summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMamadou DIOP <bossiel@yahoo.fr>2016-02-23 22:00:35 +0100
committerMamadou DIOP <bossiel@yahoo.fr>2016-02-23 22:00:35 +0100
commit50dfb4359619563012997bc3ddafb7667741066c (patch)
treedb234c1edc3240a653363b5735fc4077af4b8720
parent94b2219209038e05dd26395f6fb700be4d1062c0 (diff)
downloaddoubango-50dfb4359619563012997bc3ddafb7667741066c.zip
doubango-50dfb4359619563012997bc3ddafb7667741066c.tar.gz
Add new QoS implementation
Code formatting
-rw-r--r--.gitignore17
-rw-r--r--AStyle.sh1
-rwxr-xr-xSamples/C#/IPSec/ipsec_lib/IPSecCtx.cxx45
-rwxr-xr-xSamples/C#/IPSec/ipsec_lib/IPSecCtx.h36
-rwxr-xr-xSamples/C#/IPSec/ipsec_lib/ipsecWRAP.cxx529
-rwxr-xr-xSamples/C#/IPSec/ipsec_lib/ipsecWRAP.h8
-rwxr-xr-xSamples/C++/REGISTER/test/targetver.h4
-rwxr-xr-xandroid-utils/api.cxx2
-rwxr-xr-xandroid-utils/api.h26
-rwxr-xr-xandroid-utils/cpu-features.c87
-rwxr-xr-xandroid-utils/utils_wrap.cxx462
-rwxr-xr-xandroid-utils/utils_wrap.h8
-rwxr-xr-xbindings/_common/ActionConfig.cxx70
-rwxr-xr-xbindings/_common/ActionConfig.h36
-rwxr-xr-xbindings/_common/AudioResampler.cxx64
-rwxr-xr-xbindings/_common/AudioResampler.h36
-rwxr-xr-xbindings/_common/Common.h89
-rwxr-xr-xbindings/_common/DDebug.cxx151
-rwxr-xr-xbindings/_common/DDebug.h36
-rwxr-xr-xbindings/_common/MediaContent.cxx199
-rwxr-xr-xbindings/_common/MediaContent.h44
-rwxr-xr-xbindings/_common/MediaSessionMgr.cxx634
-rwxr-xr-xbindings/_common/MediaSessionMgr.h287
-rwxr-xr-xbindings/_common/Msrp.cxx360
-rwxr-xr-xbindings/_common/Msrp.h68
-rwxr-xr-xbindings/_common/ProxyConsumer.cxx1003
-rwxr-xr-xbindings/_common/ProxyConsumer.h268
-rwxr-xr-xbindings/_common/ProxyPluginMgr.cxx338
-rwxr-xr-xbindings/_common/ProxyPluginMgr.h107
-rwxr-xr-xbindings/_common/ProxyProducer.cxx734
-rwxr-xr-xbindings/_common/ProxyProducer.h194
-rwxr-xr-xbindings/_common/SMSEncoder.cxx497
-rwxr-xr-xbindings/_common/SMSEncoder.h98
-rwxr-xr-xbindings/_common/SafeObject.cxx14
-rwxr-xr-xbindings/_common/SafeObject.h18
-rwxr-xr-xbindings/_common/SipCallback.cxx6
-rwxr-xr-xbindings/_common/SipCallback.h48
-rwxr-xr-xbindings/_common/SipEvent.cxx128
-rwxr-xr-xbindings/_common/SipEvent.h112
-rwxr-xr-xbindings/_common/SipMessage.cxx422
-rwxr-xr-xbindings/_common/SipMessage.h60
-rwxr-xr-xbindings/_common/SipSession.cxx987
-rwxr-xr-xbindings/_common/SipSession.h368
-rwxr-xr-xbindings/_common/SipStack.cxx741
-rwxr-xr-xbindings/_common/SipStack.h144
-rwxr-xr-xbindings/_common/SipUri.cxx66
-rwxr-xr-xbindings/_common/SipUri.h38
-rwxr-xr-xbindings/_common/Xcap.cxx606
-rwxr-xr-xbindings/_common/Xcap.h144
-rwxr-xr-xbindings/_common/tinyWRAP.i1
-rwxr-xr-xbindings/_common/tinyWRAP_config.h12
-rwxr-xr-xbindings/csharp/MediaSessionMgr.cs16
-rw-r--r--bindings/csharp/QoS.cs121
-rwxr-xr-xbindings/csharp/tinyWRAPPINVOKE.cs57
-rwxr-xr-xbindings/csharp/tinyWRAP_wrap.cxx228
-rwxr-xr-xbindings/java/MediaSessionMgr.java13
-rw-r--r--bindings/java/QoS.java98
-rwxr-xr-xbindings/java/android/MediaSessionMgr.java13
-rw-r--r--bindings/java/android/QoS.java98
-rwxr-xr-xbindings/java/android/tinyWRAPJNI.java19
-rwxr-xr-xbindings/java/android/tinyWRAP_wrap.cxx282
-rwxr-xr-xbindings/java/tinyWRAPJNI.java19
-rwxr-xr-xbindings/java/tinyWRAP_wrap.cxx282
-rwxr-xr-xbindings/perl/tinyWRAP.pm49
-rwxr-xr-xbindings/perl/tinyWRAP_wrap.cxx732
-rwxr-xr-xbindings/python/tinyWRAP.py40
-rwxr-xr-xbindings/python/tinyWRAP_wrap.cxx615
-rwxr-xr-xbindings/ruby/tinyWRAP_wrap.cxx5271
-rwxr-xr-xbindings/ruby/tinyWRAP_wrap.h16
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_ActionConfig.h52
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Config.h9
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_DDebug.h54
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Enums.h609
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_MediaContent.h6
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h192
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Msrp.h149
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SMSEncoder.h6
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipCallback.h82
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipEvent.h378
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipMessage.h86
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipSession.h682
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipStack.h178
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipUri.h68
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_String.h24
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Xcap.h6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_ActionConfig.cxx36
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_DDebug.cxx62
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Enums.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_MediaContent.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx159
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Msrp.cxx109
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipCallback.cxx169
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipEvent.cxx68
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipMessage.cxx106
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipSession.cxx267
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipStack.cxx255
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipUri.cxx41
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_String.cxx50
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Xcap.cxx6
-rwxr-xr-xplugins/audio_opensles/audio_opensles.cxx866
-rwxr-xr-xplugins/audio_opensles/audio_opensles.h6
-rwxr-xr-xplugins/audio_opensles/audio_opensles_config.h14
-rwxr-xr-xplugins/audio_opensles/audio_opensles_consumer.cxx347
-rwxr-xr-xplugins/audio_opensles/audio_opensles_consumer.h8
-rwxr-xr-xplugins/audio_opensles/audio_opensles_device.cxx938
-rwxr-xr-xplugins/audio_opensles/audio_opensles_device.h132
-rwxr-xr-xplugins/audio_opensles/audio_opensles_device_impl.cxx46
-rwxr-xr-xplugins/audio_opensles/audio_opensles_device_impl.h26
-rwxr-xr-xplugins/audio_opensles/audio_opensles_producer.cxx341
-rwxr-xr-xplugins/audio_opensles/audio_opensles_producer.h6
-rwxr-xr-xplugins/audio_opensles/dllmain.cxx25
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc.cxx858
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc.h6
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_config.h52
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_consumer.cxx309
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_consumer.h8
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_producer.cxx315
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_producer.h6
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_transport.cxx34
-rwxr-xr-xplugins/audio_webrtc/audio_webrtc_transport.h57
-rwxr-xr-xplugins/audio_webrtc/dllmain.cxx25
-rwxr-xr-xplugins/pluginCUDA/dllmain_cuda.cxx100
-rwxr-xr-xplugins/pluginCUDA/plugin_cuda_codec_h264.cxx2149
-rwxr-xr-xplugins/pluginCUDA/plugin_cuda_config.h12
-rwxr-xr-xplugins/pluginCUDA/plugin_cuda_tdav.cxx6
-rwxr-xr-xplugins/pluginCUDA/plugin_cuda_utils.cxx173
-rwxr-xr-xplugins/pluginCUDA/plugin_cuda_utils.h26
-rwxr-xr-xplugins/pluginDirectShow/dllmain_dshow.cxx144
-rwxr-xr-xplugins/pluginDirectShow/internals/DSBaseCaptureGraph.h36
-rwxr-xr-xplugins/pluginDirectShow/internals/DSBufferWriter.h14
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureFormat.cxx78
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureFormat.h42
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureGraph.cxx591
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureGraph.h82
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureUtils.cxx643
-rwxr-xr-xplugins/pluginDirectShow/internals/DSCaptureUtils.h6
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDibHelper.cxx21
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplay.cxx751
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplay.h76
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayGraph.cxx470
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayGraph.h120
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayOverlay.VMR.cxx212
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayOverlay.VMR9.cxx277
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayOverlay.cxx27
-rwxr-xr-xplugins/pluginDirectShow/internals/DSDisplayOverlay.h46
-rwxr-xr-xplugins/pluginDirectShow/internals/DSFrameRateFilter.cxx129
-rwxr-xr-xplugins/pluginDirectShow/internals/DSFrameRateFilter.h50
-rwxr-xr-xplugins/pluginDirectShow/internals/DSGrabber.cxx363
-rwxr-xr-xplugins/pluginDirectShow/internals/DSGrabber.h68
-rwxr-xr-xplugins/pluginDirectShow/internals/DSOutputFilter.cxx85
-rwxr-xr-xplugins/pluginDirectShow/internals/DSOutputFilter.h116
-rwxr-xr-xplugins/pluginDirectShow/internals/DSOutputStream.cxx379
-rwxr-xr-xplugins/pluginDirectShow/internals/DSOutputStream.h102
-rwxr-xr-xplugins/pluginDirectShow/internals/DSPushSource.h156
-rwxr-xr-xplugins/pluginDirectShow/internals/DSPushSourceDesktop.cxx268
-rwxr-xr-xplugins/pluginDirectShow/internals/DSScreenCastGraph.cxx346
-rwxr-xr-xplugins/pluginDirectShow/internals/DSScreenCastGraph.h136
-rwxr-xr-xplugins/pluginDirectShow/internals/DSUtils.cxx516
-rwxr-xr-xplugins/pluginDirectShow/internals/DSUtils.h6
-rwxr-xr-xplugins/pluginDirectShow/internals/Resizer.cxx1477
-rwxr-xr-xplugins/pluginDirectShow/internals/Resizer.h16
-rwxr-xr-xplugins/pluginDirectShow/internals/VideoDisplayName.cxx12
-rwxr-xr-xplugins/pluginDirectShow/internals/VideoDisplayName.h20
-rwxr-xr-xplugins/pluginDirectShow/internals/VideoFrame.h95
-rwxr-xr-xplugins/pluginDirectShow/internals/VideoGrabberName.cxx12
-rwxr-xr-xplugins/pluginDirectShow/internals/VideoGrabberName.h20
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/CPropertyBag.cxx52
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/CPropertyBag.h33
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSISampleGrabberCB.h11
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSNullFilter.cxx12
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSNullFilter.h6
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSSampleGrabber.cxx299
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSSampleGrabber.h58
-rwxr-xr-xplugins/pluginDirectShow/internals/wince/DSSampleGrabberUtils.h20
-rwxr-xr-xplugins/pluginDirectShow/plugin_dshow_config.h12
-rwxr-xr-xplugins/pluginDirectShow/plugin_screencast_dshow_producer.cxx383
-rwxr-xr-xplugins/pluginDirectShow/plugin_video_dshow_consumer.cxx1689
-rwxr-xr-xplugins/pluginDirectShow/plugin_video_dshow_producer.cxx392
-rwxr-xr-xplugins/pluginWASAPI/dllmain_wasapi.cxx105
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_config.h12
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_consumer_audio.cxx953
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_producer_audio.cxx968
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_tdav.cxx6
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_utils.cxx76
-rwxr-xr-xplugins/pluginWASAPI/plugin_wasapi_utils.h16
-rwxr-xr-xplugins/pluginWinAudioDSP/dllmain_audio_dsp.cxx113
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_config.h12
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_denoiser.cxx556
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.cxx59
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.h8
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_resampler.cxx516
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_utils.cxx126
-rwxr-xr-xplugins/pluginWinAudioDSP/plugin_audio_dsp_utils.h44
-rwxr-xr-xplugins/pluginWinDD/dllmain_dd.cxx98
-rwxr-xr-xplugins/pluginWinDD/internals/CommonTypes.h22
-rwxr-xr-xplugins/pluginWinDD/internals/DisplayManager.cxx315
-rwxr-xr-xplugins/pluginWinDD/internals/DisplayManager.h44
-rwxr-xr-xplugins/pluginWinDD/internals/DuplicationManager.cxx393
-rwxr-xr-xplugins/pluginWinDD/internals/DuplicationManager.h40
-rwxr-xr-xplugins/pluginWinDD/internals/OutputManager.cxx503
-rwxr-xr-xplugins/pluginWinDD/internals/OutputManager.h66
-rwxr-xr-xplugins/pluginWinDD/internals/ThreadManager.cxx95
-rwxr-xr-xplugins/pluginWinDD/internals/ThreadManager.h28
-rwxr-xr-xplugins/pluginWinDD/plugin_win_dd_config.h4
-rwxr-xr-xplugins/pluginWinDD/plugin_win_dd_producer.cxx1600
-rwxr-xr-xplugins/pluginWinIPSecVista/plugin_win_ipsec_vista.c160
-rwxr-xr-xplugins/pluginWinMF/dllmain_mf.cxx235
-rwxr-xr-xplugins/pluginWinMF/internals/mf_codec.cxx1161
-rwxr-xr-xplugins/pluginWinMF/internals/mf_codec.h163
-rwxr-xr-xplugins/pluginWinMF/internals/mf_codec_topology.cxx619
-rwxr-xr-xplugins/pluginWinMF/internals/mf_codec_topology.h66
-rwxr-xr-xplugins/pluginWinMF/internals/mf_custom_src.cxx821
-rwxr-xr-xplugins/pluginWinMF/internals/mf_custom_src.h126
-rwxr-xr-xplugins/pluginWinMF/internals/mf_devices.cxx95
-rwxr-xr-xplugins/pluginWinMF/internals/mf_devices.h12
-rwxr-xr-xplugins/pluginWinMF/internals/mf_display_watcher.cxx181
-rwxr-xr-xplugins/pluginWinMF/internals/mf_display_watcher.h32
-rwxr-xr-xplugins/pluginWinMF/internals/mf_sample_grabber.cxx99
-rwxr-xr-xplugins/pluginWinMF/internals/mf_sample_grabber.h18
-rwxr-xr-xplugins/pluginWinMF/internals/mf_sample_queue.cxx75
-rwxr-xr-xplugins/pluginWinMF/internals/mf_sample_queue.h37
-rwxr-xr-xplugins/pluginWinMF/internals/mf_utils.cxx2792
-rwxr-xr-xplugins/pluginWinMF/internals/mf_utils.h383
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_codec_h264.cxx1163
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_config.h12
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_consumer_audio.cxx175
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_consumer_video.cxx2151
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_converter_video.cxx752
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_producer_audio.cxx425
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_producer_video.cxx1131
-rwxr-xr-xplugins/pluginWinMF/plugin_win_mf_tdav.cxx6
-rwxr-xr-xthirdparties/android/common/include/g729b/dtx.h62
-rwxr-xr-xthirdparties/android/common/include/g729b/ld8a.h486
-rwxr-xr-xthirdparties/android/common/include/g729b/octet.h4
-rwxr-xr-xthirdparties/android/common/include/g729b/sid.h4
-rwxr-xr-xthirdparties/android/common/include/g729b/tab_ld8a.h2
-rwxr-xr-xthirdparties/android/common/include/g729b/typedef.h2
-rwxr-xr-xthirdparties/android/common/include/g729b/vad.h20
-rwxr-xr-xthirdparties/android/common/include/gsm.h2
-rwxr-xr-xthirdparties/android/common/include/ilbc/FrameClassify.h28
-rwxr-xr-xthirdparties/android/common/include/ilbc/LPCdecode.h58
-rwxr-xr-xthirdparties/android/common/include/ilbc/LPCencode.h34
-rwxr-xr-xthirdparties/android/common/include/ilbc/StateConstructW.h32
-rwxr-xr-xthirdparties/android/common/include/ilbc/StateSearchW.h62
-rwxr-xr-xthirdparties/android/common/include/ilbc/anaFilter.h34
-rwxr-xr-xthirdparties/android/common/include/ilbc/constants.h90
-rwxr-xr-xthirdparties/android/common/include/ilbc/createCB.h68
-rwxr-xr-xthirdparties/android/common/include/ilbc/doCPLC.h40
-rwxr-xr-xthirdparties/android/common/include/ilbc/enhancer.h42
-rwxr-xr-xthirdparties/android/common/include/ilbc/filter.h74
-rwxr-xr-xthirdparties/android/common/include/ilbc/gainquant.h40
-rwxr-xr-xthirdparties/android/common/include/ilbc/getCBvec.h32
-rwxr-xr-xthirdparties/android/common/include/ilbc/helpfun.h144
-rwxr-xr-xthirdparties/android/common/include/ilbc/hpInput.h30
-rwxr-xr-xthirdparties/android/common/include/ilbc/hpOutput.h30
-rwxr-xr-xthirdparties/android/common/include/ilbc/iCBConstruct.h48
-rwxr-xr-xthirdparties/android/common/include/ilbc/iCBSearch.h48
-rwxr-xr-xthirdparties/android/common/include/ilbc/iLBC_decode.h44
-rwxr-xr-xthirdparties/android/common/include/ilbc/iLBC_define.h314
-rwxr-xr-xthirdparties/android/common/include/ilbc/iLBC_encode.h38
-rwxr-xr-xthirdparties/android/common/include/ilbc/lsf.h34
-rwxr-xr-xthirdparties/android/common/include/ilbc/packing.h66
-rwxr-xr-xthirdparties/android/common/include/ilbc/syntFilter.h30
-rwxr-xr-xthirdparties/android/common/include/libavcodec/avcodec.h80
-rwxr-xr-xthirdparties/android/common/include/libavcodec/old_codec_ids.h702
-rwxr-xr-xthirdparties/android/common/include/libavcodec/vdpau.h12
-rwxr-xr-xthirdparties/android/common/include/libavcodec/xvmc.h4
-rwxr-xr-xthirdparties/android/common/include/libavfilter/avcodec.h10
-rwxr-xr-xthirdparties/android/common/include/libavfilter/avfilter.h24
-rwxr-xr-xthirdparties/android/common/include/libavformat/avformat.h16
-rwxr-xr-xthirdparties/android/common/include/libavformat/avio.h32
-rwxr-xr-xthirdparties/android/common/include/libavutil/avstring.h6
-rwxr-xr-xthirdparties/android/common/include/libavutil/base64.h6
-rwxr-xr-xthirdparties/android/common/include/libavutil/bprint.h12
-rwxr-xr-xthirdparties/android/common/include/libavutil/common.h100
-rwxr-xr-xthirdparties/android/common/include/libavutil/cpu.h2
-rwxr-xr-xthirdparties/android/common/include/libavutil/crc.h2
-rwxr-xr-xthirdparties/android/common/include/libavutil/fifo.h6
-rwxr-xr-xthirdparties/android/common/include/libavutil/intreadwrite.h12
-rwxr-xr-xthirdparties/android/common/include/libavutil/lfg.h6
-rwxr-xr-xthirdparties/android/common/include/libavutil/log.h2
-rwxr-xr-xthirdparties/android/common/include/libavutil/mem.h37
-rwxr-xr-xthirdparties/android/common/include/libavutil/old_pix_fmts.h248
-rwxr-xr-xthirdparties/android/common/include/libavutil/opt.h2
-rwxr-xr-xthirdparties/android/common/include/libavutil/pixdesc.h8
-rwxr-xr-xthirdparties/android/common/include/libavutil/rational.h24
-rwxr-xr-xthirdparties/android/common/include/libavutil/timestamp.h16
-rwxr-xr-xthirdparties/android/common/include/libswresample/swresample.h2
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/compare.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/convert.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/convert_argb.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/convert_from.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/convert_from_argb.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/cpu_id.h10
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/format_conversion.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/mjpeg_decoder.h282
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/planar_functions.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/rotate.h24
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/rotate_argb.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/row.h2065
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/scale.h42
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/scale_argb.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/scale_row.h3
-rwxr-xr-xthirdparties/android/common/include/libyuv/libyuv/video_common.h249
-rwxr-xr-xthirdparties/android/common/include/opencore-amrnb/interf_enc.h20
-rwxr-xr-xthirdparties/android/common/include/opus/opus.h12
-rwxr-xr-xthirdparties/android/common/include/opus/opus_multistream.h70
-rwxr-xr-xthirdparties/android/common/include/opus/opus_types.h134
-rwxr-xr-xthirdparties/android/common/include/speex/speex.h84
-rwxr-xr-xthirdparties/android/common/include/speex/speex_bits.h44
-rwxr-xr-xthirdparties/android/common/include/speex/speex_buffer.h2
-rwxr-xr-xthirdparties/android/common/include/speex/speex_callbacks.h18
-rwxr-xr-xthirdparties/android/common/include/speex/speex_echo.h10
-rwxr-xr-xthirdparties/android/common/include/speex/speex_header.h38
-rwxr-xr-xthirdparties/android/common/include/speex/speex_jitter.h52
-rwxr-xr-xthirdparties/android/common/include/speex/speex_preprocess.h12
-rwxr-xr-xthirdparties/android/common/include/speex/speex_resampler.h156
-rwxr-xr-xthirdparties/android/common/include/speex/speex_stereo.h20
-rwxr-xr-xthirdparties/android/common/include/speex/speex_types.h122
-rwxr-xr-xthirdparties/android/common/include/srtp/aes.h28
-rwxr-xr-xthirdparties/android/common/include/srtp/aes_cbc.h26
-rwxr-xr-xthirdparties/android/common/include/srtp/aes_icm.h42
-rwxr-xr-xthirdparties/android/common/include/srtp/alloc.h14
-rwxr-xr-xthirdparties/android/common/include/srtp/auth.h76
-rwxr-xr-xthirdparties/android/common/include/srtp/cipher.h102
-rwxr-xr-xthirdparties/android/common/include/srtp/crypto.h10
-rwxr-xr-xthirdparties/android/common/include/srtp/crypto_kernel.h94
-rwxr-xr-xthirdparties/android/common/include/srtp/crypto_math.h30
-rwxr-xr-xthirdparties/android/common/include/srtp/crypto_types.h74
-rwxr-xr-xthirdparties/android/common/include/srtp/cryptoalg.h70
-rwxr-xr-xthirdparties/android/common/include/srtp/datatypes.h88
-rwxr-xr-xthirdparties/android/common/include/srtp/ekt.h88
-rwxr-xr-xthirdparties/android/common/include/srtp/err.h90
-rwxr-xr-xthirdparties/android/common/include/srtp/getopt_s.h16
-rwxr-xr-xthirdparties/android/common/include/srtp/gf2_8.h20
-rwxr-xr-xthirdparties/android/common/include/srtp/hmac.h20
-rwxr-xr-xthirdparties/android/common/include/srtp/integers.h16
-rwxr-xr-xthirdparties/android/common/include/srtp/kernel_compat.h20
-rwxr-xr-xthirdparties/android/common/include/srtp/key.h32
-rwxr-xr-xthirdparties/android/common/include/srtp/null_auth.h16
-rwxr-xr-xthirdparties/android/common/include/srtp/null_cipher.h20
-rwxr-xr-xthirdparties/android/common/include/srtp/prng.h14
-rwxr-xr-xthirdparties/android/common/include/srtp/rand_source.h18
-rwxr-xr-xthirdparties/android/common/include/srtp/rdb.h16
-rwxr-xr-xthirdparties/android/common/include/srtp/rdbx.h26
-rwxr-xr-xthirdparties/android/common/include/srtp/rtp.h44
-rwxr-xr-xthirdparties/android/common/include/srtp/rtp_priv.h32
-rwxr-xr-xthirdparties/android/common/include/srtp/sha1.h30
-rwxr-xr-xthirdparties/android/common/include/srtp/srtp.h357
-rwxr-xr-xthirdparties/android/common/include/srtp/srtp_priv.h170
-rwxr-xr-xthirdparties/android/common/include/srtp/stat.h14
-rwxr-xr-xthirdparties/android/common/include/srtp/ut_sim.h18
-rwxr-xr-xthirdparties/android/common/include/srtp/xfm.h112
-rwxr-xr-xthirdparties/android/common/include/vpx/svc_context.h45
-rwxr-xr-xthirdparties/android/common/include/vpx/vp8.h66
-rwxr-xr-xthirdparties/android/common/include/vpx/vp8cx.h194
-rwxr-xr-xthirdparties/android/common/include/vpx/vp8dx.h36
-rwxr-xr-xthirdparties/android/common/include/vpx/vp8e.h3
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_codec.h658
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_decoder.h520
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_decoder_compat.h937
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_encoder.h808
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_frame_buffer.h6
-rwxr-xr-xthirdparties/android/common/include/vpx/vpx_image.h223
-rwxr-xr-xthirdparties/android/common/include/x264.h56
-rwxr-xr-xthirdparties/common/include/faac.h22
-rwxr-xr-xthirdparties/common/include/faaccfg.h39
-rwxr-xr-xthirdparties/common/include/gsm.h2
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/config/ftconfig.h500
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/config/ftheader.h1200
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/config/ftoption.h1274
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/config/ftstdlib.h122
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/freetype.h7106
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftadvanc.h262
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftautoh.h574
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftbbox.h104
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftbdf.h314
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftbitmap.h368
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftbzip2.h116
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftcache.h2030
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftcffdrv.h208
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftcid.h252
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/fterrdef.h456
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/fterrors.h188
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftgasp.h164
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftglyph.h1084
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftgxval.h510
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftgzip.h116
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftimage.h2113
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftincrem.h595
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftlcdfil.h403
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftlist.h464
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftlzw.h112
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftmac.h408
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftmm.h617
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftmodapi.h1102
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftmoderr.h242
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftotval.h272
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftoutln.h1009
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftpfr.h260
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftrender.h296
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftsizes.h228
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftsnames.h281
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftstroke.h1391
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftsynth.h74
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftsystem.h575
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/fttrigon.h588
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/fttypes.h1016
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftwinfnt.h321
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ftxf86.h84
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/t1tables.h747
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ttnameid.h1044
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/tttables.h1094
-rwxr-xr-xthirdparties/common/include/libfreetype/freetype2/freetype/ttunpat.h24
-rwxr-xr-xthirdparties/common/include/libfreetype/ft2build.h64
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/DOCBparser.h60
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/HTMLparser.h232
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/HTMLtree.h106
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/SAX.h190
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/SAX2.h214
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/c14n.h59
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/catalog.h109
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/chvalid.h18
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/debugXML.h160
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/dict.h40
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/encoding.h81
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/entities.h89
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/globals.h81
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/hash.h172
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/list.h84
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/nanoftp.h92
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/nanohttp.h72
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/parser.h540
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/parserInternals.h272
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/pattern.h52
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/relaxng.h106
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/schemasInternals.h13
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/schematron.h35
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/threads.h30
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/tree.h724
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/uri.h46
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/valid.h360
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xinclude.h36
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xlink.h58
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlIO.h194
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlautomata.h146
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlerror.h103
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlexports.h172
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlmemory.h68
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlmodule.h6
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlreader.h335
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlregexp.h152
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlsave.h61
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlschemas.h183
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlschemastypes.h179
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlstring.h134
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlversion.h2
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xmlwriter.h684
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xpath.h118
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xpathInternals.h266
-rwxr-xr-xthirdparties/common/include/libxml2/libxml/xpointer.h76
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/compare.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/convert.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/convert_argb.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/convert_from.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/cpu_id.h12
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/format_conversion.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h274
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/planar_functions.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/rotate.h21
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/rotate_argb.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/scale.h9
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/scale_argb.h3
-rwxr-xr-xthirdparties/common/include/libyuv/libyuv/video_common.h207
-rwxr-xr-xthirdparties/common/include/ogg/ogg.h86
-rwxr-xr-xthirdparties/common/include/ogg/os_types.h148
-rwxr-xr-xthirdparties/common/include/openssl/asn1.h24
-rwxr-xr-xthirdparties/common/include/openssl/bio.h6
-rwxr-xr-xthirdparties/common/include/openssl/bn.h12
-rwxr-xr-xthirdparties/common/include/openssl/cms.h40
-rwxr-xr-xthirdparties/common/include/openssl/conf_api.h2
-rwxr-xr-xthirdparties/common/include/openssl/crypto.h46
-rwxr-xr-xthirdparties/common/include/openssl/dsa.h4
-rwxr-xr-xthirdparties/common/include/openssl/dso.h2
-rwxr-xr-xthirdparties/common/include/openssl/ec.h61
-rwxr-xr-xthirdparties/common/include/openssl/ecdh.h2
-rwxr-xr-xthirdparties/common/include/openssl/ecdsa.h20
-rwxr-xr-xthirdparties/common/include/openssl/engine.h50
-rwxr-xr-xthirdparties/common/include/openssl/err.h2
-rwxr-xr-xthirdparties/common/include/openssl/evp.h128
-rwxr-xr-xthirdparties/common/include/openssl/ocsp.h40
-rwxr-xr-xthirdparties/common/include/openssl/opensslconf.h8
-rwxr-xr-xthirdparties/common/include/openssl/ossl_typ.h2
-rwxr-xr-xthirdparties/common/include/openssl/pem.h22
-rwxr-xr-xthirdparties/common/include/openssl/pkcs12.h12
-rwxr-xr-xthirdparties/common/include/openssl/pkcs7.h4
-rwxr-xr-xthirdparties/common/include/openssl/rsa.h4
-rwxr-xr-xthirdparties/common/include/openssl/srp.h2
-rwxr-xr-xthirdparties/common/include/openssl/ssl.h230
-rwxr-xr-xthirdparties/common/include/openssl/ssl2.h2
-rwxr-xr-xthirdparties/common/include/openssl/ssl3.h16
-rwxr-xr-xthirdparties/common/include/openssl/stack.h2
-rwxr-xr-xthirdparties/common/include/openssl/ts.h6
-rwxr-xr-xthirdparties/common/include/openssl/ui.h12
-rwxr-xr-xthirdparties/common/include/openssl/x509.h84
-rwxr-xr-xthirdparties/common/include/openssl/x509_vfy.h24
-rwxr-xr-xthirdparties/common/include/openssl/x509v3.h24
-rwxr-xr-xthirdparties/common/include/opus/opus.h12
-rwxr-xr-xthirdparties/common/include/opus/opus_multistream.h70
-rwxr-xr-xthirdparties/common/include/opus/opus_types.h134
-rwxr-xr-xthirdparties/common/include/speex/speex.h84
-rwxr-xr-xthirdparties/common/include/speex/speex_bits.h44
-rwxr-xr-xthirdparties/common/include/speex/speex_buffer.h2
-rwxr-xr-xthirdparties/common/include/speex/speex_callbacks.h18
-rwxr-xr-xthirdparties/common/include/speex/speex_echo.h10
-rwxr-xr-xthirdparties/common/include/speex/speex_header.h38
-rwxr-xr-xthirdparties/common/include/speex/speex_jitter.h52
-rwxr-xr-xthirdparties/common/include/speex/speex_preprocess.h12
-rwxr-xr-xthirdparties/common/include/speex/speex_resampler.h156
-rwxr-xr-xthirdparties/common/include/speex/speex_stereo.h20
-rwxr-xr-xthirdparties/common/include/speex/speex_types.h114
-rwxr-xr-xthirdparties/common/include/theora/codec.h351
-rwxr-xr-xthirdparties/common/include/theora/theora.h206
-rwxr-xr-xthirdparties/common/include/theora/theoradec.h28
-rwxr-xr-xthirdparties/common/include/theora/theoraenc.h6
-rwxr-xr-xthirdparties/common/include/vorbis/codec.h188
-rwxr-xr-xthirdparties/common/include/vorbis/vorbisenc.h98
-rwxr-xr-xthirdparties/common/include/vorbis/vorbisfile.h113
-rwxr-xr-xthirdparties/common/include/webrtc/gain_control.h9
-rwxr-xr-xthirdparties/common/include/wels/codec_api.h228
-rwxr-xr-xthirdparties/common/include/wels/codec_app_def.h502
-rwxr-xr-xthirdparties/common/include/wels/codec_def.h178
-rwxr-xr-xthirdparties/iphone/include/g729b/dtx.h62
-rwxr-xr-xthirdparties/iphone/include/g729b/ld8a.h486
-rwxr-xr-xthirdparties/iphone/include/g729b/octet.h4
-rwxr-xr-xthirdparties/iphone/include/g729b/sid.h4
-rwxr-xr-xthirdparties/iphone/include/g729b/tab_ld8a.h2
-rwxr-xr-xthirdparties/iphone/include/g729b/vad.h20
-rwxr-xr-xthirdparties/iphone/include/gsm.h2
-rwxr-xr-xthirdparties/iphone/include/libavcodec/avcodec.h80
-rwxr-xr-xthirdparties/iphone/include/libavcodec/old_codec_ids.h702
-rwxr-xr-xthirdparties/iphone/include/libavcodec/opt.h18
-rwxr-xr-xthirdparties/iphone/include/libavcodec/xvmc.h4
-rwxr-xr-xthirdparties/iphone/include/libavfilter/avcodec.h10
-rwxr-xr-xthirdparties/iphone/include/libavfilter/avfilter.h12
-rwxr-xr-xthirdparties/iphone/include/libavformat/avformat.h16
-rwxr-xr-xthirdparties/iphone/include/libavformat/avio.h32
-rwxr-xr-xthirdparties/iphone/include/libavutil/avstring.h6
-rwxr-xr-xthirdparties/iphone/include/libavutil/base64.h6
-rwxr-xr-xthirdparties/iphone/include/libavutil/bprint.h12
-rwxr-xr-xthirdparties/iphone/include/libavutil/common.h76
-rwxr-xr-xthirdparties/iphone/include/libavutil/cpu.h2
-rwxr-xr-xthirdparties/iphone/include/libavutil/crc.h2
-rwxr-xr-xthirdparties/iphone/include/libavutil/fifo.h6
-rwxr-xr-xthirdparties/iphone/include/libavutil/intreadwrite.h12
-rwxr-xr-xthirdparties/iphone/include/libavutil/lfg.h6
-rwxr-xr-xthirdparties/iphone/include/libavutil/log.h2
-rwxr-xr-xthirdparties/iphone/include/libavutil/mem.h37
-rwxr-xr-xthirdparties/iphone/include/libavutil/opt.h2
-rwxr-xr-xthirdparties/iphone/include/libavutil/pixdesc.h8
-rwxr-xr-xthirdparties/iphone/include/libavutil/rational.h24
-rwxr-xr-xthirdparties/iphone/include/libavutil/timestamp.h16
-rwxr-xr-xthirdparties/iphone/include/libswresample/swresample.h2
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/compare.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/convert.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/convert_argb.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/convert_from.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/convert_from_argb.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/cpu_id.h10
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/format_conversion.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/mjpeg_decoder.h256
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/planar_functions.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/rotate.h24
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/rotate_argb.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/row.h1933
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/scale.h42
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/scale_argb.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/scale_row.h3
-rwxr-xr-xthirdparties/iphone/include/libyuv/libyuv/video_common.h249
-rwxr-xr-xthirdparties/iphone/include/net/_route.h108
-rwxr-xr-xthirdparties/iphone/include/opencore-amrnb/interf_enc.h20
-rwxr-xr-xthirdparties/iphone/include/speex/speex.h84
-rwxr-xr-xthirdparties/iphone/include/speex/speex_bits.h44
-rwxr-xr-xthirdparties/iphone/include/speex/speex_buffer.h2
-rwxr-xr-xthirdparties/iphone/include/speex/speex_callbacks.h18
-rwxr-xr-xthirdparties/iphone/include/speex/speex_echo.h10
-rwxr-xr-xthirdparties/iphone/include/speex/speex_header.h38
-rwxr-xr-xthirdparties/iphone/include/speex/speex_jitter.h52
-rwxr-xr-xthirdparties/iphone/include/speex/speex_preprocess.h12
-rwxr-xr-xthirdparties/iphone/include/speex/speex_resampler.h156
-rwxr-xr-xthirdparties/iphone/include/speex/speex_stereo.h20
-rwxr-xr-xthirdparties/iphone/include/speex/speex_types.h122
-rwxr-xr-xthirdparties/iphone/include/srtp/aes.h28
-rwxr-xr-xthirdparties/iphone/include/srtp/aes_cbc.h26
-rwxr-xr-xthirdparties/iphone/include/srtp/aes_icm.h42
-rwxr-xr-xthirdparties/iphone/include/srtp/alloc.h14
-rwxr-xr-xthirdparties/iphone/include/srtp/auth.h76
-rwxr-xr-xthirdparties/iphone/include/srtp/cipher.h102
-rwxr-xr-xthirdparties/iphone/include/srtp/crypto.h10
-rwxr-xr-xthirdparties/iphone/include/srtp/crypto_kernel.h94
-rwxr-xr-xthirdparties/iphone/include/srtp/crypto_math.h30
-rwxr-xr-xthirdparties/iphone/include/srtp/crypto_types.h74
-rwxr-xr-xthirdparties/iphone/include/srtp/cryptoalg.h70
-rwxr-xr-xthirdparties/iphone/include/srtp/datatypes.h88
-rwxr-xr-xthirdparties/iphone/include/srtp/ekt.h88
-rwxr-xr-xthirdparties/iphone/include/srtp/err.h90
-rwxr-xr-xthirdparties/iphone/include/srtp/getopt_s.h16
-rwxr-xr-xthirdparties/iphone/include/srtp/gf2_8.h20
-rwxr-xr-xthirdparties/iphone/include/srtp/hmac.h20
-rwxr-xr-xthirdparties/iphone/include/srtp/integers.h16
-rwxr-xr-xthirdparties/iphone/include/srtp/kernel_compat.h20
-rwxr-xr-xthirdparties/iphone/include/srtp/key.h32
-rwxr-xr-xthirdparties/iphone/include/srtp/null_auth.h16
-rwxr-xr-xthirdparties/iphone/include/srtp/null_cipher.h20
-rwxr-xr-xthirdparties/iphone/include/srtp/prng.h14
-rwxr-xr-xthirdparties/iphone/include/srtp/rand_source.h18
-rwxr-xr-xthirdparties/iphone/include/srtp/rdb.h16
-rwxr-xr-xthirdparties/iphone/include/srtp/rdbx.h26
-rwxr-xr-xthirdparties/iphone/include/srtp/rtp.h44
-rwxr-xr-xthirdparties/iphone/include/srtp/rtp_priv.h32
-rwxr-xr-xthirdparties/iphone/include/srtp/sha1.h30
-rwxr-xr-xthirdparties/iphone/include/srtp/srtp.h341
-rwxr-xr-xthirdparties/iphone/include/srtp/srtp_priv.h170
-rwxr-xr-xthirdparties/iphone/include/srtp/stat.h14
-rwxr-xr-xthirdparties/iphone/include/srtp/ut_sim.h18
-rwxr-xr-xthirdparties/iphone/include/srtp/xfm.h112
-rwxr-xr-xthirdparties/iphone/include/vpx/svc_context.h43
-rwxr-xr-xthirdparties/iphone/include/vpx/vp8.h66
-rwxr-xr-xthirdparties/iphone/include/vpx/vp8cx.h552
-rwxr-xr-xthirdparties/iphone/include/vpx/vp8dx.h88
-rwxr-xr-xthirdparties/iphone/include/vpx/vpx_codec.h548
-rwxr-xr-xthirdparties/iphone/include/vpx/vpx_decoder.h602
-rwxr-xr-xthirdparties/iphone/include/vpx/vpx_encoder.h840
-rwxr-xr-xthirdparties/iphone/include/vpx/vpx_frame_buffer.h6
-rwxr-xr-xthirdparties/iphone/include/vpx/vpx_image.h217
-rwxr-xr-xthirdparties/mac/include/libavcodec/avcodec.h80
-rwxr-xr-xthirdparties/mac/include/libavcodec/old_codec_ids.h702
-rwxr-xr-xthirdparties/mac/include/libavcodec/vdpau.h12
-rwxr-xr-xthirdparties/mac/include/libavcodec/xvmc.h4
-rwxr-xr-xthirdparties/mac/include/libavfilter/avcodec.h10
-rwxr-xr-xthirdparties/mac/include/libavfilter/avfilter.h24
-rwxr-xr-xthirdparties/mac/include/libavformat/avformat.h16
-rwxr-xr-xthirdparties/mac/include/libavformat/avio.h32
-rwxr-xr-xthirdparties/mac/include/libavutil/avstring.h6
-rwxr-xr-xthirdparties/mac/include/libavutil/base64.h6
-rwxr-xr-xthirdparties/mac/include/libavutil/bprint.h12
-rwxr-xr-xthirdparties/mac/include/libavutil/common.h100
-rwxr-xr-xthirdparties/mac/include/libavutil/cpu.h2
-rwxr-xr-xthirdparties/mac/include/libavutil/crc.h2
-rwxr-xr-xthirdparties/mac/include/libavutil/fifo.h6
-rwxr-xr-xthirdparties/mac/include/libavutil/intreadwrite.h12
-rwxr-xr-xthirdparties/mac/include/libavutil/lfg.h6
-rwxr-xr-xthirdparties/mac/include/libavutil/log.h2
-rwxr-xr-xthirdparties/mac/include/libavutil/mem.h37
-rwxr-xr-xthirdparties/mac/include/libavutil/old_pix_fmts.h248
-rwxr-xr-xthirdparties/mac/include/libavutil/opt.h2
-rwxr-xr-xthirdparties/mac/include/libavutil/pixdesc.h8
-rwxr-xr-xthirdparties/mac/include/libavutil/rational.h24
-rwxr-xr-xthirdparties/mac/include/libavutil/timestamp.h16
-rwxr-xr-xthirdparties/mac/include/libswresample/swresample.h2
-rwxr-xr-xthirdparties/mac/include/opus/opus.h12
-rwxr-xr-xthirdparties/mac/include/opus/opus_multistream.h106
-rwxr-xr-xthirdparties/mac/include/opus/opus_types.h134
-rwxr-xr-xthirdparties/mac/include/speex/speex.h84
-rwxr-xr-xthirdparties/mac/include/speex/speex_bits.h44
-rwxr-xr-xthirdparties/mac/include/speex/speex_buffer.h2
-rwxr-xr-xthirdparties/mac/include/speex/speex_callbacks.h18
-rwxr-xr-xthirdparties/mac/include/speex/speex_echo.h10
-rwxr-xr-xthirdparties/mac/include/speex/speex_header.h38
-rwxr-xr-xthirdparties/mac/include/speex/speex_jitter.h52
-rwxr-xr-xthirdparties/mac/include/speex/speex_preprocess.h12
-rwxr-xr-xthirdparties/mac/include/speex/speex_resampler.h156
-rwxr-xr-xthirdparties/mac/include/speex/speex_stereo.h20
-rwxr-xr-xthirdparties/mac/include/speex/speex_types.h114
-rwxr-xr-xthirdparties/mac/include/srtp/aes.h28
-rwxr-xr-xthirdparties/mac/include/srtp/aes_cbc.h42
-rwxr-xr-xthirdparties/mac/include/srtp/aes_gcm_ossl.h22
-rwxr-xr-xthirdparties/mac/include/srtp/aes_icm.h54
-rwxr-xr-xthirdparties/mac/include/srtp/alloc.h14
-rwxr-xr-xthirdparties/mac/include/srtp/auth.h76
-rwxr-xr-xthirdparties/mac/include/srtp/cipher.h122
-rwxr-xr-xthirdparties/mac/include/srtp/crypto.h22
-rwxr-xr-xthirdparties/mac/include/srtp/crypto_kernel.h96
-rwxr-xr-xthirdparties/mac/include/srtp/crypto_math.h30
-rwxr-xr-xthirdparties/mac/include/srtp/crypto_types.h102
-rwxr-xr-xthirdparties/mac/include/srtp/cryptoalg.h70
-rwxr-xr-xthirdparties/mac/include/srtp/datatypes.h90
-rwxr-xr-xthirdparties/mac/include/srtp/ekt.h88
-rwxr-xr-xthirdparties/mac/include/srtp/err.h90
-rwxr-xr-xthirdparties/mac/include/srtp/getopt_s.h16
-rwxr-xr-xthirdparties/mac/include/srtp/gf2_8.h20
-rwxr-xr-xthirdparties/mac/include/srtp/hmac.h24
-rwxr-xr-xthirdparties/mac/include/srtp/integers.h16
-rwxr-xr-xthirdparties/mac/include/srtp/kernel_compat.h20
-rwxr-xr-xthirdparties/mac/include/srtp/key.h32
-rwxr-xr-xthirdparties/mac/include/srtp/null_auth.h16
-rwxr-xr-xthirdparties/mac/include/srtp/null_cipher.h20
-rwxr-xr-xthirdparties/mac/include/srtp/prng.h26
-rwxr-xr-xthirdparties/mac/include/srtp/rand_source.h18
-rwxr-xr-xthirdparties/mac/include/srtp/rdb.h28
-rwxr-xr-xthirdparties/mac/include/srtp/rdbx.h38
-rwxr-xr-xthirdparties/mac/include/srtp/rtp.h44
-rwxr-xr-xthirdparties/mac/include/srtp/rtp_priv.h32
-rwxr-xr-xthirdparties/mac/include/srtp/sha1.h32
-rwxr-xr-xthirdparties/mac/include/srtp/srtp.h427
-rwxr-xr-xthirdparties/mac/include/srtp/srtp_priv.h176
-rwxr-xr-xthirdparties/mac/include/srtp/stat.h14
-rwxr-xr-xthirdparties/mac/include/srtp/ut_sim.h18
-rwxr-xr-xthirdparties/mac/include/srtp/xfm.h124
-rwxr-xr-xthirdparties/mac/include/vpx/vp8.h15
-rwxr-xr-xthirdparties/mac/include/vpx/vp8cx.h24
-rwxr-xr-xthirdparties/mac/include/vpx/vp8dx.h3
-rwxr-xr-xthirdparties/mac/include/vpx/vp8e.h3
-rwxr-xr-xthirdparties/mac/include/vpx/vpx_codec.h739
-rwxr-xr-xthirdparties/mac/include/vpx/vpx_decoder.h534
-rwxr-xr-xthirdparties/mac/include/vpx/vpx_decoder_compat.h937
-rwxr-xr-xthirdparties/mac/include/vpx/vpx_encoder.h1409
-rwxr-xr-xthirdparties/mac/include/vpx/vpx_image.h314
-rwxr-xr-xthirdparties/mac/include/webrtc/echo_cancellation.h36
-rwxr-xr-xthirdparties/s60/include/curl/curl.h1776
-rwxr-xr-xthirdparties/s60/include/curl/curlbuild.h26
-rwxr-xr-xthirdparties/s60/include/curl/curlrules.h46
-rwxr-xr-xthirdparties/s60/include/curl/multi.h172
-rwxr-xr-xthirdparties/s60/include/curl/stdcheaders.h10
-rwxr-xr-xthirdparties/s60/include/curl/typecheck-gcc.h72
-rwxr-xr-xthirdparties/s60/include/libxml/DOCBparser.h78
-rwxr-xr-xthirdparties/s60/include/libxml/HTMLparser.h276
-rwxr-xr-xthirdparties/s60/include/libxml/HTMLtree.h140
-rwxr-xr-xthirdparties/s60/include/libxml/SAX.h256
-rwxr-xr-xthirdparties/s60/include/libxml/SAX2.h262
-rwxr-xr-xthirdparties/s60/include/libxml/c14n.h61
-rwxr-xr-xthirdparties/s60/include/libxml/catalog.h179
-rwxr-xr-xthirdparties/s60/include/libxml/chvalid.h18
-rwxr-xr-xthirdparties/s60/include/libxml/debugXML.h210
-rwxr-xr-xthirdparties/s60/include/libxml/dict.h44
-rwxr-xr-xthirdparties/s60/include/libxml/encoding.h103
-rwxr-xr-xthirdparties/s60/include/libxml/entities.h87
-rwxr-xr-xthirdparties/s60/include/libxml/globals.h81
-rwxr-xr-xthirdparties/s60/include/libxml/hash.h218
-rwxr-xr-xthirdparties/s60/include/libxml/list.h136
-rwxr-xr-xthirdparties/s60/include/libxml/nanoftp.h140
-rwxr-xr-xthirdparties/s60/include/libxml/nanohttp.h98
-rwxr-xr-xthirdparties/s60/include/libxml/parser.h672
-rwxr-xr-xthirdparties/s60/include/libxml/parserInternals.h408
-rwxr-xr-xthirdparties/s60/include/libxml/pattern.h52
-rwxr-xr-xthirdparties/s60/include/libxml/relaxng.h106
-rwxr-xr-xthirdparties/s60/include/libxml/schemasInternals.h17
-rwxr-xr-xthirdparties/s60/include/libxml/schematron.h55
-rwxr-xr-xthirdparties/s60/include/libxml/threads.h30
-rwxr-xr-xthirdparties/s60/include/libxml/tree.h1012
-rwxr-xr-xthirdparties/s60/include/libxml/uri.h46
-rwxr-xr-xthirdparties/s60/include/libxml/valid.h506
-rwxr-xr-xthirdparties/s60/include/libxml/xinclude.h36
-rwxr-xr-xthirdparties/s60/include/libxml/xlink.h72
-rwxr-xr-xthirdparties/s60/include/libxml/xmlIO.h290
-rwxr-xr-xthirdparties/s60/include/libxml/xmlautomata.h182
-rwxr-xr-xthirdparties/s60/include/libxml/xmlerror.h103
-rwxr-xr-xthirdparties/s60/include/libxml/xmlexports.h174
-rwxr-xr-xthirdparties/s60/include/libxml/xmlmemory.h68
-rwxr-xr-xthirdparties/s60/include/libxml/xmlmodule.h8
-rwxr-xr-xthirdparties/s60/include/libxml/xmlreader.h329
-rwxr-xr-xthirdparties/s60/include/libxml/xmlregexp.h152
-rwxr-xr-xthirdparties/s60/include/libxml/xmlsave.h59
-rwxr-xr-xthirdparties/s60/include/libxml/xmlschemas.h167
-rwxr-xr-xthirdparties/s60/include/libxml/xmlschemastypes.h199
-rwxr-xr-xthirdparties/s60/include/libxml/xmlstring.h140
-rwxr-xr-xthirdparties/s60/include/libxml/xmlversion.h2
-rwxr-xr-xthirdparties/s60/include/libxml/xmlwriter.h680
-rwxr-xr-xthirdparties/s60/include/libxml/xpath.h194
-rwxr-xr-xthirdparties/s60/include/libxml/xpathInternals.h412
-rwxr-xr-xthirdparties/s60/include/libxml/xpointer.h120
-rwxr-xr-xthirdparties/s60/include/smc/statemap.h16
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/bv16.h22
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/bv16cnst.h4
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/bv16externs.h138
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/bv16strct.h108
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/g192.h2
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bv16/postfilt.h12
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bvcommon/bvcommon.h86
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bvcommon/mathutil.h16
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bvcommon/typedef.h2
-rwxr-xr-xthirdparties/win32/include/BroadVoice16/bvcommon/utility.h2
-rwxr-xr-xthirdparties/win32/include/cuda/types.h189
-rwxr-xr-xthirdparties/win32/include/curl/curl.h1776
-rwxr-xr-xthirdparties/win32/include/curl/curlbuild.h20
-rwxr-xr-xthirdparties/win32/include/curl/curlrules.h46
-rwxr-xr-xthirdparties/win32/include/curl/multi.h172
-rwxr-xr-xthirdparties/win32/include/curl/stdcheaders.h10
-rwxr-xr-xthirdparties/win32/include/curl/typecheck-gcc.h72
-rwxr-xr-xthirdparties/win32/include/directshow/amextra.h2
-rwxr-xr-xthirdparties/win32/include/directshow/amfilter.h185
-rwxr-xr-xthirdparties/win32/include/directshow/cache.h7
-rwxr-xr-xthirdparties/win32/include/directshow/checkbmi.h14
-rwxr-xr-xthirdparties/win32/include/directshow/combase.h18
-rwxr-xr-xthirdparties/win32/include/directshow/cprop.h34
-rwxr-xr-xthirdparties/win32/include/directshow/ctlutil.h278
-rwxr-xr-xthirdparties/win32/include/directshow/ddmm.h2
-rwxr-xr-xthirdparties/win32/include/directshow/dllsetup.h4
-rwxr-xr-xthirdparties/win32/include/directshow/dsschedule.h38
-rwxr-xr-xthirdparties/win32/include/directshow/dxmperf.h10
-rwxr-xr-xthirdparties/win32/include/directshow/fourcc.h6
-rwxr-xr-xthirdparties/win32/include/directshow/msgthrd.h21
-rwxr-xr-xthirdparties/win32/include/directshow/mtype.h31
-rwxr-xr-xthirdparties/win32/include/directshow/outputq.h30
-rwxr-xr-xthirdparties/win32/include/directshow/perflog.h12
-rwxr-xr-xthirdparties/win32/include/directshow/perfstruct.h22
-rwxr-xr-xthirdparties/win32/include/directshow/pstream.h85
-rwxr-xr-xthirdparties/win32/include/directshow/pullpin.h38
-rwxr-xr-xthirdparties/win32/include/directshow/refclock.h16
-rwxr-xr-xthirdparties/win32/include/directshow/reftime.h30
-rwxr-xr-xthirdparties/win32/include/directshow/renbase.h85
-rwxr-xr-xthirdparties/win32/include/directshow/schedule.h38
-rwxr-xr-xthirdparties/win32/include/directshow/source.h58
-rwxr-xr-xthirdparties/win32/include/directshow/streams.h62
-rwxr-xr-xthirdparties/win32/include/directshow/strmctl.h57
-rwxr-xr-xthirdparties/win32/include/directshow/transfrm.h41
-rwxr-xr-xthirdparties/win32/include/directshow/transip.h47
-rwxr-xr-xthirdparties/win32/include/directshow/vtrans.h10
-rwxr-xr-xthirdparties/win32/include/directshow/winctrl.h29
-rwxr-xr-xthirdparties/win32/include/directshow/winutil.h25
-rwxr-xr-xthirdparties/win32/include/directshow/wxdebug.h265
-rwxr-xr-xthirdparties/win32/include/directshow/wxlist.h208
-rwxr-xr-xthirdparties/win32/include/directshow/wxutil.h152
-rwxr-xr-xthirdparties/win32/include/g729a/LD8A.H474
-rwxr-xr-xthirdparties/win32/include/g729b/dtx.h62
-rwxr-xr-xthirdparties/win32/include/g729b/ld8a.h486
-rwxr-xr-xthirdparties/win32/include/g729b/octet.h4
-rwxr-xr-xthirdparties/win32/include/g729b/sid.h4
-rwxr-xr-xthirdparties/win32/include/g729b/tab_ld8a.h2
-rwxr-xr-xthirdparties/win32/include/g729b/vad.h20
-rwxr-xr-xthirdparties/win32/include/ilbc/FrameClassify.h28
-rwxr-xr-xthirdparties/win32/include/ilbc/LPCdecode.h58
-rwxr-xr-xthirdparties/win32/include/ilbc/LPCencode.h34
-rwxr-xr-xthirdparties/win32/include/ilbc/StateConstructW.h32
-rwxr-xr-xthirdparties/win32/include/ilbc/StateSearchW.h62
-rwxr-xr-xthirdparties/win32/include/ilbc/anaFilter.h32
-rwxr-xr-xthirdparties/win32/include/ilbc/constants.h90
-rwxr-xr-xthirdparties/win32/include/ilbc/createCB.h66
-rwxr-xr-xthirdparties/win32/include/ilbc/doCPLC.h40
-rwxr-xr-xthirdparties/win32/include/ilbc/enhancer.h42
-rwxr-xr-xthirdparties/win32/include/ilbc/filter.h74
-rwxr-xr-xthirdparties/win32/include/ilbc/gainquant.h40
-rwxr-xr-xthirdparties/win32/include/ilbc/getCBvec.h32
-rwxr-xr-xthirdparties/win32/include/ilbc/helpfun.h142
-rwxr-xr-xthirdparties/win32/include/ilbc/hpInput.h30
-rwxr-xr-xthirdparties/win32/include/ilbc/hpOutput.h30
-rwxr-xr-xthirdparties/win32/include/ilbc/iCBConstruct.h48
-rwxr-xr-xthirdparties/win32/include/ilbc/iCBSearch.h46
-rwxr-xr-xthirdparties/win32/include/ilbc/iLBC_decode.h42
-rwxr-xr-xthirdparties/win32/include/ilbc/iLBC_define.h300
-rwxr-xr-xthirdparties/win32/include/ilbc/iLBC_encode.h38
-rwxr-xr-xthirdparties/win32/include/ilbc/lsf.h34
-rwxr-xr-xthirdparties/win32/include/ilbc/packing.h66
-rwxr-xr-xthirdparties/win32/include/ilbc/syntFilter.h30
-rwxr-xr-xthirdparties/win32/include/inttypes.h40
-rwxr-xr-xthirdparties/win32/include/libavcodec/avcodec.h80
-rwxr-xr-xthirdparties/win32/include/libavcodec/old_codec_ids.h702
-rwxr-xr-xthirdparties/win32/include/libavcodec/opt.h18
-rwxr-xr-xthirdparties/win32/include/libavcodec/vdpau.h12
-rwxr-xr-xthirdparties/win32/include/libavcodec/xvmc.h4
-rwxr-xr-xthirdparties/win32/include/libavfilter/avcodec.h10
-rwxr-xr-xthirdparties/win32/include/libavfilter/avfilter.h24
-rwxr-xr-xthirdparties/win32/include/libavformat/avformat.h16
-rwxr-xr-xthirdparties/win32/include/libavformat/avio.h32
-rwxr-xr-xthirdparties/win32/include/libavutil/avstring.h6
-rwxr-xr-xthirdparties/win32/include/libavutil/base64.h6
-rwxr-xr-xthirdparties/win32/include/libavutil/bprint.h12
-rwxr-xr-xthirdparties/win32/include/libavutil/common.h100
-rwxr-xr-xthirdparties/win32/include/libavutil/cpu.h2
-rwxr-xr-xthirdparties/win32/include/libavutil/crc.h2
-rwxr-xr-xthirdparties/win32/include/libavutil/fifo.h6
-rwxr-xr-xthirdparties/win32/include/libavutil/intreadwrite.h12
-rwxr-xr-xthirdparties/win32/include/libavutil/lfg.h6
-rwxr-xr-xthirdparties/win32/include/libavutil/log.h2
-rwxr-xr-xthirdparties/win32/include/libavutil/mem.h37
-rwxr-xr-xthirdparties/win32/include/libavutil/old_pix_fmts.h248
-rwxr-xr-xthirdparties/win32/include/libavutil/opt.h2
-rwxr-xr-xthirdparties/win32/include/libavutil/pixdesc.h8
-rwxr-xr-xthirdparties/win32/include/libavutil/rational.h24
-rwxr-xr-xthirdparties/win32/include/libavutil/timestamp.h16
-rwxr-xr-xthirdparties/win32/include/libswresample/swresample.h2
-rwxr-xr-xthirdparties/win32/include/opencore-amrnb/interf_enc.h20
-rwxr-xr-xthirdparties/win32/include/pthread/implement.h568
-rwxr-xr-xthirdparties/win32/include/pthread/pthread.h459
-rwxr-xr-xthirdparties/win32/include/pthread/sched.h24
-rwxr-xr-xthirdparties/win32/include/pthread/semaphore.h26
-rwxr-xr-xthirdparties/win32/include/speex/speex.h84
-rwxr-xr-xthirdparties/win32/include/speex/speex_bits.h44
-rwxr-xr-xthirdparties/win32/include/speex/speex_buffer.h2
-rwxr-xr-xthirdparties/win32/include/speex/speex_callbacks.h18
-rwxr-xr-xthirdparties/win32/include/speex/speex_echo.h10
-rwxr-xr-xthirdparties/win32/include/speex/speex_header.h38
-rwxr-xr-xthirdparties/win32/include/speex/speex_jitter.h52
-rwxr-xr-xthirdparties/win32/include/speex/speex_preprocess.h12
-rwxr-xr-xthirdparties/win32/include/speex/speex_resampler.h156
-rwxr-xr-xthirdparties/win32/include/speex/speex_stereo.h20
-rwxr-xr-xthirdparties/win32/include/speex/speex_types.h122
-rwxr-xr-xthirdparties/win32/include/srtp/aes.h28
-rwxr-xr-xthirdparties/win32/include/srtp/aes_cbc.h30
-rwxr-xr-xthirdparties/win32/include/srtp/aes_gcm_ossl.h22
-rwxr-xr-xthirdparties/win32/include/srtp/aes_icm.h42
-rwxr-xr-xthirdparties/win32/include/srtp/alloc.h14
-rwxr-xr-xthirdparties/win32/include/srtp/auth.h76
-rwxr-xr-xthirdparties/win32/include/srtp/cipher.h122
-rwxr-xr-xthirdparties/win32/include/srtp/crypto.h10
-rwxr-xr-xthirdparties/win32/include/srtp/crypto_kernel.h96
-rwxr-xr-xthirdparties/win32/include/srtp/crypto_math.h30
-rwxr-xr-xthirdparties/win32/include/srtp/crypto_types.h102
-rwxr-xr-xthirdparties/win32/include/srtp/cryptoalg.h70
-rwxr-xr-xthirdparties/win32/include/srtp/datatypes.h90
-rwxr-xr-xthirdparties/win32/include/srtp/ekt.h88
-rwxr-xr-xthirdparties/win32/include/srtp/err.h90
-rwxr-xr-xthirdparties/win32/include/srtp/getopt_s.h16
-rwxr-xr-xthirdparties/win32/include/srtp/gf2_8.h20
-rwxr-xr-xthirdparties/win32/include/srtp/hmac.h24
-rwxr-xr-xthirdparties/win32/include/srtp/integers.h16
-rwxr-xr-xthirdparties/win32/include/srtp/kernel_compat.h20
-rwxr-xr-xthirdparties/win32/include/srtp/key.h32
-rwxr-xr-xthirdparties/win32/include/srtp/null_auth.h16
-rwxr-xr-xthirdparties/win32/include/srtp/null_cipher.h20
-rwxr-xr-xthirdparties/win32/include/srtp/prng.h14
-rwxr-xr-xthirdparties/win32/include/srtp/rand_source.h18
-rwxr-xr-xthirdparties/win32/include/srtp/rdb.h16
-rwxr-xr-xthirdparties/win32/include/srtp/rdbx.h26
-rwxr-xr-xthirdparties/win32/include/srtp/rtp.h44
-rwxr-xr-xthirdparties/win32/include/srtp/rtp_priv.h32
-rwxr-xr-xthirdparties/win32/include/srtp/sha1.h30
-rwxr-xr-xthirdparties/win32/include/srtp/srtp.h427
-rwxr-xr-xthirdparties/win32/include/srtp/srtp_priv.h176
-rwxr-xr-xthirdparties/win32/include/srtp/stat.h14
-rwxr-xr-xthirdparties/win32/include/srtp/ut_sim.h18
-rwxr-xr-xthirdparties/win32/include/srtp/xfm.h112
-rwxr-xr-xthirdparties/win32/include/stdint.h50
-rwxr-xr-xthirdparties/win32/include/vpx/svc_context.h45
-rwxr-xr-xthirdparties/win32/include/vpx/vp8.h66
-rwxr-xr-xthirdparties/win32/include/vpx/vp8cx.h194
-rwxr-xr-xthirdparties/win32/include/vpx/vp8dx.h36
-rwxr-xr-xthirdparties/win32/include/vpx/vpx_codec.h658
-rwxr-xr-xthirdparties/win32/include/vpx/vpx_decoder.h520
-rwxr-xr-xthirdparties/win32/include/vpx/vpx_encoder.h808
-rwxr-xr-xthirdparties/win32/include/vpx/vpx_image.h223
-rwxr-xr-xthirdparties/wince/include/curl/curl.h1776
-rwxr-xr-xthirdparties/wince/include/curl/curlbuild.h26
-rwxr-xr-xthirdparties/wince/include/curl/curlrules.h46
-rwxr-xr-xthirdparties/wince/include/curl/multi.h172
-rwxr-xr-xthirdparties/wince/include/curl/stdcheaders.h10
-rwxr-xr-xthirdparties/wince/include/curl/typecheck-gcc.h72
-rwxr-xr-xthirdparties/wince/include/inttypes.h40
-rwxr-xr-xthirdparties/wince/include/libxml/DOCBparser.h78
-rwxr-xr-xthirdparties/wince/include/libxml/HTMLparser.h276
-rwxr-xr-xthirdparties/wince/include/libxml/HTMLtree.h140
-rwxr-xr-xthirdparties/wince/include/libxml/SAX.h256
-rwxr-xr-xthirdparties/wince/include/libxml/SAX2.h262
-rwxr-xr-xthirdparties/wince/include/libxml/c14n.h61
-rwxr-xr-xthirdparties/wince/include/libxml/catalog.h179
-rwxr-xr-xthirdparties/wince/include/libxml/chvalid.h18
-rwxr-xr-xthirdparties/wince/include/libxml/debugXML.h210
-rwxr-xr-xthirdparties/wince/include/libxml/dict.h44
-rwxr-xr-xthirdparties/wince/include/libxml/encoding.h103
-rwxr-xr-xthirdparties/wince/include/libxml/entities.h87
-rwxr-xr-xthirdparties/wince/include/libxml/globals.h81
-rwxr-xr-xthirdparties/wince/include/libxml/hash.h218
-rwxr-xr-xthirdparties/wince/include/libxml/list.h136
-rwxr-xr-xthirdparties/wince/include/libxml/nanoftp.h140
-rwxr-xr-xthirdparties/wince/include/libxml/nanohttp.h98
-rwxr-xr-xthirdparties/wince/include/libxml/parser.h672
-rwxr-xr-xthirdparties/wince/include/libxml/parserInternals.h408
-rwxr-xr-xthirdparties/wince/include/libxml/pattern.h52
-rwxr-xr-xthirdparties/wince/include/libxml/relaxng.h106
-rwxr-xr-xthirdparties/wince/include/libxml/schemasInternals.h17
-rwxr-xr-xthirdparties/wince/include/libxml/threads.h30
-rwxr-xr-xthirdparties/wince/include/libxml/tree.h1012
-rwxr-xr-xthirdparties/wince/include/libxml/uri.h46
-rwxr-xr-xthirdparties/wince/include/libxml/valid.h506
-rwxr-xr-xthirdparties/wince/include/libxml/xinclude.h36
-rwxr-xr-xthirdparties/wince/include/libxml/xlink.h72
-rwxr-xr-xthirdparties/wince/include/libxml/xmlIO.h290
-rwxr-xr-xthirdparties/wince/include/libxml/xmlautomata.h182
-rwxr-xr-xthirdparties/wince/include/libxml/xmlerror.h103
-rwxr-xr-xthirdparties/wince/include/libxml/xmlexports.h174
-rwxr-xr-xthirdparties/wince/include/libxml/xmlmemory.h68
-rwxr-xr-xthirdparties/wince/include/libxml/xmlmodule.h8
-rwxr-xr-xthirdparties/wince/include/libxml/xmlreader.h329
-rwxr-xr-xthirdparties/wince/include/libxml/xmlregexp.h152
-rwxr-xr-xthirdparties/wince/include/libxml/xmlschemas.h167
-rwxr-xr-xthirdparties/wince/include/libxml/xmlschemastypes.h199
-rwxr-xr-xthirdparties/wince/include/libxml/xmlstring.h140
-rwxr-xr-xthirdparties/wince/include/libxml/xmlversion.h2
-rwxr-xr-xthirdparties/wince/include/libxml/xmlwriter.h680
-rwxr-xr-xthirdparties/wince/include/libxml/xpath.h194
-rwxr-xr-xthirdparties/wince/include/libxml/xpathInternals.h412
-rwxr-xr-xthirdparties/wince/include/libxml/xpointer.h120
-rwxr-xr-xthirdparties/wince/include/pthread/implement.h568
-rwxr-xr-xthirdparties/wince/include/pthread/pthread.h459
-rwxr-xr-xthirdparties/wince/include/pthread/sched.h24
-rwxr-xr-xthirdparties/wince/include/pthread/semaphore.h26
-rwxr-xr-xthirdparties/wince/include/smc/statemap.h16
-rwxr-xr-xthirdparties/wince/include/srtp/aes.h28
-rwxr-xr-xthirdparties/wince/include/srtp/aes_cbc.h30
-rwxr-xr-xthirdparties/wince/include/srtp/aes_gcm_ossl.h22
-rwxr-xr-xthirdparties/wince/include/srtp/aes_icm.h42
-rwxr-xr-xthirdparties/wince/include/srtp/alloc.h14
-rwxr-xr-xthirdparties/wince/include/srtp/auth.h76
-rwxr-xr-xthirdparties/wince/include/srtp/cipher.h122
-rwxr-xr-xthirdparties/wince/include/srtp/crypto.h10
-rwxr-xr-xthirdparties/wince/include/srtp/crypto_kernel.h96
-rwxr-xr-xthirdparties/wince/include/srtp/crypto_math.h30
-rwxr-xr-xthirdparties/wince/include/srtp/crypto_types.h102
-rwxr-xr-xthirdparties/wince/include/srtp/cryptoalg.h70
-rwxr-xr-xthirdparties/wince/include/srtp/datatypes.h88
-rwxr-xr-xthirdparties/wince/include/srtp/err.h90
-rwxr-xr-xthirdparties/wince/include/srtp/gf2_8.h20
-rwxr-xr-xthirdparties/wince/include/srtp/hmac.h24
-rwxr-xr-xthirdparties/wince/include/srtp/integers.h16
-rwxr-xr-xthirdparties/wince/include/srtp/kernel_compat.h20
-rwxr-xr-xthirdparties/wince/include/srtp/key.h32
-rwxr-xr-xthirdparties/wince/include/srtp/null_auth.h16
-rwxr-xr-xthirdparties/wince/include/srtp/null_cipher.h20
-rwxr-xr-xthirdparties/wince/include/srtp/prng.h14
-rwxr-xr-xthirdparties/wince/include/srtp/rand_source.h18
-rwxr-xr-xthirdparties/wince/include/srtp/rdb.h16
-rwxr-xr-xthirdparties/wince/include/srtp/rdbx.h26
-rwxr-xr-xthirdparties/wince/include/srtp/rtp.h44
-rwxr-xr-xthirdparties/wince/include/srtp/sha1.h30
-rwxr-xr-xthirdparties/wince/include/srtp/srtp.h419
-rwxr-xr-xthirdparties/wince/include/srtp/stat.h14
-rwxr-xr-xthirdparties/wince/include/srtp/xfm.h112
-rwxr-xr-xthirdparties/wince/include/stdint.h50
-rwxr-xr-xthirdparties/wince/include/vpx/svc_context.h43
-rwxr-xr-xthirdparties/wince/include/vpx/vp8.h66
-rwxr-xr-xthirdparties/wince/include/vpx/vp8cx.h214
-rwxr-xr-xthirdparties/wince/include/vpx/vp8dx.h42
-rwxr-xr-xthirdparties/wince/include/vpx/vpx_codec.h658
-rwxr-xr-xthirdparties/wince/include/vpx/vpx_decoder.h610
-rwxr-xr-xthirdparties/wince/include/vpx/vpx_encoder.h808
-rwxr-xr-xthirdparties/wince/include/vpx/vpx_frame_buffer.h6
-rwxr-xr-xthirdparties/wince/include/vpx/vpx_image.h223
-rwxr-xr-xtinyBFCP/include/tinybfcp/tbfcp_session.h13
-rwxr-xr-xtinyBFCP/include/tinybfcp/tbfcp_types.h6
-rwxr-xr-xtinyBFCP/src/tbfcp_attr.c44
-rwxr-xr-xtinyBFCP/src/tbfcp_pkt.c40
-rwxr-xr-xtinyBFCP/src/tbfcp_session.c575
-rwxr-xr-xtinyBFCP/src/tbfcp_utils.c82
-rwxr-xr-xtinyDAV/include/tinydav.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h43
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h19
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h45
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h19
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h37
-rwxr-xr-xtinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_consumer_audio.h23
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_jitterbuffer.h144
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_producer_audio.h11
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_session_audio.h93
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h27
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_denoise.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_resampler.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h27
-rwxr-xr-xtinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h33
-rwxr-xr-xtinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h53
-rwxr-xr-xtinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h31
-rwxr-xr-xtinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g711/g711.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h16
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h19
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h53
-rwxr-xr-xtinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h15
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h61
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h8
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h546
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h77
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h74
-rwxr-xr-xtinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h19
-rwxr-xr-xtinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h4
-rwxr-xr-xtinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h52
-rwxr-xr-xtinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h6
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h11
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_producer_msrp.h6
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_session_msrp.h111
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_consumer_t140.h25
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_producer_t140.h15
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_session_t140.h111
-rwxr-xr-xtinyDAV/include/tinydav/tdav.h85
-rwxr-xr-xtinyDAV/include/tinydav/tdav_apple.h6
-rwxr-xr-xtinyDAV/include/tinydav/tdav_session_av.h168
-rwxr-xr-xtinyDAV/include/tinydav/tdav_win32.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/jb/tdav_video_frame.h25
-rwxr-xr-xtinyDAV/include/tinydav/video/jb/tdav_video_jb.h63
-rwxr-xr-xtinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_consumer_video.h19
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_converter_video.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_runnable_video.h13
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_session_video.h161
-rwxr-xr-xtinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/winm/tdav_producer_winm.h6
-rwxr-xr-xtinyDAV/include/tinydav_config.h12
-rwxr-xr-xtinyDAV/src/audio/alsa/tdav_common_alsa.c420
-rwxr-xr-xtinyDAV/src/audio/alsa/tdav_consumer_alsa.c389
-rwxr-xr-xtinyDAV/src/audio/alsa/tdav_producer_alsa.c353
-rwxr-xr-xtinyDAV/src/audio/coreaudio/tdav_audiounit.c497
-rwxr-xr-xtinyDAV/src/audio/coreaudio/tdav_consumer_audioqueue.c263
-rwxr-xr-xtinyDAV/src/audio/coreaudio/tdav_consumer_audiounit.c669
-rwxr-xr-xtinyDAV/src/audio/coreaudio/tdav_producer_audioqueue.c255
-rwxr-xr-xtinyDAV/src/audio/coreaudio/tdav_producer_audiounit.c627
-rwxr-xr-xtinyDAV/src/audio/directsound/tdav_consumer_dsound.c665
-rwxr-xr-xtinyDAV/src/audio/directsound/tdav_producer_dsound.c519
-rwxr-xr-xtinyDAV/src/audio/oss/tdav_consumer_oss.c567
-rwxr-xr-xtinyDAV/src/audio/oss/tdav_producer_oss.c533
-rwxr-xr-xtinyDAV/src/audio/tdav_consumer_audio.c295
-rwxr-xr-xtinyDAV/src/audio/tdav_jitterbuffer.c1486
-rwxr-xr-xtinyDAV/src/audio/tdav_producer_audio.c124
-rwxr-xr-xtinyDAV/src/audio/tdav_session_audio.c1613
-rwxr-xr-xtinyDAV/src/audio/tdav_speakup_jitterbuffer.c361
-rwxr-xr-xtinyDAV/src/audio/tdav_speex_denoise.c433
-rwxr-xr-xtinyDAV/src/audio/tdav_speex_jitterbuffer.c453
-rwxr-xr-xtinyDAV/src/audio/tdav_speex_resampler.c355
-rwxr-xr-xtinyDAV/src/audio/tdav_webrtc_denoise.c898
-rwxr-xr-xtinyDAV/src/audio/wasapi/tdav_consumer_wasapi.cxx895
-rwxr-xr-xtinyDAV/src/audio/wasapi/tdav_producer_wasapi.cxx928
-rwxr-xr-xtinyDAV/src/audio/waveapi/tdav_consumer_waveapi.c560
-rwxr-xr-xtinyDAV/src/audio/waveapi/tdav_producer_waveapi.c546
-rwxr-xr-xtinyDAV/src/bfcp/tdav_session_bfcp.c1187
-rwxr-xr-xtinyDAV/src/codecs/amr/tdav_codec_amr.c1202
-rwxr-xr-xtinyDAV/src/codecs/bfcp/tdav_codec_bfcp.c93
-rwxr-xr-xtinyDAV/src/codecs/bv/tdav_codec_bv16.c299
-rwxr-xr-xtinyDAV/src/codecs/dtmf/tdav_codec_dtmf.c117
-rwxr-xr-xtinyDAV/src/codecs/fec/tdav_codec_red.c363
-rwxr-xr-xtinyDAV/src/codecs/fec/tdav_codec_ulpfec.c588
-rwxr-xr-xtinyDAV/src/codecs/g711/g711.c269
-rwxr-xr-xtinyDAV/src/codecs/g711/tdav_codec_g711.c428
-rwxr-xr-xtinyDAV/src/codecs/g722/g722_decode.c203
-rwxr-xr-xtinyDAV/src/codecs/g722/g722_encode.c171
-rwxr-xr-xtinyDAV/src/codecs/g722/tdav_codec_g722.c271
-rwxr-xr-xtinyDAV/src/codecs/g729/tdav_codec_g729.c568
-rwxr-xr-xtinyDAV/src/codecs/gsm/tdav_codec_gsm.c261
-rwxr-xr-xtinyDAV/src/codecs/h261/tdav_codec_h261.c720
-rwxr-xr-xtinyDAV/src/codecs/h263/tdav_codec_h263.c2083
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264.c1328
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx1387
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264_cuda.cxx1767
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264_intel.cxx3383
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264_rtp.c556
-rwxr-xr-xtinyDAV/src/codecs/ilbc/tdav_codec_ilbc.c354
-rwxr-xr-xtinyDAV/src/codecs/mp4ves/tdav_codec_mp4ves.c1295
-rwxr-xr-xtinyDAV/src/codecs/msrp/tdav_codec_msrp.c93
-rwxr-xr-xtinyDAV/src/codecs/opus/tdav_codec_opus.c501
-rwxr-xr-xtinyDAV/src/codecs/speex/tdav_codec_speex.c282
-rwxr-xr-xtinyDAV/src/codecs/t140/tdav_codec_t140.c198
-rwxr-xr-xtinyDAV/src/codecs/theora/tdav_codec_theora.c1394
-rwxr-xr-xtinyDAV/src/codecs/vpx/tdav_codec_vp8.c1643
-rwxr-xr-xtinyDAV/src/msrp/tdav_session_msrp.c1654
-rwxr-xr-xtinyDAV/src/t140/tdav_consumer_t140.c136
-rwxr-xr-xtinyDAV/src/t140/tdav_producer_t140.c150
-rwxr-xr-xtinyDAV/src/t140/tdav_session_t140.c1842
-rwxr-xr-xtinyDAV/src/tdav.c741
-rwxr-xr-xtinyDAV/src/tdav_session_av.c1308
-rwxr-xr-xtinyDAV/src/tdav_win32.c224
-rwxr-xr-xtinyDAV/src/video/directx/tdav_producer_screencast_d3d9.cxx163
-rwxr-xr-xtinyDAV/src/video/directx/tdav_producer_screencast_ddraw.cxx2018
-rwxr-xr-xtinyDAV/src/video/gdi/tdav_consumer_video_gdi.c786
-rwxr-xr-xtinyDAV/src/video/gdi/tdav_producer_screencast_gdi.c759
-rwxr-xr-xtinyDAV/src/video/jb/tdav_video_frame.c105
-rwxr-xr-xtinyDAV/src/video/jb/tdav_video_jb.c260
-rwxr-xr-xtinyDAV/src/video/mf/tdav_consumer_video_mf.cxx187
-rwxr-xr-xtinyDAV/src/video/mf/tdav_producer_video_mf.cxx608
-rwxr-xr-xtinyDAV/src/video/tdav_consumer_video.c245
-rwxr-xr-xtinyDAV/src/video/tdav_converter_video.cxx1321
-rwxr-xr-xtinyDAV/src/video/tdav_runnable_video.c71
-rwxr-xr-xtinyDAV/src/video/tdav_session_video.c1234
-rwxr-xr-xtinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c1855
-rwxr-xr-xtinyDAV/src/video/winm/tdav_consumer_winm.cxx225
-rwxr-xr-xtinyDAV/src/video/winm/tdav_producer_winm.cxx845
-rwxr-xr-xtinyDAV/test/test.c28
-rwxr-xr-xtinyDAV/test/test_sessions.h202
-rwxr-xr-xtinyDEMO/cmd.c114
-rwxr-xr-xtinyDEMO/cmd.h169
-rwxr-xr-xtinyDEMO/common.c1408
-rwxr-xr-xtinyDEMO/common.h125
-rwxr-xr-xtinyDEMO/demo_config.h8
-rwxr-xr-xtinyDEMO/dssl.c10076
-rwxr-xr-xtinyDEMO/dssl.h6
-rwxr-xr-xtinyDEMO/invite.c477
-rwxr-xr-xtinyDEMO/invite.h6
-rwxr-xr-xtinyDEMO/main.c884
-rwxr-xr-xtinyDEMO/main.h6
-rwxr-xr-xtinyDEMO/message.c404
-rwxr-xr-xtinyDEMO/message.h6
-rwxr-xr-xtinyDEMO/options.c136
-rwxr-xr-xtinyDEMO/options.h6
-rwxr-xr-xtinyDEMO/publish.c153
-rwxr-xr-xtinyDEMO/publish.h6
-rwxr-xr-xtinyDEMO/register.c165
-rwxr-xr-xtinyDEMO/register.h6
-rwxr-xr-xtinyDEMO/subscribe.c174
-rwxr-xr-xtinyDEMO/subscribe.h6
-rwxr-xr-xtinyHTTP/include/thttp.h113
-rwxr-xr-xtinyHTTP/include/tinyhttp.h6
-rwxr-xr-xtinyHTTP/include/tinyhttp/auth/thttp_auth.h10
-rwxr-xr-xtinyHTTP/include/tinyhttp/auth/thttp_challenge.h29
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header.h46
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Authorization.h35
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Content_Length.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Content_Type.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Dummy.h17
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_ETag.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Accept.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Key.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Protocol.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Version.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_Transfer_Encoding.h15
-rwxr-xr-xtinyHTTP/include/tinyhttp/headers/thttp_header_WWW_Authenticate.h29
-rwxr-xr-xtinyHTTP/include/tinyhttp/parsers/thttp_parser_header.h6
-rwxr-xr-xtinyHTTP/include/tinyhttp/parsers/thttp_parser_message.h6
-rwxr-xr-xtinyHTTP/include/tinyhttp/parsers/thttp_parser_url.h6
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_action.h74
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_dialog.h33
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_event.h40
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_message.h94
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_session.h63
-rwxr-xr-xtinyHTTP/include/tinyhttp/thttp_url.h43
-rwxr-xr-xtinyHTTP/include/tinyhttp_config.h12
-rwxr-xr-xtinyHTTP/src/auth/thttp_auth.c247
-rwxr-xr-xtinyHTTP/src/auth/thttp_challenge.c83
-rwxr-xr-xtinyHTTP/src/headers/thttp_header.c189
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Authorization.c13744
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Content_Length.c486
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Content_Type.c678
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Dummy.c500
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_ETag.c535
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Sec_WebSocket_Accept.c548
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Sec_WebSocket_Key.c530
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Sec_WebSocket_Protocol.c580
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Sec_WebSocket_Version.c572
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_Transfer_Encoding.c594
-rwxr-xr-xtinyHTTP/src/headers/thttp_header_WWW_Authenticate.c16418
-rwxr-xr-xtinyHTTP/src/parsers/thttp_parser_header.c5517
-rwxr-xr-xtinyHTTP/src/parsers/thttp_parser_message.c715
-rwxr-xr-xtinyHTTP/src/parsers/thttp_parser_url.c910
-rwxr-xr-xtinyHTTP/src/thttp.c770
-rwxr-xr-xtinyHTTP/src/thttp_action.c209
-rwxr-xr-xtinyHTTP/src/thttp_dialog.c686
-rwxr-xr-xtinyHTTP/src/thttp_event.c49
-rwxr-xr-xtinyHTTP/src/thttp_message.c603
-rwxr-xr-xtinyHTTP/src/thttp_proxy_node_plugin.c161
-rwxr-xr-xtinyHTTP/src/thttp_session.c282
-rwxr-xr-xtinyHTTP/src/thttp_url.c151
-rwxr-xr-xtinyHTTP/test/stdafx.c6
-rwxr-xr-xtinyHTTP/test/stdafx.h6
-rwxr-xr-xtinyHTTP/test/targetver.h4
-rwxr-xr-xtinyHTTP/test/test.c36
-rwxr-xr-xtinyHTTP/test/test_auth.h225
-rwxr-xr-xtinyHTTP/test/test_messages.h120
-rwxr-xr-xtinyHTTP/test/test_stack.h384
-rwxr-xr-xtinyHTTP/test/test_transport.h513
-rwxr-xr-xtinyHTTP/test/test_url.h104
-rwxr-xr-xtinyIPSec/src/tipsec.c106
-rwxr-xr-xtinyIPSec/src/tipsec.h8
-rwxr-xr-xtinyIPSec/test/test.c265
-rwxr-xr-xtinyMEDIA/include/tinymedia.h6
-rwxr-xr-xtinyMEDIA/include/tinymedia/content/tmedia_content.h52
-rwxr-xr-xtinyMEDIA/include/tinymedia/content/tmedia_content_cpim.h21
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia.h67
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_codec.h393
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_codec_dummy.h26
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_common.h279
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_consumer.h130
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_converter_video.h48
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_defaults.h10
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_denoise.h70
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_imageattr.h98
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_jitterbuffer.h52
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_params.h94
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_producer.h124
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_qos.h182
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_resampler.h40
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_session.h441
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_session_dummy.h33
-rwxr-xr-xtinyMEDIA/include/tinymedia/tmedia_session_ghost.h17
-rwxr-xr-xtinyMEDIA/include/tinymedia_config.h12
-rwxr-xr-xtinyMEDIA/src/content/tmedia_content.c428
-rwxr-xr-xtinyMEDIA/src/content/tmedia_content_cpim.c722
-rwxr-xr-xtinyMEDIA/src/tmedia.c347
-rwxr-xr-xtinyMEDIA/src/tmedia_codec.c1180
-rwxr-xr-xtinyMEDIA/src/tmedia_codec_dummy.c420
-rwxr-xr-xtinyMEDIA/src/tmedia_common.c640
-rwxr-xr-xtinyMEDIA/src/tmedia_consumer.c266
-rwxr-xr-xtinyMEDIA/src/tmedia_converter_video.c150
-rwxr-xr-xtinyMEDIA/src/tmedia_defaults.c864
-rwxr-xr-xtinyMEDIA/src/tmedia_denoise.c332
-rwxr-xr-xtinyMEDIA/src/tmedia_imageattr.c1848
-rwxr-xr-xtinyMEDIA/src/tmedia_jitterbuffer.c372
-rwxr-xr-xtinyMEDIA/src/tmedia_params.c265
-rwxr-xr-xtinyMEDIA/src/tmedia_producer.c298
-rwxr-xr-xtinyMEDIA/src/tmedia_qos.c1417
-rwxr-xr-xtinyMEDIA/src/tmedia_resampler.c178
-rwxr-xr-xtinyMEDIA/src/tmedia_session.c3705
-rwxr-xr-xtinyMEDIA/src/tmedia_session_dummy.c560
-rwxr-xr-xtinyMEDIA/src/tmedia_session_ghost.c150
-rwxr-xr-xtinyMEDIA/test/dummy.c168
-rwxr-xr-xtinyMEDIA/test/dummy.h19
-rwxr-xr-xtinyMEDIA/test/test.c112
-rwxr-xr-xtinyMEDIA/test/test_codecs.h18
-rwxr-xr-xtinyMEDIA/test/test_contents.h54
-rwxr-xr-xtinyMEDIA/test/test_image_attr.h47
-rwxr-xr-xtinyMEDIA/test/test_qos.h428
-rwxr-xr-xtinyMEDIA/test/test_sessions.h314
-rwxr-xr-xtinyMSRP/include/tinymsrp.h6
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header.h50
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Authorization.h43
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Byte-Range.h21
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Content-Type.h21
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Dummy.h19
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Expires.h17
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Failure-Report.h26
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_From-Path.h19
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Max-Expires.h17
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Message-ID.h17
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Min-Expires.h17
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Status.h21
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Success-Report.h15
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_To-Path.h19
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_Use-Path.h19
-rwxr-xr-xtinyMSRP/include/tinymsrp/headers/tmsrp_header_WWW-Authenticate.h33
-rwxr-xr-xtinyMSRP/include/tinymsrp/parsers/tmsrp_parser_message.h6
-rwxr-xr-xtinyMSRP/include/tinymsrp/parsers/tmsrp_parser_uri.h6
-rwxr-xr-xtinyMSRP/include/tinymsrp/session/tmsrp_config.h21
-rwxr-xr-xtinyMSRP/include/tinymsrp/session/tmsrp_data.h45
-rwxr-xr-xtinyMSRP/include/tinymsrp/session/tmsrp_receiver.h27
-rwxr-xr-xtinyMSRP/include/tinymsrp/session/tmsrp_sender.h19
-rwxr-xr-xtinyMSRP/include/tinymsrp/tmsrp_event.h30
-rwxr-xr-xtinyMSRP/include/tinymsrp/tmsrp_message.h137
-rwxr-xr-xtinyMSRP/include/tinymsrp/tmsrp_uri.h46
-rwxr-xr-xtinyMSRP/include/tinymsrp_config.h12
-rwxr-xr-xtinyMSRP/include/tmsrp.h6
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header.c127
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Authorization.c222
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Byte-Range.c619
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Content-Type.c745
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Dummy.c531
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Expires.c503
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Failure-Report.c585
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_From-Path.c621
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Max-Expires.c521
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Message-ID.c726
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Min-Expires.c521
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Status.c593
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Success-Report.c547
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_To-Path.c609
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_Use-Path.c581
-rwxr-xr-xtinyMSRP/src/headers/tmsrp_header_WWW-Authenticate.c182
-rwxr-xr-xtinyMSRP/src/parsers/tmsrp_parser_message.c7356
-rwxr-xr-xtinyMSRP/src/parsers/tmsrp_parser_uri.c1200
-rwxr-xr-xtinyMSRP/src/session/tmsrp_config.c45
-rwxr-xr-xtinyMSRP/src/session/tmsrp_data.c324
-rwxr-xr-xtinyMSRP/src/session/tmsrp_receiver.c253
-rwxr-xr-xtinyMSRP/src/session/tmsrp_sender.c391
-rwxr-xr-xtinyMSRP/src/tmsrp.c216
-rwxr-xr-xtinyMSRP/src/tmsrp_event.c69
-rwxr-xr-xtinyMSRP/src/tmsrp_message.c653
-rwxr-xr-xtinyMSRP/src/tmsrp_uri.c211
-rwxr-xr-xtinyMSRP/test/test/stdafx.c6
-rwxr-xr-xtinyMSRP/test/test/stdafx.h6
-rwxr-xr-xtinyMSRP/test/test/targetver.h4
-rwxr-xr-xtinyMSRP/test/test/test.c28
-rwxr-xr-xtinyMSRP/test/test/test_parser.h178
-rwxr-xr-xtinyMSRP/test/test/test_session.h152
-rwxr-xr-xtinyMSRP/test/test/test_uri.h139
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp.c420
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp.h48
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_message.c517
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_message.h257
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_option.c399
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_option.h398
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_option_sip.c159
-rwxr-xr-xtinyNET/src/dhcp/tnet_dhcp_option_sip.h29
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6.c364
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6.h35
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_duid.c307
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_duid.h131
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_message.c130
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_message.h152
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_option.c377
-rwxr-xr-xtinyNET/src/dhcp6/tnet_dhcp6_option.h209
-rwxr-xr-xtinyNET/src/dns/tnet_dns.c1174
-rwxr-xr-xtinyNET/src/dns/tnet_dns.h50
-rwxr-xr-xtinyNET/src/dns/tnet_dns_a.c89
-rwxr-xr-xtinyNET/src/dns/tnet_dns_a.h19
-rwxr-xr-xtinyNET/src/dns/tnet_dns_aaaa.c91
-rwxr-xr-xtinyNET/src/dns/tnet_dns_aaaa.h17
-rwxr-xr-xtinyNET/src/dns/tnet_dns_cname.c77
-rwxr-xr-xtinyNET/src/dns/tnet_dns_cname.h19
-rwxr-xr-xtinyNET/src/dns/tnet_dns_message.c497
-rwxr-xr-xtinyNET/src/dns/tnet_dns_message.h137
-rwxr-xr-xtinyNET/src/dns/tnet_dns_mx.c83
-rwxr-xr-xtinyNET/src/dns/tnet_dns_mx.h21
-rwxr-xr-xtinyNET/src/dns/tnet_dns_naptr.c171
-rwxr-xr-xtinyNET/src/dns/tnet_dns_naptr.h31
-rwxr-xr-xtinyNET/src/dns/tnet_dns_ns.c77
-rwxr-xr-xtinyNET/src/dns/tnet_dns_ns.h19
-rwxr-xr-xtinyNET/src/dns/tnet_dns_opt.c73
-rwxr-xr-xtinyNET/src/dns/tnet_dns_opt.h11
-rwxr-xr-xtinyNET/src/dns/tnet_dns_ptr.c77
-rwxr-xr-xtinyNET/src/dns/tnet_dns_ptr.h19
-rwxr-xr-xtinyNET/src/dns/tnet_dns_regexp.c477
-rwxr-xr-xtinyNET/src/dns/tnet_dns_regexp.h6
-rwxr-xr-xtinyNET/src/dns/tnet_dns_resolvconf.c510
-rwxr-xr-xtinyNET/src/dns/tnet_dns_resolvconf.h6
-rwxr-xr-xtinyNET/src/dns/tnet_dns_rr.c544
-rwxr-xr-xtinyNET/src/dns/tnet_dns_rr.h185
-rwxr-xr-xtinyNET/src/dns/tnet_dns_soa.c113
-rwxr-xr-xtinyNET/src/dns/tnet_dns_soa.h31
-rwxr-xr-xtinyNET/src/dns/tnet_dns_srv.c147
-rwxr-xr-xtinyNET/src/dns/tnet_dns_srv.h21
-rwxr-xr-xtinyNET/src/dns/tnet_dns_txt.c77
-rwxr-xr-xtinyNET/src/dns/tnet_dns_txt.h19
-rwxr-xr-xtinyNET/src/ice/tnet_ice.c6
-rwxr-xr-xtinyNET/src/ice/tnet_ice.h6
-rwxr-xr-xtinyNET/src/ice/tnet_ice_candidate.c383
-rwxr-xr-xtinyNET/src/ice/tnet_ice_candidate.h92
-rwxr-xr-xtinyNET/src/ice/tnet_ice_ctx.c947
-rwxr-xr-xtinyNET/src/ice/tnet_ice_ctx.h40
-rwxr-xr-xtinyNET/src/ice/tnet_ice_event.c23
-rwxr-xr-xtinyNET/src/ice/tnet_ice_event.h58
-rwxr-xr-xtinyNET/src/ice/tnet_ice_pair.c1136
-rwxr-xr-xtinyNET/src/ice/tnet_ice_pair.h60
-rwxr-xr-xtinyNET/src/ice/tnet_ice_utils.c230
-rwxr-xr-xtinyNET/src/ice/tnet_ice_utils.h4
-rwxr-xr-xtinyNET/src/stun/tnet_stun_attr.c996
-rwxr-xr-xtinyNET/src/stun/tnet_stun_pkt.c1245
-rwxr-xr-xtinyNET/src/stun/tnet_stun_types.h20
-rwxr-xr-xtinyNET/src/tinynet.h6
-rwxr-xr-xtinyNET/src/tinynet_config.h10
-rwxr-xr-xtinyNET/src/tls/tnet_dtls.c1166
-rwxr-xr-xtinyNET/src/tls/tnet_dtls.h23
-rwxr-xr-xtinyNET/src/tls/tnet_tls.c475
-rwxr-xr-xtinyNET/src/tls/tnet_tls.h6
-rwxr-xr-xtinyNET/src/tnet.c116
-rwxr-xr-xtinyNET/src/tnet.h6
-rwxr-xr-xtinyNET/src/tnet_auth.c6
-rwxr-xr-xtinyNET/src/tnet_auth.h6
-rwxr-xr-xtinyNET/src/tnet_endianness.c61
-rwxr-xr-xtinyNET/src/tnet_endianness.h6
-rwxr-xr-xtinyNET/src/tnet_hardwares.h41
-rwxr-xr-xtinyNET/src/tnet_nat.c380
-rwxr-xr-xtinyNET/src/tnet_nat.h4
-rwxr-xr-xtinyNET/src/tnet_poll.c132
-rwxr-xr-xtinyNET/src/tnet_poll.h11
-rwxr-xr-xtinyNET/src/tnet_proto.h301
-rwxr-xr-xtinyNET/src/tnet_proxy_node_socks_plugin.c291
-rwxr-xr-xtinyNET/src/tnet_proxy_plugin.c152
-rwxr-xr-xtinyNET/src/tnet_proxy_plugin.h16
-rwxr-xr-xtinyNET/src/tnet_proxydetect.c40
-rwxr-xr-xtinyNET/src/tnet_proxydetect.h14
-rwxr-xr-xtinyNET/src/tnet_socket.c309
-rwxr-xr-xtinyNET/src/tnet_socket.h112
-rwxr-xr-xtinyNET/src/tnet_transport.c391
-rwxr-xr-xtinyNET/src/tnet_transport.h131
-rwxr-xr-xtinyNET/src/tnet_transport_cfsocket.c696
-rwxr-xr-xtinyNET/src/tnet_transport_poll.c1321
-rwxr-xr-xtinyNET/src/tnet_transport_win32.c1227
-rwxr-xr-xtinyNET/src/tnet_types.h72
-rwxr-xr-xtinyNET/src/tnet_utils.c916
-rwxr-xr-xtinyNET/src/tnet_utils.h40
-rwxr-xr-xtinyNET/src/turn/tnet_turn.c72
-rwxr-xr-xtinyNET/src/turn/tnet_turn.h12
-rwxr-xr-xtinyNET/src/turn/tnet_turn_attribute.c56
-rwxr-xr-xtinyNET/src/turn/tnet_turn_attribute.h10
-rwxr-xr-xtinyNET/src/turn/tnet_turn_message.c16
-rwxr-xr-xtinyNET/src/turn/tnet_turn_message.h6
-rwxr-xr-xtinyNET/src/turn/tnet_turn_session.c3460
-rwxr-xr-xtinyNET/src/turn/tnet_turn_session.h47
-rwxr-xr-xtinyNET/test/targetver.h4
-rwxr-xr-xtinyNET/test/test.c44
-rwxr-xr-xtinyNET/test/test_dhcp.h133
-rwxr-xr-xtinyNET/test/test_dhcp6.h24
-rwxr-xr-xtinyNET/test/test_dns.h306
-rwxr-xr-xtinyNET/test/test_ice.h315
-rwxr-xr-xtinyNET/test/test_ifaces.h102
-rwxr-xr-xtinyNET/test/test_nat.h80
-rwxr-xr-xtinyNET/test/test_sockets.h69
-rwxr-xr-xtinyNET/test/test_stun.h290
-rwxr-xr-xtinyNET/test/test_tls.h113
-rwxr-xr-xtinyNET/test/test_transport.h242
-rwxr-xr-xtinyROHC/include/tinyrohc_config.h12
-rwxr-xr-xtinyROHC/include/trohc.h6
-rwxr-xr-xtinyROHC/src/trohc.c6
-rwxr-xr-xtinyRTP/include/tinyrtp.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h25
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h30
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h27
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h15
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h163
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h19
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h13
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h35
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h15
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h36
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h8
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h63
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h35
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp_manager.h256
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp_srtp.h78
-rwxr-xr-xtinyRTP/include/tinyrtp_config.h12
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_header.c133
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_packet.c379
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_rblock.c167
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report.c6
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_bye.c319
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_fb.c1101
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_rr.c337
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_sdes.c271
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_sr.c407
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_report_xr.c6
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_sdes_chunck.c224
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_sdes_item.c171
-rwxr-xr-xtinyRTP/src/rtcp/trtp_rtcp_session.c2421
-rwxr-xr-xtinyRTP/src/rtp/trtp_rtp_header.c353
-rwxr-xr-xtinyRTP/src/rtp/trtp_rtp_packet.c339
-rwxr-xr-xtinyRTP/src/rtp/trtp_rtp_session.c6
-rwxr-xr-xtinyRTP/src/trtp.c6
-rwxr-xr-xtinyRTP/src/trtp_manager.c2932
-rwxr-xr-xtinyRTP/src/trtp_srtp.c208
-rwxr-xr-xtinyRTP/test/test.c26
-rwxr-xr-xtinyRTP/test/test_manager.h70
-rwxr-xr-xtinyRTP/test/test_parser.h529
-rwxr-xr-xtinySAK/src/tinysak_config.h20
-rwxr-xr-xtinySAK/src/tsk.c48
-rwxr-xr-xtinySAK/src/tsk.h6
-rwxr-xr-xtinySAK/src/tsk_base64.c279
-rwxr-xr-xtinySAK/src/tsk_base64.h6
-rwxr-xr-xtinySAK/src/tsk_binaryutils.c6
-rwxr-xr-xtinySAK/src/tsk_binaryutils.h84
-rwxr-xr-xtinySAK/src/tsk_buffer.c375
-rwxr-xr-xtinySAK/src/tsk_buffer.h15
-rwxr-xr-xtinySAK/src/tsk_common.h6
-rwxr-xr-xtinySAK/src/tsk_condwait.c273
-rwxr-xr-xtinySAK/src/tsk_condwait.h6
-rwxr-xr-xtinySAK/src/tsk_debug.c72
-rwxr-xr-xtinySAK/src/tsk_debug.h14
-rwxr-xr-xtinySAK/src/tsk_errno.h6
-rwxr-xr-xtinySAK/src/tsk_fsm.c411
-rwxr-xr-xtinySAK/src/tsk_fsm.h44
-rwxr-xr-xtinySAK/src/tsk_hmac.c224
-rwxr-xr-xtinySAK/src/tsk_hmac.h6
-rwxr-xr-xtinySAK/src/tsk_list.c742
-rwxr-xr-xtinySAK/src/tsk_list.h30
-rwxr-xr-xtinySAK/src/tsk_md5.c55
-rwxr-xr-xtinySAK/src/tsk_md5.h15
-rwxr-xr-xtinySAK/src/tsk_memory.c120
-rwxr-xr-xtinySAK/src/tsk_memory.h6
-rwxr-xr-xtinySAK/src/tsk_mutex.c139
-rwxr-xr-xtinySAK/src/tsk_mutex.h6
-rwxr-xr-xtinySAK/src/tsk_object.c224
-rwxr-xr-xtinySAK/src/tsk_object.h45
-rwxr-xr-xtinySAK/src/tsk_options.c163
-rwxr-xr-xtinySAK/src/tsk_options.h21
-rwxr-xr-xtinySAK/src/tsk_params.c345
-rwxr-xr-xtinySAK/src/tsk_params.h21
-rwxr-xr-xtinySAK/src/tsk_plugin.c254
-rwxr-xr-xtinySAK/src/tsk_plugin.h44
-rwxr-xr-xtinySAK/src/tsk_ppfcs16.c81
-rwxr-xr-xtinySAK/src/tsk_ppfcs16.h6
-rwxr-xr-xtinySAK/src/tsk_ppfcs32.c147
-rwxr-xr-xtinySAK/src/tsk_ppfcs32.h6
-rwxr-xr-xtinySAK/src/tsk_ragel_state.c12
-rwxr-xr-xtinySAK/src/tsk_ragel_state.h19
-rwxr-xr-xtinySAK/src/tsk_runnable.c341
-rwxr-xr-xtinySAK/src/tsk_runnable.h66
-rwxr-xr-xtinySAK/src/tsk_safeobj.c6
-rwxr-xr-xtinySAK/src/tsk_safeobj.h6
-rwxr-xr-xtinySAK/src/tsk_semaphore.c148
-rwxr-xr-xtinySAK/src/tsk_semaphore.h6
-rwxr-xr-xtinySAK/src/tsk_sha1.c186
-rwxr-xr-xtinySAK/src/tsk_sha1.h16
-rwxr-xr-xtinySAK/src/tsk_string.c529
-rwxr-xr-xtinySAK/src/tsk_string.h15
-rwxr-xr-xtinySAK/src/tsk_thread.c140
-rwxr-xr-xtinySAK/src/tsk_thread.h10
-rwxr-xr-xtinySAK/src/tsk_time.c184
-rwxr-xr-xtinySAK/src/tsk_time.h6
-rwxr-xr-xtinySAK/src/tsk_timer.c596
-rwxr-xr-xtinySAK/src/tsk_timer.h6
-rwxr-xr-xtinySAK/src/tsk_url.c78
-rwxr-xr-xtinySAK/src/tsk_url.h6
-rwxr-xr-xtinySAK/src/tsk_uuid.c74
-rwxr-xr-xtinySAK/src/tsk_uuid.h6
-rwxr-xr-xtinySAK/src/tsk_xml.c306
-rwxr-xr-xtinySAK/src/tsk_xml.h100
-rwxr-xr-xtinySAK/test/stdafx.c6
-rwxr-xr-xtinySAK/test/stdafx.h6
-rwxr-xr-xtinySAK/test/targetver.h4
-rwxr-xr-xtinySAK/test/test.c159
-rwxr-xr-xtinySAK/test/test_base64.h162
-rwxr-xr-xtinySAK/test/test_buffer.h28
-rwxr-xr-xtinySAK/test/test_condwait.h64
-rwxr-xr-xtinySAK/test/test_fsm.h331
-rwxr-xr-xtinySAK/test/test_heap.h80
-rwxr-xr-xtinySAK/test/test_lists.h372
-rwxr-xr-xtinySAK/test/test_md5.h112
-rwxr-xr-xtinySAK/test/test_mutex.h58
-rwxr-xr-xtinySAK/test/test_object.h123
-rwxr-xr-xtinySAK/test/test_options.h59
-rwxr-xr-xtinySAK/test/test_params.h68
-rwxr-xr-xtinySAK/test/test_runnable.h153
-rwxr-xr-xtinySAK/test/test_safeobject.h77
-rwxr-xr-xtinySAK/test/test_semaphore.h56
-rwxr-xr-xtinySAK/test/test_sha1.h106
-rwxr-xr-xtinySAK/test/test_strings.h76
-rwxr-xr-xtinySAK/test/test_threads.h26
-rwxr-xr-xtinySAK/test/test_timer.h110
-rwxr-xr-xtinySAK/test/test_url.h26
-rwxr-xr-xtinySAK/test/test_uuid.h12
-rwxr-xr-xtinySAK/winrt/ThreadEmulation.cxx482
-rwxr-xr-xtinySAK/winrt/ThreadEmulation.h28
-rwxr-xr-xtinySDP/include/tinysdp.h6
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header.h58
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_A.h23
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_B.h23
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_C.h25
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_Dummy.h19
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_E.h21
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_I.h21
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_K.h21
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_M.h73
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_O.h95
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_P.h19
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_R.h27
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_S.h19
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_T.h25
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_U.h19
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_V.h19
-rwxr-xr-xtinySDP/include/tinysdp/headers/tsdp_header_Z.h32
-rwxr-xr-xtinySDP/include/tinysdp/parsers/tsdp_parser_message.h6
-rwxr-xr-xtinySDP/include/tinysdp/tsdp_message.h41
-rwxr-xr-xtinySDP/include/tinysdp_config.h12
-rwxr-xr-xtinySDP/include/tsdp.h6
-rwxr-xr-xtinySDP/src/headers/tsdp_header.c175
-rwxr-xr-xtinySDP/src/headers/tsdp_header_A.c622
-rwxr-xr-xtinySDP/src/headers/tsdp_header_B.c551
-rwxr-xr-xtinySDP/src/headers/tsdp_header_C.c567
-rwxr-xr-xtinySDP/src/headers/tsdp_header_Dummy.c532
-rwxr-xr-xtinySDP/src/headers/tsdp_header_E.c493
-rwxr-xr-xtinySDP/src/headers/tsdp_header_I.c495
-rwxr-xr-xtinySDP/src/headers/tsdp_header_K.c493
-rwxr-xr-xtinySDP/src/headers/tsdp_header_M.c1721
-rwxr-xr-xtinySDP/src/headers/tsdp_header_O.c645
-rwxr-xr-xtinySDP/src/headers/tsdp_header_P.c493
-rwxr-xr-xtinySDP/src/headers/tsdp_header_R.c619
-rwxr-xr-xtinySDP/src/headers/tsdp_header_S.c492
-rwxr-xr-xtinySDP/src/headers/tsdp_header_T.c593
-rwxr-xr-xtinySDP/src/headers/tsdp_header_U.c495
-rwxr-xr-xtinySDP/src/headers/tsdp_header_V.c498
-rwxr-xr-xtinySDP/src/headers/tsdp_header_Z.c754
-rwxr-xr-xtinySDP/src/parsers/tsdp_parser_message.c778
-rwxr-xr-xtinySDP/src/tsdp.c246
-rwxr-xr-xtinySDP/src/tsdp_message.c649
-rwxr-xr-xtinySDP/test/stdafx.c6
-rwxr-xr-xtinySDP/test/stdafx.h6
-rwxr-xr-xtinySDP/test/targetver.h10
-rwxr-xr-xtinySDP/test/test.c24
-rwxr-xr-xtinySDP/test/test_parser.h352
-rwxr-xr-xtinySDP/test/test_soa.h122
-rwxr-xr-xtinySIGCOMP/src/adler32.c43
-rwxr-xr-xtinySIGCOMP/src/compress.c32
-rwxr-xr-xtinySIGCOMP/src/deflate.c580
-rwxr-xr-xtinySIGCOMP/src/deflate.h16
-rwxr-xr-xtinySIGCOMP/src/tcomp.c42
-rwxr-xr-xtinySIGCOMP/src/tcomp.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_buffer.c776
-rwxr-xr-xtinySIGCOMP/src/tcomp_buffer.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_compartment.c769
-rwxr-xr-xtinySIGCOMP/src/tcomp_compartment.h45
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressor.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressor_deflate.c331
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressor_deflate.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressor_dummy.c110
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressor_dummy.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressordata.c10
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressordata.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressordisp.c293
-rwxr-xr-xtinySIGCOMP/src/tcomp_compressordisp.h17
-rwxr-xr-xtinySIGCOMP/src/tcomp_decompressordisp.c586
-rwxr-xr-xtinySIGCOMP/src/tcomp_decompressordisp.h28
-rwxr-xr-xtinySIGCOMP/src/tcomp_deflatedata.c99
-rwxr-xr-xtinySIGCOMP/src/tcomp_deflatedata.ghost.c263
-rwxr-xr-xtinySIGCOMP/src/tcomp_deflatedata.h44
-rwxr-xr-xtinySIGCOMP/src/tcomp_deflatedata.zlib.c266
-rwxr-xr-xtinySIGCOMP/src/tcomp_dicts.c90
-rwxr-xr-xtinySIGCOMP/src/tcomp_dicts.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_headers_index.h8
-rwxr-xr-xtinySIGCOMP/src/tcomp_instructions.h88
-rwxr-xr-xtinySIGCOMP/src/tcomp_manager.c360
-rwxr-xr-xtinySIGCOMP/src/tcomp_manager.h8
-rwxr-xr-xtinySIGCOMP/src/tcomp_message.c541
-rwxr-xr-xtinySIGCOMP/src/tcomp_message.h43
-rwxr-xr-xtinySIGCOMP/src/tcomp_nack_codes.h68
-rwxr-xr-xtinySIGCOMP/src/tcomp_nackinfo.c259
-rwxr-xr-xtinySIGCOMP/src/tcomp_nackinfo.h67
-rwxr-xr-xtinySIGCOMP/src/tcomp_operands.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_params.c286
-rwxr-xr-xtinySIGCOMP/src/tcomp_params.h29
-rwxr-xr-xtinySIGCOMP/src/tcomp_reqfeed.c69
-rwxr-xr-xtinySIGCOMP/src/tcomp_reqfeed.h19
-rwxr-xr-xtinySIGCOMP/src/tcomp_result.c288
-rwxr-xr-xtinySIGCOMP/src/tcomp_result.h54
-rwxr-xr-xtinySIGCOMP/src/tcomp_rfc3485_dictionary_sip.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_rfc5049_sip.h8
-rwxr-xr-xtinySIGCOMP/src/tcomp_rfc5112_dictionary_presence.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_state.c245
-rwxr-xr-xtinySIGCOMP/src/tcomp_state.h37
-rwxr-xr-xtinySIGCOMP/src/tcomp_statehandler.c663
-rwxr-xr-xtinySIGCOMP/src/tcomp_statehandler.h31
-rwxr-xr-xtinySIGCOMP/src/tcomp_types.h6
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.bytecopy.c178
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.c907
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.h53
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.instructions.c2577
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.nack.c49
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.operands.c318
-rwxr-xr-xtinySIGCOMP/src/tcomp_udvm.statemanagment.c166
-rwxr-xr-xtinySIGCOMP/src/tinysigcomp_config.h14
-rwxr-xr-xtinySIGCOMP/src/trees.c402
-rwxr-xr-xtinySIGCOMP/src/trees.h214
-rwxr-xr-xtinySIGCOMP/src/zconf.h40
-rwxr-xr-xtinySIGCOMP/src/zlib.h36
-rwxr-xr-xtinySIGCOMP/src/zutil.c186
-rwxr-xr-xtinySIGCOMP/src/zutil.h54
-rwxr-xr-xtinySIGCOMP/test/rfc4465_torture_tests.h162
-rwxr-xr-xtinySIGCOMP/test/stdafx.c6
-rwxr-xr-xtinySIGCOMP/test/stdafx.h6
-rwxr-xr-xtinySIGCOMP/test/targetver.h10
-rwxr-xr-xtinySIGCOMP/test/test.c18
-rwxr-xr-xtinySIGCOMP/test/test_manager.h658
-rwxr-xr-xtinySIGCOMP/test/test_osc.h6
-rwxr-xr-xtinySIGCOMP/test/test_tortures.h2125
-rwxr-xr-xtinySIP/include/tinysip.h6
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_common.h6
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_info.h20
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_invite.h100
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_message.h20
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_options.h24
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_publish.h26
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_register.h26
-rwxr-xr-xtinySIP/include/tinysip/api/tsip_api_subscribe.h32
-rwxr-xr-xtinySIP/include/tinysip/authentication/tsip_challenge.h39
-rwxr-xr-xtinySIP/include/tinysip/authentication/tsip_milenage.h16
-rwxr-xr-xtinySIP/include/tinysip/authentication/tsip_rijndael.h6
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog.h150
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_info.h15
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h134
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_invite.h149
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_layer.h27
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_message.h15
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_options.h15
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_publish.h21
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_register.common.h52
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_register.h21
-rwxr-xr-xtinySIP/include/tinysip/dialogs/tsip_dialog_subscribe.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header.h208
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Accept_Contact.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Accept_Encoding.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Accept_Language.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Accept_Resource_Priority.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Alert_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Allow.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Allow_Events.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Authentication_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Authorization.h39
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_CSeq.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Call_ID.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Call_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Contact.h21
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Content_Disposition.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Content_Encoding.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Content_Language.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Content_Length.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Content_Type.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Date.h31
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Dummy.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Error_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Event.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Expires.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_From.h21
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_History_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Identity.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Identity_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_In_Reply_To.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Join.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_MIME_Version.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Max_Forwards.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Min_Expires.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Min_SE.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Organization.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Access_Network_Info.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Answer_State.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Asserted_Identity.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Associated_URI.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Called_Party_ID.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Charging_Function_Addresses.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Charging_Vector.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_DCS_Billing_Info.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_DCS_LAES.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_DCS_OSPS.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_DCS_Redirect.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_DCS_Trace_Party_ID.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Early_Media.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Media_Authorization.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Preferred_Identity.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Profile_Key.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_User_Database.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_P_Visited_Network_ID.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Path.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Priority.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Privacy.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Proxy_Authenticate.h31
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Proxy_Authorization.h39
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Proxy_Require.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_RAck.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_RSeq.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Reason.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Record_Route.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Refer_Sub.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Refer_To.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Referred_By.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Reject_Contact.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Replaces.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Reply_To.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Request_Disposition.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Require.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Resource_Priority.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Retry_After.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Route.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_SIP_ETag.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_SIP_If_Match.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Security_Client.h57
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Security_Server.h57
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Security_Verify.h55
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Server.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Service_Route.h17
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Session_Expires.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Subject.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Subscription_State.h21
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Supported.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Target_Dialog.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Timestamp.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_To.h21
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Unsupported.h13
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_User_Agent.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Via.h39
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_WWW_Authenticate.h29
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_Warning.h19
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_header_accept.h15
-rwxr-xr-xtinySIP/include/tinysip/headers/tsip_headers.h8
-rwxr-xr-xtinySIP/include/tinysip/parsers/tsip_parser_header.h6
-rwxr-xr-xtinySIP/include/tinysip/parsers/tsip_parser_message.h6
-rwxr-xr-xtinySIP/include/tinysip/parsers/tsip_parser_uri.h6
-rwxr-xr-xtinySIP/include/tinysip/sigcomp/tsip_sigcomp.h6
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac.h105
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac_ict.h23
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac_ist.h25
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac_layer.h17
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac_nict.h19
-rwxr-xr-xtinySIP/include/tinysip/transactions/tsip_transac_nist.h15
-rwxr-xr-xtinySIP/include/tinysip/transports/tsip_transport.h119
-rwxr-xr-xtinySIP/include/tinysip/transports/tsip_transport_ipsec.h40
-rwxr-xr-xtinySIP/include/tinysip/transports/tsip_transport_layer.h17
-rwxr-xr-xtinySIP/include/tinysip/transports/tsip_transport_tls.h6
-rwxr-xr-xtinySIP/include/tinysip/tsip_action.h167
-rwxr-xr-xtinySIP/include/tinysip/tsip_event.h48
-rwxr-xr-xtinySIP/include/tinysip/tsip_message.h135
-rwxr-xr-xtinySIP/include/tinysip/tsip_message_common.h52
-rwxr-xr-xtinySIP/include/tinysip/tsip_ssession.h287
-rwxr-xr-xtinySIP/include/tinysip/tsip_timers.h48
-rwxr-xr-xtinySIP/include/tinysip/tsip_uri.h55
-rwxr-xr-xtinySIP/include/tinysip_config.h10
-rwxr-xr-xtinySIP/include/tsip.h425
-rwxr-xr-xtinySIP/src/api/tsip_api_common.c108
-rwxr-xr-xtinySIP/src/api/tsip_api_info.c111
-rwxr-xr-xtinySIP/src/api/tsip_api_invite.c489
-rwxr-xr-xtinySIP/src/api/tsip_api_message.c111
-rwxr-xr-xtinySIP/src/api/tsip_api_options.c109
-rwxr-xr-xtinySIP/src/api/tsip_api_publish.c157
-rwxr-xr-xtinySIP/src/api/tsip_api_register.c131
-rwxr-xr-xtinySIP/src/api/tsip_api_subscribe.c157
-rwxr-xr-xtinySIP/src/authentication/tsip_challenge.c636
-rwxr-xr-xtinySIP/src/authentication/tsip_milenage.c410
-rwxr-xr-xtinySIP/src/authentication/tsip_rijndael.c617
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog.c2239
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_info.c640
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.c2986
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.client.c418
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.ect.c594
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.hold.c306
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.ice.c326
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.qos.c30
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.server.c1092
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_invite.timers.c388
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_layer.c1156
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_message.c634
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_options.c672
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_publish.client.c821
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_register.c627
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_register.client.c524
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_register.server.c252
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_subscribe.client.c818
-rwxr-xr-xtinySIP/src/headers/tsip_header.c482
-rwxr-xr-xtinySIP/src/headers/tsip_header_Allow.c568
-rwxr-xr-xtinySIP/src/headers/tsip_header_Allow_Events.c550
-rwxr-xr-xtinySIP/src/headers/tsip_header_Authorization.c217
-rwxr-xr-xtinySIP/src/headers/tsip_header_CSeq.c532
-rwxr-xr-xtinySIP/src/headers/tsip_header_Call_ID.c512
-rwxr-xr-xtinySIP/src/headers/tsip_header_Contact.c1164
-rwxr-xr-xtinySIP/src/headers/tsip_header_Content_Length.c488
-rwxr-xr-xtinySIP/src/headers/tsip_header_Content_Type.c688
-rwxr-xr-xtinySIP/src/headers/tsip_header_Date.c754
-rwxr-xr-xtinySIP/src/headers/tsip_header_Dummy.c498
-rwxr-xr-xtinySIP/src/headers/tsip_header_Event.c764
-rwxr-xr-xtinySIP/src/headers/tsip_header_Expires.c470
-rwxr-xr-xtinySIP/src/headers/tsip_header_From.c1008
-rwxr-xr-xtinySIP/src/headers/tsip_header_Max_Forwards.c488
-rwxr-xr-xtinySIP/src/headers/tsip_header_Min_Expires.c491
-rwxr-xr-xtinySIP/src/headers/tsip_header_Min_SE.c742
-rwxr-xr-xtinySIP/src/headers/tsip_header_P_Access_Network_Info.c508
-rwxr-xr-xtinySIP/src/headers/tsip_header_P_Asserted_Identity.c2648
-rwxr-xr-xtinySIP/src/headers/tsip_header_P_Associated_URI.c954
-rwxr-xr-xtinySIP/src/headers/tsip_header_P_Charging_Function_Addresses.c1336
-rwxr-xr-xtinySIP/src/headers/tsip_header_P_Preferred_Identity.c1160
-rwxr-xr-xtinySIP/src/headers/tsip_header_Path.c922
-rwxr-xr-xtinySIP/src/headers/tsip_header_Privacy.c808
-rwxr-xr-xtinySIP/src/headers/tsip_header_Proxy_Authenticate.c179
-rwxr-xr-xtinySIP/src/headers/tsip_header_Proxy_Authorization.c217
-rwxr-xr-xtinySIP/src/headers/tsip_header_Proxy_Require.c562
-rwxr-xr-xtinySIP/src/headers/tsip_header_RAck.c540
-rwxr-xr-xtinySIP/src/headers/tsip_header_RSeq.c460
-rwxr-xr-xtinySIP/src/headers/tsip_header_Record_Route.c942
-rwxr-xr-xtinySIP/src/headers/tsip_header_Refer_Sub.c778
-rwxr-xr-xtinySIP/src/headers/tsip_header_Refer_To.c1510
-rwxr-xr-xtinySIP/src/headers/tsip_header_Referred_By.c2526
-rwxr-xr-xtinySIP/src/headers/tsip_header_Require.c544
-rwxr-xr-xtinySIP/src/headers/tsip_header_Route.c926
-rwxr-xr-xtinySIP/src/headers/tsip_header_SIP_ETag.c500
-rwxr-xr-xtinySIP/src/headers/tsip_header_SIP_If_Match.c506
-rwxr-xr-xtinySIP/src/headers/tsip_header_Security_Client.c1762
-rwxr-xr-xtinySIP/src/headers/tsip_header_Security_Server.c1732
-rwxr-xr-xtinySIP/src/headers/tsip_header_Security_Verify.c1732
-rwxr-xr-xtinySIP/src/headers/tsip_header_Server.c468
-rwxr-xr-xtinySIP/src/headers/tsip_header_Service_Route.c942
-rwxr-xr-xtinySIP/src/headers/tsip_header_Session_Expires.c968
-rwxr-xr-xtinySIP/src/headers/tsip_header_Subscription_State.c1246
-rwxr-xr-xtinySIP/src/headers/tsip_header_Supported.c558
-rwxr-xr-xtinySIP/src/headers/tsip_header_To.c1748
-rwxr-xr-xtinySIP/src/headers/tsip_header_User_Agent.c478
-rwxr-xr-xtinySIP/src/headers/tsip_header_Via.c2634
-rwxr-xr-xtinySIP/src/headers/tsip_header_WWW_Authenticate.c179
-rwxr-xr-xtinySIP/src/headers/tsip_header_Warning.c952
-rwxr-xr-xtinySIP/src/headers/tsip_header_accept.c6
-rwxr-xr-xtinySIP/src/parsers/tsip_parser_header.c12516
-rwxr-xr-xtinySIP/src/parsers/tsip_parser_message.c820
-rwxr-xr-xtinySIP/src/parsers/tsip_parser_uri.c1299
-rwxr-xr-xtinySIP/src/sigcomp/tsip_sigcomp.c652
-rwxr-xr-xtinySIP/src/transactions/tsip_transac.c340
-rwxr-xr-xtinySIP/src/transactions/tsip_transac_ict.c1180
-rwxr-xr-xtinySIP/src/transactions/tsip_transac_ist.c1008
-rwxr-xr-xtinySIP/src/transactions/tsip_transac_layer.c472
-rwxr-xr-xtinySIP/src/transactions/tsip_transac_nict.c806
-rwxr-xr-xtinySIP/src/transactions/tsip_transac_nist.c611
-rwxr-xr-xtinySIP/src/transports/tsip_transport.c1707
-rwxr-xr-xtinySIP/src/transports/tsip_transport_ipsec.c781
-rwxr-xr-xtinySIP/src/transports/tsip_transport_layer.c2408
-rwxr-xr-xtinySIP/src/tsip.c1107
-rwxr-xr-xtinySIP/src/tsip_action.c317
-rwxr-xr-xtinySIP/src/tsip_event.c113
-rwxr-xr-xtinySIP/src/tsip_message.c994
-rwxr-xr-xtinySIP/src/tsip_ssession.c1306
-rwxr-xr-xtinySIP/src/tsip_timers.c174
-rwxr-xr-xtinySIP/src/tsip_uri.c428
-rwxr-xr-xtinySIP/test/stdafx.c6
-rwxr-xr-xtinySIP/test/stdafx.h6
-rwxr-xr-xtinySIP/test/targetver.h4
-rwxr-xr-xtinySIP/test/test.c36
-rwxr-xr-xtinySIP/test/test_imsaka.h72
-rwxr-xr-xtinySIP/test/test_sipmessages.h120
-rwxr-xr-xtinySIP/test/test_stack.h832
-rwxr-xr-xtinySIP/test/test_transac.h12
-rwxr-xr-xtinySIP/test/test_uri.h224
-rwxr-xr-xtinySMS/include/tinysms.h6
-rwxr-xr-xtinySMS/include/tinysms/rpdu/tsms_rpdu.h54
-rwxr-xr-xtinySMS/include/tinysms/tpdu/tsms_tpdu_command.h92
-rwxr-xr-xtinySMS/include/tinysms/tpdu/tsms_tpdu_deliver.h81
-rwxr-xr-xtinySMS/include/tinysms/tpdu/tsms_tpdu_report.h75
-rwxr-xr-xtinySMS/include/tinysms/tpdu/tsms_tpdu_status_report.h190
-rwxr-xr-xtinySMS/include/tinysms/tpdu/tsms_tpdu_submit.h89
-rwxr-xr-xtinySMS/include/tinysms/tsms.h6
-rwxr-xr-xtinySMS/include/tinysms/tsms_address.h100
-rwxr-xr-xtinySMS/include/tinysms/tsms_common.h116
-rwxr-xr-xtinySMS/include/tinysms/tsms_etsi_gsm_03_38.h257
-rwxr-xr-xtinySMS/include/tinysms/tsms_packing.h6
-rwxr-xr-xtinySMS/include/tinysms_config.h12
-rwxr-xr-xtinySMS/src/rpdu/tsms_rpdu.c782
-rwxr-xr-xtinySMS/src/tpdu/tsms_tpdu_command.c369
-rwxr-xr-xtinySMS/src/tpdu/tsms_tpdu_deliver.c357
-rwxr-xr-xtinySMS/src/tpdu/tsms_tpdu_report.c397
-rwxr-xr-xtinySMS/src/tpdu/tsms_tpdu_status_report.c471
-rwxr-xr-xtinySMS/src/tpdu/tsms_tpdu_submit.c450
-rwxr-xr-xtinySMS/src/tsms.c22
-rwxr-xr-xtinySMS/src/tsms_address.c331
-rwxr-xr-xtinySMS/src/tsms_common.c498
-rwxr-xr-xtinySMS/src/tsms_packing.c464
-rwxr-xr-xtinySMS/test/stdafx.c6
-rwxr-xr-xtinySMS/test/stdafx.h6
-rwxr-xr-xtinySMS/test/targetver.h4
-rwxr-xr-xtinySMS/test/test.c72
-rwxr-xr-xtinySMS/test/test_packing.h185
-rwxr-xr-xtinySMS/test/test_rpdu.h407
-rwxr-xr-xtinySMS/test/test_tpdu.h366
-rwxr-xr-xtinyXCAP/include/tinyxcap.h6
-rwxr-xr-xtinyXCAP/include/tinyxcap/txcap_action.h58
-rwxr-xr-xtinyXCAP/include/tinyxcap/txcap_auid.h60
-rwxr-xr-xtinyXCAP/include/tinyxcap/txcap_document.h6
-rwxr-xr-xtinyXCAP/include/tinyxcap/txcap_node.h21
-rwxr-xr-xtinyXCAP/include/tinyxcap/txcap_selector.h6
-rwxr-xr-xtinyXCAP/include/tinyxcap_config.h12
-rwxr-xr-xtinyXCAP/include/txcap.h89
-rwxr-xr-xtinyXCAP/src/txcap.c657
-rwxr-xr-xtinyXCAP/src/txcap_action.c325
-rwxr-xr-xtinyXCAP/src/txcap_auid.c448
-rwxr-xr-xtinyXCAP/src/txcap_document.c68
-rwxr-xr-xtinyXCAP/src/txcap_node.c155
-rwxr-xr-xtinyXCAP/src/txcap_selector.c142
-rwxr-xr-xtinyXCAP/test/stdafx.c6
-rwxr-xr-xtinyXCAP/test/stdafx.h6
-rwxr-xr-xtinyXCAP/test/targetver.h4
-rwxr-xr-xtinyXCAP/test/test.c36
-rwxr-xr-xtinyXCAP/test/test_selector.h258
-rwxr-xr-xtinyXCAP/test/test_stack.h558
2065 files changed, 261053 insertions, 257120 deletions
diff --git a/.gitignore b/.gitignore
index 7d2cdbf..97fa6ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,20 @@ Debug
*.user
*.suo
*.ncb
+/bindings/csharp/Release
+/tinyDAV/Release
+/tinySIGCOMP/Release
+/tinyBFCP/Release
+/tinyMSRP/Release
+/tinyHTTP/Release
+/tinyMEDIA/Release
+/tinyNET/Release
+/tinySAK/Release
+/plugins/pluginWinMF/Release
+/tinySIP/Release
+/tinySMS/Release
+/tinyIPSec/Release
+/tinySDP/Release
+/tinyRTP/Release
+/tinyXCAP/Release
+*.orig
diff --git a/AStyle.sh b/AStyle.sh
new file mode 100644
index 0000000..560791a
--- /dev/null
+++ b/AStyle.sh
@@ -0,0 +1 @@
+./thirdparties/win32/tools/AStyle.exe --style=k/r --lineend=linux --mode=c --add-brackets --break-closing-brackets --recursive "*.c" "*.cxx" "*.h" "*.cc" \ No newline at end of file
diff --git a/Samples/C#/IPSec/ipsec_lib/IPSecCtx.cxx b/Samples/C#/IPSec/ipsec_lib/IPSecCtx.cxx
index db6bf63..13c4cf5 100755
--- a/Samples/C#/IPSec/ipsec_lib/IPSecCtx.cxx
+++ b/Samples/C#/IPSec/ipsec_lib/IPSecCtx.cxx
@@ -25,70 +25,69 @@ bool IPSecCtx::sInitialized = false;
extern "C" const tipsec_plugin_def_t *plugin_win_ipsec_vista_plugin_def_t;
IPSecCtx::IPSecCtx(tipsec_ipproto_t ipproto,
- bool use_ipv6,
- tipsec_mode_t mode,
- tipsec_ealg_t ealg,
- tipsec_alg_t alg,
- tipsec_proto_t protocol)
-: m_pCtx(NULL)
+ bool use_ipv6,
+ tipsec_mode_t mode,
+ tipsec_ealg_t ealg,
+ tipsec_alg_t alg,
+ tipsec_proto_t protocol)
+ : m_pCtx(NULL)
{
- tipsec_ctx_t* pCtx = NULL;
- if (!IPSecCtx::sInitialized)
- {
- assert (tipsec_plugin_register_static(plugin_win_ipsec_vista_plugin_def_t) == 0);
- IPSecCtx::sInitialized = true;
- }
- assert (tipsec_ctx_create(ipproto, use_ipv6, mode, ealg, alg, protocol, &m_pCtx) == 0 && m_pCtx != NULL);
+ tipsec_ctx_t* pCtx = NULL;
+ if (!IPSecCtx::sInitialized) {
+ assert (tipsec_plugin_register_static(plugin_win_ipsec_vista_plugin_def_t) == 0);
+ IPSecCtx::sInitialized = true;
+ }
+ assert (tipsec_ctx_create(ipproto, use_ipv6, mode, ealg, alg, protocol, &m_pCtx) == 0 && m_pCtx != NULL);
}
IPSecCtx::~IPSecCtx()
{
- TSK_OBJECT_SAFE_FREE(m_pCtx);
+ TSK_OBJECT_SAFE_FREE(m_pCtx);
}
tipsec_error_t IPSecCtx::start()
{
- return tipsec_ctx_start(m_pCtx);
+ return tipsec_ctx_start(m_pCtx);
}
tipsec_error_t IPSecCtx::setLocal(const char* addr_local, const char* addr_remote, tipsec_port_t port_uc, tipsec_port_t port_us)
{
- return tipsec_ctx_set_local(m_pCtx, addr_local, addr_remote, port_uc, port_us);
+ return tipsec_ctx_set_local(m_pCtx, addr_local, addr_remote, port_uc, port_us);
}
tipsec_error_t IPSecCtx::setKeys(const tipsec_key_t* ik, const tipsec_key_t* ck)
{
- return tipsec_ctx_set_keys(m_pCtx, ik, ck);
+ return tipsec_ctx_set_keys(m_pCtx, ik, ck);
}
tipsec_error_t IPSecCtx::setRemote(tipsec_spi_t spi_pc, tipsec_spi_t spi_ps, tipsec_port_t port_pc, tipsec_port_t port_ps, tipsec_lifetime_t lifetime)
{
- return tipsec_ctx_set_remote(m_pCtx, spi_pc, spi_ps, port_pc, port_ps, lifetime);
+ return tipsec_ctx_set_remote(m_pCtx, spi_pc, spi_ps, port_pc, port_ps, lifetime);
}
tipsec_error_t IPSecCtx::stop()
{
- return tipsec_ctx_stop(m_pCtx);
+ return tipsec_ctx_stop(m_pCtx);
}
tipsec_spi_t IPSecCtx::getSpiUC()
{
- return m_pCtx->spi_uc;
+ return m_pCtx->spi_uc;
}
tipsec_spi_t IPSecCtx::getSpiUS()
{
- return m_pCtx->spi_us;
+ return m_pCtx->spi_us;
}
tipsec_spi_t IPSecCtx::getSpiPC()
{
- return m_pCtx->spi_pc;
+ return m_pCtx->spi_pc;
}
tipsec_spi_t IPSecCtx::getSpiPS()
{
- return m_pCtx->spi_ps;
+ return m_pCtx->spi_ps;
}
diff --git a/Samples/C#/IPSec/ipsec_lib/IPSecCtx.h b/Samples/C#/IPSec/ipsec_lib/IPSecCtx.h
index 0e7d0ef..7aebc35 100755
--- a/Samples/C#/IPSec/ipsec_lib/IPSecCtx.h
+++ b/Samples/C#/IPSec/ipsec_lib/IPSecCtx.h
@@ -24,27 +24,27 @@
class IPSecCtx
{
public:
- IPSecCtx(tipsec_ipproto_t ipproto,
- bool use_ipv6,
- tipsec_mode_t mode,
- tipsec_ealg_t ealg,
- tipsec_alg_t alg,
- tipsec_proto_t protocol);
- virtual ~IPSecCtx();
- tipsec_error_t start();
- tipsec_error_t setLocal(const char* addr_local, const char* addr_remote, tipsec_port_t port_uc, tipsec_port_t port_us);
- tipsec_error_t setKeys(const tipsec_key_t* ik, const tipsec_key_t* ck);
- tipsec_error_t setRemote(tipsec_spi_t spi_pc, tipsec_spi_t spi_ps, tipsec_port_t port_pc, tipsec_port_t port_ps, tipsec_lifetime_t lifetime);
- tipsec_error_t stop();
+ IPSecCtx(tipsec_ipproto_t ipproto,
+ bool use_ipv6,
+ tipsec_mode_t mode,
+ tipsec_ealg_t ealg,
+ tipsec_alg_t alg,
+ tipsec_proto_t protocol);
+ virtual ~IPSecCtx();
+ tipsec_error_t start();
+ tipsec_error_t setLocal(const char* addr_local, const char* addr_remote, tipsec_port_t port_uc, tipsec_port_t port_us);
+ tipsec_error_t setKeys(const tipsec_key_t* ik, const tipsec_key_t* ck);
+ tipsec_error_t setRemote(tipsec_spi_t spi_pc, tipsec_spi_t spi_ps, tipsec_port_t port_pc, tipsec_port_t port_ps, tipsec_lifetime_t lifetime);
+ tipsec_error_t stop();
- tipsec_spi_t getSpiUC();
- tipsec_spi_t getSpiUS();
- tipsec_spi_t getSpiPC();
- tipsec_spi_t getSpiPS();
+ tipsec_spi_t getSpiUC();
+ tipsec_spi_t getSpiUS();
+ tipsec_spi_t getSpiPC();
+ tipsec_spi_t getSpiPS();
private:
- static bool sInitialized;
- tipsec_ctx_t* m_pCtx;
+ static bool sInitialized;
+ tipsec_ctx_t* m_pCtx;
};
#endif /* IPSEC_CTX_H */
diff --git a/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.cxx b/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.cxx
index 336643d..0e443a3 100755
--- a/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.cxx
+++ b/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.cxx
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGCSHARP
@@ -14,24 +14,43 @@
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
- struct SwigMovePointer {
- T *ptr;
- SwigMovePointer(T *p) : ptr(p) { }
- ~SwigMovePointer() { delete ptr; }
- SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
- } pointer;
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
- SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+template<typename T> class SwigValueWrapper
+{
+ struct SwigMovePointer {
+ T *ptr;
+ SwigMovePointer(T *p) : ptr(p) { }
+ ~SwigMovePointer() {
+ delete ptr;
+ }
+ SwigMovePointer& operator=(SwigMovePointer& rhs) {
+ T* oldptr = ptr;
+ ptr = 0;
+ delete oldptr;
+ ptr = rhs.ptr;
+ rhs.ptr = 0;
+ return *this;
+ }
+ } pointer;
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
- SwigValueWrapper() : pointer(0) { }
- SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
- operator T&() const { return *pointer.ptr; }
- T *operator&() { return pointer.ptr; }
+ SwigValueWrapper() : pointer(0) { }
+ SwigValueWrapper& operator=(const T& t) {
+ SwigMovePointer tmp(new T(t));
+ pointer = tmp;
+ return *this;
+ }
+ operator T&() const {
+ return *pointer.ptr;
+ }
+ T *operator&() {
+ return pointer.ptr;
+ }
};
-template <typename T> T SwigValueInit() {
- return T();
+template <typename T> T SwigValueInit()
+{
+ return T();
}
#endif
@@ -66,28 +85,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -130,7 +149,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -150,116 +169,120 @@ template <typename T> T SwigValueInit() {
#include <stdio.h>
-/* Support for throwing C# exceptions from C/C++. There are two types:
+/* Support for throwing C# exceptions from C/C++. There are two types:
* Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */
typedef enum {
- SWIG_CSharpApplicationException,
- SWIG_CSharpArithmeticException,
- SWIG_CSharpDivideByZeroException,
- SWIG_CSharpIndexOutOfRangeException,
- SWIG_CSharpInvalidCastException,
- SWIG_CSharpInvalidOperationException,
- SWIG_CSharpIOException,
- SWIG_CSharpNullReferenceException,
- SWIG_CSharpOutOfMemoryException,
- SWIG_CSharpOverflowException,
- SWIG_CSharpSystemException
+ SWIG_CSharpApplicationException,
+ SWIG_CSharpArithmeticException,
+ SWIG_CSharpDivideByZeroException,
+ SWIG_CSharpIndexOutOfRangeException,
+ SWIG_CSharpInvalidCastException,
+ SWIG_CSharpInvalidOperationException,
+ SWIG_CSharpIOException,
+ SWIG_CSharpNullReferenceException,
+ SWIG_CSharpOutOfMemoryException,
+ SWIG_CSharpOverflowException,
+ SWIG_CSharpSystemException
} SWIG_CSharpExceptionCodes;
typedef enum {
- SWIG_CSharpArgumentException,
- SWIG_CSharpArgumentNullException,
- SWIG_CSharpArgumentOutOfRangeException
+ SWIG_CSharpArgumentException,
+ SWIG_CSharpArgumentNullException,
+ SWIG_CSharpArgumentOutOfRangeException
} SWIG_CSharpExceptionArgumentCodes;
typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);
typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);
typedef struct {
- SWIG_CSharpExceptionCodes code;
- SWIG_CSharpExceptionCallback_t callback;
+ SWIG_CSharpExceptionCodes code;
+ SWIG_CSharpExceptionCallback_t callback;
} SWIG_CSharpException_t;
typedef struct {
- SWIG_CSharpExceptionArgumentCodes code;
- SWIG_CSharpExceptionArgumentCallback_t callback;
+ SWIG_CSharpExceptionArgumentCodes code;
+ SWIG_CSharpExceptionArgumentCallback_t callback;
} SWIG_CSharpExceptionArgument_t;
static SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
- { SWIG_CSharpApplicationException, NULL },
- { SWIG_CSharpArithmeticException, NULL },
- { SWIG_CSharpDivideByZeroException, NULL },
- { SWIG_CSharpIndexOutOfRangeException, NULL },
- { SWIG_CSharpInvalidCastException, NULL },
- { SWIG_CSharpInvalidOperationException, NULL },
- { SWIG_CSharpIOException, NULL },
- { SWIG_CSharpNullReferenceException, NULL },
- { SWIG_CSharpOutOfMemoryException, NULL },
- { SWIG_CSharpOverflowException, NULL },
- { SWIG_CSharpSystemException, NULL }
+ { SWIG_CSharpApplicationException, NULL },
+ { SWIG_CSharpArithmeticException, NULL },
+ { SWIG_CSharpDivideByZeroException, NULL },
+ { SWIG_CSharpIndexOutOfRangeException, NULL },
+ { SWIG_CSharpInvalidCastException, NULL },
+ { SWIG_CSharpInvalidOperationException, NULL },
+ { SWIG_CSharpIOException, NULL },
+ { SWIG_CSharpNullReferenceException, NULL },
+ { SWIG_CSharpOutOfMemoryException, NULL },
+ { SWIG_CSharpOverflowException, NULL },
+ { SWIG_CSharpSystemException, NULL }
};
static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
- { SWIG_CSharpArgumentException, NULL },
- { SWIG_CSharpArgumentNullException, NULL },
- { SWIG_CSharpArgumentOutOfRangeException, NULL }
+ { SWIG_CSharpArgumentException, NULL },
+ { SWIG_CSharpArgumentNullException, NULL },
+ { SWIG_CSharpArgumentOutOfRangeException, NULL }
};
-static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
- SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
- if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
- callback = SWIG_csharp_exceptions[code].callback;
- }
- callback(msg);
+static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg)
+{
+ SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
+ if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
+ callback = SWIG_csharp_exceptions[code].callback;
+ }
+ callback(msg);
}
-static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
- SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
- if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
- callback = SWIG_csharp_exceptions_argument[code].callback;
- }
- callback(msg, param_name);
+static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name)
+{
+ SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
+ if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
+ callback = SWIG_csharp_exceptions_argument[code].callback;
+ }
+ callback(msg, param_name);
}
#ifdef __cplusplus
-extern "C"
+extern "C"
#endif
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_ipsec_lib(
- SWIG_CSharpExceptionCallback_t applicationCallback,
- SWIG_CSharpExceptionCallback_t arithmeticCallback,
- SWIG_CSharpExceptionCallback_t divideByZeroCallback,
- SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,
- SWIG_CSharpExceptionCallback_t invalidCastCallback,
- SWIG_CSharpExceptionCallback_t invalidOperationCallback,
- SWIG_CSharpExceptionCallback_t ioCallback,
- SWIG_CSharpExceptionCallback_t nullReferenceCallback,
- SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
- SWIG_CSharpExceptionCallback_t overflowCallback,
- SWIG_CSharpExceptionCallback_t systemCallback) {
- SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;
- SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;
- SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback;
- SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback;
- SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback;
- SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback;
- SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback;
- SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback;
- SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback;
- SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback;
- SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback;
+ SWIG_CSharpExceptionCallback_t applicationCallback,
+ SWIG_CSharpExceptionCallback_t arithmeticCallback,
+ SWIG_CSharpExceptionCallback_t divideByZeroCallback,
+ SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,
+ SWIG_CSharpExceptionCallback_t invalidCastCallback,
+ SWIG_CSharpExceptionCallback_t invalidOperationCallback,
+ SWIG_CSharpExceptionCallback_t ioCallback,
+ SWIG_CSharpExceptionCallback_t nullReferenceCallback,
+ SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
+ SWIG_CSharpExceptionCallback_t overflowCallback,
+ SWIG_CSharpExceptionCallback_t systemCallback)
+{
+SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;
+SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;
+SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback;
+SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback;
+SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback;
+SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback;
+SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback;
+SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback;
+SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback;
+SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback;
+SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback;
}
#ifdef __cplusplus
-extern "C"
+extern "C"
#endif
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_ipsec_lib(
- SWIG_CSharpExceptionArgumentCallback_t argumentCallback,
- SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,
- SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) {
- SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback;
- SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback;
- SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;
+ SWIG_CSharpExceptionArgumentCallback_t argumentCallback,
+ SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,
+ SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback)
+{
+SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback;
+SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback;
+SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;
}
@@ -269,10 +292,11 @@ static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;
#ifdef __cplusplus
-extern "C"
+extern "C"
#endif
-SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStringHelperCallback callback) {
- SWIG_csharp_string_callback = callback;
+SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStringHelperCallback callback)
+{
+SWIG_csharp_string_callback = callback;
}
@@ -283,7 +307,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStri
/* -----------------------------------------------------------------------------
* director.swg
*
- * This file contains support for director classes so that C# proxy
+ * This file contains support for director classes so that C# proxy
* methods can be called from C++.
* ----------------------------------------------------------------------------- */
@@ -294,34 +318,38 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStri
#endif
#include <string>
-namespace Swig {
- /* Director base class - not currently used in C# directors */
- class Director {
- };
+namespace Swig
+{
+/* Director base class - not currently used in C# directors */
+class Director
+{
+};
- /* Base class for director exceptions */
- class DirectorException {
- protected:
+/* Base class for director exceptions */
+class DirectorException
+{
+protected:
std::string swig_msg;
- public:
+public:
DirectorException(const char* msg) : swig_msg(msg) {
}
DirectorException(const std::string &msg) : swig_msg(msg) {
}
const std::string& what() const {
- return swig_msg;
+ return swig_msg;
}
virtual ~DirectorException() {
}
- };
+};
- /* Pure virtual method exception */
- class DirectorPureVirtualException : public Swig::DirectorException {
- public:
+/* Pure virtual method exception */
+class DirectorPureVirtualException : public Swig::DirectorException
+{
+public:
DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) {
}
- };
+};
}
#endif /* __cplusplus */
@@ -346,163 +374,174 @@ namespace Swig {
extern "C" {
#endif
-SWIGEXPORT void * SWIGSTDCALL CSharp_new_IPSecCtx(int jarg1, unsigned int jarg2, int jarg3, int jarg4, int jarg5, int jarg6) {
- void * jresult ;
- tipsec_ipproto_t arg1 ;
- bool arg2 ;
- tipsec_mode_t arg3 ;
- tipsec_ealg_t arg4 ;
- tipsec_alg_t arg5 ;
- tipsec_proto_t arg6 ;
- IPSecCtx *result = 0 ;
-
- arg1 = (tipsec_ipproto_t)jarg1;
- arg2 = jarg2 ? true : false;
- arg3 = (tipsec_mode_t)jarg3;
- arg4 = (tipsec_ealg_t)jarg4;
- arg5 = (tipsec_alg_t)jarg5;
- arg6 = (tipsec_proto_t)jarg6;
- result = (IPSecCtx *)new IPSecCtx(arg1,arg2,arg3,arg4,arg5,arg6);
- jresult = (void *)result;
- return jresult;
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_IPSecCtx(int jarg1, unsigned int jarg2, int jarg3, int jarg4, int jarg5, int jarg6)
+{
+ void * jresult ;
+ tipsec_ipproto_t arg1 ;
+ bool arg2 ;
+ tipsec_mode_t arg3 ;
+ tipsec_ealg_t arg4 ;
+ tipsec_alg_t arg5 ;
+ tipsec_proto_t arg6 ;
+ IPSecCtx *result = 0 ;
+
+ arg1 = (tipsec_ipproto_t)jarg1;
+ arg2 = jarg2 ? true : false;
+ arg3 = (tipsec_mode_t)jarg3;
+ arg4 = (tipsec_ealg_t)jarg4;
+ arg5 = (tipsec_alg_t)jarg5;
+ arg6 = (tipsec_proto_t)jarg6;
+ result = (IPSecCtx *)new IPSecCtx(arg1,arg2,arg3,arg4,arg5,arg6);
+ jresult = (void *)result;
+ return jresult;
}
-SWIGEXPORT void SWIGSTDCALL CSharp_delete_IPSecCtx(void * jarg1) {
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
-
- arg1 = (IPSecCtx *)jarg1;
- delete arg1;
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_IPSecCtx(void * jarg1)
+{
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+
+ arg1 = (IPSecCtx *)jarg1;
+ delete arg1;
}
-SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_start(void * jarg1) {
- int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_error_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_error_t)(arg1)->start();
- jresult = result;
- return jresult;
+SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_start(void * jarg1)
+{
+ int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_error_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_error_t)(arg1)->start();
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setLocal(void * jarg1, char * jarg2, char * jarg3, unsigned short jarg4, unsigned short jarg5) {
- int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- tipsec_port_t arg4 ;
- tipsec_port_t arg5 ;
- tipsec_error_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- arg2 = (char *)jarg2;
- arg3 = (char *)jarg3;
- arg4 = (tipsec_port_t)jarg4;
- arg5 = (tipsec_port_t)jarg5;
- result = (tipsec_error_t)(arg1)->setLocal((char const *)arg2,(char const *)arg3,arg4,arg5);
- jresult = result;
- return jresult;
+SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setLocal(void * jarg1, char * jarg2, char * jarg3, unsigned short jarg4, unsigned short jarg5)
+{
+ int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ tipsec_port_t arg4 ;
+ tipsec_port_t arg5 ;
+ tipsec_error_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ arg2 = (char *)jarg2;
+ arg3 = (char *)jarg3;
+ arg4 = (tipsec_port_t)jarg4;
+ arg5 = (tipsec_port_t)jarg5;
+ result = (tipsec_error_t)(arg1)->setLocal((char const *)arg2,(char const *)arg3,arg4,arg5);
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setKeys(void * jarg1, void * jarg2, void * jarg3) {
- int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_key_t *arg2 = (tipsec_key_t *) 0 ;
- tipsec_key_t *arg3 = (tipsec_key_t *) 0 ;
- tipsec_error_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- arg2 = jarg2;
- arg3 = jarg3;
- result = (tipsec_error_t)(arg1)->setKeys((tipsec_key_t const *)arg2,(tipsec_key_t const *)arg3);
- jresult = result;
- return jresult;
+SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setKeys(void * jarg1, void * jarg2, void * jarg3)
+{
+ int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_key_t *arg2 = (tipsec_key_t *) 0 ;
+ tipsec_key_t *arg3 = (tipsec_key_t *) 0 ;
+ tipsec_error_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ arg2 = jarg2;
+ arg3 = jarg3;
+ result = (tipsec_error_t)(arg1)->setKeys((tipsec_key_t const *)arg2,(tipsec_key_t const *)arg3);
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setRemote(void * jarg1, unsigned int jarg2, unsigned int jarg3, unsigned short jarg4, unsigned short jarg5, unsigned long long jarg6) {
- int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_spi_t arg2 ;
- tipsec_spi_t arg3 ;
- tipsec_port_t arg4 ;
- tipsec_port_t arg5 ;
- tipsec_lifetime_t arg6 ;
- tipsec_error_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- arg2 = (tipsec_spi_t)jarg2;
- arg3 = (tipsec_spi_t)jarg3;
- arg4 = (tipsec_port_t)jarg4;
- arg5 = (tipsec_port_t)jarg5;
- arg6 = (tipsec_lifetime_t)jarg6;
- result = (tipsec_error_t)(arg1)->setRemote(arg2,arg3,arg4,arg5,arg6);
- jresult = result;
- return jresult;
+SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setRemote(void * jarg1, unsigned int jarg2, unsigned int jarg3, unsigned short jarg4, unsigned short jarg5, unsigned long long jarg6)
+{
+ int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_spi_t arg2 ;
+ tipsec_spi_t arg3 ;
+ tipsec_port_t arg4 ;
+ tipsec_port_t arg5 ;
+ tipsec_lifetime_t arg6 ;
+ tipsec_error_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ arg2 = (tipsec_spi_t)jarg2;
+ arg3 = (tipsec_spi_t)jarg3;
+ arg4 = (tipsec_port_t)jarg4;
+ arg5 = (tipsec_port_t)jarg5;
+ arg6 = (tipsec_lifetime_t)jarg6;
+ result = (tipsec_error_t)(arg1)->setRemote(arg2,arg3,arg4,arg5,arg6);
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_stop(void * jarg1) {
- int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_error_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_error_t)(arg1)->stop();
- jresult = result;
- return jresult;
+SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_stop(void * jarg1)
+{
+ int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_error_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_error_t)(arg1)->stop();
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUC(void * jarg1) {
- unsigned int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_spi_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_spi_t)(arg1)->getSpiUC();
- jresult = result;
- return jresult;
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUC(void * jarg1)
+{
+ unsigned int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_spi_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_spi_t)(arg1)->getSpiUC();
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUS(void * jarg1) {
- unsigned int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_spi_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_spi_t)(arg1)->getSpiUS();
- jresult = result;
- return jresult;
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUS(void * jarg1)
+{
+ unsigned int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_spi_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_spi_t)(arg1)->getSpiUS();
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPC(void * jarg1) {
- unsigned int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_spi_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_spi_t)(arg1)->getSpiPC();
- jresult = result;
- return jresult;
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPC(void * jarg1)
+{
+ unsigned int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_spi_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_spi_t)(arg1)->getSpiPC();
+ jresult = result;
+ return jresult;
}
-SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPS(void * jarg1) {
- unsigned int jresult ;
- IPSecCtx *arg1 = (IPSecCtx *) 0 ;
- tipsec_spi_t result;
-
- arg1 = (IPSecCtx *)jarg1;
- result = (tipsec_spi_t)(arg1)->getSpiPS();
- jresult = result;
- return jresult;
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPS(void * jarg1)
+{
+ unsigned int jresult ;
+ IPSecCtx *arg1 = (IPSecCtx *) 0 ;
+ tipsec_spi_t result;
+
+ arg1 = (IPSecCtx *)jarg1;
+ result = (tipsec_spi_t)(arg1)->getSpiPS();
+ jresult = result;
+ return jresult;
}
diff --git a/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.h b/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.h
index 49aa0fe..30b3b0e 100755
--- a/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.h
+++ b/Samples/C#/IPSec/ipsec_lib/ipsecWRAP.h
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_ipsec_lib_WRAP_H_
diff --git a/Samples/C++/REGISTER/test/targetver.h b/Samples/C++/REGISTER/test/targetver.h
index 6fe8eb7..5697f1a 100755
--- a/Samples/C++/REGISTER/test/targetver.h
+++ b/Samples/C++/REGISTER/test/targetver.h
@@ -1,8 +1,8 @@
#pragma once
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/android-utils/api.cxx b/android-utils/api.cxx
index d9573c4..68cf59a 100755
--- a/android-utils/api.cxx
+++ b/android-utils/api.cxx
@@ -8,5 +8,5 @@ uint64_t AndroidUtils::getCpuFamily()
uint64_t AndroidUtils::getCpuFeatures()
{
- return (uint64_t)android_getCpuFeatures();
+ return (uint64_t)android_getCpuFeatures();
} \ No newline at end of file
diff --git a/android-utils/api.h b/android-utils/api.h
index 0b9dc54..e8c4f12 100755
--- a/android-utils/api.h
+++ b/android-utils/api.h
@@ -3,30 +3,28 @@
#include <stdint.h>
-typedef enum CpuFamily_e
-{
- UNKNOWN = 0,
- ARM,
- X86
+typedef enum CpuFamily_e {
+ UNKNOWN = 0,
+ ARM,
+ X86
}
CpuFamily_t;
-typedef enum CpuFeatures_e
-{
- ARMv7 = 1,
- VFPv3 = 2,
- NEON = 4
+typedef enum CpuFeatures_e {
+ ARMv7 = 1,
+ VFPv3 = 2,
+ NEON = 4
}
CpuFeatures_t;
class AndroidUtils
{
public:
- AndroidUtils(){};
- virtual ~AndroidUtils(){};
+ AndroidUtils() {};
+ virtual ~AndroidUtils() {};
- static uint64_t getCpuFamily();
- static uint64_t getCpuFeatures();
+ static uint64_t getCpuFamily();
+ static uint64_t getCpuFeatures();
};
#endif /* ANDROID_UTILS_API_H */
diff --git a/android-utils/cpu-features.c b/android-utils/cpu-features.c
index 70f5545..09db061 100755
--- a/android-utils/cpu-features.c
+++ b/android-utils/cpu-features.c
@@ -85,13 +85,13 @@ static __inline__ void x86_cpuid(int func, int values[4])
/* We need to preserve ebx since we're compiling PIC code */
/* this means we can't use "=b" for the second output register */
__asm__ __volatile__ ( \
- "push %%ebx\n"
- "cpuid\n" \
- "mov %1, %%ebx\n"
- "pop %%ebx\n"
- : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
- : "a" (func) \
- );
+ "push %%ebx\n"
+ "cpuid\n" \
+ "mov %1, %%ebx\n"
+ "pop %%ebx\n"
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "a" (func) \
+ );
values[0] = a;
values[1] = b;
values[2] = c;
@@ -110,12 +110,14 @@ read_file(const char* pathname, char* buffer, size_t buffsize)
int fd, len;
fd = open(pathname, O_RDONLY);
- if (fd < 0)
+ if (fd < 0) {
return -1;
+ }
do {
len = read(fd, buffer, buffsize);
- } while (len < 0 && errno == EINTR);
+ }
+ while (len < 0 && errno == EINTR);
close(fd);
@@ -143,11 +145,13 @@ extract_cpuinfo_field(char* buffer, int buflen, const char* field)
bufend = buffer + buflen;
for (;;) {
p = memmem(p, bufend-p, field, fieldlen);
- if (p == NULL)
+ if (p == NULL) {
goto EXIT;
+ }
- if (p == buffer || p[-1] == '\n')
+ if (p == buffer || p[-1] == '\n') {
break;
+ }
p += fieldlen;
}
@@ -155,20 +159,23 @@ extract_cpuinfo_field(char* buffer, int buflen, const char* field)
/* Skip to the first column followed by a space */
p += fieldlen;
p = memchr(p, ':', bufend-p);
- if (p == NULL || p[1] != ' ')
+ if (p == NULL || p[1] != ' ') {
goto EXIT;
+ }
/* Find the end of the line */
p += 2;
q = memchr(p, '\n', bufend-p);
- if (q == NULL)
+ if (q == NULL) {
q = bufend;
+ }
/* Copy the line into a heap-allocated buffer */
len = q-p;
result = malloc(len+1);
- if (result == NULL)
+ if (result == NULL) {
goto EXIT;
+ }
memcpy(result, p, len);
result[len] = '\0';
@@ -190,23 +197,27 @@ has_list_item(const char* list, const char* item)
const char* p = list;
int itemlen = strlen(item);
- if (list == NULL)
+ if (list == NULL) {
return 0;
+ }
while (*p) {
const char* q;
/* skip spaces */
- while (*p == ' ' || *p == '\t')
+ while (*p == ' ' || *p == '\t') {
p++;
+ }
/* find end of current list item */
q = p;
- while (*q && *q != ' ' && *q != '\t')
+ while (*q && *q != ' ' && *q != '\t') {
q++;
+ }
- if (itemlen == q-p && !memcmp(p, item, itemlen))
+ if (itemlen == q-p && !memcmp(p, item, itemlen)) {
return 1;
+ }
/* skip to next item */
p = q;
@@ -231,13 +242,15 @@ parse_decimal(const char* input, const char* limit, int* result)
int val = 0;
while (p < limit) {
int d = (*p - '0');
- if ((unsigned)d >= 10U)
+ if ((unsigned)d >= 10U) {
break;
+ }
val = val*10 + d;
p++;
}
- if (p == input)
+ if (p == input) {
return NULL;
+ }
*result = val;
return p;
@@ -254,24 +267,28 @@ typedef struct {
} CpuList;
static __inline__ void
-cpulist_init(CpuList* list) {
+cpulist_init(CpuList* list)
+{
list->mask = 0;
}
static __inline__ void
-cpulist_and(CpuList* list1, CpuList* list2) {
+cpulist_and(CpuList* list1, CpuList* list2)
+{
list1->mask &= list2->mask;
}
static __inline__ void
-cpulist_set(CpuList* list, int index) {
+cpulist_set(CpuList* list, int index)
+{
if ((unsigned)index < 32) {
list->mask |= (uint32_t)(1U << index);
}
}
static __inline__ int
-cpulist_count(CpuList* list) {
+cpulist_count(CpuList* list)
+{
return __builtin_popcount(list->mask);
}
@@ -295,8 +312,7 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
/* NOTE: the input line coming from sysfs typically contains a
* trailing newline, so take care of it in the code below
*/
- while (p < end && *p != '\n')
- {
+ while (p < end && *p != '\n') {
int val, start_value, end_value;
/* Find the end of current item, and put it into 'q' */
@@ -307,8 +323,9 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
/* Get first value */
p = parse_decimal(p, q, &start_value);
- if (p == NULL)
+ if (p == NULL) {
goto BAD_FORMAT;
+ }
end_value = start_value;
@@ -317,8 +334,9 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
*/
if (p < q && *p == '-') {
p = parse_decimal(p+1, q, &end_value);
- if (p == NULL)
+ if (p == NULL) {
goto BAD_FORMAT;
+ }
}
/* Set bits CPU list bits */
@@ -328,8 +346,9 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
/* Jump to next item */
p = q;
- if (p < end)
+ if (p < end) {
p++;
+ }
}
BAD_FORMAT:
@@ -391,7 +410,7 @@ android_cpuInit(void)
D("cpuinfo_len is (%d):\n%.*s\n", cpuinfo_len,
cpuinfo_len >= 0 ? cpuinfo_len : 0, cpuinfo);
- if (cpuinfo_len < 0) /* should not happen */ {
+ if (cpuinfo_len < 0) { /* should not happen */
return;
}
@@ -478,11 +497,13 @@ android_cpuInit(void)
D("found cpuFeatures = '%s'\n", cpuFeatures);
- if (has_list_item(cpuFeatures, "vfpv3"))
+ if (has_list_item(cpuFeatures, "vfpv3")) {
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3;
+ }
- else if (has_list_item(cpuFeatures, "vfpv3d16"))
+ else if (has_list_item(cpuFeatures, "vfpv3d16")) {
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3;
+ }
if (has_list_item(cpuFeatures, "neon")) {
/* Note: Certain kernels only report neon but not vfpv3
@@ -503,7 +524,7 @@ android_cpuInit(void)
int regs[4];
-/* According to http://en.wikipedia.org/wiki/CPUID */
+ /* According to http://en.wikipedia.org/wiki/CPUID */
#define VENDOR_INTEL_b 0x756e6547
#define VENDOR_INTEL_c 0x6c65746e
#define VENDOR_INTEL_d 0x49656e69
diff --git a/android-utils/utils_wrap.cxx b/android-utils/utils_wrap.cxx
index dd0f9b1..9a43bda 100755
--- a/android-utils/utils_wrap.cxx
+++ b/android-utils/utils_wrap.cxx
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.4
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGJAVA
@@ -14,24 +14,43 @@
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
- struct SwigMovePointer {
- T *ptr;
- SwigMovePointer(T *p) : ptr(p) { }
- ~SwigMovePointer() { delete ptr; }
- SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
- } pointer;
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
- SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+template<typename T> class SwigValueWrapper
+{
+ struct SwigMovePointer {
+ T *ptr;
+ SwigMovePointer(T *p) : ptr(p) { }
+ ~SwigMovePointer() {
+ delete ptr;
+ }
+ SwigMovePointer& operator=(SwigMovePointer& rhs) {
+ T* oldptr = ptr;
+ ptr = 0;
+ delete oldptr;
+ ptr = rhs.ptr;
+ rhs.ptr = 0;
+ return *this;
+ }
+ } pointer;
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
- SwigValueWrapper() : pointer(0) { }
- SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
- operator T&() const { return *pointer.ptr; }
- T *operator&() { return pointer.ptr; }
+ SwigValueWrapper() : pointer(0) { }
+ SwigValueWrapper& operator=(const T& t) {
+ SwigMovePointer tmp(new T(t));
+ pointer = tmp;
+ return *this;
+ }
+ operator T&() const {
+ return *pointer.ptr;
+ }
+ T *operator&() {
+ return pointer.ptr;
+ }
};
-template <typename T> T SwigValueInit() {
- return T();
+template <typename T> T SwigValueInit()
+{
+ return T();
}
#endif
@@ -66,28 +85,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -130,7 +149,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -147,7 +166,7 @@ template <typename T> T SwigValueInit() {
/* Fix for jlong on some versions of gcc on Windows */
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
- typedef long long __int64;
+typedef long long __int64;
#endif
/* Fix for jlong on 64-bit x86 Solaris */
@@ -164,46 +183,49 @@ template <typename T> T SwigValueInit() {
/* Support for throwing Java exceptions */
typedef enum {
- SWIG_JavaOutOfMemoryError = 1,
- SWIG_JavaIOException,
- SWIG_JavaRuntimeException,
- SWIG_JavaIndexOutOfBoundsException,
- SWIG_JavaArithmeticException,
- SWIG_JavaIllegalArgumentException,
- SWIG_JavaNullPointerException,
- SWIG_JavaDirectorPureVirtual,
- SWIG_JavaUnknownError
+ SWIG_JavaOutOfMemoryError = 1,
+ SWIG_JavaIOException,
+ SWIG_JavaRuntimeException,
+ SWIG_JavaIndexOutOfBoundsException,
+ SWIG_JavaArithmeticException,
+ SWIG_JavaIllegalArgumentException,
+ SWIG_JavaNullPointerException,
+ SWIG_JavaDirectorPureVirtual,
+ SWIG_JavaUnknownError
} SWIG_JavaExceptionCodes;
typedef struct {
- SWIG_JavaExceptionCodes code;
- const char *java_exception;
+ SWIG_JavaExceptionCodes code;
+ const char *java_exception;
} SWIG_JavaExceptions_t;
-static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
- jclass excep;
- static const SWIG_JavaExceptions_t java_exceptions[] = {
- { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
- { SWIG_JavaIOException, "java/io/IOException" },
- { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
- { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
- { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
- { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
- { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
- { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
- { SWIG_JavaUnknownError, "java/lang/UnknownError" },
- { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
- };
- const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
-
- while (except_ptr->code != code && except_ptr->code)
- except_ptr++;
-
- jenv->ExceptionClear();
- excep = jenv->FindClass(except_ptr->java_exception);
- if (excep)
- jenv->ThrowNew(excep, msg);
+static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg)
+{
+ jclass excep;
+ static const SWIG_JavaExceptions_t java_exceptions[] = {
+ { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
+ { SWIG_JavaIOException, "java/io/IOException" },
+ { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
+ { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
+ { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
+ { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
+ { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
+ { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
+ { SWIG_JavaUnknownError, "java/lang/UnknownError" },
+ { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
+ };
+ const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
+
+ while (except_ptr->code != code && except_ptr->code) {
+ except_ptr++;
+ }
+
+ jenv->ExceptionClear();
+ excep = jenv->FindClass(except_ptr->java_exception);
+ if (excep) {
+ jenv->ThrowNew(excep, msg);
+ }
}
@@ -224,127 +246,139 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
#include <iostream>
#endif
-namespace Swig {
- /* Java object wrapper */
- class JObjectWrapper {
- public:
+namespace Swig
+{
+/* Java object wrapper */
+class JObjectWrapper
+{
+public:
JObjectWrapper() : jthis_(NULL), weak_global_(true) {
}
~JObjectWrapper() {
- jthis_ = NULL;
- weak_global_ = true;
+ jthis_ = NULL;
+ weak_global_ = true;
}
bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) {
- if (!jthis_) {
- weak_global_ = weak_global;
- if (jobj)
- jthis_ = ((weak_global_ || !mem_own) ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj));
+ if (!jthis_) {
+ weak_global_ = weak_global;
+ if (jobj) {
+ jthis_ = ((weak_global_ || !mem_own) ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj));
+ }
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl;
+ std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl;
#endif
- return true;
- } else {
+ return true;
+ }
+ else {
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl;
+ std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl;
#endif
- return false;
- }
+ return false;
+ }
}
jobject get(JNIEnv *jenv) const {
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "JObjectWrapper::get(";
- if (jthis_)
- std::cout << jthis_;
- else
- std::cout << "null";
- std::cout << ") -> return new local ref" << std::endl;
+ std::cout << "JObjectWrapper::get(";
+ if (jthis_) {
+ std::cout << jthis_;
+ }
+ else {
+ std::cout << "null";
+ }
+ std::cout << ") -> return new local ref" << std::endl;
#endif
- return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_);
+ return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_);
}
void release(JNIEnv *jenv) {
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl;
+ std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl;
#endif
- if (jthis_) {
- if (weak_global_) {
- if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE)
- jenv->DeleteWeakGlobalRef((jweak)jthis_);
- } else
- jenv->DeleteGlobalRef(jthis_);
- }
-
- jthis_ = NULL;
- weak_global_ = true;
+ if (jthis_) {
+ if (weak_global_) {
+ if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) {
+ jenv->DeleteWeakGlobalRef((jweak)jthis_);
+ }
+ }
+ else {
+ jenv->DeleteGlobalRef(jthis_);
+ }
+ }
+
+ jthis_ = NULL;
+ weak_global_ = true;
}
jobject peek() {
- return jthis_;
+ return jthis_;
}
/* Java proxy releases ownership of C++ object, C++ object is now
responsible for destruction (creates NewGlobalRef to pin Java
proxy) */
void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
- if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */
- if (!weak_global_) {
- jenv->DeleteGlobalRef(jthis_);
- jthis_ = jenv->NewWeakGlobalRef(jself);
- weak_global_ = true;
+ if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */
+ if (!weak_global_) {
+ jenv->DeleteGlobalRef(jthis_);
+ jthis_ = jenv->NewWeakGlobalRef(jself);
+ weak_global_ = true;
+ }
}
- } else { /* Java releases ownership of C++ object's lifetime */
- if (weak_global_) {
- jenv->DeleteWeakGlobalRef((jweak)jthis_);
- jthis_ = jenv->NewGlobalRef(jself);
- weak_global_ = false;
+ else { /* Java releases ownership of C++ object's lifetime */
+ if (weak_global_) {
+ jenv->DeleteWeakGlobalRef((jweak)jthis_);
+ jthis_ = jenv->NewGlobalRef(jself);
+ weak_global_ = false;
+ }
}
- }
}
- private:
+private:
/* pointer to Java object */
jobject jthis_;
/* Local or global reference flag */
bool weak_global_;
- };
+};
- /* director base class */
- class Director {
+/* director base class */
+class Director
+{
/* pointer to Java virtual machine */
JavaVM *swig_jvm_;
- protected:
+protected:
#if defined (_MSC_VER) && (_MSC_VER<1300)
class JNIEnvWrapper;
friend class JNIEnvWrapper;
#endif
/* Utility class for managing the JNI environment */
- class JNIEnvWrapper {
- const Director *director_;
- JNIEnv *jenv_;
+ class JNIEnvWrapper
+ {
+ const Director *director_;
+ JNIEnv *jenv_;
public:
- JNIEnvWrapper(const Director *director) : director_(director), jenv_(0) {
+ JNIEnvWrapper(const Director *director) : director_(director), jenv_(0) {
#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON)
- // Attach a daemon thread to the JVM. Useful when the JVM should not wait for
- // the thread to exit upon shutdown. Only for jdk-1.4 and later.
- director_->swig_jvm_->AttachCurrentThreadAsDaemon((JNIEnv **) &jenv_, NULL);
+ // Attach a daemon thread to the JVM. Useful when the JVM should not wait for
+ // the thread to exit upon shutdown. Only for jdk-1.4 and later.
+ director_->swig_jvm_->AttachCurrentThreadAsDaemon((JNIEnv **) &jenv_, NULL);
#else
- director_->swig_jvm_->AttachCurrentThread((JNIEnv **) &jenv_, NULL);
+ director_->swig_jvm_->AttachCurrentThread((JNIEnv **) &jenv_, NULL);
#endif
- }
- ~JNIEnvWrapper() {
+ }
+ ~JNIEnvWrapper() {
#if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD)
- // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
- // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
- director_->swig_jvm_->DetachCurrentThread();
+ // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
+ // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
+ director_->swig_jvm_->DetachCurrentThread();
#endif
- }
- JNIEnv *getJNIEnv() const {
- return jenv_;
- }
+ }
+ JNIEnv *getJNIEnv() const {
+ return jenv_;
+ }
};
/* Java object wrapper */
@@ -352,48 +386,48 @@ namespace Swig {
/* Disconnect director from Java object */
void swig_disconnect_director_self(const char *disconn_method) {
- JNIEnvWrapper jnienv(this) ;
- JNIEnv *jenv = jnienv.getJNIEnv() ;
- jobject jobj = swig_self_.peek();
+ JNIEnvWrapper jnienv(this) ;
+ JNIEnv *jenv = jnienv.getJNIEnv() ;
+ jobject jobj = swig_self_.peek();
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl;
+ std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl;
#endif
- if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) {
- jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V");
- if (disconn_meth) {
+ if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) {
+ jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V");
+ if (disconn_meth) {
#if defined(DEBUG_DIRECTOR_OWNED)
- std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl;
+ std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl;
#endif
- jenv->CallVoidMethod(jobj, disconn_meth);
+ jenv->CallVoidMethod(jobj, disconn_meth);
+ }
}
- }
}
- public:
+public:
Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() {
- /* Acquire the Java VM pointer */
- jenv->GetJavaVM(&swig_jvm_);
+ /* Acquire the Java VM pointer */
+ jenv->GetJavaVM(&swig_jvm_);
}
virtual ~Director() {
- JNIEnvWrapper jnienv(this) ;
- JNIEnv *jenv = jnienv.getJNIEnv() ;
- swig_self_.release(jenv);
+ JNIEnvWrapper jnienv(this) ;
+ JNIEnv *jenv = jnienv.getJNIEnv() ;
+ swig_self_.release(jenv);
}
bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) {
- return swig_self_.set(jenv, jself, mem_own, weak_global);
+ return swig_self_.set(jenv, jself, mem_own, weak_global);
}
jobject swig_get_self(JNIEnv *jenv) const {
- return swig_self_.get(jenv);
+ return swig_self_.get(jenv);
}
// Change C++ object's ownership, relative to Java
void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
- swig_self_.java_change_ownership(jenv, jself, take_or_release);
+ swig_self_.java_change_ownership(jenv, jself, take_or_release);
}
- };
+};
}
#endif /* __cplusplus */
@@ -418,81 +452,85 @@ namespace Swig {
extern "C" {
#endif
-SWIGEXPORT jlong JNICALL Java_org_doubango_utils_utilsJNI_new_1AndroidUtils(JNIEnv *jenv, jclass jcls) {
- jlong jresult = 0 ;
- AndroidUtils *result = 0 ;
-
- (void)jenv;
- (void)jcls;
- result = (AndroidUtils *)new AndroidUtils();
- *(AndroidUtils **)&jresult = result;
- return jresult;
+SWIGEXPORT jlong JNICALL Java_org_doubango_utils_utilsJNI_new_1AndroidUtils(JNIEnv *jenv, jclass jcls)
+{
+ jlong jresult = 0 ;
+ AndroidUtils *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ result = (AndroidUtils *)new AndroidUtils();
+ *(AndroidUtils **)&jresult = result;
+ return jresult;
}
-SWIGEXPORT void JNICALL Java_org_doubango_utils_utilsJNI_delete_1AndroidUtils(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- AndroidUtils *arg1 = (AndroidUtils *) 0 ;
-
- (void)jenv;
- (void)jcls;
- arg1 = *(AndroidUtils **)&jarg1;
- delete arg1;
+SWIGEXPORT void JNICALL Java_org_doubango_utils_utilsJNI_delete_1AndroidUtils(JNIEnv *jenv, jclass jcls, jlong jarg1)
+{
+ AndroidUtils *arg1 = (AndroidUtils *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = *(AndroidUtils **)&jarg1;
+ delete arg1;
}
-SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFamily(JNIEnv *jenv, jclass jcls) {
- jobject jresult = 0 ;
- uint64_t result;
-
- (void)jenv;
- (void)jcls;
- result = (uint64_t)AndroidUtils::getCpuFamily();
- {
- jbyteArray ba = jenv->NewByteArray(9);
- jbyte* bae = jenv->GetByteArrayElements(ba, 0);
- jclass clazz = jenv->FindClass("java/math/BigInteger");
- jmethodID mid = jenv->GetMethodID(clazz, "<init>", "([B)V");
- jobject bigint;
- int i;
-
- bae[0] = 0;
- for(i=1; i<9; i++ ) {
- bae[i] = (jbyte)(result>>8*(8-i));
+SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFamily(JNIEnv *jenv, jclass jcls)
+{
+ jobject jresult = 0 ;
+ uint64_t result;
+
+ (void)jenv;
+ (void)jcls;
+ result = (uint64_t)AndroidUtils::getCpuFamily();
+ {
+ jbyteArray ba = jenv->NewByteArray(9);
+ jbyte* bae = jenv->GetByteArrayElements(ba, 0);
+ jclass clazz = jenv->FindClass("java/math/BigInteger");
+ jmethodID mid = jenv->GetMethodID(clazz, "<init>", "([B)V");
+ jobject bigint;
+ int i;
+
+ bae[0] = 0;
+ for(i=1; i<9; i++ ) {
+ bae[i] = (jbyte)(result>>8*(8-i));
+ }
+
+ jenv->ReleaseByteArrayElements(ba, bae, 0);
+ bigint = jenv->NewObject(clazz, mid, ba);
+ jresult = bigint;
}
-
- jenv->ReleaseByteArrayElements(ba, bae, 0);
- bigint = jenv->NewObject(clazz, mid, ba);
- jresult = bigint;
- }
- return jresult;
+ return jresult;
}
-SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFeatures(JNIEnv *jenv, jclass jcls) {
- jobject jresult = 0 ;
- uint64_t result;
-
- (void)jenv;
- (void)jcls;
- result = (uint64_t)AndroidUtils::getCpuFeatures();
- {
- jbyteArray ba = jenv->NewByteArray(9);
- jbyte* bae = jenv->GetByteArrayElements(ba, 0);
- jclass clazz = jenv->FindClass("java/math/BigInteger");
- jmethodID mid = jenv->GetMethodID(clazz, "<init>", "([B)V");
- jobject bigint;
- int i;
-
- bae[0] = 0;
- for(i=1; i<9; i++ ) {
- bae[i] = (jbyte)(result>>8*(8-i));
+SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFeatures(JNIEnv *jenv, jclass jcls)
+{
+ jobject jresult = 0 ;
+ uint64_t result;
+
+ (void)jenv;
+ (void)jcls;
+ result = (uint64_t)AndroidUtils::getCpuFeatures();
+ {
+ jbyteArray ba = jenv->NewByteArray(9);
+ jbyte* bae = jenv->GetByteArrayElements(ba, 0);
+ jclass clazz = jenv->FindClass("java/math/BigInteger");
+ jmethodID mid = jenv->GetMethodID(clazz, "<init>", "([B)V");
+ jobject bigint;
+ int i;
+
+ bae[0] = 0;
+ for(i=1; i<9; i++ ) {
+ bae[i] = (jbyte)(result>>8*(8-i));
+ }
+
+ jenv->ReleaseByteArrayElements(ba, bae, 0);
+ bigint = jenv->NewObject(clazz, mid, ba);
+ jresult = bigint;
}
-
- jenv->ReleaseByteArrayElements(ba, bae, 0);
- bigint = jenv->NewObject(clazz, mid, ba);
- jresult = bigint;
- }
- return jresult;
+ return jresult;
}
diff --git a/android-utils/utils_wrap.h b/android-utils/utils_wrap.h
index 9cc67f4..028f9a7 100755
--- a/android-utils/utils_wrap.h
+++ b/android-utils/utils_wrap.h
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.4
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_utils_WRAP_H_
diff --git a/bindings/_common/ActionConfig.cxx b/bindings/_common/ActionConfig.cxx
index 0c1f9a4..35628ed 100755
--- a/bindings/_common/ActionConfig.cxx
+++ b/bindings/_common/ActionConfig.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,66 +23,66 @@
ActionConfig::ActionConfig()
{
- m_pHandle = tsip_action_create(tsip_atype_config,
- TSIP_ACTION_SET_NULL());
+ m_pHandle = tsip_action_create(tsip_atype_config,
+ TSIP_ACTION_SET_NULL());
}
ActionConfig::~ActionConfig()
{
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
bool ActionConfig::addHeader(const char* name, const char* value)
{
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_HEADER(name, value),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_HEADER(name, value),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool ActionConfig::addPayload(const void* payload, unsigned len)
{
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool ActionConfig::setActiveMedia(twrap_media_type_t type)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA_TYPE(media_type),
- TSIP_ACTION_SET_NULL()) == 0);
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA_TYPE(media_type),
+ TSIP_ACTION_SET_NULL()) == 0);
}
ActionConfig* ActionConfig::setResponseLine(short code, const char* phrase)
{
- int32_t _code = code;
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_RESP_LINE(_code, phrase),
- TSIP_ACTION_SET_NULL());
- return this;
+ int32_t _code = code;
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_RESP_LINE(_code, phrase),
+ TSIP_ACTION_SET_NULL());
+ return this;
}
ActionConfig* ActionConfig::setMediaString(twrap_media_type_t type, const char* key, const char* value)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA(
- TMEDIA_SESSION_SET_STR(media_type, key, value),
- TMEDIA_SESSION_SET_NULL()),
- TSIP_ACTION_SET_NULL());
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA(
+ TMEDIA_SESSION_SET_STR(media_type, key, value),
+ TMEDIA_SESSION_SET_NULL()),
+ TSIP_ACTION_SET_NULL());
- return this;
+ return this;
}
ActionConfig* ActionConfig::setMediaInt(twrap_media_type_t type, const char* key, int value)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA(
- TMEDIA_SESSION_SET_INT32(media_type, key, value),
- TMEDIA_SESSION_SET_NULL()),
- TSIP_ACTION_SET_NULL());
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA(
+ TMEDIA_SESSION_SET_INT32(media_type, key, value),
+ TMEDIA_SESSION_SET_NULL()),
+ TSIP_ACTION_SET_NULL());
- return this;
+ return this;
} \ No newline at end of file
diff --git a/bindings/_common/ActionConfig.h b/bindings/_common/ActionConfig.h
index ab8ad73..2cc43bd 100755
--- a/bindings/_common/ActionConfig.h
+++ b/bindings/_common/ActionConfig.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,25 +26,25 @@
class TINYWRAP_API ActionConfig
{
public:
- ActionConfig();
- virtual ~ActionConfig();
-
- bool addHeader(const char* name, const char* value);
- bool addPayload(const void* payload, unsigned len);
- bool setActiveMedia(twrap_media_type_t type);
-
- ActionConfig* setResponseLine(short code, const char* phrase);
- ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);
- ActionConfig* setMediaInt(twrap_media_type_t type, const char* key, int value);
-
+ ActionConfig();
+ virtual ~ActionConfig();
+
+ bool addHeader(const char* name, const char* value);
+ bool addPayload(const void* payload, unsigned len);
+ bool setActiveMedia(twrap_media_type_t type);
+
+ ActionConfig* setResponseLine(short code, const char* phrase);
+ ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);
+ ActionConfig* setMediaInt(twrap_media_type_t type, const char* key, int value);
+
private:
- tsip_action_handle_t* m_pHandle;
+ tsip_action_handle_t* m_pHandle;
#if !defined(SWIG)
public:
- const inline tsip_action_handle_t* getHandle()const{
- return m_pHandle;
- }
+ const inline tsip_action_handle_t* getHandle()const {
+ return m_pHandle;
+ }
#endif
};
diff --git a/bindings/_common/AudioResampler.cxx b/bindings/_common/AudioResampler.cxx
index 519376d..850fdc8 100755
--- a/bindings/_common/AudioResampler.cxx
+++ b/bindings/_common/AudioResampler.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,42 +32,42 @@
#include "tsk_debug.h"
AudioResampler::AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality):
-m_nOutFreq(nOutFreq),
-m_nInFreq(nInFreq),
-m_nFrameDuration(nFrameDuration),
-m_nChannels(nChannels),
-m_nQuality(nQuality)
+ m_nOutFreq(nOutFreq),
+ m_nInFreq(nInFreq),
+ m_nFrameDuration(nFrameDuration),
+ m_nChannels(nChannels),
+ m_nQuality(nQuality)
{
- if ((m_pWrappedResampler = tmedia_resampler_create())) {
- int ret;
- if ((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, nChannels, m_nQuality, 16))){
- TSK_DEBUG_ERROR("Failed to open audio resampler (%d)", ret);
- TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
- }
- }
- else {
- TSK_DEBUG_ERROR("No audio resampler could be found. Did you forget to call tdav_init()?");
- }
+ if ((m_pWrappedResampler = tmedia_resampler_create())) {
+ int ret;
+ if ((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, nChannels, m_nQuality, 16))) {
+ TSK_DEBUG_ERROR("Failed to open audio resampler (%d)", ret);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("No audio resampler could be found. Did you forget to call tdav_init()?");
+ }
}
AudioResampler::~AudioResampler()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
}
uint32_t AudioResampler::process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes)
{
- if(!m_pWrappedResampler){
- TSK_DEBUG_ERROR("Embedded resampler is invalid");
- return 0;
- }
- if(nInSizeInBytes < getInputRequiredSizeInShort()/2){
- TSK_DEBUG_ERROR("Input buffer is too short");
- return 0;
- }
- if(nOutSizeInBytes < getOutputRequiredSizeInShort()/2){
- TSK_DEBUG_ERROR("Output buffer is too short");
- return 0;
- }
- return 2*tmedia_resampler_process(m_pWrappedResampler, (uint16_t*)pInData, nInSizeInBytes/2, (uint16_t*)pOutData, nOutSizeInBytes/2);
+ if(!m_pWrappedResampler) {
+ TSK_DEBUG_ERROR("Embedded resampler is invalid");
+ return 0;
+ }
+ if(nInSizeInBytes < getInputRequiredSizeInShort()/2) {
+ TSK_DEBUG_ERROR("Input buffer is too short");
+ return 0;
+ }
+ if(nOutSizeInBytes < getOutputRequiredSizeInShort()/2) {
+ TSK_DEBUG_ERROR("Output buffer is too short");
+ return 0;
+ }
+ return 2*tmedia_resampler_process(m_pWrappedResampler, (uint16_t*)pInData, nInSizeInBytes/2, (uint16_t*)pOutData, nOutSizeInBytes/2);
}
diff --git a/bindings/_common/AudioResampler.h b/bindings/_common/AudioResampler.h
index 5f597fd..87c7995 100755
--- a/bindings/_common/AudioResampler.h
+++ b/bindings/_common/AudioResampler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,22 +34,28 @@
class AudioResampler
{
public:
- AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality);
- ~AudioResampler();
+ AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality);
+ ~AudioResampler();
public:
- inline bool isValid(){ return (m_pWrappedResampler != tsk_null); }
- inline uint32_t getOutputRequiredSizeInShort(){ return (m_nOutFreq * m_nFrameDuration)/1000; }
- inline uint32_t getInputRequiredSizeInShort(){ return (m_nInFreq * m_nFrameDuration)/1000; }
- uint32_t process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes);
+ inline bool isValid() {
+ return (m_pWrappedResampler != tsk_null);
+ }
+ inline uint32_t getOutputRequiredSizeInShort() {
+ return (m_nOutFreq * m_nFrameDuration)/1000;
+ }
+ inline uint32_t getInputRequiredSizeInShort() {
+ return (m_nInFreq * m_nFrameDuration)/1000;
+ }
+ uint32_t process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes);
private:
- struct tmedia_resampler_s* m_pWrappedResampler;
- uint32_t m_nOutFreq;
- uint32_t m_nInFreq;
- uint32_t m_nFrameDuration;
- uint32_t m_nChannels;
- uint32_t m_nQuality;
+ struct tmedia_resampler_s* m_pWrappedResampler;
+ uint32_t m_nOutFreq;
+ uint32_t m_nInFreq;
+ uint32_t m_nFrameDuration;
+ uint32_t m_nChannels;
+ uint32_t m_nQuality;
};
diff --git a/bindings/_common/Common.h b/bindings/_common/Common.h
index ca299c0..eb206b6 100755
--- a/bindings/_common/Common.h
+++ b/bindings/_common/Common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,65 +32,62 @@
# define __JNIENV void
#endif
-typedef enum twrap_media_type_e
-{
- // because of Java don't use OR
- twrap_media_none = 0x00,
+typedef enum twrap_media_type_e {
+ // because of Java don't use OR
+ twrap_media_none = 0x00,
- twrap_media_audio = 0x01, // (0x01 << 0)
- twrap_media_video = 0x02, // (0x01 << 1)
- twrap_media_msrp = 0x04, // (0x01 << 2)
- twrap_media_t140 = 0x08, // (0x01 << 3)
- twrap_media_bfcp = 0x10, // (0x01 << 4)
- twrap_media_bfcp_audio = 0x30, // (0x01 << 5) | twrap_media_bfcp;
- twrap_media_bfcp_video = 0x50, // (0x01 << 6) | twrap_media_bfcp;
+ twrap_media_audio = 0x01, // (0x01 << 0)
+ twrap_media_video = 0x02, // (0x01 << 1)
+ twrap_media_msrp = 0x04, // (0x01 << 2)
+ twrap_media_t140 = 0x08, // (0x01 << 3)
+ twrap_media_bfcp = 0x10, // (0x01 << 4)
+ twrap_media_bfcp_audio = 0x30, // (0x01 << 5) | twrap_media_bfcp;
+ twrap_media_bfcp_video = 0x50, // (0x01 << 6) | twrap_media_bfcp;
- twrap_media_audiovideo = 0x03, /* @deprecated */
- twrap_media_audio_video = twrap_media_audiovideo,
+ twrap_media_audiovideo = 0x03, /* @deprecated */
+ twrap_media_audio_video = twrap_media_audiovideo,
}
twrap_media_type_t;
#if !defined(SWIG)
#include "tinymedia/tmedia_common.h"
-struct media_type_bind_s
-{
- twrap_media_type_t twrap;
- tmedia_type_t tnative;
+struct media_type_bind_s {
+ twrap_media_type_t twrap;
+ tmedia_type_t tnative;
};
-static const struct media_type_bind_s __media_type_binds[] =
-{
- { twrap_media_msrp, tmedia_msrp },
- { twrap_media_audio , tmedia_audio },
- { twrap_media_video, tmedia_video },
- { twrap_media_audio_video, (tmedia_type_t)(tmedia_audio | tmedia_video) },
- { twrap_media_t140, tmedia_t140 },
- { twrap_media_bfcp, tmedia_bfcp },
- { twrap_media_bfcp_audio, tmedia_bfcp_audio },
- { twrap_media_bfcp_video, tmedia_bfcp_video },
+static const struct media_type_bind_s __media_type_binds[] = {
+ { twrap_media_msrp, tmedia_msrp },
+ { twrap_media_audio , tmedia_audio },
+ { twrap_media_video, tmedia_video },
+ { twrap_media_audio_video, (tmedia_type_t)(tmedia_audio | tmedia_video) },
+ { twrap_media_t140, tmedia_t140 },
+ { twrap_media_bfcp, tmedia_bfcp },
+ { twrap_media_bfcp_audio, tmedia_bfcp_audio },
+ { twrap_media_bfcp_video, tmedia_bfcp_video },
};
static const tsk_size_t __media_type_binds_count = sizeof(__media_type_binds)/sizeof(__media_type_binds[0]);
static tmedia_type_t twrap_get_native_media_type(twrap_media_type_t type)
{
- tsk_size_t u;
- tmedia_type_t t = tmedia_none;
- for (u = 0; u < __media_type_binds_count; ++u) {
- if ((__media_type_binds[u].twrap & type) == __media_type_binds[u].twrap) {
- t = (tmedia_type_t)(t | __media_type_binds[u].tnative);
- }
- }
- return t;
+ tsk_size_t u;
+ tmedia_type_t t = tmedia_none;
+ for (u = 0; u < __media_type_binds_count; ++u) {
+ if ((__media_type_binds[u].twrap & type) == __media_type_binds[u].twrap) {
+ t = (tmedia_type_t)(t | __media_type_binds[u].tnative);
+ }
+ }
+ return t;
}
static twrap_media_type_t twrap_get_wrapped_media_type(tmedia_type_t type)
{
- twrap_media_type_t t = twrap_media_none;
- tsk_size_t u;
- for (u = 0; u < __media_type_binds_count; ++u) {
- if ((__media_type_binds[u].tnative & type) == __media_type_binds[u].tnative) {
- t = (twrap_media_type_t)(t | __media_type_binds[u].twrap);
- }
- }
- return t;
+ twrap_media_type_t t = twrap_media_none;
+ tsk_size_t u;
+ for (u = 0; u < __media_type_binds_count; ++u) {
+ if ((__media_type_binds[u].tnative & type) == __media_type_binds[u].tnative) {
+ t = (twrap_media_type_t)(t | __media_type_binds[u].twrap);
+ }
+ }
+ return t;
}
#endif
diff --git a/bindings/_common/DDebug.cxx b/bindings/_common/DDebug.cxx
index d00efad..a1b77b3 100755
--- a/bindings/_common/DDebug.cxx
+++ b/bindings/_common/DDebug.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,109 +34,112 @@
* Callbacks should not be used with Android (JNI).
*/
-enum cb_type{
- cb_info,
- cb_warn,
- cb_error,
- cb_fatal
+enum cb_type {
+ cb_info,
+ cb_warn,
+ cb_error,
+ cb_fatal
};
int debug_xxx_cb(const void* arg, const char* fmt, enum cb_type type, va_list *app)
{
- int ret = -1;
- if(!arg){
- return -1;
- }
-
- const SipStack* stack = dyn_cast<const SipStack*>((const SipStack*)arg);
-
- if(stack && stack->getDebugCallback()){
- char* message = tsk_null;
- tsk_sprintf_2(&message, fmt, app);
-
- switch(type){
- case cb_info:
- ret=
+ int ret = -1;
+ if(!arg) {
+ return -1;
+ }
+
+ const SipStack* stack = dyn_cast<const SipStack*>((const SipStack*)arg);
+
+ if(stack && stack->getDebugCallback()) {
+ char* message = tsk_null;
+ tsk_sprintf_2(&message, fmt, app);
+
+ switch(type) {
+ case cb_info:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugInfo(message);
+ stack->getDebugCallback()-> OnDebugInfo(message);
#endif
- break;
- case cb_warn:
- ret=
+ break;
+ case cb_warn:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugWarn(message);
+ stack->getDebugCallback()-> OnDebugWarn(message);
#endif
- break;
- case cb_error:
- ret=
+ break;
+ case cb_error:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugError(message);
+ stack->getDebugCallback()-> OnDebugError(message);
#endif
- break;
- case cb_fatal:
- ret=
+ break;
+ case cb_fatal:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugFatal(message);
+ stack->getDebugCallback()-> OnDebugFatal(message);
#endif
- break;
- }
-
- TSK_FREE(message);
- }
+ break;
+ }
- return ret;
+ TSK_FREE(message);
+ }
+
+ return ret;
}
int DDebugCallback::debug_info_cb(const void* arg, const char* fmt, ...)
{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_info, &ap);
- va_end(ap);
-
- return ret;
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_info, &ap);
+ va_end(ap);
+
+ return ret;
}
-int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_warn, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_warn, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
-int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_error, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_error, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
-int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_fatal, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_fatal, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
diff --git a/bindings/_common/DDebug.h b/bindings/_common/DDebug.h
index 94f2f5f..67b6340 100755
--- a/bindings/_common/DDebug.h
+++ b/bindings/_common/DDebug.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,25 +25,33 @@
class DDebugCallback
{
public:
- DDebugCallback() { }
- virtual ~DDebugCallback() {}
+ DDebugCallback() { }
+ virtual ~DDebugCallback() {}
- virtual int OnDebugInfo(const char* message) { return -1; }
- virtual int OnDebugWarn(const char* message) { return -1; }
- virtual int OnDebugError(const char* message) { return -1; }
- virtual int OnDebugFatal(const char* message) { return -1; }
+ virtual int OnDebugInfo(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugWarn(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugError(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugFatal(const char* message) {
+ return -1;
+ }
#if !defined(SWIG)
public:
- static int debug_info_cb(const void* arg, const char* fmt, ...);
- static int debug_warn_cb(const void* arg, const char* fmt, ...);
- static int debug_error_cb(const void* arg, const char* fmt, ...);
- static int debug_fatal_cb(const void* arg, const char* fmt, ...);
+ static int debug_info_cb(const void* arg, const char* fmt, ...);
+ static int debug_warn_cb(const void* arg, const char* fmt, ...);
+ static int debug_error_cb(const void* arg, const char* fmt, ...);
+ static int debug_fatal_cb(const void* arg, const char* fmt, ...);
#endif
private:
-
+
};
#endif /* TINYWRAP_SIP_DEBUG_H */
diff --git a/bindings/_common/MediaContent.cxx b/bindings/_common/MediaContent.cxx
index 1929898..b039bd2 100755
--- a/bindings/_common/MediaContent.cxx
+++ b/bindings/_common/MediaContent.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,91 +24,91 @@
MediaContent::MediaContent(tmedia_content_t* pContent)
-: m_pData(tsk_null)
+ : m_pData(tsk_null)
{
- m_pContent = (tmedia_content_t*)tsk_object_ref(pContent);
+ m_pContent = (tmedia_content_t*)tsk_object_ref(pContent);
}
MediaContent::~MediaContent()
{
- TSK_OBJECT_SAFE_FREE(m_pContent);
- TSK_OBJECT_SAFE_FREE(m_pData);
+ TSK_OBJECT_SAFE_FREE(m_pContent);
+ TSK_OBJECT_SAFE_FREE(m_pData);
}
const char* MediaContent::getType()
{
- if(m_pContent){
- return m_pContent->type;
- }
- return tsk_null;
+ if(m_pContent) {
+ return m_pContent->type;
+ }
+ return tsk_null;
}
unsigned MediaContent::getDataLength()
{
- if(!m_pContent){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- if(!m_pData){
- m_pData = tmedia_content_get_data(m_pContent);
- }
+ if(!m_pData) {
+ m_pData = tmedia_content_get_data(m_pContent);
+ }
- return (m_pData ? m_pData->size : 0);
+ return (m_pData ? m_pData->size : 0);
}
unsigned MediaContent::getData(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
-
- if(!m_pContent){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
-
- if(!m_pData){
- m_pData = tmedia_content_get_data(m_pContent);
- }
-
- if(pOutput && nMaxsize && m_pData){
- nRetsize = (m_pData->size > nMaxsize) ? nMaxsize : m_pData->size;
- memcpy(pOutput, m_pData->data, nRetsize);
- }
-
- return nRetsize;
+ unsigned nRetsize = 0;
+
+ if(!m_pContent) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
+
+ if(!m_pData) {
+ m_pData = tmedia_content_get_data(m_pContent);
+ }
+
+ if(pOutput && nMaxsize && m_pData) {
+ nRetsize = (m_pData->size > nMaxsize) ? nMaxsize : m_pData->size;
+ memcpy(pOutput, m_pData->data, nRetsize);
+ }
+
+ return nRetsize;
}
MediaContent* MediaContent::parse(const void* pData, unsigned nSize, const char* pType)
{
- MediaContent* pMediaContent = tsk_null;
-
- tmedia_content_t* pContent = tmedia_content_parse(pData, (tsk_size_t)nSize, pType);
- if(pContent){
- if(TMEDIA_CONTENT_IS_CPIM(pContent)){
- pMediaContent = new MediaContentCPIM(pContent);
- }
- else if(TMEDIA_CONTENT_IS_DUMMY(pContent)){
- // Todo
- }
- TSK_OBJECT_SAFE_FREE(pContent);
- }
-
- return pMediaContent;
+ MediaContent* pMediaContent = tsk_null;
+
+ tmedia_content_t* pContent = tmedia_content_parse(pData, (tsk_size_t)nSize, pType);
+ if(pContent) {
+ if(TMEDIA_CONTENT_IS_CPIM(pContent)) {
+ pMediaContent = new MediaContentCPIM(pContent);
+ }
+ else if(TMEDIA_CONTENT_IS_DUMMY(pContent)) {
+ // Todo
+ }
+ TSK_OBJECT_SAFE_FREE(pContent);
+ }
+
+ return pMediaContent;
}
MediaContentCPIM* MediaContent::parse(const void* pData, unsigned nSize)
{
- MediaContent* pMediaContent;
- if((pMediaContent = MediaContent::parse(pData, nSize, TMEDIA_CONTENT_CPIM_TYPE))){
- return dyn_cast<MediaContentCPIM*>(pMediaContent);
- }
- return tsk_null;
+ MediaContent* pMediaContent;
+ if((pMediaContent = MediaContent::parse(pData, nSize, TMEDIA_CONTENT_CPIM_TYPE))) {
+ return dyn_cast<MediaContentCPIM*>(pMediaContent);
+ }
+ return tsk_null;
}
/* ============ message/CPIM ================= */
MediaContentCPIM::MediaContentCPIM(tmedia_content_t* pContent)
-: MediaContent(pContent)
+ : MediaContent(pContent)
{
}
@@ -118,61 +118,62 @@ MediaContentCPIM::~MediaContentCPIM()
unsigned MediaContentCPIM::getPayloadLength()
{
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- return (TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->size : 0);
+ return (TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->size : 0);
}
unsigned MediaContentCPIM::getPayload(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
+ unsigned nRetsize = 0;
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- if(pOutput && nMaxsize && TMEDIA_CONTENT_CPIM(m_pContent)->e){
- nRetsize = (TMEDIA_CONTENT_CPIM(m_pContent)->e->size > nMaxsize) ? nMaxsize : TMEDIA_CONTENT_CPIM(m_pContent)->e->size;
- memcpy(pOutput, TMEDIA_CONTENT_CPIM(m_pContent)->e->data, nRetsize);
- }
+ if(pOutput && nMaxsize && TMEDIA_CONTENT_CPIM(m_pContent)->e) {
+ nRetsize = (TMEDIA_CONTENT_CPIM(m_pContent)->e->size > nMaxsize) ? nMaxsize : TMEDIA_CONTENT_CPIM(m_pContent)->e->size;
+ memcpy(pOutput, TMEDIA_CONTENT_CPIM(m_pContent)->e->data, nRetsize);
+ }
- return nRetsize;
+ return nRetsize;
}
-const void* MediaContentCPIM::getPayloadPtr(){
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return tsk_null;
- }
-
- return TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->data : tsk_null;
+const void* MediaContentCPIM::getPayloadPtr()
+{
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return tsk_null;
+ }
+
+ return TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->data : tsk_null;
}
const char* MediaContentCPIM::getHeaderValue(const char* name)
{
- const tmedia_content_cpim_t* cpim;
- const tsk_list_item_t* item;
-
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return tsk_null;
- }
-
- cpim = TMEDIA_CONTENT_CPIM(m_pContent);
- tsk_list_foreach(item, cpim->h_headers){
- if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)){
- return TMEDIA_CONTENT_HEADER(item->data)->value;
- }
- }
- tsk_list_foreach(item, cpim->m_headers){
- if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)){
- return TMEDIA_CONTENT_HEADER(item->data)->value;
- }
- }
-
- return tsk_null;
+ const tmedia_content_cpim_t* cpim;
+ const tsk_list_item_t* item;
+
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return tsk_null;
+ }
+
+ cpim = TMEDIA_CONTENT_CPIM(m_pContent);
+ tsk_list_foreach(item, cpim->h_headers) {
+ if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)) {
+ return TMEDIA_CONTENT_HEADER(item->data)->value;
+ }
+ }
+ tsk_list_foreach(item, cpim->m_headers) {
+ if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)) {
+ return TMEDIA_CONTENT_HEADER(item->data)->value;
+ }
+ }
+
+ return tsk_null;
} \ No newline at end of file
diff --git a/bindings/_common/MediaContent.h b/bindings/_common/MediaContent.h
index 36bf929..204b8ec 100755
--- a/bindings/_common/MediaContent.h
+++ b/bindings/_common/MediaContent.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,27 +31,27 @@ class MediaContent
{
public:
#if !defined(SWIG)
- MediaContent(tmedia_content_t* content);
+ MediaContent(tmedia_content_t* content);
#endif
- virtual ~MediaContent();
+ virtual ~MediaContent();
public:
- const char* getType();
- virtual unsigned getDataLength();
- virtual unsigned getData(void* pOutput, unsigned nMaxsize);
-
- // SWIG %newobject()
- static MediaContent* parse(const void* pData, unsigned nSize, const char* pType);
- static MediaContentCPIM* parse(const void* pData, unsigned nSize);
+ const char* getType();
+ virtual unsigned getDataLength();
+ virtual unsigned getData(void* pOutput, unsigned nMaxsize);
+
+ // SWIG %newobject()
+ static MediaContent* parse(const void* pData, unsigned nSize, const char* pType);
+ static MediaContentCPIM* parse(const void* pData, unsigned nSize);
- virtual unsigned getPayloadLength() = 0;
- virtual unsigned getPayload(void* pOutput, unsigned nMaxsize) = 0;
+ virtual unsigned getPayloadLength() = 0;
+ virtual unsigned getPayload(void* pOutput, unsigned nMaxsize) = 0;
protected:
- tmedia_content_t* m_pContent;
+ tmedia_content_t* m_pContent;
private:
- tsk_buffer_t* m_pData;
+ tsk_buffer_t* m_pData;
};
@@ -60,17 +60,17 @@ class MediaContentCPIM : public MediaContent
{
public:
#if !defined(SWIG)
- MediaContentCPIM(tmedia_content_t* pContent);
+ MediaContentCPIM(tmedia_content_t* pContent);
#endif
- virtual ~MediaContentCPIM();
+ virtual ~MediaContentCPIM();
public:
- virtual unsigned getPayloadLength();
- virtual unsigned getPayload(void* pOutput, unsigned nMaxsize);
+ virtual unsigned getPayloadLength();
+ virtual unsigned getPayload(void* pOutput, unsigned nMaxsize);
#if !defined(SWIG)
- const void* getPayloadPtr();
+ const void* getPayloadPtr();
#endif
- const char* getHeaderValue(const char* pName);
+ const char* getHeaderValue(const char* pName);
};
#endif /*TINYWRAP_MEDIA_CONTENT_H*/
diff --git a/bindings/_common/MediaSessionMgr.cxx b/bindings/_common/MediaSessionMgr.cxx
index 5561e3c..6bfb333 100755
--- a/bindings/_common/MediaSessionMgr.cxx
+++ b/bindings/_common/MediaSessionMgr.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,77 +22,107 @@
#include "MediaSessionMgr.h"
//
+// QoS
+//
+QoS::QoS(float qavg, float q1 /*= -1.f*/, float q2 /*= -1.f*/, float q3 /*= -1.f*/, float q4 /*= -1.f*/, float q5 /*= -1.f*/)
+ : m_Qqvg(qavg)
+ , m_VideoInWidth(0)
+ , m_VideoOutWidth(0)
+ , m_VideoInHeight(0)
+ , m_VideoOutHeight(0)
+ , m_BandwidthDownKbps(0)
+ , m_BandwidthUpKbps(0)
+ , m_VideoInAvgFps(0)
+ , m_VideoDecAvgTime(0)
+ , m_VideoEncAvgTime(0)
+{
+ m_Qn[0] = q1;
+ m_Qn[1] = q2;
+ m_Qn[2] = q3;
+ m_Qn[3] = q4;
+ m_Qn[4] = q5;
+}
+
+QoS::~QoS()
+{
+}
+
+//
// Codec
//
Codec::Codec(const struct tmedia_codec_s* pWrappedCodec)
{
- m_pWrappedCodec = (struct tmedia_codec_s*)tsk_object_ref(TSK_OBJECT(pWrappedCodec));
+ m_pWrappedCodec = (struct tmedia_codec_s*)tsk_object_ref(TSK_OBJECT(pWrappedCodec));
}
Codec::~Codec()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedCodec);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedCodec);
}
twrap_media_type_t Codec::getMediaType()
{
- if(m_pWrappedCodec){
- switch(m_pWrappedCodec->type){
- case tmedia_audio: return twrap_media_audio;
- case tmedia_video: return twrap_media_video;
- case tmedia_msrp: return twrap_media_msrp;
- default: break;
- }
- }
- return twrap_media_none;
+ if(m_pWrappedCodec) {
+ switch(m_pWrappedCodec->type) {
+ case tmedia_audio:
+ return twrap_media_audio;
+ case tmedia_video:
+ return twrap_media_video;
+ case tmedia_msrp:
+ return twrap_media_msrp;
+ default:
+ break;
+ }
+ }
+ return twrap_media_none;
}
const char* Codec::getName()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->name;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->name;
+ }
+ return tsk_null;
}
const char* Codec::getDescription()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->desc;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->desc;
+ }
+ return tsk_null;
}
const char* Codec::getNegFormat()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->neg_format ? m_pWrappedCodec->neg_format : m_pWrappedCodec->format;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->neg_format ? m_pWrappedCodec->neg_format : m_pWrappedCodec->format;
+ }
+ return tsk_null;
}
int Codec::getAudioSamplingRate()
{
- if(m_pWrappedCodec && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->rate;
- }
- return 0;
+ if(m_pWrappedCodec && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->rate;
+ }
+ return 0;
}
int Codec::getAudioChannels()
{
- if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->audio.channels;
- }
- return 0;
+ if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->audio.channels;
+ }
+ return 0;
}
int Codec::getAudioPTime()
{
- if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->audio.ptime;
- }
- return 0;
+ if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->audio.ptime;
+ }
+ return 0;
}
//
@@ -100,78 +130,107 @@ int Codec::getAudioPTime()
//
MediaSessionMgr::MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr)
{
- m_pWrappedMgr = (tmedia_session_mgr_t*)tsk_object_ref(pWrappedMgr);
+ m_pWrappedMgr = (tmedia_session_mgr_t*)tsk_object_ref(pWrappedMgr);
}
MediaSessionMgr::~MediaSessionMgr()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedMgr);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedMgr);
}
bool MediaSessionMgr::sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
int32_t MediaSessionMgr::sessionGetInt32(twrap_media_type_t media, const char* key)
{
- int32_t value = 0;
- tmedia_type_t _media = twrap_get_native_media_type(media);
- (tmedia_session_mgr_get(m_pWrappedMgr,
- TMEDIA_SESSION_GET_INT32(_media, key, &value),
- TMEDIA_SESSION_GET_NULL()));
- return value;
+ int32_t value = 0;
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ (tmedia_session_mgr_get(m_pWrappedMgr,
+ TMEDIA_SESSION_GET_INT32(_media, key, &value),
+ TMEDIA_SESSION_GET_NULL()));
+ return value;
+}
+
+QoS* MediaSessionMgr::sessionGetQoS(twrap_media_type_t media)
+{
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if (session) {
+ QoS* pQoS = new QoS(
+ session->qos_metrics.qvag,
+ session->qos_metrics.q1,
+ session->qos_metrics.q2,
+ session->qos_metrics.q3,
+ session->qos_metrics.q4,
+ session->qos_metrics.q5);
+ if (pQoS && ((_media & tmedia_video) || (_media & tmedia_bfcp_video))) {
+ pQoS->m_VideoInWidth = session->qos_metrics.video_in_width;
+ pQoS->m_VideoInHeight = session->qos_metrics.video_in_height;
+ pQoS->m_VideoOutWidth = session->qos_metrics.video_out_width;
+ pQoS->m_VideoOutHeight = session->qos_metrics.video_out_height;
+ pQoS->m_BandwidthDownKbps = session->qos_metrics.bw_down_est_kbps;
+ pQoS->m_BandwidthUpKbps = session->qos_metrics.bw_up_est_kbps;
+ pQoS->m_VideoInAvgFps = session->qos_metrics.video_in_avg_fps;
+ pQoS->m_VideoDecAvgTime = session->qos_metrics.video_dec_avg_time;
+ pQoS->m_VideoEncAvgTime = session->qos_metrics.video_enc_avg_time;
+ }
+ TSK_OBJECT_SAFE_FREE(session);
+ return pQoS;
+ }
+ return NULL;
}
bool MediaSessionMgr::consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_CONSUMER_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_CONSUMER_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_CONSUMER_SET_INT64(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_CONSUMER_SET_INT64(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::producerSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::producerSetInt64(twrap_media_type_t media, const char* key, int64_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_SET_INT64(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_SET_INT64(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
Codec* MediaSessionMgr::producerGetCodec(twrap_media_type_t media)
{
- tmedia_codec_t* _codec = tsk_null;
- tmedia_type_t _media = twrap_get_native_media_type(media);
- (tmedia_session_mgr_get(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_GET_POBJECT(_media, "codec", &_codec),
- TMEDIA_SESSION_GET_NULL()));
+ tmedia_codec_t* _codec = tsk_null;
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ (tmedia_session_mgr_get(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_GET_POBJECT(_media, "codec", &_codec),
+ TMEDIA_SESSION_GET_NULL()));
- if(_codec){
- Codec* pCodec = new Codec(_codec);
- TSK_OBJECT_SAFE_FREE(_codec);
- return pCodec;
- }
- return tsk_null;
+ if(_codec) {
+ Codec* pCodec = new Codec(_codec);
+ TSK_OBJECT_SAFE_FREE(_codec);
+ return pCodec;
+ }
+ return NULL;
}
#include "tinydav/audio/tdav_session_audio.h"
@@ -181,379 +240,426 @@ Codec* MediaSessionMgr::producerGetCodec(twrap_media_type_t media)
const ProxyPlugin* MediaSessionMgr::findProxyPlugin(twrap_media_type_t media, bool consumer)const
{
- const ProxyPlugin* plugin = tsk_null;
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
-
- if(media != twrap_media_audio && media != twrap_media_video){
- TSK_DEBUG_ERROR("Invalid media type");
- return tsk_null;
- }
-
- if(manager && m_pWrappedMgr){
- tmedia_type_t _media = twrap_get_native_media_type(media);
- tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
- if(session){
- if(session->plugin == tdav_session_audio_plugin_def_t){
- if(consumer){
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
- }
- else{
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
- }
- }
- else if(session->plugin == tdav_session_video_plugin_def_t){
- if(consumer){
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
- }
- else{
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
- }
- }
- else{
- TSK_DEBUG_ERROR("Unknown session with media type = %d", _media);
- }
- tsk_object_unref(session);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- }
-
- return plugin;
+ const ProxyPlugin* plugin = tsk_null;
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+
+ if(media != twrap_media_audio && media != twrap_media_video) {
+ TSK_DEBUG_ERROR("Invalid media type");
+ return tsk_null;
+ }
+
+ if(manager && m_pWrappedMgr) {
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if(session) {
+ if(session->plugin == tdav_session_audio_plugin_def_t) {
+ if(consumer) {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
+ }
+ else {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
+ }
+ }
+ else if(session->plugin == tdav_session_video_plugin_def_t) {
+ if(consumer) {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
+ }
+ else {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Unknown session with media type = %d", _media);
+ }
+ tsk_object_unref(session);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ }
+
+ return plugin;
}
// FIXME: create generic function to register any kind and number of plugin from a file
unsigned int MediaSessionMgr::registerAudioPluginFromFile(const char* path)
{
- static struct tsk_plugin_s* __plugin = tsk_null;
- if(__plugin){
- TSK_DEBUG_ERROR("Audio plugin already registered");
- return 0;
- }
- if((__plugin = tsk_plugin_create(path))){
- unsigned int count = 0;
- tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
- if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_consumer, tsk_plugin_def_media_type_audio))){
- if(tmedia_consumer_plugin_register((const tmedia_consumer_plugin_def_t*)plugin_def_ptr_const) == 0){
- ++count;
- }
- }
- if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_producer, tsk_plugin_def_media_type_audio))){
- if(tmedia_producer_plugin_register((const tmedia_producer_plugin_def_t*)plugin_def_ptr_const) == 0){
- ++count;
- }
- }
- return count;
- }
- TSK_DEBUG_ERROR("Failed to create plugin with path=%s", path);
- return 0;
+ static struct tsk_plugin_s* __plugin = tsk_null;
+ if(__plugin) {
+ TSK_DEBUG_ERROR("Audio plugin already registered");
+ return 0;
+ }
+ if((__plugin = tsk_plugin_create(path))) {
+ unsigned int count = 0;
+ tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
+ if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_consumer, tsk_plugin_def_media_type_audio))) {
+ if(tmedia_consumer_plugin_register((const tmedia_consumer_plugin_def_t*)plugin_def_ptr_const) == 0) {
+ ++count;
+ }
+ }
+ if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_producer, tsk_plugin_def_media_type_audio))) {
+ if(tmedia_producer_plugin_register((const tmedia_producer_plugin_def_t*)plugin_def_ptr_const) == 0) {
+ ++count;
+ }
+ }
+ return count;
+ }
+ TSK_DEBUG_ERROR("Failed to create plugin with path=%s", path);
+ return 0;
}
uint64_t MediaSessionMgr::getSessionId(twrap_media_type_t media)const
{
- //const ProxyPlugin* plugin = tsk_null;
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- uint64_t id = 0;
+ //const ProxyPlugin* plugin = tsk_null;
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ uint64_t id = 0;
- if (media != twrap_media_audio && media != twrap_media_video) {
- TSK_DEBUG_ERROR("Invalid media type");
- return 0;
- }
+ if (media != twrap_media_audio && media != twrap_media_video) {
+ TSK_DEBUG_ERROR("Invalid media type");
+ return 0;
+ }
- if (manager && m_pWrappedMgr) {
- tmedia_type_t _media = twrap_get_native_media_type(media);
- tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
- if (session) {
- id = session->id;
- }
- tsk_object_unref(session);
- }
- else {
- TSK_DEBUG_ERROR("Invalid state");
- }
+ if (manager && m_pWrappedMgr) {
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if (session) {
+ id = session->id;
+ }
+ tsk_object_unref(session);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ }
- return id;
+ return id;
}
bool MediaSessionMgr::defaultsSetProfile(tmedia_profile_t profile)
{
- return (tmedia_defaults_set_profile(profile) == 0);
+ return (tmedia_defaults_set_profile(profile) == 0);
}
tmedia_profile_t MediaSessionMgr::defaultsGetProfile()
{
- return tmedia_defaults_get_profile();
+ return tmedia_defaults_get_profile();
}
bool MediaSessionMgr::defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl) // @deprecated
{
- return tmedia_defaults_set_bl(bl) == 0;
+ return tmedia_defaults_set_bl(bl) == 0;
}
tmedia_bandwidth_level_t MediaSessionMgr::defaultsGetBandwidthLevel() // @deprecated
{
- return tmedia_defaults_get_bl();
+ return tmedia_defaults_get_bl();
}
bool MediaSessionMgr::defaultsSetCongestionCtrlEnabled(bool enabled)
{
- return tmedia_defaults_set_congestion_ctrl_enabled(enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_congestion_ctrl_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetVideoMotionRank(int32_t video_motion_rank)
{
- return (tmedia_defaults_set_video_motion_rank(video_motion_rank) == 0);
+ return (tmedia_defaults_set_video_motion_rank(video_motion_rank) == 0);
}
bool MediaSessionMgr::defaultsSetVideoFps(int32_t video_fps)
{
- return (tmedia_defaults_set_video_fps(video_fps) == 0);
+ return (tmedia_defaults_set_video_fps(video_fps) == 0);
}
bool MediaSessionMgr::defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps)
{
- return (tmedia_defaults_set_bandwidth_video_upload_max(bw_video_up_max_kbps) == 0);
+ return (tmedia_defaults_set_bandwidth_video_upload_max(bw_video_up_max_kbps) == 0);
}
bool MediaSessionMgr::defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps)
{
- return (tmedia_defaults_set_bandwidth_video_download_max(bw_video_down_max_kbps) == 0);
+ return (tmedia_defaults_set_bandwidth_video_download_max(bw_video_down_max_kbps) == 0);
}
bool MediaSessionMgr::defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size)
{
- return tmedia_defaults_set_pref_video_size(pref_video_size) == 0;
+ return tmedia_defaults_set_pref_video_size(pref_video_size) == 0;
+}
+
+bool MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max)
+{
+ return tmedia_defaults_set_pref_video_size_range(min, max) == 0;
+}
+
+bool MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled)
+{
+ return tmedia_defaults_set_adapt_video_size_range_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetJbMargin(uint32_t jb_margin_ms)
{
- return tmedia_defaults_set_jb_margin(jb_margin_ms) == 0;
+ return tmedia_defaults_set_jb_margin(jb_margin_ms) == 0;
}
bool MediaSessionMgr::defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent)
{
- return tmedia_defaults_set_jb_max_late_rate(jb_late_rate_percent) == 0;
+ return tmedia_defaults_set_jb_max_late_rate(jb_late_rate_percent) == 0;
}
bool MediaSessionMgr::defaultsSetEchoTail(uint32_t echo_tail)
{
- return tmedia_defaults_set_echo_tail(echo_tail) == 0;
+ return tmedia_defaults_set_echo_tail(echo_tail) == 0;
}
uint32_t MediaSessionMgr::defaultsGetEchoTail()
{
- return tmedia_defaults_get_echo_tail();
+ return tmedia_defaults_get_echo_tail();
}
bool MediaSessionMgr::defaultsSetEchoSkew(uint32_t echo_skew)
{
- return tmedia_defaults_set_echo_skew(echo_skew) == 0;
+ return tmedia_defaults_set_echo_skew(echo_skew) == 0;
}
bool MediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
- return tmedia_defaults_set_echo_supp_enabled(echo_supp_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_echo_supp_enabled(echo_supp_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetEchoSuppEnabled()
{
- return tmedia_defaults_get_echo_supp_enabled() ? true : false;
+ return tmedia_defaults_get_echo_supp_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
- return tmedia_defaults_set_agc_enabled(agc_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_agc_enabled(agc_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetAgcEnabled()
{
- return tmedia_defaults_get_agc_enabled() ? true : false;
+ return tmedia_defaults_get_agc_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
- return tmedia_defaults_set_agc_level(agc_level) == 0;
+ return tmedia_defaults_set_agc_level(agc_level) == 0;
}
float MediaSessionMgr::defaultsGetAgcLevel()
{
- return tmedia_defaults_get_agc_level();
+ return tmedia_defaults_get_agc_level();
}
bool MediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
- return tmedia_defaults_set_vad_enabled(vad_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_vad_enabled(vad_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetGetVadEnabled()
{
- return tmedia_defaults_get_vad_enabled() ? true : false;
+ return tmedia_defaults_get_vad_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
- return tmedia_defaults_set_noise_supp_enabled(noise_supp_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_noise_supp_enabled(noise_supp_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
- return tmedia_defaults_get_noise_supp_enabled() ? true : false;
+ return tmedia_defaults_get_noise_supp_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetNoiseSuppLevel(int32_t noise_supp_level)
{
- return tmedia_defaults_set_noise_supp_level(noise_supp_level) == 0;
+ return tmedia_defaults_set_noise_supp_level(noise_supp_level) == 0;
}
int32_t MediaSessionMgr::defaultsGetNoiseSuppLevel()
{
- return tmedia_defaults_get_noise_supp_level();
+ return tmedia_defaults_get_noise_supp_level();
}
-bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled){
- return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
+bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
+{
+ return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
}
-bool MediaSessionMgr::defaultsGet100relEnabled(){
- return tmedia_defaults_get_100rel_enabled() == 0;
+bool MediaSessionMgr::defaultsGet100relEnabled()
+{
+ return tmedia_defaults_get_100rel_enabled() == 0;
}
-bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy){
- return tmedia_defaults_set_screen_size(sx, sy) == 0;
+bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy)
+{
+ return tmedia_defaults_set_screen_size(sx, sy) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain){
- return tmedia_defaults_set_audio_gain(producer_gain, consumer_gain) == 0;
+bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain)
+{
+ return tmedia_defaults_set_audio_gain(producer_gain, consumer_gain) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime){
- return tmedia_defaults_set_audio_ptime(ptime) == 0;
+bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime)
+{
+ return tmedia_defaults_set_audio_ptime(ptime) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record){
- return tmedia_defaults_set_audio_channels(channel_playback, channel_record) == 0;
+bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record)
+{
+ return tmedia_defaults_set_audio_channels(channel_playback, channel_record) == 0;
}
-bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop){
- return tmedia_defaults_set_rtp_port_range(range_start, range_stop) == 0;
+bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop)
+{
+ return tmedia_defaults_set_rtp_port_range(range_start, range_stop) == 0;
}
-bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled){
- return tmedia_defaults_set_rtp_symetric_enabled(enabled ? tsk_true : tsk_false) == 0;
+bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
+{
+ return tmedia_defaults_set_rtp_symetric_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetMediaType(twrap_media_type_t media_type)
{
- return (tmedia_defaults_set_media_type(twrap_get_native_media_type(media_type)) == 0);
+ return (tmedia_defaults_set_media_type(twrap_get_native_media_type(media_type)) == 0);
}
bool MediaSessionMgr::defaultsSetVolume(int32_t volume)
{
- return (tmedia_defaults_set_volume(volume) == 0);
+ return (tmedia_defaults_set_volume(volume) == 0);
}
int32_t MediaSessionMgr::defaultsGetVolume()
{
- return tmedia_defaults_get_volume();
+ return tmedia_defaults_get_volume();
}
bool MediaSessionMgr::defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher)
{
- int ret = tmedia_defaults_set_inv_session_expires(timeout);
- ret &= tmedia_defaults_set_inv_session_refresher(refresher);
- return (ret == 0);
+ int ret = tmedia_defaults_set_inv_session_expires(timeout);
+ ret &= tmedia_defaults_set_inv_session_refresher(refresher);
+ return (ret == 0);
}
-bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode){
- return (tmedia_defaults_set_srtp_mode(mode) == 0);
+bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode)
+{
+ return (tmedia_defaults_set_srtp_mode(mode) == 0);
}
-tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode(){
- return tmedia_defaults_get_srtp_mode();
+tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode()
+{
+ return tmedia_defaults_get_srtp_mode();
}
-bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type){
- return (tmedia_defaults_set_srtp_type(srtp_type) == 0);
+bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type)
+{
+ return (tmedia_defaults_set_srtp_type(srtp_type) == 0);
}
-tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType(){
- return tmedia_defaults_get_srtp_type();
+tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType()
+{
+ return tmedia_defaults_get_srtp_type();
}
-bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled){
- return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetRtcpEnabled(){
- return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetRtcpEnabled()
+{
+ return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled){
- return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetRtcpMuxEnabled(){
- return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetRtcpMuxEnabled()
+{
+ return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled){
- return (tmedia_defaults_set_stun_enabled(stun_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled)
+{
+ return (tmedia_defaults_set_stun_enabled(stun_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled){
- return (tmedia_defaults_set_icestun_enabled(icestun_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled)
+{
+ return (tmedia_defaults_set_icestun_enabled(icestun_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled){
- return (tmedia_defaults_set_iceturn_enabled(iceturn_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled)
+{
+ return (tmedia_defaults_set_iceturn_enabled(iceturn_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port){
- return (tmedia_defaults_set_stun_server(server_ip, server_port) == 0);
+bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port)
+{
+ return (tmedia_defaults_set_stun_server(server_ip, server_port) == 0);
}
-bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password){
- return (tmedia_defaults_set_stun_cred(username, password) == 0);
+bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password)
+{
+ return (tmedia_defaults_set_stun_cred(username, password) == 0);
}
-bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled){
- return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
+{
+ return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled){
- return (tmedia_defaults_set_bypass_encoding(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
+{
+ return (tmedia_defaults_set_bypass_encoding(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetByPassEncoding(){
- return (tmedia_defaults_get_bypass_encoding() == tsk_true);
+bool MediaSessionMgr::defaultsGetByPassEncoding()
+{
+ return (tmedia_defaults_get_bypass_encoding() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled){
- return (tmedia_defaults_set_bypass_decoding(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
+{
+ return (tmedia_defaults_set_bypass_decoding(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetByPassDecoding(){
- return (tmedia_defaults_get_bypass_decoding() == tsk_true);
+bool MediaSessionMgr::defaultsGetByPassDecoding()
+{
+ return (tmedia_defaults_get_bypass_decoding() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled){
- return (tmedia_defaults_set_videojb_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_videojb_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetVideoJbEnabled(){
- return (tmedia_defaults_get_videojb_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetVideoJbEnabled()
+{
+ return (tmedia_defaults_get_videojb_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled){
- return (tmedia_defaults_set_video_zeroartifacts_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_video_zeroartifacts_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled(){
- return (tmedia_defaults_get_video_zeroartifacts_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled()
+{
+ return (tmedia_defaults_get_video_zeroartifacts_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize){
- return (tmedia_defaults_set_rtpbuff_size(buffSize) == 0);
+bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
+{
+ return (tmedia_defaults_set_rtpbuff_size(buffSize) == 0);
}
-unsigned MediaSessionMgr::defaultsGetRtpBuffSize(){
- return tmedia_defaults_get_rtpbuff_size();
+unsigned MediaSessionMgr::defaultsGetRtpBuffSize()
+{
+ return tmedia_defaults_get_rtpbuff_size();
}
-bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max){
- return (tmedia_defaults_set_avpf_tail(tail_min, tail_max) == 0);
+bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
+{
+ return (tmedia_defaults_set_avpf_tail(tail_min, tail_max) == 0);
}
-bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode){
- return (tmedia_defaults_set_avpf_mode(mode) == 0);
+bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode)
+{
+ return (tmedia_defaults_set_avpf_mode(mode) == 0);
}
-bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate){
- return (tmedia_defaults_set_opus_maxcapturerate(opus_maxcapturerate) == 0);
+bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate)
+{
+ return (tmedia_defaults_set_opus_maxcapturerate(opus_maxcapturerate) == 0);
}
-bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate){
- return (tmedia_defaults_set_opus_maxplaybackrate(opus_maxplaybackrate) == 0);
+bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate)
+{
+ return (tmedia_defaults_set_opus_maxplaybackrate(opus_maxplaybackrate) == 0);
}
-bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds) {
- return (tmedia_defaults_set_max_fds(max_fds) == 0);
+bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds)
+{
+ return (tmedia_defaults_set_max_fds(max_fds) == 0);
} \ No newline at end of file
diff --git a/bindings/_common/MediaSessionMgr.h b/bindings/_common/MediaSessionMgr.h
index 5c28769..c4f52be 100755
--- a/bindings/_common/MediaSessionMgr.h
+++ b/bindings/_common/MediaSessionMgr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,142 +28,219 @@
#include "Common.h"
class ProxyPlugin;
+class MediaSessionMgr;
+
+class TINYWRAP_API QoS
+{
+ friend class MediaSessionMgr;
+public:
+#if !defined(SWIG)
+ QoS(float qavg, float q1 = -1.f, float q2 = -1.f, float q3 = -1.f, float q4 = -1.f, float q5 = -1.f);
+#endif
+ virtual ~QoS();
+ float getQavg() {
+ return m_Qqvg;
+ }
+ float getQ1() {
+ return m_Qn[0];
+ }
+ float getQ2() {
+ return m_Qn[1];
+ }
+ float getQ3() {
+ return m_Qn[2];
+ }
+ float getQ4() {
+ return m_Qn[3];
+ }
+ float getQ5() {
+ return m_Qn[4];
+ }
+ unsigned getVideoInWidth() {
+ return m_VideoInWidth;
+ }
+ unsigned getVideoOutWidth() {
+ return m_VideoOutWidth;
+ }
+ unsigned getVideoInHeight() {
+ return m_VideoInHeight;
+ }
+ unsigned getVideoOutHeight() {
+ return m_VideoOutHeight;
+ }
+ unsigned getBandwidthDownKbps() {
+ return m_BandwidthDownKbps;
+ }
+ unsigned getBandwidthUpKbps() {
+ return m_BandwidthUpKbps;
+ }
+ unsigned getVideoInAvgFps() {
+ return m_VideoInAvgFps;
+ }
+ unsigned getVideoDecAvgTime() { // In millis
+ return m_VideoDecAvgTime;
+ }
+ unsigned getVideoEncAvgTime() { // In millis
+ return m_VideoEncAvgTime;
+ }
+private:
+ float m_Qqvg;
+ float m_Qn[5];
+ unsigned m_VideoInWidth;
+ unsigned m_VideoOutWidth;
+ unsigned m_VideoInHeight;
+ unsigned m_VideoOutHeight;
+ unsigned m_BandwidthDownKbps;
+ unsigned m_BandwidthUpKbps;
+ unsigned m_VideoInAvgFps;
+ unsigned m_VideoDecAvgTime;
+ unsigned m_VideoEncAvgTime;
+};
class TINYWRAP_API Codec
{
public:
#if !defined(SWIG)
- Codec(const struct tmedia_codec_s* pWrappedCodec);
+ Codec(const struct tmedia_codec_s* pWrappedCodec);
#endif
- virtual ~Codec();
+ virtual ~Codec();
public:
#if !defined(SWIG)
- const struct tmedia_codec_s* getWrappedCodec(){ return m_pWrappedCodec; }
- inline bool isOpened(){ return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true)); }
+ const struct tmedia_codec_s* getWrappedCodec() {
+ return m_pWrappedCodec;
+ }
+ inline bool isOpened() {
+ return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true));
+ }
#endif
- twrap_media_type_t getMediaType();
- const char* getName();
- const char* getDescription();
- const char* getNegFormat();
- int getAudioSamplingRate();
- int getAudioChannels();
- int getAudioPTime();
+ twrap_media_type_t getMediaType();
+ const char* getName();
+ const char* getDescription();
+ const char* getNegFormat();
+ int getAudioSamplingRate();
+ int getAudioChannels();
+ int getAudioPTime();
private:
- struct tmedia_codec_s* m_pWrappedCodec;
+ struct tmedia_codec_s* m_pWrappedCodec;
};
class TINYWRAP_API MediaSessionMgr
{
public:
#if !defined(SWIG)
- MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr);
+ MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr);
#endif
- virtual ~MediaSessionMgr();
+ virtual ~MediaSessionMgr();
public:
- bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
+ bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
+ QoS* sessionGetQoS(twrap_media_type_t media);
- bool consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- bool consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
+ bool consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ bool consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
- bool producerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- bool producerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
- Codec* producerGetCodec(twrap_media_type_t media);
+ bool producerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ bool producerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
+ Codec* producerGetCodec(twrap_media_type_t media);
#if !defined(SWIG)
- const ProxyPlugin* findProxyPlugin(twrap_media_type_t media, bool consumer)const;
+ const ProxyPlugin* findProxyPlugin(twrap_media_type_t media, bool consumer)const;
#endif
- const ProxyPlugin* findProxyPluginConsumer(twrap_media_type_t media)const{
- return this->findProxyPlugin(media, true);
- }
- const ProxyPlugin* findProxyPluginProducer(twrap_media_type_t media)const{
- return this->findProxyPlugin(media, false);
- }
+ const ProxyPlugin* findProxyPluginConsumer(twrap_media_type_t media)const {
+ return this->findProxyPlugin(media, true);
+ }
+ const ProxyPlugin* findProxyPluginProducer(twrap_media_type_t media)const {
+ return this->findProxyPlugin(media, false);
+ }
- static unsigned int registerAudioPluginFromFile(const char* path);
+ static unsigned int registerAudioPluginFromFile(const char* path);
- uint64_t getSessionId(twrap_media_type_t media)const;
+ uint64_t getSessionId(twrap_media_type_t media)const;
#if !defined(SWIG)
- inline const tmedia_session_mgr_t* getWrappedMgr()const { return m_pWrappedMgr; }
+ inline const tmedia_session_mgr_t* getWrappedMgr()const {
+ return m_pWrappedMgr;
+ }
#endif
-
- // Defaults
- static bool defaultsSetProfile(tmedia_profile_t profile);
- static tmedia_profile_t defaultsGetProfile();
- static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl); // @deprecated
- static tmedia_bandwidth_level_t defaultsGetBandwidthLevel(); // @deprecated
- static bool defaultsSetCongestionCtrlEnabled(bool enabled);
- static bool defaultsSetVideoMotionRank(int32_t video_motion_rank);
- static bool defaultsSetVideoFps(int32_t video_fps);
- static bool defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
- static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
- static bool defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
- static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
- static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
- static bool defaultsSetEchoTail(uint32_t echo_tail);
- static uint32_t defaultsGetEchoTail();
- static bool defaultsSetEchoSkew(uint32_t echo_skew);
- static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
- static bool defaultsGetEchoSuppEnabled();
- static bool defaultsSetAgcEnabled(bool agc_enabled);
- static bool defaultsGetAgcEnabled();
- static bool defaultsSetAgcLevel(float agc_level);
- static float defaultsGetAgcLevel();
- static bool defaultsSetVadEnabled(bool vad_enabled);
- static bool defaultsGetGetVadEnabled();
- static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
- static bool defaultsGetNoiseSuppEnabled();
- static bool defaultsSetNoiseSuppLevel(int32_t noise_supp_level);
- static int32_t defaultsGetNoiseSuppLevel();
- static bool defaultsSet100relEnabled(bool _100rel_enabled);
- static bool defaultsGet100relEnabled();
- static bool defaultsSetScreenSize(int32_t sx, int32_t sy);
- static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
- static bool defaultsSetAudioPtime(int32_t ptime);
- static bool defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record);
- static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
- static bool defaultsSetRtpSymetricEnabled(bool enabled);
- static bool defaultsSetMediaType(twrap_media_type_t media_type);
- static bool defaultsSetVolume(int32_t volume);
- static int32_t defaultsGetVolume();
- static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
- static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
- static tmedia_srtp_mode_t defaultsGetSRtpMode();
- static bool defaultsSetSRtpType(tmedia_srtp_type_t srtp_type);
- static tmedia_srtp_type_t defaultsGetSRtpType();
- static bool defaultsSetRtcpEnabled(bool enabled);
- static bool defaultsGetRtcpEnabled();
- static bool defaultsSetRtcpMuxEnabled(bool enabled);
- static bool defaultsGetRtcpMuxEnabled();
- static bool defaultsSetStunEnabled(bool stun_enabled);
- static bool defaultsSetIceStunEnabled(bool icestun_enabled);
- static bool defaultsSetIceTurnEnabled(bool iceturn_enabled);
- static bool defaultsSetStunServer(const char* server_ip, uint16_t server_port);
- static bool defaultsSetStunCred(const char* username, const char* password);
- static bool defaultsSetIceEnabled(bool ice_enabled);
- static bool defaultsSetByPassEncoding(bool enabled);
- static bool defaultsGetByPassEncoding();
- static bool defaultsSetByPassDecoding(bool enabled);
- static bool defaultsGetByPassDecoding();
- static bool defaultsSetVideoJbEnabled(bool enabled);
- static bool defaultsGetVideoJbEnabled();
- static bool defaultsSetVideoZeroArtifactsEnabled(bool enabled);
- static bool defaultsGetVideoZeroArtifactsEnabled();
- static bool defaultsSetRtpBuffSize(unsigned buffSize);
- static unsigned defaultsGetRtpBuffSize();
- static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
- static bool defaultsSetAvpfMode(enum tmedia_mode_e mode);
- static bool defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate);
- static bool defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate);
- static bool defaultsSetMaxFds(int32_t max_fds);
+
+ // Defaults
+ static bool defaultsSetProfile(tmedia_profile_t profile);
+ static tmedia_profile_t defaultsGetProfile();
+ static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl); // @deprecated
+ static tmedia_bandwidth_level_t defaultsGetBandwidthLevel(); // @deprecated
+ static bool defaultsSetCongestionCtrlEnabled(bool enabled);
+ static bool defaultsSetVideoMotionRank(int32_t video_motion_rank);
+ static bool defaultsSetVideoFps(int32_t video_fps);
+ static bool defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
+ static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
+ static bool defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
+ static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max);
+ static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled);
+ static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
+ static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
+ static bool defaultsSetEchoTail(uint32_t echo_tail);
+ static uint32_t defaultsGetEchoTail();
+ static bool defaultsSetEchoSkew(uint32_t echo_skew);
+ static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
+ static bool defaultsGetEchoSuppEnabled();
+ static bool defaultsSetAgcEnabled(bool agc_enabled);
+ static bool defaultsGetAgcEnabled();
+ static bool defaultsSetAgcLevel(float agc_level);
+ static float defaultsGetAgcLevel();
+ static bool defaultsSetVadEnabled(bool vad_enabled);
+ static bool defaultsGetGetVadEnabled();
+ static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
+ static bool defaultsGetNoiseSuppEnabled();
+ static bool defaultsSetNoiseSuppLevel(int32_t noise_supp_level);
+ static int32_t defaultsGetNoiseSuppLevel();
+ static bool defaultsSet100relEnabled(bool _100rel_enabled);
+ static bool defaultsGet100relEnabled();
+ static bool defaultsSetScreenSize(int32_t sx, int32_t sy);
+ static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
+ static bool defaultsSetAudioPtime(int32_t ptime);
+ static bool defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record);
+ static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
+ static bool defaultsSetRtpSymetricEnabled(bool enabled);
+ static bool defaultsSetMediaType(twrap_media_type_t media_type);
+ static bool defaultsSetVolume(int32_t volume);
+ static int32_t defaultsGetVolume();
+ static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
+ static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
+ static tmedia_srtp_mode_t defaultsGetSRtpMode();
+ static bool defaultsSetSRtpType(tmedia_srtp_type_t srtp_type);
+ static tmedia_srtp_type_t defaultsGetSRtpType();
+ static bool defaultsSetRtcpEnabled(bool enabled);
+ static bool defaultsGetRtcpEnabled();
+ static bool defaultsSetRtcpMuxEnabled(bool enabled);
+ static bool defaultsGetRtcpMuxEnabled();
+ static bool defaultsSetStunEnabled(bool stun_enabled);
+ static bool defaultsSetIceStunEnabled(bool icestun_enabled);
+ static bool defaultsSetIceTurnEnabled(bool iceturn_enabled);
+ static bool defaultsSetStunServer(const char* server_ip, uint16_t server_port);
+ static bool defaultsSetStunCred(const char* username, const char* password);
+ static bool defaultsSetIceEnabled(bool ice_enabled);
+ static bool defaultsSetByPassEncoding(bool enabled);
+ static bool defaultsGetByPassEncoding();
+ static bool defaultsSetByPassDecoding(bool enabled);
+ static bool defaultsGetByPassDecoding();
+ static bool defaultsSetVideoJbEnabled(bool enabled);
+ static bool defaultsGetVideoJbEnabled();
+ static bool defaultsSetVideoZeroArtifactsEnabled(bool enabled);
+ static bool defaultsGetVideoZeroArtifactsEnabled();
+ static bool defaultsSetRtpBuffSize(unsigned buffSize);
+ static unsigned defaultsGetRtpBuffSize();
+ static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
+ static bool defaultsSetAvpfMode(enum tmedia_mode_e mode);
+ static bool defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate);
+ static bool defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate);
+ static bool defaultsSetMaxFds(int32_t max_fds);
private:
- tmedia_session_mgr_t* m_pWrappedMgr;
+ tmedia_session_mgr_t* m_pWrappedMgr;
};
#endif /* TINYWRAP_MEDIA_SESSIONMGR_H */
diff --git a/bindings/_common/Msrp.cxx b/bindings/_common/Msrp.cxx
index a1d0992..edb25d3 100755
--- a/bindings/_common/Msrp.cxx
+++ b/bindings/_common/Msrp.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,192 +26,224 @@
/* ======================== MsrpMessage ========================*/
MsrpMessage::MsrpMessage()
-:m_pMessage(tsk_null)
+ :m_pMessage(tsk_null)
{
}
MsrpMessage::MsrpMessage(tmsrp_message_t *_message)
{
- m_pMessage = (tmsrp_message_t *)tsk_object_ref(_message);
+ m_pMessage = (tmsrp_message_t *)tsk_object_ref(_message);
}
MsrpMessage::~MsrpMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pMessage);
+ TSK_OBJECT_SAFE_FREE(m_pMessage);
}
bool MsrpMessage::isRequest()
{
- return (m_pMessage->type == tmsrp_request);
+ return (m_pMessage->type == tmsrp_request);
}
short MsrpMessage::getCode()
{
- return TMSRP_RESPONSE_CODE(m_pMessage);
+ return TMSRP_RESPONSE_CODE(m_pMessage);
}
const char* MsrpMessage::getPhrase()
{
- return TMSRP_RESPONSE_PHRASE(m_pMessage);
+ return TMSRP_RESPONSE_PHRASE(m_pMessage);
}
tmsrp_request_type_t MsrpMessage::getRequestType()
{
- if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)){
- return m_pMessage->line.request.type;
- }
- return tmsrp_NONE;
+ if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)) {
+ return m_pMessage->line.request.type;
+ }
+ return tmsrp_NONE;
}
void MsrpMessage::getByteRange(int64_t* start, int64_t* end, int64_t* total)
{
- if(m_pMessage->ByteRange){
- *start = m_pMessage->ByteRange->start;
- *end = m_pMessage->ByteRange->end;
- *total = m_pMessage->ByteRange->total;
- }
- else{
- *start = *end = *total = -1;
- }
+ if(m_pMessage->ByteRange) {
+ *start = m_pMessage->ByteRange->start;
+ *end = m_pMessage->ByteRange->end;
+ *total = m_pMessage->ByteRange->total;
+ }
+ else {
+ *start = *end = *total = -1;
+ }
}
bool MsrpMessage::isLastChunck()
{
- if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)){
- return (m_pMessage->end_line.cflag == '$');
- }
- else{
- if(m_pMessage->ByteRange){
- return (m_pMessage->ByteRange->end >= m_pMessage->ByteRange->total);
- }
- }
- return false;
+ if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)) {
+ return (m_pMessage->end_line.cflag == '$');
+ }
+ else {
+ if(m_pMessage->ByteRange) {
+ return (m_pMessage->ByteRange->end >= m_pMessage->ByteRange->total);
+ }
+ }
+ return false;
}
bool MsrpMessage::isSuccessReport()
{
- if(TMSRP_REQUEST_IS_REPORT(m_pMessage)){
- if(m_pMessage->Status){
- return m_pMessage->Status->code >= 200 && m_pMessage->Status->code <= 299;
- }
- }
- return false;
+ if(TMSRP_REQUEST_IS_REPORT(m_pMessage)) {
+ if(m_pMessage->Status) {
+ return m_pMessage->Status->code >= 200 && m_pMessage->Status->code <= 299;
+ }
+ }
+ return false;
}
bool MsrpMessage::isFirstChunck()
{
- return (m_pMessage && m_pMessage->ByteRange->start == 1);
+ return (m_pMessage && m_pMessage->ByteRange->start == 1);
}
char* MsrpMessage::getMsrpHeaderValue(const char* name)
{
- const tmsrp_header_t* header = this->getMsrpHeader(name, 0);
- if(header){
- return tmsrp_header_tostring(header);
- }
- return tsk_null;
+ const tmsrp_header_t* header = this->getMsrpHeader(name, 0);
+ if(header) {
+ return tmsrp_header_tostring(header);
+ }
+ return tsk_null;
}
char* MsrpMessage::getMsrpHeaderParamValue(const char* name, const char* param)
{
- return tsk_null;
+ return tsk_null;
}
unsigned MsrpMessage::getMsrpContentLength()
{
- if(m_pMessage &&
- m_pMessage->Content &&
- m_pMessage->Content->data &&
- m_pMessage->Content->size){
- return m_pMessage->Content->size;
- }
- return 0;
+ if(m_pMessage &&
+ m_pMessage->Content &&
+ m_pMessage->Content->data &&
+ m_pMessage->Content->size) {
+ return m_pMessage->Content->size;
+ }
+ return 0;
}
unsigned MsrpMessage::getMsrpContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(!output ||
- !m_pMessage ||
- !m_pMessage->Content ||
- !m_pMessage->Content->data ||
- !m_pMessage->Content->size){
- return 0;
- }
-
-
- retsize = (m_pMessage->Content->size > maxsize) ? maxsize : m_pMessage->Content->size;
- memcpy(output, m_pMessage->Content->data, retsize);
- return retsize;
+ unsigned retsize = 0;
+ if(!output ||
+ !m_pMessage ||
+ !m_pMessage->Content ||
+ !m_pMessage->Content->data ||
+ !m_pMessage->Content->size) {
+ return 0;
+ }
+
+
+ retsize = (m_pMessage->Content->size > maxsize) ? maxsize : m_pMessage->Content->size;
+ memcpy(output, m_pMessage->Content->data, retsize);
+ return retsize;
}
const tmsrp_header_t* MsrpMessage::getMsrpHeader(const char* name, unsigned index /*= 0*/)
{
- tsk_size_t pos = 0;
- const tmsrp_header_t* hdr = tsk_null;
- const tsk_list_item_t *item;
-
- /* From tmsrp_message_get_headerAt() */
- if(!m_pMessage || !name){
- return tsk_null;
- }
-
- if(tsk_striequals(name, "To-Path")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->To;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "From-Path")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->From;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Message-ID")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->MessageID;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Byte-Range")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->ByteRange;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Failure-Report")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->FailureReport;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Success-Report")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->SuccessReport;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Status")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->Status;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Content-Type")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->ContentType;
- goto bail;
- }else pos++; }
-
-
- /* All other headers */
- tsk_list_foreach(item, m_pMessage->headers){
- if(tsk_striequals(tmsrp_header_get_nameex(TMSRP_HEADER(item->data)), name)){
- if(pos++ >= index){
- hdr = (const tmsrp_header_t*)item->data;
- break;
- }
- }
- }
-
+ tsk_size_t pos = 0;
+ const tmsrp_header_t* hdr = tsk_null;
+ const tsk_list_item_t *item;
+
+ /* From tmsrp_message_get_headerAt() */
+ if(!m_pMessage || !name) {
+ return tsk_null;
+ }
+
+ if(tsk_striequals(name, "To-Path")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "From-Path")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Message-ID")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->MessageID;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Byte-Range")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->ByteRange;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Failure-Report")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->FailureReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Success-Report")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->SuccessReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Status")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->Status;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Content-Type")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->ContentType;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+
+
+ /* All other headers */
+ tsk_list_foreach(item, m_pMessage->headers) {
+ if(tsk_striequals(tmsrp_header_get_nameex(TMSRP_HEADER(item->data)), name)) {
+ if(pos++ >= index) {
+ hdr = (const tmsrp_header_t*)item->data;
+ break;
+ }
+ }
+ }
+
bail:
- return hdr;
-
+ return hdr;
+
}
@@ -219,41 +251,41 @@ bail:
/* ======================== MsrpEvent ========================*/
MsrpEvent::MsrpEvent(const tmsrp_event_t *_msrpevent)
{
- this->_event = _msrpevent;
- if(this->_event && this->_event->message){
- m_pMessage = new MsrpMessage((tmsrp_message_t *)this->_event->message);
- }
- else{
- m_pMessage = tsk_null;
- }
+ this->_event = _msrpevent;
+ if(this->_event && this->_event->message) {
+ m_pMessage = new MsrpMessage((tmsrp_message_t *)this->_event->message);
+ }
+ else {
+ m_pMessage = tsk_null;
+ }
}
MsrpEvent::~MsrpEvent()
{
- if(m_pMessage){
- delete m_pMessage;
- }
+ if(m_pMessage) {
+ delete m_pMessage;
+ }
}
tmsrp_event_type_t MsrpEvent::getType()
{
- if(this->_event){
- return this->_event->type;
- }
- return tmsrp_event_type_none;
+ if(this->_event) {
+ return this->_event->type;
+ }
+ return tmsrp_event_type_none;
}
const MsrpSession* MsrpEvent::getSipSession()
{
- if(this->_event && this->_event->callback_data){
- return dyn_cast<const MsrpSession*>((const MsrpSession*)this->_event->callback_data);
- }
- return tsk_null;
+ if(this->_event && this->_event->callback_data) {
+ return dyn_cast<const MsrpSession*>((const MsrpSession*)this->_event->callback_data);
+ }
+ return tsk_null;
}
const MsrpMessage* MsrpEvent::getMessage() const
{
- return m_pMessage;
+ return m_pMessage;
}
@@ -261,23 +293,23 @@ const MsrpMessage* MsrpEvent::getMessage() const
int twrap_msrp_cb(const tmsrp_event_t* _event)
{
- const MsrpSession* session = (const MsrpSession*)_event->callback_data;
- MsrpCallback* callback;
- int ret = -1;
-
- if(session){
- if((callback = session->getCallback())){
- MsrpEvent* e = new MsrpEvent(_event);
- ret = callback->OnEvent(e);
- delete e;
- }
- else{
- return 0;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
-
- return ret;
+ const MsrpSession* session = (const MsrpSession*)_event->callback_data;
+ MsrpCallback* callback;
+ int ret = -1;
+
+ if(session) {
+ if((callback = session->getCallback())) {
+ MsrpEvent* e = new MsrpEvent(_event);
+ ret = callback->OnEvent(e);
+ delete e;
+ }
+ else {
+ return 0;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+
+ return ret;
} \ No newline at end of file
diff --git a/bindings/_common/Msrp.h b/bindings/_common/Msrp.h
index 9013abb..330860b 100755
--- a/bindings/_common/Msrp.h
+++ b/bindings/_common/Msrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,62 +31,66 @@ class MsrpSession;
class TINYWRAP_API MsrpMessage
{
public:
- MsrpMessage();
+ MsrpMessage();
#if !defined(SWIG)
- MsrpMessage(tmsrp_message_t *message);
+ MsrpMessage(tmsrp_message_t *message);
#endif
- virtual ~MsrpMessage();
+ virtual ~MsrpMessage();
- bool isRequest();
- short getCode();
- const char* getPhrase();
- tmsrp_request_type_t getRequestType();
+ bool isRequest();
+ short getCode();
+ const char* getPhrase();
+ tmsrp_request_type_t getRequestType();
#if defined(SWIG)
- void getByteRange(int64_t* OUTPUT, int64_t* OUTPUT, int64_t* OUTPUT);
+ void getByteRange(int64_t* OUTPUT, int64_t* OUTPUT, int64_t* OUTPUT);
#else
- void getByteRange(int64_t* start, int64_t* end, int64_t* total);
+ void getByteRange(int64_t* start, int64_t* end, int64_t* total);
#endif
- bool isLastChunck();
- bool isFirstChunck();
- bool isSuccessReport();
- char* getMsrpHeaderValue(const char* name);
- char* getMsrpHeaderParamValue(const char* name, const char* param);
- unsigned getMsrpContentLength();
- unsigned getMsrpContent(void* output, unsigned maxsize);
+ bool isLastChunck();
+ bool isFirstChunck();
+ bool isSuccessReport();
+ char* getMsrpHeaderValue(const char* name);
+ char* getMsrpHeaderParamValue(const char* name, const char* param);
+ unsigned getMsrpContentLength();
+ unsigned getMsrpContent(void* output, unsigned maxsize);
#if !defined(SWIG)
- const tmsrp_message_t* getWrappedMsrpMessage() { return m_pMessage; }
+ const tmsrp_message_t* getWrappedMsrpMessage() {
+ return m_pMessage;
+ }
#endif
private:
- const tmsrp_header_t* getMsrpHeader(const char* name, unsigned index = 0);
+ const tmsrp_header_t* getMsrpHeader(const char* name, unsigned index = 0);
private:
- tmsrp_message_t *m_pMessage;
+ tmsrp_message_t *m_pMessage;
};
class TINYWRAP_API MsrpEvent
{
public:
#if !defined(SWIG)
- MsrpEvent(const tmsrp_event_t *_event);
+ MsrpEvent(const tmsrp_event_t *_event);
#endif
- virtual ~MsrpEvent();
+ virtual ~MsrpEvent();
- tmsrp_event_type_t getType();
- const MsrpSession* getSipSession();
- const MsrpMessage* getMessage() const;
+ tmsrp_event_type_t getType();
+ const MsrpSession* getSipSession();
+ const MsrpMessage* getMessage() const;
protected:
- const tmsrp_event_t *_event;
- MsrpMessage* m_pMessage;
+ const tmsrp_event_t *_event;
+ MsrpMessage* m_pMessage;
};
class TINYWRAP_API MsrpCallback
{
public:
- MsrpCallback() { }
- virtual ~MsrpCallback() {}
- virtual int OnEvent(const MsrpEvent* e) { return -1; }
+ MsrpCallback() { }
+ virtual ~MsrpCallback() {}
+ virtual int OnEvent(const MsrpEvent* e) {
+ return -1;
+ }
};
diff --git a/bindings/_common/ProxyConsumer.cxx b/bindings/_common/ProxyConsumer.cxx
index 2150654..9aa4b2f 100755
--- a/bindings/_common/ProxyConsumer.cxx
+++ b/bindings/_common/ProxyConsumer.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,120 +40,119 @@
/* ============ Audio Consumer Interface ================= */
-typedef struct twrap_consumer_proxy_audio_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct twrap_consumer_proxy_audio_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- uint64_t id;
- tsk_bool_t started;
- const ProxyAudioConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
+ uint64_t id;
+ tsk_bool_t started;
+ const ProxyAudioConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
}
twrap_consumer_proxy_audio_t;
#define TWRAP_CONSUMER_PROXY_AUDIO(self) ((twrap_consumer_proxy_audio_t*)(self))
int twrap_consumer_proxy_audio_set(tmedia_consumer_t* _self, const tmedia_param_t* param)
{
- twrap_consumer_proxy_audio_t* self = (twrap_consumer_proxy_audio_t*)_self;
- if(param->plugin_type == tmedia_ppt_consumer){
- // specific proxy consumer
- }
- return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ twrap_consumer_proxy_audio_t* self = (twrap_consumer_proxy_audio_t*)_self;
+ if(param->plugin_type == tmedia_ppt_consumer) {
+ // specific proxy consumer
+ }
+ return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
int twrap_consumer_proxy_audio_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
- ProxyPluginMgr* manager = NULL;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- if((audio->pcConsumer = manager->findAudioConsumer(audio->id)) && audio->pcConsumer->getCallback()){
- self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- self->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- self->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- ret = audio->pcConsumer->getCallback()->prepare((int)self->audio.ptime, self->audio.in.rate, self->audio.in.channels);
- if(ret == 0 && !audio->pcConsumer->getCallback()->isPivotSettings()){
- // say consumer can output these params
- // Out "rate" and "channels" must be defined regardless previous values (already the case in other back-ends) to avoid issues on reINVITE with rate change (e.g. Opus -> PCMA).
- /*if(!self->audio.out.rate)*/ self->audio.out.rate = self->audio.in.rate;
- /*if(!self->audio.out.channels)*/ self->audio.out.channels = self->audio.in.channels;
- }
- }
- }
- else {
- TSK_DEBUG_ERROR("Invalid parameter/state: codec=%d, manager=%s", codec, manager ? "no-null" : "null");
- }
-
- return ret;
+ twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
+ ProxyPluginMgr* manager = NULL;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ if((audio->pcConsumer = manager->findAudioConsumer(audio->id)) && audio->pcConsumer->getCallback()) {
+ self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ self->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ self->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ ret = audio->pcConsumer->getCallback()->prepare((int)self->audio.ptime, self->audio.in.rate, self->audio.in.channels);
+ if(ret == 0 && !audio->pcConsumer->getCallback()->isPivotSettings()) {
+ // say consumer can output these params
+ // Out "rate" and "channels" must be defined regardless previous values (already the case in other back-ends) to avoid issues on reINVITE with rate change (e.g. Opus -> PCMA).
+ /*if(!self->audio.out.rate)*/ self->audio.out.rate = self->audio.in.rate;
+ /*if(!self->audio.out.channels)*/ self->audio.out.channels = self->audio.in.channels;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter/state: codec=%d, manager=%s", codec, manager ? "no-null" : "null");
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_start(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->start();
- }
- }
-
- TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->start();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0);
+ return ret;
}
int twrap_consumer_proxy_audio_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
-
- if(!audio->pcConsumer){
- ProxyPluginMgr* manager;
- if((manager = ProxyPluginMgr::getInstance())){
- audio->pcConsumer = manager->findAudioConsumer(audio->id);
- }
- }
-
- ProxyAudioConsumerCallback* callback;
- int ret = -1;
- if(audio->pcConsumer && (callback = audio->pcConsumer->getCallback())){
- if(callback->putInJitterBuffer()){
- ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
- }
- else{
- ret = callback->consume(buffer, size, proto_hdr);
- }
- }
-
- return ret;
+ twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
+
+ if(!audio->pcConsumer) {
+ ProxyPluginMgr* manager;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ audio->pcConsumer = manager->findAudioConsumer(audio->id);
+ }
+ }
+
+ ProxyAudioConsumerCallback* callback;
+ int ret = -1;
+ if(audio->pcConsumer && (callback = audio->pcConsumer->getCallback())) {
+ if(callback->putInJitterBuffer()) {
+ ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
+ }
+ else {
+ ret = callback->consume(buffer, size, proto_hdr);
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_pause(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_stop(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->stop();
- }
- }
-
- TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->stop();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -163,70 +162,68 @@ int twrap_consumer_proxy_audio_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* twrap_consumer_proxy_audio_ctor(tsk_object_t * self, va_list * app)
{
- twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyConsumer = new ProxyAudioConsumer(consumer);
- uint64_t id = proxyConsumer->getId();
- manager->addPlugin(&proxyConsumer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_consumer);
- }
- }
- return self;
+ twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyConsumer = new ProxyAudioConsumer(consumer);
+ uint64_t id = proxyConsumer->getId();
+ manager->addPlugin(&proxyConsumer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_consumer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_consumer_proxy_audio_dtor(tsk_object_t * self)
-{
- twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
- if(consumer){
- /* stop */
- if(consumer->started){
- twrap_consumer_proxy_audio_stop(TMEDIA_CONSUMER(consumer));
- }
+{
+ twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
+ if(consumer) {
+ /* stop */
+ if(consumer->started) {
+ twrap_consumer_proxy_audio_stop(TMEDIA_CONSUMER(consumer));
+ }
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
- /* deinit self */
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
+ /* deinit self */
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_audio_consumer);
- manager->removePlugin(consumer->id);
- }
- }
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_audio_consumer);
+ manager->removePlugin(consumer->id);
+ }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_consumer_proxy_audio_def_s =
-{
- sizeof(twrap_consumer_proxy_audio_t),
- twrap_consumer_proxy_audio_ctor,
- twrap_consumer_proxy_audio_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t twrap_consumer_proxy_audio_def_s = {
+ sizeof(twrap_consumer_proxy_audio_t),
+ twrap_consumer_proxy_audio_ctor,
+ twrap_consumer_proxy_audio_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s =
-{
- &twrap_consumer_proxy_audio_def_s,
-
- tmedia_audio,
- "Audio Proxy Consumer",
-
- twrap_consumer_proxy_audio_set,
- twrap_consumer_proxy_audio_prepare,
- twrap_consumer_proxy_audio_start,
- twrap_consumer_proxy_audio_consume,
- twrap_consumer_proxy_audio_pause,
- twrap_consumer_proxy_audio_stop
+static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s = {
+ &twrap_consumer_proxy_audio_def_s,
+
+ tmedia_audio,
+ "Audio Proxy Consumer",
+
+ twrap_consumer_proxy_audio_set,
+ twrap_consumer_proxy_audio_prepare,
+ twrap_consumer_proxy_audio_start,
+ twrap_consumer_proxy_audio_consume,
+ twrap_consumer_proxy_audio_pause,
+ twrap_consumer_proxy_audio_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_consumer_plugin_def_t *twrap_consumer_proxy_audio_plugin_def_t = &twrap_consumer_proxy_audio_plugin_def_s;
@@ -235,144 +232,144 @@ static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_
/* ============ ProxyAudioConsumer Class ================= */
ProxyAudioConsumer::ProxyAudioConsumer(twrap_consumer_proxy_audio_t* pConsumer)
-:ProxyPlugin(twrap_proxy_plugin_audio_consumer),
-m_pWrappedPlugin(pConsumer),
-m_pCallback(tsk_null)
+ :ProxyPlugin(twrap_proxy_plugin_audio_consumer),
+ m_pWrappedPlugin(pConsumer),
+ m_pCallback(tsk_null)
{
- memset(&m_PullBuffer, 0, sizeof(m_PullBuffer));
- memset(&m_Resampler, 0, sizeof(m_Resampler));
+ memset(&m_PullBuffer, 0, sizeof(m_PullBuffer));
+ memset(&m_Resampler, 0, sizeof(m_Resampler));
- if(m_pWrappedPlugin){
- m_pWrappedPlugin->id = this->getId();
- }
+ if(m_pWrappedPlugin) {
+ m_pWrappedPlugin->id = this->getId();
+ }
}
ProxyAudioConsumer::~ProxyAudioConsumer()
{
- TSK_FREE(m_Resampler.pInBufferPtr);
- m_Resampler.nInBufferSizeInByte = 0;
- if(m_Resampler.pResampler){
- delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
- }
+ TSK_FREE(m_Resampler.pInBufferPtr);
+ m_Resampler.nInBufferSizeInByte = 0;
+ if(m_Resampler.pResampler) {
+ delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
+ }
}
// Use this function to request resampling when your sound card can't honor negotaited record parameters
bool ProxyAudioConsumer::setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels)
{
- if(m_pWrappedPlugin){
- TSK_DEBUG_INFO("ProxyAudioConsumer::setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.ptime = nPtime;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.rate = nRate;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.channels = nChannels;
- return true;
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- return false;
- }
+ if(m_pWrappedPlugin) {
+ TSK_DEBUG_INFO("ProxyAudioConsumer::setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.ptime = nPtime;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.rate = nRate;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.channels = nChannels;
+ return true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ return false;
+ }
}
bool ProxyAudioConsumer::queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality)
{
- TSK_DEBUG_INFO("queryForResampler(%hu,%hu,%hu,%hu,%hu)", nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
- if(nResamplerQuality > 10){
- TSK_DEBUG_WARN("%d is invalid value for quality", nResamplerQuality);
- }
- m_Resampler.pResampler = new AudioResampler(nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
- if(!m_Resampler.pResampler){
- TSK_DEBUG_ERROR("Failed to create new 'AudioResampler' object");
- return false;
- }
- bool bOK = m_Resampler.pResampler->isValid();
- if(!bOK){
- goto bail;
- }
- m_Resampler.nInBufferSizeInByte = m_Resampler.pResampler->getInputRequiredSizeInShort() * 2;
- m_Resampler.pInBufferPtr = tsk_calloc(m_Resampler.nInBufferSizeInByte, 1);
- bOK = (m_Resampler.pInBufferPtr != tsk_null);
+ TSK_DEBUG_INFO("queryForResampler(%hu,%hu,%hu,%hu,%hu)", nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
+ if(nResamplerQuality > 10) {
+ TSK_DEBUG_WARN("%d is invalid value for quality", nResamplerQuality);
+ }
+ m_Resampler.pResampler = new AudioResampler(nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
+ if(!m_Resampler.pResampler) {
+ TSK_DEBUG_ERROR("Failed to create new 'AudioResampler' object");
+ return false;
+ }
+ bool bOK = m_Resampler.pResampler->isValid();
+ if(!bOK) {
+ goto bail;
+ }
+ m_Resampler.nInBufferSizeInByte = m_Resampler.pResampler->getInputRequiredSizeInShort() * 2;
+ m_Resampler.pInBufferPtr = tsk_calloc(m_Resampler.nInBufferSizeInByte, 1);
+ bOK = (m_Resampler.pInBufferPtr != tsk_null);
bail:
- if(!bOK){
- if(m_Resampler.pResampler){
- delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
- }
- TSK_FREE(m_Resampler.pInBufferPtr);
- m_Resampler.nInBufferSizeInByte = 0;
- }
- return bOK;
+ if(!bOK) {
+ if(m_Resampler.pResampler) {
+ delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
+ }
+ TSK_FREE(m_Resampler.pInBufferPtr);
+ m_Resampler.nInBufferSizeInByte = 0;
+ }
+ return bOK;
}
bool ProxyAudioConsumer::setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize)
{
- m_PullBuffer.pPullBufferPtr = pPullBufferPtr;
- m_PullBuffer.nPullBufferSize = nPullBufferSize;
- return true;
+ m_PullBuffer.pPullBufferPtr = pPullBufferPtr;
+ m_PullBuffer.nPullBufferSize = nPullBufferSize;
+ return true;
}
unsigned ProxyAudioConsumer::pull(void* _pOutput/*=tsk_null*/, unsigned _nSize/*=0*/)
{
- if((m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_ref(m_pWrappedPlugin))){
- void* pOutput;
- unsigned nSize;
- if(_pOutput && _nSize){
- pOutput = _pOutput, nSize = _nSize;
- }
- else{
- pOutput = (void*)m_PullBuffer.pPullBufferPtr, nSize = m_PullBuffer.nPullBufferSize;
- }
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ void* pOutput;
+ unsigned nSize;
+ if(_pOutput && _nSize) {
+ pOutput = _pOutput, nSize = _nSize;
+ }
+ else {
+ pOutput = (void*)m_PullBuffer.pPullBufferPtr, nSize = m_PullBuffer.nPullBufferSize;
+ }
- tsk_size_t nRetSize = 0;
+ tsk_size_t nRetSize = 0;
- if(m_Resampler.pResampler && m_Resampler.pInBufferPtr){
- nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), m_Resampler.pInBufferPtr, m_Resampler.nInBufferSizeInByte);
- if(nRetSize){
- nRetSize = m_Resampler.pResampler->process(m_Resampler.pInBufferPtr, nRetSize, pOutput, nSize);
- }
- }
- else{
- nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), pOutput, nSize);
- }
+ if(m_Resampler.pResampler && m_Resampler.pInBufferPtr) {
+ nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), m_Resampler.pInBufferPtr, m_Resampler.nInBufferSizeInByte);
+ if(nRetSize) {
+ nRetSize = m_Resampler.pResampler->process(m_Resampler.pInBufferPtr, nRetSize, pOutput, nSize);
+ }
+ }
+ else {
+ nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), pOutput, nSize);
+ }
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin));
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin));
- m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_unref(m_pWrappedPlugin);
- return nRetSize;
- }
- return 0;
+ m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_unref(m_pWrappedPlugin);
+ return nRetSize;
+ }
+ return 0;
}
bool ProxyAudioConsumer::setGain(unsigned nGain)
{
- if(m_pWrappedPlugin){
- // see also: MediaSessionMgr.consumerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ // see also: MediaSessionMgr.consumerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
+ return true;
+ }
+ return false;
}
unsigned ProxyAudioConsumer::getGain()
{
- if(m_pWrappedPlugin){
- return TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain;
- }
- return 0;
+ if(m_pWrappedPlugin) {
+ return TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain;
+ }
+ return 0;
}
bool ProxyAudioConsumer::reset()
{
- if(m_pWrappedPlugin){
- return (tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin)) == 0);
- }
- return false;
+ if(m_pWrappedPlugin) {
+ return (tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin)) == 0);
+ }
+ return false;
}
bool ProxyAudioConsumer::registerPlugin()
{
- /* HACK: Unregister all other audio plugins */
- tmedia_consumer_plugin_unregister_by_type(tmedia_audio);
- /* Register our proxy plugin */
- return (tmedia_consumer_plugin_register(twrap_consumer_proxy_audio_plugin_def_t) == 0);
+ /* HACK: Unregister all other audio plugins */
+ tmedia_consumer_plugin_unregister_by_type(tmedia_audio);
+ /* Register our proxy plugin */
+ return (tmedia_consumer_plugin_register(twrap_consumer_proxy_audio_plugin_def_t) == 0);
}
@@ -408,135 +405,134 @@ bool ProxyAudioConsumer::registerPlugin()
/* ============ Video Consumer Interface ================= */
-typedef struct twrap_consumer_proxy_video_s
-{
- TDAV_DECLARE_CONSUMER_VIDEO;
+typedef struct twrap_consumer_proxy_video_s {
+ TDAV_DECLARE_CONSUMER_VIDEO;
- uint64_t id;
- tsk_bool_t started;
- const ProxyVideoConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
+ uint64_t id;
+ tsk_bool_t started;
+ const ProxyVideoConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
}
twrap_consumer_proxy_video_t;
#define TWRAP_CONSUMER_PROXY_VIDEO(self) ((twrap_consumer_proxy_video_t*)(self))
int twrap_consumer_proxy_video_set(tmedia_consumer_t* self, const tmedia_param_t* params)
{
- return 0;
+ return 0;
}
int twrap_consumer_proxy_video_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- if((video->pcConsumer = manager->findVideoConsumer(video->id)) && video->pcConsumer->getCallback()){
- self->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- // in
- self->video.in.chroma = tmedia_chroma_yuv420p;
- self->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- self->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
- // display (out)
- self->video.display.chroma = video->pcConsumer->getChroma();
- self->video.display.auto_resize = video->pcConsumer->getAutoResizeDisplay();
- if(!self->video.display.width){
- self->video.display.width = self->video.in.width;
- }
- if(!self->video.display.height){
- self->video.display.height = self->video.in.height;
- }
- ret = video->pcConsumer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->in.fps);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ if((video->pcConsumer = manager->findVideoConsumer(video->id)) && video->pcConsumer->getCallback()) {
+ self->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ // in
+ self->video.in.chroma = tmedia_chroma_yuv420p;
+ self->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ self->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+ // display (out)
+ self->video.display.chroma = video->pcConsumer->getChroma();
+ self->video.display.auto_resize = video->pcConsumer->getAutoResizeDisplay();
+ if(!self->video.display.width) {
+ self->video.display.width = self->video.in.width;
+ }
+ if(!self->video.display.height) {
+ self->video.display.height = self->video.in.height;
+ }
+ ret = video->pcConsumer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->in.fps);
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_video_start(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->start();
- }
- }
-
- TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->start();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0);
+ return ret;
}
int twrap_consumer_proxy_video_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- if(!self || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
-
- if(!video->pcConsumer){
- ProxyPluginMgr* manager;
- if((manager = ProxyPluginMgr::getInstance())){
- video->pcConsumer = manager->findVideoConsumer(video->id);
- }
- }
-
- int ret = -1;
- ProxyVideoConsumerCallback* callback;
-
- if(video->pcConsumer && (callback = video->pcConsumer->getCallback())){
- if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(self))){
- ret = tdav_consumer_video_put(TDAV_CONSUMER_VIDEO(self), buffer, size, proto_hdr);
- }
- else{
- if(video->pcConsumer->hasConsumeBuffer()){
- unsigned nCopiedSize = video->pcConsumer->copyBuffer(buffer, size);
- ret = callback->bufferCopied(nCopiedSize, size);
- }
- else{
- ProxyVideoFrame* frame = new ProxyVideoFrame(buffer, size, const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedWidth(), const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedHeight(), proto_hdr);
- ret = callback->consume(frame);
- delete frame, frame = tsk_null;
- }
- }
- }
- else if(!video->pcConsumer){
- TSK_DEBUG_ERROR("Cannot find consumer with id=%lld", TWRAP_CONSUMER_PROXY_VIDEO(self)->id);
- }
-
-
- return ret;
+ if(!self || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
+
+ if(!video->pcConsumer) {
+ ProxyPluginMgr* manager;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ video->pcConsumer = manager->findVideoConsumer(video->id);
+ }
+ }
+
+ int ret = -1;
+ ProxyVideoConsumerCallback* callback;
+
+ if(video->pcConsumer && (callback = video->pcConsumer->getCallback())) {
+ if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(self))) {
+ ret = tdav_consumer_video_put(TDAV_CONSUMER_VIDEO(self), buffer, size, proto_hdr);
+ }
+ else {
+ if(video->pcConsumer->hasConsumeBuffer()) {
+ unsigned nCopiedSize = video->pcConsumer->copyBuffer(buffer, size);
+ ret = callback->bufferCopied(nCopiedSize, size);
+ }
+ else {
+ ProxyVideoFrame* frame = new ProxyVideoFrame(buffer, size, const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedWidth(), const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedHeight(), proto_hdr);
+ ret = callback->consume(frame);
+ delete frame, frame = tsk_null;
+ }
+ }
+ }
+ else if(!video->pcConsumer) {
+ TSK_DEBUG_ERROR("Cannot find consumer with id=%lld", TWRAP_CONSUMER_PROXY_VIDEO(self)->id);
+ }
+
+
+ return ret;
}
int twrap_consumer_proxy_video_pause(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_video_stop(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->stop();
- }
- }
-
- TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->stop();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -546,70 +542,68 @@ int twrap_consumer_proxy_video_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* twrap_consumer_proxy_video_ctor(tsk_object_t * self, va_list * app)
{
- twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
- if(consumer){
- /* init base */
- tdav_consumer_video_init(TDAV_CONSUMER_VIDEO(consumer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyConsumer = new ProxyVideoConsumer(ProxyVideoConsumer::getDefaultChroma(), consumer);
- uint64_t id = proxyConsumer->getId();
- manager->addPlugin(&proxyConsumer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_consumer);
- }
- }
- return self;
+ twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_video_init(TDAV_CONSUMER_VIDEO(consumer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyConsumer = new ProxyVideoConsumer(ProxyVideoConsumer::getDefaultChroma(), consumer);
+ uint64_t id = proxyConsumer->getId();
+ manager->addPlugin(&proxyConsumer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_consumer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_consumer_proxy_video_dtor(tsk_object_t * self)
-{
- twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
- if(consumer){
+{
+ twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
+ if(consumer) {
- /* stop */
- if(consumer->started){
- twrap_consumer_proxy_video_stop(TMEDIA_CONSUMER(consumer));
- }
+ /* stop */
+ if(consumer->started) {
+ twrap_consumer_proxy_video_stop(TMEDIA_CONSUMER(consumer));
+ }
- /* deinit base */
- tdav_consumer_video_deinit(TDAV_CONSUMER_VIDEO(consumer));
- /* deinit self */
+ /* deinit base */
+ tdav_consumer_video_deinit(TDAV_CONSUMER_VIDEO(consumer));
+ /* deinit self */
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_video_consumer);
- manager->removePlugin(consumer->id);
- }
- }
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_video_consumer);
+ manager->removePlugin(consumer->id);
+ }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_consumer_proxy_video_def_s =
-{
- sizeof(twrap_consumer_proxy_video_t),
- twrap_consumer_proxy_video_ctor,
- twrap_consumer_proxy_video_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_consumer_proxy_video_def_s = {
+ sizeof(twrap_consumer_proxy_video_t),
+ twrap_consumer_proxy_video_ctor,
+ twrap_consumer_proxy_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s =
-{
- &twrap_consumer_proxy_video_def_s,
-
- tmedia_video,
- "Video Proxy Consumer",
-
- twrap_consumer_proxy_video_set,
- twrap_consumer_proxy_video_prepare,
- twrap_consumer_proxy_video_start,
- twrap_consumer_proxy_video_consume,
- twrap_consumer_proxy_video_pause,
- twrap_consumer_proxy_video_stop
+static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s = {
+ &twrap_consumer_proxy_video_def_s,
+
+ tmedia_video,
+ "Video Proxy Consumer",
+
+ twrap_consumer_proxy_video_set,
+ twrap_consumer_proxy_video_prepare,
+ twrap_consumer_proxy_video_start,
+ twrap_consumer_proxy_video_consume,
+ twrap_consumer_proxy_video_pause,
+ twrap_consumer_proxy_video_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_consumer_plugin_def_t *twrap_consumer_proxy_video_plugin_def_t = &twrap_consumer_proxy_video_plugin_def_s;
@@ -621,15 +615,15 @@ tmedia_chroma_t ProxyVideoConsumer::s_eDefaultChroma = tmedia_chroma_rgb565le;
bool ProxyVideoConsumer::s_bAutoResizeDisplay = false;
ProxyVideoConsumer::ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer)
-: m_eChroma(eChroma),
-m_bAutoResizeDisplay(ProxyVideoConsumer::getDefaultAutoResizeDisplay()),
-m_pWrappedPlugin(pConsumer),
-m_pCallback(tsk_null),
-ProxyPlugin(twrap_proxy_plugin_video_consumer)
+ : m_eChroma(eChroma),
+ m_bAutoResizeDisplay(ProxyVideoConsumer::getDefaultAutoResizeDisplay()),
+ m_pWrappedPlugin(pConsumer),
+ m_pCallback(tsk_null),
+ ProxyPlugin(twrap_proxy_plugin_video_consumer)
{
- m_pWrappedPlugin->id = this->getId();
- m_ConsumeBuffer.pConsumeBufferPtr = tsk_null;
- m_ConsumeBuffer.nConsumeBufferSize = 0;
+ m_pWrappedPlugin->id = this->getId();
+ m_ConsumeBuffer.pConsumeBufferPtr = tsk_null;
+ m_ConsumeBuffer.nConsumeBufferSize = 0;
}
ProxyVideoConsumer::~ProxyVideoConsumer()
@@ -638,161 +632,162 @@ ProxyVideoConsumer::~ProxyVideoConsumer()
bool ProxyVideoConsumer::setDisplaySize(unsigned nWidth, unsigned nHeight)
{
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width = nWidth;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height = nHeight;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- return true;
- }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return false;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width = nWidth;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height = nHeight;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ return true;
+ }
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return false;
}
unsigned ProxyVideoConsumer::getDisplayWidth()
{
- unsigned displayWidth = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- displayWidth = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return displayWidth;
+ unsigned displayWidth = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ displayWidth = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return displayWidth;
}
unsigned ProxyVideoConsumer::getDisplayHeight()
{
- unsigned displayHeight = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- displayHeight = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return displayHeight;
+ unsigned displayHeight = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ displayHeight = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return displayHeight;
}
unsigned ProxyVideoConsumer::getDecodedWidth()
{
- unsigned width = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- width = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.width;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return width;
+ unsigned width = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ width = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.width;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return width;
}
unsigned ProxyVideoConsumer::getDecodedHeight()
{
- unsigned height = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- height = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.height;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return height;
+ unsigned height = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ height = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.height;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return height;
}
tmedia_chroma_t ProxyVideoConsumer::getChroma()const
{
- return m_eChroma;
+ return m_eChroma;
}
-bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay){
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.auto_resize = bAutoResizeDisplay ? tsk_true : tsk_false;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- m_bAutoResizeDisplay = bAutoResizeDisplay;
- return true;
- }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return false;
+bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay)
+{
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.auto_resize = bAutoResizeDisplay ? tsk_true : tsk_false;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ m_bAutoResizeDisplay = bAutoResizeDisplay;
+ return true;
+ }
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return false;
}
bool ProxyVideoConsumer::getAutoResizeDisplay()const
{
- return m_bAutoResizeDisplay;
+ return m_bAutoResizeDisplay;
}
bool ProxyVideoConsumer::setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize)
{
- m_ConsumeBuffer.pConsumeBufferPtr = pConsumeBufferPtr;
- m_ConsumeBuffer.nConsumeBufferSize = nConsumeBufferSize;
- return true;
+ m_ConsumeBuffer.pConsumeBufferPtr = pConsumeBufferPtr;
+ m_ConsumeBuffer.nConsumeBufferSize = nConsumeBufferSize;
+ return true;
}
unsigned ProxyVideoConsumer::copyBuffer(const void* pBuffer, unsigned nSize)const
{
- unsigned nRetsize = 0;
- if(pBuffer && nSize && m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize){
- nRetsize = (nSize > m_ConsumeBuffer.nConsumeBufferSize) ? m_ConsumeBuffer.nConsumeBufferSize : nSize;
- memcpy((void*)m_ConsumeBuffer.pConsumeBufferPtr, pBuffer, nRetsize);
- }
- return nRetsize;
+ unsigned nRetsize = 0;
+ if(pBuffer && nSize && m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize) {
+ nRetsize = (nSize > m_ConsumeBuffer.nConsumeBufferSize) ? m_ConsumeBuffer.nConsumeBufferSize : nSize;
+ memcpy((void*)m_ConsumeBuffer.pConsumeBufferPtr, pBuffer, nRetsize);
+ }
+ return nRetsize;
}
unsigned ProxyVideoConsumer::pull(void* pOutput, unsigned nSize)
{
- if(pOutput && nSize && (m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- tsk_size_t nRetSize = 0;
+ if(pOutput && nSize && (m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ tsk_size_t nRetSize = 0;
+
+ if(!tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))) {
+ TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer.\n\nTo pull a buffer you must register a callback ('class ProxyVideoConsumerCallback') and listen for either 'consume' or 'bufferCopied' functions");
+ goto done;
+ }
- if(!tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))){
- TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer.\n\nTo pull a buffer you must register a callback ('class ProxyVideoConsumerCallback') and listen for either 'consume' or 'bufferCopied' functions");
- goto done;
- }
-
- nRetSize = tdav_consumer_video_get(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin), pOutput, nSize);
+ nRetSize = tdav_consumer_video_get(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin), pOutput, nSize);
- tdav_consumer_video_tick(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin));
+ tdav_consumer_video_tick(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin));
done:
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- return nRetSize;
- }
- return 0;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ return nRetSize;
+ }
+ return 0;
}
bool ProxyVideoConsumer::reset()
{
- bool ret = false;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))){
- ret = (tdav_consumer_video_reset(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin)) == 0);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer");
- }
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
+ bool ret = false;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))) {
+ ret = (tdav_consumer_video_reset(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin)) == 0);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer");
+ }
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return ret;
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return ret;
}
bool ProxyVideoConsumer::registerPlugin()
{
- /* HACK: Unregister all other video plugins */
- tmedia_consumer_plugin_unregister_by_type(tmedia_video);
- /* Register our proxy plugin */
- return (tmedia_consumer_plugin_register(twrap_consumer_proxy_video_plugin_def_t) == 0);
+ /* HACK: Unregister all other video plugins */
+ tmedia_consumer_plugin_unregister_by_type(tmedia_video);
+ /* Register our proxy plugin */
+ return (tmedia_consumer_plugin_register(twrap_consumer_proxy_video_plugin_def_t) == 0);
}
ProxyVideoFrame::ProxyVideoFrame(const void* pBufferPtr, unsigned nSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr)
{
- m_pBufferPtr = pBufferPtr;
- m_nBufferSize = nSize;
- m_nFrameWidth = nFrameWidth;
- m_nFrameHeight = nFrameHeight;
- m_pProtoHdr = pProtoHdr;
+ m_pBufferPtr = pBufferPtr;
+ m_nBufferSize = nSize;
+ m_nFrameWidth = nFrameWidth;
+ m_nFrameHeight = nFrameHeight;
+ m_pProtoHdr = pProtoHdr;
}
ProxyVideoFrame::~ProxyVideoFrame()
@@ -801,15 +796,15 @@ ProxyVideoFrame::~ProxyVideoFrame()
unsigned ProxyVideoFrame::getSize()
{
- return m_nBufferSize;
+ return m_nBufferSize;
}
unsigned ProxyVideoFrame::getContent(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
- if(pOutput && nMaxsize && m_pBufferPtr){
- nRetsize = (m_nBufferSize > nMaxsize) ? nMaxsize : m_nBufferSize;
- memcpy(pOutput, m_pBufferPtr, nRetsize);
- }
- return nRetsize;
+ unsigned nRetsize = 0;
+ if(pOutput && nMaxsize && m_pBufferPtr) {
+ nRetsize = (m_nBufferSize > nMaxsize) ? nMaxsize : m_nBufferSize;
+ memcpy(pOutput, m_pBufferPtr, nRetsize);
+ }
+ return nRetsize;
}
diff --git a/bindings/_common/ProxyConsumer.h b/bindings/_common/ProxyConsumer.h
index 138d3e5..76258b6 100755
--- a/bindings/_common/ProxyConsumer.h
+++ b/bindings/_common/ProxyConsumer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,20 +41,34 @@ class AudioResampler;
class ProxyAudioConsumerCallback
{
public:
- ProxyAudioConsumerCallback() { }
- virtual ~ProxyAudioConsumerCallback(){ }
+ ProxyAudioConsumerCallback() { }
+ virtual ~ProxyAudioConsumerCallback() { }
- virtual int prepare(int ptime, int rate, int channels) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ virtual int prepare(int ptime, int rate, int channels) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
#if !defined(SWIG)
- // whether the audio buffer have to be stored in the JB then pulled using "ProxyAudioConsumer::pull()" or not
- virtual bool putInJitterBuffer(){ return true; }
- // whether we are using the "telepresence" system (PIVOT audio settings must not be changed)
- virtual bool isPivotSettings() { return false; }
- // only called if "putInJitterBuffer()" return "true"
- virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr){ return -1; }
+ // whether the audio buffer have to be stored in the JB then pulled using "ProxyAudioConsumer::pull()" or not
+ virtual bool putInJitterBuffer() {
+ return true;
+ }
+ // whether we are using the "telepresence" system (PIVOT audio settings must not be changed)
+ virtual bool isPivotSettings() {
+ return false;
+ }
+ // only called if "putInJitterBuffer()" return "true"
+ virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr) {
+ return -1;
+ }
#endif
};
@@ -63,43 +77,47 @@ class ProxyAudioConsumer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyAudioConsumer(struct twrap_consumer_proxy_audio_s* pConsumer);
+ ProxyAudioConsumer(struct twrap_consumer_proxy_audio_s* pConsumer);
#endif
- virtual ~ProxyAudioConsumer();
- bool setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels);
- bool queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality);
- bool setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize);
- unsigned pull(void* pOutput=tsk_null, unsigned nSize=0);
- bool setGain(unsigned nGain);
- unsigned getGain();
- bool reset();
- void setCallback(ProxyAudioConsumerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyAudioConsumer();
+ bool setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels);
+ bool queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality);
+ bool setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize);
+ unsigned pull(void* pOutput=tsk_null, unsigned nSize=0);
+ bool setGain(unsigned nGain);
+ unsigned getGain();
+ bool reset();
+ void setCallback(ProxyAudioConsumerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- inline ProxyAudioConsumerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin){
- return m_pWrappedPlugin == pWrappedPlugin;
- }
+ inline ProxyAudioConsumerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
+ return m_pWrappedPlugin == pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
+ static bool registerPlugin();
private:
- struct twrap_consumer_proxy_audio_s* m_pWrappedPlugin;
- ProxyAudioConsumerCallback* m_pCallback;
- struct{
- const void* pPullBufferPtr;
- unsigned nPullBufferSize;
- } m_PullBuffer;
-
- struct{
- void* pInBufferPtr;
- unsigned nInBufferSizeInByte;
- AudioResampler* pResampler;
- } m_Resampler;
+ struct twrap_consumer_proxy_audio_s* m_pWrappedPlugin;
+ ProxyAudioConsumerCallback* m_pCallback;
+ struct {
+ const void* pPullBufferPtr;
+ unsigned nPullBufferSize;
+ } m_PullBuffer;
+
+ struct {
+ void* pInBufferPtr;
+ unsigned nInBufferSizeInByte;
+ AudioResampler* pResampler;
+ } m_Resampler;
};
class ProxyVideoFrame;
@@ -108,16 +126,28 @@ class ProxyVideoFrame;
class ProxyVideoConsumerCallback
{
public:
- ProxyVideoConsumerCallback(){}
- virtual ~ProxyVideoConsumerCallback() {}
-
- virtual int prepare(int nWidth, int nHeight, int nFps) { return -1; }
- virtual int consume(const ProxyVideoFrame* frame) { return -1; }
- // only called if a buffer is registered using setPullBuffer(). Otherwise, consume() will be called
- virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ ProxyVideoConsumerCallback() {}
+ virtual ~ProxyVideoConsumerCallback() {}
+
+ virtual int prepare(int nWidth, int nHeight, int nFps) {
+ return -1;
+ }
+ virtual int consume(const ProxyVideoFrame* frame) {
+ return -1;
+ }
+ // only called if a buffer is registered using setPullBuffer(). Otherwise, consume() will be called
+ virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
};
/* ============ ProxyVideoConsumer Class ================= */
@@ -125,58 +155,72 @@ class ProxyVideoConsumer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer);
+ ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer);
#endif
- virtual ~ProxyVideoConsumer();
+ virtual ~ProxyVideoConsumer();
- bool setDisplaySize(unsigned nWidth, unsigned nHeight);
- unsigned getDisplayWidth();
- unsigned getDisplayHeight();
+ bool setDisplaySize(unsigned nWidth, unsigned nHeight);
+ unsigned getDisplayWidth();
+ unsigned getDisplayHeight();
unsigned getDecodedWidth();
- unsigned getDecodedHeight();
-
- void setCallback(ProxyVideoConsumerCallback* pCallback) { m_pCallback = pCallback; }
- bool setAutoResizeDisplay(bool bAutoResizeDisplay);
- bool getAutoResizeDisplay()const;
- bool setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize);
- unsigned pull(void* pOutput, unsigned nSize);
- bool reset();
-
+ unsigned getDecodedHeight();
+
+ void setCallback(ProxyVideoConsumerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
+ bool setAutoResizeDisplay(bool bAutoResizeDisplay);
+ bool getAutoResizeDisplay()const;
+ bool setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize);
+ unsigned pull(void* pOutput, unsigned nSize);
+ bool reset();
+
#if !defined(SWIG)
- bool hasConsumeBuffer()const { return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize; }
- unsigned copyBuffer(const void* pBuffer, unsigned nSize)const;
- inline ProxyVideoConsumerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin){
- return m_pWrappedPlugin == wrapped_plugin;
- }
+ bool hasConsumeBuffer()const {
+ return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize;
+ }
+ unsigned copyBuffer(const void* pBuffer, unsigned nSize)const;
+ inline ProxyVideoConsumerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
+ return m_pWrappedPlugin == wrapped_plugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
- static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
- static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay){ s_bAutoResizeDisplay = bAutoResizeDisplay;}
+ static bool registerPlugin();
+ static void setDefaultChroma(tmedia_chroma_t eChroma) {
+ s_eDefaultChroma = eChroma;
+ }
+ static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay) {
+ s_bAutoResizeDisplay = bAutoResizeDisplay;
+ }
#if !defined(SWIG)
- tmedia_chroma_t getChroma()const;
- static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
- static bool getDefaultAutoResizeDisplay() { return s_bAutoResizeDisplay; }
+ tmedia_chroma_t getChroma()const;
+ static tmedia_chroma_t getDefaultChroma() {
+ return s_eDefaultChroma;
+ }
+ static bool getDefaultAutoResizeDisplay() {
+ return s_bAutoResizeDisplay;
+ }
#endif
private:
- struct twrap_consumer_proxy_video_s* m_pWrappedPlugin;
- tmedia_chroma_t m_eChroma;
- ProxyVideoConsumerCallback* m_pCallback;
- struct{
- const void* pConsumeBufferPtr;
- unsigned nConsumeBufferSize;
- } m_ConsumeBuffer;
- bool m_bAutoResizeDisplay;
-
- static tmedia_chroma_t s_eDefaultChroma;
- static bool s_bAutoResizeDisplay;
+ struct twrap_consumer_proxy_video_s* m_pWrappedPlugin;
+ tmedia_chroma_t m_eChroma;
+ ProxyVideoConsumerCallback* m_pCallback;
+ struct {
+ const void* pConsumeBufferPtr;
+ unsigned nConsumeBufferSize;
+ } m_ConsumeBuffer;
+ bool m_bAutoResizeDisplay;
+
+ static tmedia_chroma_t s_eDefaultChroma;
+ static bool s_bAutoResizeDisplay;
};
/* ============ ProxyVideoFrame Class ================= */
@@ -184,27 +228,37 @@ class ProxyVideoFrame
{
public:
#if !defined(SWIG)
- ProxyVideoFrame(const void* pBufferPtr, unsigned nBufferSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr);
+ ProxyVideoFrame(const void* pBufferPtr, unsigned nBufferSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr);
#endif
- virtual ~ProxyVideoFrame();
+ virtual ~ProxyVideoFrame();
public: /* For Java/C# applications */
- unsigned getSize();
- unsigned getContent(void* pOutput, unsigned nMaxsize);
- inline unsigned getFrameWidth()const{ return m_nFrameWidth; }
- inline unsigned getFrameHeight()const{ return m_nFrameHeight; }
+ unsigned getSize();
+ unsigned getContent(void* pOutput, unsigned nMaxsize);
+ inline unsigned getFrameWidth()const {
+ return m_nFrameWidth;
+ }
+ inline unsigned getFrameHeight()const {
+ return m_nFrameHeight;
+ }
#if !defined(SWIG) /* For C/C++ applications */
public:
- inline unsigned getBufferSize()const{ return m_nBufferSize; }
- inline const void* getBufferPtr()const{ return m_pBufferPtr; }
- inline const tsk_object_t* getProtoHdr()const{ return m_pProtoHdr; }
+ inline unsigned getBufferSize()const {
+ return m_nBufferSize;
+ }
+ inline const void* getBufferPtr()const {
+ return m_pBufferPtr;
+ }
+ inline const tsk_object_t* getProtoHdr()const {
+ return m_pProtoHdr;
+ }
#endif
private:
- const void* m_pBufferPtr;
- unsigned m_nBufferSize, m_nFrameWidth, m_nFrameHeight;
- const tsk_object_t* m_pProtoHdr;
+ const void* m_pBufferPtr;
+ unsigned m_nBufferSize, m_nFrameWidth, m_nFrameHeight;
+ const tsk_object_t* m_pProtoHdr;
};
diff --git a/bindings/_common/ProxyPluginMgr.cxx b/bindings/_common/ProxyPluginMgr.cxx
index fd6e026..2191b98 100755
--- a/bindings/_common/ProxyPluginMgr.cxx
+++ b/bindings/_common/ProxyPluginMgr.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,10 +27,9 @@
//
// "twrap_proxy_plugin_t" Declarations
//
-typedef struct twrap_proxy_plugin_s
-{
- TSK_DECLARE_OBJECT;
- ProxyPlugin* plugin;
+typedef struct twrap_proxy_plugin_s {
+ TSK_DECLARE_OBJECT;
+ ProxyPlugin* plugin;
}
twrap_proxy_plugin_t;
#define TWRAP_PROXY_PLUGIN(self) ((twrap_proxy_plugin_t*)(self))
@@ -45,191 +44,191 @@ ProxyPluginMgr* ProxyPluginMgr::instance = tsk_null;
static uint64_t __uniqueId = 0;
ProxyPluginMgr::ProxyPluginMgr(ProxyPluginMgrCallback* _callback)
-:callback(_callback)
+ :callback(_callback)
{
- this->plugins = tsk_list_create();
- if(!this->callback){
- TSK_DEBUG_WARN("Callback function is Null => You will have big problems as we won't check it before call");
- }
+ this->plugins = tsk_list_create();
+ if(!this->callback) {
+ TSK_DEBUG_WARN("Callback function is Null => You will have big problems as we won't check it before call");
+ }
}
ProxyPluginMgr::~ProxyPluginMgr()
{
- if(this == ProxyPluginMgr::instance){
- ProxyPluginMgr::instance = tsk_null;
- }
- TSK_OBJECT_SAFE_FREE(this->plugins);
+ if(this == ProxyPluginMgr::instance) {
+ ProxyPluginMgr::instance = tsk_null;
+ }
+ TSK_OBJECT_SAFE_FREE(this->plugins);
}
ProxyPluginMgr* ProxyPluginMgr::createInstance(ProxyPluginMgrCallback* pCallback)
{
- if(!ProxyPluginMgr::instance){
- ProxyPluginMgr::instance = new ProxyPluginMgr(pCallback);
- }
- else{
- TSK_DEBUG_WARN("Plugin instance already exist");
- ProxyPluginMgr::instance->callback = pCallback;
- }
- return ProxyPluginMgr::instance;
+ if(!ProxyPluginMgr::instance) {
+ ProxyPluginMgr::instance = new ProxyPluginMgr(pCallback);
+ }
+ else {
+ TSK_DEBUG_WARN("Plugin instance already exist");
+ ProxyPluginMgr::instance->callback = pCallback;
+ }
+ return ProxyPluginMgr::instance;
}
void ProxyPluginMgr::destroyInstance(ProxyPluginMgr** ppInstance)
{
- if(ppInstance && *ppInstance){
- bool bMatch = ProxyPluginMgr::instance && (*ppInstance == ProxyPluginMgr::instance);
- delete *ppInstance, *ppInstance = tsk_null;
- if(bMatch){
- ProxyPluginMgr::instance = tsk_null;
- }
- }
+ if(ppInstance && *ppInstance) {
+ bool bMatch = ProxyPluginMgr::instance && (*ppInstance == ProxyPluginMgr::instance);
+ delete *ppInstance, *ppInstance = tsk_null;
+ if(bMatch) {
+ ProxyPluginMgr::instance = tsk_null;
+ }
+ }
}
ProxyPluginMgr* ProxyPluginMgr::getInstance()
{
- if(!ProxyPluginMgr::instance){
- TSK_DEBUG_ERROR("No instance of the manager could be found");
- }
- return ProxyPluginMgr::instance;
+ if(!ProxyPluginMgr::instance) {
+ TSK_DEBUG_ERROR("No instance of the manager could be found");
+ }
+ return ProxyPluginMgr::instance;
}
uint64_t ProxyPluginMgr::getUniqueId()
{
- return ++__uniqueId;
+ return ++__uniqueId;
}
int ProxyPluginMgr::addPlugin(ProxyPlugin** plugin)
{
- twrap_proxy_plugin_t* twrap_plugin;
- int ret = -1;
-
- tsk_list_lock(this->plugins);
-
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if(tsk_list_find_item_by_pred(this->plugins, pred_find_plugin_by_value, *plugin)){
- TSK_DEBUG_ERROR("Plugin already exist");
- goto bail;
- }
-
- if((twrap_plugin = twrap_proxy_plugin_create(plugin))){
- tsk_list_push_back_data(this->plugins, (void**)&twrap_plugin);
- ret = 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create plugin");
- goto bail;
- }
+ twrap_proxy_plugin_t* twrap_plugin;
+ int ret = -1;
+
+ tsk_list_lock(this->plugins);
+
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if(tsk_list_find_item_by_pred(this->plugins, pred_find_plugin_by_value, *plugin)) {
+ TSK_DEBUG_ERROR("Plugin already exist");
+ goto bail;
+ }
+
+ if((twrap_plugin = twrap_proxy_plugin_create(plugin))) {
+ tsk_list_push_back_data(this->plugins, (void**)&twrap_plugin);
+ ret = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create plugin");
+ goto bail;
+ }
bail:
- tsk_list_unlock(this->plugins);
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
int ProxyPluginMgr::removePlugin(ProxyPlugin** plugin)
{
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return this->removePlugin((*plugin)->getId());
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return this->removePlugin((*plugin)->getId());
}
const ProxyPlugin* ProxyPluginMgr::findPlugin(uint64_t id)
{
- ProxyPlugin* ret = tsk_null;
+ ProxyPlugin* ret = tsk_null;
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id){
- ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
- break;
- }
- }
- tsk_list_unlock(this->plugins);
+ tsk_list_lock(this->plugins);
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id) {
+ ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
+ break;
+ }
+ }
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
const ProxyPlugin* ProxyPluginMgr::findPlugin(tsk_object_t* wrapped_plugin)
{
- ProxyPlugin* ret = tsk_null;
+ ProxyPlugin* ret = tsk_null;
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- if(!wrapped_plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(!wrapped_plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->isWrapping(wrapped_plugin)){
- ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
- break;
- }
- }
- tsk_list_unlock(this->plugins);
+ tsk_list_lock(this->plugins);
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->isWrapping(wrapped_plugin)) {
+ ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
+ break;
+ }
+ }
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
int ProxyPluginMgr::removePlugin(uint64_t id)
{
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- tsk_list_lock(this->plugins);
+ tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id){
- tsk_list_remove_item(this->plugins, item);
- break;
- }
- }
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id) {
+ tsk_list_remove_item(this->plugins, item);
+ break;
+ }
+ }
- tsk_list_unlock(this->plugins);
- return 0;
+ tsk_list_unlock(this->plugins);
+ return 0;
}
const ProxyAudioConsumer* ProxyPluginMgr::findAudioConsumer(uint64_t id)
{
- const ProxyPlugin* audioConsumer = this->findPlugin(id);
- if(audioConsumer && audioConsumer->getType() == twrap_proxy_plugin_audio_consumer){
- return dyn_cast<const ProxyAudioConsumer*>(audioConsumer);
- }
- return tsk_null;
+ const ProxyPlugin* audioConsumer = this->findPlugin(id);
+ if(audioConsumer && audioConsumer->getType() == twrap_proxy_plugin_audio_consumer) {
+ return dyn_cast<const ProxyAudioConsumer*>(audioConsumer);
+ }
+ return tsk_null;
}
const ProxyVideoConsumer* ProxyPluginMgr::findVideoConsumer(uint64_t id)
{
- const ProxyPlugin* videoConsumer = this->findPlugin(id);
- if(videoConsumer && videoConsumer->getType() == twrap_proxy_plugin_video_consumer){
- return dyn_cast<const ProxyVideoConsumer*>(videoConsumer);
- }
- return tsk_null;
+ const ProxyPlugin* videoConsumer = this->findPlugin(id);
+ if(videoConsumer && videoConsumer->getType() == twrap_proxy_plugin_video_consumer) {
+ return dyn_cast<const ProxyVideoConsumer*>(videoConsumer);
+ }
+ return tsk_null;
}
const ProxyAudioProducer* ProxyPluginMgr::findAudioProducer(uint64_t id)
{
- const ProxyPlugin* audioProducer = this->findPlugin(id);
- if(audioProducer && audioProducer->getType() == twrap_proxy_plugin_audio_producer){
- return dyn_cast<const ProxyAudioProducer*>(audioProducer);
- }
- return tsk_null;
+ const ProxyPlugin* audioProducer = this->findPlugin(id);
+ if(audioProducer && audioProducer->getType() == twrap_proxy_plugin_audio_producer) {
+ return dyn_cast<const ProxyAudioProducer*>(audioProducer);
+ }
+ return tsk_null;
}
const ProxyVideoProducer* ProxyPluginMgr::findVideoProducer(uint64_t id)
{
- const ProxyPlugin* videoProducer = this->findPlugin(id);
- if(videoProducer && videoProducer->getType() == twrap_proxy_plugin_video_producer){
- return dyn_cast<const ProxyVideoProducer*>(videoProducer);
- }
- return tsk_null;
+ const ProxyPlugin* videoProducer = this->findPlugin(id);
+ if(videoProducer && videoProducer->getType() == twrap_proxy_plugin_video_producer) {
+ return dyn_cast<const ProxyVideoProducer*>(videoProducer);
+ }
+ return tsk_null;
}
@@ -238,69 +237,72 @@ const ProxyVideoProducer* ProxyPluginMgr::findVideoProducer(uint64_t id)
//
static tsk_object_t* twrap_proxy_plugin_ctor(tsk_object_t * self, va_list * app)
{
- twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
- if(_self){
- }
- return self;
+ twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
+ if(_self) {
+ }
+ return self;
}
static tsk_object_t* twrap_proxy_plugin_dtor(tsk_object_t * self)
-{
- twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
- if(_self){
- if(_self->plugin){
- delete _self->plugin, _self->plugin = tsk_null;
- }
- }
-
- return self;
+{
+ twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
+ if(_self) {
+ if(_self->plugin) {
+ delete _self->plugin, _self->plugin = tsk_null;
+ }
+ }
+
+ return self;
}
static int twrap_proxy_plugin_cmp(const tsk_object_t *_c1, const tsk_object_t *_c2)
{
- const twrap_proxy_plugin_t *c1 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c1));
- const twrap_proxy_plugin_t *c2 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c2));
-
- if(c1 && c2){
- return (c1->plugin == c2->plugin); // See "ProxyPlugin::operator =="
- }
- else if(!c1 && !c2) return 0;
- else return -1;
+ const twrap_proxy_plugin_t *c1 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c1));
+ const twrap_proxy_plugin_t *c2 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c2));
+
+ if(c1 && c2) {
+ return (c1->plugin == c2->plugin); // See "ProxyPlugin::operator =="
+ }
+ else if(!c1 && !c2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t twrap_proxy_plugin_def_s =
-{
- sizeof(twrap_proxy_plugin_t),
- twrap_proxy_plugin_ctor,
- twrap_proxy_plugin_dtor,
- twrap_proxy_plugin_cmp,
+static const tsk_object_def_t twrap_proxy_plugin_def_s = {
+ sizeof(twrap_proxy_plugin_t),
+ twrap_proxy_plugin_ctor,
+ twrap_proxy_plugin_dtor,
+ twrap_proxy_plugin_cmp,
};
const tsk_object_def_t *twrap_proxy_plugin_def_t = &twrap_proxy_plugin_def_s;
static int pred_find_plugin_by_value(const tsk_list_item_t *item, const void *proxyPlugin)
{
- if(item && item->data){
- const twrap_proxy_plugin_t *twrap_plugin = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(item->data));
- return (twrap_plugin->plugin == dyn_cast<const ProxyPlugin *>((const ProxyPlugin*)proxyPlugin)) ? 0 : -1;
- }
- return -1;
+ if(item && item->data) {
+ const twrap_proxy_plugin_t *twrap_plugin = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(item->data));
+ return (twrap_plugin->plugin == dyn_cast<const ProxyPlugin *>((const ProxyPlugin*)proxyPlugin)) ? 0 : -1;
+ }
+ return -1;
}
static twrap_proxy_plugin_t* twrap_proxy_plugin_create(ProxyPlugin** plugin)
{
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- twrap_proxy_plugin_t* twrap_plugin = (twrap_proxy_plugin_t*)tsk_object_new(twrap_proxy_plugin_def_t);
- if(!twrap_plugin){
- TSK_DEBUG_ERROR("Failed to create new instance of 'twrap_proxy_plugin_t'");
- return tsk_null;
- }
-
- twrap_plugin->plugin = *plugin,
- *plugin = tsk_null;
- return twrap_plugin;
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ twrap_proxy_plugin_t* twrap_plugin = (twrap_proxy_plugin_t*)tsk_object_new(twrap_proxy_plugin_def_t);
+ if(!twrap_plugin) {
+ TSK_DEBUG_ERROR("Failed to create new instance of 'twrap_proxy_plugin_t'");
+ return tsk_null;
+ }
+
+ twrap_plugin->plugin = *plugin,
+ *plugin = tsk_null;
+ return twrap_plugin;
}
diff --git a/bindings/_common/ProxyPluginMgr.h b/bindings/_common/ProxyPluginMgr.h
index 9644093..1bfd117 100755
--- a/bindings/_common/ProxyPluginMgr.h
+++ b/bindings/_common/ProxyPluginMgr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,12 +33,11 @@ class ProxyAudioProducer;
class ProxyVideoProducer;
class ProxyPluginMgrCallback;
-typedef enum twrap_proxy_plugin_type_e
-{
- twrap_proxy_plugin_audio_producer,
- twrap_proxy_plugin_video_producer,
- twrap_proxy_plugin_audio_consumer,
- twrap_proxy_plugin_video_consumer,
+typedef enum twrap_proxy_plugin_type_e {
+ twrap_proxy_plugin_audio_producer,
+ twrap_proxy_plugin_video_producer,
+ twrap_proxy_plugin_audio_consumer,
+ twrap_proxy_plugin_video_consumer,
}
twrap_proxy_plugin_type_t;
@@ -49,40 +48,42 @@ typedef tsk_list_t twrap_proxy_plungins_L_t; // contains "twrap_proxy_plungin_t"
class ProxyPluginMgr
{
private:
- ProxyPluginMgr(ProxyPluginMgrCallback* callback);
+ ProxyPluginMgr(ProxyPluginMgrCallback* callback);
public:
- virtual ~ProxyPluginMgr();
+ virtual ~ProxyPluginMgr();
- // SWIG %newobject
- static ProxyPluginMgr* createInstance(ProxyPluginMgrCallback* pCallback);
+ // SWIG %newobject
+ static ProxyPluginMgr* createInstance(ProxyPluginMgrCallback* pCallback);
#if !defined(SWIG)
- static void destroyInstance(ProxyPluginMgr** ppInstance);
+ static void destroyInstance(ProxyPluginMgr** ppInstance);
#endif
- static ProxyPluginMgr* getInstance();
+ static ProxyPluginMgr* getInstance();
#if !defined(SWIG)
- static uint64_t getUniqueId();
+ static uint64_t getUniqueId();
- int addPlugin(ProxyPlugin**);
- const ProxyPlugin* findPlugin(tsk_object_t* wrapped_plugin);
- int removePlugin(uint64_t id);
- int removePlugin(ProxyPlugin**);
+ int addPlugin(ProxyPlugin**);
+ const ProxyPlugin* findPlugin(tsk_object_t* wrapped_plugin);
+ int removePlugin(uint64_t id);
+ int removePlugin(ProxyPlugin**);
- inline ProxyPluginMgrCallback* getCallback(){ return this->callback; }
+ inline ProxyPluginMgrCallback* getCallback() {
+ return this->callback;
+ }
#endif
- const ProxyPlugin* findPlugin(uint64_t id);
+ const ProxyPlugin* findPlugin(uint64_t id);
- const ProxyAudioConsumer* findAudioConsumer(uint64_t id);
- const ProxyVideoConsumer* findVideoConsumer(uint64_t id);
- const ProxyAudioProducer* findAudioProducer(uint64_t id);
- const ProxyVideoProducer* findVideoProducer(uint64_t id);
+ const ProxyAudioConsumer* findAudioConsumer(uint64_t id);
+ const ProxyVideoConsumer* findVideoConsumer(uint64_t id);
+ const ProxyAudioProducer* findAudioProducer(uint64_t id);
+ const ProxyVideoProducer* findVideoProducer(uint64_t id);
private:
- static ProxyPluginMgr* instance;
- ProxyPluginMgrCallback* callback;
+ static ProxyPluginMgr* instance;
+ ProxyPluginMgrCallback* callback;
- twrap_proxy_plungins_L_t* plugins;
+ twrap_proxy_plungins_L_t* plugins;
};
@@ -90,11 +91,15 @@ private:
class ProxyPluginMgrCallback
{
public:
- ProxyPluginMgrCallback() { }
- virtual ~ProxyPluginMgrCallback() { }
-
- virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
- virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
+ ProxyPluginMgrCallback() { }
+ virtual ~ProxyPluginMgrCallback() { }
+
+ virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) {
+ return -1;
+ }
+ virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) {
+ return -1;
+ }
};
/* ============ ProxyPlugin Class ================= */
@@ -102,27 +107,31 @@ class ProxyPlugin
{
public:
#if !defined SWIG
- ProxyPlugin(twrap_proxy_plugin_type_t _type) {
- this->type=_type;
- this->id = ProxyPluginMgr::getUniqueId();
- }
+ ProxyPlugin(twrap_proxy_plugin_type_t _type) {
+ this->type=_type;
+ this->id = ProxyPluginMgr::getUniqueId();
+ }
#endif
- virtual ~ProxyPlugin() {}
-
+ virtual ~ProxyPlugin() {}
+
#if !defined(SWIG)
- virtual bool operator ==(const ProxyPlugin &plugin)const{
- return this->getId() == plugin.getId();
- }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) = 0;
- virtual inline uint64_t getMediaSessionId() = 0;
+ virtual bool operator ==(const ProxyPlugin &plugin)const {
+ return this->getId() == plugin.getId();
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) = 0;
+ virtual inline uint64_t getMediaSessionId() = 0;
#endif
- inline twrap_proxy_plugin_type_t getType()const{ return this->type; }
- inline uint64_t getId()const{ return this->id; }
+ inline twrap_proxy_plugin_type_t getType()const {
+ return this->type;
+ }
+ inline uint64_t getId()const {
+ return this->id;
+ }
protected:
- uint64_t id;
- twrap_proxy_plugin_type_t type;
+ uint64_t id;
+ twrap_proxy_plugin_type_t type;
};
#endif /* TINYWRAP_PROXY_PLUGIN_MGR_H */
diff --git a/bindings/_common/ProxyProducer.cxx b/bindings/_common/ProxyProducer.cxx
index 2cdb952..087a2d2 100755
--- a/bindings/_common/ProxyProducer.cxx
+++ b/bindings/_common/ProxyProducer.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,83 +37,82 @@
/* ============ Audio Media Producer Interface ================= */
-typedef struct twrap_producer_proxy_audio_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- uint64_t id;
- tsk_bool_t started;
+typedef struct twrap_producer_proxy_audio_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ uint64_t id;
+ tsk_bool_t started;
}
twrap_producer_proxy_audio_t;
#define TWRAP_PRODUCER_PROXY_AUDIO(self) ((twrap_producer_proxy_audio_t*)(self))
static int twrap_producer_proxy_audio_set(tmedia_producer_t* _self, const tmedia_param_t* param)
{
- twrap_producer_proxy_audio_t* self = (twrap_producer_proxy_audio_t*)_self;
- if(param->plugin_type == tmedia_ppt_producer){
- // specific proxy producer
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ twrap_producer_proxy_audio_t* self = (twrap_producer_proxy_audio_t*)_self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ // specific proxy producer
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int twrap_producer_proxy_audio_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- self->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- self->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- ret = audioProducer->getCallback()->prepare((int)self->audio.ptime, self->audio.rate, self->audio.channels);
- }
- }
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ self->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ self->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ ret = audioProducer->getCallback()->prepare((int)self->audio.ptime, self->audio.rate, self->audio.channels);
+ }
+ }
+ return ret;
}
static int twrap_producer_proxy_audio_start(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- const_cast<ProxyAudioProducer*>(audioProducer)->startPushCallback();
- ret = audioProducer->getCallback()->start();
- }
- }
-
- TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ const_cast<ProxyAudioProducer*>(audioProducer)->startPushCallback();
+ ret = audioProducer->getCallback()->start();
+ }
+ }
+
+ TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0);
+ return ret;
}
static int twrap_producer_proxy_audio_pause(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- ret = audioProducer->getCallback()->pause();
- }
- }
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ ret = audioProducer->getCallback()->pause();
+ }
+ }
+ return ret;
}
static int twrap_producer_proxy_audio_stop(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- const_cast<ProxyAudioProducer*>(audioProducer)->stopPushCallback();
- ret = audioProducer->getCallback()->stop();
- }
- }
- TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ const_cast<ProxyAudioProducer*>(audioProducer)->stopPushCallback();
+ ret = audioProducer->getCallback()->stop();
+ }
+ }
+ TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -123,69 +122,67 @@ static int twrap_producer_proxy_audio_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* twrap_producer_proxy_audio_ctor(tsk_object_t * self, va_list * app)
{
- twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
- if(producer){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyProducer = new ProxyAudioProducer(producer);
- uint64_t id = proxyProducer->getId();
- manager->addPlugin(&proxyProducer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_producer);
- }
- }
- return self;
+ twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
+ if(producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyProducer = new ProxyAudioProducer(producer);
+ uint64_t id = proxyProducer->getId();
+ manager->addPlugin(&proxyProducer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_producer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_producer_proxy_audio_dtor(tsk_object_t * self)
-{
- twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
- if(producer){
-
- /* stop */
- if(producer->started){
- twrap_producer_proxy_audio_stop(TMEDIA_PRODUCER(producer));
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
- /* deinit self */
-
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_audio_producer);
- manager->removePlugin(producer->id);
- }
- }
-
- return self;
+{
+ twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
+ if(producer) {
+
+ /* stop */
+ if(producer->started) {
+ twrap_producer_proxy_audio_stop(TMEDIA_PRODUCER(producer));
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
+ /* deinit self */
+
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_audio_producer);
+ manager->removePlugin(producer->id);
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_producer_proxy_audio_def_s =
-{
- sizeof(twrap_producer_proxy_audio_t),
- twrap_producer_proxy_audio_ctor,
- twrap_producer_proxy_audio_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t twrap_producer_proxy_audio_def_s = {
+ sizeof(twrap_producer_proxy_audio_t),
+ twrap_producer_proxy_audio_ctor,
+ twrap_producer_proxy_audio_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s =
-{
- &twrap_producer_proxy_audio_def_s,
-
- tmedia_audio,
- "Audio Proxy Producer",
-
- twrap_producer_proxy_audio_set,
- twrap_producer_proxy_audio_prepare,
- twrap_producer_proxy_audio_start,
- twrap_producer_proxy_audio_pause,
- twrap_producer_proxy_audio_stop
+static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s = {
+ &twrap_producer_proxy_audio_def_s,
+
+ tmedia_audio,
+ "Audio Proxy Producer",
+
+ twrap_producer_proxy_audio_set,
+ twrap_producer_proxy_audio_prepare,
+ twrap_producer_proxy_audio_start,
+ twrap_producer_proxy_audio_pause,
+ twrap_producer_proxy_audio_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_producer_plugin_def_t *twrap_producer_proxy_audio_plugin_def_t = &twrap_producer_proxy_audio_plugin_def_s;
@@ -194,141 +191,141 @@ static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_
/* ============ ProxyAudioProducer Class ================= */
ProxyAudioProducer::ProxyAudioProducer(twrap_producer_proxy_audio_t* pProducer)
-:m_pCallback(tsk_null), m_pWrappedPlugin(pProducer), m_bUsePushCallback(false), m_hPushTimerMgr(tsk_null), ProxyPlugin(twrap_proxy_plugin_audio_producer)
+ :m_pCallback(tsk_null), m_pWrappedPlugin(pProducer), m_bUsePushCallback(false), m_hPushTimerMgr(tsk_null), ProxyPlugin(twrap_proxy_plugin_audio_producer)
{
- m_pWrappedPlugin->id = this->getId();
- m_PushBuffer.pPushBufferPtr = tsk_null;
- m_PushBuffer.nPushBufferSize = 0;
+ m_pWrappedPlugin->id = this->getId();
+ m_PushBuffer.pPushBufferPtr = tsk_null;
+ m_PushBuffer.nPushBufferSize = 0;
}
ProxyAudioProducer::~ProxyAudioProducer()
{
- stopPushCallback();
+ stopPushCallback();
}
// Use this function to request resampling when your sound card can't honor negotaited record parameters
bool ProxyAudioProducer::setActualSndCardRecordParams(int nPtime, int nRate, int nChannels)
{
- if(m_pWrappedPlugin){
- TSK_DEBUG_INFO("setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime = nPtime;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.rate = nRate;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.channels = nChannels;
- return true;
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- return false;
- }
+ if(m_pWrappedPlugin) {
+ TSK_DEBUG_INFO("setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime = nPtime;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.rate = nRate;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.channels = nChannels;
+ return true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ return false;
+ }
}
bool ProxyAudioProducer::setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback/*=false*/)
{
- m_PushBuffer.pPushBufferPtr = pPushBufferPtr;
- m_PushBuffer.nPushBufferSize = nPushBufferSize;
- m_bUsePushCallback = bUsePushCallback;
+ m_PushBuffer.pPushBufferPtr = pPushBufferPtr;
+ m_PushBuffer.nPushBufferSize = nPushBufferSize;
+ m_bUsePushCallback = bUsePushCallback;
- if(!pPushBufferPtr || !nPushBufferSize || !bUsePushCallback){
- return stopPushCallback();
- }
- else if(m_bUsePushCallback && m_pWrappedPlugin && m_pWrappedPlugin->started){
- return startPushCallback();
- }
- return true;
+ if(!pPushBufferPtr || !nPushBufferSize || !bUsePushCallback) {
+ return stopPushCallback();
+ }
+ else if(m_bUsePushCallback && m_pWrappedPlugin && m_pWrappedPlugin->started) {
+ return startPushCallback();
+ }
+ return true;
}
int ProxyAudioProducer::push(const void* _pBuffer/*=tsk_null*/, unsigned _nSize/*=0*/)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback){
- const void* pBuffer;
- unsigned nSize;
- if(_pBuffer && _nSize){
- pBuffer = _pBuffer, nSize = _nSize;
- }
- else{
- pBuffer = m_PushBuffer.pPushBufferPtr, nSize = m_PushBuffer.nPushBufferSize;
- }
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
- }
- return 0;
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
+ const void* pBuffer;
+ unsigned nSize;
+ if(_pBuffer && _nSize) {
+ pBuffer = _pBuffer, nSize = _nSize;
+ }
+ else {
+ pBuffer = m_PushBuffer.pPushBufferPtr, nSize = m_PushBuffer.nPushBufferSize;
+ }
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
+ }
+ return 0;
}
bool ProxyAudioProducer::setGain(unsigned nGain)
{
- if(m_pWrappedPlugin){
- // see also: MediaSessionMgr.producerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ // see also: MediaSessionMgr.producerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
+ return true;
+ }
+ return false;
}
unsigned ProxyAudioProducer::getGain()
{
- if(m_pWrappedPlugin){
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain;
- }
- return 0;
+ if(m_pWrappedPlugin) {
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain;
+ }
+ return 0;
}
bool ProxyAudioProducer::startPushCallback()
{
- if(!m_bUsePushCallback){
- return true;
- }
-
- if(!m_pWrappedPlugin){
- TSK_DEBUG_ERROR("Not wrapping plugin");
- return false;
- }
-
- if(!m_hPushTimerMgr){
- if(!(m_hPushTimerMgr = tsk_timer_manager_create())){
- TSK_DEBUG_ERROR("Failed to create timer manager");
- return false;
- }
- }
-
- if(!TSK_RUNNABLE(m_hPushTimerMgr)->started){
- if((tsk_timer_manager_start(m_hPushTimerMgr)) == 0){
- m_uPushTimer = tsk_timer_manager_schedule(m_hPushTimerMgr, TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, this);
- }
- else{
- TSK_DEBUG_ERROR("Failed to start timer");
- return false;
- }
- }
- return true;
+ if(!m_bUsePushCallback) {
+ return true;
+ }
+
+ if(!m_pWrappedPlugin) {
+ TSK_DEBUG_ERROR("Not wrapping plugin");
+ return false;
+ }
+
+ if(!m_hPushTimerMgr) {
+ if(!(m_hPushTimerMgr = tsk_timer_manager_create())) {
+ TSK_DEBUG_ERROR("Failed to create timer manager");
+ return false;
+ }
+ }
+
+ if(!TSK_RUNNABLE(m_hPushTimerMgr)->started) {
+ if((tsk_timer_manager_start(m_hPushTimerMgr)) == 0) {
+ m_uPushTimer = tsk_timer_manager_schedule(m_hPushTimerMgr, TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, this);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to start timer");
+ return false;
+ }
+ }
+ return true;
}
bool ProxyAudioProducer::stopPushCallback()
{
- if(m_hPushTimerMgr){
- tsk_timer_manager_destroy(&m_hPushTimerMgr);
- }
- return true;
+ if(m_hPushTimerMgr) {
+ tsk_timer_manager_destroy(&m_hPushTimerMgr);
+ }
+ return true;
}
int ProxyAudioProducer::pushTimerCallback(const void* arg, tsk_timer_id_t timer_id)
{
- ProxyAudioProducer* This = (ProxyAudioProducer*)arg;
+ ProxyAudioProducer* This = (ProxyAudioProducer*)arg;
- This->m_uPushTimer = tsk_timer_manager_schedule(This->m_hPushTimerMgr, TMEDIA_PRODUCER(This->m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, This);
+ This->m_uPushTimer = tsk_timer_manager_schedule(This->m_hPushTimerMgr, TMEDIA_PRODUCER(This->m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, This);
- if(This->m_pCallback){
- if(This->m_pCallback->fillPushBuffer() == 0){
- return This->push();
- }
- }
- return 0;
+ if(This->m_pCallback) {
+ if(This->m_pCallback->fillPushBuffer() == 0) {
+ return This->push();
+ }
+ }
+ return 0;
}
bool ProxyAudioProducer::registerPlugin()
{
- /* HACK: Unregister all other audio plugins */
- tmedia_producer_plugin_unregister_by_type(tmedia_audio);
- /* Register our proxy plugin */
- return (tmedia_producer_plugin_register(twrap_producer_proxy_audio_plugin_def_t) == 0);
+ /* HACK: Unregister all other audio plugins */
+ tmedia_producer_plugin_unregister_by_type(tmedia_audio);
+ /* Register our proxy plugin */
+ return (tmedia_producer_plugin_register(twrap_producer_proxy_audio_plugin_def_t) == 0);
}
@@ -354,18 +351,17 @@ bool ProxyAudioProducer::registerPlugin()
/* ============ Video Media Producer Interface ================= */
-typedef struct twrap_producer_proxy_video_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct twrap_producer_proxy_video_s {
+ TMEDIA_DECLARE_PRODUCER;
- int rotation;
- uint64_t id;
- tsk_bool_t started;
+ int rotation;
+ uint64_t id;
+ tsk_bool_t started;
#if 0
- // https://code.google.com/p/doubango/issues/detail?id=416
- // The lock on the producer is useless because all tinyDAV proxied functions (push(), stop(), prepare()...) are already thread safe.
- // Locking the push method while tinDAV locks the stop() function produce a deadlock on Android devices with slow video producer implementations (e.g. Hovis Box v1)
- TSK_DECLARE_SAFEOBJ;
+ // https://code.google.com/p/doubango/issues/detail?id=416
+ // The lock on the producer is useless because all tinyDAV proxied functions (push(), stop(), prepare()...) are already thread safe.
+ // Locking the push method while tinDAV locks the stop() function produce a deadlock on Android devices with slow video producer implementations (e.g. Hovis Box v1)
+ TSK_DECLARE_SAFEOBJ;
#endif
}
twrap_producer_proxy_video_t;
@@ -373,67 +369,67 @@ twrap_producer_proxy_video_t;
int twrap_producer_proxy_video_set(tmedia_producer_t* self, const tmedia_param_t* params)
{
- return 0;
+ return 0;
}
int twrap_producer_proxy_video_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- self->video.chroma = videoProducer->getChroma();
- self->video.rotation = videoProducer->getRotation();
- ret = videoProducer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height, TMEDIA_CODEC_VIDEO(codec)->out.fps);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ self->video.chroma = videoProducer->getChroma();
+ self->video.rotation = videoProducer->getRotation();
+ ret = videoProducer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height, TMEDIA_CODEC_VIDEO(codec)->out.fps);
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_start(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->start();
- TWRAP_PRODUCER_PROXY_VIDEO(self)->started = (ret == 0);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->start();
+ TWRAP_PRODUCER_PROXY_VIDEO(self)->started = (ret == 0);
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_pause(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_stop(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->stop();
- TWRAP_PRODUCER_PROXY_VIDEO(self)->started = ((ret == 0) ? tsk_false : tsk_true);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->stop();
+ TWRAP_PRODUCER_PROXY_VIDEO(self)->started = ((ret == 0) ? tsk_false : tsk_true);
+ }
+ }
+
+ return ret;
}
@@ -443,69 +439,67 @@ int twrap_producer_proxy_video_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* twrap_producer_proxy_video_ctor(tsk_object_t * self, va_list * app)
{
- twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
- if(producer){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(producer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyProducer = new ProxyVideoProducer(ProxyVideoProducer::getDefaultChroma(), producer);
- uint64_t id = proxyProducer->getId();
- manager->addPlugin(&proxyProducer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_producer);
- }
- }
- return self;
+ twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
+ if(producer) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(producer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyProducer = new ProxyVideoProducer(ProxyVideoProducer::getDefaultChroma(), producer);
+ uint64_t id = proxyProducer->getId();
+ manager->addPlugin(&proxyProducer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_producer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_producer_proxy_video_dtor(tsk_object_t * self)
-{
- twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
- if(producer){
- TSK_DEBUG_INFO("twrap_producer_proxy_video_dtor()");
- /* stop */
- if(producer->started){
- twrap_producer_proxy_video_stop(TMEDIA_PRODUCER(producer));
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
- /* deinit self */
-
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_video_producer);
- manager->removePlugin(producer->id);
- }
- }
-
- return self;
+{
+ twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
+ if(producer) {
+ TSK_DEBUG_INFO("twrap_producer_proxy_video_dtor()");
+ /* stop */
+ if(producer->started) {
+ twrap_producer_proxy_video_stop(TMEDIA_PRODUCER(producer));
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
+ /* deinit self */
+
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_video_producer);
+ manager->removePlugin(producer->id);
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_producer_proxy_video_def_s =
-{
- sizeof(twrap_producer_proxy_video_t),
- twrap_producer_proxy_video_ctor,
- twrap_producer_proxy_video_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_producer_proxy_video_def_s = {
+ sizeof(twrap_producer_proxy_video_t),
+ twrap_producer_proxy_video_ctor,
+ twrap_producer_proxy_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s =
-{
- &twrap_producer_proxy_video_def_s,
-
- tmedia_video,
- "Video Proxy Producer",
-
- twrap_producer_proxy_video_set,
- twrap_producer_proxy_video_prepare,
- twrap_producer_proxy_video_start,
- twrap_producer_proxy_video_pause,
- twrap_producer_proxy_video_stop
+static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s = {
+ &twrap_producer_proxy_video_def_s,
+
+ tmedia_video,
+ "Video Proxy Producer",
+
+ twrap_producer_proxy_video_set,
+ twrap_producer_proxy_video_prepare,
+ twrap_producer_proxy_video_start,
+ twrap_producer_proxy_video_pause,
+ twrap_producer_proxy_video_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_producer_plugin_def_t *twrap_producer_proxy_video_plugin_def_t = &twrap_producer_proxy_video_plugin_def_s;
@@ -516,111 +510,111 @@ static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_
tmedia_chroma_t ProxyVideoProducer::s_eDefaultChroma = tmedia_chroma_nv21;
ProxyVideoProducer::ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer)
-:m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_bMirror(false), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
+ :m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_bMirror(false), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
{
- if(m_pWrappedPlugin){
- m_pWrappedPlugin->id = this->getId();
- }
+ if(m_pWrappedPlugin) {
+ m_pWrappedPlugin->id = this->getId();
+ }
}
ProxyVideoProducer::~ProxyVideoProducer()
{
- TSK_DEBUG_INFO("~ProxyVideoProducer");
+ TSK_DEBUG_INFO("~ProxyVideoProducer");
}
int ProxyVideoProducer::getRotation()const
{
- return m_nRotation;
+ return m_nRotation;
}
bool ProxyVideoProducer::setRotation(int nRot)
{
- m_nRotation = nRot;
- if (m_pWrappedPlugin) {
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.rotation = m_nRotation;
- return true;
- }
- return false;
+ m_nRotation = nRot;
+ if (m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.rotation = m_nRotation;
+ return true;
+ }
+ return false;
}
bool ProxyVideoProducer::getMirror()const
{
- return m_bMirror;
+ return m_bMirror;
}
bool ProxyVideoProducer::setMirror(bool bMirror)
{
- m_bMirror = bMirror;
- if (m_pWrappedPlugin) {
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.mirror = m_bMirror ? tsk_true : tsk_false;
- return true;
- }
- return false;
+ m_bMirror = bMirror;
+ if (m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.mirror = m_bMirror ? tsk_true : tsk_false;
+ return true;
+ }
+ return false;
}
// alert the encoder which size your camera is using because it's very hard to retrieve it from send(buffer, size) function
// this function is only needed if the actual size (output from your camera) is different than the negociated one
bool ProxyVideoProducer::setActualCameraOutputSize(unsigned nWidth, unsigned nHeight)
{
- if(m_pWrappedPlugin){
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.width = nWidth;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.height = nHeight;
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.width = nWidth;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.height = nHeight;
+ return true;
+ }
+ return false;
}
// encode() then send()
int ProxyVideoProducer::push(const void* pBuffer, unsigned nSize)
{
- if (m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
- int ret = -1;
- if (m_pWrappedPlugin->started) {
- ret = TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
- }
- return ret;
- }
- return 0;
+ if (m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
+ int ret = -1;
+ if (m_pWrappedPlugin->started) {
+ ret = TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
+ }
+ return ret;
+ }
+ return 0;
}
// send() "as is"
// only used by telepresence system with a H.264 SVC hardaware encoder
int ProxyVideoProducer::sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback){
- //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback) {
+ //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.duration = nDuration;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.last_chunck = (bMarker == true);
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- }
- return 0;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.duration = nDuration;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.last_chunck = (bMarker == true);
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ }
+ return 0;
}
int ProxyVideoProducer::sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback){
- //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback) {
+ //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.proto_hdr = proto_hdr;
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- }
- return 0;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.proto_hdr = proto_hdr;
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ }
+ return 0;
}
tmedia_chroma_t ProxyVideoProducer::getChroma()const
{
- return m_eChroma;
+ return m_eChroma;
}
bool ProxyVideoProducer::registerPlugin()
{
- /* HACK: Unregister all other video plugins */
- tmedia_producer_plugin_unregister_by_type(tmedia_video);
- /* Register our proxy plugin */
- return (tmedia_producer_plugin_register(twrap_producer_proxy_video_plugin_def_t) == 0);
+ /* HACK: Unregister all other video plugins */
+ tmedia_producer_plugin_unregister_by_type(tmedia_video);
+ /* Register our proxy plugin */
+ return (tmedia_producer_plugin_register(twrap_producer_proxy_video_plugin_def_t) == 0);
}
diff --git a/bindings/_common/ProxyProducer.h b/bindings/_common/ProxyProducer.h
index 83ed673..4a4ea66 100755
--- a/bindings/_common/ProxyProducer.h
+++ b/bindings/_common/ProxyProducer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,15 +41,25 @@
class ProxyAudioProducerCallback
{
public:
- ProxyAudioProducerCallback() { }
- virtual ~ProxyAudioProducerCallback(){ }
-
- virtual int prepare(int ptime, int rate, int channels) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
- // this function is called to signal that it's time to copy push data
- virtual int fillPushBuffer(){ return -1; }
+ ProxyAudioProducerCallback() { }
+ virtual ~ProxyAudioProducerCallback() { }
+
+ virtual int prepare(int ptime, int rate, int channels) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
+ // this function is called to signal that it's time to copy push data
+ virtual int fillPushBuffer() {
+ return -1;
+ }
};
@@ -58,61 +68,75 @@ class ProxyAudioProducer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyAudioProducer(struct twrap_producer_proxy_audio_s* pProducer);
+ ProxyAudioProducer(struct twrap_producer_proxy_audio_s* pProducer);
#endif
- virtual ~ProxyAudioProducer();
-
- bool setActualSndCardRecordParams(int nPtime, int nRate, int nChannels);
- bool setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback=false);
- int push(const void* pBuffer=tsk_null, unsigned nSize=0);
- bool setGain(unsigned nGain);
- unsigned getGain();
- void setCallback(ProxyAudioProducerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyAudioProducer();
+
+ bool setActualSndCardRecordParams(int nPtime, int nRate, int nChannels);
+ bool setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback=false);
+ int push(const void* pBuffer=tsk_null, unsigned nSize=0);
+ bool setGain(unsigned nGain);
+ unsigned getGain();
+ void setCallback(ProxyAudioProducerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- inline bool usePushCallback(){ return m_bUsePushCallback; }
- inline ProxyAudioProducerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin){
- return m_pWrappedPlugin == pWrappedPlugin;
- }
+ inline bool usePushCallback() {
+ return m_bUsePushCallback;
+ }
+ inline ProxyAudioProducerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
+ return m_pWrappedPlugin == pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
+ }
#if !defined(SWIG)
public:
- bool startPushCallback();
- bool stopPushCallback();
+ bool startPushCallback();
+ bool stopPushCallback();
private:
- static int pushTimerCallback(const void* arg, tsk_timer_id_t timer_id);
+ static int pushTimerCallback(const void* arg, tsk_timer_id_t timer_id);
#endif
public:
- static bool registerPlugin();
+ static bool registerPlugin();
private:
- struct twrap_producer_proxy_audio_s* m_pWrappedPlugin;
- ProxyAudioProducerCallback* m_pCallback;
- struct{
- const void* pPushBufferPtr;
- unsigned nPushBufferSize;
- } m_PushBuffer;
- bool m_bUsePushCallback;
- void* m_hPushTimerMgr;
- uint64_t m_uPushTimer;
+ struct twrap_producer_proxy_audio_s* m_pWrappedPlugin;
+ ProxyAudioProducerCallback* m_pCallback;
+ struct {
+ const void* pPushBufferPtr;
+ unsigned nPushBufferSize;
+ } m_PushBuffer;
+ bool m_bUsePushCallback;
+ void* m_hPushTimerMgr;
+ uint64_t m_uPushTimer;
};
/* ============ ProxyVideoProducerCallback Class ================= */
class ProxyVideoProducerCallback
{
public:
- ProxyVideoProducerCallback() { }
- virtual ~ProxyVideoProducerCallback(){ }
-
- virtual int prepare(int width, int height, int fps) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ ProxyVideoProducerCallback() { }
+ virtual ~ProxyVideoProducerCallback() { }
+
+ virtual int prepare(int width, int height, int fps) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
};
/* ============ ProxyVideoProducer Class ================= */
@@ -120,49 +144,57 @@ class ProxyVideoProducer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer);
+ ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer);
#endif
- virtual ~ProxyVideoProducer();
-
- int getRotation()const;
- bool setRotation(int nRot);
- bool getMirror()const;
- bool setMirror(bool bMirror);
- bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
- int push(const void* pBuffer, unsigned nSize);
- void setCallback(ProxyVideoProducerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyVideoProducer();
+
+ int getRotation()const;
+ bool setRotation(int nRot);
+ bool getMirror()const;
+ bool setMirror(bool bMirror);
+ bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
+ int push(const void* pBuffer, unsigned nSize);
+ void setCallback(ProxyVideoProducerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- int sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker);
- int sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr);
- inline ProxyVideoProducerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin){
- return m_pWrappedPlugin == wrapped_plugin;
- }
- virtual inline const tmedia_producer_t* getWrappedPlugin()const{
- return (tmedia_producer_t*)m_pWrappedPlugin;
- }
+ int sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker);
+ int sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr);
+ inline ProxyVideoProducerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
+ return m_pWrappedPlugin == wrapped_plugin;
+ }
+ virtual inline const tmedia_producer_t* getWrappedPlugin()const {
+ return (tmedia_producer_t*)m_pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
- static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
+ static bool registerPlugin();
+ static void setDefaultChroma(tmedia_chroma_t eChroma) {
+ s_eDefaultChroma = eChroma;
+ }
#if !defined(SWIG)
- tmedia_chroma_t getChroma()const;
- static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
+ tmedia_chroma_t getChroma()const;
+ static tmedia_chroma_t getDefaultChroma() {
+ return s_eDefaultChroma;
+ }
#endif
private:
- struct twrap_producer_proxy_video_s* m_pWrappedPlugin;
- ProxyVideoProducerCallback* m_pCallback;
- tmedia_chroma_t m_eChroma;
- int m_nRotation;
- bool m_bMirror;
+ struct twrap_producer_proxy_video_s* m_pWrappedPlugin;
+ ProxyVideoProducerCallback* m_pCallback;
+ tmedia_chroma_t m_eChroma;
+ int m_nRotation;
+ bool m_bMirror;
- static tmedia_chroma_t s_eDefaultChroma;
+ static tmedia_chroma_t s_eDefaultChroma;
};
#endif /* TINYWRAP_PRODUCER_PROXY_H */
diff --git a/bindings/_common/SMSEncoder.cxx b/bindings/_common/SMSEncoder.cxx
index 7fc24cd..d07ab2b 100755
--- a/bindings/_common/SMSEncoder.cxx
+++ b/bindings/_common/SMSEncoder.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,351 +26,346 @@
RPMessage::RPMessage(twrap_rpmessage_type_t _type, tsms_rpdu_message_t* _rp_message)
{
- this->rp_message = (tsms_rpdu_message_t*)tsk_object_ref(_rp_message);
- this->type = _type;
- this->tmpBuffer = tsk_null;
+ this->rp_message = (tsms_rpdu_message_t*)tsk_object_ref(_rp_message);
+ this->type = _type;
+ this->tmpBuffer = tsk_null;
}
-RPMessage::RPMessage() :
- rp_message(tsk_null),
- type(twrap_rpmessage_type_sms_none),
- tmpBuffer(tsk_null)
+RPMessage::RPMessage() :
+ rp_message(tsk_null),
+ type(twrap_rpmessage_type_sms_none),
+ tmpBuffer(tsk_null)
{
}
twrap_rpmessage_type_t RPMessage::getType()
{
- return this->type;
+ return this->type;
}
unsigned RPMessage::getPayloadLength()
{
- if(!this->tmpBuffer){
- if((this->tmpBuffer = tsk_buffer_create_null())){
- tsms_rpdu_data_serialize(this->rp_message, this->tmpBuffer);
- }
- }
- return this->tmpBuffer ? this->tmpBuffer->size : 0;
+ if(!this->tmpBuffer) {
+ if((this->tmpBuffer = tsk_buffer_create_null())) {
+ tsms_rpdu_data_serialize(this->rp_message, this->tmpBuffer);
+ }
+ }
+ return this->tmpBuffer ? this->tmpBuffer->size : 0;
}
unsigned RPMessage::getPayload(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
-
- if(!this->tmpBuffer){
- if((this->tmpBuffer = tsk_buffer_create_null())){
- tsms_rpdu_message_serialize(this->rp_message, this->tmpBuffer);
- }
- }
-
- if(output && maxsize && this->tmpBuffer && this->tmpBuffer->data){
- retsize = (this->tmpBuffer->size > maxsize) ? maxsize : this->tmpBuffer->size;
- memcpy(output, this->tmpBuffer->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+
+ if(!this->tmpBuffer) {
+ if((this->tmpBuffer = tsk_buffer_create_null())) {
+ tsms_rpdu_message_serialize(this->rp_message, this->tmpBuffer);
+ }
+ }
+
+ if(output && maxsize && this->tmpBuffer && this->tmpBuffer->data) {
+ retsize = (this->tmpBuffer->size > maxsize) ? maxsize : this->tmpBuffer->size;
+ memcpy(output, this->tmpBuffer->data, retsize);
+ }
+ return retsize;
}
RPMessage::~RPMessage()
{
- TSK_OBJECT_SAFE_FREE(this->rp_message);
- TSK_OBJECT_SAFE_FREE(this->tmpBuffer);
+ TSK_OBJECT_SAFE_FREE(this->rp_message);
+ TSK_OBJECT_SAFE_FREE(this->tmpBuffer);
}
SMSData::SMSData(twrap_sms_type_t _type, int _mr, const void* _ascii, tsk_size_t _size): oa(tsk_null), da(tsk_null)
{
- this->type = _type;
- this->mr = _mr;
- if((this->size = _size)){
- if((this->ascii = tsk_calloc(size+1, 1))){
- memcpy(this->ascii, _ascii, _size);
- }
- }
- else{
- this->ascii = tsk_null;
- }
+ this->type = _type;
+ this->mr = _mr;
+ if((this->size = _size)) {
+ if((this->ascii = tsk_calloc(size+1, 1))) {
+ memcpy(this->ascii, _ascii, _size);
+ }
+ }
+ else {
+ this->ascii = tsk_null;
+ }
}
SMSData::SMSData(): oa(tsk_null), da(tsk_null)
{
- this->type = twrap_sms_type_none;
- this->mr = 0;
- this->size = 0;
- this->ascii = tsk_null;
+ this->type = twrap_sms_type_none;
+ this->mr = 0;
+ this->size = 0;
+ this->ascii = tsk_null;
}
SMSData::~SMSData()
{
- TSK_FREE(this->ascii);
- TSK_FREE(this->oa);
- TSK_FREE(this->da);
+ TSK_FREE(this->ascii);
+ TSK_FREE(this->oa);
+ TSK_FREE(this->da);
}
twrap_sms_type_t SMSData::getType()
{
- return this->type;
+ return this->type;
}
int SMSData::getMR()
{
- return this->mr;
+ return this->mr;
}
unsigned SMSData::getPayloadLength()
{
- return this->size;
+ return this->size;
}
unsigned SMSData::getPayload(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
-
- if(output && maxsize && this->ascii){
- retsize = (this->size > maxsize) ? maxsize : this->size;
- memcpy(output, this->ascii, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+
+ if(output && maxsize && this->ascii) {
+ retsize = (this->size > maxsize) ? maxsize : this->size;
+ memcpy(output, this->ascii, retsize);
+ }
+ return retsize;
}
const char* SMSData::getOA()
{
- return this->oa;
+ return this->oa;
}
const char* SMSData::getDA()
{
- return this->da;
+ return this->da;
}
void SMSData::setOA(const char* _oa)
{
- TSK_FREE(this->oa);
- this->oa = tsk_strdup(_oa);
+ TSK_FREE(this->oa);
+ this->oa = tsk_strdup(_oa);
}
void SMSData::setDA(const char* _da)
{
- TSK_FREE(this->da);
- this->da = tsk_strdup(_da);
+ TSK_FREE(this->da);
+ this->da = tsk_strdup(_da);
}
// More information about RP-DATA: http://www.doubango.org/API/tinySMS/group__tsms__rpdu__group.html#tsms_rpdu_group_DATA
RPMessage* SMSEncoder::encodeSubmit(int mr, const char *smsc, const char *destination, const char *ascii)
{
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_submit_t* sms_submit = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
-
- RPMessage* encodedData = tsk_null;
-
- if(!smsc || ! destination || !ascii){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(mr<0 || mr>0xFF){
- TSK_DEBUG_WARN("Invalid Message Reference");
- mr &= 0xFF;
- }
-
- // create SMS-SUBMIT message
- if(!(sms_submit = tsms_tpdu_submit_create(mr, (const uint8_t*)smsc, (const uint8_t*)destination))){
- TSK_DEBUG_ERROR("Failed to create the TPDU SMS-SUBMIT message");
- goto bail;
- }
- // Set content for SMS-SUBMIT
- if((buffer = tsms_pack_to_7bit(ascii))){
- ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- else{
- TSK_DEBUG_ERROR("Failed to encode the TPDU SMS-SUBMIT message");
- goto bail;
- }
-
- // create RP-DATA(SMS-SUBMIT)
- if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_submit)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_submit, TSMS_RPDU_MESSAGE(rp_data));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-SUBMIT) message");
- goto bail;
- }
-
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_submit_t* sms_submit = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+
+ RPMessage* encodedData = tsk_null;
+
+ if(!smsc || ! destination || !ascii) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(mr<0 || mr>0xFF) {
+ TSK_DEBUG_WARN("Invalid Message Reference");
+ mr &= 0xFF;
+ }
+
+ // create SMS-SUBMIT message
+ if(!(sms_submit = tsms_tpdu_submit_create(mr, (const uint8_t*)smsc, (const uint8_t*)destination))) {
+ TSK_DEBUG_ERROR("Failed to create the TPDU SMS-SUBMIT message");
+ goto bail;
+ }
+ // Set content for SMS-SUBMIT
+ if((buffer = tsms_pack_to_7bit(ascii))) {
+ ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to encode the TPDU SMS-SUBMIT message");
+ goto bail;
+ }
+
+ // create RP-DATA(SMS-SUBMIT)
+ if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_submit)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_submit, TSMS_RPDU_MESSAGE(rp_data));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-SUBMIT) message");
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_submit);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_submit);
+ TSK_OBJECT_SAFE_FREE(rp_data);
- return encodedData;
+ return encodedData;
}
// More information about RP-DATA: http://www.doubango.org/API/tinySMS/group__tsms__rpdu__group.html#tsms_rpdu_group_DATA
RPMessage* SMSEncoder::encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii)
{
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_deliver_t* sms_deliver = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
-
- RPMessage* encodedData = tsk_null;
-
- if(!smsc || ! originator || !ascii){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(mr<0 || mr>0xFF){
- TSK_DEBUG_WARN("Invalid Message Reference");
- mr &= 0xFF;
- }
-
- // create SMS-DELIVER message
- sms_deliver = tsms_tpdu_deliver_create((const uint8_t*)smsc, (const uint8_t*)originator);
- // Set content for SMS-DELIVER
- if((buffer = tsms_pack_to_7bit(ascii))){
- ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- // create RP-DATA message
- if((rp_data = tsms_rpdu_data_create_mt(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_deliver)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_deliver, TSMS_RPDU_MESSAGE(rp_data));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-DELIVER) message");
- goto bail;
- }
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_deliver_t* sms_deliver = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+
+ RPMessage* encodedData = tsk_null;
+
+ if(!smsc || ! originator || !ascii) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(mr<0 || mr>0xFF) {
+ TSK_DEBUG_WARN("Invalid Message Reference");
+ mr &= 0xFF;
+ }
+
+ // create SMS-DELIVER message
+ sms_deliver = tsms_tpdu_deliver_create((const uint8_t*)smsc, (const uint8_t*)originator);
+ // Set content for SMS-DELIVER
+ if((buffer = tsms_pack_to_7bit(ascii))) {
+ ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ // create RP-DATA message
+ if((rp_data = tsms_rpdu_data_create_mt(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_deliver)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_deliver, TSMS_RPDU_MESSAGE(rp_data));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-DELIVER) message");
+ goto bail;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_deliver);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_deliver);
+ TSK_OBJECT_SAFE_FREE(rp_data);
- return encodedData;
+ return encodedData;
}
RPMessage* SMSEncoder::encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT)
{
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_ack_t* rp_ack = tsk_null;
- tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
- tsk_bool_t isERROR = tsk_false;
-
- RPMessage* encodedData = tsk_null;
-
- // create SMS-DELIVER(or SUBMIT)-REPORT message
- sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
- // create RP-ACK message (From MS to SC)
- if((rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_ack, TSMS_RPDU_MESSAGE(rp_ack));
- }
-
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_ack);
-
- return encodedData;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_ack_t* rp_ack = tsk_null;
+ tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
+ tsk_bool_t isERROR = tsk_false;
+
+ RPMessage* encodedData = tsk_null;
+
+ // create SMS-DELIVER(or SUBMIT)-REPORT message
+ sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
+ // create RP-ACK message (From MS to SC)
+ if((rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_ack, TSMS_RPDU_MESSAGE(rp_ack));
+ }
+
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_ack);
+
+ return encodedData;
}
RPMessage* SMSEncoder::encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT)
{
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_error_t* rp_error= tsk_null;
- tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
- tsk_bool_t isERROR = tsk_true;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_error_t* rp_error= tsk_null;
+ tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
+ tsk_bool_t isERROR = tsk_true;
- RPMessage* encodedData = tsk_null;
+ RPMessage* encodedData = tsk_null;
- // create SMS-DELIVER-REPORT message
- sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
- // create RP-ERROR message
- if((rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_error, TSMS_RPDU_MESSAGE(rp_error));
- }
+ // create SMS-DELIVER-REPORT message
+ sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
+ // create RP-ERROR message
+ if((rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_error, TSMS_RPDU_MESSAGE(rp_error));
+ }
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_error);
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_error);
- return encodedData;
+ return encodedData;
}
SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
{
- tsms_rpdu_message_t* rp_message = tsk_null;
- tsms_tpdu_message_t* tpdu = tsk_null;
-
- SMSData* decodedData = tsk_null;
-
- if(!(rp_message = tsms_rpdu_message_deserialize(data, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
- goto bail;
- }
-
- switch(rp_message->mti){
- case tsms_rpdu_type_data_mo:
- case tsms_rpdu_type_data_mt:
- {
- char* ascii = tsk_null;
- tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
- if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))){
- if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo){ /* SMS-SUBMIT or SMS-DELIVER? */
- ascii = tsms_tpdu_message_get_payload(tpdu);
- decodedData = new SMSData(twrap_sms_type_rpdata, rp_message->mr, ascii, (tsk_size_t)tsk_strlen(ascii));
-
- if(tpdu->mti == tsms_tpdu_mti_deliver_mt){
- tsms_tpdu_deliver_t* tpdu_deliver = (tsms_tpdu_deliver_t*)tpdu;
- decodedData->setOA(tpdu_deliver->oa ? tpdu_deliver->oa->digits : tsk_null);
- }
- /* IMPORTANT: to not uncomment
- else if(TSK_OBJECT_DEF(tpdu) == tsms_tpdu_submit_def_t){
- tsms_tpdu_submit_t* tpdu_submit = (tsms_tpdu_submit_t*)tpdu;
- decodedData->setDA(tpdu_submit->da ? tpdu_submit->da->digits : tsk_null);
- }*/
- TSK_FREE(ascii);
- }
- }
- break;
- }
- case tsms_rpdu_type_ack_mo:
- case tsms_rpdu_type_ack_mt:
- {
- tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
- // ...do whatever you want
- if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))){
- // ...do whatever you want
- }
- decodedData = new SMSData(twrap_sms_type_ack, rp_message->mr, tsk_null, 0);
- break;
- }
- case tsms_rpdu_type_error_mo:
- case tsms_rpdu_type_error_mt:
- {
- tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
- // ...do whatever you want
- if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))){
- // ...do whatever you want
- }
- decodedData = new SMSData(twrap_sms_type_error, rp_message->mr, tsk_null, 0);
- break;
- }
- case tsms_rpdu_type_smma_mo:
- {
- // tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
- // ...do whatever you want
- decodedData = new SMSData(twrap_sms_type_smma, rp_message->mr, tsk_null, 0);
- break;
- }
- default:
- {
- TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
- break;
- }
- }
+ tsms_rpdu_message_t* rp_message = tsk_null;
+ tsms_tpdu_message_t* tpdu = tsk_null;
+
+ SMSData* decodedData = tsk_null;
+
+ if(!(rp_message = tsms_rpdu_message_deserialize(data, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
+ goto bail;
+ }
+
+ switch(rp_message->mti) {
+ case tsms_rpdu_type_data_mo:
+ case tsms_rpdu_type_data_mt: {
+ char* ascii = tsk_null;
+ tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
+ if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))) {
+ if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo) { /* SMS-SUBMIT or SMS-DELIVER? */
+ ascii = tsms_tpdu_message_get_payload(tpdu);
+ decodedData = new SMSData(twrap_sms_type_rpdata, rp_message->mr, ascii, (tsk_size_t)tsk_strlen(ascii));
+
+ if(tpdu->mti == tsms_tpdu_mti_deliver_mt) {
+ tsms_tpdu_deliver_t* tpdu_deliver = (tsms_tpdu_deliver_t*)tpdu;
+ decodedData->setOA(tpdu_deliver->oa ? tpdu_deliver->oa->digits : tsk_null);
+ }
+ /* IMPORTANT: to not uncomment
+ else if(TSK_OBJECT_DEF(tpdu) == tsms_tpdu_submit_def_t){
+ tsms_tpdu_submit_t* tpdu_submit = (tsms_tpdu_submit_t*)tpdu;
+ decodedData->setDA(tpdu_submit->da ? tpdu_submit->da->digits : tsk_null);
+ }*/
+ TSK_FREE(ascii);
+ }
+ }
+ break;
+ }
+ case tsms_rpdu_type_ack_mo:
+ case tsms_rpdu_type_ack_mt: {
+ tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
+ // ...do whatever you want
+ if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ decodedData = new SMSData(twrap_sms_type_ack, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ case tsms_rpdu_type_error_mo:
+ case tsms_rpdu_type_error_mt: {
+ tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
+ // ...do whatever you want
+ if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ decodedData = new SMSData(twrap_sms_type_error, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ case tsms_rpdu_type_smma_mo: {
+ // tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
+ // ...do whatever you want
+ decodedData = new SMSData(twrap_sms_type_smma, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ default: {
+ TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
+ break;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(rp_message);
- TSK_OBJECT_SAFE_FREE(tpdu);
+ TSK_OBJECT_SAFE_FREE(rp_message);
+ TSK_OBJECT_SAFE_FREE(tpdu);
- return decodedData;
+ return decodedData;
} \ No newline at end of file
diff --git a/bindings/_common/SMSEncoder.h b/bindings/_common/SMSEncoder.h
index 597f978..f38c9d4 100755
--- a/bindings/_common/SMSEncoder.h
+++ b/bindings/_common/SMSEncoder.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,23 +27,21 @@
#include "tinysip.h" /* SIP/IMS */
#include "tinysms.h" /* Binary SMS API*/
-typedef enum twrap_rpmessage_type_e
-{
- twrap_rpmessage_type_sms_none,
- twrap_rpmessage_type_sms_submit,
- twrap_rpmessage_type_sms_deliver,
- twrap_rpmessage_type_sms_ack,
- twrap_rpmessage_type_sms_error,
+typedef enum twrap_rpmessage_type_e {
+ twrap_rpmessage_type_sms_none,
+ twrap_rpmessage_type_sms_submit,
+ twrap_rpmessage_type_sms_deliver,
+ twrap_rpmessage_type_sms_ack,
+ twrap_rpmessage_type_sms_error,
}
twrap_rpmessage_type_t;
-typedef enum twrap_sms_type_e
-{
- twrap_sms_type_none,
- twrap_sms_type_rpdata,
- twrap_sms_type_smma,
- twrap_sms_type_ack,
- twrap_sms_type_error,
+typedef enum twrap_sms_type_e {
+ twrap_sms_type_none,
+ twrap_sms_type_rpdata,
+ twrap_sms_type_smma,
+ twrap_sms_type_ack,
+ twrap_sms_type_error,
}
twrap_sms_type_t;
@@ -51,65 +49,65 @@ class RPMessage
{
public:
#if !defined(SWIG)
- RPMessage(twrap_rpmessage_type_t type, tsms_rpdu_message_t* rp_message);
+ RPMessage(twrap_rpmessage_type_t type, tsms_rpdu_message_t* rp_message);
#endif
- RPMessage();
+ RPMessage();
- virtual ~RPMessage();
+ virtual ~RPMessage();
public:
- /* Public API functions */
- twrap_rpmessage_type_t getType();
- unsigned getPayloadLength();
- unsigned getPayload(void* output, unsigned maxsize);
+ /* Public API functions */
+ twrap_rpmessage_type_t getType();
+ unsigned getPayloadLength();
+ unsigned getPayload(void* output, unsigned maxsize);
private:
- twrap_rpmessage_type_t type;
- tsms_rpdu_message_t* rp_message;
+ twrap_rpmessage_type_t type;
+ tsms_rpdu_message_t* rp_message;
- tsk_buffer_t* tmpBuffer;
+ tsk_buffer_t* tmpBuffer;
};
class SMSData
{
public:
#if !defined(SWIG)
- SMSData(twrap_sms_type_t type, int mr, const void* ascii, tsk_size_t size);
+ SMSData(twrap_sms_type_t type, int mr, const void* ascii, tsk_size_t size);
#endif
- SMSData();
+ SMSData();
- virtual ~SMSData();
+ virtual ~SMSData();
public:
- /* Public API functions */
- twrap_sms_type_t getType();
- int getMR();
- unsigned getPayloadLength();
- unsigned getPayload(void* output, unsigned maxsize);
- const char* getOA();
- const char* getDA();
+ /* Public API functions */
+ twrap_sms_type_t getType();
+ int getMR();
+ unsigned getPayloadLength();
+ unsigned getPayload(void* output, unsigned maxsize);
+ const char* getOA();
+ const char* getDA();
#if !defined(SWIG)
- void setOA(const char* oa);
- void setDA(const char* da);
+ void setOA(const char* oa);
+ void setDA(const char* da);
#endif
private:
- twrap_sms_type_t type;
- int mr;
- void* ascii;
- char* oa;
- char* da;
- tsk_size_t size;
+ twrap_sms_type_t type;
+ int mr;
+ void* ascii;
+ char* oa;
+ char* da;
+ tsk_size_t size;
};
class SMSEncoder
{
public:
- static RPMessage* encodeSubmit(int mr, const char* smsc, const char* destination, const char* ascii);
- static RPMessage* encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii);
- static RPMessage* encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT);
- static RPMessage* encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT);
- static SMSData* decode(const void* data, unsigned size, bool MobOrig);
+ static RPMessage* encodeSubmit(int mr, const char* smsc, const char* destination, const char* ascii);
+ static RPMessage* encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii);
+ static RPMessage* encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT);
+ static RPMessage* encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT);
+ static SMSData* decode(const void* data, unsigned size, bool MobOrig);
};
#endif /* TINYWRAP_SMSENCODER_H */
diff --git a/bindings/_common/SafeObject.cxx b/bindings/_common/SafeObject.cxx
index 9d51696..b0dfc01 100755
--- a/bindings/_common/SafeObject.cxx
+++ b/bindings/_common/SafeObject.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,20 +23,20 @@
SafeObject::SafeObject()
{
- this->mutex = tsk_mutex_create();
+ this->mutex = tsk_mutex_create();
}
int SafeObject::Lock()const
{
- return tsk_mutex_lock(this->mutex);
+ return tsk_mutex_lock(this->mutex);
}
int SafeObject::UnLock()const
{
- return tsk_mutex_unlock(this->mutex);
+ return tsk_mutex_unlock(this->mutex);
}
SafeObject::~SafeObject()
{
- tsk_mutex_destroy(&this->mutex);
+ tsk_mutex_destroy(&this->mutex);
}
diff --git a/bindings/_common/SafeObject.h b/bindings/_common/SafeObject.h
index 1b4e6bd..bb290b7 100755
--- a/bindings/_common/SafeObject.h
+++ b/bindings/_common/SafeObject.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,15 +29,15 @@
class TINYWRAP_API SafeObject
{
public:
- SafeObject();
- virtual ~SafeObject();
+ SafeObject();
+ virtual ~SafeObject();
-/* protected: */
- int Lock()const;
- int UnLock()const;
+ /* protected: */
+ int Lock()const;
+ int UnLock()const;
private:
- tsk_mutex_handle_t *mutex;
+ tsk_mutex_handle_t *mutex;
};
#endif /* TINYWRAP_SAFEOBJECT_H */
diff --git a/bindings/_common/SipCallback.cxx b/bindings/_common/SipCallback.cxx
index 995327e..5785bd9 100755
--- a/bindings/_common/SipCallback.cxx
+++ b/bindings/_common/SipCallback.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/bindings/_common/SipCallback.h b/bindings/_common/SipCallback.h
index f7e1b98..c402628 100755
--- a/bindings/_common/SipCallback.h
+++ b/bindings/_common/SipCallback.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,21 +36,39 @@ class SubscriptionEvent;
class SipCallback
{
public:
- SipCallback() { }
- virtual ~SipCallback() {}
- virtual int OnDialogEvent(const DialogEvent* e) { return -1; }
- virtual int OnStackEvent(const StackEvent* e) { return -1; }
+ SipCallback() { }
+ virtual ~SipCallback() {}
+ virtual int OnDialogEvent(const DialogEvent* e) {
+ return -1;
+ }
+ virtual int OnStackEvent(const StackEvent* e) {
+ return -1;
+ }
- virtual int OnInviteEvent(const InviteEvent* e) { return -1; }
- virtual int OnMessagingEvent(const MessagingEvent* e) { return -1; }
- virtual int OnInfoEvent(const InfoEvent* e) { return -1; }
- virtual int OnOptionsEvent(const OptionsEvent* e) { return -1; }
- virtual int OnPublicationEvent(const PublicationEvent* e) { return -1; }
- virtual int OnRegistrationEvent(const RegistrationEvent* e) { return -1; }
- virtual int OnSubscriptionEvent(const SubscriptionEvent* e) { return -1; }
+ virtual int OnInviteEvent(const InviteEvent* e) {
+ return -1;
+ }
+ virtual int OnMessagingEvent(const MessagingEvent* e) {
+ return -1;
+ }
+ virtual int OnInfoEvent(const InfoEvent* e) {
+ return -1;
+ }
+ virtual int OnOptionsEvent(const OptionsEvent* e) {
+ return -1;
+ }
+ virtual int OnPublicationEvent(const PublicationEvent* e) {
+ return -1;
+ }
+ virtual int OnRegistrationEvent(const RegistrationEvent* e) {
+ return -1;
+ }
+ virtual int OnSubscriptionEvent(const SubscriptionEvent* e) {
+ return -1;
+ }
private:
-
+
};
#endif /* TINYWRAP_SIPCALLBACK_H */
diff --git a/bindings/_common/SipEvent.cxx b/bindings/_common/SipEvent.cxx
index 3518f4a..cc8a8eb 100755
--- a/bindings/_common/SipEvent.cxx
+++ b/bindings/_common/SipEvent.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,78 +38,78 @@ name##Session* cls##Event::take##session##Ownership() const \
} \
return tsk_null; \
} \
-
+
/* ======================== SipEvent ========================*/
SipEvent::SipEvent(const tsip_event_t *_sipevent)
{
- this->sipevent = _sipevent;
- if(_sipevent){
- this->sipmessage = new SipMessage(_sipevent->sipmessage);
- }
- else{
- this->sipmessage = tsk_null;
- }
+ this->sipevent = _sipevent;
+ if(_sipevent) {
+ this->sipmessage = new SipMessage(_sipevent->sipmessage);
+ }
+ else {
+ this->sipmessage = tsk_null;
+ }
}
SipEvent::~SipEvent()
{
- if(this->sipmessage){
- delete this->sipmessage;
- }
+ if(this->sipmessage) {
+ delete this->sipmessage;
+ }
}
short SipEvent::getCode() const
{
- return this->sipevent->code;
+ return this->sipevent->code;
}
const char* SipEvent::getPhrase() const
{
- return this->sipevent->phrase;
+ return this->sipevent->phrase;
}
const SipSession* SipEvent::getBaseSession() const
{
- const void* userdata = tsip_ssession_get_userdata(this->sipevent->ss);
- if(userdata){
- return dyn_cast<const SipSession*>((const SipSession*)userdata);
- }
- return tsk_null;
+ const void* userdata = tsip_ssession_get_userdata(this->sipevent->ss);
+ if(userdata) {
+ return dyn_cast<const SipSession*>((const SipSession*)userdata);
+ }
+ return tsk_null;
}
const SipMessage* SipEvent::getSipMessage() const
{
- return this->sipmessage;
+ return this->sipmessage;
}
SipStack* SipEvent::getStack()const
{
- const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
- const void* userdata;
- if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))){
- return dyn_cast<SipStack*>((SipStack*)userdata);
- }
- return tsk_null;
+ const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
+ const void* userdata;
+ if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))) {
+ return dyn_cast<SipStack*>((SipStack*)userdata);
+ }
+ return tsk_null;
}
/* ======================== DialogEvent ========================*/
DialogEvent::DialogEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent){ }
+ :SipEvent(_sipevent) { }
-DialogEvent::~DialogEvent(){ }
+DialogEvent::~DialogEvent() { }
/* ======================== DialogEvent ========================*/
StackEvent::StackEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent){ }
+ :SipEvent(_sipevent) { }
-StackEvent::~StackEvent(){ }
+StackEvent::~StackEvent() { }
/* ======================== InviteEvent ========================*/
InviteEvent::InviteEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -119,27 +119,27 @@ InviteEvent::~InviteEvent()
tsip_invite_event_type_t InviteEvent::getType() const
{
- return TSIP_INVITE_EVENT(this->sipevent)->type;
+ return TSIP_INVITE_EVENT(this->sipevent)->type;
}
twrap_media_type_t InviteEvent::getMediaType() const
{
- // Ignore Mixed session (both audio/video and MSRP) as specified by GSMA RCS.
- if (this->sipevent && this->sipevent->ss) {
- tmedia_type_t type = tsip_ssession_get_mediatype(this->sipevent->ss);
- if ((type & tmedia_msrp) == tmedia_msrp) {
- return twrap_media_msrp;
- }
- else {
- return twrap_get_wrapped_media_type(type);
- }
- }
- return twrap_media_none;
+ // Ignore Mixed session (both audio/video and MSRP) as specified by GSMA RCS.
+ if (this->sipevent && this->sipevent->ss) {
+ tmedia_type_t type = tsip_ssession_get_mediatype(this->sipevent->ss);
+ if ((type & tmedia_msrp) == tmedia_msrp) {
+ return twrap_media_msrp;
+ }
+ else {
+ return twrap_get_wrapped_media_type(type);
+ }
+ }
+ return twrap_media_none;
}
const InviteSession* InviteEvent::getSession() const
{
- return dyn_cast<const InviteSession*>(this->getBaseSession());
+ return dyn_cast<const InviteSession*>(this->getBaseSession());
}
takeOwnership_Implement(Invite, Call, CallSession);
@@ -147,7 +147,7 @@ takeOwnership_Implement(Invite, Msrp, MsrpSession);
/* ======================== MessagingEvent ========================*/
MessagingEvent::MessagingEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -157,12 +157,12 @@ MessagingEvent::~MessagingEvent()
tsip_message_event_type_t MessagingEvent::getType() const
{
- return TSIP_MESSAGE_EVENT(this->sipevent)->type;
+ return TSIP_MESSAGE_EVENT(this->sipevent)->type;
}
const MessagingSession* MessagingEvent::getSession() const
{
- return dyn_cast<const MessagingSession*>(this->getBaseSession());
+ return dyn_cast<const MessagingSession*>(this->getBaseSession());
}
takeOwnership_Implement(Messaging, Messaging, Session);
@@ -170,7 +170,7 @@ takeOwnership_Implement(Messaging, Messaging, Session);
/* ======================== InfoEvent ========================*/
InfoEvent::InfoEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -180,12 +180,12 @@ InfoEvent::~InfoEvent()
tsip_info_event_type_t InfoEvent::getType() const
{
- return TSIP_INFO_EVENT(this->sipevent)->type;
+ return TSIP_INFO_EVENT(this->sipevent)->type;
}
const InfoSession* InfoEvent::getSession() const
{
- return dyn_cast<const InfoSession*>(this->getBaseSession());
+ return dyn_cast<const InfoSession*>(this->getBaseSession());
}
takeOwnership_Implement(Info, Info, Session);
@@ -194,7 +194,7 @@ takeOwnership_Implement(Info, Info, Session);
/* ======================== OptionsEvent ========================*/
OptionsEvent::OptionsEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -204,12 +204,12 @@ OptionsEvent::~OptionsEvent()
tsip_options_event_type_t OptionsEvent::getType() const
{
- return TSIP_OPTIONS_EVENT(this->sipevent)->type;
+ return TSIP_OPTIONS_EVENT(this->sipevent)->type;
}
const OptionsSession* OptionsEvent::getSession() const
{
- return dyn_cast<const OptionsSession*>(this->getBaseSession());
+ return dyn_cast<const OptionsSession*>(this->getBaseSession());
}
takeOwnership_Implement(Options, Options, Session);
@@ -217,7 +217,7 @@ takeOwnership_Implement(Options, Options, Session);
/* ======================== PublicationEvent ========================*/
PublicationEvent::PublicationEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -227,12 +227,12 @@ PublicationEvent::~PublicationEvent()
tsip_publish_event_type_t PublicationEvent::getType() const
{
- return TSIP_PUBLISH_EVENT(this->sipevent)->type;
+ return TSIP_PUBLISH_EVENT(this->sipevent)->type;
}
const PublicationSession* PublicationEvent::getSession() const
{
- return dyn_cast<const PublicationSession*>(this->getBaseSession());
+ return dyn_cast<const PublicationSession*>(this->getBaseSession());
}
takeOwnership_Implement(Publication, Publication, Session);
@@ -240,7 +240,7 @@ takeOwnership_Implement(Publication, Publication, Session);
/* ======================== RegistrationEvent ========================*/
RegistrationEvent::RegistrationEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -250,12 +250,12 @@ RegistrationEvent::~RegistrationEvent()
tsip_register_event_type_t RegistrationEvent::getType() const
{
- return TSIP_REGISTER_EVENT(this->sipevent)->type;
+ return TSIP_REGISTER_EVENT(this->sipevent)->type;
}
const RegistrationSession* RegistrationEvent::getSession() const
{
- return dyn_cast<const RegistrationSession*>(this->getBaseSession());
+ return dyn_cast<const RegistrationSession*>(this->getBaseSession());
}
takeOwnership_Implement(Registration, Registration, Session);
@@ -263,7 +263,7 @@ takeOwnership_Implement(Registration, Registration, Session);
/* ======================== SubscriptionEvent ========================*/
SubscriptionEvent::SubscriptionEvent(const tsip_event_t *sipevent)
-:SipEvent(sipevent)
+ :SipEvent(sipevent)
{
}
@@ -273,12 +273,12 @@ SubscriptionEvent::~SubscriptionEvent()
tsip_subscribe_event_type_t SubscriptionEvent::getType() const
{
- return TSIP_SUBSCRIBE_EVENT(this->sipevent)->type;
+ return TSIP_SUBSCRIBE_EVENT(this->sipevent)->type;
}
const SubscriptionSession* SubscriptionEvent::getSession() const
{
- return dyn_cast<const SubscriptionSession*>(this->getBaseSession());
+ return dyn_cast<const SubscriptionSession*>(this->getBaseSession());
}
takeOwnership_Implement(Subscription, Subscription, Session); \ No newline at end of file
diff --git a/bindings/_common/SipEvent.h b/bindings/_common/SipEvent.h
index 85acb8d..c8b67a8 100755
--- a/bindings/_common/SipEvent.h
+++ b/bindings/_common/SipEvent.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,25 +48,27 @@ class TINYWRAP_API SipEvent
{
public:
#if !defined(SWIG)
- SipEvent(const tsip_event_t *sipevent);
+ SipEvent(const tsip_event_t *sipevent);
#endif
- virtual ~SipEvent();
+ virtual ~SipEvent();
public:
- short getCode() const;
- const char* getPhrase() const;
- const SipSession* getBaseSession() const;
- const SipMessage* getSipMessage() const;
+ short getCode() const;
+ const char* getPhrase() const;
+ const SipSession* getBaseSession() const;
+ const SipMessage* getSipMessage() const;
#if !defined(SWIG)
- const tsip_event_t * getWrappedEvent(){ return sipevent; }
+ const tsip_event_t * getWrappedEvent() {
+ return sipevent;
+ }
#endif
#if !defined(SWIG)
- SipStack* getStack()const;
+ SipStack* getStack()const;
#endif
protected:
- const tsip_event_t *sipevent;
- SipMessage* sipmessage;
+ const tsip_event_t *sipevent;
+ SipMessage* sipmessage;
};
@@ -75,9 +77,9 @@ class TINYWRAP_API DialogEvent: public SipEvent
{
public:
#if !defined(SWIG)
- DialogEvent(const tsip_event_t *sipevent);
+ DialogEvent(const tsip_event_t *sipevent);
#endif
- virtual ~DialogEvent();
+ virtual ~DialogEvent();
public: /* Public API functions */
};
@@ -87,9 +89,9 @@ class TINYWRAP_API StackEvent: public SipEvent
{
public:
#if !defined(SWIG)
- StackEvent(const tsip_event_t *sipevent);
+ StackEvent(const tsip_event_t *sipevent);
#endif
- virtual ~StackEvent();
+ virtual ~StackEvent();
public: /* Public API functions */
};
@@ -101,16 +103,16 @@ class TINYWRAP_API InviteEvent: public SipEvent
{
public:
#if !defined(SWIG)
- InviteEvent(const tsip_event_t *sipevent);
+ InviteEvent(const tsip_event_t *sipevent);
#endif
- virtual ~InviteEvent();
+ virtual ~InviteEvent();
public: /* Public API functions */
- tsip_invite_event_type_t getType() const;
- twrap_media_type_t getMediaType() const;
- const InviteSession* getSession() const;
- CallSession* takeCallSessionOwnership() const;
- MsrpSession* takeMsrpSessionOwnership() const;
+ tsip_invite_event_type_t getType() const;
+ twrap_media_type_t getMediaType() const;
+ const InviteSession* getSession() const;
+ CallSession* takeCallSessionOwnership() const;
+ MsrpSession* takeMsrpSessionOwnership() const;
};
@@ -120,14 +122,14 @@ class TINYWRAP_API MessagingEvent: public SipEvent
{
public:
#if !defined(SWIG)
- MessagingEvent(const tsip_event_t *sipevent);
+ MessagingEvent(const tsip_event_t *sipevent);
#endif
- virtual ~MessagingEvent();
+ virtual ~MessagingEvent();
public: /* Public API functions */
- tsip_message_event_type_t getType() const;
- const MessagingSession* getSession() const;
- MessagingSession* takeSessionOwnership() const;
+ tsip_message_event_type_t getType() const;
+ const MessagingSession* getSession() const;
+ MessagingSession* takeSessionOwnership() const;
};
/* ======================== InfoEvent ========================*/
@@ -135,14 +137,14 @@ class TINYWRAP_API InfoEvent: public SipEvent
{
public:
#if !defined(SWIG)
- InfoEvent(const tsip_event_t *sipevent);
+ InfoEvent(const tsip_event_t *sipevent);
#endif
- virtual ~InfoEvent();
+ virtual ~InfoEvent();
public: /* Public API functions */
- tsip_info_event_type_t getType() const;
- const InfoSession* getSession() const;
- InfoSession* takeSessionOwnership() const;
+ tsip_info_event_type_t getType() const;
+ const InfoSession* getSession() const;
+ InfoSession* takeSessionOwnership() const;
};
@@ -152,14 +154,14 @@ class TINYWRAP_API OptionsEvent: public SipEvent
{
public:
#if !defined(SWIG)
- OptionsEvent(const tsip_event_t *sipevent);
+ OptionsEvent(const tsip_event_t *sipevent);
#endif
- virtual ~OptionsEvent();
+ virtual ~OptionsEvent();
public: /* Public API functions */
- tsip_options_event_type_t getType() const;
- const OptionsSession* getSession() const;
- OptionsSession* takeSessionOwnership() const;
+ tsip_options_event_type_t getType() const;
+ const OptionsSession* getSession() const;
+ OptionsSession* takeSessionOwnership() const;
};
@@ -169,14 +171,14 @@ class TINYWRAP_API PublicationEvent: public SipEvent
{
public:
#if !defined(SWIG)
- PublicationEvent(const tsip_event_t *sipevent);
+ PublicationEvent(const tsip_event_t *sipevent);
#endif
- virtual ~PublicationEvent();
+ virtual ~PublicationEvent();
public: /* Public API functions */
- tsip_publish_event_type_t getType() const;
- const PublicationSession* getSession() const;
- PublicationSession* takeSessionOwnership() const;
+ tsip_publish_event_type_t getType() const;
+ const PublicationSession* getSession() const;
+ PublicationSession* takeSessionOwnership() const;
};
@@ -186,15 +188,15 @@ class TINYWRAP_API RegistrationEvent: public SipEvent
{
public:
#if !defined(SWIG)
- RegistrationEvent(const tsip_event_t *sipevent);
+ RegistrationEvent(const tsip_event_t *sipevent);
#endif
- virtual ~RegistrationEvent();
+ virtual ~RegistrationEvent();
public: /* Public API functions */
- tsip_register_event_type_t getType() const;
- const RegistrationSession* getSession() const;
- RegistrationSession* takeSessionOwnership() const;
-
+ tsip_register_event_type_t getType() const;
+ const RegistrationSession* getSession() const;
+ RegistrationSession* takeSessionOwnership() const;
+
};
@@ -203,14 +205,14 @@ class TINYWRAP_API SubscriptionEvent: public SipEvent
{
public:
#if !defined(SWIG)
- SubscriptionEvent(const tsip_event_t *sipevent);
+ SubscriptionEvent(const tsip_event_t *sipevent);
#endif
- virtual ~SubscriptionEvent();
+ virtual ~SubscriptionEvent();
public: /* Public API functions */
- tsip_subscribe_event_type_t getType() const;
- const SubscriptionSession* getSession() const;
- SubscriptionSession* takeSessionOwnership() const;
+ tsip_subscribe_event_type_t getType() const;
+ const SubscriptionSession* getSession() const;
+ SubscriptionSession* takeSessionOwnership() const;
};
#endif /* TINYWRAP_SIPEVENT_H */
diff --git a/bindings/_common/SipMessage.cxx b/bindings/_common/SipMessage.cxx
index a4f09fd..2f0000b 100755
--- a/bindings/_common/SipMessage.cxx
+++ b/bindings/_common/SipMessage.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,231 +23,297 @@
SdpMessage::SdpMessage()
-:m_pSdpMessage(tsk_null)
+ :m_pSdpMessage(tsk_null)
{
}
SdpMessage::SdpMessage(tsdp_message_t *_sdpmessage)
{
- m_pSdpMessage = (tsdp_message_t *)tsk_object_ref(_sdpmessage);
+ m_pSdpMessage = (tsdp_message_t *)tsk_object_ref(_sdpmessage);
}
SdpMessage::~SdpMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pSdpMessage);
+ TSK_OBJECT_SAFE_FREE(m_pSdpMessage);
}
char* SdpMessage::getSdpHeaderValue(const char* media, char name, unsigned index /*= 0*/)
{
- const tsdp_header_M_t* M;
-
- if((M = (const tsdp_header_M_t*)tsdp_message_get_header(m_pSdpMessage, tsdp_htype_M))){
- tsdp_header_type_t type = tsdp_htype_Dummy;
- const tsdp_header_t* header;
- switch(name){
- case 'a': type = tsdp_htype_A; break;
- case 'b': type = tsdp_htype_B; break;
- case 'c': type = tsdp_htype_C; break;
- case 'e': type = tsdp_htype_E; break;
- case 'i': type = tsdp_htype_I; break;
- case 'k': type = tsdp_htype_K; break;
- case 'm': type = tsdp_htype_M; break;
- case 'o': type = tsdp_htype_O; break;
-
-
- case 'p': type = tsdp_htype_P; break;
- case 'r': type = tsdp_htype_R; break;
- case 's': type = tsdp_htype_S; break;
- case 't': type = tsdp_htype_T; break;
- case 'u': type = tsdp_htype_U; break;
- case 'v': type = tsdp_htype_V; break;
- case 'z': type = tsdp_htype_Z; break;
- }
-
- if((header = tsdp_message_get_headerAt(m_pSdpMessage, type, index))){
- return tsdp_header_tostring(header);
- }
- }
-
- return tsk_null;
+ const tsdp_header_M_t* M;
+
+ if((M = (const tsdp_header_M_t*)tsdp_message_get_header(m_pSdpMessage, tsdp_htype_M))) {
+ tsdp_header_type_t type = tsdp_htype_Dummy;
+ const tsdp_header_t* header;
+ switch(name) {
+ case 'a':
+ type = tsdp_htype_A;
+ break;
+ case 'b':
+ type = tsdp_htype_B;
+ break;
+ case 'c':
+ type = tsdp_htype_C;
+ break;
+ case 'e':
+ type = tsdp_htype_E;
+ break;
+ case 'i':
+ type = tsdp_htype_I;
+ break;
+ case 'k':
+ type = tsdp_htype_K;
+ break;
+ case 'm':
+ type = tsdp_htype_M;
+ break;
+ case 'o':
+ type = tsdp_htype_O;
+ break;
+
+
+ case 'p':
+ type = tsdp_htype_P;
+ break;
+ case 'r':
+ type = tsdp_htype_R;
+ break;
+ case 's':
+ type = tsdp_htype_S;
+ break;
+ case 't':
+ type = tsdp_htype_T;
+ break;
+ case 'u':
+ type = tsdp_htype_U;
+ break;
+ case 'v':
+ type = tsdp_htype_V;
+ break;
+ case 'z':
+ type = tsdp_htype_Z;
+ break;
+ }
+
+ if((header = tsdp_message_get_headerAt(m_pSdpMessage, type, index))) {
+ return tsdp_header_tostring(header);
+ }
+ }
+
+ return tsk_null;
}
char* SdpMessage::getSdpHeaderAValue(const char* media, const char* attributeName)
{
- const tsdp_header_M_t* M;
- tsk_size_t i;
-
- for(i = 0; (M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(m_pSdpMessage, tsdp_htype_M, i)); i++){
- if(tsk_striequals(M->media, media)){
- const tsdp_header_A_t* A;
- if((A = tsdp_header_M_findA(M, attributeName))){
- return tsk_strdup(A->value);
- }
- }
- }
-
- return tsk_null;
+ const tsdp_header_M_t* M;
+ tsk_size_t i;
+
+ for(i = 0; (M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(m_pSdpMessage, tsdp_htype_M, i)); i++) {
+ if(tsk_striequals(M->media, media)) {
+ const tsdp_header_A_t* A;
+ if((A = tsdp_header_M_findA(M, attributeName))) {
+ return tsk_strdup(A->value);
+ }
+ }
+ }
+
+ return tsk_null;
}
SipMessage::SipMessage()
-:m_pSipMessage(tsk_null), m_pSdpMessage(tsk_null)
-{
+ :m_pSipMessage(tsk_null), m_pSdpMessage(tsk_null)
+{
}
SipMessage::SipMessage(tsip_message_t *_sipmessage)
-: m_pSdpMessage(tsk_null)
+ : m_pSdpMessage(tsk_null)
{
- m_pSipMessage = (tsip_message_t *)tsk_object_ref(_sipmessage);
+ m_pSipMessage = (tsip_message_t *)tsk_object_ref(_sipmessage);
}
SipMessage::~SipMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pSipMessage);
- if(m_pSdpMessage){
- delete m_pSdpMessage;
- }
+ TSK_OBJECT_SAFE_FREE(m_pSipMessage);
+ if(m_pSdpMessage) {
+ delete m_pSdpMessage;
+ }
}
bool SipMessage::isResponse()
{
- return TSIP_MESSAGE_IS_RESPONSE(m_pSipMessage);
+ return TSIP_MESSAGE_IS_RESPONSE(m_pSipMessage);
}
tsip_request_type_t SipMessage::getRequestType()
{
- if(TSIP_MESSAGE_IS_REQUEST(m_pSipMessage)){
- return (m_pSipMessage)->line.request.request_type;
- }
- return tsip_NONE;
+ if(TSIP_MESSAGE_IS_REQUEST(m_pSipMessage)) {
+ return (m_pSipMessage)->line.request.request_type;
+ }
+ return tsip_NONE;
}
short SipMessage::getResponseCode()
{
- return TSIP_RESPONSE_CODE(m_pSipMessage);
+ return TSIP_RESPONSE_CODE(m_pSipMessage);
}
const char* SipMessage::getResponsePhrase()
{
- return TSIP_RESPONSE_PHRASE(m_pSipMessage);
+ return TSIP_RESPONSE_PHRASE(m_pSipMessage);
}
const tsip_header_t* SipMessage::getSipHeader(const char* name, unsigned index /* =0 */)
{
- /* Do not worry about calling tsk_striequals() several times because the function
- * is fully optimized.
- */
- /* Code below comes from tsip_message_get_headerAt() */
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
- const tsip_header_t* hdr = tsk_null;
- if(!m_pSipMessage || !name){
- return tsk_null;
- }
-
- if(tsk_striequals(name, "v") || tsk_striequals(name, "via")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->firstVia;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "f") || tsk_striequals(name, "from")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->From;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "t") || tsk_striequals(name, "to")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->To;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "m") || tsk_striequals(name, "contact")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Contact;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "i") || tsk_striequals(name, "call-id")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Call_ID;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "cseq")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->CSeq;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "expires")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Expires;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "c") || tsk_striequals(name, "content-type")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Content_Type;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "l") || tsk_striequals(name, "content-length")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Content_Length;
- goto bail;
- }else pos++; }
-
-
- tsk_list_foreach(item, m_pSipMessage->headers){
- if(tsk_striequals(tsip_header_get_name_2(TSIP_HEADER(item->data)), name)){
- if(pos++ >= index){
- hdr = (const tsip_header_t*)item->data;
- break;
- }
- }
- }
-
+ /* Do not worry about calling tsk_striequals() several times because the function
+ * is fully optimized.
+ */
+ /* Code below comes from tsip_message_get_headerAt() */
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+ const tsip_header_t* hdr = tsk_null;
+ if(!m_pSipMessage || !name) {
+ return tsk_null;
+ }
+
+ if(tsk_striequals(name, "v") || tsk_striequals(name, "via")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->firstVia;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "f") || tsk_striequals(name, "from")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "t") || tsk_striequals(name, "to")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "m") || tsk_striequals(name, "contact")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Contact;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "i") || tsk_striequals(name, "call-id")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Call_ID;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "cseq")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->CSeq;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "expires")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Expires;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "c") || tsk_striequals(name, "content-type")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Content_Type;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "l") || tsk_striequals(name, "content-length")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Content_Length;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+
+
+ tsk_list_foreach(item, m_pSipMessage->headers) {
+ if(tsk_striequals(tsip_header_get_name_2(TSIP_HEADER(item->data)), name)) {
+ if(pos++ >= index) {
+ hdr = (const tsip_header_t*)item->data;
+ break;
+ }
+ }
+ }
+
bail:
- return hdr;
+ return hdr;
}
// e.g. getHeaderParamValue("content-type");
char* SipMessage::getSipHeaderValue(const char* name, unsigned index /* = 0*/)
{
- const tsip_header_t* header;
- if((header = this->getSipHeader(name, index))){
-
- switch(header->type){
- case tsip_htype_From:
- return tsip_uri_tostring(((const tsip_header_From_t*)header)->uri, tsk_false, tsk_false);
- case tsip_htype_To:
- return tsip_uri_tostring(((const tsip_header_To_t*)header)->uri, tsk_false, tsk_false);
- break;
- case tsip_htype_P_Asserted_Identity:
- return tsip_uri_tostring(((const tsip_header_P_Asserted_Identity_t*)header)->uri, tsk_false, tsk_false);
- break;
-
- default:
- return tsip_header_value_tostring(header);
- }
- }
- // SWIG: %newobject getHeaderValueAt;
- return tsk_null;
+ const tsip_header_t* header;
+ if((header = this->getSipHeader(name, index))) {
+
+ switch(header->type) {
+ case tsip_htype_From:
+ return tsip_uri_tostring(((const tsip_header_From_t*)header)->uri, tsk_false, tsk_false);
+ case tsip_htype_To:
+ return tsip_uri_tostring(((const tsip_header_To_t*)header)->uri, tsk_false, tsk_false);
+ break;
+ case tsip_htype_P_Asserted_Identity:
+ return tsip_uri_tostring(((const tsip_header_P_Asserted_Identity_t*)header)->uri, tsk_false, tsk_false);
+ break;
+
+ default:
+ return tsip_header_value_tostring(header);
+ }
+ }
+ // SWIG: %newobject getHeaderValueAt;
+ return tsk_null;
}
// e.g. getHeaderParamValue("content-type", "charset");
char* SipMessage::getSipHeaderParamValue(const char* name, const char* param, unsigned index /*=0*/)
{
- const tsip_header_t* header;
+ const tsip_header_t* header;
- if((header = this->getSipHeader(name, index))){
- return tsip_header_get_param_value(header, param);
- }
+ if((header = this->getSipHeader(name, index))) {
+ return tsip_header_get_param_value(header, param);
+ }
- // SWIG: %newobject getSipHeaderParamValue;
- return tsk_null;
+ // SWIG: %newobject getSipHeaderParamValue;
+ return tsk_null;
}
/** Returns the content length.
*/
unsigned SipMessage::getSipContentLength()
{
- return TSIP_MESSAGE_CONTENT_DATA_LENGTH(m_pSipMessage);
+ return TSIP_MESSAGE_CONTENT_DATA_LENGTH(m_pSipMessage);
}
/** Gets the message content
@@ -259,31 +325,31 @@ unsigned SipMessage::getSipContentLength()
*/
unsigned SipMessage::getSipContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(output && maxsize && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)){
- retsize = (m_pSipMessage->Content->size > maxsize) ? maxsize : m_pSipMessage->Content->size;
- memcpy(output, m_pSipMessage->Content->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+ if(output && maxsize && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)) {
+ retsize = (m_pSipMessage->Content->size > maxsize) ? maxsize : m_pSipMessage->Content->size;
+ memcpy(output, m_pSipMessage->Content->data, retsize);
+ }
+ return retsize;
}
const void* SipMessage::getSipContentPtr()
{
- if(m_pSipMessage && m_pSipMessage->Content){
- return m_pSipMessage->Content->data;
- }
- return tsk_null;
+ if(m_pSipMessage && m_pSipMessage->Content) {
+ return m_pSipMessage->Content->data;
+ }
+ return tsk_null;
}
const SdpMessage* SipMessage::getSdpMessage()
{
- if(!m_pSdpMessage && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)){
- tsdp_message_t* sdp = tsdp_message_parse(m_pSipMessage->Content->data, m_pSipMessage->Content->size);
- if(sdp){
- m_pSdpMessage = new SdpMessage(sdp);
- TSK_OBJECT_SAFE_FREE(sdp);
- }
- }
-
- return m_pSdpMessage;
+ if(!m_pSdpMessage && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)) {
+ tsdp_message_t* sdp = tsdp_message_parse(m_pSipMessage->Content->data, m_pSipMessage->Content->size);
+ if(sdp) {
+ m_pSdpMessage = new SdpMessage(sdp);
+ TSK_OBJECT_SAFE_FREE(sdp);
+ }
+ }
+
+ return m_pSdpMessage;
}
diff --git a/bindings/_common/SipMessage.h b/bindings/_common/SipMessage.h
index eb9d598..e63a4a1 100755
--- a/bindings/_common/SipMessage.h
+++ b/bindings/_common/SipMessage.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,51 +28,55 @@
class TINYWRAP_API SdpMessage
{
public:
- SdpMessage();
+ SdpMessage();
#if !defined(SWIG)
- SdpMessage(tsdp_message_t *sdpmessage);
+ SdpMessage(tsdp_message_t *sdpmessage);
#endif
- virtual ~SdpMessage();
+ virtual ~SdpMessage();
- char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
- char* getSdpHeaderAValue(const char* media, const char* attributeName);
+ char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
+ char* getSdpHeaderAValue(const char* media, const char* attributeName);
#if !defined(SWIG)
- const tsdp_message_t * getWrappedSdpMessage(){ return m_pSdpMessage; }
+ const tsdp_message_t * getWrappedSdpMessage() {
+ return m_pSdpMessage;
+ }
#endif
private:
- tsdp_message_t *m_pSdpMessage;
+ tsdp_message_t *m_pSdpMessage;
};
class TINYWRAP_API SipMessage
{
public:
- SipMessage();
+ SipMessage();
#if !defined(SWIG)
- SipMessage(tsip_message_t *sipmessage);
+ SipMessage(tsip_message_t *sipmessage);
#endif
- virtual ~SipMessage();
-
- bool isResponse();
- tsip_request_type_t getRequestType();
- short getResponseCode();
- const char* getResponsePhrase();
- char* getSipHeaderValue(const char* name, unsigned index = 0);
- char* getSipHeaderParamValue(const char* name, const char* param, unsigned index = 0);
- unsigned getSipContentLength();
- unsigned getSipContent(void* output, unsigned maxsize);
+ virtual ~SipMessage();
+
+ bool isResponse();
+ tsip_request_type_t getRequestType();
+ short getResponseCode();
+ const char* getResponsePhrase();
+ char* getSipHeaderValue(const char* name, unsigned index = 0);
+ char* getSipHeaderParamValue(const char* name, const char* param, unsigned index = 0);
+ unsigned getSipContentLength();
+ unsigned getSipContent(void* output, unsigned maxsize);
#if !defined(SWIG)
- const void* getSipContentPtr();
- const tsip_message_t* getWrappedSipMessage()const{ return m_pSipMessage; }
+ const void* getSipContentPtr();
+ const tsip_message_t* getWrappedSipMessage()const {
+ return m_pSipMessage;
+ }
#endif
- const SdpMessage* getSdpMessage();
+ const SdpMessage* getSdpMessage();
private:
- const tsip_header_t* getSipHeader(const char* name, unsigned index = 0);
+ const tsip_header_t* getSipHeader(const char* name, unsigned index = 0);
private:
- tsip_message_t *m_pSipMessage;
- SdpMessage *m_pSdpMessage;
+ tsip_message_t *m_pSipMessage;
+ SdpMessage *m_pSdpMessage;
};
#endif /* TINYWRAP_SIPMESSAGE_H */
diff --git a/bindings/_common/SipSession.cxx b/bindings/_common/SipSession.cxx
index ac80d41..2de0fc8 100755
--- a/bindings/_common/SipSession.cxx
+++ b/bindings/_common/SipSession.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,10 +26,9 @@
#include "Msrp.h"
/* ======================== AsyncAction ========================*/
-typedef struct twrap_async_action_s
-{
- const tsip_ssession_handle_t *session;
- const ActionConfig* config;
+typedef struct twrap_async_action_s {
+ const tsip_ssession_handle_t *session;
+ const ActionConfig* config;
}
twrap_async_action_t;
@@ -38,264 +37,264 @@ twrap_async_action_t;
/* ======================== SipSession ========================*/
SipSession::SipSession(SipStack* stack)
{
- init(stack);
+ init(stack);
}
SipSession::SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle)
{
- init(stack, pHandle);
+ init(stack, pHandle);
}
SipSession::~SipSession()
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_USERDATA(tsk_null),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_USERDATA(tsk_null),
+ TSIP_SSESSION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
void SipSession::init(SipStack* pStack, tsip_ssession_handle_t* pHandle/*=tsk_null*/)
{
- if(pHandle){
- /* "server-side-session" */
- if(tsip_ssession_have_ownership(pHandle)){
- tsk_object_ref(pHandle);
- }
- else if(tsip_ssession_take_ownership(pHandle) != 0){ /* should never happen */
- TSK_DEBUG_ERROR("Failed to take ownership");
- return;
- }
- m_pHandle = pHandle;
- }
- else{
- /* "client-side-session" */
- m_pHandle = tsip_ssession_create(pStack->getHandle(),
- TSIP_SSESSION_SET_USERDATA(this),
- TSIP_SSESSION_SET_NULL());
- }
-
- /* set userdata (context) and ref. the stack handle */
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_USERDATA(this),
- TSIP_SSESSION_SET_NULL());
- m_pStack = pStack;
+ if(pHandle) {
+ /* "server-side-session" */
+ if(tsip_ssession_have_ownership(pHandle)) {
+ tsk_object_ref(pHandle);
+ }
+ else if(tsip_ssession_take_ownership(pHandle) != 0) { /* should never happen */
+ TSK_DEBUG_ERROR("Failed to take ownership");
+ return;
+ }
+ m_pHandle = pHandle;
+ }
+ else {
+ /* "client-side-session" */
+ m_pHandle = tsip_ssession_create(pStack->getHandle(),
+ TSIP_SSESSION_SET_USERDATA(this),
+ TSIP_SSESSION_SET_NULL());
+ }
+
+ /* set userdata (context) and ref. the stack handle */
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_USERDATA(this),
+ TSIP_SSESSION_SET_NULL());
+ m_pStack = pStack;
}
bool SipSession::addHeader(const char* name, const char* value)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_HEADER(name, value),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_HEADER(name, value),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::haveOwnership()
{
- return (tsip_ssession_have_ownership(m_pHandle) == tsk_true);
+ return (tsip_ssession_have_ownership(m_pHandle) == tsk_true);
}
bool SipSession::removeHeader(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_HEADER(name),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_HEADER(name),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addCaps(const char* name, const char* value)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_CAPS(name, value),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_CAPS(name, value),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addCaps(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_CAPS(name, tsk_null),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_CAPS(name, tsk_null),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::removeCaps(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_CAPS(name),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_CAPS(name),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setExpires(unsigned expires)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_EXPIRES(expires),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_EXPIRES(expires),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setFromUri(const char* fromUriString)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_FROM_STR(fromUriString),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_FROM_STR(fromUriString),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setFromUri(const SipUri* fromUri)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_FROM_OBJ(fromUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_FROM_OBJ(fromUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setToUri(const char* toUriString)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_STR(toUriString),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_STR(toUriString),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setToUri(const SipUri* toUri)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(toUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(toUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setSilentHangup(bool silent)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_SILENT_HANGUP(silent ? tsk_true : tsk_false),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_SILENT_HANGUP(silent ? tsk_true : tsk_false),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addSigCompCompartment(const char* compId)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(compId),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(compId),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setAuth(const char* authHa1, const char* authIMPI)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_AUTH_HA1(authHa1),
- TSIP_SSESSION_SET_AUTH_IMPI(authIMPI),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_AUTH_HA1(authHa1),
+ TSIP_SSESSION_SET_AUTH_IMPI(authIMPI),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::removeSigCompCompartment()
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_SIGCOMP_COMPARTMENT(),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_SIGCOMP_COMPARTMENT(),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
// FIXME: should be "uint64_t" instead of "unsigned"
unsigned SipSession::getId()const
{
- return (unsigned)tsip_ssession_get_id(m_pHandle);
+ return (unsigned)tsip_ssession_get_id(m_pHandle);
}
bool SipSession::setWebSocketSrc(const char* host, int32_t port, const char* proto)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_WEBSOCKET_SRC(host, port, proto),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_WEBSOCKET_SRC(host, port, proto),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
const SipStack* SipSession::getStack()const
{
- return m_pStack;
+ return m_pStack;
}
/* ======================== InviteSession ========================*/
InviteSession::InviteSession(SipStack* pStack)
-: SipSession(pStack), m_pMediaMgr(tsk_null)
+ : SipSession(pStack), m_pMediaMgr(tsk_null)
{
}
InviteSession::InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle), m_pMediaMgr(tsk_null)
+ : SipSession(pStack, pHandle), m_pMediaMgr(tsk_null)
{
}
InviteSession::~InviteSession()
{
- if(m_pMediaMgr){
- delete m_pMediaMgr, m_pMediaMgr = tsk_null;
- }
+ if(m_pMediaMgr) {
+ delete m_pMediaMgr, m_pMediaMgr = tsk_null;
+ }
}
bool InviteSession::hangup(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_bye(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_bye(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::sendInfo(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_invite_send_info(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_invite_send_info(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_invite_send_info(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_invite_send_info(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
const MediaSessionMgr* InviteSession::getMediaMgr()
{
- if(!m_pMediaMgr && m_pHandle){
- tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(m_pHandle);
- if(mgr){
- m_pMediaMgr = new MediaSessionMgr(mgr); // new() it's not yours: see "m_pMediaMgr" which is destroy in the destructor()
- tsk_object_unref(mgr);
- }
- else{
- TSK_DEBUG_WARN("No media session associated to this session");
- }
- }
- return m_pMediaMgr;
+ if(!m_pMediaMgr && m_pHandle) {
+ tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(m_pHandle);
+ if(mgr) {
+ m_pMediaMgr = new MediaSessionMgr(mgr); // new() it's not yours: see "m_pMediaMgr" which is destroy in the destructor()
+ tsk_object_unref(mgr);
+ }
+ else {
+ TSK_DEBUG_WARN("No media session associated to this session");
+ }
+ }
+ return m_pMediaMgr;
}
/* ======================== CallSession ========================*/
CallSession::CallSession(SipStack* Stack)
-: InviteSession(Stack)
+ : InviteSession(Stack)
{
}
CallSession::CallSession(SipStack* Stack, tsip_ssession_handle_t* handle)
-: InviteSession(Stack, handle)
-, m_pT140Callback(tsk_null)
-, m_pRtcpCallback(tsk_null)
+ : InviteSession(Stack, handle)
+ , m_pT140Callback(tsk_null)
+ , m_pRtcpCallback(tsk_null)
{
}
@@ -306,423 +305,423 @@ CallSession::~CallSession()
/* @deprecated */
bool CallSession::callAudio(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_audio, config);
+ return call(remoteUri, twrap_media_audio, config);
}
/* @deprecated */
bool CallSession::callAudio(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_audio, config);
+ return call(remoteUriString, twrap_media_audio, config);
}
/* @deprecated */
bool CallSession::callAudioVideo(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_audio_video, config);
+ return call(remoteUri, twrap_media_audio_video, config);
}
/* @deprecated */
bool CallSession::callAudioVideo(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_audio_video, config);
+ return call(remoteUriString, twrap_media_audio_video, config);
}
/* @deprecated */
bool CallSession::callVideo(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_video, config);
+ return call(remoteUri, twrap_media_video, config);
}
/* @deprecated */
bool CallSession::callVideo(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_video, config);
+ return call(remoteUriString, twrap_media_video, config);
}
bool CallSession::call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config/*=tsk_null*/)
{
-
- SipUri sipUri(remoteUriString);
- if(sipUri.isValid()){
- return call(&sipUri, media, config);
- }
- TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
- return false;
+
+ SipUri sipUri(remoteUriString);
+ if(sipUri.isValid()) {
+ return call(&sipUri, media, config);
+ }
+ TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
+ return false;
}
bool CallSession::call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config/*=tsk_null*/)
{
- if(!remoteUri){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL());
+ if(!remoteUri) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL());
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_invite(m_pHandle, twrap_get_native_media_type(media),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_invite(m_pHandle, twrap_get_native_media_type(media),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::setSupportedCodecs(int32_t codecs)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_CODECS(codecs),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_CODECS(codecs),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
int32_t CallSession::getNegotiatedCodecs()
{
- return (int32_t) tsip_ssession_get_codecs_neg(m_pHandle);
+ return (int32_t) tsip_ssession_get_codecs_neg(m_pHandle);
}
bool CallSession::setMediaSSRC(twrap_media_type_t media, uint32_t ssrc)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTP_SSRC(twrap_get_native_media_type(media), ssrc),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTP_SSRC(twrap_get_native_media_type(media), ssrc),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSessionTimer(unsigned timeout, const char* refresher)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_TIMERS(timeout, refresher),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_TIMERS(timeout, refresher),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::set100rel(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_100rel(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_100rel(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setRtcp(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTCP(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
-
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTCP(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
+
}
bool CallSession::setRtcpMux(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTCPMUX(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTCPMUX(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSRtpMode(enum tmedia_srtp_mode_e mode)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_SRTP_MODE(mode),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_SRTP_MODE(mode),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setAvpfMode(enum tmedia_mode_e mode)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_AVPF_MODE(mode),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_AVPF_MODE(mode),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICE(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICEStun(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE_STUN(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE_STUN(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICETurn(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE_TURN(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE_TURN(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSTUNServer(const char* hostname, uint16_t port)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_STUN_SERVER(hostname, port),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_STUN_SERVER(hostname, port),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSTUNCred(const char* username, const char* password)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_STUN_CRED(username, password),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_STUN_CRED(username, password),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoFps(int32_t fps)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_FPS(fps),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_FPS(fps),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoBandwidthUploadMax(int32_t max)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_BW_UP(max),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_BW_UP(max),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoBandwidthDownloadMax(int32_t max)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_BW_DOWN(max),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_BW_DOWN(max),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoPrefSize(tmedia_pref_video_size_t pref_video_size)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_PREFSIZE(pref_video_size),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_PREFSIZE(pref_video_size),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_QOS(type, strength),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_QOS(type, strength),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::hold(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_hold(m_pHandle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) ==0 );
+ return (tsip_api_invite_send_hold(m_pHandle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) ==0 );
}
bool CallSession::resume(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_resume(m_pHandle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_resume(m_pHandle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::transfer(const char* referToUriString, ActionConfig* config/*=tsk_null*/)
{
- if(tsk_strnullORempty(referToUriString)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
-
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect(m_pHandle, referToUriString,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ if(tsk_strnullORempty(referToUriString)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect(m_pHandle, referToUriString,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::acceptTransfer(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::rejectTransfer(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::sendDTMF(int number)
{
- return (tsip_api_invite_send_dtmf(m_pHandle, number,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_dtmf(m_pHandle, number,
+ TSIP_ACTION_SET_NULL()) == 0);
}
unsigned CallSession::getSessionTransferId()
{
- return (unsigned)tsip_ssession_get_id_parent(m_pHandle);
+ return (unsigned)tsip_ssession_get_id_parent(m_pHandle);
}
bool CallSession::sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr /*= NULL*/, unsigned data_size /*= 0*/)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- return (tmedia_session_mgr_send_t140_data((tmedia_session_mgr_t*)pWrappedMgr, data_type, data_ptr, data_size) == 0);
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ return (tmedia_session_mgr_send_t140_data((tmedia_session_mgr_t*)pWrappedMgr, data_type, data_ptr, data_size) == 0);
+ }
+ return false;
}
bool CallSession::setT140Callback(const T140Callback* pT140Callback)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- if((m_pT140Callback = pT140Callback)){
- return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, &CallSession::t140OnDataCallback) == 0);
- }
- else{
- return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, tsk_null) == 0);
- }
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ if((m_pT140Callback = pT140Callback)) {
+ return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, &CallSession::t140OnDataCallback) == 0);
+ }
+ else {
+ return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, tsk_null) == 0);
+ }
+ }
+ return false;
}
bool CallSession::sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media /*= 0*/)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- return (tmedia_session_mgr_send_rtcp_event((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), event_type, ssrc_media) == 0);
- }
- TSK_DEBUG_ERROR("No media manager");
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ return (tmedia_session_mgr_send_rtcp_event((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), event_type, ssrc_media) == 0);
+ }
+ TSK_DEBUG_ERROR("No media manager");
+ return false;
}
bool CallSession::setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- if((m_pRtcpCallback = pRtcpCallback)){
- return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, &CallSession::rtcpOnCallback) == 0);
- }
- else{
- return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, tsk_null) == 0);
- }
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ if((m_pRtcpCallback = pRtcpCallback)) {
+ return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, &CallSession::rtcpOnCallback) == 0);
+ }
+ else {
+ return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, tsk_null) == 0);
+ }
+ }
+ return false;
}
const T140Callback* CallSession::getT140Callback() const
{
- return m_pT140Callback;
+ return m_pT140Callback;
}
int CallSession::t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
- if(session && session->getT140Callback()){
- T140CallbackData* dataObj = new T140CallbackData(data_type, data_ptr, data_size);
- if(dataObj){
- int ret = const_cast<T140Callback*>(session->getT140Callback())->ondata(dataObj);
- delete dataObj;
- return ret;
- }
- }
- return 0;
+ const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
+ if(session && session->getT140Callback()) {
+ T140CallbackData* dataObj = new T140CallbackData(data_type, data_ptr, data_size);
+ if(dataObj) {
+ int ret = const_cast<T140Callback*>(session->getT140Callback())->ondata(dataObj);
+ delete dataObj;
+ return ret;
+ }
+ }
+ return 0;
}
const RtcpCallback* CallSession::getRtcpCallback() const
{
- return m_pRtcpCallback;
+ return m_pRtcpCallback;
}
int CallSession::rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media)
{
- const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
- if(session && session->getRtcpCallback()){
- RtcpCallbackData* dataObj = new RtcpCallbackData(event_type, ssrc_media);
- if(dataObj){
- int ret = const_cast<RtcpCallback*>(session->getRtcpCallback())->onevent(dataObj);
- delete dataObj;
- return ret;
- }
- }
- TSK_DEBUG_INFO("Not Sending RTCP packet (no callback)");
- return 0;
+ const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
+ if(session && session->getRtcpCallback()) {
+ RtcpCallbackData* dataObj = new RtcpCallbackData(event_type, ssrc_media);
+ if(dataObj) {
+ int ret = const_cast<RtcpCallback*>(session->getRtcpCallback())->onevent(dataObj);
+ delete dataObj;
+ return ret;
+ }
+ }
+ TSK_DEBUG_INFO("Not Sending RTCP packet (no callback)");
+ return 0;
}
/* ======================== MsrpSession ========================*/
MsrpSession::MsrpSession(SipStack* pStack, MsrpCallback* pCallback)
-: InviteSession(pStack), m_pCallback(pCallback)
+ : InviteSession(pStack), m_pCallback(pCallback)
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL());
}
MsrpSession::MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: InviteSession(pStack, pHandle), m_pCallback(tsk_null)
+ : InviteSession(pStack, pHandle), m_pCallback(tsk_null)
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL());
}
MsrpSession::~MsrpSession()
@@ -731,60 +730,60 @@ MsrpSession::~MsrpSession()
bool MsrpSession::setCallback(MsrpCallback* pCallback)
{
- m_pCallback = pCallback;
- return true;
+ m_pCallback = pCallback;
+ return true;
}
bool MsrpSession::callMsrp(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- if(!remoteUri){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(!remoteUri) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL());
- return (tsip_api_invite_send_invite(m_pHandle, tmedia_msrp,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_invite(m_pHandle, tmedia_msrp,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MsrpSession::callMsrp(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- SipUri sipUri(remoteUriString);
- if(sipUri.isValid()){
- return callMsrp(&sipUri, config);
- }
- TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
- return false;
+ SipUri sipUri(remoteUriString);
+ if(sipUri.isValid()) {
+ return callMsrp(&sipUri, config);
+ }
+ TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
+ return false;
}
bool MsrpSession::sendMessage(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_large_message(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_large_message(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MsrpSession::sendFile(ActionConfig* config/*=tsk_null*/)
{
- return false;
+ return false;
}
/* ======================== MessagingSession ========================*/
MessagingSession::MessagingSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
MessagingSession::MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -794,47 +793,47 @@ MessagingSession::~MessagingSession()
bool MessagingSession::send(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_message_send_message(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_message_send_message(m_pHandle,
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_message_send_message(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_message_send_message(m_pHandle,
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool MessagingSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MessagingSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== InfoSession ========================*/
InfoSession::InfoSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
InfoSession::InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -844,35 +843,35 @@ InfoSession::~InfoSession()
bool InfoSession::send(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_info_send_info(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_info_send_info(m_pHandle,
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_info_send_info(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_info_send_info(m_pHandle,
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool InfoSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InfoSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
@@ -880,12 +879,12 @@ bool InfoSession::reject(ActionConfig* config/*=tsk_null*/)
/* ======================== OptionsSession ========================*/
OptionsSession::OptionsSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
OptionsSession::OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -894,27 +893,27 @@ OptionsSession::~OptionsSession()
}
bool OptionsSession::send(ActionConfig* config/*=tsk_null*/)
-{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_options_send_options(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+{
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_options_send_options(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool OptionsSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool OptionsSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
@@ -922,12 +921,12 @@ bool OptionsSession::reject(ActionConfig* config/*=tsk_null*/)
/* ======================== PublicationSession ========================*/
PublicationSession::PublicationSession(SipStack* Stack)
-: SipSession(Stack)
+ : SipSession(Stack)
{
}
PublicationSession::PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -938,39 +937,39 @@ PublicationSession::~PublicationSession()
bool PublicationSession::publish(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_publish_send_publish(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_publish_send_publish(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_publish_send_publish(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_publish_send_publish(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool PublicationSession::unPublish(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_publish_send_unpublish(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_publish_send_unpublish(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== RegistrationSession ========================*/
RegistrationSession::RegistrationSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
RegistrationSession::RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -981,47 +980,47 @@ RegistrationSession::~RegistrationSession()
bool RegistrationSession::register_(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_register_send_register(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_register_send_register(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::unRegister(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_register_send_unregister(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_register_send_unregister(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== SubscriptionSession ========================*/
SubscriptionSession::SubscriptionSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
SubscriptionSession::SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -1033,12 +1032,12 @@ SubscriptionSession::~SubscriptionSession()
bool SubscriptionSession::subscribe()
{
- return (tsip_api_subscribe_send_subscribe(m_pHandle,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_subscribe_send_subscribe(m_pHandle,
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool SubscriptionSession::unSubscribe()
{
- return (tsip_api_subscribe_send_unsubscribe(m_pHandle,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_subscribe_send_unsubscribe(m_pHandle,
+ TSIP_ACTION_SET_NULL()) == 0);
}
diff --git a/bindings/_common/SipSession.h b/bindings/_common/SipSession.h
index 7a0963b..a77418d 100755
--- a/bindings/_common/SipSession.h
+++ b/bindings/_common/SipSession.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,63 +34,77 @@ class MsrpCallback;
class MediaSessionMgr;
/* ======================== T140Callback ========================*/
-class TINYWRAP_API T140CallbackData{
- public:
+class TINYWRAP_API T140CallbackData
+{
+public:
#if !defined(SWIG)
- T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size){
- m_eType = data_type;
- m_pPtr = data_ptr;
- m_nSize = data_size;
- }
+ T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size) {
+ m_eType = data_type;
+ m_pPtr = data_ptr;
+ m_nSize = data_size;
+ }
#endif
- virtual ~T140CallbackData(){}
-
- inline enum tmedia_t140_data_type_e getType()const{ return m_eType; }
- inline unsigned getSize()const{ return m_nSize; }
- inline unsigned getData(void* pOutput, unsigned nMaxsize)const{
- unsigned nRetsize = 0;
- if(pOutput && nMaxsize && m_pPtr){
- nRetsize = (m_nSize > nMaxsize) ? nMaxsize : m_nSize;
- memcpy(pOutput, m_pPtr, nRetsize);
- }
- return nRetsize;
- }
-
- private:
- enum tmedia_t140_data_type_e m_eType;
- const void* m_pPtr;
- unsigned m_nSize;
+ virtual ~T140CallbackData() {}
+
+ inline enum tmedia_t140_data_type_e getType()const {
+ return m_eType;
+ }
+ inline unsigned getSize()const {
+ return m_nSize;
+ }
+ inline unsigned getData(void* pOutput, unsigned nMaxsize)const {
+ unsigned nRetsize = 0;
+ if(pOutput && nMaxsize && m_pPtr) {
+ nRetsize = (m_nSize > nMaxsize) ? nMaxsize : m_nSize;
+ memcpy(pOutput, m_pPtr, nRetsize);
+ }
+ return nRetsize;
+ }
+
+private:
+ enum tmedia_t140_data_type_e m_eType;
+ const void* m_pPtr;
+ unsigned m_nSize;
};
class TINYWRAP_API T140Callback
{
public:
- T140Callback() {}
- virtual ~T140Callback(){}
- virtual int ondata(const T140CallbackData* pData){ return 0; }
+ T140Callback() {}
+ virtual ~T140Callback() {}
+ virtual int ondata(const T140CallbackData* pData) {
+ return 0;
+ }
};
#if !defined(SWIG)
-class RtcpCallbackData{
- public:
- RtcpCallbackData(enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media){
- m_eType = event_type;
- m_nSSRC = ssrc_media;
- }
- virtual ~RtcpCallbackData(){}
- inline enum tmedia_rtcp_event_type_e getType()const{ return m_eType; }
- inline uint32_t getSSRC()const{ return m_nSSRC; }
- private:
- enum tmedia_rtcp_event_type_e m_eType;
- uint32_t m_nSSRC;
+class RtcpCallbackData
+{
+public:
+ RtcpCallbackData(enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media) {
+ m_eType = event_type;
+ m_nSSRC = ssrc_media;
+ }
+ virtual ~RtcpCallbackData() {}
+ inline enum tmedia_rtcp_event_type_e getType()const {
+ return m_eType;
+ }
+ inline uint32_t getSSRC()const {
+ return m_nSSRC;
+ }
+private:
+ enum tmedia_rtcp_event_type_e m_eType;
+ uint32_t m_nSSRC;
};
class TINYWRAP_API RtcpCallback
{
public:
- RtcpCallback() {}
- virtual ~RtcpCallback(){}
- virtual int onevent(const RtcpCallbackData* e){ return 0; }
+ RtcpCallback() {}
+ virtual ~RtcpCallback() {}
+ virtual int onevent(const RtcpCallbackData* e) {
+ return 0;
+ }
};
#endif /* #if !defined(SWIG) */
@@ -100,65 +114,67 @@ public:
class TINYWRAP_API SipSession
{
public:
- SipSession(SipStack* stack);
+ SipSession(SipStack* stack);
#if !defined(SWIG)
- SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle);
+ SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~SipSession();
+ virtual ~SipSession();
public:
- bool haveOwnership();
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool addCaps(const char* name, const char* value);
- bool addCaps(const char* name);
- bool removeCaps(const char* name);
- bool setExpires(unsigned expires);
- bool setFromUri(const char* fromUriString);
- bool setFromUri(const SipUri* fromUri);
- bool setToUri(const char* toUriString);
- bool setToUri(const SipUri* toUri);
- bool setSilentHangup(bool silent);
- bool addSigCompCompartment(const char* compId);
- bool removeSigCompCompartment();
+ bool haveOwnership();
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool addCaps(const char* name, const char* value);
+ bool addCaps(const char* name);
+ bool removeCaps(const char* name);
+ bool setExpires(unsigned expires);
+ bool setFromUri(const char* fromUriString);
+ bool setFromUri(const SipUri* fromUri);
+ bool setToUri(const char* toUriString);
+ bool setToUri(const SipUri* toUri);
+ bool setSilentHangup(bool silent);
+ bool addSigCompCompartment(const char* compId);
+ bool removeSigCompCompartment();
#if !defined(SWIG)
- bool setAuth(const char* authHa1, const char* authIMPI);
+ bool setAuth(const char* authHa1, const char* authIMPI);
#endif
- unsigned getId()const;
+ unsigned getId()const;
#if !defined(SWIG)
- bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
- const SipStack* getStack() const;
- const tsip_ssession_handle_t* getWrappedSession() { return m_pHandle; }
+ bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
+ const SipStack* getStack() const;
+ const tsip_ssession_handle_t* getWrappedSession() {
+ return m_pHandle;
+ }
#endif
-
+
private:
- void init(SipStack* stack, tsip_ssession_handle_t* pHandle=tsk_null);
+ void init(SipStack* stack, tsip_ssession_handle_t* pHandle=tsk_null);
protected:
- tsip_ssession_handle_t* m_pHandle;
- const SipStack* m_pStack;
+ tsip_ssession_handle_t* m_pHandle;
+ const SipStack* m_pStack;
};
/* ======================== InviteSession ========================*/
class TINYWRAP_API InviteSession : public SipSession
{
public: /* ctor() and dtor() */
- InviteSession(SipStack* Stack);
+ InviteSession(SipStack* Stack);
#if !defined(SWIG)
- InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~InviteSession();
+ virtual ~InviteSession();
public: /* Public functions */
- bool accept(ActionConfig* config=tsk_null);
- bool hangup(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
- bool sendInfo(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- const MediaSessionMgr* getMediaMgr();
+ bool accept(ActionConfig* config=tsk_null);
+ bool hangup(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
+ bool sendInfo(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ const MediaSessionMgr* getMediaMgr();
private:
- MediaSessionMgr* m_pMediaMgr;
+ MediaSessionMgr* m_pMediaMgr;
};
@@ -166,92 +182,92 @@ private:
class TINYWRAP_API CallSession : public InviteSession
{
public: /* ctor() and dtor() */
- CallSession(SipStack* pStack);
+ CallSession(SipStack* pStack);
#if !defined(SWIG)
- CallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ CallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~CallSession();
+ virtual ~CallSession();
public: /* Public functions */
- bool callAudio(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudio(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudioVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudioVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
- bool callVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
-
- bool call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config=tsk_null);
- bool call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config=tsk_null);
+ bool callAudio(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudio(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudioVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudioVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+
+ bool call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config=tsk_null);
+ bool call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config=tsk_null);
#if !defined(SWIG)
- bool setSupportedCodecs(int32_t codecs);
- int32_t getNegotiatedCodecs();
- bool setMediaSSRC(twrap_media_type_t media, uint32_t ssrc);
+ bool setSupportedCodecs(int32_t codecs);
+ int32_t getNegotiatedCodecs();
+ bool setMediaSSRC(twrap_media_type_t media, uint32_t ssrc);
#endif
- bool setSessionTimer(unsigned timeout, const char* refresher);
- bool set100rel(bool enabled);
- bool setRtcp(bool enabled);
- bool setRtcpMux(bool enabled);
- bool setSRtpMode(enum tmedia_srtp_mode_e mode);
- bool setAvpfMode(enum tmedia_mode_e mode);
- bool setICE(bool enabled);
- bool setICEStun(bool enabled);
- bool setICETurn(bool enabled);
- bool setSTUNServer(const char* hostname, uint16_t port);
- bool setSTUNCred(const char* username, const char* password);
- bool setVideoFps(int32_t fps);
- bool setVideoBandwidthUploadMax(int32_t max);
- bool setVideoBandwidthDownloadMax(int32_t max);
- bool setVideoPrefSize(tmedia_pref_video_size_t pref_video_size);
- bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
- bool hold(ActionConfig* config=tsk_null);
- bool resume(ActionConfig* config=tsk_null);
- bool transfer(const char* referToUriString, ActionConfig* config=tsk_null);
- bool acceptTransfer(ActionConfig* config=tsk_null);
- bool rejectTransfer(ActionConfig* config=tsk_null);
- bool sendDTMF(int number);
- unsigned getSessionTransferId();
- bool sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr = NULL, unsigned data_size = 0);
- bool setT140Callback(const T140Callback* pT140Callback);
+ bool setSessionTimer(unsigned timeout, const char* refresher);
+ bool set100rel(bool enabled);
+ bool setRtcp(bool enabled);
+ bool setRtcpMux(bool enabled);
+ bool setSRtpMode(enum tmedia_srtp_mode_e mode);
+ bool setAvpfMode(enum tmedia_mode_e mode);
+ bool setICE(bool enabled);
+ bool setICEStun(bool enabled);
+ bool setICETurn(bool enabled);
+ bool setSTUNServer(const char* hostname, uint16_t port);
+ bool setSTUNCred(const char* username, const char* password);
+ bool setVideoFps(int32_t fps);
+ bool setVideoBandwidthUploadMax(int32_t max);
+ bool setVideoBandwidthDownloadMax(int32_t max);
+ bool setVideoPrefSize(tmedia_pref_video_size_t pref_video_size);
+ bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
+ bool hold(ActionConfig* config=tsk_null);
+ bool resume(ActionConfig* config=tsk_null);
+ bool transfer(const char* referToUriString, ActionConfig* config=tsk_null);
+ bool acceptTransfer(ActionConfig* config=tsk_null);
+ bool rejectTransfer(ActionConfig* config=tsk_null);
+ bool sendDTMF(int number);
+ unsigned getSessionTransferId();
+ bool sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr = NULL, unsigned data_size = 0);
+ bool setT140Callback(const T140Callback* pT140Callback);
#if !defined(SWIG)
- bool sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media = 0);
- bool setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type);
- const T140Callback* getT140Callback() const;
- static int t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
- const RtcpCallback* getRtcpCallback() const;
- static int rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
+ bool sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media = 0);
+ bool setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type);
+ const T140Callback* getT140Callback() const;
+ static int t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
+ const RtcpCallback* getRtcpCallback() const;
+ static int rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
#endif /* #if !defined(SWIG) */
private:
- const T140Callback* m_pT140Callback;
- const RtcpCallback* m_pRtcpCallback;
+ const T140Callback* m_pT140Callback;
+ const RtcpCallback* m_pRtcpCallback;
};
/* ======================== MsrpSession ========================*/
class TINYWRAP_API MsrpSession : public InviteSession
{
public: /* ctor() and dtor() */
- MsrpSession(SipStack* pStack, MsrpCallback* pCallback);
+ MsrpSession(SipStack* pStack, MsrpCallback* pCallback);
#if !defined(SWIG)
- MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~MsrpSession();
+ virtual ~MsrpSession();
public: /* Public functions */
- bool setCallback(MsrpCallback* pCallback);
- bool callMsrp(const char* remoteUriString, ActionConfig* config=tsk_null);
- bool callMsrp(const SipUri* remoteUri, ActionConfig* config=tsk_null);
- bool sendMessage(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool sendFile(ActionConfig* config=tsk_null);
+ bool setCallback(MsrpCallback* pCallback);
+ bool callMsrp(const char* remoteUriString, ActionConfig* config=tsk_null);
+ bool callMsrp(const SipUri* remoteUri, ActionConfig* config=tsk_null);
+ bool sendMessage(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool sendFile(ActionConfig* config=tsk_null);
- public: /* Public helper function */
+public: /* Public helper function */
#if !defined(SWIG)
- inline MsrpCallback* getCallback()const{
- return m_pCallback;
- }
+ inline MsrpCallback* getCallback()const {
+ return m_pCallback;
+ }
#endif
private:
- MsrpCallback* m_pCallback;
+ MsrpCallback* m_pCallback;
};
@@ -260,48 +276,48 @@ private:
class TINYWRAP_API MessagingSession : public SipSession
{
public: /* ctor() and dtor() */
- MessagingSession(SipStack* pStack);
+ MessagingSession(SipStack* pStack);
#if !defined(SWIG)
- MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~MessagingSession();
+ virtual ~MessagingSession();
public: /* Public functions */
- bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
/* ======================== InfoSession ========================*/
class TINYWRAP_API InfoSession : public SipSession
{
public: /* ctor() and dtor() */
- InfoSession(SipStack* pStack);
+ InfoSession(SipStack* pStack);
#if !defined(SWIG)
- InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~InfoSession();
+ virtual ~InfoSession();
public: /* Public functions */
- bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
/* ======================== OptionsSession ========================*/
class TINYWRAP_API OptionsSession : public SipSession
{
public: /* ctor() and dtor() */
- OptionsSession(SipStack* pStack);
+ OptionsSession(SipStack* pStack);
#if !defined(SWIG)
- OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~OptionsSession();
+ virtual ~OptionsSession();
public: /* Public functions */
- bool send(ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
@@ -310,15 +326,15 @@ public: /* Public functions */
class TINYWRAP_API PublicationSession : public SipSession
{
public: /* ctor() and dtor() */
- PublicationSession(SipStack* pStack);
+ PublicationSession(SipStack* pStack);
#if !defined(SWIG)
- PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~PublicationSession();
+ virtual ~PublicationSession();
public: /* Public functions */
- bool publish(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool unPublish(ActionConfig* config=tsk_null);
+ bool publish(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool unPublish(ActionConfig* config=tsk_null);
};
@@ -326,17 +342,17 @@ public: /* Public functions */
class TINYWRAP_API RegistrationSession : public SipSession
{
public: /* ctor() and dtor() */
- RegistrationSession(SipStack* pStack);
+ RegistrationSession(SipStack* pStack);
#if !defined(SWIG)
- RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~RegistrationSession();
+ virtual ~RegistrationSession();
public: /* Public functions */
- bool register_(ActionConfig* config=tsk_null);
- bool unRegister(ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool register_(ActionConfig* config=tsk_null);
+ bool unRegister(ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
@@ -344,15 +360,15 @@ public: /* Public functions */
class TINYWRAP_API SubscriptionSession : public SipSession
{
public: /* ctor() and dtor() */
- SubscriptionSession(SipStack* pStack);
+ SubscriptionSession(SipStack* pStack);
#if !defined(SWIG)
- SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~SubscriptionSession();
+ virtual ~SubscriptionSession();
public: /* Public functions */
- bool subscribe();
- bool unSubscribe();
+ bool subscribe();
+ bool unSubscribe();
};
#endif /* TINYWRAP_SIPSESSION_H */
diff --git a/bindings/_common/SipStack.cxx b/bindings/_common/SipStack.cxx
index 5ec3680..66def3b 100755
--- a/bindings/_common/SipStack.cxx
+++ b/bindings/_common/SipStack.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,585 +36,586 @@ static int stack_callback(const tsip_event_t *sipevent);
static int session_handle_event(const tsip_event_t *sipevent);
SipStack::SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri)
-:SafeObject()
+ :SafeObject()
{
- m_pDebugCallback = tsk_null;
- m_pCallback = pCallback;
+ m_pDebugCallback = tsk_null;
+ m_pCallback = pCallback;
- /* Initialize network and media layers */
- if(!SipStack::initialize()){
- return;// isValid() will be false
- }
+ /* Initialize network and media layers */
+ if(!SipStack::initialize()) {
+ return;// isValid() will be false
+ }
- /* Creates stack handle */
- m_pHandle = tsip_stack_create(stack_callback, realm_uri, impi_uri, impu_uri,
- TSIP_STACK_SET_USERDATA(this), /* used as context (useful for server-initiated requests) */
- TSIP_STACK_SET_NULL());
+ /* Creates stack handle */
+ m_pHandle = tsip_stack_create(stack_callback, realm_uri, impi_uri, impu_uri,
+ TSIP_STACK_SET_USERDATA(this), /* used as context (useful for server-initiated requests) */
+ TSIP_STACK_SET_NULL());
}
SipStack::~SipStack()
{
- this->stop();
+ this->stop();
- /* Destroy stack handle */
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ /* Destroy stack handle */
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
bool SipStack::start()
{
- bool ret = (tsip_stack_start(m_pHandle) == 0);
- return ret;
+ bool ret = (tsip_stack_start(m_pHandle) == 0);
+ return ret;
}
bool SipStack::setDebugCallback(DDebugCallback* pCallback)
{
- if(this && pCallback){
- m_pDebugCallback = pCallback;
- tsk_debug_set_arg_data(this);
- tsk_debug_set_info_cb(DDebugCallback::debug_info_cb);
- tsk_debug_set_warn_cb(DDebugCallback::debug_warn_cb);
- tsk_debug_set_error_cb(DDebugCallback::debug_error_cb);
- tsk_debug_set_fatal_cb(DDebugCallback::debug_fatal_cb);
- }
- else if(this){
- m_pDebugCallback = tsk_null;
- tsk_debug_set_arg_data(tsk_null);
- tsk_debug_set_info_cb(tsk_null);
- tsk_debug_set_warn_cb(tsk_null);
- tsk_debug_set_error_cb(tsk_null);
- tsk_debug_set_fatal_cb(tsk_null);
- }
-
- return true;
+ if(this && pCallback) {
+ m_pDebugCallback = pCallback;
+ tsk_debug_set_arg_data(this);
+ tsk_debug_set_info_cb(DDebugCallback::debug_info_cb);
+ tsk_debug_set_warn_cb(DDebugCallback::debug_warn_cb);
+ tsk_debug_set_error_cb(DDebugCallback::debug_error_cb);
+ tsk_debug_set_fatal_cb(DDebugCallback::debug_fatal_cb);
+ }
+ else if(this) {
+ m_pDebugCallback = tsk_null;
+ tsk_debug_set_arg_data(tsk_null);
+ tsk_debug_set_info_cb(tsk_null);
+ tsk_debug_set_warn_cb(tsk_null);
+ tsk_debug_set_error_cb(tsk_null);
+ tsk_debug_set_fatal_cb(tsk_null);
+ }
+
+ return true;
}
bool SipStack::setDisplayName(const char* display_name)
{
- int ret = tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DISPLAY_NAME(display_name),
- TSIP_STACK_SET_NULL());
- return (ret == 0);
+ int ret = tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DISPLAY_NAME(display_name),
+ TSIP_STACK_SET_NULL());
+ return (ret == 0);
}
bool SipStack::setRealm(const char* realm_uri)
{
- int ret = tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_REALM(realm_uri),
- TSIP_STACK_SET_NULL());
- return (ret == 0);
+ int ret = tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_REALM(realm_uri),
+ TSIP_STACK_SET_NULL());
+ return (ret == 0);
}
bool SipStack::setIMPI(const char* impi)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMPI(impi),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMPI(impi),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIMPU(const char* impu_uri)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMPU(impu_uri),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMPU(impu_uri),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setPassword(const char* password)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_PASSWORD(password),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_PASSWORD(password),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setAMF(const char* amf)
{
- uint16_t _amf = (uint16_t)tsk_atox(amf);
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMS_AKA_AMF(_amf),
- TSIP_STACK_SET_NULL()) == 0);
+ uint16_t _amf = (uint16_t)tsk_atox(amf);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMS_AKA_AMF(_amf),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setOperatorId(const char* opid)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMS_AKA_OPERATOR_ID(opid),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMS_AKA_OPERATOR_ID(opid),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion)
{
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_PROXY_CSCF(fqdn, _port, transport, ipversion),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_PROXY_CSCF(fqdn, _port, transport, ipversion),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setLocalIP(const char* ip, const char* transport/*=tsk_null*/)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_LOCAL_IP_2(transport, ip),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_LOCAL_IP_2(transport, ip),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setLocalPort(unsigned short port, const char* transport/*=tsk_null*/)
{
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_LOCAL_PORT_2(transport, _port),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_LOCAL_PORT_2(transport, _port),
+ TSIP_STACK_SET_NULL()) == 0);
}
-bool SipStack::setEarlyIMS(bool enabled){
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_EARLY_IMS(enabled? tsk_true : tsk_false),
- TSIP_STACK_SET_NULL()) == 0);
+bool SipStack::setEarlyIMS(bool enabled)
+{
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_EARLY_IMS(enabled? tsk_true : tsk_false),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addHeader(const char* name, const char* value)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_HEADER(name, value),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_HEADER(name, value),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::removeHeader(const char* name)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_UNSET_HEADER(name),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_UNSET_HEADER(name),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addDnsServer(const char* ip)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DNS_SERVER(ip),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DNS_SERVER(ip),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setDnsDiscovery(bool enabled)
{
- tsk_bool_t _enabled = enabled;// 32bit/64bit workaround
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DISCOVERY_NAPTR(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled;// 32bit/64bit workaround
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DISCOVERY_NAPTR(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setAoR(const char* ip, int port)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_AOR(ip, port),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_AOR(ip, port),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setMode(enum tsip_stack_mode_e mode)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_MODE(mode),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_MODE(mode),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict)
{
- tsk_bool_t _enablePresDict= enablePresDict;// 32bit/64bit workaround
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SIGCOMP(dms, sms, cpb, _enablePresDict),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enablePresDict= enablePresDict;// 32bit/64bit workaround
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SIGCOMP(dms, sms, cpb, _enablePresDict),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addSigCompCompartment(const char* compId)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(compId),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(compId),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::removeSigCompCompartment(const char* compId)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT(compId),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT(compId),
+ TSIP_STACK_SET_NULL()) == 0);
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNEnabledForICE(bool enabled)
{
#if 0
- tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_ICE_STUN_ENABLED(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_ICE_STUN_ENABLED(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_icestun_enabled(enabled ? tsk_true : tsk_false) == 0);
- // to set the value per session, use "CallSession::setICEStun()"
+ // set global value
+ return (tmedia_defaults_set_icestun_enabled(enabled ? tsk_true : tsk_false) == 0);
+ // to set the value per session, use "CallSession::setICEStun()"
#endif
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNServer(const char* hostname, unsigned short port)
{
#if 0
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_SERVER(hostname, _port),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_SERVER(hostname, _port),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_stun_server(hostname, port) == 0);
- // to set the value per session, use "CallSession::setSTUNServer()"
+ // set global value
+ return (tmedia_defaults_set_stun_server(hostname, port) == 0);
+ // to set the value per session, use "CallSession::setSTUNServer()"
#endif
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNCred(const char* login, const char* password)
{
#if 0
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_CRED(login, password),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_CRED(login, password),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_stun_cred(login, password) == 0);
- // to set the value per session, use "CallSession::setSTUNCred()"
+ // set global value
+ return (tmedia_defaults_set_stun_cred(login, password) == 0);
+ // to set the value per session, use "CallSession::setSTUNCred()"
#endif
}
bool SipStack::setSTUNEnabled(bool enabled)
{
- tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_ENABLED(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_ENABLED(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setTLSSecAgree(bool enabled)
{
- tsk_bool_t _enable = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SECAGREE_TLS(_enable),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enable = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SECAGREE_TLS(_enable),
+ TSIP_STACK_SET_NULL()) == 0);
}
/*@deprecated: typo */
bool SipStack::setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify/* = false*/)
{
- return setSSLCertificates(privKey, pubKey, caKey, verify);
+ return setSSLCertificates(privKey, pubKey, caKey, verify);
}
bool SipStack::setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify/* = false*/)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_TLS_CERTS_2(caKey, pubKey, privKey, (verify ? tsk_true : tsk_false)),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_TLS_CERTS_2(caKey, pubKey, privKey, (verify ? tsk_true : tsk_false)),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIPSecSecAgree(bool enabled)
{
- tsk_bool_t _enable = enabled;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SECAGREE_IPSEC(_enable),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enable = enabled;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SECAGREE_IPSEC(_enable),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IPSEC_PARAMS(algo, ealgo, mode, proto),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IPSEC_PARAMS(algo, ealgo, mode, proto),
+ TSIP_STACK_SET_NULL()) == 0);
}
char* SipStack::dnsENUM(const char* service, const char* e164num, const char* domain)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* uri = tsk_null;
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* uri = tsk_null;
- if(dnsctx){
- if(!(uri = tnet_dns_enum_2(dnsctx, service, e164num, domain))){
- TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
- }
- tsk_object_unref(dnsctx);
- return uri;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ if(dnsctx) {
+ if(!(uri = tnet_dns_enum_2(dnsctx, service, e164num, domain))) {
+ TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
+ }
+ tsk_object_unref(dnsctx);
+ return uri;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
char* SipStack::dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* ip = tsk_null;
- tnet_port_t port;
- *OUTPUT = 0;
-
-
- if(dnsctx){
- if(!tnet_dns_query_naptr_srv(dnsctx, domain, service, &ip, &port)){
- *OUTPUT = port;
- }
- tsk_object_unref(dnsctx);
- return ip;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* ip = tsk_null;
+ tnet_port_t port;
+ *OUTPUT = 0;
+
+
+ if(dnsctx) {
+ if(!tnet_dns_query_naptr_srv(dnsctx, domain, service, &ip, &port)) {
+ *OUTPUT = port;
+ }
+ tsk_object_unref(dnsctx);
+ return ip;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
char* SipStack::dnsSrv(const char* service, unsigned short* OUTPUT)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* ip = tsk_null;
- tnet_port_t port = 0;
- *OUTPUT = 0;
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* ip = tsk_null;
+ tnet_port_t port = 0;
+ *OUTPUT = 0;
- if(dnsctx){
- if(!tnet_dns_query_srv(dnsctx, service, &ip, &port)){
- *OUTPUT = port;
- }
- tsk_object_unref(dnsctx);
- return ip;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ if(dnsctx) {
+ if(!tnet_dns_query_srv(dnsctx, service, &ip, &port)) {
+ *OUTPUT = port;
+ }
+ tsk_object_unref(dnsctx);
+ return ip;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
bool SipStack::setMaxFDs(unsigned max_fds)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_MAX_FDS(max_fds),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_MAX_FDS(max_fds),
+ TSIP_STACK_SET_NULL()) == 0);
}
char* SipStack::getLocalIPnPort(const char* protocol, unsigned short* OUTPUT)
{
- tnet_ip_t ip;
- tnet_port_t port;
- int ret;
+ tnet_ip_t ip;
+ tnet_port_t port;
+ int ret;
- if(!OUTPUT || !protocol){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
+ if(!OUTPUT || !protocol) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
- if((ret = tsip_stack_get_local_ip_n_port(m_pHandle, protocol, &port, &ip))){
- TSK_DEBUG_ERROR("Failed to get local ip and port with error code=%d", ret);
- return tsk_null;
- }
+ if((ret = tsip_stack_get_local_ip_n_port(m_pHandle, protocol, &port, &ip))) {
+ TSK_DEBUG_ERROR("Failed to get local ip and port with error code=%d", ret);
+ return tsk_null;
+ }
- *OUTPUT = port;
- return tsk_strdup(ip); // See Swig %newobject
+ *OUTPUT = port;
+ return tsk_strdup(ip); // See Swig %newobject
}
char* SipStack::getPreferredIdentity()
{
- tsip_uri_t* ppid = tsip_stack_get_preferred_id(m_pHandle);
- char* str_ppid = tsk_null;
- if(ppid){
- str_ppid = tsip_uri_tostring(ppid, tsk_false, tsk_false);
- TSK_OBJECT_SAFE_FREE(ppid);
- }
- return str_ppid;
+ tsip_uri_t* ppid = tsip_stack_get_preferred_id(m_pHandle);
+ char* str_ppid = tsk_null;
+ if(ppid) {
+ str_ppid = tsip_uri_tostring(ppid, tsk_false, tsk_false);
+ TSK_OBJECT_SAFE_FREE(ppid);
+ }
+ return str_ppid;
}
bool SipStack::isValid()
{
- return (m_pHandle != tsk_null);
+ return (m_pHandle != tsk_null);
}
bool SipStack::stop()
{
- int ret = tsip_stack_stop(m_pHandle);
- return (ret == 0);
+ int ret = tsip_stack_stop(m_pHandle);
+ return (ret == 0);
}
bool SipStack::initialize()
{
- if (!g_bInitialized) {
- int ret;
-
- if((ret = tnet_startup())){
- TSK_DEBUG_ERROR("tnet_startup failed with error code=%d", ret);
- return false;
- }
- if((ret = thttp_startup())){
- TSK_DEBUG_ERROR("thttp_startup failed with error code=%d", ret);
- return false;
- }
- if((ret = tdav_init())){
- TSK_DEBUG_ERROR("tdav_init failed with error code=%d", ret);
- return false;
- }
- g_bInitialized = true;
- }
- return true;
+ if (!g_bInitialized) {
+ int ret;
+
+ if((ret = tnet_startup())) {
+ TSK_DEBUG_ERROR("tnet_startup failed with error code=%d", ret);
+ return false;
+ }
+ if((ret = thttp_startup())) {
+ TSK_DEBUG_ERROR("thttp_startup failed with error code=%d", ret);
+ return false;
+ }
+ if((ret = tdav_init())) {
+ TSK_DEBUG_ERROR("tdav_init failed with error code=%d", ret);
+ return false;
+ }
+ g_bInitialized = true;
+ }
+ return true;
}
bool SipStack::deInitialize()
{
- if (SipStack::g_bInitialized) {
- tdav_deinit();
- thttp_cleanup();
- tnet_cleanup();
- SipStack::g_bInitialized = false;
- }
- return false;
+ if (SipStack::g_bInitialized) {
+ tdav_deinit();
+ thttp_cleanup();
+ tnet_cleanup();
+ SipStack::g_bInitialized = false;
+ }
+ return false;
}
void SipStack::setCodecs(tdav_codec_id_t codecs)
{
- tdav_set_codecs(codecs);
+ tdav_set_codecs(codecs);
}
void SipStack::setCodecs_2(int64_t codecs) // For stupid languages
{
- SipStack::setCodecs((tdav_codec_id_t)codecs);
+ SipStack::setCodecs((tdav_codec_id_t)codecs);
}
bool SipStack::setCodecPriority(tdav_codec_id_t codec_id, int priority)
{
- return tdav_codec_set_priority(codec_id, priority) == 0;
+ return tdav_codec_set_priority(codec_id, priority) == 0;
}
bool SipStack::setCodecPriority_2(int codec_id, int priority)// For stupid languages
{
- return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
+ return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
}
bool SipStack::isCodecSupported(tdav_codec_id_t codec_id)
{
- return tdav_codec_is_supported(codec_id) ? true : false;
+ return tdav_codec_is_supported(codec_id) ? true : false;
}
bool SipStack::isIPSecSupported()
{
- return tdav_ipsec_is_supported() ? true : false;
+ return tdav_ipsec_is_supported() ? true : false;
}
static int stack_callback(const tsip_event_t *sipevent)
{
- int ret = 0;
- const SipStack* sipStack = tsk_null;
- SipEvent* e = tsk_null;
-
- if(!sipevent){ /* should never happen ...but who know? */
- TSK_DEBUG_WARN("Null SIP event.");
- return -1;
- }
- else {
- if(sipevent->type == tsip_event_stack && sipevent->userdata){
- /* sessionless event */
- sipStack = dyn_cast<const SipStack*>((const SipStack*)sipevent->userdata);
- }
- else {
- const void* userdata;
- /* gets the stack from the session */
- const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
- if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))){
- sipStack = dyn_cast<const SipStack*>((const SipStack*)userdata);
- }
- }
- }
-
- if(!sipStack){
- TSK_DEBUG_WARN("Invalid SIP event (Stack is Null).");
- return -2;
- }
-
- sipStack->Lock();
-
- switch(sipevent->type){
- case tsip_event_register:
- { /* REGISTER */
- if(sipStack->getCallback()){
- e = new RegistrationEvent(sipevent);
- sipStack->getCallback()->OnRegistrationEvent((const RegistrationEvent*)e);
- }
- break;
- }
- case tsip_event_invite:
- { /* INVITE */
- if(sipStack->getCallback()){
- e = new InviteEvent(sipevent);
- sipStack->getCallback()->OnInviteEvent((const InviteEvent*)e);
- }
- break;
- }
- case tsip_event_message:
- { /* MESSAGE */
- if(sipStack->getCallback()){
- e = new MessagingEvent(sipevent);
- sipStack->getCallback()->OnMessagingEvent((const MessagingEvent*)e);
- }
- break;
- }
- case tsip_event_info:
- { /* INFO */
- if(sipStack->getCallback()){
- e = new InfoEvent(sipevent);
- sipStack->getCallback()->OnInfoEvent((const InfoEvent*)e);
- }
- break;
- }
- case tsip_event_options:
- { /* OPTIONS */
- if(sipStack->getCallback()){
- e = new OptionsEvent(sipevent);
- sipStack->getCallback()->OnOptionsEvent((const OptionsEvent*)e);
- }
- break;
- }
- case tsip_event_publish:
- { /* PUBLISH */
- if(sipStack->getCallback()){
- e = new PublicationEvent(sipevent);
- sipStack->getCallback()->OnPublicationEvent((const PublicationEvent*)e);
- }
- break;
- }
- case tsip_event_subscribe:
- { /* SUBSCRIBE */
- if(sipStack->getCallback()){
- e = new SubscriptionEvent(sipevent);
- sipStack->getCallback()->OnSubscriptionEvent((const SubscriptionEvent*)e);
- }
- break;
- }
-
- case tsip_event_dialog:
- { /* Common to all dialogs */
- if(sipStack->getCallback()){
- e = new DialogEvent(sipevent);
- sipStack->getCallback()->OnDialogEvent((const DialogEvent*)e);
- }
- break;
- }
-
- case tsip_event_stack:
- { /* Stack event */
- if(sipStack->getCallback()){
- e = new StackEvent(sipevent);
- sipStack->getCallback()->OnStackEvent((const StackEvent*)e);
- }
- break;
- }
-
- default:
- { /* Unsupported */
- TSK_DEBUG_WARN("%d not supported as SIP event.", sipevent->type);
- ret = -3;
- break;
- }
- }
-
- sipStack->UnLock();
-
- if(e){
- delete e;
- }
-
- return ret;
+ int ret = 0;
+ const SipStack* sipStack = tsk_null;
+ SipEvent* e = tsk_null;
+
+ if(!sipevent) { /* should never happen ...but who know? */
+ TSK_DEBUG_WARN("Null SIP event.");
+ return -1;
+ }
+ else {
+ if(sipevent->type == tsip_event_stack && sipevent->userdata) {
+ /* sessionless event */
+ sipStack = dyn_cast<const SipStack*>((const SipStack*)sipevent->userdata);
+ }
+ else {
+ const void* userdata;
+ /* gets the stack from the session */
+ const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
+ if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))) {
+ sipStack = dyn_cast<const SipStack*>((const SipStack*)userdata);
+ }
+ }
+ }
+
+ if(!sipStack) {
+ TSK_DEBUG_WARN("Invalid SIP event (Stack is Null).");
+ return -2;
+ }
+
+ sipStack->Lock();
+
+ switch(sipevent->type) {
+ case tsip_event_register: {
+ /* REGISTER */
+ if(sipStack->getCallback()) {
+ e = new RegistrationEvent(sipevent);
+ sipStack->getCallback()->OnRegistrationEvent((const RegistrationEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_invite: {
+ /* INVITE */
+ if(sipStack->getCallback()) {
+ e = new InviteEvent(sipevent);
+ sipStack->getCallback()->OnInviteEvent((const InviteEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_message: {
+ /* MESSAGE */
+ if(sipStack->getCallback()) {
+ e = new MessagingEvent(sipevent);
+ sipStack->getCallback()->OnMessagingEvent((const MessagingEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_info: {
+ /* INFO */
+ if(sipStack->getCallback()) {
+ e = new InfoEvent(sipevent);
+ sipStack->getCallback()->OnInfoEvent((const InfoEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_options: {
+ /* OPTIONS */
+ if(sipStack->getCallback()) {
+ e = new OptionsEvent(sipevent);
+ sipStack->getCallback()->OnOptionsEvent((const OptionsEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_publish: {
+ /* PUBLISH */
+ if(sipStack->getCallback()) {
+ e = new PublicationEvent(sipevent);
+ sipStack->getCallback()->OnPublicationEvent((const PublicationEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_subscribe: {
+ /* SUBSCRIBE */
+ if(sipStack->getCallback()) {
+ e = new SubscriptionEvent(sipevent);
+ sipStack->getCallback()->OnSubscriptionEvent((const SubscriptionEvent*)e);
+ }
+ break;
+ }
+
+ case tsip_event_dialog: {
+ /* Common to all dialogs */
+ if(sipStack->getCallback()) {
+ e = new DialogEvent(sipevent);
+ sipStack->getCallback()->OnDialogEvent((const DialogEvent*)e);
+ }
+ break;
+ }
+
+ case tsip_event_stack: {
+ /* Stack event */
+ if(sipStack->getCallback()) {
+ e = new StackEvent(sipevent);
+ sipStack->getCallback()->OnStackEvent((const StackEvent*)e);
+ }
+ break;
+ }
+
+ default: {
+ /* Unsupported */
+ TSK_DEBUG_WARN("%d not supported as SIP event.", sipevent->type);
+ ret = -3;
+ break;
+ }
+ }
+
+ sipStack->UnLock();
+
+ if(e) {
+ delete e;
+ }
+
+ return ret;
}
diff --git a/bindings/_common/SipStack.h b/bindings/_common/SipStack.h
index 1f41096..d7b8cdc 100755
--- a/bindings/_common/SipStack.h
+++ b/bindings/_common/SipStack.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,88 +36,88 @@ class DDebugCallback;
class TINYWRAP_API SipStack: public SafeObject
{
public: /* ctor() and dtor() */
- SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri);
+ SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri);
~SipStack();
public: /* API functions */
- bool start();
- bool setDebugCallback(DDebugCallback* pCallback);
- bool setDisplayName(const char* display_name);
- bool setRealm(const char* realm_uri);
- bool setIMPI(const char* impi);
- bool setIMPU(const char* impu_uri);
- bool setPassword(const char* password);
- bool setAMF(const char* amf);
- bool setOperatorId(const char* opid);
- bool setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion);
- bool setLocalIP(const char* ip, const char* transport=tsk_null);
- bool setLocalPort(unsigned short port, const char* transport=tsk_null);
- bool setEarlyIMS(bool enabled);
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool addDnsServer(const char* ip);
- bool setDnsDiscovery(bool enabled);
- bool setAoR(const char* ip, int port);
+ bool start();
+ bool setDebugCallback(DDebugCallback* pCallback);
+ bool setDisplayName(const char* display_name);
+ bool setRealm(const char* realm_uri);
+ bool setIMPI(const char* impi);
+ bool setIMPU(const char* impu_uri);
+ bool setPassword(const char* password);
+ bool setAMF(const char* amf);
+ bool setOperatorId(const char* opid);
+ bool setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion);
+ bool setLocalIP(const char* ip, const char* transport=tsk_null);
+ bool setLocalPort(unsigned short port, const char* transport=tsk_null);
+ bool setEarlyIMS(bool enabled);
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool addDnsServer(const char* ip);
+ bool setDnsDiscovery(bool enabled);
+ bool setAoR(const char* ip, int port);
#if !defined(SWIG)
- bool setMode(enum tsip_stack_mode_e mode);
+ bool setMode(enum tsip_stack_mode_e mode);
#endif
- bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
- bool addSigCompCompartment(const char* compId);
- bool removeSigCompCompartment(const char* compId);
-
- bool setSTUNEnabledForICE(bool enabled); // @deprecated
- bool setSTUNServer(const char* hostname, unsigned short port); // @deprecated
- bool setSTUNCred(const char* login, const char* password); // @deprecated
- bool setSTUNEnabled(bool enabled);
-
- bool setTLSSecAgree(bool enabled);
- bool setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false);
- bool setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false); /*@deprecated: typo */
- bool setIPSecSecAgree(bool enabled);
- bool setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto);
-
- char* dnsENUM(const char* service, const char* e164num, const char* domain);
- char* dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT);
- char* dnsSrv(const char* service, unsigned short* OUTPUT);
-
- bool setMaxFDs(unsigned max_fds);
-
- char* getLocalIPnPort(const char* protocol, unsigned short* OUTPUT);
-
- char* getPreferredIdentity();
-
- bool isValid();
- bool stop();
-
- static bool initialize();
- static bool deInitialize();
- static void setCodecs(tdav_codec_id_t codecs);
- static void setCodecs_2(int64_t codecs); // For stupid languages
- static bool setCodecPriority(tdav_codec_id_t codec_id, int priority);
- static bool setCodecPriority_2(int codec, int priority);// For stupid languages
- static bool isCodecSupported(tdav_codec_id_t codec_id);
- static bool isIPSecSupported();
+ bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
+ bool addSigCompCompartment(const char* compId);
+ bool removeSigCompCompartment(const char* compId);
+
+ bool setSTUNEnabledForICE(bool enabled); // @deprecated
+ bool setSTUNServer(const char* hostname, unsigned short port); // @deprecated
+ bool setSTUNCred(const char* login, const char* password); // @deprecated
+ bool setSTUNEnabled(bool enabled);
+
+ bool setTLSSecAgree(bool enabled);
+ bool setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false);
+ bool setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false); /*@deprecated: typo */
+ bool setIPSecSecAgree(bool enabled);
+ bool setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto);
+
+ char* dnsENUM(const char* service, const char* e164num, const char* domain);
+ char* dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT);
+ char* dnsSrv(const char* service, unsigned short* OUTPUT);
+
+ bool setMaxFDs(unsigned max_fds);
+
+ char* getLocalIPnPort(const char* protocol, unsigned short* OUTPUT);
+
+ char* getPreferredIdentity();
+
+ bool isValid();
+ bool stop();
+
+ static bool initialize();
+ static bool deInitialize();
+ static void setCodecs(tdav_codec_id_t codecs);
+ static void setCodecs_2(int64_t codecs); // For stupid languages
+ static bool setCodecPriority(tdav_codec_id_t codec_id, int priority);
+ static bool setCodecPriority_2(int codec, int priority);// For stupid languages
+ static bool isCodecSupported(tdav_codec_id_t codec_id);
+ static bool isIPSecSupported();
public: /* Public helper function */
#if !defined(SWIG)
- inline tsip_stack_handle_t* getHandle()const{
- return m_pHandle;
- }
- inline SipCallback* getCallback()const{
- return m_pCallback;
- }
- inline DDebugCallback* getDebugCallback() const{
- return m_pDebugCallback;
- }
+ inline tsip_stack_handle_t* getHandle()const {
+ return m_pHandle;
+ }
+ inline SipCallback* getCallback()const {
+ return m_pCallback;
+ }
+ inline DDebugCallback* getDebugCallback() const {
+ return m_pDebugCallback;
+ }
#endif
private:
- SipCallback* m_pCallback;
- DDebugCallback* m_pDebugCallback;
- tsip_stack_handle_t* m_pHandle;
+ SipCallback* m_pCallback;
+ DDebugCallback* m_pDebugCallback;
+ tsip_stack_handle_t* m_pHandle;
- static bool g_bInitialized;
+ static bool g_bInitialized;
};
#endif /* TINYWRAP_SIPSTACK_H */
diff --git a/bindings/_common/SipUri.cxx b/bindings/_common/SipUri.cxx
index eaddf55..a55488e 100755
--- a/bindings/_common/SipUri.cxx
+++ b/bindings/_common/SipUri.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,80 +23,80 @@
SipUri::SipUri(const char* uriString, const char* displayName/*=tsk_null*/)
{
- if((m_pUri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString))) && displayName){
- m_pUri->display_name = tsk_strdup(displayName);
- }
+ if((m_pUri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString))) && displayName) {
+ m_pUri->display_name = tsk_strdup(displayName);
+ }
}
SipUri::~SipUri()
{
- TSK_OBJECT_SAFE_FREE(m_pUri);
+ TSK_OBJECT_SAFE_FREE(m_pUri);
}
bool SipUri::isValid(const char* uriString)
{
- tsip_uri_t* uri;
- bool ret = false;
+ tsip_uri_t* uri;
+ bool ret = false;
- if((uri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString)))){
- ret = (uri->type != uri_unknown)
- && (!tsk_strnullORempty(uri->host));
- TSK_OBJECT_SAFE_FREE(uri);
- }
- return ret;
+ if((uri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString)))) {
+ ret = (uri->type != uri_unknown)
+ && (!tsk_strnullORempty(uri->host));
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+ return ret;
}
bool SipUri::isValid()
{
- return (m_pUri != tsk_null);
+ return (m_pUri != tsk_null);
}
const char* SipUri::getScheme()
{
- if(m_pUri){
- return m_pUri->scheme;
- }
- return tsk_null;
+ if(m_pUri) {
+ return m_pUri->scheme;
+ }
+ return tsk_null;
}
const char* SipUri::getHost()
{
- return m_pUri ? m_pUri->host : tsk_null;
+ return m_pUri ? m_pUri->host : tsk_null;
}
unsigned short SipUri::getPort()
{
- return m_pUri ? m_pUri->port : 0;
+ return m_pUri ? m_pUri->port : 0;
}
const char* SipUri::getUserName()
{
- return m_pUri ? m_pUri->user_name : tsk_null;
+ return m_pUri ? m_pUri->user_name : tsk_null;
}
const char* SipUri::getPassword()
{
- return m_pUri ? m_pUri->password : tsk_null;
+ return m_pUri ? m_pUri->password : tsk_null;
}
const char* SipUri::getDisplayName()
{
- return m_pUri ? m_pUri->display_name : tsk_null;
+ return m_pUri ? m_pUri->display_name : tsk_null;
}
void SipUri::setDisplayName(const char* displayName)
{
- if(m_pUri){
- tsk_strupdate(&m_pUri->display_name, displayName);
- }
+ if(m_pUri) {
+ tsk_strupdate(&m_pUri->display_name, displayName);
+ }
}
const char* SipUri::getParamValue(const char* pname)
{
- if(m_pUri && m_pUri->params){
- const char* pvalue = tsk_params_get_param_value(m_pUri->params, pname);
- return pvalue;
- }
- return tsk_null;
+ if(m_pUri && m_pUri->params) {
+ const char* pvalue = tsk_params_get_param_value(m_pUri->params, pname);
+ return pvalue;
+ }
+ return tsk_null;
}
diff --git a/bindings/_common/SipUri.h b/bindings/_common/SipUri.h
index 9e2d15c..7baac53 100755
--- a/bindings/_common/SipUri.h
+++ b/bindings/_common/SipUri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,29 +29,29 @@
class TINYWRAP_API SipUri
{
public:
- SipUri(const char* uriString, const char* displayName=tsk_null);
- ~SipUri();
+ SipUri(const char* uriString, const char* displayName=tsk_null);
+ ~SipUri();
public:
- static bool isValid(const char*);
+ static bool isValid(const char*);
- bool isValid();
- const char* getScheme();
- const char* getHost();
- unsigned short getPort();
- const char* getUserName();
- const char* getPassword();
- const char* getDisplayName();
- const char* getParamValue(const char* pname);
- void setDisplayName(const char* displayName);
+ bool isValid();
+ const char* getScheme();
+ const char* getHost();
+ unsigned short getPort();
+ const char* getUserName();
+ const char* getPassword();
+ const char* getDisplayName();
+ const char* getParamValue(const char* pname);
+ void setDisplayName(const char* displayName);
#if !defined(SWIG)
- inline const tsip_uri_t* getWrappedUri()const{
- return m_pUri;
- }
+ inline const tsip_uri_t* getWrappedUri()const {
+ return m_pUri;
+ }
#endif
private:
- tsip_uri_t* m_pUri;
+ tsip_uri_t* m_pUri;
};
#endif /* TINYWRAP_SIPURI_H */
diff --git a/bindings/_common/Xcap.cxx b/bindings/_common/Xcap.cxx
index adb5609..510cb99 100755
--- a/bindings/_common/Xcap.cxx
+++ b/bindings/_common/Xcap.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,241 +29,239 @@ unsigned XcapStack::count = 0;
static int stack_callback(const thttp_event_t *httpevent);
/* =================================== XCAP Event ==================================== */
-typedef enum twrap_xcap_step_type_e
-{
- txst_name,
- txst_pos,
- txst_att,
- txst_pos_n_att,
- txst_ns
+typedef enum twrap_xcap_step_type_e {
+ txst_name,
+ txst_pos,
+ txst_att,
+ txst_pos_n_att,
+ txst_ns
}
twrap_xcap_step_type_t;
-typedef struct twrap_xcap_step_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct twrap_xcap_step_s {
+ TSK_DECLARE_OBJECT;
- twrap_xcap_step_type_t type;
- char* qname;
- char* att_qname;
- char* att_value;
- unsigned pos;
- struct{
- char* prefix;
- char* value;
- } ns;
+ twrap_xcap_step_type_t type;
+ char* qname;
+ char* att_qname;
+ char* att_value;
+ unsigned pos;
+ struct {
+ char* prefix;
+ char* value;
+ } ns;
}
twrap_xcap_step_t;
static tsk_object_t* twrap_xcap_step_ctor(tsk_object_t * self, va_list * app)
{
- twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
- if(step){
- }
- return self;
+ twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
+ if(step) {
+ }
+ return self;
}
static tsk_object_t* twrap_xcap_step_dtor(tsk_object_t * self)
-{
- twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
- if(step){
- TSK_FREE(step->qname);
- TSK_FREE(step->att_qname);
- TSK_FREE(step->att_value);
- TSK_FREE(step->ns.prefix);
- TSK_FREE(step->ns.value);
- }
+{
+ twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
+ if(step) {
+ TSK_FREE(step->qname);
+ TSK_FREE(step->att_qname);
+ TSK_FREE(step->att_value);
+ TSK_FREE(step->ns.prefix);
+ TSK_FREE(step->ns.value);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t twrap_xcap_step_def_s =
-{
- sizeof(twrap_xcap_step_t),
- twrap_xcap_step_ctor,
- twrap_xcap_step_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_xcap_step_def_s = {
+ sizeof(twrap_xcap_step_t),
+ twrap_xcap_step_ctor,
+ twrap_xcap_step_dtor,
+ tsk_null,
};
const tsk_object_def_t *twrap_xcap_step_def_t = &twrap_xcap_step_def_s;
-twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type){
- twrap_xcap_step_t* step;
- if((step = (twrap_xcap_step_t*)tsk_object_new(twrap_xcap_step_def_t))){
- step->type = type;
- }
- return step;
+twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type)
+{
+ twrap_xcap_step_t* step;
+ if((step = (twrap_xcap_step_t*)tsk_object_new(twrap_xcap_step_def_t))) {
+ step->type = type;
+ }
+ return step;
}
XcapSelector::XcapSelector(XcapStack* stack)
-: auid(tsk_null)
+ : auid(tsk_null)
{
- if(stack){
- this->stack_handle = tsk_object_ref(stack->getHandle());
- }
- this->steps = tsk_list_create();
+ if(stack) {
+ this->stack_handle = tsk_object_ref(stack->getHandle());
+ }
+ this->steps = tsk_list_create();
}
XcapSelector* XcapSelector::setAUID(const char* auid)
{
- tsk_strupdate(&this->auid, auid);
- return this;
+ tsk_strupdate(&this->auid, auid);
+ return this;
}
XcapSelector* XcapSelector::setName(const char* qname)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_name))){
- step->qname = tsk_strdup(qname);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_name))) {
+ step->qname = tsk_strdup(qname);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setAttribute(const char* qname, const char* att_qname, const char* att_value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_att))){
- step->qname = tsk_strdup(qname);
- step->att_qname = tsk_strdup(att_qname);
- step->att_value = tsk_strdup(att_value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_att))) {
+ step->qname = tsk_strdup(qname);
+ step->att_qname = tsk_strdup(att_qname);
+ step->att_value = tsk_strdup(att_value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setPos(const char* qname, unsigned pos)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_pos))){
- step->qname = tsk_strdup(qname);
- step->pos = pos;
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_pos))) {
+ step->qname = tsk_strdup(qname);
+ step->pos = pos;
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_pos))){
- step->qname = tsk_strdup(qname);
- step->pos = pos;
- step->att_qname = tsk_strdup(att_qname);
- step->att_value = tsk_strdup(att_value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_pos))) {
+ step->qname = tsk_strdup(qname);
+ step->pos = pos;
+ step->att_qname = tsk_strdup(att_qname);
+ step->att_value = tsk_strdup(att_value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setNamespace(const char* prefix, const char* value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_ns))){
- step->ns.prefix = tsk_strdup(prefix);
- step->ns.value = tsk_strdup(value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_ns))) {
+ step->ns.prefix = tsk_strdup(prefix);
+ step->ns.value = tsk_strdup(value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
/* From tinyXCAP::txcap_selector_get_node_2() */
char* XcapSelector::getString()
{
- char* node = tsk_null;
- char* temp = tsk_null;
- char* _namespace = tsk_null;
- tsk_buffer_t* buffer = tsk_buffer_create_null();
- const tsk_list_item_t* item;
- const twrap_xcap_step_t* step;
-
- /* Node */
- tsk_list_foreach(item, this->steps){
- step = (twrap_xcap_step_t*)item->data;
- switch(step->type){
- case txst_name:
- if(tsk_buffer_append_2(buffer, "/%s", step->qname)){
- goto bail;
- }
- break;
-
- case txst_pos:
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
- step->att_qname, step->pos);
- break;
-
- case txst_att:
- tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
- step->qname, step->att_qname, step->att_value);
- break;
-
- case txst_pos_n_att:
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
- step->qname, step->pos, step->att_qname, step->att_value);
- break;
-
- case txst_ns:
- tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
- _namespace?"":"%3F", step->ns.prefix, step->ns.value);
- tsk_strcat(&_namespace, temp);
- TSK_FREE(temp);
- break;
-
-
- } /* switch */
- } /* for */
-
- /* append the namespace */
- if(_namespace){
- tsk_buffer_append(buffer, _namespace, (tsk_size_t)tsk_strlen(_namespace));
- TSK_FREE(_namespace);
- }
+ char* node = tsk_null;
+ char* temp = tsk_null;
+ char* _namespace = tsk_null;
+ tsk_buffer_t* buffer = tsk_buffer_create_null();
+ const tsk_list_item_t* item;
+ const twrap_xcap_step_t* step;
+
+ /* Node */
+ tsk_list_foreach(item, this->steps) {
+ step = (twrap_xcap_step_t*)item->data;
+ switch(step->type) {
+ case txst_name:
+ if(tsk_buffer_append_2(buffer, "/%s", step->qname)) {
+ goto bail;
+ }
+ break;
+
+ case txst_pos:
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
+ step->att_qname, step->pos);
+ break;
+
+ case txst_att:
+ tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
+ step->qname, step->att_qname, step->att_value);
+ break;
+
+ case txst_pos_n_att:
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
+ step->qname, step->pos, step->att_qname, step->att_value);
+ break;
+
+ case txst_ns:
+ tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
+ _namespace?"":"%3F", step->ns.prefix, step->ns.value);
+ tsk_strcat(&_namespace, temp);
+ TSK_FREE(temp);
+ break;
+
+
+ } /* switch */
+ } /* for */
+
+ /* append the namespace */
+ if(_namespace) {
+ tsk_buffer_append(buffer, _namespace, (tsk_size_t)tsk_strlen(_namespace));
+ TSK_FREE(_namespace);
+ }
bail:
- if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)){
- node = tsk_strndup((const char*)TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
- }
- TSK_OBJECT_SAFE_FREE(buffer);
-
-
- /* Document */
- if(this->auid){
- char* document;
- if((document = txcap_selector_get_document(this->stack_handle, this->auid))){
- if(node){
- tsk_strcat_2(&document, "/~~/%s%s", this->auid, node);
- TSK_FREE(node);
- }
- return document;
- }
- }
-
- return node;
+ if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)) {
+ node = tsk_strndup((const char*)TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+
+ /* Document */
+ if(this->auid) {
+ char* document;
+ if((document = txcap_selector_get_document(this->stack_handle, this->auid))) {
+ if(node) {
+ tsk_strcat_2(&document, "/~~/%s%s", this->auid, node);
+ TSK_FREE(node);
+ }
+ return document;
+ }
+ }
+
+ return node;
}
void XcapSelector::reset()
{
- TSK_FREE(this->auid);
- tsk_list_clear_items(this->steps);
+ TSK_FREE(this->auid);
+ tsk_list_clear_items(this->steps);
}
XcapSelector::~XcapSelector()
{
- this->reset();
- TSK_OBJECT_SAFE_FREE(this->steps);
-
- tsk_object_unref(this->stack_handle);
+ this->reset();
+ TSK_OBJECT_SAFE_FREE(this->steps);
+
+ tsk_object_unref(this->stack_handle);
}
/* =================================== XCAP Message ==================================== */
XcapMessage::XcapMessage() :
-httpmessage(tsk_null)
+ httpmessage(tsk_null)
{
}
XcapMessage::XcapMessage(const thttp_message_t *_httpmessage)
{
- this->httpmessage = _httpmessage;
+ this->httpmessage = _httpmessage;
}
XcapMessage::~XcapMessage()
@@ -272,87 +270,87 @@ XcapMessage::~XcapMessage()
short XcapMessage::getCode() const
{
- if(this->httpmessage){
- return this->httpmessage->line.response.status_code;
- }
- return 0;
+ if(this->httpmessage) {
+ return this->httpmessage->line.response.status_code;
+ }
+ return 0;
}
const char* XcapMessage::getPhrase() const
{
- if(this->httpmessage){
- return this->httpmessage->line.response.reason_phrase;
- }
- return tsk_null;
+ if(this->httpmessage) {
+ return this->httpmessage->line.response.reason_phrase;
+ }
+ return tsk_null;
}
char* XcapMessage::getXcapHeaderValue(const char* name, unsigned index /*= 0*/)
{
- const thttp_header_t* header;
- if((header = thttp_message_get_headerByName(this->httpmessage, name))){
- return thttp_header_value_tostring(header);
- }
- return tsk_null;
+ const thttp_header_t* header;
+ if((header = thttp_message_get_headerByName(this->httpmessage, name))) {
+ return thttp_header_value_tostring(header);
+ }
+ return tsk_null;
}
char* XcapMessage::getXcapHeaderParamValue(const char* name, const char* pname, unsigned index /*= 0*/)
{
- const thttp_header_t* header;
- if((header = thttp_message_get_headerByName(this->httpmessage, name))){
- const tsk_param_t* param;
- if((param = tsk_params_get_param_by_name(header->params, pname))){
- return tsk_strdup(param->value);
- }
- }
- return tsk_null;
+ const thttp_header_t* header;
+ if((header = thttp_message_get_headerByName(this->httpmessage, name))) {
+ const tsk_param_t* param;
+ if((param = tsk_params_get_param_by_name(header->params, pname))) {
+ return tsk_strdup(param->value);
+ }
+ }
+ return tsk_null;
}
unsigned XcapMessage::getXcapContentLength()
{
- if(this->httpmessage && this->httpmessage->Content){
- return this->httpmessage->Content->size;
- }
- return 0;
+ if(this->httpmessage && this->httpmessage->Content) {
+ return this->httpmessage->Content->size;
+ }
+ return 0;
}
unsigned XcapMessage::getXcapContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(output && maxsize && this->httpmessage->Content){
- retsize = (this->httpmessage->Content->size > maxsize) ? maxsize : this->httpmessage->Content->size;
- memcpy(output, this->httpmessage->Content->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+ if(output && maxsize && this->httpmessage->Content) {
+ retsize = (this->httpmessage->Content->size > maxsize) ? maxsize : this->httpmessage->Content->size;
+ memcpy(output, this->httpmessage->Content->data, retsize);
+ }
+ return retsize;
}
/* =================================== XCAP Event ==================================== */
XcapEvent::XcapEvent(const thttp_event_t *_httpevent)
{
- this->httpevent = _httpevent;
- if(_httpevent){
- this->httpmessage = new XcapMessage(_httpevent->message);
- }
- else{
- this->httpmessage = tsk_null;
- }
+ this->httpevent = _httpevent;
+ if(_httpevent) {
+ this->httpmessage = new XcapMessage(_httpevent->message);
+ }
+ else {
+ this->httpmessage = tsk_null;
+ }
}
XcapEvent::~XcapEvent()
{
- if(this->httpmessage){
- delete this->httpmessage;
- }
+ if(this->httpmessage) {
+ delete this->httpmessage;
+ }
}
thttp_event_type_t XcapEvent::getType()
{
- return this->httpevent->type;
+ return this->httpevent->type;
}
const XcapMessage* XcapEvent::getXcapMessage() const
{
- return this->httpmessage;
+ return this->httpmessage;
}
@@ -374,189 +372,189 @@ XcapCallback::~XcapCallback()
/* =================================== XCAP Stack ==================================== */
XcapStack::XcapStack(XcapCallback* _callback, const char* xui, const char* password, const char* xcap_root)
{
- /* Initialize network layer */
- if(XcapStack::count == 0){
- tnet_startup();
- }
+ /* Initialize network layer */
+ if(XcapStack::count == 0) {
+ tnet_startup();
+ }
- this->callback = _callback;
- this->handle = txcap_stack_create(stack_callback, xui, password, xcap_root,
- TXCAP_STACK_SET_USERDATA(this),
- TXCAP_STACK_SET_NULL());
+ this->callback = _callback;
+ this->handle = txcap_stack_create(stack_callback, xui, password, xcap_root,
+ TXCAP_STACK_SET_USERDATA(this),
+ TXCAP_STACK_SET_NULL());
}
XcapStack::~XcapStack()
{
- TSK_OBJECT_SAFE_FREE(this->handle);
+ TSK_OBJECT_SAFE_FREE(this->handle);
- /* DeInitialize the network layer (only if last stack) */
- if(--XcapStack::count == 0){
- tnet_cleanup();
- }
+ /* DeInitialize the network layer (only if last stack) */
+ if(--XcapStack::count == 0) {
+ tnet_cleanup();
+ }
}
bool XcapStack::registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global)
{
- txcap_stack_t* stack = (txcap_stack_t*)this->handle;
- if(stack){
- tsk_bool_t _global = is_global?tsk_true:tsk_false; // 32bit <-> 64bit workaround
- return (txcap_auid_register(stack->auids, id, mime_type, ns, document_name, _global) == 0);
- }
- return false;
+ txcap_stack_t* stack = (txcap_stack_t*)this->handle;
+ if(stack) {
+ tsk_bool_t _global = is_global?tsk_true:tsk_false; // 32bit <-> 64bit workaround
+ return (txcap_auid_register(stack->auids, id, mime_type, ns, document_name, _global) == 0);
+ }
+ return false;
}
bool XcapStack::start()
{
- return (txcap_stack_start(this->handle) == 0);
+ return (txcap_stack_start(this->handle) == 0);
}
bool XcapStack::setCredentials(const char* xui, const char* password)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_XUI(xui),
- TXCAP_STACK_SET_PASSWORD(password),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_XUI(xui),
+ TXCAP_STACK_SET_PASSWORD(password),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setXcapRoot(const char* xcap_root)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_ROOT(xcap_root),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_ROOT(xcap_root),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setLocalIP(const char* ip)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_LOCAL_IP(ip),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_LOCAL_IP(ip),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setLocalPort(unsigned port)
{
- tsk_istr_t port_str;
- tsk_itoa(port, &port_str);
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_LOCAL_PORT(port_str),
- TXCAP_STACK_SET_NULL()) == 0;
+ tsk_istr_t port_str;
+ tsk_itoa(port, &port_str);
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_LOCAL_PORT(port_str),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::addHeader(const char* name, const char* value)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_HEADER(name, value),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_HEADER(name, value),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::removeHeader(const char* name)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_UNSET_HEADER(name),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_UNSET_HEADER(name),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setTimeout(unsigned timeout)
{
- tsk_istr_t timeout_str;
- tsk_itoa(timeout, &timeout_str);
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_TIMEOUT(timeout_str),
- TXCAP_STACK_SET_NULL()) == 0;
+ tsk_istr_t timeout_str;
+ tsk_itoa(timeout, &timeout_str);
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_TIMEOUT(timeout_str),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::getDocument(const char* url)
{
- return txcap_action_fetch_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::getElement(const char* url)
{
- return txcap_action_fetch_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::getAttribute(const char* url)
{
- return txcap_action_fetch_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteDocument(const char* url)
{
- return txcap_action_delete_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteElement(const char* url)
{
- return txcap_action_delete_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteAttribute(const char* url)
{
- return txcap_action_delete_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putDocument(const char* url, const void* payload, unsigned len, const char* contentType)
{
- return txcap_action_create_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_HEADER("Content-Type", contentType),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_HEADER("Content-Type", contentType),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putElement(const char* url, const void* payload, unsigned len)
{
- return txcap_action_create_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putAttribute(const char* url, const void* payload, unsigned len)
{
- return txcap_action_create_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::stop()
{
- return (txcap_stack_stop(this->handle) == 0);
+ return (txcap_stack_stop(this->handle) == 0);
}
int stack_callback(const thttp_event_t *httpevent)
{
- const XcapStack* stack = tsk_null;
- XcapEvent* e = tsk_null;
-
- const txcap_stack_handle_t* stack_handle = thttp_session_get_userdata(httpevent->session);
- if(!stack_handle || !(stack = dyn_cast<const XcapStack*>((const XcapStack*)stack_handle))){
- TSK_DEBUG_ERROR("Invalid user data");
- return -1;
- }
-
- if(stack->getCallback()){
- if((e = new XcapEvent(httpevent))){
- stack->getCallback()->onEvent(e);
- delete e;
- }
- }
- return 0;
+ const XcapStack* stack = tsk_null;
+ XcapEvent* e = tsk_null;
+
+ const txcap_stack_handle_t* stack_handle = thttp_session_get_userdata(httpevent->session);
+ if(!stack_handle || !(stack = dyn_cast<const XcapStack*>((const XcapStack*)stack_handle))) {
+ TSK_DEBUG_ERROR("Invalid user data");
+ return -1;
+ }
+
+ if(stack->getCallback()) {
+ if((e = new XcapEvent(httpevent))) {
+ stack->getCallback()->onEvent(e);
+ delete e;
+ }
+ }
+ return 0;
}
diff --git a/bindings/_common/Xcap.h b/bindings/_common/Xcap.h
index 0d26f2c..59376d6 100755
--- a/bindings/_common/Xcap.h
+++ b/bindings/_common/Xcap.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,24 +34,24 @@ typedef tsk_list_t twrap_xcap_steps_L_t;
class XcapSelector
{
public:
- XcapSelector(XcapStack* stack);
- virtual ~XcapSelector();
+ XcapSelector(XcapStack* stack);
+ virtual ~XcapSelector();
public: /* API functions */
- XcapSelector* setAUID(const char* auid);
- XcapSelector* setName(const char* qname);
- XcapSelector* setAttribute(const char* qname, const char* att_qname, const char* att_value);
- XcapSelector* setPos(const char* qname, unsigned pos);
- XcapSelector* setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value);
- XcapSelector* setNamespace(const char* prefix, const char* value);
-
- char* getString();// %newobject
- void reset();
+ XcapSelector* setAUID(const char* auid);
+ XcapSelector* setName(const char* qname);
+ XcapSelector* setAttribute(const char* qname, const char* att_qname, const char* att_value);
+ XcapSelector* setPos(const char* qname, unsigned pos);
+ XcapSelector* setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value);
+ XcapSelector* setNamespace(const char* prefix, const char* value);
+
+ char* getString();// %newobject
+ void reset();
private:
- txcap_stack_handle_t* stack_handle;
- char* auid;
- twrap_xcap_steps_L_t* steps;
+ txcap_stack_handle_t* stack_handle;
+ char* auid;
+ twrap_xcap_steps_L_t* steps;
};
//
@@ -60,22 +60,22 @@ private:
class XcapMessage
{
public:
- XcapMessage();
+ XcapMessage();
#if !defined(SWIG)
- XcapMessage(const thttp_message_t *httpmessage);
+ XcapMessage(const thttp_message_t *httpmessage);
#endif
- virtual ~XcapMessage();
-
- short getCode() const;
- const char* getPhrase() const;
+ virtual ~XcapMessage();
+
+ short getCode() const;
+ const char* getPhrase() const;
- char* getXcapHeaderValue(const char* name, unsigned index = 0);
- char* getXcapHeaderParamValue(const char* name, const char* param, unsigned index = 0);
- unsigned getXcapContentLength();
- unsigned getXcapContent(void* output, unsigned maxsize);
+ char* getXcapHeaderValue(const char* name, unsigned index = 0);
+ char* getXcapHeaderParamValue(const char* name, const char* param, unsigned index = 0);
+ unsigned getXcapContentLength();
+ unsigned getXcapContent(void* output, unsigned maxsize);
private:
- const thttp_message_t *httpmessage;
+ const thttp_message_t *httpmessage;
};
//
@@ -85,15 +85,15 @@ class XcapEvent
{
public:
#if !defined(SWIG)
- XcapEvent(const thttp_event_t *httpevent);
+ XcapEvent(const thttp_event_t *httpevent);
#endif
- virtual ~XcapEvent();
- thttp_event_type_t getType();
- const XcapMessage* getXcapMessage() const;
+ virtual ~XcapEvent();
+ thttp_event_type_t getType();
+ const XcapMessage* getXcapMessage() const;
private:
- const thttp_event_t *httpevent;
- const XcapMessage* httpmessage;
+ const thttp_event_t *httpevent;
+ const XcapMessage* httpmessage;
};
@@ -103,10 +103,12 @@ private:
class XcapCallback
{
public:
- XcapCallback();
- virtual ~XcapCallback();
+ XcapCallback();
+ virtual ~XcapCallback();
- virtual int onEvent(const XcapEvent* e)const { return -1; }
+ virtual int onEvent(const XcapEvent* e)const {
+ return -1;
+ }
};
@@ -116,49 +118,49 @@ public:
class XcapStack
{
public:
- XcapStack(XcapCallback* callback, const char* xui, const char* password, const char* xcap_root);
- virtual ~XcapStack();
+ XcapStack(XcapCallback* callback, const char* xui, const char* password, const char* xcap_root);
+ virtual ~XcapStack();
public: /* API functions */
- bool registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global);
- bool start();
- bool setCredentials(const char* xui, const char* password);
- bool setXcapRoot(const char* xcap_root);
- bool setLocalIP(const char* ip);
- bool setLocalPort(unsigned port);
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool setTimeout(unsigned timeout);
-
- bool getDocument(const char* url);
- bool getElement(const char* url);
- bool getAttribute(const char* url);
-
- bool deleteDocument(const char* url);
- bool deleteElement(const char* url);
- bool deleteAttribute(const char* url);
-
- bool putDocument(const char* url, const void* payload, unsigned len, const char* contentType);
- bool putElement(const char* url, const void* payload, unsigned len);
- bool putAttribute(const char* url, const void* payload, unsigned len);
-
- bool stop();
+ bool registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global);
+ bool start();
+ bool setCredentials(const char* xui, const char* password);
+ bool setXcapRoot(const char* xcap_root);
+ bool setLocalIP(const char* ip);
+ bool setLocalPort(unsigned port);
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool setTimeout(unsigned timeout);
+
+ bool getDocument(const char* url);
+ bool getElement(const char* url);
+ bool getAttribute(const char* url);
+
+ bool deleteDocument(const char* url);
+ bool deleteElement(const char* url);
+ bool deleteAttribute(const char* url);
+
+ bool putDocument(const char* url, const void* payload, unsigned len, const char* contentType);
+ bool putElement(const char* url, const void* payload, unsigned len);
+ bool putAttribute(const char* url, const void* payload, unsigned len);
+
+ bool stop();
public: /* Public helper function */
#if !defined(SWIG)
- txcap_stack_handle_t* getHandle(){
- return this->handle;
- }
- XcapCallback* getCallback()const{
- return this->callback;
- }
+ txcap_stack_handle_t* getHandle() {
+ return this->handle;
+ }
+ XcapCallback* getCallback()const {
+ return this->callback;
+ }
#endif
private:
- txcap_stack_handle_t* handle;
- XcapCallback* callback;
+ txcap_stack_handle_t* handle;
+ XcapCallback* callback;
- static unsigned count;
+ static unsigned count;
};
diff --git a/bindings/_common/tinyWRAP.i b/bindings/_common/tinyWRAP.i
index 69bdb38..25df7aa 100755
--- a/bindings/_common/tinyWRAP.i
+++ b/bindings/_common/tinyWRAP.i
@@ -33,6 +33,7 @@
%newobject SipStack::getPreferredIdentity;
%newobject SipStack::getLocalIPnPort;
%newobject MediaSessionMgr::producerGetCodec;
+%newobject MediaSessionMgr::sessionGetQoS;
%newobject MessagingEvent::takeSessionOwnership;
%newobject InviteEvent::takeCallSessionOwnership;
diff --git a/bindings/_common/tinyWRAP_config.h b/bindings/_common/tinyWRAP_config.h
index f2531df..16fb4fd 100755
--- a/bindings/_common/tinyWRAP_config.h
+++ b/bindings/_common/tinyWRAP_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,13 +46,13 @@
# define TINYWRAP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TWRAP_BEGIN_DECLS extern "C" {
# define TWRAP_END_DECLS }
#else
-# define TWRAP_BEGIN_DECLS
+# define TWRAP_BEGIN_DECLS
# define TWRAP_END_DECLS
#endif
@@ -66,7 +66,7 @@
#if HAVE_CONFIG_H
- #include "../config.h"
+#include "../config.h"
#endif
#endif // TINYWRAP_CONFIG_H
diff --git a/bindings/csharp/MediaSessionMgr.cs b/bindings/csharp/MediaSessionMgr.cs
index 8ee9d86..50d95a6 100755
--- a/bindings/csharp/MediaSessionMgr.cs
+++ b/bindings/csharp/MediaSessionMgr.cs
@@ -51,6 +51,12 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ IntPtr cPtr = tinyWRAPPINVOKE.MediaSessionMgr_sessionGetQoS(swigCPtr, (int)media);
+ QoS ret = (cPtr == IntPtr.Zero) ? null : new QoS(cPtr, true);
+ return ret;
+ }
+
public bool consumerSetInt32(twrap_media_type_t media, string key, int value) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_consumerSetInt32(swigCPtr, (int)media, key, value);
return ret;
@@ -149,6 +155,16 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
+ public static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange((int)min, (int)max);
+ return ret;
+ }
+
+ public static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled) {
+ bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ return ret;
+ }
+
public static bool defaultsSetJbMargin(uint jb_margin_ms) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
return ret;
diff --git a/bindings/csharp/QoS.cs b/bindings/csharp/QoS.cs
new file mode 100644
index 0000000..87aa892
--- /dev/null
+++ b/bindings/csharp/QoS.cs
@@ -0,0 +1,121 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace org.doubango.tinyWRAP {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class QoS : IDisposable {
+ private HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal QoS(IntPtr cPtr, bool cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ internal static HandleRef getCPtr(QoS obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~QoS() {
+ Dispose();
+ }
+
+ public virtual void Dispose() {
+ lock(this) {
+ if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPPINVOKE.delete_QoS(swigCPtr);
+ }
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ }
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ public float getQavg() {
+ float ret = tinyWRAPPINVOKE.QoS_getQavg(swigCPtr);
+ return ret;
+ }
+
+ public float getQ1() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ1(swigCPtr);
+ return ret;
+ }
+
+ public float getQ2() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ2(swigCPtr);
+ return ret;
+ }
+
+ public float getQ3() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ3(swigCPtr);
+ return ret;
+ }
+
+ public float getQ4() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ4(swigCPtr);
+ return ret;
+ }
+
+ public float getQ5() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ5(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInWidth() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInWidth(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoOutWidth() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoOutWidth(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInHeight() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInHeight(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoOutHeight() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoOutHeight(swigCPtr);
+ return ret;
+ }
+
+ public uint getBandwidthDownKbps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getBandwidthDownKbps(swigCPtr);
+ return ret;
+ }
+
+ public uint getBandwidthUpKbps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getBandwidthUpKbps(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInAvgFps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInAvgFps(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoDecAvgTime() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoDecAvgTime(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoEncAvgTime() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoEncAvgTime(swigCPtr);
+ return ret;
+ }
+
+}
+
+}
diff --git a/bindings/csharp/tinyWRAPPINVOKE.cs b/bindings/csharp/tinyWRAPPINVOKE.cs
index 84f9165..e76ff31 100755
--- a/bindings/csharp/tinyWRAPPINVOKE.cs
+++ b/bindings/csharp/tinyWRAPPINVOKE.cs
@@ -264,6 +264,54 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_ActionConfig_setMediaInt")]
public static extern IntPtr ActionConfig_setMediaInt(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_delete_QoS")]
+ public static extern void delete_QoS(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQavg")]
+ public static extern float QoS_getQavg(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ1")]
+ public static extern float QoS_getQ1(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ2")]
+ public static extern float QoS_getQ2(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ3")]
+ public static extern float QoS_getQ3(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ4")]
+ public static extern float QoS_getQ4(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ5")]
+ public static extern float QoS_getQ5(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInWidth")]
+ public static extern uint QoS_getVideoInWidth(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutWidth")]
+ public static extern uint QoS_getVideoOutWidth(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInHeight")]
+ public static extern uint QoS_getVideoInHeight(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutHeight")]
+ public static extern uint QoS_getVideoOutHeight(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthDownKbps")]
+ public static extern uint QoS_getBandwidthDownKbps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthUpKbps")]
+ public static extern uint QoS_getBandwidthUpKbps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInAvgFps")]
+ public static extern uint QoS_getVideoInAvgFps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoDecAvgTime")]
+ public static extern uint QoS_getVideoDecAvgTime(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoEncAvgTime")]
+ public static extern uint QoS_getVideoEncAvgTime(HandleRef jarg1);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_Codec")]
public static extern void delete_Codec(HandleRef jarg1);
@@ -297,6 +345,9 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetInt32")]
public static extern int MediaSessionMgr_sessionGetInt32(HandleRef jarg1, int jarg2, string jarg3);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetQoS")]
+ public static extern IntPtr MediaSessionMgr_sessionGetQoS(HandleRef jarg1, int jarg2);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_consumerSetInt32")]
public static extern bool MediaSessionMgr_consumerSetInt32(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
@@ -354,6 +405,12 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSize")]
public static extern bool MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange")]
+ public static extern bool MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled")]
+ public static extern bool MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(bool jarg1);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetJbMargin")]
public static extern bool MediaSessionMgr_defaultsSetJbMargin(uint jarg1);
diff --git a/bindings/csharp/tinyWRAP_wrap.cxx b/bindings/csharp/tinyWRAP_wrap.cxx
index d2c8e32..5b7d245 100755
--- a/bindings/csharp/tinyWRAP_wrap.cxx
+++ b/bindings/csharp/tinyWRAP_wrap.cxx
@@ -1488,6 +1488,194 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ActionConfig_setMediaInt(void * jarg1, int
}
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_QoS(void * jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ arg1 = (QoS *)jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQavg(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ1(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ2(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ3(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ4(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ5(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInWidth(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutWidth(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInHeight(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutHeight(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthDownKbps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthUpKbps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInAvgFps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoDecAvgTime(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoEncAvgTime(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT void SWIGSTDCALL CSharp_delete_Codec(void * jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -1622,6 +1810,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetInt32(void * jarg1,
}
+SWIGEXPORT void * SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetQoS(void * jarg1, int jarg2) {
+ void * jresult ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ arg1 = (MediaSessionMgr *)jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_consumerSetInt32(void * jarg1, int jarg2, char * jarg3, int jarg4) {
unsigned int jresult ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -1878,6 +2080,32 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoS
}
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2) {
+ unsigned int jresult ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(unsigned int jarg1) {
+ unsigned int jresult ;
+ bool arg1 ;
+ bool result;
+
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetJbMargin(unsigned int jarg1) {
unsigned int jresult ;
uint32_t arg1 ;
diff --git a/bindings/java/MediaSessionMgr.java b/bindings/java/MediaSessionMgr.java
index f5d0177..8a6b5cf 100755
--- a/bindings/java/MediaSessionMgr.java
+++ b/bindings/java/MediaSessionMgr.java
@@ -43,6 +43,11 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
+ return (cPtr == 0) ? null : new QoS(cPtr, true);
+ }
+
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
}
@@ -122,6 +127,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
}
+ public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
+ }
+
+ public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ }
+
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
}
diff --git a/bindings/java/QoS.java b/bindings/java/QoS.java
new file mode 100644
index 0000000..e216f8d
--- /dev/null
+++ b/bindings/java/QoS.java
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.doubango.tinyWRAP;
+
+public class QoS {
+ private long swigCPtr;
+ protected boolean swigCMemOwn;
+
+ protected QoS(long cPtr, boolean cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = cPtr;
+ }
+
+ protected static long getCPtr(QoS obj) {
+ return (obj == null) ? 0 : obj.swigCPtr;
+ }
+
+ protected void finalize() {
+ delete();
+ }
+
+ public synchronized void delete() {
+ if (swigCPtr != 0) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPJNI.delete_QoS(swigCPtr);
+ }
+ swigCPtr = 0;
+ }
+ }
+
+ public float getQavg() {
+ return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
+ }
+
+ public float getQ1() {
+ return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
+ }
+
+ public float getQ2() {
+ return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
+ }
+
+ public float getQ3() {
+ return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
+ }
+
+ public float getQ4() {
+ return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
+ }
+
+ public float getQ5() {
+ return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
+ }
+
+ public long getVideoInWidth() {
+ return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
+ }
+
+ public long getVideoOutWidth() {
+ return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
+ }
+
+ public long getVideoInHeight() {
+ return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
+ }
+
+ public long getVideoOutHeight() {
+ return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
+ }
+
+ public long getBandwidthDownKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
+ }
+
+ public long getBandwidthUpKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
+ }
+
+ public long getVideoInAvgFps() {
+ return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
+ }
+
+ public long getVideoDecAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
+ }
+
+ public long getVideoEncAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
+ }
+
+}
diff --git a/bindings/java/android/MediaSessionMgr.java b/bindings/java/android/MediaSessionMgr.java
index f5d0177..8a6b5cf 100755
--- a/bindings/java/android/MediaSessionMgr.java
+++ b/bindings/java/android/MediaSessionMgr.java
@@ -43,6 +43,11 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
+ return (cPtr == 0) ? null : new QoS(cPtr, true);
+ }
+
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
}
@@ -122,6 +127,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
}
+ public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
+ }
+
+ public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ }
+
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
}
diff --git a/bindings/java/android/QoS.java b/bindings/java/android/QoS.java
new file mode 100644
index 0000000..e216f8d
--- /dev/null
+++ b/bindings/java/android/QoS.java
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.doubango.tinyWRAP;
+
+public class QoS {
+ private long swigCPtr;
+ protected boolean swigCMemOwn;
+
+ protected QoS(long cPtr, boolean cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = cPtr;
+ }
+
+ protected static long getCPtr(QoS obj) {
+ return (obj == null) ? 0 : obj.swigCPtr;
+ }
+
+ protected void finalize() {
+ delete();
+ }
+
+ public synchronized void delete() {
+ if (swigCPtr != 0) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPJNI.delete_QoS(swigCPtr);
+ }
+ swigCPtr = 0;
+ }
+ }
+
+ public float getQavg() {
+ return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
+ }
+
+ public float getQ1() {
+ return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
+ }
+
+ public float getQ2() {
+ return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
+ }
+
+ public float getQ3() {
+ return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
+ }
+
+ public float getQ4() {
+ return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
+ }
+
+ public float getQ5() {
+ return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
+ }
+
+ public long getVideoInWidth() {
+ return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
+ }
+
+ public long getVideoOutWidth() {
+ return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
+ }
+
+ public long getVideoInHeight() {
+ return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
+ }
+
+ public long getVideoOutHeight() {
+ return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
+ }
+
+ public long getBandwidthDownKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
+ }
+
+ public long getBandwidthUpKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
+ }
+
+ public long getVideoInAvgFps() {
+ return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
+ }
+
+ public long getVideoDecAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
+ }
+
+ public long getVideoEncAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
+ }
+
+}
diff --git a/bindings/java/android/tinyWRAPJNI.java b/bindings/java/android/tinyWRAPJNI.java
index e7e86fc..4e02d2b 100755
--- a/bindings/java/android/tinyWRAPJNI.java
+++ b/bindings/java/android/tinyWRAPJNI.java
@@ -35,6 +35,22 @@ public class tinyWRAPJNI {
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
+ public final static native void delete_QoS(long jarg1);
+ public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
public final static native void delete_Codec(long jarg1);
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
public final static native String Codec_getName(long jarg1, Codec jarg1_);
@@ -46,6 +62,7 @@ public class tinyWRAPJNI {
public final static native void delete_MediaSessionMgr(long jarg1);
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
+ public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
@@ -65,6 +82,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+ public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
diff --git a/bindings/java/android/tinyWRAP_wrap.cxx b/bindings/java/android/tinyWRAP_wrap.cxx
index e68ff27..4ea8812 100755
--- a/bindings/java/android/tinyWRAP_wrap.cxx
+++ b/bindings/java/android/tinyWRAP_wrap.cxx
@@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
}
+SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = *(QoS **)&jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
+ jlong jresult = 0 ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(MediaSessionMgr **)&jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ *(QoS **)&jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
jboolean jresult = 0 ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
+ jboolean jresult = 0 ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
+ jboolean jresult = 0 ;
+ bool arg1 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
jboolean jresult = 0 ;
uint32_t arg1 ;
diff --git a/bindings/java/tinyWRAPJNI.java b/bindings/java/tinyWRAPJNI.java
index e7e86fc..4e02d2b 100755
--- a/bindings/java/tinyWRAPJNI.java
+++ b/bindings/java/tinyWRAPJNI.java
@@ -35,6 +35,22 @@ public class tinyWRAPJNI {
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
+ public final static native void delete_QoS(long jarg1);
+ public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
public final static native void delete_Codec(long jarg1);
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
public final static native String Codec_getName(long jarg1, Codec jarg1_);
@@ -46,6 +62,7 @@ public class tinyWRAPJNI {
public final static native void delete_MediaSessionMgr(long jarg1);
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
+ public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
@@ -65,6 +82,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+ public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
diff --git a/bindings/java/tinyWRAP_wrap.cxx b/bindings/java/tinyWRAP_wrap.cxx
index 4845801..1ee74bf 100755
--- a/bindings/java/tinyWRAP_wrap.cxx
+++ b/bindings/java/tinyWRAP_wrap.cxx
@@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
}
+SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = *(QoS **)&jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
+ jlong jresult = 0 ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(MediaSessionMgr **)&jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ *(QoS **)&jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
jboolean jresult = 0 ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
+ jboolean jresult = 0 ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
+ jboolean jresult = 0 ;
+ bool arg1 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
jboolean jresult = 0 ;
uint32_t arg1 ;
diff --git a/bindings/perl/tinyWRAP.pm b/bindings/perl/tinyWRAP.pm
index a41bdee..3437a02 100755
--- a/bindings/perl/tinyWRAP.pm
+++ b/bindings/perl/tinyWRAP.pm
@@ -175,6 +175,52 @@ sub ACQUIRE {
}
+############# Class : tinyWRAP::QoS ##############
+
+package tinyWRAP::QoS;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( tinyWRAP );
+%OWNER = ();
+%ITERATORS = ();
+sub DESTROY {
+ return unless $_[0]->isa('HASH');
+ my $self = tied(%{$_[0]});
+ return unless defined $self;
+ delete $ITERATORS{$self};
+ if (exists $OWNER{$self}) {
+ tinyWRAPc::delete_QoS($self);
+ delete $OWNER{$self};
+ }
+}
+
+*getQavg = *tinyWRAPc::QoS_getQavg;
+*getQ1 = *tinyWRAPc::QoS_getQ1;
+*getQ2 = *tinyWRAPc::QoS_getQ2;
+*getQ3 = *tinyWRAPc::QoS_getQ3;
+*getQ4 = *tinyWRAPc::QoS_getQ4;
+*getQ5 = *tinyWRAPc::QoS_getQ5;
+*getVideoInWidth = *tinyWRAPc::QoS_getVideoInWidth;
+*getVideoOutWidth = *tinyWRAPc::QoS_getVideoOutWidth;
+*getVideoInHeight = *tinyWRAPc::QoS_getVideoInHeight;
+*getVideoOutHeight = *tinyWRAPc::QoS_getVideoOutHeight;
+*getBandwidthDownKbps = *tinyWRAPc::QoS_getBandwidthDownKbps;
+*getBandwidthUpKbps = *tinyWRAPc::QoS_getBandwidthUpKbps;
+*getVideoInAvgFps = *tinyWRAPc::QoS_getVideoInAvgFps;
+*getVideoDecAvgTime = *tinyWRAPc::QoS_getVideoDecAvgTime;
+*getVideoEncAvgTime = *tinyWRAPc::QoS_getVideoEncAvgTime;
+sub DISOWN {
+ my $self = shift;
+ my $ptr = tied(%$self);
+ delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+ my $self = shift;
+ my $ptr = tied(%$self);
+ $OWNER{$ptr} = 1;
+}
+
+
############# Class : tinyWRAP::Codec ##############
package tinyWRAP::Codec;
@@ -233,6 +279,7 @@ sub DESTROY {
*sessionSetInt32 = *tinyWRAPc::MediaSessionMgr_sessionSetInt32;
*sessionGetInt32 = *tinyWRAPc::MediaSessionMgr_sessionGetInt32;
+*sessionGetQoS = *tinyWRAPc::MediaSessionMgr_sessionGetQoS;
*consumerSetInt32 = *tinyWRAPc::MediaSessionMgr_consumerSetInt32;
*consumerSetInt64 = *tinyWRAPc::MediaSessionMgr_consumerSetInt64;
*producerSetInt32 = *tinyWRAPc::MediaSessionMgr_producerSetInt32;
@@ -252,6 +299,8 @@ sub DESTROY {
*defaultsSetBandwidthVideoUploadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax;
*defaultsSetBandwidthVideoDownloadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax;
*defaultsSetPrefVideoSize = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize;
+*defaultsSetPrefVideoSizeOutRange = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange;
+*defaultsSetAdaptativeVideoSizeOutEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled;
*defaultsSetJbMargin = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin;
*defaultsSetJbMaxLateRate = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate;
*defaultsSetEchoTail = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail;
diff --git a/bindings/perl/tinyWRAP_wrap.cxx b/bindings/perl/tinyWRAP_wrap.cxx
index b968123..96b411f 100755
--- a/bindings/perl/tinyWRAP_wrap.cxx
+++ b/bindings/perl/tinyWRAP_wrap.cxx
@@ -1549,70 +1549,71 @@ SWIG_Perl_SetModule(swig_module_info *module) {
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
#define SWIGTYPE_p_PublicationEvent swig_types[33]
#define SWIGTYPE_p_PublicationSession swig_types[34]
-#define SWIGTYPE_p_RPMessage swig_types[35]
-#define SWIGTYPE_p_RegistrationEvent swig_types[36]
-#define SWIGTYPE_p_RegistrationSession swig_types[37]
-#define SWIGTYPE_p_SMSData swig_types[38]
-#define SWIGTYPE_p_SMSEncoder swig_types[39]
-#define SWIGTYPE_p_SafeObject swig_types[40]
-#define SWIGTYPE_p_SdpMessage swig_types[41]
-#define SWIGTYPE_p_SipCallback swig_types[42]
-#define SWIGTYPE_p_SipEvent swig_types[43]
-#define SWIGTYPE_p_SipMessage swig_types[44]
-#define SWIGTYPE_p_SipSession swig_types[45]
-#define SWIGTYPE_p_SipStack swig_types[46]
-#define SWIGTYPE_p_SipUri swig_types[47]
-#define SWIGTYPE_p_StackEvent swig_types[48]
-#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
-#define SWIGTYPE_p_SubscriptionSession swig_types[50]
-#define SWIGTYPE_p_T140Callback swig_types[51]
-#define SWIGTYPE_p_T140CallbackData swig_types[52]
-#define SWIGTYPE_p_XcapCallback swig_types[53]
-#define SWIGTYPE_p_XcapEvent swig_types[54]
-#define SWIGTYPE_p_XcapMessage swig_types[55]
-#define SWIGTYPE_p_XcapSelector swig_types[56]
-#define SWIGTYPE_p_XcapStack swig_types[57]
-#define SWIGTYPE_p_char swig_types[58]
-#define SWIGTYPE_p_int swig_types[59]
-#define SWIGTYPE_p_long_long swig_types[60]
-#define SWIGTYPE_p_short swig_types[61]
-#define SWIGTYPE_p_signed_char swig_types[62]
-#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
-#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
-#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
-#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
-#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
-#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
-#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
-#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
-#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
-#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
-#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
-#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
-#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
-#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
-#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
-#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
-#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
-#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
-#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
-#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
-#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
-#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
-#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
-#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
-#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
-#define SWIGTYPE_p_tsk_list_t swig_types[88]
-#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
-#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
-#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
-#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
-#define SWIGTYPE_p_unsigned_char swig_types[93]
-#define SWIGTYPE_p_unsigned_int swig_types[94]
-#define SWIGTYPE_p_unsigned_long_long swig_types[95]
-#define SWIGTYPE_p_unsigned_short swig_types[96]
-static swig_type_info *swig_types[98];
-static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
+#define SWIGTYPE_p_QoS swig_types[35]
+#define SWIGTYPE_p_RPMessage swig_types[36]
+#define SWIGTYPE_p_RegistrationEvent swig_types[37]
+#define SWIGTYPE_p_RegistrationSession swig_types[38]
+#define SWIGTYPE_p_SMSData swig_types[39]
+#define SWIGTYPE_p_SMSEncoder swig_types[40]
+#define SWIGTYPE_p_SafeObject swig_types[41]
+#define SWIGTYPE_p_SdpMessage swig_types[42]
+#define SWIGTYPE_p_SipCallback swig_types[43]
+#define SWIGTYPE_p_SipEvent swig_types[44]
+#define SWIGTYPE_p_SipMessage swig_types[45]
+#define SWIGTYPE_p_SipSession swig_types[46]
+#define SWIGTYPE_p_SipStack swig_types[47]
+#define SWIGTYPE_p_SipUri swig_types[48]
+#define SWIGTYPE_p_StackEvent swig_types[49]
+#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
+#define SWIGTYPE_p_SubscriptionSession swig_types[51]
+#define SWIGTYPE_p_T140Callback swig_types[52]
+#define SWIGTYPE_p_T140CallbackData swig_types[53]
+#define SWIGTYPE_p_XcapCallback swig_types[54]
+#define SWIGTYPE_p_XcapEvent swig_types[55]
+#define SWIGTYPE_p_XcapMessage swig_types[56]
+#define SWIGTYPE_p_XcapSelector swig_types[57]
+#define SWIGTYPE_p_XcapStack swig_types[58]
+#define SWIGTYPE_p_char swig_types[59]
+#define SWIGTYPE_p_int swig_types[60]
+#define SWIGTYPE_p_long_long swig_types[61]
+#define SWIGTYPE_p_short swig_types[62]
+#define SWIGTYPE_p_signed_char swig_types[63]
+#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
+#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
+#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
+#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
+#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
+#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
+#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
+#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
+#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
+#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
+#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
+#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
+#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
+#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
+#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
+#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
+#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
+#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
+#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
+#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
+#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
+#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
+#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
+#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
+#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
+#define SWIGTYPE_p_tsk_list_t swig_types[89]
+#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
+#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
+#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
+#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
+#define SWIGTYPE_p_unsigned_char swig_types[94]
+#define SWIGTYPE_p_unsigned_int swig_types[95]
+#define SWIGTYPE_p_unsigned_long_long swig_types[96]
+#define SWIGTYPE_p_unsigned_short swig_types[97]
+static swig_type_info *swig_types[99];
+static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -1996,6 +1997,20 @@ SWIG_AsVal_short SWIG_PERL_DECL_ARGS_2(SV * obj, short *val)
SWIGINTERNINLINE SV *
+SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
+{
+ return sv_2mortal(newSVnv(value));
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
+{
+ return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
@@ -2149,20 +2164,6 @@ SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val)
}
-SWIGINTERNINLINE SV *
-SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
-{
- return sv_2mortal(newSVnv(value));
-}
-
-
-SWIGINTERNINLINE SV *
-SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
-{
- return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
-}
-
-
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned short *val)
{
@@ -3110,6 +3111,453 @@ XS(_wrap_ActionConfig_setMediaInt) {
}
+XS(_wrap_delete_QoS) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: delete_QoS(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ delete arg1;
+ ST(argvi) = sv_newmortal();
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQavg) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQavg(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQavg();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ1) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ1(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ1();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ2) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ2(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ2();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ3) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ3(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ3();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ4) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ4(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ4();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ5) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ5(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ5();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInWidth) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInWidth(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoOutWidth) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoOutWidth(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInHeight) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInHeight(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoOutHeight) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoOutHeight(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getBandwidthDownKbps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getBandwidthDownKbps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getBandwidthUpKbps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getBandwidthUpKbps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInAvgFps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInAvgFps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoDecAvgTime) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoDecAvgTime(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoEncAvgTime) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoEncAvgTime(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_delete_Codec) {
{
Codec *arg1 = (Codec *) 0 ;
@@ -3468,6 +3916,44 @@ XS(_wrap_MediaSessionMgr_sessionGetInt32) {
}
+XS(_wrap_MediaSessionMgr_sessionGetQoS) {
+ {
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int argvi = 0;
+ QoS *result = 0 ;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: MediaSessionMgr_sessionGetQoS(self,media);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
+ }
+ arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
+ ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
+ }
+ arg2 = static_cast< twrap_media_type_t >(val2);
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_MediaSessionMgr_consumerSetInt32) {
{
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -4145,6 +4631,72 @@ XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSize) {
}
+XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange) {
+ {
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int argvi = 0;
+ bool result;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min,max);");
+ }
+ ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg1 = static_cast< tmedia_pref_video_size_t >(val1);
+ ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg2 = static_cast< tmedia_pref_video_size_t >(val2);
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled) {
+ {
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ int argvi = 0;
+ bool result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);");
+ }
+ ecode1 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_MediaSessionMgr_defaultsSetJbMargin) {
{
uint32_t arg1 ;
@@ -27523,6 +28075,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)"tinyWRAP::ProxyVideoProducerCallback", 0};
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)"tinyWRAP::PublicationEvent", 0};
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)"tinyWRAP::PublicationSession", 0};
+static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)"tinyWRAP::QoS", 0};
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)"tinyWRAP::RPMessage", 0};
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)"tinyWRAP::RegistrationEvent", 0};
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)"tinyWRAP::RegistrationSession", 0};
@@ -27622,6 +28175,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_ProxyVideoProducerCallback,
&_swigt__p_PublicationEvent,
&_swigt__p_PublicationSession,
+ &_swigt__p_QoS,
&_swigt__p_RPMessage,
&_swigt__p_RegistrationEvent,
&_swigt__p_RegistrationSession,
@@ -27721,6 +28275,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
@@ -27820,6 +28375,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_ProxyVideoProducerCallback,
_swigc__p_PublicationEvent,
_swigc__p_PublicationSession,
+ _swigc__p_QoS,
_swigc__p_RPMessage,
_swigc__p_RegistrationEvent,
_swigc__p_RegistrationSession,
@@ -27917,6 +28473,22 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::ActionConfig_setResponseLine", _wrap_ActionConfig_setResponseLine},
{"tinyWRAPc::ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString},
{"tinyWRAPc::ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt},
+{"tinyWRAPc::delete_QoS", _wrap_delete_QoS},
+{"tinyWRAPc::QoS_getQavg", _wrap_QoS_getQavg},
+{"tinyWRAPc::QoS_getQ1", _wrap_QoS_getQ1},
+{"tinyWRAPc::QoS_getQ2", _wrap_QoS_getQ2},
+{"tinyWRAPc::QoS_getQ3", _wrap_QoS_getQ3},
+{"tinyWRAPc::QoS_getQ4", _wrap_QoS_getQ4},
+{"tinyWRAPc::QoS_getQ5", _wrap_QoS_getQ5},
+{"tinyWRAPc::QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth},
+{"tinyWRAPc::QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth},
+{"tinyWRAPc::QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight},
+{"tinyWRAPc::QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight},
+{"tinyWRAPc::QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps},
+{"tinyWRAPc::QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps},
+{"tinyWRAPc::QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps},
+{"tinyWRAPc::QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime},
+{"tinyWRAPc::QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime},
{"tinyWRAPc::delete_Codec", _wrap_delete_Codec},
{"tinyWRAPc::Codec_getMediaType", _wrap_Codec_getMediaType},
{"tinyWRAPc::Codec_getName", _wrap_Codec_getName},
@@ -27928,6 +28500,7 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr},
{"tinyWRAPc::MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32},
{"tinyWRAPc::MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32},
+{"tinyWRAPc::MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS},
{"tinyWRAPc::MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32},
{"tinyWRAPc::MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64},
{"tinyWRAPc::MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32},
@@ -27947,6 +28520,8 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax},
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax},
{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize},
+{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange},
+{"tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled},
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin},
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate},
{"tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail},
@@ -28765,6 +29340,7 @@ XS(SWIG_init) {
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
SWIG_TypeClientData(SWIGTYPE_p_ActionConfig, (void*) "tinyWRAP::ActionConfig");
+ SWIG_TypeClientData(SWIGTYPE_p_QoS, (void*) "tinyWRAP::QoS");
SWIG_TypeClientData(SWIGTYPE_p_Codec, (void*) "tinyWRAP::Codec");
SWIG_TypeClientData(SWIGTYPE_p_MediaSessionMgr, (void*) "tinyWRAP::MediaSessionMgr");
SWIG_TypeClientData(SWIGTYPE_p_MediaContent, (void*) "tinyWRAP::MediaContent");
diff --git a/bindings/python/tinyWRAP.py b/bindings/python/tinyWRAP.py
index f08ac2e..4c45b08 100755
--- a/bindings/python/tinyWRAP.py
+++ b/bindings/python/tinyWRAP.py
@@ -151,6 +151,33 @@ class ActionConfig(_object):
ActionConfig_swigregister = _tinyWRAP.ActionConfig_swigregister
ActionConfig_swigregister(ActionConfig)
+class QoS(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, QoS, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, QoS, name)
+ def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+ __repr__ = _swig_repr
+ __swig_destroy__ = _tinyWRAP.delete_QoS
+ __del__ = lambda self : None;
+ def getQavg(self): return _tinyWRAP.QoS_getQavg(self)
+ def getQ1(self): return _tinyWRAP.QoS_getQ1(self)
+ def getQ2(self): return _tinyWRAP.QoS_getQ2(self)
+ def getQ3(self): return _tinyWRAP.QoS_getQ3(self)
+ def getQ4(self): return _tinyWRAP.QoS_getQ4(self)
+ def getQ5(self): return _tinyWRAP.QoS_getQ5(self)
+ def getVideoInWidth(self): return _tinyWRAP.QoS_getVideoInWidth(self)
+ def getVideoOutWidth(self): return _tinyWRAP.QoS_getVideoOutWidth(self)
+ def getVideoInHeight(self): return _tinyWRAP.QoS_getVideoInHeight(self)
+ def getVideoOutHeight(self): return _tinyWRAP.QoS_getVideoOutHeight(self)
+ def getBandwidthDownKbps(self): return _tinyWRAP.QoS_getBandwidthDownKbps(self)
+ def getBandwidthUpKbps(self): return _tinyWRAP.QoS_getBandwidthUpKbps(self)
+ def getVideoInAvgFps(self): return _tinyWRAP.QoS_getVideoInAvgFps(self)
+ def getVideoDecAvgTime(self): return _tinyWRAP.QoS_getVideoDecAvgTime(self)
+ def getVideoEncAvgTime(self): return _tinyWRAP.QoS_getVideoEncAvgTime(self)
+QoS_swigregister = _tinyWRAP.QoS_swigregister
+QoS_swigregister(QoS)
+
class Codec(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Codec, name, value)
@@ -181,6 +208,7 @@ class MediaSessionMgr(_object):
__del__ = lambda self : None;
def sessionSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionSetInt32(self, *args)
def sessionGetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetInt32(self, *args)
+ def sessionGetQoS(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetQoS(self, *args)
def consumerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt32(self, *args)
def consumerSetInt64(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt64(self, *args)
def producerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_producerSetInt32(self, *args)
@@ -211,6 +239,10 @@ class MediaSessionMgr(_object):
if _newclass:defaultsSetBandwidthVideoDownloadMax = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax)
__swig_getmethods__["defaultsSetPrefVideoSize"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
if _newclass:defaultsSetPrefVideoSize = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize)
+ __swig_getmethods__["defaultsSetPrefVideoSizeOutRange"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
+ if _newclass:defaultsSetPrefVideoSizeOutRange = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange)
+ __swig_getmethods__["defaultsSetAdaptativeVideoSizeOutEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
+ if _newclass:defaultsSetAdaptativeVideoSizeOutEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled)
__swig_getmethods__["defaultsSetJbMargin"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
if _newclass:defaultsSetJbMargin = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetJbMargin)
__swig_getmethods__["defaultsSetJbMaxLateRate"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMaxLateRate
@@ -374,6 +406,14 @@ def MediaSessionMgr_defaultsSetPrefVideoSize(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize(*args)
MediaSessionMgr_defaultsSetPrefVideoSize = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
+def MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args):
+ return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args)
+MediaSessionMgr_defaultsSetPrefVideoSizeOutRange = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
+
+def MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args):
+ return _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args)
+MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
+
def MediaSessionMgr_defaultsSetJbMargin(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin(*args)
MediaSessionMgr_defaultsSetJbMargin = _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
diff --git a/bindings/python/tinyWRAP_wrap.cxx b/bindings/python/tinyWRAP_wrap.cxx
index 1c61908..6adfc9f 100755
--- a/bindings/python/tinyWRAP_wrap.cxx
+++ b/bindings/python/tinyWRAP_wrap.cxx
@@ -3480,70 +3480,71 @@ namespace Swig {
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
#define SWIGTYPE_p_PublicationEvent swig_types[33]
#define SWIGTYPE_p_PublicationSession swig_types[34]
-#define SWIGTYPE_p_RPMessage swig_types[35]
-#define SWIGTYPE_p_RegistrationEvent swig_types[36]
-#define SWIGTYPE_p_RegistrationSession swig_types[37]
-#define SWIGTYPE_p_SMSData swig_types[38]
-#define SWIGTYPE_p_SMSEncoder swig_types[39]
-#define SWIGTYPE_p_SafeObject swig_types[40]
-#define SWIGTYPE_p_SdpMessage swig_types[41]
-#define SWIGTYPE_p_SipCallback swig_types[42]
-#define SWIGTYPE_p_SipEvent swig_types[43]
-#define SWIGTYPE_p_SipMessage swig_types[44]
-#define SWIGTYPE_p_SipSession swig_types[45]
-#define SWIGTYPE_p_SipStack swig_types[46]
-#define SWIGTYPE_p_SipUri swig_types[47]
-#define SWIGTYPE_p_StackEvent swig_types[48]
-#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
-#define SWIGTYPE_p_SubscriptionSession swig_types[50]
-#define SWIGTYPE_p_T140Callback swig_types[51]
-#define SWIGTYPE_p_T140CallbackData swig_types[52]
-#define SWIGTYPE_p_XcapCallback swig_types[53]
-#define SWIGTYPE_p_XcapEvent swig_types[54]
-#define SWIGTYPE_p_XcapMessage swig_types[55]
-#define SWIGTYPE_p_XcapSelector swig_types[56]
-#define SWIGTYPE_p_XcapStack swig_types[57]
-#define SWIGTYPE_p_char swig_types[58]
-#define SWIGTYPE_p_int swig_types[59]
-#define SWIGTYPE_p_long_long swig_types[60]
-#define SWIGTYPE_p_short swig_types[61]
-#define SWIGTYPE_p_signed_char swig_types[62]
-#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
-#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
-#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
-#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
-#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
-#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
-#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
-#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
-#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
-#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
-#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
-#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
-#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
-#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
-#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
-#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
-#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
-#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
-#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
-#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
-#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
-#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
-#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
-#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
-#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
-#define SWIGTYPE_p_tsk_list_t swig_types[88]
-#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
-#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
-#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
-#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
-#define SWIGTYPE_p_unsigned_char swig_types[93]
-#define SWIGTYPE_p_unsigned_int swig_types[94]
-#define SWIGTYPE_p_unsigned_long_long swig_types[95]
-#define SWIGTYPE_p_unsigned_short swig_types[96]
-static swig_type_info *swig_types[98];
-static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
+#define SWIGTYPE_p_QoS swig_types[35]
+#define SWIGTYPE_p_RPMessage swig_types[36]
+#define SWIGTYPE_p_RegistrationEvent swig_types[37]
+#define SWIGTYPE_p_RegistrationSession swig_types[38]
+#define SWIGTYPE_p_SMSData swig_types[39]
+#define SWIGTYPE_p_SMSEncoder swig_types[40]
+#define SWIGTYPE_p_SafeObject swig_types[41]
+#define SWIGTYPE_p_SdpMessage swig_types[42]
+#define SWIGTYPE_p_SipCallback swig_types[43]
+#define SWIGTYPE_p_SipEvent swig_types[44]
+#define SWIGTYPE_p_SipMessage swig_types[45]
+#define SWIGTYPE_p_SipSession swig_types[46]
+#define SWIGTYPE_p_SipStack swig_types[47]
+#define SWIGTYPE_p_SipUri swig_types[48]
+#define SWIGTYPE_p_StackEvent swig_types[49]
+#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
+#define SWIGTYPE_p_SubscriptionSession swig_types[51]
+#define SWIGTYPE_p_T140Callback swig_types[52]
+#define SWIGTYPE_p_T140CallbackData swig_types[53]
+#define SWIGTYPE_p_XcapCallback swig_types[54]
+#define SWIGTYPE_p_XcapEvent swig_types[55]
+#define SWIGTYPE_p_XcapMessage swig_types[56]
+#define SWIGTYPE_p_XcapSelector swig_types[57]
+#define SWIGTYPE_p_XcapStack swig_types[58]
+#define SWIGTYPE_p_char swig_types[59]
+#define SWIGTYPE_p_int swig_types[60]
+#define SWIGTYPE_p_long_long swig_types[61]
+#define SWIGTYPE_p_short swig_types[62]
+#define SWIGTYPE_p_signed_char swig_types[63]
+#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
+#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
+#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
+#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
+#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
+#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
+#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
+#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
+#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
+#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
+#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
+#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
+#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
+#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
+#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
+#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
+#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
+#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
+#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
+#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
+#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
+#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
+#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
+#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
+#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
+#define SWIGTYPE_p_tsk_list_t swig_types[89]
+#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
+#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
+#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
+#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
+#define SWIGTYPE_p_unsigned_char swig_types[94]
+#define SWIGTYPE_p_unsigned_int swig_types[95]
+#define SWIGTYPE_p_unsigned_long_long swig_types[96]
+#define SWIGTYPE_p_unsigned_short swig_types[97]
+static swig_type_info *swig_types[99];
+static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -4030,6 +4031,16 @@ SWIG_AsVal_short (PyObject * obj, short *val)
}
+ #define SWIG_From_double PyFloat_FromDouble
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_float (float value)
+{
+ return SWIG_From_double (value);
+}
+
+
SWIGINTERN int
SWIG_AsVal_long_SS_long (PyObject *obj, long long *val)
{
@@ -4113,16 +4124,6 @@ SWIG_AsVal_float (PyObject * obj, float *val)
}
- #define SWIG_From_double PyFloat_FromDouble
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_float (float value)
-{
- return SWIG_From_double (value);
-}
-
-
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
{
@@ -6273,6 +6274,364 @@ SWIGINTERN PyObject *ActionConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), P
return SWIG_Py_Void();
}
+SWIGINTERN PyObject *_wrap_delete_QoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_QoS",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQavg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQavg",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQavg();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ1",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ1();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ2",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ2();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ3",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ3();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ4",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ4();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ5",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ5();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInWidth",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoOutWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutWidth",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInHeight",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoOutHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutHeight",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getBandwidthDownKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthDownKbps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getBandwidthUpKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthUpKbps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInAvgFps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInAvgFps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoDecAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoDecAvgTime",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoEncAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoEncAvgTime",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *QoS_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_QoS, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
SWIGINTERN PyObject *_wrap_delete_Codec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
Codec *arg1 = (Codec *) 0 ;
@@ -6571,6 +6930,37 @@ fail:
}
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_sessionGetQoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ QoS *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_sessionGetQoS",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
+ }
+ arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
+ }
+ arg2 = static_cast< twrap_media_type_t >(val2);
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_MediaSessionMgr_consumerSetInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -7130,6 +7520,59 @@ fail:
}
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_defaultsSetPrefVideoSizeOutRange",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg1 = static_cast< tmedia_pref_video_size_t >(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg2 = static_cast< tmedia_pref_video_size_t >(val2);
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetJbMargin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
uint32_t arg1 ;
@@ -26276,6 +26719,23 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString, METH_VARARGS, NULL},
{ (char *)"ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt, METH_VARARGS, NULL},
{ (char *)"ActionConfig_swigregister", ActionConfig_swigregister, METH_VARARGS, NULL},
+ { (char *)"delete_QoS", _wrap_delete_QoS, METH_VARARGS, NULL},
+ { (char *)"QoS_getQavg", _wrap_QoS_getQavg, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ1", _wrap_QoS_getQ1, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ2", _wrap_QoS_getQ2, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ3", _wrap_QoS_getQ3, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ4", _wrap_QoS_getQ4, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ5", _wrap_QoS_getQ5, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight, METH_VARARGS, NULL},
+ { (char *)"QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps, METH_VARARGS, NULL},
+ { (char *)"QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime, METH_VARARGS, NULL},
+ { (char *)"QoS_swigregister", QoS_swigregister, METH_VARARGS, NULL},
{ (char *)"delete_Codec", _wrap_delete_Codec, METH_VARARGS, NULL},
{ (char *)"Codec_getMediaType", _wrap_Codec_getMediaType, METH_VARARGS, NULL},
{ (char *)"Codec_getName", _wrap_Codec_getName, METH_VARARGS, NULL},
@@ -26288,6 +26748,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32, METH_VARARGS, NULL},
@@ -26307,6 +26768,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail, METH_VARARGS, NULL},
@@ -26957,6 +27420,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)0, 0};
@@ -27056,6 +27520,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_ProxyVideoProducerCallback,
&_swigt__p_PublicationEvent,
&_swigt__p_PublicationSession,
+ &_swigt__p_QoS,
&_swigt__p_RPMessage,
&_swigt__p_RegistrationEvent,
&_swigt__p_RegistrationSession,
@@ -27155,6 +27620,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
@@ -27254,6 +27720,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_ProxyVideoProducerCallback,
_swigc__p_PublicationEvent,
_swigc__p_PublicationSession,
+ _swigc__p_QoS,
_swigc__p_RPMessage,
_swigc__p_RegistrationEvent,
_swigc__p_RegistrationSession,
diff --git a/bindings/ruby/tinyWRAP_wrap.cxx b/bindings/ruby/tinyWRAP_wrap.cxx
index 4eed3a9..59e5696 100755
--- a/bindings/ruby/tinyWRAP_wrap.cxx
+++ b/bindings/ruby/tinyWRAP_wrap.cxx
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.40
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGRUBY
@@ -14,24 +14,43 @@
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
- struct SwigMovePointer {
- T *ptr;
- SwigMovePointer(T *p) : ptr(p) { }
- ~SwigMovePointer() { delete ptr; }
- SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
- } pointer;
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
- SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+template<typename T> class SwigValueWrapper
+{
+ struct SwigMovePointer {
+ T *ptr;
+ SwigMovePointer(T *p) : ptr(p) { }
+ ~SwigMovePointer() {
+ delete ptr;
+ }
+ SwigMovePointer& operator=(SwigMovePointer& rhs) {
+ T* oldptr = ptr;
+ ptr = 0;
+ delete oldptr;
+ ptr = rhs.ptr;
+ rhs.ptr = 0;
+ return *this;
+ }
+ } pointer;
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
- SwigValueWrapper() : pointer(0) { }
- SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
- operator T&() const { return *pointer.ptr; }
- T *operator&() { return pointer.ptr; }
+ SwigValueWrapper() : pointer(0) { }
+ SwigValueWrapper& operator=(const T& t) {
+ SwigMovePointer tmp(new T(t));
+ pointer = tmp;
+ return *this;
+ }
+ operator T&() const {
+ return *pointer.ptr;
+ }
+ T *operator&() {
+ return pointer.ptr;
+ }
};
-template <typename T> T SwigValueInit() {
- return T();
+template <typename T> T SwigValueInit()
+{
+ return T();
}
#endif
@@ -66,28 +85,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -130,7 +149,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -175,28 +194,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -239,7 +258,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -277,7 +296,7 @@ template <typename T> T SwigValueInit() {
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
-
+
But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike.
*/
@@ -303,16 +322,16 @@ template <typename T> T SwigValueInit() {
#define SWIG_POINTER_OWN 0x1
-/*
+/*
Flags/methods for returning states.
-
- The SWIG conversion methods, as ConvertPtr, return and integer
+
+ The SWIG conversion methods, as ConvertPtr, return and integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
-
+
Use the following macros/flags to set or process the returning
states.
-
+
In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -345,23 +364,23 @@ template <typename T> T SwigValueInit() {
} else {
// fail code
}
-
+
I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as
- int SWIG_ConvertPtr(obj, ptr,...) {
- if (<obj is ok>) {
- if (<need new object>) {
- *ptr = <ptr to new allocated object>;
- return SWIG_NEWOBJ;
- } else {
- *ptr = <ptr to old object>;
- return SWIG_OLDOBJ;
- }
- } else {
- return SWIG_BADOBJ;
- }
+ int SWIG_ConvertPtr(obj, ptr,...) {
+ if (<obj is ok>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
}
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -375,17 +394,17 @@ template <typename T> T SwigValueInit() {
int fooi(int);
and you call
-
+
food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState()
*/
-#define SWIG_OK (0)
+#define SWIG_OK (0)
#define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0)
-#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8)
@@ -416,11 +435,13 @@ template <typename T> T SwigValueInit() {
# endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) {
- return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+SWIGINTERNINLINE int SWIG_AddCast(int r)
+{
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
-SWIGINTERNINLINE int SWIG_CheckState(int r) {
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+SWIGINTERNINLINE int SWIG_CheckState(int r)
+{
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
# define SWIG_AddCast
@@ -439,35 +460,35 @@ typedef struct swig_type_info *(*swig_dycast_func)(void **);
/* Structure to store information on one type */
typedef struct swig_type_info {
- const char *name; /* mangled name of this type */
- const char *str; /* human readable name of this type */
- swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
- struct swig_cast_info *cast; /* linked list of types that can cast into this type */
- void *clientdata; /* language specific type data */
- int owndata; /* flag if the structure owns the clientdata */
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
- swig_type_info *type; /* pointer to type that is equivalent to this type */
- swig_converter_func converter; /* function to cast the void pointers */
- struct swig_cast_info *next; /* pointer to next cast in linked list */
- struct swig_cast_info *prev; /* pointer to the previous cast */
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
} swig_cast_info;
/* Structure used to store module information
* Each module generates one structure like this, and the runtime collects
* all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
- swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
- size_t size; /* Number of types in this module */
- struct swig_module_info *next; /* Pointer to next element in circularly linked list */
- swig_type_info **type_initial; /* Array of initially generated type structures */
- swig_cast_info **cast_initial; /* Array of initially generated casting structures */
- void *clientdata; /* Language specific module data */
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
} swig_module_info;
-/*
+/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
@@ -476,13 +497,20 @@ typedef struct swig_module_info {
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
- const char *f2, const char *l2) {
- for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
- while ((*f1 == ' ') && (f1 != l1)) ++f1;
- while ((*f2 == ' ') && (f2 != l2)) ++f2;
- if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
- }
- return (int)((l1 - f1) - (l2 - f2));
+ const char *f2, const char *l2)
+{
+ for (; (f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) {
+ ++f1;
+ }
+ while ((*f2 == ' ') && (f2 != l2)) {
+ ++f2;
+ }
+ if (*f1 != *f2) {
+ return (*f1 > *f2) ? 1 : -1;
+ }
+ }
+ return (int)((l1 - f1) - (l2 - f2));
}
/*
@@ -490,18 +518,23 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
- int equiv = 0;
- const char* te = tb + strlen(tb);
- const char* ne = nb;
- while (!equiv && *ne) {
- for (nb = ne; *ne; ++ne) {
- if (*ne == '|') break;
+SWIG_TypeEquiv(const char *nb, const char *tb)
+{
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') {
+ break;
+ }
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) {
+ ++ne;
+ }
}
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
- if (*ne) ++ne;
- }
- return equiv;
+ return equiv;
}
/*
@@ -509,18 +542,23 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
- int equiv = 0;
- const char* te = tb + strlen(tb);
- const char* ne = nb;
- while (!equiv && *ne) {
- for (nb = ne; *ne; ++ne) {
- if (*ne == '|') break;
+SWIG_TypeCompare(const char *nb, const char *tb)
+{
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') {
+ break;
+ }
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) {
+ ++ne;
+ }
}
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
- if (*ne) ++ne;
- }
- return equiv;
+ return equiv;
}
@@ -528,84 +566,101 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
Check the typename
*/
SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
- if (ty) {
- swig_cast_info *iter = ty->cast;
- while (iter) {
- if (strcmp(iter->type->name, c) == 0) {
- if (iter == ty->cast)
- return iter;
- /* Move iter to the top of the linked list */
- iter->prev->next = iter->next;
- if (iter->next)
- iter->next->prev = iter->prev;
- iter->next = ty->cast;
- iter->prev = 0;
- if (ty->cast) ty->cast->prev = iter;
- ty->cast = iter;
- return iter;
- }
- iter = iter->next;
+SWIG_TypeCheck(const char *c, swig_type_info *ty)
+{
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (strcmp(iter->type->name, c) == 0) {
+ if (iter == ty->cast) {
+ return iter;
+ }
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next) {
+ iter->next->prev = iter->prev;
+ }
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) {
+ ty->cast->prev = iter;
+ }
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
}
- }
- return 0;
+ return 0;
}
-/*
+/*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
- if (ty) {
- swig_cast_info *iter = ty->cast;
- while (iter) {
- if (iter->type == from) {
- if (iter == ty->cast)
- return iter;
- /* Move iter to the top of the linked list */
- iter->prev->next = iter->next;
- if (iter->next)
- iter->next->prev = iter->prev;
- iter->next = ty->cast;
- iter->prev = 0;
- if (ty->cast) ty->cast->prev = iter;
- ty->cast = iter;
- return iter;
- }
- iter = iter->next;
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
+{
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (iter->type == from) {
+ if (iter == ty->cast) {
+ return iter;
+ }
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next) {
+ iter->next->prev = iter->prev;
+ }
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) {
+ ty->cast->prev = iter;
+ }
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
}
- }
- return 0;
+ return 0;
}
/*
Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
+{
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}
-/*
+/*
Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
- swig_type_info *lastty = ty;
- if (!ty || !ty->dcast) return ty;
- while (ty && (ty->dcast)) {
- ty = (*ty->dcast)(ptr);
- if (ty) lastty = ty;
- }
- return lastty;
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
+{
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) {
+ return ty;
+ }
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) {
+ lastty = ty;
+ }
+ }
+ return lastty;
}
/*
Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
-SWIG_TypeName(const swig_type_info *ty) {
- return ty->name;
+SWIG_TypeName(const swig_type_info *ty)
+{
+ return ty->name;
}
/*
@@ -613,224 +668,264 @@ SWIG_TypeName(const swig_type_info *ty) {
that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
- /* The "str" field contains the equivalent pretty names of the
- type, separated by vertical-bar characters. We choose
- to print the last name, as it is often (?) the most
- specific. */
- if (!type) return NULL;
- if (type->str != NULL) {
- const char *last_name = type->str;
- const char *s;
- for (s = type->str; *s; s++)
- if (*s == '|') last_name = s+1;
- return last_name;
- }
- else
- return type->name;
-}
-
-/*
+SWIG_TypePrettyName(const swig_type_info *type)
+{
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) {
+ return NULL;
+ }
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') {
+ last_name = s+1;
+ }
+ return last_name;
+ }
+ else {
+ return type->name;
+ }
+}
+
+/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
- swig_cast_info *cast = ti->cast;
- /* if (ti->clientdata == clientdata) return; */
- ti->clientdata = clientdata;
-
- while (cast) {
- if (!cast->converter) {
- swig_type_info *tc = cast->type;
- if (!tc->clientdata) {
- SWIG_TypeClientData(tc, clientdata);
- }
- }
- cast = cast->next;
- }
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
+{
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
}
SWIGRUNTIME void
-SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
- SWIG_TypeClientData(ti, clientdata);
- ti->owndata = 1;
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
+{
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
}
-
+
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)
-
- We start searching at module start, and finish searching when start == end.
+
+ We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start,
- swig_module_info *end,
- const char *name) {
- swig_module_info *iter = start;
- do {
- if (iter->size) {
- register size_t l = 0;
- register size_t r = iter->size - 1;
- do {
- /* since l+r >= 0, we can (>> 1) instead (/ 2) */
- register size_t i = (l + r) >> 1;
- const char *iname = iter->types[i]->name;
- if (iname) {
- register int compare = strcmp(name, iname);
- if (compare == 0) {
- return iter->types[i];
- } else if (compare < 0) {
- if (i) {
- r = i - 1;
- } else {
- break;
- }
- } else if (compare > 0) {
- l = i + 1;
- }
- } else {
- break; /* should never happen */
- }
- } while (l <= r);
- }
- iter = iter->next;
- } while (iter != end);
- return 0;
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name)
+{
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ }
+ else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ }
+ else {
+ break;
+ }
+ }
+ else if (compare > 0) {
+ l = i + 1;
+ }
+ }
+ else {
+ break; /* should never happen */
+ }
+ }
+ while (l <= r);
+ }
+ iter = iter->next;
+ }
+ while (iter != end);
+ return 0;
}
/*
Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types).
-
- We start searching at module start, and finish searching when start == end.
+
+ We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start,
- swig_module_info *end,
- const char *name) {
- /* STEP 1: Search the name field using binary search */
- swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
- if (ret) {
- return ret;
- } else {
- /* STEP 2: If the type hasn't been found, do a complete search
- of the str field (the human readable name) */
- swig_module_info *iter = start;
- do {
- register size_t i = 0;
- for (; i < iter->size; ++i) {
- if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
- return iter->types[i];
- }
- iter = iter->next;
- } while (iter != end);
- }
-
- /* neither found a match */
- return 0;
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name)
+{
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ }
+ else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) {
+ return iter->types[i];
+ }
+ }
+ iter = iter->next;
+ }
+ while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
}
-/*
+/*
Pack binary data into a string
*/
SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
- static const char hex[17] = "0123456789abcdef";
- register const unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register unsigned char uu = *u;
- *(c++) = hex[(uu & 0xf0) >> 4];
- *(c++) = hex[uu & 0xf];
- }
- return c;
-}
-
-/*
+SWIG_PackData(char *c, void *ptr, size_t sz)
+{
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
Unpack binary data from a string
*/
SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
- register unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register char d = *(c++);
- register unsigned char uu;
- if ((d >= '0') && (d <= '9'))
- uu = ((d - '0') << 4);
- else if ((d >= 'a') && (d <= 'f'))
- uu = ((d - ('a'-10)) << 4);
- else
- return (char *) 0;
- d = *(c++);
- if ((d >= '0') && (d <= '9'))
- uu |= (d - '0');
- else if ((d >= 'a') && (d <= 'f'))
- uu |= (d - ('a'-10));
- else
- return (char *) 0;
- *u = uu;
- }
- return c;
-}
-
-/*
+SWIG_UnpackData(const char *c, void *ptr, size_t sz)
+{
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9')) {
+ uu = ((d - '0') << 4);
+ }
+ else if ((d >= 'a') && (d <= 'f')) {
+ uu = ((d - ('a'-10)) << 4);
+ }
+ else {
+ return (char *) 0;
+ }
+ d = *(c++);
+ if ((d >= '0') && (d <= '9')) {
+ uu |= (d - '0');
+ }
+ else if ((d >= 'a') && (d <= 'f')) {
+ uu |= (d - ('a'-10));
+ }
+ else {
+ return (char *) 0;
+ }
+ *u = uu;
+ }
+ return c;
+}
+
+/*
Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
- char *r = buff;
- if ((2*sizeof(void *) + 2) > bsz) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r,&ptr,sizeof(void *));
- if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
- strcpy(r,name);
- return buff;
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
+{
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) {
+ return 0;
+ }
+ strcpy(r,name);
+ return buff;
}
SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
- if (*c != '_') {
- if (strcmp(c,"NULL") == 0) {
- *ptr = (void *) 0;
- return name;
- } else {
- return 0;
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
+{
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ }
+ else {
+ return 0;
+ }
}
- }
- return SWIG_UnpackData(++c,ptr,sizeof(void *));
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
}
SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
- char *r = buff;
- size_t lname = (name ? strlen(name) : 0);
- if ((2*sz + 2 + lname) > bsz) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r,ptr,sz);
- if (lname) {
- strncpy(r,name,lname+1);
- } else {
- *r = 0;
- }
- return buff;
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
+{
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ }
+ else {
+ *r = 0;
+ }
+ return buff;
}
SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
- if (*c != '_') {
- if (strcmp(c,"NULL") == 0) {
- memset(ptr,0,sz);
- return name;
- } else {
- return 0;
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
+{
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ }
+ else {
+ return 0;
+ }
}
- }
- return SWIG_UnpackData(++c,ptr,sz);
+ return SWIG_UnpackData(++c,ptr,sz);
}
#ifdef __cplusplus
@@ -838,18 +933,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
#endif
/* Errors in SWIG */
-#define SWIG_UnknownError -1
-#define SWIG_IOError -2
-#define SWIG_RuntimeError -3
-#define SWIG_IndexError -4
-#define SWIG_TypeError -5
-#define SWIG_DivisionByZero -6
-#define SWIG_OverflowError -7
-#define SWIG_SyntaxError -8
-#define SWIG_ValueError -9
+#define SWIG_UnknownError -1
+#define SWIG_IOError -2
+#define SWIG_RuntimeError -3
+#define SWIG_IndexError -4
+#define SWIG_TypeError -5
+#define SWIG_DivisionByZero -6
+#define SWIG_OverflowError -7
+#define SWIG_SyntaxError -8
+#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
-#define SWIG_MemoryError -12
+#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
@@ -954,7 +1049,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
* can be passed as an argument to API functions like Data_Wrap_Struct()
* and Data_Make_Struct().
*/
-
+
#ifdef __cplusplus
# ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
# define PROTECTFUNC(f) ((VALUE (*)()) f)
@@ -1016,146 +1111,146 @@ static VALUE _mSWIG = Qnil;
exceptions. Note this only works for C++ since a global cannot be
initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
-SWIGINTERN VALUE
-getNullReferenceError(void) {
- static int init = 0;
- static VALUE rb_eNullReferenceError ;
- if (!init) {
- init = 1;
- rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
- }
- return rb_eNullReferenceError;
-}
-
-SWIGINTERN VALUE
-getObjectPreviouslyDeletedError(void) {
- static int init = 0;
- static VALUE rb_eObjectPreviouslyDeleted ;
- if (!init) {
- init = 1;
- rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
- }
- return rb_eObjectPreviouslyDeleted;
-}
+SWIGINTERN VALUE
+getNullReferenceError(void)
+{
+ static int init = 0;
+ static VALUE rb_eNullReferenceError ;
+ if (!init) {
+ init = 1;
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
+ }
+ return rb_eNullReferenceError;
+}
+
+SWIGINTERN VALUE
+getObjectPreviouslyDeletedError(void)
+{
+ static int init = 0;
+ static VALUE rb_eObjectPreviouslyDeleted ;
+ if (!init) {
+ init = 1;
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
+ }
+ return rb_eObjectPreviouslyDeleted;
+}
SWIGINTERN VALUE
-SWIG_Ruby_ErrorType(int SWIG_code) {
- VALUE type;
- switch (SWIG_code) {
- case SWIG_MemoryError:
- type = rb_eNoMemError;
- break;
- case SWIG_IOError:
- type = rb_eIOError;
- break;
- case SWIG_RuntimeError:
- type = rb_eRuntimeError;
- break;
- case SWIG_IndexError:
- type = rb_eIndexError;
- break;
- case SWIG_TypeError:
- type = rb_eTypeError;
- break;
- case SWIG_DivisionByZero:
- type = rb_eZeroDivError;
- break;
- case SWIG_OverflowError:
- type = rb_eRangeError;
- break;
- case SWIG_SyntaxError:
- type = rb_eSyntaxError;
- break;
- case SWIG_ValueError:
- type = rb_eArgError;
- break;
- case SWIG_SystemError:
- type = rb_eFatal;
- break;
- case SWIG_AttributeError:
- type = rb_eRuntimeError;
- break;
- case SWIG_NullReferenceError:
- type = getNullReferenceError();
- break;
- case SWIG_ObjectPreviouslyDeletedError:
- type = getObjectPreviouslyDeletedError();
- break;
- case SWIG_UnknownError:
- type = rb_eRuntimeError;
- break;
- default:
- type = rb_eRuntimeError;
- }
- return type;
+SWIG_Ruby_ErrorType(int SWIG_code)
+{
+ VALUE type;
+ switch (SWIG_code) {
+ case SWIG_MemoryError:
+ type = rb_eNoMemError;
+ break;
+ case SWIG_IOError:
+ type = rb_eIOError;
+ break;
+ case SWIG_RuntimeError:
+ type = rb_eRuntimeError;
+ break;
+ case SWIG_IndexError:
+ type = rb_eIndexError;
+ break;
+ case SWIG_TypeError:
+ type = rb_eTypeError;
+ break;
+ case SWIG_DivisionByZero:
+ type = rb_eZeroDivError;
+ break;
+ case SWIG_OverflowError:
+ type = rb_eRangeError;
+ break;
+ case SWIG_SyntaxError:
+ type = rb_eSyntaxError;
+ break;
+ case SWIG_ValueError:
+ type = rb_eArgError;
+ break;
+ case SWIG_SystemError:
+ type = rb_eFatal;
+ break;
+ case SWIG_AttributeError:
+ type = rb_eRuntimeError;
+ break;
+ case SWIG_NullReferenceError:
+ type = getNullReferenceError();
+ break;
+ case SWIG_ObjectPreviouslyDeletedError:
+ type = getObjectPreviouslyDeletedError();
+ break;
+ case SWIG_UnknownError:
+ type = rb_eRuntimeError;
+ break;
+ default:
+ type = rb_eRuntimeError;
+ }
+ return type;
}
/* This function is called when a user inputs a wrong argument to
a method.
*/
-SWIGINTERN
+SWIGINTERN
const char* Ruby_Format_TypeError( const char* msg,
- const char* type,
- const char* name,
- const int argn,
- VALUE input )
-{
- char buf[128];
- VALUE str;
- VALUE asStr;
- if ( msg && *msg )
- {
- str = rb_str_new2(msg);
+ const char* type,
+ const char* name,
+ const int argn,
+ VALUE input )
+{
+ char buf[128];
+ VALUE str;
+ VALUE asStr;
+ if ( msg && *msg ) {
+ str = rb_str_new2(msg);
}
- else
- {
- str = rb_str_new(NULL, 0);
- }
-
- str = rb_str_cat2( str, "Expected argument " );
- sprintf( buf, "%d of type ", argn-1 );
- str = rb_str_cat2( str, buf );
- str = rb_str_cat2( str, type );
- str = rb_str_cat2( str, ", but got " );
- str = rb_str_cat2( str, rb_obj_classname(input) );
- str = rb_str_cat2( str, " " );
- asStr = rb_inspect(input);
- if ( RSTRING_LEN(asStr) > 30 )
- {
- str = rb_str_cat( str, StringValuePtr(asStr), 30 );
- str = rb_str_cat2( str, "..." );
+ else {
+ str = rb_str_new(NULL, 0);
}
- else
- {
- str = rb_str_append( str, asStr );
+
+ str = rb_str_cat2( str, "Expected argument " );
+ sprintf( buf, "%d of type ", argn-1 );
+ str = rb_str_cat2( str, buf );
+ str = rb_str_cat2( str, type );
+ str = rb_str_cat2( str, ", but got " );
+ str = rb_str_cat2( str, rb_obj_classname(input) );
+ str = rb_str_cat2( str, " " );
+ asStr = rb_inspect(input);
+ if ( RSTRING_LEN(asStr) > 30 ) {
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
+ str = rb_str_cat2( str, "..." );
+ }
+ else {
+ str = rb_str_append( str, asStr );
}
- if ( name )
- {
- str = rb_str_cat2( str, "\n\tin SWIG method '" );
- str = rb_str_cat2( str, name );
- str = rb_str_cat2( str, "'" );
+ if ( name ) {
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
+ str = rb_str_cat2( str, name );
+ str = rb_str_cat2( str, "'" );
}
- return StringValuePtr( str );
+ return StringValuePtr( str );
}
/* This function is called when an overloaded method fails */
-SWIGINTERN
+SWIGINTERN
void Ruby_Format_OverloadedError(
- const int argc,
- const int maxargs,
- const char* method,
- const char* prototypes
- )
+ const int argc,
+ const int maxargs,
+ const char* method,
+ const char* prototypes
+)
{
- const char* msg = "Wrong # of arguments";
- if ( argc <= maxargs ) msg = "Wrong arguments";
- rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
- "Possible C/C++ prototypes are:\n%s",
- msg, method, prototypes);
+ const char* msg = "Wrong # of arguments";
+ if ( argc <= maxargs ) {
+ msg = "Wrong arguments";
+ }
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
+ "Possible C/C++ prototypes are:\n%s",
+ msg, method, prototypes);
}
/* -----------------------------------------------------------------------------
@@ -1164,7 +1259,7 @@ void Ruby_Format_OverloadedError(
*
* rubytracking.swg
*
- * This file contains support for tracking mappings from
+ * This file contains support for tracking mappings from
* Ruby objects to C++ objects. This functionality is needed
* to implement mark functions for Ruby's mark and sweep
* garbage collector.
@@ -1187,7 +1282,7 @@ extern "C" {
/* Global Ruby hash table to store Trackings from C/C++
- structs to Ruby Objects.
+ structs to Ruby Objects.
*/
static VALUE swig_ruby_trackings = Qnil;
@@ -1196,122 +1291,129 @@ static VALUE swig_ruby_trackings = Qnil;
static ID swig_ruby_hash_delete;
/* Setup a Ruby hash table to store Trackings */
-SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
- /* Create a ruby hash table to store Trackings from C++
- objects to Ruby objects. */
-
- /* Try to see if some other .so has already created a
- tracking hash table, which we keep hidden in an instance var
- in the SWIG module.
- This is done to allow multiple DSOs to share the same
- tracking table.
- */
- ID trackings_id = rb_intern( "@__trackings__" );
- VALUE verbose = rb_gv_get("VERBOSE");
- rb_gv_set("VERBOSE", Qfalse);
- swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
- rb_gv_set("VERBOSE", verbose);
-
- /* No, it hasn't. Create one ourselves */
- if ( swig_ruby_trackings == Qnil )
- {
- swig_ruby_trackings = rb_hash_new();
- rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
+SWIGRUNTIME void SWIG_RubyInitializeTrackings(void)
+{
+ /* Create a ruby hash table to store Trackings from C++
+ objects to Ruby objects. */
+
+ /* Try to see if some other .so has already created a
+ tracking hash table, which we keep hidden in an instance var
+ in the SWIG module.
+ This is done to allow multiple DSOs to share the same
+ tracking table.
+ */
+ ID trackings_id = rb_intern( "@__trackings__" );
+ VALUE verbose = rb_gv_get("VERBOSE");
+ rb_gv_set("VERBOSE", Qfalse);
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
+ rb_gv_set("VERBOSE", verbose);
+
+ /* No, it hasn't. Create one ourselves */
+ if ( swig_ruby_trackings == Qnil ) {
+ swig_ruby_trackings = rb_hash_new();
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
}
- /* Now store a reference to the hash table delete function
- so that we only have to look it up once.*/
- swig_ruby_hash_delete = rb_intern("delete");
+ /* Now store a reference to the hash table delete function
+ so that we only have to look it up once.*/
+ swig_ruby_hash_delete = rb_intern("delete");
}
/* Get a Ruby number to reference a pointer */
-SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
- /* We cast the pointer to an unsigned long
- and then store a reference to it using
- a Ruby number object. */
+SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr)
+{
+ /* We cast the pointer to an unsigned long
+ and then store a reference to it using
+ a Ruby number object. */
- /* Convert the pointer to a Ruby number */
- return SWIG2NUM(ptr);
+ /* Convert the pointer to a Ruby number */
+ return SWIG2NUM(ptr);
}
/* Get a Ruby number to reference an object */
-SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
- /* We cast the object to an unsigned long
- and then store a reference to it using
- a Ruby number object. */
+SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object)
+{
+ /* We cast the object to an unsigned long
+ and then store a reference to it using
+ a Ruby number object. */
- /* Convert the Object to a Ruby number */
- return SWIG2NUM(object);
+ /* Convert the Object to a Ruby number */
+ return SWIG2NUM(object);
}
/* Get a Ruby object from a previously stored reference */
-SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
- /* The provided Ruby number object is a reference
- to the Ruby object we want.*/
+SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference)
+{
+ /* The provided Ruby number object is a reference
+ to the Ruby object we want.*/
- /* Convert the Ruby number to a Ruby object */
- return NUM2SWIG(reference);
+ /* Convert the Ruby number to a Ruby object */
+ return NUM2SWIG(reference);
}
/* Add a Tracking from a C/C++ struct to a Ruby object */
-SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
- /* In a Ruby hash table we store the pointer and
- the associated Ruby object. The trick here is
- that we cannot store the Ruby object directly - if
- we do then it cannot be garbage collected. So
- instead we typecast it as a unsigned long and
- convert it to a Ruby number object.*/
+SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object)
+{
+ /* In a Ruby hash table we store the pointer and
+ the associated Ruby object. The trick here is
+ that we cannot store the Ruby object directly - if
+ we do then it cannot be garbage collected. So
+ instead we typecast it as a unsigned long and
+ convert it to a Ruby number object.*/
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
- /* Get a reference to the Ruby object as a Ruby number */
- VALUE value = SWIG_RubyObjectToReference(object);
+ /* Get a reference to the Ruby object as a Ruby number */
+ VALUE value = SWIG_RubyObjectToReference(object);
- /* Store the mapping to the global hash table. */
- rb_hash_aset(swig_ruby_trackings, key, value);
+ /* Store the mapping to the global hash table. */
+ rb_hash_aset(swig_ruby_trackings, key, value);
}
/* Get the Ruby object that owns the specified C/C++ struct */
-SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
-
- /* Now lookup the value stored in the global hash table */
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
-
- if (value == Qnil) {
- /* No object exists - return nil. */
- return Qnil;
- }
- else {
- /* Convert this value to Ruby object */
- return SWIG_RubyReferenceToObject(value);
- }
+SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr)
+{
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
+
+ /* Now lookup the value stored in the global hash table */
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
+
+ if (value == Qnil) {
+ /* No object exists - return nil. */
+ return Qnil;
+ }
+ else {
+ /* Convert this value to Ruby object */
+ return SWIG_RubyReferenceToObject(value);
+ }
}
/* Remove a Tracking from a C/C++ struct to a Ruby object. It
is very important to remove objects once they are destroyed
since the same memory address may be reused later to create
a new object. */
-SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
+SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr)
+{
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
- /* Delete the object from the hash table by calling Ruby's
- do this we need to call the Hash.delete method.*/
- rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
+ /* Delete the object from the hash table by calling Ruby's
+ do this we need to call the Hash.delete method.*/
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
}
/* This is a helper method that unlinks a Ruby object from its
underlying C++ object. This is needed if the lifetime of the
Ruby object is longer than the C++ object */
-SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
- VALUE object = SWIG_RubyInstanceFor(ptr);
+SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr)
+{
+ VALUE object = SWIG_RubyInstanceFor(ptr);
- if (object != Qnil) {
- DATA_PTR(object) = 0;
- }
+ if (object != Qnil) {
+ DATA_PTR(object) = 0;
+ }
}
@@ -1328,23 +1430,25 @@ extern "C" {
#endif
SWIGINTERN VALUE
-SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
- if (NIL_P(target)) {
- target = o;
- } else {
- if (TYPE(target) != T_ARRAY) {
- VALUE o2 = target;
- target = rb_ary_new();
- rb_ary_push(target, o2);
+SWIG_Ruby_AppendOutput(VALUE target, VALUE o)
+{
+ if (NIL_P(target)) {
+ target = o;
}
- rb_ary_push(target, o);
- }
- return target;
+ else {
+ if (TYPE(target) != T_ARRAY) {
+ VALUE o2 = target;
+ target = rb_ary_new();
+ rb_ary_push(target, o2);
+ }
+ rb_ary_push(target, o);
+ }
+ return target;
}
/* For ruby1.8.4 and earlier. */
#ifndef RUBY_INIT_STACK
- RUBY_EXTERN void Init_stack(VALUE* addr);
+RUBY_EXTERN void Init_stack(VALUE* addr);
# define RUBY_INIT_STACK \
VALUE variable_in_this_stack_frame; \
Init_stack(&variable_in_this_stack_frame);
@@ -1396,24 +1500,24 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
/* Runtime API */
-#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
+#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
/* Error manipulation */
-#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
+#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
-#define SWIG_fail goto fail
+#define SWIG_fail goto fail
/* Ruby-specific SWIG API */
-#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
+#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
-#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
-#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
+#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
+#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
#include "assert.h"
@@ -1426,11 +1530,11 @@ extern "C" {
#endif
typedef struct {
- VALUE klass;
- VALUE mImpl;
- void (*mark)(void *);
- void (*destroy)(void *);
- int trackObjects;
+ VALUE klass;
+ VALUE mImpl;
+ void (*mark)(void *);
+ void (*destroy)(void *);
+ int trackObjects;
} swig_class;
@@ -1444,9 +1548,9 @@ static ID swig_call_id = 0;
/*
If your swig extension is to be run within an embedded ruby and has
- director callbacks, you should set -DRUBY_EMBEDDED during compilation.
- This will reset ruby's stack frame on each entry point from the main
- program the first time a virtual director function is invoked (in a
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
+ This will reset ruby's stack frame on each entry point from the main
+ program the first time a virtual director function is invoked (in a
non-recursive way).
If this is not done, you run the risk of Ruby trashing the stack.
*/
@@ -1460,7 +1564,7 @@ static ID swig_call_id = 0;
# define Ruby_DirectorTypeMismatchException(x) \
rb_raise( rb_eTypeError, x ); return c_result;
- static unsigned int swig_virtual_calls = 0;
+static unsigned int swig_virtual_calls = 0;
#else /* normal non-embedded extension */
@@ -1472,294 +1576,319 @@ static ID swig_call_id = 0;
#endif /* RUBY_EMBEDDED */
-SWIGRUNTIME VALUE
-getExceptionClass(void) {
- static int init = 0;
- static VALUE rubyExceptionClass ;
- if (!init) {
- init = 1;
- rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
- }
- return rubyExceptionClass;
-}
+SWIGRUNTIME VALUE
+getExceptionClass(void)
+{
+ static int init = 0;
+ static VALUE rubyExceptionClass ;
+ if (!init) {
+ init = 1;
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
+ }
+ return rubyExceptionClass;
+}
/* This code checks to see if the Ruby object being raised as part
of an exception inherits from the Ruby class Exception. If so,
the object is simply returned. If not, then a new Ruby exception
object is created and that will be returned to Ruby.*/
SWIGRUNTIME VALUE
-SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
- VALUE exceptionClass = getExceptionClass();
- if (rb_obj_is_kind_of(obj, exceptionClass)) {
- return obj;
- } else {
- return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
- }
+SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj)
+{
+ VALUE exceptionClass = getExceptionClass();
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
+ return obj;
+ }
+ else {
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
+ }
}
/* Initialize Ruby runtime support */
SWIGRUNTIME void
SWIG_Ruby_InitRuntime(void)
{
- if (_mSWIG == Qnil) {
- _mSWIG = rb_define_module("SWIG");
- swig_call_id = rb_intern("call");
- swig_arity_id = rb_intern("arity");
- }
+ if (_mSWIG == Qnil) {
+ _mSWIG = rb_define_module("SWIG");
+ swig_call_id = rb_intern("call");
+ swig_arity_id = rb_intern("arity");
+ }
}
/* Define Ruby class for C type */
SWIGRUNTIME void
SWIG_Ruby_define_class(swig_type_info *type)
{
- VALUE klass;
- char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
- sprintf(klass_name, "TYPE%s", type->name);
- if (NIL_P(_cSWIG_Pointer)) {
- _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
- rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
- }
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
- free((void *) klass_name);
+ VALUE klass;
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+ sprintf(klass_name, "TYPE%s", type->name);
+ if (NIL_P(_cSWIG_Pointer)) {
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
+ }
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
+ free((void *) klass_name);
}
/* Create a new pointer object */
SWIGRUNTIME VALUE
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
{
- int own = flags & SWIG_POINTER_OWN;
- int track;
- char *klass_name;
- swig_class *sklass;
- VALUE klass;
- VALUE obj;
-
- if (!ptr)
- return Qnil;
-
- if (type->clientdata) {
- sklass = (swig_class *) type->clientdata;
-
- /* Are we tracking this class and have we already returned this Ruby object? */
- track = sklass->trackObjects;
- if (track) {
- obj = SWIG_RubyInstanceFor(ptr);
-
- /* Check the object's type and make sure it has the correct type.
- It might not in cases where methods do things like
- downcast methods. */
- if (obj != Qnil) {
- VALUE value = rb_iv_get(obj, "@__swigtype__");
- char* type_name = RSTRING_PTR(value);
-
- if (strcmp(type->name, type_name) == 0) {
- return obj;
- }
- }
+ int own = flags & SWIG_POINTER_OWN;
+ int track;
+ char *klass_name;
+ swig_class *sklass;
+ VALUE klass;
+ VALUE obj;
+
+ if (!ptr) {
+ return Qnil;
}
- /* Create a new Ruby object */
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
- ( own ? VOIDFUNC(sklass->destroy) :
- (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
- ), ptr);
+ if (type->clientdata) {
+ sklass = (swig_class *) type->clientdata;
+
+ /* Are we tracking this class and have we already returned this Ruby object? */
+ track = sklass->trackObjects;
+ if (track) {
+ obj = SWIG_RubyInstanceFor(ptr);
+
+ /* Check the object's type and make sure it has the correct type.
+ It might not in cases where methods do things like
+ downcast methods. */
+ if (obj != Qnil) {
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
+ char* type_name = RSTRING_PTR(value);
+
+ if (strcmp(type->name, type_name) == 0) {
+ return obj;
+ }
+ }
+ }
+
+ /* Create a new Ruby object */
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
+ ( own ? VOIDFUNC(sklass->destroy) :
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
+ ), ptr);
- /* If tracking is on for this class then track this object. */
- if (track) {
- SWIG_RubyAddTracking(ptr, obj);
+ /* If tracking is on for this class then track this object. */
+ if (track) {
+ SWIG_RubyAddTracking(ptr, obj);
+ }
}
- } else {
- klass_name = (char *) malloc(4 + strlen(type->name) + 1);
- sprintf(klass_name, "TYPE%s", type->name);
- klass = rb_const_get(_mSWIG, rb_intern(klass_name));
- free((void *) klass_name);
- obj = Data_Wrap_Struct(klass, 0, 0, ptr);
- }
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
-
- return obj;
+ else {
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+ sprintf(klass_name, "TYPE%s", type->name);
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
+ free((void *) klass_name);
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
+ }
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+
+ return obj;
}
/* Create a new class instance (always owned) */
SWIGRUNTIME VALUE
SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
{
- VALUE obj;
- swig_class *sklass = (swig_class *) type->clientdata;
- obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
- return obj;
+ VALUE obj;
+ swig_class *sklass = (swig_class *) type->clientdata;
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+ return obj;
}
/* Get type mangle from class name */
SWIGRUNTIMEINLINE char *
SWIG_Ruby_MangleStr(VALUE obj)
{
- VALUE stype = rb_iv_get(obj, "@__swigtype__");
- return StringValuePtr(stype);
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
+ return StringValuePtr(stype);
}
/* Acquire a pointer value */
typedef void (*ruby_owntype)(void*);
SWIGRUNTIME ruby_owntype
-SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
- if (obj) {
- ruby_owntype oldown = RDATA(obj)->dfree;
- RDATA(obj)->dfree = own;
- return oldown;
- } else {
- return 0;
- }
+SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own)
+{
+ if (obj) {
+ ruby_owntype oldown = RDATA(obj)->dfree;
+ RDATA(obj)->dfree = own;
+ return oldown;
+ }
+ else {
+ return 0;
+ }
}
/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
{
- char *c;
- swig_cast_info *tc;
- void *vptr = 0;
+ char *c;
+ swig_cast_info *tc;
+ void *vptr = 0;
- /* Grab the pointer */
- if (NIL_P(obj)) {
- *ptr = 0;
- return SWIG_OK;
- } else {
- if (TYPE(obj) != T_DATA) {
- return SWIG_ERROR;
- }
- Data_Get_Struct(obj, void, vptr);
- }
-
- if (own) *own = RDATA(obj)->dfree;
-
- /* Check to see if the input object is giving up ownership
- of the underlying C struct or C++ object. If so then we
- need to reset the destructor since the Ruby object no
- longer owns the underlying C++ object.*/
- if (flags & SWIG_POINTER_DISOWN) {
- /* Is tracking on for this class? */
- int track = 0;
- if (ty && ty->clientdata) {
- swig_class *sklass = (swig_class *) ty->clientdata;
- track = sklass->trackObjects;
- }
-
- if (track) {
- /* We are tracking objects for this class. Thus we change the destructor
- * to SWIG_RubyRemoveTracking. This allows us to
- * remove the mapping from the C++ to Ruby object
- * when the Ruby object is garbage collected. If we don't
- * do this, then it is possible we will return a reference
- * to a Ruby object that no longer exists thereby crashing Ruby. */
- RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
- } else {
- RDATA(obj)->dfree = 0;
- }
- }
-
- /* Do type-checking if type info was provided */
- if (ty) {
- if (ty->clientdata) {
- if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
- if (vptr == 0) {
- /* The object has already been deleted */
- return SWIG_ObjectPreviouslyDeletedError;
- }
- *ptr = vptr;
+ /* Grab the pointer */
+ if (NIL_P(obj)) {
+ *ptr = 0;
return SWIG_OK;
- }
}
- if ((c = SWIG_MangleStr(obj)) == NULL) {
- return SWIG_ERROR;
+ else {
+ if (TYPE(obj) != T_DATA) {
+ return SWIG_ERROR;
+ }
+ Data_Get_Struct(obj, void, vptr);
}
- tc = SWIG_TypeCheck(c, ty);
- if (!tc) {
- return SWIG_ERROR;
- } else {
- int newmemory = 0;
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
- assert(!newmemory); /* newmemory handling not yet implemented */
+
+ if (own) {
+ *own = RDATA(obj)->dfree;
+ }
+
+ /* Check to see if the input object is giving up ownership
+ of the underlying C struct or C++ object. If so then we
+ need to reset the destructor since the Ruby object no
+ longer owns the underlying C++ object.*/
+ if (flags & SWIG_POINTER_DISOWN) {
+ /* Is tracking on for this class? */
+ int track = 0;
+ if (ty && ty->clientdata) {
+ swig_class *sklass = (swig_class *) ty->clientdata;
+ track = sklass->trackObjects;
+ }
+
+ if (track) {
+ /* We are tracking objects for this class. Thus we change the destructor
+ * to SWIG_RubyRemoveTracking. This allows us to
+ * remove the mapping from the C++ to Ruby object
+ * when the Ruby object is garbage collected. If we don't
+ * do this, then it is possible we will return a reference
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
+ }
+ else {
+ RDATA(obj)->dfree = 0;
+ }
+ }
+
+ /* Do type-checking if type info was provided */
+ if (ty) {
+ if (ty->clientdata) {
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
+ if (vptr == 0) {
+ /* The object has already been deleted */
+ return SWIG_ObjectPreviouslyDeletedError;
+ }
+ *ptr = vptr;
+ return SWIG_OK;
+ }
+ }
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
+ return SWIG_ERROR;
+ }
+ tc = SWIG_TypeCheck(c, ty);
+ if (!tc) {
+ return SWIG_ERROR;
+ }
+ else {
+ int newmemory = 0;
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ }
}
- } else {
- *ptr = vptr;
- }
-
- return SWIG_OK;
+ else {
+ *ptr = vptr;
+ }
+
+ return SWIG_OK;
}
/* Check convert */
SWIGRUNTIMEINLINE int
SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
{
- char *c = SWIG_MangleStr(obj);
- if (!c) return 0;
- return SWIG_TypeCheck(c,ty) != 0;
+ char *c = SWIG_MangleStr(obj);
+ if (!c) {
+ return 0;
+ }
+ return SWIG_TypeCheck(c,ty) != 0;
}
SWIGRUNTIME VALUE
-SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
- char result[1024];
- char *r = result;
- if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r, ptr, sz);
- strcpy(r, type->name);
- return rb_str_new2(result);
+SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type)
+{
+ char result[1024];
+ char *r = result;
+ if ((2*sz + 1 + strlen(type->name)) > 1000) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r, ptr, sz);
+ strcpy(r, type->name);
+ return rb_str_new2(result);
}
/* Convert a packed value value */
SWIGRUNTIME int
-SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
- swig_cast_info *tc;
- const char *c;
-
- if (TYPE(obj) != T_STRING) goto type_error;
- c = StringValuePtr(obj);
- /* Pointer values must start with leading underscore */
- if (*c != '_') goto type_error;
- c++;
- c = SWIG_UnpackData(c, ptr, sz);
- if (ty) {
- tc = SWIG_TypeCheck(c, ty);
- if (!tc) goto type_error;
- }
- return SWIG_OK;
-
- type_error:
- return SWIG_ERROR;
+SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty)
+{
+ swig_cast_info *tc;
+ const char *c;
+
+ if (TYPE(obj) != T_STRING) {
+ goto type_error;
+ }
+ c = StringValuePtr(obj);
+ /* Pointer values must start with leading underscore */
+ if (*c != '_') {
+ goto type_error;
+ }
+ c++;
+ c = SWIG_UnpackData(c, ptr, sz);
+ if (ty) {
+ tc = SWIG_TypeCheck(c, ty);
+ if (!tc) {
+ goto type_error;
+ }
+ }
+ return SWIG_OK;
+
+type_error:
+ return SWIG_ERROR;
}
SWIGRUNTIME swig_module_info *
SWIG_Ruby_GetModule(void)
{
- VALUE pointer;
- swig_module_info *ret = 0;
- VALUE verbose = rb_gv_get("VERBOSE");
+ VALUE pointer;
+ swig_module_info *ret = 0;
+ VALUE verbose = rb_gv_get("VERBOSE");
- /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
- rb_gv_set("VERBOSE", Qfalse);
-
- /* first check if pointer already created */
- pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
- if (pointer != Qnil) {
- Data_Get_Struct(pointer, swig_module_info, ret);
- }
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
+ rb_gv_set("VERBOSE", Qfalse);
- /* reinstate warnings */
- rb_gv_set("VERBOSE", verbose);
- return ret;
+ /* first check if pointer already created */
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ if (pointer != Qnil) {
+ Data_Get_Struct(pointer, swig_module_info, ret);
+ }
+
+ /* reinstate warnings */
+ rb_gv_set("VERBOSE", verbose);
+ return ret;
}
-SWIGRUNTIME void
+SWIGRUNTIME void
SWIG_Ruby_SetModule(swig_module_info *pointer)
{
- /* register a new class */
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
- /* create and store the structure pointer to a global variable */
- swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
- rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
+ /* register a new class */
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
+ /* create and store the structure pointer to a global variable */
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
}
/* This function can be used to check whether a proc or method or similarly
@@ -1772,9 +1901,10 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
SWIGINTERN
int SWIG_Ruby_isCallable( VALUE proc )
{
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
- return 1;
- return 0;
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue ) {
+ return 1;
+ }
+ return 0;
}
/* This function can be used to check the arity (number of arguments)
@@ -1785,15 +1915,18 @@ int SWIG_Ruby_isCallable( VALUE proc )
SWIGINTERN
int SWIG_Ruby_arity( VALUE proc, int minimal )
{
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
- {
- VALUE num = rb_funcall( proc, swig_arity_id, 0 );
- int arity = NUM2INT(num);
- if ( arity < 0 && (arity+1) < -minimal ) return 1;
- if ( arity == minimal ) return 1;
- return 1;
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue ) {
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
+ int arity = NUM2INT(num);
+ if ( arity < 0 && (arity+1) < -minimal ) {
+ return 1;
+ }
+ if ( arity == minimal ) {
+ return 1;
+ }
+ return 1;
}
- return 0;
+ return 0;
}
@@ -1803,9 +1936,9 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
-#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
/* -----------------------------------------------------------------------------
@@ -1834,245 +1967,226 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
#include <iostream>
#include <map>
-namespace Swig {
- /* memory handler */
- struct GCItem
- {
- virtual ~GCItem()
- {
+namespace Swig
+{
+/* memory handler */
+struct GCItem {
+ virtual ~GCItem() {
}
- virtual ruby_owntype get_own() const
- {
- return 0;
+ virtual ruby_owntype get_own() const {
+ return 0;
}
- };
-
- struct GCItem_var
- {
- GCItem_var(GCItem *item = 0) : _item(item)
- {
+};
+
+struct GCItem_var {
+ GCItem_var(GCItem *item = 0) : _item(item) {
}
- GCItem_var& operator=(GCItem *item)
- {
- GCItem *tmp = _item;
- _item = item;
- delete tmp;
- return *this;
+ GCItem_var& operator=(GCItem *item) {
+ GCItem *tmp = _item;
+ _item = item;
+ delete tmp;
+ return *this;
}
-
- ~GCItem_var()
- {
- delete _item;
+
+ ~GCItem_var() {
+ delete _item;
}
-
- GCItem * operator->() const
- {
- return _item;
+
+ GCItem * operator->() const {
+ return _item;
}
-
- private:
+
+private:
GCItem *_item;
- };
+};
- template <typename Type>
- struct GCItem_T : GCItem
- {
- GCItem_T(Type *ptr) : _ptr(ptr)
- {
+template <typename Type>
+struct GCItem_T : GCItem {
+ GCItem_T(Type *ptr) : _ptr(ptr) {
}
-
- virtual ~GCItem_T()
- {
- delete _ptr;
+
+ virtual ~GCItem_T() {
+ delete _ptr;
}
-
- private:
+
+private:
Type *_ptr;
- };
+};
- struct GCItem_Object : GCItem
- {
- GCItem_Object(ruby_owntype own) : _own(own)
- {
+struct GCItem_Object : GCItem {
+ GCItem_Object(ruby_owntype own) : _own(own) {
}
-
- virtual ~GCItem_Object()
- {
+
+ virtual ~GCItem_Object() {
}
- ruby_owntype get_own() const
- {
- return _own;
+ ruby_owntype get_own() const {
+ return _own;
}
-
- private:
+
+private:
ruby_owntype _own;
- };
+};
- template <typename Type>
- struct GCArray_T : GCItem
- {
- GCArray_T(Type *ptr) : _ptr(ptr)
- {
+template <typename Type>
+struct GCArray_T : GCItem {
+ GCArray_T(Type *ptr) : _ptr(ptr) {
}
-
- virtual ~GCArray_T()
- {
- delete[] _ptr;
+
+ virtual ~GCArray_T() {
+ delete[] _ptr;
}
-
- private:
+
+private:
Type *_ptr;
- };
+};
- /* body args */
- struct body_args {
+/* body args */
+struct body_args {
VALUE recv;
ID id;
int argc;
VALUE *argv;
- };
-
- /* Base class for director exceptions */
- class DirectorException {
- protected:
+};
+
+/* Base class for director exceptions */
+class DirectorException
+{
+protected:
VALUE swig_error;
std::string swig_msg;
- protected:
+protected:
DirectorException(VALUE error)
- : swig_error(error)
- {
+ : swig_error(error) {
}
-
- DirectorException(VALUE error, const char* hdr, const char* msg ="")
- : swig_error(error), swig_msg(hdr) {
- if (strlen(msg)) {
- swig_msg += " ";
- swig_msg += msg;
- }
- if (swig_msg.size()) {
- VALUE str = rb_str_new(swig_msg.data(), swig_msg.size());
- swig_error = rb_exc_new3(error, str);
- } else {
- swig_error = error;
- }
+
+ DirectorException(VALUE error, const char* hdr, const char* msg ="")
+ : swig_error(error), swig_msg(hdr) {
+ if (strlen(msg)) {
+ swig_msg += " ";
+ swig_msg += msg;
+ }
+ if (swig_msg.size()) {
+ VALUE str = rb_str_new(swig_msg.data(), swig_msg.size());
+ swig_error = rb_exc_new3(error, str);
+ }
+ else {
+ swig_error = error;
+ }
}
- public:
- VALUE getType() const {
- return CLASS_OF(swig_error);
+public:
+ VALUE getType() const {
+ return CLASS_OF(swig_error);
}
VALUE getError() const {
- return swig_error;
+ return swig_error;
}
- const std::string& getMessage() const
- {
- return swig_msg;
+ const std::string& getMessage() const {
+ return swig_msg;
}
-
+
virtual ~DirectorException() {}
- };
-
- /* unknown exception handler */
+};
- class UnknownExceptionHandler
- {
+/* unknown exception handler */
+
+class UnknownExceptionHandler
+{
#ifdef SWIG_DIRECTOR_UEH
static void handler() {
- try {
- throw;
- } catch (DirectorException& e) {
- std::cerr << "Swig Director exception caught:" << std::endl
- << e.getMessage() << std::endl;
- } catch (std::exception& e) {
- std::cerr << "std::exception caught: "<< e.what() << std::endl;
- } catch (...) {
- std::cerr << "Unknown exception caught." << std::endl;
- }
- std::cerr << std::endl
- << "Ruby interpreter traceback:" << std::endl;
- std::cerr << std::endl;
- std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
- << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
- << std::endl
- << "Exception is being re-thrown, program will like abort/terminate." << std::endl;
- throw;
- }
-
- public:
+ try {
+ throw;
+ }
+ catch (DirectorException& e) {
+ std::cerr << "Swig Director exception caught:" << std::endl
+ << e.getMessage() << std::endl;
+ }
+ catch (std::exception& e) {
+ std::cerr << "std::exception caught: "<< e.what() << std::endl;
+ }
+ catch (...) {
+ std::cerr << "Unknown exception caught." << std::endl;
+ }
+ std::cerr << std::endl
+ << "Ruby interpreter traceback:" << std::endl;
+ std::cerr << std::endl;
+ std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
+ << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
+ << std::endl
+ << "Exception is being re-thrown, program will like abort/terminate." << std::endl;
+ throw;
+ }
+
+public:
std::unexpected_handler old;
- UnknownExceptionHandler(std::unexpected_handler nh = handler)
- {
- old = std::set_unexpected(nh);
+ UnknownExceptionHandler(std::unexpected_handler nh = handler) {
+ old = std::set_unexpected(nh);
}
- ~UnknownExceptionHandler()
- {
- std::set_unexpected(old);
+ ~UnknownExceptionHandler() {
+ std::set_unexpected(old);
}
#endif
- };
+};
- /* Type mismatch in the return value from a Ruby method call */
- class DirectorTypeMismatchException : public Swig::DirectorException {
- public:
+/* Type mismatch in the return value from a Ruby method call */
+class DirectorTypeMismatchException : public Swig::DirectorException
+{
+public:
DirectorTypeMismatchException(VALUE error, const char *msg="")
- : Swig::DirectorException(error, "Swig director type mismatch", msg)
- {
+ : Swig::DirectorException(error, "Swig director type mismatch", msg) {
}
DirectorTypeMismatchException(const char *msg="")
- : Swig::DirectorException(rb_eTypeError, "Swig director type mismatch", msg)
- {
+ : Swig::DirectorException(rb_eTypeError, "Swig director type mismatch", msg) {
}
static void raise(VALUE error, const char *msg) {
- throw DirectorTypeMismatchException(error, msg);
+ throw DirectorTypeMismatchException(error, msg);
}
static void raise(const char *msg) {
- throw DirectorTypeMismatchException(msg);
+ throw DirectorTypeMismatchException(msg);
}
- };
+};
- /* Any Ruby exception that occurs during a director method call */
- class DirectorMethodException : public Swig::DirectorException {
- public:
- DirectorMethodException(VALUE error)
- : Swig::DirectorException(error) {
+/* Any Ruby exception that occurs during a director method call */
+class DirectorMethodException : public Swig::DirectorException
+{
+public:
+ DirectorMethodException(VALUE error)
+ : Swig::DirectorException(error) {
}
- DirectorMethodException(const char* msg = "")
- : Swig::DirectorException(rb_eRuntimeError, "Swig director method error.", msg) {
+ DirectorMethodException(const char* msg = "")
+ : Swig::DirectorException(rb_eRuntimeError, "Swig director method error.", msg) {
}
-
- static void raise(VALUE error)
- {
- throw DirectorMethodException(error);
- }
- };
- /* Attempted to call a pure virtual method via a director method */
- class DirectorPureVirtualException : public Swig::DirectorException
- {
- public:
- DirectorPureVirtualException(const char* msg = "")
- : DirectorException(rb_eRuntimeError, "Swig director pure virtual method called", msg)
- {
+ static void raise(VALUE error) {
+ throw DirectorMethodException(error);
}
+};
- static void raise(const char *msg)
- {
- throw DirectorPureVirtualException(msg);
+/* Attempted to call a pure virtual method via a director method */
+class DirectorPureVirtualException : public Swig::DirectorException
+{
+public:
+ DirectorPureVirtualException(const char* msg = "")
+ : DirectorException(rb_eRuntimeError, "Swig director pure virtual method called", msg) {
}
- };
- /* Simple thread abstraction for pthreads on win32 */
+ static void raise(const char *msg) {
+ throw DirectorPureVirtualException(msg);
+ }
+};
+
+/* Simple thread abstraction for pthreads on win32 */
#ifdef __THREAD__
# define __PTHREAD__
# if defined(_WIN32) || defined(__WIN32__)
@@ -2082,39 +2196,37 @@ namespace Swig {
# define SWIG_MUTEX_INIT(var) var
# else
# include <pthread.h>
-# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER
+# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER
# endif
#endif
#ifdef __PTHREAD__
- struct Guard
- {
+struct Guard {
pthread_mutex_t *_mutex;
-
- Guard(pthread_mutex_t &mutex) : _mutex(&mutex)
- {
- pthread_mutex_lock(_mutex);
+
+ Guard(pthread_mutex_t &mutex) : _mutex(&mutex) {
+ pthread_mutex_lock(_mutex);
}
-
- ~Guard()
- {
- pthread_mutex_unlock(_mutex);
+
+ ~Guard() {
+ pthread_mutex_unlock(_mutex);
}
- };
+};
# define SWIG_GUARD(mutex) Guard _guard(mutex)
#else
-# define SWIG_GUARD(mutex)
+# define SWIG_GUARD(mutex)
#endif
- /* director base class */
- class Director {
- private:
+/* director base class */
+class Director
+{
+private:
/* pointer to the wrapped Ruby object */
VALUE swig_self;
/* flag indicating whether the object is owned by Ruby or c++ */
mutable bool swig_disown_flag;
- public:
+public:
/* wrap a Ruby object, optionally taking ownership */
Director(VALUE self) : swig_self(self), swig_disown_flag(false) {
}
@@ -2124,67 +2236,63 @@ namespace Swig {
}
/* return a pointer to the wrapped Ruby object */
- VALUE swig_get_self() const {
- return swig_self;
+ VALUE swig_get_self() const {
+ return swig_self;
}
/* acquire ownership of the wrapped Ruby object (the sense of "disown"
* is from Ruby) */
- void swig_disown() const {
- if (!swig_disown_flag) {
- swig_disown_flag = true;
- }
+ void swig_disown() const {
+ if (!swig_disown_flag) {
+ swig_disown_flag = true;
+ }
}
- /* ownership management */
- private:
+ /* ownership management */
+private:
typedef std::map<void*, GCItem_var> ownership_map;
mutable ownership_map owner;
#ifdef __PTHREAD__
static pthread_mutex_t swig_mutex_own;
#endif
- public:
+public:
template <typename Type>
- void swig_acquire_ownership_array(Type *vptr) const
- {
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCArray_T<Type>(vptr);
- }
+ void swig_acquire_ownership_array(Type *vptr) const {
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCArray_T<Type>(vptr);
+ }
}
-
+
template <typename Type>
- void swig_acquire_ownership(Type *vptr) const
- {
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCItem_T<Type>(vptr);
- }
+ void swig_acquire_ownership(Type *vptr) const {
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCItem_T<Type>(vptr);
+ }
}
- void swig_acquire_ownership_obj(void *vptr, ruby_owntype own) const
- {
- if (vptr && own) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCItem_Object(own);
- }
+ void swig_acquire_ownership_obj(void *vptr, ruby_owntype own) const {
+ if (vptr && own) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCItem_Object(own);
+ }
}
-
- ruby_owntype swig_release_ownership(void *vptr) const
- {
- ruby_owntype own = 0;
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- ownership_map::iterator iter = owner.find(vptr);
- if (iter != owner.end()) {
- own = iter->second->get_own();
- owner.erase(iter);
- }
- }
- return own;
+
+ ruby_owntype swig_release_ownership(void *vptr) const {
+ ruby_owntype own = 0;
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ ownership_map::iterator iter = owner.find(vptr);
+ if (iter != owner.end()) {
+ own = iter->second->get_own();
+ owner.erase(iter);
+ }
+ }
+ return own;
}
- };
+};
}
#endif /* __cplusplus */
@@ -2219,12 +2327,12 @@ static VALUE mTinyWRAP;
#define SWIG_RUBY_THREAD_END_BLOCK
-#define SWIGVERSION 0x010340
+#define SWIGVERSION 0x010340
#define SWIG_VERSION SWIGVERSION
-#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
-#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#include <stdexcept>
@@ -2254,215 +2362,240 @@ static VALUE mTinyWRAP;
SWIGINTERN VALUE
SWIG_ruby_failed(void)
{
- return Qnil;
-}
+ return Qnil;
+}
/*@SWIG:C:/msys/1.0/local/share/swig/1.3.40\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
{
- VALUE obj = args[0];
- VALUE type = TYPE(obj);
- long *res = (long *)(args[1]);
- *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
- return obj;
+ VALUE obj = args[0];
+ VALUE type = TYPE(obj);
+ long *res = (long *)(args[1]);
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
+ return obj;
}
/*@SWIG@*/
SWIGINTERN int
SWIG_AsVal_long (VALUE obj, long* val)
{
- VALUE type = TYPE(obj);
- if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
- long v;
- VALUE a[2];
- a[0] = obj;
- a[1] = (VALUE)(&v);
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
- if (val) *val = v;
- return SWIG_OK;
+ VALUE type = TYPE(obj);
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+ long v;
+ VALUE a[2];
+ a[0] = obj;
+ a[1] = (VALUE)(&v);
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+ if (val) {
+ *val = v;
+ }
+ return SWIG_OK;
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_int (VALUE obj, int *val)
{
- long v;
- int res = SWIG_AsVal_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v < INT_MIN || v > INT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< int >(v);
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < INT_MIN || v > INT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< int >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERN int
SWIG_AsVal_short (VALUE obj, short *val)
{
- long v;
- int res = SWIG_AsVal_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v < SHRT_MIN || v > SHRT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< short >(v);
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < SHRT_MIN || v > SHRT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< short >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
- static int init = 0;
- static swig_type_info* info = 0;
- if (!init) {
- info = SWIG_TypeQuery("_p_char");
- init = 1;
- }
- return info;
+ static int init = 0;
+ static swig_type_info* info = 0;
+ if (!init) {
+ info = SWIG_TypeQuery("_p_char");
+ init = 1;
+ }
+ return info;
}
SWIGINTERN int
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
{
- if (TYPE(obj) == T_STRING) {
- #if defined(StringValuePtr)
- char *cstr = StringValuePtr(obj);
- #else
- char *cstr = STR2CSTR(obj);
- #endif
- size_t size = RSTRING_LEN(obj) + 1;
- if (cptr) {
- if (alloc) {
- if (*alloc == SWIG_NEWOBJ) {
- *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
- } else {
- *cptr = cstr;
- *alloc = SWIG_OLDOBJ;
- }
- }
+ if (TYPE(obj) == T_STRING) {
+#if defined(StringValuePtr)
+ char *cstr = StringValuePtr(obj);
+#else
+ char *cstr = STR2CSTR(obj);
+#endif
+ size_t size = RSTRING_LEN(obj) + 1;
+ if (cptr) {
+ if (alloc) {
+ if (*alloc == SWIG_NEWOBJ) {
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
+ }
+ else {
+ *cptr = cstr;
+ *alloc = SWIG_OLDOBJ;
+ }
+ }
+ }
+ if (psize) {
+ *psize = size;
+ }
+ return SWIG_OK;
}
- if (psize) *psize = size;
- return SWIG_OK;
- } else {
- swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
- if (pchar_descriptor) {
- void* vptr = 0;
- if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
- if (cptr) *cptr = (char *)vptr;
- if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
- if (alloc) *alloc = SWIG_OLDOBJ;
- return SWIG_OK;
- }
+ else {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ if (pchar_descriptor) {
+ void* vptr = 0;
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+ if (cptr) {
+ *cptr = (char *)vptr;
+ }
+ if (psize) {
+ *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
+ }
+ if (alloc) {
+ *alloc = SWIG_OLDOBJ;
+ }
+ return SWIG_OK;
+ }
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
- #define SWIG_From_long LONG2NUM
+#define SWIG_From_long LONG2NUM
SWIGINTERNINLINE VALUE
SWIG_From_short (short value)
-{
- return SWIG_From_long (value);
+{
+ return SWIG_From_long (value);
}
-SWIGINTERNINLINE VALUE
+SWIGINTERNINLINE VALUE
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
- if (carray) {
- if (size > LONG_MAX) {
- swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
- return pchar_descriptor ?
- SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
- } else {
- return rb_str_new(carray, static_cast< long >(size));
+ if (carray) {
+ if (size > LONG_MAX) {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ return pchar_descriptor ?
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
+ }
+ else {
+ return rb_str_new(carray, static_cast< long >(size));
+ }
+ }
+ else {
+ return Qnil;
}
- } else {
- return Qnil;
- }
}
-SWIGINTERNINLINE VALUE
+SWIGINTERNINLINE VALUE
SWIG_FromCharPtr(const char *cptr)
-{
- return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+{
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERNINLINE VALUE
SWIG_From_bool (bool value)
{
- return value ? Qtrue : Qfalse;
+ return value ? Qtrue : Qfalse;
}
/*@SWIG:C:/msys/1.0/local/share/swig/1.3.40\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
{
- VALUE obj = args[0];
- VALUE type = TYPE(obj);
- unsigned long *res = (unsigned long *)(args[1]);
- *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
- return obj;
+ VALUE obj = args[0];
+ VALUE type = TYPE(obj);
+ unsigned long *res = (unsigned long *)(args[1]);
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
+ return obj;
}
/*@SWIG@*/
SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
+SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
{
- VALUE type = TYPE(obj);
- if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
- unsigned long v;
- VALUE a[2];
- a[0] = obj;
- a[1] = (VALUE)(&v);
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
- if (val) *val = v;
- return SWIG_OK;
+ VALUE type = TYPE(obj);
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+ unsigned long v;
+ VALUE a[2];
+ a[0] = obj;
+ a[1] = (VALUE)(&v);
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+ if (val) {
+ *val = v;
+ }
+ return SWIG_OK;
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
{
- unsigned long v;
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v > UINT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< unsigned int >(v);
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v > UINT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< unsigned int >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERNINLINE VALUE
SWIG_From_int (int value)
-{
- return SWIG_From_long (value);
+{
+ return SWIG_From_long (value);
}
/* ---------------------------------------------------
@@ -2477,227 +2610,250 @@ SWIG_From_int (int value)
#include "Ruby/tinyWRAP_wrap.h"
-SwigDirector_SipCallback::SwigDirector_SipCallback(VALUE self): SipCallback(), Swig::Director(self) {
-
+SwigDirector_SipCallback::SwigDirector_SipCallback(VALUE self): SipCallback(), Swig::Director(self)
+{
+
}
-SwigDirector_SipCallback::~SwigDirector_SipCallback() {
+SwigDirector_SipCallback::~SwigDirector_SipCallback()
+{
}
-int SwigDirector_SipCallback::OnRegistrationChanged(RegistrationEvent const *e) {
- int c_result ;
- VALUE obj0 = Qnil ;
- VALUE result;
-
- obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(e), SWIGTYPE_p_RegistrationEvent, 0 );
- result = rb_funcall(swig_get_self(), rb_intern("OnRegistrationChanged"), 1,obj0);
- int swig_val;
- int swig_res = SWIG_AsVal_int(result, &swig_val);
- if (!SWIG_IsOK(swig_res)) {
- Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""int""'");
- }
- c_result = static_cast< int >(swig_val);
- return (int) c_result;
+int SwigDirector_SipCallback::OnRegistrationChanged(RegistrationEvent const *e)
+{
+ int c_result ;
+ VALUE obj0 = Qnil ;
+ VALUE result;
+
+ obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(e), SWIGTYPE_p_RegistrationEvent, 0 );
+ result = rb_funcall(swig_get_self(), rb_intern("OnRegistrationChanged"), 1,obj0);
+ int swig_val;
+ int swig_res = SWIG_AsVal_int(result, &swig_val);
+ if (!SWIG_IsOK(swig_res)) {
+ Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""int""'");
+ }
+ c_result = static_cast< int >(swig_val);
+ return (int) c_result;
}
swig_class SwigClassSipEvent;
SWIGINTERN VALUE
-_wrap_new_SipEvent__SWIG_0(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
- SipEvent *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (SipEvent *)new SipEvent();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipEvent__SWIG_0(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
+ SipEvent *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (SipEvent *)new SipEvent();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipEvent_allocate(VALUE self) {
+_wrap_SipEvent_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipEvent_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipEvent_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipEvent);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipEvent__SWIG_1(int argc, VALUE *argv, VALUE self) {
- tsip_event_type_t arg1 ;
- short arg2 ;
- char *arg3 = (char *) 0 ;
- int val1 ;
- int ecode1 = 0 ;
- short val2 ;
- int ecode2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
- SipEvent *result = 0 ;
-
- if ((argc < 3) || (argc > 3)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
- }
- ecode1 = SWIG_AsVal_int(argv[0], &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "tsip_event_type_t","SipEvent", 1, argv[0] ));
- }
- arg1 = static_cast< tsip_event_type_t >(val1);
- ecode2 = SWIG_AsVal_short(argv[1], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","SipEvent", 2, argv[1] ));
- }
- arg2 = static_cast< short >(val2);
- res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipEvent", 3, argv[2] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (SipEvent *)new SipEvent(arg1,arg2,(char const *)arg3);
- DATA_PTR(self) = result;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return self;
+_wrap_new_SipEvent__SWIG_1(int argc, VALUE *argv, VALUE self)
+{
+ tsip_event_type_t arg1 ;
+ short arg2 ;
+ char *arg3 = (char *) 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ short val2 ;
+ int ecode2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
+ SipEvent *result = 0 ;
+
+ if ((argc < 3) || (argc > 3)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
+ SWIG_fail;
+ }
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "tsip_event_type_t","SipEvent", 1, argv[0] ));
+ }
+ arg1 = static_cast< tsip_event_type_t >(val1);
+ ecode2 = SWIG_AsVal_short(argv[1], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","SipEvent", 2, argv[1] ));
+ }
+ arg2 = static_cast< short >(val2);
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipEvent", 3, argv[2] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (SipEvent *)new SipEvent(arg1,arg2,(char const *)arg3);
+ DATA_PTR(self) = result;
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return self;
fail:
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_new_SipEvent(int nargs, VALUE *args, VALUE self) {
- int argc;
- VALUE argv[3];
- int ii;
-
- argc = nargs;
- if (argc > 3) SWIG_fail;
- for (ii = 0; (ii < argc); ++ii) {
- argv[ii] = args[ii];
- }
- if (argc == 0) {
- return _wrap_new_SipEvent__SWIG_0(nargs, args, self);
- }
- if (argc == 3) {
- int _v;
- {
- int res = SWIG_AsVal_int(argv[0], NULL);
- _v = SWIG_CheckState(res);
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
}
- if (_v) {
- {
- int res = SWIG_AsVal_short(argv[1], NULL);
- _v = SWIG_CheckState(res);
- }
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
- _v = SWIG_CheckState(res);
+ return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_SipEvent(int nargs, VALUE *args, VALUE self)
+{
+ int argc;
+ VALUE argv[3];
+ int ii;
+
+ argc = nargs;
+ if (argc > 3) {
+ SWIG_fail;
+ }
+ for (ii = 0; (ii < argc); ++ii) {
+ argv[ii] = args[ii];
+ }
+ if (argc == 0) {
+ return _wrap_new_SipEvent__SWIG_0(nargs, args, self);
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ int res = SWIG_AsVal_int(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
if (_v) {
- return _wrap_new_SipEvent__SWIG_1(nargs, args, self);
+ {
+ int res = SWIG_AsVal_short(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_SipEvent__SWIG_1(nargs, args, self);
+ }
+ }
}
- }
}
- }
-
+
fail:
- Ruby_Format_OverloadedError( argc, 3, "SipEvent.new",
- " SipEvent.new()\n"
- " SipEvent.new(tsip_event_type_t type, short code, char const *phrase)\n");
-
- return Qnil;
+ Ruby_Format_OverloadedError( argc, 3, "SipEvent.new",
+ " SipEvent.new()\n"
+ " SipEvent.new(tsip_event_type_t type, short code, char const *phrase)\n");
+
+ return Qnil;
}
SWIGINTERN void
-free_SipEvent(SipEvent *arg1) {
+free_SipEvent(SipEvent *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getCode(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- short result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getCode", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (short)((SipEvent const *)arg1)->getCode();
- vresult = SWIG_From_short(static_cast< short >(result));
- return vresult;
+_wrap_SipEvent_getCode(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ short result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getCode", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (short)((SipEvent const *)arg1)->getCode();
+ vresult = SWIG_From_short(static_cast< short >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getPhrase(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- char *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getPhrase", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (char *)((SipEvent const *)arg1)->getPhrase();
- vresult = SWIG_FromCharPtr((const char *)result);
- return vresult;
+_wrap_SipEvent_getPhrase(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ char *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getPhrase", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (char *)((SipEvent const *)arg1)->getPhrase();
+ vresult = SWIG_FromCharPtr((const char *)result);
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getBaseSession(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- SipSession *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getBaseSession", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (SipSession *)((SipEvent const *)arg1)->getBaseSession();
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SipSession, 0 | 0 );
- return vresult;
+_wrap_SipEvent_getBaseSession(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ SipSession *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getBaseSession", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (SipSession *)((SipEvent const *)arg1)->getBaseSession();
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SipSession, 0 | 0 );
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -2705,397 +2861,457 @@ swig_class SwigClassSipSession;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipSession_allocate(VALUE self) {
+_wrap_SipSession_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipSession_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipSession_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipSession);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipSession(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipSession";
- SipSession *result = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","SipSession", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (SipSession *)new SipSession(arg1);
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipSession(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipSession";
+ SipSession *result = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","SipSession", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (SipSession *)new SipSession(arg1);
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SipSession(SipSession *arg1) {
+free_SipSession(SipSession *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipSession_addHeader(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipSession_addHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_removeHeader(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeHeader((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_removeHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeHeader((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_addCaps__SWIG_0(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addCaps", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addCaps((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipSession_addCaps__SWIG_0(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addCaps", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addCaps((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_addCaps__SWIG_1(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->addCaps((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_addCaps__SWIG_1(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->addCaps((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_SipSession_addCaps(int nargs, VALUE *args, VALUE self) {
- int argc;
- VALUE argv[4];
- int ii;
-
- argc = nargs + 1;
- argv[0] = self;
- if (argc > 4) SWIG_fail;
- for (ii = 1; (ii < argc); ++ii) {
- argv[ii] = args[ii-1];
- }
- if (argc == 2) {
- int _v;
- void *vptr = 0;
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- return _wrap_SipSession_addCaps__SWIG_1(nargs, args, self);
- }
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
}
- }
- if (argc == 3) {
- int _v;
- void *vptr = 0;
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_SipSession_addCaps(int nargs, VALUE *args, VALUE self)
+{
+ int argc;
+ VALUE argv[4];
+ int ii;
+
+ argc = nargs + 1;
+ argv[0] = self;
+ if (argc > 4) {
+ SWIG_fail;
+ }
+ for (ii = 1; (ii < argc); ++ii) {
+ argv[ii] = args[ii-1];
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_SipSession_addCaps__SWIG_0(nargs, args, self);
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SipSession_addCaps__SWIG_1(nargs, args, self);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SipSession_addCaps__SWIG_0(nargs, args, self);
+ }
+ }
}
- }
}
- }
-
+
fail:
- Ruby_Format_OverloadedError( argc, 4, "SipSession.addCaps",
- " bool SipSession.addCaps(char const *name, char const *value)\n"
- " bool SipSession.addCaps(char const *name)\n");
-
- return Qnil;
+ Ruby_Format_OverloadedError( argc, 4, "SipSession.addCaps",
+ " bool SipSession.addCaps(char const *name, char const *value)\n"
+ " bool SipSession.addCaps(char const *name)\n");
+
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_removeCaps(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeCaps((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_removeCaps(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeCaps((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setExpires(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setExpires", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setExpires", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->setExpires(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipSession_setExpires(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setExpires", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setExpires", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->setExpires(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setFromUri(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setFromUri", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setFromUri", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setFromUri((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_setFromUri(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setFromUri", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setFromUri", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setFromUri((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setToUri(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setToUri", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setToUri", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setToUri((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_setToUri(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setToUri", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setToUri", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setToUri((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
@@ -3103,87 +3319,96 @@ swig_class SwigClassRegistrationEvent;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_RegistrationEvent_allocate(VALUE self) {
+_wrap_RegistrationEvent_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_RegistrationEvent_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_RegistrationEvent_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_RegistrationEvent);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_RegistrationEvent(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::RegistrationEvent";
- RegistrationEvent *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (RegistrationEvent *)new RegistrationEvent();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_RegistrationEvent(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::RegistrationEvent";
+ RegistrationEvent *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (RegistrationEvent *)new RegistrationEvent();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_RegistrationEvent(RegistrationEvent *arg1) {
+free_RegistrationEvent(RegistrationEvent *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_RegistrationEvent_getType(int argc, VALUE *argv, VALUE self) {
- RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- tsip_register_event_type_t result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getType", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
- result = (tsip_register_event_type_t)((RegistrationEvent const *)arg1)->getType();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_RegistrationEvent_getType(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ tsip_register_event_type_t result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getType", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
+ result = (tsip_register_event_type_t)((RegistrationEvent const *)arg1)->getType();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_RegistrationEvent_getSession(int argc, VALUE *argv, VALUE self) {
- RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- RegistrationSession *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getSession", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
- result = (RegistrationSession *)((RegistrationEvent const *)arg1)->getSession();
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegistrationSession, 0 | 0 );
- return vresult;
+_wrap_RegistrationEvent_getSession(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ RegistrationSession *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getSession", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
+ result = (RegistrationSession *)((RegistrationEvent const *)arg1)->getSession();
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3191,103 +3416,112 @@ swig_class SwigClassRegistrationSession;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_RegistrationSession_allocate(VALUE self) {
+_wrap_RegistrationSession_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_RegistrationSession_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_RegistrationSession_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_RegistrationSession);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_RegistrationSession(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::RegistrationSession";
- RegistrationSession *result = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","RegistrationSession", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (RegistrationSession *)new RegistrationSession(arg1);
- DATA_PTR(self) = result;
- return self;
+_wrap_new_RegistrationSession(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::RegistrationSession";
+ RegistrationSession *result = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","RegistrationSession", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (RegistrationSession *)new RegistrationSession(arg1);
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_RegistrationSession(RegistrationSession *arg1) {
+free_RegistrationSession(RegistrationSession *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_RegistrationSession_Register(int argc, VALUE *argv, VALUE self) {
- RegistrationSession *arg1 = (RegistrationSession *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","Register", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationSession * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Register", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->Register(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_RegistrationSession_Register(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationSession *arg1 = (RegistrationSession *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","Register", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationSession * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Register", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->Register(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_RegistrationSession_UnRegister(int argc, VALUE *argv, VALUE self) {
- RegistrationSession *arg1 = (RegistrationSession *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","UnRegister", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationSession * >(argp1);
- result = (bool)(arg1)->UnRegister();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_RegistrationSession_UnRegister(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationSession *arg1 = (RegistrationSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","UnRegister", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationSession * >(argp1);
+ result = (bool)(arg1)->UnRegister();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3295,117 +3529,131 @@ swig_class SwigClassSipCallback;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipCallback_allocate(VALUE self) {
+_wrap_SipCallback_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipCallback_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipCallback_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipCallback);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipCallback(int argc, VALUE *argv, VALUE self) {
- VALUE arg1 = (VALUE) 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipCallback";
- SipCallback *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- arg1 = self;
- if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
- /* subclassed */
- result = (SipCallback *)new SwigDirector_SipCallback(arg1);
- } else {
- result = (SipCallback *)new SipCallback();
- }
-
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipCallback(int argc, VALUE *argv, VALUE self)
+{
+ VALUE arg1 = (VALUE) 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipCallback";
+ SipCallback *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ arg1 = self;
+ if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
+ /* subclassed */
+ result = (SipCallback *)new SwigDirector_SipCallback(arg1);
+ }
+ else {
+ result = (SipCallback *)new SipCallback();
+ }
+
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SipCallback(SipCallback *arg1) {
+free_SipCallback(SipCallback *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipCallback_OnRegistrationChanged(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- RegistrationEvent *arg2 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- void *argp2 = 0 ;
- int res2 = 0 ;
- Swig::Director *director = 0;
- bool upcall = false;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","OnRegistrationChanged", 1, self ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RegistrationEvent const *","OnRegistrationChanged", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< RegistrationEvent * >(argp2);
- director = dynamic_cast<Swig::Director *>(arg1);
- upcall = (director && (director->swig_get_self() == self));
- try {
- if (upcall) {
- result = (int)(arg1)->SipCallback::OnRegistrationChanged((RegistrationEvent const *)arg2);
- } else {
- result = (int)(arg1)->OnRegistrationChanged((RegistrationEvent const *)arg2);
- }
- } catch (Swig::DirectorException& e) {
- rb_exc_raise(e.getError());
- SWIG_fail;
- }
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SipCallback_OnRegistrationChanged(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ RegistrationEvent *arg2 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ Swig::Director *director = 0;
+ bool upcall = false;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","OnRegistrationChanged", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RegistrationEvent const *","OnRegistrationChanged", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< RegistrationEvent * >(argp2);
+ director = dynamic_cast<Swig::Director *>(arg1);
+ upcall = (director && (director->swig_get_self() == self));
+ try {
+ if (upcall) {
+ result = (int)(arg1)->SipCallback::OnRegistrationChanged((RegistrationEvent const *)arg2);
+ }
+ else {
+ result = (int)(arg1)->OnRegistrationChanged((RegistrationEvent const *)arg2);
+ }
+ }
+ catch (Swig::DirectorException& e) {
+ rb_exc_raise(e.getError());
+ SWIG_fail;
+ }
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_disown_SipCallback(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","disown_SipCallback", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- {
- Swig::Director *director = dynamic_cast<Swig::Director *>(arg1);
- if (director) director->swig_disown();
- }
-
- return Qnil;
+_wrap_disown_SipCallback(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","disown_SipCallback", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ {
+ Swig::Director *director = dynamic_cast<Swig::Director *>(arg1);
+ if (director) {
+ director->swig_disown();
+ }
+ }
+
+ return Qnil;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3413,87 +3661,96 @@ swig_class SwigClassSafeObject;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SafeObject_allocate(VALUE self) {
+_wrap_SafeObject_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SafeObject_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SafeObject_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SafeObject);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SafeObject(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::SafeObject";
- SafeObject *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (SafeObject *)new SafeObject();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SafeObject(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::SafeObject";
+ SafeObject *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (SafeObject *)new SafeObject();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SafeObject(SafeObject *arg1) {
+free_SafeObject(SafeObject *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SafeObject_Lock(int argc, VALUE *argv, VALUE self) {
- SafeObject *arg1 = (SafeObject *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","Lock", 1, self ));
- }
- arg1 = reinterpret_cast< SafeObject * >(argp1);
- result = (int)(arg1)->Lock();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SafeObject_Lock(int argc, VALUE *argv, VALUE self)
+{
+ SafeObject *arg1 = (SafeObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","Lock", 1, self ));
+ }
+ arg1 = reinterpret_cast< SafeObject * >(argp1);
+ result = (int)(arg1)->Lock();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SafeObject_UnLock(int argc, VALUE *argv, VALUE self) {
- SafeObject *arg1 = (SafeObject *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","UnLock", 1, self ));
- }
- arg1 = reinterpret_cast< SafeObject * >(argp1);
- result = (int)(arg1)->UnLock();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SafeObject_UnLock(int argc, VALUE *argv, VALUE self)
+{
+ SafeObject *arg1 = (SafeObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","UnLock", 1, self ));
+ }
+ arg1 = reinterpret_cast< SafeObject * >(argp1);
+ result = (int)(arg1)->UnLock();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3501,389 +3758,457 @@ swig_class SwigClassSipStack;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipStack_allocate(VALUE self) {
+_wrap_SipStack_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipStack_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipStack_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipStack);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipStack(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipStack";
- SipStack *result = 0 ;
-
- if ((argc < 4) || (argc > 4)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","SipStack", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SipStack", 2, argv[1] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipStack", 3, argv[2] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","SipStack", 4, argv[3] ));
- }
- arg4 = reinterpret_cast< char * >(buf4);
- result = (SipStack *)new SipStack(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
- DATA_PTR(self) = result;
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- return self;
+_wrap_new_SipStack(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipStack";
+ SipStack *result = 0 ;
+
+ if ((argc < 4) || (argc > 4)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","SipStack", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SipStack", 2, argv[1] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipStack", 3, argv[2] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","SipStack", 4, argv[3] ));
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ result = (SipStack *)new SipStack(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
+ DATA_PTR(self) = result;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ return self;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ return Qnil;
}
SWIGINTERN void
-free_SipStack(SipStack *arg1) {
+free_SipStack(SipStack *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipStack_Start(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Start", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (bool)(arg1)->Start();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_Start(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Start", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (bool)(arg1)->Start();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setPassword(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setPassword", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setPassword", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setPassword((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_setPassword(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setPassword", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setPassword", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setPassword((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setProxyCSCF(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- unsigned int arg3 ;
- char *arg4 = (char *) 0 ;
- char *arg5 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- unsigned int val3 ;
- int ecode3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
- int res5 ;
- char *buf5 = 0 ;
- int alloc5 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 4) || (argc > 4)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setProxyCSCF", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","setProxyCSCF", 3, argv[1] ));
- }
- arg3 = static_cast< unsigned int >(val3);
- res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 4, argv[2] ));
- }
- arg4 = reinterpret_cast< char * >(buf4);
- res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
- if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 5, argv[3] ));
- }
- arg5 = reinterpret_cast< char * >(buf5);
- result = (bool)(arg1)->setProxyCSCF((char const *)arg2,arg3,(char const *)arg4,(char const *)arg5);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
- return vresult;
+_wrap_SipStack_setProxyCSCF(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ unsigned int arg3 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ unsigned int val3 ;
+ int ecode3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int res5 ;
+ char *buf5 = 0 ;
+ int alloc5 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 4) || (argc > 4)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setProxyCSCF", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","setProxyCSCF", 3, argv[1] ));
+ }
+ arg3 = static_cast< unsigned int >(val3);
+ res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 4, argv[2] ));
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 5, argv[3] ));
+ }
+ arg5 = reinterpret_cast< char * >(buf5);
+ result = (bool)(arg1)->setProxyCSCF((char const *)arg2,arg3,(char const *)arg4,(char const *)arg5);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ if (alloc5 == SWIG_NEWOBJ) {
+ delete[] buf5;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ if (alloc5 == SWIG_NEWOBJ) {
+ delete[] buf5;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setLocalIP(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalIP", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setLocalIP", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setLocalIP((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_setLocalIP(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalIP", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setLocalIP", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setLocalIP((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setLocalPort(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalPort", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setLocalPort", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->setLocalPort(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_setLocalPort(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalPort", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setLocalPort", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->setLocalPort(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_addHeader(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","addHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipStack_addHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","addHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_removeHeader(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","removeHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeHeader((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_removeHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","removeHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeHeader((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_Stop(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Stop", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (bool)(arg1)->Stop();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_Stop(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Stop", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (bool)(arg1)->Stop();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-static void *_p_RegistrationEventTo_p_SipEvent(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_RegistrationEventTo_p_SipEvent(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SipEvent *) ((RegistrationEvent *) x));
}
-static void *_p_SipStackTo_p_SafeObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_SipStackTo_p_SafeObject(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SafeObject *) ((SipStack *) x));
}
-static void *_p_RegistrationSessionTo_p_SipSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_RegistrationSessionTo_p_SipSession(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SipSession *) ((RegistrationSession *) x));
}
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)0, 0};
@@ -3898,16 +4223,16 @@ static swig_type_info _swigt__p_tsip_event_type_e = {"_p_tsip_event_type_e", "en
static swig_type_info _swigt__p_tsip_register_event_type_e = {"_p_tsip_register_event_type_e", "enum tsip_register_event_type_e *|tsip_register_event_type_t *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
- &_swigt__p_RegistrationEvent,
- &_swigt__p_RegistrationSession,
- &_swigt__p_SafeObject,
- &_swigt__p_SipCallback,
- &_swigt__p_SipEvent,
- &_swigt__p_SipSession,
- &_swigt__p_SipStack,
- &_swigt__p_char,
- &_swigt__p_tsip_event_type_e,
- &_swigt__p_tsip_register_event_type_e,
+ &_swigt__p_RegistrationEvent,
+ &_swigt__p_RegistrationSession,
+ &_swigt__p_SafeObject,
+ &_swigt__p_SipCallback,
+ &_swigt__p_SipEvent,
+ &_swigt__p_SipSession,
+ &_swigt__p_SipStack,
+ &_swigt__p_char,
+ &_swigt__p_tsip_event_type_e,
+ &_swigt__p_tsip_register_event_type_e,
};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
@@ -3922,16 +4247,16 @@ static swig_cast_info _swigc__p_tsip_event_type_e[] = { {&_swigt__p_tsip_event_
static swig_cast_info _swigc__p_tsip_register_event_type_e[] = { {&_swigt__p_tsip_register_event_type_e, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
- _swigc__p_RegistrationEvent,
- _swigc__p_RegistrationSession,
- _swigc__p_SafeObject,
- _swigc__p_SipCallback,
- _swigc__p_SipEvent,
- _swigc__p_SipSession,
- _swigc__p_SipStack,
- _swigc__p_char,
- _swigc__p_tsip_event_type_e,
- _swigc__p_tsip_register_event_type_e,
+ _swigc__p_RegistrationEvent,
+ _swigc__p_RegistrationSession,
+ _swigc__p_SafeObject,
+ _swigc__p_SipCallback,
+ _swigc__p_SipEvent,
+ _swigc__p_SipSession,
+ _swigc__p_SipStack,
+ _swigc__p_char,
+ _swigc__p_tsip_event_type_e,
+ _swigc__p_tsip_register_event_type_e,
};
@@ -3939,18 +4264,18 @@ static swig_cast_info *swig_cast_initial[] = {
/* -----------------------------------------------------------------------------
* Type initialization:
- * This problem is tough by the requirement that no dynamic
- * memory is used. Also, since swig_type_info structures store pointers to
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
* swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization.
- * The idea is that swig generates all the structures that are needed.
- * The runtime then collects these partially filled structures.
- * The SWIG_InitializeModule function takes these initial arrays out of
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
* swig_module, and does all the lookup, filling in the swig_module.types
* array with the correct data and linking the correct swig_cast_info
* structures together.
*
- * The generated swig_type_info structures are assigned staticly to an initial
+ * The generated swig_type_info structures are assigned staticly to an initial
* array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the
@@ -3960,17 +4285,17 @@ static swig_cast_info *swig_cast_initial[] = {
* a column is one of the swig_cast_info structures for that type.
* The cast_initial array is actually an array of arrays, because each row has
* a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it
+ * we find the array of casts associated with the type, and loop through it
* adding the casts to the list. The one last trick we need to do is making
* sure the type pointer in the swig_cast_info struct is correct.
*
- * First off, we lookup the cast->type name to see if it is already loaded.
+ * First off, we lookup the cast->type name to see if it is already loaded.
* There are three cases to handle:
* 1) If the cast->type has already been loaded AND the type we are adding
* casting info to has not been loaded (it is in this module), THEN we
* replace the cast->type pointer with the type pointer that has already
* been loaded.
- * 2) If BOTH types (the one we are adding casting info to, and the
+ * 2) If BOTH types (the one we are adding casting info to, and the
* cast->type) are loaded, THEN the cast info has already been loaded by
* the previous module so we just ignore it.
* 3) Finally, if cast->type has not already been loaded, then we add that
@@ -3991,151 +4316,167 @@ extern "C" {
SWIGRUNTIME void
-SWIG_InitializeModule(void *clientdata) {
- size_t i;
- swig_module_info *module_head, *iter;
- int found, init;
+SWIG_InitializeModule(void *clientdata)
+{
+size_t i;
+swig_module_info *module_head, *iter;
+int found, init;
- clientdata = clientdata;
+clientdata = clientdata;
- /* check to see if the circular list has been setup, if not, set it up */
- if (swig_module.next==0) {
+/* check to see if the circular list has been setup, if not, set it up */
+if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
init = 1;
- } else {
+}
+else {
init = 0;
- }
+}
- /* Try and load any already created modules */
- module_head = SWIG_GetModule(clientdata);
- if (!module_head) {
+/* Try and load any already created modules */
+module_head = SWIG_GetModule(clientdata);
+if (!module_head) {
/* This is the first module loaded for this interpreter */
/* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module);
module_head = &swig_module;
- } else {
+}
+else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
found=0;
iter=module_head;
do {
- if (iter==&swig_module) {
- found=1;
- break;
- }
- iter=iter->next;
- } while (iter!= module_head);
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ }
+ while (iter!= module_head);
/* if the is found in the list, then all is done and we may leave */
- if (found) return;
+ if (found) {
+ return;
+ }
/* otherwise we must add out module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
- }
+}
- /* When multiple interpeters are used, a module could have already been initialized in
- a different interpreter, but not yet have a pointer in this interpreter.
- In this case, we do not want to continue adding types... everything should be
- set up already */
- if (init == 0) return;
+/* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+if (init == 0) {
+ return;
+}
- /* Now work on filling in swig_module.types */
+/* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
- for (i = 0; i < swig_module.size; ++i) {
+for (i = 0; i < swig_module.size; ++i) {
swig_type_info *type = 0;
swig_type_info *ret;
swig_cast_info *cast;
-
+
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif
/* if there is another module already loaded */
if (swig_module.next != &swig_module) {
- type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
}
if (type) {
- /* Overwrite clientdata field */
+ /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: found type %s\n", type->name);
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
- if (swig_module.type_initial[i]->clientdata) {
- type->clientdata = swig_module.type_initial[i]->clientdata;
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
- }
- } else {
- type = swig_module.type_initial[i];
+ }
+ }
+ else {
+ type = swig_module.type_initial[i];
}
/* Insert casting types */
cast = swig_module.cast_initial[i];
while (cast->type) {
-
- /* Don't need to add information already in the list */
- ret = 0;
+
+ /* Don't need to add information already in the list */
+ ret = 0;
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
- if (swig_module.next != &swig_module) {
- ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
- if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+ if (ret) {
+ printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+ }
#endif
- }
- if (ret) {
- if (type == swig_module.type_initial[i]) {
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
- cast->type = ret;
- ret = 0;
- } else {
- /* Check for casting already in the list */
- swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+ cast->type = ret;
+ ret = 0;
+ }
+ else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
- if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+ if (ocast) {
+ printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+ }
#endif
- if (!ocast) ret = 0;
- }
- }
+ if (!ocast) {
+ ret = 0;
+ }
+ }
+ }
- if (!ret) {
+ if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
- if (type->cast) {
- type->cast->prev = cast;
- cast->next = type->cast;
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
}
- type->cast = cast;
- }
- cast++;
+ cast++;
}
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
- }
- swig_module.types[i] = 0;
+}
+swig_module.types[i] = 0;
#ifdef SWIGRUNTIME_DEBUG
- printf("**** SWIG_InitializeModule: Cast List ******\n");
- for (i = 0; i < swig_module.size; ++i) {
+printf("**** SWIG_InitializeModule: Cast List ******\n");
+for (i = 0; i < swig_module.size; ++i) {
int j = 0;
swig_cast_info *cast = swig_module.cast_initial[i];
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
while (cast->type) {
- printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
- cast++;
- ++j;
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
}
- printf("---- Total casts: %d\n",j);
- }
- printf("**** SWIG_InitializeModule: Cast List ******\n");
+ printf("---- Total casts: %d\n",j);
+}
+printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}
@@ -4145,31 +4486,36 @@ SWIG_InitializeModule(void *clientdata) {
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
-SWIG_PropagateClientData(void) {
- size_t i;
- swig_cast_info *equiv;
- static int init_run = 0;
+SWIG_PropagateClientData(void)
+{
+size_t i;
+swig_cast_info *equiv;
+static int init_run = 0;
- if (init_run) return;
- init_run = 1;
+if (init_run) {
+ return;
+}
+init_run = 1;
- for (i = 0; i < swig_module.size; i++) {
+for (i = 0; i < swig_module.size; i++) {
if (swig_module.types[i]->clientdata) {
- equiv = swig_module.types[i]->cast;
- while (equiv) {
- if (!equiv->converter) {
- if (equiv->type && !equiv->type->clientdata)
- SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata) {
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ }
+ equiv = equiv->next;
}
- equiv = equiv->next;
- }
}
- }
+}
}
#ifdef __cplusplus
#if 0
-{ /* c-mode */
+{
+ /* c-mode */
#endif
}
#endif
@@ -4180,114 +4526,115 @@ SWIG_PropagateClientData(void) {
#ifdef __cplusplus
extern "C"
#endif
-SWIGEXPORT void Init_tinyWRAP(void) {
- size_t i;
-
- SWIG_InitRuntime();
- mTinyWRAP = rb_define_module("TinyWRAP");
-
- SWIG_InitializeModule(0);
- for (i = 0; i < swig_module.size; i++) {
+SWIGEXPORT void Init_tinyWRAP(void)
+{
+size_t i;
+
+SWIG_InitRuntime();
+mTinyWRAP = rb_define_module("TinyWRAP");
+
+SWIG_InitializeModule(0);
+for (i = 0; i < swig_module.size; i++) {
SWIG_define_class(swig_module.types[i]);
- }
-
- SWIG_RubyInitializeTrackings();
-
- SwigClassSipEvent.klass = rb_define_class_under(mTinyWRAP, "SipEvent", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipEvent, (void *) &SwigClassSipEvent);
- rb_define_alloc_func(SwigClassSipEvent.klass, _wrap_SipEvent_allocate);
- rb_define_method(SwigClassSipEvent.klass, "initialize", VALUEFUNC(_wrap_new_SipEvent), -1);
- rb_define_method(SwigClassSipEvent.klass, "getCode", VALUEFUNC(_wrap_SipEvent_getCode), -1);
- rb_define_method(SwigClassSipEvent.klass, "getPhrase", VALUEFUNC(_wrap_SipEvent_getPhrase), -1);
- rb_define_method(SwigClassSipEvent.klass, "getBaseSession", VALUEFUNC(_wrap_SipEvent_getBaseSession), -1);
- SwigClassSipEvent.mark = 0;
- SwigClassSipEvent.destroy = (void (*)(void *)) free_SipEvent;
- SwigClassSipEvent.trackObjects = 0;
-
- SwigClassSipSession.klass = rb_define_class_under(mTinyWRAP, "SipSession", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipSession, (void *) &SwigClassSipSession);
- rb_define_alloc_func(SwigClassSipSession.klass, _wrap_SipSession_allocate);
- rb_define_method(SwigClassSipSession.klass, "initialize", VALUEFUNC(_wrap_new_SipSession), -1);
- rb_define_method(SwigClassSipSession.klass, "addHeader", VALUEFUNC(_wrap_SipSession_addHeader), -1);
- rb_define_method(SwigClassSipSession.klass, "removeHeader", VALUEFUNC(_wrap_SipSession_removeHeader), -1);
- rb_define_method(SwigClassSipSession.klass, "addCaps", VALUEFUNC(_wrap_SipSession_addCaps), -1);
- rb_define_method(SwigClassSipSession.klass, "removeCaps", VALUEFUNC(_wrap_SipSession_removeCaps), -1);
- rb_define_method(SwigClassSipSession.klass, "setExpires", VALUEFUNC(_wrap_SipSession_setExpires), -1);
- rb_define_method(SwigClassSipSession.klass, "setFromUri", VALUEFUNC(_wrap_SipSession_setFromUri), -1);
- rb_define_method(SwigClassSipSession.klass, "setToUri", VALUEFUNC(_wrap_SipSession_setToUri), -1);
- SwigClassSipSession.mark = 0;
- SwigClassSipSession.destroy = (void (*)(void *)) free_SipSession;
- SwigClassSipSession.trackObjects = 0;
-
- SwigClassRegistrationEvent.klass = rb_define_class_under(mTinyWRAP, "RegistrationEvent", ((swig_class *) SWIGTYPE_p_SipEvent->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_RegistrationEvent, (void *) &SwigClassRegistrationEvent);
- rb_define_alloc_func(SwigClassRegistrationEvent.klass, _wrap_RegistrationEvent_allocate);
- rb_define_method(SwigClassRegistrationEvent.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationEvent), -1);
- rb_define_method(SwigClassRegistrationEvent.klass, "getType", VALUEFUNC(_wrap_RegistrationEvent_getType), -1);
- rb_define_method(SwigClassRegistrationEvent.klass, "getSession", VALUEFUNC(_wrap_RegistrationEvent_getSession), -1);
- SwigClassRegistrationEvent.mark = 0;
- SwigClassRegistrationEvent.destroy = (void (*)(void *)) free_RegistrationEvent;
- SwigClassRegistrationEvent.trackObjects = 0;
-
- SwigClassRegistrationSession.klass = rb_define_class_under(mTinyWRAP, "RegistrationSession", ((swig_class *) SWIGTYPE_p_SipSession->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_RegistrationSession, (void *) &SwigClassRegistrationSession);
- rb_define_alloc_func(SwigClassRegistrationSession.klass, _wrap_RegistrationSession_allocate);
- rb_define_method(SwigClassRegistrationSession.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationSession), -1);
- rb_define_method(SwigClassRegistrationSession.klass, "Register", VALUEFUNC(_wrap_RegistrationSession_Register), -1);
- rb_define_method(SwigClassRegistrationSession.klass, "UnRegister", VALUEFUNC(_wrap_RegistrationSession_UnRegister), -1);
- SwigClassRegistrationSession.mark = 0;
- SwigClassRegistrationSession.destroy = (void (*)(void *)) free_RegistrationSession;
- SwigClassRegistrationSession.trackObjects = 0;
- rb_define_module_function(mTinyWRAP, "disown_SipCallback", VALUEFUNC(_wrap_disown_SipCallback), -1);
-
- SwigClassSipCallback.klass = rb_define_class_under(mTinyWRAP, "SipCallback", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipCallback, (void *) &SwigClassSipCallback);
- rb_define_alloc_func(SwigClassSipCallback.klass, _wrap_SipCallback_allocate);
- rb_define_method(SwigClassSipCallback.klass, "initialize", VALUEFUNC(_wrap_new_SipCallback), -1);
- rb_define_method(SwigClassSipCallback.klass, "OnRegistrationChanged", VALUEFUNC(_wrap_SipCallback_OnRegistrationChanged), -1);
- SwigClassSipCallback.mark = 0;
- SwigClassSipCallback.destroy = (void (*)(void *)) free_SipCallback;
- SwigClassSipCallback.trackObjects = 0;
-
- SwigClassSafeObject.klass = rb_define_class_under(mTinyWRAP, "SafeObject", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SafeObject, (void *) &SwigClassSafeObject);
- rb_define_alloc_func(SwigClassSafeObject.klass, _wrap_SafeObject_allocate);
- rb_define_method(SwigClassSafeObject.klass, "initialize", VALUEFUNC(_wrap_new_SafeObject), -1);
- rb_define_method(SwigClassSafeObject.klass, "Lock", VALUEFUNC(_wrap_SafeObject_Lock), -1);
- rb_define_method(SwigClassSafeObject.klass, "UnLock", VALUEFUNC(_wrap_SafeObject_UnLock), -1);
- SwigClassSafeObject.mark = 0;
- SwigClassSafeObject.destroy = (void (*)(void *)) free_SafeObject;
- SwigClassSafeObject.trackObjects = 0;
-
- SwigClassSipStack.klass = rb_define_class_under(mTinyWRAP, "SipStack", ((swig_class *) SWIGTYPE_p_SafeObject->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_SipStack, (void *) &SwigClassSipStack);
- rb_define_alloc_func(SwigClassSipStack.klass, _wrap_SipStack_allocate);
- rb_define_method(SwigClassSipStack.klass, "initialize", VALUEFUNC(_wrap_new_SipStack), -1);
- rb_define_method(SwigClassSipStack.klass, "Start", VALUEFUNC(_wrap_SipStack_Start), -1);
- rb_define_method(SwigClassSipStack.klass, "setPassword", VALUEFUNC(_wrap_SipStack_setPassword), -1);
- rb_define_method(SwigClassSipStack.klass, "setProxyCSCF", VALUEFUNC(_wrap_SipStack_setProxyCSCF), -1);
- rb_define_method(SwigClassSipStack.klass, "setLocalIP", VALUEFUNC(_wrap_SipStack_setLocalIP), -1);
- rb_define_method(SwigClassSipStack.klass, "setLocalPort", VALUEFUNC(_wrap_SipStack_setLocalPort), -1);
- rb_define_method(SwigClassSipStack.klass, "addHeader", VALUEFUNC(_wrap_SipStack_addHeader), -1);
- rb_define_method(SwigClassSipStack.klass, "removeHeader", VALUEFUNC(_wrap_SipStack_removeHeader), -1);
- rb_define_method(SwigClassSipStack.klass, "Stop", VALUEFUNC(_wrap_SipStack_Stop), -1);
- SwigClassSipStack.mark = 0;
- SwigClassSipStack.destroy = (void (*)(void *)) free_SipStack;
- SwigClassSipStack.trackObjects = 0;
- rb_define_const(mTinyWRAP, "Tsip_event_invite", SWIG_From_int(static_cast< int >(tsip_event_invite)));
- rb_define_const(mTinyWRAP, "Tsip_event_message", SWIG_From_int(static_cast< int >(tsip_event_message)));
- rb_define_const(mTinyWRAP, "Tsip_event_options", SWIG_From_int(static_cast< int >(tsip_event_options)));
- rb_define_const(mTinyWRAP, "Tsip_event_publish", SWIG_From_int(static_cast< int >(tsip_event_publish)));
- rb_define_const(mTinyWRAP, "Tsip_event_register", SWIG_From_int(static_cast< int >(tsip_event_register)));
- rb_define_const(mTinyWRAP, "Tsip_event_subscribe", SWIG_From_int(static_cast< int >(tsip_event_subscribe)));
- rb_define_const(mTinyWRAP, "Tsip_event_dialog", SWIG_From_int(static_cast< int >(tsip_event_dialog)));
- rb_define_const(mTinyWRAP, "Tsip_i_register", SWIG_From_int(static_cast< int >(tsip_i_register)));
- rb_define_const(mTinyWRAP, "Tsip_ai_register", SWIG_From_int(static_cast< int >(tsip_ai_register)));
- rb_define_const(mTinyWRAP, "Tsip_o_register", SWIG_From_int(static_cast< int >(tsip_o_register)));
- rb_define_const(mTinyWRAP, "Tsip_ao_register", SWIG_From_int(static_cast< int >(tsip_ao_register)));
- rb_define_const(mTinyWRAP, "Tsip_i_unregister", SWIG_From_int(static_cast< int >(tsip_i_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_ai_unregister", SWIG_From_int(static_cast< int >(tsip_ai_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_o_unregister", SWIG_From_int(static_cast< int >(tsip_o_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_ao_unregister", SWIG_From_int(static_cast< int >(tsip_ao_unregister)));
+}
+
+SWIG_RubyInitializeTrackings();
+
+SwigClassSipEvent.klass = rb_define_class_under(mTinyWRAP, "SipEvent", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipEvent, (void *) &SwigClassSipEvent);
+rb_define_alloc_func(SwigClassSipEvent.klass, _wrap_SipEvent_allocate);
+rb_define_method(SwigClassSipEvent.klass, "initialize", VALUEFUNC(_wrap_new_SipEvent), -1);
+rb_define_method(SwigClassSipEvent.klass, "getCode", VALUEFUNC(_wrap_SipEvent_getCode), -1);
+rb_define_method(SwigClassSipEvent.klass, "getPhrase", VALUEFUNC(_wrap_SipEvent_getPhrase), -1);
+rb_define_method(SwigClassSipEvent.klass, "getBaseSession", VALUEFUNC(_wrap_SipEvent_getBaseSession), -1);
+SwigClassSipEvent.mark = 0;
+SwigClassSipEvent.destroy = (void (*)(void *)) free_SipEvent;
+SwigClassSipEvent.trackObjects = 0;
+
+SwigClassSipSession.klass = rb_define_class_under(mTinyWRAP, "SipSession", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipSession, (void *) &SwigClassSipSession);
+rb_define_alloc_func(SwigClassSipSession.klass, _wrap_SipSession_allocate);
+rb_define_method(SwigClassSipSession.klass, "initialize", VALUEFUNC(_wrap_new_SipSession), -1);
+rb_define_method(SwigClassSipSession.klass, "addHeader", VALUEFUNC(_wrap_SipSession_addHeader), -1);
+rb_define_method(SwigClassSipSession.klass, "removeHeader", VALUEFUNC(_wrap_SipSession_removeHeader), -1);
+rb_define_method(SwigClassSipSession.klass, "addCaps", VALUEFUNC(_wrap_SipSession_addCaps), -1);
+rb_define_method(SwigClassSipSession.klass, "removeCaps", VALUEFUNC(_wrap_SipSession_removeCaps), -1);
+rb_define_method(SwigClassSipSession.klass, "setExpires", VALUEFUNC(_wrap_SipSession_setExpires), -1);
+rb_define_method(SwigClassSipSession.klass, "setFromUri", VALUEFUNC(_wrap_SipSession_setFromUri), -1);
+rb_define_method(SwigClassSipSession.klass, "setToUri", VALUEFUNC(_wrap_SipSession_setToUri), -1);
+SwigClassSipSession.mark = 0;
+SwigClassSipSession.destroy = (void (*)(void *)) free_SipSession;
+SwigClassSipSession.trackObjects = 0;
+
+SwigClassRegistrationEvent.klass = rb_define_class_under(mTinyWRAP, "RegistrationEvent", ((swig_class *) SWIGTYPE_p_SipEvent->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_RegistrationEvent, (void *) &SwigClassRegistrationEvent);
+rb_define_alloc_func(SwigClassRegistrationEvent.klass, _wrap_RegistrationEvent_allocate);
+rb_define_method(SwigClassRegistrationEvent.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationEvent), -1);
+rb_define_method(SwigClassRegistrationEvent.klass, "getType", VALUEFUNC(_wrap_RegistrationEvent_getType), -1);
+rb_define_method(SwigClassRegistrationEvent.klass, "getSession", VALUEFUNC(_wrap_RegistrationEvent_getSession), -1);
+SwigClassRegistrationEvent.mark = 0;
+SwigClassRegistrationEvent.destroy = (void (*)(void *)) free_RegistrationEvent;
+SwigClassRegistrationEvent.trackObjects = 0;
+
+SwigClassRegistrationSession.klass = rb_define_class_under(mTinyWRAP, "RegistrationSession", ((swig_class *) SWIGTYPE_p_SipSession->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_RegistrationSession, (void *) &SwigClassRegistrationSession);
+rb_define_alloc_func(SwigClassRegistrationSession.klass, _wrap_RegistrationSession_allocate);
+rb_define_method(SwigClassRegistrationSession.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationSession), -1);
+rb_define_method(SwigClassRegistrationSession.klass, "Register", VALUEFUNC(_wrap_RegistrationSession_Register), -1);
+rb_define_method(SwigClassRegistrationSession.klass, "UnRegister", VALUEFUNC(_wrap_RegistrationSession_UnRegister), -1);
+SwigClassRegistrationSession.mark = 0;
+SwigClassRegistrationSession.destroy = (void (*)(void *)) free_RegistrationSession;
+SwigClassRegistrationSession.trackObjects = 0;
+rb_define_module_function(mTinyWRAP, "disown_SipCallback", VALUEFUNC(_wrap_disown_SipCallback), -1);
+
+SwigClassSipCallback.klass = rb_define_class_under(mTinyWRAP, "SipCallback", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipCallback, (void *) &SwigClassSipCallback);
+rb_define_alloc_func(SwigClassSipCallback.klass, _wrap_SipCallback_allocate);
+rb_define_method(SwigClassSipCallback.klass, "initialize", VALUEFUNC(_wrap_new_SipCallback), -1);
+rb_define_method(SwigClassSipCallback.klass, "OnRegistrationChanged", VALUEFUNC(_wrap_SipCallback_OnRegistrationChanged), -1);
+SwigClassSipCallback.mark = 0;
+SwigClassSipCallback.destroy = (void (*)(void *)) free_SipCallback;
+SwigClassSipCallback.trackObjects = 0;
+
+SwigClassSafeObject.klass = rb_define_class_under(mTinyWRAP, "SafeObject", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SafeObject, (void *) &SwigClassSafeObject);
+rb_define_alloc_func(SwigClassSafeObject.klass, _wrap_SafeObject_allocate);
+rb_define_method(SwigClassSafeObject.klass, "initialize", VALUEFUNC(_wrap_new_SafeObject), -1);
+rb_define_method(SwigClassSafeObject.klass, "Lock", VALUEFUNC(_wrap_SafeObject_Lock), -1);
+rb_define_method(SwigClassSafeObject.klass, "UnLock", VALUEFUNC(_wrap_SafeObject_UnLock), -1);
+SwigClassSafeObject.mark = 0;
+SwigClassSafeObject.destroy = (void (*)(void *)) free_SafeObject;
+SwigClassSafeObject.trackObjects = 0;
+
+SwigClassSipStack.klass = rb_define_class_under(mTinyWRAP, "SipStack", ((swig_class *) SWIGTYPE_p_SafeObject->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_SipStack, (void *) &SwigClassSipStack);
+rb_define_alloc_func(SwigClassSipStack.klass, _wrap_SipStack_allocate);
+rb_define_method(SwigClassSipStack.klass, "initialize", VALUEFUNC(_wrap_new_SipStack), -1);
+rb_define_method(SwigClassSipStack.klass, "Start", VALUEFUNC(_wrap_SipStack_Start), -1);
+rb_define_method(SwigClassSipStack.klass, "setPassword", VALUEFUNC(_wrap_SipStack_setPassword), -1);
+rb_define_method(SwigClassSipStack.klass, "setProxyCSCF", VALUEFUNC(_wrap_SipStack_setProxyCSCF), -1);
+rb_define_method(SwigClassSipStack.klass, "setLocalIP", VALUEFUNC(_wrap_SipStack_setLocalIP), -1);
+rb_define_method(SwigClassSipStack.klass, "setLocalPort", VALUEFUNC(_wrap_SipStack_setLocalPort), -1);
+rb_define_method(SwigClassSipStack.klass, "addHeader", VALUEFUNC(_wrap_SipStack_addHeader), -1);
+rb_define_method(SwigClassSipStack.klass, "removeHeader", VALUEFUNC(_wrap_SipStack_removeHeader), -1);
+rb_define_method(SwigClassSipStack.klass, "Stop", VALUEFUNC(_wrap_SipStack_Stop), -1);
+SwigClassSipStack.mark = 0;
+SwigClassSipStack.destroy = (void (*)(void *)) free_SipStack;
+SwigClassSipStack.trackObjects = 0;
+rb_define_const(mTinyWRAP, "Tsip_event_invite", SWIG_From_int(static_cast< int >(tsip_event_invite)));
+rb_define_const(mTinyWRAP, "Tsip_event_message", SWIG_From_int(static_cast< int >(tsip_event_message)));
+rb_define_const(mTinyWRAP, "Tsip_event_options", SWIG_From_int(static_cast< int >(tsip_event_options)));
+rb_define_const(mTinyWRAP, "Tsip_event_publish", SWIG_From_int(static_cast< int >(tsip_event_publish)));
+rb_define_const(mTinyWRAP, "Tsip_event_register", SWIG_From_int(static_cast< int >(tsip_event_register)));
+rb_define_const(mTinyWRAP, "Tsip_event_subscribe", SWIG_From_int(static_cast< int >(tsip_event_subscribe)));
+rb_define_const(mTinyWRAP, "Tsip_event_dialog", SWIG_From_int(static_cast< int >(tsip_event_dialog)));
+rb_define_const(mTinyWRAP, "Tsip_i_register", SWIG_From_int(static_cast< int >(tsip_i_register)));
+rb_define_const(mTinyWRAP, "Tsip_ai_register", SWIG_From_int(static_cast< int >(tsip_ai_register)));
+rb_define_const(mTinyWRAP, "Tsip_o_register", SWIG_From_int(static_cast< int >(tsip_o_register)));
+rb_define_const(mTinyWRAP, "Tsip_ao_register", SWIG_From_int(static_cast< int >(tsip_ao_register)));
+rb_define_const(mTinyWRAP, "Tsip_i_unregister", SWIG_From_int(static_cast< int >(tsip_i_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_ai_unregister", SWIG_From_int(static_cast< int >(tsip_ai_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_o_unregister", SWIG_From_int(static_cast< int >(tsip_o_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_ao_unregister", SWIG_From_int(static_cast< int >(tsip_ao_unregister)));
}
diff --git a/bindings/ruby/tinyWRAP_wrap.h b/bindings/ruby/tinyWRAP_wrap.h
index 5320a3f4..3943f13 100755
--- a/bindings/ruby/tinyWRAP_wrap.h
+++ b/bindings/ruby/tinyWRAP_wrap.h
@@ -1,22 +1,24 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.40
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_TinyWRAP_WRAP_H_
#define SWIG_TinyWRAP_WRAP_H_
-namespace Swig {
- class Director;
+namespace Swig
+{
+class Director;
}
-class SwigDirector_SipCallback : public SipCallback, public Swig::Director {
+class SwigDirector_SipCallback : public SipCallback, public Swig::Director
+{
public:
SwigDirector_SipCallback(VALUE self);
diff --git a/bindings/winrt/doubango_rt/include/rt_ActionConfig.h b/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
index abafc37..25a5809 100755
--- a/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
+++ b/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,31 +23,33 @@ class ActionConfig;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtActionConfig sealed
- {
- public:
- rtActionConfig();
- virtual ~rtActionConfig();
-
- bool addHeader(Platform::String^ name, Platform::String^ value);
+namespace BackEnd
+{
+public ref class rtActionConfig sealed
+{
+public:
+ rtActionConfig();
+ virtual ~rtActionConfig();
+
+ bool addHeader(Platform::String^ name, Platform::String^ value);
#if COM_VISIBLE
- bool addPayload(Platform::String^ payload);
+ bool addPayload(Platform::String^ payload);
#else
- bool addPayload(Platform::IntPtr payload, unsigned len);
+ bool addPayload(Platform::IntPtr payload, unsigned len);
#endif
- bool setActiveMedia(rt_twrap_media_type_t type);
-
- rtActionConfig^ setResponseLine(short code, Platform::String^ phrase);
- rtActionConfig^ setMediaString(rt_twrap_media_type_t type, Platform::String^ key, Platform::String^ value);
- rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
+ bool setActiveMedia(rt_twrap_media_type_t type);
+
+ rtActionConfig^ setResponseLine(short code, Platform::String^ phrase);
+ rtActionConfig^ setMediaString(rt_twrap_media_type_t type, Platform::String^ key, Platform::String^ value);
+ rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
- internal:
- ActionConfig* getWrappedActionConfig(){ return m_pActionConfig; }
+internal:
+ ActionConfig* getWrappedActionConfig() {
+ return m_pActionConfig;
+ }
- private:
- ActionConfig* m_pActionConfig;
- };
- }
+private:
+ ActionConfig* m_pActionConfig;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Config.h b/bindings/winrt/doubango_rt/include/rt_Config.h
index e8d7dde..d5fb7eb 100755
--- a/bindings/winrt/doubango_rt/include/rt_Config.h
+++ b/bindings/winrt/doubango_rt/include/rt_Config.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -20,7 +20,7 @@
#define rtSafeDelete(ptr) if((ptr)) delete (ptr), (ptr) = nullptr;
#if COM_VISIBLE
-# define OVERRIDE_FUNC(fun)
+# define OVERRIDE_FUNC(fun)
# define VISIBLE_VOID_PTR Platform::String^
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) rtString::toUtf8((ptr)).data()
#else
@@ -28,4 +28,3 @@
# define VISIBLE_VOID_PTR Platform::IntPtr
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) (void*)((ptr))
#endif
- \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_DDebug.h b/bindings/winrt/doubango_rt/include/rt_DDebug.h
index e4300b5..8973271 100755
--- a/bindings/winrt/doubango_rt/include/rt_DDebug.h
+++ b/bindings/winrt/doubango_rt/include/rt_DDebug.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,30 +24,30 @@ class DDebugCallbackProxy;
namespace doubango_rt
{
- namespace BackEnd
- {
- public interface class rtIDDebugCallback
- {
- virtual int OnDebugInfo(Platform::String^ message);
- virtual int OnDebugWarn(Platform::String^ message);
- virtual int OnDebugError(Platform::String^ message);
- virtual int OnDebugFatal(Platform::String^ message);
- };
+namespace BackEnd
+{
+public interface class rtIDDebugCallback
+{
+ virtual int OnDebugInfo(Platform::String^ message);
+ virtual int OnDebugWarn(Platform::String^ message);
+ virtual int OnDebugError(Platform::String^ message);
+ virtual int OnDebugFatal(Platform::String^ message);
+};
+
+public ref class rtDDebugCallback sealed
+{
+internal:
+ rtDDebugCallback(rtIDDebugCallback^ pI);
+public:
+ virtual ~rtDDebugCallback();
+ friend class DDebugCallbackProxy;
- public ref class rtDDebugCallback sealed
- {
- internal:
- rtDDebugCallback(rtIDDebugCallback^ pI);
- public:
- virtual ~rtDDebugCallback();
- friend class DDebugCallbackProxy;
-
- internal:
- const DDebugCallback* getWrappedCallback();
+internal:
+ const DDebugCallback* getWrappedCallback();
- private:
- rtIDDebugCallback^ m_pI;
- DDebugCallbackProxy* m_pCallback;
- };
- }
+private:
+ rtIDDebugCallback^ m_pI;
+ DDebugCallbackProxy* m_pCallback;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Enums.h b/bindings/winrt/doubango_rt/include/rt_Enums.h
index 78e97bf..843a501 100755
--- a/bindings/winrt/doubango_rt/include/rt_Enums.h
+++ b/bindings/winrt/doubango_rt/include/rt_Enums.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,307 +27,308 @@
namespace doubango_rt
{
- namespace BackEnd
- {
- public enum class rtConstants
- {
- rt_tsip_event_code_dialog_transport_error = tsip_event_code_dialog_transport_error,
- rt_tsip_event_code_dialog_global_error = tsip_event_code_dialog_global_error,
- rt_tsip_event_code_dialog_message_error = tsip_event_code_dialog_message_error,
-
- // 8xx ==> success
- rt_tsip_event_code_dialog_request_incoming = tsip_event_code_dialog_request_incoming,
- rt_tsip_event_code_dialog_request_outgoing = tsip_event_code_dialog_request_outgoing,
- rt_tsip_event_code_dialog_request_cancelled = tsip_event_code_dialog_request_cancelled,
- rt_tsip_event_code_dialog_request_sent = tsip_event_code_dialog_request_sent,
-
- // 9xx ==> Informational
- rt_tsip_event_code_dialog_connecting = tsip_event_code_dialog_connecting,
- rt_tsip_event_code_dialog_connected = tsip_event_code_dialog_connected,
- rt_tsip_event_code_dialog_terminating = tsip_event_code_dialog_terminating,
- rt_tsip_event_code_dialog_terminated = tsip_event_code_dialog_terminated,
- rt_tsip_event_code_stack_starting = tsip_event_code_stack_starting,
- rt_tsip_event_code_stack_started = tsip_event_code_stack_started,
- rt_tsip_event_code_stack_stopping = tsip_event_code_stack_stopping,
- rt_tsip_event_code_stack_stopped = tsip_event_code_stack_stopped,
- rt_tsip_event_code_stack_failed_to_start = tsip_event_code_stack_failed_to_start,
- rt_tsip_event_code_stack_failed_to_stop = tsip_event_code_stack_failed_to_stop
- };
-
- public enum class rt_twrap_media_type_t
- {
- twrap_media_none = twrap_media_none,
-
- twrap_media_audio = twrap_media_audio,
- twrap_media_video = twrap_media_video,
- twrap_media_msrp = twrap_media_msrp,
- twrap_media_t140 = twrap_media_t140,
- twrap_media_bfcp = twrap_media_bfcp,
- twrap_media_bfcp_audio = twrap_media_bfcp_audio,
- twrap_media_bfcp_video = twrap_media_bfcp_video,
-
- twrap_media_audiovideo = twrap_media_audiovideo, /* @deprecated */
- twrap_media_audio_video = twrap_media_audio_video,
- };
-
- public enum class rt_tmedia_bandwidth_level_t
- {
- tmedia_bl_low = tmedia_bl_low,
- tmedia_bl_medium = tmedia_bl_medium,
- tmedia_bl_hight = tmedia_bl_hight,
- tmedia_bl_unrestricted = tmedia_bl_unrestricted
- };
-
- public enum class rt_tmedia_pref_video_size_t
- {/* must be sorted like this */
- tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
- tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
- tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
- tmedia_pref_video_size_cif = tmedia_pref_video_size_cif, // 352 x 288
- tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
- tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
- tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
- tmedia_pref_video_size_wvga = tmedia_pref_video_size_wvga, // 800 x 480
- tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
- tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
- tmedia_pref_video_size_xga = tmedia_pref_video_size_xga, // 1024 x 768
- tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
- tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
- tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
- };
-
- public enum class rt_tmedia_profile_t
- {
- tmedia_profile_default = tmedia_profile_default,
- tmedia_profile_rtcweb = tmedia_profile_rtcweb
- };
-
- public enum class rt_tmedia_qos_strength_t
- {
- tmedia_qos_strength_none = tmedia_qos_strength_none,
- tmedia_qos_strength_failure = tmedia_qos_strength_failure,
- tmedia_qos_strength_unknown = tmedia_qos_strength_unknown,
- tmedia_qos_strength_optional = tmedia_qos_strength_optional,
- tmedia_qos_strength_mandatory = tmedia_qos_strength_mandatory
- };
-
- public enum class rt_tmedia_qos_stype_t
- {
- tmedia_qos_stype_none = tmedia_qos_stype_none,
-
- tmedia_qos_stype_segmented = tmedia_qos_stype_segmented,
- tmedia_qos_stype_e2e = tmedia_qos_stype_e2e,
- };
-
- public enum class rt_tmedia_srtp_mode_t
- {
- tmedia_srtp_mode_none = tmedia_srtp_mode_none,
- tmedia_srtp_mode_optional = tmedia_srtp_mode_optional,
- tmedia_srtp_mode_mandatory = tmedia_srtp_mode_mandatory
- };
-
- public enum class rt_tmedia_srtp_type_t
- {
- tmedia_srtp_type_none = tmedia_srtp_type_none,
- tmedia_srtp_type_sdes = tmedia_srtp_type_sdes,
- tmedia_srtp_type_dtls = tmedia_srtp_type_dtls,
- tmedia_srtp_type_sdes_dtls = tmedia_srtp_type_sdes_dtls
- };
-
- public enum class rt_tmedia_t140_data_type_t
- {
- tmedia_t140_data_type_utf8 = tmedia_t140_data_type_utf8,
- tmedia_t140_data_type_zero_width_no_break_space = tmedia_t140_data_type_zero_width_no_break_space,
- tmedia_t140_data_type_backspace = tmedia_t140_data_type_backspace,
- tmedia_t140_data_type_esc = tmedia_t140_data_type_esc,
- tmedia_t140_data_type_cr = tmedia_t140_data_type_cr,
- tmedia_t140_data_type_lf = tmedia_t140_data_type_lf,
- tmedia_t140_data_type_cr_lf = tmedia_t140_data_type_cr_lf,
- tmedia_t140_data_type_bell = tmedia_t140_data_type_bell,
- tmedia_t140_data_type_sos = tmedia_t140_data_type_sos,
- tmedia_t140_data_type_string_term = tmedia_t140_data_type_string_term,
- tmedia_t140_data_type_graphic_start = tmedia_t140_data_type_graphic_start,
- tmedia_t140_data_type_graphic_end = tmedia_t140_data_type_graphic_end,
- tmedia_t140_data_type_loss_char_char = tmedia_t140_data_type_loss_char_char,
- tmedia_t140_data_type_loss_utf8 = tmedia_t140_data_type_loss_utf8,
- };
-
- public enum class rt_tmedia_type_t
- {
- tmedia_none = tmedia_none,
- tmedia_ghost = tmedia_ghost,
-
- tmedia_audio = tmedia_audio,
- tmedia_video = tmedia_video,
- tmedia_chat = tmedia_chat,
- tmedia_file = tmedia_file,
- tmedia_t38 = tmedia_t38,
- tmedia_t140 = tmedia_t140,
-
- tmedia_msrp = tmedia_msrp,
- tmedia_audiovideo = tmedia_audiovideo,
-
- tmedia_all = tmedia_all
- };
-
- public enum class rt_tmsrp_event_type_t
- {
- tmsrp_event_type_none = tmsrp_event_type_none,
- tmsrp_event_type_connected = tmsrp_event_type_connected,
- tmsrp_event_type_disconnected = tmsrp_event_type_disconnected,
- tmsrp_event_type_message = tmsrp_event_type_message,
- };
-
- public enum class rt_tmsrp_request_type_t
- {
- tmsrp_NONE = tmsrp_NONE,
-
- tmsrp_SEND = tmsrp_SEND,
- tmsrp_REPORT = tmsrp_REPORT,
- tmsrp_AUTH = tmsrp_AUTH
- };
-
- public enum class rt_tsip_info_event_type_t
- {
- tsip_i_info = tsip_i_info,
- tsip_ao_info = tsip_ao_info,
- };
-
- public enum class rt_tsip_invite_event_type_t
- {
- tsip_i_newcall = tsip_i_newcall,
-
- tsip_i_request = tsip_i_request,
- tsip_ao_request = tsip_ao_request,
-
- tsip_o_ect_trying = tsip_o_ect_trying,
- tsip_o_ect_accepted = tsip_o_ect_accepted,
- tsip_o_ect_completed = tsip_o_ect_completed,
- tsip_o_ect_failed = tsip_o_ect_failed,
- tsip_o_ect_notify = tsip_o_ect_notify,
- tsip_i_ect_requested = tsip_i_ect_requested,
- tsip_i_ect_newcall = tsip_i_ect_newcall,
- tsip_i_ect_completed = tsip_i_ect_completed,
- tsip_i_ect_failed = tsip_i_ect_failed,
- tsip_i_ect_notify = tsip_i_ect_notify,
-
- tsip_m_early_media = tsip_m_early_media,
- tsip_m_updating = tsip_m_updating,
- tsip_m_updated = tsip_m_updated,
-
- tsip_m_local_hold_ok = tsip_m_local_hold_ok,
- tsip_m_local_hold_nok = tsip_m_local_hold_nok,
- tsip_m_local_resume_ok = tsip_m_local_resume_ok,
- tsip_m_local_resume_nok = tsip_m_local_resume_nok,
- tsip_m_remote_hold = tsip_m_remote_hold,
- tsip_m_remote_resume = tsip_m_remote_resume,
- };
-
- public enum class rt_tsip_message_event_type_t
- {
- tsip_i_message = tsip_i_message,
- tsip_ao_message = tsip_ao_message,
- };
-
- public enum class rt_tsip_options_event_type_t
- {
- tsip_i_options = tsip_i_options,
- tsip_ao_options = tsip_ao_options,
- };
-
- public enum class rt_tsip_publish_event_type_t
- {
- tsip_i_publish = tsip_i_publish,
- tsip_ao_publish = tsip_ao_publish,
-
- tsip_i_unpublish = tsip_i_unpublish,
- tsip_ao_unpublish = tsip_ao_unpublish
- };
-
- public enum class rt_tsip_register_event_type_t
- {
- tsip_i_newreg = tsip_i_newreg,
-
- tsip_i_register = tsip_i_register,
- tsip_ao_register = tsip_ao_register,
-
- tsip_i_unregister = tsip_i_unregister,
- tsip_ao_unregister = tsip_ao_unregister,
- };
-
- public enum class rt_tsip_request_type_t
- {
- tsip_NONE = tsip_NONE,
-
- tsip_ACK = tsip_ACK,
- tsip_BYE = tsip_BYE,
- tsip_CANCEL = tsip_CANCEL,
- tsip_INVITE = tsip_INVITE,
- tsip_OPTIONS = tsip_OPTIONS,
- tsip_REGISTER = tsip_REGISTER,
- tsip_SUBSCRIBE = tsip_SUBSCRIBE,
- tsip_NOTIFY = tsip_NOTIFY,
- tsip_REFER = tsip_REFER,
- tsip_INFO = tsip_INFO,
- tsip_UPDATE = tsip_UPDATE,
- tsip_MESSAGE = tsip_MESSAGE,
- tsip_PUBLISH = tsip_PUBLISH,
- tsip_PRACK = tsip_PRACK
- };
-
- public enum class rt_tsip_subscribe_event_type_t
- {
- tsip_i_subscribe = tsip_i_subscribe,
- tsip_ao_subscribe = tsip_ao_subscribe,
-
- tsip_i_unsubscribe = tsip_i_unsubscribe,
- tsip_ao_unsubscribe = tsip_ao_unsubscribe,
-
- tsip_i_notify = tsip_i_notify,
- tsip_ao_notify = tsip_ao_notify
- };
-
- public enum class rt_tdav_codec_id_t
- {
- tdav_codec_id_none = tmedia_codec_id_none,
-
- tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
- tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
- tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
- tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
- tdav_codec_id_gsm = tmedia_codec_id_gsm,
- tdav_codec_id_pcma = tmedia_codec_id_pcma,
- tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
- tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
- tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
- tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
- tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
- tdav_codec_id_bv16 = tmedia_codec_id_bv16,
- tdav_codec_id_bv32 = tmedia_codec_id_bv32,
- tdav_codec_id_opus = tmedia_codec_id_opus,
- tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
- tdav_codec_id_g722 = tmedia_codec_id_g722,
-
- tdav_codec_id_h261 = tmedia_codec_id_h261,
- tdav_codec_id_h263 = tmedia_codec_id_h263,
- tdav_codec_id_h263p = tmedia_codec_id_h263p,
- tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
- tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
- tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
- tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
- tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
- tdav_codec_id_theora = tmedia_codec_id_theora,
- tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
- tdav_codec_id_vp8 = tmedia_codec_id_vp8,
-
- tdav_codec_id_t140 = tmedia_codec_id_t140,
+namespace BackEnd
+{
+public enum class rtConstants
+{
+ rt_tsip_event_code_dialog_transport_error = tsip_event_code_dialog_transport_error,
+ rt_tsip_event_code_dialog_global_error = tsip_event_code_dialog_global_error,
+ rt_tsip_event_code_dialog_message_error = tsip_event_code_dialog_message_error,
+
+ // 8xx ==> success
+ rt_tsip_event_code_dialog_request_incoming = tsip_event_code_dialog_request_incoming,
+ rt_tsip_event_code_dialog_request_outgoing = tsip_event_code_dialog_request_outgoing,
+ rt_tsip_event_code_dialog_request_cancelled = tsip_event_code_dialog_request_cancelled,
+ rt_tsip_event_code_dialog_request_sent = tsip_event_code_dialog_request_sent,
+
+ // 9xx ==> Informational
+ rt_tsip_event_code_dialog_connecting = tsip_event_code_dialog_connecting,
+ rt_tsip_event_code_dialog_connected = tsip_event_code_dialog_connected,
+ rt_tsip_event_code_dialog_terminating = tsip_event_code_dialog_terminating,
+ rt_tsip_event_code_dialog_terminated = tsip_event_code_dialog_terminated,
+ rt_tsip_event_code_stack_starting = tsip_event_code_stack_starting,
+ rt_tsip_event_code_stack_started = tsip_event_code_stack_started,
+ rt_tsip_event_code_stack_stopping = tsip_event_code_stack_stopping,
+ rt_tsip_event_code_stack_stopped = tsip_event_code_stack_stopped,
+ rt_tsip_event_code_stack_failed_to_start = tsip_event_code_stack_failed_to_start,
+ rt_tsip_event_code_stack_failed_to_stop = tsip_event_code_stack_failed_to_stop
+};
+
+public enum class rt_twrap_media_type_t
+{
+ twrap_media_none = twrap_media_none,
+
+ twrap_media_audio = twrap_media_audio,
+ twrap_media_video = twrap_media_video,
+ twrap_media_msrp = twrap_media_msrp,
+ twrap_media_t140 = twrap_media_t140,
+ twrap_media_bfcp = twrap_media_bfcp,
+ twrap_media_bfcp_audio = twrap_media_bfcp_audio,
+ twrap_media_bfcp_video = twrap_media_bfcp_video,
+
+ twrap_media_audiovideo = twrap_media_audiovideo, /* @deprecated */
+ twrap_media_audio_video = twrap_media_audio_video,
+};
+
+public enum class rt_tmedia_bandwidth_level_t
+{
+ tmedia_bl_low = tmedia_bl_low,
+ tmedia_bl_medium = tmedia_bl_medium,
+ tmedia_bl_hight = tmedia_bl_hight,
+ tmedia_bl_unrestricted = tmedia_bl_unrestricted
+};
+
+public enum class rt_tmedia_pref_video_size_t
+{
+ /* must be sorted like this */
+ tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
+ tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
+ tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
+ tmedia_pref_video_size_cif = tmedia_pref_video_size_cif, // 352 x 288
+ tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
+ tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
+ tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
+ tmedia_pref_video_size_wvga = tmedia_pref_video_size_wvga, // 800 x 480
+ tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
+ tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
+ tmedia_pref_video_size_xga = tmedia_pref_video_size_xga, // 1024 x 768
+ tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
+ tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
+ tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
+};
+
+public enum class rt_tmedia_profile_t
+{
+ tmedia_profile_default = tmedia_profile_default,
+ tmedia_profile_rtcweb = tmedia_profile_rtcweb
+};
+
+public enum class rt_tmedia_qos_strength_t
+{
+ tmedia_qos_strength_none = tmedia_qos_strength_none,
+ tmedia_qos_strength_failure = tmedia_qos_strength_failure,
+ tmedia_qos_strength_unknown = tmedia_qos_strength_unknown,
+ tmedia_qos_strength_optional = tmedia_qos_strength_optional,
+ tmedia_qos_strength_mandatory = tmedia_qos_strength_mandatory
+};
+
+public enum class rt_tmedia_qos_stype_t
+{
+ tmedia_qos_stype_none = tmedia_qos_stype_none,
+
+ tmedia_qos_stype_segmented = tmedia_qos_stype_segmented,
+ tmedia_qos_stype_e2e = tmedia_qos_stype_e2e,
+};
+
+public enum class rt_tmedia_srtp_mode_t
+{
+ tmedia_srtp_mode_none = tmedia_srtp_mode_none,
+ tmedia_srtp_mode_optional = tmedia_srtp_mode_optional,
+ tmedia_srtp_mode_mandatory = tmedia_srtp_mode_mandatory
+};
+
+public enum class rt_tmedia_srtp_type_t
+{
+ tmedia_srtp_type_none = tmedia_srtp_type_none,
+ tmedia_srtp_type_sdes = tmedia_srtp_type_sdes,
+ tmedia_srtp_type_dtls = tmedia_srtp_type_dtls,
+ tmedia_srtp_type_sdes_dtls = tmedia_srtp_type_sdes_dtls
+};
+
+public enum class rt_tmedia_t140_data_type_t
+{
+ tmedia_t140_data_type_utf8 = tmedia_t140_data_type_utf8,
+ tmedia_t140_data_type_zero_width_no_break_space = tmedia_t140_data_type_zero_width_no_break_space,
+ tmedia_t140_data_type_backspace = tmedia_t140_data_type_backspace,
+ tmedia_t140_data_type_esc = tmedia_t140_data_type_esc,
+ tmedia_t140_data_type_cr = tmedia_t140_data_type_cr,
+ tmedia_t140_data_type_lf = tmedia_t140_data_type_lf,
+ tmedia_t140_data_type_cr_lf = tmedia_t140_data_type_cr_lf,
+ tmedia_t140_data_type_bell = tmedia_t140_data_type_bell,
+ tmedia_t140_data_type_sos = tmedia_t140_data_type_sos,
+ tmedia_t140_data_type_string_term = tmedia_t140_data_type_string_term,
+ tmedia_t140_data_type_graphic_start = tmedia_t140_data_type_graphic_start,
+ tmedia_t140_data_type_graphic_end = tmedia_t140_data_type_graphic_end,
+ tmedia_t140_data_type_loss_char_char = tmedia_t140_data_type_loss_char_char,
+ tmedia_t140_data_type_loss_utf8 = tmedia_t140_data_type_loss_utf8,
+};
+
+public enum class rt_tmedia_type_t
+{
+ tmedia_none = tmedia_none,
+ tmedia_ghost = tmedia_ghost,
+
+ tmedia_audio = tmedia_audio,
+ tmedia_video = tmedia_video,
+ tmedia_chat = tmedia_chat,
+ tmedia_file = tmedia_file,
+ tmedia_t38 = tmedia_t38,
+ tmedia_t140 = tmedia_t140,
+
+ tmedia_msrp = tmedia_msrp,
+ tmedia_audiovideo = tmedia_audiovideo,
+
+ tmedia_all = tmedia_all
+};
+
+public enum class rt_tmsrp_event_type_t
+{
+ tmsrp_event_type_none = tmsrp_event_type_none,
+ tmsrp_event_type_connected = tmsrp_event_type_connected,
+ tmsrp_event_type_disconnected = tmsrp_event_type_disconnected,
+ tmsrp_event_type_message = tmsrp_event_type_message,
+};
+
+public enum class rt_tmsrp_request_type_t
+{
+ tmsrp_NONE = tmsrp_NONE,
+
+ tmsrp_SEND = tmsrp_SEND,
+ tmsrp_REPORT = tmsrp_REPORT,
+ tmsrp_AUTH = tmsrp_AUTH
+};
+
+public enum class rt_tsip_info_event_type_t
+{
+ tsip_i_info = tsip_i_info,
+ tsip_ao_info = tsip_ao_info,
+};
+
+public enum class rt_tsip_invite_event_type_t
+{
+ tsip_i_newcall = tsip_i_newcall,
+
+ tsip_i_request = tsip_i_request,
+ tsip_ao_request = tsip_ao_request,
+
+ tsip_o_ect_trying = tsip_o_ect_trying,
+ tsip_o_ect_accepted = tsip_o_ect_accepted,
+ tsip_o_ect_completed = tsip_o_ect_completed,
+ tsip_o_ect_failed = tsip_o_ect_failed,
+ tsip_o_ect_notify = tsip_o_ect_notify,
+ tsip_i_ect_requested = tsip_i_ect_requested,
+ tsip_i_ect_newcall = tsip_i_ect_newcall,
+ tsip_i_ect_completed = tsip_i_ect_completed,
+ tsip_i_ect_failed = tsip_i_ect_failed,
+ tsip_i_ect_notify = tsip_i_ect_notify,
+
+ tsip_m_early_media = tsip_m_early_media,
+ tsip_m_updating = tsip_m_updating,
+ tsip_m_updated = tsip_m_updated,
+
+ tsip_m_local_hold_ok = tsip_m_local_hold_ok,
+ tsip_m_local_hold_nok = tsip_m_local_hold_nok,
+ tsip_m_local_resume_ok = tsip_m_local_resume_ok,
+ tsip_m_local_resume_nok = tsip_m_local_resume_nok,
+ tsip_m_remote_hold = tsip_m_remote_hold,
+ tsip_m_remote_resume = tsip_m_remote_resume,
+};
+
+public enum class rt_tsip_message_event_type_t
+{
+ tsip_i_message = tsip_i_message,
+ tsip_ao_message = tsip_ao_message,
+};
+
+public enum class rt_tsip_options_event_type_t
+{
+ tsip_i_options = tsip_i_options,
+ tsip_ao_options = tsip_ao_options,
+};
+
+public enum class rt_tsip_publish_event_type_t
+{
+ tsip_i_publish = tsip_i_publish,
+ tsip_ao_publish = tsip_ao_publish,
+
+ tsip_i_unpublish = tsip_i_unpublish,
+ tsip_ao_unpublish = tsip_ao_unpublish
+};
+
+public enum class rt_tsip_register_event_type_t
+{
+ tsip_i_newreg = tsip_i_newreg,
+
+ tsip_i_register = tsip_i_register,
+ tsip_ao_register = tsip_ao_register,
+
+ tsip_i_unregister = tsip_i_unregister,
+ tsip_ao_unregister = tsip_ao_unregister,
+};
+
+public enum class rt_tsip_request_type_t
+{
+ tsip_NONE = tsip_NONE,
+
+ tsip_ACK = tsip_ACK,
+ tsip_BYE = tsip_BYE,
+ tsip_CANCEL = tsip_CANCEL,
+ tsip_INVITE = tsip_INVITE,
+ tsip_OPTIONS = tsip_OPTIONS,
+ tsip_REGISTER = tsip_REGISTER,
+ tsip_SUBSCRIBE = tsip_SUBSCRIBE,
+ tsip_NOTIFY = tsip_NOTIFY,
+ tsip_REFER = tsip_REFER,
+ tsip_INFO = tsip_INFO,
+ tsip_UPDATE = tsip_UPDATE,
+ tsip_MESSAGE = tsip_MESSAGE,
+ tsip_PUBLISH = tsip_PUBLISH,
+ tsip_PRACK = tsip_PRACK
+};
+
+public enum class rt_tsip_subscribe_event_type_t
+{
+ tsip_i_subscribe = tsip_i_subscribe,
+ tsip_ao_subscribe = tsip_ao_subscribe,
+
+ tsip_i_unsubscribe = tsip_i_unsubscribe,
+ tsip_ao_unsubscribe = tsip_ao_unsubscribe,
+
+ tsip_i_notify = tsip_i_notify,
+ tsip_ao_notify = tsip_ao_notify
+};
+
+public enum class rt_tdav_codec_id_t
+{
+ tdav_codec_id_none = tmedia_codec_id_none,
+
+ tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
+ tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
+ tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
+ tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
+ tdav_codec_id_gsm = tmedia_codec_id_gsm,
+ tdav_codec_id_pcma = tmedia_codec_id_pcma,
+ tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
+ tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
+ tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
+ tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
+ tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
+ tdav_codec_id_bv16 = tmedia_codec_id_bv16,
+ tdav_codec_id_bv32 = tmedia_codec_id_bv32,
+ tdav_codec_id_opus = tmedia_codec_id_opus,
+ tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
+ tdav_codec_id_g722 = tmedia_codec_id_g722,
+
+ tdav_codec_id_h261 = tmedia_codec_id_h261,
+ tdav_codec_id_h263 = tmedia_codec_id_h263,
+ tdav_codec_id_h263p = tmedia_codec_id_h263p,
+ tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
+ tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
+ tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
+ tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
+ tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
+ tdav_codec_id_theora = tmedia_codec_id_theora,
+ tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
+ tdav_codec_id_vp8 = tmedia_codec_id_vp8,
+
+ tdav_codec_id_t140 = tmedia_codec_id_t140,
#if !COM_VISIBLE
- tdav_codec_id_red = tmedia_codec_id_red,
+ tdav_codec_id_red = tmedia_codec_id_red,
#endif
- tdav_codec_id_all = tmedia_codec_id_all,
- };
- }
+ tdav_codec_id_all = tmedia_codec_id_all,
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_MediaContent.h b/bindings/winrt/doubango_rt/include/rt_MediaContent.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_MediaContent.h
+++ b/bindings/winrt/doubango_rt/include/rt_MediaContent.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h b/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
index 3878667..aeb0337 100755
--- a/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
+++ b/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,106 +25,106 @@ struct tmedia_session_mgr_s;
namespace doubango_rt
{
- namespace BackEnd
- {
- enum class rt_twrap_media_type_t;
- enum class rt_tmedia_profile_t;
- enum class rt_tmedia_srtp_mode_t;
- enum class rt_tmedia_srtp_type_t;
- enum class rt_tmedia_profile_t;
- enum class rt_tmedia_pref_video_size_t;
+namespace BackEnd
+{
+enum class rt_twrap_media_type_t;
+enum class rt_tmedia_profile_t;
+enum class rt_tmedia_srtp_mode_t;
+enum class rt_tmedia_srtp_type_t;
+enum class rt_tmedia_profile_t;
+enum class rt_tmedia_pref_video_size_t;
- public ref class rtCodec sealed
- {
- internal:
- rtCodec(struct tmedia_codec_s* pCodec);
- public:
- virtual ~rtCodec();
- enum class rt_twrap_media_type_t getMediaType();
- Platform::String^ getName();
- Platform::String^ getDescription();
- Platform::String^ getNegFormat();
- int getAudioSamplingRate();
- int getAudioChannels();
- int getAudioPTime();
+public ref class rtCodec sealed
+{
+internal:
+ rtCodec(struct tmedia_codec_s* pCodec);
+public:
+ virtual ~rtCodec();
+ enum class rt_twrap_media_type_t getMediaType();
+ Platform::String^ getName();
+ Platform::String^ getDescription();
+ Platform::String^ getNegFormat();
+ int getAudioSamplingRate();
+ int getAudioChannels();
+ int getAudioPTime();
+
+private:
+ Codec* m_pCodec;
+};
- private:
- Codec* m_pCodec;
- };
+public ref class rtMediaSessionMgr sealed
+{
+internal:
+ rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
- public ref class rtMediaSessionMgr sealed
- {
- internal:
- rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
+public:
+ virtual ~rtMediaSessionMgr();
+ bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
- public:
- virtual ~rtMediaSessionMgr();
- bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
+ bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
- bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
+ bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
+ rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
- bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
- rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
+ static unsigned int registerAudioPluginFromFile(Platform::String^ path);
- static unsigned int registerAudioPluginFromFile(Platform::String^ path);
+ uint64 getSessionId(rt_twrap_media_type_t media);
- uint64 getSessionId(rt_twrap_media_type_t media);
-
- internal: // Must be from SIP service to share same global memory space
- static bool defaultsSetProfile(rt_tmedia_profile_t profile);
- static rt_tmedia_profile_t defaultsGetProfile();
- static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
- static bool defaultsSetJbMargin(uint32 jb_margin_ms);
- static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
- static bool defaultsSetEchoTail(uint32 echo_tail);
- static uint32 defaultsGetEchoTail();
- static bool defaultsSetEchoSkew(uint32 echo_skew);
- static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
- static bool defaultsGetEchoSuppEnabled();
- static bool defaultsSetAgcEnabled(bool agc_enabled);
- static bool defaultsGetAgcEnabled();
- static bool defaultsSetAgcLevel(float agc_level);
- static float defaultsGetAgcLevel();
- static bool defaultsSetVadEnabled(bool vad_enabled);
- static bool defaultsGetGetVadEnabled();
- static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
- static bool defaultsGetNoiseSuppEnabled();
- static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
- static int32 defaultsGetNoiseSuppLevel();
- static bool defaultsSet100relEnabled(bool _100rel_enabled);
- static bool defaultsGet100relEnabled();
- static bool defaultsSetScreenSize(int32 sx, int32 sy);
- static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
- static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
- static bool defaultsSetRtpSymetricEnabled(bool enabled);
- static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
- static bool defaultsSetVolume(int32 volume);
- static int32 defaultsGetVolume();
- static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
- static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
- static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
- static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
- static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
- static bool defaultsSetRtcpEnabled(bool enabled);
- static bool defaultsGetRtcpEnabled();
- static bool defaultsSetRtcpMuxEnabled(bool enabled);
- static bool defaultsGetRtcpMuxEnabled();
- static bool defaultsSetIceEnabled(bool ice_enabled);
- static bool defaultsSetByPassEncoding(bool enabled);
- static bool defaultsGetByPassEncoding();
- static bool defaultsSetByPassDecoding(bool enabled);
- static bool defaultsGetByPassDecoding();
- static bool defaultsSetVideoJbEnabled(bool enabled);
- static bool defaultsGetVideoJbEnabled();
- static bool defaultsSetRtpBuffSize(unsigned buffSize);
- static unsigned defaultsGetRtpBuffSize();
- static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
+internal: // Must be from SIP service to share same global memory space
+ static bool defaultsSetProfile(rt_tmedia_profile_t profile);
+ static rt_tmedia_profile_t defaultsGetProfile();
+ static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
+ static bool defaultsSetJbMargin(uint32 jb_margin_ms);
+ static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
+ static bool defaultsSetEchoTail(uint32 echo_tail);
+ static uint32 defaultsGetEchoTail();
+ static bool defaultsSetEchoSkew(uint32 echo_skew);
+ static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
+ static bool defaultsGetEchoSuppEnabled();
+ static bool defaultsSetAgcEnabled(bool agc_enabled);
+ static bool defaultsGetAgcEnabled();
+ static bool defaultsSetAgcLevel(float agc_level);
+ static float defaultsGetAgcLevel();
+ static bool defaultsSetVadEnabled(bool vad_enabled);
+ static bool defaultsGetGetVadEnabled();
+ static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
+ static bool defaultsGetNoiseSuppEnabled();
+ static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
+ static int32 defaultsGetNoiseSuppLevel();
+ static bool defaultsSet100relEnabled(bool _100rel_enabled);
+ static bool defaultsGet100relEnabled();
+ static bool defaultsSetScreenSize(int32 sx, int32 sy);
+ static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
+ static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
+ static bool defaultsSetRtpSymetricEnabled(bool enabled);
+ static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
+ static bool defaultsSetVolume(int32 volume);
+ static int32 defaultsGetVolume();
+ static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
+ static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
+ static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
+ static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
+ static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
+ static bool defaultsSetRtcpEnabled(bool enabled);
+ static bool defaultsGetRtcpEnabled();
+ static bool defaultsSetRtcpMuxEnabled(bool enabled);
+ static bool defaultsGetRtcpMuxEnabled();
+ static bool defaultsSetIceEnabled(bool ice_enabled);
+ static bool defaultsSetByPassEncoding(bool enabled);
+ static bool defaultsGetByPassEncoding();
+ static bool defaultsSetByPassDecoding(bool enabled);
+ static bool defaultsGetByPassDecoding();
+ static bool defaultsSetVideoJbEnabled(bool enabled);
+ static bool defaultsGetVideoJbEnabled();
+ static bool defaultsSetRtpBuffSize(unsigned buffSize);
+ static unsigned defaultsGetRtpBuffSize();
+ static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
- private:
- MediaSessionMgr* m_pMediaSessionMgr;
- };
- }
+private:
+ MediaSessionMgr* m_pMediaSessionMgr;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Msrp.h b/bindings/winrt/doubango_rt/include/rt_Msrp.h
index b0fbe26..399f3b0 100755
--- a/bindings/winrt/doubango_rt/include/rt_Msrp.h
+++ b/bindings/winrt/doubango_rt/include/rt_Msrp.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,85 +25,96 @@ class MsrpEvent;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtMsrpSession;
+namespace BackEnd
+{
+ref class rtMsrpSession;
- public ref class rtMsrpByteRange sealed
- {
- internal:
- rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total){}
- public:
- property int64 Start{ int64 get() { return _start; }; }
- property int64 End{ int64 get() { return _end; }; }
- property int64 Total{ int64 get() { return _total; }; }
- private:
- int64 _start, _end, _total;
- };
+public ref class rtMsrpByteRange sealed
+{
+internal:
+ rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total) {}
+public:
+ property int64 Start { int64 get() {
+ return _start;
+ };
+ }
+ property int64 End { int64 get() {
+ return _end;
+ };
+ }
+ property int64 Total { int64 get() {
+ return _total;
+ };
+ }
+private:
+ int64 _start, _end, _total;
+};
- public ref class rtMsrpMessage sealed
- {
- public:
- virtual ~rtMsrpMessage();
- internal:
- rtMsrpMessage(struct tmsrp_message_s *message);
+public ref class rtMsrpMessage sealed
+{
+public:
+ virtual ~rtMsrpMessage();
+internal:
+ rtMsrpMessage(struct tmsrp_message_s *message);
- public:
- bool isRequest();
- short getCode();
- Platform::String^ getPhrase();
- rt_tmsrp_request_type_t getRequestType();
+public:
+ bool isRequest();
+ short getCode();
+ Platform::String^ getPhrase();
+ rt_tmsrp_request_type_t getRequestType();
#if COM_VISIBLE
- rtMsrpByteRange^ getByteRange();
+ rtMsrpByteRange^ getByteRange();
#else
- void getByteRange(Platform::IntPtr start, Platform::IntPtr end, Platform::IntPtr total);
+ void getByteRange(Platform::IntPtr start, Platform::IntPtr end, Platform::IntPtr total);
#endif
- bool isLastChunck();
- bool isFirstChunck();
- bool isSuccessReport();
- Platform::String^ getMsrpHeaderValue(Platform::String^ name);
- Platform::String^ getMsrpHeaderParamValue(Platform::String^ name, Platform::String^ param);
- unsigned getMsrpContentLength();
+ bool isLastChunck();
+ bool isFirstChunck();
+ bool isSuccessReport();
+ Platform::String^ getMsrpHeaderValue(Platform::String^ name);
+ Platform::String^ getMsrpHeaderParamValue(Platform::String^ name, Platform::String^ param);
+ unsigned getMsrpContentLength();
#if COM_VISIBLE
- Platform::String^ getMsrpContent(unsigned maxsize);
+ Platform::String^ getMsrpContent(unsigned maxsize);
#else
- unsigned getMsrpContent(Platform::IntPtr output, unsigned maxsize);
+ unsigned getMsrpContent(Platform::IntPtr output, unsigned maxsize);
#endif
- private:
- MsrpMessage* m_pMsrpMessage;
- };
+private:
+ MsrpMessage* m_pMsrpMessage;
+};
- public ref class rtMsrpEvent sealed
- {
- internal:
- rtMsrpEvent(const struct tmsrp_event_s *event);
- public:
- virtual ~rtMsrpEvent();
+public ref class rtMsrpEvent sealed
+{
+internal:
+ rtMsrpEvent(const struct tmsrp_event_s *event);
+public:
+ virtual ~rtMsrpEvent();
- rt_tmsrp_event_type_t getType();
- rtMsrpSession^ getSipSession();
- rtMsrpMessage^ getMessage();
+ rt_tmsrp_event_type_t getType();
+ rtMsrpSession^ getSipSession();
+ rtMsrpMessage^ getMessage();
- private:
- MsrpEvent* m_pMsrpEvent;
- };
+private:
+ MsrpEvent* m_pMsrpEvent;
+};
- public interface class rtIMsrpCallback
- {
- virtual int OnEvent(rtMsrpEvent^ pEvent);
- };
- public ref class rtMsrpCallback sealed
- {
- internal:
- rtMsrpCallback(rtIMsrpCallback^ pI);
- const MsrpCallback* getWrappedCallback(){ return m_pCallback; }
- public:
- virtual ~rtMsrpCallback();
+public interface class rtIMsrpCallback
+{
+ virtual int OnEvent(rtMsrpEvent^ pEvent);
+};
+public ref class rtMsrpCallback sealed
+{
+internal:
+ rtMsrpCallback(rtIMsrpCallback^ pI);
+ const MsrpCallback* getWrappedCallback() {
+ return m_pCallback;
+ }
+public:
+ virtual ~rtMsrpCallback();
- private:
- MsrpCallback* m_pCallback;
- rtIMsrpCallback^ m_pI;
- };
- }
+private:
+ MsrpCallback* m_pCallback;
+ rtIMsrpCallback^ m_pI;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h b/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
+++ b/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/bindings/winrt/doubango_rt/include/rt_SipCallback.h b/bindings/winrt/doubango_rt/include/rt_SipCallback.h
index 1f0a9e0..ecd1d54 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipCallback.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipCallback.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -22,49 +22,49 @@ class SipCallbackProxy;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtDialogEvent;
- ref class rtStackEvent;
+namespace BackEnd
+{
+ref class rtDialogEvent;
+ref class rtStackEvent;
- ref class rtInviteEvent;
- ref class rtMessagingEvent;
- ref class rtInfoEvent;
- ref class rtOptionsEvent;
- ref class rtPublicationEvent;
- ref class rtRegistrationEvent;
- ref class rtSubscriptionEvent;
+ref class rtInviteEvent;
+ref class rtMessagingEvent;
+ref class rtInfoEvent;
+ref class rtOptionsEvent;
+ref class rtPublicationEvent;
+ref class rtRegistrationEvent;
+ref class rtSubscriptionEvent;
- public interface class rtISipCallback
- {
- virtual int OnDialogEvent(rtDialogEvent^ e);
- virtual int OnStackEvent(rtStackEvent^ e);
+public interface class rtISipCallback
+{
+ virtual int OnDialogEvent(rtDialogEvent^ e);
+ virtual int OnStackEvent(rtStackEvent^ e);
+
+ virtual int OnInviteEvent(rtInviteEvent^ e);
+ virtual int OnMessagingEvent(rtMessagingEvent^ e);
+ virtual int OnInfoEvent(rtInfoEvent^ e);
+ virtual int OnOptionsEvent(rtOptionsEvent^ e);
+ virtual int OnPublicationEvent(rtPublicationEvent^ e);
+ virtual int OnRegistrationEvent(rtRegistrationEvent^ e);
+ virtual int OnSubscriptionEvent(rtSubscriptionEvent^ e);
+};
- virtual int OnInviteEvent(rtInviteEvent^ e);
- virtual int OnMessagingEvent(rtMessagingEvent^ e);
- virtual int OnInfoEvent(rtInfoEvent^ e);
- virtual int OnOptionsEvent(rtOptionsEvent^ e);
- virtual int OnPublicationEvent(rtPublicationEvent^ e);
- virtual int OnRegistrationEvent(rtRegistrationEvent^ e);
- virtual int OnSubscriptionEvent(rtSubscriptionEvent^ e);
- };
+public ref class rtSipCallback sealed
+{
+internal:
+ rtSipCallback(rtISipCallback^ pI);
+public:
+ virtual ~rtSipCallback();
+ friend class SipCallbackProxy;
- public ref class rtSipCallback sealed
- {
- internal:
- rtSipCallback(rtISipCallback^ pI);
- public:
- virtual ~rtSipCallback();
- friend class SipCallbackProxy;
-
- internal:
- const SipCallback* getWrappedCallback();
+internal:
+ const SipCallback* getWrappedCallback();
- private:
- rtISipCallback^ m_pI;
- SipCallbackProxy* m_pCallback;
- };
- }
+private:
+ rtISipCallback^ m_pI;
+ SipCallbackProxy* m_pCallback;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipEvent.h b/bindings/winrt/doubango_rt/include/rt_SipEvent.h
index e615bde..f337262 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipEvent.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipEvent.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -39,7 +39,7 @@ class SubscriptionEvent;
virtual Platform::String^ getPhrase(); \
virtual rtISipSession^ getBaseSession(); \
virtual rtSipMessage^ getSipMessage(); \
-
+
#define rtISipEvent_Implement(cls) \
short cls##::getCode(){ \
return m_pEvent->getCode(); \
@@ -53,192 +53,192 @@ rtISipSession^ cls##::getBaseSession(){ \
rtSipMessage^ cls##::getSipMessage(){ \
return ref new rtSipMessage(const_cast<struct tsip_message_s*>(const_cast<SipMessage*>(m_pEvent->getSipMessage())->getWrappedSipMessage())); \
} \
-
+
namespace doubango_rt
{
- namespace BackEnd
- {
- interface class rtISipSession;
- ref class rtSipMessage;
- ref class rtInviteSession;
- ref class rtMsrpSession;
- ref class rtCallSession;
- ref class rtMessagingSession;
- ref class rtInfoSession;
- ref class rtOptionsSession;
- ref class rtPublicationSession;
- ref class rtRegistrationSession;
- ref class rtSubscriptionSession;
-
-
- /* ======================== rtISipEvent ========================*/
- public interface class rtISipEvent
- {
- short getCode();
- Platform::String^ getPhrase();
- rtISipSession^ getBaseSession();
- rtSipMessage^ getSipMessage();
- };
-
-
- /* ======================== rtDialogEvent ========================*/
- public ref class rtDialogEvent sealed : rtISipEvent
- {
- internal:
- rtDialogEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtDialogEvent();
- rtISipEvent_Declare();
-
- private:
- DialogEvent* m_pEvent;
- };
-
- /* ======================== rtStackEvent ========================*/
- public ref class rtStackEvent sealed : rtISipEvent
- {
- internal:
- rtStackEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtStackEvent();
- rtISipEvent_Declare();
-
- private:
- StackEvent* m_pEvent;
- };
-
-
- /* ======================== rtInviteEvent ========================*/
- public ref class rtInviteEvent sealed : rtISipEvent
- {
- internal:
- rtInviteEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtInviteEvent();
- rtISipEvent_Declare();
-
- rt_tsip_invite_event_type_t getType();
- rt_twrap_media_type_t getMediaType();
- rtInviteSession^ getSession();
- rtCallSession^ takeCallSessionOwnership();
- rtMsrpSession^ takeMsrpSessionOwnership();
-
- private:
- InviteEvent* m_pEvent;
- };
-
- /* ======================== rtMessagingEvent ========================*/
- public ref class rtMessagingEvent sealed : rtISipEvent
- {
- internal:
- rtMessagingEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtMessagingEvent();
- rtISipEvent_Declare();
-
- rt_tsip_message_event_type_t getType();
- rtMessagingSession^ getSession();
- rtMessagingSession^ takeSessionOwnership();
-
- private:
- MessagingEvent* m_pEvent;
- };
-
-
- /* ======================== rtInfoEvent ========================*/
- public ref class rtInfoEvent sealed : rtISipEvent
- {
- internal:
- rtInfoEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtInfoEvent();
- rtISipEvent_Declare();
-
- rt_tsip_info_event_type_t getType();
- rtInfoSession^ getSession();
- rtInfoSession^ takeSessionOwnership();
-
- private:
- InfoEvent* m_pEvent;
- };
-
-
- /* ======================== rtOptionsEvent ========================*/
- public ref class rtOptionsEvent sealed : rtISipEvent
- {
- internal:
- rtOptionsEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtOptionsEvent();
- rtISipEvent_Declare();
-
- rt_tsip_options_event_type_t getType();
- rtOptionsSession^ getSession();
- rtOptionsSession^ takeSessionOwnership();
-
- private:
- OptionsEvent* m_pEvent;
- };
-
- /* ======================== rtPublicationEvent ========================*/
- public ref class rtPublicationEvent sealed : rtISipEvent
- {
- internal:
- rtPublicationEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtPublicationEvent();
- rtISipEvent_Declare();
-
- rt_tsip_publish_event_type_t getType();
- rtPublicationSession^ getSession();
- rtPublicationSession^ takeSessionOwnership();
-
- private:
- PublicationEvent* m_pEvent;
- };
-
- /* ======================== rtRegistrationEvent ========================*/
- public ref class rtRegistrationEvent sealed : rtISipEvent
- {
- internal:
- rtRegistrationEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtRegistrationEvent();
- rtISipEvent_Declare();
-
- rt_tsip_register_event_type_t getType();
- rtRegistrationSession^ getSession();
- rtRegistrationSession^ takeSessionOwnership();
-
- private:
- RegistrationEvent* m_pEvent;
- };
-
- /* ======================== rtSubscriptionEvent ========================*/
- public ref class rtSubscriptionEvent sealed : rtISipEvent
- {
- internal:
- rtSubscriptionEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtSubscriptionEvent();
- rtISipEvent_Declare();
-
- rt_tsip_subscribe_event_type_t getType();
- rtSubscriptionSession^ getSession();
- rtSubscriptionSession^ takeSessionOwnership();
-
- private:
- SubscriptionEvent* m_pEvent;
- };
- }
+namespace BackEnd
+{
+interface class rtISipSession;
+ref class rtSipMessage;
+ref class rtInviteSession;
+ref class rtMsrpSession;
+ref class rtCallSession;
+ref class rtMessagingSession;
+ref class rtInfoSession;
+ref class rtOptionsSession;
+ref class rtPublicationSession;
+ref class rtRegistrationSession;
+ref class rtSubscriptionSession;
+
+
+/* ======================== rtISipEvent ========================*/
+public interface class rtISipEvent
+{
+ short getCode();
+ Platform::String^ getPhrase();
+ rtISipSession^ getBaseSession();
+ rtSipMessage^ getSipMessage();
+};
+
+
+/* ======================== rtDialogEvent ========================*/
+public ref class rtDialogEvent sealed : rtISipEvent
+{
+internal:
+ rtDialogEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtDialogEvent();
+ rtISipEvent_Declare();
+
+private:
+ DialogEvent* m_pEvent;
+};
+
+/* ======================== rtStackEvent ========================*/
+public ref class rtStackEvent sealed : rtISipEvent
+{
+internal:
+ rtStackEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtStackEvent();
+ rtISipEvent_Declare();
+
+private:
+ StackEvent* m_pEvent;
+};
+
+
+/* ======================== rtInviteEvent ========================*/
+public ref class rtInviteEvent sealed : rtISipEvent
+{
+internal:
+ rtInviteEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtInviteEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_invite_event_type_t getType();
+ rt_twrap_media_type_t getMediaType();
+ rtInviteSession^ getSession();
+ rtCallSession^ takeCallSessionOwnership();
+ rtMsrpSession^ takeMsrpSessionOwnership();
+
+private:
+ InviteEvent* m_pEvent;
+};
+
+/* ======================== rtMessagingEvent ========================*/
+public ref class rtMessagingEvent sealed : rtISipEvent
+{
+internal:
+ rtMessagingEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtMessagingEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_message_event_type_t getType();
+ rtMessagingSession^ getSession();
+ rtMessagingSession^ takeSessionOwnership();
+
+private:
+ MessagingEvent* m_pEvent;
+};
+
+
+/* ======================== rtInfoEvent ========================*/
+public ref class rtInfoEvent sealed : rtISipEvent
+{
+internal:
+ rtInfoEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtInfoEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_info_event_type_t getType();
+ rtInfoSession^ getSession();
+ rtInfoSession^ takeSessionOwnership();
+
+private:
+ InfoEvent* m_pEvent;
+};
+
+
+/* ======================== rtOptionsEvent ========================*/
+public ref class rtOptionsEvent sealed : rtISipEvent
+{
+internal:
+ rtOptionsEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtOptionsEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_options_event_type_t getType();
+ rtOptionsSession^ getSession();
+ rtOptionsSession^ takeSessionOwnership();
+
+private:
+ OptionsEvent* m_pEvent;
+};
+
+/* ======================== rtPublicationEvent ========================*/
+public ref class rtPublicationEvent sealed : rtISipEvent
+{
+internal:
+ rtPublicationEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtPublicationEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_publish_event_type_t getType();
+ rtPublicationSession^ getSession();
+ rtPublicationSession^ takeSessionOwnership();
+
+private:
+ PublicationEvent* m_pEvent;
+};
+
+/* ======================== rtRegistrationEvent ========================*/
+public ref class rtRegistrationEvent sealed : rtISipEvent
+{
+internal:
+ rtRegistrationEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtRegistrationEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_register_event_type_t getType();
+ rtRegistrationSession^ getSession();
+ rtRegistrationSession^ takeSessionOwnership();
+
+private:
+ RegistrationEvent* m_pEvent;
+};
+
+/* ======================== rtSubscriptionEvent ========================*/
+public ref class rtSubscriptionEvent sealed : rtISipEvent
+{
+internal:
+ rtSubscriptionEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtSubscriptionEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_subscribe_event_type_t getType();
+ rtSubscriptionSession^ getSession();
+ rtSubscriptionSession^ takeSessionOwnership();
+
+private:
+ SubscriptionEvent* m_pEvent;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SipMessage.h b/bindings/winrt/doubango_rt/include/rt_SipMessage.h
index a61c1c3..2feac91 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipMessage.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipMessage.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,52 +27,52 @@ struct tsip_message_s;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtSdpMessage sealed
- {
- internal:
- rtSdpMessage();
- rtSdpMessage(struct tsdp_message_s *message);
- public:
- virtual ~rtSdpMessage();
+namespace BackEnd
+{
+public ref class rtSdpMessage sealed
+{
+internal:
+ rtSdpMessage();
+ rtSdpMessage(struct tsdp_message_s *message);
+public:
+ virtual ~rtSdpMessage();
- public:
- Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name, unsigned index);
- Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name);
- Platform::String^ getSdpHeaderAValue(Platform::String^ media, Platform::String^ attributeName);
+public:
+ Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name, unsigned index);
+ Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name);
+ Platform::String^ getSdpHeaderAValue(Platform::String^ media, Platform::String^ attributeName);
- private:
- SdpMessage* m_pSdpMessage;
- };
+private:
+ SdpMessage* m_pSdpMessage;
+};
- public ref class rtSipMessage sealed
- {
- internal:
- rtSipMessage();
- rtSipMessage(struct tsip_message_s* message);
- public:
- virtual ~rtSipMessage();
+public ref class rtSipMessage sealed
+{
+internal:
+ rtSipMessage();
+ rtSipMessage(struct tsip_message_s* message);
+public:
+ virtual ~rtSipMessage();
- public:
- bool isResponse();
- rt_tsip_request_type_t getRequestType();
- short getResponseCode();
- Platform::String^ getResponsePhrase();
- Platform::String^ getSipHeaderValue(Platform::String^ name, unsigned index);
- Platform::String^ getSipHeaderValue(Platform::String^ name);
- Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param, unsigned index);
- Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param);
- unsigned getSipContentLength();
+public:
+ bool isResponse();
+ rt_tsip_request_type_t getRequestType();
+ short getResponseCode();
+ Platform::String^ getResponsePhrase();
+ Platform::String^ getSipHeaderValue(Platform::String^ name, unsigned index);
+ Platform::String^ getSipHeaderValue(Platform::String^ name);
+ Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param, unsigned index);
+ Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param);
+ unsigned getSipContentLength();
#if COM_VISIBLE
- Platform::String^ getSipContent();
+ Platform::String^ getSipContent();
#else
- unsigned getSipContent(Platform::IntPtr output, unsigned maxsize);
+ unsigned getSipContent(Platform::IntPtr output, unsigned maxsize);
#endif
- rtSdpMessage^ getSdpMessage();
+ rtSdpMessage^ getSdpMessage();
- private:
- SipMessage* m_pSipMessage;
- };
- }
+private:
+ SipMessage* m_pSipMessage;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipSession.h b/bindings/winrt/doubango_rt/include/rt_SipSession.h
index bf52ba5..73a36dd 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipSession.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipSession.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -61,7 +61,7 @@ class T140Callback;
virtual bool setSilentHangup(bool silent); \
virtual bool addSigCompCompartment(Platform::String^ compId); \
virtual bool removeSigCompCompartment(); \
-
+
#define rtISession_Implement(cls) \
unsigned cls##::getId(){ \
return m_pSipSession->getId(); \
@@ -108,7 +108,7 @@ OVERRIDE_FUNC(bool cls##::setToUri(Platform::String^ toUriString){ \
bool cls##::removeSigCompCompartment(){ \
return m_pSipSession->removeSigCompCompartment(); \
}\
-
+
#define rtIInviteSession_Declare() \
[Windows::Foundation::Metadata::DefaultOverload] \
@@ -124,7 +124,7 @@ OVERRIDE_FUNC(bool cls##::setToUri(Platform::String^ toUriString){ \
virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len, rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len);) \
virtual rtMediaSessionMgr^ getMediaMgr(); \
-
+
#define rtIInviteSession_Implement(cls) \
bool cls##::accept(rtActionConfig^ config){ \
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null); \
@@ -156,355 +156,363 @@ rtMediaSessionMgr^ cls##::getMediaMgr(){ \
} \
return nullptr; \
} \
-
+
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtMsrpCallback;
- interface class rtIMsrpCallback;
-
-
- /* ======================== rtT140CallbackData ========================*/
- public ref class rtT140CallbackData sealed
- {
- internal:
- rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
- public:
- virtual ~rtT140CallbackData();
-
- private:
- T140CallbackData* m_pData;
- };
-
- /* ======================== rtT140Callback ========================*/
- public interface class rtIT140Callback
- {
- virtual int ondata(rtT140CallbackData^ pData);
- };
- public ref class rtT140Callback sealed
- {
- internal:
- rtT140Callback();
- const T140Callback* getWrappedCallback(){ return m_pCallback; }
-
- public:
- rtT140Callback(rtIT140Callback^ pI)
- {
- m_pI = pI;
- }
- virtual ~rtT140Callback();
-
- protected:
- virtual int ondata(rtT140CallbackData^ pData){
- if(m_pI)
- {
- return m_pI->ondata(pData);
- }
- return 0;
- }
-
- private:
- T140Callback* m_pCallback;
- rtIT140Callback^ m_pI;
- };
-
-
- /* ======================== rtISipSession ========================*/
- public interface class rtISipSession
- {
- rtISession_Declare();
- };
-
-
- /* ======================== rtIInviteSession ========================*/
- public interface class rtIInviteSession : rtISipSession
- {
- rtIInviteSession_Declare();
- };
-
- /* ======================== rtSipSession ========================*/
- public ref class rtSipSession sealed: rtISipSession
- {
- public:
- rtSipSession(rtSipStack^ pStack);
- virtual ~rtSipSession();
- internal:
- rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- SipSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
-
- private:
- SipSession* m_pSipSession;
- };
-
- /* ======================== rtInviteSession ========================*/
- public ref class rtInviteSession sealed: rtIInviteSession
- {
- public:
- rtInviteSession(rtSipStack^ pStack);
- virtual ~rtInviteSession();
- internal:
- rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- InviteSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- private:
- InviteSession* m_pSipSession;
- };
-
- /* ======================== CallSession ========================*/
- public ref class rtCallSession sealed : rtIInviteSession
- {
- public:
- rtCallSession(rtSipStack^ pStack);
- virtual ~rtCallSession();
- internal:
- rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- CallSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- [Windows::Foundation::Metadata::DefaultOverload]
- bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media);
- bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config);
- bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media);
-
- bool setSessionTimer(unsigned timeout, Platform::String^ refresher);
- bool set100rel(bool enabled);
- bool setRtcp(bool enabled);
- bool setRtcpMux(bool enabled);
- bool setICE(bool enabled);
- bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
- bool setVideoFps(int32_t fps);
- bool setVideoBandwidthUploadMax(int32_t max);
- bool setVideoBandwidthDownloadMax(int32_t max);
- bool setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size);
- bool hold(rtActionConfig^ config);
- bool hold();
- bool resume(rtActionConfig^ config);
- bool resume();
- bool transfer(Platform::String^ referToUriString, rtActionConfig^ config);
- bool transfer(Platform::String^ referToUriString);
- bool acceptTransfer(rtActionConfig^ config);
- bool acceptTransfer();
- bool rejectTransfer(rtActionConfig^ config);
- bool rejectTransfer();
- bool sendDTMF(int number);
- unsigned getSessionTransferId();
+namespace BackEnd
+{
+ref class rtMsrpCallback;
+interface class rtIMsrpCallback;
+
+
+/* ======================== rtT140CallbackData ========================*/
+public ref class rtT140CallbackData sealed
+{
+internal:
+ rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
+public:
+ virtual ~rtT140CallbackData();
+
+private:
+ T140CallbackData* m_pData;
+};
+
+/* ======================== rtT140Callback ========================*/
+public interface class rtIT140Callback
+{
+ virtual int ondata(rtT140CallbackData^ pData);
+};
+public ref class rtT140Callback sealed
+{
+internal:
+ rtT140Callback();
+ const T140Callback* getWrappedCallback() {
+ return m_pCallback;
+ }
+
+public:
+ rtT140Callback(rtIT140Callback^ pI) {
+ m_pI = pI;
+ }
+ virtual ~rtT140Callback();
+
+protected:
+ virtual int ondata(rtT140CallbackData^ pData) {
+ if(m_pI) {
+ return m_pI->ondata(pData);
+ }
+ return 0;
+ }
+
+private:
+ T140Callback* m_pCallback;
+ rtIT140Callback^ m_pI;
+};
+
+
+/* ======================== rtISipSession ========================*/
+public interface class rtISipSession
+{
+ rtISession_Declare();
+};
+
+
+/* ======================== rtIInviteSession ========================*/
+public interface class rtIInviteSession : rtISipSession
+{
+ rtIInviteSession_Declare();
+};
+
+/* ======================== rtSipSession ========================*/
+public ref class rtSipSession sealed: rtISipSession
+{
+public:
+ rtSipSession(rtSipStack^ pStack);
+ virtual ~rtSipSession();
+internal:
+ rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ SipSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+
+private:
+ SipSession* m_pSipSession;
+};
+
+/* ======================== rtInviteSession ========================*/
+public ref class rtInviteSession sealed: rtIInviteSession
+{
+public:
+ rtInviteSession(rtSipStack^ pStack);
+ virtual ~rtInviteSession();
+internal:
+ rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InviteSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+private:
+ InviteSession* m_pSipSession;
+};
+
+/* ======================== CallSession ========================*/
+public ref class rtCallSession sealed : rtIInviteSession
+{
+public:
+ rtCallSession(rtSipStack^ pStack);
+ virtual ~rtCallSession();
+internal:
+ rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ CallSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media);
+ bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config);
+ bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media);
+
+ bool setSessionTimer(unsigned timeout, Platform::String^ refresher);
+ bool set100rel(bool enabled);
+ bool setRtcp(bool enabled);
+ bool setRtcpMux(bool enabled);
+ bool setICE(bool enabled);
+ bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
+ bool setVideoFps(int32_t fps);
+ bool setVideoBandwidthUploadMax(int32_t max);
+ bool setVideoBandwidthDownloadMax(int32_t max);
+ bool setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size);
+ bool hold(rtActionConfig^ config);
+ bool hold();
+ bool resume(rtActionConfig^ config);
+ bool resume();
+ bool transfer(Platform::String^ referToUriString, rtActionConfig^ config);
+ bool transfer(Platform::String^ referToUriString);
+ bool acceptTransfer(rtActionConfig^ config);
+ bool acceptTransfer();
+ bool rejectTransfer(rtActionConfig^ config);
+ bool rejectTransfer();
+ bool sendDTMF(int number);
+ unsigned getSessionTransferId();
#if COM_VISIBLE
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::String^ data);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::String^ data);
#else
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::IntPtr data_ptr, unsigned data_size);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::IntPtr data_ptr, unsigned data_size);
#endif
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type);
- bool setT140Callback(rtT140Callback^ pT140Callback);
-
- private:
- CallSession* m_pSipSession;
- };
-
-
- /* ======================== rtMsrpSession ========================*/
- public ref class rtMsrpSession sealed : rtIInviteSession
- {
- public:
- rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback);
- virtual ~rtMsrpSession();
-
- internal:
- rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- MsrpSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- bool setCallback(rtIMsrpCallback^ pCallback);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool callMsrp(Platform::String^ remoteUriString);
- bool callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config);
- bool callMsrp(rtSipUri^ remoteUri);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type);
+ bool setT140Callback(rtT140Callback^ pT140Callback);
+
+private:
+ CallSession* m_pSipSession;
+};
+
+
+/* ======================== rtMsrpSession ========================*/
+public ref class rtMsrpSession sealed : rtIInviteSession
+{
+public:
+ rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback);
+ virtual ~rtMsrpSession();
+
+internal:
+ rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MsrpSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+ bool setCallback(rtIMsrpCallback^ pCallback);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool callMsrp(Platform::String^ remoteUriString);
+ bool callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config);
+ bool callMsrp(rtSipUri^ remoteUri);
#if COM_VISIBLE
- bool sendMessage(Platform::String^ payload, rtActionConfig^ config);
- bool sendMessage(Platform::String^ payload);
+ bool sendMessage(Platform::String^ payload, rtActionConfig^ config);
+ bool sendMessage(Platform::String^ payload);
#else
- bool sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool sendMessage(Platform::IntPtr payload, unsigned len);
+ bool sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool sendMessage(Platform::IntPtr payload, unsigned len);
#endif
- private:
- MsrpSession* m_pSipSession;
- rtMsrpCallback^ m_pCallback;
- };
-
- /* ======================== rtMessagingSession ========================*/
- public ref class rtMessagingSession sealed : rtISipSession
- {
- internal:
- rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtMessagingSession(rtSipStack^ pStack);
- virtual ~rtMessagingSession();
-
- rtISession_Declare();
-
+private:
+ MsrpSession* m_pSipSession;
+ rtMsrpCallback^ m_pCallback;
+};
+
+/* ======================== rtMessagingSession ========================*/
+public ref class rtMessagingSession sealed : rtISipSession
+{
+internal:
+ rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtMessagingSession(rtSipStack^ pStack);
+ virtual ~rtMessagingSession();
+
+ rtISession_Declare();
+
#if COM_VISIBLE
- bool send(Platform::String^ payload, rtActionConfig^ config);
- bool send(Platform::String^ payload);
+ bool send(Platform::String^ payload, rtActionConfig^ config);
+ bool send(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool send(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool send(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- MessagingSession* m_pSipSession;
- };
-
-
- /* ======================== rtInfoSession ========================*/
- public ref class rtInfoSession sealed : rtISipSession
- {
- internal:
- rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtInfoSession(rtSipStack^ pStack);
- virtual ~rtInfoSession();
-
- rtISession_Declare();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ MessagingSession* m_pSipSession;
+};
+
+
+/* ======================== rtInfoSession ========================*/
+public ref class rtInfoSession sealed : rtISipSession
+{
+internal:
+ rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtInfoSession(rtSipStack^ pStack);
+ virtual ~rtInfoSession();
+
+ rtISession_Declare();
#if COM_VISIBLE
- bool send(Platform::String^ payload, rtActionConfig^ config);
- bool send(Platform::String^ payload);
+ bool send(Platform::String^ payload, rtActionConfig^ config);
+ bool send(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool send(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool send(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- InfoSession* m_pSipSession;
- };
-
-
- /* ======================== rtOptionsSession ========================*/
- public ref class rtOptionsSession sealed : rtISipSession
- {
- internal:
- rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtOptionsSession(rtSipStack^ pStack);
- virtual ~rtOptionsSession();
-
- rtISession_Declare();
-
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(rtActionConfig^ config);
- bool send();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- OptionsSession* m_pSipSession;
- };
-
-
- /* ======================== rtPublicationSession ========================*/
- public ref class rtPublicationSession sealed : rtISipSession
- {
- internal:
- rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtPublicationSession(rtSipStack^ pStack);
- virtual ~rtPublicationSession();
-
- rtISession_Declare();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ InfoSession* m_pSipSession;
+};
+
+
+/* ======================== rtOptionsSession ========================*/
+public ref class rtOptionsSession sealed : rtISipSession
+{
+internal:
+ rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtOptionsSession(rtSipStack^ pStack);
+ virtual ~rtOptionsSession();
+
+ rtISession_Declare();
+
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(rtActionConfig^ config);
+ bool send();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ OptionsSession* m_pSipSession;
+};
+
+
+/* ======================== rtPublicationSession ========================*/
+public ref class rtPublicationSession sealed : rtISipSession
+{
+internal:
+ rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtPublicationSession(rtSipStack^ pStack);
+ virtual ~rtPublicationSession();
+
+ rtISession_Declare();
#if COM_VISIBLE
- bool publish(Platform::String^ payload, rtActionConfig^ config);
- bool publish(Platform::String^ payload);
+ bool publish(Platform::String^ payload, rtActionConfig^ config);
+ bool publish(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool publish(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool publish(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool unPublish(rtActionConfig^ config);
- bool unPublish();
-
- private:
- PublicationSession* m_pSipSession;
- };
-
-
- /* ======================== rtRegistrationSession ========================*/
- public ref class rtRegistrationSession sealed : rtISipSession
- {
- internal:
- rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtRegistrationSession(rtSipStack^ pStack);
- virtual ~rtRegistrationSession();
-
- rtISession_Declare();
-
- bool register_(rtActionConfig^ config);
- bool register_();
- bool unRegister(rtActionConfig^ config);
- bool unRegister();
- bool accept(rtActionConfig^ config);
- bool accept();
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- RegistrationSession* m_pSipSession;
- };
-
- /* ======================== rtSubscriptionSession ========================*/
- public ref class rtSubscriptionSession sealed : rtISipSession
- {
- internal:
- rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtSubscriptionSession(rtSipStack^ pStack);
- virtual ~rtSubscriptionSession();
-
- rtISession_Declare();
-
- bool subscribe();
- bool unSubscribe();
-
- private:
- SubscriptionSession* m_pSipSession;
- };
- }
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool unPublish(rtActionConfig^ config);
+ bool unPublish();
+
+private:
+ PublicationSession* m_pSipSession;
+};
+
+
+/* ======================== rtRegistrationSession ========================*/
+public ref class rtRegistrationSession sealed : rtISipSession
+{
+internal:
+ rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtRegistrationSession(rtSipStack^ pStack);
+ virtual ~rtRegistrationSession();
+
+ rtISession_Declare();
+
+ bool register_(rtActionConfig^ config);
+ bool register_();
+ bool unRegister(rtActionConfig^ config);
+ bool unRegister();
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ RegistrationSession* m_pSipSession;
+};
+
+/* ======================== rtSubscriptionSession ========================*/
+public ref class rtSubscriptionSession sealed : rtISipSession
+{
+internal:
+ rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtSubscriptionSession(rtSipStack^ pStack);
+ virtual ~rtSubscriptionSession();
+
+ rtISession_Declare();
+
+ bool subscribe();
+ bool unSubscribe();
+
+private:
+ SubscriptionSession* m_pSipSession;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipStack.h b/bindings/winrt/doubango_rt/include/rt_SipStack.h
index b55c5ae..6148420 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipStack.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipStack.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,98 +23,106 @@ class SipStack;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtSipCallback;
- interface class rtISipCallback;
- ref class rtDDebugCallback;
- interface class rtIDDebugCallback;
+namespace BackEnd
+{
+ref class rtSipCallback;
+interface class rtISipCallback;
+ref class rtDDebugCallback;
+interface class rtIDDebugCallback;
- enum class rt_tdav_codec_id_t;
+enum class rt_tdav_codec_id_t;
- public ref class rtDnsResult sealed
- {
- internal:
- rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address){}
- public:
- property uint16 Port{ uint16 get() { return _port; }; }
- property Platform::String^ Address{ Platform::String^ get() { return _address; }; }
- private:
- uint16 _port;
- Platform::String^ _address;
- };
+public ref class rtDnsResult sealed
+{
+internal:
+ rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address) {}
+public:
+ property uint16 Port { uint16 get() {
+ return _port;
+ };
+ }
+ property Platform::String^ Address { Platform::String^ get() {
+ return _address;
+ };
+ }
+private:
+ uint16 _port;
+ Platform::String^ _address;
+};
- public ref class rtSipStack sealed
- {
- public:
- virtual ~rtSipStack();
+public ref class rtSipStack sealed
+{
+public:
+ virtual ~rtSipStack();
+
+internal:
+ rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
+ const SipStack* getWrappedStack() {
+ return m_pSipStack;
+ }
- internal:
- rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
- const SipStack* getWrappedStack() { return m_pSipStack; }
+public:
+ bool start();
+ bool setDebugCallback(rtIDDebugCallback^ pCallback);
+ bool setDisplayName(Platform::String^ display_name);
+ bool setRealm(Platform::String^ realm_uri);
+ bool setIMPI(Platform::String^ impi);
+ bool setIMPU(Platform::String^ impu_uri);
+ bool setPassword(Platform::String^ password);
+ bool setAMF(Platform::String^ amf);
+ bool setOperatorId(Platform::String^ opid);
+ bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
+ bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
+ bool setLocalIP(Platform::String^ ip);
+ bool setLocalPort(unsigned short port, Platform::String^ transport);
+ bool setLocalPort(unsigned short port);
+ bool setEarlyIMS(bool enabled);
+ bool addHeader(Platform::String^ name, Platform::String^ value);
+ bool removeHeader(Platform::String^ name);
+ bool addDnsServer(Platform::String^ ip);
+ bool setDnsDiscovery(bool enabled);
+ bool setAoR(Platform::String^ ip, int port);
+ bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
+ bool addSigCompCompartment(Platform::String^ compId);
+ bool removeSigCompCompartment(Platform::String^ compId);
- public:
- bool start();
- bool setDebugCallback(rtIDDebugCallback^ pCallback);
- bool setDisplayName(Platform::String^ display_name);
- bool setRealm(Platform::String^ realm_uri);
- bool setIMPI(Platform::String^ impi);
- bool setIMPU(Platform::String^ impu_uri);
- bool setPassword(Platform::String^ password);
- bool setAMF(Platform::String^ amf);
- bool setOperatorId(Platform::String^ opid);
- bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
- bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
- bool setLocalIP(Platform::String^ ip);
- bool setLocalPort(unsigned short port, Platform::String^ transport);
- bool setLocalPort(unsigned short port);
- bool setEarlyIMS(bool enabled);
- bool addHeader(Platform::String^ name, Platform::String^ value);
- bool removeHeader(Platform::String^ name);
- bool addDnsServer(Platform::String^ ip);
- bool setDnsDiscovery(bool enabled);
- bool setAoR(Platform::String^ ip, int port);
- bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
- bool addSigCompCompartment(Platform::String^ compId);
- bool removeSigCompCompartment(Platform::String^ compId);
-
- bool setSTUNServer(Platform::String^ ip, unsigned short port);
- bool setSTUNCred(Platform::String^ login, Platform::String^ password);
+ bool setSTUNServer(Platform::String^ ip, unsigned short port);
+ bool setSTUNCred(Platform::String^ login, Platform::String^ password);
- bool setTLSSecAgree(bool enabled);
- bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
- bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
- bool setIPSecSecAgree(bool enabled);
- bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
-
- Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
+ bool setTLSSecAgree(bool enabled);
+ bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
+ bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
+ bool setIPSecSecAgree(bool enabled);
+ bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
+
+ Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
#if COM_VISIBLE
- rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
- rtDnsResult^ dnsSrv(Platform::String^ service);
- Platform::String^ getLocalIP(Platform::String^ protocol);
- uint16 getLocalPort(Platform::String^ protocol);
+ rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
+ rtDnsResult^ dnsSrv(Platform::String^ service);
+ Platform::String^ getLocalIP(Platform::String^ protocol);
+ uint16 getLocalPort(Platform::String^ protocol);
#else
- Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
- Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
- Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
+ Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
+ Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
+ Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
#endif
- Platform::String^ getPreferredIdentity();
+ Platform::String^ getPreferredIdentity();
+
+ bool isValid();
+ bool stop();
- bool isValid();
- bool stop();
-
- static bool initialize();
- static bool deInitialize();
- static void setCodecs(enum class rt_tdav_codec_id_t codecs);
- static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
- static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
+ static bool initialize();
+ static bool deInitialize();
+ static void setCodecs(enum class rt_tdav_codec_id_t codecs);
+ static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
+ static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
- private:
- SipStack* m_pSipStack;
- rtSipCallback^ m_pSipCallback;
- rtDDebugCallback^ m_pDebugCallback;
- std::recursive_mutex mLock;
- };
- }
+private:
+ SipStack* m_pSipStack;
+ rtSipCallback^ m_pSipCallback;
+ rtDDebugCallback^ m_pDebugCallback;
+ std::recursive_mutex mLock;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SipUri.h b/bindings/winrt/doubango_rt/include/rt_SipUri.h
index 3917f87..99db756 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipUri.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipUri.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,38 +23,40 @@ class SipUri;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtSipUri sealed
- {
- public:
- virtual ~rtSipUri();
- rtSipUri(Platform::String^ uriString, Platform::String^ displayName);
- rtSipUri(Platform::String^ uriString);
-
-
- public:
- static bool isValid(Platform::String^ uri);
+namespace BackEnd
+{
+public ref class rtSipUri sealed
+{
+public:
+ virtual ~rtSipUri();
+ rtSipUri(Platform::String^ uriString, Platform::String^ displayName);
+ rtSipUri(Platform::String^ uriString);
+
+
+public:
+ static bool isValid(Platform::String^ uri);
#if COM_VISIBLE
- bool isValid_();
+ bool isValid_();
#else
- bool isValid();
+ bool isValid();
#endif
- Platform::String^ getScheme();
- Platform::String^ getHost();
- unsigned short getPort();
- Platform::String^ getUserName();
- Platform::String^ getPassword();
- Platform::String^ getDisplayName();
- Platform::String^ getParamValue(Platform::String^ name);
- void setDisplayName(Platform::String^ displayName);
-
- internal:
- const SipUri* getWrappedUri(){ return m_pSipUri; }
-
- private:
- SipUri* m_pSipUri;
- };
- }
+ Platform::String^ getScheme();
+ Platform::String^ getHost();
+ unsigned short getPort();
+ Platform::String^ getUserName();
+ Platform::String^ getPassword();
+ Platform::String^ getDisplayName();
+ Platform::String^ getParamValue(Platform::String^ name);
+ void setDisplayName(Platform::String^ displayName);
+
+internal:
+ const SipUri* getWrappedUri() {
+ return m_pSipUri;
+ }
+
+private:
+ SipUri* m_pSipUri;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_String.h b/bindings/winrt/doubango_rt/include/rt_String.h
index 5562b5d..ce227ae 100755
--- a/bindings/winrt/doubango_rt/include/rt_String.h
+++ b/bindings/winrt/doubango_rt/include/rt_String.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,13 +21,13 @@
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtString sealed
- {
- internal:
- static std::vector<char> toUtf8(Platform::String^ str);
- static Platform::String^ toString(char const* str);
- };
- }
+namespace BackEnd
+{
+ref class rtString sealed
+{
+internal:
+ static std::vector<char> toUtf8(Platform::String^ str);
+ static Platform::String^ toString(char const* str);
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Xcap.h b/bindings/winrt/doubango_rt/include/rt_Xcap.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_Xcap.h
+++ b/bindings/winrt/doubango_rt/include/rt_Xcap.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx b/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
index 02f713e..b076eba 100755
--- a/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,51 +26,51 @@ using namespace std;
rtActionConfig::rtActionConfig()
{
- m_pActionConfig = new ActionConfig();
+ m_pActionConfig = new ActionConfig();
}
rtActionConfig::~rtActionConfig()
{
- rtSafeDelete(m_pActionConfig);
+ rtSafeDelete(m_pActionConfig);
}
-
+
bool rtActionConfig::addHeader(String^ name, String^ value)
{
- return m_pActionConfig->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
+ return m_pActionConfig->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtActionConfig::setActiveMedia(rt_twrap_media_type_t type)
{
- return m_pActionConfig->setActiveMedia((twrap_media_type_t)type);
+ return m_pActionConfig->setActiveMedia((twrap_media_type_t)type);
}
#if COM_VISIBLE
bool rtActionConfig::addPayload(Platform::String^ payload)
{
- static std::vector<char> _payload = rtString::toUtf8(payload);
- return m_pActionConfig->addPayload(_payload.data(), _payload.size());
+ static std::vector<char> _payload = rtString::toUtf8(payload);
+ return m_pActionConfig->addPayload(_payload.data(), _payload.size());
}
#else
bool rtActionConfig::addPayload(IntPtr payload, unsigned len)
{
- return m_pActionConfig->addPayload((const void*)payload, len);
+ return m_pActionConfig->addPayload((const void*)payload, len);
}
#endif /* COM_VISIBLE */
-
+
rtActionConfig^ rtActionConfig::setResponseLine(short code, String^ phrase)
{
- m_pActionConfig->setResponseLine(code, rtString::toUtf8(phrase).data());
- return this;
+ m_pActionConfig->setResponseLine(code, rtString::toUtf8(phrase).data());
+ return this;
}
rtActionConfig^ rtActionConfig::setMediaString(rt_twrap_media_type_t type, String^ key, String^ value)
{
- m_pActionConfig->setMediaString((twrap_media_type_t)type, rtString::toUtf8(key).data(), rtString::toUtf8(value).data());
- return this;
+ m_pActionConfig->setMediaString((twrap_media_type_t)type, rtString::toUtf8(key).data(), rtString::toUtf8(value).data());
+ return this;
}
rtActionConfig^ rtActionConfig::setMediaInt(rt_twrap_media_type_t type, String^ key, int value)
{
- m_pActionConfig->setMediaInt((twrap_media_type_t)type, rtString::toUtf8(key).data(), value);
- return this;
+ m_pActionConfig->setMediaInt((twrap_media_type_t)type, rtString::toUtf8(key).data(), value);
+ return this;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_DDebug.cxx b/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
index a03300c..dcb75ea 100755
--- a/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,52 +27,46 @@ using namespace std;
class DDebugCallbackProxy : public DDebugCallback
{
public:
- DDebugCallbackProxy(rtDDebugCallback^ pCallback)
- {
- m_pCallback = pCallback;
- }
+ DDebugCallbackProxy(rtDDebugCallback^ pCallback) {
+ m_pCallback = pCallback;
+ }
- ~DDebugCallbackProxy()
- {
-
- }
+ ~DDebugCallbackProxy() {
- virtual int OnDebugInfo(const char* message)
- {
- return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
- }
+ }
- virtual int OnDebugWarn(const char* message)
- {
- return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
- }
+ virtual int OnDebugInfo(const char* message) {
+ return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
+ }
- virtual int OnDebugError(const char* message)
- {
- return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
- }
+ virtual int OnDebugWarn(const char* message) {
+ return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
+ }
- virtual int OnDebugFatal(const char* message)
- {
- return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
- }
+ virtual int OnDebugError(const char* message) {
+ return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
+ }
+
+ virtual int OnDebugFatal(const char* message) {
+ return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
+ }
private:
- rtDDebugCallback^ m_pCallback;
+ rtDDebugCallback^ m_pCallback;
};
rtDDebugCallback::rtDDebugCallback(rtIDDebugCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new DDebugCallbackProxy(this);
+ m_pI = pI;
+ m_pCallback = new DDebugCallbackProxy(this);
}
rtDDebugCallback::~rtDDebugCallback()
{
- rtSafeDelete(m_pCallback);
-}
-
+ rtSafeDelete(m_pCallback);
+}
+
const DDebugCallback* rtDDebugCallback::getWrappedCallback()
{
- return dynamic_cast<const DDebugCallback*>(m_pCallback);
+ return dynamic_cast<const DDebugCallback*>(m_pCallback);
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_Enums.cxx b/bindings/winrt/doubango_rt/src/rt_Enums.cxx
index fa2645c..888ffa4 100755
--- a/bindings/winrt/doubango_rt/src/rt_Enums.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Enums.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/#include "rt_enums.h" \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx b/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/ \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx b/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
index 7d2c6f0..fcd9b21 100755
--- a/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,348 +27,347 @@ using namespace std;
rtCodec::rtCodec(struct tmedia_codec_s* pCodec)
{
- m_pCodec = new Codec(pCodec);
+ m_pCodec = new Codec(pCodec);
}
-
+
rtCodec::~rtCodec()
{
- rtSafeDelete(m_pCodec);
+ rtSafeDelete(m_pCodec);
}
enum class rt_twrap_media_type_t rtCodec::getMediaType()
{
- return (rt_twrap_media_type_t)m_pCodec->getMediaType();
+ return (rt_twrap_media_type_t)m_pCodec->getMediaType();
}
Platform::String^ rtCodec::getName()
{
- return rtString::toString(m_pCodec->getName());
+ return rtString::toString(m_pCodec->getName());
}
Platform::String^ rtCodec::getDescription()
{
- return rtString::toString(m_pCodec->getDescription());
+ return rtString::toString(m_pCodec->getDescription());
}
Platform::String^ rtCodec::getNegFormat()
{
- return rtString::toString(m_pCodec->getNegFormat());
+ return rtString::toString(m_pCodec->getNegFormat());
}
int rtCodec::getAudioSamplingRate()
{
- return m_pCodec->getAudioSamplingRate();
+ return m_pCodec->getAudioSamplingRate();
}
int rtCodec::getAudioChannels()
{
- return m_pCodec->getAudioChannels();
+ return m_pCodec->getAudioChannels();
}
int rtCodec::getAudioPTime()
{
- return m_pCodec->getAudioPTime();
+ return m_pCodec->getAudioPTime();
}
rtMediaSessionMgr::rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr)
{
- m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
+ m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
}
rtMediaSessionMgr::~rtMediaSessionMgr()
{
- rtSafeDelete(m_pMediaSessionMgr);
+ rtSafeDelete(m_pMediaSessionMgr);
}
bool rtMediaSessionMgr::sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
- return m_pMediaSessionMgr->sessionSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
+ return m_pMediaSessionMgr->sessionSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
int32 rtMediaSessionMgr::sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key)
{
- return m_pMediaSessionMgr->sessionGetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data());
+ return m_pMediaSessionMgr->sessionGetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data());
}
bool rtMediaSessionMgr::consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
- return m_pMediaSessionMgr->consumerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
+ return m_pMediaSessionMgr->consumerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
- return m_pMediaSessionMgr->consumerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
+ return m_pMediaSessionMgr->consumerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
- return m_pMediaSessionMgr->producerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
+ return m_pMediaSessionMgr->producerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
- return m_pMediaSessionMgr->producerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
+ return m_pMediaSessionMgr->producerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
rtCodec^ rtMediaSessionMgr::producerGetCodec(rt_twrap_media_type_t media)
{
- Codec* c = m_pMediaSessionMgr->producerGetCodec((twrap_media_type_t)media);
- if(c)
- {
- rtCodec^ codec = ref new rtCodec(const_cast<struct tmedia_codec_s*>(c->getWrappedCodec()));
- rtSafeDelete(c);
- return codec;
- }
- return nullptr;
+ Codec* c = m_pMediaSessionMgr->producerGetCodec((twrap_media_type_t)media);
+ if(c) {
+ rtCodec^ codec = ref new rtCodec(const_cast<struct tmedia_codec_s*>(c->getWrappedCodec()));
+ rtSafeDelete(c);
+ return codec;
+ }
+ return nullptr;
}
unsigned int rtMediaSessionMgr::registerAudioPluginFromFile(Platform::String^ path)
{
- return MediaSessionMgr::registerAudioPluginFromFile(rtString::toUtf8(path).data());
+ return MediaSessionMgr::registerAudioPluginFromFile(rtString::toUtf8(path).data());
}
uint64 rtMediaSessionMgr::getSessionId(rt_twrap_media_type_t media)
{
- return m_pMediaSessionMgr->getSessionId((twrap_media_type_t)media);
+ return m_pMediaSessionMgr->getSessionId((twrap_media_type_t)media);
}
-
+
bool rtMediaSessionMgr::defaultsSetProfile(rt_tmedia_profile_t profile)
{
- return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
+ return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
}
rt_tmedia_profile_t rtMediaSessionMgr::defaultsGetProfile()
{
- return (rt_tmedia_profile_t)MediaSessionMgr::defaultsGetProfile();
+ return (rt_tmedia_profile_t)MediaSessionMgr::defaultsGetProfile();
}
bool rtMediaSessionMgr::defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size)
{
- return MediaSessionMgr::defaultsSetPrefVideoSize((tmedia_pref_video_size_t) pref_video_size);
+ return MediaSessionMgr::defaultsSetPrefVideoSize((tmedia_pref_video_size_t) pref_video_size);
}
bool rtMediaSessionMgr::defaultsSetJbMargin(uint32 jb_margin_ms)
{
- return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
+ return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
}
bool rtMediaSessionMgr::defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent)
{
- return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
+ return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
}
bool rtMediaSessionMgr::defaultsSetEchoTail(uint32 echo_tail)
{
- return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
+ return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
}
uint32 rtMediaSessionMgr::defaultsGetEchoTail()
{
- return MediaSessionMgr::defaultsGetEchoTail();
+ return MediaSessionMgr::defaultsGetEchoTail();
}
bool rtMediaSessionMgr::defaultsSetEchoSkew(uint32 echo_skew)
{
- return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
+ return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
}
bool rtMediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
- return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
+ return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetEchoSuppEnabled()
{
- return MediaSessionMgr::defaultsGetEchoSuppEnabled();
+ return MediaSessionMgr::defaultsGetEchoSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
- return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
+ return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
}
bool rtMediaSessionMgr::defaultsGetAgcEnabled()
{
- return MediaSessionMgr::defaultsGetAgcEnabled();
+ return MediaSessionMgr::defaultsGetAgcEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
- return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
+ return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
}
float rtMediaSessionMgr::defaultsGetAgcLevel()
{
- return MediaSessionMgr::defaultsGetAgcLevel();
+ return MediaSessionMgr::defaultsGetAgcLevel();
}
bool rtMediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
- return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
+ return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
}
bool rtMediaSessionMgr::defaultsGetGetVadEnabled()
{
- return MediaSessionMgr::defaultsGetGetVadEnabled();
+ return MediaSessionMgr::defaultsGetGetVadEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
- return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
+ return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
- return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
+ return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppLevel(int32 noise_supp_level)
{
- return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
+ return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
}
int32 rtMediaSessionMgr::defaultsGetNoiseSuppLevel()
{
- return MediaSessionMgr::defaultsGetNoiseSuppLevel();
+ return MediaSessionMgr::defaultsGetNoiseSuppLevel();
}
bool rtMediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
{
- return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
+ return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
}
bool rtMediaSessionMgr::defaultsGet100relEnabled()
{
- return MediaSessionMgr::defaultsGet100relEnabled();
+ return MediaSessionMgr::defaultsGet100relEnabled();
}
bool rtMediaSessionMgr::defaultsSetScreenSize(int32 sx, int32 sy)
{
- return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
+ return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
}
bool rtMediaSessionMgr::defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain)
{
- return MediaSessionMgr::defaultsSetAudioGain(producer_gain, consumer_gain);
+ return MediaSessionMgr::defaultsSetAudioGain(producer_gain, consumer_gain);
}
bool rtMediaSessionMgr::defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop)
{
- return MediaSessionMgr::defaultsSetRtpPortRange(range_start, range_stop);
+ return MediaSessionMgr::defaultsSetRtpPortRange(range_start, range_stop);
}
bool rtMediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtpSymetricEnabled(enabled);
+ return MediaSessionMgr::defaultsSetRtpSymetricEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsSetMediaType(enum class rt_twrap_media_type_t media_type)
{
- return MediaSessionMgr::defaultsSetMediaType((twrap_media_type_t) media_type);
+ return MediaSessionMgr::defaultsSetMediaType((twrap_media_type_t) media_type);
}
bool rtMediaSessionMgr::defaultsSetVolume(int32 volume)
{
- return MediaSessionMgr::defaultsSetVolume(volume);
+ return MediaSessionMgr::defaultsSetVolume(volume);
}
int32 rtMediaSessionMgr::defaultsGetVolume()
{
- return MediaSessionMgr::defaultsGetVolume();
+ return MediaSessionMgr::defaultsGetVolume();
}
bool rtMediaSessionMgr::defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher)
{
- return MediaSessionMgr::defaultsSetInviteSessionTimers(timeout, rtString::toUtf8(refresher).data());
+ return MediaSessionMgr::defaultsSetInviteSessionTimers(timeout, rtString::toUtf8(refresher).data());
}
bool rtMediaSessionMgr::defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode)
{
- return MediaSessionMgr::defaultsSetSRtpMode((tmedia_srtp_mode_t) mode);
+ return MediaSessionMgr::defaultsSetSRtpMode((tmedia_srtp_mode_t) mode);
}
enum class rt_tmedia_srtp_mode_t rtMediaSessionMgr::defaultsGetSRtpMode()
{
- return (rt_tmedia_srtp_mode_t)MediaSessionMgr::defaultsGetSRtpMode();
+ return (rt_tmedia_srtp_mode_t)MediaSessionMgr::defaultsGetSRtpMode();
}
bool rtMediaSessionMgr::defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type)
{
- return MediaSessionMgr::defaultsSetSRtpType((tmedia_srtp_type_t) srtp_type);
+ return MediaSessionMgr::defaultsSetSRtpType((tmedia_srtp_type_t) srtp_type);
}
enum class rt_tmedia_srtp_type_t rtMediaSessionMgr::defaultsGetSRtpType()
{
- return (rt_tmedia_srtp_type_t)MediaSessionMgr::defaultsGetSRtpType();
+ return (rt_tmedia_srtp_type_t)MediaSessionMgr::defaultsGetSRtpType();
}
bool rtMediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
+ return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpEnabled()
{
- return MediaSessionMgr::defaultsGetRtcpEnabled();
+ return MediaSessionMgr::defaultsGetRtcpEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
+ return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpMuxEnabled()
{
- return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
+ return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
}
bool rtMediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
{
- return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
+ return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
}
bool rtMediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
{
- return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
+ return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassEncoding()
{
- return MediaSessionMgr::defaultsGetByPassEncoding();
+ return MediaSessionMgr::defaultsGetByPassEncoding();
}
bool rtMediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
{
- return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
+ return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassDecoding()
{
- return MediaSessionMgr::defaultsGetByPassDecoding();
+ return MediaSessionMgr::defaultsGetByPassDecoding();
}
bool rtMediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
+ return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetVideoJbEnabled()
{
- return MediaSessionMgr::defaultsGetVideoJbEnabled();
+ return MediaSessionMgr::defaultsGetVideoJbEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
{
- return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
+ return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
}
unsigned rtMediaSessionMgr::defaultsGetRtpBuffSize()
{
- return MediaSessionMgr::defaultsGetRtpBuffSize();
+ return MediaSessionMgr::defaultsGetRtpBuffSize();
}
bool rtMediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
{
- return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
+ return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
}
diff --git a/bindings/winrt/doubango_rt/src/rt_Msrp.cxx b/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
index 1d09f06..6699495 100755
--- a/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -35,103 +35,101 @@ using namespace std;
rtMsrpMessage::rtMsrpMessage(struct tmsrp_message_s *message)
{
- m_pMsrpMessage= new MsrpMessage(message);
+ m_pMsrpMessage= new MsrpMessage(message);
}
rtMsrpMessage::~rtMsrpMessage()
{
- rtSafeDelete(m_pMsrpMessage);
+ rtSafeDelete(m_pMsrpMessage);
}
bool rtMsrpMessage::isRequest()
{
- return m_pMsrpMessage->isRequest();
+ return m_pMsrpMessage->isRequest();
}
short rtMsrpMessage::getCode()
{
- return m_pMsrpMessage->getCode();
+ return m_pMsrpMessage->getCode();
}
String^ rtMsrpMessage::getPhrase()
{
- return rtString::toString(m_pMsrpMessage->getPhrase());
+ return rtString::toString(m_pMsrpMessage->getPhrase());
}
rt_tmsrp_request_type_t rtMsrpMessage::getRequestType()
{
- return (rt_tmsrp_request_type_t)m_pMsrpMessage->getRequestType();
+ return (rt_tmsrp_request_type_t)m_pMsrpMessage->getRequestType();
}
#if COM_VISIBLE
rtMsrpByteRange^ rtMsrpMessage::getByteRange()
{
- int64_t _start = -1, _end = -1, _total = -1;
- m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
- return ref new rtMsrpByteRange(_start, _end, _total);
+ int64_t _start = -1, _end = -1, _total = -1;
+ m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
+ return ref new rtMsrpByteRange(_start, _end, _total);
}
#else
void rtMsrpMessage::getByteRange(IntPtr start, IntPtr end, IntPtr total)
{
- int64_t _start = -1, _end = -1, _total = -1;
- m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
- // IntPtr is 32bit or 64bit -> 32 to be sure not memory errors will raise
- *((int32_t*)(void*)start) = (int32_t)_start;
- *((int32_t*)(void*)end) = (int32_t)_end;
- *((int32_t*)(void*)total) = (int32_t)_total;
+ int64_t _start = -1, _end = -1, _total = -1;
+ m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
+ // IntPtr is 32bit or 64bit -> 32 to be sure not memory errors will raise
+ *((int32_t*)(void*)start) = (int32_t)_start;
+ *((int32_t*)(void*)end) = (int32_t)_end;
+ *((int32_t*)(void*)total) = (int32_t)_total;
}
#endif /* COM_VISIBLE */
bool rtMsrpMessage::isLastChunck()
{
- return m_pMsrpMessage->isLastChunck();
+ return m_pMsrpMessage->isLastChunck();
}
bool rtMsrpMessage::isFirstChunck()
{
- return m_pMsrpMessage->isFirstChunck();
+ return m_pMsrpMessage->isFirstChunck();
}
bool rtMsrpMessage::isSuccessReport()
{
- return m_pMsrpMessage->isSuccessReport();
+ return m_pMsrpMessage->isSuccessReport();
}
String^ rtMsrpMessage::getMsrpHeaderValue(String^ name)
{
- return rtString::toString(m_pMsrpMessage->getMsrpHeaderValue(rtString::toUtf8(name).data()));
+ return rtString::toString(m_pMsrpMessage->getMsrpHeaderValue(rtString::toUtf8(name).data()));
}
String^ rtMsrpMessage::getMsrpHeaderParamValue(String^ name, String^ param)
{
- return rtString::toString(m_pMsrpMessage->getMsrpHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data()));
+ return rtString::toString(m_pMsrpMessage->getMsrpHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data()));
}
unsigned rtMsrpMessage::getMsrpContentLength()
{
- return m_pMsrpMessage->getMsrpContentLength();
+ return m_pMsrpMessage->getMsrpContentLength();
}
#if COM_VISIBLE
String^ rtMsrpMessage::getMsrpContent(unsigned maxsize)
{
- if(maxsize)
- {
- void* _s = calloc(maxsize + 1, 1);
- if(_s)
- {
- unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
- String^ s = rtString::toString((const char*)_s);
- free(_s);
- return s;
- }
- }
- return nullptr;
+ if(maxsize) {
+ void* _s = calloc(maxsize + 1, 1);
+ if(_s) {
+ unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
+ String^ s = rtString::toString((const char*)_s);
+ free(_s);
+ return s;
+ }
+ }
+ return nullptr;
}
#else
unsigned rtMsrpMessage::getMsrpContent(IntPtr output, unsigned maxsize)
{
- return m_pMsrpMessage->getMsrpContent((void*)output, maxsize);
+ return m_pMsrpMessage->getMsrpContent((void*)output, maxsize);
}
#endif /* COM_VISIBLE */
@@ -142,37 +140,35 @@ unsigned rtMsrpMessage::getMsrpContent(IntPtr output, unsigned maxsize)
rtMsrpEvent::rtMsrpEvent(const struct tmsrp_event_s *event)
{
- m_pMsrpEvent = new MsrpEvent(event);
+ m_pMsrpEvent = new MsrpEvent(event);
}
-
+
rtMsrpEvent::~rtMsrpEvent()
{
- rtSafeDelete(m_pMsrpEvent);
+ rtSafeDelete(m_pMsrpEvent);
}
rt_tmsrp_event_type_t rtMsrpEvent::getType()
{
- return (rt_tmsrp_event_type_t)m_pMsrpEvent->getType();
+ return (rt_tmsrp_event_type_t)m_pMsrpEvent->getType();
}
rtMsrpSession^ rtMsrpEvent::getSipSession()
{
- if(m_pMsrpEvent->getSipSession())
- {
- assert(0); // FIXME: Not implemented
- return nullptr;
- // return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
- }
- return nullptr;
+ if(m_pMsrpEvent->getSipSession()) {
+ assert(0); // FIXME: Not implemented
+ return nullptr;
+ // return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
+ }
+ return nullptr;
}
rtMsrpMessage^ rtMsrpEvent::getMessage()
{
- if(m_pMsrpEvent->getMessage())
- {
- return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
- }
- return nullptr;
+ if(m_pMsrpEvent->getMessage()) {
+ return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
+ }
+ return nullptr;
}
//
@@ -181,14 +177,13 @@ rtMsrpMessage^ rtMsrpEvent::getMessage()
rtMsrpCallback::rtMsrpCallback(rtIMsrpCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new MsrpCallback();
+ m_pI = pI;
+ m_pCallback = new MsrpCallback();
}
rtMsrpCallback::~rtMsrpCallback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
- \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx b/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/ \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx b/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
index 68c6299..ce5c0c9 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,108 +28,89 @@ using namespace std;
class SipCallbackProxy : public SipCallback
{
public:
- SipCallbackProxy(rtSipCallback^ rtCallback)
- {
- m_pCallback = rtCallback;
- }
-
- virtual int OnDialogEvent(const DialogEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnStackEvent(const StackEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnInviteEvent(const InviteEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnMessagingEvent(const MessagingEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnInfoEvent(const InfoEvent* e) override
- {
- if(m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnOptionsEvent(const OptionsEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnPublicationEvent(const PublicationEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnRegistrationEvent(const RegistrationEvent* e) override
- {
- if(m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
+ SipCallbackProxy(rtSipCallback^ rtCallback) {
+ m_pCallback = rtCallback;
+ }
+
+ virtual int OnDialogEvent(const DialogEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnStackEvent(const StackEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnInviteEvent(const InviteEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnMessagingEvent(const MessagingEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnInfoEvent(const InfoEvent* e) override {
+ if(m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnOptionsEvent(const OptionsEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnPublicationEvent(const PublicationEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnRegistrationEvent(const RegistrationEvent* e) override {
+ if(m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
private:
- rtSipCallback^ m_pCallback;
+ rtSipCallback^ m_pCallback;
};
rtSipCallback::rtSipCallback(rtISipCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new SipCallbackProxy(this);
+ m_pI = pI;
+ m_pCallback = new SipCallbackProxy(this);
}
rtSipCallback::~rtSipCallback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
const SipCallback* rtSipCallback::getWrappedCallback()
-{
- return dynamic_cast<const SipCallback*>(m_pCallback);
+{
+ return dynamic_cast<const SipCallback*>(m_pCallback);
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx b/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
index 1bd414e..65c5dbd 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -38,7 +38,7 @@ rt##cls##Session^ rt##cls##Event::getSession(){ \
} \
return nullptr; \
} \
-
+
#define rt_takeOwnership_Implement(cls, name, session) \
rt##name##Session^ rt##cls##Event::take##session##Ownership(){ \
name##Session* s = m_pEvent->take##session##Ownership(); \
@@ -49,18 +49,18 @@ rt##name##Session^ rt##cls##Event::take##session##Ownership(){ \
} \
return nullptr; \
} \
-
+
/* ======================== rtDialogEvent ========================*/
rtISipEvent_Implement(rtDialogEvent);
rtDialogEvent::rtDialogEvent(const struct tsip_event_s *e)
{
- m_pEvent = new DialogEvent(e);
+ m_pEvent = new DialogEvent(e);
}
rtDialogEvent::~rtDialogEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
@@ -69,36 +69,36 @@ rtISipEvent_Implement(rtStackEvent);
rtStackEvent::rtStackEvent(const struct tsip_event_s *e)
{
- m_pEvent = new StackEvent(e);
+ m_pEvent = new StackEvent(e);
}
rtStackEvent::~rtStackEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
- /* ======================== rtInviteEvent ========================*/
+/* ======================== rtInviteEvent ========================*/
rtISipEvent_Implement(rtInviteEvent);
rtInviteEvent::rtInviteEvent(const struct tsip_event_s *e)
{
- m_pEvent = new InviteEvent(e);
+ m_pEvent = new InviteEvent(e);
}
rtInviteEvent::~rtInviteEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_invite_event_type_t rtInviteEvent::getType()
{
- return (rt_tsip_invite_event_type_t)m_pEvent->getType();
+ return (rt_tsip_invite_event_type_t)m_pEvent->getType();
}
rt_twrap_media_type_t rtInviteEvent::getMediaType()
{
- return (rt_twrap_media_type_t)m_pEvent->getMediaType();
+ return (rt_twrap_media_type_t)m_pEvent->getMediaType();
}
rt_getSession_Implement(Invite);
@@ -110,18 +110,18 @@ rtISipEvent_Implement(rtMessagingEvent);
rtMessagingEvent::rtMessagingEvent(const struct tsip_event_s *e)
{
- m_pEvent = new MessagingEvent(e);
+ m_pEvent = new MessagingEvent(e);
}
-
+
rtMessagingEvent::~rtMessagingEvent()
{
- rtSafeDelete(m_pEvent);
-}
+ rtSafeDelete(m_pEvent);
+}
rt_tsip_message_event_type_t rtMessagingEvent::getType()
{
- return (rt_tsip_message_event_type_t)m_pEvent->getType();
+ return (rt_tsip_message_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Messaging);
@@ -133,17 +133,17 @@ rtISipEvent_Implement(rtInfoEvent);
rtInfoEvent::rtInfoEvent(const struct tsip_event_s *e)
{
- m_pEvent = new InfoEvent(e);
+ m_pEvent = new InfoEvent(e);
}
rtInfoEvent::~rtInfoEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_info_event_type_t rtInfoEvent::getType()
{
- return (rt_tsip_info_event_type_t)m_pEvent->getType();
+ return (rt_tsip_info_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Info);
@@ -155,17 +155,17 @@ rtISipEvent_Implement(rtOptionsEvent);
rtOptionsEvent::rtOptionsEvent(const struct tsip_event_s *e)
{
- m_pEvent = new OptionsEvent(e);
+ m_pEvent = new OptionsEvent(e);
}
rtOptionsEvent::~rtOptionsEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_options_event_type_t rtOptionsEvent::getType()
{
- return (rt_tsip_options_event_type_t)m_pEvent->getType();
+ return (rt_tsip_options_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Options);
@@ -177,17 +177,17 @@ rtISipEvent_Implement(rtPublicationEvent);
rtPublicationEvent::rtPublicationEvent(const struct tsip_event_s *e)
{
- m_pEvent = new PublicationEvent(e);
+ m_pEvent = new PublicationEvent(e);
}
rtPublicationEvent::~rtPublicationEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_publish_event_type_t rtPublicationEvent::getType()
{
- return (rt_tsip_publish_event_type_t)m_pEvent->getType();
+ return (rt_tsip_publish_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Publication);
@@ -200,17 +200,17 @@ rtISipEvent_Implement(rtRegistrationEvent);
rtRegistrationEvent::rtRegistrationEvent(const struct tsip_event_s *e)
{
- m_pEvent = new RegistrationEvent(e);
+ m_pEvent = new RegistrationEvent(e);
}
rtRegistrationEvent::~rtRegistrationEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_register_event_type_t rtRegistrationEvent::getType()
{
- return (rt_tsip_register_event_type_t)m_pEvent->getType();
+ return (rt_tsip_register_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Registration);
@@ -222,17 +222,17 @@ rtISipEvent_Implement(rtSubscriptionEvent);
rtSubscriptionEvent::rtSubscriptionEvent(const struct tsip_event_s *e)
{
- m_pEvent = new SubscriptionEvent(e);
+ m_pEvent = new SubscriptionEvent(e);
}
rtSubscriptionEvent::~rtSubscriptionEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_subscribe_event_type_t rtSubscriptionEvent::getType()
{
- return (rt_tsip_subscribe_event_type_t)m_pEvent->getType();
+ return (rt_tsip_subscribe_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Subscription);
diff --git a/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx b/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
index 55e05d9..1c5ba3e 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -29,52 +29,50 @@ using namespace std;
//
rtSdpMessage::rtSdpMessage()
- :m_pSdpMessage(NULL)
+ :m_pSdpMessage(NULL)
{
}
rtSdpMessage::rtSdpMessage(struct tsdp_message_s *message)
{
- m_pSdpMessage = new SdpMessage(message);
+ m_pSdpMessage = new SdpMessage(message);
}
rtSdpMessage::~rtSdpMessage()
{
- rtSafeDelete(m_pSdpMessage);
+ rtSafeDelete(m_pSdpMessage);
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name, unsigned index)
{
- if(m_pSdpMessage)
- {
- char * _str = m_pSdpMessage->getSdpHeaderValue
- (rtString::toUtf8(media).data(),
- rtString::toUtf8(media).data()[0],
- index);
- String^ str = rtString::toString(_str);
- TSK_FREE(str);
- return str;
- }
- return nullptr;
+ if(m_pSdpMessage) {
+ char * _str = m_pSdpMessage->getSdpHeaderValue
+ (rtString::toUtf8(media).data(),
+ rtString::toUtf8(media).data()[0],
+ index);
+ String^ str = rtString::toString(_str);
+ TSK_FREE(str);
+ return str;
+ }
+ return nullptr;
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name)
{
- return getSdpHeaderValue(media, name, 0);
+ return getSdpHeaderValue(media, name, 0);
}
String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
{
- if(m_pSdpMessage)
- {
- char * _str = m_pSdpMessage->getSdpHeaderAValue
- (rtString::toUtf8(media).data(),
- rtString::toUtf8(attributeName).data());
- String^ str = rtString::toString(_str);
- TSK_FREE(str);
- return str;
- }
- return nullptr;
+ if(m_pSdpMessage) {
+ char * _str = m_pSdpMessage->getSdpHeaderAValue
+ (rtString::toUtf8(media).data(),
+ rtString::toUtf8(attributeName).data());
+ String^ str = rtString::toString(_str);
+ TSK_FREE(str);
+ return str;
+ }
+ return nullptr;
}
//
@@ -82,90 +80,88 @@ String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
//
rtSipMessage::rtSipMessage()
- :m_pSipMessage(NULL)
+ :m_pSipMessage(NULL)
{
}
rtSipMessage::rtSipMessage(struct tsip_message_s* message)
{
- m_pSipMessage = new SipMessage(message);
+ m_pSipMessage = new SipMessage(message);
}
rtSipMessage::~rtSipMessage()
{
- rtSafeDelete(m_pSipMessage);
+ rtSafeDelete(m_pSipMessage);
}
bool rtSipMessage::isResponse()
{
- return m_pSipMessage ? m_pSipMessage->isResponse() : false;
+ return m_pSipMessage ? m_pSipMessage->isResponse() : false;
}
rt_tsip_request_type_t rtSipMessage::getRequestType()
{
- return (rt_tsip_request_type_t)(m_pSipMessage ? m_pSipMessage->getRequestType() : 0);
+ return (rt_tsip_request_type_t)(m_pSipMessage ? m_pSipMessage->getRequestType() : 0);
}
short rtSipMessage::getResponseCode()
{
- return m_pSipMessage ? m_pSipMessage->getResponseCode() : 0;
+ return m_pSipMessage ? m_pSipMessage->getResponseCode() : 0;
}
String^ rtSipMessage::getResponsePhrase()
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getResponsePhrase()) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getResponsePhrase()) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name, unsigned index)
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderValue(rtString::toUtf8(name).data(), index)) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderValue(rtString::toUtf8(name).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name)
{
- return getSipHeaderValue(name, 0);
+ return getSipHeaderValue(name, 0);
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param, unsigned index)
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data(), index)) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param)
{
- return getSipHeaderParamValue(name, param, 0);
+ return getSipHeaderParamValue(name, param, 0);
}
unsigned rtSipMessage::getSipContentLength()
{
- return m_pSipMessage ? m_pSipMessage->getSipContentLength() : 0;
+ return m_pSipMessage ? m_pSipMessage->getSipContentLength() : 0;
}
#if COM_VISIBLE
String^ rtSipMessage::getSipContent()
{
- unsigned len = getSipContentLength();
- if(len > 0)
- {
- void* data_ptr = calloc(len, 1);
- if(data_ptr)
- {
- m_pSipMessage->getSipContent(data_ptr, len);
- String^ s = rtString::toString((const char*)data_ptr);
- free(data_ptr);
- return s;
- }
- }
- return nullptr;
+ unsigned len = getSipContentLength();
+ if(len > 0) {
+ void* data_ptr = calloc(len, 1);
+ if(data_ptr) {
+ m_pSipMessage->getSipContent(data_ptr, len);
+ String^ s = rtString::toString((const char*)data_ptr);
+ free(data_ptr);
+ return s;
+ }
+ }
+ return nullptr;
}
#else
unsigned rtSipMessage::getSipContent(IntPtr output, unsigned maxsize)
{
- return m_pSipMessage ? m_pSipMessage->getSipContent((void*)output, maxsize) : 0;
+ return m_pSipMessage ? m_pSipMessage->getSipContent((void*)output, maxsize) : 0;
}
#endif
rtSdpMessage^ rtSipMessage::getSdpMessage()
{
- return m_pSipMessage ? ref new rtSdpMessage(const_cast<struct tsdp_message_s *>(const_cast<SdpMessage*>(m_pSipMessage->getSdpMessage())->getWrappedSdpMessage())) : nullptr;
+ return m_pSipMessage ? ref new rtSdpMessage(const_cast<struct tsdp_message_s *>(const_cast<SdpMessage*>(m_pSipMessage->getSdpMessage())->getWrappedSdpMessage())) : nullptr;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipSession.cxx b/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
index 872a2e2..487ba2e 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,24 +31,24 @@ using namespace std;
/* ======================== T140Callback ========================*/
rtT140CallbackData::rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- m_pData = new T140CallbackData(data_type, data_ptr, data_size);
+ m_pData = new T140CallbackData(data_type, data_ptr, data_size);
}
-
+
rtT140CallbackData::~rtT140CallbackData()
{
- rtSafeDelete(m_pData);
+ rtSafeDelete(m_pData);
}
/* ======================== rtT140Callback ========================*/
rtT140Callback::rtT140Callback()
{
- m_pCallback = new T140Callback();
+ m_pCallback = new T140Callback();
}
rtT140Callback::~rtT140Callback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
/* ======================== rtSipSession ========================*/
@@ -56,17 +56,17 @@ rtISession_Implement(rtSipSession);
rtSipSession::rtSipSession(rtSipStack^ pStack)
{
- m_pSipSession = new SipSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new SipSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSipSession::rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new SipSession(pStack, pHandle);
+ m_pSipSession = new SipSession(pStack, pHandle);
}
rtSipSession::~rtSipSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
@@ -76,19 +76,19 @@ rtIInviteSession_Implement(rtInviteSession);
rtInviteSession::rtInviteSession(rtSipStack^ pStack)
{
- m_pSipSession = new InviteSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new InviteSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInviteSession::rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new InviteSession(pStack, pHandle);
+ m_pSipSession = new InviteSession(pStack, pHandle);
}
rtInviteSession::~rtInviteSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
-
+
/* ======================== rtCallSession ========================*/
rtISession_Implement(rtCallSession);
@@ -96,177 +96,177 @@ rtIInviteSession_Implement(rtCallSession);
rtCallSession::rtCallSession(rtSipStack^ pStack)
{
- m_pSipSession = new CallSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new CallSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtCallSession::rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new CallSession(pStack, pHandle);
+ m_pSipSession = new CallSession(pStack, pHandle);
}
rtCallSession::~rtCallSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config)
{
- return m_pSipSession->call(rtString::toUtf8(remoteUriString).data(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->call(rtString::toUtf8(remoteUriString).data(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media)
{
- return call(remoteUriString, media, nullptr);
+ return call(remoteUriString, media, nullptr);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config)
{
- return m_pSipSession->call(remoteUri->getWrappedUri(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->call(remoteUri->getWrappedUri(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media)
{
- return call(remoteUri, media, nullptr);
+ return call(remoteUri, media, nullptr);
}
bool rtCallSession::setSessionTimer(unsigned timeout, String^ refresher)
{
- return m_pSipSession->setSessionTimer(timeout, rtString::toUtf8(refresher).data());
+ return m_pSipSession->setSessionTimer(timeout, rtString::toUtf8(refresher).data());
}
bool rtCallSession::set100rel(bool enabled)
{
- return m_pSipSession->set100rel(enabled);
+ return m_pSipSession->set100rel(enabled);
}
bool rtCallSession::setRtcp(bool enabled)
{
- return m_pSipSession->setRtcp(enabled);
+ return m_pSipSession->setRtcp(enabled);
}
bool rtCallSession::setRtcpMux(bool enabled)
{
- return m_pSipSession->setRtcpMux(enabled);
+ return m_pSipSession->setRtcpMux(enabled);
}
bool rtCallSession::setICE(bool enabled)
{
- return m_pSipSession->setICE(enabled);
+ return m_pSipSession->setICE(enabled);
}
bool rtCallSession::setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength)
{
- return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
+ return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
}
bool rtCallSession::setVideoFps(int32_t fps)
{
- return m_pSipSession->setVideoFps(fps);
+ return m_pSipSession->setVideoFps(fps);
}
bool rtCallSession::setVideoBandwidthUploadMax(int32_t max)
{
- return m_pSipSession->setVideoBandwidthUploadMax(max);
+ return m_pSipSession->setVideoBandwidthUploadMax(max);
}
bool rtCallSession::setVideoBandwidthDownloadMax(int32_t max)
{
- return m_pSipSession->setVideoBandwidthDownloadMax(max);
+ return m_pSipSession->setVideoBandwidthDownloadMax(max);
}
bool rtCallSession::setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size)
{
- return m_pSipSession->setVideoPrefSize((tmedia_pref_video_size_t)pref_video_size);
+ return m_pSipSession->setVideoPrefSize((tmedia_pref_video_size_t)pref_video_size);
}
bool rtCallSession::hold(rtActionConfig^ config)
{
- return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::hold()
{
- return hold(nullptr);
+ return hold(nullptr);
}
bool rtCallSession::resume(rtActionConfig^ config)
{
- return m_pSipSession->resume(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->resume(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::resume()
{
- return resume(nullptr);
+ return resume(nullptr);
}
bool rtCallSession::transfer(String^ referToUriString, rtActionConfig^ config)
{
- return m_pSipSession->transfer(rtString::toUtf8(referToUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->transfer(rtString::toUtf8(referToUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::transfer(String^ referToUriString)
{
- return transfer(referToUriString, nullptr);
+ return transfer(referToUriString, nullptr);
}
bool rtCallSession::acceptTransfer(rtActionConfig^ config)
{
- return m_pSipSession->acceptTransfer(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->acceptTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::acceptTransfer()
{
- return acceptTransfer(nullptr);
+ return acceptTransfer(nullptr);
}
bool rtCallSession::rejectTransfer(rtActionConfig^ config)
{
- return m_pSipSession->rejectTransfer(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->rejectTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::rejectTransfer()
{
- return rejectTransfer(nullptr);
+ return rejectTransfer(nullptr);
}
bool rtCallSession::sendDTMF(int number)
{
- return m_pSipSession->sendDTMF(number);
+ return m_pSipSession->sendDTMF(number);
}
unsigned rtCallSession::getSessionTransferId()
{
- return m_pSipSession->getSessionTransferId();
+ return m_pSipSession->getSessionTransferId();
}
#if COM_VISIBLE
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, String^ data)
{
- std::vector<char> _data = rtString::toUtf8(data);
- return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)_data.data(), _data.size());
+ std::vector<char> _data = rtString::toUtf8(data);
+ return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)_data.data(), _data.size());
}
#else
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, IntPtr data_ptr, unsigned data_size)
{
- return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)data_ptr, data_size);
+ return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)data_ptr, data_size);
}
#endif
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type)
{
- return sendT140Data(data_type, nullptr
+ return sendT140Data(data_type, nullptr
#if !COM_VISIBLE
- , 0
+ , 0
#endif
- );
+ );
}
bool rtCallSession::setT140Callback(rtT140Callback^ pT140Callback)
{
- return m_pSipSession->setT140Callback(const_cast<T140Callback*>(pT140Callback->getWrappedCallback()));
+ return m_pSipSession->setT140Callback(const_cast<T140Callback*>(pT140Callback->getWrappedCallback()));
}
@@ -276,74 +276,73 @@ rtIInviteSession_Implement(rtMsrpSession);
rtMsrpSession::rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback)
{
- m_pCallback = ref new rtMsrpCallback(pCallback);
- m_pSipSession = new MsrpSession(const_cast<SipStack*>(pStack->getWrappedStack()), const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
+ m_pCallback = ref new rtMsrpCallback(pCallback);
+ m_pSipSession = new MsrpSession(const_cast<SipStack*>(pStack->getWrappedStack()), const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
rtMsrpSession::rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new MsrpSession(pStack, pHandle);
+ m_pSipSession = new MsrpSession(pStack, pHandle);
}
rtMsrpSession::~rtMsrpSession()
{
- rtSafeDelete(m_pSipSession);
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pCallback);
}
bool rtMsrpSession::setCallback(rtIMsrpCallback^ pCallback)
{
- rtSafeDelete(m_pCallback);
- if(!pCallback)
- {
- return m_pSipSession->setCallback(tsk_null);
- return true;
- }
- m_pCallback = ref new rtMsrpCallback(pCallback);
- return m_pSipSession->setCallback(const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
+ rtSafeDelete(m_pCallback);
+ if(!pCallback) {
+ return m_pSipSession->setCallback(tsk_null);
+ return true;
+ }
+ m_pCallback = ref new rtMsrpCallback(pCallback);
+ return m_pSipSession->setCallback(const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config)
{
- return m_pSipSession->callMsrp(rtString::toUtf8(remoteUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->callMsrp(rtString::toUtf8(remoteUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString)
{
- return callMsrp(remoteUriString, nullptr);
+ return callMsrp(remoteUriString, nullptr);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config)
{
- return m_pSipSession->callMsrp(remoteUri->getWrappedUri(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->callMsrp(remoteUri->getWrappedUri(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri)
{
- return callMsrp(remoteUri, nullptr);
+ return callMsrp(remoteUri, nullptr);
}
#if COM_VISIBLE
bool rtMsrpSession::sendMessage(String^ payload, rtActionConfig^ config)
{
- std::vector<char> _payload = rtString::toUtf8(payload);
- return m_pSipSession->sendMessage((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char> _payload = rtString::toUtf8(payload);
+ return m_pSipSession->sendMessage((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::String^ payload)
{
- return sendMessage(payload, nullptr);
+ return sendMessage(payload, nullptr);
}
#else
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->sendMessage((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->sendMessage((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len)
{
- return sendMessage(payload, len, nullptr);
+ return sendMessage(payload, len, nullptr);
}
#endif /* COM_VISIBLE */
@@ -353,61 +352,61 @@ rtISession_Implement(rtMessagingSession);
rtMessagingSession::rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new MessagingSession(pStack, pHandle);
+ m_pSipSession = new MessagingSession(pStack, pHandle);
}
-
+
rtMessagingSession::rtMessagingSession(rtSipStack^ pStack)
{
- m_pSipSession = new MessagingSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new MessagingSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtMessagingSession::~rtMessagingSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtMessagingSession::send(String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(Platform::String^ payload)
{
- return send(payload, nullptr);
+ return send(payload, nullptr);
}
#else
bool rtMessagingSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(IntPtr payload, unsigned len)
{
- return send(payload, len, nullptr);
+ return send(payload, len, nullptr);
}
#endif
bool rtMessagingSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtMessagingSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
/* ======================== rtInfoSession ========================*/
@@ -415,60 +414,60 @@ rtISession_Implement(rtInfoSession);
rtInfoSession::rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new InfoSession(pStack, pHandle);
+ m_pSipSession = new InfoSession(pStack, pHandle);
}
rtInfoSession::rtInfoSession(rtSipStack^ pStack)
{
- m_pSipSession = new InfoSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new InfoSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInfoSession::~rtInfoSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtInfoSession::send(Platform::String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(Platform::String^ payload)
{
- return send(payload, nullptr);
+ return send(payload, nullptr);
}
#else
bool rtInfoSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(IntPtr payload, unsigned len)
{
- return send(payload, len, nullptr);
+ return send(payload, len, nullptr);
}
#endif
bool rtInfoSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtInfoSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -478,47 +477,47 @@ rtISession_Implement(rtOptionsSession);
rtOptionsSession::rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new OptionsSession(pStack, pHandle);
+ m_pSipSession = new OptionsSession(pStack, pHandle);
}
rtOptionsSession::rtOptionsSession(rtSipStack^ pStack)
{
- m_pSipSession = new OptionsSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new OptionsSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtOptionsSession::~rtOptionsSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtOptionsSession::send(rtActionConfig^ config)
{
- return m_pSipSession->send(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::send()
{
- return send(nullptr);
+ return send(nullptr);
}
bool rtOptionsSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtOptionsSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -528,49 +527,49 @@ rtISession_Implement(rtPublicationSession);
rtPublicationSession::rtPublicationSession(rtSipStack^ pStack)
{
- m_pSipSession = new PublicationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new PublicationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtPublicationSession::rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new PublicationSession(pStack, pHandle);
+ m_pSipSession = new PublicationSession(pStack, pHandle);
}
rtPublicationSession::~rtPublicationSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtPublicationSession::publish(String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->publish((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->publish((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::String^ payload)
{
- return publish(payload, nullptr);
+ return publish(payload, nullptr);
}
#else
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->publish((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->publish((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len)
{
- return publish(payload, len, nullptr);
+ return publish(payload, len, nullptr);
}
#endif
bool rtPublicationSession::unPublish(rtActionConfig^ config)
{
- return m_pSipSession->unPublish(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->unPublish(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::unPublish()
{
- return unPublish(nullptr);
+ return unPublish(nullptr);
}
@@ -579,57 +578,57 @@ rtISession_Implement(rtRegistrationSession);
rtRegistrationSession::rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new RegistrationSession(pStack, pHandle);
+ m_pSipSession = new RegistrationSession(pStack, pHandle);
}
rtRegistrationSession::rtRegistrationSession(rtSipStack^ pStack)
{
- m_pSipSession = new RegistrationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new RegistrationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtRegistrationSession::~rtRegistrationSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtRegistrationSession::register_(rtActionConfig^ config)
{
- return m_pSipSession->register_(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->register_(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::register_()
{
- return register_(nullptr);
+ return register_(nullptr);
}
bool rtRegistrationSession::unRegister(rtActionConfig^ config)
{
- return m_pSipSession->unRegister(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->unRegister(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::unRegister()
{
- return unRegister(nullptr);
+ return unRegister(nullptr);
}
bool rtRegistrationSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtRegistrationSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -638,25 +637,25 @@ rtISession_Implement(rtSubscriptionSession);
rtSubscriptionSession::rtSubscriptionSession(rtSipStack^ pStack)
{
- m_pSipSession = new SubscriptionSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new SubscriptionSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSubscriptionSession::rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new SubscriptionSession(pStack, pHandle);
+ m_pSipSession = new SubscriptionSession(pStack, pHandle);
}
rtSubscriptionSession::~rtSubscriptionSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
-
+
bool rtSubscriptionSession::subscribe()
{
- return m_pSipSession->subscribe();
+ return m_pSipSession->subscribe();
}
bool rtSubscriptionSession::unSubscribe()
{
- return m_pSipSession->unSubscribe();
+ return m_pSipSession->unSubscribe();
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipStack.cxx b/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
index 753a881..4aa04c6 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -30,360 +30,359 @@ using namespace std;
rtSipStack::rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri)
{
- m_pSipCallback = ref new rtSipCallback(callback);
- m_pSipStack = new SipStack(
- const_cast<SipCallback*>(m_pSipCallback->getWrappedCallback()),
- rtString::toUtf8(realmUri).data(),
- rtString::toUtf8(impiString).data(),
- rtString::toUtf8(impuUri).data()
- );
+ m_pSipCallback = ref new rtSipCallback(callback);
+ m_pSipStack = new SipStack(
+ const_cast<SipCallback*>(m_pSipCallback->getWrappedCallback()),
+ rtString::toUtf8(realmUri).data(),
+ rtString::toUtf8(impiString).data(),
+ rtString::toUtf8(impuUri).data()
+ );
}
rtSipStack::~rtSipStack()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- rtSafeDelete(m_pSipStack);
- rtSafeDelete(m_pSipCallback);
- rtSafeDelete(m_pDebugCallback);
+ rtSafeDelete(m_pSipStack);
+ rtSafeDelete(m_pSipCallback);
+ rtSafeDelete(m_pDebugCallback);
}
bool rtSipStack::start()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->start();
+ return m_pSipStack->start();
}
bool rtSipStack::setDebugCallback(rtIDDebugCallback^ pCallback)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- m_pSipStack->setDebugCallback(tsk_null);
- rtSafeDelete(m_pDebugCallback);
- if(!pCallback)
- {
- return true;
- }
+ m_pSipStack->setDebugCallback(tsk_null);
+ rtSafeDelete(m_pDebugCallback);
+ if(!pCallback) {
+ return true;
+ }
- m_pDebugCallback = ref new rtDDebugCallback(pCallback);
- return m_pSipStack->setDebugCallback(const_cast<DDebugCallback*>(m_pDebugCallback->getWrappedCallback()));
+ m_pDebugCallback = ref new rtDDebugCallback(pCallback);
+ return m_pSipStack->setDebugCallback(const_cast<DDebugCallback*>(m_pDebugCallback->getWrappedCallback()));
}
bool rtSipStack::setDisplayName(Platform::String^ display_name)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setDisplayName(rtString::toUtf8(display_name).data());
+ return m_pSipStack->setDisplayName(rtString::toUtf8(display_name).data());
}
bool rtSipStack::setRealm(Platform::String^ realm_uri)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setRealm(rtString::toUtf8(realm_uri).data());
+ return m_pSipStack->setRealm(rtString::toUtf8(realm_uri).data());
}
bool rtSipStack::setIMPI(Platform::String^ impi)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIMPI(rtString::toUtf8(impi).data());
+ return m_pSipStack->setIMPI(rtString::toUtf8(impi).data());
}
bool rtSipStack::setIMPU(Platform::String^ impu_uri)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIMPU(rtString::toUtf8(impu_uri).data());
+ return m_pSipStack->setIMPU(rtString::toUtf8(impu_uri).data());
}
bool rtSipStack::setPassword(Platform::String^ password)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setPassword(rtString::toUtf8(password).data());
+ return m_pSipStack->setPassword(rtString::toUtf8(password).data());
}
bool rtSipStack::setAMF(Platform::String^ amf)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setAMF(rtString::toUtf8(amf).data());
+ return m_pSipStack->setAMF(rtString::toUtf8(amf).data());
}
bool rtSipStack::setOperatorId(Platform::String^ opid)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setOperatorId(rtString::toUtf8(opid).data());
+ return m_pSipStack->setOperatorId(rtString::toUtf8(opid).data());
}
bool rtSipStack::setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setProxyCSCF(
- rtString::toUtf8(fqdn).data(),
- port,
- rtString::toUtf8(transport).data(),
- rtString::toUtf8(ipversion).data()
- );
+ return m_pSipStack->setProxyCSCF(
+ rtString::toUtf8(fqdn).data(),
+ port,
+ rtString::toUtf8(transport).data(),
+ rtString::toUtf8(ipversion).data()
+ );
}
bool rtSipStack::setLocalIP(Platform::String^ ip, Platform::String^ transport)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data(), rtString::toUtf8(transport).data());
+ return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data(), rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalIP(Platform::String^ ip)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data());
+ return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data());
}
bool rtSipStack::setLocalPort(unsigned short port, Platform::String^ transport)
{
- return m_pSipStack->setLocalPort(port, rtString::toUtf8(transport).data());
+ return m_pSipStack->setLocalPort(port, rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalPort(unsigned short port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalPort(port);
+ return m_pSipStack->setLocalPort(port);
}
bool rtSipStack::setEarlyIMS(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setEarlyIMS(enabled);
+ return m_pSipStack->setEarlyIMS(enabled);
}
bool rtSipStack::addHeader(Platform::String^ name, Platform::String^ value)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
+ return m_pSipStack->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtSipStack::removeHeader(Platform::String^ name)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeHeader(rtString::toUtf8(name).data());
+ return m_pSipStack->removeHeader(rtString::toUtf8(name).data());
}
bool rtSipStack::addDnsServer(Platform::String^ ip)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeHeader(rtString::toUtf8(ip).data());
+ return m_pSipStack->removeHeader(rtString::toUtf8(ip).data());
}
bool rtSipStack::setDnsDiscovery(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setDnsDiscovery(enabled);
+ return m_pSipStack->setDnsDiscovery(enabled);
}
bool rtSipStack::setAoR(Platform::String^ ip, int port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setAoR(rtString::toUtf8(ip).data(), port);
+ return m_pSipStack->setAoR(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSigCompParams(dms, sms, cpb, enablePresDict);
+ return m_pSipStack->setSigCompParams(dms, sms, cpb, enablePresDict);
}
bool rtSipStack::addSigCompCompartment(Platform::String^ compId)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->addSigCompCompartment(rtString::toUtf8(compId).data());
+ return m_pSipStack->addSigCompCompartment(rtString::toUtf8(compId).data());
}
bool rtSipStack::removeSigCompCompartment(Platform::String^ compId)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeSigCompCompartment(rtString::toUtf8(compId).data());
+ return m_pSipStack->removeSigCompCompartment(rtString::toUtf8(compId).data());
}
-
+
bool rtSipStack::setSTUNServer(Platform::String^ ip, unsigned short port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSTUNServer(rtString::toUtf8(ip).data(), port);
+ return m_pSipStack->setSTUNServer(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSTUNCred(Platform::String^ login, Platform::String^ password)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSTUNCred(rtString::toUtf8(login).data(), rtString::toUtf8(password).data());
+ return m_pSipStack->setSTUNCred(rtString::toUtf8(login).data(), rtString::toUtf8(password).data());
}
bool rtSipStack::setTLSSecAgree(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setTLSSecAgree(enabled);
+ return m_pSipStack->setTLSSecAgree(enabled);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSSLCertificates(rtString::toUtf8(privKey).data(), rtString::toUtf8(pubKey).data(), rtString::toUtf8(caKey).data(), verify);
+ return m_pSipStack->setSSLCertificates(rtString::toUtf8(privKey).data(), rtString::toUtf8(pubKey).data(), rtString::toUtf8(caKey).data(), verify);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return setSSLCertificates(privKey, pubKey, caKey, false);
+ return setSSLCertificates(privKey, pubKey, caKey, false);
}
bool rtSipStack::setIPSecSecAgree(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIPSecSecAgree(enabled);
+ return m_pSipStack->setIPSecSecAgree(enabled);
}
bool rtSipStack::setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIPSecParameters(rtString::toUtf8(algo).data(), rtString::toUtf8(ealgo).data(), rtString::toUtf8(mode).data(), rtString::toUtf8(proto).data());
+ return m_pSipStack->setIPSecParameters(rtString::toUtf8(algo).data(), rtString::toUtf8(ealgo).data(), rtString::toUtf8(mode).data(), rtString::toUtf8(proto).data());
}
-
+
Platform::String^ rtSipStack::dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsENUM(rtString::toUtf8(service).data(), rtString::toUtf8(e164num).data(), rtString::toUtf8(domain).data()));
+ return rtString::toString(m_pSipStack->dnsENUM(rtString::toUtf8(service).data(), rtString::toUtf8(e164num).data(), rtString::toUtf8(domain).data()));
}
#if COM_VISIBLE
rtDnsResult^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- unsigned short _port = 0;
- String^ address = rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), &_port));
- return ref new rtDnsResult(_port, address);
+ unsigned short _port = 0;
+ String^ address = rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), &_port));
+ return ref new rtDnsResult(_port, address);
}
rtDnsResult^ rtSipStack::dnsSrv(String^ service)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- unsigned short _port = 0;
- String^ address = rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), &_port));
- return ref new rtDnsResult(_port, address);
+ unsigned short _port = 0;
+ String^ address = rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), &_port));
+ return ref new rtDnsResult(_port, address);
}
String^ rtSipStack::getLocalIP(String^ protocol)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), tsk_null);
- String^ ip = rtString::toString(_ip);
- TSK_FREE(_ip);
- return ip;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), tsk_null);
+ String^ ip = rtString::toString(_ip);
+ TSK_FREE(_ip);
+ return ip;
}
uint16 rtSipStack::getLocalPort(String^ protocol)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- uint16 port = 0;
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), &port);
- TSK_FREE(_ip);
- return port;
+ uint16 port = 0;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), &port);
+ TSK_FREE(_ip);
+ return port;
}
#else
String^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
+ return rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
String^ rtSipStack::dnsSrv(String^ service, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
+ return rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
Platform::String^ rtSipStack::getLocalIPnPort(String^ protocol, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), ((unsigned short*)(void*)port));
- String^ ip = rtString::toString();
- TSK_FREE(_ip);
- return ip;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), ((unsigned short*)(void*)port));
+ String^ ip = rtString::toString();
+ TSK_FREE(_ip);
+ return ip;
}
#endif /* COM_VISIBLE */
Platform::String^ rtSipStack::getPreferredIdentity()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->getPreferredIdentity());
+ return rtString::toString(m_pSipStack->getPreferredIdentity());
}
bool rtSipStack::isValid()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->isValid();
+ return m_pSipStack->isValid();
}
bool rtSipStack::stop()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->stop();
+ return m_pSipStack->stop();
}
-
+
bool rtSipStack::initialize()
{
- return SipStack::initialize();
+ return SipStack::initialize();
}
bool rtSipStack::deInitialize()
{
- return SipStack::deInitialize();
+ return SipStack::deInitialize();
}
void rtSipStack::setCodecs(enum class rt_tdav_codec_id_t codecs)
{
- return SipStack::setCodecs((tdav_codec_id_t) codecs);
+ return SipStack::setCodecs((tdav_codec_id_t) codecs);
}
bool rtSipStack::setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority)
{
- return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
+ return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
}
bool rtSipStack::isCodecSupported(enum class rt_tdav_codec_id_t codec_id)
{
- return SipStack::isCodecSupported((tdav_codec_id_t) codec_id);
+ return SipStack::isCodecSupported((tdav_codec_id_t) codec_id);
}
diff --git a/bindings/winrt/doubango_rt/src/rt_SipUri.cxx b/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
index 1398325..94565d4 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,24 +27,24 @@ using namespace std;
rtSipUri::rtSipUri(Platform::String^ uriString, Platform::String^ displayName)
{
- m_pSipUri = new SipUri(
- rtString::toUtf8(uriString).data(),
- rtString::toUtf8(displayName).data());
+ m_pSipUri = new SipUri(
+ rtString::toUtf8(uriString).data(),
+ rtString::toUtf8(displayName).data());
}
rtSipUri::rtSipUri(Platform::String^ uriString)
{
- m_pSipUri = new SipUri(rtString::toUtf8(uriString).data());
+ m_pSipUri = new SipUri(rtString::toUtf8(uriString).data());
}
rtSipUri::~rtSipUri()
{
- rtSafeDelete(m_pSipUri);
+ rtSafeDelete(m_pSipUri);
}
bool rtSipUri::isValid(Platform::String^ uri)
{
- return SipUri::isValid(rtString::toUtf8(uri).data());
+ return SipUri::isValid(rtString::toUtf8(uri).data());
}
// MIDL4069: Static members and instance members cannot have the same name on a runtime class. isValid
@@ -55,49 +55,48 @@ bool rtSipUri::isValid_()
bool rtSipUri::isValid()
#endif
{
- return (m_pSipUri && m_pSipUri->isValid());
+ return (m_pSipUri && m_pSipUri->isValid());
}
Platform::String^ rtSipUri::getScheme()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getScheme()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getScheme()) : nullptr;
}
Platform::String^ rtSipUri::getHost()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getHost()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getHost()) : nullptr;
}
unsigned short rtSipUri::getPort()
{
- return m_pSipUri ? m_pSipUri->getPort() : 0;
+ return m_pSipUri ? m_pSipUri->getPort() : 0;
}
Platform::String^ rtSipUri::getUserName()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getUserName()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getUserName()) : nullptr;
}
Platform::String^ rtSipUri::getPassword()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getPassword()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getPassword()) : nullptr;
}
Platform::String^ rtSipUri::getDisplayName()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getDisplayName()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getDisplayName()) : nullptr;
}
Platform::String^ rtSipUri::getParamValue(Platform::String^ name)
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getParamValue(rtString::toUtf8(name).data())) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getParamValue(rtString::toUtf8(name).data())) : nullptr;
}
void rtSipUri::setDisplayName(Platform::String^ displayName)
{
- if(m_pSipUri)
- {
- m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
- }
+ if(m_pSipUri) {
+ m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
+ }
}
diff --git a/bindings/winrt/doubango_rt/src/rt_String.cxx b/bindings/winrt/doubango_rt/src/rt_String.cxx
index 7d17f03..9ac6803 100755
--- a/bindings/winrt/doubango_rt/src/rt_String.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_String.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,34 +25,28 @@ using namespace std;
vector<char> rtString::toUtf8(String^ str)
{
- if(str != nullptr && !str->IsEmpty())
- {
- int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
- if (len > 0)
- {
- vector<char> vec(len + 1);
- if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len)
- {
- return std::move(vec);
- }
- }
- }
+ if(str != nullptr && !str->IsEmpty()) {
+ int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
+ if (len > 0) {
+ vector<char> vec(len + 1);
+ if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len) {
+ return std::move(vec);
+ }
+ }
+ }
return std::move(vector<char>(0));
}
String^ rtString::toString(char const* str)
{
- if(str)
- {
- int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
- if (len > 0)
- {
- vector<wchar_t> vec(len);
- if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len)
- {
- return ref new String(vec.data());
- }
- }
- }
- return nullptr;
+ if(str) {
+ int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
+ if (len > 0) {
+ vector<wchar_t> vec(len);
+ if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len) {
+ return ref new String(vec.data());
+ }
+ }
+ }
+ return nullptr;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_Xcap.cxx b/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/ \ No newline at end of file
diff --git a/plugins/audio_opensles/audio_opensles.cxx b/plugins/audio_opensles/audio_opensles.cxx
index 0cf5ea3..1d2e864 100755
--- a/plugins/audio_opensles/audio_opensles.cxx
+++ b/plugins/audio_opensles/audio_opensles.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -29,93 +29,87 @@
#include "tsk_safeobj.h"
#include "tsk_debug.h"
-typedef enum PLUGIN_INDEX_E
-{
- PLUGIN_INDEX_AUDIO_CONSUMER,
- PLUGIN_INDEX_AUDIO_PRODUCER,
- PLUGIN_INDEX_COUNT
+typedef enum PLUGIN_INDEX_E {
+ PLUGIN_INDEX_AUDIO_CONSUMER,
+ PLUGIN_INDEX_AUDIO_PRODUCER,
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER: return tsk_plugin_def_type_consumer;
- case PLUGIN_INDEX_AUDIO_PRODUCER: return tsk_plugin_def_type_producer;
- default:
- {
- AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ return tsk_plugin_def_type_consumer;
+ case PLUGIN_INDEX_AUDIO_PRODUCER:
+ return tsk_plugin_def_type_producer;
+ default: {
+ AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
+ }
+ }
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return tsk_plugin_def_media_type_audio;
- }
- default:
- {
- AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return tsk_plugin_def_media_type_audio;
+ }
+ default: {
+ AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
+ }
+ }
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- {
- return audio_consumer_opensles_plugin_def_t;
- }
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return audio_producer_opensles_plugin_def_t;
- }
- default:
- {
- AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER: {
+ return audio_consumer_opensles_plugin_def_t;
+ }
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return audio_producer_opensles_plugin_def_t;
+ }
+ default: {
+ AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
+ }
+ }
}
//
// SLES AudioInstance
//
-typedef struct audio_opensles_instance_s
-{
- TSK_DECLARE_OBJECT;
-
- uint64_t sessionId;
-
- bool isStarted;
-
- bool isConsumerPrepared;
- bool isConsumerStarted;
- bool isProducerPrepared;
- bool isProducerStarted;
-
- bool isSpeakerAvailable;
- bool isPlayoutAvailable;
- bool isRecordingAvailable;
-
- SLAudioDevice* device;
- SLAudioDeviceCallbackImpl* callback;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct audio_opensles_instance_s {
+ TSK_DECLARE_OBJECT;
+
+ uint64_t sessionId;
+
+ bool isStarted;
+
+ bool isConsumerPrepared;
+ bool isConsumerStarted;
+ bool isProducerPrepared;
+ bool isProducerStarted;
+
+ bool isSpeakerAvailable;
+ bool isPlayoutAvailable;
+ bool isRecordingAvailable;
+
+ SLAudioDevice* device;
+ SLAudioDeviceCallbackImpl* callback;
+
+ TSK_DECLARE_SAFEOBJ;
}
audio_opensles_instance_t;
typedef tsk_list_t audio_opensles_instances_L_t;
@@ -124,442 +118,442 @@ static audio_opensles_instances_L_t* __audioInstances = tsk_null;
static tsk_object_t* audio_opensles_instance_ctor(tsk_object_t * self, va_list * app)
{
- audio_opensles_instance_t* audioInstance = (audio_opensles_instance_t*)self;
- if(audioInstance){
- tsk_safeobj_init(audioInstance);
- }
- return self;
+ audio_opensles_instance_t* audioInstance = (audio_opensles_instance_t*)self;
+ if(audioInstance) {
+ tsk_safeobj_init(audioInstance);
+ }
+ return self;
}
static tsk_object_t* audio_opensles_instance_dtor(tsk_object_t * self)
-{
- AUDIO_OPENSLES_DEBUG_INFO("Audio Instance destroyed");
- audio_opensles_instance_t* audioInstance = (audio_opensles_instance_t*)self;
- if(audioInstance){
+{
+ AUDIO_OPENSLES_DEBUG_INFO("Audio Instance destroyed");
+ audio_opensles_instance_t* audioInstance = (audio_opensles_instance_t*)self;
+ if(audioInstance) {
tsk_safeobj_lock(audioInstance);
- if(audioInstance->device){
- audioInstance->device->SetCallback(NULL);
- audioInstance->device->Terminate();
- delete audioInstance->device;
- audioInstance->device = tsk_null;
- }
- if(audioInstance->callback){
- delete audioInstance->callback;
- audioInstance->callback = tsk_null;
- }
+ if(audioInstance->device) {
+ audioInstance->device->SetCallback(NULL);
+ audioInstance->device->Terminate();
+ delete audioInstance->device;
+ audioInstance->device = tsk_null;
+ }
+ if(audioInstance->callback) {
+ delete audioInstance->callback;
+ audioInstance->callback = tsk_null;
+ }
tsk_safeobj_unlock(audioInstance);
-
- tsk_safeobj_deinit(audioInstance);
- }
- return self;
+
+ tsk_safeobj_deinit(audioInstance);
+ }
+ return self;
}
static int audio_opensles_instance_cmp(const tsk_object_t *_ai1, const tsk_object_t *_ai2)
{
- return ((int)_ai1 - (int)_ai2);
+ return ((int)_ai1 - (int)_ai2);
}
-static const tsk_object_def_t audio_opensles_instance_def_s =
-{
- sizeof(audio_opensles_instance_t),
- audio_opensles_instance_ctor,
- audio_opensles_instance_dtor,
- audio_opensles_instance_cmp,
+static const tsk_object_def_t audio_opensles_instance_def_s = {
+ sizeof(audio_opensles_instance_t),
+ audio_opensles_instance_ctor,
+ audio_opensles_instance_dtor,
+ audio_opensles_instance_cmp,
};
const tsk_object_def_t *audio_opensles_instance_def_t = &audio_opensles_instance_def_s;
audio_opensles_instance_handle_t* audio_opensles_instance_create(uint64_t sessionId)
{
- audio_opensles_instance_t* audioInstance = tsk_null;
-
- // create list used to hold instances
- if(!__audioInstances && !(__audioInstances = tsk_list_create())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create new list");
- return tsk_null;
- }
-
- //= lock the list
- tsk_list_lock(__audioInstances);
-
- // find the instance from the list
- const tsk_list_item_t* item;
- tsk_list_foreach(item, __audioInstances){
- if(((audio_opensles_instance_t*)item->data)->sessionId == sessionId){
- audioInstance = (audio_opensles_instance_t*)tsk_object_ref(item->data);
- break;
- }
- }
-
- if(!audioInstance){
- audio_opensles_instance_t* _audioInstance;
- if(!(_audioInstance = (audio_opensles_instance_t*)tsk_object_new(&audio_opensles_instance_def_s))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create new audio instance");
- goto done;
- }
-
- if(!(_audioInstance->device = new SLAudioDevice())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio device");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
-
- if(!(_audioInstance->callback = new SLAudioDeviceCallbackImpl())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio transport");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
- if((_audioInstance->device->SetCallback(_audioInstance->callback))){
- AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::RegisterAudioCallback() failed");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
-
- if((_audioInstance->device->Init())){
- AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::Init() failed");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
-
- _audioInstance->sessionId = sessionId;
- audioInstance = _audioInstance;
- tsk_list_push_back_data(__audioInstances, (void**)&_audioInstance);
- }
+ audio_opensles_instance_t* audioInstance = tsk_null;
+
+ // create list used to hold instances
+ if(!__audioInstances && !(__audioInstances = tsk_list_create())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create new list");
+ return tsk_null;
+ }
+
+ //= lock the list
+ tsk_list_lock(__audioInstances);
+
+ // find the instance from the list
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, __audioInstances) {
+ if(((audio_opensles_instance_t*)item->data)->sessionId == sessionId) {
+ audioInstance = (audio_opensles_instance_t*)tsk_object_ref(item->data);
+ break;
+ }
+ }
+
+ if(!audioInstance) {
+ audio_opensles_instance_t* _audioInstance;
+ if(!(_audioInstance = (audio_opensles_instance_t*)tsk_object_new(&audio_opensles_instance_def_s))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create new audio instance");
+ goto done;
+ }
+
+ if(!(_audioInstance->device = new SLAudioDevice())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio device");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+
+ if(!(_audioInstance->callback = new SLAudioDeviceCallbackImpl())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio transport");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+ if((_audioInstance->device->SetCallback(_audioInstance->callback))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::RegisterAudioCallback() failed");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+
+ if((_audioInstance->device->Init())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::Init() failed");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+
+ _audioInstance->sessionId = sessionId;
+ audioInstance = _audioInstance;
+ tsk_list_push_back_data(__audioInstances, (void**)&_audioInstance);
+ }
done:
- //= unlock the list
- tsk_list_unlock(__audioInstances);
+ //= unlock the list
+ tsk_list_unlock(__audioInstances);
- return audioInstance;
+ return audioInstance;
}
int audio_opensles_instance_prepare_consumer(audio_opensles_instance_handle_t* _self, tmedia_consumer_t** _consumer)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- const struct audio_consumer_opensles_s* consumer = (const struct audio_consumer_opensles_s*)*_consumer;
- if(!self || !self->device || !self->callback || !_consumer || !*_consumer){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- if(self->isConsumerPrepared){
- AUDIO_OPENSLES_DEBUG_WARN("Consumer already prepared");
- return 0;
- }
-
- int ret;
- bool _bool;
-
- tsk_safeobj_lock(self);
-
- self->callback->SetConsumer(consumer);
-
- if((ret = self->device->SpeakerIsAvailable(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("SpeakerIsAvailable() failed with error code=%d", ret);
- }
- else{
- if(!_bool){
- AUDIO_OPENSLES_DEBUG_ERROR("SpeakerIsAvailable() returned false");
- }
- self->isSpeakerAvailable = _bool;
- }
-
- if((ret = self->device->InitSpeaker())){
- AUDIO_OPENSLES_DEBUG_ERROR("InitSpeaker() failed with error code=%d", ret);
- }
- else if((ret = self->device->SetSpeakerOn(audio_consumer_opensles_is_speakerOn(consumer)))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetSpeakerOn() failed with error code=%d", ret);
- }
-
- if((ret = self->device->PlayoutIsAvailable(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("PlayoutIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- AUDIO_OPENSLES_DEBUG_ERROR("PlayoutIsAvailable() returned false");
- }
- self->isPlayoutAvailable = _bool;
- }
-
- if((ret = self->device->SetStereoPlayout(((*_consumer)->audio.in.channels == 2)))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetStereoPlayout(%d==2) failed with error code=%d", (*_consumer)->audio.in.channels, ret);
- }
-
- //if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, (*_consumer)->audio.ptime))){
- // AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", (*_consumer)->audio.ptime, ret);
- //}
- // always request 10ms buffers
- if((ret = self->device->SetPlayoutBuffer(10))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", 10, ret);
- }
-
- int playoutSampleRate = (*_consumer)->audio.out.rate ? (*_consumer)->audio.out.rate : (*_consumer)->audio.in.rate;
- if((ret = self->device->SetPlayoutSampleRate(playoutSampleRate))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutSampleRate(%d) failed with error code=%d", playoutSampleRate, ret);
- }
-
- if((ret = self->device->InitPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::InitPlayout() failed with error code = %d", ret);
- goto done;
- }
-
- // init output parameters
- if((ret = self->device->StereoPlayout(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("StereoPlayout() failed with error code=%d", ret);
- }
- else{
- (*_consumer)->audio.out.channels = (_bool ? 2 : 1);
- }
- if((ret = self->device->PlayoutSampleRate(&playoutSampleRate))){
- AUDIO_OPENSLES_DEBUG_ERROR("PlayoutSampleRate() failed with error code=%d", ret);
- }
- else{
- (*_consumer)->audio.out.rate = playoutSampleRate;
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ const struct audio_consumer_opensles_s* consumer = (const struct audio_consumer_opensles_s*)*_consumer;
+ if(!self || !self->device || !self->callback || !_consumer || !*_consumer) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ if(self->isConsumerPrepared) {
+ AUDIO_OPENSLES_DEBUG_WARN("Consumer already prepared");
+ return 0;
+ }
+
+ int ret;
+ bool _bool;
+
+ tsk_safeobj_lock(self);
+
+ self->callback->SetConsumer(consumer);
+
+ if((ret = self->device->SpeakerIsAvailable(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SpeakerIsAvailable() failed with error code=%d", ret);
+ }
+ else {
+ if(!_bool) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SpeakerIsAvailable() returned false");
+ }
+ self->isSpeakerAvailable = _bool;
+ }
+
+ if((ret = self->device->InitSpeaker())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("InitSpeaker() failed with error code=%d", ret);
+ }
+ else if((ret = self->device->SetSpeakerOn(audio_consumer_opensles_is_speakerOn(consumer)))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetSpeakerOn() failed with error code=%d", ret);
+ }
+
+ if((ret = self->device->PlayoutIsAvailable(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("PlayoutIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ AUDIO_OPENSLES_DEBUG_ERROR("PlayoutIsAvailable() returned false");
+ }
+ self->isPlayoutAvailable = _bool;
+ }
+
+ if((ret = self->device->SetStereoPlayout(((*_consumer)->audio.in.channels == 2)))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetStereoPlayout(%d==2) failed with error code=%d", (*_consumer)->audio.in.channels, ret);
+ }
+
+ //if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, (*_consumer)->audio.ptime))){
+ // AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", (*_consumer)->audio.ptime, ret);
+ //}
+ // always request 10ms buffers
+ if((ret = self->device->SetPlayoutBuffer(10))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", 10, ret);
+ }
+
+ int playoutSampleRate = (*_consumer)->audio.out.rate ? (*_consumer)->audio.out.rate : (*_consumer)->audio.in.rate;
+ if((ret = self->device->SetPlayoutSampleRate(playoutSampleRate))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetPlayoutSampleRate(%d) failed with error code=%d", playoutSampleRate, ret);
+ }
+
+ if((ret = self->device->InitPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::InitPlayout() failed with error code = %d", ret);
+ goto done;
+ }
+
+ // init output parameters
+ if((ret = self->device->StereoPlayout(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StereoPlayout() failed with error code=%d", ret);
+ }
+ else {
+ (*_consumer)->audio.out.channels = (_bool ? 2 : 1);
+ }
+ if((ret = self->device->PlayoutSampleRate(&playoutSampleRate))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("PlayoutSampleRate() failed with error code=%d", ret);
+ }
+ else {
+ (*_consumer)->audio.out.rate = playoutSampleRate;
+ }
done:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- self->isConsumerPrepared = (ret == 0);
+ self->isConsumerPrepared = (ret == 0);
- return ret;
+ return ret;
}
int audio_opensles_instance_prepare_producer(audio_opensles_instance_handle_t* _self, tmedia_producer_t** _producer)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device || !self->callback || !_producer || !*_producer){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- if(self->isProducerPrepared){
- AUDIO_OPENSLES_DEBUG_WARN("Producer already prepared");
- return 0;
- }
-
- int ret;
- bool _bool;
-
- tsk_safeobj_lock(self);
-
- self->callback->SetProducer((const struct audio_producer_opensles_s*)*_producer);
-
- if((ret = self->device->RecordingIsAvailable(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("RecordingIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- AUDIO_OPENSLES_DEBUG_ERROR("RecordingIsAvailable() returned false");
- }
- self->isRecordingAvailable = _bool;
- }
-
- if((ret = self->device->MicrophoneIsAvailable(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("MicrophoneIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- AUDIO_OPENSLES_DEBUG_ERROR("MicrophoneIsAvailable() returned false");
- }
- else{
- if((ret = self->device->InitMicrophone())){
- AUDIO_OPENSLES_DEBUG_ERROR("InitMicrophone() failed with error code =%d", ret);
- }
- }
- }
-
- if((ret = self->device->SetStereoRecording(((*_producer)->audio.channels == 2)))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetStereoRecording(%d==2) failed with error code=%d", (*_producer)->audio.channels, ret);
- }
-
- int recordingSampleRate = (*_producer)->audio.rate;
- if((ret = self->device->SetRecordingSampleRate(recordingSampleRate))){
- AUDIO_OPENSLES_DEBUG_ERROR("SetRecordingSampleRate(%d) failed with error code=%d", recordingSampleRate, ret);
- }
-
- if((ret = self->device->InitRecording())){
- AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::InitRecording() failed with error code = %d", ret);
- goto done;
- }
-
- // init output parameters
- if((ret = self->device->StereoRecording(&_bool))){
- AUDIO_OPENSLES_DEBUG_ERROR("StereoRecording() failed with error code=%d", ret);
- }
- else{
- (*_producer)->audio.channels = (_bool ? 2 : 1);
- }
- if((ret = self->device->RecordingSampleRate(&recordingSampleRate))){
- AUDIO_OPENSLES_DEBUG_ERROR("RecordingSampleRate() failed with error code=%d", ret);
- }
- else{
- (*_producer)->audio.rate = recordingSampleRate;
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device || !self->callback || !_producer || !*_producer) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ if(self->isProducerPrepared) {
+ AUDIO_OPENSLES_DEBUG_WARN("Producer already prepared");
+ return 0;
+ }
+
+ int ret;
+ bool _bool;
+
+ tsk_safeobj_lock(self);
+
+ self->callback->SetProducer((const struct audio_producer_opensles_s*)*_producer);
+
+ if((ret = self->device->RecordingIsAvailable(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("RecordingIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ AUDIO_OPENSLES_DEBUG_ERROR("RecordingIsAvailable() returned false");
+ }
+ self->isRecordingAvailable = _bool;
+ }
+
+ if((ret = self->device->MicrophoneIsAvailable(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("MicrophoneIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ AUDIO_OPENSLES_DEBUG_ERROR("MicrophoneIsAvailable() returned false");
+ }
+ else {
+ if((ret = self->device->InitMicrophone())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("InitMicrophone() failed with error code =%d", ret);
+ }
+ }
+ }
+
+ if((ret = self->device->SetStereoRecording(((*_producer)->audio.channels == 2)))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetStereoRecording(%d==2) failed with error code=%d", (*_producer)->audio.channels, ret);
+ }
+
+ int recordingSampleRate = (*_producer)->audio.rate;
+ if((ret = self->device->SetRecordingSampleRate(recordingSampleRate))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("SetRecordingSampleRate(%d) failed with error code=%d", recordingSampleRate, ret);
+ }
+
+ if((ret = self->device->InitRecording())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("AudioDeviceModule::InitRecording() failed with error code = %d", ret);
+ goto done;
+ }
+
+ // init output parameters
+ if((ret = self->device->StereoRecording(&_bool))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StereoRecording() failed with error code=%d", ret);
+ }
+ else {
+ (*_producer)->audio.channels = (_bool ? 2 : 1);
+ }
+ if((ret = self->device->RecordingSampleRate(&recordingSampleRate))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("RecordingSampleRate() failed with error code=%d", ret);
+ }
+ else {
+ (*_producer)->audio.rate = recordingSampleRate;
+ }
done:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- self->isProducerPrepared = (ret == 0);
+ self->isProducerPrepared = (ret == 0);
- return ret;
+ return ret;
}
int audio_opensles_instance_start_consumer(audio_opensles_instance_handle_t* _self)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device || !self->callback){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- if(!self->isConsumerPrepared){
- AUDIO_OPENSLES_DEBUG_ERROR("Consumer not prepared");
- goto done;
- }
-
- if(self->isConsumerStarted){
- AUDIO_OPENSLES_DEBUG_WARN("Consumer already started");
- goto done;
- }
-
- if(self->isPlayoutAvailable){
- int ret;
- if((ret = self->device->StartPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("StartPlayout() failed with error code = %d", ret);
- }
-
- self->isConsumerStarted = self->device->Playing();
- AUDIO_OPENSLES_DEBUG_INFO("isPlaying=%s", (self->isConsumerPrepared ? "true" : "false"));
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device || !self->callback) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ if(!self->isConsumerPrepared) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Consumer not prepared");
+ goto done;
+ }
+
+ if(self->isConsumerStarted) {
+ AUDIO_OPENSLES_DEBUG_WARN("Consumer already started");
+ goto done;
+ }
+
+ if(self->isPlayoutAvailable) {
+ int ret;
+ if((ret = self->device->StartPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StartPlayout() failed with error code = %d", ret);
+ }
+
+ self->isConsumerStarted = self->device->Playing();
+ AUDIO_OPENSLES_DEBUG_INFO("isPlaying=%s", (self->isConsumerPrepared ? "true" : "false"));
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isConsumerStarted ? 0 : -1);
+ tsk_safeobj_unlock(self);
+ return (self->isConsumerStarted ? 0 : -1);
}
int audio_opensles_instance_start_producer(audio_opensles_instance_handle_t* _self)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device || !self->callback){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- if(!self->isProducerPrepared){
- AUDIO_OPENSLES_DEBUG_ERROR("Producer not prepared");
- goto done;
- }
-
- if(self->isProducerStarted){
- AUDIO_OPENSLES_DEBUG_WARN("Consumer already started");
- goto done;
- }
-
- if(self->isRecordingAvailable){
- int ret;
- if((ret = self->device->StartRecording())){
- AUDIO_OPENSLES_DEBUG_ERROR("StartRecording() failed with error code = %d", ret);
- }
-
- self->isProducerStarted = self->device->Recording();
- AUDIO_OPENSLES_DEBUG_INFO("isRecording=%s", (self->isProducerStarted ? "true" : "false"));
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device || !self->callback) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ if(!self->isProducerPrepared) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Producer not prepared");
+ goto done;
+ }
+
+ if(self->isProducerStarted) {
+ AUDIO_OPENSLES_DEBUG_WARN("Consumer already started");
+ goto done;
+ }
+
+ if(self->isRecordingAvailable) {
+ int ret;
+ if((ret = self->device->StartRecording())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StartRecording() failed with error code = %d", ret);
+ }
+
+ self->isProducerStarted = self->device->Recording();
+ AUDIO_OPENSLES_DEBUG_INFO("isRecording=%s", (self->isProducerStarted ? "true" : "false"));
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isProducerStarted ? 0 : -1);
+ tsk_safeobj_unlock(self);
+ return (self->isProducerStarted ? 0 : -1);
}
int audio_opensles_instance_stop_consumer(audio_opensles_instance_handle_t* _self)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device || !self->callback){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if(!self->isConsumerStarted){
- goto done;
- }
-
- int ret;
- if((ret = self->device->StopPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("StopPlayout() failed with error code = %d", ret);
- }
- else{
- self->isConsumerStarted = self->device->Playing();
- self->isConsumerPrepared = false;
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device || !self->callback) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!self->isConsumerStarted) {
+ goto done;
+ }
+
+ int ret;
+ if((ret = self->device->StopPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StopPlayout() failed with error code = %d", ret);
+ }
+ else {
+ self->isConsumerStarted = self->device->Playing();
+ self->isConsumerPrepared = false;
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isConsumerStarted ? -1 : 0);
+ tsk_safeobj_unlock(self);
+ return (self->isConsumerStarted ? -1 : 0);
}
int audio_opensles_instance_stop_producer(audio_opensles_instance_handle_t* _self)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device || !self->callback){
- AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if(!self->isProducerStarted){
- goto done;
- }
-
- int ret;
- if((ret = self->device->StopRecording())){
- AUDIO_OPENSLES_DEBUG_ERROR("StopRecording() failed with error code = %d", ret);
- }
- else{
- self->isProducerStarted = self->device->Recording();
- self->isProducerPrepared = false;
- }
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device || !self->callback) {
+ AUDIO_OPENSLES_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!self->isProducerStarted) {
+ goto done;
+ }
+
+ int ret;
+ if((ret = self->device->StopRecording())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("StopRecording() failed with error code = %d", ret);
+ }
+ else {
+ self->isProducerStarted = self->device->Recording();
+ self->isProducerPrepared = false;
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isProducerStarted ? -1 : 0);
+ tsk_safeobj_unlock(self);
+ return (self->isProducerStarted ? -1 : 0);
}
int audio_opensles_instance_set_speakerOn(audio_opensles_instance_handle_t* _self, bool speakerOn)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device ){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->device->SetSpeakerOn(speakerOn);
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device ) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->device->SetSpeakerOn(speakerOn);
}
int audio_opensles_instance_set_microphone_volume(audio_opensles_instance_handle_t* _self, int32_t volume)
{
- audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
- if(!self || !self->device ){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->device->SetMicrophoneVolume(volume);
+ audio_opensles_instance_t* self = (audio_opensles_instance_t*)_self;
+ if(!self || !self->device ) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->device->SetMicrophoneVolume(volume);
}
-int audio_opensles_instance_destroy(audio_opensles_instance_handle_t** _self){
- if(!_self || !*_self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_lock(__audioInstances);
- if(tsk_object_get_refcount(*_self)==1){
- tsk_list_remove_item_by_data(__audioInstances, *_self);
- }
- else {
- tsk_object_unref(*_self);
- }
- tsk_list_unlock(__audioInstances);
- *_self = tsk_null;
- return 0;
+int audio_opensles_instance_destroy(audio_opensles_instance_handle_t** _self)
+{
+ if(!_self || !*_self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_lock(__audioInstances);
+ if(tsk_object_get_refcount(*_self)==1) {
+ tsk_list_remove_item_by_data(__audioInstances, *_self);
+ }
+ else {
+ tsk_object_unref(*_self);
+ }
+ tsk_list_unlock(__audioInstances);
+ *_self = tsk_null;
+ return 0;
}
diff --git a/plugins/audio_opensles/audio_opensles.h b/plugins/audio_opensles/audio_opensles.h
index 7837509..e96966e 100755
--- a/plugins/audio_opensles/audio_opensles.h
+++ b/plugins/audio_opensles/audio_opensles.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/audio_opensles/audio_opensles_config.h b/plugins/audio_opensles/audio_opensles_config.h
index a495608..6967492 100755
--- a/plugins/audio_opensles/audio_opensles_config.h
+++ b/plugins/audio_opensles/audio_opensles_config.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -66,18 +66,18 @@
# define AUDIO_OPENSLES_GEXTERN extern
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define AUDIO_OPENSLES_BEGIN_DECLS extern "C" {
# define AUDIO_OPENSLES_END_DECLS }
#else
-# define AUDIO_OPENSLES_BEGIN_DECLS
+# define AUDIO_OPENSLES_BEGIN_DECLS
# define AUDIO_OPENSLES_END_DECLS
#endif
#ifdef _MSC_VER
#if HAVE_FFMPEG // FFMPeg warnings (treated as errors)
-# pragma warning (disable:4244)
+# pragma warning (disable:4244)
#endif
# define inline __inline
# define _CRT_SECURE_NO_WARNINGS
@@ -94,7 +94,7 @@
#endif
#if HAVE_CONFIG_H
- #include "../config.h"
+#include "../config.h"
#endif
#if AUDIO_OPENSLES_UNDER_ANDROID
diff --git a/plugins/audio_opensles/audio_opensles_consumer.cxx b/plugins/audio_opensles/audio_opensles_consumer.cxx
index 57acd7f..5585316 100755
--- a/plugins/audio_opensles/audio_opensles_consumer.cxx
+++ b/plugins/audio_opensles/audio_opensles_consumer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,172 +25,173 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct audio_consumer_opensles_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
- audio_opensles_instance_handle_t* audioInstHandle;
- bool isSpeakerOn;
- struct{
- void* ptr;
- bool isFull;
- int size;
- int index;
- } buffer;
+typedef struct audio_consumer_opensles_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+ audio_opensles_instance_handle_t* audioInstHandle;
+ bool isSpeakerOn;
+ struct {
+ void* ptr;
+ bool isFull;
+ int size;
+ int index;
+ } buffer;
}
audio_consumer_opensles_t;
int audio_consumer_opensles_get_data_10ms(const audio_consumer_opensles_t* _self, void* audioSamples, int nSamples, int nBytesPerSample, int nChannels, int samplesPerSec, uint32_t &nSamplesOut)
{
- nSamplesOut = 0;
- if(!_self || !audioSamples || !nSamples){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((nSamples != (samplesPerSec / 100))){
- AUDIO_OPENSLES_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
- return -2;
- }
- if((nBytesPerSample != (TMEDIA_CONSUMER(_self)->audio.bits_per_sample >> 3))){
- AUDIO_OPENSLES_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
- return -3;
- }
- if((nChannels != TMEDIA_CONSUMER(_self)->audio.out.channels)){
- AUDIO_OPENSLES_DEBUG_ERROR("Playout - %d not the expected number of channels but should be %d", nChannels, TMEDIA_CONSUMER(_self)->audio.out.channels);
- return -4;
- }
-
- audio_consumer_opensles_t* self = const_cast<audio_consumer_opensles_t*>(_self);
-
- if(self->buffer.index == self->buffer.size){
- if((tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->buffer.ptr, self->buffer.size)) != self->buffer.size){
- nSamplesOut = 0;
- self->buffer.index = self->buffer.size;
- return 0;
- }
- self->buffer.index = 0;
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
- }
-
- int nSamplesInBits = (nSamples * nBytesPerSample);
- if(_self->buffer.index + nSamplesInBits <= _self->buffer.size){
- memcpy(audioSamples, (((uint8_t*)self->buffer.ptr) + self->buffer.index), nSamplesInBits);
- }
- self->buffer.index += nSamplesInBits;
- TSK_CLAMP(0, self->buffer.index, self->buffer.size);
- nSamplesOut = nSamples;
-
- return 0;
+ nSamplesOut = 0;
+ if(!_self || !audioSamples || !nSamples) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((nSamples != (samplesPerSec / 100))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
+ return -2;
+ }
+ if((nBytesPerSample != (TMEDIA_CONSUMER(_self)->audio.bits_per_sample >> 3))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
+ return -3;
+ }
+ if((nChannels != TMEDIA_CONSUMER(_self)->audio.out.channels)) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Playout - %d not the expected number of channels but should be %d", nChannels, TMEDIA_CONSUMER(_self)->audio.out.channels);
+ return -4;
+ }
+
+ audio_consumer_opensles_t* self = const_cast<audio_consumer_opensles_t*>(_self);
+
+ if(self->buffer.index == self->buffer.size) {
+ if((tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->buffer.ptr, self->buffer.size)) != self->buffer.size) {
+ nSamplesOut = 0;
+ self->buffer.index = self->buffer.size;
+ return 0;
+ }
+ self->buffer.index = 0;
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
+ }
+
+ int nSamplesInBits = (nSamples * nBytesPerSample);
+ if(_self->buffer.index + nSamplesInBits <= _self->buffer.size) {
+ memcpy(audioSamples, (((uint8_t*)self->buffer.ptr) + self->buffer.index), nSamplesInBits);
+ }
+ self->buffer.index += nSamplesInBits;
+ TSK_CLAMP(0, self->buffer.index, self->buffer.size);
+ nSamplesOut = nSamples;
+
+ return 0;
}
bool audio_consumer_opensles_is_speakerOn(const audio_consumer_opensles_t* self)
{
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return false;
- }
- return self->isSpeakerOn;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+ return self->isSpeakerOn;
}
/* ============ Media Consumer Interface ================= */
static int audio_consumer_opensles_set(tmedia_consumer_t* _self, const tmedia_param_t* param)
{
- audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
- int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
-
- if(ret == 0){
- if(tsk_striequals(param->key, "volume")){
-
- }
- else if(tsk_striequals(param->key, "speaker-on")){
- self->isSpeakerOn = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- if(self->audioInstHandle){
- return audio_opensles_instance_set_speakerOn(self->audioInstHandle, self->isSpeakerOn);
- }
- else return 0; // will be set when instance is initialized
- }
- }
-
- return ret;
+ audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
+ int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+
+ if(ret == 0) {
+ if(tsk_striequals(param->key, "volume")) {
+
+ }
+ else if(tsk_striequals(param->key, "speaker-on")) {
+ self->isSpeakerOn = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ if(self->audioInstHandle) {
+ return audio_opensles_instance_set_speakerOn(self->audioInstHandle, self->isSpeakerOn);
+ }
+ else {
+ return 0; // will be set when instance is initialized
+ }
+ }
+ }
+
+ return ret;
}
static int audio_consumer_opensles_prepare(tmedia_consumer_t* _self, const tmedia_codec_t* codec)
{
- audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // create audio instance
- if(!(self->audioInstHandle = audio_opensles_instance_create(TMEDIA_CONSUMER(self)->session_id))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio instance handle");
- return -1;
- }
-
- // initialize input parameters from the codec information
- TMEDIA_CONSUMER(self)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(self)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(self)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- AUDIO_OPENSLES_DEBUG_INFO("audio_consumer_opensles_prepare(channels=%d, rate=%d, ptime=%d)", codec->plugin->audio.channels, codec->plugin->rate, codec->plugin->audio.ptime);
-
- // prepare playout device and update output parameters
- int ret = audio_opensles_instance_prepare_consumer(self->audioInstHandle, &_self);
-
- // now that the producer is prepared we can initialize internal buffer using device caps
- if(ret == 0){
- // allocate buffer
- int xsize = ((TMEDIA_CONSUMER(self)->audio.ptime * TMEDIA_CONSUMER(self)->audio.out.rate) / 1000) * (TMEDIA_CONSUMER(self)->audio.bits_per_sample >> 3);
- if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
- self->buffer.size = 0;
- return -1;
- }
- memset(self->buffer.ptr, 0, xsize);
- self->buffer.size = xsize;
- self->buffer.index = 0;
- self->buffer.isFull = false;
- }
- return ret;
+ audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // create audio instance
+ if(!(self->audioInstHandle = audio_opensles_instance_create(TMEDIA_CONSUMER(self)->session_id))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio instance handle");
+ return -1;
+ }
+
+ // initialize input parameters from the codec information
+ TMEDIA_CONSUMER(self)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(self)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(self)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ AUDIO_OPENSLES_DEBUG_INFO("audio_consumer_opensles_prepare(channels=%d, rate=%d, ptime=%d)", codec->plugin->audio.channels, codec->plugin->rate, codec->plugin->audio.ptime);
+
+ // prepare playout device and update output parameters
+ int ret = audio_opensles_instance_prepare_consumer(self->audioInstHandle, &_self);
+
+ // now that the producer is prepared we can initialize internal buffer using device caps
+ if(ret == 0) {
+ // allocate buffer
+ int xsize = ((TMEDIA_CONSUMER(self)->audio.ptime * TMEDIA_CONSUMER(self)->audio.out.rate) / 1000) * (TMEDIA_CONSUMER(self)->audio.bits_per_sample >> 3);
+ if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
+ self->buffer.size = 0;
+ return -1;
+ }
+ memset(self->buffer.ptr, 0, xsize);
+ self->buffer.size = xsize;
+ self->buffer.index = 0;
+ self->buffer.isFull = false;
+ }
+ return ret;
}
static int audio_consumer_opensles_start(tmedia_consumer_t* _self)
{
- audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_opensles_instance_start_consumer(self->audioInstHandle);
+ return audio_opensles_instance_start_consumer(self->audioInstHandle);
}
static int audio_consumer_opensles_consume(tmedia_consumer_t* _self, const void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
- if(!self || !data || !data_size){
- AUDIO_OPENSLES_DEBUG_ERROR("1Invalid parameter");
- return -1;
- }
- /* buffer is already decoded */
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), data, data_size, proto_hdr);
+ audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
+ if(!self || !data || !data_size) {
+ AUDIO_OPENSLES_DEBUG_ERROR("1Invalid parameter");
+ return -1;
+ }
+ /* buffer is already decoded */
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), data, data_size, proto_hdr);
}
static int audio_consumer_opensles_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int audio_consumer_opensles_stop(tmedia_consumer_t* _self)
{
- audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_consumer_opensles_t* self = (audio_consumer_opensles_t*)_self;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_opensles_instance_stop_consumer(self->audioInstHandle);
+ return audio_opensles_instance_stop_consumer(self->audioInstHandle);
}
@@ -200,54 +201,52 @@ static int audio_consumer_opensles_stop(tmedia_consumer_t* _self)
/* constructor */
static tsk_object_t* audio_consumer_opensles_ctor(tsk_object_t *_self, va_list * app)
{
- audio_consumer_opensles_t *self = (audio_consumer_opensles_t *)_self;
- if(self){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(self));
- /* init self */
-
- }
- return self;
+ audio_consumer_opensles_t *self = (audio_consumer_opensles_t *)_self;
+ if(self) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(self));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* audio_consumer_opensles_dtor(tsk_object_t *_self)
-{
- audio_consumer_opensles_t *self = (audio_consumer_opensles_t *)_self;
- if(self){
- /* stop */
- audio_consumer_opensles_stop(TMEDIA_CONSUMER(self));
- /* deinit self */
- if(self->audioInstHandle){
- audio_opensles_instance_destroy(&self->audioInstHandle);
- }
- TSK_FREE(self->buffer.ptr);
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(self));
- }
-
- return self;
+{
+ audio_consumer_opensles_t *self = (audio_consumer_opensles_t *)_self;
+ if(self) {
+ /* stop */
+ audio_consumer_opensles_stop(TMEDIA_CONSUMER(self));
+ /* deinit self */
+ if(self->audioInstHandle) {
+ audio_opensles_instance_destroy(&self->audioInstHandle);
+ }
+ TSK_FREE(self->buffer.ptr);
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t audio_consumer_opensles_def_s =
-{
- sizeof(audio_consumer_opensles_t),
- audio_consumer_opensles_ctor,
- audio_consumer_opensles_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t audio_consumer_opensles_def_s = {
+ sizeof(audio_consumer_opensles_t),
+ audio_consumer_opensles_ctor,
+ audio_consumer_opensles_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t audio_consumer_opensles_plugin_def_s =
-{
- &audio_consumer_opensles_def_s,
-
- tmedia_audio,
- "SLES audio consumer",
-
- audio_consumer_opensles_set,
- audio_consumer_opensles_prepare,
- audio_consumer_opensles_start,
- audio_consumer_opensles_consume,
- audio_consumer_opensles_pause,
- audio_consumer_opensles_stop
+static const tmedia_consumer_plugin_def_t audio_consumer_opensles_plugin_def_s = {
+ &audio_consumer_opensles_def_s,
+
+ tmedia_audio,
+ "SLES audio consumer",
+
+ audio_consumer_opensles_set,
+ audio_consumer_opensles_prepare,
+ audio_consumer_opensles_start,
+ audio_consumer_opensles_consume,
+ audio_consumer_opensles_pause,
+ audio_consumer_opensles_stop
};
const tmedia_consumer_plugin_def_t *audio_consumer_opensles_plugin_def_t = &audio_consumer_opensles_plugin_def_s;
diff --git a/plugins/audio_opensles/audio_opensles_consumer.h b/plugins/audio_opensles/audio_opensles_consumer.h
index 1702db6..786813b 100755
--- a/plugins/audio_opensles/audio_opensles_consumer.h
+++ b/plugins/audio_opensles/audio_opensles_consumer.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -22,7 +22,7 @@
AUDIO_OPENSLES_BEGIN_DECLS
-extern const struct tmedia_consumer_plugin_def_s *audio_consumer_opensles_plugin_def_t;
+extern const struct tmedia_consumer_plugin_def_s *audio_consumer_opensles_plugin_def_t;
int audio_consumer_opensles_get_data_10ms(const struct audio_consumer_opensles_s* self, void* audioSamples, int nSamples, int nBytesPerSample, int nChannels, int samplesPerSec, uint32_t &nSamplesOut);
bool audio_consumer_opensles_is_speakerOn(const struct audio_consumer_opensles_s* self);
diff --git a/plugins/audio_opensles/audio_opensles_device.cxx b/plugins/audio_opensles/audio_opensles_device.cxx
index 3c06bfc..e6fff79 100755
--- a/plugins/audio_opensles/audio_opensles_device.cxx
+++ b/plugins/audio_opensles/audio_opensles_device.cxx
@@ -23,64 +23,77 @@
#define CHECK_MICROPHONE_NOT_INITIALIZED() CHECK_FALSE(m_bMicrophoneInitialized, "Microphone initialized")
#if AUDIO_OPENSLES_UNDER_ANDROID
-static inline SLuint32 SL_SAMPLING_RATE(int RATE_INT){
- switch(RATE_INT){
- case 8000: return SL_SAMPLINGRATE_8;
- case 11025: return SL_SAMPLINGRATE_11_025;
- default:case 16000: return SL_SAMPLINGRATE_16;
- case 22050: return SL_SAMPLINGRATE_22_05;
- case 24000: return SL_SAMPLINGRATE_24;
- case 32000: return SL_SAMPLINGRATE_32;
- case 44100: return SL_SAMPLINGRATE_44_1;
- case 64000: return SL_SAMPLINGRATE_64;
- case 88200: return SL_SAMPLINGRATE_88_2;
- case 96000: return SL_SAMPLINGRATE_96;
- case 192000: return SL_SAMPLINGRATE_192;
- }
+static inline SLuint32 SL_SAMPLING_RATE(int RATE_INT)
+{
+ switch(RATE_INT) {
+ case 8000:
+ return SL_SAMPLINGRATE_8;
+ case 11025:
+ return SL_SAMPLINGRATE_11_025;
+ default:
+ case 16000:
+ return SL_SAMPLINGRATE_16;
+ case 22050:
+ return SL_SAMPLINGRATE_22_05;
+ case 24000:
+ return SL_SAMPLINGRATE_24;
+ case 32000:
+ return SL_SAMPLINGRATE_32;
+ case 44100:
+ return SL_SAMPLINGRATE_44_1;
+ case 64000:
+ return SL_SAMPLINGRATE_64;
+ case 88200:
+ return SL_SAMPLINGRATE_88_2;
+ case 96000:
+ return SL_SAMPLINGRATE_96;
+ case 192000:
+ return SL_SAMPLINGRATE_192;
+ }
}
#endif
SLAudioDevice::SLAudioDevice(const SLAudioDeviceCallback* pCallback):
#if AUDIO_OPENSLES_UNDER_ANDROID
-m_slEngineObject(NULL),
-m_slPlayer(NULL),
-m_slEngine(NULL),
-m_slPlayerPlay(NULL),
-m_slPlayerSimpleBufferQueue(NULL),
-m_slOutputMixObject(NULL),
-m_slSpeakerVolume(NULL),
-m_slRecorder(NULL),
-m_slRecorderRecord(NULL),
-m_slAudioIODeviceCapabilities(NULL),
-m_slRecorderSimpleBufferQueue(NULL),
-m_slMicVolume(NULL),
-_playQueueSeq(0),
-_recCurrentSeq(0),
-_recBufferTotalSize(0),
-_recQueueSeq(0),
+ m_slEngineObject(NULL),
+ m_slPlayer(NULL),
+ m_slEngine(NULL),
+ m_slPlayerPlay(NULL),
+ m_slPlayerSimpleBufferQueue(NULL),
+ m_slOutputMixObject(NULL),
+ m_slSpeakerVolume(NULL),
+ m_slRecorder(NULL),
+ m_slRecorderRecord(NULL),
+ m_slAudioIODeviceCapabilities(NULL),
+ m_slRecorderSimpleBufferQueue(NULL),
+ m_slMicVolume(NULL),
+ _playQueueSeq(0),
+ _recCurrentSeq(0),
+ _recBufferTotalSize(0),
+ _recQueueSeq(0),
#endif
-m_nMicDeviceId(0),
-m_pCallback(pCallback),
-m_bInitialized(false),
-m_bSpeakerInitialized(false),
-m_bSpeakerOn(false),
-m_bPlayoutInitialized(false),
-m_bRecordingInitialized(false),
-m_bMicrophoneInitialized(false),
-m_bStereoPlayout(false),
-m_bStereoRecording(false),
-m_nPlayoutSampleRate(PLAYOUT_SAMPLE_RATE),
-m_nRecordingSampleRate(RECORDING_SAMPLE_RATE),
-m_nRecordingBufferSize(RECORDING_BUFFER_SIZE),
-m_nPlayoutBufferSize(PLAYOUT_BUFFER_SIZE),
-m_bPlaying(false),
-m_bRecording(false),
-m_nSpeakerVolume(0),
-m_nMinSpeakerVolume(0),
-m_nMaxSpeakerVolume(0)
+ m_nMicDeviceId(0),
+ m_pCallback(pCallback),
+ m_bInitialized(false),
+ m_bSpeakerInitialized(false),
+ m_bSpeakerOn(false),
+ m_bPlayoutInitialized(false),
+ m_bRecordingInitialized(false),
+ m_bMicrophoneInitialized(false),
+ m_bStereoPlayout(false),
+ m_bStereoRecording(false),
+ m_nPlayoutSampleRate(PLAYOUT_SAMPLE_RATE),
+ m_nRecordingSampleRate(RECORDING_SAMPLE_RATE),
+ m_nRecordingBufferSize(RECORDING_BUFFER_SIZE),
+ m_nPlayoutBufferSize(PLAYOUT_BUFFER_SIZE),
+ m_bPlaying(false),
+ m_bRecording(false),
+ m_nSpeakerVolume(0),
+ m_nMinSpeakerVolume(0),
+ m_nMaxSpeakerVolume(0)
{
#if AUDIO_OPENSLES_UNDER_ANDROID
- memset(_playQueueBuffer, 0, sizeof(_playQueueBuffer));
+ memset(_playQueueBuffer, 0, sizeof(_playQueueBuffer));
memset(_recQueueBuffer, 0, sizeof(_recQueueBuffer));
memset(_recBuffer, 0, sizeof(_recBuffer));
memset(_recLength, 0, sizeof(_recLength));
@@ -94,22 +107,22 @@ SLAudioDevice::~SLAudioDevice()
}
int SLAudioDevice::SetCallback(const SLAudioDeviceCallback* pCallback)
-{
- m_pCallback = pCallback;
- return 0;
+{
+ m_pCallback = pCallback;
+ return 0;
}
int SLAudioDevice::Init()
{
- CHECK_FALSE(m_bInitialized, "Already initialized");
+ CHECK_FALSE(m_bInitialized, "Already initialized");
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::Init()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::Init()");
#if AUDIO_OPENSLES_UNDER_ANDROID
- SLresult slResult;
+ SLresult slResult;
SLEngineOption EngineOption[] = {
- { (SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE },
+ { (SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE },
};
slResult = slCreateEngine(&m_slEngineObject, 1, EngineOption, 0, NULL, NULL);
if (slResult != SL_RESULT_SUCCESS) {
@@ -126,152 +139,160 @@ int SLAudioDevice::Init()
}
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- m_bInitialized = true;
- AUDIO_OPENSLES_DEBUG_INFO("SL engine initialized");
- return 0;
+ m_bInitialized = true;
+ AUDIO_OPENSLES_DEBUG_INFO("SL engine initialized");
+ return 0;
}
bool SLAudioDevice::Initialized()
{
- return m_bInitialized;
+ return m_bInitialized;
}
int SLAudioDevice::SpeakerIsAvailable(bool *pAvailable)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_TRUE(m_bInitialized, "Not initialized");
- if(!pAvailable){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pAvailable) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pAvailable = true;
- return 0;
+ *pAvailable = true;
+ return 0;
}
int SLAudioDevice::InitSpeaker()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitSpeaker()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitSpeaker()");
- CHECK_TRUE(m_bInitialized, "Not initialized");
-
- if(m_bSpeakerInitialized){
- return 0;
- }
+ CHECK_TRUE(m_bInitialized, "Not initialized");
- m_bSpeakerInitialized = true;
- return 0;
+ if(m_bSpeakerInitialized) {
+ return 0;
+ }
+
+ m_bSpeakerInitialized = true;
+ return 0;
}
int SLAudioDevice::SetMaxSpeakerVolume(int nMaxSpeakerVolume)
{
- CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
- AUDIO_OPENSLES_DEBUG_INFO("SetMaxSpeakerVolume(%d)", nMaxSpeakerVolume);
- m_nMaxSpeakerVolume = nMaxSpeakerVolume;
- return 0;
+ CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("SetMaxSpeakerVolume(%d)", nMaxSpeakerVolume);
+ m_nMaxSpeakerVolume = nMaxSpeakerVolume;
+ return 0;
}
int SLAudioDevice::SetMinSpeakerVolume(int nMinSpeakerVolume)
{
- CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
- AUDIO_OPENSLES_DEBUG_INFO("SetMinSpeakerVolume(%d)", nMinSpeakerVolume);
- m_nMinSpeakerVolume = nMinSpeakerVolume;
- return 0;
+ CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("SetMinSpeakerVolume(%d)", nMinSpeakerVolume);
+ m_nMinSpeakerVolume = nMinSpeakerVolume;
+ return 0;
}
int SLAudioDevice::SetSpeakerVolume(int nSpeakerVolume)
{
- CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
- AUDIO_OPENSLES_DEBUG_INFO("SetSpeakerVolume(%d)", nSpeakerVolume);
- m_nSpeakerVolume = nSpeakerVolume;
- return 0;
+ CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("SetSpeakerVolume(%d)", nSpeakerVolume);
+ m_nSpeakerVolume = nSpeakerVolume;
+ return 0;
}
int SLAudioDevice::SetSpeakerOn(bool bSpeakerOn)
{
- CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
-
- AUDIO_OPENSLES_DEBUG_INFO("SetSpeakerOn(%s -> %s)", (m_bSpeakerOn ? "true" : "false"), (bSpeakerOn ? "true" : "false"));
- int ret = 0;
- bool oldValue = m_bSpeakerOn;
- m_bSpeakerOn = bSpeakerOn; // update value beacause use in PlayoutApplyNewConfig();
- if(m_bPlayoutInitialized && (oldValue != bSpeakerOn)){
- ret = PlayoutApplyNewConfig();
- }
-
- if(ret != 0){
- m_bSpeakerOn = oldValue;
- }
-
- return ret;
+ CHECK_TRUE(m_bSpeakerInitialized, "Speaker not initialized");
+
+ AUDIO_OPENSLES_DEBUG_INFO("SetSpeakerOn(%s -> %s)", (m_bSpeakerOn ? "true" : "false"), (bSpeakerOn ? "true" : "false"));
+ int ret = 0;
+ bool oldValue = m_bSpeakerOn;
+ m_bSpeakerOn = bSpeakerOn; // update value beacause use in PlayoutApplyNewConfig();
+ if(m_bPlayoutInitialized && (oldValue != bSpeakerOn)) {
+ ret = PlayoutApplyNewConfig();
+ }
+
+ if(ret != 0) {
+ m_bSpeakerOn = oldValue;
+ }
+
+ return ret;
}
int SLAudioDevice::PlayoutIsAvailable(bool *pAvailable)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_NOT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_NOT_INITIALIZED();
- if(!pAvailable){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pAvailable) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pAvailable = true;
- return 0;
+ *pAvailable = true;
+ return 0;
}
int SLAudioDevice::SetStereoPlayout(bool bEnabled)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_NOT_INITIALIZED();
- m_bStereoPlayout = bEnabled;
- return 0;
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_NOT_INITIALIZED();
+ m_bStereoPlayout = bEnabled;
+ return 0;
}
int SLAudioDevice::SetPlayoutBuffer(int nPlayoutBufferSize)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_NOT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_NOT_INITIALIZED();
- if(PLAYOUT_BUFFER_SIZE != nPlayoutBufferSize){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(PLAYOUT_BUFFER_SIZE != nPlayoutBufferSize) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- m_nPlayoutBufferSize = nPlayoutBufferSize;
- return 0;
+ m_nPlayoutBufferSize = nPlayoutBufferSize;
+ return 0;
}
int SLAudioDevice::SetPlayoutSampleRate(int nPlayoutSampleRate)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_NOT_INITIALIZED();
-
- AUDIO_OPENSLES_DEBUG_INFO("SetPlayoutSampleRate(%d)", nPlayoutSampleRate);
-
- switch(nPlayoutSampleRate){
- case 8000: case 11025: case 16000: case 22050: case 24000: case 32000: case 44100: case 64000: case 88200: case 96000: case 192000:
- {
- m_nPlayoutSampleRate = nPlayoutSampleRate;
- return 0;
- }
- default:
- {
- AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nPlayoutSampleRate);
- return -1;
- }
- }
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_NOT_INITIALIZED();
+
+ AUDIO_OPENSLES_DEBUG_INFO("SetPlayoutSampleRate(%d)", nPlayoutSampleRate);
+
+ switch(nPlayoutSampleRate) {
+ case 8000:
+ case 11025:
+ case 16000:
+ case 22050:
+ case 24000:
+ case 32000:
+ case 44100:
+ case 64000:
+ case 88200:
+ case 96000:
+ case 192000: {
+ m_nPlayoutSampleRate = nPlayoutSampleRate;
+ return 0;
+ }
+ default: {
+ AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nPlayoutSampleRate);
+ return -1;
+ }
+ }
}
int SLAudioDevice::InitPlayout()
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
-
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitPlayout()");
+ CHECK_TRUE(m_bInitialized, "Not initialized");
- if(m_bPlayoutInitialized){
- return 0;
- }
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitPlayout()");
+
+ if(m_bPlayoutInitialized) {
+ return 0;
+ }
if (m_bPlaying) {
AUDIO_OPENSLES_DEBUG_ERROR("Playout already started");
@@ -285,7 +306,7 @@ int SLAudioDevice::InitPlayout()
#if AUDIO_OPENSLES_UNDER_ANDROID
- if (m_slEngineObject == NULL || m_slEngine == NULL) {
+ if (m_slEngineObject == NULL || m_slEngine == NULL) {
AUDIO_OPENSLES_DEBUG_ERROR("SLObject or Engiine is NULL");
return -1;
}
@@ -305,68 +326,68 @@ int SLAudioDevice::InitPlayout()
req[i] = SL_BOOLEAN_FALSE;
}
ids[0] = SL_IID_ENVIRONMENTALREVERB;
-
+
if ((slResult = (*m_slEngine)->CreateOutputMix(m_slEngine, &m_slOutputMixObject, 1, ids, req)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("CreateOutputMix() for playout failed with error code = %d", slResult);
return -1;
}
-
+
if ((slResult = (*m_slOutputMixObject)->Realize(m_slOutputMixObject, SL_BOOLEAN_FALSE)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to realize SL Output Mix object for playout with error code = %d", slResult);
return -1;
}
-
+
simpleBufferQueue.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE;
simpleBufferQueue.numBuffers = N_PLAY_QUEUE_BUFFERS;
-
+
pcm.formatType = SL_DATAFORMAT_PCM;
- pcm.numChannels = m_bStereoPlayout ? 2 : 1;
- pcm.samplesPerSec = SL_SAMPLING_RATE(m_nPlayoutSampleRate);
+ pcm.numChannels = m_bStereoPlayout ? 2 : 1;
+ pcm.samplesPerSec = SL_SAMPLING_RATE(m_nPlayoutSampleRate);
pcm.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16;
pcm.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;
- pcm.channelMask = m_bStereoRecording ? (SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT) : SL_SPEAKER_FRONT_CENTER;
+ pcm.channelMask = m_bStereoRecording ? (SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT) : SL_SPEAKER_FRONT_CENTER;
pcm.endianness = SL_BYTEORDER_LITTLEENDIAN;
-
- audioSource.pFormat = (void *) &pcm;
+
+ audioSource.pFormat = (void *) &pcm;
audioSource.pLocator = (void *) &simpleBufferQueue;
locator_outputmix.locatorType = SL_DATALOCATOR_OUTPUTMIX;
locator_outputmix.outputMix = m_slOutputMixObject;
audioSink.pLocator = (void *) &locator_outputmix;
audioSink.pFormat = NULL;
-
+
ids[0] = SL_IID_ANDROIDSIMPLEBUFFERQUEUE;
ids[1] = SL_IID_EFFECTSEND;
- ids[2] = SL_IID_ANDROIDCONFIGURATION;
- ids[3] = SL_IID_VOLUME;
+ ids[2] = SL_IID_ANDROIDCONFIGURATION;
+ ids[3] = SL_IID_VOLUME;
req[0] = SL_BOOLEAN_TRUE;
req[1] = SL_BOOLEAN_TRUE;
- req[2] = SL_BOOLEAN_TRUE;
- req[3] = SL_BOOLEAN_TRUE;
+ req[2] = SL_BOOLEAN_TRUE;
+ req[3] = SL_BOOLEAN_TRUE;
// Create the player
if ((slResult = (*m_slEngine)->CreateAudioPlayer(m_slEngine, &m_slPlayer, &audioSource, &audioSink, 3, ids, req)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to create Audio Player with error code = %d", slResult);
return -1;
}
-
- // set stream type
- if(!m_bSpeakerOn){ // only set if speaker OFF, otherwise default is ON. "SL_ANDROID_STREAM_MEDIA" doen't look to work on all devices
- static SLAndroidConfigurationItf _playerStreamConfig;
- if((slResult = (*m_slPlayer)->GetInterface(m_slPlayer, SL_IID_ANDROIDCONFIGURATION, &_playerStreamConfig)) != SL_RESULT_SUCCESS){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to get player configuration with error code = %d", slResult);
- return -1;
- }
- else{
- static SLint32 _playerStreamType = m_bSpeakerOn ? SL_ANDROID_STREAM_MEDIA : SL_ANDROID_STREAM_VOICE;
- static SLint32 _playerStreamTypeSize = sizeof(SLint32);
- AUDIO_OPENSLES_DEBUG_INFO("_playerStreamType=%d", _playerStreamType);
- if((slResult = (*_playerStreamConfig)->SetConfiguration(_playerStreamConfig, SL_ANDROID_KEY_STREAM_TYPE, &_playerStreamType, _playerStreamTypeSize))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to set player stream type with error code = %d", slResult);
- return -2;
- }
- }
- }
+
+ // set stream type
+ if(!m_bSpeakerOn) { // only set if speaker OFF, otherwise default is ON. "SL_ANDROID_STREAM_MEDIA" doen't look to work on all devices
+ static SLAndroidConfigurationItf _playerStreamConfig;
+ if((slResult = (*m_slPlayer)->GetInterface(m_slPlayer, SL_IID_ANDROIDCONFIGURATION, &_playerStreamConfig)) != SL_RESULT_SUCCESS) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to get player configuration with error code = %d", slResult);
+ return -1;
+ }
+ else {
+ static SLint32 _playerStreamType = m_bSpeakerOn ? SL_ANDROID_STREAM_MEDIA : SL_ANDROID_STREAM_VOICE;
+ static SLint32 _playerStreamTypeSize = sizeof(SLint32);
+ AUDIO_OPENSLES_DEBUG_INFO("_playerStreamType=%d", _playerStreamType);
+ if((slResult = (*_playerStreamConfig)->SetConfiguration(_playerStreamConfig, SL_ANDROID_KEY_STREAM_TYPE, &_playerStreamType, _playerStreamTypeSize))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to set player stream type with error code = %d", slResult);
+ return -2;
+ }
+ }
+ }
// Realizing the player in synchronous mode
if ((slResult = (*m_slPlayer)->Realize(m_slPlayer, SL_BOOLEAN_FALSE)) != SL_RESULT_SUCCESS) {
@@ -384,53 +405,53 @@ int SLAudioDevice::InitPlayout()
}
// Setup to receive buffer queue event callbacks
- if ((slResult = (*m_slPlayerSimpleBufferQueue)->RegisterCallback(m_slPlayerSimpleBufferQueue, PlayerSimpleBufferQueueCallback, this)) != SL_RESULT_SUCCESS) {
+ if ((slResult = (*m_slPlayerSimpleBufferQueue)->RegisterCallback(m_slPlayerSimpleBufferQueue, PlayerSimpleBufferQueueCallback, this)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to register Player Callback");
return -1;
}
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- m_bPlayoutInitialized = true;
+ m_bPlayoutInitialized = true;
- AUDIO_OPENSLES_DEBUG_INFO("Playout initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("Playout initialized");
- return 0;
+ return 0;
}
int SLAudioDevice::StereoPlayout(bool *pEnabled)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_INITIALIZED();
- if(!pEnabled){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pEnabled) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pEnabled = m_bStereoPlayout;
- return 0;
+ *pEnabled = m_bStereoPlayout;
+ return 0;
}
int SLAudioDevice::PlayoutSampleRate(int *pPlayoutSampleRate)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_INITIALIZED();
- if(!pPlayoutSampleRate){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pPlayoutSampleRate) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pPlayoutSampleRate = m_nPlayoutSampleRate;
- return 0;
+ *pPlayoutSampleRate = m_nPlayoutSampleRate;
+ return 0;
}
int SLAudioDevice::StartPlayout()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StartPlayout()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StartPlayout()");
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_PLAYOUT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_PLAYOUT_INITIALIZED();
if (m_bPlaying) {
return 0;
@@ -450,21 +471,21 @@ int SLAudioDevice::StartPlayout()
SLresult slResult;
/* Enqueue a set of zero buffers to get the ball rolling */
- uint32_t nSample10ms = m_nPlayoutSampleRate / 100;
+ uint32_t nSample10ms = m_nPlayoutSampleRate / 100;
uint8_t playBuffer[nSample10ms << BYTES_PER_SAMPLE_LOG2];
uint32_t noSamplesOut(0);
{
- // get data from jitter buffer
- noSamplesOut = SLAudioDevice::PullPlayoutData(playBuffer, nSample10ms);
- if(noSamplesOut != nSample10ms){
- AUDIO_OPENSLES_DEBUG_WARN("%d not expected as samples output count value", noSamplesOut);
- noSamplesOut = nSample10ms;
- memset(_playQueueBuffer[_playQueueSeq], 0, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
- }
- else{
- memcpy(_playQueueBuffer[_playQueueSeq], playBuffer, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
- }
-
+ // get data from jitter buffer
+ noSamplesOut = SLAudioDevice::PullPlayoutData(playBuffer, nSample10ms);
+ if(noSamplesOut != nSample10ms) {
+ AUDIO_OPENSLES_DEBUG_WARN("%d not expected as samples output count value", noSamplesOut);
+ noSamplesOut = nSample10ms;
+ memset(_playQueueBuffer[_playQueueSeq], 0, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
+ }
+ else {
+ memcpy(_playQueueBuffer[_playQueueSeq], playBuffer, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
+ }
+
// write the buffer data we into the device
if ((slResult = (*m_slPlayerSimpleBufferQueue)->Enqueue(m_slPlayerSimpleBufferQueue, (void*) _playQueueBuffer[_playQueueSeq], (noSamplesOut << 1))) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Player simpler buffer queue Enqueue failed with error code = %d and noSamplesOut = %d", slResult, noSamplesOut);
@@ -473,42 +494,42 @@ int SLAudioDevice::StartPlayout()
}
// Play the PCM samples using a buffer queue
- m_bPlaying = true;
+ m_bPlaying = true;
if ((slResult = (*m_slPlayerPlay)->SetPlayState(m_slPlayerPlay, SL_PLAYSTATE_PLAYING)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to start playout with error code = %d", slResult);
- m_bPlaying = false;
+ m_bPlaying = false;
return -1;
}
#else
- m_bPlaying = true;
+ m_bPlaying = true;
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- AUDIO_OPENSLES_DEBUG_INFO("Payout started - rate=%d", m_nPlayoutSampleRate);
+ AUDIO_OPENSLES_DEBUG_INFO("Payout started - rate=%d", m_nPlayoutSampleRate);
- return 0;
+ return 0;
}
bool SLAudioDevice::Playing()
{
- return m_bPlaying;
+ return m_bPlaying;
}
int SLAudioDevice::StopPlayout()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StopPlayout()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StopPlayout()");
- if(!m_bPlaying){
- return 0;
- }
+ if(!m_bPlaying) {
+ return 0;
+ }
#if AUDIO_OPENSLES_UNDER_ANDROID
if ((m_slPlayerPlay != NULL) && (m_slOutputMixObject != NULL) && (m_slPlayer != NULL)) {
- SLresult slResult;
-
+ SLresult slResult;
+
if ((slResult = (*m_slPlayerPlay)->SetPlayState(m_slPlayerPlay, SL_PLAYSTATE_STOPPED)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to stop playout with error code = %d", slResult);
return -1;
}
-
+
if ((slResult = (*m_slPlayerSimpleBufferQueue)->Clear(m_slPlayerSimpleBufferQueue)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to clear recorder buffer queue");
return -1;
@@ -516,7 +537,7 @@ int SLAudioDevice::StopPlayout()
// Destroy the player
(*m_slPlayer)->Destroy(m_slPlayer);
- // Destroy Output Mix object
+ // Destroy Output Mix object
(*m_slOutputMixObject)->Destroy(m_slOutputMixObject);
m_slPlayer = NULL;
m_slPlayerPlay = NULL;
@@ -525,124 +546,132 @@ int SLAudioDevice::StopPlayout()
}
#endif
- AUDIO_OPENSLES_DEBUG_INFO("Playout stopped");
- m_bPlayoutInitialized = false;
- m_bPlaying = false;
- return 0;
+ AUDIO_OPENSLES_DEBUG_INFO("Playout stopped");
+ m_bPlayoutInitialized = false;
+ m_bPlaying = false;
+ return 0;
}
int SLAudioDevice::RecordingIsAvailable(bool *pAvailable)
{
- CHECK_TRUE(m_bInitialized, "Device not initialized");
- CHECK_RECORDING_NOT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Device not initialized");
+ CHECK_RECORDING_NOT_INITIALIZED();
- if(!pAvailable){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pAvailable) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pAvailable = true;
- return 0;
+ *pAvailable = true;
+ return 0;
}
int SLAudioDevice::MicrophoneIsAvailable(bool *pAvailable)
{
- CHECK_TRUE(m_bInitialized, "Device not initialized");
- CHECK_RECORDING_NOT_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Device not initialized");
+ CHECK_RECORDING_NOT_INITIALIZED();
- if(!pAvailable){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pAvailable) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pAvailable = true;
- return 0;
+ *pAvailable = true;
+ return 0;
}
int SLAudioDevice::InitMicrophone()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitMicrophone()");
- CHECK_TRUE(m_bInitialized, "Device not initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitMicrophone()");
+ CHECK_TRUE(m_bInitialized, "Device not initialized");
- if(m_bMicrophoneInitialized){
- return 0;
- }
+ if(m_bMicrophoneInitialized) {
+ return 0;
+ }
- m_bMicrophoneInitialized = true;
- return 0;
+ m_bMicrophoneInitialized = true;
+ return 0;
}
int SLAudioDevice::SetMicrophoneVolume(int nMicrophoneVolume)
{
- CHECK_MICROPHONE_INITIALIZED();
+ CHECK_MICROPHONE_INITIALIZED();
- AUDIO_OPENSLES_DEBUG_INFO("SetMicrophoneVolume(%d)", nMicrophoneVolume);
+ AUDIO_OPENSLES_DEBUG_INFO("SetMicrophoneVolume(%d)", nMicrophoneVolume);
#if AUDIO_OPENSLES_UNDER_ANDROID
if (m_slMicVolume == NULL) {
- SLresult slResult;
+ SLresult slResult;
if ((slResult = (*m_slEngineObject)->GetInterface(m_slEngineObject, SL_IID_DEVICEVOLUME, (void*) &m_slMicVolume)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to get 'SL_IID_DEVICEVOLUME' interface with error code = %d", slResult);
- return -1;
+ return -1;
}
}
if (m_slMicVolume != NULL) {
- SLresult slResult;
+ SLresult slResult;
int vol(0);
vol = ((nMicrophoneVolume * (m_nMaxSpeakerVolume - m_nMinSpeakerVolume) + (int) (255 / 2)) / (255)) + m_nMinSpeakerVolume;
if ((slResult = (*m_slMicVolume)->SetVolume(m_slMicVolume, m_nMicDeviceId, vol)) != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("SetVolume() failed with error code = %d", slResult);
- return -1;
+ return -1;
}
}
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- return 0;
+ return 0;
}
int SLAudioDevice::SetStereoRecording(bool bEnabled)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_RECORDING_NOT_INITIALIZED();
- AUDIO_OPENSLES_DEBUG_INFO("SetStereoRecording(%s)", bEnabled ? "True" : "False");
- m_bStereoRecording = bEnabled;
- return 0;
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_RECORDING_NOT_INITIALIZED();
+ AUDIO_OPENSLES_DEBUG_INFO("SetStereoRecording(%s)", bEnabled ? "True" : "False");
+ m_bStereoRecording = bEnabled;
+ return 0;
}
int SLAudioDevice::SetRecordingSampleRate(int nRecordingSampleRate)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_RECORDING_NOT_INITIALIZED();
-
- AUDIO_OPENSLES_DEBUG_INFO("SetRecordingSampleRate(%d)", nRecordingSampleRate);
-
- switch(nRecordingSampleRate){
- case 8000: case 11025: case 16000: case 22050: case 24000: case 32000: case 44100: case 64000: case 88200: case 96000: case 192000:
- {
- m_nRecordingSampleRate = nRecordingSampleRate;
- return 0;
- }
- default:
- {
- AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nRecordingSampleRate);
- return -1;
- }
- }
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_RECORDING_NOT_INITIALIZED();
+
+ AUDIO_OPENSLES_DEBUG_INFO("SetRecordingSampleRate(%d)", nRecordingSampleRate);
+
+ switch(nRecordingSampleRate) {
+ case 8000:
+ case 11025:
+ case 16000:
+ case 22050:
+ case 24000:
+ case 32000:
+ case 44100:
+ case 64000:
+ case 88200:
+ case 96000:
+ case 192000: {
+ m_nRecordingSampleRate = nRecordingSampleRate;
+ return 0;
+ }
+ default: {
+ AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nRecordingSampleRate);
+ return -1;
+ }
+ }
}
int SLAudioDevice::InitRecording()
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_TRUE(m_bInitialized, "Not initialized");
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitRecording()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::InitRecording()");
if (m_bRecording) {
AUDIO_OPENSLES_DEBUG_ERROR("Recording already started");
return -1;
}
- if (m_bRecordingInitialized) {
+ if (m_bRecordingInitialized) {
return 0;
}
@@ -696,21 +725,21 @@ int SLAudioDevice::InitRecording()
return -1;
}
- // Set stream type
- SLAndroidConfigurationItf slRecorderConfig;
- SLint32 slStreamType = SL_ANDROID_RECORDING_PRESET_GENERIC;
+ // Set stream type
+ SLAndroidConfigurationItf slRecorderConfig;
+ SLint32 slStreamType = SL_ANDROID_RECORDING_PRESET_GENERIC;
slResult = (*m_slRecorder)->GetInterface(m_slRecorder, SL_IID_ANDROIDCONFIGURATION, &slRecorderConfig);
if(slResult != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("GetInterface(SL_IID_ANDROIDCONFIGURATION) failed with error code = %d", slResult);
return -1;
}
- AUDIO_OPENSLES_DEBUG_INFO("Recording stream type = %d", slStreamType);
+ AUDIO_OPENSLES_DEBUG_INFO("Recording stream type = %d", slStreamType);
slResult = (*slRecorderConfig)->SetConfiguration(slRecorderConfig, SL_ANDROID_KEY_RECORDING_PRESET, &slStreamType, sizeof(SLint32));
- if(slResult != SL_RESULT_SUCCESS) {
+ if(slResult != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("SetConfiguration(SL_ANDROID_KEY_RECORDING_PRESET) failed with error code = %d", slResult);
return -1;
}
-
+
// Realizing the recorder in synchronous mode.
slResult = (*m_slRecorder)->Realize(m_slRecorder, SL_BOOLEAN_FALSE);
@@ -742,47 +771,47 @@ int SLAudioDevice::InitRecording()
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- AUDIO_OPENSLES_DEBUG_INFO("Recording initialized");
+ AUDIO_OPENSLES_DEBUG_INFO("Recording initialized");
- m_bRecordingInitialized = true;
+ m_bRecordingInitialized = true;
- return 0;
+ return 0;
}
int SLAudioDevice::StereoRecording(bool *pEnabled)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_RECORDING_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_RECORDING_INITIALIZED();
- if(!pEnabled){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pEnabled) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pEnabled = m_bStereoRecording;
- return 0;
+ *pEnabled = m_bStereoRecording;
+ return 0;
}
int SLAudioDevice::RecordingSampleRate(int *pRecordingSampleRate)
{
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_RECORDING_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_RECORDING_INITIALIZED();
- if(!pRecordingSampleRate){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pRecordingSampleRate) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- *pRecordingSampleRate = m_nRecordingSampleRate;
- return 0;
+ *pRecordingSampleRate = m_nRecordingSampleRate;
+ return 0;
}
int SLAudioDevice::StartRecording()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StartRecording()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StartRecording()");
- CHECK_TRUE(m_bInitialized, "Not initialized");
- CHECK_RECORDING_INITIALIZED();
+ CHECK_TRUE(m_bInitialized, "Not initialized");
+ CHECK_RECORDING_INITIALIZED();
if (m_bRecording) {
return 0;
@@ -791,13 +820,13 @@ int SLAudioDevice::StartRecording()
#if AUDIO_OPENSLES_UNDER_ANDROID
if (m_slRecorderRecord == NULL) {
- AUDIO_OPENSLES_DEBUG_ERROR("RecordITF is NULL");
+ AUDIO_OPENSLES_DEBUG_ERROR("RecordITF is NULL");
return -1;
}
if (m_slRecorderSimpleBufferQueue == NULL) {
- AUDIO_OPENSLES_DEBUG_ERROR("Recorder Simple Buffer Queue is NULL");
- return -1;
+ AUDIO_OPENSLES_DEBUG_ERROR("Recorder Simple Buffer Queue is NULL");
+ return -1;
}
// Reset recording buffer
@@ -822,31 +851,31 @@ int SLAudioDevice::StartRecording()
_recQueueSeq++;
}
// Record the audio
- m_bRecording = true;
+ m_bRecording = true;
slResult = (*m_slRecorderRecord)->SetRecordState(m_slRecorderRecord, SL_RECORDSTATE_RECORDING);
if (slResult != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Failed to start recording with error code = %d", slResult);
- m_bRecording = false;
+ m_bRecording = false;
return -1;
}
#else
- m_bRecording = true;
+ m_bRecording = true;
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- AUDIO_OPENSLES_DEBUG_INFO("Recording started - rate = %d", m_nRecordingSampleRate);
-
- return 0;
+ AUDIO_OPENSLES_DEBUG_INFO("Recording started - rate = %d", m_nRecordingSampleRate);
+
+ return 0;
}
bool SLAudioDevice::Recording()
{
- return m_bRecording;
+ return m_bRecording;
}
int SLAudioDevice::StopRecording()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StopRecording()");
- if (!m_bRecording) {
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::StopRecording()");
+ if (!m_bRecording) {
return 0;
}
#if AUDIO_OPENSLES_UNDER_ANDROID
@@ -870,47 +899,47 @@ int SLAudioDevice::StopRecording()
}
#endif
- AUDIO_OPENSLES_DEBUG_INFO("Recording stopped");
- m_bRecording = false;
- m_bRecordingInitialized = false;
- return 0;
+ AUDIO_OPENSLES_DEBUG_INFO("Recording stopped");
+ m_bRecording = false;
+ m_bRecordingInitialized = false;
+ return 0;
}
int SLAudioDevice::Terminate()
{
- if (!m_bInitialized) {
+ if (!m_bInitialized) {
return 0;
}
- if(Recording()){
- StopRecording();
- }
+ if(Recording()) {
+ StopRecording();
+ }
- if(Playing()){
- StopPlayout();
- }
+ if(Playing()) {
+ StopPlayout();
+ }
#if AUDIO_OPENSLES_UNDER_ANDROID
- if(m_slPlayer){
- (*m_slPlayer)->Destroy(m_slPlayer);
- m_slPlayer = NULL;
- m_slPlayerPlay = NULL;
- m_slPlayerSimpleBufferQueue = NULL;
- }
-
- if(m_slRecorder){
- (*m_slRecorder)->Destroy(m_slRecorder);
- m_slRecorder = NULL;
- m_slRecorderRecord = NULL;
- m_slRecorderSimpleBufferQueue = NULL;
- m_slAudioIODeviceCapabilities = NULL;
- }
-
- if(m_slOutputMixObject){
- (*m_slOutputMixObject)->Destroy(m_slOutputMixObject);
- m_slOutputMixObject = NULL;
- }
+ if(m_slPlayer) {
+ (*m_slPlayer)->Destroy(m_slPlayer);
+ m_slPlayer = NULL;
+ m_slPlayerPlay = NULL;
+ m_slPlayerSimpleBufferQueue = NULL;
+ }
+
+ if(m_slRecorder) {
+ (*m_slRecorder)->Destroy(m_slRecorder);
+ m_slRecorder = NULL;
+ m_slRecorderRecord = NULL;
+ m_slRecorderSimpleBufferQueue = NULL;
+ m_slAudioIODeviceCapabilities = NULL;
+ }
+
+ if(m_slOutputMixObject) {
+ (*m_slOutputMixObject)->Destroy(m_slOutputMixObject);
+ m_slOutputMixObject = NULL;
+ }
if (m_slEngineObject) {
(*m_slEngineObject)->Destroy(m_slEngineObject);
@@ -919,9 +948,9 @@ int SLAudioDevice::Terminate()
}
#endif
- m_bSpeakerInitialized = false;
- m_bPlayoutInitialized = false;
- m_bRecordingInitialized = false;
+ m_bSpeakerInitialized = false;
+ m_bPlayoutInitialized = false;
+ m_bRecordingInitialized = false;
m_bInitialized = false;
return 0;
@@ -929,73 +958,73 @@ int SLAudioDevice::Terminate()
int SLAudioDevice::PlayoutApplyNewConfig()
{
- AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::PlayoutApplyNewConfig()");
+ AUDIO_OPENSLES_DEBUG_INFO("SLAudioDevice::PlayoutApplyNewConfig()");
#if AUDIO_OPENSLES_UNDER_ANDROID
- if(m_slPlayer){
- SLresult slResult;
- int ret;
- bool wasPlaying = Playing();
-
- if(wasPlaying){
- if ((ret = StopPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to stop playout for reconf");
- return ret;
- }
- if((ret = InitPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to init() playout after reconf");
- return ret;
- }
- }
-
- if(wasPlaying){
- if((ret = StartPlayout())){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to start() playout after reconf");
- return ret;
- }
- }
- }
+ if(m_slPlayer) {
+ SLresult slResult;
+ int ret;
+ bool wasPlaying = Playing();
+
+ if(wasPlaying) {
+ if ((ret = StopPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to stop playout for reconf");
+ return ret;
+ }
+ if((ret = InitPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to init() playout after reconf");
+ return ret;
+ }
+ }
+
+ if(wasPlaying) {
+ if((ret = StartPlayout())) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to start() playout after reconf");
+ return ret;
+ }
+ }
+ }
#endif /* AUDIO_OPENSLES_UNDER_ANDROID */
- return 0;
+ return 0;
}
uint32_t SLAudioDevice::PullPlayoutData(void* pAudioSamples, const uint32_t nSamples)
{
- if(!pAudioSamples || !nSamples){
- AUDIO_OPENSLES_DEBUG_ERROR("PullPlayoutData() - Invalid parameter");
- return 0;
- }
-
- if(!m_pCallback){
- memset(pAudioSamples, 0, (nSamples << BYTES_PER_SAMPLE_LOG2));
- return nSamples;
- }
-
- uint32_t nSamplesOut = 0;
- const_cast<SLAudioDeviceCallback*>(m_pCallback)->NeedMorePlayData(nSamples,
- BYTES_PER_SAMPLE,
- m_bStereoPlayout ? 2 : 1,
- m_nPlayoutSampleRate,
- pAudioSamples,
- nSamplesOut);
- return nSamplesOut;
+ if(!pAudioSamples || !nSamples) {
+ AUDIO_OPENSLES_DEBUG_ERROR("PullPlayoutData() - Invalid parameter");
+ return 0;
+ }
+
+ if(!m_pCallback) {
+ memset(pAudioSamples, 0, (nSamples << BYTES_PER_SAMPLE_LOG2));
+ return nSamples;
+ }
+
+ uint32_t nSamplesOut = 0;
+ const_cast<SLAudioDeviceCallback*>(m_pCallback)->NeedMorePlayData(nSamples,
+ BYTES_PER_SAMPLE,
+ m_bStereoPlayout ? 2 : 1,
+ m_nPlayoutSampleRate,
+ pAudioSamples,
+ nSamplesOut);
+ return nSamplesOut;
}
void SLAudioDevice::PushRecordingData(void* pAudioSamples, const uint32_t nSamples)
{
- if(!pAudioSamples || !nSamples){
- AUDIO_OPENSLES_DEBUG_ERROR("PushRecordingData() - Invalid parameter");
- return;
- }
-
- if(m_pCallback){
- const_cast<SLAudioDeviceCallback*>(m_pCallback)->RecordedDataIsAvailable(pAudioSamples,
- nSamples,
- BYTES_PER_SAMPLE,
- m_bStereoRecording ? 2 : 1,
- m_nRecordingSampleRate);
- }
+ if(!pAudioSamples || !nSamples) {
+ AUDIO_OPENSLES_DEBUG_ERROR("PushRecordingData() - Invalid parameter");
+ return;
+ }
+
+ if(m_pCallback) {
+ const_cast<SLAudioDeviceCallback*>(m_pCallback)->RecordedDataIsAvailable(pAudioSamples,
+ nSamples,
+ BYTES_PER_SAMPLE,
+ m_bStereoRecording ? 2 : 1,
+ m_nRecordingSampleRate);
+ }
}
#if AUDIO_OPENSLES_UNDER_ANDROID
@@ -1004,24 +1033,24 @@ void SLAudioDevice::PlayerSimpleBufferQueueCallback(SLAndroidSimpleBufferQueueIt
{
SLAudioDevice* This = static_cast<SLAudioDevice*> (pContext);
- // AUDIO_OPENSLES_DEBUG_INFO("PlayerSimpleBufferQueueCallback(playing=%s, _playQueueSeq=%d)", (This->m_bPlaying ? "true" : "false"), This->_playQueueSeq);
+ // AUDIO_OPENSLES_DEBUG_INFO("PlayerSimpleBufferQueueCallback(playing=%s, _playQueueSeq=%d)", (This->m_bPlaying ? "true" : "false"), This->_playQueueSeq);
- if (This->m_bPlaying && (This->_playQueueSeq < N_PLAY_QUEUE_BUFFERS)) {
- unsigned int noSamp10ms = This->m_nPlayoutSampleRate / 100;
+ if (This->m_bPlaying && (This->_playQueueSeq < N_PLAY_QUEUE_BUFFERS)) {
+ unsigned int noSamp10ms = This->m_nPlayoutSampleRate / 100;
uint8_t playBuffer[noSamp10ms << BYTES_PER_SAMPLE_LOG2];
uint32_t noSamplesOut = This->PullPlayoutData(playBuffer, noSamp10ms);
-
+
if (noSamp10ms != noSamplesOut) {
- if(noSamplesOut){ // (noSamplesOut==0) -> jitter buffer cannot provide data
- AUDIO_OPENSLES_DEBUG_ERROR("noSamp10ms (%u) != noSamplesOut (%d)", noSamp10ms, noSamplesOut);
- }
- noSamplesOut = noSamp10ms;
- memset(This->_playQueueBuffer[This->_playQueueSeq], 0, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
+ if(noSamplesOut) { // (noSamplesOut==0) -> jitter buffer cannot provide data
+ AUDIO_OPENSLES_DEBUG_ERROR("noSamp10ms (%u) != noSamplesOut (%d)", noSamp10ms, noSamplesOut);
+ }
+ noSamplesOut = noSamp10ms;
+ memset(This->_playQueueBuffer[This->_playQueueSeq], 0, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
}
- else{
- memcpy(This->_playQueueBuffer[This->_playQueueSeq], playBuffer, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
- }
-
+ else {
+ memcpy(This->_playQueueBuffer[This->_playQueueSeq], playBuffer, (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
+ }
+
SLresult slResult = (*This->m_slPlayerSimpleBufferQueue)->Enqueue(This->m_slPlayerSimpleBufferQueue, This->_playQueueBuffer[This->_playQueueSeq], (noSamplesOut << BYTES_PER_SAMPLE_LOG2));
if (slResult != SL_RESULT_SUCCESS) {
AUDIO_OPENSLES_DEBUG_ERROR("Player simpler buffer queue Enqueue failed, noSamplesOut=%d, ret=%d", noSamplesOut, slResult);
@@ -1036,31 +1065,30 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
{
// AUDIO_OPENSLES_DEBUG_INFO("RecorderSimpleBufferQueueCallback()");
- SLAudioDevice* This = static_cast<SLAudioDevice*> (pContext);
+ SLAudioDevice* This = static_cast<SLAudioDevice*> (pContext);
- if (This->m_bRecording) {
+ if (This->m_bRecording) {
const unsigned int noSamp10ms = This->m_nRecordingSampleRate / 100;
-
+
#if 1 // not using async thread
- // push data
- This->PushRecordingData(This->_recQueueBuffer[0], noSamp10ms);
+ // push data
+ This->PushRecordingData(This->_recQueueBuffer[0], noSamp10ms);
// enqueue new buffer
SLresult slResult = (*This->m_slRecorderSimpleBufferQueue)->Enqueue(
- This->m_slRecorderSimpleBufferQueue,
- (void*) This->_recQueueBuffer[0],
- (noSamp10ms << BYTES_PER_SAMPLE_LOG2));
+ This->m_slRecorderSimpleBufferQueue,
+ (void*) This->_recQueueBuffer[0],
+ (noSamp10ms << BYTES_PER_SAMPLE_LOG2));
if (slResult != SL_RESULT_SUCCESS) {
- AUDIO_OPENSLES_DEBUG_WARN("Failed to enqueue recording buffer with error code = %d", slResult);
+ AUDIO_OPENSLES_DEBUG_WARN("Failed to enqueue recording buffer with error code = %d", slResult);
return;
}
#else
unsigned int dataPos = 0;
- uint16_t bufPos = 0;
+ uint16_t bufPos = 0;
int16_t insertPos = -1;
unsigned int nCopy = 0; // Number of samples to copy
- while (dataPos < noSamp10ms)
- {
+ while (dataPos < noSamp10ms) {
// Loop over all recording buffers or until we find the partially
// full buffer
// First choice is to insert into partially full buffer,
@@ -1068,24 +1096,20 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
bufPos = 0;
insertPos = -1;
nCopy = 0;
- while (bufPos < N_REC_BUFFERS)
- {
- if ((This->_recLength[bufPos] > 0) && (This->_recLength[bufPos] < noSamp10ms))
- {
+ while (bufPos < N_REC_BUFFERS) {
+ if ((This->_recLength[bufPos] > 0) && (This->_recLength[bufPos] < noSamp10ms)) {
// Found the partially full buffer
insertPos = static_cast<int16_t> (bufPos);
bufPos = N_REC_BUFFERS; // Don't need to search more
}
- else if ((-1 == insertPos) && (0 == This->_recLength[bufPos]))
- {
+ else if ((-1 == insertPos) && (0 == This->_recLength[bufPos])) {
// Found an empty buffer
insertPos = static_cast<int16_t> (bufPos);
}
++bufPos;
}
- if (insertPos > -1)
- {
+ if (insertPos > -1) {
// We found a non-full buffer, copy data from the buffer queue
// o recBuffer
unsigned int dataToCopy = noSamp10ms - dataPos;
@@ -1093,8 +1117,7 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
unsigned int roomInBuffer = noSamp10ms - currentRecLen;
nCopy = (dataToCopy < roomInBuffer ? dataToCopy : roomInBuffer);
memcpy(&This->_recBuffer[insertPos][currentRecLen], &This->_recQueueBuffer[This->_recQueueSeq][dataPos], nCopy * sizeof(short));
- if (0 == currentRecLen)
- {
+ if (0 == currentRecLen) {
_recSeqNumber[insertPos] = This->_recCurrentSeq;
++_recCurrentSeq;
}
@@ -1104,8 +1127,7 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
This->_recLength[insertPos] += nCopy;
dataPos += nCopy;
}
- else
- {
+ else {
// Didn't find a non-full buffer
AUDIO_OPENSLES_DEBUG_WARN("Could not insert into recording buffer");
dataPos = noSamp10ms; // Don't try to insert more
@@ -1117,19 +1139,19 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
memset(This->_recQueueBuffer[This->_recQueueSeq], 0, (REC_BUF_SIZE_IN_SAMPLES << BYTES_PER_SAMPLE_LOG2));
// write the empty buffer to the queue
SLresult slResult = (*This->m_slRecorderSimpleBufferQueue)->Enqueue(
- This->m_slRecorderSimpleBufferQueue,
- (void*) This->_recQueueBuffer[This->_recQueueSeq],
- (noSamp10ms << BYTES_PER_SAMPLE_LOG2));
+ This->m_slRecorderSimpleBufferQueue,
+ (void*) This->_recQueueBuffer[This->_recQueueSeq],
+ (noSamp10ms << BYTES_PER_SAMPLE_LOG2));
if (slResult != SL_RESULT_SUCCESS) {
- AUDIO_OPENSLES_DEBUG_WARN("Failed to enqueue recording buffer with error code = %d", slResult);
+ AUDIO_OPENSLES_DEBUG_WARN("Failed to enqueue recording buffer with error code = %d", slResult);
return;
}
// update the rec queue seq
This->_recQueueSeq = (This->_recQueueSeq + 1) % N_REC_QUEUE_BUFFERS;
- // alert thread
- // TODO
+ // alert thread
+ // TODO
#endif
}
}
diff --git a/plugins/audio_opensles/audio_opensles_device.h b/plugins/audio_opensles/audio_opensles_device.h
index 7f24dac..dd7da73 100755
--- a/plugins/audio_opensles/audio_opensles_device.h
+++ b/plugins/audio_opensles/audio_opensles_device.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -50,7 +50,7 @@ public:
const uint32_t nSamples,
const uint8_t nBytesPerSample,
const uint8_t nChannels,
- const uint32_t samplesPerSec) = 0;
+ const uint32_t samplesPerSec) = 0;
virtual int32_t NeedMorePlayData(const uint32_t nSamples,
const uint8_t nBytesPerSample,
@@ -66,75 +66,75 @@ protected:
class SLAudioDevice
{
public:
- SLAudioDevice(const SLAudioDeviceCallback* pCallback = NULL);
- virtual ~SLAudioDevice();
+ SLAudioDevice(const SLAudioDeviceCallback* pCallback = NULL);
+ virtual ~SLAudioDevice();
public:
- int SetCallback(const SLAudioDeviceCallback* pCallback);
- int Init();
- bool Initialized();
- int SpeakerIsAvailable(bool *pAvailable);
- int InitSpeaker();
- int SetMaxSpeakerVolume(int nMaxSpeakerVolume);
- int SetMinSpeakerVolume(int nMinSpeakerVolume);
- int SetSpeakerVolume(int nSpeakerVolume);
- int SetSpeakerOn(bool bSpeakerOn);
- int PlayoutIsAvailable(bool *pAvailable);
- int SetStereoPlayout(bool bEnabled);
- int SetPlayoutBuffer(int nPlayoutBufferSize);
- int SetPlayoutSampleRate(int nPlayoutSampleRate);
- int InitPlayout();
- int StereoPlayout(bool *pEnabled);
- int PlayoutSampleRate(int *pPlayoutSampleRate);
- int StartPlayout();
- bool Playing();
- int StopPlayout();
- int RecordingIsAvailable(bool *pAvailable);
- int MicrophoneIsAvailable(bool *pAvailable);
- int InitMicrophone();
- int SetMicrophoneVolume(int nMicrophoneVolume);
- int SetStereoRecording(bool bEnabled);
- int SetRecordingSampleRate(int nRecordingSampleRate);
- int InitRecording();
- int StereoRecording(bool *pEnabled);
- int RecordingSampleRate(int *pRecordingSampleRate);
- int StartRecording();
- bool Recording();
- int StopRecording();
- int Terminate();
+ int SetCallback(const SLAudioDeviceCallback* pCallback);
+ int Init();
+ bool Initialized();
+ int SpeakerIsAvailable(bool *pAvailable);
+ int InitSpeaker();
+ int SetMaxSpeakerVolume(int nMaxSpeakerVolume);
+ int SetMinSpeakerVolume(int nMinSpeakerVolume);
+ int SetSpeakerVolume(int nSpeakerVolume);
+ int SetSpeakerOn(bool bSpeakerOn);
+ int PlayoutIsAvailable(bool *pAvailable);
+ int SetStereoPlayout(bool bEnabled);
+ int SetPlayoutBuffer(int nPlayoutBufferSize);
+ int SetPlayoutSampleRate(int nPlayoutSampleRate);
+ int InitPlayout();
+ int StereoPlayout(bool *pEnabled);
+ int PlayoutSampleRate(int *pPlayoutSampleRate);
+ int StartPlayout();
+ bool Playing();
+ int StopPlayout();
+ int RecordingIsAvailable(bool *pAvailable);
+ int MicrophoneIsAvailable(bool *pAvailable);
+ int InitMicrophone();
+ int SetMicrophoneVolume(int nMicrophoneVolume);
+ int SetStereoRecording(bool bEnabled);
+ int SetRecordingSampleRate(int nRecordingSampleRate);
+ int InitRecording();
+ int StereoRecording(bool *pEnabled);
+ int RecordingSampleRate(int *pRecordingSampleRate);
+ int StartRecording();
+ bool Recording();
+ int StopRecording();
+ int Terminate();
private:
- int PlayoutApplyNewConfig();
- uint32_t PullPlayoutData(void* pAudioSamples, const uint32_t nSamples);
- void PushRecordingData(void* pAudioSamples, const uint32_t nSamples);
+ int PlayoutApplyNewConfig();
+ uint32_t PullPlayoutData(void* pAudioSamples, const uint32_t nSamples);
+ void PushRecordingData(void* pAudioSamples, const uint32_t nSamples);
#if AUDIO_OPENSLES_UNDER_ANDROID
- static void PlayerSimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf queueItf, void *pContext);
- static void RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf queueItf, void *pContext);
+ static void PlayerSimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf queueItf, void *pContext);
+ static void RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf queueItf, void *pContext);
#endif
private:
- const SLAudioDeviceCallback* m_pCallback;
- int m_nMicDeviceId;
- bool m_bInitialized;
- bool m_bSpeakerInitialized;
- bool m_bPlayoutInitialized;
- bool m_bRecordingInitialized;
- bool m_bMicrophoneInitialized;
- bool m_bSpeakerOn;
- bool m_bStereoPlayout;
- bool m_bStereoRecording;
- int m_nPlayoutBufferSize;
- int m_nRecordingBufferSize;
- int m_nPlayoutSampleRate;
- int m_nRecordingSampleRate;
- bool m_bPlaying;
- bool m_bRecording;
- int m_nSpeakerVolume;
- int m_nMaxSpeakerVolume;
- int m_nMinSpeakerVolume;
+ const SLAudioDeviceCallback* m_pCallback;
+ int m_nMicDeviceId;
+ bool m_bInitialized;
+ bool m_bSpeakerInitialized;
+ bool m_bPlayoutInitialized;
+ bool m_bRecordingInitialized;
+ bool m_bMicrophoneInitialized;
+ bool m_bSpeakerOn;
+ bool m_bStereoPlayout;
+ bool m_bStereoRecording;
+ int m_nPlayoutBufferSize;
+ int m_nRecordingBufferSize;
+ int m_nPlayoutSampleRate;
+ int m_nRecordingSampleRate;
+ bool m_bPlaying;
+ bool m_bRecording;
+ int m_nSpeakerVolume;
+ int m_nMaxSpeakerVolume;
+ int m_nMinSpeakerVolume;
#if AUDIO_OPENSLES_UNDER_ANDROID
- // audio unit
+ // audio unit
SLObjectItf m_slEngineObject;
// playout device
@@ -152,10 +152,10 @@ private:
SLAndroidSimpleBufferQueueItf m_slRecorderSimpleBufferQueue;
SLDeviceVolumeItf m_slMicVolume;
- int _recQueueSeq;
+ int _recQueueSeq;
- // Playout buffer
- uint8_t _playQueueBuffer[N_PLAY_QUEUE_BUFFERS][PLAY_BUF_SIZE_IN_SAMPLES << BYTES_PER_SAMPLE_LOG2];
+ // Playout buffer
+ uint8_t _playQueueBuffer[N_PLAY_QUEUE_BUFFERS][PLAY_BUF_SIZE_IN_SAMPLES << BYTES_PER_SAMPLE_LOG2];
int _playQueueSeq;
// Recording buffer
uint8_t _recQueueBuffer[N_REC_QUEUE_BUFFERS][REC_BUF_SIZE_IN_SAMPLES << BYTES_PER_SAMPLE_LOG2];
diff --git a/plugins/audio_opensles/audio_opensles_device_impl.cxx b/plugins/audio_opensles/audio_opensles_device_impl.cxx
index 8e32d91..69269aa 100755
--- a/plugins/audio_opensles/audio_opensles_device_impl.cxx
+++ b/plugins/audio_opensles/audio_opensles_device_impl.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,7 +21,7 @@
#include "audio_opensles_consumer.h"
SLAudioDeviceCallbackImpl::SLAudioDeviceCallbackImpl():
-SLAudioDeviceCallback()
+ SLAudioDeviceCallback()
{
}
@@ -30,29 +30,29 @@ SLAudioDeviceCallbackImpl::~SLAudioDeviceCallbackImpl()
}
int32_t SLAudioDeviceCallbackImpl::RecordedDataIsAvailable(const void* audioSamples,
- const uint32_t nSamples,
- const uint8_t nBytesPerSample,
- const uint8_t nChannels,
- const uint32_t samplesPerSec)
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec)
{
- if(!m_pProducer){
- AUDIO_OPENSLES_DEBUG_WARN("No wrapped producer");
- return 0;
- }
- return audio_producer_opensles_handle_data_10ms(m_pProducer, audioSamples, nSamples, nBytesPerSample, samplesPerSec, nChannels);
+ if(!m_pProducer) {
+ AUDIO_OPENSLES_DEBUG_WARN("No wrapped producer");
+ return 0;
+ }
+ return audio_producer_opensles_handle_data_10ms(m_pProducer, audioSamples, nSamples, nBytesPerSample, samplesPerSec, nChannels);
}
int32_t SLAudioDeviceCallbackImpl::NeedMorePlayData(const uint32_t nSamples,
- const uint8_t nBytesPerSample,
- const uint8_t nChannels,
- const uint32_t samplesPerSec,
- void* audioSamples,
- uint32_t& nSamplesOut)
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec,
+ void* audioSamples,
+ uint32_t& nSamplesOut)
{
- if(!m_pConsumer){
- AUDIO_OPENSLES_DEBUG_WARN("No wrapped consumer");
- return 0;
- }
- return audio_consumer_opensles_get_data_10ms(m_pConsumer, audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec, nSamplesOut);
+ if(!m_pConsumer) {
+ AUDIO_OPENSLES_DEBUG_WARN("No wrapped consumer");
+ return 0;
+ }
+ return audio_consumer_opensles_get_data_10ms(m_pConsumer, audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec, nSamplesOut);
} \ No newline at end of file
diff --git a/plugins/audio_opensles/audio_opensles_device_impl.h b/plugins/audio_opensles/audio_opensles_device_impl.h
index 8168fe9..6f6ad60 100755
--- a/plugins/audio_opensles/audio_opensles_device_impl.h
+++ b/plugins/audio_opensles/audio_opensles_device_impl.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,14 +24,14 @@
class SLAudioDeviceCallbackImpl : public SLAudioDeviceCallback
{
public:
- SLAudioDeviceCallbackImpl();
- virtual ~SLAudioDeviceCallbackImpl();
+ SLAudioDeviceCallbackImpl();
+ virtual ~SLAudioDeviceCallbackImpl();
- virtual int32_t RecordedDataIsAvailable(const void* audioSamples,
+ virtual int32_t RecordedDataIsAvailable(const void* audioSamples,
const uint32_t nSamples,
const uint8_t nBytesPerSample,
const uint8_t nChannels,
- const uint32_t samplesPerSec);
+ const uint32_t samplesPerSec);
virtual int32_t NeedMorePlayData(const uint32_t nSamples,
const uint8_t nBytesPerSample,
@@ -40,12 +40,16 @@ public:
void* audioSamples,
uint32_t& nSamplesOut);
- inline void SetConsumer(const struct audio_consumer_opensles_s* pConsumer){ m_pConsumer = pConsumer; }
- inline void SetProducer(const struct audio_producer_opensles_s* pProducer){ m_pProducer = pProducer; }
+ inline void SetConsumer(const struct audio_consumer_opensles_s* pConsumer) {
+ m_pConsumer = pConsumer;
+ }
+ inline void SetProducer(const struct audio_producer_opensles_s* pProducer) {
+ m_pProducer = pProducer;
+ }
private:
- const struct audio_consumer_opensles_s* m_pConsumer; // mut be const and must not take reference
- const struct audio_producer_opensles_s* m_pProducer; // mut be const and must not take reference
+ const struct audio_consumer_opensles_s* m_pConsumer; // mut be const and must not take reference
+ const struct audio_producer_opensles_s* m_pProducer; // mut be const and must not take reference
};
#endif /* _DOUBANGO_AUDIO_OPENSLES_SLDEVICE_IMPL_H */
diff --git a/plugins/audio_opensles/audio_opensles_producer.cxx b/plugins/audio_opensles/audio_opensles_producer.cxx
index 69c06f6..007b59f 100755
--- a/plugins/audio_opensles/audio_opensles_producer.cxx
+++ b/plugins/audio_opensles/audio_opensles_producer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,159 +24,158 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct audio_producer_opensles_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- bool isMuted;
- audio_opensles_instance_handle_t* audioInstHandle;
- struct{
- void* ptr;
- int size;
- int index;
- } buffer;
+typedef struct audio_producer_opensles_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ bool isMuted;
+ audio_opensles_instance_handle_t* audioInstHandle;
+ struct {
+ void* ptr;
+ int size;
+ int index;
+ } buffer;
}
audio_producer_opensles_t;
int audio_producer_opensles_handle_data_10ms(const audio_producer_opensles_t* _self, const void* audioSamples, int nSamples, int nBytesPerSample, int samplesPerSec, int nChannels)
{
- if(!_self || !audioSamples || !nSamples){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!TMEDIA_PRODUCER(_self)->enc_cb.callback){
- AUDIO_OPENSLES_DEBUG_WARN("No callback function is registered for the producer");
- return 0;
- }
- if((nSamples != (samplesPerSec / 100))){
- AUDIO_OPENSLES_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
- return -2;
- }
- if((nBytesPerSample != (TMEDIA_PRODUCER(_self)->audio.bits_per_sample >> 3))){
- AUDIO_OPENSLES_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
- return -3;
- }
- if((nChannels != TMEDIA_PRODUCER(_self)->audio.channels)){
- AUDIO_OPENSLES_DEBUG_ERROR("Recording - %d not the expected number of channels but should be %d", nChannels, TMEDIA_PRODUCER(_self)->audio.channels);
- return -4;
- }
-
- int nSamplesInBits = (nSamples * nBytesPerSample);
- if(_self->buffer.index + nSamplesInBits > _self->buffer.size){
- AUDIO_OPENSLES_DEBUG_ERROR("Buffer overflow");
- return -5;
- }
-
- audio_producer_opensles_t* self = const_cast<audio_producer_opensles_t*>(_self);
-
- if(self->isMuted){
- memset((((uint8_t*)self->buffer.ptr) + self->buffer.index), 0, nSamplesInBits);
- }
- else{
- memcpy((((uint8_t*)self->buffer.ptr) + self->buffer.index), audioSamples, nSamplesInBits);
- }
- self->buffer.index += nSamplesInBits;
-
- if(self->buffer.index == self->buffer.size){
- self->buffer.index = 0;
- TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, self->buffer.ptr, self->buffer.size);
- }
-
- return 0;
+ if(!_self || !audioSamples || !nSamples) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!TMEDIA_PRODUCER(_self)->enc_cb.callback) {
+ AUDIO_OPENSLES_DEBUG_WARN("No callback function is registered for the producer");
+ return 0;
+ }
+ if((nSamples != (samplesPerSec / 100))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
+ return -2;
+ }
+ if((nBytesPerSample != (TMEDIA_PRODUCER(_self)->audio.bits_per_sample >> 3))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
+ return -3;
+ }
+ if((nChannels != TMEDIA_PRODUCER(_self)->audio.channels)) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Recording - %d not the expected number of channels but should be %d", nChannels, TMEDIA_PRODUCER(_self)->audio.channels);
+ return -4;
+ }
+
+ int nSamplesInBits = (nSamples * nBytesPerSample);
+ if(_self->buffer.index + nSamplesInBits > _self->buffer.size) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Buffer overflow");
+ return -5;
+ }
+
+ audio_producer_opensles_t* self = const_cast<audio_producer_opensles_t*>(_self);
+
+ if(self->isMuted) {
+ memset((((uint8_t*)self->buffer.ptr) + self->buffer.index), 0, nSamplesInBits);
+ }
+ else {
+ memcpy((((uint8_t*)self->buffer.ptr) + self->buffer.index), audioSamples, nSamplesInBits);
+ }
+ self->buffer.index += nSamplesInBits;
+
+ if(self->buffer.index == self->buffer.size) {
+ self->buffer.index = 0;
+ TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, self->buffer.ptr, self->buffer.size);
+ }
+
+ return 0;
}
/* ============ Media Producer Interface ================= */
static int audio_producer_opensles_set(tmedia_producer_t* _self, const tmedia_param_t* param)
-{
- audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
- if(param->plugin_type == tmedia_ppt_producer){
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "mute")){
- self->isMuted = (*((int32_t*)param->value) != 0);
- // Mute not supported on android -> send silence when needed
- return 0;
- }
- else if(tsk_striequals(param->key, "volume")){
- return audio_opensles_instance_set_microphone_volume(self->audioInstHandle, *((int32_t*)param->value));
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+{
+ audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "mute")) {
+ self->isMuted = (*((int32_t*)param->value) != 0);
+ // Mute not supported on android -> send silence when needed
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "volume")) {
+ return audio_opensles_instance_set_microphone_volume(self->audioInstHandle, *((int32_t*)param->value));
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int audio_producer_opensles_prepare(tmedia_producer_t* _self, const tmedia_codec_t* codec)
{
- audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
- if(!self || !codec){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // create audio instance
- if(!(self->audioInstHandle = audio_opensles_instance_create(TMEDIA_PRODUCER(self)->session_id))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio instance handle");
- return -2;
- }
-
- // check that ptime is mutiple of 10
- if((codec->plugin->audio.ptime % 10)){
- AUDIO_OPENSLES_DEBUG_ERROR("ptime=%d not multiple of 10", codec->plugin->audio.ptime);
- return -3;
- }
-
- // init input parameters from the codec
- TMEDIA_PRODUCER(self)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(self)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(self)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
-
- AUDIO_OPENSLES_DEBUG_INFO("audio_producer_opensles_prepare(channels=%d, rate=%d, ptime=%d)", codec->plugin->audio.channels, codec->plugin->rate, codec->plugin->audio.ptime);
-
- // prepare playout device and update output parameters
- int ret;
- ret = audio_opensles_instance_prepare_producer(self->audioInstHandle, &_self);
-
- // now that the producer is prepared we can initialize internal buffer using device caps
- if(ret == 0){
- // allocate buffer
- int xsize = ((TMEDIA_PRODUCER(self)->audio.ptime * TMEDIA_PRODUCER(self)->audio.rate) / 1000) * (TMEDIA_PRODUCER(self)->audio.bits_per_sample >> 3);
- AUDIO_OPENSLES_DEBUG_INFO("producer buffer xsize = %d", xsize);
- if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))){
- AUDIO_OPENSLES_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
- self->buffer.size = 0;
- return -1;
- }
- self->buffer.size = xsize;
- self->buffer.index = 0;
- }
- return ret;
+ audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
+ if(!self || !codec) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // create audio instance
+ if(!(self->audioInstHandle = audio_opensles_instance_create(TMEDIA_PRODUCER(self)->session_id))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to create audio instance handle");
+ return -2;
+ }
+
+ // check that ptime is mutiple of 10
+ if((codec->plugin->audio.ptime % 10)) {
+ AUDIO_OPENSLES_DEBUG_ERROR("ptime=%d not multiple of 10", codec->plugin->audio.ptime);
+ return -3;
+ }
+
+ // init input parameters from the codec
+ TMEDIA_PRODUCER(self)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(self)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(self)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+
+ AUDIO_OPENSLES_DEBUG_INFO("audio_producer_opensles_prepare(channels=%d, rate=%d, ptime=%d)", codec->plugin->audio.channels, codec->plugin->rate, codec->plugin->audio.ptime);
+
+ // prepare playout device and update output parameters
+ int ret;
+ ret = audio_opensles_instance_prepare_producer(self->audioInstHandle, &_self);
+
+ // now that the producer is prepared we can initialize internal buffer using device caps
+ if(ret == 0) {
+ // allocate buffer
+ int xsize = ((TMEDIA_PRODUCER(self)->audio.ptime * TMEDIA_PRODUCER(self)->audio.rate) / 1000) * (TMEDIA_PRODUCER(self)->audio.bits_per_sample >> 3);
+ AUDIO_OPENSLES_DEBUG_INFO("producer buffer xsize = %d", xsize);
+ if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
+ self->buffer.size = 0;
+ return -1;
+ }
+ self->buffer.size = xsize;
+ self->buffer.index = 0;
+ }
+ return ret;
}
static int audio_producer_opensles_start(tmedia_producer_t* _self)
{
- audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- AUDIO_OPENSLES_DEBUG_INFO("audio_producer_opensles_start");
-
- return audio_opensles_instance_start_producer(self->audioInstHandle);
+ audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ AUDIO_OPENSLES_DEBUG_INFO("audio_producer_opensles_start");
+
+ return audio_opensles_instance_start_producer(self->audioInstHandle);
}
static int audio_producer_opensles_pause(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
static int audio_producer_opensles_stop(tmedia_producer_t* _self)
{
- audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
- if(!self){
- AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_producer_opensles_t* self = (audio_producer_opensles_t*)_self;
+ if(!self) {
+ AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_opensles_instance_stop_producer(self->audioInstHandle);
+ return audio_opensles_instance_stop_producer(self->audioInstHandle);
}
@@ -186,54 +185,52 @@ static int audio_producer_opensles_stop(tmedia_producer_t* _self)
/* constructor */
static tsk_object_t* audio_producer_opensles_ctor(tsk_object_t *_self, va_list * app)
{
- audio_producer_opensles_t *self = (audio_producer_opensles_t *)_self;
- if(self){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(self));
- /* init self */
-
- }
- return self;
+ audio_producer_opensles_t *self = (audio_producer_opensles_t *)_self;
+ if(self) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(self));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* audio_producer_opensles_dtor(tsk_object_t *_self)
-{
- audio_producer_opensles_t *self = (audio_producer_opensles_t *)_self;
- if(self){
- /* stop */
- audio_producer_opensles_stop(TMEDIA_PRODUCER(self));
- /* deinit self */
- if(self->audioInstHandle){
- audio_opensles_instance_destroy(&self->audioInstHandle);
- }
- TSK_FREE(self->buffer.ptr);
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(self));
- }
-
- return self;
+{
+ audio_producer_opensles_t *self = (audio_producer_opensles_t *)_self;
+ if(self) {
+ /* stop */
+ audio_producer_opensles_stop(TMEDIA_PRODUCER(self));
+ /* deinit self */
+ if(self->audioInstHandle) {
+ audio_opensles_instance_destroy(&self->audioInstHandle);
+ }
+ TSK_FREE(self->buffer.ptr);
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t audio_producer_opensles_def_s =
-{
- sizeof(audio_producer_opensles_t),
- audio_producer_opensles_ctor,
- audio_producer_opensles_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t audio_producer_opensles_def_s = {
+ sizeof(audio_producer_opensles_t),
+ audio_producer_opensles_ctor,
+ audio_producer_opensles_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t audio_producer_opensles_plugin_def_s =
-{
- &audio_producer_opensles_def_s,
-
- tmedia_audio,
- "SLES audio producer",
-
- audio_producer_opensles_set,
- audio_producer_opensles_prepare,
- audio_producer_opensles_start,
- audio_producer_opensles_pause,
- audio_producer_opensles_stop
+static const tmedia_producer_plugin_def_t audio_producer_opensles_plugin_def_s = {
+ &audio_producer_opensles_def_s,
+
+ tmedia_audio,
+ "SLES audio producer",
+
+ audio_producer_opensles_set,
+ audio_producer_opensles_prepare,
+ audio_producer_opensles_start,
+ audio_producer_opensles_pause,
+ audio_producer_opensles_stop
};
const tmedia_producer_plugin_def_t *audio_producer_opensles_plugin_def_t = &audio_producer_opensles_plugin_def_s; \ No newline at end of file
diff --git a/plugins/audio_opensles/audio_opensles_producer.h b/plugins/audio_opensles/audio_opensles_producer.h
index 0c4c756..d6ce9d9 100755
--- a/plugins/audio_opensles/audio_opensles_producer.h
+++ b/plugins/audio_opensles/audio_opensles_producer.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/audio_opensles/dllmain.cxx b/plugins/audio_opensles/dllmain.cxx
index e6b34f4..295c340 100755
--- a/plugins/audio_opensles/dllmain.cxx
+++ b/plugins/audio_opensles/dllmain.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -20,16 +20,15 @@
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
diff --git a/plugins/audio_webrtc/audio_webrtc.cxx b/plugins/audio_webrtc/audio_webrtc.cxx
index 167166d..b604d49 100755
--- a/plugins/audio_webrtc/audio_webrtc.cxx
+++ b/plugins/audio_webrtc/audio_webrtc.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -37,99 +37,93 @@ using namespace webrtc;
#if DOUBANGO_AUDIO_WEBRTC_UNDER_ANDROID
// https://groups.google.com/group/android-ndk/browse_thread/thread/a1667f28162cf69b/8ef3a171df7f8dfe
-extern "C"
-{
- void *__dso_handle = NULL;
-}
+extern "C"
+{
+ void *__dso_handle = NULL;
+}
#endif
-typedef enum PLUGIN_INDEX_E
-{
- PLUGIN_INDEX_AUDIO_CONSUMER,
- PLUGIN_INDEX_AUDIO_PRODUCER,
- PLUGIN_INDEX_COUNT
+typedef enum PLUGIN_INDEX_E {
+ PLUGIN_INDEX_AUDIO_CONSUMER,
+ PLUGIN_INDEX_AUDIO_PRODUCER,
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER: return tsk_plugin_def_type_consumer;
- case PLUGIN_INDEX_AUDIO_PRODUCER: return tsk_plugin_def_type_producer;
- default:
- {
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ return tsk_plugin_def_type_consumer;
+ case PLUGIN_INDEX_AUDIO_PRODUCER:
+ return tsk_plugin_def_type_producer;
+ default: {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
+ }
+ }
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return tsk_plugin_def_media_type_audio;
- }
- default:
- {
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return tsk_plugin_def_media_type_audio;
+ }
+ default: {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
+ }
+ }
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- {
- return audio_consumer_webrtc_plugin_def_t;
- }
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return audio_producer_webrtc_plugin_def_t;
- }
- default:
- {
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_AUDIO_CONSUMER: {
+ return audio_consumer_webrtc_plugin_def_t;
+ }
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return audio_producer_webrtc_plugin_def_t;
+ }
+ default: {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
+ }
+ }
}
//
// WebRTC AudioInstance
//
-typedef struct audio_webrtc_instance_s
-{
- TSK_DECLARE_OBJECT;
-
- uint64_t sessionId;
-
- bool isStarted;
-
- bool isConsumerPrepared;
- bool isConsumerStarted;
- bool isProducerPrepared;
- bool isProducerStarted;
-
- bool isSpeakerAvailable;
- bool isPlayoutAvailable;
- bool isRecordingAvailable;
-
- AudioDeviceModule* device;
- AudioTransportImpl* transport;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct audio_webrtc_instance_s {
+ TSK_DECLARE_OBJECT;
+
+ uint64_t sessionId;
+
+ bool isStarted;
+
+ bool isConsumerPrepared;
+ bool isConsumerStarted;
+ bool isProducerPrepared;
+ bool isProducerStarted;
+
+ bool isSpeakerAvailable;
+ bool isPlayoutAvailable;
+ bool isRecordingAvailable;
+
+ AudioDeviceModule* device;
+ AudioTransportImpl* transport;
+
+ TSK_DECLARE_SAFEOBJ;
}
audio_webrtc_instance_t;
typedef tsk_list_t audio_webrtc_instances_L_t;
@@ -138,425 +132,425 @@ static audio_webrtc_instances_L_t* __audioInstances = tsk_null;
static tsk_object_t* audio_webrtc_instance_ctor(tsk_object_t * self, va_list * app)
{
- audio_webrtc_instance_t* audioInstance = (audio_webrtc_instance_t*)self;
- if(audioInstance){
- tsk_safeobj_init(audioInstance);
- }
- return self;
+ audio_webrtc_instance_t* audioInstance = (audio_webrtc_instance_t*)self;
+ if(audioInstance) {
+ tsk_safeobj_init(audioInstance);
+ }
+ return self;
}
static tsk_object_t* audio_webrtc_instance_dtor(tsk_object_t * self)
-{
- DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("Audio Instance destroyed");
- audio_webrtc_instance_t* audioInstance = (audio_webrtc_instance_t*)self;
- if(audioInstance){
+{
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("Audio Instance destroyed");
+ audio_webrtc_instance_t* audioInstance = (audio_webrtc_instance_t*)self;
+ if(audioInstance) {
tsk_safeobj_lock(audioInstance);
- if(audioInstance->device){
- audioInstance->device->RegisterAudioCallback(tsk_null);
- audioInstance->device->Terminate();
- audioInstance->device->Release();//FIXME: must be deleted?
- audioInstance->device = tsk_null;
- }
- if(audioInstance->transport){
- delete audioInstance->transport;
- audioInstance->transport = tsk_null;
- }
+ if(audioInstance->device) {
+ audioInstance->device->RegisterAudioCallback(tsk_null);
+ audioInstance->device->Terminate();
+ audioInstance->device->Release();//FIXME: must be deleted?
+ audioInstance->device = tsk_null;
+ }
+ if(audioInstance->transport) {
+ delete audioInstance->transport;
+ audioInstance->transport = tsk_null;
+ }
tsk_safeobj_unlock(audioInstance);
-
- tsk_safeobj_deinit(audioInstance);
- }
- return self;
+
+ tsk_safeobj_deinit(audioInstance);
+ }
+ return self;
}
static int audio_webrtc_instance_cmp(const tsk_object_t *_ai1, const tsk_object_t *_ai2)
{
- return ((int)_ai1 - (int)_ai2);
+ return ((int)_ai1 - (int)_ai2);
}
-static const tsk_object_def_t audio_webrtc_instance_def_s =
-{
- sizeof(audio_webrtc_instance_t),
- audio_webrtc_instance_ctor,
- audio_webrtc_instance_dtor,
- audio_webrtc_instance_cmp,
+static const tsk_object_def_t audio_webrtc_instance_def_s = {
+ sizeof(audio_webrtc_instance_t),
+ audio_webrtc_instance_ctor,
+ audio_webrtc_instance_dtor,
+ audio_webrtc_instance_cmp,
};
const tsk_object_def_t *audio_webrtc_instance_def_t = &audio_webrtc_instance_def_s;
audio_webrtc_instance_handle_t* audio_webrtc_instance_create(uint64_t sessionId)
{
- audio_webrtc_instance_t* audioInstance = tsk_null;
-
- // create list used to hold instances
- if(!__audioInstances && !(__audioInstances = tsk_list_create())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create new list");
- return tsk_null;
- }
-
- //= lock the list
- tsk_list_lock(__audioInstances);
-
- // find the instance from the list
- const tsk_list_item_t* item;
- tsk_list_foreach(item, __audioInstances){
- if(((audio_webrtc_instance_t*)item->data)->sessionId == sessionId){
- audioInstance = (audio_webrtc_instance_t*)tsk_object_ref(item->data);
- break;
- }
- }
-
- if(!audioInstance){
- audio_webrtc_instance_t* _audioInstance;
- if(!(_audioInstance = (audio_webrtc_instance_t*)tsk_object_new(&audio_webrtc_instance_def_s))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create new audio instance");
- goto done;
- }
-
- if(!(_audioInstance->device = AudioDeviceModuleImpl::Create(kAudioDeviceModuleId))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio device");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
- _audioInstance->device->AddRef();
-
- if(!(_audioInstance->transport = new AudioTransportImpl(_audioInstance->device))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio transport");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
- if((_audioInstance->device->RegisterAudioCallback(_audioInstance->transport))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::RegisterAudioCallback() failed");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
-
- if((_audioInstance->device->Init())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::Init() failed");
- TSK_OBJECT_SAFE_FREE(_audioInstance);
- goto done;
- }
-
- _audioInstance->sessionId = sessionId;
- audioInstance = _audioInstance;
- tsk_list_push_back_data(__audioInstances, (void**)&_audioInstance);
- }
+ audio_webrtc_instance_t* audioInstance = tsk_null;
+
+ // create list used to hold instances
+ if(!__audioInstances && !(__audioInstances = tsk_list_create())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create new list");
+ return tsk_null;
+ }
+
+ //= lock the list
+ tsk_list_lock(__audioInstances);
+
+ // find the instance from the list
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, __audioInstances) {
+ if(((audio_webrtc_instance_t*)item->data)->sessionId == sessionId) {
+ audioInstance = (audio_webrtc_instance_t*)tsk_object_ref(item->data);
+ break;
+ }
+ }
+
+ if(!audioInstance) {
+ audio_webrtc_instance_t* _audioInstance;
+ if(!(_audioInstance = (audio_webrtc_instance_t*)tsk_object_new(&audio_webrtc_instance_def_s))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create new audio instance");
+ goto done;
+ }
+
+ if(!(_audioInstance->device = AudioDeviceModuleImpl::Create(kAudioDeviceModuleId))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio device");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+ _audioInstance->device->AddRef();
+
+ if(!(_audioInstance->transport = new AudioTransportImpl(_audioInstance->device))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio transport");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+ if((_audioInstance->device->RegisterAudioCallback(_audioInstance->transport))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::RegisterAudioCallback() failed");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+
+ if((_audioInstance->device->Init())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::Init() failed");
+ TSK_OBJECT_SAFE_FREE(_audioInstance);
+ goto done;
+ }
+
+ _audioInstance->sessionId = sessionId;
+ audioInstance = _audioInstance;
+ tsk_list_push_back_data(__audioInstances, (void**)&_audioInstance);
+ }
done:
- //= unlock the list
- tsk_list_unlock(__audioInstances);
+ //= unlock the list
+ tsk_list_unlock(__audioInstances);
- return audioInstance;
+ return audioInstance;
}
int audio_webrtc_instance_prepare_consumer(audio_webrtc_instance_handle_t* _self, tmedia_consumer_t** _consumer)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport || !_consumer || !*_consumer){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- if(self->isConsumerPrepared){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already prepared");
- return 0;
- }
-
- int ret;
- bool _bool;
-
- tsk_safeobj_lock(self);
-
- self->transport->SetConsumer((const struct audio_consumer_webrtc_s*)*_consumer);
-
- if((ret = self->device->SetPlayoutDevice(DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule->SetPlayoutDevice(%d) failed", DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT);
- }
-
- if((ret = self->device->SpeakerIsAvailable(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SpeakerIsAvailable() failed with error code=%d", ret);
- }
- else{
- if(!_bool){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SpeakerIsAvailable() returned false");
- }
- self->isSpeakerAvailable = _bool;
- }
-
- if((ret = self->device->InitSpeaker())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("InitSpeaker() failed with error code=%d", ret);
- }
-
- if((ret = self->device->PlayoutIsAvailable(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutIsAvailable() returned false");
- }
- self->isPlayoutAvailable = _bool;
- }
-
- if((ret = self->device->SetStereoPlayout(((*_consumer)->audio.in.channels == 2)))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetStereoPlayout(%d==2) failed with error code=%d", (*_consumer)->audio.in.channels, ret);
- }
-
- //if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, (*_consumer)->audio.ptime))){
- // DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", (*_consumer)->audio.ptime, ret);
- //}
- // always request 10ms buffers. In all cases WebRTC don't support anything else
- if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, 10))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", 10, ret);
- }
-
- uint32_t playoutSampleRate = (*_consumer)->audio.out.rate ? (*_consumer)->audio.out.rate : (*_consumer)->audio.in.rate;
- if((ret = self->device->SetPlayoutSampleRate(playoutSampleRate))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutSampleRate(%d) failed with error code=%d", playoutSampleRate, ret);
- }
-
- if((ret = self->device->InitPlayout())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::InitPlayout() failed with error code = %d", ret);
- goto done;
- }
-
- // init output parameters
- if((ret = self->device->StereoPlayout(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StereoPlayout() failed with error code=%d", ret);
- }
- else{
- (*_consumer)->audio.out.channels = (_bool ? 2 : 1);
- }
- if((ret = self->device->PlayoutSampleRate(&playoutSampleRate))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutSampleRate() failed with error code=%d", ret);
- }
- else{
- (*_consumer)->audio.out.rate = playoutSampleRate;
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport || !_consumer || !*_consumer) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ if(self->isConsumerPrepared) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already prepared");
+ return 0;
+ }
+
+ int ret;
+ bool _bool;
+
+ tsk_safeobj_lock(self);
+
+ self->transport->SetConsumer((const struct audio_consumer_webrtc_s*)*_consumer);
+
+ if((ret = self->device->SetPlayoutDevice(DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule->SetPlayoutDevice(%d) failed", DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT);
+ }
+
+ if((ret = self->device->SpeakerIsAvailable(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SpeakerIsAvailable() failed with error code=%d", ret);
+ }
+ else {
+ if(!_bool) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SpeakerIsAvailable() returned false");
+ }
+ self->isSpeakerAvailable = _bool;
+ }
+
+ if((ret = self->device->InitSpeaker())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("InitSpeaker() failed with error code=%d", ret);
+ }
+
+ if((ret = self->device->PlayoutIsAvailable(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutIsAvailable() returned false");
+ }
+ self->isPlayoutAvailable = _bool;
+ }
+
+ if((ret = self->device->SetStereoPlayout(((*_consumer)->audio.in.channels == 2)))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetStereoPlayout(%d==2) failed with error code=%d", (*_consumer)->audio.in.channels, ret);
+ }
+
+ //if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, (*_consumer)->audio.ptime))){
+ // DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", (*_consumer)->audio.ptime, ret);
+ //}
+ // always request 10ms buffers. In all cases WebRTC don't support anything else
+ if((ret = self->device->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, 10))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutBuffer(%d ms) failed with error code=%d", 10, ret);
+ }
+
+ uint32_t playoutSampleRate = (*_consumer)->audio.out.rate ? (*_consumer)->audio.out.rate : (*_consumer)->audio.in.rate;
+ if((ret = self->device->SetPlayoutSampleRate(playoutSampleRate))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetPlayoutSampleRate(%d) failed with error code=%d", playoutSampleRate, ret);
+ }
+
+ if((ret = self->device->InitPlayout())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::InitPlayout() failed with error code = %d", ret);
+ goto done;
+ }
+
+ // init output parameters
+ if((ret = self->device->StereoPlayout(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StereoPlayout() failed with error code=%d", ret);
+ }
+ else {
+ (*_consumer)->audio.out.channels = (_bool ? 2 : 1);
+ }
+ if((ret = self->device->PlayoutSampleRate(&playoutSampleRate))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("PlayoutSampleRate() failed with error code=%d", ret);
+ }
+ else {
+ (*_consumer)->audio.out.rate = playoutSampleRate;
+ }
done:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- self->isConsumerPrepared = (ret == 0);
+ self->isConsumerPrepared = (ret == 0);
- return ret;
+ return ret;
}
int audio_webrtc_instance_prepare_producer(audio_webrtc_instance_handle_t* _self, tmedia_producer_t** _producer)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport || !_producer || !*_producer){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- if(self->isProducerPrepared){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Producer already prepared");
- return 0;
- }
-
- int ret;
- bool _bool;
-
- tsk_safeobj_lock(self);
-
- self->transport->SetProducer((const struct audio_producer_webrtc_s*)*_producer);
-
- if((ret = self->device->SetRecordingDevice(DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule->SetRecordingDevice(%d) failed", DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT);
- }
-
- if((ret = self->device->RecordingIsAvailable(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingIsAvailable() returned false");
- }
- self->isRecordingAvailable = _bool;
- }
-
- if((ret = self->device->MicrophoneIsAvailable(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("MicrophoneIsAvailable() failed with error code =%d", ret);
- }
- else{
- if(!_bool){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("MicrophoneIsAvailable() returned false");
- }
- else{
- if((ret = self->device->InitMicrophone())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("InitMicrophone() failed with error code =%d", ret);
- }
- }
- }
-
- if((ret = self->device->SetStereoRecording(((*_producer)->audio.channels == 2)))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetStereoRecording(%d==2) failed with error code=%d", (*_producer)->audio.channels, ret);
- }
-
- uint32_t recordingSampleRate = (*_producer)->audio.rate;
- if((ret = self->device->SetRecordingSampleRate(recordingSampleRate))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetRecordingSampleRate(%d) failed with error code=%d", recordingSampleRate, ret);
- }
-
- if((ret = self->device->InitRecording())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::InitRecording() failed with error code = %d", ret);
- goto done;
- }
-
- // init output parameters
- if((ret = self->device->StereoRecording(&_bool))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StereoRecording() failed with error code=%d", ret);
- }
- else{
- (*_producer)->audio.channels = (_bool ? 2 : 1);
- }
- if((ret = self->device->RecordingSampleRate(&recordingSampleRate))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingSampleRate() failed with error code=%d", ret);
- }
- else{
- (*_producer)->audio.rate = recordingSampleRate;
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport || !_producer || !*_producer) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ if(self->isProducerPrepared) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Producer already prepared");
+ return 0;
+ }
+
+ int ret;
+ bool _bool;
+
+ tsk_safeobj_lock(self);
+
+ self->transport->SetProducer((const struct audio_producer_webrtc_s*)*_producer);
+
+ if((ret = self->device->SetRecordingDevice(DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule->SetRecordingDevice(%d) failed", DOUBANGO_AUDIO_WEBRTC_DEVICE_DEFAULT);
+ }
+
+ if((ret = self->device->RecordingIsAvailable(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingIsAvailable() returned false");
+ }
+ self->isRecordingAvailable = _bool;
+ }
+
+ if((ret = self->device->MicrophoneIsAvailable(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("MicrophoneIsAvailable() failed with error code =%d", ret);
+ }
+ else {
+ if(!_bool) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("MicrophoneIsAvailable() returned false");
+ }
+ else {
+ if((ret = self->device->InitMicrophone())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("InitMicrophone() failed with error code =%d", ret);
+ }
+ }
+ }
+
+ if((ret = self->device->SetStereoRecording(((*_producer)->audio.channels == 2)))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetStereoRecording(%d==2) failed with error code=%d", (*_producer)->audio.channels, ret);
+ }
+
+ uint32_t recordingSampleRate = (*_producer)->audio.rate;
+ if((ret = self->device->SetRecordingSampleRate(recordingSampleRate))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("SetRecordingSampleRate(%d) failed with error code=%d", recordingSampleRate, ret);
+ }
+
+ if((ret = self->device->InitRecording())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("AudioDeviceModule::InitRecording() failed with error code = %d", ret);
+ goto done;
+ }
+
+ // init output parameters
+ if((ret = self->device->StereoRecording(&_bool))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StereoRecording() failed with error code=%d", ret);
+ }
+ else {
+ (*_producer)->audio.channels = (_bool ? 2 : 1);
+ }
+ if((ret = self->device->RecordingSampleRate(&recordingSampleRate))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("RecordingSampleRate() failed with error code=%d", ret);
+ }
+ else {
+ (*_producer)->audio.rate = recordingSampleRate;
+ }
done:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- self->isProducerPrepared = (ret == 0);
+ self->isProducerPrepared = (ret == 0);
- return ret;
+ return ret;
}
int audio_webrtc_instance_start_consumer(audio_webrtc_instance_handle_t* _self)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- if(!self->isConsumerPrepared){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Consumer not prepared");
- goto done;
- }
-
- if(self->isConsumerStarted){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already started");
- goto done;
- }
-
- if(self->isPlayoutAvailable){
- int ret;
- if((ret = self->device->StartPlayout())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StartPlayout() failed with error code = %d", ret);
- }
-
- self->isConsumerStarted = self->device->Playing();
- DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("isPlaying=%s", (self->isConsumerPrepared ? "true" : "false"));
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ if(!self->isConsumerPrepared) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Consumer not prepared");
+ goto done;
+ }
+
+ if(self->isConsumerStarted) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already started");
+ goto done;
+ }
+
+ if(self->isPlayoutAvailable) {
+ int ret;
+ if((ret = self->device->StartPlayout())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StartPlayout() failed with error code = %d", ret);
+ }
+
+ self->isConsumerStarted = self->device->Playing();
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("isPlaying=%s", (self->isConsumerPrepared ? "true" : "false"));
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isConsumerStarted ? 0 : -1);
+ tsk_safeobj_unlock(self);
+ return (self->isConsumerStarted ? 0 : -1);
}
int audio_webrtc_instance_start_producer(audio_webrtc_instance_handle_t* _self)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- if(!self->isProducerPrepared){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Producer not prepared");
- goto done;
- }
-
- if(self->isProducerStarted){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already started");
- goto done;
- }
-
- if(self->isRecordingAvailable){
- int ret;
- if((ret = self->device->StartRecording())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StartRecording() failed with error code = %d", ret);
- }
-
- self->isProducerStarted = self->device->Recording();
- DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("isRecording=%s", (self->isProducerStarted ? "true" : "false"));
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ if(!self->isProducerPrepared) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Producer not prepared");
+ goto done;
+ }
+
+ if(self->isProducerStarted) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN("Consumer already started");
+ goto done;
+ }
+
+ if(self->isRecordingAvailable) {
+ int ret;
+ if((ret = self->device->StartRecording())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StartRecording() failed with error code = %d", ret);
+ }
+
+ self->isProducerStarted = self->device->Recording();
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO("isRecording=%s", (self->isProducerStarted ? "true" : "false"));
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isProducerStarted ? 0 : -1);
- return 0;
+ tsk_safeobj_unlock(self);
+ return (self->isProducerStarted ? 0 : -1);
+ return 0;
}
int audio_webrtc_instance_stop_consumer(audio_webrtc_instance_handle_t* _self)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if(!self->isConsumerStarted){
- goto done;
- }
-
- int ret;
- if((ret = self->device->StopPlayout())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StopPlayout() failed with error code = %d", ret);
- }
- else{
- self->isConsumerStarted = self->device->Playing();
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!self->isConsumerStarted) {
+ goto done;
+ }
+
+ int ret;
+ if((ret = self->device->StopPlayout())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StopPlayout() failed with error code = %d", ret);
+ }
+ else {
+ self->isConsumerStarted = self->device->Playing();
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isConsumerStarted ? -1 : 0);
+ tsk_safeobj_unlock(self);
+ return (self->isConsumerStarted ? -1 : 0);
}
int audio_webrtc_instance_stop_producer(audio_webrtc_instance_handle_t* _self)
{
- audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
- if(!self || !self->device || !self->transport){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if(!self->isProducerStarted){
- goto done;
- }
-
- int ret;
- if((ret = self->device->StopRecording())){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StopRecording() failed with error code = %d", ret);
- }
- else{
- self->isProducerStarted = self->device->Recording();
- }
+ audio_webrtc_instance_t* self = (audio_webrtc_instance_t*)_self;
+ if(!self || !self->device || !self->transport) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!self->isProducerStarted) {
+ goto done;
+ }
+
+ int ret;
+ if((ret = self->device->StopRecording())) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("StopRecording() failed with error code = %d", ret);
+ }
+ else {
+ self->isProducerStarted = self->device->Recording();
+ }
done:
- tsk_safeobj_unlock(self);
- return (self->isProducerStarted ? -1 : 0);
+ tsk_safeobj_unlock(self);
+ return (self->isProducerStarted ? -1 : 0);
}
-int audio_webrtc_instance_destroy(audio_webrtc_instance_handle_t** _self){
- if(!_self || !*_self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_lock(__audioInstances);
- if(tsk_object_get_refcount(*_self)==1){
- tsk_list_remove_item_by_data(__audioInstances, *_self);
- }
- else {
- tsk_object_unref(*_self);
- }
- tsk_list_unlock(__audioInstances);
- *_self = tsk_null;
- return 0;
+int audio_webrtc_instance_destroy(audio_webrtc_instance_handle_t** _self)
+{
+ if(!_self || !*_self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_lock(__audioInstances);
+ if(tsk_object_get_refcount(*_self)==1) {
+ tsk_list_remove_item_by_data(__audioInstances, *_self);
+ }
+ else {
+ tsk_object_unref(*_self);
+ }
+ tsk_list_unlock(__audioInstances);
+ *_self = tsk_null;
+ return 0;
}
diff --git a/plugins/audio_webrtc/audio_webrtc.h b/plugins/audio_webrtc/audio_webrtc.h
index 115a243..070d2fb 100755
--- a/plugins/audio_webrtc/audio_webrtc.h
+++ b/plugins/audio_webrtc/audio_webrtc.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/audio_webrtc/audio_webrtc_config.h b/plugins/audio_webrtc/audio_webrtc_config.h
index dc7c1fd..d441703 100755
--- a/plugins/audio_webrtc/audio_webrtc_config.h
+++ b/plugins/audio_webrtc/audio_webrtc_config.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -72,13 +72,13 @@
# define DOUBANGO_AUDIO_WEBRTC_BEGIN_DECLS extern "C" {
# define DOUBANGO_AUDIO_WEBRTC_END_DECLS }
#else
-# define DOUBANGO_AUDIO_WEBRTC_BEGIN_DECLS
+# define DOUBANGO_AUDIO_WEBRTC_BEGIN_DECLS
# define DOUBANGO_AUDIO_WEBRTC_END_DECLS
#endif
#ifdef _MSC_VER
#if HAVE_FFMPEG // FFMPeg warnings (treated as errors)
-# pragma warning (disable:4244)
+# pragma warning (disable:4244)
#endif
# define inline __inline
# define _CRT_SECURE_NO_WARNINGS
@@ -96,7 +96,7 @@
#endif
#if HAVE_CONFIG_H
- #include "../config.h"
+#include "../config.h"
#endif
#if DOUBANGO_AUDIO_WEBRTC_UNDER_WINDOWS
@@ -113,22 +113,30 @@
#define ANDROID_DEBUG_TAG "plugin_audio_webrtc" // DDMS log tag when using eclise
static void DOUBANGO_AUDIO_WEBRTC_DEBUG_ANY(int level, const char* fmt, ...)
{
- char* message = tsk_null;
- va_list ap;
- va_start(ap, fmt);
- tsk_sprintf_2(&message, fmt, &ap);
-
- if(message){
- switch(level){
- case DEBUG_LEVEL_INFO: __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message); break;
- case DEBUG_LEVEL_WARN: __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message); break;
- case DEBUG_LEVEL_ERROR: __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message); break;
- case DEBUG_LEVEL_FATAL: __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message); break;
- }
- TSK_FREE(message);
- }
-
- va_end(ap);
+ char* message = tsk_null;
+ va_list ap;
+ va_start(ap, fmt);
+ tsk_sprintf_2(&message, fmt, &ap);
+
+ if(message) {
+ switch(level) {
+ case DEBUG_LEVEL_INFO:
+ __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
+ break;
+ case DEBUG_LEVEL_WARN:
+ __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
+ break;
+ case DEBUG_LEVEL_ERROR:
+ __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
+ break;
+ case DEBUG_LEVEL_FATAL:
+ __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
+ break;
+ }
+ TSK_FREE(message);
+ }
+
+ va_end(ap);
}
#define DOUBANGO_AUDIO_WEBRTC_DEBUG_INFO(FMT, ...) DOUBANGO_AUDIO_WEBRTC_DEBUG_ANY(DEBUG_LEVEL_INFO, FMT, ##__VA_ARGS__)
#define DOUBANGO_AUDIO_WEBRTC_DEBUG_WARN(FMT, ...) DOUBANGO_AUDIO_WEBRTC_DEBUG_ANY(DEBUG_LEVEL_WARN, FMT, ##__VA_ARGS__)
diff --git a/plugins/audio_webrtc/audio_webrtc_consumer.cxx b/plugins/audio_webrtc/audio_webrtc_consumer.cxx
index e55097b..8762a2d 100755
--- a/plugins/audio_webrtc/audio_webrtc_consumer.cxx
+++ b/plugins/audio_webrtc/audio_webrtc_consumer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,153 +24,152 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct audio_consumer_webrtc_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
- audio_webrtc_instance_handle_t* audioInstHandle;
- struct{
- void* ptr;
- bool isFull;
- int size;
- int index;
- } buffer;
+typedef struct audio_consumer_webrtc_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+ audio_webrtc_instance_handle_t* audioInstHandle;
+ struct {
+ void* ptr;
+ bool isFull;
+ int size;
+ int index;
+ } buffer;
}
audio_consumer_webrtc_t;
int audio_consumer_webrtc_get_data_10ms(const audio_consumer_webrtc_t* _self, void* audioSamples, int nSamples, int nBytesPerSample, int nChannels, int samplesPerSec, uint32_t &nSamplesOut)
{
- nSamplesOut = 0;
- if(!_self || !audioSamples || !nSamples){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((nSamples != (samplesPerSec / 100))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
- return -2;
- }
- if((nBytesPerSample != (TMEDIA_CONSUMER(_self)->audio.bits_per_sample >> 3))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
- return -3;
- }
- if((nChannels != TMEDIA_CONSUMER(_self)->audio.out.channels)){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not the expected number of channels", nChannels);
- return -4;
- }
-
- audio_consumer_webrtc_t* self = const_cast<audio_consumer_webrtc_t*>(_self);
-
- if(self->buffer.index == self->buffer.size){
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
- self->buffer.index = 0;
- if((tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->buffer.ptr, self->buffer.size)) != self->buffer.size){
- nSamplesOut = 0;
- return 0;
- }
- }
-
- int nSamplesInBits = (nSamples * nBytesPerSample);
- if(_self->buffer.index + nSamplesInBits <= _self->buffer.size){
- memcpy(audioSamples, (((uint8_t*)self->buffer.ptr) + self->buffer.index), nSamplesInBits);
- }
- self->buffer.index += nSamplesInBits;
- TSK_CLAMP(0, self->buffer.index, self->buffer.size);
- nSamplesOut = nSamples;
-
- return 0;
+ nSamplesOut = 0;
+ if(!_self || !audioSamples || !nSamples) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((nSamples != (samplesPerSec / 100))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
+ return -2;
+ }
+ if((nBytesPerSample != (TMEDIA_CONSUMER(_self)->audio.bits_per_sample >> 3))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
+ return -3;
+ }
+ if((nChannels != TMEDIA_CONSUMER(_self)->audio.out.channels)) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not the expected number of channels", nChannels);
+ return -4;
+ }
+
+ audio_consumer_webrtc_t* self = const_cast<audio_consumer_webrtc_t*>(_self);
+
+ if(self->buffer.index == self->buffer.size) {
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
+ self->buffer.index = 0;
+ if((tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->buffer.ptr, self->buffer.size)) != self->buffer.size) {
+ nSamplesOut = 0;
+ return 0;
+ }
+ }
+
+ int nSamplesInBits = (nSamples * nBytesPerSample);
+ if(_self->buffer.index + nSamplesInBits <= _self->buffer.size) {
+ memcpy(audioSamples, (((uint8_t*)self->buffer.ptr) + self->buffer.index), nSamplesInBits);
+ }
+ self->buffer.index += nSamplesInBits;
+ TSK_CLAMP(0, self->buffer.index, self->buffer.size);
+ nSamplesOut = nSamples;
+
+ return 0;
}
/* ============ Media Consumer Interface ================= */
static int audio_consumer_webrtc_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- audio_consumer_webrtc_t* webrtc = (audio_consumer_webrtc_t*)self;
- int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ audio_consumer_webrtc_t* webrtc = (audio_consumer_webrtc_t*)self;
+ int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
- if(ret == 0){
- if(tsk_striequals(param->key, "volume")){
-
- }
- }
+ if(ret == 0) {
+ if(tsk_striequals(param->key, "volume")) {
- return ret;
+ }
+ }
+
+ return ret;
}
static int audio_consumer_webrtc_prepare(tmedia_consumer_t* _self, const tmedia_codec_t* codec)
{
- audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
- if(!self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // create audio instance
- if(!(self->audioInstHandle = audio_webrtc_instance_create(TMEDIA_CONSUMER(self)->session_id))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio instance handle");
- return -1;
- }
-
- // initialize input parameters from the codec information
- TMEDIA_CONSUMER(self)->audio.ptime = codec->plugin->audio.ptime;
- TMEDIA_CONSUMER(self)->audio.in.channels = codec->plugin->audio.channels;
- TMEDIA_CONSUMER(self)->audio.in.rate = codec->plugin->rate;
-
- // prepare playout device and update output parameters
- int ret = audio_webrtc_instance_prepare_consumer(self->audioInstHandle, &_self);
-
- // now that the producer is prepared we can initialize internal buffer using device caps
- if(ret == 0){
- // allocate buffer
- int xsize = ((TMEDIA_CONSUMER(self)->audio.ptime * TMEDIA_CONSUMER(self)->audio.out.rate) / 1000) * (TMEDIA_CONSUMER(self)->audio.bits_per_sample >> 3);
- if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
- self->buffer.size = 0;
- return -1;
- }
- memset(self->buffer.ptr, 0, xsize);
- self->buffer.size = xsize;
- self->buffer.index = 0;
- self->buffer.isFull = false;
- }
- return ret;
+ audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
+ if(!self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // create audio instance
+ if(!(self->audioInstHandle = audio_webrtc_instance_create(TMEDIA_CONSUMER(self)->session_id))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio instance handle");
+ return -1;
+ }
+
+ // initialize input parameters from the codec information
+ TMEDIA_CONSUMER(self)->audio.ptime = codec->plugin->audio.ptime;
+ TMEDIA_CONSUMER(self)->audio.in.channels = codec->plugin->audio.channels;
+ TMEDIA_CONSUMER(self)->audio.in.rate = codec->plugin->rate;
+
+ // prepare playout device and update output parameters
+ int ret = audio_webrtc_instance_prepare_consumer(self->audioInstHandle, &_self);
+
+ // now that the producer is prepared we can initialize internal buffer using device caps
+ if(ret == 0) {
+ // allocate buffer
+ int xsize = ((TMEDIA_CONSUMER(self)->audio.ptime * TMEDIA_CONSUMER(self)->audio.out.rate) / 1000) * (TMEDIA_CONSUMER(self)->audio.bits_per_sample >> 3);
+ if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
+ self->buffer.size = 0;
+ return -1;
+ }
+ memset(self->buffer.ptr, 0, xsize);
+ self->buffer.size = xsize;
+ self->buffer.index = 0;
+ self->buffer.isFull = false;
+ }
+ return ret;
}
static int audio_consumer_webrtc_start(tmedia_consumer_t* _self)
{
- audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
- if(!self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
+ if(!self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_webrtc_instance_start_consumer(self->audioInstHandle);
+ return audio_webrtc_instance_start_consumer(self->audioInstHandle);
}
static int audio_consumer_webrtc_consume(tmedia_consumer_t* _self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
- if(!self || !buffer || !size){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("1Invalid parameter");
- return -1;
- }
- /* buffer is already decoded */
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
+ audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
+ if(!self || !buffer || !size) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("1Invalid parameter");
+ return -1;
+ }
+ /* buffer is already decoded */
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
}
static int audio_consumer_webrtc_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int audio_consumer_webrtc_stop(tmedia_consumer_t* _self)
{
- audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
- if(!self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_consumer_webrtc_t* self = (audio_consumer_webrtc_t*)_self;
+ if(!self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_webrtc_instance_stop_consumer(self->audioInstHandle);
+ return audio_webrtc_instance_stop_consumer(self->audioInstHandle);
}
@@ -180,54 +179,52 @@ static int audio_consumer_webrtc_stop(tmedia_consumer_t* _self)
/* constructor */
static tsk_object_t* audio_consumer_webrtc_ctor(tsk_object_t *_self, va_list * app)
{
- audio_consumer_webrtc_t *self = (audio_consumer_webrtc_t *)_self;
- if(self){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(self));
- /* init self */
-
- }
- return self;
+ audio_consumer_webrtc_t *self = (audio_consumer_webrtc_t *)_self;
+ if(self) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(self));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* audio_consumer_webrtc_dtor(tsk_object_t *_self)
-{
- audio_consumer_webrtc_t *self = (audio_consumer_webrtc_t *)_self;
- if(self){
- /* stop */
- audio_consumer_webrtc_stop(TMEDIA_CONSUMER(self));
- /* deinit self */
- if(self->audioInstHandle){
- audio_webrtc_instance_destroy(&self->audioInstHandle);
- }
- TSK_FREE(self->buffer.ptr);
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(self));
- }
-
- return self;
+{
+ audio_consumer_webrtc_t *self = (audio_consumer_webrtc_t *)_self;
+ if(self) {
+ /* stop */
+ audio_consumer_webrtc_stop(TMEDIA_CONSUMER(self));
+ /* deinit self */
+ if(self->audioInstHandle) {
+ audio_webrtc_instance_destroy(&self->audioInstHandle);
+ }
+ TSK_FREE(self->buffer.ptr);
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t audio_consumer_webrtc_def_s =
-{
- sizeof(audio_consumer_webrtc_t),
- audio_consumer_webrtc_ctor,
- audio_consumer_webrtc_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t audio_consumer_webrtc_def_s = {
+ sizeof(audio_consumer_webrtc_t),
+ audio_consumer_webrtc_ctor,
+ audio_consumer_webrtc_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t audio_consumer_webrtc_plugin_def_s =
-{
- &audio_consumer_webrtc_def_s,
-
- tmedia_audio,
- "WebRTC audio consumer",
-
- audio_consumer_webrtc_set,
- audio_consumer_webrtc_prepare,
- audio_consumer_webrtc_start,
- audio_consumer_webrtc_consume,
- audio_consumer_webrtc_pause,
- audio_consumer_webrtc_stop
+static const tmedia_consumer_plugin_def_t audio_consumer_webrtc_plugin_def_s = {
+ &audio_consumer_webrtc_def_s,
+
+ tmedia_audio,
+ "WebRTC audio consumer",
+
+ audio_consumer_webrtc_set,
+ audio_consumer_webrtc_prepare,
+ audio_consumer_webrtc_start,
+ audio_consumer_webrtc_consume,
+ audio_consumer_webrtc_pause,
+ audio_consumer_webrtc_stop
};
const tmedia_consumer_plugin_def_t *audio_consumer_webrtc_plugin_def_t = &audio_consumer_webrtc_plugin_def_s;
diff --git a/plugins/audio_webrtc/audio_webrtc_consumer.h b/plugins/audio_webrtc/audio_webrtc_consumer.h
index 9dc7dd1..8874f6d 100755
--- a/plugins/audio_webrtc/audio_webrtc_consumer.h
+++ b/plugins/audio_webrtc/audio_webrtc_consumer.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -22,7 +22,7 @@
DOUBANGO_AUDIO_WEBRTC_BEGIN_DECLS
-extern const struct tmedia_consumer_plugin_def_s *audio_consumer_webrtc_plugin_def_t;
+extern const struct tmedia_consumer_plugin_def_s *audio_consumer_webrtc_plugin_def_t;
int audio_consumer_webrtc_get_data_10ms(const struct audio_consumer_webrtc_s* self, void* audioSamples, int nSamples, int nBytesPerSample, int nChannels, int samplesPerSec, uint32_t &nSamplesOut);
diff --git a/plugins/audio_webrtc/audio_webrtc_producer.cxx b/plugins/audio_webrtc/audio_webrtc_producer.cxx
index 02c5aeb..3d95d06 100755
--- a/plugins/audio_webrtc/audio_webrtc_producer.cxx
+++ b/plugins/audio_webrtc/audio_webrtc_producer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,147 +24,146 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct audio_producer_webrtc_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- bool isMuted;
- audio_webrtc_instance_handle_t* audioInstHandle;
- struct{
- void* ptr;
- int size;
- int index;
- } buffer;
+typedef struct audio_producer_webrtc_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ bool isMuted;
+ audio_webrtc_instance_handle_t* audioInstHandle;
+ struct {
+ void* ptr;
+ int size;
+ int index;
+ } buffer;
}
audio_producer_webrtc_t;
int audio_producer_webrtc_handle_data_10ms(const audio_producer_webrtc_t* _self, const void* audioSamples, int nSamples, int nBytesPerSample, int samplesPerSec, int nChannels)
{
- if(!_self || !audioSamples || !nSamples){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((nSamples != (samplesPerSec / 100))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
- return -2;
- }
- if((nBytesPerSample != (TMEDIA_PRODUCER(_self)->audio.bits_per_sample >> 3))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
- return -3;
- }
- if((nChannels != TMEDIA_PRODUCER(_self)->audio.channels)){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not the expected number of channels", nChannels);
- return -4;
- }
-
- int nSamplesInBits = (nSamples * nBytesPerSample);
- if(_self->buffer.index + nSamplesInBits > _self->buffer.size){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Buffer overflow");
- return -5;
- }
-
- audio_producer_webrtc_t* self = const_cast<audio_producer_webrtc_t*>(_self);
-
- memcpy((((uint8_t*)self->buffer.ptr) + self->buffer.index), audioSamples, nSamplesInBits);
- self->buffer.index += nSamplesInBits;
-
- if(self->buffer.index == self->buffer.size){
- self->buffer.index = 0;
- if(TMEDIA_PRODUCER(self)->enc_cb.callback){
- if(self->isMuted){
- memset(self->buffer.ptr, 0, self->buffer.size);
- }
- TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, self->buffer.ptr, self->buffer.size);
- }
- }
-
- return 0;
+ if(!_self || !audioSamples || !nSamples) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((nSamples != (samplesPerSec / 100))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Not producing 10ms samples (nSamples=%d, samplesPerSec=%d)", nSamples, samplesPerSec);
+ return -2;
+ }
+ if((nBytesPerSample != (TMEDIA_PRODUCER(_self)->audio.bits_per_sample >> 3))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not valid bytes/samples", nBytesPerSample);
+ return -3;
+ }
+ if((nChannels != TMEDIA_PRODUCER(_self)->audio.channels)) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("%d not the expected number of channels", nChannels);
+ return -4;
+ }
+
+ int nSamplesInBits = (nSamples * nBytesPerSample);
+ if(_self->buffer.index + nSamplesInBits > _self->buffer.size) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Buffer overflow");
+ return -5;
+ }
+
+ audio_producer_webrtc_t* self = const_cast<audio_producer_webrtc_t*>(_self);
+
+ memcpy((((uint8_t*)self->buffer.ptr) + self->buffer.index), audioSamples, nSamplesInBits);
+ self->buffer.index += nSamplesInBits;
+
+ if(self->buffer.index == self->buffer.size) {
+ self->buffer.index = 0;
+ if(TMEDIA_PRODUCER(self)->enc_cb.callback) {
+ if(self->isMuted) {
+ memset(self->buffer.ptr, 0, self->buffer.size);
+ }
+ TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, self->buffer.ptr, self->buffer.size);
+ }
+ }
+
+ return 0;
}
/* ============ Media Producer Interface ================= */
static int audio_producer_webrtc_set(tmedia_producer_t* _self, const tmedia_param_t* param)
-{
- audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
- if(param->plugin_type == tmedia_ppt_producer){
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "mute")){
- self->isMuted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+{
+ audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "mute")) {
+ self->isMuted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int audio_producer_webrtc_prepare(tmedia_producer_t* _self, const tmedia_codec_t* codec)
{
- audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
- if(!self || !codec){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // create audio instance
- if(!(self->audioInstHandle = audio_webrtc_instance_create(TMEDIA_PRODUCER(self)->session_id))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio instance handle");
- return -2;
- }
-
- // check that ptime is mutiple of 10
- if((codec->plugin->audio.ptime % 10)){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("ptime=%d not multiple of 10", codec->plugin->audio.ptime);
- return -3;
- }
-
- // init input parameters from the codec
- TMEDIA_PRODUCER(self)->audio.channels = codec->plugin->audio.channels;
- TMEDIA_PRODUCER(self)->audio.rate = codec->plugin->rate;
- TMEDIA_PRODUCER(self)->audio.ptime = codec->plugin->audio.ptime;
-
- // prepare playout device and update output parameters
- int ret;
- ret = audio_webrtc_instance_prepare_producer(self->audioInstHandle, &_self);
-
- // now that the producer is prepared we can initialize internal buffer using device caps
- if(ret == 0){
- // allocate buffer
- int xsize = ((TMEDIA_PRODUCER(self)->audio.ptime * TMEDIA_PRODUCER(self)->audio.rate) / 1000) * (TMEDIA_PRODUCER(self)->audio.bits_per_sample >> 3);
- if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
- self->buffer.size = 0;
- return -1;
- }
- self->buffer.size = xsize;
- self->buffer.index = 0;
- }
- return ret;
+ audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
+ if(!self || !codec) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // create audio instance
+ if(!(self->audioInstHandle = audio_webrtc_instance_create(TMEDIA_PRODUCER(self)->session_id))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to create audio instance handle");
+ return -2;
+ }
+
+ // check that ptime is mutiple of 10
+ if((codec->plugin->audio.ptime % 10)) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("ptime=%d not multiple of 10", codec->plugin->audio.ptime);
+ return -3;
+ }
+
+ // init input parameters from the codec
+ TMEDIA_PRODUCER(self)->audio.channels = codec->plugin->audio.channels;
+ TMEDIA_PRODUCER(self)->audio.rate = codec->plugin->rate;
+ TMEDIA_PRODUCER(self)->audio.ptime = codec->plugin->audio.ptime;
+
+ // prepare playout device and update output parameters
+ int ret;
+ ret = audio_webrtc_instance_prepare_producer(self->audioInstHandle, &_self);
+
+ // now that the producer is prepared we can initialize internal buffer using device caps
+ if(ret == 0) {
+ // allocate buffer
+ int xsize = ((TMEDIA_PRODUCER(self)->audio.ptime * TMEDIA_PRODUCER(self)->audio.rate) / 1000) * (TMEDIA_PRODUCER(self)->audio.bits_per_sample >> 3);
+ if(!(self->buffer.ptr = tsk_realloc(self->buffer.ptr, xsize))) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Failed to allocate buffer with size = %d", xsize);
+ self->buffer.size = 0;
+ return -1;
+ }
+ self->buffer.size = xsize;
+ self->buffer.index = 0;
+ }
+ return ret;
}
static int audio_producer_webrtc_start(tmedia_producer_t* _self)
{
- audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
- if(!self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
+ if(!self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_webrtc_instance_start_producer(self->audioInstHandle);
+ return audio_webrtc_instance_start_producer(self->audioInstHandle);
}
static int audio_producer_webrtc_pause(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
static int audio_producer_webrtc_stop(tmedia_producer_t* _self)
{
- audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
- if(!self){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ audio_producer_webrtc_t* self = (audio_producer_webrtc_t*)_self;
+ if(!self) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return audio_webrtc_instance_stop_producer(self->audioInstHandle);
+ return audio_webrtc_instance_stop_producer(self->audioInstHandle);
}
@@ -174,54 +173,52 @@ static int audio_producer_webrtc_stop(tmedia_producer_t* _self)
/* constructor */
static tsk_object_t* audio_producer_webrtc_ctor(tsk_object_t *_self, va_list * app)
{
- audio_producer_webrtc_t *self = (audio_producer_webrtc_t *)_self;
- if(self){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(self));
- /* init self */
-
- }
- return self;
+ audio_producer_webrtc_t *self = (audio_producer_webrtc_t *)_self;
+ if(self) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(self));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* audio_producer_webrtc_dtor(tsk_object_t *_self)
-{
- audio_producer_webrtc_t *self = (audio_producer_webrtc_t *)_self;
- if(self){
- /* stop */
- audio_producer_webrtc_stop(TMEDIA_PRODUCER(self));
- /* deinit self */
- if(self->audioInstHandle){
- audio_webrtc_instance_destroy(&self->audioInstHandle);
- }
- TSK_FREE(self->buffer.ptr);
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(self));
- }
-
- return self;
+{
+ audio_producer_webrtc_t *self = (audio_producer_webrtc_t *)_self;
+ if(self) {
+ /* stop */
+ audio_producer_webrtc_stop(TMEDIA_PRODUCER(self));
+ /* deinit self */
+ if(self->audioInstHandle) {
+ audio_webrtc_instance_destroy(&self->audioInstHandle);
+ }
+ TSK_FREE(self->buffer.ptr);
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t audio_producer_webrtc_def_s =
-{
- sizeof(audio_producer_webrtc_t),
- audio_producer_webrtc_ctor,
- audio_producer_webrtc_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t audio_producer_webrtc_def_s = {
+ sizeof(audio_producer_webrtc_t),
+ audio_producer_webrtc_ctor,
+ audio_producer_webrtc_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t audio_producer_webrtc_plugin_def_s =
-{
- &audio_producer_webrtc_def_s,
-
- tmedia_audio,
- "WebRTC audio producer",
-
- audio_producer_webrtc_set,
- audio_producer_webrtc_prepare,
- audio_producer_webrtc_start,
- audio_producer_webrtc_pause,
- audio_producer_webrtc_stop
+static const tmedia_producer_plugin_def_t audio_producer_webrtc_plugin_def_s = {
+ &audio_producer_webrtc_def_s,
+
+ tmedia_audio,
+ "WebRTC audio producer",
+
+ audio_producer_webrtc_set,
+ audio_producer_webrtc_prepare,
+ audio_producer_webrtc_start,
+ audio_producer_webrtc_pause,
+ audio_producer_webrtc_stop
};
const tmedia_producer_plugin_def_t *audio_producer_webrtc_plugin_def_t = &audio_producer_webrtc_plugin_def_s; \ No newline at end of file
diff --git a/plugins/audio_webrtc/audio_webrtc_producer.h b/plugins/audio_webrtc/audio_webrtc_producer.h
index 49adf0d..0e1defd 100755
--- a/plugins/audio_webrtc/audio_webrtc_producer.h
+++ b/plugins/audio_webrtc/audio_webrtc_producer.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/audio_webrtc/audio_webrtc_transport.cxx b/plugins/audio_webrtc/audio_webrtc_transport.cxx
index 470e4e7..a9b50ed 100755
--- a/plugins/audio_webrtc/audio_webrtc_transport.cxx
+++ b/plugins/audio_webrtc/audio_webrtc_transport.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,15 +33,15 @@ AudioTransportImpl::AudioTransportImpl(AudioDeviceModule* audioDevice) :
_microphoneBoost(false),
_microphoneAGC(false),
_loopBackMeasurements(false),
- _consumer(tsk_null),
- _producer(tsk_null)
+ _consumer(tsk_null),
+ _producer(tsk_null)
{
-
+
}
AudioTransportImpl::~AudioTransportImpl()
{
-
+
}
void AudioTransportImpl::SetFullDuplex(bool enable)
@@ -60,11 +60,11 @@ WebRtc_Word32 AudioTransportImpl::RecordedDataIsAvailable(
const WebRtc_UWord32 currentMicLevel,
WebRtc_UWord32& newMicLevel)
{
- if(!_producer){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No wrapped producer");
- return 0;
- }
- return audio_producer_webrtc_handle_data_10ms(_producer, audioSamples, nSamples, nBytesPerSample, samplesPerSec, nChannels);
+ if(!_producer) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No wrapped producer");
+ return 0;
+ }
+ return audio_producer_webrtc_handle_data_10ms(_producer, audioSamples, nSamples, nBytesPerSample, samplesPerSec, nChannels);
}
@@ -76,9 +76,9 @@ WebRtc_Word32 AudioTransportImpl::NeedMorePlayData(
void* audioSamples,
WebRtc_UWord32& nSamplesOut)
{
- if(!_consumer){
- DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No wrapped consumer");
- return 0;
- }
- return audio_consumer_webrtc_get_data_10ms(_consumer, audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec, nSamplesOut);
+ if(!_consumer) {
+ DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No wrapped consumer");
+ return 0;
+ }
+ return audio_consumer_webrtc_get_data_10ms(_consumer, audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec, nSamplesOut);
} \ No newline at end of file
diff --git a/plugins/audio_webrtc/audio_webrtc_transport.h b/plugins/audio_webrtc/audio_webrtc_transport.h
index 6d98ab5..07e5ac8 100755
--- a/plugins/audio_webrtc/audio_webrtc_transport.h
+++ b/plugins/audio_webrtc/audio_webrtc_transport.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,15 +26,15 @@ class AudioTransportImpl: public webrtc::AudioTransport
{
public:
virtual WebRtc_Word32
- RecordedDataIsAvailable(const void* audioSamples,
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 samplesPerSec,
- const WebRtc_UWord32 totalDelayMS,
- const WebRtc_Word32 clockDrift,
- const WebRtc_UWord32 currentMicLevel,
- WebRtc_UWord32& newMicLevel);
+ RecordedDataIsAvailable(const void* audioSamples,
+ const WebRtc_UWord32 nSamples,
+ const WebRtc_UWord8 nBytesPerSample,
+ const WebRtc_UWord8 nChannels,
+ const WebRtc_UWord32 samplesPerSec,
+ const WebRtc_UWord32 totalDelayMS,
+ const WebRtc_Word32 clockDrift,
+ const WebRtc_UWord32 currentMicLevel,
+ WebRtc_UWord32& newMicLevel);
virtual WebRtc_Word32 NeedMorePlayData(const WebRtc_UWord32 nSamples,
const WebRtc_UWord8 nBytesPerSample,
@@ -43,63 +43,54 @@ public:
void* audioSamples,
WebRtc_UWord32& nSamplesOut);
- AudioTransportImpl(webrtc::AudioDeviceModule* audioDevice);
+ AudioTransportImpl(webrtc::AudioDeviceModule* audioDevice);
~AudioTransportImpl();
public:
void SetFullDuplex(bool enable);
- void SetSpeakerVolume(bool enable)
- {
+ void SetSpeakerVolume(bool enable) {
_speakerVolume = enable;
}
;
- void SetSpeakerMute(bool enable)
- {
+ void SetSpeakerMute(bool enable) {
_speakerMute = enable;
}
;
- void SetMicrophoneMute(bool enable)
- {
+ void SetMicrophoneMute(bool enable) {
_microphoneMute = enable;
}
;
- void SetMicrophoneVolume(bool enable)
- {
+ void SetMicrophoneVolume(bool enable) {
_microphoneVolume = enable;
}
;
- void SetMicrophoneBoost(bool enable)
- {
+ void SetMicrophoneBoost(bool enable) {
_microphoneBoost = enable;
}
;
- void SetLoopbackMeasurements(bool enable)
- {
+ void SetLoopbackMeasurements(bool enable) {
_loopBackMeasurements = enable;
}
;
- void SetMicrophoneAGC(bool enable)
- {
+ void SetMicrophoneAGC(bool enable) {
_microphoneAGC = enable;
}
;
- void SetConsumer(const struct audio_consumer_webrtc_s* consumer)
- {
+ void SetConsumer(const struct audio_consumer_webrtc_s* consumer) {
_consumer = consumer;
}
;
- void SetProducer(const struct audio_producer_webrtc_s* producer)
- {
+ void SetProducer(const struct audio_producer_webrtc_s* producer) {
_producer = producer;
}
;
private:
webrtc::AudioDeviceModule* _audioDevice;
- const struct audio_consumer_webrtc_s* _consumer; // mut be const and must not take reference
- const struct audio_producer_webrtc_s* _producer; // mut be const and must not take reference
+ const struct audio_consumer_webrtc_s* _consumer; // mut be const and must not take reference
+ const struct audio_producer_webrtc_s* _producer; // mut be const and must not take reference
bool _fullDuplex;
bool _speakerVolume;
diff --git a/plugins/audio_webrtc/dllmain.cxx b/plugins/audio_webrtc/dllmain.cxx
index 8a319bc..06fc5ff 100755
--- a/plugins/audio_webrtc/dllmain.cxx
+++ b/plugins/audio_webrtc/dllmain.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,16 +24,15 @@
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
diff --git a/plugins/pluginCUDA/dllmain_cuda.cxx b/plugins/pluginCUDA/dllmain_cuda.cxx
index 57c3ffd..a3d6967 100755
--- a/plugins/pluginCUDA/dllmain_cuda.cxx
+++ b/plugins/pluginCUDA/dllmain_cuda.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -54,84 +54,78 @@ PLUGIN_CUDA_END_DECLS /* END */
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
-typedef enum PLUGIN_INDEX_E
-{
+typedef enum PLUGIN_INDEX_E {
#if PLUGIN_CUDA_H264_ENABLE
- PLUGIN_INDEX_CODEC_H264_MAIN,
- PLUGIN_INDEX_CODEC_H264_BASE,
+ PLUGIN_INDEX_CODEC_H264_MAIN,
+ PLUGIN_INDEX_CODEC_H264_BASE,
#endif
-
- PLUGIN_INDEX_COUNT
+
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return CudaUtils::IsH264Supported() ? PLUGIN_INDEX_COUNT : 0;
+ return CudaUtils::IsH264Supported() ? PLUGIN_INDEX_COUNT : 0;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
#if PLUGIN_CUDA_H264_ENABLE
- switch(index){
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return CudaUtils::IsH264Supported() ? tsk_plugin_def_type_codec : tsk_plugin_def_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CODEC_H264_MAIN:
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return CudaUtils::IsH264Supported() ? tsk_plugin_def_type_codec : tsk_plugin_def_type_none;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
#if PLUGIN_CUDA_H264_ENABLE
- switch(index){
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return CudaUtils::IsH264Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CODEC_H264_MAIN:
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return CudaUtils::IsH264Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
#if PLUGIN_CUDA_H264_ENABLE
- switch(index){
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- {
- return CudaUtils::IsH264Supported() ? cuda_codec_h264_main_plugin_def_t : tsk_null;
- }
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return CudaUtils::IsH264Supported() ? cuda_codec_h264_base_plugin_def_t : tsk_null;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CODEC_H264_MAIN: {
+ return CudaUtils::IsH264Supported() ? cuda_codec_h264_main_plugin_def_t : tsk_null;
+ }
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return CudaUtils::IsH264Supported() ? cuda_codec_h264_base_plugin_def_t : tsk_null;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
}
diff --git a/plugins/pluginCUDA/plugin_cuda_codec_h264.cxx b/plugins/pluginCUDA/plugin_cuda_codec_h264.cxx
index b2c8e2e..4bc1d53 100755
--- a/plugins/pluginCUDA/plugin_cuda_codec_h264.cxx
+++ b/plugins/pluginCUDA/plugin_cuda_codec_h264.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -43,52 +43,51 @@
#include <cuda.h>
#include <Windows.h>
-typedef struct cuda_codec_h264_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
-
- // Encoder
- struct{
- NVEncoder pInst;
- NVEncoderParams ctxParams;
- NVVE_CallbackParams clbParams;
- void* pBufferPtr;
- tsk_size_t nBufferSize;
- int64_t frame_count;
- tsk_bool_t force_idr;
- int32_t quality; // [1-31]
- int rotation;
- int neg_width;
- int neg_height;
- int neg_fps;
- int max_bitrate_bps;
- int32_t max_bw_kpbs;
- tsk_bool_t passthrough; // whether to bypass encoding
- } encoder;
-
- // decoder
- struct{
- CUvideodecoder pInst;
- CUVIDDECODECREATEINFO cuInfo;
- CUvideoparser cuParser;
- CUVIDPARSERPARAMS cuPaserParams;
- CUdevice cuDevice;
- IDirect3D9 *pD3D9;
- IDirect3DDevice9 *pD3D9Device;
- CUcontext cuContext;
- struct {
- void *pcuPtr; // MUST bee freed using cuMemFreeHost()
- tsk_size_t nSize;
- tsk_size_t nPitch;
- tsk_bool_t bAvail;
- } cuBuffer;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- uint16_t last_seq;
- tsk_bool_t passthrough; // whether to bypass decoding
- tsk_mutex_handle_t *phMutex;
- } decoder;
+typedef struct cuda_codec_h264_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
+
+ // Encoder
+ struct {
+ NVEncoder pInst;
+ NVEncoderParams ctxParams;
+ NVVE_CallbackParams clbParams;
+ void* pBufferPtr;
+ tsk_size_t nBufferSize;
+ int64_t frame_count;
+ tsk_bool_t force_idr;
+ int32_t quality; // [1-31]
+ int rotation;
+ int neg_width;
+ int neg_height;
+ int neg_fps;
+ int max_bitrate_bps;
+ int32_t max_bw_kpbs;
+ tsk_bool_t passthrough; // whether to bypass encoding
+ } encoder;
+
+ // decoder
+ struct {
+ CUvideodecoder pInst;
+ CUVIDDECODECREATEINFO cuInfo;
+ CUvideoparser cuParser;
+ CUVIDPARSERPARAMS cuPaserParams;
+ CUdevice cuDevice;
+ IDirect3D9 *pD3D9;
+ IDirect3DDevice9 *pD3D9Device;
+ CUcontext cuContext;
+ struct {
+ void *pcuPtr; // MUST bee freed using cuMemFreeHost()
+ tsk_size_t nSize;
+ tsk_size_t nPitch;
+ tsk_bool_t bAvail;
+ } cuBuffer;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ uint16_t last_seq;
+ tsk_bool_t passthrough; // whether to bypass decoding
+ tsk_mutex_handle_t *phMutex;
+ } decoder;
}
cuda_codec_h264_t;
@@ -120,405 +119,368 @@ static void CUDAAPI _NVCallback_HandleOnEndFrame(const NVVE_EndFrameInfo *pefi,
static int cuda_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return -1;
- }
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- h264->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
- break;
- }
- }
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-encoding")){
- h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-decoding")){
- h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "rotation")){
- int rotation = *((int32_t*)param->value);
- if(h264->encoder.rotation != rotation){
- if(self->opened){
- int ret;
- h264->encoder.rotation = rotation;
- if((ret = cuda_codec_h264_close_encoder(h264))){
- return ret;
- }
- if((ret = cuda_codec_h264_open_encoder(h264))){
- return ret;
- }
- }
- }
- return 0;
- }
- }
- return -1;
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return -1;
+ }
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ h264->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
+ break;
+ }
+ }
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-encoding")) {
+ h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-decoding")) {
+ h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "rotation")) {
+ int rotation = *((int32_t*)param->value);
+ if(h264->encoder.rotation != rotation) {
+ if(self->opened) {
+ int ret;
+ h264->encoder.rotation = rotation;
+ if((ret = cuda_codec_h264_close_encoder(h264))) {
+ return ret;
+ }
+ if((ret = cuda_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
}
static int cuda_codec_h264_open(tmedia_codec_t* self)
{
- int ret;
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
- // Encoder
- if((ret = cuda_codec_h264_open_encoder(h264))){
- return ret;
- }
-
- // Decoder
- if((ret = cuda_codec_h264_open_decoder(h264))){
- return ret;
- }
-
- return 0;
+ int ret;
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+ // Encoder
+ if((ret = cuda_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
+
+ // Decoder
+ if((ret = cuda_codec_h264_open_decoder(h264))) {
+ return ret;
+ }
+
+ return 0;
}
static int cuda_codec_h264_close(tmedia_codec_t* self)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) alreasy checked that the codec is opened */
+ /* the caller (base class) alreasy checked that the codec is opened */
- // Encoder
- cuda_codec_h264_close_encoder(h264);
+ // Encoder
+ cuda_codec_h264_close_encoder(h264);
- // Decoder
- cuda_codec_h264_close_decoder(h264);
+ // Decoder
+ cuda_codec_h264_close_decoder(h264);
- return 0;
+ return 0;
}
static tsk_size_t cuda_codec_h264_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret = 0;
- NVVE_EncodeFrameParams efparams;
- tsk_bool_t send_idr, send_hdr;
- unsigned long flags = 0;
-
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if(!self || !in_data || !in_size)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(h264->encoder.passthrough) {
- tdav_codec_h264_rtp_encap(common, (const uint8_t*)in_data, in_size);
- return 0;
- }
-
- if((h264->encoder.ctxParams.iOutputSize[1] * h264->encoder.ctxParams.iOutputSize[0] * 3) >> 1 != in_size)
- {
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
-
- if(!self->opened || !h264->encoder.pInst /*|| !h264->encoder.pInst->IsReady()*/)
- {
- TSK_DEBUG_ERROR("Encoder not opened or not ready");
- return 0;
- }
-
- if(h264->encoder.passthrough)
- {
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), (const uint8_t*)in_data, in_size);
- return 0;
- }
-
- HRESULT hr = S_OK;
-
- efparams.Width = h264->encoder.ctxParams.iOutputSize[0];
- efparams.Height = h264->encoder.ctxParams.iOutputSize[1];
- efparams.Pitch = (h264->encoder.ctxParams.nDeviceMemPitch ? h264->encoder.ctxParams.nDeviceMemPitch : h264->encoder.ctxParams.iOutputSize[0]);
- efparams.PictureStruc = (NVVE_PicStruct)h264->encoder.ctxParams.iPictureType;
+ int ret = 0;
+ NVVE_EncodeFrameParams efparams;
+ tsk_bool_t send_idr, send_hdr;
+ unsigned long flags = 0;
+
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if(!self || !in_data || !in_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(h264->encoder.passthrough) {
+ tdav_codec_h264_rtp_encap(common, (const uint8_t*)in_data, in_size);
+ return 0;
+ }
+
+ if((h264->encoder.ctxParams.iOutputSize[1] * h264->encoder.ctxParams.iOutputSize[0] * 3) >> 1 != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
+
+ if(!self->opened || !h264->encoder.pInst /*|| !h264->encoder.pInst->IsReady()*/) {
+ TSK_DEBUG_ERROR("Encoder not opened or not ready");
+ return 0;
+ }
+
+ if(h264->encoder.passthrough) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), (const uint8_t*)in_data, in_size);
+ return 0;
+ }
+
+ HRESULT hr = S_OK;
+
+ efparams.Width = h264->encoder.ctxParams.iOutputSize[0];
+ efparams.Height = h264->encoder.ctxParams.iOutputSize[1];
+ efparams.Pitch = (h264->encoder.ctxParams.nDeviceMemPitch ? h264->encoder.ctxParams.nDeviceMemPitch : h264->encoder.ctxParams.iOutputSize[0]);
+ efparams.PictureStruc = (NVVE_PicStruct)h264->encoder.ctxParams.iPictureType;
efparams.SurfFmt = (NVVE_SurfaceFormat)h264->encoder.ctxParams.iSurfaceFormat;
- efparams.progressiveFrame = (h264->encoder.ctxParams.iSurfaceFormat == 3) ? 1 : 0;
+ efparams.progressiveFrame = (h264->encoder.ctxParams.iSurfaceFormat == 3) ? 1 : 0;
efparams.repeatFirstField = 0;
- efparams.topfieldfirst = (h264->encoder.ctxParams.iSurfaceFormat == 1) ? 1 : 0;
- efparams.picBuf = (unsigned char *)in_data;
- efparams.bLast = 0;
-
- // send IDR for:
- // - the first frame
- // - remote peer requested an IDR
- // - every second within the first 4seconds
- send_idr = (
- h264->encoder.frame_count++ == 0
- || h264 ->encoder.force_idr
- || ( (h264->encoder.frame_count < h264->encoder.neg_fps * 4) && ((h264->encoder.frame_count % h264->encoder.neg_fps)==0) )
- );
-
- if(send_idr)
- {
- flags |= 0x04; // FORCE IDR
- }
-
- // send SPS and PPS headers for:
- // - IDR frames (not required but it's the easiest way to deal with pkt loss)
- // - every 5 seconds after the first 4seconds
- send_hdr = (
- send_idr
- || ( (h264->encoder.frame_count % (h264->encoder.neg_fps * 5))==0 )
- );
- if(send_hdr)
- {
- if(h264->encoder.ctxParams.iDisableSPSPPS)
- {
- unsigned char SPSPPSBuff[1024];
- int SPSPPSBuffSize = sizeof(SPSPPSBuff);
- hr = NVGetSPSPPS(h264->encoder.pInst, SPSPPSBuff, SPSPPSBuffSize, &SPSPPSBuffSize);
- if(SUCCEEDED(hr))
- {
- int size = 0;
- while(size < SPSPPSBuffSize - 2)
- {
- int16_t next_size = ((int16_t)SPSPPSBuff[size])<<1 | ((int16_t)SPSPPSBuff[size + 1]);
- tdav_codec_h264_rtp_encap(common, &SPSPPSBuff[size + 2], next_size);
- size += next_size + 2;
- }
- }
- else
- {
- TSK_DEBUG_ERROR("NVGetSPSPPS failed with error code = %08x", hr)
- }
- }
- }
-
- // Encode data
- CHECK_HR(hr = NVEncodeFrame(h264->encoder.pInst, &efparams, flags, NULL));
-
- // reset
- h264->encoder.force_idr = tsk_false;
+ efparams.topfieldfirst = (h264->encoder.ctxParams.iSurfaceFormat == 1) ? 1 : 0;
+ efparams.picBuf = (unsigned char *)in_data;
+ efparams.bLast = 0;
+
+ // send IDR for:
+ // - the first frame
+ // - remote peer requested an IDR
+ // - every second within the first 4seconds
+ send_idr = (
+ h264->encoder.frame_count++ == 0
+ || h264 ->encoder.force_idr
+ || ( (h264->encoder.frame_count < h264->encoder.neg_fps * 4) && ((h264->encoder.frame_count % h264->encoder.neg_fps)==0) )
+ );
+
+ if(send_idr) {
+ flags |= 0x04; // FORCE IDR
+ }
+
+ // send SPS and PPS headers for:
+ // - IDR frames (not required but it's the easiest way to deal with pkt loss)
+ // - every 5 seconds after the first 4seconds
+ send_hdr = (
+ send_idr
+ || ( (h264->encoder.frame_count % (h264->encoder.neg_fps * 5))==0 )
+ );
+ if(send_hdr) {
+ if(h264->encoder.ctxParams.iDisableSPSPPS) {
+ unsigned char SPSPPSBuff[1024];
+ int SPSPPSBuffSize = sizeof(SPSPPSBuff);
+ hr = NVGetSPSPPS(h264->encoder.pInst, SPSPPSBuff, SPSPPSBuffSize, &SPSPPSBuffSize);
+ if(SUCCEEDED(hr)) {
+ int size = 0;
+ while(size < SPSPPSBuffSize - 2) {
+ int16_t next_size = ((int16_t)SPSPPSBuff[size])<<1 | ((int16_t)SPSPPSBuff[size + 1]);
+ tdav_codec_h264_rtp_encap(common, &SPSPPSBuff[size + 2], next_size);
+ size += next_size + 2;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("NVGetSPSPPS failed with error code = %08x", hr)
+ }
+ }
+ }
+
+ // Encode data
+ CHECK_HR(hr = NVEncodeFrame(h264->encoder.pInst, &efparams, flags, NULL));
+
+ // reset
+ h264->encoder.force_idr = tsk_false;
bail:
- return 0;
+ return 0;
}
static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
-
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0;
- int ret;
- tsk_bool_t append_scp;
- tsk_bool_t sps_or_pps;
- tsk_size_t retsize = 0, size_to_copy = 0;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
-
- if(!h264 || !in_data || !in_size || !out_data)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!self->opened || !h264->encoder.pInst)
- {
- TSK_DEBUG_ERROR("Decoder not opened or not ready");
- return 0;
- }
-
- HRESULT hr = S_OK;
-
- /* Packet lost? */
- if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq)
- {
- TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
- }
- h264->decoder.last_seq = rtp_hdr->seq_num;
-
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0;
+ int ret;
+ tsk_bool_t append_scp;
+ tsk_bool_t sps_or_pps;
+ tsk_size_t retsize = 0, size_to_copy = 0;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+
+ if(!h264 || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!self->opened || !h264->encoder.pInst) {
+ TSK_DEBUG_ERROR("Decoder not opened or not ready");
+ return 0;
+ }
+
+ HRESULT hr = S_OK;
+
+ /* Packet lost? */
+ if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
+ TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
+ }
+ h264->decoder.last_seq = rtp_hdr->seq_num;
+
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- if(*((uint8_t*)in_data) & 0x80)
- {
- TSK_DEBUG_WARN("F=1");
- /* reset accumulator */
- h264->decoder.accumulator = 0;
- return 0;
- }
-
- /* get payload */
- if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size)
- {
- TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
- return 0;
- }
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
- // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
- sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
-
- // start-accumulator
- if(!h264->decoder.accumulator)
- {
- if(size_to_copy > xmax_size)
- {
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- return 0;
- }
- if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t))))
- {
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- return 0;
- }
- h264->decoder.accumulator_size = size_to_copy;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size)
- {
- TSK_DEBUG_ERROR("BufferOverflow");
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size)
- {
- if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy))))
- {
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
- return 0;
- }
- h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
- }
-
- if(append_scp)
- {
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
- h264->decoder.accumulator_pos += start_code_prefix_size;
- }
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
- h264->decoder.accumulator_pos += pay_size;
- // end-accumulator
-
-
- if(sps_or_pps)
- {
- // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
- // SPS and PPS should be bundled with IDR
- TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
- }
- else if(rtp_hdr->marker)
- {
- if(h264->decoder.passthrough)
- {
- if(*out_max_size < h264->decoder.accumulator_pos)
- {
- if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos)))
- {
- *out_max_size = h264->decoder.accumulator_pos;
- }
- else
- {
- *out_max_size = 0;
- return 0;
- }
- }
- memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
- retsize = h264->decoder.accumulator_pos;
- }
- else
- {
- // !h264->decoder.passthrough
- CUVIDSOURCEDATAPACKET pkt;
- CUresult cuResult;
- pkt.flags = 0;
- pkt.payload_size = (unsigned long) h264->decoder.accumulator_pos;
- pkt.payload = (unsigned char *)h264->decoder.accumulator;
- pkt.timestamp = 0;
-
- // reset accumulator
- h264->decoder.accumulator_pos = 0;
- cuResult = cuvidParseVideoData(h264->decoder.cuParser, &pkt);
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuvidParseVideoData() failed with error code = %d", (int)cuResult);
- CHECK_HR(hr = E_FAIL);
- }
-
- if(h264->decoder.cuBuffer.bAvail)
- {
- h264->decoder.cuBuffer.bAvail = tsk_false;
- if((retsize = _cuda_codec_h264_pict_layout(h264, out_data, out_max_size)) == 0)
- {
- TSK_DEBUG_ERROR("_cuda_codec_h264_pict_layout failed");
- CHECK_HR(hr = E_FAIL);
- }
- }
- }// else(!h264->decoder.passthrough)
- } // else if(rtp_hdr->marker)
+ */
+ if(*((uint8_t*)in_data) & 0x80) {
+ TSK_DEBUG_WARN("F=1");
+ /* reset accumulator */
+ h264->decoder.accumulator = 0;
+ return 0;
+ }
+
+ /* get payload */
+ if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size) {
+ TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
+ return 0;
+ }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+ // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
+ sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
+
+ // start-accumulator
+ if(!h264->decoder.accumulator) {
+ if(size_to_copy > xmax_size) {
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ return 0;
+ }
+ if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ return 0;
+ }
+ h264->decoder.accumulator_size = size_to_copy;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
+ if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+ return 0;
+ }
+ h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
+ }
+
+ if(append_scp) {
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ h264->decoder.accumulator_pos += start_code_prefix_size;
+ }
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
+ h264->decoder.accumulator_pos += pay_size;
+ // end-accumulator
+
+
+ if(sps_or_pps) {
+ // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
+ // SPS and PPS should be bundled with IDR
+ TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
+ }
+ else if(rtp_hdr->marker) {
+ if(h264->decoder.passthrough) {
+ if(*out_max_size < h264->decoder.accumulator_pos) {
+ if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))) {
+ *out_max_size = h264->decoder.accumulator_pos;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
+ retsize = h264->decoder.accumulator_pos;
+ }
+ else {
+ // !h264->decoder.passthrough
+ CUVIDSOURCEDATAPACKET pkt;
+ CUresult cuResult;
+ pkt.flags = 0;
+ pkt.payload_size = (unsigned long) h264->decoder.accumulator_pos;
+ pkt.payload = (unsigned char *)h264->decoder.accumulator;
+ pkt.timestamp = 0;
+
+ // reset accumulator
+ h264->decoder.accumulator_pos = 0;
+ cuResult = cuvidParseVideoData(h264->decoder.cuParser, &pkt);
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidParseVideoData() failed with error code = %d", (int)cuResult);
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(h264->decoder.cuBuffer.bAvail) {
+ h264->decoder.cuBuffer.bAvail = tsk_false;
+ if((retsize = _cuda_codec_h264_pict_layout(h264, out_data, out_max_size)) == 0) {
+ TSK_DEBUG_ERROR("_cuda_codec_h264_pict_layout failed");
+ CHECK_HR(hr = E_FAIL);
+ }
+ }
+ }// else(!h264->decoder.passthrough)
+ } // else if(rtp_hdr->marker)
bail:
- if(FAILED(hr))
- {
- TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
- if(TMEDIA_CODEC_VIDEO(self)->in.callback)
- {
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- return retsize;
+ if(FAILED(hr)) {
+ TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ return retsize;
}
static tsk_bool_t cuda_codec_h264_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
+ return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
}
static char* cuda_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
- if(att && tsk_striequals(att_name, "fmtp")) {
- tsk_strcat(&att, "; impl=CUDA");
- }
- return att;
+ char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
+ if(att && tsk_striequals(att_name, "fmtp")) {
+ tsk_strcat(&att, "; impl=CUDA");
+ }
+ return att;
}
@@ -529,63 +491,61 @@ static char* cuda_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char*
/* constructor */
static tsk_object_t* cuda_codec_h264_base_ctor(tsk_object_t * self, va_list * app)
{
- cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(cuda_codec_h264_init(h264, profile_idc_baseline) != 0){
- return tsk_null;
- }
- }
- return self;
+ cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(cuda_codec_h264_init(h264, profile_idc_baseline) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* cuda_codec_h264_base_dtor(tsk_object_t * self)
-{
- cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- cuda_codec_h264_deinit(h264);
- }
-
- return self;
+{
+ cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ cuda_codec_h264_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t cuda_codec_h264_base_def_s =
-{
- sizeof(cuda_codec_h264_t),
- cuda_codec_h264_base_ctor,
- cuda_codec_h264_base_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t cuda_codec_h264_base_def_s = {
+ sizeof(cuda_codec_h264_t),
+ cuda_codec_h264_base_ctor,
+ cuda_codec_h264_base_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t cuda_codec_h264_base_plugin_def_s =
-{
- &cuda_codec_h264_base_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "H264 Base Profile (NVIDIA CUDA)",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0}, // fps is @deprecated
-
- cuda_codec_h264_set,
- cuda_codec_h264_open,
- cuda_codec_h264_close,
- cuda_codec_h264_encode,
- cuda_codec_h264_decode,
- cuda_codec_h264_sdp_att_match,
- cuda_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t cuda_codec_h264_base_plugin_def_s = {
+ &cuda_codec_h264_base_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "H264 Base Profile (NVIDIA CUDA)",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0}, // fps is @deprecated
+
+ cuda_codec_h264_set,
+ cuda_codec_h264_open,
+ cuda_codec_h264_close,
+ cuda_codec_h264_encode,
+ cuda_codec_h264_decode,
+ cuda_codec_h264_sdp_att_match,
+ cuda_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *cuda_codec_h264_base_plugin_def_t = &cuda_codec_h264_base_plugin_def_s;
@@ -594,64 +554,62 @@ const tmedia_codec_plugin_def_t *cuda_codec_h264_base_plugin_def_t = &cuda_codec
/* constructor */
static tsk_object_t* cuda_codec_h264_main_ctor(tsk_object_t * self, va_list * app)
{
- cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(cuda_codec_h264_init(h264, profile_idc_main) != 0){
- return tsk_null;
- }
- }
- return self;
+ cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(cuda_codec_h264_init(h264, profile_idc_main) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* cuda_codec_h264_main_dtor(tsk_object_t * self)
-{
- cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- cuda_codec_h264_deinit(h264);
-
- }
-
- return self;
+{
+ cuda_codec_h264_t *h264 = (cuda_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ cuda_codec_h264_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t cuda_codec_h264_main_def_s =
-{
- sizeof(cuda_codec_h264_t),
- cuda_codec_h264_main_ctor,
- cuda_codec_h264_main_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t cuda_codec_h264_main_def_s = {
+ sizeof(cuda_codec_h264_t),
+ cuda_codec_h264_main_ctor,
+ cuda_codec_h264_main_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t cuda_codec_h264_main_plugin_def_s =
-{
- &cuda_codec_h264_main_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_mp,
- "H264",
- "H264 Main Profile (NVIDIA CUDA)",
- TMEDIA_CODEC_FORMAT_H264_MP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps)*/
- {176, 144, 0},// fps is @deprecated
-
- cuda_codec_h264_set,
- cuda_codec_h264_open,
- cuda_codec_h264_close,
- cuda_codec_h264_encode,
- cuda_codec_h264_decode,
- cuda_codec_h264_sdp_att_match,
- cuda_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t cuda_codec_h264_main_plugin_def_s = {
+ &cuda_codec_h264_main_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_mp,
+ "H264",
+ "H264 Main Profile (NVIDIA CUDA)",
+ TMEDIA_CODEC_FORMAT_H264_MP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps)*/
+ {176, 144, 0},// fps is @deprecated
+
+ cuda_codec_h264_set,
+ cuda_codec_h264_open,
+ cuda_codec_h264_close,
+ cuda_codec_h264_encode,
+ cuda_codec_h264_decode,
+ cuda_codec_h264_sdp_att_match,
+ cuda_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *cuda_codec_h264_main_plugin_def_t = &cuda_codec_h264_main_plugin_def_s;
@@ -663,272 +621,333 @@ const tmedia_codec_plugin_def_t *cuda_codec_h264_main_plugin_def_t = &cuda_codec
int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
{
- HRESULT hr = S_OK;
- int32_t max_bw_kpbs;
- int bestGPU = 0, gpuPerf = 0;
- static int low_latency = 1;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if(self->encoder.pInst)
- {
- TSK_DEBUG_ERROR("Encoder already initialized");
+ HRESULT hr = S_OK;
+ int32_t max_bw_kpbs;
+ int bestGPU = 0, gpuPerf = 0;
+ static int low_latency = 1;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if(self->encoder.pInst) {
+ TSK_DEBUG_ERROR("Encoder already initialized");
#if defined(E_ILLEGAL_METHOD_CALL)
- CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
+ CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
#else
- CHECK_HR(hr = 0x8000000EL);
+ CHECK_HR(hr = 0x8000000EL);
#endif
- }
-
- memset(&self->encoder.clbParams, 0, sizeof(self->encoder.clbParams));
- memset(&self->encoder.ctxParams, 0, sizeof(self->encoder.ctxParams));
-
- // create encoder
- CHECK_HR(hr = NVCreateEncoder(&self->encoder.pInst));
- CHECK_HR(hr = NVSetCodec(self->encoder.pInst, NV_CODEC_TYPE_H264));
- CHECK_HR(hr = NVSetDefaultParam(self->encoder.pInst));
-
- CHECK_HR(hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_COUNT, &self->encoder.ctxParams.GPU_count));
- {
- int temp = 0, deviceCount;
- for (deviceCount=0; deviceCount < self->encoder.ctxParams.GPU_count; deviceCount++)
- {
- NVVE_GPUAttributes GPUAttributes = {0};
-
- GPUAttributes.iGpuOrdinal = deviceCount;
- hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_ATTRIBUTES, &GPUAttributes);
- if(FAILED(hr))
- {
- TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_ATTRIBUTES) failed with error code = %08x", hr);
- continue;
- }
-
- temp = GPUAttributes.iClockRate * GPUAttributes.iMultiProcessorCount;
- temp = temp * CudaUtils::ConvertSMVer2Cores(GPUAttributes.iMajor, GPUAttributes.iMinor);
-
- if(temp > gpuPerf)
- {
- gpuPerf = temp;
- bestGPU = deviceCount;
- }
- }
- }
-
- self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
- self->encoder.max_bw_kpbs
- );
- self->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
-
- TSK_DEBUG_INFO("[H.264 CUDA Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
- self->encoder.neg_width,
- self->encoder.neg_height,
- self->encoder.neg_fps,
- self->encoder.max_bitrate_bps
- );
-
- self->encoder.ctxParams.iForcedGPU = bestGPU;
- self->encoder.ctxParams.iInputSize[0] = self->encoder.neg_width;
- self->encoder.ctxParams.iInputSize[1] = self->encoder.neg_height;
- self->encoder.ctxParams.iOutputSize[0] = self->encoder.neg_width;
- self->encoder.ctxParams.iOutputSize[1] = self->encoder.neg_height;
- self->encoder.ctxParams.GPUOffloadLevel= NVVE_GPU_OFFLOAD_ALL;
- self->encoder.ctxParams.iSurfaceFormat = (int)IYUV;
- self->encoder.ctxParams.iPictureType = (int)FRAME_PICTURE;
- self->encoder.ctxParams.Fieldmode = MODE_FRAME;
- self->encoder.ctxParams.Presets = (NVVE_PRESETS_TARGET)-1;//Should be iPod, Zune ...
- // self->encoder.ctxParams.iP_Interval = 1;
- self->encoder.ctxParams.iAspectRatio[0] = 1;
- self->encoder.ctxParams.iAspectRatio[1] = 1;
- self->encoder.ctxParams.iAspectRatio[2] = 0;
- self->encoder.ctxParams.iIDR_Period = (self->encoder.neg_fps * PLUGIN_CUDA_H264_GOP_SIZE_IN_SECONDS);
- self->encoder.ctxParams.iUseDeviceMem = 0;
- self->encoder.ctxParams.iDynamicGOP = 0;
- self->encoder.ctxParams.RCType = RC_CBR;
- self->encoder.ctxParams.iAvgBitrate = self->encoder.max_bitrate_bps;
- self->encoder.ctxParams.iPeakBitrate = self->encoder.max_bitrate_bps;
- self->encoder.ctxParams.iQP_Level_Intra = 25;
- self->encoder.ctxParams.iQP_Level_InterP = 28;
- self->encoder.ctxParams.iQP_Level_InterB = 31;
- self->encoder.ctxParams.iFrameRate[0] = self->encoder.neg_fps;
- self->encoder.ctxParams.iFrameRate[1] = 1;
- self->encoder.ctxParams.iDeblockMode = 1;
- self->encoder.ctxParams.iForceIntra = 0;
- self->encoder.ctxParams.iForceIDR = 0;
- self->encoder.ctxParams.iClearStat = 0;
- self->encoder.ctxParams.DIMode = DI_MEDIAN;
- self->encoder.ctxParams.iDisableSPSPPS = 1; // Do not include SPS/PPS frames
- self->encoder.ctxParams.iNaluFramingType = 0; // StartCodes
- self->encoder.ctxParams.iMultiGPU = 1;
- switch(common->profile)
- {
- case profile_idc_baseline:
- {
- self->encoder.ctxParams.iDisableCabac = 1;
- self->encoder.ctxParams.iProfileLevel = 0xff42; // 0xff -> autoselect level
- break;
- }
- case profile_idc_main:
- {
- self->encoder.ctxParams.iDisableCabac = 0;
- self->encoder.ctxParams.iProfileLevel = 0xff4d; // 0xff -> autoselect level
- break;
- }
- default:
- {
- CHECK_HR(hr = E_NOTIMPL);
- break;
- }
- }
-
- //
- // Allocate memory
- //
- self->encoder.nBufferSize = (self->encoder.ctxParams.iOutputSize[1] * self->encoder.ctxParams.iOutputSize[0] * 3) >> 4;
- if(!self->encoder.pBufferPtr && !(self->encoder.pBufferPtr = tsk_realloc(self->encoder.pBufferPtr, self->encoder.nBufferSize)))
- {
- self->encoder.nBufferSize = 0;
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
-
- //
- // Set parameters
- //
- hr = NVSetParamValue(self->encoder.pInst, NVVE_FORCE_GPU_SELECTION, &self->encoder.ctxParams.iForcedGPU);
- if(FAILED(hr))
- {
- TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_GPU_SELECTION) failed with error code = %08x", hr);
- }
- CHECK_HR(hr = NVSetParamValue(self->encoder.pInst, NVVE_DEVICE_MEMORY_INPUT, &(self->encoder.ctxParams.iUseDeviceMem)));
- hr = NVSetParamValue(self->encoder.pInst,NVVE_OUT_SIZE, &(self->encoder.ctxParams.iOutputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_IN_SIZE, &(self->encoder.ctxParams.iInputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_MULTI_GPU, &(self->encoder.ctxParams.iMultiGPU)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_ASPECT_RATIO, &(self->encoder.ctxParams.iAspectRatio));if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_FIELD_ENC_MODE, &(self->encoder.ctxParams.Fieldmode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_P_INTERVAL, &(self->encoder.ctxParams.iP_Interval)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_IDR_PERIOD, &(self->encoder.ctxParams.iIDR_Period)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_DYNAMIC_GOP, &(self->encoder.ctxParams.iDynamicGOP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_RC_TYPE, &(self->encoder.ctxParams.RCType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_AVG_BITRATE, &(self->encoder.ctxParams.iAvgBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_PEAK_BITRATE, &(self->encoder.ctxParams.iPeakBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTRA, &(self->encoder.ctxParams.iQP_Level_Intra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_P,&(self->encoder.ctxParams.iQP_Level_InterP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_B,&(self->encoder.ctxParams.iQP_Level_InterB)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_FRAME_RATE, &(self->encoder.ctxParams.iFrameRate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_DEBLOCK_MODE, &(self->encoder.ctxParams.iDeblockMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_PROFILE_LEVEL, &(self->encoder.ctxParams.iProfileLevel)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_INTRA, &(self->encoder.ctxParams.iForceIntra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_IDR, &(self->encoder.ctxParams.iForceIDR)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_CLEAR_STAT, &(self->encoder.ctxParams.iClearStat)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_SET_DEINTERLACE,&(self->encoder.ctxParams.DIMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr); }
- if (self->encoder.ctxParams.Presets != -1)
- {
- hr = NVSetParamValue(self->encoder.pInst,NVVE_PRESETS, &(self->encoder.ctxParams.Presets)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr); }
- }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_CABAC, &(self->encoder.ctxParams.iDisableCabac)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(self->encoder.ctxParams.iNaluFramingType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_SPS_PPS,&(self->encoder.ctxParams.iDisableSPSPPS)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr); }
- hr = NVSetParamValue(self->encoder.pInst,NVVE_LOW_LATENCY,&low_latency); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr); }
-
- self->encoder.clbParams.pfnacquirebitstream = _NVCallback_HandleAcquireBitStream;
- self->encoder.clbParams.pfnonbeginframe = _NVCallback_HandleOnBeginFrame;
- self->encoder.clbParams.pfnonendframe = _NVCallback_HandleOnEndFrame;
- self->encoder.clbParams.pfnreleasebitstream = _NVCallback_HandleReleaseBitStream;
- NVRegisterCB(self->encoder.pInst, self->encoder.clbParams, self);
-
-
- CHECK_HR(hr = NVCreateHWEncoder(self->encoder.pInst));
-
+ }
+
+ memset(&self->encoder.clbParams, 0, sizeof(self->encoder.clbParams));
+ memset(&self->encoder.ctxParams, 0, sizeof(self->encoder.ctxParams));
+
+ // create encoder
+ CHECK_HR(hr = NVCreateEncoder(&self->encoder.pInst));
+ CHECK_HR(hr = NVSetCodec(self->encoder.pInst, NV_CODEC_TYPE_H264));
+ CHECK_HR(hr = NVSetDefaultParam(self->encoder.pInst));
+
+ CHECK_HR(hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_COUNT, &self->encoder.ctxParams.GPU_count));
+ {
+ int temp = 0, deviceCount;
+ for (deviceCount=0; deviceCount < self->encoder.ctxParams.GPU_count; deviceCount++) {
+ NVVE_GPUAttributes GPUAttributes = {0};
+
+ GPUAttributes.iGpuOrdinal = deviceCount;
+ hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_ATTRIBUTES, &GPUAttributes);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_ATTRIBUTES) failed with error code = %08x", hr);
+ continue;
+ }
+
+ temp = GPUAttributes.iClockRate * GPUAttributes.iMultiProcessorCount;
+ temp = temp * CudaUtils::ConvertSMVer2Cores(GPUAttributes.iMajor, GPUAttributes.iMinor);
+
+ if(temp > gpuPerf) {
+ gpuPerf = temp;
+ bestGPU = deviceCount;
+ }
+ }
+ }
+
+ self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
+ self->encoder.max_bw_kpbs
+ );
+ self->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
+
+ TSK_DEBUG_INFO("[H.264 CUDA Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
+ self->encoder.neg_width,
+ self->encoder.neg_height,
+ self->encoder.neg_fps,
+ self->encoder.max_bitrate_bps
+ );
+
+ self->encoder.ctxParams.iForcedGPU = bestGPU;
+ self->encoder.ctxParams.iInputSize[0] = self->encoder.neg_width;
+ self->encoder.ctxParams.iInputSize[1] = self->encoder.neg_height;
+ self->encoder.ctxParams.iOutputSize[0] = self->encoder.neg_width;
+ self->encoder.ctxParams.iOutputSize[1] = self->encoder.neg_height;
+ self->encoder.ctxParams.GPUOffloadLevel= NVVE_GPU_OFFLOAD_ALL;
+ self->encoder.ctxParams.iSurfaceFormat = (int)IYUV;
+ self->encoder.ctxParams.iPictureType = (int)FRAME_PICTURE;
+ self->encoder.ctxParams.Fieldmode = MODE_FRAME;
+ self->encoder.ctxParams.Presets = (NVVE_PRESETS_TARGET)-1;//Should be iPod, Zune ...
+ // self->encoder.ctxParams.iP_Interval = 1;
+ self->encoder.ctxParams.iAspectRatio[0] = 1;
+ self->encoder.ctxParams.iAspectRatio[1] = 1;
+ self->encoder.ctxParams.iAspectRatio[2] = 0;
+ self->encoder.ctxParams.iIDR_Period = (self->encoder.neg_fps * PLUGIN_CUDA_H264_GOP_SIZE_IN_SECONDS);
+ self->encoder.ctxParams.iUseDeviceMem = 0;
+ self->encoder.ctxParams.iDynamicGOP = 0;
+ self->encoder.ctxParams.RCType = RC_CBR;
+ self->encoder.ctxParams.iAvgBitrate = self->encoder.max_bitrate_bps;
+ self->encoder.ctxParams.iPeakBitrate = self->encoder.max_bitrate_bps;
+ self->encoder.ctxParams.iQP_Level_Intra = 25;
+ self->encoder.ctxParams.iQP_Level_InterP = 28;
+ self->encoder.ctxParams.iQP_Level_InterB = 31;
+ self->encoder.ctxParams.iFrameRate[0] = self->encoder.neg_fps;
+ self->encoder.ctxParams.iFrameRate[1] = 1;
+ self->encoder.ctxParams.iDeblockMode = 1;
+ self->encoder.ctxParams.iForceIntra = 0;
+ self->encoder.ctxParams.iForceIDR = 0;
+ self->encoder.ctxParams.iClearStat = 0;
+ self->encoder.ctxParams.DIMode = DI_MEDIAN;
+ self->encoder.ctxParams.iDisableSPSPPS = 1; // Do not include SPS/PPS frames
+ self->encoder.ctxParams.iNaluFramingType = 0; // StartCodes
+ self->encoder.ctxParams.iMultiGPU = 1;
+ switch(common->profile) {
+ case profile_idc_baseline: {
+ self->encoder.ctxParams.iDisableCabac = 1;
+ self->encoder.ctxParams.iProfileLevel = 0xff42; // 0xff -> autoselect level
+ break;
+ }
+ case profile_idc_main: {
+ self->encoder.ctxParams.iDisableCabac = 0;
+ self->encoder.ctxParams.iProfileLevel = 0xff4d; // 0xff -> autoselect level
+ break;
+ }
+ default: {
+ CHECK_HR(hr = E_NOTIMPL);
+ break;
+ }
+ }
+
+ //
+ // Allocate memory
+ //
+ self->encoder.nBufferSize = (self->encoder.ctxParams.iOutputSize[1] * self->encoder.ctxParams.iOutputSize[0] * 3) >> 4;
+ if(!self->encoder.pBufferPtr && !(self->encoder.pBufferPtr = tsk_realloc(self->encoder.pBufferPtr, self->encoder.nBufferSize))) {
+ self->encoder.nBufferSize = 0;
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+
+ //
+ // Set parameters
+ //
+ hr = NVSetParamValue(self->encoder.pInst, NVVE_FORCE_GPU_SELECTION, &self->encoder.ctxParams.iForcedGPU);
+ if(FAILED(hr)) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_GPU_SELECTION) failed with error code = %08x", hr);
+ }
+ CHECK_HR(hr = NVSetParamValue(self->encoder.pInst, NVVE_DEVICE_MEMORY_INPUT, &(self->encoder.ctxParams.iUseDeviceMem)));
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_OUT_SIZE, &(self->encoder.ctxParams.iOutputSize));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_IN_SIZE, &(self->encoder.ctxParams.iInputSize));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_MULTI_GPU, &(self->encoder.ctxParams.iMultiGPU));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_ASPECT_RATIO, &(self->encoder.ctxParams.iAspectRatio));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_FIELD_ENC_MODE, &(self->encoder.ctxParams.Fieldmode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_P_INTERVAL, &(self->encoder.ctxParams.iP_Interval));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_IDR_PERIOD, &(self->encoder.ctxParams.iIDR_Period));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_DYNAMIC_GOP, &(self->encoder.ctxParams.iDynamicGOP));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_RC_TYPE, &(self->encoder.ctxParams.RCType));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_AVG_BITRATE, &(self->encoder.ctxParams.iAvgBitrate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_PEAK_BITRATE, &(self->encoder.ctxParams.iPeakBitrate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTRA, &(self->encoder.ctxParams.iQP_Level_Intra));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_P,&(self->encoder.ctxParams.iQP_Level_InterP));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_B,&(self->encoder.ctxParams.iQP_Level_InterB));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_FRAME_RATE, &(self->encoder.ctxParams.iFrameRate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_DEBLOCK_MODE, &(self->encoder.ctxParams.iDeblockMode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_PROFILE_LEVEL, &(self->encoder.ctxParams.iProfileLevel));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_INTRA, &(self->encoder.ctxParams.iForceIntra));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_IDR, &(self->encoder.ctxParams.iForceIDR));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_CLEAR_STAT, &(self->encoder.ctxParams.iClearStat));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_SET_DEINTERLACE,&(self->encoder.ctxParams.DIMode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr);
+ }
+ if (self->encoder.ctxParams.Presets != -1) {
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_PRESETS, &(self->encoder.ctxParams.Presets));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr);
+ }
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_CABAC, &(self->encoder.ctxParams.iDisableCabac));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(self->encoder.ctxParams.iNaluFramingType));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_SPS_PPS,&(self->encoder.ctxParams.iDisableSPSPPS));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(self->encoder.pInst,NVVE_LOW_LATENCY,&low_latency);
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr);
+ }
+
+ self->encoder.clbParams.pfnacquirebitstream = _NVCallback_HandleAcquireBitStream;
+ self->encoder.clbParams.pfnonbeginframe = _NVCallback_HandleOnBeginFrame;
+ self->encoder.clbParams.pfnonendframe = _NVCallback_HandleOnEndFrame;
+ self->encoder.clbParams.pfnreleasebitstream = _NVCallback_HandleReleaseBitStream;
+ NVRegisterCB(self->encoder.pInst, self->encoder.clbParams, self);
+
+
+ CHECK_HR(hr = NVCreateHWEncoder(self->encoder.pInst));
+
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
int cuda_codec_h264_close_encoder(cuda_codec_h264_t* self)
{
- if(self)
- {
- if(self->encoder.pInst)
- {
- NVDestroyEncoder(self->encoder.pInst);
- self->encoder.pInst = NULL;
- }
- if(self->encoder.pBufferPtr)
- {
- TSK_FREE(self->encoder.pBufferPtr);
- self->encoder.nBufferSize = 0;
- }
- self->encoder.frame_count = 0;
- }
-
- return 0;
+ if(self) {
+ if(self->encoder.pInst) {
+ NVDestroyEncoder(self->encoder.pInst);
+ self->encoder.pInst = NULL;
+ }
+ if(self->encoder.pBufferPtr) {
+ TSK_FREE(self->encoder.pBufferPtr);
+ self->encoder.nBufferSize = 0;
+ }
+ self->encoder.frame_count = 0;
+ }
+
+ return 0;
}
int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
{
- HRESULT hr = S_OK;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
- int i, adapterCount;
- CUresult cuResult;
- D3DPRESENT_PARAMETERS d3dpp;
-
- if(self->decoder.pInst || self->decoder.cuDevice || self->decoder.cuContext || self->decoder.pD3D9 || self->decoder.pD3D9Device)
- {
- TSK_DEBUG_ERROR("Decoder already initialized");
+ HRESULT hr = S_OK;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+ int i, adapterCount;
+ CUresult cuResult;
+ D3DPRESENT_PARAMETERS d3dpp;
+
+ if(self->decoder.pInst || self->decoder.cuDevice || self->decoder.cuContext || self->decoder.pD3D9 || self->decoder.pD3D9Device) {
+ TSK_DEBUG_ERROR("Decoder already initialized");
#if defined(E_ILLEGAL_METHOD_CALL)
- CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
+ CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
#else
- CHECK_HR(hr = 0x8000000EL);
+ CHECK_HR(hr = 0x8000000EL);
#endif
- }
-
- TSK_DEBUG_INFO("[H.264 MF Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
- TMEDIA_CODEC_VIDEO(self)->in.width,
- TMEDIA_CODEC_VIDEO(self)->in.height,
- TMEDIA_CODEC_VIDEO(self)->in.fps
- );
-
- memset(&self->decoder.cuInfo, 0, sizeof(self->decoder.cuInfo));
- self->decoder.cuInfo.ulCreationFlags = cudaVideoCreate_PreferCUDA;
- self->decoder.cuInfo.CodecType = cudaVideoCodec_H264;
- self->decoder.cuInfo.ulWidth = TMEDIA_CODEC_VIDEO(self)->in.width;
- self->decoder.cuInfo.ulTargetWidth = TMEDIA_CODEC_VIDEO(self)->in.width;
- self->decoder.cuInfo.ulHeight = TMEDIA_CODEC_VIDEO(self)->in.height;
- self->decoder.cuInfo.ulTargetHeight = TMEDIA_CODEC_VIDEO(self)->in.height;
- self->decoder.cuInfo.ulNumDecodeSurfaces = PLUGIN_CUDA_H264_MAX_FRM_CNT;
- self->decoder.cuInfo.ulNumOutputSurfaces = 1;
- self->decoder.cuInfo.ChromaFormat = cudaVideoChromaFormat_420;
- self->decoder.cuInfo.OutputFormat = cudaVideoSurfaceFormat_NV12;
- self->decoder.cuInfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;
-
- self->decoder.cuDevice = CudaUtils::GetMaxGflopsDeviceId();
+ }
+
+ TSK_DEBUG_INFO("[H.264 MF Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
+ TMEDIA_CODEC_VIDEO(self)->in.width,
+ TMEDIA_CODEC_VIDEO(self)->in.height,
+ TMEDIA_CODEC_VIDEO(self)->in.fps
+ );
+
+ memset(&self->decoder.cuInfo, 0, sizeof(self->decoder.cuInfo));
+ self->decoder.cuInfo.ulCreationFlags = cudaVideoCreate_PreferCUDA;
+ self->decoder.cuInfo.CodecType = cudaVideoCodec_H264;
+ self->decoder.cuInfo.ulWidth = TMEDIA_CODEC_VIDEO(self)->in.width;
+ self->decoder.cuInfo.ulTargetWidth = TMEDIA_CODEC_VIDEO(self)->in.width;
+ self->decoder.cuInfo.ulHeight = TMEDIA_CODEC_VIDEO(self)->in.height;
+ self->decoder.cuInfo.ulTargetHeight = TMEDIA_CODEC_VIDEO(self)->in.height;
+ self->decoder.cuInfo.ulNumDecodeSurfaces = PLUGIN_CUDA_H264_MAX_FRM_CNT;
+ self->decoder.cuInfo.ulNumOutputSurfaces = 1;
+ self->decoder.cuInfo.ChromaFormat = cudaVideoChromaFormat_420;
+ self->decoder.cuInfo.OutputFormat = cudaVideoSurfaceFormat_NV12;
+ self->decoder.cuInfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;
+
+ self->decoder.cuDevice = CudaUtils::GetMaxGflopsDeviceId();
#if _DEBUG || DEBUG
- {
- int major, minor;
- size_t totalGlobalMem;
- char deviceName[256];
- cuDeviceComputeCapability(&major, &minor, self->decoder.cuDevice);
- cuDeviceGetName(deviceName, sizeof(deviceName), self->decoder.cuDevice);
- TSK_DEBUG_INFO("[CUDA H.264 decoder] Using GPU Device %d: %s has SM %d.%d compute capability", self->decoder.cuDevice, deviceName, major, minor);
-
- /*cutilDrvSafeCallNoSync(*/cuDeviceTotalMem(&totalGlobalMem, self->decoder.cuDevice)/*)*/;
- TSK_DEBUG_INFO("[CUDA H.264 decoder] Total amount of global memory in GPU device: %4.4f MB", (float)totalGlobalMem/(1024*1024));
- }
+ {
+ int major, minor;
+ size_t totalGlobalMem;
+ char deviceName[256];
+ cuDeviceComputeCapability(&major, &minor, self->decoder.cuDevice);
+ cuDeviceGetName(deviceName, sizeof(deviceName), self->decoder.cuDevice);
+ TSK_DEBUG_INFO("[CUDA H.264 decoder] Using GPU Device %d: %s has SM %d.%d compute capability", self->decoder.cuDevice, deviceName, major, minor);
+
+ /*cutilDrvSafeCallNoSync(*/cuDeviceTotalMem(&totalGlobalMem, self->decoder.cuDevice)/*)*/;
+ TSK_DEBUG_INFO("[CUDA H.264 decoder] Total amount of global memory in GPU device: %4.4f MB", (float)totalGlobalMem/(1024*1024));
+ }
#endif
- // create Direct3D instance
- self->decoder.pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);
- if(!self->decoder.pD3D9)
- {
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- adapterCount = self->decoder.pD3D9->GetAdapterCount();
- for(i = 0; i < adapterCount; ++i)
- {
- ZeroMemory(&d3dpp, sizeof(d3dpp));
+ // create Direct3D instance
+ self->decoder.pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);
+ if(!self->decoder.pD3D9) {
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ adapterCount = self->decoder.pD3D9->GetAdapterCount();
+ for(i = 0; i < adapterCount; ++i) {
+ ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = self->decoder.cuInfo.ulTargetWidth;
@@ -938,401 +957,359 @@ int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.Flags = D3DPRESENTFLAG_VIDEO;
hr = self->decoder.pD3D9->CreateDevice(i,
- D3DDEVTYPE_HAL,
- GetDesktopWindow(),
- D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &d3dpp,
- &self->decoder.pD3D9Device);
- if(hr == S_OK)
- {
+ D3DDEVTYPE_HAL,
+ GetDesktopWindow(),
+ D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &d3dpp,
+ &self->decoder.pD3D9Device);
+ if(hr == S_OK) {
cuResult = cuD3D9CtxCreate(&self->decoder.cuContext, &self->decoder.cuDevice, 0, self->decoder.pD3D9Device);
- if(cuResult == CUDA_SUCCESS)
- {
+ if(cuResult == CUDA_SUCCESS) {
break;
- }
- SafeRelease(&self->decoder.pD3D9Device);
- if(self->decoder.cuContext)
- {
- cuCtxDestroy(self->decoder.cuContext);
- self->decoder.cuContext = NULL;
- }
+ }
+ SafeRelease(&self->decoder.pD3D9Device);
+ if(self->decoder.cuContext) {
+ cuCtxDestroy(self->decoder.cuContext);
+ self->decoder.cuContext = NULL;
+ }
}
- }
+ }
- if(!self->decoder.pD3D9Device)
- {
- TSK_DEBUG_ERROR("Failed to create D3D9 device");
- CHECK_HR(hr = E_FAIL);
- }
+ if(!self->decoder.pD3D9Device) {
+ TSK_DEBUG_ERROR("Failed to create D3D9 device");
+ CHECK_HR(hr = E_FAIL);
+ }
- memset(&self->decoder.cuPaserParams, 0, sizeof(self->decoder.cuPaserParams));
- self->decoder.cuPaserParams.CodecType = cudaVideoCodec_H264;
+ memset(&self->decoder.cuPaserParams, 0, sizeof(self->decoder.cuPaserParams));
+ self->decoder.cuPaserParams.CodecType = cudaVideoCodec_H264;
self->decoder.cuPaserParams.ulMaxNumDecodeSurfaces = PLUGIN_CUDA_H264_MAX_FRM_CNT;
self->decoder.cuPaserParams.pUserData = self;
self->decoder.cuPaserParams.pfnSequenceCallback = _NVCallback_HandleVideoSequence;
self->decoder.cuPaserParams.pfnDecodePicture = _NVCallback_HandlePictureDecode;
self->decoder.cuPaserParams.pfnDisplayPicture = _NVCallback_HandlePictureDisplay;
cuResult = cuvidCreateVideoParser(&self->decoder.cuParser, &self->decoder.cuPaserParams);
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuvidCreateVideoParser(0) failed with error code = %d", (int)cuResult);
- CHECK_HR(hr = E_FAIL);
- }
-
- cuResult = cuvidCreateDecoder(&self->decoder.pInst, &self->decoder.cuInfo);
- if(CUDA_SUCCESS != cuResult)
- {
- TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
- CHECK_HR(hr = E_FAIL);
- }
-
- if(!self->decoder.phMutex && !(self->decoder.phMutex = tsk_mutex_create()))
- {
- TSK_DEBUG_ERROR("Failed to create mutex");
- CHECK_HR(hr = E_FAIL);
- }
-
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidCreateVideoParser(0) failed with error code = %d", (int)cuResult);
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ cuResult = cuvidCreateDecoder(&self->decoder.pInst, &self->decoder.cuInfo);
+ if(CUDA_SUCCESS != cuResult) {
+ TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(!self->decoder.phMutex && !(self->decoder.phMutex = tsk_mutex_create())) {
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ CHECK_HR(hr = E_FAIL);
+ }
+
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
int cuda_codec_h264_close_decoder(cuda_codec_h264_t* self)
{
- if(self)
- {
- if(self->decoder.pInst)
- {
- cuvidDestroyDecoder(self->decoder.pInst);
- self->decoder.pInst = NULL;
- }
- if(self->decoder.cuContext)
- {
- cuCtxDestroy(self->decoder.cuContext);
- self->decoder.cuContext = NULL;
- }
- SafeRelease(&self->decoder.pD3D9Device);
- SafeRelease(&self->decoder.pD3D9);
- if(self->decoder.cuParser)
- {
- cuvidDestroyVideoParser(self->decoder.cuParser);
- self->decoder.cuParser = NULL;
- }
- {/* cuBuffer.XXX */
- if(self->decoder.cuBuffer.pcuPtr)
- {
- cuMemFreeHost(self->decoder.cuBuffer.pcuPtr);
- self->decoder.cuBuffer.pcuPtr = NULL;
- }
- self->decoder.cuBuffer.nSize = self->decoder.cuBuffer.nPitch = 0;
- self->decoder.cuBuffer.bAvail = tsk_false;
- }
-
- if(self->decoder.phMutex)
- {
- tsk_mutex_destroy(&self->decoder.phMutex);
- }
-
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_pos = 0;
- }
-
- return 0;
+ if(self) {
+ if(self->decoder.pInst) {
+ cuvidDestroyDecoder(self->decoder.pInst);
+ self->decoder.pInst = NULL;
+ }
+ if(self->decoder.cuContext) {
+ cuCtxDestroy(self->decoder.cuContext);
+ self->decoder.cuContext = NULL;
+ }
+ SafeRelease(&self->decoder.pD3D9Device);
+ SafeRelease(&self->decoder.pD3D9);
+ if(self->decoder.cuParser) {
+ cuvidDestroyVideoParser(self->decoder.cuParser);
+ self->decoder.cuParser = NULL;
+ }
+ {/* cuBuffer.XXX */
+ if(self->decoder.cuBuffer.pcuPtr) {
+ cuMemFreeHost(self->decoder.cuBuffer.pcuPtr);
+ self->decoder.cuBuffer.pcuPtr = NULL;
+ }
+ self->decoder.cuBuffer.nSize = self->decoder.cuBuffer.nPitch = 0;
+ self->decoder.cuBuffer.bAvail = tsk_false;
+ }
+
+ if(self->decoder.phMutex) {
+ tsk_mutex_destroy(&self->decoder.phMutex);
+ }
+
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_pos = 0;
+ }
+
+ return 0;
}
int cuda_codec_h264_init(cuda_codec_h264_t* self, profile_idc_t profile)
{
- int ret = 0;
- level_idc_t level;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if(!self)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- CudaUtils::Startup();
-
- if((ret = tdav_codec_h264_common_init(common)))
- {
- TSK_DEBUG_ERROR("cuda_codec_h264_common_init() faile with error code=%d", ret);
- return ret;
- }
-
- if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level)))
- {
- TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- return ret;
- }
-
- (self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
- common->pack_mode = H264_PACKETIZATION_MODE;
- common->profile = profile;
- common->level = level;
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
-
- TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_nv12; // decoder
- TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p; // encoder
-
- self->encoder.quality = 1;
-
- return ret;
+ int ret = 0;
+ level_idc_t level;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ CudaUtils::Startup();
+
+ if((ret = tdav_codec_h264_common_init(common))) {
+ TSK_DEBUG_ERROR("cuda_codec_h264_common_init() faile with error code=%d", ret);
+ return ret;
+ }
+
+ if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
+ TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ return ret;
+ }
+
+ (self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
+ common->pack_mode = H264_PACKETIZATION_MODE;
+ common->profile = profile;
+ common->level = level;
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
+
+ TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_nv12; // decoder
+ TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p; // encoder
+
+ self->encoder.quality = 1;
+
+ return ret;
}
int cuda_codec_h264_deinit(cuda_codec_h264_t* self)
{
- if(!self)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- cuda_codec_h264_close((tmedia_codec_t*)self);
+ cuda_codec_h264_close((tmedia_codec_t*)self);
- return 0;
+ return 0;
}
static inline tsk_size_t _cuda_codec_h264_pict_layout(cuda_codec_h264_t* self, void**output, tsk_size_t *output_size)
{
- if(self && self->decoder.cuBuffer.pcuPtr && self->decoder.cuBuffer.nSize)
- {
- const unsigned int w = TMEDIA_CODEC_VIDEO(self)->in.width;
- const unsigned int w_div_2 = (w >> 1);
- const unsigned int h = TMEDIA_CODEC_VIDEO(self)->in.height;
- const unsigned int h_div_2 = (h >> 1);
- const unsigned int pitch = self->decoder.cuBuffer.nPitch;
- const unsigned int pitch_div_2 = (pitch >> 1);
- const tsk_size_t xsize = (w * h * 3) >> 1;
- // resize if too short
- if(*output_size < xsize)
- {
- if((*output = tsk_realloc(*output, xsize)))
- {
- *output_size = xsize;
- }
- else
- {
- *output_size = 0;
- return 0;
- }
- }
-
-
- register unsigned int y;
+ if(self && self->decoder.cuBuffer.pcuPtr && self->decoder.cuBuffer.nSize) {
+ const unsigned int w = TMEDIA_CODEC_VIDEO(self)->in.width;
+ const unsigned int w_div_2 = (w >> 1);
+ const unsigned int h = TMEDIA_CODEC_VIDEO(self)->in.height;
+ const unsigned int h_div_2 = (h >> 1);
+ const unsigned int pitch = self->decoder.cuBuffer.nPitch;
+ const unsigned int pitch_div_2 = (pitch >> 1);
+ const tsk_size_t xsize = (w * h * 3) >> 1;
+ // resize if too short
+ if(*output_size < xsize) {
+ if((*output = tsk_realloc(*output, xsize))) {
+ *output_size = xsize;
+ }
+ else {
+ *output_size = 0;
+ return 0;
+ }
+ }
+
+
+ register unsigned int y;
const unsigned char *p = (const unsigned char *)self->decoder.cuBuffer.pcuPtr, *q = p + (h * pitch);
register unsigned char *i = (unsigned char *)*output, *j = i + (h * w);
- for (y = 0; y < h; y++)
- {
- // luma
+ for (y = 0; y < h; y++) {
+ // luma
memcpy(i, p, w);
- i += w;
- p += pitch;
-
- // chroma
- memcpy(j, &q[(y&1) ? w_div_2 : 0], w_div_2);
- j += w_div_2;
- if(y&1)
- {
- q += pitch;
- }
+ i += w;
+ p += pitch;
+
+ // chroma
+ memcpy(j, &q[(y&1) ? w_div_2 : 0], w_div_2);
+ j += w_div_2;
+ if(y&1) {
+ q += pitch;
+ }
}
-
- return xsize;
- }
- return 0;
+
+ return xsize;
+ }
+ return 0;
}
static int CUDAAPI _NVCallback_HandleVideoSequence(void *pvUserData, CUVIDEOFORMAT *pFormat)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
- CUresult cuResult;
-
- if(!h264 || !pFormat)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
-
- tsk_mutex_lock(h264->decoder.phMutex);
-
- int ret = 1;
- // http://corecodec.com/products/coreavc/guide
- // CROP 1088 to 1080
- // H.264 encoded video size is always a multiple of 16, and sequences that are 1080 pixels high are encoded as 1088 padded at the bottom.
- // Also H.264 specifications provides a set of cropping parameters to signal that parts of the encoded picture are not important and should not be displayed.
- // Some H.264 encoders fail to specify cropping parameters when encoding 1080 video.
- int newWidth = pFormat->coded_width;//pFormat->display_area.right - pFormat->display_area.left;
- int newHeight = pFormat->coded_height;//pFormat->display_area.bottom - pFormat->display_area.top;
-
- if(newWidth != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != newHeight)
- {
- TSK_DEBUG_INFO("[H.264 CUDA decoder] display area = left:%d, right:%d, bottom:%d, top:%d",
- pFormat->display_area.left,
- pFormat->display_area.right,
- pFormat->display_area.bottom,
- pFormat->display_area.top
- );
-
- h264->decoder.cuInfo.ulWidth = newWidth;
- h264->decoder.cuInfo.ulTargetWidth = newWidth;
- h264->decoder.cuInfo.ulHeight = newHeight;
- h264->decoder.cuInfo.ulTargetHeight = newHeight;
-
- CUresult cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code=%d", (int)cuResult);
- ret = 0; //error
- goto bail;
- }
-
- if(h264->decoder.pInst)
- {
- cuvidDestroyDecoder(h264->decoder.pInst);
- h264->decoder.pInst = NULL;
- }
- cuResult = cuvidCreateDecoder(&h264->decoder.pInst, &h264->decoder.cuInfo);
- if(CUDA_SUCCESS != cuResult)
- {
- TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
- ret = 0; //error
- goto bail;
- }
- else
- {
- TMEDIA_CODEC_VIDEO(h264)->in.width = /*pFormat->coded_width*/newWidth;
- TMEDIA_CODEC_VIDEO(h264)->in.height = /*pFormat->coded_height*/newHeight;
- ret = 1; //success
- }
- }
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
+ CUresult cuResult;
+
+ if(!h264 || !pFormat) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
+
+ tsk_mutex_lock(h264->decoder.phMutex);
+
+ int ret = 1;
+ // http://corecodec.com/products/coreavc/guide
+ // CROP 1088 to 1080
+ // H.264 encoded video size is always a multiple of 16, and sequences that are 1080 pixels high are encoded as 1088 padded at the bottom.
+ // Also H.264 specifications provides a set of cropping parameters to signal that parts of the encoded picture are not important and should not be displayed.
+ // Some H.264 encoders fail to specify cropping parameters when encoding 1080 video.
+ int newWidth = pFormat->coded_width;//pFormat->display_area.right - pFormat->display_area.left;
+ int newHeight = pFormat->coded_height;//pFormat->display_area.bottom - pFormat->display_area.top;
+
+ if(newWidth != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != newHeight) {
+ TSK_DEBUG_INFO("[H.264 CUDA decoder] display area = left:%d, right:%d, bottom:%d, top:%d",
+ pFormat->display_area.left,
+ pFormat->display_area.right,
+ pFormat->display_area.bottom,
+ pFormat->display_area.top
+ );
+
+ h264->decoder.cuInfo.ulWidth = newWidth;
+ h264->decoder.cuInfo.ulTargetWidth = newWidth;
+ h264->decoder.cuInfo.ulHeight = newHeight;
+ h264->decoder.cuInfo.ulTargetHeight = newHeight;
+
+ CUresult cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code=%d", (int)cuResult);
+ ret = 0; //error
+ goto bail;
+ }
+
+ if(h264->decoder.pInst) {
+ cuvidDestroyDecoder(h264->decoder.pInst);
+ h264->decoder.pInst = NULL;
+ }
+ cuResult = cuvidCreateDecoder(&h264->decoder.pInst, &h264->decoder.cuInfo);
+ if(CUDA_SUCCESS != cuResult) {
+ TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
+ ret = 0; //error
+ goto bail;
+ }
+ else {
+ TMEDIA_CODEC_VIDEO(h264)->in.width = /*pFormat->coded_width*/newWidth;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = /*pFormat->coded_height*/newHeight;
+ ret = 1; //success
+ }
+ }
bail:
- cuResult = cuCtxPopCurrent(NULL);
- tsk_mutex_unlock(h264->decoder.phMutex);
- return ret;//success
+ cuResult = cuCtxPopCurrent(NULL);
+ tsk_mutex_unlock(h264->decoder.phMutex);
+ return ret;//success
}
static int CUDAAPI _NVCallback_HandlePictureDecode(void *pvUserData, CUVIDPICPARAMS *pPicParams)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
- if(!h264 || !pPicParams)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
+ if(!h264 || !pPicParams) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
- tsk_mutex_lock(h264->decoder.phMutex);
- CUresult cuResult = cuvidDecodePicture(h264->decoder.pInst, pPicParams);
- tsk_mutex_unlock(h264->decoder.phMutex);
+ tsk_mutex_lock(h264->decoder.phMutex);
+ CUresult cuResult = cuvidDecodePicture(h264->decoder.pInst, pPicParams);
+ tsk_mutex_unlock(h264->decoder.phMutex);
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuvidDecodePicture failed with error code= %d", cuResult);
- return 0;//error
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidDecodePicture failed with error code= %d", cuResult);
+ return 0;//error
}
- return 1;//success
+ return 1;//success
}
static int CUDAAPI _NVCallback_HandlePictureDisplay(void *pvUserData, CUVIDPARSERDISPINFO *pPicParams)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
- CUVIDPROCPARAMS vpp = {0};
- CUdeviceptr devPtr;
- CUresult cuResult;
- tsk_size_t nv12_size;
- tsk_bool_t mapped = tsk_false;
- int ret = 1;//success
-
- if(!h264 || !pPicParams)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
-
- cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code = %d", (int)cuResult);
- ret = 0;//error
- goto bail;
- }
-
- vpp.progressive_frame = pPicParams->progressive_frame;
- vpp.top_field_first = pPicParams->top_field_first;
- cuResult = cuvidMapVideoFrame(h264->decoder.pInst, pPicParams->picture_index, &devPtr, &h264->decoder.cuBuffer.nPitch, &vpp);
-
- if(cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuvidMapVideoFrame failed with error code = %d", (int)cuResult);
- ret = 0;//error
- goto bail;
- }
- mapped = tsk_true;
- nv12_size = ((h264->decoder.cuBuffer.nPitch * TMEDIA_CODEC_VIDEO(h264)->in.height) * 3) >> 1;
- if ((!h264->decoder.cuBuffer.pcuPtr) || (nv12_size > h264->decoder.cuBuffer.nSize))
- {
- h264->decoder.cuBuffer.nSize = 0;
- if (h264->decoder.cuBuffer.pcuPtr)
- {
- cuResult = cuMemFreeHost(h264->decoder.cuBuffer.pcuPtr);
- h264->decoder.cuBuffer.pcuPtr = NULL;
- }
- cuResult = cuMemAllocHost((void**)&h264->decoder.cuBuffer.pcuPtr, nv12_size);
- if (cuResult != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuMemAllocHost failed to allocate %d bytes (error code=%d)", nv12_size, (int)cuResult);
- h264->decoder.cuBuffer.pcuPtr = tsk_null;
- h264->decoder.cuBuffer.nSize = 0;
- ret = 0;//error
- }
- else
- {
- h264->decoder.cuBuffer.nSize = nv12_size;
- }
- }
- if(h264->decoder.cuBuffer.pcuPtr)
- {
- cuResult = cuMemcpyDtoH(h264->decoder.cuBuffer.pcuPtr, devPtr, nv12_size);
- }
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
+ CUVIDPROCPARAMS vpp = {0};
+ CUdeviceptr devPtr;
+ CUresult cuResult;
+ tsk_size_t nv12_size;
+ tsk_bool_t mapped = tsk_false;
+ int ret = 1;//success
+
+ if(!h264 || !pPicParams) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
+
+ cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code = %d", (int)cuResult);
+ ret = 0;//error
+ goto bail;
+ }
+
+ vpp.progressive_frame = pPicParams->progressive_frame;
+ vpp.top_field_first = pPicParams->top_field_first;
+ cuResult = cuvidMapVideoFrame(h264->decoder.pInst, pPicParams->picture_index, &devPtr, &h264->decoder.cuBuffer.nPitch, &vpp);
+
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidMapVideoFrame failed with error code = %d", (int)cuResult);
+ ret = 0;//error
+ goto bail;
+ }
+ mapped = tsk_true;
+ nv12_size = ((h264->decoder.cuBuffer.nPitch * TMEDIA_CODEC_VIDEO(h264)->in.height) * 3) >> 1;
+ if ((!h264->decoder.cuBuffer.pcuPtr) || (nv12_size > h264->decoder.cuBuffer.nSize)) {
+ h264->decoder.cuBuffer.nSize = 0;
+ if (h264->decoder.cuBuffer.pcuPtr) {
+ cuResult = cuMemFreeHost(h264->decoder.cuBuffer.pcuPtr);
+ h264->decoder.cuBuffer.pcuPtr = NULL;
+ }
+ cuResult = cuMemAllocHost((void**)&h264->decoder.cuBuffer.pcuPtr, nv12_size);
+ if (cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuMemAllocHost failed to allocate %d bytes (error code=%d)", nv12_size, (int)cuResult);
+ h264->decoder.cuBuffer.pcuPtr = tsk_null;
+ h264->decoder.cuBuffer.nSize = 0;
+ ret = 0;//error
+ }
+ else {
+ h264->decoder.cuBuffer.nSize = nv12_size;
+ }
+ }
+ if(h264->decoder.cuBuffer.pcuPtr) {
+ cuResult = cuMemcpyDtoH(h264->decoder.cuBuffer.pcuPtr, devPtr, nv12_size);
+ }
bail:
- if(mapped)
- {
- cuResult = cuvidUnmapVideoFrame(h264->decoder.pInst, devPtr);
- }
- cuResult = cuCtxPopCurrent(NULL);
-
- h264->decoder.cuBuffer.bAvail = (ret == 1);
- return ret;
+ if(mapped) {
+ cuResult = cuvidUnmapVideoFrame(h264->decoder.pInst, devPtr);
+ }
+ cuResult = cuCtxPopCurrent(NULL);
+
+ h264->decoder.cuBuffer.bAvail = (ret == 1);
+ return ret;
}
static unsigned char* CUDAAPI _NVCallback_HandleAcquireBitStream(int *pBufferSize, void *pUserdata)
{
- cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pUserdata;
- if(!h264 || !pBufferSize)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- *pBufferSize = (int)h264->encoder.nBufferSize;
- return (unsigned char*)h264->encoder.pBufferPtr;
+ cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pUserdata;
+ if(!h264 || !pBufferSize) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ *pBufferSize = (int)h264->encoder.nBufferSize;
+ return (unsigned char*)h264->encoder.pBufferPtr;
}
static void CUDAAPI _NVCallback_HandleReleaseBitStream(int nBytesInBuffer, unsigned char *cb, void *pUserdata)
{
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)pUserdata;
- if(!common || !cb || !nBytesInBuffer)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
- tdav_codec_h264_rtp_encap(common, (const uint8_t*)cb, (tsk_size_t)nBytesInBuffer);
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)pUserdata;
+ if(!common || !cb || !nBytesInBuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+ tdav_codec_h264_rtp_encap(common, (const uint8_t*)cb, (tsk_size_t)nBytesInBuffer);
}
static void CUDAAPI _NVCallback_HandleOnBeginFrame(const NVVE_BeginFrameInfo *pbfi, void *pUserdata)
diff --git a/plugins/pluginCUDA/plugin_cuda_config.h b/plugins/pluginCUDA/plugin_cuda_config.h
index 4fceebb..3431e0c 100755
--- a/plugins/pluginCUDA/plugin_cuda_config.h
+++ b/plugins/pluginCUDA/plugin_cuda_config.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -48,12 +48,12 @@
# define PLUGIN_CUDA_UNDER_X86 1
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define PLUGIN_CUDA_BEGIN_DECLS extern "C" {
# define PLUGIN_CUDA_END_DECLS }
#else
-# define PLUGIN_CUDA_BEGIN_DECLS
+# define PLUGIN_CUDA_BEGIN_DECLS
# define PLUGIN_CUDA_END_DECLS
#endif
@@ -69,7 +69,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // PLUGIN_CUDA_CONFIG_H
diff --git a/plugins/pluginCUDA/plugin_cuda_tdav.cxx b/plugins/pluginCUDA/plugin_cuda_tdav.cxx
index 2d16b72..44a25d5 100755
--- a/plugins/pluginCUDA/plugin_cuda_tdav.cxx
+++ b/plugins/pluginCUDA/plugin_cuda_tdav.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/pluginCUDA/plugin_cuda_utils.cxx b/plugins/pluginCUDA/plugin_cuda_utils.cxx
index 94c7baf..d5d2aad 100755
--- a/plugins/pluginCUDA/plugin_cuda_utils.cxx
+++ b/plugins/pluginCUDA/plugin_cuda_utils.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,83 +31,74 @@ int CudaUtils::g_nCores = 0;
HRESULT CudaUtils::Startup()
{
- if(!g_bStarted)
- {
- CUresult cuResult = CUDA_SUCCESS;
- HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
- if(SUCCEEDED(hr) || hr == 0x80010106) // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
- {
- if((cuResult = cuInit(0)) != CUDA_SUCCESS)
- {
- TSK_DEBUG_ERROR("cuInit() failed with error code = %08x", cuResult);
- hr = E_FAIL;
- }
- else
- {
- hr = S_OK;
- }
- }
- g_bStarted = true;
- return hr;
- }
- return S_OK;
+ if(!g_bStarted) {
+ CUresult cuResult = CUDA_SUCCESS;
+ HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if(SUCCEEDED(hr) || hr == 0x80010106) { // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
+ if((cuResult = cuInit(0)) != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuInit() failed with error code = %08x", cuResult);
+ hr = E_FAIL;
+ }
+ else {
+ hr = S_OK;
+ }
+ }
+ g_bStarted = true;
+ return hr;
+ }
+ return S_OK;
}
HRESULT CudaUtils::Shutdown()
{
- // cuDeinit();
- return S_OK;
+ // cuDeinit();
+ return S_OK;
}
bool CudaUtils::IsH264Supported()
{
- if(g_bH264Checked)
- {
- return g_bH264Supported;
- }
-
- HRESULT hr = S_OK;
-
- CHECK_HR(hr = Startup());
-
- g_bH264Checked = true;
-
- NVEncoder pEncoder = NULL;
-
- CHECK_HR(hr = NVGetHWEncodeCaps());
- CHECK_HR(hr = NVCreateEncoder(&pEncoder));
- // Both Base and Main profiles *must* be supported
- CHECK_HR(hr = NVIsSupportedCodecProfile(pEncoder, NV_CODEC_TYPE_H264, NVVE_H264_PROFILE_BASELINE));
- CHECK_HR(hr = NVIsSupportedCodecProfile(pEncoder, NV_CODEC_TYPE_H264, NVVE_H264_PROFILE_MAIN));
-
- g_bH264Supported = true;
-
+ if(g_bH264Checked) {
+ return g_bH264Supported;
+ }
+
+ HRESULT hr = S_OK;
+
+ CHECK_HR(hr = Startup());
+
+ g_bH264Checked = true;
+
+ NVEncoder pEncoder = NULL;
+
+ CHECK_HR(hr = NVGetHWEncodeCaps());
+ CHECK_HR(hr = NVCreateEncoder(&pEncoder));
+ // Both Base and Main profiles *must* be supported
+ CHECK_HR(hr = NVIsSupportedCodecProfile(pEncoder, NV_CODEC_TYPE_H264, NVVE_H264_PROFILE_BASELINE));
+ CHECK_HR(hr = NVIsSupportedCodecProfile(pEncoder, NV_CODEC_TYPE_H264, NVVE_H264_PROFILE_MAIN));
+
+ g_bH264Supported = true;
+
bail:
- if(pEncoder)
- {
- NVDestroyEncoder(pEncoder);
- pEncoder = NULL;
- }
+ if(pEncoder) {
+ NVDestroyEncoder(pEncoder);
+ pEncoder = NULL;
+ }
- return g_bH264Supported;
+ return g_bH264Supported;
}
int CudaUtils::ConvertSMVer2Cores(int nMajor, int nMinor)
{
- if(g_nCores != 0)
- {
- return g_nCores;
- }
-
- // Defines for GPU Architecture types (using the SM version to determine the # of cores per SM
- typedef struct
- {
+ if(g_nCores != 0) {
+ return g_nCores;
+ }
+
+ // Defines for GPU Architecture types (using the SM version to determine the # of cores per SM
+ typedef struct {
int SM; // 0xMm (hexidecimal notation), M = SM Major version, and m = SM minor version
int Cores;
} sSMtoCores;
- sSMtoCores nGpuArchCoresPerSM[] =
- {
+ sSMtoCores nGpuArchCoresPerSM[] = {
{ 0x10, 8 }, // Tesla Generation (SM 1.0) G80 class
{ 0x11, 8 }, // Tesla Generation (SM 1.1) G8x class
{ 0x12, 8 }, // Tesla Generation (SM 1.2) G9x class
@@ -120,12 +111,10 @@ int CudaUtils::ConvertSMVer2Cores(int nMajor, int nMinor)
int index = 0;
- while (nGpuArchCoresPerSM[index].SM != -1)
- {
- if (nGpuArchCoresPerSM[index].SM == ((nMajor << 4) + nMinor))
- {
+ while (nGpuArchCoresPerSM[index].SM != -1) {
+ if (nGpuArchCoresPerSM[index].SM == ((nMajor << 4) + nMinor)) {
g_nCores = nGpuArchCoresPerSM[index].Cores;
- break;
+ break;
}
index++;
@@ -135,34 +124,32 @@ int CudaUtils::ConvertSMVer2Cores(int nMajor, int nMinor)
TSK_DEBUG_INFO("MapSMtoCores for SM %d.%d is undefined. Default to use %d Cores/SM", nMajor, nMinor, nGpuArchCoresPerSM[7].Cores);
g_nCores = nGpuArchCoresPerSM[7].Cores;
- return g_nCores;
+ return g_nCores;
}
int CudaUtils::GetMaxGflopsDeviceId()
{
- int device_count = 0;
- cudaGetDeviceCount( &device_count );
-
- cudaDeviceProp device_properties;
- int max_gflops_device = 0;
- int max_gflops = 0;
-
- int current_device = 0;
- cudaGetDeviceProperties( &device_properties, current_device );
- max_gflops = device_properties.multiProcessorCount * device_properties.clockRate;
- ++current_device;
-
- while( current_device < device_count )
- {
- cudaGetDeviceProperties( &device_properties, current_device );
- int gflops = device_properties.multiProcessorCount * device_properties.clockRate;
- if( gflops > max_gflops )
- {
- max_gflops = gflops;
- max_gflops_device = current_device;
- }
- ++current_device;
- }
-
- return max_gflops_device;
+ int device_count = 0;
+ cudaGetDeviceCount( &device_count );
+
+ cudaDeviceProp device_properties;
+ int max_gflops_device = 0;
+ int max_gflops = 0;
+
+ int current_device = 0;
+ cudaGetDeviceProperties( &device_properties, current_device );
+ max_gflops = device_properties.multiProcessorCount * device_properties.clockRate;
+ ++current_device;
+
+ while( current_device < device_count ) {
+ cudaGetDeviceProperties( &device_properties, current_device );
+ int gflops = device_properties.multiProcessorCount * device_properties.clockRate;
+ if( gflops > max_gflops ) {
+ max_gflops = gflops;
+ max_gflops_device = current_device;
+ }
+ ++current_device;
+ }
+
+ return max_gflops_device;
} \ No newline at end of file
diff --git a/plugins/pluginCUDA/plugin_cuda_utils.h b/plugins/pluginCUDA/plugin_cuda_utils.h
index 4829275..6b91fac 100755
--- a/plugins/pluginCUDA/plugin_cuda_utils.h
+++ b/plugins/pluginCUDA/plugin_cuda_utils.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -35,22 +35,22 @@
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
class CudaUtils
{
public:
- static HRESULT Startup();
- static HRESULT Shutdown();
- static bool IsH264Supported();
- static int ConvertSMVer2Cores(int nMajor, int nMinor);
- static int GetMaxGflopsDeviceId();
+ static HRESULT Startup();
+ static HRESULT Shutdown();
+ static bool IsH264Supported();
+ static int ConvertSMVer2Cores(int nMajor, int nMinor);
+ static int GetMaxGflopsDeviceId();
private:
- static bool g_bStarted;
- static bool g_bH264Checked;
- static bool g_bH264Supported;
- static int g_nCores;
+ static bool g_bStarted;
+ static bool g_bH264Checked;
+ static bool g_bH264Supported;
+ static int g_nCores;
};
#endif/* PLUGIN_CUDA_UTILS_H */
diff --git a/plugins/pluginDirectShow/dllmain_dshow.cxx b/plugins/pluginDirectShow/dllmain_dshow.cxx
index 2b1eda8..b8a18d7 100755
--- a/plugins/pluginDirectShow/dllmain_dshow.cxx
+++ b/plugins/pluginDirectShow/dllmain_dshow.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -42,13 +42,14 @@ extern const tmedia_consumer_plugin_def_t *plugin_video_dshow_consumer_plugin_de
extern const tmedia_producer_plugin_def_t *plugin_video_dshow_producer_plugin_def_t;
extern const tmedia_producer_plugin_def_t *plugin_screencast_dshow_producer_plugin_def_t;
-CFactoryTemplate g_Templates[]=
-{ { L""
-, NULL
-, NULL
-, NULL
-, NULL
-}
+CFactoryTemplate g_Templates[]= {
+ {
+ L""
+ , NULL
+ , NULL
+ , NULL
+ , NULL
+ }
};
int g_cTemplates = sizeof(g_Templates)/sizeof(g_Templates[0]);
@@ -56,101 +57,90 @@ int g_cTemplates = sizeof(g_Templates)/sizeof(g_Templates[0]);
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
#endif
-typedef enum PLUGIN_INDEX_E
-{
- PLUGIN_INDEX_VIDEO_CONSUMER,
- PLUGIN_INDEX_VIDEO_PRODUCER,
+typedef enum PLUGIN_INDEX_E {
+ PLUGIN_INDEX_VIDEO_CONSUMER,
+ PLUGIN_INDEX_VIDEO_PRODUCER,
#if 0
- PLUGIN_INDEX_SCREENCAST_PRODUCER,
+ PLUGIN_INDEX_SCREENCAST_PRODUCER,
#endif
- PLUGIN_INDEX_COUNT
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- return IsD3D9Supported() ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_none;
- case PLUGIN_INDEX_VIDEO_PRODUCER:
+ switch(index) {
+ case PLUGIN_INDEX_VIDEO_CONSUMER:
+ return IsD3D9Supported() ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_none;
+ case PLUGIN_INDEX_VIDEO_PRODUCER:
#if ENABLE_SCREENCAST
- case PLUGIN_INDEX_SCREENCAST_PRODUCER:
+ case PLUGIN_INDEX_SCREENCAST_PRODUCER:
#endif
- return tsk_plugin_def_type_producer;
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
- }
- }
+ return tsk_plugin_def_type_producer;
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
+ }
+ }
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- {
- return IsD3D9Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
- }
- case PLUGIN_INDEX_VIDEO_PRODUCER:
- {
- return tsk_plugin_def_media_type_video;
- }
+ switch(index) {
+ case PLUGIN_INDEX_VIDEO_CONSUMER: {
+ return IsD3D9Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
+ }
+ case PLUGIN_INDEX_VIDEO_PRODUCER: {
+ return tsk_plugin_def_media_type_video;
+ }
#if ENABLE_SCREENCAST
- case PLUGIN_INDEX_SCREENCAST_PRODUCER:
- {
- return tsk_plugin_def_media_type_screencast;
- }
+ case PLUGIN_INDEX_SCREENCAST_PRODUCER: {
+ return tsk_plugin_def_media_type_screencast;
+ }
#endif
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
- }
- }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
+ }
+ }
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch(index){
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- {
- return IsD3D9Supported() ? plugin_video_dshow_consumer_plugin_def_t : tsk_null;
- }
- case PLUGIN_INDEX_VIDEO_PRODUCER:
- {
- return plugin_video_dshow_producer_plugin_def_t;
- }
+ switch(index) {
+ case PLUGIN_INDEX_VIDEO_CONSUMER: {
+ return IsD3D9Supported() ? plugin_video_dshow_consumer_plugin_def_t : tsk_null;
+ }
+ case PLUGIN_INDEX_VIDEO_PRODUCER: {
+ return plugin_video_dshow_producer_plugin_def_t;
+ }
#if ENABLE_SCREENCAST
- case PLUGIN_INDEX_SCREENCAST_PRODUCER:
- {
- return plugin_screencast_dshow_producer_plugin_def_t;
- }
+ case PLUGIN_INDEX_SCREENCAST_PRODUCER: {
+ return plugin_screencast_dshow_producer_plugin_def_t;
+ }
#endif
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
- }
- }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
+ }
+ }
}
diff --git a/plugins/pluginDirectShow/internals/DSBaseCaptureGraph.h b/plugins/pluginDirectShow/internals/DSBaseCaptureGraph.h
index 1817fb5..c2d8455 100755
--- a/plugins/pluginDirectShow/internals/DSBaseCaptureGraph.h
+++ b/plugins/pluginDirectShow/internals/DSBaseCaptureGraph.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -36,29 +36,29 @@ class DSBaseCaptureGraph
{
public:
#if defined(_WIN32_WCE)
- DSBaseCaptureGraph(DSISampleGrabberCB* callback, HRESULT *hr) {}
+ DSBaseCaptureGraph(DSISampleGrabberCB* callback, HRESULT *hr) {}
#else
- DSBaseCaptureGraph(ISampleGrabberCB* callback, HRESULT *hr) {}
+ DSBaseCaptureGraph(ISampleGrabberCB* callback, HRESULT *hr) {}
#endif
- virtual ~DSBaseCaptureGraph() {}
+ virtual ~DSBaseCaptureGraph() {}
- virtual std::vector<DSCaptureFormat> *getFormats() = 0;
+ virtual std::vector<DSCaptureFormat> *getFormats() = 0;
- virtual HRESULT setSource(const std::string &devicePath) = 0;
- virtual HRESULT setParameters(DSCaptureFormat *format, int framerate) = 0;
+ virtual HRESULT setSource(const std::string &devicePath) = 0;
+ virtual HRESULT setParameters(DSCaptureFormat *format, int framerate) = 0;
- virtual HRESULT connect() = 0;
- virtual HRESULT disconnect() = 0;
+ virtual HRESULT connect() = 0;
+ virtual HRESULT disconnect() = 0;
- virtual HRESULT start() = 0;
- virtual HRESULT stop() = 0;
- virtual HRESULT pause() = 0;
- virtual bool isRunning() = 0;
- virtual bool isPaused() = 0;
+ virtual HRESULT start() = 0;
+ virtual HRESULT stop() = 0;
+ virtual HRESULT pause() = 0;
+ virtual bool isRunning() = 0;
+ virtual bool isPaused() = 0;
- virtual std::string getDeviceId() const = 0;
+ virtual std::string getDeviceId() const = 0;
- virtual HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType) = 0;
+ virtual HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType) = 0;
};
#endif /* PLUGIN_DSHOW_DSBASECAPTUREGRAPH_H */
diff --git a/plugins/pluginDirectShow/internals/DSBufferWriter.h b/plugins/pluginDirectShow/internals/DSBufferWriter.h
index dbe1484..70c1f23 100755
--- a/plugins/pluginDirectShow/internals/DSBufferWriter.h
+++ b/plugins/pluginDirectShow/internals/DSBufferWriter.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -30,19 +30,19 @@
#endif
// {27AD9929-E4E7-423b-8BDD-8AF5AC894DE0}
-TDSHOW_DEFINE_GUID(IID_DSBufferWriter,
+TDSHOW_DEFINE_GUID(IID_DSBufferWriter,
0x27ad9929, 0xe4e7, 0x423b, 0x8b, 0xdd, 0x8a, 0xf5, 0xac, 0x89, 0x4d, 0xe0);
*/
class DSBufferWriter
#ifndef _WIN32_WCE
- : public IUnknown
+ : public IUnknown
#endif
{
public:
- virtual void setBuffer (void* pBuffer, int size) = 0;
- virtual HRESULT setImageFormat(UINT width, UINT height/*, GUID subType, UINT fps*/) = 0;
+ virtual void setBuffer (void* pBuffer, int size) = 0;
+ virtual HRESULT setImageFormat(UINT width, UINT height/*, GUID subType, UINT fps*/) = 0;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSCaptureFormat.cxx b/plugins/pluginDirectShow/internals/DSCaptureFormat.cxx
index 378a215..781101d 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureFormat.cxx
+++ b/plugins/pluginDirectShow/internals/DSCaptureFormat.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,40 +21,60 @@
int DSCaptureFormat::getMatchScore(int w, int h)
{
- int factor;
+ int factor;
- if ((w == width) && (h = height)){
- factor = 100;
- }
- else if ((w > this->width) && (h > this->height)){
- factor = 0;
- }
- else{
- factor = (50 * w) / this->width + (50 * h) / this->height;
- }
+ if ((w == width) && (h = height)) {
+ factor = 100;
+ }
+ else if ((w > this->width) && (h > this->height)) {
+ factor = 0;
+ }
+ else {
+ factor = (50 * w) / this->width + (50 * h) / this->height;
+ }
- if (isRGB()){
- factor *= 2;
- }
+ if (isRGB()) {
+ factor *= 2;
+ }
- return factor;
+ return factor;
}
bool DSCaptureFormat::isRGB()
{
- // Order used is optimized for most used RGB types
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB32)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB24)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB565)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB555)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB8)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB4)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB1)) return true;
+ // Order used is optimized for most used RGB types
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB32)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB24)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB565)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB555)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB8)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB4)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB1)) {
+ return true;
+ }
#ifndef _WIN32_WCE
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB32)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB4444)) return true;
- if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB1555)) return true;
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB32)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB4444)) {
+ return true;
+ }
+ if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB1555)) {
+ return true;
+ }
#endif
- return false;
+ return false;
}
diff --git a/plugins/pluginDirectShow/internals/DSCaptureFormat.h b/plugins/pluginDirectShow/internals/DSCaptureFormat.h
index 5e1cabb..45497cb 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureFormat.h
+++ b/plugins/pluginDirectShow/internals/DSCaptureFormat.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,22 +25,30 @@
class DSCaptureFormat
{
public:
- DSCaptureFormat(int w, int h, int f, GUID c) : width(w), height(h), fps(f), chroma(c) {};
- virtual ~DSCaptureFormat() {};
-
- int getWidth() { return this->width; };
- int getHeight() { return this->height; };
- int getFramerate() { return this->fps; };
- GUID getChroma() { return this->chroma; };
-
- int getMatchScore(int w, int h);
- bool isRGB();
+ DSCaptureFormat(int w, int h, int f, GUID c) : width(w), height(h), fps(f), chroma(c) {};
+ virtual ~DSCaptureFormat() {};
+
+ int getWidth() {
+ return this->width;
+ };
+ int getHeight() {
+ return this->height;
+ };
+ int getFramerate() {
+ return this->fps;
+ };
+ GUID getChroma() {
+ return this->chroma;
+ };
+
+ int getMatchScore(int w, int h);
+ bool isRGB();
private:
- int width;
- int height;
- int fps;
- GUID chroma;
+ int width;
+ int height;
+ int fps;
+ GUID chroma;
};
diff --git a/plugins/pluginDirectShow/internals/DSCaptureGraph.cxx b/plugins/pluginDirectShow/internals/DSCaptureGraph.cxx
index 3da6da1..1b46b72 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureGraph.cxx
+++ b/plugins/pluginDirectShow/internals/DSCaptureGraph.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -27,149 +27,159 @@ using namespace std;
#ifdef _WIN32_WCE
DSCaptureGraph::DSCaptureGraph(DSISampleGrabberCB* callback, HRESULT *hr)
-: DSBaseCaptureGraph(callback, hr)
+ : DSBaseCaptureGraph(callback, hr)
#else
DSCaptureGraph::DSCaptureGraph(ISampleGrabberCB* callback, HRESULT *hr)
-: DSBaseCaptureGraph(callback, hr)
+ : DSBaseCaptureGraph(callback, hr)
#endif
{
- this->grabberCallback = callback;
+ this->grabberCallback = callback;
- this->captureFormat = NULL;
- this->captureGraphBuilder = NULL;
- this->graphBuilder = NULL;
+ this->captureFormat = NULL;
+ this->captureGraphBuilder = NULL;
+ this->graphBuilder = NULL;
- this->sourceFilter = NULL;
- this->sampleGrabberFilter = NULL;
+ this->sourceFilter = NULL;
+ this->sampleGrabberFilter = NULL;
#ifdef _WIN32_WCE
- this->colorConvertor565 = NULL;
+ this->colorConvertor565 = NULL;
#else
- this->frameRateFilter = NULL;
+ this->frameRateFilter = NULL;
#endif
- this->nullRendererFilter = NULL;
- this->grabberController = NULL;
- this->mediaController = NULL;
- this->mediaEventController = NULL;
+ this->nullRendererFilter = NULL;
+ this->grabberController = NULL;
+ this->mediaController = NULL;
+ this->mediaEventController = NULL;
- this->streamConfiguration = NULL;
+ this->streamConfiguration = NULL;
- this->running = FALSE;
- this->paused = FALSE;
- this->deviceId = "";
+ this->running = FALSE;
+ this->paused = FALSE;
+ this->deviceId = "";
- *hr = this->createCaptureGraph();
+ *hr = this->createCaptureGraph();
}
DSCaptureGraph::~DSCaptureGraph()
{
- SAFE_RELEASE(this->streamConfiguration);
+ SAFE_RELEASE(this->streamConfiguration);
- SAFE_RELEASE(this->mediaEventController);
- SAFE_RELEASE(this->mediaController);
- SAFE_RELEASE(this->grabberController);
+ SAFE_RELEASE(this->mediaEventController);
+ SAFE_RELEASE(this->mediaController);
+ SAFE_RELEASE(this->grabberController);
#if defined(_WIN32_WCE)
- SAFE_RELEASE(this->colorConvertor565);
+ SAFE_RELEASE(this->colorConvertor565);
#else
#endif
- SAFE_RELEASE(this->nullRendererFilter);
- SAFE_RELEASE(this->sampleGrabberFilter);
- SAFE_RELEASE(this->sourceFilter);
+ SAFE_RELEASE(this->nullRendererFilter);
+ SAFE_RELEASE(this->sampleGrabberFilter);
+ SAFE_RELEASE(this->sourceFilter);
- SAFE_RELEASE(this->graphBuilder);
- SAFE_RELEASE(this->captureGraphBuilder);
+ SAFE_RELEASE(this->graphBuilder);
+ SAFE_RELEASE(this->captureGraphBuilder);
}
HRESULT DSCaptureGraph::setSource(const std::string &devicePath)
{
- HRESULT hr = E_FAIL;
+ HRESULT hr = E_FAIL;
- if (this->sourceFilter){
- this->graphBuilder->RemoveFilter(this->sourceFilter);
- }
+ if (this->sourceFilter) {
+ this->graphBuilder->RemoveFilter(this->sourceFilter);
+ }
- SAFE_RELEASE(this->streamConfiguration);
- SAFE_RELEASE(this->sourceFilter);
+ SAFE_RELEASE(this->streamConfiguration);
+ SAFE_RELEASE(this->sourceFilter);
- // Create the filter
- this->deviceId = devicePath;
- hr = createSourceFilter(&this->deviceId, &this->sourceFilter);
+ // Create the filter
+ this->deviceId = devicePath;
+ hr = createSourceFilter(&this->deviceId, &this->sourceFilter);
- if (this->sourceFilter){
- // Gets the supported formats
- this->supportedFormats.clear();
- getSupportedFormats(this->sourceFilter, &this->supportedFormats);
+ if (this->sourceFilter) {
+ // Gets the supported formats
+ this->supportedFormats.clear();
+ getSupportedFormats(this->sourceFilter, &this->supportedFormats);
- // Query for video stream config
- hr = this->captureGraphBuilder->FindInterface(
- &PIN_CATEGORY_CAPTURE,
- &MEDIATYPE_Video,
- this->sourceFilter,
- IID_IAMStreamConfig,
- reinterpret_cast<void**>(&this->streamConfiguration));
+ // Query for video stream config
+ hr = this->captureGraphBuilder->FindInterface(
+ &PIN_CATEGORY_CAPTURE,
+ &MEDIATYPE_Video,
+ this->sourceFilter,
+ IID_IAMStreamConfig,
+ reinterpret_cast<void**>(&this->streamConfiguration));
- hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_WEBCAM);
- }
+ hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_WEBCAM);
+ }
- return hr;
+ return hr;
}
HRESULT DSCaptureGraph::setParameters(DSCaptureFormat *format, int framerate)
{
- HRESULT hr = E_FAIL;
- AM_MEDIA_TYPE *mediaType = NULL;
+ HRESULT hr = E_FAIL;
+ AM_MEDIA_TYPE *mediaType = NULL;
- if (!this->streamConfiguration) goto bail;
+ if (!this->streamConfiguration) {
+ goto bail;
+ }
- hr = this->streamConfiguration->GetFormat(&mediaType);
- if (FAILED(hr)) goto bail;
+ hr = this->streamConfiguration->GetFormat(&mediaType);
+ if (FAILED(hr)) {
+ goto bail;
+ }
- VIDEOINFOHEADER* vih = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat);
- BITMAPINFOHEADER* bih = &vih->bmiHeader;
+ VIDEOINFOHEADER* vih = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat);
+ BITMAPINFOHEADER* bih = &vih->bmiHeader;
- int w = format->getWidth();
- int h = format->getHeight();
+ int w = format->getWidth();
+ int h = format->getHeight();
- bool wN = (bih->biWidth<0);
- bool hN = (bih->biHeight<0);
+ bool wN = (bih->biWidth<0);
+ bool hN = (bih->biHeight<0);
- // DIBS are DWORD aligned
- int data_size = h * ((w * bih->biBitCount + 31) / 32) * 4;
+ // DIBS are DWORD aligned
+ int data_size = h * ((w * bih->biBitCount + 31) / 32) * 4;
- bih->biSize = sizeof(BITMAPINFOHEADER);
- bih->biWidth = w*(wN?-1:1);
- bih->biHeight = h*(hN?-1:1);
- bih->biSizeImage = data_size;
+ bih->biSize = sizeof(BITMAPINFOHEADER);
+ bih->biWidth = w*(wN?-1:1);
+ bih->biHeight = h*(hN?-1:1);
+ bih->biSizeImage = data_size;
- //vih->dwBitRate = framerate * data_size;
- //vih->AvgTimePerFrame = SECONDS_TO_100NS(framerate);
+ //vih->dwBitRate = framerate * data_size;
+ //vih->AvgTimePerFrame = SECONDS_TO_100NS(framerate);
- mediaType->cbFormat = sizeof(VIDEOINFOHEADER);
- //mediaType->lSampleSize = data_size;
- mediaType->subtype = format->getChroma();
+ mediaType->cbFormat = sizeof(VIDEOINFOHEADER);
+ //mediaType->lSampleSize = data_size;
+ mediaType->subtype = format->getChroma();
- hr = this->streamConfiguration->SetFormat(mediaType);
- if (FAILED(hr)) goto bail;
+ hr = this->streamConfiguration->SetFormat(mediaType);
+ if (FAILED(hr)) {
+ goto bail;
+ }
#if defined(_WIN32_WCE)
- hr = this->grabberController->SetFps((int) DS_SECONDS_FROM_100NS(vih->AvgTimePerFrame)/*format->getFramerate()*/, framerate);
- if (FAILED(hr)) goto bail;
- hr = this->grabberController->SetSize(w,h);
+ hr = this->grabberController->SetFps((int) DS_SECONDS_FROM_100NS(vih->AvgTimePerFrame)/*format->getFramerate()*/, framerate);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+ hr = this->grabberController->SetSize(w,h);
#else
- // Set fps using tdshow filter
- hr = this->frameRateFilter->SetFps((int) ((float)vih->AvgTimePerFrame/10000.f)/*format->getFramerate()*/, framerate);
+ // Set fps using tdshow filter
+ hr = this->frameRateFilter->SetFps((int) ((float)vih->AvgTimePerFrame/10000.f)/*format->getFramerate()*/, framerate);
#endif
- if (FAILED(hr)) goto bail;
+ if (FAILED(hr)) {
+ goto bail;
+ }
- this->captureFormat = format;
+ this->captureFormat = format;
bail:
- DeleteMediaType(mediaType);
+ DeleteMediaType(mediaType);
- return hr;
+ return hr;
}
#if defined(_WIN32_WCE)
@@ -178,259 +188,314 @@ bail:
HRESULT DSCaptureGraph::connect()
{
- HRESULT hr;
+ HRESULT hr;
- if (!this->sourceFilter){
- TSK_DEBUG_ERROR("Invalid source filter");
- return E_FAIL;
- }
+ if (!this->sourceFilter) {
+ TSK_DEBUG_ERROR("Invalid source filter");
+ return E_FAIL;
+ }
- if (!this->captureFormat){
- TSK_DEBUG_ERROR("Invalid capture format");
- return E_FAIL;
- }
+ if (!this->captureFormat) {
+ TSK_DEBUG_ERROR("Invalid capture format");
+ return E_FAIL;
+ }
- if (!this->graphBuilder){
- TSK_DEBUG_ERROR("Invalid grash builder");
- return E_FAIL;
- }
+ if (!this->graphBuilder) {
+ TSK_DEBUG_ERROR("Invalid grash builder");
+ return E_FAIL;
+ }
- if (this->captureFormat->isRGB())
- {
+ if (this->captureFormat->isRGB()) {
#if defined(_WIN32_WCE)
- hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ; if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ; if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
+ hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ;
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ;
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
#else
- hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
+ hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
#endif
- }
- else
- {
+ }
+ else {
#if defined(_WIN32_WCE)
- hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ; if(FAILED(hr))return hr;
- hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ; if(FAILED(hr))return hr;
- hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr))return hr;
+ hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ;
+ if(FAILED(hr)) {
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ;
+ if(FAILED(hr)) {
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#else
- // No convertor needed
- // AVI Decompressor Filter is automatically by the Filter Graph Manager when needed
- hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
+ // No convertor needed
+ // AVI Decompressor Filter is automatically by the Filter Graph Manager when needed
+ hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
#endif
- }
+ }
- return hr;
+ return hr;
}
HRESULT DSCaptureGraph::disconnect()
{
- HRESULT hr;
+ HRESULT hr;
- if (!this->sourceFilter) {
- return E_FAIL;
- }
+ if (!this->sourceFilter) {
+ return E_FAIL;
+ }
- if (!this->captureFormat) {
- return E_FAIL;
- }
+ if (!this->captureFormat) {
+ return E_FAIL;
+ }
- if (this->captureFormat->isRGB())
- {
+ if (this->captureFormat->isRGB()) {
#if defined(_WIN32_WCE)
- hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565);
- hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter);
- hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565);
+ hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
#else
- hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
- hr = DisconnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
- hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
#endif
- }
- else
- {
+ }
+ else {
#if defined(_WIN32_WCE)
- hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565); if(FAILED(hr))return hr;
- hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter); if(FAILED(hr))return hr;
- hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr))return hr;
+ hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565);
+ if(FAILED(hr)) {
+ return hr;
+ }
+ hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
+ hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#else
- hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
- hr = DisconnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
- hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
#endif
- }
+ }
- return hr;
+ return hr;
}
HRESULT DSCaptureGraph::start()
{
- HRESULT hr;
-
- if (isRunning() && !isPaused()) {
- return S_OK;
- }
-
- //this->mediaController->Stop();
-
- hr = this->mediaController ? this->mediaController->Run() : E_POINTER;
- /*if (hr == S_FALSE)
- {
- cerr << "DSCaptureGraph::mediaController->Start() has failed with " << hr << ". Waiting for transition." << endl;
- FILTER_STATE pfs;
- hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
- hr = this->mediaController->Run();
- }*/
-
- if (!SUCCEEDED(hr))
- {
+ HRESULT hr;
+
+ if (isRunning() && !isPaused()) {
+ return S_OK;
+ }
+
+ //this->mediaController->Stop();
+
+ hr = this->mediaController ? this->mediaController->Run() : E_POINTER;
+ /*if (hr == S_FALSE)
+ {
+ cerr << "DSCaptureGraph::mediaController->Start() has failed with " << hr << ". Waiting for transition." << endl;
+ FILTER_STATE pfs;
+ hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
+ hr = this->mediaController->Run();
+ }*/
+
+ if (!SUCCEEDED(hr)) {
#if defined(_WIN32_WCE)
- MessageBox(NULL, _T("Starting DirectShow Graph Failed"), _T("Failure"), MB_OK);
- //assert(1==15);
+ MessageBox(NULL, _T("Starting DirectShow Graph Failed"), _T("Failure"), MB_OK);
+ //assert(1==15);
#endif
- TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Run() has failed with %ld", hr);
- return hr;
- }
- this->running = true;
- return hr;
+ TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Run() has failed with %ld", hr);
+ return hr;
+ }
+ this->running = true;
+ return hr;
}
HRESULT DSCaptureGraph::pause()
{
- HRESULT hr = S_OK;
- if (isRunning()) {
- hr = this->mediaController->Pause();
- if (SUCCEEDED(hr)) {
- this->paused = TRUE;
- }
- }
- return hr;
+ HRESULT hr = S_OK;
+ if (isRunning()) {
+ hr = this->mediaController->Pause();
+ if (SUCCEEDED(hr)) {
+ this->paused = TRUE;
+ }
+ }
+ return hr;
}
HRESULT DSCaptureGraph::stop()
{
- HRESULT hr;
+ HRESULT hr;
#if 0 // Must not
- hr = this->mediaController->Pause();
- if (hr == S_FALSE)
- {
- TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Pause() has failed with %ld. Waiting for transition.", hr);
- FILTER_STATE pfs;
- hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
- }
+ hr = this->mediaController->Pause();
+ if (hr == S_FALSE) {
+ TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Pause() has failed with %ld. Waiting for transition.", hr);
+ FILTER_STATE pfs;
+ hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
+ }
#endif
- hr = this->mediaController->Stop();
- if (!SUCCEEDED(hr))
- {
- TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Stop() has failed with %ld", hr);
- }
- this->running = false;
- this->paused = false;
- return hr;
+ hr = this->mediaController->Stop();
+ if (!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Stop() has failed with %ld", hr);
+ }
+ this->running = false;
+ this->paused = false;
+ return hr;
}
bool DSCaptureGraph::isRunning()
{
- return this->running;
+ return this->running;
}
bool DSCaptureGraph::isPaused()
{
- return this->paused;
+ return this->paused;
}
HRESULT DSCaptureGraph::getConnectedMediaType(AM_MEDIA_TYPE *mediaType)
{
#if defined(_WIN32_WCE)
- memmove(mediaType, &this->grabberController->GetMediaType(), sizeof(AM_MEDIA_TYPE));
- return S_OK;
+ memmove(mediaType, &this->grabberController->GetMediaType(), sizeof(AM_MEDIA_TYPE));
+ return S_OK;
#else
- return this->grabberController->GetConnectedMediaType(mediaType);
+ return this->grabberController->GetConnectedMediaType(mediaType);
#endif
}
HRESULT DSCaptureGraph::createCaptureGraph()
{
- HRESULT hr;
+ HRESULT hr;
#if defined(_WIN32_WCE)
- // Create capture graph builder
- CHECK_HR(hr = COCREATE(CLSID_CaptureGraphBuilder, IID_ICaptureGraphBuilder2, this->captureGraphBuilder));
- CHECK_HR(hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder));
- CHECK_HR(hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder));
-
- // Create filters
- LPUNKNOWN pUnk1 = NULL, pUnk2 = NULL;
- CHECK_HR(hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorConvertor565));
- this->sampleGrabberFilter = new DSSampleGrabber(FITLER_SAMPLE_GRABBER, pUnk1, &hr); CHECK_HR(hr);
- this->nullRendererFilter = new DSNullFilter(/*FILTER_NULL_RENDERER,*/ pUnk2, &hr); CHECK_HR(hr);
- this->grabberController = (DSSampleGrabber*)(this->sampleGrabberFilter); if (!this->grabberController) CHECK_HR(E_FAIL);
-
- // Add Filters
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->colorConvertor565, FILTER_COLOR_CONVERTOR_565));
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER));
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER));
-
- // Find media control
- CHECK_HR(hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController));
-
- // Set callback
- CHECK_HR(hr = this->grabberController->SetCallback(this->grabberCallback));
+ // Create capture graph builder
+ CHECK_HR(hr = COCREATE(CLSID_CaptureGraphBuilder, IID_ICaptureGraphBuilder2, this->captureGraphBuilder));
+ CHECK_HR(hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder));
+ CHECK_HR(hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder));
+
+ // Create filters
+ LPUNKNOWN pUnk1 = NULL, pUnk2 = NULL;
+ CHECK_HR(hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorConvertor565));
+ this->sampleGrabberFilter = new DSSampleGrabber(FITLER_SAMPLE_GRABBER, pUnk1, &hr);
+ CHECK_HR(hr);
+ this->nullRendererFilter = new DSNullFilter(/*FILTER_NULL_RENDERER,*/ pUnk2, &hr);
+ CHECK_HR(hr);
+ this->grabberController = (DSSampleGrabber*)(this->sampleGrabberFilter);
+ if (!this->grabberController) {
+ CHECK_HR(E_FAIL);
+ }
+
+ // Add Filters
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->colorConvertor565, FILTER_COLOR_CONVERTOR_565));
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER));
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER));
+
+ // Find media control
+ CHECK_HR(hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController));
+
+ // Set callback
+ CHECK_HR(hr = this->grabberController->SetCallback(this->grabberCallback));
#else
- // Create capture graph builder
- CHECK_HR(hr = COCREATE(CLSID_CaptureGraphBuilder2, IID_ICaptureGraphBuilder2, this->captureGraphBuilder));
+ // Create capture graph builder
+ CHECK_HR(hr = COCREATE(CLSID_CaptureGraphBuilder2, IID_ICaptureGraphBuilder2, this->captureGraphBuilder));
- // Create the graph builder
- CHECK_HR(hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder));
+ // Create the graph builder
+ CHECK_HR(hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder));
- // Initialize the Capture Graph Builder.
- CHECK_HR(hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder));
+ // Initialize the Capture Graph Builder.
+ CHECK_HR(hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder));
- // Create the sample grabber filter
- CHECK_HR(hr = COCREATE(CLSID_SampleGrabber, IID_IBaseFilter, this->sampleGrabberFilter));
+ // Create the sample grabber filter
+ CHECK_HR(hr = COCREATE(CLSID_SampleGrabber, IID_IBaseFilter, this->sampleGrabberFilter));
- // Create tdshow filter
- LPUNKNOWN pUnk = NULL;
- this->frameRateFilter = new DSFrameRateFilter(FILTER_FRAMERATE, pUnk, &hr); CHECK_HR(hr);
- if (!this->frameRateFilter == NULL) CHECK_HR(E_FAIL);
+ // Create tdshow filter
+ LPUNKNOWN pUnk = NULL;
+ this->frameRateFilter = new DSFrameRateFilter(FILTER_FRAMERATE, pUnk, &hr);
+ CHECK_HR(hr);
+ if (!this->frameRateFilter == NULL) {
+ CHECK_HR(E_FAIL);
+ }
- // Create the NULL renderer
- CHECK_HR(hr = COCREATE(CLSID_NullRenderer, IID_IBaseFilter, this->nullRendererFilter));
+ // Create the NULL renderer
+ CHECK_HR(hr = COCREATE(CLSID_NullRenderer, IID_IBaseFilter, this->nullRendererFilter));
- // Add sample grabber to the graph
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER));
+ // Add sample grabber to the graph
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER));
- // Add null renderer to the graph
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER));
+ // Add null renderer to the graph
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER));
- // Add tdshow filter
- CHECK_HR(hr = this->graphBuilder->AddFilter(this->frameRateFilter, FILTER_FRAMERATE));
+ // Add tdshow filter
+ CHECK_HR(hr = this->graphBuilder->AddFilter(this->frameRateFilter, FILTER_FRAMERATE));
- // Find media control
- CHECK_HR(hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController));
+ // Find media control
+ CHECK_HR(hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController));
- // Create the sample grabber
- CHECK_HR(hr = QUERY(this->sampleGrabberFilter, IID_ISampleGrabber, this->grabberController));
+ // Create the sample grabber
+ CHECK_HR(hr = QUERY(this->sampleGrabberFilter, IID_ISampleGrabber, this->grabberController));
- // Set the sample grabber media type (RGB24)
- // TODO : CHECK
- AM_MEDIA_TYPE mt;
- ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
- mt.majortype = MEDIATYPE_Video;
- mt.subtype = MEDIASUBTYPE_RGB24;
- mt.formattype = FORMAT_VideoInfo;
+ // Set the sample grabber media type (RGB24)
+ // TODO : CHECK
+ AM_MEDIA_TYPE mt;
+ ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
+ mt.majortype = MEDIATYPE_Video;
+ mt.subtype = MEDIASUBTYPE_RGB24;
+ mt.formattype = FORMAT_VideoInfo;
- CHECK_HR(hr = this->grabberController->SetMediaType(&mt));
+ CHECK_HR(hr = this->grabberController->SetMediaType(&mt));
- // Set sample grabber media type
- this->grabberController->SetOneShot(FALSE);
- this->grabberController->SetBufferSamples(FALSE);
+ // Set sample grabber media type
+ this->grabberController->SetOneShot(FALSE);
+ this->grabberController->SetBufferSamples(FALSE);
- CHECK_HR(hr = this->grabberController->SetCallback(this->grabberCallback, 1));
+ CHECK_HR(hr = this->grabberController->SetCallback(this->grabberCallback, 1));
#endif
bail:
- return hr;
+ return hr;
} \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/DSCaptureGraph.h b/plugins/pluginDirectShow/internals/DSCaptureGraph.h
index 6bf8862..7c9b674 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureGraph.h
+++ b/plugins/pluginDirectShow/internals/DSCaptureGraph.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -37,70 +37,74 @@ class DSCaptureGraph : public DSBaseCaptureGraph
{
public:
#ifdef _WIN32_WCE
- DSCaptureGraph(DSISampleGrabberCB* callback, HRESULT *hr);
+ DSCaptureGraph(DSISampleGrabberCB* callback, HRESULT *hr);
#else
- DSCaptureGraph(ISampleGrabberCB* callback, HRESULT *hr);
+ DSCaptureGraph(ISampleGrabberCB* callback, HRESULT *hr);
#endif
- virtual ~DSCaptureGraph();
+ virtual ~DSCaptureGraph();
- std::vector<DSCaptureFormat> *getFormats() { return &this->supportedFormats; };
+ std::vector<DSCaptureFormat> *getFormats() {
+ return &this->supportedFormats;
+ };
- HRESULT setSource(const std::string &devicePath);
- HRESULT setParameters(DSCaptureFormat *format, int framerate);
+ HRESULT setSource(const std::string &devicePath);
+ HRESULT setParameters(DSCaptureFormat *format, int framerate);
- HRESULT connect();
- HRESULT disconnect();
+ HRESULT connect();
+ HRESULT disconnect();
- HRESULT start();
- HRESULT stop();
- HRESULT pause();
- bool isRunning();
- bool isPaused();
+ HRESULT start();
+ HRESULT stop();
+ HRESULT pause();
+ bool isRunning();
+ bool isPaused();
- std::string getDeviceId() const { return this->deviceId; };
+ std::string getDeviceId() const {
+ return this->deviceId;
+ };
- HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
+ HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
private:
- HRESULT createCaptureGraph();
+ HRESULT createCaptureGraph();
private:
#ifdef _WIN32_WCE
- DSISampleGrabberCB *grabberCallback;
+ DSISampleGrabberCB *grabberCallback;
#else
- ISampleGrabberCB *grabberCallback;
+ ISampleGrabberCB *grabberCallback;
#endif
- ICaptureGraphBuilder2 *captureGraphBuilder;
- IGraphBuilder *graphBuilder;
+ ICaptureGraphBuilder2 *captureGraphBuilder;
+ IGraphBuilder *graphBuilder;
+
+ IBaseFilter *sourceFilter;
+ IBaseFilter *nullRendererFilter;
+ IBaseFilter *sampleGrabberFilter;
- IBaseFilter *sourceFilter;
- IBaseFilter *nullRendererFilter;
- IBaseFilter *sampleGrabberFilter;
-
#ifdef _WIN32_WCE
- IBaseFilter *colorConvertor565; //http://msdn.microsoft.com/en-us/library/aa926076.aspx
+ IBaseFilter *colorConvertor565; //http://msdn.microsoft.com/en-us/library/aa926076.aspx
#else
- DSFrameRateFilter *frameRateFilter;
+ DSFrameRateFilter *frameRateFilter;
#endif
#ifdef _WIN32_WCE
- DSSampleGrabber *grabberController;
+ DSSampleGrabber *grabberController;
#else
- ISampleGrabber *grabberController;
+ ISampleGrabber *grabberController;
#endif
- IMediaControl *mediaController;
- IMediaEventEx *mediaEventController;
+ IMediaControl *mediaController;
+ IMediaEventEx *mediaEventController;
- IAMStreamConfig *streamConfiguration;
+ IAMStreamConfig *streamConfiguration;
- std::vector<DSCaptureFormat> supportedFormats;
- DSCaptureFormat *captureFormat;
+ std::vector<DSCaptureFormat> supportedFormats;
+ DSCaptureFormat *captureFormat;
- bool running;
- bool paused;
- std::string deviceId;
+ bool running;
+ bool paused;
+ std::string deviceId;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSCaptureUtils.cxx b/plugins/pluginDirectShow/internals/DSCaptureUtils.cxx
index d95f996..6c99476 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureUtils.cxx
+++ b/plugins/pluginDirectShow/internals/DSCaptureUtils.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -38,340 +38,367 @@
HRESULT enumerateCaptureDevices(const std::string &prefix, std::vector<VideoGrabberName> *names)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
#ifdef _WIN32_WCE
- // FIXME: use FindNextDevice to query all devices
- HANDLE handle = NULL;
- DEVMGR_DEVICE_INFORMATION di;
-
- TCHAR pwzName[MAX_PATH]; memset(pwzName,NULL,MAX_PATH);
-
- GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
- 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
-
- di.dwSize = sizeof(di);
-
- for( int i=0; ; i++)
- {
- if(0 == i)
- { /* 1st time */
- handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
- if(!handle || !di.hDevice)
- {
- hr = ( HRESULT_FROM_WIN32( GetLastError() ));
- goto bail;
- }
- }
- else if(handle)
- { /* 2nd or 3rd time */
- BOOL ret = FindNextDevice(handle, &di);
- if(!ret || !di.hDevice)
- {
- /* No 2nd or 3rd camera ==> do not return error*/
- goto bail;
- }
- }
- else assert(0);
-
- StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
-
- /* from LPWSTR to LPSTR */
- char mbstr_name[MAX_PATH]; memset(mbstr_name,NULL,MAX_PATH);
- wcstombs(mbstr_name, pwzName, MAX_PATH);
-
- VideoGrabberName grabberName(std::string((const char*)mbstr_name), std::string((const char*)mbstr_name));
- names->push_back(grabberName);
- }
-
+ // FIXME: use FindNextDevice to query all devices
+ HANDLE handle = NULL;
+ DEVMGR_DEVICE_INFORMATION di;
+
+ TCHAR pwzName[MAX_PATH];
+ memset(pwzName,NULL,MAX_PATH);
+
+ GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
+ 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86
+ }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
+
+ di.dwSize = sizeof(di);
+
+ for( int i=0; ; i++) {
+ if(0 == i) {
+ /* 1st time */
+ handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
+ if(!handle || !di.hDevice) {
+ hr = ( HRESULT_FROM_WIN32( GetLastError() ));
+ goto bail;
+ }
+ }
+ else if(handle) {
+ /* 2nd or 3rd time */
+ BOOL ret = FindNextDevice(handle, &di);
+ if(!ret || !di.hDevice) {
+ /* No 2nd or 3rd camera ==> do not return error*/
+ goto bail;
+ }
+ }
+ else {
+ assert(0);
+ }
+
+ StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
+
+ /* from LPWSTR to LPSTR */
+ char mbstr_name[MAX_PATH];
+ memset(mbstr_name,NULL,MAX_PATH);
+ wcstombs(mbstr_name, pwzName, MAX_PATH);
+
+ VideoGrabberName grabberName(std::string((const char*)mbstr_name), std::string((const char*)mbstr_name));
+ names->push_back(grabberName);
+ }
+
bail:
- /* close */
- if(handle) FindClose( handle );
-
+ /* close */
+ if(handle) {
+ FindClose( handle );
+ }
+
#else
- ICreateDevEnum *deviceEnum;
- IEnumMoniker *enumerator;
- IMoniker *moniker;
-
- // Create the System Device Enumerator
- hr = COCREATE(CLSID_SystemDeviceEnum, IID_ICreateDevEnum, deviceEnum);
- if (FAILED(hr)) goto bail;
-
- // Ask for a device enumerator
- hr = deviceEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumerator, INCLUDE_CATEGORY_FLAG);
- if (FAILED(hr)) goto bail;
-
- // hr = S_FALSE and enumerator is NULL if there is no device to enumerate
- if (!enumerator) goto bail;
-
- USES_CONVERSION;
-
- while (enumerator->Next(1, &moniker, NULL) == S_OK)
- {
- // Get the properties bag for each device
- IPropertyBag *propBag;
- hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, reinterpret_cast<void**>(&propBag));
- if (FAILED(hr))
- {
- SAFE_RELEASE(moniker);
- continue;
- }
-
- std::string name;
- std::string description;
-
- VARIANT varName;
- VariantInit(&varName);
- VARIANT varDescription;
- VariantInit(&varDescription);
-
- // Find the device path (uniqueness is guaranteed)
- hr = propBag->Read(L"DevicePath", &varName, 0);
- if (SUCCEEDED(hr))
- {
- if (prefix != "") name = prefix + ":";
- name = name + std::string(W2A(varName.bstrVal));
- }
-
- // Find friendly name or the description
- hr = propBag->Read(L"FriendlyName", &varDescription, 0);
- if (SUCCEEDED(hr))
- {
- description = std::string(W2A(varDescription.bstrVal));
- }
- else
- {
- hr = propBag->Read(L"Description", &varDescription, 0);
- if (SUCCEEDED(hr)) description = std::string(W2A(varDescription.bstrVal));
- }
-
- hr = VariantClear(&varName);
- hr = VariantClear(&varDescription);
-
- SAFE_RELEASE(propBag);
- SAFE_RELEASE(moniker);
-
- // Add it to the list
- if (name != "")
- {
- VideoGrabberName grabberName(name, description);
- names->push_back(grabberName);
- }
- }
+ ICreateDevEnum *deviceEnum;
+ IEnumMoniker *enumerator;
+ IMoniker *moniker;
+
+ // Create the System Device Enumerator
+ hr = COCREATE(CLSID_SystemDeviceEnum, IID_ICreateDevEnum, deviceEnum);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Ask for a device enumerator
+ hr = deviceEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumerator, INCLUDE_CATEGORY_FLAG);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // hr = S_FALSE and enumerator is NULL if there is no device to enumerate
+ if (!enumerator) {
+ goto bail;
+ }
+
+ USES_CONVERSION;
+
+ while (enumerator->Next(1, &moniker, NULL) == S_OK) {
+ // Get the properties bag for each device
+ IPropertyBag *propBag;
+ hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, reinterpret_cast<void**>(&propBag));
+ if (FAILED(hr)) {
+ SAFE_RELEASE(moniker);
+ continue;
+ }
+
+ std::string name;
+ std::string description;
+
+ VARIANT varName;
+ VariantInit(&varName);
+ VARIANT varDescription;
+ VariantInit(&varDescription);
+
+ // Find the device path (uniqueness is guaranteed)
+ hr = propBag->Read(L"DevicePath", &varName, 0);
+ if (SUCCEEDED(hr)) {
+ if (prefix != "") {
+ name = prefix + ":";
+ }
+ name = name + std::string(W2A(varName.bstrVal));
+ }
+
+ // Find friendly name or the description
+ hr = propBag->Read(L"FriendlyName", &varDescription, 0);
+ if (SUCCEEDED(hr)) {
+ description = std::string(W2A(varDescription.bstrVal));
+ }
+ else {
+ hr = propBag->Read(L"Description", &varDescription, 0);
+ if (SUCCEEDED(hr)) {
+ description = std::string(W2A(varDescription.bstrVal));
+ }
+ }
+
+ hr = VariantClear(&varName);
+ hr = VariantClear(&varDescription);
+
+ SAFE_RELEASE(propBag);
+ SAFE_RELEASE(moniker);
+
+ // Add it to the list
+ if (name != "") {
+ VideoGrabberName grabberName(name, description);
+ names->push_back(grabberName);
+ }
+ }
bail:
- SAFE_RELEASE(enumerator);
- SAFE_RELEASE(deviceEnum);
+ SAFE_RELEASE(enumerator);
+ SAFE_RELEASE(deviceEnum);
#endif
- return hr;
+ return hr;
}
HRESULT createSourceFilter(std::string *devicePath, IBaseFilter **sourceFilter)
{
- HRESULT hr;
-
- IEnumMoniker *enumerator = NULL;
- IMoniker *moniker = NULL;
- bool found = false;
+ HRESULT hr;
- // Set sourceFilter to null
- SAFE_RELEASE((*sourceFilter));
+ IEnumMoniker *enumerator = NULL;
+ IMoniker *moniker = NULL;
+ bool found = false;
+
+ // Set sourceFilter to null
+ SAFE_RELEASE((*sourceFilter));
#if defined( _WIN32_WCE)
- CPropertyBag pBag;
- HANDLE handle = NULL;
- DEVMGR_DEVICE_INFORMATION di;
- TCHAR pwzName[MAX_PATH];
- CComVariant varCamName;
- IPersistPropertyBag *propBag = NULL;
- GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
- 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
-
- di.dwSize = sizeof(di);
-
- for( int i=0; ; i++)
- {
- if(0 == i)
- { /* 1st time */
- handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
- if(!handle || !di.hDevice)
- {
- hr = ( HRESULT_FROM_WIN32( GetLastError() ));
- goto bail;
- }
- }
- else if(handle)
- { /* 2nd or 3rd time */
- BOOL ret = FindNextDevice(handle, &di);
- if(!ret || !di.hDevice)
- {
- /* No 2nd or 3rd camera ==> do not return error*/
- goto bail;
- }
- }
- else assert(0);
-
- StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
-
- /* from LPWSTR to LPSTR */
- char mbstr_name[MAX_PATH];
- memset(mbstr_name,NULL,MAX_PATH);
- wcstombs(mbstr_name, pwzName, MAX_PATH);
-
- if((std::string((const char*)mbstr_name) == (*devicePath)) || ("0" == (*devicePath)))
- {
- varCamName = pwzName;
- if( varCamName.vt != VT_BSTR )
- {
- hr = E_OUTOFMEMORY;
- goto bail;
- }
-
- // Create Source filter
- hr = COCREATE(CLSID_VideoCapture, IID_IBaseFilter, *sourceFilter);
- if(FAILED(hr)) goto bail;
-
- // Query PropertyBag
- hr = QUERY((*sourceFilter), IID_IPersistPropertyBag, propBag);
- if(FAILED(hr)) goto bail;
-
- hr = pBag.Write( L"VCapName", &varCamName );
- if(FAILED(hr)) goto bail;
-
- hr = propBag->Load( &pBag, NULL );
- if(FAILED(hr)) goto bail;
- }
- }
+ CPropertyBag pBag;
+ HANDLE handle = NULL;
+ DEVMGR_DEVICE_INFORMATION di;
+ TCHAR pwzName[MAX_PATH];
+ CComVariant varCamName;
+ IPersistPropertyBag *propBag = NULL;
+ GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
+ 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86
+ }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
+
+ di.dwSize = sizeof(di);
+
+ for( int i=0; ; i++) {
+ if(0 == i) {
+ /* 1st time */
+ handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
+ if(!handle || !di.hDevice) {
+ hr = ( HRESULT_FROM_WIN32( GetLastError() ));
+ goto bail;
+ }
+ }
+ else if(handle) {
+ /* 2nd or 3rd time */
+ BOOL ret = FindNextDevice(handle, &di);
+ if(!ret || !di.hDevice) {
+ /* No 2nd or 3rd camera ==> do not return error*/
+ goto bail;
+ }
+ }
+ else {
+ assert(0);
+ }
+
+ StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
+
+ /* from LPWSTR to LPSTR */
+ char mbstr_name[MAX_PATH];
+ memset(mbstr_name,NULL,MAX_PATH);
+ wcstombs(mbstr_name, pwzName, MAX_PATH);
+
+ if((std::string((const char*)mbstr_name) == (*devicePath)) || ("0" == (*devicePath))) {
+ varCamName = pwzName;
+ if( varCamName.vt != VT_BSTR ) {
+ hr = E_OUTOFMEMORY;
+ goto bail;
+ }
+
+ // Create Source filter
+ hr = COCREATE(CLSID_VideoCapture, IID_IBaseFilter, *sourceFilter);
+ if(FAILED(hr)) {
+ goto bail;
+ }
+
+ // Query PropertyBag
+ hr = QUERY((*sourceFilter), IID_IPersistPropertyBag, propBag);
+ if(FAILED(hr)) {
+ goto bail;
+ }
+
+ hr = pBag.Write( L"VCapName", &varCamName );
+ if(FAILED(hr)) {
+ goto bail;
+ }
+
+ hr = propBag->Load( &pBag, NULL );
+ if(FAILED(hr)) {
+ goto bail;
+ }
+ }
+ }
#else
- ICreateDevEnum *deviceEnum = NULL;
- IPropertyBag *propBag = NULL;
-
- // Create the System Device Enumerator
- hr = COCREATE(CLSID_SystemDeviceEnum, IID_ICreateDevEnum, deviceEnum);
- if (FAILED(hr)){
- goto bail;
- }
-
- // Ask for a device enumerator
- hr = deviceEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumerator, INCLUDE_CATEGORY_FLAG);
- if(FAILED(hr)){
- goto bail;
- }
-
- // hr = S_FALSE and enumerator is NULL if there is no device to enumerate
- if(!enumerator){
- goto bail;
- }
-
- USES_CONVERSION;
-
- while (!found && (enumerator->Next(1, &moniker, NULL) == S_OK)){
- // Get the properties bag for each device
- hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, reinterpret_cast<void**>(&propBag));
- if (FAILED(hr)){
- SAFE_RELEASE(moniker);
- continue;
- }
-
- std::string name;
-
- VARIANT varName;
- VariantInit(&varName);
-
- // Find the device path (uniqueness is guaranteed)
- hr = propBag->Read(L"DevicePath", &varName, 0);
- if (SUCCEEDED(hr)) name = std::string(W2A(varName.bstrVal));
-
- // Check for device path
- // "Null" means first found
- if ((name == (*devicePath)) ||
- ("Null" == (*devicePath)))
- {
- hr = moniker->BindToObject(0, 0, IID_IBaseFilter, reinterpret_cast<void**>(&(*sourceFilter)));
- if (SUCCEEDED(hr)){
- (*devicePath) = name;
- found = true;
- }
- }
-
- hr = VariantClear(&varName);
-
- SAFE_RELEASE(propBag);
- SAFE_RELEASE(moniker);
- }
+ ICreateDevEnum *deviceEnum = NULL;
+ IPropertyBag *propBag = NULL;
+
+ // Create the System Device Enumerator
+ hr = COCREATE(CLSID_SystemDeviceEnum, IID_ICreateDevEnum, deviceEnum);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Ask for a device enumerator
+ hr = deviceEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumerator, INCLUDE_CATEGORY_FLAG);
+ if(FAILED(hr)) {
+ goto bail;
+ }
+
+ // hr = S_FALSE and enumerator is NULL if there is no device to enumerate
+ if(!enumerator) {
+ goto bail;
+ }
+
+ USES_CONVERSION;
+
+ while (!found && (enumerator->Next(1, &moniker, NULL) == S_OK)) {
+ // Get the properties bag for each device
+ hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, reinterpret_cast<void**>(&propBag));
+ if (FAILED(hr)) {
+ SAFE_RELEASE(moniker);
+ continue;
+ }
+
+ std::string name;
+
+ VARIANT varName;
+ VariantInit(&varName);
+
+ // Find the device path (uniqueness is guaranteed)
+ hr = propBag->Read(L"DevicePath", &varName, 0);
+ if (SUCCEEDED(hr)) {
+ name = std::string(W2A(varName.bstrVal));
+ }
+
+ // Check for device path
+ // "Null" means first found
+ if ((name == (*devicePath)) ||
+ ("Null" == (*devicePath))) {
+ hr = moniker->BindToObject(0, 0, IID_IBaseFilter, reinterpret_cast<void**>(&(*sourceFilter)));
+ if (SUCCEEDED(hr)) {
+ (*devicePath) = name;
+ found = true;
+ }
+ }
+
+ hr = VariantClear(&varName);
+
+ SAFE_RELEASE(propBag);
+ SAFE_RELEASE(moniker);
+ }
#endif
bail:
#ifdef _WIN32_WCE
- if(handle) FindClose(handle);
+ if(handle) {
+ FindClose(handle);
+ }
#else
- SAFE_RELEASE(deviceEnum);
+ SAFE_RELEASE(deviceEnum);
#endif
- SAFE_RELEASE(moniker);
- SAFE_RELEASE(enumerator);
- SAFE_RELEASE(propBag);
+ SAFE_RELEASE(moniker);
+ SAFE_RELEASE(enumerator);
+ SAFE_RELEASE(propBag);
- return hr;
+ return hr;
}
HRESULT getSupportedFormats(IBaseFilter *sourceFilter, std::vector<DSCaptureFormat> *formats)
{
- HRESULT hr = E_FAIL;
- IPin *pinOut = NULL;
- IAMStreamConfig *streamConfig = NULL;
- AM_MEDIA_TYPE *mediaType = NULL;
- int count, size;
-
- // Check source filter pointer
- if (!sourceFilter) goto bail;
-
- pinOut = GetPin(sourceFilter, PINDIR_OUTPUT);
- if(!pinOut) goto bail;
-
- // Retrieve the stream config interface
- hr = QUERY(pinOut, IID_IAMStreamConfig, streamConfig);
- if (FAILED(hr)) goto bail;
-
- // Get the number of capabilities
- hr = streamConfig->GetNumberOfCapabilities(&count, &size);
- if (FAILED(hr)) goto bail;
-
- hr = streamConfig->GetFormat(&mediaType);
- if (FAILED(hr)) goto bail;
-
- // Iterate through the formats
- for (int i = 0; i < count; i++){
- VIDEO_STREAM_CONFIG_CAPS streamConfigCaps;
-
- hr = streamConfig->GetStreamCaps(i, &mediaType, reinterpret_cast<BYTE*>(&streamConfigCaps));
-
- if (FAILED(hr)){
- TSK_DEBUG_ERROR("Failed to get Stream caps");
- break;
- }
-
- if (streamConfigCaps.guid == FORMAT_VideoInfo){
- VIDEOINFOHEADER* vih = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat);
- BITMAPINFOHEADER* bih = &vih->bmiHeader;
-
- int width = abs(bih->biWidth);
- int height = abs(bih->biHeight);
- int fps = (int) ((float)(vih->AvgTimePerFrame)/10000.f);
- GUID chroma = mediaType->subtype;
-
- // Add format to the list
- DSCaptureFormat format(width, height, fps, chroma);
- formats->push_back(format);
- }
-
- DeleteMediaType(mediaType);
- }
+ HRESULT hr = E_FAIL;
+ IPin *pinOut = NULL;
+ IAMStreamConfig *streamConfig = NULL;
+ AM_MEDIA_TYPE *mediaType = NULL;
+ int count, size;
+
+ // Check source filter pointer
+ if (!sourceFilter) {
+ goto bail;
+ }
+
+ pinOut = GetPin(sourceFilter, PINDIR_OUTPUT);
+ if(!pinOut) {
+ goto bail;
+ }
+
+ // Retrieve the stream config interface
+ hr = QUERY(pinOut, IID_IAMStreamConfig, streamConfig);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Get the number of capabilities
+ hr = streamConfig->GetNumberOfCapabilities(&count, &size);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ hr = streamConfig->GetFormat(&mediaType);
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Iterate through the formats
+ for (int i = 0; i < count; i++) {
+ VIDEO_STREAM_CONFIG_CAPS streamConfigCaps;
+
+ hr = streamConfig->GetStreamCaps(i, &mediaType, reinterpret_cast<BYTE*>(&streamConfigCaps));
+
+ if (FAILED(hr)) {
+ TSK_DEBUG_ERROR("Failed to get Stream caps");
+ break;
+ }
+
+ if (streamConfigCaps.guid == FORMAT_VideoInfo) {
+ VIDEOINFOHEADER* vih = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat);
+ BITMAPINFOHEADER* bih = &vih->bmiHeader;
+
+ int width = abs(bih->biWidth);
+ int height = abs(bih->biHeight);
+ int fps = (int) ((float)(vih->AvgTimePerFrame)/10000.f);
+ GUID chroma = mediaType->subtype;
+
+ // Add format to the list
+ DSCaptureFormat format(width, height, fps, chroma);
+ formats->push_back(format);
+ }
+
+ DeleteMediaType(mediaType);
+ }
bail:
- SAFE_RELEASE(streamConfig);
- SAFE_RELEASE(pinOut);
+ SAFE_RELEASE(streamConfig);
+ SAFE_RELEASE(pinOut);
- return hr;
+ return hr;
}
diff --git a/plugins/pluginDirectShow/internals/DSCaptureUtils.h b/plugins/pluginDirectShow/internals/DSCaptureUtils.h
index 7d99ed2..f7d6b60 100755
--- a/plugins/pluginDirectShow/internals/DSCaptureUtils.h
+++ b/plugins/pluginDirectShow/internals/DSCaptureUtils.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/pluginDirectShow/internals/DSDibHelper.cxx b/plugins/pluginDirectShow/internals/DSDibHelper.cxx
index b7f40d5..3b02ae2 100755
--- a/plugins/pluginDirectShow/internals/DSDibHelper.cxx
+++ b/plugins/pluginDirectShow/internals/DSDibHelper.cxx
@@ -22,11 +22,12 @@ HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader)
int xScrn, yScrn; // screen resolution
// check for an empty rectangle
- if (IsRectEmpty(lpRect))
- return NULL;
+ if (IsRectEmpty(lpRect)) {
+ return NULL;
+ }
// create a DC for the screen and create
- // a memory DC compatible to screen DC
+ // a memory DC compatible to screen DC
hScrDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
hMemDC = CreateCompatibleDC(hScrDC);
@@ -41,14 +42,18 @@ HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader)
yScrn = GetDeviceCaps(hScrDC, VERTRES);
//make sure bitmap rectangle is visible
- if (nX < 0)
+ if (nX < 0) {
nX = 0;
- if (nY < 0)
+ }
+ if (nY < 0) {
nY = 0;
- if (nX2 > xScrn)
+ }
+ if (nX2 > xScrn) {
nX2 = xScrn;
- if (nY2 > yScrn)
+ }
+ if (nY2 > yScrn) {
nY2 = yScrn;
+ }
nWidth = nX2 - nX;
nHeight = nY2 - nY;
@@ -63,7 +68,7 @@ HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader)
BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
// select old bitmap back into memory DC and get handle to
- // bitmap of the screen
+ // bitmap of the screen
hBitmap = (HBITMAP) SelectObject(hMemDC, hOldBitmap);
// Copy the bitmap data into the provided BYTE buffer
diff --git a/plugins/pluginDirectShow/internals/DSDisplay.cxx b/plugins/pluginDirectShow/internals/DSDisplay.cxx
index 326b86c..5cc1b04 100755
--- a/plugins/pluginDirectShow/internals/DSDisplay.cxx
+++ b/plugins/pluginDirectShow/internals/DSDisplay.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,12 +36,11 @@ using namespace std;
#define FSCREEN_MIN_IDEAL_WIDTH 352
#define FSCREEN_MIN_IDEAL_HEIGHT 288
-typedef struct tdshow_display_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tdshow_display_s {
+ TSK_DECLARE_OBJECT;
- HWND hwnd;
- DSDisplay* display;
+ HWND hwnd;
+ DSDisplay* display;
}
tdshow_display_t;
typedef tsk_list_t tdshow_displays_L_t;
@@ -53,504 +52,501 @@ static tdshow_displays_L_t* __directshow__Displays = tsk_null;
/*== Predicate function to find tdshow_display_t object by HWND. */
static int __pred_find_display_by_hwnd(const tsk_list_item_t *item, const void *hWnd)
{
- if(item && item->data){
- const tdshow_display_t *display = (const tdshow_display_t *)item->data;
- int ret = 0;
- tsk_subsat_int32_ptr(display->hwnd, *((HWND*)hWnd), &ret);
- return ret;
- }
- return -1;
+ if(item && item->data) {
+ const tdshow_display_t *display = (const tdshow_display_t *)item->data;
+ int ret = 0;
+ tsk_subsat_int32_ptr(display->hwnd, *((HWND*)hWnd), &ret);
+ return ret;
+ }
+ return -1;
}
// C Callback that dispatch event to the right display
static LRESULT CALLBACK __directshow__WndProcWindow(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- LRESULT result = FALSE;
- BOOL resultSet = FALSE;
-
- if(__directshow__Displays){
- tsk_list_lock(__directshow__Displays);
+ LRESULT result = FALSE;
+ BOOL resultSet = FALSE;
+
+ if(__directshow__Displays) {
+ tsk_list_lock(__directshow__Displays);
- const tdshow_display_t *display = (const tdshow_display_t *)tsk_list_find_object_by_pred(__directshow__Displays, __pred_find_display_by_hwnd, &hWnd);
- if((resultSet = (display && display->display))){
- result = display->display->handleEvents(hWnd, uMsg, wParam, lParam);
- }
+ const tdshow_display_t *display = (const tdshow_display_t *)tsk_list_find_object_by_pred(__directshow__Displays, __pred_find_display_by_hwnd, &hWnd);
+ if((resultSet = (display && display->display))) {
+ result = display->display->handleEvents(hWnd, uMsg, wParam, lParam);
+ }
- tsk_list_unlock(__directshow__Displays);
- }
+ tsk_list_unlock(__directshow__Displays);
+ }
- return resultSet ? result : DefWindowProc(hWnd, uMsg, wParam, lParam);
+ return resultSet ? result : DefWindowProc(hWnd, uMsg, wParam, lParam);
}
DSDisplay::DSDisplay(HRESULT *hr)
{
- this->window = NULL;
- this->parentWindowProc = NULL;
- this->hooked = false;
- this->fullscreen = false;
- this->bPluginFirefox = false;
- this->top = 0;
- this->left = 0;
- this->width = this->imgWidth = 176;
- this->height = this->imgHeight = 144;
- this->fps = 15;
-
- this->graph = new DSDisplayGraph(hr);
- if (FAILED(*hr)) return;
+ this->window = NULL;
+ this->parentWindowProc = NULL;
+ this->hooked = false;
+ this->fullscreen = false;
+ this->bPluginFirefox = false;
+ this->top = 0;
+ this->left = 0;
+ this->width = this->imgWidth = 176;
+ this->height = this->imgHeight = 144;
+ this->fps = 15;
+
+ this->graph = new DSDisplayGraph(hr);
+ if (FAILED(*hr)) {
+ return;
+ }
#if USE_OVERLAY
- this->overlay = new DSDisplayOverlay();
+ this->overlay = new DSDisplayOverlay();
#else
- this->overlay = NULL;
+ this->overlay = NULL;
#endif
-
- this->graph->getVideoWindow()->put_Visible(OAFALSE);
+
+ this->graph->getVideoWindow()->put_Visible(OAFALSE);
}
DSDisplay::~DSDisplay()
{
- this->unhook();
+ this->unhook();
- SAFE_DELETE_PTR(this->overlay);
- SAFE_DELETE_PTR(this->graph);
+ SAFE_DELETE_PTR(this->overlay);
+ SAFE_DELETE_PTR(this->graph);
}
void DSDisplay::start()
{
- if (!this->graph->isRunning()){
- this->hook();
- }
- if (!this->graph->isRunning() || this->graph->isPaused()){
- this->graph->start();
- }
- this->graph->getVideoWindow()->put_Visible(OATRUE);
+ if (!this->graph->isRunning()) {
+ this->hook();
+ }
+ if (!this->graph->isRunning() || this->graph->isPaused()) {
+ this->graph->start();
+ }
+ this->graph->getVideoWindow()->put_Visible(OATRUE);
}
void DSDisplay::pause()
{
- this->graph->pause();
+ this->graph->pause();
}
void DSDisplay::stop()
{
- if (this->graph->isRunning()){
- this->setFullscreen(false);
+ if (this->graph->isRunning()) {
+ this->setFullscreen(false);
- this->graph->stop();
- this->unhook();
- }
+ this->graph->stop();
+ this->unhook();
+ }
}
void DSDisplay::attach(INT64 parent)
{
- this->attach((void*)parent);
+ this->attach((void*)parent);
}
void DSDisplay::attach(void *parent)
{
- // Don't reattach if this is the same parent
- if (this->isAttached() && parent){
- HWND hwnd = reinterpret_cast<HWND>(parent);
- if (hwnd != this->window){
- this->detach();
- }
- }
-
- // Gets the handle of the parent
- this->window = reinterpret_cast<HWND>(parent);
- // Hook to the parent WindowProc
- this->hook();
+ // Don't reattach if this is the same parent
+ if (this->isAttached() && parent) {
+ HWND hwnd = reinterpret_cast<HWND>(parent);
+ if (hwnd != this->window) {
+ this->detach();
+ }
+ }
+
+ // Gets the handle of the parent
+ this->window = reinterpret_cast<HWND>(parent);
+ // Hook to the parent WindowProc
+ this->hook();
#if USE_OVERLAY
- // Allows the overlay to initialize
- this->overlay->attach(this->window, this->graph);
+ // Allows the overlay to initialize
+ this->overlay->attach(this->window, this->graph);
#endif
}
void DSDisplay::detach(void *parent)
{
- // The detach action is only valid and if this is the same parent
- if (parent){
- HWND hwnd = reinterpret_cast<HWND>(parent);
- if (hwnd == this->window){
- this->detach();
- }
- }
+ // The detach action is only valid and if this is the same parent
+ if (parent) {
+ HWND hwnd = reinterpret_cast<HWND>(parent);
+ if (hwnd == this->window) {
+ this->detach();
+ }
+ }
}
void DSDisplay::detach()
{
- if (!this->isAttached()){
- return;
- }
+ if (!this->isAttached()) {
+ return;
+ }
#if USE_OVERLAY
- // Clean up overlay
- this->overlay->detach();
+ // Clean up overlay
+ this->overlay->detach();
#endif
- // Unhook from the parent WindowProc
- this->unhook();
+ // Unhook from the parent WindowProc
+ this->unhook();
- // Set the handle of the parent to NULL
- this->window = NULL;
+ // Set the handle of the parent to NULL
+ this->window = NULL;
}
bool DSDisplay::isAttached()
{
- return (this->window != NULL);
+ return (this->window != NULL);
}
int DSDisplay::getWidth()
{
- return this->width;
+ return this->width;
}
int DSDisplay::getHeight()
{
- return this->height;
+ return this->height;
}
void DSDisplay::setSize(int w, int h)
{
- //this->width = w;
- //this->height = h;
+ //this->width = w;
+ //this->height = h;
- if (!this->fullscreen){
- this->graph->setImageFormat(w, h);
- if(this->hooked){
+ if (!this->fullscreen) {
+ this->graph->setImageFormat(w, h);
+ if(this->hooked) {
#if 0
- #if defined(VMR9_WINDOWLESS)
- RECT rc;
- SetRect(&rc, 0, 0, w, h);
- this->graph->getWindowlessControl()->SetVideoPosition(&rc, &rc);
- #else
- this->graph->getVideoWindow()->SetWindowPosition(0, 0, this->width , this->height);
- #endif
+#if defined(VMR9_WINDOWLESS)
+ RECT rc;
+ SetRect(&rc, 0, 0, w, h);
+ this->graph->getWindowlessControl()->SetVideoPosition(&rc, &rc);
+#else
+ this->graph->getVideoWindow()->SetWindowPosition(0, 0, this->width , this->height);
#endif
- }
- }
+#endif
+ }
+ }
}
void DSDisplay::applyRatio(RECT rect)
{
- long w = rect.right - rect.left;
- long h = rect.bottom - rect.top;
- float ratio = ((float)this->imgWidth/(float)this->imgHeight);
- // (w/h)=ratio =>
- // 1) h=w/ratio
- // and
- // 2) w=h*ratio
- this->width = (int)(w/ratio) > h ? (int)(h * ratio) : w;
- this->height = (int)(this->width/ratio) > h ? h : (int)(this->width/ratio);
- this->left = ((w - this->width) >> 1);
- this->top = ((h - this->height) >> 1);
+ long w = rect.right - rect.left;
+ long h = rect.bottom - rect.top;
+ float ratio = ((float)this->imgWidth/(float)this->imgHeight);
+ // (w/h)=ratio =>
+ // 1) h=w/ratio
+ // and
+ // 2) w=h*ratio
+ this->width = (int)(w/ratio) > h ? (int)(h * ratio) : w;
+ this->height = (int)(this->width/ratio) > h ? h : (int)(this->width/ratio);
+ this->left = ((w - this->width) >> 1);
+ this->top = ((h - this->height) >> 1);
}
bool DSDisplay::isFullscreen()
{
#if defined(VMR9_WINDOWLESS)
- // TODO
+ // TODO
#else
- long result;
- HRESULT hr = this->graph->getVideoWindow()->get_FullScreenMode(&result);
- if (SUCCEEDED(hr)){
- this->fullscreen = (result == OATRUE);
- }
- else{
- TSK_DEBUG_ERROR("get_FullScreenMode failed with %ld", hr);
- this->fullscreen = FALSE;
- }
+ long result;
+ HRESULT hr = this->graph->getVideoWindow()->get_FullScreenMode(&result);
+ if (SUCCEEDED(hr)) {
+ this->fullscreen = (result == OATRUE);
+ }
+ else {
+ TSK_DEBUG_ERROR("get_FullScreenMode failed with %ld", hr);
+ this->fullscreen = FALSE;
+ }
#endif
- return this->fullscreen;
+ return this->fullscreen;
}
void DSDisplay::setFullscreen(bool value)
{
- if(!this->canFullscreen()){
- TSK_DEBUG_WARN("Cannot fullscreen");
- return;
- }
+ if(!this->canFullscreen()) {
+ TSK_DEBUG_WARN("Cannot fullscreen");
+ return;
+ }
- HRESULT hr;
+ HRESULT hr;
#if defined(VMR9_WINDOWLESS)
- // TODO
+ // TODO
#else
- if (this->isFullscreen() == value){
- return;
- }
+ if (this->isFullscreen() == value) {
+ return;
+ }
- hr = this->graph->getVideoWindow()->put_FullScreenMode(value ? OATRUE : OAFALSE);
- if (SUCCEEDED(hr)){
- this->fullscreen = value;
+ hr = this->graph->getVideoWindow()->put_FullScreenMode(value ? OATRUE : OAFALSE);
+ if (SUCCEEDED(hr)) {
+ this->fullscreen = value;
#if USE_OVERLAY
- this->overlay->show(this->fullscreen ? (OVERLAY_TIMEOUT * this->graph->getDisplayFps()) : 0);
+ this->overlay->show(this->fullscreen ? (OVERLAY_TIMEOUT * this->graph->getDisplayFps()) : 0);
#endif
- }
- else{
- TSK_DEBUG_ERROR("put_FullScreenMode failed with %ld", hr);
- }
+ }
+ else {
+ TSK_DEBUG_ERROR("put_FullScreenMode failed with %ld", hr);
+ }
#endif
}
void DSDisplay::setPluginFirefox(bool value)
{
- bPluginFirefox = value;
+ bPluginFirefox = value;
}
bool DSDisplay::canFullscreen()
{
#if defined(VMR9_WINDOWLESS)
- // TODO
+ // TODO
#else
- if(this->graph){
- UINT image_w, image_h;
-
- if( this->graph->getImageFormat(image_w, image_h) ){
- //this->graph->getVideoWindow()->GetMinIdealImageSize(&ideal_w, &ideal_h);
- return (((long)image_w >= FSCREEN_MIN_IDEAL_WIDTH) && ((long)image_h >= FSCREEN_MIN_IDEAL_HEIGHT));
- }
- }
+ if(this->graph) {
+ UINT image_w, image_h;
+
+ if( this->graph->getImageFormat(image_w, image_h) ) {
+ //this->graph->getVideoWindow()->GetMinIdealImageSize(&ideal_w, &ideal_h);
+ return (((long)image_w >= FSCREEN_MIN_IDEAL_WIDTH) && ((long)image_h >= FSCREEN_MIN_IDEAL_HEIGHT));
+ }
+ }
#endif
- return false;
+ return false;
}
void DSDisplay::setFps(int fps_)
{
- this->fps = fps_;
- this->graph->setDisplayFps(fps_);
+ this->fps = fps_;
+ this->graph->setDisplayFps(fps_);
}
// w and h are the size of the buffer not the display
void DSDisplay::handleVideoFrame(const void* data, int w, int h)
{
- if (this->graph->isRunning()){
- // The graph will take care of changing the source filter if needed
- // in case of dimension change or anything else...
- this->graph->handleFrame(data, w, h);
- if(this->imgWidth != w || this->imgHeight != h){
- this->imgWidth = w;
- this->imgHeight = h;
- if(this->window){
- SendMessage(this->window, WM_SIZE, SIZE_RESTORED, MAKELPARAM(this->width , this->height));
- }
- }
+ if (this->graph->isRunning()) {
+ // The graph will take care of changing the source filter if needed
+ // in case of dimension change or anything else...
+ this->graph->handleFrame(data, w, h);
+ if(this->imgWidth != w || this->imgHeight != h) {
+ this->imgWidth = w;
+ this->imgHeight = h;
+ if(this->window) {
+ SendMessage(this->window, WM_SIZE, SIZE_RESTORED, MAKELPARAM(this->width , this->height));
+ }
+ }
#if USE_OVERLAY
- this->overlay->update();
+ this->overlay->update();
#endif
- }
+ }
}
LRESULT DSDisplay::handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_CREATE:
- case WM_SIZE:
- case WM_MOVE:
- {
- RECT rect = {0};
- GetWindowRect(hWnd, &rect);
- applyRatio(rect);
+ switch(uMsg) {
+ case WM_CREATE:
+ case WM_SIZE:
+ case WM_MOVE: {
+ RECT rect = {0};
+ GetWindowRect(hWnd, &rect);
+ applyRatio(rect);
#if defined(VMR9_WINDOWLESS)
- this->graph->getWindowlessControl()->SetVideoPosition(&rect, &rect);
+ this->graph->getWindowlessControl()->SetVideoPosition(&rect, &rect);
#else
- this->graph->getVideoWindow()->SetWindowPosition(this->left, this->top, this->width , this->height);
+ this->graph->getVideoWindow()->SetWindowPosition(this->left, this->top, this->width , this->height);
#endif
- }
- break;
-
- case WM_LBUTTONDBLCLK:
- if(this->canFullscreen()){
- this->setFullscreen(true);
- }
- break;
-
- case WM_FULLSCREEN_SET:
- if(this->canFullscreen()){
- this->setFullscreen(!this->isFullscreen());
- }
- break;
-
- case WM_LBUTTONDOWN:
- case WM_RBUTTONDOWN:
- case WM_KEYDOWN:
- if(this->isFullscreen())
- {
+ }
+ break;
+
+ case WM_LBUTTONDBLCLK:
+ if(this->canFullscreen()) {
+ this->setFullscreen(true);
+ }
+ break;
+
+ case WM_FULLSCREEN_SET:
+ if(this->canFullscreen()) {
+ this->setFullscreen(!this->isFullscreen());
+ }
+ break;
+
+ case WM_LBUTTONDOWN:
+ case WM_RBUTTONDOWN:
+ case WM_KEYDOWN:
+ if(this->isFullscreen()) {
#if USE_OVERLAY
- // Re-Show overlay
- this->overlay->show(OVERLAY_TIMEOUT * this->graph->getDisplayFps());
+ // Re-Show overlay
+ this->overlay->show(OVERLAY_TIMEOUT * this->graph->getDisplayFps());
#endif
- }
- break;
-
- case WM_CHAR:
- case WM_KEYUP:
- if(this->isFullscreen() && (wParam == 0x1B || wParam == VK_ESCAPE))
- {
- // escape
- this->setFullscreen(false);
- }
-
- break;
-
- case WM_GRAPHNOTIFY:
- {
- long evCode;
- LONG_PTR param1, param2;
- HRESULT hr;
- while (hr = this->graph->getMediaEvent()->GetEvent(&evCode, &param1, &param2, 0), SUCCEEDED(hr))
- {
- hr = this->graph->getMediaEvent()->FreeEventParams(evCode, param1, param2);
-
- switch(evCode)
- {
- case EC_FULLSCREEN_LOST:
+ }
+ break;
+
+ case WM_CHAR:
+ case WM_KEYUP:
+ if(this->isFullscreen() && (wParam == 0x1B || wParam == VK_ESCAPE)) {
+ // escape
+ this->setFullscreen(false);
+ }
+
+ break;
+
+ case WM_GRAPHNOTIFY: {
+ long evCode;
+ LONG_PTR param1, param2;
+ HRESULT hr;
+ while (hr = this->graph->getMediaEvent()->GetEvent(&evCode, &param1, &param2, 0), SUCCEEDED(hr)) {
+ hr = this->graph->getMediaEvent()->FreeEventParams(evCode, param1, param2);
+
+ switch(evCode) {
+ case EC_FULLSCREEN_LOST:
#if USE_OVERLAY
- this->overlay->show(0);
+ this->overlay->show(0);
#endif
- break;
- case EC_COMPLETE:
- case EC_USERABORT:
- default:
- break;
- }
- }
- }
- break;
+ break;
+ case EC_COMPLETE:
+ case EC_USERABORT:
+ default:
+ break;
+ }
+ }
+ }
+ break;
#if defined(VMR9_WINDOWLESS)
- case WM_DISPLAYCHANGE:
- {
- this->graph->getWindowlessControl()->DisplayModeChanged();
- }
- break;
- case WM_PAINT:
- {
- RECT rect = {0};
- GetWindowRect(hWnd, &rect);
-
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hWnd, &ps);
-
- this->graph->getWindowlessControl()->RepaintVideo(hWnd, hdc);
-
- EndPaint(hWnd, &ps);
- }
- break;
-#endif
+ case WM_DISPLAYCHANGE: {
+ this->graph->getWindowlessControl()->DisplayModeChanged();
+ }
+ break;
+ case WM_PAINT: {
+ RECT rect = {0};
+ GetWindowRect(hWnd, &rect);
+
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hWnd, &ps);
+
+ this->graph->getWindowlessControl()->RepaintVideo(hWnd, hdc);
+
+ EndPaint(hWnd, &ps);
+ }
+ break;
+#endif
- }
+ }
- return bPluginFirefox ? DefWindowProc(hWnd, uMsg, wParam, lParam) : CallWindowProc(this->parentWindowProc, hWnd, uMsg, wParam, lParam);
+ return bPluginFirefox ? DefWindowProc(hWnd, uMsg, wParam, lParam) : CallWindowProc(this->parentWindowProc, hWnd, uMsg, wParam, lParam);
}
void DSDisplay::hook()
{
- HRESULT hr;
+ HRESULT hr;
- if (!this->window){
- return;
- }
+ if (!this->window) {
+ return;
+ }
- if(this->hooked){
- return;
- }
- this->hooked = TRUE;
+ if(this->hooked) {
+ return;
+ }
+ this->hooked = TRUE;
- bool lock = (__directshow__Displays != NULL);
+ bool lock = (__directshow__Displays != NULL);
- if(lock)
- tsk_list_lock(__directshow__Displays);
- {
- // Gets the parent Window procedure
+ if(lock) {
+ tsk_list_lock(__directshow__Displays);
+ }
+ {
+ // Gets the parent Window procedure
#if defined(_WIN32_WCE)
- // Workaround for bug in SetWindowLong, call twice the API
- //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) __directshow__WndProcWindow );
- //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) __directshow__WndProcWindow );
- //__directshow__Displays[this->window] = this;
+ // Workaround for bug in SetWindowLong, call twice the API
+ //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) __directshow__WndProcWindow );
+ //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) __directshow__WndProcWindow );
+ //__directshow__Displays[this->window] = this;
#else
- this->parentWindowProc = (WNDPROC) SetWindowLongPtr(this->window, GWLP_WNDPROC, (LONG_PTR) __directshow__WndProcWindow);
- // Add this instance to the callback map
- tsk_object_new(tdshow_display_def_t, this->window, this);
+ this->parentWindowProc = (WNDPROC) SetWindowLongPtr(this->window, GWLP_WNDPROC, (LONG_PTR) __directshow__WndProcWindow);
+ // Add this instance to the callback map
+ tsk_object_new(tdshow_display_def_t, this->window, this);
#endif
- }
- if(lock)
- tsk_list_unlock(__directshow__Displays);
+ }
+ if(lock) {
+ tsk_list_unlock(__directshow__Displays);
+ }
- RECT rect;
- GetWindowRect(this->window, &rect);
- applyRatio(rect);
+ RECT rect;
+ GetWindowRect(this->window, &rect);
+ applyRatio(rect);
#if defined(VMR9_WINDOWLESS)
- rect.left = 0;
- rect.top = 0;
- rect.right = this->width;
- rect.bottom = this->height;
-
- // TODO : Review
- hr = this->graph->getWindowlessControl()->SetVideoClippingWindow(this->window);
- hr = this->graph->getWindowlessControl()->SetBorderColor(RGB(0, 0, 128));
- hr = this->graph->getWindowlessControl()->SetVideoPosition(NULL, &rect);
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = this->width;
+ rect.bottom = this->height;
+
+ // TODO : Review
+ hr = this->graph->getWindowlessControl()->SetVideoClippingWindow(this->window);
+ hr = this->graph->getWindowlessControl()->SetBorderColor(RGB(0, 0, 128));
+ hr = this->graph->getWindowlessControl()->SetVideoPosition(NULL, &rect);
#else
- // TODO : Review the order
- hr = this->graph->getVideoWindow()->put_Owner((OAHWND) this->window);
- hr = this->graph->getVideoWindow()->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
- hr = this->graph->getVideoWindow()->SetWindowPosition(this->left, this->top, this->width, this->height);
- hr = this->graph->getVideoWindow()->put_MessageDrain((OAHWND) this->window);
- hr = this->graph->getVideoWindow()->put_Visible(OATRUE);
+ // TODO : Review the order
+ hr = this->graph->getVideoWindow()->put_Owner((OAHWND) this->window);
+ hr = this->graph->getVideoWindow()->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
+ hr = this->graph->getVideoWindow()->SetWindowPosition(this->left, this->top, this->width, this->height);
+ hr = this->graph->getVideoWindow()->put_MessageDrain((OAHWND) this->window);
+ hr = this->graph->getVideoWindow()->put_Visible(OATRUE);
#endif
- hr = this->graph->getMediaEvent()->SetNotifyWindow((OAHWND) this->window, WM_GRAPHNOTIFY, 0);
+ hr = this->graph->getMediaEvent()->SetNotifyWindow((OAHWND) this->window, WM_GRAPHNOTIFY, 0);
}
void DSDisplay::unhook()
{
- HRESULT hr;
+ HRESULT hr;
- if(!this->window){
- return;
- }
+ if(!this->window) {
+ return;
+ }
- if(!this->hooked){
- return;
- }
-
- hr = this->graph->getMediaEvent()->SetNotifyWindow(NULL, WM_GRAPHNOTIFY, 0);
+ if(!this->hooked) {
+ return;
+ }
+
+ hr = this->graph->getMediaEvent()->SetNotifyWindow(NULL, WM_GRAPHNOTIFY, 0);
#if defined(VMR9_WINDOWLESS)
- // TODO : Review
- hr = this->graph->getWindowlessControl()->SetVideoClippingWindow(NULL);
+ // TODO : Review
+ hr = this->graph->getWindowlessControl()->SetVideoClippingWindow(NULL);
#else
- // TODO : Review the order
- hr = this->graph->getVideoWindow()->put_Visible(OAFALSE);
- hr = this->graph->getVideoWindow()->put_MessageDrain((OAHWND) NULL);
- hr = this->graph->getVideoWindow()->put_Owner((OAHWND) NULL);
- hr = this->graph->getVideoWindow()->put_AutoShow(OAFALSE);
+ // TODO : Review the order
+ hr = this->graph->getVideoWindow()->put_Visible(OAFALSE);
+ hr = this->graph->getVideoWindow()->put_MessageDrain((OAHWND) NULL);
+ hr = this->graph->getVideoWindow()->put_Owner((OAHWND) NULL);
+ hr = this->graph->getVideoWindow()->put_AutoShow(OAFALSE);
#endif
- bool lock = (__directshow__Displays != NULL);
- if(lock)
- tsk_list_lock(__directshow__Displays);
- {
- // Remove this instance from the callback map
- tsk_list_remove_item_by_pred(__directshow__Displays, __pred_find_display_by_hwnd, &this->window);
- // Restore parent Window procedure
+ bool lock = (__directshow__Displays != NULL);
+ if(lock) {
+ tsk_list_lock(__directshow__Displays);
+ }
+ {
+ // Remove this instance from the callback map
+ tsk_list_remove_item_by_pred(__directshow__Displays, __pred_find_display_by_hwnd, &this->window);
+ // Restore parent Window procedure
#if defined(_WIN32_WCE)
- // Workaround for bug in SetWindowLong, call twice the API
- //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) this->parentWindowProc );
- //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) this->parentWindowProc );
+ // Workaround for bug in SetWindowLong, call twice the API
+ //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) this->parentWindowProc );
+ //this->parentWindowProc = (WNDPROC)SetWindowLong( this->window, GWL_WNDPROC, (LONG) this->parentWindowProc );
#else
- SetWindowLongPtr(this->window, GWLP_WNDPROC, (LONG_PTR) this->parentWindowProc);
+ SetWindowLongPtr(this->window, GWLP_WNDPROC, (LONG_PTR) this->parentWindowProc);
#endif
- }
- if(lock)
- tsk_list_unlock(__directshow__Displays);
+ }
+ if(lock) {
+ tsk_list_unlock(__directshow__Displays);
+ }
- this->hooked = FALSE;
+ this->hooked = FALSE;
}
@@ -568,55 +564,58 @@ void DSDisplay::unhook()
//
static tsk_object_t* tdshow_display_ctor(tsk_object_t * self, va_list * app)
{
- tdshow_display_t *display = (tdshow_display_t *)self;
-
- if(display){
- display->hwnd = va_arg(*app, HWND);
- display->display = va_arg(*app, DSDisplay*);
-
- if(!__directshow__Displays){
- __directshow__Displays = tsk_list_create();
- }
- tsk_list_push_back_data(__directshow__Displays, (void**)&display);
- }
-
- return self;
+ tdshow_display_t *display = (tdshow_display_t *)self;
+
+ if(display) {
+ display->hwnd = va_arg(*app, HWND);
+ display->display = va_arg(*app, DSDisplay*);
+
+ if(!__directshow__Displays) {
+ __directshow__Displays = tsk_list_create();
+ }
+ tsk_list_push_back_data(__directshow__Displays, (void**)&display);
+ }
+
+ return self;
}
static tsk_object_t* tdshow_display_dtor(tsk_object_t * self)
-{
- tdshow_display_t *display = (tdshow_display_t *)self;
- if(display){
- if(__directshow__Displays){
- tsk_list_remove_item_by_data(__directshow__Displays, display);
- //if(TSK_LIST_IS_EMPTY(__directshow__Displays)){
- // TSK_OBJECT_SAFE_FREE(__directshow__Displays);
- //}
- }
- }
-
- return self;
+{
+ tdshow_display_t *display = (tdshow_display_t *)self;
+ if(display) {
+ if(__directshow__Displays) {
+ tsk_list_remove_item_by_data(__directshow__Displays, display);
+ //if(TSK_LIST_IS_EMPTY(__directshow__Displays)){
+ // TSK_OBJECT_SAFE_FREE(__directshow__Displays);
+ //}
+ }
+ }
+
+ return self;
}
static int tdshow_display_cmp(const tsk_object_t *_d1, const tsk_object_t *_d2)
{
- const tdshow_display_t *d1 = (const tdshow_display_t *)_d1;
- const tdshow_display_t *d2 = (const tdshow_display_t *)_d2;
-
- if(d1 && d2){
- int ret = 0;
- tsk_subsat_int32_ptr(d1->hwnd, d2->hwnd, &ret);
- return ret;
- }
- else if(!d1 && !d2) return 0;
- else return -1;
+ const tdshow_display_t *d1 = (const tdshow_display_t *)_d1;
+ const tdshow_display_t *d2 = (const tdshow_display_t *)_d2;
+
+ if(d1 && d2) {
+ int ret = 0;
+ tsk_subsat_int32_ptr(d1->hwnd, d2->hwnd, &ret);
+ return ret;
+ }
+ else if(!d1 && !d2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tdshow_display_def_s =
-{
- sizeof(tdshow_display_t),
- tdshow_display_ctor,
- tdshow_display_dtor,
- tdshow_display_cmp,
+static const tsk_object_def_t tdshow_display_def_s = {
+ sizeof(tdshow_display_t),
+ tdshow_display_ctor,
+ tdshow_display_dtor,
+ tdshow_display_cmp,
};
extern const tsk_object_def_t *tdshow_display_def_t = &tdshow_display_def_s;
diff --git a/plugins/pluginDirectShow/internals/DSDisplay.h b/plugins/pluginDirectShow/internals/DSDisplay.h
index b2985ef..c20c17c 100755
--- a/plugins/pluginDirectShow/internals/DSDisplay.h
+++ b/plugins/pluginDirectShow/internals/DSDisplay.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,53 +32,53 @@
class DSDisplay
{
public:
- DSDisplay(HRESULT *hr);
- virtual ~DSDisplay();
+ DSDisplay(HRESULT *hr);
+ virtual ~DSDisplay();
- virtual void attach(INT64 parent);
- virtual void attach(void *parent);
- virtual void detach(void *parent);
- virtual void detach();
- virtual bool isAttached();
+ virtual void attach(INT64 parent);
+ virtual void attach(void *parent);
+ virtual void detach(void *parent);
+ virtual void detach();
+ virtual bool isAttached();
- virtual void start();
- virtual void pause();
- virtual void stop();
+ virtual void start();
+ virtual void pause();
+ virtual void stop();
- virtual int getWidth();
- virtual int getHeight();
- virtual void setSize(int w, int h);
+ virtual int getWidth();
+ virtual int getHeight();
+ virtual void setSize(int w, int h);
- virtual bool isFullscreen();
- virtual void setFullscreen(bool value);
- virtual void setPluginFirefox(bool value);
+ virtual bool isFullscreen();
+ virtual void setFullscreen(bool value);
+ virtual void setPluginFirefox(bool value);
- virtual bool canFullscreen();
+ virtual bool canFullscreen();
- virtual void setFps(int fps_);
+ virtual void setFps(int fps_);
- virtual void handleVideoFrame(const void* data, int w, int h);
+ virtual void handleVideoFrame(const void* data, int w, int h);
- LRESULT handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ LRESULT handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
- void hook();
- void unhook();
- void applyRatio(RECT rect);
+ void hook();
+ void unhook();
+ void applyRatio(RECT rect);
private:
- DSDisplayGraph *graph;
- DSDisplayOverlay *overlay;
-
- int fps;
- int left, top, width, height, imgWidth, imgHeight;
-
- bool bPluginFirefox;
- bool fullscreen;
- HWND window;
- WNDPROC parentWindowProc;
-
- bool hooked;
+ DSDisplayGraph *graph;
+ DSDisplayOverlay *overlay;
+
+ int fps;
+ int left, top, width, height, imgWidth, imgHeight;
+
+ bool bPluginFirefox;
+ bool fullscreen;
+ HWND window;
+ WNDPROC parentWindowProc;
+
+ bool hooked;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSDisplayGraph.cxx b/plugins/pluginDirectShow/internals/DSDisplayGraph.cxx
index b2da43b..75b00f4 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayGraph.cxx
+++ b/plugins/pluginDirectShow/internals/DSDisplayGraph.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,315 +31,359 @@ using namespace std;
DSDisplayGraph::DSDisplayGraph(HRESULT *hr)
{
- this->running = FALSE;
- this->paused = FALSE;
- this->fps = 15;
-
- this->graphBuilder = NULL;
+ this->running = FALSE;
+ this->paused = FALSE;
+ this->fps = 15;
+
+ this->graphBuilder = NULL;
- this->sourceFilter = NULL;
- this->colorspaceConverterFilter = NULL;
- this->videoRendererFilter = NULL;
+ this->sourceFilter = NULL;
+ this->colorspaceConverterFilter = NULL;
+ this->videoRendererFilter = NULL;
- this->mediaController = NULL;
- this->mediaEvent = NULL;
- this->videoWindow = NULL;
+ this->mediaController = NULL;
+ this->mediaEvent = NULL;
+ this->videoWindow = NULL;
#if defined(VMR) ||defined(VMR9) || defined(VMR9_WINDOWLESS)
- this->mixerBitmap = NULL;
- this->filterConfig = NULL;
+ this->mixerBitmap = NULL;
+ this->filterConfig = NULL;
#endif
#if defined(VMR9_WINDOWLESS)
- this->windowlessControl = NULL;
+ this->windowlessControl = NULL;
#endif
- *hr = this->createDisplayGraph();
- if (FAILED(*hr)) return;
+ *hr = this->createDisplayGraph();
+ if (FAILED(*hr)) {
+ return;
+ }
- *hr = this->connect();
- if (FAILED(*hr)) return;
+ *hr = this->connect();
+ if (FAILED(*hr)) {
+ return;
+ }
}
DSDisplayGraph::~DSDisplayGraph()
{
- this->disconnect();
+ this->disconnect();
#if defined(VMR9_WINDOWLESS)
- SAFE_RELEASE(this->windowlessControl);
+ SAFE_RELEASE(this->windowlessControl);
#endif
#if defined(VMR) ||defined(VMR9) || defined(VMR9_WINDOWLESS)
- SAFE_RELEASE(this->filterConfig);
- SAFE_RELEASE(this->mixerBitmap);
+ SAFE_RELEASE(this->filterConfig);
+ SAFE_RELEASE(this->mixerBitmap);
#endif
- SAFE_RELEASE(this->videoWindow);
- SAFE_RELEASE(this->mediaEvent);
- SAFE_RELEASE(this->mediaController);
+ SAFE_RELEASE(this->videoWindow);
+ SAFE_RELEASE(this->mediaEvent);
+ SAFE_RELEASE(this->mediaController);
- SAFE_RELEASE(this->colorspaceConverterFilter);
- SAFE_RELEASE(this->videoRendererFilter);
- //SAFE_RELEASE(this->sourceFilter);
+ SAFE_RELEASE(this->colorspaceConverterFilter);
+ SAFE_RELEASE(this->videoRendererFilter);
+ //SAFE_RELEASE(this->sourceFilter);
- SAFE_RELEASE(this->graphBuilder);
+ SAFE_RELEASE(this->graphBuilder);
}
void DSDisplayGraph::setDisplayFps(int fps_)
{
- this->fps = fps_;
- if(this->sourceFilter){
- this->sourceFilter->setFps(fps_);
- }
+ this->fps = fps_;
+ if(this->sourceFilter) {
+ this->sourceFilter->setFps(fps_);
+ }
}
bool DSDisplayGraph::getImageFormat(UINT &width, UINT &height)
{
- if(this->sourceFilter){
- return this->sourceFilter->getImageFormat(width, height);
- }
- return false;
+ if(this->sourceFilter) {
+ return this->sourceFilter->getImageFormat(width, height);
+ }
+ return false;
}
bool DSDisplayGraph::setImageFormat(UINT width, UINT height)
{
- bool ret = true;
- if(this->sourceFilter){
- UINT w=width, h = height;
- if(this->sourceFilter->getImageFormat(w, h)){
- if(w!= width || h!=height){ // Image format has changed
- bool reconnect = this->connected; // IMPORTANT: Must reconnect all elements
- HRESULT hr;
- if(reconnect){
- if((hr = this->disconnect()) != S_OK){
- return false;
- }
- }
- ret = (this->sourceFilter->setImageFormat(width, height) == S_OK);
- if(reconnect){
- if((hr = this->connect())){
- return false;
- }
- }
- }
- }
- }
- return ret;
+ bool ret = true;
+ if(this->sourceFilter) {
+ UINT w=width, h = height;
+ if(this->sourceFilter->getImageFormat(w, h)) {
+ if(w!= width || h!=height) { // Image format has changed
+ bool reconnect = this->connected; // IMPORTANT: Must reconnect all elements
+ HRESULT hr;
+ if(reconnect) {
+ if((hr = this->disconnect()) != S_OK) {
+ return false;
+ }
+ }
+ ret = (this->sourceFilter->setImageFormat(width, height) == S_OK);
+ if(reconnect) {
+ if((hr = this->connect())) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return ret;
}
HRESULT DSDisplayGraph::connect()
{
- HRESULT hr;
-
- if((hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorspaceConverterFilter)) != S_OK){
- TSK_DEBUG_ERROR("Failed to connect sourcefilter with the colorspace");
- return hr;
- }
- if((hr = ConnectFilters(this->graphBuilder, this->colorspaceConverterFilter, this->videoRendererFilter)) != S_OK){
- TSK_DEBUG_ERROR("Failed to connect colorspace with the videorenderer");
- return hr;
- }
-
- this->connected = true;
- return S_OK;
+ HRESULT hr;
+
+ if((hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorspaceConverterFilter)) != S_OK) {
+ TSK_DEBUG_ERROR("Failed to connect sourcefilter with the colorspace");
+ return hr;
+ }
+ if((hr = ConnectFilters(this->graphBuilder, this->colorspaceConverterFilter, this->videoRendererFilter)) != S_OK) {
+ TSK_DEBUG_ERROR("Failed to connect colorspace with the videorenderer");
+ return hr;
+ }
+
+ this->connected = true;
+ return S_OK;
}
HRESULT DSDisplayGraph::disconnect()
{
- HRESULT hr;
-
- if((hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorspaceConverterFilter)) != S_OK){
- TSK_DEBUG_ERROR("Failed to disconnect sourcefilter with the colorspace");
- return hr;
- }
- if((hr = DisconnectFilters(this->graphBuilder, this->colorspaceConverterFilter, this->videoRendererFilter)) != S_OK){
- TSK_DEBUG_ERROR("Failed to connect colorspace with the videorenderer");
- return hr;
- }
-
- this->connected = false;
- return S_OK;
+ HRESULT hr;
+
+ if((hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorspaceConverterFilter)) != S_OK) {
+ TSK_DEBUG_ERROR("Failed to disconnect sourcefilter with the colorspace");
+ return hr;
+ }
+ if((hr = DisconnectFilters(this->graphBuilder, this->colorspaceConverterFilter, this->videoRendererFilter)) != S_OK) {
+ TSK_DEBUG_ERROR("Failed to connect colorspace with the videorenderer");
+ return hr;
+ }
+
+ this->connected = false;
+ return S_OK;
}
HRESULT DSDisplayGraph::start()
{
- HRESULT hr;
- this->running = true;
- this->sourceFilter->reset();
-
- hr = this->mediaController->Run();
- if (!SUCCEEDED(hr)){
- TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Run() has failed with %ld", hr);
- }
- return hr;
+ HRESULT hr;
+ this->running = true;
+ this->sourceFilter->reset();
+
+ hr = this->mediaController->Run();
+ if (!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Run() has failed with %ld", hr);
+ }
+ return hr;
}
HRESULT DSDisplayGraph::pause()
{
- HRESULT hr = S_OK;
- if(isRunning() && !isPaused()){
- hr = this->mediaController->Pause();
- if(SUCCEEDED(hr)){
- this->paused = true;
- }
- }
- return hr;
+ HRESULT hr = S_OK;
+ if(isRunning() && !isPaused()) {
+ hr = this->mediaController->Pause();
+ if(SUCCEEDED(hr)) {
+ this->paused = true;
+ }
+ }
+ return hr;
}
HRESULT DSDisplayGraph::stop()
{
- HRESULT hr;
+ HRESULT hr;
- hr = this->mediaController->Pause();
- if (hr == S_FALSE){
- TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Pause() has failed with %ld. Waiting for transition.", hr);
- FILTER_STATE pfs;
- hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
- }
+ hr = this->mediaController->Pause();
+ if (hr == S_FALSE) {
+ TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Pause() has failed with %ld. Waiting for transition.", hr);
+ FILTER_STATE pfs;
+ hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
+ }
- hr = this->mediaController->Stop();
- if (!SUCCEEDED(hr)){
- TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Stop() has failed with %ld", hr);
- }
+ hr = this->mediaController->Stop();
+ if (!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("DSDisplayGraph::mediaController->Stop() has failed with %ld", hr);
+ }
- this->running = false;
- this->paused = false;
+ this->running = false;
+ this->paused = false;
- return hr;
+ return hr;
}
bool DSDisplayGraph::isRunning()
{
- return this->running;
+ return this->running;
}
bool DSDisplayGraph::isPaused()
{
- return this->paused;
+ return this->paused;
}
void DSDisplayGraph::handleFrame(const void* data, int w, int h)
{
- HRESULT hr;
-
- if(!this->sourceFilter){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
-
- if(!data || !this->running){
- this->sourceFilter->setBuffer(NULL, (w*h*3));
- return;
- }
-
- hr = this->sourceFilter->setImageFormat(w, h);
- if (hr == S_OK){
- this->stop();
-
- this->disconnect();
- this->connect();
-
- this->start();
- }
-
- this->sourceFilter->setBuffer((void*)data, (w*h*3));
+ HRESULT hr;
+
+ if(!this->sourceFilter) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+
+ if(!data || !this->running) {
+ this->sourceFilter->setBuffer(NULL, (w*h*3));
+ return;
+ }
+
+ hr = this->sourceFilter->setImageFormat(w, h);
+ if (hr == S_OK) {
+ this->stop();
+
+ this->disconnect();
+ this->connect();
+
+ this->start();
+ }
+
+ this->sourceFilter->setBuffer((void*)data, (w*h*3));
}
HRESULT DSDisplayGraph::createDisplayGraph()
{
- HRESULT hr;
+ HRESULT hr;
- // Create the graph builder
- hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder);
- if(FAILED(hr)) return hr;
+ // Create the graph builder
+ hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder);
+ if(FAILED(hr)) {
+ return hr;
+ }
- // Create my custom filter
- LPUNKNOWN pUnk = NULL;
- this->sourceFilter = new DSOutputFilter(pUnk, &hr /*, this*/);
- if(FAILED(hr) || this->sourceFilter == NULL) return hr;
+ // Create my custom filter
+ LPUNKNOWN pUnk = NULL;
+ this->sourceFilter = new DSOutputFilter(pUnk, &hr /*, this*/);
+ if(FAILED(hr) || this->sourceFilter == NULL) {
+ return hr;
+ }
- // Create the color space convertor filter
- hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorspaceConverterFilter);
- if(FAILED(hr)) return hr;
+ // Create the color space convertor filter
+ hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorspaceConverterFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#if defined(VMR)
- // Create the video mixing renderer based on Direct X
- hr = COCREATE(CLSID_VideoMixingRenderer, IID_IBaseFilter, this->videoRendererFilter);
- if(FAILED(hr)) return hr;
+ // Create the video mixing renderer based on Direct X
+ hr = COCREATE(CLSID_VideoMixingRenderer, IID_IBaseFilter, this->videoRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#elif defined(VMR9) || defined(VMR9_WINDOWLESS)
- // Create the video mixing renderer based on Direct X 9.0
- hr = COCREATE(CLSID_VideoMixingRenderer9, IID_IBaseFilter, this->videoRendererFilter);
- if(FAILED(hr)) return hr;
+ // Create the video mixing renderer based on Direct X 9.0
+ hr = COCREATE(CLSID_VideoMixingRenderer9, IID_IBaseFilter, this->videoRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#else
- // Create the video renderer
- hr = COCREATE(CLSID_VideoRenderer, IID_IBaseFilter, this->videoRendererFilter);
- if(FAILED(hr)) return hr;
+ // Create the video renderer
+ hr = COCREATE(CLSID_VideoRenderer, IID_IBaseFilter, this->videoRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
#endif
- // Add dource filter to the graph
- hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_OUTPUT);
- if(FAILED(hr)) return hr;
+ // Add dource filter to the graph
+ hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_OUTPUT);
+ if(FAILED(hr)) {
+ return hr;
+ }
- // Add the color space convertor to the graph
- hr = this->graphBuilder->AddFilter(this->colorspaceConverterFilter, FILTER_COLORSPACE_CONVERTOR);
- if(FAILED(hr)) return hr;
+ // Add the color space convertor to the graph
+ hr = this->graphBuilder->AddFilter(this->colorspaceConverterFilter, FILTER_COLORSPACE_CONVERTOR);
+ if(FAILED(hr)) {
+ return hr;
+ }
- // Add video renderer to the graph
- hr = this->graphBuilder->AddFilter(this->videoRendererFilter, FILTER_VIDEO_RENDERER);
- if(FAILED(hr)) return hr;
+ // Add video renderer to the graph
+ hr = this->graphBuilder->AddFilter(this->videoRendererFilter, FILTER_VIDEO_RENDERER);
+ if(FAILED(hr)) {
+ return hr;
+ }
- // Find media control
- hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController);
- if(FAILED(hr)) return hr;
+ // Find media control
+ hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController);
+ if(FAILED(hr)) {
+ return hr;
+ }
- // Find media event
- hr = QUERY(this->graphBuilder, IID_IMediaEventEx, this->mediaEvent);
- if(FAILED(hr)) return hr;
- // hr = this->mediaEvent->SetNotifyFlags(AM_MEDIAEVENT_NONOTIFY);
+ // Find media event
+ hr = QUERY(this->graphBuilder, IID_IMediaEventEx, this->mediaEvent);
+ if(FAILED(hr)) {
+ return hr;
+ }
+ // hr = this->mediaEvent->SetNotifyFlags(AM_MEDIAEVENT_NONOTIFY);
#if defined(VMR)
- // Find the bitmap mixer (Direct X)
- hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap, this->mixerBitmap);
- if(FAILED(hr)) return hr;
-
- // Find the bitmap configurer (Direct X)
- hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig, this->filterConfig);
- if(FAILED(hr)) return hr;
-
- // Set the number of streams (Direct X)
- hr = this->filterConfig->SetNumberOfStreams(1);
- if(FAILED(hr)) return hr;
+ // Find the bitmap mixer (Direct X)
+ hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap, this->mixerBitmap);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Find the bitmap configurer (Direct X)
+ hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig, this->filterConfig);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Set the number of streams (Direct X)
+ hr = this->filterConfig->SetNumberOfStreams(1);
+ if(FAILED(hr)) {
+ return hr;
+ }
#elif defined(VMR9) || defined(VMR9_WINDOWLESS)
- // Find the bitmap mixer (Direct X 9.0)
- hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap9, this->mixerBitmap);
- if(FAILED(hr)) return hr;
-
- // Find the bitmap configurer (Direct X 9.0)
- hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig9, this->filterConfig);
- if(FAILED(hr)) return hr;
-
- // Set the number of streams (Direct X 9.0)
- hr = this->filterConfig->SetNumberOfStreams(1);
- if(FAILED(hr)) return hr;
+ // Find the bitmap mixer (Direct X 9.0)
+ hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap9, this->mixerBitmap);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Find the bitmap configurer (Direct X 9.0)
+ hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig9, this->filterConfig);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Set the number of streams (Direct X 9.0)
+ hr = this->filterConfig->SetNumberOfStreams(1);
+ if(FAILED(hr)) {
+ return hr;
+ }
#endif
#if defined(VMR9_WINDOWLESS)
- // Set the rendering mode (Direct X 9.0)
- hr = this->filterConfig->SetRenderingMode(VMR9Mode_Windowless);
- if(FAILED(hr)) return hr;
-
- // Find the windowless control (Direct X 9.0)
- hr = QUERY(this->videoRendererFilter, IID_IVMRWindowlessControl9, this->windowlessControl);
- if(FAILED(hr)) return hr;
+ // Set the rendering mode (Direct X 9.0)
+ hr = this->filterConfig->SetRenderingMode(VMR9Mode_Windowless);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Find the windowless control (Direct X 9.0)
+ hr = QUERY(this->videoRendererFilter, IID_IVMRWindowlessControl9, this->windowlessControl);
+ if(FAILED(hr)) {
+ return hr;
+ }
#else
- // Find IVideoWindow interface
- hr = QUERY(this->graphBuilder, IID_IVideoWindow, this->videoWindow);
- if(FAILED(hr)) return hr;
+ // Find IVideoWindow interface
+ hr = QUERY(this->graphBuilder, IID_IVideoWindow, this->videoWindow);
+ if(FAILED(hr)) {
+ return hr;
+ }
#endif
- return hr;
+ return hr;
}
diff --git a/plugins/pluginDirectShow/internals/DSDisplayGraph.h b/plugins/pluginDirectShow/internals/DSDisplayGraph.h
index c9080fe..4260e45 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayGraph.h
+++ b/plugins/pluginDirectShow/internals/DSDisplayGraph.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,72 +39,90 @@
class DSDisplayGraph
{
public:
- DSDisplayGraph(HRESULT *hr);
- virtual ~DSDisplayGraph();
-
- int getDisplayFps() { return this->fps; };
- void setDisplayFps(int fps_);
-
- bool getImageFormat(UINT &width, UINT &height);
- bool setImageFormat(UINT width, UINT height);
-
- HRESULT connect();
- HRESULT disconnect();
-
- HRESULT start();
- HRESULT pause();
- HRESULT stop();
- bool isRunning();
- bool isPaused();
-
- IMediaEventEx *getMediaEvent() { return this->mediaEvent; };
- IVideoWindow *getVideoWindow() { return this->videoWindow; };
- DSOutputFilter *getSourceFilter() { return this->sourceFilter; };
+ DSDisplayGraph(HRESULT *hr);
+ virtual ~DSDisplayGraph();
+
+ int getDisplayFps() {
+ return this->fps;
+ };
+ void setDisplayFps(int fps_);
+
+ bool getImageFormat(UINT &width, UINT &height);
+ bool setImageFormat(UINT width, UINT height);
+
+ HRESULT connect();
+ HRESULT disconnect();
+
+ HRESULT start();
+ HRESULT pause();
+ HRESULT stop();
+ bool isRunning();
+ bool isPaused();
+
+ IMediaEventEx *getMediaEvent() {
+ return this->mediaEvent;
+ };
+ IVideoWindow *getVideoWindow() {
+ return this->videoWindow;
+ };
+ DSOutputFilter *getSourceFilter() {
+ return this->sourceFilter;
+ };
#if defined(VMR)
- IVMRMixerBitmap *getMixerBitmap() { return this->mixerBitmap; };
+ IVMRMixerBitmap *getMixerBitmap() {
+ return this->mixerBitmap;
+ };
#elif defined(VMR9)
- IVMRMixerBitmap9 *getMixerBitmap() { return this->mixerBitmap; };
+ IVMRMixerBitmap9 *getMixerBitmap() {
+ return this->mixerBitmap;
+ };
#elif defined(VMR9_WINDOWLESS)
- IVMRMixerBitmap9 *getMixerBitmap() { return this->mixerBitmap; };
- IVMRMixerControl9 *getMixerControl() { return this->mixerControl; };
- IVMRWindowlessControl9 *getWindowlessControl() { return this->windowlessControl; };
+ IVMRMixerBitmap9 *getMixerBitmap() {
+ return this->mixerBitmap;
+ };
+ IVMRMixerControl9 *getMixerControl() {
+ return this->mixerControl;
+ };
+ IVMRWindowlessControl9 *getWindowlessControl() {
+ return this->windowlessControl;
+ };
#endif
- void handleFrame(const void* data, int w, int h);
+ void handleFrame(const void* data, int w, int h);
private:
- HRESULT createDisplayGraph();
+ HRESULT createDisplayGraph();
private:
- IGraphBuilder *graphBuilder;
+ IGraphBuilder *graphBuilder;
- DSOutputFilter *sourceFilter;
- IBaseFilter *colorspaceConverterFilter;
- IBaseFilter *videoRendererFilter;
+ DSOutputFilter *sourceFilter;
+ IBaseFilter *colorspaceConverterFilter;
+ IBaseFilter *videoRendererFilter;
- IMediaControl *mediaController;
- IMediaEventEx *mediaEvent;
- IVideoWindow *videoWindow;
+ IMediaControl *mediaController;
+ IMediaEventEx *mediaEvent;
+ IVideoWindow *videoWindow;
#if defined(VMR)
- IVMRMixerBitmap *mixerBitmap;
- IVMRFilterConfig *filterConfig;
+ IVMRMixerBitmap *mixerBitmap;
+ IVMRFilterConfig *filterConfig;
#elif defined(VMR9)
- IVMRMixerBitmap9 *mixerBitmap;
- IVMRMixerControl9 *mixerControl;
- IVMRFilterConfig9 *filterConfig;
+ IVMRMixerBitmap9 *mixerBitmap;
+ IVMRMixerControl9 *mixerControl;
+ IVMRFilterConfig9 *filterConfig;
#elif defined(VMR9_WINDOWLESS)
- IVMRMixerBitmap9 *mixerBitmap;
- IVMRMixerControl9 *mixerControl;
- IVMRFilterConfig9 *filterConfig;
- IVMRWindowlessControl9 *windowlessControl;
+ IVMRMixerBitmap9 *mixerBitmap;
+ IVMRMixerControl9 *mixerControl;
+ IVMRFilterConfig9 *filterConfig;
+ IVMRWindowlessControl9 *windowlessControl;
#endif
- bool connected;
- bool running;
- bool paused;
- int fps;
+ bool connected;
+ bool running;
+ bool paused;
+ int fps;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR.cxx b/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR.cxx
index dacea84..188f7ec 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR.cxx
+++ b/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,9 +39,9 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase;
DSDisplayOverlay::DSDisplayOverlay()
{
- this->window = NULL;
- this->hdcBmp = NULL;
- this->hbmOld = NULL;
+ this->window = NULL;
+ this->hdcBmp = NULL;
+ this->hbmOld = NULL;
}
DSDisplayOverlay::~DSDisplayOverlay()
@@ -50,130 +50,122 @@ DSDisplayOverlay::~DSDisplayOverlay()
void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
{
- HRESULT hr;
-
- // Gets the handle of the parent and the graph
- this->window = parent;
- this->displayGraph = graph;
-
- if (this->window)
- {
- // Hack to get module of the current code
- TCHAR *modulePath = (TCHAR *) calloc(255, sizeof(TCHAR));
- GetModuleFileName((HINSTANCE)&__ImageBase, modulePath, 255);
- HMODULE module = GetModuleHandle(modulePath);
- delete[] modulePath;
- if (!module)
- {
- cout << "Failed to get current module";
- return;
- }
-
- HBITMAP bitmap = LoadBitmap(module, MAKEINTRESOURCE(IDB_BITMAP_OVERLAY));
- if (!bitmap)
- {
- cout << "Failed to load overlay bitmap" << endl;
- return;
- }
-
- RECT rect;
- hr = GetWindowRect(this->window, &rect);
- if (FAILED(hr))
- {
- cout << "Failed to get window size" << endl;
- return;
- }
-
- BITMAP bm;
- HDC hdc = GetDC(this->window);
- this->hdcBmp = CreateCompatibleDC(hdc);
- ReleaseDC(this->window, hdc);
-
- GetObject(bitmap, sizeof(bm), &bm);
- this->hbmOld= (HBITMAP) SelectObject(this->hdcBmp, bitmap);
-
- ZeroMemory(&this->alphaBitmap, sizeof(VMRALPHABITMAP));
- this->alphaBitmap.dwFlags = VMRBITMAP_HDC | VMRBITMAP_SRCCOLORKEY;
- this->alphaBitmap.hdc = this->hdcBmp;
- this->alphaBitmap.clrSrcKey = 0x00FF00FF;
- // Source rectangle
- this->alphaBitmap.rSrc.left = 0;
- this->alphaBitmap.rSrc.top = 0;
- this->alphaBitmap.rSrc.right = bm.bmWidth;
- this->alphaBitmap.rSrc.bottom = bm.bmHeight;
- // Destination rectangle
- this->alphaBitmap.rDest.left = (rect.right - rect.left - bm.bmWidth) / 2.0;
- this->alphaBitmap.rDest.top = (rect.bottom - rect.top - bm.bmHeight) / 2.0;
- this->alphaBitmap.rDest.right = this->alphaBitmap.rDest.left + bm.bmWidth;
- this->alphaBitmap.rDest.bottom = this->alphaBitmap.rDest.top + bm.bmHeight;
- this->alphaBitmap.rDest.left /= (rect.right - rect.left);
- this->alphaBitmap.rDest.top /= (rect.bottom - rect.top);
- this->alphaBitmap.rDest.right /= (rect.right - rect.left);
- this->alphaBitmap.rDest.bottom /= (rect.bottom - rect.top);
- // Alpha value for start
- this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
-
- }
+ HRESULT hr;
+
+ // Gets the handle of the parent and the graph
+ this->window = parent;
+ this->displayGraph = graph;
+
+ if (this->window) {
+ // Hack to get module of the current code
+ TCHAR *modulePath = (TCHAR *) calloc(255, sizeof(TCHAR));
+ GetModuleFileName((HINSTANCE)&__ImageBase, modulePath, 255);
+ HMODULE module = GetModuleHandle(modulePath);
+ delete[] modulePath;
+ if (!module) {
+ cout << "Failed to get current module";
+ return;
+ }
+
+ HBITMAP bitmap = LoadBitmap(module, MAKEINTRESOURCE(IDB_BITMAP_OVERLAY));
+ if (!bitmap) {
+ cout << "Failed to load overlay bitmap" << endl;
+ return;
+ }
+
+ RECT rect;
+ hr = GetWindowRect(this->window, &rect);
+ if (FAILED(hr)) {
+ cout << "Failed to get window size" << endl;
+ return;
+ }
+
+ BITMAP bm;
+ HDC hdc = GetDC(this->window);
+ this->hdcBmp = CreateCompatibleDC(hdc);
+ ReleaseDC(this->window, hdc);
+
+ GetObject(bitmap, sizeof(bm), &bm);
+ this->hbmOld= (HBITMAP) SelectObject(this->hdcBmp, bitmap);
+
+ ZeroMemory(&this->alphaBitmap, sizeof(VMRALPHABITMAP));
+ this->alphaBitmap.dwFlags = VMRBITMAP_HDC | VMRBITMAP_SRCCOLORKEY;
+ this->alphaBitmap.hdc = this->hdcBmp;
+ this->alphaBitmap.clrSrcKey = 0x00FF00FF;
+ // Source rectangle
+ this->alphaBitmap.rSrc.left = 0;
+ this->alphaBitmap.rSrc.top = 0;
+ this->alphaBitmap.rSrc.right = bm.bmWidth;
+ this->alphaBitmap.rSrc.bottom = bm.bmHeight;
+ // Destination rectangle
+ this->alphaBitmap.rDest.left = (rect.right - rect.left - bm.bmWidth) / 2.0;
+ this->alphaBitmap.rDest.top = (rect.bottom - rect.top - bm.bmHeight) / 2.0;
+ this->alphaBitmap.rDest.right = this->alphaBitmap.rDest.left + bm.bmWidth;
+ this->alphaBitmap.rDest.bottom = this->alphaBitmap.rDest.top + bm.bmHeight;
+ this->alphaBitmap.rDest.left /= (rect.right - rect.left);
+ this->alphaBitmap.rDest.top /= (rect.bottom - rect.top);
+ this->alphaBitmap.rDest.right /= (rect.right - rect.left);
+ this->alphaBitmap.rDest.bottom /= (rect.bottom - rect.top);
+ // Alpha value for start
+ this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
+
+ }
}
void DSDisplayOverlay::detach()
{
- // Clean up
- DeleteObject(SelectObject(this->hdcBmp, this->hbmOld));
- DeleteDC(this->hdcBmp);
-
- this->hdcBmp = NULL;
- this->hbmOld = NULL;
- this->displayGraph = NULL;
- this->window = NULL;
+ // Clean up
+ DeleteObject(SelectObject(this->hdcBmp, this->hbmOld));
+ DeleteDC(this->hdcBmp);
+
+ this->hdcBmp = NULL;
+ this->hbmOld = NULL;
+ this->displayGraph = NULL;
+ this->window = NULL;
}
void DSDisplayOverlay::show(int value)
{
- // Store the ticks to count down
- this->ticks = value;
+ // Store the ticks to count down
+ this->ticks = value;
- // Compute alpha value decrement
- this->alphaStep = (this->ticks > 0) ? ((ALPHA_VALUE_START - ALPHA_VALUE_STOP) / this->ticks) : 0;
- this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
+ // Compute alpha value decrement
+ this->alphaStep = (this->ticks > 0) ? ((ALPHA_VALUE_START - ALPHA_VALUE_STOP) / this->ticks) : 0;
+ this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
- this->internalUpdate();
+ this->internalUpdate();
}
void DSDisplayOverlay::update()
{
- if (this->displayGraph && (this->ticks > 0))
- {
- this->ticks--;
+ if (this->displayGraph && (this->ticks > 0)) {
+ this->ticks--;
- // Be sure alpha is in 0.0 .. 1.0 range.
- float value = this->alphaBitmap.fAlpha;
- value -= this->alphaStep;
- this->alphaBitmap.fAlpha = (value >= 0.0f) ? value : 0.0f;
+ // Be sure alpha is in 0.0 .. 1.0 range.
+ float value = this->alphaBitmap.fAlpha;
+ value -= this->alphaStep;
+ this->alphaBitmap.fAlpha = (value >= 0.0f) ? value : 0.0f;
- this->internalUpdate();
- }
+ this->internalUpdate();
+ }
}
void DSDisplayOverlay::internalUpdate()
{
- HRESULT hr;
-
- if (this->ticks > 0)
- {
- this->alphaBitmap.dwFlags = VMRBITMAP_HDC | VMRBITMAP_SRCCOLORKEY;
- }
- else
- {
- this->alphaBitmap.dwFlags = VMRBITMAP_DISABLE;
- }
-
- hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
- if (FAILED(hr))
- {
- cout << "Failed to mix overylay (" << hr << ")" << endl;
- return;
- }
+ HRESULT hr;
+
+ if (this->ticks > 0) {
+ this->alphaBitmap.dwFlags = VMRBITMAP_HDC | VMRBITMAP_SRCCOLORKEY;
+ }
+ else {
+ this->alphaBitmap.dwFlags = VMRBITMAP_DISABLE;
+ }
+
+ hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
+ if (FAILED(hr)) {
+ cout << "Failed to mix overylay (" << hr << ")" << endl;
+ return;
+ }
}
#endif
diff --git a/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR9.cxx b/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR9.cxx
index 972945f..4504849 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR9.cxx
+++ b/plugins/pluginDirectShow/internals/DSDisplayOverlay.VMR9.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -32,176 +32,165 @@ using namespace std;
DSDisplayOverlay::DSDisplayOverlay()
{
- this->window = NULL;
- this->direct3DDevice = NULL;
- this->direct3DSurface = NULL;
-
- this->direct3D = Direct3DCreate9(D3D_SDK_VERSION);
- if (!this->direct3D)
- {
- cout << "Cannot create Direct3D environment" << endl;
- return;
- }
+ this->window = NULL;
+ this->direct3DDevice = NULL;
+ this->direct3DSurface = NULL;
+
+ this->direct3D = Direct3DCreate9(D3D_SDK_VERSION);
+ if (!this->direct3D) {
+ cout << "Cannot create Direct3D environment" << endl;
+ return;
+ }
}
DSDisplayOverlay::~DSDisplayOverlay()
{
- SAFE_RELEASE(this->direct3D);
+ SAFE_RELEASE(this->direct3D);
}
void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
{
- HRESULT hr;
-
- // Gets the handle of the parent and the graph
- this->window = parent;
- this->displayGraph = graph;
-
- if (this->window)
- {
- D3DPRESENT_PARAMETERS d3dpp;
- ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS));
- d3dpp.Windowed = TRUE;
- d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
-
- hr = this->direct3D->CreateDevice(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- this->window,
- D3DCREATE_SOFTWARE_VERTEXPROCESSING,
- &d3dpp,
- &this->direct3DDevice);
- if (FAILED(hr))
- {
- cout << "Cannot create Direct3D device" << endl;
- return;
- }
-
- ZeroMemory(&this->overlayInfo, sizeof(D3DXIMAGE_INFO));
- hr = D3DXGetImageInfoFromFile(FILENAME, &this->overlayInfo);
- if (FAILED(hr))
- {
- cout << "Cannot stat overlay file" << endl;
- return;
- }
-
- hr = this->direct3DDevice->CreateOffscreenPlainSurface(
- this->overlayInfo.Width,
- this->overlayInfo.Height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SYSTEMMEM,
- &this->direct3DSurface,
- NULL);
- if (FAILED(hr))
- {
- cout << "Cannot create Direct3D surface" << endl;
- return;
- }
-
- D3DCOLOR alphaKey = 0xFF000000;
-
- hr = D3DXLoadSurfaceFromFile(this->direct3DSurface,
- NULL,
- NULL,
- FILENAME,
- NULL,
- D3DX_FILTER_NONE,
- alphaKey,
- &this->overlayInfo);
- if (FAILED(hr))
- {
- cout << "Cannot load overlay file" << endl;
- return;
- }
-
- D3DVIEWPORT9 viewport;
- ZeroMemory(&viewport, sizeof(D3DVIEWPORT9));
-
- hr= this->direct3DDevice->GetViewport(&viewport);
- if (FAILED(hr))
- {
- cout << "Cannot get view port" << endl;
- return;
- }
-
- ZeroMemory(&this->alphaBitmap, sizeof(VMR9AlphaBitmap));
- this->alphaBitmap.dwFlags = VMR9AlphaBitmap_EntireDDS;
- this->alphaBitmap.hdc = NULL;
- this->alphaBitmap.pDDS = this->direct3DSurface;
- // Source rectangle
- this->alphaBitmap.rSrc.left = 0;
- this->alphaBitmap.rSrc.top = 0;
- this->alphaBitmap.rSrc.right = this->overlayInfo.Width;
- this->alphaBitmap.rSrc.bottom = this->overlayInfo.Height;
- // Destination rectangle
- this->alphaBitmap.rDest.left = (viewport.Width - this->overlayInfo.Width) / 2.0;
- this->alphaBitmap.rDest.top = (viewport.Height - this->overlayInfo.Height) / 2.0;
- this->alphaBitmap.rDest.right = this->alphaBitmap.rDest.left + this->overlayInfo.Width;
- this->alphaBitmap.rDest.bottom = this->alphaBitmap.rDest.top + this->overlayInfo.Height;
- this->alphaBitmap.rDest.left /= viewport.Width;
- this->alphaBitmap.rDest.top /= viewport.Height;
- this->alphaBitmap.rDest.right /= viewport.Width;
- this->alphaBitmap.rDest.bottom /= viewport.Height;
- // Alpha value for start
- this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
- }
+ HRESULT hr;
+
+ // Gets the handle of the parent and the graph
+ this->window = parent;
+ this->displayGraph = graph;
+
+ if (this->window) {
+ D3DPRESENT_PARAMETERS d3dpp;
+ ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS));
+ d3dpp.Windowed = TRUE;
+ d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
+
+ hr = this->direct3D->CreateDevice(
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ this->window,
+ D3DCREATE_SOFTWARE_VERTEXPROCESSING,
+ &d3dpp,
+ &this->direct3DDevice);
+ if (FAILED(hr)) {
+ cout << "Cannot create Direct3D device" << endl;
+ return;
+ }
+
+ ZeroMemory(&this->overlayInfo, sizeof(D3DXIMAGE_INFO));
+ hr = D3DXGetImageInfoFromFile(FILENAME, &this->overlayInfo);
+ if (FAILED(hr)) {
+ cout << "Cannot stat overlay file" << endl;
+ return;
+ }
+
+ hr = this->direct3DDevice->CreateOffscreenPlainSurface(
+ this->overlayInfo.Width,
+ this->overlayInfo.Height,
+ D3DFMT_A8R8G8B8,
+ D3DPOOL_SYSTEMMEM,
+ &this->direct3DSurface,
+ NULL);
+ if (FAILED(hr)) {
+ cout << "Cannot create Direct3D surface" << endl;
+ return;
+ }
+
+ D3DCOLOR alphaKey = 0xFF000000;
+
+ hr = D3DXLoadSurfaceFromFile(this->direct3DSurface,
+ NULL,
+ NULL,
+ FILENAME,
+ NULL,
+ D3DX_FILTER_NONE,
+ alphaKey,
+ &this->overlayInfo);
+ if (FAILED(hr)) {
+ cout << "Cannot load overlay file" << endl;
+ return;
+ }
+
+ D3DVIEWPORT9 viewport;
+ ZeroMemory(&viewport, sizeof(D3DVIEWPORT9));
+
+ hr= this->direct3DDevice->GetViewport(&viewport);
+ if (FAILED(hr)) {
+ cout << "Cannot get view port" << endl;
+ return;
+ }
+
+ ZeroMemory(&this->alphaBitmap, sizeof(VMR9AlphaBitmap));
+ this->alphaBitmap.dwFlags = VMR9AlphaBitmap_EntireDDS;
+ this->alphaBitmap.hdc = NULL;
+ this->alphaBitmap.pDDS = this->direct3DSurface;
+ // Source rectangle
+ this->alphaBitmap.rSrc.left = 0;
+ this->alphaBitmap.rSrc.top = 0;
+ this->alphaBitmap.rSrc.right = this->overlayInfo.Width;
+ this->alphaBitmap.rSrc.bottom = this->overlayInfo.Height;
+ // Destination rectangle
+ this->alphaBitmap.rDest.left = (viewport.Width - this->overlayInfo.Width) / 2.0;
+ this->alphaBitmap.rDest.top = (viewport.Height - this->overlayInfo.Height) / 2.0;
+ this->alphaBitmap.rDest.right = this->alphaBitmap.rDest.left + this->overlayInfo.Width;
+ this->alphaBitmap.rDest.bottom = this->alphaBitmap.rDest.top + this->overlayInfo.Height;
+ this->alphaBitmap.rDest.left /= viewport.Width;
+ this->alphaBitmap.rDest.top /= viewport.Height;
+ this->alphaBitmap.rDest.right /= viewport.Width;
+ this->alphaBitmap.rDest.bottom /= viewport.Height;
+ // Alpha value for start
+ this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
+ }
}
void DSDisplayOverlay::detach()
{
- SAFE_RELEASE(this->direct3DSurface);
- SAFE_RELEASE(this->direct3DDevice);
+ SAFE_RELEASE(this->direct3DSurface);
+ SAFE_RELEASE(this->direct3DDevice);
- this->displayGraph = NULL;
- this->window = NULL;
+ this->displayGraph = NULL;
+ this->window = NULL;
}
void DSDisplayOverlay::show(int value)
{
- // Store the ticks to count down
- this->ticks = value;
+ // Store the ticks to count down
+ this->ticks = value;
- // Compute alpha value decrement
- this->alphaStep = (this->ticks > 0) ? ((ALPHA_VALUE_START - ALPHA_VALUE_STOP) / this->ticks) : 0;
- this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
+ // Compute alpha value decrement
+ this->alphaStep = (this->ticks > 0) ? ((ALPHA_VALUE_START - ALPHA_VALUE_STOP) / this->ticks) : 0;
+ this->alphaBitmap.fAlpha = ALPHA_VALUE_START;
- this->internalUpdate();
+ this->internalUpdate();
}
void DSDisplayOverlay::update()
{
- if (this->displayGraph && (this->ticks > 0))
- {
- this->ticks--;
+ if (this->displayGraph && (this->ticks > 0)) {
+ this->ticks--;
- // Be sure alpha is in 0.0 .. 1.0 range.
- float value = this->alphaBitmap.fAlpha;
- value -= this->alphaStep;
- this->alphaBitmap.fAlpha = (value >= 0.0f) ? value : 0.0f;
+ // Be sure alpha is in 0.0 .. 1.0 range.
+ float value = this->alphaBitmap.fAlpha;
+ value -= this->alphaStep;
+ this->alphaBitmap.fAlpha = (value >= 0.0f) ? value : 0.0f;
- this->internalUpdate();
- }
+ this->internalUpdate();
+ }
}
void DSDisplayOverlay::internalUpdate()
{
- HRESULT hr;
-
- if (this->ticks > 0)
- {
- this->alphaBitmap.dwFlags = VMR9AlphaBitmap_EntireDDS;
- }
- else
- {
- this->alphaBitmap.dwFlags = VMR9AlphaBitmap_Disable;
- }
-
- hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
- if (FAILED(hr))
- {
- cout << "Failed to mix overylay (" << hr << ")" << endl;
- return;
- }
+ HRESULT hr;
+
+ if (this->ticks > 0) {
+ this->alphaBitmap.dwFlags = VMR9AlphaBitmap_EntireDDS;
+ }
+ else {
+ this->alphaBitmap.dwFlags = VMR9AlphaBitmap_Disable;
+ }
+
+ hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
+ if (FAILED(hr)) {
+ cout << "Failed to mix overylay (" << hr << ")" << endl;
+ return;
+ }
}
#endif
diff --git a/plugins/pluginDirectShow/internals/DSDisplayOverlay.cxx b/plugins/pluginDirectShow/internals/DSDisplayOverlay.cxx
index eb355c4..7c5463b 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayOverlay.cxx
+++ b/plugins/pluginDirectShow/internals/DSDisplayOverlay.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -34,34 +34,33 @@ DSDisplayOverlay::~DSDisplayOverlay()
void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
{
- this->displayGraph = graph;
+ this->displayGraph = graph;
}
void DSDisplayOverlay::detach()
{
- this->displayGraph = NULL;
+ this->displayGraph = NULL;
}
void DSDisplayOverlay::show(int value)
{
- // Store the ticks to count down
- this->ticks = value;
+ // Store the ticks to count down
+ this->ticks = value;
- this->internalUpdate();
+ this->internalUpdate();
}
void DSDisplayOverlay::update()
{
- if (this->displayGraph && (this->ticks > 0))
- {
- this->ticks--;
- this->internalUpdate();
- }
+ if (this->displayGraph && (this->ticks > 0)) {
+ this->ticks--;
+ this->internalUpdate();
+ }
}
void DSDisplayOverlay::internalUpdate()
{
- this->displayGraph->getSourceFilter()->showOverlay(this->ticks);
+ this->displayGraph->getSourceFilter()->showOverlay(this->ticks);
}
#endif
diff --git a/plugins/pluginDirectShow/internals/DSDisplayOverlay.h b/plugins/pluginDirectShow/internals/DSDisplayOverlay.h
index 0db887d..69ed6a3 100755
--- a/plugins/pluginDirectShow/internals/DSDisplayOverlay.h
+++ b/plugins/pluginDirectShow/internals/DSDisplayOverlay.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -32,36 +32,36 @@ class DSDisplayGraph;
class DSDisplayOverlay
{
public:
- DSDisplayOverlay();
- virtual ~DSDisplayOverlay();
+ DSDisplayOverlay();
+ virtual ~DSDisplayOverlay();
- void attach(HWND parent, DSDisplayGraph *graph);
- void detach();
+ void attach(HWND parent, DSDisplayGraph *graph);
+ void detach();
- void show(int value);
- void update();
+ void show(int value);
+ void update();
private:
- void internalUpdate();
+ void internalUpdate();
private:
- HWND window;
+ HWND window;
- DSDisplayGraph *displayGraph;
- int ticks;
+ DSDisplayGraph *displayGraph;
+ int ticks;
#if defined(VMR)
- HDC hdcBmp;
- HBITMAP hbmOld;
- VMRALPHABITMAP alphaBitmap;
- float alphaStep;
+ HDC hdcBmp;
+ HBITMAP hbmOld;
+ VMRALPHABITMAP alphaBitmap;
+ float alphaStep;
#elif defined(VMR9) || defined(VMR9_WINDOWLESS)
- IDirect3D9 *direct3D;
- IDirect3DDevice9 *direct3DDevice;
- IDirect3DSurface9 *direct3DSurface;
- D3DXIMAGE_INFO overlayInfo;
- VMR9AlphaBitmap alphaBitmap;
- float alphaStep;
+ IDirect3D9 *direct3D;
+ IDirect3DDevice9 *direct3DDevice;
+ IDirect3DSurface9 *direct3DSurface;
+ D3DXIMAGE_INFO overlayInfo;
+ VMR9AlphaBitmap alphaBitmap;
+ float alphaStep;
#endif
};
diff --git a/plugins/pluginDirectShow/internals/DSFrameRateFilter.cxx b/plugins/pluginDirectShow/internals/DSFrameRateFilter.cxx
index cbf2a0a..c44ba03 100755
--- a/plugins/pluginDirectShow/internals/DSFrameRateFilter.cxx
+++ b/plugins/pluginDirectShow/internals/DSFrameRateFilter.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,20 +26,20 @@ using namespace std;
#define FPS_OUTPUT 5
// {7F9F08CF-139F-40b2-A283-01C4EC26A452}
-TDSHOW_DEFINE_GUID(CLSID_DSFrameRateFilter,
-0x7f9f08cf, 0x139f, 0x40b2, 0xa2, 0x83, 0x1, 0xc4, 0xec, 0x26, 0xa4, 0x52);
+TDSHOW_DEFINE_GUID(CLSID_DSFrameRateFilter,
+ 0x7f9f08cf, 0x139f, 0x40b2, 0xa2, 0x83, 0x1, 0xc4, 0xec, 0x26, 0xa4, 0x52);
DSFrameRateFilter::DSFrameRateFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr)
-:CTransInPlaceFilter (tszName, punk, CLSID_DSFrameRateFilter, phr)
+ :CTransInPlaceFilter (tszName, punk, CLSID_DSFrameRateFilter, phr)
{
- this->m_rtFrameLength = (10000000)/FPS_OUTPUT;
+ this->m_rtFrameLength = (10000000)/FPS_OUTPUT;
- this->m_inputFps = FPS_INPUT;
- this->m_outputFps = FPS_OUTPUT;
+ this->m_inputFps = FPS_INPUT;
+ this->m_outputFps = FPS_OUTPUT;
- this->m_iFrameNumber = 0;
- this->m_progress = 0;
- this->m_bProcessFrame = true;
+ this->m_iFrameNumber = 0;
+ this->m_progress = 0;
+ this->m_bProcessFrame = true;
}
DSFrameRateFilter::~DSFrameRateFilter()
@@ -48,73 +48,74 @@ DSFrameRateFilter::~DSFrameRateFilter()
HRESULT DSFrameRateFilter::SetFps(int inputFps, int outputFps)
{
- if(inputFps <= 0 || outputFps <= 0)
- {
- return E_FAIL;
- }
-
- // Stop prcessing
- this->m_bProcessFrame = false;
-
- if (inputFps < outputFps) {
- this->m_inputFps = this->m_outputFps = inputFps;
- }
- else {
- this->m_outputFps = outputFps;
- this->m_inputFps = inputFps;
- }
-
- // Restart processing
- this->m_iFrameNumber = 0;
- this->m_progress = 0;
- this->m_bProcessFrame = true;
-
- return S_OK;
+ if(inputFps <= 0 || outputFps <= 0) {
+ return E_FAIL;
+ }
+
+ // Stop prcessing
+ this->m_bProcessFrame = false;
+
+ if (inputFps < outputFps) {
+ this->m_inputFps = this->m_outputFps = inputFps;
+ }
+ else {
+ this->m_outputFps = outputFps;
+ this->m_inputFps = inputFps;
+ }
+
+ // Restart processing
+ this->m_iFrameNumber = 0;
+ this->m_progress = 0;
+ this->m_bProcessFrame = true;
+
+ return S_OK;
}
HRESULT DSFrameRateFilter::Transform(IMediaSample *pSample)
-{
- if(!this->m_bProcessFrame) return S_FALSE;
+{
+ if(!this->m_bProcessFrame) {
+ return S_FALSE;
+ }
- CheckPointer(pSample, E_POINTER);
+ CheckPointer(pSample, E_POINTER);
- HRESULT hr = S_OK;
- HRESULT ret = S_FALSE;
+ HRESULT hr = S_OK;
+ HRESULT ret = S_FALSE;
- pSample->SetTime(NULL, NULL);
+ pSample->SetTime(NULL, NULL);
- // Drop frame?
- if (this->m_iFrameNumber == 0) {
- ret = S_OK;
- }
- else if (this->m_progress >= this->m_inputFps) {
- this->m_progress -= this->m_inputFps;
- ret = S_OK;
- }
+ // Drop frame?
+ if (this->m_iFrameNumber == 0) {
+ ret = S_OK;
+ }
+ else if (this->m_progress >= this->m_inputFps) {
+ this->m_progress -= this->m_inputFps;
+ ret = S_OK;
+ }
- // Mark frame as accepted
- if (ret == S_OK) {
- // Set TRUE on every sample for uncompressed frames
- pSample->SetSyncPoint(TRUE);
- }
+ // Mark frame as accepted
+ if (ret == S_OK) {
+ // Set TRUE on every sample for uncompressed frames
+ pSample->SetSyncPoint(TRUE);
+ }
- this->m_progress += this->m_outputFps;
- this->m_iFrameNumber++;
+ this->m_progress += this->m_outputFps;
+ this->m_iFrameNumber++;
- return ret;
+ return ret;
}
HRESULT DSFrameRateFilter::CheckInputType(const CMediaType* mtIn)
-{
- return S_OK;
+{
+ return S_OK;
}
//Implement CreateInstance for your filter object. Typically, CreateInstance calls the constructor of your filter clas
CUnknown * WINAPI DSFrameRateFilter::CreateInstance(LPUNKNOWN punk, HRESULT *phr)
{
- DSFrameRateFilter *pNewObject = new DSFrameRateFilter(_T("Tdshow DirectShow Framerate Limiter Filter."), punk, phr );
- if (pNewObject == NULL) {
- *phr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
+ DSFrameRateFilter *pNewObject = new DSFrameRateFilter(_T("Tdshow DirectShow Framerate Limiter Filter."), punk, phr );
+ if (pNewObject == NULL) {
+ *phr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
diff --git a/plugins/pluginDirectShow/internals/DSFrameRateFilter.h b/plugins/pluginDirectShow/internals/DSFrameRateFilter.h
index 9f2296e..eff2bfb 100755
--- a/plugins/pluginDirectShow/internals/DSFrameRateFilter.h
+++ b/plugins/pluginDirectShow/internals/DSFrameRateFilter.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,39 +26,39 @@
class DSFrameRateFilter : public CTransInPlaceFilter
{
public:
- DSFrameRateFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr);
- ~DSFrameRateFilter(void);
+ DSFrameRateFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr);
+ ~DSFrameRateFilter(void);
public:
- HRESULT Transform(IMediaSample *pSample);
+ HRESULT Transform(IMediaSample *pSample);
HRESULT CheckInputType(const CMediaType* mtIn);
public:
- /**
- * \def SetFps
- * \brief fps1 define source .
- */
- HRESULT SetFps(int inputFps, int outputFps);
+ /**
+ * \def SetFps
+ * \brief fps1 define source .
+ */
+ HRESULT SetFps(int inputFps, int outputFps);
static CUnknown *WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *phr);
DECLARE_IUNKNOWN;
- /*STDMETHODIMP_(ULONG) NonDelegatingRelease()
- {
- if(InterlockedDecrement(&m_cRef) == 0)
- {
- delete this;
- return 0;
- }
- return m_cRef;
- }*/
+ /*STDMETHODIMP_(ULONG) NonDelegatingRelease()
+ {
+ if(InterlockedDecrement(&m_cRef) == 0)
+ {
+ delete this;
+ return 0;
+ }
+ return m_cRef;
+ }*/
private:
- int m_progress;
- int m_inputFps, m_outputFps;
- bool m_bProcessFrame;
- REFERENCE_TIME m_rtFrameLength; // UNITS/fps
- LONGLONG m_iFrameNumber;
+ int m_progress;
+ int m_inputFps, m_outputFps;
+ bool m_bProcessFrame;
+ REFERENCE_TIME m_rtFrameLength; // UNITS/fps
+ LONGLONG m_iFrameNumber;
};
#endif ////DSFrameRateFilter_H \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/DSGrabber.cxx b/plugins/pluginDirectShow/internals/DSGrabber.cxx
index e4dc3a7..18df2a3 100755
--- a/plugins/pluginDirectShow/internals/DSGrabber.cxx
+++ b/plugins/pluginDirectShow/internals/DSGrabber.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,260 +33,257 @@
using namespace std;
DSGrabber::DSGrabber(HRESULT *hr, BOOL _screenCast)
-: mutex_buffer(NULL), preview(NULL)
-, screenCast(_screenCast)
+ : mutex_buffer(NULL), preview(NULL)
+ , screenCast(_screenCast)
{
#if defined(_WIN32_WCE)
- assert(!screenCast);
- this->graph = new DSCaptureGraph(this, hr);
- CHECK_HR((*hr));
+ assert(!screenCast);
+ this->graph = new DSCaptureGraph(this, hr);
+ CHECK_HR((*hr));
#else
- this->graph = screenCast ? dynamic_cast<DSBaseCaptureGraph*>(new DSScreenCastGraph(this, hr)) : dynamic_cast<DSBaseCaptureGraph*>(new DSCaptureGraph(this, hr));
- CHECK_HR((*hr));
- this->preview = new DSDisplay(hr);
+ this->graph = screenCast ? dynamic_cast<DSBaseCaptureGraph*>(new DSScreenCastGraph(this, hr)) : dynamic_cast<DSBaseCaptureGraph*>(new DSCaptureGraph(this, hr));
+ CHECK_HR((*hr));
+ this->preview = new DSDisplay(hr);
#endif
- // Init the bitmap info header with default values
- memset(&(this->bitmapInfo), 0, sizeof(BITMAPINFOHEADER));
- this->bitmapInfo.biSize = sizeof(BITMAPINFOHEADER);
- this->bitmapInfo.biWidth = 352;
- this->bitmapInfo.biHeight = 288;
- this->bitmapInfo.biPlanes = 1;
- this->bitmapInfo.biBitCount = 24;
- this->bitmapInfo.biCompression = 0;
- this->bitmapInfo.biXPelsPerMeter = 0;
- this->bitmapInfo.biYPelsPerMeter = 0;
- this->bitmapInfo.biClrUsed = 0;
- this->bitmapInfo.biClrImportant = 0;
-
- this->plugin_cb = NULL;
- this->buffer = NULL;
- this->mutex_buffer = tsk_mutex_create();
-
-bail: ;
+ // Init the bitmap info header with default values
+ memset(&(this->bitmapInfo), 0, sizeof(BITMAPINFOHEADER));
+ this->bitmapInfo.biSize = sizeof(BITMAPINFOHEADER);
+ this->bitmapInfo.biWidth = 352;
+ this->bitmapInfo.biHeight = 288;
+ this->bitmapInfo.biPlanes = 1;
+ this->bitmapInfo.biBitCount = 24;
+ this->bitmapInfo.biCompression = 0;
+ this->bitmapInfo.biXPelsPerMeter = 0;
+ this->bitmapInfo.biYPelsPerMeter = 0;
+ this->bitmapInfo.biClrUsed = 0;
+ this->bitmapInfo.biClrImportant = 0;
+
+ this->plugin_cb = NULL;
+ this->buffer = NULL;
+ this->mutex_buffer = tsk_mutex_create();
+
+bail:
+ ;
}
DSGrabber::~DSGrabber()
{
- SAFE_DELETE_PTR ( this->graph );
- SAFE_DELETE_PTR ( this->preview );
- SAFE_DELETE_ARRAY ( this->buffer );
- tsk_mutex_destroy(&this->mutex_buffer);
+ SAFE_DELETE_PTR ( this->graph );
+ SAFE_DELETE_PTR ( this->preview );
+ SAFE_DELETE_ARRAY ( this->buffer );
+ tsk_mutex_destroy(&this->mutex_buffer);
}
void DSGrabber::setCaptureDevice(const std::string &devicePath)
{
- this->graph->setSource(devicePath);
+ this->graph->setSource(devicePath);
}
void DSGrabber::setCallback(tmedia_producer_enc_cb_f callback, const void* callback_data)
{
- this->plugin_cb = callback;
- this->plugin_cb_data = callback_data;
+ this->plugin_cb = callback;
+ this->plugin_cb_data = callback_data;
}
void DSGrabber::start()
{
- if(this->graph->isPaused()){
- this->graph->start();
- this->preview->start();
- return;
- }
-
- if (!this->graph->isRunning()){
- first_buffer = true;
-
- if(this->preview){
- this->preview->start();
- }
- this->graph->connect();
- this->graph->start();
- }
+ if(this->graph->isPaused()) {
+ this->graph->start();
+ this->preview->start();
+ return;
+ }
+
+ if (!this->graph->isRunning()) {
+ first_buffer = true;
+
+ if(this->preview) {
+ this->preview->start();
+ }
+ this->graph->connect();
+ this->graph->start();
+ }
}
void DSGrabber::pause()
{
- if(this->graph && this->graph->isRunning()){
- this->graph->pause();
- this->preview->pause();
- }
+ if(this->graph && this->graph->isRunning()) {
+ this->graph->pause();
+ this->preview->pause();
+ }
}
void DSGrabber::stop()
{
- if (this->graph->isRunning()){
- if(this->preview){
- this->preview->stop();
- }
- this->graph->stop();
- this->graph->disconnect();
- }
+ if (this->graph->isRunning()) {
+ if(this->preview) {
+ this->preview->stop();
+ }
+ this->graph->stop();
+ this->graph->disconnect();
+ }
}
bool DSGrabber::setCaptureParameters(int w, int h, int f)
{
- tsk_mutex_lock(this->mutex_buffer);
-
- // Store the framerate
- this->fps = f;
- this->width = w;
- this->height = h;
-
- // Store the required dimensions
- this->bitmapInfo.biWidth = this->width;
- this->bitmapInfo.biHeight = this->height;
- this->bitmapInfo.biBitCount = 24;
- this->bitmapInfo.biSizeImage = (this->width * this->height * 3);
-
- // Change the intermediate buffer
- SAFE_DELETE_ARRAY ( this->buffer );
- this->buffer = new BYTE[this->bitmapInfo.biSizeImage];
- memset(this->buffer,0,this->bitmapInfo.biSizeImage);
-
- // Find closest matching format to drive the source filter
- DSCaptureFormat *fmt = NULL;
- int score = 0;
- std::vector<DSCaptureFormat> *formats = this->graph->getFormats();
- std::vector<DSCaptureFormat>::iterator iter;
- std::vector<DSCaptureFormat>::iterator last = formats->end();
- for(iter = formats->begin(); iter != last; iter++){
- int value = (*iter).getMatchScore(this->width, this->height);
- if (value > score || !fmt){
- score = value;
- fmt = &(*iter);
- }
- }
-
- // Setup source filter in the graph
- HRESULT hr = this->graph->setParameters(fmt, this->fps);
- // Set preview parameters
- if(this->preview){
- this->preview->setFps(this->fps);
- this->preview->setSize(this->width, this->height);
- }
-
- tsk_mutex_unlock(this->mutex_buffer);
-
- return SUCCEEDED(hr);
+ tsk_mutex_lock(this->mutex_buffer);
+
+ // Store the framerate
+ this->fps = f;
+ this->width = w;
+ this->height = h;
+
+ // Store the required dimensions
+ this->bitmapInfo.biWidth = this->width;
+ this->bitmapInfo.biHeight = this->height;
+ this->bitmapInfo.biBitCount = 24;
+ this->bitmapInfo.biSizeImage = (this->width * this->height * 3);
+
+ // Change the intermediate buffer
+ SAFE_DELETE_ARRAY ( this->buffer );
+ this->buffer = new BYTE[this->bitmapInfo.biSizeImage];
+ memset(this->buffer,0,this->bitmapInfo.biSizeImage);
+
+ // Find closest matching format to drive the source filter
+ DSCaptureFormat *fmt = NULL;
+ int score = 0;
+ std::vector<DSCaptureFormat> *formats = this->graph->getFormats();
+ std::vector<DSCaptureFormat>::iterator iter;
+ std::vector<DSCaptureFormat>::iterator last = formats->end();
+ for(iter = formats->begin(); iter != last; iter++) {
+ int value = (*iter).getMatchScore(this->width, this->height);
+ if (value > score || !fmt) {
+ score = value;
+ fmt = &(*iter);
+ }
+ }
+
+ // Setup source filter in the graph
+ HRESULT hr = this->graph->setParameters(fmt, this->fps);
+ // Set preview parameters
+ if(this->preview) {
+ this->preview->setFps(this->fps);
+ this->preview->setSize(this->width, this->height);
+ }
+
+ tsk_mutex_unlock(this->mutex_buffer);
+
+ return SUCCEEDED(hr);
}
void DSGrabber::setPluginFirefox(bool value)
{
- if(this->preview){
- this->preview->setPluginFirefox(value);
- }
+ if(this->preview) {
+ this->preview->setPluginFirefox(value);
+ }
}
bool DSGrabber::setCaptureParameters(int format, int f)
{
- int w, h;
- // Get size from the format
- VIDEOFORMAT_TO_SIZE(format, w, h);
- return this->setCaptureParameters(w, h, f);
+ int w, h;
+ // Get size from the format
+ VIDEOFORMAT_TO_SIZE(format, w, h);
+ return this->setCaptureParameters(w, h, f);
}
int DSGrabber::getFramerate()
{
- return this->fps;
+ return this->fps;
}
HRESULT DSGrabber::getConnectedMediaType(AM_MEDIA_TYPE *mediaType)
{
- if (!this->graph || !mediaType) {
- return E_INVALIDARG;
- }
- return this->graph->getConnectedMediaType(mediaType);
+ if (!this->graph || !mediaType) {
+ return E_INVALIDARG;
+ }
+ return this->graph->getConnectedMediaType(mediaType);
}
HRESULT DSGrabber::SampleCB(double SampleTime, IMediaSample *pSample)
{
- return S_OK;
+ return S_OK;
}
HRESULT DSGrabber::BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen)
-{
- HRESULT hr;
-
- tsk_mutex_lock(this->mutex_buffer);
-
- AM_MEDIA_TYPE mediaType;
- hr = this->graph->getConnectedMediaType(&mediaType);
- if (FAILED(hr) || !this->buffer){
- return hr;
- }
-
- if(first_buffer){
- first_buffer = false;
-
- tsk_mutex_unlock(this->mutex_buffer);
- return hr;
- }
-
- // Examine the format block.
- if ((mediaType.formattype == FORMAT_VideoInfo) && (mediaType.cbFormat >= sizeof(VIDEOINFOHEADER)) && (mediaType.pbFormat != NULL) )
- {
- VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER *>(mediaType.pbFormat);
- BITMAPINFOHEADER* bih = &pVih->bmiHeader;
-
- //int framerate = pVih->AvgTimePerFrame;
- if( (bih->biHeight == this->bitmapInfo.biHeight) && (bih->biWidth == this->bitmapInfo.biWidth) && (bih->biBitCount == this->bitmapInfo.biBitCount) )
- {
- memmove(this->buffer, pBuffer, this->bitmapInfo.biSizeImage);
- }
- else
- {
- ResizeRGB(
- bih,
- (const unsigned char *) pBuffer,
- &this->bitmapInfo,
- (unsigned char *) this->buffer,
- this->width,
- this->height);
- }
-
- // for the network
- if(this->plugin_cb){
- this->plugin_cb(this->plugin_cb_data, this->buffer, (this->width*this->height*3));
- }
-
- // for the preview
- if(this->preview){
- this->preview->handleVideoFrame(this->buffer, this->width, this->height);
- }
- }
-
- // Free the format
+{
+ HRESULT hr;
+
+ tsk_mutex_lock(this->mutex_buffer);
+
+ AM_MEDIA_TYPE mediaType;
+ hr = this->graph->getConnectedMediaType(&mediaType);
+ if (FAILED(hr) || !this->buffer) {
+ return hr;
+ }
+
+ if(first_buffer) {
+ first_buffer = false;
+
+ tsk_mutex_unlock(this->mutex_buffer);
+ return hr;
+ }
+
+ // Examine the format block.
+ if ((mediaType.formattype == FORMAT_VideoInfo) && (mediaType.cbFormat >= sizeof(VIDEOINFOHEADER)) && (mediaType.pbFormat != NULL) ) {
+ VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER *>(mediaType.pbFormat);
+ BITMAPINFOHEADER* bih = &pVih->bmiHeader;
+
+ //int framerate = pVih->AvgTimePerFrame;
+ if( (bih->biHeight == this->bitmapInfo.biHeight) && (bih->biWidth == this->bitmapInfo.biWidth) && (bih->biBitCount == this->bitmapInfo.biBitCount) ) {
+ memmove(this->buffer, pBuffer, this->bitmapInfo.biSizeImage);
+ }
+ else {
+ ResizeRGB(
+ bih,
+ (const unsigned char *) pBuffer,
+ &this->bitmapInfo,
+ (unsigned char *) this->buffer,
+ this->width,
+ this->height);
+ }
+
+ // for the network
+ if(this->plugin_cb) {
+ this->plugin_cb(this->plugin_cb_data, this->buffer, (this->width*this->height*3));
+ }
+
+ // for the preview
+ if(this->preview) {
+ this->preview->handleVideoFrame(this->buffer, this->width, this->height);
+ }
+ }
+
+ // Free the format
#ifdef _WIN32_WCE
- // Nothing had been allocated
+ // Nothing had been allocated
#else
- FreeMediaType(mediaType);
+ FreeMediaType(mediaType);
#endif
- tsk_mutex_unlock(this->mutex_buffer);
+ tsk_mutex_unlock(this->mutex_buffer);
- return hr;
+ return hr;
}
HRESULT DSGrabber::QueryInterface(REFIID iid, LPVOID *ppv)
{
#ifdef _WIN32_WCE
- assert(1==0);
+ assert(1==0);
#else
- if( iid == IID_ISampleGrabberCB || iid == IID_IUnknown )
- {
- *ppv = (void *) static_cast<ISampleGrabberCB*>(this);
- return NOERROR;
- }
+ if( iid == IID_ISampleGrabberCB || iid == IID_IUnknown ) {
+ *ppv = (void *) static_cast<ISampleGrabberCB*>(this);
+ return NOERROR;
+ }
#endif
- return E_NOINTERFACE;
+ return E_NOINTERFACE;
}
ULONG DSGrabber::AddRef()
{
- return 2;
+ return 2;
}
ULONG DSGrabber::Release()
{
- return 1;
+ return 1;
} \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/DSGrabber.h b/plugins/pluginDirectShow/internals/DSGrabber.h
index 64cde75..3445fb3 100755
--- a/plugins/pluginDirectShow/internals/DSGrabber.h
+++ b/plugins/pluginDirectShow/internals/DSGrabber.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -36,57 +36,57 @@ class DSDisplay;
class DSGrabber : public
#if defined(_WIN32_WCE)
- DSISampleGrabberCB
+ DSISampleGrabberCB
#else
- ISampleGrabberCB
+ ISampleGrabberCB
#endif
{
public:
- DSGrabber(HRESULT *hr, BOOL screenCast);
- virtual ~DSGrabber();
+ DSGrabber(HRESULT *hr, BOOL screenCast);
+ virtual ~DSGrabber();
- void setCallback(tmedia_producer_enc_cb_f callback, const void* callback_data);
- void setCaptureDevice(const std::string &devicePath);
+ void setCallback(tmedia_producer_enc_cb_f callback, const void* callback_data);
+ void setCaptureDevice(const std::string &devicePath);
- virtual void start();
- virtual void pause();
- virtual void stop();
+ virtual void start();
+ virtual void pause();
+ virtual void stop();
- virtual bool setCaptureParameters(int format, int f);
- virtual bool setCaptureParameters(int w, int h, int f);
+ virtual bool setCaptureParameters(int format, int f);
+ virtual bool setCaptureParameters(int w, int h, int f);
- virtual void setPluginFirefox(bool value);
+ virtual void setPluginFirefox(bool value);
- virtual int getFramerate();
- virtual HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
+ virtual int getFramerate();
+ virtual HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
- virtual HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample);
+ virtual HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample);
virtual HRESULT STDMETHODCALLTYPE BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen);
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
- virtual ULONG STDMETHODCALLTYPE AddRef();
- virtual ULONG STDMETHODCALLTYPE Release();
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef();
+ virtual ULONG STDMETHODCALLTYPE Release();
- DSDisplay *preview;
+ DSDisplay *preview;
private:
- int width;
- int height;
- int fps;
+ int width;
+ int height;
+ int fps;
- DSBaseCaptureGraph *graph;
+ DSBaseCaptureGraph *graph;
- //VideoFrame *currentFrame;
- BITMAPINFOHEADER bitmapInfo;
- BYTE *buffer;
+ //VideoFrame *currentFrame;
+ BITMAPINFOHEADER bitmapInfo;
+ BYTE *buffer;
- tsk_mutex_handle_t *mutex_buffer;
+ tsk_mutex_handle_t *mutex_buffer;
- BOOL first_buffer;
- BOOL screenCast;
+ BOOL first_buffer;
+ BOOL screenCast;
- const void* plugin_cb_data;
- tmedia_producer_enc_cb_f plugin_cb;
+ const void* plugin_cb_data;
+ tmedia_producer_enc_cb_f plugin_cb;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSOutputFilter.cxx b/plugins/pluginDirectShow/internals/DSOutputFilter.cxx
index ab5aa0f..7efbcc6 100755
--- a/plugins/pluginDirectShow/internals/DSOutputFilter.cxx
+++ b/plugins/pluginDirectShow/internals/DSOutputFilter.cxx
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,91 +23,92 @@
#include "tsk_memory.h"
-DSOutputFilter::DSOutputFilter(LPUNKNOWN pUnk, HRESULT *phr)
-: CSource(_T("TDSHOW_OUTPUT"), pUnk, CLSID_TdshowOutputFilter)
+DSOutputFilter::DSOutputFilter(LPUNKNOWN pUnk, HRESULT *phr)
+ : CSource(_T("TDSHOW_OUTPUT"), pUnk, CLSID_TdshowOutputFilter)
{
#if !(defined(_WIN32_WCE) && defined(_DEBUG))
CAutoLock cAutoLock(&m_cStateLock);
#endif
- // Add one source stream (output pin)!
- this->outputStream = new DSOutputStream(phr, this, _T("Out"));
+ // Add one source stream (output pin)!
+ this->outputStream = new DSOutputStream(phr, this, _T("Out"));
}
DSOutputFilter::~DSOutputFilter()
{
- //SAFE_RELEASE(this->outputStream);
+ //SAFE_RELEASE(this->outputStream);
}
void DSOutputFilter::setBuffer(void *pointer, int size)
{
- this->outputStream->lockBuffer();
- if(pointer && size){
- if(this->outputStream->buffer_size != size){
- if((this->outputStream->buffer = tsk_realloc(this->outputStream->buffer, size))){
- this->outputStream->buffer_size = size;
- }
- else goto done;
- }
- memcpy(this->outputStream->buffer, pointer, size);
- }
+ this->outputStream->lockBuffer();
+ if(pointer && size) {
+ if(this->outputStream->buffer_size != size) {
+ if((this->outputStream->buffer = tsk_realloc(this->outputStream->buffer, size))) {
+ this->outputStream->buffer_size = size;
+ }
+ else {
+ goto done;
+ }
+ }
+ memcpy(this->outputStream->buffer, pointer, size);
+ }
done:
- this->outputStream->unlockBuffer();
+ this->outputStream->unlockBuffer();
}
void DSOutputFilter::getMediaType(AM_MEDIA_TYPE* &pmt)
{
- //if(pmt)
- //{
- // memcpy(pmt, &this->outputStream->pmt, sizeof(AM_MEDIA_TYPE));
- //}
+ //if(pmt)
+ //{
+ // memcpy(pmt, &this->outputStream->pmt, sizeof(AM_MEDIA_TYPE));
+ //}
}
HRESULT DSOutputFilter::setMediaType(const AM_MEDIA_TYPE* pmt)
{
- return this->ReconnectPin(this->outputStream, pmt);
+ return this->ReconnectPin(this->outputStream, pmt);
}
HRESULT DSOutputFilter::setImageFormat(UINT width, UINT height)
{
- return this->outputStream->setImageFormat(width, height);
+ return this->outputStream->setImageFormat(width, height);
}
bool DSOutputFilter::getImageFormat(UINT &width, UINT &height)
{
- if(this->outputStream){
- return this->outputStream->getImageFormat(width, height);
- }
- return false;
+ if(this->outputStream) {
+ return this->outputStream->getImageFormat(width, height);
+ }
+ return false;
}
void DSOutputFilter::setFps(int fps_)
{
- this->outputStream->setFps(fps_);
+ this->outputStream->setFps(fps_);
}
void DSOutputFilter::showOverlay(int value)
{
- this->outputStream->showOverlay(value);
+ this->outputStream->showOverlay(value);
}
void DSOutputFilter::reset()
{
- this->outputStream->frameNumber = 0;
- this->outputStream->lockBuffer();
- this->outputStream->buffer = NULL;
- this->outputStream->buffer_size = 0;
- this->outputStream->unlockBuffer();
+ this->outputStream->frameNumber = 0;
+ this->outputStream->lockBuffer();
+ this->outputStream->buffer = NULL;
+ this->outputStream->buffer_size = 0;
+ this->outputStream->unlockBuffer();
}
#ifdef _WIN32_WCE
STDMETHODIMP_(ULONG) DSOutputFilter::NonDelegatingRelease()
{
- if(InterlockedDecrement(&m_cRef) == 0)
- {
- delete this;
- return 0;
- }
- return m_cRef;
+ if(InterlockedDecrement(&m_cRef) == 0) {
+ delete this;
+ return 0;
+ }
+ return m_cRef;
}
#endif
diff --git a/plugins/pluginDirectShow/internals/DSOutputFilter.h b/plugins/pluginDirectShow/internals/DSOutputFilter.h
index fea2d23..eb424c4 100755
--- a/plugins/pluginDirectShow/internals/DSOutputFilter.h
+++ b/plugins/pluginDirectShow/internals/DSOutputFilter.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,87 +26,87 @@
class DSOutputStream;
// {17D9D5CB-850D-4339-B72A-F72D084D8D64}
-TDSHOW_DEFINE_GUID(CLSID_TdshowOutputFilter,
-0x17d9d5cb, 0x850d, 0x4339, 0xb7, 0x2a, 0xf7, 0x2d, 0x8, 0x4d, 0x8d, 0x64);
+TDSHOW_DEFINE_GUID(CLSID_TdshowOutputFilter,
+ 0x17d9d5cb, 0x850d, 0x4339, 0xb7, 0x2a, 0xf7, 0x2d, 0x8, 0x4d, 0x8d, 0x64);
class DSOutputFilter : public CSource, public DSBufferWriter
{
public:
- DSOutputFilter(LPUNKNOWN pUnk, HRESULT *phr);
- virtual ~DSOutputFilter();
-
- //static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
- DECLARE_IUNKNOWN;
-
- virtual void setBuffer(void *pointer, int size);
- virtual inline HRESULT setImageFormat(UINT width, UINT height);
- virtual bool getImageFormat(UINT &width, UINT &height);
+ DSOutputFilter(LPUNKNOWN pUnk, HRESULT *phr);
+ virtual ~DSOutputFilter();
+
+ //static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
+ DECLARE_IUNKNOWN;
+
+ virtual void setBuffer(void *pointer, int size);
+ virtual inline HRESULT setImageFormat(UINT width, UINT height);
+ virtual bool getImageFormat(UINT &width, UINT &height);
- virtual void setFps(int fps_);
- virtual void showOverlay(int value);
+ virtual void setFps(int fps_);
+ virtual void showOverlay(int value);
- virtual void getMediaType(AM_MEDIA_TYPE* &pmt);
- virtual HRESULT setMediaType(const AM_MEDIA_TYPE* pmt);
+ virtual void getMediaType(AM_MEDIA_TYPE* &pmt);
+ virtual HRESULT setMediaType(const AM_MEDIA_TYPE* pmt);
- void reset();
+ void reset();
#ifdef _WIN32_WCE
- STDMETHODIMP_(ULONG) NonDelegatingRelease();
+ STDMETHODIMP_(ULONG) NonDelegatingRelease();
#endif
//protected:
#ifdef _WIN32_WCE
- /*STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
- {
- CheckPointer(ppv, E_POINTER);
-
- if (riid == IID_IBaseFilter
- || riid == IID_IBaseFilter
- || riid == IID_IUnknown
- || riid == IID_IMediaFilter
- )
- {
- return GetInterface((IBaseFilter *) this, ppv);
- }
- else
- {
- *ppv = NULL;
- return E_NOINTERFACE;
- }
+ /*STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+ {
+ CheckPointer(ppv, E_POINTER);
+
+ if (riid == IID_IBaseFilter
+ || riid == IID_IBaseFilter
+ || riid == IID_IUnknown
+ || riid == IID_IMediaFilter
+ )
+ {
+ return GetInterface((IBaseFilter *) this, ppv);
+ }
+ else
+ {
+ *ppv = NULL;
+ return E_NOINTERFACE;
+ }
};
STDMETHODIMP_(ULONG) AddRef() {
- //return GetOwner()->AddRef();
- //return 1;
- return (ULONG)InterlockedIncrement(&m_cRef);
+ //return GetOwner()->AddRef();
+ //return 1;
+ return (ULONG)InterlockedIncrement(&m_cRef);
};
STDMETHODIMP_(ULONG) Release() {
LONG lRefCount = InterlockedDecrement(&m_cRef);
- if(m_cRef < 1) delete this;
- return (ULONG)m_cRef;
+ if(m_cRef < 1) delete this;
+ return (ULONG)m_cRef;
};
- STDMETHODIMP_(ULONG) NonDelegatingAddRef()
- {
- return InterlockedIncrement(&m_cRef);
- }*/
+ STDMETHODIMP_(ULONG) NonDelegatingAddRef()
+ {
+ return InterlockedIncrement(&m_cRef);
+ }*/
#endif
-/*
- STDMETHODIMP_(ULONG) NonDelegatingRelease()
- {
- if(InterlockedDecrement(&m_cRef) == 0)
- {
- delete this;
- return 0;
- }
- return m_cRef;
- }*/
+ /*
+ STDMETHODIMP_(ULONG) NonDelegatingRelease()
+ {
+ if(InterlockedDecrement(&m_cRef) == 0)
+ {
+ delete this;
+ return 0;
+ }
+ return m_cRef;
+ }*/
private:
- DSOutputStream *outputStream;
+ DSOutputStream *outputStream;
- friend class DSOutputStream;
+ friend class DSOutputStream;
};
#endif
diff --git a/plugins/pluginDirectShow/internals/DSOutputStream.cxx b/plugins/pluginDirectShow/internals/DSOutputStream.cxx
index 670d0ae..1e13d78 100755
--- a/plugins/pluginDirectShow/internals/DSOutputStream.cxx
+++ b/plugins/pluginDirectShow/internals/DSOutputStream.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -34,280 +34,281 @@ using namespace std;
#define OVERLAY_TEXT TEXT("Press ESC to exit full screen mode")
#define OVERLAY_DURATION 3 // in seconds
-DSOutputStream::DSOutputStream(HRESULT *phr, DSOutputFilter *pParent, LPCWSTR pPinName)
-: CSourceStream(_T("DSOutputStream"), phr, pParent, pPinName)
+DSOutputStream::DSOutputStream(HRESULT *phr, DSOutputFilter *pParent, LPCWSTR pPinName)
+ : CSourceStream(_T("DSOutputStream"), phr, pParent, pPinName)
{
#if !(defined(_WIN32_WCE) && defined(_DEBUG))
- CAutoLock cAutoLock(m_pFilter->pStateLock());
+ CAutoLock cAutoLock(m_pFilter->pStateLock());
#endif
- this->buffer = NULL;
- this->buffer_size = NULL;
+ this->buffer = NULL;
+ this->buffer_size = NULL;
- this->frameNumber = 0;
- this->frameLength = (1000)/DEFAULT_FPS;
- this->fps = DEFAULT_FPS;
+ this->frameNumber = 0;
+ this->frameLength = (1000)/DEFAULT_FPS;
+ this->fps = DEFAULT_FPS;
- this->width = 352;
- this->height = 288;
+ this->width = 352;
+ this->height = 288;
- this->overlay = false;
+ this->overlay = false;
- this->paintBuffer = NULL;
- this->paintDC = NULL;
- this->hDibSection = NULL;
- this->hObject = NULL;
+ this->paintBuffer = NULL;
+ this->paintDC = NULL;
+ this->hDibSection = NULL;
+ this->hObject = NULL;
- this->mutex = tsk_mutex_create();
+ this->mutex = tsk_mutex_create();
}
DSOutputStream::~DSOutputStream()
{
- TSK_FREE(this->buffer);
- tsk_mutex_destroy(&this->mutex);
- // TODO : Is there anything to free ???
+ TSK_FREE(this->buffer);
+ tsk_mutex_destroy(&this->mutex);
+ // TODO : Is there anything to free ???
}
void DSOutputStream::setFps(int fps_)
{
- this->fps = fps_;
- this->frameLength = (1000)/this->fps;
+ this->fps = fps_;
+ this->frameLength = (1000)/this->fps;
}
void DSOutputStream::showOverlay(int value)
{
- if (value == 0){
- this->overlay = false;
- }
- this->overlay = (value > 0);
+ if (value == 0) {
+ this->overlay = false;
+ }
+ this->overlay = (value > 0);
}
HRESULT DSOutputStream::setImageFormat(UINT width, UINT height)
{
- if ((this->width == width) && (this->height == height)) return S_FALSE;
+ if ((this->width == width) && (this->height == height)) {
+ return S_FALSE;
+ }
- this->width = width;
- this->height = height;
+ this->width = width;
+ this->height = height;
- this->frameNumber = 0;
+ this->frameNumber = 0;
- return S_OK;
+ return S_OK;
}
bool DSOutputStream::getImageFormat(UINT &width, UINT &height)
{
- width = this->width;
- height = this->height;
- return true;
+ width = this->width;
+ height = this->height;
+ return true;
}
HRESULT DSOutputStream::GetMediaType(CMediaType *pMediaType)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
#if !(defined(_WIN32_WCE) && defined(_DEBUG))
- CAutoLock lock(m_pFilter->pStateLock());
+ CAutoLock lock(m_pFilter->pStateLock());
#endif
- ZeroMemory(pMediaType, sizeof(CMediaType));
-
- VIDEOINFO *pvi = (VIDEOINFO *)pMediaType->AllocFormatBuffer(sizeof(VIDEOINFO));
- if (NULL == pvi)
- return E_OUTOFMEMORY;
-
- ZeroMemory(pvi, sizeof(VIDEOINFO));
-
- pvi->bmiHeader.biCompression = BI_RGB;
- pvi->bmiHeader.biBitCount = 24;
- pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pvi->bmiHeader.biWidth = this->width;
- pvi->bmiHeader.biHeight = this->height;
- pvi->bmiHeader.biPlanes = 1;
- pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
- pvi->bmiHeader.biClrImportant = 0;
-
- // Frame rate
- pvi->AvgTimePerFrame = DS_MILLIS_TO_100NS(1000/this->fps);
-
- SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
- SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
-
- pMediaType->SetType(&MEDIATYPE_Video);
- pMediaType->SetFormatType(&FORMAT_VideoInfo);
- pMediaType->SetTemporalCompression(FALSE);
-
- pMediaType->SetSubtype(&MEDIASUBTYPE_RGB24);
- pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);
-
- bitmapInfo.bmiHeader = pvi->bmiHeader;
-
- return hr;
+ ZeroMemory(pMediaType, sizeof(CMediaType));
+
+ VIDEOINFO *pvi = (VIDEOINFO *)pMediaType->AllocFormatBuffer(sizeof(VIDEOINFO));
+ if (NULL == pvi) {
+ return E_OUTOFMEMORY;
+ }
+
+ ZeroMemory(pvi, sizeof(VIDEOINFO));
+
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 24;
+ pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ pvi->bmiHeader.biWidth = this->width;
+ pvi->bmiHeader.biHeight = this->height;
+ pvi->bmiHeader.biPlanes = 1;
+ pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
+ pvi->bmiHeader.biClrImportant = 0;
+
+ // Frame rate
+ pvi->AvgTimePerFrame = DS_MILLIS_TO_100NS(1000/this->fps);
+
+ SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
+ SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
+
+ pMediaType->SetType(&MEDIATYPE_Video);
+ pMediaType->SetFormatType(&FORMAT_VideoInfo);
+ pMediaType->SetTemporalCompression(FALSE);
+
+ pMediaType->SetSubtype(&MEDIASUBTYPE_RGB24);
+ pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);
+
+ bitmapInfo.bmiHeader = pvi->bmiHeader;
+
+ return hr;
}
HRESULT DSOutputStream::DecideBufferSize(IMemAllocator *pMemAlloc, ALLOCATOR_PROPERTIES *pProperties)
{
- CheckPointer(pMemAlloc, E_POINTER);
- CheckPointer(pProperties, E_POINTER);
+ CheckPointer(pMemAlloc, E_POINTER);
+ CheckPointer(pProperties, E_POINTER);
#if !(defined(_WIN32_WCE) && defined(_DEBUG))
- CAutoLock cAutoLock(m_pFilter->pStateLock());
+ CAutoLock cAutoLock(m_pFilter->pStateLock());
#endif
- HRESULT hr = NOERROR;
-
- VIDEOINFO *pvi = (VIDEOINFO *) m_mt.Format();
- pProperties->cBuffers = 1;
- pProperties->cbBuffer = pvi->bmiHeader.biSizeImage;
-
- // Ask the allocator to reserve us some sample memory. NOTE: the function
- // can succeed (return NOERROR) but still not have allocated the
- // memory that we requested, so we must check we got whatever we wanted.
- ALLOCATOR_PROPERTIES Actual;
- hr = pMemAlloc->SetProperties(pProperties,&Actual);
- if(FAILED(hr)){
- return hr;
- }
-
- // Is this allocator unsuitable?
- if(Actual.cbBuffer < pProperties->cbBuffer)
- {
- return E_FAIL;
- }
-
- // Make sure that we have only 1 buffer (we erase the ball in the
- // old buffer to save having to zero a 200k+ buffer every time
- // we draw a frame)
- return NOERROR;
+ HRESULT hr = NOERROR;
+
+ VIDEOINFO *pvi = (VIDEOINFO *) m_mt.Format();
+ pProperties->cBuffers = 1;
+ pProperties->cbBuffer = pvi->bmiHeader.biSizeImage;
+
+ // Ask the allocator to reserve us some sample memory. NOTE: the function
+ // can succeed (return NOERROR) but still not have allocated the
+ // memory that we requested, so we must check we got whatever we wanted.
+ ALLOCATOR_PROPERTIES Actual;
+ hr = pMemAlloc->SetProperties(pProperties,&Actual);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Is this allocator unsuitable?
+ if(Actual.cbBuffer < pProperties->cbBuffer) {
+ return E_FAIL;
+ }
+
+ // Make sure that we have only 1 buffer (we erase the ball in the
+ // old buffer to save having to zero a 200k+ buffer every time
+ // we draw a frame)
+ return NOERROR;
}
HRESULT DSOutputStream::OnThreadCreate()
{
#if OVERLAY
- hDibSection = CreateDIBSection(NULL, (BITMAPINFO *) &bitmapInfo, DIB_RGB_COLORS, &paintBuffer, NULL, 0);
+ hDibSection = CreateDIBSection(NULL, (BITMAPINFO *) &bitmapInfo, DIB_RGB_COLORS, &paintBuffer, NULL, 0);
- HDC hDC = GetDC(NULL);
- paintDC = CreateCompatibleDC(hDC);
- SetMapMode(paintDC, GetMapMode(hDC));
- SetBkMode(paintDC, TRANSPARENT);
- SetTextColor(paintDC, RGB(255,255,255));
+ HDC hDC = GetDC(NULL);
+ paintDC = CreateCompatibleDC(hDC);
+ SetMapMode(paintDC, GetMapMode(hDC));
+ SetBkMode(paintDC, TRANSPARENT);
+ SetTextColor(paintDC, RGB(255,255,255));
- hObject = SelectObject(paintDC, hDibSection);
+ hObject = SelectObject(paintDC, hDibSection);
#endif
- return CSourceStream::OnThreadCreate();
+ return CSourceStream::OnThreadCreate();
}
HRESULT DSOutputStream::OnThreadDestroy()
{
#if OVERLAY
- if (paintDC) DeleteDC(paintDC);
- if (hObject) DeleteObject(hObject);
-
- if (paintBuffer)
- {
- //delete[] paintBuffer; // will be done
- //paintBuffer = NULL;
- }
+ if (paintDC) {
+ DeleteDC(paintDC);
+ }
+ if (hObject) {
+ DeleteObject(hObject);
+ }
+
+ if (paintBuffer) {
+ //delete[] paintBuffer; // will be done
+ //paintBuffer = NULL;
+ }
#endif
- return CSourceStream::OnThreadDestroy();
+ return CSourceStream::OnThreadDestroy();
}
inline HRESULT DSOutputStream::DrawOverLay(void *pBuffer, long lSize)
{
- // called only #if OVERLAY
- CopyMemory(paintBuffer, pBuffer, lSize);
+ // called only #if OVERLAY
+ CopyMemory(paintBuffer, pBuffer, lSize);
- // Draw the current frame
+ // Draw the current frame
#ifdef _WIN32_WCE
-
+
#else
- if( !TextOut( paintDC, 0, 0, OVERLAY_TEXT, (int)_tcslen( OVERLAY_TEXT ) ) ) return E_FAIL;
+ if( !TextOut( paintDC, 0, 0, OVERLAY_TEXT, (int)_tcslen( OVERLAY_TEXT ) ) ) {
+ return E_FAIL;
+ }
#endif
-
- CopyMemory(pBuffer, paintBuffer, lSize);
- return S_OK;
+ CopyMemory(pBuffer, paintBuffer, lSize);
+
+ return S_OK;
}
static __inline void TransfertBuffer(void* src, void* dest, long lSize)
{
- __try
- {
+ __try {
#if MEMCPY_WORKAROUND
- //#ifdef _WIN32_WCE
- memmove(dest, src, lSize);
- /*#else
- unsigned char * pDst = (unsigned char *) dest;
-
- if(src){
- unsigned char const * pSrc = (unsigned char const *) src;
- for( register int i=0; ((i< lSize) && src); i++) *pDst++ = *pSrc++;
- }else{
- for( register int i=0; i< lSize; i++) *pDst++ = 0;
- }
- #endif*/
+ //#ifdef _WIN32_WCE
+ memmove(dest, src, lSize);
+ /*#else
+ unsigned char * pDst = (unsigned char *) dest;
+
+ if(src){
+ unsigned char const * pSrc = (unsigned char const *) src;
+ for( register int i=0; ((i< lSize) && src); i++) *pDst++ = *pSrc++;
+ }else{
+ for( register int i=0; i< lSize; i++) *pDst++ = 0;
+ }
+ #endif*/
#else
- CopyMemory(dest, src, lSize); //BUGGY
+ CopyMemory(dest, src, lSize); //BUGGY
#endif
- }
- __except(EXCEPTION_ACCESS_VIOLATION == GetExceptionCode())
- {
- //ZeroMemory(dest, sizeof(void*));
- }
+ }
+ __except(EXCEPTION_ACCESS_VIOLATION == GetExceptionCode()) {
+ //ZeroMemory(dest, sizeof(void*));
+ }
}
HRESULT DSOutputStream::FillBuffer(IMediaSample *pSample)
{
- CheckPointer(pSample, E_POINTER);
+ CheckPointer(pSample, E_POINTER);
#if !(defined(_WIN32_WCE) && defined(_DEBUG))
- CAutoLock lock(m_pFilter->pStateLock());
+ CAutoLock lock(m_pFilter->pStateLock());
#endif
- HRESULT hr;
- BYTE *pBuffer = NULL;
- long lSize, lDataSize;
+ HRESULT hr;
+ BYTE *pBuffer = NULL;
+ long lSize, lDataSize;
- hr = pSample->GetPointer(&pBuffer);
- if (SUCCEEDED(hr))
- {
- lDataSize = lSize = pSample->GetSize();
+ hr = pSample->GetPointer(&pBuffer);
+ if (SUCCEEDED(hr)) {
+ lDataSize = lSize = pSample->GetSize();
- // Check that we're still using video
- //ASSERT(m_mt.formattype == FORMAT_VideoInfo);
+ // Check that we're still using video
+ //ASSERT(m_mt.formattype == FORMAT_VideoInfo);
- if (this->buffer)
- {
+ if (this->buffer) {
#if OVERLAY
- if (this->overlay)
- {
- DrawOverLay(this->buffer, lSize);
- }
+ if (this->overlay) {
+ DrawOverLay(this->buffer, lSize);
+ }
#endif
- // Why try do not work, see: http://msdn2.microsoft.com/en-us/library/xwtb73ad(vs.80).aspx
- this->lockBuffer();
- lDataSize = TSK_MIN(lSize, this->buffer_size);
- TransfertBuffer(this->buffer, (void*)pBuffer, lDataSize);
- this->unlockBuffer();
- }
- else
- {
- // Avoid caching last image
- memset((void*)pBuffer, NULL, lSize);
- }
-
- REFERENCE_TIME rtStart = DS_MILLIS_TO_100NS(this->frameNumber * this->frameLength);
- REFERENCE_TIME rtStop = rtStart + DS_MILLIS_TO_100NS(this->frameLength);
-
- this->frameNumber++;
-
- pSample->SetTime(&rtStart, &rtStop);
- //pSample->SetMediaTime(&rtStart, &rtStop);
- pSample->SetActualDataLength(lDataSize);
- pSample->SetPreroll(FALSE);
- pSample->SetDiscontinuity(FALSE);
- }
-
- // Set TRUE on every sample for uncompressed frames (KEYFRAME)
- pSample->SetSyncPoint(TRUE);
-
- return S_OK;
+ // Why try do not work, see: http://msdn2.microsoft.com/en-us/library/xwtb73ad(vs.80).aspx
+ this->lockBuffer();
+ lDataSize = TSK_MIN(lSize, this->buffer_size);
+ TransfertBuffer(this->buffer, (void*)pBuffer, lDataSize);
+ this->unlockBuffer();
+ }
+ else {
+ // Avoid caching last image
+ memset((void*)pBuffer, NULL, lSize);
+ }
+
+ REFERENCE_TIME rtStart = DS_MILLIS_TO_100NS(this->frameNumber * this->frameLength);
+ REFERENCE_TIME rtStop = rtStart + DS_MILLIS_TO_100NS(this->frameLength);
+
+ this->frameNumber++;
+
+ pSample->SetTime(&rtStart, &rtStop);
+ //pSample->SetMediaTime(&rtStart, &rtStop);
+ pSample->SetActualDataLength(lDataSize);
+ pSample->SetPreroll(FALSE);
+ pSample->SetDiscontinuity(FALSE);
+ }
+
+ // Set TRUE on every sample for uncompressed frames (KEYFRAME)
+ pSample->SetSyncPoint(TRUE);
+
+ return S_OK;
}
diff --git a/plugins/pluginDirectShow/internals/DSOutputStream.h b/plugins/pluginDirectShow/internals/DSOutputStream.h
index db3ede4..211bdd8 100755
--- a/plugins/pluginDirectShow/internals/DSOutputStream.h
+++ b/plugins/pluginDirectShow/internals/DSOutputStream.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -29,61 +29,63 @@ class DSOutputFilter;
class DSOutputStream : public CSourceStream
{
public:
- DSOutputStream(HRESULT *phr, DSOutputFilter *pParent, LPCWSTR pPinName);
- virtual ~DSOutputStream();
-
- void setFps(int fps_);
- void showOverlay(int value);
-
- HRESULT setImageFormat(UINT width, UINT height);
- bool getImageFormat(UINT &width, UINT &height);
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) { return E_NOTIMPL; };
- inline bool lockBuffer() {
- if (this->mutex) {
- return tsk_mutex_lock(this->mutex) == 0;
- }
- return false;
- }
- inline bool unlockBuffer() {
- if (this->mutex) {
- return tsk_mutex_unlock(this->mutex) == 0;
- }
- return false;
- }
+ DSOutputStream(HRESULT *phr, DSOutputFilter *pParent, LPCWSTR pPinName);
+ virtual ~DSOutputStream();
+
+ void setFps(int fps_);
+ void showOverlay(int value);
+
+ HRESULT setImageFormat(UINT width, UINT height);
+ bool getImageFormat(UINT &width, UINT &height);
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
+ return E_NOTIMPL;
+ };
+ inline bool lockBuffer() {
+ if (this->mutex) {
+ return tsk_mutex_lock(this->mutex) == 0;
+ }
+ return false;
+ }
+ inline bool unlockBuffer() {
+ if (this->mutex) {
+ return tsk_mutex_unlock(this->mutex) == 0;
+ }
+ return false;
+ }
public:
- void *buffer;
- int buffer_size;
- LONGLONG frameNumber;
+ void *buffer;
+ int buffer_size;
+ LONGLONG frameNumber;
protected: // Overrides
- HRESULT GetMediaType(CMediaType *pMediaType);
- HRESULT DecideBufferSize(IMemAllocator *pMemAlloc, ALLOCATOR_PROPERTIES *pProperties);
- HRESULT OnThreadCreate();
- HRESULT OnThreadDestroy();
- HRESULT FillBuffer(IMediaSample *pSample);
+ HRESULT GetMediaType(CMediaType *pMediaType);
+ HRESULT DecideBufferSize(IMemAllocator *pMemAlloc, ALLOCATOR_PROPERTIES *pProperties);
+ HRESULT OnThreadCreate();
+ HRESULT OnThreadDestroy();
+ HRESULT FillBuffer(IMediaSample *pSample);
private:
- inline HRESULT DrawOverLay(void *pBuffer, long lSize);
+ inline HRESULT DrawOverLay(void *pBuffer, long lSize);
private:
- // TIMING
- REFERENCE_TIME frameLength;
- int fps;
-
- // sizing
- UINT width;
- UINT height;
-
- // overlaying
- bool overlay;
- BITMAPINFO bitmapInfo;
- void *paintBuffer;
- HDC paintDC;
- HBITMAP hDibSection;
- HGDIOBJ hObject;
-
- tsk_mutex_handle_t* mutex;
+ // TIMING
+ REFERENCE_TIME frameLength;
+ int fps;
+
+ // sizing
+ UINT width;
+ UINT height;
+
+ // overlaying
+ bool overlay;
+ BITMAPINFO bitmapInfo;
+ void *paintBuffer;
+ HDC paintDC;
+ HBITMAP hDibSection;
+ HGDIOBJ hObject;
+
+ tsk_mutex_handle_t* mutex;
};
diff --git a/plugins/pluginDirectShow/internals/DSPushSource.h b/plugins/pluginDirectShow/internals/DSPushSource.h
index 140d9bd..e78c47e 100755
--- a/plugins/pluginDirectShow/internals/DSPushSource.h
+++ b/plugins/pluginDirectShow/internals/DSPushSource.h
@@ -12,7 +12,7 @@
#include <strsafe.h>
-// UNITS = 10 ^ 7
+// UNITS = 10 ^ 7
// UNITS / 30 = 30 fps;
// UNITS / 20 = 20 fps, etc
const REFERENCE_TIME FPS_30 = UNITS / 30;
@@ -35,8 +35,8 @@ const REFERENCE_TIME rtDefaultFrameLength = FPS_10;
#define NUM_FILES 5
// {3FD3081A-A8C9-4958-9F75-07EC89690024}
-TDSHOW_DEFINE_GUID(CLSID_PushSourceDesktop,
-0x3fd3081a, 0xa8c9, 0x4958, 0x9f, 0x75, 0x7, 0xec, 0x89, 0x69, 0x0, 0x24);
+TDSHOW_DEFINE_GUID(CLSID_PushSourceDesktop,
+ 0x3fd3081a, 0xa8c9, 0x4958, 0x9f, 0x75, 0x7, 0xec, 0x89, 0x69, 0x0, 0x24);
@@ -56,11 +56,11 @@ protected:
BITMAPINFO *m_pBmi; // Pointer to the bitmap header
DWORD m_cbBitmapInfo; // Size of the bitmap header
-
- // File opening variables
- HANDLE m_hFile; // Handle returned from CreateFile
+
+ // File opening variables
+ HANDLE m_hFile; // Handle returned from CreateFile
BYTE * m_pFile; // Points to beginning of file buffer
- BYTE * m_pImage; // Points to pixel bits
+ BYTE * m_pImage; // Points to pixel bits
int m_iFrameNumber;
const REFERENCE_TIME m_rtFrameLength;
@@ -77,13 +77,12 @@ public:
HRESULT GetMediaType(CMediaType *pMediaType);
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
@@ -100,11 +99,11 @@ protected:
BITMAPINFO *m_pBmi[NUM_FILES]; // Pointer to the bitmap headers
DWORD m_cbBitmapInfo[NUM_FILES]; // Size of the bitmap headers
-
- // File opening variables
- HANDLE m_hFile[NUM_FILES]; // Handles returned from CreateFile
+
+ // File opening variables
+ HANDLE m_hFile[NUM_FILES]; // Handles returned from CreateFile
BYTE * m_pFile[NUM_FILES]; // Points to beginning of file buffers
- BYTE * m_pImage[NUM_FILES]; // Points to pixel bits
+ BYTE * m_pImage[NUM_FILES]; // Points to pixel bits
BOOL m_bFilesLoaded;
int m_iCurrentBitmap; // Which bitmap is being displayed
@@ -123,13 +122,12 @@ public:
HRESULT GetMediaType(CMediaType *pMediaType);
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
@@ -158,7 +156,7 @@ protected:
CCritSec m_cSharedState; // Protects our internal state
CImageDisplay m_Display; // Figures out our media type for us
- HWND m_hSrcHwnd; // Handle to the window to grab
+ HWND m_hSrcHwnd; // Handle to the window to grab
public:
@@ -168,7 +166,7 @@ public:
// Override the version that offers exactly one media type
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Set the agreed media type and set up the necessary parameters
HRESULT SetMediaType(const CMediaType *pMediaType);
@@ -177,19 +175,17 @@ public:
HRESULT GetMediaType(int iPosition, CMediaType *pmt);
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
- HRESULT SetSrcHwnd(HWND hWnd)
- {
- m_hSrcHwnd = hWnd;
- return S_OK;
- }
+ HRESULT SetSrcHwnd(HWND hWnd) {
+ m_hSrcHwnd = hWnd;
+ return S_OK;
+ }
};
@@ -206,7 +202,7 @@ private:
CPushPinBitmap *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
};
@@ -222,7 +218,7 @@ private:
CPushPinBitmapSet *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
};
@@ -238,10 +234,10 @@ private:
CPushPinDesktop *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
- DECLARE_IUNKNOWN;
-
- HRESULT SetSrcHwnd(HWND hWnd);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ DECLARE_IUNKNOWN;
+
+ HRESULT SetSrcHwnd(HWND hWnd);
};
@@ -260,7 +256,7 @@ public:
#include <strsafe.h>
-// UNITS = 10 ^ 7
+// UNITS = 10 ^ 7
// UNITS / 30 = 30 fps;
// UNITS / 20 = 20 fps, etc
const REFERENCE_TIME FPS_30 = UNITS / 30;
@@ -283,8 +279,8 @@ const REFERENCE_TIME rtDefaultFrameLength = FPS_10;
#define NUM_FILES 5
// {3FD3081A-A8C9-4958-9F75-07EC89690024}
-TDSHOW_DEFINE_GUID(CLSID_PushSourceDesktop,
-0x3fd3081a, 0xa8c9, 0x4958, 0x9f, 0x75, 0x7, 0xec, 0x89, 0x69, 0x0, 0x24);
+TDSHOW_DEFINE_GUID(CLSID_PushSourceDesktop,
+ 0x3fd3081a, 0xa8c9, 0x4958, 0x9f, 0x75, 0x7, 0xec, 0x89, 0x69, 0x0, 0x24);
@@ -304,11 +300,11 @@ protected:
BITMAPINFO *m_pBmi; // Pointer to the bitmap header
DWORD m_cbBitmapInfo; // Size of the bitmap header
-
- // File opening variables
- HANDLE m_hFile; // Handle returned from CreateFile
+
+ // File opening variables
+ HANDLE m_hFile; // Handle returned from CreateFile
BYTE * m_pFile; // Points to beginning of file buffer
- BYTE * m_pImage; // Points to pixel bits
+ BYTE * m_pImage; // Points to pixel bits
int m_iFrameNumber;
const REFERENCE_TIME m_rtFrameLength;
@@ -325,13 +321,12 @@ public:
HRESULT GetMediaType(CMediaType *pMediaType);
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
@@ -348,11 +343,11 @@ protected:
BITMAPINFO *m_pBmi[NUM_FILES]; // Pointer to the bitmap headers
DWORD m_cbBitmapInfo[NUM_FILES]; // Size of the bitmap headers
-
- // File opening variables
- HANDLE m_hFile[NUM_FILES]; // Handles returned from CreateFile
+
+ // File opening variables
+ HANDLE m_hFile[NUM_FILES]; // Handles returned from CreateFile
BYTE * m_pFile[NUM_FILES]; // Points to beginning of file buffers
- BYTE * m_pImage[NUM_FILES]; // Points to pixel bits
+ BYTE * m_pImage[NUM_FILES]; // Points to pixel bits
BOOL m_bFilesLoaded;
int m_iCurrentBitmap; // Which bitmap is being displayed
@@ -371,13 +366,12 @@ public:
HRESULT GetMediaType(CMediaType *pMediaType);
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
@@ -406,7 +400,7 @@ protected:
CCritSec m_cSharedState; // Protects our internal state
CImageDisplay m_Display; // Figures out our media type for us
- HWND m_hSrcHwnd; // Handle to the window to grab
+ HWND m_hSrcHwnd; // Handle to the window to grab
public:
@@ -416,7 +410,7 @@ public:
// Override the version that offers exactly one media type
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest);
HRESULT FillBuffer(IMediaSample *pSample);
-
+
// Set the agreed media type and set up the necessary parameters
HRESULT SetMediaType(const CMediaType *pMediaType);
@@ -425,19 +419,17 @@ public:
HRESULT GetMediaType(int iPosition, CMediaType *pmt);
// Quality control
- // Not implemented because we aren't going in real time.
- // If the file-writing filter slows the graph down, we just do nothing, which means
- // wait until we're unblocked. No frames are ever dropped.
- STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
- {
+ // Not implemented because we aren't going in real time.
+ // If the file-writing filter slows the graph down, we just do nothing, which means
+ // wait until we're unblocked. No frames are ever dropped.
+ STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q) {
return E_FAIL;
}
- HRESULT SetSrcHwnd(HWND hWnd)
- {
- m_hSrcHwnd = hWnd;
- return S_OK;
- }
+ HRESULT SetSrcHwnd(HWND hWnd) {
+ m_hSrcHwnd = hWnd;
+ return S_OK;
+ }
};
@@ -454,7 +446,7 @@ private:
CPushPinBitmap *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
};
@@ -470,7 +462,7 @@ private:
CPushPinBitmapSet *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
};
@@ -486,10 +478,10 @@ private:
CPushPinDesktop *m_pPin;
public:
- static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
- DECLARE_IUNKNOWN;
-
- HRESULT SetSrcHwnd(HWND hWnd);
+ static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
+ DECLARE_IUNKNOWN;
+
+ HRESULT SetSrcHwnd(HWND hWnd);
};
diff --git a/plugins/pluginDirectShow/internals/DSPushSourceDesktop.cxx b/plugins/pluginDirectShow/internals/DSPushSourceDesktop.cxx
index 1bdee9e..3e68ee2 100755
--- a/plugins/pluginDirectShow/internals/DSPushSourceDesktop.cxx
+++ b/plugins/pluginDirectShow/internals/DSPushSourceDesktop.cxx
@@ -18,27 +18,27 @@
/**********************************************
*
* CPushPinDesktop Class
- *
+ *
*
**********************************************/
CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CSource *pFilter)
- : CSourceStream(NAME("Push Source Desktop"), phr, pFilter, L"Out"),
- m_FramesWritten(0),
- m_bZeroMemory(0),
- m_iFrameNumber(0),
- m_rtFrameLength(FPS_5), // Capture and display desktop 5 times per second
- m_nCurrentBitDepth(24),
- m_hSrcHwnd(NULL)
+ : CSourceStream(NAME("Push Source Desktop"), phr, pFilter, L"Out"),
+ m_FramesWritten(0),
+ m_bZeroMemory(0),
+ m_iFrameNumber(0),
+ m_rtFrameLength(FPS_5), // Capture and display desktop 5 times per second
+ m_nCurrentBitDepth(24),
+ m_hSrcHwnd(NULL)
{
- // The main point of this sample is to demonstrate how to take a DIB
- // in host memory and insert it into a video stream.
+ // The main point of this sample is to demonstrate how to take a DIB
+ // in host memory and insert it into a video stream.
- // To keep this sample as simple as possible, we just read the desktop image
- // from a file and copy it into every frame that we send downstream.
+ // To keep this sample as simple as possible, we just read the desktop image
+ // from a file and copy it into every frame that we send downstream.
//
- // In the filter graph, we connect this filter to the AVI Mux, which creates
- // the AVI file with the video frames we pass to it. In this case,
+ // In the filter graph, we connect this filter to the AVI Mux, which creates
+ // the AVI file with the video frames we pass to it. In this case,
// the end result is a screen capture video (GDI images only, with no
// support for overlay surfaces).
@@ -60,7 +60,7 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CSource *pFilter)
}
CPushPinDesktop::~CPushPinDesktop()
-{
+{
DbgLog((LOG_TRACE, 3, TEXT("Frames written %d"), m_iFrameNumber));
}
@@ -84,74 +84,76 @@ HRESULT CPushPinDesktop::GetMediaType(int iPosition, CMediaType *pmt)
CheckPointer(pmt,E_POINTER);
CAutoLock cAutoLock(m_pFilter->pStateLock());
- if(iPosition < 0)
+ if(iPosition < 0) {
return E_INVALIDARG;
+ }
// Have we run off the end of types?
- if(iPosition > 4)
+ if(iPosition > 4) {
return VFW_S_NO_MORE_ITEMS;
+ }
VIDEOINFO *pvi = (VIDEOINFO *) pmt->AllocFormatBuffer(sizeof(VIDEOINFO));
- if(NULL == pvi)
+ if(NULL == pvi) {
return(E_OUTOFMEMORY);
+ }
// Initialize the VideoInfo structure before configuring its members
ZeroMemory(pvi, sizeof(VIDEOINFO));
- switch(iPosition)
- {
- case 0:
- {
- // Return our highest quality 32bit format
-
- // Since we use RGB888 (the default for 32 bit), there is
- // no reason to use BI_BITFIELDS to specify the RGB
- // masks. Also, not everything supports BI_BITFIELDS
- pvi->bmiHeader.biCompression = BI_RGB;
- pvi->bmiHeader.biBitCount = 32;
- break;
- }
+ switch(iPosition) {
+ case 0: {
+ // Return our highest quality 32bit format
- case 1:
- { // Return our 24bit format
- pvi->bmiHeader.biCompression = BI_RGB;
- pvi->bmiHeader.biBitCount = 24;
- break;
- }
+ // Since we use RGB888 (the default for 32 bit), there is
+ // no reason to use BI_BITFIELDS to specify the RGB
+ // masks. Also, not everything supports BI_BITFIELDS
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 32;
+ break;
+ }
- case 2:
- {
- // 16 bit per pixel RGB565
+ case 1: {
+ // Return our 24bit format
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 24;
+ break;
+ }
- // Place the RGB masks as the first 3 doublewords in the palette area
- for(int i = 0; i < 3; i++)
- pvi->TrueColorInfo.dwBitMasks[i] = bits565[i];
+ case 2: {
+ // 16 bit per pixel RGB565
- pvi->bmiHeader.biCompression = BI_BITFIELDS;
- pvi->bmiHeader.biBitCount = 16;
- break;
+ // Place the RGB masks as the first 3 doublewords in the palette area
+ for(int i = 0; i < 3; i++) {
+ pvi->TrueColorInfo.dwBitMasks[i] = bits565[i];
}
- case 3:
- { // 16 bits per pixel RGB555
+ pvi->bmiHeader.biCompression = BI_BITFIELDS;
+ pvi->bmiHeader.biBitCount = 16;
+ break;
+ }
- // Place the RGB masks as the first 3 doublewords in the palette area
- for(int i = 0; i < 3; i++)
- pvi->TrueColorInfo.dwBitMasks[i] = bits555[i];
+ case 3: {
+ // 16 bits per pixel RGB555
- pvi->bmiHeader.biCompression = BI_BITFIELDS;
- pvi->bmiHeader.biBitCount = 16;
- break;
+ // Place the RGB masks as the first 3 doublewords in the palette area
+ for(int i = 0; i < 3; i++) {
+ pvi->TrueColorInfo.dwBitMasks[i] = bits555[i];
}
- case 4:
- { // 8 bit palettised
+ pvi->bmiHeader.biCompression = BI_BITFIELDS;
+ pvi->bmiHeader.biBitCount = 16;
+ break;
+ }
- pvi->bmiHeader.biCompression = BI_RGB;
- pvi->bmiHeader.biBitCount = 8;
- pvi->bmiHeader.biClrUsed = iPALETTE_COLORS;
- break;
- }
+ case 4: {
+ // 8 bit palettised
+
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 8;
+ pvi->bmiHeader.biClrUsed = iPALETTE_COLORS;
+ break;
+ }
}
// Adjust the parameters common to all formats
@@ -191,38 +193,37 @@ HRESULT CPushPinDesktop::CheckMediaType(const CMediaType *pMediaType)
CheckPointer(pMediaType,E_POINTER);
if((*(pMediaType->Type()) != MEDIATYPE_Video) || // we only output video
- !(pMediaType->IsFixedSize())) // in fixed size samples
- {
+ !(pMediaType->IsFixedSize())) { // in fixed size samples
return E_INVALIDARG;
}
// Check for the subtypes we support
const GUID *SubType = pMediaType->Subtype();
- if (SubType == NULL)
+ if (SubType == NULL) {
return E_INVALIDARG;
+ }
if( (*SubType != MEDIASUBTYPE_RGB24)
#if 0
- && (*SubType != MEDIASUBTYPE_RGB565)
- && (*SubType != MEDIASUBTYPE_RGB555)
- && (*SubType != MEDIASUBTYPE_RGB32)
- && (*SubType != MEDIASUBTYPE_RGB8)
+ && (*SubType != MEDIASUBTYPE_RGB565)
+ && (*SubType != MEDIASUBTYPE_RGB555)
+ && (*SubType != MEDIASUBTYPE_RGB32)
+ && (*SubType != MEDIASUBTYPE_RGB8)
#endif
- )
- {
+ ) {
return E_INVALIDARG;
}
// Get the format area of the media type
VIDEOINFO *pvi = (VIDEOINFO *) pMediaType->Format();
- if(pvi == NULL)
+ if(pvi == NULL) {
return E_INVALIDARG;
+ }
// Check if the image width & height have changed
- if( pvi->bmiHeader.biWidth != m_iImageWidth ||
- abs(pvi->bmiHeader.biHeight) != m_iImageHeight)
- {
+ if( pvi->bmiHeader.biWidth != m_iImageWidth ||
+ abs(pvi->bmiHeader.biHeight) != m_iImageHeight) {
// If the image width/height is changed, fail CheckMediaType() to force
// the renderer to resize the image.
return E_INVALIDARG;
@@ -230,8 +231,9 @@ HRESULT CPushPinDesktop::CheckMediaType(const CMediaType *pMediaType)
// Don't accept formats with negative height, which would cause the desktop
// image to be displayed upside down.
- if (pvi->bmiHeader.biHeight < 0)
+ if (pvi->bmiHeader.biHeight < 0) {
return E_INVALIDARG;
+ }
return S_OK; // This format is acceptable.
@@ -246,7 +248,7 @@ HRESULT CPushPinDesktop::CheckMediaType(const CMediaType *pMediaType)
// Then we can ask for buffers of the correct size to contain them.
//
HRESULT CPushPinDesktop::DecideBufferSize(IMemAllocator *pAlloc,
- ALLOCATOR_PROPERTIES *pProperties)
+ ALLOCATOR_PROPERTIES *pProperties)
{
CheckPointer(pAlloc,E_POINTER);
CheckPointer(pProperties,E_POINTER);
@@ -265,14 +267,12 @@ HRESULT CPushPinDesktop::DecideBufferSize(IMemAllocator *pAlloc,
// memory that we requested, so we must check we got whatever we wanted.
ALLOCATOR_PROPERTIES Actual;
hr = pAlloc->SetProperties(pProperties,&Actual);
- if(FAILED(hr))
- {
+ if(FAILED(hr)) {
return hr;
}
// Is this allocator unsuitable?
- if(Actual.cbBuffer < pProperties->cbBuffer)
- {
+ if(Actual.cbBuffer < pProperties->cbBuffer) {
return E_FAIL;
}
@@ -297,31 +297,30 @@ HRESULT CPushPinDesktop::SetMediaType(const CMediaType *pMediaType)
// Pass the call up to my base class
HRESULT hr = CSourceStream::SetMediaType(pMediaType);
- if(SUCCEEDED(hr))
- {
+ if(SUCCEEDED(hr)) {
VIDEOINFO * pvi = (VIDEOINFO *) m_mt.Format();
- if (pvi == NULL)
+ if (pvi == NULL) {
return E_UNEXPECTED;
+ }
- switch(pvi->bmiHeader.biBitCount)
- {
- case 8: // 8-bit palettized
- case 16: // RGB565, RGB555
- case 24: // RGB24
- case 32: // RGB32
- // Save the current media type and bit depth
- m_MediaType = *pMediaType;
- m_nCurrentBitDepth = pvi->bmiHeader.biBitCount;
- hr = S_OK;
- break;
-
- default:
- // We should never agree any other media types
- ASSERT(FALSE);
- hr = E_INVALIDARG;
- break;
+ switch(pvi->bmiHeader.biBitCount) {
+ case 8: // 8-bit palettized
+ case 16: // RGB565, RGB555
+ case 24: // RGB24
+ case 32: // RGB32
+ // Save the current media type and bit depth
+ m_MediaType = *pMediaType;
+ m_nCurrentBitDepth = pvi->bmiHeader.biBitCount;
+ hr = S_OK;
+ break;
+
+ default:
+ // We should never agree any other media types
+ ASSERT(FALSE);
+ hr = E_INVALIDARG;
+ break;
}
- }
+ }
return hr;
@@ -332,7 +331,7 @@ HRESULT CPushPinDesktop::SetMediaType(const CMediaType *pMediaType)
// FillBuffer is called once for every sample in the stream.
HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
{
- BYTE *pData;
+ BYTE *pData;
long cbData;
CheckPointer(pSample, E_POINTER);
@@ -348,18 +347,19 @@ HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)m_mt.pbFormat;
- // Copy the DIB bits over into our filter's output buffer.
+ // Copy the DIB bits over into our filter's output buffer.
// Since sample size may be larger than the image size, bound the copy size.
int nSize = min(pVih->bmiHeader.biSizeImage, (DWORD) cbData);
HDIB hDib = CopyScreenToBitmap(&m_rScreen, pData, (BITMAPINFO *) &(pVih->bmiHeader));
- if (hDib)
+ if (hDib) {
DeleteObject(hDib);
+ }
- // Set the timestamps that will govern playback frame rate.
- // If this file is getting written out as an AVI,
- // then you'll also need to configure the AVI Mux filter to
- // set the Average Time Per Frame for the AVI Header.
+ // Set the timestamps that will govern playback frame rate.
+ // If this file is getting written out as an AVI,
+ // then you'll also need to configure the AVI Mux filter to
+ // set the Average Time Per Frame for the AVI Header.
// The current time is the sample's start.
REFERENCE_TIME rtStart = m_iFrameNumber * m_rtFrameLength;
REFERENCE_TIME rtStop = rtStart + m_rtFrameLength;
@@ -367,7 +367,7 @@ HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
pSample->SetTime(&rtStart, &rtStop);
m_iFrameNumber++;
- // Set TRUE on every sample for uncompressed frames
+ // Set TRUE on every sample for uncompressed frames
pSample->SetSyncPoint(TRUE);
return S_OK;
@@ -382,28 +382,28 @@ HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
**********************************************/
CPushSourceDesktop::CPushSourceDesktop(IUnknown *pUnk, HRESULT *phr)
- : CSource(NAME("PushSourceDesktop"), pUnk, CLSID_PushSourceDesktop)
+ : CSource(NAME("PushSourceDesktop"), pUnk, CLSID_PushSourceDesktop)
{
// The pin magically adds itself to our pin array.
m_pPin = new CPushPinDesktop(phr, this);
- if (phr)
- {
- if (m_pPin == NULL)
- *phr = E_OUTOFMEMORY;
- else
- *phr = S_OK;
- }
+ if (phr) {
+ if (m_pPin == NULL) {
+ *phr = E_OUTOFMEMORY;
+ }
+ else {
+ *phr = S_OK;
+ }
+ }
}
CPushSourceDesktop::~CPushSourceDesktop()
{
- if (m_pPin)
- {
- delete m_pPin;
- m_pPin = NULL;
- }
+ if (m_pPin) {
+ delete m_pPin;
+ m_pPin = NULL;
+ }
}
@@ -411,24 +411,24 @@ CUnknown * WINAPI CPushSourceDesktop::CreateInstance(IUnknown *pUnk, HRESULT *ph
{
CPushSourceDesktop *pNewFilter = new CPushSourceDesktop(pUnk, phr );
- if (phr)
- {
- if (pNewFilter == NULL)
- *phr = E_OUTOFMEMORY;
- else
- *phr = S_OK;
- }
+ if (phr) {
+ if (pNewFilter == NULL) {
+ *phr = E_OUTOFMEMORY;
+ }
+ else {
+ *phr = S_OK;
+ }
+ }
return pNewFilter;
}
HRESULT CPushSourceDesktop::SetSrcHwnd(HWND hWnd)
{
- if (m_pPin)
- {
- return m_pPin->SetSrcHwnd(hWnd);
- }
- return E_FAIL;
+ if (m_pPin) {
+ return m_pPin->SetSrcHwnd(hWnd);
+ }
+ return E_FAIL;
}
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/internals/DSScreenCastGraph.cxx b/plugins/pluginDirectShow/internals/DSScreenCastGraph.cxx
index b425d65..efdb261 100755
--- a/plugins/pluginDirectShow/internals/DSScreenCastGraph.cxx
+++ b/plugins/pluginDirectShow/internals/DSScreenCastGraph.cxx
@@ -1,18 +1,18 @@
#if !defined(_WIN32_WCE)
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -29,46 +29,46 @@
using namespace std;
DSScreenCastGraph::DSScreenCastGraph(ISampleGrabberCB* callback, HRESULT *hr)
-: DSBaseCaptureGraph(callback, hr)
+ : DSBaseCaptureGraph(callback, hr)
{
- this->grabberCallback = callback;
+ this->grabberCallback = callback;
- this->captureFormat = NULL;
- this->captureGraphBuilder = NULL;
- this->graphBuilder = NULL;
+ this->captureFormat = NULL;
+ this->captureGraphBuilder = NULL;
+ this->graphBuilder = NULL;
- this->sourceFilter = NULL;
- this->sampleGrabberFilter = NULL;
+ this->sourceFilter = NULL;
+ this->sampleGrabberFilter = NULL;
- this->nullRendererFilter = NULL;
- this->grabberController = NULL;
- this->mediaController = NULL;
- this->mediaEventController = NULL;
+ this->nullRendererFilter = NULL;
+ this->grabberController = NULL;
+ this->mediaController = NULL;
+ this->mediaEventController = NULL;
- this->running = FALSE;
- this->paused = FALSE;
+ this->running = FALSE;
+ this->paused = FALSE;
- *hr = this->createCaptureGraph();
+ *hr = this->createCaptureGraph();
}
DSScreenCastGraph::~DSScreenCastGraph()
{
- SAFE_RELEASE(this->mediaEventController);
- SAFE_RELEASE(this->mediaController);
- SAFE_RELEASE(this->grabberController);
+ SAFE_RELEASE(this->mediaEventController);
+ SAFE_RELEASE(this->mediaController);
+ SAFE_RELEASE(this->grabberController);
- SAFE_RELEASE(this->nullRendererFilter);
- SAFE_RELEASE(this->sampleGrabberFilter);
+ SAFE_RELEASE(this->nullRendererFilter);
+ SAFE_RELEASE(this->sampleGrabberFilter);
- SAFE_RELEASE(this->graphBuilder);
- SAFE_RELEASE(this->captureGraphBuilder);
+ SAFE_RELEASE(this->graphBuilder);
+ SAFE_RELEASE(this->captureGraphBuilder);
- SAFE_RELEASE(this->sourceFilter);
+ SAFE_RELEASE(this->sourceFilter);
}
HRESULT DSScreenCastGraph::setParameters(DSCaptureFormat *format, int framerate)
{
- return S_OK;
+ return S_OK;
}
#ifdef _WIN32_WCE
@@ -77,181 +77,207 @@ HRESULT DSScreenCastGraph::setParameters(DSCaptureFormat *format, int framerate)
HRESULT DSScreenCastGraph::connect()
{
- HRESULT hr;
+ HRESULT hr;
- if (!this->sourceFilter){
- TSK_DEBUG_ERROR("Invalid source filter");
- return E_FAIL;
- }
+ if (!this->sourceFilter) {
+ TSK_DEBUG_ERROR("Invalid source filter");
+ return E_FAIL;
+ }
#if 0
- if (!this->captureFormat){
- TSK_DEBUG_ERROR("Invalid capture format");
- return E_FAIL;
- }
+ if (!this->captureFormat) {
+ TSK_DEBUG_ERROR("Invalid capture format");
+ return E_FAIL;
+ }
#endif
-
- hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->sampleGrabberFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
- return hr;
+ hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->sampleGrabberFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+ hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("ConnectFilters failed");
+ return hr;
+ }
+
+ return hr;
}
HRESULT DSScreenCastGraph::disconnect()
{
- HRESULT hr;
+ HRESULT hr;
- if (!this->sourceFilter)
- {
- return E_FAIL;
- }
+ if (!this->sourceFilter) {
+ return E_FAIL;
+ }
#if 0
- if (!this->captureFormat)
- {
- return E_FAIL;
- }
+ if (!this->captureFormat) {
+ return E_FAIL;
+ }
#endif
- hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->sampleGrabberFilter);
- hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->sampleGrabberFilter);
+ hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
- return hr;
+ return hr;
}
HRESULT DSScreenCastGraph::start()
{
- HRESULT hr;
-
- if (isRunning() && !isPaused())
- {
- return S_OK;
- }
-
- hr = this->mediaController->Run();
- if (!SUCCEEDED(hr))
- {
- TSK_DEBUG_ERROR("DSScreenCastGraph::mediaController->Run() has failed with %ld", hr);
- return hr;
- }
- this->running = true;
- return hr;
+ HRESULT hr;
+
+ if (isRunning() && !isPaused()) {
+ return S_OK;
+ }
+
+ hr = this->mediaController->Run();
+ if (!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("DSScreenCastGraph::mediaController->Run() has failed with %ld", hr);
+ return hr;
+ }
+ this->running = true;
+ return hr;
}
HRESULT DSScreenCastGraph::pause()
{
- HRESULT hr = S_OK;
- if (isRunning())
- {
- hr = this->mediaController->Pause();
- if (SUCCEEDED(hr))
- {
- this->paused = TRUE;
- }
- }
- return hr;
+ HRESULT hr = S_OK;
+ if (isRunning()) {
+ hr = this->mediaController->Pause();
+ if (SUCCEEDED(hr)) {
+ this->paused = TRUE;
+ }
+ }
+ return hr;
}
HRESULT DSScreenCastGraph::stop()
{
- if (!this->running)
- {
- return S_OK;
- }
-
- HRESULT hr;
- hr = this->mediaController->Stop();
- if (FAILED(hr))
- {
- TSK_DEBUG_ERROR("DSScreenCastGraph::mediaController->Stop() has failed with %ld", hr);
- }
- this->running = false;
- this->paused = false;
- return hr;
+ if (!this->running) {
+ return S_OK;
+ }
+
+ HRESULT hr;
+ hr = this->mediaController->Stop();
+ if (FAILED(hr)) {
+ TSK_DEBUG_ERROR("DSScreenCastGraph::mediaController->Stop() has failed with %ld", hr);
+ }
+ this->running = false;
+ this->paused = false;
+ return hr;
}
bool DSScreenCastGraph::isRunning()
{
- return this->running;
+ return this->running;
}
bool DSScreenCastGraph::isPaused()
{
- return this->paused;
+ return this->paused;
}
HRESULT DSScreenCastGraph::getConnectedMediaType(AM_MEDIA_TYPE *mediaType)
{
- return this->grabberController->GetConnectedMediaType(mediaType);
+ return this->grabberController->GetConnectedMediaType(mediaType);
}
HRESULT DSScreenCastGraph::createCaptureGraph()
{
- HRESULT hr;
-
- // Create capture graph builder
- hr = COCREATE(CLSID_CaptureGraphBuilder2, IID_ICaptureGraphBuilder2, this->captureGraphBuilder);
- if(FAILED(hr)) return hr;
-
- // Create the graph builder
- hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder);
- if(FAILED(hr)) return hr;
-
- // Initialize the Capture Graph Builder.
- hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder);
- if(FAILED(hr)) return hr;
-
- // Create source filter
- LPUNKNOWN pUnk = NULL;
- this->sourceFilter = (CPushSourceDesktop*)CPushSourceDesktop::CreateInstance(pUnk, &hr);
- if(FAILED(hr)) return hr;
- this->sourceFilter->AddRef();
-
- // Create the sample grabber filter
- hr = COCREATE(CLSID_SampleGrabber, IID_IBaseFilter, this->sampleGrabberFilter);
- if(FAILED(hr)) return hr;
-
- // Create the NULL renderer
- hr = COCREATE(CLSID_NullRenderer, IID_IBaseFilter, this->nullRendererFilter);
- if(FAILED(hr)) return hr;
-
- // Add source filter to the graph
- hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_SCREENCAST);
- if(FAILED(hr)) return hr;
-
- // Add sample grabber to the graph
- hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER);
- if(FAILED(hr)) return hr;
-
- // Add null renderer to the graph
- hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER);
- if(FAILED(hr)) return hr;
-
- // Find media control
- hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController);
- if(FAILED(hr)) return hr;
-
- // Create the sample grabber controller
- hr = QUERY(this->sampleGrabberFilter, IID_ISampleGrabber, this->grabberController);
- if(FAILED(hr)) return hr;
-
- // Set the sample grabber media type (RGB24)
- // TODO : CHECK
- AM_MEDIA_TYPE mt;
- ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
- mt.majortype = MEDIATYPE_Video;
- mt.subtype = MEDIASUBTYPE_RGB24;
- mt.formattype = FORMAT_VideoInfo;
-
- hr = this->grabberController->SetMediaType(&mt);
- if(FAILED(hr)) return hr;
-
- // Set sample grabber media type
- this->grabberController->SetOneShot(FALSE);
- this->grabberController->SetBufferSamples(FALSE);
-
- hr = this->grabberController->SetCallback(this->grabberCallback, 1);
- if(FAILED(hr)) return hr;
-
- return hr;
+ HRESULT hr;
+
+ // Create capture graph builder
+ hr = COCREATE(CLSID_CaptureGraphBuilder2, IID_ICaptureGraphBuilder2, this->captureGraphBuilder);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Create the graph builder
+ hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Initialize the Capture Graph Builder.
+ hr = this->captureGraphBuilder->SetFiltergraph(this->graphBuilder);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Create source filter
+ LPUNKNOWN pUnk = NULL;
+ this->sourceFilter = (CPushSourceDesktop*)CPushSourceDesktop::CreateInstance(pUnk, &hr);
+ if(FAILED(hr)) {
+ return hr;
+ }
+ this->sourceFilter->AddRef();
+
+ // Create the sample grabber filter
+ hr = COCREATE(CLSID_SampleGrabber, IID_IBaseFilter, this->sampleGrabberFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Create the NULL renderer
+ hr = COCREATE(CLSID_NullRenderer, IID_IBaseFilter, this->nullRendererFilter);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Add source filter to the graph
+ hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_SCREENCAST);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Add sample grabber to the graph
+ hr = this->graphBuilder->AddFilter(this->sampleGrabberFilter, FITLER_SAMPLE_GRABBER);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Add null renderer to the graph
+ hr = this->graphBuilder->AddFilter(this->nullRendererFilter, FILTER_NULL_RENDERER);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Find media control
+ hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Create the sample grabber controller
+ hr = QUERY(this->sampleGrabberFilter, IID_ISampleGrabber, this->grabberController);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Set the sample grabber media type (RGB24)
+ // TODO : CHECK
+ AM_MEDIA_TYPE mt;
+ ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
+ mt.majortype = MEDIATYPE_Video;
+ mt.subtype = MEDIASUBTYPE_RGB24;
+ mt.formattype = FORMAT_VideoInfo;
+
+ hr = this->grabberController->SetMediaType(&mt);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ // Set sample grabber media type
+ this->grabberController->SetOneShot(FALSE);
+ this->grabberController->SetBufferSamples(FALSE);
+
+ hr = this->grabberController->SetCallback(this->grabberCallback, 1);
+ if(FAILED(hr)) {
+ return hr;
+ }
+
+ return hr;
}
#endif /* _WIN32_WCE */ \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/DSScreenCastGraph.h b/plugins/pluginDirectShow/internals/DSScreenCastGraph.h
index d201668..38400d0 100755
--- a/plugins/pluginDirectShow/internals/DSScreenCastGraph.h
+++ b/plugins/pluginDirectShow/internals/DSScreenCastGraph.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,67 +31,73 @@ class CPushSourceDesktop;
class DSScreenCastGraph : public DSBaseCaptureGraph
{
public:
- DSScreenCastGraph(ISampleGrabberCB* callback, HRESULT *hr);
- virtual ~DSScreenCastGraph();
+ DSScreenCastGraph(ISampleGrabberCB* callback, HRESULT *hr);
+ virtual ~DSScreenCastGraph();
- std::vector<DSCaptureFormat> *getFormats() { return &this->supportedFormats; };
+ std::vector<DSCaptureFormat> *getFormats() {
+ return &this->supportedFormats;
+ };
- virtual HRESULT setSource(const std::string &devicePath) { return S_OK; }
- HRESULT setParameters(DSCaptureFormat *format, int framerate);
+ virtual HRESULT setSource(const std::string &devicePath) {
+ return S_OK;
+ }
+ HRESULT setParameters(DSCaptureFormat *format, int framerate);
- HRESULT connect();
- HRESULT disconnect();
+ HRESULT connect();
+ HRESULT disconnect();
- HRESULT start();
- HRESULT stop();
- HRESULT pause();
- bool isRunning();
- bool isPaused();
+ HRESULT start();
+ HRESULT stop();
+ HRESULT pause();
+ bool isRunning();
+ bool isPaused();
- HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
+ HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
- virtual std::string getDeviceId() const { return std::string("screencast"); }
+ virtual std::string getDeviceId() const {
+ return std::string("screencast");
+ }
private:
- HRESULT createCaptureGraph();
+ HRESULT createCaptureGraph();
private:
- ISampleGrabberCB *grabberCallback;
+ ISampleGrabberCB *grabberCallback;
- ICaptureGraphBuilder2 *captureGraphBuilder;
- IGraphBuilder *graphBuilder;
+ ICaptureGraphBuilder2 *captureGraphBuilder;
+ IGraphBuilder *graphBuilder;
- CPushSourceDesktop *sourceFilter;
- IBaseFilter *nullRendererFilter;
- IBaseFilter *sampleGrabberFilter;
+ CPushSourceDesktop *sourceFilter;
+ IBaseFilter *nullRendererFilter;
+ IBaseFilter *sampleGrabberFilter;
- ISampleGrabber *grabberController;
+ ISampleGrabber *grabberController;
- IMediaControl *mediaController;
- IMediaEventEx *mediaEventController;
+ IMediaControl *mediaController;
+ IMediaEventEx *mediaEventController;
- std::vector<DSCaptureFormat> supportedFormats;
- DSCaptureFormat *captureFormat;
+ std::vector<DSCaptureFormat> supportedFormats;
+ DSCaptureFormat *captureFormat;
- bool running;
- bool paused;
+ bool running;
+ bool paused;
};
#endif /* PLUGIN_DSHOW_DSSCREENCAST_H */
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -111,50 +117,56 @@ class CPushSourceDesktop;
class DSScreenCastGraph : public DSBaseCaptureGraph
{
public:
- DSScreenCastGraph(ISampleGrabberCB* callback, HRESULT *hr);
- virtual ~DSScreenCastGraph();
+ DSScreenCastGraph(ISampleGrabberCB* callback, HRESULT *hr);
+ virtual ~DSScreenCastGraph();
- std::vector<DSCaptureFormat> *getFormats() { return &this->supportedFormats; };
+ std::vector<DSCaptureFormat> *getFormats() {
+ return &this->supportedFormats;
+ };
- virtual HRESULT setSource(const std::string &devicePath) { return S_OK; }
- HRESULT setParameters(DSCaptureFormat *format, int framerate);
+ virtual HRESULT setSource(const std::string &devicePath) {
+ return S_OK;
+ }
+ HRESULT setParameters(DSCaptureFormat *format, int framerate);
- HRESULT connect();
- HRESULT disconnect();
+ HRESULT connect();
+ HRESULT disconnect();
- HRESULT start();
- HRESULT stop();
- HRESULT pause();
- bool isRunning();
- bool isPaused();
+ HRESULT start();
+ HRESULT stop();
+ HRESULT pause();
+ bool isRunning();
+ bool isPaused();
- HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
+ HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
- virtual std::string getDeviceId() const { return std::string("screencast"); }
+ virtual std::string getDeviceId() const {
+ return std::string("screencast");
+ }
private:
- HRESULT createCaptureGraph();
+ HRESULT createCaptureGraph();
private:
- ISampleGrabberCB *grabberCallback;
+ ISampleGrabberCB *grabberCallback;
- ICaptureGraphBuilder2 *captureGraphBuilder;
- IGraphBuilder *graphBuilder;
+ ICaptureGraphBuilder2 *captureGraphBuilder;
+ IGraphBuilder *graphBuilder;
- CPushSourceDesktop *sourceFilter;
- IBaseFilter *nullRendererFilter;
- IBaseFilter *sampleGrabberFilter;
+ CPushSourceDesktop *sourceFilter;
+ IBaseFilter *nullRendererFilter;
+ IBaseFilter *sampleGrabberFilter;
- ISampleGrabber *grabberController;
+ ISampleGrabber *grabberController;
- IMediaControl *mediaController;
- IMediaEventEx *mediaEventController;
+ IMediaControl *mediaController;
+ IMediaEventEx *mediaEventController;
- std::vector<DSCaptureFormat> supportedFormats;
- DSCaptureFormat *captureFormat;
+ std::vector<DSCaptureFormat> supportedFormats;
+ DSCaptureFormat *captureFormat;
- bool running;
- bool paused;
+ bool running;
+ bool paused;
};
#endif /* PLUGIN_DSHOW_DSSCREENCAST_H */
diff --git a/plugins/pluginDirectShow/internals/DSUtils.cxx b/plugins/pluginDirectShow/internals/DSUtils.cxx
index 913c081..6187e0f 100755
--- a/plugins/pluginDirectShow/internals/DSUtils.cxx
+++ b/plugins/pluginDirectShow/internals/DSUtils.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -29,221 +29,223 @@
HWND GetMainWindow()
{
- HWND hWnd;
- if (!(hWnd = GetActiveWindow())) {
- if (!(hWnd = GetForegroundWindow())) {
+ HWND hWnd;
+ if (!(hWnd = GetActiveWindow())) {
+ if (!(hWnd = GetForegroundWindow())) {
#if !defined(_WIN32_WCE)
- if (!(hWnd = GetConsoleWindow())) {
- return NULL;
- }
+ if (!(hWnd = GetConsoleWindow())) {
+ return NULL;
+ }
#endif
- }
- }
- return hWnd;
+ }
+ }
+ return hWnd;
}
bool IsMainThread()
-{
- HWND hWnd = GetMainWindow();
- if (hWnd) {
- DWORD mainTid = GetWindowThreadProcessId(hWnd, NULL);
- DWORD currentTid = GetCurrentThreadId();
- return (mainTid == currentTid);
- }
- return false;
+{
+ HWND hWnd = GetMainWindow();
+ if (hWnd) {
+ DWORD mainTid = GetWindowThreadProcessId(hWnd, NULL);
+ DWORD currentTid = GetCurrentThreadId();
+ return (mainTid == currentTid);
+ }
+ return false;
}
bool IsD3D9Supported()
{
#if defined(_WIN32_WCE)
- return false;
+ return false;
#else
- static bool g_bChecked = false;
- static bool g_bSupported = false;
-
- if (g_bChecked) {
- return g_bSupported;
- }
- g_bChecked = true;
- HRESULT hr = S_OK;
- IDirect3D9* pD3D = NULL;
- D3DDISPLAYMODE mode = { 0 };
- D3DPRESENT_PARAMETERS pp = {0};
- IDirect3DDevice9* pDevice = NULL;
-
- if (!(pD3D = Direct3DCreate9(D3D_SDK_VERSION))) {
+ static bool g_bChecked = false;
+ static bool g_bSupported = false;
+
+ if (g_bChecked) {
+ return g_bSupported;
+ }
+ g_bChecked = true;
+ HRESULT hr = S_OK;
+ IDirect3D9* pD3D = NULL;
+ D3DDISPLAYMODE mode = { 0 };
+ D3DPRESENT_PARAMETERS pp = {0};
+ IDirect3DDevice9* pDevice = NULL;
+
+ if (!(pD3D = Direct3DCreate9(D3D_SDK_VERSION))) {
hr = E_OUTOFMEMORY;
- goto bail;
+ goto bail;
}
hr = pD3D->GetAdapterDisplayMode(
- D3DADAPTER_DEFAULT,
- &mode
- );
- if (FAILED(hr)) {
- goto bail;
- }
+ D3DADAPTER_DEFAULT,
+ &mode
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
hr = pD3D->CheckDeviceType(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- mode.Format,
- D3DFMT_X8R8G8B8,
- TRUE // windowed
- );
- if (FAILED(hr)) {
- goto bail;
- }
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ mode.Format,
+ D3DFMT_X8R8G8B8,
+ TRUE // windowed
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
pp.BackBufferFormat = D3DFMT_X8R8G8B8;
pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- pp.Windowed = TRUE;
- pp.hDeviceWindow = GetDesktopWindow();
+ pp.Windowed = TRUE;
+ pp.hDeviceWindow = GetDesktopWindow();
hr = pD3D->CreateDevice(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- pp.hDeviceWindow,
- D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &pp,
- &pDevice
- );
- if (FAILED(hr)) {
- goto bail;
- }
-
- // Everythings is OK
- g_bSupported = true;
- TSK_DEBUG_INFO("D3D9 supported");
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ pp.hDeviceWindow,
+ D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &pp,
+ &pDevice
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Everythings is OK
+ g_bSupported = true;
+ TSK_DEBUG_INFO("D3D9 supported");
bail:
- if (!g_bSupported) {
- TSK_DEBUG_WARN("D3D9 not supported");
- }
- SAFE_RELEASE(pDevice);
- SAFE_RELEASE(pD3D);
- return g_bSupported;
+ if (!g_bSupported) {
+ TSK_DEBUG_WARN("D3D9 not supported");
+ }
+ SAFE_RELEASE(pDevice);
+ SAFE_RELEASE(pD3D);
+ return g_bSupported;
#endif /* _WIN32_WCE */
}
IPin *GetPin(IBaseFilter *filter, PIN_DIRECTION direction)
{
- IEnumPins *enumPins = NULL;
- IPin *pin = NULL;
-
- HRESULT hr = filter->EnumPins(&enumPins);
- if(!enumPins){
- return NULL;
- }
-
- for(;;){
- ULONG fetched = 0;
- PIN_DIRECTION pinDir = PIN_DIRECTION(-1);
- pin = NULL;
-
- if (FAILED(enumPins->Next(1, &pin, &fetched))){
- enumPins->Release();
- return NULL;
- }
-
- if (fetched == 1 && pin){
- pin->QueryDirection(&pinDir);
- if(pinDir == direction){
- break;
- }
- pin->Release();
- }
- }
-
- enumPins->Release();
- return pin;
+ IEnumPins *enumPins = NULL;
+ IPin *pin = NULL;
+
+ HRESULT hr = filter->EnumPins(&enumPins);
+ if(!enumPins) {
+ return NULL;
+ }
+
+ for(;;) {
+ ULONG fetched = 0;
+ PIN_DIRECTION pinDir = PIN_DIRECTION(-1);
+ pin = NULL;
+
+ if (FAILED(enumPins->Next(1, &pin, &fetched))) {
+ enumPins->Release();
+ return NULL;
+ }
+
+ if (fetched == 1 && pin) {
+ pin->QueryDirection(&pinDir);
+ if(pinDir == direction) {
+ break;
+ }
+ pin->Release();
+ }
+ }
+
+ enumPins->Release();
+ return pin;
}
HRESULT ConnectFilters(IGraphBuilder *graphBuilder, IBaseFilter *source, IBaseFilter *destination, AM_MEDIA_TYPE *mediaType)
{
- HRESULT hr;
+ HRESULT hr;
- IPin *outPin = GetPin(source, PINDIR_OUTPUT);
- IPin *inPin = GetPin(destination, PINDIR_INPUT);
+ IPin *outPin = GetPin(source, PINDIR_OUTPUT);
+ IPin *inPin = GetPin(destination, PINDIR_INPUT);
- if (mediaType != NULL){
- hr = graphBuilder->ConnectDirect(outPin, inPin, mediaType);
- }
- else{
- hr = graphBuilder->Connect(outPin, inPin);
- }
+ if (mediaType != NULL) {
+ hr = graphBuilder->ConnectDirect(outPin, inPin, mediaType);
+ }
+ else {
+ hr = graphBuilder->Connect(outPin, inPin);
+ }
- SAFE_RELEASE(outPin);
- SAFE_RELEASE(inPin);
+ SAFE_RELEASE(outPin);
+ SAFE_RELEASE(inPin);
- return hr;
+ return hr;
}
HRESULT DisconnectFilters(IGraphBuilder *graphBuilder, IBaseFilter *source, IBaseFilter *destination)
{
- HRESULT hr;
+ HRESULT hr;
- IPin *outPin = GetPin(source, PINDIR_OUTPUT);
- IPin *inPin = GetPin(destination, PINDIR_INPUT);
+ IPin *outPin = GetPin(source, PINDIR_OUTPUT);
+ IPin *inPin = GetPin(destination, PINDIR_INPUT);
- if (inPin){
- hr = graphBuilder->Disconnect(inPin);
- }
+ if (inPin) {
+ hr = graphBuilder->Disconnect(inPin);
+ }
- if (outPin){
- hr = graphBuilder->Disconnect(outPin);
- }
+ if (outPin) {
+ hr = graphBuilder->Disconnect(outPin);
+ }
- SAFE_RELEASE(outPin);
- SAFE_RELEASE(inPin);
+ SAFE_RELEASE(outPin);
+ SAFE_RELEASE(inPin);
- return hr;
+ return hr;
}
bool DisconnectAllFilters(IGraphBuilder *graphBuilder)
{
- IEnumFilters* filterEnum = NULL;
- IBaseFilter* currentFilter = NULL;
- ULONG fetched;
- HRESULT hr;
-
- hr = graphBuilder->EnumFilters(&filterEnum);
- if (FAILED(hr)) {
- SAFE_RELEASE(filterEnum);
- return false;
- }
-
- while(filterEnum->Next(1, &currentFilter, &fetched) == S_OK){
- hr = DisconnectFilters(graphBuilder, currentFilter, currentFilter);
- SAFE_RELEASE(currentFilter);
- }
- SAFE_RELEASE(filterEnum);
- SAFE_RELEASE(currentFilter);
- return true;
+ IEnumFilters* filterEnum = NULL;
+ IBaseFilter* currentFilter = NULL;
+ ULONG fetched;
+ HRESULT hr;
+
+ hr = graphBuilder->EnumFilters(&filterEnum);
+ if (FAILED(hr)) {
+ SAFE_RELEASE(filterEnum);
+ return false;
+ }
+
+ while(filterEnum->Next(1, &currentFilter, &fetched) == S_OK) {
+ hr = DisconnectFilters(graphBuilder, currentFilter, currentFilter);
+ SAFE_RELEASE(currentFilter);
+ }
+ SAFE_RELEASE(filterEnum);
+ SAFE_RELEASE(currentFilter);
+ return true;
}
bool RemoveAllFilters(IGraphBuilder *graphBuilder)
{
- IEnumFilters* filterEnum = NULL;
- IBaseFilter* currentFilter = NULL;
- ULONG fetched;
- HRESULT hr;
-
- hr = graphBuilder->EnumFilters(&filterEnum);
- if (FAILED(hr)) return false;
-
- while(filterEnum->Next(1, &currentFilter, &fetched) == S_OK){
- hr = graphBuilder->RemoveFilter(currentFilter);
- if (FAILED(hr)){
- SAFE_RELEASE(filterEnum);
- return false;
- }
- SAFE_RELEASE(currentFilter);
- filterEnum->Reset();
- }
-
- SAFE_RELEASE(filterEnum);
- SAFE_RELEASE(currentFilter);
- return true;
+ IEnumFilters* filterEnum = NULL;
+ IBaseFilter* currentFilter = NULL;
+ ULONG fetched;
+ HRESULT hr;
+
+ hr = graphBuilder->EnumFilters(&filterEnum);
+ if (FAILED(hr)) {
+ return false;
+ }
+
+ while(filterEnum->Next(1, &currentFilter, &fetched) == S_OK) {
+ hr = graphBuilder->RemoveFilter(currentFilter);
+ if (FAILED(hr)) {
+ SAFE_RELEASE(filterEnum);
+ return false;
+ }
+ SAFE_RELEASE(currentFilter);
+ filterEnum->Reset();
+ }
+
+ SAFE_RELEASE(filterEnum);
+ SAFE_RELEASE(currentFilter);
+ return true;
}
@@ -257,109 +259,113 @@ bool RemoveAllFilters(IGraphBuilder *graphBuilder)
// C Callback that dispatch event to create display on UI thread
static LRESULT CALLBACK __create__WndProcWindow(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- HANDLE* event = reinterpret_cast<HANDLE*>(wParam);
- BOOL* isScreenCast = reinterpret_cast<BOOL*>(GetProp(hWnd, TEXT("screnCast")));
-
- if(event && lParam){
- switch(uMsg){
- case WM_CREATE_DISPLAY_ON_UI_THREAD:
- {
- HRESULT hr;
- DSDisplay** ppDisplay = reinterpret_cast<DSDisplay**>(lParam);
- *ppDisplay = new DSDisplay(&hr);
- SetEvent(event);
- break;
- }
- case WM_CREATE_GRABBER_ON_UI_THREAD:
- {
- HRESULT hr;
- DSGrabber** ppGrabber = reinterpret_cast<DSGrabber**>(lParam);
- *ppGrabber = new DSGrabber(&hr, *isScreenCast);
- SetEvent(event);
- break;
- }
- }
- }
- return DefWindowProc(hWnd, uMsg, wParam, lParam);
+ HANDLE* event = reinterpret_cast<HANDLE*>(wParam);
+ BOOL* isScreenCast = reinterpret_cast<BOOL*>(GetProp(hWnd, TEXT("screnCast")));
+
+ if(event && lParam) {
+ switch(uMsg) {
+ case WM_CREATE_DISPLAY_ON_UI_THREAD: {
+ HRESULT hr;
+ DSDisplay** ppDisplay = reinterpret_cast<DSDisplay**>(lParam);
+ *ppDisplay = new DSDisplay(&hr);
+ SetEvent(event);
+ break;
+ }
+ case WM_CREATE_GRABBER_ON_UI_THREAD: {
+ HRESULT hr;
+ DSGrabber** ppGrabber = reinterpret_cast<DSGrabber**>(lParam);
+ *ppGrabber = new DSGrabber(&hr, *isScreenCast);
+ SetEvent(event);
+ break;
+ }
+ }
+ }
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
int createOnCurrentThead(HWND hWnd, void** ppRet, BOOL display, BOOL screnCast)
{
- HRESULT hr;
- if(display) *ppRet = new DSDisplay(&hr);
- else *ppRet = new DSGrabber(&hr, screnCast);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("Failed to created DirectShow %s", display ? "Display" : "Grabber");
- SAFE_DELETE_PTR(*ppRet);
- return -2;
- }
- return 0;
+ HRESULT hr;
+ if(display) {
+ *ppRet = new DSDisplay(&hr);
+ }
+ else {
+ *ppRet = new DSGrabber(&hr, screnCast);
+ }
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("Failed to created DirectShow %s", display ? "Display" : "Grabber");
+ SAFE_DELETE_PTR(*ppRet);
+ return -2;
+ }
+ return 0;
}
int createOnUIThead(HWND hWnd, void** ppRet, BOOL display, BOOL screnCast)
{
- static BOOL __isScreenCastFalse = FALSE;
- static BOOL __isScreenCastTrue = TRUE;
- if(!ppRet){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (IsMainThread()) {
- return createOnCurrentThead(hWnd, ppRet, display, screnCast);
- }
- else{
- TSK_DEBUG_INFO("Create DirectShow element on worker thread");
- HANDLE event = NULL;
- int ret = 0;
- DWORD retWait, retryCount = 3;
-
- if(!hWnd){
- if (!(hWnd = FindWindow(NULL, TEXT("Boghe - IMS/RCS Client")))) {
- if(!(hWnd = GetMainWindow())){
- TSK_DEBUG_ERROR("No Window handle could be used");
- return -2;
- }
- }
- }
+ static BOOL __isScreenCastFalse = FALSE;
+ static BOOL __isScreenCastTrue = TRUE;
+ if(!ppRet) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (IsMainThread()) {
+ return createOnCurrentThead(hWnd, ppRet, display, screnCast);
+ }
+ else {
+ TSK_DEBUG_INFO("Create DirectShow element on worker thread");
+ HANDLE event = NULL;
+ int ret = 0;
+ DWORD retWait, retryCount = 3;
+
+ if(!hWnd) {
+ if (!(hWnd = FindWindow(NULL, TEXT("Boghe - IMS/RCS Client")))) {
+ if(!(hWnd = GetMainWindow())) {
+ TSK_DEBUG_ERROR("No Window handle could be used");
+ return -2;
+ }
+ }
+ }
#if defined(_WIN32_WCE)
- WNDPROC wndProc = (WNDPROC) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) __create__WndProcWindow);
+ WNDPROC wndProc = (WNDPROC) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) __create__WndProcWindow);
#else
- WNDPROC wndProc = (WNDPROC) SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) __create__WndProcWindow);
+ WNDPROC wndProc = (WNDPROC) SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) __create__WndProcWindow);
#endif
- if (!wndProc) {
- TSK_DEBUG_ERROR("SetWindowLongPtr() failed with errcode=%d", GetLastError());
- return createOnCurrentThead(hWnd, ppRet, display, screnCast);
- }
-
- if (!(event = CreateEvent(NULL, TRUE, FALSE, NULL))) {
- TSK_DEBUG_ERROR("Failed to create new event");
- ret = -4; goto bail;
- }
- SetProp(hWnd, TEXT("screnCast"), screnCast ? &__isScreenCastTrue : &__isScreenCastFalse);
- if (!PostMessage(hWnd, display ? WM_CREATE_DISPLAY_ON_UI_THREAD : WM_CREATE_GRABBER_ON_UI_THREAD, reinterpret_cast<WPARAM>(event), reinterpret_cast<LPARAM>(ppRet))) {
- TSK_DEBUG_ERROR("PostMessageA() failed");
- ret = -5; goto bail;
- }
-
- do {
- retWait = WaitForSingleObject(event, WM_CREATE_ON_UI_THREAD_TIMEOUT);
- }
- while (retryCount-- > 0 && (retWait == WAIT_TIMEOUT));
-
- bail:
- // restore
- if (hWnd && wndProc) {
+ if (!wndProc) {
+ TSK_DEBUG_ERROR("SetWindowLongPtr() failed with errcode=%d", GetLastError());
+ return createOnCurrentThead(hWnd, ppRet, display, screnCast);
+ }
+
+ if (!(event = CreateEvent(NULL, TRUE, FALSE, NULL))) {
+ TSK_DEBUG_ERROR("Failed to create new event");
+ ret = -4;
+ goto bail;
+ }
+ SetProp(hWnd, TEXT("screnCast"), screnCast ? &__isScreenCastTrue : &__isScreenCastFalse);
+ if (!PostMessage(hWnd, display ? WM_CREATE_DISPLAY_ON_UI_THREAD : WM_CREATE_GRABBER_ON_UI_THREAD, reinterpret_cast<WPARAM>(event), reinterpret_cast<LPARAM>(ppRet))) {
+ TSK_DEBUG_ERROR("PostMessageA() failed");
+ ret = -5;
+ goto bail;
+ }
+
+ do {
+ retWait = WaitForSingleObject(event, WM_CREATE_ON_UI_THREAD_TIMEOUT);
+ }
+ while (retryCount-- > 0 && (retWait == WAIT_TIMEOUT));
+
+bail:
+ // restore
+ if (hWnd && wndProc) {
#if defined(_WIN32_WCE)
- SetWindowLong(hWnd, GWL_WNDPROC, (LONG)wndProc);
+ SetWindowLong(hWnd, GWL_WNDPROC, (LONG)wndProc);
#else
- SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
+ SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
#endif
- }
- if (event) {
- CloseHandle(event);
- }
+ }
+ if (event) {
+ CloseHandle(event);
+ }
- return ret;
- }
+ return ret;
+ }
} \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/DSUtils.h b/plugins/pluginDirectShow/internals/DSUtils.h
index 09690ea..4d4cc97 100755
--- a/plugins/pluginDirectShow/internals/DSUtils.h
+++ b/plugins/pluginDirectShow/internals/DSUtils.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/pluginDirectShow/internals/Resizer.cxx b/plugins/pluginDirectShow/internals/Resizer.cxx
index 32bcfac..94db49e 100755
--- a/plugins/pluginDirectShow/internals/Resizer.cxx
+++ b/plugins/pluginDirectShow/internals/Resizer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,19 +33,19 @@
#define STRETCH_2_1 7
void __stdcall StretchDIB(
- LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of destination
- LPVOID lpvDst, // --> to destination bits
- int DstX, // Destination origin - x coordinate
- int DstY, // Destination origin - y coordinate
- int DstXE, // x extent of the BLT
- int DstYE, // y extent of the BLT
- LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of source
- LPVOID lpvSrc, // --> to source bits
- int SrcX, // Source origin - x coordinate
- int SrcY, // Source origin - y coordinate
- int SrcXE, // x extent of the BLT
- int SrcYE // y extent of the BLT
- );
+ LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of destination
+ LPVOID lpvDst, // --> to destination bits
+ int DstX, // Destination origin - x coordinate
+ int DstY, // Destination origin - y coordinate
+ int DstXE, // x extent of the BLT
+ int DstYE, // y extent of the BLT
+ LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of source
+ LPVOID lpvSrc, // --> to source bits
+ int SrcX, // Source origin - x coordinate
+ int SrcY, // Source origin - y coordinate
+ int SrcXE, // x extent of the BLT
+ int SrcYE // y extent of the BLT
+);
/*
* an X_FUNC is a function that copies one scanline, stretching or shrinking it
@@ -63,10 +63,10 @@ void __stdcall StretchDIB(
* the fraction is multiplied by 65536.
*/
typedef void (*X_FUNC) (LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract);
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract);
void X_Stretch_1_1_8Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE, int DstXE, int x_fract);
@@ -97,23 +97,23 @@ void X_Stretch_N_1_32Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE, int DstXE, int
*/
void Y_Stretch_1_N(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract,
- X_FUNC x_func, int nBits);
+ int DstYE, int SrcWidth, int DstWidth, int x_fract,
+ X_FUNC x_func, int nBits);
void Y_Stretch_N_1(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract,
- X_FUNC x_func);
+ int DstYE, int SrcWidth, int DstWidth, int x_fract,
+ X_FUNC x_func);
/*
* special case y-stretch functions for 1:2 in both dimensions for 8 and 16 bits
* takes no X_FUNC arg. Will do entire stretch.
*/
void Stretch_1_2_8Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract);
+ int DstYE, int SrcWidth, int DstWidth, int x_fract);
void Stretch_1_2_16Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract);
+ int DstYE, int SrcWidth, int DstWidth, int x_fract);
/* straight copy of one scanline of count bytes */
void X_CopyScanline(LPBYTE lpSrc, LPBYTE lpDst, int count);
@@ -123,27 +123,27 @@ void X_CopyScanline(LPBYTE lpSrc, LPBYTE lpDst, int count);
// Resize function
//
void ResizeRGB( BITMAPINFOHEADER *pbiIn, //Src's BitMapInFoHeader
- const unsigned char * dibBits, //Src bits
- BITMAPINFOHEADER *pbiOut,
- unsigned char *pFrame, //Dst bits
- int iNewWidth, //new W in pixel
- int iNewHeight) //new H in pixel
-{
- StretchDIB( pbiOut, // --> BITMAPINFO of destination
- pFrame, // --> to destination bits
- 0, // Destination origin - x coordinate
- 0, // Destination origin - y coordinate
- iNewWidth, // x extent of the BLT
- iNewHeight, // y extent of the BLT
- pbiIn, // --> BITMAPINFO of destination
- (void*) dibBits, // --> to source bits
- 0, // Source origin - x coordinate
- 0, // Source origin - y coordinate
- pbiIn->biWidth, // x extent of the BLT
- pbiIn->biHeight // y extent of the BLT
- );
-
- return;
+ const unsigned char * dibBits, //Src bits
+ BITMAPINFOHEADER *pbiOut,
+ unsigned char *pFrame, //Dst bits
+ int iNewWidth, //new W in pixel
+ int iNewHeight) //new H in pixel
+{
+ StretchDIB( pbiOut, // --> BITMAPINFO of destination
+ pFrame, // --> to destination bits
+ 0, // Destination origin - x coordinate
+ 0, // Destination origin - y coordinate
+ iNewWidth, // x extent of the BLT
+ iNewHeight, // y extent of the BLT
+ pbiIn, // --> BITMAPINFO of destination
+ (void*) dibBits, // --> to source bits
+ 0, // Source origin - x coordinate
+ 0, // Source origin - y coordinate
+ pbiIn->biWidth, // x extent of the BLT
+ pbiIn->biHeight // y extent of the BLT
+ );
+
+ return;
}
@@ -166,44 +166,49 @@ StretchFactor(int SrcE, int DstE, int *pfract)
{
- if (SrcE == DstE) {
- if (pfract != NULL) {
- pfract = 0;
- }
-
- return(STRETCH_1_1);
-
- }
-
-
- if (SrcE > DstE) {
- if (pfract != NULL) {
- *pfract = ( (DstE << 16) / SrcE) & 0xffff;
- }
-
- if (SrcE == (DstE * 2)) {
- return(STRETCH_2_1);
- } else if (SrcE == (DstE * 4)) {
- return(STRETCH_4_1);
- } else {
- return(STRETCH_N_1);
- }
-
- } else {
-
- /* calculate delta fraction based on smallest / largest */
- if (pfract != NULL) {
- *pfract = ( (SrcE << 16) / DstE) & 0xffff;
- }
-
- if (DstE == (SrcE * 2)) {
- return(STRETCH_1_2);
- } else if (DstE == (SrcE * 4)) {
- return(STRETCH_1_4);
- } else {
- return(STRETCH_1_N);
- }
- }
+ if (SrcE == DstE) {
+ if (pfract != NULL) {
+ pfract = 0;
+ }
+
+ return(STRETCH_1_1);
+
+ }
+
+
+ if (SrcE > DstE) {
+ if (pfract != NULL) {
+ *pfract = ( (DstE << 16) / SrcE) & 0xffff;
+ }
+
+ if (SrcE == (DstE * 2)) {
+ return(STRETCH_2_1);
+ }
+ else if (SrcE == (DstE * 4)) {
+ return(STRETCH_4_1);
+ }
+ else {
+ return(STRETCH_N_1);
+ }
+
+ }
+ else {
+
+ /* calculate delta fraction based on smallest / largest */
+ if (pfract != NULL) {
+ *pfract = ( (SrcE << 16) / DstE) & 0xffff;
+ }
+
+ if (DstE == (SrcE * 2)) {
+ return(STRETCH_1_2);
+ }
+ else if (DstE == (SrcE * 4)) {
+ return(STRETCH_1_4);
+ }
+ else {
+ return(STRETCH_1_N);
+ }
+ }
}
@@ -216,226 +221,227 @@ StretchFactor(int SrcE, int DstE, int *pfract)
void FAR PASCAL
StretchDIB(
- LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of destination
- LPVOID lpvDst, // --> to destination bits
- int DstX, // Destination origin - x coordinate
- int DstY, // Destination origin - y coordinate
- int DstXE, // x extent of the BLT
- int DstYE, // y extent of the BLT
- LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of source
- LPVOID lpvSrc, // --> to source bits
- int SrcX, // Source origin - x coordinate
- int SrcY, // Source origin - y coordinate
- int SrcXE, // x extent of the BLT
- int SrcYE // y extent of the BLT
- )
+ LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of destination
+ LPVOID lpvDst, // --> to destination bits
+ int DstX, // Destination origin - x coordinate
+ int DstY, // Destination origin - y coordinate
+ int DstXE, // x extent of the BLT
+ int DstYE, // y extent of the BLT
+ LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of source
+ LPVOID lpvSrc, // --> to source bits
+ int SrcX, // Source origin - x coordinate
+ int SrcY, // Source origin - y coordinate
+ int SrcXE, // x extent of the BLT
+ int SrcYE // y extent of the BLT
+)
{
- int nBits;
- int SrcWidth, DstWidth;
- LPBYTE lpDst = (LPBYTE)lpvDst, lpSrc = (LPBYTE)lpvSrc;
- int x_fract;
- int x_factor;
- int y_factor;
- X_FUNC xfunc;
-
-
- /*
- * chek that sizes are not same
- */
- /*if(DstXE == SrcXE && DstYE == SrcYE)
- {
- return;
- }*/
- /*
- * check that bit depths are same and 8, 16 or 24
- */
-
- if ((nBits = biDst->biBitCount) != biSrc->biBitCount) {
- return;
- }
-
- if ( (nBits != 8 ) && (nBits != 16) && (nBits != 24) &&
- (nBits != 32)) {
- return;
- }
-
- /*
- * check that extents are not bad
- */
- if ( (SrcXE <= 0) || (SrcYE <= 0) || (DstXE <= 0) || (DstYE <= 0)) {
- return;
- }
-
- /*
- * calculate width of one scan line in bytes, rounded up to
- * DWORD boundary.
- */
- SrcWidth = (((biSrc->biWidth * nBits) + 31) & ~31) / 8;
- DstWidth = (((biDst->biWidth * nBits) + 31) & ~31) / 8;
-
- /*
- * set initial source and dest pointers
- */
- lpSrc += (SrcY * SrcWidth) + ((SrcX * nBits) / 8);
- lpDst += (DstY * DstWidth) + ((DstX * nBits) / 8);
-
-
- /*
- * calculate stretch proportions (1:1, 1:2, 1:N, N:1 etc) and
- * also the fractional stretch factor. (we are not interested in
- * the y stretch fraction - this is only used in x stretching.
- */
-
- y_factor = StretchFactor(SrcYE, DstYE, NULL);
- x_factor = StretchFactor(SrcXE, DstXE, &x_fract);
-
- /*
- * we have special case routines for 1:2 in both dimensions
- * for 8 and 16 bits
- */
- if ((y_factor == x_factor) && (y_factor == STRETCH_1_2)) {
-
- if (nBits == 8) {
- //StartCounting();
- Stretch_1_2_8Bits(lpSrc, lpDst, SrcXE, SrcYE,
- DstXE, DstYE, SrcWidth, DstWidth,
- x_fract);
- //EndCounting("8 bit");
- return;
-
- } else if (nBits == 16) {
- //StartCounting();
- Stretch_1_2_16Bits(lpSrc, lpDst, SrcXE, SrcYE,
- DstXE, DstYE, SrcWidth, DstWidth,
- x_fract);
- //EndCounting("16 bit");
- return;
- }
- }
-
-
- /* pick an X stretch function */
- switch(nBits) {
-
- case 8:
- switch(x_factor) {
- case STRETCH_1_1:
- xfunc = X_Stretch_1_1_8Bits;
- break;
-
- case STRETCH_1_2:
- xfunc = X_Stretch_1_2_8Bits;
- break;
-
- case STRETCH_1_4:
- xfunc = X_Stretch_1_4_8Bits;
- break;
-
- case STRETCH_1_N:
- xfunc = X_Stretch_1_N_8Bits;
- break;
-
- case STRETCH_N_1:
- case STRETCH_4_1:
- case STRETCH_2_1:
- xfunc = X_Stretch_N_1_8Bits;
- break;
-
- }
- break;
-
- case 16:
- switch(x_factor) {
- case STRETCH_1_1:
- xfunc = X_Stretch_1_1_16Bits;
- break;
-
- case STRETCH_1_2:
- xfunc = X_Stretch_1_2_16Bits;
- break;
-
- case STRETCH_1_4:
- case STRETCH_1_N:
- xfunc = X_Stretch_1_N_16Bits;
- break;
-
- case STRETCH_N_1:
- case STRETCH_4_1:
- case STRETCH_2_1:
- xfunc = X_Stretch_N_1_16Bits;
- break;
-
- }
- break;
-
- case 24:
- switch(x_factor) {
- case STRETCH_1_1:
- xfunc = X_Stretch_1_1_24Bits;
- break;
-
- case STRETCH_1_2:
- case STRETCH_1_4:
- case STRETCH_1_N:
- xfunc = X_Stretch_1_N_24Bits;
- break;
-
- case STRETCH_N_1:
- case STRETCH_4_1:
- case STRETCH_2_1:
- xfunc = X_Stretch_N_1_24Bits;
- break;
-
- }
- break;
-
- case 32:
- switch(x_factor) {
- case STRETCH_1_1:
- xfunc = X_Stretch_1_1_32Bits;
- break;
-
- case STRETCH_1_2:
- case STRETCH_1_4:
- case STRETCH_1_N:
- xfunc = X_Stretch_1_N_32Bits;
- break;
-
- case STRETCH_N_1:
- case STRETCH_4_1:
- case STRETCH_2_1:
- xfunc = X_Stretch_N_1_32Bits;
- break;
-
- }
- break;
-
- }
-
-
- /*
- * now call appropriate stretching function depending
- * on the y stretch factor
- */
- switch (y_factor) {
- case STRETCH_1_1:
- case STRETCH_1_2:
- case STRETCH_1_4:
- case STRETCH_1_N:
- Y_Stretch_1_N(lpSrc, lpDst, SrcXE, SrcYE,
- DstXE, DstYE, SrcWidth, DstWidth, x_fract, xfunc, nBits);
- break;
-
- case STRETCH_N_1:
- case STRETCH_4_1:
- case STRETCH_2_1:
- Y_Stretch_N_1(lpSrc, lpDst, SrcXE, SrcYE,
- DstXE, DstYE, SrcWidth, DstWidth, x_fract, xfunc);
- break;
-
- }
- return;
+ int nBits;
+ int SrcWidth, DstWidth;
+ LPBYTE lpDst = (LPBYTE)lpvDst, lpSrc = (LPBYTE)lpvSrc;
+ int x_fract;
+ int x_factor;
+ int y_factor;
+ X_FUNC xfunc;
+
+
+ /*
+ * chek that sizes are not same
+ */
+ /*if(DstXE == SrcXE && DstYE == SrcYE)
+ {
+ return;
+ }*/
+ /*
+ * check that bit depths are same and 8, 16 or 24
+ */
+
+ if ((nBits = biDst->biBitCount) != biSrc->biBitCount) {
+ return;
+ }
+
+ if ( (nBits != 8 ) && (nBits != 16) && (nBits != 24) &&
+ (nBits != 32)) {
+ return;
+ }
+
+ /*
+ * check that extents are not bad
+ */
+ if ( (SrcXE <= 0) || (SrcYE <= 0) || (DstXE <= 0) || (DstYE <= 0)) {
+ return;
+ }
+
+ /*
+ * calculate width of one scan line in bytes, rounded up to
+ * DWORD boundary.
+ */
+ SrcWidth = (((biSrc->biWidth * nBits) + 31) & ~31) / 8;
+ DstWidth = (((biDst->biWidth * nBits) + 31) & ~31) / 8;
+
+ /*
+ * set initial source and dest pointers
+ */
+ lpSrc += (SrcY * SrcWidth) + ((SrcX * nBits) / 8);
+ lpDst += (DstY * DstWidth) + ((DstX * nBits) / 8);
+
+
+ /*
+ * calculate stretch proportions (1:1, 1:2, 1:N, N:1 etc) and
+ * also the fractional stretch factor. (we are not interested in
+ * the y stretch fraction - this is only used in x stretching.
+ */
+
+ y_factor = StretchFactor(SrcYE, DstYE, NULL);
+ x_factor = StretchFactor(SrcXE, DstXE, &x_fract);
+
+ /*
+ * we have special case routines for 1:2 in both dimensions
+ * for 8 and 16 bits
+ */
+ if ((y_factor == x_factor) && (y_factor == STRETCH_1_2)) {
+
+ if (nBits == 8) {
+ //StartCounting();
+ Stretch_1_2_8Bits(lpSrc, lpDst, SrcXE, SrcYE,
+ DstXE, DstYE, SrcWidth, DstWidth,
+ x_fract);
+ //EndCounting("8 bit");
+ return;
+
+ }
+ else if (nBits == 16) {
+ //StartCounting();
+ Stretch_1_2_16Bits(lpSrc, lpDst, SrcXE, SrcYE,
+ DstXE, DstYE, SrcWidth, DstWidth,
+ x_fract);
+ //EndCounting("16 bit");
+ return;
+ }
+ }
+
+
+ /* pick an X stretch function */
+ switch(nBits) {
+
+ case 8:
+ switch(x_factor) {
+ case STRETCH_1_1:
+ xfunc = X_Stretch_1_1_8Bits;
+ break;
+
+ case STRETCH_1_2:
+ xfunc = X_Stretch_1_2_8Bits;
+ break;
+
+ case STRETCH_1_4:
+ xfunc = X_Stretch_1_4_8Bits;
+ break;
+
+ case STRETCH_1_N:
+ xfunc = X_Stretch_1_N_8Bits;
+ break;
+
+ case STRETCH_N_1:
+ case STRETCH_4_1:
+ case STRETCH_2_1:
+ xfunc = X_Stretch_N_1_8Bits;
+ break;
+
+ }
+ break;
+
+ case 16:
+ switch(x_factor) {
+ case STRETCH_1_1:
+ xfunc = X_Stretch_1_1_16Bits;
+ break;
+
+ case STRETCH_1_2:
+ xfunc = X_Stretch_1_2_16Bits;
+ break;
+
+ case STRETCH_1_4:
+ case STRETCH_1_N:
+ xfunc = X_Stretch_1_N_16Bits;
+ break;
+
+ case STRETCH_N_1:
+ case STRETCH_4_1:
+ case STRETCH_2_1:
+ xfunc = X_Stretch_N_1_16Bits;
+ break;
+
+ }
+ break;
+
+ case 24:
+ switch(x_factor) {
+ case STRETCH_1_1:
+ xfunc = X_Stretch_1_1_24Bits;
+ break;
+
+ case STRETCH_1_2:
+ case STRETCH_1_4:
+ case STRETCH_1_N:
+ xfunc = X_Stretch_1_N_24Bits;
+ break;
+
+ case STRETCH_N_1:
+ case STRETCH_4_1:
+ case STRETCH_2_1:
+ xfunc = X_Stretch_N_1_24Bits;
+ break;
+
+ }
+ break;
+
+ case 32:
+ switch(x_factor) {
+ case STRETCH_1_1:
+ xfunc = X_Stretch_1_1_32Bits;
+ break;
+
+ case STRETCH_1_2:
+ case STRETCH_1_4:
+ case STRETCH_1_N:
+ xfunc = X_Stretch_1_N_32Bits;
+ break;
+
+ case STRETCH_N_1:
+ case STRETCH_4_1:
+ case STRETCH_2_1:
+ xfunc = X_Stretch_N_1_32Bits;
+ break;
+
+ }
+ break;
+
+ }
+
+
+ /*
+ * now call appropriate stretching function depending
+ * on the y stretch factor
+ */
+ switch (y_factor) {
+ case STRETCH_1_1:
+ case STRETCH_1_2:
+ case STRETCH_1_4:
+ case STRETCH_1_N:
+ Y_Stretch_1_N(lpSrc, lpDst, SrcXE, SrcYE,
+ DstXE, DstYE, SrcWidth, DstWidth, x_fract, xfunc, nBits);
+ break;
+
+ case STRETCH_N_1:
+ case STRETCH_4_1:
+ case STRETCH_2_1:
+ Y_Stretch_N_1(lpSrc, lpDst, SrcXE, SrcYE,
+ DstXE, DstYE, SrcWidth, DstWidth, x_fract, xfunc);
+ break;
+
+ }
+ return;
}
@@ -456,49 +462,50 @@ StretchDIB(
void
Y_Stretch_1_N(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int SrcYE,
- int DstXE,
- int DstYE,
- int SrcWidth,
- int DstWidth,
- int x_fract,
- X_FUNC x_func,
- int nBits)
+ LPBYTE lpDst,
+ int SrcXE,
+ int SrcYE,
+ int DstXE,
+ int DstYE,
+ int SrcWidth,
+ int DstWidth,
+ int x_fract,
+ X_FUNC x_func,
+ int nBits)
{
- int ydelta;
- register int i;
- LPBYTE lpPrev = NULL;
-
- ydelta = DstYE -1;
-
- for (i = 0; i < DstYE; i++) {
-
- /* have we already stretched this scanline ? */
- if (lpPrev == NULL) {
- /* no - copy one scanline */
- (*x_func)(lpSrc, lpDst, SrcXE, DstXE, x_fract);
- lpPrev = lpDst;
- } else {
- /* yes - this is a duplicate scanline. do
- * a straight copy of one that has already
- * been stretched/shrunk
- */
- X_CopyScanline(lpPrev, lpDst, DstXE * nBits / 8);
- }
-
- /* advance dest pointer */
- lpDst += DstWidth;
-
- /* should we advance source pointer this time ? */
- if ( (ydelta -= SrcYE) < 0) {
- ydelta += DstYE;
- lpSrc += SrcWidth;
- lpPrev = NULL;
- }
- }
+ int ydelta;
+ register int i;
+ LPBYTE lpPrev = NULL;
+
+ ydelta = DstYE -1;
+
+ for (i = 0; i < DstYE; i++) {
+
+ /* have we already stretched this scanline ? */
+ if (lpPrev == NULL) {
+ /* no - copy one scanline */
+ (*x_func)(lpSrc, lpDst, SrcXE, DstXE, x_fract);
+ lpPrev = lpDst;
+ }
+ else {
+ /* yes - this is a duplicate scanline. do
+ * a straight copy of one that has already
+ * been stretched/shrunk
+ */
+ X_CopyScanline(lpPrev, lpDst, DstXE * nBits / 8);
+ }
+
+ /* advance dest pointer */
+ lpDst += DstWidth;
+
+ /* should we advance source pointer this time ? */
+ if ( (ydelta -= SrcYE) < 0) {
+ ydelta += DstYE;
+ lpSrc += SrcWidth;
+ lpPrev = NULL;
+ }
+ }
}
@@ -510,38 +517,39 @@ Y_Stretch_1_N(LPBYTE lpSrc,
*/
void
Y_Stretch_N_1(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int SrcYE,
- int DstXE,
- int DstYE,
- int SrcWidth,
- int DstWidth,
- int x_fract,
- X_FUNC x_func)
+ LPBYTE lpDst,
+ int SrcXE,
+ int SrcYE,
+ int DstXE,
+ int DstYE,
+ int SrcWidth,
+ int DstWidth,
+ int x_fract,
+ X_FUNC x_func)
{
- int ydelta;
- register int i;
+ int ydelta;
+ register int i;
- ydelta = SrcYE -1;
+ ydelta = SrcYE -1;
- for (i = 0; i < DstYE; i++) {
+ for (i = 0; i < DstYE; i++) {
- /* copy one scanline */
- (*x_func)(lpSrc, lpDst, SrcXE, DstXE, x_fract);
+ /* copy one scanline */
+ (*x_func)(lpSrc, lpDst, SrcXE, DstXE, x_fract);
- /* advance dest pointer */
- lpDst += DstWidth;
+ /* advance dest pointer */
+ lpDst += DstWidth;
- /* how many times do we advance source pointer this time ? */
- do {
- lpSrc += SrcWidth;
- ydelta -= DstYE;
- } while (ydelta >= 0);
+ /* how many times do we advance source pointer this time ? */
+ do {
+ lpSrc += SrcWidth;
+ ydelta -= DstYE;
+ }
+ while (ydelta >= 0);
- ydelta += SrcYE;
- }
+ ydelta += SrcYE;
+ }
}
/* ---8-bit X stretching -------------------------------------------------- */
@@ -553,27 +561,27 @@ Y_Stretch_N_1(LPBYTE lpSrc,
*/
void
X_Stretch_1_N_8Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = DstXE -1;
+ xdelta = DstXE -1;
- for (i = 0; i < DstXE; i++) {
+ for (i = 0; i < DstXE; i++) {
- /* copy one byte and advance dest */
- *lpDst++ = *lpSrc;
+ /* copy one byte and advance dest */
+ *lpDst++ = *lpSrc;
- /* should we advance source pointer this time ? */
- if ( (xdelta -= SrcXE) < 0) {
- xdelta += DstXE;
- lpSrc++;
- }
- }
+ /* should we advance source pointer this time ? */
+ if ( (xdelta -= SrcXE) < 0) {
+ xdelta += DstXE;
+ lpSrc++;
+ }
+ }
}
@@ -584,29 +592,30 @@ X_Stretch_1_N_8Bits(LPBYTE lpSrc,
*/
void
X_Stretch_N_1_8Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = SrcXE -1;
+ xdelta = SrcXE -1;
- for (i = 0; i < DstXE; i++) {
+ for (i = 0; i < DstXE; i++) {
- /* copy one byte and advance dest */
- *lpDst++ = *lpSrc;
+ /* copy one byte and advance dest */
+ *lpDst++ = *lpSrc;
- /* how many times do we advance source pointer this time ? */
- do {
- lpSrc++;
- xdelta -= DstXE;
- } while (xdelta >= 0);
+ /* how many times do we advance source pointer this time ? */
+ do {
+ lpSrc++;
+ xdelta -= DstXE;
+ }
+ while (xdelta >= 0);
- xdelta += SrcXE;
- }
+ xdelta += SrcXE;
+ }
}
/*
@@ -616,51 +625,52 @@ X_Stretch_N_1_8Bits(LPBYTE lpSrc,
void
X_CopyScanline(LPBYTE lpSrc, LPBYTE lpDst, int count)
{
- register int i;
-
- /*
- * if the alignment of lpSrc and lpDst is the same, then
- * we can get them aligned and do a faster copy
- */
- if (((DWORD_PTR) lpSrc & 0x3) == ( (DWORD_PTR) lpDst & 0x3)) {
-
- /* align on WORD boundary */
- if ( (DWORD_PTR) lpSrc & 0x1) {
- *lpDst++ = *lpSrc++;
- count--;
- }
-
- /* align on DWORD boundary */
- if ((DWORD_PTR) lpSrc & 0x2) {
- * ((LPWORD) lpDst) = *((LPWORD) lpSrc);
- lpDst += sizeof(WORD);
- lpSrc += sizeof(WORD);
- count -= sizeof(WORD);
- }
-
- /* copy whole DWORDS */
- for ( i = (count / 4); i > 0; i--) {
- *((LPDWORD) lpDst) = *((LPDWORD) lpSrc);
- lpSrc += sizeof(DWORD);
- lpDst += sizeof(DWORD);
- }
- } else {
- /* the lpSrc and lpDst pointers are different
- * alignment, so leave them unaligned and
- * copy all the whole DWORDs
- */
- for (i = (count / 4); i> 0; i--) {
- *( (DWORD UNALIGNED FAR *) lpDst) =
- *((DWORD UNALIGNED FAR *) lpSrc);
- lpSrc += sizeof(DWORD);
- lpDst += sizeof(DWORD);
- }
- }
-
- /* in either case, copy last (up to 3) bytes. */
- for ( i = count % 4; i > 0; i--) {
- *lpDst++ = *lpSrc++;
- }
+ register int i;
+
+ /*
+ * if the alignment of lpSrc and lpDst is the same, then
+ * we can get them aligned and do a faster copy
+ */
+ if (((DWORD_PTR) lpSrc & 0x3) == ( (DWORD_PTR) lpDst & 0x3)) {
+
+ /* align on WORD boundary */
+ if ( (DWORD_PTR) lpSrc & 0x1) {
+ *lpDst++ = *lpSrc++;
+ count--;
+ }
+
+ /* align on DWORD boundary */
+ if ((DWORD_PTR) lpSrc & 0x2) {
+ * ((LPWORD) lpDst) = *((LPWORD) lpSrc);
+ lpDst += sizeof(WORD);
+ lpSrc += sizeof(WORD);
+ count -= sizeof(WORD);
+ }
+
+ /* copy whole DWORDS */
+ for ( i = (count / 4); i > 0; i--) {
+ *((LPDWORD) lpDst) = *((LPDWORD) lpSrc);
+ lpSrc += sizeof(DWORD);
+ lpDst += sizeof(DWORD);
+ }
+ }
+ else {
+ /* the lpSrc and lpDst pointers are different
+ * alignment, so leave them unaligned and
+ * copy all the whole DWORDs
+ */
+ for (i = (count / 4); i> 0; i--) {
+ *( (DWORD UNALIGNED FAR *) lpDst) =
+ *((DWORD UNALIGNED FAR *) lpSrc);
+ lpSrc += sizeof(DWORD);
+ lpDst += sizeof(DWORD);
+ }
+ }
+
+ /* in either case, copy last (up to 3) bytes. */
+ for ( i = count % 4; i > 0; i--) {
+ *lpDst++ = *lpSrc++;
+ }
}
/*
@@ -670,13 +680,13 @@ X_CopyScanline(LPBYTE lpSrc, LPBYTE lpDst, int count)
*/
void
X_Stretch_1_1_8Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- X_CopyScanline(lpSrc, lpDst, DstXE);
+ X_CopyScanline(lpSrc, lpDst, DstXE);
}
@@ -687,22 +697,22 @@ X_Stretch_1_1_8Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_2_8Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- WORD wPix;
- register int i;
+ WORD wPix;
+ register int i;
- for (i = 0; i < SrcXE; i++) {
+ for (i = 0; i < SrcXE; i++) {
- /* get a pixel and double it */
- wPix = *lpSrc++;
- wPix |= (wPix << 8);
- * ((WORD UNALIGNED *) lpDst) = wPix;
- lpDst += sizeof(WORD);
- }
+ /* get a pixel and double it */
+ wPix = *lpSrc++;
+ wPix |= (wPix << 8);
+ * ((WORD UNALIGNED *) lpDst) = wPix;
+ lpDst += sizeof(WORD);
+ }
}
@@ -713,23 +723,23 @@ X_Stretch_1_2_8Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_4_8Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- DWORD dwPix;
- register int i;
-
- for (i = 0; i < SrcXE; i++) {
-
- /* get a pixel and make four copies of it */
- dwPix = *lpSrc++;
- dwPix |= (dwPix <<8);
- dwPix |= (dwPix << 16);
- * ((DWORD UNALIGNED *) lpDst) = dwPix;
- lpDst += sizeof(DWORD);
- }
+ DWORD dwPix;
+ register int i;
+
+ for (i = 0; i < SrcXE; i++) {
+
+ /* get a pixel and make four copies of it */
+ dwPix = *lpSrc++;
+ dwPix |= (dwPix <<8);
+ dwPix |= (dwPix << 16);
+ * ((DWORD UNALIGNED *) lpDst) = dwPix;
+ lpDst += sizeof(DWORD);
+ }
}
@@ -740,13 +750,13 @@ X_Stretch_1_4_8Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_1_16Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- X_CopyScanline(lpSrc, lpDst, DstXE * sizeof(WORD));
+ X_CopyScanline(lpSrc, lpDst, DstXE * sizeof(WORD));
}
@@ -756,25 +766,25 @@ X_Stretch_1_1_16Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_2_16Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- DWORD dwPix;
- register int i;
+ DWORD dwPix;
+ register int i;
- for (i = 0; i < SrcXE; i++) {
+ for (i = 0; i < SrcXE; i++) {
- /* get a pixel and double it */
- dwPix = * ((WORD *)lpSrc);
- dwPix |= (dwPix << 16);
- * ((DWORD UNALIGNED *) lpDst) = dwPix;
+ /* get a pixel and double it */
+ dwPix = * ((WORD *)lpSrc);
+ dwPix |= (dwPix << 16);
+ * ((DWORD UNALIGNED *) lpDst) = dwPix;
- lpDst += sizeof(DWORD);
- lpSrc += sizeof(WORD);
- }
+ lpDst += sizeof(DWORD);
+ lpSrc += sizeof(WORD);
+ }
}
@@ -783,29 +793,29 @@ X_Stretch_1_2_16Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_N_16Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = DstXE -1;
+ xdelta = DstXE -1;
- for (i = 0; i < DstXE; i++) {
+ for (i = 0; i < DstXE; i++) {
- /* copy one pixel and advance dest */
- *((WORD *) lpDst) = *((WORD *) lpSrc);
+ /* copy one pixel and advance dest */
+ *((WORD *) lpDst) = *((WORD *) lpSrc);
- lpDst += sizeof(WORD);
+ lpDst += sizeof(WORD);
- /* should we advance source pointer this time ? */
- if ( (xdelta -= SrcXE) < 0) {
- xdelta += DstXE;
- lpSrc += sizeof(WORD);
- }
- }
+ /* should we advance source pointer this time ? */
+ if ( (xdelta -= SrcXE) < 0) {
+ xdelta += DstXE;
+ lpSrc += sizeof(WORD);
+ }
+ }
}
/*
@@ -813,32 +823,33 @@ X_Stretch_1_N_16Bits(LPBYTE lpSrc,
*/
void
X_Stretch_N_1_16Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = SrcXE -1;
+ xdelta = SrcXE -1;
- for (i = 0; i < DstXE; i++) {
+ for (i = 0; i < DstXE; i++) {
- /* copy one pixel and advance dest */
- *((WORD *) lpDst) = *((WORD *)lpSrc);
+ /* copy one pixel and advance dest */
+ *((WORD *) lpDst) = *((WORD *)lpSrc);
- lpDst += sizeof(WORD);
+ lpDst += sizeof(WORD);
- /* how many times do we advance source pointer this time ? */
- do {
- lpSrc += sizeof(WORD);
- xdelta -= DstXE;
- } while (xdelta >= 0);
+ /* how many times do we advance source pointer this time ? */
+ do {
+ lpSrc += sizeof(WORD);
+ xdelta -= DstXE;
+ }
+ while (xdelta >= 0);
- xdelta += SrcXE;
- }
+ xdelta += SrcXE;
+ }
}
@@ -850,12 +861,12 @@ X_Stretch_N_1_16Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_1_24Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- X_CopyScanline(lpSrc, lpDst, DstXE * 3);
+ X_CopyScanline(lpSrc, lpDst, DstXE * 3);
}
/*
@@ -863,32 +874,32 @@ X_Stretch_1_1_24Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_N_24Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = DstXE -1;
+ xdelta = DstXE -1;
- for (i = 0; i < DstXE; i++) {
- /* copy first word of pixel and advance dest */
- *((WORD UNALIGNED *) lpDst) = *((WORD UNALIGNED *) lpSrc);
+ for (i = 0; i < DstXE; i++) {
+ /* copy first word of pixel and advance dest */
+ *((WORD UNALIGNED *) lpDst) = *((WORD UNALIGNED *) lpSrc);
- lpDst += sizeof(WORD);
+ lpDst += sizeof(WORD);
- /* copy third byte and advance dest */
- *lpDst++ = lpSrc[sizeof(WORD)];
+ /* copy third byte and advance dest */
+ *lpDst++ = lpSrc[sizeof(WORD)];
- /* should we advance source pointer this time ? */
- if ( (xdelta -= SrcXE) < 0) {
- xdelta += DstXE;
- lpSrc += 3;
- }
- }
+ /* should we advance source pointer this time ? */
+ if ( (xdelta -= SrcXE) < 0) {
+ xdelta += DstXE;
+ lpSrc += 3;
+ }
+ }
}
/*
@@ -896,36 +907,37 @@ X_Stretch_1_N_24Bits(LPBYTE lpSrc,
*/
void
X_Stretch_N_1_24Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- xdelta = SrcXE -1;
+ xdelta = SrcXE -1;
- for (i = 0; i < DstXE; i++) {
+ for (i = 0; i < DstXE; i++) {
- /* copy first word of pixel and advance dest */
- *((WORD UNALIGNED *) lpDst) = *((WORD UNALIGNED *) lpSrc);
+ /* copy first word of pixel and advance dest */
+ *((WORD UNALIGNED *) lpDst) = *((WORD UNALIGNED *) lpSrc);
- lpDst += sizeof(WORD);
+ lpDst += sizeof(WORD);
- /* copy third byte and advance dest */
- *lpDst++ = lpSrc[sizeof(WORD)];
+ /* copy third byte and advance dest */
+ *lpDst++ = lpSrc[sizeof(WORD)];
- /* how many times do we advance source pointer this time ? */
- do {
- lpSrc += 3;
- xdelta -= DstXE;
- } while (xdelta >= 0);
+ /* how many times do we advance source pointer this time ? */
+ do {
+ lpSrc += 3;
+ xdelta -= DstXE;
+ }
+ while (xdelta >= 0);
- xdelta += SrcXE;
- }
-}
+ xdelta += SrcXE;
+ }
+}
/* 32-bits ---------------------------------------------------------*/
@@ -935,12 +947,12 @@ X_Stretch_N_1_24Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_1_32Bits(LPBYTE lpSrc,
- LPBYTE lpDst,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- X_CopyScanline((BYTE*) lpSrc, (BYTE*) lpDst, DstXE * sizeof( RGBQUAD ) );
+ X_CopyScanline((BYTE*) lpSrc, (BYTE*) lpDst, DstXE * sizeof( RGBQUAD ) );
}
/*
@@ -948,34 +960,32 @@ X_Stretch_1_1_32Bits(LPBYTE lpSrc,
*/
void
X_Stretch_1_N_32Bits(LPBYTE lpSrc0,
- LPBYTE lpDst0,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst0,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- RGBQUAD *lpSrc=(RGBQUAD *)lpSrc0;
- RGBQUAD *lpDst=(RGBQUAD *)lpDst0;
+ RGBQUAD *lpSrc=(RGBQUAD *)lpSrc0;
+ RGBQUAD *lpDst=(RGBQUAD *)lpDst0;
- xdelta = DstXE -1;
+ xdelta = DstXE -1;
- for (i = 0; i < DstXE; i++)
- {
- /* copy first word of pixel and advance dest */
- *lpDst = *lpSrc;
- lpDst++;
+ for (i = 0; i < DstXE; i++) {
+ /* copy first word of pixel and advance dest */
+ *lpDst = *lpSrc;
+ lpDst++;
- /* should we advance source pointer this time ? */
- if ( (xdelta -= SrcXE) < 0)
- {
- xdelta += DstXE;
- lpSrc++;
- }
- }
+ /* should we advance source pointer this time ? */
+ if ( (xdelta -= SrcXE) < 0) {
+ xdelta += DstXE;
+ lpSrc++;
+ }
+ }
}
/*
@@ -983,34 +993,33 @@ X_Stretch_1_N_32Bits(LPBYTE lpSrc0,
*/
void
X_Stretch_N_1_32Bits(LPBYTE lpSrc0,
- LPBYTE lpDst0,
- int SrcXE,
- int DstXE,
- int x_fract)
+ LPBYTE lpDst0,
+ int SrcXE,
+ int DstXE,
+ int x_fract)
{
- int xdelta;
- register int i;
+ int xdelta;
+ register int i;
- RGBQUAD *lpSrc=(RGBQUAD *)lpSrc0;
- RGBQUAD *lpDst=(RGBQUAD *)lpDst0;
+ RGBQUAD *lpSrc=(RGBQUAD *)lpSrc0;
+ RGBQUAD *lpDst=(RGBQUAD *)lpDst0;
- xdelta = SrcXE -1;
+ xdelta = SrcXE -1;
- for (i = 0; i < DstXE; i++)
- {
- *lpDst = *lpSrc;
- lpDst++;
+ for (i = 0; i < DstXE; i++) {
+ *lpDst = *lpSrc;
+ lpDst++;
- /* how many times do we advance source pointer this time ? */
- do
- {
- lpSrc++;
- xdelta -= DstXE;
- } while (xdelta >= 0);
+ /* how many times do we advance source pointer this time ? */
+ do {
+ lpSrc++;
+ xdelta -= DstXE;
+ }
+ while (xdelta >= 0);
- xdelta += SrcXE;
- }
-}
+ xdelta += SrcXE;
+ }
+}
@@ -1026,116 +1035,116 @@ X_Stretch_N_1_32Bits(LPBYTE lpSrc0,
*/
void
Stretch_1_2_8Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract)
+ int DstYE, int SrcWidth, int DstWidth, int x_fract)
{
- int SrcInc, DstInc;
- register int i, j;
- WORD wPix;
- DWORD dwPix4;
+ int SrcInc, DstInc;
+ register int i, j;
+ WORD wPix;
+ DWORD dwPix4;
- /* amount to advance source by at the end of each scan */
- SrcInc = SrcWidth - SrcXE;
+ /* amount to advance source by at the end of each scan */
+ SrcInc = SrcWidth - SrcXE;
- /* amount to advance dest by at the end of each scan - note
- * that we write two scans at once, so advance past the next
- * scan line
- */
- DstInc = (DstWidth * 2) - DstXE;
+ /* amount to advance dest by at the end of each scan - note
+ * that we write two scans at once, so advance past the next
+ * scan line
+ */
+ DstInc = (DstWidth * 2) - DstXE;
- /*
- * we would like to copy the pixels DWORD at a time. this means
- * being aligned. if we are currently aligned on a WORD boundary,
- * then copy one pixel to get aligned. If we are on a byte
- * boundary, we can never get aligned, so use the slower loop.
- */
- if ( ((DWORD_PTR)lpDst) & 1) {
+ /*
+ * we would like to copy the pixels DWORD at a time. this means
+ * being aligned. if we are currently aligned on a WORD boundary,
+ * then copy one pixel to get aligned. If we are on a byte
+ * boundary, we can never get aligned, so use the slower loop.
+ */
+ if ( ((DWORD_PTR)lpDst) & 1) {
- /*
- * dest is byte aligned - so we can never align it
- * by writing WORDs - use slow loop.
- */
- for (i = 0; i < SrcYE; i++) {
+ /*
+ * dest is byte aligned - so we can never align it
+ * by writing WORDs - use slow loop.
+ */
+ for (i = 0; i < SrcYE; i++) {
- for (j = 0; j < SrcXE; j++) {
+ for (j = 0; j < SrcXE; j++) {
- /* get a pixel and double it */
+ /* get a pixel and double it */
- wPix = *lpSrc++;
- wPix |= (wPix<<8);
+ wPix = *lpSrc++;
+ wPix |= (wPix<<8);
- /* write doubled pixel to this scanline */
+ /* write doubled pixel to this scanline */
- *( (WORD UNALIGNED *) lpDst) = wPix;
+ *( (WORD UNALIGNED *) lpDst) = wPix;
- /* write double pixel to next scanline */
- *( (WORD UNALIGNED *) (lpDst + DstWidth)) = wPix;
+ /* write double pixel to next scanline */
+ *( (WORD UNALIGNED *) (lpDst + DstWidth)) = wPix;
- lpDst += sizeof(WORD);
- }
- lpSrc += SrcInc;
- lpDst += DstInc;
- }
- return;
- }
+ lpDst += sizeof(WORD);
+ }
+ lpSrc += SrcInc;
+ lpDst += DstInc;
+ }
+ return;
+ }
- /*
- * this will be the aligned version. align each scan line
- */
- for ( i = 0; i < SrcYE; i++) {
+ /*
+ * this will be the aligned version. align each scan line
+ */
+ for ( i = 0; i < SrcYE; i++) {
- /* count of pixels remaining */
- j = SrcXE;
+ /* count of pixels remaining */
+ j = SrcXE;
- /* align this scan line */
- if (((DWORD_PTR)lpDst) & 2) {
+ /* align this scan line */
+ if (((DWORD_PTR)lpDst) & 2) {
- /* word aligned - copy one doubled pixel and we are ok */
- wPix = *lpSrc++;
- wPix |= (wPix << 8);
+ /* word aligned - copy one doubled pixel and we are ok */
+ wPix = *lpSrc++;
+ wPix |= (wPix << 8);
- *( (WORD *) lpDst) = wPix;
- *( (WORD *) (lpDst + DstWidth)) = wPix;
- lpDst += sizeof(WORD);
+ *( (WORD *) lpDst) = wPix;
+ *( (WORD *) (lpDst + DstWidth)) = wPix;
+ lpDst += sizeof(WORD);
- j -= 1;
- }
+ j -= 1;
+ }
- /* now dest is aligned - so loop eating two pixels at a time
- * until there is at most one left
- */
- for ( ; j > 1; j -= 2) {
+ /* now dest is aligned - so loop eating two pixels at a time
+ * until there is at most one left
+ */
+ for ( ; j > 1; j -= 2) {
- /* read two pixels and double them */
- wPix = * ((WORD UNALIGNED *) lpSrc);
- lpSrc += sizeof(WORD);
+ /* read two pixels and double them */
+ wPix = * ((WORD UNALIGNED *) lpSrc);
+ lpSrc += sizeof(WORD);
- dwPix4 = (wPix & 0xff) | ((wPix & 0xff) << 8);
- dwPix4 |= ((wPix & 0xff00) << 8) | ((wPix & 0xff00) << 16);
- *((DWORD *) lpDst) = dwPix4;
- *((DWORD *) (lpDst + DstWidth)) = dwPix4;
+ dwPix4 = (wPix & 0xff) | ((wPix & 0xff) << 8);
+ dwPix4 |= ((wPix & 0xff00) << 8) | ((wPix & 0xff00) << 16);
+ *((DWORD *) lpDst) = dwPix4;
+ *((DWORD *) (lpDst + DstWidth)) = dwPix4;
- lpDst += sizeof(DWORD);
- }
+ lpDst += sizeof(DWORD);
+ }
- /* odd byte remaining ? */
- if (j > 0) {
- /* word aligned - copy one doubled pixel and we are ok */
- wPix = *lpSrc++;
- wPix |= (wPix << 8);
+ /* odd byte remaining ? */
+ if (j > 0) {
+ /* word aligned - copy one doubled pixel and we are ok */
+ wPix = *lpSrc++;
+ wPix |= (wPix << 8);
- *( (WORD *) lpDst) = wPix;
- *( (WORD *) (lpDst + DstWidth)) = wPix;
- lpDst += sizeof(WORD);
+ *( (WORD *) lpDst) = wPix;
+ *( (WORD *) (lpDst + DstWidth)) = wPix;
+ lpDst += sizeof(WORD);
- j -= 1;
- }
- lpSrc += SrcInc;
- lpDst += DstInc;
- }
+ j -= 1;
+ }
+ lpSrc += SrcInc;
+ lpDst += DstInc;
+ }
}
@@ -1148,45 +1157,45 @@ Stretch_1_2_8Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
void
Stretch_1_2_16Bits(LPBYTE lpSrc, LPBYTE lpDst, int SrcXE,int SrcYE, int DstXE,
- int DstYE, int SrcWidth, int DstWidth, int x_fract)
+ int DstYE, int SrcWidth, int DstWidth, int x_fract)
{
- int SrcInc, DstInc;
- register int i, j;
- DWORD dwPix;
+ int SrcInc, DstInc;
+ register int i, j;
+ DWORD dwPix;
- /* amount to advance source by at the end of each scan */
- SrcInc = SrcWidth - (SrcXE * sizeof(WORD));
+ /* amount to advance source by at the end of each scan */
+ SrcInc = SrcWidth - (SrcXE * sizeof(WORD));
- /* amount to advance dest by at the end of each scan - note
- * that we write two scans at once, so advance past the next
- * scan line
- */
- DstInc = (DstWidth * 2) - (DstXE * sizeof(WORD));
+ /* amount to advance dest by at the end of each scan - note
+ * that we write two scans at once, so advance past the next
+ * scan line
+ */
+ DstInc = (DstWidth * 2) - (DstXE * sizeof(WORD));
- for (i = 0; i < SrcYE; i++) {
+ for (i = 0; i < SrcYE; i++) {
- for (j = 0; j < SrcXE; j++) {
+ for (j = 0; j < SrcXE; j++) {
- /* get a pixel and double it */
+ /* get a pixel and double it */
- dwPix = *((WORD *)lpSrc);
- dwPix |= (dwPix<<16);
+ dwPix = *((WORD *)lpSrc);
+ dwPix |= (dwPix<<16);
- lpSrc += sizeof(WORD);
+ lpSrc += sizeof(WORD);
- /* write doubled pixel to this scanline */
+ /* write doubled pixel to this scanline */
- *( (DWORD UNALIGNED *) lpDst) = dwPix;
+ *( (DWORD UNALIGNED *) lpDst) = dwPix;
- /* write double pixel to next scanline */
- *( (DWORD UNALIGNED *) (lpDst + DstWidth)) = dwPix;
+ /* write double pixel to next scanline */
+ *( (DWORD UNALIGNED *) (lpDst + DstWidth)) = dwPix;
- lpDst += sizeof(DWORD);
- }
- lpSrc += SrcInc;
- lpDst += DstInc;
+ lpDst += sizeof(DWORD);
+ }
+ lpSrc += SrcInc;
+ lpDst += DstInc;
- }
+ }
}
diff --git a/plugins/pluginDirectShow/internals/Resizer.h b/plugins/pluginDirectShow/internals/Resizer.h
index 6c76970..e91b980 100755
--- a/plugins/pluginDirectShow/internals/Resizer.h
+++ b/plugins/pluginDirectShow/internals/Resizer.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -67,10 +67,10 @@
void ResizeRGB( BITMAPINFOHEADER *pbiIn, //Src's BitMapInFoHeader
- const unsigned char * dibBits, //Src bits
- BITMAPINFOHEADER *pbiOut,
- unsigned char *pFrame, //Dst bits
- int iNewWidth, //new W in pixel
- int iNewHeight); //new H in pixel
+ const unsigned char * dibBits, //Src bits
+ BITMAPINFOHEADER *pbiOut,
+ unsigned char *pFrame, //Dst bits
+ int iNewWidth, //new W in pixel
+ int iNewHeight); //new H in pixel
#endif //RESIZER_H
diff --git a/plugins/pluginDirectShow/internals/VideoDisplayName.cxx b/plugins/pluginDirectShow/internals/VideoDisplayName.cxx
index 6b4d0b0..ba71428 100755
--- a/plugins/pluginDirectShow/internals/VideoDisplayName.cxx
+++ b/plugins/pluginDirectShow/internals/VideoDisplayName.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,15 +23,15 @@ VideoDisplayName::VideoDisplayName(std::string name_, std::string descr) : name(
std::string VideoDisplayName::getName() const
{
- return this->name;
+ return this->name;
}
std::string VideoDisplayName::getDescription() const
{
- return this->description;
+ return this->description;
}
int VideoDisplayName::operator==(const VideoDisplayName &dev) const
{
- return this->name == dev.name;
+ return this->name == dev.name;
}
diff --git a/plugins/pluginDirectShow/internals/VideoDisplayName.h b/plugins/pluginDirectShow/internals/VideoDisplayName.h
index 82dc0d0..34914b7 100755
--- a/plugins/pluginDirectShow/internals/VideoDisplayName.h
+++ b/plugins/pluginDirectShow/internals/VideoDisplayName.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,19 +25,19 @@
class VideoDisplayName
{
public:
- VideoDisplayName() {}
+ VideoDisplayName() {}
- VideoDisplayName(std::string name, std::string description);
+ VideoDisplayName(std::string name, std::string description);
- std::string getName() const;
+ std::string getName() const;
- std::string getDescription() const;
+ std::string getDescription() const;
- int operator==( const VideoDisplayName &dev ) const;
+ int operator==( const VideoDisplayName &dev ) const;
private:
- std::string name;
- std::string description;
+ std::string name;
+ std::string description;
};
#endif /* PLUGIN_DSHOW_VIDEODISPLAYNAME_H */
diff --git a/plugins/pluginDirectShow/internals/VideoFrame.h b/plugins/pluginDirectShow/internals/VideoFrame.h
index 2c910a6..d9a7a9f 100755
--- a/plugins/pluginDirectShow/internals/VideoFrame.h
+++ b/plugins/pluginDirectShow/internals/VideoFrame.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -19,20 +19,19 @@
#define PLUGIN_DSHOW_VIDEOFRAME_H
// Define supported video formats
-typedef enum _VIDEOFORMAT
-{
- VIDEOFORMAT_NULL = 0, // 0 x 0 : Null
- VIDEOFORMAT_SQCIF, // 128 x 96 : SQCIF
- VIDEOFORMAT_QCIF, // 176 x 144 : QCIF
- VIDEOFORMAT_QVGA, // 320 x 240 : QVGA
- VIDEOFORMAT_CIF, // 352 x 288 : CIF
- VIDEOFORMAT_IOS_MEDIUM, // 480 x 360 : IOS_MEDIUM
- VIDEOFORMAT_VGA, // 640 x 480 : VGA
- VIDEOFORMAT_4CIF, // 704 x 576 : 4CIF
- VIDEOFORMAT_SVGA, // 800 x 600 : SVGA
- VIDEOFORMAT_XGA, // 1024 x 768 : XGA
- VIDEOFORMAT_SXGA, // 1280 x 1024 : SXGA
- VIDEOFORMAT_16CIF, // 1408 x 1152 : 16CIF
+typedef enum _VIDEOFORMAT {
+ VIDEOFORMAT_NULL = 0, // 0 x 0 : Null
+ VIDEOFORMAT_SQCIF, // 128 x 96 : SQCIF
+ VIDEOFORMAT_QCIF, // 176 x 144 : QCIF
+ VIDEOFORMAT_QVGA, // 320 x 240 : QVGA
+ VIDEOFORMAT_CIF, // 352 x 288 : CIF
+ VIDEOFORMAT_IOS_MEDIUM, // 480 x 360 : IOS_MEDIUM
+ VIDEOFORMAT_VGA, // 640 x 480 : VGA
+ VIDEOFORMAT_4CIF, // 704 x 576 : 4CIF
+ VIDEOFORMAT_SVGA, // 800 x 600 : SVGA
+ VIDEOFORMAT_XGA, // 1024 x 768 : XGA
+ VIDEOFORMAT_SXGA, // 1280 x 1024 : SXGA
+ VIDEOFORMAT_16CIF, // 1408 x 1152 : 16CIF
} VIDEOFORMAT;
@@ -54,7 +53,7 @@ typedef enum _VIDEOFORMAT
case VIDEOFORMAT_NULL: \
default: width = 0; height = 0; break; \
} \
-
+
// Macro to get a video format from its size
#define SIZE_TO_VIDEOFORMAT(width, height, format) \
@@ -70,7 +69,7 @@ typedef enum _VIDEOFORMAT
else if ((width == 1280) && (height = 1024)) format = VIDEOFORMAT_SXGA; \
else if ((width == 1408) && (height = 1152)) format = VIDEOFORMAT_16CIF; \
else format = VIDEOFORMAT_NULL; \
-
+
// Constants for consumer and producer Ids
#define GRABBER_VIDEO_ID 0x1FFFFFFF
@@ -80,28 +79,52 @@ typedef enum _VIDEOFORMAT
class VideoFrame
{
public:
- VideoFrame() { this->data = NULL; };
- virtual ~VideoFrame() { if(this->data) { this->data = NULL;} };
+ VideoFrame() {
+ this->data = NULL;
+ };
+ virtual ~VideoFrame() {
+ if(this->data) {
+ this->data = NULL;
+ }
+ };
- int getWidth() { return this->width; };
- int getHeight() { return this->height; };
- int getBitsPerPixel() { return this->bpp; };
- int getTotalBits () { return this->width * this->height * (this->bpp/8); };
- void* getData() { return this->data; };
+ int getWidth() {
+ return this->width;
+ };
+ int getHeight() {
+ return this->height;
+ };
+ int getBitsPerPixel() {
+ return this->bpp;
+ };
+ int getTotalBits () {
+ return this->width * this->height * (this->bpp/8);
+ };
+ void* getData() {
+ return this->data;
+ };
- void setWidth(int width_) { this->width = width_; };
- void setHeight(int height_) { this->height = height_; };
- void setBitsPerPixel( int bpp_) { this->bpp = bpp_; };
- void setData( void* data_) { this->data = data_; };
+ void setWidth(int width_) {
+ this->width = width_;
+ };
+ void setHeight(int height_) {
+ this->height = height_;
+ };
+ void setBitsPerPixel( int bpp_) {
+ this->bpp = bpp_;
+ };
+ void setData( void* data_) {
+ this->data = data_;
+ };
- VIDEOFORMAT getSize();
- void setSize(VIDEOFORMAT format);
+ VIDEOFORMAT getSize();
+ void setSize(VIDEOFORMAT format);
private:
- void *data;
- int width;
- int height;
- int bpp;
+ void *data;
+ int width;
+ int height;
+ int bpp;
};
#endif /* VIDEOFRAME_H */
diff --git a/plugins/pluginDirectShow/internals/VideoGrabberName.cxx b/plugins/pluginDirectShow/internals/VideoGrabberName.cxx
index 4b418cf..dd681c2 100755
--- a/plugins/pluginDirectShow/internals/VideoGrabberName.cxx
+++ b/plugins/pluginDirectShow/internals/VideoGrabberName.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,15 +23,15 @@ VideoGrabberName::VideoGrabberName(std::string name_, std::string descr) : name(
std::string VideoGrabberName::getName() const
{
- return this->name;
+ return this->name;
}
std::string VideoGrabberName::getDescription() const
{
- return this->description;
+ return this->description;
}
int VideoGrabberName::operator==(const VideoGrabberName &dev) const
{
- return this->name == dev.name;
+ return this->name == dev.name;
} \ No newline at end of file
diff --git a/plugins/pluginDirectShow/internals/VideoGrabberName.h b/plugins/pluginDirectShow/internals/VideoGrabberName.h
index 0bb45b5..aaf7d75 100755
--- a/plugins/pluginDirectShow/internals/VideoGrabberName.h
+++ b/plugins/pluginDirectShow/internals/VideoGrabberName.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,19 +25,19 @@
class VideoGrabberName
{
public:
- VideoGrabberName() {}
+ VideoGrabberName() {}
- VideoGrabberName(std::string name, std::string description);
+ VideoGrabberName(std::string name, std::string description);
- std::string getName() const;
+ std::string getName() const;
- std::string getDescription() const;
+ std::string getDescription() const;
- int operator==( const VideoGrabberName &dev ) const;
+ int operator==( const VideoGrabberName &dev ) const;
private:
- std::string name;
- std::string description;
+ std::string name;
+ std::string description;
};
#endif /* PLUGIN_DSHOW_VIDEOGRABBERNAME_H */
diff --git a/plugins/pluginDirectShow/internals/wince/CPropertyBag.cxx b/plugins/pluginDirectShow/internals/wince/CPropertyBag.cxx
index a6b436a..045530d 100755
--- a/plugins/pluginDirectShow/internals/wince/CPropertyBag.cxx
+++ b/plugins/pluginDirectShow/internals/wince/CPropertyBag.cxx
@@ -16,14 +16,14 @@
#include "internals/wince/CPropertyBag.h"
CPropertyBag::CPropertyBag() : _refCount(1), pVar(0)
-{
+{
}
CPropertyBag::~CPropertyBag()
{
VAR_LIST *pTemp = pVar;
HRESULT hr = S_OK;
-
+
while(pTemp) {
VAR_LIST *pDel = pTemp;
VariantClear(&pTemp->var);
@@ -35,13 +35,13 @@ CPropertyBag::~CPropertyBag()
}
HRESULT STDMETHODCALLTYPE
-CPropertyBag::Read(LPCOLESTR pszPropName,
- VARIANT *_pVar,
- IErrorLog *pErrorLog)
+CPropertyBag::Read(LPCOLESTR pszPropName,
+ VARIANT *_pVar,
+ IErrorLog *pErrorLog)
{
VAR_LIST *pTemp = pVar;
HRESULT hr = S_OK;
-
+
while (pTemp) {
if (0 == wcscmp(pszPropName, pTemp->pBSTRName)) {
hr = VariantCopy(_pVar, &pTemp->var);
@@ -54,8 +54,8 @@ CPropertyBag::Read(LPCOLESTR pszPropName,
HRESULT STDMETHODCALLTYPE
-CPropertyBag::Write(LPCOLESTR pszPropName,
- VARIANT *_pVar)
+CPropertyBag::Write(LPCOLESTR pszPropName,
+ VARIANT *_pVar)
{
HRESULT hr = S_OK;
VAR_LIST *pTemp = new VAR_LIST();
@@ -72,37 +72,37 @@ CPropertyBag::Write(LPCOLESTR pszPropName,
return VariantCopy(&pTemp->var, _pVar);
}
-ULONG STDMETHODCALLTYPE
-CPropertyBag::AddRef()
+ULONG STDMETHODCALLTYPE
+CPropertyBag::AddRef()
{
return InterlockedIncrement((LONG *)&_refCount);
}
-ULONG STDMETHODCALLTYPE
-CPropertyBag::Release()
+ULONG STDMETHODCALLTYPE
+CPropertyBag::Release()
{
ASSERT(_refCount != 0xFFFFFFFF);
- ULONG ret = InterlockedDecrement((LONG *)&_refCount);
- if (!ret) {
- delete this;
- }
+ ULONG ret = InterlockedDecrement((LONG *)&_refCount);
+ if (!ret) {
+ delete this;
+ }
return ret;
}
-HRESULT STDMETHODCALLTYPE
-CPropertyBag::QueryInterface(REFIID riid, void** ppv)
+HRESULT STDMETHODCALLTYPE
+CPropertyBag::QueryInterface(REFIID riid, void** ppv)
{
- if (!ppv) {
+ if (!ppv) {
return E_POINTER;
- }
- if (riid == IID_IPropertyBag) {
+ }
+ if (riid == IID_IPropertyBag) {
*ppv = static_cast<IPropertyBag*>(this);
- }
- else {
+ }
+ else {
return *ppv = 0, E_NOINTERFACE;
- }
-
- return AddRef(), S_OK;
+ }
+
+ return AddRef(), S_OK;
}
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/internals/wince/CPropertyBag.h b/plugins/pluginDirectShow/internals/wince/CPropertyBag.h
index 20ce779..8abb728 100755
--- a/plugins/pluginDirectShow/internals/wince/CPropertyBag.h
+++ b/plugins/pluginDirectShow/internals/wince/CPropertyBag.h
@@ -4,40 +4,39 @@
#include "plugin_dshow_config.h"
-struct VAR_LIST
-{
+struct VAR_LIST {
VARIANT var;
VAR_LIST *pNext;
BSTR pBSTRName;
};
class CPropertyBag : public IPropertyBag
-{
+{
public:
CPropertyBag();
~CPropertyBag();
-
+
HRESULT STDMETHODCALLTYPE
Read(
- LPCOLESTR pszPropName,
- VARIANT *pVar,
+ LPCOLESTR pszPropName,
+ VARIANT *pVar,
IErrorLog *pErrorLog
- );
-
-
+ );
+
+
HRESULT STDMETHODCALLTYPE
Write(
- LPCOLESTR pszPropName,
+ LPCOLESTR pszPropName,
VARIANT *pVar
- );
-
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppv);
+ );
+
+ ULONG STDMETHODCALLTYPE AddRef();
+ ULONG STDMETHODCALLTYPE Release();
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppv);
private:
- ULONG _refCount;
- VAR_LIST *pVar;
+ ULONG _refCount;
+ VAR_LIST *pVar;
};
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/internals/wince/DSISampleGrabberCB.h b/plugins/pluginDirectShow/internals/wince/DSISampleGrabberCB.h
index 89d8909..ec983d7 100755
--- a/plugins/pluginDirectShow/internals/wince/DSISampleGrabberCB.h
+++ b/plugins/pluginDirectShow/internals/wince/DSISampleGrabberCB.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,9 +21,8 @@
#include "plugin_dshow_config.h"
-interface DSISampleGrabberCB
-{
- virtual HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample) = 0;
+interface DSISampleGrabberCB {
+ virtual HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample) = 0;
virtual HRESULT STDMETHODCALLTYPE BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen) = 0;
};
diff --git a/plugins/pluginDirectShow/internals/wince/DSNullFilter.cxx b/plugins/pluginDirectShow/internals/wince/DSNullFilter.cxx
index 76d713c..8b43d83 100755
--- a/plugins/pluginDirectShow/internals/wince/DSNullFilter.cxx
+++ b/plugins/pluginDirectShow/internals/wince/DSNullFilter.cxx
@@ -1,19 +1,19 @@
#if defined(_WIN32_WCE)
/* Copyright (C) 2014-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,10 +21,10 @@
#include "internals/wince/DSNullFilter.h"
// {7F9F08CF-139F-40b2-A283-01C4EC26A452}
-TDSHOW_DEFINE_GUID(CLSID_DSNullFilter,
-0x7f9f08cf, 0x139f, 0x40b2, 0xa2, 0x83, 0x1, 0xc4, 0xec, 0x26, 0xa4, 0x52);
+TDSHOW_DEFINE_GUID(CLSID_DSNullFilter,
+ 0x7f9f08cf, 0x139f, 0x40b2, 0xa2, 0x83, 0x1, 0xc4, 0xec, 0x26, 0xa4, 0x52);
-DSNullFilter::DSNullFilter(LPUNKNOWN punk,HRESULT *phr)
+DSNullFilter::DSNullFilter(LPUNKNOWN punk,HRESULT *phr)
: CTransInPlaceFilter(TEXT("NullRenderer"), punk, CLSID_DSNullFilter, phr)
{
}
diff --git a/plugins/pluginDirectShow/internals/wince/DSNullFilter.h b/plugins/pluginDirectShow/internals/wince/DSNullFilter.h
index fc9b76a..608a2b6 100755
--- a/plugins/pluginDirectShow/internals/wince/DSNullFilter.h
+++ b/plugins/pluginDirectShow/internals/wince/DSNullFilter.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.cxx b/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.cxx
index d33d105..920111f 100755
--- a/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.cxx
+++ b/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.cxx
@@ -6,192 +6,191 @@
// {38589364-71FD-4641-B426-E443DB023568}
-TDSHOW_DEFINE_GUID(CLSID_SampleGrabber,
-0x38589364, 0x71fd, 0x4641, 0xb4, 0x26, 0xe4, 0x43, 0xdb, 0x2, 0x35, 0x68);
+TDSHOW_DEFINE_GUID(CLSID_SampleGrabber,
+ 0x38589364, 0x71fd, 0x4641, 0xb4, 0x26, 0xe4, 0x43, 0xdb, 0x2, 0x35, 0x68);
#define RGB565_MASK_RED 0xF800
#define RGB565_MASK_GREEN 0x07E0
#define RGB565_MASK_BLUE 0x001F
-DSSampleGrabber::DSSampleGrabber(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr)
-:CTransInPlaceFilter (tszName, punk, CLSID_SampleGrabber, phr)
-{
+DSSampleGrabber::DSSampleGrabber(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr)
+ :CTransInPlaceFilter (tszName, punk, CLSID_SampleGrabber, phr)
+{
#define FPS_INPUT 30
#define FPS_OUTPUT 5
- this->m_rtFrameLength = (10000000)/FPS_OUTPUT;
+ this->m_rtFrameLength = (10000000)/FPS_OUTPUT;
- this->m_inputFps = FPS_INPUT;
- this->m_outputFps = FPS_OUTPUT;
+ this->m_inputFps = FPS_INPUT;
+ this->m_outputFps = FPS_OUTPUT;
- this->m_iFrameNumber = 0;
- this->m_progress = 0;
- this->m_bProcessFrame = true;
+ this->m_iFrameNumber = 0;
+ this->m_progress = 0;
+ this->m_bProcessFrame = true;
- this->callback = NULL;
- this->m_rgb24 = NULL;
+ this->callback = NULL;
+ this->m_rgb24 = NULL;
- m_cRef = 0;
+ m_cRef = 0;
}
-DSSampleGrabber::~DSSampleGrabber() {
- this->callback = NULL;
- if(this->m_rgb24)
- {
- delete[]this->m_rgb24;
- this->m_rgb24 = NULL;
- }
+DSSampleGrabber::~DSSampleGrabber()
+{
+ this->callback = NULL;
+ if(this->m_rgb24) {
+ delete[]this->m_rgb24;
+ this->m_rgb24 = NULL;
+ }
}
HRESULT DSSampleGrabber::SetFps(int inputFps, int outputFps)
{
- if (inputFps <= 0 || outputFps <= 0) {
- return E_FAIL;
- }
-
- // Stop prcessing
- this->m_bProcessFrame = false;
-
- if (inputFps < outputFps) {
- this->m_inputFps = this->m_outputFps = inputFps;
- }
- else {
- this->m_outputFps = outputFps;
- this->m_inputFps = inputFps;
- }
-
- // Restart processing
- this->m_iFrameNumber = 0;
- this->m_progress = 0;
- this->m_bProcessFrame = true;
-
- return S_OK;
+ if (inputFps <= 0 || outputFps <= 0) {
+ return E_FAIL;
+ }
+
+ // Stop prcessing
+ this->m_bProcessFrame = false;
+
+ if (inputFps < outputFps) {
+ this->m_inputFps = this->m_outputFps = inputFps;
+ }
+ else {
+ this->m_outputFps = outputFps;
+ this->m_inputFps = inputFps;
+ }
+
+ // Restart processing
+ this->m_iFrameNumber = 0;
+ this->m_progress = 0;
+ this->m_bProcessFrame = true;
+
+ return S_OK;
}
HRESULT DSSampleGrabber::Transform(IMediaSample *pSample)
-{
- BYTE *pData = NULL;
- HRESULT hr = S_OK;
- HRESULT ret = S_FALSE;
-
- if (!this->m_bProcessFrame) {
- return S_FALSE;
- }
-
- // Get pointer to the video buffer data
- if ( FAILED(pSample->GetPointer(&pData)) ) {
- ret = E_FAIL;
- goto bail;
- }
-
- pSample->SetTime(NULL, NULL);
-
- // Drop frame?
- if (this->m_iFrameNumber == 0) {
- ret = S_OK;
- }
- else if (this->m_progress >= this->m_inputFps) {
- this->m_progress -= this->m_inputFps;
- ret = S_OK;
- }
-
- // Mark frame as accepted
- if (ret == S_OK) {
- // Set TRUE on every sample for uncompressed frames
- pSample->SetSyncPoint(TRUE);
-
- long Size = pSample->GetSize();
- if ( this->callback ) {
- LONGLONG start, end;
- WORD *rgb565 = (WORD*)pData;
-
- for(int i = 0, i24 = 0, i565 = 0; i< (Size/2); i++, i24+=3, i565+=1) {
- BYTE *p24 = (this->m_rgb24+i24);
- WORD val565 = *(rgb565 + i565);
-
- // extract RGB
- p24[2] = (val565 & RGB565_MASK_RED) >> 11;
- p24[1] = (val565 & RGB565_MASK_GREEN) >> 5;
- p24[0] = (val565 & RGB565_MASK_BLUE);
-
- // amplify the image
- p24[2] <<= 3;
- p24[1] <<= 2;
- p24[0] <<= 3;
- }
-
- pSample->GetMediaTime(&start, &end);
- this->callback->BufferCB( (double)start, this->m_rgb24, ((Size >> 1) * 3));
- }
- }
-
- this->m_progress += this->m_outputFps;
- this->m_iFrameNumber++;
+{
+ BYTE *pData = NULL;
+ HRESULT hr = S_OK;
+ HRESULT ret = S_FALSE;
+
+ if (!this->m_bProcessFrame) {
+ return S_FALSE;
+ }
+
+ // Get pointer to the video buffer data
+ if ( FAILED(pSample->GetPointer(&pData)) ) {
+ ret = E_FAIL;
+ goto bail;
+ }
+
+ pSample->SetTime(NULL, NULL);
+
+ // Drop frame?
+ if (this->m_iFrameNumber == 0) {
+ ret = S_OK;
+ }
+ else if (this->m_progress >= this->m_inputFps) {
+ this->m_progress -= this->m_inputFps;
+ ret = S_OK;
+ }
+
+ // Mark frame as accepted
+ if (ret == S_OK) {
+ // Set TRUE on every sample for uncompressed frames
+ pSample->SetSyncPoint(TRUE);
+
+ long Size = pSample->GetSize();
+ if ( this->callback ) {
+ LONGLONG start, end;
+ WORD *rgb565 = (WORD*)pData;
+
+ for(int i = 0, i24 = 0, i565 = 0; i< (Size/2); i++, i24+=3, i565+=1) {
+ BYTE *p24 = (this->m_rgb24+i24);
+ WORD val565 = *(rgb565 + i565);
+
+ // extract RGB
+ p24[2] = (val565 & RGB565_MASK_RED) >> 11;
+ p24[1] = (val565 & RGB565_MASK_GREEN) >> 5;
+ p24[0] = (val565 & RGB565_MASK_BLUE);
+
+ // amplify the image
+ p24[2] <<= 3;
+ p24[1] <<= 2;
+ p24[0] <<= 3;
+ }
+
+ pSample->GetMediaTime(&start, &end);
+ this->callback->BufferCB( (double)start, this->m_rgb24, ((Size >> 1) * 3));
+ }
+ }
+
+ this->m_progress += this->m_outputFps;
+ this->m_iFrameNumber++;
bail:
- SAFE_DELETE_ARRAY( pData );
- SAFE_RELEASE(pSample);
+ SAFE_DELETE_ARRAY( pData );
+ SAFE_RELEASE(pSample);
- return ret;
+ return ret;
}
HRESULT DSSampleGrabber::CheckInputType(const CMediaType* mtIn)
-{
- VIDEOINFO *video;
- if ( !IsEqualGUID( *mtIn->Subtype(), MEDIASUBTYPE_RGB565 ) || !(video=(VIDEOINFO *)mtIn->Format()) ) {
- return E_FAIL;
- }
+{
+ VIDEOINFO *video;
+ if ( !IsEqualGUID( *mtIn->Subtype(), MEDIASUBTYPE_RGB565 ) || !(video=(VIDEOINFO *)mtIn->Format()) ) {
+ return E_FAIL;
+ }
- return S_OK;
+ return S_OK;
}
-STDMETHODIMP DSSampleGrabber::SetCallback( DSISampleGrabberCB* callback_ )
+STDMETHODIMP DSSampleGrabber::SetCallback( DSISampleGrabberCB* callback_ )
{
- if (!callback_) {
- return E_FAIL;
- }
+ if (!callback_) {
+ return E_FAIL;
+ }
- this->callback = callback_;
- return S_OK;
+ this->callback = callback_;
+ return S_OK;
}
HRESULT DSSampleGrabber::SetSize(int width, int height)
{
- ZeroMemory(&this->mt, sizeof(CMediaType));
-
- VIDEOINFO *pvi = (VIDEOINFO *)this->mt.AllocFormatBuffer(sizeof(VIDEOINFO));
- if (NULL == pvi)
- {
- return E_OUTOFMEMORY;
- }
-
- ZeroMemory(pvi, sizeof(VIDEOINFO));
-
- pvi->bmiHeader.biCompression = BI_RGB;
- pvi->bmiHeader.biBitCount = 24;
- pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pvi->bmiHeader.biWidth = width;
- pvi->bmiHeader.biHeight = height;
- pvi->bmiHeader.biPlanes = 1;
- pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
- pvi->bmiHeader.biClrImportant = 0;
-
- // Frame rate
- pvi->AvgTimePerFrame = 10000000/this->m_outputFps;
-
- SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
- SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
-
- this->mt.SetType(&MEDIATYPE_Video);
- this->mt.SetFormatType(&FORMAT_VideoInfo);
- this->mt.SetTemporalCompression(FALSE);
-
- this->mt.SetSubtype(&MEDIASUBTYPE_RGB24);
- this->mt.SetSampleSize(pvi->bmiHeader.biSizeImage);
-
- this->m_rgb24 = new BYTE[pvi->bmiHeader.biSizeImage];
-
- return S_OK;
+ ZeroMemory(&this->mt, sizeof(CMediaType));
+
+ VIDEOINFO *pvi = (VIDEOINFO *)this->mt.AllocFormatBuffer(sizeof(VIDEOINFO));
+ if (NULL == pvi) {
+ return E_OUTOFMEMORY;
+ }
+
+ ZeroMemory(pvi, sizeof(VIDEOINFO));
+
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 24;
+ pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ pvi->bmiHeader.biWidth = width;
+ pvi->bmiHeader.biHeight = height;
+ pvi->bmiHeader.biPlanes = 1;
+ pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
+ pvi->bmiHeader.biClrImportant = 0;
+
+ // Frame rate
+ pvi->AvgTimePerFrame = 10000000/this->m_outputFps;
+
+ SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
+ SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
+
+ this->mt.SetType(&MEDIATYPE_Video);
+ this->mt.SetFormatType(&FORMAT_VideoInfo);
+ this->mt.SetTemporalCompression(FALSE);
+
+ this->mt.SetSubtype(&MEDIASUBTYPE_RGB24);
+ this->mt.SetSampleSize(pvi->bmiHeader.biSizeImage);
+
+ this->m_rgb24 = new BYTE[pvi->bmiHeader.biSizeImage];
+
+ return S_OK;
}
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.h b/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.h
index 39ee5c6..9ae11cd 100755
--- a/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.h
+++ b/plugins/pluginDirectShow/internals/wince/DSSampleGrabber.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -32,42 +32,44 @@
class DSSampleGrabber : public CTransInPlaceFilter
{
public:
- // instantiation
- DSSampleGrabber( TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr );
- ~DSSampleGrabber(void);
-
+ // instantiation
+ DSSampleGrabber( TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr );
+ ~DSSampleGrabber(void);
+
public:
- HRESULT Transform(IMediaSample *pSample);
+ HRESULT Transform(IMediaSample *pSample);
HRESULT CheckInputType(const CMediaType* mtIn);
-
- HRESULT SetFps(int inputFps, int outputFps);
+
+ HRESULT SetFps(int inputFps, int outputFps);
// DECLARE_IUNKNOWN;
- STDMETHODIMP QueryInterface(REFIID riid, void **ppv) {
- return GetOwner()->QueryInterface(riid,ppv);
- };
- STDMETHODIMP_(ULONG) AddRef() {
- return InterlockedIncrement(&m_cRef);
- };
+ STDMETHODIMP QueryInterface(REFIID riid, void **ppv) {
+ return GetOwner()->QueryInterface(riid,ppv);
+ };
+ STDMETHODIMP_(ULONG) AddRef() {
+ return InterlockedIncrement(&m_cRef);
+ };
STDMETHODIMP_(ULONG) Release() {
- return GetOwner()->Release();
+ return GetOwner()->Release();
};
- STDMETHODIMP SetCallback(DSISampleGrabberCB* callback_);
- HRESULT SetSize(int width, int height);
+ STDMETHODIMP SetCallback(DSISampleGrabberCB* callback_);
+ HRESULT SetSize(int width, int height);
- inline AM_MEDIA_TYPE GetMediaType() { return (AM_MEDIA_TYPE)this->mt; }
+ inline AM_MEDIA_TYPE GetMediaType() {
+ return (AM_MEDIA_TYPE)this->mt;
+ }
private:
- int m_progress;
- int m_inputFps, m_outputFps;
- bool m_bProcessFrame;
- REFERENCE_TIME m_rtFrameLength; // UNITS/fps
- LONGLONG m_iFrameNumber;
+ int m_progress;
+ int m_inputFps, m_outputFps;
+ bool m_bProcessFrame;
+ REFERENCE_TIME m_rtFrameLength; // UNITS/fps
+ LONGLONG m_iFrameNumber;
- DSISampleGrabberCB* callback;
- CMediaType mt;
- BYTE *m_rgb24;
+ DSISampleGrabberCB* callback;
+ CMediaType mt;
+ BYTE *m_rgb24;
};
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/internals/wince/DSSampleGrabberUtils.h b/plugins/pluginDirectShow/internals/wince/DSSampleGrabberUtils.h
index 01e1728..e22be83 100755
--- a/plugins/pluginDirectShow/internals/wince/DSSampleGrabberUtils.h
+++ b/plugins/pluginDirectShow/internals/wince/DSSampleGrabberUtils.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,14 +25,16 @@ typedef void (CALLBACK *MANAGEDCALLBACKPROC)(BYTE* pdata, long len);
// ISampleGrabber interface definition
// {04951BFF-696A-4ade-828D-42A5F1EDB631}
-DEFINE_GUID(IID_ISampleGrabber,
- 0x4951bff, 0x696a, 0x4ade, 0x82, 0x8d, 0x42, 0xa5, 0xf1, 0xed, 0xb6, 0x31);
+DEFINE_GUID(IID_ISampleGrabber,
+ 0x4951bff, 0x696a, 0x4ade, 0x82, 0x8d, 0x42, 0xa5, 0xf1, 0xed, 0xb6, 0x31);
-DECLARE_INTERFACE_(ISampleGrabber, IUnknown) {
- STDMETHOD(SetCallback)(MANAGEDCALLBACKPROC callback) PURE;};
+DECLARE_INTERFACE_(ISampleGrabber, IUnknown)
+{
+ STDMETHOD(SetCallback)(MANAGEDCALLBACKPROC callback) PURE;
+};
- // {D11DFE19-8864-4a60-B26C-552F9AA472E1}
+// {D11DFE19-8864-4a60-B26C-552F9AA472E1}
DEFINE_GUID(CLSID_NullRenderer,
- 0xd11dfe19, 0x8864, 0x4a60, 0xb2, 0x6c, 0x55, 0x2f, 0x9a, 0xa4, 0x72, 0xe1);
+ 0xd11dfe19, 0x8864, 0x4a60, 0xb2, 0x6c, 0x55, 0x2f, 0x9a, 0xa4, 0x72, 0xe1);
#endif /* _WIN32_WCE */
diff --git a/plugins/pluginDirectShow/plugin_dshow_config.h b/plugins/pluginDirectShow/plugin_dshow_config.h
index f58e4b2..df01cda 100755
--- a/plugins/pluginDirectShow/plugin_dshow_config.h
+++ b/plugins/pluginDirectShow/plugin_dshow_config.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -42,13 +42,13 @@
# define PLUGIN_DSHOW_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define PLUGIN_DSHOW_BEGIN_DECLS extern "C" {
# define PLUGIN_DSHOW_END_DECLS }
#else
-# define PLUGIN_DSHOW_BEGIN_DECLS
+# define PLUGIN_DSHOW_BEGIN_DECLS
# define PLUGIN_DSHOW_END_DECLS
#endif
@@ -79,7 +79,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#if !defined(TDSHOW_DEFINE_GUID) && !defined(_WIN32_WCE)
diff --git a/plugins/pluginDirectShow/plugin_screencast_dshow_producer.cxx b/plugins/pluginDirectShow/plugin_screencast_dshow_producer.cxx
index af09c4e..789c7b9 100755
--- a/plugins/pluginDirectShow/plugin_screencast_dshow_producer.cxx
+++ b/plugins/pluginDirectShow/plugin_screencast_dshow_producer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,181 +26,184 @@
#define DSPRODUCER(self) ((plugin_screencast_dshow_producer_t*)(self))
-typedef struct plugin_screencast_dshow_producer_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- DSGrabber* grabber;
- INT64 previewHwnd;
-
- tsk_bool_t started;
- tsk_bool_t mute;
- tsk_bool_t create_on_ui_thread;
+typedef struct plugin_screencast_dshow_producer_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ DSGrabber* grabber;
+ INT64 previewHwnd;
+
+ tsk_bool_t started;
+ tsk_bool_t mute;
+ tsk_bool_t create_on_ui_thread;
}
plugin_screencast_dshow_producer_t;
// Producer callback (From DirectShow Grabber to our plugin)
static int plugin_video_dshow_plugin_cb(const void* callback_data, const void* buffer, tsk_size_t size)
{
- const plugin_screencast_dshow_producer_t* producer = (const plugin_screencast_dshow_producer_t*)callback_data;
+ const plugin_screencast_dshow_producer_t* producer = (const plugin_screencast_dshow_producer_t*)callback_data;
- if (producer && TMEDIA_PRODUCER(producer)->enc_cb.callback) {
- TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer, size);
- }
+ if (producer && TMEDIA_PRODUCER(producer)->enc_cb.callback) {
+ TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer, size);
+ }
- return 0;
+ return 0;
}
/* ============ Media Producer Interface ================= */
static int plugin_screencast_dshow_producer_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
-
- if(!producer || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int64){
- if(tsk_striequals(param->key, "local-hwnd")){
- DSPRODUCER(producer)->previewHwnd = (INT64)*((int64_t*)param->value);
- if(DSPRODUCER(producer)->grabber && DSPRODUCER(self)->grabber->preview){
- DSPRODUCER(producer)->grabber->preview->attach(DSPRODUCER(producer)->previewHwnd);
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "mute")){
- producer->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- if(producer->started){
- if(producer->mute){
- producer->grabber->pause();
- }
- else{
- producer->grabber->start();
- }
- }
- }
- else if(tsk_striequals(param->key, "create-on-current-thead")){
- producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox")){
- TSK_DEBUG_INFO("'plugin-firefox' ignored for screencast");
- }
- }
-
- return ret;
+ int ret = 0;
+ plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
+
+ if(!producer || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "local-hwnd")) {
+ DSPRODUCER(producer)->previewHwnd = (INT64)*((int64_t*)param->value);
+ if(DSPRODUCER(producer)->grabber && DSPRODUCER(self)->grabber->preview) {
+ DSPRODUCER(producer)->grabber->preview->attach(DSPRODUCER(producer)->previewHwnd);
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "mute")) {
+ producer->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ if(producer->started) {
+ if(producer->mute) {
+ producer->grabber->pause();
+ }
+ else {
+ producer->grabber->start();
+ }
+ }
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ TSK_DEBUG_INFO("'plugin-firefox' ignored for screencast");
+ }
+ }
+
+ return ret;
}
static int plugin_screencast_dshow_producer_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
-
- if(!producer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
-
- return 0;
+ plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
+
+ if(!producer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+
+ return 0;
}
static int plugin_screencast_dshow_producer_start(tmedia_producer_t* self)
{
- plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
- HRESULT hr = S_OK;
-
- if (!producer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (producer->started) {
- return 0;
- }
-
- // create grabber on ALWAYS current thread
- if (!producer->grabber) {
- static BOOL __isDisplayFalse = FALSE;
- static BOOL __isScreenCastTrue = TRUE;
- if(producer->create_on_ui_thread) createOnUIThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastTrue);
- else createOnCurrentThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastTrue);
- if (!producer->grabber) {
- TSK_DEBUG_ERROR("Failed to create grabber");
- return -2;
- }
- }
-
- // set parameters
- producer->grabber->setCaptureParameters((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height, TMEDIA_PRODUCER(producer)->video.fps);
-
- // set callback function
- producer->grabber->setCallback(plugin_video_dshow_plugin_cb, producer);
-
- // attach preview
- if (producer->grabber->preview) {
- if (producer->previewHwnd) {
- producer->grabber->preview->attach(producer->previewHwnd);
- }
- producer->grabber->preview->setSize((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height);
- }
-
- // start grabber
- if (!producer->mute) {
- producer->grabber->start();
- }
-
- producer->started = tsk_true;
-
- return 0;
+ plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
+ HRESULT hr = S_OK;
+
+ if (!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (producer->started) {
+ return 0;
+ }
+
+ // create grabber on ALWAYS current thread
+ if (!producer->grabber) {
+ static BOOL __isDisplayFalse = FALSE;
+ static BOOL __isScreenCastTrue = TRUE;
+ if(producer->create_on_ui_thread) {
+ createOnUIThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastTrue);
+ }
+ else {
+ createOnCurrentThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastTrue);
+ }
+ if (!producer->grabber) {
+ TSK_DEBUG_ERROR("Failed to create grabber");
+ return -2;
+ }
+ }
+
+ // set parameters
+ producer->grabber->setCaptureParameters((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height, TMEDIA_PRODUCER(producer)->video.fps);
+
+ // set callback function
+ producer->grabber->setCallback(plugin_video_dshow_plugin_cb, producer);
+
+ // attach preview
+ if (producer->grabber->preview) {
+ if (producer->previewHwnd) {
+ producer->grabber->preview->attach(producer->previewHwnd);
+ }
+ producer->grabber->preview->setSize((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height);
+ }
+
+ // start grabber
+ if (!producer->mute) {
+ producer->grabber->start();
+ }
+
+ producer->started = tsk_true;
+
+ return 0;
}
static int plugin_screencast_dshow_producer_pause(tmedia_producer_t* self)
{
- plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
+ plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!producer->grabber){
- TSK_DEBUG_ERROR("Invalid internal grabber");
- return -2;
- }
+ if(!producer->grabber) {
+ TSK_DEBUG_ERROR("Invalid internal grabber");
+ return -2;
+ }
- producer->grabber->pause();
+ producer->grabber->pause();
- return 0;
+ return 0;
}
static int plugin_screencast_dshow_producer_stop(tmedia_producer_t* self)
{
- plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
+ plugin_screencast_dshow_producer_t* producer = (plugin_screencast_dshow_producer_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!producer->started){
- return 0;
- }
+ if(!producer->started) {
+ return 0;
+ }
- if(!producer->grabber){
- TSK_DEBUG_ERROR("Invalid internal grabber");
- return -2;
- }
+ if(!producer->grabber) {
+ TSK_DEBUG_ERROR("Invalid internal grabber");
+ return -2;
+ }
- producer->grabber->stop();
- producer->started = tsk_false;
+ producer->grabber->stop();
+ producer->started = tsk_false;
- return 0;
+ return 0;
}
@@ -210,64 +213,62 @@ static int plugin_screencast_dshow_producer_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* plugin_screencast_dshow_producer_ctor(tsk_object_t * self, va_list * app)
{
- CoInitializeEx(NULL, COINIT_MULTITHREADED);
-
- plugin_screencast_dshow_producer_t *producer = (plugin_screencast_dshow_producer_t *)self;
- if(producer){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(producer));
- TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
- /* init self with default values*/
- producer->create_on_ui_thread = tsk_true;
- TMEDIA_PRODUCER(producer)->video.fps = 15;
- TMEDIA_PRODUCER(producer)->video.width = 352;
- TMEDIA_PRODUCER(producer)->video.height = 288;
- }
- return self;
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
+ plugin_screencast_dshow_producer_t *producer = (plugin_screencast_dshow_producer_t *)self;
+ if(producer) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(producer));
+ TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+ /* init self with default values*/
+ producer->create_on_ui_thread = tsk_true;
+ TMEDIA_PRODUCER(producer)->video.fps = 15;
+ TMEDIA_PRODUCER(producer)->video.width = 352;
+ TMEDIA_PRODUCER(producer)->video.height = 288;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_screencast_dshow_producer_dtor(tsk_object_t * self)
-{
- plugin_screencast_dshow_producer_t *producer = (plugin_screencast_dshow_producer_t *)self;
- if(producer){
- /* stop */
- if(producer->started){
- plugin_screencast_dshow_producer_stop((tmedia_producer_t*)self);
- }
-
- /* for safety */
- if(producer->grabber){
- producer->grabber->setCallback(tsk_null, tsk_null);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
- /* deinit self */
- SAFE_DELETE_PTR(producer->grabber);
- }
-
- return self;
+{
+ plugin_screencast_dshow_producer_t *producer = (plugin_screencast_dshow_producer_t *)self;
+ if(producer) {
+ /* stop */
+ if(producer->started) {
+ plugin_screencast_dshow_producer_stop((tmedia_producer_t*)self);
+ }
+
+ /* for safety */
+ if(producer->grabber) {
+ producer->grabber->setCallback(tsk_null, tsk_null);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
+ /* deinit self */
+ SAFE_DELETE_PTR(producer->grabber);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_screencast_dshow_producer_def_s =
-{
- sizeof(plugin_screencast_dshow_producer_t),
- plugin_screencast_dshow_producer_ctor,
- plugin_screencast_dshow_producer_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_screencast_dshow_producer_def_s = {
+ sizeof(plugin_screencast_dshow_producer_t),
+ plugin_screencast_dshow_producer_ctor,
+ plugin_screencast_dshow_producer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_screencast_dshow_producer_plugin_def_s =
-{
- &plugin_screencast_dshow_producer_def_s,
-
- tmedia_bfcp_video,
- "Microsoft DirectShow producer (ScrenCast)",
-
- plugin_screencast_dshow_producer_set,
- plugin_screencast_dshow_producer_prepare,
- plugin_screencast_dshow_producer_start,
- plugin_screencast_dshow_producer_pause,
- plugin_screencast_dshow_producer_stop
+static const tmedia_producer_plugin_def_t plugin_screencast_dshow_producer_plugin_def_s = {
+ &plugin_screencast_dshow_producer_def_s,
+
+ tmedia_bfcp_video,
+ "Microsoft DirectShow producer (ScrenCast)",
+
+ plugin_screencast_dshow_producer_set,
+ plugin_screencast_dshow_producer_prepare,
+ plugin_screencast_dshow_producer_start,
+ plugin_screencast_dshow_producer_pause,
+ plugin_screencast_dshow_producer_stop
};
const tmedia_producer_plugin_def_t *plugin_screencast_dshow_producer_plugin_def_t = &plugin_screencast_dshow_producer_plugin_def_s;
diff --git a/plugins/pluginDirectShow/plugin_video_dshow_consumer.cxx b/plugins/pluginDirectShow/plugin_video_dshow_consumer.cxx
index dfd7e72..3d47f4c 100755
--- a/plugins/pluginDirectShow/plugin_video_dshow_consumer.cxx
+++ b/plugins/pluginDirectShow/plugin_video_dshow_consumer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -55,33 +55,32 @@ const DWORD NUM_BACK_BUFFERS = 2;
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
#undef CHECK_HR
// In CHECK_HR(x) When (x) is a function it will be executed twice when used in "TSK_DEBUG_ERROR(x)" and "If(x)"
#define CHECK_HR(x) { HRESULT __hr__ = (x); if (FAILED(__hr__)) { TSK_DEBUG_ERROR("Operation Failed (%08x)", __hr__); goto bail; } }
-typedef struct _DSRatio
- {
+typedef struct _DSRatio {
DWORD Numerator;
DWORD Denominator;
- } DSRatio;
+} DSRatio;
static HRESULT CreateDeviceD3D9(
- HWND hWnd,
- IDirect3DDevice9** ppDevice,
- IDirect3D9 **ppD3D,
- D3DPRESENT_PARAMETERS &d3dpp
- );
+ HWND hWnd,
+ IDirect3DDevice9** ppDevice,
+ IDirect3D9 **ppD3D,
+ D3DPRESENT_PARAMETERS &d3dpp
+);
static HRESULT TestCooperativeLevel(
- struct plugin_video_dshow_consumer_s *pSelf
- );
+ struct plugin_video_dshow_consumer_s *pSelf
+);
static HRESULT CreateSwapChain(
- HWND hWnd,
- UINT32 nFrameWidth,
- UINT32 nFrameHeight,
- IDirect3DDevice9* pDevice,
- IDirect3DSwapChain9 **ppSwapChain);
+ HWND hWnd,
+ UINT32 nFrameWidth,
+ UINT32 nFrameHeight,
+ IDirect3DDevice9* pDevice,
+ IDirect3DSwapChain9 **ppSwapChain);
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -98,30 +97,29 @@ static HRESULT HookWindow(struct plugin_video_dshow_consumer_s *pSelf, HWND hWnd
static HRESULT UnhookWindow(struct plugin_video_dshow_consumer_s *pSelf);
-typedef struct plugin_video_dshow_consumer_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked;
- BOOL bPluginFireFox, bPluginWebRTC4All;
- HWND hWindow;
- WNDPROC wndProc;
- HWND hWindowFullScreen;
- RECT rcWindow;
- RECT rcDest;
- DSRatio pixelAR;
-
- UINT32 nNegWidth;
- UINT32 nNegHeight;
- UINT32 nNegFps;
-
- D3DLOCKED_RECT rcLock;
- IDirect3DDevice9* pDevice;
- IDirect3D9 *pD3D;
- IDirect3DSwapChain9 *pSwapChain;
- D3DPRESENT_PARAMETERS d3dpp;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct plugin_video_dshow_consumer_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked;
+ BOOL bPluginFireFox, bPluginWebRTC4All;
+ HWND hWindow;
+ WNDPROC wndProc;
+ HWND hWindowFullScreen;
+ RECT rcWindow;
+ RECT rcDest;
+ DSRatio pixelAR;
+
+ UINT32 nNegWidth;
+ UINT32 nNegHeight;
+ UINT32 nNegFps;
+
+ D3DLOCKED_RECT rcLock;
+ IDirect3DDevice9* pDevice;
+ IDirect3D9 *pD3D;
+ IDirect3DSwapChain9 *pSwapChain;
+ D3DPRESENT_PARAMETERS d3dpp;
+
+ TSK_DECLARE_SAFEOBJ;
}
plugin_video_dshow_consumer_t;
@@ -130,377 +128,345 @@ static int _plugin_video_dshow_consumer_unprepare(plugin_video_dshow_consumer_t*
/* ============ Media Consumer Interface ================= */
static int plugin_video_dshow_consumer_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- HRESULT hr = S_OK;
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
-
- if(!self || !param)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_POINTER);
- }
-
- if(param->value_type == tmedia_pvt_int64)
- {
- if(tsk_striequals(param->key, "remote-hwnd"))
- {
- HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
- if(hWnd != pSelf->hWindow)
- {
- tsk_safeobj_lock(pSelf); // block consumer thread
- pSelf->hWindow = hWnd;
- if(pSelf->bPrepared)
- {
- hr = ResetDevice(pSelf);
- }
- tsk_safeobj_unlock(pSelf); // unblock consumer thread
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32)
- {
- if(tsk_striequals(param->key, "fullscreen"))
- {
- BOOL bFullScreen = !!*((int32_t*)param->value);
- TSK_DEBUG_INFO("[MF video consumer] Full Screen = %d", bFullScreen);
- CHECK_HR(hr = SetFullscreen(pSelf, bFullScreen));
- }
- else if(tsk_striequals(param->key, "create-on-current-thead"))
- {
- // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox"))
- {
- pSelf->bPluginFireFox = (*((int32_t*)param->value) != 0);
- }
- else if(tsk_striequals(param->key, "plugin-webrtc4all"))
- {
- pSelf->bPluginWebRTC4All = (*((int32_t*)param->value) != 0);
- }
- }
-
- CHECK_HR(hr);
+ int ret = 0;
+ HRESULT hr = S_OK;
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "remote-hwnd")) {
+ HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
+ if(hWnd != pSelf->hWindow) {
+ tsk_safeobj_lock(pSelf); // block consumer thread
+ pSelf->hWindow = hWnd;
+ if(pSelf->bPrepared) {
+ hr = ResetDevice(pSelf);
+ }
+ tsk_safeobj_unlock(pSelf); // unblock consumer thread
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "fullscreen")) {
+ BOOL bFullScreen = !!*((int32_t*)param->value);
+ TSK_DEBUG_INFO("[MF video consumer] Full Screen = %d", bFullScreen);
+ CHECK_HR(hr = SetFullscreen(pSelf, bFullScreen));
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ pSelf->bPluginFireFox = (*((int32_t*)param->value) != 0);
+ }
+ else if(tsk_striequals(param->key, "plugin-webrtc4all")) {
+ pSelf->bPluginWebRTC4All = (*((int32_t*)param->value) != 0);
+ }
+ }
+
+ CHECK_HR(hr);
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_video_dshow_consumer_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
-
- if(!pSelf || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(pSelf->bPrepared){
- TSK_DEBUG_WARN("D3D9 video consumer already prepared");
- return -1;
- }
-
- HRESULT hr = S_OK;
- HWND hWnd = Window(pSelf);
-
- TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if(!TMEDIA_CONSUMER(pSelf)->video.display.width){
- TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(pSelf)->video.display.height){
- TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
- }
-
- pSelf->nNegFps = (UINT32)TMEDIA_CONSUMER(pSelf)->video.fps;
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.height;
-
- TSK_DEBUG_INFO("D3D9 video consumer: fps=%d, width=%d, height=%d",
- pSelf->nNegFps,
- pSelf->nNegWidth,
- pSelf->nNegHeight);
-
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- // The window handle is not created until the call is connect (incoming only) - At least on Internet Explorer 10
- if(hWnd && !pSelf->bPluginWebRTC4All)
- {
- CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
- else
- {
- if(hWnd && pSelf->bPluginWebRTC4All)
- {
- TSK_DEBUG_INFO("[MF consumer] HWND is defined but we detected webrtc4all...delaying D3D9 device creating until session get connected");
- }
- else
- {
- TSK_DEBUG_WARN("Delaying D3D9 device creation because HWND is not defined yet");
- }
- }
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+
+ if(!pSelf || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(pSelf->bPrepared) {
+ TSK_DEBUG_WARN("D3D9 video consumer already prepared");
+ return -1;
+ }
+
+ HRESULT hr = S_OK;
+ HWND hWnd = Window(pSelf);
+
+ TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.width) {
+ TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.height) {
+ TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
+ }
+
+ pSelf->nNegFps = (UINT32)TMEDIA_CONSUMER(pSelf)->video.fps;
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.height;
+
+ TSK_DEBUG_INFO("D3D9 video consumer: fps=%d, width=%d, height=%d",
+ pSelf->nNegFps,
+ pSelf->nNegWidth,
+ pSelf->nNegHeight);
+
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ // The window handle is not created until the call is connect (incoming only) - At least on Internet Explorer 10
+ if(hWnd && !pSelf->bPluginWebRTC4All) {
+ CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
+ else {
+ if(hWnd && pSelf->bPluginWebRTC4All) {
+ TSK_DEBUG_INFO("[MF consumer] HWND is defined but we detected webrtc4all...delaying D3D9 device creating until session get connected");
+ }
+ else {
+ TSK_DEBUG_WARN("Delaying D3D9 device creation because HWND is not defined yet");
+ }
+ }
bail:
- pSelf->bPrepared = SUCCEEDED(hr);
- return pSelf->bPrepared ? 0 : -1;
+ pSelf->bPrepared = SUCCEEDED(hr);
+ return pSelf->bPrepared ? 0 : -1;
}
static int plugin_video_dshow_consumer_start(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(pSelf->bStarted){
- TSK_DEBUG_INFO("D3D9 video consumer already started");
- return 0;
- }
- if(!pSelf->bPrepared){
- TSK_DEBUG_ERROR("D3D9 video consumer not prepared");
- return -1;
- }
+ if(pSelf->bStarted) {
+ TSK_DEBUG_INFO("D3D9 video consumer already started");
+ return 0;
+ }
+ if(!pSelf->bPrepared) {
+ TSK_DEBUG_ERROR("D3D9 video consumer not prepared");
+ return -1;
+ }
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- pSelf->bPaused = false;
- pSelf->bStarted = true;
+ pSelf->bPaused = false;
+ pSelf->bStarted = true;
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_video_dshow_consumer_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
- HRESULT hr = S_OK;
- HWND hWnd = Window(pSelf);
+ HRESULT hr = S_OK;
+ HWND hWnd = Window(pSelf);
- IDirect3DSurface9 *pSurf = NULL;
+ IDirect3DSurface9 *pSurf = NULL;
IDirect3DSurface9 *pBB = NULL;
- if(!pSelf)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1; // because of the mutex lock do it here
- }
-
- tsk_safeobj_lock(pSelf);
-
- if(!buffer || !size)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_INVALIDARG);
- }
-
- if(!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("D3D9 video consumer not started");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(!hWnd)
- {
- TSK_DEBUG_INFO("Do not draw frame because HWND not set");
- goto bail; // not an error as the application can decide to set the HWND at any time
- }
-
- if (!pSelf->bWindowHooked)
- {
- // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
- CHECK_HR(hr = HookWindow(pSelf, pSelf->hWindow));
- }
-
- if(!pSelf->pDevice || !pSelf->pD3D || !pSelf->pSwapChain)
- {
- if(pSelf->pDevice || pSelf->pD3D || pSelf->pSwapChain)
- {
- CHECK_HR(hr = E_POINTER); // They must be "all null" or "all valid"
- }
-
- if(hWnd)
- {
- // means HWND was not set but defined now
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
-
- CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
- }
-
- if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height){
- TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
- pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
- pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
- // Update media type
-
- SafeRelease(&pSelf->pSwapChain);
- CHECK_HR(hr = CreateSwapChain(hWnd, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height, pSelf->pDevice, &pSelf->pSwapChain));
-
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
-
- // Update Destination will do noting if the window size haven't changed.
- // Force updating the destination rect if negotiated size change
- CHECK_HR(hr = UpdateDestinationRect(pSelf, TRUE/* Force */));
- }
-
- if(((pSelf->nNegWidth * pSelf->nNegHeight) << 2) != size)
- {
- TSK_DEBUG_ERROR("%u not valid as input size", size);
- CHECK_HR(hr = E_FAIL);
- }
-
- CHECK_HR(hr = TestCooperativeLevel(pSelf));
-
- CHECK_HR(hr = UpdateDestinationRect(pSelf));
-
- CHECK_HR(hr = pSelf->pSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pSurf));
- CHECK_HR(hr = pSurf->LockRect(&pSelf->rcLock, NULL, D3DLOCK_NOSYSLOCK ));
-
- // Fast copy() using MMX, SSE, or SSE2
- // Only available on Vista or later: Use LoadLibrary() to get a pointer to the function
- /*hr = MFCopyImage(
- (BYTE*)pSelf->rcLock.pBits,
- pSelf->rcLock.Pitch,
- (BYTE*)buffer,
- (pSelf->nNegWidth << 2),
- (pSelf->nNegWidth << 2),
- pSelf->nNegHeight
- );*/
-
- if(pSelf->rcLock.Pitch == (pSelf->nNegWidth << 2))
- {
- memcpy(pSelf->rcLock.pBits, buffer, size);
- }
- else
- {
- const BYTE* pSrcPtr = (const BYTE*)buffer;
- BYTE* pDstPtr = (BYTE*)pSelf->rcLock.pBits;
- UINT32 nDstPitch = pSelf->rcLock.Pitch;
- UINT32 nSrcPitch = (pSelf->nNegWidth << 2);
- for(UINT32 i = 0; i < pSelf->nNegHeight; ++i)
- {
- memcpy(pDstPtr, pSrcPtr, nSrcPitch);
- pDstPtr += nDstPitch;
- pSrcPtr += nSrcPitch;
- }
- }
-
- if(FAILED(hr))
- {
- // unlock() before leaving
- pSurf->UnlockRect();
- CHECK_HR(hr);
- }
-
- CHECK_HR(hr = pSurf->UnlockRect());
-
- // Color fill the back buffer
- CHECK_HR(hr = pSelf->pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBB));
- CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF)));
-
- // Resize keeping aspect ratio and Blit the frame (required)
- hr = pSelf->pDevice->StretchRect(
- pSurf,
- NULL,
- pBB,
- &pSelf->rcDest/*NULL*/,
- D3DTEXF_LINEAR
- ); // could fail when display is being resized
- if(SUCCEEDED(hr))
- {
- // Present the frame
- CHECK_HR(hr = pSelf->pDevice->Present(NULL, NULL, NULL, NULL));
- }
- else
- {
- TSK_DEBUG_INFO("StretchRect returned ...%x", hr);
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1; // because of the mutex lock do it here
+ }
+
+ tsk_safeobj_lock(pSelf);
+
+ if(!buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("D3D9 video consumer not started");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(!hWnd) {
+ TSK_DEBUG_INFO("Do not draw frame because HWND not set");
+ goto bail; // not an error as the application can decide to set the HWND at any time
+ }
+
+ if (!pSelf->bWindowHooked) {
+ // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
+ CHECK_HR(hr = HookWindow(pSelf, pSelf->hWindow));
+ }
+
+ if(!pSelf->pDevice || !pSelf->pD3D || !pSelf->pSwapChain) {
+ if(pSelf->pDevice || pSelf->pD3D || pSelf->pSwapChain) {
+ CHECK_HR(hr = E_POINTER); // They must be "all null" or "all valid"
+ }
+
+ if(hWnd) {
+ // means HWND was not set but defined now
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
+
+ CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
+ }
+
+ if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height) {
+ TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
+ pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
+ pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
+ // Update media type
+
+ SafeRelease(&pSelf->pSwapChain);
+ CHECK_HR(hr = CreateSwapChain(hWnd, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height, pSelf->pDevice, &pSelf->pSwapChain));
+
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
+
+ // Update Destination will do noting if the window size haven't changed.
+ // Force updating the destination rect if negotiated size change
+ CHECK_HR(hr = UpdateDestinationRect(pSelf, TRUE/* Force */));
+ }
+
+ if(((pSelf->nNegWidth * pSelf->nNegHeight) << 2) != size) {
+ TSK_DEBUG_ERROR("%u not valid as input size", size);
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ CHECK_HR(hr = TestCooperativeLevel(pSelf));
+
+ CHECK_HR(hr = UpdateDestinationRect(pSelf));
+
+ CHECK_HR(hr = pSelf->pSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pSurf));
+ CHECK_HR(hr = pSurf->LockRect(&pSelf->rcLock, NULL, D3DLOCK_NOSYSLOCK ));
+
+ // Fast copy() using MMX, SSE, or SSE2
+ // Only available on Vista or later: Use LoadLibrary() to get a pointer to the function
+ /*hr = MFCopyImage(
+ (BYTE*)pSelf->rcLock.pBits,
+ pSelf->rcLock.Pitch,
+ (BYTE*)buffer,
+ (pSelf->nNegWidth << 2),
+ (pSelf->nNegWidth << 2),
+ pSelf->nNegHeight
+ );*/
+
+ if(pSelf->rcLock.Pitch == (pSelf->nNegWidth << 2)) {
+ memcpy(pSelf->rcLock.pBits, buffer, size);
+ }
+ else {
+ const BYTE* pSrcPtr = (const BYTE*)buffer;
+ BYTE* pDstPtr = (BYTE*)pSelf->rcLock.pBits;
+ UINT32 nDstPitch = pSelf->rcLock.Pitch;
+ UINT32 nSrcPitch = (pSelf->nNegWidth << 2);
+ for(UINT32 i = 0; i < pSelf->nNegHeight; ++i) {
+ memcpy(pDstPtr, pSrcPtr, nSrcPitch);
+ pDstPtr += nDstPitch;
+ pSrcPtr += nSrcPitch;
+ }
+ }
+
+ if(FAILED(hr)) {
+ // unlock() before leaving
+ pSurf->UnlockRect();
+ CHECK_HR(hr);
+ }
+
+ CHECK_HR(hr = pSurf->UnlockRect());
+
+ // Color fill the back buffer
+ CHECK_HR(hr = pSelf->pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBB));
+ CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF)));
+
+ // Resize keeping aspect ratio and Blit the frame (required)
+ hr = pSelf->pDevice->StretchRect(
+ pSurf,
+ NULL,
+ pBB,
+ &pSelf->rcDest/*NULL*/,
+ D3DTEXF_LINEAR
+ ); // could fail when display is being resized
+ if(SUCCEEDED(hr)) {
+ // Present the frame
+ CHECK_HR(hr = pSelf->pDevice->Present(NULL, NULL, NULL, NULL));
+ }
+ else {
+ TSK_DEBUG_INFO("StretchRect returned ...%x", hr);
+ }
bail:
- SafeRelease(&pSurf);
- SafeRelease(&pBB);
+ SafeRelease(&pSurf);
+ SafeRelease(&pBB);
- tsk_safeobj_unlock(pSelf);
+ tsk_safeobj_unlock(pSelf);
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_video_dshow_consumer_pause(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("MF video producer not started");
- return 0;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video producer not started");
+ return 0;
+ }
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- pSelf->bPaused = true;
+ pSelf->bPaused = true;
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_video_dshow_consumer_stop(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* pSelf = (plugin_video_dshow_consumer_t*)self;
- if(!pSelf){
+ if(!pSelf) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- HRESULT hr = S_OK;
-
+ HRESULT hr = S_OK;
+
pSelf->bStarted = false;
- pSelf->bPaused = false;
+ pSelf->bPaused = false;
- if(pSelf->hWindowFullScreen)
- {
- ::InvalidateRect(pSelf->hWindowFullScreen, NULL, FALSE);
- ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
- }
+ if(pSelf->hWindowFullScreen) {
+ ::InvalidateRect(pSelf->hWindowFullScreen, NULL, FALSE);
+ ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
+ }
- // next start() will be called after prepare()
- return _plugin_video_dshow_consumer_unprepare(pSelf);
+ // next start() will be called after prepare()
+ return _plugin_video_dshow_consumer_unprepare(pSelf);
}
static int _plugin_video_dshow_consumer_unprepare(plugin_video_dshow_consumer_t* pSelf)
{
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(pSelf->bStarted)
- {
- // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
- TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
- return -1;
- }
+ if(pSelf->bStarted) {
+ // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
+ TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
+ return -1;
+ }
- UnhookWindow(pSelf);
+ UnhookWindow(pSelf);
- SafeRelease(&pSelf->pDevice);
- SafeRelease(&pSelf->pD3D);
- SafeRelease(&pSelf->pSwapChain);
+ SafeRelease(&pSelf->pDevice);
+ SafeRelease(&pSelf->pD3D);
+ SafeRelease(&pSelf->pSwapChain);
- pSelf->bPrepared = false;
+ pSelf->bPrepared = false;
- return 0;
+ return 0;
}
@@ -510,191 +476,177 @@ static int _plugin_video_dshow_consumer_unprepare(plugin_video_dshow_consumer_t*
/* constructor */
static tsk_object_t* plugin_video_dshow_consumer_ctor(tsk_object_t * self, va_list * app)
{
- plugin_video_dshow_consumer_t *pSelf = (plugin_video_dshow_consumer_t *)self;
- if(pSelf)
- {
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- /* init self */
- tsk_safeobj_init(pSelf);
- TMEDIA_CONSUMER(pSelf)->video.fps = 15;
- TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
-
- pSelf->pixelAR.Denominator = pSelf->pixelAR.Numerator = 1;
- }
- return self;
+ plugin_video_dshow_consumer_t *pSelf = (plugin_video_dshow_consumer_t *)self;
+ if(pSelf) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ /* init self */
+ tsk_safeobj_init(pSelf);
+ TMEDIA_CONSUMER(pSelf)->video.fps = 15;
+ TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
+
+ pSelf->pixelAR.Denominator = pSelf->pixelAR.Numerator = 1;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_video_dshow_consumer_dtor(tsk_object_t * self)
-{
- plugin_video_dshow_consumer_t *pSelf = (plugin_video_dshow_consumer_t *)self;
- if (pSelf) {
- /* stop */
- if (pSelf->bStarted)
- {
- plugin_video_dshow_consumer_stop(TMEDIA_CONSUMER(pSelf));
- }
-
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
- /* deinit self */
- _plugin_video_dshow_consumer_unprepare(pSelf);
- tsk_safeobj_deinit(pSelf);
- }
-
- return self;
+{
+ plugin_video_dshow_consumer_t *pSelf = (plugin_video_dshow_consumer_t *)self;
+ if (pSelf) {
+ /* stop */
+ if (pSelf->bStarted) {
+ plugin_video_dshow_consumer_stop(TMEDIA_CONSUMER(pSelf));
+ }
+
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
+ /* deinit self */
+ _plugin_video_dshow_consumer_unprepare(pSelf);
+ tsk_safeobj_deinit(pSelf);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_video_dshow_consumer_def_s =
-{
- sizeof(plugin_video_dshow_consumer_t),
- plugin_video_dshow_consumer_ctor,
- plugin_video_dshow_consumer_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_video_dshow_consumer_def_s = {
+ sizeof(plugin_video_dshow_consumer_t),
+ plugin_video_dshow_consumer_ctor,
+ plugin_video_dshow_consumer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_video_dshow_consumer_plugin_def_s =
-{
- &plugin_video_dshow_consumer_def_s,
-
- tmedia_video,
- "Microsoft DirectShow consumer (D3D9)",
-
- plugin_video_dshow_consumer_set,
- plugin_video_dshow_consumer_prepare,
- plugin_video_dshow_consumer_start,
- plugin_video_dshow_consumer_consume,
- plugin_video_dshow_consumer_pause,
- plugin_video_dshow_consumer_stop
+static const tmedia_consumer_plugin_def_t plugin_video_dshow_consumer_plugin_def_s = {
+ &plugin_video_dshow_consumer_def_s,
+
+ tmedia_video,
+ "Microsoft DirectShow consumer (D3D9)",
+
+ plugin_video_dshow_consumer_set,
+ plugin_video_dshow_consumer_prepare,
+ plugin_video_dshow_consumer_start,
+ plugin_video_dshow_consumer_consume,
+ plugin_video_dshow_consumer_pause,
+ plugin_video_dshow_consumer_stop
};
const tmedia_consumer_plugin_def_t *plugin_video_dshow_consumer_plugin_def_t = &plugin_video_dshow_consumer_plugin_def_s;
// Helper functions
static HRESULT CreateDeviceD3D9(
- HWND hWnd,
- IDirect3DDevice9** ppDevice,
- IDirect3D9 **ppD3D,
- D3DPRESENT_PARAMETERS &d3dpp
- )
+ HWND hWnd,
+ IDirect3DDevice9** ppDevice,
+ IDirect3D9 **ppD3D,
+ D3DPRESENT_PARAMETERS &d3dpp
+)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
D3DDISPLAYMODE mode = { 0 };
- D3DPRESENT_PARAMETERS pp = {0};
-
- if(!ppDevice || *ppDevice || !ppD3D || *ppD3D)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!(*ppD3D = Direct3DCreate9(D3D_SDK_VERSION)))
- {
+ D3DPRESENT_PARAMETERS pp = {0};
+
+ if(!ppDevice || *ppDevice || !ppD3D || *ppD3D) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!(*ppD3D = Direct3DCreate9(D3D_SDK_VERSION))) {
CHECK_HR(hr = E_OUTOFMEMORY);
}
CHECK_HR(hr = (*ppD3D)->GetAdapterDisplayMode(
- D3DADAPTER_DEFAULT,
- &mode
- ));
+ D3DADAPTER_DEFAULT,
+ &mode
+ ));
CHECK_HR(hr = (*ppD3D)->CheckDeviceType(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- mode.Format,
- D3DFMT_X8R8G8B8,
- TRUE // windowed
- ));
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ mode.Format,
+ D3DFMT_X8R8G8B8,
+ TRUE // windowed
+ ));
pp.BackBufferFormat = D3DFMT_X8R8G8B8;
pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- pp.Windowed = TRUE;
+ pp.Windowed = TRUE;
pp.hDeviceWindow = hWnd;
CHECK_HR(hr = (*ppD3D)->CreateDevice(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- hWnd,
- D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &pp,
- ppDevice
- ));
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ hWnd,
+ D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &pp,
+ ppDevice
+ ));
- d3dpp = pp;
+ d3dpp = pp;
bail:
- if(FAILED(hr))
- {
- SafeRelease(ppD3D);
- SafeRelease(ppDevice);
- }
+ if(FAILED(hr)) {
+ SafeRelease(ppD3D);
+ SafeRelease(ppDevice);
+ }
return hr;
}
static HRESULT TestCooperativeLevel(
- struct plugin_video_dshow_consumer_s *pSelf
- )
+ struct plugin_video_dshow_consumer_s *pSelf
+)
{
- HRESULT hr = S_OK;
-
- if (!pSelf || !pSelf->pDevice)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- switch((hr = pSelf->pDevice->TestCooperativeLevel()))
- {
- case D3D_OK:
- {
- break;
- }
-
- case D3DERR_DEVICELOST:
- {
- hr = S_OK;
- break;
- }
-
- case D3DERR_DEVICENOTRESET:
- {
- hr = ResetDevice(pSelf, TRUE);
- break;
- }
-
- default:
- {
- break;
- }
- }
-
- CHECK_HR(hr);
+ HRESULT hr = S_OK;
+
+ if (!pSelf || !pSelf->pDevice) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ switch((hr = pSelf->pDevice->TestCooperativeLevel())) {
+ case D3D_OK: {
+ break;
+ }
+
+ case D3DERR_DEVICELOST: {
+ hr = S_OK;
+ break;
+ }
+
+ case D3DERR_DEVICENOTRESET: {
+ hr = ResetDevice(pSelf, TRUE);
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
+
+ CHECK_HR(hr);
bail:
return hr;
}
static HRESULT CreateSwapChain(
- HWND hWnd,
- UINT32 nFrameWidth,
- UINT32 nFrameHeight,
- IDirect3DDevice9* pDevice,
- IDirect3DSwapChain9 **ppSwapChain
- )
+ HWND hWnd,
+ UINT32 nFrameWidth,
+ UINT32 nFrameHeight,
+ IDirect3DDevice9* pDevice,
+ IDirect3DSwapChain9 **ppSwapChain
+)
{
HRESULT hr = S_OK;
D3DPRESENT_PARAMETERS pp = { 0 };
- if(!pDevice || !ppSwapChain || *ppSwapChain)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- pp.BackBufferWidth = nFrameWidth;
+ if(!pDevice || !ppSwapChain || *ppSwapChain) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ pp.BackBufferWidth = nFrameWidth;
pp.BackBufferHeight = nFrameHeight;
pp.Windowed = TRUE;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
@@ -706,7 +658,7 @@ static HRESULT CreateSwapChain(
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
pp.BackBufferCount = NUM_BACK_BUFFERS;
- CHECK_HR(hr = pDevice->CreateAdditionalSwapChain(&pp, ppSwapChain));
+ CHECK_HR(hr = pDevice->CreateAdditionalSwapChain(&pp, ppSwapChain));
bail:
return hr;
@@ -714,7 +666,7 @@ bail:
static inline HWND Window(struct plugin_video_dshow_consumer_s *pSelf)
{
- return pSelf ? (pSelf->bFullScreen ? pSelf->hWindowFullScreen : pSelf->hWindow) : NULL;
+ return pSelf ? (pSelf->bFullScreen ? pSelf->hWindowFullScreen : pSelf->hWindow) : NULL;
}
static inline LONG Width(const RECT& r)
@@ -743,17 +695,14 @@ static inline RECT CorrectAspectRatio(const RECT& src, const DSRatio& srcPAR)
// Start with a rectangle the same size as src, but offset to the origin (0,0).
RECT rc = {0, 0, src.right - src.left, src.bottom - src.top};
- if ((srcPAR.Numerator != 1) || (srcPAR.Denominator != 1))
- {
+ if ((srcPAR.Numerator != 1) || (srcPAR.Denominator != 1)) {
// Correct for the source's PAR.
- if (srcPAR.Numerator > srcPAR.Denominator)
- {
+ if (srcPAR.Numerator > srcPAR.Denominator) {
// The source has "wide" pixels, so stretch the width.
rc.right = MulDiv(rc.right, srcPAR.Numerator, srcPAR.Denominator);
}
- else if (srcPAR.Numerator < srcPAR.Denominator)
- {
+ else if (srcPAR.Numerator < srcPAR.Denominator) {
// The source has "tall" pixels, so stretch the height.
rc.bottom = MulDiv(rc.bottom, srcPAR.Denominator, srcPAR.Numerator);
}
@@ -816,266 +765,242 @@ static inline RECT LetterBoxRect(const RECT& rcSrc, const RECT& rcDst)
static inline HRESULT UpdateDestinationRect(plugin_video_dshow_consumer_t *pSelf, BOOL bForce /*= FALSE*/)
{
- HRESULT hr = S_OK;
- HWND hwnd = Window(pSelf);
-
- if(!pSelf)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!hwnd)
- {
- CHECK_HR(hr = E_HANDLE);
- }
+ HRESULT hr = S_OK;
+ HWND hwnd = Window(pSelf);
+
+ if(!pSelf) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!hwnd) {
+ CHECK_HR(hr = E_HANDLE);
+ }
RECT rcClient;
- GetClientRect(hwnd, &rcClient);
+ GetClientRect(hwnd, &rcClient);
- // only update destination if window size changed
- if(bForce || (rcClient.bottom != pSelf->rcWindow.bottom || rcClient.left != pSelf->rcWindow.left || rcClient.right != pSelf->rcWindow.right || rcClient.top != pSelf->rcWindow.top))
- {
- CHECK_HR(hr = ResetDevice(pSelf));
+ // only update destination if window size changed
+ if(bForce || (rcClient.bottom != pSelf->rcWindow.bottom || rcClient.left != pSelf->rcWindow.left || rcClient.right != pSelf->rcWindow.right || rcClient.top != pSelf->rcWindow.top)) {
+ CHECK_HR(hr = ResetDevice(pSelf));
- pSelf->rcWindow = rcClient;
+ pSelf->rcWindow = rcClient;
#if 1
- RECT rcSrc = { 0, 0, pSelf->nNegWidth, pSelf->nNegHeight };
- rcSrc = CorrectAspectRatio(rcSrc, pSelf->pixelAR);
- pSelf->rcDest = LetterBoxRect(rcSrc, rcClient);
+ RECT rcSrc = { 0, 0, pSelf->nNegWidth, pSelf->nNegHeight };
+ rcSrc = CorrectAspectRatio(rcSrc, pSelf->pixelAR);
+ pSelf->rcDest = LetterBoxRect(rcSrc, rcClient);
#else
- long w = rcClient.right - rcClient.left;
- long h = rcClient.bottom - rcClient.top;
- float ratio = ((float)pSelf->nNegWidth/(float)pSelf->nNegHeight);
- // (w/h)=ratio =>
- // 1) h=w/ratio
- // and
- // 2) w=h*ratio
- pSelf->rcDest.right = (int)(w/ratio) > h ? (int)(h * ratio) : w;
- pSelf->rcDest.bottom = (int)(pSelf->rcDest.right/ratio) > h ? h : (int)(pSelf->rcDest.right/ratio);
- pSelf->rcDest.left = ((w - pSelf->rcDest.right) >> 1);
- pSelf->rcDest.top = ((h - pSelf->rcDest.bottom) >> 1);
+ long w = rcClient.right - rcClient.left;
+ long h = rcClient.bottom - rcClient.top;
+ float ratio = ((float)pSelf->nNegWidth/(float)pSelf->nNegHeight);
+ // (w/h)=ratio =>
+ // 1) h=w/ratio
+ // and
+ // 2) w=h*ratio
+ pSelf->rcDest.right = (int)(w/ratio) > h ? (int)(h * ratio) : w;
+ pSelf->rcDest.bottom = (int)(pSelf->rcDest.right/ratio) > h ? h : (int)(pSelf->rcDest.right/ratio);
+ pSelf->rcDest.left = ((w - pSelf->rcDest.right) >> 1);
+ pSelf->rcDest.top = ((h - pSelf->rcDest.bottom) >> 1);
#endif
- //::InvalidateRect(hwnd, NULL, FALSE);
- }
+ //::InvalidateRect(hwnd, NULL, FALSE);
+ }
bail:
- return hr;
+ return hr;
}
static HRESULT ResetDevice(plugin_video_dshow_consumer_t *pSelf, BOOL bUpdateDestinationRect /*= FALSE*/)
{
HRESULT hr = S_OK;
- tsk_safeobj_lock(pSelf);
+ tsk_safeobj_lock(pSelf);
- HWND hWnd = Window(pSelf);
+ HWND hWnd = Window(pSelf);
- if (pSelf->pDevice)
- {
+ if (pSelf->pDevice) {
D3DPRESENT_PARAMETERS d3dpp = pSelf->d3dpp;
hr = pSelf->pDevice->Reset(&d3dpp);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
SafeRelease(&pSelf->pDevice);
- SafeRelease(&pSelf->pD3D);
- SafeRelease(&pSelf->pSwapChain);
+ SafeRelease(&pSelf->pD3D);
+ SafeRelease(&pSelf->pSwapChain);
}
}
- if (pSelf->pDevice == NULL && hWnd)
- {
+ if (pSelf->pDevice == NULL && hWnd) {
CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
- if(bUpdateDestinationRect) // endless loop guard
- {
- CHECK_HR(hr = UpdateDestinationRect(pSelf));
- }
+ if(bUpdateDestinationRect) { // endless loop guard
+ CHECK_HR(hr = UpdateDestinationRect(pSelf));
+ }
bail:
- tsk_safeobj_unlock(pSelf);
+ tsk_safeobj_unlock(pSelf);
- return hr;
+ return hr;
}
static HRESULT SetFullscreen(struct plugin_video_dshow_consumer_s *pSelf, BOOL bFullScreen)
{
- HRESULT hr = S_OK;
- if(!pSelf)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(pSelf->bFullScreen != bFullScreen)
- {
- tsk_safeobj_lock(pSelf);
- if(bFullScreen)
- {
- HWND hWnd = CreateFullScreenWindow(pSelf);
- if(hWnd)
- {
- ::ShowWindow(hWnd, SW_SHOWDEFAULT);
- ::UpdateWindow(hWnd);
- }
- }
- else if(pSelf->hWindowFullScreen)
- {
- ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
- }
- pSelf->bFullScreen = bFullScreen;
- if(pSelf->bPrepared)
- {
- hr = ResetDevice(pSelf);
- }
- tsk_safeobj_unlock(pSelf);
-
- CHECK_HR(hr);
- }
+ HRESULT hr = S_OK;
+ if(!pSelf) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(pSelf->bFullScreen != bFullScreen) {
+ tsk_safeobj_lock(pSelf);
+ if(bFullScreen) {
+ HWND hWnd = CreateFullScreenWindow(pSelf);
+ if(hWnd) {
+ ::ShowWindow(hWnd, SW_SHOWDEFAULT);
+ ::UpdateWindow(hWnd);
+ }
+ }
+ else if(pSelf->hWindowFullScreen) {
+ ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
+ }
+ pSelf->bFullScreen = bFullScreen;
+ if(pSelf->bPrepared) {
+ hr = ResetDevice(pSelf);
+ }
+ tsk_safeobj_unlock(pSelf);
+
+ CHECK_HR(hr);
+ }
bail:
- return hr;
+ return hr;
}
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_CREATE:
- case WM_SIZE:
- case WM_MOVE:
- {
- struct plugin_video_dshow_consumer_s* pSelf = dynamic_cast<struct plugin_video_dshow_consumer_s*>((struct plugin_video_dshow_consumer_s*)GetPropA(hWnd, "Self"));
- if (pSelf)
- {
-
- }
- break;
- }
+ switch(uMsg) {
+ case WM_CREATE:
+ case WM_SIZE:
+ case WM_MOVE: {
+ struct plugin_video_dshow_consumer_s* pSelf = dynamic_cast<struct plugin_video_dshow_consumer_s*>((struct plugin_video_dshow_consumer_s*)GetPropA(hWnd, "Self"));
+ if (pSelf) {
+
+ }
+ break;
+ }
#if 0
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hWnd, &ps);
- ps.fErase = FALSE;
-
- RECT rc;
- GetBoundsRect(hdc, &rc, 0);
- FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
-
- EndPaint(hWnd, &ps);
- break;
- }
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hWnd, &ps);
+ ps.fErase = FALSE;
+
+ RECT rc;
+ GetBoundsRect(hdc, &rc, 0);
+ FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
+
+ EndPaint(hWnd, &ps);
+ break;
+ }
#endif
- case WM_ERASEBKGND:
- {
- return TRUE; // avoid background erasing.
- }
-
-
- case WM_CHAR:
- case WM_KEYUP:
- {
- struct plugin_video_dshow_consumer_s* pSelf = dynamic_cast<struct plugin_video_dshow_consumer_s*>((struct plugin_video_dshow_consumer_s*)GetPropA(hWnd, "Self"));
- if (pSelf)
- {
- SetFullscreen(pSelf, FALSE);
- }
-
- break;
- }
- }
-
- return DefWindowProc(hWnd, uMsg, wParam, lParam);
+ case WM_ERASEBKGND: {
+ return TRUE; // avoid background erasing.
+ }
+
+
+ case WM_CHAR:
+ case WM_KEYUP: {
+ struct plugin_video_dshow_consumer_s* pSelf = dynamic_cast<struct plugin_video_dshow_consumer_s*>((struct plugin_video_dshow_consumer_s*)GetPropA(hWnd, "Self"));
+ if (pSelf) {
+ SetFullscreen(pSelf, FALSE);
+ }
+
+ break;
+ }
+ }
+
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
static HWND CreateFullScreenWindow(struct plugin_video_dshow_consumer_s *pSelf)
{
- HRESULT hr = S_OK;
-
- if(!pSelf)
- {
- return NULL;
- }
-
- if(!pSelf->hWindowFullScreen)
- {
- WNDCLASS wc = {0};
-
- wc.lpfnWndProc = WndProc;
- wc.hInstance = GetModuleHandle(NULL);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.lpszClassName = L"WindowClass";
- RegisterClass(&wc);
- pSelf->hWindowFullScreen = ::CreateWindowEx(
- NULL,
- wc.lpszClassName,
- L"Doubango's Video Consumer Fullscreen",
- WS_EX_TOPMOST | WS_POPUP,
- 0, 0,
- GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
- NULL,
- NULL,
- GetModuleHandle(NULL),
- NULL);
-
- SetPropA(pSelf->hWindowFullScreen, "Self", pSelf);
- }
- return pSelf->hWindowFullScreen;
+ HRESULT hr = S_OK;
+
+ if(!pSelf) {
+ return NULL;
+ }
+
+ if(!pSelf->hWindowFullScreen) {
+ WNDCLASS wc = {0};
+
+ wc.lpfnWndProc = WndProc;
+ wc.hInstance = GetModuleHandle(NULL);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.lpszClassName = L"WindowClass";
+ RegisterClass(&wc);
+ pSelf->hWindowFullScreen = ::CreateWindowEx(
+ NULL,
+ wc.lpszClassName,
+ L"Doubango's Video Consumer Fullscreen",
+ WS_EX_TOPMOST | WS_POPUP,
+ 0, 0,
+ GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
+ NULL,
+ NULL,
+ GetModuleHandle(NULL),
+ NULL);
+
+ SetPropA(pSelf->hWindowFullScreen, "Self", pSelf);
+ }
+ return pSelf->hWindowFullScreen;
}
static HRESULT HookWindow(plugin_video_dshow_consumer_t *pSelf, HWND hWnd)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- tsk_safeobj_lock(pSelf);
+ tsk_safeobj_lock(pSelf);
- CHECK_HR(hr = UnhookWindow(pSelf));
+ CHECK_HR(hr = UnhookWindow(pSelf));
- if ((pSelf->hWindow = hWnd)) {
- pSelf->wndProc = (WNDPROC)SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)WndProc);
- if (!pSelf->wndProc) {
- TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
- CHECK_HR(hr = E_FAIL);
- }
- pSelf->bWindowHooked = TRUE;
- }
+ if ((pSelf->hWindow = hWnd)) {
+ pSelf->wndProc = (WNDPROC)SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)WndProc);
+ if (!pSelf->wndProc) {
+ TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
+ CHECK_HR(hr = E_FAIL);
+ }
+ pSelf->bWindowHooked = TRUE;
+ }
bail:
- tsk_safeobj_unlock(pSelf);
- return S_OK;
+ tsk_safeobj_unlock(pSelf);
+ return S_OK;
}
static HRESULT UnhookWindow(struct plugin_video_dshow_consumer_s *pSelf)
{
- tsk_safeobj_lock(pSelf);
- if (pSelf->hWindow && pSelf->wndProc) {
- SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)pSelf->wndProc);
- pSelf->wndProc = NULL;
- }
- if(pSelf->hWindow)
- {
- ::InvalidateRect(pSelf->hWindow, NULL, FALSE);
- }
- pSelf->bWindowHooked = FALSE;
- tsk_safeobj_unlock(pSelf);
- return S_OK;
+ tsk_safeobj_lock(pSelf);
+ if (pSelf->hWindow && pSelf->wndProc) {
+ SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)pSelf->wndProc);
+ pSelf->wndProc = NULL;
+ }
+ if(pSelf->hWindow) {
+ ::InvalidateRect(pSelf->hWindow, NULL, FALSE);
+ }
+ pSelf->bWindowHooked = FALSE;
+ tsk_safeobj_unlock(pSelf);
+ return S_OK;
}
#else /* !PLUGIN_DS_CV_USE_D3D9 */
-typedef struct plugin_video_dshow_consumer_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- DSDisplay* display;
- INT64 window;
-
- tsk_bool_t plugin_firefox;
- tsk_bool_t started;
- tsk_bool_t create_on_ui_thread;
+typedef struct plugin_video_dshow_consumer_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ DSDisplay* display;
+ INT64 window;
+
+ tsk_bool_t plugin_firefox;
+ tsk_bool_t started;
+ tsk_bool_t create_on_ui_thread;
}
plugin_video_dshow_consumer_t;
@@ -1084,166 +1009,170 @@ plugin_video_dshow_consumer_t;
/* ============ Media Consumer Interface ================= */
static int plugin_video_dshow_consumer_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
-
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int64){
- if(tsk_striequals(param->key, "remote-hwnd")){
- DSCONSUMER(self)->window = (INT64)*((int64_t*)param->value);
- if(DSCONSUMER(self)->display){
- if(DSCONSUMER(self)->window){
- DSCONSUMER(self)->display->attach(DSCONSUMER(self)->window);
- }
- else{
- DSCONSUMER(self)->display->detach();
- }
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "fullscreen")){
- if(DSCONSUMER(self)->display){
- DSCONSUMER(self)->display->setFullscreen(*((int32_t*)param->value) != 0);
- }
- }
- else if(tsk_striequals(param->key, "create-on-current-thead")){
- DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox")){
- DSCONSUMER(self)->plugin_firefox = (*((int32_t*)param->value) != 0);
- if(DSCONSUMER(self)->display){
- DSCONSUMER(self)->display->setPluginFirefox((DSCONSUMER(self)->plugin_firefox == tsk_true));
- }
- }
- }
-
- return ret;
+ int ret = 0;
+
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "remote-hwnd")) {
+ DSCONSUMER(self)->window = (INT64)*((int64_t*)param->value);
+ if(DSCONSUMER(self)->display) {
+ if(DSCONSUMER(self)->window) {
+ DSCONSUMER(self)->display->attach(DSCONSUMER(self)->window);
+ }
+ else {
+ DSCONSUMER(self)->display->detach();
+ }
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "fullscreen")) {
+ if(DSCONSUMER(self)->display) {
+ DSCONSUMER(self)->display->setFullscreen(*((int32_t*)param->value) != 0);
+ }
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ DSCONSUMER(self)->plugin_firefox = (*((int32_t*)param->value) != 0);
+ if(DSCONSUMER(self)->display) {
+ DSCONSUMER(self)->display->setPluginFirefox((DSCONSUMER(self)->plugin_firefox == tsk_true));
+ }
+ }
+ }
+
+ return ret;
}
static int plugin_video_dshow_consumer_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
-
- if(!consumer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if(!TMEDIA_CONSUMER(consumer)->video.display.width){
- TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(consumer)->video.display.height){
- TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
- }
-
- return 0;
+ plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
+
+ if(!consumer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if(!TMEDIA_CONSUMER(consumer)->video.display.width) {
+ TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(consumer)->video.display.height) {
+ TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
+ }
+
+ return 0;
}
static int plugin_video_dshow_consumer_start(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(consumer->started){
- return 0;
- }
-
- // create display on UI thread
- if(!consumer->display){
- if (consumer->create_on_ui_thread) createOnUIThead(reinterpret_cast<HWND>((void*)consumer->window), (void**)&consumer->display, true, false);
- else createOnCurrentThead(reinterpret_cast<HWND>((void*)consumer->window), (void**)&consumer->display, true, false);
-
- if(!consumer->display){
- TSK_DEBUG_ERROR("Failed to create display");
- return -2;
- }
- }
-
- // Set parameters
- consumer->display->setPluginFirefox((consumer->plugin_firefox == tsk_true));
- consumer->display->setFps(TMEDIA_CONSUMER(consumer)->video.fps);
- // do not change the display size: see hook()
- // consumer->display->setSize(TMEDIA_CONSUMER(consumer)->video.display.width, TMEDIA_CONSUMER(consumer)->video.display.height);
- if(consumer->window){
- consumer->display->attach(consumer->window);
- }
-
- // Start display
- consumer->display->start();
- consumer->started = tsk_true;
-
- return 0;
+ plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(consumer->started) {
+ return 0;
+ }
+
+ // create display on UI thread
+ if(!consumer->display) {
+ if (consumer->create_on_ui_thread) {
+ createOnUIThead(reinterpret_cast<HWND>((void*)consumer->window), (void**)&consumer->display, true, false);
+ }
+ else {
+ createOnCurrentThead(reinterpret_cast<HWND>((void*)consumer->window), (void**)&consumer->display, true, false);
+ }
+
+ if(!consumer->display) {
+ TSK_DEBUG_ERROR("Failed to create display");
+ return -2;
+ }
+ }
+
+ // Set parameters
+ consumer->display->setPluginFirefox((consumer->plugin_firefox == tsk_true));
+ consumer->display->setFps(TMEDIA_CONSUMER(consumer)->video.fps);
+ // do not change the display size: see hook()
+ // consumer->display->setSize(TMEDIA_CONSUMER(consumer)->video.display.width, TMEDIA_CONSUMER(consumer)->video.display.height);
+ if(consumer->window) {
+ consumer->display->attach(consumer->window);
+ }
+
+ // Start display
+ consumer->display->start();
+ consumer->started = tsk_true;
+
+ return 0;
}
static int plugin_video_dshow_consumer_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
- if(consumer && consumer->display && buffer){
- consumer->display->handleVideoFrame(buffer, TMEDIA_CONSUMER(consumer)->video.display.width, TMEDIA_CONSUMER(consumer)->video.display.height);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
+ if(consumer && consumer->display && buffer) {
+ consumer->display->handleVideoFrame(buffer, TMEDIA_CONSUMER(consumer)->video.display.width, TMEDIA_CONSUMER(consumer)->video.display.height);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
static int plugin_video_dshow_consumer_pause(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!consumer->display){
- TSK_DEBUG_ERROR("Invalid internal grabber");
- return -2;
- }
+ if(!consumer->display) {
+ TSK_DEBUG_ERROR("Invalid internal grabber");
+ return -2;
+ }
- //consumer->display->pause();
+ //consumer->display->pause();
- return 0;
+ return 0;
}
static int plugin_video_dshow_consumer_stop(tmedia_consumer_t* self)
{
- plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
+ plugin_video_dshow_consumer_t* consumer = (plugin_video_dshow_consumer_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!consumer->started){
- return 0;
- }
+ if(!consumer->started) {
+ return 0;
+ }
- if(!consumer->display){
- TSK_DEBUG_ERROR("Invalid internal display");
- return -2;
- }
+ if(!consumer->display) {
+ TSK_DEBUG_ERROR("Invalid internal display");
+ return -2;
+ }
- TSK_DEBUG_INFO("Before stopping DirectShow consumer");
- consumer->display->stop();
- consumer->started = tsk_false;
- TSK_DEBUG_INFO("After stopping DirectShow consumer");
+ TSK_DEBUG_INFO("Before stopping DirectShow consumer");
+ consumer->display->stop();
+ consumer->started = tsk_false;
+ TSK_DEBUG_INFO("After stopping DirectShow consumer");
- return 0;
+ return 0;
}
@@ -1253,65 +1182,63 @@ static int plugin_video_dshow_consumer_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* plugin_video_dshow_consumer_ctor(tsk_object_t * self, va_list * app)
{
- CoInitializeEx(NULL, COINIT_MULTITHREADED);
-
- plugin_video_dshow_consumer_t *consumer = (plugin_video_dshow_consumer_t *)self;
- if(consumer){
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
- TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
-
- /* init self */
- consumer->create_on_ui_thread = tsk_true;
- TMEDIA_CONSUMER(consumer)->video.fps = 15;
- TMEDIA_CONSUMER(consumer)->video.display.width = 352;
- TMEDIA_CONSUMER(consumer)->video.display.height = 288;
- TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
- }
- return self;
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
+ plugin_video_dshow_consumer_t *consumer = (plugin_video_dshow_consumer_t *)self;
+ if(consumer) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
+ TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+
+ /* init self */
+ consumer->create_on_ui_thread = tsk_true;
+ TMEDIA_CONSUMER(consumer)->video.fps = 15;
+ TMEDIA_CONSUMER(consumer)->video.display.width = 352;
+ TMEDIA_CONSUMER(consumer)->video.display.height = 288;
+ TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_video_dshow_consumer_dtor(tsk_object_t * self)
-{
- plugin_video_dshow_consumer_t *consumer = (plugin_video_dshow_consumer_t *)self;
- if(consumer){
-
- /* stop */
- if(consumer->started){
- plugin_video_dshow_consumer_stop((tmedia_consumer_t*)self);
- }
-
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
- /* deinit self */
- SAFE_DELETE_PTR(consumer->display);
-
- }
-
- return self;
+{
+ plugin_video_dshow_consumer_t *consumer = (plugin_video_dshow_consumer_t *)self;
+ if(consumer) {
+
+ /* stop */
+ if(consumer->started) {
+ plugin_video_dshow_consumer_stop((tmedia_consumer_t*)self);
+ }
+
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
+ /* deinit self */
+ SAFE_DELETE_PTR(consumer->display);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_video_dshow_consumer_def_s =
-{
- sizeof(plugin_video_dshow_consumer_t),
- plugin_video_dshow_consumer_ctor,
- plugin_video_dshow_consumer_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_video_dshow_consumer_def_s = {
+ sizeof(plugin_video_dshow_consumer_t),
+ plugin_video_dshow_consumer_ctor,
+ plugin_video_dshow_consumer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_video_dshow_consumer_plugin_def_s =
-{
- &plugin_video_dshow_consumer_def_s,
-
- tmedia_video,
- "Microsoft DirectShow consumer (using custom source)",
-
- plugin_video_dshow_consumer_set,
- plugin_video_dshow_consumer_prepare,
- plugin_video_dshow_consumer_start,
- plugin_video_dshow_consumer_consume,
- plugin_video_dshow_consumer_pause,
- plugin_video_dshow_consumer_stop
+static const tmedia_consumer_plugin_def_t plugin_video_dshow_consumer_plugin_def_s = {
+ &plugin_video_dshow_consumer_def_s,
+
+ tmedia_video,
+ "Microsoft DirectShow consumer (using custom source)",
+
+ plugin_video_dshow_consumer_set,
+ plugin_video_dshow_consumer_prepare,
+ plugin_video_dshow_consumer_start,
+ plugin_video_dshow_consumer_consume,
+ plugin_video_dshow_consumer_pause,
+ plugin_video_dshow_consumer_stop
};
const tmedia_consumer_plugin_def_t *plugin_video_dshow_consumer_plugin_def_t = &plugin_video_dshow_consumer_plugin_def_s;
diff --git a/plugins/pluginDirectShow/plugin_video_dshow_producer.cxx b/plugins/pluginDirectShow/plugin_video_dshow_producer.cxx
index 61aa929..77f6bfb 100755
--- a/plugins/pluginDirectShow/plugin_video_dshow_producer.cxx
+++ b/plugins/pluginDirectShow/plugin_video_dshow_producer.cxx
@@ -1,17 +1,17 @@
/* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,187 +26,190 @@
#define DSPRODUCER(self) ((plugin_video_dshow_producer_t*)(self))
-typedef struct plugin_video_dshow_producer_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- DSGrabber* grabber;
- INT64 previewHwnd;
-
- tsk_bool_t plugin_firefox;
- tsk_bool_t started;
- tsk_bool_t mute;
- tsk_bool_t create_on_ui_thread;
+typedef struct plugin_video_dshow_producer_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ DSGrabber* grabber;
+ INT64 previewHwnd;
+
+ tsk_bool_t plugin_firefox;
+ tsk_bool_t started;
+ tsk_bool_t mute;
+ tsk_bool_t create_on_ui_thread;
}
plugin_video_dshow_producer_t;
// Producer callback (From DirectShow Grabber to our plugin)
static int plugin_video_dshow_plugin_cb(const void* callback_data, const void* buffer, tsk_size_t size)
{
- const plugin_video_dshow_producer_t* producer = (const plugin_video_dshow_producer_t*)callback_data;
+ const plugin_video_dshow_producer_t* producer = (const plugin_video_dshow_producer_t*)callback_data;
- if(producer && TMEDIA_PRODUCER(producer)->enc_cb.callback){
- TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer, size);
- }
+ if(producer && TMEDIA_PRODUCER(producer)->enc_cb.callback) {
+ TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer, size);
+ }
- return 0;
+ return 0;
}
/* ============ Media Producer Interface ================= */
static int plugin_video_dshow_producer_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
-
- if(!producer || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int64){
- if(tsk_striequals(param->key, "local-hwnd")){
- DSPRODUCER(producer)->previewHwnd = (INT64)*((int64_t*)param->value);
- if(DSPRODUCER(producer)->grabber && DSPRODUCER(self)->grabber->preview){
- DSPRODUCER(producer)->grabber->preview->attach(DSPRODUCER(producer)->previewHwnd);
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "mute")){
- producer->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- if(producer->started){
- if (producer->mute) {
- producer->grabber->pause();
- }
- else{
- producer->grabber->start();
- }
- }
- }
- else if(tsk_striequals(param->key, "create-on-current-thead")){
- producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox")){
- producer->plugin_firefox = (*((int32_t*)param->value) != 0);
- if(producer->grabber){
- producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
- }
- }
- }
-
- return ret;
+ int ret = 0;
+ plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
+
+ if(!producer || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "local-hwnd")) {
+ DSPRODUCER(producer)->previewHwnd = (INT64)*((int64_t*)param->value);
+ if(DSPRODUCER(producer)->grabber && DSPRODUCER(self)->grabber->preview) {
+ DSPRODUCER(producer)->grabber->preview->attach(DSPRODUCER(producer)->previewHwnd);
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "mute")) {
+ producer->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ if(producer->started) {
+ if (producer->mute) {
+ producer->grabber->pause();
+ }
+ else {
+ producer->grabber->start();
+ }
+ }
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ producer->plugin_firefox = (*((int32_t*)param->value) != 0);
+ if(producer->grabber) {
+ producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
+ }
+ }
+ }
+
+ return ret;
}
static int plugin_video_dshow_producer_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
-
- if(!producer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
-
- return 0;
+ plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
+
+ if(!producer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+
+ return 0;
}
static int plugin_video_dshow_producer_start(tmedia_producer_t* self)
{
- plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (producer->started) {
- return 0;
- }
-
- // create grabber on UI thread
- if (!producer->grabber) {
- static BOOL __isDisplayFalse = FALSE;
- static BOOL __isScreenCastFalse = FALSE;
- if(producer->create_on_ui_thread) createOnUIThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastFalse);
- else createOnCurrentThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastFalse);
- if (!producer->grabber) {
- TSK_DEBUG_ERROR("Failed to create grabber");
- return -2;
- }
- }
- producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
-
- //set Source device
- producer->grabber->setCaptureDevice("Null");
-
- // set parameters
- producer->grabber->setCaptureParameters((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height, TMEDIA_PRODUCER(producer)->video.fps);
-
- // set callback function
- producer->grabber->setCallback(plugin_video_dshow_plugin_cb, producer);
-
- // attach preview
- if(producer->grabber->preview){
- if(producer->previewHwnd){
- producer->grabber->preview->attach(producer->previewHwnd);
- }
- producer->grabber->preview->setSize((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height);
- }
-
- // start grabber
- if(!producer->mute){
- producer->grabber->start();
- }
- producer->started = tsk_true;
-
- return 0;
+ plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (producer->started) {
+ return 0;
+ }
+
+ // create grabber on UI thread
+ if (!producer->grabber) {
+ static BOOL __isDisplayFalse = FALSE;
+ static BOOL __isScreenCastFalse = FALSE;
+ if(producer->create_on_ui_thread) {
+ createOnUIThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastFalse);
+ }
+ else {
+ createOnCurrentThead(reinterpret_cast<HWND>((void*)DSPRODUCER(producer)->previewHwnd), (void**)&producer->grabber, __isDisplayFalse, __isScreenCastFalse);
+ }
+ if (!producer->grabber) {
+ TSK_DEBUG_ERROR("Failed to create grabber");
+ return -2;
+ }
+ }
+ producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
+
+ //set Source device
+ producer->grabber->setCaptureDevice("Null");
+
+ // set parameters
+ producer->grabber->setCaptureParameters((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height, TMEDIA_PRODUCER(producer)->video.fps);
+
+ // set callback function
+ producer->grabber->setCallback(plugin_video_dshow_plugin_cb, producer);
+
+ // attach preview
+ if(producer->grabber->preview) {
+ if(producer->previewHwnd) {
+ producer->grabber->preview->attach(producer->previewHwnd);
+ }
+ producer->grabber->preview->setSize((int)TMEDIA_PRODUCER(producer)->video.width, (int)TMEDIA_PRODUCER(producer)->video.height);
+ }
+
+ // start grabber
+ if(!producer->mute) {
+ producer->grabber->start();
+ }
+ producer->started = tsk_true;
+
+ return 0;
}
static int plugin_video_dshow_producer_pause(tmedia_producer_t* self)
{
- plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
+ plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!producer->grabber){
- TSK_DEBUG_ERROR("Invalid internal grabber");
- return -2;
- }
+ if(!producer->grabber) {
+ TSK_DEBUG_ERROR("Invalid internal grabber");
+ return -2;
+ }
- producer->grabber->pause();
+ producer->grabber->pause();
- return 0;
+ return 0;
}
static int plugin_video_dshow_producer_stop(tmedia_producer_t* self)
{
- plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
+ plugin_video_dshow_producer_t* producer = (plugin_video_dshow_producer_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!producer->started){
- return 0;
- }
+ if(!producer->started) {
+ return 0;
+ }
- if(!producer->grabber){
- TSK_DEBUG_ERROR("Invalid internal grabber");
- return -2;
- }
+ if(!producer->grabber) {
+ TSK_DEBUG_ERROR("Invalid internal grabber");
+ return -2;
+ }
- producer->grabber->stop();
- producer->started = tsk_false;
+ producer->grabber->stop();
+ producer->started = tsk_false;
- return 0;
+ return 0;
}
@@ -215,62 +218,61 @@ static int plugin_video_dshow_producer_stop(tmedia_producer_t* self)
//
/* constructor */
static tsk_object_t* plugin_video_dshow_producer_ctor(tsk_object_t * self, va_list * app)
-{ plugin_video_dshow_producer_t *producer = (plugin_video_dshow_producer_t *)self;
- if (producer) {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(producer));
- TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
- /* init self with default values*/
- producer->create_on_ui_thread = tsk_true;
- TMEDIA_PRODUCER(producer)->video.fps = 15;
- TMEDIA_PRODUCER(producer)->video.width = 352;
- TMEDIA_PRODUCER(producer)->video.height = 288;
- }
- return self;
+{
+ plugin_video_dshow_producer_t *producer = (plugin_video_dshow_producer_t *)self;
+ if (producer) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(producer));
+ TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+ /* init self with default values*/
+ producer->create_on_ui_thread = tsk_true;
+ TMEDIA_PRODUCER(producer)->video.fps = 15;
+ TMEDIA_PRODUCER(producer)->video.width = 352;
+ TMEDIA_PRODUCER(producer)->video.height = 288;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_video_dshow_producer_dtor(tsk_object_t * self)
-{
- plugin_video_dshow_producer_t *producer = (plugin_video_dshow_producer_t *)self;
- if(producer){
- /* stop */
- if(producer->started){
- plugin_video_dshow_producer_stop((tmedia_producer_t*)self);
- }
-
- /* for safety */
- if(producer->grabber){
- producer->grabber->setCallback(tsk_null, tsk_null);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
- /* deinit self */
- SAFE_DELETE_PTR(producer->grabber);
- }
-
- return self;
+{
+ plugin_video_dshow_producer_t *producer = (plugin_video_dshow_producer_t *)self;
+ if(producer) {
+ /* stop */
+ if(producer->started) {
+ plugin_video_dshow_producer_stop((tmedia_producer_t*)self);
+ }
+
+ /* for safety */
+ if(producer->grabber) {
+ producer->grabber->setCallback(tsk_null, tsk_null);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
+ /* deinit self */
+ SAFE_DELETE_PTR(producer->grabber);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_video_dshow_producer_def_s =
-{
- sizeof(plugin_video_dshow_producer_t),
- plugin_video_dshow_producer_ctor,
- plugin_video_dshow_producer_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_video_dshow_producer_def_s = {
+ sizeof(plugin_video_dshow_producer_t),
+ plugin_video_dshow_producer_ctor,
+ plugin_video_dshow_producer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_video_dshow_producer_plugin_def_s =
-{
- &plugin_video_dshow_producer_def_s,
-
- tmedia_video,
- "Microsoft DirectShow producer",
-
- plugin_video_dshow_producer_set,
- plugin_video_dshow_producer_prepare,
- plugin_video_dshow_producer_start,
- plugin_video_dshow_producer_pause,
- plugin_video_dshow_producer_stop
+static const tmedia_producer_plugin_def_t plugin_video_dshow_producer_plugin_def_s = {
+ &plugin_video_dshow_producer_def_s,
+
+ tmedia_video,
+ "Microsoft DirectShow producer",
+
+ plugin_video_dshow_producer_set,
+ plugin_video_dshow_producer_prepare,
+ plugin_video_dshow_producer_start,
+ plugin_video_dshow_producer_pause,
+ plugin_video_dshow_producer_stop
};
const tmedia_producer_plugin_def_t *plugin_video_dshow_producer_plugin_def_t = &plugin_video_dshow_producer_plugin_def_s;
diff --git a/plugins/pluginWASAPI/dllmain_wasapi.cxx b/plugins/pluginWASAPI/dllmain_wasapi.cxx
index ff13977..1ba8313 100755
--- a/plugins/pluginWASAPI/dllmain_wasapi.cxx
+++ b/plugins/pluginWASAPI/dllmain_wasapi.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -48,87 +48,80 @@ PLUGIN_WASAPI_END_DECLS /* END */
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
-typedef enum PLUGIN_INDEX_E
-{
+typedef enum PLUGIN_INDEX_E {
#if PLUGIN_WASAPI_ENABLE
- PLUGIN_INDEX_CONSUMER,
- PLUGIN_INDEX_PRODUCER,
+ PLUGIN_INDEX_CONSUMER,
+ PLUGIN_INDEX_PRODUCER,
#endif
-
- PLUGIN_INDEX_COUNT
+
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
#if PLUGIN_WASAPI_ENABLE
- switch(index){
- case PLUGIN_INDEX_CONSUMER:
- {
- return tsk_plugin_def_type_consumer;
- }
- case PLUGIN_INDEX_PRODUCER:
- {
- return tsk_plugin_def_type_producer;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CONSUMER: {
+ return tsk_plugin_def_type_consumer;
+ }
+ case PLUGIN_INDEX_PRODUCER: {
+ return tsk_plugin_def_type_producer;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
#if PLUGIN_WASAPI_ENABLE
- switch(index){
- case PLUGIN_INDEX_CONSUMER:
- case PLUGIN_INDEX_PRODUCER:
- {
- return tsk_plugin_def_media_type_audio;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CONSUMER:
+ case PLUGIN_INDEX_PRODUCER: {
+ return tsk_plugin_def_media_type_audio;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
#if PLUGIN_WASAPI_ENABLE
- switch(index){
- case PLUGIN_INDEX_CONSUMER:
- {
- return plugin_wasapi_consumer_audio_plugin_def_t;
- }
- case PLUGIN_INDEX_PRODUCER:
- {
- return plugin_wasapi_producer_audio_plugin_def_t;
- }
- }
+ switch(index) {
+ case PLUGIN_INDEX_CONSUMER: {
+ return plugin_wasapi_consumer_audio_plugin_def_t;
+ }
+ case PLUGIN_INDEX_PRODUCER: {
+ return plugin_wasapi_producer_audio_plugin_def_t;
+ }
+ }
#endif
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
}
diff --git a/plugins/pluginWASAPI/plugin_wasapi_config.h b/plugins/pluginWASAPI/plugin_wasapi_config.h
index d5f742f..822c575 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_config.h
+++ b/plugins/pluginWASAPI/plugin_wasapi_config.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -51,12 +51,12 @@
# define PLUGIN_WASAPI_UNDER_X86 1
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define PLUGIN_WASAPI_BEGIN_DECLS extern "C" {
# define PLUGIN_WASAPI_END_DECLS }
#else
-# define PLUGIN_WASAPI_BEGIN_DECLS
+# define PLUGIN_WASAPI_BEGIN_DECLS
# define PLUGIN_WASAPI_END_DECLS
#endif
@@ -72,7 +72,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // PLUGIN_WASAPI_CONFIG_H
diff --git a/plugins/pluginWASAPI/plugin_wasapi_consumer_audio.cxx b/plugins/pluginWASAPI/plugin_wasapi_consumer_audio.cxx
index 97db2eb..74d0383 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_consumer_audio.cxx
+++ b/plugins/pluginWASAPI/plugin_wasapi_consumer_audio.cxx
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -22,7 +22,7 @@
*/
#include "plugin_wasapi_utils.h"
-#include "tinydav/audio/tdav_consumer_audio.h"
+#include "tinydav/audio/tdav_consumer_audio.h"
#include "tsk_thread.h"
#include "tsk_memory.h"
@@ -52,58 +52,55 @@ struct plugin_wasapi_consumer_audio_s;
class AudioRender sealed
{
public:
- AudioRender();
- virtual ~AudioRender();
-
- int Prepare(struct plugin_wasapi_consumer_audio_s* wasapi, const tmedia_codec_t* codec);
- int UnPrepare();
- int Start();
- int Stop();
- int Pause();
- int Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
+ AudioRender();
+ virtual ~AudioRender();
+
+ int Prepare(struct plugin_wasapi_consumer_audio_s* wasapi, const tmedia_codec_t* codec);
+ int UnPrepare();
+ int Start();
+ int Stop();
+ int Pause();
+ int Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
private:
- tsk_size_t Read(void* data, tsk_size_t size);
- static void* TSK_STDCALL AsyncThread(void *pArg);
+ tsk_size_t Read(void* data, tsk_size_t size);
+ static void* TSK_STDCALL AsyncThread(void *pArg);
private:
- tsk_mutex_handle_t* m_hMutex;
- const struct plugin_wasapi_consumer_audio_s* m_pWrappedConsumer; // Must not take ref() otherwise dtor() will be never called (circular reference)
+ tsk_mutex_handle_t* m_hMutex;
+ const struct plugin_wasapi_consumer_audio_s* m_pWrappedConsumer; // Must not take ref() otherwise dtor() will be never called (circular reference)
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- IAudioClient2* m_pDevice;
+ IAudioClient2* m_pDevice;
#else
- IAudioClient* m_pDevice;
+ IAudioClient* m_pDevice;
#endif
- IAudioRenderClient* m_pClient;
- tsk_condwait_handle_t* m_hCondWait;
- tsk_thread_handle_t* m_ppTread[1];
- INT32 m_nBytesPerNotif;
- INT32 m_nSourceFrameSizeInBytes;
- UINT32 m_nMaxFrameCount;
- UINT32 m_nPtime;
- UINT32 m_nChannels;
-
- struct
- {
- struct
- {
- void* buffer;
- tsk_size_t size;
- } chunck;
- tsk_ssize_t leftBytes;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } m_ring;
-
- bool m_bStarted;
- bool m_bPrepared;
- bool m_bPaused;
+ IAudioRenderClient* m_pClient;
+ tsk_condwait_handle_t* m_hCondWait;
+ tsk_thread_handle_t* m_ppTread[1];
+ INT32 m_nBytesPerNotif;
+ INT32 m_nSourceFrameSizeInBytes;
+ UINT32 m_nMaxFrameCount;
+ UINT32 m_nPtime;
+ UINT32 m_nChannels;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ tsk_ssize_t leftBytes;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } m_ring;
+
+ bool m_bStarted;
+ bool m_bPrepared;
+ bool m_bPaused;
};
-typedef struct plugin_wasapi_consumer_audio_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct plugin_wasapi_consumer_audio_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- AudioRender* pAudioRender;
+ AudioRender* pAudioRender;
}
plugin_wasapi_consumer_audio_t;
@@ -111,88 +108,83 @@ plugin_wasapi_consumer_audio_t;
/* ============ Media consumer Interface ================= */
static int plugin_wasapi_consumer_audio_set(tmedia_consumer_t* self, const tmedia_param_t* param)
-{
- return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+{
+ return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
static int plugin_wasapi_consumer_audio_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
-
- if(!wasapi || !codec || !wasapi->pAudioRender)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_CONSUMER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(wasapi)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(wasapi)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- TSK_DEBUG_INFO("WASAPI consumer: in.channels=%d, out.channles=%d, in.rate=%d, out.rate=%d, ptime=%d",
- TMEDIA_CONSUMER(wasapi)->audio.in.channels,
- TMEDIA_CONSUMER(wasapi)->audio.out.channels,
- TMEDIA_CONSUMER(wasapi)->audio.in.rate,
- TMEDIA_CONSUMER(wasapi)->audio.out.rate,
- TMEDIA_CONSUMER(wasapi)->audio.ptime);
-
- return wasapi->pAudioRender->Prepare(wasapi, codec);
+ plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
+
+ if(!wasapi || !codec || !wasapi->pAudioRender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_CONSUMER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(wasapi)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(wasapi)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ TSK_DEBUG_INFO("WASAPI consumer: in.channels=%d, out.channles=%d, in.rate=%d, out.rate=%d, ptime=%d",
+ TMEDIA_CONSUMER(wasapi)->audio.in.channels,
+ TMEDIA_CONSUMER(wasapi)->audio.out.channels,
+ TMEDIA_CONSUMER(wasapi)->audio.in.rate,
+ TMEDIA_CONSUMER(wasapi)->audio.out.rate,
+ TMEDIA_CONSUMER(wasapi)->audio.ptime);
+
+ return wasapi->pAudioRender->Prepare(wasapi, codec);
}
static int plugin_wasapi_consumer_audio_start(tmedia_consumer_t* self)
{
- plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
- TSK_DEBUG_INFO("plugin_wasapi_consumer_audio_start()");
+ TSK_DEBUG_INFO("plugin_wasapi_consumer_audio_start()");
- if(!wasapi || !wasapi->pAudioRender)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioRender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioRender->Start();
+ return wasapi->pAudioRender->Start();
}
static int plugin_wasapi_consumer_audio_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
-{
- plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
- if(!wasapi || !wasapi->pAudioRender || !buffer || !size)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- return wasapi->pAudioRender->Consume(buffer, size, proto_hdr);
+{
+ plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ if(!wasapi || !wasapi->pAudioRender || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ return wasapi->pAudioRender->Consume(buffer, size, proto_hdr);
}
static int plugin_wasapi_consumer_audio_pause(tmedia_consumer_t* self)
{
- plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
- if(!wasapi || !wasapi->pAudioRender)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioRender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioRender->Pause();
+ return wasapi->pAudioRender->Pause();
}
static int plugin_wasapi_consumer_audio_stop(tmedia_consumer_t* self)
{
- plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ plugin_wasapi_consumer_audio_t* wasapi = (plugin_wasapi_consumer_audio_t*)self;
- TSK_DEBUG_INFO("plugin_wasapi_consumer_audio_stop()");
+ TSK_DEBUG_INFO("plugin_wasapi_consumer_audio_stop()");
- if(!wasapi || !wasapi->pAudioRender)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioRender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioRender->Stop();
+ return wasapi->pAudioRender->Stop();
}
@@ -202,425 +194,386 @@ static int plugin_wasapi_consumer_audio_stop(tmedia_consumer_t* self)
AudioRender::AudioRender()
-: m_pDevice(NULL)
-, m_hMutex(NULL)
-, m_pClient(NULL)
-, m_hCondWait(NULL)
-, m_pWrappedConsumer(NULL)
-, m_nBytesPerNotif(0)
-, m_nSourceFrameSizeInBytes(0)
-, m_nMaxFrameCount(0)
-, m_nPtime(0)
-, m_nChannels(1)
-, m_bStarted(false)
-, m_bPrepared(false)
-, m_bPaused(false)
+ : m_pDevice(NULL)
+ , m_hMutex(NULL)
+ , m_pClient(NULL)
+ , m_hCondWait(NULL)
+ , m_pWrappedConsumer(NULL)
+ , m_nBytesPerNotif(0)
+ , m_nSourceFrameSizeInBytes(0)
+ , m_nMaxFrameCount(0)
+ , m_nPtime(0)
+ , m_nChannels(1)
+ , m_bStarted(false)
+ , m_bPrepared(false)
+ , m_bPaused(false)
{
- m_ppTread[0] = NULL;
- memset(&m_ring, 0, sizeof(m_ring));
+ m_ppTread[0] = NULL;
+ memset(&m_ring, 0, sizeof(m_ring));
- if(!(m_hMutex = tsk_mutex_create()))
- {
- TSK_DEBUG_ERROR("Failed to create mutex");
- }
+ if(!(m_hMutex = tsk_mutex_create())) {
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ }
}
AudioRender::~AudioRender()
{
- Stop();
- UnPrepare();
+ Stop();
+ UnPrepare();
- tsk_mutex_destroy(&m_hMutex);
+ tsk_mutex_destroy(&m_hMutex);
}
int AudioRender::Prepare(plugin_wasapi_consumer_audio_t* wasapi, const tmedia_codec_t* codec)
{
- HRESULT hr = E_FAIL;
- int ret = 0;
- WAVEFORMATEX wfx = {0};
+ HRESULT hr = E_FAIL;
+ int ret = 0;
+ WAVEFORMATEX wfx = {0};
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- AudioClientProperties properties = {0};
+ AudioClientProperties properties = {0};
#endif
- LPCWSTR pwstrRenderId = NULL;
- IMMDeviceEnumerator *pEnumerator = NULL;
- IMMDevice *pDevice = NULL;
-
- tsk_mutex_lock(m_hMutex);
-
- if(m_bPrepared)
- {
- TSK_DEBUG_INFO("#WASAPI: Audio consumer already prepared");
- goto bail;
- }
-
- if(!wasapi || !codec)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(m_pDevice || m_pClient)
- {
- TSK_DEBUG_ERROR("consumer already prepared");
- CHECK_HR(hr = E_FAIL);
- }
+ LPCWSTR pwstrRenderId = NULL;
+ IMMDeviceEnumerator *pEnumerator = NULL;
+ IMMDevice *pDevice = NULL;
+
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bPrepared) {
+ TSK_DEBUG_INFO("#WASAPI: Audio consumer already prepared");
+ goto bail;
+ }
+
+ if(!wasapi || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(m_pDevice || m_pClient) {
+ TSK_DEBUG_ERROR("consumer already prepared");
+ CHECK_HR(hr = E_FAIL);
+ }
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- pwstrRenderId = GetDefaultAudioRenderId(AudioDeviceRole::Communications);
+ pwstrRenderId = GetDefaultAudioRenderId(AudioDeviceRole::Communications);
- if (NULL == pwstrRenderId)
- {
- PLUGIN_WASAPI_ERROR("GetDefaultAudioRenderId", HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
+ if (NULL == pwstrRenderId) {
+ PLUGIN_WASAPI_ERROR("GetDefaultAudioRenderId", HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
- CHECK_HR(hr = ActivateAudioInterface(pwstrRenderId, __uuidof(IAudioClient2), (void**)&m_pDevice));
+ CHECK_HR(hr = ActivateAudioInterface(pwstrRenderId, __uuidof(IAudioClient2), (void**)&m_pDevice));
- // Win8 or WP8 only
- properties.cbSize = sizeof AudioClientProperties;
- properties.eCategory = AudioCategory_Communications;
- CHECK_HR(hr = m_pDevice->SetClientProperties(&properties));
+ // Win8 or WP8 only
+ properties.cbSize = sizeof AudioClientProperties;
+ properties.eCategory = AudioCategory_Communications;
+ CHECK_HR(hr = m_pDevice->SetClientProperties(&properties));
#else
- CHECK_HR(hr = CoCreateInstance(
- CLSID_MMDeviceEnumerator, NULL,
- CLSCTX_ALL, IID_IMMDeviceEnumerator,
- (void**)&pEnumerator));
+ CHECK_HR(hr = CoCreateInstance(
+ CLSID_MMDeviceEnumerator, NULL,
+ CLSCTX_ALL, IID_IMMDeviceEnumerator,
+ (void**)&pEnumerator));
CHECK_HR(hr = pEnumerator->GetDefaultAudioEndpoint(
- eRender, eCommunications, &pDevice));
+ eRender, eCommunications, &pDevice));
CHECK_HR(hr = pDevice->Activate(
- IID_IAudioClient, CLSCTX_ALL,
- NULL, (void**)&m_pDevice));
+ IID_IAudioClient, CLSCTX_ALL,
+ NULL, (void**)&m_pDevice));
#endif
-
-
-
-
- /* Set best format */
- {
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_CONSUMER(wasapi)->audio.in.channels;
- wfx.nSamplesPerSec = TMEDIA_CONSUMER(wasapi)->audio.in.rate;
- wfx.wBitsPerSample = TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- PWAVEFORMATEX pwfxClosestMatch = NULL;
- hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
- if(hr != S_OK && hr != S_FALSE)
- {
- PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
-
- if(hr == S_FALSE)
- {
- if(!pwfxClosestMatch)
- {
- TSK_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
-
- wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
- wfx.nChannels = pwfxClosestMatch->nChannels;
+
+
+
+
+ /* Set best format */
+ {
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_CONSUMER(wasapi)->audio.in.channels;
+ wfx.nSamplesPerSec = TMEDIA_CONSUMER(wasapi)->audio.in.rate;
+ wfx.wBitsPerSample = TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ PWAVEFORMATEX pwfxClosestMatch = NULL;
+ hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
+ if(hr != S_OK && hr != S_FALSE) {
+ PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(hr == S_FALSE) {
+ if(!pwfxClosestMatch) {
+ TSK_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+
+ wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
+ wfx.nChannels = pwfxClosestMatch->nChannels;
#if 0
- wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
+ wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
- wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
- wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
- // Request resampler
- TMEDIA_CONSUMER(wasapi)->audio.out.rate = (uint32_t)wfx.nSamplesPerSec;
- TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
- TMEDIA_CONSUMER(wasapi)->audio.out.channels = (uint8_t)wfx.nChannels;
-
- TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
- }
- if(pwfxClosestMatch)
- {
- CoTaskMemFree(pwfxClosestMatch);
- }
- }
-
- m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
- m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(wasapi)->audio.ptime)/1000) * wfx.nChannels;
-
- // Initialize
- CHECK_HR(hr = m_pDevice->Initialize(
- AUDCLNT_SHAREMODE_SHARED,
- 0x00000000,
- (PLUGIN_WASAPI_CONSUMER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_CONSUMER(wasapi)->audio.ptime)) ,
- 0,
- &wfx,
- NULL));
-
- REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
- CHECK_HR(hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod));
-
- CHECK_HR(hr = m_pDevice->GetBufferSize(&m_nMaxFrameCount));
- TSK_DEBUG_INFO("#WASAPI (Playback): BufferSize=%u, DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", m_nMaxFrameCount, WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
-
- if(!m_hCondWait)
- {
- if(!(m_hCondWait = tsk_condwait_create()))
- {
- PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
- }
-
- CHECK_HR(hr = m_pDevice->GetService(__uuidof(IAudioRenderClient), (void**)&m_pClient));
-
- int packetperbuffer = (1000 / TMEDIA_CONSUMER(wasapi)->audio.ptime);
- m_ring.chunck.size = (wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer) * wfx.nChannels;
- m_ring.size = PLUGIN_WASAPI_CONSUMER_NOTIF_POS_COUNT * m_ring.chunck.size;
- if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size)))
- {
- m_ring.size = 0;
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- if(!m_ring.buffer)
- {
- m_ring.buffer = speex_buffer_init(m_ring.size);
- }
- else
- {
- int sret;
- if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0)
- {
- TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- }
- if(!m_ring.buffer)
- {
- TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
+ wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
+ wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
+ // Request resampler
+ TMEDIA_CONSUMER(wasapi)->audio.out.rate = (uint32_t)wfx.nSamplesPerSec;
+ TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
+ TMEDIA_CONSUMER(wasapi)->audio.out.channels = (uint8_t)wfx.nChannels;
+
+ TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
+ }
+ if(pwfxClosestMatch) {
+ CoTaskMemFree(pwfxClosestMatch);
+ }
+ }
+
+ m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
+ m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(wasapi)->audio.ptime)/1000) * wfx.nChannels;
+
+ // Initialize
+ CHECK_HR(hr = m_pDevice->Initialize(
+ AUDCLNT_SHAREMODE_SHARED,
+ 0x00000000,
+ (PLUGIN_WASAPI_CONSUMER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_CONSUMER(wasapi)->audio.ptime)) ,
+ 0,
+ &wfx,
+ NULL));
+
+ REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
+ CHECK_HR(hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod));
+
+ CHECK_HR(hr = m_pDevice->GetBufferSize(&m_nMaxFrameCount));
+ TSK_DEBUG_INFO("#WASAPI (Playback): BufferSize=%u, DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", m_nMaxFrameCount, WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
+
+ if(!m_hCondWait) {
+ if(!(m_hCondWait = tsk_condwait_create())) {
+ PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
+ }
+
+ CHECK_HR(hr = m_pDevice->GetService(__uuidof(IAudioRenderClient), (void**)&m_pClient));
+
+ int packetperbuffer = (1000 / TMEDIA_CONSUMER(wasapi)->audio.ptime);
+ m_ring.chunck.size = (wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer) * wfx.nChannels;
+ m_ring.size = PLUGIN_WASAPI_CONSUMER_NOTIF_POS_COUNT * m_ring.chunck.size;
+ if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))) {
+ m_ring.size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ if(!m_ring.buffer) {
+ m_ring.buffer = speex_buffer_init(m_ring.size);
+ }
+ else {
+ int sret;
+ if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0) {
+ TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ }
+ if(!m_ring.buffer) {
+ TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
bail:
- ret = SUCCEEDED(hr) ? 0 : -1;
- if (pwstrRenderId)
- {
- CoTaskMemFree((LPVOID)pwstrRenderId);
- }
- if(ret != 0)
- {
- UnPrepare();
- }
-
- if((m_bPrepared = (ret == 0)))
- {
- m_pWrappedConsumer = wasapi;
- m_nPtime = TMEDIA_CONSUMER(wasapi)->audio.ptime;
- m_nChannels = TMEDIA_CONSUMER(wasapi)->audio.out.channels;
- }
-
- tsk_mutex_unlock(m_hMutex);
-
- SafeRelease(&pEnumerator);
- SafeRelease(&pDevice);
-
- return ret;
+ ret = SUCCEEDED(hr) ? 0 : -1;
+ if (pwstrRenderId) {
+ CoTaskMemFree((LPVOID)pwstrRenderId);
+ }
+ if(ret != 0) {
+ UnPrepare();
+ }
+
+ if((m_bPrepared = (ret == 0))) {
+ m_pWrappedConsumer = wasapi;
+ m_nPtime = TMEDIA_CONSUMER(wasapi)->audio.ptime;
+ m_nChannels = TMEDIA_CONSUMER(wasapi)->audio.out.channels;
+ }
+
+ tsk_mutex_unlock(m_hMutex);
+
+ SafeRelease(&pEnumerator);
+ SafeRelease(&pDevice);
+
+ return ret;
}
int AudioRender::UnPrepare()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_hCondWait)
- {
- tsk_condwait_destroy(&m_hCondWait);
- }
- if(m_pDevice)
- {
- m_pDevice->Release(), m_pDevice = NULL;
- }
- if(m_pClient)
- {
- m_pClient->Release(), m_pClient = NULL;
- }
-
- TSK_FREE(m_ring.chunck.buffer);
- if(m_ring.buffer)
- {
- speex_buffer_destroy(m_ring.buffer);
- m_ring.buffer = NULL;
- }
-
- m_pWrappedConsumer = NULL;
-
- m_bPrepared = false;
-
- tsk_mutex_unlock(m_hMutex);
-
- return 0;
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_hCondWait) {
+ tsk_condwait_destroy(&m_hCondWait);
+ }
+ if(m_pDevice) {
+ m_pDevice->Release(), m_pDevice = NULL;
+ }
+ if(m_pClient) {
+ m_pClient->Release(), m_pClient = NULL;
+ }
+
+ TSK_FREE(m_ring.chunck.buffer);
+ if(m_ring.buffer) {
+ speex_buffer_destroy(m_ring.buffer);
+ m_ring.buffer = NULL;
+ }
+
+ m_pWrappedConsumer = NULL;
+
+ m_bPrepared = false;
+
+ tsk_mutex_unlock(m_hMutex);
+
+ return 0;
}
int AudioRender::Start()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_bStarted)
- {
- TSK_DEBUG_INFO("#WASAPI: Audio consumer already started");
- goto bail;
- }
- if(!m_bPrepared)
- {
- TSK_DEBUG_ERROR("Audio consumer not prepared");
- goto bail;
- }
-
- m_bStarted = true;
- if(!m_ppTread[0] && tsk_thread_create(m_ppTread, AudioRender::AsyncThread, this) != 0)
- {
- m_bStarted = false;
- goto bail;
- }
-
- HRESULT hr = m_pDevice->Start();
- if(!SUCCEEDED(hr))
- {
- PLUGIN_WASAPI_ERROR(hr);
- Stop();
- }
- m_bPaused = false;
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bStarted) {
+ TSK_DEBUG_INFO("#WASAPI: Audio consumer already started");
+ goto bail;
+ }
+ if(!m_bPrepared) {
+ TSK_DEBUG_ERROR("Audio consumer not prepared");
+ goto bail;
+ }
+
+ m_bStarted = true;
+ if(!m_ppTread[0] && tsk_thread_create(m_ppTread, AudioRender::AsyncThread, this) != 0) {
+ m_bStarted = false;
+ goto bail;
+ }
+
+ HRESULT hr = m_pDevice->Start();
+ if(!SUCCEEDED(hr)) {
+ PLUGIN_WASAPI_ERROR(hr);
+ Stop();
+ }
+ m_bPaused = false;
bail:
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return (m_bStarted ? 0 : -2);
+ return (m_bStarted ? 0 : -2);
}
int AudioRender::Stop()
{
- m_bStarted = false;
+ m_bStarted = false;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_hCondWait)
- {
- tsk_condwait_broadcast(m_hCondWait);
- }
+ if (m_hCondWait) {
+ tsk_condwait_broadcast(m_hCondWait);
+ }
- if (m_ppTread[0])
- {
- tsk_thread_join(m_ppTread);
- }
+ if (m_ppTread[0]) {
+ tsk_thread_join(m_ppTread);
+ }
- if(m_pDevice)
- {
- m_pDevice->Stop();
- }
+ if(m_pDevice) {
+ m_pDevice->Stop();
+ }
- // will be prepared again before next start()
- UnPrepare();
+ // will be prepared again before next start()
+ UnPrepare();
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int AudioRender::Pause()
{
- m_bPaused = true;
+ m_bPaused = true;
- return 0;
+ return 0;
}
int AudioRender::Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), buffer, size, proto_hdr);
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), buffer, size, proto_hdr);
}
tsk_size_t AudioRender::Read(void* data, tsk_size_t size)
{
- tsk_ssize_t retSize = 0;
-
- m_ring.leftBytes += size;
- while (m_ring.leftBytes >= (tsk_ssize_t)m_ring.chunck.size)
- {
- m_ring.leftBytes -= m_ring.chunck.size;
- retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), m_ring.chunck.buffer, m_ring.chunck.size);
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer));
- speex_buffer_write(m_ring.buffer, m_ring.chunck.buffer, retSize);
- }
- // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
- // many times can corrupt the buffer. At least on OS X 1.5
- int avail = speex_buffer_get_available(m_ring.buffer);
- //if(speex_buffer_get_available(m_ring.buffer) >= (tsk_ssize_t)size)
- //{
- retSize = speex_buffer_read(m_ring.buffer, data, TSK_MIN((int)size,avail));
- //}
- //else
- //{
- //memset(data, 0, size);
- //}
-
- return retSize;
+ tsk_ssize_t retSize = 0;
+
+ m_ring.leftBytes += size;
+ while (m_ring.leftBytes >= (tsk_ssize_t)m_ring.chunck.size) {
+ m_ring.leftBytes -= m_ring.chunck.size;
+ retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), m_ring.chunck.buffer, m_ring.chunck.size);
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer));
+ speex_buffer_write(m_ring.buffer, m_ring.chunck.buffer, retSize);
+ }
+ // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
+ // many times can corrupt the buffer. At least on OS X 1.5
+ int avail = speex_buffer_get_available(m_ring.buffer);
+ //if(speex_buffer_get_available(m_ring.buffer) >= (tsk_ssize_t)size)
+ //{
+ retSize = speex_buffer_read(m_ring.buffer, data, TSK_MIN((int)size,avail));
+ //}
+ //else
+ //{
+ //memset(data, 0, size);
+ //}
+
+ return retSize;
}
void* TSK_STDCALL AudioRender::AsyncThread(void *pArg)
{
- HRESULT hr = S_OK;
- INT32 nFramesToWrite;
- UINT32 nPadding, nRead;
- int waitResult = 0;
- AudioRender* This = (AudioRender*)pArg;
+ HRESULT hr = S_OK;
+ INT32 nFramesToWrite;
+ UINT32 nPadding, nRead;
+ int waitResult = 0;
+ AudioRender* This = (AudioRender*)pArg;
- TSK_DEBUG_INFO("#WASAPI: __playback_thread -- START");
+ TSK_DEBUG_INFO("#WASAPI: __playback_thread -- START");
#define BREAK_WHILE tsk_mutex_unlock(This->m_hMutex); break;
- while(This->m_bStarted && SUCCEEDED(hr))
- {
- waitResult = tsk_condwait_timedwait(This->m_hCondWait, This->m_nPtime);
-
- tsk_mutex_lock(This->m_hMutex);
-
- if(!This->m_bStarted)
- {
- BREAK_WHILE;
- }
-
- if(waitResult == 0)
- {
- hr = This->m_pDevice->GetCurrentPadding(&nPadding);
- if (SUCCEEDED(hr))
- {
- BYTE* pRenderBuffer = NULL;
- nFramesToWrite = This->m_nMaxFrameCount - nPadding;
-
- if (nFramesToWrite > 0)
- {
- hr = This->m_pClient->GetBuffer(nFramesToWrite, &pRenderBuffer);
- if (SUCCEEDED(hr))
- {
- nRead = This->Read(pRenderBuffer, (nFramesToWrite * This->m_nSourceFrameSizeInBytes));
-
- // Release the buffer
- hr = This->m_pClient->ReleaseBuffer((nRead / This->m_nSourceFrameSizeInBytes), (nRead == 0) ? AUDCLNT_BUFFERFLAGS_SILENT: 0);
- }
- }
- }
- }
- else
- {
- BREAK_WHILE;
- }
-
- tsk_mutex_lock(This->m_hMutex);
- }// end-of-while
-
- if (!SUCCEEDED(hr))
- {
- PLUGIN_WASAPI_ERROR(hr);
- }
-
- TSK_DEBUG_INFO("WASAPI: __playback_thread(%s) -- STOP", (SUCCEEDED(hr) && waitResult == 0) ? "OK": "NOK");
-
- return NULL;
+ while(This->m_bStarted && SUCCEEDED(hr)) {
+ waitResult = tsk_condwait_timedwait(This->m_hCondWait, This->m_nPtime);
+
+ tsk_mutex_lock(This->m_hMutex);
+
+ if(!This->m_bStarted) {
+ BREAK_WHILE;
+ }
+
+ if(waitResult == 0) {
+ hr = This->m_pDevice->GetCurrentPadding(&nPadding);
+ if (SUCCEEDED(hr)) {
+ BYTE* pRenderBuffer = NULL;
+ nFramesToWrite = This->m_nMaxFrameCount - nPadding;
+
+ if (nFramesToWrite > 0) {
+ hr = This->m_pClient->GetBuffer(nFramesToWrite, &pRenderBuffer);
+ if (SUCCEEDED(hr)) {
+ nRead = This->Read(pRenderBuffer, (nFramesToWrite * This->m_nSourceFrameSizeInBytes));
+
+ // Release the buffer
+ hr = This->m_pClient->ReleaseBuffer((nRead / This->m_nSourceFrameSizeInBytes), (nRead == 0) ? AUDCLNT_BUFFERFLAGS_SILENT: 0);
+ }
+ }
+ }
+ }
+ else {
+ BREAK_WHILE;
+ }
+
+ tsk_mutex_lock(This->m_hMutex);
+ }// end-of-while
+
+ if (!SUCCEEDED(hr)) {
+ PLUGIN_WASAPI_ERROR(hr);
+ }
+
+ TSK_DEBUG_INFO("WASAPI: __playback_thread(%s) -- STOP", (SUCCEEDED(hr) && waitResult == 0) ? "OK": "NOK");
+
+ return NULL;
}
@@ -635,66 +588,60 @@ void* TSK_STDCALL AudioRender::AsyncThread(void *pArg)
/* constructor */
static tsk_object_t* plugin_wasapi_consumer_audio_ctor(tsk_object_t * self, va_list * app)
{
- plugin_wasapi_consumer_audio_t *wasapi = (plugin_wasapi_consumer_audio_t*)self;
- if(wasapi)
- {
- WASAPIUtils::Startup();
-
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(wasapi));
- /* init self */
-
- wasapi->pAudioRender = new AudioRender();
- if(!wasapi->pAudioRender)
- {
- TSK_DEBUG_ERROR("Failed to create renderer");
- return tsk_null;
- }
- }
- return self;
+ plugin_wasapi_consumer_audio_t *wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ if(wasapi) {
+ WASAPIUtils::Startup();
+
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(wasapi));
+ /* init self */
+
+ wasapi->pAudioRender = new AudioRender();
+ if(!wasapi->pAudioRender) {
+ TSK_DEBUG_ERROR("Failed to create renderer");
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_wasapi_consumer_audio_dtor(tsk_object_t * self)
-{
- plugin_wasapi_consumer_audio_t *wasapi = (plugin_wasapi_consumer_audio_t*)self;
- if(wasapi)
- {
- /* stop */
- plugin_wasapi_consumer_audio_stop((tmedia_consumer_t*)self);
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(wasapi));
- /* deinit self */
- if(wasapi->pAudioRender)
- {
- delete wasapi->pAudioRender;
- wasapi->pAudioRender = NULL;
- }
- }
-
- return self;
+{
+ plugin_wasapi_consumer_audio_t *wasapi = (plugin_wasapi_consumer_audio_t*)self;
+ if(wasapi) {
+ /* stop */
+ plugin_wasapi_consumer_audio_stop((tmedia_consumer_t*)self);
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(wasapi));
+ /* deinit self */
+ if(wasapi->pAudioRender) {
+ delete wasapi->pAudioRender;
+ wasapi->pAudioRender = NULL;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_wasapi_consumer_audio_def_s =
-{
- sizeof(plugin_wasapi_consumer_audio_t),
- plugin_wasapi_consumer_audio_ctor,
- plugin_wasapi_consumer_audio_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t plugin_wasapi_consumer_audio_def_s = {
+ sizeof(plugin_wasapi_consumer_audio_t),
+ plugin_wasapi_consumer_audio_ctor,
+ plugin_wasapi_consumer_audio_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_wasapi_consumer_audio_plugin_def_s =
-{
- &plugin_wasapi_consumer_audio_def_s,
-
- tmedia_audio,
- "Microsoft Windows Audio Session API (WASAPI) consumer",
-
- plugin_wasapi_consumer_audio_set,
- plugin_wasapi_consumer_audio_prepare,
- plugin_wasapi_consumer_audio_start,
- plugin_wasapi_consumer_audio_consume,
- plugin_wasapi_consumer_audio_pause,
- plugin_wasapi_consumer_audio_stop
+static const tmedia_consumer_plugin_def_t plugin_wasapi_consumer_audio_plugin_def_s = {
+ &plugin_wasapi_consumer_audio_def_s,
+
+ tmedia_audio,
+ "Microsoft Windows Audio Session API (WASAPI) consumer",
+
+ plugin_wasapi_consumer_audio_set,
+ plugin_wasapi_consumer_audio_prepare,
+ plugin_wasapi_consumer_audio_start,
+ plugin_wasapi_consumer_audio_consume,
+ plugin_wasapi_consumer_audio_pause,
+ plugin_wasapi_consumer_audio_stop
};
const tmedia_consumer_plugin_def_t *plugin_wasapi_consumer_audio_plugin_def_t = &plugin_wasapi_consumer_audio_plugin_def_s;
diff --git a/plugins/pluginWASAPI/plugin_wasapi_producer_audio.cxx b/plugins/pluginWASAPI/plugin_wasapi_producer_audio.cxx
index 6f44ab0..92e03f7 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_producer_audio.cxx
+++ b/plugins/pluginWASAPI/plugin_wasapi_producer_audio.cxx
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -22,7 +22,7 @@
*/
#include "plugin_wasapi_utils.h"
-#include "tinydav/audio/tdav_producer_audio.h"
+#include "tinydav/audio/tdav_producer_audio.h"
#include "tsk_thread.h"
#include "tsk_memory.h"
@@ -56,156 +56,147 @@ struct plugin_wasapi_producer_audio_s;
class AudioCapture
{
public:
- AudioCapture();
- virtual ~AudioCapture();
+ AudioCapture();
+ virtual ~AudioCapture();
- int Prepare(struct plugin_wasapi_producer_audio_s* wasapi, const tmedia_codec_t* codec);
- int UnPrepare();
- int Start();
- int Stop();
- int Pause();
+ int Prepare(struct plugin_wasapi_producer_audio_s* wasapi, const tmedia_codec_t* codec);
+ int UnPrepare();
+ int Start();
+ int Stop();
+ int Pause();
private:
- static void* TSK_STDCALL AsyncThread(void *pArg);
+ static void* TSK_STDCALL AsyncThread(void *pArg);
private:
- tsk_mutex_handle_t* m_hMutex;
+ tsk_mutex_handle_t* m_hMutex;
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- IAudioClient2* m_pDevice;
+ IAudioClient2* m_pDevice;
#else
- IAudioClient* m_pDevice;
+ IAudioClient* m_pDevice;
#endif
- IAudioCaptureClient* m_pClient;
- HANDLE m_hCaptureEvent;
- HANDLE m_hShutdownEvent;
- tsk_thread_handle_t* m_ppTread[1];
- INT32 m_nBytesPerNotif;
- INT32 m_nSourceFrameSizeInBytes;
-
- struct
- {
- tmedia_producer_enc_cb_f fn;
- const void* pcData;
- } m_callback;
-
- struct
- {
- struct
- {
- void* buffer;
- tsk_size_t size;
- } chunck;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } m_ring;
- bool m_bStarted;
- bool m_bPrepared;
- bool m_bPaused;
+ IAudioCaptureClient* m_pClient;
+ HANDLE m_hCaptureEvent;
+ HANDLE m_hShutdownEvent;
+ tsk_thread_handle_t* m_ppTread[1];
+ INT32 m_nBytesPerNotif;
+ INT32 m_nSourceFrameSizeInBytes;
+
+ struct {
+ tmedia_producer_enc_cb_f fn;
+ const void* pcData;
+ } m_callback;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } m_ring;
+ bool m_bStarted;
+ bool m_bPrepared;
+ bool m_bPaused;
};
-typedef struct plugin_wasapi_producer_audio_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
- AudioCapture* pAudioCapture;
+typedef struct plugin_wasapi_producer_audio_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+ AudioCapture* pAudioCapture;
}
plugin_wasapi_producer_audio_t;
/* ============ Media Producer Interface ================= */
static int plugin_wasapi_producer_audio_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
- plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
- if(param->plugin_type == tmedia_ppt_producer)
- {
- if(param->value_type == tmedia_pvt_int32)
- {
- if(tsk_striequals(param->key, "volume"))
- {
- return 0;
- }
- else if(tsk_striequals(param->key, "mute"))
- {
- //wasapi->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+{
+ plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "volume")) {
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "mute")) {
+ //wasapi->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
#if !FIXME_SEND_SILENCE_ON_MUTE
- //if(wasapi->started){
- // if(wasapi->mute){
- //IDirectSoundCaptureBuffer_Stop(wasapi->captureBuffer);
- // }
- // else{
- //IDirectSoundCaptureBuffer_Start(wasapi->captureBuffer, DSBPLAY_LOOPING);
- // }
- //}
+ //if(wasapi->started){
+ // if(wasapi->mute){
+ //IDirectSoundCaptureBuffer_Stop(wasapi->captureBuffer);
+ // }
+ // else{
+ //IDirectSoundCaptureBuffer_Start(wasapi->captureBuffer, DSBPLAY_LOOPING);
+ // }
+ //}
#endif
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int plugin_wasapi_producer_audio_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
+ plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
- if(!wasapi || !codec || !wasapi->pAudioCapture)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !codec || !wasapi->pAudioCapture) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* codec should have ptime */
- TMEDIA_PRODUCER(wasapi)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(wasapi)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ /* codec should have ptime */
+ TMEDIA_PRODUCER(wasapi)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(wasapi)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- TSK_DEBUG_INFO("WASAPI producer: channels=%d, rate=%d, ptime=%d",
- TMEDIA_PRODUCER(wasapi)->audio.channels,
- TMEDIA_PRODUCER(wasapi)->audio.rate,
- TMEDIA_PRODUCER(wasapi)->audio.ptime);
+ TSK_DEBUG_INFO("WASAPI producer: channels=%d, rate=%d, ptime=%d",
+ TMEDIA_PRODUCER(wasapi)->audio.channels,
+ TMEDIA_PRODUCER(wasapi)->audio.rate,
+ TMEDIA_PRODUCER(wasapi)->audio.ptime);
- return wasapi->pAudioCapture->Prepare(wasapi, codec);
+ return wasapi->pAudioCapture->Prepare(wasapi, codec);
}
static int plugin_wasapi_producer_audio_start(tmedia_producer_t* self)
{
- plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
+ plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
- TSK_DEBUG_INFO("plugin_wasapi_producer_audio_start()");
+ TSK_DEBUG_INFO("plugin_wasapi_producer_audio_start()");
- if(!wasapi || !wasapi->pAudioCapture){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioCapture) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioCapture->Start();
+ return wasapi->pAudioCapture->Start();
}
static int plugin_wasapi_producer_audio_pause(tmedia_producer_t* self)
{
- plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
+ plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
- if(!wasapi || !wasapi->pAudioCapture){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioCapture) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioCapture->Pause();
+ return wasapi->pAudioCapture->Pause();
}
static int plugin_wasapi_producer_audio_stop(tmedia_producer_t* self)
{
- plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
+ plugin_wasapi_producer_audio_t* wasapi = (plugin_wasapi_producer_audio_t*)self;
- TSK_DEBUG_INFO("plugin_wasapi_producer_audio_stop()");
+ TSK_DEBUG_INFO("plugin_wasapi_producer_audio_stop()");
- if(!wasapi || !wasapi->pAudioCapture){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->pAudioCapture) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->pAudioCapture->Stop();
+ return wasapi->pAudioCapture->Stop();
}
@@ -215,426 +206,383 @@ static int plugin_wasapi_producer_audio_stop(tmedia_producer_t* self)
AudioCapture::AudioCapture()
-: m_pDevice(NULL)
-, m_hMutex(NULL)
-, m_pClient(NULL)
-, m_hCaptureEvent(NULL)
-, m_hShutdownEvent(NULL)
-, m_nBytesPerNotif(0)
-, m_nSourceFrameSizeInBytes(0)
-, m_bStarted(false)
-, m_bPrepared(false)
-, m_bPaused(false)
+ : m_pDevice(NULL)
+ , m_hMutex(NULL)
+ , m_pClient(NULL)
+ , m_hCaptureEvent(NULL)
+ , m_hShutdownEvent(NULL)
+ , m_nBytesPerNotif(0)
+ , m_nSourceFrameSizeInBytes(0)
+ , m_bStarted(false)
+ , m_bPrepared(false)
+ , m_bPaused(false)
{
- m_ppTread[0] = NULL;
- memset(&m_ring, 0, sizeof(m_ring));
+ m_ppTread[0] = NULL;
+ memset(&m_ring, 0, sizeof(m_ring));
- m_callback.fn = NULL, m_callback.pcData = NULL;
+ m_callback.fn = NULL, m_callback.pcData = NULL;
- if(!(m_hMutex = tsk_mutex_create()))
- {
- TSK_DEBUG_ERROR("Failed to create mutex");
- }
+ if(!(m_hMutex = tsk_mutex_create())) {
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ }
}
AudioCapture::~AudioCapture()
{
- Stop();
- UnPrepare();
+ Stop();
+ UnPrepare();
- tsk_mutex_destroy(&m_hMutex);
+ tsk_mutex_destroy(&m_hMutex);
}
int AudioCapture::Prepare(plugin_wasapi_producer_audio_t* wasapi, const tmedia_codec_t* codec)
{
- HRESULT hr = S_OK;
- int ret = 0;
- WAVEFORMATEX wfx = {0};
+ HRESULT hr = S_OK;
+ int ret = 0;
+ WAVEFORMATEX wfx = {0};
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- AudioClientProperties properties = {0};
+ AudioClientProperties properties = {0};
#endif
- IMMDeviceEnumerator *pEnumerator = NULL;
- LPCWSTR pwstrCaptureId = NULL;
- IMMDevice *pDevice = NULL;
-
- tsk_mutex_lock(m_hMutex);
-
- if(m_bPrepared)
- {
- TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
- goto bail;
- }
-
- if(!wasapi || !codec)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(m_pDevice || m_pClient)
- {
- TSK_DEBUG_ERROR("Producer already prepared");
- CHECK_HR(hr = E_FAIL);
- }
+ IMMDeviceEnumerator *pEnumerator = NULL;
+ LPCWSTR pwstrCaptureId = NULL;
+ IMMDevice *pDevice = NULL;
+
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bPrepared) {
+ TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
+ goto bail;
+ }
+
+ if(!wasapi || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(m_pDevice || m_pClient) {
+ TSK_DEBUG_ERROR("Producer already prepared");
+ CHECK_HR(hr = E_FAIL);
+ }
#if PLUGIN_WASAPI_UNDER_WINDOWS_PHONE
- pwstrCaptureId = GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
- if (NULL == pwstrCaptureId)
- {
- PLUGIN_WASAPI_ERROR("GetDefaultAudioCaptureId", HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
- CHECK_HR(hr = ActivateAudioInterface(pwstrCaptureId, __uuidof(IAudioClient2), (void**)&m_pDevice));
-
- // Win8 or WP8 only
- properties.cbSize = sizeof AudioClientProperties;
- properties.eCategory = AudioCategory_Communications;
- CHECK_HR(hr = m_pDevice->SetClientProperties(&properties));
+ pwstrCaptureId = GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
+ if (NULL == pwstrCaptureId) {
+ PLUGIN_WASAPI_ERROR("GetDefaultAudioCaptureId", HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
+ CHECK_HR(hr = ActivateAudioInterface(pwstrCaptureId, __uuidof(IAudioClient2), (void**)&m_pDevice));
+
+ // Win8 or WP8 only
+ properties.cbSize = sizeof AudioClientProperties;
+ properties.eCategory = AudioCategory_Communications;
+ CHECK_HR(hr = m_pDevice->SetClientProperties(&properties));
#else
- CHECK_HR(hr = CoCreateInstance(
- CLSID_MMDeviceEnumerator, NULL,
- CLSCTX_ALL, IID_IMMDeviceEnumerator,
- (void**)&pEnumerator));
+ CHECK_HR(hr = CoCreateInstance(
+ CLSID_MMDeviceEnumerator, NULL,
+ CLSCTX_ALL, IID_IMMDeviceEnumerator,
+ (void**)&pEnumerator));
CHECK_HR(hr = pEnumerator->GetDefaultAudioEndpoint(
- eCapture, eCommunications, &pDevice));
+ eCapture, eCommunications, &pDevice));
CHECK_HR(hr = pDevice->Activate(
- IID_IAudioClient, CLSCTX_ALL,
- NULL, (void**)&m_pDevice));
+ IID_IAudioClient, CLSCTX_ALL,
+ NULL, (void**)&m_pDevice));
#endif
-
-
- /* Set best format */
- {
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_PRODUCER(wasapi)->audio.channels;
- wfx.nSamplesPerSec = TMEDIA_PRODUCER(wasapi)->audio.rate;
- wfx.wBitsPerSample = TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- PWAVEFORMATEX pwfxClosestMatch = NULL;
- hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
- if(hr != S_OK && hr != S_FALSE)
- {
- CHECK_HR(hr);
- }
-
- if(hr == S_FALSE)
- {
- if(!pwfxClosestMatch)
- {
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- wfx.nChannels = pwfxClosestMatch->nChannels;
- wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
+
+
+ /* Set best format */
+ {
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_PRODUCER(wasapi)->audio.channels;
+ wfx.nSamplesPerSec = TMEDIA_PRODUCER(wasapi)->audio.rate;
+ wfx.wBitsPerSample = TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ PWAVEFORMATEX pwfxClosestMatch = NULL;
+ hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
+ if(hr != S_OK && hr != S_FALSE) {
+ CHECK_HR(hr);
+ }
+
+ if(hr == S_FALSE) {
+ if(!pwfxClosestMatch) {
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ wfx.nChannels = pwfxClosestMatch->nChannels;
+ wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
#if 0
- wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
+ wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
- wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
- wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
- // Request resampler
- TMEDIA_PRODUCER(wasapi)->audio.rate = (uint32_t)wfx.nSamplesPerSec;
- TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
- TMEDIA_PRODUCER(wasapi)->audio.channels = (uint8_t)wfx.nChannels;
-
- TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
- }
- if(pwfxClosestMatch)
- {
- CoTaskMemFree(pwfxClosestMatch);
- }
- }
-
- m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
- m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(wasapi)->audio.ptime)/1000) * wfx.nChannels;
-
- // Initialize
- CHECK_HR(hr = m_pDevice->Initialize(
- AUDCLNT_SHAREMODE_SHARED,
- AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
- (PLUGIN_WASAPI_PRODUCER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_PRODUCER(wasapi)->audio.ptime)),
- 0,
- &wfx,
- NULL));
-
- REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
- CHECK_HR(hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod));
- TSK_DEBUG_INFO("#WASAPI(Capture): DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
-
- if(!m_hCaptureEvent)
- {
- if(!(m_hCaptureEvent = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS)))
- {
- PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
- }
- if(!m_hShutdownEvent)
- {
- if(!(m_hShutdownEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS)))
- {
- PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
- CHECK_HR(hr = E_FAIL);
- }
- }
-
- CHECK_HR(hr = m_pDevice->SetEventHandle(m_hCaptureEvent));
-
- CHECK_HR(hr = m_pDevice->GetService(__uuidof(IAudioCaptureClient), (void**)&m_pClient));
-
- int packetperbuffer = (1000 / TMEDIA_PRODUCER(wasapi)->audio.ptime);
- m_ring.chunck.size = (wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer) * wfx.nChannels;
- TSK_DEBUG_INFO("#WASAPI: Audio producer ring chunk size = %u", m_ring.chunck.size);
- // allocate our chunck buffer
- if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size)))
- {
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- // create ringbuffer
- m_ring.size = PLUGIN_WASAPI_PRODUCER_NOTIF_POS_COUNT * m_ring.chunck.size;
- TSK_DEBUG_INFO("#WASAPI: Audio producer ring size = %u", m_ring.size);
- if(!m_ring.buffer)
- {
- m_ring.buffer = speex_buffer_init(m_ring.size);
- }
- else
- {
- int sret;
- if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0)
- {
- TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- }
- if(!m_ring.buffer)
- {
- TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
-
- m_callback.fn = TMEDIA_PRODUCER(wasapi)->enc_cb.callback;
- m_callback.pcData = TMEDIA_PRODUCER(wasapi)->enc_cb.callback_data;
+ wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
+ wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
+ // Request resampler
+ TMEDIA_PRODUCER(wasapi)->audio.rate = (uint32_t)wfx.nSamplesPerSec;
+ TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
+ TMEDIA_PRODUCER(wasapi)->audio.channels = (uint8_t)wfx.nChannels;
+
+ TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
+ }
+ if(pwfxClosestMatch) {
+ CoTaskMemFree(pwfxClosestMatch);
+ }
+ }
+
+ m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
+ m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(wasapi)->audio.ptime)/1000) * wfx.nChannels;
+
+ // Initialize
+ CHECK_HR(hr = m_pDevice->Initialize(
+ AUDCLNT_SHAREMODE_SHARED,
+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
+ (PLUGIN_WASAPI_PRODUCER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_PRODUCER(wasapi)->audio.ptime)),
+ 0,
+ &wfx,
+ NULL));
+
+ REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
+ CHECK_HR(hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod));
+ TSK_DEBUG_INFO("#WASAPI(Capture): DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
+
+ if(!m_hCaptureEvent) {
+ if(!(m_hCaptureEvent = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS))) {
+ PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
+ }
+ if(!m_hShutdownEvent) {
+ if(!(m_hShutdownEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS))) {
+ PLUGIN_WASAPI_ERROR(HRESULT_FROM_WIN32(GetLastError()));
+ CHECK_HR(hr = E_FAIL);
+ }
+ }
+
+ CHECK_HR(hr = m_pDevice->SetEventHandle(m_hCaptureEvent));
+
+ CHECK_HR(hr = m_pDevice->GetService(__uuidof(IAudioCaptureClient), (void**)&m_pClient));
+
+ int packetperbuffer = (1000 / TMEDIA_PRODUCER(wasapi)->audio.ptime);
+ m_ring.chunck.size = (wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer) * wfx.nChannels;
+ TSK_DEBUG_INFO("#WASAPI: Audio producer ring chunk size = %u", m_ring.chunck.size);
+ // allocate our chunck buffer
+ if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ // create ringbuffer
+ m_ring.size = PLUGIN_WASAPI_PRODUCER_NOTIF_POS_COUNT * m_ring.chunck.size;
+ TSK_DEBUG_INFO("#WASAPI: Audio producer ring size = %u", m_ring.size);
+ if(!m_ring.buffer) {
+ m_ring.buffer = speex_buffer_init(m_ring.size);
+ }
+ else {
+ int sret;
+ if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0) {
+ TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ }
+ if(!m_ring.buffer) {
+ TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+
+ m_callback.fn = TMEDIA_PRODUCER(wasapi)->enc_cb.callback;
+ m_callback.pcData = TMEDIA_PRODUCER(wasapi)->enc_cb.callback_data;
bail:
- ret = SUCCEEDED(hr) ? 0 : -1;
- if (pwstrCaptureId)
- {
- CoTaskMemFree((LPVOID)pwstrCaptureId);
- }
- if(ret != 0)
- {
- UnPrepare();
- }
- m_bPrepared = (ret == 0);
-
- tsk_mutex_unlock(m_hMutex);
-
- SafeRelease(&pEnumerator);
- SafeRelease(&pDevice);
-
- return ret;
+ ret = SUCCEEDED(hr) ? 0 : -1;
+ if (pwstrCaptureId) {
+ CoTaskMemFree((LPVOID)pwstrCaptureId);
+ }
+ if(ret != 0) {
+ UnPrepare();
+ }
+ m_bPrepared = (ret == 0);
+
+ tsk_mutex_unlock(m_hMutex);
+
+ SafeRelease(&pEnumerator);
+ SafeRelease(&pDevice);
+
+ return ret;
}
int AudioCapture::UnPrepare()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_hCaptureEvent)
- {
- CloseHandle(m_hCaptureEvent), m_hCaptureEvent = NULL;
- }
- if(m_hShutdownEvent)
- {
- CloseHandle(m_hShutdownEvent), m_hShutdownEvent = NULL;
- }
- if(m_pDevice)
- {
- m_pDevice->Release(), m_pDevice = NULL;
- }
- if(m_pClient)
- {
- m_pClient->Release(), m_pClient = NULL;
- }
-
- TSK_FREE(m_ring.chunck.buffer);
- if(m_ring.buffer)
- {
- speex_buffer_destroy(m_ring.buffer);
- m_ring.buffer = NULL;
- }
-
- m_callback.fn = NULL;
- m_callback.pcData = NULL;
-
- m_bPrepared = false;
-
- tsk_mutex_unlock(m_hMutex);
-
- return 0;
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_hCaptureEvent) {
+ CloseHandle(m_hCaptureEvent), m_hCaptureEvent = NULL;
+ }
+ if(m_hShutdownEvent) {
+ CloseHandle(m_hShutdownEvent), m_hShutdownEvent = NULL;
+ }
+ if(m_pDevice) {
+ m_pDevice->Release(), m_pDevice = NULL;
+ }
+ if(m_pClient) {
+ m_pClient->Release(), m_pClient = NULL;
+ }
+
+ TSK_FREE(m_ring.chunck.buffer);
+ if(m_ring.buffer) {
+ speex_buffer_destroy(m_ring.buffer);
+ m_ring.buffer = NULL;
+ }
+
+ m_callback.fn = NULL;
+ m_callback.pcData = NULL;
+
+ m_bPrepared = false;
+
+ tsk_mutex_unlock(m_hMutex);
+
+ return 0;
}
int AudioCapture::Start()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_bStarted)
- {
- TSK_DEBUG_INFO("#WASAPI: Audio producer already started");
- goto bail;
- }
- if(!m_bPrepared)
- {
- TSK_DEBUG_ERROR("Audio producer not prepared");
- goto bail;
- }
-
- m_bStarted = true;
- if(!m_ppTread[0] && tsk_thread_create(m_ppTread, AudioCapture::AsyncThread, this) != 0)
- {
- m_bStarted = false;
- goto bail;
- }
-
- HRESULT hr = m_pDevice->Start();
- if(!SUCCEEDED(hr))
- {
- PLUGIN_WASAPI_ERROR(hr);
- Stop();
- }
- m_bPaused = false;
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bStarted) {
+ TSK_DEBUG_INFO("#WASAPI: Audio producer already started");
+ goto bail;
+ }
+ if(!m_bPrepared) {
+ TSK_DEBUG_ERROR("Audio producer not prepared");
+ goto bail;
+ }
+
+ m_bStarted = true;
+ if(!m_ppTread[0] && tsk_thread_create(m_ppTread, AudioCapture::AsyncThread, this) != 0) {
+ m_bStarted = false;
+ goto bail;
+ }
+
+ HRESULT hr = m_pDevice->Start();
+ if(!SUCCEEDED(hr)) {
+ PLUGIN_WASAPI_ERROR(hr);
+ Stop();
+ }
+ m_bPaused = false;
bail:
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return (m_bStarted ? 0 : -2);
+ return (m_bStarted ? 0 : -2);
}
int AudioCapture::Stop()
{
- m_bStarted = false;
+ m_bStarted = false;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_hShutdownEvent)
- {
- SetEvent(m_hShutdownEvent);
- }
+ if (m_hShutdownEvent) {
+ SetEvent(m_hShutdownEvent);
+ }
- if (m_ppTread[0])
- {
- tsk_thread_join(m_ppTread);
- }
+ if (m_ppTread[0]) {
+ tsk_thread_join(m_ppTread);
+ }
- if(m_pDevice)
- {
- m_pDevice->Stop();
- }
+ if(m_pDevice) {
+ m_pDevice->Stop();
+ }
- // will be prepared again before next start()
- UnPrepare();
+ // will be prepared again before next start()
+ UnPrepare();
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int AudioCapture::Pause()
{
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- m_bPaused = true;
+ m_bPaused = true;
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
void* TSK_STDCALL AudioCapture::AsyncThread(void *pArg)
{
- HRESULT hr = S_OK;
- BYTE* pbData = NULL;
- UINT32 nFrames = 0;
- DWORD dwFlags = 0;
- UINT32 incomingBufferSize;
- INT32 avail;
- UINT32 nNextPacketSize;
- AudioCapture* This = (AudioCapture*)pArg;
-
- HANDLE eventHandles[] = {
- This->m_hCaptureEvent, // WAIT_OBJECT0
- This->m_hShutdownEvent // WAIT_OBJECT1
- };
-
- TSK_DEBUG_INFO("#WASAPI: __record_thread -- START");
+ HRESULT hr = S_OK;
+ BYTE* pbData = NULL;
+ UINT32 nFrames = 0;
+ DWORD dwFlags = 0;
+ UINT32 incomingBufferSize;
+ INT32 avail;
+ UINT32 nNextPacketSize;
+ AudioCapture* This = (AudioCapture*)pArg;
+
+ HANDLE eventHandles[] = {
+ This->m_hCaptureEvent, // WAIT_OBJECT0
+ This->m_hShutdownEvent // WAIT_OBJECT1
+ };
+
+ TSK_DEBUG_INFO("#WASAPI: __record_thread -- START");
#define BREAK_WHILE tsk_mutex_unlock(This->m_hMutex); break;
- while(This->m_bStarted && SUCCEEDED(hr))
- {
- DWORD waitResult = WaitForMultipleObjectsEx(SIZEOF_ARRAY(eventHandles), eventHandles, FALSE, INFINITE, FALSE);
-
- tsk_mutex_lock(This->m_hMutex);
-
- if(!This->m_bStarted)
- {
- BREAK_WHILE;
- }
-
- if(waitResult == WAIT_OBJECT_0 && This->m_callback.fn)
- {
- hr = This->m_pClient->GetNextPacketSize(&nNextPacketSize);
- while(SUCCEEDED(hr) && nNextPacketSize >0)
- {
- hr = This->m_pClient->GetBuffer(&pbData, &nFrames, &dwFlags, NULL, NULL);
- if(SUCCEEDED(hr) && pbData && nFrames)
- {
- if((dwFlags & AUDCLNT_BUFFERFLAGS_SILENT) != AUDCLNT_BUFFERFLAGS_SILENT)
- {
- incomingBufferSize = nFrames * This->m_nSourceFrameSizeInBytes;
- speex_buffer_write(This->m_ring.buffer, pbData, incomingBufferSize);
- avail = speex_buffer_get_available(This->m_ring.buffer);
- while (This->m_bStarted && avail >= (INT32)This->m_ring.chunck.size)
- {
- avail -= speex_buffer_read(This->m_ring.buffer, This->m_ring.chunck.buffer, This->m_ring.chunck.size);
+ while(This->m_bStarted && SUCCEEDED(hr)) {
+ DWORD waitResult = WaitForMultipleObjectsEx(SIZEOF_ARRAY(eventHandles), eventHandles, FALSE, INFINITE, FALSE);
+
+ tsk_mutex_lock(This->m_hMutex);
+
+ if(!This->m_bStarted) {
+ BREAK_WHILE;
+ }
+
+ if(waitResult == WAIT_OBJECT_0 && This->m_callback.fn) {
+ hr = This->m_pClient->GetNextPacketSize(&nNextPacketSize);
+ while(SUCCEEDED(hr) && nNextPacketSize >0) {
+ hr = This->m_pClient->GetBuffer(&pbData, &nFrames, &dwFlags, NULL, NULL);
+ if(SUCCEEDED(hr) && pbData && nFrames) {
+ if((dwFlags & AUDCLNT_BUFFERFLAGS_SILENT) != AUDCLNT_BUFFERFLAGS_SILENT) {
+ incomingBufferSize = nFrames * This->m_nSourceFrameSizeInBytes;
+ speex_buffer_write(This->m_ring.buffer, pbData, incomingBufferSize);
+ avail = speex_buffer_get_available(This->m_ring.buffer);
+ while (This->m_bStarted && avail >= (INT32)This->m_ring.chunck.size) {
+ avail -= speex_buffer_read(This->m_ring.buffer, This->m_ring.chunck.buffer, This->m_ring.chunck.size);
#if 0
- {
- static FILE* f = fopen("./wasapi_producer.raw", "w+");
- fwrite(This->m_ring.chunck.buffer, 1, This->m_ring.chunck.size, f);
- }
+ {
+ static FILE* f = fopen("./wasapi_producer.raw", "w+");
+ fwrite(This->m_ring.chunck.buffer, 1, This->m_ring.chunck.size, f);
+ }
#endif
- This->m_callback.fn(This->m_callback.pcData, This->m_ring.chunck.buffer, This->m_ring.chunck.size);
- }
- }
-
- if (SUCCEEDED(hr))
- {
- hr = This->m_pClient->ReleaseBuffer(nFrames);
- }
- if (SUCCEEDED(hr))
- {
- hr = This->m_pClient->GetNextPacketSize(&nNextPacketSize);
- }
- }
- }
- }
- else if(waitResult != WAIT_OBJECT_0)
- {
- BREAK_WHILE;
- }
-
- tsk_mutex_unlock(This->m_hMutex);
- }// end-of-while
-
- if (!SUCCEEDED(hr))
- {
- PLUGIN_WASAPI_ERROR(hr);
- }
-
- TSK_DEBUG_INFO("WASAPI: __record_thread(%s) -- STOP", SUCCEEDED(hr) ? "OK": "NOK");
-
- return NULL;
+ This->m_callback.fn(This->m_callback.pcData, This->m_ring.chunck.buffer, This->m_ring.chunck.size);
+ }
+ }
+
+ if (SUCCEEDED(hr)) {
+ hr = This->m_pClient->ReleaseBuffer(nFrames);
+ }
+ if (SUCCEEDED(hr)) {
+ hr = This->m_pClient->GetNextPacketSize(&nNextPacketSize);
+ }
+ }
+ }
+ }
+ else if(waitResult != WAIT_OBJECT_0) {
+ BREAK_WHILE;
+ }
+
+ tsk_mutex_unlock(This->m_hMutex);
+ }// end-of-while
+
+ if (!SUCCEEDED(hr)) {
+ PLUGIN_WASAPI_ERROR(hr);
+ }
+
+ TSK_DEBUG_INFO("WASAPI: __record_thread(%s) -- STOP", SUCCEEDED(hr) ? "OK": "NOK");
+
+ return NULL;
}
@@ -649,64 +597,58 @@ void* TSK_STDCALL AudioCapture::AsyncThread(void *pArg)
/* constructor */
static tsk_object_t* plugin_wasapi_producer_audio_ctor(tsk_object_t * self, va_list * app)
{
- plugin_wasapi_producer_audio_t *wasapi = (plugin_wasapi_producer_audio_t*)self;
- if(wasapi)
- {
- WASAPIUtils::Startup();
-
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(wasapi));
- /* init self */
-
- wasapi->pAudioCapture = new AudioCapture();
- if(!wasapi->pAudioCapture)
- {
- TSK_DEBUG_ERROR("Failed to create Audio capture device");
- return tsk_null;
- }
- }
- return self;
+ plugin_wasapi_producer_audio_t *wasapi = (plugin_wasapi_producer_audio_t*)self;
+ if(wasapi) {
+ WASAPIUtils::Startup();
+
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(wasapi));
+ /* init self */
+
+ wasapi->pAudioCapture = new AudioCapture();
+ if(!wasapi->pAudioCapture) {
+ TSK_DEBUG_ERROR("Failed to create Audio capture device");
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_wasapi_producer_audio_dtor(tsk_object_t * self)
-{
- plugin_wasapi_producer_audio_t *wasapi = (plugin_wasapi_producer_audio_t*)self;
- if(wasapi)
- {
- /* stop */
- plugin_wasapi_producer_audio_stop((tmedia_producer_t*)self);
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(wasapi));
- /* deinit self */
- if(wasapi->pAudioCapture)
- {
- delete wasapi->pAudioCapture;
- wasapi->pAudioCapture = NULL;
- }
- }
-
- return self;
+{
+ plugin_wasapi_producer_audio_t *wasapi = (plugin_wasapi_producer_audio_t*)self;
+ if(wasapi) {
+ /* stop */
+ plugin_wasapi_producer_audio_stop((tmedia_producer_t*)self);
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(wasapi));
+ /* deinit self */
+ if(wasapi->pAudioCapture) {
+ delete wasapi->pAudioCapture;
+ wasapi->pAudioCapture = NULL;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_wasapi_producer_audio_def_s =
-{
- sizeof(plugin_wasapi_producer_audio_t),
- plugin_wasapi_producer_audio_ctor,
- plugin_wasapi_producer_audio_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t plugin_wasapi_producer_audio_def_s = {
+ sizeof(plugin_wasapi_producer_audio_t),
+ plugin_wasapi_producer_audio_ctor,
+ plugin_wasapi_producer_audio_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_wasapi_producer_audio_plugin_def_s =
-{
- &plugin_wasapi_producer_audio_def_s,
+static const tmedia_producer_plugin_def_t plugin_wasapi_producer_audio_plugin_def_s = {
+ &plugin_wasapi_producer_audio_def_s,
- tmedia_audio,
- "Microsoft Windows Audio Session API (WASAPI) producer",
+ tmedia_audio,
+ "Microsoft Windows Audio Session API (WASAPI) producer",
- plugin_wasapi_producer_audio_set,
- plugin_wasapi_producer_audio_prepare,
- plugin_wasapi_producer_audio_start,
- plugin_wasapi_producer_audio_pause,
- plugin_wasapi_producer_audio_stop
+ plugin_wasapi_producer_audio_set,
+ plugin_wasapi_producer_audio_prepare,
+ plugin_wasapi_producer_audio_start,
+ plugin_wasapi_producer_audio_pause,
+ plugin_wasapi_producer_audio_stop
};
const tmedia_producer_plugin_def_t *plugin_wasapi_producer_audio_plugin_def_t = &plugin_wasapi_producer_audio_plugin_def_s;
diff --git a/plugins/pluginWASAPI/plugin_wasapi_tdav.cxx b/plugins/pluginWASAPI/plugin_wasapi_tdav.cxx
index e7a15e9..ebfc85f 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_tdav.cxx
+++ b/plugins/pluginWASAPI/plugin_wasapi_tdav.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/plugins/pluginWASAPI/plugin_wasapi_utils.cxx b/plugins/pluginWASAPI/plugin_wasapi_utils.cxx
index bc2d45e..e967cff 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_utils.cxx
+++ b/plugins/pluginWASAPI/plugin_wasapi_utils.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,58 +24,56 @@ bool WASAPIUtils::g_bStarted = false;
HRESULT WASAPIUtils::Startup()
{
- if(!g_bStarted)
- {
- HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
- if(SUCCEEDED(hr) || hr == 0x80010106) // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
- {
- hr = S_OK;
- }
- g_bStarted = SUCCEEDED(hr);
- return hr;
- }
- return S_OK;
+ if(!g_bStarted) {
+ HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if(SUCCEEDED(hr) || hr == 0x80010106) { // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
+ hr = S_OK;
+ }
+ g_bStarted = SUCCEEDED(hr);
+ return hr;
+ }
+ return S_OK;
}
HRESULT WASAPIUtils::Shutdown()
{
- return S_OK;
+ return S_OK;
}
void WASAPIUtils::PrintError(const char* pcFileName, const char* pcFuncName, unsigned nLineNumber, HRESULT hr)
{
- CHAR message[1024] = {0};
+ CHAR message[1024] = {0};
#if PLUGIN_WASAPI_UNDER_WINDOWS_RT
- // FormatMessageA not allowed on the Store
- static WCHAR wBuff[1024] = {0};
- FormatMessageW(
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- hr,
- 0,
- wBuff,
- sizeof(wBuff)-1,
- tsk_null);
- WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), message, sizeof(message) - 1, NULL, NULL);
+ // FormatMessageA not allowed on the Store
+ static WCHAR wBuff[1024] = {0};
+ FormatMessageW(
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ hr,
+ 0,
+ wBuff,
+ sizeof(wBuff)-1,
+ tsk_null);
+ WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), message, sizeof(message) - 1, NULL, NULL);
#else
#ifdef _WIN32_WCE
- FormatMessage
+ FormatMessage
#else
- FormatMessageA
+ FormatMessageA
#endif
- (
+ (
#if !PLUGIN_WASAPI_UNDER_WINDOWS_RT
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
#endif
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- hr,
- 0,
- message,
- sizeof(message) - 1,
- tsk_null);
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ hr,
+ 0,
+ message,
+ sizeof(message) - 1,
+ tsk_null);
#endif
- TSK_DEBUG_ERROR("[WASAPI] File:%s\n Function=%s\n Line:%u\n Message:%s", pcFileName, pcFuncName, nLineNumber, message);
+ TSK_DEBUG_ERROR("[WASAPI] File:%s\n Function=%s\n Line:%u\n Message:%s", pcFileName, pcFuncName, nLineNumber, message);
} \ No newline at end of file
diff --git a/plugins/pluginWASAPI/plugin_wasapi_utils.h b/plugins/pluginWASAPI/plugin_wasapi_utils.h
index 218a7f8..7237619 100755
--- a/plugins/pluginWASAPI/plugin_wasapi_utils.h
+++ b/plugins/pluginWASAPI/plugin_wasapi_utils.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,7 +31,7 @@
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
#undef CHECK_HR
// In CHECK_HR(x) When (x) is a function it will be executed twice when used in "TSK_DEBUG_ERROR(x)" and "If(x)"
@@ -42,12 +42,12 @@
class WASAPIUtils
{
public:
- static HRESULT Startup();
- static HRESULT Shutdown();
- static void PrintError(const char* pcFileName, const char* pcFuncName, unsigned nLineNumber, HRESULT hr);
+ static HRESULT Startup();
+ static HRESULT Shutdown();
+ static void PrintError(const char* pcFileName, const char* pcFuncName, unsigned nLineNumber, HRESULT hr);
private:
- static bool g_bStarted;
+ static bool g_bStarted;
};
#endif /* PLUGIN_WASAPI_UTILS_H */
diff --git a/plugins/pluginWinAudioDSP/dllmain_audio_dsp.cxx b/plugins/pluginWinAudioDSP/dllmain_audio_dsp.cxx
index dcb9005..a252d04 100755
--- a/plugins/pluginWinAudioDSP/dllmain_audio_dsp.cxx
+++ b/plugins/pluginWinAudioDSP/dllmain_audio_dsp.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -55,103 +55,92 @@ PLUGIN_AUDIO_DSP_END_DECLS /* END */
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
-typedef enum PLUGIN_INDEX_E
-{
+typedef enum PLUGIN_INDEX_E {
#if PLUGIN_AUDIO_DSP_RESAMPLER_ENABLE
- PLUGIN_INDEX_RESAMPLER,
+ PLUGIN_INDEX_RESAMPLER,
#endif
#if PLUGIN_AUDIO_DSP_DENOISER_ENABLE
- PLUGIN_INDEX_DENOISER,
+ PLUGIN_INDEX_DENOISER,
#endif
-
- PLUGIN_INDEX_COUNT
+
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch(index)
- {
+ switch(index) {
#if PLUGIN_AUDIO_DSP_RESAMPLER_ENABLE
- case PLUGIN_INDEX_RESAMPLER:
- {
- return tsk_plugin_def_type_resampler;
- }
+ case PLUGIN_INDEX_RESAMPLER: {
+ return tsk_plugin_def_type_resampler;
+ }
#endif
#if PLUGIN_AUDIO_DSP_DENOISER_ENABLE
- case PLUGIN_INDEX_DENOISER:
- {
- return tsk_plugin_def_type_denoiser;
- }
+ case PLUGIN_INDEX_DENOISER: {
+ return tsk_plugin_def_type_denoiser;
+ }
#endif
- }
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
+ }
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch(index)
- {
+ switch(index) {
#if PLUGIN_AUDIO_DSP_RESAMPLER_ENABLE
- case PLUGIN_INDEX_RESAMPLER:
- {
- return tsk_plugin_def_media_type_audio;
- }
+ case PLUGIN_INDEX_RESAMPLER: {
+ return tsk_plugin_def_media_type_audio;
+ }
#endif
#if PLUGIN_AUDIO_DSP_DENOISER_ENABLE
- case PLUGIN_INDEX_DENOISER:
- {
- return tsk_plugin_def_media_type_audio;
- }
+ case PLUGIN_INDEX_DENOISER: {
+ return tsk_plugin_def_media_type_audio;
+ }
#endif
- }
+ }
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch(index)
- {
+ switch(index) {
#if PLUGIN_AUDIO_DSP_RESAMPLER_ENABLE
- case PLUGIN_INDEX_RESAMPLER:
- {
- return plugin_audio_dsp_resampler_plugin_def_t;
- }
+ case PLUGIN_INDEX_RESAMPLER: {
+ return plugin_audio_dsp_resampler_plugin_def_t;
+ }
#endif
#if PLUGIN_AUDIO_DSP_DENOISER_ENABLE
- case PLUGIN_INDEX_DENOISER:
- {
- return plugin_audio_dsp_denoise_plugin_def_t;
- }
+ case PLUGIN_INDEX_DENOISER: {
+ return plugin_audio_dsp_denoise_plugin_def_t;
+ }
#endif
- }
+ }
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
}
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_config.h b/plugins/pluginWinAudioDSP/plugin_audio_dsp_config.h
index 7730bc8..100f0f8 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_config.h
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_config.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -48,12 +48,12 @@
# define PLUGIN_AUDIO_DSP_UNDER_X86 1
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define PLUGIN_AUDIO_DSP_BEGIN_DECLS extern "C" {
# define PLUGIN_AUDIO_DSP_END_DECLS }
#else
-# define PLUGIN_AUDIO_DSP_BEGIN_DECLS
+# define PLUGIN_AUDIO_DSP_BEGIN_DECLS
# define PLUGIN_AUDIO_DSP_END_DECLS
#endif
@@ -69,7 +69,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // PLUGIN_AUDIO_DSP_CONFIG_H
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_denoiser.cxx b/plugins/pluginWinAudioDSP/plugin_audio_dsp_denoiser.cxx
index 574c5ac..74d713f 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_denoiser.cxx
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_denoiser.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -44,201 +44,189 @@ static const UINT32 g_nChannles = 1; // FIXME
static const UINT32 g_nFrameDuration = 20; // FIXME
/** Speex denoiser*/
-typedef struct plugin_audio_dsp_denoise_s
-{
- TMEDIA_DECLARE_DENOISE;
-
- bool bOpened;
+typedef struct plugin_audio_dsp_denoise_s {
+ TMEDIA_DECLARE_DENOISE;
+
+ bool bOpened;
- LONGLONG rtStart;
+ LONGLONG rtStart;
UINT64 rtDuration;
- uint32_t echo_tail;
- tsk_size_t playback_size_samples;
- tsk_size_t playback_size_bytes;
- tsk_size_t playback_channels;
- tsk_size_t record_size_samples;
- tsk_size_t record_size_bytes;
- tsk_size_t record_channels;
-
- IMediaObject* pInst;
- IMediaBuffer *pBufferIn;
- IMediaBuffer *pBufferOut;
+ uint32_t echo_tail;
+ tsk_size_t playback_size_samples;
+ tsk_size_t playback_size_bytes;
+ tsk_size_t playback_channels;
+ tsk_size_t record_size_samples;
+ tsk_size_t record_size_bytes;
+ tsk_size_t record_channels;
+
+ IMediaObject* pInst;
+ IMediaBuffer *pBufferIn;
+ IMediaBuffer *pBufferOut;
}
plugin_audio_dsp_denoise_t;
static int plugin_audio_dsp_denoise_set(tmedia_denoise_t* _self, const tmedia_param_t* param)
{
- plugin_audio_dsp_denoise_t *self = (plugin_audio_dsp_denoise_t *)_self;
- if(!self || !param)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int32)
- {
- if(tsk_striequals(param->key, "echo-tail"))
- {
- _self->echo_tail = *((int32_t*)param->value);
- TSK_DEBUG_INFO("ms_voice_dsp_set_echo_tail(%d)", _self->echo_tail);
- if(self->pInst)
- {
- IPropertyStore* pPropStore = NULL;
- HRESULT hr = self->pInst->QueryInterface(IID_PPV_ARGS(&pPropStore));
- if(SUCCEEDED(hr))
- {
- DMO_MEDIA_TYPE mt = {0};
- PROPVARIANT var = {0};
- var.vt = VT_UI4;
- var.ulVal = _self->echo_tail;
- hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH , var);
- }
- SafeRelease(&pPropStore);
- }
- return 0;
- }
- }
- return -1;
+ plugin_audio_dsp_denoise_t *self = (plugin_audio_dsp_denoise_t *)_self;
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "echo-tail")) {
+ _self->echo_tail = *((int32_t*)param->value);
+ TSK_DEBUG_INFO("ms_voice_dsp_set_echo_tail(%d)", _self->echo_tail);
+ if(self->pInst) {
+ IPropertyStore* pPropStore = NULL;
+ HRESULT hr = self->pInst->QueryInterface(IID_PPV_ARGS(&pPropStore));
+ if(SUCCEEDED(hr)) {
+ DMO_MEDIA_TYPE mt = {0};
+ PROPVARIANT var = {0};
+ var.vt = VT_UI4;
+ var.ulVal = _self->echo_tail;
+ hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH , var);
+ }
+ SafeRelease(&pPropStore);
+ }
+ return 0;
+ }
+ }
+ return -1;
}
static int plugin_audio_dsp_denoise_open(tmedia_denoise_t* self, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate)
{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
-
- HRESULT hr = S_OK;
- DMO_MEDIA_TYPE mt = {0};
- PROPVARIANT var = {0};
- IPropertyStore* pPropStore = NULL;
-
- TSK_DEBUG_INFO("[MS Voice Capture DSP] AEC_ENABLED=%d ECHO_TAIL=%d,\nAGC_ENABLED=%d,\nNOISE_SUPP_ENABLED=%d,\nVAD_ENABLED=%d",
- self->echo_supp_enabled, self->echo_tail,
- self->agc_enabled,
- self->noise_supp_enabled,
- self->vad_enabled
- );
-
- if(denoiser->bOpened)
- {
- TSK_DEBUG_ERROR("Denoiser already opened");
- CHECK_HR(hr = E_FAIL);
- }
-
- CHECK_HR(hr = AudioDSPUtils::MoInitMediaType(
- record_sampling_rate,
- g_nBitsPerSample,
- g_nChannles,
- &mt));
-
- CHECK_HR(hr = CoCreateInstance(CLSID_CWMAudioAEC, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&denoiser->pInst)));
- CHECK_HR(hr = denoiser->pInst->QueryInterface(IID_PPV_ARGS(&pPropStore)));
-
- // If the input format does not match the output format, the DMO automatically performs sample-rate conversion.
- CHECK_HR(hr = denoiser->pInst->SetInputType(0, &mt, 0));
- CHECK_HR(hr = denoiser->pInst->SetOutputType(0, &mt, 0));
-
- // Enables the application to override the default settings on various properties of the Voice Capture DSP
- // http://msdn.microsoft.com/en-us/library/windows/desktop/ff819422(v=vs.85).aspx
- var.vt = VT_BOOL;
- var.boolVal = VARIANT_TRUE;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATURE_MODE, var));
-
- // Switch to filter mode: http://msdn.microsoft.com/en-us/library/windows/desktop/ff819410(v=vs.85).aspx
- var.vt = VT_BOOL;
- var.boolVal = VARIANT_FALSE; /* VARIANT_FALSE: Filter, VARIANT_TRUE: Source */
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_DMO_SOURCE_MODE, var));
-
- // Enable AEC
- if(self->echo_supp_enabled)
- {
- // Enable AEC: http://msdn.microsoft.com/en-us/library/windows/desktop/ff819427(v=vs.85).aspx
- var.vt = VT_I4;
- var.lVal = SINGLE_CHANNEL_AEC;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_SYSTEM_MODE, var));
-
- // Echo Tail (milliseconds): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819414(v=vs.85).aspx
- if(!self->echo_tail)
- {
- self->echo_tail = tmedia_defaults_get_echo_tail();
- }
- var.vt = VT_I4;
- var.lVal = self->echo_tail ? self->echo_tail : 256;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH, var));
- }
-
- // Automatic Gain Control (AGC): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819412(v=vs.85).aspx
- var.vt = VT_BOOL;
- var.boolVal = self->agc_enabled ? VARIANT_TRUE : VARIANT_FALSE;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_AGC, var));
-
- // Noise suppression (NS): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819420(v=vs.85).aspx
- var.vt = VT_I4;
- var.lVal = self->noise_supp_enabled ? 1 : 0;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_NS, var));
-
- // Automatic Gain Control (AGC): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819412(v=vs.85).aspx
- var.vt = VT_BOOL;
- var.boolVal = self->agc_enabled ? VARIANT_TRUE : VARIANT_FALSE;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_AGC, var));
-
- // Voice Activity Detection (VAD): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819421(v=vs.85).aspx
- var.vt = VT_I4;
- var.lVal = self->vad_enabled ? AEC_VAD_FOR_SILENCE_SUPPRESSION : AEC_VAD_DISABLED;
- CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_VAD, var));
-
- // Recommended to allocate resources
- CHECK_HR(hr = denoiser->pInst->AllocateStreamingResources()); // FIXME: returns E_FAIL
-
- denoiser->record_channels = g_nChannles;
- denoiser->record_size_samples = ((record_sampling_rate * g_nFrameDuration) / 1000) << (denoiser->record_channels == 2 ? 1 : 0);
- denoiser->record_size_bytes = (denoiser->record_size_samples * (g_nBitsPerSample >> 3));
-
- denoiser->playback_channels = g_nChannles;
- denoiser->playback_size_samples = ((playback_sampling_rate * g_nFrameDuration) / 1000) << (denoiser->playback_channels == 2 ? 1 : 0);
- denoiser->playback_size_bytes = (denoiser->playback_size_samples * (g_nBitsPerSample >> 3));
-
- denoiser->rtStart = 0;
- denoiser->rtDuration = PLUGIN_AUDIO_DSP_MILLIS_TO_100NS(g_nFrameDuration); // milliseconds -> 100ns
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+
+ HRESULT hr = S_OK;
+ DMO_MEDIA_TYPE mt = {0};
+ PROPVARIANT var = {0};
+ IPropertyStore* pPropStore = NULL;
+
+ TSK_DEBUG_INFO("[MS Voice Capture DSP] AEC_ENABLED=%d ECHO_TAIL=%d,\nAGC_ENABLED=%d,\nNOISE_SUPP_ENABLED=%d,\nVAD_ENABLED=%d",
+ self->echo_supp_enabled, self->echo_tail,
+ self->agc_enabled,
+ self->noise_supp_enabled,
+ self->vad_enabled
+ );
+
+ if(denoiser->bOpened) {
+ TSK_DEBUG_ERROR("Denoiser already opened");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ CHECK_HR(hr = AudioDSPUtils::MoInitMediaType(
+ record_sampling_rate,
+ g_nBitsPerSample,
+ g_nChannles,
+ &mt));
+
+ CHECK_HR(hr = CoCreateInstance(CLSID_CWMAudioAEC, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&denoiser->pInst)));
+ CHECK_HR(hr = denoiser->pInst->QueryInterface(IID_PPV_ARGS(&pPropStore)));
+
+ // If the input format does not match the output format, the DMO automatically performs sample-rate conversion.
+ CHECK_HR(hr = denoiser->pInst->SetInputType(0, &mt, 0));
+ CHECK_HR(hr = denoiser->pInst->SetOutputType(0, &mt, 0));
+
+ // Enables the application to override the default settings on various properties of the Voice Capture DSP
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/ff819422(v=vs.85).aspx
+ var.vt = VT_BOOL;
+ var.boolVal = VARIANT_TRUE;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATURE_MODE, var));
+
+ // Switch to filter mode: http://msdn.microsoft.com/en-us/library/windows/desktop/ff819410(v=vs.85).aspx
+ var.vt = VT_BOOL;
+ var.boolVal = VARIANT_FALSE; /* VARIANT_FALSE: Filter, VARIANT_TRUE: Source */
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_DMO_SOURCE_MODE, var));
+
+ // Enable AEC
+ if(self->echo_supp_enabled) {
+ // Enable AEC: http://msdn.microsoft.com/en-us/library/windows/desktop/ff819427(v=vs.85).aspx
+ var.vt = VT_I4;
+ var.lVal = SINGLE_CHANNEL_AEC;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_SYSTEM_MODE, var));
+
+ // Echo Tail (milliseconds): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819414(v=vs.85).aspx
+ if(!self->echo_tail) {
+ self->echo_tail = tmedia_defaults_get_echo_tail();
+ }
+ var.vt = VT_I4;
+ var.lVal = self->echo_tail ? self->echo_tail : 256;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH, var));
+ }
+
+ // Automatic Gain Control (AGC): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819412(v=vs.85).aspx
+ var.vt = VT_BOOL;
+ var.boolVal = self->agc_enabled ? VARIANT_TRUE : VARIANT_FALSE;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_AGC, var));
+
+ // Noise suppression (NS): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819420(v=vs.85).aspx
+ var.vt = VT_I4;
+ var.lVal = self->noise_supp_enabled ? 1 : 0;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_NS, var));
+
+ // Automatic Gain Control (AGC): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819412(v=vs.85).aspx
+ var.vt = VT_BOOL;
+ var.boolVal = self->agc_enabled ? VARIANT_TRUE : VARIANT_FALSE;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_AGC, var));
+
+ // Voice Activity Detection (VAD): http://msdn.microsoft.com/en-us/library/windows/desktop/ff819421(v=vs.85).aspx
+ var.vt = VT_I4;
+ var.lVal = self->vad_enabled ? AEC_VAD_FOR_SILENCE_SUPPRESSION : AEC_VAD_DISABLED;
+ CHECK_HR(hr = pPropStore->SetValue(MFPKEY_WMAAECMA_FEATR_VAD, var));
+
+ // Recommended to allocate resources
+ CHECK_HR(hr = denoiser->pInst->AllocateStreamingResources()); // FIXME: returns E_FAIL
+
+ denoiser->record_channels = g_nChannles;
+ denoiser->record_size_samples = ((record_sampling_rate * g_nFrameDuration) / 1000) << (denoiser->record_channels == 2 ? 1 : 0);
+ denoiser->record_size_bytes = (denoiser->record_size_samples * (g_nBitsPerSample >> 3));
+
+ denoiser->playback_channels = g_nChannles;
+ denoiser->playback_size_samples = ((playback_sampling_rate * g_nFrameDuration) / 1000) << (denoiser->playback_channels == 2 ? 1 : 0);
+ denoiser->playback_size_bytes = (denoiser->playback_size_samples * (g_nBitsPerSample >> 3));
+
+ denoiser->rtStart = 0;
+ denoiser->rtDuration = PLUGIN_AUDIO_DSP_MILLIS_TO_100NS(g_nFrameDuration); // milliseconds -> 100ns
bail:
- denoiser->bOpened = SUCCEEDED(hr);
+ denoiser->bOpened = SUCCEEDED(hr);
- MoFreeMediaType(&mt);
- SafeRelease(&pPropStore);
+ MoFreeMediaType(&mt);
+ SafeRelease(&pPropStore);
- return denoiser->bOpened ? 0 : -1;
+ return denoiser->bOpened ? 0 : -1;
}
// playback = "stream 1"
// /!\Thread safety: could be called at the same time as plugin_audio_dsp_denoise_process_record()
static int plugin_audio_dsp_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+
+ HRESULT hr = S_OK;
- HRESULT hr = S_OK;
+ if(!self || !echo_frame || !echo_frame_size_bytes) {
+ CHECK_HR(hr = E_POINTER);
+ }
- if(!self || !echo_frame || !echo_frame_size_bytes)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!denoiser->bOpened) {
+ TSK_DEBUG_ERROR("Denoiser not opened");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(denoiser->record_size_bytes != echo_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_size_bytes, echo_frame_size_bytes);
+ CHECK_HR(hr = E_INVALIDARG);
+ }
- if(!denoiser->bOpened)
- {
- TSK_DEBUG_ERROR("Denoiser not opened");
- CHECK_HR(hr = E_FAIL);
- }
- if(denoiser->record_size_bytes != echo_frame_size_bytes)
- {
- TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_size_bytes, echo_frame_size_bytes);
- CHECK_HR(hr = E_INVALIDARG);
- }
-
-
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
@@ -246,97 +234,89 @@ bail:
// /!\Thread safety: could be called at the same time as plugin_audio_dsp_denoise_echo_playback()
static int plugin_audio_dsp_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
-
- HRESULT hr = S_OK;
- BYTE* pBufferInPtr = NULL;
- DWORD dwBufferInSize = 0;
-
- if(!self || !audio_frame || !audio_frame_size_bytes || !silence_or_noise)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!denoiser->bOpened)
- {
- TSK_DEBUG_ERROR("Denoiser not opened");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(denoiser->record_size_bytes != audio_frame_size_bytes)
- {
- TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_size_bytes, audio_frame_size_bytes);
- CHECK_HR(hr = E_INVALIDARG);
- }
-
- if(!denoiser->pBufferIn)
- {
- CHECK_HR(hr = AudioDSPMediaBuffer::Create(denoiser->record_size_bytes, &denoiser->pBufferIn));
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = denoiser->pBufferIn->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < denoiser->record_size_bytes)
- {
- SafeRelease(&denoiser->pBufferIn);
- CHECK_HR(hr = AudioDSPMediaBuffer::Create(denoiser->record_size_bytes, &denoiser->pBufferIn));
- }
- }
-
- // Get memory pointer to the input buffer
- CHECK_HR(hr = denoiser->pBufferIn->GetBufferAndLength(&pBufferInPtr, NULL));
- // Copy data
- dwBufferInSize = TSK_MIN(audio_frame_size_bytes, denoiser->record_size_bytes);
- memcpy(pBufferInPtr, audio_frame, dwBufferInSize);
- CHECK_HR(hr = denoiser->pBufferIn->SetLength(dwBufferInSize));
-
- // Process input
- hr = denoiser->pInst->ProcessInput(
- g_nMicrophoneStreamIndex,
- denoiser->pBufferIn,
- (/*DMO_INPUT_DATA_BUFFERF_TIME | DMO_INPUT_DATA_BUFFERF_TIMELENGTH*/0),
- denoiser->rtStart,
- denoiser->rtDuration);
- if(hr == DMO_E_NOTACCEPTING)
- {
- hr = S_OK;
- }
- CHECK_HR(hr);
-
- denoiser->rtStart += denoiser->rtDuration;
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+
+ HRESULT hr = S_OK;
+ BYTE* pBufferInPtr = NULL;
+ DWORD dwBufferInSize = 0;
+
+ if(!self || !audio_frame || !audio_frame_size_bytes || !silence_or_noise) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!denoiser->bOpened) {
+ TSK_DEBUG_ERROR("Denoiser not opened");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(denoiser->record_size_bytes != audio_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_size_bytes, audio_frame_size_bytes);
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+
+ if(!denoiser->pBufferIn) {
+ CHECK_HR(hr = AudioDSPMediaBuffer::Create(denoiser->record_size_bytes, &denoiser->pBufferIn));
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = denoiser->pBufferIn->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < denoiser->record_size_bytes) {
+ SafeRelease(&denoiser->pBufferIn);
+ CHECK_HR(hr = AudioDSPMediaBuffer::Create(denoiser->record_size_bytes, &denoiser->pBufferIn));
+ }
+ }
+
+ // Get memory pointer to the input buffer
+ CHECK_HR(hr = denoiser->pBufferIn->GetBufferAndLength(&pBufferInPtr, NULL));
+ // Copy data
+ dwBufferInSize = TSK_MIN(audio_frame_size_bytes, denoiser->record_size_bytes);
+ memcpy(pBufferInPtr, audio_frame, dwBufferInSize);
+ CHECK_HR(hr = denoiser->pBufferIn->SetLength(dwBufferInSize));
+
+ // Process input
+ hr = denoiser->pInst->ProcessInput(
+ g_nMicrophoneStreamIndex,
+ denoiser->pBufferIn,
+ (/*DMO_INPUT_DATA_BUFFERF_TIME | DMO_INPUT_DATA_BUFFERF_TIMELENGTH*/0),
+ denoiser->rtStart,
+ denoiser->rtDuration);
+ if(hr == DMO_E_NOTACCEPTING) {
+ hr = S_OK;
+ }
+ CHECK_HR(hr);
+
+ denoiser->rtStart += denoiser->rtDuration;
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_audio_dsp_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
-
- (void)(denoiser);
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+
+ (void)(denoiser);
- // Not mandatory to denoise audio before playback.
- // All Doubango clients support noise suppression.
- return 0;
+ // Not mandatory to denoise audio before playback.
+ // All Doubango clients support noise suppression.
+ return 0;
}
static int plugin_audio_dsp_denoise_close(tmedia_denoise_t* self)
{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
-
- if(!self)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- denoiser->bOpened = false;
- SafeRelease(&denoiser->pBufferIn);
- SafeRelease(&denoiser->pBufferOut);
- SafeRelease(&denoiser->pInst);
- return 0;
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t *)self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ denoiser->bOpened = false;
+ SafeRelease(&denoiser->pBufferIn);
+ SafeRelease(&denoiser->pBufferOut);
+ SafeRelease(&denoiser->pInst);
+ return 0;
}
@@ -348,55 +328,51 @@ static int plugin_audio_dsp_denoise_close(tmedia_denoise_t* self)
/* constructor */
static tsk_object_t* plugin_audio_dsp_denoise_ctor(tsk_object_t * self, va_list * app)
{
- plugin_audio_dsp_denoise_t *denoise = (plugin_audio_dsp_denoise_t*)self;
- if(denoise)
- {
- AudioDSPUtils::Startup();
-
- /* init base */
- tmedia_denoise_init(TMEDIA_DENOISE(denoise));
- /* init self */
- }
- return self;
+ plugin_audio_dsp_denoise_t *denoise = (plugin_audio_dsp_denoise_t*)self;
+ if(denoise) {
+ AudioDSPUtils::Startup();
+
+ /* init base */
+ tmedia_denoise_init(TMEDIA_DENOISE(denoise));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_audio_dsp_denoise_dtor(tsk_object_t * self)
-{
- plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t*)self;
- if(denoiser)
- {
- /* deinit base */
- tmedia_denoise_deinit(TMEDIA_DENOISE(denoiser));
- /* deinit self */
- SafeRelease(&denoiser->pBufferIn);
- SafeRelease(&denoiser->pBufferOut);
- SafeRelease(&denoiser->pInst);
-
- TSK_DEBUG_INFO("*** MS Voice Capture DSP destroyed ***");
- }
-
- return self;
+{
+ plugin_audio_dsp_denoise_t *denoiser = (plugin_audio_dsp_denoise_t*)self;
+ if(denoiser) {
+ /* deinit base */
+ tmedia_denoise_deinit(TMEDIA_DENOISE(denoiser));
+ /* deinit self */
+ SafeRelease(&denoiser->pBufferIn);
+ SafeRelease(&denoiser->pBufferOut);
+ SafeRelease(&denoiser->pInst);
+
+ TSK_DEBUG_INFO("*** MS Voice Capture DSP destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_audio_dsp_denoise_def_s =
-{
- sizeof(plugin_audio_dsp_denoise_t),
- plugin_audio_dsp_denoise_ctor,
- plugin_audio_dsp_denoise_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_audio_dsp_denoise_def_s = {
+ sizeof(plugin_audio_dsp_denoise_t),
+ plugin_audio_dsp_denoise_ctor,
+ plugin_audio_dsp_denoise_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_denoise_plugin_def_t plugin_audio_dsp_denoise_plugin_def_s =
-{
- &plugin_audio_dsp_denoise_def_s,
+static const tmedia_denoise_plugin_def_t plugin_audio_dsp_denoise_plugin_def_s = {
+ &plugin_audio_dsp_denoise_def_s,
- "MS Voice Capture DSP", /* http://msdn.microsoft.com/en-us/library/windows/desktop/ff819492(v=vs.85).aspx */
+ "MS Voice Capture DSP", /* http://msdn.microsoft.com/en-us/library/windows/desktop/ff819492(v=vs.85).aspx */
- plugin_audio_dsp_denoise_set,
- plugin_audio_dsp_denoise_open,
- plugin_audio_dsp_denoise_echo_playback,
- plugin_audio_dsp_denoise_process_record,
- plugin_audio_dsp_denoise_process_playback,
- plugin_audio_dsp_denoise_close,
+ plugin_audio_dsp_denoise_set,
+ plugin_audio_dsp_denoise_open,
+ plugin_audio_dsp_denoise_echo_playback,
+ plugin_audio_dsp_denoise_process_record,
+ plugin_audio_dsp_denoise_process_playback,
+ plugin_audio_dsp_denoise_close,
};
const tmedia_denoise_plugin_def_t *plugin_audio_dsp_denoise_plugin_def_t = &plugin_audio_dsp_denoise_plugin_def_s;
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.cxx b/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.cxx
index 34e5b4d..b4a1726 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.cxx
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,48 +25,42 @@ AudioDSPMediaBuffer::AudioDSPMediaBuffer(DWORD cbMaxLength, HRESULT& hr) :
m_pbData(NULL)
{
m_pbData = new BYTE[cbMaxLength];
- if (!m_pbData)
- {
+ if (!m_pbData) {
hr = E_OUTOFMEMORY;
}
}
AudioDSPMediaBuffer::~AudioDSPMediaBuffer()
{
- if (m_pbData)
- {
+ if (m_pbData) {
delete [] m_pbData;
}
}
-// Function to create a new IMediaBuffer object and return
+// Function to create a new IMediaBuffer object and return
// an AddRef'd interface pointer.
HRESULT AudioDSPMediaBuffer::Create(long cbMaxLen, IMediaBuffer **ppBuffer)
{
HRESULT hr = S_OK;
AudioDSPMediaBuffer *pBuffer = NULL;
- if (ppBuffer == NULL)
- {
+ if (ppBuffer == NULL) {
return E_POINTER;
}
pBuffer = new AudioDSPMediaBuffer(cbMaxLen, hr);
- if (pBuffer == NULL)
- {
+ if (pBuffer == NULL) {
hr = E_OUTOFMEMORY;
}
- if (SUCCEEDED(hr))
- {
- *ppBuffer = pBuffer;
- (*ppBuffer)->AddRef();
+ if (SUCCEEDED(hr)) {
+ *ppBuffer = pBuffer;
+ (*ppBuffer)->AddRef();
}
- if (pBuffer)
- {
+ if (pBuffer) {
pBuffer->Release();
}
return hr;
@@ -75,18 +69,15 @@ HRESULT AudioDSPMediaBuffer::Create(long cbMaxLen, IMediaBuffer **ppBuffer)
// IUnknown methods.
STDMETHODIMP AudioDSPMediaBuffer::QueryInterface(REFIID riid, void **ppv)
{
- if (ppv == NULL)
- {
+ if (ppv == NULL) {
return E_POINTER;
}
- else if (riid == IID_IMediaBuffer || riid == IID_IUnknown)
- {
+ else if (riid == IID_IMediaBuffer || riid == IID_IUnknown) {
*ppv = static_cast<IMediaBuffer *>(this);
AddRef();
return S_OK;
}
- else
- {
+ else {
*ppv = NULL;
return E_NOINTERFACE;
}
@@ -100,19 +91,17 @@ STDMETHODIMP_(ULONG) AudioDSPMediaBuffer::AddRef()
STDMETHODIMP_(ULONG) AudioDSPMediaBuffer::Release()
{
LONG lRef = InterlockedDecrement(&m_nRefCount);
- if (lRef == 0)
- {
+ if (lRef == 0) {
delete this;
// m_cRef is no longer valid! Return lRef.
}
- return lRef;
+ return lRef;
}
// IMediaBuffer methods.
STDMETHODIMP AudioDSPMediaBuffer::SetLength(DWORD cbLength)
{
- if (cbLength > m_cbMaxLength)
- {
+ if (cbLength > m_cbMaxLength) {
return E_INVALIDARG;
}
m_cbLength = cbLength;
@@ -121,8 +110,7 @@ STDMETHODIMP AudioDSPMediaBuffer::SetLength(DWORD cbLength)
STDMETHODIMP AudioDSPMediaBuffer::GetMaxLength(DWORD *pcbMaxLength)
{
- if (pcbMaxLength == NULL)
- {
+ if (pcbMaxLength == NULL) {
return E_POINTER;
}
*pcbMaxLength = m_cbMaxLength;
@@ -132,16 +120,13 @@ STDMETHODIMP AudioDSPMediaBuffer::GetMaxLength(DWORD *pcbMaxLength)
STDMETHODIMP AudioDSPMediaBuffer::GetBufferAndLength(BYTE **ppbBuffer, DWORD *pcbLength)
{
// Either parameter can be NULL, but not both.
- if (ppbBuffer == NULL && pcbLength == NULL)
- {
+ if (ppbBuffer == NULL && pcbLength == NULL) {
return E_POINTER;
}
- if (ppbBuffer)
- {
+ if (ppbBuffer) {
*ppbBuffer = m_pbData;
}
- if (pcbLength)
- {
+ if (pcbLength) {
*pcbLength = m_cbLength;
}
return S_OK;
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.h b/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.h
index a8d603b..486c273 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.h
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_mediabuffer.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -34,7 +34,7 @@ private:
AudioDSPMediaBuffer(DWORD cbMaxLength, HRESULT& hr);
~AudioDSPMediaBuffer();
-public:
+public:
static HRESULT Create(long cbMaxLen, IMediaBuffer **ppBuffer);
// IUnknown methods.
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_resampler.cxx b/plugins/pluginWinAudioDSP/plugin_audio_dsp_resampler.cxx
index 3e5a291..4fe636f 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_resampler.cxx
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_resampler.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -37,268 +37,246 @@
static const UINT32 g_nBitsPerSample = 16;
static HRESULT ProcessOutput(struct plugin_audio_dsp_resampler_s *resampler, IMFSample **ppSample);
-typedef struct plugin_audio_dsp_resampler_s
-{
- TMEDIA_DECLARE_RESAMPLER;
-
- bool bOpened;
-
- tsk_size_t in_size_samples;
- tsk_size_t in_size_bytes;
- tsk_size_t out_size_samples;
- tsk_size_t out_size_bytes;
- uint32_t in_channels;
- uint32_t out_channels;
-
- LONGLONG rtStart;
+typedef struct plugin_audio_dsp_resampler_s {
+ TMEDIA_DECLARE_RESAMPLER;
+
+ bool bOpened;
+
+ tsk_size_t in_size_samples;
+ tsk_size_t in_size_bytes;
+ tsk_size_t out_size_samples;
+ tsk_size_t out_size_bytes;
+ uint32_t in_channels;
+ uint32_t out_channels;
+
+ LONGLONG rtStart;
UINT64 rtDuration;
-
- IMFTransform* pMFT;
- IMFSample *pSampleIn;
- IMFSample *pSampleOut;
+
+ IMFTransform* pMFT;
+ IMFSample *pSampleIn;
+ IMFSample *pSampleOut;
}
plugin_audio_dsp_resampler_t;
// Doubango engine uses quality from [1 - 10].
static int plugin_audio_dsp_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality)
{
- plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
-
- IMFMediaType* pTypeIn = NULL;
- IMFMediaType* pTypeOut = NULL;
- IWMResamplerProps* pProps = NULL;
- HRESULT hr = S_OK;
-
- if(in_channels != 1 && in_channels != 2)
- {
- TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
- CHECK_HR(hr = E_INVALIDARG);
- }
- if(out_channels != 1 && out_channels != 2)
- {
- TSK_DEBUG_ERROR("%d not valid as output channel", out_channels);
- CHECK_HR(hr = E_INVALIDARG);
- }
-
- if(resampler->bOpened)
- {
- TSK_DEBUG_ERROR("Resampler already opened");
- CHECK_HR(hr = E_FAIL);
- }
-
- resampler->in_size_samples = ((in_freq * frame_duration) / 1000) << (in_channels == 2 ? 1 : 0);
- resampler->out_size_samples = ((out_freq * frame_duration) / 1000) << (out_channels == 2 ? 1 : 0);
- resampler->in_channels = in_channels;
- resampler->out_channels = out_channels;
-
- resampler->in_size_bytes = (resampler->in_size_samples * (g_nBitsPerSample >> 3));
- resampler->out_size_bytes = (resampler->out_size_samples * (g_nBitsPerSample >> 3));
-
- resampler->rtStart = 0;
- resampler->rtDuration = PLUGIN_AUDIO_DSP_MILLIS_TO_100NS(frame_duration); // milliseconds -> 100ns
-
- CHECK_HR(hr = CoCreateInstance(CLSID_CResamplerMediaObject, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&resampler->pMFT)));
-
- CHECK_HR(hr = AudioDSPUtils::CreatePCMAudioType(in_freq, g_nBitsPerSample, in_channels, &pTypeIn));
- CHECK_HR(hr = AudioDSPUtils::CreatePCMAudioType(out_freq, g_nBitsPerSample, out_channels, &pTypeOut));
-
- CHECK_HR(hr = resampler->pMFT->SetInputType(0, pTypeIn, 0));
- CHECK_HR(hr = resampler->pMFT->SetOutputType(0, pTypeOut, 0));
-
- CHECK_HR(hr = resampler->pMFT->QueryInterface(IID_PPV_ARGS(&pProps)));
+ plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
+
+ IMFMediaType* pTypeIn = NULL;
+ IMFMediaType* pTypeOut = NULL;
+ IWMResamplerProps* pProps = NULL;
+ HRESULT hr = S_OK;
+
+ if(in_channels != 1 && in_channels != 2) {
+ TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+ if(out_channels != 1 && out_channels != 2) {
+ TSK_DEBUG_ERROR("%d not valid as output channel", out_channels);
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+
+ if(resampler->bOpened) {
+ TSK_DEBUG_ERROR("Resampler already opened");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ resampler->in_size_samples = ((in_freq * frame_duration) / 1000) << (in_channels == 2 ? 1 : 0);
+ resampler->out_size_samples = ((out_freq * frame_duration) / 1000) << (out_channels == 2 ? 1 : 0);
+ resampler->in_channels = in_channels;
+ resampler->out_channels = out_channels;
+
+ resampler->in_size_bytes = (resampler->in_size_samples * (g_nBitsPerSample >> 3));
+ resampler->out_size_bytes = (resampler->out_size_samples * (g_nBitsPerSample >> 3));
+
+ resampler->rtStart = 0;
+ resampler->rtDuration = PLUGIN_AUDIO_DSP_MILLIS_TO_100NS(frame_duration); // milliseconds -> 100ns
+
+ CHECK_HR(hr = CoCreateInstance(CLSID_CResamplerMediaObject, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&resampler->pMFT)));
+
+ CHECK_HR(hr = AudioDSPUtils::CreatePCMAudioType(in_freq, g_nBitsPerSample, in_channels, &pTypeIn));
+ CHECK_HR(hr = AudioDSPUtils::CreatePCMAudioType(out_freq, g_nBitsPerSample, out_channels, &pTypeOut));
+
+ CHECK_HR(hr = resampler->pMFT->SetInputType(0, pTypeIn, 0));
+ CHECK_HR(hr = resampler->pMFT->SetOutputType(0, pTypeOut, 0));
+
+ CHECK_HR(hr = resampler->pMFT->QueryInterface(IID_PPV_ARGS(&pProps)));
CHECK_HR(hr = pProps->SetHalfFilterLength((quality * PLUGIN_AUDIO_DSP_RESAMPLER_MAX_QUALITY) / 10)); // [1 - 10] -> [1 - 60]
- CHECK_HR(hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_COMMAND_FLUSH, NULL));
+ CHECK_HR(hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_COMMAND_FLUSH, NULL));
CHECK_HR(hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, NULL));
CHECK_HR(hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, NULL));
bail:
- resampler->bOpened = SUCCEEDED(hr);
- if(!resampler->bOpened)
- {
- SafeRelease(&resampler->pMFT);
- }
- SafeRelease(&pTypeIn);
- SafeRelease(&pTypeOut);
- SafeRelease(&pProps);
- return resampler->bOpened ? 0 : -1;
+ resampler->bOpened = SUCCEEDED(hr);
+ if(!resampler->bOpened) {
+ SafeRelease(&resampler->pMFT);
+ }
+ SafeRelease(&pTypeIn);
+ SafeRelease(&pTypeOut);
+ SafeRelease(&pProps);
+ return resampler->bOpened ? 0 : -1;
}
static tsk_size_t plugin_audio_dsp_resampler_process(tmedia_resampler_t* self, const uint16_t* in_data, tsk_size_t in_size, uint16_t* out_data, tsk_size_t out_size)
{
- plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
-
- HRESULT hr = S_OK;
- tsk_size_t retSize = 0;
-
- if(!resampler || !out_data)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!resampler->bOpened)
- {
- TSK_DEBUG_ERROR("Resampler not opened");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(in_size != resampler->in_size_samples)
- {
- TSK_DEBUG_ERROR("Input data has wrong size");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(out_size < resampler->out_size_samples)
- {
- TSK_DEBUG_ERROR("Output data is too short");
- CHECK_HR(hr = E_FAIL);
- }
-
- IMFMediaBuffer* pBufferIn = NULL;
- IMFMediaBuffer* pBufferOut = NULL;
- IMFSample *pSampleOut = NULL;
- BYTE* pBufferPtr = NULL;
-
- if(!resampler->pSampleIn)
- {
- CHECK_HR(hr = AudioDSPUtils::CreateMediaSample(resampler->in_size_bytes, &resampler->pSampleIn));
- hr = resampler->pSampleIn->GetBufferByIndex(0, &pBufferIn);
- if(FAILED(hr))
- {
- SafeRelease(&resampler->pSampleIn);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = resampler->pSampleIn->GetBufferByIndex(0, &pBufferIn));
- CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < resampler->in_size_bytes)
- {
- CHECK_HR(hr = resampler->pSampleIn->RemoveAllBuffers());
- SafeRelease(&pBufferIn);
- CHECK_HR(hr = MFCreateMemoryBuffer(resampler->in_size_bytes, &pBufferIn));
- CHECK_HR(hr = resampler->pSampleIn->AddBuffer(pBufferIn));
- }
- }
-
- CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
- memcpy(pBufferPtr, in_data, resampler->in_size_bytes);
- CHECK_HR(hr = pBufferIn->Unlock());
- CHECK_HR(hr = pBufferIn->SetCurrentLength(resampler->in_size_bytes));
-
- CHECK_HR(hr = resampler->pSampleIn->SetSampleDuration(resampler->rtDuration));
- CHECK_HR(hr = resampler->pSampleIn->SetSampleTime(resampler->rtStart));
-
- // Process input
- hr = resampler->pMFT->ProcessInput(0, resampler->pSampleIn, 0);
- if(hr == MF_E_NOTACCEPTING)
- {
- hr = S_OK;
- }
- CHECK_HR(hr);
-
- resampler->rtStart += resampler->rtDuration;
-
- // Process output
- CHECK_HR(hr = ProcessOutput(resampler, &pSampleOut));
- if(pSampleOut)
- {
- CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
-
- BYTE* pBufferOutPtr = NULL;
- DWORD dwDataLength = 0;
- CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
- //if(dwDataLength == resampler->out_size_bytes)
- {
- CHECK_HR(hr = pBufferOut->Lock(&pBufferOutPtr, NULL, NULL));
- {
- memcpy(out_data, pBufferOutPtr, TSK_MIN(dwDataLength, resampler->out_size_bytes));
- if(dwDataLength < resampler->out_size_bytes)
- {
- TSK_DEBUG_INFO("[MS Resampler DSP] Output too short filling with silence");
- memset(&((uint8_t*)out_data)[dwDataLength], 0, (resampler->out_size_bytes - dwDataLength));
- }
- retSize = (tsk_size_t)resampler->out_size_bytes;
- }
- CHECK_HR(hr = pBufferOut->Unlock());
- }
- }
-
-
+ plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
+
+ HRESULT hr = S_OK;
+ tsk_size_t retSize = 0;
+
+ if(!resampler || !out_data) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!resampler->bOpened) {
+ TSK_DEBUG_ERROR("Resampler not opened");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(in_size != resampler->in_size_samples) {
+ TSK_DEBUG_ERROR("Input data has wrong size");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(out_size < resampler->out_size_samples) {
+ TSK_DEBUG_ERROR("Output data is too short");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ IMFMediaBuffer* pBufferIn = NULL;
+ IMFMediaBuffer* pBufferOut = NULL;
+ IMFSample *pSampleOut = NULL;
+ BYTE* pBufferPtr = NULL;
+
+ if(!resampler->pSampleIn) {
+ CHECK_HR(hr = AudioDSPUtils::CreateMediaSample(resampler->in_size_bytes, &resampler->pSampleIn));
+ hr = resampler->pSampleIn->GetBufferByIndex(0, &pBufferIn);
+ if(FAILED(hr)) {
+ SafeRelease(&resampler->pSampleIn);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = resampler->pSampleIn->GetBufferByIndex(0, &pBufferIn));
+ CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < resampler->in_size_bytes) {
+ CHECK_HR(hr = resampler->pSampleIn->RemoveAllBuffers());
+ SafeRelease(&pBufferIn);
+ CHECK_HR(hr = MFCreateMemoryBuffer(resampler->in_size_bytes, &pBufferIn));
+ CHECK_HR(hr = resampler->pSampleIn->AddBuffer(pBufferIn));
+ }
+ }
+
+ CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
+ memcpy(pBufferPtr, in_data, resampler->in_size_bytes);
+ CHECK_HR(hr = pBufferIn->Unlock());
+ CHECK_HR(hr = pBufferIn->SetCurrentLength(resampler->in_size_bytes));
+
+ CHECK_HR(hr = resampler->pSampleIn->SetSampleDuration(resampler->rtDuration));
+ CHECK_HR(hr = resampler->pSampleIn->SetSampleTime(resampler->rtStart));
+
+ // Process input
+ hr = resampler->pMFT->ProcessInput(0, resampler->pSampleIn, 0);
+ if(hr == MF_E_NOTACCEPTING) {
+ hr = S_OK;
+ }
+ CHECK_HR(hr);
+
+ resampler->rtStart += resampler->rtDuration;
+
+ // Process output
+ CHECK_HR(hr = ProcessOutput(resampler, &pSampleOut));
+ if(pSampleOut) {
+ CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
+
+ BYTE* pBufferOutPtr = NULL;
+ DWORD dwDataLength = 0;
+ CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
+ //if(dwDataLength == resampler->out_size_bytes)
+ {
+ CHECK_HR(hr = pBufferOut->Lock(&pBufferOutPtr, NULL, NULL));
+ {
+ memcpy(out_data, pBufferOutPtr, TSK_MIN(dwDataLength, resampler->out_size_bytes));
+ if(dwDataLength < resampler->out_size_bytes) {
+ TSK_DEBUG_INFO("[MS Resampler DSP] Output too short filling with silence");
+ memset(&((uint8_t*)out_data)[dwDataLength], 0, (resampler->out_size_bytes - dwDataLength));
+ }
+ retSize = (tsk_size_t)resampler->out_size_bytes;
+ }
+ CHECK_HR(hr = pBufferOut->Unlock());
+ }
+ }
+
+
bail:
- SafeRelease(&pBufferIn);
- SafeRelease(&pBufferOut);
- SafeRelease(&pSampleOut);
-
- return retSize;
+ SafeRelease(&pBufferIn);
+ SafeRelease(&pBufferOut);
+ SafeRelease(&pSampleOut);
+
+ return retSize;
}
static int plugin_audio_dsp_resampler_close(tmedia_resampler_t* self)
{
- plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
+ plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
+
+ if(resampler->pMFT) {
+ hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, NULL);
+ }
- if(resampler->pMFT)
- {
- hr = resampler->pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, NULL);
- }
+ SafeRelease(&resampler->pMFT);
+ SafeRelease(&resampler->pSampleIn);
+ SafeRelease(&resampler->pSampleOut);
- SafeRelease(&resampler->pMFT);
- SafeRelease(&resampler->pSampleIn);
- SafeRelease(&resampler->pSampleOut);
+ resampler->bOpened = false;
- resampler->bOpened = false;
-
- return 0;
+ return 0;
}
static HRESULT ProcessOutput(plugin_audio_dsp_resampler_t *resampler, IMFSample **ppSample)
{
- *ppSample = NULL;
+ *ppSample = NULL;
IMFMediaBuffer* pBufferOut = NULL;
DWORD dwStatus;
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
MFT_OUTPUT_DATA_BUFFER mftOutputData = { 0 };
- if(!resampler || !ppSample)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!resampler->pSampleOut)
- {
- CHECK_HR(hr = AudioDSPUtils::CreateMediaSample(resampler->out_size_bytes, &resampler->pSampleOut));
- hr = resampler->pSampleOut->GetBufferByIndex(0, &pBufferOut);
- if(FAILED(hr))
- {
- SafeRelease(&resampler->pSampleOut);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = resampler->pSampleOut->GetBufferByIndex(0, &pBufferOut));
- CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < resampler->out_size_bytes)
- {
- CHECK_HR(hr = resampler->pSampleOut->RemoveAllBuffers());
- SafeRelease(&pBufferOut);
- CHECK_HR(hr = MFCreateMemoryBuffer(resampler->out_size_bytes, &pBufferOut));
- CHECK_HR(hr = resampler->pSampleOut->AddBuffer(pBufferOut));
- }
- }
-
- CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
-
+ if(!resampler || !ppSample) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!resampler->pSampleOut) {
+ CHECK_HR(hr = AudioDSPUtils::CreateMediaSample(resampler->out_size_bytes, &resampler->pSampleOut));
+ hr = resampler->pSampleOut->GetBufferByIndex(0, &pBufferOut);
+ if(FAILED(hr)) {
+ SafeRelease(&resampler->pSampleOut);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = resampler->pSampleOut->GetBufferByIndex(0, &pBufferOut));
+ CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < resampler->out_size_bytes) {
+ CHECK_HR(hr = resampler->pSampleOut->RemoveAllBuffers());
+ SafeRelease(&pBufferOut);
+ CHECK_HR(hr = MFCreateMemoryBuffer(resampler->out_size_bytes, &pBufferOut));
+ CHECK_HR(hr = resampler->pSampleOut->AddBuffer(pBufferOut));
+ }
+ }
+
+ CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
+
//Set the output sample
mftOutputData.pSample = resampler->pSampleOut;
//Set the output id
@@ -306,16 +284,14 @@ static HRESULT ProcessOutput(plugin_audio_dsp_resampler_t *resampler, IMFSample
//Generate the output sample
hr = resampler->pMFT->ProcessOutput(0, 1, &mftOutputData, &dwStatus);
- if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
- {
+ if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) {
hr = S_OK;
goto bail;
}
// TODO: Handle MF_E_TRANSFORM_STREAM_CHANGE
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
goto bail;
}
@@ -336,53 +312,49 @@ bail:
/* constructor */
static tsk_object_t* plugin_audio_dsp_resampler_ctor(tsk_object_t * self, va_list * app)
{
- plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
- if(resampler)
- {
- AudioDSPUtils::Startup();
-
- /* init base */
- tmedia_resampler_init(TMEDIA_RESAMPLER(resampler));
- /* init self */
- }
- return self;
+ plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
+ if(resampler) {
+ AudioDSPUtils::Startup();
+
+ /* init base */
+ tmedia_resampler_init(TMEDIA_RESAMPLER(resampler));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_audio_dsp_resampler_dtor(tsk_object_t * self)
-{
- plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
- if(resampler)
- {
- /* deinit base */
- tmedia_resampler_deinit(TMEDIA_RESAMPLER(resampler));
- /* deinit self */
- // tmedia_resampler_deinit() already closed the resampler and freed the resources...but do it again
- SafeRelease(&resampler->pMFT);
- SafeRelease(&resampler->pSampleIn);
- SafeRelease(&resampler->pSampleOut);
-
- TSK_DEBUG_INFO("*** MS Audio Resampler DSP (plugin) destroyed ***");
- }
-
- return self;
+{
+ plugin_audio_dsp_resampler_t *resampler = (plugin_audio_dsp_resampler_t *)self;
+ if(resampler) {
+ /* deinit base */
+ tmedia_resampler_deinit(TMEDIA_RESAMPLER(resampler));
+ /* deinit self */
+ // tmedia_resampler_deinit() already closed the resampler and freed the resources...but do it again
+ SafeRelease(&resampler->pMFT);
+ SafeRelease(&resampler->pSampleIn);
+ SafeRelease(&resampler->pSampleOut);
+
+ TSK_DEBUG_INFO("*** MS Audio Resampler DSP (plugin) destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_audio_dsp_resampler_def_s =
-{
- sizeof(plugin_audio_dsp_resampler_t),
- plugin_audio_dsp_resampler_ctor,
- plugin_audio_dsp_resampler_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_audio_dsp_resampler_def_s = {
+ sizeof(plugin_audio_dsp_resampler_t),
+ plugin_audio_dsp_resampler_ctor,
+ plugin_audio_dsp_resampler_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_resampler_plugin_def_t plugin_audio_dsp_resampler_plugin_def_s =
-{
- &plugin_audio_dsp_resampler_def_s,
-
- "MS Audio Resampler DSP", /* http://msdn.microsoft.com/en-us/library/windows/desktop/ff819070(v=vs.85).aspx */
-
- plugin_audio_dsp_resampler_open,
- plugin_audio_dsp_resampler_process,
- plugin_audio_dsp_resampler_close,
+static const tmedia_resampler_plugin_def_t plugin_audio_dsp_resampler_plugin_def_s = {
+ &plugin_audio_dsp_resampler_def_s,
+
+ "MS Audio Resampler DSP", /* http://msdn.microsoft.com/en-us/library/windows/desktop/ff819070(v=vs.85).aspx */
+
+ plugin_audio_dsp_resampler_open,
+ plugin_audio_dsp_resampler_process,
+ plugin_audio_dsp_resampler_close,
};
const tmedia_resampler_plugin_def_t *plugin_audio_dsp_resampler_plugin_def_t = &plugin_audio_dsp_resampler_plugin_def_s;
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.cxx b/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.cxx
index 67cf3cf..d549336 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.cxx
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,22 +28,20 @@ bool AudioDSPUtils::g_bStarted = false;
HRESULT AudioDSPUtils::Startup()
{
- if(!g_bStarted)
- {
- HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
- if(SUCCEEDED(hr) || hr == 0x80010106) // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
- {
- hr = MFStartup(MF_VERSION);
- }
- g_bStarted = SUCCEEDED(hr);
- return hr;
- }
- return S_OK;
+ if(!g_bStarted) {
+ HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if(SUCCEEDED(hr) || hr == 0x80010106) { // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
+ hr = MFStartup(MF_VERSION);
+ }
+ g_bStarted = SUCCEEDED(hr);
+ return hr;
+ }
+ return S_OK;
}
HRESULT AudioDSPUtils::Shutdown()
{
- return S_OK;
+ return S_OK;
}
HRESULT AudioDSPUtils::CreatePCMAudioType(
@@ -51,7 +49,7 @@ HRESULT AudioDSPUtils::CreatePCMAudioType(
UINT32 bitsPerSample, // Bits per sample
UINT32 cChannels, // Number of channels
IMFMediaType **ppType // Receives a pointer to the media type.
- )
+)
{
HRESULT hr = S_OK;
@@ -62,27 +60,27 @@ HRESULT AudioDSPUtils::CreatePCMAudioType(
UINT32 bytesPerSecond = blockAlign * sampleRate;
// Create the empty media type.
- CHECK_HR(hr = MFCreateMediaType(&pType));
+ CHECK_HR(hr = MFCreateMediaType(&pType));
// Set attributes on the type.
CHECK_HR(hr = pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio));
-
- CHECK_HR(hr = pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, cChannels));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, sampleRate));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, blockAlign));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, bytesPerSecond));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, bitsPerSample));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE));
-
- CHECK_HR(hr = pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE));
-
+
+ CHECK_HR(hr = pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, cChannels));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, sampleRate));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, blockAlign));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, bytesPerSecond));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, bitsPerSample));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE));
+
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE));
+
*ppType = pType;
(*ppType)->AddRef();
@@ -92,24 +90,23 @@ bail:
}
HRESULT AudioDSPUtils::CreateMediaSample(
- DWORD cbData, // Maximum buffer size
- IMFSample **ppSample // Receives the sample
+ DWORD cbData, // Maximum buffer size
+ IMFSample **ppSample // Receives the sample
)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if(!ppSample)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!ppSample) {
+ CHECK_HR(hr = E_POINTER);
+ }
IMFSample *pSample = NULL;
IMFMediaBuffer *pBuffer = NULL;
- CHECK_HR(hr = MFCreateSample(&pSample));
- CHECK_HR(hr = MFCreateMemoryBuffer(cbData, &pBuffer));
+ CHECK_HR(hr = MFCreateSample(&pSample));
+ CHECK_HR(hr = MFCreateMemoryBuffer(cbData, &pBuffer));
CHECK_HR(hr = pSample->AddBuffer(pBuffer));
-
+
*ppSample = pSample;
(*ppSample)->AddRef();
@@ -120,38 +117,37 @@ bail:
}
HRESULT AudioDSPUtils::MoInitMediaType(
- UINT32 sampleRate, // Samples per second
- UINT32 bitsPerSample, // Bits per sample
- UINT32 cChannels, // Number of channels
- DMO_MEDIA_TYPE *pType // The media type to initialize. Must be freed using MoFreeMediaType.
- )
+ UINT32 sampleRate, // Samples per second
+ UINT32 bitsPerSample, // Bits per sample
+ UINT32 cChannels, // Number of channels
+ DMO_MEDIA_TYPE *pType // The media type to initialize. Must be freed using MoFreeMediaType.
+)
{
- HRESULT hr = S_OK;
- WAVEFORMATEX *pWAV = NULL;
+ HRESULT hr = S_OK;
+ WAVEFORMATEX *pWAV = NULL;
- if(!pType)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!pType) {
+ CHECK_HR(hr = E_POINTER);
+ }
- pType->majortype = MEDIATYPE_Audio;
- pType->subtype = MEDIASUBTYPE_PCM;
- pType->lSampleSize = 0;
- pType->bFixedSizeSamples = TRUE;
- pType->bTemporalCompression = FALSE;
- pType->formattype = FORMAT_WaveFormatEx;
+ pType->majortype = MEDIATYPE_Audio;
+ pType->subtype = MEDIASUBTYPE_PCM;
+ pType->lSampleSize = 0;
+ pType->bFixedSizeSamples = TRUE;
+ pType->bTemporalCompression = FALSE;
+ pType->formattype = FORMAT_WaveFormatEx;
- CHECK_HR(hr = ::MoInitMediaType(pType, sizeof(WAVEFORMATEX)));
+ CHECK_HR(hr = ::MoInitMediaType(pType, sizeof(WAVEFORMATEX)));
- pWAV = (WAVEFORMATEX*)pType->pbFormat;
+ pWAV = (WAVEFORMATEX*)pType->pbFormat;
pWAV->wFormatTag = WAVE_FORMAT_PCM;
pWAV->nChannels = 1;
pWAV->nSamplesPerSec = sampleRate;
- pWAV->nBlockAlign = cChannels * (bitsPerSample >> 3);
+ pWAV->nBlockAlign = cChannels * (bitsPerSample >> 3);
pWAV->nAvgBytesPerSec = pWAV->nBlockAlign * pWAV->nSamplesPerSec;
pWAV->wBitsPerSample = bitsPerSample;
pWAV->cbSize = 0;
bail:
- return hr;
+ return hr;
}
diff --git a/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.h b/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.h
index 7daff31..b2236f2 100755
--- a/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.h
+++ b/plugins/pluginWinAudioDSP/plugin_audio_dsp_utils.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -40,32 +40,32 @@
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
class AudioDSPUtils
{
public:
- static HRESULT Startup();
- static HRESULT Shutdown();
- static HRESULT CreatePCMAudioType(
- UINT32 sampleRate, // Samples per second
- UINT32 bitsPerSample, // Bits per sample
- UINT32 cChannels, // Number of channels
- IMFMediaType **ppType // Receives a pointer to the media type.
+ static HRESULT Startup();
+ static HRESULT Shutdown();
+ static HRESULT CreatePCMAudioType(
+ UINT32 sampleRate, // Samples per second
+ UINT32 bitsPerSample, // Bits per sample
+ UINT32 cChannels, // Number of channels
+ IMFMediaType **ppType // Receives a pointer to the media type.
+ );
+ static HRESULT CreateMediaSample(
+ DWORD cbData, // Maximum buffer size
+ IMFSample **ppSample // Receives the sample
+ );
+ static HRESULT MoInitMediaType(
+ UINT32 sampleRate, // Samples per second
+ UINT32 bitsPerSample, // Bits per sample
+ UINT32 cChannels, // Number of channels
+ DMO_MEDIA_TYPE *pType // The media type to initialize. Must be freed using MoFreeMediaType.
);
- static HRESULT CreateMediaSample(
- DWORD cbData, // Maximum buffer size
- IMFSample **ppSample // Receives the sample
- );
- static HRESULT MoInitMediaType(
- UINT32 sampleRate, // Samples per second
- UINT32 bitsPerSample, // Bits per sample
- UINT32 cChannels, // Number of channels
- DMO_MEDIA_TYPE *pType // The media type to initialize. Must be freed using MoFreeMediaType.
- );
private:
- static bool g_bStarted;
+ static bool g_bStarted;
};
#endif /* PLUGIN_AUDIO_DSP_UTILS_H */
diff --git a/plugins/pluginWinDD/dllmain_dd.cxx b/plugins/pluginWinDD/dllmain_dd.cxx
index b390c90..e8df126 100755
--- a/plugins/pluginWinDD/dllmain_dd.cxx
+++ b/plugins/pluginWinDD/dllmain_dd.cxx
@@ -35,80 +35,72 @@ PLUGIN_WIN_DDP_API tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index);
PLUGIN_WIN_DD_END_DECLS /* END */
BOOL APIENTRY DllMain(HMODULE hModule,
-DWORD ul_reason_for_call,
-LPVOID lpReserved
-)
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
-typedef enum PLUGIN_INDEX_E
-{
- PLUGIN_INDEX_PRODUCER,
+typedef enum PLUGIN_INDEX_E {
+ PLUGIN_INDEX_PRODUCER,
- PLUGIN_INDEX_COUNT
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- return PLUGIN_INDEX_COUNT;
+ return PLUGIN_INDEX_COUNT;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch (index){
- case PLUGIN_INDEX_PRODUCER:
- {
- return tsk_plugin_def_type_producer;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
- }
- }
+ switch (index) {
+ case PLUGIN_INDEX_PRODUCER: {
+ return tsk_plugin_def_type_producer;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
+ }
+ }
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch (index){
- case PLUGIN_INDEX_PRODUCER:
- {
- return tsk_plugin_def_media_type_screencast;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
- }
- }
+ switch (index) {
+ case PLUGIN_INDEX_PRODUCER: {
+ return tsk_plugin_def_media_type_screencast;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
+ }
+ }
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch (index){
- case PLUGIN_INDEX_PRODUCER:
- {
- return plugin_win_dd_producer_plugin_def_t;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
- }
- }
+ switch (index) {
+ case PLUGIN_INDEX_PRODUCER: {
+ return plugin_win_dd_producer_plugin_def_t;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
+ }
+ }
}
diff --git a/plugins/pluginWinDD/internals/CommonTypes.h b/plugins/pluginWinDD/internals/CommonTypes.h
index 7b9c2d4..3870e96 100755
--- a/plugins/pluginWinDD/internals/CommonTypes.h
+++ b/plugins/pluginWinDD/internals/CommonTypes.h
@@ -32,12 +32,11 @@ extern HRESULT AcquireFrameExpectedError[];
extern HRESULT EnumOutputsExpectedErrors[];
-typedef _Return_type_success_(return == DUPL_RETURN_SUCCESS) enum
-{
+typedef _Return_type_success_(return == DUPL_RETURN_SUCCESS) enum {
DUPL_RETURN_SUCCESS = 0,
DUPL_RETURN_ERROR_EXPECTED = 1,
DUPL_RETURN_ERROR_UNEXPECTED = 2
-}DUPL_RETURN;
+} DUPL_RETURN;
_Post_satisfies_(return != DUPL_RETURN_SUCCESS)
DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors = nullptr);
@@ -47,8 +46,7 @@ void DisplayMsg(_In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr);
//
// Holds info about the pointer/cursor
//
-typedef struct _PTR_INFO
-{
+typedef struct _PTR_INFO {
_Field_size_bytes_(BufferSize) BYTE* PtrShapeBuffer;
DXGI_OUTDUPL_POINTER_SHAPE_INFO ShapeInfo;
POINT Position;
@@ -61,8 +59,7 @@ typedef struct _PTR_INFO
//
// Structure that holds D3D resources not directly tied to any one thread
//
-typedef struct _DX_RESOURCES
-{
+typedef struct _DX_RESOURCES {
ID3D11Device* Device;
ID3D11DeviceContext* Context;
ID3D11VertexShader* VertexShader;
@@ -74,8 +71,7 @@ typedef struct _DX_RESOURCES
//
// Structure to pass to a new thread
//
-typedef struct _THREAD_DATA
-{
+typedef struct _THREAD_DATA {
// Used to indicate abnormal error condition
HANDLE UnexpectedErrorEvent;
@@ -92,14 +88,13 @@ typedef struct _THREAD_DATA
PTR_INFO* PtrInfo;
DX_RESOURCES DxRes;
- const struct tmedia_producer_s* Producer;
+ const struct tmedia_producer_s* Producer;
} THREAD_DATA;
//
// FRAME_DATA holds information about an acquired frame
//
-typedef struct _FRAME_DATA
-{
+typedef struct _FRAME_DATA {
ID3D11Texture2D* Frame;
DXGI_OUTDUPL_FRAME_INFO FrameInfo;
_Field_size_bytes_((MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT)) + (DirtyCount * sizeof(RECT))) BYTE* MetaData;
@@ -110,8 +105,7 @@ typedef struct _FRAME_DATA
//
// A vertex with a position and texture coordinate
//
-typedef struct _VERTEX
-{
+typedef struct _VERTEX {
DirectX::XMFLOAT3 Pos;
DirectX::XMFLOAT2 TexCoord;
} VERTEX;
diff --git a/plugins/pluginWinDD/internals/DisplayManager.cxx b/plugins/pluginWinDD/internals/DisplayManager.cxx
index 98209a0..e60ab64 100755
--- a/plugins/pluginWinDD/internals/DisplayManager.cxx
+++ b/plugins/pluginWinDD/internals/DisplayManager.cxx
@@ -12,15 +12,15 @@ using namespace DirectX;
// Constructor NULLs out vars
//
DISPLAYMANAGER::DISPLAYMANAGER() : m_Device(nullptr),
- m_DeviceContext(nullptr),
- m_MoveSurf(nullptr),
- m_VertexShader(nullptr),
- m_PixelShader(nullptr),
- m_InputLayout(nullptr),
- m_RTV(nullptr),
- m_SamplerLinear(nullptr),
- m_DirtyVertexBufferAlloc(nullptr),
- m_DirtyVertexBufferAllocSize(0)
+ m_DeviceContext(nullptr),
+ m_MoveSurf(nullptr),
+ m_VertexShader(nullptr),
+ m_PixelShader(nullptr),
+ m_InputLayout(nullptr),
+ m_RTV(nullptr),
+ m_SamplerLinear(nullptr),
+ m_DirtyVertexBufferAlloc(nullptr),
+ m_DirtyVertexBufferAllocSize(0)
{
}
@@ -31,8 +31,7 @@ DISPLAYMANAGER::~DISPLAYMANAGER()
{
CleanRefs();
- if (m_DirtyVertexBufferAlloc)
- {
+ if (m_DirtyVertexBufferAlloc) {
delete [] m_DirtyVertexBufferAlloc;
m_DirtyVertexBufferAlloc = nullptr;
}
@@ -66,22 +65,18 @@ DUPL_RETURN DISPLAYMANAGER::ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Te
DUPL_RETURN Ret = DUPL_RETURN_SUCCESS;
// Process dirties and moves
- if (Data->FrameInfo.TotalMetadataBufferSize)
- {
+ if (Data->FrameInfo.TotalMetadataBufferSize) {
D3D11_TEXTURE2D_DESC Desc;
Data->Frame->GetDesc(&Desc);
- if (Data->MoveCount)
- {
+ if (Data->MoveCount) {
Ret = CopyMove(SharedSurf, reinterpret_cast<DXGI_OUTDUPL_MOVE_RECT*>(Data->MetaData), Data->MoveCount, OffsetX, OffsetY, DeskDesc, Desc.Width, Desc.Height);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
+ if (Ret != DUPL_RETURN_SUCCESS) {
return Ret;
}
}
- if (Data->DirtyCount)
- {
+ if (Data->DirtyCount) {
Ret = CopyDirty(Data->Frame, SharedSurf, reinterpret_cast<RECT*>(Data->MetaData + (Data->MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT))), Data->DirtyCount, OffsetX, OffsetY, DeskDesc);
}
}
@@ -102,64 +97,58 @@ ID3D11Device* DISPLAYMANAGER::GetDevice()
//
void DISPLAYMANAGER::SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight)
{
- switch (DeskDesc->Rotation)
- {
- case DXGI_MODE_ROTATION_UNSPECIFIED:
- case DXGI_MODE_ROTATION_IDENTITY:
- {
- SrcRect->left = MoveRect->SourcePoint.x;
- SrcRect->top = MoveRect->SourcePoint.y;
- SrcRect->right = MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left;
- SrcRect->bottom = MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top;
-
- *DestRect = MoveRect->DestinationRect;
- break;
- }
- case DXGI_MODE_ROTATION_ROTATE90:
- {
- SrcRect->left = TexHeight - (MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top);
- SrcRect->top = MoveRect->SourcePoint.x;
- SrcRect->right = TexHeight - MoveRect->SourcePoint.y;
- SrcRect->bottom = MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left;
-
- DestRect->left = TexHeight - MoveRect->DestinationRect.bottom;
- DestRect->top = MoveRect->DestinationRect.left;
- DestRect->right = TexHeight - MoveRect->DestinationRect.top;
- DestRect->bottom = MoveRect->DestinationRect.right;
- break;
- }
- case DXGI_MODE_ROTATION_ROTATE180:
- {
- SrcRect->left = TexWidth - (MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left);
- SrcRect->top = TexHeight - (MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top);
- SrcRect->right = TexWidth - MoveRect->SourcePoint.x;
- SrcRect->bottom = TexHeight - MoveRect->SourcePoint.y;
-
- DestRect->left = TexWidth - MoveRect->DestinationRect.right;
- DestRect->top = TexHeight - MoveRect->DestinationRect.bottom;
- DestRect->right = TexWidth - MoveRect->DestinationRect.left;
- DestRect->bottom = TexHeight - MoveRect->DestinationRect.top;
- break;
- }
- case DXGI_MODE_ROTATION_ROTATE270:
- {
- SrcRect->left = MoveRect->SourcePoint.x;
- SrcRect->top = TexWidth - (MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left);
- SrcRect->right = MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top;
- SrcRect->bottom = TexWidth - MoveRect->SourcePoint.x;
-
- DestRect->left = MoveRect->DestinationRect.top;
- DestRect->top = TexWidth - MoveRect->DestinationRect.right;
- DestRect->right = MoveRect->DestinationRect.bottom;
- DestRect->bottom = TexWidth - MoveRect->DestinationRect.left;
- break;
- }
- default:
- {
- RtlZeroMemory(DestRect, sizeof(RECT));
- RtlZeroMemory(SrcRect, sizeof(RECT));
- break;
- }
+ switch (DeskDesc->Rotation) {
+ case DXGI_MODE_ROTATION_UNSPECIFIED:
+ case DXGI_MODE_ROTATION_IDENTITY: {
+ SrcRect->left = MoveRect->SourcePoint.x;
+ SrcRect->top = MoveRect->SourcePoint.y;
+ SrcRect->right = MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left;
+ SrcRect->bottom = MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top;
+
+ *DestRect = MoveRect->DestinationRect;
+ break;
+ }
+ case DXGI_MODE_ROTATION_ROTATE90: {
+ SrcRect->left = TexHeight - (MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top);
+ SrcRect->top = MoveRect->SourcePoint.x;
+ SrcRect->right = TexHeight - MoveRect->SourcePoint.y;
+ SrcRect->bottom = MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left;
+
+ DestRect->left = TexHeight - MoveRect->DestinationRect.bottom;
+ DestRect->top = MoveRect->DestinationRect.left;
+ DestRect->right = TexHeight - MoveRect->DestinationRect.top;
+ DestRect->bottom = MoveRect->DestinationRect.right;
+ break;
+ }
+ case DXGI_MODE_ROTATION_ROTATE180: {
+ SrcRect->left = TexWidth - (MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left);
+ SrcRect->top = TexHeight - (MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top);
+ SrcRect->right = TexWidth - MoveRect->SourcePoint.x;
+ SrcRect->bottom = TexHeight - MoveRect->SourcePoint.y;
+
+ DestRect->left = TexWidth - MoveRect->DestinationRect.right;
+ DestRect->top = TexHeight - MoveRect->DestinationRect.bottom;
+ DestRect->right = TexWidth - MoveRect->DestinationRect.left;
+ DestRect->bottom = TexHeight - MoveRect->DestinationRect.top;
+ break;
+ }
+ case DXGI_MODE_ROTATION_ROTATE270: {
+ SrcRect->left = MoveRect->SourcePoint.x;
+ SrcRect->top = TexWidth - (MoveRect->SourcePoint.x + MoveRect->DestinationRect.right - MoveRect->DestinationRect.left);
+ SrcRect->right = MoveRect->SourcePoint.y + MoveRect->DestinationRect.bottom - MoveRect->DestinationRect.top;
+ SrcRect->bottom = TexWidth - MoveRect->SourcePoint.x;
+
+ DestRect->left = MoveRect->DestinationRect.top;
+ DestRect->top = TexWidth - MoveRect->DestinationRect.right;
+ DestRect->right = MoveRect->DestinationRect.bottom;
+ DestRect->bottom = TexWidth - MoveRect->DestinationRect.left;
+ break;
+ }
+ default: {
+ RtlZeroMemory(DestRect, sizeof(RECT));
+ RtlZeroMemory(SrcRect, sizeof(RECT));
+ break;
+ }
}
}
@@ -172,8 +161,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_re
SharedSurf->GetDesc(&FullDesc);
// Make new intermediate surface to copy into for moving
- if (!m_MoveSurf)
- {
+ if (!m_MoveSurf) {
D3D11_TEXTURE2D_DESC MoveDesc;
MoveDesc = FullDesc;
MoveDesc.Width = DeskDesc->DesktopCoordinates.right - DeskDesc->DesktopCoordinates.left;
@@ -181,14 +169,12 @@ DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_re
MoveDesc.BindFlags = D3D11_BIND_RENDER_TARGET;
MoveDesc.MiscFlags = 0;
HRESULT hr = m_Device->CreateTexture2D(&MoveDesc, nullptr, &m_MoveSurf);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create staging texture for move rects", L"Error", hr, SystemTransitionsExpectedErrors);
}
}
- for (UINT i = 0; i < MoveCount; ++i)
- {
+ for (UINT i = 0; i < MoveCount; ++i) {
RECT SrcRect;
RECT DestRect;
@@ -235,75 +221,70 @@ void DISPLAYMANAGER::SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _I
RECT DestDirty = *Dirty;
// Set appropriate coordinates compensated for rotation
- switch (DeskDesc->Rotation)
- {
- case DXGI_MODE_ROTATION_ROTATE90:
- {
- DestDirty.left = Width - Dirty->bottom;
- DestDirty.top = Dirty->left;
- DestDirty.right = Width - Dirty->top;
- DestDirty.bottom = Dirty->right;
-
- Vertices[0].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[1].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[2].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[5].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- break;
- }
- case DXGI_MODE_ROTATION_ROTATE180:
- {
- DestDirty.left = Width - Dirty->right;
- DestDirty.top = Height - Dirty->bottom;
- DestDirty.right = Width - Dirty->left;
- DestDirty.bottom = Height - Dirty->top;
-
- Vertices[0].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[1].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[2].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[5].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- break;
- }
- case DXGI_MODE_ROTATION_ROTATE270:
- {
- DestDirty.left = Dirty->top;
- DestDirty.top = Height - Dirty->right;
- DestDirty.right = Dirty->bottom;
- DestDirty.bottom = Height - Dirty->left;
-
- Vertices[0].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[1].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[2].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[5].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- break;
- }
- default:
- assert(false); // drop through
- case DXGI_MODE_ROTATION_UNSPECIFIED:
- case DXGI_MODE_ROTATION_IDENTITY:
- {
- Vertices[0].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[1].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[2].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
- Vertices[5].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
- break;
- }
+ switch (DeskDesc->Rotation) {
+ case DXGI_MODE_ROTATION_ROTATE90: {
+ DestDirty.left = Width - Dirty->bottom;
+ DestDirty.top = Dirty->left;
+ DestDirty.right = Width - Dirty->top;
+ DestDirty.bottom = Dirty->right;
+
+ Vertices[0].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[1].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[2].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[5].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ break;
+ }
+ case DXGI_MODE_ROTATION_ROTATE180: {
+ DestDirty.left = Width - Dirty->right;
+ DestDirty.top = Height - Dirty->bottom;
+ DestDirty.right = Width - Dirty->left;
+ DestDirty.bottom = Height - Dirty->top;
+
+ Vertices[0].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[1].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[2].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[5].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ break;
+ }
+ case DXGI_MODE_ROTATION_ROTATE270: {
+ DestDirty.left = Dirty->top;
+ DestDirty.top = Height - Dirty->right;
+ DestDirty.right = Dirty->bottom;
+ DestDirty.bottom = Height - Dirty->left;
+
+ Vertices[0].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[1].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[2].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[5].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ break;
+ }
+ default:
+ assert(false); // drop through
+ case DXGI_MODE_ROTATION_UNSPECIFIED:
+ case DXGI_MODE_ROTATION_IDENTITY: {
+ Vertices[0].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[1].TexCoord = XMFLOAT2(Dirty->left / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[2].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->bottom / static_cast<FLOAT>(ThisDesc->Height));
+ Vertices[5].TexCoord = XMFLOAT2(Dirty->right / static_cast<FLOAT>(ThisDesc->Width), Dirty->top / static_cast<FLOAT>(ThisDesc->Height));
+ break;
+ }
}
// Set positions
Vertices[0].Pos = XMFLOAT3((DestDirty.left + DeskDesc->DesktopCoordinates.left - OffsetX - CenterX) / static_cast<FLOAT>(CenterX),
- -1 * (DestDirty.bottom + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
- 0.0f);
+ -1 * (DestDirty.bottom + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
+ 0.0f);
Vertices[1].Pos = XMFLOAT3((DestDirty.left + DeskDesc->DesktopCoordinates.left - OffsetX - CenterX) / static_cast<FLOAT>(CenterX),
- -1 * (DestDirty.top + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
- 0.0f);
+ -1 * (DestDirty.top + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
+ 0.0f);
Vertices[2].Pos = XMFLOAT3((DestDirty.right + DeskDesc->DesktopCoordinates.left - OffsetX - CenterX) / static_cast<FLOAT>(CenterX),
- -1 * (DestDirty.bottom + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
- 0.0f);
+ -1 * (DestDirty.bottom + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
+ 0.0f);
Vertices[3].Pos = Vertices[2].Pos;
Vertices[4].Pos = Vertices[1].Pos;
Vertices[5].Pos = XMFLOAT3((DestDirty.right + DeskDesc->DesktopCoordinates.left - OffsetX - CenterX) / static_cast<FLOAT>(CenterX),
- -1 * (DestDirty.top + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
- 0.0f);
+ -1 * (DestDirty.top + DeskDesc->DesktopCoordinates.top - OffsetY - CenterY) / static_cast<FLOAT>(CenterY),
+ 0.0f);
Vertices[3].TexCoord = Vertices[2].TexCoord;
Vertices[4].TexCoord = Vertices[1].TexCoord;
@@ -324,11 +305,9 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
D3D11_TEXTURE2D_DESC ThisDesc;
SrcSurface->GetDesc(&ThisDesc);
- if (!m_RTV)
- {
+ if (!m_RTV) {
hr = m_Device->CreateRenderTargetView(SharedSurf, nullptr, &m_RTV);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create render target view for dirty rects", L"Error", hr, SystemTransitionsExpectedErrors);
}
}
@@ -342,8 +321,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
// Create new shader resource view
ID3D11ShaderResourceView* ShaderResource = nullptr;
hr = m_Device->CreateShaderResourceView(SrcSurface, &ShaderDesc, &ShaderResource);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create shader resource view for dirty rects", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -358,16 +336,13 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
// Create space for vertices for the dirty rects if the current space isn't large enough
UINT BytesNeeded = sizeof(VERTEX) * NUMVERTICES * DirtyCount;
- if (BytesNeeded > m_DirtyVertexBufferAllocSize)
- {
- if (m_DirtyVertexBufferAlloc)
- {
+ if (BytesNeeded > m_DirtyVertexBufferAllocSize) {
+ if (m_DirtyVertexBufferAlloc) {
delete [] m_DirtyVertexBufferAlloc;
}
m_DirtyVertexBufferAlloc = new (std::nothrow) BYTE[BytesNeeded];
- if (!m_DirtyVertexBufferAlloc)
- {
+ if (!m_DirtyVertexBufferAlloc) {
m_DirtyVertexBufferAllocSize = 0;
return ProcessFailure(nullptr, L"Failed to allocate memory for dirty vertex buffer.", L"Error", E_OUTOFMEMORY);
}
@@ -377,8 +352,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
// Fill them in
VERTEX* DirtyVertex = reinterpret_cast<VERTEX*>(m_DirtyVertexBufferAlloc);
- for (UINT i = 0; i < DirtyCount; ++i, DirtyVertex += NUMVERTICES)
- {
+ for (UINT i = 0; i < DirtyCount; ++i, DirtyVertex += NUMVERTICES) {
SetDirtyVert(DirtyVertex, &(DirtyBuffer[i]), OffsetX, OffsetY, DeskDesc, &FullDesc, &ThisDesc);
}
@@ -395,8 +369,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
ID3D11Buffer* VertBuf = nullptr;
hr = m_Device->CreateBuffer(&BufferDesc, &InitData, &VertBuf);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create vertex buffer in dirty rect processing", L"Error", hr, SystemTransitionsExpectedErrors);
}
UINT Stride = sizeof(VERTEX);
@@ -428,50 +401,42 @@ DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_
//
void DISPLAYMANAGER::CleanRefs()
{
- if (m_DeviceContext)
- {
+ if (m_DeviceContext) {
m_DeviceContext->Release();
m_DeviceContext = nullptr;
}
- if (m_Device)
- {
+ if (m_Device) {
m_Device->Release();
m_Device = nullptr;
}
- if (m_MoveSurf)
- {
+ if (m_MoveSurf) {
m_MoveSurf->Release();
m_MoveSurf = nullptr;
}
- if (m_VertexShader)
- {
+ if (m_VertexShader) {
m_VertexShader->Release();
m_VertexShader = nullptr;
}
- if (m_PixelShader)
- {
+ if (m_PixelShader) {
m_PixelShader->Release();
m_PixelShader = nullptr;
}
- if (m_InputLayout)
- {
+ if (m_InputLayout) {
m_InputLayout->Release();
m_InputLayout = nullptr;
}
- if (m_SamplerLinear)
- {
+ if (m_SamplerLinear) {
m_SamplerLinear->Release();
m_SamplerLinear = nullptr;
}
- if (m_RTV)
- {
+ if (m_RTV) {
m_RTV->Release();
m_RTV = nullptr;
}
diff --git a/plugins/pluginWinDD/internals/DisplayManager.h b/plugins/pluginWinDD/internals/DisplayManager.h
index f9bf69c..3308ecb 100755
--- a/plugins/pluginWinDD/internals/DisplayManager.h
+++ b/plugins/pluginWinDD/internals/DisplayManager.h
@@ -15,32 +15,32 @@
//
class DISPLAYMANAGER
{
- public:
- DISPLAYMANAGER();
- ~DISPLAYMANAGER();
- void InitD3D(DX_RESOURCES* Data);
- ID3D11Device* GetDevice();
- DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
- void CleanRefs();
+public:
+ DISPLAYMANAGER();
+ ~DISPLAYMANAGER();
+ void InitD3D(DX_RESOURCES* Data);
+ ID3D11Device* GetDevice();
+ DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
+ void CleanRefs();
- private:
+private:
// methods
- DUPL_RETURN CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
- DUPL_RETURN CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight);
- void SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC* FullDesc, _In_ D3D11_TEXTURE2D_DESC* ThisDesc);
- void SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight);
+ DUPL_RETURN CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
+ DUPL_RETURN CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight);
+ void SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC* FullDesc, _In_ D3D11_TEXTURE2D_DESC* ThisDesc);
+ void SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight);
// variables
- ID3D11Device* m_Device;
- ID3D11DeviceContext* m_DeviceContext;
- ID3D11Texture2D* m_MoveSurf;
- ID3D11VertexShader* m_VertexShader;
- ID3D11PixelShader* m_PixelShader;
- ID3D11InputLayout* m_InputLayout;
- ID3D11RenderTargetView* m_RTV;
- ID3D11SamplerState* m_SamplerLinear;
- BYTE* m_DirtyVertexBufferAlloc;
- UINT m_DirtyVertexBufferAllocSize;
+ ID3D11Device* m_Device;
+ ID3D11DeviceContext* m_DeviceContext;
+ ID3D11Texture2D* m_MoveSurf;
+ ID3D11VertexShader* m_VertexShader;
+ ID3D11PixelShader* m_PixelShader;
+ ID3D11InputLayout* m_InputLayout;
+ ID3D11RenderTargetView* m_RTV;
+ ID3D11SamplerState* m_SamplerLinear;
+ BYTE* m_DirtyVertexBufferAlloc;
+ UINT m_DirtyVertexBufferAllocSize;
};
#endif
diff --git a/plugins/pluginWinDD/internals/DuplicationManager.cxx b/plugins/pluginWinDD/internals/DuplicationManager.cxx
index 995c8ec..34ec896 100755
--- a/plugins/pluginWinDD/internals/DuplicationManager.cxx
+++ b/plugins/pluginWinDD/internals/DuplicationManager.cxx
@@ -12,24 +12,24 @@
#include <Mfapi.h>
static inline HRESULT CopyRGBb32DownTop(
- BYTE* pDst,
- const BYTE* pSrc,
- INT dwWidthDstPixels,
- INT dwWidthSrcPixels,
- INT dwHeightPixels
- );
+ BYTE* pDst,
+ const BYTE* pSrc,
+ INT dwWidthDstPixels,
+ INT dwWidthSrcPixels,
+ INT dwHeightPixels
+);
//
// Constructor sets up references / variables
//
DUPLICATIONMANAGER::DUPLICATIONMANAGER() : m_DeskDupl(nullptr),
- m_AcquiredDesktopImage(nullptr),
- m_MetaDataBuffer(nullptr),
- m_MetaDataSize(0),
- m_OutputNumber(0),
- m_Device(nullptr),
- m_DeviceContext(nullptr),
- m_BufferPtr(nullptr),
- m_BufferSize(0)
+ m_AcquiredDesktopImage(nullptr),
+ m_MetaDataBuffer(nullptr),
+ m_MetaDataSize(0),
+ m_OutputNumber(0),
+ m_Device(nullptr),
+ m_DeviceContext(nullptr),
+ m_BufferPtr(nullptr),
+ m_BufferSize(0)
{
RtlZeroMemory(&m_OutputDesc, sizeof(m_OutputDesc));
}
@@ -39,41 +39,35 @@ DUPLICATIONMANAGER::DUPLICATIONMANAGER() : m_DeskDupl(nullptr),
//
DUPLICATIONMANAGER::~DUPLICATIONMANAGER()
{
- if (m_DeskDupl)
- {
+ if (m_DeskDupl) {
m_DeskDupl->Release();
m_DeskDupl = nullptr;
}
- if (m_AcquiredDesktopImage)
- {
+ if (m_AcquiredDesktopImage) {
m_AcquiredDesktopImage->Release();
m_AcquiredDesktopImage = nullptr;
}
- if (m_MetaDataBuffer)
- {
+ if (m_MetaDataBuffer) {
delete [] m_MetaDataBuffer;
m_MetaDataBuffer = nullptr;
}
- if (m_DeviceContext)
- {
- m_DeviceContext->Release();
- m_DeviceContext = nullptr;
- }
+ if (m_DeviceContext) {
+ m_DeviceContext->Release();
+ m_DeviceContext = nullptr;
+ }
- if (m_Device)
- {
+ if (m_Device) {
m_Device->Release();
m_Device = nullptr;
}
- if (m_BufferPtr)
- {
- VirtualFree(m_BufferPtr, 0, MEM_RELEASE);
- m_BufferPtr = nullptr;
- }
+ if (m_BufferPtr) {
+ VirtualFree(m_BufferPtr, 0, MEM_RELEASE);
+ m_BufferPtr = nullptr;
+ }
}
//
@@ -87,14 +81,13 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
m_Device = Device;
m_Device->AddRef();
- m_DeviceContext = DeviceContext;
- m_DeviceContext->AddRef();
+ m_DeviceContext = DeviceContext;
+ m_DeviceContext->AddRef();
// Get DXGI device
IDXGIDevice* DxgiDevice = nullptr;
HRESULT hr = m_Device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&DxgiDevice));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI for DXGI Device", L"Error", hr);
}
@@ -103,8 +96,7 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
hr = DxgiDevice->GetParent(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&DxgiAdapter));
DxgiDevice->Release();
DxgiDevice = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get parent DXGI Adapter", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -113,8 +105,7 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
hr = DxgiAdapter->EnumOutputs(Output, &DxgiOutput);
DxgiAdapter->Release();
DxgiAdapter = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get specified output in DUPLICATIONMANAGER", L"Error", hr, EnumOutputsExpectedErrors);
}
@@ -125,8 +116,7 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
hr = DxgiOutput->QueryInterface(__uuidof(DxgiOutput1), reinterpret_cast<void**>(&DxgiOutput1));
DxgiOutput->Release();
DxgiOutput = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI for DxgiOutput1 in DUPLICATIONMANAGER", L"Error", hr);
}
@@ -134,10 +124,8 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
hr = DxgiOutput1->DuplicateOutput(m_Device, &m_DeskDupl);
DxgiOutput1->Release();
DxgiOutput1 = nullptr;
- if (FAILED(hr))
- {
- if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE)
- {
+ if (FAILED(hr)) {
+ if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) {
MessageBoxW(nullptr, L"There is already the maximum number of applications using the Desktop Duplication API running, please close one of those applications and then try again.", L"Error", MB_OK);
return DUPL_RETURN_ERROR_UNEXPECTED;
}
@@ -153,8 +141,7 @@ DUPL_RETURN DUPLICATIONMANAGER::InitDupl(_In_ ID3D11Device* Device, ID3D11Device
DUPL_RETURN DUPLICATIONMANAGER::GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OUTDUPL_FRAME_INFO* FrameInfo, INT OffsetX, INT OffsetY)
{
// A non-zero mouse update timestamp indicates that there is a mouse position update and optionally a shape change
- if (FrameInfo->LastMouseUpdateTime.QuadPart == 0)
- {
+ if (FrameInfo->LastMouseUpdateTime.QuadPart == 0) {
return DUPL_RETURN_SUCCESS;
}
@@ -163,20 +150,17 @@ DUPL_RETURN DUPLICATIONMANAGER::GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OU
// Make sure we don't update pointer position wrongly
// If pointer is invisible, make sure we did not get an update from another output that the last time that said pointer
// was visible, if so, don't set it to invisible or update.
- if (!FrameInfo->PointerPosition.Visible && (PtrInfo->WhoUpdatedPositionLast != m_OutputNumber))
- {
+ if (!FrameInfo->PointerPosition.Visible && (PtrInfo->WhoUpdatedPositionLast != m_OutputNumber)) {
UpdatePosition = false;
}
// If two outputs both say they have a visible, only update if new update has newer timestamp
- if (FrameInfo->PointerPosition.Visible && PtrInfo->Visible && (PtrInfo->WhoUpdatedPositionLast != m_OutputNumber) && (PtrInfo->LastTimeStamp.QuadPart > FrameInfo->LastMouseUpdateTime.QuadPart))
- {
+ if (FrameInfo->PointerPosition.Visible && PtrInfo->Visible && (PtrInfo->WhoUpdatedPositionLast != m_OutputNumber) && (PtrInfo->LastTimeStamp.QuadPart > FrameInfo->LastMouseUpdateTime.QuadPart)) {
UpdatePosition = false;
}
// Update position
- if (UpdatePosition)
- {
+ if (UpdatePosition) {
PtrInfo->Position.x = FrameInfo->PointerPosition.Position.x + m_OutputDesc.DesktopCoordinates.left - OffsetX;
PtrInfo->Position.y = FrameInfo->PointerPosition.Position.y + m_OutputDesc.DesktopCoordinates.top - OffsetY;
PtrInfo->WhoUpdatedPositionLast = m_OutputNumber;
@@ -185,22 +169,18 @@ DUPL_RETURN DUPLICATIONMANAGER::GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OU
}
// No new shape
- if (FrameInfo->PointerShapeBufferSize == 0)
- {
+ if (FrameInfo->PointerShapeBufferSize == 0) {
return DUPL_RETURN_SUCCESS;
}
// Old buffer too small
- if (FrameInfo->PointerShapeBufferSize > PtrInfo->BufferSize)
- {
- if (PtrInfo->PtrShapeBuffer)
- {
+ if (FrameInfo->PointerShapeBufferSize > PtrInfo->BufferSize) {
+ if (PtrInfo->PtrShapeBuffer) {
delete [] PtrInfo->PtrShapeBuffer;
PtrInfo->PtrShapeBuffer = nullptr;
}
PtrInfo->PtrShapeBuffer = new (std::nothrow) BYTE[FrameInfo->PointerShapeBufferSize];
- if (!PtrInfo->PtrShapeBuffer)
- {
+ if (!PtrInfo->PtrShapeBuffer) {
PtrInfo->BufferSize = 0;
return ProcessFailure(nullptr, L"Failed to allocate memory for pointer shape in DUPLICATIONMANAGER", L"Error", E_OUTOFMEMORY);
}
@@ -212,8 +192,7 @@ DUPL_RETURN DUPLICATIONMANAGER::GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OU
// Get shape
UINT BufferSizeRequired;
HRESULT hr = m_DeskDupl->GetFramePointerShape(FrameInfo->PointerShapeBufferSize, reinterpret_cast<VOID*>(PtrInfo->PtrShapeBuffer), &BufferSizeRequired, &(PtrInfo->ShapeInfo));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
delete [] PtrInfo->PtrShapeBuffer;
PtrInfo->PtrShapeBuffer = nullptr;
PtrInfo->BufferSize = 0;
@@ -235,21 +214,18 @@ DUPL_RETURN DUPLICATIONMANAGER::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Tim
// Get new frame
HRESULT hr = m_DeskDupl->AcquireNextFrame(500, &FrameInfo, &DesktopResource);
- if (hr == DXGI_ERROR_WAIT_TIMEOUT)
- {
+ if (hr == DXGI_ERROR_WAIT_TIMEOUT) {
*Timeout = true;
return DUPL_RETURN_SUCCESS;
}
*Timeout = false;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to acquire next frame in DUPLICATIONMANAGER", L"Error", hr, FrameInfoExpectedErrors);
}
// If still holding old frame, destroy it
- if (m_AcquiredDesktopImage)
- {
+ if (m_AcquiredDesktopImage) {
m_AcquiredDesktopImage->Release();
m_AcquiredDesktopImage = nullptr;
}
@@ -258,25 +234,20 @@ DUPL_RETURN DUPLICATIONMANAGER::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Tim
hr = DesktopResource->QueryInterface(__uuidof(ID3D11Texture2D), reinterpret_cast<void **>(&m_AcquiredDesktopImage));
DesktopResource->Release();
DesktopResource = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI for ID3D11Texture2D from acquired IDXGIResource in DUPLICATIONMANAGER", L"Error", hr);
}
// Get metadata
- if (FrameInfo.TotalMetadataBufferSize)
- {
+ if (FrameInfo.TotalMetadataBufferSize) {
// Old buffer too small
- if (FrameInfo.TotalMetadataBufferSize > m_MetaDataSize)
- {
- if (m_MetaDataBuffer)
- {
+ if (FrameInfo.TotalMetadataBufferSize > m_MetaDataSize) {
+ if (m_MetaDataBuffer) {
delete [] m_MetaDataBuffer;
m_MetaDataBuffer = nullptr;
}
m_MetaDataBuffer = new (std::nothrow) BYTE[FrameInfo.TotalMetadataBufferSize];
- if (!m_MetaDataBuffer)
- {
+ if (!m_MetaDataBuffer) {
m_MetaDataSize = 0;
Data->MoveCount = 0;
Data->DirtyCount = 0;
@@ -289,8 +260,7 @@ DUPL_RETURN DUPLICATIONMANAGER::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Tim
// Get move rectangles
hr = m_DeskDupl->GetFrameMoveRects(BufSize, reinterpret_cast<DXGI_OUTDUPL_MOVE_RECT*>(m_MetaDataBuffer), &BufSize);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
Data->MoveCount = 0;
Data->DirtyCount = 0;
return ProcessFailure(nullptr, L"Failed to get frame move rects in DUPLICATIONMANAGER", L"Error", hr, FrameInfoExpectedErrors);
@@ -302,8 +272,7 @@ DUPL_RETURN DUPLICATIONMANAGER::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Tim
// Get dirty rectangles
hr = m_DeskDupl->GetFrameDirtyRects(BufSize, reinterpret_cast<RECT*>(DirtyRects), &BufSize);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
Data->MoveCount = 0;
Data->DirtyCount = 0;
return ProcessFailure(nullptr, L"Failed to get frame dirty rects in DUPLICATIONMANAGER", L"Error", hr, FrameInfoExpectedErrors);
@@ -325,13 +294,11 @@ DUPL_RETURN DUPLICATIONMANAGER::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Tim
DUPL_RETURN DUPLICATIONMANAGER::DoneWithFrame()
{
HRESULT hr = m_DeskDupl->ReleaseFrame();
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to release frame in DUPLICATIONMANAGER", L"Error", hr, FrameInfoExpectedErrors);
}
- if (m_AcquiredDesktopImage)
- {
+ if (m_AcquiredDesktopImage) {
m_AcquiredDesktopImage->Release();
m_AcquiredDesktopImage = nullptr;
}
@@ -350,150 +317,138 @@ void DUPLICATIONMANAGER::GetOutputDesc(_Out_ DXGI_OUTPUT_DESC* DescPtr)
HRESULT DUPLICATIONMANAGER::SendData(struct tmedia_producer_s* pProducer, FRAME_DATA* FrameData)
{
- HRESULT hr = E_FAIL;
- D3D11_TEXTURE2D_DESC CopyBufferDesc = {0};
- D3D11_TEXTURE2D_DESC FullDesc;
- DXGI_MAPPED_RECT MappedSurface;
- D3D11_BOX Box;
- UINT BuffSize;
-
- ID3D11Texture2D* CopyBuffer = nullptr;
- IDXGISurface* CopySurface = nullptr;
- ID3D11Device* Device = nullptr;
-
- FrameData->Frame->GetDesc(&FullDesc);
-
- CopyBufferDesc.Width = FullDesc.Width;
- CopyBufferDesc.Height = FullDesc.Height;
- CopyBufferDesc.MipLevels = 1;
- CopyBufferDesc.ArraySize = 1;
- CopyBufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
- CopyBufferDesc.SampleDesc.Count = 1;
- CopyBufferDesc.SampleDesc.Quality = 0;
- CopyBufferDesc.Usage = D3D11_USAGE_STAGING;
- CopyBufferDesc.BindFlags = 0;
- CopyBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
- CopyBufferDesc.MiscFlags = 0;
-
- FrameData->Frame->GetDevice(&Device);
- if (!Device)
- {
- hr = E_POINTER;
- ProcessFailure(m_Device, L"Failed to get device", L"Error", hr, SystemTransitionsExpectedErrors);
- goto bail;
- }
-
- hr = Device->CreateTexture2D(&CopyBufferDesc, nullptr, &CopyBuffer);
- if (FAILED(hr))
- {
- ProcessFailure(m_Device, L"Failed creating staging texture for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
- goto bail;
- }
-
- Box.left = 0;
- Box.top = 0;
- Box.right = CopyBufferDesc.Width;
- Box.bottom = CopyBufferDesc.Height;
- Box.front = 0;
- Box.back = 1;
- m_DeviceContext->CopySubresourceRegion(CopyBuffer, 0, 0, 0, 0, FrameData->Frame, 0, &Box);
-
- hr = CopyBuffer->QueryInterface(__uuidof(IDXGISurface), (void **)&CopySurface);
- if (FAILED(hr))
- {
- ProcessFailure(nullptr, L"Failed to QI staging texture into IDXGISurface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
- goto bail;
- }
-
- BuffSize = CopyBufferDesc.Width * CopyBufferDesc.Height * 4;
- if (m_BufferSize < BuffSize)
- {
- if (m_BufferPtr)
- {
- VirtualFree(m_BufferPtr, 0, MEM_RELEASE);
- m_BufferSize = 0;
- }
- if (!(m_BufferPtr = (BYTE*)VirtualAlloc(NULL, BuffSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)))
- {
- ProcessFailure(Device, L"Failed to allocate memory", L"Error", hr, SystemTransitionsExpectedErrors);
- goto bail;
- }
- m_BufferSize = BuffSize;
- }
-
- hr = CopySurface->Map(&MappedSurface, DXGI_MAP_READ); // *** MAP *** //
- if (FAILED(hr))
- {
- ProcessFailure(Device, L"Failed to map surface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
- goto bail;
- }
-
- pProducer->video.width = CopyBufferDesc.Width;
- pProducer->video.height = CopyBufferDesc.Height;
+ HRESULT hr = E_FAIL;
+ D3D11_TEXTURE2D_DESC CopyBufferDesc = {0};
+ D3D11_TEXTURE2D_DESC FullDesc;
+ DXGI_MAPPED_RECT MappedSurface;
+ D3D11_BOX Box;
+ UINT BuffSize;
+
+ ID3D11Texture2D* CopyBuffer = nullptr;
+ IDXGISurface* CopySurface = nullptr;
+ ID3D11Device* Device = nullptr;
+
+ FrameData->Frame->GetDesc(&FullDesc);
+
+ CopyBufferDesc.Width = FullDesc.Width;
+ CopyBufferDesc.Height = FullDesc.Height;
+ CopyBufferDesc.MipLevels = 1;
+ CopyBufferDesc.ArraySize = 1;
+ CopyBufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
+ CopyBufferDesc.SampleDesc.Count = 1;
+ CopyBufferDesc.SampleDesc.Quality = 0;
+ CopyBufferDesc.Usage = D3D11_USAGE_STAGING;
+ CopyBufferDesc.BindFlags = 0;
+ CopyBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
+ CopyBufferDesc.MiscFlags = 0;
+
+ FrameData->Frame->GetDevice(&Device);
+ if (!Device) {
+ hr = E_POINTER;
+ ProcessFailure(m_Device, L"Failed to get device", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto bail;
+ }
+
+ hr = Device->CreateTexture2D(&CopyBufferDesc, nullptr, &CopyBuffer);
+ if (FAILED(hr)) {
+ ProcessFailure(m_Device, L"Failed creating staging texture for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto bail;
+ }
+
+ Box.left = 0;
+ Box.top = 0;
+ Box.right = CopyBufferDesc.Width;
+ Box.bottom = CopyBufferDesc.Height;
+ Box.front = 0;
+ Box.back = 1;
+ m_DeviceContext->CopySubresourceRegion(CopyBuffer, 0, 0, 0, 0, FrameData->Frame, 0, &Box);
+
+ hr = CopyBuffer->QueryInterface(__uuidof(IDXGISurface), (void **)&CopySurface);
+ if (FAILED(hr)) {
+ ProcessFailure(nullptr, L"Failed to QI staging texture into IDXGISurface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto bail;
+ }
+
+ BuffSize = CopyBufferDesc.Width * CopyBufferDesc.Height * 4;
+ if (m_BufferSize < BuffSize) {
+ if (m_BufferPtr) {
+ VirtualFree(m_BufferPtr, 0, MEM_RELEASE);
+ m_BufferSize = 0;
+ }
+ if (!(m_BufferPtr = (BYTE*)VirtualAlloc(NULL, BuffSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE))) {
+ ProcessFailure(Device, L"Failed to allocate memory", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto bail;
+ }
+ m_BufferSize = BuffSize;
+ }
+
+ hr = CopySurface->Map(&MappedSurface, DXGI_MAP_READ); // *** MAP *** //
+ if (FAILED(hr)) {
+ ProcessFailure(Device, L"Failed to map surface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto bail;
+ }
+
+ pProducer->video.width = CopyBufferDesc.Width;
+ pProducer->video.height = CopyBufferDesc.Height;
#if 0
- hr = MFCopyImage(
- m_BufferPtr,
- (LONG)(CopyBufferDesc.Width << 2),
- (BYTE*)MappedSurface.pBits,
- (LONG)MappedSurface.Pitch,
- (DWORD)(CopyBufferDesc.Width << 2),
- (DWORD)CopyBufferDesc.Height
- );
+ hr = MFCopyImage(
+ m_BufferPtr,
+ (LONG)(CopyBufferDesc.Width << 2),
+ (BYTE*)MappedSurface.pBits,
+ (LONG)MappedSurface.Pitch,
+ (DWORD)(CopyBufferDesc.Width << 2),
+ (DWORD)CopyBufferDesc.Height
+ );
#else;
- hr = CopyRGBb32DownTop(
- m_BufferPtr,
- MappedSurface.pBits,
- CopyBufferDesc.Width,
- (MappedSurface.Pitch >> 2), // Bytes -> Pixels
- CopyBufferDesc.Height);
+ hr = CopyRGBb32DownTop(
+ m_BufferPtr,
+ MappedSurface.pBits,
+ CopyBufferDesc.Width,
+ (MappedSurface.Pitch >> 2), // Bytes -> Pixels
+ CopyBufferDesc.Height);
#endif
- pProducer->enc_cb.callback(pProducer->enc_cb.callback_data, m_BufferPtr, BuffSize);
+ pProducer->enc_cb.callback(pProducer->enc_cb.callback_data, m_BufferPtr, BuffSize);
- CopySurface->Unmap(); // *** UNMAP *** //
+ CopySurface->Unmap(); // *** UNMAP *** //
bail:
- if (CopyBuffer)
- {
- CopyBuffer->Release();
- }
- if (CopySurface)
- {
- CopySurface->Release();
- }
- if (Device)
- {
- Device->Release();
- }
- return hr;
+ if (CopyBuffer) {
+ CopyBuffer->Release();
+ }
+ if (CopySurface) {
+ CopySurface->Release();
+ }
+ if (Device) {
+ Device->Release();
+ }
+ return hr;
}
// For RGB32:
// Direct3D -> Top-Down
// Video Processor -> Down-Top
static inline HRESULT CopyRGBb32DownTop(
- BYTE* pDst,
- const BYTE* pSrc,
- INT dwWidthDstPixels,
- INT dwWidthSrcPixels,
- INT dwHeightPixels
- )
+ BYTE* pDst,
+ const BYTE* pSrc,
+ INT dwWidthDstPixels,
+ INT dwWidthSrcPixels,
+ INT dwHeightPixels
+)
{
- RGBQUAD *pSrcPixel = &((RGBQUAD*)pSrc)[(dwWidthSrcPixels * dwHeightPixels) - dwWidthSrcPixels];
- RGBQUAD *pDestPixel = &((RGBQUAD*)pDst)[0];
-
- register INT x;
- register INT y;
-
- for (y = dwHeightPixels; y > 0; --y)
- {
- for (x = 0; x < dwWidthDstPixels; ++x)
- {
- pDestPixel[x] = pSrcPixel[x];
- }
- pDestPixel += dwWidthDstPixels;
- pSrcPixel -= dwWidthSrcPixels;
- }
- return S_OK;
+ RGBQUAD *pSrcPixel = &((RGBQUAD*)pSrc)[(dwWidthSrcPixels * dwHeightPixels) - dwWidthSrcPixels];
+ RGBQUAD *pDestPixel = &((RGBQUAD*)pDst)[0];
+
+ register INT x;
+ register INT y;
+
+ for (y = dwHeightPixels; y > 0; --y) {
+ for (x = 0; x < dwWidthDstPixels; ++x) {
+ pDestPixel[x] = pSrcPixel[x];
+ }
+ pDestPixel += dwWidthDstPixels;
+ pSrcPixel -= dwWidthSrcPixels;
+ }
+ return S_OK;
} \ No newline at end of file
diff --git a/plugins/pluginWinDD/internals/DuplicationManager.h b/plugins/pluginWinDD/internals/DuplicationManager.h
index 2c44b57..8f98145 100755
--- a/plugins/pluginWinDD/internals/DuplicationManager.h
+++ b/plugins/pluginWinDD/internals/DuplicationManager.h
@@ -15,29 +15,29 @@
//
class DUPLICATIONMANAGER
{
- public:
- DUPLICATIONMANAGER();
- ~DUPLICATIONMANAGER();
- _Success_(*Timeout == false && return == DUPL_RETURN_SUCCESS) DUPL_RETURN GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout);
- DUPL_RETURN DoneWithFrame();
- DUPL_RETURN InitDupl(_In_ ID3D11Device* Device, ID3D11DeviceContext* DeviceContext, UINT Output);
- DUPL_RETURN GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OUTDUPL_FRAME_INFO* FrameInfo, INT OffsetX, INT OffsetY);
- void GetOutputDesc(_Out_ DXGI_OUTPUT_DESC* DescPtr);
- HRESULT SendData(struct tmedia_producer_s* pProducer, FRAME_DATA* FrameData);
+public:
+ DUPLICATIONMANAGER();
+ ~DUPLICATIONMANAGER();
+ _Success_(*Timeout == false && return == DUPL_RETURN_SUCCESS) DUPL_RETURN GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout);
+ DUPL_RETURN DoneWithFrame();
+ DUPL_RETURN InitDupl(_In_ ID3D11Device* Device, ID3D11DeviceContext* DeviceContext, UINT Output);
+ DUPL_RETURN GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OUTDUPL_FRAME_INFO* FrameInfo, INT OffsetX, INT OffsetY);
+ void GetOutputDesc(_Out_ DXGI_OUTPUT_DESC* DescPtr);
+ HRESULT SendData(struct tmedia_producer_s* pProducer, FRAME_DATA* FrameData);
- private:
+private:
// vars
- IDXGIOutputDuplication* m_DeskDupl;
- ID3D11Texture2D* m_AcquiredDesktopImage;
- _Field_size_bytes_(m_MetaDataSize) BYTE* m_MetaDataBuffer;
- UINT m_MetaDataSize;
- UINT m_OutputNumber;
- DXGI_OUTPUT_DESC m_OutputDesc;
- ID3D11Device* m_Device;
- ID3D11DeviceContext* m_DeviceContext;
- BYTE* m_BufferPtr;
- UINT m_BufferSize;
+ IDXGIOutputDuplication* m_DeskDupl;
+ ID3D11Texture2D* m_AcquiredDesktopImage;
+ _Field_size_bytes_(m_MetaDataSize) BYTE* m_MetaDataBuffer;
+ UINT m_MetaDataSize;
+ UINT m_OutputNumber;
+ DXGI_OUTPUT_DESC m_OutputDesc;
+ ID3D11Device* m_Device;
+ ID3D11DeviceContext* m_DeviceContext;
+ BYTE* m_BufferPtr;
+ UINT m_BufferSize;
};
#endif
diff --git a/plugins/pluginWinDD/internals/OutputManager.cxx b/plugins/pluginWinDD/internals/OutputManager.cxx
index 7468cf2..a82f84c 100755
--- a/plugins/pluginWinDD/internals/OutputManager.cxx
+++ b/plugins/pluginWinDD/internals/OutputManager.cxx
@@ -12,20 +12,20 @@ using namespace DirectX;
// Constructor NULLs out all pointers & sets appropriate var vals
//
OUTPUTMANAGER::OUTPUTMANAGER() : m_SwapChain(nullptr),
- m_Device(nullptr),
- m_Factory(nullptr),
- m_DeviceContext(nullptr),
- m_RTV(nullptr),
- m_SamplerLinear(nullptr),
- m_BlendState(nullptr),
- m_VertexShader(nullptr),
- m_PixelShader(nullptr),
- m_InputLayout(nullptr),
- m_SharedSurf(nullptr),
- m_KeyMutex(nullptr),
- m_WindowHandle(nullptr),
- m_NeedsResize(false),
- m_OcclusionCookie(0)
+ m_Device(nullptr),
+ m_Factory(nullptr),
+ m_DeviceContext(nullptr),
+ m_RTV(nullptr),
+ m_SamplerLinear(nullptr),
+ m_BlendState(nullptr),
+ m_VertexShader(nullptr),
+ m_PixelShader(nullptr),
+ m_InputLayout(nullptr),
+ m_SharedSurf(nullptr),
+ m_KeyMutex(nullptr),
+ m_WindowHandle(nullptr),
+ m_NeedsResize(false),
+ m_OcclusionCookie(0)
{
}
@@ -56,8 +56,7 @@ DUPL_RETURN OUTPUTMANAGER::InitOutput(HWND Window, INT SingleOutput, _Out_ UINT*
m_WindowHandle = Window;
// Driver types supported
- D3D_DRIVER_TYPE DriverTypes[] =
- {
+ D3D_DRIVER_TYPE DriverTypes[] = {
D3D_DRIVER_TYPE_HARDWARE,
D3D_DRIVER_TYPE_WARP,
D3D_DRIVER_TYPE_REFERENCE,
@@ -65,8 +64,7 @@ DUPL_RETURN OUTPUTMANAGER::InitOutput(HWND Window, INT SingleOutput, _Out_ UINT*
UINT NumDriverTypes = ARRAYSIZE(DriverTypes);
// Feature levels supported
- D3D_FEATURE_LEVEL FeatureLevels[] =
- {
+ D3D_FEATURE_LEVEL FeatureLevels[] = {
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
@@ -76,26 +74,22 @@ DUPL_RETURN OUTPUTMANAGER::InitOutput(HWND Window, INT SingleOutput, _Out_ UINT*
D3D_FEATURE_LEVEL FeatureLevel;
// Create device
- for (UINT DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex)
- {
+ for (UINT DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex) {
hr = D3D11CreateDevice(nullptr, DriverTypes[DriverTypeIndex], nullptr, 0, FeatureLevels, NumFeatureLevels,
- D3D11_SDK_VERSION, &m_Device, &FeatureLevel, &m_DeviceContext);
- if (SUCCEEDED(hr))
- {
+ D3D11_SDK_VERSION, &m_Device, &FeatureLevel, &m_DeviceContext);
+ if (SUCCEEDED(hr)) {
// Device creation succeeded, no need to loop anymore
break;
}
}
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Device creation in OUTPUTMANAGER failed", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Get DXGI factory
IDXGIDevice* DxgiDevice = nullptr;
hr = m_Device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&DxgiDevice));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI for DXGI Device", L"Error", hr, nullptr);
}
@@ -103,79 +97,69 @@ DUPL_RETURN OUTPUTMANAGER::InitOutput(HWND Window, INT SingleOutput, _Out_ UINT*
hr = DxgiDevice->GetParent(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&DxgiAdapter));
DxgiDevice->Release();
DxgiDevice = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get parent DXGI Adapter", L"Error", hr, SystemTransitionsExpectedErrors);
}
hr = DxgiAdapter->GetParent(__uuidof(IDXGIFactory2), reinterpret_cast<void**>(&m_Factory));
DxgiAdapter->Release();
DxgiAdapter = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get parent DXGI Factory", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Register for occlusion status windows message
- if (m_WindowHandle)
- {
- hr = m_Factory->RegisterOcclusionStatusWindow(Window, OCCLUSION_STATUS_MSG, &m_OcclusionCookie);
- if (FAILED(hr))
- {
- return ProcessFailure(m_Device, L"Failed to register for occlusion message", L"Error", hr, SystemTransitionsExpectedErrors);
- }
- }
+ if (m_WindowHandle) {
+ hr = m_Factory->RegisterOcclusionStatusWindow(Window, OCCLUSION_STATUS_MSG, &m_OcclusionCookie);
+ if (FAILED(hr)) {
+ return ProcessFailure(m_Device, L"Failed to register for occlusion message", L"Error", hr, SystemTransitionsExpectedErrors);
+ }
+ }
// Get window size
RECT WindowRect;
- GetClientRect(m_WindowHandle ? m_WindowHandle : GetDesktopWindow(), &WindowRect);
+ GetClientRect(m_WindowHandle ? m_WindowHandle : GetDesktopWindow(), &WindowRect);
UINT Width = WindowRect.right - WindowRect.left;
UINT Height = WindowRect.bottom - WindowRect.top;
- if (m_WindowHandle)
- {
- // Create swapchain for window
- DXGI_SWAP_CHAIN_DESC1 SwapChainDesc;
- RtlZeroMemory(&SwapChainDesc, sizeof(SwapChainDesc));
-
- SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
- SwapChainDesc.BufferCount = 2;
- SwapChainDesc.Width = Width;
- SwapChainDesc.Height = Height;
- SwapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
- SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- SwapChainDesc.SampleDesc.Count = 1;
- SwapChainDesc.SampleDesc.Quality = 0;
- hr = m_Factory->CreateSwapChainForHwnd(m_Device, Window, &SwapChainDesc, nullptr, nullptr, &m_SwapChain);
- if (FAILED(hr))
- {
- return ProcessFailure(m_Device, L"Failed to create window swapchain", L"Error", hr, SystemTransitionsExpectedErrors);
- }
-
- // Disable the ALT-ENTER shortcut for entering full-screen mode
- hr = m_Factory->MakeWindowAssociation(Window, DXGI_MWA_NO_ALT_ENTER);
- if (FAILED(hr))
- {
- return ProcessFailure(m_Device, L"Failed to make window association", L"Error", hr, SystemTransitionsExpectedErrors);
- }
- }
+ if (m_WindowHandle) {
+ // Create swapchain for window
+ DXGI_SWAP_CHAIN_DESC1 SwapChainDesc;
+ RtlZeroMemory(&SwapChainDesc, sizeof(SwapChainDesc));
+
+ SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+ SwapChainDesc.BufferCount = 2;
+ SwapChainDesc.Width = Width;
+ SwapChainDesc.Height = Height;
+ SwapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
+ SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ SwapChainDesc.SampleDesc.Count = 1;
+ SwapChainDesc.SampleDesc.Quality = 0;
+ hr = m_Factory->CreateSwapChainForHwnd(m_Device, Window, &SwapChainDesc, nullptr, nullptr, &m_SwapChain);
+ if (FAILED(hr)) {
+ return ProcessFailure(m_Device, L"Failed to create window swapchain", L"Error", hr, SystemTransitionsExpectedErrors);
+ }
+
+ // Disable the ALT-ENTER shortcut for entering full-screen mode
+ hr = m_Factory->MakeWindowAssociation(Window, DXGI_MWA_NO_ALT_ENTER);
+ if (FAILED(hr)) {
+ return ProcessFailure(m_Device, L"Failed to make window association", L"Error", hr, SystemTransitionsExpectedErrors);
+ }
+ }
// Create shared texture
DUPL_RETURN Return = CreateSharedSurf(SingleOutput, OutCount, DeskBounds);
- if (Return != DUPL_RETURN_SUCCESS)
- {
+ if (Return != DUPL_RETURN_SUCCESS) {
return Return;
}
// Make new render target view
- if (m_WindowHandle)
- {
- Return = MakeRTV();
- if (Return != DUPL_RETURN_SUCCESS)
- {
- return Return;
- }
- }
+ if (m_WindowHandle) {
+ Return = MakeRTV();
+ if (Return != DUPL_RETURN_SUCCESS) {
+ return Return;
+ }
+ }
// Set view port
SetViewPort(Width, Height);
@@ -191,41 +175,37 @@ DUPL_RETURN OUTPUTMANAGER::InitOutput(HWND Window, INT SingleOutput, _Out_ UINT*
SampDesc.MinLOD = 0;
SampDesc.MaxLOD = D3D11_FLOAT32_MAX;
hr = m_Device->CreateSamplerState(&SampDesc, &m_SamplerLinear);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create sampler state in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
- if (m_WindowHandle)
- {
- // Create the blend state
- D3D11_BLEND_DESC BlendStateDesc;
- BlendStateDesc.AlphaToCoverageEnable = FALSE;
- BlendStateDesc.IndependentBlendEnable = FALSE;
- BlendStateDesc.RenderTarget[0].BlendEnable = TRUE;
- BlendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
- BlendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
- BlendStateDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
- BlendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
- BlendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
- BlendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
- BlendStateDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
- hr = m_Device->CreateBlendState(&BlendStateDesc, &m_BlendState);
- if (FAILED(hr))
- {
- return ProcessFailure(m_Device, L"Failed to create blend state in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
- }
-
- // Initialize shaders
- Return = InitShaders();
- if (Return != DUPL_RETURN_SUCCESS)
- {
- return Return;
- }
-
- GetWindowRect(m_WindowHandle, &WindowRect);
- MoveWindow(m_WindowHandle, WindowRect.left, WindowRect.top, (DeskBounds->right - DeskBounds->left) / 2, (DeskBounds->bottom - DeskBounds->top) / 2, TRUE);
- }
+ if (m_WindowHandle) {
+ // Create the blend state
+ D3D11_BLEND_DESC BlendStateDesc;
+ BlendStateDesc.AlphaToCoverageEnable = FALSE;
+ BlendStateDesc.IndependentBlendEnable = FALSE;
+ BlendStateDesc.RenderTarget[0].BlendEnable = TRUE;
+ BlendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
+ BlendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
+ BlendStateDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ BlendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
+ BlendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
+ BlendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ BlendStateDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+ hr = m_Device->CreateBlendState(&BlendStateDesc, &m_BlendState);
+ if (FAILED(hr)) {
+ return ProcessFailure(m_Device, L"Failed to create blend state in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
+ }
+
+ // Initialize shaders
+ Return = InitShaders();
+ if (Return != DUPL_RETURN_SUCCESS) {
+ return Return;
+ }
+
+ GetWindowRect(m_WindowHandle, &WindowRect);
+ MoveWindow(m_WindowHandle, WindowRect.left, WindowRect.top, (DeskBounds->right - DeskBounds->left) / 2, (DeskBounds->bottom - DeskBounds->top) / 2, TRUE);
+ }
return Return;
}
@@ -240,8 +220,7 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
// Get DXGI resources
IDXGIDevice* DxgiDevice = nullptr;
hr = m_Device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&DxgiDevice));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI for DXGI Device", L"Error", hr);
}
@@ -249,8 +228,7 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
hr = DxgiDevice->GetParent(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&DxgiAdapter));
DxgiDevice->Release();
DxgiDevice = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get parent DXGI Adapter", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -264,19 +242,15 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
// Figure out right dimensions for full size desktop texture and # of outputs to duplicate
UINT OutputCount;
- if (SingleOutput < 0)
- {
+ if (SingleOutput < 0) {
hr = S_OK;
- for (OutputCount = 0; SUCCEEDED(hr); ++OutputCount)
- {
- if (DxgiOutput)
- {
+ for (OutputCount = 0; SUCCEEDED(hr); ++OutputCount) {
+ if (DxgiOutput) {
DxgiOutput->Release();
DxgiOutput = nullptr;
}
hr = DxgiAdapter->EnumOutputs(OutputCount, &DxgiOutput);
- if (DxgiOutput && (hr != DXGI_ERROR_NOT_FOUND))
- {
+ if (DxgiOutput && (hr != DXGI_ERROR_NOT_FOUND)) {
DXGI_OUTPUT_DESC DesktopDesc;
DxgiOutput->GetDesc(&DesktopDesc);
@@ -289,11 +263,9 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
--OutputCount;
}
- else
- {
+ else {
hr = DxgiAdapter->EnumOutputs(SingleOutput, &DxgiOutput);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
DxgiAdapter->Release();
DxgiAdapter = nullptr;
return ProcessFailure(m_Device, L"Output specified to be duplicated does not exist", L"Error", hr);
@@ -314,8 +286,7 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
// Set passed in output count variable
*OutCount = OutputCount;
- if (OutputCount == 0)
- {
+ if (OutputCount == 0) {
// We could not find any outputs, the system must be in a transition so return expected error
// so we will attempt to recreate
return DUPL_RETURN_ERROR_EXPECTED;
@@ -336,10 +307,8 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
DeskTexD.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
hr = m_Device->CreateTexture2D(&DeskTexD, nullptr, &m_SharedSurf);
- if (FAILED(hr))
- {
- if (OutputCount != 1)
- {
+ if (FAILED(hr)) {
+ if (OutputCount != 1) {
// If we are duplicating the complete desktop we try to create a single texture to hold the
// complete desktop image and blit updates from the per output DDA interface. The GPU can
// always support a texture size of the maximum resolution of any single output but there is no
@@ -348,16 +317,14 @@ DUPL_RETURN OUTPUTMANAGER::CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCou
// we could revert back to using GDI to update the window in this failure case.
return ProcessFailure(m_Device, L"Failed to create DirectX shared texture - we are attempting to create a texture the size of the complete desktop and this may be larger than the maximum texture size of your GPU. Please try again using the -output command line parameter to duplicate only 1 monitor or configure your computer to a single monitor configuration", L"Error", hr, SystemTransitionsExpectedErrors);
}
- else
- {
+ else {
return ProcessFailure(m_Device, L"Failed to create shared texture", L"Error", hr, SystemTransitionsExpectedErrors);
}
}
// Get keyed mutex
hr = m_SharedSurf->QueryInterface(__uuidof(IDXGIKeyedMutex), reinterpret_cast<void**>(&m_KeyMutex));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to query for keyed mutex in OUTPUTMANAGER", L"Error", hr);
}
@@ -376,23 +343,19 @@ DUPL_RETURN OUTPUTMANAGER::UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _
// Try and acquire sync on common display buffer
HRESULT hr = m_KeyMutex->AcquireSync(1, 100);
- if (hr == static_cast<HRESULT>(WAIT_TIMEOUT))
- {
+ if (hr == static_cast<HRESULT>(WAIT_TIMEOUT)) {
// Another thread has the keyed mutex so try again later
return DUPL_RETURN_SUCCESS;
}
- else if (FAILED(hr))
- {
+ else if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to acquire Keyed mutex in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Got mutex, so draw
DUPL_RETURN Ret = DrawFrame();
- if (Ret == DUPL_RETURN_SUCCESS)
- {
+ if (Ret == DUPL_RETURN_SUCCESS) {
// We have keyed mutex so we can access the mouse info
- if (PointerInfo->Visible)
- {
+ if (PointerInfo->Visible) {
// Draw mouse into texture
Ret = DrawMouse(PointerInfo);
}
@@ -400,27 +363,22 @@ DUPL_RETURN OUTPUTMANAGER::UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _
// Release keyed mutex
hr = m_KeyMutex->ReleaseSync(0);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to Release Keyed mutex in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Present to window if all worked
- if (Ret == DUPL_RETURN_SUCCESS)
- {
+ if (Ret == DUPL_RETURN_SUCCESS) {
// Present to window
- if (m_SwapChain)
- {
- hr = m_SwapChain->Present(1, 0);
- if (FAILED(hr))
- {
- return ProcessFailure(m_Device, L"Failed to present", L"Error", hr, SystemTransitionsExpectedErrors);
- }
- else if (hr == DXGI_STATUS_OCCLUDED)
- {
- *Occluded = true;
- }
- }
+ if (m_SwapChain) {
+ hr = m_SwapChain->Present(1, 0);
+ if (FAILED(hr)) {
+ return ProcessFailure(m_Device, L"Failed to present", L"Error", hr, SystemTransitionsExpectedErrors);
+ }
+ else if (hr == DXGI_STATUS_OCCLUDED) {
+ *Occluded = true;
+ }
+ }
}
return Ret;
@@ -436,8 +394,7 @@ HANDLE OUTPUTMANAGER::GetSharedHandle()
// QI IDXGIResource interface to synchronized shared surface.
IDXGIResource* DXGIResource = nullptr;
HRESULT hr = m_SharedSurf->QueryInterface(__uuidof(IDXGIResource), reinterpret_cast<void**>(&DXGIResource));
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Obtain handle to IDXGIResource object.
DXGIResource->GetSharedHandle(&Hnd);
DXGIResource->Release();
@@ -455,19 +412,16 @@ DUPL_RETURN OUTPUTMANAGER::DrawFrame()
HRESULT hr;
// If window was resized, resize swapchain
- if (m_NeedsResize)
- {
+ if (m_NeedsResize) {
DUPL_RETURN Ret = ResizeSwapChain();
- if (Ret != DUPL_RETURN_SUCCESS)
- {
+ if (Ret != DUPL_RETURN_SUCCESS) {
return Ret;
}
m_NeedsResize = false;
}
// Vertices for drawing whole texture
- VERTEX Vertices[NUMVERTICES] =
- {
+ VERTEX Vertices[NUMVERTICES] = {
{XMFLOAT3(-1.0f, -1.0f, 0), XMFLOAT2(0.0f, 1.0f)},
{XMFLOAT3(-1.0f, 1.0f, 0), XMFLOAT2(0.0f, 0.0f)},
{XMFLOAT3(1.0f, -1.0f, 0), XMFLOAT2(1.0f, 1.0f)},
@@ -488,8 +442,7 @@ DUPL_RETURN OUTPUTMANAGER::DrawFrame()
// Create new shader resource view
ID3D11ShaderResourceView* ShaderResource = nullptr;
hr = m_Device->CreateShaderResourceView(m_SharedSurf, &ShaderDesc, &ShaderResource);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create shader resource when drawing a frame", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -519,8 +472,7 @@ DUPL_RETURN OUTPUTMANAGER::DrawFrame()
// Create vertex buffer
hr = m_Device->CreateBuffer(&BufferDesc, &InitData, &VertexBuffer);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
ShaderResource->Release();
ShaderResource = nullptr;
return ProcessFailure(m_Device, L"Failed to create vertex buffer when drawing a frame", L"Error", hr, SystemTransitionsExpectedErrors);
@@ -543,7 +495,7 @@ DUPL_RETURN OUTPUTMANAGER::DrawFrame()
//
// Process both masked and monochrome pointers
//
-DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight * *PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box)
+DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight **PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box)
{
// Desktop dimensions
D3D11_TEXTURE2D_DESC FullDesc;
@@ -556,39 +508,31 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
INT GivenTop = PtrInfo->Position.y;
// Figure out if any adjustment is needed for out of bound positions
- if (GivenLeft < 0)
- {
+ if (GivenLeft < 0) {
*PtrWidth = GivenLeft + static_cast<INT>(PtrInfo->ShapeInfo.Width);
}
- else if ((GivenLeft + static_cast<INT>(PtrInfo->ShapeInfo.Width)) > DesktopWidth)
- {
+ else if ((GivenLeft + static_cast<INT>(PtrInfo->ShapeInfo.Width)) > DesktopWidth) {
*PtrWidth = DesktopWidth - GivenLeft;
}
- else
- {
+ else {
*PtrWidth = static_cast<INT>(PtrInfo->ShapeInfo.Width);
}
- if (IsMono)
- {
+ if (IsMono) {
PtrInfo->ShapeInfo.Height = PtrInfo->ShapeInfo.Height / 2;
}
- if (GivenTop < 0)
- {
+ if (GivenTop < 0) {
*PtrHeight = GivenTop + static_cast<INT>(PtrInfo->ShapeInfo.Height);
}
- else if ((GivenTop + static_cast<INT>(PtrInfo->ShapeInfo.Height)) > DesktopHeight)
- {
+ else if ((GivenTop + static_cast<INT>(PtrInfo->ShapeInfo.Height)) > DesktopHeight) {
*PtrHeight = DesktopHeight - GivenTop;
}
- else
- {
+ else {
*PtrHeight = static_cast<INT>(PtrInfo->ShapeInfo.Height);
}
- if (IsMono)
- {
+ if (IsMono) {
PtrInfo->ShapeInfo.Height = PtrInfo->ShapeInfo.Height * 2;
}
@@ -611,8 +555,7 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
ID3D11Texture2D* CopyBuffer = nullptr;
HRESULT hr = m_Device->CreateTexture2D(&CopyBufferDesc, nullptr, &CopyBuffer);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed creating staging texture for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -628,25 +571,22 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
hr = CopyBuffer->QueryInterface(__uuidof(IDXGISurface), (void **)&CopySurface);
CopyBuffer->Release();
CopyBuffer = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to QI staging texture into IDXGISurface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Map pixels
DXGI_MAPPED_RECT MappedSurface;
hr = CopySurface->Map(&MappedSurface, DXGI_MAP_READ);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
CopySurface->Release();
CopySurface = nullptr;
return ProcessFailure(m_Device, L"Failed to map surface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
}
// New mouseshape buffer
- *InitBuffer = new (std::nothrow) BYTE[*PtrWidth * *PtrHeight * BPP];
- if (!(*InitBuffer))
- {
+ *InitBuffer = new (std::nothrow) BYTE[*PtrWidth **PtrHeight * BPP];
+ if (!(*InitBuffer)) {
return ProcessFailure(nullptr, L"Failed to allocate memory for new mouse shape buffer.", L"Error", E_OUTOFMEMORY);
}
@@ -658,15 +598,12 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
UINT SkipX = (GivenLeft < 0) ? (-1 * GivenLeft) : (0);
UINT SkipY = (GivenTop < 0) ? (-1 * GivenTop) : (0);
- if (IsMono)
- {
- for (INT Row = 0; Row < *PtrHeight; ++Row)
- {
+ if (IsMono) {
+ for (INT Row = 0; Row < *PtrHeight; ++Row) {
// Set mask
BYTE Mask = 0x80;
Mask = Mask >> (SkipX % 8);
- for (INT Col = 0; Col < *PtrWidth; ++Col)
- {
+ for (INT Col = 0; Col < *PtrWidth; ++Col) {
// Get masks using appropriate offsets
BYTE AndMask = PtrInfo->PtrShapeBuffer[((Col + SkipX) / 8) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch))] & Mask;
BYTE XorMask = PtrInfo->PtrShapeBuffer[((Col + SkipX) / 8) + ((Row + SkipY + (PtrInfo->ShapeInfo.Height / 2)) * (PtrInfo->ShapeInfo.Pitch))] & Mask;
@@ -674,40 +611,33 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
UINT XorMask32 = (XorMask) ? 0x00FFFFFF : 0x00000000;
// Set new pixel
- InitBuffer32[(Row * *PtrWidth) + Col] = (Desktop32[(Row * DesktopPitchInPixels) + Col] & AndMask32) ^ XorMask32;
+ InitBuffer32[(Row **PtrWidth) + Col] = (Desktop32[(Row * DesktopPitchInPixels) + Col] & AndMask32) ^ XorMask32;
// Adjust mask
- if (Mask == 0x01)
- {
+ if (Mask == 0x01) {
Mask = 0x80;
}
- else
- {
+ else {
Mask = Mask >> 1;
}
}
}
}
- else
- {
+ else {
UINT* Buffer32 = reinterpret_cast<UINT*>(PtrInfo->PtrShapeBuffer);
// Iterate through pixels
- for (INT Row = 0; Row < *PtrHeight; ++Row)
- {
- for (INT Col = 0; Col < *PtrWidth; ++Col)
- {
+ for (INT Row = 0; Row < *PtrHeight; ++Row) {
+ for (INT Col = 0; Col < *PtrWidth; ++Col) {
// Set up mask
UINT MaskVal = 0xFF000000 & Buffer32[(Col + SkipX) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch / sizeof(UINT)))];
- if (MaskVal)
- {
+ if (MaskVal) {
// Mask was 0xFF
- InitBuffer32[(Row * *PtrWidth) + Col] = (Desktop32[(Row * DesktopPitchInPixels) + Col] ^ Buffer32[(Col + SkipX) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch / sizeof(UINT)))]) | 0xFF000000;
+ InitBuffer32[(Row **PtrWidth) + Col] = (Desktop32[(Row * DesktopPitchInPixels) + Col] ^ Buffer32[(Col + SkipX) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch / sizeof(UINT)))]) | 0xFF000000;
}
- else
- {
+ else {
// Mask was 0x00
- InitBuffer32[(Row * *PtrWidth) + Col] = Buffer32[(Col + SkipX) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch / sizeof(UINT)))] | 0xFF000000;
+ InitBuffer32[(Row **PtrWidth) + Col] = Buffer32[(Col + SkipX) + ((Row + SkipY) * (PtrInfo->ShapeInfo.Pitch / sizeof(UINT)))] | 0xFF000000;
}
}
}
@@ -717,8 +647,7 @@ DUPL_RETURN OUTPUTMANAGER::ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInf
hr = CopySurface->Unmap();
CopySurface->Release();
CopySurface = nullptr;
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to unmap surface for pointer", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -739,8 +668,7 @@ DUPL_RETURN OUTPUTMANAGER::DrawMouse(_In_ PTR_INFO* PtrInfo)
D3D11_SHADER_RESOURCE_VIEW_DESC SDesc;
// Position will be changed based on mouse position
- VERTEX Vertices[NUMVERTICES] =
- {
+ VERTEX Vertices[NUMVERTICES] = {
{XMFLOAT3(-1.0f, -1.0f, 0), XMFLOAT2(0.0f, 1.0f)},
{XMFLOAT3(-1.0f, 1.0f, 0), XMFLOAT2(0.0f, 0.0f)},
{XMFLOAT3(1.0f, -1.0f, 0), XMFLOAT2(1.0f, 1.0f)},
@@ -788,33 +716,29 @@ DUPL_RETURN OUTPUTMANAGER::DrawMouse(_In_ PTR_INFO* PtrInfo)
SDesc.Texture2D.MostDetailedMip = Desc.MipLevels - 1;
SDesc.Texture2D.MipLevels = Desc.MipLevels;
- switch (PtrInfo->ShapeInfo.Type)
- {
- case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR:
- {
- PtrLeft = PtrInfo->Position.x;
- PtrTop = PtrInfo->Position.y;
+ switch (PtrInfo->ShapeInfo.Type) {
+ case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR: {
+ PtrLeft = PtrInfo->Position.x;
+ PtrTop = PtrInfo->Position.y;
- PtrWidth = static_cast<INT>(PtrInfo->ShapeInfo.Width);
- PtrHeight = static_cast<INT>(PtrInfo->ShapeInfo.Height);
+ PtrWidth = static_cast<INT>(PtrInfo->ShapeInfo.Width);
+ PtrHeight = static_cast<INT>(PtrInfo->ShapeInfo.Height);
- break;
- }
+ break;
+ }
- case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME:
- {
- ProcessMonoMask(true, PtrInfo, &PtrWidth, &PtrHeight, &PtrLeft, &PtrTop, &InitBuffer, &Box);
- break;
- }
+ case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME: {
+ ProcessMonoMask(true, PtrInfo, &PtrWidth, &PtrHeight, &PtrLeft, &PtrTop, &InitBuffer, &Box);
+ break;
+ }
- case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR:
- {
- ProcessMonoMask(false, PtrInfo, &PtrWidth, &PtrHeight, &PtrLeft, &PtrTop, &InitBuffer, &Box);
- break;
- }
+ case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR: {
+ ProcessMonoMask(false, PtrInfo, &PtrWidth, &PtrHeight, &PtrLeft, &PtrTop, &InitBuffer, &Box);
+ break;
+ }
- default:
- break;
+ default:
+ break;
}
// VERTEX creation
@@ -842,15 +766,13 @@ DUPL_RETURN OUTPUTMANAGER::DrawMouse(_In_ PTR_INFO* PtrInfo)
// Create mouseshape as texture
HRESULT hr = m_Device->CreateTexture2D(&Desc, &InitData, &MouseTex);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create mouse pointer texture", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Create shader resource from texture
hr = m_Device->CreateShaderResourceView(MouseTex, &SDesc, &ShaderRes);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
MouseTex->Release();
MouseTex = nullptr;
return ProcessFailure(m_Device, L"Failed to create shader resource from mouse pointer texture", L"Error", hr, SystemTransitionsExpectedErrors);
@@ -868,8 +790,7 @@ DUPL_RETURN OUTPUTMANAGER::DrawMouse(_In_ PTR_INFO* PtrInfo)
// Create vertex buffer
hr = m_Device->CreateBuffer(&BDesc, &InitData, &VertexBufferMouse);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
ShaderRes->Release();
ShaderRes = nullptr;
MouseTex->Release();
@@ -893,23 +814,19 @@ DUPL_RETURN OUTPUTMANAGER::DrawMouse(_In_ PTR_INFO* PtrInfo)
m_DeviceContext->Draw(NUMVERTICES, 0);
// Clean
- if (VertexBufferMouse)
- {
+ if (VertexBufferMouse) {
VertexBufferMouse->Release();
VertexBufferMouse = nullptr;
}
- if (ShaderRes)
- {
+ if (ShaderRes) {
ShaderRes->Release();
ShaderRes = nullptr;
}
- if (MouseTex)
- {
+ if (MouseTex) {
MouseTex->Release();
MouseTex = nullptr;
}
- if (InitBuffer)
- {
+ if (InitBuffer) {
delete [] InitBuffer;
InitBuffer = nullptr;
}
@@ -926,28 +843,24 @@ DUPL_RETURN OUTPUTMANAGER::InitShaders()
UINT Size = ARRAYSIZE(g_VS);
hr = m_Device->CreateVertexShader(g_VS, Size, nullptr, &m_VertexShader);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create vertex shader in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
- D3D11_INPUT_ELEMENT_DESC Layout[] =
- {
+ D3D11_INPUT_ELEMENT_DESC Layout[] = {
{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
{"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}
};
UINT NumElements = ARRAYSIZE(Layout);
hr = m_Device->CreateInputLayout(Layout, NumElements, g_VS, Size, &m_InputLayout);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create input layout in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
m_DeviceContext->IASetInputLayout(m_InputLayout);
Size = ARRAYSIZE(g_PS);
hr = m_Device->CreatePixelShader(g_PS, Size, nullptr, &m_PixelShader);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create pixel shader in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -962,16 +875,14 @@ DUPL_RETURN OUTPUTMANAGER::MakeRTV()
// Get backbuffer
ID3D11Texture2D* BackBuffer = nullptr;
HRESULT hr = m_SwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&BackBuffer));
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to get backbuffer for making render target view in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Create a render target view
hr = m_Device->CreateRenderTargetView(BackBuffer, nullptr, &m_RTV);
BackBuffer->Release();
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to create render target view in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -1001,8 +912,7 @@ void OUTPUTMANAGER::SetViewPort(UINT Width, UINT Height)
//
DUPL_RETURN OUTPUTMANAGER::ResizeSwapChain()
{
- if (m_RTV)
- {
+ if (m_RTV) {
m_RTV->Release();
m_RTV = nullptr;
}
@@ -1016,15 +926,13 @@ DUPL_RETURN OUTPUTMANAGER::ResizeSwapChain()
DXGI_SWAP_CHAIN_DESC SwapChainDesc;
m_SwapChain->GetDesc(&SwapChainDesc);
HRESULT hr = m_SwapChain->ResizeBuffers(SwapChainDesc.BufferCount, Width, Height, SwapChainDesc.BufferDesc.Format, SwapChainDesc.Flags);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(m_Device, L"Failed to resize swapchain buffers in OUTPUTMANAGER", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Make new render target view
DUPL_RETURN Ret = MakeRTV();
- if (Ret != DUPL_RETURN_SUCCESS)
- {
+ if (Ret != DUPL_RETURN_SUCCESS) {
return Ret;
}
@@ -1039,76 +947,63 @@ DUPL_RETURN OUTPUTMANAGER::ResizeSwapChain()
//
void OUTPUTMANAGER::CleanRefs()
{
- if (m_VertexShader)
- {
+ if (m_VertexShader) {
m_VertexShader->Release();
m_VertexShader = nullptr;
}
- if (m_PixelShader)
- {
+ if (m_PixelShader) {
m_PixelShader->Release();
m_PixelShader = nullptr;
}
- if (m_InputLayout)
- {
+ if (m_InputLayout) {
m_InputLayout->Release();
m_InputLayout = nullptr;
}
- if (m_RTV)
- {
+ if (m_RTV) {
m_RTV->Release();
m_RTV = nullptr;
}
- if (m_SamplerLinear)
- {
+ if (m_SamplerLinear) {
m_SamplerLinear->Release();
m_SamplerLinear = nullptr;
}
- if (m_BlendState)
- {
+ if (m_BlendState) {
m_BlendState->Release();
m_BlendState = nullptr;
}
- if (m_DeviceContext)
- {
+ if (m_DeviceContext) {
m_DeviceContext->Release();
m_DeviceContext = nullptr;
}
- if (m_Device)
- {
+ if (m_Device) {
m_Device->Release();
m_Device = nullptr;
}
- if (m_SwapChain)
- {
+ if (m_SwapChain) {
m_SwapChain->Release();
m_SwapChain = nullptr;
}
- if (m_SharedSurf)
- {
+ if (m_SharedSurf) {
m_SharedSurf->Release();
m_SharedSurf = nullptr;
}
- if (m_KeyMutex)
- {
+ if (m_KeyMutex) {
m_KeyMutex->Release();
m_KeyMutex = nullptr;
}
- if (m_Factory)
- {
- if (m_OcclusionCookie)
- {
+ if (m_Factory) {
+ if (m_OcclusionCookie) {
m_Factory->UnregisterOcclusionStatus(m_OcclusionCookie);
m_OcclusionCookie = 0;
}
diff --git a/plugins/pluginWinDD/internals/OutputManager.h b/plugins/pluginWinDD/internals/OutputManager.h
index cd16e5f..fa1902a 100755
--- a/plugins/pluginWinDD/internals/OutputManager.h
+++ b/plugins/pluginWinDD/internals/OutputManager.h
@@ -19,43 +19,43 @@
//
class OUTPUTMANAGER
{
- public:
- OUTPUTMANAGER();
- ~OUTPUTMANAGER();
- DUPL_RETURN InitOutput(HWND Window, INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
- DUPL_RETURN UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _Inout_ bool* Occluded);
- void CleanRefs();
- HANDLE GetSharedHandle();
- void WindowResize();
+public:
+ OUTPUTMANAGER();
+ ~OUTPUTMANAGER();
+ DUPL_RETURN InitOutput(HWND Window, INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
+ DUPL_RETURN UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _Inout_ bool* Occluded);
+ void CleanRefs();
+ HANDLE GetSharedHandle();
+ void WindowResize();
- private:
+private:
// Methods
- DUPL_RETURN ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight * *PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box);
- DUPL_RETURN MakeRTV();
- void SetViewPort(UINT Width, UINT Height);
- DUPL_RETURN InitShaders();
- DUPL_RETURN InitGeometry();
- DUPL_RETURN CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
- DUPL_RETURN DrawFrame();
- DUPL_RETURN DrawMouse(_In_ PTR_INFO* PtrInfo);
- DUPL_RETURN ResizeSwapChain();
+ DUPL_RETURN ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight **PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box);
+ DUPL_RETURN MakeRTV();
+ void SetViewPort(UINT Width, UINT Height);
+ DUPL_RETURN InitShaders();
+ DUPL_RETURN InitGeometry();
+ DUPL_RETURN CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
+ DUPL_RETURN DrawFrame();
+ DUPL_RETURN DrawMouse(_In_ PTR_INFO* PtrInfo);
+ DUPL_RETURN ResizeSwapChain();
// Vars
- IDXGISwapChain1* m_SwapChain;
- ID3D11Device* m_Device;
- IDXGIFactory2* m_Factory;
- ID3D11DeviceContext* m_DeviceContext;
- ID3D11RenderTargetView* m_RTV;
- ID3D11SamplerState* m_SamplerLinear;
- ID3D11BlendState* m_BlendState;
- ID3D11VertexShader* m_VertexShader;
- ID3D11PixelShader* m_PixelShader;
- ID3D11InputLayout* m_InputLayout;
- ID3D11Texture2D* m_SharedSurf;
- IDXGIKeyedMutex* m_KeyMutex;
- HWND m_WindowHandle;
- bool m_NeedsResize;
- DWORD m_OcclusionCookie;
+ IDXGISwapChain1* m_SwapChain;
+ ID3D11Device* m_Device;
+ IDXGIFactory2* m_Factory;
+ ID3D11DeviceContext* m_DeviceContext;
+ ID3D11RenderTargetView* m_RTV;
+ ID3D11SamplerState* m_SamplerLinear;
+ ID3D11BlendState* m_BlendState;
+ ID3D11VertexShader* m_VertexShader;
+ ID3D11PixelShader* m_PixelShader;
+ ID3D11InputLayout* m_InputLayout;
+ ID3D11Texture2D* m_SharedSurf;
+ IDXGIKeyedMutex* m_KeyMutex;
+ HWND m_WindowHandle;
+ bool m_NeedsResize;
+ DWORD m_OcclusionCookie;
};
#endif
diff --git a/plugins/pluginWinDD/internals/ThreadManager.cxx b/plugins/pluginWinDD/internals/ThreadManager.cxx
index 68fe757..fcae447 100755
--- a/plugins/pluginWinDD/internals/ThreadManager.cxx
+++ b/plugins/pluginWinDD/internals/ThreadManager.cxx
@@ -10,8 +10,8 @@
DWORD WINAPI DDProc(_In_ void* Param);
THREADMANAGER::THREADMANAGER() : m_ThreadCount(0),
- m_ThreadHandles(nullptr),
- m_ThreadData(nullptr)
+ m_ThreadHandles(nullptr),
+ m_ThreadData(nullptr)
{
RtlZeroMemory(&m_PtrInfo, sizeof(m_PtrInfo));
}
@@ -26,19 +26,15 @@ THREADMANAGER::~THREADMANAGER()
//
void THREADMANAGER::Clean()
{
- if (m_PtrInfo.PtrShapeBuffer)
- {
+ if (m_PtrInfo.PtrShapeBuffer) {
delete [] m_PtrInfo.PtrShapeBuffer;
m_PtrInfo.PtrShapeBuffer = nullptr;
}
RtlZeroMemory(&m_PtrInfo, sizeof(m_PtrInfo));
- if (m_ThreadHandles)
- {
- for (UINT i = 0; i < m_ThreadCount; ++i)
- {
- if (m_ThreadHandles[i])
- {
+ if (m_ThreadHandles) {
+ for (UINT i = 0; i < m_ThreadCount; ++i) {
+ if (m_ThreadHandles[i]) {
CloseHandle(m_ThreadHandles[i]);
}
}
@@ -46,10 +42,8 @@ void THREADMANAGER::Clean()
m_ThreadHandles = nullptr;
}
- if (m_ThreadData)
- {
- for (UINT i = 0; i < m_ThreadCount; ++i)
- {
+ if (m_ThreadData) {
+ for (UINT i = 0; i < m_ThreadCount; ++i) {
CleanDx(&m_ThreadData[i].DxRes);
}
delete [] m_ThreadData;
@@ -64,38 +58,32 @@ void THREADMANAGER::Clean()
//
void THREADMANAGER::CleanDx(_Inout_ DX_RESOURCES* Data)
{
- if (Data->Device)
- {
+ if (Data->Device) {
Data->Device->Release();
Data->Device = nullptr;
}
- if (Data->Context)
- {
+ if (Data->Context) {
Data->Context->Release();
Data->Context = nullptr;
}
- if (Data->VertexShader)
- {
+ if (Data->VertexShader) {
Data->VertexShader->Release();
Data->VertexShader = nullptr;
}
- if (Data->PixelShader)
- {
+ if (Data->PixelShader) {
Data->PixelShader->Release();
Data->PixelShader = nullptr;
}
- if (Data->InputLayout)
- {
+ if (Data->InputLayout) {
Data->InputLayout->Release();
Data->InputLayout = nullptr;
}
- if (Data->SamplerLinear)
- {
+ if (Data->SamplerLinear) {
Data->SamplerLinear->Release();
Data->SamplerLinear = nullptr;
}
@@ -109,15 +97,13 @@ DUPL_RETURN THREADMANAGER::Initialize(INT SingleOutput, UINT OutputCount, HANDLE
m_ThreadCount = OutputCount;
m_ThreadHandles = new (std::nothrow) HANDLE[m_ThreadCount];
m_ThreadData = new (std::nothrow) THREAD_DATA[m_ThreadCount];
- if (!m_ThreadHandles || !m_ThreadData)
- {
+ if (!m_ThreadHandles || !m_ThreadData) {
return ProcessFailure(nullptr, L"Failed to allocate array for threads", L"Error", E_OUTOFMEMORY);
}
// Create appropriate # of threads for duplication
DUPL_RETURN Ret = DUPL_RETURN_SUCCESS;
- for (UINT i = 0; i < m_ThreadCount; ++i)
- {
+ for (UINT i = 0; i < m_ThreadCount; ++i) {
m_ThreadData[i].UnexpectedErrorEvent = UnexpectedErrorEvent;
m_ThreadData[i].ExpectedErrorEvent = ExpectedErrorEvent;
m_ThreadData[i].TerminateThreadsEvent = TerminateThreadsEvent;
@@ -126,19 +112,17 @@ DUPL_RETURN THREADMANAGER::Initialize(INT SingleOutput, UINT OutputCount, HANDLE
m_ThreadData[i].OffsetX = DesktopDim->left;
m_ThreadData[i].OffsetY = DesktopDim->top;
m_ThreadData[i].PtrInfo = &m_PtrInfo;
- m_ThreadData[i].Producer = Producer;
+ m_ThreadData[i].Producer = Producer;
RtlZeroMemory(&m_ThreadData[i].DxRes, sizeof(DX_RESOURCES));
Ret = InitializeDx(&m_ThreadData[i].DxRes);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
+ if (Ret != DUPL_RETURN_SUCCESS) {
return Ret;
}
DWORD ThreadId;
m_ThreadHandles[i] = CreateThread(nullptr, 0, DDProc, &m_ThreadData[i], 0, &ThreadId);
- if (m_ThreadHandles[i] == nullptr)
- {
+ if (m_ThreadHandles[i] == nullptr) {
return ProcessFailure(nullptr, L"Failed to create thread", L"Error", E_FAIL);
}
}
@@ -154,8 +138,7 @@ DUPL_RETURN THREADMANAGER::InitializeDx(_Out_ DX_RESOURCES* Data)
HRESULT hr = S_OK;
// Driver types supported
- D3D_DRIVER_TYPE DriverTypes[] =
- {
+ D3D_DRIVER_TYPE DriverTypes[] = {
D3D_DRIVER_TYPE_HARDWARE,
D3D_DRIVER_TYPE_WARP,
D3D_DRIVER_TYPE_REFERENCE,
@@ -163,8 +146,7 @@ DUPL_RETURN THREADMANAGER::InitializeDx(_Out_ DX_RESOURCES* Data)
UINT NumDriverTypes = ARRAYSIZE(DriverTypes);
// Feature levels supported
- D3D_FEATURE_LEVEL FeatureLevels[] =
- {
+ D3D_FEATURE_LEVEL FeatureLevels[] = {
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
@@ -175,39 +157,33 @@ DUPL_RETURN THREADMANAGER::InitializeDx(_Out_ DX_RESOURCES* Data)
D3D_FEATURE_LEVEL FeatureLevel;
// Create device
- for (UINT DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex)
- {
+ for (UINT DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex) {
hr = D3D11CreateDevice(nullptr, DriverTypes[DriverTypeIndex], nullptr, 0, FeatureLevels, NumFeatureLevels,
- D3D11_SDK_VERSION, &Data->Device, &FeatureLevel, &Data->Context);
- if (SUCCEEDED(hr))
- {
+ D3D11_SDK_VERSION, &Data->Device, &FeatureLevel, &Data->Context);
+ if (SUCCEEDED(hr)) {
// Device creation success, no need to loop anymore
break;
}
}
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(nullptr, L"Failed to create device in InitializeDx", L"Error", hr);
}
// VERTEX shader
UINT Size = ARRAYSIZE(g_VS);
hr = Data->Device->CreateVertexShader(g_VS, Size, nullptr, &Data->VertexShader);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(Data->Device, L"Failed to create vertex shader in InitializeDx", L"Error", hr, SystemTransitionsExpectedErrors);
}
// Input layout
- D3D11_INPUT_ELEMENT_DESC Layout[] =
- {
+ D3D11_INPUT_ELEMENT_DESC Layout[] = {
{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
{"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}
};
UINT NumElements = ARRAYSIZE(Layout);
hr = Data->Device->CreateInputLayout(Layout, NumElements, g_VS, Size, &Data->InputLayout);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(Data->Device, L"Failed to create input layout in InitializeDx", L"Error", hr, SystemTransitionsExpectedErrors);
}
Data->Context->IASetInputLayout(Data->InputLayout);
@@ -215,8 +191,7 @@ DUPL_RETURN THREADMANAGER::InitializeDx(_Out_ DX_RESOURCES* Data)
// Pixel shader
Size = ARRAYSIZE(g_PS);
hr = Data->Device->CreatePixelShader(g_PS, Size, nullptr, &Data->PixelShader);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(Data->Device, L"Failed to create pixel shader in InitializeDx", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -231,8 +206,7 @@ DUPL_RETURN THREADMANAGER::InitializeDx(_Out_ DX_RESOURCES* Data)
SampDesc.MinLOD = 0;
SampDesc.MaxLOD = D3D11_FLOAT32_MAX;
hr = Data->Device->CreateSamplerState(&SampDesc, &Data->SamplerLinear);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
return ProcessFailure(Data->Device, L"Failed to create sampler state in InitializeDx", L"Error", hr, SystemTransitionsExpectedErrors);
}
@@ -252,10 +226,9 @@ PTR_INFO* THREADMANAGER::GetPointerInfo()
//
bool THREADMANAGER::WaitForThreadTermination(DWORD timeout /*= INFINITE*/)
{
- bool bRet = true;
- if (m_ThreadCount != 0)
- {
- bRet = (WaitForMultipleObjectsEx(m_ThreadCount, m_ThreadHandles, TRUE, timeout, FALSE) != WAIT_TIMEOUT);
+ bool bRet = true;
+ if (m_ThreadCount != 0) {
+ bRet = (WaitForMultipleObjectsEx(m_ThreadCount, m_ThreadHandles, TRUE, timeout, FALSE) != WAIT_TIMEOUT);
}
- return bRet;
+ return bRet;
}
diff --git a/plugins/pluginWinDD/internals/ThreadManager.h b/plugins/pluginWinDD/internals/ThreadManager.h
index d710998..2a9157f 100755
--- a/plugins/pluginWinDD/internals/ThreadManager.h
+++ b/plugins/pluginWinDD/internals/ThreadManager.h
@@ -12,22 +12,22 @@
class THREADMANAGER
{
- public:
- THREADMANAGER();
- ~THREADMANAGER();
- void Clean();
- DUPL_RETURN Initialize(INT SingleOutput, UINT OutputCount, HANDLE UnexpectedErrorEvent, HANDLE ExpectedErrorEvent, HANDLE TerminateThreadsEvent, HANDLE SharedHandle, _In_ const struct tmedia_producer_s* Producer, _In_ RECT* DesktopDim);
- PTR_INFO* GetPointerInfo();
- bool WaitForThreadTermination(DWORD timeout = INFINITE);
+public:
+ THREADMANAGER();
+ ~THREADMANAGER();
+ void Clean();
+ DUPL_RETURN Initialize(INT SingleOutput, UINT OutputCount, HANDLE UnexpectedErrorEvent, HANDLE ExpectedErrorEvent, HANDLE TerminateThreadsEvent, HANDLE SharedHandle, _In_ const struct tmedia_producer_s* Producer, _In_ RECT* DesktopDim);
+ PTR_INFO* GetPointerInfo();
+ bool WaitForThreadTermination(DWORD timeout = INFINITE);
- private:
- DUPL_RETURN InitializeDx(_Out_ DX_RESOURCES* Data);
- void CleanDx(_Inout_ DX_RESOURCES* Data);
+private:
+ DUPL_RETURN InitializeDx(_Out_ DX_RESOURCES* Data);
+ void CleanDx(_Inout_ DX_RESOURCES* Data);
- PTR_INFO m_PtrInfo;
- UINT m_ThreadCount;
- _Field_size_(m_ThreadCount) HANDLE* m_ThreadHandles;
- _Field_size_(m_ThreadCount) THREAD_DATA* m_ThreadData;
+ PTR_INFO m_PtrInfo;
+ UINT m_ThreadCount;
+ _Field_size_(m_ThreadCount) HANDLE* m_ThreadHandles;
+ _Field_size_(m_ThreadCount) THREAD_DATA* m_ThreadData;
};
#endif
diff --git a/plugins/pluginWinDD/plugin_win_dd_config.h b/plugins/pluginWinDD/plugin_win_dd_config.h
index a1d3855..70e6ce5 100755
--- a/plugins/pluginWinDD/plugin_win_dd_config.h
+++ b/plugins/pluginWinDD/plugin_win_dd_config.h
@@ -48,12 +48,12 @@
# define PLUGIN_WIN_DD_UNDER_X86 1
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define PLUGIN_WIN_DD_BEGIN_DECLS extern "C" {
# define PLUGIN_WIN_DD_END_DECLS }
#else
-# define PLUGIN_WIN_DD_BEGIN_DECLS
+# define PLUGIN_WIN_DD_BEGIN_DECLS
# define PLUGIN_WIN_DD_END_DECLS
#endif
diff --git a/plugins/pluginWinDD/plugin_win_dd_producer.cxx b/plugins/pluginWinDD/plugin_win_dd_producer.cxx
index 7c13767..01d857d 100755
--- a/plugins/pluginWinDD/plugin_win_dd_producer.cxx
+++ b/plugins/pluginWinDD/plugin_win_dd_producer.cxx
@@ -55,28 +55,27 @@
//
// plugin_win_dd_producer_t
//
-typedef struct plugin_win_dd_producer_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- bool bStarted, bPrepared, bMuted, bWindowHooked, bThreadTerminationDelayed;
- tsk_thread_handle_t* ppTread[1];
-
- OUTPUTMANAGER *pOutMgr;
- THREADMANAGER *pThreadMgr;
-
- // Window handles
- HWND hwndPreview;
- WNDPROC wndPreviewProc;
- HWND hwndSrc;
-
- // Synchronization
- HANDLE hlUnexpectedErrorEvent;
- HANDLE hlExpectedErrorEvent;
- HANDLE hlOcclutionEvent;
- HANDLE hlTerminateThreadsEvent;
-
- HCURSOR hcCursor;
+typedef struct plugin_win_dd_producer_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ bool bStarted, bPrepared, bMuted, bWindowHooked, bThreadTerminationDelayed;
+ tsk_thread_handle_t* ppTread[1];
+
+ OUTPUTMANAGER *pOutMgr;
+ THREADMANAGER *pThreadMgr;
+
+ // Window handles
+ HWND hwndPreview;
+ WNDPROC wndPreviewProc;
+ HWND hwndSrc;
+
+ // Synchronization
+ HANDLE hlUnexpectedErrorEvent;
+ HANDLE hlExpectedErrorEvent;
+ HANDLE hlOcclutionEvent;
+ HANDLE hlTerminateThreadsEvent;
+
+ HCURSOR hcCursor;
}
plugin_win_dd_producer_t;
@@ -97,11 +96,10 @@ static void* TSK_STDCALL DDThread(void *pArg);
//
// Class for progressive waits
//
-typedef struct
-{
- UINT WaitTime;
- UINT WaitCount;
-}WAIT_BAND;
+typedef struct {
+ UINT WaitTime;
+ UINT WaitCount;
+} WAIT_BAND;
#define WAIT_BAND_COUNT 3
#define WAIT_BAND_STOP 0
@@ -109,360 +107,316 @@ typedef struct
class DYNAMIC_WAIT
{
public:
- DYNAMIC_WAIT();
- ~DYNAMIC_WAIT();
+ DYNAMIC_WAIT();
+ ~DYNAMIC_WAIT();
- void Wait();
+ void Wait();
private:
- static const WAIT_BAND m_WaitBands[WAIT_BAND_COUNT];
+ static const WAIT_BAND m_WaitBands[WAIT_BAND_COUNT];
- // Period in seconds that a new wait call is considered part of the same wait sequence
- static const UINT m_WaitSequenceTimeInSeconds = 2;
+ // Period in seconds that a new wait call is considered part of the same wait sequence
+ static const UINT m_WaitSequenceTimeInSeconds = 2;
- UINT m_CurrentWaitBandIdx;
- UINT m_WaitCountInCurrentBand;
- LARGE_INTEGER m_QPCFrequency;
- LARGE_INTEGER m_LastWakeUpTime;
- BOOL m_QPCValid;
+ UINT m_CurrentWaitBandIdx;
+ UINT m_WaitCountInCurrentBand;
+ LARGE_INTEGER m_QPCFrequency;
+ LARGE_INTEGER m_LastWakeUpTime;
+ BOOL m_QPCValid;
};
const WAIT_BAND DYNAMIC_WAIT::m_WaitBands[WAIT_BAND_COUNT] = {
- { 250, 20 },
- { 2000, 60 },
- { 5000, WAIT_BAND_STOP } // Never move past this band
+ { 250, 20 },
+ { 2000, 60 },
+ { 5000, WAIT_BAND_STOP } // Never move past this band
};
/* ============ Video DD Producer Interface ================= */
static int plugin_win_dd_producer_set(tmedia_producer_t *p_self, const tmedia_param_t* pc_param)
{
- int ret = -1;
- plugin_win_dd_producer_t* p_dd = (plugin_win_dd_producer_t*)p_self;
-
- if (!p_dd || !pc_param)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pc_param->value_type == tmedia_pvt_int64)
- {
- if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd"))
- {
- HWND hwnd = (HWND)*((int64_t*)pc_param->value);
- ret = SUCCEEDED(HookWindow(p_dd, hwnd)) ? 0 : -1;
- }
- else if (tsk_striequals(pc_param->key, "src-hwnd"))
- {
- p_dd->hwndSrc = (HWND)*((int64_t*)pc_param->value);
- ret = 0;
- }
- }
- else if (pc_param->value_type == tmedia_pvt_int32)
- {
- if (tsk_striequals(pc_param->key, "mute"))
- {
- p_dd->bMuted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
- ret = 0;
- }
- }
-
- return ret;
+ int ret = -1;
+ plugin_win_dd_producer_t* p_dd = (plugin_win_dd_producer_t*)p_self;
+
+ if (!p_dd || !pc_param) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pc_param->value_type == tmedia_pvt_int64) {
+ if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
+ HWND hwnd = (HWND)*((int64_t*)pc_param->value);
+ ret = SUCCEEDED(HookWindow(p_dd, hwnd)) ? 0 : -1;
+ }
+ else if (tsk_striequals(pc_param->key, "src-hwnd")) {
+ p_dd->hwndSrc = (HWND)*((int64_t*)pc_param->value);
+ ret = 0;
+ }
+ }
+ else if (pc_param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(pc_param->key, "mute")) {
+ p_dd->bMuted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
+ ret = 0;
+ }
+ }
+
+ return ret;
}
static int plugin_win_dd_producer_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
- HRESULT hr = S_OK;
-
- if (!pSelf || !codec && codec->plugin)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- if (pSelf->bPrepared)
- {
- DD_DEBUG_WARN("DD video producer already prepared");
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- if (pSelf->bThreadTerminationDelayed)
- {
- DD_DEBUG_INFO("Thread termination was delayed ...cleanup now");
- if (_plugin_win_dd_producer_unprepare(pSelf, true/*cleanup?*/) != 0)
- {
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
- }
-
- TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
- TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
-
- DD_DEBUG_INFO("DD video producer: fps=%d, width=%d, height=%d",
- TMEDIA_PRODUCER(pSelf)->video.fps,
- TMEDIA_PRODUCER(pSelf)->video.width,
- TMEDIA_PRODUCER(pSelf)->video.height);
-
- // Event used by the threads to signal an unexpected error and we want to quit the app
- if (!pSelf->hlUnexpectedErrorEvent && !(pSelf->hlUnexpectedErrorEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr)))
- {
- ProcessFailure(nullptr, L"UnexpectedErrorEvent creation failed", L"Error", E_UNEXPECTED);
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- // Event for when a thread encounters an expected error
- if (!pSelf->hlExpectedErrorEvent && !(pSelf->hlExpectedErrorEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr)))
- {
- ProcessFailure(nullptr, L"ExpectedErrorEvent creation failed", L"Error", E_UNEXPECTED);
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- // Event for Occlution
- if (!pSelf->hlOcclutionEvent && !(pSelf->hlOcclutionEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr)))
- {
- ProcessFailure(nullptr, L"OcclutionEvent creation failed", L"Error", E_UNEXPECTED);
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- // Event to tell spawned threads to quit
- if (!pSelf->hlTerminateThreadsEvent && !(pSelf->hlTerminateThreadsEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr)))
- {
- ProcessFailure(nullptr, L"TerminateThreadsEvent creation failed", L"Error", E_UNEXPECTED);
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- // Load simple cursor
- if (!pSelf->hcCursor && !(pSelf->hcCursor = LoadCursor(nullptr, IDC_ARROW)))
- {
- ProcessFailure(nullptr, L"Cursor load failed", L"Error", E_UNEXPECTED);
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- if (!pSelf->pOutMgr && !(pSelf->pOutMgr = new OUTPUTMANAGER()))
- {
- ProcessFailure(nullptr, L"Out manager allocation failed", L"Error", E_OUTOFMEMORY);
- DD_CHECK_HR(hr = E_OUTOFMEMORY);
- }
-
- if (!pSelf->pThreadMgr && !(pSelf->pThreadMgr = new THREADMANAGER()))
- {
- ProcessFailure(nullptr, L"Thread managed allocation failed", L"Error", E_OUTOFMEMORY);
- DD_CHECK_HR(hr = E_OUTOFMEMORY);
- }
+ plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
+ HRESULT hr = S_OK;
+
+ if (!pSelf || !codec && codec->plugin) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ if (pSelf->bPrepared) {
+ DD_DEBUG_WARN("DD video producer already prepared");
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ if (pSelf->bThreadTerminationDelayed) {
+ DD_DEBUG_INFO("Thread termination was delayed ...cleanup now");
+ if (_plugin_win_dd_producer_unprepare(pSelf, true/*cleanup?*/) != 0) {
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+ }
+
+ TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+ TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
+
+ DD_DEBUG_INFO("DD video producer: fps=%d, width=%d, height=%d",
+ TMEDIA_PRODUCER(pSelf)->video.fps,
+ TMEDIA_PRODUCER(pSelf)->video.width,
+ TMEDIA_PRODUCER(pSelf)->video.height);
+
+ // Event used by the threads to signal an unexpected error and we want to quit the app
+ if (!pSelf->hlUnexpectedErrorEvent && !(pSelf->hlUnexpectedErrorEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr))) {
+ ProcessFailure(nullptr, L"UnexpectedErrorEvent creation failed", L"Error", E_UNEXPECTED);
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ // Event for when a thread encounters an expected error
+ if (!pSelf->hlExpectedErrorEvent && !(pSelf->hlExpectedErrorEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr))) {
+ ProcessFailure(nullptr, L"ExpectedErrorEvent creation failed", L"Error", E_UNEXPECTED);
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ // Event for Occlution
+ if (!pSelf->hlOcclutionEvent && !(pSelf->hlOcclutionEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr))) {
+ ProcessFailure(nullptr, L"OcclutionEvent creation failed", L"Error", E_UNEXPECTED);
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ // Event to tell spawned threads to quit
+ if (!pSelf->hlTerminateThreadsEvent && !(pSelf->hlTerminateThreadsEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr))) {
+ ProcessFailure(nullptr, L"TerminateThreadsEvent creation failed", L"Error", E_UNEXPECTED);
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ // Load simple cursor
+ if (!pSelf->hcCursor && !(pSelf->hcCursor = LoadCursor(nullptr, IDC_ARROW))) {
+ ProcessFailure(nullptr, L"Cursor load failed", L"Error", E_UNEXPECTED);
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ if (!pSelf->pOutMgr && !(pSelf->pOutMgr = new OUTPUTMANAGER())) {
+ ProcessFailure(nullptr, L"Out manager allocation failed", L"Error", E_OUTOFMEMORY);
+ DD_CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+
+ if (!pSelf->pThreadMgr && !(pSelf->pThreadMgr = new THREADMANAGER())) {
+ ProcessFailure(nullptr, L"Thread managed allocation failed", L"Error", E_OUTOFMEMORY);
+ DD_CHECK_HR(hr = E_OUTOFMEMORY);
+ }
bail:
- pSelf->bPrepared = SUCCEEDED(hr);
- return SUCCEEDED(hr) ? 0 : -1;
+ pSelf->bPrepared = SUCCEEDED(hr);
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_dd_producer_start(tmedia_producer_t* self)
{
- plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
- HRESULT hr = S_OK;
-
- if (!pSelf)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pSelf->bStarted)
- {
- DD_DEBUG_INFO("Producer already started");
- goto bail;
- }
- if (!pSelf->bPrepared)
- {
- DD_DEBUG_ERROR("Producer not prepared");
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- DD_CHECK_HR(hr = HookWindow(pSelf, pSelf->hwndPreview));
-
- // Start asynchronous watcher thread
- pSelf->bStarted = true;
- int ret = tsk_thread_create(&pSelf->ppTread[0], DDThread, pSelf);
- if (ret != 0)
- {
- TSK_DEBUG_ERROR("Failed to create thread");
- pSelf->bStarted = false;
- if (pSelf->ppTread[0])
- {
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
+ plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
+ HRESULT hr = S_OK;
+
+ if (!pSelf) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pSelf->bStarted) {
+ DD_DEBUG_INFO("Producer already started");
+ goto bail;
+ }
+ if (!pSelf->bPrepared) {
+ DD_DEBUG_ERROR("Producer not prepared");
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ DD_CHECK_HR(hr = HookWindow(pSelf, pSelf->hwndPreview));
+
+ // Start asynchronous watcher thread
+ pSelf->bStarted = true;
+ int ret = tsk_thread_create(&pSelf->ppTread[0], DDThread, pSelf);
+ if (ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ pSelf->bStarted = false;
+ if (pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
bail:
- if (FAILED(hr))
- {
- UnhookWindow(pSelf);
- return -1;
- }
- pSelf->bStarted = true;
- return 0;
+ if (FAILED(hr)) {
+ UnhookWindow(pSelf);
+ return -1;
+ }
+ pSelf->bStarted = true;
+ return 0;
}
static int plugin_win_dd_producer_pause(tmedia_producer_t* self)
{
- plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
-
- if (!pSelf)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!pSelf->bStarted)
- {
- DD_DEBUG_INFO("MF video producer not started");
- }
-
- return 0;
+ plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
+
+ if (!pSelf) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!pSelf->bStarted) {
+ DD_DEBUG_INFO("MF video producer not started");
+ }
+
+ return 0;
}
static int plugin_win_dd_producer_stop(tmedia_producer_t* self)
{
- plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
-
- if (!pSelf)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- pSelf->bStarted = false;
-
- UnhookWindow(pSelf);
-
- if (pSelf->hlTerminateThreadsEvent)
- {
- SetEvent(pSelf->hlTerminateThreadsEvent);
- }
- if (pSelf->ppTread[0])
- {
- tsk_thread_join(&pSelf->ppTread[0]);
- }
-
- // next start() will be called after prepare()
- int ret = _plugin_win_dd_producer_unprepare(pSelf);
-
- return ret;
+ plugin_win_dd_producer_t* pSelf = (plugin_win_dd_producer_t*)self;
+
+ if (!pSelf) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ pSelf->bStarted = false;
+
+ UnhookWindow(pSelf);
+
+ if (pSelf->hlTerminateThreadsEvent) {
+ SetEvent(pSelf->hlTerminateThreadsEvent);
+ }
+ if (pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+
+ // next start() will be called after prepare()
+ int ret = _plugin_win_dd_producer_unprepare(pSelf);
+
+ return ret;
}
static int _plugin_win_dd_producer_unprepare(plugin_win_dd_producer_t* pSelf, bool bCleanup /*= false*/)
{
- HRESULT hr = S_OK;
-
- if (!pSelf)
- {
- DD_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pSelf->bStarted)
- {
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
-
- pSelf->bThreadTerminationDelayed = false;
-
- // Thread manager must be destroyed before the events and output manager
- if (pSelf->pThreadMgr)
- {
- // if we are cleaning the producer then all threads must exit only when all threads are destroyed
- // https://code.google.com/p/sincity/issues/detail?id=7
- if (pSelf->pThreadMgr->WaitForThreadTermination(bCleanup ? INFINITE : DD_DDPROC_THREAD_TIMEOUT) == true)
- {
- delete pSelf->pThreadMgr;
- pSelf->pThreadMgr = nullptr;
- }
- else
- {
- // Thread wait timedout
- DD_DEBUG_WARN("DDProc thread termination delayed");
- pSelf->bThreadTerminationDelayed = true;
- }
- }
-
- if (!pSelf->bThreadTerminationDelayed)
- {
- if (pSelf->hlUnexpectedErrorEvent)
- {
- CloseHandle(pSelf->hlUnexpectedErrorEvent);
- pSelf->hlUnexpectedErrorEvent = nullptr;
- }
- if (pSelf->hlExpectedErrorEvent)
- {
- CloseHandle(pSelf->hlExpectedErrorEvent);
- pSelf->hlExpectedErrorEvent = nullptr;
- }
- if (pSelf->hlOcclutionEvent)
- {
- CloseHandle(pSelf->hlOcclutionEvent);
- pSelf->hlOcclutionEvent = nullptr;
- }
- if (pSelf->hlTerminateThreadsEvent)
- {
- CloseHandle(pSelf->hlTerminateThreadsEvent);
- pSelf->hlTerminateThreadsEvent = nullptr;
- }
-
- if (pSelf->hcCursor)
- {
- DestroyCursor(pSelf->hcCursor);
- pSelf->hcCursor = nullptr;
- }
-
- if (pSelf->pOutMgr)
- {
- delete pSelf->pOutMgr;
- pSelf->pOutMgr = nullptr;
- }
- }
-
- pSelf->bPrepared = false;
+ HRESULT hr = S_OK;
+
+ if (!pSelf) {
+ DD_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pSelf->bStarted) {
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ pSelf->bThreadTerminationDelayed = false;
+
+ // Thread manager must be destroyed before the events and output manager
+ if (pSelf->pThreadMgr) {
+ // if we are cleaning the producer then all threads must exit only when all threads are destroyed
+ // https://code.google.com/p/sincity/issues/detail?id=7
+ if (pSelf->pThreadMgr->WaitForThreadTermination(bCleanup ? INFINITE : DD_DDPROC_THREAD_TIMEOUT) == true) {
+ delete pSelf->pThreadMgr;
+ pSelf->pThreadMgr = nullptr;
+ }
+ else {
+ // Thread wait timedout
+ DD_DEBUG_WARN("DDProc thread termination delayed");
+ pSelf->bThreadTerminationDelayed = true;
+ }
+ }
+
+ if (!pSelf->bThreadTerminationDelayed) {
+ if (pSelf->hlUnexpectedErrorEvent) {
+ CloseHandle(pSelf->hlUnexpectedErrorEvent);
+ pSelf->hlUnexpectedErrorEvent = nullptr;
+ }
+ if (pSelf->hlExpectedErrorEvent) {
+ CloseHandle(pSelf->hlExpectedErrorEvent);
+ pSelf->hlExpectedErrorEvent = nullptr;
+ }
+ if (pSelf->hlOcclutionEvent) {
+ CloseHandle(pSelf->hlOcclutionEvent);
+ pSelf->hlOcclutionEvent = nullptr;
+ }
+ if (pSelf->hlTerminateThreadsEvent) {
+ CloseHandle(pSelf->hlTerminateThreadsEvent);
+ pSelf->hlTerminateThreadsEvent = nullptr;
+ }
+
+ if (pSelf->hcCursor) {
+ DestroyCursor(pSelf->hcCursor);
+ pSelf->hcCursor = nullptr;
+ }
+
+ if (pSelf->pOutMgr) {
+ delete pSelf->pOutMgr;
+ pSelf->pOutMgr = nullptr;
+ }
+ }
+
+ pSelf->bPrepared = false;
bail:
- return 0;
+ return 0;
}
static HRESULT HookWindow(struct plugin_win_dd_producer_s *pSelf, HWND hWnd)
{
- HRESULT hr = S_OK;
-
- DD_CHECK_HR(hr = UnhookWindow(pSelf));
-
- if ((pSelf->hwndPreview = hWnd))
- {
- pSelf->wndPreviewProc = (WNDPROC)SetWindowLongPtr(pSelf->hwndPreview, GWLP_WNDPROC, (LONG_PTR)WndProc);
- if (!pSelf->wndPreviewProc)
- {
- DD_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
- DD_CHECK_HR(hr = E_FAIL);
- }
- SetProp(pSelf->hwndPreview, L"Self", pSelf);
- pSelf->bWindowHooked = true;
- }
+ HRESULT hr = S_OK;
+
+ DD_CHECK_HR(hr = UnhookWindow(pSelf));
+
+ if ((pSelf->hwndPreview = hWnd)) {
+ pSelf->wndPreviewProc = (WNDPROC)SetWindowLongPtr(pSelf->hwndPreview, GWLP_WNDPROC, (LONG_PTR)WndProc);
+ if (!pSelf->wndPreviewProc) {
+ DD_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
+ DD_CHECK_HR(hr = E_FAIL);
+ }
+ SetProp(pSelf->hwndPreview, L"Self", pSelf);
+ pSelf->bWindowHooked = true;
+ }
bail:
- return S_OK;
+ return S_OK;
}
static HRESULT UnhookWindow(struct plugin_win_dd_producer_s *pSelf)
{
- if (pSelf->hwndPreview && pSelf->wndPreviewProc)
- {
- SetWindowLongPtr(pSelf->hwndPreview, GWLP_WNDPROC, (LONG_PTR)pSelf->wndPreviewProc);
- pSelf->wndPreviewProc = NULL;
- }
- if (pSelf->hwndPreview)
- {
- ::InvalidateRect(pSelf->hwndPreview, NULL, FALSE);
- }
- pSelf->bWindowHooked = false;
- return S_OK;
+ if (pSelf->hwndPreview && pSelf->wndPreviewProc) {
+ SetWindowLongPtr(pSelf->hwndPreview, GWLP_WNDPROC, (LONG_PTR)pSelf->wndPreviewProc);
+ pSelf->wndPreviewProc = NULL;
+ }
+ if (pSelf->hwndPreview) {
+ ::InvalidateRect(pSelf->hwndPreview, NULL, FALSE);
+ }
+ pSelf->bWindowHooked = false;
+ return S_OK;
}
//
@@ -471,66 +425,61 @@ static HRESULT UnhookWindow(struct plugin_win_dd_producer_s *pSelf)
/* constructor */
static tsk_object_t* plugin_win_dd_producer_ctor(tsk_object_t * self, va_list * app)
{
- plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)self;
- if (pSelf)
- {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
-
- /* init self with default values*/
- TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
- TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_rgb32;
- TMEDIA_PRODUCER(pSelf)->video.fps = 15;
- TMEDIA_PRODUCER(pSelf)->video.width = 352;
- TMEDIA_PRODUCER(pSelf)->video.height = 288;
-
- DD_DEBUG_INFO("Create Microsoft Desktop Duplication producer");
- }
- return self;
+ plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)self;
+ if (pSelf) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
+
+ /* init self with default values*/
+ TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
+ TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_rgb32;
+ TMEDIA_PRODUCER(pSelf)->video.fps = 15;
+ TMEDIA_PRODUCER(pSelf)->video.width = 352;
+ TMEDIA_PRODUCER(pSelf)->video.height = 288;
+
+ DD_DEBUG_INFO("Create Microsoft Desktop Duplication producer");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_dd_producer_dtor(tsk_object_t * self)
{
- plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)self;
- if (pSelf)
- {
- /* stop */
- if (pSelf->bStarted)
- {
- plugin_win_dd_producer_stop(TMEDIA_PRODUCER(pSelf));
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
- /* deinit self */
- _plugin_win_dd_producer_unprepare(pSelf, true/*cleanup*/);
-
- DD_DEBUG_INFO("*** WinDD producer destroyed ***");
- }
-
- return self;
+ plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)self;
+ if (pSelf) {
+ /* stop */
+ if (pSelf->bStarted) {
+ plugin_win_dd_producer_stop(TMEDIA_PRODUCER(pSelf));
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
+ /* deinit self */
+ _plugin_win_dd_producer_unprepare(pSelf, true/*cleanup*/);
+
+ DD_DEBUG_INFO("*** WinDD producer destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_dd_producer_def_s =
-{
- sizeof(plugin_win_dd_producer_t),
- plugin_win_dd_producer_ctor,
- plugin_win_dd_producer_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_win_dd_producer_def_s = {
+ sizeof(plugin_win_dd_producer_t),
+ plugin_win_dd_producer_ctor,
+ plugin_win_dd_producer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_win_dd_producer_plugin_def_s =
-{
- &plugin_win_dd_producer_def_s,
+static const tmedia_producer_plugin_def_t plugin_win_dd_producer_plugin_def_s = {
+ &plugin_win_dd_producer_def_s,
- tmedia_bfcp_video,
- "Microsoft Windows Desktop Duplication producer (Video)",
+ tmedia_bfcp_video,
+ "Microsoft Windows Desktop Duplication producer (Video)",
- plugin_win_dd_producer_set,
- plugin_win_dd_producer_prepare,
- plugin_win_dd_producer_start,
- plugin_win_dd_producer_pause,
- plugin_win_dd_producer_stop
+ plugin_win_dd_producer_set,
+ plugin_win_dd_producer_prepare,
+ plugin_win_dd_producer_start,
+ plugin_win_dd_producer_pause,
+ plugin_win_dd_producer_stop
};
const tmedia_producer_plugin_def_t *plugin_win_dd_producer_plugin_def_t = &plugin_win_dd_producer_plugin_def_s;
@@ -545,130 +494,115 @@ const tmedia_producer_plugin_def_t *plugin_win_dd_producer_plugin_def_t = &plugi
// These are the errors we expect from general Dxgi API due to a transition
HRESULT SystemTransitionsExpectedErrors[] = {
- DXGI_ERROR_DEVICE_REMOVED,
- DXGI_ERROR_ACCESS_LOST,
- static_cast<HRESULT>(WAIT_ABANDONED),
- S_OK // Terminate list with zero valued HRESULT
+ DXGI_ERROR_DEVICE_REMOVED,
+ DXGI_ERROR_ACCESS_LOST,
+ static_cast<HRESULT>(WAIT_ABANDONED),
+ S_OK // Terminate list with zero valued HRESULT
};
// These are the errors we expect from IDXGIOutput1::DuplicateOutput due to a transition
HRESULT CreateDuplicationExpectedErrors[] = {
- DXGI_ERROR_DEVICE_REMOVED,
- static_cast<HRESULT>(E_ACCESSDENIED),
- DXGI_ERROR_UNSUPPORTED,
- DXGI_ERROR_SESSION_DISCONNECTED,
- S_OK // Terminate list with zero valued HRESULT
+ DXGI_ERROR_DEVICE_REMOVED,
+ static_cast<HRESULT>(E_ACCESSDENIED),
+ DXGI_ERROR_UNSUPPORTED,
+ DXGI_ERROR_SESSION_DISCONNECTED,
+ S_OK // Terminate list with zero valued HRESULT
};
// These are the errors we expect from IDXGIOutputDuplication methods due to a transition
HRESULT FrameInfoExpectedErrors[] = {
- DXGI_ERROR_DEVICE_REMOVED,
- DXGI_ERROR_ACCESS_LOST,
- S_OK // Terminate list with zero valued HRESULT
+ DXGI_ERROR_DEVICE_REMOVED,
+ DXGI_ERROR_ACCESS_LOST,
+ S_OK // Terminate list with zero valued HRESULT
};
// These are the errors we expect from IDXGIAdapter::EnumOutputs methods due to outputs becoming stale during a transition
HRESULT EnumOutputsExpectedErrors[] = {
- DXGI_ERROR_NOT_FOUND,
- S_OK // Terminate list with zero valued HRESULT
+ DXGI_ERROR_NOT_FOUND,
+ S_OK // Terminate list with zero valued HRESULT
};
_Post_satisfies_(return != DUPL_RETURN_SUCCESS)
- DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors)
+DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors)
{
- HRESULT TranslatedHr;
-
- // On an error check if the DX device is lost
- if (Device)
- {
- HRESULT DeviceRemovedReason = Device->GetDeviceRemovedReason();
-
- switch (DeviceRemovedReason)
- {
- case DXGI_ERROR_DEVICE_REMOVED:
- case DXGI_ERROR_DEVICE_RESET:
- case static_cast<HRESULT>(E_OUTOFMEMORY) :
- {
- // Our device has been stopped due to an external event on the GPU so map them all to
- // device removed and continue processing the condition
- TranslatedHr = DXGI_ERROR_DEVICE_REMOVED;
- break;
- }
-
- case S_OK:
- {
- // Device is not removed so use original error
- TranslatedHr = hr;
- break;
- }
-
- default:
- {
- // Device is removed but not a error we want to remap
- TranslatedHr = DeviceRemovedReason;
- }
- }
- }
- else
- {
- TranslatedHr = hr;
- }
-
- // Check if this error was expected or not
- if (ExpectedErrors)
- {
- HRESULT* CurrentResult = ExpectedErrors;
-
- while (*CurrentResult != S_OK)
- {
- if (*(CurrentResult++) == TranslatedHr)
- {
- return DUPL_RETURN_ERROR_EXPECTED;
- }
- }
- }
-
- // Error was not expected so display the message box
- DisplayMsg(Str, Title, TranslatedHr);
-
- return DUPL_RETURN_ERROR_UNEXPECTED;
+ HRESULT TranslatedHr;
+
+ // On an error check if the DX device is lost
+ if (Device) {
+ HRESULT DeviceRemovedReason = Device->GetDeviceRemovedReason();
+
+ switch (DeviceRemovedReason) {
+ case DXGI_ERROR_DEVICE_REMOVED:
+ case DXGI_ERROR_DEVICE_RESET:
+ case static_cast<HRESULT>(E_OUTOFMEMORY) : {
+ // Our device has been stopped due to an external event on the GPU so map them all to
+ // device removed and continue processing the condition
+ TranslatedHr = DXGI_ERROR_DEVICE_REMOVED;
+ break;
+ }
+
+ case S_OK: {
+ // Device is not removed so use original error
+ TranslatedHr = hr;
+ break;
+ }
+
+ default: {
+ // Device is removed but not a error we want to remap
+ TranslatedHr = DeviceRemovedReason;
+ }
+ }
+ }
+ else {
+ TranslatedHr = hr;
+ }
+
+ // Check if this error was expected or not
+ if (ExpectedErrors) {
+ HRESULT* CurrentResult = ExpectedErrors;
+
+ while (*CurrentResult != S_OK) {
+ if (*(CurrentResult++) == TranslatedHr) {
+ return DUPL_RETURN_ERROR_EXPECTED;
+ }
+ }
+ }
+
+ // Error was not expected so display the message box
+ DisplayMsg(Str, Title, TranslatedHr);
+
+ return DUPL_RETURN_ERROR_UNEXPECTED;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
- case WM_DESTROY:
- {
- PostQuitMessage(0);
- break;
- }
- case WM_SIZE:
- {
- // Tell output manager that window size has changed
- plugin_win_dd_producer_t* pSelf = static_cast<plugin_win_dd_producer_t*>(GetProp(hWnd, L"Self"));
- if (pSelf && pSelf->pOutMgr)
- {
- pSelf->pOutMgr->WindowResize();
- }
- break;
- }
- case OCCLUSION_STATUS_MSG:
- {
- plugin_win_dd_producer_t* pSelf = static_cast<plugin_win_dd_producer_t*>(GetProp(hWnd, L"Self"));
- if (pSelf && pSelf->hlOcclutionEvent)
- {
- SetEvent(pSelf->hlOcclutionEvent);
- }
- break;
- }
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
-
- return 0;
+ switch (message) {
+ case WM_DESTROY: {
+ PostQuitMessage(0);
+ break;
+ }
+ case WM_SIZE: {
+ // Tell output manager that window size has changed
+ plugin_win_dd_producer_t* pSelf = static_cast<plugin_win_dd_producer_t*>(GetProp(hWnd, L"Self"));
+ if (pSelf && pSelf->pOutMgr) {
+ pSelf->pOutMgr->WindowResize();
+ }
+ break;
+ }
+ case OCCLUSION_STATUS_MSG: {
+ plugin_win_dd_producer_t* pSelf = static_cast<plugin_win_dd_producer_t*>(GetProp(hWnd, L"Self"));
+ if (pSelf && pSelf->hlOcclutionEvent) {
+ SetEvent(pSelf->hlOcclutionEvent);
+ }
+ break;
+ }
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+
+ return 0;
}
//
@@ -676,399 +610,357 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
//
DWORD WINAPI DDProc(_In_ void* Param)
{
- DD_DEBUG_INFO("DDProc (producer) - ENTER");
-
- // Classes
- DISPLAYMANAGER DispMgr;
- DUPLICATIONMANAGER DuplMgr;
-
- // D3D objects
- ID3D11Texture2D* SharedSurf = nullptr;
- IDXGIKeyedMutex* KeyMutex = nullptr;
-
- // Data passed in from thread creation
- THREAD_DATA* TData = reinterpret_cast<THREAD_DATA*>(Param);
-
- // Get desktop
- DUPL_RETURN Ret;
- HDESK CurrentDesktop = nullptr;
- CurrentDesktop = OpenInputDesktop(0, FALSE, GENERIC_ALL);
- if (!CurrentDesktop)
- {
- // We do not have access to the desktop so request a retry
- SetEvent(TData->ExpectedErrorEvent);
- Ret = DUPL_RETURN_ERROR_EXPECTED;
- goto Exit;
- }
-
- // Attach desktop to this thread
- bool DesktopAttached = SetThreadDesktop(CurrentDesktop) != 0;
- CloseDesktop(CurrentDesktop);
- CurrentDesktop = nullptr;
- if (!DesktopAttached)
- {
- // We do not have access to the desktop so request a retry
- Ret = DUPL_RETURN_ERROR_EXPECTED;
- goto Exit;
- }
-
- // New display manager
- DispMgr.InitD3D(&TData->DxRes);
-
- // FPS manager
- uint64_t TimeNow, TimeLastFrame = 0;
- const uint64_t TimeFrameDuration = 1000 / TData->Producer->video.fps;
-
- // Obtain handle to sync shared Surface
- HRESULT hr = TData->DxRes.Device->OpenSharedResource(TData->TexSharedHandle, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&SharedSurf));
- if (FAILED(hr))
- {
- Ret = ProcessFailure(TData->DxRes.Device, L"Opening shared texture failed", L"Error", hr, SystemTransitionsExpectedErrors);
- goto Exit;
- }
-
- hr = SharedSurf->QueryInterface(__uuidof(IDXGIKeyedMutex), reinterpret_cast<void**>(&KeyMutex));
- if (FAILED(hr))
- {
- Ret = ProcessFailure(nullptr, L"Failed to get keyed mutex interface in spawned thread", L"Error", hr);
- goto Exit;
- }
-
- // Make duplication manager
- Ret = DuplMgr.InitDupl(TData->DxRes.Device, TData->DxRes.Context ,TData->Output);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- goto Exit;
- }
-
- // Get output description
- DXGI_OUTPUT_DESC DesktopDesc;
- RtlZeroMemory(&DesktopDesc, sizeof(DXGI_OUTPUT_DESC));
- DuplMgr.GetOutputDesc(&DesktopDesc);
-
- // Main duplication loop
- bool WaitToProcessCurrentFrame = false;
- FRAME_DATA CurrentData;
-
- while (TData->Producer->is_started && (WaitForSingleObjectEx(TData->TerminateThreadsEvent, 0, FALSE) == WAIT_TIMEOUT))
- {
- if (!WaitToProcessCurrentFrame)
- {
- // Get new frame from desktop duplication
- bool TimeOut;
- Ret = DuplMgr.GetFrame(&CurrentData, &TimeOut);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- // An error occurred getting the next frame drop out of loop which
- // will check if it was expected or not
- break;
- }
-
- // Check for timeout
- if (TimeOut)
- {
- // No new frame at the moment
- continue;
- }
- }
-
- // We have a new frame so try and process it
- // Try to acquire keyed mutex in order to access shared surface
- hr = KeyMutex->AcquireSync(0, 1000);
- if (hr == static_cast<HRESULT>(WAIT_TIMEOUT))
- {
- // Can't use shared surface right now, try again later
- WaitToProcessCurrentFrame = true;
- continue;
- }
- else if (FAILED(hr))
- {
- // Generic unknown failure
- Ret = ProcessFailure(TData->DxRes.Device, L"Unexpected error acquiring KeyMutex", L"Error", hr, SystemTransitionsExpectedErrors);
- DuplMgr.DoneWithFrame();
- break;
- }
-
- // We can now process the current frame
- WaitToProcessCurrentFrame = false;
-
- // Get mouse info
- Ret = DuplMgr.GetMouse(TData->PtrInfo, &(CurrentData.FrameInfo), TData->OffsetX, TData->OffsetY);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- DuplMgr.DoneWithFrame();
- KeyMutex->ReleaseSync(1);
- break;
- }
-
- // Process new frame
- Ret = DispMgr.ProcessFrame(&CurrentData, SharedSurf, TData->OffsetX, TData->OffsetY, &DesktopDesc);
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- DuplMgr.DoneWithFrame();
- KeyMutex->ReleaseSync(1);
- break;
- }
-
- // Release acquired keyed mutex
- hr = KeyMutex->ReleaseSync(1);
- if (FAILED(hr))
- {
- Ret = ProcessFailure(TData->DxRes.Device, L"Unexpected error releasing the keyed mutex", L"Error", hr, SystemTransitionsExpectedErrors);
- DuplMgr.DoneWithFrame();
- break;
- }
-
- // Send Frame Over the Network
- TimeNow = tsk_time_now();
- if ((TimeNow - TimeLastFrame) > TimeFrameDuration)
- {
- if (!((const plugin_win_dd_producer_t*)TData->Producer)->bMuted)
- {
- hr = DuplMgr.SendData(const_cast<struct tmedia_producer_s*>(TData->Producer), &CurrentData);
- }
- if (SUCCEEDED(hr))
- {
- TimeLastFrame = TimeNow;
- }
- }
+ DD_DEBUG_INFO("DDProc (producer) - ENTER");
+
+ // Classes
+ DISPLAYMANAGER DispMgr;
+ DUPLICATIONMANAGER DuplMgr;
+
+ // D3D objects
+ ID3D11Texture2D* SharedSurf = nullptr;
+ IDXGIKeyedMutex* KeyMutex = nullptr;
+
+ // Data passed in from thread creation
+ THREAD_DATA* TData = reinterpret_cast<THREAD_DATA*>(Param);
+
+ // Get desktop
+ DUPL_RETURN Ret;
+ HDESK CurrentDesktop = nullptr;
+ CurrentDesktop = OpenInputDesktop(0, FALSE, GENERIC_ALL);
+ if (!CurrentDesktop) {
+ // We do not have access to the desktop so request a retry
+ SetEvent(TData->ExpectedErrorEvent);
+ Ret = DUPL_RETURN_ERROR_EXPECTED;
+ goto Exit;
+ }
+
+ // Attach desktop to this thread
+ bool DesktopAttached = SetThreadDesktop(CurrentDesktop) != 0;
+ CloseDesktop(CurrentDesktop);
+ CurrentDesktop = nullptr;
+ if (!DesktopAttached) {
+ // We do not have access to the desktop so request a retry
+ Ret = DUPL_RETURN_ERROR_EXPECTED;
+ goto Exit;
+ }
+
+ // New display manager
+ DispMgr.InitD3D(&TData->DxRes);
+
+ // FPS manager
+ uint64_t TimeNow, TimeLastFrame = 0;
+ const uint64_t TimeFrameDuration = 1000 / TData->Producer->video.fps;
+
+ // Obtain handle to sync shared Surface
+ HRESULT hr = TData->DxRes.Device->OpenSharedResource(TData->TexSharedHandle, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&SharedSurf));
+ if (FAILED(hr)) {
+ Ret = ProcessFailure(TData->DxRes.Device, L"Opening shared texture failed", L"Error", hr, SystemTransitionsExpectedErrors);
+ goto Exit;
+ }
+
+ hr = SharedSurf->QueryInterface(__uuidof(IDXGIKeyedMutex), reinterpret_cast<void**>(&KeyMutex));
+ if (FAILED(hr)) {
+ Ret = ProcessFailure(nullptr, L"Failed to get keyed mutex interface in spawned thread", L"Error", hr);
+ goto Exit;
+ }
+
+ // Make duplication manager
+ Ret = DuplMgr.InitDupl(TData->DxRes.Device, TData->DxRes.Context ,TData->Output);
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ goto Exit;
+ }
+
+ // Get output description
+ DXGI_OUTPUT_DESC DesktopDesc;
+ RtlZeroMemory(&DesktopDesc, sizeof(DXGI_OUTPUT_DESC));
+ DuplMgr.GetOutputDesc(&DesktopDesc);
+
+ // Main duplication loop
+ bool WaitToProcessCurrentFrame = false;
+ FRAME_DATA CurrentData;
+
+ while (TData->Producer->is_started && (WaitForSingleObjectEx(TData->TerminateThreadsEvent, 0, FALSE) == WAIT_TIMEOUT)) {
+ if (!WaitToProcessCurrentFrame) {
+ // Get new frame from desktop duplication
+ bool TimeOut;
+ Ret = DuplMgr.GetFrame(&CurrentData, &TimeOut);
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ // An error occurred getting the next frame drop out of loop which
+ // will check if it was expected or not
+ break;
+ }
+
+ // Check for timeout
+ if (TimeOut) {
+ // No new frame at the moment
+ continue;
+ }
+ }
+
+ // We have a new frame so try and process it
+ // Try to acquire keyed mutex in order to access shared surface
+ hr = KeyMutex->AcquireSync(0, 1000);
+ if (hr == static_cast<HRESULT>(WAIT_TIMEOUT)) {
+ // Can't use shared surface right now, try again later
+ WaitToProcessCurrentFrame = true;
+ continue;
+ }
+ else if (FAILED(hr)) {
+ // Generic unknown failure
+ Ret = ProcessFailure(TData->DxRes.Device, L"Unexpected error acquiring KeyMutex", L"Error", hr, SystemTransitionsExpectedErrors);
+ DuplMgr.DoneWithFrame();
+ break;
+ }
+
+ // We can now process the current frame
+ WaitToProcessCurrentFrame = false;
+
+ // Get mouse info
+ Ret = DuplMgr.GetMouse(TData->PtrInfo, &(CurrentData.FrameInfo), TData->OffsetX, TData->OffsetY);
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ DuplMgr.DoneWithFrame();
+ KeyMutex->ReleaseSync(1);
+ break;
+ }
+
+ // Process new frame
+ Ret = DispMgr.ProcessFrame(&CurrentData, SharedSurf, TData->OffsetX, TData->OffsetY, &DesktopDesc);
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ DuplMgr.DoneWithFrame();
+ KeyMutex->ReleaseSync(1);
+ break;
+ }
+
+ // Release acquired keyed mutex
+ hr = KeyMutex->ReleaseSync(1);
+ if (FAILED(hr)) {
+ Ret = ProcessFailure(TData->DxRes.Device, L"Unexpected error releasing the keyed mutex", L"Error", hr, SystemTransitionsExpectedErrors);
+ DuplMgr.DoneWithFrame();
+ break;
+ }
+
+ // Send Frame Over the Network
+ TimeNow = tsk_time_now();
+ if ((TimeNow - TimeLastFrame) > TimeFrameDuration) {
+ if (!((const plugin_win_dd_producer_t*)TData->Producer)->bMuted) {
+ hr = DuplMgr.SendData(const_cast<struct tmedia_producer_s*>(TData->Producer), &CurrentData);
+ }
+ if (SUCCEEDED(hr)) {
+ TimeLastFrame = TimeNow;
+ }
+ }
#if 0
- else
- {
- DD_DEBUG_INFO("Skip frame");
- }
+ else {
+ DD_DEBUG_INFO("Skip frame");
+ }
#endif
- // Release frame back to desktop duplication
- Ret = DuplMgr.DoneWithFrame();
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- break;
- }
- }
+ // Release frame back to desktop duplication
+ Ret = DuplMgr.DoneWithFrame();
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ break;
+ }
+ }
Exit:
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- if (Ret == DUPL_RETURN_ERROR_EXPECTED)
- {
- // The system is in a transition state so request the duplication be restarted
- SetEvent(TData->ExpectedErrorEvent);
- }
- else
- {
- // Unexpected error so exit the application
- SetEvent(TData->UnexpectedErrorEvent);
- }
- }
-
- if (SharedSurf)
- {
- SharedSurf->Release();
- SharedSurf = nullptr;
- }
-
- if (KeyMutex)
- {
- KeyMutex->Release();
- KeyMutex = nullptr;
- }
-
- DD_DEBUG_INFO("DDProc (producer) - EXIT");
-
- return 0;
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ if (Ret == DUPL_RETURN_ERROR_EXPECTED) {
+ // The system is in a transition state so request the duplication be restarted
+ SetEvent(TData->ExpectedErrorEvent);
+ }
+ else {
+ // Unexpected error so exit the application
+ SetEvent(TData->UnexpectedErrorEvent);
+ }
+ }
+
+ if (SharedSurf) {
+ SharedSurf->Release();
+ SharedSurf = nullptr;
+ }
+
+ if (KeyMutex) {
+ KeyMutex->Release();
+ KeyMutex = nullptr;
+ }
+
+ DD_DEBUG_INFO("DDProc (producer) - EXIT");
+
+ return 0;
}
// Run session async thread
static void* TSK_STDCALL DDThread(void *pArg)
{
- plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)pArg;
- HRESULT hr = S_OK;
- INT SingleOutput = -1;
-
- RECT DeskBounds = {};
- UINT OutputCount = 1;
-
- bool FirstTime = true;
- bool Occluded = true;
- bool PreviewChanged = false;
- DYNAMIC_WAIT DynamicWait;
- HWND hwndPreview = NULL;
-
- DD_DEBUG_INFO("DDThread (producer) - ENTER");
-
- while (pSelf->bStarted)
- {
- DUPL_RETURN Ret = DUPL_RETURN_SUCCESS;
-
- // Check if Preview window changed
- PreviewChanged = (hwndPreview != pSelf->hwndPreview);
-
- if (WaitForSingleObjectEx(pSelf->hlOcclutionEvent, 0, FALSE) == WAIT_OBJECT_0)
- {
- Occluded = false;
- }
- if (WaitForSingleObjectEx(pSelf->hlUnexpectedErrorEvent, 0, FALSE) == WAIT_OBJECT_0)
- {
- // Unexpected error occurred so exit the application
- DD_CHECK_HR(hr = E_UNEXPECTED);
- }
- else if (FirstTime || PreviewChanged || WaitForSingleObjectEx(pSelf->hlExpectedErrorEvent, 0, FALSE) == WAIT_OBJECT_0)
- {
- if (PreviewChanged)
- {
- hwndPreview = pSelf->hwndPreview;
- }
-
- if (!FirstTime)
- {
- // Terminate other threads
- SetEvent(pSelf->hlTerminateThreadsEvent);
- pSelf->pThreadMgr->WaitForThreadTermination();
- ResetEvent(pSelf->hlTerminateThreadsEvent);
- ResetEvent(pSelf->hlExpectedErrorEvent);
-
- // Clean up
- pSelf->pThreadMgr->Clean();
- pSelf->pOutMgr->CleanRefs();
-
- // As we have encountered an error due to a system transition we wait before trying again, using this dynamic wait
- // the wait periods will get progressively long to avoid wasting too much system resource if this state lasts a long time
- DynamicWait.Wait();
- }
- else
- {
- // First time through the loop so nothing to clean up
- FirstTime = false;
- }
-
- // Re-initialize
- Ret = pSelf->pOutMgr->InitOutput(hwndPreview, SingleOutput, &OutputCount, &DeskBounds);
- if (Ret == DUPL_RETURN_SUCCESS)
- {
- HANDLE SharedHandle = pSelf->pOutMgr->GetSharedHandle();
- if (SharedHandle)
- {
- Ret = pSelf->pThreadMgr->Initialize(SingleOutput, OutputCount, pSelf->hlUnexpectedErrorEvent, pSelf->hlExpectedErrorEvent, pSelf->hlTerminateThreadsEvent, SharedHandle, TMEDIA_PRODUCER(pSelf), &DeskBounds);
- }
- else
- {
- DisplayMsg(L"Failed to get handle of shared surface", L"Error", S_OK);
- Ret = DUPL_RETURN_ERROR_UNEXPECTED;
- }
- }
-
-
- // We start off in occluded state and we should immediate get a occlusion status window message
- Occluded = true;
- }
- else
- {
- // Nothing else to do, so try to present to write out to window if not occluded
- if (!Occluded || !pSelf->bWindowHooked)
- {
- Ret = pSelf->pOutMgr->UpdateApplicationWindow(pSelf->pThreadMgr->GetPointerInfo(), &Occluded);
- }
- }
-
- // Check if for errors
- if (Ret != DUPL_RETURN_SUCCESS)
- {
- if (Ret == DUPL_RETURN_ERROR_EXPECTED)
- {
- // Some type of system transition is occurring so retry
- SetEvent(pSelf->hlExpectedErrorEvent);
- }
- else
- {
- // Unexpected error so exit
- DD_CHECK_HR(hr = E_UNEXPECTED);
- break;
- }
- }
- }
+ plugin_win_dd_producer_t *pSelf = (plugin_win_dd_producer_t *)pArg;
+ HRESULT hr = S_OK;
+ INT SingleOutput = -1;
+
+ RECT DeskBounds = {};
+ UINT OutputCount = 1;
+
+ bool FirstTime = true;
+ bool Occluded = true;
+ bool PreviewChanged = false;
+ DYNAMIC_WAIT DynamicWait;
+ HWND hwndPreview = NULL;
+
+ DD_DEBUG_INFO("DDThread (producer) - ENTER");
+
+ while (pSelf->bStarted) {
+ DUPL_RETURN Ret = DUPL_RETURN_SUCCESS;
+
+ // Check if Preview window changed
+ PreviewChanged = (hwndPreview != pSelf->hwndPreview);
+
+ if (WaitForSingleObjectEx(pSelf->hlOcclutionEvent, 0, FALSE) == WAIT_OBJECT_0) {
+ Occluded = false;
+ }
+ if (WaitForSingleObjectEx(pSelf->hlUnexpectedErrorEvent, 0, FALSE) == WAIT_OBJECT_0) {
+ // Unexpected error occurred so exit the application
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ }
+ else if (FirstTime || PreviewChanged || WaitForSingleObjectEx(pSelf->hlExpectedErrorEvent, 0, FALSE) == WAIT_OBJECT_0) {
+ if (PreviewChanged) {
+ hwndPreview = pSelf->hwndPreview;
+ }
+
+ if (!FirstTime) {
+ // Terminate other threads
+ SetEvent(pSelf->hlTerminateThreadsEvent);
+ pSelf->pThreadMgr->WaitForThreadTermination();
+ ResetEvent(pSelf->hlTerminateThreadsEvent);
+ ResetEvent(pSelf->hlExpectedErrorEvent);
+
+ // Clean up
+ pSelf->pThreadMgr->Clean();
+ pSelf->pOutMgr->CleanRefs();
+
+ // As we have encountered an error due to a system transition we wait before trying again, using this dynamic wait
+ // the wait periods will get progressively long to avoid wasting too much system resource if this state lasts a long time
+ DynamicWait.Wait();
+ }
+ else {
+ // First time through the loop so nothing to clean up
+ FirstTime = false;
+ }
+
+ // Re-initialize
+ Ret = pSelf->pOutMgr->InitOutput(hwndPreview, SingleOutput, &OutputCount, &DeskBounds);
+ if (Ret == DUPL_RETURN_SUCCESS) {
+ HANDLE SharedHandle = pSelf->pOutMgr->GetSharedHandle();
+ if (SharedHandle) {
+ Ret = pSelf->pThreadMgr->Initialize(SingleOutput, OutputCount, pSelf->hlUnexpectedErrorEvent, pSelf->hlExpectedErrorEvent, pSelf->hlTerminateThreadsEvent, SharedHandle, TMEDIA_PRODUCER(pSelf), &DeskBounds);
+ }
+ else {
+ DisplayMsg(L"Failed to get handle of shared surface", L"Error", S_OK);
+ Ret = DUPL_RETURN_ERROR_UNEXPECTED;
+ }
+ }
+
+
+ // We start off in occluded state and we should immediate get a occlusion status window message
+ Occluded = true;
+ }
+ else {
+ // Nothing else to do, so try to present to write out to window if not occluded
+ if (!Occluded || !pSelf->bWindowHooked) {
+ Ret = pSelf->pOutMgr->UpdateApplicationWindow(pSelf->pThreadMgr->GetPointerInfo(), &Occluded);
+ }
+ }
+
+ // Check if for errors
+ if (Ret != DUPL_RETURN_SUCCESS) {
+ if (Ret == DUPL_RETURN_ERROR_EXPECTED) {
+ // Some type of system transition is occurring so retry
+ SetEvent(pSelf->hlExpectedErrorEvent);
+ }
+ else {
+ // Unexpected error so exit
+ DD_CHECK_HR(hr = E_UNEXPECTED);
+ break;
+ }
+ }
+ }
bail:
-
- DD_DEBUG_INFO("DDThread (producer) - BAIL");
+
+ DD_DEBUG_INFO("DDThread (producer) - BAIL");
#if 0 // Done by unprepare()
- // Make sure all other threads have exited
- if (SetEvent(pSelf->hlTerminateThreadsEvent))
- {
- ThreadMgr.WaitForThreadTermination();
- }
-
- // Clean up
- CloseHandle(pSelf->hlUnexpectedErrorEvent); pSelf->hlUnexpectedErrorEvent = NULL;
- CloseHandle(pSelf->hlExpectedErrorEvent); pSelf->hlExpectedErrorEvent = NULL;
- CloseHandle(pSelf->hlTerminateThreadsEvent); pSelf->hlTerminateThreadsEvent = NULL;
+ // Make sure all other threads have exited
+ if (SetEvent(pSelf->hlTerminateThreadsEvent)) {
+ ThreadMgr.WaitForThreadTermination();
+ }
+
+ // Clean up
+ CloseHandle(pSelf->hlUnexpectedErrorEvent);
+ pSelf->hlUnexpectedErrorEvent = NULL;
+ CloseHandle(pSelf->hlExpectedErrorEvent);
+ pSelf->hlExpectedErrorEvent = NULL;
+ CloseHandle(pSelf->hlTerminateThreadsEvent);
+ pSelf->hlTerminateThreadsEvent = NULL;
#endif
- DD_DEBUG_INFO("DDThread (producer) - EXIT");
+ DD_DEBUG_INFO("DDThread (producer) - EXIT");
- return NULL;
+ return NULL;
}
//
// Displays a message
//
- void DisplayMsg(_In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr)
+void DisplayMsg(_In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr)
{
- const UINT StringLen = (UINT)(wcslen(Str) + sizeof(" with HRESULT 0x########."));
- wchar_t* OutStr = new wchar_t[StringLen];
- if (!OutStr)
- {
- return;
- }
-
- INT LenWritten = swprintf_s(OutStr, StringLen, L"%s with 0x%X.", Str, hr);
- if (LenWritten != -1)
- {
- DD_DEBUG_ERROR("%ls: %ls", Title, OutStr);
- }
-
- delete[] OutStr;
+ const UINT StringLen = (UINT)(wcslen(Str) + sizeof(" with HRESULT 0x########."));
+ wchar_t* OutStr = new wchar_t[StringLen];
+ if (!OutStr) {
+ return;
+ }
+
+ INT LenWritten = swprintf_s(OutStr, StringLen, L"%s with 0x%X.", Str, hr);
+ if (LenWritten != -1) {
+ DD_DEBUG_ERROR("%ls: %ls", Title, OutStr);
+ }
+
+ delete[] OutStr;
}
- DYNAMIC_WAIT::DYNAMIC_WAIT() : m_CurrentWaitBandIdx(0), m_WaitCountInCurrentBand(0)
- {
- m_QPCValid = QueryPerformanceFrequency(&m_QPCFrequency);
- m_LastWakeUpTime.QuadPart = 0L;
- }
-
- DYNAMIC_WAIT::~DYNAMIC_WAIT()
- {
- }
-
- void DYNAMIC_WAIT::Wait()
- {
- LARGE_INTEGER CurrentQPC = { 0 };
-
- // Is this wait being called with the period that we consider it to be part of the same wait sequence
- QueryPerformanceCounter(&CurrentQPC);
- if (m_QPCValid && (CurrentQPC.QuadPart <= (m_LastWakeUpTime.QuadPart + (m_QPCFrequency.QuadPart * m_WaitSequenceTimeInSeconds))))
- {
- // We are still in the same wait sequence, lets check if we should move to the next band
- if ((m_WaitBands[m_CurrentWaitBandIdx].WaitCount != WAIT_BAND_STOP) && (m_WaitCountInCurrentBand > m_WaitBands[m_CurrentWaitBandIdx].WaitCount))
- {
- m_CurrentWaitBandIdx++;
- m_WaitCountInCurrentBand = 0;
- }
- }
- else
- {
- // Either we could not get the current time or we are starting a new wait sequence
- m_WaitCountInCurrentBand = 0;
- m_CurrentWaitBandIdx = 0;
- }
-
- // Sleep for the required period of time
- Sleep(m_WaitBands[m_CurrentWaitBandIdx].WaitTime);
-
- // Record the time we woke up so we can detect wait sequences
- QueryPerformanceCounter(&m_LastWakeUpTime);
- m_WaitCountInCurrentBand++;
- } \ No newline at end of file
+DYNAMIC_WAIT::DYNAMIC_WAIT() : m_CurrentWaitBandIdx(0), m_WaitCountInCurrentBand(0)
+{
+ m_QPCValid = QueryPerformanceFrequency(&m_QPCFrequency);
+ m_LastWakeUpTime.QuadPart = 0L;
+}
+
+DYNAMIC_WAIT::~DYNAMIC_WAIT()
+{
+}
+
+void DYNAMIC_WAIT::Wait()
+{
+ LARGE_INTEGER CurrentQPC = { 0 };
+
+ // Is this wait being called with the period that we consider it to be part of the same wait sequence
+ QueryPerformanceCounter(&CurrentQPC);
+ if (m_QPCValid && (CurrentQPC.QuadPart <= (m_LastWakeUpTime.QuadPart + (m_QPCFrequency.QuadPart * m_WaitSequenceTimeInSeconds)))) {
+ // We are still in the same wait sequence, lets check if we should move to the next band
+ if ((m_WaitBands[m_CurrentWaitBandIdx].WaitCount != WAIT_BAND_STOP) && (m_WaitCountInCurrentBand > m_WaitBands[m_CurrentWaitBandIdx].WaitCount)) {
+ m_CurrentWaitBandIdx++;
+ m_WaitCountInCurrentBand = 0;
+ }
+ }
+ else {
+ // Either we could not get the current time or we are starting a new wait sequence
+ m_WaitCountInCurrentBand = 0;
+ m_CurrentWaitBandIdx = 0;
+ }
+
+ // Sleep for the required period of time
+ Sleep(m_WaitBands[m_CurrentWaitBandIdx].WaitTime);
+
+ // Record the time we woke up so we can detect wait sequences
+ QueryPerformanceCounter(&m_LastWakeUpTime);
+ m_WaitCountInCurrentBand++;
+} \ No newline at end of file
diff --git a/plugins/pluginWinIPSecVista/plugin_win_ipsec_vista.c b/plugins/pluginWinIPSecVista/plugin_win_ipsec_vista.c
index ac65b94..63b1194 100755
--- a/plugins/pluginWinIPSecVista/plugin_win_ipsec_vista.c
+++ b/plugins/pluginWinIPSecVista/plugin_win_ipsec_vista.c
@@ -60,11 +60,11 @@ typedef struct plugin_win_ipsec_vista_ctx_s {
tipsec_ctx_t* pc_base;
UINT64 saId_us;
UINT64 saId_uc;
- UINT64 filterId_in_us;
- UINT64 filterId_out_us;
- UINT64 filterId_in_uc;
- UINT64 filterId_out_uc;
- WCHAR filter_name[256];
+ UINT64 filterId_in_us;
+ UINT64 filterId_out_us;
+ UINT64 filterId_in_uc;
+ UINT64 filterId_out_uc;
+ WCHAR filter_name[256];
HANDLE engine;
}
@@ -84,33 +84,33 @@ static tipsec_error_t _plugin_win_ipsec_vista_ctx_init(tipsec_ctx_t* _p_ctx)
{
plugin_win_ipsec_vista_ctx_t* p_ctx = (plugin_win_ipsec_vista_ctx_t*)_p_ctx;
DWORD code;
- UUID uuid;
- RPC_STATUS status;
- static uint64_t __guard = 0;
+ UUID uuid;
+ RPC_STATUS status;
+ static uint64_t __guard = 0;
if (p_ctx->pc_base->initialized) {
TSK_DEBUG_ERROR("Already initialized");
return tipsec_error_invalid_state;
}
- /* Create filter name */
+ /* Create filter name */
status = UuidCreate(&uuid);
if (status == RPC_S_OK) {
- WCHAR* wszUuid = NULL;
+ WCHAR* wszUuid = NULL;
UuidToStringW(&uuid, (RPC_WSTR*)&wszUuid);
- if (!wszUuid) {
- TSK_DEBUG_ERROR("Failed to convert the UUID");
- return tipsec_error_sys;
- }
- swprintf(p_ctx->filter_name, sizeof(p_ctx->filter_name)/sizeof(p_ctx->filter_name[0]), L"%s//%s//%llu", TINYIPSEC_FILTER_NAME, wszUuid, __guard++);
- RpcStringFree((RPC_WSTR*)&wszUuid);
- }
- else {
- TSK_DEBUG_ERROR("Failed to create new UUID");
- return tipsec_error_sys;
- }
-
-
+ if (!wszUuid) {
+ TSK_DEBUG_ERROR("Failed to convert the UUID");
+ return tipsec_error_sys;
+ }
+ swprintf(p_ctx->filter_name, sizeof(p_ctx->filter_name)/sizeof(p_ctx->filter_name[0]), L"%s//%s//%llu", TINYIPSEC_FILTER_NAME, wszUuid, __guard++);
+ RpcStringFree((RPC_WSTR*)&wszUuid);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new UUID");
+ return tipsec_error_sys;
+ }
+
+
/* Open engine */
if ((code = FwpmEngineOpen0(NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &p_ctx->engine))) {
@@ -172,7 +172,7 @@ static tipsec_error_t _plugin_win_ipsec_vista_ctx_set_local(tipsec_ctx_t* _p_ctx
_p_ctx->port_us = port_us;
// Create SA1: (UC -> PS)
- if ((ret = _vista_createLocalSA(p_ctx, _p_ctx->port_uc, &_p_ctx->spi_uc, &p_ctx->saId_uc, &p_ctx->filterId_in_uc, &p_ctx->filterId_out_uc))) {
+ if ((ret = _vista_createLocalSA(p_ctx, _p_ctx->port_uc, &_p_ctx->spi_uc, &p_ctx->saId_uc, &p_ctx->filterId_in_uc, &p_ctx->filterId_out_uc))) {
return tipsec_error_sys;
}
@@ -312,12 +312,12 @@ static int _vista_createLocalSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx,
IPSEC_GETSPI0 getSpi;
int ret = -1;
FWPM_FILTER_CONDITION0 conds[6];
- UINT32 numFilterConditions = 3;
+ UINT32 numFilterConditions = 3;
*spi = 0;
*saId = 0;
- *filterId_in = 0;
- *filterId_out = 0;
+ *filterId_in = 0;
+ *filterId_out = 0;
conds[0].fieldKey = FWPM_CONDITION_IP_LOCAL_ADDRESS;
conds[0].matchType = FWP_MATCH_EQUAL;
@@ -341,19 +341,19 @@ static int _vista_createLocalSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx,
conds[2].conditionValue.type = FWP_UINT16;
conds[2].conditionValue.uint16 = local_port;
- if (p_ctx->pc_base->ipproto != tipsec_ipproto_all) {
- conds[numFilterConditions].fieldKey = FWPM_CONDITION_IP_PROTOCOL;
- conds[numFilterConditions].matchType = FWP_MATCH_EQUAL;
- conds[numFilterConditions].conditionValue.type = FWP_UINT8;
- conds[numFilterConditions].conditionValue.uint8 = TINYIPSEC_VISTA_GET_IPPROTO(p_ctx->pc_base->ipproto);
- ++numFilterConditions;
- }
+ if (p_ctx->pc_base->ipproto != tipsec_ipproto_all) {
+ conds[numFilterConditions].fieldKey = FWPM_CONDITION_IP_PROTOCOL;
+ conds[numFilterConditions].matchType = FWP_MATCH_EQUAL;
+ conds[numFilterConditions].conditionValue.type = FWP_UINT8;
+ conds[numFilterConditions].conditionValue.uint8 = TINYIPSEC_VISTA_GET_IPPROTO(p_ctx->pc_base->ipproto);
+ ++numFilterConditions;
+ }
// Fill in the common fields shared by both filters.
memset(&filter, 0, sizeof(filter));
// For MUI compatibility, object names should be indirect strings. See
// SHLoadIndirectString for details.
- filter.displayData.name = (PWCHAR)p_ctx->filter_name;
+ filter.displayData.name = (PWCHAR)p_ctx->filter_name;
// Link all objects to our provider. When multiple providers are installed
// on a computer, this makes it easy to determine who added what.
filter.providerKey = (GUID*)TINYIPSEC_PROVIDER_KEY;
@@ -362,7 +362,7 @@ static int _vista_createLocalSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx,
filter.action.type = FWP_ACTION_CALLOUT_TERMINATING;
filter.flags = FWPM_FILTER_FLAG_NONE;
filter.weight.type = FWP_EMPTY;
-
+
// Add the inbound filter.
filter.layerKey = (p_ctx->pc_base->use_ipv6) ? FWPM_LAYER_INBOUND_TRANSPORT_V6 : FWPM_LAYER_INBOUND_TRANSPORT_V4;
if (p_ctx->pc_base->mode == tipsec_mode_tun) {
@@ -427,8 +427,8 @@ static int _vista_createLocalSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx,
}
//// Return the various LUIDs to the caller, so he can clean up.
- *filterId_in = tmpInFilterId;
- *filterId_out = tmpOutFilterId;
+ *filterId_in = tmpInFilterId;
+ *filterId_out = tmpOutFilterId;
*saId = tmpSaId;
CLEANUP:
@@ -449,7 +449,7 @@ static int _vista_boundSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx, __in U
IPSEC_SA0 sa;
IPSEC_SA_BUNDLE0 bundle;
IPSEC_SA_AUTH_INFORMATION0 authInfo; // must be global because use as reference (X = &authInfo)
- IPSEC_SA_AUTH_AND_CIPHER_INFORMATION0 cipherAuthInfo; // must be global because use as reference (X = &cipherAuthInfo)
+ IPSEC_SA_AUTH_AND_CIPHER_INFORMATION0 cipherAuthInfo; // must be global because use as reference (X = &cipherAuthInfo)
PFWP_BYTE_BLOB ik = (PFWP_BYTE_BLOB)p_ctx->pc_base->ik;
PFWP_BYTE_BLOB ck = (PFWP_BYTE_BLOB)p_ctx->pc_base->ck;
@@ -490,7 +490,7 @@ static int _vista_boundSA(__in const plugin_win_ipsec_vista_ctx_t* p_ctx, __in U
else if ( sa.saTransformType == IPSEC_TRANSFORM_ESP_AUTH ) {
sa.espAuthInformation = &authInfo;
}
- else if ( sa.saTransformType == IPSEC_TRANSFORM_ESP_CIPHER ) {
+ else if ( sa.saTransformType == IPSEC_TRANSFORM_ESP_CIPHER ) {
IPSEC_SA_CIPHER_INFORMATION0 cipherInfo;
memset(&cipherInfo, 0, sizeof(cipherInfo));
@@ -540,29 +540,29 @@ CLEANUP:
static int _vista_flushAll(const plugin_win_ipsec_vista_ctx_t* p_ctx)
{
#if 1
- int ret = -1;
- if (p_ctx && p_ctx->engine) {
- DWORD result;
- result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_in_uc);
- if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
- TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
- }
- result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_in_us);
- if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
- TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
- }
- result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_out_uc);
- if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
- TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
- }
- result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_out_us);
- if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
- TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
- }
- return 0;
- }
- //
- return ret;
+ int ret = -1;
+ if (p_ctx && p_ctx->engine) {
+ DWORD result;
+ result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_in_uc);
+ if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
+ TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
+ }
+ result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_in_us);
+ if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
+ TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
+ }
+ result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_out_uc);
+ if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
+ TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
+ }
+ result = FwpmFilterDeleteById0(p_ctx->engine, p_ctx->filterId_out_us);
+ if (result != ERROR_SUCCESS && result != FWP_E_FILTER_NOT_FOUND) {
+ TSK_DEBUG_ERROR("FwpmFilterDeleteById0 failed with error code [%x]", result);
+ }
+ return 0;
+ }
+ //
+ return ret;
#else
UINT32 i;
int ret = -1;
@@ -593,18 +593,18 @@ static int _vista_flushAll(const plugin_win_ipsec_vista_ctx_t* p_ctx)
}
}
- TSK_DEBUG_INFO("All SAs have been flushed.");
+ TSK_DEBUG_INFO("All SAs have been flushed.");
ret = 0;
CLEANUP:
- if (entries) {
- FwpmFreeMemory0((void**)entries);
- }
- if (enumHandle) {
- if ((result = IPsecSaDestroyEnumHandle0(p_ctx->engine, enumHandle)) != ERROR_SUCCESS) {
- TSK_DEBUG_ERROR("IPsecSaDestroyEnumHandle0 failed with error code [%x].", result);
- }
- }
+ if (entries) {
+ FwpmFreeMemory0((void**)entries);
+ }
+ if (enumHandle) {
+ if ((result = IPsecSaDestroyEnumHandle0(p_ctx->engine, enumHandle)) != ERROR_SUCCESS) {
+ TSK_DEBUG_ERROR("IPsecSaDestroyEnumHandle0 failed with error code [%x].", result);
+ }
+ }
}
return ret;
@@ -672,15 +672,15 @@ static tsk_object_t* _plugin_win_ipsec_vista_ctx_dtor(tsk_object_t * self)
TSK_FREE(p_ctx->pc_base->addr_local);
TSK_FREE(p_ctx->pc_base->addr_remote);
-
- if (p_ctx->pc_base->ik) {
- TSK_FREE(((PFWP_BYTE_BLOB)p_ctx->pc_base->ik)->data);
- TSK_FREE(p_ctx->pc_base->ik);
- }
+
+ if (p_ctx->pc_base->ik) {
+ TSK_FREE(((PFWP_BYTE_BLOB)p_ctx->pc_base->ik)->data);
+ TSK_FREE(p_ctx->pc_base->ik);
+ }
if (p_ctx->pc_base->ck) {
- TSK_FREE(((PFWP_BYTE_BLOB)p_ctx->pc_base->ck)->data);
- TSK_FREE(p_ctx->pc_base->ck);
- }
+ TSK_FREE(((PFWP_BYTE_BLOB)p_ctx->pc_base->ck)->data);
+ TSK_FREE(p_ctx->pc_base->ck);
+ }
TSK_DEBUG_INFO("*** Windows Vista IPSec plugin (Windows Filtering Platform) context destroyed ***");
}
diff --git a/plugins/pluginWinMF/dllmain_mf.cxx b/plugins/pluginWinMF/dllmain_mf.cxx
index aeeb863..99cace8 100755
--- a/plugins/pluginWinMF/dllmain_mf.cxx
+++ b/plugins/pluginWinMF/dllmain_mf.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -71,174 +71,151 @@ PLUGIN_WIN_MF_END_DECLS /* END */
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
- )
+ )
{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
}
-typedef enum PLUGIN_INDEX_E
-{
+typedef enum PLUGIN_INDEX_E {
#if PLUGIN_MF_ENABLE_AUDIO_IO
- PLUGIN_INDEX_AUDIO_CONSUMER,
- PLUGIN_INDEX_AUDIO_PRODUCER,
+ PLUGIN_INDEX_AUDIO_CONSUMER,
+ PLUGIN_INDEX_AUDIO_PRODUCER,
#endif
#if PLUGIN_MF_ENABLE_VIDEO_IO
- PLUGIN_INDEX_VIDEO_PRODUCER,
- PLUGIN_INDEX_VIDEO_CONSUMER,
+ PLUGIN_INDEX_VIDEO_PRODUCER,
+ PLUGIN_INDEX_VIDEO_CONSUMER,
#endif
#if PLUGIN_MF_ENABLE_VIDEO_CONVERTER
- PLUGIN_INDEX_VIDEO_CONVERTER,
+ PLUGIN_INDEX_VIDEO_CONVERTER,
#endif
- PLUGIN_INDEX_CODEC_H264_MAIN,
- PLUGIN_INDEX_CODEC_H264_BASE,
-
- PLUGIN_INDEX_COUNT
+ PLUGIN_INDEX_CODEC_H264_MAIN,
+ PLUGIN_INDEX_CODEC_H264_BASE,
+
+ PLUGIN_INDEX_COUNT
}
PLUGIN_INDEX_T;
int __plugin_get_def_count()
{
- int count = PLUGIN_INDEX_COUNT;
- if(!MFUtils::IsLowLatencyH264Supported())
- {
- count -= 2;
- }
- return count;
+ int count = PLUGIN_INDEX_COUNT;
+ if(!MFUtils::IsLowLatencyH264Supported()) {
+ count -= 2;
+ }
+ return count;
}
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
{
- switch(index){
+ switch(index) {
#if PLUGIN_MF_ENABLE_AUDIO_IO
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return (index == PLUGIN_INDEX_AUDIO_CONSUMER) ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_producer;
- }
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return (index == PLUGIN_INDEX_AUDIO_CONSUMER) ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_producer;
+ }
#endif
#if PLUGIN_MF_ENABLE_VIDEO_IO
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- {
- return MFUtils::IsD3D9Supported() ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_none;
- }
- case PLUGIN_INDEX_VIDEO_PRODUCER:
- {
- return tsk_plugin_def_type_producer;
- }
+ case PLUGIN_INDEX_VIDEO_CONSUMER: {
+ return MFUtils::IsD3D9Supported() ? tsk_plugin_def_type_consumer : tsk_plugin_def_type_none;
+ }
+ case PLUGIN_INDEX_VIDEO_PRODUCER: {
+ return tsk_plugin_def_type_producer;
+ }
#endif
#if PLUGIN_MF_ENABLE_VIDEO_CONVERTER
- case PLUGIN_INDEX_VIDEO_CONVERTER:
- {
- return tsk_plugin_def_type_converter;
- }
-#endif
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return MFUtils::IsLowLatencyH264Supported() ? tsk_plugin_def_type_codec : tsk_plugin_def_type_none;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_type_none;
- }
- }
+ case PLUGIN_INDEX_VIDEO_CONVERTER: {
+ return tsk_plugin_def_type_converter;
+ }
+#endif
+ case PLUGIN_INDEX_CODEC_H264_MAIN:
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return MFUtils::IsLowLatencyH264Supported() ? tsk_plugin_def_type_codec : tsk_plugin_def_type_none;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_type_none;
+ }
+ }
}
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
{
- switch(index){
+ switch(index) {
#if PLUGIN_MF_ENABLE_AUDIO_IO
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return tsk_plugin_def_media_type_audio;
- }
+ case PLUGIN_INDEX_AUDIO_CONSUMER:
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return tsk_plugin_def_media_type_audio;
+ }
#endif
#if PLUGIN_MF_ENABLE_VIDEO_IO
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- {
- return MFUtils::IsD3D9Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
- }
- case PLUGIN_INDEX_VIDEO_PRODUCER:
- {
- return tsk_plugin_def_media_type_video;
- }
+ case PLUGIN_INDEX_VIDEO_CONSUMER: {
+ return MFUtils::IsD3D9Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
+ }
+ case PLUGIN_INDEX_VIDEO_PRODUCER: {
+ return tsk_plugin_def_media_type_video;
+ }
#endif
#if PLUGIN_MF_ENABLE_VIDEO_CONVERTER
- case PLUGIN_INDEX_VIDEO_CONVERTER:
- {
- return tsk_plugin_def_media_type_video;
- }
-#endif
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return MFUtils::IsLowLatencyH264Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_plugin_def_media_type_none;
- }
- }
+ case PLUGIN_INDEX_VIDEO_CONVERTER: {
+ return tsk_plugin_def_media_type_video;
+ }
+#endif
+ case PLUGIN_INDEX_CODEC_H264_MAIN:
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return MFUtils::IsLowLatencyH264Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_plugin_def_media_type_none;
+ }
+ }
}
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
{
- switch(index){
+ switch(index) {
#if PLUGIN_MF_ENABLE_VIDEO_IO
- case PLUGIN_INDEX_VIDEO_PRODUCER:
- {
- return plugin_win_mf_producer_video_plugin_def_t;
- }
- case PLUGIN_INDEX_VIDEO_CONSUMER:
- {
- return MFUtils::IsD3D9Supported() ? plugin_win_mf_consumer_video_plugin_def_t : tsk_null;
- }
+ case PLUGIN_INDEX_VIDEO_PRODUCER: {
+ return plugin_win_mf_producer_video_plugin_def_t;
+ }
+ case PLUGIN_INDEX_VIDEO_CONSUMER: {
+ return MFUtils::IsD3D9Supported() ? plugin_win_mf_consumer_video_plugin_def_t : tsk_null;
+ }
#endif
#if PLUGIN_MF_ENABLE_AUDIO_IO
- case PLUGIN_INDEX_AUDIO_PRODUCER:
- {
- return plugin_win_mf_producer_audio_plugin_def_t;
- }
- case PLUGIN_INDEX_AUDIO_CONSUMER:
- {
- return plugin_win_mf_consumer_audio_plugin_def_t;
- }
+ case PLUGIN_INDEX_AUDIO_PRODUCER: {
+ return plugin_win_mf_producer_audio_plugin_def_t;
+ }
+ case PLUGIN_INDEX_AUDIO_CONSUMER: {
+ return plugin_win_mf_consumer_audio_plugin_def_t;
+ }
#endif
#if PLUGIN_MF_ENABLE_VIDEO_CONVERTER
- case PLUGIN_INDEX_VIDEO_CONVERTER:
- {
- return plugin_win_mf_converter_video_ms_plugin_def_t;
- }
-#endif
- case PLUGIN_INDEX_CODEC_H264_MAIN:
- {
- return MFUtils::IsLowLatencyH264Supported() ? mf_codec_h264_main_plugin_def_t : tsk_null;
- }
- case PLUGIN_INDEX_CODEC_H264_BASE:
- {
- return MFUtils::IsLowLatencyH264Supported() ? mf_codec_h264_base_plugin_def_t : tsk_null;
- }
- default:
- {
- TSK_DEBUG_ERROR("No plugin at index %d", index);
- return tsk_null;
- }
- }
+ case PLUGIN_INDEX_VIDEO_CONVERTER: {
+ return plugin_win_mf_converter_video_ms_plugin_def_t;
+ }
+#endif
+ case PLUGIN_INDEX_CODEC_H264_MAIN: {
+ return MFUtils::IsLowLatencyH264Supported() ? mf_codec_h264_main_plugin_def_t : tsk_null;
+ }
+ case PLUGIN_INDEX_CODEC_H264_BASE: {
+ return MFUtils::IsLowLatencyH264Supported() ? mf_codec_h264_base_plugin_def_t : tsk_null;
+ }
+ default: {
+ TSK_DEBUG_ERROR("No plugin at index %d", index);
+ return tsk_null;
+ }
+ }
}
diff --git a/plugins/pluginWinMF/internals/mf_codec.cxx b/plugins/pluginWinMF/internals/mf_codec.cxx
index e2968f4..27fb903 100755
--- a/plugins/pluginWinMF/internals/mf_codec.cxx
+++ b/plugins/pluginWinMF/internals/mf_codec.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -40,13 +40,13 @@
#endif
// Make sure usable on Win7 SDK targeting Win8 OS
-#if !defined(CODECAPI_AVLowLatencyMode)
+#if !defined(CODECAPI_AVLowLatencyMode)
DEFINE_GUID(CODECAPI_AVLowLatencyMode,
- 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
+ 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
#endif
#if !defined(CODECAPI_AVDecVideoH264ErrorConcealment)
DEFINE_GUID(CODECAPI_AVDecVideoH264ErrorConcealment,
-0xececace8, 0x3436, 0x462c, 0x92, 0x94, 0xcd, 0x7b, 0xac, 0xd7, 0x58, 0xa9);
+ 0xececace8, 0x3436, 0x462c, 0x92, 0x94, 0xcd, 0x7b, 0xac, 0xd7, 0x58, 0xa9);
#endif
//
@@ -54,117 +54,105 @@ DEFINE_GUID(CODECAPI_AVDecVideoH264ErrorConcealment,
//
MFCodec::MFCodec(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT /*= NULL*/)
-: m_nRefCount(1)
-, m_eId(eId)
-, m_eType(eType)
-, m_pMFT(NULL)
-, m_pCodecAPI(NULL)
-, m_pOutputType(NULL)
-, m_pInputType(NULL)
-, m_dwInputID(0)
-, m_dwOutputID(0)
-, m_rtStart(0)
-, m_rtDuration(0)
-, m_pSampleIn(NULL)
-, m_pSampleOut(NULL)
-, m_pEventGenerator(NULL)
-, m_bIsAsync(FALSE)
-, m_bIsFirstFrame(TRUE)
-, m_bIsBundled(FALSE)
-, m_nMETransformNeedInputCount(0)
-, m_nMETransformHaveOutputCount(0)
-, m_pSampleQueueAsyncInput(NULL)
+ : m_nRefCount(1)
+ , m_eId(eId)
+ , m_eType(eType)
+ , m_pMFT(NULL)
+ , m_pCodecAPI(NULL)
+ , m_pOutputType(NULL)
+ , m_pInputType(NULL)
+ , m_dwInputID(0)
+ , m_dwOutputID(0)
+ , m_rtStart(0)
+ , m_rtDuration(0)
+ , m_pSampleIn(NULL)
+ , m_pSampleOut(NULL)
+ , m_pEventGenerator(NULL)
+ , m_bIsAsync(FALSE)
+ , m_bIsFirstFrame(TRUE)
+ , m_bIsBundled(FALSE)
+ , m_nMETransformNeedInputCount(0)
+ , m_nMETransformHaveOutputCount(0)
+ , m_pSampleQueueAsyncInput(NULL)
{
- MFUtils::Startup();
-
- HRESULT hr = S_OK;
-
- switch(eId)
- {
- case MFCodecId_H264Base:
- case MFCodecId_H264Main:
- {
- m_eMediaType = MFCodecMediaType_Video;
- m_guidCompressedFormat = MFVideoFormat_H264;
- break;
- }
- case MFCodecId_AAC:
- {
- m_eMediaType = MFCodecMediaType_Audio;
- m_guidCompressedFormat = MFAudioFormat_AAC;
- break;
- }
- default:
- {
- assert(false);
- break;
- }
- }
- CHECK_HR(hr = MFCreateMediaType(&m_pOutputType));
- CHECK_HR(hr = MFCreateMediaType(&m_pInputType));
- if(pMFT) // up to the caller to make sure all parameters are corrrect
- {
- m_pMFT = pMFT;
- m_pMFT->AddRef();
- }
- else
- {
- CHECK_HR(hr = MFUtils::GetBestCodec(
- (m_eType == MFCodecType_Encoder) ? TRUE : FALSE, // Encoder ?
- (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio, // Media Type
- (m_eType == MFCodecType_Encoder) ? kMFCodecUncompressedFormat : m_guidCompressedFormat/*GUID_NULL*/, // Input
- (m_eType == MFCodecType_Encoder) ? m_guidCompressedFormat : kMFCodecUncompressedFormat, // Output
- &m_pMFT));
- }
- hr = m_pMFT->QueryInterface(IID_PPV_ARGS(&m_pCodecAPI));
- if(FAILED(hr) && m_eType == MFCodecType_Encoder) // Required only for Encoders
- {
- CHECK_HR(hr);
- }
-
-
- CHECK_HR(hr = MFUtils::IsAsyncMFT(m_pMFT, &m_bIsAsync));
- if(m_bIsAsync)
- {
- m_pSampleQueueAsyncInput = new MFSampleQueue();
- if(!m_pSampleQueueAsyncInput)
- {
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- CHECK_HR(hr = MFUtils::UnlockAsyncMFT(m_pMFT));
- CHECK_HR(hr = m_pMFT->QueryInterface(IID_PPV_ARGS(&m_pEventGenerator)));
- }
+ MFUtils::Startup();
+
+ HRESULT hr = S_OK;
+
+ switch(eId) {
+ case MFCodecId_H264Base:
+ case MFCodecId_H264Main: {
+ m_eMediaType = MFCodecMediaType_Video;
+ m_guidCompressedFormat = MFVideoFormat_H264;
+ break;
+ }
+ case MFCodecId_AAC: {
+ m_eMediaType = MFCodecMediaType_Audio;
+ m_guidCompressedFormat = MFAudioFormat_AAC;
+ break;
+ }
+ default: {
+ assert(false);
+ break;
+ }
+ }
+ CHECK_HR(hr = MFCreateMediaType(&m_pOutputType));
+ CHECK_HR(hr = MFCreateMediaType(&m_pInputType));
+ if(pMFT) { // up to the caller to make sure all parameters are corrrect
+ m_pMFT = pMFT;
+ m_pMFT->AddRef();
+ }
+ else {
+ CHECK_HR(hr = MFUtils::GetBestCodec(
+ (m_eType == MFCodecType_Encoder) ? TRUE : FALSE, // Encoder ?
+ (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio, // Media Type
+ (m_eType == MFCodecType_Encoder) ? kMFCodecUncompressedFormat : m_guidCompressedFormat/*GUID_NULL*/, // Input
+ (m_eType == MFCodecType_Encoder) ? m_guidCompressedFormat : kMFCodecUncompressedFormat, // Output
+ &m_pMFT));
+ }
+ hr = m_pMFT->QueryInterface(IID_PPV_ARGS(&m_pCodecAPI));
+ if(FAILED(hr) && m_eType == MFCodecType_Encoder) { // Required only for Encoders
+ CHECK_HR(hr);
+ }
+
+
+ CHECK_HR(hr = MFUtils::IsAsyncMFT(m_pMFT, &m_bIsAsync));
+ if(m_bIsAsync) {
+ m_pSampleQueueAsyncInput = new MFSampleQueue();
+ if(!m_pSampleQueueAsyncInput) {
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ CHECK_HR(hr = MFUtils::UnlockAsyncMFT(m_pMFT));
+ CHECK_HR(hr = m_pMFT->QueryInterface(IID_PPV_ARGS(&m_pEventGenerator)));
+ }
bail:
- if(FAILED(hr))
- {
- SafeRelease(&m_pMFT);
- SafeRelease(&m_pCodecAPI);
- }
- if(!IsValid())
- {
- TSK_DEBUG_ERROR("Failed to create codec with id = %d", m_eId);
- }
-}
+ if(FAILED(hr)) {
+ SafeRelease(&m_pMFT);
+ SafeRelease(&m_pCodecAPI);
+ }
+ if(!IsValid()) {
+ TSK_DEBUG_ERROR("Failed to create codec with id = %d", m_eId);
+ }
+}
MFCodec::~MFCodec()
{
- assert(m_nRefCount == 0);
+ assert(m_nRefCount == 0);
- if(m_bIsAsync && m_pMFT)
- {
- m_pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, NULL);
- m_pMFT->ProcessMessage(MFT_MESSAGE_COMMAND_DRAIN, NULL);
- }
+ if(m_bIsAsync && m_pMFT) {
+ m_pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, NULL);
+ m_pMFT->ProcessMessage(MFT_MESSAGE_COMMAND_DRAIN, NULL);
+ }
- SafeRelease(&m_pMFT);
- SafeRelease(&m_pCodecAPI);
+ SafeRelease(&m_pMFT);
+ SafeRelease(&m_pCodecAPI);
SafeRelease(&m_pOutputType);
- SafeRelease(&m_pInputType);
- SafeRelease(&m_pSampleIn);
- SafeRelease(&m_pSampleOut);
- SafeRelease(&m_pEventGenerator);
- SafeRelease(&m_pSampleQueueAsyncInput);
+ SafeRelease(&m_pInputType);
+ SafeRelease(&m_pSampleIn);
+ SafeRelease(&m_pSampleOut);
+ SafeRelease(&m_pEventGenerator);
+ SafeRelease(&m_pSampleQueueAsyncInput);
}
ULONG MFCodec::AddRef()
@@ -175,8 +163,7 @@ ULONG MFCodec::AddRef()
ULONG MFCodec::Release()
{
ULONG uCount = InterlockedDecrement(&m_nRefCount);
- if (uCount == 0)
- {
+ if (uCount == 0) {
delete this;
}
// For thread safety, return a temporary variable.
@@ -185,242 +172,210 @@ ULONG MFCodec::Release()
HRESULT MFCodec::QueryInterface(REFIID iid, void** ppv)
{
- if(!IsValid())
- {
- return E_FAIL;
- }
- return m_pMFT->QueryInterface(iid, ppv);
+ if(!IsValid()) {
+ return E_FAIL;
+ }
+ return m_pMFT->QueryInterface(iid, ppv);
}
// IMFAsyncCallback
STDMETHODIMP MFCodec::GetParameters(DWORD *pdwFlags, DWORD *pdwQueue)
{
- return E_NOTIMPL;
+ return E_NOTIMPL;
}
STDMETHODIMP MFCodec::Invoke(IMFAsyncResult *pAsyncResult)
{
- HRESULT hr = S_OK, hrStatus = S_OK;
+ HRESULT hr = S_OK, hrStatus = S_OK;
IMFMediaEvent* pEvent = NULL;
MediaEventType meType = MEUnknown;
-
+
CHECK_HR(hr = m_pEventGenerator->EndGetEvent(pAsyncResult, &pEvent));
- CHECK_HR(hr = pEvent->GetType(&meType));
+ CHECK_HR(hr = pEvent->GetType(&meType));
CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- if (SUCCEEDED(hrStatus))
- {
- switch(meType)
- {
- case METransformNeedInput:
- {
- InterlockedIncrement(&m_nMETransformNeedInputCount);
- break;
- }
-
- case METransformHaveOutput:
- {
- InterlockedIncrement(&m_nMETransformHaveOutputCount);
- break;
- }
- }
- }
-
+ if (SUCCEEDED(hrStatus)) {
+ switch(meType) {
+ case METransformNeedInput: {
+ InterlockedIncrement(&m_nMETransformNeedInputCount);
+ break;
+ }
+
+ case METransformHaveOutput: {
+ InterlockedIncrement(&m_nMETransformHaveOutputCount);
+ break;
+ }
+ }
+ }
+
CHECK_HR(hr = m_pEventGenerator->BeginGetEvent(this, NULL));
bail:
- SafeRelease(&pEvent);
+ SafeRelease(&pEvent);
return hr;
}
HRESULT MFCodec::ProcessInput(IMFSample* pSample)
{
- assert(IsReady());
-
- HRESULT hr = S_OK;
-
- if(m_bIsFirstFrame)
- {
- if(m_bIsAsync && !m_bIsBundled)
- {
- CHECK_HR(hr = m_pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, NULL));
- CHECK_HR(hr = m_pEventGenerator->BeginGetEvent(this, NULL));
- }
- m_bIsFirstFrame = FALSE;
- }
-
- if(m_bIsAsync)
- {
- if(m_nMETransformNeedInputCount == 1 && m_pSampleQueueAsyncInput->IsEmpty())
- {
- InterlockedDecrement(&m_nMETransformNeedInputCount);
- return m_pMFT->ProcessInput(m_dwInputID, pSample, 0);
- }
-
- if(m_pSampleQueueAsyncInput->Count() > kMFCodecQueuedFramesMax)
- {
- m_pSampleQueueAsyncInput->Clear();
- CHECK_HR(hr = E_UNEXPECTED);
- }
-
- // Input sample holds shared memory (also used by other samples)
- IMFSample *pSampleCopy = NULL;
- IMFMediaBuffer *pMediaBuffer = NULL, *pMediaBufferCopy = NULL;
- BYTE *pBufferPtr = NULL, *pBufferPtrCopy = NULL;
- DWORD dwDataLength = 0;
- BOOL bMediaBufferLocked = FALSE, bMediaBufferLockedCopy = FALSE;
-
- CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
- hr = pMediaBuffer->GetCurrentLength(&dwDataLength);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
- hr = pMediaBuffer->Lock(&pBufferPtr, NULL, NULL);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
- bMediaBufferLocked = TRUE;
-
- hr = MFUtils::CreateMediaSample(dwDataLength, &pSampleCopy);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
- hr = pSampleCopy->GetBufferByIndex(0, &pMediaBufferCopy);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
- hr = pMediaBufferCopy->Lock(&pBufferPtrCopy, NULL, NULL);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
- bMediaBufferLockedCopy = TRUE;
-
- memcpy(pBufferPtrCopy, pBufferPtr, dwDataLength);
- hr = pMediaBufferCopy->SetCurrentLength(dwDataLength);
- if(FAILED(hr))
- {
- goto endofcopy;
- }
-
- LONGLONG hnsSampleTime = 0;
- LONGLONG hnsSampleDuration = 0;
- hr = pSample->GetSampleTime(&hnsSampleTime);
- if(SUCCEEDED(hr))
- {
- hr = pSampleCopy->SetSampleTime(hnsSampleTime);
- }
- hr = pSample->GetSampleDuration(&hnsSampleDuration);
- if(SUCCEEDED(hr))
- {
- hr = pSampleCopy->SetSampleDuration(hnsSampleDuration);
- }
-
- // EnQueue
- hr = m_pSampleQueueAsyncInput->Queue(pSampleCopy);
+ assert(IsReady());
+
+ HRESULT hr = S_OK;
+
+ if(m_bIsFirstFrame) {
+ if(m_bIsAsync && !m_bIsBundled) {
+ CHECK_HR(hr = m_pMFT->ProcessMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, NULL));
+ CHECK_HR(hr = m_pEventGenerator->BeginGetEvent(this, NULL));
+ }
+ m_bIsFirstFrame = FALSE;
+ }
+
+ if(m_bIsAsync) {
+ if(m_nMETransformNeedInputCount == 1 && m_pSampleQueueAsyncInput->IsEmpty()) {
+ InterlockedDecrement(&m_nMETransformNeedInputCount);
+ return m_pMFT->ProcessInput(m_dwInputID, pSample, 0);
+ }
+
+ if(m_pSampleQueueAsyncInput->Count() > kMFCodecQueuedFramesMax) {
+ m_pSampleQueueAsyncInput->Clear();
+ CHECK_HR(hr = E_UNEXPECTED);
+ }
+
+ // Input sample holds shared memory (also used by other samples)
+ IMFSample *pSampleCopy = NULL;
+ IMFMediaBuffer *pMediaBuffer = NULL, *pMediaBufferCopy = NULL;
+ BYTE *pBufferPtr = NULL, *pBufferPtrCopy = NULL;
+ DWORD dwDataLength = 0;
+ BOOL bMediaBufferLocked = FALSE, bMediaBufferLockedCopy = FALSE;
+
+ CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
+ hr = pMediaBuffer->GetCurrentLength(&dwDataLength);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+ hr = pMediaBuffer->Lock(&pBufferPtr, NULL, NULL);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+ bMediaBufferLocked = TRUE;
+
+ hr = MFUtils::CreateMediaSample(dwDataLength, &pSampleCopy);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+ hr = pSampleCopy->GetBufferByIndex(0, &pMediaBufferCopy);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+ hr = pMediaBufferCopy->Lock(&pBufferPtrCopy, NULL, NULL);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+ bMediaBufferLockedCopy = TRUE;
+
+ memcpy(pBufferPtrCopy, pBufferPtr, dwDataLength);
+ hr = pMediaBufferCopy->SetCurrentLength(dwDataLength);
+ if(FAILED(hr)) {
+ goto endofcopy;
+ }
+
+ LONGLONG hnsSampleTime = 0;
+ LONGLONG hnsSampleDuration = 0;
+ hr = pSample->GetSampleTime(&hnsSampleTime);
+ if(SUCCEEDED(hr)) {
+ hr = pSampleCopy->SetSampleTime(hnsSampleTime);
+ }
+ hr = pSample->GetSampleDuration(&hnsSampleDuration);
+ if(SUCCEEDED(hr)) {
+ hr = pSampleCopy->SetSampleDuration(hnsSampleDuration);
+ }
+
+ // EnQueue
+ hr = m_pSampleQueueAsyncInput->Queue(pSampleCopy);
endofcopy:
- if(pMediaBuffer && bMediaBufferLocked)
- {
- pMediaBuffer->Unlock();
- }
- if(pMediaBufferCopy && bMediaBufferLockedCopy)
- {
- pMediaBufferCopy->Unlock();
- }
- SafeRelease(&pSampleCopy);
- SafeRelease(&pMediaBuffer);
- CHECK_HR(hr);
-
- while(m_nMETransformNeedInputCount > 0)
- {
- if(m_pSampleQueueAsyncInput->IsEmpty())
- {
- break;
- }
- IMFSample *_pSample = NULL;
- hr = m_pSampleQueueAsyncInput->Dequeue(&_pSample);
- if(SUCCEEDED(hr))
- {
- InterlockedDecrement(&m_nMETransformNeedInputCount);
- hr = m_pMFT->ProcessInput(m_dwInputID, _pSample, 0);
- }
- SafeRelease(&_pSample);
- CHECK_HR(hr);
- }
- }
- else
- {
- CHECK_HR(hr = m_pMFT->ProcessInput(m_dwInputID, pSample, 0));
- }
+ if(pMediaBuffer && bMediaBufferLocked) {
+ pMediaBuffer->Unlock();
+ }
+ if(pMediaBufferCopy && bMediaBufferLockedCopy) {
+ pMediaBufferCopy->Unlock();
+ }
+ SafeRelease(&pSampleCopy);
+ SafeRelease(&pMediaBuffer);
+ CHECK_HR(hr);
+
+ while(m_nMETransformNeedInputCount > 0) {
+ if(m_pSampleQueueAsyncInput->IsEmpty()) {
+ break;
+ }
+ IMFSample *_pSample = NULL;
+ hr = m_pSampleQueueAsyncInput->Dequeue(&_pSample);
+ if(SUCCEEDED(hr)) {
+ InterlockedDecrement(&m_nMETransformNeedInputCount);
+ hr = m_pMFT->ProcessInput(m_dwInputID, _pSample, 0);
+ }
+ SafeRelease(&_pSample);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ CHECK_HR(hr = m_pMFT->ProcessInput(m_dwInputID, pSample, 0));
+ }
bail:
- return hr;
+ return hr;
}
HRESULT MFCodec::ProcessOutput(IMFSample **ppSample)
{
- assert(IsReady());
+ assert(IsReady());
- if(m_bIsAsync)
- {
- if(m_nMETransformHaveOutputCount == 0)
- {
- return S_OK;
- }
- InterlockedDecrement(&m_nMETransformHaveOutputCount);
- }
+ if(m_bIsAsync) {
+ if(m_nMETransformHaveOutputCount == 0) {
+ return S_OK;
+ }
+ InterlockedDecrement(&m_nMETransformHaveOutputCount);
+ }
- *ppSample = NULL;
+ *ppSample = NULL;
IMFMediaBuffer* pBufferOut = NULL;
DWORD dwStatus;
- HRESULT hr = S_OK;
-
+ HRESULT hr = S_OK;
+
MFT_OUTPUT_STREAM_INFO mftStreamInfo = { 0 };
MFT_OUTPUT_DATA_BUFFER mftOutputData = { 0 };
- CHECK_HR(hr = m_pMFT->GetOutputStreamInfo(m_dwOutputID, &mftStreamInfo));
-
- BOOL bOutputStreamProvidesSamples = (mftStreamInfo.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) == MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
-
- if(!bOutputStreamProvidesSamples)
- {
- if(!m_pSampleOut)
- {
- CHECK_HR(hr = MFUtils::CreateMediaSample(mftStreamInfo.cbSize, &m_pSampleOut));
- hr = m_pSampleOut->GetBufferByIndex(0, &pBufferOut);
- if(FAILED(hr))
- {
- SafeRelease(&m_pSampleOut);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = m_pSampleOut->GetBufferByIndex(0, &pBufferOut));
- CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < mftStreamInfo.cbSize)
- {
- CHECK_HR(hr = m_pSampleOut->RemoveAllBuffers());
- SafeRelease(&pBufferOut);
- CHECK_HR(hr = MFCreateMemoryBuffer(mftStreamInfo.cbSize, &pBufferOut));
- CHECK_HR(hr = m_pSampleOut->AddBuffer(pBufferOut));
- }
- }
- }
-
- if(pBufferOut)
- {
- CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
- }
-
+ CHECK_HR(hr = m_pMFT->GetOutputStreamInfo(m_dwOutputID, &mftStreamInfo));
+
+ BOOL bOutputStreamProvidesSamples = (mftStreamInfo.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) == MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
+
+ if(!bOutputStreamProvidesSamples) {
+ if(!m_pSampleOut) {
+ CHECK_HR(hr = MFUtils::CreateMediaSample(mftStreamInfo.cbSize, &m_pSampleOut));
+ hr = m_pSampleOut->GetBufferByIndex(0, &pBufferOut);
+ if(FAILED(hr)) {
+ SafeRelease(&m_pSampleOut);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = m_pSampleOut->GetBufferByIndex(0, &pBufferOut));
+ CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < mftStreamInfo.cbSize) {
+ CHECK_HR(hr = m_pSampleOut->RemoveAllBuffers());
+ SafeRelease(&pBufferOut);
+ CHECK_HR(hr = MFCreateMemoryBuffer(mftStreamInfo.cbSize, &pBufferOut));
+ CHECK_HR(hr = m_pSampleOut->AddBuffer(pBufferOut));
+ }
+ }
+ }
+
+ if(pBufferOut) {
+ CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
+ }
+
//Set the output sample
mftOutputData.pSample = bOutputStreamProvidesSamples ? NULL : m_pSampleOut;
//Set the output id
@@ -428,167 +383,145 @@ HRESULT MFCodec::ProcessOutput(IMFSample **ppSample)
//Generate the output sample
hr = m_pMFT->ProcessOutput(0, 1, &mftOutputData, &dwStatus);
- if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
- {
+ if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) {
hr = S_OK;
goto bail;
}
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
goto bail;
}
*ppSample = mftOutputData.pSample;
- if(*ppSample)
- {
- (*ppSample)->AddRef();
- }
+ if(*ppSample) {
+ (*ppSample)->AddRef();
+ }
bail:
- if(bOutputStreamProvidesSamples)
- {
- SafeRelease(&mftOutputData.pSample);
- }
+ if(bOutputStreamProvidesSamples) {
+ SafeRelease(&mftOutputData.pSample);
+ }
SafeRelease(&pBufferOut);
return hr;
}
bool MFCodec::IsValid()
{
- return (m_pMFT && (m_eType == MFCodecType_Decoder || m_pCodecAPI));
+ return (m_pMFT && (m_eType == MFCodecType_Decoder || m_pCodecAPI));
}
bool MFCodec::IsReady()
{
- return (IsValid() && m_pOutputType && m_pInputType);
+ return (IsValid() && m_pOutputType && m_pInputType);
}
HRESULT MFCodec::Process(const void* pcInputPtr, UINT32 nInputSize, IMFSample **ppSampleOut)
{
- if(!pcInputPtr || !nInputSize || !ppSampleOut)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return E_INVALIDARG;
- }
-
- *ppSampleOut = NULL;
-
- HRESULT hr = S_OK;
-
- IMFMediaBuffer* pBufferIn = NULL;
- BYTE* pBufferPtr = NULL;
- BOOL bMediaChangeHandled = FALSE; // Endless loop guard
-
- if(!m_pSampleIn)
- {
- CHECK_HR(hr = MFUtils::CreateMediaSample(nInputSize, &m_pSampleIn));
- hr = m_pSampleIn->GetBufferByIndex(0, &pBufferIn);
- if(FAILED(hr))
- {
- SafeRelease(&m_pSampleIn);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = m_pSampleIn->GetBufferByIndex(0, &pBufferIn));
- CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < nInputSize)
- {
- CHECK_HR(hr = m_pSampleIn->RemoveAllBuffers());
- SafeRelease(&pBufferIn);
- CHECK_HR(hr = MFCreateMemoryBuffer(nInputSize, &pBufferIn));
- CHECK_HR(hr = m_pSampleIn->AddBuffer(pBufferIn));
- }
- }
-
- CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
- memcpy(pBufferPtr, pcInputPtr, nInputSize);
- CHECK_HR(hr = pBufferIn->Unlock());
- CHECK_HR(hr = pBufferIn->SetCurrentLength(nInputSize));
-
- if(m_eType == MFCodecType_Encoder)
- {
- CHECK_HR(hr = m_pSampleIn->SetSampleDuration(m_rtDuration));
- CHECK_HR(hr = m_pSampleIn->SetSampleTime(m_rtStart)); // FIXME: use clock(), Same for custom source
- }
+ if(!pcInputPtr || !nInputSize || !ppSampleOut) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return E_INVALIDARG;
+ }
+
+ *ppSampleOut = NULL;
+
+ HRESULT hr = S_OK;
+
+ IMFMediaBuffer* pBufferIn = NULL;
+ BYTE* pBufferPtr = NULL;
+ BOOL bMediaChangeHandled = FALSE; // Endless loop guard
+
+ if(!m_pSampleIn) {
+ CHECK_HR(hr = MFUtils::CreateMediaSample(nInputSize, &m_pSampleIn));
+ hr = m_pSampleIn->GetBufferByIndex(0, &pBufferIn);
+ if(FAILED(hr)) {
+ SafeRelease(&m_pSampleIn);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = m_pSampleIn->GetBufferByIndex(0, &pBufferIn));
+ CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < nInputSize) {
+ CHECK_HR(hr = m_pSampleIn->RemoveAllBuffers());
+ SafeRelease(&pBufferIn);
+ CHECK_HR(hr = MFCreateMemoryBuffer(nInputSize, &pBufferIn));
+ CHECK_HR(hr = m_pSampleIn->AddBuffer(pBufferIn));
+ }
+ }
+
+ CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
+ memcpy(pBufferPtr, pcInputPtr, nInputSize);
+ CHECK_HR(hr = pBufferIn->Unlock());
+ CHECK_HR(hr = pBufferIn->SetCurrentLength(nInputSize));
+
+ if(m_eType == MFCodecType_Encoder) {
+ CHECK_HR(hr = m_pSampleIn->SetSampleDuration(m_rtDuration));
+ CHECK_HR(hr = m_pSampleIn->SetSampleTime(m_rtStart)); // FIXME: use clock(), Same for custom source
+ }
Label_ProcessInput:
- hr = ProcessInput(m_pSampleIn);
- while(hr == MF_E_NOTACCEPTING)
- {
- TSK_DEBUG_INFO("MF_E_NOTACCEPTING");
- IMFSample* pSample = NULL;
- hr = ProcessOutput(&pSample);
- if(SUCCEEDED(hr) && pSample)
- {
- SafeRelease(ppSampleOut);
- *ppSampleOut = pSample, pSample = NULL;
-
- hr = m_pSampleIn->SetUINT32(MFSampleExtension_Discontinuity, TRUE);
- hr = ProcessInput(m_pSampleIn);
- }
- }
- if(!*ppSampleOut)
- {
- hr = ProcessOutput(ppSampleOut);
- if(hr == MF_E_TRANSFORM_STREAM_CHANGE) /* Handling Stream Changes: http://msdn.microsoft.com/en-us/library/windows/desktop/ee663587(v=vs.85).aspx */
- {
- TSK_DEBUG_INFO("[MF Codec] Stream changed");
- if(m_eType == MFCodecType_Decoder)
- {
- IMFMediaType *pTypeOut = NULL;
- hr = m_pMFT->GetOutputAvailableType(m_dwOutputID, 0, &pTypeOut);
- if(SUCCEEDED(hr))
- {
- UINT32 uWidth = 0, uHeight = 0;
- hr = MFGetAttributeSize(pTypeOut, MF_MT_FRAME_SIZE, &uWidth, &uHeight);
- if(SUCCEEDED(hr))
- {
- TSK_DEBUG_INFO("[MF Decoder] New size: width=%u, height=%u", uWidth, uHeight);
- hr = m_pMFT->SetOutputType(m_dwOutputID, pTypeOut, 0);
- if(SUCCEEDED(hr))
- {
- SafeRelease(&m_pOutputType);
- pTypeOut->AddRef();
- m_pOutputType = pTypeOut;
- if(m_eMediaType == MFCodecMediaType_Video)
- {
- dynamic_cast<MFCodecVideo*>(this)->m_nWidth = uWidth;
- dynamic_cast<MFCodecVideo*>(this)->m_nHeight = uHeight;
- }
- }
- }
- }
- SafeRelease(&pTypeOut);
- if(SUCCEEDED(hr))
- {
- if(!bMediaChangeHandled)
- {
- bMediaChangeHandled = TRUE;
- goto Label_ProcessInput;
- }
- }
- }
- }
- }
-
- m_rtStart += m_rtDuration;
-
+ hr = ProcessInput(m_pSampleIn);
+ while(hr == MF_E_NOTACCEPTING) {
+ TSK_DEBUG_INFO("MF_E_NOTACCEPTING");
+ IMFSample* pSample = NULL;
+ hr = ProcessOutput(&pSample);
+ if(SUCCEEDED(hr) && pSample) {
+ SafeRelease(ppSampleOut);
+ *ppSampleOut = pSample, pSample = NULL;
+
+ hr = m_pSampleIn->SetUINT32(MFSampleExtension_Discontinuity, TRUE);
+ hr = ProcessInput(m_pSampleIn);
+ }
+ }
+ if(!*ppSampleOut) {
+ hr = ProcessOutput(ppSampleOut);
+ if(hr == MF_E_TRANSFORM_STREAM_CHANGE) { /* Handling Stream Changes: http://msdn.microsoft.com/en-us/library/windows/desktop/ee663587(v=vs.85).aspx */
+ TSK_DEBUG_INFO("[MF Codec] Stream changed");
+ if(m_eType == MFCodecType_Decoder) {
+ IMFMediaType *pTypeOut = NULL;
+ hr = m_pMFT->GetOutputAvailableType(m_dwOutputID, 0, &pTypeOut);
+ if(SUCCEEDED(hr)) {
+ UINT32 uWidth = 0, uHeight = 0;
+ hr = MFGetAttributeSize(pTypeOut, MF_MT_FRAME_SIZE, &uWidth, &uHeight);
+ if(SUCCEEDED(hr)) {
+ TSK_DEBUG_INFO("[MF Decoder] New size: width=%u, height=%u", uWidth, uHeight);
+ hr = m_pMFT->SetOutputType(m_dwOutputID, pTypeOut, 0);
+ if(SUCCEEDED(hr)) {
+ SafeRelease(&m_pOutputType);
+ pTypeOut->AddRef();
+ m_pOutputType = pTypeOut;
+ if(m_eMediaType == MFCodecMediaType_Video) {
+ dynamic_cast<MFCodecVideo*>(this)->m_nWidth = uWidth;
+ dynamic_cast<MFCodecVideo*>(this)->m_nHeight = uHeight;
+ }
+ }
+ }
+ }
+ SafeRelease(&pTypeOut);
+ if(SUCCEEDED(hr)) {
+ if(!bMediaChangeHandled) {
+ bMediaChangeHandled = TRUE;
+ goto Label_ProcessInput;
+ }
+ }
+ }
+ }
+ }
+
+ m_rtStart += m_rtDuration;
+
bail:
- SafeRelease(&pBufferIn);
- return hr;
+ SafeRelease(&pBufferIn);
+ return hr;
}
enum tmedia_chroma_e MFCodec::GetUncompressedChroma()
{
- if(kMFCodecUncompressedFormat == MFVideoFormat_NV12)
- {
- return tmedia_chroma_nv12;
- }
- assert(false);
- return tmedia_chroma_none;
+ if(kMFCodecUncompressedFormat == MFVideoFormat_NV12) {
+ return tmedia_chroma_nv12;
+ }
+ assert(false);
+ return tmedia_chroma_none;
}
//
@@ -596,12 +529,12 @@ enum tmedia_chroma_e MFCodec::GetUncompressedChroma()
//
MFCodecVideo::MFCodecVideo(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT /*= NULL*/)
-: MFCodec(eId, eType, pMFT)
-, m_nFrameRate(0)
-, m_nWidth(0)
-, m_nHeight(0)
+ : MFCodec(eId, eType, pMFT)
+ , m_nFrameRate(0)
+ , m_nWidth(0)
+ , m_nHeight(0)
{
- assert(m_eMediaType == MFCodecMediaType_Video);
+ assert(m_eMediaType == MFCodecMediaType_Video);
}
MFCodecVideo::~MFCodecVideo()
@@ -610,279 +543,261 @@ MFCodecVideo::~MFCodecVideo()
}
HRESULT MFCodecVideo::Initialize(
- UINT32 nFrameRate,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nOutputBitRateInBps /*= 0*/
- )
+ UINT32 nFrameRate,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nOutputBitRateInBps /*= 0*/
+)
{
- assert(IsValid());
-
- HRESULT hr = S_OK;
+ assert(IsValid());
- VARIANT var = {0};
+ HRESULT hr = S_OK;
- // make sure identifiers are zero-based (other layouts not supported yet)
- hr = m_pMFT->GetStreamIDs(1, &m_dwInputID, 1, &m_dwOutputID);
- if (hr == E_NOTIMPL)
- {
+ VARIANT var = {0};
+
+ // make sure identifiers are zero-based (other layouts not supported yet)
+ hr = m_pMFT->GetStreamIDs(1, &m_dwInputID, 1, &m_dwOutputID);
+ if (hr == E_NOTIMPL) {
m_dwInputID = 0;
m_dwOutputID = 0;
hr = S_OK;
}
- else if (FAILED(hr))
- {
- TSK_DEBUG_ERROR("The stream identifiers are not zero-based");
+ else if (FAILED(hr)) {
+ TSK_DEBUG_ERROR("The stream identifiers are not zero-based");
return hr;
}
- m_rtStart = 0;
- CHECK_HR(hr = MFFrameRateToAverageTimePerFrame(nFrameRate, 1, &m_rtDuration));
+ m_rtStart = 0;
+ CHECK_HR(hr = MFFrameRateToAverageTimePerFrame(nFrameRate, 1, &m_rtDuration));
+
+ CHECK_HR(hr = m_pOutputType->SetGUID(MF_MT_MAJOR_TYPE, (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio));
+ CHECK_HR(hr = m_pInputType->SetGUID(MF_MT_MAJOR_TYPE, (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio));
- CHECK_HR(hr = m_pOutputType->SetGUID(MF_MT_MAJOR_TYPE, (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio));
- CHECK_HR(hr = m_pInputType->SetGUID(MF_MT_MAJOR_TYPE, (m_eMediaType == MFCodecMediaType_Video) ? MFMediaType_Video : MFMediaType_Audio));
+ CHECK_HR(hr = m_pOutputType->SetGUID(MF_MT_SUBTYPE, (m_eType == MFCodecType_Encoder) ? m_guidCompressedFormat : kMFCodecUncompressedFormat));
+ CHECK_HR(hr = m_pInputType->SetGUID(MF_MT_SUBTYPE, (m_eType == MFCodecType_Encoder) ? kMFCodecUncompressedFormat : m_guidCompressedFormat));
- CHECK_HR(hr = m_pOutputType->SetGUID(MF_MT_SUBTYPE, (m_eType == MFCodecType_Encoder) ? m_guidCompressedFormat : kMFCodecUncompressedFormat));
- CHECK_HR(hr = m_pInputType->SetGUID(MF_MT_SUBTYPE, (m_eType == MFCodecType_Encoder) ? kMFCodecUncompressedFormat : m_guidCompressedFormat));
-
- CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, (m_eType == MFCodecType_Encoder) ? FALSE : TRUE));
- CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, (m_eType == MFCodecType_Encoder) ? TRUE : FALSE));
+ CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, (m_eType == MFCodecType_Encoder) ? FALSE : TRUE));
+ CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, (m_eType == MFCodecType_Encoder) ? TRUE : FALSE));
+
+ CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, (m_eType == MFCodecType_Encoder) ? FALSE : TRUE));
+ CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, (m_eType == MFCodecType_Encoder) ? TRUE : FALSE));
+
+ // Set bitrate
+ // Set (MF_MT_AVG_BITRATE) for MediaType
+ // Set (CODECAPI_AVEncCommonMeanBitRate) for H.264
+ hr = SetBitRate(nOutputBitRateInBps);
- CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, (m_eType == MFCodecType_Encoder) ? FALSE : TRUE));
- CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, (m_eType == MFCodecType_Encoder) ? TRUE : FALSE));
-
- // Set bitrate
- // Set (MF_MT_AVG_BITRATE) for MediaType
- // Set (CODECAPI_AVEncCommonMeanBitRate) for H.264
- hr = SetBitRate(nOutputBitRateInBps);
-
CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
- CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+ CHECK_HR(hr = m_pInputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
CHECK_HR(hr = MFSetAttributeSize(m_pOutputType, MF_MT_FRAME_SIZE, nWidth, nHeight));
- CHECK_HR(hr = MFSetAttributeSize(m_pInputType, MF_MT_FRAME_SIZE, nWidth, nHeight));
+ CHECK_HR(hr = MFSetAttributeSize(m_pInputType, MF_MT_FRAME_SIZE, nWidth, nHeight));
CHECK_HR(hr = MFSetAttributeRatio(m_pOutputType, MF_MT_FRAME_RATE, nFrameRate, 1));
- CHECK_HR(hr = MFSetAttributeRatio(m_pInputType, MF_MT_FRAME_RATE, nFrameRate, 1));
+ CHECK_HR(hr = MFSetAttributeRatio(m_pInputType, MF_MT_FRAME_RATE, nFrameRate, 1));
CHECK_HR(hr = MFSetAttributeRatio(m_pOutputType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
- CHECK_HR(hr = MFSetAttributeRatio(m_pInputType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
-
- // Encoder: Output format must be set before input
- // Decoder: Input format must be set before output
- if(m_eType == MFCodecType_Encoder)
- {
- CHECK_HR(hr = m_pMFT->SetOutputType(m_dwOutputID, m_pOutputType, 0));
- CHECK_HR(hr = m_pMFT->SetInputType(m_dwInputID, m_pInputType, 0));
- }
- else
- {
- CHECK_HR(hr = m_pMFT->SetInputType(m_dwInputID, m_pInputType, 0));
- CHECK_HR(hr = m_pMFT->SetOutputType(m_dwOutputID, m_pOutputType, 0));
- }
-
- if(m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)
- {
- if(m_eType == MFCodecType_Decoder)
- {
- // Only decoder support GetAttributes()
- IMFAttributes* pAttributes = NULL;
- hr = m_pMFT->GetAttributes(&pAttributes);
- if(SUCCEEDED(hr))
- {
- // FIXME: Very strange that "CODECAPI_AVLowLatencyMode" only works with "IMFAttributes->" and not "ICodecAPI->SetValue()"
- hr = pAttributes->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
- }
- SafeRelease(&pAttributes);
- }
- else
- {
- var.vt = VT_BOOL;
- var.boolVal = VARIANT_TRUE;
- hr = m_pCodecAPI->SetValue(&CODECAPI_AVLowLatencyMode, &var);
-
- var.vt = VT_BOOL;
- var.boolVal = VARIANT_TRUE;
- hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonLowLatency, &var); // Correct for the decoder
-
- // Disable B-Frames
- var.vt = VT_UI4;
- var.ulVal = 0;
- hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncMPVDefaultBPictureCount, &var);
-
- // Constant bitrate (updated using RTCP)
- var.vt = VT_UI4;
- var.ulVal = eAVEncCommonRateControlMode_CBR;
- hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonRateControlMode, &var);
- }
-
- hr = S_OK; // Not mandatory features
- }
+ CHECK_HR(hr = MFSetAttributeRatio(m_pInputType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
+
+ // Encoder: Output format must be set before input
+ // Decoder: Input format must be set before output
+ if(m_eType == MFCodecType_Encoder) {
+ CHECK_HR(hr = m_pMFT->SetOutputType(m_dwOutputID, m_pOutputType, 0));
+ CHECK_HR(hr = m_pMFT->SetInputType(m_dwInputID, m_pInputType, 0));
+ }
+ else {
+ CHECK_HR(hr = m_pMFT->SetInputType(m_dwInputID, m_pInputType, 0));
+ CHECK_HR(hr = m_pMFT->SetOutputType(m_dwOutputID, m_pOutputType, 0));
+ }
+
+ if(m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main) {
+ if(m_eType == MFCodecType_Decoder) {
+ // Only decoder support GetAttributes()
+ IMFAttributes* pAttributes = NULL;
+ hr = m_pMFT->GetAttributes(&pAttributes);
+ if(SUCCEEDED(hr)) {
+ // FIXME: Very strange that "CODECAPI_AVLowLatencyMode" only works with "IMFAttributes->" and not "ICodecAPI->SetValue()"
+ hr = pAttributes->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
+ }
+ SafeRelease(&pAttributes);
+ }
+ else {
+ var.vt = VT_BOOL;
+ var.boolVal = VARIANT_TRUE;
+ hr = m_pCodecAPI->SetValue(&CODECAPI_AVLowLatencyMode, &var);
+
+ var.vt = VT_BOOL;
+ var.boolVal = VARIANT_TRUE;
+ hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonLowLatency, &var); // Correct for the decoder
+
+ // Disable B-Frames
+ var.vt = VT_UI4;
+ var.ulVal = 0;
+ hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncMPVDefaultBPictureCount, &var);
+
+ // Constant bitrate (updated using RTCP)
+ var.vt = VT_UI4;
+ var.ulVal = eAVEncCommonRateControlMode_CBR;
+ hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonRateControlMode, &var);
+ }
+
+ hr = S_OK; // Not mandatory features
+ }
bail:
- if(SUCCEEDED(hr))
- {
- m_nFrameRate = nFrameRate;
- m_nWidth = nWidth;
- m_nHeight = nHeight;
- }
+ if(SUCCEEDED(hr)) {
+ m_nFrameRate = nFrameRate;
+ m_nWidth = nWidth;
+ m_nHeight = nHeight;
+ }
- return hr;
+ return hr;
}
HRESULT MFCodecVideo::SetGOPSize(UINT32 nFramesCount)
{
- assert(IsValid());
+ assert(IsValid());
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if(m_eType == MFCodecType_Encoder && (m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main))
- {
- VARIANT var = {0};
- var.vt = VT_UI4;
- var.ullVal = nFramesCount;
- CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncMPVGOPSize, &var));
- }
+ if(m_eType == MFCodecType_Encoder && (m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)) {
+ VARIANT var = {0};
+ var.vt = VT_UI4;
+ var.ullVal = nFramesCount;
+ CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncMPVGOPSize, &var));
+ }
bail:
- return hr;
+ return hr;
}
HRESULT MFCodecVideo::SetBitRate(UINT32 nBitRateInBps)
{
- assert(IsValid());
+ assert(IsValid());
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if(nBitRateInBps > 0 && m_eType == MFCodecType_Encoder)
- {
- CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_AVG_BITRATE, nBitRateInBps));
+ if(nBitRateInBps > 0 && m_eType == MFCodecType_Encoder) {
+ CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_AVG_BITRATE, nBitRateInBps));
- if((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main))
- {
- VARIANT var = {0};
+ if((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)) {
+ VARIANT var = {0};
- // Set BitRate
- var.vt = VT_UI4;
- var.ullVal = nBitRateInBps;
- CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonMeanBitRate, &var));
- }
- }
+ // Set BitRate
+ var.vt = VT_UI4;
+ var.ullVal = nBitRateInBps;
+ CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncCommonMeanBitRate, &var));
+ }
+ }
bail:
- return hr;
+ return hr;
}
HRESULT MFCodecVideo::IsSetSliceMaxSizeInBytesSupported(BOOL &supported)
{
- HRESULT hr = S_OK;
- supported = FALSE;
+ HRESULT hr = S_OK;
+ supported = FALSE;
- if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main))
- {
+ if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)) {
#if defined(CODECAPI_AVEncSliceControlMode) && defined(CODECAPI_AVEncSliceControlSize)
- if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlMode) == S_OK && m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlSize) == S_OK) {
- supported = TRUE;
- }
+ if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlMode) == S_OK && m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlSize) == S_OK) {
+ supported = TRUE;
+ }
#endif
- }
- return hr;
+ }
+ return hr;
}
HRESULT MFCodecVideo::SetSliceMaxSizeInBytes(UINT32 nSliceMaxSizeInBytes)
{
- assert(IsValid() && nSliceMaxSizeInBytes > 0);
+ assert(IsValid() && nSliceMaxSizeInBytes > 0);
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main))
- {
+ if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)) {
#if defined(CODECAPI_AVEncSliceControlMode) && defined(CODECAPI_AVEncSliceControlSize)
- if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlMode) == S_OK && m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlSize) == S_OK) {
- VARIANT var = { 0 };
- var.vt = VT_UI4;
+ if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlMode) == S_OK && m_pCodecAPI->IsSupported(&CODECAPI_AVEncSliceControlSize) == S_OK) {
+ VARIANT var = { 0 };
+ var.vt = VT_UI4;
- var.ulVal = 1; // Bits
- CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncSliceControlMode, &var));
+ var.ulVal = 1; // Bits
+ CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncSliceControlMode, &var));
- var.ulVal = (nSliceMaxSizeInBytes << 3); // From Bytes to Bits
- CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncSliceControlSize, &var));
- }
+ var.ulVal = (nSliceMaxSizeInBytes << 3); // From Bytes to Bits
+ CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncSliceControlSize, &var));
+ }
#else
- CHECK_HR(hr = S_OK);
+ CHECK_HR(hr = S_OK);
#endif
- }
+ }
bail:
- return hr;
+ return hr;
}
HRESULT MFCodecVideo::RequestKeyFrame()
{
- assert(IsValid());
-
- HRESULT hr = S_OK;
+ assert(IsValid());
+
+ HRESULT hr = S_OK;
- if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main))
- {
+ if ((m_eId == MFCodecId_H264Base || m_eId == MFCodecId_H264Main)) {
#if defined(CODECAPI_AVEncVideoForceKeyFrame)
- if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncVideoForceKeyFrame) == S_OK) {
- VARIANT var = { 0 };
+ if (m_pCodecAPI->IsSupported(&CODECAPI_AVEncVideoForceKeyFrame) == S_OK) {
+ VARIANT var = { 0 };
- var.vt = VT_UI4;
- var.ulVal = 1;
- CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncVideoForceKeyFrame, &var));
- }
+ var.vt = VT_UI4;
+ var.ulVal = 1;
+ CHECK_HR(hr = m_pCodecAPI->SetValue(&CODECAPI_AVEncVideoForceKeyFrame, &var));
+ }
#else
- CHECK_HR(hr = S_OK);
+ CHECK_HR(hr = S_OK);
#endif
- }
+ }
bail:
- return hr;
+ return hr;
}
//
// MFCodecVideo
//
MFCodecVideoH264::MFCodecVideoH264(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT /*= NULL*/)
-: MFCodecVideo(eId, eType, pMFT)
+ : MFCodecVideo(eId, eType, pMFT)
{
- assert(eId == MFCodecId_H264Base || eId == MFCodecId_H264Main);
-
- HRESULT hr = S_OK;
+ assert(eId == MFCodecId_H264Base || eId == MFCodecId_H264Main);
- if(m_pOutputType)
- {
- CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_MPEG2_PROFILE, (m_eId == MFCodecId_H264Base) ? eAVEncH264VProfile_Base : eAVEncH264VProfile_Main));
- }
+ HRESULT hr = S_OK;
+
+ if(m_pOutputType) {
+ CHECK_HR(hr = m_pOutputType->SetUINT32(MF_MT_MPEG2_PROFILE, (m_eId == MFCodecId_H264Base) ? eAVEncH264VProfile_Base : eAVEncH264VProfile_Main));
+ }
bail:
- assert(SUCCEEDED(hr));
+ assert(SUCCEEDED(hr));
}
MFCodecVideoH264::~MFCodecVideoH264()
{
-
+
}
MFCodecVideoH264* MFCodecVideoH264::CreateCodecH264Base(MFCodecType_t eType, IMFTransform *pMFT /*= NULL*/)
{
- MFCodecVideoH264* pCodec = new MFCodecVideoH264(MFCodecId_H264Base, eType, pMFT);
- if(pCodec && !pCodec->IsValid())
- {
- SafeRelease(&pCodec);
- }
- return pCodec;
+ MFCodecVideoH264* pCodec = new MFCodecVideoH264(MFCodecId_H264Base, eType, pMFT);
+ if(pCodec && !pCodec->IsValid()) {
+ SafeRelease(&pCodec);
+ }
+ return pCodec;
}
MFCodecVideoH264* MFCodecVideoH264::CreateCodecH264Main(MFCodecType_t eType, IMFTransform *pMFT /*= NULL*/)
{
- MFCodecVideoH264* pCodec = new MFCodecVideoH264(MFCodecId_H264Main, eType, pMFT);
- if(pCodec && !pCodec->IsValid())
- {
- SafeRelease(&pCodec);
- }
- return pCodec;
+ MFCodecVideoH264* pCodec = new MFCodecVideoH264(MFCodecId_H264Main, eType, pMFT);
+ if(pCodec && !pCodec->IsValid()) {
+ SafeRelease(&pCodec);
+ }
+ return pCodec;
}
diff --git a/plugins/pluginWinMF/internals/mf_codec.h b/plugins/pluginWinMF/internals/mf_codec.h
index 51b06dc..d4f00c7 100755
--- a/plugins/pluginWinMF/internals/mf_codec.h
+++ b/plugins/pluginWinMF/internals/mf_codec.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -30,125 +30,136 @@
class MFSampleQueue;
-typedef enum MFCodecId_e
-{
- MFCodecId_H264Base,
- MFCodecId_H264Main,
- MFCodecId_AAC
+typedef enum MFCodecId_e {
+ MFCodecId_H264Base,
+ MFCodecId_H264Main,
+ MFCodecId_AAC
}
MFCodecId_t;
-typedef enum MFCodecType_e
-{
- MFCodecType_Encoder,
- MFCodecType_Decoder
+typedef enum MFCodecType_e {
+ MFCodecType_Encoder,
+ MFCodecType_Decoder
}
MFCodecType_t;
-typedef enum MFCodecMediaType_e
-{
- MFCodecMediaType_Audio,
- MFCodecMediaType_Video
+typedef enum MFCodecMediaType_e {
+ MFCodecMediaType_Audio,
+ MFCodecMediaType_Video
}
MFCodecMediaType_t;
-class MFCodec : IMFAsyncCallback
+class MFCodec : IMFAsyncCallback
{
protected:
- MFCodec(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
- virtual ~MFCodec();
- HRESULT ProcessInput(IMFSample* pSample);
- HRESULT ProcessOutput(IMFSample **ppSample);
+ MFCodec(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
+ virtual ~MFCodec();
+ HRESULT ProcessInput(IMFSample* pSample);
+ HRESULT ProcessOutput(IMFSample **ppSample);
public:
- virtual bool IsValid();
- virtual bool IsReady();
- virtual HRESULT Process(const void* pcInputPtr, UINT32 nInputSize, IMFSample **ppSampleOut);
- static enum tmedia_chroma_e GetUncompressedChroma();
- inline IMFTransform* GetMFT(){ return m_pMFT; }
- inline MFCodecId_t GetId() { return m_eId; }
- inline MFCodecType_t GetType() { return m_eType; }
- inline void setBundled(BOOL bBundled) { m_bIsBundled = bBundled; }
-
- // IUnknown
+ virtual bool IsValid();
+ virtual bool IsReady();
+ virtual HRESULT Process(const void* pcInputPtr, UINT32 nInputSize, IMFSample **ppSampleOut);
+ static enum tmedia_chroma_e GetUncompressedChroma();
+ inline IMFTransform* GetMFT() {
+ return m_pMFT;
+ }
+ inline MFCodecId_t GetId() {
+ return m_eId;
+ }
+ inline MFCodecType_t GetType() {
+ return m_eType;
+ }
+ inline void setBundled(BOOL bBundled) {
+ m_bIsBundled = bBundled;
+ }
+
+ // IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
- // IMFAsyncCallback
- STDMETHODIMP GetParameters(DWORD *pdwFlags, DWORD *pdwQueue);
- STDMETHODIMP Invoke(IMFAsyncResult *pAsyncResult);
+ // IMFAsyncCallback
+ STDMETHODIMP GetParameters(DWORD *pdwFlags, DWORD *pdwQueue);
+ STDMETHODIMP Invoke(IMFAsyncResult *pAsyncResult);
private:
- long m_nRefCount;
+ long m_nRefCount;
protected:
- MFCodecId_t m_eId; // Codec Id
- MFCodecType_t m_eType; // Codec type.
- MFCodecMediaType_t m_eMediaType; // Codec Media type.
- DWORD m_dwInputID; // Input stream ID.
+ MFCodecId_t m_eId; // Codec Id
+ MFCodecType_t m_eType; // Codec type.
+ MFCodecMediaType_t m_eMediaType; // Codec Media type.
+ DWORD m_dwInputID; // Input stream ID.
DWORD m_dwOutputID; // Output stream ID.
- GUID m_guidCompressedFormat; // Compressed Media format (e.g. MFVideoFormat_H264)
+ GUID m_guidCompressedFormat; // Compressed Media format (e.g. MFVideoFormat_H264)
IMFTransform *m_pMFT; // Pointer to the encoder MFT.
- ICodecAPI *m_pCodecAPI; // Pointer to CodecAPI.
+ ICodecAPI *m_pCodecAPI; // Pointer to CodecAPI.
IMFMediaType *m_pOutputType; // Output media type of the codec.
- IMFMediaType *m_pInputType; // Input media type of the codec.
+ IMFMediaType *m_pInputType; // Input media type of the codec.
- LONGLONG m_rtStart;
+ LONGLONG m_rtStart;
UINT64 m_rtDuration;
- IMFSample *m_pSampleIn;
- IMFSample *m_pSampleOut;
+ IMFSample *m_pSampleIn;
+ IMFSample *m_pSampleOut;
- MFSampleQueue *m_pSampleQueueAsyncInput;
- BOOL m_bIsBundled; // Bundled with a producer or cosumer -> do not monitor events
- BOOL m_bIsAsync;
- IMFMediaEventGenerator *m_pEventGenerator;
- BOOL m_bIsFirstFrame;
- long m_nMETransformNeedInputCount, m_nMETransformHaveOutputCount;
+ MFSampleQueue *m_pSampleQueueAsyncInput;
+ BOOL m_bIsBundled; // Bundled with a producer or cosumer -> do not monitor events
+ BOOL m_bIsAsync;
+ IMFMediaEventGenerator *m_pEventGenerator;
+ BOOL m_bIsFirstFrame;
+ long m_nMETransformNeedInputCount, m_nMETransformHaveOutputCount;
};
class MFCodecVideo : public MFCodec
{
- friend class MFCodec;
+ friend class MFCodec;
protected:
- MFCodecVideo(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
- virtual ~MFCodecVideo();
+ MFCodecVideo(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
+ virtual ~MFCodecVideo();
public:
- virtual HRESULT Initialize(
- UINT32 nFrameRate,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nOutputBitRateInBps = 0 // Only for encoders
- );
- virtual HRESULT SetGOPSize(UINT32 nFramesCount);
- virtual HRESULT SetBitRate(UINT32 nBitRateInBps);
- virtual HRESULT SetSliceMaxSizeInBytes(UINT32 nSliceMaxSizeInBytes);
- virtual HRESULT RequestKeyFrame();
-
- virtual HRESULT IsSetSliceMaxSizeInBytesSupported(BOOL &supported);
- virtual inline UINT32 GetFrameRate() { return m_nFrameRate; }
- virtual inline UINT32 GetWidth() { return m_nWidth; }
- virtual inline UINT32 GetHeight() { return m_nHeight; }
+ virtual HRESULT Initialize(
+ UINT32 nFrameRate,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nOutputBitRateInBps = 0 // Only for encoders
+ );
+ virtual HRESULT SetGOPSize(UINT32 nFramesCount);
+ virtual HRESULT SetBitRate(UINT32 nBitRateInBps);
+ virtual HRESULT SetSliceMaxSizeInBytes(UINT32 nSliceMaxSizeInBytes);
+ virtual HRESULT RequestKeyFrame();
+
+ virtual HRESULT IsSetSliceMaxSizeInBytesSupported(BOOL &supported);
+ virtual inline UINT32 GetFrameRate() {
+ return m_nFrameRate;
+ }
+ virtual inline UINT32 GetWidth() {
+ return m_nWidth;
+ }
+ virtual inline UINT32 GetHeight() {
+ return m_nHeight;
+ }
protected:
- UINT32 m_nFrameRate;
- UINT32 m_nWidth;
- UINT32 m_nHeight;
+ UINT32 m_nFrameRate;
+ UINT32 m_nWidth;
+ UINT32 m_nHeight;
};
class MFCodecVideoH264 : public MFCodecVideo
{
protected:
- MFCodecVideoH264(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
+ MFCodecVideoH264(MFCodecId_t eId, MFCodecType_t eType, IMFTransform *pMFT = NULL);
public:
- virtual ~MFCodecVideoH264();
- static MFCodecVideoH264* CreateCodecH264Base(MFCodecType_t eType, IMFTransform *pMFT = NULL);
- static MFCodecVideoH264* CreateCodecH264Main(MFCodecType_t eType, IMFTransform *pMFT = NULL);
+ virtual ~MFCodecVideoH264();
+ static MFCodecVideoH264* CreateCodecH264Base(MFCodecType_t eType, IMFTransform *pMFT = NULL);
+ static MFCodecVideoH264* CreateCodecH264Main(MFCodecType_t eType, IMFTransform *pMFT = NULL);
protected:
diff --git a/plugins/pluginWinMF/internals/mf_codec_topology.cxx b/plugins/pluginWinMF/internals/mf_codec_topology.cxx
index 1ee2a16..1f63466 100755
--- a/plugins/pluginWinMF/internals/mf_codec_topology.cxx
+++ b/plugins/pluginWinMF/internals/mf_codec_topology.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -25,134 +25,117 @@
// MFCodecTopologySampleGrabberCB
//
-class MFCodecTopologySampleGrabberCB : public IMFSampleGrabberSinkCallback
+class MFCodecTopologySampleGrabberCB : public IMFSampleGrabberSinkCallback
{
long m_cRef;
MFCodecTopology *m_pCodecTopology;
MFCodecTopologySampleGrabberCB(MFCodecTopology *pCodecTopology)
- : m_cRef(1)
- {
- m_pCodecTopology = pCodecTopology;
- m_pCodecTopology->AddRef();
- }
- virtual ~MFCodecTopologySampleGrabberCB()
- {
- SafeRelease(&m_pCodecTopology);
- }
+ : m_cRef(1) {
+ m_pCodecTopology = pCodecTopology;
+ m_pCodecTopology->AddRef();
+ }
+ virtual ~MFCodecTopologySampleGrabberCB() {
+ SafeRelease(&m_pCodecTopology);
+ }
public:
// Create a new instance of the object.
- static HRESULT MFCodecTopologySampleGrabberCB::CreateInstance(MFCodecTopology *pCodecTopology, MFCodecTopologySampleGrabberCB **ppCB)
- {
- *ppCB = new (std::nothrow) MFCodecTopologySampleGrabberCB(pCodecTopology);
-
- if (ppCB == NULL)
- {
- return E_OUTOFMEMORY;
- }
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::QueryInterface(REFIID riid, void** ppv)
- {
- static const QITAB qit[] =
- {
- QITABENT(MFCodecTopologySampleGrabberCB, IMFSampleGrabberSinkCallback),
- QITABENT(MFCodecTopologySampleGrabberCB, IMFClockStateSink),
- { 0 }
- };
- return QISearch(this, qit, riid, ppv);
- }
-
- STDMETHODIMP_(ULONG) MFCodecTopologySampleGrabberCB::AddRef()
- {
- return InterlockedIncrement(&m_cRef);
- }
-
- STDMETHODIMP_(ULONG) MFCodecTopologySampleGrabberCB::Release()
- {
- ULONG cRef = InterlockedDecrement(&m_cRef);
- if (cRef == 0)
- {
- delete this;
- }
- return cRef;
-
- }
-
- // IMFClockStateSink methods
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockStart(%lld, %lld)", hnsSystemTime, llClockStartOffset);
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockStop(MFTIME hnsSystemTime)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockStop(%lld)", hnsSystemTime);
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockPause(MFTIME hnsSystemTime)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockPause(%lld)", hnsSystemTime);
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockRestart(MFTIME hnsSystemTime)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockRestart(%lld)", hnsSystemTime);
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockSetRate(MFTIME hnsSystemTime, float flRate)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockSetRate(%lld, %f)", hnsSystemTime, flRate);
- return S_OK;
- }
-
- // IMFSampleGrabberSink methods.
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnSetPresentationClock(IMFPresentationClock* pClock)
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnSetPresentationClock");
- return S_OK;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnProcessSample(
- REFGUID guidMajorMediaType, DWORD dwSampleFlags,
- LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
- DWORD dwSampleSize)
- {
- HRESULT hr = S_OK;
- IMFSample *pSample = NULL;
- IMFMediaBuffer* pMediaBuffer = NULL;
- BYTE* _pcBufferPtr = NULL;
-
- CHECK_HR(hr = MFUtils::CreateMediaSample(dwSampleSize, &pSample));
- CHECK_HR(hr = pSample->SetSampleTime(llSampleTime));
- CHECK_HR(hr = pSample->SetSampleDuration(llSampleDuration));
- CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
- CHECK_HR(hr = pMediaBuffer->Lock(&_pcBufferPtr, NULL, NULL));
- memcpy(_pcBufferPtr, pSampleBuffer, dwSampleSize);
- CHECK_HR(hr = pMediaBuffer->SetCurrentLength(dwSampleSize));
- CHECK_HR(hr = pMediaBuffer->Unlock());
-
- m_pCodecTopology->m_SampleQueue.Queue(pSample); // thread-safe
-
+ static HRESULT MFCodecTopologySampleGrabberCB::CreateInstance(MFCodecTopology *pCodecTopology, MFCodecTopologySampleGrabberCB **ppCB) {
+ *ppCB = new (std::nothrow) MFCodecTopologySampleGrabberCB(pCodecTopology);
+
+ if (ppCB == NULL) {
+ return E_OUTOFMEMORY;
+ }
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::QueryInterface(REFIID riid, void** ppv) {
+ static const QITAB qit[] = {
+ QITABENT(MFCodecTopologySampleGrabberCB, IMFSampleGrabberSinkCallback),
+ QITABENT(MFCodecTopologySampleGrabberCB, IMFClockStateSink),
+ { 0 }
+ };
+ return QISearch(this, qit, riid, ppv);
+ }
+
+ STDMETHODIMP_(ULONG) MFCodecTopologySampleGrabberCB::AddRef() {
+ return InterlockedIncrement(&m_cRef);
+ }
+
+ STDMETHODIMP_(ULONG) MFCodecTopologySampleGrabberCB::Release() {
+ ULONG cRef = InterlockedDecrement(&m_cRef);
+ if (cRef == 0) {
+ delete this;
+ }
+ return cRef;
+
+ }
+
+ // IMFClockStateSink methods
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockStart(%lld, %lld)", hnsSystemTime, llClockStartOffset);
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockStop(MFTIME hnsSystemTime) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockStop(%lld)", hnsSystemTime);
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockPause(MFTIME hnsSystemTime) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockPause(%lld)", hnsSystemTime);
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockRestart(MFTIME hnsSystemTime) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockRestart(%lld)", hnsSystemTime);
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnClockSetRate(MFTIME hnsSystemTime, float flRate) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnClockSetRate(%lld, %f)", hnsSystemTime, flRate);
+ return S_OK;
+ }
+
+ // IMFSampleGrabberSink methods.
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnSetPresentationClock(IMFPresentationClock* pClock) {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnSetPresentationClock");
+ return S_OK;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnProcessSample(
+ REFGUID guidMajorMediaType, DWORD dwSampleFlags,
+ LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
+ DWORD dwSampleSize) {
+ HRESULT hr = S_OK;
+ IMFSample *pSample = NULL;
+ IMFMediaBuffer* pMediaBuffer = NULL;
+ BYTE* _pcBufferPtr = NULL;
+
+ CHECK_HR(hr = MFUtils::CreateMediaSample(dwSampleSize, &pSample));
+ CHECK_HR(hr = pSample->SetSampleTime(llSampleTime));
+ CHECK_HR(hr = pSample->SetSampleDuration(llSampleDuration));
+ CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
+ CHECK_HR(hr = pMediaBuffer->Lock(&_pcBufferPtr, NULL, NULL));
+ memcpy(_pcBufferPtr, pSampleBuffer, dwSampleSize);
+ CHECK_HR(hr = pMediaBuffer->SetCurrentLength(dwSampleSize));
+ CHECK_HR(hr = pMediaBuffer->Unlock());
+
+ m_pCodecTopology->m_SampleQueue.Queue(pSample); // thread-safe
+
bail:
- SafeRelease(&pSample);
- SafeRelease(&pMediaBuffer);
- return hr;
- }
-
- STDMETHODIMP MFCodecTopologySampleGrabberCB::OnShutdown()
- {
- TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnShutdown");
- return S_OK;
- }
+ SafeRelease(&pSample);
+ SafeRelease(&pMediaBuffer);
+ return hr;
+ }
+
+ STDMETHODIMP MFCodecTopologySampleGrabberCB::OnShutdown() {
+ TSK_DEBUG_INFO("MFCodecTopologySampleGrabberCB::OnShutdown");
+ return S_OK;
+ }
};
//
@@ -161,36 +144,36 @@ bail:
MFCodecTopology::MFCodecTopology(MFCodec* pCodec, HRESULT &hr)
-: m_nRefCount(1)
-, m_bInitialized(FALSE)
-, m_bStarted(FALSE)
-, m_pCodec(NULL)
-, m_pSource(NULL)
-, m_pSession(NULL)
-, m_pTopologyFull(NULL)
-, m_pTopologyPartial(NULL)
-, m_pOutputType(NULL)
-, m_pInputType(NULL)
-, m_pGrabberCallback(NULL)
-, m_pGrabberActivate(NULL)
-, m_pTread(NULL)
+ : m_nRefCount(1)
+ , m_bInitialized(FALSE)
+ , m_bStarted(FALSE)
+ , m_pCodec(NULL)
+ , m_pSource(NULL)
+ , m_pSession(NULL)
+ , m_pTopologyFull(NULL)
+ , m_pTopologyPartial(NULL)
+ , m_pOutputType(NULL)
+ , m_pInputType(NULL)
+ , m_pGrabberCallback(NULL)
+ , m_pGrabberActivate(NULL)
+ , m_pTread(NULL)
{
- hr = S_OK;
+ hr = S_OK;
- if(!pCodec)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!pCodec) {
+ CHECK_HR(hr = E_POINTER);
+ }
- m_pCodec = pCodec;
- m_pCodec->AddRef();
+ m_pCodec = pCodec;
+ m_pCodec->AddRef();
-bail: ;
+bail:
+ ;
}
MFCodecTopology::~MFCodecTopology()
{
- DeInitialize();
+ DeInitialize();
}
ULONG MFCodecTopology::AddRef()
@@ -201,8 +184,7 @@ ULONG MFCodecTopology::AddRef()
ULONG MFCodecTopology::Release()
{
ULONG uCount = InterlockedDecrement(&m_nRefCount);
- if (uCount == 0)
- {
+ if (uCount == 0) {
delete this;
}
// For thread safety, return a temporary variable.
@@ -211,245 +193,226 @@ ULONG MFCodecTopology::Release()
HRESULT MFCodecTopology::QueryInterface(REFIID iid, void** ppv)
{
- return E_NOTIMPL;
+ return E_NOTIMPL;
}
HRESULT MFCodecTopology::Start()
{
- HRESULT hr = S_OK;
-
- if(m_bStarted)
- {
- return S_OK;
- }
-
- if(!m_bInitialized)
- {
- CHECK_HR(hr = E_FAIL);
- }
-
- CHECK_HR(hr = MFUtils::RunSession(m_pSession, m_pTopologyFull));
-
- // Start asynchronous watcher thread
- m_bStarted = TRUE;
- int ret = tsk_thread_create(&m_pTread, MFCodecTopology::RunSessionThread, this);
- if(ret != 0)
- {
- TSK_DEBUG_ERROR("Failed to create thread");
- m_bStarted = FALSE;
- if(m_pTread)
- {
- tsk_thread_join(&m_pTread);
- }
- MFUtils::ShutdownSession(m_pSession, m_pSource);
- CHECK_HR(hr = E_FAIL);
- }
-
- // FIXME
- Sleep(2000);
+ HRESULT hr = S_OK;
+
+ if(m_bStarted) {
+ return S_OK;
+ }
+
+ if(!m_bInitialized) {
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ CHECK_HR(hr = MFUtils::RunSession(m_pSession, m_pTopologyFull));
+
+ // Start asynchronous watcher thread
+ m_bStarted = TRUE;
+ int ret = tsk_thread_create(&m_pTread, MFCodecTopology::RunSessionThread, this);
+ if(ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ m_bStarted = FALSE;
+ if(m_pTread) {
+ tsk_thread_join(&m_pTread);
+ }
+ MFUtils::ShutdownSession(m_pSession, m_pSource);
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ // FIXME
+ Sleep(2000);
bail:
- return hr;
+ return hr;
}
HRESULT MFCodecTopology::Stop()
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if(!m_bStarted)
- {
- return S_OK;
- }
+ if(!m_bStarted) {
+ return S_OK;
+ }
- m_bStarted = FALSE;
+ m_bStarted = FALSE;
hr = MFUtils::ShutdownSession(m_pSession, NULL); // stop session to wakeup the asynchronous thread
- if(m_pTread)
- {
+ if(m_pTread) {
tsk_thread_join(&m_pTread);
}
hr = MFUtils::ShutdownSession(NULL, m_pSource);
-
- return hr;
+
+ return hr;
}
HRESULT MFCodecTopology::Initialize()
{
- HRESULT hr = S_OK;
- IMFAttributes* pSessionAttributes = NULL;
+ HRESULT hr = S_OK;
+ IMFAttributes* pSessionAttributes = NULL;
- if(m_bInitialized)
- {
- CHECK_HR(hr = E_FAIL);
- }
+ if(m_bInitialized) {
+ CHECK_HR(hr = E_FAIL);
+ }
- // Set session attributes
- CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
- CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
+ // Set session attributes
+ CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
+ CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
- // Get input and output type
- CHECK_HR(hr = m_pCodec->GetInputType(&m_pInputType));
- CHECK_HR(hr = m_pCodec->GetOutputType(&m_pOutputType));
+ // Get input and output type
+ CHECK_HR(hr = m_pCodec->GetInputType(&m_pInputType));
+ CHECK_HR(hr = m_pCodec->GetOutputType(&m_pOutputType));
- // Create custom source
- CHECK_HR(hr = CMFSource::CreateInstanceEx(IID_IMFMediaSource, (void**)&m_pSource, m_pInputType));
+ // Create custom source
+ CHECK_HR(hr = CMFSource::CreateInstanceEx(IID_IMFMediaSource, (void**)&m_pSource, m_pInputType));
- // Create the sample grabber sink.
- CHECK_HR(hr = MFCodecTopologySampleGrabberCB::CreateInstance(this, &m_pGrabberCallback));
- CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(m_pOutputType, m_pGrabberCallback, &m_pGrabberActivate));
+ // Create the sample grabber sink.
+ CHECK_HR(hr = MFCodecTopologySampleGrabberCB::CreateInstance(this, &m_pGrabberCallback));
+ CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(m_pOutputType, m_pGrabberCallback, &m_pGrabberActivate));
- // To run as fast as possible, set this attribute (requires Windows 7 or later):
- CHECK_HR(hr = m_pGrabberActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
+ // To run as fast as possible, set this attribute (requires Windows 7 or later):
+ CHECK_HR(hr = m_pGrabberActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
- // Create the Media Session.
- CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &m_pSession));
+ // Create the Media Session.
+ CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &m_pSession));
- // Create the topology.
- CHECK_HR(hr = MFUtils::CreateTopology(
- m_pSource,
- m_pCodec->GetMFT(),
- m_pGrabberActivate,
- NULL, // no preview
- m_pOutputType,
- &m_pTopologyPartial));
- // Resolve topology (adds video processors if needed).
- CHECK_HR(hr = MFUtils::ResolveTopology(m_pTopologyPartial, &m_pTopologyFull));
+ // Create the topology.
+ CHECK_HR(hr = MFUtils::CreateTopology(
+ m_pSource,
+ m_pCodec->GetMFT(),
+ m_pGrabberActivate,
+ NULL, // no preview
+ m_pOutputType,
+ &m_pTopologyPartial));
+ // Resolve topology (adds video processors if needed).
+ CHECK_HR(hr = MFUtils::ResolveTopology(m_pTopologyPartial, &m_pTopologyFull));
- m_bInitialized = TRUE;
+ m_bInitialized = TRUE;
bail:
- SafeRelease(&pSessionAttributes);
+ SafeRelease(&pSessionAttributes);
- if(FAILED(hr))
- {
- DeInitialize();
- }
+ if(FAILED(hr)) {
+ DeInitialize();
+ }
- return hr;
+ return hr;
}
void* TSK_STDCALL MFCodecTopology::RunSessionThread(void *pArg)
{
- MFCodecTopology *pSelf = (MFCodecTopology *)pArg;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- IMFMediaEvent *pEvent = NULL;
- MediaEventType met;
-
- TSK_DEBUG_INFO("RunSessionThread (MFCodecTopology) - ENTER");
-
- while(pSelf->isStarted())
- {
- CHECK_HR(hr = pSelf->m_pSession->GetEvent(0, &pEvent));
- CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- CHECK_HR(hr = pEvent->GetType(&met));
-
- if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/)
- {
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
- hr = hrStatus;
- goto bail;
- }
- if (met == MESessionEnded)
- {
- break;
- }
- SafeRelease(&pEvent);
- }
+ MFCodecTopology *pSelf = (MFCodecTopology *)pArg;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ IMFMediaEvent *pEvent = NULL;
+ MediaEventType met;
+
+ TSK_DEBUG_INFO("RunSessionThread (MFCodecTopology) - ENTER");
+
+ while(pSelf->isStarted()) {
+ CHECK_HR(hr = pSelf->m_pSession->GetEvent(0, &pEvent));
+ CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
+ CHECK_HR(hr = pEvent->GetType(&met));
+
+ if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/) {
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ hr = hrStatus;
+ goto bail;
+ }
+ if (met == MESessionEnded) {
+ break;
+ }
+ SafeRelease(&pEvent);
+ }
bail:
- TSK_DEBUG_INFO("RunSessionThread (MFCodecTopology) - EXIT");
+ TSK_DEBUG_INFO("RunSessionThread (MFCodecTopology) - EXIT");
- return NULL;
+ return NULL;
}
HRESULT MFCodecTopology::DeInitialize()
{
- Stop();
-
- SafeRelease(&m_pCodec);
- SafeRelease(&m_pSource);
- SafeRelease(&m_pCodec);
- SafeRelease(&m_pSession);
- SafeRelease(&m_pTopologyFull);
- SafeRelease(&m_pTopologyPartial);
- SafeRelease(&m_pOutputType);
- SafeRelease(&m_pInputType);
- SafeRelease(&m_pGrabberCallback);
- SafeRelease(&m_pGrabberActivate);
-
- if(m_pTread)
- {
- tsk_thread_join(&m_pTread);
- }
+ Stop();
+
+ SafeRelease(&m_pCodec);
+ SafeRelease(&m_pSource);
+ SafeRelease(&m_pCodec);
+ SafeRelease(&m_pSession);
+ SafeRelease(&m_pTopologyFull);
+ SafeRelease(&m_pTopologyPartial);
+ SafeRelease(&m_pOutputType);
+ SafeRelease(&m_pInputType);
+ SafeRelease(&m_pGrabberCallback);
+ SafeRelease(&m_pGrabberActivate);
+
+ if(m_pTread) {
+ tsk_thread_join(&m_pTread);
+ }
- m_SampleQueue.Clear();
+ m_SampleQueue.Clear();
- m_bInitialized = FALSE;
+ m_bInitialized = FALSE;
- return S_OK;
+ return S_OK;
}
HRESULT MFCodecTopology::ProcessInput(IMFSample* pSample)
{
- HRESULT hr = S_OK;
- IMFMediaBuffer* pMediaBuffer = NULL;
- BYTE* _pcBufferPtr = NULL;
-
- if(!pSample)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(m_pCodec->GetMediaType() != MFCodecMediaType_Video)
- {
- CHECK_HR(hr = E_NOTIMPL);
- }
-
- if(!m_bStarted)
- {
- CHECK_HR(hr = Start());
- }
-
- CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
-
- DWORD dwDataLength = 0;
- BOOL bLocked = FALSE;
- CHECK_HR(hr = pMediaBuffer->GetCurrentLength(&dwDataLength));
- bLocked = TRUE;
- if(dwDataLength > 0)
- {
- CHECK_HR(hr = pMediaBuffer->Lock(&_pcBufferPtr, NULL, NULL));
- CHECK_HR(hr = m_pSource->CopyVideoBuffer(
- dynamic_cast<MFCodecVideo*>(m_pCodec)->GetWidth(),
- dynamic_cast<MFCodecVideo*>(m_pCodec)->GetHeight(),
- _pcBufferPtr, dwDataLength));
- }
+ HRESULT hr = S_OK;
+ IMFMediaBuffer* pMediaBuffer = NULL;
+ BYTE* _pcBufferPtr = NULL;
+
+ if(!pSample) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(m_pCodec->GetMediaType() != MFCodecMediaType_Video) {
+ CHECK_HR(hr = E_NOTIMPL);
+ }
+
+ if(!m_bStarted) {
+ CHECK_HR(hr = Start());
+ }
+
+ CHECK_HR(hr = pSample->GetBufferByIndex(0, &pMediaBuffer));
+
+ DWORD dwDataLength = 0;
+ BOOL bLocked = FALSE;
+ CHECK_HR(hr = pMediaBuffer->GetCurrentLength(&dwDataLength));
+ bLocked = TRUE;
+ if(dwDataLength > 0) {
+ CHECK_HR(hr = pMediaBuffer->Lock(&_pcBufferPtr, NULL, NULL));
+ CHECK_HR(hr = m_pSource->CopyVideoBuffer(
+ dynamic_cast<MFCodecVideo*>(m_pCodec)->GetWidth(),
+ dynamic_cast<MFCodecVideo*>(m_pCodec)->GetHeight(),
+ _pcBufferPtr, dwDataLength));
+ }
bail:
- if(bLocked)
- {
- pMediaBuffer->Unlock();
- }
- SafeRelease(&pMediaBuffer);
- return hr;
+ if(bLocked) {
+ pMediaBuffer->Unlock();
+ }
+ SafeRelease(&pMediaBuffer);
+ return hr;
}
HRESULT MFCodecTopology::ProcessOutput(IMFSample **ppSample)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if(!ppSample)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!ppSample) {
+ CHECK_HR(hr = E_POINTER);
+ }
- if(!m_SampleQueue.IsEmpty())
- {
- CHECK_HR(hr = m_SampleQueue.Dequeue(ppSample)); // thread-safe
- }
+ if(!m_SampleQueue.IsEmpty()) {
+ CHECK_HR(hr = m_SampleQueue.Dequeue(ppSample)); // thread-safe
+ }
bail:
- return hr;
+ return hr;
}
//
@@ -458,11 +421,11 @@ bail:
MFCodecVideoTopology::MFCodecVideoTopology(MFCodec* pCodec, HRESULT &hr)
-: MFCodecTopology(pCodec, hr)
-, m_nWidth(0)
-, m_nHeight(0)
+ : MFCodecTopology(pCodec, hr)
+ , m_nWidth(0)
+ , m_nHeight(0)
{
- assert(pCodec->GetMediaType() == MFCodecMediaType_Video);
+ assert(pCodec->GetMediaType() == MFCodecMediaType_Video);
}
MFCodecVideoTopology::~MFCodecVideoTopology()
diff --git a/plugins/pluginWinMF/internals/mf_codec_topology.h b/plugins/pluginWinMF/internals/mf_codec_topology.h
index c5d2f34..6a4bb94 100755
--- a/plugins/pluginWinMF/internals/mf_codec_topology.h
+++ b/plugins/pluginWinMF/internals/mf_codec_topology.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,59 +28,63 @@ class MFCodecTopologySampleGrabberCB;
class MFCodecTopology : IUnknown
{
- friend class MFCodecTopologySampleGrabberCB;
+ friend class MFCodecTopologySampleGrabberCB;
public:
- MFCodecTopology(MFCodec* pCodec, HRESULT &hr);
- virtual ~MFCodecTopology();
+ MFCodecTopology(MFCodec* pCodec, HRESULT &hr);
+ virtual ~MFCodecTopology();
- virtual HRESULT Initialize();
- virtual HRESULT DeInitialize();
+ virtual HRESULT Initialize();
+ virtual HRESULT DeInitialize();
- virtual HRESULT ProcessInput(IMFSample* pSample);
- virtual HRESULT ProcessOutput(IMFSample **ppSample);
+ virtual HRESULT ProcessInput(IMFSample* pSample);
+ virtual HRESULT ProcessOutput(IMFSample **ppSample);
- // IUnknown
+ // IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
- inline BOOL isStarted() { return m_bStarted; }
- inline BOOL isInitialized() { return m_bInitialized; }
+ inline BOOL isStarted() {
+ return m_bStarted;
+ }
+ inline BOOL isInitialized() {
+ return m_bInitialized;
+ }
private:
- static void* TSK_STDCALL RunSessionThread(void *pArg);
+ static void* TSK_STDCALL RunSessionThread(void *pArg);
protected:
- HRESULT Start();
- HRESULT Stop();
+ HRESULT Start();
+ HRESULT Stop();
private:
- long m_nRefCount;
+ long m_nRefCount;
protected:
- BOOL m_bInitialized;
- BOOL m_bStarted;
- MFCodec* m_pCodec;
- CMFSource *m_pSource;
- IMFMediaSession *m_pSession;
+ BOOL m_bInitialized;
+ BOOL m_bStarted;
+ MFCodec* m_pCodec;
+ CMFSource *m_pSource;
+ IMFMediaSession *m_pSession;
IMFTopology *m_pTopologyFull;
- IMFTopology *m_pTopologyPartial;
- IMFMediaType *m_pOutputType;
- IMFMediaType *m_pInputType;
- MFCodecTopologySampleGrabberCB *m_pGrabberCallback;
+ IMFTopology *m_pTopologyPartial;
+ IMFMediaType *m_pOutputType;
+ IMFMediaType *m_pInputType;
+ MFCodecTopologySampleGrabberCB *m_pGrabberCallback;
IMFActivate *m_pGrabberActivate;
- tsk_thread_handle_t* m_pTread;
- SampleQueue m_SampleQueue;
+ tsk_thread_handle_t* m_pTread;
+ SampleQueue m_SampleQueue;
};
class MFCodecVideoTopology : public MFCodecTopology
{
public:
- MFCodecVideoTopology(MFCodec* pCodec, HRESULT &hr);
- virtual ~MFCodecVideoTopology();
+ MFCodecVideoTopology(MFCodec* pCodec, HRESULT &hr);
+ virtual ~MFCodecVideoTopology();
private:
- UINT32 m_nWidth, m_nHeight;
+ UINT32 m_nWidth, m_nHeight;
};
diff --git a/plugins/pluginWinMF/internals/mf_custom_src.cxx b/plugins/pluginWinMF/internals/mf_custom_src.cxx
index 1de9904..186887e 100755
--- a/plugins/pluginWinMF/internals/mf_custom_src.cxx
+++ b/plugins/pluginWinMF/internals/mf_custom_src.cxx
@@ -1,20 +1,20 @@
-/*
+/*
* Copyright (C) Microsoft Corporation. All rights reserved.
* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -63,7 +63,7 @@ LONGLONG BufferSizeFromAudioDuration(const WAVEFORMATEX *pWav, LONGLONG duration
HRESULT CMFSource_CreateInstance(REFIID iid, void **ppMFT)
{
- return CMFSource::CreateInstance(iid, ppMFT);
+ return CMFSource::CreateInstance(iid, ppMFT);
}
@@ -77,30 +77,26 @@ HRESULT CMFSource_CreateInstance(REFIID iid, void **ppMFT)
HRESULT CMFSource::CreateInstance(REFIID iid, void **ppSource) // Called when source used as plugin
{
- return CreateInstanceEx(iid, ppSource, NULL);
+ return CreateInstanceEx(iid, ppSource, NULL);
}
HRESULT CMFSource::CreateInstanceEx(REFIID iid, void **ppSource, IMFMediaType *pMediaType) // Called when source directly called
{
- if (ppSource == NULL)
- {
+ if (ppSource == NULL) {
return E_POINTER;
}
HRESULT hr = S_OK;
CMFSource *pSource = new (std::nothrow) CMFSource(hr, pMediaType); // Created with ref count = 1.
- if (pSource == NULL)
- {
+ if (pSource == NULL) {
return E_OUTOFMEMORY;
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pSource->QueryInterface(iid, ppSource);
- if(SUCCEEDED(hr))
- {
- ((CMFSource*)(*ppSource))->AddRef();
- }
+ if(SUCCEEDED(hr)) {
+ ((CMFSource*)(*ppSource))->AddRef();
+ }
}
SafeRelease(&pSource);
@@ -115,22 +111,21 @@ HRESULT CMFSource::CreateInstanceEx(REFIID iid, void **ppSource, IMFMediaType *p
//-------------------------------------------------------------------
CMFSource::CMFSource(HRESULT& hr, IMFMediaType *pMediaType)
- : m_nRefCount(1),
- m_pEventQueue(NULL),
- m_pPresentationDescriptor(NULL),
- m_IsShutdown(FALSE),
- m_state(STATE_STOPPED),
- m_pStream(NULL),
- m_pMediaType(NULL)
+ : m_nRefCount(1),
+ m_pEventQueue(NULL),
+ m_pPresentationDescriptor(NULL),
+ m_IsShutdown(FALSE),
+ m_state(STATE_STOPPED),
+ m_pStream(NULL),
+ m_pMediaType(NULL)
{
// Create the media event queue.
hr = MFCreateEventQueue(&m_pEventQueue);
- if(pMediaType)
- {
- m_pMediaType = pMediaType;
- pMediaType->AddRef();
- }
+ if(pMediaType) {
+ m_pMediaType = pMediaType;
+ pMediaType->AddRef();
+ }
InitializeCriticalSection(&m_critSec);
}
@@ -145,7 +140,7 @@ CMFSource::~CMFSource()
{
assert(m_IsShutdown);
assert(m_nRefCount == 0);
- SafeRelease(&m_pMediaType);
+ SafeRelease(&m_pMediaType);
DeleteCriticalSection(&m_critSec);
}
@@ -154,26 +149,22 @@ CMFSource::~CMFSource()
HRESULT CMFSource::CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize)
{
- if(!pBufferPtr)
- {
- TSK_DEBUG_ERROR("Invalid buffer pointer");
- return E_POINTER;
- }
-
- if(!nWidth || !nHeight || !nBufferSize)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return E_INVALIDARG;
- }
- if(m_pStream)
- {
- return m_pStream->CopyVideoBuffer(nWidth, nHeight, pBufferPtr, nBufferSize);
- }
- else
- {
- TSK_DEBUG_ERROR("No stream associated to this source");
- return E_NOT_VALID_STATE;
- }
+ if(!pBufferPtr) {
+ TSK_DEBUG_ERROR("Invalid buffer pointer");
+ return E_POINTER;
+ }
+
+ if(!nWidth || !nHeight || !nBufferSize) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return E_INVALIDARG;
+ }
+ if(m_pStream) {
+ return m_pStream->CopyVideoBuffer(nWidth, nHeight, pBufferPtr, nBufferSize);
+ }
+ else {
+ TSK_DEBUG_ERROR("No stream associated to this source");
+ return E_NOT_VALID_STATE;
+ }
}
// IUnknown methods
@@ -186,8 +177,7 @@ ULONG CMFSource::AddRef()
ULONG CMFSource::Release()
{
ULONG uCount = InterlockedDecrement(&m_nRefCount);
- if (uCount == 0)
- {
+ if (uCount == 0) {
delete this;
}
// For thread safety, return a temporary variable.
@@ -196,8 +186,7 @@ ULONG CMFSource::Release()
HRESULT CMFSource::QueryInterface(REFIID iid, void** ppv)
{
- static const QITAB qit[] =
- {
+ static const QITAB qit[] = {
QITABENT(CMFSource, IMFMediaEventGenerator),
QITABENT(CMFSource, IMFMediaSource),
{ 0 }
@@ -220,8 +209,7 @@ HRESULT CMFSource::BeginGetEvent(IMFAsyncCallback* pCallback, IUnknown* punkStat
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->BeginGetEvent(pCallback, punkState);
}
@@ -238,8 +226,7 @@ HRESULT CMFSource::EndGetEvent(IMFAsyncResult* pResult, IMFMediaEvent** ppEvent)
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->EndGetEvent(pResult, ppEvent);
}
@@ -263,16 +250,14 @@ HRESULT CMFSource::GetEvent(DWORD dwFlags, IMFMediaEvent** ppEvent)
// Check shutdown
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
pQueue = m_pEventQueue;
pQueue->AddRef();
}
LeaveCriticalSection(&m_critSec);
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pQueue->GetEvent(dwFlags, ppEvent);
}
@@ -288,8 +273,7 @@ HRESULT CMFSource::QueueEvent(MediaEventType met, REFGUID guidExtendedType, HRES
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
}
@@ -309,8 +293,7 @@ HRESULT CMFSource::QueueEvent(MediaEventType met, REFGUID guidExtendedType, HRES
HRESULT CMFSource::CreatePresentationDescriptor(IMFPresentationDescriptor** ppPresentationDescriptor)
{
- if (ppPresentationDescriptor == NULL)
- {
+ if (ppPresentationDescriptor == NULL) {
return E_POINTER;
}
@@ -320,17 +303,14 @@ HRESULT CMFSource::CreatePresentationDescriptor(IMFPresentationDescriptor** ppPr
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
- if (m_pPresentationDescriptor == NULL)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_pPresentationDescriptor == NULL) {
hr = CreatePresentationDescriptor();
}
}
// Clone our default presentation descriptor.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pPresentationDescriptor->Clone(ppPresentationDescriptor);
}
@@ -347,8 +327,7 @@ HRESULT CMFSource::CreatePresentationDescriptor(IMFPresentationDescriptor** ppPr
HRESULT CMFSource::GetCharacteristics(DWORD* pdwCharacteristics)
{
- if (pdwCharacteristics == NULL)
- {
+ if (pdwCharacteristics == NULL) {
return E_POINTER;
}
@@ -358,8 +337,7 @@ HRESULT CMFSource::GetCharacteristics(DWORD* pdwCharacteristics)
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
*pdwCharacteristics = MFMEDIASOURCE_CAN_PAUSE | MFMEDIASOURCE_IS_LIVE;
}
@@ -377,7 +355,7 @@ HRESULT CMFSource::Start(
IMFPresentationDescriptor* pPresentationDescriptor,
const GUID* pguidTimeFormat,
const PROPVARIANT* pvarStartPosition
- )
+)
{
HRESULT hr = S_OK;
LONGLONG llStartOffset = 0;
@@ -392,14 +370,12 @@ HRESULT CMFSource::Start(
// Check parameters.
// Start position and presentation descriptor cannot be NULL.
- if (pvarStartPosition == NULL || pPresentationDescriptor == NULL)
- {
+ if (pvarStartPosition == NULL || pPresentationDescriptor == NULL) {
return E_INVALIDARG;
}
// Check the time format. Must be "reference time" units.
- if ((pguidTimeFormat != NULL) && (*pguidTimeFormat != GUID_NULL))
- {
+ if ((pguidTimeFormat != NULL) && (*pguidTimeFormat != GUID_NULL)) {
// Unrecognized time format GUID.
return MF_E_UNSUPPORTED_TIME_FORMAT;
}
@@ -410,33 +386,27 @@ HRESULT CMFSource::Start(
CHECK_HR(hr = CheckShutdown());
// Check the start position.
- if (pvarStartPosition->vt == VT_I8)
- {
+ if (pvarStartPosition->vt == VT_I8) {
// Start position is given in pvarStartPosition in 100-ns units.
llStartOffset = pvarStartPosition->hVal.QuadPart;
- if (m_state != STATE_STOPPED)
- {
+ if (m_state != STATE_STOPPED) {
// Source is running or paused, so this is a seek.
bIsSeek = TRUE;
}
}
- else if (pvarStartPosition->vt == VT_EMPTY)
- {
+ else if (pvarStartPosition->vt == VT_EMPTY) {
// Start position is "current position".
// For stopped, that means 0. Otherwise, use the current position.
- if (m_state == STATE_STOPPED)
- {
+ if (m_state == STATE_STOPPED) {
llStartOffset = 0;
}
- else
- {
+ else {
llStartOffset = GetCurrentPosition();
bIsRestartFromCurrentPosition = TRUE;
}
}
- else
- {
+ else {
// We don't support this time format.
hr = MF_E_UNSUPPORTED_TIME_FORMAT;
goto bail;
@@ -457,12 +427,10 @@ HRESULT CMFSource::Start(
var.hVal.QuadPart = llStartOffset;
// Send the source event.
- if (bIsSeek)
- {
+ if (bIsSeek) {
CHECK_HR(hr = QueueEvent(MESourceSeeked, GUID_NULL, hr, &var));
}
- else
- {
+ else {
// For starting, if we are RESTARTING from the current position and our
// previous state was running/paused, then we need to add the
// MF_EVENT_SOURCE_ACTUAL_START attribute to the event. This requires
@@ -472,8 +440,7 @@ HRESULT CMFSource::Start(
CHECK_HR(hr = MFCreateMediaEvent(MESourceStarted, GUID_NULL, hr, &var, &pEvent));
// For restarts, set the actual start time as an attribute.
- if (bIsRestartFromCurrentPosition)
- {
+ if (bIsRestartFromCurrentPosition) {
CHECK_HR(hr = pEvent->SetUINT64(MF_EVENT_SOURCE_ACTUAL_START, llStartOffset));
}
@@ -484,31 +451,26 @@ HRESULT CMFSource::Start(
bQueuedStartEvent = TRUE;
// Send the stream event.
- if (m_pStream)
- {
- if (bIsSeek)
- {
+ if (m_pStream) {
+ if (bIsSeek) {
CHECK_HR(hr = m_pStream->QueueEvent(MEStreamSeeked, GUID_NULL, hr, &var));
}
- else
- {
+ else {
CHECK_HR(hr = m_pStream->QueueEvent(MEStreamStarted, GUID_NULL, hr, &var));
}
}
- if (bIsSeek)
- {
+ if (bIsSeek) {
// For seek requests, flush any queued samples.
CHECK_HR(hr = m_pStream->Flush());
}
- else
- {
+ else {
// Otherwise, deliver any queued samples.
CHECK_HR(hr = m_pStream->DeliverQueuedSamples());
}
- // Initialize Stream parameters
- CHECK_HR(hr = m_pStream->InitializeParams());
+ // Initialize Stream parameters
+ CHECK_HR(hr = m_pStream->InitializeParams());
m_state = STATE_STARTED;
@@ -522,8 +484,7 @@ bail:
// event (with a success code), then we need to raise an
// MEError event.
- if (FAILED(hr) && bQueuedStartEvent)
- {
+ if (FAILED(hr) && bQueuedStartEvent) {
hr = QueueEvent(MEError, GUID_NULL, hr, &var);
}
@@ -531,7 +492,7 @@ bail:
SafeRelease(&pEvent);
LeaveCriticalSection(&m_critSec);
-
+
return hr;
}
@@ -550,31 +511,25 @@ HRESULT CMFSource::Pause()
hr = CheckShutdown();
// Pause is only allowed from started state.
- if (SUCCEEDED(hr))
- {
- if (m_state != STATE_STARTED)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_state != STATE_STARTED) {
hr = MF_E_INVALID_STATE_TRANSITION;
}
}
// Send the appropriate events.
- if (SUCCEEDED(hr))
- {
- if (m_pStream)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_pStream) {
hr = m_pStream->QueueEvent(MEStreamPaused, GUID_NULL, S_OK, NULL);
}
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = QueueEvent(MESourcePaused, GUID_NULL, S_OK, NULL);
}
// Update our state.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
m_state = STATE_PAUSED;
}
@@ -597,8 +552,7 @@ HRESULT CMFSource::Stop()
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Update our state.
m_state = STATE_STOPPED;
@@ -610,15 +564,12 @@ HRESULT CMFSource::Stop()
// Queue events.
//
- if (SUCCEEDED(hr))
- {
- if (m_pStream)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_pStream) {
hr = m_pStream->QueueEvent(MEStreamStopped, GUID_NULL, S_OK, NULL);
}
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = QueueEvent(MESourceStopped, GUID_NULL, S_OK, NULL);
}
@@ -645,17 +596,14 @@ HRESULT CMFSource::Shutdown()
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Shut down the stream object.
- if (m_pStream)
- {
+ if (m_pStream) {
(void)m_pStream->Shutdown();
}
// Shut down the event queue.
- if (m_pEventQueue)
- {
+ if (m_pEventQueue) {
(void)m_pEventQueue->Shutdown();
}
@@ -694,44 +642,39 @@ HRESULT CMFSource::CreatePresentationDescriptor()
// Create the stream descriptor.
hr = MFCreateStreamDescriptor(
- 0, // stream identifier
- 1, // Number of media types.
- &m_pMediaType, // Array of media types
- &pStreamDescriptor
- );
+ 0, // stream identifier
+ 1, // Number of media types.
+ &m_pMediaType, // Array of media types
+ &pStreamDescriptor
+ );
// Set the default media type on the media type handler.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pStreamDescriptor->GetMediaTypeHandler(&pHandler);
}
-
- if (SUCCEEDED(hr))
- {
- hr = pHandler->SetCurrentMediaType(m_pMediaType);
+
+ if (SUCCEEDED(hr)) {
+ hr = pHandler->SetCurrentMediaType(m_pMediaType);
}
// Create the presentation descriptor.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = MFCreatePresentationDescriptor(
- 1, // Number of stream descriptors
- &pStreamDescriptor, // Array of stream descriptors
- &m_pPresentationDescriptor
- );
+ 1, // Number of stream descriptors
+ &pStreamDescriptor, // Array of stream descriptors
+ &m_pPresentationDescriptor
+ );
}
// Select the first stream
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pPresentationDescriptor->SelectStream(0);
}
// Set the file/stream duration as an attribute on the presentation descriptor.
- if (SUCCEEDED(hr))
- {
- hr = m_pPresentationDescriptor->SetUINT64(MF_PD_DURATION, (UINT64)ULLONG_MAX);
+ if (SUCCEEDED(hr)) {
+ hr = m_pPresentationDescriptor->SetUINT64(MF_PD_DURATION, (UINT64)ULLONG_MAX);
}
-
+
SafeRelease(&pStreamDescriptor);
SafeRelease(&pHandler);
return hr;
@@ -764,7 +707,7 @@ HRESULT CMFSource::ValidatePresentationDescriptor(IMFPresentationDescriptor *pPD
IMFStreamDescriptor *pStreamDescriptor = NULL;
IMFMediaTypeHandler *pHandler = NULL;
IMFMediaType *pMediaType = NULL;
- GUID majorType;
+ GUID majorType;
DWORD cStreamDescriptors = 0;
BOOL fSelected = FALSE;
@@ -772,85 +715,71 @@ HRESULT CMFSource::ValidatePresentationDescriptor(IMFPresentationDescriptor *pPD
// Make sure there is only one stream.
hr = pPD->GetStreamDescriptorCount(&cStreamDescriptors);
- if (SUCCEEDED(hr))
- {
- if (cStreamDescriptors != 1)
- {
+ if (SUCCEEDED(hr)) {
+ if (cStreamDescriptors != 1) {
hr = MF_E_UNSUPPORTED_REPRESENTATION;
}
}
// Get the stream descriptor.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pPD->GetStreamDescriptorByIndex(0, &fSelected, &pStreamDescriptor);
}
// Make sure it's selected. (This media source has only one stream, so it
// is not useful to deselect the only stream.)
- if (SUCCEEDED(hr))
- {
- if (!fSelected)
- {
+ if (SUCCEEDED(hr)) {
+ if (!fSelected) {
hr = MF_E_UNSUPPORTED_REPRESENTATION;
}
}
// Get the media type handler, so that we can get the media type.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pStreamDescriptor->GetMediaTypeHandler(&pHandler);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pHandler->GetCurrentMediaType(&pMediaType);
}
- hr = pMediaType->GetMajorType(&majorType);
-
- if (SUCCEEDED(hr))
- {
- if(majorType == MFMediaType_Video)
- {
- if (SUCCEEDED(hr))
- {
- hr = MFUtils::ValidateVideoFormat(pMediaType);
- }
- }
- else
- {
- WAVEFORMATEX *pFormat = NULL;
- UINT32 cbWaveFormat = 0;
-
- if (SUCCEEDED(hr))
- {
- hr = MFCreateWaveFormatExFromMFMediaType(
- pMediaType,
- &pFormat,
- &cbWaveFormat);
- }
- if (SUCCEEDED(hr))
- {
- /*assert(this->WaveFormat() != NULL);
-
- if (cbWaveFormat < this->WaveFormatSize())
- {
- hr = MF_E_INVALIDMEDIATYPE;
- }*/
- }
-
- if (SUCCEEDED(hr))
- {
- /*if (memcmp(pFormat, WaveFormat(), WaveFormatSize()) != 0)
- {
- hr = MF_E_INVALIDMEDIATYPE;
- }*/
- }
-
- CoTaskMemFree(pFormat);
- }
- }
+ hr = pMediaType->GetMajorType(&majorType);
+
+ if (SUCCEEDED(hr)) {
+ if(majorType == MFMediaType_Video) {
+ if (SUCCEEDED(hr)) {
+ hr = MFUtils::ValidateVideoFormat(pMediaType);
+ }
+ }
+ else {
+ WAVEFORMATEX *pFormat = NULL;
+ UINT32 cbWaveFormat = 0;
+
+ if (SUCCEEDED(hr)) {
+ hr = MFCreateWaveFormatExFromMFMediaType(
+ pMediaType,
+ &pFormat,
+ &cbWaveFormat);
+ }
+ if (SUCCEEDED(hr)) {
+ /*assert(this->WaveFormat() != NULL);
+
+ if (cbWaveFormat < this->WaveFormatSize())
+ {
+ hr = MF_E_INVALIDMEDIATYPE;
+ }*/
+ }
+
+ if (SUCCEEDED(hr)) {
+ /*if (memcmp(pFormat, WaveFormat(), WaveFormatSize()) != 0)
+ {
+ hr = MF_E_INVALIDMEDIATYPE;
+ }*/
+ }
+
+ CoTaskMemFree(pFormat);
+ }
+ }
SafeRelease(&pStreamDescriptor);
SafeRelease(&pHandler);
@@ -882,27 +811,23 @@ HRESULT CMFSource::QueueNewStreamEvent(IMFPresentationDescriptor *pPD)
hr = pPD->GetStreamDescriptorByIndex(0, &fSelected, &pSD);
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// The stream must be selected, because we don't allow the app
// to de-select the stream. See ValidatePresentationDescriptor.
assert(fSelected);
- if (m_pStream)
- {
+ if (m_pStream) {
// The stream already exists, and is still selected.
// Send the MEUpdatedStream event.
hr = QueueEventWithIUnknown(this, MEUpdatedStream, S_OK, m_pStream);
}
- else
- {
+ else {
// The stream does not exist, and is now selected.
// Create a new stream.
hr = CreateCMFStreamSource(pSD);
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// CreateCMFStreamSource creates the stream, so m_pStream is no longer NULL.
assert(m_pStream != NULL);
@@ -926,13 +851,11 @@ HRESULT CMFSource::CreateCMFStreamSource(IMFStreamDescriptor *pSD)
HRESULT hr = S_OK;
m_pStream = new (std::nothrow) CMFStreamSource(this, pSD, hr);
- if (m_pStream == NULL)
- {
+ if (m_pStream == NULL) {
hr = E_OUTOFMEMORY;
}
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
SafeRelease(&m_pStream);
}
@@ -948,12 +871,10 @@ HRESULT CMFSource::CreateCMFStreamSource(IMFStreamDescriptor *pSD)
LONGLONG CMFSource::GetCurrentPosition() const
{
- if (m_pStream)
- {
+ if (m_pStream) {
return m_pStream->GetCurrentPosition();
}
- else
- {
+ else {
// If no stream is selected, we are at time 0 by definition.
return 0;
}
@@ -977,11 +898,11 @@ CMFStreamSource::CMFStreamSource(CMFSource *pSource, IMFStreamDescriptor *pSD,
m_pEventQueue(NULL),
m_IsShutdown(FALSE),
m_rtCurrentPosition(0),
- m_rtDuration(0),
+ m_rtDuration(0),
m_discontinuity(FALSE),
m_EOS(FALSE),
- m_pMediaBuffer(NULL),
- m_nBufferSize(0)
+ m_pMediaBuffer(NULL),
+ m_nBufferSize(0)
{
m_pSource = pSource;
m_pSource->AddRef();
@@ -992,12 +913,12 @@ CMFStreamSource::CMFStreamSource(CMFSource *pSource, IMFStreamDescriptor *pSD,
// Create the media event queue.
CHECK_HR(hr = MFCreateEventQueue(&m_pEventQueue));
- //CHECK_HR(hr = InitializeParams());
-
+ //CHECK_HR(hr = InitializeParams());
+
InitializeCriticalSection(&m_critSec);
bail:
- return;
+ return;
}
@@ -1010,7 +931,7 @@ CMFStreamSource::~CMFStreamSource()
assert(m_IsShutdown);
assert(m_nRefCount == 0);
- SafeRelease(&m_pMediaBuffer);
+ SafeRelease(&m_pMediaBuffer);
DeleteCriticalSection(&m_critSec);
}
@@ -1020,38 +941,36 @@ CMFStreamSource::~CMFStreamSource()
HRESULT CMFStreamSource::CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize)
{
- // Buffer pointer and size validity already checked by source (caller)
- if(m_guidMajorType != MFMediaType_Video)
- {
- TSK_DEBUG_ERROR("Calling CopyVideoBuffer on no-video stream");
+ // Buffer pointer and size validity already checked by source (caller)
+ if(m_guidMajorType != MFMediaType_Video) {
+ TSK_DEBUG_ERROR("Calling CopyVideoBuffer on no-video stream");
#if defined(E_ILLEGAL_METHOD_CALL)
- return E_ILLEGAL_METHOD_CALL;
+ return E_ILLEGAL_METHOD_CALL;
#else
- return _HRESULT_TYPEDEF_(0x8000000EL);
+ return _HRESULT_TYPEDEF_(0x8000000EL);
#endif
- }
- if(nWidth != m_structVideoParams.nWidth || nHeight != m_structVideoParams.nHeigh || nBufferSize != m_nBufferSize)
- {
- TSK_DEBUG_ERROR("Invalid argument %u#%u or %u#%u or %u#%u. If the call is from a video consumer then, you can safely ignore this message.", nWidth, m_structVideoParams.nWidth, nHeight, m_structVideoParams.nHeigh, nBufferSize, m_nBufferSize);
+ }
+ if(nWidth != m_structVideoParams.nWidth || nHeight != m_structVideoParams.nHeigh || nBufferSize != m_nBufferSize) {
+ TSK_DEBUG_ERROR("Invalid argument %u#%u or %u#%u or %u#%u. If the call is from a video consumer then, you can safely ignore this message.", nWidth, m_structVideoParams.nWidth, nHeight, m_structVideoParams.nHeigh, nBufferSize, m_nBufferSize);
#if defined(E_BOUNDS)
- return E_BOUNDS;
+ return E_BOUNDS;
#else
- return _HRESULT_TYPEDEF_(0x8000000BL);
+ return _HRESULT_TYPEDEF_(0x8000000BL);
#endif
- }
-
- HRESULT hr = S_OK;
-
- BYTE* pMediaBufferPtr = NULL;
- DWORD cbMaxLength = nBufferSize, cbCurrentLength = nBufferSize;
- CHECK_HR(hr = m_pMediaBuffer->Lock(&pMediaBufferPtr, &cbMaxLength, &cbCurrentLength));
-
- memcpy(pMediaBufferPtr, pBufferPtr, nBufferSize);
- CHECK_HR(hr = m_pMediaBuffer->SetCurrentLength(nBufferSize));
- CHECK_HR(hr = m_pMediaBuffer->Unlock());
-
+ }
+
+ HRESULT hr = S_OK;
+
+ BYTE* pMediaBufferPtr = NULL;
+ DWORD cbMaxLength = nBufferSize, cbCurrentLength = nBufferSize;
+ CHECK_HR(hr = m_pMediaBuffer->Lock(&pMediaBufferPtr, &cbMaxLength, &cbCurrentLength));
+
+ memcpy(pMediaBufferPtr, pBufferPtr, nBufferSize);
+ CHECK_HR(hr = m_pMediaBuffer->SetCurrentLength(nBufferSize));
+ CHECK_HR(hr = m_pMediaBuffer->Unlock());
+
bail:
- return hr;
+ return hr;
}
// IUnknown methods
@@ -1064,8 +983,7 @@ ULONG CMFStreamSource::AddRef()
ULONG CMFStreamSource::Release()
{
ULONG uCount = InterlockedDecrement(&m_nRefCount);
- if (uCount == 0)
- {
+ if (uCount == 0) {
delete this;
}
// For thread safety, return a temporary variable.
@@ -1074,8 +992,7 @@ ULONG CMFStreamSource::Release()
HRESULT CMFStreamSource::QueryInterface(REFIID iid, void** ppv)
{
- static const QITAB qit[] =
- {
+ static const QITAB qit[] = {
QITABENT(CMFStreamSource, IMFMediaEventGenerator),
QITABENT(CMFStreamSource, IMFMediaStream),
{ 0 }
@@ -1094,8 +1011,7 @@ HRESULT CMFStreamSource::BeginGetEvent(IMFAsyncCallback* pCallback, IUnknown* pu
EnterCriticalSection(&m_critSec);
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->BeginGetEvent(pCallback, punkState);
}
@@ -1110,8 +1026,7 @@ HRESULT CMFStreamSource::EndGetEvent(IMFAsyncResult* pResult, IMFMediaEvent** pp
EnterCriticalSection(&m_critSec);
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->EndGetEvent(pResult, ppEvent);
}
@@ -1129,16 +1044,14 @@ HRESULT CMFStreamSource::GetEvent(DWORD dwFlags, IMFMediaEvent** ppEvent)
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
pQueue = m_pEventQueue;
pQueue->AddRef();
}
LeaveCriticalSection(&m_critSec);
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pQueue->GetEvent(dwFlags, ppEvent);
}
@@ -1153,8 +1066,7 @@ HRESULT CMFStreamSource::QueueEvent(MediaEventType met, REFGUID guidExtendedType
EnterCriticalSection(&m_critSec);
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pEventQueue->QueueEventParamVar(met, guidExtendedType, hrStatus, pvValue);
}
@@ -1173,8 +1085,7 @@ HRESULT CMFStreamSource::QueueEvent(MediaEventType met, REFGUID guidExtendedType
HRESULT CMFStreamSource::GetMediaSource(IMFMediaSource** ppMediaSource)
{
- if (ppMediaSource == NULL)
- {
+ if (ppMediaSource == NULL) {
return E_POINTER;
}
@@ -1187,16 +1098,13 @@ HRESULT CMFStreamSource::GetMediaSource(IMFMediaSource** ppMediaSource)
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
- if (m_pSource == NULL)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_pSource == NULL) {
hr = E_UNEXPECTED;
}
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = m_pSource->QueryInterface(IID_PPV_ARGS(ppMediaSource));
}
@@ -1212,13 +1120,11 @@ HRESULT CMFStreamSource::GetMediaSource(IMFMediaSource** ppMediaSource)
HRESULT CMFStreamSource::GetStreamDescriptor(IMFStreamDescriptor** ppStreamDescriptor)
{
- if (ppStreamDescriptor == NULL)
- {
+ if (ppStreamDescriptor == NULL) {
return E_POINTER;
}
- if (m_pStreamDescriptor == NULL)
- {
+ if (m_pStreamDescriptor == NULL) {
return E_UNEXPECTED;
}
@@ -1228,8 +1134,7 @@ HRESULT CMFStreamSource::GetStreamDescriptor(IMFStreamDescriptor** ppStreamDescr
hr = CheckShutdown();
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
*ppStreamDescriptor = m_pStreamDescriptor;
(*ppStreamDescriptor)->AddRef();
}
@@ -1250,8 +1155,7 @@ HRESULT CMFStreamSource::GetStreamDescriptor(IMFStreamDescriptor** ppStreamDescr
HRESULT CMFStreamSource::RequestSample(IUnknown* pToken)
{
- if (m_pSource == NULL)
- {
+ if (m_pSource == NULL) {
return E_UNEXPECTED;
}
@@ -1266,60 +1170,49 @@ HRESULT CMFStreamSource::RequestSample(IUnknown* pToken)
hr = CheckShutdown();
// Check if we already reached the end of the stream.
- if (SUCCEEDED(hr))
- {
- if (m_EOS)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_EOS) {
hr = MF_E_END_OF_STREAM;
}
}
// Check the source is stopped.
// GetState does not hold the source's critical section. Safe to call.
- if (SUCCEEDED(hr))
- {
- if (m_pSource->GetState() == CMFSource::STATE_STOPPED)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_pSource->GetState() == CMFSource::STATE_STOPPED) {
hr = MF_E_INVALIDREQUEST;
}
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Create a new audio sample.
hr = CreateSample(&pSample);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// If the caller provided a token, attach it to the sample as
// an attribute.
// NOTE: If we processed sample requests asynchronously, we would
// need to call AddRef on the token and put the token onto a FIFO
// queue. See documenation for IMFMediaStream::RequestSample.
- if (pToken && pSample)
- {
+ if (pToken && pSample) {
hr = pSample->SetUnknown(MFSampleExtension_Token, pToken);
}
}
// If paused, queue the sample for later delivery. Otherwise, deliver the sample now.
- if (SUCCEEDED(hr) && pSample)
- {
- if (m_pSource->GetState() == CMFSource::STATE_PAUSED)
- {
+ if (SUCCEEDED(hr) && pSample) {
+ if (m_pSource->GetState() == CMFSource::STATE_PAUSED) {
hr = m_sampleQueue.Queue(pSample);
}
- else
- {
+ else {
hr = DeliverSample(pSample);
}
}
// Cache a pointer to the source, prior to leaving the critical section.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
pSource = m_pSource;
pSource->AddRef();
}
@@ -1334,10 +1227,8 @@ HRESULT CMFStreamSource::RequestSample(IUnknown* pToken)
// source's critical section while holding the stream's critical section, at
// risk of deadlock.
- if (SUCCEEDED(hr))
- {
- if (m_EOS)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_EOS) {
hr = pSource->QueueEvent(MEEndOfPresentation, GUID_NULL, S_OK, NULL);
}
}
@@ -1352,78 +1243,72 @@ HRESULT CMFStreamSource::RequestSample(IUnknown* pToken)
HRESULT CMFStreamSource::InitializeParams()
{
- HRESULT hr = S_OK;
-
- IMFMediaTypeHandler *pMediaTypeHandler = NULL;
- IMFMediaType* pMediaType = NULL;
-
- CHECK_HR(hr = m_pStreamDescriptor->GetMediaTypeHandler(&pMediaTypeHandler));
- CHECK_HR(hr = pMediaTypeHandler->GetCurrentMediaType(&pMediaType));
-
- GUID majorType, subType;
- pMediaType->GetMajorType(&majorType);
- if(majorType == MFMediaType_Video)
- {
- memset(&m_structVideoParams, 0, sizeof(m_structVideoParams));
- CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &m_structVideoParams.nWidth, &m_structVideoParams.nHeigh));
- CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
-
- m_guidMajorType = MFMediaType_Video;
- m_guidSubType = subType;
-
- // Guess video size
- UINT32 nBufferSize;
- if(subType == MFVideoFormat_RGB32)
- {
- nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh << 2);
- }
- else if(subType == MFVideoFormat_RGB24)
- {
- nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh << 2);
- }
- else if(subType == MFVideoFormat_NV12 || subType == MFVideoFormat_I420)
- {
- nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh * 3) >> 1;
- }
- else
- {
- TSK_DEBUG_ERROR("Video subType not supported");
- CHECK_HR(hr = E_NOTIMPL);
- }
-
- // Allocate media buffer
- SafeRelease(&m_pMediaBuffer);
- CHECK_HR(hr = MFCreateMemoryBuffer(nBufferSize, &m_pMediaBuffer));
- m_nBufferSize = nBufferSize;
- {
- //FIXME: DeliverSample() stops if no data
- BYTE* pBuffer = NULL;
- CHECK_HR(hr = m_pMediaBuffer->Lock(&pBuffer, NULL, NULL));
- memset(pBuffer, 0, nBufferSize);
- CHECK_HR(hr = m_pMediaBuffer->SetCurrentLength(nBufferSize));
- CHECK_HR(hr = m_pMediaBuffer->Unlock());
- }
-
- // Retrieve video Frame rate
- UINT32 unNumerator, unDenominator;
- CHECK_HR(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &unNumerator, &unDenominator));
- m_structVideoParams.nFps = (unNumerator / unDenominator);
-
- // Retrieve sample duration based on framerate
- m_rtCurrentPosition = 0;
- CHECK_HR(hr = MFFrameRateToAverageTimePerFrame(m_structVideoParams.nFps, 1, &m_rtDuration));
- }
- else
- {
- TSK_DEBUG_ERROR("Only video media type is supported");
- CHECK_HR(hr = E_NOTIMPL);
- }
+ HRESULT hr = S_OK;
+
+ IMFMediaTypeHandler *pMediaTypeHandler = NULL;
+ IMFMediaType* pMediaType = NULL;
+
+ CHECK_HR(hr = m_pStreamDescriptor->GetMediaTypeHandler(&pMediaTypeHandler));
+ CHECK_HR(hr = pMediaTypeHandler->GetCurrentMediaType(&pMediaType));
+
+ GUID majorType, subType;
+ pMediaType->GetMajorType(&majorType);
+ if(majorType == MFMediaType_Video) {
+ memset(&m_structVideoParams, 0, sizeof(m_structVideoParams));
+ CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &m_structVideoParams.nWidth, &m_structVideoParams.nHeigh));
+ CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
+
+ m_guidMajorType = MFMediaType_Video;
+ m_guidSubType = subType;
+
+ // Guess video size
+ UINT32 nBufferSize;
+ if(subType == MFVideoFormat_RGB32) {
+ nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh << 2);
+ }
+ else if(subType == MFVideoFormat_RGB24) {
+ nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh << 2);
+ }
+ else if(subType == MFVideoFormat_NV12 || subType == MFVideoFormat_I420) {
+ nBufferSize = (m_structVideoParams.nWidth * m_structVideoParams.nHeigh * 3) >> 1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Video subType not supported");
+ CHECK_HR(hr = E_NOTIMPL);
+ }
+
+ // Allocate media buffer
+ SafeRelease(&m_pMediaBuffer);
+ CHECK_HR(hr = MFCreateMemoryBuffer(nBufferSize, &m_pMediaBuffer));
+ m_nBufferSize = nBufferSize;
+ {
+ //FIXME: DeliverSample() stops if no data
+ BYTE* pBuffer = NULL;
+ CHECK_HR(hr = m_pMediaBuffer->Lock(&pBuffer, NULL, NULL));
+ memset(pBuffer, 0, nBufferSize);
+ CHECK_HR(hr = m_pMediaBuffer->SetCurrentLength(nBufferSize));
+ CHECK_HR(hr = m_pMediaBuffer->Unlock());
+ }
+
+ // Retrieve video Frame rate
+ UINT32 unNumerator, unDenominator;
+ CHECK_HR(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &unNumerator, &unDenominator));
+ m_structVideoParams.nFps = (unNumerator / unDenominator);
+
+ // Retrieve sample duration based on framerate
+ m_rtCurrentPosition = 0;
+ CHECK_HR(hr = MFFrameRateToAverageTimePerFrame(m_structVideoParams.nFps, 1, &m_rtDuration));
+ }
+ else {
+ TSK_DEBUG_ERROR("Only video media type is supported");
+ CHECK_HR(hr = E_NOTIMPL);
+ }
bail:
- SafeRelease(&pMediaTypeHandler);
- SafeRelease(&pMediaType);
+ SafeRelease(&pMediaTypeHandler);
+ SafeRelease(&pMediaType);
- return hr;
+ return hr;
}
// NOTE: Some of these methods hold the stream's critical section
@@ -1436,29 +1321,27 @@ bail:
HRESULT CMFStreamSource::CreateSample(IMFSample **ppSample)
{
- *ppSample = NULL;
+ *ppSample = NULL;
HRESULT hr = S_OK;
IMFSample *pSample = NULL;
- DWORD nCurrentLength = 0;
-
- CHECK_HR(hr = m_pMediaBuffer->GetCurrentLength(&nCurrentLength));
-
- if(nCurrentLength > 0)
- {
- CHECK_HR(hr = MFCreateSample(&pSample));
- CHECK_HR(hr = pSample->SetSampleTime(m_rtCurrentPosition));
- CHECK_HR(hr = pSample->SetSampleDuration(m_rtDuration));
- m_rtCurrentPosition += m_rtDuration;
- CHECK_HR(hr = pSample->AddBuffer(m_pMediaBuffer));
-
- if((*ppSample = pSample))
- {
- (*ppSample)->AddRef();
- }
- }
-
+ DWORD nCurrentLength = 0;
+
+ CHECK_HR(hr = m_pMediaBuffer->GetCurrentLength(&nCurrentLength));
+
+ if(nCurrentLength > 0) {
+ CHECK_HR(hr = MFCreateSample(&pSample));
+ CHECK_HR(hr = pSample->SetSampleTime(m_rtCurrentPosition));
+ CHECK_HR(hr = pSample->SetSampleDuration(m_rtDuration));
+ m_rtCurrentPosition += m_rtDuration;
+ CHECK_HR(hr = pSample->AddBuffer(m_pMediaBuffer));
+
+ if((*ppSample = pSample)) {
+ (*ppSample)->AddRef();
+ }
+ }
+
bail:
SafeRelease(&pSample);
return hr;
@@ -1472,15 +1355,13 @@ HRESULT CMFStreamSource::DeliverSample(IMFSample *pSample)
{
HRESULT hr = S_OK;
- if(pSample)
- {
- // Send the MEMediaSample event with the new sample.
- hr = QueueEventWithIUnknown(this, MEMediaSample, hr, pSample);
- }
+ if(pSample) {
+ // Send the MEMediaSample event with the new sample.
+ hr = QueueEventWithIUnknown(this, MEMediaSample, hr, pSample);
+ }
// See if we reached the end of the stream.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = CheckEndOfStream(); // This method sends MEEndOfStream if needed.
}
@@ -1506,25 +1387,20 @@ HRESULT CMFStreamSource::DeliverQueuedSamples()
// If we already reached the end of the stream, send the MEEndStream
// event again.
- if (m_EOS)
- {
+ if (m_EOS) {
hr = QueueEvent(MEEndOfStream, GUID_NULL, S_OK, NULL);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Deliver any queued samples.
- while (!m_sampleQueue.IsEmpty())
- {
+ while (!m_sampleQueue.IsEmpty()) {
hr = m_sampleQueue.Dequeue(&pSample);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
break;
}
hr = DeliverSample(pSample);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
break;
}
@@ -1536,10 +1412,8 @@ HRESULT CMFStreamSource::DeliverQueuedSamples()
// If we reached the end of the stream, send the end-of-presentation event from
// the media source.
- if (SUCCEEDED(hr))
- {
- if (m_EOS)
- {
+ if (SUCCEEDED(hr)) {
+ if (m_EOS) {
hr = m_pSource->QueueEvent(MEEndOfPresentation, GUID_NULL, S_OK, NULL);
}
}
@@ -1578,8 +1452,7 @@ HRESULT CMFStreamSource::Shutdown()
Flush();
// Shut down the event queue.
- if (m_pEventQueue)
- {
+ if (m_pEventQueue) {
m_pEventQueue->Shutdown();
}
@@ -1602,37 +1475,37 @@ HRESULT CMFStreamSource::SetPosition(LONGLONG rtNewPosition)
{
EnterCriticalSection(&m_critSec);
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
-/*
- // Check if the requested position is beyond the end of the stream.
- LONGLONG duration = AudioDurationFromBufferSize(m_pRiff->Format(), m_pRiff->Chunk().DataSize());
+ /*
+ // Check if the requested position is beyond the end of the stream.
+ LONGLONG duration = AudioDurationFromBufferSize(m_pRiff->Format(), m_pRiff->Chunk().DataSize());
- if (rtNewPosition > duration)
- {
- LeaveCriticalSection(&m_critSec);
+ if (rtNewPosition > duration)
+ {
+ LeaveCriticalSection(&m_critSec);
- return MF_E_INVALIDREQUEST; // Start position is past the end of the presentation.
- }
+ return MF_E_INVALIDREQUEST; // Start position is past the end of the presentation.
+ }
- if (m_rtCurrentPosition != rtNewPosition)
- {
- LONGLONG offset = BufferSizeFromAudioDuration(m_pRiff->Format(), rtNewPosition);
+ if (m_rtCurrentPosition != rtNewPosition)
+ {
+ LONGLONG offset = BufferSizeFromAudioDuration(m_pRiff->Format(), rtNewPosition);
- // The chunk size is a DWORD. So if our calculations are correct, there is no
- // way that the maximum valid seek position can be larger than a DWORD.
- assert(offset <= MAXDWORD);
+ // The chunk size is a DWORD. So if our calculations are correct, there is no
+ // way that the maximum valid seek position can be larger than a DWORD.
+ assert(offset <= MAXDWORD);
- hr = m_pRiff->MoveToChunkOffset((DWORD)offset);
+ hr = m_pRiff->MoveToChunkOffset((DWORD)offset);
- if (SUCCEEDED(hr))
- {
- m_rtCurrentPosition = rtNewPosition;
- m_discontinuity = TRUE;
- m_EOS = FALSE;
+ if (SUCCEEDED(hr))
+ {
+ m_rtCurrentPosition = rtNewPosition;
+ m_discontinuity = TRUE;
+ m_EOS = FALSE;
+ }
}
- }
-*/
+ */
LeaveCriticalSection(&m_critSec);
return hr;
}
@@ -1640,18 +1513,18 @@ HRESULT CMFStreamSource::SetPosition(LONGLONG rtNewPosition)
HRESULT CMFStreamSource::CheckEndOfStream()
{
HRESULT hr = S_OK;
-/*
- if (m_pRiff->BytesRemainingInChunk() < m_pRiff->Format()->nBlockAlign)
- {
- // The remaining data is smaller than the audio block size. (In theory there shouldn't be
- // partial bits of data at the end, so we should reach an even zero bytes, but the file
- // might not be authored correctly.)
- m_EOS = TRUE;
-
- // Send the end-of-stream event,
- hr = QueueEvent(MEEndOfStream, GUID_NULL, S_OK, NULL);
- }
- */
+ /*
+ if (m_pRiff->BytesRemainingInChunk() < m_pRiff->Format()->nBlockAlign)
+ {
+ // The remaining data is smaller than the audio block size. (In theory there shouldn't be
+ // partial bits of data at the end, so we should reach an even zero bytes, but the file
+ // might not be authored correctly.)
+ m_EOS = TRUE;
+
+ // Send the end-of-stream event,
+ hr = QueueEvent(MEEndOfStream, GUID_NULL, S_OK, NULL);
+ }
+ */
return hr;
}
@@ -1697,8 +1570,7 @@ LONGLONG AudioDurationFromBufferSize(const WAVEFORMATEX *pWav, DWORD cbAudioData
{
assert(pWav != NULL);
- if (pWav->nAvgBytesPerSec == 0)
- {
+ if (pWav->nAvgBytesPerSec == 0) {
return 0;
}
return (LONGLONG)cbAudioDataSize * 10000000 / pWav->nAvgBytesPerSec;
@@ -1711,8 +1583,7 @@ LONGLONG BufferSizeFromAudioDuration(const WAVEFORMATEX *pWav, LONGLONG duration
ULONG ulRemainder = (ULONG)(cbSize % pWav->nBlockAlign);
// Round up to the next block.
- if(ulRemainder)
- {
+ if(ulRemainder) {
cbSize += pWav->nBlockAlign - ulRemainder;
}
diff --git a/plugins/pluginWinMF/internals/mf_custom_src.h b/plugins/pluginWinMF/internals/mf_custom_src.h
index f9194c9..15d8b90 100755
--- a/plugins/pluginWinMF/internals/mf_custom_src.h
+++ b/plugins/pluginWinMF/internals/mf_custom_src.h
@@ -1,20 +1,20 @@
-/*
+/*
* Copyright (C) Microsoft Corporation. All rights reserved.
* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -50,10 +50,10 @@ class CMFSource : public IMFMediaSource
public:
static HRESULT CreateInstance(REFIID iid, void **ppSource);
- static HRESULT CreateInstanceEx(REFIID iid, void **ppSource, IMFMediaType *pMediaType);
+ static HRESULT CreateInstanceEx(REFIID iid, void **ppSource, IMFMediaType *pMediaType);
- // IMFCustomSource
- HRESULT CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize);
+ // IMFCustomSource
+ HRESULT CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize);
// IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
@@ -80,8 +80,7 @@ public:
private:
- enum State
- {
+ enum State {
STATE_STOPPED,
STATE_PAUSED,
STATE_STARTED
@@ -92,14 +91,11 @@ private:
CMFSource(HRESULT &hr, IMFMediaType *pMediaType);
virtual ~CMFSource();
- HRESULT CheckShutdown() const
- {
- if (m_IsShutdown)
- {
+ HRESULT CheckShutdown() const {
+ if (m_IsShutdown) {
return MF_E_SHUTDOWN;
}
- else
- {
+ else {
return S_OK;
}
}
@@ -110,7 +106,9 @@ private:
HRESULT ValidatePresentationDescriptor(IMFPresentationDescriptor *pPD);
LONGLONG GetCurrentPosition() const;
- State GetState() const { return m_state; }
+ State GetState() const {
+ return m_state;
+ }
IMFMediaEventQueue *m_pEventQueue; // Event generator helper
IMFPresentationDescriptor *m_pPresentationDescriptor; // Default presentation
@@ -122,7 +120,7 @@ private:
BOOL m_IsShutdown; // Flag to indicate if Shutdown() method was called.
State m_state; // Current state (running, stopped, paused)
- IMFMediaType *m_pMediaType; // The supported mediaType
+ IMFMediaType *m_pMediaType; // The supported mediaType
};
@@ -131,22 +129,21 @@ class SampleQueue
protected:
// Nodes in the linked list
- struct Node
- {
+ struct Node {
Node *prev;
Node *next;
IMFSample* item;
- Node() : prev(NULL), next(NULL)
- {
+ Node() : prev(NULL), next(NULL) {
}
- Node(IMFSample* item) : prev(NULL), next(NULL)
- {
+ Node(IMFSample* item) : prev(NULL), next(NULL) {
this->item = item;
}
- IMFSample* Item() const { return item; }
+ IMFSample* Item() const {
+ return item;
+ }
};
@@ -155,27 +152,22 @@ protected:
public:
- SampleQueue()
- {
+ SampleQueue() {
m_anchor.next = &m_anchor;
m_anchor.prev = &m_anchor;
}
- virtual ~SampleQueue()
- {
+ virtual ~SampleQueue() {
Clear();
}
- HRESULT Queue(IMFSample* item)
- {
- if (item == NULL)
- {
+ HRESULT Queue(IMFSample* item) {
+ if (item == NULL) {
return E_POINTER;
}
Node *pNode = new (std::nothrow) Node(item);
- if (pNode == NULL)
- {
+ if (pNode == NULL) {
return E_OUTOFMEMORY;
}
@@ -195,14 +187,11 @@ public:
}
- HRESULT Dequeue(IMFSample* *ppItem)
- {
- if (IsEmpty())
- {
+ HRESULT Dequeue(IMFSample**ppItem) {
+ if (IsEmpty()) {
return E_FAIL;
}
- if (ppItem == NULL)
- {
+ if (ppItem == NULL) {
return E_POINTER;
}
@@ -220,17 +209,16 @@ public:
return S_OK;
}
- BOOL IsEmpty() const { return m_anchor.next == &m_anchor; }
+ BOOL IsEmpty() const {
+ return m_anchor.next == &m_anchor;
+ }
- void Clear()
- {
+ void Clear() {
Node *n = m_anchor.next;
// Delete the nodes
- while (n != &m_anchor)
- {
- if (n->item)
- {
+ while (n != &m_anchor) {
+ if (n->item) {
n->item->Release();
}
@@ -260,8 +248,8 @@ class CMFStreamSource : public IMFMediaStream
public:
- // IMFCustomSource
- HRESULT CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize);
+ // IMFCustomSource
+ HRESULT CopyVideoBuffer(UINT32 nWidth, UINT32 nHeight, const void* pBufferPtr, UINT32 nBufferSize);
// IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
@@ -285,26 +273,25 @@ private:
~CMFStreamSource();
- HRESULT CheckShutdown() const
- {
- if (m_IsShutdown)
- {
+ HRESULT CheckShutdown() const {
+ if (m_IsShutdown) {
return MF_E_SHUTDOWN;
}
- else
- {
+ else {
return S_OK;
}
}
- HRESULT InitializeParams();
+ HRESULT InitializeParams();
HRESULT Shutdown();
HRESULT CreateSample(IMFSample **pSample);
HRESULT DeliverSample(IMFSample *pSample);
HRESULT DeliverQueuedSamples();
HRESULT Flush();
- LONGLONG GetCurrentPosition() const { return m_rtCurrentPosition; }
+ LONGLONG GetCurrentPosition() const {
+ return m_rtCurrentPosition;
+ }
HRESULT SetPosition(LONGLONG rtNewPosition);
HRESULT CheckEndOfStream();
@@ -313,7 +300,7 @@ private:
CRITICAL_SECTION m_critSec;
BOOL m_IsShutdown; // Flag to indicate if source's Shutdown() method was called.
LONGLONG m_rtCurrentPosition; // Current position in the stream, in 100-ns units
- UINT64 m_rtDuration; // Sample duration, in 100-ns units
+ UINT64 m_rtDuration; // Sample duration, in 100-ns units
BOOL m_discontinuity; // Is the next sample a discontinuity?
BOOL m_EOS; // Did we reach the end of the stream?
@@ -322,18 +309,17 @@ private:
IMFStreamDescriptor *m_pStreamDescriptor; // Stream descriptor for this stream.
SampleQueue m_sampleQueue; // Queue for samples while paused.
- GUID m_guidMajorType; // major media type (e.g. MFMediaType_Video or MFMediaType_Audio)
- GUID m_guidSubType; // Media subtype (e.g. MFVideoFormat_RGB32 or MFVideoFormat_H264)
- IMFMediaBuffer *m_pMediaBuffer; // Pointer to the data to deliver
- UINT32 m_nBufferSize; // Size of the data to deliver
-
- struct
- {
- UINT32 nWidth;
- UINT32 nHeigh;
- UINT32 nFps;
- }
- m_structVideoParams;
+ GUID m_guidMajorType; // major media type (e.g. MFMediaType_Video or MFMediaType_Audio)
+ GUID m_guidSubType; // Media subtype (e.g. MFVideoFormat_RGB32 or MFVideoFormat_H264)
+ IMFMediaBuffer *m_pMediaBuffer; // Pointer to the data to deliver
+ UINT32 m_nBufferSize; // Size of the data to deliver
+
+ struct {
+ UINT32 nWidth;
+ UINT32 nHeigh;
+ UINT32 nFps;
+ }
+ m_structVideoParams;
};
diff --git a/plugins/pluginWinMF/internals/mf_devices.cxx b/plugins/pluginWinMF/internals/mf_devices.cxx
index 22b862e..49005de 100755
--- a/plugins/pluginWinMF/internals/mf_devices.cxx
+++ b/plugins/pluginWinMF/internals/mf_devices.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -20,25 +20,25 @@
#include "mf_utils.h"
DeviceList::DeviceList()
-: m_ppDevices(NULL)
-, m_cDevices(0)
+ : m_ppDevices(NULL)
+ , m_cDevices(0)
{
-
+
}
DeviceList::~DeviceList()
{
- Clear();
+ Clear();
}
UINT32 DeviceList::Count()const
{
- return m_cDevices;
+ return m_cDevices;
}
void DeviceList::Clear()
{
- for (UINT32 i = 0; i < m_cDevices; i++) {
+ for (UINT32 i = 0; i < m_cDevices; i++) {
SafeRelease(&m_ppDevices[i]);
}
CoTaskMemFree(m_ppDevices);
@@ -49,7 +49,7 @@ void DeviceList::Clear()
HRESULT DeviceList::EnumerateDevices(const GUID& sourceType)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
IMFAttributes *pAttributes = NULL;
Clear();
@@ -60,17 +60,15 @@ HRESULT DeviceList::EnumerateDevices(const GUID& sourceType)
hr = MFCreateAttributes(&pAttributes, 1);
// Ask for source type = video capture devices
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pAttributes->SetGUID(
- MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
- sourceType
- );
+ MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
+ sourceType
+ );
}
// Enumerate devices.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = MFEnumDeviceSources(pAttributes, &m_ppDevices, &m_cDevices);
}
@@ -81,8 +79,7 @@ HRESULT DeviceList::EnumerateDevices(const GUID& sourceType)
HRESULT DeviceList::GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate)
{
- if (index >= Count())
- {
+ if (index >= Count()) {
return E_INVALIDARG;
}
@@ -94,58 +91,52 @@ HRESULT DeviceList::GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate)
HRESULT DeviceList::GetDeviceBest(IMFActivate **ppActivate, WCHAR *pszName /*= NULL*/)
{
- UINT32 index = 0;
- if(pszName)
- {
- WCHAR *_pszName = NULL;
- BOOL bFound = FALSE;
- for(UINT32 i = 0; i < Count() && !bFound; ++i)
- {
- if((SUCCEEDED(GetDeviceName(i, &_pszName))))
- {
- if(wcscmp(_pszName, pszName) == 0)
- {
- index = i;
- bFound = TRUE;
- // do not break the loop because we need to free(_pszName)
- }
- }
- if(_pszName)
- {
- CoTaskMemFree(_pszName), _pszName = NULL;
- }
- }
- }
- return GetDeviceAtIndex(index, ppActivate);
+ UINT32 index = 0;
+ if(pszName) {
+ WCHAR *_pszName = NULL;
+ BOOL bFound = FALSE;
+ for(UINT32 i = 0; i < Count() && !bFound; ++i) {
+ if((SUCCEEDED(GetDeviceName(i, &_pszName)))) {
+ if(wcscmp(_pszName, pszName) == 0) {
+ index = i;
+ bFound = TRUE;
+ // do not break the loop because we need to free(_pszName)
+ }
+ }
+ if(_pszName) {
+ CoTaskMemFree(_pszName), _pszName = NULL;
+ }
+ }
+ }
+ return GetDeviceAtIndex(index, ppActivate);
}
// The caller must free the memory for the string by calling CoTaskMemFree
HRESULT DeviceList::GetDeviceName(UINT32 index, WCHAR **ppszName)
{
- if (index >= Count())
- {
+ if (index >= Count()) {
return E_INVALIDARG;
}
HRESULT hr = S_OK;
hr = m_ppDevices[index]->GetAllocatedString(
- MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
- ppszName,
- NULL
- );
+ MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
+ ppszName,
+ NULL
+ );
return hr;
}
HRESULT DeviceListAudio::EnumerateDevices()
{
- // call base class function
- return DeviceList::EnumerateDevices(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_GUID);
+ // call base class function
+ return DeviceList::EnumerateDevices(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_GUID);
}
HRESULT DeviceListVideo::EnumerateDevices()
{
- // call base class function
- return DeviceList::EnumerateDevices(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID);
+ // call base class function
+ return DeviceList::EnumerateDevices(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID);
}
diff --git a/plugins/pluginWinMF/internals/mf_devices.h b/plugins/pluginWinMF/internals/mf_devices.h
index 03d010f..3a16a29 100755
--- a/plugins/pluginWinMF/internals/mf_devices.h
+++ b/plugins/pluginWinMF/internals/mf_devices.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -46,19 +46,19 @@ public:
HRESULT GetDeviceName(UINT32 index, WCHAR **ppszName);
protected:
- HRESULT EnumerateDevices(const GUID& sourceType);
+ HRESULT EnumerateDevices(const GUID& sourceType);
};
class DeviceListAudio : public DeviceList
{
public:
- HRESULT EnumerateDevices();
+ HRESULT EnumerateDevices();
};
class DeviceListVideo : public DeviceList
{
public:
- HRESULT EnumerateDevices();
+ HRESULT EnumerateDevices();
};
#endif /* PLUGIN_WIN_MF_DEVICES_H */
diff --git a/plugins/pluginWinMF/internals/mf_display_watcher.cxx b/plugins/pluginWinMF/internals/mf_display_watcher.cxx
index 62dbc5f..38f3687 100755
--- a/plugins/pluginWinMF/internals/mf_display_watcher.cxx
+++ b/plugins/pluginWinMF/internals/mf_display_watcher.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,137 +24,126 @@
#include <assert.h>
DisplayWatcher::DisplayWatcher(HWND hWnd, IMFMediaSink* pMediaSink, HRESULT &hr)
-: m_pDisplayControl(NULL)
-, m_hWnd(hWnd)
-, m_pWndProc(NULL)
-, m_bStarted(FALSE)
-, m_bFullScreen(FALSE)
+ : m_pDisplayControl(NULL)
+ , m_hWnd(hWnd)
+ , m_pWndProc(NULL)
+ , m_bStarted(FALSE)
+ , m_bFullScreen(FALSE)
{
- IMFGetService *pService = NULL;
+ IMFGetService *pService = NULL;
- CHECK_HR(hr = pMediaSink->QueryInterface(__uuidof(IMFGetService), (void**)&pService));
- CHECK_HR(hr = pService->GetService(MR_VIDEO_RENDER_SERVICE, __uuidof(IMFVideoDisplayControl), (void**)&m_pDisplayControl));
- CHECK_HR(hr = m_pDisplayControl->SetAspectRatioMode(MFVideoARMode_PreservePicture));
+ CHECK_HR(hr = pMediaSink->QueryInterface(__uuidof(IMFGetService), (void**)&pService));
+ CHECK_HR(hr = pService->GetService(MR_VIDEO_RENDER_SERVICE, __uuidof(IMFVideoDisplayControl), (void**)&m_pDisplayControl));
+ CHECK_HR(hr = m_pDisplayControl->SetAspectRatioMode(MFVideoARMode_PreservePicture));
bail:
- SafeRelease(&pService);
+ SafeRelease(&pService);
}
DisplayWatcher::~DisplayWatcher()
{
- Stop();
+ Stop();
- SafeRelease(&m_pDisplayControl);
+ SafeRelease(&m_pDisplayControl);
}
HRESULT DisplayWatcher::Start()
{
- HRESULT hr = S_OK;
- HWND hWnd = m_hWnd; // save()
- CHECK_HR(hr = Stop());
-
- if((m_hWnd = hWnd) && m_pDisplayControl)
- {
- CHECK_HR(hr = m_pDisplayControl->SetVideoWindow(hWnd));
-
- BOOL ret = SetPropA(m_hWnd, "This", this);
- assert(ret);
-
+ HRESULT hr = S_OK;
+ HWND hWnd = m_hWnd; // save()
+ CHECK_HR(hr = Stop());
+
+ if((m_hWnd = hWnd) && m_pDisplayControl) {
+ CHECK_HR(hr = m_pDisplayControl->SetVideoWindow(hWnd));
+
+ BOOL ret = SetPropA(m_hWnd, "This", this);
+ assert(ret);
+
#if _M_X64
- m_pWndProc = (WNDPROC)SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)DisplayWatcher::WndProc);
+ m_pWndProc = (WNDPROC)SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)DisplayWatcher::WndProc);
#else
- m_pWndProc = (WNDPROC)SetWindowLongPtr(m_hWnd, GWL_WNDPROC, (LONG)DisplayWatcher::WndProc);
+ m_pWndProc = (WNDPROC)SetWindowLongPtr(m_hWnd, GWL_WNDPROC, (LONG)DisplayWatcher::WndProc);
#endif
- UpdatePosition(); // black screen if attached later
- }
- m_bStarted = TRUE;
+ UpdatePosition(); // black screen if attached later
+ }
+ m_bStarted = TRUE;
bail:
- return hr;
+ return hr;
}
HRESULT DisplayWatcher::SetFullscreen(BOOL bEnabled)
{
- if(m_pDisplayControl)
- {
- HRESULT hr = m_pDisplayControl->SetFullscreen(bEnabled);
- m_bFullScreen = SUCCEEDED(hr);
- return hr;
- }
-
- return E_FAIL;
+ if(m_pDisplayControl) {
+ HRESULT hr = m_pDisplayControl->SetFullscreen(bEnabled);
+ m_bFullScreen = SUCCEEDED(hr);
+ return hr;
+ }
+
+ return E_FAIL;
}
HRESULT DisplayWatcher::SetHwnd(HWND hWnd)
{
- BOOL bWasStarted = m_bStarted;
- Stop();
- m_hWnd = hWnd;
- if(bWasStarted)
- {
- return Start();
- }
- return S_OK;
+ BOOL bWasStarted = m_bStarted;
+ Stop();
+ m_hWnd = hWnd;
+ if(bWasStarted) {
+ return Start();
+ }
+ return S_OK;
}
HRESULT DisplayWatcher::Stop()
{
- if(m_hWnd && m_pWndProc)
- {
- // Restore
-
+ if(m_hWnd && m_pWndProc) {
+ // Restore
+
#if _M_X64
- SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)m_pWndProc);
+ SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)m_pWndProc);
#else
- SetWindowLongPtr(m_hWnd, GWL_WNDPROC, (LONG)m_pWndProc);
+ SetWindowLongPtr(m_hWnd, GWL_WNDPROC, (LONG)m_pWndProc);
#endif
- }
- m_hWnd = NULL;
- m_pWndProc = NULL;
- m_bStarted = FALSE;
- return S_OK;
+ }
+ m_hWnd = NULL;
+ m_pWndProc = NULL;
+ m_bStarted = FALSE;
+ return S_OK;
}
void DisplayWatcher::UpdatePosition()
{
- if(m_pDisplayControl && m_hWnd)
- {
- RECT rcDst = { 0, 0, 0, 0 };
- GetClientRect(m_hWnd, &rcDst);
- m_pDisplayControl->SetVideoPosition(NULL, &rcDst);
- }
+ if(m_pDisplayControl && m_hWnd) {
+ RECT rcDst = { 0, 0, 0, 0 };
+ GetClientRect(m_hWnd, &rcDst);
+ m_pDisplayControl->SetVideoPosition(NULL, &rcDst);
+ }
}
LRESULT CALLBACK DisplayWatcher::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_CREATE:
- case WM_SIZE:
- case WM_MOVE:
- {
- DisplayWatcher* This = dynamic_cast<DisplayWatcher*>((DisplayWatcher*)GetPropA(hWnd, "This"));
- if(This)
- {
- This->UpdatePosition();
- }
- break;
- }
-
- case WM_CHAR:
- case WM_KEYUP:
- {
- DisplayWatcher* This = dynamic_cast<DisplayWatcher*>((DisplayWatcher*)GetPropA(hWnd, "This"));
- if(This)
- {
- if(This->m_bFullScreen && (wParam == 0x1B || wParam == VK_ESCAPE))
- {
- This->SetFullscreen(FALSE);
- }
- }
-
- break;
- }
- }
-
- return DefWindowProc(hWnd, uMsg, wParam, lParam);
+ switch(uMsg) {
+ case WM_CREATE:
+ case WM_SIZE:
+ case WM_MOVE: {
+ DisplayWatcher* This = dynamic_cast<DisplayWatcher*>((DisplayWatcher*)GetPropA(hWnd, "This"));
+ if(This) {
+ This->UpdatePosition();
+ }
+ break;
+ }
+
+ case WM_CHAR:
+ case WM_KEYUP: {
+ DisplayWatcher* This = dynamic_cast<DisplayWatcher*>((DisplayWatcher*)GetPropA(hWnd, "This"));
+ if(This) {
+ if(This->m_bFullScreen && (wParam == 0x1B || wParam == VK_ESCAPE)) {
+ This->SetFullscreen(FALSE);
+ }
+ }
+
+ break;
+ }
+ }
+
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
} \ No newline at end of file
diff --git a/plugins/pluginWinMF/internals/mf_display_watcher.h b/plugins/pluginWinMF/internals/mf_display_watcher.h
index d41d6a6..127fb35 100755
--- a/plugins/pluginWinMF/internals/mf_display_watcher.h
+++ b/plugins/pluginWinMF/internals/mf_display_watcher.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,25 +31,25 @@
class DisplayWatcher
{
public:
- DisplayWatcher(HWND hWnd, IMFMediaSink* pMediaSink, HRESULT &hr);
- virtual ~DisplayWatcher();
+ DisplayWatcher(HWND hWnd, IMFMediaSink* pMediaSink, HRESULT &hr);
+ virtual ~DisplayWatcher();
public:
- HRESULT Start();
- HRESULT SetFullscreen(BOOL bEnabled);
- HRESULT SetHwnd(HWND hWnd);
- HRESULT Stop();
+ HRESULT Start();
+ HRESULT SetFullscreen(BOOL bEnabled);
+ HRESULT SetHwnd(HWND hWnd);
+ HRESULT Stop();
private:
- void UpdatePosition();
- static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ void UpdatePosition();
+ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
- IMFVideoDisplayControl *m_pDisplayControl;
- HWND m_hWnd;
- WNDPROC m_pWndProc;
- BOOL m_bStarted;
- BOOL m_bFullScreen;
+ IMFVideoDisplayControl *m_pDisplayControl;
+ HWND m_hWnd;
+ WNDPROC m_pWndProc;
+ BOOL m_bStarted;
+ BOOL m_bFullScreen;
};
#endif /* PLUGIN_WIN_MF_DISPLAY_WATCHER_H */
diff --git a/plugins/pluginWinMF/internals/mf_sample_grabber.cxx b/plugins/pluginWinMF/internals/mf_sample_grabber.cxx
index 87aa6af..8d148a3 100755
--- a/plugins/pluginWinMF/internals/mf_sample_grabber.cxx
+++ b/plugins/pluginWinMF/internals/mf_sample_grabber.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,108 +28,105 @@
// Create a new instance of the object.
HRESULT SampleGrabberCB::CreateInstance(const struct tmedia_producer_s* pcWrappedProducer, SampleGrabberCB **ppCB)
{
- assert(pcWrappedProducer);
+ assert(pcWrappedProducer);
- *ppCB = new (std::nothrow) SampleGrabberCB(pcWrappedProducer);
+ *ppCB = new (std::nothrow) SampleGrabberCB(pcWrappedProducer);
- if (ppCB == NULL)
- {
- return E_OUTOFMEMORY;
- }
- return S_OK;
+ if (ppCB == NULL) {
+ return E_OUTOFMEMORY;
+ }
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::QueryInterface(REFIID riid, void** ppv)
{
- static const QITAB qit[] =
- {
- QITABENT(SampleGrabberCB, IMFSampleGrabberSinkCallback),
- QITABENT(SampleGrabberCB, IMFClockStateSink),
- { 0 }
- };
- return QISearch(this, qit, riid, ppv);
+ static const QITAB qit[] = {
+ QITABENT(SampleGrabberCB, IMFSampleGrabberSinkCallback),
+ QITABENT(SampleGrabberCB, IMFClockStateSink),
+ { 0 }
+ };
+ return QISearch(this, qit, riid, ppv);
}
STDMETHODIMP_(ULONG) SampleGrabberCB::AddRef()
{
- return InterlockedIncrement(&m_cRef);
+ return InterlockedIncrement(&m_cRef);
}
STDMETHODIMP_(ULONG) SampleGrabberCB::Release()
{
- ULONG cRef = InterlockedDecrement(&m_cRef);
- if (cRef == 0)
- {
- delete this;
- }
- return cRef;
+ ULONG cRef = InterlockedDecrement(&m_cRef);
+ if (cRef == 0) {
+ delete this;
+ }
+ return cRef;
}
// IMFClockStateSink methods.
-// In these example, the IMFClockStateSink methods do not perform any actions.
+// In these example, the IMFClockStateSink methods do not perform any actions.
// You can use these methods to track the state of the sample grabber sink.
STDMETHODIMP SampleGrabberCB::OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnClockStart(%lld, %lld)", hnsSystemTime, llClockStartOffset);
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnClockStart(%lld, %lld)", hnsSystemTime, llClockStartOffset);
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnClockStop(MFTIME hnsSystemTime)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnClockStop(%lld)", hnsSystemTime);
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnClockStop(%lld)", hnsSystemTime);
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnClockPause(MFTIME hnsSystemTime)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnClockPause(%lld)", hnsSystemTime);
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnClockPause(%lld)", hnsSystemTime);
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnClockRestart(MFTIME hnsSystemTime)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnClockRestart(%lld)", hnsSystemTime);
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnClockRestart(%lld)", hnsSystemTime);
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnClockSetRate(MFTIME hnsSystemTime, float flRate)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnClockSetRate(%lld, %f)", hnsSystemTime, flRate);
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnClockSetRate(%lld, %f)", hnsSystemTime, flRate);
+ return S_OK;
}
// IMFSampleGrabberSink methods.
STDMETHODIMP SampleGrabberCB::OnSetPresentationClock(IMFPresentationClock* pClock)
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnSetPresentationClock");
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnSetPresentationClock");
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnProcessSample(
- REFGUID guidMajorMediaType, DWORD dwSampleFlags,
- LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
- DWORD dwSampleSize)
+ REFGUID guidMajorMediaType, DWORD dwSampleFlags,
+ LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
+ DWORD dwSampleSize)
{
- if (m_pWrappedProducer && TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback) {
+ if (m_pWrappedProducer && TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback) {
#if 1
- if (m_bMuted) {
- // Send zeros. Do not skip sending data to avoid NAT issues and session deconnection.
- // Some TelePresence systems disconnect the session when the remote peer stops sending video data.
- memset((void*)pSampleBuffer, 0, dwSampleSize);
- }
+ if (m_bMuted) {
+ // Send zeros. Do not skip sending data to avoid NAT issues and session deconnection.
+ // Some TelePresence systems disconnect the session when the remote peer stops sending video data.
+ memset((void*)pSampleBuffer, 0, dwSampleSize);
+ }
#endif
- TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback_data, pSampleBuffer, dwSampleSize);
- }
+ TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback_data, pSampleBuffer, dwSampleSize);
+ }
- return S_OK;
+ return S_OK;
}
STDMETHODIMP SampleGrabberCB::OnShutdown()
{
- TSK_DEBUG_INFO("SampleGrabberCB::OnShutdown");
- return S_OK;
+ TSK_DEBUG_INFO("SampleGrabberCB::OnShutdown");
+ return S_OK;
} \ No newline at end of file
diff --git a/plugins/pluginWinMF/internals/mf_sample_grabber.h b/plugins/pluginWinMF/internals/mf_sample_grabber.h
index 858f3c1..9ea239d 100755
--- a/plugins/pluginWinMF/internals/mf_sample_grabber.h
+++ b/plugins/pluginWinMF/internals/mf_sample_grabber.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,9 +31,9 @@
// Sample Grabber callback [Declaration]
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh184779(v=vs.85).aspx
//
-class SampleGrabberCB : public IMFSampleGrabberSinkCallback
+class SampleGrabberCB : public IMFSampleGrabberSinkCallback
{
- bool m_bMuted;
+ bool m_bMuted;
long m_cRef;
const struct tmedia_producer_s* m_pWrappedProducer;
@@ -42,7 +42,9 @@ class SampleGrabberCB : public IMFSampleGrabberSinkCallback
public:
static HRESULT CreateInstance(const struct tmedia_producer_s* pcWrappedProducer, SampleGrabberCB **ppCB);
- void SetMute(bool bMuted) { m_bMuted = bMuted; }
+ void SetMute(bool bMuted) {
+ m_bMuted = bMuted;
+ }
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
@@ -59,8 +61,8 @@ public:
// IMFSampleGrabberSinkCallback methods
STDMETHODIMP OnSetPresentationClock(IMFPresentationClock* pClock);
STDMETHODIMP OnProcessSample(REFGUID guidMajorMediaType, DWORD dwSampleFlags,
- LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
- DWORD dwSampleSize);
+ LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
+ DWORD dwSampleSize);
STDMETHODIMP OnShutdown();
};
diff --git a/plugins/pluginWinMF/internals/mf_sample_queue.cxx b/plugins/pluginWinMF/internals/mf_sample_queue.cxx
index 05c2bc6..32630b8 100755
--- a/plugins/pluginWinMF/internals/mf_sample_queue.cxx
+++ b/plugins/pluginWinMF/internals/mf_sample_queue.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -21,39 +21,38 @@
#include <assert.h>
MFSampleQueue::MFSampleQueue()
-: m_nRefCount(1)
-, m_nCount(0)
+ : m_nRefCount(1)
+ , m_nCount(0)
{
- InitializeCriticalSection(&m_critSec);
+ InitializeCriticalSection(&m_critSec);
- m_anchor.next = &m_anchor;
- m_anchor.prev = &m_anchor;
+ m_anchor.next = &m_anchor;
+ m_anchor.prev = &m_anchor;
}
MFSampleQueue::~MFSampleQueue()
{
- assert(m_nRefCount == 0);
+ assert(m_nRefCount == 0);
- Clear();
+ Clear();
- DeleteCriticalSection(&m_critSec);
+ DeleteCriticalSection(&m_critSec);
}
STDMETHODIMP MFSampleQueue::QueryInterface(REFIID iid, void** ppv)
{
- return E_NOTIMPL;
+ return E_NOTIMPL;
}
STDMETHODIMP_(ULONG) MFSampleQueue::AddRef()
{
- return InterlockedIncrement(&m_nRefCount);
+ return InterlockedIncrement(&m_nRefCount);
}
STDMETHODIMP_(ULONG) MFSampleQueue::Release()
{
- ULONG uCount = InterlockedDecrement(&m_nRefCount);
- if (uCount == 0)
- {
+ ULONG uCount = InterlockedDecrement(&m_nRefCount);
+ if (uCount == 0) {
delete this;
}
// For thread safety, return a temporary variable.
@@ -62,20 +61,18 @@ STDMETHODIMP_(ULONG) MFSampleQueue::Release()
HRESULT MFSampleQueue::Queue(IMFSample* item)
{
- if (item == NULL)
- {
+ if (item == NULL) {
return E_POINTER;
}
Node *pNode = new (std::nothrow) Node(item);
- if (pNode == NULL)
- {
+ if (pNode == NULL) {
return E_OUTOFMEMORY;
}
item->AddRef();
- EnterCriticalSection(&m_critSec);
+ EnterCriticalSection(&m_critSec);
Node *pBefore = m_anchor.prev;
@@ -87,25 +84,23 @@ HRESULT MFSampleQueue::Queue(IMFSample* item)
pNode->prev = pBefore;
pNode->next = pAfter;
- m_nCount++;
+ m_nCount++;
- LeaveCriticalSection(&m_critSec);
+ LeaveCriticalSection(&m_critSec);
return S_OK;
}
-HRESULT MFSampleQueue::Dequeue(IMFSample* *ppItem)
+HRESULT MFSampleQueue::Dequeue(IMFSample**ppItem)
{
- if (ppItem == NULL)
- {
+ if (ppItem == NULL) {
return E_POINTER;
}
- EnterCriticalSection(&m_critSec);
+ EnterCriticalSection(&m_critSec);
- if (IsEmpty())
- {
- LeaveCriticalSection(&m_critSec);
+ if (IsEmpty()) {
+ LeaveCriticalSection(&m_critSec);
return E_FAIL;
}
@@ -120,24 +115,22 @@ HRESULT MFSampleQueue::Dequeue(IMFSample* *ppItem)
*ppItem = pNode->item;
delete pNode;
- m_nCount--;
+ m_nCount--;
- LeaveCriticalSection(&m_critSec);
+ LeaveCriticalSection(&m_critSec);
return S_OK;
}
HRESULT MFSampleQueue::Clear()
{
- EnterCriticalSection(&m_critSec);
+ EnterCriticalSection(&m_critSec);
- Node *n = m_anchor.next;
+ Node *n = m_anchor.next;
// Delete the nodes
- while (n != &m_anchor)
- {
- if (n->item)
- {
+ while (n != &m_anchor) {
+ if (n->item) {
n->item->Release();
}
@@ -150,9 +143,9 @@ HRESULT MFSampleQueue::Clear()
m_anchor.next = &m_anchor;
m_anchor.prev = &m_anchor;
- m_nCount = 0;
+ m_nCount = 0;
- LeaveCriticalSection(&m_critSec);
+ LeaveCriticalSection(&m_critSec);
- return S_OK;
+ return S_OK;
}
diff --git a/plugins/pluginWinMF/internals/mf_sample_queue.h b/plugins/pluginWinMF/internals/mf_sample_queue.h
index b42ecde..b110a06 100755
--- a/plugins/pluginWinMF/internals/mf_sample_queue.h
+++ b/plugins/pluginWinMF/internals/mf_sample_queue.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -32,49 +32,52 @@ class MFSampleQueue : public IUnknown
protected:
// Nodes in the linked list
- struct Node
- {
+ struct Node {
Node *prev;
Node *next;
IMFSample* item;
- Node() : prev(NULL), next(NULL)
- {
+ Node() : prev(NULL), next(NULL) {
}
- Node(IMFSample* item) : prev(NULL), next(NULL)
- {
+ Node(IMFSample* item) : prev(NULL), next(NULL) {
this->item = item;
}
- IMFSample* Item() const { return item; }
+ IMFSample* Item() const {
+ return item;
+ }
};
protected:
Node m_anchor;
- long m_nCount;
- CRITICAL_SECTION m_critSec;
+ long m_nCount;
+ CRITICAL_SECTION m_critSec;
private:
- long m_nRefCount;
+ long m_nRefCount;
public:
MFSampleQueue();
virtual ~MFSampleQueue();
- // IUnknown
+ // IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
HRESULT Queue(IMFSample* item);
- HRESULT Dequeue(IMFSample* *ppItem);
+ HRESULT Dequeue(IMFSample**ppItem);
HRESULT Clear();
- inline BOOL IsEmpty() const { return m_anchor.next == &m_anchor; }
- inline long Count() { return m_nCount; }
+ inline BOOL IsEmpty() const {
+ return m_anchor.next == &m_anchor;
+ }
+ inline long Count() {
+ return m_nCount;
+ }
};
diff --git a/plugins/pluginWinMF/internals/mf_utils.cxx b/plugins/pluginWinMF/internals/mf_utils.cxx
index d1f326c..bcb63f1 100755
--- a/plugins/pluginWinMF/internals/mf_utils.cxx
+++ b/plugins/pluginWinMF/internals/mf_utils.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -74,35 +74,34 @@ const TOPOID MFUtils::g_ullTopoIdSource = 333;
const TOPOID MFUtils::g_ullTopoIdVideoProcessor = 444;
// Preferred VideoSubTypes
-static const VideoSubTypeGuidPair PreferredVideoSubTypeGuidPairs[] =
-{
- { tmedia_chroma_yuv420p, MFVideoFormat_I420 },
- { tmedia_chroma_nv12, MFVideoFormat_NV12 },
- { tmedia_chroma_uyvy422, MFVideoFormat_UYVY },
- { tmedia_chroma_yuyv422, MFVideoFormat_YUY2 },
- /* TODO: Add more YUV formats */
- { tmedia_chroma_rgb565le, MFVideoFormat_RGB565 },
- { tmedia_chroma_bgr24, MFVideoFormat_RGB24 },
- { tmedia_chroma_rgb32, MFVideoFormat_RGB32 },
+static const VideoSubTypeGuidPair PreferredVideoSubTypeGuidPairs[] = {
+ { tmedia_chroma_yuv420p, MFVideoFormat_I420 },
+ { tmedia_chroma_nv12, MFVideoFormat_NV12 },
+ { tmedia_chroma_uyvy422, MFVideoFormat_UYVY },
+ { tmedia_chroma_yuyv422, MFVideoFormat_YUY2 },
+ /* TODO: Add more YUV formats */
+ { tmedia_chroma_rgb565le, MFVideoFormat_RGB565 },
+ { tmedia_chroma_bgr24, MFVideoFormat_RGB24 },
+ { tmedia_chroma_rgb32, MFVideoFormat_RGB32 },
};
static const tsk_size_t PreferredVideoSubTypeGuidPairsCount = sizeof(PreferredVideoSubTypeGuidPairs)/sizeof(PreferredVideoSubTypeGuidPairs[0]);
// Video Processor
-DEFINE_GUID(CLSID_VideoProcessorMFT,
- 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);
+DEFINE_GUID(CLSID_VideoProcessorMFT,
+ 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);
// {4BE8D3C0-0515-4A37-AD55-E4BAE19AF471}
DEFINE_GUID(CLSID_MF_INTEL_H264EncFilter, // Intel Quick Sync Encoder
-0x4be8d3c0, 0x0515, 0x4a37, 0xad, 0x55, 0xe4, 0xba, 0xe1, 0x9a, 0xf4, 0x71);
+ 0x4be8d3c0, 0x0515, 0x4a37, 0xad, 0x55, 0xe4, 0xba, 0xe1, 0x9a, 0xf4, 0x71);
// {0855C9AC-BC6F-4371-8954-671CCD4EC16F}
DEFINE_GUID(CLSID_MF_INTEL_H264DecFilter, // Intel Quick Sync Decoder
-0x0855c9ac, 0xbc6f, 0x4371, 0x89, 0x54, 0x67, 0x1c, 0xcd, 0x4e, 0xc1, 0x6f);
+ 0x0855c9ac, 0xbc6f, 0x4371, 0x89, 0x54, 0x67, 0x1c, 0xcd, 0x4e, 0xc1, 0x6f);
#if WINVER < 0x0602/* From "sdkddkver.h" and defines the SDK version not the host */
// 6ca50344-051a-4ded-9779-a43305165e35
DEFINE_GUID(CLSID_CMSH264EncoderMFT, // MS H.264 encoder
-0x6ca50344, 0x051a, 0x4ded, 0x97, 0x79, 0xa4, 0x33, 0x05, 0x16, 0x5e, 0x35);
+ 0x6ca50344, 0x051a, 0x4ded, 0x97, 0x79, 0xa4, 0x33, 0x05, 0x16, 0x5e, 0x35);
#endif /* WINVER */
#define IsWin7_OrLater(dwMajorVersion, dwMinorVersion) ( (dwMajorVersion > 6) || ( (dwMajorVersion == 6) && (dwMinorVersion >= 1) ) )
@@ -111,249 +110,231 @@ DEFINE_GUID(CLSID_CMSH264EncoderMFT, // MS H.264 encoder
HRESULT MFUtils::Startup()
{
- if(!g_bStarted)
- {
- HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
- if(SUCCEEDED(hr) || hr == 0x80010106) // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
- {
- hr = MFStartup(MF_VERSION);
- }
- g_bStarted = SUCCEEDED(hr);
-
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- g_dwMajorVersion = osvi.dwMajorVersion;
- g_dwMinorVersion = osvi.dwMinorVersion;
-
- return hr;
- }
- return S_OK;
+ if(!g_bStarted) {
+ HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if(SUCCEEDED(hr) || hr == 0x80010106) { // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
+ hr = MFStartup(MF_VERSION);
+ }
+ g_bStarted = SUCCEEDED(hr);
+
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ g_dwMajorVersion = osvi.dwMajorVersion;
+ g_dwMinorVersion = osvi.dwMinorVersion;
+
+ return hr;
+ }
+ return S_OK;
}
HRESULT MFUtils::Shutdown()
{
- if(g_bStarted)
- {
- g_bStarted = false;
- return S_OK;
- }
- return S_OK;
+ if(g_bStarted) {
+ g_bStarted = false;
+ return S_OK;
+ }
+ return S_OK;
}
BOOL MFUtils::IsD3D9Supported()
{
- if (MFUtils::g_bD3D9Checked)
- {
- return MFUtils::g_bD3D9Supported;
- }
- MFUtils::g_bD3D9Checked = TRUE;
- HRESULT hr = S_OK;
- IDirect3D9* pD3D = NULL;
- D3DDISPLAYMODE mode = { 0 };
- D3DPRESENT_PARAMETERS pp = {0};
- IDirect3DDevice9* pDevice = NULL;
-
- CHECK_HR(hr = MFUtils::Startup());
-
- if (!(pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
- {
+ if (MFUtils::g_bD3D9Checked) {
+ return MFUtils::g_bD3D9Supported;
+ }
+ MFUtils::g_bD3D9Checked = TRUE;
+ HRESULT hr = S_OK;
+ IDirect3D9* pD3D = NULL;
+ D3DDISPLAYMODE mode = { 0 };
+ D3DPRESENT_PARAMETERS pp = {0};
+ IDirect3DDevice9* pDevice = NULL;
+
+ CHECK_HR(hr = MFUtils::Startup());
+
+ if (!(pD3D = Direct3DCreate9(D3D_SDK_VERSION))) {
CHECK_HR(hr = E_OUTOFMEMORY);
}
hr = pD3D->GetAdapterDisplayMode(
- D3DADAPTER_DEFAULT,
- &mode
- );
- if (FAILED(hr))
- {
- goto bail;
- }
+ D3DADAPTER_DEFAULT,
+ &mode
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
hr = pD3D->CheckDeviceType(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- mode.Format,
- D3DFMT_X8R8G8B8,
- TRUE // windowed
- );
- if (FAILED(hr))
- {
- goto bail;
- }
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ mode.Format,
+ D3DFMT_X8R8G8B8,
+ TRUE // windowed
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
pp.BackBufferFormat = D3DFMT_X8R8G8B8;
pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- pp.Windowed = TRUE;
- pp.hDeviceWindow = GetDesktopWindow();
+ pp.Windowed = TRUE;
+ pp.hDeviceWindow = GetDesktopWindow();
hr = pD3D->CreateDevice(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- pp.hDeviceWindow,
- D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &pp,
- &pDevice
- );
- if (FAILED(hr))
- {
- goto bail;
- }
-
- // Everythings is OK
- MFUtils::g_bD3D9Supported = TRUE;
- TSK_DEBUG_INFO("D3D9 supported");
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ pp.hDeviceWindow,
+ D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &pp,
+ &pDevice
+ );
+ if (FAILED(hr)) {
+ goto bail;
+ }
+
+ // Everythings is OK
+ MFUtils::g_bD3D9Supported = TRUE;
+ TSK_DEBUG_INFO("D3D9 supported");
bail:
- if (!MFUtils::g_bD3D9Supported) {
- TSK_DEBUG_WARN("D3D9 not supported");
- }
- SafeRelease(&pDevice);
- SafeRelease(&pD3D);
- return MFUtils::g_bD3D9Supported;
+ if (!MFUtils::g_bD3D9Supported) {
+ TSK_DEBUG_WARN("D3D9 not supported");
+ }
+ SafeRelease(&pDevice);
+ SafeRelease(&pD3D);
+ return MFUtils::g_bD3D9Supported;
}
BOOL MFUtils::IsLowLatencyH264Supported()
{
- if(MFUtils::g_bLowLatencyH264Checked)
- {
- return MFUtils::g_bLowLatencyH264Supported;
- }
+ if(MFUtils::g_bLowLatencyH264Checked) {
+ return MFUtils::g_bLowLatencyH264Supported;
+ }
#if PLUGIN_MF_DISABLE_CODECS
- MFUtils::g_bLowLatencyH264Checked = TRUE;
- MFUtils::g_bLowLatencyH264Supported = FALSE;
+ MFUtils::g_bLowLatencyH264Checked = TRUE;
+ MFUtils::g_bLowLatencyH264Supported = FALSE;
#else
- Startup();
-
- HRESULT hr = S_OK;
- IMFTransform *pEncoderMFT = NULL;
- IMFTransform *pDecoderMFT = NULL;
- MFCodecVideoH264* pEncoderCodec = NULL;
- MFCodecVideoH264* pDecoderCodec = NULL;
-
- static const BOOL IsEncoderYes = TRUE;
-
- // Encoder
- hr = MFUtils::GetBestCodec(IsEncoderYes, MFMediaType_Video, MFVideoFormat_NV12, MFVideoFormat_H264, &pEncoderMFT);
- if(FAILED(hr))
- {
- TSK_DEBUG_INFO("No low latency H.264 encoder");
- goto bail;
- }
-
- // Decoder
- hr = MFUtils::GetBestCodec(!IsEncoderYes, MFMediaType_Video, MFVideoFormat_H264, MFVideoFormat_NV12, &pDecoderMFT);
- if(FAILED(hr))
- {
- TSK_DEBUG_INFO("No low latency H.264 decoder");
- goto bail;
- }
-
- // Make sure both encoder and decoder are working well. Check encoding/decoding 1080p@30 would work.
-
- TSK_DEBUG_INFO("Probing H.264 MFT encoder...");
- pEncoderCodec = MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder, pEncoderMFT);
- if(!pEncoderCodec)
- {
- CHECK_HR(hr = E_FAIL);
- }
- CHECK_HR(hr = pEncoderCodec->Initialize(
- 30, // FPS
- 1920, // WIDTH
- 1080, // HEIGHT
- tmedia_get_video_bandwidth_kbps_2(1920, 1080, 30) * 1024) // BITRATE
- );
- CHECK_HR(pEncoderCodec->IsSetSliceMaxSizeInBytesSupported(MFUtils::g_bLowLatencyH264SupportsMaxSliceSize));
-
- TSK_DEBUG_INFO("Probing H.264 MFT decoder...");
- pDecoderCodec = MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder, pDecoderMFT);
- if(!pDecoderCodec)
- {
- CHECK_HR(hr = E_FAIL);
- }
- CHECK_HR(hr = pDecoderCodec->Initialize(
- 30, // FPS
- 1920, // WIDTH
- 1080 // HEIGHT
- ));
+ Startup();
+
+ HRESULT hr = S_OK;
+ IMFTransform *pEncoderMFT = NULL;
+ IMFTransform *pDecoderMFT = NULL;
+ MFCodecVideoH264* pEncoderCodec = NULL;
+ MFCodecVideoH264* pDecoderCodec = NULL;
+
+ static const BOOL IsEncoderYes = TRUE;
+
+ // Encoder
+ hr = MFUtils::GetBestCodec(IsEncoderYes, MFMediaType_Video, MFVideoFormat_NV12, MFVideoFormat_H264, &pEncoderMFT);
+ if(FAILED(hr)) {
+ TSK_DEBUG_INFO("No low latency H.264 encoder");
+ goto bail;
+ }
+
+ // Decoder
+ hr = MFUtils::GetBestCodec(!IsEncoderYes, MFMediaType_Video, MFVideoFormat_H264, MFVideoFormat_NV12, &pDecoderMFT);
+ if(FAILED(hr)) {
+ TSK_DEBUG_INFO("No low latency H.264 decoder");
+ goto bail;
+ }
+
+ // Make sure both encoder and decoder are working well. Check encoding/decoding 1080p@30 would work.
+
+ TSK_DEBUG_INFO("Probing H.264 MFT encoder...");
+ pEncoderCodec = MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder, pEncoderMFT);
+ if(!pEncoderCodec) {
+ CHECK_HR(hr = E_FAIL);
+ }
+ CHECK_HR(hr = pEncoderCodec->Initialize(
+ 30, // FPS
+ 1920, // WIDTH
+ 1080, // HEIGHT
+ tmedia_get_video_bandwidth_kbps_2(1920, 1080, 30) * 1024) // BITRATE
+ );
+ CHECK_HR(pEncoderCodec->IsSetSliceMaxSizeInBytesSupported(MFUtils::g_bLowLatencyH264SupportsMaxSliceSize));
+
+ TSK_DEBUG_INFO("Probing H.264 MFT decoder...");
+ pDecoderCodec = MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder, pDecoderMFT);
+ if(!pDecoderCodec) {
+ CHECK_HR(hr = E_FAIL);
+ }
+ CHECK_HR(hr = pDecoderCodec->Initialize(
+ 30, // FPS
+ 1920, // WIDTH
+ 1080 // HEIGHT
+ ));
bail:
- MFUtils::g_bLowLatencyH264Checked = TRUE;
- MFUtils::g_bLowLatencyH264Supported = SUCCEEDED(hr) ? TRUE : FALSE;
- SafeRelease(&pEncoderMFT);
- SafeRelease(&pEncoderCodec);
- SafeRelease(&pDecoderMFT);
- SafeRelease(&pDecoderCodec);
+ MFUtils::g_bLowLatencyH264Checked = TRUE;
+ MFUtils::g_bLowLatencyH264Supported = SUCCEEDED(hr) ? TRUE : FALSE;
+ SafeRelease(&pEncoderMFT);
+ SafeRelease(&pEncoderCodec);
+ SafeRelease(&pDecoderMFT);
+ SafeRelease(&pDecoderCodec);
#endif /* PLUGIN_MF_DISABLE_CODECS */
- return MFUtils::g_bLowLatencyH264Supported;
+ return MFUtils::g_bLowLatencyH264Supported;
}
BOOL MFUtils::IsLowLatencyH264SupportsMaxSliceSize()
{
- return MFUtils::IsLowLatencyH264Supported() && MFUtils::g_bLowLatencyH264SupportsMaxSliceSize;
+ return MFUtils::IsLowLatencyH264Supported() && MFUtils::g_bLowLatencyH264SupportsMaxSliceSize;
}
HRESULT MFUtils::IsAsyncMFT(
- IMFTransform *pMFT, // The MFT to check
- BOOL* pbIsAsync // Whether the MFT is Async
- )
+ IMFTransform *pMFT, // The MFT to check
+ BOOL* pbIsAsync // Whether the MFT is Async
+)
{
- if(!pbIsAsync || !pMFT)
- {
- return E_POINTER;
- }
+ if(!pbIsAsync || !pMFT) {
+ return E_POINTER;
+ }
- IMFAttributes *pAttributes = NULL;
- UINT32 nIsAsync = 0;
- HRESULT hr = S_OK;
+ IMFAttributes *pAttributes = NULL;
+ UINT32 nIsAsync = 0;
+ HRESULT hr = S_OK;
hr = pMFT->GetAttributes(&pAttributes);
- if(SUCCEEDED(hr))
- {
- hr = pAttributes->GetUINT32(MF_TRANSFORM_ASYNC, &nIsAsync);
- }
-
- // Never fails: just say not Async
- CHECK_HR(hr = S_OK);
+ if(SUCCEEDED(hr)) {
+ hr = pAttributes->GetUINT32(MF_TRANSFORM_ASYNC, &nIsAsync);
+ }
+
+ // Never fails: just say not Async
+ CHECK_HR(hr = S_OK);
- *pbIsAsync = !!nIsAsync;
+ *pbIsAsync = !!nIsAsync;
bail:
- return hr;
+ return hr;
}
HRESULT MFUtils::UnlockAsyncMFT(
- IMFTransform *pMFT // The MFT to unlock
- )
+ IMFTransform *pMFT // The MFT to unlock
+)
{
- IMFAttributes *pAttributes = NULL;
- UINT32 nValue = 0;
- HRESULT hr = S_OK;
+ IMFAttributes *pAttributes = NULL;
+ UINT32 nValue = 0;
+ HRESULT hr = S_OK;
hr = pMFT->GetAttributes(&pAttributes);
- if(FAILED(hr))
- {
- hr = S_OK;
- goto bail;
- }
-
- hr = pAttributes->GetUINT32(MF_TRANSFORM_ASYNC, &nValue);
- if(FAILED(hr))
- {
- hr = S_OK;
- goto bail;
- }
-
- if(nValue == TRUE)
- {
- CHECK_HR(hr = pAttributes->SetUINT32(MF_TRANSFORM_ASYNC_UNLOCK, TRUE));
- }
-
+ if(FAILED(hr)) {
+ hr = S_OK;
+ goto bail;
+ }
+
+ hr = pAttributes->GetUINT32(MF_TRANSFORM_ASYNC, &nValue);
+ if(FAILED(hr)) {
+ hr = S_OK;
+ goto bail;
+ }
+
+ if(nValue == TRUE) {
+ CHECK_HR(hr = pAttributes->SetUINT32(MF_TRANSFORM_ASYNC_UNLOCK, TRUE));
+ }
+
bail:
- SafeRelease(&pAttributes);
- return hr;
+ SafeRelease(&pAttributes);
+ return hr;
}
//-------------------------------------------------------------------
// CreatePCMAudioType
@@ -367,7 +348,7 @@ HRESULT MFUtils::CreatePCMAudioType(
UINT32 bitsPerSample, // Bits per sample
UINT32 cChannels, // Number of channels
IMFMediaType **ppType // Receives a pointer to the media type.
- )
+)
{
HRESULT hr = S_OK;
@@ -381,48 +362,39 @@ HRESULT MFUtils::CreatePCMAudioType(
hr = MFCreateMediaType(&pType);
// Set attributes on the type.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, cChannels);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, sampleRate);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, blockAlign);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, bytesPerSecond);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, bitsPerSample);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
// Return the type to the caller.
*ppType = pType;
(*ppType)->AddRef();
@@ -440,13 +412,13 @@ HRESULT MFUtils::CreatePCMAudioType(
// format.
//-------------------------------------------------------------------
HRESULT MFUtils::CreateVideoType(
- const GUID* subType, // video subType
- IMFMediaType **ppType, // Receives a pointer to the media type.
- UINT32 unWidth, // Video width (0 to ignore)
- UINT32 unHeight // Video height (0 to ignore)
- )
+ const GUID* subType, // video subType
+ IMFMediaType **ppType, // Receives a pointer to the media type.
+ UINT32 unWidth, // Video width (0 to ignore)
+ UINT32 unHeight // Video height (0 to ignore)
+)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
IMFMediaType *pType = NULL;
@@ -456,17 +428,16 @@ HRESULT MFUtils::CreateVideoType(
CHECK_HR(hr = pType->SetGUID(MF_MT_SUBTYPE, *subType));
- CHECK_HR(hr = pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE)); // UnCompressed
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE)); // UnCompressed
- CHECK_HR(hr = pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE)); // UnCompressed
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE)); // UnCompressed
- CHECK_HR(hr = pType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+ CHECK_HR(hr = pType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+
+ if(unWidth > 0 && unHeight > 0) {
+ CHECK_HR(hr = MFSetAttributeSize(pType, MF_MT_FRAME_SIZE, unWidth, unHeight));
+ }
- if(unWidth > 0 && unHeight > 0)
- {
- CHECK_HR(hr = MFSetAttributeSize(pType, MF_MT_FRAME_SIZE, unWidth, unHeight));
- }
-
*ppType = pType;
(*ppType)->AddRef();
@@ -481,7 +452,7 @@ bail:
//-------------------------------------------------------------------
HRESULT MFUtils::ValidateVideoFormat(IMFMediaType *pmt)
{
- GUID major_type = GUID_NULL;
+ GUID major_type = GUID_NULL;
GUID subtype = GUID_NULL;
MFVideoInterlaceMode interlace = MFVideoInterlace_Unknown;
UINT32 val = 0;
@@ -492,8 +463,7 @@ HRESULT MFUtils::ValidateVideoFormat(IMFMediaType *pmt)
// Major type must be video.
CHECK_HR(hr = pmt->GetGUID(MF_MT_MAJOR_TYPE, &major_type));
- if (major_type != MFMediaType_Video)
- {
+ if (major_type != MFMediaType_Video) {
CHECK_HR(hr = MF_E_INVALIDMEDIATYPE);
}
@@ -504,24 +474,20 @@ HRESULT MFUtils::ValidateVideoFormat(IMFMediaType *pmt)
#if 0
// Look for the subtype in our list of accepted types.
- for (DWORD i = 0; i < g_NumVideoSubtypes; i++)
- {
- if (subtype == *g_VideoSubtypes[i])
- {
+ for (DWORD i = 0; i < g_NumVideoSubtypes; i++) {
+ if (subtype == *g_VideoSubtypes[i]) {
bFoundMatchingSubtype = TRUE;
break;
}
}
- if (!bFoundMatchingSubtype)
- {
+ if (!bFoundMatchingSubtype) {
CHECK_HR(hr = MF_E_INVALIDMEDIATYPE);
}
#endif
// Video must be progressive frames.
CHECK_HR(hr = pmt->GetUINT32(MF_MT_INTERLACE_MODE, (UINT32*)&interlace));
- if (interlace != MFVideoInterlace_Progressive)
- {
+ if (interlace != MFVideoInterlace_Progressive) {
CHECK_HR(hr = MF_E_INVALIDMEDIATYPE);
}
@@ -533,9 +499,9 @@ HRESULT MFUtils::ConvertVideoTypeToUncompressedType(
IMFMediaType *pType, // Pointer to an encoded video type.
const GUID& subtype, // Uncompressed subtype (eg, RGB-32, AYUV)
IMFMediaType **ppType // Receives a matching uncompressed video type.
- )
+)
{
- IMFMediaType *pTypeUncomp = NULL;
+ IMFMediaType *pTypeUncomp = NULL;
HRESULT hr = S_OK;
GUID majortype = { 0 };
@@ -543,59 +509,51 @@ HRESULT MFUtils::ConvertVideoTypeToUncompressedType(
hr = pType->GetMajorType(&majortype);
- if (majortype != MFMediaType_Video)
- {
+ if (majortype != MFMediaType_Video) {
return MF_E_INVALIDMEDIATYPE;
}
// Create a new media type and copy over all of the items.
// This ensures that extended color information is retained.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = MFCreateMediaType(&pTypeUncomp);
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pType->CopyAllItems(pTypeUncomp);
}
// Set the subtype.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pTypeUncomp->SetGUID(MF_MT_SUBTYPE, subtype);
}
// Uncompressed means all samples are independent.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pTypeUncomp->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
}
// Fix up PAR if not set on the original type.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = MFGetAttributeRatio(
- pTypeUncomp,
- MF_MT_PIXEL_ASPECT_RATIO,
- (UINT32*)&par.Numerator,
- (UINT32*)&par.Denominator
- );
+ pTypeUncomp,
+ MF_MT_PIXEL_ASPECT_RATIO,
+ (UINT32*)&par.Numerator,
+ (UINT32*)&par.Denominator
+ );
// Default to square pixels.
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
hr = MFSetAttributeRatio(
- pTypeUncomp,
- MF_MT_PIXEL_ASPECT_RATIO,
- 1, 1
- );
+ pTypeUncomp,
+ MF_MT_PIXEL_ASPECT_RATIO,
+ 1, 1
+ );
}
}
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
*ppType = pTypeUncomp;
(*ppType)->AddRef();
}
@@ -605,21 +563,21 @@ HRESULT MFUtils::ConvertVideoTypeToUncompressedType(
}
HRESULT MFUtils::CreateMediaSample(
- DWORD cbData, // Maximum buffer size
- IMFSample **ppSample // Receives the sample
+ DWORD cbData, // Maximum buffer size
+ IMFSample **ppSample // Receives the sample
)
{
- assert(ppSample);
+ assert(ppSample);
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
IMFSample *pSample = NULL;
IMFMediaBuffer *pBuffer = NULL;
- CHECK_HR(hr = MFCreateSample(&pSample));
- CHECK_HR(hr = MFCreateMemoryBuffer(cbData, &pBuffer));
+ CHECK_HR(hr = MFCreateSample(&pSample));
+ CHECK_HR(hr = MFCreateMemoryBuffer(cbData, &pBuffer));
CHECK_HR(hr = pSample->AddBuffer(pBuffer));
-
+
*ppSample = pSample;
(*ppSample)->AddRef();
@@ -631,222 +589,198 @@ bail:
// Gets the best encoder and decoder. Up to the caller to release the returned pointer
HRESULT MFUtils::GetBestCodec(
- BOOL bEncoder, // Whether we request an encoder or not (TRUE=encoder, FALSE=decoder)
- const GUID& mediaType, // The MediaType
- const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_NV12)
- const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_H264)
- IMFTransform **ppMFT // Receives the decoder/encoder transform
- )
+ BOOL bEncoder, // Whether we request an encoder or not (TRUE=encoder, FALSE=decoder)
+ const GUID& mediaType, // The MediaType
+ const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_NV12)
+ const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_H264)
+ IMFTransform **ppMFT // Receives the decoder/encoder transform
+)
{
- assert(ppMFT);
- assert(mediaType == MFMediaType_Video || mediaType == MFMediaType_Audio); // only audio and video codecs are support for now
-
- *ppMFT = NULL;
-
- HRESULT hr = S_OK;
-
- if(outputFormat == MFVideoFormat_H264 || inputFormat == MFVideoFormat_H264)
- {
- if(bEncoder)
- {
- // Force using Intel Quick Sync Encoder
- hr = CoCreateInstance(CLSID_MF_INTEL_H264EncFilter, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(ppMFT));
- if(SUCCEEDED(hr) && *ppMFT)
- {
- TSK_DEBUG_INFO("Using Intel Quick Sync encoder :)");
- return hr;
- }
- TSK_DEBUG_INFO("Not using Intel Quick Sync encoder :(");
- }
- else
- {
+ assert(ppMFT);
+ assert(mediaType == MFMediaType_Video || mediaType == MFMediaType_Audio); // only audio and video codecs are support for now
+
+ *ppMFT = NULL;
+
+ HRESULT hr = S_OK;
+
+ if(outputFormat == MFVideoFormat_H264 || inputFormat == MFVideoFormat_H264) {
+ if(bEncoder) {
+ // Force using Intel Quick Sync Encoder
+ hr = CoCreateInstance(CLSID_MF_INTEL_H264EncFilter, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(ppMFT));
+ if(SUCCEEDED(hr) && *ppMFT) {
+ TSK_DEBUG_INFO("Using Intel Quick Sync encoder :)");
+ return hr;
+ }
+ TSK_DEBUG_INFO("Not using Intel Quick Sync encoder :(");
+ }
+ else {
#if !PLUGIN_MF_DISABLE_ASYNC_DECODERS // Intel Quick Sync decoder is asynchronous
- // Force using Intel Quick Sync Decoder
- hr = CoCreateInstance(CLSID_MF_INTEL_H264DecFilter, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(ppMFT));
+ // Force using Intel Quick Sync Decoder
+ hr = CoCreateInstance(CLSID_MF_INTEL_H264DecFilter, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(ppMFT));
#endif
- if(SUCCEEDED(hr) && *ppMFT)
- {
- TSK_DEBUG_INFO("Using Intel Quick Sync decoder :)");
- return hr;
- }
- TSK_DEBUG_INFO("Not using Intel Quick Sync decoder :(");
- }
- }
-
- UINT32 count = 0;
- BOOL bAsync = FALSE;
- GUID guidActivateCLSID = GUID_NULL;
-
- IMFActivate **ppActivate = NULL;
-
- MFT_REGISTER_TYPE_INFO infoInput = { mediaType, inputFormat };
- MFT_REGISTER_TYPE_INFO infoOutput = { mediaType, outputFormat };
-
- UINT32 unFlags = MFT_ENUM_FLAG_HARDWARE |
- MFT_ENUM_FLAG_SYNCMFT |
- MFT_ENUM_FLAG_ASYNCMFT |
- MFT_ENUM_FLAG_LOCALMFT |
- MFT_ENUM_FLAG_TRANSCODE_ONLY | // Otherwise Intel Quick Sync will not be listed
- MFT_ENUM_FLAG_SORTANDFILTER;
-
- hr = MFTEnumEx(
- (mediaType == MFMediaType_Video) ? (bEncoder ? MFT_CATEGORY_VIDEO_ENCODER : MFT_CATEGORY_VIDEO_DECODER) : (bEncoder ? MFT_CATEGORY_AUDIO_ENCODER : MFT_CATEGORY_AUDIO_DECODER),
- unFlags,
- (inputFormat == GUID_NULL) ? NULL : &infoInput, // Input type
- (outputFormat == GUID_NULL) ? NULL : &infoOutput, // Output type
- &ppActivate,
- &count
- );
-
- for(UINT32 i = 0; i < count; ++i)
- {
- SafeRelease(ppMFT);
- hr = ppActivate[i]->GetGUID(MFT_TRANSFORM_CLSID_Attribute, &guidActivateCLSID);
- if(FAILED(hr))
- {
- continue;
- }
-
- if(bEncoder)
- {
- // Encoder
- if(guidActivateCLSID == CLSID_CMSH264EncoderMFT) // MS H.264 encoder ?
- {
- if(PLUGIN_MF_DISABLE_MS_H264_ENCODER)
- {
- // Microsoft H.264 encoder is disabled
- TSK_DEBUG_INFO("MS H.264 encoder is disabled...skipping");
- continue;
- }
- if(!IsWin8_OrLater(g_dwMajorVersion, g_dwMinorVersion))
- {
- // Microsoft H.264 encoder doesn't support low latency on Win7.
- TSK_DEBUG_INFO("MS H.264 encoder doesn't support low delay on (%ld, %ld)...skipping", g_dwMajorVersion, g_dwMinorVersion);
- continue;
- }
- }
- }
- else
- {
- // Decoder
- if(guidActivateCLSID == CLSID_CMSH264DecoderMFT) // MS H.264 decoder ?
- {
- if(!IsWin8_OrLater(g_dwMajorVersion, g_dwMinorVersion))
- {
- // Microsoft H.264 decoder doesn't support low latency on Win7.
- TSK_DEBUG_INFO("MS H.264 decoder doesn't support low delay on (%ld, %ld)...skipping", g_dwMajorVersion, g_dwMinorVersion);
- continue;
- }
- }
- }
-
- hr = ppActivate[i]->ActivateObject(IID_PPV_ARGS(ppMFT));
- if(SUCCEEDED(hr) && *ppMFT) // For now we just get the first one. FIXME: Give HW encoders/decoders higher priority.
- {
- if(bEncoder)
- {
- // Encoder
-
- }
- else
- {
- // Decoder
+ if(SUCCEEDED(hr) && *ppMFT) {
+ TSK_DEBUG_INFO("Using Intel Quick Sync decoder :)");
+ return hr;
+ }
+ TSK_DEBUG_INFO("Not using Intel Quick Sync decoder :(");
+ }
+ }
+
+ UINT32 count = 0;
+ BOOL bAsync = FALSE;
+ GUID guidActivateCLSID = GUID_NULL;
+
+ IMFActivate **ppActivate = NULL;
+
+ MFT_REGISTER_TYPE_INFO infoInput = { mediaType, inputFormat };
+ MFT_REGISTER_TYPE_INFO infoOutput = { mediaType, outputFormat };
+
+ UINT32 unFlags = MFT_ENUM_FLAG_HARDWARE |
+ MFT_ENUM_FLAG_SYNCMFT |
+ MFT_ENUM_FLAG_ASYNCMFT |
+ MFT_ENUM_FLAG_LOCALMFT |
+ MFT_ENUM_FLAG_TRANSCODE_ONLY | // Otherwise Intel Quick Sync will not be listed
+ MFT_ENUM_FLAG_SORTANDFILTER;
+
+ hr = MFTEnumEx(
+ (mediaType == MFMediaType_Video) ? (bEncoder ? MFT_CATEGORY_VIDEO_ENCODER : MFT_CATEGORY_VIDEO_DECODER) : (bEncoder ? MFT_CATEGORY_AUDIO_ENCODER : MFT_CATEGORY_AUDIO_DECODER),
+ unFlags,
+ (inputFormat == GUID_NULL) ? NULL : &infoInput, // Input type
+ (outputFormat == GUID_NULL) ? NULL : &infoOutput, // Output type
+ &ppActivate,
+ &count
+ );
+
+ for(UINT32 i = 0; i < count; ++i) {
+ SafeRelease(ppMFT);
+ hr = ppActivate[i]->GetGUID(MFT_TRANSFORM_CLSID_Attribute, &guidActivateCLSID);
+ if(FAILED(hr)) {
+ continue;
+ }
+
+ if(bEncoder) {
+ // Encoder
+ if(guidActivateCLSID == CLSID_CMSH264EncoderMFT) { // MS H.264 encoder ?
+ if(PLUGIN_MF_DISABLE_MS_H264_ENCODER) {
+ // Microsoft H.264 encoder is disabled
+ TSK_DEBUG_INFO("MS H.264 encoder is disabled...skipping");
+ continue;
+ }
+ if(!IsWin8_OrLater(g_dwMajorVersion, g_dwMinorVersion)) {
+ // Microsoft H.264 encoder doesn't support low latency on Win7.
+ TSK_DEBUG_INFO("MS H.264 encoder doesn't support low delay on (%ld, %ld)...skipping", g_dwMajorVersion, g_dwMinorVersion);
+ continue;
+ }
+ }
+ }
+ else {
+ // Decoder
+ if(guidActivateCLSID == CLSID_CMSH264DecoderMFT) { // MS H.264 decoder ?
+ if(!IsWin8_OrLater(g_dwMajorVersion, g_dwMinorVersion)) {
+ // Microsoft H.264 decoder doesn't support low latency on Win7.
+ TSK_DEBUG_INFO("MS H.264 decoder doesn't support low delay on (%ld, %ld)...skipping", g_dwMajorVersion, g_dwMinorVersion);
+ continue;
+ }
+ }
+ }
+
+ hr = ppActivate[i]->ActivateObject(IID_PPV_ARGS(ppMFT));
+ if(SUCCEEDED(hr) && *ppMFT) { // For now we just get the first one. FIXME: Give HW encoders/decoders higher priority.
+ if(bEncoder) {
+ // Encoder
+
+ }
+ else {
+ // Decoder
#if PLUGIN_MF_DISABLE_ASYNC_DECODERS
- hr = IsAsyncMFT(*ppMFT, &bAsync);
- if(bAsync)
- {
- TSK_DEBUG_INFO("Skipping async decoder because not supported yet");
- continue; // Async decoders not supported yet
- }
+ hr = IsAsyncMFT(*ppMFT, &bAsync);
+ if(bAsync) {
+ TSK_DEBUG_INFO("Skipping async decoder because not supported yet");
+ continue; // Async decoders not supported yet
+ }
#endif
- }
- break;
- }
- }
-
- for (UINT32 i = 0; i < count; i++)
- {
- ppActivate[i]->Release();
- }
- CoTaskMemFree(ppActivate);
-
- return *ppMFT ? S_OK : MF_E_NOT_FOUND;
+ }
+ break;
+ }
+ }
+
+ for (UINT32 i = 0; i < count; i++) {
+ ppActivate[i]->Release();
+ }
+ CoTaskMemFree(ppActivate);
+
+ return *ppMFT ? S_OK : MF_E_NOT_FOUND;
}
HRESULT MFUtils::IsVideoProcessorSupported(BOOL *pbSupported)
{
- HRESULT hr = S_OK;
- IMFTransform *pTransform = NULL;
-
- if(!pbSupported)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pTransform));
- *pbSupported = SUCCEEDED(hr);
- if(FAILED(hr))
- {
- hr = S_OK; // not an error
- }
+ HRESULT hr = S_OK;
+ IMFTransform *pTransform = NULL;
+
+ if(!pbSupported) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pTransform));
+ *pbSupported = SUCCEEDED(hr);
+ if(FAILED(hr)) {
+ hr = S_OK; // not an error
+ }
bail:
- SafeRelease(&pTransform);
- return hr;
+ SafeRelease(&pTransform);
+ return hr;
}
HRESULT MFUtils::GetBestVideoProcessor(
- const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_I420)
- const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_NV12)
- IMFTransform **ppProcessor // Receives the video processor
- )
+ const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_I420)
+ const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_NV12)
+ IMFTransform **ppProcessor // Receives the video processor
+)
{
- assert(ppProcessor);
-
- *ppProcessor = NULL;
-
- HRESULT hr = S_OK;
- UINT32 count = 0;
-
- IMFActivate **ppActivate = NULL;
-
- MFT_REGISTER_TYPE_INFO infoInput = { MFMediaType_Video, inputFormat };
- MFT_REGISTER_TYPE_INFO infoOutput = { MFMediaType_Video, outputFormat };
-
- UINT32 unFlags = MFT_ENUM_FLAG_HARDWARE |
- MFT_ENUM_FLAG_SYNCMFT |
- MFT_ENUM_FLAG_LOCALMFT |
- MFT_ENUM_FLAG_SORTANDFILTER;
-
- hr = MFTEnumEx(
- MFT_CATEGORY_VIDEO_PROCESSOR,
- unFlags,
- &infoInput, // Input type
- &infoOutput, // Output type
- &ppActivate,
- &count
- );
-
- for(UINT32 i = 0; i < count; ++i)
- {
- hr = ppActivate[i]->ActivateObject(IID_PPV_ARGS(ppProcessor));
- if(SUCCEEDED(hr) && *ppProcessor)
- {
- break;
- }
- SafeRelease(ppProcessor);
- }
-
- for (UINT32 i = 0; i < count; i++)
- {
- ppActivate[i]->Release();
- }
- CoTaskMemFree(ppActivate);
-
- return *ppProcessor ? S_OK : MF_E_NOT_FOUND;
+ assert(ppProcessor);
+
+ *ppProcessor = NULL;
+
+ HRESULT hr = S_OK;
+ UINT32 count = 0;
+
+ IMFActivate **ppActivate = NULL;
+
+ MFT_REGISTER_TYPE_INFO infoInput = { MFMediaType_Video, inputFormat };
+ MFT_REGISTER_TYPE_INFO infoOutput = { MFMediaType_Video, outputFormat };
+
+ UINT32 unFlags = MFT_ENUM_FLAG_HARDWARE |
+ MFT_ENUM_FLAG_SYNCMFT |
+ MFT_ENUM_FLAG_LOCALMFT |
+ MFT_ENUM_FLAG_SORTANDFILTER;
+
+ hr = MFTEnumEx(
+ MFT_CATEGORY_VIDEO_PROCESSOR,
+ unFlags,
+ &infoInput, // Input type
+ &infoOutput, // Output type
+ &ppActivate,
+ &count
+ );
+
+ for(UINT32 i = 0; i < count; ++i) {
+ hr = ppActivate[i]->ActivateObject(IID_PPV_ARGS(ppProcessor));
+ if(SUCCEEDED(hr) && *ppProcessor) {
+ break;
+ }
+ SafeRelease(ppProcessor);
+ }
+
+ for (UINT32 i = 0; i < count; i++) {
+ ppActivate[i]->Release();
+ }
+ CoTaskMemFree(ppActivate);
+
+ return *ppProcessor ? S_OK : MF_E_NOT_FOUND;
}
// Add an transform node to a topology.
@@ -855,26 +789,26 @@ HRESULT MFUtils::AddTransformNode(
IMFTransform *pMFT, // MFT.
DWORD dwId, // Identifier of the stream sink.
IMFTopologyNode **ppNode // Receives the node pointer.
- )
+)
{
- *ppNode = NULL;
+ *ppNode = NULL;
IMFTopologyNode *pNode = NULL;
- HRESULT hr = S_OK;
-
+ HRESULT hr = S_OK;
+
// Create the node.
CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_TRANSFORM_NODE, &pNode));
// Set the object pointer.
CHECK_HR(hr = pNode->SetObject(pMFT));
- CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_STREAMID, dwId));
- CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE));
+ CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_STREAMID, dwId));
+ CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE));
// Add the node to the topology.
CHECK_HR(hr = pTopology->AddNode(pNode));
// Return the pointer to the caller.
*ppNode = pNode;
(*ppNode)->AddRef();
-
+
bail:
SafeRelease(&pNode);
return hr;
@@ -882,13 +816,13 @@ bail:
// Sets the IMFStreamSink pointer on an output node.
HRESULT MFUtils::BindOutputNode(
- IMFTopologyNode *pNode // The Node
- )
+ IMFTopologyNode *pNode // The Node
+)
{
- assert(pNode);
+ assert(pNode);
- HRESULT hr = S_OK;
- IUnknown *pNodeObject = NULL;
+ HRESULT hr = S_OK;
+ IUnknown *pNodeObject = NULL;
IMFActivate *pActivate = NULL;
IMFStreamSink *pStream = NULL;
IMFMediaSink *pSink = NULL;
@@ -905,44 +839,38 @@ HRESULT MFUtils::BindOutputNode(
// First, check if it's an activation object.
CHECK_HR(hr = pNodeObject->QueryInterface(IID_PPV_ARGS(&pActivate)));
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
DWORD dwStreamID = 0;
- // The object pointer is an activation object.
-
+ // The object pointer is an activation object.
+
// Try to create the media sink.
hr = pActivate->ActivateObject(IID_PPV_ARGS(&pSink));
// Look up the stream ID. (Default to zero.)
- if (SUCCEEDED(hr))
- {
- dwStreamID = MFGetAttributeUINT32(pNode, MF_TOPONODE_STREAMID, 0);
+ if (SUCCEEDED(hr)) {
+ dwStreamID = MFGetAttributeUINT32(pNode, MF_TOPONODE_STREAMID, 0);
}
// Now try to get or create the stream sink.
// Check if the media sink already has a stream sink with the requested ID.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pSink->GetStreamSinkById(dwStreamID, &pStream);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
// Try to add a new stream sink.
hr = pSink->AddStreamSink(dwStreamID, NULL, &pStream);
}
}
- // Replace the node's object pointer with the stream sink.
- if (SUCCEEDED(hr))
- {
+ // Replace the node's object pointer with the stream sink.
+ if (SUCCEEDED(hr)) {
hr = pNode->SetObject(pStream);
}
}
- else
- {
+ else {
// Not an activation object. Is it a stream sink?
hr = pNodeObject->QueryInterface(IID_PPV_ARGS(&pStream));
}
@@ -957,54 +885,54 @@ bail:
// Add an output node to a topology.
HRESULT MFUtils::AddOutputNode(
- IMFTopology *pTopology, // Topology.
- IMFActivate *pActivate, // Media sink activation object.
- DWORD dwId, // Identifier of the stream sink.
- IMFTopologyNode **ppNode) // Receives the node pointer
+ IMFTopology *pTopology, // Topology.
+ IMFActivate *pActivate, // Media sink activation object.
+ DWORD dwId, // Identifier of the stream sink.
+ IMFTopologyNode **ppNode) // Receives the node pointer
{
- IMFTopologyNode *pNode = NULL;
+ IMFTopologyNode *pNode = NULL;
- HRESULT hr = S_OK;
- CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &pNode));
- CHECK_HR(hr = pNode->SetObject(pActivate));
- CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_STREAMID, dwId));
- CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE));
- CHECK_HR(hr = pTopology->AddNode(pNode));
+ HRESULT hr = S_OK;
+ CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &pNode));
+ CHECK_HR(hr = pNode->SetObject(pActivate));
+ CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_STREAMID, dwId));
+ CHECK_HR(hr = pNode->SetUINT32(MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE));
+ CHECK_HR(hr = pTopology->AddNode(pNode));
- // Return the pointer to the caller.
- *ppNode = pNode;
- (*ppNode)->AddRef();
+ // Return the pointer to the caller.
+ *ppNode = pNode;
+ (*ppNode)->AddRef();
bail:
- SafeRelease(&pNode);
- return hr;
+ SafeRelease(&pNode);
+ return hr;
}
// Add a source node to a topology
HRESULT MFUtils::AddSourceNode(
- IMFTopology *pTopology, // Topology.
- IMFMediaSource *pSource, // Media source.
- IMFPresentationDescriptor *pPD, // Presentation descriptor.
- IMFStreamDescriptor *pSD, // Stream descriptor.
- IMFTopologyNode **ppNode // Receives the node pointer.
- )
+ IMFTopology *pTopology, // Topology.
+ IMFMediaSource *pSource, // Media source.
+ IMFPresentationDescriptor *pPD, // Presentation descriptor.
+ IMFStreamDescriptor *pSD, // Stream descriptor.
+ IMFTopologyNode **ppNode // Receives the node pointer.
+)
{
- IMFTopologyNode *pNode = NULL;
+ IMFTopologyNode *pNode = NULL;
- HRESULT hr = S_OK;
- CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &pNode));
- CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_SOURCE, pSource));
- CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_PRESENTATION_DESCRIPTOR, pPD));
- CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_STREAM_DESCRIPTOR, pSD));
- CHECK_HR(hr = pTopology->AddNode(pNode));
+ HRESULT hr = S_OK;
+ CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &pNode));
+ CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_SOURCE, pSource));
+ CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_PRESENTATION_DESCRIPTOR, pPD));
+ CHECK_HR(hr = pNode->SetUnknown(MF_TOPONODE_STREAM_DESCRIPTOR, pSD));
+ CHECK_HR(hr = pTopology->AddNode(pNode));
- // Return the pointer to the caller.
- *ppNode = pNode;
- (*ppNode)->AddRef();
+ // Return the pointer to the caller.
+ *ppNode = pNode;
+ (*ppNode)->AddRef();
bail:
- SafeRelease(&pNode);
- return hr;
+ SafeRelease(&pNode);
+ return hr;
}
// Create the topology
@@ -1013,386 +941,345 @@ bail:
// \-> (SinkPreview)
//
HRESULT MFUtils::CreateTopology(
- IMFMediaSource *pSource, // Media source
- IMFTransform *pTransform, // Transform filter (e.g. encoder or decoder) to insert between the source and Sink. NULL is valid.
- IMFActivate *pSinkActivateMain, // Main sink (e.g. sample grabber or EVR).
- IMFActivate *pSinkActivatePreview, // Preview sink. Optional. Could be NULL.
- IMFMediaType *pIputTypeMain, // Main sink input MediaType
- IMFTopology **ppTopo // Receives the newly created topology
- )
+ IMFMediaSource *pSource, // Media source
+ IMFTransform *pTransform, // Transform filter (e.g. encoder or decoder) to insert between the source and Sink. NULL is valid.
+ IMFActivate *pSinkActivateMain, // Main sink (e.g. sample grabber or EVR).
+ IMFActivate *pSinkActivatePreview, // Preview sink. Optional. Could be NULL.
+ IMFMediaType *pIputTypeMain, // Main sink input MediaType
+ IMFTopology **ppTopo // Receives the newly created topology
+)
{
- IMFTopology *pTopology = NULL;
- IMFPresentationDescriptor *pPD = NULL;
- IMFStreamDescriptor *pSD = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
- IMFTopologyNode *pNodeSource = NULL;
- IMFTopologyNode *pNodeSinkMain = NULL;
- IMFTopologyNode *pNodeSinkPreview = NULL;
- IMFTopologyNode *pNodeTransform = NULL;
- IMFTopologyNode *pNodeTee = NULL;
- IMFMediaType *pMediaType = NULL;
+ IMFTopology *pTopology = NULL;
+ IMFPresentationDescriptor *pPD = NULL;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+ IMFTopologyNode *pNodeSource = NULL;
+ IMFTopologyNode *pNodeSinkMain = NULL;
+ IMFTopologyNode *pNodeSinkPreview = NULL;
+ IMFTopologyNode *pNodeTransform = NULL;
+ IMFTopologyNode *pNodeTee = NULL;
+ IMFMediaType *pMediaType = NULL;
IMFTransform *pVideoProcessor = NULL;
IMFTopologyNode *pNodeVideoProcessor = NULL;
- IMFTransform *pConvFrameRate = NULL;
- IMFTransform *pConvSize = NULL;
- IMFTransform *pConvColor = NULL;
- IMFTopologyNode *pNodeConvFrameRate = NULL;
- IMFTopologyNode *pNodeConvSize = NULL;
- IMFTopologyNode *pNodeConvColor = NULL;
- IMFMediaType *pTransformInputType = NULL;
- IMFMediaType *pSinkMainInputType = NULL;
- const IMFTopologyNode *pcNodeBeforeSinkMain = NULL;
-
- HRESULT hr = S_OK;
- DWORD cStreams = 0;
- BOOL bSourceFound = FALSE;
- BOOL bSupportedSize = FALSE;
- BOOL bSupportedFps = FALSE;
- BOOL bSupportedFormat = FALSE;
- BOOL bVideoProcessorSupported = FALSE;
- GUID inputMajorType, inputSubType;
-
- CHECK_HR(hr = IsVideoProcessorSupported(&bVideoProcessorSupported));
- CHECK_HR(hr = pIputTypeMain->GetMajorType(&inputMajorType));
-
- CHECK_HR(hr = MFCreateTopology(&pTopology));
- CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
- CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
-
- for (DWORD i = 0; i < cStreams; i++)
- {
- BOOL fSelected = FALSE;
- GUID majorType;
-
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
- CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
- CHECK_HR(hr = pHandler->GetMajorType(&majorType));
-
- if (majorType == inputMajorType && fSelected)
- {
- CHECK_HR(hr = AddSourceNode(pTopology, pSource, pPD, pSD, &pNodeSource));
- CHECK_HR(hr = pNodeSource->SetTopoNodeID(MFUtils::g_ullTopoIdSource));
- CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivateMain, 0, &pNodeSinkMain));
- CHECK_HR(hr = pNodeSinkMain->SetTopoNodeID(MFUtils::g_ullTopoIdSinkMain));
- CHECK_HR(hr = MFUtils::BindOutputNode(pNodeSinkMain)); // To avoid MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED
-
- //
- // Create preview
- //
-
- if(pSinkActivatePreview)
- {
- CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivatePreview, 0, &pNodeSinkPreview));
- CHECK_HR(hr = pNodeSinkPreview->SetTopoNodeID(MFUtils::g_ullTopoIdSinkPreview));
- CHECK_HR(hr = MFUtils::BindOutputNode(pNodeSinkPreview));
-
- CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &pNodeTee));
- CHECK_HR(hr = pTopology->AddNode(pNodeTee));
- }
-
- //
- // Create converters
- //
-
- if(majorType == MFMediaType_Video)
- {
- // Even when size matches the topology could add a resizer which doesn't keep ratio when resizing while video processor does.
- if(!bVideoProcessorSupported)
- {
- hr = IsSupported(
- pPD,
- i,
- pIputTypeMain,
- &bSupportedSize,
- &bSupportedFps,
- &bSupportedFormat);
- }
-
- CHECK_HR(hr = pIputTypeMain->GetGUID(MF_MT_SUBTYPE, &inputSubType));
-
- if(!bSupportedSize || !bSupportedFps || !bSupportedFormat)
- {
- // Use video processor single MFT or 3 different MFTs
- if(!pVideoProcessor)
- {
- hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pVideoProcessor));
- }
- if(!pVideoProcessor)
- {
- // Video Resizer DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx) supports I420 only
- if(!bSupportedSize && !pConvSize && inputSubType == MFVideoFormat_I420)
- {
- hr = CoCreateInstance(CLSID_CResizerDMO, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvSize));
- }
- // Frame Rate Converter DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819100(v=vs.85).aspx) supports neither NV12 nor I420
- /*if(!bSupportedFps && !pConvFrameRate)
- {
- hr = CoCreateInstance(CLSID_CFrameRateConvertDmo, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvFrameRate));
- }*/
- // Color Converter DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819079(v=vs.85).aspx) supports both NV12 and I420
- if(!bSupportedFormat && !pConvColor)
- {
- hr = CoCreateInstance(CLSID_CColorConvertDMO, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvColor));
- }
- }
- }
- else
- {
- // MediaType supported
- CHECK_HR(hr = pHandler->SetCurrentMediaType(pIputTypeMain));
- }
-
- if(pVideoProcessor && !pNodeVideoProcessor)
- {
- CHECK_HR(hr = AddTransformNode(pTopology, pVideoProcessor, 0, &pNodeVideoProcessor));
- CHECK_HR(hr = pNodeVideoProcessor->SetTopoNodeID(MFUtils::g_ullTopoIdVideoProcessor));
- }
- if(pConvColor && !pNodeConvColor)
- {
- CHECK_HR(hr = AddTransformNode(pTopology, pConvColor, 0, &pNodeConvColor));
- }
- if(pConvFrameRate && !pNodeConvFrameRate)
- {
- CHECK_HR(hr = AddTransformNode(pTopology, pConvFrameRate, 0, &pNodeConvFrameRate));
- }
- if(pConvSize && !pNodeConvSize)
- {
- CHECK_HR(hr = AddTransformNode(pTopology, pConvSize, 0, &pNodeConvSize));
- }
- } // if(majorType == MFMediaType_Video)
-
-
- //
- // Set media type
- //
-
- if(pTransform)
- {
- CHECK_HR(hr = AddTransformNode(pTopology, pTransform, 0, &pNodeTransform));
- hr = pTransform->GetInputCurrentType(0, &pTransformInputType);
- if(FAILED(hr))
- {
- pTransformInputType = pIputTypeMain;
- pTransformInputType->AddRef();
- hr = S_OK;
- }
- if(pVideoProcessor)
- {
- CHECK_HR(hr = pVideoProcessor->SetOutputType(0, pTransformInputType, 0));
- }
- else
- {
- if(pConvColor)
- {
- /*CHECK_HR*/(hr = pConvColor->SetOutputType(0, pTransformInputType, 0));
- }
- if(pConvFrameRate)
- {
- /*CHECK_HR*/(hr = pConvFrameRate->SetOutputType(0, pTransformInputType, 0));
- }
- if(pConvSize)
- {
- // Transform requires NV12
- //Video Resizer DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx) doesn't support NV12
- //*CHECK_HR*/(hr = pConvSize->SetOutputType(0, pTransformInputType, 0));
- }
- }
- }
- else
- {
- hr = pNodeSinkMain->GetInputPrefType(0, &pSinkMainInputType);
- if(FAILED(hr))
- {
- pSinkMainInputType = pIputTypeMain;
- pSinkMainInputType->AddRef();
- hr = S_OK;
- }
- if(SUCCEEDED(hr))
- {
- if(pVideoProcessor)
- {
- CHECK_HR(hr = pVideoProcessor->SetOutputType(0, pSinkMainInputType, 0));
- }
- else
- {
- //!\ MUST NOT SET OUTPUT TYPE
- if(pConvColor)
- {
- //*CHECK_HR*/(hr = pConvColor->SetOutputType(0, pSinkMainInputType, 0));
- }
- if(pConvFrameRate)
- {
- //*CHECK_HR*/(hr = pConvFrameRate->SetOutputType(0, pSinkMainInputType, 0));
- }
- if(pConvSize)
- {
- //*CHECK_HR*/(hr = pConvSize->SetOutputType(0, pSinkMainInputType, 0));
- }
- }
- }
- }
-
- //
- // Connect
- //
-
- if(pNodeTee)
- {
- // Connect(Source -> Tee)
- CHECK_HR(hr = pNodeSource->ConnectOutput(0, pNodeTee, 0));
-
- // Connect(Tee -> SinkPreview)
- CHECK_HR(hr = pNodeTee->ConnectOutput(1, pNodeSinkPreview, 0));
-
- // Connect(Tee ->(Processors)
- if(pVideoProcessor)
- {
- CHECK_HR(hr = pNodeTee->ConnectOutput(0, pNodeVideoProcessor, 0));
- pcNodeBeforeSinkMain = pNodeVideoProcessor;
- }
- else if(pNodeConvFrameRate || pNodeConvSize || pNodeConvColor)
- {
- CHECK_HR(hr = ConnectConverters(
- pNodeTee,
- 0,
- pNodeConvFrameRate,
- pNodeConvColor,
- pNodeConvSize
- ));
- pcNodeBeforeSinkMain = pNodeConvSize ? pNodeConvSize : (pNodeConvColor ? pNodeConvColor : pNodeConvFrameRate);
- }
- else
- {
- pcNodeBeforeSinkMain = pNodeTee;
- }
- }
- else
- {
- // Connect(Source -> (Processors))
- if(pVideoProcessor)
- {
- CHECK_HR(hr = pNodeSource->ConnectOutput(0, pNodeVideoProcessor, 0));
- pcNodeBeforeSinkMain = pNodeVideoProcessor;
- }
- else if(pNodeConvFrameRate || pNodeConvFrameRate || pNodeConvColor)
- {
- CHECK_HR(hr = ConnectConverters(
- pNodeSource,
- 0,
- pNodeConvFrameRate,
- pNodeConvSize,
- pNodeConvColor
- ));
- pcNodeBeforeSinkMain = pNodeConvSize ? pNodeConvSize : (pNodeConvColor ? pNodeConvColor : pNodeConvFrameRate);
- }
- else
- {
- pcNodeBeforeSinkMain = pNodeSource;
- }
- }
-
-
- if(pNodeTransform)
- {
- // Connect(X->Transform)
- CHECK_HR(hr = ((IMFTopologyNode *)pcNodeBeforeSinkMain)->ConnectOutput(0, pNodeTransform, 0));
- pcNodeBeforeSinkMain = pNodeTransform;
- }
-
- // Connect(X -> SinkMain)
- CHECK_HR(hr = ((IMFTopologyNode *)pcNodeBeforeSinkMain)->ConnectOutput(0, pNodeSinkMain, 0));
-
- bSourceFound = TRUE;
- break;
- }
- else
- {
- CHECK_HR(hr = pPD->DeselectStream(i));
- }
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- }
-
- *ppTopo = pTopology;
- (*ppTopo)->AddRef();
+ IMFTransform *pConvFrameRate = NULL;
+ IMFTransform *pConvSize = NULL;
+ IMFTransform *pConvColor = NULL;
+ IMFTopologyNode *pNodeConvFrameRate = NULL;
+ IMFTopologyNode *pNodeConvSize = NULL;
+ IMFTopologyNode *pNodeConvColor = NULL;
+ IMFMediaType *pTransformInputType = NULL;
+ IMFMediaType *pSinkMainInputType = NULL;
+ const IMFTopologyNode *pcNodeBeforeSinkMain = NULL;
+
+ HRESULT hr = S_OK;
+ DWORD cStreams = 0;
+ BOOL bSourceFound = FALSE;
+ BOOL bSupportedSize = FALSE;
+ BOOL bSupportedFps = FALSE;
+ BOOL bSupportedFormat = FALSE;
+ BOOL bVideoProcessorSupported = FALSE;
+ GUID inputMajorType, inputSubType;
+
+ CHECK_HR(hr = IsVideoProcessorSupported(&bVideoProcessorSupported));
+ CHECK_HR(hr = pIputTypeMain->GetMajorType(&inputMajorType));
+
+ CHECK_HR(hr = MFCreateTopology(&pTopology));
+ CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
+ CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
+
+ for (DWORD i = 0; i < cStreams; i++) {
+ BOOL fSelected = FALSE;
+ GUID majorType;
+
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
+ CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
+ CHECK_HR(hr = pHandler->GetMajorType(&majorType));
+
+ if (majorType == inputMajorType && fSelected) {
+ CHECK_HR(hr = AddSourceNode(pTopology, pSource, pPD, pSD, &pNodeSource));
+ CHECK_HR(hr = pNodeSource->SetTopoNodeID(MFUtils::g_ullTopoIdSource));
+ CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivateMain, 0, &pNodeSinkMain));
+ CHECK_HR(hr = pNodeSinkMain->SetTopoNodeID(MFUtils::g_ullTopoIdSinkMain));
+ CHECK_HR(hr = MFUtils::BindOutputNode(pNodeSinkMain)); // To avoid MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED
+
+ //
+ // Create preview
+ //
+
+ if(pSinkActivatePreview) {
+ CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivatePreview, 0, &pNodeSinkPreview));
+ CHECK_HR(hr = pNodeSinkPreview->SetTopoNodeID(MFUtils::g_ullTopoIdSinkPreview));
+ CHECK_HR(hr = MFUtils::BindOutputNode(pNodeSinkPreview));
+
+ CHECK_HR(hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &pNodeTee));
+ CHECK_HR(hr = pTopology->AddNode(pNodeTee));
+ }
+
+ //
+ // Create converters
+ //
+
+ if(majorType == MFMediaType_Video) {
+ // Even when size matches the topology could add a resizer which doesn't keep ratio when resizing while video processor does.
+ if(!bVideoProcessorSupported) {
+ hr = IsSupported(
+ pPD,
+ i,
+ pIputTypeMain,
+ &bSupportedSize,
+ &bSupportedFps,
+ &bSupportedFormat);
+ }
+
+ CHECK_HR(hr = pIputTypeMain->GetGUID(MF_MT_SUBTYPE, &inputSubType));
+
+ if(!bSupportedSize || !bSupportedFps || !bSupportedFormat) {
+ // Use video processor single MFT or 3 different MFTs
+ if(!pVideoProcessor) {
+ hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pVideoProcessor));
+ }
+ if(!pVideoProcessor) {
+ // Video Resizer DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx) supports I420 only
+ if(!bSupportedSize && !pConvSize && inputSubType == MFVideoFormat_I420) {
+ hr = CoCreateInstance(CLSID_CResizerDMO, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvSize));
+ }
+ // Frame Rate Converter DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819100(v=vs.85).aspx) supports neither NV12 nor I420
+ /*if(!bSupportedFps && !pConvFrameRate)
+ {
+ hr = CoCreateInstance(CLSID_CFrameRateConvertDmo, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvFrameRate));
+ }*/
+ // Color Converter DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819079(v=vs.85).aspx) supports both NV12 and I420
+ if(!bSupportedFormat && !pConvColor) {
+ hr = CoCreateInstance(CLSID_CColorConvertDMO, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pConvColor));
+ }
+ }
+ }
+ else {
+ // MediaType supported
+ CHECK_HR(hr = pHandler->SetCurrentMediaType(pIputTypeMain));
+ }
+
+ if(pVideoProcessor && !pNodeVideoProcessor) {
+ CHECK_HR(hr = AddTransformNode(pTopology, pVideoProcessor, 0, &pNodeVideoProcessor));
+ CHECK_HR(hr = pNodeVideoProcessor->SetTopoNodeID(MFUtils::g_ullTopoIdVideoProcessor));
+ }
+ if(pConvColor && !pNodeConvColor) {
+ CHECK_HR(hr = AddTransformNode(pTopology, pConvColor, 0, &pNodeConvColor));
+ }
+ if(pConvFrameRate && !pNodeConvFrameRate) {
+ CHECK_HR(hr = AddTransformNode(pTopology, pConvFrameRate, 0, &pNodeConvFrameRate));
+ }
+ if(pConvSize && !pNodeConvSize) {
+ CHECK_HR(hr = AddTransformNode(pTopology, pConvSize, 0, &pNodeConvSize));
+ }
+ } // if(majorType == MFMediaType_Video)
+
+
+ //
+ // Set media type
+ //
+
+ if(pTransform) {
+ CHECK_HR(hr = AddTransformNode(pTopology, pTransform, 0, &pNodeTransform));
+ hr = pTransform->GetInputCurrentType(0, &pTransformInputType);
+ if(FAILED(hr)) {
+ pTransformInputType = pIputTypeMain;
+ pTransformInputType->AddRef();
+ hr = S_OK;
+ }
+ if(pVideoProcessor) {
+ CHECK_HR(hr = pVideoProcessor->SetOutputType(0, pTransformInputType, 0));
+ }
+ else {
+ if(pConvColor) {
+ /*CHECK_HR*/(hr = pConvColor->SetOutputType(0, pTransformInputType, 0));
+ }
+ if(pConvFrameRate) {
+ /*CHECK_HR*/(hr = pConvFrameRate->SetOutputType(0, pTransformInputType, 0));
+ }
+ if(pConvSize) {
+ // Transform requires NV12
+ //Video Resizer DSP(http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx) doesn't support NV12
+ //*CHECK_HR*/(hr = pConvSize->SetOutputType(0, pTransformInputType, 0));
+ }
+ }
+ }
+ else {
+ hr = pNodeSinkMain->GetInputPrefType(0, &pSinkMainInputType);
+ if(FAILED(hr)) {
+ pSinkMainInputType = pIputTypeMain;
+ pSinkMainInputType->AddRef();
+ hr = S_OK;
+ }
+ if(SUCCEEDED(hr)) {
+ if(pVideoProcessor) {
+ CHECK_HR(hr = pVideoProcessor->SetOutputType(0, pSinkMainInputType, 0));
+ }
+ else {
+ //!\ MUST NOT SET OUTPUT TYPE
+ if(pConvColor) {
+ //*CHECK_HR*/(hr = pConvColor->SetOutputType(0, pSinkMainInputType, 0));
+ }
+ if(pConvFrameRate) {
+ //*CHECK_HR*/(hr = pConvFrameRate->SetOutputType(0, pSinkMainInputType, 0));
+ }
+ if(pConvSize) {
+ //*CHECK_HR*/(hr = pConvSize->SetOutputType(0, pSinkMainInputType, 0));
+ }
+ }
+ }
+ }
+
+ //
+ // Connect
+ //
+
+ if(pNodeTee) {
+ // Connect(Source -> Tee)
+ CHECK_HR(hr = pNodeSource->ConnectOutput(0, pNodeTee, 0));
+
+ // Connect(Tee -> SinkPreview)
+ CHECK_HR(hr = pNodeTee->ConnectOutput(1, pNodeSinkPreview, 0));
+
+ // Connect(Tee ->(Processors)
+ if(pVideoProcessor) {
+ CHECK_HR(hr = pNodeTee->ConnectOutput(0, pNodeVideoProcessor, 0));
+ pcNodeBeforeSinkMain = pNodeVideoProcessor;
+ }
+ else if(pNodeConvFrameRate || pNodeConvSize || pNodeConvColor) {
+ CHECK_HR(hr = ConnectConverters(
+ pNodeTee,
+ 0,
+ pNodeConvFrameRate,
+ pNodeConvColor,
+ pNodeConvSize
+ ));
+ pcNodeBeforeSinkMain = pNodeConvSize ? pNodeConvSize : (pNodeConvColor ? pNodeConvColor : pNodeConvFrameRate);
+ }
+ else {
+ pcNodeBeforeSinkMain = pNodeTee;
+ }
+ }
+ else {
+ // Connect(Source -> (Processors))
+ if(pVideoProcessor) {
+ CHECK_HR(hr = pNodeSource->ConnectOutput(0, pNodeVideoProcessor, 0));
+ pcNodeBeforeSinkMain = pNodeVideoProcessor;
+ }
+ else if(pNodeConvFrameRate || pNodeConvFrameRate || pNodeConvColor) {
+ CHECK_HR(hr = ConnectConverters(
+ pNodeSource,
+ 0,
+ pNodeConvFrameRate,
+ pNodeConvSize,
+ pNodeConvColor
+ ));
+ pcNodeBeforeSinkMain = pNodeConvSize ? pNodeConvSize : (pNodeConvColor ? pNodeConvColor : pNodeConvFrameRate);
+ }
+ else {
+ pcNodeBeforeSinkMain = pNodeSource;
+ }
+ }
+
+
+ if(pNodeTransform) {
+ // Connect(X->Transform)
+ CHECK_HR(hr = ((IMFTopologyNode *)pcNodeBeforeSinkMain)->ConnectOutput(0, pNodeTransform, 0));
+ pcNodeBeforeSinkMain = pNodeTransform;
+ }
+
+ // Connect(X -> SinkMain)
+ CHECK_HR(hr = ((IMFTopologyNode *)pcNodeBeforeSinkMain)->ConnectOutput(0, pNodeSinkMain, 0));
+
+ bSourceFound = TRUE;
+ break;
+ }
+ else {
+ CHECK_HR(hr = pPD->DeselectStream(i));
+ }
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ }
+
+ *ppTopo = pTopology;
+ (*ppTopo)->AddRef();
bail:
- SafeRelease(&pTopology);
- SafeRelease(&pNodeSource);
- SafeRelease(&pNodeSinkMain);
- SafeRelease(&pNodeSinkPreview);
- SafeRelease(&pNodeTransform);
- SafeRelease(&pNodeTee);
- SafeRelease(&pPD);
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- SafeRelease(&pMediaType);
- SafeRelease(&pTransformInputType);
- SafeRelease(&pSinkMainInputType);
-
- SafeRelease(&pVideoProcessor);
+ SafeRelease(&pTopology);
+ SafeRelease(&pNodeSource);
+ SafeRelease(&pNodeSinkMain);
+ SafeRelease(&pNodeSinkPreview);
+ SafeRelease(&pNodeTransform);
+ SafeRelease(&pNodeTee);
+ SafeRelease(&pPD);
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ SafeRelease(&pMediaType);
+ SafeRelease(&pTransformInputType);
+ SafeRelease(&pSinkMainInputType);
+
+ SafeRelease(&pVideoProcessor);
SafeRelease(&pNodeVideoProcessor);
- SafeRelease(&pConvFrameRate);
- SafeRelease(&pConvSize);
- SafeRelease(&pConvColor);
- SafeRelease(&pNodeConvFrameRate);
- SafeRelease(&pNodeConvSize);
- SafeRelease(&pNodeConvColor);
-
- if(!bSourceFound)
- {
- TSK_DEBUG_ERROR("No source node found");
- return E_NOT_SET;
- }
-
- return hr;
+ SafeRelease(&pConvFrameRate);
+ SafeRelease(&pConvSize);
+ SafeRelease(&pConvColor);
+ SafeRelease(&pNodeConvFrameRate);
+ SafeRelease(&pNodeConvSize);
+ SafeRelease(&pNodeConvColor);
+
+ if(!bSourceFound) {
+ TSK_DEBUG_ERROR("No source node found");
+ return E_NOT_SET;
+ }
+
+ return hr;
}
// Creates a fully loaded topology from the input partial topology.
HRESULT MFUtils::ResolveTopology(
- IMFTopology *pInputTopo, // A pointer to the IMFTopology interface of the partial topology to be resolved.
- IMFTopology **ppOutputTopo, // Receives a pointer to the IMFTopology interface of the completed topology. The caller must release the interface.
- IMFTopology *pCurrentTopo /*= NULL*/ // A pointer to the IMFTopology interface of the previous full topology. The topology loader can re-use objects from this topology in the new topology. This parameter can be NULL.
- )
+ IMFTopology *pInputTopo, // A pointer to the IMFTopology interface of the partial topology to be resolved.
+ IMFTopology **ppOutputTopo, // Receives a pointer to the IMFTopology interface of the completed topology. The caller must release the interface.
+ IMFTopology *pCurrentTopo /*= NULL*/ // A pointer to the IMFTopology interface of the previous full topology. The topology loader can re-use objects from this topology in the new topology. This parameter can be NULL.
+)
{
- assert(ppOutputTopo && pInputTopo);
-
- HRESULT hr = S_OK;
- IMFTopoLoader* pTopoLoader = NULL;
-
- *ppOutputTopo = NULL;
-
- CHECK_HR(hr = MFCreateTopoLoader(&pTopoLoader));
- CHECK_HR(hr = pTopoLoader->Load(pInputTopo, ppOutputTopo, pCurrentTopo));
-
+ assert(ppOutputTopo && pInputTopo);
+
+ HRESULT hr = S_OK;
+ IMFTopoLoader* pTopoLoader = NULL;
+
+ *ppOutputTopo = NULL;
+
+ CHECK_HR(hr = MFCreateTopoLoader(&pTopoLoader));
+ CHECK_HR(hr = pTopoLoader->Load(pInputTopo, ppOutputTopo, pCurrentTopo));
+
bail:
- SafeRelease(&pTopoLoader);
- return hr;
+ SafeRelease(&pTopoLoader);
+ return hr;
}
HRESULT MFUtils::FindNodeObject(
- IMFTopology *pInputTopo, // The Topology containing the node to find
- TOPOID qwTopoNodeID, //The identifier for the node
- void** ppObject // Receives the Object
- )
+ IMFTopology *pInputTopo, // The Topology containing the node to find
+ TOPOID qwTopoNodeID, //The identifier for the node
+ void** ppObject // Receives the Object
+)
{
- assert(pInputTopo && ppObject);
+ assert(pInputTopo && ppObject);
- *ppObject = NULL;
+ *ppObject = NULL;
- IMFTopologyNode *pNode = NULL;
- HRESULT hr = S_OK;
+ IMFTopologyNode *pNode = NULL;
+ HRESULT hr = S_OK;
- CHECK_HR(hr = pInputTopo->GetNodeByID(qwTopoNodeID, &pNode));
- CHECK_HR(hr = pNode->GetObject((IUnknown**)ppObject));
+ CHECK_HR(hr = pInputTopo->GetNodeByID(qwTopoNodeID, &pNode));
+ CHECK_HR(hr = pNode->GetObject((IUnknown**)ppObject));
bail:
- SafeRelease(&pNode);
- return hr;
+ SafeRelease(&pNode);
+ return hr;
}
// Create an activation object for a renderer, based on the stream media type.
@@ -1402,7 +1289,7 @@ HRESULT MFUtils::CreateMediaSinkActivate(
IMFActivate **ppActivate
)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
IMFMediaTypeHandler *pHandler = NULL;
IMFActivate *pActivate = NULL;
@@ -1411,29 +1298,25 @@ HRESULT MFUtils::CreateMediaSinkActivate(
// Get the major media type.
GUID guidMajorType;
CHECK_HR(hr = pHandler->GetMajorType(&guidMajorType));
-
+
// Create an IMFActivate object for the renderer, based on the media type.
- if (MFMediaType_Audio == guidMajorType)
- {
+ if (MFMediaType_Audio == guidMajorType) {
// Create the audio renderer.
CHECK_HR(hr = MFCreateAudioRendererActivate(&pActivate));
}
- else if (MFMediaType_Video == guidMajorType)
- {
+ else if (MFMediaType_Video == guidMajorType) {
// Create the video renderer.
CHECK_HR(hr = MFCreateVideoRendererActivate(hVideoWindow, &pActivate));
}
- else
- {
- // Unknown stream type.
+ else {
+ // Unknown stream type.
hr = E_FAIL;
// Optionally, you could deselect this stream instead of failing.
}
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
goto bail;
}
-
+
// Return IMFActivate pointer to caller.
*ppActivate = pActivate;
(*ppActivate)->AddRef();
@@ -1447,92 +1330,87 @@ bail:
// Set source output media type
HRESULT MFUtils::SetMediaType(
IMFMediaSource *pSource, // Media source.
- IMFMediaType* pMediaType // Media Type.
- )
+ IMFMediaType* pMediaType // Media Type.
+)
{
- assert(pSource && pMediaType);
-
- IMFPresentationDescriptor *pPD = NULL;
- IMFStreamDescriptor *pSD = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
-
- HRESULT hr = S_OK;
- DWORD cStreams = 0;
- GUID inputMajorType;
-
- CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
- CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
- CHECK_HR(hr = pMediaType->GetMajorType(&inputMajorType));
-
- for (DWORD i = 0; i < cStreams; i++)
- {
- BOOL fSelected = FALSE;
- GUID majorType;
-
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
- CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
- CHECK_HR(hr = pHandler->GetMajorType(&majorType));
-
- if (majorType == inputMajorType && fSelected)
- {
- CHECK_HR(hr = pHandler->SetCurrentMediaType(pMediaType));
- }
- else
- {
- CHECK_HR(hr = pPD->DeselectStream(i));
- }
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- }
+ assert(pSource && pMediaType);
+
+ IMFPresentationDescriptor *pPD = NULL;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+
+ HRESULT hr = S_OK;
+ DWORD cStreams = 0;
+ GUID inputMajorType;
+
+ CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
+ CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
+ CHECK_HR(hr = pMediaType->GetMajorType(&inputMajorType));
+
+ for (DWORD i = 0; i < cStreams; i++) {
+ BOOL fSelected = FALSE;
+ GUID majorType;
+
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
+ CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
+ CHECK_HR(hr = pHandler->GetMajorType(&majorType));
+
+ if (majorType == inputMajorType && fSelected) {
+ CHECK_HR(hr = pHandler->SetCurrentMediaType(pMediaType));
+ }
+ else {
+ CHECK_HR(hr = pPD->DeselectStream(i));
+ }
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ }
bail:
- SafeRelease(&pPD);
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
+ SafeRelease(&pPD);
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
- return hr;
+ return hr;
}
HRESULT MFUtils::SetVideoWindow(
IMFTopology *pTopology, // Topology.
IMFMediaSource *pSource, // Media source.
HWND hVideoWnd // Window for video playback.
- )
+)
{
- HRESULT hr = S_OK;
- IMFStreamDescriptor *pSD = NULL;
- IMFPresentationDescriptor *pPD = NULL;
+ HRESULT hr = S_OK;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFPresentationDescriptor *pPD = NULL;
IMFActivate *pSinkActivate = NULL;
IMFTopologyNode *pSourceNode = NULL;
IMFTopologyNode *pOutputNode = NULL;
- DWORD cStreams = 0, iStream;
-
- CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
- CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
-
- for(iStream = 0; iStream < cStreams; ++iStream)
- {
- BOOL fSelected = FALSE;
-
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(iStream, &fSelected, &pSD));
-
- if (fSelected)
- {
- // Create the media sink activation object.
- CHECK_HR(hr = CreateMediaSinkActivate(pSD, hVideoWnd, &pSinkActivate));
- // Add a source node for this stream.
- CHECK_HR(hr = AddSourceNode(pTopology, pSource, pPD, pSD, &pSourceNode));
- // Create the output node for the renderer.
- CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivate, 0, &pOutputNode));
- // Connect the source node to the output node.
- CHECK_HR(hr = pSourceNode->ConnectOutput(0, pOutputNode, 0));
- }
- // else: If not selected, don't add the branch.
- }
+ DWORD cStreams = 0, iStream;
+
+ CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
+ CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
+
+ for(iStream = 0; iStream < cStreams; ++iStream) {
+ BOOL fSelected = FALSE;
+
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(iStream, &fSelected, &pSD));
+
+ if (fSelected) {
+ // Create the media sink activation object.
+ CHECK_HR(hr = CreateMediaSinkActivate(pSD, hVideoWnd, &pSinkActivate));
+ // Add a source node for this stream.
+ CHECK_HR(hr = AddSourceNode(pTopology, pSource, pPD, pSD, &pSourceNode));
+ // Create the output node for the renderer.
+ CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivate, 0, &pOutputNode));
+ // Connect the source node to the output node.
+ CHECK_HR(hr = pSourceNode->ConnectOutput(0, pOutputNode, 0));
+ }
+ // else: If not selected, don't add the branch.
+ }
bail:
- SafeRelease(&pPD);
+ SafeRelease(&pPD);
SafeRelease(&pSD);
SafeRelease(&pSinkActivate);
SafeRelease(&pSourceNode);
@@ -1542,407 +1420,374 @@ bail:
// Run the session
HRESULT MFUtils::RunSession(
- IMFMediaSession *pSession, // Session to run
- IMFTopology *pTopology // The toppology
- )
+ IMFMediaSession *pSession, // Session to run
+ IMFTopology *pTopology // The toppology
+)
{
- assert(pSession && pTopology);
-
- IMFMediaEvent *pEvent = NULL;
-
- PROPVARIANT var;
- PropVariantInit(&var);
-
- MediaEventType met;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- CHECK_HR(hr = pSession->SetTopology(MFSESSION_SETTOPOLOGY_IMMEDIATE, pTopology)); // MFSESSION_SETTOPOLOGY_IMMEDIATE required to update (reload) topology when media type change
- CHECK_HR(hr = pSession->Start(&GUID_NULL, &var));
-
- // Check first event
- hr = pSession->GetEvent(MF_EVENT_FLAG_NO_WAIT, &pEvent);
- if(hr == MF_E_NO_EVENTS_AVAILABLE || hr == MF_E_MULTIPLE_SUBSCRIBERS){ // MF_E_MULTIPLE_SUBSCRIBERS means already listening
- hr = S_OK;
- goto bail;
- }
- if(pEvent) {
- CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- }
- else {
- hrStatus = hr;
- }
- if (FAILED(hrStatus))
- {
- CHECK_HR(hr = pEvent->GetType(&met));
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
- hr = hrStatus;
- goto bail;
- }
+ assert(pSession && pTopology);
+
+ IMFMediaEvent *pEvent = NULL;
+
+ PROPVARIANT var;
+ PropVariantInit(&var);
+
+ MediaEventType met;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ CHECK_HR(hr = pSession->SetTopology(MFSESSION_SETTOPOLOGY_IMMEDIATE, pTopology)); // MFSESSION_SETTOPOLOGY_IMMEDIATE required to update (reload) topology when media type change
+ CHECK_HR(hr = pSession->Start(&GUID_NULL, &var));
+
+ // Check first event
+ hr = pSession->GetEvent(MF_EVENT_FLAG_NO_WAIT, &pEvent);
+ if(hr == MF_E_NO_EVENTS_AVAILABLE || hr == MF_E_MULTIPLE_SUBSCRIBERS) { // MF_E_MULTIPLE_SUBSCRIBERS means already listening
+ hr = S_OK;
+ goto bail;
+ }
+ if(pEvent) {
+ CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
+ }
+ else {
+ hrStatus = hr;
+ }
+ if (FAILED(hrStatus)) {
+ CHECK_HR(hr = pEvent->GetType(&met));
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ hr = hrStatus;
+ goto bail;
+ }
bail:
- SafeRelease(&pEvent);
- return hr;
+ SafeRelease(&pEvent);
+ return hr;
}
// Stop session
HRESULT MFUtils::ShutdownSession(
- IMFMediaSession *pSession, // The Session
- IMFMediaSource *pSource // Source to shutdown (optional)
- )
+ IMFMediaSession *pSession, // The Session
+ IMFMediaSource *pSource // Source to shutdown (optional)
+)
{
- // MUST be source then session
- if(pSource){
- pSource->Stop();
- pSource->Shutdown();
- }
- if(pSession){
- pSession->Shutdown();
- }
- return S_OK;
+ // MUST be source then session
+ if(pSource) {
+ pSource->Stop();
+ pSource->Shutdown();
+ }
+ if(pSession) {
+ pSession->Shutdown();
+ }
+ return S_OK;
}
// Pause session
HRESULT MFUtils::PauseSession(
- IMFMediaSession *pSession, // The session
- IMFMediaSource *pSource // Source to pause (optional)
- )
+ IMFMediaSession *pSession, // The session
+ IMFMediaSource *pSource // Source to pause (optional)
+)
{
- if(!pSession){
- return E_INVALIDARG;
- }
- if(pSource){
- pSource->Pause();
- }
- return pSession->Pause();
+ if(!pSession) {
+ return E_INVALIDARG;
+ }
+ if(pSource) {
+ pSource->Pause();
+ }
+ return pSession->Pause();
}
// Returns -1 if none is supported
INT MFUtils::GetSupportedSubTypeIndex(
- IMFMediaSource *pSource, // The source
- const GUID& mediaType, // The MediaType
- const VideoSubTypeGuidPair* subTypes, UINT subTypesCount // List of preferred subtypes (in ascending order)
- )
+ IMFMediaSource *pSource, // The source
+ const GUID& mediaType, // The MediaType
+ const VideoSubTypeGuidPair* subTypes, UINT subTypesCount // List of preferred subtypes (in ascending order)
+)
{
- assert(pSource);
-
- IMFPresentationDescriptor *pPD = NULL;
- IMFStreamDescriptor *pSD = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
- IMFMediaType *pMediaType = NULL;
-
- INT nIndex = -1;
- HRESULT hr = S_OK;
- DWORD cStreams = 0, cMediaTypesCount;
- GUID majorType, subType;
- BOOL fSelected;
-
- CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
- CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
-
- for (UINT subTypesIndex = 0; subTypesIndex < subTypesCount && nIndex == -1; ++subTypesIndex)
- {
- for (DWORD cStreamIndex = 0; cStreamIndex < cStreams && nIndex == -1; ++cStreamIndex)
- {
- fSelected = FALSE;
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(cStreamIndex, &fSelected, &pSD));
- if(fSelected)
- {
- CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
- CHECK_HR(hr = pHandler->GetMajorType(&majorType));
- if(majorType == mediaType)
- {
- CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
- for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount && nIndex == -1; ++cMediaTypesIndex)
- {
- CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
- CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
- if (subTypes[subTypesIndex].fourcc == subType)
- {
- nIndex = subTypesIndex;
- break;
- }
- SafeRelease(&pMediaType);
- }
- }
- }
-
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- }
- }
+ assert(pSource);
+
+ IMFPresentationDescriptor *pPD = NULL;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+ IMFMediaType *pMediaType = NULL;
+
+ INT nIndex = -1;
+ HRESULT hr = S_OK;
+ DWORD cStreams = 0, cMediaTypesCount;
+ GUID majorType, subType;
+ BOOL fSelected;
+
+ CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
+ CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
+
+ for (UINT subTypesIndex = 0; subTypesIndex < subTypesCount && nIndex == -1; ++subTypesIndex) {
+ for (DWORD cStreamIndex = 0; cStreamIndex < cStreams && nIndex == -1; ++cStreamIndex) {
+ fSelected = FALSE;
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(cStreamIndex, &fSelected, &pSD));
+ if(fSelected) {
+ CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
+ CHECK_HR(hr = pHandler->GetMajorType(&majorType));
+ if(majorType == mediaType) {
+ CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
+ for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount && nIndex == -1; ++cMediaTypesIndex) {
+ CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
+ CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
+ if (subTypes[subTypesIndex].fourcc == subType) {
+ nIndex = subTypesIndex;
+ break;
+ }
+ SafeRelease(&pMediaType);
+ }
+ }
+ }
+
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ }
+ }
bail:
- SafeRelease(&pMediaType);
- SafeRelease(&pPD);
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
+ SafeRelease(&pMediaType);
+ SafeRelease(&pPD);
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
- return nIndex;
+ return nIndex;
}
HRESULT MFUtils::IsSupported(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nFps,
- const GUID& guidFormat,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- )
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nFps,
+ const GUID& guidFormat,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+)
{
- HRESULT hr = S_OK;
-
- BOOL fSelected = FALSE;
- IMFStreamDescriptor *pSD = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
- IMFMediaType *pMediaType = NULL;
- UINT32 _nWidth = 0, _nHeight = 0, numeratorFps = 0, denominatorFps = 0;
- GUID subType;
- DWORD cMediaTypesCount;
-
- if(!pPD || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- *pbSupportedSize = FALSE;
- *pbSupportedFps = FALSE;
- *pbSupportedFormat = FALSE;
-
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(cStreamIndex, &fSelected, &pSD));
- if(fSelected)
- {
- CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
- CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
- for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount; ++cMediaTypesIndex)
- {
- CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
- CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &_nWidth, &_nHeight));
- CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
- if(FAILED(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps)))
- {
- numeratorFps = 30;
- denominatorFps = 1;
- }
-
- // all must match for the same stream
- if(_nWidth == nWidth && _nHeight == nHeight && subType == guidFormat && (numeratorFps/denominatorFps) == nFps)
- {
- *pbSupportedSize = TRUE;
- *pbSupportedFormat = TRUE;
- *pbSupportedFps = TRUE;
- break;
- }
-
- SafeRelease(&pMediaType);
- }
- SafeRelease(&pHandler);
- }
-
+ HRESULT hr = S_OK;
+
+ BOOL fSelected = FALSE;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+ IMFMediaType *pMediaType = NULL;
+ UINT32 _nWidth = 0, _nHeight = 0, numeratorFps = 0, denominatorFps = 0;
+ GUID subType;
+ DWORD cMediaTypesCount;
+
+ if(!pPD || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ *pbSupportedSize = FALSE;
+ *pbSupportedFps = FALSE;
+ *pbSupportedFormat = FALSE;
+
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(cStreamIndex, &fSelected, &pSD));
+ if(fSelected) {
+ CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
+ CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
+ for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount; ++cMediaTypesIndex) {
+ CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
+ CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &_nWidth, &_nHeight));
+ CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
+ if(FAILED(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps))) {
+ numeratorFps = 30;
+ denominatorFps = 1;
+ }
+
+ // all must match for the same stream
+ if(_nWidth == nWidth && _nHeight == nHeight && subType == guidFormat && (numeratorFps/denominatorFps) == nFps) {
+ *pbSupportedSize = TRUE;
+ *pbSupportedFormat = TRUE;
+ *pbSupportedFps = TRUE;
+ break;
+ }
+
+ SafeRelease(&pMediaType);
+ }
+ SafeRelease(&pHandler);
+ }
+
bail:
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- SafeRelease(&pMediaType);
-
- return hr;
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ SafeRelease(&pMediaType);
+
+ return hr;
}
HRESULT MFUtils::IsSupported(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- IMFMediaType* pMediaType,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- )
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ IMFMediaType* pMediaType,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+)
{
- HRESULT hr = S_OK;
-
- UINT32 nWidth = 0, nHeight = 0, nFps = 0, numeratorFps = 30, denominatorFps = 1;
- GUID subType;
-
- if(!pPD || !pMediaType || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &nWidth, &nHeight));
- CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
- if(FAILED(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps)))
- {
- numeratorFps = 30;
- denominatorFps = 1;
- }
-
- CHECK_HR(hr = IsSupported(
- pPD,
- cStreamIndex,
- nWidth,
- nHeight,
- (numeratorFps / denominatorFps),
- subType,
- pbSupportedSize,
- pbSupportedFps,
- pbSupportedFormat
- ));
+ HRESULT hr = S_OK;
+
+ UINT32 nWidth = 0, nHeight = 0, nFps = 0, numeratorFps = 30, denominatorFps = 1;
+ GUID subType;
+
+ if(!pPD || !pMediaType || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &nWidth, &nHeight));
+ CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
+ if(FAILED(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps))) {
+ numeratorFps = 30;
+ denominatorFps = 1;
+ }
+
+ CHECK_HR(hr = IsSupported(
+ pPD,
+ cStreamIndex,
+ nWidth,
+ nHeight,
+ (numeratorFps / denominatorFps),
+ subType,
+ pbSupportedSize,
+ pbSupportedFps,
+ pbSupportedFormat
+ ));
bail:
- return hr;
+ return hr;
}
HRESULT MFUtils::IsSupportedByInput(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- IMFTopologyNode *pNode,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- )
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ IMFTopologyNode *pNode,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+)
{
- HRESULT hr = S_OK;
-
- IMFMediaType *pMediaType = NULL;
- IUnknown* pObject = NULL;
- IMFActivate *pActivate = NULL;
- IMFMediaSink *pMediaSink = NULL;
- IMFTransform *pTransform = NULL;
- IMFStreamSink *pStreamSink = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
-
- if(!pPD || !pNode || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- CHECK_HR(hr = pNode->GetObject(&pObject));
- hr = pObject->QueryInterface(IID_PPV_ARGS(&pActivate));
- if(SUCCEEDED(hr))
- {
- SafeRelease(&pObject);
- hr = pActivate->ActivateObject(IID_IMFMediaSink, (void**)&pObject);
- if(FAILED(hr))
- {
- hr = pActivate->ActivateObject(IID_IMFTransform, (void**)&pObject);
- }
- }
-
- if(!pObject)
- {
- CHECK_HR(hr = E_NOINTERFACE);
- }
-
- hr = pObject->QueryInterface(IID_PPV_ARGS(&pMediaSink));
- if(FAILED(hr))
- {
- hr = pObject->QueryInterface(IID_PPV_ARGS(&pTransform));
- }
-
-
-
- if(pMediaSink)
- {
- CHECK_HR(hr = pMediaSink->GetStreamSinkByIndex(0, &pStreamSink));
- CHECK_HR(hr = pStreamSink->GetMediaTypeHandler(&pHandler));
- CHECK_HR(hr = pHandler->GetCurrentMediaType(&pMediaType));
-
- }
- else if(pTransform)
- {
- CHECK_HR(hr = pTransform->GetInputCurrentType(0, &pMediaType));
- }
- else
- {
- CHECK_HR(hr = pNode->GetInputPrefType(0, &pMediaType));
- }
-
- CHECK_HR(hr = IsSupported(
- pPD,
- cStreamIndex,
- pMediaType,
- pbSupportedSize,
- pbSupportedFps,
- pbSupportedFormat
- ));
+ HRESULT hr = S_OK;
+
+ IMFMediaType *pMediaType = NULL;
+ IUnknown* pObject = NULL;
+ IMFActivate *pActivate = NULL;
+ IMFMediaSink *pMediaSink = NULL;
+ IMFTransform *pTransform = NULL;
+ IMFStreamSink *pStreamSink = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+
+ if(!pPD || !pNode || !pbSupportedSize || !pbSupportedFps || !pbSupportedFormat) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ CHECK_HR(hr = pNode->GetObject(&pObject));
+ hr = pObject->QueryInterface(IID_PPV_ARGS(&pActivate));
+ if(SUCCEEDED(hr)) {
+ SafeRelease(&pObject);
+ hr = pActivate->ActivateObject(IID_IMFMediaSink, (void**)&pObject);
+ if(FAILED(hr)) {
+ hr = pActivate->ActivateObject(IID_IMFTransform, (void**)&pObject);
+ }
+ }
+
+ if(!pObject) {
+ CHECK_HR(hr = E_NOINTERFACE);
+ }
+
+ hr = pObject->QueryInterface(IID_PPV_ARGS(&pMediaSink));
+ if(FAILED(hr)) {
+ hr = pObject->QueryInterface(IID_PPV_ARGS(&pTransform));
+ }
+
+
+
+ if(pMediaSink) {
+ CHECK_HR(hr = pMediaSink->GetStreamSinkByIndex(0, &pStreamSink));
+ CHECK_HR(hr = pStreamSink->GetMediaTypeHandler(&pHandler));
+ CHECK_HR(hr = pHandler->GetCurrentMediaType(&pMediaType));
+
+ }
+ else if(pTransform) {
+ CHECK_HR(hr = pTransform->GetInputCurrentType(0, &pMediaType));
+ }
+ else {
+ CHECK_HR(hr = pNode->GetInputPrefType(0, &pMediaType));
+ }
+
+ CHECK_HR(hr = IsSupported(
+ pPD,
+ cStreamIndex,
+ pMediaType,
+ pbSupportedSize,
+ pbSupportedFps,
+ pbSupportedFormat
+ ));
bail:
- SafeRelease(&pObject);
- SafeRelease(&pActivate);
- SafeRelease(&pMediaType);
- SafeRelease(&pStreamSink);
- SafeRelease(&pHandler);
- return hr;
+ SafeRelease(&pObject);
+ SafeRelease(&pActivate);
+ SafeRelease(&pMediaType);
+ SafeRelease(&pStreamSink);
+ SafeRelease(&pHandler);
+ return hr;
}
HRESULT MFUtils::ConnectConverters(
- IMFTopologyNode *pNode,
- DWORD dwOutputIndex,
- IMFTopologyNode *pNodeConvFrameRate,
- IMFTopologyNode *pNodeConvColor,
- IMFTopologyNode *pNodeConvSize
- )
+ IMFTopologyNode *pNode,
+ DWORD dwOutputIndex,
+ IMFTopologyNode *pNodeConvFrameRate,
+ IMFTopologyNode *pNodeConvColor,
+ IMFTopologyNode *pNodeConvSize
+)
{
- HRESULT hr = S_OK;
-
- if(!pNode)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(pNodeConvFrameRate)
- {
- CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvFrameRate, 0));
- if(pNodeConvSize)
- {
- CHECK_HR(hr = pNodeConvFrameRate->ConnectOutput(0, pNodeConvSize, 0));
- if(pNodeConvColor)
- {
- CHECK_HR(hr = pNodeConvSize->ConnectOutput(0, pNodeConvColor, 0));
- }
- }
- else
- {
- if(pNodeConvColor)
- {
- CHECK_HR(hr = pNodeConvFrameRate->ConnectOutput(0, pNodeConvColor, 0));
- }
- }
- }
- else
- {
- if(pNodeConvSize)
- {
- CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvSize, 0));
- if(pNodeConvColor)
- {
- CHECK_HR(hr = pNodeConvSize->ConnectOutput(0, pNodeConvColor, 0));
- }
- }
- else
- {
- if(pNodeConvColor)
- {
- CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvColor, 0));
- }
- }
- }
+ HRESULT hr = S_OK;
+
+ if(!pNode) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(pNodeConvFrameRate) {
+ CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvFrameRate, 0));
+ if(pNodeConvSize) {
+ CHECK_HR(hr = pNodeConvFrameRate->ConnectOutput(0, pNodeConvSize, 0));
+ if(pNodeConvColor) {
+ CHECK_HR(hr = pNodeConvSize->ConnectOutput(0, pNodeConvColor, 0));
+ }
+ }
+ else {
+ if(pNodeConvColor) {
+ CHECK_HR(hr = pNodeConvFrameRate->ConnectOutput(0, pNodeConvColor, 0));
+ }
+ }
+ }
+ else {
+ if(pNodeConvSize) {
+ CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvSize, 0));
+ if(pNodeConvColor) {
+ CHECK_HR(hr = pNodeConvSize->ConnectOutput(0, pNodeConvColor, 0));
+ }
+ }
+ else {
+ if(pNodeConvColor) {
+ CHECK_HR(hr = pNode->ConnectOutput(dwOutputIndex, pNodeConvColor, 0));
+ }
+ }
+ }
bail:
- return hr;
+ return hr;
}
// This function should be called only if VideoProcessor is not supported
HRESULT MFUtils::GetBestFormat(
- IMFMediaSource *pSource,
- const GUID *pSubType,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nFps,
- UINT32 *pnWidth,
- UINT32 *pnHeight,
- UINT32 *pnFps,
- const VideoSubTypeGuidPair **ppSubTypeGuidPair
- )
+ IMFMediaSource *pSource,
+ const GUID *pSubType,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nFps,
+ UINT32 *pnWidth,
+ UINT32 *pnHeight,
+ UINT32 *pnFps,
+ const VideoSubTypeGuidPair **ppSubTypeGuidPair
+)
{
#define _FindPairByGuid(_guid, _index) { \
@@ -1954,151 +1799,146 @@ HRESULT MFUtils::GetBestFormat(
} \
}
#if 0
- *pnWidth = 640;
- *pnHeight = 480;
- *pnFps = 30;
- return S_OK;
-#else
- HRESULT hr = S_OK;
- IMFPresentationDescriptor *pPD = NULL;
- IMFStreamDescriptor *pSD = NULL;
- IMFMediaTypeHandler *pHandler = NULL;
- IMFMediaType *pMediaType = NULL;
- DWORD cStreams = 0, cMediaTypesCount;
- GUID majorType, subType, _BestSubType;
- BOOL bFound = FALSE, fSelected;
- UINT32 _nWidth, _nHeight, numeratorFps, denominatorFps, _nFps, _nScore, _nBestScore;
- int PreferredVideoSubTypeGuidPairIndex;
- static const UINT32 kSubTypeMismatchPad = _UI32_MAX >> 4;
- static const UINT32 kFpsMismatchPad = _UI32_MAX >> 2;
-
- if (!ppSubTypeGuidPair || !pSubType) {
- CHECK_HR(hr = E_INVALIDARG);
- }
- _FindPairByGuid(*pSubType, PreferredVideoSubTypeGuidPairIndex);
- if (PreferredVideoSubTypeGuidPairIndex == -1) {
- CHECK_HR(hr = E_INVALIDARG);
- }
- *ppSubTypeGuidPair = &PreferredVideoSubTypeGuidPairs[PreferredVideoSubTypeGuidPairIndex];
-
- _nBestScore = _UI32_MAX;
- CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
- CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
-
-
- for (DWORD i = 0; i < cStreams; i++)
- {
- fSelected = FALSE;
-
- CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
-
- if (fSelected)
- {
- CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
-
- CHECK_HR(hr = pHandler->GetMajorType(&majorType));
-
- if(majorType == MFMediaType_Video)
- {
- CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
-
- for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount; ++cMediaTypesIndex)
- {
- CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
-
- CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
- // if(subType == *pSubType)
- {
- CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &_nWidth, &_nHeight));
- CHECK_HR(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps));
- _nFps = (numeratorFps / denominatorFps);
-
- if (subType == *pSubType) {
- _nScore = 0;
- }
- else {
- _FindPairByGuid(subType, PreferredVideoSubTypeGuidPairIndex);
- if (PreferredVideoSubTypeGuidPairIndex == -1) {
- _nScore = kSubTypeMismatchPad; // Not a must but important: If(!VideoProcess) then CLSID_CColorConvertDMO
- }
- else {
- _nScore = kSubTypeMismatchPad >> (PreferredVideoSubTypeGuidPairsCount - PreferredVideoSubTypeGuidPairIndex);
- }
- }
- _nScore += abs((int)(_nWidth - nWidth)); // Not a must: If(!VideoProcess) then CLSID_CResizerDMO
- _nScore += abs((int)(_nHeight - nHeight)); // Not a must: If(!VideoProcess) then CLSID_CResizerDMO
- _nScore += (_nFps == nFps) ? 0 : kFpsMismatchPad; // Fps is a must because without video processor no alternative exist (CLSID_CFrameRateConvertDmo doesn't support I420)
-
- if (_nScore <= _nBestScore || !bFound)
- {
- *pnWidth = _nWidth;
- *pnHeight = _nHeight;
- *pnFps = _nFps;
- bFound = TRUE;
- _BestSubType = subType;
- _nBestScore = _nScore;
- }
- }
-
- SafeRelease(&pMediaType);
- }
- }
- }
-
- SafeRelease(&pHandler);
- SafeRelease(&pSD);
- }
+ *pnWidth = 640;
+ *pnHeight = 480;
+ *pnFps = 30;
+ return S_OK;
+#else
+ HRESULT hr = S_OK;
+ IMFPresentationDescriptor *pPD = NULL;
+ IMFStreamDescriptor *pSD = NULL;
+ IMFMediaTypeHandler *pHandler = NULL;
+ IMFMediaType *pMediaType = NULL;
+ DWORD cStreams = 0, cMediaTypesCount;
+ GUID majorType, subType, _BestSubType;
+ BOOL bFound = FALSE, fSelected;
+ UINT32 _nWidth, _nHeight, numeratorFps, denominatorFps, _nFps, _nScore, _nBestScore;
+ int PreferredVideoSubTypeGuidPairIndex;
+ static const UINT32 kSubTypeMismatchPad = _UI32_MAX >> 4;
+ static const UINT32 kFpsMismatchPad = _UI32_MAX >> 2;
+
+ if (!ppSubTypeGuidPair || !pSubType) {
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+ _FindPairByGuid(*pSubType, PreferredVideoSubTypeGuidPairIndex);
+ if (PreferredVideoSubTypeGuidPairIndex == -1) {
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+ *ppSubTypeGuidPair = &PreferredVideoSubTypeGuidPairs[PreferredVideoSubTypeGuidPairIndex];
+
+ _nBestScore = _UI32_MAX;
+ CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
+ CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
+
+
+ for (DWORD i = 0; i < cStreams; i++) {
+ fSelected = FALSE;
+
+ CHECK_HR(hr = pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));
+
+ if (fSelected) {
+ CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
+
+ CHECK_HR(hr = pHandler->GetMajorType(&majorType));
+
+ if(majorType == MFMediaType_Video) {
+ CHECK_HR(hr = pHandler->GetMediaTypeCount(&cMediaTypesCount));
+
+ for(DWORD cMediaTypesIndex = 0; cMediaTypesIndex < cMediaTypesCount; ++cMediaTypesIndex) {
+ CHECK_HR(hr = pHandler->GetMediaTypeByIndex(cMediaTypesIndex, &pMediaType));
+
+ CHECK_HR(hr = pMediaType->GetGUID(MF_MT_SUBTYPE, &subType));
+ // if(subType == *pSubType)
+ {
+ CHECK_HR(hr = MFGetAttributeSize(pMediaType, MF_MT_FRAME_SIZE, &_nWidth, &_nHeight));
+ CHECK_HR(hr = MFGetAttributeRatio(pMediaType, MF_MT_FRAME_RATE, &numeratorFps, &denominatorFps));
+ _nFps = (numeratorFps / denominatorFps);
+
+ if (subType == *pSubType) {
+ _nScore = 0;
+ }
+ else {
+ _FindPairByGuid(subType, PreferredVideoSubTypeGuidPairIndex);
+ if (PreferredVideoSubTypeGuidPairIndex == -1) {
+ _nScore = kSubTypeMismatchPad; // Not a must but important: If(!VideoProcess) then CLSID_CColorConvertDMO
+ }
+ else {
+ _nScore = kSubTypeMismatchPad >> (PreferredVideoSubTypeGuidPairsCount - PreferredVideoSubTypeGuidPairIndex);
+ }
+ }
+ _nScore += abs((int)(_nWidth - nWidth)); // Not a must: If(!VideoProcess) then CLSID_CResizerDMO
+ _nScore += abs((int)(_nHeight - nHeight)); // Not a must: If(!VideoProcess) then CLSID_CResizerDMO
+ _nScore += (_nFps == nFps) ? 0 : kFpsMismatchPad; // Fps is a must because without video processor no alternative exist (CLSID_CFrameRateConvertDmo doesn't support I420)
+
+ if (_nScore <= _nBestScore || !bFound) {
+ *pnWidth = _nWidth;
+ *pnHeight = _nHeight;
+ *pnFps = _nFps;
+ bFound = TRUE;
+ _BestSubType = subType;
+ _nBestScore = _nScore;
+ }
+ }
+
+ SafeRelease(&pMediaType);
+ }
+ }
+ }
+
+ SafeRelease(&pHandler);
+ SafeRelease(&pSD);
+ }
bail:
- SafeRelease(&pPD);
- SafeRelease(&pSD);
- SafeRelease(&pHandler);
- SafeRelease(&pMediaType);
-
- _FindPairByGuid(_BestSubType, PreferredVideoSubTypeGuidPairIndex);
- if (PreferredVideoSubTypeGuidPairIndex != -1) {
- *ppSubTypeGuidPair = &PreferredVideoSubTypeGuidPairs[PreferredVideoSubTypeGuidPairIndex];
- }
- else /*if (_nBestScore > kSubTypeMismatchPad)*/ {
- *pnWidth = 640;
- *pnHeight = 480;
- *pnFps = 30;
- TSK_DEBUG_WARN("Failed to math subtype...using VGA@30fps");
- }
-
- return SUCCEEDED(hr) ? (bFound ? S_OK : E_NOT_SET): hr;
+ SafeRelease(&pPD);
+ SafeRelease(&pSD);
+ SafeRelease(&pHandler);
+ SafeRelease(&pMediaType);
+
+ _FindPairByGuid(_BestSubType, PreferredVideoSubTypeGuidPairIndex);
+ if (PreferredVideoSubTypeGuidPairIndex != -1) {
+ *ppSubTypeGuidPair = &PreferredVideoSubTypeGuidPairs[PreferredVideoSubTypeGuidPairIndex];
+ }
+ else { /*if (_nBestScore > kSubTypeMismatchPad)*/
+ *pnWidth = 640;
+ *pnHeight = 480;
+ *pnFps = 30;
+ TSK_DEBUG_WARN("Failed to math subtype...using VGA@30fps");
+ }
+
+ return SUCCEEDED(hr) ? (bFound ? S_OK : E_NOT_SET): hr;
#endif
}
HWND MFUtils::GetConsoleHwnd(void)
{
- #define MY_BUFSIZE 1024 // Buffer size for console window titles.
- HWND hwndFound; // This is what is returned to the caller.
- TCHAR pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
- // WindowTitle.
- TCHAR pszOldWindowTitle[MY_BUFSIZE]; // Contains original
- // WindowTitle.
+#define MY_BUFSIZE 1024 // Buffer size for console window titles.
+ HWND hwndFound; // This is what is returned to the caller.
+ TCHAR pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
+ // WindowTitle.
+ TCHAR pszOldWindowTitle[MY_BUFSIZE]; // Contains original
+ // WindowTitle.
- // Fetch current window title.
- GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
+ // Fetch current window title.
+ GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
- // Format a "unique" NewWindowTitle.
- wsprintf(pszNewWindowTitle,TEXT("%d/%d"),
- GetTickCount(),
- GetCurrentProcessId());
+ // Format a "unique" NewWindowTitle.
+ wsprintf(pszNewWindowTitle,TEXT("%d/%d"),
+ GetTickCount(),
+ GetCurrentProcessId());
- // Change current window title.
- SetConsoleTitle(pszNewWindowTitle);
+ // Change current window title.
+ SetConsoleTitle(pszNewWindowTitle);
- // Ensure window title has been updated.
- Sleep(40);
+ // Ensure window title has been updated.
+ Sleep(40);
- // Look for NewWindowTitle.
- hwndFound=FindWindow(NULL, pszNewWindowTitle);
+ // Look for NewWindowTitle.
+ hwndFound=FindWindow(NULL, pszNewWindowTitle);
- // Restore original window title.
- SetConsoleTitle(pszOldWindowTitle);
+ // Restore original window title.
+ SetConsoleTitle(pszOldWindowTitle);
- return(hwndFound);
+ return(hwndFound);
}
diff --git a/plugins/pluginWinMF/internals/mf_utils.h b/plugins/pluginWinMF/internals/mf_utils.h
index 0819597..1225b3b 100755
--- a/plugins/pluginWinMF/internals/mf_utils.h
+++ b/plugins/pluginWinMF/internals/mf_utils.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -35,14 +35,13 @@
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
#undef CHECK_HR
// In CHECK_HR(x) When (x) is a function it will be executed twice when used in "TSK_DEBUG_ERROR(x)" and "If(x)"
#define CHECK_HR(x) { HRESULT __hr__ = (x); if (FAILED(__hr__)) { TSK_DEBUG_ERROR("Operation Failed (%08x)", __hr__); goto bail; } }
-typedef struct VideoSubTypeGuidPair
-{
+typedef struct VideoSubTypeGuidPair {
enum tmedia_chroma_e chroma;
const GUID& fourcc;
}
@@ -52,209 +51,207 @@ class MFUtils
{
public:
-static HRESULT Startup();
-static HRESULT Shutdown();
+ static HRESULT Startup();
+ static HRESULT Shutdown();
-static BOOL IsD3D9Supported();
-static BOOL IsLowLatencyH264Supported();
-static BOOL IsLowLatencyH264SupportsMaxSliceSize();
+ static BOOL IsD3D9Supported();
+ static BOOL IsLowLatencyH264Supported();
+ static BOOL IsLowLatencyH264SupportsMaxSliceSize();
-static HRESULT IsAsyncMFT(
- IMFTransform *pMFT, // The MFT to check
- BOOL* pbIsAsync // Whether the MFT is Async
- );
-static HRESULT UnlockAsyncMFT(
- IMFTransform *pMFT // The MFT to unlock
- );
+ static HRESULT IsAsyncMFT(
+ IMFTransform *pMFT, // The MFT to check
+ BOOL* pbIsAsync // Whether the MFT is Async
+ );
+ static HRESULT UnlockAsyncMFT(
+ IMFTransform *pMFT // The MFT to unlock
+ );
-static HRESULT CreatePCMAudioType(
- UINT32 sampleRate, // Samples per second
- UINT32 bitsPerSample, // Bits per sample
- UINT32 cChannels, // Number of channels
- IMFMediaType **ppType // Receives a pointer to the media type.
+ static HRESULT CreatePCMAudioType(
+ UINT32 sampleRate, // Samples per second
+ UINT32 bitsPerSample, // Bits per sample
+ UINT32 cChannels, // Number of channels
+ IMFMediaType **ppType // Receives a pointer to the media type.
+ );
+ static HRESULT CreateVideoType(
+ const GUID* subType, // video subType
+ IMFMediaType **ppType, // Receives a pointer to the media type.
+ UINT32 unWidth = 0, // Video width (0 to ignore)
+ UINT32 unHeight = 0 // Video height (0 to ignore)
+ );
+ static HRESULT ConvertVideoTypeToUncompressedType(
+ IMFMediaType *pType, // Pointer to an encoded video type.
+ const GUID& subtype, // Uncompressed subtype (eg, RGB-32, AYUV)
+ IMFMediaType **ppType // Receives a matching uncompressed video type.
+ );
+ static HRESULT CreateMediaSample(
+ DWORD cbData, // Maximum buffer size
+ IMFSample **ppSample // Receives the sample
+ );
+ static HRESULT ValidateVideoFormat(
+ IMFMediaType *pmt
+ );
+ static HRESULT IsVideoProcessorSupported(BOOL *pbSupported);
+ static HRESULT GetBestVideoProcessor(
+ const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_I420)
+ const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_NV12)
+ IMFTransform **ppProcessor // Receives the video processor
+ );
+ static HRESULT GetBestCodec(
+ BOOL bEncoder, // Whether we request an encoder or not (TRUE=encoder, FALSE=decoder)
+ const GUID& mediaType, // The MediaType
+ const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_NV12)
+ const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_H264)
+ IMFTransform **ppMFT // Receives the decoder/encoder transform
+ );
+ static HRESULT BindOutputNode(
+ IMFTopologyNode *pNode // The Node
+ );
+ static HRESULT AddOutputNode(
+ IMFTopology *pTopology, // Topology.
+ IMFActivate *pActivate, // Media sink activation object.
+ DWORD dwId, // Identifier of the stream sink.
+ IMFTopologyNode **ppNode // Receives the node pointer.
+ );
+ static HRESULT AddTransformNode(
+ IMFTopology *pTopology, // Topology.
+ IMFTransform *pMFT, // MFT.
+ DWORD dwId, // Identifier of the stream sink.
+ IMFTopologyNode **ppNode // Receives the node pointer.
+ );
+ static HRESULT AddSourceNode(
+ IMFTopology *pTopology, // Topology.
+ IMFMediaSource *pSource, // Media source.
+ IMFPresentationDescriptor *pPD, // Presentation descriptor.
+ IMFStreamDescriptor *pSD, // Stream descriptor.
+ IMFTopologyNode **ppNode // Receives the node pointer.
);
-static HRESULT CreateVideoType(
- const GUID* subType, // video subType
- IMFMediaType **ppType, // Receives a pointer to the media type.
- UINT32 unWidth = 0, // Video width (0 to ignore)
- UINT32 unHeight = 0 // Video height (0 to ignore)
- );
-static HRESULT ConvertVideoTypeToUncompressedType(
- IMFMediaType *pType, // Pointer to an encoded video type.
- const GUID& subtype, // Uncompressed subtype (eg, RGB-32, AYUV)
- IMFMediaType **ppType // Receives a matching uncompressed video type.
+ static HRESULT CreateTopology(
+ IMFMediaSource *pSource, // Media source
+ IMFTransform *pTransform, // Transform filter (e.g. encoder or decoder) to insert between the source and Sink. NULL is valid.
+ IMFActivate *pSinkActivateMain, // Main sink (e.g. sample grabber or EVR).
+ IMFActivate *pSinkActivatePreview, // Preview sink. Optional. Could be NULL.
+ IMFMediaType *pIputTypeMain, // Main sink input MediaType
+ IMFTopology **ppTopo // Receives the newly created topology
+ );
+ static HRESULT ResolveTopology(
+ IMFTopology *pInputTopo, // A pointer to the IMFTopology interface of the partial topology to be resolved.
+ IMFTopology **ppOutputTopo, // Receives a pointer to the IMFTopology interface of the completed topology. The caller must release the interface.
+ IMFTopology *pCurrentTopo = NULL // A pointer to the IMFTopology interface of the previous full topology. The topology loader can re-use objects from this topology in the new topology. This parameter can be NULL.
+ );
+ static HRESULT FindNodeObject(
+ IMFTopology *pInputTopo, // The Topology containing the node to find
+ TOPOID qwTopoNodeID, //The identifier for the node
+ void** ppObject // Receives the Object
+ );
+ static HRESULT CreateMediaSinkActivate(
+ IMFStreamDescriptor *pSourceSD, // Pointer to the stream descriptor.
+ HWND hVideoWindow, // Handle to the video clipping window.
+ IMFActivate **ppActivate
+ );
+ static HRESULT SetMediaType(
+ IMFMediaSource *pSource, // Media source.
+ IMFMediaType* pMediaType // Media Type.
+ );
+ static HRESULT SetVideoWindow(
+ IMFTopology *pTopology, // Topology.
+ IMFMediaSource *pSource, // Media source.
+ HWND hVideoWnd // Window for video playback.
+ );
+ static HRESULT RunSession(
+ IMFMediaSession *pSession, // Session to run
+ IMFTopology *pTopology // The toppology
+ );
+ static HRESULT ShutdownSession(
+ IMFMediaSession *pSession, // The Session
+ IMFMediaSource *pSource = NULL // Source to shutdown (optional)
+ );
+ static HRESULT PauseSession(
+ IMFMediaSession *pSession, // The session
+ IMFMediaSource *pSource = NULL// Source to pause (optional)
+ );
+ static INT GetSupportedSubTypeIndex(
+ IMFMediaSource *pSource, // The source
+ const GUID& mediaType, // The MediaType
+ const VideoSubTypeGuidPair* subTypes, UINT subTypesCount // List of preferred subtypes (in ascending order)
+ );
+ static HRESULT IsSupported(
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nFps,
+ const GUID& guidFormat,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+ );
+ static HRESULT IsSupported(
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ IMFMediaType* pMediaType,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+ );
+ static HRESULT IsSupportedByInput(
+ IMFPresentationDescriptor *pPD,
+ DWORD cStreamIndex,
+ IMFTopologyNode *pNode,
+ BOOL* pbSupportedSize,
+ BOOL* pbSupportedFps,
+ BOOL* pbSupportedFormat
+ );
+ static HRESULT ConnectConverters(
+ IMFTopologyNode *pNode,
+ DWORD dwOutputIndex,
+ IMFTopologyNode *pNodeConvFrameRate,
+ IMFTopologyNode *pNodeConvColor,
+ IMFTopologyNode *pNodeConvSize
+ );
+ static HRESULT GetBestFormat(
+ IMFMediaSource *pSource,
+ const GUID *pSubType,
+ UINT32 nWidth,
+ UINT32 nHeight,
+ UINT32 nFps,
+ UINT32 *pnWidth,
+ UINT32 *pnHeight,
+ UINT32 *pnFps,
+ const VideoSubTypeGuidPair **pSubTypeGuidPair
);
-static HRESULT CreateMediaSample(
- DWORD cbData, // Maximum buffer size
- IMFSample **ppSample // Receives the sample
- );
-static HRESULT ValidateVideoFormat(
- IMFMediaType *pmt
- );
-static HRESULT IsVideoProcessorSupported(BOOL *pbSupported);
-static HRESULT GetBestVideoProcessor(
- const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_I420)
- const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_NV12)
- IMFTransform **ppProcessor // Receives the video processor
- );
-static HRESULT GetBestCodec(
- BOOL bEncoder, // Whether we request an encoder or not (TRUE=encoder, FALSE=decoder)
- const GUID& mediaType, // The MediaType
- const GUID& inputFormat, // The input MediaFormat (e.g. MFVideoFormat_NV12)
- const GUID& outputFormat, // The output MediaFormat (e.g. MFVideoFormat_H264)
- IMFTransform **ppMFT // Receives the decoder/encoder transform
- );
-static HRESULT BindOutputNode(
- IMFTopologyNode *pNode // The Node
- );
-static HRESULT AddOutputNode(
- IMFTopology *pTopology, // Topology.
- IMFActivate *pActivate, // Media sink activation object.
- DWORD dwId, // Identifier of the stream sink.
- IMFTopologyNode **ppNode // Receives the node pointer.
- );
-static HRESULT AddTransformNode(
- IMFTopology *pTopology, // Topology.
- IMFTransform *pMFT, // MFT.
- DWORD dwId, // Identifier of the stream sink.
- IMFTopologyNode **ppNode // Receives the node pointer.
- );
-static HRESULT AddSourceNode(
- IMFTopology *pTopology, // Topology.
- IMFMediaSource *pSource, // Media source.
- IMFPresentationDescriptor *pPD, // Presentation descriptor.
- IMFStreamDescriptor *pSD, // Stream descriptor.
- IMFTopologyNode **ppNode // Receives the node pointer.
- );
-static HRESULT CreateTopology(
- IMFMediaSource *pSource, // Media source
- IMFTransform *pTransform, // Transform filter (e.g. encoder or decoder) to insert between the source and Sink. NULL is valid.
- IMFActivate *pSinkActivateMain, // Main sink (e.g. sample grabber or EVR).
- IMFActivate *pSinkActivatePreview, // Preview sink. Optional. Could be NULL.
- IMFMediaType *pIputTypeMain, // Main sink input MediaType
- IMFTopology **ppTopo // Receives the newly created topology
- );
-static HRESULT ResolveTopology(
- IMFTopology *pInputTopo, // A pointer to the IMFTopology interface of the partial topology to be resolved.
- IMFTopology **ppOutputTopo, // Receives a pointer to the IMFTopology interface of the completed topology. The caller must release the interface.
- IMFTopology *pCurrentTopo = NULL // A pointer to the IMFTopology interface of the previous full topology. The topology loader can re-use objects from this topology in the new topology. This parameter can be NULL.
- );
-static HRESULT FindNodeObject(
- IMFTopology *pInputTopo, // The Topology containing the node to find
- TOPOID qwTopoNodeID, //The identifier for the node
- void** ppObject // Receives the Object
- );
-static HRESULT CreateMediaSinkActivate(
- IMFStreamDescriptor *pSourceSD, // Pointer to the stream descriptor.
- HWND hVideoWindow, // Handle to the video clipping window.
- IMFActivate **ppActivate
-);
-static HRESULT SetMediaType(
- IMFMediaSource *pSource, // Media source.
- IMFMediaType* pMediaType // Media Type.
- );
-static HRESULT SetVideoWindow(
- IMFTopology *pTopology, // Topology.
- IMFMediaSource *pSource, // Media source.
- HWND hVideoWnd // Window for video playback.
- );
-static HRESULT RunSession(
- IMFMediaSession *pSession, // Session to run
- IMFTopology *pTopology // The toppology
- );
-static HRESULT ShutdownSession(
- IMFMediaSession *pSession, // The Session
- IMFMediaSource *pSource = NULL // Source to shutdown (optional)
- );
-static HRESULT PauseSession(
- IMFMediaSession *pSession, // The session
- IMFMediaSource *pSource = NULL// Source to pause (optional)
- );
-static INT GetSupportedSubTypeIndex(
- IMFMediaSource *pSource, // The source
- const GUID& mediaType, // The MediaType
- const VideoSubTypeGuidPair* subTypes, UINT subTypesCount // List of preferred subtypes (in ascending order)
- );
-static HRESULT IsSupported(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nFps,
- const GUID& guidFormat,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- );
-static HRESULT IsSupported(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- IMFMediaType* pMediaType,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- );
-static HRESULT IsSupportedByInput(
- IMFPresentationDescriptor *pPD,
- DWORD cStreamIndex,
- IMFTopologyNode *pNode,
- BOOL* pbSupportedSize,
- BOOL* pbSupportedFps,
- BOOL* pbSupportedFormat
- );
-static HRESULT ConnectConverters(
- IMFTopologyNode *pNode,
- DWORD dwOutputIndex,
- IMFTopologyNode *pNodeConvFrameRate,
- IMFTopologyNode *pNodeConvColor,
- IMFTopologyNode *pNodeConvSize
- );
-static HRESULT GetBestFormat(
- IMFMediaSource *pSource,
- const GUID *pSubType,
- UINT32 nWidth,
- UINT32 nHeight,
- UINT32 nFps,
- UINT32 *pnWidth,
- UINT32 *pnHeight,
- UINT32 *pnFps,
- const VideoSubTypeGuidPair **pSubTypeGuidPair
- );
-static HWND GetConsoleHwnd(void);
+ static HWND GetConsoleHwnd(void);
-template <class Q>
-static HRESULT GetTopoNodeObject(IMFTopologyNode *pNode, Q **ppObject)
-{
- IUnknown *pUnk = NULL; // zero output
+ template <class Q>
+ static HRESULT GetTopoNodeObject(IMFTopologyNode *pNode, Q **ppObject) {
+ IUnknown *pUnk = NULL; // zero output
- HRESULT hr = pNode->GetObject(&pUnk);
- if (SUCCEEDED(hr))
- {
- pUnk->QueryInterface(IID_PPV_ARGS(ppObject));
- pUnk->Release();
+ HRESULT hr = pNode->GetObject(&pUnk);
+ if (SUCCEEDED(hr)) {
+ pUnk->QueryInterface(IID_PPV_ARGS(ppObject));
+ pUnk->Release();
+ }
+ return hr;
}
- return hr;
-}
private:
- static BOOL g_bStarted;
+ static BOOL g_bStarted;
- static DWORD g_dwMajorVersion;
- static DWORD g_dwMinorVersion;
+ static DWORD g_dwMajorVersion;
+ static DWORD g_dwMinorVersion;
- static BOOL g_bLowLatencyH264Checked;
- static BOOL g_bLowLatencyH264Supported;
- static BOOL g_bLowLatencyH264SupportsMaxSliceSize;
+ static BOOL g_bLowLatencyH264Checked;
+ static BOOL g_bLowLatencyH264Supported;
+ static BOOL g_bLowLatencyH264SupportsMaxSliceSize;
- static BOOL g_bD3D9Checked;
- static BOOL g_bD3D9Supported;
+ static BOOL g_bD3D9Checked;
+ static BOOL g_bD3D9Supported;
public:
- static const TOPOID g_ullTopoIdSinkMain;
- static const TOPOID g_ullTopoIdSinkPreview;
- static const TOPOID g_ullTopoIdSource;
- static const TOPOID g_ullTopoIdVideoProcessor;
+ static const TOPOID g_ullTopoIdSinkMain;
+ static const TOPOID g_ullTopoIdSinkPreview;
+ static const TOPOID g_ullTopoIdSource;
+ static const TOPOID g_ullTopoIdVideoProcessor;
};
#endif /* PLUGIN_WIN_MF_UTILS_H */
diff --git a/plugins/pluginWinMF/plugin_win_mf_codec_h264.cxx b/plugins/pluginWinMF/plugin_win_mf_codec_h264.cxx
index bee00f0..c815deb 100755
--- a/plugins/pluginWinMF/plugin_win_mf_codec_h264.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_codec_h264.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -31,35 +31,34 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct mf_codec_h264_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
-
- // Encoder
- struct{
- MFCodecVideoH264* pInst;
- void* buffer;
- int64_t frame_count;
- tsk_bool_t force_idr;
- int32_t quality; // [1-31]
- int rotation;
- int neg_width;
- int neg_height;
- int neg_fps;
- int max_bitrate_bps;
- int32_t max_bw_kpbs;
- tsk_bool_t passthrough; // whether to bypass encoding
- } encoder;
-
- // decoder
- struct{
- MFCodecVideoH264* pInst;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- uint16_t last_seq;
- tsk_bool_t passthrough; // whether to bypass decoding
- } decoder;
+typedef struct mf_codec_h264_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
+
+ // Encoder
+ struct {
+ MFCodecVideoH264* pInst;
+ void* buffer;
+ int64_t frame_count;
+ tsk_bool_t force_idr;
+ int32_t quality; // [1-31]
+ int rotation;
+ int neg_width;
+ int neg_height;
+ int neg_fps;
+ int max_bitrate_bps;
+ int32_t max_bw_kpbs;
+ tsk_bool_t passthrough; // whether to bypass encoding
+ } encoder;
+
+ // decoder
+ struct {
+ MFCodecVideoH264* pInst;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ uint16_t last_seq;
+ tsk_bool_t passthrough; // whether to bypass decoding
+ } decoder;
}
mf_codec_h264_t;
@@ -78,372 +77,368 @@ static int mf_codec_h264_close_decoder(mf_codec_h264_t* self);
static int mf_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return -1;
- }
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- h264->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
- break;
- }
- }
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-encoding")){
- h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- h264->encoder.pInst->setBundled(h264->encoder.passthrough);
- TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-decoding")){
- h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- h264->decoder.pInst->setBundled(h264->decoder.passthrough);
- TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "rotation")){
- int rotation = *((int32_t*)param->value);
- if(h264->encoder.rotation != rotation){
- if(self->opened){
- int ret;
- h264->encoder.rotation = rotation;
- if((ret = mf_codec_h264_close_encoder(h264))){
- return ret;
- }
- if((ret = mf_codec_h264_open_encoder(h264))){
- return ret;
- }
- }
- }
- return 0;
- }
- }
- return -1;
+ mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return -1;
+ }
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ h264->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
+ break;
+ }
+ }
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-encoding")) {
+ h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ h264->encoder.pInst->setBundled(h264->encoder.passthrough);
+ TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-decoding")) {
+ h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ h264->decoder.pInst->setBundled(h264->decoder.passthrough);
+ TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "rotation")) {
+ int rotation = *((int32_t*)param->value);
+ if(h264->encoder.rotation != rotation) {
+ if(self->opened) {
+ int ret;
+ h264->encoder.rotation = rotation;
+ if((ret = mf_codec_h264_close_encoder(h264))) {
+ return ret;
+ }
+ if((ret = mf_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
}
static int mf_codec_h264_open(tmedia_codec_t* self)
{
- int ret;
- mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
- // Encoder
- if((ret = mf_codec_h264_open_encoder(h264))){
- return ret;
- }
-
- // Decoder
- if((ret = mf_codec_h264_open_decoder(h264))){
- return ret;
- }
-
- return 0;
+ int ret;
+ mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+ // Encoder
+ if((ret = mf_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
+
+ // Decoder
+ if((ret = mf_codec_h264_open_decoder(h264))) {
+ return ret;
+ }
+
+ return 0;
}
static int mf_codec_h264_close(tmedia_codec_t* self)
{
- mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
+ mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) alreasy checked that the codec is opened */
+ /* the caller (base class) alreasy checked that the codec is opened */
- // Encoder
- mf_codec_h264_close_encoder(h264);
+ // Encoder
+ mf_codec_h264_close_encoder(h264);
- // Decoder
- mf_codec_h264_close_decoder(h264);
+ // Decoder
+ mf_codec_h264_close_decoder(h264);
- return 0;
+ return 0;
}
static tsk_size_t mf_codec_h264_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret = 0;
- tsk_bool_t send_idr, send_hdr;
-
- mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if(!self || !in_data || !in_size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!self->opened || !h264->encoder.pInst || !h264->encoder.pInst->IsReady()){
- TSK_DEBUG_ERROR("Encoder not opened or not ready");
- return 0;
- }
-
-
- HRESULT hr = S_OK;
- IMFSample *pSampleOut = NULL;
- IMFMediaBuffer* pBufferOut = NULL;
-
- // send IDR for:
- // - the first frame
- // - remote peer requested an IDR
- // - every second within the first 4seconds
- send_idr = (
- h264->encoder.frame_count++ == 0
- || h264 ->encoder.force_idr
- || ( (h264->encoder.frame_count < h264->encoder.neg_fps * 4) && ((h264->encoder.frame_count % h264->encoder.neg_fps)==0) )
- );
-
- if(send_idr) {
- CHECK_HR(hr = h264->encoder.pInst->RequestKeyFrame());
- }
-
- // send SPS and PPS headers for:
- // - IDR frames (not required but it's the easiest way to deal with pkt loss)
- // - every 5 seconds after the first 4seconds
- send_hdr = (
- send_idr
- || ( (h264->encoder.frame_count % (h264->encoder.neg_fps * 5))==0 )
- );
- if(send_hdr){
- //FIXME: MF_MT_MPEG_SEQUENCE_HEADER
- // tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.context->extradata, (tsk_size_t)h264->encoder.context->extradata_size);
- }
-
- if (h264->encoder.passthrough) {
- tdav_codec_h264_rtp_encap(common, (const uint8_t*)in_data, in_size);
- return 0;
- }
-
- // Encode data
- CHECK_HR(hr = h264->encoder.pInst->Process(in_data, (UINT32)in_size, &pSampleOut));
- if(pSampleOut) {
- CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
-
- BYTE* pBufferPtr = NULL;
- DWORD dwDataLength = 0;
- CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
- if(dwDataLength > 0) {
- CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
- tdav_codec_h264_rtp_encap(common, (const uint8_t*)pBufferPtr, (tsk_size_t)dwDataLength);
- CHECK_HR(hr = pBufferOut->Unlock());
- }
- }
-
- // reset
- h264->encoder.force_idr = tsk_false;
+ int ret = 0;
+ tsk_bool_t send_idr, send_hdr;
+
+ mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if(!self || !in_data || !in_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!self->opened || !h264->encoder.pInst || !h264->encoder.pInst->IsReady()) {
+ TSK_DEBUG_ERROR("Encoder not opened or not ready");
+ return 0;
+ }
+
+
+ HRESULT hr = S_OK;
+ IMFSample *pSampleOut = NULL;
+ IMFMediaBuffer* pBufferOut = NULL;
+
+ // send IDR for:
+ // - the first frame
+ // - remote peer requested an IDR
+ // - every second within the first 4seconds
+ send_idr = (
+ h264->encoder.frame_count++ == 0
+ || h264 ->encoder.force_idr
+ || ( (h264->encoder.frame_count < h264->encoder.neg_fps * 4) && ((h264->encoder.frame_count % h264->encoder.neg_fps)==0) )
+ );
+
+ if(send_idr) {
+ CHECK_HR(hr = h264->encoder.pInst->RequestKeyFrame());
+ }
+
+ // send SPS and PPS headers for:
+ // - IDR frames (not required but it's the easiest way to deal with pkt loss)
+ // - every 5 seconds after the first 4seconds
+ send_hdr = (
+ send_idr
+ || ( (h264->encoder.frame_count % (h264->encoder.neg_fps * 5))==0 )
+ );
+ if(send_hdr) {
+ //FIXME: MF_MT_MPEG_SEQUENCE_HEADER
+ // tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.context->extradata, (tsk_size_t)h264->encoder.context->extradata_size);
+ }
+
+ if (h264->encoder.passthrough) {
+ tdav_codec_h264_rtp_encap(common, (const uint8_t*)in_data, in_size);
+ return 0;
+ }
+
+ // Encode data
+ CHECK_HR(hr = h264->encoder.pInst->Process(in_data, (UINT32)in_size, &pSampleOut));
+ if(pSampleOut) {
+ CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
+
+ BYTE* pBufferPtr = NULL;
+ DWORD dwDataLength = 0;
+ CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
+ if(dwDataLength > 0) {
+ CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
+ tdav_codec_h264_rtp_encap(common, (const uint8_t*)pBufferPtr, (tsk_size_t)dwDataLength);
+ CHECK_HR(hr = pBufferOut->Unlock());
+ }
+ }
+
+ // reset
+ h264->encoder.force_idr = tsk_false;
bail:
- SafeRelease(&pSampleOut);
- SafeRelease(&pBufferOut);
- return 0;
+ SafeRelease(&pSampleOut);
+ SafeRelease(&pBufferOut);
+ return 0;
}
static tsk_size_t mf_codec_h264_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
-
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0;
- int ret;
- tsk_bool_t append_scp, end_of_unit;
- tsk_bool_t sps_or_pps;
- tsk_size_t retsize = 0, size_to_copy = 0;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
-
- if(!h264 || !in_data || !in_size || !out_data)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!self->opened || !h264->encoder.pInst || !h264->decoder.pInst->IsReady()){
- TSK_DEBUG_ERROR("Decoder not opened or not ready");
- return 0;
- }
-
- HRESULT hr = S_OK;
- IMFSample *pSampleOut = NULL;
- IMFMediaBuffer* pBufferOut = NULL;
-
- /* Packet lost? */
- if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq){
- TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
- }
- h264->decoder.last_seq = rtp_hdr->seq_num;
-
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ mf_codec_h264_t* h264 = (mf_codec_h264_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0;
+ int ret;
+ tsk_bool_t append_scp, end_of_unit;
+ tsk_bool_t sps_or_pps;
+ tsk_size_t retsize = 0, size_to_copy = 0;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+
+ if(!h264 || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!self->opened || !h264->encoder.pInst || !h264->decoder.pInst->IsReady()) {
+ TSK_DEBUG_ERROR("Decoder not opened or not ready");
+ return 0;
+ }
+
+ HRESULT hr = S_OK;
+ IMFSample *pSampleOut = NULL;
+ IMFMediaBuffer* pBufferOut = NULL;
+
+ /* Packet lost? */
+ if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
+ TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
+ }
+ h264->decoder.last_seq = rtp_hdr->seq_num;
+
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- if (*((uint8_t*)in_data) & 0x80) {
- TSK_DEBUG_WARN("F=1");
- /* reset accumulator */
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
-
- /* get payload */
- if ((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size){
- TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
- return 0;
- }
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
- // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
- sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
-
- // start-accumulator
- if (!h264->decoder.accumulator) {
- if (size_to_copy > xmax_size) {
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- return 0;
- }
- if (!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- return 0;
- }
- h264->decoder.accumulator_size = size_to_copy;
- }
- if ((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
- TSK_DEBUG_ERROR("BufferOverflow");
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
- if ((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
- if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))){
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
- return 0;
- }
- h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
- }
-
- if (append_scp) {
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
- h264->decoder.accumulator_pos += start_code_prefix_size;
- }
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
- h264->decoder.accumulator_pos += pay_size;
- // end-accumulator
-
- /*if(sps_or_pps){
- // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
- // SPS and PPS should be bundled with IDR
- TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
- }
- else */if (rtp_hdr->marker) {
- if (h264->decoder.passthrough) {
- if (*out_max_size < h264->decoder.accumulator_pos) {
- if ((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))) {
- *out_max_size = h264->decoder.accumulator_pos;
- }
- else {
- *out_max_size = 0;
- return 0;
- }
- }
- memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
- retsize = h264->decoder.accumulator_pos;
- }
- else { // !h264->decoder.passthrough
- /* decode the picture */
- CHECK_HR(hr = h264->decoder.pInst->Process(h264->decoder.accumulator, (UINT32)h264->decoder.accumulator_pos, &pSampleOut));
- if (pSampleOut) {
- CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
-
- BYTE* pBufferPtr = NULL;
- DWORD dwDataLength = 0;
- CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
- if (dwDataLength > 0) {
- CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
- {
- /* IDR ? */
- if(((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback){
- TSK_DEBUG_INFO("Decoded H.264 IDR");
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- /* fill out */
- if(*out_max_size < dwDataLength){
- if((*out_data = tsk_realloc(*out_data, dwDataLength))){
- *out_max_size = dwDataLength;
- }
- else{
- *out_max_size = 0;
- return 0;
- }
- }
- retsize = (tsk_size_t)dwDataLength;
- TMEDIA_CODEC_VIDEO(h264)->in.width = h264->decoder.pInst->GetWidth();
- TMEDIA_CODEC_VIDEO(h264)->in.height = h264->decoder.pInst->GetHeight();
- memcpy(*out_data, pBufferPtr, retsize);
- }
- CHECK_HR(hr = pBufferOut->Unlock());
- }
- }
- }// else(!h264->decoder.passthrough)
- } // else if(rtp_hdr->marker)
+ */
+ if (*((uint8_t*)in_data) & 0x80) {
+ TSK_DEBUG_WARN("F=1");
+ /* reset accumulator */
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ /* get payload */
+ if ((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size) {
+ TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
+ return 0;
+ }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+ // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
+ sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
+
+ // start-accumulator
+ if (!h264->decoder.accumulator) {
+ if (size_to_copy > xmax_size) {
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ return 0;
+ }
+ if (!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ return 0;
+ }
+ h264->decoder.accumulator_size = size_to_copy;
+ }
+ if ((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ if ((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
+ if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+ return 0;
+ }
+ h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
+ }
+
+ if (append_scp) {
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ h264->decoder.accumulator_pos += start_code_prefix_size;
+ }
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
+ h264->decoder.accumulator_pos += pay_size;
+ // end-accumulator
+
+ /*if(sps_or_pps){
+ // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
+ // SPS and PPS should be bundled with IDR
+ TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
+ }
+ else */if (rtp_hdr->marker) {
+ if (h264->decoder.passthrough) {
+ if (*out_max_size < h264->decoder.accumulator_pos) {
+ if ((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))) {
+ *out_max_size = h264->decoder.accumulator_pos;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
+ retsize = h264->decoder.accumulator_pos;
+ }
+ else { // !h264->decoder.passthrough
+ /* decode the picture */
+ CHECK_HR(hr = h264->decoder.pInst->Process(h264->decoder.accumulator, (UINT32)h264->decoder.accumulator_pos, &pSampleOut));
+ if (pSampleOut) {
+ CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
+
+ BYTE* pBufferPtr = NULL;
+ DWORD dwDataLength = 0;
+ CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
+ if (dwDataLength > 0) {
+ CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
+ {
+ /* IDR ? */
+ if(((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TSK_DEBUG_INFO("Decoded H.264 IDR");
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ /* fill out */
+ if(*out_max_size < dwDataLength) {
+ if((*out_data = tsk_realloc(*out_data, dwDataLength))) {
+ *out_max_size = dwDataLength;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ retsize = (tsk_size_t)dwDataLength;
+ TMEDIA_CODEC_VIDEO(h264)->in.width = h264->decoder.pInst->GetWidth();
+ TMEDIA_CODEC_VIDEO(h264)->in.height = h264->decoder.pInst->GetHeight();
+ memcpy(*out_data, pBufferPtr, retsize);
+ }
+ CHECK_HR(hr = pBufferOut->Unlock());
+ }
+ }
+ }// else(!h264->decoder.passthrough)
+ } // else if(rtp_hdr->marker)
bail:
- if (rtp_hdr->marker) {
- h264->decoder.accumulator_pos = 0;
- }
- if (FAILED(hr) /*|| (!pSampleOut && rtp_hdr->marker)*/){
- TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
- if(TMEDIA_CODEC_VIDEO(self)->in.callback){
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- SafeRelease(&pSampleOut);
- SafeRelease(&pBufferOut);
- return retsize;
+ if (rtp_hdr->marker) {
+ h264->decoder.accumulator_pos = 0;
+ }
+ if (FAILED(hr) /*|| (!pSampleOut && rtp_hdr->marker)*/) {
+ TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ SafeRelease(&pSampleOut);
+ SafeRelease(&pBufferOut);
+ return retsize;
}
static tsk_bool_t mf_codec_h264_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
+ return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
}
static char* mf_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
- if(att && tsk_striequals(att_name, "fmtp")) {
- tsk_strcat(&att, "; impl=MF");
- }
- return att;
+ char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
+ if(att && tsk_striequals(att_name, "fmtp")) {
+ tsk_strcat(&att, "; impl=MF");
+ }
+ return att;
}
@@ -454,63 +449,61 @@ static char* mf_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char* a
/* constructor */
static tsk_object_t* mf_codec_h264_base_ctor(tsk_object_t * self, va_list * app)
{
- mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(mf_codec_h264_init(h264, profile_idc_baseline) != 0){
- return tsk_null;
- }
- }
- return self;
+ mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(mf_codec_h264_init(h264, profile_idc_baseline) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* mf_codec_h264_base_dtor(tsk_object_t * self)
-{
- mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- mf_codec_h264_deinit(h264);
- }
-
- return self;
+{
+ mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ mf_codec_h264_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t mf_codec_h264_base_def_s =
-{
- sizeof(mf_codec_h264_t),
- mf_codec_h264_base_ctor,
- mf_codec_h264_base_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t mf_codec_h264_base_def_s = {
+ sizeof(mf_codec_h264_t),
+ mf_codec_h264_base_ctor,
+ mf_codec_h264_base_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t mf_codec_h264_base_plugin_def_s =
-{
- &mf_codec_h264_base_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "H264 Base Profile (Media Foundation)",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0}, // fps is @deprecated
-
- mf_codec_h264_set,
- mf_codec_h264_open,
- mf_codec_h264_close,
- mf_codec_h264_encode,
- mf_codec_h264_decode,
- mf_codec_h264_sdp_att_match,
- mf_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t mf_codec_h264_base_plugin_def_s = {
+ &mf_codec_h264_base_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "H264 Base Profile (Media Foundation)",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0}, // fps is @deprecated
+
+ mf_codec_h264_set,
+ mf_codec_h264_open,
+ mf_codec_h264_close,
+ mf_codec_h264_encode,
+ mf_codec_h264_decode,
+ mf_codec_h264_sdp_att_match,
+ mf_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *mf_codec_h264_base_plugin_def_t = &mf_codec_h264_base_plugin_def_s;
@@ -519,64 +512,62 @@ const tmedia_codec_plugin_def_t *mf_codec_h264_base_plugin_def_t = &mf_codec_h26
/* constructor */
static tsk_object_t* mf_codec_h264_main_ctor(tsk_object_t * self, va_list * app)
{
- mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(mf_codec_h264_init(h264, profile_idc_main) != 0){
- return tsk_null;
- }
- }
- return self;
+ mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(mf_codec_h264_init(h264, profile_idc_main) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* mf_codec_h264_main_dtor(tsk_object_t * self)
-{
- mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- mf_codec_h264_deinit(h264);
-
- }
-
- return self;
+{
+ mf_codec_h264_t *h264 = (mf_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ mf_codec_h264_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t mf_codec_h264_main_def_s =
-{
- sizeof(mf_codec_h264_t),
- mf_codec_h264_main_ctor,
- mf_codec_h264_main_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t mf_codec_h264_main_def_s = {
+ sizeof(mf_codec_h264_t),
+ mf_codec_h264_main_ctor,
+ mf_codec_h264_main_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t mf_codec_h264_main_plugin_def_s =
-{
- &mf_codec_h264_main_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_mp,
- "H264",
- "H264 Main Profile (Media Foundation)",
- TMEDIA_CODEC_FORMAT_H264_MP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps)*/
- {176, 144, 0},// fps is @deprecated
-
- mf_codec_h264_set,
- mf_codec_h264_open,
- mf_codec_h264_close,
- mf_codec_h264_encode,
- mf_codec_h264_decode,
- mf_codec_h264_sdp_att_match,
- mf_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t mf_codec_h264_main_plugin_def_s = {
+ &mf_codec_h264_main_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_mp,
+ "H264",
+ "H264 Main Profile (Media Foundation)",
+ TMEDIA_CODEC_FORMAT_H264_MP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps)*/
+ {176, 144, 0},// fps is @deprecated
+
+ mf_codec_h264_set,
+ mf_codec_h264_open,
+ mf_codec_h264_close,
+ mf_codec_h264_encode,
+ mf_codec_h264_decode,
+ mf_codec_h264_sdp_att_match,
+ mf_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *mf_codec_h264_main_plugin_def_t = &mf_codec_h264_main_plugin_def_s;
@@ -586,165 +577,165 @@ const tmedia_codec_plugin_def_t *mf_codec_h264_main_plugin_def_t = &mf_codec_h26
int mf_codec_h264_open_encoder(mf_codec_h264_t* self)
{
- HRESULT hr = S_OK;
- int32_t max_bw_kpbs;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+ HRESULT hr = S_OK;
+ int32_t max_bw_kpbs;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
- if(self->encoder.pInst) {
- TSK_DEBUG_ERROR("Encoder already initialized");
+ if(self->encoder.pInst) {
+ TSK_DEBUG_ERROR("Encoder already initialized");
#if defined(E_ILLEGAL_METHOD_CALL)
- CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
+ CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
#else
- CHECK_HR(hr = 0x8000000EL);
-#endif
- }
-
- // create encoder
- if(!(self->encoder.pInst = (common->profile == profile_idc_baseline) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Encoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder))){
- TSK_DEBUG_ERROR("Failed to find H.264 encoder");
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
-
- //self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- //self->encoder.context->time_base.num = 1;
- //self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
- self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
- self->encoder.max_bw_kpbs
- );
- self->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
-
- TSK_DEBUG_INFO("[H.264 MF Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
- self->encoder.neg_width,
- self->encoder.neg_height,
- self->encoder.neg_fps,
- self->encoder.max_bitrate_bps
- );
-
- CHECK_HR(hr = self->encoder.pInst->Initialize(
- self->encoder.neg_fps,
- self->encoder.neg_width,
- self->encoder.neg_height,
- self->encoder.max_bitrate_bps));
-
- CHECK_HR(hr = self->encoder.pInst->SetGOPSize(self->encoder.neg_fps * PLUGIN_MF_H264_GOP_SIZE_IN_SECONDS));
- CHECK_HR(hr = self->encoder.pInst->SetSliceMaxSizeInBytes((H264_RTP_PAYLOAD_SIZE - 100)));
+ CHECK_HR(hr = 0x8000000EL);
+#endif
+ }
+
+ // create encoder
+ if(!(self->encoder.pInst = (common->profile == profile_idc_baseline) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Encoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder))) {
+ TSK_DEBUG_ERROR("Failed to find H.264 encoder");
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+
+ //self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ //self->encoder.context->time_base.num = 1;
+ //self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
+ self->encoder.max_bw_kpbs
+ );
+ self->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
+
+ TSK_DEBUG_INFO("[H.264 MF Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
+ self->encoder.neg_width,
+ self->encoder.neg_height,
+ self->encoder.neg_fps,
+ self->encoder.max_bitrate_bps
+ );
+
+ CHECK_HR(hr = self->encoder.pInst->Initialize(
+ self->encoder.neg_fps,
+ self->encoder.neg_width,
+ self->encoder.neg_height,
+ self->encoder.max_bitrate_bps));
+
+ CHECK_HR(hr = self->encoder.pInst->SetGOPSize(self->encoder.neg_fps * PLUGIN_MF_H264_GOP_SIZE_IN_SECONDS));
+ CHECK_HR(hr = self->encoder.pInst->SetSliceMaxSizeInBytes((H264_RTP_PAYLOAD_SIZE - 100)));
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
int mf_codec_h264_close_encoder(mf_codec_h264_t* self)
{
- if(self){
- SafeRelease(&self->encoder.pInst);
- if(self->encoder.buffer){
- TSK_FREE(self->encoder.buffer);
- }
- self->encoder.frame_count = 0;
- }
-
- return 0;
+ if(self) {
+ SafeRelease(&self->encoder.pInst);
+ if(self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
+ self->encoder.frame_count = 0;
+ }
+
+ return 0;
}
int mf_codec_h264_open_decoder(mf_codec_h264_t* self)
{
- HRESULT hr = S_OK;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+ HRESULT hr = S_OK;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
- if(self->decoder.pInst) {
- TSK_DEBUG_ERROR("Decoder already initialized");
+ if(self->decoder.pInst) {
+ TSK_DEBUG_ERROR("Decoder already initialized");
#if defined(E_ILLEGAL_METHOD_CALL)
- CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
+ CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
#else
- CHECK_HR(hr = 0x8000000EL);
+ CHECK_HR(hr = 0x8000000EL);
#endif
- }
+ }
- // create decoder
- if(!(self->decoder.pInst = (common->profile == profile_idc_baseline) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Decoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder))){
- TSK_DEBUG_ERROR("Failed to find H.264 encoder");
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
+ // create decoder
+ if(!(self->decoder.pInst = (common->profile == profile_idc_baseline) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Decoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder))) {
+ TSK_DEBUG_ERROR("Failed to find H.264 encoder");
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
- TSK_DEBUG_INFO("[H.264 MF Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
- TMEDIA_CODEC_VIDEO(self)->in.width,
- TMEDIA_CODEC_VIDEO(self)->in.height,
- TMEDIA_CODEC_VIDEO(self)->in.fps
- );
+ TSK_DEBUG_INFO("[H.264 MF Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
+ TMEDIA_CODEC_VIDEO(self)->in.width,
+ TMEDIA_CODEC_VIDEO(self)->in.height,
+ TMEDIA_CODEC_VIDEO(self)->in.fps
+ );
- CHECK_HR(hr = self->decoder.pInst->Initialize(
- TMEDIA_CODEC_VIDEO(self)->in.fps,
- TMEDIA_CODEC_VIDEO(self)->in.width,
- TMEDIA_CODEC_VIDEO(self)->in.height));
+ CHECK_HR(hr = self->decoder.pInst->Initialize(
+ TMEDIA_CODEC_VIDEO(self)->in.fps,
+ TMEDIA_CODEC_VIDEO(self)->in.width,
+ TMEDIA_CODEC_VIDEO(self)->in.height));
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
int mf_codec_h264_close_decoder(mf_codec_h264_t* self)
{
- if(self){
- SafeRelease(&self->decoder.pInst);
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_pos = 0;
- }
+ if(self) {
+ SafeRelease(&self->decoder.pInst);
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_pos = 0;
+ }
- return 0;
+ return 0;
}
int mf_codec_h264_init(mf_codec_h264_t* self, profile_idc_t profile)
{
- int ret = 0;
- level_idc_t level;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = tdav_codec_h264_common_init(common))){
- TSK_DEBUG_ERROR("mf_codec_h264_common_init() faile with error code=%d", ret);
- return ret;
- }
-
- if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))){
- TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- return ret;
- }
-
- (self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
- if (MFUtils::IsLowLatencyH264SupportsMaxSliceSize()) {
- common->pack_mode_local = H264_PACKETIZATION_MODE;
- }
- else {
- common->pack_mode_local = Non_Interleaved_Mode;
- }
- common->profile = profile;
- common->level = level;
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
-
- TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_nv12;
- TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_nv12;
-
- self->encoder.quality = 1;
-
- return ret;
+ int ret = 0;
+ level_idc_t level;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = tdav_codec_h264_common_init(common))) {
+ TSK_DEBUG_ERROR("mf_codec_h264_common_init() faile with error code=%d", ret);
+ return ret;
+ }
+
+ if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
+ TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ return ret;
+ }
+
+ (self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
+ if (MFUtils::IsLowLatencyH264SupportsMaxSliceSize()) {
+ common->pack_mode_local = H264_PACKETIZATION_MODE;
+ }
+ else {
+ common->pack_mode_local = Non_Interleaved_Mode;
+ }
+ common->profile = profile;
+ common->level = level;
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
+
+ TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_nv12;
+ TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_nv12;
+
+ self->encoder.quality = 1;
+
+ return ret;
}
int mf_codec_h264_deinit(mf_codec_h264_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- mf_codec_h264_close((tmedia_codec_t*)self);
+ mf_codec_h264_close((tmedia_codec_t*)self);
- return 0;
+ return 0;
} \ No newline at end of file
diff --git a/plugins/pluginWinMF/plugin_win_mf_config.h b/plugins/pluginWinMF/plugin_win_mf_config.h
index f4f692a..e518e37 100755
--- a/plugins/pluginWinMF/plugin_win_mf_config.h
+++ b/plugins/pluginWinMF/plugin_win_mf_config.h
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -48,12 +48,12 @@
# define PLUGIN_WIN_MF_UNDER_X86 1
#endif
-// Guards against C++ name mangling
+// Guards against C++ name mangling
#ifdef __cplusplus
# define PLUGIN_WIN_MF_BEGIN_DECLS extern "C" {
# define PLUGIN_WIN_MF_END_DECLS }
#else
-# define PLUGIN_WIN_MF_BEGIN_DECLS
+# define PLUGIN_WIN_MF_BEGIN_DECLS
# define PLUGIN_WIN_MF_END_DECLS
#endif
@@ -69,7 +69,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // PLUGIN_WIN_MF_CONFIG_H
diff --git a/plugins/pluginWinMF/plugin_win_mf_consumer_audio.cxx b/plugins/pluginWinMF/plugin_win_mf_consumer_audio.cxx
index 026f510..f68f428 100755
--- a/plugins/pluginWinMF/plugin_win_mf_consumer_audio.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_consumer_audio.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -23,11 +23,10 @@
#include "tsk_debug.h"
-typedef struct plugin_win_mf_consumer_audio_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct plugin_win_mf_consumer_audio_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- bool bStarted;
+ bool bStarted;
}
plugin_win_mf_consumer_audio_t;
@@ -35,70 +34,70 @@ plugin_win_mf_consumer_audio_t;
/* ============ Consumer Interface ================= */
static int plugin_win_mf_consumer_audio_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
- int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
+ int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+
+ if(ret == 0) {
- if(ret == 0){
-
- }
+ }
- return ret;
+ return ret;
}
static int plugin_win_mf_consumer_audio_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
+ plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
static int plugin_win_mf_consumer_audio_start(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
+ plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
- pSelf->bStarted = true;
+ pSelf->bStarted = true;
- return 0;
+ return 0;
}
static int plugin_win_mf_consumer_audio_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- if(!self || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* buffer is already decoded */
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
+ if(!self || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* buffer is already decoded */
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
}
static int plugin_win_mf_consumer_audio_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int plugin_win_mf_consumer_audio_stop(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
-
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!pSelf->bStarted){
- TSK_DEBUG_INFO("WinMF audio consumer not started");
- return 0;
- }
-
- /* should be done here */
- pSelf->bStarted = false;
-
- return 0;
+ plugin_win_mf_consumer_audio_t* pSelf = (plugin_win_mf_consumer_audio_t*)self;
+
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("WinMF audio consumer not started");
+ return 0;
+ }
+
+ /* should be done here */
+ pSelf->bStarted = false;
+
+ return 0;
}
@@ -108,56 +107,54 @@ static int plugin_win_mf_consumer_audio_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* plugin_win_mf_consumer_audio_ctor(tsk_object_t * self, va_list * app)
{
- MFUtils::Startup();
-
- plugin_win_mf_consumer_audio_t *pSelf = (plugin_win_mf_consumer_audio_t *)self;
- if(pSelf){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(pSelf));
- /* init self */
-
- }
- return self;
+ MFUtils::Startup();
+
+ plugin_win_mf_consumer_audio_t *pSelf = (plugin_win_mf_consumer_audio_t *)self;
+ if(pSelf) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(pSelf));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_mf_consumer_audio_dtor(tsk_object_t * self)
-{
- plugin_win_mf_consumer_audio_t *pSelf = (plugin_win_mf_consumer_audio_t *)self;
- if(pSelf){
- /* stop */
- if(pSelf->bStarted){
- plugin_win_mf_consumer_audio_stop(TMEDIA_CONSUMER(pSelf));
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(pSelf));
- /* deinit self */
-
- }
-
- return self;
+{
+ plugin_win_mf_consumer_audio_t *pSelf = (plugin_win_mf_consumer_audio_t *)self;
+ if(pSelf) {
+ /* stop */
+ if(pSelf->bStarted) {
+ plugin_win_mf_consumer_audio_stop(TMEDIA_CONSUMER(pSelf));
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(pSelf));
+ /* deinit self */
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_mf_consumer_audio_def_s =
-{
- sizeof(plugin_win_mf_consumer_audio_t),
- plugin_win_mf_consumer_audio_ctor,
- plugin_win_mf_consumer_audio_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t plugin_win_mf_consumer_audio_def_s = {
+ sizeof(plugin_win_mf_consumer_audio_t),
+ plugin_win_mf_consumer_audio_ctor,
+ plugin_win_mf_consumer_audio_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_audio_plugin_def_s =
-{
- &plugin_win_mf_consumer_audio_def_s,
-
- tmedia_audio,
- "Windows Media Foundation audio consumer",
-
- plugin_win_mf_consumer_audio_set,
- plugin_win_mf_consumer_audio_prepare,
- plugin_win_mf_consumer_audio_start,
- plugin_win_mf_consumer_audio_consume,
- plugin_win_mf_consumer_audio_pause,
- plugin_win_mf_consumer_audio_stop
+static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_audio_plugin_def_s = {
+ &plugin_win_mf_consumer_audio_def_s,
+
+ tmedia_audio,
+ "Windows Media Foundation audio consumer",
+
+ plugin_win_mf_consumer_audio_set,
+ plugin_win_mf_consumer_audio_prepare,
+ plugin_win_mf_consumer_audio_start,
+ plugin_win_mf_consumer_audio_consume,
+ plugin_win_mf_consumer_audio_pause,
+ plugin_win_mf_consumer_audio_stop
};
const tmedia_consumer_plugin_def_t *plugin_win_mf_consumer_audio_plugin_def_t = &plugin_win_mf_consumer_audio_plugin_def_s;
diff --git a/plugins/pluginWinMF/plugin_win_mf_consumer_video.cxx b/plugins/pluginWinMF/plugin_win_mf_consumer_video.cxx
index f6bef59..ee6eaaa 100755
--- a/plugins/pluginWinMF/plugin_win_mf_consumer_video.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_consumer_video.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -50,20 +50,20 @@
const DWORD NUM_BACK_BUFFERS = 2;
static HRESULT CreateDeviceD3D9(
- HWND hWnd,
- IDirect3DDevice9** ppDevice,
- IDirect3D9 **ppD3D,
- D3DPRESENT_PARAMETERS &d3dpp
- );
+ HWND hWnd,
+ IDirect3DDevice9** ppDevice,
+ IDirect3D9 **ppD3D,
+ D3DPRESENT_PARAMETERS &d3dpp
+);
static HRESULT TestCooperativeLevel(
- struct plugin_win_mf_consumer_video_s *pSelf
- );
+ struct plugin_win_mf_consumer_video_s *pSelf
+);
static HRESULT CreateSwapChain(
- HWND hWnd,
- UINT32 nFrameWidth,
- UINT32 nFrameHeight,
- IDirect3DDevice9* pDevice,
- IDirect3DSwapChain9 **ppSwapChain);
+ HWND hWnd,
+ UINT32 nFrameWidth,
+ UINT32 nFrameHeight,
+ IDirect3DDevice9* pDevice,
+ IDirect3DSwapChain9 **ppSwapChain);
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -81,30 +81,29 @@ static HRESULT UnhookWindow(struct plugin_win_mf_consumer_video_s *pSelf);
-typedef struct plugin_win_mf_consumer_video_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked;
- BOOL bPluginFireFox, bPluginWebRTC4All;
- HWND hWindow;
- WNDPROC wndProc;
- HWND hWindowFullScreen;
- RECT rcWindow;
- RECT rcDest;
- MFRatio pixelAR;
-
- UINT32 nNegWidth;
- UINT32 nNegHeight;
- UINT32 nNegFps;
-
- D3DLOCKED_RECT rcLock;
- IDirect3DDevice9* pDevice;
- IDirect3D9 *pD3D;
- IDirect3DSwapChain9 *pSwapChain;
- D3DPRESENT_PARAMETERS d3dpp;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct plugin_win_mf_consumer_video_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked;
+ BOOL bPluginFireFox, bPluginWebRTC4All;
+ HWND hWindow;
+ WNDPROC wndProc;
+ HWND hWindowFullScreen;
+ RECT rcWindow;
+ RECT rcDest;
+ MFRatio pixelAR;
+
+ UINT32 nNegWidth;
+ UINT32 nNegHeight;
+ UINT32 nNegFps;
+
+ D3DLOCKED_RECT rcLock;
+ IDirect3DDevice9* pDevice;
+ IDirect3D9 *pD3D;
+ IDirect3DSwapChain9 *pSwapChain;
+ D3DPRESENT_PARAMETERS d3dpp;
+
+ TSK_DECLARE_SAFEOBJ;
}
plugin_win_mf_consumer_video_t;
@@ -113,360 +112,331 @@ static int _plugin_win_mf_consumer_video_unprepare(plugin_win_mf_consumer_video_
/* ============ Media Consumer Interface ================= */
static int plugin_win_mf_consumer_video_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- HRESULT hr = S_OK;
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!self || !param)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_POINTER);
- }
-
- if(param->value_type == tmedia_pvt_int64)
- {
- if(tsk_striequals(param->key, "remote-hwnd"))
- {
- HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
- if(hWnd != pSelf->hWindow)
- {
- tsk_safeobj_lock(pSelf); // block consumer thread
- pSelf->hWindow = hWnd;
- if(pSelf->bPrepared)
- {
- hr = ResetDevice(pSelf);
- }
- tsk_safeobj_unlock(pSelf); // unblock consumer thread
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32)
- {
- if(tsk_striequals(param->key, "fullscreen"))
- {
- BOOL bFullScreen = !!*((int32_t*)param->value);
- TSK_DEBUG_INFO("[MF video consumer] Full Screen = %d", bFullScreen);
- CHECK_HR(hr = SetFullscreen(pSelf, bFullScreen));
- }
- else if(tsk_striequals(param->key, "create-on-current-thead"))
- {
- // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox"))
- {
- pSelf->bPluginFireFox = (*((int32_t*)param->value) != 0);
- }
- else if(tsk_striequals(param->key, "plugin-webrtc4all"))
- {
- pSelf->bPluginWebRTC4All = (*((int32_t*)param->value) != 0);
- }
- }
-
- CHECK_HR(hr);
+ int ret = 0;
+ HRESULT hr = S_OK;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "remote-hwnd")) {
+ HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
+ if(hWnd != pSelf->hWindow) {
+ tsk_safeobj_lock(pSelf); // block consumer thread
+ pSelf->hWindow = hWnd;
+ if(pSelf->bPrepared) {
+ hr = ResetDevice(pSelf);
+ }
+ tsk_safeobj_unlock(pSelf); // unblock consumer thread
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "fullscreen")) {
+ BOOL bFullScreen = !!*((int32_t*)param->value);
+ TSK_DEBUG_INFO("[MF video consumer] Full Screen = %d", bFullScreen);
+ CHECK_HR(hr = SetFullscreen(pSelf, bFullScreen));
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ pSelf->bPluginFireFox = (*((int32_t*)param->value) != 0);
+ }
+ else if(tsk_striequals(param->key, "plugin-webrtc4all")) {
+ pSelf->bPluginWebRTC4All = (*((int32_t*)param->value) != 0);
+ }
+ }
+
+ CHECK_HR(hr);
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!pSelf || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(pSelf->bPrepared){
- TSK_DEBUG_WARN("D3D9 video consumer already prepared");
- return -1;
- }
-
- // FIXME: DirectShow requires flipping but not D3D9
- // The Core library always tries to flip when OSType==Win32. Must be changed
- TMEDIA_CODEC_VIDEO(codec)->in.flip = tsk_false;
-
- HRESULT hr = S_OK;
- HWND hWnd = Window(pSelf);
-
- TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if(!TMEDIA_CONSUMER(pSelf)->video.display.width){
- TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(pSelf)->video.display.height){
- TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
- }
-
- pSelf->nNegFps = TMEDIA_CONSUMER(pSelf)->video.fps;
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.height;
-
- TSK_DEBUG_INFO("D3D9 video consumer: fps=%d, width=%d, height=%d",
- pSelf->nNegFps,
- pSelf->nNegWidth,
- pSelf->nNegHeight);
-
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- // The window handle is not created until the call is connect (incoming only) - At least on Internet Explorer 10
- if(hWnd && !pSelf->bPluginWebRTC4All)
- {
- CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
- else
- {
- if(hWnd && pSelf->bPluginWebRTC4All)
- {
- TSK_DEBUG_INFO("[MF consumer] HWND is defined but we detected webrtc4all...delaying D3D9 device creating until session get connected");
- }
- else
- {
- TSK_DEBUG_WARN("Delaying D3D9 device creation because HWND is not defined yet");
- }
- }
-
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!pSelf || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(pSelf->bPrepared) {
+ TSK_DEBUG_WARN("D3D9 video consumer already prepared");
+ return -1;
+ }
+
+ // FIXME: DirectShow requires flipping but not D3D9
+ // The Core library always tries to flip when OSType==Win32. Must be changed
+ TMEDIA_CODEC_VIDEO(codec)->in.flip = tsk_false;
+
+ HRESULT hr = S_OK;
+ HWND hWnd = Window(pSelf);
+
+ TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.width) {
+ TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.height) {
+ TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
+ }
+
+ pSelf->nNegFps = TMEDIA_CONSUMER(pSelf)->video.fps;
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.display.height;
+
+ TSK_DEBUG_INFO("D3D9 video consumer: fps=%d, width=%d, height=%d",
+ pSelf->nNegFps,
+ pSelf->nNegWidth,
+ pSelf->nNegHeight);
+
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ // The window handle is not created until the call is connect (incoming only) - At least on Internet Explorer 10
+ if(hWnd && !pSelf->bPluginWebRTC4All) {
+ CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
+ else {
+ if(hWnd && pSelf->bPluginWebRTC4All) {
+ TSK_DEBUG_INFO("[MF consumer] HWND is defined but we detected webrtc4all...delaying D3D9 device creating until session get connected");
+ }
+ else {
+ TSK_DEBUG_WARN("Delaying D3D9 device creation because HWND is not defined yet");
+ }
+ }
+
bail:
- pSelf->bPrepared = SUCCEEDED(hr);
- return pSelf->bPrepared ? 0 : -1;
+ pSelf->bPrepared = SUCCEEDED(hr);
+ return pSelf->bPrepared ? 0 : -1;
}
static int plugin_win_mf_consumer_video_start(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(pSelf->bStarted){
- TSK_DEBUG_INFO("D3D9 video consumer already started");
- return 0;
- }
- if(!pSelf->bPrepared){
- TSK_DEBUG_ERROR("D3D9 video consumer not prepared");
- return -1;
- }
-
- HRESULT hr = S_OK;
-
- pSelf->bPaused = false;
- pSelf->bStarted = true;
-
- return SUCCEEDED(hr) ? 0 : -1;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(pSelf->bStarted) {
+ TSK_DEBUG_INFO("D3D9 video consumer already started");
+ return 0;
+ }
+ if(!pSelf->bPrepared) {
+ TSK_DEBUG_ERROR("D3D9 video consumer not prepared");
+ return -1;
+ }
+
+ HRESULT hr = S_OK;
+
+ pSelf->bPaused = false;
+ pSelf->bStarted = true;
+
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
- HRESULT hr = S_OK;
- HWND hWnd = Window(pSelf);
+ HRESULT hr = S_OK;
+ HWND hWnd = Window(pSelf);
- IDirect3DSurface9 *pSurf = NULL;
+ IDirect3DSurface9 *pSurf = NULL;
IDirect3DSurface9 *pBB = NULL;
- if(!pSelf)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1; // because of the mutex lock do it here
- }
-
- tsk_safeobj_lock(pSelf);
-
- if(!buffer || !size)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_INVALIDARG);
- }
-
- if(!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("D3D9 video consumer not started");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(!hWnd)
- {
- TSK_DEBUG_INFO("Do not draw frame because HWND not set");
- goto bail; // not an error as the application can decide to set the HWND at any time
- }
-
- if (!pSelf->bWindowHooked)
- {
- // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
- CHECK_HR(hr = HookWindow(pSelf, pSelf->hWindow));
- }
-
- if(!pSelf->pDevice || !pSelf->pD3D || !pSelf->pSwapChain)
- {
- if(pSelf->pDevice || pSelf->pD3D || pSelf->pSwapChain)
- {
- CHECK_HR(hr = E_POINTER); // They must be "all null" or "all valid"
- }
-
- if(hWnd)
- {
- // means HWND was not set but defined now
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
-
- CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
- }
-
- if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height){
- TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
- pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
- pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
- // Update media type
-
- SafeRelease(&pSelf->pSwapChain);
- CHECK_HR(hr = CreateSwapChain(hWnd, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height, pSelf->pDevice, &pSelf->pSwapChain));
-
- pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
- pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
-
- // Update Destination will do noting if the window size haven't changed.
- // Force updating the destination rect if negotiated size change
- CHECK_HR(hr = UpdateDestinationRect(pSelf, TRUE/* Force */));
- }
-
- CHECK_HR(hr = TestCooperativeLevel(pSelf));
-
- CHECK_HR(hr = UpdateDestinationRect(pSelf));
-
- CHECK_HR(hr = pSelf->pSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pSurf));
- CHECK_HR(hr = pSurf->LockRect(&pSelf->rcLock, NULL, D3DLOCK_NOSYSLOCK ));
-
- // Fast copy() using MMX, SSE, or SSE2
- hr = MFCopyImage(
- (BYTE*)pSelf->rcLock.pBits,
- pSelf->rcLock.Pitch,
- (BYTE*)buffer,
- (pSelf->nNegWidth << 2),
- (pSelf->nNegWidth << 2),
- pSelf->nNegHeight
- );
- if(FAILED(hr))
- {
- // unlock() before leaving
- pSurf->UnlockRect();
- CHECK_HR(hr);
- }
-
- CHECK_HR(hr = pSurf->UnlockRect());
-
- // Color fill the back buffer
- CHECK_HR(hr = pSelf->pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBB));
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1; // because of the mutex lock do it here
+ }
+
+ tsk_safeobj_lock(pSelf);
+
+ if(!buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("D3D9 video consumer not started");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(!hWnd) {
+ TSK_DEBUG_INFO("Do not draw frame because HWND not set");
+ goto bail; // not an error as the application can decide to set the HWND at any time
+ }
+
+ if (!pSelf->bWindowHooked) {
+ // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
+ CHECK_HR(hr = HookWindow(pSelf, pSelf->hWindow));
+ }
+
+ if(!pSelf->pDevice || !pSelf->pD3D || !pSelf->pSwapChain) {
+ if(pSelf->pDevice || pSelf->pD3D || pSelf->pSwapChain) {
+ CHECK_HR(hr = E_POINTER); // They must be "all null" or "all valid"
+ }
+
+ if(hWnd) {
+ // means HWND was not set but defined now
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
+
+ CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
+ }
+
+ if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height) {
+ TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
+ pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
+ pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
+ // Update media type
+
+ SafeRelease(&pSelf->pSwapChain);
+ CHECK_HR(hr = CreateSwapChain(hWnd, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width, (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height, pSelf->pDevice, &pSelf->pSwapChain));
+
+ pSelf->nNegWidth = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.width;
+ pSelf->nNegHeight = (UINT32)TMEDIA_CONSUMER(pSelf)->video.in.height;
+
+ // Update Destination will do noting if the window size haven't changed.
+ // Force updating the destination rect if negotiated size change
+ CHECK_HR(hr = UpdateDestinationRect(pSelf, TRUE/* Force */));
+ }
+
+ CHECK_HR(hr = TestCooperativeLevel(pSelf));
+
+ CHECK_HR(hr = UpdateDestinationRect(pSelf));
+
+ CHECK_HR(hr = pSelf->pSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pSurf));
+ CHECK_HR(hr = pSurf->LockRect(&pSelf->rcLock, NULL, D3DLOCK_NOSYSLOCK ));
+
+ // Fast copy() using MMX, SSE, or SSE2
+ hr = MFCopyImage(
+ (BYTE*)pSelf->rcLock.pBits,
+ pSelf->rcLock.Pitch,
+ (BYTE*)buffer,
+ (pSelf->nNegWidth << 2),
+ (pSelf->nNegWidth << 2),
+ pSelf->nNegHeight
+ );
+ if(FAILED(hr)) {
+ // unlock() before leaving
+ pSurf->UnlockRect();
+ CHECK_HR(hr);
+ }
+
+ CHECK_HR(hr = pSurf->UnlockRect());
+
+ // Color fill the back buffer
+ CHECK_HR(hr = pSelf->pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBB));
#if METROPOLIS
- CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0x00, 0x00, 0x00)));
+ CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0x00, 0x00, 0x00)));
#else
- CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF)));
+ CHECK_HR(hr = pSelf->pDevice->ColorFill(pBB, NULL, D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF)));
#endif
-
- // Resize keeping aspect ratio and Blit the frame (required)
- hr = pSelf->pDevice->StretchRect(
- pSurf,
- NULL,
- pBB,
- &pSelf->rcDest/*NULL*/,
- D3DTEXF_LINEAR
- ); // could fail when display is being resized
- if(SUCCEEDED(hr))
- {
- // Present the frame
- CHECK_HR(hr = pSelf->pDevice->Present(NULL, NULL, NULL, NULL));
- }
- else
- {
- TSK_DEBUG_INFO("StretchRect returned ...%x", hr);
- }
+
+ // Resize keeping aspect ratio and Blit the frame (required)
+ hr = pSelf->pDevice->StretchRect(
+ pSurf,
+ NULL,
+ pBB,
+ &pSelf->rcDest/*NULL*/,
+ D3DTEXF_LINEAR
+ ); // could fail when display is being resized
+ if(SUCCEEDED(hr)) {
+ // Present the frame
+ CHECK_HR(hr = pSelf->pDevice->Present(NULL, NULL, NULL, NULL));
+ }
+ else {
+ TSK_DEBUG_INFO("StretchRect returned ...%x", hr);
+ }
bail:
- SafeRelease(&pSurf);
- SafeRelease(&pBB);
+ SafeRelease(&pSurf);
+ SafeRelease(&pBB);
- tsk_safeobj_unlock(pSelf);
+ tsk_safeobj_unlock(pSelf);
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_pause(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("MF video producer not started");
- return 0;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video producer not started");
+ return 0;
+ }
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- pSelf->bPaused = true;
+ pSelf->bPaused = true;
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_stop(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
- if(!pSelf){
+ if(!pSelf) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- HRESULT hr = S_OK;
-
+ HRESULT hr = S_OK;
+
pSelf->bStarted = false;
- pSelf->bPaused = false;
+ pSelf->bPaused = false;
- if(pSelf->hWindowFullScreen)
- {
- ::InvalidateRect(pSelf->hWindowFullScreen, NULL, FALSE);
- ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
- }
+ if(pSelf->hWindowFullScreen) {
+ ::InvalidateRect(pSelf->hWindowFullScreen, NULL, FALSE);
+ ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
+ }
- // next start() will be called after prepare()
- return _plugin_win_mf_consumer_video_unprepare(pSelf);
+ // next start() will be called after prepare()
+ return _plugin_win_mf_consumer_video_unprepare(pSelf);
}
static int _plugin_win_mf_consumer_video_unprepare(plugin_win_mf_consumer_video_t* pSelf)
{
- if(!pSelf)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- UnhookWindow(pSelf);
+ UnhookWindow(pSelf);
- if(pSelf->bStarted)
- {
- // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
- TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
- return -1;
- }
+ if(pSelf->bStarted) {
+ // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
+ TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
+ return -1;
+ }
- SafeRelease(&pSelf->pDevice);
- SafeRelease(&pSelf->pD3D);
- SafeRelease(&pSelf->pSwapChain);
+ SafeRelease(&pSelf->pDevice);
+ SafeRelease(&pSelf->pD3D);
+ SafeRelease(&pSelf->pSwapChain);
- pSelf->bPrepared = false;
+ pSelf->bPrepared = false;
- return 0;
+ return 0;
}
@@ -476,192 +446,179 @@ static int _plugin_win_mf_consumer_video_unprepare(plugin_win_mf_consumer_video_
/* constructor */
static tsk_object_t* plugin_win_mf_consumer_video_ctor(tsk_object_t * self, va_list * app)
{
- MFUtils::Startup();
-
- plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
- if(pSelf){
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- /* init self */
- tsk_safeobj_init(pSelf);
- TMEDIA_CONSUMER(pSelf)->video.fps = 15;
- TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
-
- pSelf->pixelAR.Denominator = pSelf->pixelAR.Numerator = 1;
- }
- return self;
+ MFUtils::Startup();
+
+ plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
+ if(pSelf) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ /* init self */
+ tsk_safeobj_init(pSelf);
+ TMEDIA_CONSUMER(pSelf)->video.fps = 15;
+ TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
+
+ pSelf->pixelAR.Denominator = pSelf->pixelAR.Numerator = 1;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_mf_consumer_video_dtor(tsk_object_t * self)
-{
- plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
- if(pSelf){
- /* stop */
- if(pSelf->bStarted)
- {
- plugin_win_mf_consumer_video_stop(TMEDIA_CONSUMER(pSelf));
- }
-
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
- /* deinit self */
- _plugin_win_mf_consumer_video_unprepare(pSelf);
- tsk_safeobj_deinit(pSelf);
- }
-
- return self;
+{
+ plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
+ if(pSelf) {
+ /* stop */
+ if(pSelf->bStarted) {
+ plugin_win_mf_consumer_video_stop(TMEDIA_CONSUMER(pSelf));
+ }
+
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
+ /* deinit self */
+ _plugin_win_mf_consumer_video_unprepare(pSelf);
+ tsk_safeobj_deinit(pSelf);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_mf_consumer_video_def_s =
-{
- sizeof(plugin_win_mf_consumer_video_t),
- plugin_win_mf_consumer_video_ctor,
- plugin_win_mf_consumer_video_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_win_mf_consumer_video_def_s = {
+ sizeof(plugin_win_mf_consumer_video_t),
+ plugin_win_mf_consumer_video_ctor,
+ plugin_win_mf_consumer_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_video_plugin_def_s =
-{
- &plugin_win_mf_consumer_video_def_s,
-
- tmedia_video,
- "D3D9 video consumer",
-
- plugin_win_mf_consumer_video_set,
- plugin_win_mf_consumer_video_prepare,
- plugin_win_mf_consumer_video_start,
- plugin_win_mf_consumer_video_consume,
- plugin_win_mf_consumer_video_pause,
- plugin_win_mf_consumer_video_stop
+static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_video_plugin_def_s = {
+ &plugin_win_mf_consumer_video_def_s,
+
+ tmedia_video,
+ "D3D9 video consumer",
+
+ plugin_win_mf_consumer_video_set,
+ plugin_win_mf_consumer_video_prepare,
+ plugin_win_mf_consumer_video_start,
+ plugin_win_mf_consumer_video_consume,
+ plugin_win_mf_consumer_video_pause,
+ plugin_win_mf_consumer_video_stop
};
const tmedia_consumer_plugin_def_t *plugin_win_mf_consumer_video_plugin_def_t = &plugin_win_mf_consumer_video_plugin_def_s;
// Helper functions
static HRESULT CreateDeviceD3D9(
- HWND hWnd,
- IDirect3DDevice9** ppDevice,
- IDirect3D9 **ppD3D,
- D3DPRESENT_PARAMETERS &d3dpp
- )
+ HWND hWnd,
+ IDirect3DDevice9** ppDevice,
+ IDirect3D9 **ppD3D,
+ D3DPRESENT_PARAMETERS &d3dpp
+)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
D3DDISPLAYMODE mode = { 0 };
- D3DPRESENT_PARAMETERS pp = {0};
-
- if(!ppDevice || *ppDevice || !ppD3D || *ppD3D)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!(*ppD3D = Direct3DCreate9(D3D_SDK_VERSION)))
- {
+ D3DPRESENT_PARAMETERS pp = {0};
+
+ if(!ppDevice || *ppDevice || !ppD3D || *ppD3D) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!(*ppD3D = Direct3DCreate9(D3D_SDK_VERSION))) {
CHECK_HR(hr = E_OUTOFMEMORY);
}
CHECK_HR(hr = (*ppD3D)->GetAdapterDisplayMode(
- D3DADAPTER_DEFAULT,
- &mode
- ));
+ D3DADAPTER_DEFAULT,
+ &mode
+ ));
CHECK_HR(hr = (*ppD3D)->CheckDeviceType(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- mode.Format,
- D3DFMT_X8R8G8B8,
- TRUE // windowed
- ));
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ mode.Format,
+ D3DFMT_X8R8G8B8,
+ TRUE // windowed
+ ));
pp.BackBufferFormat = D3DFMT_X8R8G8B8;
pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- pp.Windowed = TRUE;
+ pp.Windowed = TRUE;
pp.hDeviceWindow = hWnd;
CHECK_HR(hr = (*ppD3D)->CreateDevice(
- D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- hWnd,
- D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &pp,
- ppDevice
- ));
+ D3DADAPTER_DEFAULT,
+ D3DDEVTYPE_HAL,
+ hWnd,
+ D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &pp,
+ ppDevice
+ ));
- d3dpp = pp;
+ d3dpp = pp;
bail:
- if(FAILED(hr))
- {
- SafeRelease(ppD3D);
- SafeRelease(ppDevice);
- }
+ if(FAILED(hr)) {
+ SafeRelease(ppD3D);
+ SafeRelease(ppDevice);
+ }
return hr;
}
static HRESULT TestCooperativeLevel(
- struct plugin_win_mf_consumer_video_s *pSelf
- )
+ struct plugin_win_mf_consumer_video_s *pSelf
+)
{
- HRESULT hr = S_OK;
-
- if (!pSelf || !pSelf->pDevice)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- switch((hr = pSelf->pDevice->TestCooperativeLevel()))
- {
- case D3D_OK:
- {
- break;
- }
-
- case D3DERR_DEVICELOST:
- {
- hr = S_OK;
- break;
- }
-
- case D3DERR_DEVICENOTRESET:
- {
- hr = ResetDevice(pSelf, TRUE);
- break;
- }
-
- default:
- {
- break;
- }
- }
-
- CHECK_HR(hr);
+ HRESULT hr = S_OK;
+
+ if (!pSelf || !pSelf->pDevice) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ switch((hr = pSelf->pDevice->TestCooperativeLevel())) {
+ case D3D_OK: {
+ break;
+ }
+
+ case D3DERR_DEVICELOST: {
+ hr = S_OK;
+ break;
+ }
+
+ case D3DERR_DEVICENOTRESET: {
+ hr = ResetDevice(pSelf, TRUE);
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
+
+ CHECK_HR(hr);
bail:
return hr;
}
static HRESULT CreateSwapChain(
- HWND hWnd,
- UINT32 nFrameWidth,
- UINT32 nFrameHeight,
- IDirect3DDevice9* pDevice,
- IDirect3DSwapChain9 **ppSwapChain
- )
+ HWND hWnd,
+ UINT32 nFrameWidth,
+ UINT32 nFrameHeight,
+ IDirect3DDevice9* pDevice,
+ IDirect3DSwapChain9 **ppSwapChain
+)
{
HRESULT hr = S_OK;
D3DPRESENT_PARAMETERS pp = { 0 };
- if(!pDevice || !ppSwapChain || *ppSwapChain)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- pp.BackBufferWidth = nFrameWidth;
+ if(!pDevice || !ppSwapChain || *ppSwapChain) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ pp.BackBufferWidth = nFrameWidth;
pp.BackBufferHeight = nFrameHeight;
pp.Windowed = TRUE;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
@@ -673,7 +630,7 @@ static HRESULT CreateSwapChain(
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
pp.BackBufferCount = NUM_BACK_BUFFERS;
- CHECK_HR(hr = pDevice->CreateAdditionalSwapChain(&pp, ppSwapChain));
+ CHECK_HR(hr = pDevice->CreateAdditionalSwapChain(&pp, ppSwapChain));
bail:
return hr;
@@ -681,7 +638,7 @@ bail:
static inline HWND Window(struct plugin_win_mf_consumer_video_s *pSelf)
{
- return pSelf ? (pSelf->bFullScreen ? pSelf->hWindowFullScreen : pSelf->hWindow) : NULL;
+ return pSelf ? (pSelf->bFullScreen ? pSelf->hWindowFullScreen : pSelf->hWindow) : NULL;
}
static inline LONG Width(const RECT& r)
@@ -710,17 +667,14 @@ static inline RECT CorrectAspectRatio(const RECT& src, const MFRatio& srcPAR)
// Start with a rectangle the same size as src, but offset to the origin (0,0).
RECT rc = {0, 0, src.right - src.left, src.bottom - src.top};
- if ((srcPAR.Numerator != 1) || (srcPAR.Denominator != 1))
- {
+ if ((srcPAR.Numerator != 1) || (srcPAR.Denominator != 1)) {
// Correct for the source's PAR.
- if (srcPAR.Numerator > srcPAR.Denominator)
- {
+ if (srcPAR.Numerator > srcPAR.Denominator) {
// The source has "wide" pixels, so stretch the width.
rc.right = MulDiv(rc.right, srcPAR.Numerator, srcPAR.Denominator);
}
- else if (srcPAR.Numerator < srcPAR.Denominator)
- {
+ else if (srcPAR.Numerator < srcPAR.Denominator) {
// The source has "tall" pixels, so stretch the height.
rc.bottom = MulDiv(rc.bottom, srcPAR.Denominator, srcPAR.Numerator);
}
@@ -783,236 +737,214 @@ static inline RECT LetterBoxRect(const RECT& rcSrc, const RECT& rcDst)
static inline HRESULT UpdateDestinationRect(plugin_win_mf_consumer_video_t *pSelf, BOOL bForce /*= FALSE*/)
{
- HRESULT hr = S_OK;
- HWND hwnd = Window(pSelf);
-
- if(!pSelf)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(!hwnd)
- {
- CHECK_HR(hr = E_HANDLE);
- }
+ HRESULT hr = S_OK;
+ HWND hwnd = Window(pSelf);
+
+ if(!pSelf) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(!hwnd) {
+ CHECK_HR(hr = E_HANDLE);
+ }
RECT rcClient;
- GetClientRect(hwnd, &rcClient);
+ GetClientRect(hwnd, &rcClient);
- // only update destination if window size changed
- if(bForce || (rcClient.bottom != pSelf->rcWindow.bottom || rcClient.left != pSelf->rcWindow.left || rcClient.right != pSelf->rcWindow.right || rcClient.top != pSelf->rcWindow.top))
- {
- CHECK_HR(hr = ResetDevice(pSelf));
+ // only update destination if window size changed
+ if(bForce || (rcClient.bottom != pSelf->rcWindow.bottom || rcClient.left != pSelf->rcWindow.left || rcClient.right != pSelf->rcWindow.right || rcClient.top != pSelf->rcWindow.top)) {
+ CHECK_HR(hr = ResetDevice(pSelf));
- pSelf->rcWindow = rcClient;
+ pSelf->rcWindow = rcClient;
#if 1
- RECT rcSrc = { 0, 0, pSelf->nNegWidth, pSelf->nNegHeight };
- rcSrc = CorrectAspectRatio(rcSrc, pSelf->pixelAR);
- pSelf->rcDest = LetterBoxRect(rcSrc, rcClient);
+ RECT rcSrc = { 0, 0, pSelf->nNegWidth, pSelf->nNegHeight };
+ rcSrc = CorrectAspectRatio(rcSrc, pSelf->pixelAR);
+ pSelf->rcDest = LetterBoxRect(rcSrc, rcClient);
#else
- long w = rcClient.right - rcClient.left;
- long h = rcClient.bottom - rcClient.top;
- float ratio = ((float)pSelf->nNegWidth/(float)pSelf->nNegHeight);
- // (w/h)=ratio =>
- // 1) h=w/ratio
- // and
- // 2) w=h*ratio
- pSelf->rcDest.right = (int)(w/ratio) > h ? (int)(h * ratio) : w;
- pSelf->rcDest.bottom = (int)(pSelf->rcDest.right/ratio) > h ? h : (int)(pSelf->rcDest.right/ratio);
- pSelf->rcDest.left = ((w - pSelf->rcDest.right) >> 1);
- pSelf->rcDest.top = ((h - pSelf->rcDest.bottom) >> 1);
+ long w = rcClient.right - rcClient.left;
+ long h = rcClient.bottom - rcClient.top;
+ float ratio = ((float)pSelf->nNegWidth/(float)pSelf->nNegHeight);
+ // (w/h)=ratio =>
+ // 1) h=w/ratio
+ // and
+ // 2) w=h*ratio
+ pSelf->rcDest.right = (int)(w/ratio) > h ? (int)(h * ratio) : w;
+ pSelf->rcDest.bottom = (int)(pSelf->rcDest.right/ratio) > h ? h : (int)(pSelf->rcDest.right/ratio);
+ pSelf->rcDest.left = ((w - pSelf->rcDest.right) >> 1);
+ pSelf->rcDest.top = ((h - pSelf->rcDest.bottom) >> 1);
#endif
- //::InvalidateRect(hwnd, NULL, FALSE);
- }
+ //::InvalidateRect(hwnd, NULL, FALSE);
+ }
bail:
- return hr;
+ return hr;
}
static HRESULT ResetDevice(plugin_win_mf_consumer_video_t *pSelf, BOOL bUpdateDestinationRect /*= FALSE*/)
{
HRESULT hr = S_OK;
- tsk_safeobj_lock(pSelf);
+ tsk_safeobj_lock(pSelf);
- HWND hWnd = Window(pSelf);
+ HWND hWnd = Window(pSelf);
- if (pSelf->pDevice)
- {
+ if (pSelf->pDevice) {
D3DPRESENT_PARAMETERS d3dpp = pSelf->d3dpp;
hr = pSelf->pDevice->Reset(&d3dpp);
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
SafeRelease(&pSelf->pDevice);
- SafeRelease(&pSelf->pD3D);
- SafeRelease(&pSelf->pSwapChain);
+ SafeRelease(&pSelf->pD3D);
+ SafeRelease(&pSelf->pSwapChain);
}
}
- if (pSelf->pDevice == NULL && hWnd)
- {
+ if (pSelf->pDevice == NULL && hWnd) {
CHECK_HR(hr = CreateDeviceD3D9(hWnd, &pSelf->pDevice, &pSelf->pD3D, pSelf->d3dpp));
- CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
- }
+ CHECK_HR(hr = CreateSwapChain(hWnd, pSelf->nNegWidth, pSelf->nNegHeight, pSelf->pDevice, &pSelf->pSwapChain));
+ }
- if(bUpdateDestinationRect) // endless loop guard
- {
- CHECK_HR(hr = UpdateDestinationRect(pSelf));
- }
+ if(bUpdateDestinationRect) { // endless loop guard
+ CHECK_HR(hr = UpdateDestinationRect(pSelf));
+ }
bail:
- tsk_safeobj_unlock(pSelf);
+ tsk_safeobj_unlock(pSelf);
- return hr;
+ return hr;
}
static HRESULT SetFullscreen(struct plugin_win_mf_consumer_video_s *pSelf, BOOL bFullScreen)
{
- HRESULT hr = S_OK;
- if(!pSelf)
- {
- CHECK_HR(hr = E_POINTER);
- }
-
- if(pSelf->bFullScreen != bFullScreen)
- {
- tsk_safeobj_lock(pSelf);
- if(bFullScreen)
- {
- HWND hWnd = CreateFullScreenWindow(pSelf);
- if(hWnd)
- {
- ::ShowWindow(hWnd, SW_SHOWDEFAULT);
- ::UpdateWindow(hWnd);
- }
- }
- else if(pSelf->hWindowFullScreen)
- {
- ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
- }
- pSelf->bFullScreen = bFullScreen;
- if(pSelf->bPrepared)
- {
- hr = ResetDevice(pSelf);
- }
- tsk_safeobj_unlock(pSelf);
-
- CHECK_HR(hr);
- }
+ HRESULT hr = S_OK;
+ if(!pSelf) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if(pSelf->bFullScreen != bFullScreen) {
+ tsk_safeobj_lock(pSelf);
+ if(bFullScreen) {
+ HWND hWnd = CreateFullScreenWindow(pSelf);
+ if(hWnd) {
+ ::ShowWindow(hWnd, SW_SHOWDEFAULT);
+ ::UpdateWindow(hWnd);
+ }
+ }
+ else if(pSelf->hWindowFullScreen) {
+ ::ShowWindow(pSelf->hWindowFullScreen, SW_HIDE);
+ }
+ pSelf->bFullScreen = bFullScreen;
+ if(pSelf->bPrepared) {
+ hr = ResetDevice(pSelf);
+ }
+ tsk_safeobj_unlock(pSelf);
+
+ CHECK_HR(hr);
+ }
bail:
- return hr;
+ return hr;
}
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_CREATE:
- case WM_SIZE:
- case WM_MOVE:
- {
- struct plugin_win_mf_consumer_video_s* pSelf = dynamic_cast<struct plugin_win_mf_consumer_video_s*>((struct plugin_win_mf_consumer_video_s*)GetPropA(hWnd, "Self"));
- if (pSelf)
- {
-
- }
- break;
- }
-
- case WM_ERASEBKGND:
- {
- return TRUE; // avoid background erasing.
- }
-
- case WM_CHAR:
- case WM_KEYUP:
- {
- struct plugin_win_mf_consumer_video_s* pSelf = dynamic_cast<struct plugin_win_mf_consumer_video_s*>((struct plugin_win_mf_consumer_video_s*)GetPropA(hWnd, "Self"));
- if (pSelf)
- {
- SetFullscreen(pSelf, FALSE);
- }
-
- break;
- }
- }
-
- return DefWindowProc(hWnd, uMsg, wParam, lParam);
+ switch(uMsg) {
+ case WM_CREATE:
+ case WM_SIZE:
+ case WM_MOVE: {
+ struct plugin_win_mf_consumer_video_s* pSelf = dynamic_cast<struct plugin_win_mf_consumer_video_s*>((struct plugin_win_mf_consumer_video_s*)GetPropA(hWnd, "Self"));
+ if (pSelf) {
+
+ }
+ break;
+ }
+
+ case WM_ERASEBKGND: {
+ return TRUE; // avoid background erasing.
+ }
+
+ case WM_CHAR:
+ case WM_KEYUP: {
+ struct plugin_win_mf_consumer_video_s* pSelf = dynamic_cast<struct plugin_win_mf_consumer_video_s*>((struct plugin_win_mf_consumer_video_s*)GetPropA(hWnd, "Self"));
+ if (pSelf) {
+ SetFullscreen(pSelf, FALSE);
+ }
+
+ break;
+ }
+ }
+
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
static HWND CreateFullScreenWindow(struct plugin_win_mf_consumer_video_s *pSelf)
{
- HRESULT hr = S_OK;
-
- if(!pSelf)
- {
- return NULL;
- }
-
- if(!pSelf->hWindowFullScreen)
- {
- WNDCLASS wc = {0};
-
- wc.lpfnWndProc = WndProc;
- wc.hInstance = GetModuleHandle(NULL);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.lpszClassName = L"WindowClass";
- RegisterClass(&wc);
- pSelf->hWindowFullScreen = ::CreateWindowEx(
- NULL,
- wc.lpszClassName,
- L"Doubango's Video Consumer Fullscreen",
- WS_EX_TOPMOST | WS_POPUP,
- 0, 0,
- GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
- NULL,
- NULL,
- GetModuleHandle(NULL),
- NULL);
-
- SetPropA(pSelf->hWindowFullScreen, "Self", pSelf);
- }
- return pSelf->hWindowFullScreen;
+ HRESULT hr = S_OK;
+
+ if(!pSelf) {
+ return NULL;
+ }
+
+ if(!pSelf->hWindowFullScreen) {
+ WNDCLASS wc = {0};
+
+ wc.lpfnWndProc = WndProc;
+ wc.hInstance = GetModuleHandle(NULL);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.lpszClassName = L"WindowClass";
+ RegisterClass(&wc);
+ pSelf->hWindowFullScreen = ::CreateWindowEx(
+ NULL,
+ wc.lpszClassName,
+ L"Doubango's Video Consumer Fullscreen",
+ WS_EX_TOPMOST | WS_POPUP,
+ 0, 0,
+ GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
+ NULL,
+ NULL,
+ GetModuleHandle(NULL),
+ NULL);
+
+ SetPropA(pSelf->hWindowFullScreen, "Self", pSelf);
+ }
+ return pSelf->hWindowFullScreen;
}
static HRESULT HookWindow(plugin_win_mf_consumer_video_s *pSelf, HWND hWnd)
{
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- tsk_safeobj_lock(pSelf);
+ tsk_safeobj_lock(pSelf);
- CHECK_HR(hr = UnhookWindow(pSelf));
+ CHECK_HR(hr = UnhookWindow(pSelf));
- if ((pSelf->hWindow = hWnd)) {
- pSelf->wndProc = (WNDPROC)SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)WndProc);
- if (!pSelf->wndProc) {
- TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
- CHECK_HR(hr = E_FAIL);
- }
- pSelf->bWindowHooked = TRUE;
- }
+ if ((pSelf->hWindow = hWnd)) {
+ pSelf->wndProc = (WNDPROC)SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)WndProc);
+ if (!pSelf->wndProc) {
+ TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
+ CHECK_HR(hr = E_FAIL);
+ }
+ pSelf->bWindowHooked = TRUE;
+ }
bail:
- tsk_safeobj_unlock(pSelf);
- return S_OK;
+ tsk_safeobj_unlock(pSelf);
+ return S_OK;
}
static HRESULT UnhookWindow(struct plugin_win_mf_consumer_video_s *pSelf)
{
- tsk_safeobj_lock(pSelf);
- if (pSelf->hWindow && pSelf->wndProc) {
- SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)pSelf->wndProc);
- pSelf->wndProc = NULL;
- }
- if(pSelf->hWindow)
- {
- ::InvalidateRect(pSelf->hWindow, NULL, FALSE);
- }
- pSelf->bWindowHooked = FALSE;
- tsk_safeobj_unlock(pSelf);
- return S_OK;
+ tsk_safeobj_lock(pSelf);
+ if (pSelf->hWindow && pSelf->wndProc) {
+ SetWindowLongPtr(pSelf->hWindow, GWLP_WNDPROC, (LONG_PTR)pSelf->wndProc);
+ pSelf->wndProc = NULL;
+ }
+ if(pSelf->hWindow) {
+ ::InvalidateRect(pSelf->hWindow, NULL, FALSE);
+ }
+ pSelf->bWindowHooked = FALSE;
+ tsk_safeobj_unlock(pSelf);
+ return S_OK;
}
@@ -1038,39 +970,38 @@ static HRESULT UnhookWindow(struct plugin_win_mf_consumer_video_s *pSelf)
// To avoid chroma conversion (performance issues) we use NV12 when the codec is bundled as MediaFoundation codecs most likely only support this format.
// NV12 is the native format for media foundation codecs (e.g. Intel Quick Sync) and the GPU.
// I420 is the native format for FFmpeg, libvpx and libtheora.
-const GUID kDefaultUncompressedType
+const GUID kDefaultUncompressedType
#if PLUGIN_MF_CV_BUNDLE_CODEC
-= MFVideoFormat_NV12;
+ = MFVideoFormat_NV12;
#else
-= MFVideoFormat_I420;
+ = MFVideoFormat_I420;
#endif
DEFINE_GUID(PLUGIN_MF_LOW_LATENCY,
-0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
+ 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
static void* TSK_STDCALL RunSessionThread(void *pArg);
static int _plugin_win_mf_consumer_video_unprepare(struct plugin_win_mf_consumer_video_s* pSelf);
-typedef struct plugin_win_mf_consumer_video_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- bool bStarted, bPrepared;
- HWND hWindow;
- tsk_thread_handle_t* ppTread[1];
+typedef struct plugin_win_mf_consumer_video_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ bool bStarted, bPrepared;
+ HWND hWindow;
+ tsk_thread_handle_t* ppTread[1];
- UINT32 nNegWidth;
- UINT32 nNegHeight;
- UINT32 nNegFps;
+ UINT32 nNegWidth;
+ UINT32 nNegHeight;
+ UINT32 nNegFps;
- MFCodecVideo *pDecoder;
+ MFCodecVideo *pDecoder;
IMFMediaSession *pSession;
CMFSource *pSource;
IMFActivate *pSinkActivate;
- DisplayWatcher* pDisplayWatcher;
+ DisplayWatcher* pDisplayWatcher;
IMFTopology *pTopologyFull;
- IMFTopology *pTopologyPartial;
- IMFMediaType *pOutType;
+ IMFTopology *pTopologyPartial;
+ IMFMediaType *pOutType;
}
plugin_win_mf_consumer_video_t;
@@ -1079,437 +1010,437 @@ plugin_win_mf_consumer_video_t;
/* ============ Media Consumer Interface ================= */
static int plugin_win_mf_consumer_video_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- HRESULT hr = S_OK;
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int64){
- if(tsk_striequals(param->key, "remote-hwnd")){
- HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
- if(hWnd != pSelf->hWindow)
- {
- pSelf->hWindow = hWnd;
- if(pSelf->pDisplayWatcher)
- {
- CHECK_HR(hr = pSelf->pDisplayWatcher->SetHwnd(hWnd));
- }
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "fullscreen")){
- if(pSelf->pDisplayWatcher)
- {
- CHECK_HR(hr = pSelf->pDisplayWatcher->SetFullscreen(!!*((int32_t*)param->value)));
- }
- }
- else if(tsk_striequals(param->key, "create-on-current-thead")){
- // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if(tsk_striequals(param->key, "plugin-firefox")){
- /*DSCONSUMER(self)->plugin_firefox = (*((int32_t*)param->value) != 0);
- if(DSCONSUMER(self)->display){
- DSCONSUMER(self)->display->setPluginFirefox((DSCONSUMER(self)->plugin_firefox == tsk_true));
- }*/
- }
- }
+ int ret = 0;
+ HRESULT hr = S_OK;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int64) {
+ if(tsk_striequals(param->key, "remote-hwnd")) {
+ HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
+ if(hWnd != pSelf->hWindow) {
+ pSelf->hWindow = hWnd;
+ if(pSelf->pDisplayWatcher) {
+ CHECK_HR(hr = pSelf->pDisplayWatcher->SetHwnd(hWnd));
+ }
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "fullscreen")) {
+ if(pSelf->pDisplayWatcher) {
+ CHECK_HR(hr = pSelf->pDisplayWatcher->SetFullscreen(!!*((int32_t*)param->value)));
+ }
+ }
+ else if(tsk_striequals(param->key, "create-on-current-thead")) {
+ // DSCONSUMER(self)->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if(tsk_striequals(param->key, "plugin-firefox")) {
+ /*DSCONSUMER(self)->plugin_firefox = (*((int32_t*)param->value) != 0);
+ if(DSCONSUMER(self)->display){
+ DSCONSUMER(self)->display->setPluginFirefox((DSCONSUMER(self)->plugin_firefox == tsk_true));
+ }*/
+ }
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!pSelf || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(pSelf->bPrepared){
- TSK_DEBUG_WARN("MF video consumer already prepared");
- return -1;
- }
-
- // FIXME: DirectShow requires flipping but not MF
- // The Core library always tries to flip when OSType==Win32. Must be changed
- TMEDIA_CODEC_VIDEO(codec)->in.flip = tsk_false;
-
- HRESULT hr = S_OK;
-
- TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if(!TMEDIA_CONSUMER(pSelf)->video.display.width){
- TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(pSelf)->video.display.height){
- TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
- }
-
- pSelf->nNegFps = TMEDIA_CONSUMER(pSelf)->video.fps;
- pSelf->nNegWidth = TMEDIA_CONSUMER(pSelf)->video.display.width;
- pSelf->nNegHeight = TMEDIA_CONSUMER(pSelf)->video.display.height;
-
- TSK_DEBUG_INFO("MF video consumer: fps=%d, width=%d, height=%d",
- pSelf->nNegFps,
- pSelf->nNegWidth,
- pSelf->nNegHeight);
-
- if(kDefaultUncompressedType == MFVideoFormat_NV12) {
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_nv12;
- }
- else if(kDefaultUncompressedType == MFVideoFormat_I420) {
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_yuv420p;
- }
- else if(kDefaultUncompressedType == MFVideoFormat_RGB32) {
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
- }
- else if(kDefaultUncompressedType == MFVideoFormat_RGB24) {
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb24;
- }
- else {
- CHECK_HR(hr = E_NOTIMPL);
- }
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- IMFMediaSink* pMediaSink = NULL;
- IMFAttributes* pSessionAttributes = NULL;
-
- // Set session attributes
- CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
- CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
-
- CHECK_HR(hr = MFCreateMediaType(&pSelf->pOutType));
- CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!pSelf || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(pSelf->bPrepared) {
+ TSK_DEBUG_WARN("MF video consumer already prepared");
+ return -1;
+ }
+
+ // FIXME: DirectShow requires flipping but not MF
+ // The Core library always tries to flip when OSType==Win32. Must be changed
+ TMEDIA_CODEC_VIDEO(codec)->in.flip = tsk_false;
+
+ HRESULT hr = S_OK;
+
+ TMEDIA_CONSUMER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(pSelf)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(pSelf)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.width) {
+ TMEDIA_CONSUMER(pSelf)->video.display.width = TMEDIA_CONSUMER(pSelf)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(pSelf)->video.display.height) {
+ TMEDIA_CONSUMER(pSelf)->video.display.height = TMEDIA_CONSUMER(pSelf)->video.in.height;
+ }
+
+ pSelf->nNegFps = TMEDIA_CONSUMER(pSelf)->video.fps;
+ pSelf->nNegWidth = TMEDIA_CONSUMER(pSelf)->video.display.width;
+ pSelf->nNegHeight = TMEDIA_CONSUMER(pSelf)->video.display.height;
+
+ TSK_DEBUG_INFO("MF video consumer: fps=%d, width=%d, height=%d",
+ pSelf->nNegFps,
+ pSelf->nNegWidth,
+ pSelf->nNegHeight);
+
+ if(kDefaultUncompressedType == MFVideoFormat_NV12) {
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_nv12;
+ }
+ else if(kDefaultUncompressedType == MFVideoFormat_I420) {
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_yuv420p;
+ }
+ else if(kDefaultUncompressedType == MFVideoFormat_RGB32) {
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb32;
+ }
+ else if(kDefaultUncompressedType == MFVideoFormat_RGB24) {
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_rgb24;
+ }
+ else {
+ CHECK_HR(hr = E_NOTIMPL);
+ }
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ IMFMediaSink* pMediaSink = NULL;
+ IMFAttributes* pSessionAttributes = NULL;
+
+ // Set session attributes
+ CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
+ CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
+
+ CHECK_HR(hr = MFCreateMediaType(&pSelf->pOutType));
+ CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
#if PLUGIN_MF_CV_BUNDLE_CODEC
- if((codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) && MFUtils::IsLowLatencyH264Supported()) {
- // both Microsoft and Intel encoders support NV12 only as input
- // static const BOOL kIsEncoder = FALSE;
- // hr = MFUtils::GetBestCodec(kIsEncoder, MFMediaType_Video, MFVideoFormat_H264, MFVideoFormat_NV12, &pSelf->pDecoder);
- pSelf->pDecoder = (codec->id == tmedia_codec_id_h264_bp) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Decoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder);
- if(pSelf->pDecoder)
- {
- hr = pSelf->pDecoder->Initialize(
- pSelf->nNegFps,
- pSelf->nNegWidth,
- pSelf->nNegHeight);
-
- if(FAILED(hr))
- {
- SafeRelease(&pSelf->pDecoder);
- hr = S_OK;
- }
- }
- if(SUCCEEDED(hr) && pSelf->pDecoder) {
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = codec->id; // means accept ENCODED fames
- CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264));
- }
- else {
- SafeRelease(&pSelf->pDecoder);
- TSK_DEBUG_WARN("Failed to find H.264 HW encoder...fallback to SW implementation");
- }
- }
+ if((codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) && MFUtils::IsLowLatencyH264Supported()) {
+ // both Microsoft and Intel encoders support NV12 only as input
+ // static const BOOL kIsEncoder = FALSE;
+ // hr = MFUtils::GetBestCodec(kIsEncoder, MFMediaType_Video, MFVideoFormat_H264, MFVideoFormat_NV12, &pSelf->pDecoder);
+ pSelf->pDecoder = (codec->id == tmedia_codec_id_h264_bp) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Decoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Decoder);
+ if(pSelf->pDecoder) {
+ hr = pSelf->pDecoder->Initialize(
+ pSelf->nNegFps,
+ pSelf->nNegWidth,
+ pSelf->nNegHeight);
+
+ if(FAILED(hr)) {
+ SafeRelease(&pSelf->pDecoder);
+ hr = S_OK;
+ }
+ }
+ if(SUCCEEDED(hr) && pSelf->pDecoder) {
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = codec->id; // means accept ENCODED fames
+ CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264));
+ }
+ else {
+ SafeRelease(&pSelf->pDecoder);
+ TSK_DEBUG_WARN("Failed to find H.264 HW encoder...fallback to SW implementation");
+ }
+ }
#endif
- if(!pSelf->pDecoder){
- CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_SUBTYPE, kDefaultUncompressedType));
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = kDefaultUncompressedType == MFVideoFormat_NV12 ? tmedia_chroma_nv12 : tmedia_chroma_yuv420p;
- }
+ if(!pSelf->pDecoder) {
+ CHECK_HR(hr = pSelf->pOutType->SetGUID(MF_MT_SUBTYPE, kDefaultUncompressedType));
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = kDefaultUncompressedType == MFVideoFormat_NV12 ? tmedia_chroma_nv12 : tmedia_chroma_yuv420p;
+ }
CHECK_HR(hr = pSelf->pOutType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
- CHECK_HR(hr = pSelf->pOutType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE));
+ CHECK_HR(hr = pSelf->pOutType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE));
CHECK_HR(hr = MFSetAttributeSize(pSelf->pOutType, MF_MT_FRAME_SIZE, pSelf->nNegWidth, pSelf->nNegHeight));
- CHECK_HR(hr = MFSetAttributeRatio(pSelf->pOutType, MF_MT_FRAME_RATE, pSelf->nNegFps, 1));
+ CHECK_HR(hr = MFSetAttributeRatio(pSelf->pOutType, MF_MT_FRAME_RATE, pSelf->nNegFps, 1));
CHECK_HR(hr = MFSetAttributeRatio(pSelf->pOutType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
- CHECK_HR(hr = CMFSource::CreateInstanceEx(IID_IMFMediaSource, (void**)&pSelf->pSource, pSelf->pOutType));
+ CHECK_HR(hr = CMFSource::CreateInstanceEx(IID_IMFMediaSource, (void**)&pSelf->pSource, pSelf->pOutType));
- // Apply Encoder output type (must be called before SetInputType)
- //if(pSelf->pDecoder) {
- // CHECK_HR(hr = pSelf->pDecoder->SetOutputType(0, pSelf->pOutType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
- //}
+ // Apply Encoder output type (must be called before SetInputType)
+ //if(pSelf->pDecoder) {
+ // CHECK_HR(hr = pSelf->pDecoder->SetOutputType(0, pSelf->pOutType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
+ //}
- // Create the Media Session.
- CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &pSelf->pSession));
+ // Create the Media Session.
+ CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &pSelf->pSession));
- // Create the EVR activation object.
- CHECK_HR(hr = MFCreateVideoRendererActivate(pSelf->hWindow, &pSelf->pSinkActivate));
+ // Create the EVR activation object.
+ CHECK_HR(hr = MFCreateVideoRendererActivate(pSelf->hWindow, &pSelf->pSinkActivate));
- // Create the topology.
- CHECK_HR(hr = MFUtils::CreateTopology(
- pSelf->pSource,
- pSelf->pDecoder ? pSelf->pDecoder->GetMFT() : NULL,
- pSelf->pSinkActivate,
- NULL/*Preview*/,
- pSelf->pOutType,
- &pSelf->pTopologyPartial));
- // Resolve topology (adds video processors if needed).
- CHECK_HR(hr = MFUtils::ResolveTopology(pSelf->pTopologyPartial, &pSelf->pTopologyFull));
+ // Create the topology.
+ CHECK_HR(hr = MFUtils::CreateTopology(
+ pSelf->pSource,
+ pSelf->pDecoder ? pSelf->pDecoder->GetMFT() : NULL,
+ pSelf->pSinkActivate,
+ NULL/*Preview*/,
+ pSelf->pOutType,
+ &pSelf->pTopologyPartial));
+ // Resolve topology (adds video processors if needed).
+ CHECK_HR(hr = MFUtils::ResolveTopology(pSelf->pTopologyPartial, &pSelf->pTopologyFull));
- // Find EVR
- CHECK_HR(hr = MFUtils::FindNodeObject(pSelf->pTopologyFull, MFUtils::g_ullTopoIdSinkMain, (void**)&pMediaSink));
+ // Find EVR
+ CHECK_HR(hr = MFUtils::FindNodeObject(pSelf->pTopologyFull, MFUtils::g_ullTopoIdSinkMain, (void**)&pMediaSink));
- // Create EVR watcher
- pSelf->pDisplayWatcher = new DisplayWatcher(pSelf->hWindow, pMediaSink, hr);
- CHECK_HR(hr);
+ // Create EVR watcher
+ pSelf->pDisplayWatcher = new DisplayWatcher(pSelf->hWindow, pMediaSink, hr);
+ CHECK_HR(hr);
bail:
- SafeRelease(&pMediaSink);
- SafeRelease(&pSessionAttributes);
-
- pSelf->bPrepared = SUCCEEDED(hr);
- return pSelf->bPrepared ? 0 : -1;
+ SafeRelease(&pMediaSink);
+ SafeRelease(&pSessionAttributes);
+
+ pSelf->bPrepared = SUCCEEDED(hr);
+ return pSelf->bPrepared ? 0 : -1;
}
static int plugin_win_mf_consumer_video_start(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(pSelf->bStarted){
- TSK_DEBUG_INFO("MF video consumer already started");
- return 0;
- }
- if(!pSelf->bPrepared){
- TSK_DEBUG_ERROR("MF video consumer not prepared");
- return -1;
- }
-
- HRESULT hr = S_OK;
-
- // Run EVR watcher
- if(pSelf->pDisplayWatcher) {
- CHECK_HR(hr = pSelf->pDisplayWatcher->Start());
- }
-
- // Run the media session.
- CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopologyFull));
-
- // Start asynchronous watcher thread
- pSelf->bStarted = true;
- int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
- if(ret != 0) {
- TSK_DEBUG_ERROR("Failed to create thread");
- hr = E_FAIL;
- pSelf->bStarted = false;
- if(pSelf->ppTread[0]){
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
- CHECK_HR(hr = E_FAIL);
- }
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video consumer already started");
+ return 0;
+ }
+ if(!pSelf->bPrepared) {
+ TSK_DEBUG_ERROR("MF video consumer not prepared");
+ return -1;
+ }
+
+ HRESULT hr = S_OK;
+
+ // Run EVR watcher
+ if(pSelf->pDisplayWatcher) {
+ CHECK_HR(hr = pSelf->pDisplayWatcher->Start());
+ }
+
+ // Run the media session.
+ CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopologyFull));
+
+ // Start asynchronous watcher thread
+ pSelf->bStarted = true;
+ int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
+ if(ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ hr = E_FAIL;
+ pSelf->bStarted = false;
+ if(pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
+ CHECK_HR(hr = E_FAIL);
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
-
- HRESULT hr = S_OK;
-
- if(!pSelf || !buffer || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_INVALIDARG);
- }
-
- if(!pSelf->bStarted) {
- TSK_DEBUG_INFO("MF video consumer not started");
- CHECK_HR(hr = E_FAIL);
- }
- if(!pSelf->pSource) {
- TSK_DEBUG_ERROR("No video custom source");
- CHECK_HR(hr = E_FAIL);
- }
-
- if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height){
- TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
- pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
- pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
- // Update media type
- CHECK_HR(hr = MFSetAttributeSize(pSelf->pOutType, MF_MT_FRAME_SIZE, TMEDIA_CONSUMER(pSelf)->video.in.width, TMEDIA_CONSUMER(pSelf)->video.in.height));
- CHECK_HR(hr = MFSetAttributeRatio(pSelf->pOutType, MF_MT_FRAME_RATE, TMEDIA_CONSUMER(pSelf)->video.fps, 1));
-
- CHECK_HR(hr = pSelf->pSession->ClearTopologies());
-
- //
- // FIXME: Using same EVR when the size is just swapped (e.g. [640, 480] -> [480, 640]) doesn't work while other changes does (e.g. [352, 288] -> [640, 480])
- // /!\This look like a bug in Media Foundation
- //
- if(pSelf->nNegWidth == TMEDIA_CONSUMER(pSelf)->video.in.height && pSelf->nNegHeight == TMEDIA_CONSUMER(pSelf)->video.in.width) // swapped?
- {
- TSK_DEBUG_INFO("/!\\ Size swapped");
-
- IMFActivate* pSinkActivate = NULL;
- IMFTopology* pTopologyPartial = NULL;
- hr = MFCreateVideoRendererActivate(pSelf->hWindow, &pSinkActivate);
- if(FAILED(hr)) goto end_of_swapping;
- hr = MFUtils::CreateTopology(
- pSelf->pSource,
- pSelf->pDecoder ? pSelf->pDecoder->GetMFT() : NULL,
- pSinkActivate,
- NULL/*Preview*/,
- pSelf->pOutType,
- &pTopologyPartial);
- if(FAILED(hr)) goto end_of_swapping;
-
- if(SUCCEEDED(hr)) {
- SafeRelease(&pSelf->pSinkActivate);
- SafeRelease(&pSelf->pTopologyPartial);
- pSelf->pSinkActivate = pSinkActivate; pSinkActivate = NULL;
- pSelf->pTopologyPartial = pTopologyPartial; pTopologyPartial = NULL;
-
- }
-
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+
+ HRESULT hr = S_OK;
+
+ if(!pSelf || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_INVALIDARG);
+ }
+
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video consumer not started");
+ CHECK_HR(hr = E_FAIL);
+ }
+ if(!pSelf->pSource) {
+ TSK_DEBUG_ERROR("No video custom source");
+ CHECK_HR(hr = E_FAIL);
+ }
+
+ if(pSelf->nNegWidth != TMEDIA_CONSUMER(pSelf)->video.in.width || pSelf->nNegHeight != TMEDIA_CONSUMER(pSelf)->video.in.height) {
+ TSK_DEBUG_INFO("Negotiated and input video sizes are different:%d#%d or %d#%d",
+ pSelf->nNegWidth, TMEDIA_CONSUMER(pSelf)->video.in.width,
+ pSelf->nNegHeight, TMEDIA_CONSUMER(pSelf)->video.in.height);
+ // Update media type
+ CHECK_HR(hr = MFSetAttributeSize(pSelf->pOutType, MF_MT_FRAME_SIZE, TMEDIA_CONSUMER(pSelf)->video.in.width, TMEDIA_CONSUMER(pSelf)->video.in.height));
+ CHECK_HR(hr = MFSetAttributeRatio(pSelf->pOutType, MF_MT_FRAME_RATE, TMEDIA_CONSUMER(pSelf)->video.fps, 1));
+
+ CHECK_HR(hr = pSelf->pSession->ClearTopologies());
+
+ //
+ // FIXME: Using same EVR when the size is just swapped (e.g. [640, 480] -> [480, 640]) doesn't work while other changes does (e.g. [352, 288] -> [640, 480])
+ // /!\This look like a bug in Media Foundation
+ //
+ if(pSelf->nNegWidth == TMEDIA_CONSUMER(pSelf)->video.in.height && pSelf->nNegHeight == TMEDIA_CONSUMER(pSelf)->video.in.width) { // swapped?
+ TSK_DEBUG_INFO("/!\\ Size swapped");
+
+ IMFActivate* pSinkActivate = NULL;
+ IMFTopology* pTopologyPartial = NULL;
+ hr = MFCreateVideoRendererActivate(pSelf->hWindow, &pSinkActivate);
+ if(FAILED(hr)) {
+ goto end_of_swapping;
+ }
+ hr = MFUtils::CreateTopology(
+ pSelf->pSource,
+ pSelf->pDecoder ? pSelf->pDecoder->GetMFT() : NULL,
+ pSinkActivate,
+ NULL/*Preview*/,
+ pSelf->pOutType,
+ &pTopologyPartial);
+ if(FAILED(hr)) {
+ goto end_of_swapping;
+ }
+
+ if(SUCCEEDED(hr)) {
+ SafeRelease(&pSelf->pSinkActivate);
+ SafeRelease(&pSelf->pTopologyPartial);
+ pSelf->pSinkActivate = pSinkActivate;
+ pSinkActivate = NULL;
+ pSelf->pTopologyPartial = pTopologyPartial;
+ pTopologyPartial = NULL;
+
+ }
+
end_of_swapping:
- SafeRelease(&pSinkActivate);
- SafeRelease(&pTopologyPartial);
- CHECK_HR(hr);
- }
-
- // Set media type again (not required but who know)
- CHECK_HR(hr = MFUtils::SetMediaType(pSelf->pSource, pSelf->pOutType));
-
- // Rebuild topology using the partial one
- IMFTopology* pTopologyFull = NULL;
- hr = MFUtils::ResolveTopology(pSelf->pTopologyPartial, &pTopologyFull);
- if(SUCCEEDED(hr)){
- SafeRelease(&pSelf->pTopologyFull);
- pSelf->pTopologyFull = pTopologyFull; pTopologyFull = NULL;
- }
- SafeRelease(&pTopologyFull);
- CHECK_HR(hr);
-
- // Find Main Sink
- IMFMediaSink* pMediaSink = NULL;
- hr = MFUtils::FindNodeObject(pSelf->pTopologyFull, MFUtils::g_ullTopoIdSinkMain, (void**)&pMediaSink);
- if(SUCCEEDED(hr)) {
- if(pSelf->pDisplayWatcher){
- delete pSelf->pDisplayWatcher, pSelf->pDisplayWatcher = NULL;
- }
- pSelf->pDisplayWatcher = new DisplayWatcher(pSelf->hWindow, pMediaSink, hr);
- if(SUCCEEDED(hr) && pSelf->bStarted) {
- hr = pSelf->pDisplayWatcher->Start();
- }
- }
- SafeRelease(&pMediaSink);
- CHECK_HR(hr);
-
- // Update the topology associated to the media session
- CHECK_HR(hr = pSelf->pSession->SetTopology(MFSESSION_SETTOPOLOGY_IMMEDIATE, pSelf->pTopologyFull));
-
- // Update negotiated width and height
- pSelf->nNegWidth = TMEDIA_CONSUMER(pSelf)->video.in.width;
- pSelf->nNegHeight = TMEDIA_CONSUMER(pSelf)->video.in.height;
- }
-
- // Deliver buffer
- CHECK_HR(hr = pSelf->pSource->CopyVideoBuffer(pSelf->nNegWidth, pSelf->nNegHeight, buffer, size));
+ SafeRelease(&pSinkActivate);
+ SafeRelease(&pTopologyPartial);
+ CHECK_HR(hr);
+ }
+
+ // Set media type again (not required but who know)
+ CHECK_HR(hr = MFUtils::SetMediaType(pSelf->pSource, pSelf->pOutType));
+
+ // Rebuild topology using the partial one
+ IMFTopology* pTopologyFull = NULL;
+ hr = MFUtils::ResolveTopology(pSelf->pTopologyPartial, &pTopologyFull);
+ if(SUCCEEDED(hr)) {
+ SafeRelease(&pSelf->pTopologyFull);
+ pSelf->pTopologyFull = pTopologyFull;
+ pTopologyFull = NULL;
+ }
+ SafeRelease(&pTopologyFull);
+ CHECK_HR(hr);
+
+ // Find Main Sink
+ IMFMediaSink* pMediaSink = NULL;
+ hr = MFUtils::FindNodeObject(pSelf->pTopologyFull, MFUtils::g_ullTopoIdSinkMain, (void**)&pMediaSink);
+ if(SUCCEEDED(hr)) {
+ if(pSelf->pDisplayWatcher) {
+ delete pSelf->pDisplayWatcher, pSelf->pDisplayWatcher = NULL;
+ }
+ pSelf->pDisplayWatcher = new DisplayWatcher(pSelf->hWindow, pMediaSink, hr);
+ if(SUCCEEDED(hr) && pSelf->bStarted) {
+ hr = pSelf->pDisplayWatcher->Start();
+ }
+ }
+ SafeRelease(&pMediaSink);
+ CHECK_HR(hr);
+
+ // Update the topology associated to the media session
+ CHECK_HR(hr = pSelf->pSession->SetTopology(MFSESSION_SETTOPOLOGY_IMMEDIATE, pSelf->pTopologyFull));
+
+ // Update negotiated width and height
+ pSelf->nNegWidth = TMEDIA_CONSUMER(pSelf)->video.in.width;
+ pSelf->nNegHeight = TMEDIA_CONSUMER(pSelf)->video.in.height;
+ }
+
+ // Deliver buffer
+ CHECK_HR(hr = pSelf->pSource->CopyVideoBuffer(pSelf->nNegWidth, pSelf->nNegHeight, buffer, size));
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_pause(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("MF video producer not started");
- return 0;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video producer not started");
+ return 0;
+ }
- HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
+ HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_consumer_video_stop(tmedia_consumer_t* self)
{
- plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
+ plugin_win_mf_consumer_video_t* pSelf = (plugin_win_mf_consumer_video_t*)self;
- if(!pSelf){
+ if(!pSelf) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
HRESULT hr = S_OK;
- // stop EVR watcher
- if(pSelf->pDisplayWatcher) {
- hr = pSelf->pDisplayWatcher->Stop();
- }
+ // stop EVR watcher
+ if(pSelf->pDisplayWatcher) {
+ hr = pSelf->pDisplayWatcher->Stop();
+ }
// for the thread
pSelf->bStarted = false;
hr = MFUtils::ShutdownSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
- if(pSelf->ppTread[0]){
+ if(pSelf->ppTread[0]) {
tsk_thread_join(&pSelf->ppTread[0]);
}
hr = MFUtils::ShutdownSession(NULL, pSelf->pSource); // stop source to release the camera
- // next start() will be called after prepare()
- return _plugin_win_mf_consumer_video_unprepare(pSelf);
+ // next start() will be called after prepare()
+ return _plugin_win_mf_consumer_video_unprepare(pSelf);
}
static int _plugin_win_mf_consumer_video_unprepare(plugin_win_mf_consumer_video_t* pSelf)
{
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(pSelf->bStarted) {
- // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
- TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
- }
-
- if(pSelf->pDisplayWatcher) {
- pSelf->pDisplayWatcher->Stop();
- }
- if(pSelf->pSource){
- pSelf->pSource->Shutdown();
- pSelf->pSource = NULL;
- }
- if(pSelf->pSession){
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(pSelf->bStarted) {
+ // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
+ TSK_DEBUG_ERROR("Consumer must be stopped before calling unprepare");
+ }
+
+ if(pSelf->pDisplayWatcher) {
+ pSelf->pDisplayWatcher->Stop();
+ }
+ if(pSelf->pSource) {
+ pSelf->pSource->Shutdown();
+ pSelf->pSource = NULL;
+ }
+ if(pSelf->pSession) {
pSelf->pSession->Shutdown();
- pSelf->pSession = NULL;
+ pSelf->pSession = NULL;
}
- SafeRelease(&pSelf->pDecoder);
+ SafeRelease(&pSelf->pDecoder);
SafeRelease(&pSelf->pSession);
SafeRelease(&pSelf->pSource);
SafeRelease(&pSelf->pSinkActivate);
SafeRelease(&pSelf->pTopologyFull);
- SafeRelease(&pSelf->pTopologyPartial);
- SafeRelease(&pSelf->pOutType);
+ SafeRelease(&pSelf->pTopologyPartial);
+ SafeRelease(&pSelf->pOutType);
- if(pSelf->pDisplayWatcher) {
- delete pSelf->pDisplayWatcher;
- pSelf->pDisplayWatcher = NULL;
- }
+ if(pSelf->pDisplayWatcher) {
+ delete pSelf->pDisplayWatcher;
+ pSelf->pDisplayWatcher = NULL;
+ }
- pSelf->bPrepared = false;
+ pSelf->bPrepared = false;
- return 0;
+ return 0;
}
@@ -1519,102 +1450,98 @@ static int _plugin_win_mf_consumer_video_unprepare(plugin_win_mf_consumer_video_
/* constructor */
static tsk_object_t* plugin_win_mf_consumer_video_ctor(tsk_object_t * self, va_list * app)
{
- MFUtils::Startup();
-
- plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
- if(pSelf){
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
- TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_yuv420p;
- TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
-
- /* init self */
- // consumer->create_on_ui_thread = tsk_true;
- TMEDIA_CONSUMER(pSelf)->video.fps = 15;
- TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
- TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
-
- TSK_DEBUG_INFO("Create WinMF video consumer");
- }
- return self;
+ MFUtils::Startup();
+
+ plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
+ if(pSelf) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(pSelf));
+ TMEDIA_CONSUMER(pSelf)->video.display.chroma = tmedia_chroma_yuv420p;
+ TMEDIA_CONSUMER(pSelf)->decoder.codec_id = tmedia_codec_id_none; // means accept RAW fames
+
+ /* init self */
+ // consumer->create_on_ui_thread = tsk_true;
+ TMEDIA_CONSUMER(pSelf)->video.fps = 15;
+ TMEDIA_CONSUMER(pSelf)->video.display.width = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.height = 0; // use codec value
+ TMEDIA_CONSUMER(pSelf)->video.display.auto_resize = tsk_true;
+
+ TSK_DEBUG_INFO("Create WinMF video consumer");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_mf_consumer_video_dtor(tsk_object_t * self)
-{
- plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
- if(pSelf){
- /* stop */
- if(pSelf->bStarted){
- plugin_win_mf_consumer_video_stop(TMEDIA_CONSUMER(pSelf));
- }
-
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
- /* deinit self */
- _plugin_win_mf_consumer_video_unprepare(pSelf);
- }
-
- return self;
+{
+ plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)self;
+ if(pSelf) {
+ /* stop */
+ if(pSelf->bStarted) {
+ plugin_win_mf_consumer_video_stop(TMEDIA_CONSUMER(pSelf));
+ }
+
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(pSelf));
+ /* deinit self */
+ _plugin_win_mf_consumer_video_unprepare(pSelf);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_mf_consumer_video_def_s =
-{
- sizeof(plugin_win_mf_consumer_video_t),
- plugin_win_mf_consumer_video_ctor,
- plugin_win_mf_consumer_video_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_win_mf_consumer_video_def_s = {
+ sizeof(plugin_win_mf_consumer_video_t),
+ plugin_win_mf_consumer_video_ctor,
+ plugin_win_mf_consumer_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_video_plugin_def_s =
-{
- &plugin_win_mf_consumer_video_def_s,
-
- tmedia_video,
- "Media Foundation video consumer",
-
- plugin_win_mf_consumer_video_set,
- plugin_win_mf_consumer_video_prepare,
- plugin_win_mf_consumer_video_start,
- plugin_win_mf_consumer_video_consume,
- plugin_win_mf_consumer_video_pause,
- plugin_win_mf_consumer_video_stop
+static const tmedia_consumer_plugin_def_t plugin_win_mf_consumer_video_plugin_def_s = {
+ &plugin_win_mf_consumer_video_def_s,
+
+ tmedia_video,
+ "Media Foundation video consumer",
+
+ plugin_win_mf_consumer_video_set,
+ plugin_win_mf_consumer_video_prepare,
+ plugin_win_mf_consumer_video_start,
+ plugin_win_mf_consumer_video_consume,
+ plugin_win_mf_consumer_video_pause,
+ plugin_win_mf_consumer_video_stop
};
const tmedia_consumer_plugin_def_t *plugin_win_mf_consumer_video_plugin_def_t = &plugin_win_mf_consumer_video_plugin_def_s;
// Run session async thread
static void* TSK_STDCALL RunSessionThread(void *pArg)
{
- plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)pArg;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- IMFMediaEvent *pEvent = NULL;
- MediaEventType met;
-
- TSK_DEBUG_INFO("RunSessionThread (MF video consumer) - ENTER");
-
- while(pSelf->bStarted){
- CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
- CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- CHECK_HR(hr = pEvent->GetType(&met));
-
- if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/)
- {
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
- hr = hrStatus;
- goto bail;
- }
- if (met == MESessionEnded)
- {
- break;
- }
- SafeRelease(&pEvent);
- }
+ plugin_win_mf_consumer_video_t *pSelf = (plugin_win_mf_consumer_video_t *)pArg;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ IMFMediaEvent *pEvent = NULL;
+ MediaEventType met;
+
+ TSK_DEBUG_INFO("RunSessionThread (MF video consumer) - ENTER");
+
+ while(pSelf->bStarted) {
+ CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
+ CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
+ CHECK_HR(hr = pEvent->GetType(&met));
+
+ if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/) {
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ hr = hrStatus;
+ goto bail;
+ }
+ if (met == MESessionEnded) {
+ break;
+ }
+ SafeRelease(&pEvent);
+ }
bail:
- TSK_DEBUG_INFO("RunSessionThread (MF video consumer) - EXIT");
+ TSK_DEBUG_INFO("RunSessionThread (MF video consumer) - EXIT");
- return NULL;
+ return NULL;
}
#endif /* PLUGIN_MF_CV_USE_D3D9 */ \ No newline at end of file
diff --git a/plugins/pluginWinMF/plugin_win_mf_converter_video.cxx b/plugins/pluginWinMF/plugin_win_mf_converter_video.cxx
index 0e6abcb..70a1b4c 100755
--- a/plugins/pluginWinMF/plugin_win_mf_converter_video.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_converter_video.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013-2015 Mamadou DIOP
* Copyright (C) 2013-2015 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -53,9 +53,9 @@ EXTERN_C const GUID CLSID_VideoProcessorMFT; // defined in mf_utils.cxx
#define _WIN32_WINNT_WIN8 0x0602
#endif /* _WIN32_WINNT_WIN8 */
-#if (WINVER < _WIN32_WINNT_WIN8)
+#if (WINVER < _WIN32_WINNT_WIN8)
DEFINE_GUID(MF_SA_D3D11_AWARE,
- 0x206b4fc8, 0xfcf9, 0x4c51, 0xaf, 0xe3, 0x97, 0x64, 0x36, 0x9e, 0x33, 0xa0);
+ 0x206b4fc8, 0xfcf9, 0x4c51, 0xaf, 0xe3, 0x97, 0x64, 0x36, 0x9e, 0x33, 0xa0);
#endif /* MF_SA_D3D11_AWARE */
#if !defined(HAVE_IMFVideoProcessorControl)
@@ -72,34 +72,33 @@ DEFINE_GUID(MF_SA_D3D11_AWARE,
#define PLUGIN_MF_VC_FPS 120 // Samples requires timestamp
#endif /* PLUGIN_MF_VC_FPS */
-typedef struct plugin_win_mf_converter_video_ms_s
-{
- TMEDIA_DECLARE_CONVERTER_VIDEO;
-
- GUID fmtSrc;
- tsk_size_t widthSrc;
- tsk_size_t heightSrc;
-
- GUID fmtDst;
- tsk_size_t widthDst;
- tsk_size_t heightDst;
-
- UINT32 rotation;
- UINT32 xOutputSize;
- UINT32 xInputSize;
- BOOL flip;
-
- IMFSample* pSampleOut;
- IMFSample* pSampleIn;
-
- LONGLONG rtStart;
+typedef struct plugin_win_mf_converter_video_ms_s {
+ TMEDIA_DECLARE_CONVERTER_VIDEO;
+
+ GUID fmtSrc;
+ tsk_size_t widthSrc;
+ tsk_size_t heightSrc;
+
+ GUID fmtDst;
+ tsk_size_t widthDst;
+ tsk_size_t heightDst;
+
+ UINT32 rotation;
+ UINT32 xOutputSize;
+ UINT32 xInputSize;
+ BOOL flip;
+
+ IMFSample* pSampleOut;
+ IMFSample* pSampleIn;
+
+ LONGLONG rtStart;
UINT64 rtDuration;
- IMFTransform* pMFT; // "CLSID_VideoProcessorMFT" or "CLSID_CColorConvertDMO"
+ IMFTransform* pMFT; // "CLSID_VideoProcessorMFT" or "CLSID_CColorConvertDMO"
#if HAVE_IMFVideoProcessorControl
- IMFVideoProcessorControl* pVPC;
+ IMFVideoProcessorControl* pVPC;
#endif
- BOOL isVideoProcessor;
+ BOOL isVideoProcessor;
}
plugin_win_mf_converter_video_ms_t;
@@ -110,324 +109,299 @@ static inline HRESULT _plugin_win_mf_converter_video_ms_copy_rgb32_down_top(
const BYTE* pSrc,
INT dwWidthInPixels,
INT dwHeightInPixels
- );
+);
static HRESULT _plugin_win_mf_converter_video_ms_process_input(plugin_win_mf_converter_video_ms_t* pSelf, IMFSample* pSample);
static HRESULT _plugin_win_mf_converter_video_ms_process_output(plugin_win_mf_converter_video_ms_t* pSelf, IMFSample **ppSample);
static HRESULT _plugin_win_mf_converter_video_ms_process(plugin_win_mf_converter_video_ms_t* pSelf, const void* pcInputPtr, UINT32 nInputSize, IMFSample **ppSampleOut);
static int plugin_win_mf_converter_video_ms_init(tmedia_converter_video_t* self, tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma)
{
- plugin_win_mf_converter_video_ms_t* pSelf = (plugin_win_mf_converter_video_ms_t*)self;
- TSK_DEBUG_INFO("Initializing new MF Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma);
-
- if((pSelf->fmtSrc = _plugin_win_mf_converter_video_ms_get_pixfmt(srcChroma)) == GUID_NULL)
- {
- TSK_DEBUG_ERROR("Invalid source chroma");
- return -2;
- }
- if((pSelf->fmtDst = _plugin_win_mf_converter_video_ms_get_pixfmt(dstChroma)) == GUID_NULL)
- {
- TSK_DEBUG_ERROR("Invalid destination chroma");
- return -3;
- }
-
- pSelf->rtStart = 0;
-
- pSelf->widthSrc = srcWidth;
- pSelf->heightSrc = srcHeight;
- pSelf->widthDst = dstWidth;
- pSelf->heightDst = dstHeight;
- pSelf->rotation = 0;
- pSelf->xOutputSize = (UINT32)_plugin_win_mf_converter_video_ms_get_size(dstChroma, dstWidth, dstHeight);
- pSelf->xInputSize = (UINT32)_plugin_win_mf_converter_video_ms_get_size(srcChroma, srcWidth, srcHeight);
-
- SafeRelease(&pSelf->pSampleOut);
- SafeRelease(&pSelf->pSampleIn);
- SafeRelease(&pSelf->pMFT);
+ plugin_win_mf_converter_video_ms_t* pSelf = (plugin_win_mf_converter_video_ms_t*)self;
+ TSK_DEBUG_INFO("Initializing new MF Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma);
+
+ if((pSelf->fmtSrc = _plugin_win_mf_converter_video_ms_get_pixfmt(srcChroma)) == GUID_NULL) {
+ TSK_DEBUG_ERROR("Invalid source chroma");
+ return -2;
+ }
+ if((pSelf->fmtDst = _plugin_win_mf_converter_video_ms_get_pixfmt(dstChroma)) == GUID_NULL) {
+ TSK_DEBUG_ERROR("Invalid destination chroma");
+ return -3;
+ }
+
+ pSelf->rtStart = 0;
+
+ pSelf->widthSrc = srcWidth;
+ pSelf->heightSrc = srcHeight;
+ pSelf->widthDst = dstWidth;
+ pSelf->heightDst = dstHeight;
+ pSelf->rotation = 0;
+ pSelf->xOutputSize = (UINT32)_plugin_win_mf_converter_video_ms_get_size(dstChroma, dstWidth, dstHeight);
+ pSelf->xInputSize = (UINT32)_plugin_win_mf_converter_video_ms_get_size(srcChroma, srcWidth, srcHeight);
+
+ SafeRelease(&pSelf->pSampleOut);
+ SafeRelease(&pSelf->pSampleIn);
+ SafeRelease(&pSelf->pMFT);
#if HAVE_IMFVideoProcessorControl
- SafeRelease(&pSelf->pVPC);
+ SafeRelease(&pSelf->pVPC);
#endif
- HRESULT hr = S_OK;
-
- IMFMediaType* pTypeSrc = NULL;
- IMFMediaType* pTypeDst = NULL;
-
- // Get video processor or Color convertor
- hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSelf->pMFT));
- pSelf->isVideoProcessor = SUCCEEDED(hr);
- if(FAILED(hr))
- {
- TSK_DEBUG_INFO("CoCreateInstance(CLSID_VideoProcessorMFT) failed");
- if(pSelf->widthSrc == pSelf->widthDst && pSelf->heightSrc == pSelf->heightDst)
- {
- TSK_DEBUG_INFO("No video scaling is required...perform CoCreateInstance(CLSID_CColorConvertDMO)");
- CHECK_HR(hr = CoCreateInstance(CLSID_CColorConvertDMO, NULL,
- CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSelf->pMFT)));
- }
- else
- {
- CHECK_HR(hr);
- }
- }
-
-
-
- if(pSelf->isVideoProcessor)
- {
- IMFAttributes* pAttributes = NULL;
- UINT32 GPU = 0;
- hr = pSelf->pMFT->GetAttributes(&pAttributes);
- if (SUCCEEDED(hr)) {
- hr = pAttributes->GetUINT32(MF_SA_D3D11_AWARE, &GPU);
- }
- SafeRelease(&pAttributes);
- TSK_DEBUG_INFO("MF_SA_D3D11_AWARE = %d", GPU);
+ HRESULT hr = S_OK;
+
+ IMFMediaType* pTypeSrc = NULL;
+ IMFMediaType* pTypeDst = NULL;
+
+ // Get video processor or Color convertor
+ hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSelf->pMFT));
+ pSelf->isVideoProcessor = SUCCEEDED(hr);
+ if(FAILED(hr)) {
+ TSK_DEBUG_INFO("CoCreateInstance(CLSID_VideoProcessorMFT) failed");
+ if(pSelf->widthSrc == pSelf->widthDst && pSelf->heightSrc == pSelf->heightDst) {
+ TSK_DEBUG_INFO("No video scaling is required...perform CoCreateInstance(CLSID_CColorConvertDMO)");
+ CHECK_HR(hr = CoCreateInstance(CLSID_CColorConvertDMO, NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSelf->pMFT)));
+ }
+ else {
+ CHECK_HR(hr);
+ }
+ }
+
+
+
+ if(pSelf->isVideoProcessor) {
+ IMFAttributes* pAttributes = NULL;
+ UINT32 GPU = 0;
+ hr = pSelf->pMFT->GetAttributes(&pAttributes);
+ if (SUCCEEDED(hr)) {
+ hr = pAttributes->GetUINT32(MF_SA_D3D11_AWARE, &GPU);
+ }
+ SafeRelease(&pAttributes);
+ TSK_DEBUG_INFO("MF_SA_D3D11_AWARE = %d", GPU);
#if HAVE_IMFVideoProcessorControl
- CHECK_HR(hr = pSelf->pMFT->QueryInterface(IID_PPV_ARGS(&pSelf->pVPC)));
+ CHECK_HR(hr = pSelf->pMFT->QueryInterface(IID_PPV_ARGS(&pSelf->pVPC)));
#endif
- }
+ }
- CHECK_HR(hr = MFUtils::CreateVideoType(&pSelf->fmtSrc, &pTypeSrc, (UINT32)pSelf->widthSrc, (UINT32)pSelf->heightSrc));
- CHECK_HR(hr = MFUtils::CreateVideoType(&pSelf->fmtDst, &pTypeDst, (UINT32)pSelf->widthDst, (UINT32)pSelf->heightDst));
+ CHECK_HR(hr = MFUtils::CreateVideoType(&pSelf->fmtSrc, &pTypeSrc, (UINT32)pSelf->widthSrc, (UINT32)pSelf->heightSrc));
+ CHECK_HR(hr = MFUtils::CreateVideoType(&pSelf->fmtDst, &pTypeDst, (UINT32)pSelf->widthDst, (UINT32)pSelf->heightDst));
- CHECK_HR(hr = pSelf->pMFT->SetInputType(0, pTypeSrc, 0));
- CHECK_HR(hr = pSelf->pMFT->SetOutputType(0, pTypeDst, 0));
+ CHECK_HR(hr = pSelf->pMFT->SetInputType(0, pTypeSrc, 0));
+ CHECK_HR(hr = pSelf->pMFT->SetOutputType(0, pTypeDst, 0));
bail:
- SafeRelease(&pTypeSrc);
- SafeRelease(&pTypeDst);
+ SafeRelease(&pTypeSrc);
+ SafeRelease(&pTypeDst);
- if(FAILED(hr))
- {
- SafeRelease(&pSelf->pMFT);
+ if(FAILED(hr)) {
+ SafeRelease(&pSelf->pMFT);
#if HAVE_IMFVideoProcessorControl
- SafeRelease(&pSelf->pVPC);
+ SafeRelease(&pSelf->pVPC);
#endif
- return -4;
- }
+ return -4;
+ }
- return 0;
+ return 0;
}
static tsk_size_t plugin_win_mf_converter_video_ms_process(tmedia_converter_video_t* _self, const void* buffer, tsk_size_t buffer_size, void** output, tsk_size_t* output_max_size)
{
- plugin_win_mf_converter_video_ms_t* pSelf = (plugin_win_mf_converter_video_ms_t*)_self;
+ plugin_win_mf_converter_video_ms_t* pSelf = (plugin_win_mf_converter_video_ms_t*)_self;
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- IMFSample *pSampleOut = NULL;
- IMFMediaBuffer* pBufferOut = NULL;
+ IMFSample *pSampleOut = NULL;
+ IMFMediaBuffer* pBufferOut = NULL;
- if(!pSelf || !buffer || !output || !output_max_size)
- {
- CHECK_HR(hr = E_POINTER);
- }
+ if(!pSelf || !buffer || !output || !output_max_size) {
+ CHECK_HR(hr = E_POINTER);
+ }
- if(!pSelf->pMFT)
- {
- TSK_DEBUG_ERROR("Not initialized");
- CHECK_HR(hr = E_FAIL);
- }
+ if(!pSelf->pMFT) {
+ TSK_DEBUG_ERROR("Not initialized");
+ CHECK_HR(hr = E_FAIL);
+ }
#if HAVE_IMFVideoProcessorControl
- if(!pSelf->pVPC && pSelf->isVideoProcessor)
- {
- TSK_DEBUG_ERROR("Not initialized");
- CHECK_HR(hr = E_FAIL);
- }
+ if(!pSelf->pVPC && pSelf->isVideoProcessor) {
+ TSK_DEBUG_ERROR("Not initialized");
+ CHECK_HR(hr = E_FAIL);
+ }
#endif
- if(*output_max_size < pSelf->xOutputSize)
- {
- if(!(*output = tsk_realloc(*output, pSelf->xOutputSize)))
- {
- *output_max_size = 0;
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", pSelf->xOutputSize);
- CHECK_HR(hr = E_OUTOFMEMORY);
- }
- *output_max_size = pSelf->xOutputSize;
- }
+ if(*output_max_size < pSelf->xOutputSize) {
+ if(!(*output = tsk_realloc(*output, pSelf->xOutputSize))) {
+ *output_max_size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", pSelf->xOutputSize);
+ CHECK_HR(hr = E_OUTOFMEMORY);
+ }
+ *output_max_size = pSelf->xOutputSize;
+ }
#if HAVE_IMFVideoProcessorControl
- if(pSelf->pVPC && !!_self->flip != !!pSelf->flip)
- {
- pSelf->flip = !!_self->flip;
- CHECK_HR(hr = pSelf->pVPC->SetMirror(pSelf->flip ? MIRROR_NONE : MIRROR_VERTICAL));
- }
- if(pSelf->pVPC && _self->rotation != pSelf->rotation)
- {
- _self->rotation = pSelf->rotation;
- CHECK_HR(hr = pSelf->pVPC->SetRotation(pSelf->rotation == 0 ? ROTATION_NONE : ROTATION_NORMAL));
-
- }
+ if(pSelf->pVPC && !!_self->flip != !!pSelf->flip) {
+ pSelf->flip = !!_self->flip;
+ CHECK_HR(hr = pSelf->pVPC->SetMirror(pSelf->flip ? MIRROR_NONE : MIRROR_VERTICAL));
+ }
+ if(pSelf->pVPC && _self->rotation != pSelf->rotation) {
+ _self->rotation = pSelf->rotation;
+ CHECK_HR(hr = pSelf->pVPC->SetRotation(pSelf->rotation == 0 ? ROTATION_NONE : ROTATION_NORMAL));
+
+ }
#endif
- CHECK_HR(hr = _plugin_win_mf_converter_video_ms_process(
- pSelf, buffer, pSelf->xInputSize, &pSampleOut));
-
- if(pSampleOut)
- {
- CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
-
- BYTE* pBufferPtr = NULL;
- DWORD dwDataLength = 0;
- CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
- if(dwDataLength > 0)
- {
- if(dwDataLength != pSelf->xOutputSize)
- {
- TSK_DEBUG_ERROR("Output size mismatch");
- CHECK_HR(hr = E_BOUNDS);
- }
- CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
-
- // MFCopyImage() is optimized: MMX, SSE, or SSE2
- switch(_self->dstChroma)
- {
- // Don't waste your time guessing which parameter to use: The consumer will always request RGB32. If not used for consumer then, just memcpy()
- case tmedia_chroma_rgb32:
- {
- if(pSelf->isVideoProcessor)
- {
- hr = _plugin_win_mf_converter_video_ms_copy_rgb32_down_top(
- (BYTE*)*output,
- (const BYTE*)pBufferPtr,
- (INT)pSelf->widthDst,
- (INT)pSelf->heightDst
- );
- }
- else
- {
- hr = MFCopyImage(
- (BYTE*)*output,
- (LONG)(pSelf->widthDst << 2),
- (BYTE*)pBufferPtr,
- (LONG)(pSelf->widthDst << 2),
- (DWORD)(pSelf->widthDst << 2),
- (DWORD)pSelf->heightDst
- );
- }
-
-
- if(FAILED(hr))
- {
- // unlock() before leaving
- pBufferOut->Unlock();
- CHECK_HR(hr);
- }
- break;
- }
- default:
- {
- memcpy(*output, pBufferPtr, dwDataLength);
- }
- }
- CHECK_HR(hr = pBufferOut->Unlock());
- }
- }
-
- pSelf->rtStart += pSelf->rtDuration;
+ CHECK_HR(hr = _plugin_win_mf_converter_video_ms_process(
+ pSelf, buffer, pSelf->xInputSize, &pSampleOut));
+
+ if(pSampleOut) {
+ CHECK_HR(hr = pSampleOut->GetBufferByIndex(0, &pBufferOut));
+
+ BYTE* pBufferPtr = NULL;
+ DWORD dwDataLength = 0;
+ CHECK_HR(hr = pBufferOut->GetCurrentLength(&dwDataLength));
+ if(dwDataLength > 0) {
+ if(dwDataLength != pSelf->xOutputSize) {
+ TSK_DEBUG_ERROR("Output size mismatch");
+ CHECK_HR(hr = E_BOUNDS);
+ }
+ CHECK_HR(hr = pBufferOut->Lock(&pBufferPtr, NULL, NULL));
+
+ // MFCopyImage() is optimized: MMX, SSE, or SSE2
+ switch(_self->dstChroma) {
+ // Don't waste your time guessing which parameter to use: The consumer will always request RGB32. If not used for consumer then, just memcpy()
+ case tmedia_chroma_rgb32: {
+ if(pSelf->isVideoProcessor) {
+ hr = _plugin_win_mf_converter_video_ms_copy_rgb32_down_top(
+ (BYTE*)*output,
+ (const BYTE*)pBufferPtr,
+ (INT)pSelf->widthDst,
+ (INT)pSelf->heightDst
+ );
+ }
+ else {
+ hr = MFCopyImage(
+ (BYTE*)*output,
+ (LONG)(pSelf->widthDst << 2),
+ (BYTE*)pBufferPtr,
+ (LONG)(pSelf->widthDst << 2),
+ (DWORD)(pSelf->widthDst << 2),
+ (DWORD)pSelf->heightDst
+ );
+ }
+
+
+ if(FAILED(hr)) {
+ // unlock() before leaving
+ pBufferOut->Unlock();
+ CHECK_HR(hr);
+ }
+ break;
+ }
+ default: {
+ memcpy(*output, pBufferPtr, dwDataLength);
+ }
+ }
+ CHECK_HR(hr = pBufferOut->Unlock());
+ }
+ }
+
+ pSelf->rtStart += pSelf->rtDuration;
bail:
- SafeRelease(&pSampleOut);
- SafeRelease(&pBufferOut);
+ SafeRelease(&pSampleOut);
+ SafeRelease(&pBufferOut);
- return SUCCEEDED(hr) ? pSelf->xOutputSize : 0;
+ return SUCCEEDED(hr) ? pSelf->xOutputSize : 0;
}
static tsk_object_t* plugin_win_mf_converter_video_ms_ctor(tsk_object_t * self, va_list * app)
{
- plugin_win_mf_converter_video_ms_t *pSelf = (plugin_win_mf_converter_video_ms_t *)self;
- if(pSelf){
- HRESULT hr = MFFrameRateToAverageTimePerFrame(PLUGIN_MF_VC_FPS, 1, &pSelf->rtDuration);
- if(FAILED(hr)){
- pSelf->rtDuration = 83333; // 120 FPS
- }
- }
- return self;
+ plugin_win_mf_converter_video_ms_t *pSelf = (plugin_win_mf_converter_video_ms_t *)self;
+ if(pSelf) {
+ HRESULT hr = MFFrameRateToAverageTimePerFrame(PLUGIN_MF_VC_FPS, 1, &pSelf->rtDuration);
+ if(FAILED(hr)) {
+ pSelf->rtDuration = 83333; // 120 FPS
+ }
+ }
+ return self;
}
static tsk_object_t* plugin_win_mf_converter_video_ms_dtor(tsk_object_t * self)
-{
- plugin_win_mf_converter_video_ms_t *pSelf = (plugin_win_mf_converter_video_ms_t *)self;
- if(pSelf){
- SafeRelease(&pSelf->pSampleOut);
- SafeRelease(&pSelf->pSampleIn);
- SafeRelease(&pSelf->pMFT);
+{
+ plugin_win_mf_converter_video_ms_t *pSelf = (plugin_win_mf_converter_video_ms_t *)self;
+ if(pSelf) {
+ SafeRelease(&pSelf->pSampleOut);
+ SafeRelease(&pSelf->pSampleIn);
+ SafeRelease(&pSelf->pMFT);
#if HAVE_IMFVideoProcessorControl
- SafeRelease(&pSelf->pVPC);
+ SafeRelease(&pSelf->pVPC);
#endif
- }
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t plugin_win_mf_converter_video_ms_def_s =
-{
- sizeof(plugin_win_mf_converter_video_ms_t),
- plugin_win_mf_converter_video_ms_ctor,
- plugin_win_mf_converter_video_ms_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_win_mf_converter_video_ms_def_s = {
+ sizeof(plugin_win_mf_converter_video_ms_t),
+ plugin_win_mf_converter_video_ms_ctor,
+ plugin_win_mf_converter_video_ms_dtor,
+ tsk_null,
};
const tsk_object_def_t *plugin_win_mf_converter_video_ms_def_t = &plugin_win_mf_converter_video_ms_def_s;
-static const tmedia_converter_video_plugin_def_t plugin_win_mf_converter_video_ms_plugin_def_s =
-{
- &plugin_win_mf_converter_video_ms_def_s,
-
- plugin_win_mf_converter_video_ms_init,
- plugin_win_mf_converter_video_ms_process
+static const tmedia_converter_video_plugin_def_t plugin_win_mf_converter_video_ms_plugin_def_s = {
+ &plugin_win_mf_converter_video_ms_def_s,
+
+ plugin_win_mf_converter_video_ms_init,
+ plugin_win_mf_converter_video_ms_process
};
const tmedia_converter_video_plugin_def_t *plugin_win_mf_converter_video_ms_plugin_def_t = &plugin_win_mf_converter_video_ms_plugin_def_s;
static inline tsk_size_t _plugin_win_mf_converter_video_ms_get_size(tmedia_chroma_t chroma, tsk_size_t w, tsk_size_t h)
{
- switch(chroma){
- case tmedia_chroma_rgb24:
- case tmedia_chroma_bgr24:
- return (w * h * 3);
- case tmedia_chroma_rgb565le:
- return ((w * h) << 1);
- case tmedia_chroma_rgb32:
- return ((w * h) << 2);
- case tmedia_chroma_nv21:
- return ((w * h * 3) >> 1);
- case tmedia_chroma_nv12:
- return ((w * h * 3) >> 1);
- case tmedia_chroma_yuv422p:
- return ((w * h) << 1);
- case tmedia_chroma_uyvy422:
- case tmedia_chroma_yuyv422:
- return ((w * h) << 1);
- case tmedia_chroma_yuv420p:
- return ((w * h * 3) >> 1);
- default:
- TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
- return 0;
- }
+ switch(chroma) {
+ case tmedia_chroma_rgb24:
+ case tmedia_chroma_bgr24:
+ return (w * h * 3);
+ case tmedia_chroma_rgb565le:
+ return ((w * h) << 1);
+ case tmedia_chroma_rgb32:
+ return ((w * h) << 2);
+ case tmedia_chroma_nv21:
+ return ((w * h * 3) >> 1);
+ case tmedia_chroma_nv12:
+ return ((w * h * 3) >> 1);
+ case tmedia_chroma_yuv422p:
+ return ((w * h) << 1);
+ case tmedia_chroma_uyvy422:
+ case tmedia_chroma_yuyv422:
+ return ((w * h) << 1);
+ case tmedia_chroma_yuv420p:
+ return ((w * h * 3) >> 1);
+ default:
+ TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
+ return 0;
+ }
}
static inline const GUID& _plugin_win_mf_converter_video_ms_get_pixfmt(tmedia_chroma_t chroma)
{
- switch(chroma){
- case tmedia_chroma_rgb24:
- case tmedia_chroma_bgr24:
- return MFVideoFormat_RGB24;
- case tmedia_chroma_rgb565le:
- return MFVideoFormat_RGB565;
- case tmedia_chroma_rgb32:
- return MFVideoFormat_RGB32;
- case tmedia_chroma_nv12:
- return MFVideoFormat_NV12;
- case tmedia_chroma_yuv420p:
- return MFVideoFormat_I420;
- case tmedia_chroma_yuyv422:
- return MFVideoFormat_YUY2;
- case tmedia_chroma_uyvy422:
- return MFVideoFormat_UYVY;
- default:
- TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
- return GUID_NULL;
- }
+ switch(chroma) {
+ case tmedia_chroma_rgb24:
+ case tmedia_chroma_bgr24:
+ return MFVideoFormat_RGB24;
+ case tmedia_chroma_rgb565le:
+ return MFVideoFormat_RGB565;
+ case tmedia_chroma_rgb32:
+ return MFVideoFormat_RGB32;
+ case tmedia_chroma_nv12:
+ return MFVideoFormat_NV12;
+ case tmedia_chroma_yuv420p:
+ return MFVideoFormat_I420;
+ case tmedia_chroma_yuyv422:
+ return MFVideoFormat_YUY2;
+ case tmedia_chroma_uyvy422:
+ return MFVideoFormat_UYVY;
+ default:
+ TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
+ return GUID_NULL;
+ }
}
// For RGB32:
@@ -438,72 +412,66 @@ static inline HRESULT _plugin_win_mf_converter_video_ms_copy_rgb32_down_top(
const BYTE* pSrc,
INT dwWidthInPixels,
INT dwHeightInPixels
- )
+)
{
- RGBQUAD *pSrcPixel = &((RGBQUAD*)pSrc)[(dwWidthInPixels * dwHeightInPixels) - dwWidthInPixels];
+ RGBQUAD *pSrcPixel = &((RGBQUAD*)pSrc)[(dwWidthInPixels * dwHeightInPixels) - dwWidthInPixels];
RGBQUAD *pDestPixel = &((RGBQUAD*)pDst)[0];
- register INT x;
- register INT y;
+ register INT x;
+ register INT y;
- for (y = dwHeightInPixels; y > 0 ; --y)
- {
- for (x = 0; x < dwWidthInPixels; ++x)
- {
+ for (y = dwHeightInPixels; y > 0 ; --y) {
+ for (x = 0; x < dwWidthInPixels; ++x) {
pDestPixel[x] = pSrcPixel[x];
}
pDestPixel += dwWidthInPixels;
pSrcPixel -= dwWidthInPixels;
}
- return S_OK;
+ return S_OK;
}
static HRESULT _plugin_win_mf_converter_video_ms_process_input(plugin_win_mf_converter_video_ms_t* pSelf, IMFSample* pSample)
{
- return pSelf->pMFT->ProcessInput(0, pSample, 0);
+ return pSelf->pMFT->ProcessInput(0, pSample, 0);
}
static HRESULT _plugin_win_mf_converter_video_ms_process_output(plugin_win_mf_converter_video_ms_t* pSelf, IMFSample **ppSample)
{
- *ppSample = NULL;
+ *ppSample = NULL;
IMFMediaBuffer* pBufferOut = NULL;
DWORD dwStatus;
- HRESULT hr = S_OK;
-
+ HRESULT hr = S_OK;
+
MFT_OUTPUT_STREAM_INFO mftStreamInfo = { 0 };
MFT_OUTPUT_DATA_BUFFER mftOutputData = { 0 };
- CHECK_HR(hr = pSelf->pMFT->GetOutputStreamInfo(0, &mftStreamInfo));
-
- if(!pSelf->pSampleOut)
- {
- CHECK_HR(hr = MFUtils::CreateMediaSample(mftStreamInfo.cbSize, &pSelf->pSampleOut));
- hr = pSelf->pSampleOut->GetBufferByIndex(0, &pBufferOut);
- if(FAILED(hr))
- {
- SafeRelease(&pSelf->pSampleOut);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = pSelf->pSampleOut->GetBufferByIndex(0, &pBufferOut));
- CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < mftStreamInfo.cbSize)
- {
- CHECK_HR(hr = pSelf->pSampleOut->RemoveAllBuffers());
- SafeRelease(&pBufferOut);
- CHECK_HR(hr = MFCreateMemoryBuffer(mftStreamInfo.cbSize, &pBufferOut));
- CHECK_HR(hr = pSelf->pSampleOut->AddBuffer(pBufferOut));
- }
- }
-
- CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
-
+ CHECK_HR(hr = pSelf->pMFT->GetOutputStreamInfo(0, &mftStreamInfo));
+
+ if(!pSelf->pSampleOut) {
+ CHECK_HR(hr = MFUtils::CreateMediaSample(mftStreamInfo.cbSize, &pSelf->pSampleOut));
+ hr = pSelf->pSampleOut->GetBufferByIndex(0, &pBufferOut);
+ if(FAILED(hr)) {
+ SafeRelease(&pSelf->pSampleOut);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = pSelf->pSampleOut->GetBufferByIndex(0, &pBufferOut));
+ CHECK_HR(hr = pBufferOut->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < mftStreamInfo.cbSize) {
+ CHECK_HR(hr = pSelf->pSampleOut->RemoveAllBuffers());
+ SafeRelease(&pBufferOut);
+ CHECK_HR(hr = MFCreateMemoryBuffer(mftStreamInfo.cbSize, &pBufferOut));
+ CHECK_HR(hr = pSelf->pSampleOut->AddBuffer(pBufferOut));
+ }
+ }
+
+ CHECK_HR(hr = pBufferOut->SetCurrentLength(0));
+
//Set the output sample
mftOutputData.pSample = pSelf->pSampleOut;
//Set the output id
@@ -529,72 +497,64 @@ bail:
static HRESULT _plugin_win_mf_converter_video_ms_process(plugin_win_mf_converter_video_ms_t* pSelf, const void* pcInputPtr, UINT32 nInputSize, IMFSample **ppSampleOut)
{
- if(!pcInputPtr || !nInputSize || !ppSampleOut)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return E_INVALIDARG;
- }
-
- *ppSampleOut = NULL;
-
- HRESULT hr = S_OK;
-
- IMFMediaBuffer* pBufferIn = NULL;
- BYTE* pBufferPtr = NULL;
-
- if(!pSelf->pSampleIn)
- {
- CHECK_HR(hr = MFUtils::CreateMediaSample(nInputSize, &pSelf->pSampleIn));
- hr = pSelf->pSampleIn->GetBufferByIndex(0, &pBufferIn);
- if(FAILED(hr))
- {
- SafeRelease(&pSelf->pSampleIn);
- CHECK_HR(hr);
- }
- }
- else
- {
- DWORD dwMaxLength = 0;
- CHECK_HR(hr = pSelf->pSampleIn->GetBufferByIndex(0, &pBufferIn));
- CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
- if(dwMaxLength < nInputSize)
- {
- CHECK_HR(hr = pSelf->pSampleIn->RemoveAllBuffers());
- SafeRelease(&pBufferIn);
- CHECK_HR(hr = MFCreateMemoryBuffer(nInputSize, &pBufferIn));
- CHECK_HR(hr = pSelf->pSampleIn->AddBuffer(pBufferIn));
- }
- }
-
- CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
- memcpy(pBufferPtr, pcInputPtr, nInputSize);
- CHECK_HR(hr = pBufferIn->Unlock());
- CHECK_HR(hr = pBufferIn->SetCurrentLength(nInputSize));
-
- CHECK_HR(hr = pSelf->pSampleIn->SetSampleDuration(pSelf->rtDuration));
- CHECK_HR(hr = pSelf->pSampleIn->SetSampleTime(pSelf->rtStart));
-
- hr = _plugin_win_mf_converter_video_ms_process_input(pSelf, pSelf->pSampleIn);
- while(hr == MF_E_NOTACCEPTING)
- {
- TSK_DEBUG_INFO("MF_E_NOTACCEPTING");
- IMFSample* pSample = NULL;
- hr = _plugin_win_mf_converter_video_ms_process_output(pSelf, &pSample);
- if(SUCCEEDED(hr) && pSample)
- {
- SafeRelease(ppSampleOut);
- *ppSampleOut = pSample, pSample = NULL;
-
- hr = pSelf->pSampleIn->SetUINT32(MFSampleExtension_Discontinuity, TRUE);
- hr = _plugin_win_mf_converter_video_ms_process_input(pSelf, pSelf->pSampleIn);
- }
- }
- if(!*ppSampleOut)
- {
- CHECK_HR(hr = _plugin_win_mf_converter_video_ms_process_output(pSelf, ppSampleOut));
- }
-
+ if(!pcInputPtr || !nInputSize || !ppSampleOut) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return E_INVALIDARG;
+ }
+
+ *ppSampleOut = NULL;
+
+ HRESULT hr = S_OK;
+
+ IMFMediaBuffer* pBufferIn = NULL;
+ BYTE* pBufferPtr = NULL;
+
+ if(!pSelf->pSampleIn) {
+ CHECK_HR(hr = MFUtils::CreateMediaSample(nInputSize, &pSelf->pSampleIn));
+ hr = pSelf->pSampleIn->GetBufferByIndex(0, &pBufferIn);
+ if(FAILED(hr)) {
+ SafeRelease(&pSelf->pSampleIn);
+ CHECK_HR(hr);
+ }
+ }
+ else {
+ DWORD dwMaxLength = 0;
+ CHECK_HR(hr = pSelf->pSampleIn->GetBufferByIndex(0, &pBufferIn));
+ CHECK_HR(hr = pBufferIn->GetMaxLength(&dwMaxLength));
+ if(dwMaxLength < nInputSize) {
+ CHECK_HR(hr = pSelf->pSampleIn->RemoveAllBuffers());
+ SafeRelease(&pBufferIn);
+ CHECK_HR(hr = MFCreateMemoryBuffer(nInputSize, &pBufferIn));
+ CHECK_HR(hr = pSelf->pSampleIn->AddBuffer(pBufferIn));
+ }
+ }
+
+ CHECK_HR(hr = pBufferIn->Lock(&pBufferPtr, NULL, NULL));
+ memcpy(pBufferPtr, pcInputPtr, nInputSize);
+ CHECK_HR(hr = pBufferIn->Unlock());
+ CHECK_HR(hr = pBufferIn->SetCurrentLength(nInputSize));
+
+ CHECK_HR(hr = pSelf->pSampleIn->SetSampleDuration(pSelf->rtDuration));
+ CHECK_HR(hr = pSelf->pSampleIn->SetSampleTime(pSelf->rtStart));
+
+ hr = _plugin_win_mf_converter_video_ms_process_input(pSelf, pSelf->pSampleIn);
+ while(hr == MF_E_NOTACCEPTING) {
+ TSK_DEBUG_INFO("MF_E_NOTACCEPTING");
+ IMFSample* pSample = NULL;
+ hr = _plugin_win_mf_converter_video_ms_process_output(pSelf, &pSample);
+ if(SUCCEEDED(hr) && pSample) {
+ SafeRelease(ppSampleOut);
+ *ppSampleOut = pSample, pSample = NULL;
+
+ hr = pSelf->pSampleIn->SetUINT32(MFSampleExtension_Discontinuity, TRUE);
+ hr = _plugin_win_mf_converter_video_ms_process_input(pSelf, pSelf->pSampleIn);
+ }
+ }
+ if(!*ppSampleOut) {
+ CHECK_HR(hr = _plugin_win_mf_converter_video_ms_process_output(pSelf, ppSampleOut));
+ }
+
bail:
- SafeRelease(&pBufferIn);
- return hr;
+ SafeRelease(&pBufferIn);
+ return hr;
} \ No newline at end of file
diff --git a/plugins/pluginWinMF/plugin_win_mf_producer_audio.cxx b/plugins/pluginWinMF/plugin_win_mf_producer_audio.cxx
index 2a3c314..5745b24 100755
--- a/plugins/pluginWinMF/plugin_win_mf_producer_audio.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_producer_audio.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,12 +28,11 @@
static void* TSK_STDCALL RunSessionThread(void *pArg);
-typedef struct plugin_win_mf_producer_audio_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
+typedef struct plugin_win_mf_producer_audio_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
- bool bStarted;
- tsk_thread_handle_t* ppTread[1];
+ bool bStarted;
+ tsk_thread_handle_t* ppTread[1];
DeviceListAudio* pDeviceList;
@@ -48,162 +47,162 @@ plugin_win_mf_producer_audio_t;
/* ============ Media Producer Interface ================= */
static int plugin_win_mf_producer_audio_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
- plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
- if(param->plugin_type == tmedia_ppt_producer){
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(pSelf), param);
+{
+ plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(pSelf), param);
}
static int plugin_win_mf_producer_audio_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
-
- if(!pSelf || !codec){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_PRODUCER(pSelf)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(pSelf)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(pSelf)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
-
- TSK_DEBUG_INFO("MF audio producer: channels=%d, rate=%d, ptime=%d",
- TMEDIA_PRODUCER(pSelf)->audio.channels,
- TMEDIA_PRODUCER(pSelf)->audio.rate,
- TMEDIA_PRODUCER(pSelf)->audio.ptime
- );
-
- HRESULT hr = S_OK;
-
- // create device list object
- if(!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceListAudio())){
- TSK_DEBUG_ERROR("Failed to create device list");
- hr = E_OUTOFMEMORY;
- goto bail;
- }
- // enumerate devices
- hr = pSelf->pDeviceList->EnumerateDevices();
- if(!SUCCEEDED(hr)){
- goto bail;
- }
-
- // check if we have at least one MF video source connected to the PC
- if(pSelf->pDeviceList->Count() == 0){
- TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
- // do not break the negotiation as one-way video connection is a valid use-case
- }
- else{
- IMFActivate* pActivate = NULL;
- // Get best MF audio source
- hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
- if(!SUCCEEDED(hr) || !pActivate){
- TSK_DEBUG_ERROR("Failed to get best MF audio source");
- if(!pActivate){
- hr = E_OUTOFMEMORY;
- }
- goto bail;
- }
-
- // Create the media source for the device.
- hr = pActivate->ActivateObject(
- __uuidof(IMFMediaSource),
- (void**)&pSelf->pSource
- );
- SafeRelease(&pActivate);
- if(!SUCCEEDED(hr)){
- TSK_DEBUG_ERROR("ActivateObject(MF audio source) failed");
- goto bail;
- }
-
- // Create and configure the media type
- CHECK_HR(hr = MFCreateMediaType(&pSelf->pType));
- CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio));
- CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, TMEDIA_PRODUCER(pSelf)->audio.channels));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, TMEDIA_PRODUCER(pSelf)->audio.rate));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, TMEDIA_PRODUCER(pSelf)->audio.bits_per_sample));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE)); // because uncompressed media type
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE));
- UINT32 nBlockAlign = TMEDIA_PRODUCER(pSelf)->audio.channels * (TMEDIA_PRODUCER(pSelf)->audio.bits_per_sample >> 3);
- UINT32 nAvgBytesPerSec = (nBlockAlign * TMEDIA_PRODUCER(pSelf)->audio.rate);
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, nBlockAlign));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, nAvgBytesPerSec));
-
- // Create the sample grabber sink.
- CHECK_HR(hr = SampleGrabberCB::CreateInstance(TMEDIA_PRODUCER(pSelf), &pSelf->pCallback));
- CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pType, pSelf->pCallback, &pSelf->pSinkActivate));
-
- // To run as fast as possible, set this attribute (requires Windows 7):
- CHECK_HR(hr = pSelf->pSinkActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
-
- // Create the Media Session.
- CHECK_HR(hr = MFCreateMediaSession(NULL, &pSelf->pSession));
-
- // Create the topology.
- CHECK_HR(hr = MFUtils::CreateTopology(pSelf->pSource, NULL/*NO ENCODER*/, pSelf->pSinkActivate, NULL/*Preview*/, pSelf->pType, &pSelf->pTopology));
- }
+ plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
+
+ if(!pSelf || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_PRODUCER(pSelf)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(pSelf)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(pSelf)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+
+ TSK_DEBUG_INFO("MF audio producer: channels=%d, rate=%d, ptime=%d",
+ TMEDIA_PRODUCER(pSelf)->audio.channels,
+ TMEDIA_PRODUCER(pSelf)->audio.rate,
+ TMEDIA_PRODUCER(pSelf)->audio.ptime
+ );
+
+ HRESULT hr = S_OK;
+
+ // create device list object
+ if(!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceListAudio())) {
+ TSK_DEBUG_ERROR("Failed to create device list");
+ hr = E_OUTOFMEMORY;
+ goto bail;
+ }
+ // enumerate devices
+ hr = pSelf->pDeviceList->EnumerateDevices();
+ if(!SUCCEEDED(hr)) {
+ goto bail;
+ }
+
+ // check if we have at least one MF video source connected to the PC
+ if(pSelf->pDeviceList->Count() == 0) {
+ TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
+ // do not break the negotiation as one-way video connection is a valid use-case
+ }
+ else {
+ IMFActivate* pActivate = NULL;
+ // Get best MF audio source
+ hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
+ if(!SUCCEEDED(hr) || !pActivate) {
+ TSK_DEBUG_ERROR("Failed to get best MF audio source");
+ if(!pActivate) {
+ hr = E_OUTOFMEMORY;
+ }
+ goto bail;
+ }
+
+ // Create the media source for the device.
+ hr = pActivate->ActivateObject(
+ __uuidof(IMFMediaSource),
+ (void**)&pSelf->pSource
+ );
+ SafeRelease(&pActivate);
+ if(!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("ActivateObject(MF audio source) failed");
+ goto bail;
+ }
+
+ // Create and configure the media type
+ CHECK_HR(hr = MFCreateMediaType(&pSelf->pType));
+ CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio));
+ CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, TMEDIA_PRODUCER(pSelf)->audio.channels));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, TMEDIA_PRODUCER(pSelf)->audio.rate));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, TMEDIA_PRODUCER(pSelf)->audio.bits_per_sample));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE)); // because uncompressed media type
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE));
+ UINT32 nBlockAlign = TMEDIA_PRODUCER(pSelf)->audio.channels * (TMEDIA_PRODUCER(pSelf)->audio.bits_per_sample >> 3);
+ UINT32 nAvgBytesPerSec = (nBlockAlign * TMEDIA_PRODUCER(pSelf)->audio.rate);
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, nBlockAlign));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, nAvgBytesPerSec));
+
+ // Create the sample grabber sink.
+ CHECK_HR(hr = SampleGrabberCB::CreateInstance(TMEDIA_PRODUCER(pSelf), &pSelf->pCallback));
+ CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pType, pSelf->pCallback, &pSelf->pSinkActivate));
+
+ // To run as fast as possible, set this attribute (requires Windows 7):
+ CHECK_HR(hr = pSelf->pSinkActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
+
+ // Create the Media Session.
+ CHECK_HR(hr = MFCreateMediaSession(NULL, &pSelf->pSession));
+
+ // Create the topology.
+ CHECK_HR(hr = MFUtils::CreateTopology(pSelf->pSource, NULL/*NO ENCODER*/, pSelf->pSinkActivate, NULL/*Preview*/, pSelf->pType, &pSelf->pTopology));
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_audio_start(tmedia_producer_t* self)
{
- plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
-
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(pSelf->bStarted){
- TSK_DEBUG_INFO("MF audio producer already started");
- return 0;
- }
-
- HRESULT hr = S_OK;
-
- // Run the media session.
- CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
-
- // Start asynchronous watcher thread
- pSelf->bStarted = true;
- int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
- if(ret != 0) {
- TSK_DEBUG_ERROR("Failed to create thread");
- hr = E_FAIL;
- pSelf->bStarted = false;
- if(pSelf->ppTread[0]){
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
- goto bail;
- }
+ plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
+
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF audio producer already started");
+ return 0;
+ }
+
+ HRESULT hr = S_OK;
+
+ // Run the media session.
+ CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
+
+ // Start asynchronous watcher thread
+ pSelf->bStarted = true;
+ int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
+ if(ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ hr = E_FAIL;
+ pSelf->bStarted = false;
+ if(pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
+ goto bail;
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_audio_pause(tmedia_producer_t* self)
{
- plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
+ plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
+ HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_audio_stop(tmedia_producer_t* self)
{
- plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
-
- if(!pSelf){
+ plugin_win_mf_producer_audio_t* pSelf = (plugin_win_mf_producer_audio_t*)self;
+
+ if(!pSelf) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -213,7 +212,7 @@ static int plugin_win_mf_producer_audio_stop(tmedia_producer_t* self)
// for the thread
pSelf->bStarted = false;
hr = MFUtils::ShutdownSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
- if(pSelf->ppTread[0]){
+ if(pSelf->ppTread[0]) {
tsk_thread_join(&pSelf->ppTread[0]);
}
hr = MFUtils::ShutdownSession(NULL, pSelf->pSource); // stop source to release the camera
@@ -228,37 +227,37 @@ static int plugin_win_mf_producer_audio_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* plugin_win_mf_producer_audio_ctor(tsk_object_t * self, va_list * app)
{
- MFUtils::Startup();
-
- plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t*)self;
- if(pSelf){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(pSelf));
- /* init self */
-
- }
- return self;
+ MFUtils::Startup();
+
+ plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t*)self;
+ if(pSelf) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(pSelf));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_mf_producer_audio_dtor(tsk_object_t * self)
-{
- plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t *)self;
- if(pSelf){
- /* stop */
- if(pSelf->bStarted){
- plugin_win_mf_producer_audio_stop(TMEDIA_PRODUCER(pSelf));
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(pSelf));
- /* deinit self */
- if(pSelf->pDeviceList){
- delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
+{
+ plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t *)self;
+ if(pSelf) {
+ /* stop */
+ if(pSelf->bStarted) {
+ plugin_win_mf_producer_audio_stop(TMEDIA_PRODUCER(pSelf));
}
- if(pSelf->pSource){
- pSelf->pSource->Shutdown();
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(pSelf));
+ /* deinit self */
+ if(pSelf->pDeviceList) {
+ delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
+ }
+ if(pSelf->pSource) {
+ pSelf->pSource->Shutdown();
}
- if(pSelf->pSession){
+ if(pSelf->pSession) {
pSelf->pSession->Shutdown();
}
@@ -268,31 +267,29 @@ static tsk_object_t* plugin_win_mf_producer_audio_dtor(tsk_object_t * self)
SafeRelease(&pSelf->pSinkActivate);
SafeRelease(&pSelf->pTopology);
SafeRelease(&pSelf->pType);
- }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_mf_producer_audio_def_s =
-{
- sizeof(plugin_win_mf_producer_audio_t),
- plugin_win_mf_producer_audio_ctor,
- plugin_win_mf_producer_audio_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t plugin_win_mf_producer_audio_def_s = {
+ sizeof(plugin_win_mf_producer_audio_t),
+ plugin_win_mf_producer_audio_ctor,
+ plugin_win_mf_producer_audio_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_win_mf_producer_audio_plugin_def_s =
-{
- &plugin_win_mf_producer_audio_def_s,
-
- tmedia_audio,
- "Media Foundation audio producer",
-
- plugin_win_mf_producer_audio_set,
- plugin_win_mf_producer_audio_prepare,
- plugin_win_mf_producer_audio_start,
- plugin_win_mf_producer_audio_pause,
- plugin_win_mf_producer_audio_stop
+static const tmedia_producer_plugin_def_t plugin_win_mf_producer_audio_plugin_def_s = {
+ &plugin_win_mf_producer_audio_def_s,
+
+ tmedia_audio,
+ "Media Foundation audio producer",
+
+ plugin_win_mf_producer_audio_set,
+ plugin_win_mf_producer_audio_prepare,
+ plugin_win_mf_producer_audio_start,
+ plugin_win_mf_producer_audio_pause,
+ plugin_win_mf_producer_audio_stop
};
const tmedia_producer_plugin_def_t *plugin_win_mf_producer_audio_plugin_def_t = &plugin_win_mf_producer_audio_plugin_def_s;
@@ -300,34 +297,32 @@ const tmedia_producer_plugin_def_t *plugin_win_mf_producer_audio_plugin_def_t =
// Run session async thread
static void* TSK_STDCALL RunSessionThread(void *pArg)
{
- plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t *)pArg;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- IMFMediaEvent *pEvent = NULL;
- MediaEventType met;
-
- TSK_DEBUG_INFO("RunSessionThread (audio) - ENTER");
-
- while(pSelf->bStarted){
- CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
- CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- CHECK_HR(hr = pEvent->GetType(&met));
-
- if (FAILED(hrStatus))
- {
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
- hr = hrStatus;
- goto bail;
- }
- if (met == MESessionEnded)
- {
- break;
- }
- SafeRelease(&pEvent);
- }
+ plugin_win_mf_producer_audio_t *pSelf = (plugin_win_mf_producer_audio_t *)pArg;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ IMFMediaEvent *pEvent = NULL;
+ MediaEventType met;
+
+ TSK_DEBUG_INFO("RunSessionThread (audio) - ENTER");
+
+ while(pSelf->bStarted) {
+ CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
+ CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
+ CHECK_HR(hr = pEvent->GetType(&met));
+
+ if (FAILED(hrStatus)) {
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ hr = hrStatus;
+ goto bail;
+ }
+ if (met == MESessionEnded) {
+ break;
+ }
+ SafeRelease(&pEvent);
+ }
bail:
- TSK_DEBUG_INFO("RunSessionThread (audio) - EXIT");
+ TSK_DEBUG_INFO("RunSessionThread (audio) - EXIT");
- return NULL;
+ return NULL;
}
diff --git a/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx b/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx
index f20f9e4..e4bf690 100755
--- a/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx
@@ -50,7 +50,7 @@
#endif /* PLUGIN_MF_GOP_SIZE_IN_SECONDS */
DEFINE_GUID(PLUGIN_MF_LOW_LATENCY,
- 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
+ 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee);
extern const tmedia_codec_plugin_def_t *mf_codec_h264_main_plugin_def_t;
extern const tmedia_codec_plugin_def_t *mf_codec_h264_base_plugin_def_t;
@@ -61,548 +61,527 @@ static int _plugin_win_mf_producer_video_unprepare(struct plugin_win_mf_producer
//
// plugin_win_mf_producer_video_t
//
-typedef struct plugin_win_mf_producer_video_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- bool bStarted, bPrepared, bMuted;
- tsk_thread_handle_t* ppTread[1];
- HWND hWndPreview;
-
- int32_t bitrate_bps; // used when encoder bundled only
-
- DeviceListVideo* pDeviceList;
-
- MFCodecVideo *pEncoder;
- IMFMediaSession *pSession;
- IMFMediaSource *pSource;
- SampleGrabberCB *pCallback;
- IMFActivate *pSinkGrabber;
- IMFActivate *pSinkActivatePreview;
- DisplayWatcher* pWatcherPreview;
- IMFTopology *pTopology;
- IMFMediaType *pGrabberInputType;
+typedef struct plugin_win_mf_producer_video_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ bool bStarted, bPrepared, bMuted;
+ tsk_thread_handle_t* ppTread[1];
+ HWND hWndPreview;
+
+ int32_t bitrate_bps; // used when encoder bundled only
+
+ DeviceListVideo* pDeviceList;
+
+ MFCodecVideo *pEncoder;
+ IMFMediaSession *pSession;
+ IMFMediaSource *pSource;
+ SampleGrabberCB *pCallback;
+ IMFActivate *pSinkGrabber;
+ IMFActivate *pSinkActivatePreview;
+ DisplayWatcher* pWatcherPreview;
+ IMFTopology *pTopology;
+ IMFMediaType *pGrabberInputType;
}
plugin_win_mf_producer_video_t;
/* ============ Video MF Producer Interface ================= */
static int plugin_win_mf_producer_video_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- HRESULT hr = S_OK;
- plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
-
- if (!pSelf || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- HRESULT hr = S_OK;
- switch (action){
- case tmedia_codec_action_encode_idr:
- {
- if (pSelf->pEncoder)
- {
- CHECK_HR(hr = pSelf->pEncoder->RequestKeyFrame());
- }
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- pSelf->bitrate_bps = TSK_CLAMP(0, (int32_t)((pSelf->bitrate_bps << 1) / 3), TMEDIA_CODEC(pSelf)->bandwidth_max_upload);
- TSK_DEBUG_INFO("New target bitrate = %d kbps", pSelf->bitrate_bps);
- if (pSelf->pEncoder)
- {
- CHECK_HR(hr = pSelf->pEncoder->SetBitRate(pSelf->bitrate_bps));
- }
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- pSelf->bitrate_bps = TSK_CLAMP(0, (int32_t)((pSelf->bitrate_bps * 3) >> 1), TMEDIA_CODEC(pSelf)->bandwidth_max_upload);
- TSK_DEBUG_INFO("New target bitrate = %d kbps", pSelf->bitrate_bps);
- if (pSelf->pEncoder)
- {
- CHECK_HR(hr = pSelf->pEncoder->SetBitRate(pSelf->bitrate_bps));
- }
- break;
- }
- }
- }
- else if (param->value_type == tmedia_pvt_int64){
- if (tsk_striequals(param->key, "local-hwnd")){
- HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
- if (hWnd != pSelf->hWndPreview)
- {
- pSelf->hWndPreview = hWnd;
- if (pSelf->pWatcherPreview)
- {
- CHECK_HR(hr = pSelf->pWatcherPreview->SetHwnd(hWnd));
- }
- }
- }
- }
- else if (param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "mute")){
- pSelf->bMuted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- if (pSelf->pCallback) {
- pSelf->pCallback->SetMute(pSelf->bMuted);
- }
+ int ret = 0;
+ HRESULT hr = S_OK;
+ plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
+
+ if (!pSelf || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ HRESULT hr = S_OK;
+ switch (action) {
+ case tmedia_codec_action_encode_idr: {
+ if (pSelf->pEncoder) {
+ CHECK_HR(hr = pSelf->pEncoder->RequestKeyFrame());
+ }
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ pSelf->bitrate_bps = TSK_CLAMP(0, (int32_t)((pSelf->bitrate_bps << 1) / 3), TMEDIA_CODEC(pSelf)->bandwidth_max_upload);
+ TSK_DEBUG_INFO("New target bitrate = %d kbps", pSelf->bitrate_bps);
+ if (pSelf->pEncoder) {
+ CHECK_HR(hr = pSelf->pEncoder->SetBitRate(pSelf->bitrate_bps));
+ }
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ pSelf->bitrate_bps = TSK_CLAMP(0, (int32_t)((pSelf->bitrate_bps * 3) >> 1), TMEDIA_CODEC(pSelf)->bandwidth_max_upload);
+ TSK_DEBUG_INFO("New target bitrate = %d kbps", pSelf->bitrate_bps);
+ if (pSelf->pEncoder) {
+ CHECK_HR(hr = pSelf->pEncoder->SetBitRate(pSelf->bitrate_bps));
+ }
+ break;
+ }
+ }
+ }
+ else if (param->value_type == tmedia_pvt_int64) {
+ if (tsk_striequals(param->key, "local-hwnd")) {
+ HWND hWnd = reinterpret_cast<HWND>((INT64)*((int64_t*)param->value));
+ if (hWnd != pSelf->hWndPreview) {
+ pSelf->hWndPreview = hWnd;
+ if (pSelf->pWatcherPreview) {
+ CHECK_HR(hr = pSelf->pWatcherPreview->SetHwnd(hWnd));
+ }
+ }
+ }
+ }
+ else if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "mute")) {
+ pSelf->bMuted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ if (pSelf->pCallback) {
+ pSelf->pCallback->SetMute(pSelf->bMuted);
+ }
#if 0
- if (pSelf->bStarted && pSelf->pSession) {
- if (pSelf->bMuted) {
- pSelf->pSession->Pause();
- }
- else {
- CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
- }
- }
+ if (pSelf->bStarted && pSelf->pSession) {
+ if (pSelf->bMuted) {
+ pSelf->pSession->Pause();
+ }
+ else {
+ CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
+ }
+ }
#endif
- }
- else if (tsk_striequals(param->key, "create-on-current-thead")){
- //producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
- }
- else if (tsk_striequals(param->key, "plugin-firefox")){
- //producer->plugin_firefox = (*((int32_t*)param->value) != 0);
- //if(producer->grabber){
- // producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
- //}
- }
- }
+ }
+ else if (tsk_striequals(param->key, "create-on-current-thead")) {
+ //producer->create_on_ui_thread = *((int32_t*)param->value) ? tsk_false : tsk_true;
+ }
+ else if (tsk_striequals(param->key, "plugin-firefox")) {
+ //producer->plugin_firefox = (*((int32_t*)param->value) != 0);
+ //if(producer->grabber){
+ // producer->grabber->setPluginFirefox((producer->plugin_firefox == tsk_true));
+ //}
+ }
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_video_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
-
- if (!pSelf || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (pSelf->bPrepared){
- TSK_DEBUG_WARN("MF video producer already prepared");
- return -1;
- }
-
- // FIXME: DirectShow requires flipping but not MF
- // The Core library always tries to flip when OSType==Win32. Must be changed
- TMEDIA_CODEC_VIDEO(codec)->out.flip = tsk_false;
-
- TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
- TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
-
- TSK_DEBUG_INFO("MF video producer: fps=%d, width=%d, height=%d",
- TMEDIA_PRODUCER(pSelf)->video.fps,
- TMEDIA_PRODUCER(pSelf)->video.width,
- TMEDIA_PRODUCER(pSelf)->video.height);
-
- HRESULT hr = S_OK;
- IMFAttributes* pSessionAttributes = NULL;
- IMFTopology *pTopology = NULL;
- IMFMediaSink* pEvr = NULL;
- IMFMediaType* pEncoderInputType = NULL;
- IMFTopologyNode *pNodeGrabber = NULL;
- IMFMediaType* pGrabberNegotiatedInputMedia = NULL;
- BOOL bVideoProcessorIsSupported = FALSE;
- const VideoSubTypeGuidPair *pcPreferredSubTypeGuidPair = NULL;
-
- // create device list object
- if (!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceListVideo())){
- TSK_DEBUG_ERROR("Failed to create device list");
- hr = E_OUTOFMEMORY;
- goto bail;
- }
- // enumerate devices
- hr = pSelf->pDeviceList->EnumerateDevices();
- if (!SUCCEEDED(hr)){
- goto bail;
- }
-
- // check if we have at least one MF video source connected to the PC
- if (pSelf->pDeviceList->Count() == 0){
- TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
- // do not break the negotiation as one-way video connection is a valid use-case
- }
- else{
- // Get best MF video source
- IMFActivate* pActivate = NULL;
- const char* pczSrcFriendlyName = tmedia_producer_get_friendly_name(tmedia_video);
- if (!tsk_strnullORempty(pczSrcFriendlyName)) {
- TSK_DEBUG_INFO("MF pref. video source = %s", pczSrcFriendlyName);
- wchar_t pczwSrcFriendlyName[MAX_PATH] = { 0 };
- mbstowcs(pczwSrcFriendlyName, pczSrcFriendlyName, sizeof(pczwSrcFriendlyName) / sizeof(pczwSrcFriendlyName[0]));
- hr = pSelf->pDeviceList->GetDeviceBest(&pActivate, pczwSrcFriendlyName);
- }
- else {
- hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
- }
- if (!SUCCEEDED(hr) || !pActivate){
- TSK_DEBUG_ERROR("Failed to get best MF video source");
- if (!pActivate){
- hr = E_OUTOFMEMORY;
- }
- goto bail;
- }
-
- // Create the media source for the device.
- hr = pActivate->ActivateObject(
- __uuidof(IMFMediaSource),
- (void**)&pSelf->pSource
- );
- SafeRelease(&pActivate);
- if (!SUCCEEDED(hr)){
- TSK_DEBUG_ERROR("ActivateObject(MF video source) failed");
- goto bail;
- }
-
- // Check whether video processor (http://msdn.microsoft.com/en-us/library/windows/desktop/hh162913(v=vs.85).aspx) is supported
- CHECK_HR(hr = MFUtils::IsVideoProcessorSupported(&bVideoProcessorIsSupported));
-
- // Must not be set because not supported by Frame Rate Converter DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819100(v=vs.85).aspx).aspx) because of color (neither I420 nor NV12)
- // Video Processor (http://msdn.microsoft.com/en-us/library/windows/desktop/hh162913(v=vs.85).aspx) supports both NV12 and I420
- if (!bVideoProcessorIsSupported) {
- UINT32 nWidth, nHeight, nFps;
- hr = MFUtils::GetBestFormat(
- pSelf->pSource,
- &MFVideoFormat_I420,
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.width,
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.height,
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps,
- &nWidth,
- &nHeight,
- &nFps,
- &pcPreferredSubTypeGuidPair
- );
- if (SUCCEEDED(hr))
- {
- TSK_DEBUG_INFO("Video processor not supported...using source fps=%u, width=%u, height=%u", nFps, nWidth, nHeight);
- TMEDIA_PRODUCER(pSelf)->video.width = nWidth;
- TMEDIA_PRODUCER(pSelf)->video.height = nHeight;
- TMEDIA_PRODUCER(pSelf)->video.fps = nFps;
- }
- }
-
- // If H.264 is negotiated for this session then, try to find hardware encoder
- // If no HW encoder is found will fallback to SW implementation from x264
+ plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
+
+ if (!pSelf || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (pSelf->bPrepared) {
+ TSK_DEBUG_WARN("MF video producer already prepared");
+ return -1;
+ }
+
+ // FIXME: DirectShow requires flipping but not MF
+ // The Core library always tries to flip when OSType==Win32. Must be changed
+ TMEDIA_CODEC_VIDEO(codec)->out.flip = tsk_false;
+
+ TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+ TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
+
+ TSK_DEBUG_INFO("MF video producer: fps=%d, width=%d, height=%d",
+ TMEDIA_PRODUCER(pSelf)->video.fps,
+ TMEDIA_PRODUCER(pSelf)->video.width,
+ TMEDIA_PRODUCER(pSelf)->video.height);
+
+ HRESULT hr = S_OK;
+ IMFAttributes* pSessionAttributes = NULL;
+ IMFTopology *pTopology = NULL;
+ IMFMediaSink* pEvr = NULL;
+ IMFMediaType* pEncoderInputType = NULL;
+ IMFTopologyNode *pNodeGrabber = NULL;
+ IMFMediaType* pGrabberNegotiatedInputMedia = NULL;
+ BOOL bVideoProcessorIsSupported = FALSE;
+ const VideoSubTypeGuidPair *pcPreferredSubTypeGuidPair = NULL;
+
+ // create device list object
+ if (!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceListVideo())) {
+ TSK_DEBUG_ERROR("Failed to create device list");
+ hr = E_OUTOFMEMORY;
+ goto bail;
+ }
+ // enumerate devices
+ hr = pSelf->pDeviceList->EnumerateDevices();
+ if (!SUCCEEDED(hr)) {
+ goto bail;
+ }
+
+ // check if we have at least one MF video source connected to the PC
+ if (pSelf->pDeviceList->Count() == 0) {
+ TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
+ // do not break the negotiation as one-way video connection is a valid use-case
+ }
+ else {
+ // Get best MF video source
+ IMFActivate* pActivate = NULL;
+ const char* pczSrcFriendlyName = tmedia_producer_get_friendly_name(tmedia_video);
+ if (!tsk_strnullORempty(pczSrcFriendlyName)) {
+ TSK_DEBUG_INFO("MF pref. video source = %s", pczSrcFriendlyName);
+ wchar_t pczwSrcFriendlyName[MAX_PATH] = { 0 };
+ mbstowcs(pczwSrcFriendlyName, pczSrcFriendlyName, sizeof(pczwSrcFriendlyName) / sizeof(pczwSrcFriendlyName[0]));
+ hr = pSelf->pDeviceList->GetDeviceBest(&pActivate, pczwSrcFriendlyName);
+ }
+ else {
+ hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
+ }
+ if (!SUCCEEDED(hr) || !pActivate) {
+ TSK_DEBUG_ERROR("Failed to get best MF video source");
+ if (!pActivate) {
+ hr = E_OUTOFMEMORY;
+ }
+ goto bail;
+ }
+
+ // Create the media source for the device.
+ hr = pActivate->ActivateObject(
+ __uuidof(IMFMediaSource),
+ (void**)&pSelf->pSource
+ );
+ SafeRelease(&pActivate);
+ if (!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("ActivateObject(MF video source) failed");
+ goto bail;
+ }
+
+ // Check whether video processor (http://msdn.microsoft.com/en-us/library/windows/desktop/hh162913(v=vs.85).aspx) is supported
+ CHECK_HR(hr = MFUtils::IsVideoProcessorSupported(&bVideoProcessorIsSupported));
+
+ // Must not be set because not supported by Frame Rate Converter DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819100(v=vs.85).aspx).aspx) because of color (neither I420 nor NV12)
+ // Video Processor (http://msdn.microsoft.com/en-us/library/windows/desktop/hh162913(v=vs.85).aspx) supports both NV12 and I420
+ if (!bVideoProcessorIsSupported) {
+ UINT32 nWidth, nHeight, nFps;
+ hr = MFUtils::GetBestFormat(
+ pSelf->pSource,
+ &MFVideoFormat_I420,
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.width,
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.height,
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps,
+ &nWidth,
+ &nHeight,
+ &nFps,
+ &pcPreferredSubTypeGuidPair
+ );
+ if (SUCCEEDED(hr)) {
+ TSK_DEBUG_INFO("Video processor not supported...using source fps=%u, width=%u, height=%u", nFps, nWidth, nHeight);
+ TMEDIA_PRODUCER(pSelf)->video.width = nWidth;
+ TMEDIA_PRODUCER(pSelf)->video.height = nHeight;
+ TMEDIA_PRODUCER(pSelf)->video.fps = nFps;
+ }
+ }
+
+ // If H.264 is negotiated for this session then, try to find hardware encoder
+ // If no HW encoder is found will fallback to SW implementation from x264
#if PLUGIN_MF_PV_BUNDLE_CODEC
- // Before embedding a H.264 encoder we have to be sure that:
- // - Low latency is supported
- // - The user decided to use MF encoder (Microsoft, Intel Quick Sync or any other)
- if ((codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) && MFUtils::IsLowLatencyH264Supported()) {
- BOOL bMFEncoderIsRegistered =
- (codec->id == tmedia_codec_id_h264_mp && codec->plugin == mf_codec_h264_main_plugin_def_t)
- || (codec->id == tmedia_codec_id_h264_bp && codec->plugin == mf_codec_h264_base_plugin_def_t);
- if (bMFEncoderIsRegistered)
- {
- // both Microsoft and Intel encoders support NV12 only as input
- // static const BOOL kIsEncoder = TRUE;
- // hr = MFUtils::GetBestCodec(kIsEncoder, MFMediaType_Video, MFVideoFormat_NV12, MFVideoFormat_H264, &pSelf->pEncoder);
- pSelf->pEncoder = (codec->id == tmedia_codec_id_h264_bp) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Encoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder);
- if (pSelf->pEncoder)
- {
- pSelf->pEncoder->setBundled(TRUE);
- int32_t avg_bitrate_kbps = tmedia_get_video_bandwidth_kbps_2((unsigned int)TMEDIA_PRODUCER(pSelf)->video.width, (unsigned int)TMEDIA_PRODUCER(pSelf)->video.height, TMEDIA_PRODUCER(pSelf)->video.fps);
- TSK_DEBUG_INFO("MF_MT_AVG_BITRATE defined with value = %d kbps", avg_bitrate_kbps);
- pSelf->bitrate_bps = (avg_bitrate_kbps * 1024);
-
- hr = pSelf->pEncoder->Initialize(
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps,
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.width,
- (UINT32)TMEDIA_PRODUCER(pSelf)->video.height,
- (UINT32)pSelf->bitrate_bps);
- if (SUCCEEDED(hr))
- {
- /*hr =*/ pSelf->pEncoder->SetGOPSize((PLUGIN_MF_GOP_SIZE_IN_SECONDS * TMEDIA_PRODUCER(pSelf)->video.fps));
- }
- if (FAILED(hr))
- {
- SafeRelease(&pSelf->pEncoder);
- hr = S_OK;
- }
- }
- if (SUCCEEDED(hr) && pSelf->pEncoder)
- {
- TMEDIA_PRODUCER(pSelf)->encoder.codec_id = codec->id; // means encoded frames as input
- }
- else
- {
- SafeRelease(&pSelf->pEncoder);
- TSK_DEBUG_WARN("Failed to find H.264 HW encoder...fallback to SW implementation");
- }
- }
- else /* if(!bMFEncoderIsRegistered) */
- {
- TSK_DEBUG_INFO("Not bundling MF H.264 encoder even if low latency is supported because another implementation is registered: %s", codec->plugin->desc);
- }
- }
+ // Before embedding a H.264 encoder we have to be sure that:
+ // - Low latency is supported
+ // - The user decided to use MF encoder (Microsoft, Intel Quick Sync or any other)
+ if ((codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) && MFUtils::IsLowLatencyH264Supported()) {
+ BOOL bMFEncoderIsRegistered =
+ (codec->id == tmedia_codec_id_h264_mp && codec->plugin == mf_codec_h264_main_plugin_def_t)
+ || (codec->id == tmedia_codec_id_h264_bp && codec->plugin == mf_codec_h264_base_plugin_def_t);
+ if (bMFEncoderIsRegistered) {
+ // both Microsoft and Intel encoders support NV12 only as input
+ // static const BOOL kIsEncoder = TRUE;
+ // hr = MFUtils::GetBestCodec(kIsEncoder, MFMediaType_Video, MFVideoFormat_NV12, MFVideoFormat_H264, &pSelf->pEncoder);
+ pSelf->pEncoder = (codec->id == tmedia_codec_id_h264_bp) ? MFCodecVideoH264::CreateCodecH264Base(MFCodecType_Encoder) : MFCodecVideoH264::CreateCodecH264Main(MFCodecType_Encoder);
+ if (pSelf->pEncoder) {
+ pSelf->pEncoder->setBundled(TRUE);
+ int32_t avg_bitrate_kbps = tmedia_get_video_bandwidth_kbps_2((unsigned int)TMEDIA_PRODUCER(pSelf)->video.width, (unsigned int)TMEDIA_PRODUCER(pSelf)->video.height, TMEDIA_PRODUCER(pSelf)->video.fps);
+ TSK_DEBUG_INFO("MF_MT_AVG_BITRATE defined with value = %d kbps", avg_bitrate_kbps);
+ pSelf->bitrate_bps = (avg_bitrate_kbps * 1024);
+
+ hr = pSelf->pEncoder->Initialize(
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps,
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.width,
+ (UINT32)TMEDIA_PRODUCER(pSelf)->video.height,
+ (UINT32)pSelf->bitrate_bps);
+ if (SUCCEEDED(hr)) {
+ /*hr =*/ pSelf->pEncoder->SetGOPSize((PLUGIN_MF_GOP_SIZE_IN_SECONDS * TMEDIA_PRODUCER(pSelf)->video.fps));
+ }
+ if (FAILED(hr)) {
+ SafeRelease(&pSelf->pEncoder);
+ hr = S_OK;
+ }
+ }
+ if (SUCCEEDED(hr) && pSelf->pEncoder) {
+ TMEDIA_PRODUCER(pSelf)->encoder.codec_id = codec->id; // means encoded frames as input
+ }
+ else {
+ SafeRelease(&pSelf->pEncoder);
+ TSK_DEBUG_WARN("Failed to find H.264 HW encoder...fallback to SW implementation");
+ }
+ }
+ else { /* if(!bMFEncoderIsRegistered) */
+ TSK_DEBUG_INFO("Not bundling MF H.264 encoder even if low latency is supported because another implementation is registered: %s", codec->plugin->desc);
+ }
+ }
#endif
- // Set session attributes
- CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
- CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
-
- // Configure the media type that the Sample Grabber will receive.
- // Setting the major and subtype is usually enough for the topology loader
- // to resolve the topology.
-
- CHECK_HR(hr = MFCreateMediaType(&pSelf->pGrabberInputType));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
-
- CHECK_HR(hr = MFSetAttributeSize(pSelf->pGrabberInputType, MF_MT_FRAME_SIZE, (UINT32)TMEDIA_PRODUCER(pSelf)->video.width, (UINT32)TMEDIA_PRODUCER(pSelf)->video.height));
- CHECK_HR(hr = MFSetAttributeRatio(pSelf->pGrabberInputType, MF_MT_FRAME_RATE, TMEDIA_PRODUCER(pSelf)->video.fps, 1));
-
- CHECK_HR(hr = MFSetAttributeRatio(pSelf->pGrabberInputType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, pSelf->pEncoder ? FALSE : TRUE));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, pSelf->pEncoder ? FALSE : TRUE));
- if (pSelf->pEncoder) {
- switch (codec->id){
- case tmedia_codec_id_h264_bp: case tmedia_codec_id_h264_mp:
- {
- CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_MPEG2_PROFILE, (codec->id == tmedia_codec_id_h264_bp) ? eAVEncH264VProfile_Base : eAVEncH264VProfile_Main));
- CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_AVG_BITRATE, pSelf->bitrate_bps));
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("HW encoder with id = %d not expected", codec->id);
- assert(false);
- }
- }
- TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_nv12;
- TSK_DEBUG_INFO("MF video producer chroma = NV12 (because of HW encoder)");
- }
- else {
- // Video Processors will be inserted in the topology if the source cannot produce I420 frames
- // IMPORTANT: Must not be NV12 because not supported by Video Resizer DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx)
- CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_SUBTYPE, pcPreferredSubTypeGuidPair ? pcPreferredSubTypeGuidPair->fourcc : MFVideoFormat_I420));
- TMEDIA_PRODUCER(pSelf)->video.chroma = pcPreferredSubTypeGuidPair ? pcPreferredSubTypeGuidPair->chroma : tmedia_chroma_yuv420p;
- TSK_DEBUG_INFO("MF video producer chroma = %d", TMEDIA_PRODUCER(pSelf)->video.chroma);
- }
-
- if (pSelf->pEncoder) {
- // Unlock the encoder
- //BOOL bIsAsyncMFT = FALSE;
- //CHECK_HR(hr = MFUtils::IsAsyncMFT(pSelf->pEncoder->GetMFT(), &bIsAsyncMFT));
- //if(bIsAsyncMFT)
- //{
- // CHECK_HR(hr = MFUtils::UnlockAsyncMFT(pSelf->pEncoderpSelf->pEncoder->GetMFT()));
- //}
- // Apply Encoder output type (must be called before SetInputType)
- //CHECK_HR(hr = pSelf->pEncoder->GetMFT()->SetOutputType(0, pSelf->pGrabberInputType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
-
- // HW encoders support only NV12
- //CHECK_HR(hr = MFUtils::ConvertVideoTypeToUncompressedType(pSelf->pGrabberInputType, MFVideoFormat_NV12, &pEncoderInputType));
- //CHECK_HR(hr = pSelf->pEncoder->GetMFT()->SetInputType(0, pEncoderInputType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
- }
- // Create the sample grabber sink.
- CHECK_HR(hr = SampleGrabberCB::CreateInstance(TMEDIA_PRODUCER(pSelf), &pSelf->pCallback));
- CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pGrabberInputType, pSelf->pCallback, &pSelf->pSinkGrabber));
-
- // To run as fast as possible, set this attribute (requires Windows 7):
- CHECK_HR(hr = pSelf->pSinkGrabber->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
-
- // Create the Media Session.
- CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &pSelf->pSession));
-
- // Create the EVR activation object for the preview.
- CHECK_HR(hr = MFCreateVideoRendererActivate(pSelf->hWndPreview, &pSelf->pSinkActivatePreview));
-
- // Create the topology.
- CHECK_HR(hr = MFUtils::CreateTopology(
- pSelf->pSource,
- pSelf->pEncoder ? pSelf->pEncoder->GetMFT() : NULL,
- pSelf->pSinkGrabber,
- pSelf->pSinkActivatePreview,
- pSelf->pGrabberInputType,
- &pTopology));
- // Resolve topology (adds video processors if needed).
- CHECK_HR(hr = MFUtils::ResolveTopology(pTopology, &pSelf->pTopology));
-
- // Find EVR for the preview.
- CHECK_HR(hr = MFUtils::FindNodeObject(pSelf->pTopology, MFUtils::g_ullTopoIdSinkPreview, (void**)&pEvr));
-
- // Find negotiated media and update producer
- UINT32 nNegWidth = (UINT32)TMEDIA_PRODUCER(pSelf)->video.width, nNegHeight = (UINT32)TMEDIA_PRODUCER(pSelf)->video.height, nNegNumeratorFps = (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps, nNegDenominatorFps = 1;
- CHECK_HR(hr = pSelf->pTopology->GetNodeByID(MFUtils::g_ullTopoIdSinkMain, &pNodeGrabber));
- CHECK_HR(hr = pNodeGrabber->GetInputPrefType(0, &pGrabberNegotiatedInputMedia));
- hr = MFGetAttributeSize(pGrabberNegotiatedInputMedia, MF_MT_FRAME_SIZE, &nNegWidth, &nNegHeight);
- if (SUCCEEDED(hr))
- {
- TSK_DEBUG_INFO("MF video producer topology vs sdp parameters: width(%u/%u), height(%u/%u)",
- TMEDIA_PRODUCER(pSelf)->video.width, nNegWidth,
- TMEDIA_PRODUCER(pSelf)->video.height, nNegHeight
- );
- TMEDIA_PRODUCER(pSelf)->video.width = nNegWidth;
- TMEDIA_PRODUCER(pSelf)->video.height = nNegHeight;
- }
- hr = MFGetAttributeRatio(pGrabberNegotiatedInputMedia, MF_MT_FRAME_RATE, &nNegNumeratorFps, &nNegDenominatorFps);
- if (SUCCEEDED(hr))
- {
- TSK_DEBUG_INFO("MF video producer topology vs sdp parameters: fps(%u/%u)",
- TMEDIA_PRODUCER(pSelf)->video.fps, (nNegNumeratorFps / nNegDenominatorFps)
- );
- TMEDIA_PRODUCER(pSelf)->video.fps = (nNegNumeratorFps / nNegDenominatorFps);
- }
-
- // Create EVR watcher for the preview.
- pSelf->pWatcherPreview = new DisplayWatcher(pSelf->hWndPreview, pEvr, hr);
- CHECK_HR(hr);
- }
+ // Set session attributes
+ CHECK_HR(hr = MFCreateAttributes(&pSessionAttributes, 1));
+ CHECK_HR(hr = pSessionAttributes->SetUINT32(PLUGIN_MF_LOW_LATENCY, 1));
+
+ // Configure the media type that the Sample Grabber will receive.
+ // Setting the major and subtype is usually enough for the topology loader
+ // to resolve the topology.
+
+ CHECK_HR(hr = MFCreateMediaType(&pSelf->pGrabberInputType));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+
+ CHECK_HR(hr = MFSetAttributeSize(pSelf->pGrabberInputType, MF_MT_FRAME_SIZE, (UINT32)TMEDIA_PRODUCER(pSelf)->video.width, (UINT32)TMEDIA_PRODUCER(pSelf)->video.height));
+ CHECK_HR(hr = MFSetAttributeRatio(pSelf->pGrabberInputType, MF_MT_FRAME_RATE, TMEDIA_PRODUCER(pSelf)->video.fps, 1));
+
+ CHECK_HR(hr = MFSetAttributeRatio(pSelf->pGrabberInputType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, pSelf->pEncoder ? FALSE : TRUE));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, pSelf->pEncoder ? FALSE : TRUE));
+ if (pSelf->pEncoder) {
+ switch (codec->id) {
+ case tmedia_codec_id_h264_bp:
+ case tmedia_codec_id_h264_mp: {
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_MPEG2_PROFILE, (codec->id == tmedia_codec_id_h264_bp) ? eAVEncH264VProfile_Base : eAVEncH264VProfile_Main));
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetUINT32(MF_MT_AVG_BITRATE, pSelf->bitrate_bps));
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("HW encoder with id = %d not expected", codec->id);
+ assert(false);
+ }
+ }
+ TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_nv12;
+ TSK_DEBUG_INFO("MF video producer chroma = NV12 (because of HW encoder)");
+ }
+ else {
+ // Video Processors will be inserted in the topology if the source cannot produce I420 frames
+ // IMPORTANT: Must not be NV12 because not supported by Video Resizer DSP (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819491(v=vs.85).aspx)
+ CHECK_HR(hr = pSelf->pGrabberInputType->SetGUID(MF_MT_SUBTYPE, pcPreferredSubTypeGuidPair ? pcPreferredSubTypeGuidPair->fourcc : MFVideoFormat_I420));
+ TMEDIA_PRODUCER(pSelf)->video.chroma = pcPreferredSubTypeGuidPair ? pcPreferredSubTypeGuidPair->chroma : tmedia_chroma_yuv420p;
+ TSK_DEBUG_INFO("MF video producer chroma = %d", TMEDIA_PRODUCER(pSelf)->video.chroma);
+ }
+
+ if (pSelf->pEncoder) {
+ // Unlock the encoder
+ //BOOL bIsAsyncMFT = FALSE;
+ //CHECK_HR(hr = MFUtils::IsAsyncMFT(pSelf->pEncoder->GetMFT(), &bIsAsyncMFT));
+ //if(bIsAsyncMFT)
+ //{
+ // CHECK_HR(hr = MFUtils::UnlockAsyncMFT(pSelf->pEncoderpSelf->pEncoder->GetMFT()));
+ //}
+ // Apply Encoder output type (must be called before SetInputType)
+ //CHECK_HR(hr = pSelf->pEncoder->GetMFT()->SetOutputType(0, pSelf->pGrabberInputType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
+
+ // HW encoders support only NV12
+ //CHECK_HR(hr = MFUtils::ConvertVideoTypeToUncompressedType(pSelf->pGrabberInputType, MFVideoFormat_NV12, &pEncoderInputType));
+ //CHECK_HR(hr = pSelf->pEncoder->GetMFT()->SetInputType(0, pEncoderInputType, 0/*MFT_SET_TYPE_TEST_ONLY*/));
+ }
+ // Create the sample grabber sink.
+ CHECK_HR(hr = SampleGrabberCB::CreateInstance(TMEDIA_PRODUCER(pSelf), &pSelf->pCallback));
+ CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pGrabberInputType, pSelf->pCallback, &pSelf->pSinkGrabber));
+
+ // To run as fast as possible, set this attribute (requires Windows 7):
+ CHECK_HR(hr = pSelf->pSinkGrabber->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
+
+ // Create the Media Session.
+ CHECK_HR(hr = MFCreateMediaSession(pSessionAttributes, &pSelf->pSession));
+
+ // Create the EVR activation object for the preview.
+ CHECK_HR(hr = MFCreateVideoRendererActivate(pSelf->hWndPreview, &pSelf->pSinkActivatePreview));
+
+ // Create the topology.
+ CHECK_HR(hr = MFUtils::CreateTopology(
+ pSelf->pSource,
+ pSelf->pEncoder ? pSelf->pEncoder->GetMFT() : NULL,
+ pSelf->pSinkGrabber,
+ pSelf->pSinkActivatePreview,
+ pSelf->pGrabberInputType,
+ &pTopology));
+ // Resolve topology (adds video processors if needed).
+ CHECK_HR(hr = MFUtils::ResolveTopology(pTopology, &pSelf->pTopology));
+
+ // Find EVR for the preview.
+ CHECK_HR(hr = MFUtils::FindNodeObject(pSelf->pTopology, MFUtils::g_ullTopoIdSinkPreview, (void**)&pEvr));
+
+ // Find negotiated media and update producer
+ UINT32 nNegWidth = (UINT32)TMEDIA_PRODUCER(pSelf)->video.width, nNegHeight = (UINT32)TMEDIA_PRODUCER(pSelf)->video.height, nNegNumeratorFps = (UINT32)TMEDIA_PRODUCER(pSelf)->video.fps, nNegDenominatorFps = 1;
+ CHECK_HR(hr = pSelf->pTopology->GetNodeByID(MFUtils::g_ullTopoIdSinkMain, &pNodeGrabber));
+ CHECK_HR(hr = pNodeGrabber->GetInputPrefType(0, &pGrabberNegotiatedInputMedia));
+ hr = MFGetAttributeSize(pGrabberNegotiatedInputMedia, MF_MT_FRAME_SIZE, &nNegWidth, &nNegHeight);
+ if (SUCCEEDED(hr)) {
+ TSK_DEBUG_INFO("MF video producer topology vs sdp parameters: width(%u/%u), height(%u/%u)",
+ TMEDIA_PRODUCER(pSelf)->video.width, nNegWidth,
+ TMEDIA_PRODUCER(pSelf)->video.height, nNegHeight
+ );
+ TMEDIA_PRODUCER(pSelf)->video.width = nNegWidth;
+ TMEDIA_PRODUCER(pSelf)->video.height = nNegHeight;
+ }
+ hr = MFGetAttributeRatio(pGrabberNegotiatedInputMedia, MF_MT_FRAME_RATE, &nNegNumeratorFps, &nNegDenominatorFps);
+ if (SUCCEEDED(hr)) {
+ TSK_DEBUG_INFO("MF video producer topology vs sdp parameters: fps(%u/%u)",
+ TMEDIA_PRODUCER(pSelf)->video.fps, (nNegNumeratorFps / nNegDenominatorFps)
+ );
+ TMEDIA_PRODUCER(pSelf)->video.fps = (nNegNumeratorFps / nNegDenominatorFps);
+ }
+
+ // Create EVR watcher for the preview.
+ pSelf->pWatcherPreview = new DisplayWatcher(pSelf->hWndPreview, pEvr, hr);
+ CHECK_HR(hr);
+ }
bail:
- SafeRelease(&pSessionAttributes);
- SafeRelease(&pTopology);
- SafeRelease(&pEvr);
- SafeRelease(&pEncoderInputType);
- SafeRelease(&pNodeGrabber);
- SafeRelease(&pGrabberNegotiatedInputMedia);
-
- pSelf->bPrepared = SUCCEEDED(hr);
- return pSelf->bPrepared ? 0 : -1;
+ SafeRelease(&pSessionAttributes);
+ SafeRelease(&pTopology);
+ SafeRelease(&pEvr);
+ SafeRelease(&pEncoderInputType);
+ SafeRelease(&pNodeGrabber);
+ SafeRelease(&pGrabberNegotiatedInputMedia);
+
+ pSelf->bPrepared = SUCCEEDED(hr);
+ return pSelf->bPrepared ? 0 : -1;
}
static int plugin_win_mf_producer_video_start(tmedia_producer_t* self)
{
- plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
-
- if (!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pSelf->bStarted){
- TSK_DEBUG_INFO("MF video producer already started");
- return 0;
- }
- if (!pSelf->bPrepared){
- TSK_DEBUG_ERROR("MF video producer not prepared");
- return -1;
- }
-
- HRESULT hr = S_OK;
-
- // Run preview watcher
- if (pSelf->pWatcherPreview) {
- CHECK_HR(hr = pSelf->pWatcherPreview->Start());
- }
-
- // Run the media session.
- CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
-
- // Start asynchronous watcher thread
- pSelf->bStarted = true;
- int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
- if (ret != 0) {
- TSK_DEBUG_ERROR("Failed to create thread");
- hr = E_FAIL;
- pSelf->bStarted = false;
- if (pSelf->ppTread[0]){
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
- goto bail;
- }
+ plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
+
+ if (!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video producer already started");
+ return 0;
+ }
+ if (!pSelf->bPrepared) {
+ TSK_DEBUG_ERROR("MF video producer not prepared");
+ return -1;
+ }
+
+ HRESULT hr = S_OK;
+
+ // Run preview watcher
+ if (pSelf->pWatcherPreview) {
+ CHECK_HR(hr = pSelf->pWatcherPreview->Start());
+ }
+
+ // Run the media session.
+ CHECK_HR(hr = MFUtils::RunSession(pSelf->pSession, pSelf->pTopology));
+
+ // Start asynchronous watcher thread
+ pSelf->bStarted = true;
+ int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
+ if (ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ hr = E_FAIL;
+ pSelf->bStarted = false;
+ if (pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ MFUtils::ShutdownSession(pSelf->pSession, pSelf->pSource);
+ goto bail;
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_video_pause(tmedia_producer_t* self)
{
- plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
+ plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
- if (!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!pSelf->bStarted)
- {
- TSK_DEBUG_INFO("MF video producer not started");
- return 0;
- }
+ if (!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!pSelf->bStarted) {
+ TSK_DEBUG_INFO("MF video producer not started");
+ return 0;
+ }
- HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
+ HRESULT hr = MFUtils::PauseSession(pSelf->pSession);
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int plugin_win_mf_producer_video_stop(tmedia_producer_t* self)
{
- plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
+ plugin_win_mf_producer_video_t* pSelf = (plugin_win_mf_producer_video_t*)self;
- if (!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- if (pSelf->pWatcherPreview){
- hr = pSelf->pWatcherPreview->Stop();
- }
+ if (pSelf->pWatcherPreview) {
+ hr = pSelf->pWatcherPreview->Stop();
+ }
- // for the thread
- pSelf->bStarted = false;
- hr = MFUtils::ShutdownSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
- if (pSelf->ppTread[0]){
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- hr = MFUtils::ShutdownSession(NULL, pSelf->pSource); // stop source to release the camera
+ // for the thread
+ pSelf->bStarted = false;
+ hr = MFUtils::ShutdownSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
+ if (pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ hr = MFUtils::ShutdownSession(NULL, pSelf->pSource); // stop source to release the camera
- // next start() will be called after prepare()
- return _plugin_win_mf_producer_video_unprepare(pSelf);
+ // next start() will be called after prepare()
+ return _plugin_win_mf_producer_video_unprepare(pSelf);
}
static int _plugin_win_mf_producer_video_unprepare(plugin_win_mf_producer_video_t* pSelf)
{
- if (!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pSelf->bStarted) {
- // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
- TSK_DEBUG_ERROR("Producer must be stopped before calling unprepare");
- }
- if (pSelf->pDeviceList){
- delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
- }
- if (pSelf->pWatcherPreview){
- pSelf->pWatcherPreview->Stop();
- }
- if (pSelf->pSource){
- pSelf->pSource->Shutdown();
- }
- if (pSelf->pSession){
- pSelf->pSession->Shutdown();
- }
-
- SafeRelease(&pSelf->pEncoder);
- SafeRelease(&pSelf->pSession);
- SafeRelease(&pSelf->pSource);
- SafeRelease(&pSelf->pSinkActivatePreview);
- SafeRelease(&pSelf->pCallback);
- SafeRelease(&pSelf->pSinkGrabber);
- SafeRelease(&pSelf->pTopology);
- SafeRelease(&pSelf->pGrabberInputType);
-
- if (pSelf->pWatcherPreview){
- delete pSelf->pWatcherPreview;
- pSelf->pWatcherPreview = NULL;
- }
-
- pSelf->bPrepared = false;
-
- return 0;
+ if (!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pSelf->bStarted) {
+ // plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
+ TSK_DEBUG_ERROR("Producer must be stopped before calling unprepare");
+ }
+ if (pSelf->pDeviceList) {
+ delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
+ }
+ if (pSelf->pWatcherPreview) {
+ pSelf->pWatcherPreview->Stop();
+ }
+ if (pSelf->pSource) {
+ pSelf->pSource->Shutdown();
+ }
+ if (pSelf->pSession) {
+ pSelf->pSession->Shutdown();
+ }
+
+ SafeRelease(&pSelf->pEncoder);
+ SafeRelease(&pSelf->pSession);
+ SafeRelease(&pSelf->pSource);
+ SafeRelease(&pSelf->pSinkActivatePreview);
+ SafeRelease(&pSelf->pCallback);
+ SafeRelease(&pSelf->pSinkGrabber);
+ SafeRelease(&pSelf->pTopology);
+ SafeRelease(&pSelf->pGrabberInputType);
+
+ if (pSelf->pWatcherPreview) {
+ delete pSelf->pWatcherPreview;
+ pSelf->pWatcherPreview = NULL;
+ }
+
+ pSelf->bPrepared = false;
+
+ return 0;
}
//
@@ -611,63 +590,61 @@ static int _plugin_win_mf_producer_video_unprepare(plugin_win_mf_producer_video_
/* constructor */
static tsk_object_t* plugin_win_mf_producer_video_ctor(tsk_object_t * self, va_list * app)
{
- MFUtils::Startup();
-
- plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)self;
- if (pSelf){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
-
- /* init self with default values*/
- TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
- TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_nv12;
- TMEDIA_PRODUCER(pSelf)->video.fps = 15;
- TMEDIA_PRODUCER(pSelf)->video.width = 352;
- TMEDIA_PRODUCER(pSelf)->video.height = 288;
-
- TSK_DEBUG_INFO("Create WinMF video producer");
- }
- return self;
+ MFUtils::Startup();
+
+ plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)self;
+ if (pSelf) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
+
+ /* init self with default values*/
+ TMEDIA_PRODUCER(pSelf)->encoder.codec_id = tmedia_codec_id_none; // means RAW frames as input
+ TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_nv12;
+ TMEDIA_PRODUCER(pSelf)->video.fps = 15;
+ TMEDIA_PRODUCER(pSelf)->video.width = 352;
+ TMEDIA_PRODUCER(pSelf)->video.height = 288;
+
+ TSK_DEBUG_INFO("Create WinMF video producer");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* plugin_win_mf_producer_video_dtor(tsk_object_t * self)
{
- plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)self;
- if (pSelf){
- /* stop */
- if (pSelf->bStarted){
- plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
- /* deinit self */
- _plugin_win_mf_producer_video_unprepare(pSelf);
- }
-
- return self;
+ plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)self;
+ if (pSelf) {
+ /* stop */
+ if (pSelf->bStarted) {
+ plugin_win_mf_producer_video_stop(TMEDIA_PRODUCER(pSelf));
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
+ /* deinit self */
+ _plugin_win_mf_producer_video_unprepare(pSelf);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t plugin_win_mf_producer_video_def_s =
-{
- sizeof(plugin_win_mf_producer_video_t),
- plugin_win_mf_producer_video_ctor,
- plugin_win_mf_producer_video_dtor,
- tsk_null,
+static const tsk_object_def_t plugin_win_mf_producer_video_def_s = {
+ sizeof(plugin_win_mf_producer_video_t),
+ plugin_win_mf_producer_video_ctor,
+ plugin_win_mf_producer_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t plugin_win_mf_producer_video_plugin_def_s =
-{
- &plugin_win_mf_producer_video_def_s,
+static const tmedia_producer_plugin_def_t plugin_win_mf_producer_video_plugin_def_s = {
+ &plugin_win_mf_producer_video_def_s,
- tmedia_video,
- "Microsoft Windows Media Foundation producer (Video)",
+ tmedia_video,
+ "Microsoft Windows Media Foundation producer (Video)",
- plugin_win_mf_producer_video_set,
- plugin_win_mf_producer_video_prepare,
- plugin_win_mf_producer_video_start,
- plugin_win_mf_producer_video_pause,
- plugin_win_mf_producer_video_stop
+ plugin_win_mf_producer_video_set,
+ plugin_win_mf_producer_video_prepare,
+ plugin_win_mf_producer_video_start,
+ plugin_win_mf_producer_video_pause,
+ plugin_win_mf_producer_video_stop
};
const tmedia_producer_plugin_def_t *plugin_win_mf_producer_video_plugin_def_t = &plugin_win_mf_producer_video_plugin_def_s;
@@ -675,40 +652,38 @@ const tmedia_producer_plugin_def_t *plugin_win_mf_producer_video_plugin_def_t =
// Run session async thread
static void* TSK_STDCALL RunSessionThread(void *pArg)
{
- plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)pArg;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- IMFMediaEvent *pEvent = NULL;
- MediaEventType met;
-
- TSK_DEBUG_INFO("RunSessionThread (MF video producer) - ENTER");
-
- while (pSelf->bStarted){
- hr = pSelf->pSession->GetEvent(0, &pEvent);
- if (hr == MF_E_SHUTDOWN) {
- if (pSelf->bStarted) {
- CHECK_HR(hr); // Shutdown called but "bStarted" not equal to false
- }
- break; // Shutdown called and "bStarted" is equal to false => break the loop
- }
- CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- CHECK_HR(hr = pEvent->GetType(&met));
-
- if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/)
- {
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
- hr = hrStatus;
- goto bail;
- }
- if (met == MESessionEnded)
- {
- break;
- }
- SafeRelease(&pEvent);
- }
+ plugin_win_mf_producer_video_t *pSelf = (plugin_win_mf_producer_video_t *)pArg;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ IMFMediaEvent *pEvent = NULL;
+ MediaEventType met;
+
+ TSK_DEBUG_INFO("RunSessionThread (MF video producer) - ENTER");
+
+ while (pSelf->bStarted) {
+ hr = pSelf->pSession->GetEvent(0, &pEvent);
+ if (hr == MF_E_SHUTDOWN) {
+ if (pSelf->bStarted) {
+ CHECK_HR(hr); // Shutdown called but "bStarted" not equal to false
+ }
+ break; // Shutdown called and "bStarted" is equal to false => break the loop
+ }
+ CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
+ CHECK_HR(hr = pEvent->GetType(&met));
+
+ if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/) {
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ hr = hrStatus;
+ goto bail;
+ }
+ if (met == MESessionEnded) {
+ break;
+ }
+ SafeRelease(&pEvent);
+ }
bail:
- TSK_DEBUG_INFO("RunSessionThread (MF video producer) - EXIT");
+ TSK_DEBUG_INFO("RunSessionThread (MF video producer) - EXIT");
- return NULL;
+ return NULL;
} \ No newline at end of file
diff --git a/plugins/pluginWinMF/plugin_win_mf_tdav.cxx b/plugins/pluginWinMF/plugin_win_mf_tdav.cxx
index d08bcfc..1885617 100755
--- a/plugins/pluginWinMF/plugin_win_mf_tdav.cxx
+++ b/plugins/pluginWinMF/plugin_win_mf_tdav.cxx
@@ -1,18 +1,18 @@
/* Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/thirdparties/android/common/include/g729b/dtx.h b/thirdparties/android/common/include/g729b/dtx.h
index d0cc6ac..c8af076 100755
--- a/thirdparties/android/common/include/g729b/dtx.h
+++ b/thirdparties/android/common/include/g729b/dtx.h
@@ -13,36 +13,36 @@
/* Encoder DTX/CNG functions */
void Init_Cod_cng(void);
void Cod_cng(
- Word16 *exc, /* (i/o) : excitation array */
- Word16 pastVad, /* (i) : previous VAD decision */
- Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
- Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
- Word16 *ana, /* (o) : coded SID parameters */
- Word16 freq_prev[MA_NP][M],
- /* (i/o) : previous LPS for quantization */
- Word16 *seed /* (i/o) : random generator seed */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 pastVad, /* (i) : previous VAD decision */
+ Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
+ Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
+ Word16 *ana, /* (o) : coded SID parameters */
+ Word16 freq_prev[MA_NP][M],
+ /* (i/o) : previous LPS for quantization */
+ Word16 *seed /* (i/o) : random generator seed */
);
void Update_cng(
- Word16 *r_h, /* (i) : MSB of frame autocorrelation */
- Word16 exp_r, /* (i) : scaling factor associated */
- Word16 Vad /* (i) : current Vad decision */
+ Word16 *r_h, /* (i) : MSB of frame autocorrelation */
+ Word16 exp_r, /* (i) : scaling factor associated */
+ Word16 Vad /* (i) : current Vad decision */
);
/* SID gain Quantization */
void Qua_Sidgain(
- Word16 *ener, /* (i) array of energies */
- Word16 *sh_ener, /* (i) corresponding scaling factors */
- Word16 nb_ener, /* (i) number of energies or */
- Word16 *enerq, /* (o) decoded energies in dB */
- Word16 *idx /* (o) SID gain quantization index */
+ Word16 *ener, /* (i) array of energies */
+ Word16 *sh_ener, /* (i) corresponding scaling factors */
+ Word16 nb_ener, /* (i) number of energies or */
+ Word16 *enerq, /* (o) decoded energies in dB */
+ Word16 *idx /* (o) SID gain quantization index */
);
/* CNG excitation generation */
void Calc_exc_rand(
- Word16 cur_gain, /* (i) : target sample gain */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *seed, /* (i) : current Vad decision */
- Flag flag_cod /* (i) : encoder/decoder flag */
+ Word16 cur_gain, /* (i) : target sample gain */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *seed, /* (i) : current Vad decision */
+ Flag flag_cod /* (i) : encoder/decoder flag */
);
/* SID LSP Quantization */
@@ -54,16 +54,16 @@ void Update_decfreq_prev(Word16 x[MA_NP][M]);
/* Decoder CNG generation */
void Init_Dec_cng(void);
void Dec_cng(
- Word16 past_ftyp, /* (i) : past frame type */
- Word16 sid_sav, /* (i) : energy to recover SID gain */
- Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
- Word16 *parm, /* (i) : coded SID parameters */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *lsp_old, /* (i/o) : previous lsp */
- Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
- Word16 *seed, /* (i/o) : random generator seed */
- Word16 freq_prev[MA_NP][M]
- /* (i/o) : previous LPS for quantization */
+ Word16 past_ftyp, /* (i) : past frame type */
+ Word16 sid_sav, /* (i) : energy to recover SID gain */
+ Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
+ Word16 *parm, /* (i) : coded SID parameters */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *lsp_old, /* (i/o) : previous lsp */
+ Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
+ Word16 *seed, /* (i/o) : random generator seed */
+ Word16 freq_prev[MA_NP][M]
+ /* (i/o) : previous LPS for quantization */
);
Word16 read_frame(FILE *f_serial, Word16 *parm);
@@ -92,7 +92,7 @@ Word16 read_frame(FILE *f_serial, Word16 *parm);
#define RATE_0 0 /* 0 bit/s rate */
/* CNG excitation generation constant */
- /* alpha = 0.5 */
+/* alpha = 0.5 */
#define FRAC1 19043 /* (sqrt(40)xalpha/2 - 1) * 32768 */
#define K0 24576 /* (1 - alpha ** 2) in Q15 */
#define G_MAX 5000
diff --git a/thirdparties/android/common/include/g729b/ld8a.h b/thirdparties/android/common/include/g729b/ld8a.h
index 0f95011..7a847b8 100755
--- a/thirdparties/android/common/include/g729b/ld8a.h
+++ b/thirdparties/android/common/include/g729b/ld8a.h
@@ -43,18 +43,18 @@
*-------------------------------*/
Word32 Inv_sqrt( /* (o) Q30 : output value (range: 0<=val<1) */
- Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
+ Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
);
void Log2(
- Word32 L_x, /* (i) Q0 : input value */
- Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
- Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
+ Word32 L_x, /* (i) Q0 : input value */
+ Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
+ Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
);
Word32 Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffffff) */
- Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
- Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
+ Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
+ Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
);
/*-------------------------------*
@@ -65,13 +65,13 @@ void Init_Pre_Process(void);
void Init_Post_Process(void);
void Pre_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
void Post_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
/*----------------------------------*
@@ -81,20 +81,20 @@ void Post_Process(
void Init_Coder_ld8a(void);
void Coder_ld8a(
- Word16 ana[], /* output : Analysis parameters */
- Word16 frame,
- Word16 vad_enable
+ Word16 ana[], /* output : Analysis parameters */
+ Word16 frame,
+ Word16 vad_enable
);
void Init_Decod_ld8a(void);
void Decod_ld8a(
- Word16 parm[], /* (i) : vector of synthesis parameters
+ Word16 parm[], /* (i) : vector of synthesis parameters
parm[0] = bad frame indicator (bfi) */
- Word16 synth[], /* (o) : synthesis speech */
- Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
- Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
- Word16 *Vad /* (o) : VAD */
+ Word16 synth[], /* (o) : synthesis speech */
+ Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
+ Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
+ Word16 *Vad /* (o) : VAD */
);
/*-------------------------------*
@@ -102,84 +102,84 @@ void Decod_ld8a(
*-------------------------------*/
void Autocorr(
- Word16 x[], /* (i) : Input signal */
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (o) : Autocorrelations (msb) */
- Word16 r_l[], /* (o) : Autocorrelations (lsb) */
- Word16 *exp_R0
+ Word16 x[], /* (i) : Input signal */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (o) : Autocorrelations (msb) */
+ Word16 r_l[], /* (o) : Autocorrelations (lsb) */
+ Word16 *exp_R0
);
void Lag_window(
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
- Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
+ Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
);
void Levinson(
- Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
- Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
- Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
- Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
- Word16 *Err /* (o) : Residual energy */
+ Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
+ Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
+ Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
+ Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
+ Word16 *Err /* (o) : Residual energy */
);
void Az_lsp(
- Word16 a[], /* (i) Q12 : predictor coefficients */
- Word16 lsp[], /* (o) Q15 : line spectral pairs */
- Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
+ Word16 a[], /* (i) Q12 : predictor coefficients */
+ Word16 lsp[], /* (o) Q15 : line spectral pairs */
+ Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
);
void Lsp_Az(
- Word16 lsp[], /* (i) Q15 : line spectral frequencies */
- Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
+ Word16 lsp[], /* (i) Q15 : line spectral frequencies */
+ Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
);
void Lsf_lsp(
- Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 m /* (i) : LPC order */
);
void Int_qlpc(
- Word16 lsp_old[], /* input : LSP vector of past frame */
- Word16 lsp_new[], /* input : LSP vector of present frame */
- Word16 Az[] /* output: interpolated Az() for the 2 subframes */
+ Word16 lsp_old[], /* input : LSP vector of past frame */
+ Word16 lsp_new[], /* input : LSP vector of present frame */
+ Word16 Az[] /* output: interpolated Az() for the 2 subframes */
);
void Weight_Az(
- Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
- Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
- Word16 m, /* (i) : LPC order. */
- Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
+ Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
+ Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
+ Word16 m, /* (i) : LPC order. */
+ Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
);
void Residu(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
- Word16 y[], /* (o) : residual signal */
- Word16 lg /* (i) : size of filtering */
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
+ Word16 y[], /* (o) : residual signal */
+ Word16 lg /* (i) : size of filtering */
);
void Syn_filt(
- Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
- Word16 x[], /* (i) : input signal */
- Word16 y[], /* (o) : output signal */
- Word16 lg, /* (i) : size of filtering */
- Word16 mem[], /* (i/o) : memory associated with this filtering. */
- Word16 update /* (i) : 0=no update, 1=update of memory. */
+ Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
+ Word16 x[], /* (i) : input signal */
+ Word16 y[], /* (o) : output signal */
+ Word16 lg, /* (i) : size of filtering */
+ Word16 mem[], /* (i/o) : memory associated with this filtering. */
+ Word16 update /* (i) : 0=no update, 1=update of memory. */
);
void Convolve(
- Word16 x[], /* (i) : input vector */
- Word16 h[], /* (i) Q12 : impulse response */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector size */
+ Word16 x[], /* (i) : input vector */
+ Word16 h[], /* (i) Q12 : impulse response */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector size */
);
/*--------------------------------------------------------------------------*
@@ -195,75 +195,75 @@ void Convolve(
*-----------------------*/
Word16 Pitch_ol_fast( /* output: open loop pitch lag */
- Word16 signal[], /* input : signal used to compute the open loop pitch */
- /* signal[-pit_max] to signal[-1] should be known */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 L_frame /* input : length of frame to compute pitch */
+ Word16 signal[], /* input : signal used to compute the open loop pitch */
+ /* signal[-pit_max] to signal[-1] should be known */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 L_frame /* input : length of frame to compute pitch */
);
Word16 Pitch_fr3_fast(/* (o) : pitch period. */
- Word16 exc[], /* (i) : excitation buffer */
- Word16 xn[], /* (i) : target vector */
- Word16 h[], /* (i) Q12 : impulse response of filters. */
- Word16 L_subfr, /* (i) : Length of subframe */
- Word16 t0_min, /* (i) : minimum value in the searched range. */
- Word16 t0_max, /* (i) : maximum value in the searched range. */
- Word16 i_subfr, /* (i) : indicator for first subframe. */
- Word16 *pit_frac /* (o) : chosen fraction. */
+ Word16 exc[], /* (i) : excitation buffer */
+ Word16 xn[], /* (i) : target vector */
+ Word16 h[], /* (i) Q12 : impulse response of filters. */
+ Word16 L_subfr, /* (i) : Length of subframe */
+ Word16 t0_min, /* (i) : minimum value in the searched range. */
+ Word16 t0_max, /* (i) : maximum value in the searched range. */
+ Word16 i_subfr, /* (i) : indicator for first subframe. */
+ Word16 *pit_frac /* (o) : chosen fraction. */
);
Word16 G_pitch( /* (o) Q14 : Gain of pitch lag saturated to 1.2 */
- Word16 xn[], /* (i) : Pitch target. */
- Word16 y1[], /* (i) : Filtered adaptive codebook. */
- Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
- Word16 L_subfr /* (i) : Length of subframe. */
+ Word16 xn[], /* (i) : Pitch target. */
+ Word16 y1[], /* (i) : Filtered adaptive codebook. */
+ Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
+ Word16 L_subfr /* (i) : Length of subframe. */
);
Word16 Enc_lag3( /* output: Return index of encoding */
- Word16 T0, /* input : Pitch delay */
- Word16 T0_frac, /* input : Fractional pitch delay */
- Word16 *T0_min, /* in/out: Minimum search delay */
- Word16 *T0_max, /* in/out: Maximum search delay */
- Word16 pit_min, /* input : Minimum pitch delay */
- Word16 pit_max, /* input : Maximum pitch delay */
- Word16 pit_flag /* input : Flag for 1st subframe */
+ Word16 T0, /* input : Pitch delay */
+ Word16 T0_frac, /* input : Fractional pitch delay */
+ Word16 *T0_min, /* in/out: Minimum search delay */
+ Word16 *T0_max, /* in/out: Maximum search delay */
+ Word16 pit_min, /* input : Minimum pitch delay */
+ Word16 pit_max, /* input : Maximum pitch delay */
+ Word16 pit_flag /* input : Flag for 1st subframe */
);
void Dec_lag3( /* output: return integer pitch lag */
- Word16 index, /* input : received pitch index */
- Word16 pit_min, /* input : minimum pitch lag */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 i_subfr, /* input : subframe flag */
- Word16 *T0, /* output: integer part of pitch lag */
- Word16 *T0_frac /* output: fractional part of pitch lag */
+ Word16 index, /* input : received pitch index */
+ Word16 pit_min, /* input : minimum pitch lag */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 i_subfr, /* input : subframe flag */
+ Word16 *T0, /* output: integer part of pitch lag */
+ Word16 *T0_frac /* output: fractional part of pitch lag */
);
Word16 Interpol_3( /* (o) : interpolated value */
- Word16 *x, /* (i) : input vector */
- Word16 frac /* (i) : fraction */
+ Word16 *x, /* (i) : input vector */
+ Word16 frac /* (i) : fraction */
);
void Pred_lt_3(
- Word16 exc[], /* in/out: excitation buffer */
- Word16 T0, /* input : integer pitch lag */
- Word16 frac, /* input : fraction of lag */
- Word16 L_subfr /* input : subframe size */
+ Word16 exc[], /* in/out: excitation buffer */
+ Word16 T0, /* input : integer pitch lag */
+ Word16 frac, /* input : fraction of lag */
+ Word16 L_subfr /* input : subframe size */
);
Word16 Parity_Pitch( /* output: parity bit (XOR of 6 MSB bits) */
- Word16 pitch_index /* input : index for which parity to compute */
+ Word16 pitch_index /* input : index for which parity to compute */
);
Word16 Check_Parity_Pitch( /* output: 0 = no error, 1= error */
- Word16 pitch_index, /* input : index of parameter */
- Word16 parity /* input : parity bit */
+ Word16 pitch_index, /* input : index of parameter */
+ Word16 parity /* input : parity bit */
);
void Cor_h_X(
- Word16 h[], /* (i) Q12 :Impulse response of filters */
- Word16 X[], /* (i) :Target vector */
- Word16 D[] /* (o) :Correlations between h[] and D[] */
- /* Normalized to 13 bits */
+ Word16 h[], /* (i) Q12 :Impulse response of filters */
+ Word16 X[], /* (i) :Target vector */
+ Word16 D[] /* (o) :Correlations between h[] and D[] */
+ /* Normalized to 13 bits */
);
/*-----------------------*
@@ -284,19 +284,19 @@ void Cor_h_X(
#define _1_16 (Word16)( 2048)
Word16 ACELP_Code_A( /* (o) :index of pulses positions */
- Word16 x[], /* (i) :Target vector */
- Word16 h[], /* (i) Q12 :Inpulse response of filters */
- Word16 T0, /* (i) :Pitch lag */
- Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
- Word16 code[], /* (o) Q13 :Innovative codebook */
- Word16 y[], /* (o) Q12 :Filtered innovative codebook */
- Word16 *sign /* (o) :Signs of 4 pulses */
+ Word16 x[], /* (i) :Target vector */
+ Word16 h[], /* (i) Q12 :Inpulse response of filters */
+ Word16 T0, /* (i) :Pitch lag */
+ Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
+ Word16 code[], /* (o) Q13 :Innovative codebook */
+ Word16 y[], /* (o) Q12 :Filtered innovative codebook */
+ Word16 *sign /* (o) :Signs of 4 pulses */
);
void Decod_ACELP(
- Word16 sign, /* (i) : signs of 4 pulses. */
- Word16 index, /* (i) : Positions of the 4 pulses. */
- Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
+ Word16 sign, /* (i) : signs of 4 pulses. */
+ Word16 index, /* (i) : Positions of the 4 pulses. */
+ Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
);
/*--------------------------------------------------------------------------*
* LSP constant parameters *
@@ -328,152 +328,152 @@ void Decod_ACELP(
*-------------------------------*/
void Lsf_lsp2(
- Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf2(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 m /* (i) : LPC order */
);
void Qua_lsp(
- Word16 lsp[], /* (i) Q15 : Unquantized LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
- Word16 ana[] /* (o) : indexes */
+ Word16 lsp[], /* (i) Q15 : Unquantized LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
+ Word16 ana[] /* (o) : indexes */
);
void Get_wegt(
- Word16 flsp[], /* Q13 */
- Word16 wegt[] /* Q11 -> normalized */
+ Word16 flsp[], /* Q13 */
+ Word16 wegt[] /* Q11 -> normalized */
);
void Lsp_encw_reset(
- void
+ void
);
void Lsp_qua_cs(
- Word16 flsp_in[M], /* Q13 */
- Word16 lspq_out[M], /* Q13 */
- Word16 *code
+ Word16 flsp_in[M], /* Q13 */
+ Word16 lspq_out[M], /* Q13 */
+ Word16 *code
);
void Lsp_expand_1(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_1_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_get_quant(
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 code0,
- Word16 code1,
- Word16 code2,
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 lspq[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 code0,
+ Word16 code1,
+ Word16 code2,
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 lspq[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_get_tdist(
- Word16 wegt[], /* normalized */
- Word16 buf[], /* Q13 */
- Word32 *L_tdist, /* Q27 */
- Word16 rbuf[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 wegt[], /* normalized */
+ Word16 buf[], /* Q13 */
+ Word32 *L_tdist, /* Q27 */
+ Word16 rbuf[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_last_select(
- Word32 L_tdist[], /* Q27 */
- Word16 *mode_index
+ Word32 L_tdist[], /* Q27 */
+ Word16 *mode_index
);
void Lsp_pre_select(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 *cand
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 *cand
);
void Lsp_select_1(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_select_2(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_stability(
- Word16 buf[] /* Q13 */
+ Word16 buf[] /* Q13 */
);
void Relspwed(
- Word16 lsp[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspq[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 fg[MODE][MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum[MODE][M], /* Q15 */
- Word16 fg_sum_inv[MODE][M], /* Q12 */
- Word16 code_ana[]
+ Word16 lsp[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspq[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 fg[MODE][MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum[MODE][M], /* Q15 */
+ Word16 fg_sum_inv[MODE][M], /* Q12 */
+ Word16 code_ana[]
);
void D_lsp(
- Word16 prm[], /* (i) : indexes of the selected LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
- Word16 erase /* (i) : frame erase information */
+ Word16 prm[], /* (i) : indexes of the selected LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
+ Word16 erase /* (i) : frame erase information */
);
void Lsp_decw_reset(
- void
+ void
);
void Lsp_iqua_cs(
- Word16 prm[], /* input : codes of the selected LSP*/
- Word16 lsp_q[], /* output: Quantized LSP parameters*/
- Word16 erase /* input : frame erase information */
+ Word16 prm[], /* input : codes of the selected LSP*/
+ Word16 lsp_q[], /* output: Quantized LSP parameters*/
+ Word16 erase /* input : frame erase information */
);
void Lsp_prev_compose(
- Word16 lsp_ele[], /* Q13 */
- Word16 lsp[], /* Q13 */
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lsp_ele[], /* Q13 */
+ Word16 lsp[], /* Q13 */
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_prev_extract(
- Word16 lsp[M], /* Q13 */
- Word16 lsp_ele[M], /* Q13 */
- Word16 fg[MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum_inv[M] /* Q12 */
+ Word16 lsp[M], /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 fg[MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum_inv[M] /* Q12 */
);
void Lsp_prev_update(
- Word16 lsp_ele[M], /* Q13 */
- Word16 freq_prev[MA_NP][M] /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 freq_prev[MA_NP][M] /* Q13 */
);
/*-------------------------------*
@@ -493,48 +493,48 @@ void Lsp_prev_update(
*--------------------------------------------------------------------------*/
Word16 Qua_gain(
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
- /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
- Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod, /* (o) Q1 : Code gain. */
- Word16 tameflag /* (i) : flag set to 1 if taming is needed */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
+ /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
+ Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod, /* (o) Q1 : Code gain. */
+ Word16 tameflag /* (i) : flag set to 1 if taming is needed */
);
void Dec_gain(
- Word16 index, /* (i) : Index of quantization. */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 bfi, /* (i) : Bad frame indicator */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod /* (o) Q1 : Code gain. */
+ Word16 index, /* (i) : Index of quantization. */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 bfi, /* (i) : Bad frame indicator */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod /* (o) Q1 : Code gain. */
);
void Gain_predict(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
- Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
+ Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
);
void Gain_update(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
);
void Gain_update_erasure(
- Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
+ Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
);
void Corr_xy2(
- Word16 xn[], /* (i) Q0 :Target vector. */
- Word16 y1[], /* (i) Q0 :Adaptive codebook. */
- Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
- Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
- Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
+ Word16 xn[], /* (i) Q0 :Target vector. */
+ Word16 y1[], /* (i) Q0 :Adaptive codebook. */
+ Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
+ Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
+ Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
);
/*-----------------------*
@@ -570,31 +570,31 @@ void bits2prm_ld8k(Word16 bits[], Word16 prm[]);
void Init_Post_Filter(void);
void Post_Filter(
- Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
- Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
- Word16 *T, /* input : decoded pitch lags in all subframes */
- Word16 Vad
+ Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
+ Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
+ Word16 *T, /* input : decoded pitch lags in all subframes */
+ Word16 Vad
);
void pit_pst_filt(
- Word16 *signal, /* (i) : input signal */
- Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
- Word16 t0_min, /* (i) : minimum value in the searched range */
- Word16 t0_max, /* (i) : maximum value in the searched range */
- Word16 L_subfr, /* (i) : size of filtering */
- Word16 *signal_pst /* (o) : harmonically postfiltered signal */
+ Word16 *signal, /* (i) : input signal */
+ Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
+ Word16 t0_min, /* (i) : minimum value in the searched range */
+ Word16 t0_max, /* (i) : maximum value in the searched range */
+ Word16 L_subfr, /* (i) : size of filtering */
+ Word16 *signal_pst /* (o) : harmonically postfiltered signal */
);
void preemphasis(
- Word16 *signal, /* (i/o) : input signal overwritten by the output */
- Word16 g, /* (i) Q15 : preemphasis coefficient */
- Word16 L /* (i) : size of filtering */
+ Word16 *signal, /* (i/o) : input signal overwritten by the output */
+ Word16 g, /* (i) Q15 : preemphasis coefficient */
+ Word16 L /* (i) : size of filtering */
);
void agc(
- Word16 *sig_in, /* (i) : postfilter input signal */
- Word16 *sig_out, /* (i/o) : postfilter output signal */
- Word16 l_trm /* (i) : subframe size */
+ Word16 *sig_in, /* (i) : postfilter input signal */
+ Word16 *sig_out, /* (i/o) : postfilter output signal */
+ Word16 l_trm /* (i) : subframe size */
);
/*--------------------------------------------------------------------------*
@@ -615,14 +615,14 @@ Word16 test_err(Word16 t0, Word16 t0_frac);
*--------------------------------------------------------------------------*/
void Copy(
- Word16 x[], /* (i) : input vector */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector length */
+ Word16 x[], /* (i) : input vector */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector length */
);
void Set_zero(
- Word16 x[], /* (o) : vector to clear */
- Word16 L /* (i) : length of vector */
+ Word16 x[], /* (o) : vector to clear */
+ Word16 L /* (i) : length of vector */
);
Word16 Random(Word16 *seed);
diff --git a/thirdparties/android/common/include/g729b/octet.h b/thirdparties/android/common/include/g729b/octet.h
index e75827a..61adecb 100755
--- a/thirdparties/android/common/include/g729b/octet.h
+++ b/thirdparties/android/common/include/g729b/octet.h
@@ -7,8 +7,8 @@
*/
/* Definition for Octet Transmission mode */
-/* When Annex B is used for transmission systems that operate on octet boundary,
- an extra bit (with value zero) will be packed at the end of a SID bit stream.
+/* When Annex B is used for transmission systems that operate on octet boundary,
+ an extra bit (with value zero) will be packed at the end of a SID bit stream.
This will change the number of bits in a SID bit stream from 15 bits to
16 bits (i.e., 2 bytes).
*/
diff --git a/thirdparties/android/common/include/g729b/sid.h b/thirdparties/android/common/include/g729b/sid.h
index 3aae1eb..a9b539b 100755
--- a/thirdparties/android/common/include/g729b/sid.h
+++ b/thirdparties/android/common/include/g729b/sid.h
@@ -14,8 +14,8 @@
void Init_lsfq_noise(void);
void lsfq_noise(Word16 *lsp_new, Word16 *lspq,
Word16 freq_prev[MA_NP][M], Word16 *idx);
-void sid_lsfq_decode(Word16 *index, Word16 *lspq,
- Word16 freq_prev[MA_NP][M]);
+void sid_lsfq_decode(Word16 *index, Word16 *lspq,
+ Word16 freq_prev[MA_NP][M]);
diff --git a/thirdparties/android/common/include/g729b/tab_ld8a.h b/thirdparties/android/common/include/g729b/tab_ld8a.h
index 0cb1b3e..08410d9 100755
--- a/thirdparties/android/common/include/g729b/tab_ld8a.h
+++ b/thirdparties/android/common/include/g729b/tab_ld8a.h
@@ -40,7 +40,7 @@ extern Word16 a100[3];
extern Word16 b140[3];
extern Word16 a140[3];
extern Word16 bitsno[PRM_SIZE];
-extern Word16 bitsno2[4];
+extern Word16 bitsno2[4];
extern Word16 tabpow[33];
extern Word16 tablog[33];
extern Word16 tabsqr[49];
diff --git a/thirdparties/android/common/include/g729b/typedef.h b/thirdparties/android/common/include/g729b/typedef.h
index 9a12d42..5dafcaa 100755
--- a/thirdparties/android/common/include/g729b/typedef.h
+++ b/thirdparties/android/common/include/g729b/typedef.h
@@ -40,7 +40,7 @@ typedef int Flag;
#elif defined(__GNUC__) && !defined(__APPLE__)
# define G729_INLINE __inline
#else
-# define G729_INLINE
+# define G729_INLINE
#endif
#if ANDROID || TARGET_OS_EMBEDDED || defined(_WIN32_WCE)
diff --git a/thirdparties/android/common/include/g729b/vad.h b/thirdparties/android/common/include/g729b/vad.h
index fb7a67e..d455071 100755
--- a/thirdparties/android/common/include/g729b/vad.h
+++ b/thirdparties/android/common/include/g729b/vad.h
@@ -17,14 +17,14 @@
void vad_init(void);
void vad(
- Word16 rc,
- Word16 *lsf,
- Word16 *r_h,
- Word16 *r_l,
- Word16 exp_R0,
- Word16 *sigpp,
- Word16 frm_count,
- Word16 prev_marker,
- Word16 pprev_marker,
- Word16 *marker);
+ Word16 rc,
+ Word16 *lsf,
+ Word16 *r_h,
+ Word16 *r_l,
+ Word16 exp_R0,
+ Word16 *sigpp,
+ Word16 frm_count,
+ Word16 prev_marker,
+ Word16 pprev_marker,
+ Word16 *marker);
diff --git a/thirdparties/android/common/include/gsm.h b/thirdparties/android/common/include/gsm.h
index 4714ab6..5df6c99 100755
--- a/thirdparties/android/common/include/gsm.h
+++ b/thirdparties/android/common/include/gsm.h
@@ -55,7 +55,7 @@ typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */
#define GSM_OPT_FRAME_CHAIN 6
extern gsm gsm_create GSM_P((void));
-extern void gsm_destroy GSM_P((gsm));
+extern void gsm_destroy GSM_P((gsm));
extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *));
extern int gsm_option GSM_P((gsm, int, int *));
diff --git a/thirdparties/android/common/include/ilbc/FrameClassify.h b/thirdparties/android/common/include/ilbc/FrameClassify.h
index 8d30cda..df76d32 100755
--- a/thirdparties/android/common/include/ilbc/FrameClassify.h
+++ b/thirdparties/android/common/include/ilbc/FrameClassify.h
@@ -1,28 +1,28 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- FrameClassify.h
+ FrameClassify.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_FRAMECLASSIFY_H
- #define __iLBC_FRAMECLASSIFY_H
+#ifndef __iLBC_FRAMECLASSIFY_H
+#define __iLBC_FRAMECLASSIFY_H
- int FrameClassify( /* index to the max-energy sub-frame */
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i/o) the encoder state structure */
- float *residual /* (i) lpc residual signal */
- );
+int FrameClassify( /* index to the max-energy sub-frame */
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i/o) the encoder state structure */
+ float *residual /* (i) lpc residual signal */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/LPCdecode.h b/thirdparties/android/common/include/ilbc/LPCdecode.h
index d2aae9b..a3e95c0 100755
--- a/thirdparties/android/common/include/ilbc/LPCdecode.h
+++ b/thirdparties/android/common/include/ilbc/LPCdecode.h
@@ -1,43 +1,43 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- LPC_decode.h
+ LPC_decode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LPC_DECODE_H
- #define __iLBC_LPC_DECODE_H
+#ifndef __iLBC_LPC_DECODE_H
+#define __iLBC_LPC_DECODE_H
- void LSFinterpolate2a_dec(
- float *a, /* (o) lpc coefficients for a sub-frame */
- float *lsf1, /* (i) first lsf coefficient vector */
- float *lsf2, /* (i) second lsf coefficient vector */
- float coef, /* (i) interpolation weight */
- int length /* (i) length of lsf vectors */
- );
+void LSFinterpolate2a_dec(
+ float *a, /* (o) lpc coefficients for a sub-frame */
+ float *lsf1, /* (i) first lsf coefficient vector */
+ float *lsf2, /* (i) second lsf coefficient vector */
+ float coef, /* (i) interpolation weight */
+ int length /* (i) length of lsf vectors */
+);
- void SimplelsfDEQ(
- float *lsfdeq, /* (o) dequantized lsf coefficients */
- int *index, /* (i) quantization index */
- int lpc_n /* (i) number of LPCs */
- );
+void SimplelsfDEQ(
+ float *lsfdeq, /* (o) dequantized lsf coefficients */
+ int *index, /* (i) quantization index */
+ int lpc_n /* (i) number of LPCs */
+);
- void DecoderInterpolateLSF(
- float *syntdenum, /* (o) synthesis filter coefficients */
- float *weightdenum, /* (o) weighting denumerator
+void DecoderInterpolateLSF(
+ float *syntdenum, /* (o) synthesis filter coefficients */
+ float *weightdenum, /* (o) weighting denumerator
coefficients */
- float *lsfdeq, /* (i) dequantized lsf coefficients */
- int length, /* (i) length of lsf coefficient vector */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i) the decoder state structure */
- );
+ float *lsfdeq, /* (i) dequantized lsf coefficients */
+ int length, /* (i) length of lsf coefficient vector */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i) the decoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/LPCencode.h b/thirdparties/android/common/include/ilbc/LPCencode.h
index 39a9b04..3452545 100755
--- a/thirdparties/android/common/include/ilbc/LPCencode.h
+++ b/thirdparties/android/common/include/ilbc/LPCencode.h
@@ -1,28 +1,28 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- LPCencode.h
+ LPCencode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LPCENCOD_H
- #define __iLBC_LPCENCOD_H
+#ifndef __iLBC_LPCENCOD_H
+#define __iLBC_LPCENCOD_H
- void LPCencode(
- float *syntdenum, /* (i/o) synthesis filter coefficients
+void LPCencode(
+ float *syntdenum, /* (i/o) synthesis filter coefficients
before/after encoding */
- float *weightdenum, /* (i/o) weighting denumerator coefficients
+ float *weightdenum, /* (i/o) weighting denumerator coefficients
before/after encoding */
- int *lsf_index, /* (o) lsf quantization index */
- float *data, /* (i) lsf coefficients to quantize */
- iLBC_Enc_Inst_t *iLBCenc_inst
- /* (i/o) the encoder state structure */
- );
+ int *lsf_index, /* (o) lsf quantization index */
+ float *data, /* (i) lsf coefficients to quantize */
+ iLBC_Enc_Inst_t *iLBCenc_inst
+ /* (i/o) the encoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/StateConstructW.h b/thirdparties/android/common/include/ilbc/StateConstructW.h
index a066b3d..e6ecf9b 100755
--- a/thirdparties/android/common/include/ilbc/StateConstructW.h
+++ b/thirdparties/android/common/include/ilbc/StateConstructW.h
@@ -1,9 +1,9 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- StateConstructW.h
+ StateConstructW.h
@@ -11,22 +11,22 @@
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_STATECONSTRUCTW_H
- #define __iLBC_STATECONSTRUCTW_H
+#ifndef __iLBC_STATECONSTRUCTW_H
+#define __iLBC_STATECONSTRUCTW_H
- void StateConstructW(
- int idxForMax, /* (i) 6-bit index for the quantization of
+void StateConstructW(
+ int idxForMax, /* (i) 6-bit index for the quantization of
max amplitude */
- int *idxVec, /* (i) vector of quantization indexes */
- float *syntDenum, /* (i) synthesis filter denumerator */
- float *out, /* (o) the decoded state vector */
- int len /* (i) length of a state vector */
- );
+ int *idxVec, /* (i) vector of quantization indexes */
+ float *syntDenum, /* (i) synthesis filter denumerator */
+ float *out, /* (o) the decoded state vector */
+ int len /* (i) length of a state vector */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/StateSearchW.h b/thirdparties/android/common/include/ilbc/StateSearchW.h
index 8809ac7..b34050e 100755
--- a/thirdparties/android/common/include/ilbc/StateSearchW.h
+++ b/thirdparties/android/common/include/ilbc/StateSearchW.h
@@ -1,47 +1,47 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- StateSearchW.h
+ StateSearchW.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_STATESEARCHW_H
- #define __iLBC_STATESEARCHW_H
+#ifndef __iLBC_STATESEARCHW_H
+#define __iLBC_STATESEARCHW_H
- void AbsQuantW(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) Encoder instance */
- float *in, /* (i) vector to encode */
- float *syntDenum, /* (i) denominator of synthesis filter */
- float *weightDenum, /* (i) denominator of weighting filter */
- int *out, /* (o) vector of quantizer indexes */
- int len, /* (i) length of vector to encode and
+void AbsQuantW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *in, /* (i) vector to encode */
+ float *syntDenum, /* (i) denominator of synthesis filter */
+ float *weightDenum, /* (i) denominator of weighting filter */
+ int *out, /* (o) vector of quantizer indexes */
+ int len, /* (i) length of vector to encode and
vector of quantizer indexes */
- int state_first /* (i) position of start state in the
+ int state_first /* (i) position of start state in the
80 vec */
- );
-
- void StateSearchW(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) Encoder instance */
- float *residual,/* (i) target residual vector */
- float *syntDenum, /* (i) lpc synthesis filter */
- float *weightDenum, /* (i) weighting filter denuminator */
- int *idxForMax, /* (o) quantizer index for maximum
+);
+
+void StateSearchW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *residual,/* (i) target residual vector */
+ float *syntDenum, /* (i) lpc synthesis filter */
+ float *weightDenum, /* (i) weighting filter denuminator */
+ int *idxForMax, /* (o) quantizer index for maximum
amplitude */
- int *idxVec, /* (o) vector of quantization indexes */
- int len, /* (i) length of all vectors */
- int state_first /* (i) position of start state in the
+ int *idxVec, /* (o) vector of quantization indexes */
+ int len, /* (i) length of all vectors */
+ int state_first /* (i) position of start state in the
80 vec */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/anaFilter.h b/thirdparties/android/common/include/ilbc/anaFilter.h
index 5a347e8..4238547 100755
--- a/thirdparties/android/common/include/ilbc/anaFilter.h
+++ b/thirdparties/android/common/include/ilbc/anaFilter.h
@@ -1,31 +1,31 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- anaFilter.h
+ anaFilter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ANAFILTER_H
- #define __iLBC_ANAFILTER_H
+#ifndef __iLBC_ANAFILTER_H
+#define __iLBC_ANAFILTER_H
- void anaFilter(
+void anaFilter(
-
+
- float *In, /* (i) Signal to be filtered */
- float *a, /* (i) LP parameters */
- int len,/* (i) Length of signal */
- float *Out, /* (o) Filtered signal */
- float *mem /* (i/o) Filter state */
- );
+ float *In, /* (i) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len,/* (i) Length of signal */
+ float *Out, /* (o) Filtered signal */
+ float *mem /* (i/o) Filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/constants.h b/thirdparties/android/common/include/ilbc/constants.h
index d2adb8a..213d0c7 100755
--- a/thirdparties/android/common/include/ilbc/constants.h
+++ b/thirdparties/android/common/include/ilbc/constants.h
@@ -1,22 +1,22 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- constants.h
+ constants.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_CONSTANTS_H
- #define __iLBC_CONSTANTS_H
+#ifndef __iLBC_CONSTANTS_H
+#define __iLBC_CONSTANTS_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- /* ULP bit allocation */
+/* ULP bit allocation */
@@ -24,53 +24,53 @@
- extern const iLBC_ULP_Inst_t ULP_20msTbl;
- extern const iLBC_ULP_Inst_t ULP_30msTbl;
+extern const iLBC_ULP_Inst_t ULP_20msTbl;
+extern const iLBC_ULP_Inst_t ULP_30msTbl;
- /* high pass filters */
+/* high pass filters */
- extern float hpi_zero_coefsTbl[];
- extern float hpi_pole_coefsTbl[];
- extern float hpo_zero_coefsTbl[];
- extern float hpo_pole_coefsTbl[];
+extern float hpi_zero_coefsTbl[];
+extern float hpi_pole_coefsTbl[];
+extern float hpo_zero_coefsTbl[];
+extern float hpo_pole_coefsTbl[];
- /* low pass filters */
- extern float lpFilt_coefsTbl[];
+/* low pass filters */
+extern float lpFilt_coefsTbl[];
- /* LPC analysis and quantization */
+/* LPC analysis and quantization */
- extern float lpc_winTbl[];
- extern float lpc_asymwinTbl[];
- extern float lpc_lagwinTbl[];
- extern float lsfCbTbl[];
- extern float lsfmeanTbl[];
- extern int dim_lsfCbTbl[];
- extern int size_lsfCbTbl[];
- extern float lsf_weightTbl_30ms[];
- extern float lsf_weightTbl_20ms[];
+extern float lpc_winTbl[];
+extern float lpc_asymwinTbl[];
+extern float lpc_lagwinTbl[];
+extern float lsfCbTbl[];
+extern float lsfmeanTbl[];
+extern int dim_lsfCbTbl[];
+extern int size_lsfCbTbl[];
+extern float lsf_weightTbl_30ms[];
+extern float lsf_weightTbl_20ms[];
- /* state quantization tables */
+/* state quantization tables */
- extern float state_sq3Tbl[];
- extern float state_frgqTbl[];
+extern float state_sq3Tbl[];
+extern float state_frgqTbl[];
- /* gain quantization tables */
+/* gain quantization tables */
- extern float gain_sq3Tbl[];
- extern float gain_sq4Tbl[];
- extern float gain_sq5Tbl[];
+extern float gain_sq3Tbl[];
+extern float gain_sq4Tbl[];
+extern float gain_sq5Tbl[];
- /* adaptive codebook definitions */
+/* adaptive codebook definitions */
- extern int search_rangeTbl[5][CB_NSTAGES];
- extern int memLfTbl[];
- extern int stMemLTbl;
- extern float cbfiltersTbl[CB_FILTERLEN];
+extern int search_rangeTbl[5][CB_NSTAGES];
+extern int memLfTbl[];
+extern int stMemLTbl;
+extern float cbfiltersTbl[CB_FILTERLEN];
- /* enhancer definitions */
+/* enhancer definitions */
- extern float polyphaserTbl[];
- extern float enh_plocsTbl[];
+extern float polyphaserTbl[];
+extern float enh_plocsTbl[];
@@ -78,5 +78,5 @@
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/createCB.h b/thirdparties/android/common/include/ilbc/createCB.h
index 7331dc8..430b13a 100755
--- a/thirdparties/android/common/include/ilbc/createCB.h
+++ b/thirdparties/android/common/include/ilbc/createCB.h
@@ -1,59 +1,59 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- createCB.h
+ createCB.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_CREATECB_H
- #define __iLBC_CREATECB_H
+#ifndef __iLBC_CREATECB_H
+#define __iLBC_CREATECB_H
- void filteredCBvecs(
- float *cbvectors, /* (o) Codebook vector for the
+void filteredCBvecs(
+ float *cbvectors, /* (o) Codebook vector for the
higher section */
-
+
- float *mem, /* (i) Buffer to create codebook
+ float *mem, /* (i) Buffer to create codebook
vectors from */
- int lMem /* (i) Length of buffer */
- );
-
- void searchAugmentedCB(
- int low, /* (i) Start index for the search */
- int high, /* (i) End index for the search */
- int stage, /* (i) Current stage */
- int startIndex, /* (i) CB index for the first
+ int lMem /* (i) Length of buffer */
+);
+
+void searchAugmentedCB(
+ int low, /* (i) Start index for the search */
+ int high, /* (i) End index for the search */
+ int stage, /* (i) Current stage */
+ int startIndex, /* (i) CB index for the first
augmented vector */
- float *target, /* (i) Target vector for encoding */
- float *buffer, /* (i) Pointer to the end of the
+ float *target, /* (i) Target vector for encoding */
+ float *buffer, /* (i) Pointer to the end of the
buffer for augmented codebook
construction */
- float *max_measure, /* (i/o) Currently maximum measure */
- int *best_index,/* (o) Currently the best index */
- float *gain, /* (o) Currently the best gain */
- float *energy, /* (o) Energy of augmented
+ float *max_measure, /* (i/o) Currently maximum measure */
+ int *best_index,/* (o) Currently the best index */
+ float *gain, /* (o) Currently the best gain */
+ float *energy, /* (o) Energy of augmented
codebook vectors */
- float *invenergy/* (o) Inv energy of aug codebook
+ float *invenergy/* (o) Inv energy of aug codebook
vectors */
- );
+);
- void createAugmentedVec(
- int index, /* (i) Index for the aug vector
+void createAugmentedVec(
+ int index, /* (i) Index for the aug vector
to be created */
- float *buffer, /* (i) Pointer to the end of the
+ float *buffer, /* (i) Pointer to the end of the
buffer for augmented codebook
construction */
- float *cbVec /* (o) The construced codebook vector */
- );
+ float *cbVec /* (o) The construced codebook vector */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/doCPLC.h b/thirdparties/android/common/include/ilbc/doCPLC.h
index 2bda7a1..10b6656 100755
--- a/thirdparties/android/common/include/ilbc/doCPLC.h
+++ b/thirdparties/android/common/include/ilbc/doCPLC.h
@@ -1,29 +1,29 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- doCPLC.h
+ doCPLC.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_DOLPC_H
- #define __iLBC_DOLPC_H
+#ifndef __iLBC_DOLPC_H
+#define __iLBC_DOLPC_H
- void doThePLC(
- float *PLCresidual, /* (o) concealed residual */
- float *PLClpc, /* (o) concealed LP parameters */
- int PLI, /* (i) packet loss indicator
+void doThePLC(
+ float *PLCresidual, /* (o) concealed residual */
+ float *PLClpc, /* (o) concealed LP parameters */
+ int PLI, /* (i) packet loss indicator
0 - no PL, 1 = PL */
- float *decresidual, /* (i) decoded residual */
- float *lpc, /* (i) decoded LPC (only used for no PL) */
- int inlag, /* (i) pitch lag */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i/o) decoder instance */
- );
-
- #endif
+ float *decresidual, /* (i) decoded residual */
+ float *lpc, /* (i) decoded LPC (only used for no PL) */
+ int inlag, /* (i) pitch lag */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) decoder instance */
+);
+
+#endif
diff --git a/thirdparties/android/common/include/ilbc/enhancer.h b/thirdparties/android/common/include/ilbc/enhancer.h
index bc5152a..20fa8a4 100755
--- a/thirdparties/android/common/include/ilbc/enhancer.h
+++ b/thirdparties/android/common/include/ilbc/enhancer.h
@@ -1,37 +1,37 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- enhancer.h
+ enhancer.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __ENHANCER_H
- #define __ENHANCER_H
+#ifndef __ENHANCER_H
+#define __ENHANCER_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- float xCorrCoef(
- float *target, /* (i) first array */
- float *regressor, /* (i) second array */
- int subl /* (i) dimension arrays */
- );
+float xCorrCoef(
+ float *target, /* (i) first array */
+ float *regressor, /* (i) second array */
+ int subl /* (i) dimension arrays */
+);
- int enhancerInterface(
- float *out, /* (o) the enhanced recidual signal */
- float *in, /* (i) the recidual signal to enhance */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i/o) the decoder state structure */
- );
+int enhancerInterface(
+ float *out, /* (o) the enhanced recidual signal */
+ float *in, /* (i) the recidual signal to enhance */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) the decoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/filter.h b/thirdparties/android/common/include/ilbc/filter.h
index 63f5af7..3db573f 100755
--- a/thirdparties/android/common/include/ilbc/filter.h
+++ b/thirdparties/android/common/include/ilbc/filter.h
@@ -1,14 +1,14 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- filter.h
+ filter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
@@ -16,11 +16,11 @@
- #ifndef __iLBC_FILTER_H
- #define __iLBC_FILTER_H
+#ifndef __iLBC_FILTER_H
+#define __iLBC_FILTER_H
- void AllPoleFilter(
- float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
+void AllPoleFilter(
+ float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
InOut[-1] contain the state of the
filter (delayed samples). InOut[0] to
InOut[lengthInOut-1] contain the filter
@@ -28,41 +28,41 @@
InOut[-1] is unchanged and InOut[0] to
InOut[lengthInOut-1] contain filtered
samples */
- float *Coef,/* (i) filter coefficients, Coef[0] is assumed
+ float *Coef,/* (i) filter coefficients, Coef[0] is assumed
to be 1.0 */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef /* (i) number of filter coefficients */
- );
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef /* (i) number of filter coefficients */
+);
- void AllZeroFilter(
- float *In, /* (i) In[0] to In[lengthInOut-1] contain
+void AllZeroFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain
filter input samples */
- float *Coef,/* (i) filter coefficients (Coef[0] is assumed
+ float *Coef,/* (i) filter coefficients (Coef[0] is assumed
to be 1.0) */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef, /* (i) number of filter coefficients */
- float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
contain the filter state, on exit Out[0]
to Out[lengthInOut-1] contain filtered
samples */
- );
+);
- void ZeroPoleFilter(
- float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
+void ZeroPoleFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
input samples In[-orderCoef] to In[-1]
contain state of all-zero section */
- float *ZeroCoef,/* (i) filter coefficients for all-zero
+ float *ZeroCoef,/* (i) filter coefficients for all-zero
section (ZeroCoef[0] is assumed to
be 1.0) */
- float *PoleCoef,/* (i) filter coefficients for all-pole section
+ float *PoleCoef,/* (i) filter coefficients for all-pole section
(ZeroCoef[0] is assumed to be 1.0) */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef, /* (i) number of filter coefficients */
- float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
contain state of all-pole section. On
exit Out[0] to Out[lengthInOut-1]
contain filtered samples */
- );
+);
@@ -70,13 +70,13 @@
- void DownSample (
- float *In, /* (i) input samples */
- float *Coef, /* (i) filter coefficients */
- int lengthIn, /* (i) number of input samples */
- float *state, /* (i) filter state */
- float *Out /* (o) downsampled output */
- );
+void DownSample (
+ float *In, /* (i) input samples */
+ float *Coef, /* (i) filter coefficients */
+ int lengthIn, /* (i) number of input samples */
+ float *state, /* (i) filter state */
+ float *Out /* (o) downsampled output */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/gainquant.h b/thirdparties/android/common/include/ilbc/gainquant.h
index 0d02424..6381292 100755
--- a/thirdparties/android/common/include/ilbc/gainquant.h
+++ b/thirdparties/android/common/include/ilbc/gainquant.h
@@ -1,30 +1,30 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- gainquant.h
+ gainquant.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_GAINQUANT_H
- #define __iLBC_GAINQUANT_H
+#ifndef __iLBC_GAINQUANT_H
+#define __iLBC_GAINQUANT_H
- float gainquant(/* (o) quantized gain value */
- float in, /* (i) gain value */
- float maxIn,/* (i) maximum of gain value */
- int cblen, /* (i) number of quantization indices */
- int *index /* (o) quantization index */
- );
+float gainquant(/* (o) quantized gain value */
+ float in, /* (i) gain value */
+ float maxIn,/* (i) maximum of gain value */
+ int cblen, /* (i) number of quantization indices */
+ int *index /* (o) quantization index */
+);
- float gaindequant( /* (o) quantized gain value */
- int index, /* (i) quantization index */
- float maxIn,/* (i) maximum of unquantized gain */
- int cblen /* (i) number of quantization indices */
- );
+float gaindequant( /* (o) quantized gain value */
+ int index, /* (i) quantization index */
+ float maxIn,/* (i) maximum of unquantized gain */
+ int cblen /* (i) number of quantization indices */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/getCBvec.h b/thirdparties/android/common/include/ilbc/getCBvec.h
index 0080907..c8f36e3 100755
--- a/thirdparties/android/common/include/ilbc/getCBvec.h
+++ b/thirdparties/android/common/include/ilbc/getCBvec.h
@@ -1,25 +1,25 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- getCBvec.h
+ getCBvec.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_GETCBVEC_H
- #define __iLBC_GETCBVEC_H
+#ifndef __iLBC_GETCBVEC_H
+#define __iLBC_GETCBVEC_H
- void getCBvec(
- float *cbvec, /* (o) Constructed codebook vector */
- float *mem, /* (i) Codebook buffer */
- int index, /* (i) Codebook index */
- int lMem, /* (i) Length of codebook buffer */
- int cbveclen/* (i) Codebook vector length */
- );
+void getCBvec(
+ float *cbvec, /* (o) Constructed codebook vector */
+ float *mem, /* (i) Codebook buffer */
+ int index, /* (i) Codebook index */
+ int lMem, /* (i) Length of codebook buffer */
+ int cbveclen/* (i) Codebook vector length */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/helpfun.h b/thirdparties/android/common/include/ilbc/helpfun.h
index 6e80c80..2a2b33b 100755
--- a/thirdparties/android/common/include/ilbc/helpfun.h
+++ b/thirdparties/android/common/include/ilbc/helpfun.h
@@ -1,96 +1,96 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- helpfun.h
+ helpfun.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HELPFUN_H
- #define __iLBC_HELPFUN_H
+#ifndef __iLBC_HELPFUN_H
+#define __iLBC_HELPFUN_H
- void autocorr(
- float *r, /* (o) autocorrelation vector */
- const float *x, /* (i) data vector */
- int N, /* (i) length of data vector */
- int order /* largest lag for calculated
+void autocorr(
+ float *r, /* (o) autocorrelation vector */
+ const float *x, /* (i) data vector */
+ int N, /* (i) length of data vector */
+ int order /* largest lag for calculated
autocorrelations */
- );
+);
- void window(
- float *z, /* (o) the windowed data */
- const float *x, /* (i) the original data vector */
- const float *y, /* (i) the window */
- int N /* (i) length of all vectors */
- );
+void window(
+ float *z, /* (o) the windowed data */
+ const float *x, /* (i) the original data vector */
+ const float *y, /* (i) the window */
+ int N /* (i) length of all vectors */
+);
- void levdurb(
- float *a, /* (o) lpc coefficient vector starting
+void levdurb(
+ float *a, /* (o) lpc coefficient vector starting
with 1.0 */
- float *k, /* (o) reflection coefficients */
- float *r, /* (i) autocorrelation vector */
- int order /* (i) order of lpc filter */
- );
+ float *k, /* (o) reflection coefficients */
+ float *r, /* (i) autocorrelation vector */
+ int order /* (i) order of lpc filter */
+);
- void interpolate(
+void interpolate(
-
+
- float *out, /* (o) the interpolated vector */
- float *in1, /* (i) the first vector for the
+ float *out, /* (o) the interpolated vector */
+ float *in1, /* (i) the first vector for the
interpolation */
- float *in2, /* (i) the second vector for the
+ float *in2, /* (i) the second vector for the
interpolation */
- float coef, /* (i) interpolation weights */
- int length /* (i) length of all vectors */
- );
+ float coef, /* (i) interpolation weights */
+ int length /* (i) length of all vectors */
+);
- void bwexpand(
- float *out, /* (o) the bandwidth expanded lpc
+void bwexpand(
+ float *out, /* (o) the bandwidth expanded lpc
coefficients */
- float *in, /* (i) the lpc coefficients before bandwidth
+ float *in, /* (i) the lpc coefficients before bandwidth
expansion */
- float coef, /* (i) the bandwidth expansion factor */
- int length /* (i) the length of lpc coefficient vectors */
- );
-
- void vq(
- float *Xq, /* (o) the quantized vector */
- int *index, /* (o) the quantization index */
- const float *CB,/* (i) the vector quantization codebook */
- float *X, /* (i) the vector to quantize */
- int n_cb, /* (i) the number of vectors in the codebook */
- int dim /* (i) the dimension of all vectors */
- );
-
- void SplitVQ(
- float *qX, /* (o) the quantized vector */
- int *index, /* (o) a vector of indexes for all vector
+ float coef, /* (i) the bandwidth expansion factor */
+ int length /* (i) the length of lpc coefficient vectors */
+);
+
+void vq(
+ float *Xq, /* (o) the quantized vector */
+ int *index, /* (o) the quantization index */
+ const float *CB,/* (i) the vector quantization codebook */
+ float *X, /* (i) the vector to quantize */
+ int n_cb, /* (i) the number of vectors in the codebook */
+ int dim /* (i) the dimension of all vectors */
+);
+
+void SplitVQ(
+ float *qX, /* (o) the quantized vector */
+ int *index, /* (o) a vector of indexes for all vector
codebooks in the split */
- float *X, /* (i) the vector to quantize */
- const float *CB,/* (i) the quantizer codebook */
- int nsplit, /* the number of vector splits */
- const int *dim, /* the dimension of X and qX */
- const int *cbsize /* the number of vectors in the codebook */
- );
+ float *X, /* (i) the vector to quantize */
+ const float *CB,/* (i) the quantizer codebook */
+ int nsplit, /* the number of vector splits */
+ const int *dim, /* the dimension of X and qX */
+ const int *cbsize /* the number of vectors in the codebook */
+);
- void sort_sq(
- float *xq, /* (o) the quantized value */
- int *index, /* (o) the quantization index */
- float x, /* (i) the value to quantize */
- const float *cb,/* (i) the quantization codebook */
- int cb_size /* (i) the size of the quantization codebook */
- );
+void sort_sq(
+ float *xq, /* (o) the quantized value */
+ int *index, /* (o) the quantization index */
+ float x, /* (i) the value to quantize */
+ const float *cb,/* (i) the quantization codebook */
+ int cb_size /* (i) the size of the quantization codebook */
+);
- int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
+int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
@@ -98,11 +98,11 @@
nonstable ones */
- float *lsf, /* (i) a table of lsf vectors */
- int dim, /* (i) the dimension of each lsf vector */
- int NoAn /* (i) the number of lsf vectors in the
+ float *lsf, /* (i) a table of lsf vectors */
+ int dim, /* (i) the dimension of each lsf vector */
+ int NoAn /* (i) the number of lsf vectors in the
table */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/hpInput.h b/thirdparties/android/common/include/ilbc/hpInput.h
index 3b020d1..2a5da2e 100755
--- a/thirdparties/android/common/include/ilbc/hpInput.h
+++ b/thirdparties/android/common/include/ilbc/hpInput.h
@@ -1,24 +1,24 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- hpInput.h
+ hpInput.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HPINPUT_H
- #define __iLBC_HPINPUT_H
+#ifndef __iLBC_HPINPUT_H
+#define __iLBC_HPINPUT_H
- void hpInput(
- float *In, /* (i) vector to filter */
- int len, /* (i) length of vector to filter */
- float *Out, /* (o) the resulting filtered vector */
- float *mem /* (i/o) the filter state */
- );
+void hpInput(
+ float *In, /* (i) vector to filter */
+ int len, /* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/hpOutput.h b/thirdparties/android/common/include/ilbc/hpOutput.h
index b213a19..839fbe1 100755
--- a/thirdparties/android/common/include/ilbc/hpOutput.h
+++ b/thirdparties/android/common/include/ilbc/hpOutput.h
@@ -1,24 +1,24 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- hpOutput.h
+ hpOutput.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HPOUTPUT_H
- #define __iLBC_HPOUTPUT_H
+#ifndef __iLBC_HPOUTPUT_H
+#define __iLBC_HPOUTPUT_H
- void hpOutput(
- float *In, /* (i) vector to filter */
- int len,/* (i) length of vector to filter */
- float *Out, /* (o) the resulting filtered vector */
- float *mem /* (i/o) the filter state */
- );
+void hpOutput(
+ float *In, /* (i) vector to filter */
+ int len,/* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/iCBConstruct.h b/thirdparties/android/common/include/ilbc/iCBConstruct.h
index 373f66e..5eba11f 100755
--- a/thirdparties/android/common/include/ilbc/iCBConstruct.h
+++ b/thirdparties/android/common/include/ilbc/iCBConstruct.h
@@ -1,12 +1,12 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iCBConstruct.h
+ iCBConstruct.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
@@ -14,28 +14,28 @@
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ICBCONSTRUCT_H
- #define __iLBC_ICBCONSTRUCT_H
+#ifndef __iLBC_ICBCONSTRUCT_H
+#define __iLBC_ICBCONSTRUCT_H
- void index_conv_enc(
- int *index /* (i/o) Codebook indexes */
- );
+void index_conv_enc(
+ int *index /* (i/o) Codebook indexes */
+);
- void index_conv_dec(
- int *index /* (i/o) Codebook indexes */
- );
+void index_conv_dec(
+ int *index /* (i/o) Codebook indexes */
+);
- void iCBConstruct(
- float *decvector, /* (o) Decoded vector */
- int *index, /* (i) Codebook indices */
- int *gain_index,/* (i) Gain quantization indices */
- float *mem, /* (i) Buffer for codevector construction */
- int lMem, /* (i) Length of buffer */
- int veclen, /* (i) Length of vector */
- int nStages /* (i) Number of codebook stages */
- );
+void iCBConstruct(
+ float *decvector, /* (o) Decoded vector */
+ int *index, /* (i) Codebook indices */
+ int *gain_index,/* (i) Gain quantization indices */
+ float *mem, /* (i) Buffer for codevector construction */
+ int lMem, /* (i) Length of buffer */
+ int veclen, /* (i) Length of vector */
+ int nStages /* (i) Number of codebook stages */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/iCBSearch.h b/thirdparties/android/common/include/ilbc/iCBSearch.h
index 39695b5..254f798 100755
--- a/thirdparties/android/common/include/ilbc/iCBSearch.h
+++ b/thirdparties/android/common/include/ilbc/iCBSearch.h
@@ -1,17 +1,17 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iCBSearch.h
+ iCBSearch.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ICBSEARCH_H
- #define __iLBC_ICBSEARCH_H
+#ifndef __iLBC_ICBSEARCH_H
+#define __iLBC_ICBSEARCH_H
@@ -19,20 +19,20 @@
- void iCBSearch(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) the encoder state structure */
- int *index, /* (o) Codebook indices */
- int *gain_index,/* (o) Gain quantization indices */
- float *intarget,/* (i) Target vector for encoding */
- float *mem, /* (i) Buffer for codebook construction */
- int lMem, /* (i) Length of buffer */
- int lTarget, /* (i) Length of vector */
- int nStages, /* (i) Number of codebook stages */
- float *weightDenum, /* (i) weighting filter coefficients */
- float *weightState, /* (i) weighting filter state */
- int block /* (i) the sub-block number */
- );
-
- #endif
+void iCBSearch(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) the encoder state structure */
+ int *index, /* (o) Codebook indices */
+ int *gain_index,/* (o) Gain quantization indices */
+ float *intarget,/* (i) Target vector for encoding */
+ float *mem, /* (i) Buffer for codebook construction */
+ int lMem, /* (i) Length of buffer */
+ int lTarget, /* (i) Length of vector */
+ int nStages, /* (i) Number of codebook stages */
+ float *weightDenum, /* (i) weighting filter coefficients */
+ float *weightState, /* (i) weighting filter state */
+ int block /* (i) the sub-block number */
+);
+
+#endif
diff --git a/thirdparties/android/common/include/ilbc/iLBC_decode.h b/thirdparties/android/common/include/ilbc/iLBC_decode.h
index bfd5223..33ab71d 100755
--- a/thirdparties/android/common/include/ilbc/iLBC_decode.h
+++ b/thirdparties/android/common/include/ilbc/iLBC_decode.h
@@ -1,43 +1,43 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_decode.h
+ iLBC_decode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ILBCDECODE_H
- #define __iLBC_ILBCDECODE_H
+#ifndef __iLBC_ILBCDECODE_H
+#define __iLBC_ILBCDECODE_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- short initDecode( /* (o) Number of decoded
+short initDecode( /* (o) Number of decoded
samples */
- iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
- int mode, /* (i) frame size mode */
- int use_enhancer /* (i) 1 to use enhancer
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
+ int mode, /* (i) frame size mode */
+ int use_enhancer /* (i) 1 to use enhancer
0 to run without
enhancer */
- );
+);
- void iLBC_decode(
- float *decblock, /* (o) decoded signal block */
- unsigned char *bytes, /* (i) encoded signal bits */
- iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
+void iLBC_decode(
+ float *decblock, /* (o) decoded signal block */
+ unsigned char *bytes, /* (i) encoded signal bits */
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
structure */
- int mode /* (i) 0: bad packet, PLC,
+ int mode /* (i) 0: bad packet, PLC,
1: normal */
-
+
- );
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/iLBC_define.h b/thirdparties/android/common/include/ilbc/iLBC_define.h
index e704f77..3d7f6d4 100755
--- a/thirdparties/android/common/include/ilbc/iLBC_define.h
+++ b/thirdparties/android/common/include/ilbc/iLBC_define.h
@@ -1,221 +1,221 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_define.h
+ iLBC_define.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
- #include <string.h>
+******************************************************************/
+#include <string.h>
- #ifndef __iLBC_ILBCDEFINE_H
- #define __iLBC_ILBCDEFINE_H
+#ifndef __iLBC_ILBCDEFINE_H
+#define __iLBC_ILBCDEFINE_H
- /* general codec settings */
+/* general codec settings */
- #define FS (float)8000.0
- #define BLOCKL_20MS 160
- #define BLOCKL_30MS 240
- #define BLOCKL_MAX 240
- #define NSUB_20MS 4
- #define NSUB_30MS 6
- #define NSUB_MAX 6
- #define NASUB_20MS 2
+#define FS (float)8000.0
+#define BLOCKL_20MS 160
+#define BLOCKL_30MS 240
+#define BLOCKL_MAX 240
+#define NSUB_20MS 4
+#define NSUB_30MS 6
+#define NSUB_MAX 6
+#define NASUB_20MS 2
- #define NASUB_30MS 4
- #define NASUB_MAX 4
- #define SUBL 40
- #define STATE_LEN 80
- #define STATE_SHORT_LEN_30MS 58
- #define STATE_SHORT_LEN_20MS 57
-
- /* LPC settings */
-
- #define LPC_FILTERORDER 10
- #define LPC_CHIRP_SYNTDENUM (float)0.9025
- #define LPC_CHIRP_WEIGHTDENUM (float)0.4222
- #define LPC_LOOKBACK 60
- #define LPC_N_20MS 1
- #define LPC_N_30MS 2
- #define LPC_N_MAX 2
- #define LPC_ASYMDIFF 20
- #define LPC_BW (float)60.0
- #define LPC_WN (float)1.0001
- #define LSF_NSPLIT 3
- #define LSF_NUMBER_OF_STEPS 4
- #define LPC_HALFORDER (LPC_FILTERORDER/2)
-
- /* cb settings */
-
- #define CB_NSTAGES 3
- #define CB_EXPAND 2
- #define CB_MEML 147
- #define CB_FILTERLEN 2*4
- #define CB_HALFFILTERLEN 4
- #define CB_RESRANGE 34
- #define CB_MAXGAIN (float)1.3
-
- /* enhancer */
-
- #define ENH_BLOCKL 80 /* block length */
- #define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
- #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks
+#define NASUB_30MS 4
+#define NASUB_MAX 4
+#define SUBL 40
+#define STATE_LEN 80
+#define STATE_SHORT_LEN_30MS 58
+#define STATE_SHORT_LEN_20MS 57
+
+/* LPC settings */
+
+#define LPC_FILTERORDER 10
+#define LPC_CHIRP_SYNTDENUM (float)0.9025
+#define LPC_CHIRP_WEIGHTDENUM (float)0.4222
+#define LPC_LOOKBACK 60
+#define LPC_N_20MS 1
+#define LPC_N_30MS 2
+#define LPC_N_MAX 2
+#define LPC_ASYMDIFF 20
+#define LPC_BW (float)60.0
+#define LPC_WN (float)1.0001
+#define LSF_NSPLIT 3
+#define LSF_NUMBER_OF_STEPS 4
+#define LPC_HALFORDER (LPC_FILTERORDER/2)
+
+/* cb settings */
+
+#define CB_NSTAGES 3
+#define CB_EXPAND 2
+#define CB_MEML 147
+#define CB_FILTERLEN 2*4
+#define CB_HALFFILTERLEN 4
+#define CB_RESRANGE 34
+#define CB_MAXGAIN (float)1.3
+
+/* enhancer */
+
+#define ENH_BLOCKL 80 /* block length */
+#define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
+#define ENH_HL 3 /* 2*ENH_HL+1 is number blocks
in said second sequence */
- #define ENH_SLOP 2 /* max difference estimated and
+#define ENH_SLOP 2 /* max difference estimated and
correct pitch period */
- #define ENH_PLOCSL 20 /* pitch-estimates and pitch-
+#define ENH_PLOCSL 20 /* pitch-estimates and pitch-
locations buffer length */
- #define ENH_OVERHANG 2
- #define ENH_UPS0 4 /* upsampling rate */
- #define ENH_FL0 3 /* 2*FLO+1 is the length of
+#define ENH_OVERHANG 2
+#define ENH_UPS0 4 /* upsampling rate */
+#define ENH_FL0 3 /* 2*FLO+1 is the length of
each filter */
- #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0)
+#define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0)
- #define ENH_CORRDIM (2*ENH_SLOP+1)
- #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL)
- #define ENH_NBLOCKS_EXTRA 5
- #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS +
+#define ENH_CORRDIM (2*ENH_SLOP+1)
+#define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL)
+#define ENH_NBLOCKS_EXTRA 5
+#define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS +
ENH_NBLOCKS_EXTRA */
- #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL
- #define ENH_ALPHA0 (float)0.05
+#define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL
+#define ENH_ALPHA0 (float)0.05
- /* Down sampling */
+/* Down sampling */
- #define FILTERORDER_DS 7
- #define DELAY_DS 3
- #define FACTOR_DS 2
+#define FILTERORDER_DS 7
+#define DELAY_DS 3
+#define FACTOR_DS 2
- /* bit stream defs */
+/* bit stream defs */
- #define NO_OF_BYTES_20MS 38
- #define NO_OF_BYTES_30MS 50
- #define NO_OF_WORDS_20MS 19
- #define NO_OF_WORDS_30MS 25
- #define STATE_BITS 3
- #define BYTE_LEN 8
- #define ULP_CLASSES 3
+#define NO_OF_BYTES_20MS 38
+#define NO_OF_BYTES_30MS 50
+#define NO_OF_WORDS_20MS 19
+#define NO_OF_WORDS_30MS 25
+#define STATE_BITS 3
+#define BYTE_LEN 8
+#define ULP_CLASSES 3
- /* help parameters */
+/* help parameters */
- #define FLOAT_MAX (float)1.0e37
- #define EPS (float)2.220446049250313e-016
- #define PI (float)3.14159265358979323846
- #define MIN_SAMPLE -32768
- #define MAX_SAMPLE 32767
- #define TWO_PI (float)6.283185307
- #define PI2 (float)0.159154943
+#define FLOAT_MAX (float)1.0e37
+#define EPS (float)2.220446049250313e-016
+#define PI (float)3.14159265358979323846
+#define MIN_SAMPLE -32768
+#define MAX_SAMPLE 32767
+#define TWO_PI (float)6.283185307
+#define PI2 (float)0.159154943
- /* type definition encoder instance */
- typedef struct iLBC_ULP_Inst_t_ {
- int lsf_bits[6][ULP_CLASSES+2];
- int start_bits[ULP_CLASSES+2];
- int startfirst_bits[ULP_CLASSES+2];
- int scale_bits[ULP_CLASSES+2];
- int state_bits[ULP_CLASSES+2];
- int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
- int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
- int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
- int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
- } iLBC_ULP_Inst_t;
+/* type definition encoder instance */
+typedef struct iLBC_ULP_Inst_t_ {
+ int lsf_bits[6][ULP_CLASSES+2];
+ int start_bits[ULP_CLASSES+2];
+ int startfirst_bits[ULP_CLASSES+2];
+ int scale_bits[ULP_CLASSES+2];
+ int state_bits[ULP_CLASSES+2];
+ int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
+ int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
+ int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+ int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+} iLBC_ULP_Inst_t;
- /* type definition encoder instance */
+/* type definition encoder instance */
- typedef struct iLBC_Enc_Inst_t_ {
+typedef struct iLBC_Enc_Inst_t_ {
- /* flag for frame size mode */
- int mode;
+ /* flag for frame size mode */
+ int mode;
- /* basic parameters for different frame sizes */
- int blockl;
- int nsub;
- int nasub;
- int no_of_bytes, no_of_words;
- int lpc_n;
- int state_short_len;
- const iLBC_ULP_Inst_t *ULP_inst;
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
- /* analysis filter state */
- float anaMem[LPC_FILTERORDER];
+ /* analysis filter state */
+ float anaMem[LPC_FILTERORDER];
- /* old lsf parameters for interpolation */
- float lsfold[LPC_FILTERORDER];
- float lsfdeqold[LPC_FILTERORDER];
+ /* old lsf parameters for interpolation */
+ float lsfold[LPC_FILTERORDER];
+ float lsfdeqold[LPC_FILTERORDER];
- /* signal buffer for LP analysis */
- float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
+ /* signal buffer for LP analysis */
+ float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
- /* state of input HP filter */
- float hpimem[4];
+ /* state of input HP filter */
+ float hpimem[4];
- } iLBC_Enc_Inst_t;
+} iLBC_Enc_Inst_t;
- /* type definition decoder instance */
- typedef struct iLBC_Dec_Inst_t_ {
+/* type definition decoder instance */
+typedef struct iLBC_Dec_Inst_t_ {
- /* flag for frame size mode */
- int mode;
+ /* flag for frame size mode */
+ int mode;
- /* basic parameters for different frame sizes */
- int blockl;
- int nsub;
- int nasub;
- int no_of_bytes, no_of_words;
- int lpc_n;
- int state_short_len;
- const iLBC_ULP_Inst_t *ULP_inst;
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
- /* synthesis filter state */
- float syntMem[LPC_FILTERORDER];
+ /* synthesis filter state */
+ float syntMem[LPC_FILTERORDER];
- /* old LSF for interpolation */
+ /* old LSF for interpolation */
-
+
- float lsfdeqold[LPC_FILTERORDER];
+ float lsfdeqold[LPC_FILTERORDER];
- /* pitch lag estimated in enhancer and used in PLC */
- int last_lag;
+ /* pitch lag estimated in enhancer and used in PLC */
+ int last_lag;
- /* PLC state information */
- int prevLag, consPLICount, prevPLI, prev_enh_pl;
- float prevLpc[LPC_FILTERORDER+1];
- float prevResidual[NSUB_MAX*SUBL];
- float per;
- unsigned long seed;
+ /* PLC state information */
+ int prevLag, consPLICount, prevPLI, prev_enh_pl;
+ float prevLpc[LPC_FILTERORDER+1];
+ float prevResidual[NSUB_MAX*SUBL];
+ float per;
+ unsigned long seed;
- /* previous synthesis filter parameters */
- float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
+ /* previous synthesis filter parameters */
+ float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
- /* state of output HP filter */
- float hpomem[4];
+ /* state of output HP filter */
+ float hpomem[4];
- /* enhancer state information */
- int use_enhancer;
- float enh_buf[ENH_BUFL];
- float enh_period[ENH_NBLOCKS_TOT];
+ /* enhancer state information */
+ int use_enhancer;
+ float enh_buf[ENH_BUFL];
+ float enh_period[ENH_NBLOCKS_TOT];
- } iLBC_Dec_Inst_t;
+} iLBC_Dec_Inst_t;
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/iLBC_encode.h b/thirdparties/android/common/include/ilbc/iLBC_encode.h
index bc49359..9795bef 100755
--- a/thirdparties/android/common/include/ilbc/iLBC_encode.h
+++ b/thirdparties/android/common/include/ilbc/iLBC_encode.h
@@ -1,36 +1,36 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_encode.h
+ iLBC_encode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ILBCENCODE_H
- #define __iLBC_ILBCENCODE_H
+#ifndef __iLBC_ILBCENCODE_H
+#define __iLBC_ILBCENCODE_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- short initEncode( /* (o) Number of bytes
+short initEncode( /* (o) Number of bytes
encoded */
- iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
- int mode /* (i) frame size mode */
- );
+ iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
+ int mode /* (i) frame size mode */
+);
- void iLBC_encode(
+void iLBC_encode(
- unsigned char *bytes, /* (o) encoded data bits iLBC */
- float *block, /* (o) speech vector to
+ unsigned char *bytes, /* (o) encoded data bits iLBC */
+ float *block, /* (o) speech vector to
encode */
- iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
+ iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
state */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/lsf.h b/thirdparties/android/common/include/ilbc/lsf.h
index caff77e..391dbcd 100755
--- a/thirdparties/android/common/include/ilbc/lsf.h
+++ b/thirdparties/android/common/include/ilbc/lsf.h
@@ -1,27 +1,27 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- lsf.h
+ lsf.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LSF_H
- #define __iLBC_LSF_H
+#ifndef __iLBC_LSF_H
+#define __iLBC_LSF_H
- void a2lsf(
- float *freq,/* (o) lsf coefficients */
- float *a /* (i) lpc coefficients */
- );
+void a2lsf(
+ float *freq,/* (o) lsf coefficients */
+ float *a /* (i) lpc coefficients */
+);
- void lsf2a(
- float *a_coef, /* (o) lpc coefficients */
- float *freq /* (i) lsf coefficients */
- );
+void lsf2a(
+ float *a_coef, /* (o) lpc coefficients */
+ float *freq /* (i) lsf coefficients */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/packing.h b/thirdparties/android/common/include/ilbc/packing.h
index 762cfb1..624c2b4 100755
--- a/thirdparties/android/common/include/ilbc/packing.h
+++ b/thirdparties/android/common/include/ilbc/packing.h
@@ -1,69 +1,69 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- packing.h
+ packing.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __PACKING_H
- #define __PACKING_H
+#ifndef __PACKING_H
+#define __PACKING_H
- void packsplit(
- int *index, /* (i) the value to split */
- int *firstpart, /* (o) the value specified by most
+void packsplit(
+ int *index, /* (i) the value to split */
+ int *firstpart, /* (o) the value specified by most
significant bits */
- int *rest, /* (o) the value specified by least
+ int *rest, /* (o) the value specified by least
significant bits */
- int bitno_firstpart, /* (i) number of bits in most
+ int bitno_firstpart, /* (i) number of bits in most
significant part */
- int bitno_total /* (i) number of bits in full range
+ int bitno_total /* (i) number of bits in full range
of value */
- );
+);
- void packcombine(
- int *index, /* (i/o) the msb value in the
+void packcombine(
+ int *index, /* (i/o) the msb value in the
combined value out */
- int rest, /* (i) the lsb value */
- int bitno_rest /* (i) the number of bits in the
+ int rest, /* (i) the lsb value */
+ int bitno_rest /* (i) the number of bits in the
lsb part */
- );
+);
- void dopack(
- unsigned char **bitstream, /* (i/o) on entrance pointer to
+void dopack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
place in bitstream to pack
new data, on exit pointer
to place in bitstream to
pack future data */
- int index, /* (i) the value to pack */
- int bitno, /* (i) the number of bits that the
+ int index, /* (i) the value to pack */
+ int bitno, /* (i) the number of bits that the
value will fit within */
- int *pos /* (i/o) write position in the
+ int *pos /* (i/o) write position in the
current byte */
- );
+);
- void unpack(
- unsigned char **bitstream, /* (i/o) on entrance pointer to
+void unpack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
place in bitstream to
unpack new data from, on
exit pointer to place in
bitstream to unpack future
data from */
- int *index, /* (o) resulting value */
- int bitno, /* (i) number of bits used to
+ int *index, /* (o) resulting value */
+ int bitno, /* (i) number of bits used to
represent the value */
- int *pos /* (i/o) read position in the
+ int *pos /* (i/o) read position in the
current byte */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/ilbc/syntFilter.h b/thirdparties/android/common/include/ilbc/syntFilter.h
index 8865b89..af524cb 100755
--- a/thirdparties/android/common/include/ilbc/syntFilter.h
+++ b/thirdparties/android/common/include/ilbc/syntFilter.h
@@ -1,24 +1,24 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- syntFilter.h
+ syntFilter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_SYNTFILTER_H
- #define __iLBC_SYNTFILTER_H
+#ifndef __iLBC_SYNTFILTER_H
+#define __iLBC_SYNTFILTER_H
- void syntFilter(
- float *Out, /* (i/o) Signal to be filtered */
- float *a, /* (i) LP parameters */
- int len, /* (i) Length of signal */
- float *mem /* (i/o) Filter state */
- );
+void syntFilter(
+ float *Out, /* (i/o) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len, /* (i) Length of signal */
+ float *mem /* (i/o) Filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/android/common/include/libavcodec/avcodec.h b/thirdparties/android/common/include/libavcodec/avcodec.h
index c4db4d7..479a2a4 100755
--- a/thirdparties/android/common/include/libavcodec/avcodec.h
+++ b/thirdparties/android/common/include/libavcodec/avcodec.h
@@ -588,7 +588,7 @@ enum Motion_Est_ID {
/**
* @ingroup lavc_decoding
*/
-enum AVDiscard{
+enum AVDiscard {
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
AVDISCARD_NONE =-16, ///< discard nothing
@@ -599,7 +599,7 @@ enum AVDiscard{
AVDISCARD_ALL = 48, ///< discard all
};
-enum AVColorPrimaries{
+enum AVColorPrimaries {
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_BT470M = 4,
@@ -610,7 +610,7 @@ enum AVColorPrimaries{
AVCOL_PRI_NB , ///< Not part of ABI
};
-enum AVColorTransferCharacteristic{
+enum AVColorTransferCharacteristic {
AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361
AVCOL_TRC_UNSPECIFIED = 2,
AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@@ -619,7 +619,7 @@ enum AVColorTransferCharacteristic{
AVCOL_TRC_NB , ///< Not part of ABI
};
-enum AVColorSpace{
+enum AVColorSpace {
AVCOL_SPC_RGB = 0,
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVCOL_SPC_UNSPECIFIED = 2,
@@ -632,7 +632,7 @@ enum AVColorSpace{
};
#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
-enum AVColorRange{
+enum AVColorRange {
AVCOL_RANGE_UNSPECIFIED = 0,
AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
@@ -644,7 +644,7 @@ enum AVColorRange{
* 1 2 1-6 are possible chroma positions
* X X 5 6 X 0 is undefined/unknown position
*/
-enum AVChromaLocation{
+enum AVChromaLocation {
AVCHROMA_LOC_UNSPECIFIED = 0,
AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default
AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263
@@ -671,7 +671,7 @@ enum AVAudioServiceType {
/**
* @ingroup lavc_encoding
*/
-typedef struct RcOverride{
+typedef struct RcOverride {
int start_frame;
int end_frame;
int qscale; // If this is 0 then quality_factor will be used instead.
@@ -863,7 +863,7 @@ typedef struct RcOverride{
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
*/
-typedef struct AVPanScan{
+typedef struct AVPanScan {
/**
* id
* - encoding: Set by user.
@@ -885,7 +885,7 @@ typedef struct AVPanScan{
* - decoding: Set by libavcodec.
*/
int16_t position[3][2];
-}AVPanScan;
+} AVPanScan;
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
@@ -1929,7 +1929,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int prediction_method;
+ int prediction_method;
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
@@ -2699,11 +2699,11 @@ typedef struct AVCodecContext {
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
int rtp_payload_size; /* The size of the RTP payload: the coder will */
- /* do its best to deliver a chunk with size */
- /* below rtp_payload_size, the chunk will start */
- /* with a start code on some codecs like H.263. */
- /* This doesn't take account of any particular */
- /* headers inside the transmitted RTP payload. */
+ /* do its best to deliver a chunk with size */
+ /* below rtp_payload_size, the chunk will start */
+ /* with a start code on some codecs like H.263. */
+ /* This doesn't take account of any particular */
+ /* headers inside the transmitted RTP payload. */
/* statistics, used for 2-pass encoding */
int mv_bits;
@@ -2934,7 +2934,7 @@ typedef struct AVCodecContext {
* - encoding: Set by libavcodec.
* - decoding: Set by user.
*/
- int bits_per_coded_sample;
+ int bits_per_coded_sample;
/**
* Bits per sample/pixel of internal libavcodec pixel/sample format.
@@ -2948,7 +2948,7 @@ typedef struct AVCodecContext {
* - encoding: unused
* - decoding: Set by user.
*/
- int lowres;
+ int lowres;
/**
* the picture in the bitstream
@@ -3038,14 +3038,14 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int nsse_weight;
+ int nsse_weight;
/**
* profile
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int profile;
+ int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100
@@ -3115,7 +3115,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int level;
+ int level;
#define FF_LEVEL_UNKNOWN -99
/**
@@ -3992,8 +3992,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
* used or zero if no frame data was decompressed (used) from the input AVPacket.
*/
attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt);
+ int *frame_size_ptr,
+ AVPacket *avpkt);
#endif
/**
@@ -4074,8 +4074,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- const AVPacket *avpkt);
+ int *got_picture_ptr,
+ const AVPacket *avpkt);
/**
* Decode a subtitle message.
@@ -4094,8 +4094,8 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr,
+ AVPacket *avpkt);
/**
* @defgroup lavc_parsing Frame parsing
@@ -4353,8 +4353,8 @@ AVCodec *avcodec_find_encoder_by_name(const char *name);
* of bytes used to encode the data read from the input buffer.
*/
int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples);
+ uint8_t *buf, int buf_size,
+ const short *samples);
#endif
/**
@@ -4642,7 +4642,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
* Pad image.
*/
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
+ int padtop, int padbottom, int padleft, int padright, int *color);
/**
* @}
@@ -4745,7 +4745,7 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat
*/
attribute_deprecated
enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */
/**
@@ -4766,8 +4766,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelF
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
/**
* Find the best pixel format to convert to given a certain source pixel
@@ -4800,16 +4800,16 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
attribute_deprecated
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
#else
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
#endif
@@ -5033,10 +5033,10 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
* Lock operation used by lockmgr
*/
enum AVLockOp {
- AV_LOCK_CREATE, ///< Create a mutex
- AV_LOCK_OBTAIN, ///< Lock the mutex
- AV_LOCK_RELEASE, ///< Unlock the mutex
- AV_LOCK_DESTROY, ///< Free mutex resources
+ AV_LOCK_CREATE, ///< Create a mutex
+ AV_LOCK_OBTAIN, ///< Lock the mutex
+ AV_LOCK_RELEASE, ///< Unlock the mutex
+ AV_LOCK_DESTROY, ///< Free mutex resources
};
/**
diff --git a/thirdparties/android/common/include/libavcodec/old_codec_ids.h b/thirdparties/android/common/include/libavcodec/old_codec_ids.h
index ded4cc7..e0d3d7e 100755
--- a/thirdparties/android/common/include/libavcodec/old_codec_ids.h
+++ b/thirdparties/android/common/include/libavcodec/old_codec_ids.h
@@ -29,370 +29,370 @@
* Do not add new items to this list. Use the AVCodecID enum instead.
*/
- CODEC_ID_NONE = AV_CODEC_ID_NONE,
+CODEC_ID_NONE = AV_CODEC_ID_NONE,
- /* video codecs */
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
- CODEC_ID_MPEG2VIDEO_XVMC,
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_SNOW,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_DXA,
- CODEC_ID_DNXHD,
- CODEC_ID_THP,
- CODEC_ID_SGI,
- CODEC_ID_C93,
- CODEC_ID_BETHSOFTVID,
- CODEC_ID_PTX,
- CODEC_ID_TXD,
- CODEC_ID_VP6A,
- CODEC_ID_AMV,
- CODEC_ID_VB,
- CODEC_ID_PCX,
- CODEC_ID_SUNRAST,
- CODEC_ID_INDEO4,
- CODEC_ID_INDEO5,
- CODEC_ID_MIMIC,
- CODEC_ID_RL2,
- CODEC_ID_ESCAPE124,
- CODEC_ID_DIRAC,
- CODEC_ID_BFI,
- CODEC_ID_CMV,
- CODEC_ID_MOTIONPIXELS,
- CODEC_ID_TGV,
- CODEC_ID_TGQ,
- CODEC_ID_TQI,
- CODEC_ID_AURA,
- CODEC_ID_AURA2,
- CODEC_ID_V210X,
- CODEC_ID_TMV,
- CODEC_ID_V210,
- CODEC_ID_DPX,
- CODEC_ID_MAD,
- CODEC_ID_FRWU,
- CODEC_ID_FLASHSV2,
- CODEC_ID_CDGRAPHICS,
- CODEC_ID_R210,
- CODEC_ID_ANM,
- CODEC_ID_BINKVIDEO,
- CODEC_ID_IFF_ILBM,
- CODEC_ID_IFF_BYTERUN1,
- CODEC_ID_KGV1,
- CODEC_ID_YOP,
- CODEC_ID_VP8,
- CODEC_ID_PICTOR,
- CODEC_ID_ANSI,
- CODEC_ID_A64_MULTI,
- CODEC_ID_A64_MULTI5,
- CODEC_ID_R10K,
- CODEC_ID_MXPEG,
- CODEC_ID_LAGARITH,
- CODEC_ID_PRORES,
- CODEC_ID_JV,
- CODEC_ID_DFA,
- CODEC_ID_WMV3IMAGE,
- CODEC_ID_VC1IMAGE,
- CODEC_ID_UTVIDEO,
- CODEC_ID_BMV_VIDEO,
- CODEC_ID_VBLE,
- CODEC_ID_DXTORY,
- CODEC_ID_V410,
- CODEC_ID_XWD,
- CODEC_ID_CDXL,
- CODEC_ID_XBM,
- CODEC_ID_ZEROCODEC,
- CODEC_ID_MSS1,
- CODEC_ID_MSA1,
- CODEC_ID_TSCC2,
- CODEC_ID_MTS2,
- CODEC_ID_CLLC,
- CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
+/* video codecs */
+CODEC_ID_MPEG1VIDEO,
+CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+CODEC_ID_MPEG2VIDEO_XVMC,
+CODEC_ID_H261,
+CODEC_ID_H263,
+CODEC_ID_RV10,
+CODEC_ID_RV20,
+CODEC_ID_MJPEG,
+CODEC_ID_MJPEGB,
+CODEC_ID_LJPEG,
+CODEC_ID_SP5X,
+CODEC_ID_JPEGLS,
+CODEC_ID_MPEG4,
+CODEC_ID_RAWVIDEO,
+CODEC_ID_MSMPEG4V1,
+CODEC_ID_MSMPEG4V2,
+CODEC_ID_MSMPEG4V3,
+CODEC_ID_WMV1,
+CODEC_ID_WMV2,
+CODEC_ID_H263P,
+CODEC_ID_H263I,
+CODEC_ID_FLV1,
+CODEC_ID_SVQ1,
+CODEC_ID_SVQ3,
+CODEC_ID_DVVIDEO,
+CODEC_ID_HUFFYUV,
+CODEC_ID_CYUV,
+CODEC_ID_H264,
+CODEC_ID_INDEO3,
+CODEC_ID_VP3,
+CODEC_ID_THEORA,
+CODEC_ID_ASV1,
+CODEC_ID_ASV2,
+CODEC_ID_FFV1,
+CODEC_ID_4XM,
+CODEC_ID_VCR1,
+CODEC_ID_CLJR,
+CODEC_ID_MDEC,
+CODEC_ID_ROQ,
+CODEC_ID_INTERPLAY_VIDEO,
+CODEC_ID_XAN_WC3,
+CODEC_ID_XAN_WC4,
+CODEC_ID_RPZA,
+CODEC_ID_CINEPAK,
+CODEC_ID_WS_VQA,
+CODEC_ID_MSRLE,
+CODEC_ID_MSVIDEO1,
+CODEC_ID_IDCIN,
+CODEC_ID_8BPS,
+CODEC_ID_SMC,
+CODEC_ID_FLIC,
+CODEC_ID_TRUEMOTION1,
+CODEC_ID_VMDVIDEO,
+CODEC_ID_MSZH,
+CODEC_ID_ZLIB,
+CODEC_ID_QTRLE,
+CODEC_ID_SNOW,
+CODEC_ID_TSCC,
+CODEC_ID_ULTI,
+CODEC_ID_QDRAW,
+CODEC_ID_VIXL,
+CODEC_ID_QPEG,
+CODEC_ID_PNG,
+CODEC_ID_PPM,
+CODEC_ID_PBM,
+CODEC_ID_PGM,
+CODEC_ID_PGMYUV,
+CODEC_ID_PAM,
+CODEC_ID_FFVHUFF,
+CODEC_ID_RV30,
+CODEC_ID_RV40,
+CODEC_ID_VC1,
+CODEC_ID_WMV3,
+CODEC_ID_LOCO,
+CODEC_ID_WNV1,
+CODEC_ID_AASC,
+CODEC_ID_INDEO2,
+CODEC_ID_FRAPS,
+CODEC_ID_TRUEMOTION2,
+CODEC_ID_BMP,
+CODEC_ID_CSCD,
+CODEC_ID_MMVIDEO,
+CODEC_ID_ZMBV,
+CODEC_ID_AVS,
+CODEC_ID_SMACKVIDEO,
+CODEC_ID_NUV,
+CODEC_ID_KMVC,
+CODEC_ID_FLASHSV,
+CODEC_ID_CAVS,
+CODEC_ID_JPEG2000,
+CODEC_ID_VMNC,
+CODEC_ID_VP5,
+CODEC_ID_VP6,
+CODEC_ID_VP6F,
+CODEC_ID_TARGA,
+CODEC_ID_DSICINVIDEO,
+CODEC_ID_TIERTEXSEQVIDEO,
+CODEC_ID_TIFF,
+CODEC_ID_GIF,
+CODEC_ID_DXA,
+CODEC_ID_DNXHD,
+CODEC_ID_THP,
+CODEC_ID_SGI,
+CODEC_ID_C93,
+CODEC_ID_BETHSOFTVID,
+CODEC_ID_PTX,
+CODEC_ID_TXD,
+CODEC_ID_VP6A,
+CODEC_ID_AMV,
+CODEC_ID_VB,
+CODEC_ID_PCX,
+CODEC_ID_SUNRAST,
+CODEC_ID_INDEO4,
+CODEC_ID_INDEO5,
+CODEC_ID_MIMIC,
+CODEC_ID_RL2,
+CODEC_ID_ESCAPE124,
+CODEC_ID_DIRAC,
+CODEC_ID_BFI,
+CODEC_ID_CMV,
+CODEC_ID_MOTIONPIXELS,
+CODEC_ID_TGV,
+CODEC_ID_TGQ,
+CODEC_ID_TQI,
+CODEC_ID_AURA,
+CODEC_ID_AURA2,
+CODEC_ID_V210X,
+CODEC_ID_TMV,
+CODEC_ID_V210,
+CODEC_ID_DPX,
+CODEC_ID_MAD,
+CODEC_ID_FRWU,
+CODEC_ID_FLASHSV2,
+CODEC_ID_CDGRAPHICS,
+CODEC_ID_R210,
+CODEC_ID_ANM,
+CODEC_ID_BINKVIDEO,
+CODEC_ID_IFF_ILBM,
+CODEC_ID_IFF_BYTERUN1,
+CODEC_ID_KGV1,
+CODEC_ID_YOP,
+CODEC_ID_VP8,
+CODEC_ID_PICTOR,
+CODEC_ID_ANSI,
+CODEC_ID_A64_MULTI,
+CODEC_ID_A64_MULTI5,
+CODEC_ID_R10K,
+CODEC_ID_MXPEG,
+CODEC_ID_LAGARITH,
+CODEC_ID_PRORES,
+CODEC_ID_JV,
+CODEC_ID_DFA,
+CODEC_ID_WMV3IMAGE,
+CODEC_ID_VC1IMAGE,
+CODEC_ID_UTVIDEO,
+CODEC_ID_BMV_VIDEO,
+CODEC_ID_VBLE,
+CODEC_ID_DXTORY,
+CODEC_ID_V410,
+CODEC_ID_XWD,
+CODEC_ID_CDXL,
+CODEC_ID_XBM,
+CODEC_ID_ZEROCODEC,
+CODEC_ID_MSS1,
+CODEC_ID_MSA1,
+CODEC_ID_TSCC2,
+CODEC_ID_MTS2,
+CODEC_ID_CLLC,
+CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
+CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
+CODEC_ID_EXR = MKBETAG('0','E','X','R'),
+CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
- CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
+CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
+CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
+CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
+CODEC_ID_V308 = MKBETAG('V','3','0','8'),
+CODEC_ID_V408 = MKBETAG('V','4','0','8'),
+CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
+CODEC_ID_SANM = MKBETAG('S','A','N','M'),
+CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- /* various PCM "codecs" */
- CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
- CODEC_ID_PCM_S16LE = 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
- CODEC_ID_PCM_ZORK,
- CODEC_ID_PCM_S16LE_PLANAR,
- CODEC_ID_PCM_DVD,
- CODEC_ID_PCM_F32BE,
- CODEC_ID_PCM_F32LE,
- CODEC_ID_PCM_F64BE,
- CODEC_ID_PCM_F64LE,
- CODEC_ID_PCM_BLURAY,
- CODEC_ID_PCM_LXF,
- CODEC_ID_S302M,
- CODEC_ID_PCM_S8_PLANAR,
+/* various PCM "codecs" */
+CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
+CODEC_ID_PCM_S16LE = 0x10000,
+CODEC_ID_PCM_S16BE,
+CODEC_ID_PCM_U16LE,
+CODEC_ID_PCM_U16BE,
+CODEC_ID_PCM_S8,
+CODEC_ID_PCM_U8,
+CODEC_ID_PCM_MULAW,
+CODEC_ID_PCM_ALAW,
+CODEC_ID_PCM_S32LE,
+CODEC_ID_PCM_S32BE,
+CODEC_ID_PCM_U32LE,
+CODEC_ID_PCM_U32BE,
+CODEC_ID_PCM_S24LE,
+CODEC_ID_PCM_S24BE,
+CODEC_ID_PCM_U24LE,
+CODEC_ID_PCM_U24BE,
+CODEC_ID_PCM_S24DAUD,
+CODEC_ID_PCM_ZORK,
+CODEC_ID_PCM_S16LE_PLANAR,
+CODEC_ID_PCM_DVD,
+CODEC_ID_PCM_F32BE,
+CODEC_ID_PCM_F32LE,
+CODEC_ID_PCM_F64BE,
+CODEC_ID_PCM_F64LE,
+CODEC_ID_PCM_BLURAY,
+CODEC_ID_PCM_LXF,
+CODEC_ID_S302M,
+CODEC_ID_PCM_S8_PLANAR,
- /* various ADPCM codecs */
- CODEC_ID_ADPCM_IMA_QT = 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
- CODEC_ID_ADPCM_THP,
- CODEC_ID_ADPCM_IMA_AMV,
- CODEC_ID_ADPCM_EA_R1,
- CODEC_ID_ADPCM_EA_R3,
- CODEC_ID_ADPCM_EA_R2,
- CODEC_ID_ADPCM_IMA_EA_SEAD,
- CODEC_ID_ADPCM_IMA_EA_EACS,
- CODEC_ID_ADPCM_EA_XAS,
- CODEC_ID_ADPCM_EA_MAXIS_XA,
- CODEC_ID_ADPCM_IMA_ISS,
- CODEC_ID_ADPCM_G722,
- CODEC_ID_ADPCM_IMA_APC,
- CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+/* various ADPCM codecs */
+CODEC_ID_ADPCM_IMA_QT = 0x11000,
+CODEC_ID_ADPCM_IMA_WAV,
+CODEC_ID_ADPCM_IMA_DK3,
+CODEC_ID_ADPCM_IMA_DK4,
+CODEC_ID_ADPCM_IMA_WS,
+CODEC_ID_ADPCM_IMA_SMJPEG,
+CODEC_ID_ADPCM_MS,
+CODEC_ID_ADPCM_4XM,
+CODEC_ID_ADPCM_XA,
+CODEC_ID_ADPCM_ADX,
+CODEC_ID_ADPCM_EA,
+CODEC_ID_ADPCM_G726,
+CODEC_ID_ADPCM_CT,
+CODEC_ID_ADPCM_SWF,
+CODEC_ID_ADPCM_YAMAHA,
+CODEC_ID_ADPCM_SBPRO_4,
+CODEC_ID_ADPCM_SBPRO_3,
+CODEC_ID_ADPCM_SBPRO_2,
+CODEC_ID_ADPCM_THP,
+CODEC_ID_ADPCM_IMA_AMV,
+CODEC_ID_ADPCM_EA_R1,
+CODEC_ID_ADPCM_EA_R3,
+CODEC_ID_ADPCM_EA_R2,
+CODEC_ID_ADPCM_IMA_EA_SEAD,
+CODEC_ID_ADPCM_IMA_EA_EACS,
+CODEC_ID_ADPCM_EA_XAS,
+CODEC_ID_ADPCM_EA_MAXIS_XA,
+CODEC_ID_ADPCM_IMA_ISS,
+CODEC_ID_ADPCM_G722,
+CODEC_ID_ADPCM_IMA_APC,
+CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
- /* AMR */
- CODEC_ID_AMR_NB = 0x12000,
- CODEC_ID_AMR_WB,
+/* AMR */
+CODEC_ID_AMR_NB = 0x12000,
+CODEC_ID_AMR_WB,
- /* RealAudio codecs*/
- CODEC_ID_RA_144 = 0x13000,
- CODEC_ID_RA_288,
+/* RealAudio codecs*/
+CODEC_ID_RA_144 = 0x13000,
+CODEC_ID_RA_288,
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM = 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
+/* various DPCM codecs */
+CODEC_ID_ROQ_DPCM = 0x14000,
+CODEC_ID_INTERPLAY_DPCM,
+CODEC_ID_XAN_DPCM,
+CODEC_ID_SOL_DPCM,
- /* audio codecs */
- CODEC_ID_MP2 = 0x15000,
- CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
- CODEC_ID_AAC,
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM, ///< as in Berlin toast format
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
- CODEC_ID_MLP,
- CODEC_ID_GSM_MS, /* as found in WAV */
- CODEC_ID_ATRAC3,
- CODEC_ID_VOXWARE,
- CODEC_ID_APE,
- CODEC_ID_NELLYMOSER,
- CODEC_ID_MUSEPACK8,
- CODEC_ID_SPEEX,
- CODEC_ID_WMAVOICE,
- CODEC_ID_WMAPRO,
- CODEC_ID_WMALOSSLESS,
- CODEC_ID_ATRAC3P,
- CODEC_ID_EAC3,
- CODEC_ID_SIPR,
- CODEC_ID_MP1,
- CODEC_ID_TWINVQ,
- CODEC_ID_TRUEHD,
- CODEC_ID_MP4ALS,
- CODEC_ID_ATRAC1,
- CODEC_ID_BINKAUDIO_RDFT,
- CODEC_ID_BINKAUDIO_DCT,
- CODEC_ID_AAC_LATM,
- CODEC_ID_QDMC,
- CODEC_ID_CELT,
- CODEC_ID_G723_1,
- CODEC_ID_G729,
- CODEC_ID_8SVX_EXP,
- CODEC_ID_8SVX_FIB,
- CODEC_ID_BMV_AUDIO,
- CODEC_ID_RALF,
- CODEC_ID_IAC,
- CODEC_ID_ILBC,
- CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
- CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
+/* audio codecs */
+CODEC_ID_MP2 = 0x15000,
+CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+CODEC_ID_AAC,
+CODEC_ID_AC3,
+CODEC_ID_DTS,
+CODEC_ID_VORBIS,
+CODEC_ID_DVAUDIO,
+CODEC_ID_WMAV1,
+CODEC_ID_WMAV2,
+CODEC_ID_MACE3,
+CODEC_ID_MACE6,
+CODEC_ID_VMDAUDIO,
+CODEC_ID_FLAC,
+CODEC_ID_MP3ADU,
+CODEC_ID_MP3ON4,
+CODEC_ID_SHORTEN,
+CODEC_ID_ALAC,
+CODEC_ID_WESTWOOD_SND1,
+CODEC_ID_GSM, ///< as in Berlin toast format
+CODEC_ID_QDM2,
+CODEC_ID_COOK,
+CODEC_ID_TRUESPEECH,
+CODEC_ID_TTA,
+CODEC_ID_SMACKAUDIO,
+CODEC_ID_QCELP,
+CODEC_ID_WAVPACK,
+CODEC_ID_DSICINAUDIO,
+CODEC_ID_IMC,
+CODEC_ID_MUSEPACK7,
+CODEC_ID_MLP,
+CODEC_ID_GSM_MS, /* as found in WAV */
+CODEC_ID_ATRAC3,
+CODEC_ID_VOXWARE,
+CODEC_ID_APE,
+CODEC_ID_NELLYMOSER,
+CODEC_ID_MUSEPACK8,
+CODEC_ID_SPEEX,
+CODEC_ID_WMAVOICE,
+CODEC_ID_WMAPRO,
+CODEC_ID_WMALOSSLESS,
+CODEC_ID_ATRAC3P,
+CODEC_ID_EAC3,
+CODEC_ID_SIPR,
+CODEC_ID_MP1,
+CODEC_ID_TWINVQ,
+CODEC_ID_TRUEHD,
+CODEC_ID_MP4ALS,
+CODEC_ID_ATRAC1,
+CODEC_ID_BINKAUDIO_RDFT,
+CODEC_ID_BINKAUDIO_DCT,
+CODEC_ID_AAC_LATM,
+CODEC_ID_QDMC,
+CODEC_ID_CELT,
+CODEC_ID_G723_1,
+CODEC_ID_G729,
+CODEC_ID_8SVX_EXP,
+CODEC_ID_8SVX_FIB,
+CODEC_ID_BMV_AUDIO,
+CODEC_ID_RALF,
+CODEC_ID_IAC,
+CODEC_ID_ILBC,
+CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
+CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
+CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
+CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
+CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
+CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
- /* subtitle codecs */
- CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
- CODEC_ID_DVD_SUBTITLE = 0x17000,
- CODEC_ID_DVB_SUBTITLE,
- CODEC_ID_TEXT, ///< raw UTF-8 text
- CODEC_ID_XSUB,
- CODEC_ID_SSA,
- CODEC_ID_MOV_TEXT,
- CODEC_ID_HDMV_PGS_SUBTITLE,
- CODEC_ID_DVB_TELETEXT,
- CODEC_ID_SRT,
- CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
+/* subtitle codecs */
+CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
+CODEC_ID_DVD_SUBTITLE = 0x17000,
+CODEC_ID_DVB_SUBTITLE,
+CODEC_ID_TEXT, ///< raw UTF-8 text
+CODEC_ID_XSUB,
+CODEC_ID_SSA,
+CODEC_ID_MOV_TEXT,
+CODEC_ID_HDMV_PGS_SUBTITLE,
+CODEC_ID_DVB_TELETEXT,
+CODEC_ID_SRT,
+CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
+CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
+CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
+CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
+CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
+CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
- /* other specific kind of codecs (generally used for attachments) */
- CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
- CODEC_ID_TTF = 0x18000,
- CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
+/* other specific kind of codecs (generally used for attachments) */
+CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
+CODEC_ID_TTF = 0x18000,
+CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
+CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
+CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
+CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
- CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
- CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
- CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+ CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
- CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
+ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/thirdparties/android/common/include/libavcodec/vdpau.h b/thirdparties/android/common/include/libavcodec/vdpau.h
index df2aace..fe1d3b7 100755
--- a/thirdparties/android/common/include/libavcodec/vdpau.h
+++ b/thirdparties/android/common/include/libavcodec/vdpau.h
@@ -104,12 +104,12 @@ typedef struct AVVDPAUContext {
*/
int bitstream_buffers_used;
- /**
- * Table of bitstream buffers.
- * The user is responsible for freeing this buffer using av_freep().
- *
- * Set by libavcodec.
- */
+ /**
+ * Table of bitstream buffers.
+ * The user is responsible for freeing this buffer using av_freep().
+ *
+ * Set by libavcodec.
+ */
VdpBitstreamBuffer *bitstream_buffers;
} AVVDPAUContext;
diff --git a/thirdparties/android/common/include/libavcodec/xvmc.h b/thirdparties/android/common/include/libavcodec/xvmc.h
index b2bf518..373d9aa 100755
--- a/thirdparties/android/common/include/libavcodec/xvmc.h
+++ b/thirdparties/android/common/include/libavcodec/xvmc.h
@@ -101,8 +101,8 @@ struct xvmc_pix_fmt {
*/
XvMCSurface* p_surface;
-/** Set by the decoder before calling ff_draw_horiz_band(),
- needed by the XvMCRenderSurface function. */
+ /** Set by the decoder before calling ff_draw_horiz_band(),
+ needed by the XvMCRenderSurface function. */
//@{
/** Pointer to the surface used as past reference
- application - unchanged
diff --git a/thirdparties/android/common/include/libavfilter/avcodec.h b/thirdparties/android/common/include/libavfilter/avcodec.h
index 5f4209a..8dee966 100755
--- a/thirdparties/android/common/include/libavfilter/avcodec.h
+++ b/thirdparties/android/common/include/libavfilter/avcodec.h
@@ -63,7 +63,7 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms);
+ int perms);
/**
* Create and return a buffer reference from the data and properties
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms);
+ const AVFrame *frame,
+ int perms);
#ifdef FF_API_FILL_FRAME
/**
@@ -87,7 +87,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
*/
attribute_deprecated
int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *samplesref);
+ const AVFilterBufferRef *samplesref);
/**
* Fill an AVFrame with the information stored in picref.
@@ -100,7 +100,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
*/
attribute_deprecated
int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *picref);
+ const AVFilterBufferRef *picref);
/**
* Fill an AVFrame with information stored in ref.
diff --git a/thirdparties/android/common/include/libavfilter/avfilter.h b/thirdparties/android/common/include/libavfilter/avfilter.h
index 1c80167..69c028e 100755
--- a/thirdparties/android/common/include/libavfilter/avfilter.h
+++ b/thirdparties/android/common/include/libavfilter/avfilter.h
@@ -714,7 +714,7 @@ int avfilter_config_links(AVFilterContext *filter);
*/
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum AVPixelFormat format);
+ int w, int h, enum AVPixelFormat format);
/**
* Create an audio buffer reference wrapped around an already
@@ -731,11 +731,11 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin
* @param channel_layout the channel layout of the buffer
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ uint64_t channel_layout);
/**
* Create an audio buffer reference wrapped around an already
* allocated samples buffer.
@@ -750,12 +750,12 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
* must be either 0 or consistent with channels
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- int channels,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ int channels,
+ uint64_t channel_layout);
diff --git a/thirdparties/android/common/include/libavformat/avformat.h b/thirdparties/android/common/include/libavformat/avformat.h
index d23d0e8..575b088 100755
--- a/thirdparties/android/common/include/libavformat/avformat.h
+++ b/thirdparties/android/common/include/libavformat/avformat.h
@@ -367,9 +367,9 @@ typedef struct AVProbeData {
#else
#define AVFMT_TS_NONSTRICT 0x20000
#endif
- /**< Format does not require strictly
- increasing timestamps, but they must
- still be monotonic */
+/**< Format does not require strictly
+ increasing timestamps, but they must
+ still be monotonic */
#define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */
@@ -1378,7 +1378,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
#if FF_API_PKT_DUMP
attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
- int dump_payload);
+ int dump_payload);
#endif
#if FF_API_ALLOC_OUTPUT_CONTEXT
@@ -1387,8 +1387,8 @@ attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
*/
attribute_deprecated
AVFormatContext *avformat_alloc_output_context(const char *format,
- AVOutputFormat *oformat,
- const char *filename);
+ AVOutputFormat *oformat,
+ const char *filename);
#endif
/**
@@ -1835,8 +1835,8 @@ AVOutputFormat *av_guess_format(const char *short_name,
* Guess the codec ID based upon muxer and filename.
*/
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
- const char *filename, const char *mime_type,
- enum AVMediaType type);
+ const char *filename, const char *mime_type,
+ enum AVMediaType type);
/**
* Get timing information for the data currently output.
diff --git a/thirdparties/android/common/include/libavformat/avio.h b/thirdparties/android/common/include/libavformat/avio.h
index 17b341d..4623814 100755
--- a/thirdparties/android/common/include/libavformat/avio.h
+++ b/thirdparties/android/common/include/libavformat/avio.h
@@ -120,26 +120,26 @@ typedef struct AVIOContext {
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t maxsize;
+ int64_t maxsize;
- /**
- * avio_read and avio_write should if possible be satisfied directly
- * instead of going through a buffer, and avio_seek will always
- * call the underlying seek function directly.
- */
- int direct;
+ /**
+ * avio_read and avio_write should if possible be satisfied directly
+ * instead of going through a buffer, and avio_seek will always
+ * call the underlying seek function directly.
+ */
+ int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t bytes_read;
+ int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int seek_count;
+ int seek_count;
} AVIOContext;
/* unbuffered I/O */
@@ -177,13 +177,13 @@ int avio_check(const char *url, int flags);
* @return Allocated AVIOContext or NULL on failure.
*/
AVIOContext *avio_alloc_context(
- unsigned char *buffer,
- int buffer_size,
- int write_flag,
- void *opaque,
- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
- int64_t (*seek)(void *opaque, int64_t offset, int whence));
+ unsigned char *buffer,
+ int buffer_size,
+ int write_flag,
+ void *opaque,
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int64_t (*seek)(void *opaque, int64_t offset, int whence));
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
diff --git a/thirdparties/android/common/include/libavutil/avstring.h b/thirdparties/android/common/include/libavutil/avstring.h
index 5b078f1..00ecca7 100755
--- a/thirdparties/android/common/include/libavutil/avstring.h
+++ b/thirdparties/android/common/include/libavutil/avstring.h
@@ -214,8 +214,9 @@ static inline int av_isspace(int c)
*/
static inline int av_toupper(int c)
{
- if (c >= 'a' && c <= 'z')
+ if (c >= 'a' && c <= 'z') {
c ^= 0x20;
+ }
return c;
}
@@ -224,8 +225,9 @@ static inline int av_toupper(int c)
*/
static inline int av_tolower(int c)
{
- if (c >= 'A' && c <= 'Z')
+ if (c >= 'A' && c <= 'Z') {
c ^= 0x20;
+ }
return c;
}
diff --git a/thirdparties/android/common/include/libavutil/base64.h b/thirdparties/android/common/include/libavutil/base64.h
index 514498e..0f2be64 100755
--- a/thirdparties/android/common/include/libavutil/base64.h
+++ b/thirdparties/android/common/include/libavutil/base64.h
@@ -60,8 +60,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
- /**
- * @}
- */
+/**
+ * @}
+ */
#endif /* AVUTIL_BASE64_H */
diff --git a/thirdparties/android/common/include/libavutil/bprint.h b/thirdparties/android/common/include/libavutil/bprint.h
index df78916..6dafdc7 100755
--- a/thirdparties/android/common/include/libavutil/bprint.h
+++ b/thirdparties/android/common/include/libavutil/bprint.h
@@ -74,12 +74,12 @@
*/
typedef struct AVBPrint {
FF_PAD_STRUCTURE(1024,
- char *str; /** string so far */
- unsigned len; /** length so far */
- unsigned size; /** allocated memory */
- unsigned size_max; /** maximum allocated memory */
- char reserved_internal_buffer[1];
- )
+ char *str; /** string so far */
+ unsigned len; /** length so far */
+ unsigned size; /** allocated memory */
+ unsigned size_max; /** maximum allocated memory */
+ char reserved_internal_buffer[1];
+ )
} AVBPrint;
/**
diff --git a/thirdparties/android/common/include/libavutil/common.h b/thirdparties/android/common/include/libavutil/common.h
index beaf9f7..ede062e 100755
--- a/thirdparties/android/common/include/libavutil/common.h
+++ b/thirdparties/android/common/include/libavutil/common.h
@@ -97,11 +97,19 @@ av_const int av_log2_16bit(unsigned v);
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -114,11 +122,19 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -128,8 +144,12 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in
*/
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
- if (a&(~0xFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -139,8 +159,12 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
*/
static av_always_inline av_const int8_t av_clip_int8_c(int a)
{
- if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
- else return a;
+ if ((a+0x80) & ~0xFF) {
+ return (a>>31) ^ 0x7F;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -150,8 +174,12 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
- if (a&(~0xFFFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFFFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -161,8 +189,12 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
*/
static av_always_inline av_const int16_t av_clip_int16_c(int a)
{
- if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
- else return a;
+ if ((a+0x8000) & ~0xFFFF) {
+ return (a>>31) ^ 0x7FFF;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -172,8 +204,12 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a)
*/
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
{
- if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
- else return (int32_t)a;
+ if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) {
+ return (a>>63) ^ 0x7FFFFFFF;
+ }
+ else {
+ return (int32_t)a;
+ }
}
/**
@@ -184,8 +220,12 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
- if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
- else return a;
+ if (a & ~((1<<p) - 1)) {
+ return -a >> 31 & ((1<<p) - 1);
+ }
+ else {
+ return a;
+ }
}
/**
@@ -222,11 +262,19 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/** Compute ceil(log2(x)).
@@ -312,7 +360,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
val += (hi<<10) + 0x10000;\
}\
}\
-
+
/**
* @def PUT_UTF8(val, tmp, PUT_BYTE)
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
@@ -376,7 +424,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
PUT_16BIT\
}\
}\
-
+
#include "mem.h"
diff --git a/thirdparties/android/common/include/libavutil/cpu.h b/thirdparties/android/common/include/libavutil/cpu.h
index c8f34e0..7cb1a50 100755
--- a/thirdparties/android/common/include/libavutil/cpu.h
+++ b/thirdparties/android/common/include/libavutil/cpu.h
@@ -25,7 +25,7 @@
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
- /* lower 16 bits - CPU features */
+/* lower 16 bits - CPU features */
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
diff --git a/thirdparties/android/common/include/libavutil/crc.h b/thirdparties/android/common/include/libavutil/crc.h
index 2bdfca8..63e7605 100755
--- a/thirdparties/android/common/include/libavutil/crc.h
+++ b/thirdparties/android/common/include/libavutil/crc.h
@@ -34,7 +34,7 @@ typedef enum {
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
+} AVCRCId;
/**
* Initialize a CRC table.
diff --git a/thirdparties/android/common/include/libavutil/fifo.h b/thirdparties/android/common/include/libavutil/fifo.h
index 849b9a6..f56149b 100755
--- a/thirdparties/android/common/include/libavutil/fifo.h
+++ b/thirdparties/android/common/include/libavutil/fifo.h
@@ -134,10 +134,12 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
{
uint8_t *ptr = f->rptr + offs;
- if (ptr >= f->end)
+ if (ptr >= f->end) {
ptr = f->buffer + (ptr - f->end);
- else if (ptr < f->buffer)
+ }
+ else if (ptr < f->buffer) {
ptr = f->end - (f->buffer - ptr);
+ }
return ptr;
}
diff --git a/thirdparties/android/common/include/libavutil/intreadwrite.h b/thirdparties/android/common/include/libavutil/intreadwrite.h
index 7ee6977..1d6db92 100755
--- a/thirdparties/android/common/include/libavutil/intreadwrite.h
+++ b/thirdparties/android/common/include/libavutil/intreadwrite.h
@@ -209,9 +209,15 @@ typedef union {
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+union unaligned_64 {
+ uint64_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_32 {
+ uint32_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_16 {
+ uint16_t l;
+} __attribute__((packed)) av_alias;
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
diff --git a/thirdparties/android/common/include/libavutil/lfg.h b/thirdparties/android/common/include/libavutil/lfg.h
index ec90562..301d6da 100755
--- a/thirdparties/android/common/include/libavutil/lfg.h
+++ b/thirdparties/android/common/include/libavutil/lfg.h
@@ -35,7 +35,8 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
* Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case.
*/
-static inline unsigned int av_lfg_get(AVLFG *c){
+static inline unsigned int av_lfg_get(AVLFG *c)
+{
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
return c->state[c->index++ & 63];
}
@@ -45,7 +46,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){
*
* Please also consider av_lfg_get() above, it is faster.
*/
-static inline unsigned int av_mlfg_get(AVLFG *c){
+static inline unsigned int av_mlfg_get(AVLFG *c)
+{
unsigned int a= c->state[(c->index-55) & 63];
unsigned int b= c->state[(c->index-24) & 63];
return c->state[c->index++ & 63] = 2*a*b+a+b;
diff --git a/thirdparties/android/common/include/libavutil/log.h b/thirdparties/android/common/include/libavutil/log.h
index 7ea95fa..5dc45c1 100755
--- a/thirdparties/android/common/include/libavutil/log.h
+++ b/thirdparties/android/common/include/libavutil/log.h
@@ -38,7 +38,7 @@ typedef enum {
AV_CLASS_CATEGORY_SWSCALER,
AV_CLASS_CATEGORY_SWRESAMPLER,
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
-}AVClassCategory;
+} AVClassCategory;
struct AVOptionRanges;
diff --git a/thirdparties/android/common/include/libavutil/mem.h b/thirdparties/android/common/include/libavutil/mem.h
index ced9453..a7b3d9f 100755
--- a/thirdparties/android/common/include/libavutil/mem.h
+++ b/thirdparties/android/common/include/libavutil/mem.h
@@ -40,36 +40,36 @@
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
#elif defined(__TI_COMPILER_VERSION__)
- #define DECLARE_ALIGNED(n,t,v) \
+#define DECLARE_ALIGNED(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
t __attribute__((aligned(n))) v
- #define DECLARE_ASM_CONST(n,t,v) \
+#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
#elif defined(__GNUC__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
+#define DECLARE_ALIGNED(n,t,v) t v
+#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
- #define av_malloc_attrib __attribute__((__malloc__))
+#define av_malloc_attrib __attribute__((__malloc__))
#else
- #define av_malloc_attrib
+#define av_malloc_attrib
#endif
#if AV_GCC_VERSION_AT_LEAST(4,3)
- #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
#else
- #define av_alloc_size(...)
+#define av_alloc_size(...)
#endif
/**
@@ -93,8 +93,9 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
*/
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_malloc(nmemb * size);
}
@@ -166,8 +167,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
*/
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_mallocz(nmemb * size);
}
@@ -206,8 +208,9 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r)
size_t t = a * b;
/* Hack inspired from glibc: only try the division if nelem and elsize
* are both greater than sqrt(SIZE_MAX). */
- if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
+ if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) {
return AVERROR(EINVAL);
+ }
*r = t;
return 0;
}
diff --git a/thirdparties/android/common/include/libavutil/old_pix_fmts.h b/thirdparties/android/common/include/libavutil/old_pix_fmts.h
index 57b6992..a804f03 100755
--- a/thirdparties/android/common/include/libavutil/old_pix_fmts.h
+++ b/thirdparties/android/common/include/libavutil/old_pix_fmts.h
@@ -28,144 +28,144 @@
*
* Do not add new items to this list. Use the AVPixelFormat enum instead.
*/
- PIX_FMT_NONE = AV_PIX_FMT_NONE,
- PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
- PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
- PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+PIX_FMT_NONE = AV_PIX_FMT_NONE,
+PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+PIX_FMT_GRAY8, ///< Y , 8bpp
+PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+PIX_FMT_XVMC_MPEG2_IDCT,
+PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
- PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
- PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
- PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
- PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
- PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
- PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
- PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
- PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
- PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
- PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
- PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
- PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
- PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
- PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
- PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
- PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
- PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
- PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
- PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
- PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
- PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
- PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
- PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
+PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
- //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
- //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
- //is better
- PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
+//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
+//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
+//is better
+PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
- PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
- PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
- PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
- PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
- PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
- PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
+PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
+PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
+PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
+PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
+PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
+PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
+PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
- PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
- PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
- PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
- PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
- PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
+PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
+PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
+PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
+PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
- PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
- PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
- PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
- PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
+PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
+PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
+PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
+PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
- PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/thirdparties/android/common/include/libavutil/opt.h b/thirdparties/android/common/include/libavutil/opt.h
index baf1b82..05f6f4b 100755
--- a/thirdparties/android/common/include/libavutil/opt.h
+++ b/thirdparties/android/common/include/libavutil/opt.h
@@ -217,7 +217,7 @@
* before the file is actually opened.
*/
-enum AVOptionType{
+enum AVOptionType {
AV_OPT_TYPE_FLAGS,
AV_OPT_TYPE_INT,
AV_OPT_TYPE_INT64,
diff --git a/thirdparties/android/common/include/libavutil/pixdesc.h b/thirdparties/android/common/include/libavutil/pixdesc.h
index ca0722e..4caa15b 100755
--- a/thirdparties/android/common/include/libavutil/pixdesc.h
+++ b/thirdparties/android/common/include/libavutil/pixdesc.h
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include "pixfmt.h"
-typedef struct AVComponentDescriptor{
+typedef struct AVComponentDescriptor {
uint16_t plane :2; ///< which of the 4 planes contains the component
/**
@@ -41,7 +41,7 @@ typedef struct AVComponentDescriptor{
uint16_t offset_plus1 :3;
uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
-}AVComponentDescriptor;
+} AVComponentDescriptor;
/**
* Descriptor that unambiguously describes how the bits of a pixel are
@@ -52,7 +52,7 @@ typedef struct AVComponentDescriptor{
* and all the YUV variants) AVPixFmtDescriptor just stores how values
* are stored not what these values represent.
*/
-typedef struct AVPixFmtDescriptor{
+typedef struct AVPixFmtDescriptor {
const char *name;
uint8_t nb_components; ///< The number of components each pixel has, (1-4)
@@ -84,7 +84,7 @@ typedef struct AVPixFmtDescriptor{
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
*/
AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
+} AVPixFmtDescriptor;
#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
diff --git a/thirdparties/android/common/include/libavutil/rational.h b/thirdparties/android/common/include/libavutil/rational.h
index 417e29e..84ce7a0 100755
--- a/thirdparties/android/common/include/libavutil/rational.h
+++ b/thirdparties/android/common/include/libavutil/rational.h
@@ -40,7 +40,7 @@
/**
* rational number numerator/denominator
*/
-typedef struct AVRational{
+typedef struct AVRational {
int num; ///< numerator
int den; ///< denominator
} AVRational;
@@ -52,13 +52,22 @@ typedef struct AVRational{
* @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
* values is of the form 0/0
*/
-static inline int av_cmp_q(AVRational a, AVRational b){
+static inline int av_cmp_q(AVRational a, AVRational b)
+{
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
- if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
- else if(b.den && a.den) return 0;
- else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
- else return INT_MIN;
+ if(tmp) {
+ return ((tmp ^ a.den ^ b.den)>>63)|1;
+ }
+ else if(b.den && a.den) {
+ return 0;
+ }
+ else if(a.num && b.num) {
+ return (a.num>>31) - (b.num>>31);
+ }
+ else {
+ return INT_MIN;
+ }
}
/**
@@ -66,7 +75,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){
* @param a rational to convert
* @return (double) a
*/
-static inline double av_q2d(AVRational a){
+static inline double av_q2d(AVRational a)
+{
return a.num / (double) a.den;
}
diff --git a/thirdparties/android/common/include/libavutil/timestamp.h b/thirdparties/android/common/include/libavutil/timestamp.h
index c7348d8..6b46998 100755
--- a/thirdparties/android/common/include/libavutil/timestamp.h
+++ b/thirdparties/android/common/include/libavutil/timestamp.h
@@ -38,8 +38,12 @@
*/
static inline char *av_ts_make_string(char *buf, int64_t ts)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ }
return buf;
}
@@ -60,8 +64,12 @@ static inline char *av_ts_make_string(char *buf, int64_t ts)
*/
static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ }
return buf;
}
diff --git a/thirdparties/android/common/include/libswresample/swresample.h b/thirdparties/android/common/include/libswresample/swresample.h
index 95e8a5a..d7e3027 100755
--- a/thirdparties/android/common/include/libswresample/swresample.h
+++ b/thirdparties/android/common/include/libswresample/swresample.h
@@ -214,7 +214,7 @@ void swr_free(struct SwrContext **s);
* @return number of samples output per channel, negative value on error
*/
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
- const uint8_t **in , int in_count);
+ const uint8_t **in , int in_count);
/**
* Convert the next timestamp from input to output
diff --git a/thirdparties/android/common/include/libyuv/libyuv/compare.h b/thirdparties/android/common/include/libyuv/libyuv/compare.h
index 5dfac7c..8463a4c 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/compare.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/compare.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/convert.h b/thirdparties/android/common/include/libyuv/libyuv/convert.h
index 1bd45c8..e447d64 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/convert.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/convert.h
@@ -18,7 +18,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/convert_argb.h b/thirdparties/android/common/include/libyuv/libyuv/convert_argb.h
index a18014c..eaa14bc 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/convert_argb.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/convert_argb.h
@@ -24,7 +24,8 @@
// TODO(fbarchard): Some of these functions lack parameter setting.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/convert_from.h b/thirdparties/android/common/include/libyuv/libyuv/convert_from.h
index b1cf57f..a9c9cdb 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/convert_from.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/convert_from.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/convert_from_argb.h b/thirdparties/android/common/include/libyuv/libyuv/convert_from_argb.h
index f0343a7..680dd77 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/convert_from_argb.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/convert_from_argb.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/cpu_id.h b/thirdparties/android/common/include/libyuv/libyuv/cpu_id.h
index dc858a8..d36213c 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/cpu_id.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/cpu_id.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -55,9 +56,10 @@ int ArmCpuCaps(const char* cpuinfo_name);
// Detect CPU has SSE2 etc.
// Test_flag parameter should be one of kCpuHas constants above.
// returns non-zero if instruction set is detected
-static __inline int TestCpuFlag(int test_flag) {
- LIBYUV_API extern int cpu_info_;
- return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag;
+static __inline int TestCpuFlag(int test_flag)
+{
+ LIBYUV_API extern int cpu_info_;
+ return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag;
}
// For testing, allow CPU flags to be disabled.
diff --git a/thirdparties/android/common/include/libyuv/libyuv/format_conversion.h b/thirdparties/android/common/include/libyuv/libyuv/format_conversion.h
index b18bf05..8cf6e4b 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/format_conversion.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/format_conversion.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/mjpeg_decoder.h b/thirdparties/android/common/include/libyuv/libyuv/mjpeg_decoder.h
index faffaea..6567f8f 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/mjpeg_decoder.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/mjpeg_decoder.h
@@ -20,7 +20,8 @@ struct jpeg_common_struct;
struct jpeg_decompress_struct;
struct jpeg_source_mgr;
-namespace libyuv {
+namespace libyuv
+{
#ifdef __cplusplus
extern "C" {
@@ -35,12 +36,12 @@ LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size);
static const uint32 kUnknownDataSize = 0xFFFFFFFF;
enum JpegSubsamplingType {
- kJpegYuv420,
- kJpegYuv422,
- kJpegYuv411,
- kJpegYuv444,
- kJpegYuv400,
- kJpegUnknown
+ kJpegYuv420,
+ kJpegYuv422,
+ kJpegYuv411,
+ kJpegYuv444,
+ kJpegYuv400,
+ kJpegUnknown
};
struct SetJmpErrorMgr;
@@ -52,147 +53,148 @@ struct SetJmpErrorMgr;
// MJPEG frames.
//
// See http://tools.ietf.org/html/rfc2435
-class LIBYUV_API MJpegDecoder {
- public:
- typedef void (*CallbackFunction)(void* opaque,
- const uint8* const* data,
- const int* strides,
- int rows);
-
- static const int kColorSpaceUnknown;
- static const int kColorSpaceGrayscale;
- static const int kColorSpaceRgb;
- static const int kColorSpaceYCbCr;
- static const int kColorSpaceCMYK;
- static const int kColorSpaceYCCK;
-
- MJpegDecoder();
- ~MJpegDecoder();
-
- // Loads a new frame, reads its headers, and determines the uncompressed
- // image format.
- // Returns LIBYUV_TRUE if image looks valid and format is supported.
- // If return value is LIBYUV_TRUE, then the values for all the following
- // getters are populated.
- // src_len is the size of the compressed mjpeg frame in bytes.
- LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len);
+class LIBYUV_API MJpegDecoder
+{
+public:
+ typedef void (*CallbackFunction)(void* opaque,
+ const uint8* const* data,
+ const int* strides,
+ int rows);
+
+ static const int kColorSpaceUnknown;
+ static const int kColorSpaceGrayscale;
+ static const int kColorSpaceRgb;
+ static const int kColorSpaceYCbCr;
+ static const int kColorSpaceCMYK;
+ static const int kColorSpaceYCCK;
+
+ MJpegDecoder();
+ ~MJpegDecoder();
+
+ // Loads a new frame, reads its headers, and determines the uncompressed
+ // image format.
+ // Returns LIBYUV_TRUE if image looks valid and format is supported.
+ // If return value is LIBYUV_TRUE, then the values for all the following
+ // getters are populated.
+ // src_len is the size of the compressed mjpeg frame in bytes.
+ LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len);
- // Returns width of the last loaded frame in pixels.
- int GetWidth();
-
- // Returns height of the last loaded frame in pixels.
- int GetHeight();
+ // Returns width of the last loaded frame in pixels.
+ int GetWidth();
+
+ // Returns height of the last loaded frame in pixels.
+ int GetHeight();
+
+ // Returns format of the last loaded frame. The return value is one of the
+ // kColorSpace* constants.
+ int GetColorSpace();
+
+ // Number of color components in the color space.
+ int GetNumComponents();
+
+ // Sample factors of the n-th component.
+ int GetHorizSampFactor(int component);
+
+ int GetVertSampFactor(int component);
+
+ int GetHorizSubSampFactor(int component);
+
+ int GetVertSubSampFactor(int component);
+
+ // Public for testability.
+ int GetImageScanlinesPerImcuRow();
+
+ // Public for testability.
+ int GetComponentScanlinesPerImcuRow(int component);
+
+ // Width of a component in bytes.
+ int GetComponentWidth(int component);
+
+ // Height of a component.
+ int GetComponentHeight(int component);
+
+ // Width of a component in bytes with padding for DCTSIZE. Public for testing.
+ int GetComponentStride(int component);
+
+ // Size of a component in bytes.
+ int GetComponentSize(int component);
+
+ // Call this after LoadFrame() if you decide you don't want to decode it
+ // after all.
+ LIBYUV_BOOL UnloadFrame();
+
+ // Decodes the entire image into a one-buffer-per-color-component format.
+ // dst_width must match exactly. dst_height must be <= to image height; if
+ // less, the image is cropped. "planes" must have size equal to at least
+ // GetNumComponents() and they must point to non-overlapping buffers of size
+ // at least GetComponentSize(i). The pointers in planes are incremented
+ // to point to after the end of the written data.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
+
+ // Decodes the entire image and passes the data via repeated calls to a
+ // callback function. Each call will get the data for a whole number of
+ // image scanlines.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque,
+ int dst_width, int dst_height);
+
+ // The helper function which recognizes the jpeg sub-sampling type.
+ static JpegSubsamplingType JpegSubsamplingTypeHelper(
+ int* subsample_x, int* subsample_y, int number_of_components);
+
+private:
+ struct Buffer {
+ const uint8* data;
+ int len;
+ };
+
+ struct BufferVector {
+ Buffer* buffers;
+ int len;
+ int pos;
+ };
+
+ // Methods that are passed to jpeglib.
+ static int fill_input_buffer(jpeg_decompress_struct* cinfo);
+ static void init_source(jpeg_decompress_struct* cinfo);
+ static void skip_input_data(jpeg_decompress_struct* cinfo,
+ long num_bytes); // NOLINT
+ static void term_source(jpeg_decompress_struct* cinfo);
+
+ static void ErrorHandler(jpeg_common_struct* cinfo);
+
+ void AllocOutputBuffers(int num_outbufs);
+ void DestroyOutputBuffers();
- // Returns format of the last loaded frame. The return value is one of the
- // kColorSpace* constants.
- int GetColorSpace();
+ LIBYUV_BOOL StartDecode();
+ LIBYUV_BOOL FinishDecode();
- // Number of color components in the color space.
- int GetNumComponents();
-
- // Sample factors of the n-th component.
- int GetHorizSampFactor(int component);
-
- int GetVertSampFactor(int component);
-
- int GetHorizSubSampFactor(int component);
-
- int GetVertSubSampFactor(int component);
-
- // Public for testability.
- int GetImageScanlinesPerImcuRow();
-
- // Public for testability.
- int GetComponentScanlinesPerImcuRow(int component);
-
- // Width of a component in bytes.
- int GetComponentWidth(int component);
-
- // Height of a component.
- int GetComponentHeight(int component);
-
- // Width of a component in bytes with padding for DCTSIZE. Public for testing.
- int GetComponentStride(int component);
-
- // Size of a component in bytes.
- int GetComponentSize(int component);
-
- // Call this after LoadFrame() if you decide you don't want to decode it
- // after all.
- LIBYUV_BOOL UnloadFrame();
-
- // Decodes the entire image into a one-buffer-per-color-component format.
- // dst_width must match exactly. dst_height must be <= to image height; if
- // less, the image is cropped. "planes" must have size equal to at least
- // GetNumComponents() and they must point to non-overlapping buffers of size
- // at least GetComponentSize(i). The pointers in planes are incremented
- // to point to after the end of the written data.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
-
- // Decodes the entire image and passes the data via repeated calls to a
- // callback function. Each call will get the data for a whole number of
- // image scanlines.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque,
- int dst_width, int dst_height);
-
- // The helper function which recognizes the jpeg sub-sampling type.
- static JpegSubsamplingType JpegSubsamplingTypeHelper(
- int* subsample_x, int* subsample_y, int number_of_components);
-
- private:
- struct Buffer {
- const uint8* data;
- int len;
- };
-
- struct BufferVector {
- Buffer* buffers;
- int len;
- int pos;
- };
-
- // Methods that are passed to jpeglib.
- static int fill_input_buffer(jpeg_decompress_struct* cinfo);
- static void init_source(jpeg_decompress_struct* cinfo);
- static void skip_input_data(jpeg_decompress_struct* cinfo,
- long num_bytes); // NOLINT
- static void term_source(jpeg_decompress_struct* cinfo);
-
- static void ErrorHandler(jpeg_common_struct* cinfo);
-
- void AllocOutputBuffers(int num_outbufs);
- void DestroyOutputBuffers();
+ void SetScanlinePointers(uint8** data);
+ LIBYUV_BOOL DecodeImcuRow();
- LIBYUV_BOOL StartDecode();
- LIBYUV_BOOL FinishDecode();
+ int GetComponentScanlinePadding(int component);
- void SetScanlinePointers(uint8** data);
- LIBYUV_BOOL DecodeImcuRow();
+ // A buffer holding the input data for a frame.
+ Buffer buf_;
+ BufferVector buf_vec_;
- int GetComponentScanlinePadding(int component);
+ jpeg_decompress_struct* decompress_struct_;
+ jpeg_source_mgr* source_mgr_;
+ SetJmpErrorMgr* error_mgr_;
- // A buffer holding the input data for a frame.
- Buffer buf_;
- BufferVector buf_vec_;
+ // LIBYUV_TRUE iff at least one component has scanline padding. (i.e.,
+ // GetComponentScanlinePadding() != 0.)
+ LIBYUV_BOOL has_scanline_padding_;
- jpeg_decompress_struct* decompress_struct_;
- jpeg_source_mgr* source_mgr_;
- SetJmpErrorMgr* error_mgr_;
-
- // LIBYUV_TRUE iff at least one component has scanline padding. (i.e.,
- // GetComponentScanlinePadding() != 0.)
- LIBYUV_BOOL has_scanline_padding_;
-
- // Temporaries used to point to scanline outputs.
- int num_outbufs_; // Outermost size of all arrays below.
- uint8*** scanlines_;
- int* scanlines_sizes_;
- // Temporary buffer used for decoding when we can't decode directly to the
- // output buffers. Large enough for just one iMCU row.
- uint8** databuf_;
- int* databuf_strides_;
+ // Temporaries used to point to scanline outputs.
+ int num_outbufs_; // Outermost size of all arrays below.
+ uint8*** scanlines_;
+ int* scanlines_sizes_;
+ // Temporary buffer used for decoding when we can't decode directly to the
+ // output buffers. Large enough for just one iMCU row.
+ uint8** databuf_;
+ int* databuf_strides_;
};
} // namespace libyuv
diff --git a/thirdparties/android/common/include/libyuv/libyuv/planar_functions.h b/thirdparties/android/common/include/libyuv/libyuv/planar_functions.h
index ac516c5..8ff502c 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/planar_functions.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/planar_functions.h
@@ -18,7 +18,8 @@
#include "libyuv/convert_argb.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/rotate.h b/thirdparties/android/common/include/libyuv/libyuv/rotate.h
index 8af60b8..58bc1c2 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/rotate.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/rotate.h
@@ -14,22 +14,24 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported rotation.
typedef enum RotationMode {
- kRotate0 = 0, // No rotation.
- kRotate90 = 90, // Rotate 90 degrees clockwise.
- kRotate180 = 180, // Rotate 180 degrees.
- kRotate270 = 270, // Rotate 270 degrees clockwise.
-
- // Deprecated.
- kRotateNone = 0,
- kRotateClockwise = 90,
- kRotateCounterClockwise = 270,
-} RotationModeEnum;
+ kRotate0 = 0, // No rotation.
+ kRotate90 = 90, // Rotate 90 degrees clockwise.
+ kRotate180 = 180, // Rotate 180 degrees.
+ kRotate270 = 270, // Rotate 270 degrees clockwise.
+
+ // Deprecated.
+ kRotateNone = 0,
+ kRotateClockwise = 90,
+ kRotateCounterClockwise = 270,
+}
+RotationModeEnum;
// Rotate I420 frame.
LIBYUV_API
diff --git a/thirdparties/android/common/include/libyuv/libyuv/rotate_argb.h b/thirdparties/android/common/include/libyuv/libyuv/rotate_argb.h
index 660ff55..349707c 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/rotate_argb.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/rotate_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h" // For RotationMode.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/row.h b/thirdparties/android/common/include/libyuv/libyuv/row.h
index 757020d..503b3dc 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/row.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/row.h
@@ -16,7 +16,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -215,7 +216,7 @@ extern "C" {
// TODO(fbarchard): Port AVX2 to inline.
#if !defined(LIBYUV_DISABLE_X86) && defined(HAVE_YASM)
(defined(_M_IX86) || defined(_M_X64) || \
- defined(__x86_64__) || defined(__i386__))
+ defined(__x86_64__) || defined(__i386__))
#define HAS_MERGEUVROW_AVX2
#define HAS_MERGEUVROW_MMX
#define HAS_SPLITUVROW_AVX2
@@ -344,36 +345,36 @@ extern "C" {
#if defined(_MSC_VER) && !defined(__CLR_VER)
#define SIMD_ALIGNED(var) __declspec(align(16)) var
-typedef __declspec(align(16)) int16 vec16[8];
-typedef __declspec(align(16)) int32 vec32[4];
-typedef __declspec(align(16)) int8 vec8[16];
-typedef __declspec(align(16)) uint16 uvec16[8];
-typedef __declspec(align(16)) uint32 uvec32[4];
-typedef __declspec(align(16)) uint8 uvec8[16];
-typedef __declspec(align(32)) int16 lvec16[16];
-typedef __declspec(align(32)) int32 lvec32[8];
-typedef __declspec(align(32)) int8 lvec8[32];
-typedef __declspec(align(32)) uint16 ulvec16[16];
-typedef __declspec(align(32)) uint32 ulvec32[8];
-typedef __declspec(align(32)) uint8 ulvec8[32];
+ typedef __declspec(align(16)) int16 vec16[8];
+ typedef __declspec(align(16)) int32 vec32[4];
+ typedef __declspec(align(16)) int8 vec8[16];
+ typedef __declspec(align(16)) uint16 uvec16[8];
+ typedef __declspec(align(16)) uint32 uvec32[4];
+ typedef __declspec(align(16)) uint8 uvec8[16];
+ typedef __declspec(align(32)) int16 lvec16[16];
+ typedef __declspec(align(32)) int32 lvec32[8];
+ typedef __declspec(align(32)) int8 lvec8[32];
+ typedef __declspec(align(32)) uint16 ulvec16[16];
+ typedef __declspec(align(32)) uint32 ulvec32[8];
+ typedef __declspec(align(32)) uint8 ulvec8[32];
#elif defined(__GNUC__)
// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
#define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
-typedef int16 __attribute__((vector_size(16))) vec16;
-typedef int32 __attribute__((vector_size(16))) vec32;
-typedef int8 __attribute__((vector_size(16))) vec8;
-typedef uint16 __attribute__((vector_size(16))) uvec16;
-typedef uint32 __attribute__((vector_size(16))) uvec32;
-typedef uint8 __attribute__((vector_size(16))) uvec8;
+ typedef int16 __attribute__((vector_size(16))) vec16;
+ typedef int32 __attribute__((vector_size(16))) vec32;
+ typedef int8 __attribute__((vector_size(16))) vec8;
+ typedef uint16 __attribute__((vector_size(16))) uvec16;
+ typedef uint32 __attribute__((vector_size(16))) uvec32;
+ typedef uint8 __attribute__((vector_size(16))) uvec8;
#else
#define SIMD_ALIGNED(var) var
-typedef int16 vec16[8];
-typedef int32 vec32[4];
-typedef int8 vec8[16];
-typedef uint16 uvec16[8];
-typedef uint32 uvec32[4];
-typedef uint8 uvec8[16];
+ typedef int16 vec16[8];
+ typedef int32 vec32[4];
+ typedef int8 vec8[16];
+ typedef uint16 uvec16[8];
+ typedef uint32 uvec32[4];
+ typedef uint8 uvec8[16];
#endif
#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
@@ -444,1247 +445,1247 @@ typedef uint8 uvec8[16];
#opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n"
#endif
-void I444ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_bgra,
- int width);
-void I422ToABGRRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_abgr,
- int width);
-void I422ToRGBARow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgba,
- int width);
-void I422ToRGB24Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-void I422ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb565,
- int width);
-void I422ToARGB1555Row_NEON(const uint8* src_y,
+ void I444ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb1555,
+ uint8* dst_argb,
int width);
-void I422ToARGB4444Row_NEON(const uint8* src_y,
+ void I422ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb4444,
+ uint8* dst_argb,
+ int width);
+ void I411ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_bgra,
+ int width);
+ void I422ToABGRRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_abgr,
+ int width);
+ void I422ToRGBARow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToRGB24Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb24,
+ int width);
+ void I422ToRAWRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_raw,
+ int width);
+ void I422ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb565,
+ int width);
+ void I422ToARGB1555Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb1555,
+ int width);
+ void I422ToARGB4444Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb4444,
+ int width);
+ void NV12ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_rgb565,
+ int width);
+ void NV21ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_rgb565,
+ int width);
+ void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_NEON(const uint8* src_uyvy,
+ uint8* dst_argb,
int width);
-void NV12ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_rgb565,
- int width);
-void NV21ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_rgb565,
- int width);
-void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_NEON(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
-void ARGBToYRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_Unaligned_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_Unaligned_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_Unaligned_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_Unaligned_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
-void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int pix);
-void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24,
- uint8* dst_u, uint8* dst_v, int pix);
-void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444,
- uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
-void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix);
-void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
-void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
-
-void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_Unaligned_SSSE3(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_Unaligned_SSSE3(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_Unaligned_SSSE3(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
+ void ARGBToYRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_Unaligned_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_Unaligned_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_Unaligned_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_Unaligned_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
+ void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra,
+ void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra,
uint8* dst_u, uint8* dst_v, int pix);
-void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr,
+ void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr,
uint8* dst_u, uint8* dst_v, int pix);
-void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba,
+ void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba,
uint8* dst_u, uint8* dst_v, int pix);
-void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24,
+ void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24,
uint8* dst_u, uint8* dst_v, int pix);
-void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw,
+ void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw,
uint8* dst_u, uint8* dst_v, int pix);
-void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565,
+ void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
- int src_stride_argb1555,
+ void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
+ void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
+
+ void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_Unaligned_SSSE3(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_Unaligned_SSSE3(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGBAToUVRow_Unaligned_SSSE3(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
- int src_stride_argb4444,
+ void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24,
- uint8* dst_u, uint8* dst_v, int width);
-void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw,
- uint8* dst_u, uint8* dst_v, int width);
-void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555,
+ void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
+ int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
+ int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr,
uint8* dst_u, uint8* dst_v, int width);
-void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444,
+ void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba,
uint8* dst_u, uint8* dst_v, int width);
+ void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_Unaligned_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
+ void ARGBToUV444Row_SSSE3(const uint8* src_argb,
uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_Unaligned_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_Unaligned_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb,
+ void ARGBToUV422Row_SSSE3(const uint8* src_argb,
uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV422Row_Unaligned_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV411Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV422Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV411Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
-void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
-void MirrorRow_SSE2(const uint8* src, uint8* dst, int width);
-void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
-void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width);
-void MirrorRow_C(const uint8* src, uint8* dst, int width);
+ void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
+ void MirrorRow_SSE2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
+ void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_C(const uint8* src, uint8* dst, int width);
-void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int width);
-void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-
-void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
-
-void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Unaligned_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Unaligned_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u,
- uint8* dst_v, int pix);
-void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+
+ void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
+
+ void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int pix);
+ void SplitUVRow_Unaligned_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Unaligned_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u,
+ uint8* dst_v, int pix);
+ void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
-void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_Unaligned_SSE2(const uint8* src_u, const uint8* src_v,
- uint8* dst_uv, int width);
-void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
-void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
-void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
+ void MergeUVRow_Unaligned_SSE2(const uint8* src_u, const uint8* src_v,
+ uint8* dst_uv, int width);
+ void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
-void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
-void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
-void CopyRow_X86(const uint8* src, uint8* dst, int count);
-void CopyRow_NEON(const uint8* src, uint8* dst, int count);
-void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
-void CopyRow_C(const uint8* src, uint8* dst, int count);
-
-void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-
-void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
-void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
-void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
-
-void SetRow_X86(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_X86(uint8* dst, uint32 v32, int width,
- int dst_stride, int height);
-void SetRow_NEON(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width,
- int dst_stride, int height);
-void SetRow_C(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
- int height);
+ void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
+ void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
+ void CopyRow_X86(const uint8* src, uint8* dst, int count);
+ void CopyRow_NEON(const uint8* src, uint8* dst, int count);
+ void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
+ void CopyRow_C(const uint8* src, uint8* dst, int count);
+
+ void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+
+ void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
+ void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
+ void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
+
+ void SetRow_X86(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_X86(uint8* dst, uint32 v32, int width,
+ int dst_stride, int height);
+ void SetRow_NEON(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width,
+ int dst_stride, int height);
+ void SetRow_C(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
+ int height);
// ARGBShufflers for BGRAToARGB etc.
-void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-
-void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb,
- int pix);
-void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb,
- int pix);
-
-void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb,
- int pix);
-void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb,
- int pix);
-void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
-void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
-void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb,
- int pix);
-void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb,
+ void ARGBShuffleRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+
+ void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb,
int pix);
-void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb,
+ void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb,
int pix);
-void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb,
- int pix);
-void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb,
+
+ void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb,
int pix);
-void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb,
+ void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb,
int pix);
-
-void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_Unaligned_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix);
-
-void I444ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void NV12ToARGBRow_C(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToRGB565Row_C(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_C(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_C(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void YUY2ToARGBRow_C(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_C(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_bgra,
- int width);
-void I422ToABGRRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_abgr,
- int width);
-void I422ToRGBARow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgba,
- int width);
-void I422ToRGB24Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-void I422ToARGB4444Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb4444,
- int width);
-void I422ToARGB1555Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb4444,
- int width);
-void I422ToRGB565Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb565,
- int width);
-void YToARGBRow_C(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_AVX2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I444ToARGBRow_SSSE3(const uint8* src_y,
+ void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
+ void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
+ void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb,
+ int pix);
+ void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb,
+ int pix);
+ void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb,
+ int pix);
+ void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb,
+ int pix);
+ void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb,
+ int pix);
+ void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb,
+ int pix);
+
+ void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_Unaligned_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix);
+
+ void I444ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGBRow_SSSE3(const uint8* src_y,
+ void I422ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I411ToARGBRow_SSSE3(const uint8* src_y,
+ void I411ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void NV12ToARGBRow_SSSE3(const uint8* src_y,
+ void NV12ToARGBRow_C(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToARGBRow_SSSE3(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_SSSE3(const uint8* src_y,
- const uint8* src_uv,
+ void NV21ToRGB565Row_C(const uint8* src_y,
+ const uint8* src_vu,
uint8* dst_argb,
int width);
-void NV21ToRGB565Row_SSSE3(const uint8* src_y,
- const uint8* src_vu,
+ void NV12ToRGB565Row_C(const uint8* src_y,
+ const uint8* src_uv,
uint8* dst_argb,
int width);
-void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
+ void NV21ToARGBRow_C(const uint8* src_y,
+ const uint8* src_vu,
uint8* dst_argb,
int width);
-void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
+ void YUY2ToARGBRow_C(const uint8* src_yuy2,
uint8* dst_argb,
int width);
-void I422ToBGRARow_SSSE3(const uint8* src_y,
+ void UYVYToARGBRow_C(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_bgra,
int width);
-void I422ToABGRRow_SSSE3(const uint8* src_y,
+ void I422ToABGRRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_abgr,
int width);
-void I422ToRGBARow_SSSE3(const uint8* src_y,
+ void I422ToRGBARow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_rgba,
int width);
-void I422ToARGB4444Row_SSSE3(const uint8* src_y,
+ void I422ToRGB24Row_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb24,
+ int width);
+ void I422ToRAWRow_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_raw,
+ int width);
+ void I422ToARGB4444Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_argb4444,
int width);
-void I422ToARGB1555Row_SSSE3(const uint8* src_y,
+ void I422ToARGB1555Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_argb4444,
int width);
-void I422ToRGB565Row_SSSE3(const uint8* src_y,
+ void I422ToRGB565Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_rgb565,
int width);
-// RGB24/RAW are unaligned.
-void I422ToRGB24Row_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-
-void I444ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void NV12ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void YUY2ToARGBRow_Unaligned_SSSE3(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_Unaligned_SSSE3(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_bgra,
- int width);
-void I422ToABGRRow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_abgr,
- int width);
-void I422ToRGBARow_Unaligned_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgba,
- int width);
-void I422ToARGBRow_Any_AVX2(const uint8* src_y,
+ void YToARGBRow_C(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_AVX2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I444ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I422ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I411ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I411ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void NV12ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void NV21ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_vu,
uint8* dst_argb,
int width);
-void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void NV12ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void NV21ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_vu,
uint8* dst_argb,
int width);
-void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
+ void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
uint8* dst_argb,
int width);
-void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
+ void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
uint8* dst_argb,
int width);
-void I422ToBGRARow_Any_SSSE3(const uint8* src_y,
+ void I422ToBGRARow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_bgra,
int width);
-void I422ToABGRRow_Any_SSSE3(const uint8* src_y,
+ void I422ToABGRRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_abgr,
int width);
-void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
+ void I422ToRGBARow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_rgba,
int width);
-void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
+ void I422ToARGB4444Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
-void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
+ void I422ToARGB1555Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
-void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void I422ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
// RGB24/RAW are unaligned.
-void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
+ void I422ToRGB24Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_rgb24,
int width);
-void I422ToRAWRow_Any_SSSE3(const uint8* src_y,
+ void I422ToRAWRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_raw,
int width);
-void YToARGBRow_SSE2(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void YToARGBRow_NEON(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void YToARGBRow_Any_SSE2(const uint8* src_y,
+
+ void I444ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I411ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void NV12ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void YUY2ToARGBRow_Unaligned_SSSE3(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_Unaligned_SSSE3(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_bgra,
+ int width);
+ void I422ToABGRRow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_abgr,
+ int width);
+ void I422ToRGBARow_Unaligned_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToARGBRow_Any_AVX2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I411ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_bgra,
+ int width);
+ void I422ToABGRRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_abgr,
+ int width);
+ void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+// RGB24/RAW are unaligned.
+ void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRAWRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void YToARGBRow_SSE2(const uint8* src_y,
uint8* dst_argb,
int width);
-void YToARGBRow_Any_NEON(const uint8* src_y,
+ void YToARGBRow_NEON(const uint8* src_y,
uint8* dst_argb,
int width);
+ void YToARGBRow_Any_SSE2(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
+ void YToARGBRow_Any_NEON(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
// ARGB preattenuated alpha blend.
-void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
// ARGB multiply images. Same API as Blend, but these require
// pointer and width alignment for SSE2.
-void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
+ void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
// ARGB add images.
-void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
+ void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
// ARGB subtract images. Same API as Blend, but these require
// pointer and width alignment for SSE2.
-void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-
-void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void I444ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRGBARow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRGB24Row_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRAWRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
+ void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+
+ void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void I444ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
+ void I422ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void NV12ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-
-void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Unaligned_SSE2(const uint8* src_yuy2,
- uint8* dst_y, int pix);
-void YUY2ToUVRow_Unaligned_SSE2(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Unaligned_SSE2(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_C(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2,
+ void I411ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGBARow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGB24Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRAWRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void NV12ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+
+ void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
+ void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2,
+ void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
+ void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2,
+ void YUY2ToYRow_Unaligned_SSE2(const uint8* src_yuy2,
+ uint8* dst_y, int pix);
+ void YUY2ToUVRow_Unaligned_SSE2(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Unaligned_SSE2(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
+ void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Unaligned_SSE2(const uint8* src_uyvy,
- uint8* dst_y, int pix);
-void UYVYToUVRow_Unaligned_SSE2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Unaligned_SSE2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_NEON(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-
-void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_C(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_C(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
+ void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy,
+ void UYVYToYRow_Unaligned_SSE2(const uint8* src_uyvy,
+ uint8* dst_y, int pix);
+ void UYVYToUVRow_Unaligned_SSE2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Unaligned_SSE2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
+ void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy,
+ void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
+ void UYVYToUV422Row_NEON(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void HalfRow_C(const uint8* src_uv, int src_uv_stride,
- uint8* dst_uv, int pix);
-void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
- uint8* dst_uv, int pix);
-void HalfRow_AVX2(const uint8* src_uv, int src_uv_stride,
- uint8* dst_uv, int pix);
-void HalfRow_NEON(const uint8* src_uv, int src_uv_stride,
- uint8* dst_uv, int pix);
-
-void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer,
- uint32 selector, int pix);
-void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_C(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+
+ void HalfRow_C(const uint8* src_uv, int src_uv_stride,
+ uint8* dst_uv, int pix);
+ void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
+ uint8* dst_uv, int pix);
+ void HalfRow_AVX2(const uint8* src_uv, int src_uv_stride,
+ uint8* dst_uv, int pix);
+ void HalfRow_NEON(const uint8* src_uv, int src_uv_stride,
+ uint8* dst_uv, int pix);
+
+ void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer,
- uint32 selector, int pix);
-void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ uint32 selector, int pix);
+ void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ uint32 selector, int pix);
+ void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer,
uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer,
uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
-void I422ToYUY2Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_SSE2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_SSE2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
+ void I422ToYUY2Row_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_SSE2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_yuy2, int width);
-void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
+ void I422ToUYVYRow_SSE2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_uyvy, int width);
-void I422ToYUY2Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_Any_NEON(const uint8* src_y,
+ void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_yuy2, int width);
-void I422ToUYVYRow_Any_NEON(const uint8* src_y,
+ void I422ToUYVYRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
// Effects related row functions.
-void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
- int width);
+ void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ int width);
// Inverse table for unattenuate, shared by C and SSE2.
-extern const uint32 fixed_invtbl8[256];
-void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
- int width);
-
-void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
-
-void ARGBSepiaRow_C(uint8* dst_argb, int width);
-void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
-void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
-
-void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb,
- const int8* matrix_argb, int width);
-void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ extern const uint32 fixed_invtbl8[256];
+ void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+
+ void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
+
+ void ARGBSepiaRow_C(uint8* dst_argb, int width);
+ void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
+ void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
+
+ void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb,
const int8* matrix_argb, int width);
-void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb,
- const int8* matrix_argb, int width);
-
-void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
-void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
-
-void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
-void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
-
-void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-
-void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
-void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
-void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
+ void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ const int8* matrix_argb, int width);
+ void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb,
+ const int8* matrix_argb, int width);
+
+ void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
+ void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
+
+ void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
+ void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
+
+ void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+ void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+ void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+
+ void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
+ void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
+ void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
// Used for blur.
-void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft,
- int width, int area, uint8* dst, int count);
-void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum,
- const int32* previous_cumsum, int width);
-
-void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft,
- int width, int area, uint8* dst, int count);
-void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum,
- const int32* previous_cumsum, int width);
-
-LIBYUV_API
-void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
- uint8* dst_argb, const float* uv_dudv, int width);
-LIBYUV_API
-void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
- uint8* dst_argb, const float* uv_dudv, int width);
+ void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft,
+ int width, int area, uint8* dst, int count);
+ void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum,
+ const int32* previous_cumsum, int width);
+
+ void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft,
+ int width, int area, uint8* dst, int count);
+ void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum,
+ const int32* previous_cumsum, int width);
+
+ LIBYUV_API
+ void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
+ uint8* dst_argb, const float* uv_dudv, int width);
+ LIBYUV_API
+ void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
+ uint8* dst_argb, const float* uv_dudv, int width);
// Used for I420Scale, ARGBScale, and ARGBInterpolate.
-void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr,
- int width, int source_y_fraction);
-void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr,
+ int width, int source_y_fraction);
+ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
+ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
// Sobel images.
-void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2,
- uint8* dst_sobelx, int width);
-void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1,
- const uint8* src_y2, uint8* dst_sobelx, int width);
-void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1,
- const uint8* src_y2, uint8* dst_sobelx, int width);
-void SobelYRow_C(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-
-void ARGBPolynomialRow_C(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
-void ARGBPolynomialRow_SSE2(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
-void ARGBPolynomialRow_AVX2(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
+ void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2,
+ uint8* dst_sobelx, int width);
+ void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1,
+ const uint8* src_y2, uint8* dst_sobelx, int width);
+ void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1,
+ const uint8* src_y2, uint8* dst_sobelx, int width);
+ void SobelYRow_C(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+
+ void ARGBPolynomialRow_C(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
+ void ARGBPolynomialRow_SSE2(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
+ void ARGBPolynomialRow_AVX2(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
-void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width,
- const uint8* luma, uint32 lumacoeff);
-void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
- int width,
+ void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width,
const uint8* luma, uint32 lumacoeff);
+ void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ int width,
+ const uint8* luma, uint32 lumacoeff);
#ifdef __cplusplus
} // extern "C"
diff --git a/thirdparties/android/common/include/libyuv/libyuv/scale.h b/thirdparties/android/common/include/libyuv/libyuv/scale.h
index 592b8ed..1907d0d 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/scale.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/scale.h
@@ -14,17 +14,19 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported filtering.
typedef enum FilterMode {
- kFilterNone = 0, // Point sample; Fastest.
- kFilterLinear = 1, // Filter horizontally only.
- kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
- kFilterBox = 3 // Highest quality.
-} FilterModeEnum;
+ kFilterNone = 0, // Point sample; Fastest.
+ kFilterLinear = 1, // Filter horizontally only.
+ kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
+ kFilterBox = 3 // Highest quality.
+}
+FilterModeEnum;
// Scale a YUV plane.
LIBYUV_API
@@ -57,24 +59,24 @@ int I420Scale(const uint8* src_y, int src_stride_y,
#ifdef __cplusplus
// Legacy API. Deprecated.
-LIBYUV_API
-int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
- int src_stride_y, int src_stride_u, int src_stride_v,
- int src_width, int src_height,
- uint8* dst_y, uint8* dst_u, uint8* dst_v,
- int dst_stride_y, int dst_stride_u, int dst_stride_v,
- int dst_width, int dst_height,
- LIBYUV_BOOL interpolate);
+ LIBYUV_API
+ int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
+ int src_stride_y, int src_stride_u, int src_stride_v,
+ int src_width, int src_height,
+ uint8* dst_y, uint8* dst_u, uint8* dst_v,
+ int dst_stride_y, int dst_stride_u, int dst_stride_v,
+ int dst_width, int dst_height,
+ LIBYUV_BOOL interpolate);
// Legacy API. Deprecated.
-LIBYUV_API
-int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
- uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
- LIBYUV_BOOL interpolate);
+ LIBYUV_API
+ int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
+ uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
+ LIBYUV_BOOL interpolate);
// For testing, allow disabling of specialized scalers.
-LIBYUV_API
-void SetUseReferenceImpl(LIBYUV_BOOL use);
+ LIBYUV_API
+ void SetUseReferenceImpl(LIBYUV_BOOL use);
#endif // __cplusplus
#ifdef __cplusplus
diff --git a/thirdparties/android/common/include/libyuv/libyuv/scale_argb.h b/thirdparties/android/common/include/libyuv/libyuv/scale_argb.h
index 0c9b362..9058a78 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/scale_argb.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/scale_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/scale.h" // For FilterMode
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/scale_row.h b/thirdparties/android/common/include/libyuv/libyuv/scale_row.h
index 13eccc4..faaf672 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/scale_row.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/scale_row.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/android/common/include/libyuv/libyuv/video_common.h b/thirdparties/android/common/include/libyuv/libyuv/video_common.h
index 039efb9..b46666c 100755
--- a/thirdparties/android/common/include/libyuv/libyuv/video_common.h
+++ b/thirdparties/android/common/include/libyuv/libyuv/video_common.h
@@ -16,7 +16,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -48,131 +49,131 @@ extern "C" {
// Primary formats should convert in 1 efficient step.
// Secondary formats are converted in 2 steps.
// Auxilliary formats call primary converters.
-enum FourCC {
- // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
- FOURCC_I420 = FOURCC('I', '4', '2', '0'),
- FOURCC_I422 = FOURCC('I', '4', '2', '2'),
- FOURCC_I444 = FOURCC('I', '4', '4', '4'),
- FOURCC_I411 = FOURCC('I', '4', '1', '1'),
- FOURCC_I400 = FOURCC('I', '4', '0', '0'),
- FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
- FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
- FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
- FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
-
- // 2 Secondary YUV formats: row biplanar.
- FOURCC_M420 = FOURCC('M', '4', '2', '0'),
- FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
-
- // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp.
- FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
- FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
- FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
- FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
- FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
- FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
- FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
- FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
- FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
-
- // 4 Secondary RGB formats: 4 Bayer Patterns.
- FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
- FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
- FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
- FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
-
- // 1 Primary Compressed YUV format.
- FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
-
- // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
- FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
- FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
- FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
- FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
- FOURCC_J420 = FOURCC('J', '4', '2', '0'),
- FOURCC_J400 = FOURCC('J', '4', '0', '0'),
-
- // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
- FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
- FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
- FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
- FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
- FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
- FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
- FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
- FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
- FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
- FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
- FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
- FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
- FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
- FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
- FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
- FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
- FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
-
- // 1 Auxiliary compressed YUV format set aside for capturer.
- FOURCC_H264 = FOURCC('H', '2', '6', '4'),
-
- // Match any fourcc.
- FOURCC_ANY = 0xFFFFFFFF,
-};
-
-enum FourCCBpp {
- // Canonical fourcc codes used in our code.
- FOURCC_BPP_I420 = 12,
- FOURCC_BPP_I422 = 16,
- FOURCC_BPP_I444 = 24,
- FOURCC_BPP_I411 = 12,
- FOURCC_BPP_I400 = 8,
- FOURCC_BPP_NV21 = 12,
- FOURCC_BPP_NV12 = 12,
- FOURCC_BPP_YUY2 = 16,
- FOURCC_BPP_UYVY = 16,
- FOURCC_BPP_M420 = 12,
- FOURCC_BPP_Q420 = 12,
- FOURCC_BPP_ARGB = 32,
- FOURCC_BPP_BGRA = 32,
- FOURCC_BPP_ABGR = 32,
- FOURCC_BPP_RGBA = 32,
- FOURCC_BPP_24BG = 24,
- FOURCC_BPP_RAW = 24,
- FOURCC_BPP_RGBP = 16,
- FOURCC_BPP_RGBO = 16,
- FOURCC_BPP_R444 = 16,
- FOURCC_BPP_RGGB = 8,
- FOURCC_BPP_BGGR = 8,
- FOURCC_BPP_GRBG = 8,
- FOURCC_BPP_GBRG = 8,
- FOURCC_BPP_YV12 = 12,
- FOURCC_BPP_YV16 = 16,
- FOURCC_BPP_YV24 = 24,
- FOURCC_BPP_YU12 = 12,
- FOURCC_BPP_J420 = 12,
- FOURCC_BPP_J400 = 8,
- FOURCC_BPP_MJPG = 0, // 0 means unknown.
- FOURCC_BPP_H264 = 0,
- FOURCC_BPP_IYUV = 12,
- FOURCC_BPP_YU16 = 16,
- FOURCC_BPP_YU24 = 24,
- FOURCC_BPP_YUYV = 16,
- FOURCC_BPP_YUVS = 16,
- FOURCC_BPP_HDYC = 16,
- FOURCC_BPP_2VUY = 16,
- FOURCC_BPP_JPEG = 1,
- FOURCC_BPP_DMB1 = 1,
- FOURCC_BPP_BA81 = 8,
- FOURCC_BPP_RGB3 = 24,
- FOURCC_BPP_BGR3 = 24,
- FOURCC_BPP_CM32 = 32,
- FOURCC_BPP_CM24 = 24,
-
- // Match any fourcc.
- FOURCC_BPP_ANY = 0, // 0 means unknown.
-};
+ enum FourCC {
+ // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
+ FOURCC_I420 = FOURCC('I', '4', '2', '0'),
+ FOURCC_I422 = FOURCC('I', '4', '2', '2'),
+ FOURCC_I444 = FOURCC('I', '4', '4', '4'),
+ FOURCC_I411 = FOURCC('I', '4', '1', '1'),
+ FOURCC_I400 = FOURCC('I', '4', '0', '0'),
+ FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
+ FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
+ FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
+ FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
+
+ // 2 Secondary YUV formats: row biplanar.
+ FOURCC_M420 = FOURCC('M', '4', '2', '0'),
+ FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
+
+ // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp.
+ FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
+ FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
+ FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
+ FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
+ FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
+ FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
+ FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
+ FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
+ FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
+
+ // 4 Secondary RGB formats: 4 Bayer Patterns.
+ FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
+ FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
+ FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
+ FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
+
+ // 1 Primary Compressed YUV format.
+ FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
+
+ // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
+ FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
+ FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
+ FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
+ FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
+ FOURCC_J420 = FOURCC('J', '4', '2', '0'),
+ FOURCC_J400 = FOURCC('J', '4', '0', '0'),
+
+ // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
+ FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
+ FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
+ FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
+ FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
+ FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
+ FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
+ FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
+ FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
+ FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
+ FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
+ FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
+ FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
+ FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
+ FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
+ FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
+ FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
+ FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
+
+ // 1 Auxiliary compressed YUV format set aside for capturer.
+ FOURCC_H264 = FOURCC('H', '2', '6', '4'),
+
+ // Match any fourcc.
+ FOURCC_ANY = 0xFFFFFFFF,
+ };
+
+ enum FourCCBpp {
+ // Canonical fourcc codes used in our code.
+ FOURCC_BPP_I420 = 12,
+ FOURCC_BPP_I422 = 16,
+ FOURCC_BPP_I444 = 24,
+ FOURCC_BPP_I411 = 12,
+ FOURCC_BPP_I400 = 8,
+ FOURCC_BPP_NV21 = 12,
+ FOURCC_BPP_NV12 = 12,
+ FOURCC_BPP_YUY2 = 16,
+ FOURCC_BPP_UYVY = 16,
+ FOURCC_BPP_M420 = 12,
+ FOURCC_BPP_Q420 = 12,
+ FOURCC_BPP_ARGB = 32,
+ FOURCC_BPP_BGRA = 32,
+ FOURCC_BPP_ABGR = 32,
+ FOURCC_BPP_RGBA = 32,
+ FOURCC_BPP_24BG = 24,
+ FOURCC_BPP_RAW = 24,
+ FOURCC_BPP_RGBP = 16,
+ FOURCC_BPP_RGBO = 16,
+ FOURCC_BPP_R444 = 16,
+ FOURCC_BPP_RGGB = 8,
+ FOURCC_BPP_BGGR = 8,
+ FOURCC_BPP_GRBG = 8,
+ FOURCC_BPP_GBRG = 8,
+ FOURCC_BPP_YV12 = 12,
+ FOURCC_BPP_YV16 = 16,
+ FOURCC_BPP_YV24 = 24,
+ FOURCC_BPP_YU12 = 12,
+ FOURCC_BPP_J420 = 12,
+ FOURCC_BPP_J400 = 8,
+ FOURCC_BPP_MJPG = 0, // 0 means unknown.
+ FOURCC_BPP_H264 = 0,
+ FOURCC_BPP_IYUV = 12,
+ FOURCC_BPP_YU16 = 16,
+ FOURCC_BPP_YU24 = 24,
+ FOURCC_BPP_YUYV = 16,
+ FOURCC_BPP_YUVS = 16,
+ FOURCC_BPP_HDYC = 16,
+ FOURCC_BPP_2VUY = 16,
+ FOURCC_BPP_JPEG = 1,
+ FOURCC_BPP_DMB1 = 1,
+ FOURCC_BPP_BA81 = 8,
+ FOURCC_BPP_RGB3 = 24,
+ FOURCC_BPP_BGR3 = 24,
+ FOURCC_BPP_CM32 = 32,
+ FOURCC_BPP_CM24 = 24,
+
+ // Match any fourcc.
+ FOURCC_BPP_ANY = 0, // 0 means unknown.
+ };
// Converts fourcc aliases into canonical ones.
-LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
+ LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
#ifdef __cplusplus
} // extern "C"
diff --git a/thirdparties/android/common/include/opencore-amrnb/interf_enc.h b/thirdparties/android/common/include/opencore-amrnb/interf_enc.h
index b89b0c7..42b0df4 100755
--- a/thirdparties/android/common/include/opencore-amrnb/interf_enc.h
+++ b/thirdparties/android/common/include/opencore-amrnb/interf_enc.h
@@ -26,16 +26,16 @@ extern "C" {
#ifndef AMRNB_WRAPPER_INTERNAL
/* Copied from enc/src/gsmamr_enc.h */
enum Mode {
- MR475 = 0,/* 4.75 kbps */
- MR515, /* 5.15 kbps */
- MR59, /* 5.90 kbps */
- MR67, /* 6.70 kbps */
- MR74, /* 7.40 kbps */
- MR795, /* 7.95 kbps */
- MR102, /* 10.2 kbps */
- MR122, /* 12.2 kbps */
- MRDTX, /* DTX */
- N_MODES /* Not Used */
+ MR475 = 0,/* 4.75 kbps */
+ MR515, /* 5.15 kbps */
+ MR59, /* 5.90 kbps */
+ MR67, /* 6.70 kbps */
+ MR74, /* 7.40 kbps */
+ MR795, /* 7.95 kbps */
+ MR102, /* 10.2 kbps */
+ MR122, /* 12.2 kbps */
+ MRDTX, /* DTX */
+ N_MODES /* Not Used */
};
#endif
diff --git a/thirdparties/android/common/include/opus/opus.h b/thirdparties/android/common/include/opus/opus.h
index 847a07c..74f2d1c 100755
--- a/thirdparties/android/common/include/opus/opus.h
+++ b/thirdparties/android/common/include/opus/opus.h
@@ -525,12 +525,12 @@ OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
* @returns number of frames
*/
OPUS_EXPORT int opus_packet_parse(
- const unsigned char *data,
- opus_int32 len,
- unsigned char *out_toc,
- const unsigned char *frames[48],
- short size[48],
- int *payload_offset
+ const unsigned char *data,
+ opus_int32 len,
+ unsigned char *out_toc,
+ const unsigned char *frames[48],
+ short size[48],
+ int *payload_offset
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Gets the bandwidth of an Opus packet.
diff --git a/thirdparties/android/common/include/opus/opus_multistream.h b/thirdparties/android/common/include/opus/opus_multistream.h
index 658067f..8e8c6b7 100755
--- a/thirdparties/android/common/include/opus/opus_multistream.h
+++ b/thirdparties/android/common/include/opus/opus_multistream.h
@@ -201,8 +201,8 @@ typedef struct OpusMSDecoder OpusMSDecoder;
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
/** Allocates and initializes a multistream encoder state.
@@ -249,13 +249,13 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Initialize a previously allocated multistream encoder state.
@@ -307,13 +307,13 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_crea
* on failure.
*/
OPUS_EXPORT int opus_multistream_encoder_init(
- OpusMSEncoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application
+ OpusMSEncoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Encodes a multistream Opus frame.
@@ -392,11 +392,11 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
* negative error code (see @ref opus_errorcodes) on failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float(
- OpusMSEncoder *st,
- const float *pcm,
- int frame_size,
- unsigned char *data,
- opus_int32 max_data_bytes
+ OpusMSEncoder *st,
+ const float *pcm,
+ int frame_size,
+ unsigned char *data,
+ opus_int32 max_data_bytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Frees an <code>OpusMSEncoder</code> allocated by
@@ -440,8 +440,8 @@ OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
/** Allocates and initializes a multistream decoder state.
@@ -474,12 +474,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Intialize a previously allocated decoder state object.
@@ -517,12 +517,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea
* on failure.
*/
OPUS_EXPORT int opus_multistream_decoder_init(
- OpusMSDecoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping
+ OpusMSDecoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Decode a multistream Opus packet.
diff --git a/thirdparties/android/common/include/opus/opus_types.h b/thirdparties/android/common/include/opus/opus_types.h
index b28e03a..85a2ed8 100755
--- a/thirdparties/android/common/include/opus/opus_types.h
+++ b/thirdparties/android/common/include/opus/opus_types.h
@@ -37,114 +37,114 @@
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#include <stdint.h>
- typedef int16_t opus_int16;
- typedef uint16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef uint32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef uint16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef uint32_t opus_uint32;
#elif defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t opus_int32;
- typedef _G_uint32_t opus_uint32;
- typedef _G_int16 opus_int16;
- typedef _G_uint16 opus_uint16;
+typedef _G_int32_t opus_int32;
+typedef _G_uint32_t opus_uint32;
+typedef _G_int16 opus_int16;
+typedef _G_uint16 opus_uint16;
# elif defined(__MINGW32__)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
# elif defined(__MWERKS__)
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
# else
- /* MSVC/Borland */
- typedef __int32 opus_int32;
- typedef unsigned __int32 opus_uint32;
- typedef __int16 opus_int16;
- typedef unsigned __int16 opus_uint16;
+/* MSVC/Borland */
+typedef __int32 opus_int32;
+typedef unsigned __int32 opus_uint32;
+typedef __int16 opus_int16;
+typedef unsigned __int16 opus_uint16;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 opus_int16;
- typedef UInt16 opus_uint16;
- typedef SInt32 opus_int32;
- typedef UInt32 opus_uint32;
+typedef SInt16 opus_int16;
+typedef UInt16 opus_uint16;
+typedef SInt32 opus_int32;
+typedef UInt32 opus_uint32;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t opus_int16;
- typedef u_int16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef u_int16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16 opus_int16;
- typedef u_int16 opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16 opus_int16;
+typedef u_int16 opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* OS/2 GCC */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* DJGPP */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(R5900)
- /* PS2 EE */
- typedef int opus_int32;
- typedef unsigned opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+/* PS2 EE */
+typedef int opus_int32;
+typedef unsigned opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short opus_int16;
- typedef unsigned short opus_uint16;
- typedef signed int opus_int32;
- typedef unsigned int opus_uint32;
+/* Symbian GCC */
+typedef signed short opus_int16;
+typedef unsigned short opus_uint16;
+typedef signed int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef long opus_int32;
- typedef unsigned long opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef long opus_int32;
+typedef unsigned long opus_uint32;
#elif defined(CONFIG_TI_C6X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#else
- /* Give up, take a reasonable guess */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* Give up, take a reasonable guess */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#endif
diff --git a/thirdparties/android/common/include/speex/speex.h b/thirdparties/android/common/include/speex/speex.h
index 82ba016..0eb560e 100755
--- a/thirdparties/android/common/include/speex/speex.h
+++ b/thirdparties/android/common/include/speex/speex.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
-/** Struct defining a Speex mode */
+/** Struct defining a Speex mode */
typedef struct SpeexMode {
- /** Pointer to the low-level mode data */
- const void *mode;
+ /** Pointer to the low-level mode data */
+ const void *mode;
+
+ /** Pointer to the mode query function */
+ mode_query_func query;
- /** Pointer to the mode query function */
- mode_query_func query;
-
- /** The name of the mode (you should not rely on this to identify the mode)*/
- const char *modeName;
+ /** The name of the mode (you should not rely on this to identify the mode)*/
+ const char *modeName;
- /**ID of the mode*/
- int modeID;
+ /**ID of the mode*/
+ int modeID;
- /**Version number of the bitstream (incremented every time we break
- bitstream compatibility*/
- int bitstream_version;
+ /**Version number of the bitstream (incremented every time we break
+ bitstream compatibility*/
+ int bitstream_version;
- /** Pointer to encoder initialization function */
- encoder_init_func enc_init;
+ /** Pointer to encoder initialization function */
+ encoder_init_func enc_init;
- /** Pointer to encoder destruction function */
- encoder_destroy_func enc_destroy;
+ /** Pointer to encoder destruction function */
+ encoder_destroy_func enc_destroy;
- /** Pointer to frame encoding function */
- encode_func enc;
+ /** Pointer to frame encoding function */
+ encode_func enc;
- /** Pointer to decoder initialization function */
- decoder_init_func dec_init;
+ /** Pointer to decoder initialization function */
+ decoder_init_func dec_init;
- /** Pointer to decoder destruction function */
- decoder_destroy_func dec_destroy;
+ /** Pointer to decoder destruction function */
+ decoder_destroy_func dec_destroy;
- /** Pointer to frame decoding function */
- decode_func dec;
+ /** Pointer to frame decoding function */
+ decode_func dec;
- /** ioctl-like requests for encoder */
- encoder_ctl_func enc_ctl;
+ /** ioctl-like requests for encoder */
+ encoder_ctl_func enc_ctl;
- /** ioctl-like requests for decoder */
- decoder_ctl_func dec_ctl;
+ /** ioctl-like requests for decoder */
+ decoder_ctl_func dec_ctl;
} SpeexMode;
/**
- * Returns a handle to a newly created Speex encoder state structure. For now,
- * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
- * may be added. Note that for now if you have more than one channels to
+ * Returns a handle to a newly created Speex encoder state structure. For now,
+ * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
+ * may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
- * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
+ * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
-/** Frees all resources associated to an existing Speex encoder state.
+/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
- @param in Frame that will be encoded with a +-2^15 range. This data MAY be
- overwritten by the encoder and should be considered uninitialised
+ @param in Frame that will be encoded with a +-2^15 range. This data MAY be
+ overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
@@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int speex_encoder_ctl(void *state, int request, void *ptr);
-/** Returns a handle to a newly created decoder state structure. For now,
+/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
- */
+ */
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
diff --git a/thirdparties/android/common/include/speex/speex_bits.h b/thirdparties/android/common/include/speex/speex_bits.h
index a26fb4c..dd3b752 100755
--- a/thirdparties/android/common/include/speex/speex_bits.h
+++ b/thirdparties/android/common/include/speex/speex_bits.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,15 +47,15 @@ extern "C" {
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
- char *chars; /**< "raw" data */
- int nbBits; /**< Total number of bits stored in the stream*/
- int charPtr; /**< Position of the byte "cursor" */
- int bitPtr; /**< Position of the bit "cursor" within the current char */
- int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
- int overflow;/**< Set to one if we try to read past the valid data */
- int buf_size;/**< Allocated size for buffer */
- int reserved1; /**< Reserved for future use */
- void *reserved2; /**< Reserved for future use */
+ char *chars; /**< "raw" data */
+ int nbBits; /**< Total number of bits stored in the stream*/
+ int charPtr; /**< Position of the byte "cursor" */
+ int bitPtr; /**< Position of the bit "cursor" within the current char */
+ int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
+ int overflow;/**< Set to one if we try to read past the valid data */
+ int buf_size;/**< Allocated size for buffer */
+ int reserved1; /**< Reserved for future use */
+ void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int speex_bits_nbytes(SpeexBits *bits);
-/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
- *
+/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
+ *
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
- * "cursor" position
- *
+ * "cursor" position
+ *
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
-/** Advances the position of the "bit cursor" in the stream
+/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int speex_bits_remaining(SpeexBits *bits);
-/** Insert a terminator so that the data can be sent as a packet while auto-detecting
- * the number of frames in each packet
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting
+ * the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
diff --git a/thirdparties/android/common/include/speex/speex_buffer.h b/thirdparties/android/common/include/speex/speex_buffer.h
index df56f5f..909bd6d 100755
--- a/thirdparties/android/common/include/speex/speex_buffer.h
+++ b/thirdparties/android/common/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/thirdparties/android/common/include/speex/speex_callbacks.h b/thirdparties/android/common/include/speex/speex_callbacks.h
index 6f450b3..27b5649 100755
--- a/thirdparties/android/common/include/speex/speex_callbacks.h
+++ b/thirdparties/android/common/include/speex/speex_callbacks.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
- int callback_id; /**< ID associated to the callback */
- speex_callback_func func; /**< Callback handler function */
- void *data; /**< Data that will be sent to the handler */
- void *reserved1; /**< Reserved for future use */
- int reserved2; /**< Reserved for future use */
+ int callback_id; /**< ID associated to the callback */
+ speex_callback_func func; /**< Callback handler function */
+ void *data; /**< Data that will be sent to the handler */
+ void *reserved1; /**< Reserved for future use */
+ int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
diff --git a/thirdparties/android/common/include/speex/speex_echo.h b/thirdparties/android/common/include/speex/speex_echo.h
index 53bcd28..582e1cc 100755
--- a/thirdparties/android/common/include/speex/speex_echo.h
+++ b/thirdparties/android/common/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/thirdparties/android/common/include/speex/speex_header.h b/thirdparties/android/common/include/speex/speex_header.h
index f85b249..4cc15df 100755
--- a/thirdparties/android/common/include/speex/speex_header.h
+++ b/thirdparties/android/common/include/speex/speex_header.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,21 +57,21 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
- char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
- char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
- spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
- spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
- spx_int32_t rate; /**< Sampling rate used */
- spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
- spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
- spx_int32_t nb_channels; /**< Number of channels encoded */
- spx_int32_t bitrate; /**< Bit-rate used */
- spx_int32_t frame_size; /**< Size of frames */
- spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
- spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
- spx_int32_t extra_headers; /**< Number of additional headers after the comments */
- spx_int32_t reserved1; /**< Reserved for future use, must be zero */
- spx_int32_t reserved2; /**< Reserved for future use, must be zero */
+ char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
+ char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
+ spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
+ spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
+ spx_int32_t rate; /**< Sampling rate used */
+ spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
+ spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
+ spx_int32_t nb_channels; /**< Number of channels encoded */
+ spx_int32_t bitrate; /**< Bit-rate used */
+ spx_int32_t frame_size; /**< Size of frames */
+ spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
+ spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
+ spx_int32_t extra_headers; /**< Number of additional headers after the comments */
+ spx_int32_t reserved1; /**< Reserved for future use, must be zero */
+ spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
diff --git a/thirdparties/android/common/include/speex/speex_jitter.h b/thirdparties/android/common/include/speex/speex_jitter.h
index d68674b..e6f0321 100755
--- a/thirdparties/android/common/include/speex/speex_jitter.h
+++ b/thirdparties/android/common/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
- char *data; /**< Data bytes contained in the packet */
- spx_uint32_t len; /**< Length of the packet in bytes */
- spx_uint32_t timestamp; /**< Timestamp for the packet */
- spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
- spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
- spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
+ char *data; /**< Data bytes contained in the packet */
+ spx_uint32_t len; /**< Length of the packet in bytes */
+ spx_uint32_t timestamp; /**< Timestamp for the packet */
+ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
+ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
+ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/android/common/include/speex/speex_preprocess.h b/thirdparties/android/common/include/speex/speex_preprocess.h
index f8eef2c..5cd3710 100755
--- a/thirdparties/android/common/include/speex/speex_preprocess.h
+++ b/thirdparties/android/common/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/android/common/include/speex/speex_resampler.h b/thirdparties/android/common/include/speex/speex_resampler.h
index 54eef8d..4aefa61 100755
--- a/thirdparties/android/common/include/speex/speex_resampler.h
+++ b/thirdparties/android/common/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,7 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
@@ -99,13 +99,13 @@ extern "C" {
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
- RESAMPLER_ERR_SUCCESS = 0,
- RESAMPLER_ERR_ALLOC_FAILED = 1,
- RESAMPLER_ERR_BAD_STATE = 2,
- RESAMPLER_ERR_INVALID_ARG = 3,
- RESAMPLER_ERR_PTR_OVERLAP = 4,
-
- RESAMPLER_ERR_MAX_ERROR
+ RESAMPLER_ERR_SUCCESS = 0,
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
+ RESAMPLER_ERR_BAD_STATE = 2,
+ RESAMPLER_ERR_INVALID_ARG = 3,
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
+
+ RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
@@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
-
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
+
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
/** Destroy a resampler state.
* @param st Resampler state
@@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
@@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
- int quality);
+int speex_resampler_set_quality(SpeexResamplerState *st,
+ int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
- spx_uint32_t stride);
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
+ spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
- spx_uint32_t *stride);
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
+ spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
@@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/thirdparties/android/common/include/speex/speex_stereo.h b/thirdparties/android/common/include/speex/speex_stereo.h
index a259713..f33704d 100755
--- a/thirdparties/android/common/include/speex/speex_stereo.h
+++ b/thirdparties/android/common/include/speex/speex_stereo.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -48,12 +48,12 @@ extern "C" {
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
- float balance; /**< Left/right balance info */
- float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
- float smooth_left; /**< Smoothed left channel gain */
- float smooth_right; /**< Smoothed right channel gain */
- float reserved1; /**< Reserved for future use */
- float reserved2; /**< Reserved for future use */
+ float balance; /**< Left/right balance info */
+ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
+ float smooth_left; /**< Smoothed left channel gain */
+ float smooth_right; /**< Smoothed right channel gain */
+ float reserved1; /**< Reserved for future use */
+ float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
diff --git a/thirdparties/android/common/include/speex/speex_types.h b/thirdparties/android/common/include/speex/speex_types.h
index 737c5fa..b262aac 100755
--- a/thirdparties/android/common/include/speex/speex_types.h
+++ b/thirdparties/android/common/include/speex/speex_types.h
@@ -22,107 +22,107 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t spx_int32_t;
- typedef _G_uint32_t spx_uint32_t;
- typedef _G_int16_t spx_int16_t;
- typedef _G_uint16_t spx_uint16_t;
+typedef _G_int32_t spx_int32_t;
+typedef _G_uint32_t spx_uint32_t;
+typedef _G_int16_t spx_int16_t;
+typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int32 spx_int32_t;
- typedef unsigned __int32 spx_uint32_t;
- typedef __int16 spx_int16_t;
- typedef unsigned __int16 spx_uint16_t;
+/* MSVC/Borland */
+typedef __int32 spx_int32_t;
+typedef unsigned __int32 spx_uint32_t;
+typedef __int16 spx_int16_t;
+typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 spx_int16_t;
- typedef UInt16 spx_uint16_t;
- typedef SInt32 spx_int32_t;
- typedef UInt32 spx_uint32_t;
+typedef SInt16 spx_int16_t;
+typedef UInt16 spx_uint16_t;
+typedef SInt32 spx_int32_t;
+typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* OS/2 GCC */
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short spx_int16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* DJGPP */
+typedef short spx_int16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef int spx_int32_t;
- typedef unsigned spx_uint32_t;
- typedef short spx_int16_t;
+/* PS2 EE */
+typedef int spx_int32_t;
+typedef unsigned spx_uint32_t;
+typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef signed int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* Symbian GCC */
+typedef signed short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef signed int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef long spx_int32_t;
- typedef unsigned long spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef long spx_int32_t;
+typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif ANDROID
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#else
diff --git a/thirdparties/android/common/include/srtp/aes.h b/thirdparties/android/common/include/srtp/aes.h
index 2881337..97fdb63 100755
--- a/thirdparties/android/common/include/srtp/aes.h
+++ b/thirdparties/android/common/include/srtp/aes.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -55,19 +55,19 @@
/* aes internals */
typedef struct {
- v128_t round[15];
- int num_rounds;
+ v128_t round[15];
+ int num_rounds;
} aes_expanded_key_t;
err_status_t
aes_expand_encryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
err_status_t
aes_expand_decryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
void
aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
@@ -77,7 +77,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
#if 0
/*
- * internal functions
+ * internal functions
*/
void
@@ -85,6 +85,6 @@ aes_init_sbox(void);
void
aes_compute_tables(void);
-#endif
+#endif
#endif /* _AES_H */
diff --git a/thirdparties/android/common/include/srtp/aes_cbc.h b/thirdparties/android/common/include/srtp/aes_cbc.h
index bc4e41a..7abd6d6 100755
--- a/thirdparties/android/common/include/srtp/aes_cbc.h
+++ b/thirdparties/android/common/include/srtp/aes_cbc.h
@@ -15,36 +15,36 @@
#include "cipher.h"
typedef struct {
- v128_t state; /* cipher chaining state */
- v128_t previous; /* previous ciphertext block */
- aes_expanded_key_t expanded_key; /* the cipher key */
+ v128_t state; /* cipher chaining state */
+ v128_t previous; /* previous ciphertext block */
+ aes_expanded_key_t expanded_key; /* the cipher key */
} aes_cbc_ctx_t;
err_status_t
aes_cbc_set_key(aes_cbc_ctx_t *c,
- const unsigned char *key);
+ const unsigned char *key);
err_status_t
-aes_cbc_encrypt(aes_cbc_ctx_t *c,
- unsigned char *buf,
- unsigned int *bytes_in_data);
+aes_cbc_encrypt(aes_cbc_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *bytes_in_data);
err_status_t
-aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
- int key_len, cipher_direction_t dir);
+aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
+ int key_len, cipher_direction_t dir);
err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv);
err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
#endif /* AES_CBC_H */
diff --git a/thirdparties/android/common/include/srtp/aes_icm.h b/thirdparties/android/common/include/srtp/aes_icm.h
index dac0cdc..6ed032e 100755
--- a/thirdparties/android/common/include/srtp/aes_icm.h
+++ b/thirdparties/android/common/include/srtp/aes_icm.h
@@ -15,43 +15,43 @@
#include "cipher.h"
typedef struct {
- v128_t counter; /* holds the counter value */
- v128_t offset; /* initial offset value */
- v128_t keystream_buffer; /* buffers bytes of keystream */
- aes_expanded_key_t expanded_key; /* the cipher key */
- int bytes_in_buffer; /* number of unused bytes in buffer */
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
} aes_icm_ctx_t;
err_status_t
aes_icm_context_init(aes_icm_ctx_t *c,
- const unsigned char *key,
- int key_len);
+ const unsigned char *key,
+ int key_len);
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv);
err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
aes_icm_output(aes_icm_ctx_t *c,
- unsigned char *buf, int bytes_to_output);
+ unsigned char *buf, int bytes_to_output);
-err_status_t
+err_status_t
aes_icm_dealloc(cipher_t *c);
-
-err_status_t
-aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
- unsigned char *buf,
- unsigned int *enc_len,
- int forIsmacryp);
-
-err_status_t
-aes_icm_alloc_ismacryp(cipher_t **c,
- int key_len,
- int forIsmacryp);
+
+err_status_t
+aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *enc_len,
+ int forIsmacryp);
+
+err_status_t
+aes_icm_alloc_ismacryp(cipher_t **c,
+ int key_len,
+ int forIsmacryp);
#endif /* AES_ICM_H */
diff --git a/thirdparties/android/common/include/srtp/alloc.h b/thirdparties/android/common/include/srtp/alloc.h
index 5980eed..306e5f4 100755
--- a/thirdparties/android/common/include/srtp/alloc.h
+++ b/thirdparties/android/common/include/srtp/alloc.h
@@ -1,32 +1,32 @@
/*
* alloc.h
*
- * interface to memory allocation and deallocation, with optional debugging
+ * interface to memory allocation and deallocation, with optional debugging
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/android/common/include/srtp/auth.h b/thirdparties/android/common/include/srtp/auth.h
index 5b5e4b2..4d03d08 100755
--- a/thirdparties/android/common/include/srtp/auth.h
+++ b/thirdparties/android/common/include/srtp/auth.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "err.h" /* error codes */
#include "crypto.h" /* for auth_type_id_t */
#include "crypto_types.h" /* for values of auth_type_id_t */
@@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer;
typedef struct auth_t *auth_pointer_t;
typedef err_status_t (*auth_alloc_func)
- (auth_pointer_t *ap, int key_len, int out_len);
+(auth_pointer_t *ap, int key_len, int out_len);
typedef err_status_t (*auth_init_func)
- (void *state, const uint8_t *key, int key_len);
+(void *state, const uint8_t *key, int key_len);
typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap);
typedef err_status_t (*auth_compute_func)
- (void *state, uint8_t *buffer, int octets_to_auth,
- int tag_len, uint8_t *tag);
+(void *state, uint8_t *buffer, int octets_to_auth,
+ int tag_len, uint8_t *tag);
typedef err_status_t (*auth_update_func)
- (void *state, uint8_t *buffer, int octets_to_auth);
+(void *state, uint8_t *buffer, int octets_to_auth);
typedef err_status_t (*auth_start_func)(void *state);
-
+
/* some syntactic sugar on these function types */
#define auth_type_alloc(at, a, klen, outlen) \
@@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a);
*/
typedef struct auth_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- int data_length_octets; /* octets in data */
- uint8_t *data; /* data */
- int tag_length_octets; /* octets in tag */
- uint8_t *tag; /* tag */
- struct auth_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ int data_length_octets; /* octets in data */
+ uint8_t *data; /* data */
+ int tag_length_octets; /* octets in tag */
+ uint8_t *tag; /* tag */
+ struct auth_test_case_t *next_test_case; /* pointer to next testcase */
} auth_test_case_t;
/* auth_type_t */
typedef struct auth_type_t {
- auth_alloc_func alloc;
- auth_dealloc_func dealloc;
- auth_init_func init;
- auth_compute_func compute;
- auth_update_func update;
- auth_start_func start;
- char *description;
- int ref_count;
- auth_test_case_t *test_data;
- debug_module_t *debug;
- auth_type_id_t id;
+ auth_alloc_func alloc;
+ auth_dealloc_func dealloc;
+ auth_init_func init;
+ auth_compute_func compute;
+ auth_update_func update;
+ auth_start_func start;
+ char *description;
+ int ref_count;
+ auth_test_case_t *test_data;
+ debug_module_t *debug;
+ auth_type_id_t id;
} auth_type_t;
typedef struct auth_t {
- auth_type_t *type;
- void *state;
- int out_len; /* length of output tag in octets */
- int key_len; /* length of key in octets */
- int prefix_len; /* length of keystream prefix */
+ auth_type_t *type;
+ void *state;
+ int out_len; /* length of output tag in octets */
+ int key_len; /* length of key in octets */
+ int prefix_len; /* length of keystream prefix */
} auth_t;
-/*
+/*
* auth_type_self_test() tests an auth_type against test cases
* provided in an array of values of key/message/tag that is known to
* be good
@@ -151,7 +151,7 @@ typedef struct auth_t {
err_status_t
auth_type_self_test(const auth_type_t *at);
-/*
+/*
* auth_type_test() tests an auth_type against external test cases
* provided in an array of values of key/message/tag that is known to
* be good
diff --git a/thirdparties/android/common/include/srtp/cipher.h b/thirdparties/android/common/include/srtp/cipher.h
index eff6dd1..9529153 100755
--- a/thirdparties/android/common/include/srtp/cipher.h
+++ b/thirdparties/android/common/include/srtp/cipher.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CIPHER_H
#define CIPHER_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "rdbx.h" /* for xtd_seq_num_t */
#include "err.h" /* for error codes */
#include "crypto.h" /* for cipher_type_id_t */
@@ -54,17 +54,17 @@
/**
- * @brief cipher_direction_t defines a particular cipher operation.
+ * @brief cipher_direction_t defines a particular cipher operation.
*
* A cipher_direction_t is an enum that describes a particular cipher
* operation, i.e. encryption or decryption. For some ciphers, this
* distinction does not matter, but for others, it is essential.
*/
-typedef enum {
- direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
- direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
- direction_any /**< encryption or decryption */
+typedef enum {
+ direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
+ direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
+ direction_any /**< encryption or decryption */
} cipher_direction_t;
/*
@@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t;
typedef struct cipher_t *cipher_pointer_t;
/*
- * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
+ * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
*/
typedef err_status_t (*cipher_alloc_func_t)
- (cipher_pointer_t *cp, int key_len);
+(cipher_pointer_t *cp, int key_len);
-/*
+/*
* a cipher_init_func_t [re-]initializes a cipher_t with a given key
* and direction (i.e., encrypt or decrypt)
*/
@@ -97,24 +97,24 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp);
/* a cipher_set_segment_func_t sets the segment index of a cipher_t */
typedef err_status_t (*cipher_set_segment_func_t)
- (void *state, xtd_seq_num_t idx);
+(void *state, xtd_seq_num_t idx);
/* a cipher_encrypt_func_t encrypts data in-place */
typedef err_status_t (*cipher_encrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
/* a cipher_decrypt_func_t decrypts data in-place */
typedef err_status_t (*cipher_decrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
-/*
+/*
* a cipher_set_iv_func_t function sets the current initialization vector
*/
typedef err_status_t (*cipher_set_iv_func_t)
- (cipher_pointer_t cp, void *iv);
+(cipher_pointer_t cp, void *iv);
/*
* cipher_test_case_t is a (list of) key, salt, xtd_seq_num_t,
@@ -125,30 +125,30 @@ typedef err_status_t (*cipher_set_iv_func_t)
*/
typedef struct cipher_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- uint8_t *idx; /* packet index */
- int plaintext_length_octets; /* octets in plaintext */
- uint8_t *plaintext; /* plaintext */
- int ciphertext_length_octets; /* octets in plaintext */
- uint8_t *ciphertext; /* ciphertext */
- struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ uint8_t *idx; /* packet index */
+ int plaintext_length_octets; /* octets in plaintext */
+ uint8_t *plaintext; /* plaintext */
+ int ciphertext_length_octets; /* octets in plaintext */
+ uint8_t *ciphertext; /* ciphertext */
+ struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
} cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t {
- cipher_alloc_func_t alloc;
- cipher_dealloc_func_t dealloc;
- cipher_init_func_t init;
- cipher_encrypt_func_t encrypt;
- cipher_encrypt_func_t decrypt;
- cipher_set_iv_func_t set_iv;
- char *description;
- int ref_count;
- cipher_test_case_t *test_data;
- debug_module_t *debug;
- cipher_type_id_t id;
+ cipher_alloc_func_t alloc;
+ cipher_dealloc_func_t dealloc;
+ cipher_init_func_t init;
+ cipher_encrypt_func_t encrypt;
+ cipher_encrypt_func_t decrypt;
+ cipher_set_iv_func_t set_iv;
+ char *description;
+ int ref_count;
+ cipher_test_case_t *test_data;
+ debug_module_t *debug;
+ cipher_type_id_t id;
} cipher_type_t;
/*
@@ -157,11 +157,11 @@ typedef struct cipher_type_t {
*/
typedef struct cipher_t {
- cipher_type_t *type;
- void *state;
- int key_len;
+ cipher_type_t *type;
+ void *state;
+ int key_len;
#ifdef FORCE_64BIT_ALIGN
- int pad;
+ int pad;
#endif
} cipher_t;
@@ -181,7 +181,7 @@ typedef struct cipher_t {
#define cipher_set_iv(c, n) \
((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output);
@@ -193,9 +193,9 @@ int
cipher_get_key_length(const cipher_t *c);
-/*
- * cipher_type_self_test() tests a cipher against test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_self_test() tests a cipher against test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -203,9 +203,9 @@ err_status_t
cipher_type_self_test(const cipher_type_t *ct);
-/*
- * cipher_type_test() tests a cipher against external test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_test() tests a cipher against external test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -216,7 +216,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data);
/*
* cipher_bits_per_second(c, l, t) computes (and estimate of) the
* number of bits that a cipher implementation can encrypt in a second
- *
+ *
* c is a cipher (which MUST be allocated and initialized already), l
* is the length in octets of the test data to be encrypted, and t is
* the number of trials
diff --git a/thirdparties/android/common/include/srtp/crypto.h b/thirdparties/android/common/include/srtp/crypto.h
index 0e9667d..9d656fa 100755
--- a/thirdparties/android/common/include/srtp/crypto.h
+++ b/thirdparties/android/common/include/srtp/crypto.h
@@ -2,7 +2,7 @@
* crypto.h
*
* API for libcrypto
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -10,7 +10,7 @@
#ifndef CRYPTO_H
#define CRYPTO_H
-/**
+/**
* @brief A cipher_type_id_t is an identifier for a particular cipher
* type.
*
@@ -19,10 +19,10 @@
* NULL_CIPHER is avaliable; this cipher leaves the data unchanged,
* and can be selected to indicate that no encryption is to take
* place.
- *
+ *
* @ingroup Ciphers
*/
-typedef uint32_t cipher_type_id_t;
+typedef uint32_t cipher_type_id_t;
/**
* @brief An auth_type_id_t is an identifier for a particular authentication
@@ -33,7 +33,7 @@ typedef uint32_t cipher_type_id_t;
* avaliable; this authentication function performs no computation,
* and can be selected to indicate that no authentication is to take
* place.
- *
+ *
* @ingroup Authentication
*/
typedef uint32_t auth_type_id_t;
diff --git a/thirdparties/android/common/include/srtp/crypto_kernel.h b/thirdparties/android/common/include/srtp/crypto_kernel.h
index 1acf497..c496174 100755
--- a/thirdparties/android/common/include/srtp/crypto_kernel.h
+++ b/thirdparties/android/common/include/srtp/crypto_kernel.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,9 +46,9 @@
#ifndef CRYPTO_KERNEL
#define CRYPTO_KERNEL
-#include "rand_source.h"
+#include "rand_source.h"
#include "prng.h"
-#include "cipher.h"
+#include "cipher.h"
#include "auth.h"
#include "cryptoalg.h"
#include "stat.h"
@@ -65,37 +65,37 @@
*/
typedef enum {
- crypto_kernel_state_insecure,
- crypto_kernel_state_secure
+ crypto_kernel_state_insecure,
+ crypto_kernel_state_secure
} crypto_kernel_state_t;
-/*
- * linked list of cipher types
+/*
+ * linked list of cipher types
*/
typedef struct kernel_cipher_type {
- cipher_type_id_t id;
- cipher_type_t *cipher_type;
- struct kernel_cipher_type *next;
+ cipher_type_id_t id;
+ cipher_type_t *cipher_type;
+ struct kernel_cipher_type *next;
} kernel_cipher_type_t;
-/*
- * linked list of auth types
+/*
+ * linked list of auth types
*/
typedef struct kernel_auth_type {
- auth_type_id_t id;
- auth_type_t *auth_type;
- struct kernel_auth_type *next;
+ auth_type_id_t id;
+ auth_type_t *auth_type;
+ struct kernel_auth_type *next;
} kernel_auth_type_t;
/*
- * linked list of debug modules
+ * linked list of debug modules
*/
typedef struct kernel_debug_module {
- debug_module_t *mod;
- struct kernel_debug_module *next;
+ debug_module_t *mod;
+ struct kernel_debug_module *next;
} kernel_debug_module_t;
@@ -107,10 +107,10 @@ typedef struct kernel_debug_module {
*/
typedef struct {
- crypto_kernel_state_t state; /* current state of kernel */
- kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
- kernel_auth_type_t *auth_type_list; /* list of all auth func types */
- kernel_debug_module_t *debug_module_list; /* list of all debug modules */
+ crypto_kernel_state_t state; /* current state of kernel */
+ kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
+ kernel_auth_type_t *auth_type_list; /* list of all auth func types */
+ kernel_debug_module_t *debug_module_list; /* list of all debug modules */
} crypto_kernel_t;
@@ -125,10 +125,10 @@ typedef struct {
* crypto algorithms. Possible return values are:
*
* err_status_ok initialization successful
- * <other> init failure
+ * <other> init failure
*
* If any value other than err_status_ok is returned, the
- * crypto_kernel MUST NOT be used.
+ * crypto_kernel MUST NOT be used.
*/
err_status_t
@@ -142,7 +142,7 @@ crypto_kernel_init(void);
* values are:
*
* err_status_ok shutdown successful
- * <other> shutdown failure
+ * <other> shutdown failure
*
*/
@@ -155,7 +155,7 @@ crypto_kernel_shutdown(void);
* status report. Possible return values are:
*
* err_status_ok all tests were passed
- * <other> a test failed
+ * <other> a test failed
*
*/
@@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id);
/*
* crypto_kernel_replace_cipher_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the cipher_type id
* with a new one passed in externally. The new cipher must pass all the
* existing cipher_type's self tests as well as its own.
@@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id);
/*
* crypto_kernel_replace_auth_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the auth_type id
* with a new one passed in externally. The new auth type must pass all the
* existing auth_type's self tests as well as its own.
@@ -208,43 +208,43 @@ err_status_t
crypto_kernel_load_debug_module(debug_module_t *new_dm);
/*
- * crypto_kernel_alloc_cipher(id, cp, key_len);
+ * crypto_kernel_alloc_cipher(id, cp, key_len);
*
* allocates a cipher of type id at location *cp, with key length
* key_len octets. Return values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find cipher with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_cipher(cipher_type_id_t id,
- cipher_pointer_t *cp,
- int key_len);
+crypto_kernel_alloc_cipher(cipher_type_id_t id,
+ cipher_pointer_t *cp,
+ int key_len);
/*
- * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
+ * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
*
* allocates an auth function of type id at location *ap, with key
* length key_len octets and output tag length of tag_len. Return
* values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find auth with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_auth(auth_type_id_t id,
- auth_pointer_t *ap,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_auth(auth_type_id_t id,
+ auth_pointer_t *ap,
+ int key_len,
+ int tag_len);
/*
* crypto_kernel_set_debug_module(mod_name, v)
- *
+ *
* sets dynamic debugging to the value v (0 for off, 1 for on) for the
* debug module with the name mod_name
*
@@ -261,7 +261,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
- *
+ *
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
@@ -276,5 +276,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);
-
+
#endif /* CRYPTO_KERNEL */
diff --git a/thirdparties/android/common/include/srtp/crypto_math.h b/thirdparties/android/common/include/srtp/crypto_math.h
index 52f0837..4de3912 100755
--- a/thirdparties/android/common/include/srtp/crypto_math.h
+++ b/thirdparties/android/common/include/srtp/crypto_math.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ hex_string_to_v64(char *s);
/* the matrix A[] is stored in column format, i.e., A[i] is
the ith column of the matrix */
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
void
@@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
-/*
+/*
* the matrix A[] is stored in column format, i.e., A[i] is the ith
* column of the matrix
*/
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
@@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-
-#endif /* WORDS_BIGENDIAN */
+
+#endif /* WORDS_BIGENDIAN */
#endif
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
@@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -202,7 +202,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -211,10 +211,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
diff --git a/thirdparties/android/common/include/srtp/crypto_types.h b/thirdparties/android/common/include/srtp/crypto_types.h
index 3531710..06a05dc 100755
--- a/thirdparties/android/common/include/srtp/crypto_types.h
+++ b/thirdparties/android/common/include/srtp/crypto_types.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,14 +57,14 @@
* (UST) must be used in conjunction with a cipher other than the null
* cipher. These functions require a per-message pseudorandom input
* that is generated by the cipher.
- *
+ *
* The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the
* strongest available authentication function and cipher,
* respectively. They are resolved at compile time to the strongest
* available algorithm. The stronghold algorithms can serve as did
* the keep of a medieval fortification; they provide the strongest
* defense (or the last refuge).
- *
+ *
* @{
*/
@@ -72,7 +72,7 @@
* @defgroup Ciphers Cipher Types
*
* @brief Each cipher type is identified by an unsigned integer. The
- * cipher types available in this edition of libSRTP are given
+ * cipher types available in this edition of libSRTP are given
* by the #defines below.
*
* A cipher_type_id_t is an identifier for a cipher_type; only values
@@ -90,56 +90,56 @@
/**
* @brief The null cipher performs no encryption.
*
- * The NULL_CIPHER leaves its inputs unaltered, during both the
+ * The NULL_CIPHER leaves its inputs unaltered, during both the
* encryption and decryption operations. This cipher can be chosen
* to indicate that no encryption is to be performed.
*/
-#define NULL_CIPHER 0
+#define NULL_CIPHER 0
-/**
- * @brief AES Integer Counter Mode (AES ICM)
+/**
+ * @brief AES Integer Counter Mode (AES ICM)
*
- * AES ICM is the variant of counter mode that is used by Secure RTP.
+ * AES ICM is the variant of counter mode that is used by Secure RTP.
* This cipher uses a 16-, 24-, or 32-octet key concatenated with a
* 14-octet offset (or salt) value.
*/
-#define AES_ICM 1
+#define AES_ICM 1
-/**
- * @brief AES-128 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-128 Integer Counter Mode (AES ICM)
* AES-128 ICM is a deprecated alternate name for AES ICM.
*/
#define AES_128_ICM AES_ICM
/**
- * @brief SEAL 3.0
- *
+ * @brief SEAL 3.0
+ *
* SEAL is the Software-Optimized Encryption Algorithm of Coppersmith
* and Rogaway. Nota bene: this cipher is IBM proprietary.
*/
-#define SEAL 2
+#define SEAL 2
-/**
- * @brief AES Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES Cipher Block Chaining mode (AES CBC)
*
* AES CBC is the AES Cipher Block Chaining mode.
* This cipher uses a 16-, 24-, or 32-octet key.
*/
-#define AES_CBC 3
+#define AES_CBC 3
-/**
- * @brief AES-128 Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES-128 Cipher Block Chaining mode (AES CBC)
*
* AES-128 CBC is a deprecated alternate name for AES CBC.
*/
-#define AES_128_CBC AES_CBC
+#define AES_128_CBC AES_CBC
/**
* @brief Strongest available cipher.
*
* This identifier resolves to the strongest cipher type available.
*/
-#define STRONGHOLD_CIPHER AES_ICM
+#define STRONGHOLD_CIPHER AES_ICM
/**
* @}
@@ -149,14 +149,14 @@
/**
* @defgroup Authentication Authentication Function Types
- *
+ *
* @brief Each authentication function type is identified by an
* unsigned integer. The authentication function types available in
* this edition of libSRTP are given by the #defines below.
*
* An auth_type_id_t is an identifier for an authentication function type;
- * only values given by the #defines above (or those present in the
- * file crypto_types.h) should be used.
+ * only values given by the #defines above (or those present in the
+ * file crypto_types.h) should be used.
*
* The identifier STRONGHOLD_AUTH indicates the strongest available
* authentication function, allowing an application to choose the
@@ -173,8 +173,8 @@
*
* The NULL_AUTH function does nothing, and can be selected to indicate
* that authentication should not be performed.
- */
-#define NULL_AUTH 0
+ */
+#define NULL_AUTH 0
/**
* @brief UST with TMMH Version 2
@@ -184,15 +184,15 @@
* than the null cipher.
* with a cipher.
*/
-#define UST_TMMHv2 1
+#define UST_TMMHv2 1
/**
- * @brief (UST) AES-128 XORMAC
+ * @brief (UST) AES-128 XORMAC
*
* UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene:
* the XORMAC algorithm is IBM proprietary.
*/
-#define UST_AES_128_XMAC 2
+#define UST_AES_128_XMAC 2
/**
* @brief HMAC-SHA1
@@ -200,7 +200,7 @@
* HMAC_SHA1 implements the Hash-based MAC using the NIST Secure
* Hash Algorithm version 1 (SHA1).
*/
-#define HMAC_SHA1 3
+#define HMAC_SHA1 3
/**
* @brief Strongest available authentication function.
@@ -208,7 +208,7 @@
* This identifier resolves to the strongest available authentication
* function.
*/
-#define STRONGHOLD_AUTH HMAC_SHA1
+#define STRONGHOLD_AUTH HMAC_SHA1
/**
* @}
diff --git a/thirdparties/android/common/include/srtp/cryptoalg.h b/thirdparties/android/common/include/srtp/cryptoalg.h
index d9f0441..ad29fa0 100755
--- a/thirdparties/android/common/include/srtp/cryptoalg.h
+++ b/thirdparties/android/common/include/srtp/cryptoalg.h
@@ -2,31 +2,31 @@
* cryptoalg.h
*
* API for authenticated encryption crypto algorithms
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -61,10 +61,10 @@
* The function pointer cryptoalg_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated but not encrypted
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated but not encrypted
*
* @param clear_len length of data to be authenticated but not encrypted
*
@@ -79,34 +79,34 @@
* length of the ciphertext (after the call)
*
*/
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- const void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len);
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ const void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- const void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ const void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
@@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t;
int
cryptoalg_get_id(cryptoalg_t c);
-cryptoalg_t
+cryptoalg_t
cryptoalg_find_by_id(int id);
diff --git a/thirdparties/android/common/include/srtp/datatypes.h b/thirdparties/android/common/include/srtp/datatypes.h
index e16d895..314a73a 100755
--- a/thirdparties/android/common/include/srtp/datatypes.h
+++ b/thirdparties/android/common/include/srtp/datatypes.h
@@ -1,6 +1,6 @@
/*
* datatypes.h
- *
+ *
* data types for bit vectors and finite fields
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -65,31 +65,31 @@
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
-#define DATATYPES_USE_MACROS
+#define DATATYPES_USE_MACROS
typedef union {
- uint8_t v8[2];
- uint16_t value;
+ uint8_t v8[2];
+ uint16_t value;
} v16_t;
typedef union {
- uint8_t v8[4];
- uint16_t v16[2];
- uint32_t value;
+ uint8_t v8[4];
+ uint16_t v16[2];
+ uint32_t value;
} v32_t;
typedef union {
- uint8_t v8[8];
- uint16_t v16[4];
- uint32_t v32[2];
- uint64_t value;
+ uint8_t v8[8];
+ uint16_t v16[4];
+ uint32_t v32[2];
+ uint64_t value;
} v64_t;
typedef union {
- uint8_t v8[16];
- uint16_t v16[8];
- uint32_t v32[4];
- uint64_t v64[2];
+ uint8_t v8[16];
+ uint16_t v16[8];
+ uint32_t v32[4];
+ uint64_t v64[2];
} v128_t;
@@ -162,7 +162,7 @@ v128_right_shift(v128_t *x, int shift_index);
/*
* the following macros define the data manipulation functions
- *
+ *
* If DATATYPES_USE_MACROS is defined, then these macros are used
* directly (and function call overhead is avoided). Otherwise,
* the macros are used through the functions defined in datatypes.c
@@ -309,18 +309,18 @@ v128_right_shift(v128_t *x, int shift_index);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* 0 */
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -346,7 +346,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -355,10 +355,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
@@ -379,7 +379,7 @@ octet_string_set_to_zero(uint8_t *s, int len);
#ifndef SRTP_KERNEL_LINUX
-/*
+/*
* Convert big endian integers to CPU byte order.
*/
#ifdef WORDS_BIGENDIAN
@@ -395,10 +395,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
-static inline uint32_t be32_to_cpu(uint32_t v) {
- /* optimized for x86. */
- asm("bswap %0" : "=r" (v) : "0" (v));
- return v;
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ /* optimized for x86. */
+ asm("bswap %0" : "=r" (v) : "0" (v));
+ return v;
}
# else /* HAVE_X86 */
# ifdef HAVE_NETINET_IN_H
@@ -409,15 +410,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) {
# define be32_to_cpu(x) ntohl((x))
# endif /* HAVE_X86 */
-static inline uint64_t be64_to_cpu(uint64_t v) {
+static inline uint64_t be64_to_cpu(uint64_t v)
+{
# ifdef NO_64BIT_MATH
- /* use the make64 functions to do 64-bit math */
- v = make64(htonl(low32(v)),htonl(high32(v)));
+ /* use the make64 functions to do 64-bit math */
+ v = make64(htonl(low32(v)),htonl(high32(v)));
# else
- /* use the native 64-bit math */
- v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
+ /* use the native 64-bit math */
+ v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
# endif
- return v;
+ return v;
}
#endif /* ! SRTP_KERNEL_LINUX */
@@ -425,22 +427,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) {
#endif /* WORDS_BIGENDIAN */
/*
- * functions manipulating bitvector_t
+ * functions manipulating bitvector_t
*
* A bitvector_t consists of an array of words and an integer
* representing the number of significant bits stored in the array.
* The bits are packed as follows: the least significant bit is that
* of word[0], while the most significant bit is the nth most
* significant bit of word[m], where length = bits_per_word * m + n.
- *
+ *
*/
#define bits_per_word 32
#define bytes_per_word 4
typedef struct {
- uint32_t length;
- uint32_t *word;
+ uint32_t length;
+ uint32_t *word;
} bitvector_t;
diff --git a/thirdparties/android/common/include/srtp/ekt.h b/thirdparties/android/common/include/srtp/ekt.h
index b0d888b..d7f9854 100755
--- a/thirdparties/android/common/include/srtp/ekt.h
+++ b/thirdparties/android/common/include/srtp/ekt.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2005 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,12 +45,12 @@
/*
- * EKT implementation strategy
- *
+ * EKT implementation strategy
+ *
* use stream_template approach
*
* in srtp_unprotect, when a new stream appears, check if template has
- * EKT defined, and if it does, then apply EKT processing
+ * EKT defined, and if it does, then apply EKT processing
*
* question: will we want to allow key-sharing templates in addition
* to EKT templates? could define a new ssrc_type_t that's associated
@@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt);
*/
typedef struct ekt_policy_ctx_t {
- ekt_spi_t spi; /* security parameter index */
- uint8_t ekt_cipher_type;
- uint8_t *ekt_key;
- struct ekt_policy_ctx_t *next_ekt_policy;
+ ekt_spi_t spi; /* security parameter index */
+ uint8_t ekt_cipher_type;
+ uint8_t *ekt_key;
+ struct ekt_policy_ctx_t *next_ekt_policy;
} ekt_policy_ctx_t;
@@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t {
*/
typedef struct ekt_data_t {
- ekt_spi_t spi;
- uint8_t ekt_cipher_type;
- aes_expanded_key_t ekt_enc_key;
- aes_expanded_key_t ekt_dec_key;
- struct ekt_data_t *next_ekt_data;
+ ekt_spi_t spi;
+ uint8_t ekt_cipher_type;
+ aes_expanded_key_t ekt_enc_key;
+ aes_expanded_key_t ekt_dec_key;
+ struct ekt_data_t *next_ekt_data;
} ekt_data_t;
/*
@@ -116,39 +116,39 @@ typedef struct ekt_data_t {
*/
typedef struct ekt_stream_ctx_t {
- ekt_data_t *data;
- uint16_t isn; /* initial sequence number */
- uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
+ ekt_data_t *data;
+ uint16_t isn; /* initial sequence number */
+ uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
} ekt_stream_ctx_t;
-err_status_t
+err_status_t
ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy);
err_status_t
-ekt_stream_init(ekt_stream_t e,
- ekt_spi_t spi,
- void *ekt_key,
- unsigned ekt_cipher_type);
+ekt_stream_init(ekt_stream_t e,
+ ekt_spi_t spi,
+ void *ekt_key,
+ unsigned ekt_cipher_type);
err_status_t
ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p);
-
+
err_status_t
-srtp_stream_init_from_ekt(srtp_stream_t stream,
- const void *srtcp_hdr,
- unsigned pkt_octet_len);
-
+srtp_stream_init_from_ekt(srtp_stream_t stream,
+ const void *srtcp_hdr,
+ unsigned pkt_octet_len);
+
void
ekt_write_data(ekt_stream_t ekt,
- uint8_t *base_tag,
- unsigned base_tag_len,
- int *packet_len,
- xtd_seq_num_t pkt_index);
+ uint8_t *base_tag,
+ unsigned base_tag_len,
+ int *packet_len,
+ xtd_seq_num_t pkt_index);
/*
* We handle EKT by performing some additional steps before
@@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt,
*/
err_status_t
-ekt_tag_verification_preproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ekt_tag_verification_preproces(uint8_t *pkt_tag,
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
err_status_t
ekt_tag_verification_postproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
/*
@@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag,
* Master Key, the SRTP ROC, the Initial Sequence Number, and SPI
* fields. The Base Authentication Tag field is set to the all-zero
* value
- *
+ *
* When EKT is not used, this function is a no-op.
- *
+ *
*/
err_status_t
srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s,
- uint8_t *pkt_tag,
- unsigned pkt_octet_len);
+ uint8_t *pkt_tag,
+ unsigned pkt_octet_len);
/* it's not clear that a tag_generation_postprocess function is needed */
diff --git a/thirdparties/android/common/include/srtp/err.h b/thirdparties/android/common/include/srtp/err.h
index 1a6e170..9a318e5 100755
--- a/thirdparties/android/common/include/srtp/err.h
+++ b/thirdparties/android/common/include/srtp/err.h
@@ -1,32 +1,32 @@
/*
* err.h
- *
+ *
* error status codes
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,9 +50,9 @@
/**
* @defgroup Error Error Codes
- *
+ *
* Error status codes are represented by the enumeration err_status_t.
- *
+ *
* @{
*/
@@ -66,31 +66,31 @@
*
*/
typedef enum {
- err_status_ok = 0, /**< nothing to report */
- err_status_fail = 1, /**< unspecified failure */
- err_status_bad_param = 2, /**< unsupported parameter */
- err_status_alloc_fail = 3, /**< couldn't allocate memory */
- err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
- err_status_init_fail = 5, /**< couldn't initialize */
- err_status_terminus = 6, /**< can't process as much data as requested */
- err_status_auth_fail = 7, /**< authentication failure */
- err_status_cipher_fail = 8, /**< cipher failure */
- err_status_replay_fail = 9, /**< replay check failed (bad index) */
- err_status_replay_old = 10, /**< replay check failed (index too old) */
- err_status_algo_fail = 11, /**< algorithm failed test routine */
- err_status_no_such_op = 12, /**< unsupported operation */
- err_status_no_ctx = 13, /**< no appropriate context found */
- err_status_cant_check = 14, /**< unable to perform desired validation */
- err_status_key_expired = 15, /**< can't use key any more */
- err_status_socket_err = 16, /**< error in use of socket */
- err_status_signal_err = 17, /**< error in use POSIX signals */
- err_status_nonce_bad = 18, /**< nonce check failed */
- err_status_read_fail = 19, /**< couldn't read data */
- err_status_write_fail = 20, /**< couldn't write data */
- err_status_parse_err = 21, /**< error pasring data */
- err_status_encode_err = 22, /**< error encoding data */
- err_status_semaphore_err = 23,/**< error while using semaphores */
- err_status_pfkey_err = 24 /**< error while using pfkey */
+ err_status_ok = 0, /**< nothing to report */
+ err_status_fail = 1, /**< unspecified failure */
+ err_status_bad_param = 2, /**< unsupported parameter */
+ err_status_alloc_fail = 3, /**< couldn't allocate memory */
+ err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
+ err_status_init_fail = 5, /**< couldn't initialize */
+ err_status_terminus = 6, /**< can't process as much data as requested */
+ err_status_auth_fail = 7, /**< authentication failure */
+ err_status_cipher_fail = 8, /**< cipher failure */
+ err_status_replay_fail = 9, /**< replay check failed (bad index) */
+ err_status_replay_old = 10, /**< replay check failed (index too old) */
+ err_status_algo_fail = 11, /**< algorithm failed test routine */
+ err_status_no_such_op = 12, /**< unsupported operation */
+ err_status_no_ctx = 13, /**< no appropriate context found */
+ err_status_cant_check = 14, /**< unable to perform desired validation */
+ err_status_key_expired = 15, /**< can't use key any more */
+ err_status_socket_err = 16, /**< error in use of socket */
+ err_status_signal_err = 17, /**< error in use POSIX signals */
+ err_status_nonce_bad = 18, /**< nonce check failed */
+ err_status_read_fail = 19, /**< couldn't read data */
+ err_status_write_fail = 20, /**< couldn't write data */
+ err_status_parse_err = 21, /**< error pasring data */
+ err_status_encode_err = 22, /**< error encoding data */
+ err_status_semaphore_err = 23,/**< error while using semaphores */
+ err_status_pfkey_err = 24 /**< error while using pfkey */
} err_status_t;
/**
@@ -98,15 +98,15 @@ typedef enum {
*/
typedef enum {
- err_level_emergency = 0,
- err_level_alert,
- err_level_critical,
- err_level_error,
- err_level_warning,
- err_level_notice,
- err_level_info,
- err_level_debug,
- err_level_none
+ err_level_emergency = 0,
+ err_level_alert,
+ err_level_critical,
+ err_level_error,
+ err_level_warning,
+ err_level_notice,
+ err_level_info,
+ err_level_debug,
+ err_level_none
} err_reporting_level_t;
/*
@@ -144,8 +144,8 @@ err_report(int priority, char *format, ...);
*/
typedef struct {
- int on; /* 1 if debugging is on, 0 if it is off */
- char *name; /* printable name for debug module */
+ int on; /* 1 if debugging is on, 0 if it is off */
+ char *name; /* printable name for debug module */
} debug_module_t;
#ifdef ENABLE_DEBUGGING
diff --git a/thirdparties/android/common/include/srtp/getopt_s.h b/thirdparties/android/common/include/srtp/getopt_s.h
index 2a6ece3..d3dc33d 100755
--- a/thirdparties/android/common/include/srtp/getopt_s.h
+++ b/thirdparties/android/common/include/srtp/getopt_s.h
@@ -7,26 +7,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,11 +45,11 @@
#ifndef GETOPT_S_H
#define GETOPT_S_H
-/*
+/*
* getopt_s(), optarg_s, and optind_s are small, locally defined
* versions of the POSIX standard getopt() interface.
*/
-
+
int
getopt_s(int argc, char * const argv[], const char *optstring);
diff --git a/thirdparties/android/common/include/srtp/gf2_8.h b/thirdparties/android/common/include/srtp/gf2_8.h
index 098d37c..bbbabdf 100755
--- a/thirdparties/android/common/include/srtp/gf2_8.h
+++ b/thirdparties/android/common/include/srtp/gf2_8.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,13 +54,13 @@ typedef uint8_t gf2_8;
#define gf2_8_field_polynomial 0x1B
/*
- * gf2_8_shift(x) returns
+ * gf2_8_shift(x) returns
*/
/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
+ * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
+ * operation, using the field representation from AES; that is, the
+ * next gf2_8 value in the cyclic representation of that field. The
* value z should be an uint8_t.
*/
diff --git a/thirdparties/android/common/include/srtp/hmac.h b/thirdparties/android/common/include/srtp/hmac.h
index 262c0e2..77468ab 100755
--- a/thirdparties/android/common/include/srtp/hmac.h
+++ b/thirdparties/android/common/include/srtp/hmac.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,9 +50,9 @@
#include "sha1.h"
typedef struct {
- uint8_t opad[64];
- sha1_ctx_t ctx;
- sha1_ctx_t init_ctx;
+ uint8_t opad[64];
+ sha1_ctx_t ctx;
+ sha1_ctx_t init_ctx;
} hmac_ctx_t;
err_status_t
@@ -72,7 +72,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets);
err_status_t
hmac_compute(hmac_ctx_t *state, const void *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* HMAC_H */
diff --git a/thirdparties/android/common/include/srtp/integers.h b/thirdparties/android/common/include/srtp/integers.h
index 7010efd..91935eb 100755
--- a/thirdparties/android/common/include/srtp/integers.h
+++ b/thirdparties/android/common/include/srtp/integers.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -125,7 +125,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \
(((unsigned char *) (addr))[1] << 16) | \
(((unsigned char *) (addr))[2] << 8) | \
- (((unsigned char *) (addr))[3]))
+ (((unsigned char *) (addr))[3]))
#else
#define PUT_32(addr,value) \
{ \
@@ -137,7 +137,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \
(((unsigned char *) (addr))[2] << 16) | \
(((unsigned char *) (addr))[1] << 8) | \
- (((unsigned char *) (addr))[0]))
+ (((unsigned char *) (addr))[0]))
#endif // WORDS_BIGENDIAN
#else
#define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value)
diff --git a/thirdparties/android/common/include/srtp/kernel_compat.h b/thirdparties/android/common/include/srtp/kernel_compat.h
index 59d1898..36559f7 100755
--- a/thirdparties/android/common/include/srtp/kernel_compat.h
+++ b/thirdparties/android/common/include/srtp/kernel_compat.h
@@ -1,6 +1,6 @@
/*
* kernel_compat.h
- *
+ *
* Compatibility stuff for building in kernel context where standard
* C headers and library are not available.
*
@@ -8,26 +8,26 @@
* Ingate Systems AB
*/
/*
- *
+ *
* Copyright(c) 2005 Ingate Systems AB
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the author(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -70,9 +70,9 @@
static inline int rand(void)
{
- uint32_t temp;
- get_random_bytes(&temp, sizeof(temp));
- return temp % (RAND_MAX+1);
+ uint32_t temp;
+ get_random_bytes(&temp, sizeof(temp));
+ return temp % (RAND_MAX+1);
}
/* stdio/stdlib implementation. */
diff --git a/thirdparties/android/common/include/srtp/key.h b/thirdparties/android/common/include/srtp/key.h
index e7e0744..340547f 100755
--- a/thirdparties/android/common/include/srtp/key.h
+++ b/thirdparties/android/common/include/srtp/key.h
@@ -2,31 +2,31 @@
* key.h
*
* key usage limits enforcement
- *
+ *
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
typedef struct key_limit_ctx_t *key_limit_t;
typedef enum {
- key_event_normal,
- key_event_soft_limit,
- key_event_hard_limit
+ key_event_normal,
+ key_event_soft_limit,
+ key_event_hard_limit
} key_event_t;
err_status_t
@@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key);
key_event_t
key_limit_update(key_limit_t key);
-typedef enum {
- key_state_normal,
- key_state_past_soft_limit,
- key_state_expired
+typedef enum {
+ key_state_normal,
+ key_state_past_soft_limit,
+ key_state_expired
} key_state_t;
typedef struct key_limit_ctx_t {
- xtd_seq_num_t num_left;
- key_state_t state;
+ xtd_seq_num_t num_left;
+ key_state_t state;
} key_limit_ctx_t;
#endif /* KEY_H */
diff --git a/thirdparties/android/common/include/srtp/null_auth.h b/thirdparties/android/common/include/srtp/null_auth.h
index 44f9a4a..54c0296 100755
--- a/thirdparties/android/common/include/srtp/null_auth.h
+++ b/thirdparties/android/common/include/srtp/null_auth.h
@@ -7,26 +7,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#include "auth.h"
typedef struct {
- char foo;
+ char foo;
} null_auth_ctx_t;
err_status_t
@@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len);
err_status_t
null_auth_compute (null_auth_ctx_t *state, uint8_t *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* NULL_AUTH_H */
diff --git a/thirdparties/android/common/include/srtp/null_cipher.h b/thirdparties/android/common/include/srtp/null_cipher.h
index 39da59a..63d272d 100755
--- a/thirdparties/android/common/include/srtp/null_cipher.h
+++ b/thirdparties/android/common/include/srtp/null_cipher.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,7 +52,7 @@
#include "cipher.h"
typedef struct {
- char foo ;/* empty, for now */
+ char foo ;/* empty, for now */
} null_cipher_ctx_t;
@@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len);
err_status_t
null_cipher_set_segment(null_cipher_ctx_t *c,
- unsigned long segment_index);
+ unsigned long segment_index);
err_status_t
null_cipher_encrypt(null_cipher_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
null_cipher_encrypt_aligned(null_cipher_ctx_t *c,
- unsigned char *buf, int bytes_to_encr);
+ unsigned char *buf, int bytes_to_encr);
#endif /* NULL_CIPHER_H */
diff --git a/thirdparties/android/common/include/srtp/prng.h b/thirdparties/android/common/include/srtp/prng.h
index fb96b5e..148b07a 100755
--- a/thirdparties/android/common/include/srtp/prng.h
+++ b/thirdparties/android/common/include/srtp/prng.h
@@ -21,10 +21,10 @@
*/
typedef struct {
- v128_t state; /* state data */
- aes_expanded_key_t key; /* secret key */
- uint32_t octet_count; /* number of octets output since last init */
- rand_source_func_t rand; /* random source for re-initialization */
+ v128_t state; /* state data */
+ aes_expanded_key_t key; /* secret key */
+ uint32_t octet_count; /* number of octets output since last init */
+ rand_source_func_t rand; /* random source for re-initialization */
} x917_prng_t;
err_status_t
@@ -39,9 +39,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
*/
typedef struct {
- uint32_t octet_count; /* number of octets output since last init */
- aes_icm_ctx_t state; /* state data */
- rand_source_func_t rand; /* random source for re-initialization */
+ uint32_t octet_count; /* number of octets output since last init */
+ aes_icm_ctx_t state; /* state data */
+ rand_source_func_t rand; /* random source for re-initialization */
} ctr_prng_t;
err_status_t
diff --git a/thirdparties/android/common/include/srtp/rand_source.h b/thirdparties/android/common/include/srtp/rand_source.h
index b4c2110..d2e52ce 100755
--- a/thirdparties/android/common/include/srtp/rand_source.h
+++ b/thirdparties/android/common/include/srtp/rand_source.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -60,7 +60,7 @@ rand_source_init(void);
* and returns an error code. This error code should be checked,
* and if a failure is reported, the data in the buffer MUST NOT
* be used.
- *
+ *
* warning: If the return code is not checked, then non-random
* data may inadvertently be used.
*
@@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length);
err_status_t
rand_source_deinit(void);
-/*
+/*
* function prototype for a random source function
*
* A rand_source_func_t writes num_octets at the location indicated by
@@ -86,6 +86,6 @@ rand_source_deinit(void);
*/
typedef err_status_t (*rand_source_func_t)
- (void *dest, uint32_t num_octets);
+(void *dest, uint32_t num_octets);
#endif /* RAND_SOURCE */
diff --git a/thirdparties/android/common/include/srtp/rdb.h b/thirdparties/android/common/include/srtp/rdb.h
index 2ccb144..2432fae 100755
--- a/thirdparties/android/common/include/srtp/rdb.h
+++ b/thirdparties/android/common/include/srtp/rdb.h
@@ -21,11 +21,11 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
} rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8*sizeof(v128_t))
/*
* rdb init
@@ -49,7 +49,7 @@ rdb_init(rdb_t *rdb);
*/
err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+rdb_check(const rdb_t *rdb, uint32_t rdb_index);
/*
* rdb_add_index
@@ -64,18 +64,18 @@ err_status_t
rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions rdb_increment() and rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
* rdb_t upon which rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
+ *
* err_status_ok no problem
* err_status_key_expired sequence number too high
*
@@ -91,4 +91,4 @@ uint32_t
rdb_get_value(const rdb_t *rdb);
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
diff --git a/thirdparties/android/common/include/srtp/rdbx.h b/thirdparties/android/common/include/srtp/rdbx.h
index 146fb42..88055c2 100755
--- a/thirdparties/android/common/include/srtp/rdbx.h
+++ b/thirdparties/android/common/include/srtp/rdbx.h
@@ -14,7 +14,7 @@
#include "datatypes.h"
#include "err.h"
-/* #define ROC_TEST */
+/* #define ROC_TEST */
#ifndef ROC_TEST
@@ -33,7 +33,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
- * sequence number.
+ * sequence number.
*/
typedef uint64_t xtd_seq_num_t;
@@ -45,8 +45,8 @@ typedef uint64_t xtd_seq_num_t;
*/
typedef struct {
- xtd_seq_num_t index;
- bitvector_t bitmask;
+ xtd_seq_num_t index;
+ bitvector_t bitmask;
} rdbx_t;
@@ -73,7 +73,7 @@ rdbx_dealloc(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
- *
+ *
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
@@ -82,8 +82,8 @@ rdbx_dealloc(rdbx_t *rdbx);
int
rdbx_estimate_index(const rdbx_t *rdbx,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
@@ -98,7 +98,7 @@ rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
- *
+ *
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
@@ -116,7 +116,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta);
* to have the rollover counter value roc. If that value is less than
* the current rollover counter value, then the function returns
* err_status_replay_old; otherwise, err_status_ok is returned.
- *
+ *
*/
err_status_t
@@ -125,7 +125,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc);
/*
* rdbx_get_roc(rdbx) returns the value of the rollover counter for
* the rdbx_t pointed to by rdbx
- *
+ *
*/
xtd_seq_num_t
@@ -160,7 +160,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
- *
+ *
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
@@ -170,8 +170,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
int
index_guess(const xtd_seq_num_t *local,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
#endif /* RDBX_H */
diff --git a/thirdparties/android/common/include/srtp/rtp.h b/thirdparties/android/common/include/srtp/rtp.h
index 0e0119c..9b97ab6 100755
--- a/thirdparties/android/common/include/srtp/rtp.h
+++ b/thirdparties/android/common/include/srtp/rtp.h
@@ -1,6 +1,6 @@
/*
* rtp.h
- *
+ *
* rtp interface for srtp reference implementation
*
* David A. McGrew
@@ -15,26 +15,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -73,12 +73,12 @@ int
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
int
-rtp_receiver_init(rtp_receiver_t rcvr, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_receiver_init(rtp_receiver_t rcvr, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
int
-rtp_sender_init(rtp_sender_t sender, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_sender_init(rtp_sender_t sender, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
/*
* srtp_sender_init(...) initializes an rtp_sender_t
@@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
@@ -112,13 +112,13 @@ int
rtp_receiver_deinit_srtp(rtp_receiver_t sender);
-rtp_sender_t
+rtp_sender_t
rtp_sender_alloc(void);
void
rtp_sender_dealloc(rtp_sender_t rtp_ctx);
-rtp_receiver_t
+rtp_receiver_t
rtp_receiver_alloc(void);
void
@@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
*/
#define RTP_HEADER_LEN 12
-/*
+/*
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
*/
#define RTP_MAX_BUF_LEN 16384
diff --git a/thirdparties/android/common/include/srtp/rtp_priv.h b/thirdparties/android/common/include/srtp/rtp_priv.h
index 1421386..088cdbe 100755
--- a/thirdparties/android/common/include/srtp/rtp_priv.h
+++ b/thirdparties/android/common/include/srtp/rtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,22 +52,22 @@
typedef srtp_hdr_t rtp_hdr_t;
typedef struct {
- srtp_hdr_t header;
- char body[RTP_MAX_BUF_LEN];
+ srtp_hdr_t header;
+ char body[RTP_MAX_BUF_LEN];
} rtp_msg_t;
typedef struct rtp_sender_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* reciever's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* reciever's address */
} rtp_sender_ctx_t;
typedef struct rtp_receiver_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* receiver's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* receiver's address */
} rtp_receiver_ctx_t;
diff --git a/thirdparties/android/common/include/srtp/sha1.h b/thirdparties/android/common/include/srtp/sha1.h
index e3af4d4..65ecee4 100755
--- a/thirdparties/android/common/include/srtp/sha1.h
+++ b/thirdparties/android/common/include/srtp/sha1.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,17 +51,17 @@
#include "datatypes.h"
typedef struct {
- uint32_t H[5]; /* state vector */
- uint32_t M[16]; /* message buffer */
- int octets_in_buffer; /* octets of message in buffer */
- uint32_t num_bits_in_msg; /* total number of bits in message */
+ uint32_t H[5]; /* state vector */
+ uint32_t M[16]; /* message buffer */
+ int octets_in_buffer; /* octets of message in buffer */
+ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/*
* sha1(&ctx, msg, len, output) hashes the len octets starting at msg
* into the SHA1 context, then writes the result to the 20 octets at
* output
- *
+ *
*/
void
@@ -69,10 +69,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/*
* sha1_init(&ctx) initializes the SHA1 context ctx
- *
+ *
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
- *
+ *
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
@@ -90,7 +90,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
- * setup algorithm.
+ * setup algorithm.
*/
/*
@@ -104,5 +104,5 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
-
+
#endif /* SHA1_H */
diff --git a/thirdparties/android/common/include/srtp/srtp.h b/thirdparties/android/common/include/srtp/srtp.h
index b4d48d1..1b9ffb2 100755
--- a/thirdparties/android/common/include/srtp/srtp.h
+++ b/thirdparties/android/common/include/srtp/srtp.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,7 +50,7 @@
extern "C" {
#endif
-#include "crypto_kernel.h"
+#include "crypto_kernel.h"
/**
* @defgroup SRTP Secure RTP
@@ -76,7 +76,7 @@ extern "C" {
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
-#define SRTP_MAX_TAG_LEN 12
+#define SRTP_MAX_TAG_LEN 12
/**
* SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer
@@ -86,85 +86,86 @@ extern "C" {
*
* @brief the maximum number of octets added by srtp_protect().
*/
-#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
+#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
-/*
+/*
* nota bene: since libSRTP doesn't support the use of the MKI, the
* SRTP_MAX_TRAILER_LEN value is just the maximum tag length
*/
/**
- * @brief sec_serv_t describes a set of security services.
+ * @brief sec_serv_t describes a set of security services.
*
* A sec_serv_t enumeration is used to describe the particular
* security services that will be applied by a particular crypto
- * policy (or other mechanism).
+ * policy (or other mechanism).
*/
typedef enum {
- sec_serv_none = 0, /**< no services */
- sec_serv_conf = 1, /**< confidentiality */
- sec_serv_auth = 2, /**< authentication */
- sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
-} sec_serv_t;
+ sec_serv_none = 0, /**< no services */
+ sec_serv_conf = 1, /**< confidentiality */
+ sec_serv_auth = 2, /**< authentication */
+ sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
+}
+sec_serv_t;
-/**
+/**
* @brief crypto_policy_t describes a particular crypto policy that
* can be applied to an SRTP stream.
*
* A crypto_policy_t describes a particular cryptographic policy that
* can be applied to an SRTP or SRTCP stream. An SRTP session policy
- * consists of a list of these policies, one for each SRTP stream
+ * consists of a list of these policies, one for each SRTP stream
* in the session.
*/
typedef struct crypto_policy_t {
- cipher_type_id_t cipher_type; /**< An integer representing
+ cipher_type_id_t cipher_type; /**< An integer representing
* the type of cipher. */
- int cipher_key_len; /**< The length of the cipher key
+ int cipher_key_len; /**< The length of the cipher key
* in octets. */
- auth_type_id_t auth_type; /**< An integer representing the
+ auth_type_id_t auth_type; /**< An integer representing the
* authentication function. */
- int auth_key_len; /**< The length of the authentication
+ int auth_key_len; /**< The length of the authentication
* function key in octets. */
- int auth_tag_len; /**< The length of the authentication
+ int auth_tag_len; /**< The length of the authentication
* tag in octets. */
- sec_serv_t sec_serv; /**< The flag indicating the security
+ sec_serv_t sec_serv; /**< The flag indicating the security
* services to be applied. */
} crypto_policy_t;
-/**
+/**
* @brief ssrc_type_t describes the type of an SSRC.
- *
+ *
* An ssrc_type_t enumeration is used to indicate a type of SSRC. See
* @ref srtp_policy_t for more informataion.
*/
-typedef enum {
- ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
- ssrc_specific = 1, /**< Indicates a specific SSRC value */
- ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
+typedef enum {
+ ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
+ ssrc_specific = 1, /**< Indicates a specific SSRC value */
+ ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
(i.e. a value that is used in the
function srtp_unprotect()) */
- ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
- (i.e. a value that is used in the
+ ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
+ (i.e. a value that is used in the
function srtp_protect()) */
} ssrc_type_t;
/**
* @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
- *
+ *
* An ssrc_t represents a particular SSRC value (if its type is
* ssrc_specific), or a wildcard SSRC value that will match all
* outbound SSRCs (if its type is ssrc_any_outbound) or all inbound
- * SSRCs (if its type is ssrc_any_inbound).
+ * SSRCs (if its type is ssrc_any_inbound).
*
*/
-typedef struct {
- ssrc_type_t type; /**< The type of this particular SSRC */
- unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
+typedef struct {
+ ssrc_type_t type; /**< The type of this particular SSRC */
+ unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
} ssrc_t;
@@ -180,8 +181,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t;
typedef struct ekt_stream_ctx_t *ekt_stream_t;
-/**
- * @brief represents the policy for an SRTP session.
+/**
+ * @brief represents the policy for an SRTP session.
*
* A single srtp_policy_t struct represents the policy for a single
* SRTP stream, and a linked list of these elements represents the
@@ -190,7 +191,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* master key for that stream, the SSRC describing that stream, or a
* flag indicating a `wildcard' SSRC value, and a `next' field that
* holds a pointer to the next element in the list of policy elements,
- * or NULL if it is the last element.
+ * or NULL if it is the last element.
*
* The wildcard value SSRC_ANY_INBOUND matches any SSRC from an
* inbound stream that for which there is no explicit SSRC entry in
@@ -201,33 +202,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* is intentional, and it allows libSRTP to ensure that no security
* lapses result from accidental re-use of SSRC values during key
* sharing.
- *
- *
+ *
+ *
* @warning The final element of the list @b must have its `next' pointer
* set to NULL.
*/
typedef struct srtp_policy_t {
- ssrc_t ssrc; /**< The SSRC value of stream, or the
- * flags SSRC_ANY_INBOUND or
+ ssrc_t ssrc; /**< The SSRC value of stream, or the
+ * flags SSRC_ANY_INBOUND or
* SSRC_ANY_OUTBOUND if key sharing
* is used for this policy element.
*/
- crypto_policy_t rtp; /**< SRTP crypto policy. */
- crypto_policy_t rtcp; /**< SRTCP crypto policy. */
- unsigned char *key; /**< Pointer to the SRTP master key for
+ crypto_policy_t rtp; /**< SRTP crypto policy. */
+ crypto_policy_t rtcp; /**< SRTCP crypto policy. */
+ unsigned char *key; /**< Pointer to the SRTP master key for
* this stream. */
- ekt_policy_t ekt; /**< Pointer to the EKT policy structure
- * for this stream (if any) */
- unsigned long window_size; /**< The window size to use for replay
+ ekt_policy_t ekt; /**< Pointer to the EKT policy structure
+ * for this stream (if any) */
+ unsigned long window_size; /**< The window size to use for replay
* protection. */
- int allow_repeat_tx; /**< Whether retransmissions of
+ int allow_repeat_tx; /**< Whether retransmissions of
* packets with the same sequence number
* are allowed. (Note that such repeated
* transmissions must have the same RTP
* payload, or a severe security weakness
* is introduced!) */
- struct srtp_policy_t *next; /**< Pointer to next stream policy. */
+ struct srtp_policy_t *next; /**< Pointer to next stream policy. */
} srtp_policy_t;
@@ -237,7 +238,7 @@ typedef struct srtp_policy_t {
* @brief An srtp_t points to an SRTP session structure.
*
* The typedef srtp_t is a pointer to a structure that represents
- * an SRTP session. This datatype is intentially opaque in
+ * an SRTP session. This datatype is intentially opaque in
* order to separate the interface from the implementation.
*
* An SRTP session consists of all of the traffic sent to the RTP and
@@ -254,11 +255,11 @@ typedef struct srtp_ctx_t *srtp_t;
*
* The typedef srtp_stream_t is a pointer to a structure that
* represents an SRTP stream. This datatype is intentionally
- * opaque in order to separate the interface from the implementation.
- *
+ * opaque in order to separate the interface from the implementation.
+ *
* An SRTP stream consists of all of the traffic sent to an SRTP
* session by a single participant. A session can be viewed as
- * a set of streams.
+ * a set of streams.
*
*/
typedef struct srtp_stream_ctx_t *srtp_stream_t;
@@ -266,7 +267,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t;
/**
- * @brief srtp_init() initializes the srtp library.
+ * @brief srtp_init() initializes the srtp library.
*
* @warning This function @b must be called before any other srtp
* functions.
@@ -287,14 +288,14 @@ srtp_shutdown(void);
/**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
- *
+ *
* The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP
* protection to the RTP packet rtp_hdr (which has length *len_ptr) using
* the SRTP context ctx. If err_status_ok is returned, then rtp_hdr
* points to the resulting SRTP packet and *len_ptr is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
- *
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
@@ -304,11 +305,11 @@ srtp_shutdown(void);
* packet, and assumes that the RTP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
- * into the location in memory immediately following the RTP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
+ * into the location in memory immediately following the RTP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtp_hdr is a pointer to the RTP packet (before the call); after
@@ -319,7 +320,7 @@ srtp_shutdown(void);
* complete SRTP packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok no problems
* - err_status_replay_fail rtp sequence number was non-increasing
* - @e other failure in cryptographic mechanisms
@@ -327,7 +328,7 @@ srtp_shutdown(void);
err_status_t
srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
-
+
/**
* @brief srtp_unprotect() is the Secure RTP receiver-side packet
* processing function.
@@ -338,12 +339,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* err_status_ok is returned, then srtp_hdr points to the resulting
* RTP packet and *len_ptr is the number of octets in that packet;
* otherwise, no assumptions should be made about the value of either
- * data elements.
- *
+ * data elements.
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
- *
+ *
* @warning This function assumes that the SRTP packet is aligned on a
* 32-bit boundary.
*
@@ -360,9 +361,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* complete rtp packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTP packet is valid.
- * - err_status_auth_fail if the SRTP packet failed the message
+ * - err_status_auth_fail if the SRTP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has
* already been processed and accepted).
@@ -382,14 +383,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
* key.
*
* @param session is the SRTP session to which the policy is to be added.
- *
+ *
* @param policy is the srtp_policy_t struct that describes the policy
* for the session. The struct may be a single element, or it may be
* the head of a list, in which case each element of the list is
* processed. It may also be NULL, in which case streams should be added
* later using srtp_add_stream(). The final element of the list @b must
* have its `next' field set to NULL.
- *
+ *
* @return
* - err_status_ok if creation succeded.
* - err_status_alloc_fail if allocation failed.
@@ -403,7 +404,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
/**
* @brief srtp_add_stream() allocates and initializes an SRTP stream
* within a given SRTP session.
- *
+ *
* The function call srtp_add_stream(session, policy) allocates and
* initializes a new SRTP stream within a given, previously created
* session, applying the policy given as the other argument to that
@@ -416,13 +417,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
*/
err_status_t
-srtp_add_stream(srtp_t session,
- const srtp_policy_t *policy);
+srtp_add_stream(srtp_t session,
+ const srtp_policy_t *policy);
/**
* @brief srtp_remove_stream() deallocates an SRTP stream.
- *
+ *
* The function call srtp_remove_stream(session, ssrc) removes
* the SRTP stream with the SSRC value ssrc from the SRTP session
* context given by the argument session.
@@ -434,7 +435,7 @@ srtp_add_stream(srtp_t session,
*
* @warning Wildcard SSRC values cannot be removed from a
* session.
- *
+ *
* @return
* - err_status_ok if the stream deallocation succeded.
* - [other] otherwise.
@@ -448,8 +449,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* @brief crypto_policy_set_rtp_default() sets a crypto policy
* structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTP
* protection, as defined in the specification. This function is a
@@ -458,9 +459,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -470,8 +471,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* @brief crypto_policy_set_rtcp_default() sets a crypto policy
* structure to the SRTP default policy for RTCP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTCP
* protection, as defined in the specification. This function is a
@@ -480,9 +481,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -492,15 +493,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto
* policy structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a
* synonym for crypto_policy_set_rtp_default(). It conforms to the
* naming convention used in RFC 4568 (SDP Security Descriptions for
* Media Streams).
- *
+ *
* @return void.
- *
+ *
*/
#define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p)
@@ -510,8 +511,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto
* policy structure to a short-authentication tag policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568.
@@ -521,7 +522,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -534,7 +535,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -546,14 +547,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto
* policy structure to an encryption-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Counter Mode), but to use no authentication method. This
* policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5
* of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -565,7 +566,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -576,14 +577,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto
* policy structure to an authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80
* bit authentication tag to provide message authentication, but to
* use no encryption. This policy is NOT RECOMMENDED for SRTP unless
- * there is a requirement to forego encryption.
- *
+ * there is a requirement to forego encryption.
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -591,10 +592,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @warning This policy is NOT RECOMMENDED for SRTP unless there is a
- * requirement to forego encryption.
+ * requirement to forego encryption.
*
* @return void.
- *
+ *
*/
void
@@ -603,18 +604,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
/**
* @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto
- * policy structure to a encryption and authentication policy using AES-256
+ * policy structure to a encryption and authentication policy using AES-256
* for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_80 as defined in
* draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256
* Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit
* authentication tag.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -622,7 +623,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
@@ -633,8 +634,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* policy structure to a short-authentication tag policy using AES-256
* encryption.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_32 as defined in
@@ -644,7 +645,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -657,7 +658,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -667,7 +668,7 @@ crypto_policy_set_aes_cm_256_hmac_sha1_32(crypto_policy_t *p);
/**
* @brief srtp_dealloc() deallocates storage for an SRTP session
* context.
- *
+ *
* The function call srtp_dealloc(s) deallocates storage for the
* SRTP session context s. This function should be called no more
* than one time for each of the contexts allocated by the function
@@ -685,7 +686,7 @@ srtp_dealloc(srtp_t s);
/*
- * @brief identifies a particular SRTP profile
+ * @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters). These
@@ -693,13 +694,13 @@ srtp_dealloc(srtp_t s);
*/
typedef enum {
- srtp_profile_reserved = 0,
- srtp_profile_aes128_cm_sha1_80 = 1,
- srtp_profile_aes128_cm_sha1_32 = 2,
- srtp_profile_aes256_cm_sha1_80 = 3,
- srtp_profile_aes256_cm_sha1_32 = 4,
- srtp_profile_null_sha1_80 = 5,
- srtp_profile_null_sha1_32 = 6,
+ srtp_profile_reserved = 0,
+ srtp_profile_aes128_cm_sha1_80 = 1,
+ srtp_profile_aes128_cm_sha1_32 = 2,
+ srtp_profile_aes256_cm_sha1_80 = 3,
+ srtp_profile_aes256_cm_sha1_32 = 4,
+ srtp_profile_null_sha1_80 = 5,
+ srtp_profile_null_sha1_32 = 6,
} srtp_profile_t;
@@ -707,26 +708,26 @@ typedef enum {
* @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy
* structure to the appropriate value for RTP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
+ srtp_profile_t profile);
@@ -735,26 +736,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
* @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy
* structure to the appropriate value for RTCP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTCP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
+ srtp_profile_t profile);
/**
* @brief returns the master key length for a given SRTP profile
@@ -772,18 +773,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile);
/**
* @brief appends the salt to the key
*
- * The function call append_salt_to_key(k, klen, s, slen)
+ * The function call append_salt_to_key(k, klen, s, slen)
* copies the string s to the location at klen bytes following
- * the location k.
+ * the location k.
*
* @warning There must be at least bytes_in_salt + bytes_in_key bytes
* available at the location pointed to by key.
- *
+ *
*/
void
append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
- unsigned char *salt, unsigned int bytes_in_salt);
+ unsigned char *salt, unsigned int bytes_in_salt);
@@ -795,7 +796,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
/**
* @defgroup SRTCP Secure RTCP
- * @ingroup SRTP
+ * @ingroup SRTP
*
* @brief Secure RTCP functions are used to protect RTCP traffic.
*
@@ -803,36 +804,36 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* traffic in much the same way as it does RTP traffic. The function
* srtp_protect_rtcp() applies cryptographic protections to outbound
* RTCP packets, and srtp_unprotect_rtcp() verifies the protections on
- * inbound RTCP packets.
+ * inbound RTCP packets.
*
* A note on the naming convention: srtp_protect_rtcp() has an srtp_t
* as its first argument, and thus has `srtp_' as its prefix. The
- * trailing `_rtcp' indicates the protocol on which it acts.
- *
+ * trailing `_rtcp' indicates the protocol on which it acts.
+ *
* @{
*/
/**
* @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet
* processing function.
- *
+ *
* The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies
* SRTCP protection to the RTCP packet rtcp_hdr (which has length
* *len_ptr) using the SRTP session context ctx. If err_status_ok is
* returned, then rtp_hdr points to the resulting SRTCP packet and
* *len_ptr is the number of octets in that packet; otherwise, no
* assumptions should be made about the value of either data elements.
- *
+ *
* @warning This function assumes that it can write the authentication
* tag into the location in memory immediately following the RTCP
* packet, and assumes that the RTCP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
- * into the location in memory immediately following the RTCP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
+ * into the location in memory immediately following the RTCP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTCP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtcp_hdr is a pointer to the RTCP packet (before the call); after
@@ -844,14 +845,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* was returned. Otherwise, the value of the data to which it points
* is undefined.
*
- * @return
+ * @return
* - err_status_ok if there were no problems.
- * - [other] if there was a failure in
+ * - [other] if there was a failure in
* the cryptographic mechanisms.
*/
-
-err_status_t
+
+err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
/**
@@ -865,7 +866,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* to the resulting RTCP packet and *len_ptr is the number of octets
* in that packet; otherwise, no assumptions should be made about the
* value of either data elements.
- *
+ *
* @warning This function assumes that the SRTCP packet is aligned on a
* 32-bit boundary.
*
@@ -883,9 +884,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* returned. Otherwise, the value of the data to which it points is
* undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTCP packet is valid.
- * - err_status_auth_fail if the SRTCP packet failed the message
+ * - err_status_auth_fail if the SRTCP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTCP packet is a replay (e.g. has
* already been processed and accepted).
@@ -893,7 +894,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
*
*/
-err_status_t
+err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
/**
@@ -904,10 +905,10 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @defgroup SRTPevents SRTP events and callbacks
* @ingroup SRTP
*
- * @brief libSRTP can use a user-provided callback function to
+ * @brief libSRTP can use a user-provided callback function to
* handle events.
*
- *
+ *
* libSRTP allows a user to provide a callback function to handle
* events that need to be dealt with outside of the data plane (see
* the enum srtp_event_t for a description of these events). Dealing
@@ -928,8 +929,8 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @brief srtp_event_t defines events that need to be handled
*
* The enum srtp_event_t defines events that need to be handled
- * outside the `data plane', such as SSRC collisions and
- * key expirations.
+ * outside the `data plane', such as SSRC collisions and
+ * key expirations.
*
* When a key expires or the maximum number of packets has been
* reached, an SRTP stream will enter an `expired' state in which no
@@ -942,33 +943,33 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* latter case, all of the streams in the session will expire.
*/
-typedef enum {
- event_ssrc_collision, /**<
- * An SSRC collision occured.
+typedef enum {
+ event_ssrc_collision, /**<
+ * An SSRC collision occured.
*/
- event_key_soft_limit, /**< An SRTP stream reached the soft key
- * usage limit and will expire soon.
+ event_key_soft_limit, /**< An SRTP stream reached the soft key
+ * usage limit and will expire soon.
*/
- event_key_hard_limit, /**< An SRTP stream reached the hard
+ event_key_hard_limit, /**< An SRTP stream reached the hard
* key usage limit and has expired.
*/
- event_packet_index_limit /**< An SRTP stream reached the hard
- * packet limit (2^48 packets).
+ event_packet_index_limit /**< An SRTP stream reached the hard
+ * packet limit (2^48 packets).
*/
} srtp_event_t;
/**
- * @brief srtp_event_data_t is the structure passed as a callback to
+ * @brief srtp_event_data_t is the structure passed as a callback to
* the event handler function
*
* The struct srtp_event_data_t holds the data passed to the event
- * handler function.
+ * handler function.
*/
typedef struct srtp_event_data_t {
- srtp_t session; /**< The session in which the event happend. */
- srtp_stream_t stream; /**< The stream in which the event happend. */
- srtp_event_t event; /**< An enum indicating the type of event. */
+ srtp_t session; /**< The session in which the event happend. */
+ srtp_stream_t stream; /**< The stream in which the event happend. */
+ srtp_event_t event; /**< An enum indicating the type of event. */
} srtp_event_data_t;
/**
@@ -986,7 +987,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data);
/**
* @brief sets the event handler to the function supplied by the caller.
- *
+ *
* The function call srtp_install_event_handler(func) sets the event
* handler function to the value func. The value NULL is acceptable
* as an argument; in this case, events will be ignored rather than
diff --git a/thirdparties/android/common/include/srtp/srtp_priv.h b/thirdparties/android/common/include/srtp/srtp_priv.h
index cf2274e..997a115 100755
--- a/thirdparties/android/common/include/srtp/srtp_priv.h
+++ b/thirdparties/android/common/include/srtp/srtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,56 +54,56 @@
* an srtp_hdr_t represents the srtp header
*
* in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
- *
+ *
* (note that this definition follows that of RFC 1889 Appendix A, but
* is not identical)
*/
-
+
#ifndef WORDS_BIGENDIAN
/*
* srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
- * this structure should be declared "unsigned int" instead of
+ * this structure should be declared "unsigned int" instead of
* "unsigned char", but doing so causes the MS compiler to not
* fully pack the bit fields.
*/
typedef struct {
- unsigned char cc:4; /* CSRC count */
- unsigned char x:1; /* header extension flag */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:7; /* payload type */
- unsigned char m:1; /* marker bit */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char x:1; /* header extension flag */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:7; /* payload type */
+ unsigned char m:1; /* marker bit */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char x:1; /* header extension flag */
- unsigned char cc:4; /* CSRC count */
- unsigned char m:1; /* marker bit */
- unsigned pt:7; /* payload type */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char x:1; /* header extension flag */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char m:1; /* marker bit */
+ unsigned pt:7; /* payload type */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#endif
typedef struct {
- uint16_t profile_specific; /* profile-specific info */
- uint16_t length; /* number of 32-bit words in extension */
+ uint16_t profile_specific; /* profile-specific info */
+ uint16_t length; /* number of 32-bit words in extension */
} srtp_hdr_xtnd_t;
/*
- * srtcp_hdr_t represents a secure rtcp header
+ * srtcp_hdr_t represents a secure rtcp header
*
* in this implementation, an srtcp header is assumed to be 32-bit
* alinged
@@ -112,53 +112,53 @@ typedef struct {
#ifndef WORDS_BIGENDIAN
typedef struct {
- unsigned char rc:5; /* reception report count */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char rc:5; /* reception report count */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int index:31; /* srtcp packet index in network order! */
- unsigned int e:1; /* encrypted? 1=yes */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int index:31; /* srtcp packet index in network order! */
+ unsigned int e:1; /* encrypted? 1=yes */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char rc:5; /* reception report count */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char rc:5; /* reception report count */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int version:2; /* protocol version */
- unsigned int p:1; /* padding flag */
- unsigned int count:5; /* varies by packet type */
- unsigned int pt:8; /* payload type */
- uint16_t length; /* len of uint32s of packet less header */
+ unsigned int version:2; /* protocol version */
+ unsigned int p:1; /* padding flag */
+ unsigned int count:5; /* varies by packet type */
+ unsigned int pt:8; /* payload type */
+ uint16_t length; /* len of uint32s of packet less header */
} rtcp_common_t;
typedef struct {
- unsigned int e:1; /* encrypted? 1=yes */
- unsigned int index:31; /* srtcp packet index */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int e:1; /* encrypted? 1=yes */
+ unsigned int index:31; /* srtcp packet index */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#endif
/*
- * the following declarations are libSRTP internal functions
+ * the following declarations are libSRTP internal functions
*/
/*
@@ -166,7 +166,7 @@ typedef struct {
* to ssrc, or NULL if no stream exists for that ssrc
*/
-srtp_stream_t
+srtp_stream_t
srtp_get_stream(srtp_t srtp, uint32_t ssrc);
@@ -180,47 +180,47 @@ err_status_t
srtp_stream_init_keys(srtp_stream_t srtp, const void *key);
/*
- * srtp_stream_init(s, p) initializes the srtp_stream_t s to
+ * srtp_stream_init(s, p) initializes the srtp_stream_t s to
* use the policy at the location p
*/
err_status_t
-srtp_stream_init(srtp_stream_t srtp,
- const srtp_policy_t *p);
+srtp_stream_init(srtp_stream_t srtp,
+ const srtp_policy_t *p);
/*
- * libsrtp internal datatypes
+ * libsrtp internal datatypes
*/
-typedef enum direction_t {
- dir_unknown = 0,
- dir_srtp_sender = 1,
- dir_srtp_receiver = 2
+typedef enum direction_t {
+ dir_unknown = 0,
+ dir_srtp_sender = 1,
+ dir_srtp_receiver = 2
} direction_t;
-/*
+/*
* an srtp_stream_t has its own SSRC, encryption key, authentication
* key, sequence number, and replay database
- *
+ *
* note that the keys might not actually be unique, in which case the
* cipher_t and auth_t pointers will point to the same structures
*/
typedef struct srtp_stream_ctx_t {
- uint32_t ssrc;
- cipher_t *rtp_cipher;
- auth_t *rtp_auth;
- rdbx_t rtp_rdbx;
- sec_serv_t rtp_services;
- cipher_t *rtcp_cipher;
- auth_t *rtcp_auth;
- rdb_t rtcp_rdb;
- sec_serv_t rtcp_services;
- key_limit_ctx_t *limit;
- direction_t direction;
- int allow_repeat_tx;
- ekt_stream_t ekt;
- struct srtp_stream_ctx_t *next; /* linked list of streams */
+ uint32_t ssrc;
+ cipher_t *rtp_cipher;
+ auth_t *rtp_auth;
+ rdbx_t rtp_rdbx;
+ sec_serv_t rtp_services;
+ cipher_t *rtcp_cipher;
+ auth_t *rtcp_auth;
+ rdb_t rtcp_rdb;
+ sec_serv_t rtcp_services;
+ key_limit_ctx_t *limit;
+ direction_t direction;
+ int allow_repeat_tx;
+ ekt_stream_t ekt;
+ struct srtp_stream_ctx_t *next; /* linked list of streams */
} srtp_stream_ctx_t;
@@ -229,8 +229,8 @@ typedef struct srtp_stream_ctx_t {
*/
typedef struct srtp_ctx_t {
- srtp_stream_ctx_t *stream_list; /* linked list of streams */
- srtp_stream_ctx_t *stream_template; /* act as template for other streams */
+ srtp_stream_ctx_t *stream_list; /* linked list of streams */
+ srtp_stream_ctx_t *stream_template; /* act as template for other streams */
} srtp_ctx_t;
@@ -239,7 +239,7 @@ typedef struct srtp_ctx_t {
* srtp_handle_event(srtp, srtm, evnt) calls the event handling
* function, if there is one.
*
- * This macro is not included in the documentation as it is
+ * This macro is not included in the documentation as it is
* an internal-only function.
*/
@@ -250,7 +250,7 @@ typedef struct srtp_ctx_t {
data.stream = strm; \
data.event = evnt; \
srtp_event_handler(&data); \
-}
+}
#endif /* SRTP_PRIV_H */
diff --git a/thirdparties/android/common/include/srtp/stat.h b/thirdparties/android/common/include/srtp/stat.h
index e28b131..a67a380 100755
--- a/thirdparties/android/common/include/srtp/stat.h
+++ b/thirdparties/android/common/include/srtp/stat.h
@@ -1,6 +1,6 @@
/*
* stats.h
- *
+ *
* interface to statistical test functions
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright(c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/android/common/include/srtp/ut_sim.h b/thirdparties/android/common/include/srtp/ut_sim.h
index c25feeb..bd7d015 100755
--- a/thirdparties/android/common/include/srtp/ut_sim.h
+++ b/thirdparties/android/common/include/srtp/ut_sim.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,12 +54,12 @@
#define UT_BUF 160 /* maximum amount of packet reorder */
typedef struct {
- uint32_t index;
- uint32_t buffer[UT_BUF];
+ uint32_t index;
+ uint32_t buffer[UT_BUF];
} ut_connection;
/*
- * ut_init(&u) initializes the ut_connection
+ * ut_init(&u) initializes the ut_connection
*
* this function should always be the first one called on a new
* ut_connection
diff --git a/thirdparties/android/common/include/srtp/xfm.h b/thirdparties/android/common/include/srtp/xfm.h
index 5837149..a5e393f 100755
--- a/thirdparties/android/common/include/srtp/xfm.h
+++ b/thirdparties/android/common/include/srtp/xfm.h
@@ -2,7 +2,7 @@
* xfm.h
*
* interface for abstract crypto transform
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -28,12 +28,12 @@
* The function pointer xfm_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated only
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated only
*
- * @param clear_len length of data to be authenticated only
+ * @param clear_len length of data to be authenticated only
*
* @param iv location to write the Initialization Vector (IV)
*
@@ -45,38 +45,38 @@
* encrypted and authenticated (before the function call), and the
* length of the ciphertext (after the call)
*
- * @param auth_tag location to write auth tag
+ * @param auth_tag location to write auth tag
*/
-typedef err_status_t (*xfm_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len,
- void *auth_tag
- );
-
-typedef
+typedef err_status_t (*xfm_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len,
+ void *auth_tag
+);
+
+typedef
err_status_t (*xfm_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len, /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len, /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- void *auth_tag /* location of auth tag */
- );
+ void *auth_tag /* location of auth tag */
+);
typedef struct xfm_ctx_t {
- xfm_func_t func;
- xfm_inv_t inv;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
+ xfm_func_t func;
+ xfm_inv_t inv;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
} xfm_ctx_t;
typedef xfm_ctx_t *xfm_t;
@@ -89,35 +89,35 @@ typedef xfm_ctx_t *xfm_t;
/* cryptoalgo - 5/28 */
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *opaque,
- unsigned *opaque_len
- );
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *opaque,
+ unsigned *opaque_len
+);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
diff --git a/thirdparties/android/common/include/vpx/svc_context.h b/thirdparties/android/common/include/vpx/svc_context.h
index f4933f8..9916fd4 100755
--- a/thirdparties/android/common/include/vpx/svc_context.h
+++ b/thirdparties/android/common/include/vpx/svc_context.h
@@ -24,29 +24,30 @@ extern "C" {
#endif
typedef enum SVC_ENCODING_MODE {
- INTER_LAYER_PREDICTION_I,
- ALT_INTER_LAYER_PREDICTION_IP,
- INTER_LAYER_PREDICTION_IP,
- USE_GOLDEN_FRAME
-} SVC_ENCODING_MODE;
+ INTER_LAYER_PREDICTION_I,
+ ALT_INTER_LAYER_PREDICTION_IP,
+ INTER_LAYER_PREDICTION_IP,
+ USE_GOLDEN_FRAME
+}
+SVC_ENCODING_MODE;
typedef enum SVC_LOG_LEVEL {
- SVC_LOG_ERROR,
- SVC_LOG_INFO,
- SVC_LOG_DEBUG
+ SVC_LOG_ERROR,
+ SVC_LOG_INFO,
+ SVC_LOG_DEBUG
} SVC_LOG_LEVEL;
typedef struct {
- // public interface to svc_command options
- int spatial_layers; // number of layers
- int first_frame_full_size; // set to one to force first frame full size
- SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
- SVC_LOG_LEVEL log_level; // amount of information to display
- int log_print; // when set, printf log messages instead of returning the
- // message with svc_get_message
-
- // private storage for vpx_svc_encode
- void *internal;
+ // public interface to svc_command options
+ int spatial_layers; // number of layers
+ int first_frame_full_size; // set to one to force first frame full size
+ SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
+ SVC_LOG_LEVEL log_level; // amount of information to display
+ int log_print; // when set, printf log messages instead of returning the
+ // message with svc_get_message
+
+ // private storage for vpx_svc_encode
+ void *internal;
} SvcContext;
/**
@@ -73,7 +74,7 @@ vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
* e.g., "4/16,5/16,7/16,11/16,16/16"
*/
vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx,
- const char *scale_factors);
+ const char *scale_factors);
/**
* initialize SVC encoding
@@ -117,9 +118,9 @@ void *vpx_svc_get_buffer(const SvcContext *svc_ctx);
* return spatial resolution of the specified layer
*/
vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
- int layer,
- unsigned int *width,
- unsigned int *height);
+ int layer,
+ unsigned int *width,
+ unsigned int *height);
/**
* return number of frames that have been encoded
*/
diff --git a/thirdparties/android/common/include/vpx/vp8.h b/thirdparties/android/common/include/vpx/vp8.h
index 056fa7a..3361ffc 100755
--- a/thirdparties/android/common/include/vpx/vp8.h
+++ b/thirdparties/android/common/include/vpx/vp8.h
@@ -42,21 +42,21 @@ extern "C" {
* The set of macros define the control functions of VP8 interface
*/
enum vp8_com_control_id {
- VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
- VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
- VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
- VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
- VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
- VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
- VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
+ VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
+ VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
+ VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
+ VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
+ VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
+ VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
+ VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
- /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
- * for its control ids. These should be migrated to something like the
- * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
- */
- VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
- VP8_COMMON_CTRL_ID_MAX,
- VP8_DECODER_CTRL_ID_START = 256
+ /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
+ * for its control ids. These should be migrated to something like the
+ * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
+ */
+ VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
+ VP8_COMMON_CTRL_ID_MAX,
+ VP8_DECODER_CTRL_ID_START = 256
};
/*!\brief post process flags
@@ -64,15 +64,15 @@ enum vp8_com_control_id {
* The set of macros define VP8 decoder post processing flags
*/
enum vp8_postproc_level {
- VP8_NOFILTERING = 0,
- VP8_DEBLOCK = 1 << 0,
- VP8_DEMACROBLOCK = 1 << 1,
- VP8_ADDNOISE = 1 << 2,
- VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
- VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
- VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
- VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
- VP8_MFQE = 1 << 10
+ VP8_NOFILTERING = 0,
+ VP8_DEBLOCK = 1 << 0,
+ VP8_DEMACROBLOCK = 1 << 1,
+ VP8_ADDNOISE = 1 << 2,
+ VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
+ VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
+ VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
+ VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
+ VP8_MFQE = 1 << 10
};
/*!\brief post process flags
@@ -83,9 +83,9 @@ enum vp8_postproc_level {
*/
typedef struct vp8_postproc_cfg {
- int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
- int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
- int noise_level; /**< the strength of additive noise, valid range [0, 16] */
+ int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
+ int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
+ int noise_level; /**< the strength of additive noise, valid range [0, 16] */
} vp8_postproc_cfg_t;
/*!\brief reference frame type
@@ -93,9 +93,9 @@ typedef struct vp8_postproc_cfg {
* The set of macros define the type of VP8 reference frames
*/
typedef enum vpx_ref_frame_type {
- VP8_LAST_FRAME = 1,
- VP8_GOLD_FRAME = 2,
- VP8_ALTR_FRAME = 4
+ VP8_LAST_FRAME = 1,
+ VP8_GOLD_FRAME = 2,
+ VP8_ALTR_FRAME = 4
} vpx_ref_frame_type_t;
/*!\brief reference frame data struct
@@ -103,8 +103,8 @@ typedef enum vpx_ref_frame_type {
* Define the data struct to access vp8 reference frames.
*/
typedef struct vpx_ref_frame {
- vpx_ref_frame_type_t frame_type; /**< which reference frame */
- vpx_image_t img; /**< reference frame data in image format */
+ vpx_ref_frame_type_t frame_type; /**< which reference frame */
+ vpx_image_t img; /**< reference frame data in image format */
} vpx_ref_frame_t;
/*!\brief VP9 specific reference frame data struct
@@ -112,8 +112,8 @@ typedef struct vpx_ref_frame {
* Define the data struct to access vp9 reference frames.
*/
typedef struct vp9_ref_frame {
- int idx; /**< frame index to get (input) */
- vpx_image_t img; /**< img structure to populate (output) */
+ int idx; /**< frame index to get (input) */
+ vpx_image_t img; /**< img structure to populate (output) */
} vp9_ref_frame_t;
/*!\brief vp8 decoder control function parameter type
diff --git a/thirdparties/android/common/include/vpx/vp8cx.h b/thirdparties/android/common/include/vpx/vp8cx.h
index c0424f1..17a0075 100755
--- a/thirdparties/android/common/include/vpx/vp8cx.h
+++ b/thirdparties/android/common/include/vpx/vp8cx.h
@@ -131,72 +131,72 @@ extern vpx_codec_iface_t *vpx_codec_vp9x_cx(void);
* \sa #vpx_codec_control
*/
enum vp8e_enc_control_id {
- VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
- VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
- VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
- VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
- VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
- VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
- /*!\brief control function to set vp8 encoder cpuused
- *
- * Changes in this value influences, among others, the encoder's selection
- * of motion estimation methods. Values greater than 0 will increase encoder
- * speed at the expense of quality.
- * The full set of adjustments can be found in
- * onyx_if.c:vp8_set_speed_features().
- * \todo List highlights of the changes at various levels.
- *
- * \note Valid range: -16..16
- */
- VP8E_SET_CPUUSED = 13,
- VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
- VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
- VP8E_SET_SHARPNESS, /**< control function to set sharpness */
- VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
- VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
- VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
+ VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
+ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
+ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
+ VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
+ VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
+ VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
+ /*!\brief control function to set vp8 encoder cpuused
+ *
+ * Changes in this value influences, among others, the encoder's selection
+ * of motion estimation methods. Values greater than 0 will increase encoder
+ * speed at the expense of quality.
+ * The full set of adjustments can be found in
+ * onyx_if.c:vp8_set_speed_features().
+ * \todo List highlights of the changes at various levels.
+ *
+ * \note Valid range: -16..16
+ */
+ VP8E_SET_CPUUSED = 13,
+ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
+ VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
+ VP8E_SET_SHARPNESS, /**< control function to set sharpness */
+ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
+ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
+ VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
encoder for the last frame using the internal
scale */
- VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
+ VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
encoder for the last frame, using the 0..63
scale as used by the rc_*_quantizer config
parameters */
- VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
- VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
- VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
- VP8E_SET_TUNING, /**< control function to set visual tuning */
- /*!\brief control function to set constrained quality level
- *
- * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
- * set to #VPX_CQ.
- * \note Valid range: 0..63
- */
- VP8E_SET_CQ_LEVEL,
-
- /*!\brief Max data rate for Intra frames
- *
- * This value controls additional clamping on the maximum size of a
- * keyframe. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * unlimited, or no additional clamping beyond the codec's built-in
- * algorithm.
- *
- * For example, to allocate no more than 4.5 frames worth of bitrate
- * to a keyframe, set this to 450.
- *
- */
- VP8E_SET_MAX_INTRA_BITRATE_PCT,
-
-
- /* TODO(jkoleszar): Move to vp9cx.h */
- VP9E_SET_LOSSLESS,
- VP9E_SET_TILE_COLUMNS,
- VP9E_SET_TILE_ROWS,
- VP9E_SET_FRAME_PARALLEL_DECODING,
- VP9E_SET_AQ_MODE,
-
- VP9E_SET_SVC,
- VP9E_SET_SVC_PARAMETERS
+ VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
+ VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
+ VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
+ VP8E_SET_TUNING, /**< control function to set visual tuning */
+ /*!\brief control function to set constrained quality level
+ *
+ * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
+ * set to #VPX_CQ.
+ * \note Valid range: 0..63
+ */
+ VP8E_SET_CQ_LEVEL,
+
+ /*!\brief Max data rate for Intra frames
+ *
+ * This value controls additional clamping on the maximum size of a
+ * keyframe. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * unlimited, or no additional clamping beyond the codec's built-in
+ * algorithm.
+ *
+ * For example, to allocate no more than 4.5 frames worth of bitrate
+ * to a keyframe, set this to 450.
+ *
+ */
+ VP8E_SET_MAX_INTRA_BITRATE_PCT,
+
+
+ /* TODO(jkoleszar): Move to vp9cx.h */
+ VP9E_SET_LOSSLESS,
+ VP9E_SET_TILE_COLUMNS,
+ VP9E_SET_TILE_ROWS,
+ VP9E_SET_FRAME_PARALLEL_DECODING,
+ VP9E_SET_AQ_MODE,
+
+ VP9E_SET_SVC,
+ VP9E_SET_SVC_PARAMETERS
};
/*!\brief vpx 1-D scaling mode
@@ -204,10 +204,10 @@ enum vp8e_enc_control_id {
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d {
- VP8E_NORMAL = 0,
- VP8E_FOURFIVE = 1,
- VP8E_THREEFIVE = 2,
- VP8E_ONETWO = 3
+ VP8E_NORMAL = 0,
+ VP8E_FOURFIVE = 1,
+ VP8E_THREEFIVE = 2,
+ VP8E_ONETWO = 3
} VPX_SCALING_MODE;
@@ -218,17 +218,17 @@ typedef enum vpx_scaling_mode_1d {
*/
typedef struct vpx_roi_map {
- /*! An id between 0 and 3 for each 16x16 region within a frame. */
- unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
- // TODO(paulwilkins): broken for VP9 which has 8 segments
- // q and loop filter deltas for each segment
- // (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
- /*! Static breakout threshold for each segment. */
- unsigned int static_threshold[4];
+ /*! An id between 0 and 3 for each 16x16 region within a frame. */
+ unsigned char *roi_map;
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
+ // TODO(paulwilkins): broken for VP9 which has 8 segments
+ // q and loop filter deltas for each segment
+ // (see MAX_MB_SEGMENTS)
+ int delta_q[4]; /**< Quantizer deltas. */
+ int delta_lf[4]; /**< Loop filter deltas. */
+ /*! Static breakout threshold for each segment. */
+ unsigned int static_threshold[4];
} vpx_roi_map_t;
/*!\brief vpx active region map
@@ -239,9 +239,9 @@ typedef struct vpx_roi_map {
typedef struct vpx_active_map {
- unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
- unsigned int rows; /**< number of rows */
- unsigned int cols; /**< number of cols */
+ unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
+ unsigned int rows; /**< number of rows */
+ unsigned int cols; /**< number of cols */
} vpx_active_map_t;
/*!\brief vpx image scaling mode
@@ -250,8 +250,8 @@ typedef struct vpx_active_map {
*
*/
typedef struct vpx_scaling_mode {
- VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
- VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
+ VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
+ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
/*!\brief VP8 token partition mode
@@ -262,10 +262,10 @@ typedef struct vpx_scaling_mode {
*/
typedef enum {
- VP8_ONE_TOKENPARTITION = 0,
- VP8_TWO_TOKENPARTITION = 1,
- VP8_FOUR_TOKENPARTITION = 2,
- VP8_EIGHT_TOKENPARTITION = 3
+ VP8_ONE_TOKENPARTITION = 0,
+ VP8_TWO_TOKENPARTITION = 1,
+ VP8_FOUR_TOKENPARTITION = 2,
+ VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
@@ -275,8 +275,8 @@ typedef enum {
*
*/
typedef enum {
- VP8_TUNE_PSNR,
- VP8_TUNE_SSIM
+ VP8_TUNE_PSNR,
+ VP8_TUNE_SSIM
} vp8e_tuning;
/*!\brief vp9 svc parameters
@@ -285,16 +285,16 @@ typedef enum {
*
*/
typedef struct vpx_svc_parameters {
- unsigned int width; /**< width of current spatial layer */
- unsigned int height; /**< height of current spatial layer */
- int layer; /**< current layer number - 0 = base */
- int flags; /**< encode frame flags */
- int max_quantizer; /**< max quantizer for current layer */
- int min_quantizer; /**< min quantizer for current layer */
- int distance_from_i_frame; /**< frame number within current gop */
- int lst_fb_idx; /**< last frame frame buffer index */
- int gld_fb_idx; /**< golden frame frame buffer index */
- int alt_fb_idx; /**< alt reference frame frame buffer index */
+ unsigned int width; /**< width of current spatial layer */
+ unsigned int height; /**< height of current spatial layer */
+ int layer; /**< current layer number - 0 = base */
+ int flags; /**< encode frame flags */
+ int max_quantizer; /**< max quantizer for current layer */
+ int min_quantizer; /**< min quantizer for current layer */
+ int distance_from_i_frame; /**< frame number within current gop */
+ int lst_fb_idx; /**< last frame frame buffer index */
+ int gld_fb_idx; /**< golden frame frame buffer index */
+ int alt_fb_idx; /**< alt reference frame frame buffer index */
} vpx_svc_parameters_t;
/*!\brief VP8 encoder control function parameter type
diff --git a/thirdparties/android/common/include/vpx/vp8dx.h b/thirdparties/android/common/include/vpx/vp8dx.h
index d3093c4..d96bf57 100755
--- a/thirdparties/android/common/include/vpx/vp8dx.h
+++ b/thirdparties/android/common/include/vpx/vp8dx.h
@@ -54,29 +54,29 @@ extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
* \sa #vpx_codec_control
*/
enum vp8_dec_control_id {
- /** control function to get info on which reference frames were updated
- * by the last decode
- */
- VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
+ /** control function to get info on which reference frames were updated
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
- /** check if the indicated frame is corrupted */
- VP8D_GET_FRAME_CORRUPTED,
+ /** check if the indicated frame is corrupted */
+ VP8D_GET_FRAME_CORRUPTED,
- /** control function to get info on which reference frames were used
- * by the last decode
- */
- VP8D_GET_LAST_REF_USED,
+ /** control function to get info on which reference frames were used
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_USED,
- /** decryption function to decrypt encoded buffer data immediately
- * before decoding. Takes a vp8_decrypt_init, which contains
- * a callback function and opaque context pointer.
- */
- VP8D_SET_DECRYPTOR,
+ /** decryption function to decrypt encoded buffer data immediately
+ * before decoding. Takes a vp8_decrypt_init, which contains
+ * a callback function and opaque context pointer.
+ */
+ VP8D_SET_DECRYPTOR,
- /** For testing. */
- VP9_INVERT_TILE_DECODE_ORDER,
+ /** For testing. */
+ VP9_INVERT_TILE_DECODE_ORDER,
- VP8_DECODER_CTRL_ID_MAX
+ VP8_DECODER_CTRL_ID_MAX
};
/*!\brief Structure to hold decryption state
diff --git a/thirdparties/android/common/include/vpx/vp8e.h b/thirdparties/android/common/include/vpx/vp8e.h
index ca907c9..4ad8d22 100755
--- a/thirdparties/android/common/include/vpx/vp8e.h
+++ b/thirdparties/android/common/include/vpx/vp8e.h
@@ -24,8 +24,7 @@
DECLSPEC_DEPRECATED extern vpx_codec_iface_t vpx_enc_vp8_algo DEPRECATED;
-enum
-{
+enum {
VP8E_SET_REFERENCE = VP8_SET_REFERENCE,
VP8E_COPY_REFERENCE = VP8_COPY_REFERENCE,
VP8E_SET_PREVIEWPP = VP8_SET_POSTPROC,
diff --git a/thirdparties/android/common/include/vpx/vpx_codec.h b/thirdparties/android/common/include/vpx/vpx_codec.h
index 3ea36d6..ad1c08a 100755
--- a/thirdparties/android/common/include/vpx/vpx_codec.h
+++ b/thirdparties/android/common/include/vpx/vpx_codec.h
@@ -46,7 +46,7 @@ extern "C" {
#include "vpx_integer.h"
#include "vpx_image.h"
- /*!\brief Decorator indicating a function is deprecated */
+/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
#if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__ ((deprecated))
@@ -67,7 +67,7 @@ extern "C" {
#endif
#endif /* DECLSPEC_DEPRECATED */
- /*!\brief Decorator indicating a function is potentially unused */
+/*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED
#elif __GNUC__
#define UNUSED __attribute__ ((unused))
@@ -75,18 +75,18 @@ extern "C" {
#define UNUSED
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
- /*!\brief Algorithm return codes */
- typedef enum {
+/*!\brief Algorithm return codes */
+typedef enum {
/*!\brief Operation completed without error */
VPX_CODEC_OK,
@@ -138,247 +138,247 @@ extern "C" {
*/
VPX_CODEC_LIST_END
- }
- vpx_codec_err_t;
+}
+vpx_codec_err_t;
- /*! \brief Codec capabilities bitfield
- *
- * Each codec advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
- typedef long vpx_codec_caps_t;
+/*! \brief Codec capabilities bitfield
+ *
+ * Each codec advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
+typedef long vpx_codec_caps_t;
#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
#define VPX_CODEC_CAP_XMA 0x4 /**< Supports eXternal Memory Allocation */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
- typedef long vpx_codec_flags_t;
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
+typedef long vpx_codec_flags_t;
#define VPX_CODEC_USE_XMA 0x00000001 /**< Use eXternal Memory Allocation mode */
- /*!\brief Codec interface structure.
- *
- * Contains function pointers and other data private to the codec
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_codec_iface_t;
+/*!\brief Codec interface structure.
+ *
+ * Contains function pointers and other data private to the codec
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_codec_iface_t;
- /*!\brief Codec private data structure.
- *
- * Contains data private to the codec implementation. This structure is opaque
- * to the application.
- */
- typedef struct vpx_codec_priv vpx_codec_priv_t;
+/*!\brief Codec private data structure.
+ *
+ * Contains data private to the codec implementation. This structure is opaque
+ * to the application.
+ */
+typedef struct vpx_codec_priv vpx_codec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef const void *vpx_codec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef const void *vpx_codec_iter_t;
- /*!\brief Codec context structure
- *
- * All codecs \ref MUST support this context structure fully. In general,
- * this data should be considered private to the codec algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
- typedef struct vpx_codec_ctx {
+/*!\brief Codec context structure
+ *
+ * All codecs \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the codec algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
+typedef struct vpx_codec_ctx {
const char *name; /**< Printable interface name */
vpx_codec_iface_t *iface; /**< Interface pointers */
vpx_codec_err_t err; /**< Last returned error */
const char *err_detail; /**< Detailed info, if available */
vpx_codec_flags_t init_flags; /**< Flags passed at init time */
union {
- struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
- struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
- void *raw;
+ struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
+ struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
+ void *raw;
} config; /**< Configuration pointer aliasing union */
vpx_codec_priv_t *priv; /**< Algorithm private storage */
- } vpx_codec_ctx_t;
-
-
- /*
- * Library Version Number Interface
- *
- * For example, see the following sample return values:
- * vpx_codec_version() (1<<16 | 2<<8 | 3)
- * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
- * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
- */
-
- /*!\brief Return the version information (as an integer)
- *
- * Returns a packed encoding of the library version number. This will only include
- * the major.minor.patch component of the version number. Note that this encoded
- * value should be accessed through the macros provided, as the encoding may change
- * in the future.
- *
- */
- int vpx_codec_version(void);
+} vpx_codec_ctx_t;
+
+
+/*
+ * Library Version Number Interface
+ *
+ * For example, see the following sample return values:
+ * vpx_codec_version() (1<<16 | 2<<8 | 3)
+ * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
+ * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
+ */
+
+/*!\brief Return the version information (as an integer)
+ *
+ * Returns a packed encoding of the library version number. This will only include
+ * the major.minor.patch component of the version number. Note that this encoded
+ * value should be accessed through the macros provided, as the encoding may change
+ * in the future.
+ *
+ */
+int vpx_codec_version(void);
#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */
#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */
#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */
- /*!\brief Return the version major number */
+/*!\brief Return the version major number */
#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff)
- /*!\brief Return the version minor number */
+/*!\brief Return the version minor number */
#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff)
- /*!\brief Return the version patch number */
+/*!\brief Return the version patch number */
#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff)
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable string containing the full library version number. This may
- * contain additional text following the three digit version number, as to indicate
- * release candidates, prerelease versions, etc.
- *
- */
- const char *vpx_codec_version_str(void);
-
-
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable "extra string". This is the component of the string returned
- * by vpx_codec_version_str() following the three digit version number.
- *
- */
- const char *vpx_codec_version_extra_str(void);
-
-
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_codec_build_config(void);
-
-
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given codec interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
-
-
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_codec_err_to_string(vpx_codec_err_t err);
-
-
- /*!\brief Retrieve error synopsis for codec context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Retrieve detailed error information for codec context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
-
-
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all codecs.
- * They represent the base case functionality expected of all codecs.
- */
-
- /*!\brief Destroy a codec instance
- *
- * Destroys a codec context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_CODEC_OK
- * The codec algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
-
-
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the codec
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_CODEC_ERROR if the request could not
- * be dispatched.
- *
- * Note that this function should not be used directly. Call the
- * #vpx_codec_control wrapper macro instead.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- *
- * \retval #VPX_CODEC_OK
- * The control request was processed.
- * \retval #VPX_CODEC_ERROR
- * The control request was not processed.
- * \retval #VPX_CODEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
- int ctrl_id,
- ...);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable string containing the full library version number. This may
+ * contain additional text following the three digit version number, as to indicate
+ * release candidates, prerelease versions, etc.
+ *
+ */
+const char *vpx_codec_version_str(void);
+
+
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable "extra string". This is the component of the string returned
+ * by vpx_codec_version_str() following the three digit version number.
+ *
+ */
+const char *vpx_codec_version_extra_str(void);
+
+
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_codec_build_config(void);
+
+
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given codec interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
+
+
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_codec_err_to_string(vpx_codec_err_t err);
+
+
+/*!\brief Retrieve error synopsis for codec context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Retrieve detailed error information for codec context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+
+
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all codecs.
+ * They represent the base case functionality expected of all codecs.
+ */
+
+/*!\brief Destroy a codec instance
+ *
+ * Destroys a codec context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_CODEC_OK
+ * The codec algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
+
+
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the codec
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_CODEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * Note that this function should not be used directly. Call the
+ * #vpx_codec_control wrapper macro instead.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ *
+ * \retval #VPX_CODEC_OK
+ * The control request was processed.
+ * \retval #VPX_CODEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
+ int ctrl_id,
+ ...);
#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS
# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data)
# define VPX_CTRL_USE_TYPE(id, typ)
@@ -386,30 +386,30 @@ extern "C" {
# define VPX_CTRL_VOID(id, typ)
#else
- /*!\brief vpx_codec_control wrapper macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_().
- *
- * \internal
- * It works by dispatching the call to the control function through a wrapper
- * function named with the id parameter.
- */
+/*!\brief vpx_codec_control wrapper macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_().
+ *
+ * \internal
+ * It works by dispatching the call to the control function through a wrapper
+ * function named with the id parameter.
+ */
# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\
/**<\hideinitializer*/
- /*!\brief vpx_codec_control type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It defines the type of the argument for a given
- * control identifier.
- *
- * \internal
- * It defines a static function with
- * the correctly typed arguments as a wrapper to the type-unsafe internal
- * function.
- */
+/*!\brief vpx_codec_control type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It defines the type of the argument for a given
+ * control identifier.
+ *
+ * \internal
+ * It defines a static function with
+ * the correctly typed arguments as a wrapper to the type-unsafe internal
+ * function.
+ */
# define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\
@@ -420,16 +420,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control deprecated type definition macro
- *
- * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
- * deprecated and should not be used. Consult the documentation for your
- * codec for more information.
- *
- * \internal
- * It defines a static function with the correctly typed arguments as a
- * wrapper to the type-unsafe internal function.
- */
+/*!\brief vpx_codec_control deprecated type definition macro
+ *
+ * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
+ * deprecated and should not be used. Consult the documentation for your
+ * codec for more information.
+ *
+ * \internal
+ * It defines a static function with the correctly typed arguments as a
+ * wrapper to the type-unsafe internal function.
+ */
# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\
@@ -440,16 +440,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control void type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It indicates that a given control identifier takes
- * no argument.
- *
- * \internal
- * It defines a static function without a data argument as a wrapper to the
- * type-unsafe internal function.
- */
+/*!\brief vpx_codec_control void type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It indicates that a given control identifier takes
+ * no argument.
+ *
+ * \internal
+ * It defines a static function without a data argument as a wrapper to the
+ * type-unsafe internal function.
+ */
# define VPX_CTRL_VOID(id) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\
@@ -463,23 +463,23 @@ extern "C" {
#endif
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all codecs
- * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_INCAPABLE
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all codecs
+ * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_INCAPABLE
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the codec in the request phase, and by the calling
- * application once the requested allocation has been performed.
- */
- typedef struct vpx_codec_mmap {
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the codec in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
+typedef struct vpx_codec_mmap {
/*
* The following members are set by the codec when requesting a segment
*/
@@ -495,62 +495,62 @@ extern "C" {
void *base; /**< pointer to the allocated segment */
void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */
void *priv; /**< allocator private storage */
- } vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
-
-
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. In cases where the
- * stream is not available at allocation time, a fixed size must be requested.
- * The codec will not be able to operate on streams larger than the size used at
- * allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_CODEC_OK
- * The memory map entry was populated.
- * \retval #VPX_CODEC_ERROR
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmap,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Identify allocated segments to codec instance
- *
- * Stores a list of allocated segments in the codec. Segments \ref MUST be
- * passed in the order they are read from vpx_codec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_CODEC_OK
- * The segment was stored in the codec context.
- * \retval #VPX_CODEC_INCAPABLE
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
-
- */
- vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmaps,
- unsigned int num_maps);
-
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup codec*/
+} vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
+
+
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. In cases where the
+ * stream is not available at allocation time, a fixed size must be requested.
+ * The codec will not be able to operate on streams larger than the size used at
+ * allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_CODEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_CODEC_ERROR
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmap,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Identify allocated segments to codec instance
+ *
+ * Stores a list of allocated segments in the codec. Segments \ref MUST be
+ * passed in the order they are read from vpx_codec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_CODEC_OK
+ * The segment was stored in the codec context.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
+
+ */
+vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmaps,
+ unsigned int num_maps);
+
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup codec*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/android/common/include/vpx/vpx_decoder.h b/thirdparties/android/common/include/vpx/vpx_decoder.h
index 2dcd024..424849d 100755
--- a/thirdparties/android/common/include/vpx/vpx_decoder.h
+++ b/thirdparties/android/common/include/vpx/vpx_decoder.h
@@ -31,24 +31,24 @@ extern "C" {
#include "vpx_codec.h"
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Decoder capabilities bitfield
- *
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
@@ -57,13 +57,13 @@ extern "C" {
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames
one fragment at a time */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based
multi-threading */
@@ -76,257 +76,257 @@ extern "C" {
#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based
multi-threading */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
- typedef struct vpx_codec_stream_info {
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
+typedef struct vpx_codec_stream_info {
unsigned int sz; /**< Size of this structure */
unsigned int w; /**< Width (or 0 for unknown/default) */
unsigned int h; /**< Height (or 0 for unknown/default) */
unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_codec_stream_info_t;
+} vpx_codec_stream_info_t;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialization Configurations
- *
- * This structure is used to pass init time configuration options to the
- * decoder.
- */
- typedef struct vpx_codec_dec_cfg {
+/*!\brief Initialization Configurations
+ *
+ * This structure is used to pass init time configuration options to the
+ * decoder.
+ */
+typedef struct vpx_codec_dec_cfg {
unsigned int threads; /**< Maximum number of threads to use, default 1 */
unsigned int w; /**< Width */
unsigned int h; /**< Height */
- } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
-
-
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_codec_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
- /*!\brief Convenience macro for vpx_codec_dec_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
+
+
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_codec_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_dec_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+/*!\brief Convenience macro for vpx_codec_dec_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_dec_init(ctx, iface, cfg, flags) \
vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
- * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
- * time stamp) order. Frames produced will always be in PTS (presentation
- * time stamp) order.
- * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
- * data and data_sz can contain a fragment of the encoded frame. Fragment
- * \#n must contain at least partition \#n, but can also contain subsequent
- * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
- * be empty. When no more data is available, this function should be called
- * with NULL as data and 0 as data_sz. The memory passed to this function
- * must be available until the frame has been decoded.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] deadline Soft deadline the decoder should attempt to meet,
- * in us. Set to zero for unlimited.
- *
- * \return Returns #VPX_CODEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_codec_err_t
- * for recoverability capabilities.
- */
- vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
- const uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- long deadline);
-
-
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
-
-
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_frame_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_frame */
-
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
-
-
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_slice_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_slice*/
-
- /*!@} - end defgroup decoder*/
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
+ * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
+ * time stamp) order. Frames produced will always be in PTS (presentation
+ * time stamp) order.
+ * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
+ * data and data_sz can contain a fragment of the encoded frame. Fragment
+ * \#n must contain at least partition \#n, but can also contain subsequent
+ * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
+ * be empty. When no more data is available, this function should be called
+ * with NULL as data and 0 as data_sz. The memory passed to this function
+ * must be available until the frame has been decoded.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] deadline Soft deadline the decoder should attempt to meet,
+ * in us. Set to zero for unlimited.
+ *
+ * \return Returns #VPX_CODEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_codec_err_t
+ * for recoverability capabilities.
+ */
+vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
+ const uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ long deadline);
+
+
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
+
+
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_frame_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_frame */
+
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
+
+
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_slice_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_slice*/
+
+/*!@} - end defgroup decoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/android/common/include/vpx/vpx_decoder_compat.h b/thirdparties/android/common/include/vpx/vpx_decoder_compat.h
index 8adc1b9..13046e1 100755
--- a/thirdparties/android/common/include/vpx/vpx_decoder_compat.h
+++ b/thirdparties/android/common/include/vpx/vpx_decoder_compat.h
@@ -30,555 +30,552 @@ extern "C" {
#ifndef VPX_DECODER_COMPAT_H
#define VPX_DECODER_COMPAT_H
- /*!\brief Decoder algorithm return codes */
- typedef enum {
- /*!\brief Operation completed without error */
- VPX_DEC_OK = VPX_CODEC_OK,
-
- /*!\brief Unspecified error */
- VPX_DEC_ERROR = VPX_CODEC_ERROR,
-
- /*!\brief Memory operation failed */
- VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR,
-
- /*!\brief ABI version mismatch */
- VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH,
-
- /*!\brief The given bitstream is not supported.
- *
- * The bitstream was unable to be parsed at the highest level. The decoder
- * is unable to proceed. This error \ref SHOULD be treated as fatal to the
- * stream. */
- VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM,
-
- /*!\brief Encoded bitstream uses an unsupported feature
- *
- * The decoder does not implement a feature required by the encoder. This
- * return code should only be used for features that prevent future
- * pictures from being properly decoded. This error \ref MAY be treated as
- * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
- */
- VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE,
-
- /*!\brief The coded data for this stream is corrupt or incomplete
- *
- * There was a problem decoding the current frame. This return code
- * should only be used for failures that prevent future pictures from
- * being properly decoded. This error \ref MAY be treated as fatal to the
- * stream or \ref MAY be treated as fatal to the current GOP. If decoding
- * is continued for the current GOP, artifacts may be present.
- */
- VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME,
-
- /*!\brief An application-supplied parameter is not valid.
- *
- */
- VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM,
-
- /*!\brief An iterator reached the end of list.
- *
- */
- VPX_DEC_LIST_END = VPX_CODEC_LIST_END
-
- }
- vpx_dec_err_t;
-
- /*! \brief Decoder capabilities bitfield
+/*!\brief Decoder algorithm return codes */
+typedef enum {
+ /*!\brief Operation completed without error */
+ VPX_DEC_OK = VPX_CODEC_OK,
+
+ /*!\brief Unspecified error */
+ VPX_DEC_ERROR = VPX_CODEC_ERROR,
+
+ /*!\brief Memory operation failed */
+ VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR,
+
+ /*!\brief ABI version mismatch */
+ VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH,
+
+ /*!\brief The given bitstream is not supported.
+ *
+ * The bitstream was unable to be parsed at the highest level. The decoder
+ * is unable to proceed. This error \ref SHOULD be treated as fatal to the
+ * stream. */
+ VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM,
+
+ /*!\brief Encoded bitstream uses an unsupported feature
+ *
+ * The decoder does not implement a feature required by the encoder. This
+ * return code should only be used for features that prevent future
+ * pictures from being properly decoded. This error \ref MAY be treated as
+ * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
+ */
+ VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE,
+
+ /*!\brief The coded data for this stream is corrupt or incomplete
*
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
+ * There was a problem decoding the current frame. This return code
+ * should only be used for failures that prevent future pictures from
+ * being properly decoded. This error \ref MAY be treated as fatal to the
+ * stream or \ref MAY be treated as fatal to the current GOP. If decoding
+ * is continued for the current GOP, artifacts may be present.
+ */
+ VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME,
+
+ /*!\brief An application-supplied parameter is not valid.
+ *
+ */
+ VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM,
+
+ /*!\brief An iterator reached the end of list.
*
- * The available flags are specified by VPX_DEC_CAP_* defines.
*/
- typedef int vpx_dec_caps_t;
+ VPX_DEC_LIST_END = VPX_CODEC_LIST_END
+
+}
+vpx_dec_err_t;
+
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_DEC_CAP_* defines.
+ */
+typedef int vpx_dec_caps_t;
#define VPX_DEC_CAP_PUT_SLICE 0x0001 /**< Will issue put_slice callbacks */
#define VPX_DEC_CAP_PUT_FRAME 0x0002 /**< Will issue put_frame callbacks */
#define VPX_DEC_CAP_XMA 0x0004 /**< Supports eXternal Memory Allocation */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
#if 1
- typedef vpx_codec_stream_info_t vpx_dec_stream_info_t;
+typedef vpx_codec_stream_info_t vpx_dec_stream_info_t;
#else
- typedef struct
- {
- unsigned int sz; /**< Size of this structure */
- unsigned int w; /**< Width (or 0 for unknown/default) */
- unsigned int h; /**< Height (or 0 for unknown/default) */
- unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_dec_stream_info_t;
+typedef struct {
+ unsigned int sz; /**< Size of this structure */
+ unsigned int w; /**< Width (or 0 for unknown/default) */
+ unsigned int h; /**< Height (or 0 for unknown/default) */
+ unsigned int is_kf; /**< Current frame is a keyframe */
+} vpx_dec_stream_info_t;
#endif
- /*!\brief Decoder interface structure.
- *
- * Contains function pointers and other data private to the decoder
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_dec_iface_t;
- typedef struct vpx_codec_priv vpx_dec_priv_t;
+/*!\brief Decoder interface structure.
+ *
+ * Contains function pointers and other data private to the decoder
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_dec_iface_t;
+typedef struct vpx_codec_priv vpx_dec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef vpx_codec_iter_t vpx_dec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef vpx_codec_iter_t vpx_dec_iter_t;
- /*!\brief Decoder context structure
- *
- * All decoders \ref MUST support this context structure fully. In general,
- * this data should be considered private to the decoder algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
+/*!\brief Decoder context structure
+ *
+ * All decoders \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the decoder algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
#if 1
- typedef vpx_codec_ctx_t vpx_dec_ctx_t;
+typedef vpx_codec_ctx_t vpx_dec_ctx_t;
#else
- typedef struct
- {
- const char *name; /**< Printable interface name */
- vpx_dec_iface_t *iface; /**< Interface pointers */
- vpx_dec_err_t err; /**< Last returned error */
- vpx_dec_priv_t *priv; /**< Algorithm private storage */
- } vpx_dec_ctx_t;
+typedef struct {
+ const char *name; /**< Printable interface name */
+ vpx_dec_iface_t *iface; /**< Interface pointers */
+ vpx_dec_err_t err; /**< Last returned error */
+ vpx_dec_priv_t *priv; /**< Algorithm private storage */
+} vpx_dec_ctx_t;
#endif
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_dec_build_config(void) DEPRECATED;
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_dec_build_config(void) DEPRECATED;
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given decoder interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED;
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given decoder interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED;
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED;
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED;
- /*!\brief Retrieve error synopsis for decoder context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Retrieve error synopsis for decoder context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED;
- /*!\brief Retrieve detailed error information for decoder context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Retrieve detailed error information for decoder context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx,
- vpx_dec_iface_t *iface,
- int ver) DEPRECATED;
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx,
+ vpx_dec_iface_t *iface,
+ int ver) DEPRECATED;
#define vpx_dec_init(ctx, iface) \
vpx_dec_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)
- /*!\brief Destroy a decoder instance
- *
- * Destroys a decoder context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Destroy a decoder instance
+ *
+ * Destroys a decoder context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED;
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED;
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED;
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_DEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_dec_stream_info_t *si) DEPRECATED;
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_DEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_dec_stream_info_t *si) DEPRECATED;
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_DEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx,
- vpx_dec_stream_info_t *si) DEPRECATED;
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_DEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx,
+ vpx_dec_stream_info_t *si) DEPRECATED;
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the decoder
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_DEC_ERROR if the request could not
- * be dispatched.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- * \param[in,out] data Data to exchange with algorithm instance.
- *
- * \retval #VPX_DEC_OK
- * The control request was processed.
- * \retval #VPX_DEC_ERROR
- * The control request was not processed.
- * \retval #VPX_DEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx,
- int ctrl_id,
- void *data) DEPRECATED;
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the decoder
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_DEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ * \param[in,out] data Data to exchange with algorithm instance.
+ *
+ * \retval #VPX_DEC_OK
+ * The control request was processed.
+ * \retval #VPX_DEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_DEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx,
+ int ctrl_id,
+ void *data) DEPRECATED;
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and
- * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data
- * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will
- * always be in PTS (presentation time stamp) order.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_DEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] rel_pts PTS relative to the previous frame, in us. If
- * unknown or unavailable, set to zero.
- *
- * \return Returns #VPX_DEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_dec_err_t
- * for recoverability capabilities.
- */
- vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx,
- uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- int rel_pts) DEPRECATED;
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and
+ * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data
+ * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will
+ * always be in PTS (presentation time stamp) order.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_DEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] rel_pts PTS relative to the previous frame, in us. If
+ * unknown or unavailable, set to zero.
+ *
+ * \return Returns #VPX_DEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_dec_err_t
+ * for recoverability capabilities.
+ */
+vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx,
+ uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ int rel_pts) DEPRECATED;
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx,
- vpx_dec_iter_t *iter) DEPRECATED;
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx,
+ vpx_dec_iter_t *iter) DEPRECATED;
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_DEC_OK
- * Callback successfully registered.
- * \retval #VPX_DEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx,
- vpx_dec_put_frame_cb_fn_t cb,
- void *user_priv) DEPRECATED;
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_DEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_DEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx,
+ vpx_dec_put_frame_cb_fn_t cb,
+ void *user_priv) DEPRECATED;
- /*!@} - end defgroup cap_put_frame */
+/*!@} - end defgroup cap_put_frame */
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_DEC_OK
- * Callback successfully registered.
- * \retval #VPX_DEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx,
- vpx_dec_put_slice_cb_fn_t cb,
- void *user_priv) DEPRECATED;
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_DEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_DEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx,
+ vpx_dec_put_slice_cb_fn_t cb,
+ void *user_priv) DEPRECATED;
- /*!@} - end defgroup cap_put_slice*/
+/*!@} - end defgroup cap_put_slice*/
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the decoder in the request phase, and by the calling
- * application once the requested allocation has been performed.
- */
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the decoder in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
#if 1
#define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */
#define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */
#define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */
- typedef struct vpx_codec_mmap vpx_dec_mmap_t;
+typedef struct vpx_codec_mmap vpx_dec_mmap_t;
#else
- typedef struct vpx_dec_mmap
- {
- /*
- * The following members are set by the codec when requesting a segment
- */
- unsigned int id; /**< identifier for the segment's contents */
- unsigned long sz; /**< size of the segment, in bytes */
- unsigned int align; /**< required alignment of the segment, in bytes */
- unsigned int flags; /**< bitfield containing segment properties */
+typedef struct vpx_dec_mmap {
+ /*
+ * The following members are set by the codec when requesting a segment
+ */
+ unsigned int id; /**< identifier for the segment's contents */
+ unsigned long sz; /**< size of the segment, in bytes */
+ unsigned int align; /**< required alignment of the segment, in bytes */
+ unsigned int flags; /**< bitfield containing segment properties */
#define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */
#define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */
#define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */
- /* The following members are to be filled in by the allocation function */
- void *base; /**< pointer to the allocated segment */
- void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */
- void *priv; /**< allocator private storage */
- } vpx_dec_mmap_t;
+ /* The following members are to be filled in by the allocation function */
+ void *base; /**< pointer to the allocated segment */
+ void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */
+ void *priv; /**< allocator private storage */
+} vpx_dec_mmap_t;
#endif
- /*!\brief Initialize a decoder instance in external allocation mode
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_dec_xma_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- */
- vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx,
- vpx_dec_iface_t *iface,
- int ver) DEPRECATED;
+/*!\brief Initialize a decoder instance in external allocation mode
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_dec_xma_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ */
+vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx,
+ vpx_dec_iface_t *iface,
+ int ver) DEPRECATED;
#define vpx_dec_xma_init(ctx, iface) \
vpx_dec_xma_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_DEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. This means that
- * the stream info structure must be known at allocation time. It can be
- * populated with the vpx_dec_peek_stream_info() function. In cases where the
- * stream to be decoded is not available at allocation time, a fixed size must
- * be requested. The decoder will not be able to decode streams larger than
- * the size used at allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in] si Pointer to the stream info.
- * \param[in out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_DEC_OK
- * The memory map entry was populated.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- * \retval #VPX_DEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx,
- vpx_dec_mmap_t *mmap,
- const vpx_dec_stream_info_t *si,
- vpx_dec_iter_t *iter) DEPRECATED;
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_DEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. This means that
+ * the stream info structure must be known at allocation time. It can be
+ * populated with the vpx_dec_peek_stream_info() function. In cases where the
+ * stream to be decoded is not available at allocation time, a fixed size must
+ * be requested. The decoder will not be able to decode streams larger than
+ * the size used at allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in] si Pointer to the stream info.
+ * \param[in out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_DEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx,
+ vpx_dec_mmap_t *mmap,
+ const vpx_dec_stream_info_t *si,
+ vpx_dec_iter_t *iter) DEPRECATED;
- /*!\brief Identify allocated segments to decoder instance
- *
- * Stores a list of allocated segments in the decoder. Segments \ref MUST be
- * passed in the order they are read from vpx_dec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_DEC_OK
- * The segment was stored in the decoder context.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- * \retval #VPX_DEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
+/*!\brief Identify allocated segments to decoder instance
+ *
+ * Stores a list of allocated segments in the decoder. Segments \ref MUST be
+ * passed in the order they are read from vpx_dec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_DEC_OK
+ * The segment was stored in the decoder context.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
- */
- vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx,
- vpx_dec_mmap_t *mmaps,
- unsigned int num_maps) DEPRECATED;
+ */
+vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx,
+ vpx_dec_mmap_t *mmaps,
+ unsigned int num_maps) DEPRECATED;
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup decoder*/
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup decoder*/
#endif
diff --git a/thirdparties/android/common/include/vpx/vpx_encoder.h b/thirdparties/android/common/include/vpx/vpx_encoder.h
index 56752cf..8c9399a 100755
--- a/thirdparties/android/common/include/vpx/vpx_encoder.h
+++ b/thirdparties/android/common/include/vpx/vpx_encoder.h
@@ -31,18 +31,18 @@ extern "C" {
#include "vpx_codec.h"
- /*! Temporal Scalability: Maximum length of the sequence defining frame
- * layer membership
- */
+/*! Temporal Scalability: Maximum length of the sequence defining frame
+ * layer membership
+ */
#define VPX_TS_MAX_PERIODICITY 16
- /*! Temporal Scalability: Maximum number of coding layers */
+/*! Temporal Scalability: Maximum number of coding layers */
#define VPX_TS_MAX_LAYERS 5
- /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
+/*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
- /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
+/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
#define MAX_LAYERS VPX_TS_MAX_LAYERS
/*! Spatial Scalability: Maximum number of coding layers */
@@ -51,74 +51,74 @@ extern "C" {
/*! Spatial Scalability: Default number of coding layers */
#define VPX_SS_DEFAULT_LAYERS 3
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Encoder capabilities bitfield
- *
- * Each encoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra
- * interfaces or functionality, and are not required to be supported
- * by an encoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Encoder capabilities bitfield
+ *
+ * Each encoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra
+ * interfaces or functionality, and are not required to be supported
+ * by an encoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
- /*! Can output one partition at a time. Each partition is returned in its
- * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
- * every partition but the last. In this mode all frames are always
- * returned partition by partition.
- */
+/*! Can output one partition at a time. Each partition is returned in its
+ * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
+ * every partition but the last. In this mode all frames are always
+ * returned partition by partition.
+ */
#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow
- * for proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow
+ * for proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one
partition at a time. */
- /*!\brief Generic fixed size buffer structure
- *
- * This structure is able to hold a reference to any fixed size buffer.
- */
- typedef struct vpx_fixed_buf {
+/*!\brief Generic fixed size buffer structure
+ *
+ * This structure is able to hold a reference to any fixed size buffer.
+ */
+typedef struct vpx_fixed_buf {
void *buf; /**< Pointer to the data */
size_t sz; /**< Length of the buffer, in chars */
- } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
+} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
- /*!\brief Time Stamp Type
- *
- * An integer, which when multiplied by the stream's time base, provides
- * the absolute time of a sample.
- */
- typedef int64_t vpx_codec_pts_t;
+/*!\brief Time Stamp Type
+ *
+ * An integer, which when multiplied by the stream's time base, provides
+ * the absolute time of a sample.
+ */
+typedef int64_t vpx_codec_pts_t;
- /*!\brief Compressed Frame Flags
- *
- * This type represents a bitfield containing information about a compressed
- * frame that may be useful to an application. The most significant 16 bits
- * can be used by an algorithm to provide additional detail, for example to
- * support frame types that are codec specific (MPEG-1 D-frames for example)
- */
- typedef uint32_t vpx_codec_frame_flags_t;
+/*!\brief Compressed Frame Flags
+ *
+ * This type represents a bitfield containing information about a compressed
+ * frame that may be useful to an application. The most significant 16 bits
+ * can be used by an algorithm to provide additional detail, for example to
+ * support frame types that are codec specific (MPEG-1 D-frames for example)
+ */
+typedef uint32_t vpx_codec_frame_flags_t;
#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */
#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting
the stream (no future frame depends on
@@ -128,13 +128,13 @@ extern "C" {
#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded
frame */
- /*!\brief Error Resilient flags
- *
- * These flags define which error resilient features to enable in the
- * encoder. The flags are specified through the
- * vpx_codec_enc_cfg::g_error_resilient variable.
- */
- typedef uint32_t vpx_codec_er_flags_t;
+/*!\brief Error Resilient flags
+ *
+ * These flags define which error resilient features to enable in the
+ * encoder. The flags are specified through the
+ * vpx_codec_enc_cfg::g_error_resilient variable.
+ */
+typedef uint32_t vpx_codec_er_flags_t;
#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against
losses of whole frames */
#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are
@@ -146,122 +146,122 @@ extern "C" {
predicition is still done over
the partition boundary. */
- /*!\brief Encoder output packet variants
- *
- * This enumeration lists the different kinds of data packets that can be
- * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
- * extend this list to provide additional functionality.
- */
- enum vpx_codec_cx_pkt_kind {
+/*!\brief Encoder output packet variants
+ *
+ * This enumeration lists the different kinds of data packets that can be
+ * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
+ * extend this list to provide additional functionality.
+ */
+enum vpx_codec_cx_pkt_kind {
VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
- };
+};
- /*!\brief Encoder output packet
- *
- * This structure contains the different kinds of output data the encoder
- * may produce while compressing a frame.
- */
- typedef struct vpx_codec_cx_pkt {
+/*!\brief Encoder output packet
+ *
+ * This structure contains the different kinds of output data the encoder
+ * may produce while compressing a frame.
+ */
+typedef struct vpx_codec_cx_pkt {
enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
union {
- struct {
- void *buf; /**< compressed data buffer */
- size_t sz; /**< length of compressed data */
- vpx_codec_pts_t pts; /**< time stamp to show frame
+ struct {
+ void *buf; /**< compressed data buffer */
+ size_t sz; /**< length of compressed data */
+ vpx_codec_pts_t pts; /**< time stamp to show frame
(in timebase units) */
- unsigned long duration; /**< duration to show frame
+ unsigned long duration; /**< duration to show frame
(in timebase units) */
- vpx_codec_frame_flags_t flags; /**< flags for this frame */
- int partition_id; /**< the partition id
+ vpx_codec_frame_flags_t flags; /**< flags for this frame */
+ int partition_id; /**< the partition id
defines the decoding order
of the partitions. Only
applicable when "output partition"
mode is enabled. First partition
has id 0.*/
- } frame; /**< data for compressed frame packet */
- struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
- struct vpx_psnr_pkt {
- unsigned int samples[4]; /**< Number of samples, total/y/u/v */
- uint64_t sse[4]; /**< sum squared error, total/y/u/v */
- double psnr[4]; /**< PSNR, total/y/u/v */
- } psnr; /**< data for PSNR packet */
- struct vpx_fixed_buf raw; /**< data for arbitrary packets */
-
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
+ } frame; /**< data for compressed frame packet */
+ struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
+ struct vpx_psnr_pkt {
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
+ double psnr[4]; /**< PSNR, total/y/u/v */
+ } psnr; /**< data for PSNR packet */
+ struct vpx_fixed_buf raw; /**< data for arbitrary packets */
+
+ /* This packet size is fixed to allow codecs to extend this
+ * interface without having to manage storage for raw packets,
+ * i.e., if it's smaller than 128 bytes, you can store in the
+ * packet list directly.
+ */
+ char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
} data; /**< packet data */
- } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
+} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
- /*!\brief Rational Number
- *
- * This structure holds a fractional value.
- */
- typedef struct vpx_rational {
+/*!\brief Rational Number
+ *
+ * This structure holds a fractional value.
+ */
+typedef struct vpx_rational {
int num; /**< fraction numerator */
int den; /**< fraction denominator */
- } vpx_rational_t; /**< alias for struct vpx_rational */
+} vpx_rational_t; /**< alias for struct vpx_rational */
- /*!\brief Multi-pass Encoding Pass */
- enum vpx_enc_pass {
+/*!\brief Multi-pass Encoding Pass */
+enum vpx_enc_pass {
VPX_RC_ONE_PASS, /**< Single pass mode */
VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
- };
+};
- /*!\brief Rate control mode */
- enum vpx_rc_mode {
+/*!\brief Rate control mode */
+enum vpx_rc_mode {
VPX_VBR, /**< Variable Bit Rate (VBR) mode */
VPX_CBR, /**< Constant Bit Rate (CBR) mode */
VPX_CQ, /**< Constrained Quality (CQ) mode */
VPX_Q, /**< Constant Quality (Q) mode */
- };
-
-
- /*!\brief Keyframe placement mode.
- *
- * This enumeration determines whether keyframes are placed automatically by
- * the encoder or whether this behavior is disabled. Older releases of this
- * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
- * This name is confusing for this behavior, so the new symbols to be used
- * are VPX_KF_AUTO and VPX_KF_DISABLED.
- */
- enum vpx_kf_mode {
+};
+
+
+/*!\brief Keyframe placement mode.
+ *
+ * This enumeration determines whether keyframes are placed automatically by
+ * the encoder or whether this behavior is disabled. Older releases of this
+ * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
+ * This name is confusing for this behavior, so the new symbols to be used
+ * are VPX_KF_AUTO and VPX_KF_DISABLED.
+ */
+enum vpx_kf_mode {
VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
- };
+};
- /*!\brief Encoded Frame Flags
- *
- * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
- * per-frame boolean values. By convention, bits common to all codecs will be
- * named VPX_EFLAG_*, and bits specific to an algorithm will be named
- * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
- */
- typedef long vpx_enc_frame_flags_t;
+/*!\brief Encoded Frame Flags
+ *
+ * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
+ * per-frame boolean values. By convention, bits common to all codecs will be
+ * named VPX_EFLAG_*, and bits specific to an algorithm will be named
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
+ */
+typedef long vpx_enc_frame_flags_t;
#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */
- /*!\brief Encoder configuration structure
- *
- * This structure contains the encoder settings that have common representations
- * across all codecs. This doesn't imply that all codecs support all features,
- * however.
- */
- typedef struct vpx_codec_enc_cfg {
+/*!\brief Encoder configuration structure
+ *
+ * This structure contains the encoder settings that have common representations
+ * across all codecs. This doesn't imply that all codecs support all features,
+ * however.
+ */
+typedef struct vpx_codec_enc_cfg {
/*
* generic settings (g)
*/
@@ -646,146 +646,146 @@ extern "C" {
* then ts_layer_id = (0,1,0,1,0,1,0,1).
*/
unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
- } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
-
-
- /*!\brief Initialize an encoder instance
- *
- * Initializes a encoder context using the given interface. Applications
- * should call the vpx_codec_enc_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+
+
+/*!\brief Initialize an encoder instance
+ *
+ * Initializes a encoder context using the given interface. Applications
+ * should call the vpx_codec_enc_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init(ctx, iface, cfg, flags) \
vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
- /*!\brief Initialize multi-encoder instance
- *
- * Initializes multi-encoder context using the given interface.
- * Applications should call the vpx_codec_enc_init_multi convenience macro
- * instead of this function directly, to ensure that the ABI version number
- * parameter is properly initialized.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] num_enc Total number of encoders.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] dsf Pointer to down-sampling factors.
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- int num_enc,
- vpx_codec_flags_t flags,
- vpx_rational_t *dsf,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Initialize multi-encoder instance
+ *
+ * Initializes multi-encoder context using the given interface.
+ * Applications should call the vpx_codec_enc_init_multi convenience macro
+ * instead of this function directly, to ensure that the ABI version number
+ * parameter is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] num_enc Total number of encoders.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] dsf Pointer to down-sampling factors.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ int num_enc,
+ vpx_codec_flags_t flags,
+ vpx_rational_t *dsf,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
VPX_ENCODER_ABI_VERSION)
- /*!\brief Get a default configuration
- *
- * Initializes a encoder configuration structure with default values. Supports
- * the notion of "usages" so that an algorithm may offer different default
- * settings depending on the user's intended goal. This function \ref SHOULD
- * be called by all applications to initialize the configuration structure
- * before specializing the configuration with application specific values.
- *
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[out] cfg Configuration buffer to populate
- * \param[in] usage End usage. Set to 0 or use codec specific values.
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- unsigned int usage);
-
-
- /*!\brief Set or change configuration
- *
- * Reconfigures an encoder instance according to the given configuration.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cfg Configuration buffer to use
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
- const vpx_codec_enc_cfg_t *cfg);
-
-
- /*!\brief Get global stream headers
- *
- * Retrieves a stream level global header packet, if supported by the codec.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval NULL
- * Encoder does not support global header
- * \retval Non-NULL
- * Pointer to buffer containing global header packet
- */
- vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
+/*!\brief Get a default configuration
+ *
+ * Initializes a encoder configuration structure with default values. Supports
+ * the notion of "usages" so that an algorithm may offer different default
+ * settings depending on the user's intended goal. This function \ref SHOULD
+ * be called by all applications to initialize the configuration structure
+ * before specializing the configuration with application specific values.
+ *
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[out] cfg Configuration buffer to populate
+ * \param[in] usage End usage. Set to 0 or use codec specific values.
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ unsigned int usage);
+
+
+/*!\brief Set or change configuration
+ *
+ * Reconfigures an encoder instance according to the given configuration.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cfg Configuration buffer to use
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
+ const vpx_codec_enc_cfg_t *cfg);
+
+
+/*!\brief Get global stream headers
+ *
+ * Retrieves a stream level global header packet, if supported by the codec.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval NULL
+ * Encoder does not support global header
+ * \retval Non-NULL
+ * Pointer to buffer containing global header packet
+ */
+vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to
@@ -794,141 +794,141 @@ extern "C" {
* VPx GOOD QUALITY mode. */
#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to
* VPx BEST QUALITY mode. */
- /*!\brief Encode a frame
- *
- * Encodes a video frame at the given "presentation time." The presentation
- * time stamp (PTS) \ref MUST be strictly increasing.
- *
- * The encoder supports the notion of a soft real-time deadline. Given a
- * non-zero value to the deadline parameter, the encoder will make a "best
- * effort" guarantee to return before the given time slice expires. It is
- * implicit that limiting the available time to encode will degrade the
- * output quality. The encoder can be given an unlimited time to produce the
- * best possible frame by specifying a deadline of '0'. This deadline
- * supercedes the VPx notion of "best quality, good quality, realtime".
- * Applications that wish to map these former settings to the new deadline
- * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
- * and #VPX_DL_BEST_QUALITY.
- *
- * When the last frame has been passed to the encoder, this function should
- * continue to be called, with the img parameter set to NULL. This will
- * signal the end-of-stream condition to the encoder and allow it to encode
- * any held buffers. Encoding is complete when vpx_codec_encode() is called
- * and vpx_codec_get_cx_data() returns no data.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] img Image data to encode, NULL to flush.
- * \param[in] pts Presentation time stamp, in timebase units.
- * \param[in] duration Duration to show frame, in timebase units.
- * \param[in] flags Flags to use for encoding this frame.
- * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
- const vpx_image_t *img,
- vpx_codec_pts_t pts,
- unsigned long duration,
- vpx_enc_frame_flags_t flags,
- unsigned long deadline);
-
- /*!\brief Set compressed data output buffer
- *
- * Sets the buffer that the codec should output the compressed data
- * into. This call effectively sets the buffer pointer returned in the
- * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
- * appended into this buffer. The buffer is preserved across frames,
- * so applications must periodically call this function after flushing
- * the accumulated compressed data to disk or to the network to reset
- * the pointer to the buffer's head.
- *
- * `pad_before` bytes will be skipped before writing the compressed
- * data, and `pad_after` bytes will be appended to the packet. The size
- * of the packet will be the sum of the size of the actual compressed
- * data, pad_before, and pad_after. The padding bytes will be preserved
- * (not overwritten).
- *
- * Note that calling this function does not guarantee that the returned
- * compressed data will be placed into the specified buffer. In the
- * event that the encoded data will not fit into the buffer provided,
- * the returned packet \ref MAY point to an internal buffer, as it would
- * if this call were never used. In this event, the output packet will
- * NOT have any padding, and the application must free space and copy it
- * to the proper place. This is of particular note in configurations
- * that may output multiple packets for a single encoded frame (e.g., lagged
- * encoding) or if the application does not reset the buffer periodically.
- *
- * Applications may restore the default behavior of the codec providing
- * the compressed data buffer by calling this function with a NULL
- * buffer.
- *
- * Applications \ref MUSTNOT call this function during iteration of
- * vpx_codec_get_cx_data().
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] buf Buffer to store compressed data into
- * \param[in] pad_before Bytes to skip before writing compressed data
- * \param[in] pad_after Bytes to skip after writing compressed data
- *
- * \retval #VPX_CODEC_OK
- * The buffer was set successfully.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
- const vpx_fixed_buf_t *buf,
- unsigned int pad_before,
- unsigned int pad_after);
-
-
- /*!\brief Encoded data iterator
- *
- * Iterates over a list of data packets to be passed from the encoder to the
- * application. The different kinds of packets available are enumerated in
- * #vpx_codec_cx_pkt_kind.
- *
- * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
- * muxer. Multiple compressed frames may be in the list.
- * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
- *
- * The application \ref MUST silently ignore any packet kinds that it does
- * not recognize or support.
- *
- * The data buffers returned from this function are only guaranteed to be
- * valid until the application makes another call to any vpx_codec_* function.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an output data packet (compressed frame data,
- * two-pass statistics, etc.) or NULL to signal end-of-list.
- *
- */
- const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Get Preview Frame
- *
- * Returns an image that can be used as a preview. Shows the image as it would
- * exist at the decompressor. The application \ref MUST NOT write into this
- * image buffer.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \return Returns a pointer to a preview image, or NULL if no image is
- * available.
- *
- */
- const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
-
-
- /*!@} - end defgroup encoder*/
+/*!\brief Encode a frame
+ *
+ * Encodes a video frame at the given "presentation time." The presentation
+ * time stamp (PTS) \ref MUST be strictly increasing.
+ *
+ * The encoder supports the notion of a soft real-time deadline. Given a
+ * non-zero value to the deadline parameter, the encoder will make a "best
+ * effort" guarantee to return before the given time slice expires. It is
+ * implicit that limiting the available time to encode will degrade the
+ * output quality. The encoder can be given an unlimited time to produce the
+ * best possible frame by specifying a deadline of '0'. This deadline
+ * supercedes the VPx notion of "best quality, good quality, realtime".
+ * Applications that wish to map these former settings to the new deadline
+ * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
+ * and #VPX_DL_BEST_QUALITY.
+ *
+ * When the last frame has been passed to the encoder, this function should
+ * continue to be called, with the img parameter set to NULL. This will
+ * signal the end-of-stream condition to the encoder and allow it to encode
+ * any held buffers. Encoding is complete when vpx_codec_encode() is called
+ * and vpx_codec_get_cx_data() returns no data.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] img Image data to encode, NULL to flush.
+ * \param[in] pts Presentation time stamp, in timebase units.
+ * \param[in] duration Duration to show frame, in timebase units.
+ * \param[in] flags Flags to use for encoding this frame.
+ * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned long duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned long deadline);
+
+/*!\brief Set compressed data output buffer
+ *
+ * Sets the buffer that the codec should output the compressed data
+ * into. This call effectively sets the buffer pointer returned in the
+ * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
+ * appended into this buffer. The buffer is preserved across frames,
+ * so applications must periodically call this function after flushing
+ * the accumulated compressed data to disk or to the network to reset
+ * the pointer to the buffer's head.
+ *
+ * `pad_before` bytes will be skipped before writing the compressed
+ * data, and `pad_after` bytes will be appended to the packet. The size
+ * of the packet will be the sum of the size of the actual compressed
+ * data, pad_before, and pad_after. The padding bytes will be preserved
+ * (not overwritten).
+ *
+ * Note that calling this function does not guarantee that the returned
+ * compressed data will be placed into the specified buffer. In the
+ * event that the encoded data will not fit into the buffer provided,
+ * the returned packet \ref MAY point to an internal buffer, as it would
+ * if this call were never used. In this event, the output packet will
+ * NOT have any padding, and the application must free space and copy it
+ * to the proper place. This is of particular note in configurations
+ * that may output multiple packets for a single encoded frame (e.g., lagged
+ * encoding) or if the application does not reset the buffer periodically.
+ *
+ * Applications may restore the default behavior of the codec providing
+ * the compressed data buffer by calling this function with a NULL
+ * buffer.
+ *
+ * Applications \ref MUSTNOT call this function during iteration of
+ * vpx_codec_get_cx_data().
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] buf Buffer to store compressed data into
+ * \param[in] pad_before Bytes to skip before writing compressed data
+ * \param[in] pad_after Bytes to skip after writing compressed data
+ *
+ * \retval #VPX_CODEC_OK
+ * The buffer was set successfully.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
+ const vpx_fixed_buf_t *buf,
+ unsigned int pad_before,
+ unsigned int pad_after);
+
+
+/*!\brief Encoded data iterator
+ *
+ * Iterates over a list of data packets to be passed from the encoder to the
+ * application. The different kinds of packets available are enumerated in
+ * #vpx_codec_cx_pkt_kind.
+ *
+ * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
+ * muxer. Multiple compressed frames may be in the list.
+ * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
+ *
+ * The application \ref MUST silently ignore any packet kinds that it does
+ * not recognize or support.
+ *
+ * The data buffers returned from this function are only guaranteed to be
+ * valid until the application makes another call to any vpx_codec_* function.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an output data packet (compressed frame data,
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
+ *
+ */
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Get Preview Frame
+ *
+ * Returns an image that can be used as a preview. Shows the image as it would
+ * exist at the decompressor. The application \ref MUST NOT write into this
+ * image buffer.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \return Returns a pointer to a preview image, or NULL if no image is
+ * available.
+ *
+ */
+const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
+
+
+/*!@} - end defgroup encoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/android/common/include/vpx/vpx_frame_buffer.h b/thirdparties/android/common/include/vpx/vpx_frame_buffer.h
index e69df4b..599c990 100755
--- a/thirdparties/android/common/include/vpx/vpx_frame_buffer.h
+++ b/thirdparties/android/common/include/vpx/vpx_frame_buffer.h
@@ -34,9 +34,9 @@ extern "C" {
* This structure holds allocated frame buffers used by the decoder.
*/
typedef struct vpx_codec_frame_buffer {
- uint8_t *data; /**< Pointer to the data buffer */
- size_t size; /**< Size of data in bytes */
- void *priv; /**< Frame's private data */
+ uint8_t *data; /**< Pointer to the data buffer */
+ size_t size; /**< Size of data in bytes */
+ void *priv; /**< Frame's private data */
} vpx_codec_frame_buffer_t;
/*!\brief get frame buffer callback prototype
diff --git a/thirdparties/android/common/include/vpx/vpx_image.h b/thirdparties/android/common/include/vpx/vpx_image.h
index c304bac..514dd7a 100755
--- a/thirdparties/android/common/include/vpx/vpx_image.h
+++ b/thirdparties/android/common/include/vpx/vpx_image.h
@@ -20,14 +20,14 @@ extern "C" {
#ifndef VPX_IMAGE_H
#define VPX_IMAGE_H
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/
@@ -36,8 +36,8 @@ extern "C" {
#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component */
- /*!\brief List of supported image formats */
- typedef enum vpx_img_fmt {
+/*!\brief List of supported image formats */
+typedef enum vpx_img_fmt {
VPX_IMG_FMT_NONE,
VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
@@ -59,20 +59,21 @@ extern "C" {
VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5,
VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6,
VPX_IMG_FMT_444A = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_HAS_ALPHA | 7
- } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
+}
+vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
#define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_IMG_FMT_PLANAR */
#define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_IMG_FMT_UV_FLIP */
#define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_IMG_FMT_HAS_ALPHA */
- /*!\brief Deprecated list of supported image formats
- * \deprecated New code should use #vpx_img_fmt
- */
+/*!\brief Deprecated list of supported image formats
+ * \deprecated New code should use #vpx_img_fmt
+ */
#define img_fmt vpx_img_fmt
- /*!\brief alias for enum img_fmt.
- * \deprecated New code should use #vpx_img_fmt_t
- */
+/*!\brief alias for enum img_fmt.
+ * \deprecated New code should use #vpx_img_fmt_t
+ */
#define img_fmt_t vpx_img_fmt_t
#define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_FMT_NONE */
@@ -95,8 +96,8 @@ extern "C" {
#define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_FMT_VPXI420 */
#endif /* VPX_CODEC_DISABLE_COMPAT */
- /**\brief Image Descriptor */
- typedef struct vpx_image {
+/**\brief Image Descriptor */
+typedef struct vpx_image {
vpx_img_fmt_t fmt; /**< Image Format */
/* Image storage dimensions */
@@ -139,103 +140,103 @@ extern "C" {
unsigned char *img_data; /**< private */
int img_data_owner; /**< private */
int self_allocd; /**< private */
- } vpx_image_t; /**< alias for struct vpx_image */
+} vpx_image_t; /**< alias for struct vpx_image */
- /**\brief Representation of a rectangle on a surface */
- typedef struct vpx_image_rect {
+/**\brief Representation of a rectangle on a surface */
+typedef struct vpx_image_rect {
unsigned int x; /**< leftmost column */
unsigned int y; /**< topmost row */
unsigned int w; /**< width */
unsigned int h; /**< height */
- } vpx_image_rect_t; /**< alias for struct vpx_image_rect */
-
- /*!\brief Open a descriptor, allocating storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for the descriptor is allocated on the heap.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of the image buffer and
- * each row in the image(stride).
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_alloc(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align);
-
- /*!\brief Open a descriptor, using existing storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for descriptor has been allocated elsewhere, and a descriptor is
- * desired to "wrap" that storage.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of each row in the image.
- * \param[in] img_data Storage to use for the image
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_wrap(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align,
- unsigned char *img_data);
-
-
- /*!\brief Set the rectangle identifying the displayed portion of the image
- *
- * Updates the displayed rectangle (aka viewport) on the image surface to
- * match the specified coordinates and size.
- *
- * \param[in] img Image descriptor
- * \param[in] x leftmost column
- * \param[in] y topmost row
- * \param[in] w width
- * \param[in] h height
- *
- * \return 0 if the requested rectangle is valid, nonzero otherwise.
- */
- int vpx_img_set_rect(vpx_image_t *img,
- unsigned int x,
- unsigned int y,
- unsigned int w,
- unsigned int h);
-
-
- /*!\brief Flip the image vertically (top for bottom)
- *
- * Adjusts the image descriptor's pointers and strides to make the image
- * be referenced upside-down.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_flip(vpx_image_t *img);
-
- /*!\brief Close an image descriptor
- *
- * Frees all allocated storage associated with an image descriptor.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_free(vpx_image_t *img);
+} vpx_image_rect_t; /**< alias for struct vpx_image_rect */
+
+/*!\brief Open a descriptor, allocating storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for the descriptor is allocated on the heap.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of the image buffer and
+ * each row in the image(stride).
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_alloc(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align);
+
+/*!\brief Open a descriptor, using existing storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for descriptor has been allocated elsewhere, and a descriptor is
+ * desired to "wrap" that storage.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of each row in the image.
+ * \param[in] img_data Storage to use for the image
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_wrap(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align,
+ unsigned char *img_data);
+
+
+/*!\brief Set the rectangle identifying the displayed portion of the image
+ *
+ * Updates the displayed rectangle (aka viewport) on the image surface to
+ * match the specified coordinates and size.
+ *
+ * \param[in] img Image descriptor
+ * \param[in] x leftmost column
+ * \param[in] y topmost row
+ * \param[in] w width
+ * \param[in] h height
+ *
+ * \return 0 if the requested rectangle is valid, nonzero otherwise.
+ */
+int vpx_img_set_rect(vpx_image_t *img,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h);
+
+
+/*!\brief Flip the image vertically (top for bottom)
+ *
+ * Adjusts the image descriptor's pointers and strides to make the image
+ * be referenced upside-down.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_flip(vpx_image_t *img);
+
+/*!\brief Close an image descriptor
+ *
+ * Frees all allocated storage associated with an image descriptor.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_free(vpx_image_t *img);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/android/common/include/x264.h b/thirdparties/android/common/include/x264.h
index 225a269..16019ab 100755
--- a/thirdparties/android/common/include/x264.h
+++ b/thirdparties/android/common/include/x264.h
@@ -62,8 +62,7 @@ typedef struct x264_t x264_t;
* NAL structure and functions
****************************************************************************/
-enum nal_unit_type_e
-{
+enum nal_unit_type_e {
NAL_UNKNOWN = 0,
NAL_SLICE = 1,
NAL_SLICE_DPA = 2,
@@ -77,8 +76,7 @@ enum nal_unit_type_e
NAL_FILLER = 12,
/* ref_idc == 0 for 6,9,10,11,12 */
};
-enum nal_priority_e
-{
+enum nal_priority_e {
NAL_PRIORITY_DISPOSABLE = 0,
NAL_PRIORITY_LOW = 1,
NAL_PRIORITY_HIGH = 2,
@@ -90,8 +88,7 @@ enum nal_priority_e
* All data returned in an x264_nal_t, including the data in p_payload, is no longer
* valid after the next call to x264_encoder_encode. Thus it must be used or copied
* before calling x264_encoder_encode or x264_encoder_headers again. */
-typedef struct
-{
+typedef struct {
int i_ref_idc; /* nal_priority_e */
int i_type; /* nal_unit_type_e */
int b_long_startcode;
@@ -202,7 +199,8 @@ static const char * const x264_vidformat_names[] = { "component", "pal", "ntsc",
static const char * const x264_fullrange_names[] = { "off", "on", 0 };
static const char * const x264_colorprim_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", 0 };
static const char * const x264_transfer_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316",
- "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", 0 };
+ "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", 0
+ };
static const char * const x264_colmatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo", "bt2020nc", "bt2020c", 0 };
static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };
@@ -255,8 +253,7 @@ static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };
/* Zones: override ratecontrol or other options for specific sections of the video.
* See x264_encoder_reconfig() for which options can be changed.
* If zones overlap, whichever comes later in the list takes precedence. */
-typedef struct
-{
+typedef struct {
int i_start, i_end; /* range of frame numbers */
int b_force_qp; /* whether to use qp vs bitrate factor */
int i_qp;
@@ -264,8 +261,7 @@ typedef struct
struct x264_param_t *param;
} x264_zone_t;
-typedef struct x264_param_t
-{
+typedef struct x264_param_t {
/* CPU flags */
unsigned int cpu;
int i_threads; /* encode multiple frames in parallel */
@@ -290,8 +286,7 @@ typedef struct x264_param_t
* will currently generate invalid HRD. */
int i_nal_hrd;
- struct
- {
+ struct {
/* they will be reduced to be 0 < x <= 65535 and prime */
int i_sar_height;
int i_sar_width;
@@ -353,8 +348,7 @@ typedef struct x264_param_t
char *psz_dump_yuv; /* filename (in UTF-8) for reconstructed frames */
/* Encoder analyser parameters */
- struct
- {
+ struct {
unsigned int intra; /* intra partitions */
unsigned int inter; /* inter partitions */
@@ -390,8 +384,7 @@ typedef struct x264_param_t
} analyse;
/* Rate control parameters */
- struct
- {
+ struct {
int i_rc_method; /* X264_RC_* */
int i_qp_constant; /* 0 to (51 + 6*(x264_bit_depth-8)). 0=lossless */
@@ -435,8 +428,7 @@ typedef struct x264_param_t
/* Cropping Rectangle parameters: added to those implicitly defined by
non-mod16 video resolutions. */
- struct
- {
+ struct {
unsigned int i_left;
unsigned int i_top;
unsigned int i_right;
@@ -549,8 +541,7 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
* H.264 level restriction information
****************************************************************************/
-typedef struct
-{
+typedef struct {
int level_idc;
int mbps; /* max macroblock processing rate (macroblocks/sec) */
int frame_size; /* max frame size (macroblocks) */
@@ -673,8 +664,7 @@ X264_API extern const int x264_bit_depth;
* there are no restrictions. */
X264_API extern const int x264_chroma_format;
-enum pic_struct_e
-{
+enum pic_struct_e {
PIC_STRUCT_AUTO = 0, // automatically decide (default)
PIC_STRUCT_PROGRESSIVE = 1, // progressive frame
// "TOP" and "BOTTOM" are not supported in x264 (PAFF only)
@@ -686,8 +676,7 @@ enum pic_struct_e
PIC_STRUCT_TRIPLE = 9, // triple frame
};
-typedef struct
-{
+typedef struct {
double cpb_initial_arrival_time;
double cpb_final_arrival_time;
double cpb_removal_time;
@@ -704,31 +693,27 @@ typedef struct
* Payloads are written first in order of input, apart from in the case when HRD
* is enabled where payloads are written after the Buffering Period SEI. */
-typedef struct
-{
+typedef struct {
int payload_size;
int payload_type;
uint8_t *payload;
} x264_sei_payload_t;
-typedef struct
-{
+typedef struct {
int num_payloads;
x264_sei_payload_t *payloads;
/* In: optional callback to free each payload AND x264_sei_payload_t when used. */
void (*sei_free)( void* );
} x264_sei_t;
-typedef struct
-{
+typedef struct {
int i_csp; /* Colorspace */
int i_plane; /* Number of image planes */
int i_stride[4]; /* Strides for each plane */
uint8_t *plane[4]; /* Pointers to each plane */
} x264_image_t;
-typedef struct
-{
+typedef struct {
/* All arrays of data here are ordered as follows:
* each array contains one offset per macroblock, in raster scan order. In interlaced
* mode, top-field MBs and bottom-field MBs are interleaved at the row level.
@@ -769,7 +754,7 @@ typedef struct
void (*mb_info_free)( void* );
/* The macroblock is constant and remains unchanged from the previous frame. */
- #define X264_MBINFO_CONSTANT (1<<0)
+#define X264_MBINFO_CONSTANT (1<<0)
/* More flags may be added in the future. */
/* Out: SSIM of the the frame luma (if x264_param_t.b_ssim is set) */
@@ -783,8 +768,7 @@ typedef struct
double f_crf_avg;
} x264_image_properties_t;
-typedef struct
-{
+typedef struct {
/* In: force picture type (if not auto)
* If x264 encoding parameters are violated in the forcing of picture types,
* x264 will correct the input picture type and log a warning.
diff --git a/thirdparties/common/include/faac.h b/thirdparties/common/include/faac.h
index 77c05f1..7d29c59 100755
--- a/thirdparties/common/include/faac.h
+++ b/thirdparties/common/include/faac.h
@@ -39,8 +39,8 @@ extern "C" {
#pragma pack(push, 1)
typedef struct {
- void *ptr;
- char *name;
+ void *ptr;
+ char *name;
}
psymodellist_t;
@@ -60,30 +60,30 @@ typedef signed int int32_t;
Returns FAAC_CFG_VERSION.
*/
int FAACAPI faacEncGetVersion(char **faac_id_string,
- char **faac_copyright_string);
+ char **faac_copyright_string);
faacEncConfigurationPtr FAACAPI
- faacEncGetCurrentConfiguration(faacEncHandle hEncoder);
+faacEncGetCurrentConfiguration(faacEncHandle hEncoder);
int FAACAPI faacEncSetConfiguration(faacEncHandle hEncoder,
- faacEncConfigurationPtr config);
+ faacEncConfigurationPtr config);
faacEncHandle FAACAPI faacEncOpen(unsigned long sampleRate,
- unsigned int numChannels,
- unsigned long *inputSamples,
- unsigned long *maxOutputBytes);
+ unsigned int numChannels,
+ unsigned long *inputSamples,
+ unsigned long *maxOutputBytes);
int FAACAPI faacEncGetDecoderSpecificInfo(faacEncHandle hEncoder, unsigned char **ppBuffer,
- unsigned long *pSizeOfDecoderSpecificInfo);
+ unsigned long *pSizeOfDecoderSpecificInfo);
int FAACAPI faacEncEncode(faacEncHandle hEncoder, int32_t * inputBuffer, unsigned int samplesInput,
- unsigned char *outputBuffer,
- unsigned int bufferSize);
+ unsigned char *outputBuffer,
+ unsigned int bufferSize);
int FAACAPI faacEncClose(faacEncHandle hEncoder);
diff --git a/thirdparties/common/include/faaccfg.h b/thirdparties/common/include/faaccfg.h
index 001f821..b6520cd 100755
--- a/thirdparties/common/include/faaccfg.h
+++ b/thirdparties/common/include/faaccfg.h
@@ -46,8 +46,7 @@
#define SHORTCTL_NOLONG 2
#pragma pack(push, 1)
-typedef struct faacEncConfiguration
-{
+typedef struct faacEncConfiguration {
/* config version */
int version;
@@ -91,29 +90,29 @@ typedef struct faacEncConfiguration
unsigned int psymodelidx;
/*
- PCM Sample Input Format
- 0 FAAC_INPUT_NULL invalid, signifies a misconfigured config
- 1 FAAC_INPUT_16BIT native endian 16bit
- 2 FAAC_INPUT_24BIT native endian 24bit in 24 bits (not implemented)
- 3 FAAC_INPUT_32BIT native endian 24bit in 32 bits (DEFAULT)
- 4 FAAC_INPUT_FLOAT 32bit floating point
+ PCM Sample Input Format
+ 0 FAAC_INPUT_NULL invalid, signifies a misconfigured config
+ 1 FAAC_INPUT_16BIT native endian 16bit
+ 2 FAAC_INPUT_24BIT native endian 24bit in 24 bits (not implemented)
+ 3 FAAC_INPUT_32BIT native endian 24bit in 32 bits (DEFAULT)
+ 4 FAAC_INPUT_FLOAT 32bit floating point
*/
unsigned int inputFormat;
/* block type enforcing (SHORTCTL_NORMAL/SHORTCTL_NOSHORT/SHORTCTL_NOLONG) */
int shortctl;
-
- /*
- Channel Remapping
-
- Default 0, 1, 2, 3 ... 63 (64 is MAX_CHANNELS in coder.h)
-
- WAVE 4.0 2, 0, 1, 3
- WAVE 5.0 2, 0, 1, 3, 4
- WAVE 5.1 2, 0, 1, 4, 5, 3
- AIFF 5.1 2, 0, 3, 1, 4, 5
- */
- int channel_map[64];
+
+ /*
+ Channel Remapping
+
+ Default 0, 1, 2, 3 ... 63 (64 is MAX_CHANNELS in coder.h)
+
+ WAVE 4.0 2, 0, 1, 3
+ WAVE 5.0 2, 0, 1, 3, 4
+ WAVE 5.1 2, 0, 1, 4, 5, 3
+ AIFF 5.1 2, 0, 3, 1, 4, 5
+ */
+ int channel_map[64];
} faacEncConfiguration, *faacEncConfigurationPtr;
diff --git a/thirdparties/common/include/gsm.h b/thirdparties/common/include/gsm.h
index 4714ab6..5df6c99 100755
--- a/thirdparties/common/include/gsm.h
+++ b/thirdparties/common/include/gsm.h
@@ -55,7 +55,7 @@ typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */
#define GSM_OPT_FRAME_CHAIN 6
extern gsm gsm_create GSM_P((void));
-extern void gsm_destroy GSM_P((gsm));
+extern void gsm_destroy GSM_P((gsm));
extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *));
extern int gsm_option GSM_P((gsm, int, int *));
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftconfig.h b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftconfig.h
index 3e28f77..4e06af9 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftconfig.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftconfig.h
@@ -17,22 +17,22 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This header file contains a number of macro definitions that are used */
- /* by the rest of the engine. Most of the macros here are automatically */
- /* determined at compile time, and you should not need to change it to */
- /* port FreeType, except to compile the library with a non-ANSI */
- /* compiler. */
- /* */
- /* Note however that if some specific modifications are needed, we */
- /* advise you to place a modified copy in your build directory. */
- /* */
- /* The build directory is usually `freetype/builds/<system>', and */
- /* contains system-specific files that are always included first when */
- /* building the library. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This header file contains a number of macro definitions that are used */
+/* by the rest of the engine. Most of the macros here are automatically */
+/* determined at compile time, and you should not need to change it to */
+/* port FreeType, except to compile the library with a non-ANSI */
+/* compiler. */
+/* */
+/* Note however that if some specific modifications are needed, we */
+/* advise you to place a modified copy in your build directory. */
+/* */
+/* The build directory is usually `freetype/builds/<system>', and */
+/* contains system-specific files that are always included first when */
+/* building the library. */
+/* */
+/*************************************************************************/
#ifndef __FTCONFIG_H__
@@ -46,16 +46,16 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
- /* */
- /* These macros can be toggled to suit a specific system. The current */
- /* ones are defaults used to compile FreeType in an ANSI C environment */
- /* (16bit compilers are also supported). Copy this file to your own */
- /* `freetype/builds/<system>' directory, and edit it to port the engine. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
+/* */
+/* These macros can be toggled to suit a specific system. The current */
+/* ones are defaults used to compile FreeType in an ANSI C environment */
+/* (16bit compilers are also supported). Copy this file to your own */
+/* `freetype/builds/<system>' directory, and edit it to port the engine. */
+/* */
+/*************************************************************************/
#undef HAVE_UNISTD_H
@@ -63,13 +63,13 @@ FT_BEGIN_HEADER
#undef HAVE_STDINT_H
- /* There are systems (like the Texas Instruments 'C54x) where a `char' */
- /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
- /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
- /* is probably unexpected. */
- /* */
- /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
- /* `char' type. */
+/* There are systems (like the Texas Instruments 'C54x) where a `char' */
+/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
+/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
+/* is probably unexpected. */
+/* */
+/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
+/* `char' type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
@@ -86,13 +86,13 @@ FT_BEGIN_HEADER
#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
- /* Following cpp computation of the bit length of int and long */
- /* is copied from default include/freetype/config/ftconfig.h. */
- /* If any improvement is required for this file, it should be */
- /* applied to the original header file for the builders that */
- /* does not use configure script. */
+/* Following cpp computation of the bit length of int and long */
+/* is copied from default include/freetype/config/ftconfig.h. */
+/* If any improvement is required for this file, it should be */
+/* applied to the original header file for the builders that */
+/* does not use configure script. */
- /* The size of an `int' type. */
+/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
#elif FT_UINT_MAX == 0xFFFFFFFFUL
@@ -103,8 +103,8 @@ FT_BEGIN_HEADER
#error "Unsupported size of `int' type!"
#endif
- /* The size of a `long' type. A five-byte `long' (as used e.g. on the */
- /* DM642) is recognized but avoided. */
+/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
+/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
@@ -118,35 +118,35 @@ FT_BEGIN_HEADER
#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
- /* FT_UNUSED is a macro used to indicate that a given parameter is not */
- /* used -- this is only used to get rid of unpleasant compiler warnings */
+/* FT_UNUSED is a macro used to indicate that a given parameter is not */
+/* used -- this is only used to get rid of unpleasant compiler warnings */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif
- /*************************************************************************/
- /* */
- /* AUTOMATIC CONFIGURATION MACROS */
- /* */
- /* These macros are computed from the ones defined above. Don't touch */
- /* their definition, unless you know precisely what you are doing. No */
- /* porter should need to mess with them. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Mac support */
- /* */
- /* This is the only necessary change, so it is defined here instead */
- /* providing a new configuration file. */
- /* */
+/*************************************************************************/
+/* */
+/* AUTOMATIC CONFIGURATION MACROS */
+/* */
+/* These macros are computed from the ones defined above. Don't touch */
+/* their definition, unless you know precisely what you are doing. No */
+/* porter should need to mess with them. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* Mac support */
+/* */
+/* This is the only necessary change, so it is defined here instead */
+/* providing a new configuration file. */
+/* */
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
- /* no Carbon frameworks for 64bit 10.4.x */
- /* AvailabilityMacros.h is available since Mac OS X 10.2, */
- /* so guess the system version by maximum errno before inclusion */
+/* no Carbon frameworks for 64bit 10.4.x */
+/* AvailabilityMacros.h is available since Mac OS X 10.2, */
+/* so guess the system version by maximum errno before inclusion */
#include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
@@ -157,7 +157,7 @@ FT_BEGIN_HEADER
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
- /* Classic MacOS compilers */
+/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC
#define FT_MACINTOSH 1
@@ -166,7 +166,7 @@ FT_BEGIN_HEADER
#endif
- /* Fix compiler warning with sgi compiler */
+/* Fix compiler warning with sgi compiler */
#if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505
@@ -174,134 +174,134 @@ FT_BEGIN_HEADER
#endif
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* basic_types */
+/* */
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int16 */
- /* */
- /* <Description> */
- /* A typedef for a 16bit signed integer type. */
- /* */
- typedef signed short FT_Int16;
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Int16 */
+/* */
+/* <Description> */
+/* A typedef for a 16bit signed integer type. */
+/* */
+typedef signed short FT_Int16;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt16 */
- /* */
- /* <Description> */
- /* A typedef for a 16bit unsigned integer type. */
- /* */
- typedef unsigned short FT_UInt16;
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_UInt16 */
+/* */
+/* <Description> */
+/* A typedef for a 16bit unsigned integer type. */
+/* */
+typedef unsigned short FT_UInt16;
- /* */
+/* */
- /* this #if 0 ... #endif clause is for documentation purposes */
+/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int32 */
- /* */
- /* <Description> */
- /* A typedef for a 32bit signed integer type. The size depends on */
- /* the configuration. */
- /* */
- typedef signed XXX FT_Int32;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt32 */
- /* */
- /* A typedef for a 32bit unsigned integer type. The size depends on */
- /* the configuration. */
- /* */
- typedef unsigned XXX FT_UInt32;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int64 */
- /* */
- /* A typedef for a 64bit signed integer type. The size depends on */
- /* the configuration. Only defined if there is real 64bit support; */
- /* otherwise, it gets emulated with a structure (if necessary). */
- /* */
- typedef signed XXX FT_Int64;
-
- /* */
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Int32 */
+/* */
+/* <Description> */
+/* A typedef for a 32bit signed integer type. The size depends on */
+/* the configuration. */
+/* */
+typedef signed XXX FT_Int32;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_UInt32 */
+/* */
+/* A typedef for a 32bit unsigned integer type. The size depends on */
+/* the configuration. */
+/* */
+typedef unsigned XXX FT_UInt32;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Int64 */
+/* */
+/* A typedef for a 64bit signed integer type. The size depends on */
+/* the configuration. Only defined if there is real 64bit support; */
+/* otherwise, it gets emulated with a structure (if necessary). */
+/* */
+typedef signed XXX FT_Int64;
+
+/* */
#endif
#if FT_SIZEOF_INT == 4
- typedef signed int FT_Int32;
- typedef unsigned int FT_UInt32;
+typedef signed int FT_Int32;
+typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == 4
- typedef signed long FT_Int32;
- typedef unsigned long FT_UInt32;
+typedef signed long FT_Int32;
+typedef unsigned long FT_UInt32;
#else
#error "no 32bit type found -- please check your configuration files"
#endif
- /* look up an integer type that is at least 32 bits */
+/* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= 4
- typedef int FT_Fast;
- typedef unsigned int FT_UFast;
+typedef int FT_Fast;
+typedef unsigned int FT_UFast;
#elif FT_SIZEOF_LONG >= 4
- typedef long FT_Fast;
- typedef unsigned long FT_UFast;
+typedef long FT_Fast;
+typedef unsigned long FT_UFast;
#endif
- /* determine whether we have a 64-bit int type for platforms without */
- /* Autoconf */
+/* determine whether we have a 64-bit int type for platforms without */
+/* Autoconf */
#if FT_SIZEOF_LONG == 8
- /* FT_LONG64 must be defined if a 64-bit type is available */
+/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
- /* this compiler provides the __int64 type */
+/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
- /* XXXX: We should probably check the value of __BORLANDC__ in order */
- /* to test the compiler version. */
+/* XXXX: We should probably check the value of __BORLANDC__ in order */
+/* to test the compiler version. */
- /* this compiler provides the __int64 type */
+/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */
- /* Watcom doesn't provide 64-bit data types */
+/* Watcom doesn't provide 64-bit data types */
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
@@ -310,28 +310,28 @@ FT_BEGIN_HEADER
#elif defined( __GNUC__ )
- /* GCC provides the `long long' type */
+/* GCC provides the `long long' type */
#define FT_LONG64
#define FT_INT64 long long int
#endif /* FT_SIZEOF_LONG == 8 */
- /*************************************************************************/
- /* */
- /* A 64-bit data type will create compilation problems if you compile */
- /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
- /* is defined. You can however ignore this rule by defining the */
- /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
- /* */
+/*************************************************************************/
+/* */
+/* A 64-bit data type will create compilation problems if you compile */
+/* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
+/* is defined. You can however ignore this rule by defining the */
+/* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
+/* */
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
#ifdef __STDC__
- /* Undefine the 64-bit macros in strict ANSI compilation mode. */
- /* Since `#undef' doesn't survive in configuration header files */
- /* we use the postprocessing facility of AC_CONFIG_HEADERS to */
- /* replace the leading `/' with `#'. */
+/* Undefine the 64-bit macros in strict ANSI compilation mode. */
+/* Since `#undef' doesn't survive in configuration header files */
+/* we use the postprocessing facility of AC_CONFIG_HEADERS to */
+/* replace the leading `/' with `#'. */
#undef FT_LONG64
#undef FT_INT64
@@ -340,7 +340,7 @@ FT_BEGIN_HEADER
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
+typedef FT_INT64 FT_Int64;
#endif
@@ -350,33 +350,32 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
- /* Provide assembler fragments for performance-critical functions. */
- /* These must be defined `static __inline__' with GCC. */
+/* Provide assembler fragments for performance-critical functions. */
+/* These must be defined `static __inline__' with GCC. */
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
- /* documentation is in freetype.h */
+/* documentation is in freetype.h */
- static __inline FT_Int32
- FT_MulFix_arm( FT_Int32 a,
- FT_Int32 b )
- {
+static __inline FT_Int32
+FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+{
register FT_Int32 t, t2;
- __asm
- {
- smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
- mov a, t, asr #31 /* a = (hi >> 31) */
- add a, a, #0x8000 /* a += 0x8000 */
- adds t2, t2, a /* t2 += a */
- adc t, t, #0 /* t += carry */
- mov a, t2, lsr #16 /* a = t2 >> 16 */
- orr a, a, t, lsl #16 /* a |= t << 16 */
+ __asm {
+ smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
+ mov a, t, asr #31 /* a = (hi >> 31) */
+ add a, a, #0x8000 /* a += 0x8000 */
+ adds t2, t2, a /* t2 += a */
+ adc t, t, #0 /* t += carry */
+ mov a, t2, lsr #16 /* a = t2 >> 16 */
+ orr a, a, t, lsl #16 /* a |= t << 16 */
}
return a;
- }
+}
#endif /* __CC_ARM || __ARMCC__ */
@@ -387,58 +386,58 @@ FT_BEGIN_HEADER
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
- /* documentation is in freetype.h */
+/* documentation is in freetype.h */
- static __inline__ FT_Int32
- FT_MulFix_arm( FT_Int32 a,
- FT_Int32 b )
- {
+static __inline__ FT_Int32
+FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+{
register FT_Int32 t, t2;
__asm__ __volatile__ (
- "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
- "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
- "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
- "adds %1, %1, %0\n\t" /* %1 += %0 */
- "adc %2, %2, #0\n\t" /* %2 += carry */
- "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
- "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
- : "=r"(a), "=&r"(t2), "=&r"(t)
- : "r"(a), "r"(b)
- : "cc" );
+ "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
+ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
+ "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
+ "adds %1, %1, %0\n\t" /* %1 += %0 */
+ "adc %2, %2, #0\n\t" /* %2 += carry */
+ "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
+ "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
+ : "=r"(a), "=&r"(t2), "=&r"(t)
+ : "r"(a), "r"(b)
+ : "cc" );
return a;
- }
+}
#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
#if defined( __i386__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
- /* documentation is in freetype.h */
+/* documentation is in freetype.h */
- static __inline__ FT_Int32
- FT_MulFix_i386( FT_Int32 a,
- FT_Int32 b )
- {
+static __inline__ FT_Int32
+FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+{
register FT_Int32 result;
__asm__ __volatile__ (
- "imul %%edx\n"
- "movl %%edx, %%ecx\n"
- "sarl $31, %%ecx\n"
- "addl $0x8000, %%ecx\n"
- "addl %%ecx, %%eax\n"
- "adcl $0, %%edx\n"
- "shrl $16, %%eax\n"
- "shll $16, %%edx\n"
- "addl %%edx, %%eax\n"
- : "=a"(result), "=d"(b)
- : "a"(a), "d"(b)
- : "%ecx", "cc" );
+ "imul %%edx\n"
+ "movl %%edx, %%ecx\n"
+ "sarl $31, %%ecx\n"
+ "addl $0x8000, %%ecx\n"
+ "addl %%ecx, %%eax\n"
+ "adcl $0, %%edx\n"
+ "shrl $16, %%eax\n"
+ "shll $16, %%edx\n"
+ "addl %%edx, %%eax\n"
+ : "=a"(result), "=d"(b)
+ : "a"(a), "d"(b)
+ : "%ecx", "cc" );
return result;
- }
+}
#endif /* i386 */
@@ -451,31 +450,30 @@ FT_BEGIN_HEADER
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
- /* documentation is in freetype.h */
+/* documentation is in freetype.h */
- static __inline FT_Int32
- FT_MulFix_i386( FT_Int32 a,
- FT_Int32 b )
- {
+static __inline FT_Int32
+FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+{
register FT_Int32 result;
- __asm
- {
- mov eax, a
- mov edx, b
- imul edx
- mov ecx, edx
- sar ecx, 31
- add ecx, 8000h
- add eax, ecx
- adc edx, 0
- shr eax, 16
- shl edx, 16
- add eax, edx
- mov result, eax
+ __asm {
+ mov eax, a
+ mov edx, b
+ imul edx
+ mov ecx, edx
+ sar ecx, 31
+ add ecx, 8000h
+ add eax, ecx
+ adc edx, 0
+ shr eax, 16
+ shl edx, 16
+ add eax, edx
+ mov result, eax
}
return result;
- }
+}
#endif /* _M_IX86 */
@@ -563,29 +561,29 @@ FT_BEGIN_HEADER
#endif /* !FT_EXPORT_VAR */
- /* The following macros are needed to compile the library with a */
- /* C++ compiler and with 16bit compilers. */
- /* */
-
- /* This is special. Within C++, you must specify `extern "C"' for */
- /* functions which are used via function pointers, and you also */
- /* must do that for structures which contain function pointers to */
- /* assure C linkage -- it's not possible to have (local) anonymous */
- /* functions which are accessed by (global) function pointers. */
- /* */
- /* */
- /* FT_CALLBACK_DEF is used to _define_ a callback function. */
- /* */
- /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
- /* contains pointers to callback functions. */
- /* */
- /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
- /* that contains pointers to callback functions. */
- /* */
- /* */
- /* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl' or `__fastcall' declarations. */
- /* */
+/* The following macros are needed to compile the library with a */
+/* C++ compiler and with 16bit compilers. */
+/* */
+
+/* This is special. Within C++, you must specify `extern "C"' for */
+/* functions which are used via function pointers, and you also */
+/* must do that for structures which contain function pointers to */
+/* assure C linkage -- it's not possible to have (local) anonymous */
+/* functions which are accessed by (global) function pointers. */
+/* */
+/* */
+/* FT_CALLBACK_DEF is used to _define_ a callback function. */
+/* */
+/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
+/* contains pointers to callback functions. */
+/* */
+/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
+/* that contains pointers to callback functions. */
+/* */
+/* */
+/* Some 16bit compilers have to redefine these macros to insert */
+/* the infamous `_cdecl' or `__fastcall' declarations. */
+/* */
#ifndef FT_CALLBACK_DEF
#ifdef __cplusplus
#define FT_CALLBACK_DEF( x ) extern "C" x
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftheader.h b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftheader.h
index 93969ef..8c83621 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftheader.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftheader.h
@@ -19,17 +19,17 @@
#define __FT_HEADER_H__
- /*@***********************************************************************/
- /* */
- /* <Macro> */
- /* FT_BEGIN_HEADER */
- /* */
- /* <Description> */
- /* This macro is used in association with @FT_END_HEADER in header */
- /* files to ensure that the declarations within are properly */
- /* encapsulated in an `extern "C" { .. }' block when included from a */
- /* C++ compiler. */
- /* */
+/*@***********************************************************************/
+/* */
+/* <Macro> */
+/* FT_BEGIN_HEADER */
+/* */
+/* <Description> */
+/* This macro is used in association with @FT_END_HEADER in header */
+/* files to ensure that the declarations within are properly */
+/* encapsulated in an `extern "C" { .. }' block when included from a */
+/* C++ compiler. */
+/* */
#ifdef __cplusplus
#define FT_BEGIN_HEADER extern "C" {
#else
@@ -37,17 +37,17 @@
#endif
- /*@***********************************************************************/
- /* */
- /* <Macro> */
- /* FT_END_HEADER */
- /* */
- /* <Description> */
- /* This macro is used in association with @FT_BEGIN_HEADER in header */
- /* files to ensure that the declarations within are properly */
- /* encapsulated in an `extern "C" { .. }' block when included from a */
- /* C++ compiler. */
- /* */
+/*@***********************************************************************/
+/* */
+/* <Macro> */
+/* FT_END_HEADER */
+/* */
+/* <Description> */
+/* This macro is used in association with @FT_BEGIN_HEADER in header */
+/* files to ensure that the declarations within are properly */
+/* encapsulated in an `extern "C" { .. }' block when included from a */
+/* C++ compiler. */
+/* */
#ifdef __cplusplus
#define FT_END_HEADER }
#else
@@ -55,740 +55,740 @@
#endif
- /*************************************************************************/
- /* */
- /* Aliases for the FreeType 2 public and configuration files. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* header_file_macros */
- /* */
- /* <Title> */
- /* Header File Macros */
- /* */
- /* <Abstract> */
- /* Macro definitions used to #include specific header files. */
- /* */
- /* <Description> */
- /* The following macros are defined to the name of specific */
- /* FreeType~2 header files. They can be used directly in #include */
- /* statements as in: */
- /* */
- /* { */
- /* #include FT_FREETYPE_H */
- /* #include FT_MULTIPLE_MASTERS_H */
- /* #include FT_GLYPH_H */
- /* } */
- /* */
- /* There are several reasons why we are now using macros to name */
- /* public header files. The first one is that such macros are not */
- /* limited to the infamous 8.3~naming rule required by DOS (and */
- /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
- /* */
- /* The second reason is that it allows for more flexibility in the */
- /* way FreeType~2 is installed on a given system. */
- /* */
- /*************************************************************************/
-
-
- /* configuration files */
-
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_CONFIG_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 configuration data.
- *
- */
+/*************************************************************************/
+/* */
+/* Aliases for the FreeType 2 public and configuration files. */
+/* */
+/*************************************************************************/
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* header_file_macros */
+/* */
+/* <Title> */
+/* Header File Macros */
+/* */
+/* <Abstract> */
+/* Macro definitions used to #include specific header files. */
+/* */
+/* <Description> */
+/* The following macros are defined to the name of specific */
+/* FreeType~2 header files. They can be used directly in #include */
+/* statements as in: */
+/* */
+/* { */
+/* #include FT_FREETYPE_H */
+/* #include FT_MULTIPLE_MASTERS_H */
+/* #include FT_GLYPH_H */
+/* } */
+/* */
+/* There are several reasons why we are now using macros to name */
+/* public header files. The first one is that such macros are not */
+/* limited to the infamous 8.3~naming rule required by DOS (and */
+/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
+/* */
+/* The second reason is that it allows for more flexibility in the */
+/* way FreeType~2 is installed on a given system. */
+/* */
+/*************************************************************************/
+
+
+/* configuration files */
+
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_CONFIG_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 configuration data.
+ *
+ */
#ifndef FT_CONFIG_CONFIG_H
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
#endif
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_STANDARD_LIBRARY_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 interface to the standard C library functions.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_STANDARD_LIBRARY_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 interface to the standard C library functions.
+ *
+ */
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
#endif
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_OPTIONS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 project-specific configuration options.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_OPTIONS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 project-specific configuration options.
+ *
+ */
#ifndef FT_CONFIG_OPTIONS_H
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
#endif
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_MODULES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 modules that are statically linked to new library
- * instances in @FT_Init_FreeType.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_MODULES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 modules that are statically linked to new library
+ * instances in @FT_Init_FreeType.
+ *
+ */
#ifndef FT_CONFIG_MODULES_H
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
#endif
- /* */
+/* */
- /* public headers */
+/* public headers */
- /*************************************************************************
- *
- * @macro:
- * FT_FREETYPE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * base FreeType~2 API.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_FREETYPE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * base FreeType~2 API.
+ *
+ */
#define FT_FREETYPE_H <freetype/freetype.h>
- /*************************************************************************
- *
- * @macro:
- * FT_ERRORS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 error codes (and messages).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ERRORS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 error codes (and messages).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
#define FT_ERRORS_H <freetype/fterrors.h>
- /*************************************************************************
- *
- * @macro:
- * FT_MODULE_ERRORS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 module error offsets (and messages).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_MODULE_ERRORS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 module error offsets (and messages).
+ *
+ */
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
- /*************************************************************************
- *
- * @macro:
- * FT_SYSTEM_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 interface to low-level operations (i.e., memory management
- * and stream i/o).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_SYSTEM_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 interface to low-level operations (i.e., memory management
+ * and stream i/o).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
#define FT_SYSTEM_H <freetype/ftsystem.h>
- /*************************************************************************
- *
- * @macro:
- * FT_IMAGE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing type
- * definitions related to glyph images (i.e., bitmaps, outlines,
- * scan-converter parameters).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IMAGE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing type
+ * definitions related to glyph images (i.e., bitmaps, outlines,
+ * scan-converter parameters).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
#define FT_IMAGE_H <freetype/ftimage.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TYPES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * basic data types defined by FreeType~2.
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TYPES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * basic data types defined by FreeType~2.
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
#define FT_TYPES_H <freetype/fttypes.h>
- /*************************************************************************
- *
- * @macro:
- * FT_LIST_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list management API of FreeType~2.
- *
- * (Most applications will never need to include this file.)
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_LIST_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list management API of FreeType~2.
+ *
+ * (Most applications will never need to include this file.)
+ *
+ */
#define FT_LIST_H <freetype/ftlist.h>
- /*************************************************************************
- *
- * @macro:
- * FT_OUTLINE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * scalable outline management API of FreeType~2.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_OUTLINE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * scalable outline management API of FreeType~2.
+ *
+ */
#define FT_OUTLINE_H <freetype/ftoutln.h>
- /*************************************************************************
- *
- * @macro:
- * FT_SIZES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API which manages multiple @FT_Size objects per face.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_SIZES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API which manages multiple @FT_Size objects per face.
+ *
+ */
#define FT_SIZES_H <freetype/ftsizes.h>
- /*************************************************************************
- *
- * @macro:
- * FT_MODULE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * module management API of FreeType~2.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_MODULE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * module management API of FreeType~2.
+ *
+ */
#define FT_MODULE_H <freetype/ftmodapi.h>
- /*************************************************************************
- *
- * @macro:
- * FT_RENDER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * renderer module management API of FreeType~2.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_RENDER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * renderer module management API of FreeType~2.
+ *
+ */
#define FT_RENDER_H <freetype/ftrender.h>
- /*************************************************************************
- *
- * @macro:
- * FT_AUTOHINTER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * structures and macros related to the auto-hinting module.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_AUTOHINTER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the auto-hinting module.
+ *
+ */
#define FT_AUTOHINTER_H <freetype/ftautoh.h>
- /*************************************************************************
- *
- * @macro:
- * FT_CFF_DRIVER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * structures and macros related to the CFF driver module.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CFF_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the CFF driver module.
+ *
+ */
#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TYPE1_TABLES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * types and API specific to the Type~1 format.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TYPE1_TABLES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * types and API specific to the Type~1 format.
+ *
+ */
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_IDS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * enumeration values which identify name strings, languages, encodings,
- * etc. This file really contains a _large_ set of constant macro
- * definitions, taken from the TrueType and OpenType specifications.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_IDS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * enumeration values which identify name strings, languages, encodings,
+ * etc. This file really contains a _large_ set of constant macro
+ * definitions, taken from the TrueType and OpenType specifications.
+ *
+ */
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_TABLES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * types and API specific to the TrueType (as well as OpenType) format.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_TABLES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * types and API specific to the TrueType (as well as OpenType) format.
+ *
+ */
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_TAGS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of TrueType four-byte `tags' which identify blocks in
- * SFNT-based font formats (i.e., TrueType and OpenType).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_TAGS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of TrueType four-byte `tags' which identify blocks in
+ * SFNT-based font formats (i.e., TrueType and OpenType).
+ *
+ */
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
- /*************************************************************************
- *
- * @macro:
- * FT_BDF_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which accesses BDF-specific strings from a
- * face.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_BDF_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which accesses BDF-specific strings from a
+ * face.
+ *
+ */
#define FT_BDF_H <freetype/ftbdf.h>
- /*************************************************************************
- *
- * @macro:
- * FT_CID_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which access CID font information from a
- * face.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CID_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which access CID font information from a
+ * face.
+ *
+ */
#define FT_CID_H <freetype/ftcid.h>
- /*************************************************************************
- *
- * @macro:
- * FT_GZIP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports gzip-compressed files.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_GZIP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports gzip-compressed files.
+ *
+ */
#define FT_GZIP_H <freetype/ftgzip.h>
- /*************************************************************************
- *
- * @macro:
- * FT_LZW_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports LZW-compressed files.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_LZW_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports LZW-compressed files.
+ *
+ */
#define FT_LZW_H <freetype/ftlzw.h>
- /*************************************************************************
- *
- * @macro:
- * FT_BZIP2_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports bzip2-compressed files.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_BZIP2_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports bzip2-compressed files.
+ *
+ */
#define FT_BZIP2_H <freetype/ftbzip2.h>
- /*************************************************************************
- *
- * @macro:
- * FT_WINFONTS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports Windows FNT files.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_WINFONTS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports Windows FNT files.
+ *
+ */
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
- /*************************************************************************
- *
- * @macro:
- * FT_GLYPH_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional glyph management component.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_GLYPH_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional glyph management component.
+ *
+ */
#define FT_GLYPH_H <freetype/ftglyph.h>
- /*************************************************************************
- *
- * @macro:
- * FT_BITMAP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional bitmap conversion component.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_BITMAP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional bitmap conversion component.
+ *
+ */
#define FT_BITMAP_H <freetype/ftbitmap.h>
- /*************************************************************************
- *
- * @macro:
- * FT_BBOX_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional exact bounding box computation routines.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_BBOX_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional exact bounding box computation routines.
+ *
+ */
#define FT_BBOX_H <freetype/ftbbox.h>
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional FreeType~2 cache sub-system.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional FreeType~2 cache sub-system.
+ *
+ */
#define FT_CACHE_H <freetype/ftcache.h>
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_IMAGE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `glyph image' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for @FT_Glyph elements. You can also
- * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
- * store small glyph bitmaps, as it will use less memory.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * glyph image-related cache declarations.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_IMAGE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `glyph image' API of the FreeType~2 cache sub-system.
+ *
+ * It is used to define a cache for @FT_Glyph elements. You can also
+ * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
+ * store small glyph bitmaps, as it will use less memory.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * glyph image-related cache declarations.
+ *
+ */
#define FT_CACHE_IMAGE_H FT_CACHE_H
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_SMALL_BITMAPS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `small bitmaps' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for small glyph bitmaps in a relatively
- * memory-efficient way. You can also use the API defined in
- * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
- * including scalable outlines.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * small bitmaps-related cache declarations.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_SMALL_BITMAPS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `small bitmaps' API of the FreeType~2 cache sub-system.
+ *
+ * It is used to define a cache for small glyph bitmaps in a relatively
+ * memory-efficient way. You can also use the API defined in
+ * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
+ * including scalable outlines.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * small bitmaps-related cache declarations.
+ *
+ */
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_CHARMAP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `charmap' API of the FreeType~2 cache sub-system.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * charmap-based cache declarations.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_CHARMAP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `charmap' API of the FreeType~2 cache sub-system.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * charmap-based cache declarations.
+ *
+ */
#define FT_CACHE_CHARMAP_H FT_CACHE_H
- /*************************************************************************
- *
- * @macro:
- * FT_MAC_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * Macintosh-specific FreeType~2 API. The latter is used to access
- * fonts embedded in resource forks.
- *
- * This header file must be explicitly included by client applications
- * compiled on the Mac (note that the base API still works though).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_MAC_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * Macintosh-specific FreeType~2 API. The latter is used to access
+ * fonts embedded in resource forks.
+ *
+ * This header file must be explicitly included by client applications
+ * compiled on the Mac (note that the base API still works though).
+ *
+ */
#define FT_MAC_H <freetype/ftmac.h>
- /*************************************************************************
- *
- * @macro:
- * FT_MULTIPLE_MASTERS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional multiple-masters management API of FreeType~2.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_MULTIPLE_MASTERS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional multiple-masters management API of FreeType~2.
+ *
+ */
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
- /*************************************************************************
- *
- * @macro:
- * FT_SFNT_NAMES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which accesses embedded `name' strings in
- * SFNT-based font formats (i.e., TrueType and OpenType).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_SFNT_NAMES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which accesses embedded `name' strings in
+ * SFNT-based font formats (i.e., TrueType and OpenType).
+ *
+ */
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
- /*************************************************************************
- *
- * @macro:
- * FT_OPENTYPE_VALIDATE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
- * GPOS, GSUB, JSTF).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_OPENTYPE_VALIDATE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
+ * GPOS, GSUB, JSTF).
+ *
+ */
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
- /*************************************************************************
- *
- * @macro:
- * FT_GX_VALIDATE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
- * mort, morx, bsln, just, kern, opbd, trak, prop).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_GX_VALIDATE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
+ * mort, morx, bsln, just, kern, opbd, trak, prop).
+ *
+ */
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
- /*************************************************************************
- *
- * @macro:
- * FT_PFR_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which accesses PFR-specific data.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_PFR_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which accesses PFR-specific data.
+ *
+ */
#define FT_PFR_H <freetype/ftpfr.h>
- /*************************************************************************
- *
- * @macro:
- * FT_STROKER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which provides functions to stroke outline paths.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_STROKER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which provides functions to stroke outline paths.
+ */
#define FT_STROKER_H <freetype/ftstroke.h>
- /*************************************************************************
- *
- * @macro:
- * FT_SYNTHESIS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs artificial obliquing and emboldening.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_SYNTHESIS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs artificial obliquing and emboldening.
+ */
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
- /*************************************************************************
- *
- * @macro:
- * FT_XFREE86_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which provides functions specific to the XFree86 and
- * X.Org X11 servers.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_XFREE86_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which provides functions specific to the XFree86 and
+ * X.Org X11 servers.
+ */
#define FT_XFREE86_H <freetype/ftxf86.h>
- /*************************************************************************
- *
- * @macro:
- * FT_TRIGONOMETRY_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs trigonometric computations (e.g.,
- * cosines and arc tangents).
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_TRIGONOMETRY_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs trigonometric computations (e.g.,
+ * cosines and arc tangents).
+ */
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
- /*************************************************************************
- *
- * @macro:
- * FT_LCD_FILTER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_LCD_FILTER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
- /*************************************************************************
- *
- * @macro:
- * FT_UNPATENTED_HINTING_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_UNPATENTED_HINTING_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
- /*************************************************************************
- *
- * @macro:
- * FT_INCREMENTAL_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_INCREMENTAL_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
- /*************************************************************************
- *
- * @macro:
- * FT_GASP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which returns entries from the TrueType GASP table.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_GASP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which returns entries from the TrueType GASP table.
+ */
#define FT_GASP_H <freetype/ftgasp.h>
- /*************************************************************************
- *
- * @macro:
- * FT_ADVANCES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which returns individual and ranged glyph advances.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ADVANCES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which returns individual and ranged glyph advances.
+ */
#define FT_ADVANCES_H <freetype/ftadvanc.h>
- /* */
+/* */
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
- /* The internals of the cache sub-system are no longer exposed. We */
- /* default to FT_CACHE_H at the moment just in case, but we know of */
- /* no rogue client that uses them. */
- /* */
+/* The internals of the cache sub-system are no longer exposed. We */
+/* default to FT_CACHE_H at the moment just in case, but we know of */
+/* no rogue client that uses them. */
+/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
@@ -803,10 +803,10 @@
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
- /*
- * Include internal headers definitions from <freetype/internal/...>
- * only when building the library.
- */
+/*
+ * Include internal headers definitions from <freetype/internal/...>
+ * only when building the library.
+ */
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
#include FT_INTERNAL_INTERNAL_H
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftoption.h b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftoption.h
index 93e9eb5..e007105 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftoption.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftoption.h
@@ -25,506 +25,506 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* USER-SELECTABLE CONFIGURATION MACROS */
- /* */
- /* This file contains the default configuration macro definitions for */
- /* a standard build of the FreeType library. There are three ways to */
- /* use this file to build project-specific versions of the library: */
- /* */
- /* - You can modify this file by hand, but this is not recommended in */
- /* cases where you would like to build several versions of the */
- /* library from a single source directory. */
- /* */
- /* - You can put a copy of this file in your build directory, more */
- /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
- /* is the name of a directory that is included _before_ the FreeType */
- /* include path during compilation. */
- /* */
- /* The default FreeType Makefiles and Jamfiles use the build */
- /* directory `builds/<system>' by default, but you can easily change */
- /* that for your own projects. */
- /* */
- /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
- /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
- /* locate this file during the build. For example, */
- /* */
- /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
- /* #include <freetype/config/ftheader.h> */
- /* */
- /* will use `$BUILD/myftoptions.h' instead of this file for macro */
- /* definitions. */
- /* */
- /* Note also that you can similarly pre-define the macro */
- /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
- /* that are statically linked to the library at compile time. By */
- /* default, this file is <freetype/config/ftmodule.h>. */
- /* */
- /* We highly recommend using the third method whenever possible. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Uncomment the line below if you want to activate sub-pixel rendering */
- /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
- /* */
- /* Note that this feature is covered by several Microsoft patents */
- /* and should not be activated in any default build of the library. */
- /* */
- /* This macro has no impact on the FreeType API, only on its */
- /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
- /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
- /* the original size in case this macro isn't defined; however, each */
- /* triplet of subpixels has R=G=B. */
- /* */
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
+/*************************************************************************/
+/* */
+/* USER-SELECTABLE CONFIGURATION MACROS */
+/* */
+/* This file contains the default configuration macro definitions for */
+/* a standard build of the FreeType library. There are three ways to */
+/* use this file to build project-specific versions of the library: */
+/* */
+/* - You can modify this file by hand, but this is not recommended in */
+/* cases where you would like to build several versions of the */
+/* library from a single source directory. */
+/* */
+/* - You can put a copy of this file in your build directory, more */
+/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
+/* is the name of a directory that is included _before_ the FreeType */
+/* include path during compilation. */
+/* */
+/* The default FreeType Makefiles and Jamfiles use the build */
+/* directory `builds/<system>' by default, but you can easily change */
+/* that for your own projects. */
+/* */
+/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
+/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
+/* locate this file during the build. For example, */
+/* */
+/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
+/* #include <freetype/config/ftheader.h> */
+/* */
+/* will use `$BUILD/myftoptions.h' instead of this file for macro */
+/* definitions. */
+/* */
+/* Note also that you can similarly pre-define the macro */
+/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
+/* that are statically linked to the library at compile time. By */
+/* default, this file is <freetype/config/ftmodule.h>. */
+/* */
+/* We highly recommend using the third method whenever possible. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/*************************************************************************/
+/**** ****/
+/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
+/**** ****/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* Uncomment the line below if you want to activate sub-pixel rendering */
+/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
+/* */
+/* Note that this feature is covered by several Microsoft patents */
+/* and should not be activated in any default build of the library. */
+/* */
+/* This macro has no impact on the FreeType API, only on its */
+/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
+/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
+/* the original size in case this macro isn't defined; however, each */
+/* triplet of subpixels has R=G=B. */
+/* */
+/* This is done to allow FreeType clients to run unmodified, forcing */
+/* them to display normal gray-level anti-aliased glyphs. */
+/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
- /*************************************************************************/
- /* */
- /* Many compilers provide a non-ANSI 64-bit data type that can be used */
- /* by FreeType to speed up some computations. However, this will create */
- /* some problems when compiling the library in strict ANSI mode. */
- /* */
- /* For this reason, the use of 64-bit integers is normally disabled when */
- /* the __STDC__ macro is defined. You can however disable this by */
- /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
- /* */
- /* For most compilers, this will only create compilation warnings when */
- /* building the library. */
- /* */
- /* ObNote: The compiler-specific 64-bit integers are detected in the */
- /* file `ftconfig.h' either statically or through the */
- /* `configure' script on supported platforms. */
- /* */
+/*************************************************************************/
+/* */
+/* Many compilers provide a non-ANSI 64-bit data type that can be used */
+/* by FreeType to speed up some computations. However, this will create */
+/* some problems when compiling the library in strict ANSI mode. */
+/* */
+/* For this reason, the use of 64-bit integers is normally disabled when */
+/* the __STDC__ macro is defined. You can however disable this by */
+/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
+/* */
+/* For most compilers, this will only create compilation warnings when */
+/* building the library. */
+/* */
+/* ObNote: The compiler-specific 64-bit integers are detected in the */
+/* file `ftconfig.h' either statically or through the */
+/* `configure' script on supported platforms. */
+/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
- /*************************************************************************/
- /* */
- /* If this macro is defined, do not try to use an assembler version of */
- /* performance-critical functions (e.g. FT_MulFix). You should only do */
- /* that to verify that the assembler function works properly, or to */
- /* execute benchmark tests of the various implementations. */
+/*************************************************************************/
+/* */
+/* If this macro is defined, do not try to use an assembler version of */
+/* performance-critical functions (e.g. FT_MulFix). You should only do */
+/* that to verify that the assembler function works properly, or to */
+/* execute benchmark tests of the various implementations. */
/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
- /*************************************************************************/
- /* */
- /* If this macro is defined, try to use an inlined assembler version of */
- /* the `FT_MulFix' function, which is a `hotspot' when loading and */
- /* hinting glyphs, and which should be executed as fast as possible. */
- /* */
- /* Note that if your compiler or CPU is not supported, this will default */
- /* to the standard and portable implementation found in `ftcalc.c'. */
- /* */
+/*************************************************************************/
+/* */
+/* If this macro is defined, try to use an inlined assembler version of */
+/* the `FT_MulFix' function, which is a `hotspot' when loading and */
+/* hinting glyphs, and which should be executed as fast as possible. */
+/* */
+/* Note that if your compiler or CPU is not supported, this will default */
+/* to the standard and portable implementation found in `ftcalc.c'. */
+/* */
#define FT_CONFIG_OPTION_INLINE_MULFIX
- /*************************************************************************/
- /* */
- /* LZW-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `compress' program. This is mostly used to parse many of the PCF */
- /* files that come with various X11 distributions. The implementation */
- /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
- /* (see src/lzw/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
+/*************************************************************************/
+/* */
+/* LZW-compressed file support. */
+/* */
+/* FreeType now handles font files that have been compressed with the */
+/* `compress' program. This is mostly used to parse many of the PCF */
+/* files that come with various X11 distributions. The implementation */
+/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
+/* (see src/lzw/ftgzip.c). */
+/* */
+/* Define this macro if you want to enable this `feature'. */
+/* */
#define FT_CONFIG_OPTION_USE_LZW
- /*************************************************************************/
- /* */
- /* Gzip-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `gzip' program. This is mostly used to parse many of the PCF files */
- /* that come with XFree86. The implementation uses `zlib' to */
- /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. See also */
- /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
- /* */
+/*************************************************************************/
+/* */
+/* Gzip-compressed file support. */
+/* */
+/* FreeType now handles font files that have been compressed with the */
+/* `gzip' program. This is mostly used to parse many of the PCF files */
+/* that come with XFree86. The implementation uses `zlib' to */
+/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
+/* */
+/* Define this macro if you want to enable this `feature'. See also */
+/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
+/* */
#define FT_CONFIG_OPTION_USE_ZLIB
- /*************************************************************************/
- /* */
- /* ZLib library selection */
- /* */
- /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
- /* It allows FreeType's `ftgzip' component to link to the system's */
- /* installation of the ZLib library. This is useful on systems like */
- /* Unix or VMS where it generally is already available. */
- /* */
- /* If you let it undefined, the component will use its own copy */
- /* of the zlib sources instead. These have been modified to be */
- /* included directly within the component and *not* export external */
- /* function names. This allows you to link any program with FreeType */
- /* _and_ ZLib without linking conflicts. */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
+/*************************************************************************/
+/* */
+/* ZLib library selection */
+/* */
+/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
+/* It allows FreeType's `ftgzip' component to link to the system's */
+/* installation of the ZLib library. This is useful on systems like */
+/* Unix or VMS where it generally is already available. */
+/* */
+/* If you let it undefined, the component will use its own copy */
+/* of the zlib sources instead. These have been modified to be */
+/* included directly within the component and *not* export external */
+/* function names. This allows you to link any program with FreeType */
+/* _and_ ZLib without linking conflicts. */
+/* */
+/* Do not #undef this macro here since the build system might define */
+/* it for certain configurations only. */
+/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
- /*************************************************************************/
- /* */
- /* Bzip2-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `bzip2' program. This is mostly used to parse many of the PCF */
- /* files that come with XFree86. The implementation uses `libbz2' to */
- /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
- /* Contrary to gzip, bzip2 currently is not included and need to use */
- /* the system available bzip2 implementation. */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
+/*************************************************************************/
+/* */
+/* Bzip2-compressed file support. */
+/* */
+/* FreeType now handles font files that have been compressed with the */
+/* `bzip2' program. This is mostly used to parse many of the PCF */
+/* files that come with XFree86. The implementation uses `libbz2' to */
+/* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
+/* Contrary to gzip, bzip2 currently is not included and need to use */
+/* the system available bzip2 implementation. */
+/* */
+/* Define this macro if you want to enable this `feature'. */
+/* */
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
- /*************************************************************************/
- /* */
- /* Define to disable the use of file stream functions and types, FILE, */
- /* fopen() etc. Enables the use of smaller system libraries on embedded */
- /* systems that have multiple system libraries, some with or without */
- /* file stream support, in the cases where file stream support is not */
- /* necessary such as memory loading of font files. */
- /* */
+/*************************************************************************/
+/* */
+/* Define to disable the use of file stream functions and types, FILE, */
+/* fopen() etc. Enables the use of smaller system libraries on embedded */
+/* systems that have multiple system libraries, some with or without */
+/* file stream support, in the cases where file stream support is not */
+/* necessary such as memory loading of font files. */
+/* */
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
- /*************************************************************************/
- /* */
- /* DLL export compilation */
- /* */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special keyword in front OR after the return type of function */
- /* declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
- /* */
- /* FT_EXPORT( return_type ) */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* */
- /* */
- /* FT_EXPORT_DEF( return_type ) */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* */
- /* You can provide your own implementation of FT_EXPORT and */
- /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
- /* will be later automatically defined as `extern return_type' to */
- /* allow normal compilation. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
+/*************************************************************************/
+/* */
+/* DLL export compilation */
+/* */
+/* When compiling FreeType as a DLL, some systems/compilers need a */
+/* special keyword in front OR after the return type of function */
+/* declarations. */
+/* */
+/* Two macros are used within the FreeType source code to define */
+/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
+/* */
+/* FT_EXPORT( return_type ) */
+/* */
+/* is used in a function declaration, as in */
+/* */
+/* FT_EXPORT( FT_Error ) */
+/* FT_Init_FreeType( FT_Library* alibrary ); */
+/* */
+/* */
+/* FT_EXPORT_DEF( return_type ) */
+/* */
+/* is used in a function definition, as in */
+/* */
+/* FT_EXPORT_DEF( FT_Error ) */
+/* FT_Init_FreeType( FT_Library* alibrary ) */
+/* { */
+/* ... some code ... */
+/* return FT_Err_Ok; */
+/* } */
+/* */
+/* You can provide your own implementation of FT_EXPORT and */
+/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
+/* will be later automatically defined as `extern return_type' to */
+/* allow normal compilation. */
+/* */
+/* Do not #undef these macros here since the build system might define */
+/* them for certain configurations only. */
+/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
- /*************************************************************************/
- /* */
- /* Glyph Postscript Names handling */
- /* */
- /* By default, FreeType 2 is compiled with the `psnames' module. This */
- /* module is in charge of converting a glyph name string into a */
- /* Unicode value, or return a Macintosh standard glyph name for the */
- /* use with the TrueType `post' table. */
- /* */
- /* Undefine this macro if you do not want `psnames' compiled in your */
- /* build of FreeType. This has the following effects: */
- /* */
- /* - The TrueType driver will provide its own set of glyph names, */
- /* if you build it to support postscript names in the TrueType */
- /* `post' table. */
- /* */
- /* - The Type 1 driver will not be able to synthesize a Unicode */
- /* charmap out of the glyphs found in the fonts. */
- /* */
- /* You would normally undefine this configuration macro when building */
- /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
- /* */
+/*************************************************************************/
+/* */
+/* Glyph Postscript Names handling */
+/* */
+/* By default, FreeType 2 is compiled with the `psnames' module. This */
+/* module is in charge of converting a glyph name string into a */
+/* Unicode value, or return a Macintosh standard glyph name for the */
+/* use with the TrueType `post' table. */
+/* */
+/* Undefine this macro if you do not want `psnames' compiled in your */
+/* build of FreeType. This has the following effects: */
+/* */
+/* - The TrueType driver will provide its own set of glyph names, */
+/* if you build it to support postscript names in the TrueType */
+/* `post' table. */
+/* */
+/* - The Type 1 driver will not be able to synthesize a Unicode */
+/* charmap out of the glyphs found in the fonts. */
+/* */
+/* You would normally undefine this configuration macro when building */
+/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
+/* */
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- /*************************************************************************/
- /* */
- /* Postscript Names to Unicode Values support */
- /* */
- /* By default, FreeType 2 is built with the `PSNames' module compiled */
- /* in. Among other things, the module is used to convert a glyph name */
- /* into a Unicode value. This is especially useful in order to */
- /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
- /* through a big table named the `Adobe Glyph List' (AGL). */
- /* */
- /* Undefine this macro if you do not want the Adobe Glyph List */
- /* compiled in your `PSNames' module. The Type 1 driver will not be */
- /* able to synthesize a Unicode charmap out of the glyphs found in the */
- /* fonts. */
- /* */
+/*************************************************************************/
+/* */
+/* Postscript Names to Unicode Values support */
+/* */
+/* By default, FreeType 2 is built with the `PSNames' module compiled */
+/* in. Among other things, the module is used to convert a glyph name */
+/* into a Unicode value. This is especially useful in order to */
+/* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
+/* through a big table named the `Adobe Glyph List' (AGL). */
+/* */
+/* Undefine this macro if you do not want the Adobe Glyph List */
+/* compiled in your `PSNames' module. The Type 1 driver will not be */
+/* able to synthesize a Unicode charmap out of the glyphs found in the */
+/* fonts. */
+/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- /*************************************************************************/
- /* */
- /* Support for Mac fonts */
- /* */
- /* Define this macro if you want support for outline fonts in Mac */
- /* format (mac dfont, mac resource, macbinary containing a mac */
- /* resource) on non-Mac platforms. */
- /* */
- /* Note that the `FOND' resource isn't checked. */
- /* */
+/*************************************************************************/
+/* */
+/* Support for Mac fonts */
+/* */
+/* Define this macro if you want support for outline fonts in Mac */
+/* format (mac dfont, mac resource, macbinary containing a mac */
+/* resource) on non-Mac platforms. */
+/* */
+/* Note that the `FOND' resource isn't checked. */
+/* */
#define FT_CONFIG_OPTION_MAC_FONTS
- /*************************************************************************/
- /* */
- /* Guessing methods to access embedded resource forks */
- /* */
- /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
- /* GNU/Linux). */
- /* */
- /* Resource forks which include fonts data are stored sometimes in */
- /* locations which users or developers don't expected. In some cases, */
- /* resource forks start with some offset from the head of a file. In */
- /* other cases, the actual resource fork is stored in file different */
- /* from what the user specifies. If this option is activated, */
- /* FreeType tries to guess whether such offsets or different file */
- /* names must be used. */
- /* */
- /* Note that normal, direct access of resource forks is controlled via */
- /* the FT_CONFIG_OPTION_MAC_FONTS option. */
- /* */
+/*************************************************************************/
+/* */
+/* Guessing methods to access embedded resource forks */
+/* */
+/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
+/* GNU/Linux). */
+/* */
+/* Resource forks which include fonts data are stored sometimes in */
+/* locations which users or developers don't expected. In some cases, */
+/* resource forks start with some offset from the head of a file. In */
+/* other cases, the actual resource fork is stored in file different */
+/* from what the user specifies. If this option is activated, */
+/* FreeType tries to guess whether such offsets or different file */
+/* names must be used. */
+/* */
+/* Note that normal, direct access of resource forks is controlled via */
+/* the FT_CONFIG_OPTION_MAC_FONTS option. */
+/* */
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#endif
- /*************************************************************************/
- /* */
- /* Allow the use of FT_Incremental_Interface to load typefaces that */
- /* contain no glyph data, but supply it via a callback function. */
- /* This is required by clients supporting document formats which */
- /* supply font data incrementally as the document is parsed, such */
- /* as the Ghostscript interpreter for the PostScript language. */
- /* */
+/*************************************************************************/
+/* */
+/* Allow the use of FT_Incremental_Interface to load typefaces that */
+/* contain no glyph data, but supply it via a callback function. */
+/* This is required by clients supporting document formats which */
+/* supply font data incrementally as the document is parsed, such */
+/* as the Ghostscript interpreter for the PostScript language. */
+/* */
#define FT_CONFIG_OPTION_INCREMENTAL
- /*************************************************************************/
- /* */
- /* The size in bytes of the render pool used by the scan-line converter */
- /* to do all of its work. */
- /* */
- /* This must be greater than 4KByte if you use FreeType to rasterize */
- /* glyphs; otherwise, you may set it to zero to avoid unnecessary */
- /* allocation of the render pool. */
- /* */
+/*************************************************************************/
+/* */
+/* The size in bytes of the render pool used by the scan-line converter */
+/* to do all of its work. */
+/* */
+/* This must be greater than 4KByte if you use FreeType to rasterize */
+/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
+/* allocation of the render pool. */
+/* */
#define FT_RENDER_POOL_SIZE 16384L
- /*************************************************************************/
- /* */
- /* FT_MAX_MODULES */
- /* */
- /* The maximum number of modules that can be registered in a single */
- /* FreeType library object. 32 is the default. */
- /* */
+/*************************************************************************/
+/* */
+/* FT_MAX_MODULES */
+/* */
+/* The maximum number of modules that can be registered in a single */
+/* FreeType library object. 32 is the default. */
+/* */
#define FT_MAX_MODULES 32
- /*************************************************************************/
- /* */
- /* Debug level */
- /* */
- /* FreeType can be compiled in debug or trace mode. In debug mode, */
- /* errors are reported through the `ftdebug' component. In trace */
- /* mode, additional messages are sent to the standard output during */
- /* execution. */
- /* */
- /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
- /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
- /* */
- /* Don't define any of these macros to compile in `release' mode! */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
+/*************************************************************************/
+/* */
+/* Debug level */
+/* */
+/* FreeType can be compiled in debug or trace mode. In debug mode, */
+/* errors are reported through the `ftdebug' component. In trace */
+/* mode, additional messages are sent to the standard output during */
+/* execution. */
+/* */
+/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
+/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
+/* */
+/* Don't define any of these macros to compile in `release' mode! */
+/* */
+/* Do not #undef these macros here since the build system might define */
+/* them for certain configurations only. */
+/* */
/* #define FT_DEBUG_LEVEL_ERROR */
/* #define FT_DEBUG_LEVEL_TRACE */
- /*************************************************************************/
- /* */
- /* Autofitter debugging */
- /* */
- /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
- /* control the autofitter behaviour for debugging purposes with global */
- /* boolean variables (consequently, you should *never* enable this */
- /* while compiling in `release' mode): */
- /* */
- /* _af_debug_disable_horz_hints */
- /* _af_debug_disable_vert_hints */
- /* _af_debug_disable_blue_hints */
- /* */
- /* Additionally, the following functions provide dumps of various */
- /* internal autofit structures to stdout (using `printf'): */
- /* */
- /* af_glyph_hints_dump_points */
- /* af_glyph_hints_dump_segments */
- /* af_glyph_hints_dump_edges */
- /* */
- /* As an argument, they use another global variable: */
- /* */
- /* _af_debug_hints */
- /* */
- /* Please have a look at the `ftgrid' demo program to see how those */
- /* variables and macros should be used. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
+/*************************************************************************/
+/* */
+/* Autofitter debugging */
+/* */
+/* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
+/* control the autofitter behaviour for debugging purposes with global */
+/* boolean variables (consequently, you should *never* enable this */
+/* while compiling in `release' mode): */
+/* */
+/* _af_debug_disable_horz_hints */
+/* _af_debug_disable_vert_hints */
+/* _af_debug_disable_blue_hints */
+/* */
+/* Additionally, the following functions provide dumps of various */
+/* internal autofit structures to stdout (using `printf'): */
+/* */
+/* af_glyph_hints_dump_points */
+/* af_glyph_hints_dump_segments */
+/* af_glyph_hints_dump_edges */
+/* */
+/* As an argument, they use another global variable: */
+/* */
+/* _af_debug_hints */
+/* */
+/* Please have a look at the `ftgrid' demo program to see how those */
+/* variables and macros should be used. */
+/* */
+/* Do not #undef these macros here since the build system might define */
+/* them for certain configurations only. */
+/* */
/* #define FT_DEBUG_AUTOFIT */
- /*************************************************************************/
- /* */
- /* Memory Debugging */
- /* */
- /* FreeType now comes with an integrated memory debugger that is */
- /* capable of detecting simple errors like memory leaks or double */
- /* deletes. To compile it within your build of the library, you */
- /* should define FT_DEBUG_MEMORY here. */
- /* */
- /* Note that the memory debugger is only activated at runtime when */
- /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
+/*************************************************************************/
+/* */
+/* Memory Debugging */
+/* */
+/* FreeType now comes with an integrated memory debugger that is */
+/* capable of detecting simple errors like memory leaks or double */
+/* deletes. To compile it within your build of the library, you */
+/* should define FT_DEBUG_MEMORY here. */
+/* */
+/* Note that the memory debugger is only activated at runtime when */
+/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
+/* */
+/* Do not #undef this macro here since the build system might define */
+/* it for certain configurations only. */
+/* */
/* #define FT_DEBUG_MEMORY */
- /*************************************************************************/
- /* */
- /* Module errors */
- /* */
- /* If this macro is set (which is _not_ the default), the higher byte */
- /* of an error code gives the module in which the error has occurred, */
- /* while the lower byte is the real error code. */
- /* */
- /* Setting this macro makes sense for debugging purposes only, since */
- /* it would break source compatibility of certain programs that use */
- /* FreeType 2. */
- /* */
- /* More details can be found in the files ftmoderr.h and fterrors.h. */
- /* */
+/*************************************************************************/
+/* */
+/* Module errors */
+/* */
+/* If this macro is set (which is _not_ the default), the higher byte */
+/* of an error code gives the module in which the error has occurred, */
+/* while the lower byte is the real error code. */
+/* */
+/* Setting this macro makes sense for debugging purposes only, since */
+/* it would break source compatibility of certain programs that use */
+/* FreeType 2. */
+/* */
+/* More details can be found in the files ftmoderr.h and fterrors.h. */
+/* */
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
- /*************************************************************************/
- /* */
- /* Position Independent Code */
- /* */
- /* If this macro is set (which is _not_ the default), FreeType2 will */
- /* avoid creating constants that require address fixups. Instead the */
- /* constants will be moved into a struct and additional intialization */
- /* code will be used. */
- /* */
- /* Setting this macro is needed for systems that prohibit address */
- /* fixups, such as BREW. */
- /* */
+/*************************************************************************/
+/* */
+/* Position Independent Code */
+/* */
+/* If this macro is set (which is _not_ the default), FreeType2 will */
+/* avoid creating constants that require address fixups. Instead the */
+/* constants will be moved into a struct and additional intialization */
+/* code will be used. */
+/* */
+/* Setting this macro is needed for systems that prohibit address */
+/* fixups, such as BREW. */
+/* */
/* #define FT_CONFIG_OPTION_PIC */
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/**** ****/
+/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
+/**** ****/
+/*************************************************************************/
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
- /* embedded bitmaps in all formats using the SFNT module (namely */
- /* TrueType & OpenType). */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
+/* embedded bitmaps in all formats using the SFNT module (namely */
+/* TrueType & OpenType). */
+/* */
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
- /* load and enumerate the glyph Postscript names in a TrueType or */
- /* OpenType file. */
- /* */
- /* Note that when you do not compile the `PSNames' module by undefining */
- /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
- /* contain additional code used to read the PS Names table from a font. */
- /* */
- /* (By default, the module uses `PSNames' to extract glyph names.) */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
+/* load and enumerate the glyph Postscript names in a TrueType or */
+/* OpenType file. */
+/* */
+/* Note that when you do not compile the `PSNames' module by undefining */
+/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
+/* contain additional code used to read the PS Names table from a font. */
+/* */
+/* (By default, the module uses `PSNames' to extract glyph names.) */
+/* */
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
- /* access the internal name table in a SFNT-based format like TrueType */
- /* or OpenType. The name table contains various strings used to */
- /* describe the font, like family name, copyright, version, etc. It */
- /* does not contain any glyph name though. */
- /* */
- /* Accessing SFNT names is done through the functions declared in */
- /* `freetype/ftsnames.h'. */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
+/* access the internal name table in a SFNT-based format like TrueType */
+/* or OpenType. The name table contains various strings used to */
+/* describe the font, like family name, copyright, version, etc. It */
+/* does not contain any glyph name though. */
+/* */
+/* Accessing SFNT names is done through the functions declared in */
+/* `freetype/ftsnames.h'. */
+/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
- /*************************************************************************/
- /* */
- /* TrueType CMap support */
- /* */
- /* Here you can fine-tune which TrueType CMap table format shall be */
- /* supported. */
+/*************************************************************************/
+/* */
+/* TrueType CMap support */
+/* */
+/* Here you can fine-tune which TrueType CMap table format shall be */
+/* supported. */
#define TT_CONFIG_CMAP_FORMAT_0
#define TT_CONFIG_CMAP_FORMAT_2
#define TT_CONFIG_CMAP_FORMAT_4
@@ -536,281 +536,281 @@ FT_BEGIN_HEADER
#define TT_CONFIG_CMAP_FORMAT_14
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
- /* a bytecode interpreter in the TrueType driver. */
- /* */
- /* By undefining this, you will only compile the code necessary to load */
- /* TrueType glyphs without hinting. */
- /* */
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
+/*************************************************************************/
+/*************************************************************************/
+/**** ****/
+/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
+/**** ****/
+/*************************************************************************/
+/*************************************************************************/
+
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
+/* a bytecode interpreter in the TrueType driver. */
+/* */
+/* By undefining this, you will only compile the code necessary to load */
+/* TrueType glyphs without hinting. */
+/* */
+/* Do not #undef this macro here, since the build system might */
+/* define it for certain configurations only. */
+/* */
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
- /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
- /* replaces the native TrueType hinting mechanism when anything but */
- /* FT_RENDER_MODE_MONO is requested. */
- /* */
- /* Enabling this causes the TrueType driver to ignore instructions under */
- /* certain conditions. This is done in accordance with the guide here, */
- /* with some minor differences: */
- /* */
- /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
- /* */
- /* By undefining this, you only compile the code necessary to hint */
- /* TrueType glyphs with native TT hinting. */
- /* */
- /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
- /* defined. */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
+/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
+/* replaces the native TrueType hinting mechanism when anything but */
+/* FT_RENDER_MODE_MONO is requested. */
+/* */
+/* Enabling this causes the TrueType driver to ignore instructions under */
+/* certain conditions. This is done in accordance with the guide here, */
+/* with some minor differences: */
+/* */
+/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
+/* */
+/* By undefining this, you only compile the code necessary to hint */
+/* TrueType glyphs with native TT hinting. */
+/* */
+/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
+/* defined. */
+/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- /*************************************************************************/
- /* */
- /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
- /* of the TrueType bytecode interpreter is used that doesn't implement */
- /* any of the patented opcodes and algorithms. The patents related to */
- /* TrueType hinting have expired worldwide since May 2010; this option */
- /* is now deprecated. */
- /* */
- /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
- /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
- /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
- /* */
- /* This macro is only useful for a small number of font files (mostly */
- /* for Asian scripts) that require bytecode interpretation to properly */
- /* load glyphs. For all other fonts, this produces unpleasant results, */
- /* thus the unpatented interpreter is never used to load glyphs from */
- /* TrueType fonts unless one of the following two options is used. */
- /* */
- /* - The unpatented interpreter is explicitly activated by the user */
- /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
- /* when opening the FT_Face. */
- /* */
- /* - FreeType detects that the FT_Face corresponds to one of the */
- /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
- /* contains a hard-coded list of font names and other matching */
- /* parameters (see function `tt_face_init' in file */
- /* `src/truetype/ttobjs.c'). */
- /* */
- /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
- /* */
- /* { */
- /* FT_Parameter parameter; */
- /* FT_Open_Args open_args; */
- /* */
- /* */
- /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
- /* */
- /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
- /* open_args.pathname = my_font_pathname; */
- /* open_args.num_params = 1; */
- /* open_args.params = &parameter; */
- /* */
- /* error = FT_Open_Face( library, &open_args, index, &face ); */
- /* ... */
- /* } */
- /* */
+/*************************************************************************/
+/* */
+/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
+/* of the TrueType bytecode interpreter is used that doesn't implement */
+/* any of the patented opcodes and algorithms. The patents related to */
+/* TrueType hinting have expired worldwide since May 2010; this option */
+/* is now deprecated. */
+/* */
+/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
+/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
+/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
+/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
+/* */
+/* This macro is only useful for a small number of font files (mostly */
+/* for Asian scripts) that require bytecode interpretation to properly */
+/* load glyphs. For all other fonts, this produces unpleasant results, */
+/* thus the unpatented interpreter is never used to load glyphs from */
+/* TrueType fonts unless one of the following two options is used. */
+/* */
+/* - The unpatented interpreter is explicitly activated by the user */
+/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
+/* when opening the FT_Face. */
+/* */
+/* - FreeType detects that the FT_Face corresponds to one of the */
+/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
+/* contains a hard-coded list of font names and other matching */
+/* parameters (see function `tt_face_init' in file */
+/* `src/truetype/ttobjs.c'). */
+/* */
+/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
+/* */
+/* { */
+/* FT_Parameter parameter; */
+/* FT_Open_Args open_args; */
+/* */
+/* */
+/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
+/* */
+/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
+/* open_args.pathname = my_font_pathname; */
+/* open_args.num_params = 1; */
+/* open_args.params = &parameter; */
+/* */
+/* error = FT_Open_Face( library, &open_args, index, &face ); */
+/* ... */
+/* } */
+/* */
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
- /* bytecode interpreter with a huge switch statement, rather than a call */
- /* table. This results in smaller and faster code for a number of */
- /* architectures. */
- /* */
- /* Note however that on some compiler/processor combinations, undefining */
- /* this macro will generate faster, though larger, code. */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
+/* bytecode interpreter with a huge switch statement, rather than a call */
+/* table. This results in smaller and faster code for a number of */
+/* architectures. */
+/* */
+/* Note however that on some compiler/processor combinations, undefining */
+/* this macro will generate faster, though larger, code. */
+/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
- /* TrueType glyph loader to use Apple's definition of how to handle */
- /* component offsets in composite glyphs. */
- /* */
- /* Apple and MS disagree on the default behavior of component offsets */
- /* in composites. Apple says that they should be scaled by the scaling */
- /* factors in the transformation matrix (roughly, it's more complex) */
- /* while MS says they should not. OpenType defines two bits in the */
- /* composite flags array which can be used to disambiguate, but old */
- /* fonts will not have them. */
- /* */
- /* http://www.microsoft.com/typography/otspec/glyf.htm */
- /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
+/* TrueType glyph loader to use Apple's definition of how to handle */
+/* component offsets in composite glyphs. */
+/* */
+/* Apple and MS disagree on the default behavior of component offsets */
+/* in composites. Apple says that they should be scaled by the scaling */
+/* factors in the transformation matrix (roughly, it's more complex) */
+/* while MS says they should not. OpenType defines two bits in the */
+/* composite flags array which can be used to disambiguate, but old */
+/* fonts will not have them. */
+/* */
+/* http://www.microsoft.com/typography/otspec/glyf.htm */
+/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
+/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
- /* support for Apple's distortable font technology (fvar, gvar, cvar, */
- /* and avar tables). This has many similarities to Type 1 Multiple */
- /* Masters support. */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
+/* support for Apple's distortable font technology (fvar, gvar, cvar, */
+/* and avar tables). This has many similarities to Type 1 Multiple */
+/* Masters support. */
+/* */
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
- /* an embedded `BDF ' table within SFNT-based bitmap formats. */
- /* */
+/*************************************************************************/
+/* */
+/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
+/* an embedded `BDF ' table within SFNT-based bitmap formats. */
+/* */
#define TT_CONFIG_OPTION_BDF
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/**** ****/
+/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
+/**** ****/
+/*************************************************************************/
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
- /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
- /* required. */
- /* */
+/*************************************************************************/
+/* */
+/* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
+/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
+/* required. */
+/* */
#define T1_MAX_DICT_DEPTH 5
- /*************************************************************************/
- /* */
- /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
- /* calls during glyph loading. */
- /* */
+/*************************************************************************/
+/* */
+/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
+/* calls during glyph loading. */
+/* */
#define T1_MAX_SUBRS_CALLS 16
- /*************************************************************************/
- /* */
- /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
- /* minimum of 16 is required. */
- /* */
- /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
- /* */
+/*************************************************************************/
+/* */
+/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
+/* minimum of 16 is required. */
+/* */
+/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
+/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 256
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
- /* files into an existing face. Note that if set, the T1 driver will be */
- /* unable to produce kerning distances. */
- /* */
+/*************************************************************************/
+/* */
+/* Define this configuration macro if you want to prevent the */
+/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
+/* files into an existing face. Note that if set, the T1 driver will be */
+/* unable to produce kerning distances. */
+/* */
#undef T1_CONFIG_OPTION_NO_AFM
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of the Multiple Masters font support in the Type 1 */
- /* driver. */
- /* */
+/*************************************************************************/
+/* */
+/* Define this configuration macro if you want to prevent the */
+/* compilation of the Multiple Masters font support in the Type 1 */
+/* driver. */
+/* */
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/**** ****/
+/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
+/**** ****/
+/*************************************************************************/
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
- /* support. */
- /* */
+/*************************************************************************/
+/* */
+/* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
+/* support. */
+/* */
#define AF_CONFIG_OPTION_CJK
- /*************************************************************************/
- /* */
- /* Compile autofit module with Indic script support. */
- /* */
+/*************************************************************************/
+/* */
+/* Compile autofit module with Indic script support. */
+/* */
#define AF_CONFIG_OPTION_INDIC
- /*************************************************************************/
- /* */
- /* Compile autofit module with warp hinting. The idea of the warping */
- /* code is to slightly scale and shift a glyph within a single dimension */
- /* so that as much of its segments are aligned (more or less) on the */
- /* grid. To find out the optimal scaling and shifting value, various */
- /* parameter combinations are tried and scored. */
- /* */
- /* This experimental option is only active if the render mode is */
- /* FT_RENDER_MODE_LIGHT. */
- /* */
+/*************************************************************************/
+/* */
+/* Compile autofit module with warp hinting. The idea of the warping */
+/* code is to slightly scale and shift a glyph within a single dimension */
+/* so that as much of its segments are aligned (more or less) on the */
+/* grid. To find out the optimal scaling and shifting value, various */
+/* parameter combinations are tried and scored. */
+/* */
+/* This experimental option is only active if the render mode is */
+/* FT_RENDER_MODE_LIGHT. */
+/* */
/* #define AF_CONFIG_OPTION_USE_WARPER */
- /* */
+/* */
- /*
- * Define this variable if you want to keep the layout of internal
- * structures that was used prior to FreeType 2.2. This also compiles in
- * a few obsolete functions to avoid linking problems on typical Unix
- * distributions.
- *
- * For embedded systems or building a new distribution from scratch, it
- * is recommended to disable the macro since it reduces the library's code
- * size and activates a few memory-saving optimizations as well.
- */
+/*
+ * Define this variable if you want to keep the layout of internal
+ * structures that was used prior to FreeType 2.2. This also compiles in
+ * a few obsolete functions to avoid linking problems on typical Unix
+ * distributions.
+ *
+ * For embedded systems or building a new distribution from scratch, it
+ * is recommended to disable the macro since it reduces the library's code
+ * size and activates a few memory-saving optimizations as well.
+ */
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
- /*
- * To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
- * we restrict the number of charmaps in a font. The current API of
- * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
- * takes charcode only. To determine the passed value is for cmap_index
- * or charcode, the possible cmap_index is restricted not to exceed
- * the minimum possible charcode by a rogue client. It is also very
- * unlikely that a rogue client is interested in Unicode values 0 to 15.
- *
- * NOTE: The original threshold was 4 deduced from popular number of
- * cmap subtables in UCS-4 TrueType fonts, but now it is not
- * irregular for OpenType fonts to have more than 4 subtables,
- * because variation selector subtables are available for Apple
- * and Microsoft platforms.
- */
+/*
+ * To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
+ * we restrict the number of charmaps in a font. The current API of
+ * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
+ * takes charcode only. To determine the passed value is for cmap_index
+ * or charcode, the possible cmap_index is restricted not to exceed
+ * the minimum possible charcode by a rogue client. It is also very
+ * unlikely that a rogue client is interested in Unicode values 0 to 15.
+ *
+ * NOTE: The original threshold was 4 deduced from popular number of
+ * cmap subtables in UCS-4 TrueType fonts, but now it is not
+ * irregular for OpenType fonts to have more than 4 subtables,
+ * because variation selector subtables are available for Apple
+ * and Microsoft platforms.
+ */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_MAX_CHARMAP_CACHEABLE 15
#endif
- /*
- * This macro is defined if either unpatented or native TrueType
- * hinting is requested by the definitions above.
- */
+/*
+ * This macro is defined if either unpatented or native TrueType
+ * hinting is requested by the definitions above.
+ */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftstdlib.h b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftstdlib.h
index b940efc..55da6be 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftstdlib.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/config/ftstdlib.h
@@ -17,16 +17,16 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This file is used to group all #includes to the ANSI C library that */
- /* FreeType normally requires. It also defines macros to rename the */
- /* standard functions within the FreeType source code. */
- /* */
- /* Load a file which defines __FTSTDLIB_H__ before this one to override */
- /* it. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This file is used to group all #includes to the ANSI C library that */
+/* FreeType normally requires. It also defines macros to rename the */
+/* standard functions within the FreeType source code. */
+/* */
+/* Load a file which defines __FTSTDLIB_H__ before this one to override */
+/* it. */
+/* */
+/*************************************************************************/
#ifndef __FTSTDLIB_H__
@@ -38,23 +38,23 @@
#define ft_ptrdiff_t ptrdiff_t
- /**********************************************************************/
- /* */
- /* integer limits */
- /* */
- /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
- /* of `int' and `long' in bytes at compile-time. So far, this works */
- /* for all platforms the library has been tested on. */
- /* */
- /* Note that on the extremely rare platforms that do not provide */
- /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
- /* old Crays where `int' is 36 bits), we do not make any guarantee */
- /* about the correct behaviour of FT2 with all fonts. */
- /* */
- /* In these case, `ftconfig.h' will refuse to compile anyway with a */
- /* message like `couldn't find 32-bit type' or something similar. */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* integer limits */
+/* */
+/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
+/* of `int' and `long' in bytes at compile-time. So far, this works */
+/* for all platforms the library has been tested on. */
+/* */
+/* Note that on the extremely rare platforms that do not provide */
+/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
+/* old Crays where `int' is 36 bits), we do not make any guarantee */
+/* about the correct behaviour of FT2 with all fonts. */
+/* */
+/* In these case, `ftconfig.h' will refuse to compile anyway with a */
+/* message like `couldn't find 32-bit type' or something similar. */
+/* */
+/**********************************************************************/
#include <limits.h>
@@ -67,11 +67,11 @@
#define FT_ULONG_MAX ULONG_MAX
- /**********************************************************************/
- /* */
- /* character and string processing */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* character and string processing */
+/* */
+/**********************************************************************/
#include <string.h>
@@ -91,11 +91,11 @@
#define ft_strstr strstr
- /**********************************************************************/
- /* */
- /* file handling */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* file handling */
+/* */
+/**********************************************************************/
#include <stdio.h>
@@ -109,11 +109,11 @@
#define ft_sprintf sprintf
- /**********************************************************************/
- /* */
- /* sorting */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* sorting */
+/* */
+/**********************************************************************/
#include <stdlib.h>
@@ -121,11 +121,11 @@
#define ft_qsort qsort
- /**********************************************************************/
- /* */
- /* memory allocation */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* memory allocation */
+/* */
+/**********************************************************************/
#define ft_scalloc calloc
@@ -134,36 +134,36 @@
#define ft_srealloc realloc
- /**********************************************************************/
- /* */
- /* miscellaneous */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* miscellaneous */
+/* */
+/**********************************************************************/
#define ft_atol atol
#define ft_labs labs
- /**********************************************************************/
- /* */
- /* execution control */
- /* */
- /**********************************************************************/
+/**********************************************************************/
+/* */
+/* execution control */
+/* */
+/**********************************************************************/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
- /* jmp_buf is defined as a macro */
- /* on certain platforms */
+/* jmp_buf is defined as a macro */
+/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
- /* the following is only used for debugging purposes, i.e., if */
- /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
+/* the following is only used for debugging purposes, i.e., if */
+/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
#include <stdarg.h>
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/freetype.h b/thirdparties/common/include/libfreetype/freetype2/freetype/freetype.h
index 57a03a7..c502ec3 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/freetype.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/freetype.h
@@ -39,210 +39,209 @@ FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* user_allocation */
- /* */
- /* <Title> */
- /* User allocation */
- /* */
- /* <Abstract> */
- /* How client applications should allocate FreeType data structures. */
- /* */
- /* <Description> */
- /* FreeType assumes that structures allocated by the user and passed */
- /* as arguments are zeroed out except for the actual data. In other */
- /* words, it is recommended to use `calloc' (or variants of it) */
- /* instead of `malloc' for allocation. */
- /* */
- /*************************************************************************/
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S I C T Y P E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* base_interface */
- /* */
- /* <Title> */
- /* Base Interface */
- /* */
- /* <Abstract> */
- /* The FreeType~2 base font interface. */
- /* */
- /* <Description> */
- /* This section describes the public high-level API of FreeType~2. */
- /* */
- /* <Order> */
- /* FT_Library */
- /* FT_Face */
- /* FT_Size */
- /* FT_GlyphSlot */
- /* FT_CharMap */
- /* FT_Encoding */
- /* */
- /* FT_FaceRec */
- /* */
- /* FT_FACE_FLAG_SCALABLE */
- /* FT_FACE_FLAG_FIXED_SIZES */
- /* FT_FACE_FLAG_FIXED_WIDTH */
- /* FT_FACE_FLAG_HORIZONTAL */
- /* FT_FACE_FLAG_VERTICAL */
- /* FT_FACE_FLAG_SFNT */
- /* FT_FACE_FLAG_KERNING */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS */
- /* FT_FACE_FLAG_GLYPH_NAMES */
- /* FT_FACE_FLAG_EXTERNAL_STREAM */
- /* FT_FACE_FLAG_FAST_GLYPHS */
- /* FT_FACE_FLAG_HINTER */
- /* */
- /* FT_STYLE_FLAG_BOLD */
- /* FT_STYLE_FLAG_ITALIC */
- /* */
- /* FT_SizeRec */
- /* FT_Size_Metrics */
- /* */
- /* FT_GlyphSlotRec */
- /* FT_Glyph_Metrics */
- /* FT_SubGlyph */
- /* */
- /* FT_Bitmap_Size */
- /* */
- /* FT_Init_FreeType */
- /* FT_Done_FreeType */
- /* */
- /* FT_New_Face */
- /* FT_Done_Face */
- /* FT_New_Memory_Face */
- /* FT_Open_Face */
- /* FT_Open_Args */
- /* FT_Parameter */
- /* FT_Attach_File */
- /* FT_Attach_Stream */
- /* */
- /* FT_Set_Char_Size */
- /* FT_Set_Pixel_Sizes */
- /* FT_Request_Size */
- /* FT_Select_Size */
- /* FT_Size_Request_Type */
- /* FT_Size_Request */
- /* FT_Set_Transform */
- /* FT_Load_Glyph */
- /* FT_Get_Char_Index */
- /* FT_Get_Name_Index */
- /* FT_Load_Char */
- /* */
- /* FT_OPEN_MEMORY */
- /* FT_OPEN_STREAM */
- /* FT_OPEN_PATHNAME */
- /* FT_OPEN_DRIVER */
- /* FT_OPEN_PARAMS */
- /* */
- /* FT_LOAD_DEFAULT */
- /* FT_LOAD_RENDER */
- /* FT_LOAD_MONOCHROME */
- /* FT_LOAD_LINEAR_DESIGN */
- /* FT_LOAD_NO_SCALE */
- /* FT_LOAD_NO_HINTING */
- /* FT_LOAD_NO_BITMAP */
- /* FT_LOAD_CROP_BITMAP */
- /* */
- /* FT_LOAD_VERTICAL_LAYOUT */
- /* FT_LOAD_IGNORE_TRANSFORM */
- /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
- /* FT_LOAD_FORCE_AUTOHINT */
- /* FT_LOAD_NO_RECURSE */
- /* FT_LOAD_PEDANTIC */
- /* */
- /* FT_LOAD_TARGET_NORMAL */
- /* FT_LOAD_TARGET_LIGHT */
- /* FT_LOAD_TARGET_MONO */
- /* FT_LOAD_TARGET_LCD */
- /* FT_LOAD_TARGET_LCD_V */
- /* */
- /* FT_Render_Glyph */
- /* FT_Render_Mode */
- /* FT_Get_Kerning */
- /* FT_Kerning_Mode */
- /* FT_Get_Track_Kerning */
- /* FT_Get_Glyph_Name */
- /* FT_Get_Postscript_Name */
- /* */
- /* FT_CharMapRec */
- /* FT_Select_Charmap */
- /* FT_Set_Charmap */
- /* FT_Get_Charmap_Index */
- /* */
- /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
- /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
- /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
- /* FT_FSTYPE_EDITABLE_EMBEDDING */
- /* FT_FSTYPE_NO_SUBSETTING */
- /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
- /* */
- /* FT_Get_FSType_Flags */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Glyph_Metrics */
- /* */
- /* <Description> */
- /* A structure used to model the metrics of a single glyph. The */
- /* values are expressed in 26.6 fractional pixel format; if the flag */
- /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
- /* are expressed in font units instead. */
- /* */
- /* <Fields> */
- /* width :: */
- /* The glyph's width. */
- /* */
- /* height :: */
- /* The glyph's height. */
- /* */
- /* horiBearingX :: */
- /* Left side bearing for horizontal layout. */
- /* */
- /* horiBearingY :: */
- /* Top side bearing for horizontal layout. */
- /* */
- /* horiAdvance :: */
- /* Advance width for horizontal layout. */
- /* */
- /* vertBearingX :: */
- /* Left side bearing for vertical layout. */
- /* */
- /* vertBearingY :: */
- /* Top side bearing for vertical layout. Larger positive values */
- /* mean further below the vertical glyph origin. */
- /* */
- /* vertAdvance :: */
- /* Advance height for vertical layout. Positive values mean the */
- /* glyph has a positive advance downward. */
- /* */
- /* <Note> */
- /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
- /* dimensions of the hinted glyph (in case hinting is applicable). */
- /* */
- /* Stroking a glyph with an outside border does not increase */
- /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
- /* values to account for the added width and height. */
- /* */
- typedef struct FT_Glyph_Metrics_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* user_allocation */
+/* */
+/* <Title> */
+/* User allocation */
+/* */
+/* <Abstract> */
+/* How client applications should allocate FreeType data structures. */
+/* */
+/* <Description> */
+/* FreeType assumes that structures allocated by the user and passed */
+/* as arguments are zeroed out except for the actual data. In other */
+/* words, it is recommended to use `calloc' (or variants of it) */
+/* instead of `malloc' for allocation. */
+/* */
+/*************************************************************************/
+
+
+
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* B A S I C T Y P E S */
+/* */
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* base_interface */
+/* */
+/* <Title> */
+/* Base Interface */
+/* */
+/* <Abstract> */
+/* The FreeType~2 base font interface. */
+/* */
+/* <Description> */
+/* This section describes the public high-level API of FreeType~2. */
+/* */
+/* <Order> */
+/* FT_Library */
+/* FT_Face */
+/* FT_Size */
+/* FT_GlyphSlot */
+/* FT_CharMap */
+/* FT_Encoding */
+/* */
+/* FT_FaceRec */
+/* */
+/* FT_FACE_FLAG_SCALABLE */
+/* FT_FACE_FLAG_FIXED_SIZES */
+/* FT_FACE_FLAG_FIXED_WIDTH */
+/* FT_FACE_FLAG_HORIZONTAL */
+/* FT_FACE_FLAG_VERTICAL */
+/* FT_FACE_FLAG_SFNT */
+/* FT_FACE_FLAG_KERNING */
+/* FT_FACE_FLAG_MULTIPLE_MASTERS */
+/* FT_FACE_FLAG_GLYPH_NAMES */
+/* FT_FACE_FLAG_EXTERNAL_STREAM */
+/* FT_FACE_FLAG_FAST_GLYPHS */
+/* FT_FACE_FLAG_HINTER */
+/* */
+/* FT_STYLE_FLAG_BOLD */
+/* FT_STYLE_FLAG_ITALIC */
+/* */
+/* FT_SizeRec */
+/* FT_Size_Metrics */
+/* */
+/* FT_GlyphSlotRec */
+/* FT_Glyph_Metrics */
+/* FT_SubGlyph */
+/* */
+/* FT_Bitmap_Size */
+/* */
+/* FT_Init_FreeType */
+/* FT_Done_FreeType */
+/* */
+/* FT_New_Face */
+/* FT_Done_Face */
+/* FT_New_Memory_Face */
+/* FT_Open_Face */
+/* FT_Open_Args */
+/* FT_Parameter */
+/* FT_Attach_File */
+/* FT_Attach_Stream */
+/* */
+/* FT_Set_Char_Size */
+/* FT_Set_Pixel_Sizes */
+/* FT_Request_Size */
+/* FT_Select_Size */
+/* FT_Size_Request_Type */
+/* FT_Size_Request */
+/* FT_Set_Transform */
+/* FT_Load_Glyph */
+/* FT_Get_Char_Index */
+/* FT_Get_Name_Index */
+/* FT_Load_Char */
+/* */
+/* FT_OPEN_MEMORY */
+/* FT_OPEN_STREAM */
+/* FT_OPEN_PATHNAME */
+/* FT_OPEN_DRIVER */
+/* FT_OPEN_PARAMS */
+/* */
+/* FT_LOAD_DEFAULT */
+/* FT_LOAD_RENDER */
+/* FT_LOAD_MONOCHROME */
+/* FT_LOAD_LINEAR_DESIGN */
+/* FT_LOAD_NO_SCALE */
+/* FT_LOAD_NO_HINTING */
+/* FT_LOAD_NO_BITMAP */
+/* FT_LOAD_CROP_BITMAP */
+/* */
+/* FT_LOAD_VERTICAL_LAYOUT */
+/* FT_LOAD_IGNORE_TRANSFORM */
+/* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
+/* FT_LOAD_FORCE_AUTOHINT */
+/* FT_LOAD_NO_RECURSE */
+/* FT_LOAD_PEDANTIC */
+/* */
+/* FT_LOAD_TARGET_NORMAL */
+/* FT_LOAD_TARGET_LIGHT */
+/* FT_LOAD_TARGET_MONO */
+/* FT_LOAD_TARGET_LCD */
+/* FT_LOAD_TARGET_LCD_V */
+/* */
+/* FT_Render_Glyph */
+/* FT_Render_Mode */
+/* FT_Get_Kerning */
+/* FT_Kerning_Mode */
+/* FT_Get_Track_Kerning */
+/* FT_Get_Glyph_Name */
+/* FT_Get_Postscript_Name */
+/* */
+/* FT_CharMapRec */
+/* FT_Select_Charmap */
+/* FT_Set_Charmap */
+/* FT_Get_Charmap_Index */
+/* */
+/* FT_FSTYPE_INSTALLABLE_EMBEDDING */
+/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
+/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
+/* FT_FSTYPE_EDITABLE_EMBEDDING */
+/* FT_FSTYPE_NO_SUBSETTING */
+/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
+/* */
+/* FT_Get_FSType_Flags */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Glyph_Metrics */
+/* */
+/* <Description> */
+/* A structure used to model the metrics of a single glyph. The */
+/* values are expressed in 26.6 fractional pixel format; if the flag */
+/* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
+/* are expressed in font units instead. */
+/* */
+/* <Fields> */
+/* width :: */
+/* The glyph's width. */
+/* */
+/* height :: */
+/* The glyph's height. */
+/* */
+/* horiBearingX :: */
+/* Left side bearing for horizontal layout. */
+/* */
+/* horiBearingY :: */
+/* Top side bearing for horizontal layout. */
+/* */
+/* horiAdvance :: */
+/* Advance width for horizontal layout. */
+/* */
+/* vertBearingX :: */
+/* Left side bearing for vertical layout. */
+/* */
+/* vertBearingY :: */
+/* Top side bearing for vertical layout. Larger positive values */
+/* mean further below the vertical glyph origin. */
+/* */
+/* vertAdvance :: */
+/* Advance height for vertical layout. Positive values mean the */
+/* glyph has a positive advance downward. */
+/* */
+/* <Note> */
+/* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
+/* dimensions of the hinted glyph (in case hinting is applicable). */
+/* */
+/* Stroking a glyph with an outside border does not increase */
+/* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
+/* values to account for the added width and height. */
+/* */
+typedef struct FT_Glyph_Metrics_ {
FT_Pos width;
FT_Pos height;
@@ -254,49 +253,48 @@ FT_BEGIN_HEADER
FT_Pos vertBearingY;
FT_Pos vertAdvance;
- } FT_Glyph_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap_Size */
- /* */
- /* <Description> */
- /* This structure models the metrics of a bitmap strike (i.e., a set */
- /* of glyphs for a given point size and resolution) in a bitmap font. */
- /* It is used for the `available_sizes' field of @FT_Face. */
- /* */
- /* <Fields> */
- /* height :: The vertical distance, in pixels, between two */
- /* consecutive baselines. It is always positive. */
- /* */
- /* width :: The average width, in pixels, of all glyphs in the */
- /* strike. */
- /* */
- /* size :: The nominal size of the strike in 26.6 fractional */
- /* points. This field is not very useful. */
- /* */
- /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
- /* pixels. */
- /* */
- /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
- /* pixels. */
- /* */
- /* <Note> */
- /* Windows FNT: */
- /* The nominal size given in a FNT font is not reliable. Thus when */
- /* the driver finds it incorrect, it sets `size' to some calculated */
- /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
- /* height given in the font, respectively. */
- /* */
- /* TrueType embedded bitmaps: */
- /* `size', `width', and `height' values are not contained in the */
- /* bitmap strike itself. They are computed from the global font */
- /* parameters. */
- /* */
- typedef struct FT_Bitmap_Size_
- {
+} FT_Glyph_Metrics;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Bitmap_Size */
+/* */
+/* <Description> */
+/* This structure models the metrics of a bitmap strike (i.e., a set */
+/* of glyphs for a given point size and resolution) in a bitmap font. */
+/* It is used for the `available_sizes' field of @FT_Face. */
+/* */
+/* <Fields> */
+/* height :: The vertical distance, in pixels, between two */
+/* consecutive baselines. It is always positive. */
+/* */
+/* width :: The average width, in pixels, of all glyphs in the */
+/* strike. */
+/* */
+/* size :: The nominal size of the strike in 26.6 fractional */
+/* points. This field is not very useful. */
+/* */
+/* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
+/* pixels. */
+/* */
+/* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
+/* pixels. */
+/* */
+/* <Note> */
+/* Windows FNT: */
+/* The nominal size given in a FNT font is not reliable. Thus when */
+/* the driver finds it incorrect, it sets `size' to some calculated */
+/* values and sets `x_ppem' and `y_ppem' to the pixel width and */
+/* height given in the font, respectively. */
+/* */
+/* TrueType embedded bitmaps: */
+/* `size', `width', and `height' values are not contained in the */
+/* bitmap strike itself. They are computed from the global font */
+/* parameters. */
+/* */
+typedef struct FT_Bitmap_Size_ {
FT_Short height;
FT_Short width;
@@ -305,207 +303,207 @@ FT_BEGIN_HEADER
FT_Pos x_ppem;
FT_Pos y_ppem;
- } FT_Bitmap_Size;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Library */
- /* */
- /* <Description> */
- /* A handle to a FreeType library instance. Each `library' is */
- /* completely independent from the others; it is the `root' of a set */
- /* of objects like fonts, faces, sizes, etc. */
- /* */
- /* It also embeds a memory manager (see @FT_Memory), as well as a */
- /* scan-line converter object (see @FT_Raster). */
- /* */
- /* For multi-threading applications each thread should have its own */
- /* FT_Library object. */
- /* */
- /* <Note> */
- /* Library objects are normally created by @FT_Init_FreeType, and */
- /* destroyed with @FT_Done_FreeType. */
- /* */
- typedef struct FT_LibraryRec_ *FT_Library;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Module */
- /* */
- /* <Description> */
- /* A handle to a given FreeType module object. Each module can be a */
- /* font driver, a renderer, or anything else that provides services */
- /* to the formers. */
- /* */
- typedef struct FT_ModuleRec_* FT_Module;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Driver */
- /* */
- /* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is a special module capable of creating faces from font files. */
- /* */
- typedef struct FT_DriverRec_* FT_Driver;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Renderer */
- /* */
- /* <Description> */
- /* A handle to a given FreeType renderer. A renderer is a special */
- /* module in charge of converting a glyph image to a bitmap, when */
- /* necessary. Each renderer supports a given glyph image format, and */
- /* one or more target surface depths. */
- /* */
- typedef struct FT_RendererRec_* FT_Renderer;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face */
- /* */
- /* <Description> */
- /* A handle to a given typographic face object. A face object models */
- /* a given typeface, in a given style. */
- /* */
- /* <Note> */
- /* Each face object also owns a single @FT_GlyphSlot object, as well */
- /* as one or more @FT_Size objects. */
- /* */
- /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
- /* a given filepathname or a custom input stream. */
- /* */
- /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
- /* */
- /* <Also> */
- /* See @FT_FaceRec for the publicly accessible fields of a given face */
- /* object. */
- /* */
- typedef struct FT_FaceRec_* FT_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size */
- /* */
- /* <Description> */
- /* A handle to an object used to model a face scaled to a given */
- /* character size. */
- /* */
- /* <Note> */
- /* Each @FT_Face has an _active_ @FT_Size object that is used by */
- /* functions like @FT_Load_Glyph to determine the scaling */
- /* transformation which is used to load and hint glyphs and metrics. */
- /* */
- /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
- /* @FT_Request_Size or even @FT_Select_Size to change the content */
- /* (i.e., the scaling values) of the active @FT_Size. */
- /* */
- /* You can use @FT_New_Size to create additional size objects for a */
- /* given @FT_Face, but they won't be used by other functions until */
- /* you activate it through @FT_Activate_Size. Only one size can be */
- /* activated at any given time per face. */
- /* */
- /* <Also> */
- /* See @FT_SizeRec for the publicly accessible fields of a given size */
- /* object. */
- /* */
- typedef struct FT_SizeRec_* FT_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained in its parent */
- /* face. */
- /* */
- /* In other words, each time you call @FT_Load_Glyph or */
- /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
- /* i.e., the glyph's metrics, its image (bitmap or outline), and */
- /* other control information. */
- /* */
- /* <Also> */
- /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
- /* */
- typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_CharMap */
- /* */
- /* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
- /* */
- /* Each face object owns zero or more charmaps, but only one of them */
- /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
- /* */
- /* The list of available charmaps in a face is available through the */
- /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
- /* */
- /* The currently active charmap is available as `face->charmap'. */
- /* You should call @FT_Set_Charmap to change it. */
- /* */
- /* <Note> */
- /* When a new face is created (either through @FT_New_Face or */
- /* @FT_Open_Face), the library looks for a Unicode charmap within */
- /* the list and automatically activates it. */
- /* */
- /* <Also> */
- /* See @FT_CharMapRec for the publicly accessible fields of a given */
- /* character map. */
- /* */
- typedef struct FT_CharMapRec_* FT_CharMap;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_ENC_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags into an unsigned long. It is */
- /* used to define `encoding' identifiers (see @FT_Encoding). */
- /* */
- /* <Note> */
- /* Since many 16-bit compilers don't like 32-bit enumerations, you */
- /* should redefine this macro in case of problems to something like */
- /* this: */
- /* */
- /* { */
- /* #define FT_ENC_TAG( value, a, b, c, d ) value */
- /* } */
- /* */
- /* to get a simple enumeration without assigning special numbers. */
- /* */
+} FT_Bitmap_Size;
+
+
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* O B J E C T C L A S S E S */
+/* */
+/*************************************************************************/
+/*************************************************************************/
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Library */
+/* */
+/* <Description> */
+/* A handle to a FreeType library instance. Each `library' is */
+/* completely independent from the others; it is the `root' of a set */
+/* of objects like fonts, faces, sizes, etc. */
+/* */
+/* It also embeds a memory manager (see @FT_Memory), as well as a */
+/* scan-line converter object (see @FT_Raster). */
+/* */
+/* For multi-threading applications each thread should have its own */
+/* FT_Library object. */
+/* */
+/* <Note> */
+/* Library objects are normally created by @FT_Init_FreeType, and */
+/* destroyed with @FT_Done_FreeType. */
+/* */
+typedef struct FT_LibraryRec_ *FT_Library;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Module */
+/* */
+/* <Description> */
+/* A handle to a given FreeType module object. Each module can be a */
+/* font driver, a renderer, or anything else that provides services */
+/* to the formers. */
+/* */
+typedef struct FT_ModuleRec_* FT_Module;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Driver */
+/* */
+/* <Description> */
+/* A handle to a given FreeType font driver object. Each font driver */
+/* is a special module capable of creating faces from font files. */
+/* */
+typedef struct FT_DriverRec_* FT_Driver;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Renderer */
+/* */
+/* <Description> */
+/* A handle to a given FreeType renderer. A renderer is a special */
+/* module in charge of converting a glyph image to a bitmap, when */
+/* necessary. Each renderer supports a given glyph image format, and */
+/* one or more target surface depths. */
+/* */
+typedef struct FT_RendererRec_* FT_Renderer;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Face */
+/* */
+/* <Description> */
+/* A handle to a given typographic face object. A face object models */
+/* a given typeface, in a given style. */
+/* */
+/* <Note> */
+/* Each face object also owns a single @FT_GlyphSlot object, as well */
+/* as one or more @FT_Size objects. */
+/* */
+/* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
+/* a given filepathname or a custom input stream. */
+/* */
+/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
+/* */
+/* <Also> */
+/* See @FT_FaceRec for the publicly accessible fields of a given face */
+/* object. */
+/* */
+typedef struct FT_FaceRec_* FT_Face;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Size */
+/* */
+/* <Description> */
+/* A handle to an object used to model a face scaled to a given */
+/* character size. */
+/* */
+/* <Note> */
+/* Each @FT_Face has an _active_ @FT_Size object that is used by */
+/* functions like @FT_Load_Glyph to determine the scaling */
+/* transformation which is used to load and hint glyphs and metrics. */
+/* */
+/* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
+/* @FT_Request_Size or even @FT_Select_Size to change the content */
+/* (i.e., the scaling values) of the active @FT_Size. */
+/* */
+/* You can use @FT_New_Size to create additional size objects for a */
+/* given @FT_Face, but they won't be used by other functions until */
+/* you activate it through @FT_Activate_Size. Only one size can be */
+/* activated at any given time per face. */
+/* */
+/* <Also> */
+/* See @FT_SizeRec for the publicly accessible fields of a given size */
+/* object. */
+/* */
+typedef struct FT_SizeRec_* FT_Size;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_GlyphSlot */
+/* */
+/* <Description> */
+/* A handle to a given `glyph slot'. A slot is a container where it */
+/* is possible to load any of the glyphs contained in its parent */
+/* face. */
+/* */
+/* In other words, each time you call @FT_Load_Glyph or */
+/* @FT_Load_Char, the slot's content is erased by the new glyph data, */
+/* i.e., the glyph's metrics, its image (bitmap or outline), and */
+/* other control information. */
+/* */
+/* <Also> */
+/* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
+/* */
+typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_CharMap */
+/* */
+/* <Description> */
+/* A handle to a given character map. A charmap is used to translate */
+/* character codes in a given encoding into glyph indexes for its */
+/* parent's face. Some font formats may provide several charmaps per */
+/* font. */
+/* */
+/* Each face object owns zero or more charmaps, but only one of them */
+/* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
+/* */
+/* The list of available charmaps in a face is available through the */
+/* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
+/* */
+/* The currently active charmap is available as `face->charmap'. */
+/* You should call @FT_Set_Charmap to change it. */
+/* */
+/* <Note> */
+/* When a new face is created (either through @FT_New_Face or */
+/* @FT_Open_Face), the library looks for a Unicode charmap within */
+/* the list and automatically activates it. */
+/* */
+/* <Also> */
+/* See @FT_CharMapRec for the publicly accessible fields of a given */
+/* character map. */
+/* */
+typedef struct FT_CharMapRec_* FT_CharMap;
+
+
+/*************************************************************************/
+/* */
+/* <Macro> */
+/* FT_ENC_TAG */
+/* */
+/* <Description> */
+/* This macro converts four-letter tags into an unsigned long. It is */
+/* used to define `encoding' identifiers (see @FT_Encoding). */
+/* */
+/* <Note> */
+/* Since many 16-bit compilers don't like 32-bit enumerations, you */
+/* should redefine this macro in case of problems to something like */
+/* this: */
+/* */
+/* { */
+/* #define FT_ENC_TAG( value, a, b, c, d ) value */
+/* } */
+/* */
+/* to get a simple enumeration without assigning special numbers. */
+/* */
#ifndef FT_ENC_TAG
#define FT_ENC_TAG( value, a, b, c, d ) \
@@ -517,147 +515,146 @@ FT_BEGIN_HEADER
#endif /* FT_ENC_TAG */
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Encoding */
- /* */
- /* <Description> */
- /* An enumeration used to specify character sets supported by */
- /* charmaps. Used in the @FT_Select_Charmap API function. */
- /* */
- /* <Note> */
- /* Despite the name, this enumeration lists specific character */
- /* repertories (i.e., charsets), and not text encoding methods (e.g., */
- /* UTF-8, UTF-16, etc.). */
- /* */
- /* Other encodings might be defined in the future. */
- /* */
- /* <Values> */
- /* FT_ENCODING_NONE :: */
- /* The encoding value~0 is reserved. */
- /* */
- /* FT_ENCODING_UNICODE :: */
- /* Corresponds to the Unicode character set. This value covers */
- /* all versions of the Unicode repertoire, including ASCII and */
- /* Latin-1. Most fonts include a Unicode charmap, but not all */
- /* of them. */
- /* */
- /* For example, if you want to access Unicode value U+1F028 (and */
- /* the font contains it), use value 0x1F028 as the input value for */
- /* @FT_Get_Char_Index. */
- /* */
- /* FT_ENCODING_MS_SYMBOL :: */
- /* Corresponds to the Microsoft Symbol encoding, used to encode */
- /* mathematical symbols in the 32..255 character code range. For */
- /* more information, see `http://www.ceviz.net/symbol.htm'. */
- /* */
- /* FT_ENCODING_SJIS :: */
- /* Corresponds to Japanese SJIS encoding. More info at */
- /* at `http://langsupport.japanreference.com/encoding.shtml'. */
- /* See note on multi-byte encodings below. */
- /* */
- /* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as used */
- /* used in mainland China. */
- /* */
- /* FT_ENCODING_BIG5 :: */
- /* Corresponds to an encoding system for Traditional Chinese as */
- /* used in Taiwan and Hong Kong. */
- /* */
- /* FT_ENCODING_WANSUNG :: */
- /* Corresponds to the Korean encoding system known as Wansung. */
- /* For more information see */
- /* `http://www.microsoft.com/typography/unicode/949.txt'. */
- /* */
- /* FT_ENCODING_JOHAB :: */
- /* The Korean standard character set (KS~C 5601-1992), which */
- /* corresponds to MS Windows code page 1361. This character set */
- /* includes all possible Hangeul character combinations. */
- /* */
- /* FT_ENCODING_ADOBE_LATIN_1 :: */
- /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
- /* PostScript font. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_ADOBE_STANDARD :: */
- /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_EXPERT :: */
- /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_CUSTOM :: */
- /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
- /* OpenType/CFF fonts. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_APPLE_ROMAN :: */
- /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
- /* and OpenType fonts contain a charmap for this encoding, since */
- /* older versions of Mac OS are able to use it. */
- /* */
- /* FT_ENCODING_OLD_LATIN_2 :: */
- /* This value is deprecated and was never used nor reported by */
- /* FreeType. Don't use or test for it. */
- /* */
- /* FT_ENCODING_MS_SJIS :: */
- /* Same as FT_ENCODING_SJIS. Deprecated. */
- /* */
- /* FT_ENCODING_MS_GB2312 :: */
- /* Same as FT_ENCODING_GB2312. Deprecated. */
- /* */
- /* FT_ENCODING_MS_BIG5 :: */
- /* Same as FT_ENCODING_BIG5. Deprecated. */
- /* */
- /* FT_ENCODING_MS_WANSUNG :: */
- /* Same as FT_ENCODING_WANSUNG. Deprecated. */
- /* */
- /* FT_ENCODING_MS_JOHAB :: */
- /* Same as FT_ENCODING_JOHAB. Deprecated. */
- /* */
- /* <Note> */
- /* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph names dictionaries. */
- /* However, it also reports the encodings defined explicitly in the */
- /* font file, for the cases when they are needed, with the Adobe */
- /* values as well. */
- /* */
- /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
- /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
- /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
- /* which encoding is really present. If, for example, the */
- /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
- /* the font is encoded in KOI8-R. */
- /* */
- /* FT_ENCODING_NONE is always set (with a single exception) by the */
- /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
- /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
- /* which encoding is really present. For example, */
- /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
- /* Russian). */
- /* */
- /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
- /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
- /* FT_ENCODING_APPLE_ROMAN). */
- /* */
- /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
- /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
- /* be needed to be able to distinguish Apple encoding variants. See */
- /* */
- /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
- /* */
- /* to get an idea how to do that. Basically, if the language ID */
- /* is~0, don't use it, otherwise subtract 1 from the language ID. */
- /* Then examine `encoding_id'. If, for example, `encoding_id' is */
- /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
- /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
- /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
- /* variant the Arabic encoding. */
- /* */
- typedef enum FT_Encoding_
- {
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Encoding */
+/* */
+/* <Description> */
+/* An enumeration used to specify character sets supported by */
+/* charmaps. Used in the @FT_Select_Charmap API function. */
+/* */
+/* <Note> */
+/* Despite the name, this enumeration lists specific character */
+/* repertories (i.e., charsets), and not text encoding methods (e.g., */
+/* UTF-8, UTF-16, etc.). */
+/* */
+/* Other encodings might be defined in the future. */
+/* */
+/* <Values> */
+/* FT_ENCODING_NONE :: */
+/* The encoding value~0 is reserved. */
+/* */
+/* FT_ENCODING_UNICODE :: */
+/* Corresponds to the Unicode character set. This value covers */
+/* all versions of the Unicode repertoire, including ASCII and */
+/* Latin-1. Most fonts include a Unicode charmap, but not all */
+/* of them. */
+/* */
+/* For example, if you want to access Unicode value U+1F028 (and */
+/* the font contains it), use value 0x1F028 as the input value for */
+/* @FT_Get_Char_Index. */
+/* */
+/* FT_ENCODING_MS_SYMBOL :: */
+/* Corresponds to the Microsoft Symbol encoding, used to encode */
+/* mathematical symbols in the 32..255 character code range. For */
+/* more information, see `http://www.ceviz.net/symbol.htm'. */
+/* */
+/* FT_ENCODING_SJIS :: */
+/* Corresponds to Japanese SJIS encoding. More info at */
+/* at `http://langsupport.japanreference.com/encoding.shtml'. */
+/* See note on multi-byte encodings below. */
+/* */
+/* FT_ENCODING_GB2312 :: */
+/* Corresponds to an encoding system for Simplified Chinese as used */
+/* used in mainland China. */
+/* */
+/* FT_ENCODING_BIG5 :: */
+/* Corresponds to an encoding system for Traditional Chinese as */
+/* used in Taiwan and Hong Kong. */
+/* */
+/* FT_ENCODING_WANSUNG :: */
+/* Corresponds to the Korean encoding system known as Wansung. */
+/* For more information see */
+/* `http://www.microsoft.com/typography/unicode/949.txt'. */
+/* */
+/* FT_ENCODING_JOHAB :: */
+/* The Korean standard character set (KS~C 5601-1992), which */
+/* corresponds to MS Windows code page 1361. This character set */
+/* includes all possible Hangeul character combinations. */
+/* */
+/* FT_ENCODING_ADOBE_LATIN_1 :: */
+/* Corresponds to a Latin-1 encoding as defined in a Type~1 */
+/* PostScript font. It is limited to 256 character codes. */
+/* */
+/* FT_ENCODING_ADOBE_STANDARD :: */
+/* Corresponds to the Adobe Standard encoding, as found in Type~1, */
+/* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+/* codes. */
+/* */
+/* FT_ENCODING_ADOBE_EXPERT :: */
+/* Corresponds to the Adobe Expert encoding, as found in Type~1, */
+/* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+/* codes. */
+/* */
+/* FT_ENCODING_ADOBE_CUSTOM :: */
+/* Corresponds to a custom encoding, as found in Type~1, CFF, and */
+/* OpenType/CFF fonts. It is limited to 256 character codes. */
+/* */
+/* FT_ENCODING_APPLE_ROMAN :: */
+/* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
+/* and OpenType fonts contain a charmap for this encoding, since */
+/* older versions of Mac OS are able to use it. */
+/* */
+/* FT_ENCODING_OLD_LATIN_2 :: */
+/* This value is deprecated and was never used nor reported by */
+/* FreeType. Don't use or test for it. */
+/* */
+/* FT_ENCODING_MS_SJIS :: */
+/* Same as FT_ENCODING_SJIS. Deprecated. */
+/* */
+/* FT_ENCODING_MS_GB2312 :: */
+/* Same as FT_ENCODING_GB2312. Deprecated. */
+/* */
+/* FT_ENCODING_MS_BIG5 :: */
+/* Same as FT_ENCODING_BIG5. Deprecated. */
+/* */
+/* FT_ENCODING_MS_WANSUNG :: */
+/* Same as FT_ENCODING_WANSUNG. Deprecated. */
+/* */
+/* FT_ENCODING_MS_JOHAB :: */
+/* Same as FT_ENCODING_JOHAB. Deprecated. */
+/* */
+/* <Note> */
+/* By default, FreeType automatically synthesizes a Unicode charmap */
+/* for PostScript fonts, using their glyph names dictionaries. */
+/* However, it also reports the encodings defined explicitly in the */
+/* font file, for the cases when they are needed, with the Adobe */
+/* values as well. */
+/* */
+/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
+/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
+/* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
+/* which encoding is really present. If, for example, the */
+/* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
+/* the font is encoded in KOI8-R. */
+/* */
+/* FT_ENCODING_NONE is always set (with a single exception) by the */
+/* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
+/* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
+/* which encoding is really present. For example, */
+/* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
+/* Russian). */
+/* */
+/* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
+/* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
+/* FT_ENCODING_APPLE_ROMAN). */
+/* */
+/* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
+/* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
+/* be needed to be able to distinguish Apple encoding variants. See */
+/* */
+/* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
+/* */
+/* to get an idea how to do that. Basically, if the language ID */
+/* is~0, don't use it, otherwise subtract 1 from the language ID. */
+/* Then examine `encoding_id'. If, for example, `encoding_id' is */
+/* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
+/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
+/* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
+/* variant the Arabic encoding. */
+/* */
+typedef enum FT_Encoding_ {
FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
@@ -685,18 +682,18 @@ FT_BEGIN_HEADER
FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
- } FT_Encoding;
+} FT_Encoding;
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_encoding_xxx */
- /* */
- /* <Description> */
- /* These constants are deprecated; use the corresponding @FT_Encoding */
- /* values instead. */
- /* */
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* ft_encoding_xxx */
+/* */
+/* <Description> */
+/* These constants are deprecated; use the corresponding @FT_Encoding */
+/* values instead. */
+/* */
#define ft_encoding_none FT_ENCODING_NONE
#define ft_encoding_unicode FT_ENCODING_UNICODE
#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
@@ -714,210 +711,208 @@ FT_BEGIN_HEADER
#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_CharMapRec */
- /* */
- /* <Description> */
- /* The base charmap structure. */
- /* */
- /* <Fields> */
- /* face :: A handle to the parent face object. */
- /* */
- /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
- /* this with @FT_Select_Charmap. */
- /* */
- /* platform_id :: An ID number describing the platform for the */
- /* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
- /* for other formats. */
- /* */
- /* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
- /* emulated similarly. */
- /* */
- typedef struct FT_CharMapRec_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_CharMapRec */
+/* */
+/* <Description> */
+/* The base charmap structure. */
+/* */
+/* <Fields> */
+/* face :: A handle to the parent face object. */
+/* */
+/* encoding :: An @FT_Encoding tag identifying the charmap. Use */
+/* this with @FT_Select_Charmap. */
+/* */
+/* platform_id :: An ID number describing the platform for the */
+/* following encoding ID. This comes directly from */
+/* the TrueType specification and should be emulated */
+/* for other formats. */
+/* */
+/* encoding_id :: A platform specific encoding number. This also */
+/* comes from the TrueType specification and should be */
+/* emulated similarly. */
+/* */
+typedef struct FT_CharMapRec_ {
FT_Face face;
FT_Encoding encoding;
FT_UShort platform_id;
FT_UShort encoding_id;
- } FT_CharMapRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S E O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
- /* model private data of a given @FT_Face object. */
- /* */
- /* This structure might change between releases of FreeType~2 and is */
- /* not generally available to client applications. */
- /* */
- typedef struct FT_Face_InternalRec_* FT_Face_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_FaceRec */
- /* */
- /* <Description> */
- /* FreeType root face class structure. A face object models a */
- /* typeface in a font file. */
- /* */
- /* <Fields> */
- /* num_faces :: The number of faces in the font file. Some */
- /* font formats can have multiple faces in */
- /* a font file. */
- /* */
- /* face_index :: The index of the face in the font file. It */
- /* is set to~0 if there is only one face in */
- /* the font file. */
- /* */
- /* face_flags :: A set of bit flags that give important */
- /* information about the face; see */
- /* @FT_FACE_FLAG_XXX for the details. */
- /* */
- /* style_flags :: A set of bit flags indicating the style of */
- /* the face; see @FT_STYLE_FLAG_XXX for the */
- /* details. */
- /* */
- /* num_glyphs :: The number of glyphs in the face. If the */
- /* face is scalable and has sbits (see */
- /* `num_fixed_sizes'), it is set to the number */
- /* of outline glyphs. */
- /* */
- /* For CID-keyed fonts, this value gives the */
- /* highest CID used in the font. */
- /* */
- /* family_name :: The face's family name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's family (like `Times New */
- /* Roman', `Bodoni', `Garamond', etc). This */
- /* is a least common denominator used to list */
- /* fonts. Some formats (TrueType & OpenType) */
- /* provide localized and Unicode versions of */
- /* this string. Applications should use the */
- /* format specific interface to access them. */
- /* Can be NULL (e.g., in fonts embedded in a */
- /* PDF file). */
- /* */
- /* style_name :: The face's style name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's style (like `Italic', */
- /* `Bold', `Condensed', etc). Not all font */
- /* formats provide a style name, so this field */
- /* is optional, and can be set to NULL. As */
- /* for `family_name', some formats provide */
- /* localized and Unicode versions of this */
- /* string. Applications should use the format */
- /* specific interface to access them. */
- /* */
- /* num_fixed_sizes :: The number of bitmap strikes in the face. */
- /* Even if the face is scalable, there might */
- /* still be bitmap strikes, which are called */
- /* `sbits' in that case. */
- /* */
- /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
- /* strikes in the face. It is set to NULL if */
- /* there is no bitmap strike. */
- /* */
- /* num_charmaps :: The number of charmaps in the face. */
- /* */
- /* charmaps :: An array of the charmaps of the face. */
- /* */
- /* generic :: A field reserved for client uses. See the */
- /* @FT_Generic type description. */
- /* */
- /* bbox :: The font bounding box. Coordinates are */
- /* expressed in font units (see */
- /* `units_per_EM'). The box is large enough */
- /* to contain any glyph from the font. Thus, */
- /* `bbox.yMax' can be seen as the `maximum */
- /* ascender', and `bbox.yMin' as the `minimum */
- /* descender'. Only relevant for scalable */
- /* formats. */
- /* */
- /* Note that the bounding box might be off by */
- /* (at least) one pixel for hinted fonts. See */
- /* @FT_Size_Metrics for further discussion. */
- /* */
- /* units_per_EM :: The number of font units per EM square for */
- /* this face. This is typically 2048 for */
- /* TrueType fonts, and 1000 for Type~1 fonts. */
- /* Only relevant for scalable formats. */
- /* */
- /* ascender :: The typographic ascender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMax'. Only relevant for scalable */
- /* formats. */
- /* */
- /* descender :: The typographic descender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMin'. Note that this field is */
- /* usually negative. Only relevant for */
- /* scalable formats. */
- /* */
- /* height :: This value is the vertical distance */
- /* between two consecutive baselines, */
- /* expressed in font units. It is always */
- /* positive. Only relevant for scalable */
- /* formats. */
- /* */
- /* If you want the global glyph height, use */
- /* `ascender - descender'. */
- /* */
- /* max_advance_width :: The maximum advance width, in font units, */
- /* for all glyphs in this face. This can be */
- /* used to make word wrapping computations */
- /* faster. Only relevant for scalable */
- /* formats. */
- /* */
- /* max_advance_height :: The maximum advance height, in font units, */
- /* for all glyphs in this face. This is only */
- /* relevant for vertical layouts, and is set */
- /* to `height' for fonts that do not provide */
- /* vertical metrics. Only relevant for */
- /* scalable formats. */
- /* */
- /* underline_position :: The position, in font units, of the */
- /* underline line for this face. It is the */
- /* center of the underlining stem. Only */
- /* relevant for scalable formats. */
- /* */
- /* underline_thickness :: The thickness, in font units, of the */
- /* underline for this face. Only relevant for */
- /* scalable formats. */
- /* */
- /* glyph :: The face's associated glyph slot(s). */
- /* */
- /* size :: The current active size for this face. */
- /* */
- /* charmap :: The current active charmap for this face. */
- /* */
- /* <Note> */
- /* Fields may be changed after a call to @FT_Attach_File or */
- /* @FT_Attach_Stream. */
- /* */
- typedef struct FT_FaceRec_
- {
+} FT_CharMapRec;
+
+
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* B A S E O B J E C T C L A S S E S */
+/* */
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Face_Internal */
+/* */
+/* <Description> */
+/* An opaque handle to an `FT_Face_InternalRec' structure, used to */
+/* model private data of a given @FT_Face object. */
+/* */
+/* This structure might change between releases of FreeType~2 and is */
+/* not generally available to client applications. */
+/* */
+typedef struct FT_Face_InternalRec_* FT_Face_Internal;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_FaceRec */
+/* */
+/* <Description> */
+/* FreeType root face class structure. A face object models a */
+/* typeface in a font file. */
+/* */
+/* <Fields> */
+/* num_faces :: The number of faces in the font file. Some */
+/* font formats can have multiple faces in */
+/* a font file. */
+/* */
+/* face_index :: The index of the face in the font file. It */
+/* is set to~0 if there is only one face in */
+/* the font file. */
+/* */
+/* face_flags :: A set of bit flags that give important */
+/* information about the face; see */
+/* @FT_FACE_FLAG_XXX for the details. */
+/* */
+/* style_flags :: A set of bit flags indicating the style of */
+/* the face; see @FT_STYLE_FLAG_XXX for the */
+/* details. */
+/* */
+/* num_glyphs :: The number of glyphs in the face. If the */
+/* face is scalable and has sbits (see */
+/* `num_fixed_sizes'), it is set to the number */
+/* of outline glyphs. */
+/* */
+/* For CID-keyed fonts, this value gives the */
+/* highest CID used in the font. */
+/* */
+/* family_name :: The face's family name. This is an ASCII */
+/* string, usually in English, which describes */
+/* the typeface's family (like `Times New */
+/* Roman', `Bodoni', `Garamond', etc). This */
+/* is a least common denominator used to list */
+/* fonts. Some formats (TrueType & OpenType) */
+/* provide localized and Unicode versions of */
+/* this string. Applications should use the */
+/* format specific interface to access them. */
+/* Can be NULL (e.g., in fonts embedded in a */
+/* PDF file). */
+/* */
+/* style_name :: The face's style name. This is an ASCII */
+/* string, usually in English, which describes */
+/* the typeface's style (like `Italic', */
+/* `Bold', `Condensed', etc). Not all font */
+/* formats provide a style name, so this field */
+/* is optional, and can be set to NULL. As */
+/* for `family_name', some formats provide */
+/* localized and Unicode versions of this */
+/* string. Applications should use the format */
+/* specific interface to access them. */
+/* */
+/* num_fixed_sizes :: The number of bitmap strikes in the face. */
+/* Even if the face is scalable, there might */
+/* still be bitmap strikes, which are called */
+/* `sbits' in that case. */
+/* */
+/* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
+/* strikes in the face. It is set to NULL if */
+/* there is no bitmap strike. */
+/* */
+/* num_charmaps :: The number of charmaps in the face. */
+/* */
+/* charmaps :: An array of the charmaps of the face. */
+/* */
+/* generic :: A field reserved for client uses. See the */
+/* @FT_Generic type description. */
+/* */
+/* bbox :: The font bounding box. Coordinates are */
+/* expressed in font units (see */
+/* `units_per_EM'). The box is large enough */
+/* to contain any glyph from the font. Thus, */
+/* `bbox.yMax' can be seen as the `maximum */
+/* ascender', and `bbox.yMin' as the `minimum */
+/* descender'. Only relevant for scalable */
+/* formats. */
+/* */
+/* Note that the bounding box might be off by */
+/* (at least) one pixel for hinted fonts. See */
+/* @FT_Size_Metrics for further discussion. */
+/* */
+/* units_per_EM :: The number of font units per EM square for */
+/* this face. This is typically 2048 for */
+/* TrueType fonts, and 1000 for Type~1 fonts. */
+/* Only relevant for scalable formats. */
+/* */
+/* ascender :: The typographic ascender of the face, */
+/* expressed in font units. For font formats */
+/* not having this information, it is set to */
+/* `bbox.yMax'. Only relevant for scalable */
+/* formats. */
+/* */
+/* descender :: The typographic descender of the face, */
+/* expressed in font units. For font formats */
+/* not having this information, it is set to */
+/* `bbox.yMin'. Note that this field is */
+/* usually negative. Only relevant for */
+/* scalable formats. */
+/* */
+/* height :: This value is the vertical distance */
+/* between two consecutive baselines, */
+/* expressed in font units. It is always */
+/* positive. Only relevant for scalable */
+/* formats. */
+/* */
+/* If you want the global glyph height, use */
+/* `ascender - descender'. */
+/* */
+/* max_advance_width :: The maximum advance width, in font units, */
+/* for all glyphs in this face. This can be */
+/* used to make word wrapping computations */
+/* faster. Only relevant for scalable */
+/* formats. */
+/* */
+/* max_advance_height :: The maximum advance height, in font units, */
+/* for all glyphs in this face. This is only */
+/* relevant for vertical layouts, and is set */
+/* to `height' for fonts that do not provide */
+/* vertical metrics. Only relevant for */
+/* scalable formats. */
+/* */
+/* underline_position :: The position, in font units, of the */
+/* underline line for this face. It is the */
+/* center of the underlining stem. Only */
+/* relevant for scalable formats. */
+/* */
+/* underline_thickness :: The thickness, in font units, of the */
+/* underline for this face. Only relevant for */
+/* scalable formats. */
+/* */
+/* glyph :: The face's associated glyph slot(s). */
+/* */
+/* size :: The current active size for this face. */
+/* */
+/* charmap :: The current active charmap for this face. */
+/* */
+/* <Note> */
+/* Fields may be changed after a call to @FT_Attach_File or */
+/* @FT_Attach_Stream. */
+/* */
+typedef struct FT_FaceRec_ {
FT_Long num_faces;
FT_Long face_index;
@@ -972,107 +967,107 @@ FT_BEGIN_HEADER
/*@private end */
- } FT_FaceRec;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FACE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `face_flags' field of the */
- /* @FT_FaceRec structure. They inform client applications of */
- /* properties of the corresponding face. */
- /* */
- /* <Values> */
- /* FT_FACE_FLAG_SCALABLE :: */
- /* Indicates that the face contains outline glyphs. This doesn't */
- /* prevent bitmap strikes, i.e., a face can have both this and */
- /* and @FT_FACE_FLAG_FIXED_SIZES set. */
- /* */
- /* FT_FACE_FLAG_FIXED_SIZES :: */
- /* Indicates that the face contains bitmap strikes. See also the */
- /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
- /* */
- /* FT_FACE_FLAG_FIXED_WIDTH :: */
- /* Indicates that the face contains fixed-width characters (like */
- /* Courier, Lucido, MonoType, etc.). */
- /* */
- /* FT_FACE_FLAG_SFNT :: */
- /* Indicates that the face uses the `sfnt' storage scheme. For */
- /* now, this means TrueType and OpenType. */
- /* */
- /* FT_FACE_FLAG_HORIZONTAL :: */
- /* Indicates that the face contains horizontal glyph metrics. This */
- /* should be set for all common formats. */
- /* */
- /* FT_FACE_FLAG_VERTICAL :: */
- /* Indicates that the face contains vertical glyph metrics. This */
- /* is only available in some formats, not all of them. */
- /* */
- /* FT_FACE_FLAG_KERNING :: */
- /* Indicates that the face contains kerning information. If set, */
- /* the kerning distance can be retrieved through the function */
- /* @FT_Get_Kerning. Otherwise the function always return the */
- /* vector (0,0). Note that FreeType doesn't handle kerning data */
- /* from the `GPOS' table (as present in some OpenType fonts). */
- /* */
- /* FT_FACE_FLAG_FAST_GLYPHS :: */
- /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
- /* */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
- /* Indicates that the font contains multiple masters and is capable */
- /* of interpolating between them. See the multiple-masters */
- /* specific API for details. */
- /* */
- /* FT_FACE_FLAG_GLYPH_NAMES :: */
- /* Indicates that the font contains glyph names that can be */
- /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
- /* fonts contain broken glyph name tables. Use the function */
- /* @FT_Has_PS_Glyph_Names when needed. */
- /* */
- /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
- /* Used internally by FreeType to indicate that a face's stream was */
- /* provided by the client application and should not be destroyed */
- /* when @FT_Done_Face is called. Don't read or test this flag. */
- /* */
- /* FT_FACE_FLAG_HINTER :: */
- /* Set if the font driver has a hinting machine of its own. For */
- /* example, with TrueType fonts, it makes sense to use data from */
- /* the SFNT `gasp' table only if the native TrueType hinting engine */
- /* (with the bytecode interpreter) is available and active. */
- /* */
- /* FT_FACE_FLAG_CID_KEYED :: */
- /* Set if the font is CID-keyed. In that case, the font is not */
- /* accessed by glyph indices but by CID values. For subsetted */
- /* CID-keyed fonts this has the consequence that not all index */
- /* values are a valid argument to FT_Load_Glyph. Only the CID */
- /* values for which corresponding glyphs in the subsetted font */
- /* exist make FT_Load_Glyph return successfully; in all other cases */
- /* you get an `FT_Err_Invalid_Argument' error. */
- /* */
- /* Note that CID-keyed fonts which are in an SFNT wrapper don't */
- /* have this flag set since the glyphs are accessed in the normal */
- /* way (using contiguous indices); the `CID-ness' isn't visible to */
- /* the application. */
- /* */
- /* FT_FACE_FLAG_TRICKY :: */
- /* Set if the font is `tricky', this is, it always needs the */
- /* font format's native hinting engine to get a reasonable result. */
- /* A typical example is the Chinese font `mingli.ttf' which uses */
- /* TrueType bytecode instructions to move and scale all of its */
- /* subglyphs. */
- /* */
- /* It is not possible to autohint such fonts using */
- /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
- /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
- /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
- /* probably never want this except for demonstration purposes. */
- /* */
- /* Currently, there are about a dozen TrueType fonts in the list of */
- /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
- /* */
+} FT_FaceRec;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_FACE_FLAG_XXX */
+/* */
+/* <Description> */
+/* A list of bit flags used in the `face_flags' field of the */
+/* @FT_FaceRec structure. They inform client applications of */
+/* properties of the corresponding face. */
+/* */
+/* <Values> */
+/* FT_FACE_FLAG_SCALABLE :: */
+/* Indicates that the face contains outline glyphs. This doesn't */
+/* prevent bitmap strikes, i.e., a face can have both this and */
+/* and @FT_FACE_FLAG_FIXED_SIZES set. */
+/* */
+/* FT_FACE_FLAG_FIXED_SIZES :: */
+/* Indicates that the face contains bitmap strikes. See also the */
+/* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
+/* */
+/* FT_FACE_FLAG_FIXED_WIDTH :: */
+/* Indicates that the face contains fixed-width characters (like */
+/* Courier, Lucido, MonoType, etc.). */
+/* */
+/* FT_FACE_FLAG_SFNT :: */
+/* Indicates that the face uses the `sfnt' storage scheme. For */
+/* now, this means TrueType and OpenType. */
+/* */
+/* FT_FACE_FLAG_HORIZONTAL :: */
+/* Indicates that the face contains horizontal glyph metrics. This */
+/* should be set for all common formats. */
+/* */
+/* FT_FACE_FLAG_VERTICAL :: */
+/* Indicates that the face contains vertical glyph metrics. This */
+/* is only available in some formats, not all of them. */
+/* */
+/* FT_FACE_FLAG_KERNING :: */
+/* Indicates that the face contains kerning information. If set, */
+/* the kerning distance can be retrieved through the function */
+/* @FT_Get_Kerning. Otherwise the function always return the */
+/* vector (0,0). Note that FreeType doesn't handle kerning data */
+/* from the `GPOS' table (as present in some OpenType fonts). */
+/* */
+/* FT_FACE_FLAG_FAST_GLYPHS :: */
+/* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
+/* */
+/* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
+/* Indicates that the font contains multiple masters and is capable */
+/* of interpolating between them. See the multiple-masters */
+/* specific API for details. */
+/* */
+/* FT_FACE_FLAG_GLYPH_NAMES :: */
+/* Indicates that the font contains glyph names that can be */
+/* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
+/* fonts contain broken glyph name tables. Use the function */
+/* @FT_Has_PS_Glyph_Names when needed. */
+/* */
+/* FT_FACE_FLAG_EXTERNAL_STREAM :: */
+/* Used internally by FreeType to indicate that a face's stream was */
+/* provided by the client application and should not be destroyed */
+/* when @FT_Done_Face is called. Don't read or test this flag. */
+/* */
+/* FT_FACE_FLAG_HINTER :: */
+/* Set if the font driver has a hinting machine of its own. For */
+/* example, with TrueType fonts, it makes sense to use data from */
+/* the SFNT `gasp' table only if the native TrueType hinting engine */
+/* (with the bytecode interpreter) is available and active. */
+/* */
+/* FT_FACE_FLAG_CID_KEYED :: */
+/* Set if the font is CID-keyed. In that case, the font is not */
+/* accessed by glyph indices but by CID values. For subsetted */
+/* CID-keyed fonts this has the consequence that not all index */
+/* values are a valid argument to FT_Load_Glyph. Only the CID */
+/* values for which corresponding glyphs in the subsetted font */
+/* exist make FT_Load_Glyph return successfully; in all other cases */
+/* you get an `FT_Err_Invalid_Argument' error. */
+/* */
+/* Note that CID-keyed fonts which are in an SFNT wrapper don't */
+/* have this flag set since the glyphs are accessed in the normal */
+/* way (using contiguous indices); the `CID-ness' isn't visible to */
+/* the application. */
+/* */
+/* FT_FACE_FLAG_TRICKY :: */
+/* Set if the font is `tricky', this is, it always needs the */
+/* font format's native hinting engine to get a reasonable result. */
+/* A typical example is the Chinese font `mingli.ttf' which uses */
+/* TrueType bytecode instructions to move and scale all of its */
+/* subglyphs. */
+/* */
+/* It is not possible to autohint such fonts using */
+/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
+/* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
+/* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
+/* probably never want this except for demonstration purposes. */
+/* */
+/* Currently, there are about a dozen TrueType fonts in the list of */
+/* tricky fonts; they are hard-coded in file `ttobjs.c'. */
+/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
@@ -1089,283 +1084,282 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_HORIZONTAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains
- * horizontal metrics (this is true for all font formats though).
- *
- * @also:
- * @FT_HAS_VERTICAL can be used to check for vertical metrics.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_HORIZONTAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains
+ * horizontal metrics (this is true for all font formats though).
+ *
+ * @also:
+ * @FT_HAS_VERTICAL can be used to check for vertical metrics.
+ *
+ */
#define FT_HAS_HORIZONTAL( face ) \
( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_VERTICAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains real
- * vertical metrics (and not only synthesized ones).
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_VERTICAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains real
+ * vertical metrics (and not only synthesized ones).
+ *
+ */
#define FT_HAS_VERTICAL( face ) \
( face->face_flags & FT_FACE_FLAG_VERTICAL )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_KERNING( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains kerning
- * data that can be accessed with @FT_Get_Kerning.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_KERNING( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains kerning
+ * data that can be accessed with @FT_Get_Kerning.
+ *
+ */
#define FT_HAS_KERNING( face ) \
( face->face_flags & FT_FACE_FLAG_KERNING )
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SCALABLE( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a scalable
- * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
- * and PFR font formats.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SCALABLE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a scalable
+ * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
+ * and PFR font formats.
+ *
+ */
#define FT_IS_SCALABLE( face ) \
( face->face_flags & FT_FACE_FLAG_SCALABLE )
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SFNT( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font
- * whose format is based on the SFNT storage scheme. This usually
- * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
- * bitmap fonts.
- *
- * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
- * @FT_TRUETYPE_TABLES_H are available.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SFNT( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font
+ * whose format is based on the SFNT storage scheme. This usually
+ * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
+ * bitmap fonts.
+ *
+ * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
+ * @FT_TRUETYPE_TABLES_H are available.
+ *
+ */
#define FT_IS_SFNT( face ) \
( face->face_flags & FT_FACE_FLAG_SFNT )
- /*************************************************************************
- *
- * @macro:
- * FT_IS_FIXED_WIDTH( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font face
- * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
- * glyphs.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IS_FIXED_WIDTH( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font face
+ * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
+ * glyphs.
+ *
+ */
#define FT_IS_FIXED_WIDTH( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FIXED_SIZES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * embedded bitmaps. See the `available_sizes' field of the
- * @FT_FaceRec structure.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FIXED_SIZES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * embedded bitmaps. See the `available_sizes' field of the
+ * @FT_FaceRec structure.
+ *
+ */
#define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FAST_GLYPHS( face )
- *
- * @description:
- * Deprecated.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FAST_GLYPHS( face )
+ *
+ * @description:
+ * Deprecated.
+ *
+ */
#define FT_HAS_FAST_GLYPHS( face ) 0
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_GLYPH_NAMES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some glyph
- * names that can be accessed through @FT_Get_Glyph_Name.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_GLYPH_NAMES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some glyph
+ * names that can be accessed through @FT_Get_Glyph_Name.
+ *
+ */
#define FT_HAS_GLYPH_NAMES( face ) \
( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_MULTIPLE_MASTERS( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
- * are then available to choose the exact design you want.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_MULTIPLE_MASTERS( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
+ * are then available to choose the exact design you want.
+ *
+ */
#define FT_HAS_MULTIPLE_MASTERS( face ) \
( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
- /*************************************************************************
- *
- * @macro:
- * FT_IS_CID_KEYED( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a CID-keyed
- * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
- * details.
- *
- * If this macro is true, all functions defined in @FT_CID_H are
- * available.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IS_CID_KEYED( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a CID-keyed
+ * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
+ * details.
+ *
+ * If this macro is true, all functions defined in @FT_CID_H are
+ * available.
+ *
+ */
#define FT_IS_CID_KEYED( face ) \
( face->face_flags & FT_FACE_FLAG_CID_KEYED )
- /*************************************************************************
- *
- * @macro:
- * FT_IS_TRICKY( face )
- *
- * @description:
- * A macro that returns true whenever a face represents a `tricky' font.
- * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_IS_TRICKY( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face represents a `tricky' font.
+ * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
+ *
+ */
#define FT_IS_TRICKY( face ) \
( face->face_flags & FT_FACE_FLAG_TRICKY )
- /*************************************************************************/
- /* */
- /* <Const> */
- /* FT_STYLE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit-flags used to indicate the style of a given face. */
- /* These are used in the `style_flags' field of @FT_FaceRec. */
- /* */
- /* <Values> */
- /* FT_STYLE_FLAG_ITALIC :: */
- /* Indicates that a given face style is italic or oblique. */
- /* */
- /* FT_STYLE_FLAG_BOLD :: */
- /* Indicates that a given face is bold. */
- /* */
- /* <Note> */
- /* The style information as provided by FreeType is very basic. More */
- /* details are beyond the scope and should be done on a higher level */
- /* (for example, by analyzing various fields of the `OS/2' table in */
- /* SFNT based fonts). */
- /* */
+/*************************************************************************/
+/* */
+/* <Const> */
+/* FT_STYLE_FLAG_XXX */
+/* */
+/* <Description> */
+/* A list of bit-flags used to indicate the style of a given face. */
+/* These are used in the `style_flags' field of @FT_FaceRec. */
+/* */
+/* <Values> */
+/* FT_STYLE_FLAG_ITALIC :: */
+/* Indicates that a given face style is italic or oblique. */
+/* */
+/* FT_STYLE_FLAG_BOLD :: */
+/* Indicates that a given face is bold. */
+/* */
+/* <Note> */
+/* The style information as provided by FreeType is very basic. More */
+/* details are beyond the scope and should be done on a higher level */
+/* (for example, by analyzing various fields of the `OS/2' table in */
+/* SFNT based fonts). */
+/* */
#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
- /* model private data of a given @FT_Size object. */
- /* */
- typedef struct FT_Size_InternalRec_* FT_Size_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Metrics */
- /* */
- /* <Description> */
- /* The size metrics structure gives the metrics of a size object. */
- /* */
- /* <Fields> */
- /* x_ppem :: The width of the scaled EM square in pixels, hence */
- /* the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal width'. */
- /* */
- /* y_ppem :: The height of the scaled EM square in pixels, */
- /* hence the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal height'. */
- /* */
- /* x_scale :: A 16.16 fractional scaling value used to convert */
- /* horizontal metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* y_scale :: A 16.16 fractional scaling value used to convert */
- /* vertical metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* ascender :: The ascender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* descender :: The descender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* height :: The height in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* max_advance :: The maximum advance width in 26.6 fractional */
- /* pixels. See @FT_FaceRec for the details. */
- /* */
- /* <Note> */
- /* The scaling values, if relevant, are determined first during a */
- /* size changing operation. The remaining fields are then set by the */
- /* driver. For scalable formats, they are usually set to scaled */
- /* values of the corresponding fields in @FT_FaceRec. */
- /* */
- /* Note that due to glyph hinting, these values might not be exact */
- /* for certain fonts. Thus they must be treated as unreliable */
- /* with an error margin of at least one pixel! */
- /* */
- /* Indeed, the only way to get the exact metrics is to render _all_ */
- /* glyphs. As this would be a definite performance hit, it is up to */
- /* client applications to perform such computations. */
- /* */
- /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
- /* */
- typedef struct FT_Size_Metrics_
- {
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Size_Internal */
+/* */
+/* <Description> */
+/* An opaque handle to an `FT_Size_InternalRec' structure, used to */
+/* model private data of a given @FT_Size object. */
+/* */
+typedef struct FT_Size_InternalRec_* FT_Size_Internal;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Size_Metrics */
+/* */
+/* <Description> */
+/* The size metrics structure gives the metrics of a size object. */
+/* */
+/* <Fields> */
+/* x_ppem :: The width of the scaled EM square in pixels, hence */
+/* the term `ppem' (pixels per EM). It is also */
+/* referred to as `nominal width'. */
+/* */
+/* y_ppem :: The height of the scaled EM square in pixels, */
+/* hence the term `ppem' (pixels per EM). It is also */
+/* referred to as `nominal height'. */
+/* */
+/* x_scale :: A 16.16 fractional scaling value used to convert */
+/* horizontal metrics from font units to 26.6 */
+/* fractional pixels. Only relevant for scalable */
+/* font formats. */
+/* */
+/* y_scale :: A 16.16 fractional scaling value used to convert */
+/* vertical metrics from font units to 26.6 */
+/* fractional pixels. Only relevant for scalable */
+/* font formats. */
+/* */
+/* ascender :: The ascender in 26.6 fractional pixels. See */
+/* @FT_FaceRec for the details. */
+/* */
+/* descender :: The descender in 26.6 fractional pixels. See */
+/* @FT_FaceRec for the details. */
+/* */
+/* height :: The height in 26.6 fractional pixels. See */
+/* @FT_FaceRec for the details. */
+/* */
+/* max_advance :: The maximum advance width in 26.6 fractional */
+/* pixels. See @FT_FaceRec for the details. */
+/* */
+/* <Note> */
+/* The scaling values, if relevant, are determined first during a */
+/* size changing operation. The remaining fields are then set by the */
+/* driver. For scalable formats, they are usually set to scaled */
+/* values of the corresponding fields in @FT_FaceRec. */
+/* */
+/* Note that due to glyph hinting, these values might not be exact */
+/* for certain fonts. Thus they must be treated as unreliable */
+/* with an error margin of at least one pixel! */
+/* */
+/* Indeed, the only way to get the exact metrics is to render _all_ */
+/* glyphs. As this would be a definite performance hit, it is up to */
+/* client applications to perform such computations. */
+/* */
+/* The FT_Size_Metrics structure is valid for bitmap fonts also. */
+/* */
+typedef struct FT_Size_Metrics_ {
FT_UShort x_ppem; /* horizontal pixels per EM */
FT_UShort y_ppem; /* vertical pixels per EM */
@@ -1377,240 +1371,238 @@ FT_BEGIN_HEADER
FT_Pos height; /* text height in 26.6 frac. pixels */
FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
- } FT_Size_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SizeRec */
- /* */
- /* <Description> */
- /* FreeType root size class structure. A size object models a face */
- /* object at a given size. */
- /* */
- /* <Fields> */
- /* face :: Handle to the parent face object. */
- /* */
- /* generic :: A typeless pointer, which is unused by the FreeType */
- /* library or any of its drivers. It can be used by */
- /* client applications to link their own data to each size */
- /* object. */
- /* */
- /* metrics :: Metrics for this size object. This field is read-only. */
- /* */
- typedef struct FT_SizeRec_
- {
+} FT_Size_Metrics;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_SizeRec */
+/* */
+/* <Description> */
+/* FreeType root size class structure. A size object models a face */
+/* object at a given size. */
+/* */
+/* <Fields> */
+/* face :: Handle to the parent face object. */
+/* */
+/* generic :: A typeless pointer, which is unused by the FreeType */
+/* library or any of its drivers. It can be used by */
+/* client applications to link their own data to each size */
+/* object. */
+/* */
+/* metrics :: Metrics for this size object. This field is read-only. */
+/* */
+typedef struct FT_SizeRec_ {
FT_Face face; /* parent face object */
FT_Generic generic; /* generic pointer for client uses */
FT_Size_Metrics metrics; /* size metrics */
FT_Size_Internal internal;
- } FT_SizeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SubGlyph */
- /* */
- /* <Description> */
- /* The subglyph structure is an internal object used to describe */
- /* subglyphs (for example, in the case of composites). */
- /* */
- /* <Note> */
- /* The subglyph implementation is not part of the high-level API, */
- /* hence the forward structure declaration. */
- /* */
- /* You can however retrieve subglyph information with */
- /* @FT_Get_SubGlyph_Info. */
- /* */
- typedef struct FT_SubGlyphRec_* FT_SubGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Slot_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
- /* model private data of a given @FT_GlyphSlot object. */
- /* */
- typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphSlotRec */
- /* */
- /* <Description> */
- /* FreeType root glyph slot class structure. A glyph slot is a */
- /* container where individual glyphs can be loaded, be they in */
- /* outline or bitmap format. */
- /* */
- /* <Fields> */
- /* library :: A handle to the FreeType library instance */
- /* this slot belongs to. */
- /* */
- /* face :: A handle to the parent face object. */
- /* */
- /* next :: In some cases (like some font tools), several */
- /* glyph slots per face object can be a good */
- /* thing. As this is rare, the glyph slots are */
- /* listed through a direct, single-linked list */
- /* using its `next' field. */
- /* */
- /* generic :: A typeless pointer which is unused by the */
- /* FreeType library or any of its drivers. It */
- /* can be used by client applications to link */
- /* their own data to each glyph slot object. */
- /* */
- /* metrics :: The metrics of the last loaded glyph in the */
- /* slot. The returned values depend on the last */
- /* load flags (see the @FT_Load_Glyph API */
- /* function) and can be expressed either in 26.6 */
- /* fractional pixels or font units. */
- /* */
- /* Note that even when the glyph image is */
- /* transformed, the metrics are not. */
- /* */
- /* linearHoriAdvance :: The advance width of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* linearVertAdvance :: The advance height of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* advance :: This shorthand is, depending on */
- /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
- /* advance width for the glyph (in 26.6 */
- /* fractional pixel format). As specified with */
- /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
- /* `horiAdvance' or the `vertAdvance' value of */
- /* `metrics' field. */
- /* */
- /* format :: This field indicates the format of the image */
- /* contained in the glyph slot. Typically */
- /* @FT_GLYPH_FORMAT_BITMAP, */
- /* @FT_GLYPH_FORMAT_OUTLINE, or */
- /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
- /* possible. */
- /* */
- /* bitmap :: This field is used as a bitmap descriptor */
- /* when the slot format is */
- /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
- /* address and content of the bitmap buffer can */
- /* change between calls of @FT_Load_Glyph and a */
- /* few other functions. */
- /* */
- /* bitmap_left :: This is the bitmap's left bearing expressed */
- /* in integer pixels. Of course, this is only */
- /* valid if the format is */
- /* @FT_GLYPH_FORMAT_BITMAP. */
- /* */
- /* bitmap_top :: This is the bitmap's top bearing expressed in */
- /* integer pixels. Remember that this is the */
- /* distance from the baseline to the top-most */
- /* glyph scanline, upwards y~coordinates being */
- /* *positive*. */
- /* */
- /* outline :: The outline descriptor for the current glyph */
- /* image if its format is */
- /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
- /* loaded, `outline' can be transformed, */
- /* distorted, embolded, etc. However, it must */
- /* not be freed. */
- /* */
- /* num_subglyphs :: The number of subglyphs in a composite glyph. */
- /* This field is only valid for the composite */
- /* glyph format that should normally only be */
- /* loaded with the @FT_LOAD_NO_RECURSE flag. */
- /* For now this is internal to FreeType. */
- /* */
- /* subglyphs :: An array of subglyph descriptors for */
- /* composite glyphs. There are `num_subglyphs' */
- /* elements in there. Currently internal to */
- /* FreeType. */
- /* */
- /* control_data :: Certain font drivers can also return the */
- /* control data for a given glyph image (e.g. */
- /* TrueType bytecode, Type~1 charstrings, etc.). */
- /* This field is a pointer to such data. */
- /* */
- /* control_len :: This is the length in bytes of the control */
- /* data. */
- /* */
- /* other :: Really wicked formats can use this pointer to */
- /* present their own glyph image to client */
- /* applications. Note that the application */
- /* needs to know about the image format. */
- /* */
- /* lsb_delta :: The difference between hinted and unhinted */
- /* left side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* rsb_delta :: The difference between hinted and unhinted */
- /* right side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* <Note> */
- /* If @FT_Load_Glyph is called with default flags (see */
- /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
- /* its native format (e.g., an outline glyph for TrueType and Type~1 */
- /* formats). */
- /* */
- /* This image can later be converted into a bitmap by calling */
- /* @FT_Render_Glyph. This function finds the current renderer for */
- /* the native image's format, then invokes it. */
- /* */
- /* The renderer is in charge of transforming the native image through */
- /* the slot's face transformation fields, then converting it into a */
- /* bitmap that is returned in `slot->bitmap'. */
- /* */
- /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
- /* to specify the position of the bitmap relative to the current pen */
- /* position (e.g., coordinates (0,0) on the baseline). Of course, */
- /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
- /* */
- /* <Note> */
- /* Here a small pseudo code fragment which shows how to use */
- /* `lsb_delta' and `rsb_delta': */
- /* */
- /* { */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
- /* */
- /* */
- /* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
- /* */
- /* <load glyph with `FT_Load_Glyph'> */
- /* */
- /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
- /* origin_x -= 64; */
- /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
- /* origin_x += 64; */
- /* */
- /* prev_rsb_delta = face->glyph->rsb_delta; */
- /* */
- /* <save glyph image, or render glyph, or ...> */
- /* */
- /* origin_x += face->glyph->advance.x; */
- /* endfor */
- /* } */
- /* */
- typedef struct FT_GlyphSlotRec_
- {
+} FT_SizeRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_SubGlyph */
+/* */
+/* <Description> */
+/* The subglyph structure is an internal object used to describe */
+/* subglyphs (for example, in the case of composites). */
+/* */
+/* <Note> */
+/* The subglyph implementation is not part of the high-level API, */
+/* hence the forward structure declaration. */
+/* */
+/* You can however retrieve subglyph information with */
+/* @FT_Get_SubGlyph_Info. */
+/* */
+typedef struct FT_SubGlyphRec_* FT_SubGlyph;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Slot_Internal */
+/* */
+/* <Description> */
+/* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
+/* model private data of a given @FT_GlyphSlot object. */
+/* */
+typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_GlyphSlotRec */
+/* */
+/* <Description> */
+/* FreeType root glyph slot class structure. A glyph slot is a */
+/* container where individual glyphs can be loaded, be they in */
+/* outline or bitmap format. */
+/* */
+/* <Fields> */
+/* library :: A handle to the FreeType library instance */
+/* this slot belongs to. */
+/* */
+/* face :: A handle to the parent face object. */
+/* */
+/* next :: In some cases (like some font tools), several */
+/* glyph slots per face object can be a good */
+/* thing. As this is rare, the glyph slots are */
+/* listed through a direct, single-linked list */
+/* using its `next' field. */
+/* */
+/* generic :: A typeless pointer which is unused by the */
+/* FreeType library or any of its drivers. It */
+/* can be used by client applications to link */
+/* their own data to each glyph slot object. */
+/* */
+/* metrics :: The metrics of the last loaded glyph in the */
+/* slot. The returned values depend on the last */
+/* load flags (see the @FT_Load_Glyph API */
+/* function) and can be expressed either in 26.6 */
+/* fractional pixels or font units. */
+/* */
+/* Note that even when the glyph image is */
+/* transformed, the metrics are not. */
+/* */
+/* linearHoriAdvance :: The advance width of the unhinted glyph. */
+/* Its value is expressed in 16.16 fractional */
+/* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+/* when loading the glyph. This field can be */
+/* important to perform correct WYSIWYG layout. */
+/* Only relevant for outline glyphs. */
+/* */
+/* linearVertAdvance :: The advance height of the unhinted glyph. */
+/* Its value is expressed in 16.16 fractional */
+/* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+/* when loading the glyph. This field can be */
+/* important to perform correct WYSIWYG layout. */
+/* Only relevant for outline glyphs. */
+/* */
+/* advance :: This shorthand is, depending on */
+/* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
+/* advance width for the glyph (in 26.6 */
+/* fractional pixel format). As specified with */
+/* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
+/* `horiAdvance' or the `vertAdvance' value of */
+/* `metrics' field. */
+/* */
+/* format :: This field indicates the format of the image */
+/* contained in the glyph slot. Typically */
+/* @FT_GLYPH_FORMAT_BITMAP, */
+/* @FT_GLYPH_FORMAT_OUTLINE, or */
+/* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
+/* possible. */
+/* */
+/* bitmap :: This field is used as a bitmap descriptor */
+/* when the slot format is */
+/* @FT_GLYPH_FORMAT_BITMAP. Note that the */
+/* address and content of the bitmap buffer can */
+/* change between calls of @FT_Load_Glyph and a */
+/* few other functions. */
+/* */
+/* bitmap_left :: This is the bitmap's left bearing expressed */
+/* in integer pixels. Of course, this is only */
+/* valid if the format is */
+/* @FT_GLYPH_FORMAT_BITMAP. */
+/* */
+/* bitmap_top :: This is the bitmap's top bearing expressed in */
+/* integer pixels. Remember that this is the */
+/* distance from the baseline to the top-most */
+/* glyph scanline, upwards y~coordinates being */
+/* *positive*. */
+/* */
+/* outline :: The outline descriptor for the current glyph */
+/* image if its format is */
+/* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
+/* loaded, `outline' can be transformed, */
+/* distorted, embolded, etc. However, it must */
+/* not be freed. */
+/* */
+/* num_subglyphs :: The number of subglyphs in a composite glyph. */
+/* This field is only valid for the composite */
+/* glyph format that should normally only be */
+/* loaded with the @FT_LOAD_NO_RECURSE flag. */
+/* For now this is internal to FreeType. */
+/* */
+/* subglyphs :: An array of subglyph descriptors for */
+/* composite glyphs. There are `num_subglyphs' */
+/* elements in there. Currently internal to */
+/* FreeType. */
+/* */
+/* control_data :: Certain font drivers can also return the */
+/* control data for a given glyph image (e.g. */
+/* TrueType bytecode, Type~1 charstrings, etc.). */
+/* This field is a pointer to such data. */
+/* */
+/* control_len :: This is the length in bytes of the control */
+/* data. */
+/* */
+/* other :: Really wicked formats can use this pointer to */
+/* present their own glyph image to client */
+/* applications. Note that the application */
+/* needs to know about the image format. */
+/* */
+/* lsb_delta :: The difference between hinted and unhinted */
+/* left side bearing while autohinting is */
+/* active. Zero otherwise. */
+/* */
+/* rsb_delta :: The difference between hinted and unhinted */
+/* right side bearing while autohinting is */
+/* active. Zero otherwise. */
+/* */
+/* <Note> */
+/* If @FT_Load_Glyph is called with default flags (see */
+/* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
+/* its native format (e.g., an outline glyph for TrueType and Type~1 */
+/* formats). */
+/* */
+/* This image can later be converted into a bitmap by calling */
+/* @FT_Render_Glyph. This function finds the current renderer for */
+/* the native image's format, then invokes it. */
+/* */
+/* The renderer is in charge of transforming the native image through */
+/* the slot's face transformation fields, then converting it into a */
+/* bitmap that is returned in `slot->bitmap'. */
+/* */
+/* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
+/* to specify the position of the bitmap relative to the current pen */
+/* position (e.g., coordinates (0,0) on the baseline). Of course, */
+/* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
+/* */
+/* <Note> */
+/* Here a small pseudo code fragment which shows how to use */
+/* `lsb_delta' and `rsb_delta': */
+/* */
+/* { */
+/* FT_Pos origin_x = 0; */
+/* FT_Pos prev_rsb_delta = 0; */
+/* */
+/* */
+/* for all glyphs do */
+/* <compute kern between current and previous glyph and add it to */
+/* `origin_x'> */
+/* */
+/* <load glyph with `FT_Load_Glyph'> */
+/* */
+/* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+/* origin_x -= 64; */
+/* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+/* origin_x += 64; */
+/* */
+/* prev_rsb_delta = face->glyph->rsb_delta; */
+/* */
+/* <save glyph image, or render glyph, or ...> */
+/* */
+/* origin_x += face->glyph->advance.x; */
+/* endfor */
+/* } */
+/* */
+typedef struct FT_GlyphSlotRec_ {
FT_Library library;
FT_Face face;
FT_GlyphSlot next;
@@ -1643,99 +1635,99 @@ FT_BEGIN_HEADER
FT_Slot_Internal internal;
- } FT_GlyphSlotRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* F U N C T I O N S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Init_FreeType */
- /* */
- /* <Description> */
- /* Initialize a new FreeType library object. The set of modules */
- /* that are registered by this function is determined at build time. */
- /* */
- /* <Output> */
- /* alibrary :: A handle to a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* In case you want to provide your own memory allocating routines, */
- /* use @FT_New_Library instead, followed by a call to */
- /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
- /* */
- /* For multi-threading applications each thread should have its own */
- /* FT_Library object. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Init_FreeType( FT_Library *alibrary );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_FreeType */
- /* */
- /* <Description> */
- /* Destroy a given FreeType library object and all of its children, */
- /* including resources, drivers, faces, sizes, etc. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_FreeType( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_OPEN_XXX */
- /* */
- /* <Description> */
- /* A list of bit-field constants used within the `flags' field of the */
- /* @FT_Open_Args structure. */
- /* */
- /* <Values> */
- /* FT_OPEN_MEMORY :: This is a memory-based stream. */
- /* */
- /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
- /* */
- /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
- /* name. */
- /* */
- /* FT_OPEN_DRIVER :: Use the `driver' field. */
- /* */
- /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
- /* */
- /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
- /* */
- /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
- /* */
- /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
- /* */
- /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
- /* */
- /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
- /* */
- /* <Note> */
- /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
- /* flags are mutually exclusive. */
- /* */
+} FT_GlyphSlotRec;
+
+
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* F U N C T I O N S */
+/* */
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Init_FreeType */
+/* */
+/* <Description> */
+/* Initialize a new FreeType library object. The set of modules */
+/* that are registered by this function is determined at build time. */
+/* */
+/* <Output> */
+/* alibrary :: A handle to a new library object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* In case you want to provide your own memory allocating routines, */
+/* use @FT_New_Library instead, followed by a call to */
+/* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
+/* */
+/* For multi-threading applications each thread should have its own */
+/* FT_Library object. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Init_FreeType( FT_Library *alibrary );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Done_FreeType */
+/* */
+/* <Description> */
+/* Destroy a given FreeType library object and all of its children, */
+/* including resources, drivers, faces, sizes, etc. */
+/* */
+/* <Input> */
+/* library :: A handle to the target library object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Done_FreeType( FT_Library library );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_OPEN_XXX */
+/* */
+/* <Description> */
+/* A list of bit-field constants used within the `flags' field of the */
+/* @FT_Open_Args structure. */
+/* */
+/* <Values> */
+/* FT_OPEN_MEMORY :: This is a memory-based stream. */
+/* */
+/* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
+/* */
+/* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
+/* name. */
+/* */
+/* FT_OPEN_DRIVER :: Use the `driver' field. */
+/* */
+/* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
+/* */
+/* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
+/* */
+/* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
+/* */
+/* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
+/* */
+/* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
+/* */
+/* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
+/* */
+/* <Note> */
+/* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
+/* flags are mutually exclusive. */
+/* */
#define FT_OPEN_MEMORY 0x1
#define FT_OPEN_STREAM 0x2
#define FT_OPEN_PATHNAME 0x4
@@ -1749,92 +1741,90 @@ FT_BEGIN_HEADER
#define ft_open_params FT_OPEN_PARAMS /* deprecated */
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Parameter */
- /* */
- /* <Description> */
- /* A simple structure used to pass more or less generic parameters to */
- /* @FT_Open_Face. */
- /* */
- /* <Fields> */
- /* tag :: A four-byte identification tag. */
- /* */
- /* data :: A pointer to the parameter data. */
- /* */
- /* <Note> */
- /* The ID and function of parameters are driver-specific. See the */
- /* various FT_PARAM_TAG_XXX flags for more information. */
- /* */
- typedef struct FT_Parameter_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Parameter */
+/* */
+/* <Description> */
+/* A simple structure used to pass more or less generic parameters to */
+/* @FT_Open_Face. */
+/* */
+/* <Fields> */
+/* tag :: A four-byte identification tag. */
+/* */
+/* data :: A pointer to the parameter data. */
+/* */
+/* <Note> */
+/* The ID and function of parameters are driver-specific. See the */
+/* various FT_PARAM_TAG_XXX flags for more information. */
+/* */
+typedef struct FT_Parameter_ {
FT_ULong tag;
FT_Pointer data;
- } FT_Parameter;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Open_Args */
- /* */
- /* <Description> */
- /* A structure used to indicate how to open a new font file or */
- /* stream. A pointer to such a structure can be used as a parameter */
- /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
- /* */
- /* <Fields> */
- /* flags :: A set of bit flags indicating how to use the */
- /* structure. */
- /* */
- /* memory_base :: The first byte of the file in memory. */
- /* */
- /* memory_size :: The size in bytes of the file in memory. */
- /* */
- /* pathname :: A pointer to an 8-bit file pathname. */
- /* */
- /* stream :: A handle to a source stream object. */
- /* */
- /* driver :: This field is exclusively used by @FT_Open_Face; */
- /* it simply specifies the font driver to use to open */
- /* the face. If set to~0, FreeType tries to load the */
- /* face with each one of the drivers in its list. */
- /* */
- /* num_params :: The number of extra parameters. */
- /* */
- /* params :: Extra parameters passed to the font driver when */
- /* opening a new face. */
- /* */
- /* <Note> */
- /* The stream type is determined by the contents of `flags' which */
- /* are tested in the following order by @FT_Open_Face: */
- /* */
- /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
- /* memory file of `memory_size' bytes, located at `memory_address'. */
- /* The data are are not copied, and the client is responsible for */
- /* releasing and destroying them _after_ the corresponding call to */
- /* @FT_Done_Face. */
- /* */
- /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
- /* custom input stream `stream' is used. */
- /* */
- /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
- /* is a normal file and use `pathname' to open it. */
- /* */
- /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
- /* open the file with the driver whose handler is in `driver'. */
- /* */
- /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
- /* `num_params' and `params' is used. They are ignored otherwise. */
- /* */
- /* Ideally, both the `pathname' and `params' fields should be tagged */
- /* as `const'; this is missing for API backwards compatibility. In */
- /* other words, applications should treat them as read-only. */
- /* */
- typedef struct FT_Open_Args_
- {
+} FT_Parameter;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Open_Args */
+/* */
+/* <Description> */
+/* A structure used to indicate how to open a new font file or */
+/* stream. A pointer to such a structure can be used as a parameter */
+/* for the functions @FT_Open_Face and @FT_Attach_Stream. */
+/* */
+/* <Fields> */
+/* flags :: A set of bit flags indicating how to use the */
+/* structure. */
+/* */
+/* memory_base :: The first byte of the file in memory. */
+/* */
+/* memory_size :: The size in bytes of the file in memory. */
+/* */
+/* pathname :: A pointer to an 8-bit file pathname. */
+/* */
+/* stream :: A handle to a source stream object. */
+/* */
+/* driver :: This field is exclusively used by @FT_Open_Face; */
+/* it simply specifies the font driver to use to open */
+/* the face. If set to~0, FreeType tries to load the */
+/* face with each one of the drivers in its list. */
+/* */
+/* num_params :: The number of extra parameters. */
+/* */
+/* params :: Extra parameters passed to the font driver when */
+/* opening a new face. */
+/* */
+/* <Note> */
+/* The stream type is determined by the contents of `flags' which */
+/* are tested in the following order by @FT_Open_Face: */
+/* */
+/* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
+/* memory file of `memory_size' bytes, located at `memory_address'. */
+/* The data are are not copied, and the client is responsible for */
+/* releasing and destroying them _after_ the corresponding call to */
+/* @FT_Done_Face. */
+/* */
+/* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
+/* custom input stream `stream' is used. */
+/* */
+/* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
+/* is a normal file and use `pathname' to open it. */
+/* */
+/* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
+/* open the file with the driver whose handler is in `driver'. */
+/* */
+/* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
+/* `num_params' and `params' is used. They are ignored otherwise. */
+/* */
+/* Ideally, both the `pathname' and `params' fields should be tagged */
+/* as `const'; this is missing for API backwards compatibility. In */
+/* other words, applications should treat them as read-only. */
+/* */
+typedef struct FT_Open_Args_ {
FT_UInt flags;
const FT_Byte* memory_base;
FT_Long memory_size;
@@ -1844,313 +1834,312 @@ FT_BEGIN_HEADER
FT_Int num_params;
FT_Parameter* params;
- } FT_Open_Args;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font by its pathname. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* pathname :: A path to the font file. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face( FT_Library library,
- const char* filepathname,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font which has been */
- /* loaded into memory. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* file_base :: A pointer to the beginning of the font data. */
- /* */
- /* file_size :: The size of the memory chunk used by the font data. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You must not deallocate the memory before calling @FT_Done_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Memory_Face( FT_Library library,
- const FT_Byte* file_base,
- FT_Long file_size,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Open_Face */
- /* */
- /* <Description> */
- /* Create a face object from a given resource described by */
- /* @FT_Open_Args. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* args :: A pointer to an `FT_Open_Args' structure which must */
- /* be filled by the caller. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See note below. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* FT_Open_Face can be used to quickly check whether the font */
- /* format of a given font resource is supported by FreeType. If the */
- /* `face_index' field is negative, the function's return value is~0 */
- /* if the font format is recognized, or non-zero otherwise; */
- /* the function returns a more or less empty face handle in `*aface' */
- /* (if `aface' isn't NULL). The only useful field in this special */
- /* case is `face->num_faces' which gives the number of faces within */
- /* the font file. After examination, the returned @FT_Face structure */
- /* should be deallocated with a call to @FT_Done_Face. */
- /* */
- /* Each new face object created with this function also owns a */
- /* default @FT_Size object, accessible as `face->size'. */
- /* */
- /* One @FT_Library instance can have multiple face objects, this is, */
- /* @FT_Open_Face and its siblings can be called multiple times using */
- /* the same `library' argument. */
- /* */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Open_Face( FT_Library library,
- const FT_Open_Args* args,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_File */
- /* */
- /* <Description> */
- /* This function calls @FT_Attach_Stream to attach a file. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* filepathname :: The pathname. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_File( FT_Face face,
- const char* filepathname );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_Stream */
- /* */
- /* <Description> */
- /* `Attach' data to a face object. Normally, this is used to read */
- /* additional information for the face object. For example, you can */
- /* attach an AFM file that comes with a Type~1 font to get the */
- /* kerning values and other metrics. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* parameters :: A pointer to @FT_Open_Args which must be filled by */
- /* the caller. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The meaning of the `attach' (i.e., what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they are doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_Stream( FT_Face face,
- FT_Open_Args* parameters );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Reference_Face */
- /* */
- /* <Description> */
- /* A counter gets initialized to~1 at the time an @FT_Face structure */
- /* is created. This function increments the counter. @FT_Done_Face */
- /* then only destroys a face if the counter is~1, otherwise it simply */
- /* decrements the counter. */
- /* */
- /* This function helps in managing life-cycles of structures which */
- /* reference @FT_Face objects. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Since> */
- /* 2.4.2 */
- /* */
- FT_EXPORT( FT_Error )
- FT_Reference_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Face */
- /* */
- /* <Description> */
- /* Discard a given face object, as well as all of its child slots and */
- /* sizes. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Size */
- /* */
- /* <Description> */
- /* Select a bitmap strike. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* strike_index :: The index of the bitmap strike in the */
- /* `available_sizes' field of @FT_FaceRec structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Size( FT_Face face,
- FT_Int strike_index );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Size_Request_Type */
- /* */
- /* <Description> */
- /* An enumeration type that lists the supported size request types. */
- /* */
- /* <Values> */
- /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
- /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
- /* used to determine both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `ascender' and (minus */
- /* of) the `descender' fields of @FT_FaceRec are used to determine */
- /* both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_BBOX :: */
- /* The font bounding box. The width and height of the `bbox' field */
- /* of @FT_FaceRec are used to determine the horizontal and vertical */
- /* scaling value, respectively. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_CELL :: */
- /* The `max_advance_width' field of @FT_FaceRec is used to */
- /* determine the horizontal scaling value; the vertical scaling */
- /* value is determined the same way as */
- /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
- /* values are set to the smaller one. This type is useful if you */
- /* want to specify the font size for, say, a window of a given */
- /* dimension and 80x24 cells. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_SCALES :: */
- /* Specify the scaling values directly. */
- /* */
- /* <Note> */
- /* The above descriptions only apply to scalable formats. For bitmap */
- /* formats, the behaviour is up to the driver. */
- /* */
- /* See the note section of @FT_Size_Metrics if you wonder how size */
- /* requesting relates to scaling values. */
- /* */
- typedef enum FT_Size_Request_Type_
- {
+} FT_Open_Args;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Face */
+/* */
+/* <Description> */
+/* This function calls @FT_Open_Face to open a font by its pathname. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* pathname :: A path to the font file. */
+/* */
+/* face_index :: The index of the face within the font. The first */
+/* face has index~0. */
+/* */
+/* <Output> */
+/* aface :: A handle to a new face object. If `face_index' is */
+/* greater than or equal to zero, it must be non-NULL. */
+/* See @FT_Open_Face for more details. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Face( FT_Library library,
+ const char* filepathname,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Memory_Face */
+/* */
+/* <Description> */
+/* This function calls @FT_Open_Face to open a font which has been */
+/* loaded into memory. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* file_base :: A pointer to the beginning of the font data. */
+/* */
+/* file_size :: The size of the memory chunk used by the font data. */
+/* */
+/* face_index :: The index of the face within the font. The first */
+/* face has index~0. */
+/* */
+/* <Output> */
+/* aface :: A handle to a new face object. If `face_index' is */
+/* greater than or equal to zero, it must be non-NULL. */
+/* See @FT_Open_Face for more details. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* You must not deallocate the memory before calling @FT_Done_Face. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Memory_Face( FT_Library library,
+ const FT_Byte* file_base,
+ FT_Long file_size,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Open_Face */
+/* */
+/* <Description> */
+/* Create a face object from a given resource described by */
+/* @FT_Open_Args. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* args :: A pointer to an `FT_Open_Args' structure which must */
+/* be filled by the caller. */
+/* */
+/* face_index :: The index of the face within the font. The first */
+/* face has index~0. */
+/* */
+/* <Output> */
+/* aface :: A handle to a new face object. If `face_index' is */
+/* greater than or equal to zero, it must be non-NULL. */
+/* See note below. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* Unlike FreeType 1.x, this function automatically creates a glyph */
+/* slot for the face object which can be accessed directly through */
+/* `face->glyph'. */
+/* */
+/* FT_Open_Face can be used to quickly check whether the font */
+/* format of a given font resource is supported by FreeType. If the */
+/* `face_index' field is negative, the function's return value is~0 */
+/* if the font format is recognized, or non-zero otherwise; */
+/* the function returns a more or less empty face handle in `*aface' */
+/* (if `aface' isn't NULL). The only useful field in this special */
+/* case is `face->num_faces' which gives the number of faces within */
+/* the font file. After examination, the returned @FT_Face structure */
+/* should be deallocated with a call to @FT_Done_Face. */
+/* */
+/* Each new face object created with this function also owns a */
+/* default @FT_Size object, accessible as `face->size'. */
+/* */
+/* One @FT_Library instance can have multiple face objects, this is, */
+/* @FT_Open_Face and its siblings can be called multiple times using */
+/* the same `library' argument. */
+/* */
+/* See the discussion of reference counters in the description of */
+/* @FT_Reference_Face. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Open_Face( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Attach_File */
+/* */
+/* <Description> */
+/* This function calls @FT_Attach_Stream to attach a file. */
+/* */
+/* <InOut> */
+/* face :: The target face object. */
+/* */
+/* <Input> */
+/* filepathname :: The pathname. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Attach_File( FT_Face face,
+ const char* filepathname );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Attach_Stream */
+/* */
+/* <Description> */
+/* `Attach' data to a face object. Normally, this is used to read */
+/* additional information for the face object. For example, you can */
+/* attach an AFM file that comes with a Type~1 font to get the */
+/* kerning values and other metrics. */
+/* */
+/* <InOut> */
+/* face :: The target face object. */
+/* */
+/* <Input> */
+/* parameters :: A pointer to @FT_Open_Args which must be filled by */
+/* the caller. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The meaning of the `attach' (i.e., what really happens when the */
+/* new file is read) is not fixed by FreeType itself. It really */
+/* depends on the font format (and thus the font driver). */
+/* */
+/* Client applications are expected to know what they are doing */
+/* when invoking this function. Most drivers simply do not implement */
+/* file attachments. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Attach_Stream( FT_Face face,
+ FT_Open_Args* parameters );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Reference_Face */
+/* */
+/* <Description> */
+/* A counter gets initialized to~1 at the time an @FT_Face structure */
+/* is created. This function increments the counter. @FT_Done_Face */
+/* then only destroys a face if the counter is~1, otherwise it simply */
+/* decrements the counter. */
+/* */
+/* This function helps in managing life-cycles of structures which */
+/* reference @FT_Face objects. */
+/* */
+/* <Input> */
+/* face :: A handle to a target face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Since> */
+/* 2.4.2 */
+/* */
+FT_EXPORT( FT_Error )
+FT_Reference_Face( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Done_Face */
+/* */
+/* <Description> */
+/* Discard a given face object, as well as all of its child slots and */
+/* sizes. */
+/* */
+/* <Input> */
+/* face :: A handle to a target face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* See the discussion of reference counters in the description of */
+/* @FT_Reference_Face. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Done_Face( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Select_Size */
+/* */
+/* <Description> */
+/* Select a bitmap strike. */
+/* */
+/* <InOut> */
+/* face :: A handle to a target face object. */
+/* */
+/* <Input> */
+/* strike_index :: The index of the bitmap strike in the */
+/* `available_sizes' field of @FT_FaceRec structure. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Select_Size( FT_Face face,
+ FT_Int strike_index );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Size_Request_Type */
+/* */
+/* <Description> */
+/* An enumeration type that lists the supported size request types. */
+/* */
+/* <Values> */
+/* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
+/* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
+/* used to determine both scaling values. */
+/* */
+/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
+/* The real dimension. The sum of the the `ascender' and (minus */
+/* of) the `descender' fields of @FT_FaceRec are used to determine */
+/* both scaling values. */
+/* */
+/* FT_SIZE_REQUEST_TYPE_BBOX :: */
+/* The font bounding box. The width and height of the `bbox' field */
+/* of @FT_FaceRec are used to determine the horizontal and vertical */
+/* scaling value, respectively. */
+/* */
+/* FT_SIZE_REQUEST_TYPE_CELL :: */
+/* The `max_advance_width' field of @FT_FaceRec is used to */
+/* determine the horizontal scaling value; the vertical scaling */
+/* value is determined the same way as */
+/* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
+/* values are set to the smaller one. This type is useful if you */
+/* want to specify the font size for, say, a window of a given */
+/* dimension and 80x24 cells. */
+/* */
+/* FT_SIZE_REQUEST_TYPE_SCALES :: */
+/* Specify the scaling values directly. */
+/* */
+/* <Note> */
+/* The above descriptions only apply to scalable formats. For bitmap */
+/* formats, the behaviour is up to the driver. */
+/* */
+/* See the note section of @FT_Size_Metrics if you wonder how size */
+/* requesting relates to scaling values. */
+/* */
+typedef enum FT_Size_Request_Type_ {
FT_SIZE_REQUEST_TYPE_NOMINAL,
FT_SIZE_REQUEST_TYPE_REAL_DIM,
FT_SIZE_REQUEST_TYPE_BBOX,
@@ -2159,392 +2148,391 @@ FT_BEGIN_HEADER
FT_SIZE_REQUEST_TYPE_MAX
- } FT_Size_Request_Type;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_RequestRec */
- /* */
- /* <Description> */
- /* A structure used to model a size request. */
- /* */
- /* <Fields> */
- /* type :: See @FT_Size_Request_Type. */
- /* */
- /* width :: The desired width. */
- /* */
- /* height :: The desired height. */
- /* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* <Note> */
- /* If `width' is zero, then the horizontal scaling value is set equal */
- /* to the vertical scaling value, and vice versa. */
- /* */
- typedef struct FT_Size_RequestRec_
- {
+} FT_Size_Request_Type;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Size_RequestRec */
+/* */
+/* <Description> */
+/* A structure used to model a size request. */
+/* */
+/* <Fields> */
+/* type :: See @FT_Size_Request_Type. */
+/* */
+/* width :: The desired width. */
+/* */
+/* height :: The desired height. */
+/* */
+/* horiResolution :: The horizontal resolution. If set to zero, */
+/* `width' is treated as a 26.6 fractional pixel */
+/* value. */
+/* */
+/* vertResolution :: The vertical resolution. If set to zero, */
+/* `height' is treated as a 26.6 fractional pixel */
+/* value. */
+/* */
+/* <Note> */
+/* If `width' is zero, then the horizontal scaling value is set equal */
+/* to the vertical scaling value, and vice versa. */
+/* */
+typedef struct FT_Size_RequestRec_ {
FT_Size_Request_Type type;
FT_Long width;
FT_Long height;
FT_UInt horiResolution;
FT_UInt vertResolution;
- } FT_Size_RequestRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Request */
- /* */
- /* <Description> */
- /* A handle to a size request structure. */
- /* */
- typedef struct FT_Size_RequestRec_ *FT_Size_Request;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Request_Size */
- /* */
- /* <Description> */
- /* Resize the scale of the active @FT_Size object in a face. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* req :: A pointer to a @FT_Size_RequestRec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Although drivers may select the bitmap strike matching the */
- /* request, you should not rely on this if you intend to select a */
- /* particular bitmap strike. Use @FT_Select_Size instead in that */
- /* case. */
- /* */
- /* The relation between the requested size and the resulting glyph */
- /* size is dependent entirely on how the size is defined in the */
- /* source face. The font designer chooses the final size of each */
- /* glyph relative to this size. For more information refer to */
- /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
- /* */
- FT_EXPORT( FT_Error )
- FT_Request_Size( FT_Face face,
- FT_Size_Request req );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Char_Size */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in points). */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* char_width :: The nominal width, in 26.6 fractional points. */
- /* */
- /* char_height :: The nominal height, in 26.6 fractional points. */
- /* */
- /* horz_resolution :: The horizontal resolution in dpi. */
- /* */
- /* vert_resolution :: The vertical resolution in dpi. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If either the character width or height is zero, it is set equal */
- /* to the other value. */
- /* */
- /* If either the horizontal or vertical resolution is zero, it is set */
- /* equal to the other value. */
- /* */
- /* A character width or height smaller than 1pt is set to 1pt; if */
- /* both resolution values are zero, they are set to 72dpi. */
- /* */
- /* Don't use this function if you are using the FreeType cache API. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Char_Size( FT_Face face,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in pixels). */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* pixel_width :: The nominal width, in pixels. */
- /* */
- /* pixel_height :: The nominal height, in pixels. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You should not rely on the resulting glyphs matching, or being */
- /* constrained, to this pixel size. Refer to @FT_Request_Size to */
- /* understand how requested sizes relate to actual sizes. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Pixel_Sizes( FT_Face face,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* glyph_index :: The index of the glyph in the font file. For */
- /* CID-keyed fonts (either in PS or in CFF format) */
- /* this argument specifies the CID value. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The loaded glyph may be transformed. See @FT_Set_Transform for */
- /* the details. */
- /* */
- /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
- /* returned for invalid CID values (this is, for CID values which */
- /* don't have a corresponding glyph in the font). See the discussion */
- /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Glyph( FT_Face face,
- FT_UInt glyph_index,
- FT_Int32 load_flags );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Char */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object, according to its character code. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* char_code :: The glyph's character code, according to the */
- /* current charmap used in the face. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Char( FT_Face face,
- FT_ULong char_code,
- FT_Int32 load_flags );
-
-
- /*************************************************************************
- *
- * @enum:
- * FT_LOAD_XXX
- *
- * @description:
- * A list of bit-field constants used with @FT_Load_Glyph to indicate
- * what kind of operations to perform during glyph loading.
- *
- * @values:
- * FT_LOAD_DEFAULT ::
- * Corresponding to~0, this value is used as the default glyph load
- * operation. In this case, the following happens:
- *
- * 1. FreeType looks for a bitmap for the glyph corresponding to the
- * face's current size. If one is found, the function returns.
- * The bitmap data can be accessed from the glyph slot (see note
- * below).
- *
- * 2. If no embedded bitmap is searched or found, FreeType looks for a
- * scalable outline. If one is found, it is loaded from the font
- * file, scaled to device pixels, then `hinted' to the pixel grid
- * in order to optimize it. The outline data can be accessed from
- * the glyph slot (see note below).
- *
- * Note that by default, the glyph loader doesn't render outlines into
- * bitmaps. The following flags are used to modify this default
- * behaviour to more specific and useful cases.
- *
- * FT_LOAD_NO_SCALE ::
- * Don't scale the loaded outline glyph but keep it in font units.
- *
- * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
- * unsets @FT_LOAD_RENDER.
- *
- * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
- * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
- * subglyphs must be scaled and positioned with hinting instructions.
- * This can be solved by loading the font without FT_LOAD_NO_SCALE and
- * setting the character size to `font->units_per_EM'.
- *
- * FT_LOAD_NO_HINTING ::
- * Disable hinting. This generally generates `blurrier' bitmap glyphs
- * when the glyph are rendered in any of the anti-aliased modes. See
- * also the note below.
- *
- * This flag is implied by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_RENDER ::
- * Call @FT_Render_Glyph after the glyph is loaded. By default, the
- * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
- * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
- *
- * This flag is unset by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_NO_BITMAP ::
- * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
- * flag.
- *
- * @FT_LOAD_NO_SCALE always sets this flag.
- *
- * FT_LOAD_VERTICAL_LAYOUT ::
- * Load the glyph for vertical text layout. In particular, the
- * `advance' value in the @FT_GlyphSlotRec structure is set to the
- * `vertAdvance' value of the `metrics' field.
- *
- * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
- * this flag currently. Reason is that in this case vertical metrics
- * get synthesized, and those values are not always consistent across
- * various font formats.
- *
- * FT_LOAD_FORCE_AUTOHINT ::
- * Indicates that the auto-hinter is preferred over the font's native
- * hinter. See also the note below.
- *
- * FT_LOAD_CROP_BITMAP ::
- * Indicates that the font driver should crop the loaded bitmap glyph
- * (i.e., remove all space around its black bits). Not all drivers
- * implement this.
- *
- * FT_LOAD_PEDANTIC ::
- * Indicates that the font driver should perform pedantic verifications
- * during glyph loading. This is mostly used to detect broken glyphs
- * in fonts. By default, FreeType tries to handle broken fonts also.
- *
- * In particular, errors from the TrueType bytecode engine are not
- * passed to the application if this flag is not set; this might
- * result in partially hinted or distorted glyphs in case a glyph's
- * bytecode is buggy.
- *
- * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
- * Ignored. Deprecated.
- *
- * FT_LOAD_NO_RECURSE ::
- * This flag is only used internally. It merely indicates that the
- * font driver should not load composite glyphs recursively. Instead,
- * it should set the `num_subglyph' and `subglyphs' values of the
- * glyph slot accordingly, and set `glyph->format' to
- * @FT_GLYPH_FORMAT_COMPOSITE.
- *
- * The description of sub-glyphs is not available to client
- * applications for now.
- *
- * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
- *
- * FT_LOAD_IGNORE_TRANSFORM ::
- * Indicates that the transform matrix set by @FT_Set_Transform should
- * be ignored.
- *
- * FT_LOAD_MONOCHROME ::
- * This flag is used with @FT_LOAD_RENDER to indicate that you want to
- * render an outline glyph to a 1-bit monochrome bitmap glyph, with
- * 8~pixels packed into each byte of the bitmap data.
- *
- * Note that this has no effect on the hinting algorithm used. You
- * should rather use @FT_LOAD_TARGET_MONO so that the
- * monochrome-optimized hinting algorithm is used.
- *
- * FT_LOAD_LINEAR_DESIGN ::
- * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
- * fields of @FT_GlyphSlotRec should be kept in font units. See
- * @FT_GlyphSlotRec for details.
- *
- * FT_LOAD_NO_AUTOHINT ::
- * Disable auto-hinter. See also the note below.
- *
- * @note:
- * By default, hinting is enabled and the font's native hinter (see
- * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
- * disable hinting by setting @FT_LOAD_NO_HINTING or change the
- * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
- * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
- * used at all.
- *
- * See the description of @FT_FACE_FLAG_TRICKY for a special exception
- * (affecting only a handful of Asian fonts).
- *
- * Besides deciding which hinter to use, you can also decide which
- * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
- *
- * Note that the auto-hinter needs a valid Unicode cmap (either a native
- * one or synthesized by FreeType) for producing correct results. If a
- * font provides an incorrect mapping (for example, assigning the
- * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
- * mathematical integral sign), the auto-hinter might produce useless
- * results.
- *
- */
+} FT_Size_RequestRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Size_Request */
+/* */
+/* <Description> */
+/* A handle to a size request structure. */
+/* */
+typedef struct FT_Size_RequestRec_ *FT_Size_Request;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Request_Size */
+/* */
+/* <Description> */
+/* Resize the scale of the active @FT_Size object in a face. */
+/* */
+/* <InOut> */
+/* face :: A handle to a target face object. */
+/* */
+/* <Input> */
+/* req :: A pointer to a @FT_Size_RequestRec. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* Although drivers may select the bitmap strike matching the */
+/* request, you should not rely on this if you intend to select a */
+/* particular bitmap strike. Use @FT_Select_Size instead in that */
+/* case. */
+/* */
+/* The relation between the requested size and the resulting glyph */
+/* size is dependent entirely on how the size is defined in the */
+/* source face. The font designer chooses the final size of each */
+/* glyph relative to this size. For more information refer to */
+/* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
+/* */
+FT_EXPORT( FT_Error )
+FT_Request_Size( FT_Face face,
+ FT_Size_Request req );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Char_Size */
+/* */
+/* <Description> */
+/* This function calls @FT_Request_Size to request the nominal size */
+/* (in points). */
+/* */
+/* <InOut> */
+/* face :: A handle to a target face object. */
+/* */
+/* <Input> */
+/* char_width :: The nominal width, in 26.6 fractional points. */
+/* */
+/* char_height :: The nominal height, in 26.6 fractional points. */
+/* */
+/* horz_resolution :: The horizontal resolution in dpi. */
+/* */
+/* vert_resolution :: The vertical resolution in dpi. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* If either the character width or height is zero, it is set equal */
+/* to the other value. */
+/* */
+/* If either the horizontal or vertical resolution is zero, it is set */
+/* equal to the other value. */
+/* */
+/* A character width or height smaller than 1pt is set to 1pt; if */
+/* both resolution values are zero, they are set to 72dpi. */
+/* */
+/* Don't use this function if you are using the FreeType cache API. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Pixel_Sizes */
+/* */
+/* <Description> */
+/* This function calls @FT_Request_Size to request the nominal size */
+/* (in pixels). */
+/* */
+/* <InOut> */
+/* face :: A handle to the target face object. */
+/* */
+/* <Input> */
+/* pixel_width :: The nominal width, in pixels. */
+/* */
+/* pixel_height :: The nominal height, in pixels. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* You should not rely on the resulting glyphs matching, or being */
+/* constrained, to this pixel size. Refer to @FT_Request_Size to */
+/* understand how requested sizes relate to actual sizes. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Load_Glyph */
+/* */
+/* <Description> */
+/* A function used to load a single glyph into the glyph slot of a */
+/* face object. */
+/* */
+/* <InOut> */
+/* face :: A handle to the target face object where the glyph */
+/* is loaded. */
+/* */
+/* <Input> */
+/* glyph_index :: The index of the glyph in the font file. For */
+/* CID-keyed fonts (either in PS or in CFF format) */
+/* this argument specifies the CID value. */
+/* */
+/* load_flags :: A flag indicating what to load for this glyph. The */
+/* @FT_LOAD_XXX constants can be used to control the */
+/* glyph loading process (e.g., whether the outline */
+/* should be scaled, whether to load bitmaps or not, */
+/* whether to hint the outline, etc). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The loaded glyph may be transformed. See @FT_Set_Transform for */
+/* the details. */
+/* */
+/* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
+/* returned for invalid CID values (this is, for CID values which */
+/* don't have a corresponding glyph in the font). See the discussion */
+/* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Load_Glyph( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Load_Char */
+/* */
+/* <Description> */
+/* A function used to load a single glyph into the glyph slot of a */
+/* face object, according to its character code. */
+/* */
+/* <InOut> */
+/* face :: A handle to a target face object where the glyph */
+/* is loaded. */
+/* */
+/* <Input> */
+/* char_code :: The glyph's character code, according to the */
+/* current charmap used in the face. */
+/* */
+/* load_flags :: A flag indicating what to load for this glyph. The */
+/* @FT_LOAD_XXX constants can be used to control the */
+/* glyph loading process (e.g., whether the outline */
+/* should be scaled, whether to load bitmaps or not, */
+/* whether to hint the outline, etc). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Load_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_Int32 load_flags );
+
+
+/*************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_XXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_Load_Glyph to indicate
+ * what kind of operations to perform during glyph loading.
+ *
+ * @values:
+ * FT_LOAD_DEFAULT ::
+ * Corresponding to~0, this value is used as the default glyph load
+ * operation. In this case, the following happens:
+ *
+ * 1. FreeType looks for a bitmap for the glyph corresponding to the
+ * face's current size. If one is found, the function returns.
+ * The bitmap data can be accessed from the glyph slot (see note
+ * below).
+ *
+ * 2. If no embedded bitmap is searched or found, FreeType looks for a
+ * scalable outline. If one is found, it is loaded from the font
+ * file, scaled to device pixels, then `hinted' to the pixel grid
+ * in order to optimize it. The outline data can be accessed from
+ * the glyph slot (see note below).
+ *
+ * Note that by default, the glyph loader doesn't render outlines into
+ * bitmaps. The following flags are used to modify this default
+ * behaviour to more specific and useful cases.
+ *
+ * FT_LOAD_NO_SCALE ::
+ * Don't scale the loaded outline glyph but keep it in font units.
+ *
+ * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
+ * unsets @FT_LOAD_RENDER.
+ *
+ * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
+ * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
+ * subglyphs must be scaled and positioned with hinting instructions.
+ * This can be solved by loading the font without FT_LOAD_NO_SCALE and
+ * setting the character size to `font->units_per_EM'.
+ *
+ * FT_LOAD_NO_HINTING ::
+ * Disable hinting. This generally generates `blurrier' bitmap glyphs
+ * when the glyph are rendered in any of the anti-aliased modes. See
+ * also the note below.
+ *
+ * This flag is implied by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_RENDER ::
+ * Call @FT_Render_Glyph after the glyph is loaded. By default, the
+ * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
+ * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
+ *
+ * This flag is unset by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_NO_BITMAP ::
+ * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
+ * flag.
+ *
+ * @FT_LOAD_NO_SCALE always sets this flag.
+ *
+ * FT_LOAD_VERTICAL_LAYOUT ::
+ * Load the glyph for vertical text layout. In particular, the
+ * `advance' value in the @FT_GlyphSlotRec structure is set to the
+ * `vertAdvance' value of the `metrics' field.
+ *
+ * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
+ * this flag currently. Reason is that in this case vertical metrics
+ * get synthesized, and those values are not always consistent across
+ * various font formats.
+ *
+ * FT_LOAD_FORCE_AUTOHINT ::
+ * Indicates that the auto-hinter is preferred over the font's native
+ * hinter. See also the note below.
+ *
+ * FT_LOAD_CROP_BITMAP ::
+ * Indicates that the font driver should crop the loaded bitmap glyph
+ * (i.e., remove all space around its black bits). Not all drivers
+ * implement this.
+ *
+ * FT_LOAD_PEDANTIC ::
+ * Indicates that the font driver should perform pedantic verifications
+ * during glyph loading. This is mostly used to detect broken glyphs
+ * in fonts. By default, FreeType tries to handle broken fonts also.
+ *
+ * In particular, errors from the TrueType bytecode engine are not
+ * passed to the application if this flag is not set; this might
+ * result in partially hinted or distorted glyphs in case a glyph's
+ * bytecode is buggy.
+ *
+ * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+ * Ignored. Deprecated.
+ *
+ * FT_LOAD_NO_RECURSE ::
+ * This flag is only used internally. It merely indicates that the
+ * font driver should not load composite glyphs recursively. Instead,
+ * it should set the `num_subglyph' and `subglyphs' values of the
+ * glyph slot accordingly, and set `glyph->format' to
+ * @FT_GLYPH_FORMAT_COMPOSITE.
+ *
+ * The description of sub-glyphs is not available to client
+ * applications for now.
+ *
+ * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
+ *
+ * FT_LOAD_IGNORE_TRANSFORM ::
+ * Indicates that the transform matrix set by @FT_Set_Transform should
+ * be ignored.
+ *
+ * FT_LOAD_MONOCHROME ::
+ * This flag is used with @FT_LOAD_RENDER to indicate that you want to
+ * render an outline glyph to a 1-bit monochrome bitmap glyph, with
+ * 8~pixels packed into each byte of the bitmap data.
+ *
+ * Note that this has no effect on the hinting algorithm used. You
+ * should rather use @FT_LOAD_TARGET_MONO so that the
+ * monochrome-optimized hinting algorithm is used.
+ *
+ * FT_LOAD_LINEAR_DESIGN ::
+ * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
+ * fields of @FT_GlyphSlotRec should be kept in font units. See
+ * @FT_GlyphSlotRec for details.
+ *
+ * FT_LOAD_NO_AUTOHINT ::
+ * Disable auto-hinter. See also the note below.
+ *
+ * @note:
+ * By default, hinting is enabled and the font's native hinter (see
+ * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
+ * disable hinting by setting @FT_LOAD_NO_HINTING or change the
+ * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
+ * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
+ * used at all.
+ *
+ * See the description of @FT_FACE_FLAG_TRICKY for a special exception
+ * (affecting only a handful of Asian fonts).
+ *
+ * Besides deciding which hinter to use, you can also decide which
+ * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
+ *
+ * Note that the auto-hinter needs a valid Unicode cmap (either a native
+ * one or synthesized by FreeType) for producing correct results. If a
+ * font provides an incorrect mapping (for example, assigning the
+ * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
+ * mathematical integral sign), the auto-hinter might produce useless
+ * results.
+ *
+ */
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE ( 1L << 0 )
#define FT_LOAD_NO_HINTING ( 1L << 1 )
@@ -2561,78 +2549,78 @@ FT_BEGIN_HEADER
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
- /* */
+/* */
- /* used internally only by certain font drivers! */
+/* used internally only by certain font drivers! */
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
- /**************************************************************************
- *
- * @enum:
- * FT_LOAD_TARGET_XXX
- *
- * @description:
- * A list of values that are used to select a specific hinting algorithm
- * to use by the hinter. You should OR one of these values to your
- * `load_flags' when calling @FT_Load_Glyph.
- *
- * Note that font's native hinters may ignore the hinting algorithm you
- * have specified (e.g., the TrueType bytecode interpreter). You can set
- * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
- *
- * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
- * always implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * @values:
- * FT_LOAD_TARGET_NORMAL ::
- * This corresponds to the default hinting algorithm, optimized for
- * standard gray-level rendering. For monochrome output, use
- * @FT_LOAD_TARGET_MONO instead.
- *
- * FT_LOAD_TARGET_LIGHT ::
- * A lighter hinting algorithm for non-monochrome modes. Many
- * generated glyphs are more fuzzy but better resemble its original
- * shape. A bit like rendering on Mac OS~X.
- *
- * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * FT_LOAD_TARGET_MONO ::
- * Strong hinting algorithm that should only be used for monochrome
- * output. The result is probably unpleasant if the glyph is rendered
- * in non-monochrome modes.
- *
- * FT_LOAD_TARGET_LCD ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
- * decimated LCD displays.
- *
- * FT_LOAD_TARGET_LCD_V ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
- * decimated LCD displays.
- *
- * @note:
- * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
- * `load_flags'. They can't be ORed.
- *
- * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
- * corresponding mode (i.e., the mode which matches the used algorithm
- * best). An exeption is FT_LOAD_TARGET_MONO since it implies
- * @FT_LOAD_MONOCHROME.
- *
- * You can use a hinting algorithm that doesn't correspond to the same
- * rendering mode. As an example, it is possible to use the `light'
- * hinting algorithm and have the results rendered in horizontal LCD
- * pixel mode, with code like
- *
- * {
- * FT_Load_Glyph( face, glyph_index,
- * load_flags | FT_LOAD_TARGET_LIGHT );
- *
- * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
- * }
- *
- */
+/**************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_TARGET_XXX
+ *
+ * @description:
+ * A list of values that are used to select a specific hinting algorithm
+ * to use by the hinter. You should OR one of these values to your
+ * `load_flags' when calling @FT_Load_Glyph.
+ *
+ * Note that font's native hinters may ignore the hinting algorithm you
+ * have specified (e.g., the TrueType bytecode interpreter). You can set
+ * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
+ *
+ * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
+ * always implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * @values:
+ * FT_LOAD_TARGET_NORMAL ::
+ * This corresponds to the default hinting algorithm, optimized for
+ * standard gray-level rendering. For monochrome output, use
+ * @FT_LOAD_TARGET_MONO instead.
+ *
+ * FT_LOAD_TARGET_LIGHT ::
+ * A lighter hinting algorithm for non-monochrome modes. Many
+ * generated glyphs are more fuzzy but better resemble its original
+ * shape. A bit like rendering on Mac OS~X.
+ *
+ * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * FT_LOAD_TARGET_MONO ::
+ * Strong hinting algorithm that should only be used for monochrome
+ * output. The result is probably unpleasant if the glyph is rendered
+ * in non-monochrome modes.
+ *
+ * FT_LOAD_TARGET_LCD ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
+ * decimated LCD displays.
+ *
+ * FT_LOAD_TARGET_LCD_V ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
+ * decimated LCD displays.
+ *
+ * @note:
+ * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
+ * `load_flags'. They can't be ORed.
+ *
+ * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
+ * corresponding mode (i.e., the mode which matches the used algorithm
+ * best). An exeption is FT_LOAD_TARGET_MONO since it implies
+ * @FT_LOAD_MONOCHROME.
+ *
+ * You can use a hinting algorithm that doesn't correspond to the same
+ * rendering mode. As an example, it is possible to use the `light'
+ * hinting algorithm and have the results rendered in horizontal LCD
+ * pixel mode, with code like
+ *
+ * {
+ * FT_Load_Glyph( face, glyph_index,
+ * load_flags | FT_LOAD_TARGET_LIGHT );
+ *
+ * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
+ * }
+ *
+ */
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
@@ -2642,110 +2630,109 @@ FT_BEGIN_HEADER
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
- /**************************************************************************
- *
- * @macro:
- * FT_LOAD_TARGET_MODE
- *
- * @description:
- * Return the @FT_Render_Mode corresponding to a given
- * @FT_LOAD_TARGET_XXX value.
- *
- */
+/**************************************************************************
+ *
+ * @macro:
+ * FT_LOAD_TARGET_MODE
+ *
+ * @description:
+ * Return the @FT_Render_Mode corresponding to a given
+ * @FT_LOAD_TARGET_XXX value.
+ *
+ */
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Transform */
- /* */
- /* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images when they are loaded into a glyph slot through */
- /* @FT_Load_Glyph. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use~0 for the null */
- /* vector. */
- /* */
- /* <Note> */
- /* The transformation is only applied to scalable image formats after */
- /* the glyph has been loaded. It means that hinting is unaltered by */
- /* the transformation and is performed on the character size given in */
- /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
- /* */
- /* Note that this also transforms the `face.glyph.advance' field, but */
- /* *not* the values in `face.glyph.metrics'. */
- /* */
- FT_EXPORT( void )
- FT_Set_Transform( FT_Face face,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Render_Mode */
- /* */
- /* <Description> */
- /* An enumeration type that lists the render modes supported by */
- /* FreeType~2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline. */
- /* */
- /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
- /* field in the @FT_GlyphSlotRec structure gives the format of the */
- /* returned bitmap. */
- /* */
- /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
- /* */
- /* <Values> */
- /* FT_RENDER_MODE_NORMAL :: */
- /* This is the default render mode; it corresponds to 8-bit */
- /* anti-aliased bitmaps. */
- /* */
- /* FT_RENDER_MODE_LIGHT :: */
- /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
- /* defined as a separate value because render modes are also used */
- /* indirectly to define hinting algorithm selectors. See */
- /* @FT_LOAD_TARGET_XXX for details. */
- /* */
- /* FT_RENDER_MODE_MONO :: */
- /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
- /* opacity). */
- /* */
- /* FT_RENDER_MODE_LCD :: */
- /* This mode corresponds to horizontal RGB and BGR sub-pixel */
- /* displays like LCD screens. It produces 8-bit bitmaps that are */
- /* 3~times the width of the original glyph outline in pixels, and */
- /* which use the @FT_PIXEL_MODE_LCD mode. */
- /* */
- /* FT_RENDER_MODE_LCD_V :: */
- /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
- /* (like PDA screens, rotated LCD displays, etc.). It produces */
- /* 8-bit bitmaps that are 3~times the height of the original */
- /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
- /* */
- /* <Note> */
- /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
- /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
- /* (not active in the default builds). It is up to the caller to */
- /* either call @FT_Library_SetLcdFilter (if available) or do the */
- /* filtering itself. */
- /* */
- /* The selected render mode only affects vector glyphs of a font. */
- /* Embedded bitmaps often have a different pixel mode like */
- /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
- /* them into 8-bit pixmaps. */
- /* */
- typedef enum FT_Render_Mode_
- {
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Transform */
+/* */
+/* <Description> */
+/* A function used to set the transformation that is applied to glyph */
+/* images when they are loaded into a glyph slot through */
+/* @FT_Load_Glyph. */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Input> */
+/* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
+/* the identity matrix. */
+/* delta :: A pointer to the translation vector. Use~0 for the null */
+/* vector. */
+/* */
+/* <Note> */
+/* The transformation is only applied to scalable image formats after */
+/* the glyph has been loaded. It means that hinting is unaltered by */
+/* the transformation and is performed on the character size given in */
+/* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
+/* */
+/* Note that this also transforms the `face.glyph.advance' field, but */
+/* *not* the values in `face.glyph.metrics'. */
+/* */
+FT_EXPORT( void )
+FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Render_Mode */
+/* */
+/* <Description> */
+/* An enumeration type that lists the render modes supported by */
+/* FreeType~2. Each mode corresponds to a specific type of scanline */
+/* conversion performed on the outline. */
+/* */
+/* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
+/* field in the @FT_GlyphSlotRec structure gives the format of the */
+/* returned bitmap. */
+/* */
+/* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
+/* */
+/* <Values> */
+/* FT_RENDER_MODE_NORMAL :: */
+/* This is the default render mode; it corresponds to 8-bit */
+/* anti-aliased bitmaps. */
+/* */
+/* FT_RENDER_MODE_LIGHT :: */
+/* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
+/* defined as a separate value because render modes are also used */
+/* indirectly to define hinting algorithm selectors. See */
+/* @FT_LOAD_TARGET_XXX for details. */
+/* */
+/* FT_RENDER_MODE_MONO :: */
+/* This mode corresponds to 1-bit bitmaps (with 2~levels of */
+/* opacity). */
+/* */
+/* FT_RENDER_MODE_LCD :: */
+/* This mode corresponds to horizontal RGB and BGR sub-pixel */
+/* displays like LCD screens. It produces 8-bit bitmaps that are */
+/* 3~times the width of the original glyph outline in pixels, and */
+/* which use the @FT_PIXEL_MODE_LCD mode. */
+/* */
+/* FT_RENDER_MODE_LCD_V :: */
+/* This mode corresponds to vertical RGB and BGR sub-pixel displays */
+/* (like PDA screens, rotated LCD displays, etc.). It produces */
+/* 8-bit bitmaps that are 3~times the height of the original */
+/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
+/* */
+/* <Note> */
+/* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
+/* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
+/* (not active in the default builds). It is up to the caller to */
+/* either call @FT_Library_SetLcdFilter (if available) or do the */
+/* filtering itself. */
+/* */
+/* The selected render mode only affects vector glyphs of a font. */
+/* Embedded bitmaps often have a different pixel mode like */
+/* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
+/* them into 8-bit pixmaps. */
+/* */
+typedef enum FT_Render_Mode_ {
FT_RENDER_MODE_NORMAL = 0,
FT_RENDER_MODE_LIGHT,
FT_RENDER_MODE_MONO,
@@ -2754,510 +2741,509 @@ FT_BEGIN_HEADER
FT_RENDER_MODE_MAX
- } FT_Render_Mode;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_render_mode_xxx */
- /* */
- /* <Description> */
- /* These constants are deprecated. Use the corresponding */
- /* @FT_Render_Mode values instead. */
- /* */
- /* <Values> */
- /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
- /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
- /* */
+} FT_Render_Mode;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* ft_render_mode_xxx */
+/* */
+/* <Description> */
+/* These constants are deprecated. Use the corresponding */
+/* @FT_Render_Mode values instead. */
+/* */
+/* <Values> */
+/* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
+/* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
+/* */
#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
#define ft_render_mode_mono FT_RENDER_MODE_MONO
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Render_Glyph */
- /* */
- /* <Description> */
- /* Convert a given glyph image to a bitmap. It does so by inspecting */
- /* the glyph image format, finding the relevant renderer, and */
- /* invoking it. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the glyph slot containing the image to */
- /* convert. */
- /* */
- /* <Input> */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See @FT_Render_Mode for a */
- /* list of possible values. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Render_Glyph( FT_GlyphSlot slot,
- FT_Render_Mode render_mode );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Kerning_Mode */
- /* */
- /* <Description> */
- /* An enumeration used to specify which kerning values to return in */
- /* @FT_Get_Kerning. */
- /* */
- /* <Values> */
- /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
- /* distances (value is~0). */
- /* */
- /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
- /* distances. */
- /* */
- /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
- /* units. */
- /* */
- typedef enum FT_Kerning_Mode_
- {
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Render_Glyph */
+/* */
+/* <Description> */
+/* Convert a given glyph image to a bitmap. It does so by inspecting */
+/* the glyph image format, finding the relevant renderer, and */
+/* invoking it. */
+/* */
+/* <InOut> */
+/* slot :: A handle to the glyph slot containing the image to */
+/* convert. */
+/* */
+/* <Input> */
+/* render_mode :: This is the render mode used to render the glyph */
+/* image into a bitmap. See @FT_Render_Mode for a */
+/* list of possible values. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Kerning_Mode */
+/* */
+/* <Description> */
+/* An enumeration used to specify which kerning values to return in */
+/* @FT_Get_Kerning. */
+/* */
+/* <Values> */
+/* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
+/* distances (value is~0). */
+/* */
+/* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
+/* distances. */
+/* */
+/* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
+/* units. */
+/* */
+typedef enum FT_Kerning_Mode_ {
FT_KERNING_DEFAULT = 0,
FT_KERNING_UNFITTED,
FT_KERNING_UNSCALED
- } FT_Kerning_Mode;
+} FT_Kerning_Mode;
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_default */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
- /* instead. */
- /* */
+/*************************************************************************/
+/* */
+/* <Const> */
+/* ft_kerning_default */
+/* */
+/* <Description> */
+/* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
+/* instead. */
+/* */
#define ft_kerning_default FT_KERNING_DEFAULT
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_unfitted */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
- /* instead. */
- /* */
+/*************************************************************************/
+/* */
+/* <Const> */
+/* ft_kerning_unfitted */
+/* */
+/* <Description> */
+/* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
+/* instead. */
+/* */
#define ft_kerning_unfitted FT_KERNING_UNFITTED
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_unscaled */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
- /* instead. */
- /* */
+/*************************************************************************/
+/* */
+/* <Const> */
+/* ft_kerning_unscaled */
+/* */
+/* <Description> */
+/* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
+/* instead. */
+/* */
#define ft_kerning_unscaled FT_KERNING_UNSCALED
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Kerning */
- /* */
- /* <Description> */
- /* Return the kerning vector between two glyphs of a same face. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* left_glyph :: The index of the left glyph in the kern pair. */
- /* */
- /* right_glyph :: The index of the right glyph in the kern pair. */
- /* */
- /* kern_mode :: See @FT_Kerning_Mode for more information. */
- /* Determines the scale and dimension of the returned */
- /* kerning vector. */
- /* */
- /* <Output> */
- /* akerning :: The kerning vector. This is either in font units */
- /* or in pixels (26.6 format) for scalable formats, */
- /* and in pixels for fixed-sizes formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this method. Other layouts, or more sophisticated */
- /* kernings, are out of the scope of this API function -- they can be */
- /* implemented through format-specific interfaces. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Kerning( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_UInt kern_mode,
- FT_Vector *akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Track_Kerning */
- /* */
- /* <Description> */
- /* Return the track kerning for a given face object at a given size. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* point_size :: The point size in 16.16 fractional points. */
- /* */
- /* degree :: The degree of tightness. Increasingly negative */
- /* values represent tighter track kerning, while */
- /* increasingly positive values represent looser track */
- /* kerning. Value zero means no track kerning. */
- /* */
- /* <Output> */
- /* akerning :: The kerning in 16.16 fractional points, to be */
- /* uniformly applied between all glyphs. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Currently, only the Type~1 font driver supports track kerning, */
- /* using data from AFM files (if attached with @FT_Attach_File or */
- /* @FT_Attach_Stream). */
- /* */
- /* Only very few AFM files come with track kerning data; please refer */
- /* to the Adobe's AFM specification for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Track_Kerning( FT_Face face,
- FT_Fixed point_size,
- FT_Int degree,
- FT_Fixed* akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII name of a given glyph in a face. This only */
- /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* buffer_max :: The maximum number of bytes available in the */
- /* buffer. */
- /* */
- /* <Output> */
- /* buffer :: A pointer to a target buffer where the name is */
- /* copied to. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* An error is returned if the face doesn't provide glyph names or if */
- /* the glyph index is invalid. In all cases of failure, the first */
- /* byte of `buffer' is set to~0 to indicate an empty name. */
- /* */
- /* The glyph name is truncated to fit within the buffer if it is too */
- /* long. The returned string is always zero-terminated. */
- /* */
- /* Be aware that FreeType reorders glyph indices internally so that */
- /* glyph index~0 always corresponds to the `missing glyph' (called */
- /* `.notdef'). */
- /* */
- /* This function is not compiled within the library if the config */
- /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
- /* `include/freetype/config/ftoptions.h'. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph_Name( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Postscript_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII PostScript name of a given face, if available. */
- /* This only works with PostScript and TrueType fonts. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to the face's PostScript name. NULL if unavailable. */
- /* */
- /* <Note> */
- /* The returned pointer is owned by the face and is destroyed with */
- /* it. */
- /* */
- FT_EXPORT( const char* )
- FT_Get_Postscript_Name( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap by its encoding tag (as listed in */
- /* `freetype.h'). */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* encoding :: A handle to the selected encoding. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if no charmap in the face */
- /* corresponds to the encoding queried here. */
- /* */
- /* Because many fonts contain more than a single cmap for Unicode */
- /* encoding, this function has some special code to select the one */
- /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
- /* is preferred to a UCS-2 cmap). It is thus preferable to */
- /* @FT_Set_Charmap in this case. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Charmap( FT_Face face,
- FT_Encoding encoding );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap for character code to glyph index mapping. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* charmap :: A handle to the selected charmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if the charmap is not part of */
- /* the face (i.e., if it is not listed in the `face->charmaps' */
- /* table). */
- /* */
- /* It also fails if a type~14 charmap is selected. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Charmap( FT_Face face,
- FT_CharMap charmap );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Get_Charmap_Index
- *
- * @description:
- * Retrieve index of a given charmap.
- *
- * @input:
- * charmap ::
- * A handle to a charmap.
- *
- * @return:
- * The index into the array of character maps within the face to which
- * `charmap' belongs. If an error occurs, -1 is returned.
- *
- */
- FT_EXPORT( FT_Int )
- FT_Get_Charmap_Index( FT_CharMap charmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Char_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code. This function */
- /* uses a charmap object to do the mapping. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within the */
- /* file. This is done to ensure that value~0 always corresponds to */
- /* the `missing glyph'. If the first glyph is not named `.notdef', */
- /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
- /* the glyph ID~0 position, and whatever was there will be moved to */
- /* the position `.notdef' had. For Type~1 fonts, if there is no */
- /* `.notdef' glyph at all, then one will be created at index~0 and */
- /* whatever was there will be moved to the last index -- Type~42 */
- /* fonts are considered invalid under this condition. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Char_Index( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_First_Char */
- /* */
- /* <Description> */
- /* This function is used to return the first character code in the */
- /* current charmap of a given face. It also returns the */
- /* corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of first character code. 0~if charmap is */
- /* empty. */
- /* */
- /* <Return> */
- /* The charmap's first character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_Next_Char to be able to */
- /* parse all character codes available in a given charmap. The code */
- /* should look like this: */
- /* */
- /* { */
- /* FT_ULong charcode; */
- /* FT_UInt gindex; */
- /* */
- /* */
- /* charcode = FT_Get_First_Char( face, &gindex ); */
- /* while ( gindex != 0 ) */
- /* { */
- /* ... do something with (charcode,gindex) pair ... */
- /* */
- /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
- /* } */
- /* } */
- /* */
- /* Note that `*agindex' is set to~0 if the charmap is empty. The */
- /* result itself can be~0 in two cases: if the charmap is empty or */
- /* if the value~0 is the first valid character code. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_First_Char( FT_Face face,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Next_Char */
- /* */
- /* <Description> */
- /* This function is used to return the next character code in the */
- /* current charmap of a given face following the value `char_code', */
- /* as well as the corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* char_code :: The starting character code. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of next character code. 0~if charmap */
- /* is empty. */
- /* */
- /* <Return> */
- /* The charmap's next character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_First_Char to walk */
- /* over all character codes available in a given charmap. See the */
- /* note for this function for a simple code example. */
- /* */
- /* Note that `*agindex' is set to~0 when there are no more codes in */
- /* the charmap. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_Next_Char( FT_Face face,
- FT_ULong char_code,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Name_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given glyph name. This function uses */
- /* driver specific objects to do the translation. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* glyph_name :: The glyph name. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Name_Index( FT_Face face,
- FT_String* glyph_name );
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SUBGLYPH_FLAG_XXX
- *
- * @description:
- * A list of constants used to describe subglyphs. Please refer to the
- * TrueType specification for the meaning of the various flags.
- *
- * @values:
- * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
- * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
- * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
- * FT_SUBGLYPH_FLAG_SCALE ::
- * FT_SUBGLYPH_FLAG_XY_SCALE ::
- * FT_SUBGLYPH_FLAG_2X2 ::
- * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
- *
- */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Kerning */
+/* */
+/* <Description> */
+/* Return the kerning vector between two glyphs of a same face. */
+/* */
+/* <Input> */
+/* face :: A handle to a source face object. */
+/* */
+/* left_glyph :: The index of the left glyph in the kern pair. */
+/* */
+/* right_glyph :: The index of the right glyph in the kern pair. */
+/* */
+/* kern_mode :: See @FT_Kerning_Mode for more information. */
+/* Determines the scale and dimension of the returned */
+/* kerning vector. */
+/* */
+/* <Output> */
+/* akerning :: The kerning vector. This is either in font units */
+/* or in pixels (26.6 format) for scalable formats, */
+/* and in pixels for fixed-sizes formats. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* Only horizontal layouts (left-to-right & right-to-left) are */
+/* supported by this method. Other layouts, or more sophisticated */
+/* kernings, are out of the scope of this API function -- they can be */
+/* implemented through format-specific interfaces. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Kerning( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_UInt kern_mode,
+ FT_Vector *akerning );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Track_Kerning */
+/* */
+/* <Description> */
+/* Return the track kerning for a given face object at a given size. */
+/* */
+/* <Input> */
+/* face :: A handle to a source face object. */
+/* */
+/* point_size :: The point size in 16.16 fractional points. */
+/* */
+/* degree :: The degree of tightness. Increasingly negative */
+/* values represent tighter track kerning, while */
+/* increasingly positive values represent looser track */
+/* kerning. Value zero means no track kerning. */
+/* */
+/* <Output> */
+/* akerning :: The kerning in 16.16 fractional points, to be */
+/* uniformly applied between all glyphs. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* Currently, only the Type~1 font driver supports track kerning, */
+/* using data from AFM files (if attached with @FT_Attach_File or */
+/* @FT_Attach_Stream). */
+/* */
+/* Only very few AFM files come with track kerning data; please refer */
+/* to the Adobe's AFM specification for more details. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Track_Kerning( FT_Face face,
+ FT_Fixed point_size,
+ FT_Int degree,
+ FT_Fixed* akerning );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Glyph_Name */
+/* */
+/* <Description> */
+/* Retrieve the ASCII name of a given glyph in a face. This only */
+/* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
+/* */
+/* <Input> */
+/* face :: A handle to a source face object. */
+/* */
+/* glyph_index :: The glyph index. */
+/* */
+/* buffer_max :: The maximum number of bytes available in the */
+/* buffer. */
+/* */
+/* <Output> */
+/* buffer :: A pointer to a target buffer where the name is */
+/* copied to. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* An error is returned if the face doesn't provide glyph names or if */
+/* the glyph index is invalid. In all cases of failure, the first */
+/* byte of `buffer' is set to~0 to indicate an empty name. */
+/* */
+/* The glyph name is truncated to fit within the buffer if it is too */
+/* long. The returned string is always zero-terminated. */
+/* */
+/* Be aware that FreeType reorders glyph indices internally so that */
+/* glyph index~0 always corresponds to the `missing glyph' (called */
+/* `.notdef'). */
+/* */
+/* This function is not compiled within the library if the config */
+/* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
+/* `include/freetype/config/ftoptions.h'. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Glyph_Name( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Postscript_Name */
+/* */
+/* <Description> */
+/* Retrieve the ASCII PostScript name of a given face, if available. */
+/* This only works with PostScript and TrueType fonts. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Return> */
+/* A pointer to the face's PostScript name. NULL if unavailable. */
+/* */
+/* <Note> */
+/* The returned pointer is owned by the face and is destroyed with */
+/* it. */
+/* */
+FT_EXPORT( const char* )
+FT_Get_Postscript_Name( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Select_Charmap */
+/* */
+/* <Description> */
+/* Select a given charmap by its encoding tag (as listed in */
+/* `freetype.h'). */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Input> */
+/* encoding :: A handle to the selected encoding. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function returns an error if no charmap in the face */
+/* corresponds to the encoding queried here. */
+/* */
+/* Because many fonts contain more than a single cmap for Unicode */
+/* encoding, this function has some special code to select the one */
+/* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
+/* is preferred to a UCS-2 cmap). It is thus preferable to */
+/* @FT_Set_Charmap in this case. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Select_Charmap( FT_Face face,
+ FT_Encoding encoding );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Charmap */
+/* */
+/* <Description> */
+/* Select a given charmap for character code to glyph index mapping. */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Input> */
+/* charmap :: A handle to the selected charmap. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function returns an error if the charmap is not part of */
+/* the face (i.e., if it is not listed in the `face->charmaps' */
+/* table). */
+/* */
+/* It also fails if a type~14 charmap is selected. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Charmap( FT_Face face,
+ FT_CharMap charmap );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Get_Charmap_Index
+ *
+ * @description:
+ * Retrieve index of a given charmap.
+ *
+ * @input:
+ * charmap ::
+ * A handle to a charmap.
+ *
+ * @return:
+ * The index into the array of character maps within the face to which
+ * `charmap' belongs. If an error occurs, -1 is returned.
+ *
+ */
+FT_EXPORT( FT_Int )
+FT_Get_Charmap_Index( FT_CharMap charmap );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Char_Index */
+/* */
+/* <Description> */
+/* Return the glyph index of a given character code. This function */
+/* uses a charmap object to do the mapping. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* */
+/* charcode :: The character code. */
+/* */
+/* <Return> */
+/* The glyph index. 0~means `undefined character code'. */
+/* */
+/* <Note> */
+/* If you use FreeType to manipulate the contents of font files */
+/* directly, be aware that the glyph index returned by this function */
+/* doesn't always correspond to the internal indices used within the */
+/* file. This is done to ensure that value~0 always corresponds to */
+/* the `missing glyph'. If the first glyph is not named `.notdef', */
+/* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
+/* the glyph ID~0 position, and whatever was there will be moved to */
+/* the position `.notdef' had. For Type~1 fonts, if there is no */
+/* `.notdef' glyph at all, then one will be created at index~0 and */
+/* whatever was there will be moved to the last index -- Type~42 */
+/* fonts are considered invalid under this condition. */
+/* */
+FT_EXPORT( FT_UInt )
+FT_Get_Char_Index( FT_Face face,
+ FT_ULong charcode );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_First_Char */
+/* */
+/* <Description> */
+/* This function is used to return the first character code in the */
+/* current charmap of a given face. It also returns the */
+/* corresponding glyph index. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Output> */
+/* agindex :: Glyph index of first character code. 0~if charmap is */
+/* empty. */
+/* */
+/* <Return> */
+/* The charmap's first character code. */
+/* */
+/* <Note> */
+/* You should use this function with @FT_Get_Next_Char to be able to */
+/* parse all character codes available in a given charmap. The code */
+/* should look like this: */
+/* */
+/* { */
+/* FT_ULong charcode; */
+/* FT_UInt gindex; */
+/* */
+/* */
+/* charcode = FT_Get_First_Char( face, &gindex ); */
+/* while ( gindex != 0 ) */
+/* { */
+/* ... do something with (charcode,gindex) pair ... */
+/* */
+/* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
+/* } */
+/* } */
+/* */
+/* Note that `*agindex' is set to~0 if the charmap is empty. The */
+/* result itself can be~0 in two cases: if the charmap is empty or */
+/* if the value~0 is the first valid character code. */
+/* */
+FT_EXPORT( FT_ULong )
+FT_Get_First_Char( FT_Face face,
+ FT_UInt *agindex );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Next_Char */
+/* */
+/* <Description> */
+/* This function is used to return the next character code in the */
+/* current charmap of a given face following the value `char_code', */
+/* as well as the corresponding glyph index. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* char_code :: The starting character code. */
+/* */
+/* <Output> */
+/* agindex :: Glyph index of next character code. 0~if charmap */
+/* is empty. */
+/* */
+/* <Return> */
+/* The charmap's next character code. */
+/* */
+/* <Note> */
+/* You should use this function with @FT_Get_First_Char to walk */
+/* over all character codes available in a given charmap. See the */
+/* note for this function for a simple code example. */
+/* */
+/* Note that `*agindex' is set to~0 when there are no more codes in */
+/* the charmap. */
+/* */
+FT_EXPORT( FT_ULong )
+FT_Get_Next_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_UInt *agindex );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Name_Index */
+/* */
+/* <Description> */
+/* Return the glyph index of a given glyph name. This function uses */
+/* driver specific objects to do the translation. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* */
+/* glyph_name :: The glyph name. */
+/* */
+/* <Return> */
+/* The glyph index. 0~means `undefined character code'. */
+/* */
+FT_EXPORT( FT_UInt )
+FT_Get_Name_Index( FT_Face face,
+ FT_String* glyph_name );
+
+
+/*************************************************************************
+ *
+ * @macro:
+ * FT_SUBGLYPH_FLAG_XXX
+ *
+ * @description:
+ * A list of constants used to describe subglyphs. Please refer to the
+ * TrueType specification for the meaning of the various flags.
+ *
+ * @values:
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
+ * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
+ * FT_SUBGLYPH_FLAG_SCALE ::
+ * FT_SUBGLYPH_FLAG_XY_SCALE ::
+ * FT_SUBGLYPH_FLAG_2X2 ::
+ * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
+ *
+ */
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
@@ -3267,110 +3253,110 @@ FT_BEGIN_HEADER
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
- /*************************************************************************
- *
- * @func:
- * FT_Get_SubGlyph_Info
- *
- * @description:
- * Retrieve a description of a given subglyph. Only use it if
- * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
- * returned otherwise.
- *
- * @input:
- * glyph ::
- * The source glyph slot.
- *
- * sub_index ::
- * The index of the subglyph. Must be less than
- * `glyph->num_subglyphs'.
- *
- * @output:
- * p_index ::
- * The glyph index of the subglyph.
- *
- * p_flags ::
- * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
- *
- * p_arg1 ::
- * The subglyph's first argument (if any).
- *
- * p_arg2 ::
- * The subglyph's second argument (if any).
- *
- * p_transform ::
- * The subglyph transformation (if any).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
- * interpreted depending on the flags returned in `*p_flags'. See the
- * TrueType specification for details.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
- FT_UInt sub_index,
- FT_Int *p_index,
- FT_UInt *p_flags,
- FT_Int *p_arg1,
- FT_Int *p_arg2,
- FT_Matrix *p_transform );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FSTYPE_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `fsType' field of the OS/2 table */
- /* in a TrueType or OpenType font and the `FSType' entry in a */
- /* PostScript font. These bit flags are returned by */
- /* @FT_Get_FSType_Flags; they inform client applications of embedding */
- /* and subsetting restrictions associated with a font. */
- /* */
- /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
- /* more details. */
- /* */
- /* <Values> */
- /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
- /* Fonts with no fsType bit set may be embedded and permanently */
- /* installed on the remote system by an application. */
- /* */
- /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
- /* Fonts that have only this bit set must not be modified, embedded */
- /* or exchanged in any manner without first obtaining permission of */
- /* the font software copyright owner. */
- /* */
- /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
- /* If this bit is set, the font may be embedded and temporarily */
- /* loaded on the remote system. Documents containing Preview & */
- /* Print fonts must be opened `read-only'; no edits can be applied */
- /* to the document. */
- /* */
- /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
- /* If this bit is set, the font may be embedded but must only be */
- /* installed temporarily on other systems. In contrast to Preview */
- /* & Print fonts, documents containing editable fonts may be opened */
- /* for reading, editing is permitted, and changes may be saved. */
- /* */
- /* FT_FSTYPE_NO_SUBSETTING :: */
- /* If this bit is set, the font may not be subsetted prior to */
- /* embedding. */
- /* */
- /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
- /* If this bit is set, only bitmaps contained in the font may be */
- /* embedded; no outline data may be embedded. If there are no */
- /* bitmaps available in the font, then the font is unembeddable. */
- /* */
- /* <Note> */
- /* While the fsType flags can indicate that a font may be embedded, a */
- /* license with the font vendor may be separately required to use the */
- /* font in this way. */
- /* */
+/*************************************************************************
+ *
+ * @func:
+ * FT_Get_SubGlyph_Info
+ *
+ * @description:
+ * Retrieve a description of a given subglyph. Only use it if
+ * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
+ * returned otherwise.
+ *
+ * @input:
+ * glyph ::
+ * The source glyph slot.
+ *
+ * sub_index ::
+ * The index of the subglyph. Must be less than
+ * `glyph->num_subglyphs'.
+ *
+ * @output:
+ * p_index ::
+ * The glyph index of the subglyph.
+ *
+ * p_flags ::
+ * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
+ *
+ * p_arg1 ::
+ * The subglyph's first argument (if any).
+ *
+ * p_arg2 ::
+ * The subglyph's second argument (if any).
+ *
+ * p_transform ::
+ * The subglyph transformation (if any).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
+ * interpreted depending on the flags returned in `*p_flags'. See the
+ * TrueType specification for details.
+ *
+ */
+FT_EXPORT( FT_Error )
+FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
+ FT_UInt sub_index,
+ FT_Int *p_index,
+ FT_UInt *p_flags,
+ FT_Int *p_arg1,
+ FT_Int *p_arg2,
+ FT_Matrix *p_transform );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_FSTYPE_XXX */
+/* */
+/* <Description> */
+/* A list of bit flags used in the `fsType' field of the OS/2 table */
+/* in a TrueType or OpenType font and the `FSType' entry in a */
+/* PostScript font. These bit flags are returned by */
+/* @FT_Get_FSType_Flags; they inform client applications of embedding */
+/* and subsetting restrictions associated with a font. */
+/* */
+/* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
+/* more details. */
+/* */
+/* <Values> */
+/* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
+/* Fonts with no fsType bit set may be embedded and permanently */
+/* installed on the remote system by an application. */
+/* */
+/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
+/* Fonts that have only this bit set must not be modified, embedded */
+/* or exchanged in any manner without first obtaining permission of */
+/* the font software copyright owner. */
+/* */
+/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
+/* If this bit is set, the font may be embedded and temporarily */
+/* loaded on the remote system. Documents containing Preview & */
+/* Print fonts must be opened `read-only'; no edits can be applied */
+/* to the document. */
+/* */
+/* FT_FSTYPE_EDITABLE_EMBEDDING :: */
+/* If this bit is set, the font may be embedded but must only be */
+/* installed temporarily on other systems. In contrast to Preview */
+/* & Print fonts, documents containing editable fonts may be opened */
+/* for reading, editing is permitted, and changes may be saved. */
+/* */
+/* FT_FSTYPE_NO_SUBSETTING :: */
+/* If this bit is set, the font may not be subsetted prior to */
+/* embedding. */
+/* */
+/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
+/* If this bit is set, only bitmaps contained in the font may be */
+/* embedded; no outline data may be embedded. If there are no */
+/* bitmaps available in the font, then the font is unembeddable. */
+/* */
+/* <Note> */
+/* While the fsType flags can indicate that a font may be embedded, a */
+/* license with the font vendor may be separately required to use the */
+/* font in this way. */
+/* */
#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
@@ -3379,610 +3365,610 @@ FT_BEGIN_HEADER
#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_FSType_Flags */
- /* */
- /* <Description> */
- /* Return the fsType flags for a font. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* The fsType flags, @FT_FSTYPE_XXX. */
- /* */
- /* <Note> */
- /* Use this function rather than directly reading the `fs_type' field */
- /* in the @PS_FontInfoRec structure which is only guaranteed to */
- /* return the correct results for Type~1 fonts. */
- /* */
- /* <Since> */
- /* 2.3.8 */
- /* */
- FT_EXPORT( FT_UShort )
- FT_Get_FSType_Flags( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* glyph_variants */
- /* */
- /* <Title> */
- /* Glyph Variants */
- /* */
- /* <Abstract> */
- /* The FreeType~2 interface to Unicode Ideographic Variation */
- /* Sequences (IVS), using the SFNT cmap format~14. */
- /* */
- /* <Description> */
- /* Many CJK characters have variant forms. They are a sort of grey */
- /* area somewhere between being totally irrelevant and semantically */
- /* distinct; for this reason, the Unicode consortium decided to */
- /* introduce Ideographic Variation Sequences (IVS), consisting of a */
- /* Unicode base character and one of 240 variant selectors */
- /* (U+E0100-U+E01EF), instead of further extending the already huge */
- /* code range for CJK characters. */
- /* */
- /* An IVS is registered and unique; for further details please refer */
- /* to Unicode Technical Standard #37, the Ideographic Variation */
- /* Database: */
- /* */
- /* http://www.unicode.org/reports/tr37/ */
- /* */
- /* To date (November 2012), the character with the most variants is */
- /* U+9089, having 31 such IVS. */
- /* */
- /* Adobe and MS decided to support IVS with a new cmap subtable */
- /* (format~14). It is an odd subtable because it is not a mapping of */
- /* input code points to glyphs, but contains lists of all variants */
- /* supported by the font. */
- /* */
- /* A variant may be either `default' or `non-default'. A default */
- /* variant is the one you will get for that code point if you look it */
- /* up in the standard Unicode cmap. A non-default variant is a */
- /* different glyph. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIndex */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code as modified by */
- /* the variation selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character code point in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode code point of the variation selector. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means either `undefined character code', or */
- /* `undefined selector code', or `no variation selector cmap */
- /* subtable', or `current CharMap is not Unicode'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within */
- /* the file. This is done to ensure that value~0 always corresponds */
- /* to the `missing glyph'. */
- /* */
- /* This function is only meaningful if */
- /* a) the font has a variation selector cmap sub table, */
- /* and */
- /* b) the current charmap has a Unicode encoding. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Face_GetCharVariantIndex( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIsDefault */
- /* */
- /* <Description> */
- /* Check whether this variant of this Unicode character is the one to */
- /* be found in the `cmap'. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode codepoint of the variation selector. */
- /* */
- /* <Return> */
- /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
- /* variation selector cmap, or -1 if it is not a variant. */
- /* */
- /* <Note> */
- /* This function is only meaningful if the font has a variation */
- /* selector cmap subtable. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_Int )
- FT_Face_GetCharVariantIsDefault( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantSelectors */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* in the font. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to an array of selector code points, or NULL if there is */
- /* no valid variant selector cmap subtable. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantSelectors( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantsOfChar */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* for the specified character code. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* <Return> */
- /* A pointer to an array of variant selector code points which are */
- /* active for the given character, or NULL if the corresponding list */
- /* is empty. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantsOfChar( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharsOfVariant */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode character codes found for */
- /* the specified variant selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* variantSelector :: */
- /* The variant selector code point in Unicode. */
- /* */
- /* <Return> */
- /* A list of all the code points which are specified by this selector */
- /* (both default and non-default codes are returned) or NULL if there */
- /* is no valid cmap or the variant selector is invalid. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetCharsOfVariant( FT_Face face,
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_FSType_Flags */
+/* */
+/* <Description> */
+/* Return the fsType flags for a font. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face object. */
+/* */
+/* <Return> */
+/* The fsType flags, @FT_FSTYPE_XXX. */
+/* */
+/* <Note> */
+/* Use this function rather than directly reading the `fs_type' field */
+/* in the @PS_FontInfoRec structure which is only guaranteed to */
+/* return the correct results for Type~1 fonts. */
+/* */
+/* <Since> */
+/* 2.3.8 */
+/* */
+FT_EXPORT( FT_UShort )
+FT_Get_FSType_Flags( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* glyph_variants */
+/* */
+/* <Title> */
+/* Glyph Variants */
+/* */
+/* <Abstract> */
+/* The FreeType~2 interface to Unicode Ideographic Variation */
+/* Sequences (IVS), using the SFNT cmap format~14. */
+/* */
+/* <Description> */
+/* Many CJK characters have variant forms. They are a sort of grey */
+/* area somewhere between being totally irrelevant and semantically */
+/* distinct; for this reason, the Unicode consortium decided to */
+/* introduce Ideographic Variation Sequences (IVS), consisting of a */
+/* Unicode base character and one of 240 variant selectors */
+/* (U+E0100-U+E01EF), instead of further extending the already huge */
+/* code range for CJK characters. */
+/* */
+/* An IVS is registered and unique; for further details please refer */
+/* to Unicode Technical Standard #37, the Ideographic Variation */
+/* Database: */
+/* */
+/* http://www.unicode.org/reports/tr37/ */
+/* */
+/* To date (November 2012), the character with the most variants is */
+/* U+9089, having 31 such IVS. */
+/* */
+/* Adobe and MS decided to support IVS with a new cmap subtable */
+/* (format~14). It is an odd subtable because it is not a mapping of */
+/* input code points to glyphs, but contains lists of all variants */
+/* supported by the font. */
+/* */
+/* A variant may be either `default' or `non-default'. A default */
+/* variant is the one you will get for that code point if you look it */
+/* up in the standard Unicode cmap. A non-default variant is a */
+/* different glyph. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_GetCharVariantIndex */
+/* */
+/* <Description> */
+/* Return the glyph index of a given character code as modified by */
+/* the variation selector. */
+/* */
+/* <Input> */
+/* face :: */
+/* A handle to the source face object. */
+/* */
+/* charcode :: */
+/* The character code point in Unicode. */
+/* */
+/* variantSelector :: */
+/* The Unicode code point of the variation selector. */
+/* */
+/* <Return> */
+/* The glyph index. 0~means either `undefined character code', or */
+/* `undefined selector code', or `no variation selector cmap */
+/* subtable', or `current CharMap is not Unicode'. */
+/* */
+/* <Note> */
+/* If you use FreeType to manipulate the contents of font files */
+/* directly, be aware that the glyph index returned by this function */
+/* doesn't always correspond to the internal indices used within */
+/* the file. This is done to ensure that value~0 always corresponds */
+/* to the `missing glyph'. */
+/* */
+/* This function is only meaningful if */
+/* a) the font has a variation selector cmap sub table, */
+/* and */
+/* b) the current charmap has a Unicode encoding. */
+/* */
+/* <Since> */
+/* 2.3.6 */
+/* */
+FT_EXPORT( FT_UInt )
+FT_Face_GetCharVariantIndex( FT_Face face,
+ FT_ULong charcode,
FT_ULong variantSelector );
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /* <Title> */
- /* Computations */
- /* */
- /* <Abstract> */
- /* Crunching fixed numbers and vectors. */
- /* */
- /* <Description> */
- /* This section contains various functions used to perform */
- /* computations on 16.16 fixed-float numbers or 2d vectors. */
- /* */
- /* <Order> */
- /* FT_MulDiv */
- /* FT_MulFix */
- /* FT_DivFix */
- /* FT_RoundFix */
- /* FT_CeilFix */
- /* FT_FloorFix */
- /* FT_Vector_Transform */
- /* FT_Matrix_Multiply */
- /* FT_Matrix_Invert */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c );
-
-
- /* */
-
- /* The following #if 0 ... #endif is for the documentation formatter, */
- /* hiding the internal `FT_MULFIX_INLINED' macro. */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_GetCharVariantIsDefault */
+/* */
+/* <Description> */
+/* Check whether this variant of this Unicode character is the one to */
+/* be found in the `cmap'. */
+/* */
+/* <Input> */
+/* face :: */
+/* A handle to the source face object. */
+/* */
+/* charcode :: */
+/* The character codepoint in Unicode. */
+/* */
+/* variantSelector :: */
+/* The Unicode codepoint of the variation selector. */
+/* */
+/* <Return> */
+/* 1~if found in the standard (Unicode) cmap, 0~if found in the */
+/* variation selector cmap, or -1 if it is not a variant. */
+/* */
+/* <Note> */
+/* This function is only meaningful if the font has a variation */
+/* selector cmap subtable. */
+/* */
+/* <Since> */
+/* 2.3.6 */
+/* */
+FT_EXPORT( FT_Int )
+FT_Face_GetCharVariantIsDefault( FT_Face face,
+ FT_ULong charcode,
+ FT_ULong variantSelector );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_GetVariantSelectors */
+/* */
+/* <Description> */
+/* Return a zero-terminated list of Unicode variant selectors found */
+/* in the font. */
+/* */
+/* <Input> */
+/* face :: */
+/* A handle to the source face object. */
+/* */
+/* <Return> */
+/* A pointer to an array of selector code points, or NULL if there is */
+/* no valid variant selector cmap subtable. */
+/* */
+/* <Note> */
+/* The last item in the array is~0; the array is owned by the */
+/* @FT_Face object but can be overwritten or released on the next */
+/* call to a FreeType function. */
+/* */
+/* <Since> */
+/* 2.3.6 */
+/* */
+FT_EXPORT( FT_UInt32* )
+FT_Face_GetVariantSelectors( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_GetVariantsOfChar */
+/* */
+/* <Description> */
+/* Return a zero-terminated list of Unicode variant selectors found */
+/* for the specified character code. */
+/* */
+/* <Input> */
+/* face :: */
+/* A handle to the source face object. */
+/* */
+/* charcode :: */
+/* The character codepoint in Unicode. */
+/* */
+/* <Return> */
+/* A pointer to an array of variant selector code points which are */
+/* active for the given character, or NULL if the corresponding list */
+/* is empty. */
+/* */
+/* <Note> */
+/* The last item in the array is~0; the array is owned by the */
+/* @FT_Face object but can be overwritten or released on the next */
+/* call to a FreeType function. */
+/* */
+/* <Since> */
+/* 2.3.6 */
+/* */
+FT_EXPORT( FT_UInt32* )
+FT_Face_GetVariantsOfChar( FT_Face face,
+ FT_ULong charcode );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_GetCharsOfVariant */
+/* */
+/* <Description> */
+/* Return a zero-terminated list of Unicode character codes found for */
+/* the specified variant selector. */
+/* */
+/* <Input> */
+/* face :: */
+/* A handle to the source face object. */
+/* */
+/* variantSelector :: */
+/* The variant selector code point in Unicode. */
+/* */
+/* <Return> */
+/* A list of all the code points which are specified by this selector */
+/* (both default and non-default codes are returned) or NULL if there */
+/* is no valid cmap or the variant selector is invalid. */
+/* */
+/* <Note> */
+/* The last item in the array is~0; the array is owned by the */
+/* @FT_Face object but can be overwritten or released on the next */
+/* call to a FreeType function. */
+/* */
+/* <Since> */
+/* 2.3.6 */
+/* */
+FT_EXPORT( FT_UInt32* )
+FT_Face_GetCharsOfVariant( FT_Face face,
+ FT_ULong variantSelector );
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* computations */
+/* */
+/* <Title> */
+/* Computations */
+/* */
+/* <Abstract> */
+/* Crunching fixed numbers and vectors. */
+/* */
+/* <Description> */
+/* This section contains various functions used to perform */
+/* computations on 16.16 fixed-float numbers or 2d vectors. */
+/* */
+/* <Order> */
+/* FT_MulDiv */
+/* FT_MulFix */
+/* FT_DivFix */
+/* FT_RoundFix */
+/* FT_CeilFix */
+/* FT_FloorFix */
+/* FT_Vector_Transform */
+/* FT_Matrix_Multiply */
+/* FT_Matrix_Invert */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_MulDiv */
+/* */
+/* <Description> */
+/* A very simple function used to perform the computation `(a*b)/c' */
+/* with maximum accuracy (it uses a 64-bit intermediate integer */
+/* whenever necessary). */
+/* */
+/* This function isn't necessarily as fast as some processor specific */
+/* operations, but is at least completely portable. */
+/* */
+/* <Input> */
+/* a :: The first multiplier. */
+/* b :: The second multiplier. */
+/* c :: The divisor. */
+/* */
+/* <Return> */
+/* The result of `(a*b)/c'. This function never traps when trying to */
+/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
+/* on the signs of `a' and `b'. */
+/* */
+FT_EXPORT( FT_Long )
+FT_MulDiv( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+/* */
+
+/* The following #if 0 ... #endif is for the documentation formatter, */
+/* hiding the internal `FT_MULFIX_INLINED' macro. */
#if 0
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* This function has been optimized for the case where the absolute */
- /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
- /* As this happens mainly when scaling from notional units to */
- /* fractional pixels in FreeType, it resulted in noticeable speed */
- /* improvements between versions 2.x and 1.x. */
- /* */
- /* As a conclusion, always try to place a 16.16 factor as the */
- /* _second_ argument of this function; this can make a great */
- /* difference. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b );
-
- /* */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_MulFix */
+/* */
+/* <Description> */
+/* A very simple function used to perform the computation */
+/* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
+/* used to multiply a given value by a 16.16 fixed-point factor. */
+/* */
+/* <Input> */
+/* a :: The first multiplier. */
+/* b :: The second multiplier. Use a 16.16 factor here whenever */
+/* possible (see note below). */
+/* */
+/* <Return> */
+/* The result of `(a*b)/0x10000'. */
+/* */
+/* <Note> */
+/* This function has been optimized for the case where the absolute */
+/* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
+/* As this happens mainly when scaling from notional units to */
+/* fractional pixels in FreeType, it resulted in noticeable speed */
+/* improvements between versions 2.x and 1.x. */
+/* */
+/* As a conclusion, always try to place a 16.16 factor as the */
+/* _second_ argument of this function; this can make a great */
+/* difference. */
+/* */
+FT_EXPORT( FT_Long )
+FT_MulFix( FT_Long a,
+ FT_Long b );
+
+/* */
#endif
#ifdef FT_MULFIX_INLINED
#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
#else
- FT_EXPORT( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b );
+FT_EXPORT( FT_Long )
+FT_MulFix( FT_Long a,
+ FT_Long b );
#endif
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- /* <Note> */
- /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
- /* 32~bits, then the division is computed directly. Otherwise, we */
- /* use a specialized version of @FT_MulDiv. */
- /* */
- FT_EXPORT( FT_Long )
- FT_DivFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_RoundFix */
- /* */
- /* <Description> */
- /* A very simple function used to round a 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number to be rounded. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x8000) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_RoundFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_CeilFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the ceiling function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x10000 - 1) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_CeilFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_FloorFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the floor function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `a & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_FloorFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Vector_Transform */
- /* */
- /* <Description> */
- /* Transform a single vector through a 2x2 matrix. */
- /* */
- /* <InOut> */
- /* vector :: The target vector to transform. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <Note> */
- /* The result is undefined if either `vector' or `matrix' is invalid. */
- /* */
- FT_EXPORT( void )
- FT_Vector_Transform( FT_Vector* vec,
- const FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* version */
- /* */
- /* <Title> */
- /* FreeType Version */
- /* */
- /* <Abstract> */
- /* Functions and macros related to FreeType versions. */
- /* */
- /* <Description> */
- /* Note that those functions and macros are of limited use because */
- /* even a new release of FreeType with only documentation changes */
- /* increases the version number. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @enum:
- * FREETYPE_XXX
- *
- * @description:
- * These three macros identify the FreeType source code version.
- * Use @FT_Library_Version to access them at runtime.
- *
- * @values:
- * FREETYPE_MAJOR :: The major version number.
- * FREETYPE_MINOR :: The minor version number.
- * FREETYPE_PATCH :: The patch level.
- *
- * @note:
- * The version number of FreeType if built as a dynamic link library
- * with the `libtool' package is _not_ controlled by these three
- * macros.
- *
- */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_DivFix */
+/* */
+/* <Description> */
+/* A very simple function used to perform the computation */
+/* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
+/* used to divide a given value by a 16.16 fixed-point factor. */
+/* */
+/* <Input> */
+/* a :: The first multiplier. */
+/* b :: The second multiplier. Use a 16.16 factor here whenever */
+/* possible (see note below). */
+/* */
+/* <Return> */
+/* The result of `(a*0x10000)/b'. */
+/* */
+/* <Note> */
+/* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
+/* 32~bits, then the division is computed directly. Otherwise, we */
+/* use a specialized version of @FT_MulDiv. */
+/* */
+FT_EXPORT( FT_Long )
+FT_DivFix( FT_Long a,
+ FT_Long b );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_RoundFix */
+/* */
+/* <Description> */
+/* A very simple function used to round a 16.16 fixed number. */
+/* */
+/* <Input> */
+/* a :: The number to be rounded. */
+/* */
+/* <Return> */
+/* The result of `(a + 0x8000) & -0x10000'. */
+/* */
+FT_EXPORT( FT_Fixed )
+FT_RoundFix( FT_Fixed a );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_CeilFix */
+/* */
+/* <Description> */
+/* A very simple function used to compute the ceiling function of a */
+/* 16.16 fixed number. */
+/* */
+/* <Input> */
+/* a :: The number for which the ceiling function is to be computed. */
+/* */
+/* <Return> */
+/* The result of `(a + 0x10000 - 1) & -0x10000'. */
+/* */
+FT_EXPORT( FT_Fixed )
+FT_CeilFix( FT_Fixed a );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_FloorFix */
+/* */
+/* <Description> */
+/* A very simple function used to compute the floor function of a */
+/* 16.16 fixed number. */
+/* */
+/* <Input> */
+/* a :: The number for which the floor function is to be computed. */
+/* */
+/* <Return> */
+/* The result of `a & -0x10000'. */
+/* */
+FT_EXPORT( FT_Fixed )
+FT_FloorFix( FT_Fixed a );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Vector_Transform */
+/* */
+/* <Description> */
+/* Transform a single vector through a 2x2 matrix. */
+/* */
+/* <InOut> */
+/* vector :: The target vector to transform. */
+/* */
+/* <Input> */
+/* matrix :: A pointer to the source 2x2 matrix. */
+/* */
+/* <Note> */
+/* The result is undefined if either `vector' or `matrix' is invalid. */
+/* */
+FT_EXPORT( void )
+FT_Vector_Transform( FT_Vector* vec,
+ const FT_Matrix* matrix );
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* version */
+/* */
+/* <Title> */
+/* FreeType Version */
+/* */
+/* <Abstract> */
+/* Functions and macros related to FreeType versions. */
+/* */
+/* <Description> */
+/* Note that those functions and macros are of limited use because */
+/* even a new release of FreeType with only documentation changes */
+/* increases the version number. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @enum:
+ * FREETYPE_XXX
+ *
+ * @description:
+ * These three macros identify the FreeType source code version.
+ * Use @FT_Library_Version to access them at runtime.
+ *
+ * @values:
+ * FREETYPE_MAJOR :: The major version number.
+ * FREETYPE_MINOR :: The minor version number.
+ * FREETYPE_PATCH :: The patch level.
+ *
+ * @note:
+ * The version number of FreeType if built as a dynamic link library
+ * with the `libtool' package is _not_ controlled by these three
+ * macros.
+ *
+ */
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 4
#define FREETYPE_PATCH 12
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Library_Version */
- /* */
- /* <Description> */
- /* Return the version of the FreeType library being used. This is */
- /* useful when dynamically linking to the library, since one cannot */
- /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
- /* @FREETYPE_PATCH. */
- /* */
- /* <Input> */
- /* library :: A source library handle. */
- /* */
- /* <Output> */
- /* amajor :: The major version number. */
- /* */
- /* aminor :: The minor version number. */
- /* */
- /* apatch :: The patch version number. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' argument is because */
- /* certain programs implement library initialization in a custom way */
- /* that doesn't use @FT_Init_FreeType. */
- /* */
- /* In such cases, the library version might not be available before */
- /* the library object has been created. */
- /* */
- FT_EXPORT( void )
- FT_Library_Version( FT_Library library,
- FT_Int *amajor,
- FT_Int *aminor,
- FT_Int *apatch );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_CheckTrueTypePatents */
- /* */
- /* <Description> */
- /* Parse all bytecode instructions of a TrueType font file to check */
- /* whether any of the patented opcodes are used. This is only useful */
- /* if you want to be able to use the unpatented hinter with */
- /* fonts that do *not* use these opcodes. */
- /* */
- /* Note that this function parses *all* glyph instructions in the */
- /* font file, which may be slow. */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* <Return> */
- /* 1~if this is a TrueType font that uses one of the patented */
- /* opcodes, 0~otherwise. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_CheckTrueTypePatents( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_SetUnpatentedHinting */
- /* */
- /* <Description> */
- /* Enable or disable the unpatented hinter for a given face. */
- /* Only enable it if you have determined that the face doesn't */
- /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* value :: New boolean setting. */
- /* */
- /* <Return> */
- /* The old setting value. This will always be false if this is not */
- /* an SFNT font, or if the unpatented hinter is not compiled in this */
- /* instance of the library. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_SetUnpatentedHinting( FT_Face face,
- FT_Bool value );
-
- /* */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Library_Version */
+/* */
+/* <Description> */
+/* Return the version of the FreeType library being used. This is */
+/* useful when dynamically linking to the library, since one cannot */
+/* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
+/* @FREETYPE_PATCH. */
+/* */
+/* <Input> */
+/* library :: A source library handle. */
+/* */
+/* <Output> */
+/* amajor :: The major version number. */
+/* */
+/* aminor :: The minor version number. */
+/* */
+/* apatch :: The patch version number. */
+/* */
+/* <Note> */
+/* The reason why this function takes a `library' argument is because */
+/* certain programs implement library initialization in a custom way */
+/* that doesn't use @FT_Init_FreeType. */
+/* */
+/* In such cases, the library version might not be available before */
+/* the library object has been created. */
+/* */
+FT_EXPORT( void )
+FT_Library_Version( FT_Library library,
+ FT_Int *amajor,
+ FT_Int *aminor,
+ FT_Int *apatch );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_CheckTrueTypePatents */
+/* */
+/* <Description> */
+/* Parse all bytecode instructions of a TrueType font file to check */
+/* whether any of the patented opcodes are used. This is only useful */
+/* if you want to be able to use the unpatented hinter with */
+/* fonts that do *not* use these opcodes. */
+/* */
+/* Note that this function parses *all* glyph instructions in the */
+/* font file, which may be slow. */
+/* */
+/* <Input> */
+/* face :: A face handle. */
+/* */
+/* <Return> */
+/* 1~if this is a TrueType font that uses one of the patented */
+/* opcodes, 0~otherwise. */
+/* */
+/* <Note> */
+/* Since May 2010, TrueType hinting is no longer patented. */
+/* */
+/* <Since> */
+/* 2.3.5 */
+/* */
+FT_EXPORT( FT_Bool )
+FT_Face_CheckTrueTypePatents( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Face_SetUnpatentedHinting */
+/* */
+/* <Description> */
+/* Enable or disable the unpatented hinter for a given face. */
+/* Only enable it if you have determined that the face doesn't */
+/* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
+/* */
+/* <Input> */
+/* face :: A face handle. */
+/* */
+/* value :: New boolean setting. */
+/* */
+/* <Return> */
+/* The old setting value. This will always be false if this is not */
+/* an SFNT font, or if the unpatented hinter is not compiled in this */
+/* instance of the library. */
+/* */
+/* <Note> */
+/* Since May 2010, TrueType hinting is no longer patented. */
+/* */
+/* <Since> */
+/* 2.3.5 */
+/* */
+FT_EXPORT( FT_Bool )
+FT_Face_SetUnpatentedHinting( FT_Face face,
+ FT_Bool value );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftadvanc.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftadvanc.h
index b2451be..56ad44b 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftadvanc.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftadvanc.h
@@ -33,140 +33,140 @@
FT_BEGIN_HEADER
- /**************************************************************************
- *
- * @section:
- * quick_advance
- *
- * @title:
- * Quick retrieval of advance values
- *
- * @abstract:
- * Retrieve horizontal and vertical advance values without processing
- * glyph outlines, if possible.
- *
- * @description:
- * This section contains functions to quickly extract advance values
- * without handling glyph outlines, if possible.
- */
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* FT_ADVANCE_FLAG_FAST_ONLY */
- /* */
- /* <Description> */
- /* A bit-flag to be OR-ed with the `flags' parameter of the */
- /* @FT_Get_Advance and @FT_Get_Advances functions. */
- /* */
- /* If set, it indicates that you want these functions to fail if the */
- /* corresponding hinting mode or font driver doesn't allow for very */
- /* quick advance computation. */
- /* */
- /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
- /* or light-hinted can have their advance width computed very */
- /* quickly. */
- /* */
- /* Normal and bytecode hinted modes, which require loading, scaling, */
- /* and hinting of the glyph outline, are extremely slow by */
- /* comparison. */
- /* */
+/**************************************************************************
+ *
+ * @section:
+ * quick_advance
+ *
+ * @title:
+ * Quick retrieval of advance values
+ *
+ * @abstract:
+ * Retrieve horizontal and vertical advance values without processing
+ * glyph outlines, if possible.
+ *
+ * @description:
+ * This section contains functions to quickly extract advance values
+ * without handling glyph outlines, if possible.
+ */
+
+
+/*************************************************************************/
+/* */
+/* <Const> */
+/* FT_ADVANCE_FLAG_FAST_ONLY */
+/* */
+/* <Description> */
+/* A bit-flag to be OR-ed with the `flags' parameter of the */
+/* @FT_Get_Advance and @FT_Get_Advances functions. */
+/* */
+/* If set, it indicates that you want these functions to fail if the */
+/* corresponding hinting mode or font driver doesn't allow for very */
+/* quick advance computation. */
+/* */
+/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
+/* or light-hinted can have their advance width computed very */
+/* quickly. */
+/* */
+/* Normal and bytecode hinted modes, which require loading, scaling, */
+/* and hinting of the glyph outline, are extremely slow by */
+/* comparison. */
+/* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Advance */
- /* */
- /* <Description> */
- /* Retrieve the advance value of a given glyph outline in an */
- /* @FT_Face. By default, the unhinted advance is returned in font */
- /* units. */
- /* */
- /* <Input> */
- /* face :: The source @FT_Face handle. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* load_flags :: A set of bit flags similar to those used when */
- /* calling @FT_Load_Glyph, used to determine what kind */
- /* of advances you need. */
- /* <Output> */
- /* padvance :: The advance value, in either font units or 16.16 */
- /* format. */
- /* */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
- /* vertical advance corresponding to a vertical layout. */
- /* Otherwise, it is the horizontal advance in a */
- /* horizontal layout. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
- /* if the corresponding font backend doesn't have a quick way to */
- /* retrieve the advances. */
- /* */
- /* A scaled advance is returned in 16.16 format but isn't transformed */
- /* by the affine transformation specified by @FT_Set_Transform. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Advance( FT_Face face,
- FT_UInt gindex,
- FT_Int32 load_flags,
- FT_Fixed *padvance );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Advances */
- /* */
- /* <Description> */
- /* Retrieve the advance values of several glyph outlines in an */
- /* @FT_Face. By default, the unhinted advances are returned in font */
- /* units. */
- /* */
- /* <Input> */
- /* face :: The source @FT_Face handle. */
- /* */
- /* start :: The first glyph index. */
- /* */
- /* count :: The number of advance values you want to retrieve. */
- /* */
- /* load_flags :: A set of bit flags similar to those used when */
- /* calling @FT_Load_Glyph. */
- /* */
- /* <Output> */
- /* padvance :: The advances, in either font units or 16.16 format. */
- /* This array must contain at least `count' elements. */
- /* */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
- /* vertical advances corresponding to a vertical layout. */
- /* Otherwise, they are the horizontal advances in a */
- /* horizontal layout. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
- /* if the corresponding font backend doesn't have a quick way to */
- /* retrieve the advances. */
- /* */
- /* Scaled advances are returned in 16.16 format but aren't */
- /* transformed by the affine transformation specified by */
- /* @FT_Set_Transform. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Advances( FT_Face face,
- FT_UInt start,
- FT_UInt count,
- FT_Int32 load_flags,
- FT_Fixed *padvances );
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Advance */
+/* */
+/* <Description> */
+/* Retrieve the advance value of a given glyph outline in an */
+/* @FT_Face. By default, the unhinted advance is returned in font */
+/* units. */
+/* */
+/* <Input> */
+/* face :: The source @FT_Face handle. */
+/* */
+/* gindex :: The glyph index. */
+/* */
+/* load_flags :: A set of bit flags similar to those used when */
+/* calling @FT_Load_Glyph, used to determine what kind */
+/* of advances you need. */
+/* <Output> */
+/* padvance :: The advance value, in either font units or 16.16 */
+/* format. */
+/* */
+/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
+/* vertical advance corresponding to a vertical layout. */
+/* Otherwise, it is the horizontal advance in a */
+/* horizontal layout. */
+/* */
+/* <Return> */
+/* FreeType error code. 0 means success. */
+/* */
+/* <Note> */
+/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
+/* if the corresponding font backend doesn't have a quick way to */
+/* retrieve the advances. */
+/* */
+/* A scaled advance is returned in 16.16 format but isn't transformed */
+/* by the affine transformation specified by @FT_Set_Transform. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Advance( FT_Face face,
+ FT_UInt gindex,
+ FT_Int32 load_flags,
+ FT_Fixed *padvance );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Advances */
+/* */
+/* <Description> */
+/* Retrieve the advance values of several glyph outlines in an */
+/* @FT_Face. By default, the unhinted advances are returned in font */
+/* units. */
+/* */
+/* <Input> */
+/* face :: The source @FT_Face handle. */
+/* */
+/* start :: The first glyph index. */
+/* */
+/* count :: The number of advance values you want to retrieve. */
+/* */
+/* load_flags :: A set of bit flags similar to those used when */
+/* calling @FT_Load_Glyph. */
+/* */
+/* <Output> */
+/* padvance :: The advances, in either font units or 16.16 format. */
+/* This array must contain at least `count' elements. */
+/* */
+/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
+/* vertical advances corresponding to a vertical layout. */
+/* Otherwise, they are the horizontal advances in a */
+/* horizontal layout. */
+/* */
+/* <Return> */
+/* FreeType error code. 0 means success. */
+/* */
+/* <Note> */
+/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
+/* if the corresponding font backend doesn't have a quick way to */
+/* retrieve the advances. */
+/* */
+/* Scaled advances are returned in 16.16 format but aren't */
+/* transformed by the affine transformation specified by */
+/* @FT_Set_Transform. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Advances( FT_Face face,
+ FT_UInt start,
+ FT_UInt count,
+ FT_Int32 load_flags,
+ FT_Fixed *padvances );
/* */
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftautoh.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftautoh.h
index 62ce96d..25d34b1 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftautoh.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftautoh.h
@@ -32,314 +32,312 @@
FT_BEGIN_HEADER
- /**************************************************************************
- *
- * @section:
- * auto_hinter
- *
- * @title:
- * The auto-hinter
- *
- * @abstract:
- * Controlling the auto-hinting module.
- *
- * @description:
- * While FreeType's auto-hinter doesn't expose API functions by itself,
- * it is possible to control its behaviour with @FT_Property_Set and
- * @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * Note that the auto-hinter's module name is `autofitter' for
- * historical reasons.
- *
- */
+/**************************************************************************
+ *
+ * @section:
+ * auto_hinter
+ *
+ * @title:
+ * The auto-hinter
+ *
+ * @abstract:
+ * Controlling the auto-hinting module.
+ *
+ * @description:
+ * While FreeType's auto-hinter doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * Note that the auto-hinter's module name is `autofitter' for
+ * historical reasons.
+ *
+ */
- /**************************************************************************
- *
- * @property:
- * glyph-to-script-map
- *
- * @description:
- * The auto-hinter provides various script modules to hint glyphs.
- * Examples of supported scripts are Latin or CJK. Before a glyph is
- * auto-hinted, the Unicode character map of the font gets examined, and
- * the script is then determined based on Unicode character ranges, see
- * below.
- *
- * OpenType fonts, however, often provide much more glyphs than
- * character codes (small caps, superscripts, ligatures, swashes, etc.),
- * to be controlled by so-called `features'. Handling OpenType features
- * can be quite complicated and thus needs a separate library on top of
- * FreeType.
- *
- * The mapping between glyph indices and scripts (in the auto-hinter
- * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
- * array with `num_glyphs' elements, as found in the font's @FT_Face
- * structure. The `glyph-to-script-map' property returns a pointer to
- * this array which can be modified as needed. Note that the
- * modification should happen before the first glyph gets processed by
- * the auto-hinter so that the global analysis of the font shapes
- * actually uses the modified mapping.
- *
- * The following example code demonstrates how to access it (omitting
- * the error handling).
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_Prop_GlyphToScriptMap prop;
- *
- *
- * FT_Init_FreeType( &library );
- * FT_New_Face( library, "foo.ttf", 0, &face );
- *
- * prop.face = face;
- *
- * FT_Property_Get( library, "autofitter",
- * "glyph-to-script-map", &prop );
- *
- * // adjust `prop.map' as needed right here
- *
- * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
- * }
- *
- */
+/**************************************************************************
+ *
+ * @property:
+ * glyph-to-script-map
+ *
+ * @description:
+ * The auto-hinter provides various script modules to hint glyphs.
+ * Examples of supported scripts are Latin or CJK. Before a glyph is
+ * auto-hinted, the Unicode character map of the font gets examined, and
+ * the script is then determined based on Unicode character ranges, see
+ * below.
+ *
+ * OpenType fonts, however, often provide much more glyphs than
+ * character codes (small caps, superscripts, ligatures, swashes, etc.),
+ * to be controlled by so-called `features'. Handling OpenType features
+ * can be quite complicated and thus needs a separate library on top of
+ * FreeType.
+ *
+ * The mapping between glyph indices and scripts (in the auto-hinter
+ * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
+ * array with `num_glyphs' elements, as found in the font's @FT_Face
+ * structure. The `glyph-to-script-map' property returns a pointer to
+ * this array which can be modified as needed. Note that the
+ * modification should happen before the first glyph gets processed by
+ * the auto-hinter so that the global analysis of the font shapes
+ * actually uses the modified mapping.
+ *
+ * The following example code demonstrates how to access it (omitting
+ * the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_GlyphToScriptMap prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ *
+ * prop.face = face;
+ *
+ * FT_Property_Get( library, "autofitter",
+ * "glyph-to-script-map", &prop );
+ *
+ * // adjust `prop.map' as needed right here
+ *
+ * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
+ * }
+ *
+ */
- /**************************************************************************
- *
- * @enum:
- * FT_AUTOHINTER_SCRIPT_XXX
- *
- * @description:
- * A list of constants used for the @glyph-to-script-map property to
- * specify the script submodule the auto-hinter should use for hinting a
- * particular glyph.
- *
- * @values:
- * FT_AUTOHINTER_SCRIPT_NONE ::
- * Don't auto-hint this glyph.
- *
- * FT_AUTOHINTER_SCRIPT_LATIN ::
- * Apply the latin auto-hinter. For the auto-hinter, `latin' is a
- * very broad term, including Cyrillic and Greek also since characters
- * from those scripts share the same design constraints.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+0020 - U+007F // Basic Latin (no control characters)
- * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
- * U+0100 - U+017F // Latin Extended-A
- * U+0180 - U+024F // Latin Extended-B
- * U+0250 - U+02AF // IPA Extensions
- * U+02B0 - U+02FF // Spacing Modifier Letters
- * U+0300 - U+036F // Combining Diacritical Marks
- * U+0370 - U+03FF // Greek and Coptic
- * U+0400 - U+04FF // Cyrillic
- * U+0500 - U+052F // Cyrillic Supplement
- * U+1D00 - U+1D7F // Phonetic Extensions
- * U+1D80 - U+1DBF // Phonetic Extensions Supplement
- * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
- * U+1E00 - U+1EFF // Latin Extended Additional
- * U+1F00 - U+1FFF // Greek Extended
- * U+2000 - U+206F // General Punctuation
- * U+2070 - U+209F // Superscripts and Subscripts
- * U+20A0 - U+20CF // Currency Symbols
- * U+2150 - U+218F // Number Forms
- * U+2460 - U+24FF // Enclosed Alphanumerics
- * U+2C60 - U+2C7F // Latin Extended-C
- * U+2DE0 - U+2DFF // Cyrillic Extended-A
- * U+2E00 - U+2E7F // Supplemental Punctuation
- * U+A640 - U+A69F // Cyrillic Extended-B
- * U+A720 - U+A7FF // Latin Extended-D
- * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
- * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
- * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
- * }
- *
- * FT_AUTOHINTER_SCRIPT_CJK ::
- * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
- * Vietnamese, and some other scripts.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+1100 - U+11FF // Hangul Jamo
- * U+2E80 - U+2EFF // CJK Radicals Supplement
- * U+2F00 - U+2FDF // Kangxi Radicals
- * U+2FF0 - U+2FFF // Ideographic Description Characters
- * U+3000 - U+303F // CJK Symbols and Punctuation
- * U+3040 - U+309F // Hiragana
- * U+30A0 - U+30FF // Katakana
- * U+3100 - U+312F // Bopomofo
- * U+3130 - U+318F // Hangul Compatibility Jamo
- * U+3190 - U+319F // Kanbun
- * U+31A0 - U+31BF // Bopomofo Extended
- * U+31C0 - U+31EF // CJK Strokes
- * U+31F0 - U+31FF // Katakana Phonetic Extensions
- * U+3200 - U+32FF // Enclosed CJK Letters and Months
- * U+3300 - U+33FF // CJK Compatibility
- * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
- * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
- * U+4E00 - U+9FFF // CJK Unified Ideographs
- * U+A960 - U+A97F // Hangul Jamo Extended-A
- * U+AC00 - U+D7AF // Hangul Syllables
- * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
- * U+F900 - U+FAFF // CJK Compatibility Ideographs
- * U+FE10 - U+FE1F // Vertical forms
- * U+FE30 - U+FE4F // CJK Compatibility Forms
- * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
- * U+1B000 - U+1B0FF // Kana Supplement
- * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
- * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
- * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
- * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
- * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
- * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
- * }
- *
- * FT_AUTOHINTER_SCRIPT_INDIC ::
- * Apply the indic auto-hinter, covering all major scripts from the
- * Indian sub-continent and some other related scripts like Thai, Lao,
- * or Tibetan.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+0900 - U+0DFF // Indic Range
- * U+0F00 - U+0FFF // Tibetan
- * U+1900 - U+194F // Limbu
- * U+1B80 - U+1BBF // Sundanese
- * U+1C80 - U+1CDF // Meetei Mayak
- * U+A800 - U+A82F // Syloti Nagri
- * U+11800 - U+118DF // Sharada
- * }
- *
- * Note that currently Indic support is rudimentary only, missing blue
- * zone support.
- *
- */
+/**************************************************************************
+ *
+ * @enum:
+ * FT_AUTOHINTER_SCRIPT_XXX
+ *
+ * @description:
+ * A list of constants used for the @glyph-to-script-map property to
+ * specify the script submodule the auto-hinter should use for hinting a
+ * particular glyph.
+ *
+ * @values:
+ * FT_AUTOHINTER_SCRIPT_NONE ::
+ * Don't auto-hint this glyph.
+ *
+ * FT_AUTOHINTER_SCRIPT_LATIN ::
+ * Apply the latin auto-hinter. For the auto-hinter, `latin' is a
+ * very broad term, including Cyrillic and Greek also since characters
+ * from those scripts share the same design constraints.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0020 - U+007F // Basic Latin (no control characters)
+ * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
+ * U+0100 - U+017F // Latin Extended-A
+ * U+0180 - U+024F // Latin Extended-B
+ * U+0250 - U+02AF // IPA Extensions
+ * U+02B0 - U+02FF // Spacing Modifier Letters
+ * U+0300 - U+036F // Combining Diacritical Marks
+ * U+0370 - U+03FF // Greek and Coptic
+ * U+0400 - U+04FF // Cyrillic
+ * U+0500 - U+052F // Cyrillic Supplement
+ * U+1D00 - U+1D7F // Phonetic Extensions
+ * U+1D80 - U+1DBF // Phonetic Extensions Supplement
+ * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
+ * U+1E00 - U+1EFF // Latin Extended Additional
+ * U+1F00 - U+1FFF // Greek Extended
+ * U+2000 - U+206F // General Punctuation
+ * U+2070 - U+209F // Superscripts and Subscripts
+ * U+20A0 - U+20CF // Currency Symbols
+ * U+2150 - U+218F // Number Forms
+ * U+2460 - U+24FF // Enclosed Alphanumerics
+ * U+2C60 - U+2C7F // Latin Extended-C
+ * U+2DE0 - U+2DFF // Cyrillic Extended-A
+ * U+2E00 - U+2E7F // Supplemental Punctuation
+ * U+A640 - U+A69F // Cyrillic Extended-B
+ * U+A720 - U+A7FF // Latin Extended-D
+ * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
+ * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
+ * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_CJK ::
+ * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
+ * Vietnamese, and some other scripts.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+1100 - U+11FF // Hangul Jamo
+ * U+2E80 - U+2EFF // CJK Radicals Supplement
+ * U+2F00 - U+2FDF // Kangxi Radicals
+ * U+2FF0 - U+2FFF // Ideographic Description Characters
+ * U+3000 - U+303F // CJK Symbols and Punctuation
+ * U+3040 - U+309F // Hiragana
+ * U+30A0 - U+30FF // Katakana
+ * U+3100 - U+312F // Bopomofo
+ * U+3130 - U+318F // Hangul Compatibility Jamo
+ * U+3190 - U+319F // Kanbun
+ * U+31A0 - U+31BF // Bopomofo Extended
+ * U+31C0 - U+31EF // CJK Strokes
+ * U+31F0 - U+31FF // Katakana Phonetic Extensions
+ * U+3200 - U+32FF // Enclosed CJK Letters and Months
+ * U+3300 - U+33FF // CJK Compatibility
+ * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
+ * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
+ * U+4E00 - U+9FFF // CJK Unified Ideographs
+ * U+A960 - U+A97F // Hangul Jamo Extended-A
+ * U+AC00 - U+D7AF // Hangul Syllables
+ * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
+ * U+F900 - U+FAFF // CJK Compatibility Ideographs
+ * U+FE10 - U+FE1F // Vertical forms
+ * U+FE30 - U+FE4F // CJK Compatibility Forms
+ * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
+ * U+1B000 - U+1B0FF // Kana Supplement
+ * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
+ * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
+ * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
+ * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
+ * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
+ * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_INDIC ::
+ * Apply the indic auto-hinter, covering all major scripts from the
+ * Indian sub-continent and some other related scripts like Thai, Lao,
+ * or Tibetan.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0900 - U+0DFF // Indic Range
+ * U+0F00 - U+0FFF // Tibetan
+ * U+1900 - U+194F // Limbu
+ * U+1B80 - U+1BBF // Sundanese
+ * U+1C80 - U+1CDF // Meetei Mayak
+ * U+A800 - U+A82F // Syloti Nagri
+ * U+11800 - U+118DF // Sharada
+ * }
+ *
+ * Note that currently Indic support is rudimentary only, missing blue
+ * zone support.
+ *
+ */
#define FT_AUTOHINTER_SCRIPT_NONE 0
#define FT_AUTOHINTER_SCRIPT_LATIN 1
#define FT_AUTOHINTER_SCRIPT_CJK 2
#define FT_AUTOHINTER_SCRIPT_INDIC 3
- /**************************************************************************
- *
- * @struct:
- * FT_Prop_GlyphToScriptMap
- *
- * @description:
- * The data exchange structure for the @glyph-to-script-map property.
- *
- */
- typedef struct FT_Prop_GlyphToScriptMap_
- {
- FT_Face face;
- FT_Byte* map;
+/**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_GlyphToScriptMap
+ *
+ * @description:
+ * The data exchange structure for the @glyph-to-script-map property.
+ *
+ */
+typedef struct FT_Prop_GlyphToScriptMap_ {
+ FT_Face face;
+ FT_Byte* map;
- } FT_Prop_GlyphToScriptMap;
+} FT_Prop_GlyphToScriptMap;
- /**************************************************************************
- *
- * @property:
- * fallback-script
- *
- * @description:
- * If no auto-hinter script module can be assigned to a glyph, a
- * fallback script gets assigned to it (see also the
- * @glyph-to-script-map property). By default, this is
- * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
- * this fallback value can be changed.
- *
- * {
- * FT_Library library;
- * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "autofitter",
- * "fallback-script", &fallback_script );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * It's important to use the right timing for changing this value: The
- * creation of the glyph-to-script map which eventually uses the
- * fallback script value gets triggered either by setting or reading a
- * face-specific property like @glyph-to-script-map, or by auto-hinting
- * any glyph from that face. In particular, if you have already created
- * an @FT_Face structure but not loaded any glyph (using the
- * auto-hinter), a change of the fallback glyph will affect this face.
- *
- */
+/**************************************************************************
+ *
+ * @property:
+ * fallback-script
+ *
+ * @description:
+ * If no auto-hinter script module can be assigned to a glyph, a
+ * fallback script gets assigned to it (see also the
+ * @glyph-to-script-map property). By default, this is
+ * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
+ * this fallback value can be changed.
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "fallback-script", &fallback_script );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * It's important to use the right timing for changing this value: The
+ * creation of the glyph-to-script map which eventually uses the
+ * fallback script value gets triggered either by setting or reading a
+ * face-specific property like @glyph-to-script-map, or by auto-hinting
+ * any glyph from that face. In particular, if you have already created
+ * an @FT_Face structure but not loaded any glyph (using the
+ * auto-hinter), a change of the fallback glyph will affect this face.
+ *
+ */
- /**************************************************************************
- *
- * @property:
- * increase-x-height
- *
- * @description:
- * For ppem values in the range 6~<= ppem <= `increase-x-height', round
- * up the font's x~height much more often than normally. If the value
- * is set to~0, which is the default, this feature is switched off. Use
- * this property to improve the legibility of small font sizes if
- * necessary.
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_Prop_IncreaseXHeight prop;
- *
- *
- * FT_Init_FreeType( &library );
- * FT_New_Face( library, "foo.ttf", 0, &face );
- * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
- *
- * prop.face = face;
- * prop.limit = 14;
- *
- * FT_Property_Set( library, "autofitter",
- * "increase-x-height", &prop );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * Set this value right after calling @FT_Set_Char_Size, but before
- * loading any glyph (using the auto-hinter).
- *
- */
+/**************************************************************************
+ *
+ * @property:
+ * increase-x-height
+ *
+ * @description:
+ * For ppem values in the range 6~<= ppem <= `increase-x-height', round
+ * up the font's x~height much more often than normally. If the value
+ * is set to~0, which is the default, this feature is switched off. Use
+ * this property to improve the legibility of small font sizes if
+ * necessary.
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_IncreaseXHeight prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
+ *
+ * prop.face = face;
+ * prop.limit = 14;
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "increase-x-height", &prop );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * Set this value right after calling @FT_Set_Char_Size, but before
+ * loading any glyph (using the auto-hinter).
+ *
+ */
- /**************************************************************************
- *
- * @struct:
- * FT_Prop_IncreaseXHeight
- *
- * @description:
- * The data exchange structure for the @increase-x-height property.
- *
- */
- typedef struct FT_Prop_IncreaseXHeight_
- {
- FT_Face face;
- FT_UInt limit;
+/**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_IncreaseXHeight
+ *
+ * @description:
+ * The data exchange structure for the @increase-x-height property.
+ *
+ */
+typedef struct FT_Prop_IncreaseXHeight_ {
+ FT_Face face;
+ FT_UInt limit;
- } FT_Prop_IncreaseXHeight;
+} FT_Prop_IncreaseXHeight;
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbbox.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbbox.h
index 9766919..389aa1c 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbbox.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbbox.h
@@ -16,15 +16,15 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This component has a _single_ role: to compute exact outline bounding */
- /* boxes. */
- /* */
- /* It is separated from the rest of the engine for various technical */
- /* reasons. It may well be integrated in `ftoutln' later. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This component has a _single_ role: to compute exact outline bounding */
+/* boxes. */
+/* */
+/* It is separated from the rest of the engine for various technical */
+/* reasons. It may well be integrated in `ftoutln' later. */
+/* */
+/*************************************************************************/
#ifndef __FTBBOX_H__
@@ -44,49 +44,49 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_BBox */
- /* */
- /* <Description> */
- /* Compute the exact bounding box of an outline. This is slower */
- /* than computing the control box. However, it uses an advanced */
- /* algorithm which returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bézier arcs are traversed to */
- /* extract their extrema. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline. */
- /* */
- /* <Output> */
- /* abbox :: The outline's exact bounding box. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If the font is tricky and the glyph has been loaded with */
- /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
- /* reasonable values for the BBox it is necessary to load the glyph */
- /* at a large ppem value (so that the hinting instructions can */
- /* properly shift and scale the subglyphs), then extracting the BBox */
- /* which can be eventually converted back to font units. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Get_BBox( FT_Outline* outline,
- FT_BBox *abbox );
-
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* outline_processing */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Get_BBox */
+/* */
+/* <Description> */
+/* Compute the exact bounding box of an outline. This is slower */
+/* than computing the control box. However, it uses an advanced */
+/* algorithm which returns _very_ quickly when the two boxes */
+/* coincide. Otherwise, the outline Bézier arcs are traversed to */
+/* extract their extrema. */
+/* */
+/* <Input> */
+/* outline :: A pointer to the source outline. */
+/* */
+/* <Output> */
+/* abbox :: The outline's exact bounding box. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* If the font is tricky and the glyph has been loaded with */
+/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
+/* reasonable values for the BBox it is necessary to load the glyph */
+/* at a large ppem value (so that the hinting instructions can */
+/* properly shift and scale the subglyphs), then extracting the BBox */
+/* which can be eventually converted back to font units. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Get_BBox( FT_Outline* outline,
+ FT_BBox *abbox );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbdf.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbdf.h
index 4f8baf8..9199906 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbdf.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbdf.h
@@ -32,174 +32,172 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bdf_fonts */
- /* */
- /* <Title> */
- /* BDF and PCF Files */
- /* */
- /* <Abstract> */
- /* BDF and PCF specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions specific to BDF */
- /* and PCF fonts. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @enum:
- * FT_PropertyType
- *
- * @description:
- * A list of BDF property types.
- *
- * @values:
- * BDF_PROPERTY_TYPE_NONE ::
- * Value~0 is used to indicate a missing property.
- *
- * BDF_PROPERTY_TYPE_ATOM ::
- * Property is a string atom.
- *
- * BDF_PROPERTY_TYPE_INTEGER ::
- * Property is a 32-bit signed integer.
- *
- * BDF_PROPERTY_TYPE_CARDINAL ::
- * Property is a 32-bit unsigned integer.
- */
- typedef enum BDF_PropertyType_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* bdf_fonts */
+/* */
+/* <Title> */
+/* BDF and PCF Files */
+/* */
+/* <Abstract> */
+/* BDF and PCF specific API. */
+/* */
+/* <Description> */
+/* This section contains the declaration of functions specific to BDF */
+/* and PCF fonts. */
+/* */
+/*************************************************************************/
+
+
+/**********************************************************************
+ *
+ * @enum:
+ * FT_PropertyType
+ *
+ * @description:
+ * A list of BDF property types.
+ *
+ * @values:
+ * BDF_PROPERTY_TYPE_NONE ::
+ * Value~0 is used to indicate a missing property.
+ *
+ * BDF_PROPERTY_TYPE_ATOM ::
+ * Property is a string atom.
+ *
+ * BDF_PROPERTY_TYPE_INTEGER ::
+ * Property is a 32-bit signed integer.
+ *
+ * BDF_PROPERTY_TYPE_CARDINAL ::
+ * Property is a 32-bit unsigned integer.
+ */
+typedef enum BDF_PropertyType_ {
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3
- } BDF_PropertyType;
-
-
- /**********************************************************************
- *
- * @type:
- * BDF_Property
- *
- * @description:
- * A handle to a @BDF_PropertyRec structure to model a given
- * BDF/PCF property.
- */
- typedef struct BDF_PropertyRec_* BDF_Property;
-
-
- /**********************************************************************
- *
- * @struct:
- * BDF_PropertyRec
- *
- * @description:
- * This structure models a given BDF/PCF property.
- *
- * @fields:
- * type ::
- * The property type.
- *
- * u.atom ::
- * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
- *
- * u.integer ::
- * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
- *
- * u.cardinal ::
- * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
- */
- typedef struct BDF_PropertyRec_
- {
+} BDF_PropertyType;
+
+
+/**********************************************************************
+ *
+ * @type:
+ * BDF_Property
+ *
+ * @description:
+ * A handle to a @BDF_PropertyRec structure to model a given
+ * BDF/PCF property.
+ */
+typedef struct BDF_PropertyRec_* BDF_Property;
+
+
+/**********************************************************************
+ *
+ * @struct:
+ * BDF_PropertyRec
+ *
+ * @description:
+ * This structure models a given BDF/PCF property.
+ *
+ * @fields:
+ * type ::
+ * The property type.
+ *
+ * u.atom ::
+ * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
+ *
+ * u.integer ::
+ * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
+ *
+ * u.cardinal ::
+ * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
+ */
+typedef struct BDF_PropertyRec_ {
BDF_PropertyType type;
union {
- const char* atom;
- FT_Int32 integer;
- FT_UInt32 cardinal;
+ const char* atom;
+ FT_Int32 integer;
+ FT_UInt32 cardinal;
} u;
- } BDF_PropertyRec;
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_BDF_Charset_ID
- *
- * @description:
- * Retrieve a BDF font character set identity, according to
- * the BDF specification.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * acharset_encoding ::
- * Charset encoding, as a C~string, owned by the face.
- *
- * acharset_registry ::
- * Charset registry, as a C~string, owned by the face.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with BDF faces, returning an error otherwise.
- */
- FT_EXPORT( FT_Error )
- FT_Get_BDF_Charset_ID( FT_Face face,
- const char* *acharset_encoding,
- const char* *acharset_registry );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_BDF_Property
- *
- * @description:
- * Retrieve a BDF property from a BDF or PCF font file.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * name :: The property name.
- *
- * @output:
- * aproperty :: The property.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function works with BDF _and_ PCF fonts. It returns an error
- * otherwise. It also returns an error if the property is not in the
- * font.
- *
- * A `property' is a either key-value pair within the STARTPROPERTIES
- * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
- * `info->props' array within a `FontRec' structure of a PCF font.
- *
- * Integer properties are always stored as `signed' within PCF fonts;
- * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
- * for BDF fonts only.
- *
- * In case of error, `aproperty->type' is always set to
- * @BDF_PROPERTY_TYPE_NONE.
- */
- FT_EXPORT( FT_Error )
- FT_Get_BDF_Property( FT_Face face,
- const char* prop_name,
- BDF_PropertyRec *aproperty );
-
- /* */
+} BDF_PropertyRec;
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_BDF_Charset_ID
+ *
+ * @description:
+ * Retrieve a BDF font character set identity, according to
+ * the BDF specification.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * acharset_encoding ::
+ * Charset encoding, as a C~string, owned by the face.
+ *
+ * acharset_registry ::
+ * Charset registry, as a C~string, owned by the face.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with BDF faces, returning an error otherwise.
+ */
+FT_EXPORT( FT_Error )
+FT_Get_BDF_Charset_ID( FT_Face face,
+ const char**acharset_encoding,
+ const char**acharset_registry );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_BDF_Property
+ *
+ * @description:
+ * Retrieve a BDF property from a BDF or PCF font file.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * name :: The property name.
+ *
+ * @output:
+ * aproperty :: The property.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function works with BDF _and_ PCF fonts. It returns an error
+ * otherwise. It also returns an error if the property is not in the
+ * font.
+ *
+ * A `property' is a either key-value pair within the STARTPROPERTIES
+ * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
+ * `info->props' array within a `FontRec' structure of a PCF font.
+ *
+ * Integer properties are always stored as `signed' within PCF fonts;
+ * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
+ * for BDF fonts only.
+ *
+ * In case of error, `aproperty->type' is always set to
+ * @BDF_PROPERTY_TYPE_NONE.
+ */
+FT_EXPORT( FT_Error )
+FT_Get_BDF_Property( FT_Face face,
+ const char* prop_name,
+ BDF_PropertyRec *aproperty );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbitmap.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbitmap.h
index 9274236..9e324fe 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbitmap.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbitmap.h
@@ -33,190 +33,190 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bitmap_handling */
- /* */
- /* <Title> */
- /* Bitmap Handling */
- /* */
- /* <Abstract> */
- /* Handling FT_Bitmap objects. */
- /* */
- /* <Description> */
- /* This section contains functions for converting FT_Bitmap objects. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_New */
- /* */
- /* <Description> */
- /* Initialize a pointer to an @FT_Bitmap structure. */
- /* */
- /* <InOut> */
- /* abitmap :: A pointer to the bitmap structure. */
- /* */
- FT_EXPORT( void )
- FT_Bitmap_New( FT_Bitmap *abitmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Copy */
- /* */
- /* <Description> */
- /* Copy a bitmap into another one. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* source :: A handle to the source bitmap. */
- /* */
- /* <Output> */
- /* target :: A handle to the target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Copy( FT_Library library,
- const FT_Bitmap *source,
- FT_Bitmap *target);
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Embolden */
- /* */
- /* <Description> */
- /* Embolden a bitmap. The new bitmap will be about `xStrength' */
- /* pixels wider and `yStrength' pixels higher. The left and bottom */
- /* borders are kept unchanged. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* xStrength :: How strong the glyph is emboldened horizontally. */
- /* Expressed in 26.6 pixel format. */
- /* */
- /* yStrength :: How strong the glyph is emboldened vertically. */
- /* Expressed in 26.6 pixel format. */
- /* */
- /* <InOut> */
- /* bitmap :: A handle to the target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The current implementation restricts `xStrength' to be less than */
- /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
- /* */
- /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
- /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Embolden( FT_Library library,
- FT_Bitmap* bitmap,
- FT_Pos xStrength,
- FT_Pos yStrength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Convert */
- /* */
- /* <Description> */
- /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
- /* bitmap object with depth 8bpp, making the number of used bytes per */
- /* line (a.k.a. the `pitch') a multiple of `alignment'. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* source :: The source bitmap. */
- /* */
- /* alignment :: The pitch of the bitmap is a multiple of this */
- /* parameter. Common values are 1, 2, or 4. */
- /* */
- /* <Output> */
- /* target :: The target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* It is possible to call @FT_Bitmap_Convert multiple times without */
- /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
- /* */
- /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
- /* */
- /* The `library' argument is taken to have access to FreeType's */
- /* memory handling functions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Convert( FT_Library library,
- const FT_Bitmap *source,
- FT_Bitmap *target,
- FT_Int alignment );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GlyphSlot_Own_Bitmap */
- /* */
- /* <Description> */
- /* Make sure that a glyph slot owns `slot->bitmap'. */
- /* */
- /* <Input> */
- /* slot :: The glyph slot. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function is to be used in combination with */
- /* @FT_Bitmap_Embolden. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Done */
- /* */
- /* <Description> */
- /* Destroy a bitmap object created with @FT_Bitmap_New. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* bitmap :: The bitmap object to be freed. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `library' argument is taken to have access to FreeType's */
- /* memory handling functions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Done( FT_Library library,
- FT_Bitmap *bitmap );
-
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* bitmap_handling */
+/* */
+/* <Title> */
+/* Bitmap Handling */
+/* */
+/* <Abstract> */
+/* Handling FT_Bitmap objects. */
+/* */
+/* <Description> */
+/* This section contains functions for converting FT_Bitmap objects. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Bitmap_New */
+/* */
+/* <Description> */
+/* Initialize a pointer to an @FT_Bitmap structure. */
+/* */
+/* <InOut> */
+/* abitmap :: A pointer to the bitmap structure. */
+/* */
+FT_EXPORT( void )
+FT_Bitmap_New( FT_Bitmap *abitmap );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Bitmap_Copy */
+/* */
+/* <Description> */
+/* Copy a bitmap into another one. */
+/* */
+/* <Input> */
+/* library :: A handle to a library object. */
+/* */
+/* source :: A handle to the source bitmap. */
+/* */
+/* <Output> */
+/* target :: A handle to the target bitmap. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Bitmap_Copy( FT_Library library,
+ const FT_Bitmap *source,
+ FT_Bitmap *target);
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Bitmap_Embolden */
+/* */
+/* <Description> */
+/* Embolden a bitmap. The new bitmap will be about `xStrength' */
+/* pixels wider and `yStrength' pixels higher. The left and bottom */
+/* borders are kept unchanged. */
+/* */
+/* <Input> */
+/* library :: A handle to a library object. */
+/* */
+/* xStrength :: How strong the glyph is emboldened horizontally. */
+/* Expressed in 26.6 pixel format. */
+/* */
+/* yStrength :: How strong the glyph is emboldened vertically. */
+/* Expressed in 26.6 pixel format. */
+/* */
+/* <InOut> */
+/* bitmap :: A handle to the target bitmap. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The current implementation restricts `xStrength' to be less than */
+/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
+/* */
+/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
+/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Bitmap_Embolden( FT_Library library,
+ FT_Bitmap* bitmap,
+ FT_Pos xStrength,
+ FT_Pos yStrength );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Bitmap_Convert */
+/* */
+/* <Description> */
+/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
+/* bitmap object with depth 8bpp, making the number of used bytes per */
+/* line (a.k.a. the `pitch') a multiple of `alignment'. */
+/* */
+/* <Input> */
+/* library :: A handle to a library object. */
+/* */
+/* source :: The source bitmap. */
+/* */
+/* alignment :: The pitch of the bitmap is a multiple of this */
+/* parameter. Common values are 1, 2, or 4. */
+/* */
+/* <Output> */
+/* target :: The target bitmap. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* It is possible to call @FT_Bitmap_Convert multiple times without */
+/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
+/* */
+/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
+/* */
+/* The `library' argument is taken to have access to FreeType's */
+/* memory handling functions. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Bitmap_Convert( FT_Library library,
+ const FT_Bitmap *source,
+ FT_Bitmap *target,
+ FT_Int alignment );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_GlyphSlot_Own_Bitmap */
+/* */
+/* <Description> */
+/* Make sure that a glyph slot owns `slot->bitmap'. */
+/* */
+/* <Input> */
+/* slot :: The glyph slot. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function is to be used in combination with */
+/* @FT_Bitmap_Embolden. */
+/* */
+FT_EXPORT( FT_Error )
+FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Bitmap_Done */
+/* */
+/* <Description> */
+/* Destroy a bitmap object created with @FT_Bitmap_New. */
+/* */
+/* <Input> */
+/* library :: A handle to a library object. */
+/* */
+/* bitmap :: The bitmap object to be freed. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The `library' argument is taken to have access to FreeType's */
+/* memory handling functions. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Bitmap_Done( FT_Library library,
+ FT_Bitmap *bitmap );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbzip2.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbzip2.h
index 1bf81b1..f63e9a9 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftbzip2.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftbzip2.h
@@ -31,67 +31,67 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bzip2 */
- /* */
- /* <Title> */
- /* BZIP2 Streams */
- /* */
- /* <Abstract> */
- /* Using bzip2-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Bzip2-specific functions. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* bzip2 */
+/* */
+/* <Title> */
+/* BZIP2 Streams */
+/* */
+/* <Abstract> */
+/* Using bzip2-compressed font files. */
+/* */
+/* <Description> */
+/* This section contains the declaration of Bzip2-specific functions. */
+/* */
+/*************************************************************************/
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenBzip2
- *
- * @description:
- * Open a new stream to parse bzip2-compressed font files. This is
- * mainly used to support the compressed `*.pcf.bz2' fonts that come
- * with XFree86.
- *
- * @input:
- * stream ::
- * The target embedding stream.
- *
- * source ::
- * The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream.
- *
- * In certain builds of the library, bzip2 compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a bzip2 compressed stream
- * from it and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with bzip2 support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenBzip2( FT_Stream stream,
- FT_Stream source );
+/************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenBzip2
+ *
+ * @description:
+ * Open a new stream to parse bzip2-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.bz2' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream ::
+ * The target embedding stream.
+ *
+ * source ::
+ * The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream.
+ *
+ * In certain builds of the library, bzip2 compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a bzip2 compressed stream
+ * from it and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with bzip2 support.
+ */
+FT_EXPORT( FT_Error )
+FT_Stream_OpenBzip2( FT_Stream stream,
+ FT_Stream source );
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcache.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcache.h
index 6af5306..7db591c 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcache.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcache.h
@@ -27,196 +27,196 @@
FT_BEGIN_HEADER
- /*************************************************************************
- *
- * <Section>
- * cache_subsystem
- *
- * <Title>
- * Cache Sub-System
- *
- * <Abstract>
- * How to cache face, size, and glyph data with FreeType~2.
- *
- * <Description>
- * This section describes the FreeType~2 cache sub-system, which is used
- * to limit the number of concurrently opened @FT_Face and @FT_Size
- * objects, as well as caching information like character maps and glyph
- * images while limiting their maximum memory usage.
- *
- * Note that all types and functions begin with the `FTC_' prefix.
- *
- * The cache is highly portable and thus doesn't know anything about the
- * fonts installed on your system, or how to access them. This implies
- * the following scheme:
- *
- * First, available or installed font faces are uniquely identified by
- * @FTC_FaceID values, provided to the cache by the client. Note that
- * the cache only stores and compares these values, and doesn't try to
- * interpret them in any way.
- *
- * Second, the cache calls, only when needed, a client-provided function
- * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
- * then completely managed by the cache, including its termination
- * through @FT_Done_Face. To monitor termination of face objects, the
- * finalizer callback in the `generic' field of the @FT_Face object can
- * be used, which might also be used to store the @FTC_FaceID of the
- * face.
- *
- * Clients are free to map face IDs to anything else. The most simple
- * usage is to associate them to a (pathname,face_index) pair that is
- * used to call @FT_New_Face. However, more complex schemes are also
- * possible.
- *
- * Note that for the cache to work correctly, the face ID values must be
- * *persistent*, which means that the contents they point to should not
- * change at runtime, or that their value should not become invalid.
- *
- * If this is unavoidable (e.g., when a font is uninstalled at runtime),
- * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
- * the cache get rid of any references to the old @FTC_FaceID it may
- * keep internally. Failure to do so will lead to incorrect behaviour
- * or even crashes.
- *
- * To use the cache, start with calling @FTC_Manager_New to create a new
- * @FTC_Manager object, which models a single cache instance. You can
- * then look up @FT_Face and @FT_Size objects with
- * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
- *
- * If you want to use the charmap caching, call @FTC_CMapCache_New, then
- * later use @FTC_CMapCache_Lookup to perform the equivalent of
- * @FT_Get_Char_Index, only much faster.
- *
- * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
- * later use @FTC_ImageCache_Lookup to retrieve the corresponding
- * @FT_Glyph objects from the cache.
- *
- * If you need lots of small bitmaps, it is much more memory efficient
- * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
- * returns @FTC_SBitRec structures, which are used to store small
- * bitmaps directly. (A small bitmap is one whose metrics and
- * dimensions all fit into 8-bit integers).
- *
- * We hope to also provide a kerning cache in the near future.
- *
- *
- * <Order>
- * FTC_Manager
- * FTC_FaceID
- * FTC_Face_Requester
- *
- * FTC_Manager_New
- * FTC_Manager_Reset
- * FTC_Manager_Done
- * FTC_Manager_LookupFace
- * FTC_Manager_LookupSize
- * FTC_Manager_RemoveFaceID
- *
- * FTC_Node
- * FTC_Node_Unref
- *
- * FTC_ImageCache
- * FTC_ImageCache_New
- * FTC_ImageCache_Lookup
- *
- * FTC_SBit
- * FTC_SBitCache
- * FTC_SBitCache_New
- * FTC_SBitCache_Lookup
- *
- * FTC_CMapCache
- * FTC_CMapCache_New
- * FTC_CMapCache_Lookup
- *
- *************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** BASIC TYPE DEFINITIONS *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type: FTC_FaceID
- *
- * @description:
- * An opaque pointer type that is used to identity face objects. The
- * contents of such objects is application-dependent.
- *
- * These pointers are typically used to point to a user-defined
- * structure containing a font file path, and face index.
- *
- * @note:
- * Never use NULL as a valid @FTC_FaceID.
- *
- * Face IDs are passed by the client to the cache manager, which calls,
- * when needed, the @FTC_Face_Requester to translate them into new
- * @FT_Face objects.
- *
- * If the content of a given face ID changes at runtime, or if the value
- * becomes invalid (e.g., when uninstalling a font), you should
- * immediately call @FTC_Manager_RemoveFaceID before any other cache
- * function.
- *
- * Failure to do so will result in incorrect behaviour or even
- * memory leaks and crashes.
- */
- typedef FT_Pointer FTC_FaceID;
-
-
- /************************************************************************
- *
- * @functype:
- * FTC_Face_Requester
- *
- * @description:
- * A callback function provided by client applications. It is used by
- * the cache manager to translate a given @FTC_FaceID into a new valid
- * @FT_Face object, on demand.
- *
- * <Input>
- * face_id ::
- * The face ID to resolve.
- *
- * library ::
- * A handle to a FreeType library object.
- *
- * req_data ::
- * Application-provided request data (see note below).
- *
- * <Output>
- * aface ::
- * A new @FT_Face handle.
- *
- * <Return>
- * FreeType error code. 0~means success.
- *
- * <Note>
- * The third parameter `req_data' is the same as the one passed by the
- * client when @FTC_Manager_New is called.
- *
- * The face requester should not perform funny things on the returned
- * face object, like creating a new @FT_Size for it, or setting a
- * transformation through @FT_Set_Transform!
- */
- typedef FT_Error
- (*FTC_Face_Requester)( FTC_FaceID face_id,
- FT_Library library,
- FT_Pointer request_data,
- FT_Face* aface );
-
- /* */
+/*************************************************************************
+ *
+ * <Section>
+ * cache_subsystem
+ *
+ * <Title>
+ * Cache Sub-System
+ *
+ * <Abstract>
+ * How to cache face, size, and glyph data with FreeType~2.
+ *
+ * <Description>
+ * This section describes the FreeType~2 cache sub-system, which is used
+ * to limit the number of concurrently opened @FT_Face and @FT_Size
+ * objects, as well as caching information like character maps and glyph
+ * images while limiting their maximum memory usage.
+ *
+ * Note that all types and functions begin with the `FTC_' prefix.
+ *
+ * The cache is highly portable and thus doesn't know anything about the
+ * fonts installed on your system, or how to access them. This implies
+ * the following scheme:
+ *
+ * First, available or installed font faces are uniquely identified by
+ * @FTC_FaceID values, provided to the cache by the client. Note that
+ * the cache only stores and compares these values, and doesn't try to
+ * interpret them in any way.
+ *
+ * Second, the cache calls, only when needed, a client-provided function
+ * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
+ * then completely managed by the cache, including its termination
+ * through @FT_Done_Face. To monitor termination of face objects, the
+ * finalizer callback in the `generic' field of the @FT_Face object can
+ * be used, which might also be used to store the @FTC_FaceID of the
+ * face.
+ *
+ * Clients are free to map face IDs to anything else. The most simple
+ * usage is to associate them to a (pathname,face_index) pair that is
+ * used to call @FT_New_Face. However, more complex schemes are also
+ * possible.
+ *
+ * Note that for the cache to work correctly, the face ID values must be
+ * *persistent*, which means that the contents they point to should not
+ * change at runtime, or that their value should not become invalid.
+ *
+ * If this is unavoidable (e.g., when a font is uninstalled at runtime),
+ * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
+ * the cache get rid of any references to the old @FTC_FaceID it may
+ * keep internally. Failure to do so will lead to incorrect behaviour
+ * or even crashes.
+ *
+ * To use the cache, start with calling @FTC_Manager_New to create a new
+ * @FTC_Manager object, which models a single cache instance. You can
+ * then look up @FT_Face and @FT_Size objects with
+ * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
+ *
+ * If you want to use the charmap caching, call @FTC_CMapCache_New, then
+ * later use @FTC_CMapCache_Lookup to perform the equivalent of
+ * @FT_Get_Char_Index, only much faster.
+ *
+ * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
+ * later use @FTC_ImageCache_Lookup to retrieve the corresponding
+ * @FT_Glyph objects from the cache.
+ *
+ * If you need lots of small bitmaps, it is much more memory efficient
+ * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
+ * returns @FTC_SBitRec structures, which are used to store small
+ * bitmaps directly. (A small bitmap is one whose metrics and
+ * dimensions all fit into 8-bit integers).
+ *
+ * We hope to also provide a kerning cache in the near future.
+ *
+ *
+ * <Order>
+ * FTC_Manager
+ * FTC_FaceID
+ * FTC_Face_Requester
+ *
+ * FTC_Manager_New
+ * FTC_Manager_Reset
+ * FTC_Manager_Done
+ * FTC_Manager_LookupFace
+ * FTC_Manager_LookupSize
+ * FTC_Manager_RemoveFaceID
+ *
+ * FTC_Node
+ * FTC_Node_Unref
+ *
+ * FTC_ImageCache
+ * FTC_ImageCache_New
+ * FTC_ImageCache_Lookup
+ *
+ * FTC_SBit
+ * FTC_SBitCache
+ * FTC_SBitCache_New
+ * FTC_SBitCache_Lookup
+ *
+ * FTC_CMapCache
+ * FTC_CMapCache_New
+ * FTC_CMapCache_Lookup
+ *
+ *************************************************************************/
+
+
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/***** *****/
+/***** BASIC TYPE DEFINITIONS *****/
+/***** *****/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @type: FTC_FaceID
+ *
+ * @description:
+ * An opaque pointer type that is used to identity face objects. The
+ * contents of such objects is application-dependent.
+ *
+ * These pointers are typically used to point to a user-defined
+ * structure containing a font file path, and face index.
+ *
+ * @note:
+ * Never use NULL as a valid @FTC_FaceID.
+ *
+ * Face IDs are passed by the client to the cache manager, which calls,
+ * when needed, the @FTC_Face_Requester to translate them into new
+ * @FT_Face objects.
+ *
+ * If the content of a given face ID changes at runtime, or if the value
+ * becomes invalid (e.g., when uninstalling a font), you should
+ * immediately call @FTC_Manager_RemoveFaceID before any other cache
+ * function.
+ *
+ * Failure to do so will result in incorrect behaviour or even
+ * memory leaks and crashes.
+ */
+typedef FT_Pointer FTC_FaceID;
+
+
+/************************************************************************
+ *
+ * @functype:
+ * FTC_Face_Requester
+ *
+ * @description:
+ * A callback function provided by client applications. It is used by
+ * the cache manager to translate a given @FTC_FaceID into a new valid
+ * @FT_Face object, on demand.
+ *
+ * <Input>
+ * face_id ::
+ * The face ID to resolve.
+ *
+ * library ::
+ * A handle to a FreeType library object.
+ *
+ * req_data ::
+ * Application-provided request data (see note below).
+ *
+ * <Output>
+ * aface ::
+ * A new @FT_Face handle.
+ *
+ * <Return>
+ * FreeType error code. 0~means success.
+ *
+ * <Note>
+ * The third parameter `req_data' is the same as the one passed by the
+ * client when @FTC_Manager_New is called.
+ *
+ * The face requester should not perform funny things on the returned
+ * face object, like creating a new @FT_Size for it, or setting a
+ * transformation through @FT_Set_Transform!
+ */
+typedef FT_Error
+(*FTC_Face_Requester)( FTC_FaceID face_id,
+ FT_Library library,
+ FT_Pointer request_data,
+ FT_Face* aface );
+
+/* */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* these macros are incompatible with LLP64, should not be used */
+/* these macros are incompatible with LLP64, should not be used */
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
@@ -226,215 +226,214 @@ FT_BEGIN_HEADER
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** CACHE MANAGER OBJECT *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_Manager */
- /* */
- /* <Description> */
- /* This object corresponds to one instance of the cache-subsystem. */
- /* It is used to cache one or more @FT_Face objects, along with */
- /* corresponding @FT_Size objects. */
- /* */
- /* The manager intentionally limits the total number of opened */
- /* @FT_Face and @FT_Size objects to control memory usage. See the */
- /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
- /* */
- /* The manager is also used to cache `nodes' of various types while */
- /* limiting their total memory usage. */
- /* */
- /* All limitations are enforced by keeping lists of managed objects */
- /* in most-recently-used order, and flushing old nodes to make room */
- /* for new ones. */
- /* */
- typedef struct FTC_ManagerRec_* FTC_Manager;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_Node */
- /* */
- /* <Description> */
- /* An opaque handle to a cache node object. Each cache node is */
- /* reference-counted. A node with a count of~0 might be flushed */
- /* out of a full cache whenever a lookup request is performed. */
- /* */
- /* If you look up nodes, you have the ability to `acquire' them, */
- /* i.e., to increment their reference count. This will prevent the */
- /* node from being flushed out of the cache until you explicitly */
- /* `release' it (see @FTC_Node_Unref). */
- /* */
- /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
- /* */
- typedef struct FTC_NodeRec_* FTC_Node;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_New */
- /* */
- /* <Description> */
- /* Create a new cache manager. */
- /* */
- /* <Input> */
- /* library :: The parent FreeType library handle to use. */
- /* */
- /* max_faces :: Maximum number of opened @FT_Face objects managed by */
- /* this cache instance. Use~0 for defaults. */
- /* */
- /* max_sizes :: Maximum number of opened @FT_Size objects managed by */
- /* this cache instance. Use~0 for defaults. */
- /* */
- /* max_bytes :: Maximum number of bytes to use for cached data nodes. */
- /* Use~0 for defaults. Note that this value does not */
- /* account for managed @FT_Face and @FT_Size objects. */
- /* */
- /* requester :: An application-provided callback used to translate */
- /* face IDs into real @FT_Face objects. */
- /* */
- /* req_data :: A generic pointer that is passed to the requester */
- /* each time it is called (see @FTC_Face_Requester). */
- /* */
- /* <Output> */
- /* amanager :: A handle to a new manager object. 0~in case of */
- /* failure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_New( FT_Library library,
- FT_UInt max_faces,
- FT_UInt max_sizes,
- FT_ULong max_bytes,
- FTC_Face_Requester requester,
- FT_Pointer req_data,
- FTC_Manager *amanager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_Reset */
- /* */
- /* <Description> */
- /* Empty a given cache manager. This simply gets rid of all the */
- /* currently cached @FT_Face and @FT_Size objects within the manager. */
- /* */
- /* <InOut> */
- /* manager :: A handle to the manager. */
- /* */
- FT_EXPORT( void )
- FTC_Manager_Reset( FTC_Manager manager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_Done */
- /* */
- /* <Description> */
- /* Destroy a given manager after emptying it. */
- /* */
- /* <Input> */
- /* manager :: A handle to the target cache manager object. */
- /* */
- FT_EXPORT( void )
- FTC_Manager_Done( FTC_Manager manager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_LookupFace */
- /* */
- /* <Description> */
- /* Retrieve the @FT_Face object that corresponds to a given face ID */
- /* through a cache manager. */
- /* */
- /* <Input> */
- /* manager :: A handle to the cache manager. */
- /* */
- /* face_id :: The ID of the face object. */
- /* */
- /* <Output> */
- /* aface :: A handle to the face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned @FT_Face object is always owned by the manager. You */
- /* should never try to discard it yourself. */
- /* */
- /* The @FT_Face object doesn't necessarily have a current size object */
- /* (i.e., face->size can be 0). If you need a specific `font size', */
- /* use @FTC_Manager_LookupSize instead. */
- /* */
- /* Never change the face's transformation matrix (i.e., never call */
- /* the @FT_Set_Transform function) on a returned face! If you need */
- /* to transform glyphs, do it yourself after glyph loading. */
- /* */
- /* When you perform a lookup, out-of-memory errors are detected */
- /* _within_ the lookup and force incremental flushes of the cache */
- /* until enough memory is released for the lookup to succeed. */
- /* */
- /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
- /* already been completely flushed, and still no memory was available */
- /* for the operation. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_LookupFace( FTC_Manager manager,
- FTC_FaceID face_id,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_ScalerRec */
- /* */
- /* <Description> */
- /* A structure used to describe a given character size in either */
- /* pixels or points to the cache manager. See */
- /* @FTC_Manager_LookupSize. */
- /* */
- /* <Fields> */
- /* face_id :: The source face ID. */
- /* */
- /* width :: The character width. */
- /* */
- /* height :: The character height. */
- /* */
- /* pixel :: A Boolean. If 1, the `width' and `height' fields are */
- /* interpreted as integer pixel character sizes. */
- /* Otherwise, they are expressed as 1/64th of points. */
- /* */
- /* x_res :: Only used when `pixel' is value~0 to indicate the */
- /* horizontal resolution in dpi. */
- /* */
- /* y_res :: Only used when `pixel' is value~0 to indicate the */
- /* vertical resolution in dpi. */
- /* */
- /* <Note> */
- /* This type is mainly used to retrieve @FT_Size objects through the */
- /* cache manager. */
- /* */
- typedef struct FTC_ScalerRec_
- {
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/***** *****/
+/***** CACHE MANAGER OBJECT *****/
+/***** *****/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FTC_Manager */
+/* */
+/* <Description> */
+/* This object corresponds to one instance of the cache-subsystem. */
+/* It is used to cache one or more @FT_Face objects, along with */
+/* corresponding @FT_Size objects. */
+/* */
+/* The manager intentionally limits the total number of opened */
+/* @FT_Face and @FT_Size objects to control memory usage. See the */
+/* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
+/* */
+/* The manager is also used to cache `nodes' of various types while */
+/* limiting their total memory usage. */
+/* */
+/* All limitations are enforced by keeping lists of managed objects */
+/* in most-recently-used order, and flushing old nodes to make room */
+/* for new ones. */
+/* */
+typedef struct FTC_ManagerRec_* FTC_Manager;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FTC_Node */
+/* */
+/* <Description> */
+/* An opaque handle to a cache node object. Each cache node is */
+/* reference-counted. A node with a count of~0 might be flushed */
+/* out of a full cache whenever a lookup request is performed. */
+/* */
+/* If you look up nodes, you have the ability to `acquire' them, */
+/* i.e., to increment their reference count. This will prevent the */
+/* node from being flushed out of the cache until you explicitly */
+/* `release' it (see @FTC_Node_Unref). */
+/* */
+/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
+/* */
+typedef struct FTC_NodeRec_* FTC_Node;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Manager_New */
+/* */
+/* <Description> */
+/* Create a new cache manager. */
+/* */
+/* <Input> */
+/* library :: The parent FreeType library handle to use. */
+/* */
+/* max_faces :: Maximum number of opened @FT_Face objects managed by */
+/* this cache instance. Use~0 for defaults. */
+/* */
+/* max_sizes :: Maximum number of opened @FT_Size objects managed by */
+/* this cache instance. Use~0 for defaults. */
+/* */
+/* max_bytes :: Maximum number of bytes to use for cached data nodes. */
+/* Use~0 for defaults. Note that this value does not */
+/* account for managed @FT_Face and @FT_Size objects. */
+/* */
+/* requester :: An application-provided callback used to translate */
+/* face IDs into real @FT_Face objects. */
+/* */
+/* req_data :: A generic pointer that is passed to the requester */
+/* each time it is called (see @FTC_Face_Requester). */
+/* */
+/* <Output> */
+/* amanager :: A handle to a new manager object. 0~in case of */
+/* failure. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_Manager_New( FT_Library library,
+ FT_UInt max_faces,
+ FT_UInt max_sizes,
+ FT_ULong max_bytes,
+ FTC_Face_Requester requester,
+ FT_Pointer req_data,
+ FTC_Manager *amanager );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Manager_Reset */
+/* */
+/* <Description> */
+/* Empty a given cache manager. This simply gets rid of all the */
+/* currently cached @FT_Face and @FT_Size objects within the manager. */
+/* */
+/* <InOut> */
+/* manager :: A handle to the manager. */
+/* */
+FT_EXPORT( void )
+FTC_Manager_Reset( FTC_Manager manager );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Manager_Done */
+/* */
+/* <Description> */
+/* Destroy a given manager after emptying it. */
+/* */
+/* <Input> */
+/* manager :: A handle to the target cache manager object. */
+/* */
+FT_EXPORT( void )
+FTC_Manager_Done( FTC_Manager manager );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Manager_LookupFace */
+/* */
+/* <Description> */
+/* Retrieve the @FT_Face object that corresponds to a given face ID */
+/* through a cache manager. */
+/* */
+/* <Input> */
+/* manager :: A handle to the cache manager. */
+/* */
+/* face_id :: The ID of the face object. */
+/* */
+/* <Output> */
+/* aface :: A handle to the face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The returned @FT_Face object is always owned by the manager. You */
+/* should never try to discard it yourself. */
+/* */
+/* The @FT_Face object doesn't necessarily have a current size object */
+/* (i.e., face->size can be 0). If you need a specific `font size', */
+/* use @FTC_Manager_LookupSize instead. */
+/* */
+/* Never change the face's transformation matrix (i.e., never call */
+/* the @FT_Set_Transform function) on a returned face! If you need */
+/* to transform glyphs, do it yourself after glyph loading. */
+/* */
+/* When you perform a lookup, out-of-memory errors are detected */
+/* _within_ the lookup and force incremental flushes of the cache */
+/* until enough memory is released for the lookup to succeed. */
+/* */
+/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
+/* already been completely flushed, and still no memory was available */
+/* for the operation. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_Manager_LookupFace( FTC_Manager manager,
+ FTC_FaceID face_id,
+ FT_Face *aface );
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FTC_ScalerRec */
+/* */
+/* <Description> */
+/* A structure used to describe a given character size in either */
+/* pixels or points to the cache manager. See */
+/* @FTC_Manager_LookupSize. */
+/* */
+/* <Fields> */
+/* face_id :: The source face ID. */
+/* */
+/* width :: The character width. */
+/* */
+/* height :: The character height. */
+/* */
+/* pixel :: A Boolean. If 1, the `width' and `height' fields are */
+/* interpreted as integer pixel character sizes. */
+/* Otherwise, they are expressed as 1/64th of points. */
+/* */
+/* x_res :: Only used when `pixel' is value~0 to indicate the */
+/* horizontal resolution in dpi. */
+/* */
+/* y_res :: Only used when `pixel' is value~0 to indicate the */
+/* vertical resolution in dpi. */
+/* */
+/* <Note> */
+/* This type is mainly used to retrieve @FT_Size objects through the */
+/* cache manager. */
+/* */
+typedef struct FTC_ScalerRec_ {
FTC_FaceID face_id;
FT_UInt width;
FT_UInt height;
@@ -442,262 +441,261 @@ FT_BEGIN_HEADER
FT_UInt x_res;
FT_UInt y_res;
- } FTC_ScalerRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_Scaler */
- /* */
- /* <Description> */
- /* A handle to an @FTC_ScalerRec structure. */
- /* */
- typedef struct FTC_ScalerRec_* FTC_Scaler;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_LookupSize */
- /* */
- /* <Description> */
- /* Retrieve the @FT_Size object that corresponds to a given */
- /* @FTC_ScalerRec pointer through a cache manager. */
- /* */
- /* <Input> */
- /* manager :: A handle to the cache manager. */
- /* */
- /* scaler :: A scaler handle. */
- /* */
- /* <Output> */
- /* asize :: A handle to the size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned @FT_Size object is always owned by the manager. You */
- /* should never try to discard it by yourself. */
- /* */
- /* You can access the parent @FT_Face object simply as `size->face' */
- /* if you need it. Note that this object is also owned by the */
- /* manager. */
- /* */
- /* <Note> */
- /* When you perform a lookup, out-of-memory errors are detected */
- /* _within_ the lookup and force incremental flushes of the cache */
- /* until enough memory is released for the lookup to succeed. */
- /* */
- /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
- /* already been completely flushed, and still no memory is available */
- /* for the operation. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_LookupSize( FTC_Manager manager,
- FTC_Scaler scaler,
- FT_Size *asize );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Node_Unref */
- /* */
- /* <Description> */
- /* Decrement a cache node's internal reference count. When the count */
- /* reaches 0, it is not destroyed but becomes eligible for subsequent */
- /* cache flushes. */
- /* */
- /* <Input> */
- /* node :: The cache node handle. */
- /* */
- /* manager :: The cache manager handle. */
- /* */
- FT_EXPORT( void )
- FTC_Node_Unref( FTC_Node node,
- FTC_Manager manager );
-
-
- /*************************************************************************
- *
- * @function:
- * FTC_Manager_RemoveFaceID
- *
- * @description:
- * A special function used to indicate to the cache manager that
- * a given @FTC_FaceID is no longer valid, either because its
- * content changed, or because it was deallocated or uninstalled.
- *
- * @input:
- * manager ::
- * The cache manager handle.
- *
- * face_id ::
- * The @FTC_FaceID to be removed.
- *
- * @note:
- * This function flushes all nodes from the cache corresponding to this
- * `face_id', with the exception of nodes with a non-null reference
- * count.
- *
- * Such nodes are however modified internally so as to never appear
- * in later lookups with the same `face_id' value, and to be immediately
- * destroyed when released by all their users.
- *
- */
- FT_EXPORT( void )
- FTC_Manager_RemoveFaceID( FTC_Manager manager,
- FTC_FaceID face_id );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
- /*************************************************************************
- *
- * @type:
- * FTC_CMapCache
- *
- * @description:
- * An opaque handle used to model a charmap cache. This cache is to
- * hold character codes -> glyph indices mappings.
- *
- */
- typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
-
-
- /*************************************************************************
- *
- * @function:
- * FTC_CMapCache_New
- *
- * @description:
- * Create a new charmap cache.
- *
- * @input:
- * manager ::
- * A handle to the cache manager.
- *
- * @output:
- * acache ::
- * A new cache handle. NULL in case of error.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * Like all other caches, this one will be destroyed with the cache
- * manager.
- *
- */
- FT_EXPORT( FT_Error )
- FTC_CMapCache_New( FTC_Manager manager,
- FTC_CMapCache *acache );
-
-
- /************************************************************************
- *
- * @function:
- * FTC_CMapCache_Lookup
- *
- * @description:
- * Translate a character code into a glyph index, using the charmap
- * cache.
- *
- * @input:
- * cache ::
- * A charmap cache handle.
- *
- * face_id ::
- * The source face ID.
- *
- * cmap_index ::
- * The index of the charmap in the source face. Any negative value
- * means to use the cache @FT_Face's default charmap.
- *
- * char_code ::
- * The character code (in the corresponding charmap).
- *
- * @return:
- * Glyph index. 0~means `no glyph'.
- *
- */
- FT_EXPORT( FT_UInt )
- FTC_CMapCache_Lookup( FTC_CMapCache cache,
- FTC_FaceID face_id,
- FT_Int cmap_index,
- FT_UInt32 char_code );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** IMAGE CACHE OBJECT *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @struct:
- * FTC_ImageTypeRec
- *
- * @description:
- * A structure used to model the type of images in a glyph cache.
- *
- * @fields:
- * face_id ::
- * The face ID.
- *
- * width ::
- * The width in pixels.
- *
- * height ::
- * The height in pixels.
- *
- * flags ::
- * The load flags, as in @FT_Load_Glyph.
- *
- */
- typedef struct FTC_ImageTypeRec_
- {
+} FTC_ScalerRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FTC_Scaler */
+/* */
+/* <Description> */
+/* A handle to an @FTC_ScalerRec structure. */
+/* */
+typedef struct FTC_ScalerRec_* FTC_Scaler;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Manager_LookupSize */
+/* */
+/* <Description> */
+/* Retrieve the @FT_Size object that corresponds to a given */
+/* @FTC_ScalerRec pointer through a cache manager. */
+/* */
+/* <Input> */
+/* manager :: A handle to the cache manager. */
+/* */
+/* scaler :: A scaler handle. */
+/* */
+/* <Output> */
+/* asize :: A handle to the size object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The returned @FT_Size object is always owned by the manager. You */
+/* should never try to discard it by yourself. */
+/* */
+/* You can access the parent @FT_Face object simply as `size->face' */
+/* if you need it. Note that this object is also owned by the */
+/* manager. */
+/* */
+/* <Note> */
+/* When you perform a lookup, out-of-memory errors are detected */
+/* _within_ the lookup and force incremental flushes of the cache */
+/* until enough memory is released for the lookup to succeed. */
+/* */
+/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
+/* already been completely flushed, and still no memory is available */
+/* for the operation. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_Manager_LookupSize( FTC_Manager manager,
+ FTC_Scaler scaler,
+ FT_Size *asize );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_Node_Unref */
+/* */
+/* <Description> */
+/* Decrement a cache node's internal reference count. When the count */
+/* reaches 0, it is not destroyed but becomes eligible for subsequent */
+/* cache flushes. */
+/* */
+/* <Input> */
+/* node :: The cache node handle. */
+/* */
+/* manager :: The cache manager handle. */
+/* */
+FT_EXPORT( void )
+FTC_Node_Unref( FTC_Node node,
+ FTC_Manager manager );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FTC_Manager_RemoveFaceID
+ *
+ * @description:
+ * A special function used to indicate to the cache manager that
+ * a given @FTC_FaceID is no longer valid, either because its
+ * content changed, or because it was deallocated or uninstalled.
+ *
+ * @input:
+ * manager ::
+ * The cache manager handle.
+ *
+ * face_id ::
+ * The @FTC_FaceID to be removed.
+ *
+ * @note:
+ * This function flushes all nodes from the cache corresponding to this
+ * `face_id', with the exception of nodes with a non-null reference
+ * count.
+ *
+ * Such nodes are however modified internally so as to never appear
+ * in later lookups with the same `face_id' value, and to be immediately
+ * destroyed when released by all their users.
+ *
+ */
+FT_EXPORT( void )
+FTC_Manager_RemoveFaceID( FTC_Manager manager,
+ FTC_FaceID face_id );
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* cache_subsystem */
+/* */
+/*************************************************************************/
+
+/*************************************************************************
+ *
+ * @type:
+ * FTC_CMapCache
+ *
+ * @description:
+ * An opaque handle used to model a charmap cache. This cache is to
+ * hold character codes -> glyph indices mappings.
+ *
+ */
+typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FTC_CMapCache_New
+ *
+ * @description:
+ * Create a new charmap cache.
+ *
+ * @input:
+ * manager ::
+ * A handle to the cache manager.
+ *
+ * @output:
+ * acache ::
+ * A new cache handle. NULL in case of error.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * Like all other caches, this one will be destroyed with the cache
+ * manager.
+ *
+ */
+FT_EXPORT( FT_Error )
+FTC_CMapCache_New( FTC_Manager manager,
+ FTC_CMapCache *acache );
+
+
+/************************************************************************
+ *
+ * @function:
+ * FTC_CMapCache_Lookup
+ *
+ * @description:
+ * Translate a character code into a glyph index, using the charmap
+ * cache.
+ *
+ * @input:
+ * cache ::
+ * A charmap cache handle.
+ *
+ * face_id ::
+ * The source face ID.
+ *
+ * cmap_index ::
+ * The index of the charmap in the source face. Any negative value
+ * means to use the cache @FT_Face's default charmap.
+ *
+ * char_code ::
+ * The character code (in the corresponding charmap).
+ *
+ * @return:
+ * Glyph index. 0~means `no glyph'.
+ *
+ */
+FT_EXPORT( FT_UInt )
+FTC_CMapCache_Lookup( FTC_CMapCache cache,
+ FTC_FaceID face_id,
+ FT_Int cmap_index,
+ FT_UInt32 char_code );
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* cache_subsystem */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/***** *****/
+/***** IMAGE CACHE OBJECT *****/
+/***** *****/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @struct:
+ * FTC_ImageTypeRec
+ *
+ * @description:
+ * A structure used to model the type of images in a glyph cache.
+ *
+ * @fields:
+ * face_id ::
+ * The face ID.
+ *
+ * width ::
+ * The width in pixels.
+ *
+ * height ::
+ * The height in pixels.
+ *
+ * flags ::
+ * The load flags, as in @FT_Load_Glyph.
+ *
+ */
+typedef struct FTC_ImageTypeRec_ {
FTC_FaceID face_id;
FT_Int width;
FT_Int height;
FT_Int32 flags;
- } FTC_ImageTypeRec;
+} FTC_ImageTypeRec;
- /*************************************************************************
- *
- * @type:
- * FTC_ImageType
- *
- * @description:
- * A handle to an @FTC_ImageTypeRec structure.
- *
- */
- typedef struct FTC_ImageTypeRec_* FTC_ImageType;
+/*************************************************************************
+ *
+ * @type:
+ * FTC_ImageType
+ *
+ * @description:
+ * A handle to an @FTC_ImageTypeRec structure.
+ *
+ */
+typedef struct FTC_ImageTypeRec_* FTC_ImageType;
- /* */
+/* */
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
@@ -707,7 +705,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* this macro is incompatible with LLP64, should not be used */
+/* this macro is incompatible with LLP64, should not be used */
#define FTC_IMAGE_TYPE_HASH( d ) \
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
@@ -717,197 +715,196 @@ FT_BEGIN_HEADER
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_ImageCache */
- /* */
- /* <Description> */
- /* A handle to an glyph image cache object. They are designed to */
- /* hold many distinct glyph images while not exceeding a certain */
- /* memory threshold. */
- /* */
- typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_New */
- /* */
- /* <Description> */
- /* Create a new glyph image cache. */
- /* */
- /* <Input> */
- /* manager :: The parent manager for the image cache. */
- /* */
- /* <Output> */
- /* acache :: A handle to the new glyph image cache object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_New( FTC_Manager manager,
- FTC_ImageCache *acache );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_Lookup */
- /* */
- /* <Description> */
- /* Retrieve a given glyph image from a glyph image cache. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source glyph image cache. */
- /* */
- /* type :: A pointer to a glyph image type descriptor. */
- /* */
- /* gindex :: The glyph index to retrieve. */
- /* */
- /* <Output> */
- /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
- /* failure. */
- /* */
- /* anode :: Used to return the address of of the corresponding cache */
- /* node after incrementing its reference count (see note */
- /* below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned glyph is owned and managed by the glyph image cache. */
- /* Never try to transform or discard it manually! You can however */
- /* create a copy with @FT_Glyph_Copy and modify the new one. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the glyph image, after increasing its reference */
- /* count. This ensures that the node (as well as the @FT_Glyph) will */
- /* always be kept in the cache until you call @FTC_Node_Unref to */
- /* `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the @FT_Glyph could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_Lookup( FTC_ImageCache cache,
- FTC_ImageType type,
- FT_UInt gindex,
- FT_Glyph *aglyph,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_LookupScaler */
- /* */
- /* <Description> */
- /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
- /* to specify the face ID and its size. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source glyph image cache. */
- /* */
- /* scaler :: A pointer to a scaler descriptor. */
- /* */
- /* load_flags :: The corresponding load flags. */
- /* */
- /* gindex :: The glyph index to retrieve. */
- /* */
- /* <Output> */
- /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
- /* failure. */
- /* */
- /* anode :: Used to return the address of of the corresponding */
- /* cache node after incrementing its reference count */
- /* (see note below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned glyph is owned and managed by the glyph image cache. */
- /* Never try to transform or discard it manually! You can however */
- /* create a copy with @FT_Glyph_Copy and modify the new one. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the glyph image, after increasing its reference */
- /* count. This ensures that the node (as well as the @FT_Glyph) will */
- /* always be kept in the cache until you call @FTC_Node_Unref to */
- /* `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the @FT_Glyph could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- /* Calls to @FT_Set_Char_Size and friends have no effect on cached */
- /* glyphs; you should always use the FreeType cache API instead. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
- FTC_Scaler scaler,
- FT_ULong load_flags,
- FT_UInt gindex,
- FT_Glyph *aglyph,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_SBit */
- /* */
- /* <Description> */
- /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
- /* structure for details. */
- /* */
- typedef struct FTC_SBitRec_* FTC_SBit;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_SBitRec */
- /* */
- /* <Description> */
- /* A very compact structure used to describe a small glyph bitmap. */
- /* */
- /* <Fields> */
- /* width :: The bitmap width in pixels. */
- /* */
- /* height :: The bitmap height in pixels. */
- /* */
- /* left :: The horizontal distance from the pen position to the */
- /* left bitmap border (a.k.a. `left side bearing', or */
- /* `lsb'). */
- /* */
- /* top :: The vertical distance from the pen position (on the */
- /* baseline) to the upper bitmap border (a.k.a. `top */
- /* side bearing'). The distance is positive for upwards */
- /* y~coordinates. */
- /* */
- /* format :: The format of the glyph bitmap (monochrome or gray). */
- /* */
- /* max_grays :: Maximum gray level value (in the range 1 to~255). */
- /* */
- /* pitch :: The number of bytes per bitmap line. May be positive */
- /* or negative. */
- /* */
- /* xadvance :: The horizontal advance width in pixels. */
- /* */
- /* yadvance :: The vertical advance height in pixels. */
- /* */
- /* buffer :: A pointer to the bitmap pixels. */
- /* */
- typedef struct FTC_SBitRec_
- {
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FTC_ImageCache */
+/* */
+/* <Description> */
+/* A handle to an glyph image cache object. They are designed to */
+/* hold many distinct glyph images while not exceeding a certain */
+/* memory threshold. */
+/* */
+typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_ImageCache_New */
+/* */
+/* <Description> */
+/* Create a new glyph image cache. */
+/* */
+/* <Input> */
+/* manager :: The parent manager for the image cache. */
+/* */
+/* <Output> */
+/* acache :: A handle to the new glyph image cache object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_ImageCache_New( FTC_Manager manager,
+ FTC_ImageCache *acache );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_ImageCache_Lookup */
+/* */
+/* <Description> */
+/* Retrieve a given glyph image from a glyph image cache. */
+/* */
+/* <Input> */
+/* cache :: A handle to the source glyph image cache. */
+/* */
+/* type :: A pointer to a glyph image type descriptor. */
+/* */
+/* gindex :: The glyph index to retrieve. */
+/* */
+/* <Output> */
+/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
+/* failure. */
+/* */
+/* anode :: Used to return the address of of the corresponding cache */
+/* node after incrementing its reference count (see note */
+/* below). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The returned glyph is owned and managed by the glyph image cache. */
+/* Never try to transform or discard it manually! You can however */
+/* create a copy with @FT_Glyph_Copy and modify the new one. */
+/* */
+/* If `anode' is _not_ NULL, it receives the address of the cache */
+/* node containing the glyph image, after increasing its reference */
+/* count. This ensures that the node (as well as the @FT_Glyph) will */
+/* always be kept in the cache until you call @FTC_Node_Unref to */
+/* `release' it. */
+/* */
+/* If `anode' is NULL, the cache node is left unchanged, which means */
+/* that the @FT_Glyph could be flushed out of the cache on the next */
+/* call to one of the caching sub-system APIs. Don't assume that it */
+/* is persistent! */
+/* */
+FT_EXPORT( FT_Error )
+FTC_ImageCache_Lookup( FTC_ImageCache cache,
+ FTC_ImageType type,
+ FT_UInt gindex,
+ FT_Glyph *aglyph,
+ FTC_Node *anode );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_ImageCache_LookupScaler */
+/* */
+/* <Description> */
+/* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
+/* to specify the face ID and its size. */
+/* */
+/* <Input> */
+/* cache :: A handle to the source glyph image cache. */
+/* */
+/* scaler :: A pointer to a scaler descriptor. */
+/* */
+/* load_flags :: The corresponding load flags. */
+/* */
+/* gindex :: The glyph index to retrieve. */
+/* */
+/* <Output> */
+/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
+/* failure. */
+/* */
+/* anode :: Used to return the address of of the corresponding */
+/* cache node after incrementing its reference count */
+/* (see note below). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The returned glyph is owned and managed by the glyph image cache. */
+/* Never try to transform or discard it manually! You can however */
+/* create a copy with @FT_Glyph_Copy and modify the new one. */
+/* */
+/* If `anode' is _not_ NULL, it receives the address of the cache */
+/* node containing the glyph image, after increasing its reference */
+/* count. This ensures that the node (as well as the @FT_Glyph) will */
+/* always be kept in the cache until you call @FTC_Node_Unref to */
+/* `release' it. */
+/* */
+/* If `anode' is NULL, the cache node is left unchanged, which means */
+/* that the @FT_Glyph could be flushed out of the cache on the next */
+/* call to one of the caching sub-system APIs. Don't assume that it */
+/* is persistent! */
+/* */
+/* Calls to @FT_Set_Char_Size and friends have no effect on cached */
+/* glyphs; you should always use the FreeType cache API instead. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
+ FTC_Scaler scaler,
+ FT_ULong load_flags,
+ FT_UInt gindex,
+ FT_Glyph *aglyph,
+ FTC_Node *anode );
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FTC_SBit */
+/* */
+/* <Description> */
+/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
+/* structure for details. */
+/* */
+typedef struct FTC_SBitRec_* FTC_SBit;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FTC_SBitRec */
+/* */
+/* <Description> */
+/* A very compact structure used to describe a small glyph bitmap. */
+/* */
+/* <Fields> */
+/* width :: The bitmap width in pixels. */
+/* */
+/* height :: The bitmap height in pixels. */
+/* */
+/* left :: The horizontal distance from the pen position to the */
+/* left bitmap border (a.k.a. `left side bearing', or */
+/* `lsb'). */
+/* */
+/* top :: The vertical distance from the pen position (on the */
+/* baseline) to the upper bitmap border (a.k.a. `top */
+/* side bearing'). The distance is positive for upwards */
+/* y~coordinates. */
+/* */
+/* format :: The format of the glyph bitmap (monochrome or gray). */
+/* */
+/* max_grays :: Maximum gray level value (in the range 1 to~255). */
+/* */
+/* pitch :: The number of bytes per bitmap line. May be positive */
+/* or negative. */
+/* */
+/* xadvance :: The horizontal advance width in pixels. */
+/* */
+/* yadvance :: The vertical advance height in pixels. */
+/* */
+/* buffer :: A pointer to the bitmap pixels. */
+/* */
+typedef struct FTC_SBitRec_ {
FT_Byte width;
FT_Byte height;
FT_Char left;
@@ -921,185 +918,184 @@ FT_BEGIN_HEADER
FT_Byte* buffer;
- } FTC_SBitRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_SBitCache */
- /* */
- /* <Description> */
- /* A handle to a small bitmap cache. These are special cache objects */
- /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
- /* much more efficient way than the traditional glyph image cache */
- /* implemented by @FTC_ImageCache. */
- /* */
- typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_New */
- /* */
- /* <Description> */
- /* Create a new cache to store small glyph bitmaps. */
- /* */
- /* <Input> */
- /* manager :: A handle to the source cache manager. */
- /* */
- /* <Output> */
- /* acache :: A handle to the new sbit cache. NULL in case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_New( FTC_Manager manager,
- FTC_SBitCache *acache );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_Lookup */
- /* */
- /* <Description> */
- /* Look up a given small glyph bitmap in a given sbit cache and */
- /* `lock' it to prevent its flushing from the cache until needed. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source sbit cache. */
- /* */
- /* type :: A pointer to the glyph image type descriptor. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* sbit :: A handle to a small bitmap descriptor. */
- /* */
- /* anode :: Used to return the address of of the corresponding cache */
- /* node after incrementing its reference count (see note */
- /* below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The small bitmap descriptor and its bit buffer are owned by the */
- /* cache and should never be freed by the application. They might */
- /* as well disappear from memory on the next cache lookup, so don't */
- /* treat them as persistent data. */
- /* */
- /* The descriptor's `buffer' field is set to~0 to indicate a missing */
- /* glyph bitmap. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the bitmap, after increasing its reference count. */
- /* This ensures that the node (as well as the image) will always be */
- /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the bitmap could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_Lookup( FTC_SBitCache cache,
- FTC_ImageType type,
- FT_UInt gindex,
- FTC_SBit *sbit,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_LookupScaler */
- /* */
- /* <Description> */
- /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
- /* to specify the face ID and its size. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source sbit cache. */
- /* */
- /* scaler :: A pointer to the scaler descriptor. */
- /* */
- /* load_flags :: The corresponding load flags. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* sbit :: A handle to a small bitmap descriptor. */
- /* */
- /* anode :: Used to return the address of of the corresponding */
- /* cache node after incrementing its reference count */
- /* (see note below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The small bitmap descriptor and its bit buffer are owned by the */
- /* cache and should never be freed by the application. They might */
- /* as well disappear from memory on the next cache lookup, so don't */
- /* treat them as persistent data. */
- /* */
- /* The descriptor's `buffer' field is set to~0 to indicate a missing */
- /* glyph bitmap. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the bitmap, after increasing its reference count. */
- /* This ensures that the node (as well as the image) will always be */
- /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the bitmap could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
- FTC_Scaler scaler,
- FT_ULong load_flags,
- FT_UInt gindex,
- FTC_SBit *sbit,
- FTC_Node *anode );
-
-
- /* */
+} FTC_SBitRec;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FTC_SBitCache */
+/* */
+/* <Description> */
+/* A handle to a small bitmap cache. These are special cache objects */
+/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
+/* much more efficient way than the traditional glyph image cache */
+/* implemented by @FTC_ImageCache. */
+/* */
+typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_SBitCache_New */
+/* */
+/* <Description> */
+/* Create a new cache to store small glyph bitmaps. */
+/* */
+/* <Input> */
+/* manager :: A handle to the source cache manager. */
+/* */
+/* <Output> */
+/* acache :: A handle to the new sbit cache. NULL in case of error. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FTC_SBitCache_New( FTC_Manager manager,
+ FTC_SBitCache *acache );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_SBitCache_Lookup */
+/* */
+/* <Description> */
+/* Look up a given small glyph bitmap in a given sbit cache and */
+/* `lock' it to prevent its flushing from the cache until needed. */
+/* */
+/* <Input> */
+/* cache :: A handle to the source sbit cache. */
+/* */
+/* type :: A pointer to the glyph image type descriptor. */
+/* */
+/* gindex :: The glyph index. */
+/* */
+/* <Output> */
+/* sbit :: A handle to a small bitmap descriptor. */
+/* */
+/* anode :: Used to return the address of of the corresponding cache */
+/* node after incrementing its reference count (see note */
+/* below). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The small bitmap descriptor and its bit buffer are owned by the */
+/* cache and should never be freed by the application. They might */
+/* as well disappear from memory on the next cache lookup, so don't */
+/* treat them as persistent data. */
+/* */
+/* The descriptor's `buffer' field is set to~0 to indicate a missing */
+/* glyph bitmap. */
+/* */
+/* If `anode' is _not_ NULL, it receives the address of the cache */
+/* node containing the bitmap, after increasing its reference count. */
+/* This ensures that the node (as well as the image) will always be */
+/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
+/* */
+/* If `anode' is NULL, the cache node is left unchanged, which means */
+/* that the bitmap could be flushed out of the cache on the next */
+/* call to one of the caching sub-system APIs. Don't assume that it */
+/* is persistent! */
+/* */
+FT_EXPORT( FT_Error )
+FTC_SBitCache_Lookup( FTC_SBitCache cache,
+ FTC_ImageType type,
+ FT_UInt gindex,
+ FTC_SBit *sbit,
+ FTC_Node *anode );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FTC_SBitCache_LookupScaler */
+/* */
+/* <Description> */
+/* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
+/* to specify the face ID and its size. */
+/* */
+/* <Input> */
+/* cache :: A handle to the source sbit cache. */
+/* */
+/* scaler :: A pointer to the scaler descriptor. */
+/* */
+/* load_flags :: The corresponding load flags. */
+/* */
+/* gindex :: The glyph index. */
+/* */
+/* <Output> */
+/* sbit :: A handle to a small bitmap descriptor. */
+/* */
+/* anode :: Used to return the address of of the corresponding */
+/* cache node after incrementing its reference count */
+/* (see note below). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The small bitmap descriptor and its bit buffer are owned by the */
+/* cache and should never be freed by the application. They might */
+/* as well disappear from memory on the next cache lookup, so don't */
+/* treat them as persistent data. */
+/* */
+/* The descriptor's `buffer' field is set to~0 to indicate a missing */
+/* glyph bitmap. */
+/* */
+/* If `anode' is _not_ NULL, it receives the address of the cache */
+/* node containing the bitmap, after increasing its reference count. */
+/* This ensures that the node (as well as the image) will always be */
+/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
+/* */
+/* If `anode' is NULL, the cache node is left unchanged, which means */
+/* that the bitmap could be flushed out of the cache on the next */
+/* call to one of the caching sub-system APIs. Don't assume that it */
+/* is persistent! */
+/* */
+FT_EXPORT( FT_Error )
+FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
+ FTC_Scaler scaler,
+ FT_ULong load_flags,
+ FT_UInt gindex,
+ FTC_SBit *sbit,
+ FTC_Node *anode );
+
+
+/* */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /*@***********************************************************************/
- /* */
- /* <Struct> */
- /* FTC_FontRec */
- /* */
- /* <Description> */
- /* A simple structure used to describe a given `font' to the cache */
- /* manager. Note that a `font' is the combination of a given face */
- /* with a given character size. */
- /* */
- /* <Fields> */
- /* face_id :: The ID of the face to use. */
- /* */
- /* pix_width :: The character width in integer pixels. */
- /* */
- /* pix_height :: The character height in integer pixels. */
- /* */
- typedef struct FTC_FontRec_
- {
+/*@***********************************************************************/
+/* */
+/* <Struct> */
+/* FTC_FontRec */
+/* */
+/* <Description> */
+/* A simple structure used to describe a given `font' to the cache */
+/* manager. Note that a `font' is the combination of a given face */
+/* with a given character size. */
+/* */
+/* <Fields> */
+/* face_id :: The ID of the face to use. */
+/* */
+/* pix_width :: The character width in integer pixels. */
+/* */
+/* pix_height :: The character height in integer pixels. */
+/* */
+typedef struct FTC_FontRec_ {
FTC_FaceID face_id;
FT_UShort pix_width;
FT_UShort pix_height;
- } FTC_FontRec;
+} FTC_FontRec;
- /* */
+/* */
#define FTC_FONT_COMPARE( f1, f2 ) \
@@ -1107,30 +1103,30 @@ FT_BEGIN_HEADER
(f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height )
- /* this macro is incompatible with LLP64, should not be used */
+/* this macro is incompatible with LLP64, should not be used */
#define FTC_FONT_HASH( f ) \
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
((f)->pix_width << 8) ^ \
((f)->pix_height) )
- typedef FTC_FontRec* FTC_Font;
+typedef FTC_FontRec* FTC_Font;
- FT_EXPORT( FT_Error )
- FTC_Manager_Lookup_Face( FTC_Manager manager,
- FTC_FaceID face_id,
- FT_Face *aface );
+FT_EXPORT( FT_Error )
+FTC_Manager_Lookup_Face( FTC_Manager manager,
+ FTC_FaceID face_id,
+ FT_Face *aface );
- FT_EXPORT( FT_Error )
- FTC_Manager_Lookup_Size( FTC_Manager manager,
- FTC_Font font,
- FT_Face *aface,
- FT_Size *asize );
+FT_EXPORT( FT_Error )
+FTC_Manager_Lookup_Size( FTC_Manager manager,
+ FTC_Font font,
+ FT_Face *aface,
+ FT_Size *asize );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcffdrv.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcffdrv.h
index 07ae54d..3b2b6b2 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcffdrv.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcffdrv.h
@@ -32,114 +32,114 @@
FT_BEGIN_HEADER
- /**************************************************************************
- *
- * @section:
- * cff_driver
- *
- * @title:
- * The CFF driver
- *
- * @abstract:
- * Controlling the CFF driver module.
- *
- * @description:
- * While FreeType's CFF driver doesn't expose API functions by itself,
- * it is possible to control its behaviour with @FT_Property_Set and
- * @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * The CFF driver's module name is `cff'.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * hinting-engine
- *
- * @description:
- * Thanks to Adobe, which contributed a new hinting (and parsing)
- * engine, an application can select between `freetype' and `adobe'.
- *
- * Right now, the default engine is `freetype'. However, this will
- * change: After a certain time of intensive testing it is planned to
- * make `adobe' the default due to its superior rendering results.
- *
- * The following example code demonstrates how to select Adobe's hinting
- * engine (omitting the error handling).
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "cff",
- * "hinting-engine", &hinting_engine );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_CFF_HINTING_XXX
- *
- * @description:
- * A list of constants used for the @hinting-engine property to select
- * the hinting engine for CFF fonts.
- *
- * @values:
- * FT_CFF_HINTING_FREETYPE ::
- * Use the old FreeType hinting engine.
- *
- * FT_CFF_HINTING_ADOBE ::
- * Use the hinting engine contributed by Adobe.
- *
- */
+/**************************************************************************
+ *
+ * @section:
+ * cff_driver
+ *
+ * @title:
+ * The CFF driver
+ *
+ * @abstract:
+ * Controlling the CFF driver module.
+ *
+ * @description:
+ * While FreeType's CFF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * The CFF driver's module name is `cff'.
+ *
+ */
+
+
+/**************************************************************************
+ *
+ * @property:
+ * hinting-engine
+ *
+ * @description:
+ * Thanks to Adobe, which contributed a new hinting (and parsing)
+ * engine, an application can select between `freetype' and `adobe'.
+ *
+ * Right now, the default engine is `freetype'. However, this will
+ * change: After a certain time of intensive testing it is planned to
+ * make `adobe' the default due to its superior rendering results.
+ *
+ * The following example code demonstrates how to select Adobe's hinting
+ * engine (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "hinting-engine", &hinting_engine );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+/**************************************************************************
+ *
+ * @enum:
+ * FT_CFF_HINTING_XXX
+ *
+ * @description:
+ * A list of constants used for the @hinting-engine property to select
+ * the hinting engine for CFF fonts.
+ *
+ * @values:
+ * FT_CFF_HINTING_FREETYPE ::
+ * Use the old FreeType hinting engine.
+ *
+ * FT_CFF_HINTING_ADOBE ::
+ * Use the hinting engine contributed by Adobe.
+ *
+ */
#define FT_CFF_HINTING_FREETYPE 0
#define FT_CFF_HINTING_ADOBE 1
- /**************************************************************************
- *
- * @property:
- * no-stem-darkening
- *
- * @description:
- * By default, the Adobe CFF engine darkens stems at smaller sizes,
- * regardless of hinting, to enhance contrast. Setting this property,
- * stem darkening gets switched off.
- *
- * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_Bool no_stem_darkening = TRUE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "cff",
- * "no-stem-darkening", &no_stem_darkening );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
-
- /* */
+/**************************************************************************
+ *
+ * @property:
+ * no-stem-darkening
+ *
+ * @description:
+ * By default, the Adobe CFF engine darkens stems at smaller sizes,
+ * regardless of hinting, to enhance contrast. Setting this property,
+ * stem darkening gets switched off.
+ *
+ * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Bool no_stem_darkening = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "no-stem-darkening", &no_stem_darkening );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcid.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcid.h
index 203a30c..31f4012 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftcid.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftcid.h
@@ -31,132 +31,132 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cid_fonts */
- /* */
- /* <Title> */
- /* CID Fonts */
- /* */
- /* <Abstract> */
- /* CID-keyed font specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of CID-keyed font specific */
- /* functions. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_Registry_Ordering_Supplement
- *
- * @description:
- * Retrieve the Registry/Ordering/Supplement triple (also known as the
- * "R/O/S") from a CID-keyed font.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * registry ::
- * The registry, as a C~string, owned by the face.
- *
- * ordering ::
- * The ordering, as a C~string, owned by the face.
- *
- * supplement ::
- * The supplement.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces, returning an error
- * otherwise.
- *
- * @since:
- * 2.3.6
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
- const char* *registry,
- const char* *ordering,
- FT_Int *supplement);
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_Is_Internally_CID_Keyed
- *
- * @description:
- * Retrieve the type of the input face, CID keyed or not. In
- * constrast to the @FT_IS_CID_KEYED macro this function returns
- * successfully also for CID-keyed fonts in an SNFT wrapper.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * is_cid ::
- * The type of the face as an @FT_Bool.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces and OpenType fonts,
- * returning an error otherwise.
- *
- * @since:
- * 2.3.9
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
- FT_Bool *is_cid );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_From_Glyph_Index
- *
- * @description:
- * Retrieve the CID of the input glyph index.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * glyph_index ::
- * The input glyph index.
- *
- * @output:
- * cid ::
- * The CID as an @FT_UInt.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces and OpenType fonts,
- * returning an error otherwise.
- *
- * @since:
- * 2.3.9
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_From_Glyph_Index( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt *cid );
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* cid_fonts */
+/* */
+/* <Title> */
+/* CID Fonts */
+/* */
+/* <Abstract> */
+/* CID-keyed font specific API. */
+/* */
+/* <Description> */
+/* This section contains the declaration of CID-keyed font specific */
+/* functions. */
+/* */
+/*************************************************************************/
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_Registry_Ordering_Supplement
+ *
+ * @description:
+ * Retrieve the Registry/Ordering/Supplement triple (also known as the
+ * "R/O/S") from a CID-keyed font.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * registry ::
+ * The registry, as a C~string, owned by the face.
+ *
+ * ordering ::
+ * The ordering, as a C~string, owned by the face.
+ *
+ * supplement ::
+ * The supplement.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces, returning an error
+ * otherwise.
+ *
+ * @since:
+ * 2.3.6
+ */
+FT_EXPORT( FT_Error )
+FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
+ const char**registry,
+ const char**ordering,
+ FT_Int *supplement);
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_Is_Internally_CID_Keyed
+ *
+ * @description:
+ * Retrieve the type of the input face, CID keyed or not. In
+ * constrast to the @FT_IS_CID_KEYED macro this function returns
+ * successfully also for CID-keyed fonts in an SNFT wrapper.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * is_cid ::
+ * The type of the face as an @FT_Bool.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces and OpenType fonts,
+ * returning an error otherwise.
+ *
+ * @since:
+ * 2.3.9
+ */
+FT_EXPORT( FT_Error )
+FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
+ FT_Bool *is_cid );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_From_Glyph_Index
+ *
+ * @description:
+ * Retrieve the CID of the input glyph index.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * glyph_index ::
+ * The input glyph index.
+ *
+ * @output:
+ * cid ::
+ * The CID as an @FT_UInt.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces and OpenType fonts,
+ * returning an error otherwise.
+ *
+ * @since:
+ * 2.3.9
+ */
+FT_EXPORT( FT_Error )
+FT_Get_CID_From_Glyph_Index( FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt *cid );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/fterrdef.h b/thirdparties/common/include/libfreetype/freetype2/freetype/fterrdef.h
index 76c7b9e..8b25d8b 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/fterrdef.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/fterrdef.h
@@ -16,234 +16,234 @@
/***************************************************************************/
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** LIST OF ERROR CODES/MESSAGES *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
- /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
- /* including this file. */
-
-
- /* generic errors */
-
- FT_NOERRORDEF_( Ok, 0x00, \
- "no error" )
-
- FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
- "cannot open resource" )
- FT_ERRORDEF_( Unknown_File_Format, 0x02, \
- "unknown file format" )
- FT_ERRORDEF_( Invalid_File_Format, 0x03, \
- "broken file" )
- FT_ERRORDEF_( Invalid_Version, 0x04, \
- "invalid FreeType version" )
- FT_ERRORDEF_( Lower_Module_Version, 0x05, \
- "module version is too low" )
- FT_ERRORDEF_( Invalid_Argument, 0x06, \
- "invalid argument" )
- FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
- "unimplemented feature" )
- FT_ERRORDEF_( Invalid_Table, 0x08, \
- "broken table" )
- FT_ERRORDEF_( Invalid_Offset, 0x09, \
- "broken offset within table" )
- FT_ERRORDEF_( Array_Too_Large, 0x0A, \
- "array allocation size too large" )
- FT_ERRORDEF_( Missing_Module, 0x0B, \
- "missing module" )
- FT_ERRORDEF_( Missing_Property, 0x0C, \
- "missing property" )
-
- /* glyph/character errors */
-
- FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
- "invalid glyph index" )
- FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
- "invalid character code" )
- FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
- "unsupported glyph image format" )
- FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
- "cannot render this glyph format" )
- FT_ERRORDEF_( Invalid_Outline, 0x14, \
- "invalid outline" )
- FT_ERRORDEF_( Invalid_Composite, 0x15, \
- "invalid composite glyph" )
- FT_ERRORDEF_( Too_Many_Hints, 0x16, \
- "too many hints" )
- FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
- "invalid pixel size" )
-
- /* handle errors */
-
- FT_ERRORDEF_( Invalid_Handle, 0x20, \
- "invalid object handle" )
- FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
- "invalid library handle" )
- FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
- "invalid module handle" )
- FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
- "invalid face handle" )
- FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
- "invalid size handle" )
- FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
- "invalid glyph slot handle" )
- FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
- "invalid charmap handle" )
- FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
- "invalid cache manager handle" )
- FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
- "invalid stream handle" )
-
- /* driver errors */
-
- FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
- "too many modules" )
- FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
- "too many extensions" )
-
- /* memory errors */
-
- FT_ERRORDEF_( Out_Of_Memory, 0x40, \
- "out of memory" )
- FT_ERRORDEF_( Unlisted_Object, 0x41, \
- "unlisted object" )
-
- /* stream errors */
-
- FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
- "cannot open stream" )
- FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
- "invalid stream seek" )
- FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
- "invalid stream skip" )
- FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
- "invalid stream read" )
- FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
- "invalid stream operation" )
- FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
- "invalid frame operation" )
- FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
- "nested frame access" )
- FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
- "invalid frame read" )
-
- /* raster errors */
-
- FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
- "raster uninitialized" )
- FT_ERRORDEF_( Raster_Corrupted, 0x61, \
- "raster corrupted" )
- FT_ERRORDEF_( Raster_Overflow, 0x62, \
- "raster overflow" )
- FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
- "negative height while rastering" )
-
- /* cache errors */
-
- FT_ERRORDEF_( Too_Many_Caches, 0x70, \
- "too many registered caches" )
-
- /* TrueType and SFNT errors */
-
- FT_ERRORDEF_( Invalid_Opcode, 0x80, \
- "invalid opcode" )
- FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
- "too few arguments" )
- FT_ERRORDEF_( Stack_Overflow, 0x82, \
- "stack overflow" )
- FT_ERRORDEF_( Code_Overflow, 0x83, \
- "code overflow" )
- FT_ERRORDEF_( Bad_Argument, 0x84, \
- "bad argument" )
- FT_ERRORDEF_( Divide_By_Zero, 0x85, \
- "division by zero" )
- FT_ERRORDEF_( Invalid_Reference, 0x86, \
- "invalid reference" )
- FT_ERRORDEF_( Debug_OpCode, 0x87, \
- "found debug opcode" )
- FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
- "found ENDF opcode in execution stream" )
- FT_ERRORDEF_( Nested_DEFS, 0x89, \
- "nested DEFS" )
- FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
- "invalid code range" )
- FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
- "execution context too long" )
- FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
- "too many function definitions" )
- FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
- "too many instruction definitions" )
- FT_ERRORDEF_( Table_Missing, 0x8E, \
- "SFNT font table missing" )
- FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
- "horizontal header (hhea) table missing" )
- FT_ERRORDEF_( Locations_Missing, 0x90, \
- "locations (loca) table missing" )
- FT_ERRORDEF_( Name_Table_Missing, 0x91, \
- "name table missing" )
- FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
- "character map (cmap) table missing" )
- FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
- "horizontal metrics (hmtx) table missing" )
- FT_ERRORDEF_( Post_Table_Missing, 0x94, \
- "PostScript (post) table missing" )
- FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
- "invalid horizontal metrics" )
- FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
- "invalid character map (cmap) format" )
- FT_ERRORDEF_( Invalid_PPem, 0x97, \
- "invalid ppem value" )
- FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
- "invalid vertical metrics" )
- FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
- "could not find context" )
- FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
- "invalid PostScript (post) table format" )
- FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
- "invalid PostScript (post) table" )
-
- /* CFF, CID, and Type 1 errors */
-
- FT_ERRORDEF_( Syntax_Error, 0xA0, \
- "opcode syntax error" )
- FT_ERRORDEF_( Stack_Underflow, 0xA1, \
- "argument stack underflow" )
- FT_ERRORDEF_( Ignore, 0xA2, \
- "ignore" )
- FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
- "no Unicode glyph name found" )
- FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \
- "glyph to big for hinting" )
-
- /* BDF errors */
-
- FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
- "`STARTFONT' field missing" )
- FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
- "`FONT' field missing" )
- FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
- "`SIZE' field missing" )
- FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
- "`FONTBOUNDINGBOX' field missing" )
- FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
- "`CHARS' field missing" )
- FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
- "`STARTCHAR' field missing" )
- FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
- "`ENCODING' field missing" )
- FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
- "`BBX' field missing" )
- FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
- "`BBX' too big" )
- FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
- "Font header corrupted or missing fields" )
- FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
- "Font glyphs corrupted or missing fields" )
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** LIST OF ERROR CODES/MESSAGES *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
+
+
+/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
+/* including this file. */
+
+
+/* generic errors */
+
+FT_NOERRORDEF_( Ok, 0x00, \
+ "no error" )
+
+FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
+ "cannot open resource" )
+FT_ERRORDEF_( Unknown_File_Format, 0x02, \
+ "unknown file format" )
+FT_ERRORDEF_( Invalid_File_Format, 0x03, \
+ "broken file" )
+FT_ERRORDEF_( Invalid_Version, 0x04, \
+ "invalid FreeType version" )
+FT_ERRORDEF_( Lower_Module_Version, 0x05, \
+ "module version is too low" )
+FT_ERRORDEF_( Invalid_Argument, 0x06, \
+ "invalid argument" )
+FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
+ "unimplemented feature" )
+FT_ERRORDEF_( Invalid_Table, 0x08, \
+ "broken table" )
+FT_ERRORDEF_( Invalid_Offset, 0x09, \
+ "broken offset within table" )
+FT_ERRORDEF_( Array_Too_Large, 0x0A, \
+ "array allocation size too large" )
+FT_ERRORDEF_( Missing_Module, 0x0B, \
+ "missing module" )
+FT_ERRORDEF_( Missing_Property, 0x0C, \
+ "missing property" )
+
+/* glyph/character errors */
+
+FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
+ "invalid glyph index" )
+FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
+ "invalid character code" )
+FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
+ "unsupported glyph image format" )
+FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
+ "cannot render this glyph format" )
+FT_ERRORDEF_( Invalid_Outline, 0x14, \
+ "invalid outline" )
+FT_ERRORDEF_( Invalid_Composite, 0x15, \
+ "invalid composite glyph" )
+FT_ERRORDEF_( Too_Many_Hints, 0x16, \
+ "too many hints" )
+FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
+ "invalid pixel size" )
+
+/* handle errors */
+
+FT_ERRORDEF_( Invalid_Handle, 0x20, \
+ "invalid object handle" )
+FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
+ "invalid library handle" )
+FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
+ "invalid module handle" )
+FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
+ "invalid face handle" )
+FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
+ "invalid size handle" )
+FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
+ "invalid glyph slot handle" )
+FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
+ "invalid charmap handle" )
+FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
+ "invalid cache manager handle" )
+FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
+ "invalid stream handle" )
+
+/* driver errors */
+
+FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
+ "too many modules" )
+FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
+ "too many extensions" )
+
+/* memory errors */
+
+FT_ERRORDEF_( Out_Of_Memory, 0x40, \
+ "out of memory" )
+FT_ERRORDEF_( Unlisted_Object, 0x41, \
+ "unlisted object" )
+
+/* stream errors */
+
+FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
+ "cannot open stream" )
+FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
+ "invalid stream seek" )
+FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
+ "invalid stream skip" )
+FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
+ "invalid stream read" )
+FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
+ "invalid stream operation" )
+FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
+ "invalid frame operation" )
+FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
+ "nested frame access" )
+FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
+ "invalid frame read" )
+
+/* raster errors */
+
+FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
+ "raster uninitialized" )
+FT_ERRORDEF_( Raster_Corrupted, 0x61, \
+ "raster corrupted" )
+FT_ERRORDEF_( Raster_Overflow, 0x62, \
+ "raster overflow" )
+FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
+ "negative height while rastering" )
+
+/* cache errors */
+
+FT_ERRORDEF_( Too_Many_Caches, 0x70, \
+ "too many registered caches" )
+
+/* TrueType and SFNT errors */
+
+FT_ERRORDEF_( Invalid_Opcode, 0x80, \
+ "invalid opcode" )
+FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
+ "too few arguments" )
+FT_ERRORDEF_( Stack_Overflow, 0x82, \
+ "stack overflow" )
+FT_ERRORDEF_( Code_Overflow, 0x83, \
+ "code overflow" )
+FT_ERRORDEF_( Bad_Argument, 0x84, \
+ "bad argument" )
+FT_ERRORDEF_( Divide_By_Zero, 0x85, \
+ "division by zero" )
+FT_ERRORDEF_( Invalid_Reference, 0x86, \
+ "invalid reference" )
+FT_ERRORDEF_( Debug_OpCode, 0x87, \
+ "found debug opcode" )
+FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
+ "found ENDF opcode in execution stream" )
+FT_ERRORDEF_( Nested_DEFS, 0x89, \
+ "nested DEFS" )
+FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
+ "invalid code range" )
+FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
+ "execution context too long" )
+FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
+ "too many function definitions" )
+FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
+ "too many instruction definitions" )
+FT_ERRORDEF_( Table_Missing, 0x8E, \
+ "SFNT font table missing" )
+FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
+ "horizontal header (hhea) table missing" )
+FT_ERRORDEF_( Locations_Missing, 0x90, \
+ "locations (loca) table missing" )
+FT_ERRORDEF_( Name_Table_Missing, 0x91, \
+ "name table missing" )
+FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
+ "character map (cmap) table missing" )
+FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
+ "horizontal metrics (hmtx) table missing" )
+FT_ERRORDEF_( Post_Table_Missing, 0x94, \
+ "PostScript (post) table missing" )
+FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
+ "invalid horizontal metrics" )
+FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
+ "invalid character map (cmap) format" )
+FT_ERRORDEF_( Invalid_PPem, 0x97, \
+ "invalid ppem value" )
+FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
+ "invalid vertical metrics" )
+FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
+ "could not find context" )
+FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
+ "invalid PostScript (post) table format" )
+FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
+ "invalid PostScript (post) table" )
+
+/* CFF, CID, and Type 1 errors */
+
+FT_ERRORDEF_( Syntax_Error, 0xA0, \
+ "opcode syntax error" )
+FT_ERRORDEF_( Stack_Underflow, 0xA1, \
+ "argument stack underflow" )
+FT_ERRORDEF_( Ignore, 0xA2, \
+ "ignore" )
+FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
+ "no Unicode glyph name found" )
+FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \
+ "glyph to big for hinting" )
+
+/* BDF errors */
+
+FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
+ "`STARTFONT' field missing" )
+FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
+ "`FONT' field missing" )
+FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
+ "`SIZE' field missing" )
+FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
+ "`FONTBOUNDINGBOX' field missing" )
+FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
+ "`CHARS' field missing" )
+FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
+ "`STARTCHAR' field missing" )
+FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
+ "`ENCODING' field missing" )
+FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
+ "`BBX' field missing" )
+FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
+ "`BBX' too big" )
+FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
+ "Font header corrupted or missing fields" )
+FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
+ "Font glyphs corrupted or missing fields" )
/* END */
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/fterrors.h b/thirdparties/common/include/libfreetype/freetype2/freetype/fterrors.h
index 0fa3e4d..f260ce0 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/fterrors.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/fterrors.h
@@ -16,101 +16,101 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This special header file is used to define the handling of FT2 */
- /* enumeration constants. It can also be used to generate error message */
- /* strings with a small macro trick explained below. */
- /* */
- /* I - Error Formats */
- /* ----------------- */
- /* */
- /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
- /* defined in ftoption.h in order to make the higher byte indicate */
- /* the module where the error has happened (this is not compatible */
- /* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
- /* more details. */
- /* */
- /* */
- /* II - Error Message strings */
- /* -------------------------- */
- /* */
- /* The error definitions below are made through special macros that */
- /* allow client applications to build a table of error message strings */
- /* if they need it. The strings are not included in a normal build of */
- /* FreeType 2 to save space (most client applications do not use */
- /* them). */
- /* */
- /* To do so, you have to define the following macros before including */
- /* this file: */
- /* */
- /* FT_ERROR_START_LIST :: */
- /* This macro is called before anything else to define the start of */
- /* the error list. It is followed by several FT_ERROR_DEF calls */
- /* (see below). */
- /* */
- /* FT_ERROR_DEF( e, v, s ) :: */
- /* This macro is called to define one single error. */
- /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
- /* `v' is the error numerical value. */
- /* `s' is the corresponding error string. */
- /* */
- /* FT_ERROR_END_LIST :: */
- /* This macro ends the list. */
- /* */
- /* Additionally, you have to undefine __FTERRORS_H__ before #including */
- /* this file. */
- /* */
- /* Here is a simple example: */
- /* */
- /* { */
- /* #undef __FTERRORS_H__ */
- /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
- /* #define FT_ERROR_START_LIST { */
- /* #define FT_ERROR_END_LIST { 0, 0 } }; */
- /* */
- /* const struct */
- /* { */
- /* int err_code; */
- /* const char* err_msg; */
- /* } ft_errors[] = */
- /* */
- /* #include FT_ERRORS_H */
- /* } */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This special header file is used to define the handling of FT2 */
+/* enumeration constants. It can also be used to generate error message */
+/* strings with a small macro trick explained below. */
+/* */
+/* I - Error Formats */
+/* ----------------- */
+/* */
+/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
+/* defined in ftoption.h in order to make the higher byte indicate */
+/* the module where the error has happened (this is not compatible */
+/* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
+/* more details. */
+/* */
+/* */
+/* II - Error Message strings */
+/* -------------------------- */
+/* */
+/* The error definitions below are made through special macros that */
+/* allow client applications to build a table of error message strings */
+/* if they need it. The strings are not included in a normal build of */
+/* FreeType 2 to save space (most client applications do not use */
+/* them). */
+/* */
+/* To do so, you have to define the following macros before including */
+/* this file: */
+/* */
+/* FT_ERROR_START_LIST :: */
+/* This macro is called before anything else to define the start of */
+/* the error list. It is followed by several FT_ERROR_DEF calls */
+/* (see below). */
+/* */
+/* FT_ERROR_DEF( e, v, s ) :: */
+/* This macro is called to define one single error. */
+/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
+/* `v' is the error numerical value. */
+/* `s' is the corresponding error string. */
+/* */
+/* FT_ERROR_END_LIST :: */
+/* This macro ends the list. */
+/* */
+/* Additionally, you have to undefine __FTERRORS_H__ before #including */
+/* this file. */
+/* */
+/* Here is a simple example: */
+/* */
+/* { */
+/* #undef __FTERRORS_H__ */
+/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
+/* #define FT_ERROR_START_LIST { */
+/* #define FT_ERROR_END_LIST { 0, 0 } }; */
+/* */
+/* const struct */
+/* { */
+/* int err_code; */
+/* const char* err_msg; */
+/* } ft_errors[] = */
+/* */
+/* #include FT_ERRORS_H */
+/* } */
+/* */
+/*************************************************************************/
#ifndef __FTERRORS_H__
#define __FTERRORS_H__
- /* include module base error codes */
+/* include module base error codes */
#include FT_MODULE_ERRORS_H
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SETUP MACROS *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** SETUP MACROS *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
#undef FT_NEED_EXTERN_C
- /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
- /* By default, we use `FT_Err_'. */
- /* */
+/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
+/* By default, we use `FT_Err_'. */
+/* */
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_
#endif
- /* FT_ERR_BASE is used as the base for module-specific errors. */
- /* */
+/* FT_ERR_BASE is used as the base for module-specific errors. */
+/* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#ifndef FT_ERR_BASE
@@ -125,9 +125,9 @@
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
- /* If FT_ERRORDEF is not defined, we need to define a simple */
- /* enumeration type. */
- /* */
+/* If FT_ERRORDEF is not defined, we need to define a simple */
+/* enumeration type. */
+/* */
#ifndef FT_ERRORDEF
#define FT_ERRORDEF( e, v, s ) e = v,
@@ -136,45 +136,45 @@
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
- extern "C" {
+extern "C" {
#endif
#endif /* !FT_ERRORDEF */
- /* this macro is used to define an error */
+/* this macro is used to define an error */
#define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
- /* this is only used for <module>_Err_Ok, which must be 0! */
+/* this is only used for <module>_Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
#ifdef FT_ERROR_START_LIST
- FT_ERROR_START_LIST
+FT_ERROR_START_LIST
#endif
- /* now include the error codes */
+/* now include the error codes */
#include FT_ERROR_DEFINITIONS_H
#ifdef FT_ERROR_END_LIST
- FT_ERROR_END_LIST
+FT_ERROR_END_LIST
#endif
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SIMPLE CLEANUP *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** SIMPLE CLEANUP *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
#ifdef FT_NEED_EXTERN_C
- }
+}
#endif
#undef FT_ERROR_START_LIST
@@ -187,7 +187,7 @@
#undef FT_NEED_EXTERN_C
#undef FT_ERR_BASE
- /* FT_ERR_PREFIX is needed internally */
+/* FT_ERR_PREFIX is needed internally */
#ifndef FT2_BUILD_LIBRARY
#undef FT_ERR_PREFIX
#endif
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgasp.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgasp.h
index 453d4fa..55fc70e 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgasp.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgasp.h
@@ -29,66 +29,66 @@
#endif
- /***************************************************************************
- *
- * @section:
- * gasp_table
- *
- * @title:
- * Gasp Table
- *
- * @abstract:
- * Retrieving TrueType `gasp' table entries.
- *
- * @description:
- * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
- * font for specific entries in its `gasp' table, if any. This is
- * mainly useful when implementing native TrueType hinting with the
- * bytecode interpreter to duplicate the Windows text rendering results.
- */
+/***************************************************************************
+ *
+ * @section:
+ * gasp_table
+ *
+ * @title:
+ * Gasp Table
+ *
+ * @abstract:
+ * Retrieving TrueType `gasp' table entries.
+ *
+ * @description:
+ * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
+ * font for specific entries in its `gasp' table, if any. This is
+ * mainly useful when implementing native TrueType hinting with the
+ * bytecode interpreter to duplicate the Windows text rendering results.
+ */
- /*************************************************************************
- *
- * @enum:
- * FT_GASP_XXX
- *
- * @description:
- * A list of values and/or bit-flags returned by the @FT_Get_Gasp
- * function.
- *
- * @values:
- * FT_GASP_NO_TABLE ::
- * This special value means that there is no GASP table in this face.
- * It is up to the client to decide what to do.
- *
- * FT_GASP_DO_GRIDFIT ::
- * Grid-fitting and hinting should be performed at the specified ppem.
- * This *really* means TrueType bytecode interpretation. If this bit
- * is not set, no hinting gets applied.
- *
- * FT_GASP_DO_GRAY ::
- * Anti-aliased rendering should be performed at the specified ppem.
- * If not set, do monochrome rendering.
- *
- * FT_GASP_SYMMETRIC_SMOOTHING ::
- * If set, smoothing along multiple axes must be used with ClearType.
- *
- * FT_GASP_SYMMETRIC_GRIDFIT ::
- * Grid-fitting must be used with ClearType's symmetric smoothing.
- *
- * @note:
- * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
- * used for standard font rasterization only. Independently of that,
- * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
- * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
- * `FT_GASP_DO_GRAY' are consequently ignored).
- *
- * `ClearType' is Microsoft's implementation of LCD rendering, partly
- * protected by patents.
- *
- * @since:
- * 2.3.0
- */
+/*************************************************************************
+ *
+ * @enum:
+ * FT_GASP_XXX
+ *
+ * @description:
+ * A list of values and/or bit-flags returned by the @FT_Get_Gasp
+ * function.
+ *
+ * @values:
+ * FT_GASP_NO_TABLE ::
+ * This special value means that there is no GASP table in this face.
+ * It is up to the client to decide what to do.
+ *
+ * FT_GASP_DO_GRIDFIT ::
+ * Grid-fitting and hinting should be performed at the specified ppem.
+ * This *really* means TrueType bytecode interpretation. If this bit
+ * is not set, no hinting gets applied.
+ *
+ * FT_GASP_DO_GRAY ::
+ * Anti-aliased rendering should be performed at the specified ppem.
+ * If not set, do monochrome rendering.
+ *
+ * FT_GASP_SYMMETRIC_SMOOTHING ::
+ * If set, smoothing along multiple axes must be used with ClearType.
+ *
+ * FT_GASP_SYMMETRIC_GRIDFIT ::
+ * Grid-fitting must be used with ClearType's symmetric smoothing.
+ *
+ * @note:
+ * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
+ * used for standard font rasterization only. Independently of that,
+ * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
+ * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
+ * `FT_GASP_DO_GRAY' are consequently ignored).
+ *
+ * `ClearType' is Microsoft's implementation of LCD rendering, partly
+ * protected by patents.
+ *
+ * @since:
+ * 2.3.0
+ */
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
@@ -96,29 +96,29 @@
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
- /*************************************************************************
- *
- * @func:
- * FT_Get_Gasp
- *
- * @description:
- * Read the `gasp' table from a TrueType or OpenType font file and
- * return the entry corresponding to a given character pixel size.
- *
- * @input:
- * face :: The source face handle.
- * ppem :: The vertical character pixel size.
- *
- * @return:
- * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
- * `gasp' table in the face.
- *
- * @since:
- * 2.3.0
- */
- FT_EXPORT( FT_Int )
- FT_Get_Gasp( FT_Face face,
- FT_UInt ppem );
+/*************************************************************************
+ *
+ * @func:
+ * FT_Get_Gasp
+ *
+ * @description:
+ * Read the `gasp' table from a TrueType or OpenType font file and
+ * return the entry corresponding to a given character pixel size.
+ *
+ * @input:
+ * face :: The source face handle.
+ * ppem :: The vertical character pixel size.
+ *
+ * @return:
+ * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
+ * `gasp' table in the face.
+ *
+ * @since:
+ * 2.3.0
+ */
+FT_EXPORT( FT_Int )
+FT_Get_Gasp( FT_Face face,
+ FT_UInt ppem );
/* */
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftglyph.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftglyph.h
index 31dc331..34c0525 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftglyph.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftglyph.h
@@ -16,17 +16,17 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This file contains the definition of several convenience functions */
- /* that can be used by client applications to easily retrieve glyph */
- /* bitmaps and outlines from a given face. */
- /* */
- /* These functions should be optional if you are writing a font server */
- /* or text layout engine on top of FreeType. However, they are pretty */
- /* handy for many other simple uses of the library. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This file contains the definition of several convenience functions */
+/* that can be used by client applications to easily retrieve glyph */
+/* bitmaps and outlines from a given face. */
+/* */
+/* These functions should be optional if you are writing a font server */
+/* or text layout engine on top of FreeType. However, they are pretty */
+/* handy for many other simple uses of the library. */
+/* */
+/*************************************************************************/
#ifndef __FTGLYPH_H__
@@ -46,301 +46,297 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* glyph_management */
- /* */
- /* <Title> */
- /* Glyph Management */
- /* */
- /* <Abstract> */
- /* Generic interface to manage individual glyph data. */
- /* */
- /* <Description> */
- /* This section contains definitions used to manage glyph data */
- /* through generic FT_Glyph objects. Each of them can contain a */
- /* bitmap, a vector outline, or even images in other formats. */
- /* */
- /*************************************************************************/
-
-
- /* forward declaration to a private type */
- typedef struct FT_Glyph_Class_ FT_Glyph_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Glyph */
- /* */
- /* <Description> */
- /* Handle to an object used to model generic glyph images. It is a */
- /* pointer to the @FT_GlyphRec structure and can contain a glyph */
- /* bitmap or pointer. */
- /* */
- /* <Note> */
- /* Glyph objects are not owned by the library. You must thus release */
- /* them manually (through @FT_Done_Glyph) _before_ calling */
- /* @FT_Done_FreeType. */
- /* */
- typedef struct FT_GlyphRec_* FT_Glyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphRec */
- /* */
- /* <Description> */
- /* The root glyph structure contains a given glyph image plus its */
- /* advance width in 16.16 fixed-point format. */
- /* */
- /* <Fields> */
- /* library :: A handle to the FreeType library object. */
- /* */
- /* clazz :: A pointer to the glyph's class. Private. */
- /* */
- /* format :: The format of the glyph's image. */
- /* */
- /* advance :: A 16.16 vector that gives the glyph's advance width. */
- /* */
- typedef struct FT_GlyphRec_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* glyph_management */
+/* */
+/* <Title> */
+/* Glyph Management */
+/* */
+/* <Abstract> */
+/* Generic interface to manage individual glyph data. */
+/* */
+/* <Description> */
+/* This section contains definitions used to manage glyph data */
+/* through generic FT_Glyph objects. Each of them can contain a */
+/* bitmap, a vector outline, or even images in other formats. */
+/* */
+/*************************************************************************/
+
+
+/* forward declaration to a private type */
+typedef struct FT_Glyph_Class_ FT_Glyph_Class;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Glyph */
+/* */
+/* <Description> */
+/* Handle to an object used to model generic glyph images. It is a */
+/* pointer to the @FT_GlyphRec structure and can contain a glyph */
+/* bitmap or pointer. */
+/* */
+/* <Note> */
+/* Glyph objects are not owned by the library. You must thus release */
+/* them manually (through @FT_Done_Glyph) _before_ calling */
+/* @FT_Done_FreeType. */
+/* */
+typedef struct FT_GlyphRec_* FT_Glyph;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_GlyphRec */
+/* */
+/* <Description> */
+/* The root glyph structure contains a given glyph image plus its */
+/* advance width in 16.16 fixed-point format. */
+/* */
+/* <Fields> */
+/* library :: A handle to the FreeType library object. */
+/* */
+/* clazz :: A pointer to the glyph's class. Private. */
+/* */
+/* format :: The format of the glyph's image. */
+/* */
+/* advance :: A 16.16 vector that gives the glyph's advance width. */
+/* */
+typedef struct FT_GlyphRec_ {
FT_Library library;
const FT_Glyph_Class* clazz;
FT_Glyph_Format format;
FT_Vector advance;
- } FT_GlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_BitmapGlyph */
- /* */
- /* <Description> */
- /* A handle to an object used to model a bitmap glyph image. This is */
- /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
- /* */
- typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_BitmapGlyphRec */
- /* */
- /* <Description> */
- /* A structure used for bitmap glyph images. This really is a */
- /* `sub-class' of @FT_GlyphRec. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Glyph fields. */
- /* */
- /* left :: The left-side bearing, i.e., the horizontal distance */
- /* from the current pen position to the left border of the */
- /* glyph bitmap. */
- /* */
- /* top :: The top-side bearing, i.e., the vertical distance from */
- /* the current pen position to the top border of the glyph */
- /* bitmap. This distance is positive for upwards~y! */
- /* */
- /* bitmap :: A descriptor for the bitmap. */
- /* */
- /* <Note> */
- /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
- /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
- /* the bitmap's contents easily. */
- /* */
- /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
- /* and is thus created and destroyed with it. */
- /* */
- typedef struct FT_BitmapGlyphRec_
- {
+} FT_GlyphRec;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_BitmapGlyph */
+/* */
+/* <Description> */
+/* A handle to an object used to model a bitmap glyph image. This is */
+/* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
+/* */
+typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_BitmapGlyphRec */
+/* */
+/* <Description> */
+/* A structure used for bitmap glyph images. This really is a */
+/* `sub-class' of @FT_GlyphRec. */
+/* */
+/* <Fields> */
+/* root :: The root @FT_Glyph fields. */
+/* */
+/* left :: The left-side bearing, i.e., the horizontal distance */
+/* from the current pen position to the left border of the */
+/* glyph bitmap. */
+/* */
+/* top :: The top-side bearing, i.e., the vertical distance from */
+/* the current pen position to the top border of the glyph */
+/* bitmap. This distance is positive for upwards~y! */
+/* */
+/* bitmap :: A descriptor for the bitmap. */
+/* */
+/* <Note> */
+/* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
+/* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
+/* the bitmap's contents easily. */
+/* */
+/* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
+/* and is thus created and destroyed with it. */
+/* */
+typedef struct FT_BitmapGlyphRec_ {
FT_GlyphRec root;
FT_Int left;
FT_Int top;
FT_Bitmap bitmap;
- } FT_BitmapGlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_OutlineGlyph */
- /* */
- /* <Description> */
- /* A handle to an object used to model an outline glyph image. This */
- /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
- /* */
- typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_OutlineGlyphRec */
- /* */
- /* <Description> */
- /* A structure used for outline (vectorial) glyph images. This */
- /* really is a `sub-class' of @FT_GlyphRec. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Glyph fields. */
- /* */
- /* outline :: A descriptor for the outline. */
- /* */
- /* <Note> */
- /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
- /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
- /* the outline's content easily. */
- /* */
- /* As the outline is extracted from a glyph slot, its coordinates are */
- /* expressed normally in 26.6 pixels, unless the flag */
- /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
- /* */
- /* The outline's tables are always owned by the object and are */
- /* destroyed with it. */
- /* */
- typedef struct FT_OutlineGlyphRec_
- {
+} FT_BitmapGlyphRec;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_OutlineGlyph */
+/* */
+/* <Description> */
+/* A handle to an object used to model an outline glyph image. This */
+/* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
+/* */
+typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_OutlineGlyphRec */
+/* */
+/* <Description> */
+/* A structure used for outline (vectorial) glyph images. This */
+/* really is a `sub-class' of @FT_GlyphRec. */
+/* */
+/* <Fields> */
+/* root :: The root @FT_Glyph fields. */
+/* */
+/* outline :: A descriptor for the outline. */
+/* */
+/* <Note> */
+/* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
+/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
+/* the outline's content easily. */
+/* */
+/* As the outline is extracted from a glyph slot, its coordinates are */
+/* expressed normally in 26.6 pixels, unless the flag */
+/* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
+/* */
+/* The outline's tables are always owned by the object and are */
+/* destroyed with it. */
+/* */
+typedef struct FT_OutlineGlyphRec_ {
FT_GlyphRec root;
FT_Outline outline;
- } FT_OutlineGlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph */
- /* */
- /* <Description> */
- /* A function used to extract a glyph image from a slot. Note that */
- /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
- /* */
- /* <Input> */
- /* slot :: A handle to the source glyph slot. */
- /* */
- /* <Output> */
- /* aglyph :: A handle to the glyph object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph( FT_GlyphSlot slot,
- FT_Glyph *aglyph );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Copy */
- /* */
- /* <Description> */
- /* A function used to copy a glyph image. Note that the created */
- /* @FT_Glyph object must be released with @FT_Done_Glyph. */
- /* */
- /* <Input> */
- /* source :: A handle to the source glyph object. */
- /* */
- /* <Output> */
- /* target :: A handle to the target glyph object. 0~in case of */
- /* error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_Copy( FT_Glyph source,
- FT_Glyph *target );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Transform */
- /* */
- /* <Description> */
- /* Transform a glyph image if its format is scalable. */
- /* */
- /* <InOut> */
- /* glyph :: A handle to the target glyph object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to a 2x2 matrix to apply. */
- /* */
- /* delta :: A pointer to a 2d vector to apply. Coordinates are */
- /* expressed in 1/64th of a pixel. */
- /* */
- /* <Return> */
- /* FreeType error code (if not 0, the glyph format is not scalable). */
- /* */
- /* <Note> */
- /* The 2x2 transformation matrix is also applied to the glyph's */
- /* advance vector. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_Transform( FT_Glyph glyph,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Glyph_BBox_Mode */
- /* */
- /* <Description> */
- /* The mode how the values of @FT_Glyph_Get_CBox are returned. */
- /* */
- /* <Values> */
- /* FT_GLYPH_BBOX_UNSCALED :: */
- /* Return unscaled font units. */
- /* */
- /* FT_GLYPH_BBOX_SUBPIXELS :: */
- /* Return unfitted 26.6 coordinates. */
- /* */
- /* FT_GLYPH_BBOX_GRIDFIT :: */
- /* Return grid-fitted 26.6 coordinates. */
- /* */
- /* FT_GLYPH_BBOX_TRUNCATE :: */
- /* Return coordinates in integer pixels. */
- /* */
- /* FT_GLYPH_BBOX_PIXELS :: */
- /* Return grid-fitted pixel coordinates. */
- /* */
- typedef enum FT_Glyph_BBox_Mode_
- {
+} FT_OutlineGlyphRec;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Glyph */
+/* */
+/* <Description> */
+/* A function used to extract a glyph image from a slot. Note that */
+/* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
+/* */
+/* <Input> */
+/* slot :: A handle to the source glyph slot. */
+/* */
+/* <Output> */
+/* aglyph :: A handle to the glyph object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Glyph( FT_GlyphSlot slot,
+ FT_Glyph *aglyph );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Glyph_Copy */
+/* */
+/* <Description> */
+/* A function used to copy a glyph image. Note that the created */
+/* @FT_Glyph object must be released with @FT_Done_Glyph. */
+/* */
+/* <Input> */
+/* source :: A handle to the source glyph object. */
+/* */
+/* <Output> */
+/* target :: A handle to the target glyph object. 0~in case of */
+/* error. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Glyph_Copy( FT_Glyph source,
+ FT_Glyph *target );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Glyph_Transform */
+/* */
+/* <Description> */
+/* Transform a glyph image if its format is scalable. */
+/* */
+/* <InOut> */
+/* glyph :: A handle to the target glyph object. */
+/* */
+/* <Input> */
+/* matrix :: A pointer to a 2x2 matrix to apply. */
+/* */
+/* delta :: A pointer to a 2d vector to apply. Coordinates are */
+/* expressed in 1/64th of a pixel. */
+/* */
+/* <Return> */
+/* FreeType error code (if not 0, the glyph format is not scalable). */
+/* */
+/* <Note> */
+/* The 2x2 transformation matrix is also applied to the glyph's */
+/* advance vector. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Glyph_Transform( FT_Glyph glyph,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Glyph_BBox_Mode */
+/* */
+/* <Description> */
+/* The mode how the values of @FT_Glyph_Get_CBox are returned. */
+/* */
+/* <Values> */
+/* FT_GLYPH_BBOX_UNSCALED :: */
+/* Return unscaled font units. */
+/* */
+/* FT_GLYPH_BBOX_SUBPIXELS :: */
+/* Return unfitted 26.6 coordinates. */
+/* */
+/* FT_GLYPH_BBOX_GRIDFIT :: */
+/* Return grid-fitted 26.6 coordinates. */
+/* */
+/* FT_GLYPH_BBOX_TRUNCATE :: */
+/* Return coordinates in integer pixels. */
+/* */
+/* FT_GLYPH_BBOX_PIXELS :: */
+/* Return grid-fitted pixel coordinates. */
+/* */
+typedef enum FT_Glyph_BBox_Mode_ {
FT_GLYPH_BBOX_UNSCALED = 0,
FT_GLYPH_BBOX_SUBPIXELS = 0,
FT_GLYPH_BBOX_GRIDFIT = 1,
FT_GLYPH_BBOX_TRUNCATE = 2,
FT_GLYPH_BBOX_PIXELS = 3
- } FT_Glyph_BBox_Mode;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_glyph_bbox_xxx */
- /* */
- /* <Description> */
- /* These constants are deprecated. Use the corresponding */
- /* @FT_Glyph_BBox_Mode values instead. */
- /* */
- /* <Values> */
- /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
- /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
- /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
- /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
- /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
- /* */
+} FT_Glyph_BBox_Mode;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* ft_glyph_bbox_xxx */
+/* */
+/* <Description> */
+/* These constants are deprecated. Use the corresponding */
+/* @FT_Glyph_BBox_Mode values instead. */
+/* */
+/* <Values> */
+/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
+/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
+/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
+/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
+/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
+/* */
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
@@ -348,263 +344,263 @@ FT_BEGIN_HEADER
#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Get_CBox */
- /* */
- /* <Description> */
- /* Return a glyph's `control box'. The control box encloses all the */
- /* outline's points, including Bézier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* which contains Bézier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the source glyph object. */
- /* */
- /* mode :: The mode which indicates how to interpret the returned */
- /* bounding box values. */
- /* */
- /* <Output> */
- /* acbox :: The glyph coordinate bounding box. Coordinates are */
- /* expressed in 1/64th of pixels if it is grid-fitted. */
- /* */
- /* <Note> */
- /* Coordinates are relative to the glyph origin, using the y~upwards */
- /* convention. */
- /* */
- /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
- /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
- /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
- /* is another name for this constant. */
- /* */
- /* If the font is tricky and the glyph has been loaded with */
- /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
- /* reasonable values for the CBox it is necessary to load the glyph */
- /* at a large ppem value (so that the hinting instructions can */
- /* properly shift and scale the subglyphs), then extracting the CBox */
- /* which can be eventually converted back to font units. */
- /* */
- /* Note that the maximum coordinates are exclusive, which means that */
- /* one can compute the width and height of the glyph image (be it in */
- /* integer or 26.6 pixels) as: */
- /* */
- /* { */
- /* width = bbox.xMax - bbox.xMin; */
- /* height = bbox.yMax - bbox.yMin; */
- /* } */
- /* */
- /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
- /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
- /* which corresponds to: */
- /* */
- /* { */
- /* bbox.xMin = FLOOR(bbox.xMin); */
- /* bbox.yMin = FLOOR(bbox.yMin); */
- /* bbox.xMax = CEILING(bbox.xMax); */
- /* bbox.yMax = CEILING(bbox.yMax); */
- /* } */
- /* */
- /* To get the bbox in pixel coordinates, set `bbox_mode' to */
- /* @FT_GLYPH_BBOX_TRUNCATE. */
- /* */
- /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
- /* to @FT_GLYPH_BBOX_PIXELS. */
- /* */
- FT_EXPORT( void )
- FT_Glyph_Get_CBox( FT_Glyph glyph,
- FT_UInt bbox_mode,
- FT_BBox *acbox );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_To_Bitmap */
- /* */
- /* <Description> */
- /* Convert a given glyph object to a bitmap glyph object. */
- /* */
- /* <InOut> */
- /* the_glyph :: A pointer to a handle to the target glyph. */
- /* */
- /* <Input> */
- /* render_mode :: An enumeration that describes how the data is */
- /* rendered. */
- /* */
- /* origin :: A pointer to a vector used to translate the glyph */
- /* image before rendering. Can be~0 (if no */
- /* translation). The origin is expressed in */
- /* 26.6 pixels. */
- /* */
- /* destroy :: A boolean that indicates that the original glyph */
- /* image should be destroyed by this function. It is */
- /* never destroyed in case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function does nothing if the glyph format isn't scalable. */
- /* */
- /* The glyph image is translated with the `origin' vector before */
- /* rendering. */
- /* */
- /* The first parameter is a pointer to an @FT_Glyph handle, that will */
- /* be _replaced_ by this function (with newly allocated data). */
- /* Typically, you would use (omitting error handling): */
- /* */
- /* */
- /* { */
- /* FT_Glyph glyph; */
- /* FT_BitmapGlyph glyph_bitmap; */
- /* */
- /* */
- /* // load glyph */
- /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
- /* */
- /* // extract glyph image */
- /* error = FT_Get_Glyph( face->glyph, &glyph ); */
- /* */
- /* // convert to a bitmap (default render mode + destroying old) */
- /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
- /* { */
- /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
- /* 0, 1 ); */
- /* if ( error ) // `glyph' unchanged */
- /* ... */
- /* } */
- /* */
- /* // access bitmap content by typecasting */
- /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
- /* */
- /* // do funny stuff with it, like blitting/drawing */
- /* ... */
- /* */
- /* // discard glyph image (bitmap or not) */
- /* FT_Done_Glyph( glyph ); */
- /* } */
- /* */
- /* */
- /* Here another example, again without error handling: */
- /* */
- /* */
- /* { */
- /* FT_Glyph glyphs[MAX_GLYPHS] */
- /* */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
- /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* { */
- /* FT_Glyph bitmap = glyphs[idx]; */
- /* */
- /* */
- /* ... */
- /* */
- /* // after this call, `bitmap' no longer points into */
- /* // the `glyphs' array (and the old value isn't destroyed) */
- /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
- /* */
- /* ... */
- /* */
- /* FT_Done_Glyph( bitmap ); */
- /* } */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* FT_Done_Glyph( glyphs[idx] ); */
- /* } */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
- FT_Render_Mode render_mode,
- FT_Vector* origin,
- FT_Bool destroy );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Glyph */
- /* */
- /* <Description> */
- /* Destroy a given glyph. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the target glyph object. */
- /* */
- FT_EXPORT( void )
- FT_Done_Glyph( FT_Glyph glyph );
-
- /* */
-
-
- /* other helpful functions */
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Multiply */
- /* */
- /* <Description> */
- /* Perform the matrix operation `b = a*b'. */
- /* */
- /* <Input> */
- /* a :: A pointer to matrix `a'. */
- /* */
- /* <InOut> */
- /* b :: A pointer to matrix `b'. */
- /* */
- /* <Note> */
- /* The result is undefined if either `a' or `b' is zero. */
- /* */
- FT_EXPORT( void )
- FT_Matrix_Multiply( const FT_Matrix* a,
- FT_Matrix* b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Invert */
- /* */
- /* <Description> */
- /* Invert a 2x2 matrix. Return an error if it can't be inverted. */
- /* */
- /* <InOut> */
- /* matrix :: A pointer to the target matrix. Remains untouched in */
- /* case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Matrix_Invert( FT_Matrix* matrix );
-
-
- /* */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Glyph_Get_CBox */
+/* */
+/* <Description> */
+/* Return a glyph's `control box'. The control box encloses all the */
+/* outline's points, including Bézier control points. Though it */
+/* coincides with the exact bounding box for most glyphs, it can be */
+/* slightly larger in some situations (like when rotating an outline */
+/* which contains Bézier outside arcs). */
+/* */
+/* Computing the control box is very fast, while getting the bounding */
+/* box can take much more time as it needs to walk over all segments */
+/* and arcs in the outline. To get the latter, you can use the */
+/* `ftbbox' component which is dedicated to this single task. */
+/* */
+/* <Input> */
+/* glyph :: A handle to the source glyph object. */
+/* */
+/* mode :: The mode which indicates how to interpret the returned */
+/* bounding box values. */
+/* */
+/* <Output> */
+/* acbox :: The glyph coordinate bounding box. Coordinates are */
+/* expressed in 1/64th of pixels if it is grid-fitted. */
+/* */
+/* <Note> */
+/* Coordinates are relative to the glyph origin, using the y~upwards */
+/* convention. */
+/* */
+/* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
+/* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
+/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
+/* is another name for this constant. */
+/* */
+/* If the font is tricky and the glyph has been loaded with */
+/* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
+/* reasonable values for the CBox it is necessary to load the glyph */
+/* at a large ppem value (so that the hinting instructions can */
+/* properly shift and scale the subglyphs), then extracting the CBox */
+/* which can be eventually converted back to font units. */
+/* */
+/* Note that the maximum coordinates are exclusive, which means that */
+/* one can compute the width and height of the glyph image (be it in */
+/* integer or 26.6 pixels) as: */
+/* */
+/* { */
+/* width = bbox.xMax - bbox.xMin; */
+/* height = bbox.yMax - bbox.yMin; */
+/* } */
+/* */
+/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
+/* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
+/* which corresponds to: */
+/* */
+/* { */
+/* bbox.xMin = FLOOR(bbox.xMin); */
+/* bbox.yMin = FLOOR(bbox.yMin); */
+/* bbox.xMax = CEILING(bbox.xMax); */
+/* bbox.yMax = CEILING(bbox.yMax); */
+/* } */
+/* */
+/* To get the bbox in pixel coordinates, set `bbox_mode' to */
+/* @FT_GLYPH_BBOX_TRUNCATE. */
+/* */
+/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
+/* to @FT_GLYPH_BBOX_PIXELS. */
+/* */
+FT_EXPORT( void )
+FT_Glyph_Get_CBox( FT_Glyph glyph,
+ FT_UInt bbox_mode,
+ FT_BBox *acbox );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Glyph_To_Bitmap */
+/* */
+/* <Description> */
+/* Convert a given glyph object to a bitmap glyph object. */
+/* */
+/* <InOut> */
+/* the_glyph :: A pointer to a handle to the target glyph. */
+/* */
+/* <Input> */
+/* render_mode :: An enumeration that describes how the data is */
+/* rendered. */
+/* */
+/* origin :: A pointer to a vector used to translate the glyph */
+/* image before rendering. Can be~0 (if no */
+/* translation). The origin is expressed in */
+/* 26.6 pixels. */
+/* */
+/* destroy :: A boolean that indicates that the original glyph */
+/* image should be destroyed by this function. It is */
+/* never destroyed in case of error. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function does nothing if the glyph format isn't scalable. */
+/* */
+/* The glyph image is translated with the `origin' vector before */
+/* rendering. */
+/* */
+/* The first parameter is a pointer to an @FT_Glyph handle, that will */
+/* be _replaced_ by this function (with newly allocated data). */
+/* Typically, you would use (omitting error handling): */
+/* */
+/* */
+/* { */
+/* FT_Glyph glyph; */
+/* FT_BitmapGlyph glyph_bitmap; */
+/* */
+/* */
+/* // load glyph */
+/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
+/* */
+/* // extract glyph image */
+/* error = FT_Get_Glyph( face->glyph, &glyph ); */
+/* */
+/* // convert to a bitmap (default render mode + destroying old) */
+/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
+/* { */
+/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
+/* 0, 1 ); */
+/* if ( error ) // `glyph' unchanged */
+/* ... */
+/* } */
+/* */
+/* // access bitmap content by typecasting */
+/* glyph_bitmap = (FT_BitmapGlyph)glyph; */
+/* */
+/* // do funny stuff with it, like blitting/drawing */
+/* ... */
+/* */
+/* // discard glyph image (bitmap or not) */
+/* FT_Done_Glyph( glyph ); */
+/* } */
+/* */
+/* */
+/* Here another example, again without error handling: */
+/* */
+/* */
+/* { */
+/* FT_Glyph glyphs[MAX_GLYPHS] */
+/* */
+/* */
+/* ... */
+/* */
+/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+/* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
+/* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
+/* */
+/* ... */
+/* */
+/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+/* { */
+/* FT_Glyph bitmap = glyphs[idx]; */
+/* */
+/* */
+/* ... */
+/* */
+/* // after this call, `bitmap' no longer points into */
+/* // the `glyphs' array (and the old value isn't destroyed) */
+/* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
+/* */
+/* ... */
+/* */
+/* FT_Done_Glyph( bitmap ); */
+/* } */
+/* */
+/* ... */
+/* */
+/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+/* FT_Done_Glyph( glyphs[idx] ); */
+/* } */
+/* */
+FT_EXPORT( FT_Error )
+FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
+ FT_Render_Mode render_mode,
+ FT_Vector* origin,
+ FT_Bool destroy );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Done_Glyph */
+/* */
+/* <Description> */
+/* Destroy a given glyph. */
+/* */
+/* <Input> */
+/* glyph :: A handle to the target glyph object. */
+/* */
+FT_EXPORT( void )
+FT_Done_Glyph( FT_Glyph glyph );
+
+/* */
+
+
+/* other helpful functions */
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* computations */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Matrix_Multiply */
+/* */
+/* <Description> */
+/* Perform the matrix operation `b = a*b'. */
+/* */
+/* <Input> */
+/* a :: A pointer to matrix `a'. */
+/* */
+/* <InOut> */
+/* b :: A pointer to matrix `b'. */
+/* */
+/* <Note> */
+/* The result is undefined if either `a' or `b' is zero. */
+/* */
+FT_EXPORT( void )
+FT_Matrix_Multiply( const FT_Matrix* a,
+ FT_Matrix* b );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Matrix_Invert */
+/* */
+/* <Description> */
+/* Invert a 2x2 matrix. Return an error if it can't be inverted. */
+/* */
+/* <InOut> */
+/* matrix :: A pointer to the target matrix. Remains untouched in */
+/* case of error. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Matrix_Invert( FT_Matrix* matrix );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgxval.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgxval.h
index 497015c..a56ca6d 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgxval.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgxval.h
@@ -41,33 +41,33 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* gx_validation */
- /* */
- /* <Title> */
- /* TrueTypeGX/AAT Validation */
- /* */
- /* <Abstract> */
- /* An API to validate TrueTypeGX/AAT tables. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions to validate */
- /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
- /* trak, prop, lcar). */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* */
- /* Warning: Use FT_VALIDATE_XXX to validate a table. */
- /* Following definitions are for gxvalid developers. */
- /* */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* gx_validation */
+/* */
+/* <Title> */
+/* TrueTypeGX/AAT Validation */
+/* */
+/* <Abstract> */
+/* An API to validate TrueTypeGX/AAT tables. */
+/* */
+/* <Description> */
+/* This section contains the declaration of functions to validate */
+/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
+/* trak, prop, lcar). */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* */
+/* Warning: Use FT_VALIDATE_XXX to validate a table. */
+/* Following definitions are for gxvalid developers. */
+/* */
+/* */
+/*************************************************************************/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
@@ -82,71 +82,71 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
- /*************************************************************************
- *
- * @macro:
- * FT_VALIDATE_GX_LENGTH
- *
- * @description:
- * The number of tables checked in this module. Use it as a parameter
- * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_VALIDATE_GX_LENGTH
+ *
+ * @description:
+ * The number of tables checked in this module. Use it as a parameter
+ * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
+ */
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
- /* */
+/* */
- /* Up to 0x1000 is used by otvalid.
- Ox2xxx is reserved for feature OT extension. */
+/* Up to 0x1000 is used by otvalid.
+ Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_GXXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
- * indicate which TrueTypeGX/AAT Type tables should be validated.
- *
- * @values:
- * FT_VALIDATE_feat ::
- * Validate `feat' table.
- *
- * FT_VALIDATE_mort ::
- * Validate `mort' table.
- *
- * FT_VALIDATE_morx ::
- * Validate `morx' table.
- *
- * FT_VALIDATE_bsln ::
- * Validate `bsln' table.
- *
- * FT_VALIDATE_just ::
- * Validate `just' table.
- *
- * FT_VALIDATE_kern ::
- * Validate `kern' table.
- *
- * FT_VALIDATE_opbd ::
- * Validate `opbd' table.
- *
- * FT_VALIDATE_trak ::
- * Validate `trak' table.
- *
- * FT_VALIDATE_prop ::
- * Validate `prop' table.
- *
- * FT_VALIDATE_lcar ::
- * Validate `lcar' table.
- *
- * FT_VALIDATE_GX ::
- * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
- * opbd, trak, prop and lcar).
- *
- */
+/**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_GXXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
+ * indicate which TrueTypeGX/AAT Type tables should be validated.
+ *
+ * @values:
+ * FT_VALIDATE_feat ::
+ * Validate `feat' table.
+ *
+ * FT_VALIDATE_mort ::
+ * Validate `mort' table.
+ *
+ * FT_VALIDATE_morx ::
+ * Validate `morx' table.
+ *
+ * FT_VALIDATE_bsln ::
+ * Validate `bsln' table.
+ *
+ * FT_VALIDATE_just ::
+ * Validate `just' table.
+ *
+ * FT_VALIDATE_kern ::
+ * Validate `kern' table.
+ *
+ * FT_VALIDATE_opbd ::
+ * Validate `opbd' table.
+ *
+ * FT_VALIDATE_trak ::
+ * Validate `trak' table.
+ *
+ * FT_VALIDATE_prop ::
+ * Validate `prop' table.
+ *
+ * FT_VALIDATE_lcar ::
+ * Validate `lcar' table.
+ *
+ * FT_VALIDATE_GX ::
+ * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
+ * opbd, trak, prop and lcar).
+ *
+ */
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
@@ -171,183 +171,183 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar )
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_TrueTypeGX_Validate
- *
- * @description:
- * Validate various TrueTypeGX tables to assure that all offsets and
- * indices are valid. The idea is that a higher-level library which
- * actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field which specifies the tables to be validated. See
- * @FT_VALIDATE_GXXXX for possible values.
- *
- * table_length ::
- * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
- * should be passed.
- *
- * @output:
- * tables ::
- * The array where all validated sfnt tables are stored.
- * The array itself must be allocated by a client.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with TrueTypeGX fonts, returning an error
- * otherwise.
- *
- * After use, the application should deallocate the buffers pointed to by
- * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
- * indicates that the table either doesn't exist in the font, the
- * application hasn't asked for validation, or the validator doesn't have
- * the ability to validate the sfnt table.
- */
- FT_EXPORT( FT_Error )
- FT_TrueTypeGX_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length );
-
-
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_TrueTypeGX_Free
- *
- * @description:
- * Free the buffer allocated by TrueTypeGX validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer allocated by
- * @FT_TrueTypeGX_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_TrueTypeGX_Validate only.
- */
- FT_EXPORT( void )
- FT_TrueTypeGX_Free( FT_Face face,
- FT_Bytes table );
-
-
- /* */
-
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_CKERNXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_ClassicKern_Validate
- * to indicate the classic kern dialect or dialects. If the selected
- * type doesn't fit, @FT_ClassicKern_Validate regards the table as
- * invalid.
- *
- * @values:
- * FT_VALIDATE_MS ::
- * Handle the `kern' table as a classic Microsoft kern table.
- *
- * FT_VALIDATE_APPLE ::
- * Handle the `kern' table as a classic Apple kern table.
- *
- * FT_VALIDATE_CKERN ::
- * Handle the `kern' as either classic Apple or Microsoft kern table.
- */
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_TrueTypeGX_Validate
+ *
+ * @description:
+ * Validate various TrueTypeGX tables to assure that all offsets and
+ * indices are valid. The idea is that a higher-level library which
+ * actually does the text layout can access those tables without
+ * error checking (which can be quite time consuming).
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field which specifies the tables to be validated. See
+ * @FT_VALIDATE_GXXXX for possible values.
+ *
+ * table_length ::
+ * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
+ * should be passed.
+ *
+ * @output:
+ * tables ::
+ * The array where all validated sfnt tables are stored.
+ * The array itself must be allocated by a client.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with TrueTypeGX fonts, returning an error
+ * otherwise.
+ *
+ * After use, the application should deallocate the buffers pointed to by
+ * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
+ * indicates that the table either doesn't exist in the font, the
+ * application hasn't asked for validation, or the validator doesn't have
+ * the ability to validate the sfnt table.
+ */
+FT_EXPORT( FT_Error )
+FT_TrueTypeGX_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length );
+
+
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_TrueTypeGX_Free
+ *
+ * @description:
+ * Free the buffer allocated by TrueTypeGX validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer allocated by
+ * @FT_TrueTypeGX_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_TrueTypeGX_Validate only.
+ */
+FT_EXPORT( void )
+FT_TrueTypeGX_Free( FT_Face face,
+ FT_Bytes table );
+
+
+/* */
+
+/**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_CKERNXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_ClassicKern_Validate
+ * to indicate the classic kern dialect or dialects. If the selected
+ * type doesn't fit, @FT_ClassicKern_Validate regards the table as
+ * invalid.
+ *
+ * @values:
+ * FT_VALIDATE_MS ::
+ * Handle the `kern' table as a classic Microsoft kern table.
+ *
+ * FT_VALIDATE_APPLE ::
+ * Handle the `kern' table as a classic Apple kern table.
+ *
+ * FT_VALIDATE_CKERN ::
+ * Handle the `kern' as either classic Apple or Microsoft kern table.
+ */
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_ClassicKern_Validate
- *
- * @description:
- * Validate classic (16-bit format) kern table to assure that the offsets
- * and indices are valid. The idea is that a higher-level library which
- * actually does the text layout can access those tables without error
- * checking (which can be quite time consuming).
- *
- * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
- * the new 32-bit format and the classic 16-bit format, while
- * FT_ClassicKern_Validate only supports the classic 16-bit format.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field which specifies the dialect to be validated. See
- * @FT_VALIDATE_CKERNXXX for possible values.
- *
- * @output:
- * ckern_table ::
- * A pointer to the kern table.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * After use, the application should deallocate the buffers pointed to by
- * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
- * indicates that the table doesn't exist in the font.
- */
- FT_EXPORT( FT_Error )
- FT_ClassicKern_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *ckern_table );
-
-
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_ClassicKern_Free
- *
- * @description:
- * Free the buffer allocated by classic Kern validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer that is allocated by
- * @FT_ClassicKern_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_ClassicKern_Validate only.
- */
- FT_EXPORT( void )
- FT_ClassicKern_Free( FT_Face face,
- FT_Bytes table );
-
-
- /* */
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_ClassicKern_Validate
+ *
+ * @description:
+ * Validate classic (16-bit format) kern table to assure that the offsets
+ * and indices are valid. The idea is that a higher-level library which
+ * actually does the text layout can access those tables without error
+ * checking (which can be quite time consuming).
+ *
+ * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
+ * the new 32-bit format and the classic 16-bit format, while
+ * FT_ClassicKern_Validate only supports the classic 16-bit format.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field which specifies the dialect to be validated. See
+ * @FT_VALIDATE_CKERNXXX for possible values.
+ *
+ * @output:
+ * ckern_table ::
+ * A pointer to the kern table.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * After use, the application should deallocate the buffers pointed to by
+ * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
+ * indicates that the table doesn't exist in the font.
+ */
+FT_EXPORT( FT_Error )
+FT_ClassicKern_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *ckern_table );
+
+
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_ClassicKern_Free
+ *
+ * @description:
+ * Free the buffer allocated by classic Kern validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * @FT_ClassicKern_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_ClassicKern_Validate only.
+ */
+FT_EXPORT( void )
+FT_ClassicKern_Free( FT_Face face,
+ FT_Bytes table );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgzip.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgzip.h
index acbc4f0..09838d0 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftgzip.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftgzip.h
@@ -31,67 +31,67 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* gzip */
- /* */
- /* <Title> */
- /* GZIP Streams */
- /* */
- /* <Abstract> */
- /* Using gzip-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Gzip-specific functions. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* gzip */
+/* */
+/* <Title> */
+/* GZIP Streams */
+/* */
+/* <Abstract> */
+/* Using gzip-compressed font files. */
+/* */
+/* <Description> */
+/* This section contains the declaration of Gzip-specific functions. */
+/* */
+/*************************************************************************/
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenGzip
- *
- * @description:
- * Open a new stream to parse gzip-compressed font files. This is
- * mainly used to support the compressed `*.pcf.gz' fonts that come
- * with XFree86.
- *
- * @input:
- * stream ::
- * The target embedding stream.
- *
- * source ::
- * The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream.
- *
- * In certain builds of the library, gzip compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a gzipped stream from
- * it and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with zlib support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenGzip( FT_Stream stream,
- FT_Stream source );
+/************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenGzip
+ *
+ * @description:
+ * Open a new stream to parse gzip-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.gz' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream ::
+ * The target embedding stream.
+ *
+ * source ::
+ * The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream.
+ *
+ * In certain builds of the library, gzip compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a gzipped stream from
+ * it and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with zlib support.
+ */
+FT_EXPORT( FT_Error )
+FT_Stream_OpenGzip( FT_Stream stream,
+ FT_Stream source );
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftimage.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftimage.h
index 7834303..1766702 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftimage.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftimage.h
@@ -17,19 +17,19 @@
/* */
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* Note: A `raster' is simply a scan-line converter, used to render */
- /* FT_Outlines into FT_Bitmaps. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* Note: A `raster' is simply a scan-line converter, used to render */
+/* FT_Outlines into FT_Bitmaps. */
+/* */
+/*************************************************************************/
#ifndef __FTIMAGE_H__
#define __FTIMAGE_H__
- /* _STANDALONE_ is from ftgrays.c */
+/* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
#include <ft2build.h>
#endif
@@ -38,139 +38,136 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pos */
- /* */
- /* <Description> */
- /* The type FT_Pos is used to store vectorial coordinates. Depending */
- /* on the context, these can represent distances in integer font */
- /* units, or 16.16, or 26.6 fixed-point pixel coordinates. */
- /* */
- typedef signed long FT_Pos;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Vector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2D vector; coordinates are of */
- /* the FT_Pos type. */
- /* */
- /* <Fields> */
- /* x :: The horizontal coordinate. */
- /* y :: The vertical coordinate. */
- /* */
- typedef struct FT_Vector_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* basic_types */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Pos */
+/* */
+/* <Description> */
+/* The type FT_Pos is used to store vectorial coordinates. Depending */
+/* on the context, these can represent distances in integer font */
+/* units, or 16.16, or 26.6 fixed-point pixel coordinates. */
+/* */
+typedef signed long FT_Pos;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Vector */
+/* */
+/* <Description> */
+/* A simple structure used to store a 2D vector; coordinates are of */
+/* the FT_Pos type. */
+/* */
+/* <Fields> */
+/* x :: The horizontal coordinate. */
+/* y :: The vertical coordinate. */
+/* */
+typedef struct FT_Vector_ {
FT_Pos x;
FT_Pos y;
- } FT_Vector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_BBox */
- /* */
- /* <Description> */
- /* A structure used to hold an outline's bounding box, i.e., the */
- /* coordinates of its extrema in the horizontal and vertical */
- /* directions. */
- /* */
- /* <Fields> */
- /* xMin :: The horizontal minimum (left-most). */
- /* */
- /* yMin :: The vertical minimum (bottom-most). */
- /* */
- /* xMax :: The horizontal maximum (right-most). */
- /* */
- /* yMax :: The vertical maximum (top-most). */
- /* */
- /* <Note> */
- /* The bounding box is specified with the coordinates of the lower */
- /* left and the upper right corner. In PostScript, those values are */
- /* often called (llx,lly) and (urx,ury), respectively. */
- /* */
- /* If `yMin' is negative, this value gives the glyph's descender. */
- /* Otherwise, the glyph doesn't descend below the baseline. */
- /* Similarly, if `ymax' is positive, this value gives the glyph's */
- /* ascender. */
- /* */
- /* `xMin' gives the horizontal distance from the glyph's origin to */
- /* the left edge of the glyph's bounding box. If `xMin' is negative, */
- /* the glyph extends to the left of the origin. */
- /* */
- typedef struct FT_BBox_
- {
+} FT_Vector;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_BBox */
+/* */
+/* <Description> */
+/* A structure used to hold an outline's bounding box, i.e., the */
+/* coordinates of its extrema in the horizontal and vertical */
+/* directions. */
+/* */
+/* <Fields> */
+/* xMin :: The horizontal minimum (left-most). */
+/* */
+/* yMin :: The vertical minimum (bottom-most). */
+/* */
+/* xMax :: The horizontal maximum (right-most). */
+/* */
+/* yMax :: The vertical maximum (top-most). */
+/* */
+/* <Note> */
+/* The bounding box is specified with the coordinates of the lower */
+/* left and the upper right corner. In PostScript, those values are */
+/* often called (llx,lly) and (urx,ury), respectively. */
+/* */
+/* If `yMin' is negative, this value gives the glyph's descender. */
+/* Otherwise, the glyph doesn't descend below the baseline. */
+/* Similarly, if `ymax' is positive, this value gives the glyph's */
+/* ascender. */
+/* */
+/* `xMin' gives the horizontal distance from the glyph's origin to */
+/* the left edge of the glyph's bounding box. If `xMin' is negative, */
+/* the glyph extends to the left of the origin. */
+/* */
+typedef struct FT_BBox_ {
FT_Pos xMin, yMin;
FT_Pos xMax, yMax;
- } FT_BBox;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Pixel_Mode */
- /* */
- /* <Description> */
- /* An enumeration type used to describe the format of pixels in a */
- /* given bitmap. Note that additional formats may be added in the */
- /* future. */
- /* */
- /* <Values> */
- /* FT_PIXEL_MODE_NONE :: */
- /* Value~0 is reserved. */
- /* */
- /* FT_PIXEL_MODE_MONO :: */
- /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */
- /* are stored in most-significant order (MSB), which means that */
- /* the left-most pixel in a byte has value 128. */
- /* */
- /* FT_PIXEL_MODE_GRAY :: */
- /* An 8-bit bitmap, generally used to represent anti-aliased glyph */
- /* images. Each pixel is stored in one byte. Note that the number */
- /* of `gray' levels is stored in the `num_grays' field of the */
- /* @FT_Bitmap structure (it generally is 256). */
- /* */
- /* FT_PIXEL_MODE_GRAY2 :: */
- /* A 2-bit per pixel bitmap, used to represent embedded */
- /* anti-aliased bitmaps in font files according to the OpenType */
- /* specification. We haven't found a single font using this */
- /* format, however. */
- /* */
- /* FT_PIXEL_MODE_GRAY4 :: */
- /* A 4-bit per pixel bitmap, representing embedded anti-aliased */
- /* bitmaps in font files according to the OpenType specification. */
- /* We haven't found a single font using this format, however. */
- /* */
- /* FT_PIXEL_MODE_LCD :: */
- /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
- /* used for display on LCD displays; the bitmap is three times */
- /* wider than the original glyph image. See also */
- /* @FT_RENDER_MODE_LCD. */
- /* */
- /* FT_PIXEL_MODE_LCD_V :: */
- /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
- /* used for display on rotated LCD displays; the bitmap is three */
- /* times taller than the original glyph image. See also */
- /* @FT_RENDER_MODE_LCD_V. */
- /* */
- typedef enum FT_Pixel_Mode_
- {
+} FT_BBox;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Pixel_Mode */
+/* */
+/* <Description> */
+/* An enumeration type used to describe the format of pixels in a */
+/* given bitmap. Note that additional formats may be added in the */
+/* future. */
+/* */
+/* <Values> */
+/* FT_PIXEL_MODE_NONE :: */
+/* Value~0 is reserved. */
+/* */
+/* FT_PIXEL_MODE_MONO :: */
+/* A monochrome bitmap, using 1~bit per pixel. Note that pixels */
+/* are stored in most-significant order (MSB), which means that */
+/* the left-most pixel in a byte has value 128. */
+/* */
+/* FT_PIXEL_MODE_GRAY :: */
+/* An 8-bit bitmap, generally used to represent anti-aliased glyph */
+/* images. Each pixel is stored in one byte. Note that the number */
+/* of `gray' levels is stored in the `num_grays' field of the */
+/* @FT_Bitmap structure (it generally is 256). */
+/* */
+/* FT_PIXEL_MODE_GRAY2 :: */
+/* A 2-bit per pixel bitmap, used to represent embedded */
+/* anti-aliased bitmaps in font files according to the OpenType */
+/* specification. We haven't found a single font using this */
+/* format, however. */
+/* */
+/* FT_PIXEL_MODE_GRAY4 :: */
+/* A 4-bit per pixel bitmap, representing embedded anti-aliased */
+/* bitmaps in font files according to the OpenType specification. */
+/* We haven't found a single font using this format, however. */
+/* */
+/* FT_PIXEL_MODE_LCD :: */
+/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
+/* used for display on LCD displays; the bitmap is three times */
+/* wider than the original glyph image. See also */
+/* @FT_RENDER_MODE_LCD. */
+/* */
+/* FT_PIXEL_MODE_LCD_V :: */
+/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
+/* used for display on rotated LCD displays; the bitmap is three */
+/* times taller than the original glyph image. See also */
+/* @FT_RENDER_MODE_LCD_V. */
+/* */
+typedef enum FT_Pixel_Mode_ {
FT_PIXEL_MODE_NONE = 0,
FT_PIXEL_MODE_MONO,
FT_PIXEL_MODE_GRAY,
@@ -181,134 +178,132 @@ FT_BEGIN_HEADER
FT_PIXEL_MODE_MAX /* do not remove */
- } FT_Pixel_Mode;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_pixel_mode_xxx */
- /* */
- /* <Description> */
- /* A list of deprecated constants. Use the corresponding */
- /* @FT_Pixel_Mode values instead. */
- /* */
- /* <Values> */
- /* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
- /* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
- /* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
- /* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
- /* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
- /* */
+} FT_Pixel_Mode;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* ft_pixel_mode_xxx */
+/* */
+/* <Description> */
+/* A list of deprecated constants. Use the corresponding */
+/* @FT_Pixel_Mode values instead. */
+/* */
+/* <Values> */
+/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
+/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
+/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
+/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
+/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
+/* */
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
- /* */
+/* */
#if 0
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Palette_Mode */
- /* */
- /* <Description> */
- /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
- /* */
- /* An enumeration type to describe the format of a bitmap palette, */
- /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
- /* */
- /* <Values> */
- /* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */
- /* records. */
- /* */
- /* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */
- /* records. */
- /* */
- /* <Note> */
- /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
- /* FreeType, these types are not handled by the library itself. */
- /* */
- typedef enum FT_Palette_Mode_
- {
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Palette_Mode */
+/* */
+/* <Description> */
+/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
+/* */
+/* An enumeration type to describe the format of a bitmap palette, */
+/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
+/* */
+/* <Values> */
+/* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */
+/* records. */
+/* */
+/* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */
+/* records. */
+/* */
+/* <Note> */
+/* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
+/* FreeType, these types are not handled by the library itself. */
+/* */
+typedef enum FT_Palette_Mode_ {
ft_palette_mode_rgb = 0,
ft_palette_mode_rgba,
ft_palette_mode_max /* do not remove */
- } FT_Palette_Mode;
+} FT_Palette_Mode;
- /* */
+/* */
#endif
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap */
- /* */
- /* <Description> */
- /* A structure used to describe a bitmap or pixmap to the raster. */
- /* Note that we now manage pixmaps of various depths through the */
- /* `pixel_mode' field. */
- /* */
- /* <Fields> */
- /* rows :: The number of bitmap rows. */
- /* */
- /* width :: The number of pixels in bitmap row. */
- /* */
- /* pitch :: The pitch's absolute value is the number of bytes */
- /* taken by one bitmap row, including padding. */
- /* However, the pitch is positive when the bitmap has */
- /* a `down' flow, and negative when it has an `up' */
- /* flow. In all cases, the pitch is an offset to add */
- /* to a bitmap pointer in order to go down one row. */
- /* */
- /* Note that `padding' means the alignment of a */
- /* bitmap to a byte border, and FreeType functions */
- /* normally align to the smallest possible integer */
- /* value. */
- /* */
- /* For the B/W rasterizer, `pitch' is always an even */
- /* number. */
- /* */
- /* To change the pitch of a bitmap (say, to make it a */
- /* multiple of 4), use @FT_Bitmap_Convert. */
- /* Alternatively, you might use callback functions to */
- /* directly render to the application's surface; see */
- /* the file `example2.cpp' in the tutorial for a */
- /* demonstration. */
- /* */
- /* buffer :: A typeless pointer to the bitmap buffer. This */
- /* value should be aligned on 32-bit boundaries in */
- /* most cases. */
- /* */
- /* num_grays :: This field is only used with */
- /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
- /* levels used in the bitmap. */
- /* */
- /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
- /* See @FT_Pixel_Mode for possible values. */
- /* */
- /* palette_mode :: This field is intended for paletted pixel modes; */
- /* it indicates how the palette is stored. Not */
- /* used currently. */
- /* */
- /* palette :: A typeless pointer to the bitmap palette; this */
- /* field is intended for paletted pixel modes. Not */
- /* used currently. */
- /* */
- /* <Note> */
- /* For now, the only pixel modes supported by FreeType are mono and */
- /* grays. However, drivers might be added in the future to support */
- /* more `colorful' options. */
- /* */
- typedef struct FT_Bitmap_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Bitmap */
+/* */
+/* <Description> */
+/* A structure used to describe a bitmap or pixmap to the raster. */
+/* Note that we now manage pixmaps of various depths through the */
+/* `pixel_mode' field. */
+/* */
+/* <Fields> */
+/* rows :: The number of bitmap rows. */
+/* */
+/* width :: The number of pixels in bitmap row. */
+/* */
+/* pitch :: The pitch's absolute value is the number of bytes */
+/* taken by one bitmap row, including padding. */
+/* However, the pitch is positive when the bitmap has */
+/* a `down' flow, and negative when it has an `up' */
+/* flow. In all cases, the pitch is an offset to add */
+/* to a bitmap pointer in order to go down one row. */
+/* */
+/* Note that `padding' means the alignment of a */
+/* bitmap to a byte border, and FreeType functions */
+/* normally align to the smallest possible integer */
+/* value. */
+/* */
+/* For the B/W rasterizer, `pitch' is always an even */
+/* number. */
+/* */
+/* To change the pitch of a bitmap (say, to make it a */
+/* multiple of 4), use @FT_Bitmap_Convert. */
+/* Alternatively, you might use callback functions to */
+/* directly render to the application's surface; see */
+/* the file `example2.cpp' in the tutorial for a */
+/* demonstration. */
+/* */
+/* buffer :: A typeless pointer to the bitmap buffer. This */
+/* value should be aligned on 32-bit boundaries in */
+/* most cases. */
+/* */
+/* num_grays :: This field is only used with */
+/* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
+/* levels used in the bitmap. */
+/* */
+/* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
+/* See @FT_Pixel_Mode for possible values. */
+/* */
+/* palette_mode :: This field is intended for paletted pixel modes; */
+/* it indicates how the palette is stored. Not */
+/* used currently. */
+/* */
+/* palette :: A typeless pointer to the bitmap palette; this */
+/* field is intended for paletted pixel modes. Not */
+/* used currently. */
+/* */
+/* <Note> */
+/* For now, the only pixel modes supported by FreeType are mono and */
+/* grays. However, drivers might be added in the future to support */
+/* more `colorful' options. */
+/* */
+typedef struct FT_Bitmap_ {
int rows;
int width;
int pitch;
@@ -318,70 +313,69 @@ FT_BEGIN_HEADER
char palette_mode;
void* palette;
- } FT_Bitmap;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline */
- /* */
- /* <Description> */
- /* This structure is used to describe an outline to the scan-line */
- /* converter. */
- /* */
- /* <Fields> */
- /* n_contours :: The number of contours in the outline. */
- /* */
- /* n_points :: The number of points in the outline. */
- /* */
- /* points :: A pointer to an array of `n_points' @FT_Vector */
- /* elements, giving the outline's point coordinates. */
- /* */
- /* tags :: A pointer to an array of `n_points' chars, giving */
- /* each outline point's type. */
- /* */
- /* If bit~0 is unset, the point is `off' the curve, */
- /* i.e., a Bézier control point, while it is `on' if */
- /* set. */
- /* */
- /* Bit~1 is meaningful for `off' points only. If set, */
- /* it indicates a third-order Bézier arc control point; */
- /* and a second-order control point if unset. */
- /* */
- /* If bit~2 is set, bits 5-7 contain the drop-out mode */
- /* (as defined in the OpenType specification; the value */
- /* is the same as the argument to the SCANMODE */
- /* instruction). */
- /* */
- /* Bits 3 and~4 are reserved for internal purposes. */
- /* */
- /* contours :: An array of `n_contours' shorts, giving the end */
- /* point of each contour within the outline. For */
- /* example, the first contour is defined by the points */
- /* `0' to `contours[0]', the second one is defined by */
- /* the points `contours[0]+1' to `contours[1]', etc. */
- /* */
- /* flags :: A set of bit flags used to characterize the outline */
- /* and give hints to the scan-converter and hinter on */
- /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
- /* */
- /* <Note> */
- /* The B/W rasterizer only checks bit~2 in the `tags' array for the */
- /* first point of each contour. The drop-out mode as given with */
- /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
- /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
- /* */
- typedef struct FT_Outline_
- {
+} FT_Bitmap;
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* outline_processing */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Outline */
+/* */
+/* <Description> */
+/* This structure is used to describe an outline to the scan-line */
+/* converter. */
+/* */
+/* <Fields> */
+/* n_contours :: The number of contours in the outline. */
+/* */
+/* n_points :: The number of points in the outline. */
+/* */
+/* points :: A pointer to an array of `n_points' @FT_Vector */
+/* elements, giving the outline's point coordinates. */
+/* */
+/* tags :: A pointer to an array of `n_points' chars, giving */
+/* each outline point's type. */
+/* */
+/* If bit~0 is unset, the point is `off' the curve, */
+/* i.e., a Bézier control point, while it is `on' if */
+/* set. */
+/* */
+/* Bit~1 is meaningful for `off' points only. If set, */
+/* it indicates a third-order Bézier arc control point; */
+/* and a second-order control point if unset. */
+/* */
+/* If bit~2 is set, bits 5-7 contain the drop-out mode */
+/* (as defined in the OpenType specification; the value */
+/* is the same as the argument to the SCANMODE */
+/* instruction). */
+/* */
+/* Bits 3 and~4 are reserved for internal purposes. */
+/* */
+/* contours :: An array of `n_contours' shorts, giving the end */
+/* point of each contour within the outline. For */
+/* example, the first contour is defined by the points */
+/* `0' to `contours[0]', the second one is defined by */
+/* the points `contours[0]+1' to `contours[1]', etc. */
+/* */
+/* flags :: A set of bit flags used to characterize the outline */
+/* and give hints to the scan-converter and hinter on */
+/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
+/* */
+/* <Note> */
+/* The B/W rasterizer only checks bit~2 in the `tags' array for the */
+/* first point of each contour. The drop-out mode as given with */
+/* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
+/* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
+/* */
+typedef struct FT_Outline_ {
short n_contours; /* number of contours in glyph */
short n_points; /* number of points in the glyph */
@@ -391,86 +385,86 @@ FT_BEGIN_HEADER
int flags; /* outline masks */
- } FT_Outline;
+} FT_Outline;
- /* Following limits must be consistent with */
- /* FT_Outline.{n_contours,n_points} */
+/* Following limits must be consistent with */
+/* FT_Outline.{n_contours,n_points} */
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
#define FT_OUTLINE_POINTS_MAX SHRT_MAX
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_OUTLINE_FLAGS */
- /* */
- /* <Description> */
- /* A list of bit-field constants use for the flags in an outline's */
- /* `flags' field. */
- /* */
- /* <Values> */
- /* FT_OUTLINE_NONE :: */
- /* Value~0 is reserved. */
- /* */
- /* FT_OUTLINE_OWNER :: */
- /* If set, this flag indicates that the outline's field arrays */
- /* (i.e., `points', `flags', and `contours') are `owned' by the */
- /* outline object, and should thus be freed when it is destroyed. */
- /* */
- /* FT_OUTLINE_EVEN_ODD_FILL :: */
- /* By default, outlines are filled using the non-zero winding rule. */
- /* If set to 1, the outline will be filled using the even-odd fill */
- /* rule (only works with the smooth rasterizer). */
- /* */
- /* FT_OUTLINE_REVERSE_FILL :: */
- /* By default, outside contours of an outline are oriented in */
- /* clock-wise direction, as defined in the TrueType specification. */
- /* This flag is set if the outline uses the opposite direction */
- /* (typically for Type~1 fonts). This flag is ignored by the scan */
- /* converter. */
- /* */
- /* FT_OUTLINE_IGNORE_DROPOUTS :: */
- /* By default, the scan converter will try to detect drop-outs in */
- /* an outline and correct the glyph bitmap to ensure consistent */
- /* shape continuity. If set, this flag hints the scan-line */
- /* converter to ignore such cases. See below for more information. */
- /* */
- /* FT_OUTLINE_SMART_DROPOUTS :: */
- /* Select smart dropout control. If unset, use simple dropout */
- /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
- /* below for more information. */
- /* */
- /* FT_OUTLINE_INCLUDE_STUBS :: */
- /* If set, turn pixels on for `stubs', otherwise exclude them. */
- /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
- /* more information. */
- /* */
- /* FT_OUTLINE_HIGH_PRECISION :: */
- /* This flag indicates that the scan-line converter should try to */
- /* convert this outline to bitmaps with the highest possible */
- /* quality. It is typically set for small character sizes. Note */
- /* that this is only a hint that might be completely ignored by a */
- /* given scan-converter. */
- /* */
- /* FT_OUTLINE_SINGLE_PASS :: */
- /* This flag is set to force a given scan-converter to only use a */
- /* single pass over the outline to render a bitmap glyph image. */
- /* Normally, it is set for very large character sizes. It is only */
- /* a hint that might be completely ignored by a given */
- /* scan-converter. */
- /* */
- /* <Note> */
- /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
- /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
- /* rasterizer. */
- /* */
- /* There exists a second mechanism to pass the drop-out mode to the */
- /* B/W rasterizer; see the `tags' field in @FT_Outline. */
- /* */
- /* Please refer to the description of the `SCANTYPE' instruction in */
- /* the OpenType specification (in file `ttinst1.doc') how simple */
- /* drop-outs, smart drop-outs, and stubs are defined. */
- /* */
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_OUTLINE_FLAGS */
+/* */
+/* <Description> */
+/* A list of bit-field constants use for the flags in an outline's */
+/* `flags' field. */
+/* */
+/* <Values> */
+/* FT_OUTLINE_NONE :: */
+/* Value~0 is reserved. */
+/* */
+/* FT_OUTLINE_OWNER :: */
+/* If set, this flag indicates that the outline's field arrays */
+/* (i.e., `points', `flags', and `contours') are `owned' by the */
+/* outline object, and should thus be freed when it is destroyed. */
+/* */
+/* FT_OUTLINE_EVEN_ODD_FILL :: */
+/* By default, outlines are filled using the non-zero winding rule. */
+/* If set to 1, the outline will be filled using the even-odd fill */
+/* rule (only works with the smooth rasterizer). */
+/* */
+/* FT_OUTLINE_REVERSE_FILL :: */
+/* By default, outside contours of an outline are oriented in */
+/* clock-wise direction, as defined in the TrueType specification. */
+/* This flag is set if the outline uses the opposite direction */
+/* (typically for Type~1 fonts). This flag is ignored by the scan */
+/* converter. */
+/* */
+/* FT_OUTLINE_IGNORE_DROPOUTS :: */
+/* By default, the scan converter will try to detect drop-outs in */
+/* an outline and correct the glyph bitmap to ensure consistent */
+/* shape continuity. If set, this flag hints the scan-line */
+/* converter to ignore such cases. See below for more information. */
+/* */
+/* FT_OUTLINE_SMART_DROPOUTS :: */
+/* Select smart dropout control. If unset, use simple dropout */
+/* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
+/* below for more information. */
+/* */
+/* FT_OUTLINE_INCLUDE_STUBS :: */
+/* If set, turn pixels on for `stubs', otherwise exclude them. */
+/* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
+/* more information. */
+/* */
+/* FT_OUTLINE_HIGH_PRECISION :: */
+/* This flag indicates that the scan-line converter should try to */
+/* convert this outline to bitmaps with the highest possible */
+/* quality. It is typically set for small character sizes. Note */
+/* that this is only a hint that might be completely ignored by a */
+/* given scan-converter. */
+/* */
+/* FT_OUTLINE_SINGLE_PASS :: */
+/* This flag is set to force a given scan-converter to only use a */
+/* single pass over the outline to render a bitmap glyph image. */
+/* Normally, it is set for very large character sizes. It is only */
+/* a hint that might be completely ignored by a given */
+/* scan-converter. */
+/* */
+/* <Note> */
+/* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
+/* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
+/* rasterizer. */
+/* */
+/* There exists a second mechanism to pass the drop-out mode to the */
+/* B/W rasterizer; see the `tags' field in @FT_Outline. */
+/* */
+/* Please refer to the description of the `SCANTYPE' instruction in */
+/* the OpenType specification (in file `ttinst1.doc') how simple */
+/* drop-outs, smart drop-outs, and stubs are defined. */
+/* */
#define FT_OUTLINE_NONE 0x0
#define FT_OUTLINE_OWNER 0x1
#define FT_OUTLINE_EVEN_ODD_FILL 0x2
@@ -483,24 +477,24 @@ FT_BEGIN_HEADER
#define FT_OUTLINE_SINGLE_PASS 0x200
- /*************************************************************************
- *
- * @enum:
- * ft_outline_flags
- *
- * @description:
- * These constants are deprecated. Please use the corresponding
- * @FT_OUTLINE_FLAGS values.
- *
- * @values:
- * ft_outline_none :: See @FT_OUTLINE_NONE.
- * ft_outline_owner :: See @FT_OUTLINE_OWNER.
- * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
- * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
- * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
- * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
- * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
- */
+/*************************************************************************
+ *
+ * @enum:
+ * ft_outline_flags
+ *
+ * @description:
+ * These constants are deprecated. Please use the corresponding
+ * @FT_OUTLINE_FLAGS values.
+ *
+ * @values:
+ * ft_outline_none :: See @FT_OUTLINE_NONE.
+ * ft_outline_owner :: See @FT_OUTLINE_OWNER.
+ * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
+ * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
+ * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
+ * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
+ * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
+ */
#define ft_outline_none FT_OUTLINE_NONE
#define ft_outline_owner FT_OUTLINE_OWNER
#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
@@ -509,7 +503,7 @@ FT_BEGIN_HEADER
#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
- /* */
+/* */
#define FT_CURVE_TAG( flag ) ( flag & 3 )
@@ -532,164 +526,163 @@ FT_BEGIN_HEADER
#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_MoveToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `move */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `move to' is emitted to start a new contour in an outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `move to'. */
- /* */
- /* user :: A typeless pointer which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_MoveToFunc)( const FT_Vector* to,
- void* user );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Outline_MoveToFunc */
+/* */
+/* <Description> */
+/* A function pointer type used to describe the signature of a `move */
+/* to' function during outline walking/decomposition. */
+/* */
+/* A `move to' is emitted to start a new contour in an outline. */
+/* */
+/* <Input> */
+/* to :: A pointer to the target point of the `move to'. */
+/* */
+/* user :: A typeless pointer which is passed from the caller of the */
+/* decomposition function. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+typedef int
+(*FT_Outline_MoveToFunc)( const FT_Vector* to,
+ void* user );
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_LineToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `line */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `line to' is emitted to indicate a segment in the outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `line to'. */
- /* */
- /* user :: A typeless pointer which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_LineToFunc)( const FT_Vector* to,
- void* user );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Outline_LineToFunc */
+/* */
+/* <Description> */
+/* A function pointer type used to describe the signature of a `line */
+/* to' function during outline walking/decomposition. */
+/* */
+/* A `line to' is emitted to indicate a segment in the outline. */
+/* */
+/* <Input> */
+/* to :: A pointer to the target point of the `line to'. */
+/* */
+/* user :: A typeless pointer which is passed from the caller of the */
+/* decomposition function. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+typedef int
+(*FT_Outline_LineToFunc)( const FT_Vector* to,
+ void* user );
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_ConicToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `conic */
- /* to' function during outline walking or decomposition. */
- /* */
- /* A `conic to' is emitted to indicate a second-order Bézier arc in */
- /* the outline. */
- /* */
- /* <Input> */
- /* control :: An intermediate control point between the last position */
- /* and the new target in `to'. */
- /* */
- /* to :: A pointer to the target end point of the conic arc. */
- /* */
- /* user :: A typeless pointer which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_ConicToFunc)( const FT_Vector* control,
- const FT_Vector* to,
- void* user );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Outline_ConicToFunc */
+/* */
+/* <Description> */
+/* A function pointer type used to describe the signature of a `conic */
+/* to' function during outline walking or decomposition. */
+/* */
+/* A `conic to' is emitted to indicate a second-order Bézier arc in */
+/* the outline. */
+/* */
+/* <Input> */
+/* control :: An intermediate control point between the last position */
+/* and the new target in `to'. */
+/* */
+/* to :: A pointer to the target end point of the conic arc. */
+/* */
+/* user :: A typeless pointer which is passed from the caller of */
+/* the decomposition function. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+typedef int
+(*FT_Outline_ConicToFunc)( const FT_Vector* control,
+ const FT_Vector* to,
+ void* user );
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_CubicToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `cubic */
- /* to' function during outline walking or decomposition. */
- /* */
- /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
- /* */
- /* <Input> */
- /* control1 :: A pointer to the first Bézier control point. */
- /* */
- /* control2 :: A pointer to the second Bézier control point. */
- /* */
- /* to :: A pointer to the target end point. */
- /* */
- /* user :: A typeless pointer which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_CubicToFunc)( const FT_Vector* control1,
- const FT_Vector* control2,
- const FT_Vector* to,
- void* user );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Outline_CubicToFunc */
+/* */
+/* <Description> */
+/* A function pointer type used to describe the signature of a `cubic */
+/* to' function during outline walking or decomposition. */
+/* */
+/* A `cubic to' is emitted to indicate a third-order Bézier arc. */
+/* */
+/* <Input> */
+/* control1 :: A pointer to the first Bézier control point. */
+/* */
+/* control2 :: A pointer to the second Bézier control point. */
+/* */
+/* to :: A pointer to the target end point. */
+/* */
+/* user :: A typeless pointer which is passed from the caller of */
+/* the decomposition function. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+typedef int
+(*FT_Outline_CubicToFunc)( const FT_Vector* control1,
+ const FT_Vector* control2,
+ const FT_Vector* to,
+ void* user );
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline_Funcs */
- /* */
- /* <Description> */
- /* A structure to hold various function pointers used during outline */
- /* decomposition in order to emit segments, conic, and cubic Béziers. */
- /* */
- /* <Fields> */
- /* move_to :: The `move to' emitter. */
- /* */
- /* line_to :: The segment emitter. */
- /* */
- /* conic_to :: The second-order Bézier arc emitter. */
- /* */
- /* cubic_to :: The third-order Bézier arc emitter. */
- /* */
- /* shift :: The shift that is applied to coordinates before they */
- /* are sent to the emitter. */
- /* */
- /* delta :: The delta that is applied to coordinates before they */
- /* are sent to the emitter, but after the shift. */
- /* */
- /* <Note> */
- /* The point coordinates sent to the emitters are the transformed */
- /* version of the original coordinates (this is important for high */
- /* accuracy during scan-conversion). The transformation is simple: */
- /* */
- /* { */
- /* x' = (x << shift) - delta */
- /* y' = (x << shift) - delta */
- /* } */
- /* */
- /* Set the values of `shift' and `delta' to~0 to get the original */
- /* point coordinates. */
- /* */
- typedef struct FT_Outline_Funcs_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Outline_Funcs */
+/* */
+/* <Description> */
+/* A structure to hold various function pointers used during outline */
+/* decomposition in order to emit segments, conic, and cubic Béziers. */
+/* */
+/* <Fields> */
+/* move_to :: The `move to' emitter. */
+/* */
+/* line_to :: The segment emitter. */
+/* */
+/* conic_to :: The second-order Bézier arc emitter. */
+/* */
+/* cubic_to :: The third-order Bézier arc emitter. */
+/* */
+/* shift :: The shift that is applied to coordinates before they */
+/* are sent to the emitter. */
+/* */
+/* delta :: The delta that is applied to coordinates before they */
+/* are sent to the emitter, but after the shift. */
+/* */
+/* <Note> */
+/* The point coordinates sent to the emitters are the transformed */
+/* version of the original coordinates (this is important for high */
+/* accuracy during scan-conversion). The transformation is simple: */
+/* */
+/* { */
+/* x' = (x << shift) - delta */
+/* y' = (x << shift) - delta */
+/* } */
+/* */
+/* Set the values of `shift' and `delta' to~0 to get the original */
+/* point coordinates. */
+/* */
+typedef struct FT_Outline_Funcs_ {
FT_Outline_MoveToFunc move_to;
FT_Outline_LineToFunc line_to;
FT_Outline_ConicToFunc conic_to;
@@ -698,36 +691,36 @@ FT_BEGIN_HEADER
int shift;
FT_Pos delta;
- } FT_Outline_Funcs;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_IMAGE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags to an unsigned long type. */
- /* */
- /* <Note> */
- /* Since many 16-bit compilers don't like 32-bit enumerations, you */
- /* should redefine this macro in case of problems to something like */
- /* this: */
- /* */
- /* { */
- /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
- /* } */
- /* */
- /* to get a simple enumeration without assigning special numbers. */
- /* */
+} FT_Outline_Funcs;
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* basic_types */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Macro> */
+/* FT_IMAGE_TAG */
+/* */
+/* <Description> */
+/* This macro converts four-letter tags to an unsigned long type. */
+/* */
+/* <Note> */
+/* Since many 16-bit compilers don't like 32-bit enumerations, you */
+/* should redefine this macro in case of problems to something like */
+/* this: */
+/* */
+/* { */
+/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
+/* } */
+/* */
+/* to get a simple enumeration without assigning special numbers. */
+/* */
#ifndef FT_IMAGE_TAG
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
value = ( ( (unsigned long)_x1 << 24 ) | \
@@ -737,46 +730,45 @@ FT_BEGIN_HEADER
#endif /* FT_IMAGE_TAG */
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Glyph_Format */
- /* */
- /* <Description> */
- /* An enumeration type used to describe the format of a given glyph */
- /* image. Note that this version of FreeType only supports two image */
- /* formats, even though future font drivers will be able to register */
- /* their own format. */
- /* */
- /* <Values> */
- /* FT_GLYPH_FORMAT_NONE :: */
- /* The value~0 is reserved. */
- /* */
- /* FT_GLYPH_FORMAT_COMPOSITE :: */
- /* The glyph image is a composite of several other images. This */
- /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */
- /* report compound glyphs (like accented characters). */
- /* */
- /* FT_GLYPH_FORMAT_BITMAP :: */
- /* The glyph image is a bitmap, and can be described as an */
- /* @FT_Bitmap. You generally need to access the `bitmap' field of */
- /* the @FT_GlyphSlotRec structure to read it. */
- /* */
- /* FT_GLYPH_FORMAT_OUTLINE :: */
- /* The glyph image is a vectorial outline made of line segments */
- /* and Bézier arcs; it can be described as an @FT_Outline; you */
- /* generally want to access the `outline' field of the */
- /* @FT_GlyphSlotRec structure to read it. */
- /* */
- /* FT_GLYPH_FORMAT_PLOTTER :: */
- /* The glyph image is a vectorial path with no inside and outside */
- /* contours. Some Type~1 fonts, like those in the Hershey family, */
- /* contain glyphs in this format. These are described as */
- /* @FT_Outline, but FreeType isn't currently capable of rendering */
- /* them correctly. */
- /* */
- typedef enum FT_Glyph_Format_
- {
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Glyph_Format */
+/* */
+/* <Description> */
+/* An enumeration type used to describe the format of a given glyph */
+/* image. Note that this version of FreeType only supports two image */
+/* formats, even though future font drivers will be able to register */
+/* their own format. */
+/* */
+/* <Values> */
+/* FT_GLYPH_FORMAT_NONE :: */
+/* The value~0 is reserved. */
+/* */
+/* FT_GLYPH_FORMAT_COMPOSITE :: */
+/* The glyph image is a composite of several other images. This */
+/* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */
+/* report compound glyphs (like accented characters). */
+/* */
+/* FT_GLYPH_FORMAT_BITMAP :: */
+/* The glyph image is a bitmap, and can be described as an */
+/* @FT_Bitmap. You generally need to access the `bitmap' field of */
+/* the @FT_GlyphSlotRec structure to read it. */
+/* */
+/* FT_GLYPH_FORMAT_OUTLINE :: */
+/* The glyph image is a vectorial outline made of line segments */
+/* and Bézier arcs; it can be described as an @FT_Outline; you */
+/* generally want to access the `outline' field of the */
+/* @FT_GlyphSlotRec structure to read it. */
+/* */
+/* FT_GLYPH_FORMAT_PLOTTER :: */
+/* The glyph image is a vectorial path with no inside and outside */
+/* contours. Some Type~1 fonts, like those in the Hershey family, */
+/* contain glyphs in this format. These are described as */
+/* @FT_Outline, but FreeType isn't currently capable of rendering */
+/* them correctly. */
+/* */
+typedef enum FT_Glyph_Format_ {
FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
@@ -784,25 +776,25 @@ FT_BEGIN_HEADER
FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
- } FT_Glyph_Format;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_glyph_format_xxx */
- /* */
- /* <Description> */
- /* A list of deprecated constants. Use the corresponding */
- /* @FT_Glyph_Format values instead. */
- /* */
- /* <Values> */
- /* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
- /* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
- /* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
- /* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
- /* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
- /* */
+} FT_Glyph_Format;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* ft_glyph_format_xxx */
+/* */
+/* <Description> */
+/* A list of deprecated constants. Use the corresponding */
+/* @FT_Glyph_Format values instead. */
+/* */
+/* <Values> */
+/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
+/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
+/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
+/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
+/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
+/* */
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
@@ -810,299 +802,297 @@ FT_BEGIN_HEADER
#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** R A S T E R D E F I N I T I O N S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* A raster is a scan converter, in charge of rendering an outline into */
- /* a a bitmap. This section contains the public API for rasters. */
- /* */
- /* Note that in FreeType 2, all rasters are now encapsulated within */
- /* specific modules called `renderers'. See `freetype/ftrender.h' for */
- /* more details on renderers. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* raster */
- /* */
- /* <Title> */
- /* Scanline Converter */
- /* */
- /* <Abstract> */
- /* How vectorial outlines are converted into bitmaps and pixmaps. */
- /* */
- /* <Description> */
- /* This section contains technical definitions. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Raster */
- /* */
- /* <Description> */
- /* A handle (pointer) to a raster object. Each object can be used */
- /* independently to convert an outline into a bitmap or pixmap. */
- /* */
- typedef struct FT_RasterRec_* FT_Raster;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Span */
- /* */
- /* <Description> */
- /* A structure used to model a single span of gray (or black) pixels */
- /* when rendering a monochrome or anti-aliased bitmap. */
- /* */
- /* <Fields> */
- /* x :: The span's horizontal start position. */
- /* */
- /* len :: The span's length in pixels. */
- /* */
- /* coverage :: The span color/coverage, ranging from 0 (background) */
- /* to 255 (foreground). Only used for anti-aliased */
- /* rendering. */
- /* */
- /* <Note> */
- /* This structure is used by the span drawing callback type named */
- /* @FT_SpanFunc which takes the y~coordinate of the span as a */
- /* a parameter. */
- /* */
- /* The coverage value is always between 0 and 255. If you want less */
- /* gray values, the callback function has to reduce them. */
- /* */
- typedef struct FT_Span_
- {
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/***** *****/
+/***** R A S T E R D E F I N I T I O N S *****/
+/***** *****/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* A raster is a scan converter, in charge of rendering an outline into */
+/* a a bitmap. This section contains the public API for rasters. */
+/* */
+/* Note that in FreeType 2, all rasters are now encapsulated within */
+/* specific modules called `renderers'. See `freetype/ftrender.h' for */
+/* more details on renderers. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* raster */
+/* */
+/* <Title> */
+/* Scanline Converter */
+/* */
+/* <Abstract> */
+/* How vectorial outlines are converted into bitmaps and pixmaps. */
+/* */
+/* <Description> */
+/* This section contains technical definitions. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Raster */
+/* */
+/* <Description> */
+/* A handle (pointer) to a raster object. Each object can be used */
+/* independently to convert an outline into a bitmap or pixmap. */
+/* */
+typedef struct FT_RasterRec_* FT_Raster;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Span */
+/* */
+/* <Description> */
+/* A structure used to model a single span of gray (or black) pixels */
+/* when rendering a monochrome or anti-aliased bitmap. */
+/* */
+/* <Fields> */
+/* x :: The span's horizontal start position. */
+/* */
+/* len :: The span's length in pixels. */
+/* */
+/* coverage :: The span color/coverage, ranging from 0 (background) */
+/* to 255 (foreground). Only used for anti-aliased */
+/* rendering. */
+/* */
+/* <Note> */
+/* This structure is used by the span drawing callback type named */
+/* @FT_SpanFunc which takes the y~coordinate of the span as a */
+/* a parameter. */
+/* */
+/* The coverage value is always between 0 and 255. If you want less */
+/* gray values, the callback function has to reduce them. */
+/* */
+typedef struct FT_Span_ {
short x;
unsigned short len;
unsigned char coverage;
- } FT_Span;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_SpanFunc */
- /* */
- /* <Description> */
- /* A function used as a call-back by the anti-aliased renderer in */
- /* order to let client applications draw themselves the gray pixel */
- /* spans on each scan line. */
- /* */
- /* <Input> */
- /* y :: The scanline's y~coordinate. */
- /* */
- /* count :: The number of spans to draw on this scanline. */
- /* */
- /* spans :: A table of `count' spans to draw on the scanline. */
- /* */
- /* user :: User-supplied data that is passed to the callback. */
- /* */
- /* <Note> */
- /* This callback allows client applications to directly render the */
- /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
- /* */
- /* This can be used to write anti-aliased outlines directly to a */
- /* given background bitmap, and even perform translucency. */
- /* */
- /* Note that the `count' field cannot be greater than a fixed value */
- /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
- /* `ftoption.h'. By default, this value is set to~32, which means */
- /* that if there are more than 32~spans on a given scanline, the */
- /* callback is called several times with the same `y' parameter in */
- /* order to draw all callbacks. */
- /* */
- /* Otherwise, the callback is only called once per scan-line, and */
- /* only for those scanlines that do have `gray' pixels on them. */
- /* */
- typedef void
- (*FT_SpanFunc)( int y,
- int count,
- const FT_Span* spans,
- void* user );
+} FT_Span;
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_SpanFunc */
+/* */
+/* <Description> */
+/* A function used as a call-back by the anti-aliased renderer in */
+/* order to let client applications draw themselves the gray pixel */
+/* spans on each scan line. */
+/* */
+/* <Input> */
+/* y :: The scanline's y~coordinate. */
+/* */
+/* count :: The number of spans to draw on this scanline. */
+/* */
+/* spans :: A table of `count' spans to draw on the scanline. */
+/* */
+/* user :: User-supplied data that is passed to the callback. */
+/* */
+/* <Note> */
+/* This callback allows client applications to directly render the */
+/* gray spans of the anti-aliased bitmap to any kind of surfaces. */
+/* */
+/* This can be used to write anti-aliased outlines directly to a */
+/* given background bitmap, and even perform translucency. */
+/* */
+/* Note that the `count' field cannot be greater than a fixed value */
+/* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
+/* `ftoption.h'. By default, this value is set to~32, which means */
+/* that if there are more than 32~spans on a given scanline, the */
+/* callback is called several times with the same `y' parameter in */
+/* order to draw all callbacks. */
+/* */
+/* Otherwise, the callback is only called once per scan-line, and */
+/* only for those scanlines that do have `gray' pixels on them. */
+/* */
+typedef void
+(*FT_SpanFunc)( int y,
+ int count,
+ const FT_Span* spans,
+ void* user );
#define FT_Raster_Span_Func FT_SpanFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitTest_Func */
- /* */
- /* <Description> */
- /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
- /* */
- /* A function used as a call-back by the monochrome scan-converter */
- /* to test whether a given target pixel is already set to the drawing */
- /* `color'. These tests are crucial to implement drop-out control */
- /* per-se the TrueType spec. */
- /* */
- /* <Input> */
- /* y :: The pixel's y~coordinate. */
- /* */
- /* x :: The pixel's x~coordinate. */
- /* */
- /* user :: User-supplied data that is passed to the callback. */
- /* */
- /* <Return> */
- /* 1~if the pixel is `set', 0~otherwise. */
- /* */
- typedef int
- (*FT_Raster_BitTest_Func)( int y,
- int x,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitSet_Func */
- /* */
- /* <Description> */
- /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
- /* */
- /* A function used as a call-back by the monochrome scan-converter */
- /* to set an individual target pixel. This is crucial to implement */
- /* drop-out control according to the TrueType specification. */
- /* */
- /* <Input> */
- /* y :: The pixel's y~coordinate. */
- /* */
- /* x :: The pixel's x~coordinate. */
- /* */
- /* user :: User-supplied data that is passed to the callback. */
- /* */
- /* <Return> */
- /* 1~if the pixel is `set', 0~otherwise. */
- /* */
- typedef void
- (*FT_Raster_BitSet_Func)( int y,
- int x,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_RASTER_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit flag constants as used in the `flags' field of a */
- /* @FT_Raster_Params structure. */
- /* */
- /* <Values> */
- /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
- /* */
- /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
- /* anti-aliased glyph image should be */
- /* generated. Otherwise, it will be */
- /* monochrome (1-bit). */
- /* */
- /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
- /* rendering. In this mode, client */
- /* applications must provide their own span */
- /* callback. This lets them directly */
- /* draw or compose over an existing bitmap. */
- /* If this bit is not set, the target */
- /* pixmap's buffer _must_ be zeroed before */
- /* rendering. */
- /* */
- /* Note that for now, direct rendering is */
- /* only possible with anti-aliased glyphs. */
- /* */
- /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
- /* rendering mode. If set, the output will */
- /* be clipped to a box specified in the */
- /* `clip_box' field of the */
- /* @FT_Raster_Params structure. */
- /* */
- /* Note that by default, the glyph bitmap */
- /* is clipped to the target pixmap, except */
- /* in direct rendering mode where all spans */
- /* are generated if no clipping box is set. */
- /* */
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_BitTest_Func */
+/* */
+/* <Description> */
+/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
+/* */
+/* A function used as a call-back by the monochrome scan-converter */
+/* to test whether a given target pixel is already set to the drawing */
+/* `color'. These tests are crucial to implement drop-out control */
+/* per-se the TrueType spec. */
+/* */
+/* <Input> */
+/* y :: The pixel's y~coordinate. */
+/* */
+/* x :: The pixel's x~coordinate. */
+/* */
+/* user :: User-supplied data that is passed to the callback. */
+/* */
+/* <Return> */
+/* 1~if the pixel is `set', 0~otherwise. */
+/* */
+typedef int
+(*FT_Raster_BitTest_Func)( int y,
+ int x,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_BitSet_Func */
+/* */
+/* <Description> */
+/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
+/* */
+/* A function used as a call-back by the monochrome scan-converter */
+/* to set an individual target pixel. This is crucial to implement */
+/* drop-out control according to the TrueType specification. */
+/* */
+/* <Input> */
+/* y :: The pixel's y~coordinate. */
+/* */
+/* x :: The pixel's x~coordinate. */
+/* */
+/* user :: User-supplied data that is passed to the callback. */
+/* */
+/* <Return> */
+/* 1~if the pixel is `set', 0~otherwise. */
+/* */
+typedef void
+(*FT_Raster_BitSet_Func)( int y,
+ int x,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_RASTER_FLAG_XXX */
+/* */
+/* <Description> */
+/* A list of bit flag constants as used in the `flags' field of a */
+/* @FT_Raster_Params structure. */
+/* */
+/* <Values> */
+/* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
+/* */
+/* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
+/* anti-aliased glyph image should be */
+/* generated. Otherwise, it will be */
+/* monochrome (1-bit). */
+/* */
+/* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
+/* rendering. In this mode, client */
+/* applications must provide their own span */
+/* callback. This lets them directly */
+/* draw or compose over an existing bitmap. */
+/* If this bit is not set, the target */
+/* pixmap's buffer _must_ be zeroed before */
+/* rendering. */
+/* */
+/* Note that for now, direct rendering is */
+/* only possible with anti-aliased glyphs. */
+/* */
+/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
+/* rendering mode. If set, the output will */
+/* be clipped to a box specified in the */
+/* `clip_box' field of the */
+/* @FT_Raster_Params structure. */
+/* */
+/* Note that by default, the glyph bitmap */
+/* is clipped to the target pixmap, except */
+/* in direct rendering mode where all spans */
+/* are generated if no clipping box is set. */
+/* */
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
- /* deprecated */
+/* deprecated */
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Raster_Params */
- /* */
- /* <Description> */
- /* A structure to hold the arguments used by a raster's render */
- /* function. */
- /* */
- /* <Fields> */
- /* target :: The target bitmap. */
- /* */
- /* source :: A pointer to the source glyph image (e.g., an */
- /* @FT_Outline). */
- /* */
- /* flags :: The rendering flags. */
- /* */
- /* gray_spans :: The gray span drawing callback. */
- /* */
- /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
- /* */
- /* bit_test :: The bit test callback. UNIMPLEMENTED! */
- /* */
- /* bit_set :: The bit set callback. UNIMPLEMENTED! */
- /* */
- /* user :: User-supplied data that is passed to each drawing */
- /* callback. */
- /* */
- /* clip_box :: An optional clipping box. It is only used in */
- /* direct rendering mode. Note that coordinates here */
- /* should be expressed in _integer_ pixels (and not in */
- /* 26.6 fixed-point units). */
- /* */
- /* <Note> */
- /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
- /* bit flag is set in the `flags' field, otherwise a monochrome */
- /* bitmap is generated. */
- /* */
- /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
- /* raster will call the `gray_spans' callback to draw gray pixel */
- /* spans, in the case of an aa glyph bitmap, it will call */
- /* `black_spans', and `bit_test' and `bit_set' in the case of a */
- /* monochrome bitmap. This allows direct composition over a */
- /* pre-existing bitmap through user-provided callbacks to perform the */
- /* span drawing/composition. */
- /* */
- /* Note that the `bit_test' and `bit_set' callbacks are required when */
- /* rendering a monochrome bitmap, as they are crucial to implement */
- /* correct drop-out control as defined in the TrueType specification. */
- /* */
- typedef struct FT_Raster_Params_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Raster_Params */
+/* */
+/* <Description> */
+/* A structure to hold the arguments used by a raster's render */
+/* function. */
+/* */
+/* <Fields> */
+/* target :: The target bitmap. */
+/* */
+/* source :: A pointer to the source glyph image (e.g., an */
+/* @FT_Outline). */
+/* */
+/* flags :: The rendering flags. */
+/* */
+/* gray_spans :: The gray span drawing callback. */
+/* */
+/* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
+/* */
+/* bit_test :: The bit test callback. UNIMPLEMENTED! */
+/* */
+/* bit_set :: The bit set callback. UNIMPLEMENTED! */
+/* */
+/* user :: User-supplied data that is passed to each drawing */
+/* callback. */
+/* */
+/* clip_box :: An optional clipping box. It is only used in */
+/* direct rendering mode. Note that coordinates here */
+/* should be expressed in _integer_ pixels (and not in */
+/* 26.6 fixed-point units). */
+/* */
+/* <Note> */
+/* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
+/* bit flag is set in the `flags' field, otherwise a monochrome */
+/* bitmap is generated. */
+/* */
+/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
+/* raster will call the `gray_spans' callback to draw gray pixel */
+/* spans, in the case of an aa glyph bitmap, it will call */
+/* `black_spans', and `bit_test' and `bit_set' in the case of a */
+/* monochrome bitmap. This allows direct composition over a */
+/* pre-existing bitmap through user-provided callbacks to perform the */
+/* span drawing/composition. */
+/* */
+/* Note that the `bit_test' and `bit_set' callbacks are required when */
+/* rendering a monochrome bitmap, as they are crucial to implement */
+/* correct drop-out control as defined in the TrueType specification. */
+/* */
+typedef struct FT_Raster_Params_ {
const FT_Bitmap* target;
const void* source;
int flags;
@@ -1113,180 +1103,179 @@ FT_BEGIN_HEADER
void* user;
FT_BBox clip_box;
- } FT_Raster_Params;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_NewFunc */
- /* */
- /* <Description> */
- /* A function used to create a new raster object. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory allocator. */
- /* */
- /* <Output> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `memory' parameter is a typeless pointer in order to avoid */
- /* un-wanted dependencies on the rest of the FreeType code. In */
- /* practice, it is an @FT_Memory object, i.e., a handle to the */
- /* standard FreeType memory allocator. However, this field can be */
- /* completely ignored by a given raster implementation. */
- /* */
- typedef int
- (*FT_Raster_NewFunc)( void* memory,
- FT_Raster* raster );
+} FT_Raster_Params;
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_NewFunc */
+/* */
+/* <Description> */
+/* A function used to create a new raster object. */
+/* */
+/* <Input> */
+/* memory :: A handle to the memory allocator. */
+/* */
+/* <Output> */
+/* raster :: A handle to the new raster object. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+/* <Note> */
+/* The `memory' parameter is a typeless pointer in order to avoid */
+/* un-wanted dependencies on the rest of the FreeType code. In */
+/* practice, it is an @FT_Memory object, i.e., a handle to the */
+/* standard FreeType memory allocator. However, this field can be */
+/* completely ignored by a given raster implementation. */
+/* */
+typedef int
+(*FT_Raster_NewFunc)( void* memory,
+ FT_Raster* raster );
#define FT_Raster_New_Func FT_Raster_NewFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_DoneFunc */
- /* */
- /* <Description> */
- /* A function used to destroy a given raster object. */
- /* */
- /* <Input> */
- /* raster :: A handle to the raster object. */
- /* */
- typedef void
- (*FT_Raster_DoneFunc)( FT_Raster raster );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_DoneFunc */
+/* */
+/* <Description> */
+/* A function used to destroy a given raster object. */
+/* */
+/* <Input> */
+/* raster :: A handle to the raster object. */
+/* */
+typedef void
+(*FT_Raster_DoneFunc)( FT_Raster raster );
#define FT_Raster_Done_Func FT_Raster_DoneFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_ResetFunc */
- /* */
- /* <Description> */
- /* FreeType provides an area of memory called the `render pool', */
- /* available to all registered rasters. This pool can be freely used */
- /* during a given scan-conversion but is shared by all rasters. Its */
- /* content is thus transient. */
- /* */
- /* This function is called each time the render pool changes, or just */
- /* after a new raster object is created. */
- /* */
- /* <Input> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* pool_base :: The address in memory of the render pool. */
- /* */
- /* pool_size :: The size in bytes of the render pool. */
- /* */
- /* <Note> */
- /* Rasters can ignore the render pool and rely on dynamic memory */
- /* allocation if they want to (a handle to the memory allocator is */
- /* passed to the raster constructor). However, this is not */
- /* recommended for efficiency purposes. */
- /* */
- typedef void
- (*FT_Raster_ResetFunc)( FT_Raster raster,
- unsigned char* pool_base,
- unsigned long pool_size );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_ResetFunc */
+/* */
+/* <Description> */
+/* FreeType provides an area of memory called the `render pool', */
+/* available to all registered rasters. This pool can be freely used */
+/* during a given scan-conversion but is shared by all rasters. Its */
+/* content is thus transient. */
+/* */
+/* This function is called each time the render pool changes, or just */
+/* after a new raster object is created. */
+/* */
+/* <Input> */
+/* raster :: A handle to the new raster object. */
+/* */
+/* pool_base :: The address in memory of the render pool. */
+/* */
+/* pool_size :: The size in bytes of the render pool. */
+/* */
+/* <Note> */
+/* Rasters can ignore the render pool and rely on dynamic memory */
+/* allocation if they want to (a handle to the memory allocator is */
+/* passed to the raster constructor). However, this is not */
+/* recommended for efficiency purposes. */
+/* */
+typedef void
+(*FT_Raster_ResetFunc)( FT_Raster raster,
+ unsigned char* pool_base,
+ unsigned long pool_size );
#define FT_Raster_Reset_Func FT_Raster_ResetFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_SetModeFunc */
- /* */
- /* <Description> */
- /* This function is a generic facility to change modes or attributes */
- /* in a given raster. This can be used for debugging purposes, or */
- /* simply to allow implementation-specific `features' in a given */
- /* raster module. */
- /* */
- /* <Input> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* mode :: A 4-byte tag used to name the mode or property. */
- /* */
- /* args :: A pointer to the new mode/property to use. */
- /* */
- typedef int
- (*FT_Raster_SetModeFunc)( FT_Raster raster,
- unsigned long mode,
- void* args );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_SetModeFunc */
+/* */
+/* <Description> */
+/* This function is a generic facility to change modes or attributes */
+/* in a given raster. This can be used for debugging purposes, or */
+/* simply to allow implementation-specific `features' in a given */
+/* raster module. */
+/* */
+/* <Input> */
+/* raster :: A handle to the new raster object. */
+/* */
+/* mode :: A 4-byte tag used to name the mode or property. */
+/* */
+/* args :: A pointer to the new mode/property to use. */
+/* */
+typedef int
+(*FT_Raster_SetModeFunc)( FT_Raster raster,
+ unsigned long mode,
+ void* args );
#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_RenderFunc */
- /* */
- /* <Description> */
- /* Invoke a given raster to scan-convert a given glyph image into a */
- /* target bitmap. */
- /* */
- /* <Input> */
- /* raster :: A handle to the raster object. */
- /* */
- /* params :: A pointer to an @FT_Raster_Params structure used to */
- /* store the rendering parameters. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- /* <Note> */
- /* The exact format of the source image depends on the raster's glyph */
- /* format defined in its @FT_Raster_Funcs structure. It can be an */
- /* @FT_Outline or anything else in order to support a large array of */
- /* glyph formats. */
- /* */
- /* Note also that the render function can fail and return a */
- /* `FT_Err_Unimplemented_Feature' error code if the raster used does */
- /* not support direct composition. */
- /* */
- /* XXX: For now, the standard raster doesn't support direct */
- /* composition but this should change for the final release (see */
- /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
- /* for examples of distinct implementations which support direct */
- /* composition). */
- /* */
- typedef int
- (*FT_Raster_RenderFunc)( FT_Raster raster,
- const FT_Raster_Params* params );
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Raster_RenderFunc */
+/* */
+/* <Description> */
+/* Invoke a given raster to scan-convert a given glyph image into a */
+/* target bitmap. */
+/* */
+/* <Input> */
+/* raster :: A handle to the raster object. */
+/* */
+/* params :: A pointer to an @FT_Raster_Params structure used to */
+/* store the rendering parameters. */
+/* */
+/* <Return> */
+/* Error code. 0~means success. */
+/* */
+/* <Note> */
+/* The exact format of the source image depends on the raster's glyph */
+/* format defined in its @FT_Raster_Funcs structure. It can be an */
+/* @FT_Outline or anything else in order to support a large array of */
+/* glyph formats. */
+/* */
+/* Note also that the render function can fail and return a */
+/* `FT_Err_Unimplemented_Feature' error code if the raster used does */
+/* not support direct composition. */
+/* */
+/* XXX: For now, the standard raster doesn't support direct */
+/* composition but this should change for the final release (see */
+/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
+/* for examples of distinct implementations which support direct */
+/* composition). */
+/* */
+typedef int
+(*FT_Raster_RenderFunc)( FT_Raster raster,
+ const FT_Raster_Params* params );
#define FT_Raster_Render_Func FT_Raster_RenderFunc
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Raster_Funcs */
- /* */
- /* <Description> */
- /* A structure used to describe a given raster class to the library. */
- /* */
- /* <Fields> */
- /* glyph_format :: The supported glyph format for this raster. */
- /* */
- /* raster_new :: The raster constructor. */
- /* */
- /* raster_reset :: Used to reset the render pool within the raster. */
- /* */
- /* raster_render :: A function to render a glyph into a given bitmap. */
- /* */
- /* raster_done :: The raster destructor. */
- /* */
- typedef struct FT_Raster_Funcs_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Raster_Funcs */
+/* */
+/* <Description> */
+/* A structure used to describe a given raster class to the library. */
+/* */
+/* <Fields> */
+/* glyph_format :: The supported glyph format for this raster. */
+/* */
+/* raster_new :: The raster constructor. */
+/* */
+/* raster_reset :: Used to reset the render pool within the raster. */
+/* */
+/* raster_render :: A function to render a glyph into a given bitmap. */
+/* */
+/* raster_done :: The raster destructor. */
+/* */
+typedef struct FT_Raster_Funcs_ {
FT_Glyph_Format glyph_format;
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
@@ -1294,10 +1283,10 @@ FT_BEGIN_HEADER
FT_Raster_RenderFunc raster_render;
FT_Raster_DoneFunc raster_done;
- } FT_Raster_Funcs;
+} FT_Raster_Funcs;
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftincrem.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftincrem.h
index aaf689f..01e4041 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftincrem.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftincrem.h
@@ -31,319 +31,316 @@
FT_BEGIN_HEADER
- /***************************************************************************
- *
- * @section:
- * incremental
- *
- * @title:
- * Incremental Loading
- *
- * @abstract:
- * Custom Glyph Loading.
- *
- * @description:
- * This section contains various functions used to perform so-called
- * `incremental' glyph loading. This is a mode where all glyphs loaded
- * from a given @FT_Face are provided by the client application,
- *
- * Apart from that, all other tables are loaded normally from the font
- * file. This mode is useful when FreeType is used within another
- * engine, e.g., a PostScript Imaging Processor.
- *
- * To enable this mode, you must use @FT_Open_Face, passing an
- * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
- * @FT_Incremental_Interface value. See the comments for
- * @FT_Incremental_InterfaceRec for an example.
- *
- */
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental
- *
- * @description:
- * An opaque type describing a user-provided object used to implement
- * `incremental' glyph loading within FreeType. This is used to support
- * embedded fonts in certain environments (e.g., PostScript interpreters),
- * where the glyph data isn't in the font file, or must be overridden by
- * different values.
- *
- * @note:
- * It is up to client applications to create and implement @FT_Incremental
- * objects, as long as they provide implementations for the methods
- * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
- * and @FT_Incremental_GetGlyphMetricsFunc.
- *
- * See the description of @FT_Incremental_InterfaceRec to understand how
- * to use incremental objects with FreeType.
- *
- */
- typedef struct FT_IncrementalRec_* FT_Incremental;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_MetricsRec
- *
- * @description:
- * A small structure used to contain the basic glyph metrics returned
- * by the @FT_Incremental_GetGlyphMetricsFunc method.
- *
- * @fields:
- * bearing_x ::
- * Left bearing, in font units.
- *
- * bearing_y ::
- * Top bearing, in font units.
- *
- * advance ::
- * Horizontal component of glyph advance, in font units.
- *
- * advance_v ::
- * Vertical component of glyph advance, in font units.
- *
- * @note:
- * These correspond to horizontal or vertical metrics depending on the
- * value of the `vertical' argument to the function
- * @FT_Incremental_GetGlyphMetricsFunc.
- *
- */
- typedef struct FT_Incremental_MetricsRec_
- {
+/***************************************************************************
+ *
+ * @section:
+ * incremental
+ *
+ * @title:
+ * Incremental Loading
+ *
+ * @abstract:
+ * Custom Glyph Loading.
+ *
+ * @description:
+ * This section contains various functions used to perform so-called
+ * `incremental' glyph loading. This is a mode where all glyphs loaded
+ * from a given @FT_Face are provided by the client application,
+ *
+ * Apart from that, all other tables are loaded normally from the font
+ * file. This mode is useful when FreeType is used within another
+ * engine, e.g., a PostScript Imaging Processor.
+ *
+ * To enable this mode, you must use @FT_Open_Face, passing an
+ * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
+ * @FT_Incremental_Interface value. See the comments for
+ * @FT_Incremental_InterfaceRec for an example.
+ *
+ */
+
+
+/***************************************************************************
+ *
+ * @type:
+ * FT_Incremental
+ *
+ * @description:
+ * An opaque type describing a user-provided object used to implement
+ * `incremental' glyph loading within FreeType. This is used to support
+ * embedded fonts in certain environments (e.g., PostScript interpreters),
+ * where the glyph data isn't in the font file, or must be overridden by
+ * different values.
+ *
+ * @note:
+ * It is up to client applications to create and implement @FT_Incremental
+ * objects, as long as they provide implementations for the methods
+ * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
+ * and @FT_Incremental_GetGlyphMetricsFunc.
+ *
+ * See the description of @FT_Incremental_InterfaceRec to understand how
+ * to use incremental objects with FreeType.
+ *
+ */
+typedef struct FT_IncrementalRec_* FT_Incremental;
+
+
+/***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_MetricsRec
+ *
+ * @description:
+ * A small structure used to contain the basic glyph metrics returned
+ * by the @FT_Incremental_GetGlyphMetricsFunc method.
+ *
+ * @fields:
+ * bearing_x ::
+ * Left bearing, in font units.
+ *
+ * bearing_y ::
+ * Top bearing, in font units.
+ *
+ * advance ::
+ * Horizontal component of glyph advance, in font units.
+ *
+ * advance_v ::
+ * Vertical component of glyph advance, in font units.
+ *
+ * @note:
+ * These correspond to horizontal or vertical metrics depending on the
+ * value of the `vertical' argument to the function
+ * @FT_Incremental_GetGlyphMetricsFunc.
+ *
+ */
+typedef struct FT_Incremental_MetricsRec_ {
FT_Long bearing_x;
FT_Long bearing_y;
FT_Long advance;
FT_Long advance_v; /* since 2.3.12 */
- } FT_Incremental_MetricsRec;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_Metrics
- *
- * @description:
- * A handle to an @FT_Incremental_MetricsRec structure.
- *
- */
- typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_GetGlyphDataFunc
- *
- * @description:
- * A function called by FreeType to access a given glyph's data bytes
- * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
- * enabled.
- *
- * Note that the format of the glyph's data bytes depends on the font
- * file format. For TrueType, it must correspond to the raw bytes within
- * the `glyf' table. For PostScript formats, it must correspond to the
- * *unencrypted* charstring bytes, without any `lenIV' header. It is
- * undefined for any other format.
- *
- * @input:
- * incremental ::
- * Handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * glyph_index ::
- * Index of relevant glyph.
- *
- * @output:
- * adata ::
- * A structure describing the returned glyph data bytes (which will be
- * accessed as a read-only byte block).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If this function returns successfully the method
- * @FT_Incremental_FreeGlyphDataFunc will be called later to release
- * the data bytes.
- *
- * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
- * compound glyphs.
- *
- */
- typedef FT_Error
- (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
- FT_UInt glyph_index,
- FT_Data* adata );
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_FreeGlyphDataFunc
- *
- * @description:
- * A function used to release the glyph data bytes returned by a
- * successful call to @FT_Incremental_GetGlyphDataFunc.
- *
- * @input:
- * incremental ::
- * A handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * data ::
- * A structure describing the glyph data bytes (which will be accessed
- * as a read-only byte block).
- *
- */
- typedef void
- (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
- FT_Data* data );
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_GetGlyphMetricsFunc
- *
- * @description:
- * A function used to retrieve the basic metrics of a given glyph index
- * before accessing its data. This is necessary because, in certain
- * formats like TrueType, the metrics are stored in a different place from
- * the glyph images proper.
- *
- * @input:
- * incremental ::
- * A handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * glyph_index ::
- * Index of relevant glyph.
- *
- * vertical ::
- * If true, return vertical metrics.
- *
- * ametrics ::
- * This parameter is used for both input and output.
- * The original glyph metrics, if any, in font units. If metrics are
- * not available all the values must be set to zero.
- *
- * @output:
- * ametrics ::
- * The replacement glyph metrics in font units.
- *
- */
- typedef FT_Error
- (*FT_Incremental_GetGlyphMetricsFunc)
- ( FT_Incremental incremental,
- FT_UInt glyph_index,
- FT_Bool vertical,
- FT_Incremental_MetricsRec *ametrics );
-
-
- /**************************************************************************
- *
- * @struct:
- * FT_Incremental_FuncsRec
- *
- * @description:
- * A table of functions for accessing fonts that load data
- * incrementally. Used in @FT_Incremental_InterfaceRec.
- *
- * @fields:
- * get_glyph_data ::
- * The function to get glyph data. Must not be null.
- *
- * free_glyph_data ::
- * The function to release glyph data. Must not be null.
- *
- * get_glyph_metrics ::
- * The function to get glyph metrics. May be null if the font does
- * not provide overriding glyph metrics.
- *
- */
- typedef struct FT_Incremental_FuncsRec_
- {
+} FT_Incremental_MetricsRec;
+
+
+/***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_Metrics
+ *
+ * @description:
+ * A handle to an @FT_Incremental_MetricsRec structure.
+ *
+ */
+typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
+
+
+/***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphDataFunc
+ *
+ * @description:
+ * A function called by FreeType to access a given glyph's data bytes
+ * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
+ * enabled.
+ *
+ * Note that the format of the glyph's data bytes depends on the font
+ * file format. For TrueType, it must correspond to the raw bytes within
+ * the `glyf' table. For PostScript formats, it must correspond to the
+ * *unencrypted* charstring bytes, without any `lenIV' header. It is
+ * undefined for any other format.
+ *
+ * @input:
+ * incremental ::
+ * Handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * @output:
+ * adata ::
+ * A structure describing the returned glyph data bytes (which will be
+ * accessed as a read-only byte block).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If this function returns successfully the method
+ * @FT_Incremental_FreeGlyphDataFunc will be called later to release
+ * the data bytes.
+ *
+ * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
+ * compound glyphs.
+ *
+ */
+typedef FT_Error
+(*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Data* adata );
+
+
+/***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_FreeGlyphDataFunc
+ *
+ * @description:
+ * A function used to release the glyph data bytes returned by a
+ * successful call to @FT_Incremental_GetGlyphDataFunc.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * data ::
+ * A structure describing the glyph data bytes (which will be accessed
+ * as a read-only byte block).
+ *
+ */
+typedef void
+(*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
+ FT_Data* data );
+
+
+/***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphMetricsFunc
+ *
+ * @description:
+ * A function used to retrieve the basic metrics of a given glyph index
+ * before accessing its data. This is necessary because, in certain
+ * formats like TrueType, the metrics are stored in a different place from
+ * the glyph images proper.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * vertical ::
+ * If true, return vertical metrics.
+ *
+ * ametrics ::
+ * This parameter is used for both input and output.
+ * The original glyph metrics, if any, in font units. If metrics are
+ * not available all the values must be set to zero.
+ *
+ * @output:
+ * ametrics ::
+ * The replacement glyph metrics in font units.
+ *
+ */
+typedef FT_Error
+(*FT_Incremental_GetGlyphMetricsFunc)
+( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Bool vertical,
+ FT_Incremental_MetricsRec *ametrics );
+
+
+/**************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_FuncsRec
+ *
+ * @description:
+ * A table of functions for accessing fonts that load data
+ * incrementally. Used in @FT_Incremental_InterfaceRec.
+ *
+ * @fields:
+ * get_glyph_data ::
+ * The function to get glyph data. Must not be null.
+ *
+ * free_glyph_data ::
+ * The function to release glyph data. Must not be null.
+ *
+ * get_glyph_metrics ::
+ * The function to get glyph metrics. May be null if the font does
+ * not provide overriding glyph metrics.
+ *
+ */
+typedef struct FT_Incremental_FuncsRec_ {
FT_Incremental_GetGlyphDataFunc get_glyph_data;
FT_Incremental_FreeGlyphDataFunc free_glyph_data;
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
- } FT_Incremental_FuncsRec;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_InterfaceRec
- *
- * @description:
- * A structure to be used with @FT_Open_Face to indicate that the user
- * wants to support incremental glyph loading. You should use it with
- * @FT_PARAM_TAG_INCREMENTAL as in the following example:
- *
- * {
- * FT_Incremental_InterfaceRec inc_int;
- * FT_Parameter parameter;
- * FT_Open_Args open_args;
- *
- *
- * // set up incremental descriptor
- * inc_int.funcs = my_funcs;
- * inc_int.object = my_object;
- *
- * // set up optional parameter
- * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
- * parameter.data = &inc_int;
- *
- * // set up FT_Open_Args structure
- * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
- * open_args.pathname = my_font_pathname;
- * open_args.num_params = 1;
- * open_args.params = &parameter; // we use one optional argument
- *
- * // open the font
- * error = FT_Open_Face( library, &open_args, index, &face );
- * ...
- * }
- *
- */
- typedef struct FT_Incremental_InterfaceRec_
- {
+} FT_Incremental_FuncsRec;
+
+
+/***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_InterfaceRec
+ *
+ * @description:
+ * A structure to be used with @FT_Open_Face to indicate that the user
+ * wants to support incremental glyph loading. You should use it with
+ * @FT_PARAM_TAG_INCREMENTAL as in the following example:
+ *
+ * {
+ * FT_Incremental_InterfaceRec inc_int;
+ * FT_Parameter parameter;
+ * FT_Open_Args open_args;
+ *
+ *
+ * // set up incremental descriptor
+ * inc_int.funcs = my_funcs;
+ * inc_int.object = my_object;
+ *
+ * // set up optional parameter
+ * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
+ * parameter.data = &inc_int;
+ *
+ * // set up FT_Open_Args structure
+ * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
+ * open_args.pathname = my_font_pathname;
+ * open_args.num_params = 1;
+ * open_args.params = &parameter; // we use one optional argument
+ *
+ * // open the font
+ * error = FT_Open_Face( library, &open_args, index, &face );
+ * ...
+ * }
+ *
+ */
+typedef struct FT_Incremental_InterfaceRec_ {
const FT_Incremental_FuncsRec* funcs;
FT_Incremental object;
- } FT_Incremental_InterfaceRec;
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_Interface
- *
- * @description:
- * A pointer to an @FT_Incremental_InterfaceRec structure.
- *
- */
- typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_INCREMENTAL
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to indicate
- * an incremental loading object to be used by FreeType.
- *
- */
+} FT_Incremental_InterfaceRec;
+
+
+/***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_Interface
+ *
+ * @description:
+ * A pointer to an @FT_Incremental_InterfaceRec structure.
+ *
+ */
+typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
+
+
+/***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_INCREMENTAL
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to indicate
+ * an incremental loading object to be used by FreeType.
+ *
+ */
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlcdfil.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlcdfil.h
index 8b253f1..68e34f9 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlcdfil.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlcdfil.h
@@ -32,105 +32,104 @@
FT_BEGIN_HEADER
- /***************************************************************************
- *
- * @section:
- * lcd_filtering
- *
- * @title:
- * LCD Filtering
- *
- * @abstract:
- * Reduce color fringes of LCD-optimized bitmaps.
- *
- * @description:
- * The @FT_Library_SetLcdFilter API can be used to specify a low-pass
- * filter which is then applied to LCD-optimized bitmaps generated
- * through @FT_Render_Glyph. This is useful to reduce color fringes
- * which would occur with unfiltered rendering.
- *
- * Note that no filter is active by default, and that this function is
- * *not* implemented in default builds of the library. You need to
- * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
- * in order to activate it.
- *
- * FreeType generates alpha coverage maps, which are linear by nature.
- * For instance, the value 0x80 in bitmap representation means that
- * (within numerical precision) 0x80/0xff fraction of that pixel is
- * covered by the glyph's outline. The blending function for placing
- * text over a background is
- *
- * {
- * dst = alpha * src + (1 - alpha) * dst ,
- * }
- *
- * which is known as OVER. However, when calculating the output of the
- * OVER operator, the source colors should first be transformed to a
- * linear color space, then alpha blended in that space, and transformed
- * back to the output color space.
- *
- * When linear light blending is used, the default FIR5 filtering
- * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
- * they have been designed for black on white rendering while lacking
- * gamma correction. To preserve color neutrality, weights for a FIR5
- * filter should be chosen according to two free parameters `a' and `c',
- * and the FIR weights should be
- *
- * {
- * [a - c, a + c, 2 * a, a + c, a - c] .
- * }
- *
- * This formula generates equal weights for all the color primaries
- * across the filter kernel, which makes it colorless. One suggested
- * set of weights is
- *
- * {
- * [0x10, 0x50, 0x60, 0x50, 0x10] ,
- * }
- *
- * where `a' has value 0x30 and `b' value 0x20. The weights in filter
- * may have a sum larger than 0x100, which increases coloration slightly
- * but also improves contrast.
- */
-
-
- /****************************************************************************
- *
- * @enum:
- * FT_LcdFilter
- *
- * @description:
- * A list of values to identify various types of LCD filters.
- *
- * @values:
- * FT_LCD_FILTER_NONE ::
- * Do not perform filtering. When used with subpixel rendering, this
- * results in sometimes severe color fringes.
- *
- * FT_LCD_FILTER_DEFAULT ::
- * The default filter reduces color fringes considerably, at the cost
- * of a slight blurriness in the output.
- *
- * FT_LCD_FILTER_LIGHT ::
- * The light filter is a variant that produces less blurriness at the
- * cost of slightly more color fringes than the default one. It might
- * be better, depending on taste, your monitor, or your personal vision.
- *
- * FT_LCD_FILTER_LEGACY ::
- * This filter corresponds to the original libXft color filter. It
- * provides high contrast output but can exhibit really bad color
- * fringes if glyphs are not extremely well hinted to the pixel grid.
- * In other words, it only works well if the TrueType bytecode
- * interpreter is enabled *and* high-quality hinted fonts are used.
- *
- * This filter is only provided for comparison purposes, and might be
- * disabled or stay unsupported in the future.
- *
- * @since:
- * 2.3.0
- */
- typedef enum FT_LcdFilter_
- {
+/***************************************************************************
+ *
+ * @section:
+ * lcd_filtering
+ *
+ * @title:
+ * LCD Filtering
+ *
+ * @abstract:
+ * Reduce color fringes of LCD-optimized bitmaps.
+ *
+ * @description:
+ * The @FT_Library_SetLcdFilter API can be used to specify a low-pass
+ * filter which is then applied to LCD-optimized bitmaps generated
+ * through @FT_Render_Glyph. This is useful to reduce color fringes
+ * which would occur with unfiltered rendering.
+ *
+ * Note that no filter is active by default, and that this function is
+ * *not* implemented in default builds of the library. You need to
+ * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
+ * in order to activate it.
+ *
+ * FreeType generates alpha coverage maps, which are linear by nature.
+ * For instance, the value 0x80 in bitmap representation means that
+ * (within numerical precision) 0x80/0xff fraction of that pixel is
+ * covered by the glyph's outline. The blending function for placing
+ * text over a background is
+ *
+ * {
+ * dst = alpha * src + (1 - alpha) * dst ,
+ * }
+ *
+ * which is known as OVER. However, when calculating the output of the
+ * OVER operator, the source colors should first be transformed to a
+ * linear color space, then alpha blended in that space, and transformed
+ * back to the output color space.
+ *
+ * When linear light blending is used, the default FIR5 filtering
+ * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
+ * they have been designed for black on white rendering while lacking
+ * gamma correction. To preserve color neutrality, weights for a FIR5
+ * filter should be chosen according to two free parameters `a' and `c',
+ * and the FIR weights should be
+ *
+ * {
+ * [a - c, a + c, 2 * a, a + c, a - c] .
+ * }
+ *
+ * This formula generates equal weights for all the color primaries
+ * across the filter kernel, which makes it colorless. One suggested
+ * set of weights is
+ *
+ * {
+ * [0x10, 0x50, 0x60, 0x50, 0x10] ,
+ * }
+ *
+ * where `a' has value 0x30 and `b' value 0x20. The weights in filter
+ * may have a sum larger than 0x100, which increases coloration slightly
+ * but also improves contrast.
+ */
+
+
+/****************************************************************************
+ *
+ * @enum:
+ * FT_LcdFilter
+ *
+ * @description:
+ * A list of values to identify various types of LCD filters.
+ *
+ * @values:
+ * FT_LCD_FILTER_NONE ::
+ * Do not perform filtering. When used with subpixel rendering, this
+ * results in sometimes severe color fringes.
+ *
+ * FT_LCD_FILTER_DEFAULT ::
+ * The default filter reduces color fringes considerably, at the cost
+ * of a slight blurriness in the output.
+ *
+ * FT_LCD_FILTER_LIGHT ::
+ * The light filter is a variant that produces less blurriness at the
+ * cost of slightly more color fringes than the default one. It might
+ * be better, depending on taste, your monitor, or your personal vision.
+ *
+ * FT_LCD_FILTER_LEGACY ::
+ * This filter corresponds to the original libXft color filter. It
+ * provides high contrast output but can exhibit really bad color
+ * fringes if glyphs are not extremely well hinted to the pixel grid.
+ * In other words, it only works well if the TrueType bytecode
+ * interpreter is enabled *and* high-quality hinted fonts are used.
+ *
+ * This filter is only provided for comparison purposes, and might be
+ * disabled or stay unsupported in the future.
+ *
+ * @since:
+ * 2.3.0
+ */
+typedef enum FT_LcdFilter_ {
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
@@ -138,109 +137,109 @@ FT_BEGIN_HEADER
FT_LCD_FILTER_MAX /* do not remove */
- } FT_LcdFilter;
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Library_SetLcdFilter
- *
- * @description:
- * This function is used to apply color filtering to LCD decimated
- * bitmaps, like the ones used when calling @FT_Render_Glyph with
- * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
- *
- * @input:
- * library ::
- * A handle to the target library instance.
- *
- * filter ::
- * The filter type.
- *
- * You can use @FT_LCD_FILTER_NONE here to disable this feature, or
- * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
- * well on most LCD screens.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This feature is always disabled by default. Clients must make an
- * explicit call to this function with a `filter' value other than
- * @FT_LCD_FILTER_NONE in order to enable it.
- *
- * Due to *PATENTS* covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature' if the
- * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
- *
- * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
- * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
- *
- * It does _not_ affect the output of @FT_Outline_Render and
- * @FT_Outline_Get_Bitmap.
- *
- * If this feature is activated, the dimensions of LCD glyph bitmaps are
- * either larger or taller than the dimensions of the corresponding
- * outline with regards to the pixel grid. For example, for
- * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
- * up to 3~pixels to the right.
- *
- * The bitmap offset values are adjusted correctly, so clients shouldn't
- * need to modify their layout and glyph positioning code when enabling
- * the filter.
- *
- * @since:
- * 2.3.0
- */
- FT_EXPORT( FT_Error )
- FT_Library_SetLcdFilter( FT_Library library,
- FT_LcdFilter filter );
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Library_SetLcdFilterWeights
- *
- * @description:
- * Use this function to override the filter weights selected by
- * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
- * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
- * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
- * FT_LCD_FILTER_LEGACY.
- *
- * @input:
- * library ::
- * A handle to the target library instance.
- *
- * weights ::
- * A pointer to an array; the function copies the first five bytes and
- * uses them to specify the filter weights.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * Due to *PATENTS* covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature' if the
- * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
- *
- * This function must be called after @FT_Library_SetLcdFilter to have
- * any effect.
- *
- * @since:
- * 2.4.0
- */
- FT_EXPORT( FT_Error )
- FT_Library_SetLcdFilterWeights( FT_Library library,
- unsigned char *weights );
-
- /* */
+} FT_LcdFilter;
+
+
+/**************************************************************************
+ *
+ * @func:
+ * FT_Library_SetLcdFilter
+ *
+ * @description:
+ * This function is used to apply color filtering to LCD decimated
+ * bitmaps, like the ones used when calling @FT_Render_Glyph with
+ * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
+ *
+ * @input:
+ * library ::
+ * A handle to the target library instance.
+ *
+ * filter ::
+ * The filter type.
+ *
+ * You can use @FT_LCD_FILTER_NONE here to disable this feature, or
+ * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
+ * well on most LCD screens.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This feature is always disabled by default. Clients must make an
+ * explicit call to this function with a `filter' value other than
+ * @FT_LCD_FILTER_NONE in order to enable it.
+ *
+ * Due to *PATENTS* covering subpixel rendering, this function doesn't
+ * do anything except returning `FT_Err_Unimplemented_Feature' if the
+ * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
+ * defined in your build of the library, which should correspond to all
+ * default builds of FreeType.
+ *
+ * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
+ * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
+ *
+ * It does _not_ affect the output of @FT_Outline_Render and
+ * @FT_Outline_Get_Bitmap.
+ *
+ * If this feature is activated, the dimensions of LCD glyph bitmaps are
+ * either larger or taller than the dimensions of the corresponding
+ * outline with regards to the pixel grid. For example, for
+ * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
+ * up to 3~pixels to the right.
+ *
+ * The bitmap offset values are adjusted correctly, so clients shouldn't
+ * need to modify their layout and glyph positioning code when enabling
+ * the filter.
+ *
+ * @since:
+ * 2.3.0
+ */
+FT_EXPORT( FT_Error )
+FT_Library_SetLcdFilter( FT_Library library,
+ FT_LcdFilter filter );
+
+
+/**************************************************************************
+ *
+ * @func:
+ * FT_Library_SetLcdFilterWeights
+ *
+ * @description:
+ * Use this function to override the filter weights selected by
+ * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
+ * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
+ * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
+ * FT_LCD_FILTER_LEGACY.
+ *
+ * @input:
+ * library ::
+ * A handle to the target library instance.
+ *
+ * weights ::
+ * A pointer to an array; the function copies the first five bytes and
+ * uses them to specify the filter weights.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * Due to *PATENTS* covering subpixel rendering, this function doesn't
+ * do anything except returning `FT_Err_Unimplemented_Feature' if the
+ * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
+ * defined in your build of the library, which should correspond to all
+ * default builds of FreeType.
+ *
+ * This function must be called after @FT_Library_SetLcdFilter to have
+ * any effect.
+ *
+ * @since:
+ * 2.4.0
+ */
+FT_EXPORT( FT_Error )
+FT_Library_SetLcdFilterWeights( FT_Library library,
+ unsigned char *weights );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlist.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlist.h
index bb6f7f1..44fcecd 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlist.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlist.h
@@ -16,12 +16,12 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This file implements functions relative to list processing. Its */
- /* data structures are defined in `freetype.h'. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This file implements functions relative to list processing. Its */
+/* data structures are defined in `freetype.h'. */
+/* */
+/*************************************************************************/
#ifndef __FTLIST_H__
@@ -41,232 +41,232 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* list_processing */
- /* */
- /* <Title> */
- /* List Processing */
- /* */
- /* <Abstract> */
- /* Simple management of lists. */
- /* */
- /* <Description> */
- /* This section contains various definitions related to list */
- /* processing using doubly-linked nodes. */
- /* */
- /* <Order> */
- /* FT_List */
- /* FT_ListNode */
- /* FT_ListRec */
- /* FT_ListNodeRec */
- /* */
- /* FT_List_Add */
- /* FT_List_Insert */
- /* FT_List_Find */
- /* FT_List_Remove */
- /* FT_List_Up */
- /* FT_List_Iterate */
- /* FT_List_Iterator */
- /* FT_List_Finalize */
- /* FT_List_Destructor */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Find */
- /* */
- /* <Description> */
- /* Find the list node for a given listed object. */
- /* */
- /* <Input> */
- /* list :: A pointer to the parent list. */
- /* data :: The address of the listed object. */
- /* */
- /* <Return> */
- /* List node. NULL if it wasn't found. */
- /* */
- FT_EXPORT( FT_ListNode )
- FT_List_Find( FT_List list,
- void* data );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Add */
- /* */
- /* <Description> */
- /* Append an element to the end of a list. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* node :: The node to append. */
- /* */
- FT_EXPORT( void )
- FT_List_Add( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Insert */
- /* */
- /* <Description> */
- /* Insert an element at the head of a list. */
- /* */
- /* <InOut> */
- /* list :: A pointer to parent list. */
- /* node :: The node to insert. */
- /* */
- FT_EXPORT( void )
- FT_List_Insert( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Remove */
- /* */
- /* <Description> */
- /* Remove a node from a list. This function doesn't check whether */
- /* the node is in the list! */
- /* */
- /* <Input> */
- /* node :: The node to remove. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* */
- FT_EXPORT( void )
- FT_List_Remove( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Up */
- /* */
- /* <Description> */
- /* Move a node to the head/top of a list. Used to maintain LRU */
- /* lists. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* node :: The node to move. */
- /* */
- FT_EXPORT( void )
- FT_List_Up( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_List_Iterator */
- /* */
- /* <Description> */
- /* An FT_List iterator function which is called during a list parse */
- /* by @FT_List_Iterate. */
- /* */
- /* <Input> */
- /* node :: The current iteration list node. */
- /* */
- /* user :: A typeless pointer passed to @FT_List_Iterate. */
- /* Can be used to point to the iteration's state. */
- /* */
- typedef FT_Error
- (*FT_List_Iterator)( FT_ListNode node,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Iterate */
- /* */
- /* <Description> */
- /* Parse a list and calls a given iterator function on each element. */
- /* Note that parsing is stopped as soon as one of the iterator calls */
- /* returns a non-zero value. */
- /* */
- /* <Input> */
- /* list :: A handle to the list. */
- /* iterator :: An iterator function, called on each node of the list. */
- /* user :: A user-supplied field which is passed as the second */
- /* argument to the iterator. */
- /* */
- /* <Return> */
- /* The result (a FreeType error code) of the last iterator call. */
- /* */
- FT_EXPORT( FT_Error )
- FT_List_Iterate( FT_List list,
- FT_List_Iterator iterator,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_List_Destructor */
- /* */
- /* <Description> */
- /* An @FT_List iterator function which is called during a list */
- /* finalization by @FT_List_Finalize to destroy all elements in a */
- /* given list. */
- /* */
- /* <Input> */
- /* system :: The current system object. */
- /* */
- /* data :: The current object to destroy. */
- /* */
- /* user :: A typeless pointer passed to @FT_List_Iterate. It can */
- /* be used to point to the iteration's state. */
- /* */
- typedef void
- (*FT_List_Destructor)( FT_Memory memory,
- void* data,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Finalize */
- /* */
- /* <Description> */
- /* Destroy all elements in the list as well as the list itself. */
- /* */
- /* <Input> */
- /* list :: A handle to the list. */
- /* */
- /* destroy :: A list destructor that will be applied to each element */
- /* of the list. */
- /* */
- /* memory :: The current memory object which handles deallocation. */
- /* */
- /* user :: A user-supplied field which is passed as the last */
- /* argument to the destructor. */
- /* */
- /* <Note> */
- /* This function expects that all nodes added by @FT_List_Add or */
- /* @FT_List_Insert have been dynamically allocated. */
- /* */
- FT_EXPORT( void )
- FT_List_Finalize( FT_List list,
- FT_List_Destructor destroy,
- FT_Memory memory,
- void* user );
-
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* list_processing */
+/* */
+/* <Title> */
+/* List Processing */
+/* */
+/* <Abstract> */
+/* Simple management of lists. */
+/* */
+/* <Description> */
+/* This section contains various definitions related to list */
+/* processing using doubly-linked nodes. */
+/* */
+/* <Order> */
+/* FT_List */
+/* FT_ListNode */
+/* FT_ListRec */
+/* FT_ListNodeRec */
+/* */
+/* FT_List_Add */
+/* FT_List_Insert */
+/* FT_List_Find */
+/* FT_List_Remove */
+/* FT_List_Up */
+/* FT_List_Iterate */
+/* FT_List_Iterator */
+/* FT_List_Finalize */
+/* FT_List_Destructor */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Find */
+/* */
+/* <Description> */
+/* Find the list node for a given listed object. */
+/* */
+/* <Input> */
+/* list :: A pointer to the parent list. */
+/* data :: The address of the listed object. */
+/* */
+/* <Return> */
+/* List node. NULL if it wasn't found. */
+/* */
+FT_EXPORT( FT_ListNode )
+FT_List_Find( FT_List list,
+ void* data );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Add */
+/* */
+/* <Description> */
+/* Append an element to the end of a list. */
+/* */
+/* <InOut> */
+/* list :: A pointer to the parent list. */
+/* node :: The node to append. */
+/* */
+FT_EXPORT( void )
+FT_List_Add( FT_List list,
+ FT_ListNode node );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Insert */
+/* */
+/* <Description> */
+/* Insert an element at the head of a list. */
+/* */
+/* <InOut> */
+/* list :: A pointer to parent list. */
+/* node :: The node to insert. */
+/* */
+FT_EXPORT( void )
+FT_List_Insert( FT_List list,
+ FT_ListNode node );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Remove */
+/* */
+/* <Description> */
+/* Remove a node from a list. This function doesn't check whether */
+/* the node is in the list! */
+/* */
+/* <Input> */
+/* node :: The node to remove. */
+/* */
+/* <InOut> */
+/* list :: A pointer to the parent list. */
+/* */
+FT_EXPORT( void )
+FT_List_Remove( FT_List list,
+ FT_ListNode node );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Up */
+/* */
+/* <Description> */
+/* Move a node to the head/top of a list. Used to maintain LRU */
+/* lists. */
+/* */
+/* <InOut> */
+/* list :: A pointer to the parent list. */
+/* node :: The node to move. */
+/* */
+FT_EXPORT( void )
+FT_List_Up( FT_List list,
+ FT_ListNode node );
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_List_Iterator */
+/* */
+/* <Description> */
+/* An FT_List iterator function which is called during a list parse */
+/* by @FT_List_Iterate. */
+/* */
+/* <Input> */
+/* node :: The current iteration list node. */
+/* */
+/* user :: A typeless pointer passed to @FT_List_Iterate. */
+/* Can be used to point to the iteration's state. */
+/* */
+typedef FT_Error
+(*FT_List_Iterator)( FT_ListNode node,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Iterate */
+/* */
+/* <Description> */
+/* Parse a list and calls a given iterator function on each element. */
+/* Note that parsing is stopped as soon as one of the iterator calls */
+/* returns a non-zero value. */
+/* */
+/* <Input> */
+/* list :: A handle to the list. */
+/* iterator :: An iterator function, called on each node of the list. */
+/* user :: A user-supplied field which is passed as the second */
+/* argument to the iterator. */
+/* */
+/* <Return> */
+/* The result (a FreeType error code) of the last iterator call. */
+/* */
+FT_EXPORT( FT_Error )
+FT_List_Iterate( FT_List list,
+ FT_List_Iterator iterator,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_List_Destructor */
+/* */
+/* <Description> */
+/* An @FT_List iterator function which is called during a list */
+/* finalization by @FT_List_Finalize to destroy all elements in a */
+/* given list. */
+/* */
+/* <Input> */
+/* system :: The current system object. */
+/* */
+/* data :: The current object to destroy. */
+/* */
+/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
+/* be used to point to the iteration's state. */
+/* */
+typedef void
+(*FT_List_Destructor)( FT_Memory memory,
+ void* data,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_List_Finalize */
+/* */
+/* <Description> */
+/* Destroy all elements in the list as well as the list itself. */
+/* */
+/* <Input> */
+/* list :: A handle to the list. */
+/* */
+/* destroy :: A list destructor that will be applied to each element */
+/* of the list. */
+/* */
+/* memory :: The current memory object which handles deallocation. */
+/* */
+/* user :: A user-supplied field which is passed as the last */
+/* argument to the destructor. */
+/* */
+/* <Note> */
+/* This function expects that all nodes added by @FT_List_Add or */
+/* @FT_List_Insert have been dynamically allocated. */
+/* */
+FT_EXPORT( void )
+FT_List_Finalize( FT_List list,
+ FT_List_Destructor destroy,
+ FT_Memory memory,
+ void* user );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlzw.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlzw.h
index 00d4016..2a7ecb2 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftlzw.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftlzw.h
@@ -31,64 +31,64 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* lzw */
- /* */
- /* <Title> */
- /* LZW Streams */
- /* */
- /* <Abstract> */
- /* Using LZW-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of LZW-specific functions. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* lzw */
+/* */
+/* <Title> */
+/* LZW Streams */
+/* */
+/* <Abstract> */
+/* Using LZW-compressed font files. */
+/* */
+/* <Description> */
+/* This section contains the declaration of LZW-specific functions. */
+/* */
+/*************************************************************************/
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenLZW
- *
- * @description:
- * Open a new stream to parse LZW-compressed font files. This is
- * mainly used to support the compressed `*.pcf.Z' fonts that come
- * with XFree86.
- *
- * @input:
- * stream :: The target embedding stream.
- *
- * source :: The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream
- *
- * In certain builds of the library, LZW compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a LZW stream from it
- * and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with LZW support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenLZW( FT_Stream stream,
- FT_Stream source );
+/************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenLZW
+ *
+ * @description:
+ * Open a new stream to parse LZW-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.Z' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream :: The target embedding stream.
+ *
+ * source :: The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream
+ *
+ * In certain builds of the library, LZW compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a LZW stream from it
+ * and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with LZW support.
+ */
+FT_EXPORT( FT_Error )
+FT_Stream_OpenLZW( FT_Stream stream,
+ FT_Stream source );
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmac.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmac.h
index ab5bab5..56a658d 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmac.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmac.h
@@ -46,223 +46,223 @@ FT_BEGIN_HEADER
#endif
- /*************************************************************************/
- /* */
- /* <Section> */
- /* mac_specific */
- /* */
- /* <Title> */
- /* Mac Specific Interface */
- /* */
- /* <Abstract> */
- /* Only available on the Macintosh. */
- /* */
- /* <Description> */
- /* The following definitions are only available if FreeType is */
- /* compiled on a Macintosh. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* mac_specific */
+/* */
+/* <Title> */
+/* Mac Specific Interface */
+/* */
+/* <Abstract> */
+/* Only available on the Macintosh. */
+/* */
+/* <Description> */
+/* The following definitions are only available if FreeType is */
+/* compiled on a Macintosh. */
+/* */
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FOND */
- /* */
- /* <Description> */
- /* Create a new face object from a FOND resource. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* fond :: A FOND resource. */
- /* */
- /* face_index :: Only supported for the -1 `sanity check' special */
- /* case. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Notes> */
- /* This function can be used to create @FT_Face objects from fonts */
- /* that are installed in the system as follows. */
- /* */
- /* { */
- /* fond = GetResource( 'FOND', fontName ); */
- /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
- /* } */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FOND( FT_Library library,
- Handle fond,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Face_From_FOND */
+/* */
+/* <Description> */
+/* Create a new face object from a FOND resource. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* fond :: A FOND resource. */
+/* */
+/* face_index :: Only supported for the -1 `sanity check' special */
+/* case. */
+/* */
+/* <Output> */
+/* aface :: A handle to a new face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Notes> */
+/* This function can be used to create @FT_Face objects from fonts */
+/* that are installed in the system as follows. */
+/* */
+/* { */
+/* fond = GetResource( 'FOND', fontName ); */
+/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
+/* } */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Face_From_FOND( FT_Library library,
+ Handle fond,
+ FT_Long face_index,
+ FT_Face *aface )
+FT_DEPRECATED_ATTRIBUTE;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFile_From_Mac_Name */
- /* */
- /* <Description> */
- /* Return an FSSpec for the disk file containing the named font. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font (e.g., Times New Roman */
- /* Bold). */
- /* */
- /* <Output> */
- /* pathSpec :: FSSpec to the file. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* face_index :: Index of the face. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFile_From_Mac_Name( const char* fontName,
- FSSpec* pathSpec,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_GetFile_From_Mac_Name */
+/* */
+/* <Description> */
+/* Return an FSSpec for the disk file containing the named font. */
+/* */
+/* <Input> */
+/* fontName :: Mac OS name of the font (e.g., Times New Roman */
+/* Bold). */
+/* */
+/* <Output> */
+/* pathSpec :: FSSpec to the file. For passing to */
+/* @FT_New_Face_From_FSSpec. */
+/* */
+/* face_index :: Index of the face. For passing to */
+/* @FT_New_Face_From_FSSpec. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_GetFile_From_Mac_Name( const char* fontName,
+ FSSpec* pathSpec,
+ FT_Long* face_index )
+FT_DEPRECATED_ATTRIBUTE;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFile_From_Mac_ATS_Name */
- /* */
- /* <Description> */
- /* Return an FSSpec for the disk file containing the named font. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font in ATS framework. */
- /* */
- /* <Output> */
- /* pathSpec :: FSSpec to the file. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* face_index :: Index of the face. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFile_From_Mac_ATS_Name( const char* fontName,
- FSSpec* pathSpec,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_GetFile_From_Mac_ATS_Name */
+/* */
+/* <Description> */
+/* Return an FSSpec for the disk file containing the named font. */
+/* */
+/* <Input> */
+/* fontName :: Mac OS name of the font in ATS framework. */
+/* */
+/* <Output> */
+/* pathSpec :: FSSpec to the file. For passing to */
+/* @FT_New_Face_From_FSSpec. */
+/* */
+/* face_index :: Index of the face. For passing to */
+/* @FT_New_Face_From_FSSpec. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_GetFile_From_Mac_ATS_Name( const char* fontName,
+ FSSpec* pathSpec,
+ FT_Long* face_index )
+FT_DEPRECATED_ATTRIBUTE;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFilePath_From_Mac_ATS_Name */
- /* */
- /* <Description> */
- /* Return a pathname of the disk file and face index for given font */
- /* name which is handled by ATS framework. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font in ATS framework. */
- /* */
- /* <Output> */
- /* path :: Buffer to store pathname of the file. For passing */
- /* to @FT_New_Face. The client must allocate this */
- /* buffer before calling this function. */
- /* */
- /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
- /* */
- /* face_index :: Index of the face. For passing to @FT_New_Face. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
- UInt8* path,
- UInt32 maxPathSize,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_GetFilePath_From_Mac_ATS_Name */
+/* */
+/* <Description> */
+/* Return a pathname of the disk file and face index for given font */
+/* name which is handled by ATS framework. */
+/* */
+/* <Input> */
+/* fontName :: Mac OS name of the font in ATS framework. */
+/* */
+/* <Output> */
+/* path :: Buffer to store pathname of the file. For passing */
+/* to @FT_New_Face. The client must allocate this */
+/* buffer before calling this function. */
+/* */
+/* maxPathSize :: Lengths of the buffer `path' that client allocated. */
+/* */
+/* face_index :: Index of the face. For passing to @FT_New_Face. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
+ UInt8* path,
+ UInt32 maxPathSize,
+ FT_Long* face_index )
+FT_DEPRECATED_ATTRIBUTE;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSSpec */
- /* */
- /* <Description> */
- /* Create a new face object from a given resource and typeface index */
- /* using an FSSpec to the font file. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* spec :: FSSpec to the font file. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index~0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
- /* it accepts an FSSpec instead of a path. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FSSpec( FT_Library library,
- const FSSpec *spec,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Face_From_FSSpec */
+/* */
+/* <Description> */
+/* Create a new face object from a given resource and typeface index */
+/* using an FSSpec to the font file. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* spec :: FSSpec to the font file. */
+/* */
+/* face_index :: The index of the face within the resource. The */
+/* first face has index~0. */
+/* <Output> */
+/* aface :: A handle to a new face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
+/* it accepts an FSSpec instead of a path. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Face_From_FSSpec( FT_Library library,
+ const FSSpec *spec,
+ FT_Long face_index,
+ FT_Face *aface )
+FT_DEPRECATED_ATTRIBUTE;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSRef */
- /* */
- /* <Description> */
- /* Create a new face object from a given resource and typeface index */
- /* using an FSRef to the font file. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* spec :: FSRef to the font file. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index~0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
- /* it accepts an FSRef instead of a path. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FSRef( FT_Library library,
- const FSRef *ref,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Face_From_FSRef */
+/* */
+/* <Description> */
+/* Create a new face object from a given resource and typeface index */
+/* using an FSRef to the font file. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library resource. */
+/* */
+/* <Input> */
+/* spec :: FSRef to the font file. */
+/* */
+/* face_index :: The index of the face within the resource. The */
+/* first face has index~0. */
+/* <Output> */
+/* aface :: A handle to a new face object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
+/* it accepts an FSRef instead of a path. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Face_From_FSRef( FT_Library library,
+ const FSRef *ref,
+ FT_Long face_index,
+ FT_Face *aface )
+FT_DEPRECATED_ATTRIBUTE;
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmm.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmm.h
index 3aefb9e..16fc3c9 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmm.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmm.h
@@ -27,118 +27,115 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* multiple_masters */
- /* */
- /* <Title> */
- /* Multiple Masters */
- /* */
- /* <Abstract> */
- /* How to manage Multiple Masters fonts. */
- /* */
- /* <Description> */
- /* The following types and functions are used to manage Multiple */
- /* Master fonts, i.e., the selection of specific design instances by */
- /* setting design axis coordinates. */
- /* */
- /* George Williams has extended this interface to make it work with */
- /* both Type~1 Multiple Masters fonts and GX distortable (var) */
- /* fonts. Some of these routines only work with MM fonts, others */
- /* will work with both types. They are similar enough that a */
- /* consistent interface makes sense. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_MM_Axis */
- /* */
- /* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters fonts. */
- /* */
- /* This structure can't be used for GX var fonts. */
- /* */
- /* <Fields> */
- /* name :: The axis's name. */
- /* */
- /* minimum :: The axis's minimum design coordinate. */
- /* */
- /* maximum :: The axis's maximum design coordinate. */
- /* */
- typedef struct FT_MM_Axis_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* multiple_masters */
+/* */
+/* <Title> */
+/* Multiple Masters */
+/* */
+/* <Abstract> */
+/* How to manage Multiple Masters fonts. */
+/* */
+/* <Description> */
+/* The following types and functions are used to manage Multiple */
+/* Master fonts, i.e., the selection of specific design instances by */
+/* setting design axis coordinates. */
+/* */
+/* George Williams has extended this interface to make it work with */
+/* both Type~1 Multiple Masters fonts and GX distortable (var) */
+/* fonts. Some of these routines only work with MM fonts, others */
+/* will work with both types. They are similar enough that a */
+/* consistent interface makes sense. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_MM_Axis */
+/* */
+/* <Description> */
+/* A simple structure used to model a given axis in design space for */
+/* Multiple Masters fonts. */
+/* */
+/* This structure can't be used for GX var fonts. */
+/* */
+/* <Fields> */
+/* name :: The axis's name. */
+/* */
+/* minimum :: The axis's minimum design coordinate. */
+/* */
+/* maximum :: The axis's maximum design coordinate. */
+/* */
+typedef struct FT_MM_Axis_ {
FT_String* name;
FT_Long minimum;
FT_Long maximum;
- } FT_MM_Axis;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Multi_Master */
- /* */
- /* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* font. */
- /* */
- /* This structure can't be used for GX var fonts. */
- /* */
- /* <Fields> */
- /* num_axis :: Number of axes. Cannot exceed~4. */
- /* */
- /* num_designs :: Number of designs; should be normally 2^num_axis */
- /* even though the Type~1 specification strangely */
- /* allows for intermediate designs to be present. This */
- /* number cannot exceed~16. */
- /* */
- /* axis :: A table of axis descriptors. */
- /* */
- typedef struct FT_Multi_Master_
- {
+} FT_MM_Axis;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Multi_Master */
+/* */
+/* <Description> */
+/* A structure used to model the axes and space of a Multiple Masters */
+/* font. */
+/* */
+/* This structure can't be used for GX var fonts. */
+/* */
+/* <Fields> */
+/* num_axis :: Number of axes. Cannot exceed~4. */
+/* */
+/* num_designs :: Number of designs; should be normally 2^num_axis */
+/* even though the Type~1 specification strangely */
+/* allows for intermediate designs to be present. This */
+/* number cannot exceed~16. */
+/* */
+/* axis :: A table of axis descriptors. */
+/* */
+typedef struct FT_Multi_Master_ {
FT_UInt num_axis;
FT_UInt num_designs;
FT_MM_Axis axis[T1_MAX_MM_AXIS];
- } FT_Multi_Master;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Var_Axis */
- /* */
- /* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters and GX var fonts. */
- /* */
- /* <Fields> */
- /* name :: The axis's name. */
- /* Not always meaningful for GX. */
- /* */
- /* minimum :: The axis's minimum design coordinate. */
- /* */
- /* def :: The axis's default design coordinate. */
- /* FreeType computes meaningful default values for MM; it */
- /* is then an integer value, not in 16.16 format. */
- /* */
- /* maximum :: The axis's maximum design coordinate. */
- /* */
- /* tag :: The axis's tag (the GX equivalent to `name'). */
- /* FreeType provides default values for MM if possible. */
- /* */
- /* strid :: The entry in `name' table (another GX version of */
- /* `name'). */
- /* Not meaningful for MM. */
- /* */
- typedef struct FT_Var_Axis_
- {
+} FT_Multi_Master;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Var_Axis */
+/* */
+/* <Description> */
+/* A simple structure used to model a given axis in design space for */
+/* Multiple Masters and GX var fonts. */
+/* */
+/* <Fields> */
+/* name :: The axis's name. */
+/* Not always meaningful for GX. */
+/* */
+/* minimum :: The axis's minimum design coordinate. */
+/* */
+/* def :: The axis's default design coordinate. */
+/* FreeType computes meaningful default values for MM; it */
+/* is then an integer value, not in 16.16 format. */
+/* */
+/* maximum :: The axis's maximum design coordinate. */
+/* */
+/* tag :: The axis's tag (the GX equivalent to `name'). */
+/* FreeType provides default values for MM if possible. */
+/* */
+/* strid :: The entry in `name' table (another GX version of */
+/* `name'). */
+/* Not meaningful for MM. */
+/* */
+typedef struct FT_Var_Axis_ {
FT_String* name;
FT_Fixed minimum;
@@ -148,226 +145,224 @@ FT_BEGIN_HEADER
FT_ULong tag;
FT_UInt strid;
- } FT_Var_Axis;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Var_Named_Style */
- /* */
- /* <Description> */
- /* A simple structure used to model a named style in a GX var font. */
- /* */
- /* This structure can't be used for MM fonts. */
- /* */
- /* <Fields> */
- /* coords :: The design coordinates for this style. */
- /* This is an array with one entry for each axis. */
- /* */
- /* strid :: The entry in `name' table identifying this style. */
- /* */
- typedef struct FT_Var_Named_Style_
- {
+} FT_Var_Axis;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Var_Named_Style */
+/* */
+/* <Description> */
+/* A simple structure used to model a named style in a GX var font. */
+/* */
+/* This structure can't be used for MM fonts. */
+/* */
+/* <Fields> */
+/* coords :: The design coordinates for this style. */
+/* This is an array with one entry for each axis. */
+/* */
+/* strid :: The entry in `name' table identifying this style. */
+/* */
+typedef struct FT_Var_Named_Style_ {
FT_Fixed* coords;
FT_UInt strid;
- } FT_Var_Named_Style;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_MM_Var */
- /* */
- /* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* or GX var distortable font. */
- /* */
- /* Some fields are specific to one format and not to the other. */
- /* */
- /* <Fields> */
- /* num_axis :: The number of axes. The maximum value is~4 for */
- /* MM; no limit in GX. */
- /* */
- /* num_designs :: The number of designs; should be normally */
- /* 2^num_axis for MM fonts. Not meaningful for GX */
- /* (where every glyph could have a different */
- /* number of designs). */
- /* */
- /* num_namedstyles :: The number of named styles; only meaningful for */
- /* GX which allows certain design coordinates to */
- /* have a string ID (in the `name' table) */
- /* associated with them. The font can tell the */
- /* user that, for example, Weight=1.5 is `Bold'. */
- /* */
- /* axis :: A table of axis descriptors. */
- /* GX fonts contain slightly more data than MM. */
- /* */
- /* namedstyles :: A table of named styles. */
- /* Only meaningful with GX. */
- /* */
- typedef struct FT_MM_Var_
- {
+} FT_Var_Named_Style;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_MM_Var */
+/* */
+/* <Description> */
+/* A structure used to model the axes and space of a Multiple Masters */
+/* or GX var distortable font. */
+/* */
+/* Some fields are specific to one format and not to the other. */
+/* */
+/* <Fields> */
+/* num_axis :: The number of axes. The maximum value is~4 for */
+/* MM; no limit in GX. */
+/* */
+/* num_designs :: The number of designs; should be normally */
+/* 2^num_axis for MM fonts. Not meaningful for GX */
+/* (where every glyph could have a different */
+/* number of designs). */
+/* */
+/* num_namedstyles :: The number of named styles; only meaningful for */
+/* GX which allows certain design coordinates to */
+/* have a string ID (in the `name' table) */
+/* associated with them. The font can tell the */
+/* user that, for example, Weight=1.5 is `Bold'. */
+/* */
+/* axis :: A table of axis descriptors. */
+/* GX fonts contain slightly more data than MM. */
+/* */
+/* namedstyles :: A table of named styles. */
+/* Only meaningful with GX. */
+/* */
+typedef struct FT_MM_Var_ {
FT_UInt num_axis;
FT_UInt num_designs;
FT_UInt num_namedstyles;
FT_Var_Axis* axis;
FT_Var_Named_Style* namedstyle;
- } FT_MM_Var;
-
-
- /* */
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Multi_Master */
- /* */
- /* <Description> */
- /* Retrieve the Multiple Master descriptor of a given font. */
- /* */
- /* This function can't be used with GX fonts. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Output> */
- /* amaster :: The Multiple Masters descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Multi_Master( FT_Face face,
- FT_Multi_Master *amaster );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_MM_Var */
- /* */
- /* <Description> */
- /* Retrieve the Multiple Master/GX var descriptor of a given font. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Output> */
- /* amaster :: The Multiple Masters/GX var descriptor. */
- /* Allocates a data structure, which the user must free */
- /* (a single call to FT_FREE will do it). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_MM_Var( FT_Face face,
- FT_MM_Var* *amaster );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_MM_Design_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Masters fonts, choose an interpolated font design */
- /* through design coordinates. */
- /* */
- /* This function can't be used with GX fonts. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: An array of design coordinates. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_MM_Design_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Var_Design_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Master or GX Var fonts, choose an interpolated font */
- /* design through design coordinates. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: An array of design coordinates. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Var_Design_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_MM_Blend_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Masters and GX var fonts, choose an interpolated font */
- /* design through normalized blend coordinates. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: The design coordinates array (each element must be */
- /* between 0 and 1.0). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_MM_Blend_Coordinates( FT_Face face,
+} FT_MM_Var;
+
+
+/* */
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Multi_Master */
+/* */
+/* <Description> */
+/* Retrieve the Multiple Master descriptor of a given font. */
+/* */
+/* This function can't be used with GX fonts. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face. */
+/* */
+/* <Output> */
+/* amaster :: The Multiple Masters descriptor. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Multi_Master( FT_Face face,
+ FT_Multi_Master *amaster );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_MM_Var */
+/* */
+/* <Description> */
+/* Retrieve the Multiple Master/GX var descriptor of a given font. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face. */
+/* */
+/* <Output> */
+/* amaster :: The Multiple Masters/GX var descriptor. */
+/* Allocates a data structure, which the user must free */
+/* (a single call to FT_FREE will do it). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_MM_Var( FT_Face face,
+ FT_MM_Var**amaster );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_MM_Design_Coordinates */
+/* */
+/* <Description> */
+/* For Multiple Masters fonts, choose an interpolated font design */
+/* through design coordinates. */
+/* */
+/* This function can't be used with GX fonts. */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face. */
+/* */
+/* <Input> */
+/* num_coords :: The number of design coordinates (must be equal to */
+/* the number of axes in the font). */
+/* */
+/* coords :: An array of design coordinates. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_MM_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Var_Design_Coordinates */
+/* */
+/* <Description> */
+/* For Multiple Master or GX Var fonts, choose an interpolated font */
+/* design through design coordinates. */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face. */
+/* */
+/* <Input> */
+/* num_coords :: The number of design coordinates (must be equal to */
+/* the number of axes in the font). */
+/* */
+/* coords :: An array of design coordinates. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Var_Blend_Coordinates */
- /* */
- /* <Description> */
- /* This is another name of @FT_Set_MM_Blend_Coordinates. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Var_Blend_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
-
- /* */
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_MM_Blend_Coordinates */
+/* */
+/* <Description> */
+/* For Multiple Masters and GX var fonts, choose an interpolated font */
+/* design through normalized blend coordinates. */
+/* */
+/* <InOut> */
+/* face :: A handle to the source face. */
+/* */
+/* <Input> */
+/* num_coords :: The number of design coordinates (must be equal to */
+/* the number of axes in the font). */
+/* */
+/* coords :: The design coordinates array (each element must be */
+/* between 0 and 1.0). */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Var_Blend_Coordinates */
+/* */
+/* <Description> */
+/* This is another name of @FT_Set_MM_Blend_Coordinates. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Var_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmodapi.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmodapi.h
index aedfc54..4b67065 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmodapi.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmodapi.h
@@ -33,66 +33,66 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* module_management */
- /* */
- /* <Title> */
- /* Module Management */
- /* */
- /* <Abstract> */
- /* How to add, upgrade, remove, and control modules from FreeType. */
- /* */
- /* <Description> */
- /* The definitions below are used to manage modules within FreeType. */
- /* Modules can be added, upgraded, and removed at runtime. */
- /* Additionally, some module properties can be controlled also. */
- /* */
- /* Here is a list of possible values of the `module_name' field in */
- /* the @FT_Module_Class structure. */
- /* */
- /* { */
- /* autofitter */
- /* bdf */
- /* cff */
- /* gxvalid */
- /* otvalid */
- /* pcf */
- /* pfr */
- /* psaux */
- /* pshinter */
- /* psnames */
- /* raster1, raster5 */
- /* sfnt */
- /* smooth, smooth-lcd, smooth-lcdv */
- /* truetype */
- /* type1 */
- /* type42 */
- /* t1cid */
- /* winfonts */
- /* } */
- /* */
- /* Note that the FreeType Cache sub-system is not a FreeType module. */
- /* */
- /*************************************************************************/
-
-
- /* module bit flags */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* module_management */
+/* */
+/* <Title> */
+/* Module Management */
+/* */
+/* <Abstract> */
+/* How to add, upgrade, remove, and control modules from FreeType. */
+/* */
+/* <Description> */
+/* The definitions below are used to manage modules within FreeType. */
+/* Modules can be added, upgraded, and removed at runtime. */
+/* Additionally, some module properties can be controlled also. */
+/* */
+/* Here is a list of possible values of the `module_name' field in */
+/* the @FT_Module_Class structure. */
+/* */
+/* { */
+/* autofitter */
+/* bdf */
+/* cff */
+/* gxvalid */
+/* otvalid */
+/* pcf */
+/* pfr */
+/* psaux */
+/* pshinter */
+/* psnames */
+/* raster1, raster5 */
+/* sfnt */
+/* smooth, smooth-lcd, smooth-lcdv */
+/* truetype */
+/* type1 */
+/* type42 */
+/* t1cid */
+/* winfonts */
+/* } */
+/* */
+/* Note that the FreeType Cache sub-system is not a FreeType module. */
+/* */
+/*************************************************************************/
+
+
+/* module bit flags */
#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
#define FT_MODULE_RENDERER 2 /* this module is a renderer */
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
- /* scalable fonts */
+/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
- /* support vector outlines */
+/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
- /* own hinter */
+/* own hinter */
- /* deprecated values */
+/* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER
@@ -103,88 +103,87 @@ FT_BEGIN_HEADER
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
- typedef FT_Pointer FT_Module_Interface;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Constructor */
- /* */
- /* <Description> */
- /* A function used to initialize (not create) a new module object. */
- /* */
- /* <Input> */
- /* module :: The module to initialize. */
- /* */
- typedef FT_Error
- (*FT_Module_Constructor)( FT_Module module );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Destructor */
- /* */
- /* <Description> */
- /* A function used to finalize (not destroy) a given module object. */
- /* */
- /* <Input> */
- /* module :: The module to finalize. */
- /* */
- typedef void
- (*FT_Module_Destructor)( FT_Module module );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Requester */
- /* */
- /* <Description> */
- /* A function used to query a given module for a specific interface. */
- /* */
- /* <Input> */
- /* module :: The module to be searched. */
- /* */
- /* name :: The name of the interface in the module. */
- /* */
- typedef FT_Module_Interface
- (*FT_Module_Requester)( FT_Module module,
- const char* name );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Module_Class */
- /* */
- /* <Description> */
- /* The module class descriptor. */
- /* */
- /* <Fields> */
- /* module_flags :: Bit flags describing the module. */
- /* */
- /* module_size :: The size of one module object/instance in */
- /* bytes. */
- /* */
- /* module_name :: The name of the module. */
- /* */
- /* module_version :: The version, as a 16.16 fixed number */
- /* (major.minor). */
- /* */
- /* module_requires :: The version of FreeType this module requires, */
- /* as a 16.16 fixed number (major.minor). Starts */
- /* at version 2.0, i.e., 0x20000. */
- /* */
- /* module_init :: The initializing function. */
- /* */
- /* module_done :: The finalizing function. */
- /* */
- /* get_interface :: The interface requesting function. */
- /* */
- typedef struct FT_Module_Class_
- {
+typedef FT_Pointer FT_Module_Interface;
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Module_Constructor */
+/* */
+/* <Description> */
+/* A function used to initialize (not create) a new module object. */
+/* */
+/* <Input> */
+/* module :: The module to initialize. */
+/* */
+typedef FT_Error
+(*FT_Module_Constructor)( FT_Module module );
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Module_Destructor */
+/* */
+/* <Description> */
+/* A function used to finalize (not destroy) a given module object. */
+/* */
+/* <Input> */
+/* module :: The module to finalize. */
+/* */
+typedef void
+(*FT_Module_Destructor)( FT_Module module );
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Module_Requester */
+/* */
+/* <Description> */
+/* A function used to query a given module for a specific interface. */
+/* */
+/* <Input> */
+/* module :: The module to be searched. */
+/* */
+/* name :: The name of the interface in the module. */
+/* */
+typedef FT_Module_Interface
+(*FT_Module_Requester)( FT_Module module,
+ const char* name );
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Module_Class */
+/* */
+/* <Description> */
+/* The module class descriptor. */
+/* */
+/* <Fields> */
+/* module_flags :: Bit flags describing the module. */
+/* */
+/* module_size :: The size of one module object/instance in */
+/* bytes. */
+/* */
+/* module_name :: The name of the module. */
+/* */
+/* module_version :: The version, as a 16.16 fixed number */
+/* (major.minor). */
+/* */
+/* module_requires :: The version of FreeType this module requires, */
+/* as a 16.16 fixed number (major.minor). Starts */
+/* at version 2.0, i.e., 0x20000. */
+/* */
+/* module_init :: The initializing function. */
+/* */
+/* module_done :: The finalizing function. */
+/* */
+/* get_interface :: The interface requesting function. */
+/* */
+typedef struct FT_Module_Class_ {
FT_ULong module_flags;
FT_Long module_size;
const FT_String* module_name;
@@ -197,433 +196,432 @@ FT_BEGIN_HEADER
FT_Module_Destructor module_done;
FT_Module_Requester get_interface;
- } FT_Module_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add_Module */
- /* */
- /* <Description> */
- /* Add a new module to a given library instance. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* clazz :: A pointer to class descriptor for the module. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* An error will be returned if a module already exists by that name, */
- /* or if the module requires a version of FreeType that is too great. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Add_Module( FT_Library library,
- const FT_Module_Class* clazz );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Module */
- /* */
- /* <Description> */
- /* Find a module by its name. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* module_name :: The module's name (as an ASCII string). */
- /* */
- /* <Return> */
- /* A module handle. 0~if none was found. */
- /* */
- /* <Note> */
- /* FreeType's internal modules aren't documented very well, and you */
- /* should look up the source code for details. */
- /* */
- FT_EXPORT( FT_Module )
- FT_Get_Module( FT_Library library,
- const char* module_name );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Remove_Module */
- /* */
- /* <Description> */
- /* Remove a given module from a library instance. */
- /* */
- /* <InOut> */
- /* library :: A handle to a library object. */
- /* */
- /* <Input> */
- /* module :: A handle to a module object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The module object is destroyed by the function in case of success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Remove_Module( FT_Library library,
- FT_Module module );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Property_Set
- *
- * @description:
- * Set a property for a given module.
- *
- * @input:
- * library ::
- * A handle to the library the module is part of.
- *
- * module_name ::
- * The module name.
- *
- * property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
- *
- * Note that only a few modules have properties.
- *
- * value ::
- * A generic pointer to a variable or structure which gives the new
- * value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `module_name' isn't a valid module name, or `property_name'
- * doesn't specify a valid property, or if `value' doesn't represent a
- * valid value for the given property, an error is returned.
- *
- * The following example sets property `bar' (a simple integer) in
- * module `foo' to value~1.
- *
- * {
- * FT_UInt bar;
- *
- *
- * bar = 1;
- * FT_Property_Set( library, "foo", "bar", &bar );
- * }
- *
- * It is not possible to set properties of the FreeType Cache
- * sub-system with FT_Property_Set; use @FTC_Property_Set instead.
- *
- * @since:
- * 2.4.11
- *
- */
- FT_Error
- FT_Property_Set( FT_Library library,
- const FT_String* module_name,
- const FT_String* property_name,
- const void* value );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Property_Get
- *
- * @description:
- * Get a module's property value.
- *
- * @input:
- * library ::
- * A handle to the library the module is part of.
- *
- * module_name ::
- * The module name.
- *
- * property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
- *
- * @inout:
- * value ::
- * A generic pointer to a variable or structure which gives the
- * value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `module_name' isn't a valid module name, or `property_name'
- * doesn't specify a valid property, or if `value' doesn't represent a
- * valid value for the given property, an error is returned.
- *
- * The following example gets property `baz' (a range) in module `foo'.
- *
- * {
- * typedef range_
- * {
- * FT_Int32 min;
- * FT_Int32 max;
- *
- * } range;
- *
- * range baz;
- *
- *
- * FT_Property_Get( library, "foo", "baz", &baz );
- * }
- *
- * It is not possible to retrieve properties of the FreeType Cache
- * sub-system with FT_Property_Get; use @FTC_Property_Get instead.
- *
- * @since:
- * 2.4.11
- *
- */
- FT_Error
- FT_Property_Get( FT_Library library,
- const FT_String* module_name,
- const FT_String* property_name,
- void* value );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Reference_Library */
- /* */
- /* <Description> */
- /* A counter gets initialized to~1 at the time an @FT_Library */
- /* structure is created. This function increments the counter. */
- /* @FT_Done_Library then only destroys a library if the counter is~1, */
- /* otherwise it simply decrements the counter. */
- /* */
- /* This function helps in managing life-cycles of structures which */
- /* reference @FT_Library objects. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Since> */
- /* 2.4.2 */
- /* */
- FT_EXPORT( FT_Error )
- FT_Reference_Library( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Library */
- /* */
- /* <Description> */
- /* This function is used to create a new FreeType library instance */
- /* from a given memory object. It is thus possible to use libraries */
- /* with distinct memory allocators within the same program. */
- /* */
- /* Normally, you would call this function (followed by a call to */
- /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
- /* instead of @FT_Init_FreeType to initialize the FreeType library. */
- /* */
- /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
- /* library instance. */
- /* */
- /* <Input> */
- /* memory :: A handle to the original memory object. */
- /* */
- /* <Output> */
- /* alibrary :: A pointer to handle of a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Library( FT_Memory memory,
- FT_Library *alibrary );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Library */
- /* */
- /* <Description> */
- /* Discard a given library object. This closes all drivers and */
- /* discards all resource objects. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Library( FT_Library library );
+} FT_Module_Class;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Add_Module */
+/* */
+/* <Description> */
+/* Add a new module to a given library instance. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library object. */
+/* */
+/* <Input> */
+/* clazz :: A pointer to class descriptor for the module. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* An error will be returned if a module already exists by that name, */
+/* or if the module requires a version of FreeType that is too great. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Add_Module( FT_Library library,
+ const FT_Module_Class* clazz );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Module */
+/* */
+/* <Description> */
+/* Find a module by its name. */
+/* */
+/* <Input> */
+/* library :: A handle to the library object. */
+/* */
+/* module_name :: The module's name (as an ASCII string). */
+/* */
+/* <Return> */
+/* A module handle. 0~if none was found. */
+/* */
+/* <Note> */
+/* FreeType's internal modules aren't documented very well, and you */
+/* should look up the source code for details. */
+/* */
+FT_EXPORT( FT_Module )
+FT_Get_Module( FT_Library library,
+ const char* module_name );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Remove_Module */
+/* */
+/* <Description> */
+/* Remove a given module from a library instance. */
+/* */
+/* <InOut> */
+/* library :: A handle to a library object. */
+/* */
+/* <Input> */
+/* module :: A handle to a module object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The module object is destroyed by the function in case of success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Remove_Module( FT_Library library,
+ FT_Module module );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Property_Set
+ *
+ * @description:
+ * Set a property for a given module.
+ *
+ * @input:
+ * library ::
+ * A handle to the library the module is part of.
+ *
+ * module_name ::
+ * The module name.
+ *
+ * property_name ::
+ * The property name. Properties are described in the `Synopsis'
+ * subsection of the module's documentation.
+ *
+ * Note that only a few modules have properties.
+ *
+ * value ::
+ * A generic pointer to a variable or structure which gives the new
+ * value of the property. The exact definition of `value' is
+ * dependent on the property; see the `Synopsis' subsection of the
+ * module's documentation.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `module_name' isn't a valid module name, or `property_name'
+ * doesn't specify a valid property, or if `value' doesn't represent a
+ * valid value for the given property, an error is returned.
+ *
+ * The following example sets property `bar' (a simple integer) in
+ * module `foo' to value~1.
+ *
+ * {
+ * FT_UInt bar;
+ *
+ *
+ * bar = 1;
+ * FT_Property_Set( library, "foo", "bar", &bar );
+ * }
+ *
+ * It is not possible to set properties of the FreeType Cache
+ * sub-system with FT_Property_Set; use @FTC_Property_Set instead.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+FT_Error
+FT_Property_Set( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ const void* value );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Property_Get
+ *
+ * @description:
+ * Get a module's property value.
+ *
+ * @input:
+ * library ::
+ * A handle to the library the module is part of.
+ *
+ * module_name ::
+ * The module name.
+ *
+ * property_name ::
+ * The property name. Properties are described in the `Synopsis'
+ * subsection of the module's documentation.
+ *
+ * @inout:
+ * value ::
+ * A generic pointer to a variable or structure which gives the
+ * value of the property. The exact definition of `value' is
+ * dependent on the property; see the `Synopsis' subsection of the
+ * module's documentation.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `module_name' isn't a valid module name, or `property_name'
+ * doesn't specify a valid property, or if `value' doesn't represent a
+ * valid value for the given property, an error is returned.
+ *
+ * The following example gets property `baz' (a range) in module `foo'.
+ *
+ * {
+ * typedef range_
+ * {
+ * FT_Int32 min;
+ * FT_Int32 max;
+ *
+ * } range;
+ *
+ * range baz;
+ *
+ *
+ * FT_Property_Get( library, "foo", "baz", &baz );
+ * }
+ *
+ * It is not possible to retrieve properties of the FreeType Cache
+ * sub-system with FT_Property_Get; use @FTC_Property_Get instead.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+FT_Error
+FT_Property_Get( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ void* value );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Reference_Library */
+/* */
+/* <Description> */
+/* A counter gets initialized to~1 at the time an @FT_Library */
+/* structure is created. This function increments the counter. */
+/* @FT_Done_Library then only destroys a library if the counter is~1, */
+/* otherwise it simply decrements the counter. */
+/* */
+/* This function helps in managing life-cycles of structures which */
+/* reference @FT_Library objects. */
+/* */
+/* <Input> */
+/* library :: A handle to a target library object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Since> */
+/* 2.4.2 */
+/* */
+FT_EXPORT( FT_Error )
+FT_Reference_Library( FT_Library library );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Library */
+/* */
+/* <Description> */
+/* This function is used to create a new FreeType library instance */
+/* from a given memory object. It is thus possible to use libraries */
+/* with distinct memory allocators within the same program. */
+/* */
+/* Normally, you would call this function (followed by a call to */
+/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
+/* instead of @FT_Init_FreeType to initialize the FreeType library. */
+/* */
+/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
+/* library instance. */
+/* */
+/* <Input> */
+/* memory :: A handle to the original memory object. */
+/* */
+/* <Output> */
+/* alibrary :: A pointer to handle of a new library object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* See the discussion of reference counters in the description of */
+/* @FT_Reference_Library. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Library( FT_Memory memory,
+ FT_Library *alibrary );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Done_Library */
+/* */
+/* <Description> */
+/* Discard a given library object. This closes all drivers and */
+/* discards all resource objects. */
+/* */
+/* <Input> */
+/* library :: A handle to the target library. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* See the discussion of reference counters in the description of */
+/* @FT_Reference_Library. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Done_Library( FT_Library library );
/* */
- typedef void
- (*FT_DebugHook_Func)( void* arg );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Debug_Hook */
- /* */
- /* <Description> */
- /* Set a debug hook function for debugging the interpreter of a font */
- /* format. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* hook_index :: The index of the debug hook. You should use the */
- /* values defined in `ftobjs.h', e.g., */
- /* `FT_DEBUG_HOOK_TRUETYPE'. */
- /* */
- /* debug_hook :: The function used to debug the interpreter. */
- /* */
- /* <Note> */
- /* Currently, four debug hook slots are available, but only two (for */
- /* the TrueType and the Type~1 interpreter) are defined. */
- /* */
- /* Since the internal headers of FreeType are no longer installed, */
- /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
- /* This is a bug and will be fixed in a forthcoming release. */
- /* */
- FT_EXPORT( void )
- FT_Set_Debug_Hook( FT_Library library,
- FT_UInt hook_index,
- FT_DebugHook_Func debug_hook );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add_Default_Modules */
- /* */
- /* <Description> */
- /* Add the set of default drivers to a given library object. */
- /* This is only useful when you create a library object with */
- /* @FT_New_Library (usually to plug a custom memory manager). */
- /* */
- /* <InOut> */
- /* library :: A handle to a new library object. */
- /* */
- FT_EXPORT( void )
- FT_Add_Default_Modules( FT_Library library );
-
-
-
- /**************************************************************************
- *
- * @section:
- * truetype_engine
- *
- * @title:
- * The TrueType Engine
- *
- * @abstract:
- * TrueType bytecode support.
- *
- * @description:
- * This section contains a function used to query the level of TrueType
- * bytecode support compiled in this version of the library.
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_TrueTypeEngineType
- *
- * @description:
- * A list of values describing which kind of TrueType bytecode
- * engine is implemented in a given FT_Library instance. It is used
- * by the @FT_Get_TrueType_Engine_Type function.
- *
- * @values:
- * FT_TRUETYPE_ENGINE_TYPE_NONE ::
- * The library doesn't implement any kind of bytecode interpreter.
- *
- * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
- * The library implements a bytecode interpreter that doesn't
- * support the patented operations of the TrueType virtual machine.
- *
- * Its main use is to load certain Asian fonts which position and
- * scale glyph components with bytecode instructions. It produces
- * bad output for most other fonts.
- *
- * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
- * The library implements a bytecode interpreter that covers
- * the full instruction set of the TrueType virtual machine (this
- * was governed by patents until May 2010, hence the name).
- *
- * @since:
- * 2.2
- *
- */
- typedef enum FT_TrueTypeEngineType_
- {
+typedef void
+(*FT_DebugHook_Func)( void* arg );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Debug_Hook */
+/* */
+/* <Description> */
+/* Set a debug hook function for debugging the interpreter of a font */
+/* format. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library object. */
+/* */
+/* <Input> */
+/* hook_index :: The index of the debug hook. You should use the */
+/* values defined in `ftobjs.h', e.g., */
+/* `FT_DEBUG_HOOK_TRUETYPE'. */
+/* */
+/* debug_hook :: The function used to debug the interpreter. */
+/* */
+/* <Note> */
+/* Currently, four debug hook slots are available, but only two (for */
+/* the TrueType and the Type~1 interpreter) are defined. */
+/* */
+/* Since the internal headers of FreeType are no longer installed, */
+/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
+/* This is a bug and will be fixed in a forthcoming release. */
+/* */
+FT_EXPORT( void )
+FT_Set_Debug_Hook( FT_Library library,
+ FT_UInt hook_index,
+ FT_DebugHook_Func debug_hook );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Add_Default_Modules */
+/* */
+/* <Description> */
+/* Add the set of default drivers to a given library object. */
+/* This is only useful when you create a library object with */
+/* @FT_New_Library (usually to plug a custom memory manager). */
+/* */
+/* <InOut> */
+/* library :: A handle to a new library object. */
+/* */
+FT_EXPORT( void )
+FT_Add_Default_Modules( FT_Library library );
+
+
+
+/**************************************************************************
+ *
+ * @section:
+ * truetype_engine
+ *
+ * @title:
+ * The TrueType Engine
+ *
+ * @abstract:
+ * TrueType bytecode support.
+ *
+ * @description:
+ * This section contains a function used to query the level of TrueType
+ * bytecode support compiled in this version of the library.
+ *
+ */
+
+
+/**************************************************************************
+ *
+ * @enum:
+ * FT_TrueTypeEngineType
+ *
+ * @description:
+ * A list of values describing which kind of TrueType bytecode
+ * engine is implemented in a given FT_Library instance. It is used
+ * by the @FT_Get_TrueType_Engine_Type function.
+ *
+ * @values:
+ * FT_TRUETYPE_ENGINE_TYPE_NONE ::
+ * The library doesn't implement any kind of bytecode interpreter.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
+ * The library implements a bytecode interpreter that doesn't
+ * support the patented operations of the TrueType virtual machine.
+ *
+ * Its main use is to load certain Asian fonts which position and
+ * scale glyph components with bytecode instructions. It produces
+ * bad output for most other fonts.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
+ * The library implements a bytecode interpreter that covers
+ * the full instruction set of the TrueType virtual machine (this
+ * was governed by patents until May 2010, hence the name).
+ *
+ * @since:
+ * 2.2
+ *
+ */
+typedef enum FT_TrueTypeEngineType_ {
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
FT_TRUETYPE_ENGINE_TYPE_PATENTED
- } FT_TrueTypeEngineType;
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Get_TrueType_Engine_Type
- *
- * @description:
- * Return an @FT_TrueTypeEngineType value to indicate which level of
- * the TrueType virtual machine a given library instance supports.
- *
- * @input:
- * library ::
- * A library instance.
- *
- * @return:
- * A value indicating which level is supported.
- *
- * @since:
- * 2.2
- *
- */
- FT_EXPORT( FT_TrueTypeEngineType )
- FT_Get_TrueType_Engine_Type( FT_Library library );
-
-
- /* */
+} FT_TrueTypeEngineType;
+
+
+/**************************************************************************
+ *
+ * @func:
+ * FT_Get_TrueType_Engine_Type
+ *
+ * @description:
+ * Return an @FT_TrueTypeEngineType value to indicate which level of
+ * the TrueType virtual machine a given library instance supports.
+ *
+ * @input:
+ * library ::
+ * A library instance.
+ *
+ * @return:
+ * A value indicating which level is supported.
+ *
+ * @since:
+ * 2.2
+ *
+ */
+FT_EXPORT( FT_TrueTypeEngineType )
+FT_Get_TrueType_Engine_Type( FT_Library library );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmoderr.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmoderr.h
index 5a27db1..90a3e45 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftmoderr.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftmoderr.h
@@ -16,92 +16,92 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This file is used to define the FreeType module error codes. */
- /* */
- /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
- /* set, the lower byte of an error value identifies the error code as */
- /* usual. In addition, the higher byte identifies the module. For */
- /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
- /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
- /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
- /* */
- /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
- /* including the high byte. */
- /* */
- /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
- /* an error value is set to zero. */
- /* */
- /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
- /* provides some macros in `fttypes.h'. */
- /* */
- /* FT_ERR( err ) */
- /* Add current error module prefix (as defined with the */
- /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
- /* the line */
- /* */
- /* error = FT_ERR( Invalid_Outline ); */
- /* */
- /* expands to */
- /* */
- /* error = BDF_Err_Invalid_Outline; */
- /* */
- /* For simplicity, you can always use `FT_Err_Ok' directly instead */
- /* of `FT_ERR( Ok )'. */
- /* */
- /* FT_ERR_EQ( errcode, err ) */
- /* FT_ERR_NEQ( errcode, err ) */
- /* Compare error code `errcode' with the error `err' for equality */
- /* and inequality, respectively. Example: */
- /* */
- /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
- /* ... */
- /* */
- /* Using this macro you don't have to think about error prefixes. */
- /* Of course, if module errors are not active, the above example is */
- /* the same as */
- /* */
- /* if ( error == FT_Err_Invalid_Outline ) */
- /* ... */
- /* */
- /* FT_ERROR_BASE( errcode ) */
- /* FT_ERROR_MODULE( errcode ) */
- /* Get base error and module error code, respectively. */
- /* */
- /* */
- /* It can also be used to create a module error message table easily */
- /* with something like */
- /* */
- /* { */
- /* #undef __FTMODERR_H__ */
- /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
- /* #define FT_MODERR_START_LIST { */
- /* #define FT_MODERR_END_LIST { 0, 0 } }; */
- /* */
- /* const struct */
- /* { */
- /* int mod_err_offset; */
- /* const char* mod_err_msg */
- /* } ft_mod_errors[] = */
- /* */
- /* #include FT_MODULE_ERRORS_H */
- /* } */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This file is used to define the FreeType module error codes. */
+/* */
+/* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
+/* set, the lower byte of an error value identifies the error code as */
+/* usual. In addition, the higher byte identifies the module. For */
+/* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
+/* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
+/* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
+/* */
+/* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
+/* including the high byte. */
+/* */
+/* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
+/* an error value is set to zero. */
+/* */
+/* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
+/* provides some macros in `fttypes.h'. */
+/* */
+/* FT_ERR( err ) */
+/* Add current error module prefix (as defined with the */
+/* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
+/* the line */
+/* */
+/* error = FT_ERR( Invalid_Outline ); */
+/* */
+/* expands to */
+/* */
+/* error = BDF_Err_Invalid_Outline; */
+/* */
+/* For simplicity, you can always use `FT_Err_Ok' directly instead */
+/* of `FT_ERR( Ok )'. */
+/* */
+/* FT_ERR_EQ( errcode, err ) */
+/* FT_ERR_NEQ( errcode, err ) */
+/* Compare error code `errcode' with the error `err' for equality */
+/* and inequality, respectively. Example: */
+/* */
+/* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
+/* ... */
+/* */
+/* Using this macro you don't have to think about error prefixes. */
+/* Of course, if module errors are not active, the above example is */
+/* the same as */
+/* */
+/* if ( error == FT_Err_Invalid_Outline ) */
+/* ... */
+/* */
+/* FT_ERROR_BASE( errcode ) */
+/* FT_ERROR_MODULE( errcode ) */
+/* Get base error and module error code, respectively. */
+/* */
+/* */
+/* It can also be used to create a module error message table easily */
+/* with something like */
+/* */
+/* { */
+/* #undef __FTMODERR_H__ */
+/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
+/* #define FT_MODERR_START_LIST { */
+/* #define FT_MODERR_END_LIST { 0, 0 } }; */
+/* */
+/* const struct */
+/* { */
+/* int mod_err_offset; */
+/* const char* mod_err_msg */
+/* } ft_mod_errors[] = */
+/* */
+/* #include FT_MODULE_ERRORS_H */
+/* } */
+/* */
+/*************************************************************************/
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SETUP MACROS *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** SETUP MACROS *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
#undef FT_NEED_EXTERN_C
@@ -119,67 +119,67 @@
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
- extern "C" {
+extern "C" {
#endif
#endif /* !FT_MODERRDEF */
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** LIST MODULE ERROR BASES *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** LIST MODULE ERROR BASES *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
#ifdef FT_MODERR_START_LIST
- FT_MODERR_START_LIST
+FT_MODERR_START_LIST
#endif
- FT_MODERRDEF( Base, 0x000, "base module" )
- FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
- FT_MODERRDEF( BDF, 0x200, "BDF module" )
- FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
- FT_MODERRDEF( Cache, 0x400, "cache module" )
- FT_MODERRDEF( CFF, 0x500, "CFF module" )
- FT_MODERRDEF( CID, 0x600, "CID module" )
- FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
- FT_MODERRDEF( LZW, 0x800, "LZW module" )
- FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
- FT_MODERRDEF( PCF, 0xA00, "PCF module" )
- FT_MODERRDEF( PFR, 0xB00, "PFR module" )
- FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
- FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
- FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
- FT_MODERRDEF( Raster, 0xF00, "raster module" )
- FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
- FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
- FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
- FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
- FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
- FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
- FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
+FT_MODERRDEF( Base, 0x000, "base module" )
+FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
+FT_MODERRDEF( BDF, 0x200, "BDF module" )
+FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
+FT_MODERRDEF( Cache, 0x400, "cache module" )
+FT_MODERRDEF( CFF, 0x500, "CFF module" )
+FT_MODERRDEF( CID, 0x600, "CID module" )
+FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
+FT_MODERRDEF( LZW, 0x800, "LZW module" )
+FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
+FT_MODERRDEF( PCF, 0xA00, "PCF module" )
+FT_MODERRDEF( PFR, 0xB00, "PFR module" )
+FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
+FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
+FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
+FT_MODERRDEF( Raster, 0xF00, "raster module" )
+FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
+FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
+FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
+FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
+FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
+FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
+FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
#ifdef FT_MODERR_END_LIST
- FT_MODERR_END_LIST
+FT_MODERR_END_LIST
#endif
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** CLEANUP *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
+/*******************************************************************/
+/*******************************************************************/
+/***** *****/
+/***** CLEANUP *****/
+/***** *****/
+/*******************************************************************/
+/*******************************************************************/
#ifdef FT_NEED_EXTERN_C
- }
+}
#endif
#undef FT_MODERR_START_LIST
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftotval.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftotval.h
index 027f2e8..7f2c924 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftotval.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftotval.h
@@ -43,56 +43,56 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* ot_validation */
- /* */
- /* <Title> */
- /* OpenType Validation */
- /* */
- /* <Abstract> */
- /* An API to validate OpenType tables. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions to validate */
- /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_OTXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_OpenType_Validate to
- * indicate which OpenType tables should be validated.
- *
- * @values:
- * FT_VALIDATE_BASE ::
- * Validate BASE table.
- *
- * FT_VALIDATE_GDEF ::
- * Validate GDEF table.
- *
- * FT_VALIDATE_GPOS ::
- * Validate GPOS table.
- *
- * FT_VALIDATE_GSUB ::
- * Validate GSUB table.
- *
- * FT_VALIDATE_JSTF ::
- * Validate JSTF table.
- *
- * FT_VALIDATE_MATH ::
- * Validate MATH table.
- *
- * FT_VALIDATE_OT ::
- * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
- *
- */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* ot_validation */
+/* */
+/* <Title> */
+/* OpenType Validation */
+/* */
+/* <Abstract> */
+/* An API to validate OpenType tables. */
+/* */
+/* <Description> */
+/* This section contains the declaration of functions to validate */
+/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
+/* */
+/*************************************************************************/
+
+
+/**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_OTXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_OpenType_Validate to
+ * indicate which OpenType tables should be validated.
+ *
+ * @values:
+ * FT_VALIDATE_BASE ::
+ * Validate BASE table.
+ *
+ * FT_VALIDATE_GDEF ::
+ * Validate GDEF table.
+ *
+ * FT_VALIDATE_GPOS ::
+ * Validate GPOS table.
+ *
+ * FT_VALIDATE_GSUB ::
+ * Validate GSUB table.
+ *
+ * FT_VALIDATE_JSTF ::
+ * Validate JSTF table.
+ *
+ * FT_VALIDATE_MATH ::
+ * Validate MATH table.
+ *
+ * FT_VALIDATE_OT ::
+ * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
+ *
+ */
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
@@ -107,92 +107,92 @@ FT_BEGIN_HEADER
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_OpenType_Validate
- *
- * @description:
- * Validate various OpenType tables to assure that all offsets and
- * indices are valid. The idea is that a higher-level library which
- * actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field which specifies the tables to be validated. See
- * @FT_VALIDATE_OTXXX for possible values.
- *
- * @output:
- * BASE_table ::
- * A pointer to the BASE table.
- *
- * GDEF_table ::
- * A pointer to the GDEF table.
- *
- * GPOS_table ::
- * A pointer to the GPOS table.
- *
- * GSUB_table ::
- * A pointer to the GSUB table.
- *
- * JSTF_table ::
- * A pointer to the JSTF table.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with OpenType fonts, returning an error
- * otherwise.
- *
- * After use, the application should deallocate the five tables with
- * @FT_OpenType_Free. A NULL value indicates that the table either
- * doesn't exist in the font, or the application hasn't asked for
- * validation.
- */
- FT_EXPORT( FT_Error )
- FT_OpenType_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *BASE_table,
- FT_Bytes *GDEF_table,
- FT_Bytes *GPOS_table,
- FT_Bytes *GSUB_table,
- FT_Bytes *JSTF_table );
-
- /* */
-
- /**********************************************************************
- *
- * @function:
- * FT_OpenType_Free
- *
- * @description:
- * Free the buffer allocated by OpenType validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer that is allocated by
- * @FT_OpenType_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_OpenType_Validate only.
- */
- FT_EXPORT( void )
- FT_OpenType_Free( FT_Face face,
- FT_Bytes table );
-
-
- /* */
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_OpenType_Validate
+ *
+ * @description:
+ * Validate various OpenType tables to assure that all offsets and
+ * indices are valid. The idea is that a higher-level library which
+ * actually does the text layout can access those tables without
+ * error checking (which can be quite time consuming).
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field which specifies the tables to be validated. See
+ * @FT_VALIDATE_OTXXX for possible values.
+ *
+ * @output:
+ * BASE_table ::
+ * A pointer to the BASE table.
+ *
+ * GDEF_table ::
+ * A pointer to the GDEF table.
+ *
+ * GPOS_table ::
+ * A pointer to the GPOS table.
+ *
+ * GSUB_table ::
+ * A pointer to the GSUB table.
+ *
+ * JSTF_table ::
+ * A pointer to the JSTF table.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with OpenType fonts, returning an error
+ * otherwise.
+ *
+ * After use, the application should deallocate the five tables with
+ * @FT_OpenType_Free. A NULL value indicates that the table either
+ * doesn't exist in the font, or the application hasn't asked for
+ * validation.
+ */
+FT_EXPORT( FT_Error )
+FT_OpenType_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *BASE_table,
+ FT_Bytes *GDEF_table,
+ FT_Bytes *GPOS_table,
+ FT_Bytes *GSUB_table,
+ FT_Bytes *JSTF_table );
+
+/* */
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_OpenType_Free
+ *
+ * @description:
+ * Free the buffer allocated by OpenType validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * @FT_OpenType_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_OpenType_Validate only.
+ */
+FT_EXPORT( void )
+FT_OpenType_Free( FT_Face face,
+ FT_Bytes table );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftoutln.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftoutln.h
index fd69f28..3aff51a 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftoutln.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftoutln.h
@@ -34,517 +34,516 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /* <Title> */
- /* Outline Processing */
- /* */
- /* <Abstract> */
- /* Functions to create, transform, and render vectorial glyph images. */
- /* */
- /* <Description> */
- /* This section contains routines used to create and destroy scalable */
- /* glyph images known as `outlines'. These can also be measured, */
- /* transformed, and converted into bitmaps and pixmaps. */
- /* */
- /* <Order> */
- /* FT_Outline */
- /* FT_OUTLINE_FLAGS */
- /* FT_Outline_New */
- /* FT_Outline_Done */
- /* FT_Outline_Copy */
- /* FT_Outline_Translate */
- /* FT_Outline_Transform */
- /* FT_Outline_Embolden */
- /* FT_Outline_EmboldenXY */
- /* FT_Outline_Reverse */
- /* FT_Outline_Check */
- /* */
- /* FT_Outline_Get_CBox */
- /* FT_Outline_Get_BBox */
- /* */
- /* FT_Outline_Get_Bitmap */
- /* FT_Outline_Render */
- /* */
- /* FT_Outline_Decompose */
- /* FT_Outline_Funcs */
- /* FT_Outline_MoveTo_Func */
- /* FT_Outline_LineTo_Func */
- /* FT_Outline_ConicTo_Func */
- /* FT_Outline_CubicTo_Func */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Decompose */
- /* */
- /* <Description> */
- /* Walk over an outline's structure to decompose it into individual */
- /* segments and Bézier arcs. This function also emits `move to' */
- /* operations to indicate the start of new contours in the outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source target. */
- /* */
- /* func_interface :: A table of `emitters', i.e., function pointers */
- /* called during decomposition to indicate path */
- /* operations. */
- /* */
- /* <InOut> */
- /* user :: A typeless pointer which is passed to each */
- /* emitter during the decomposition. It can be */
- /* used to store the state during the */
- /* decomposition. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Decompose( FT_Outline* outline,
- const FT_Outline_Funcs* func_interface,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_New */
- /* */
- /* <Description> */
- /* Create a new outline of a given size. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object from where the */
- /* outline is allocated. Note however that the new */
- /* outline will *not* necessarily be *freed*, when */
- /* destroying the library, by @FT_Done_FreeType. */
- /* */
- /* numPoints :: The maximum number of points within the outline. */
- /* Must be smaller than or equal to 0xFFFF (65535). */
- /* */
- /* numContours :: The maximum number of contours within the outline. */
- /* This value must be in the range 0 to `numPoints'. */
- /* */
- /* <Output> */
- /* anoutline :: A handle to the new outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' parameter is simply */
- /* to use the library's memory allocator. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_New( FT_Library library,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline );
-
-
- FT_EXPORT( FT_Error )
- FT_Outline_New_Internal( FT_Memory memory,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Done */
- /* */
- /* <Description> */
- /* Destroy an outline created with @FT_Outline_New. */
- /* */
- /* <Input> */
- /* library :: A handle of the library object used to allocate the */
- /* outline. */
- /* */
- /* outline :: A pointer to the outline object to be discarded. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If the outline's `owner' field is not set, only the outline */
- /* descriptor will be released. */
- /* */
- /* The reason why this function takes an `library' parameter is */
- /* simply to use ft_mem_free(). */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Done( FT_Library library,
- FT_Outline* outline );
-
-
- FT_EXPORT( FT_Error )
- FT_Outline_Done_Internal( FT_Memory memory,
- FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Check */
- /* */
- /* <Description> */
- /* Check the contents of an outline descriptor. */
- /* */
- /* <Input> */
- /* outline :: A handle to a source outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Check( FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_CBox */
- /* */
- /* <Description> */
- /* Return an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bézier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* which contains Bézier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <Output> */
- /* acbox :: The outline's control box. */
- /* */
- /* <Note> */
- /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Get_CBox( const FT_Outline* outline,
- FT_BBox *acbox );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Translate */
- /* */
- /* <Description> */
- /* Apply a simple translation to the points of an outline. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Input> */
- /* xOffset :: The horizontal offset. */
- /* */
- /* yOffset :: The vertical offset. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Translate( const FT_Outline* outline,
- FT_Pos xOffset,
- FT_Pos yOffset );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Copy */
- /* */
- /* <Description> */
- /* Copy an outline into another one. Both objects must have the */
- /* same sizes (number of points & number of contours) when this */
- /* function is called. */
- /* */
- /* <Input> */
- /* source :: A handle to the source outline. */
- /* */
- /* <Output> */
- /* target :: A handle to the target outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Copy( const FT_Outline* source,
- FT_Outline *target );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Transform */
- /* */
- /* <Description> */
- /* Apply a simple 2x2 matrix to all of an outline's points. Useful */
- /* for applying rotations, slanting, flipping, etc. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation matrix. */
- /* */
- /* <Note> */
- /* You can use @FT_Outline_Translate if you need to translate the */
- /* outline's points. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Transform( const FT_Outline* outline,
- const FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Embolden */
- /* */
- /* <Description> */
- /* Embolden an outline. The new outline will be at most 4~times */
- /* `strength' pixels wider and higher. You may think of the left and */
- /* bottom borders as unchanged. */
- /* */
- /* Negative `strength' values to reduce the outline thickness are */
- /* possible also. */
- /* */
- /* <InOut> */
- /* outline :: A handle to the target outline. */
- /* */
- /* <Input> */
- /* strength :: How strong the glyph is emboldened. Expressed in */
- /* 26.6 pixel format. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The used algorithm to increase or decrease the thickness of the */
- /* glyph doesn't change the number of points; this means that certain */
- /* situations like acute angles or intersections are sometimes */
- /* handled incorrectly. */
- /* */
- /* If you need `better' metrics values you should call */
- /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
- /* */
- /* Example call: */
- /* */
- /* { */
- /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
- /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
- /* FT_Outline_Embolden( &face->slot->outline, strength ); */
- /* } */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Embolden( FT_Outline* outline,
- FT_Pos strength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_EmboldenXY */
- /* */
- /* <Description> */
- /* Embolden an outline. The new outline will be `xstrength' pixels */
- /* wider and `ystrength' pixels higher. Otherwise, it is similar to */
- /* @FT_Outline_Embolden, which uses the same strength in both */
- /* directions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_EmboldenXY( FT_Outline* outline,
- FT_Pos xstrength,
- FT_Pos ystrength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Reverse */
- /* */
- /* <Description> */
- /* Reverse the drawing direction of an outline. This is used to */
- /* ensure consistent fill conventions for mirrored glyphs. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Note> */
- /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
- /* the outline's `flags' field. */
- /* */
- /* It shouldn't be used by a normal client application, unless it */
- /* knows what it is doing. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Reverse( FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_Bitmap */
- /* */
- /* <Description> */
- /* Render an outline within a bitmap. The outline's image is simply */
- /* OR-ed to the target bitmap. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <InOut> */
- /* abitmap :: A pointer to the target bitmap descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function does NOT CREATE the bitmap, it only renders an */
- /* outline image within the one you pass to it! Consequently, the */
- /* various fields in `abitmap' should be set accordingly. */
- /* */
- /* It will use the raster corresponding to the default glyph format. */
- /* */
- /* The value of the `num_grays' field in `abitmap' is ignored. If */
- /* you select the gray-level rasterizer, and you want less than 256 */
- /* gray levels, you have to use @FT_Outline_Render directly. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Get_Bitmap( FT_Library library,
- FT_Outline* outline,
- const FT_Bitmap *abitmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Render */
- /* */
- /* <Description> */
- /* Render an outline within a bitmap using the current scan-convert. */
- /* This function uses an @FT_Raster_Params structure as an argument, */
- /* allowing advanced features like direct composition, translucency, */
- /* etc. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <InOut> */
- /* params :: A pointer to an @FT_Raster_Params structure used to */
- /* describe the rendering operation. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You should know what you are doing and how @FT_Raster_Params works */
- /* to use this function. */
- /* */
- /* The field `params.source' will be set to `outline' before the scan */
- /* converter is called, which means that the value you give to it is */
- /* actually ignored. */
- /* */
- /* The gray-level rasterizer always uses 256 gray levels. If you */
- /* want less gray levels, you have to provide your own span callback. */
- /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
- /* @FT_Raster_Params structure for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Render( FT_Library library,
- FT_Outline* outline,
- FT_Raster_Params* params );
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_Orientation
- *
- * @description:
- * A list of values used to describe an outline's contour orientation.
- *
- * The TrueType and PostScript specifications use different conventions
- * to determine whether outline contours should be filled or unfilled.
- *
- * @values:
- * FT_ORIENTATION_TRUETYPE ::
- * According to the TrueType specification, clockwise contours must
- * be filled, and counter-clockwise ones must be unfilled.
- *
- * FT_ORIENTATION_POSTSCRIPT ::
- * According to the PostScript specification, counter-clockwise contours
- * must be filled, and clockwise ones must be unfilled.
- *
- * FT_ORIENTATION_FILL_RIGHT ::
- * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
- * remember that in TrueType, everything that is to the right of
- * the drawing direction of a contour must be filled.
- *
- * FT_ORIENTATION_FILL_LEFT ::
- * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
- * remember that in PostScript, everything that is to the left of
- * the drawing direction of a contour must be filled.
- *
- * FT_ORIENTATION_NONE ::
- * The orientation cannot be determined. That is, different parts of
- * the glyph have different orientation.
- *
- */
- typedef enum FT_Orientation_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* outline_processing */
+/* */
+/* <Title> */
+/* Outline Processing */
+/* */
+/* <Abstract> */
+/* Functions to create, transform, and render vectorial glyph images. */
+/* */
+/* <Description> */
+/* This section contains routines used to create and destroy scalable */
+/* glyph images known as `outlines'. These can also be measured, */
+/* transformed, and converted into bitmaps and pixmaps. */
+/* */
+/* <Order> */
+/* FT_Outline */
+/* FT_OUTLINE_FLAGS */
+/* FT_Outline_New */
+/* FT_Outline_Done */
+/* FT_Outline_Copy */
+/* FT_Outline_Translate */
+/* FT_Outline_Transform */
+/* FT_Outline_Embolden */
+/* FT_Outline_EmboldenXY */
+/* FT_Outline_Reverse */
+/* FT_Outline_Check */
+/* */
+/* FT_Outline_Get_CBox */
+/* FT_Outline_Get_BBox */
+/* */
+/* FT_Outline_Get_Bitmap */
+/* FT_Outline_Render */
+/* */
+/* FT_Outline_Decompose */
+/* FT_Outline_Funcs */
+/* FT_Outline_MoveTo_Func */
+/* FT_Outline_LineTo_Func */
+/* FT_Outline_ConicTo_Func */
+/* FT_Outline_CubicTo_Func */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Decompose */
+/* */
+/* <Description> */
+/* Walk over an outline's structure to decompose it into individual */
+/* segments and Bézier arcs. This function also emits `move to' */
+/* operations to indicate the start of new contours in the outline. */
+/* */
+/* <Input> */
+/* outline :: A pointer to the source target. */
+/* */
+/* func_interface :: A table of `emitters', i.e., function pointers */
+/* called during decomposition to indicate path */
+/* operations. */
+/* */
+/* <InOut> */
+/* user :: A typeless pointer which is passed to each */
+/* emitter during the decomposition. It can be */
+/* used to store the state during the */
+/* decomposition. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Decompose( FT_Outline* outline,
+ const FT_Outline_Funcs* func_interface,
+ void* user );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_New */
+/* */
+/* <Description> */
+/* Create a new outline of a given size. */
+/* */
+/* <Input> */
+/* library :: A handle to the library object from where the */
+/* outline is allocated. Note however that the new */
+/* outline will *not* necessarily be *freed*, when */
+/* destroying the library, by @FT_Done_FreeType. */
+/* */
+/* numPoints :: The maximum number of points within the outline. */
+/* Must be smaller than or equal to 0xFFFF (65535). */
+/* */
+/* numContours :: The maximum number of contours within the outline. */
+/* This value must be in the range 0 to `numPoints'. */
+/* */
+/* <Output> */
+/* anoutline :: A handle to the new outline. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The reason why this function takes a `library' parameter is simply */
+/* to use the library's memory allocator. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+FT_EXPORT( FT_Error )
+FT_Outline_New_Internal( FT_Memory memory,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Done */
+/* */
+/* <Description> */
+/* Destroy an outline created with @FT_Outline_New. */
+/* */
+/* <Input> */
+/* library :: A handle of the library object used to allocate the */
+/* outline. */
+/* */
+/* outline :: A pointer to the outline object to be discarded. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* If the outline's `owner' field is not set, only the outline */
+/* descriptor will be released. */
+/* */
+/* The reason why this function takes an `library' parameter is */
+/* simply to use ft_mem_free(). */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Done( FT_Library library,
+ FT_Outline* outline );
+
+
+FT_EXPORT( FT_Error )
+FT_Outline_Done_Internal( FT_Memory memory,
+ FT_Outline* outline );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Check */
+/* */
+/* <Description> */
+/* Check the contents of an outline descriptor. */
+/* */
+/* <Input> */
+/* outline :: A handle to a source outline. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Check( FT_Outline* outline );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Get_CBox */
+/* */
+/* <Description> */
+/* Return an outline's `control box'. The control box encloses all */
+/* the outline's points, including Bézier control points. Though it */
+/* coincides with the exact bounding box for most glyphs, it can be */
+/* slightly larger in some situations (like when rotating an outline */
+/* which contains Bézier outside arcs). */
+/* */
+/* Computing the control box is very fast, while getting the bounding */
+/* box can take much more time as it needs to walk over all segments */
+/* and arcs in the outline. To get the latter, you can use the */
+/* `ftbbox' component which is dedicated to this single task. */
+/* */
+/* <Input> */
+/* outline :: A pointer to the source outline descriptor. */
+/* */
+/* <Output> */
+/* acbox :: The outline's control box. */
+/* */
+/* <Note> */
+/* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
+/* */
+FT_EXPORT( void )
+FT_Outline_Get_CBox( const FT_Outline* outline,
+ FT_BBox *acbox );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Translate */
+/* */
+/* <Description> */
+/* Apply a simple translation to the points of an outline. */
+/* */
+/* <InOut> */
+/* outline :: A pointer to the target outline descriptor. */
+/* */
+/* <Input> */
+/* xOffset :: The horizontal offset. */
+/* */
+/* yOffset :: The vertical offset. */
+/* */
+FT_EXPORT( void )
+FT_Outline_Translate( const FT_Outline* outline,
+ FT_Pos xOffset,
+ FT_Pos yOffset );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Copy */
+/* */
+/* <Description> */
+/* Copy an outline into another one. Both objects must have the */
+/* same sizes (number of points & number of contours) when this */
+/* function is called. */
+/* */
+/* <Input> */
+/* source :: A handle to the source outline. */
+/* */
+/* <Output> */
+/* target :: A handle to the target outline. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Copy( const FT_Outline* source,
+ FT_Outline *target );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Transform */
+/* */
+/* <Description> */
+/* Apply a simple 2x2 matrix to all of an outline's points. Useful */
+/* for applying rotations, slanting, flipping, etc. */
+/* */
+/* <InOut> */
+/* outline :: A pointer to the target outline descriptor. */
+/* */
+/* <Input> */
+/* matrix :: A pointer to the transformation matrix. */
+/* */
+/* <Note> */
+/* You can use @FT_Outline_Translate if you need to translate the */
+/* outline's points. */
+/* */
+FT_EXPORT( void )
+FT_Outline_Transform( const FT_Outline* outline,
+ const FT_Matrix* matrix );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Embolden */
+/* */
+/* <Description> */
+/* Embolden an outline. The new outline will be at most 4~times */
+/* `strength' pixels wider and higher. You may think of the left and */
+/* bottom borders as unchanged. */
+/* */
+/* Negative `strength' values to reduce the outline thickness are */
+/* possible also. */
+/* */
+/* <InOut> */
+/* outline :: A handle to the target outline. */
+/* */
+/* <Input> */
+/* strength :: How strong the glyph is emboldened. Expressed in */
+/* 26.6 pixel format. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The used algorithm to increase or decrease the thickness of the */
+/* glyph doesn't change the number of points; this means that certain */
+/* situations like acute angles or intersections are sometimes */
+/* handled incorrectly. */
+/* */
+/* If you need `better' metrics values you should call */
+/* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
+/* */
+/* Example call: */
+/* */
+/* { */
+/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
+/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
+/* FT_Outline_Embolden( &face->slot->outline, strength ); */
+/* } */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Embolden( FT_Outline* outline,
+ FT_Pos strength );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_EmboldenXY */
+/* */
+/* <Description> */
+/* Embolden an outline. The new outline will be `xstrength' pixels */
+/* wider and `ystrength' pixels higher. Otherwise, it is similar to */
+/* @FT_Outline_Embolden, which uses the same strength in both */
+/* directions. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_EmboldenXY( FT_Outline* outline,
+ FT_Pos xstrength,
+ FT_Pos ystrength );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Reverse */
+/* */
+/* <Description> */
+/* Reverse the drawing direction of an outline. This is used to */
+/* ensure consistent fill conventions for mirrored glyphs. */
+/* */
+/* <InOut> */
+/* outline :: A pointer to the target outline descriptor. */
+/* */
+/* <Note> */
+/* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
+/* the outline's `flags' field. */
+/* */
+/* It shouldn't be used by a normal client application, unless it */
+/* knows what it is doing. */
+/* */
+FT_EXPORT( void )
+FT_Outline_Reverse( FT_Outline* outline );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Get_Bitmap */
+/* */
+/* <Description> */
+/* Render an outline within a bitmap. The outline's image is simply */
+/* OR-ed to the target bitmap. */
+/* */
+/* <Input> */
+/* library :: A handle to a FreeType library object. */
+/* */
+/* outline :: A pointer to the source outline descriptor. */
+/* */
+/* <InOut> */
+/* abitmap :: A pointer to the target bitmap descriptor. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* This function does NOT CREATE the bitmap, it only renders an */
+/* outline image within the one you pass to it! Consequently, the */
+/* various fields in `abitmap' should be set accordingly. */
+/* */
+/* It will use the raster corresponding to the default glyph format. */
+/* */
+/* The value of the `num_grays' field in `abitmap' is ignored. If */
+/* you select the gray-level rasterizer, and you want less than 256 */
+/* gray levels, you have to use @FT_Outline_Render directly. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Get_Bitmap( FT_Library library,
+ FT_Outline* outline,
+ const FT_Bitmap *abitmap );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Outline_Render */
+/* */
+/* <Description> */
+/* Render an outline within a bitmap using the current scan-convert. */
+/* This function uses an @FT_Raster_Params structure as an argument, */
+/* allowing advanced features like direct composition, translucency, */
+/* etc. */
+/* */
+/* <Input> */
+/* library :: A handle to a FreeType library object. */
+/* */
+/* outline :: A pointer to the source outline descriptor. */
+/* */
+/* <InOut> */
+/* params :: A pointer to an @FT_Raster_Params structure used to */
+/* describe the rendering operation. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* You should know what you are doing and how @FT_Raster_Params works */
+/* to use this function. */
+/* */
+/* The field `params.source' will be set to `outline' before the scan */
+/* converter is called, which means that the value you give to it is */
+/* actually ignored. */
+/* */
+/* The gray-level rasterizer always uses 256 gray levels. If you */
+/* want less gray levels, you have to provide your own span callback. */
+/* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
+/* @FT_Raster_Params structure for more details. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Outline_Render( FT_Library library,
+ FT_Outline* outline,
+ FT_Raster_Params* params );
+
+
+/**************************************************************************
+ *
+ * @enum:
+ * FT_Orientation
+ *
+ * @description:
+ * A list of values used to describe an outline's contour orientation.
+ *
+ * The TrueType and PostScript specifications use different conventions
+ * to determine whether outline contours should be filled or unfilled.
+ *
+ * @values:
+ * FT_ORIENTATION_TRUETYPE ::
+ * According to the TrueType specification, clockwise contours must
+ * be filled, and counter-clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_POSTSCRIPT ::
+ * According to the PostScript specification, counter-clockwise contours
+ * must be filled, and clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_FILL_RIGHT ::
+ * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
+ * remember that in TrueType, everything that is to the right of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_FILL_LEFT ::
+ * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
+ * remember that in PostScript, everything that is to the left of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_NONE ::
+ * The orientation cannot be determined. That is, different parts of
+ * the glyph have different orientation.
+ *
+ */
+typedef enum FT_Orientation_ {
FT_ORIENTATION_TRUETYPE = 0,
FT_ORIENTATION_POSTSCRIPT = 1,
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
FT_ORIENTATION_NONE
- } FT_Orientation;
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Outline_Get_Orientation
- *
- * @description:
- * This function analyzes a glyph outline and tries to compute its
- * fill orientation (see @FT_Orientation). This is done by computing
- * the direction of each global horizontal and/or vertical extrema
- * within the outline.
- *
- * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
- * outlines.
- *
- * @input:
- * outline ::
- * A handle to the source outline.
- *
- * @return:
- * The orientation.
- *
- */
- FT_EXPORT( FT_Orientation )
- FT_Outline_Get_Orientation( FT_Outline* outline );
-
-
- /* */
+} FT_Orientation;
+
+
+/**************************************************************************
+ *
+ * @function:
+ * FT_Outline_Get_Orientation
+ *
+ * @description:
+ * This function analyzes a glyph outline and tries to compute its
+ * fill orientation (see @FT_Orientation). This is done by computing
+ * the direction of each global horizontal and/or vertical extrema
+ * within the outline.
+ *
+ * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
+ * outlines.
+ *
+ * @input:
+ * outline ::
+ * A handle to the source outline.
+ *
+ * @return:
+ * The orientation.
+ *
+ */
+FT_EXPORT( FT_Orientation )
+FT_Outline_Get_Orientation( FT_Outline* outline );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftpfr.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftpfr.h
index 0b7b7d4..abcc786 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftpfr.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftpfr.h
@@ -32,136 +32,136 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* pfr_fonts */
- /* */
- /* <Title> */
- /* PFR Fonts */
- /* */
- /* <Abstract> */
- /* PFR/TrueDoc specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of PFR-specific functions. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Metrics
- *
- * @description:
- * Return the outline and metrics resolutions of a given PFR face.
- *
- * @input:
- * face :: Handle to the input face. It can be a non-PFR face.
- *
- * @output:
- * aoutline_resolution ::
- * Outline resolution. This is equivalent to `face->units_per_EM'
- * for non-PFR fonts. Optional (parameter can be NULL).
- *
- * ametrics_resolution ::
- * Metrics resolution. This is equivalent to `outline_resolution'
- * for non-PFR fonts. Optional (parameter can be NULL).
- *
- * ametrics_x_scale ::
- * A 16.16 fixed-point number used to scale distance expressed
- * in metrics units to device sub-pixels. This is equivalent to
- * `face->size->x_scale', but for metrics only. Optional (parameter
- * can be NULL).
- *
- * ametrics_y_scale ::
- * Same as `ametrics_x_scale' but for the vertical direction.
- * optional (parameter can be NULL).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If the input face is not a PFR, this function will return an error.
- * However, in all cases, it will return valid values.
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Metrics( FT_Face face,
- FT_UInt *aoutline_resolution,
- FT_UInt *ametrics_resolution,
- FT_Fixed *ametrics_x_scale,
- FT_Fixed *ametrics_y_scale );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Kerning
- *
- * @description:
- * Return the kerning pair corresponding to two glyphs in a PFR face.
- * The distance is expressed in metrics units, unlike the result of
- * @FT_Get_Kerning.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * left :: Index of the left glyph.
- *
- * right :: Index of the right glyph.
- *
- * @output:
- * avector :: A kerning vector.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function always return distances in original PFR metrics
- * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
- * mode, which always returns distances converted to outline units.
- *
- * You can use the value of the `x_scale' and `y_scale' parameters
- * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Kerning( FT_Face face,
- FT_UInt left,
- FT_UInt right,
- FT_Vector *avector );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Advance
- *
- * @description:
- * Return a given glyph advance, expressed in original metrics units,
- * from a PFR font.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * gindex :: The glyph index.
- *
- * @output:
- * aadvance :: The glyph advance in metrics units.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
- * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Advance( FT_Face face,
- FT_UInt gindex,
- FT_Pos *aadvance );
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* pfr_fonts */
+/* */
+/* <Title> */
+/* PFR Fonts */
+/* */
+/* <Abstract> */
+/* PFR/TrueDoc specific API. */
+/* */
+/* <Description> */
+/* This section contains the declaration of PFR-specific functions. */
+/* */
+/*************************************************************************/
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Metrics
+ *
+ * @description:
+ * Return the outline and metrics resolutions of a given PFR face.
+ *
+ * @input:
+ * face :: Handle to the input face. It can be a non-PFR face.
+ *
+ * @output:
+ * aoutline_resolution ::
+ * Outline resolution. This is equivalent to `face->units_per_EM'
+ * for non-PFR fonts. Optional (parameter can be NULL).
+ *
+ * ametrics_resolution ::
+ * Metrics resolution. This is equivalent to `outline_resolution'
+ * for non-PFR fonts. Optional (parameter can be NULL).
+ *
+ * ametrics_x_scale ::
+ * A 16.16 fixed-point number used to scale distance expressed
+ * in metrics units to device sub-pixels. This is equivalent to
+ * `face->size->x_scale', but for metrics only. Optional (parameter
+ * can be NULL).
+ *
+ * ametrics_y_scale ::
+ * Same as `ametrics_x_scale' but for the vertical direction.
+ * optional (parameter can be NULL).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If the input face is not a PFR, this function will return an error.
+ * However, in all cases, it will return valid values.
+ */
+FT_EXPORT( FT_Error )
+FT_Get_PFR_Metrics( FT_Face face,
+ FT_UInt *aoutline_resolution,
+ FT_UInt *ametrics_resolution,
+ FT_Fixed *ametrics_x_scale,
+ FT_Fixed *ametrics_y_scale );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Kerning
+ *
+ * @description:
+ * Return the kerning pair corresponding to two glyphs in a PFR face.
+ * The distance is expressed in metrics units, unlike the result of
+ * @FT_Get_Kerning.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * left :: Index of the left glyph.
+ *
+ * right :: Index of the right glyph.
+ *
+ * @output:
+ * avector :: A kerning vector.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function always return distances in original PFR metrics
+ * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
+ * mode, which always returns distances converted to outline units.
+ *
+ * You can use the value of the `x_scale' and `y_scale' parameters
+ * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
+ */
+FT_EXPORT( FT_Error )
+FT_Get_PFR_Kerning( FT_Face face,
+ FT_UInt left,
+ FT_UInt right,
+ FT_Vector *avector );
+
+
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Advance
+ *
+ * @description:
+ * Return a given glyph advance, expressed in original metrics units,
+ * from a PFR font.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * gindex :: The glyph index.
+ *
+ * @output:
+ * aadvance :: The glyph advance in metrics units.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
+ * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
+ */
+FT_EXPORT( FT_Error )
+FT_Get_PFR_Advance( FT_Face face,
+ FT_UInt gindex,
+ FT_Pos *aadvance );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftrender.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftrender.h
index dd0229b..9415fe2 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftrender.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftrender.h
@@ -28,39 +28,39 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* module_management */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* module_management */
+/* */
+/*************************************************************************/
- /* create a new glyph object */
- typedef FT_Error
- (*FT_Glyph_InitFunc)( FT_Glyph glyph,
- FT_GlyphSlot slot );
+/* create a new glyph object */
+typedef FT_Error
+(*FT_Glyph_InitFunc)( FT_Glyph glyph,
+ FT_GlyphSlot slot );
- /* destroys a given glyph object */
- typedef void
- (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
+/* destroys a given glyph object */
+typedef void
+(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
- typedef void
- (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
- const FT_Matrix* matrix,
- const FT_Vector* delta );
+typedef void
+(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
+ const FT_Matrix* matrix,
+ const FT_Vector* delta );
- typedef void
- (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
- FT_BBox* abbox );
+typedef void
+(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
+ FT_BBox* abbox );
- typedef FT_Error
- (*FT_Glyph_CopyFunc)( FT_Glyph source,
- FT_Glyph target );
+typedef FT_Error
+(*FT_Glyph_CopyFunc)( FT_Glyph source,
+ FT_Glyph target );
- typedef FT_Error
- (*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
- FT_GlyphSlot slot );
+typedef FT_Error
+(*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
+ FT_GlyphSlot slot );
/* deprecated */
#define FT_Glyph_Init_Func FT_Glyph_InitFunc
@@ -71,8 +71,7 @@ FT_BEGIN_HEADER
#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
- struct FT_Glyph_Class_
- {
+struct FT_Glyph_Class_ {
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
@@ -81,32 +80,32 @@ FT_BEGIN_HEADER
FT_Glyph_TransformFunc glyph_transform;
FT_Glyph_GetBBoxFunc glyph_bbox;
FT_Glyph_PrepareFunc glyph_prepare;
- };
+};
- typedef FT_Error
- (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- FT_UInt mode,
- const FT_Vector* origin );
+typedef FT_Error
+(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ FT_UInt mode,
+ const FT_Vector* origin );
- typedef FT_Error
- (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- const FT_Matrix* matrix,
- const FT_Vector* delta );
+typedef FT_Error
+(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ const FT_Matrix* matrix,
+ const FT_Vector* delta );
- typedef void
- (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- FT_BBox* cbox );
+typedef void
+(*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ FT_BBox* cbox );
- typedef FT_Error
- (*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
- FT_ULong mode_tag,
- FT_Pointer mode_ptr );
+typedef FT_Error
+(*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
+ FT_ULong mode_tag,
+ FT_Pointer mode_ptr );
/* deprecated identifiers */
#define FTRenderer_render FT_Renderer_RenderFunc
@@ -115,34 +114,33 @@ FT_BEGIN_HEADER
#define FTRenderer_setMode FT_Renderer_SetModeFunc
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Renderer_Class */
- /* */
- /* <Description> */
- /* The renderer module class descriptor. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Module_Class fields. */
- /* */
- /* glyph_format :: The glyph image format this renderer handles. */
- /* */
- /* render_glyph :: A method used to render the image that is in a */
- /* given glyph slot into a bitmap. */
- /* */
- /* transform_glyph :: A method used to transform the image that is in */
- /* a given glyph slot. */
- /* */
- /* get_glyph_cbox :: A method used to access the glyph's cbox. */
- /* */
- /* set_mode :: A method used to pass additional parameters. */
- /* */
- /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
- /* This is a pointer to its raster's class. */
- /* */
- typedef struct FT_Renderer_Class_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Renderer_Class */
+/* */
+/* <Description> */
+/* The renderer module class descriptor. */
+/* */
+/* <Fields> */
+/* root :: The root @FT_Module_Class fields. */
+/* */
+/* glyph_format :: The glyph image format this renderer handles. */
+/* */
+/* render_glyph :: A method used to render the image that is in a */
+/* given glyph slot into a bitmap. */
+/* */
+/* transform_glyph :: A method used to transform the image that is in */
+/* a given glyph slot. */
+/* */
+/* get_glyph_cbox :: A method used to access the glyph's cbox. */
+/* */
+/* set_mode :: A method used to pass additional parameters. */
+/* */
+/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
+/* This is a pointer to its raster's class. */
+/* */
+typedef struct FT_Renderer_Class_ {
FT_Module_Class root;
FT_Glyph_Format glyph_format;
@@ -154,80 +152,80 @@ FT_BEGIN_HEADER
FT_Raster_Funcs* raster_class;
- } FT_Renderer_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Renderer */
- /* */
- /* <Description> */
- /* Retrieve the current renderer for a given glyph format. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* format :: The glyph format. */
- /* */
- /* <Return> */
- /* A renderer handle. 0~if none found. */
- /* */
- /* <Note> */
- /* An error will be returned if a module already exists by that name, */
- /* or if the module requires a version of FreeType that is too great. */
- /* */
- /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
- /* renderer by its name, use @FT_Get_Module. */
- /* */
- FT_EXPORT( FT_Renderer )
- FT_Get_Renderer( FT_Library library,
- FT_Glyph_Format format );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Renderer */
- /* */
- /* <Description> */
- /* Set the current renderer to use, and set additional mode. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* renderer :: A handle to the renderer object. */
- /* */
- /* num_params :: The number of additional parameters. */
- /* */
- /* parameters :: Additional parameters. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* In case of success, the renderer will be used to convert glyph */
- /* images in the renderer's known format into bitmaps. */
- /* */
- /* This doesn't change the current renderer for other formats. */
- /* */
- /* Currently, only the B/W renderer, if compiled with */
- /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
- /* anti-aliasing mode; this option must be set directly in */
- /* `ftraster.c' and is undefined by default) accepts a single tag */
- /* `pal5' to set its gray palette as a character string with */
- /* 5~elements. Consequently, the third and fourth argument are zero */
- /* normally. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Renderer( FT_Library library,
- FT_Renderer renderer,
- FT_UInt num_params,
- FT_Parameter* parameters );
-
-
- /* */
+} FT_Renderer_Class;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Renderer */
+/* */
+/* <Description> */
+/* Retrieve the current renderer for a given glyph format. */
+/* */
+/* <Input> */
+/* library :: A handle to the library object. */
+/* */
+/* format :: The glyph format. */
+/* */
+/* <Return> */
+/* A renderer handle. 0~if none found. */
+/* */
+/* <Note> */
+/* An error will be returned if a module already exists by that name, */
+/* or if the module requires a version of FreeType that is too great. */
+/* */
+/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
+/* renderer by its name, use @FT_Get_Module. */
+/* */
+FT_EXPORT( FT_Renderer )
+FT_Get_Renderer( FT_Library library,
+ FT_Glyph_Format format );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Set_Renderer */
+/* */
+/* <Description> */
+/* Set the current renderer to use, and set additional mode. */
+/* */
+/* <InOut> */
+/* library :: A handle to the library object. */
+/* */
+/* <Input> */
+/* renderer :: A handle to the renderer object. */
+/* */
+/* num_params :: The number of additional parameters. */
+/* */
+/* parameters :: Additional parameters. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* In case of success, the renderer will be used to convert glyph */
+/* images in the renderer's known format into bitmaps. */
+/* */
+/* This doesn't change the current renderer for other formats. */
+/* */
+/* Currently, only the B/W renderer, if compiled with */
+/* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
+/* anti-aliasing mode; this option must be set directly in */
+/* `ftraster.c' and is undefined by default) accepts a single tag */
+/* `pal5' to set its gray palette as a character string with */
+/* 5~elements. Consequently, the third and fourth argument are zero */
+/* normally. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Set_Renderer( FT_Library library,
+ FT_Renderer renderer,
+ FT_UInt num_params,
+ FT_Parameter* parameters );
+
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsizes.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsizes.h
index 3e548cc..8d69c73 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsizes.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsizes.h
@@ -16,13 +16,13 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* Typical application would normally not need to use these functions. */
- /* However, they have been placed in a public API for the rare cases */
- /* where they are needed. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* Typical application would normally not need to use these functions. */
+/* However, they have been placed in a public API for the rare cases */
+/* where they are needed. */
+/* */
+/*************************************************************************/
#ifndef __FTSIZES_H__
@@ -42,113 +42,113 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* sizes_management */
- /* */
- /* <Title> */
- /* Size Management */
- /* */
- /* <Abstract> */
- /* Managing multiple sizes per face. */
- /* */
- /* <Description> */
- /* When creating a new face object (e.g., with @FT_New_Face), an */
- /* @FT_Size object is automatically created and used to store all */
- /* pixel-size dependent information, available in the `face->size' */
- /* field. */
- /* */
- /* It is however possible to create more sizes for a given face, */
- /* mostly in order to manage several character pixel sizes of the */
- /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
- /* */
- /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
- /* modify the contents of the current `active' size; you thus need */
- /* to use @FT_Activate_Size to change it. */
- /* */
- /* 99% of applications won't need the functions provided here, */
- /* especially if they use the caching sub-system, so be cautious */
- /* when using these. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Size */
- /* */
- /* <Description> */
- /* Create a new size object from a given face object. */
- /* */
- /* <Input> */
- /* face :: A handle to a parent face object. */
- /* */
- /* <Output> */
- /* asize :: A handle to a new size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You need to call @FT_Activate_Size in order to select the new size */
- /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
- /* @FT_Load_Glyph, @FT_Load_Char, etc. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Size( FT_Face face,
- FT_Size* size );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Size */
- /* */
- /* <Description> */
- /* Discard a given size object. Note that @FT_Done_Face */
- /* automatically discards all size objects allocated with */
- /* @FT_New_Size. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Size( FT_Size size );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Activate_Size */
- /* */
- /* <Description> */
- /* Even though it is possible to create several size objects for a */
- /* given face (see @FT_New_Size for details), functions like */
- /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
- /* activated last to determine the `current character pixel size'. */
- /* */
- /* This function can be used to `activate' a previously created size */
- /* object. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If `face' is the size's parent face object, this function changes */
- /* the value of `face->size' to the input size handle. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Activate_Size( FT_Size size );
-
- /* */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* sizes_management */
+/* */
+/* <Title> */
+/* Size Management */
+/* */
+/* <Abstract> */
+/* Managing multiple sizes per face. */
+/* */
+/* <Description> */
+/* When creating a new face object (e.g., with @FT_New_Face), an */
+/* @FT_Size object is automatically created and used to store all */
+/* pixel-size dependent information, available in the `face->size' */
+/* field. */
+/* */
+/* It is however possible to create more sizes for a given face, */
+/* mostly in order to manage several character pixel sizes of the */
+/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
+/* */
+/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
+/* modify the contents of the current `active' size; you thus need */
+/* to use @FT_Activate_Size to change it. */
+/* */
+/* 99% of applications won't need the functions provided here, */
+/* especially if they use the caching sub-system, so be cautious */
+/* when using these. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_New_Size */
+/* */
+/* <Description> */
+/* Create a new size object from a given face object. */
+/* */
+/* <Input> */
+/* face :: A handle to a parent face object. */
+/* */
+/* <Output> */
+/* asize :: A handle to a new size object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* You need to call @FT_Activate_Size in order to select the new size */
+/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
+/* @FT_Load_Glyph, @FT_Load_Char, etc. */
+/* */
+FT_EXPORT( FT_Error )
+FT_New_Size( FT_Face face,
+ FT_Size* size );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Done_Size */
+/* */
+/* <Description> */
+/* Discard a given size object. Note that @FT_Done_Face */
+/* automatically discards all size objects allocated with */
+/* @FT_New_Size. */
+/* */
+/* <Input> */
+/* size :: A handle to a target size object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Done_Size( FT_Size size );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Activate_Size */
+/* */
+/* <Description> */
+/* Even though it is possible to create several size objects for a */
+/* given face (see @FT_New_Size for details), functions like */
+/* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
+/* activated last to determine the `current character pixel size'. */
+/* */
+/* This function can be used to `activate' a previously created size */
+/* object. */
+/* */
+/* <Input> */
+/* size :: A handle to a target size object. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* If `face' is the size's parent face object, this function changes */
+/* the value of `face->size' to the input size handle. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Activate_Size( FT_Size size );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsnames.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsnames.h
index 485e4e1..486b448 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsnames.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsnames.h
@@ -36,67 +36,66 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* sfnt_names */
- /* */
- /* <Title> */
- /* SFNT Names */
- /* */
- /* <Abstract> */
- /* Access the names embedded in TrueType and OpenType files. */
- /* */
- /* <Description> */
- /* The TrueType and OpenType specifications allow the inclusion of */
- /* a special `names table' in font files. This table contains */
- /* textual (and internationalized) information regarding the font, */
- /* like family name, copyright, version, etc. */
- /* */
- /* The definitions below are used to access them if available. */
- /* */
- /* Note that this has nothing to do with glyph names! */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SfntName */
- /* */
- /* <Description> */
- /* A structure used to model an SFNT `name' table entry. */
- /* */
- /* <Fields> */
- /* platform_id :: The platform ID for `string'. */
- /* */
- /* encoding_id :: The encoding ID for `string'. */
- /* */
- /* language_id :: The language ID for `string'. */
- /* */
- /* name_id :: An identifier for `string'. */
- /* */
- /* string :: The `name' string. Note that its format differs */
- /* depending on the (platform,encoding) pair. It can */
- /* be a Pascal String, a UTF-16 one, etc. */
- /* */
- /* Generally speaking, the string is not */
- /* zero-terminated. Please refer to the TrueType */
- /* specification for details. */
- /* */
- /* string_len :: The length of `string' in bytes. */
- /* */
- /* <Note> */
- /* Possible values for `platform_id', `encoding_id', `language_id', */
- /* and `name_id' are given in the file `ttnameid.h'. For details */
- /* please refer to the TrueType or OpenType specification. */
- /* */
- /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
- /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
- /* */
- typedef struct FT_SfntName_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* sfnt_names */
+/* */
+/* <Title> */
+/* SFNT Names */
+/* */
+/* <Abstract> */
+/* Access the names embedded in TrueType and OpenType files. */
+/* */
+/* <Description> */
+/* The TrueType and OpenType specifications allow the inclusion of */
+/* a special `names table' in font files. This table contains */
+/* textual (and internationalized) information regarding the font, */
+/* like family name, copyright, version, etc. */
+/* */
+/* The definitions below are used to access them if available. */
+/* */
+/* Note that this has nothing to do with glyph names! */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_SfntName */
+/* */
+/* <Description> */
+/* A structure used to model an SFNT `name' table entry. */
+/* */
+/* <Fields> */
+/* platform_id :: The platform ID for `string'. */
+/* */
+/* encoding_id :: The encoding ID for `string'. */
+/* */
+/* language_id :: The language ID for `string'. */
+/* */
+/* name_id :: An identifier for `string'. */
+/* */
+/* string :: The `name' string. Note that its format differs */
+/* depending on the (platform,encoding) pair. It can */
+/* be a Pascal String, a UTF-16 one, etc. */
+/* */
+/* Generally speaking, the string is not */
+/* zero-terminated. Please refer to the TrueType */
+/* specification for details. */
+/* */
+/* string_len :: The length of `string' in bytes. */
+/* */
+/* <Note> */
+/* Possible values for `platform_id', `encoding_id', `language_id', */
+/* and `name_id' are given in the file `ttnameid.h'. For details */
+/* please refer to the TrueType or OpenType specification. */
+/* */
+/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
+/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
+/* */
+typedef struct FT_SfntName_ {
FT_UShort platform_id;
FT_UShort encoding_id;
FT_UShort language_id;
@@ -105,91 +104,91 @@ FT_BEGIN_HEADER
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
- } FT_SfntName;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name_Count */
- /* */
- /* <Description> */
- /* Retrieve the number of name strings in the SFNT `name' table. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Return> */
- /* The number of strings in the `name' table. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Sfnt_Name_Count( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name */
- /* */
- /* <Description> */
- /* Retrieve a string of the SFNT `name' table for a given index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* idx :: The index of the `name' string. */
- /* */
- /* <Output> */
- /* aname :: The indexed @FT_SfntName structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `string' array returned in the `aname' structure is not */
- /* null-terminated. The application should deallocate it if it is no */
- /* longer in use. */
- /* */
- /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
- /* `name' table entries, then do a loop until you get the right */
- /* platform, encoding, and name ID. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Sfnt_Name( FT_Face face,
- FT_UInt idx,
- FT_SfntName *aname );
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred family subfamily names in `name'
- * table since OpenType version 1.4. For backwards compatibility with
- * legacy systems which has 4-face-per-family restriction.
- *
- */
+} FT_SfntName;
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Sfnt_Name_Count */
+/* */
+/* <Description> */
+/* Retrieve the number of name strings in the SFNT `name' table. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face. */
+/* */
+/* <Return> */
+/* The number of strings in the `name' table. */
+/* */
+FT_EXPORT( FT_UInt )
+FT_Get_Sfnt_Name_Count( FT_Face face );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Sfnt_Name */
+/* */
+/* <Description> */
+/* Retrieve a string of the SFNT `name' table for a given index. */
+/* */
+/* <Input> */
+/* face :: A handle to the source face. */
+/* */
+/* idx :: The index of the `name' string. */
+/* */
+/* <Output> */
+/* aname :: The indexed @FT_SfntName structure. */
+/* */
+/* <Return> */
+/* FreeType error code. 0~means success. */
+/* */
+/* <Note> */
+/* The `string' array returned in the `aname' structure is not */
+/* null-terminated. The application should deallocate it if it is no */
+/* longer in use. */
+/* */
+/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
+/* `name' table entries, then do a loop until you get the right */
+/* platform, encoding, and name ID. */
+/* */
+FT_EXPORT( FT_Error )
+FT_Get_Sfnt_Name( FT_Face face,
+ FT_UInt idx,
+ FT_SfntName *aname );
+
+
+/***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to make
+ * FT_Open_Face() ignore preferred family subfamily names in `name'
+ * table since OpenType version 1.4. For backwards compatibility with
+ * legacy systems which has 4-face-per-family restriction.
+ *
+ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred subfamily names in `name' table since
- * OpenType version 1.4. For backwards compatibility with legacy
- * systems which has 4-face-per-family restriction.
- *
- */
+/***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to make
+ * FT_Open_Face() ignore preferred subfamily names in `name' table since
+ * OpenType version 1.4. For backwards compatibility with legacy
+ * systems which has 4-face-per-family restriction.
+ *
+ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftstroke.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftstroke.h
index a498e4a..933557b 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftstroke.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftstroke.h
@@ -27,716 +27,713 @@
FT_BEGIN_HEADER
- /************************************************************************
- *
- * @section:
- * glyph_stroker
- *
- * @title:
- * Glyph Stroker
- *
- * @abstract:
- * Generating bordered and stroked glyphs.
- *
- * @description:
- * This component generates stroked outlines of a given vectorial
- * glyph. It also allows you to retrieve the `outside' and/or the
- * `inside' borders of the stroke.
- *
- * This can be useful to generate `bordered' glyph, i.e., glyphs
- * displayed with a coloured (and anti-aliased) border around their
- * shape.
- */
-
-
- /**************************************************************
- *
- * @type:
- * FT_Stroker
- *
- * @description:
- * Opaque handler to a path stroker object.
- */
- typedef struct FT_StrokerRec_* FT_Stroker;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_Stroker_LineJoin
- *
- * @description:
- * These values determine how two joining lines are rendered
- * in a stroker.
- *
- * @values:
- * FT_STROKER_LINEJOIN_ROUND ::
- * Used to render rounded line joins. Circular arcs are used
- * to join two lines smoothly.
- *
- * FT_STROKER_LINEJOIN_BEVEL ::
- * Used to render beveled line joins. The outer corner of
- * the joined lines is filled by enclosing the triangular
- * region of the corner with a straight line between the
- * outer corners of each stroke.
- *
- * FT_STROKER_LINEJOIN_MITER_FIXED ::
- * Used to render mitered line joins, with fixed bevels if the
- * miter limit is exceeded. The outer edges of the strokes
- * for the two segments are extended until they meet at an
- * angle. If the segments meet at too sharp an angle (such
- * that the miter would extend from the intersection of the
- * segments a distance greater than the product of the miter
- * limit value and the border radius), then a bevel join (see
- * above) is used instead. This prevents long spikes being
- * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
- * line join as used in PostScript and PDF.
- *
- * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
- * FT_STROKER_LINEJOIN_MITER ::
- * Used to render mitered line joins, with variable bevels if
- * the miter limit is exceeded. The intersection of the
- * strokes is clipped at a line perpendicular to the bisector
- * of the angle between the strokes, at the distance from the
- * intersection of the segments equal to the product of the
- * miter limit value and the border radius. This prevents
- * long spikes being created.
- * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
- * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
- * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
- * backwards compatibility.
- */
- typedef enum FT_Stroker_LineJoin_
- {
+/************************************************************************
+ *
+ * @section:
+ * glyph_stroker
+ *
+ * @title:
+ * Glyph Stroker
+ *
+ * @abstract:
+ * Generating bordered and stroked glyphs.
+ *
+ * @description:
+ * This component generates stroked outlines of a given vectorial
+ * glyph. It also allows you to retrieve the `outside' and/or the
+ * `inside' borders of the stroke.
+ *
+ * This can be useful to generate `bordered' glyph, i.e., glyphs
+ * displayed with a coloured (and anti-aliased) border around their
+ * shape.
+ */
+
+
+/**************************************************************
+ *
+ * @type:
+ * FT_Stroker
+ *
+ * @description:
+ * Opaque handler to a path stroker object.
+ */
+typedef struct FT_StrokerRec_* FT_Stroker;
+
+
+/**************************************************************
+ *
+ * @enum:
+ * FT_Stroker_LineJoin
+ *
+ * @description:
+ * These values determine how two joining lines are rendered
+ * in a stroker.
+ *
+ * @values:
+ * FT_STROKER_LINEJOIN_ROUND ::
+ * Used to render rounded line joins. Circular arcs are used
+ * to join two lines smoothly.
+ *
+ * FT_STROKER_LINEJOIN_BEVEL ::
+ * Used to render beveled line joins. The outer corner of
+ * the joined lines is filled by enclosing the triangular
+ * region of the corner with a straight line between the
+ * outer corners of each stroke.
+ *
+ * FT_STROKER_LINEJOIN_MITER_FIXED ::
+ * Used to render mitered line joins, with fixed bevels if the
+ * miter limit is exceeded. The outer edges of the strokes
+ * for the two segments are extended until they meet at an
+ * angle. If the segments meet at too sharp an angle (such
+ * that the miter would extend from the intersection of the
+ * segments a distance greater than the product of the miter
+ * limit value and the border radius), then a bevel join (see
+ * above) is used instead. This prevents long spikes being
+ * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
+ * line join as used in PostScript and PDF.
+ *
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
+ * FT_STROKER_LINEJOIN_MITER ::
+ * Used to render mitered line joins, with variable bevels if
+ * the miter limit is exceeded. The intersection of the
+ * strokes is clipped at a line perpendicular to the bisector
+ * of the angle between the strokes, at the distance from the
+ * intersection of the segments equal to the product of the
+ * miter limit value and the border radius. This prevents
+ * long spikes being created.
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
+ * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
+ * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
+ * backwards compatibility.
+ */
+typedef enum FT_Stroker_LineJoin_ {
FT_STROKER_LINEJOIN_ROUND = 0,
FT_STROKER_LINEJOIN_BEVEL = 1,
FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
FT_STROKER_LINEJOIN_MITER_FIXED = 3
- } FT_Stroker_LineJoin;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_Stroker_LineCap
- *
- * @description:
- * These values determine how the end of opened sub-paths are
- * rendered in a stroke.
- *
- * @values:
- * FT_STROKER_LINECAP_BUTT ::
- * The end of lines is rendered as a full stop on the last
- * point itself.
- *
- * FT_STROKER_LINECAP_ROUND ::
- * The end of lines is rendered as a half-circle around the
- * last point.
- *
- * FT_STROKER_LINECAP_SQUARE ::
- * The end of lines is rendered as a square around the
- * last point.
- */
- typedef enum FT_Stroker_LineCap_
- {
+} FT_Stroker_LineJoin;
+
+
+/**************************************************************
+ *
+ * @enum:
+ * FT_Stroker_LineCap
+ *
+ * @description:
+ * These values determine how the end of opened sub-paths are
+ * rendered in a stroke.
+ *
+ * @values:
+ * FT_STROKER_LINECAP_BUTT ::
+ * The end of lines is rendered as a full stop on the last
+ * point itself.
+ *
+ * FT_STROKER_LINECAP_ROUND ::
+ * The end of lines is rendered as a half-circle around the
+ * last point.
+ *
+ * FT_STROKER_LINECAP_SQUARE ::
+ * The end of lines is rendered as a square around the
+ * last point.
+ */
+typedef enum FT_Stroker_LineCap_ {
FT_STROKER_LINECAP_BUTT = 0,
FT_STROKER_LINECAP_ROUND,
FT_STROKER_LINECAP_SQUARE
- } FT_Stroker_LineCap;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_StrokerBorder
- *
- * @description:
- * These values are used to select a given stroke border
- * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
- *
- * @values:
- * FT_STROKER_BORDER_LEFT ::
- * Select the left border, relative to the drawing direction.
- *
- * FT_STROKER_BORDER_RIGHT ::
- * Select the right border, relative to the drawing direction.
- *
- * @note:
- * Applications are generally interested in the `inside' and `outside'
- * borders. However, there is no direct mapping between these and the
- * `left' and `right' ones, since this really depends on the glyph's
- * drawing orientation, which varies between font formats.
- *
- * You can however use @FT_Outline_GetInsideBorder and
- * @FT_Outline_GetOutsideBorder to get these.
- */
- typedef enum FT_StrokerBorder_
- {
+} FT_Stroker_LineCap;
+
+
+/**************************************************************
+ *
+ * @enum:
+ * FT_StrokerBorder
+ *
+ * @description:
+ * These values are used to select a given stroke border
+ * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
+ *
+ * @values:
+ * FT_STROKER_BORDER_LEFT ::
+ * Select the left border, relative to the drawing direction.
+ *
+ * FT_STROKER_BORDER_RIGHT ::
+ * Select the right border, relative to the drawing direction.
+ *
+ * @note:
+ * Applications are generally interested in the `inside' and `outside'
+ * borders. However, there is no direct mapping between these and the
+ * `left' and `right' ones, since this really depends on the glyph's
+ * drawing orientation, which varies between font formats.
+ *
+ * You can however use @FT_Outline_GetInsideBorder and
+ * @FT_Outline_GetOutsideBorder to get these.
+ */
+typedef enum FT_StrokerBorder_ {
FT_STROKER_BORDER_LEFT = 0,
FT_STROKER_BORDER_RIGHT
- } FT_StrokerBorder;
-
-
- /**************************************************************
- *
- * @function:
- * FT_Outline_GetInsideBorder
- *
- * @description:
- * Retrieve the @FT_StrokerBorder value corresponding to the
- * `inside' borders of a given outline.
- *
- * @input:
- * outline ::
- * The source outline handle.
- *
- * @return:
- * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
- * outlines.
- */
- FT_EXPORT( FT_StrokerBorder )
- FT_Outline_GetInsideBorder( FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Outline_GetOutsideBorder
- *
- * @description:
- * Retrieve the @FT_StrokerBorder value corresponding to the
- * `outside' borders of a given outline.
- *
- * @input:
- * outline ::
- * The source outline handle.
- *
- * @return:
- * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
- * outlines.
- */
- FT_EXPORT( FT_StrokerBorder )
- FT_Outline_GetOutsideBorder( FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_New
- *
- * @description:
- * Create a new stroker object.
- *
- * @input:
- * library ::
- * FreeType library handle.
- *
- * @output:
- * astroker ::
- * A new stroker object handle. NULL in case of error.
- *
- * @return:
- * FreeType error code. 0~means success.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_New( FT_Library library,
- FT_Stroker *astroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Set
- *
- * @description:
- * Reset a stroker object's attributes.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * radius ::
- * The border radius.
- *
- * line_cap ::
- * The line cap style.
- *
- * line_join ::
- * The line join style.
- *
- * miter_limit ::
- * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
- * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
- * expressed as 16.16 fixed-point value.
- *
- * @note:
- * The radius is expressed in the same units as the outline
- * coordinates.
- */
- FT_EXPORT( void )
- FT_Stroker_Set( FT_Stroker stroker,
- FT_Fixed radius,
- FT_Stroker_LineCap line_cap,
- FT_Stroker_LineJoin line_join,
- FT_Fixed miter_limit );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Rewind
- *
- * @description:
- * Reset a stroker object without changing its attributes.
- * You should call this function before beginning a new
- * series of calls to @FT_Stroker_BeginSubPath or
- * @FT_Stroker_EndSubPath.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- */
- FT_EXPORT( void )
- FT_Stroker_Rewind( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ParseOutline
- *
- * @description:
- * A convenience function used to parse a whole outline with
- * the stroker. The resulting outline(s) can be retrieved
- * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * outline ::
- * The source outline.
- *
- * opened ::
- * A boolean. If~1, the outline is treated as an open path instead
- * of a closed one.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `opened' is~0 (the default), the outline is treated as a closed
- * path, and the stroker generates two distinct `border' outlines.
- *
- * If `opened' is~1, the outline is processed as an open path, and the
- * stroker generates a single `stroke' outline.
- *
- * This function calls @FT_Stroker_Rewind automatically.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_ParseOutline( FT_Stroker stroker,
- FT_Outline* outline,
- FT_Bool opened );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_BeginSubPath
- *
- * @description:
- * Start a new sub-path in the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * to ::
- * A pointer to the start vector.
- *
- * open ::
- * A boolean. If~1, the sub-path is treated as an open one.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function is useful when you need to stroke a path that is
- * not stored as an @FT_Outline object.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_BeginSubPath( FT_Stroker stroker,
- FT_Vector* to,
- FT_Bool open );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_EndSubPath
- *
- * @description:
- * Close the current sub-path in the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function after @FT_Stroker_BeginSubPath.
- * If the subpath was not `opened', this function `draws' a
- * single line segment to the start position when needed.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_EndSubPath( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_LineTo
- *
- * @description:
- * `Draw' a single line segment in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_LineTo( FT_Stroker stroker,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ConicTo
- *
- * @description:
- * `Draw' a single quadratic Bézier in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * control ::
- * A pointer to a Bézier control point.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_ConicTo( FT_Stroker stroker,
- FT_Vector* control,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_CubicTo
- *
- * @description:
- * `Draw' a single cubic Bézier in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * control1 ::
- * A pointer to the first Bézier control point.
- *
- * control2 ::
- * A pointer to second Bézier control point.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_CubicTo( FT_Stroker stroker,
- FT_Vector* control1,
- FT_Vector* control2,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_GetBorderCounts
- *
- * @description:
- * Call this function once you have finished parsing your paths
- * with the stroker. It returns the number of points and
- * contours necessary to export one of the `border' or `stroke'
- * outlines generated by the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * border ::
- * The border index.
- *
- * @output:
- * anum_points ::
- * The number of points.
- *
- * anum_contours ::
- * The number of contours.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * When an outline, or a sub-path, is `closed', the stroker generates
- * two independent `border' outlines, named `left' and `right'.
- *
- * When the outline, or a sub-path, is `opened', the stroker merges
- * the `border' outlines with caps. The `left' border receives all
- * points, while the `right' border becomes empty.
- *
- * Use the function @FT_Stroker_GetCounts instead if you want to
- * retrieve the counts associated to both borders.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_GetBorderCounts( FT_Stroker stroker,
- FT_StrokerBorder border,
- FT_UInt *anum_points,
- FT_UInt *anum_contours );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ExportBorder
- *
- * @description:
- * Call this function after @FT_Stroker_GetBorderCounts to
- * export the corresponding border to your own @FT_Outline
- * structure.
- *
- * Note that this function appends the border points and
- * contours to your outline, but does not try to resize its
- * arrays.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * border ::
- * The border index.
- *
- * outline ::
- * The target outline handle.
- *
- * @note:
- * Always call this function after @FT_Stroker_GetBorderCounts to
- * get sure that there is enough room in your @FT_Outline object to
- * receive all new data.
- *
- * When an outline, or a sub-path, is `closed', the stroker generates
- * two independent `border' outlines, named `left' and `right'
- *
- * When the outline, or a sub-path, is `opened', the stroker merges
- * the `border' outlines with caps. The `left' border receives all
- * points, while the `right' border becomes empty.
- *
- * Use the function @FT_Stroker_Export instead if you want to
- * retrieve all borders at once.
- */
- FT_EXPORT( void )
- FT_Stroker_ExportBorder( FT_Stroker stroker,
- FT_StrokerBorder border,
- FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_GetCounts
- *
- * @description:
- * Call this function once you have finished parsing your paths
- * with the stroker. It returns the number of points and
- * contours necessary to export all points/borders from the stroked
- * outline/path.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * @output:
- * anum_points ::
- * The number of points.
- *
- * anum_contours ::
- * The number of contours.
- *
- * @return:
- * FreeType error code. 0~means success.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_GetCounts( FT_Stroker stroker,
- FT_UInt *anum_points,
- FT_UInt *anum_contours );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Export
- *
- * @description:
- * Call this function after @FT_Stroker_GetBorderCounts to
- * export all borders to your own @FT_Outline structure.
- *
- * Note that this function appends the border points and
- * contours to your outline, but does not try to resize its
- * arrays.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * outline ::
- * The target outline handle.
- */
- FT_EXPORT( void )
- FT_Stroker_Export( FT_Stroker stroker,
- FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Done
- *
- * @description:
- * Destroy a stroker object.
- *
- * @input:
- * stroker ::
- * A stroker handle. Can be NULL.
- */
- FT_EXPORT( void )
- FT_Stroker_Done( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Glyph_Stroke
- *
- * @description:
- * Stroke a given outline glyph object with a given stroker.
- *
- * @inout:
- * pglyph ::
- * Source glyph handle on input, new glyph handle on output.
- *
- * @input:
- * stroker ::
- * A stroker handle.
- *
- * destroy ::
- * A Boolean. If~1, the source glyph object is destroyed
- * on success.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source glyph is untouched in case of error.
- *
- * Adding stroke may yield a significantly wider and taller glyph
- * depending on how large of a radius was used to stroke the glyph. You
- * may need to manually adjust horizontal and vertical advance amounts
- * to account for this added size.
- */
- FT_EXPORT( FT_Error )
- FT_Glyph_Stroke( FT_Glyph *pglyph,
- FT_Stroker stroker,
- FT_Bool destroy );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Glyph_StrokeBorder
- *
- * @description:
- * Stroke a given outline glyph object with a given stroker, but
- * only return either its inside or outside border.
- *
- * @inout:
- * pglyph ::
- * Source glyph handle on input, new glyph handle on output.
- *
- * @input:
- * stroker ::
- * A stroker handle.
- *
- * inside ::
- * A Boolean. If~1, return the inside border, otherwise
- * the outside border.
- *
- * destroy ::
- * A Boolean. If~1, the source glyph object is destroyed
- * on success.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source glyph is untouched in case of error.
- *
- * Adding stroke may yield a significantly wider and taller glyph
- * depending on how large of a radius was used to stroke the glyph. You
- * may need to manually adjust horizontal and vertical advance amounts
- * to account for this added size.
- */
- FT_EXPORT( FT_Error )
- FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
- FT_Stroker stroker,
- FT_Bool inside,
- FT_Bool destroy );
-
- /* */
+} FT_StrokerBorder;
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Outline_GetInsideBorder
+ *
+ * @description:
+ * Retrieve the @FT_StrokerBorder value corresponding to the
+ * `inside' borders of a given outline.
+ *
+ * @input:
+ * outline ::
+ * The source outline handle.
+ *
+ * @return:
+ * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
+ * outlines.
+ */
+FT_EXPORT( FT_StrokerBorder )
+FT_Outline_GetInsideBorder( FT_Outline* outline );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Outline_GetOutsideBorder
+ *
+ * @description:
+ * Retrieve the @FT_StrokerBorder value corresponding to the
+ * `outside' borders of a given outline.
+ *
+ * @input:
+ * outline ::
+ * The source outline handle.
+ *
+ * @return:
+ * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
+ * outlines.
+ */
+FT_EXPORT( FT_StrokerBorder )
+FT_Outline_GetOutsideBorder( FT_Outline* outline );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_New
+ *
+ * @description:
+ * Create a new stroker object.
+ *
+ * @input:
+ * library ::
+ * FreeType library handle.
+ *
+ * @output:
+ * astroker ::
+ * A new stroker object handle. NULL in case of error.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_New( FT_Library library,
+ FT_Stroker *astroker );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Set
+ *
+ * @description:
+ * Reset a stroker object's attributes.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * radius ::
+ * The border radius.
+ *
+ * line_cap ::
+ * The line cap style.
+ *
+ * line_join ::
+ * The line join style.
+ *
+ * miter_limit ::
+ * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
+ * expressed as 16.16 fixed-point value.
+ *
+ * @note:
+ * The radius is expressed in the same units as the outline
+ * coordinates.
+ */
+FT_EXPORT( void )
+FT_Stroker_Set( FT_Stroker stroker,
+ FT_Fixed radius,
+ FT_Stroker_LineCap line_cap,
+ FT_Stroker_LineJoin line_join,
+ FT_Fixed miter_limit );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Rewind
+ *
+ * @description:
+ * Reset a stroker object without changing its attributes.
+ * You should call this function before beginning a new
+ * series of calls to @FT_Stroker_BeginSubPath or
+ * @FT_Stroker_EndSubPath.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ */
+FT_EXPORT( void )
+FT_Stroker_Rewind( FT_Stroker stroker );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ParseOutline
+ *
+ * @description:
+ * A convenience function used to parse a whole outline with
+ * the stroker. The resulting outline(s) can be retrieved
+ * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * outline ::
+ * The source outline.
+ *
+ * opened ::
+ * A boolean. If~1, the outline is treated as an open path instead
+ * of a closed one.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `opened' is~0 (the default), the outline is treated as a closed
+ * path, and the stroker generates two distinct `border' outlines.
+ *
+ * If `opened' is~1, the outline is processed as an open path, and the
+ * stroker generates a single `stroke' outline.
+ *
+ * This function calls @FT_Stroker_Rewind automatically.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_ParseOutline( FT_Stroker stroker,
+ FT_Outline* outline,
+ FT_Bool opened );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_BeginSubPath
+ *
+ * @description:
+ * Start a new sub-path in the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * to ::
+ * A pointer to the start vector.
+ *
+ * open ::
+ * A boolean. If~1, the sub-path is treated as an open one.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function is useful when you need to stroke a path that is
+ * not stored as an @FT_Outline object.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_BeginSubPath( FT_Stroker stroker,
+ FT_Vector* to,
+ FT_Bool open );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_EndSubPath
+ *
+ * @description:
+ * Close the current sub-path in the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function after @FT_Stroker_BeginSubPath.
+ * If the subpath was not `opened', this function `draws' a
+ * single line segment to the start position when needed.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_EndSubPath( FT_Stroker stroker );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_LineTo
+ *
+ * @description:
+ * `Draw' a single line segment in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_LineTo( FT_Stroker stroker,
+ FT_Vector* to );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ConicTo
+ *
+ * @description:
+ * `Draw' a single quadratic Bézier in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * control ::
+ * A pointer to a Bézier control point.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_ConicTo( FT_Stroker stroker,
+ FT_Vector* control,
+ FT_Vector* to );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_CubicTo
+ *
+ * @description:
+ * `Draw' a single cubic Bézier in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * control1 ::
+ * A pointer to the first Bézier control point.
+ *
+ * control2 ::
+ * A pointer to second Bézier control point.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_CubicTo( FT_Stroker stroker,
+ FT_Vector* control1,
+ FT_Vector* control2,
+ FT_Vector* to );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_GetBorderCounts
+ *
+ * @description:
+ * Call this function once you have finished parsing your paths
+ * with the stroker. It returns the number of points and
+ * contours necessary to export one of the `border' or `stroke'
+ * outlines generated by the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * border ::
+ * The border index.
+ *
+ * @output:
+ * anum_points ::
+ * The number of points.
+ *
+ * anum_contours ::
+ * The number of contours.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * When an outline, or a sub-path, is `closed', the stroker generates
+ * two independent `border' outlines, named `left' and `right'.
+ *
+ * When the outline, or a sub-path, is `opened', the stroker merges
+ * the `border' outlines with caps. The `left' border receives all
+ * points, while the `right' border becomes empty.
+ *
+ * Use the function @FT_Stroker_GetCounts instead if you want to
+ * retrieve the counts associated to both borders.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_GetBorderCounts( FT_Stroker stroker,
+ FT_StrokerBorder border,
+ FT_UInt *anum_points,
+ FT_UInt *anum_contours );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ExportBorder
+ *
+ * @description:
+ * Call this function after @FT_Stroker_GetBorderCounts to
+ * export the corresponding border to your own @FT_Outline
+ * structure.
+ *
+ * Note that this function appends the border points and
+ * contours to your outline, but does not try to resize its
+ * arrays.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * border ::
+ * The border index.
+ *
+ * outline ::
+ * The target outline handle.
+ *
+ * @note:
+ * Always call this function after @FT_Stroker_GetBorderCounts to
+ * get sure that there is enough room in your @FT_Outline object to
+ * receive all new data.
+ *
+ * When an outline, or a sub-path, is `closed', the stroker generates
+ * two independent `border' outlines, named `left' and `right'
+ *
+ * When the outline, or a sub-path, is `opened', the stroker merges
+ * the `border' outlines with caps. The `left' border receives all
+ * points, while the `right' border becomes empty.
+ *
+ * Use the function @FT_Stroker_Export instead if you want to
+ * retrieve all borders at once.
+ */
+FT_EXPORT( void )
+FT_Stroker_ExportBorder( FT_Stroker stroker,
+ FT_StrokerBorder border,
+ FT_Outline* outline );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_GetCounts
+ *
+ * @description:
+ * Call this function once you have finished parsing your paths
+ * with the stroker. It returns the number of points and
+ * contours necessary to export all points/borders from the stroked
+ * outline/path.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * @output:
+ * anum_points ::
+ * The number of points.
+ *
+ * anum_contours ::
+ * The number of contours.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ */
+FT_EXPORT( FT_Error )
+FT_Stroker_GetCounts( FT_Stroker stroker,
+ FT_UInt *anum_points,
+ FT_UInt *anum_contours );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Export
+ *
+ * @description:
+ * Call this function after @FT_Stroker_GetBorderCounts to
+ * export all borders to your own @FT_Outline structure.
+ *
+ * Note that this function appends the border points and
+ * contours to your outline, but does not try to resize its
+ * arrays.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * outline ::
+ * The target outline handle.
+ */
+FT_EXPORT( void )
+FT_Stroker_Export( FT_Stroker stroker,
+ FT_Outline* outline );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Done
+ *
+ * @description:
+ * Destroy a stroker object.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle. Can be NULL.
+ */
+FT_EXPORT( void )
+FT_Stroker_Done( FT_Stroker stroker );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Glyph_Stroke
+ *
+ * @description:
+ * Stroke a given outline glyph object with a given stroker.
+ *
+ * @inout:
+ * pglyph ::
+ * Source glyph handle on input, new glyph handle on output.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle.
+ *
+ * destroy ::
+ * A Boolean. If~1, the source glyph object is destroyed
+ * on success.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source glyph is untouched in case of error.
+ *
+ * Adding stroke may yield a significantly wider and taller glyph
+ * depending on how large of a radius was used to stroke the glyph. You
+ * may need to manually adjust horizontal and vertical advance amounts
+ * to account for this added size.
+ */
+FT_EXPORT( FT_Error )
+FT_Glyph_Stroke( FT_Glyph *pglyph,
+ FT_Stroker stroker,
+ FT_Bool destroy );
+
+
+/**************************************************************
+ *
+ * @function:
+ * FT_Glyph_StrokeBorder
+ *
+ * @description:
+ * Stroke a given outline glyph object with a given stroker, but
+ * only return either its inside or outside border.
+ *
+ * @inout:
+ * pglyph ::
+ * Source glyph handle on input, new glyph handle on output.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle.
+ *
+ * inside ::
+ * A Boolean. If~1, return the inside border, otherwise
+ * the outside border.
+ *
+ * destroy ::
+ * A Boolean. If~1, the source glyph object is destroyed
+ * on success.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source glyph is untouched in case of error.
+ *
+ * Adding stroke may yield a significantly wider and taller glyph
+ * depending on how large of a radius was used to stroke the glyph. You
+ * may need to manually adjust horizontal and vertical advance amounts
+ * to account for this added size.
+ */
+FT_EXPORT( FT_Error )
+FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
+ FT_Stroker stroker,
+ FT_Bool inside,
+ FT_Bool destroy );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsynth.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsynth.h
index 2074503..76b2a41 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsynth.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsynth.h
@@ -17,28 +17,28 @@
/***************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /********* *********/
- /********* WARNING, THIS IS ALPHA CODE! THIS API *********/
- /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
- /********* FREETYPE DEVELOPMENT TEAM *********/
- /********* *********/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /* Main reason for not lifting the functions in this module to a */
- /* `standard' API is that the used parameters for emboldening and */
- /* slanting are not configurable. Consider the functions as a */
- /* code resource which should be copied into the application and */
- /* adapted to the particular needs. */
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/********* *********/
+/********* WARNING, THIS IS ALPHA CODE! THIS API *********/
+/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
+/********* FREETYPE DEVELOPMENT TEAM *********/
+/********* *********/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+/*************************************************************************/
+
+
+/* Main reason for not lifting the functions in this module to a */
+/* `standard' API is that the used parameters for emboldening and */
+/* slanting are not configurable. Consider the functions as a */
+/* code resource which should be copied into the application and */
+/* adapted to the particular needs. */
#ifndef __FTSYNTH_H__
@@ -57,21 +57,21 @@
FT_BEGIN_HEADER
- /* Embolden a glyph by a `reasonable' value (which is highly a matter of */
- /* taste). This function is actually a convenience function, providing */
- /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
- /* */
- /* For emboldened outlines the height, width, and advance metrics are */
- /* increased by the strength of the emboldening. You can also call */
- /* @FT_Outline_Get_CBox to get precise values. */
- FT_EXPORT( void )
- FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
-
- /* Slant an outline glyph to the right by about 12 degrees. */
- FT_EXPORT( void )
- FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
-
- /* */
+/* Embolden a glyph by a `reasonable' value (which is highly a matter of */
+/* taste). This function is actually a convenience function, providing */
+/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
+/* */
+/* For emboldened outlines the height, width, and advance metrics are */
+/* increased by the strength of the emboldening. You can also call */
+/* @FT_Outline_Get_CBox to get precise values. */
+FT_EXPORT( void )
+FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
+
+/* Slant an outline glyph to the right by about 12 degrees. */
+FT_EXPORT( void )
+FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsystem.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsystem.h
index e07460c..027cc0f 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftsystem.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftsystem.h
@@ -26,300 +26,297 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* system_interface */
- /* */
- /* <Title> */
- /* System Interface */
- /* */
- /* <Abstract> */
- /* How FreeType manages memory and i/o. */
- /* */
- /* <Description> */
- /* This section contains various definitions related to memory */
- /* management and i/o access. You need to understand this */
- /* information if you want to use a custom memory manager or you own */
- /* i/o streams. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* M E M O R Y M A N A G E M E N T */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Memory
- *
- * @description:
- * A handle to a given memory manager object, defined with an
- * @FT_MemoryRec structure.
- *
- */
- typedef struct FT_MemoryRec_* FT_Memory;
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Alloc_Func
- *
- * @description:
- * A function used to allocate `size' bytes from `memory'.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * size ::
- * The size in bytes to allocate.
- *
- * @return:
- * Address of new memory block. 0~in case of failure.
- *
- */
- typedef void*
- (*FT_Alloc_Func)( FT_Memory memory,
- long size );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Free_Func
- *
- * @description:
- * A function used to release a given block of memory.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * block ::
- * The address of the target memory block.
- *
- */
- typedef void
- (*FT_Free_Func)( FT_Memory memory,
- void* block );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Realloc_Func
- *
- * @description:
- * A function used to re-allocate a given block of memory.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * cur_size ::
- * The block's current size in bytes.
- *
- * new_size ::
- * The block's requested new size.
- *
- * block ::
- * The block's current address.
- *
- * @return:
- * New block address. 0~in case of memory shortage.
- *
- * @note:
- * In case of error, the old block must still be available.
- *
- */
- typedef void*
- (*FT_Realloc_Func)( FT_Memory memory,
- long cur_size,
- long new_size,
- void* block );
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_MemoryRec
- *
- * @description:
- * A structure used to describe a given memory manager to FreeType~2.
- *
- * @fields:
- * user ::
- * A generic typeless pointer for user data.
- *
- * alloc ::
- * A pointer type to an allocation function.
- *
- * free ::
- * A pointer type to an memory freeing function.
- *
- * realloc ::
- * A pointer type to a reallocation function.
- *
- */
- struct FT_MemoryRec_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* system_interface */
+/* */
+/* <Title> */
+/* System Interface */
+/* */
+/* <Abstract> */
+/* How FreeType manages memory and i/o. */
+/* */
+/* <Description> */
+/* This section contains various definitions related to memory */
+/* management and i/o access. You need to understand this */
+/* information if you want to use a custom memory manager or you own */
+/* i/o streams. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* M E M O R Y M A N A G E M E N T */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @type:
+ * FT_Memory
+ *
+ * @description:
+ * A handle to a given memory manager object, defined with an
+ * @FT_MemoryRec structure.
+ *
+ */
+typedef struct FT_MemoryRec_* FT_Memory;
+
+
+/*************************************************************************
+ *
+ * @functype:
+ * FT_Alloc_Func
+ *
+ * @description:
+ * A function used to allocate `size' bytes from `memory'.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * size ::
+ * The size in bytes to allocate.
+ *
+ * @return:
+ * Address of new memory block. 0~in case of failure.
+ *
+ */
+typedef void*
+(*FT_Alloc_Func)( FT_Memory memory,
+ long size );
+
+
+/*************************************************************************
+ *
+ * @functype:
+ * FT_Free_Func
+ *
+ * @description:
+ * A function used to release a given block of memory.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * block ::
+ * The address of the target memory block.
+ *
+ */
+typedef void
+(*FT_Free_Func)( FT_Memory memory,
+ void* block );
+
+
+/*************************************************************************
+ *
+ * @functype:
+ * FT_Realloc_Func
+ *
+ * @description:
+ * A function used to re-allocate a given block of memory.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * cur_size ::
+ * The block's current size in bytes.
+ *
+ * new_size ::
+ * The block's requested new size.
+ *
+ * block ::
+ * The block's current address.
+ *
+ * @return:
+ * New block address. 0~in case of memory shortage.
+ *
+ * @note:
+ * In case of error, the old block must still be available.
+ *
+ */
+typedef void*
+(*FT_Realloc_Func)( FT_Memory memory,
+ long cur_size,
+ long new_size,
+ void* block );
+
+
+/*************************************************************************
+ *
+ * @struct:
+ * FT_MemoryRec
+ *
+ * @description:
+ * A structure used to describe a given memory manager to FreeType~2.
+ *
+ * @fields:
+ * user ::
+ * A generic typeless pointer for user data.
+ *
+ * alloc ::
+ * A pointer type to an allocation function.
+ *
+ * free ::
+ * A pointer type to an memory freeing function.
+ *
+ * realloc ::
+ * A pointer type to a reallocation function.
+ *
+ */
+struct FT_MemoryRec_ {
void* user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
- };
-
-
- /*************************************************************************/
- /* */
- /* I / O M A N A G E M E N T */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Stream
- *
- * @description:
- * A handle to an input stream.
- *
- */
- typedef struct FT_StreamRec_* FT_Stream;
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_StreamDesc
- *
- * @description:
- * A union type used to store either a long or a pointer. This is used
- * to store a file descriptor or a `FILE*' in an input stream.
- *
- */
- typedef union FT_StreamDesc_
- {
+};
+
+
+/*************************************************************************/
+/* */
+/* I / O M A N A G E M E N T */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @type:
+ * FT_Stream
+ *
+ * @description:
+ * A handle to an input stream.
+ *
+ */
+typedef struct FT_StreamRec_* FT_Stream;
+
+
+/*************************************************************************
+ *
+ * @struct:
+ * FT_StreamDesc
+ *
+ * @description:
+ * A union type used to store either a long or a pointer. This is used
+ * to store a file descriptor or a `FILE*' in an input stream.
+ *
+ */
+typedef union FT_StreamDesc_ {
long value;
void* pointer;
- } FT_StreamDesc;
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Stream_IoFunc
- *
- * @description:
- * A function used to seek and read data from a given input stream.
- *
- * @input:
- * stream ::
- * A handle to the source stream.
- *
- * offset ::
- * The offset of read in stream (always from start).
- *
- * buffer ::
- * The address of the read buffer.
- *
- * count ::
- * The number of bytes to read from the stream.
- *
- * @return:
- * The number of bytes effectively read by the stream.
- *
- * @note:
- * This function might be called to perform a seek or skip operation
- * with a `count' of~0. A non-zero return value then indicates an
- * error.
- *
- */
- typedef unsigned long
- (*FT_Stream_IoFunc)( FT_Stream stream,
- unsigned long offset,
- unsigned char* buffer,
- unsigned long count );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Stream_CloseFunc
- *
- * @description:
- * A function used to close a given input stream.
- *
- * @input:
- * stream ::
- * A handle to the target stream.
- *
- */
- typedef void
- (*FT_Stream_CloseFunc)( FT_Stream stream );
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_StreamRec
- *
- * @description:
- * A structure used to describe an input stream.
- *
- * @input:
- * base ::
- * For memory-based streams, this is the address of the first stream
- * byte in memory. This field should always be set to NULL for
- * disk-based streams.
- *
- * size ::
- * The stream size in bytes.
- *
- * pos ::
- * The current position within the stream.
- *
- * descriptor ::
- * This field is a union that can hold an integer or a pointer. It is
- * used by stream implementations to store file descriptors or `FILE*'
- * pointers.
- *
- * pathname ::
- * This field is completely ignored by FreeType. However, it is often
- * useful during debugging to use it to store the stream's filename
- * (where available).
- *
- * read ::
- * The stream's input function.
- *
- * close ::
- * The stream's close function.
- *
- * memory ::
- * The memory manager to use to preload frames. This is set
- * internally by FreeType and shouldn't be touched by stream
- * implementations.
- *
- * cursor ::
- * This field is set and used internally by FreeType when parsing
- * frames.
- *
- * limit ::
- * This field is set and used internally by FreeType when parsing
- * frames.
- *
- */
- typedef struct FT_StreamRec_
- {
+} FT_StreamDesc;
+
+
+/*************************************************************************
+ *
+ * @functype:
+ * FT_Stream_IoFunc
+ *
+ * @description:
+ * A function used to seek and read data from a given input stream.
+ *
+ * @input:
+ * stream ::
+ * A handle to the source stream.
+ *
+ * offset ::
+ * The offset of read in stream (always from start).
+ *
+ * buffer ::
+ * The address of the read buffer.
+ *
+ * count ::
+ * The number of bytes to read from the stream.
+ *
+ * @return:
+ * The number of bytes effectively read by the stream.
+ *
+ * @note:
+ * This function might be called to perform a seek or skip operation
+ * with a `count' of~0. A non-zero return value then indicates an
+ * error.
+ *
+ */
+typedef unsigned long
+(*FT_Stream_IoFunc)( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count );
+
+
+/*************************************************************************
+ *
+ * @functype:
+ * FT_Stream_CloseFunc
+ *
+ * @description:
+ * A function used to close a given input stream.
+ *
+ * @input:
+ * stream ::
+ * A handle to the target stream.
+ *
+ */
+typedef void
+(*FT_Stream_CloseFunc)( FT_Stream stream );
+
+
+/*************************************************************************
+ *
+ * @struct:
+ * FT_StreamRec
+ *
+ * @description:
+ * A structure used to describe an input stream.
+ *
+ * @input:
+ * base ::
+ * For memory-based streams, this is the address of the first stream
+ * byte in memory. This field should always be set to NULL for
+ * disk-based streams.
+ *
+ * size ::
+ * The stream size in bytes.
+ *
+ * pos ::
+ * The current position within the stream.
+ *
+ * descriptor ::
+ * This field is a union that can hold an integer or a pointer. It is
+ * used by stream implementations to store file descriptors or `FILE*'
+ * pointers.
+ *
+ * pathname ::
+ * This field is completely ignored by FreeType. However, it is often
+ * useful during debugging to use it to store the stream's filename
+ * (where available).
+ *
+ * read ::
+ * The stream's input function.
+ *
+ * close ::
+ * The stream's close function.
+ *
+ * memory ::
+ * The memory manager to use to preload frames. This is set
+ * internally by FreeType and shouldn't be touched by stream
+ * implementations.
+ *
+ * cursor ::
+ * This field is set and used internally by FreeType when parsing
+ * frames.
+ *
+ * limit ::
+ * This field is set and used internally by FreeType when parsing
+ * frames.
+ *
+ */
+typedef struct FT_StreamRec_ {
unsigned char* base;
unsigned long size;
unsigned long pos;
@@ -333,10 +330,10 @@ FT_BEGIN_HEADER
unsigned char* cursor;
unsigned char* limit;
- } FT_StreamRec;
+} FT_StreamRec;
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/fttrigon.h b/thirdparties/common/include/libfreetype/freetype2/freetype/fttrigon.h
index 65143cb..2e4bab6 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/fttrigon.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/fttrigon.h
@@ -31,315 +31,315 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Angle
- *
- * @description:
- * This type is used to model angle values in FreeType. Note that the
- * angle is a 16.16 fixed-point value expressed in degrees.
- *
- */
- typedef FT_Fixed FT_Angle;
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI
- *
- * @description:
- * The angle pi expressed in @FT_Angle units.
- *
- */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* computations */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************
+ *
+ * @type:
+ * FT_Angle
+ *
+ * @description:
+ * This type is used to model angle values in FreeType. Note that the
+ * angle is a 16.16 fixed-point value expressed in degrees.
+ *
+ */
+typedef FT_Fixed FT_Angle;
+
+
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI
+ *
+ * @description:
+ * The angle pi expressed in @FT_Angle units.
+ *
+ */
#define FT_ANGLE_PI ( 180L << 16 )
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_2PI
- *
- * @description:
- * The angle 2*pi expressed in @FT_Angle units.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_2PI
+ *
+ * @description:
+ * The angle 2*pi expressed in @FT_Angle units.
+ *
+ */
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI2
- *
- * @description:
- * The angle pi/2 expressed in @FT_Angle units.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI2
+ *
+ * @description:
+ * The angle pi/2 expressed in @FT_Angle units.
+ *
+ */
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI4
- *
- * @description:
- * The angle pi/4 expressed in @FT_Angle units.
- *
- */
+/*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI4
+ *
+ * @description:
+ * The angle pi/4 expressed in @FT_Angle units.
+ *
+ */
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
- /*************************************************************************
- *
- * @function:
- * FT_Sin
- *
- * @description:
- * Return the sinus of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The sinus value.
- *
- * @note:
- * If you need both the sinus and cosinus for a given angle, use the
- * function @FT_Vector_Unit.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Sin( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Cos
- *
- * @description:
- * Return the cosinus of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The cosinus value.
- *
- * @note:
- * If you need both the sinus and cosinus for a given angle, use the
- * function @FT_Vector_Unit.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Cos( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Tan
- *
- * @description:
- * Return the tangent of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The tangent value.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Tan( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Atan2
- *
- * @description:
- * Return the arc-tangent corresponding to a given vector (x,y) in
- * the 2d plane.
- *
- * @input:
- * x ::
- * The horizontal vector coordinate.
- *
- * y ::
- * The vertical vector coordinate.
- *
- * @return:
- * The arc-tangent value (i.e. angle).
- *
- */
- FT_EXPORT( FT_Angle )
- FT_Atan2( FT_Fixed x,
- FT_Fixed y );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Angle_Diff
- *
- * @description:
- * Return the difference between two angles. The result is always
- * constrained to the ]-PI..PI] interval.
- *
- * @input:
- * angle1 ::
- * First angle.
- *
- * angle2 ::
- * Second angle.
- *
- * @return:
- * Constrained value of `value2-value1'.
- *
- */
- FT_EXPORT( FT_Angle )
- FT_Angle_Diff( FT_Angle angle1,
- FT_Angle angle2 );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Unit
- *
- * @description:
- * Return the unit vector corresponding to a given angle. After the
- * call, the value of `vec.x' will be `sin(angle)', and the value of
- * `vec.y' will be `cos(angle)'.
- *
- * This function is useful to retrieve both the sinus and cosinus of a
- * given angle quickly.
- *
- * @output:
- * vec ::
- * The address of target vector.
- *
- * @input:
- * angle ::
- * The address of angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Unit( FT_Vector* vec,
+/*************************************************************************
+ *
+ * @function:
+ * FT_Sin
+ *
+ * @description:
+ * Return the sinus of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The sinus value.
+ *
+ * @note:
+ * If you need both the sinus and cosinus for a given angle, use the
+ * function @FT_Vector_Unit.
+ *
+ */
+FT_EXPORT( FT_Fixed )
+FT_Sin( FT_Angle angle );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Cos
+ *
+ * @description:
+ * Return the cosinus of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The cosinus value.
+ *
+ * @note:
+ * If you need both the sinus and cosinus for a given angle, use the
+ * function @FT_Vector_Unit.
+ *
+ */
+FT_EXPORT( FT_Fixed )
+FT_Cos( FT_Angle angle );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Tan
+ *
+ * @description:
+ * Return the tangent of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The tangent value.
+ *
+ */
+FT_EXPORT( FT_Fixed )
+FT_Tan( FT_Angle angle );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Atan2
+ *
+ * @description:
+ * Return the arc-tangent corresponding to a given vector (x,y) in
+ * the 2d plane.
+ *
+ * @input:
+ * x ::
+ * The horizontal vector coordinate.
+ *
+ * y ::
+ * The vertical vector coordinate.
+ *
+ * @return:
+ * The arc-tangent value (i.e. angle).
+ *
+ */
+FT_EXPORT( FT_Angle )
+FT_Atan2( FT_Fixed x,
+ FT_Fixed y );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Angle_Diff
+ *
+ * @description:
+ * Return the difference between two angles. The result is always
+ * constrained to the ]-PI..PI] interval.
+ *
+ * @input:
+ * angle1 ::
+ * First angle.
+ *
+ * angle2 ::
+ * Second angle.
+ *
+ * @return:
+ * Constrained value of `value2-value1'.
+ *
+ */
+FT_EXPORT( FT_Angle )
+FT_Angle_Diff( FT_Angle angle1,
+ FT_Angle angle2 );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Unit
+ *
+ * @description:
+ * Return the unit vector corresponding to a given angle. After the
+ * call, the value of `vec.x' will be `sin(angle)', and the value of
+ * `vec.y' will be `cos(angle)'.
+ *
+ * This function is useful to retrieve both the sinus and cosinus of a
+ * given angle quickly.
+ *
+ * @output:
+ * vec ::
+ * The address of target vector.
+ *
+ * @input:
+ * angle ::
+ * The address of angle.
+ *
+ */
+FT_EXPORT( void )
+FT_Vector_Unit( FT_Vector* vec,
+ FT_Angle angle );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Rotate
+ *
+ * @description:
+ * Rotate a vector by a given angle.
+ *
+ * @inout:
+ * vec ::
+ * The address of target vector.
+ *
+ * @input:
+ * angle ::
+ * The address of angle.
+ *
+ */
+FT_EXPORT( void )
+FT_Vector_Rotate( FT_Vector* vec,
FT_Angle angle );
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Rotate
- *
- * @description:
- * Rotate a vector by a given angle.
- *
- * @inout:
- * vec ::
- * The address of target vector.
- *
- * @input:
- * angle ::
- * The address of angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Rotate( FT_Vector* vec,
- FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Length
- *
- * @description:
- * Return the length of a given vector.
- *
- * @input:
- * vec ::
- * The address of target vector.
- *
- * @return:
- * The vector length, expressed in the same units that the original
- * vector coordinates.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Vector_Length( FT_Vector* vec );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Polarize
- *
- * @description:
- * Compute both the length and angle of a given vector.
- *
- * @input:
- * vec ::
- * The address of source vector.
- *
- * @output:
- * length ::
- * The vector length.
- *
- * angle ::
- * The vector angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Polarize( FT_Vector* vec,
- FT_Fixed *length,
- FT_Angle *angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_From_Polar
- *
- * @description:
- * Compute vector coordinates from a length and angle.
- *
- * @output:
- * vec ::
- * The address of source vector.
- *
- * @input:
- * length ::
- * The vector length.
- *
- * angle ::
- * The vector angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_From_Polar( FT_Vector* vec,
- FT_Fixed length,
- FT_Angle angle );
-
- /* */
+/*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Length
+ *
+ * @description:
+ * Return the length of a given vector.
+ *
+ * @input:
+ * vec ::
+ * The address of target vector.
+ *
+ * @return:
+ * The vector length, expressed in the same units that the original
+ * vector coordinates.
+ *
+ */
+FT_EXPORT( FT_Fixed )
+FT_Vector_Length( FT_Vector* vec );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Polarize
+ *
+ * @description:
+ * Compute both the length and angle of a given vector.
+ *
+ * @input:
+ * vec ::
+ * The address of source vector.
+ *
+ * @output:
+ * length ::
+ * The vector length.
+ *
+ * angle ::
+ * The vector angle.
+ *
+ */
+FT_EXPORT( void )
+FT_Vector_Polarize( FT_Vector* vec,
+ FT_Fixed *length,
+ FT_Angle *angle );
+
+
+/*************************************************************************
+ *
+ * @function:
+ * FT_Vector_From_Polar
+ *
+ * @description:
+ * Compute vector coordinates from a length and angle.
+ *
+ * @output:
+ * vec ::
+ * The address of source vector.
+ *
+ * @input:
+ * length ::
+ * The vector length.
+ *
+ * angle ::
+ * The vector angle.
+ *
+ */
+FT_EXPORT( void )
+FT_Vector_From_Polar( FT_Vector* vec,
+ FT_Fixed length,
+ FT_Angle angle );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/fttypes.h b/thirdparties/common/include/libfreetype/freetype2/freetype/fttypes.h
index 027e59c..ee7b808 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/fttypes.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/fttypes.h
@@ -31,448 +31,444 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /* <Title> */
- /* Basic Data Types */
- /* */
- /* <Abstract> */
- /* The basic data types defined by the library. */
- /* */
- /* <Description> */
- /* This section contains the basic data types defined by FreeType~2, */
- /* ranging from simple scalar types to bitmap descriptors. More */
- /* font-specific structures are defined in a different section. */
- /* */
- /* <Order> */
- /* FT_Byte */
- /* FT_Bytes */
- /* FT_Char */
- /* FT_Int */
- /* FT_UInt */
- /* FT_Int16 */
- /* FT_UInt16 */
- /* FT_Int32 */
- /* FT_UInt32 */
- /* FT_Short */
- /* FT_UShort */
- /* FT_Long */
- /* FT_ULong */
- /* FT_Bool */
- /* FT_Offset */
- /* FT_PtrDist */
- /* FT_String */
- /* FT_Tag */
- /* FT_Error */
- /* FT_Fixed */
- /* FT_Pointer */
- /* FT_Pos */
- /* FT_Vector */
- /* FT_BBox */
- /* FT_Matrix */
- /* FT_FWord */
- /* FT_UFWord */
- /* FT_F2Dot14 */
- /* FT_UnitVector */
- /* FT_F26Dot6 */
- /* */
- /* */
- /* FT_Generic */
- /* FT_Generic_Finalizer */
- /* */
- /* FT_Bitmap */
- /* FT_Pixel_Mode */
- /* FT_Palette_Mode */
- /* FT_Glyph_Format */
- /* FT_IMAGE_TAG */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bool */
- /* */
- /* <Description> */
- /* A typedef of unsigned char, used for simple booleans. As usual, */
- /* values 1 and~0 represent true and false, respectively. */
- /* */
- typedef unsigned char FT_Bool;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_FWord */
- /* */
- /* <Description> */
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
- /* */
- typedef signed short FT_FWord; /* distance in FUnits */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UFWord */
- /* */
- /* <Description> */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- typedef unsigned short FT_UFWord; /* unsigned distance */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Char */
- /* */
- /* <Description> */
- /* A simple typedef for the _signed_ char type. */
- /* */
- typedef signed char FT_Char;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Byte */
- /* */
- /* <Description> */
- /* A simple typedef for the _unsigned_ char type. */
- /* */
- typedef unsigned char FT_Byte;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bytes */
- /* */
- /* <Description> */
- /* A typedef for constant memory areas. */
- /* */
- typedef const FT_Byte* FT_Bytes;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Tag */
- /* */
- /* <Description> */
- /* A typedef for 32-bit tags (as used in the SFNT format). */
- /* */
- typedef FT_UInt32 FT_Tag;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_String */
- /* */
- /* <Description> */
- /* A simple typedef for the char type, usually used for strings. */
- /* */
- typedef char FT_String;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Short */
- /* */
- /* <Description> */
- /* A typedef for signed short. */
- /* */
- typedef signed short FT_Short;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UShort */
- /* */
- /* <Description> */
- /* A typedef for unsigned short. */
- /* */
- typedef unsigned short FT_UShort;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int */
- /* */
- /* <Description> */
- /* A typedef for the int type. */
- /* */
- typedef signed int FT_Int;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt */
- /* */
- /* <Description> */
- /* A typedef for the unsigned int type. */
- /* */
- typedef unsigned int FT_UInt;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Long */
- /* */
- /* <Description> */
- /* A typedef for signed long. */
- /* */
- typedef signed long FT_Long;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ULong */
- /* */
- /* <Description> */
- /* A typedef for unsigned long. */
- /* */
- typedef unsigned long FT_ULong;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F2Dot14 */
- /* */
- /* <Description> */
- /* A signed 2.14 fixed-point type used for unit vectors. */
- /* */
- typedef signed short FT_F2Dot14;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F26Dot6 */
- /* */
- /* <Description> */
- /* A signed 26.6 fixed-point type used for vectorial pixel */
- /* coordinates. */
- /* */
- typedef signed long FT_F26Dot6;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed-point values, like scaling */
- /* values or matrix coefficients. */
- /* */
- typedef signed long FT_Fixed;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Error */
- /* */
- /* <Description> */
- /* The FreeType error code type. A value of~0 is always interpreted */
- /* as a successful operation. */
- /* */
- typedef int FT_Error;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pointer */
- /* */
- /* <Description> */
- /* A simple typedef for a typeless pointer. */
- /* */
- typedef void* FT_Pointer;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Offset */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
- /* _unsigned_ integer type used to express a file size or position, */
- /* or a memory block size. */
- /* */
- typedef size_t FT_Offset;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_PtrDist */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
- /* largest _signed_ integer type used to express the distance */
- /* between two pointers. */
- /* */
- typedef ft_ptrdiff_t FT_PtrDist;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2D vector unit vector. Uses */
- /* FT_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: Horizontal coordinate. */
- /* */
- /* y :: Vertical coordinate. */
- /* */
- typedef struct FT_UnitVector_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* basic_types */
+/* */
+/* <Title> */
+/* Basic Data Types */
+/* */
+/* <Abstract> */
+/* The basic data types defined by the library. */
+/* */
+/* <Description> */
+/* This section contains the basic data types defined by FreeType~2, */
+/* ranging from simple scalar types to bitmap descriptors. More */
+/* font-specific structures are defined in a different section. */
+/* */
+/* <Order> */
+/* FT_Byte */
+/* FT_Bytes */
+/* FT_Char */
+/* FT_Int */
+/* FT_UInt */
+/* FT_Int16 */
+/* FT_UInt16 */
+/* FT_Int32 */
+/* FT_UInt32 */
+/* FT_Short */
+/* FT_UShort */
+/* FT_Long */
+/* FT_ULong */
+/* FT_Bool */
+/* FT_Offset */
+/* FT_PtrDist */
+/* FT_String */
+/* FT_Tag */
+/* FT_Error */
+/* FT_Fixed */
+/* FT_Pointer */
+/* FT_Pos */
+/* FT_Vector */
+/* FT_BBox */
+/* FT_Matrix */
+/* FT_FWord */
+/* FT_UFWord */
+/* FT_F2Dot14 */
+/* FT_UnitVector */
+/* FT_F26Dot6 */
+/* */
+/* */
+/* FT_Generic */
+/* FT_Generic_Finalizer */
+/* */
+/* FT_Bitmap */
+/* FT_Pixel_Mode */
+/* FT_Palette_Mode */
+/* FT_Glyph_Format */
+/* FT_IMAGE_TAG */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Bool */
+/* */
+/* <Description> */
+/* A typedef of unsigned char, used for simple booleans. As usual, */
+/* values 1 and~0 represent true and false, respectively. */
+/* */
+typedef unsigned char FT_Bool;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_FWord */
+/* */
+/* <Description> */
+/* A signed 16-bit integer used to store a distance in original font */
+/* units. */
+/* */
+typedef signed short FT_FWord; /* distance in FUnits */
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_UFWord */
+/* */
+/* <Description> */
+/* An unsigned 16-bit integer used to store a distance in original */
+/* font units. */
+/* */
+typedef unsigned short FT_UFWord; /* unsigned distance */
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Char */
+/* */
+/* <Description> */
+/* A simple typedef for the _signed_ char type. */
+/* */
+typedef signed char FT_Char;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Byte */
+/* */
+/* <Description> */
+/* A simple typedef for the _unsigned_ char type. */
+/* */
+typedef unsigned char FT_Byte;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Bytes */
+/* */
+/* <Description> */
+/* A typedef for constant memory areas. */
+/* */
+typedef const FT_Byte* FT_Bytes;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Tag */
+/* */
+/* <Description> */
+/* A typedef for 32-bit tags (as used in the SFNT format). */
+/* */
+typedef FT_UInt32 FT_Tag;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_String */
+/* */
+/* <Description> */
+/* A simple typedef for the char type, usually used for strings. */
+/* */
+typedef char FT_String;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Short */
+/* */
+/* <Description> */
+/* A typedef for signed short. */
+/* */
+typedef signed short FT_Short;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_UShort */
+/* */
+/* <Description> */
+/* A typedef for unsigned short. */
+/* */
+typedef unsigned short FT_UShort;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Int */
+/* */
+/* <Description> */
+/* A typedef for the int type. */
+/* */
+typedef signed int FT_Int;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_UInt */
+/* */
+/* <Description> */
+/* A typedef for the unsigned int type. */
+/* */
+typedef unsigned int FT_UInt;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Long */
+/* */
+/* <Description> */
+/* A typedef for signed long. */
+/* */
+typedef signed long FT_Long;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_ULong */
+/* */
+/* <Description> */
+/* A typedef for unsigned long. */
+/* */
+typedef unsigned long FT_ULong;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_F2Dot14 */
+/* */
+/* <Description> */
+/* A signed 2.14 fixed-point type used for unit vectors. */
+/* */
+typedef signed short FT_F2Dot14;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_F26Dot6 */
+/* */
+/* <Description> */
+/* A signed 26.6 fixed-point type used for vectorial pixel */
+/* coordinates. */
+/* */
+typedef signed long FT_F26Dot6;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Fixed */
+/* */
+/* <Description> */
+/* This type is used to store 16.16 fixed-point values, like scaling */
+/* values or matrix coefficients. */
+/* */
+typedef signed long FT_Fixed;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Error */
+/* */
+/* <Description> */
+/* The FreeType error code type. A value of~0 is always interpreted */
+/* as a successful operation. */
+/* */
+typedef int FT_Error;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Pointer */
+/* */
+/* <Description> */
+/* A simple typedef for a typeless pointer. */
+/* */
+typedef void* FT_Pointer;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_Offset */
+/* */
+/* <Description> */
+/* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
+/* _unsigned_ integer type used to express a file size or position, */
+/* or a memory block size. */
+/* */
+typedef size_t FT_Offset;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_PtrDist */
+/* */
+/* <Description> */
+/* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
+/* largest _signed_ integer type used to express the distance */
+/* between two pointers. */
+/* */
+typedef ft_ptrdiff_t FT_PtrDist;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_UnitVector */
+/* */
+/* <Description> */
+/* A simple structure used to store a 2D vector unit vector. Uses */
+/* FT_F2Dot14 types. */
+/* */
+/* <Fields> */
+/* x :: Horizontal coordinate. */
+/* */
+/* y :: Vertical coordinate. */
+/* */
+typedef struct FT_UnitVector_ {
FT_F2Dot14 x;
FT_F2Dot14 y;
- } FT_UnitVector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Matrix */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed-point format. The computation performed is: */
- /* */
- /* { */
- /* x' = x*xx + y*xy */
- /* y' = x*yx + y*yy */
- /* } */
- /* */
- /* <Fields> */
- /* xx :: Matrix coefficient. */
- /* */
- /* xy :: Matrix coefficient. */
- /* */
- /* yx :: Matrix coefficient. */
- /* */
- /* yy :: Matrix coefficient. */
- /* */
- typedef struct FT_Matrix_
- {
+} FT_UnitVector;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Matrix */
+/* */
+/* <Description> */
+/* A simple structure used to store a 2x2 matrix. Coefficients are */
+/* in 16.16 fixed-point format. The computation performed is: */
+/* */
+/* { */
+/* x' = x*xx + y*xy */
+/* y' = x*yx + y*yy */
+/* } */
+/* */
+/* <Fields> */
+/* xx :: Matrix coefficient. */
+/* */
+/* xy :: Matrix coefficient. */
+/* */
+/* yx :: Matrix coefficient. */
+/* */
+/* yy :: Matrix coefficient. */
+/* */
+typedef struct FT_Matrix_ {
FT_Fixed xx, xy;
FT_Fixed yx, yy;
- } FT_Matrix;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Data */
- /* */
- /* <Description> */
- /* Read-only binary data represented as a pointer and a length. */
- /* */
- /* <Fields> */
- /* pointer :: The data. */
- /* */
- /* length :: The length of the data in bytes. */
- /* */
- typedef struct FT_Data_
- {
+} FT_Matrix;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Data */
+/* */
+/* <Description> */
+/* Read-only binary data represented as a pointer and a length. */
+/* */
+/* <Fields> */
+/* pointer :: The data. */
+/* */
+/* length :: The length of the data in bytes. */
+/* */
+typedef struct FT_Data_ {
const FT_Byte* pointer;
FT_Int length;
- } FT_Data;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Generic_Finalizer */
- /* */
- /* <Description> */
- /* Describe a function used to destroy the `client' data of any */
- /* FreeType object. See the description of the @FT_Generic type for */
- /* details of usage. */
- /* */
- /* <Input> */
- /* The address of the FreeType object which is under finalization. */
- /* Its client data is accessed through its `generic' field. */
- /* */
- typedef void (*FT_Generic_Finalizer)(void* object);
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Generic */
- /* */
- /* <Description> */
- /* Client applications often need to associate their own data to a */
- /* variety of FreeType core objects. For example, a text layout API */
- /* might want to associate a glyph cache to a given size object. */
- /* */
- /* Some FreeType object contains a `generic' field, of type */
- /* FT_Generic, which usage is left to client applications and font */
- /* servers. */
- /* */
- /* It can be used to store a pointer to client-specific data, as well */
- /* as the address of a `finalizer' function, which will be called by */
- /* FreeType when the object is destroyed (for example, the previous */
- /* client example would put the address of the glyph cache destructor */
- /* in the `finalizer' field). */
- /* */
- /* <Fields> */
- /* data :: A typeless pointer to any client-specified data. This */
- /* field is completely ignored by the FreeType library. */
- /* */
- /* finalizer :: A pointer to a `generic finalizer' function, which */
- /* will be called when the object is destroyed. If this */
- /* field is set to NULL, no code will be called. */
- /* */
- typedef struct FT_Generic_
- {
+} FT_Data;
+
+
+/*************************************************************************/
+/* */
+/* <FuncType> */
+/* FT_Generic_Finalizer */
+/* */
+/* <Description> */
+/* Describe a function used to destroy the `client' data of any */
+/* FreeType object. See the description of the @FT_Generic type for */
+/* details of usage. */
+/* */
+/* <Input> */
+/* The address of the FreeType object which is under finalization. */
+/* Its client data is accessed through its `generic' field. */
+/* */
+typedef void (*FT_Generic_Finalizer)(void* object);
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_Generic */
+/* */
+/* <Description> */
+/* Client applications often need to associate their own data to a */
+/* variety of FreeType core objects. For example, a text layout API */
+/* might want to associate a glyph cache to a given size object. */
+/* */
+/* Some FreeType object contains a `generic' field, of type */
+/* FT_Generic, which usage is left to client applications and font */
+/* servers. */
+/* */
+/* It can be used to store a pointer to client-specific data, as well */
+/* as the address of a `finalizer' function, which will be called by */
+/* FreeType when the object is destroyed (for example, the previous */
+/* client example would put the address of the glyph cache destructor */
+/* in the `finalizer' field). */
+/* */
+/* <Fields> */
+/* data :: A typeless pointer to any client-specified data. This */
+/* field is completely ignored by the FreeType library. */
+/* */
+/* finalizer :: A pointer to a `generic finalizer' function, which */
+/* will be called when the object is destroyed. If this */
+/* field is set to NULL, no code will be called. */
+/* */
+typedef struct FT_Generic_ {
void* data;
FT_Generic_Finalizer finalizer;
- } FT_Generic;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_MAKE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags which are used to label */
- /* TrueType tables into an unsigned long to be used within FreeType. */
- /* */
- /* <Note> */
- /* The produced values *must* be 32-bit integers. Don't redefine */
- /* this macro. */
- /* */
+} FT_Generic;
+
+
+/*************************************************************************/
+/* */
+/* <Macro> */
+/* FT_MAKE_TAG */
+/* */
+/* <Description> */
+/* This macro converts four-letter tags which are used to label */
+/* TrueType tables into an unsigned long to be used within FreeType. */
+/* */
+/* <Note> */
+/* The produced values *must* be 32-bit integers. Don't redefine */
+/* this macro. */
+/* */
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \
@@ -481,103 +477,101 @@ FT_BEGIN_HEADER
(FT_ULong)_x4 )
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* L I S T M A N A G E M E N T */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* list_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ListNode */
- /* */
- /* <Description> */
- /* Many elements and objects in FreeType are listed through an */
- /* @FT_List record (see @FT_ListRec). As its name suggests, an */
- /* FT_ListNode is a handle to a single list element. */
- /* */
- typedef struct FT_ListNodeRec_* FT_ListNode;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_List */
- /* */
- /* <Description> */
- /* A handle to a list record (see @FT_ListRec). */
- /* */
- typedef struct FT_ListRec_* FT_List;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListNodeRec */
- /* */
- /* <Description> */
- /* A structure used to hold a single list element. */
- /* */
- /* <Fields> */
- /* prev :: The previous element in the list. NULL if first. */
- /* */
- /* next :: The next element in the list. NULL if last. */
- /* */
- /* data :: A typeless pointer to the listed object. */
- /* */
- typedef struct FT_ListNodeRec_
- {
+/*************************************************************************/
+/*************************************************************************/
+/* */
+/* L I S T M A N A G E M E N T */
+/* */
+/*************************************************************************/
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Section> */
+/* list_processing */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_ListNode */
+/* */
+/* <Description> */
+/* Many elements and objects in FreeType are listed through an */
+/* @FT_List record (see @FT_ListRec). As its name suggests, an */
+/* FT_ListNode is a handle to a single list element. */
+/* */
+typedef struct FT_ListNodeRec_* FT_ListNode;
+
+
+/*************************************************************************/
+/* */
+/* <Type> */
+/* FT_List */
+/* */
+/* <Description> */
+/* A handle to a list record (see @FT_ListRec). */
+/* */
+typedef struct FT_ListRec_* FT_List;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_ListNodeRec */
+/* */
+/* <Description> */
+/* A structure used to hold a single list element. */
+/* */
+/* <Fields> */
+/* prev :: The previous element in the list. NULL if first. */
+/* */
+/* next :: The next element in the list. NULL if last. */
+/* */
+/* data :: A typeless pointer to the listed object. */
+/* */
+typedef struct FT_ListNodeRec_ {
FT_ListNode prev;
FT_ListNode next;
void* data;
- } FT_ListNodeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListRec */
- /* */
- /* <Description> */
- /* A structure used to hold a simple doubly-linked list. These are */
- /* used in many parts of FreeType. */
- /* */
- /* <Fields> */
- /* head :: The head (first element) of doubly-linked list. */
- /* */
- /* tail :: The tail (last element) of doubly-linked list. */
- /* */
- typedef struct FT_ListRec_
- {
+} FT_ListNodeRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_ListRec */
+/* */
+/* <Description> */
+/* A structure used to hold a simple doubly-linked list. These are */
+/* used in many parts of FreeType. */
+/* */
+/* <Fields> */
+/* head :: The head (first element) of doubly-linked list. */
+/* */
+/* tail :: The tail (last element) of doubly-linked list. */
+/* */
+typedef struct FT_ListRec_ {
FT_ListNode head;
FT_ListNode tail;
- } FT_ListRec;
+} FT_ListRec;
- /* */
+/* */
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
- /* concatenate C tokens */
+/* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
- /* see `ftmoderr.h' for descriptions of the following macros */
+/* see `ftmoderr.h' for descriptions of the following macros */
#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftwinfnt.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftwinfnt.h
index ea33353..22a68d8 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftwinfnt.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftwinfnt.h
@@ -32,124 +32,124 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* winfnt_fonts */
- /* */
- /* <Title> */
- /* Window FNT Files */
- /* */
- /* <Abstract> */
- /* Windows FNT specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Windows FNT specific */
- /* functions. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* winfnt_fonts */
+/* */
+/* <Title> */
+/* Window FNT Files */
+/* */
+/* <Abstract> */
+/* Windows FNT specific API. */
+/* */
+/* <Description> */
+/* This section contains the declaration of Windows FNT specific */
+/* functions. */
+/* */
+/*************************************************************************/
- /*************************************************************************
- *
- * @enum:
- * FT_WinFNT_ID_XXX
- *
- * @description:
- * A list of valid values for the `charset' byte in
- * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
- * encodings (except for cp1361) can be found at ftp://ftp.unicode.org
- * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
- * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
- *
- * @values:
- * FT_WinFNT_ID_DEFAULT ::
- * This is used for font enumeration and font creation as a
- * `don't care' value. Valid font files don't contain this value.
- * When querying for information about the character set of the font
- * that is currently selected into a specified device context, this
- * return value (of the related Windows API) simply denotes failure.
- *
- * FT_WinFNT_ID_SYMBOL ::
- * There is no known mapping table available.
- *
- * FT_WinFNT_ID_MAC ::
- * Mac Roman encoding.
- *
- * FT_WinFNT_ID_OEM ::
- * From Michael Pöttgen <michael@poettgen.de>:
- *
- * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
- * is used for the charset of vector fonts, like `modern.fon',
- * `roman.fon', and `script.fon' on Windows.
- *
- * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
- * specifies a character set that is operating-system dependent.
- *
- * The `IFIMETRICS' documentation from the `Windows Driver
- * Development Kit' says: This font supports an OEM-specific
- * character set. The OEM character set is system dependent.
- *
- * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
- * second default codepage that most international versions of
- * Windows have. It is one of the OEM codepages from
- *
- * http://www.microsoft.com/globaldev/reference/cphome.mspx,
- *
- * and is used for the `DOS boxes', to support legacy applications.
- * A German Windows version for example usually uses ANSI codepage
- * 1252 and OEM codepage 850.
- *
- * FT_WinFNT_ID_CP874 ::
- * A superset of Thai TIS 620 and ISO 8859-11.
- *
- * FT_WinFNT_ID_CP932 ::
- * A superset of Japanese Shift-JIS (with minor deviations).
- *
- * FT_WinFNT_ID_CP936 ::
- * A superset of simplified Chinese GB 2312-1980 (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP949 ::
- * A superset of Korean Hangul KS~C 5601-1987 (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP950 ::
- * A superset of traditional Chinese Big~5 ETen (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP1250 ::
- * A superset of East European ISO 8859-2 (with slightly different
- * ordering).
- *
- * FT_WinFNT_ID_CP1251 ::
- * A superset of Russian ISO 8859-5 (with different ordering).
- *
- * FT_WinFNT_ID_CP1252 ::
- * ANSI encoding. A superset of ISO 8859-1.
- *
- * FT_WinFNT_ID_CP1253 ::
- * A superset of Greek ISO 8859-7 (with minor modifications).
- *
- * FT_WinFNT_ID_CP1254 ::
- * A superset of Turkish ISO 8859-9.
- *
- * FT_WinFNT_ID_CP1255 ::
- * A superset of Hebrew ISO 8859-8 (with some modifications).
- *
- * FT_WinFNT_ID_CP1256 ::
- * A superset of Arabic ISO 8859-6 (with different ordering).
- *
- * FT_WinFNT_ID_CP1257 ::
- * A superset of Baltic ISO 8859-13 (with some deviations).
- *
- * FT_WinFNT_ID_CP1258 ::
- * For Vietnamese. This encoding doesn't cover all necessary
- * characters.
- *
- * FT_WinFNT_ID_CP1361 ::
- * Korean (Johab).
- */
+/*************************************************************************
+ *
+ * @enum:
+ * FT_WinFNT_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `charset' byte in
+ * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
+ * encodings (except for cp1361) can be found at ftp://ftp.unicode.org
+ * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
+ * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
+ *
+ * @values:
+ * FT_WinFNT_ID_DEFAULT ::
+ * This is used for font enumeration and font creation as a
+ * `don't care' value. Valid font files don't contain this value.
+ * When querying for information about the character set of the font
+ * that is currently selected into a specified device context, this
+ * return value (of the related Windows API) simply denotes failure.
+ *
+ * FT_WinFNT_ID_SYMBOL ::
+ * There is no known mapping table available.
+ *
+ * FT_WinFNT_ID_MAC ::
+ * Mac Roman encoding.
+ *
+ * FT_WinFNT_ID_OEM ::
+ * From Michael Pöttgen <michael@poettgen.de>:
+ *
+ * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
+ * is used for the charset of vector fonts, like `modern.fon',
+ * `roman.fon', and `script.fon' on Windows.
+ *
+ * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
+ * specifies a character set that is operating-system dependent.
+ *
+ * The `IFIMETRICS' documentation from the `Windows Driver
+ * Development Kit' says: This font supports an OEM-specific
+ * character set. The OEM character set is system dependent.
+ *
+ * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
+ * second default codepage that most international versions of
+ * Windows have. It is one of the OEM codepages from
+ *
+ * http://www.microsoft.com/globaldev/reference/cphome.mspx,
+ *
+ * and is used for the `DOS boxes', to support legacy applications.
+ * A German Windows version for example usually uses ANSI codepage
+ * 1252 and OEM codepage 850.
+ *
+ * FT_WinFNT_ID_CP874 ::
+ * A superset of Thai TIS 620 and ISO 8859-11.
+ *
+ * FT_WinFNT_ID_CP932 ::
+ * A superset of Japanese Shift-JIS (with minor deviations).
+ *
+ * FT_WinFNT_ID_CP936 ::
+ * A superset of simplified Chinese GB 2312-1980 (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP949 ::
+ * A superset of Korean Hangul KS~C 5601-1987 (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP950 ::
+ * A superset of traditional Chinese Big~5 ETen (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP1250 ::
+ * A superset of East European ISO 8859-2 (with slightly different
+ * ordering).
+ *
+ * FT_WinFNT_ID_CP1251 ::
+ * A superset of Russian ISO 8859-5 (with different ordering).
+ *
+ * FT_WinFNT_ID_CP1252 ::
+ * ANSI encoding. A superset of ISO 8859-1.
+ *
+ * FT_WinFNT_ID_CP1253 ::
+ * A superset of Greek ISO 8859-7 (with minor modifications).
+ *
+ * FT_WinFNT_ID_CP1254 ::
+ * A superset of Turkish ISO 8859-9.
+ *
+ * FT_WinFNT_ID_CP1255 ::
+ * A superset of Hebrew ISO 8859-8 (with some modifications).
+ *
+ * FT_WinFNT_ID_CP1256 ::
+ * A superset of Arabic ISO 8859-6 (with different ordering).
+ *
+ * FT_WinFNT_ID_CP1257 ::
+ * A superset of Baltic ISO 8859-13 (with some deviations).
+ *
+ * FT_WinFNT_ID_CP1258 ::
+ * For Vietnamese. This encoding doesn't cover all necessary
+ * characters.
+ *
+ * FT_WinFNT_ID_CP1361 ::
+ * Korean (Johab).
+ */
#define FT_WinFNT_ID_CP1252 0
#define FT_WinFNT_ID_DEFAULT 1
@@ -172,16 +172,15 @@ FT_BEGIN_HEADER
#define FT_WinFNT_ID_OEM 255
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_WinFNT_HeaderRec */
- /* */
- /* <Description> */
- /* Windows FNT Header info. */
- /* */
- typedef struct FT_WinFNT_HeaderRec_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_WinFNT_HeaderRec */
+/* */
+/* <Description> */
+/* Windows FNT Header info. */
+/* */
+typedef struct FT_WinFNT_HeaderRec_ {
FT_UShort version;
FT_ULong file_size;
FT_Byte copyright[60];
@@ -219,47 +218,47 @@ FT_BEGIN_HEADER
FT_UShort color_table_offset;
FT_ULong reserved1[4];
- } FT_WinFNT_HeaderRec;
+} FT_WinFNT_HeaderRec;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_WinFNT_Header */
- /* */
- /* <Description> */
- /* A handle to an @FT_WinFNT_HeaderRec structure. */
- /* */
- typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* FT_WinFNT_Header */
+/* */
+/* <Description> */
+/* A handle to an @FT_WinFNT_HeaderRec structure. */
+/* */
+typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
- /**********************************************************************
- *
- * @function:
- * FT_Get_WinFNT_Header
- *
- * @description:
- * Retrieve a Windows FNT font info header.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * @output:
- * aheader :: The WinFNT header.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with Windows FNT faces, returning an error
- * otherwise.
- */
- FT_EXPORT( FT_Error )
- FT_Get_WinFNT_Header( FT_Face face,
- FT_WinFNT_HeaderRec *aheader );
+/**********************************************************************
+ *
+ * @function:
+ * FT_Get_WinFNT_Header
+ *
+ * @description:
+ * Retrieve a Windows FNT font info header.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * @output:
+ * aheader :: The WinFNT header.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with Windows FNT faces, returning an error
+ * otherwise.
+ */
+FT_EXPORT( FT_Error )
+FT_Get_WinFNT_Header( FT_Face face,
+ FT_WinFNT_HeaderRec *aheader );
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ftxf86.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ftxf86.h
index 8c68afd..dbebae8 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ftxf86.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ftxf86.h
@@ -32,51 +32,51 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* font_formats */
- /* */
- /* <Title> */
- /* Font Formats */
- /* */
- /* <Abstract> */
- /* Getting the font format. */
- /* */
- /* <Description> */
- /* The single function in this section can be used to get the font */
- /* format. Note that this information is not needed normally; */
- /* however, there are special cases (like in PDF devices) where it is */
- /* important to differentiate, in spite of FreeType's uniform API. */
- /* */
- /* This function is in the X11/xf86 namespace for historical reasons */
- /* and in no way depends on that windowing system. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* <Section> */
+/* font_formats */
+/* */
+/* <Title> */
+/* Font Formats */
+/* */
+/* <Abstract> */
+/* Getting the font format. */
+/* */
+/* <Description> */
+/* The single function in this section can be used to get the font */
+/* format. Note that this information is not needed normally; */
+/* however, there are special cases (like in PDF devices) where it is */
+/* important to differentiate, in spite of FreeType's uniform API. */
+/* */
+/* This function is in the X11/xf86 namespace for historical reasons */
+/* and in no way depends on that windowing system. */
+/* */
+/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_X11_Font_Format */
- /* */
- /* <Description> */
- /* Return a string describing the format of a given face, using values */
- /* which can be used as an X11 FONT_PROPERTY. Possible values are */
- /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
- /* `PFR', and `Windows~FNT'. */
- /* */
- /* <Input> */
- /* face :: */
- /* Input face handle. */
- /* */
- /* <Return> */
- /* Font format string. NULL in case of error. */
- /* */
- FT_EXPORT( const char* )
- FT_Get_X11_Font_Format( FT_Face face );
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_X11_Font_Format */
+/* */
+/* <Description> */
+/* Return a string describing the format of a given face, using values */
+/* which can be used as an X11 FONT_PROPERTY. Possible values are */
+/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
+/* `PFR', and `Windows~FNT'. */
+/* */
+/* <Input> */
+/* face :: */
+/* Input face handle. */
+/* */
+/* <Return> */
+/* Font format string. NULL in case of error. */
+/* */
+FT_EXPORT( const char* )
+FT_Get_X11_Font_Format( FT_Face face );
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/t1tables.h b/thirdparties/common/include/libfreetype/freetype2/freetype/t1tables.h
index a14255e..5a68750 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/t1tables.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/t1tables.h
@@ -34,40 +34,39 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* type1_tables */
- /* */
- /* <Title> */
- /* Type 1 Tables */
- /* */
- /* <Abstract> */
- /* Type~1 (PostScript) specific font tables. */
- /* */
- /* <Description> */
- /* This section contains the definition of Type 1-specific tables, */
- /* including structures related to other PostScript font formats. */
- /* */
- /*************************************************************************/
-
-
- /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
- /* structures in order to support Multiple Master fonts. */
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_FontInfoRec */
- /* */
- /* <Description> */
- /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
- /* Note that for Multiple Master fonts, each instance has its own */
- /* FontInfo dictionary. */
- /* */
- typedef struct PS_FontInfoRec_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* type1_tables */
+/* */
+/* <Title> */
+/* Type 1 Tables */
+/* */
+/* <Abstract> */
+/* Type~1 (PostScript) specific font tables. */
+/* */
+/* <Description> */
+/* This section contains the definition of Type 1-specific tables, */
+/* including structures related to other PostScript font formats. */
+/* */
+/*************************************************************************/
+
+
+/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
+/* structures in order to support Multiple Master fonts. */
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* PS_FontInfoRec */
+/* */
+/* <Description> */
+/* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
+/* Note that for Multiple Master fonts, each instance has its own */
+/* FontInfo dictionary. */
+/* */
+typedef struct PS_FontInfoRec_ {
FT_String* version;
FT_String* notice;
FT_String* full_name;
@@ -78,45 +77,44 @@ FT_BEGIN_HEADER
FT_Short underline_position;
FT_UShort underline_thickness;
- } PS_FontInfoRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_FontInfo */
- /* */
- /* <Description> */
- /* A handle to a @PS_FontInfoRec structure. */
- /* */
- typedef struct PS_FontInfoRec_* PS_FontInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_FontInfo */
- /* */
- /* <Description> */
- /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef PS_FontInfoRec T1_FontInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_PrivateRec */
- /* */
- /* <Description> */
- /* A structure used to model a Type~1 or Type~2 private dictionary. */
- /* Note that for Multiple Master fonts, each instance has its own */
- /* Private dictionary. */
- /* */
- typedef struct PS_PrivateRec_
- {
+} PS_FontInfoRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* PS_FontInfo */
+/* */
+/* <Description> */
+/* A handle to a @PS_FontInfoRec structure. */
+/* */
+typedef struct PS_FontInfoRec_* PS_FontInfo;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* T1_FontInfo */
+/* */
+/* <Description> */
+/* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
+/* kept to maintain source compatibility between various versions of */
+/* FreeType. */
+/* */
+typedef PS_FontInfoRec T1_FontInfo;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* PS_PrivateRec */
+/* */
+/* <Description> */
+/* A structure used to model a Type~1 or Type~2 private dictionary. */
+/* Note that for Multiple Master fonts, each instance has its own */
+/* Private dictionary. */
+/* */
+typedef struct PS_PrivateRec_ {
FT_Int unique_id;
FT_Int lenIV;
@@ -153,45 +151,44 @@ FT_BEGIN_HEADER
FT_Short min_feature[2];
- } PS_PrivateRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_Private */
- /* */
- /* <Description> */
- /* A handle to a @PS_PrivateRec structure. */
- /* */
- typedef struct PS_PrivateRec_* PS_Private;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_Private */
- /* */
- /* <Description> */
- /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef PS_PrivateRec T1_Private;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* T1_Blend_Flags */
- /* */
- /* <Description> */
- /* A set of flags used to indicate which fields are present in a */
- /* given blend dictionary (font info or private). Used to support */
- /* Multiple Masters fonts. */
- /* */
- typedef enum T1_Blend_Flags_
- {
+} PS_PrivateRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* PS_Private */
+/* */
+/* <Description> */
+/* A handle to a @PS_PrivateRec structure. */
+/* */
+typedef struct PS_PrivateRec_* PS_Private;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* T1_Private */
+/* */
+/* <Description> */
+/* This type is equivalent to @PS_PrivateRec. It is deprecated but */
+/* kept to maintain source compatibility between various versions of */
+/* FreeType. */
+/* */
+typedef PS_PrivateRec T1_Private;
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* T1_Blend_Flags */
+/* */
+/* <Description> */
+/* A set of flags used to indicate which fields are present in a */
+/* given blend dictionary (font info or private). Used to support */
+/* Multiple Masters fonts. */
+/* */
+typedef enum T1_Blend_Flags_ {
/*# required fields in a FontInfo blend dictionary */
T1_BLEND_UNDERLINE_POSITION = 0,
T1_BLEND_UNDERLINE_THICKNESS,
@@ -213,12 +210,12 @@ FT_BEGIN_HEADER
/*# never remove */
T1_BLEND_MAX
- } T1_Blend_Flags;
+} T1_Blend_Flags;
- /* */
+/* */
- /*# backwards compatible definitions */
+/*# backwards compatible definitions */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
@@ -236,31 +233,29 @@ FT_BEGIN_HEADER
#define t1_blend_max T1_BLEND_MAX
- /* maximum number of Multiple Masters designs, as defined in the spec */
+/* maximum number of Multiple Masters designs, as defined in the spec */
#define T1_MAX_MM_DESIGNS 16
- /* maximum number of Multiple Masters axes, as defined in the spec */
+/* maximum number of Multiple Masters axes, as defined in the spec */
#define T1_MAX_MM_AXIS 4
- /* maximum number of elements in a design map */
+/* maximum number of elements in a design map */
#define T1_MAX_MM_MAP_POINTS 20
- /* this structure is used to store the BlendDesignMap entry for an axis */
- typedef struct PS_DesignMap_
- {
+/* this structure is used to store the BlendDesignMap entry for an axis */
+typedef struct PS_DesignMap_ {
FT_Byte num_points;
FT_Long* design_points;
FT_Fixed* blend_points;
- } PS_DesignMapRec, *PS_DesignMap;
+} PS_DesignMapRec, *PS_DesignMap;
- /* backwards-compatible definition */
- typedef PS_DesignMapRec T1_DesignMap;
+/* backwards-compatible definition */
+typedef PS_DesignMapRec T1_DesignMap;
- typedef struct PS_BlendRec_
- {
+typedef struct PS_BlendRec_ {
FT_UInt num_designs;
FT_UInt num_axis;
@@ -287,23 +282,22 @@ FT_BEGIN_HEADER
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
FT_UInt num_default_design_vector;
- } PS_BlendRec, *PS_Blend;
+} PS_BlendRec, *PS_Blend;
- /* backwards-compatible definition */
- typedef PS_BlendRec T1_Blend;
+/* backwards-compatible definition */
+typedef PS_BlendRec T1_Blend;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceDictRec */
- /* */
- /* <Description> */
- /* A structure used to represent data in a CID top-level dictionary. */
- /* */
- typedef struct CID_FaceDictRec_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* CID_FaceDictRec */
+/* */
+/* <Description> */
+/* A structure used to represent data in a CID top-level dictionary. */
+/* */
+typedef struct CID_FaceDictRec_ {
PS_PrivateRec private_dict;
FT_UInt len_buildchar;
@@ -320,36 +314,35 @@ FT_BEGIN_HEADER
FT_ULong subrmap_offset;
FT_Int sd_bytes;
- } CID_FaceDictRec;
+} CID_FaceDictRec;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceDict */
- /* */
- /* <Description> */
- /* A handle to a @CID_FaceDictRec structure. */
- /* */
- typedef struct CID_FaceDictRec_* CID_FaceDict;
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* CID_FaceDict */
+/* */
+/* <Description> */
+/* A handle to a @CID_FaceDictRec structure. */
+/* */
+typedef struct CID_FaceDictRec_* CID_FaceDict;
- /* */
+/* */
- /* backwards-compatible definition */
- typedef CID_FaceDictRec CID_FontDict;
+/* backwards-compatible definition */
+typedef CID_FaceDictRec CID_FontDict;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceInfoRec */
- /* */
- /* <Description> */
- /* A structure used to represent CID Face information. */
- /* */
- typedef struct CID_FaceInfoRec_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* CID_FaceInfoRec */
+/* */
+/* <Description> */
+/* A structure used to represent CID Face information. */
+/* */
+typedef struct CID_FaceInfoRec_ {
FT_String* cid_font_name;
FT_Fixed cid_version;
FT_Int cid_font_type;
@@ -375,156 +368,154 @@ FT_BEGIN_HEADER
FT_ULong data_offset;
- } CID_FaceInfoRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceInfo */
- /* */
- /* <Description> */
- /* A handle to a @CID_FaceInfoRec structure. */
- /* */
- typedef struct CID_FaceInfoRec_* CID_FaceInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_Info */
- /* */
- /* <Description> */
- /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef CID_FaceInfoRec CID_Info;
-
-
- /************************************************************************
- *
- * @function:
- * FT_Has_PS_Glyph_Names
- *
- * @description:
- * Return true if a given face provides reliable PostScript glyph
- * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
- * except that certain fonts (mostly TrueType) contain incorrect
- * glyph name tables.
- *
- * When this function returns true, the caller is sure that the glyph
- * names returned by @FT_Get_Glyph_Name are reliable.
- *
- * @input:
- * face ::
- * face handle
- *
- * @return:
- * Boolean. True if glyph names are reliable.
- *
- */
- FT_EXPORT( FT_Int )
- FT_Has_PS_Glyph_Names( FT_Face face );
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Info
- *
- * @description:
- * Retrieve the @PS_FontInfoRec structure corresponding to a given
- * PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * @output:
- * afont_info ::
- * Output font info structure pointer.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The string pointers within the font info structure are owned by
- * the face and don't need to be freed by the caller.
- *
- * If the font's format is not PostScript-based, this function will
- * return the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_PS_Font_Info( FT_Face face,
- PS_FontInfo afont_info );
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Private
- *
- * @description:
- * Retrieve the @PS_PrivateRec structure corresponding to a given
- * PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * @output:
- * afont_private ::
- * Output private dictionary structure pointer.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The string pointers within the @PS_PrivateRec structure are owned by
- * the face and don't need to be freed by the caller.
- *
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_PS_Font_Private( FT_Face face,
- PS_Private afont_private );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* T1_EncodingType */
- /* */
- /* <Description> */
- /* An enumeration describing the `Encoding' entry in a Type 1 */
- /* dictionary. */
- /* */
- typedef enum T1_EncodingType_
- {
+} CID_FaceInfoRec;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* CID_FaceInfo */
+/* */
+/* <Description> */
+/* A handle to a @CID_FaceInfoRec structure. */
+/* */
+typedef struct CID_FaceInfoRec_* CID_FaceInfo;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* CID_Info */
+/* */
+/* <Description> */
+/* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
+/* kept to maintain source compatibility between various versions of */
+/* FreeType. */
+/* */
+typedef CID_FaceInfoRec CID_Info;
+
+
+/************************************************************************
+ *
+ * @function:
+ * FT_Has_PS_Glyph_Names
+ *
+ * @description:
+ * Return true if a given face provides reliable PostScript glyph
+ * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
+ * except that certain fonts (mostly TrueType) contain incorrect
+ * glyph name tables.
+ *
+ * When this function returns true, the caller is sure that the glyph
+ * names returned by @FT_Get_Glyph_Name are reliable.
+ *
+ * @input:
+ * face ::
+ * face handle
+ *
+ * @return:
+ * Boolean. True if glyph names are reliable.
+ *
+ */
+FT_EXPORT( FT_Int )
+FT_Has_PS_Glyph_Names( FT_Face face );
+
+
+/************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Info
+ *
+ * @description:
+ * Retrieve the @PS_FontInfoRec structure corresponding to a given
+ * PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * @output:
+ * afont_info ::
+ * Output font info structure pointer.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The string pointers within the font info structure are owned by
+ * the face and don't need to be freed by the caller.
+ *
+ * If the font's format is not PostScript-based, this function will
+ * return the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+FT_EXPORT( FT_Error )
+FT_Get_PS_Font_Info( FT_Face face,
+ PS_FontInfo afont_info );
+
+
+/************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Private
+ *
+ * @description:
+ * Retrieve the @PS_PrivateRec structure corresponding to a given
+ * PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * @output:
+ * afont_private ::
+ * Output private dictionary structure pointer.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The string pointers within the @PS_PrivateRec structure are owned by
+ * the face and don't need to be freed by the caller.
+ *
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+FT_EXPORT( FT_Error )
+FT_Get_PS_Font_Private( FT_Face face,
+ PS_Private afont_private );
+
+
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* T1_EncodingType */
+/* */
+/* <Description> */
+/* An enumeration describing the `Encoding' entry in a Type 1 */
+/* dictionary. */
+/* */
+typedef enum T1_EncodingType_ {
T1_ENCODING_TYPE_NONE = 0,
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPERT
- } T1_EncodingType;
+} T1_EncodingType;
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* PS_Dict_Keys */
- /* */
- /* <Description> */
- /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
- /* the Type~1 dictionary entry to retrieve. */
- /* */
- typedef enum PS_Dict_Keys_
- {
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* PS_Dict_Keys */
+/* */
+/* <Description> */
+/* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
+/* the Type~1 dictionary entry to retrieve. */
+/* */
+typedef enum PS_Dict_Keys_ {
/* conventionally in the font dictionary */
PS_DICT_FONT_TYPE, /* FT_Byte */
PS_DICT_FONT_MATRIX, /* FT_Fixed */
@@ -579,80 +570,80 @@ FT_BEGIN_HEADER
PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
- } PS_Dict_Keys;
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Value
- *
- * @description:
- * Retrieve the value for the supplied key from a PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * key ::
- * An enumeration value representing the dictionary key to retrieve.
- *
- * idx ::
- * For array values, this specifies the index to be returned.
- *
- * value ::
- * A pointer to memory into which to write the value.
- *
- * valen_len ::
- * The size, in bytes, of the memory supplied for the value.
- *
- * @output:
- * value ::
- * The value matching the above key, if it exists.
- *
- * @return:
- * The amount of memory (in bytes) required to hold the requested
- * value (if it exists, -1 otherwise).
- *
- * @note:
- * The values returned are not pointers into the internal structures of
- * the face, but are `fresh' copies, so that the memory containing them
- * belongs to the calling application. This also enforces the
- * `read-only' nature of these values, i.e., this function cannot be
- * used to manipulate the face.
- *
- * `value' is a void pointer because the values returned can be of
- * various types.
- *
- * If either `value' is NULL or `value_len' is too small, just the
- * required memory size for the requested entry is returned.
- *
- * The `idx' parameter is used, not only to retrieve elements of, for
- * example, the FontMatrix or FontBBox, but also to retrieve name keys
- * from the CharStrings dictionary, and the charstrings themselves. It
- * is ignored for atomic values.
- *
- * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
- * get the value as in the font stream, you need to divide by
- * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
- *
- * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
- * be retrieved. So, for example, PostScript procedures such as NP,
- * ND, and RD are not available. Arbitrary keys are, obviously, not be
- * available either.
- *
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Long )
- FT_Get_PS_Font_Value( FT_Face face,
- PS_Dict_Keys key,
- FT_UInt idx,
- void *value,
- FT_Long value_len );
-
- /* */
+} PS_Dict_Keys;
+
+
+/************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Value
+ *
+ * @description:
+ * Retrieve the value for the supplied key from a PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * key ::
+ * An enumeration value representing the dictionary key to retrieve.
+ *
+ * idx ::
+ * For array values, this specifies the index to be returned.
+ *
+ * value ::
+ * A pointer to memory into which to write the value.
+ *
+ * valen_len ::
+ * The size, in bytes, of the memory supplied for the value.
+ *
+ * @output:
+ * value ::
+ * The value matching the above key, if it exists.
+ *
+ * @return:
+ * The amount of memory (in bytes) required to hold the requested
+ * value (if it exists, -1 otherwise).
+ *
+ * @note:
+ * The values returned are not pointers into the internal structures of
+ * the face, but are `fresh' copies, so that the memory containing them
+ * belongs to the calling application. This also enforces the
+ * `read-only' nature of these values, i.e., this function cannot be
+ * used to manipulate the face.
+ *
+ * `value' is a void pointer because the values returned can be of
+ * various types.
+ *
+ * If either `value' is NULL or `value_len' is too small, just the
+ * required memory size for the requested entry is returned.
+ *
+ * The `idx' parameter is used, not only to retrieve elements of, for
+ * example, the FontMatrix or FontBBox, but also to retrieve name keys
+ * from the CharStrings dictionary, and the charstrings themselves. It
+ * is ignored for atomic values.
+ *
+ * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
+ * get the value as in the font stream, you need to divide by
+ * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
+ *
+ * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
+ * be retrieved. So, for example, PostScript procedures such as NP,
+ * ND, and RD are not available. Arbitrary keys are, obviously, not be
+ * available either.
+ *
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+FT_EXPORT( FT_Long )
+FT_Get_PS_Font_Value( FT_Face face,
+ PS_Dict_Keys key,
+ FT_UInt idx,
+ void *value,
+ FT_Long value_len );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ttnameid.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ttnameid.h
index 173f88c..fb72434 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ttnameid.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ttnameid.h
@@ -26,62 +26,62 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* truetype_tables */
- /* */
-
-
- /*************************************************************************/
- /* */
- /* Possible values for the `platform' identifier code in the name */
- /* records of the TTF `name' table. */
- /* */
- /*************************************************************************/
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_PLATFORM_XXX
- *
- * @description:
- * A list of valid values for the `platform_id' identifier code in
- * @FT_CharMapRec and @FT_SfntName structures.
- *
- * @values:
- * TT_PLATFORM_APPLE_UNICODE ::
- * Used by Apple to indicate a Unicode character map and/or name entry.
- * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
- * that name entries in this format are coded as big-endian UCS-2
- * character codes _only_.
- *
- * TT_PLATFORM_MACINTOSH ::
- * Used by Apple to indicate a MacOS-specific charmap and/or name entry.
- * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
- * most TrueType fonts contain an Apple roman charmap to be usable on
- * MacOS systems (even if they contain a Microsoft charmap as well).
- *
- * TT_PLATFORM_ISO ::
- * This value was used to specify ISO/IEC 10646 charmaps. It is however
- * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
- * `encoding_id' values.
- *
- * TT_PLATFORM_MICROSOFT ::
- * Used by Microsoft to indicate Windows-specific charmaps. See
- * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
- * Note that most fonts contain a Unicode charmap using
- * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
- *
- * TT_PLATFORM_CUSTOM ::
- * Used to indicate application-specific charmaps.
- *
- * TT_PLATFORM_ADOBE ::
- * This value isn't part of any font format specification, but is used
- * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec
- * structure. See @TT_ADOBE_ID_XXX.
- */
+/*************************************************************************/
+/* */
+/* <Section> */
+/* truetype_tables */
+/* */
+
+
+/*************************************************************************/
+/* */
+/* Possible values for the `platform' identifier code in the name */
+/* records of the TTF `name' table. */
+/* */
+/*************************************************************************/
+
+
+/***********************************************************************
+ *
+ * @enum:
+ * TT_PLATFORM_XXX
+ *
+ * @description:
+ * A list of valid values for the `platform_id' identifier code in
+ * @FT_CharMapRec and @FT_SfntName structures.
+ *
+ * @values:
+ * TT_PLATFORM_APPLE_UNICODE ::
+ * Used by Apple to indicate a Unicode character map and/or name entry.
+ * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
+ * that name entries in this format are coded as big-endian UCS-2
+ * character codes _only_.
+ *
+ * TT_PLATFORM_MACINTOSH ::
+ * Used by Apple to indicate a MacOS-specific charmap and/or name entry.
+ * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
+ * most TrueType fonts contain an Apple roman charmap to be usable on
+ * MacOS systems (even if they contain a Microsoft charmap as well).
+ *
+ * TT_PLATFORM_ISO ::
+ * This value was used to specify ISO/IEC 10646 charmaps. It is however
+ * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
+ * `encoding_id' values.
+ *
+ * TT_PLATFORM_MICROSOFT ::
+ * Used by Microsoft to indicate Windows-specific charmaps. See
+ * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
+ * Note that most fonts contain a Unicode charmap using
+ * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
+ *
+ * TT_PLATFORM_CUSTOM ::
+ * Used to indicate application-specific charmaps.
+ *
+ * TT_PLATFORM_ADOBE ::
+ * This value isn't part of any font format specification, but is used
+ * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec
+ * structure. See @TT_ADOBE_ID_XXX.
+ */
#define TT_PLATFORM_APPLE_UNICODE 0
#define TT_PLATFORM_MACINTOSH 1
@@ -91,35 +91,35 @@ FT_BEGIN_HEADER
#define TT_PLATFORM_ADOBE 7 /* artificial */
- /***********************************************************************
- *
- * @enum:
- * TT_APPLE_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
- *
- * @values:
- * TT_APPLE_ID_DEFAULT ::
- * Unicode version 1.0.
- *
- * TT_APPLE_ID_UNICODE_1_1 ::
- * Unicode 1.1; specifies Hangul characters starting at U+34xx.
- *
- * TT_APPLE_ID_ISO_10646 ::
- * Deprecated (identical to preceding).
- *
- * TT_APPLE_ID_UNICODE_2_0 ::
- * Unicode 2.0 and beyond (UTF-16 BMP only).
- *
- * TT_APPLE_ID_UNICODE_32 ::
- * Unicode 3.1 and beyond, using UTF-32.
- *
- * TT_APPLE_ID_VARIANT_SELECTOR ::
- * From Adobe, not Apple. Not a normal cmap. Specifies variations
- * on a real cmap.
- */
+/***********************************************************************
+ *
+ * @enum:
+ * TT_APPLE_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
+ *
+ * @values:
+ * TT_APPLE_ID_DEFAULT ::
+ * Unicode version 1.0.
+ *
+ * TT_APPLE_ID_UNICODE_1_1 ::
+ * Unicode 1.1; specifies Hangul characters starting at U+34xx.
+ *
+ * TT_APPLE_ID_ISO_10646 ::
+ * Deprecated (identical to preceding).
+ *
+ * TT_APPLE_ID_UNICODE_2_0 ::
+ * Unicode 2.0 and beyond (UTF-16 BMP only).
+ *
+ * TT_APPLE_ID_UNICODE_32 ::
+ * Unicode 3.1 and beyond, using UTF-32.
+ *
+ * TT_APPLE_ID_VARIANT_SELECTOR ::
+ * From Adobe, not Apple. Not a normal cmap. Specifies variations
+ * on a real cmap.
+ */
#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
@@ -129,51 +129,51 @@ FT_BEGIN_HEADER
#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
- /***********************************************************************
- *
- * @enum:
- * TT_MAC_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_MACINTOSH charmaps and name entries.
- *
- * @values:
- * TT_MAC_ID_ROMAN ::
- * TT_MAC_ID_JAPANESE ::
- * TT_MAC_ID_TRADITIONAL_CHINESE ::
- * TT_MAC_ID_KOREAN ::
- * TT_MAC_ID_ARABIC ::
- * TT_MAC_ID_HEBREW ::
- * TT_MAC_ID_GREEK ::
- * TT_MAC_ID_RUSSIAN ::
- * TT_MAC_ID_RSYMBOL ::
- * TT_MAC_ID_DEVANAGARI ::
- * TT_MAC_ID_GURMUKHI ::
- * TT_MAC_ID_GUJARATI ::
- * TT_MAC_ID_ORIYA ::
- * TT_MAC_ID_BENGALI ::
- * TT_MAC_ID_TAMIL ::
- * TT_MAC_ID_TELUGU ::
- * TT_MAC_ID_KANNADA ::
- * TT_MAC_ID_MALAYALAM ::
- * TT_MAC_ID_SINHALESE ::
- * TT_MAC_ID_BURMESE ::
- * TT_MAC_ID_KHMER ::
- * TT_MAC_ID_THAI ::
- * TT_MAC_ID_LAOTIAN ::
- * TT_MAC_ID_GEORGIAN ::
- * TT_MAC_ID_ARMENIAN ::
- * TT_MAC_ID_MALDIVIAN ::
- * TT_MAC_ID_SIMPLIFIED_CHINESE ::
- * TT_MAC_ID_TIBETAN ::
- * TT_MAC_ID_MONGOLIAN ::
- * TT_MAC_ID_GEEZ ::
- * TT_MAC_ID_SLAVIC ::
- * TT_MAC_ID_VIETNAMESE ::
- * TT_MAC_ID_SINDHI ::
- * TT_MAC_ID_UNINTERP ::
- */
+/***********************************************************************
+ *
+ * @enum:
+ * TT_MAC_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_MACINTOSH charmaps and name entries.
+ *
+ * @values:
+ * TT_MAC_ID_ROMAN ::
+ * TT_MAC_ID_JAPANESE ::
+ * TT_MAC_ID_TRADITIONAL_CHINESE ::
+ * TT_MAC_ID_KOREAN ::
+ * TT_MAC_ID_ARABIC ::
+ * TT_MAC_ID_HEBREW ::
+ * TT_MAC_ID_GREEK ::
+ * TT_MAC_ID_RUSSIAN ::
+ * TT_MAC_ID_RSYMBOL ::
+ * TT_MAC_ID_DEVANAGARI ::
+ * TT_MAC_ID_GURMUKHI ::
+ * TT_MAC_ID_GUJARATI ::
+ * TT_MAC_ID_ORIYA ::
+ * TT_MAC_ID_BENGALI ::
+ * TT_MAC_ID_TAMIL ::
+ * TT_MAC_ID_TELUGU ::
+ * TT_MAC_ID_KANNADA ::
+ * TT_MAC_ID_MALAYALAM ::
+ * TT_MAC_ID_SINHALESE ::
+ * TT_MAC_ID_BURMESE ::
+ * TT_MAC_ID_KHMER ::
+ * TT_MAC_ID_THAI ::
+ * TT_MAC_ID_LAOTIAN ::
+ * TT_MAC_ID_GEORGIAN ::
+ * TT_MAC_ID_ARMENIAN ::
+ * TT_MAC_ID_MALDIVIAN ::
+ * TT_MAC_ID_SIMPLIFIED_CHINESE ::
+ * TT_MAC_ID_TIBETAN ::
+ * TT_MAC_ID_MONGOLIAN ::
+ * TT_MAC_ID_GEEZ ::
+ * TT_MAC_ID_SLAVIC ::
+ * TT_MAC_ID_VIETNAMESE ::
+ * TT_MAC_ID_SINDHI ::
+ * TT_MAC_ID_UNINTERP ::
+ */
#define TT_MAC_ID_ROMAN 0
#define TT_MAC_ID_JAPANESE 1
@@ -211,70 +211,70 @@ FT_BEGIN_HEADER
#define TT_MAC_ID_UNINTERP 32
- /***********************************************************************
- *
- * @enum:
- * TT_ISO_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_ISO charmaps and name entries.
- *
- * Their use is now deprecated.
- *
- * @values:
- * TT_ISO_ID_7BIT_ASCII ::
- * ASCII.
- * TT_ISO_ID_10646 ::
- * ISO/10646.
- * TT_ISO_ID_8859_1 ::
- * Also known as Latin-1.
- */
+/***********************************************************************
+ *
+ * @enum:
+ * TT_ISO_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_ISO charmaps and name entries.
+ *
+ * Their use is now deprecated.
+ *
+ * @values:
+ * TT_ISO_ID_7BIT_ASCII ::
+ * ASCII.
+ * TT_ISO_ID_10646 ::
+ * ISO/10646.
+ * TT_ISO_ID_8859_1 ::
+ * Also known as Latin-1.
+ */
#define TT_ISO_ID_7BIT_ASCII 0
#define TT_ISO_ID_10646 1
#define TT_ISO_ID_8859_1 2
- /***********************************************************************
- *
- * @enum:
- * TT_MS_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_MICROSOFT charmaps and name entries.
- *
- * @values:
- * TT_MS_ID_SYMBOL_CS ::
- * Corresponds to Microsoft symbol encoding. See
- * @FT_ENCODING_MS_SYMBOL.
- *
- * TT_MS_ID_UNICODE_CS ::
- * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
- * @FT_ENCODING_UNICODE.
- *
- * TT_MS_ID_SJIS ::
- * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
- *
- * TT_MS_ID_GB2312 ::
- * Corresponds to Simplified Chinese as used in Mainland China. See
- * @FT_ENCODING_GB2312.
- *
- * TT_MS_ID_BIG_5 ::
- * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
- * See @FT_ENCODING_BIG5.
- *
- * TT_MS_ID_WANSUNG ::
- * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
- *
- * TT_MS_ID_JOHAB ::
- * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
- *
- * TT_MS_ID_UCS_4 ::
- * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
- * the OpenType specification version 1.4 (mid-2001.)
- */
+/***********************************************************************
+ *
+ * @enum:
+ * TT_MS_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_MICROSOFT charmaps and name entries.
+ *
+ * @values:
+ * TT_MS_ID_SYMBOL_CS ::
+ * Corresponds to Microsoft symbol encoding. See
+ * @FT_ENCODING_MS_SYMBOL.
+ *
+ * TT_MS_ID_UNICODE_CS ::
+ * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
+ * @FT_ENCODING_UNICODE.
+ *
+ * TT_MS_ID_SJIS ::
+ * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
+ *
+ * TT_MS_ID_GB2312 ::
+ * Corresponds to Simplified Chinese as used in Mainland China. See
+ * @FT_ENCODING_GB2312.
+ *
+ * TT_MS_ID_BIG_5 ::
+ * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
+ * See @FT_ENCODING_BIG5.
+ *
+ * TT_MS_ID_WANSUNG ::
+ * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
+ *
+ * TT_MS_ID_JOHAB ::
+ * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
+ *
+ * TT_MS_ID_UCS_4 ::
+ * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
+ * the OpenType specification version 1.4 (mid-2001.)
+ */
#define TT_MS_ID_SYMBOL_CS 0
#define TT_MS_ID_UNICODE_CS 1
@@ -286,25 +286,25 @@ FT_BEGIN_HEADER
#define TT_MS_ID_UCS_4 10
- /***********************************************************************
- *
- * @enum:
- * TT_ADOBE_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
- *
- * @values:
- * TT_ADOBE_ID_STANDARD ::
- * Adobe standard encoding.
- * TT_ADOBE_ID_EXPERT ::
- * Adobe expert encoding.
- * TT_ADOBE_ID_CUSTOM ::
- * Adobe custom encoding.
- * TT_ADOBE_ID_LATIN_1 ::
- * Adobe Latin~1 encoding.
- */
+/***********************************************************************
+ *
+ * @enum:
+ * TT_ADOBE_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
+ *
+ * @values:
+ * TT_ADOBE_ID_STANDARD ::
+ * Adobe standard encoding.
+ * TT_ADOBE_ID_EXPERT ::
+ * Adobe expert encoding.
+ * TT_ADOBE_ID_CUSTOM ::
+ * Adobe custom encoding.
+ * TT_ADOBE_ID_LATIN_1 ::
+ * Adobe Latin~1 encoding.
+ */
#define TT_ADOBE_ID_STANDARD 0
#define TT_ADOBE_ID_EXPERT 1
@@ -312,17 +312,17 @@ FT_BEGIN_HEADER
#define TT_ADOBE_ID_LATIN_1 3
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MACINTOSH. These values are also used as return values */
- /* for function @FT_Get_CMap_Language_ID. */
- /* */
- /* The canonical source for the Apple assigned Language ID's is at */
- /* */
- /* https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html */
- /* */
+/*************************************************************************/
+/* */
+/* Possible values of the language identifier field in the name records */
+/* of the TTF `name' table if the `platform' identifier code is */
+/* TT_PLATFORM_MACINTOSH. These values are also used as return values */
+/* for function @FT_Get_CMap_Language_ID. */
+/* */
+/* The canonical source for the Apple assigned Language ID's is at */
+/* */
+/* https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html */
+/* */
#define TT_MAC_LANGID_ENGLISH 0
#define TT_MAC_LANGID_FRENCH 1
#define TT_MAC_LANGID_GERMAN 2
@@ -442,7 +442,7 @@ FT_BEGIN_HEADER
#endif
- /* The following codes are new as of 2000-03-10 */
+/* The following codes are new as of 2000-03-10 */
#define TT_MAC_LANGID_GALICIAN 140
#define TT_MAC_LANGID_AFRIKAANS 141
#define TT_MAC_LANGID_BRETON 142
@@ -456,16 +456,16 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MICROSOFT. */
- /* */
- /* The canonical source for the MS assigned LCIDs is */
- /* */
- /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
- /* */
+/*************************************************************************/
+/* */
+/* Possible values of the language identifier field in the name records */
+/* of the TTF `name' table if the `platform' identifier code is */
+/* TT_PLATFORM_MICROSOFT. */
+/* */
+/* The canonical source for the MS assigned LCIDs is */
+/* */
+/* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
+/* */
#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
@@ -512,7 +512,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
#define TT_MS_LANGID_GREEK_GREECE 0x0408
- /* don't ask what this one means... It is commented out currently. */
+/* don't ask what this one means... It is commented out currently. */
#if 0
#define TT_MS_LANGID_GREEK_GREECE2 0x2008
#endif
@@ -557,8 +557,8 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a
- /* The following ID blatantly violate MS specs by using a */
- /* sublanguage > 0x1F. */
+/* The following ID blatantly violate MS specs by using a */
+/* sublanguage > 0x1F. */
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
@@ -570,7 +570,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c
#define TT_MS_LANGID_FRENCH_REUNION 0x200c
#define TT_MS_LANGID_FRENCH_CONGO 0x240c
- /* which was formerly: */
+/* which was formerly: */
#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c
@@ -578,7 +578,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_FRENCH_MALI 0x340c
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c
#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c
- /* and another violation of the spec (see 0xE40aU) */
+/* and another violation of the spec (see 0xE40aU) */
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
@@ -609,8 +609,8 @@ FT_BEGIN_HEADER
#else /* current sources say */
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a
- /* and XPsp2 Platform SDK added (2004-07-26) */
- /* Names are shortened to be significant within 40 chars. */
+/* and XPsp2 Platform SDK added (2004-07-26) */
+/* Names are shortened to be significant within 40 chars. */
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a
#endif
@@ -651,7 +651,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
#define TT_MS_LANGID_HINDI_INDIA 0x0439
#define TT_MS_LANGID_MALTESE_MALTA 0x043a
- /* Added by XPsp2 Platform SDK (2004-07-26) */
+/* Added by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b
@@ -661,7 +661,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b
- /* ... and we also keep our old identifier... */
+/* ... and we also keep our old identifier... */
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
#if 0 /* this seems to be a previous inversion */
@@ -677,7 +677,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
- /* alias declared in Windows 2000 */
+/* alias declared in Windows 2000 */
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
@@ -702,23 +702,23 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
- /* Don't use the next constant! It has */
- /* (1) the wrong spelling (Dzonghka) */
- /* (2) Microsoft doesn't officially define it -- */
- /* at least it is not in the List of Local */
- /* ID Values. */
- /* (3) Dzongkha is not the same language as */
- /* Tibetan, so merging it is wrong anyway. */
- /* */
- /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
+/* Don't use the next constant! It has */
+/* (1) the wrong spelling (Dzonghka) */
+/* (2) Microsoft doesn't officially define it -- */
+/* at least it is not in the List of Local */
+/* ID Values. */
+/* (3) Dzongkha is not the same language as */
+/* Tibetan, so merging it is wrong anyway. */
+/* */
+/* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
#if 0
- /* the following used to be defined */
+/* the following used to be defined */
#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
- /* ... but it was changed; */
+/* ... but it was changed; */
#else
- /* So we will continue to #define it, but with the correct value */
+/* So we will continue to #define it, but with the correct value */
#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
#endif
@@ -731,7 +731,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
- /* Missing a LCID for Sindhi in Devanagari script */
+/* Missing a LCID for Sindhi in Devanagari script */
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a
#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b
#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c
@@ -739,12 +739,12 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f
- /* Missing a LCID for Tifinagh script */
+/* Missing a LCID for Tifinagh script */
#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
- /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
- /* script is yet unclear... might be Arabic, Nagari or Sharada */
+/* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
+/* script is yet unclear... might be Arabic, Nagari or Sharada */
#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
- /* ... and aliased (by MS) for compatibility reasons. */
+/* ... and aliased (by MS) for compatibility reasons. */
#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
#define TT_MS_LANGID_NEPALI_INDIA 0x0861
@@ -752,7 +752,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
- /* alias declared in Windows 2000 */
+/* alias declared in Windows 2000 */
#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
#define TT_MS_LANGID_EDO_NIGERIA 0x0466
#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
@@ -763,27 +763,27 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b
#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b
#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c
- /* Also spelled by XPsp2 Platform SDK (2004-07-26) */
+/* Also spelled by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
- /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
+/* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
- /* also spelled in the `Passport SDK' list as: */
+/* also spelled in the `Passport SDK' list as: */
#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
#define TT_MS_LANGID_LATIN 0x0476
#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
- /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
- /* not written (but OTOH the peculiar writing system is worth */
- /* studying). */
+/* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
+/* not written (but OTOH the peculiar writing system is worth */
+/* studying). */
#define TT_MS_LANGID_YI_CHINA 0x0478
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
- /* language codes from 0x047a to 0x047f are (still) unknown. */
+/* language codes from 0x047a to 0x047f are (still) unknown. */
#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
@@ -792,11 +792,11 @@ FT_BEGIN_HEADER
#endif
- /*************************************************************************/
- /* */
- /* Possible values of the `name' identifier field in the name records of */
- /* the TTF `name' table. These values are platform independent. */
- /* */
+/*************************************************************************/
+/* */
+/* Possible values of the `name' identifier field in the name records of */
+/* the TTF `name' table. These values are platform independent. */
+/* */
#define TT_NAME_ID_COPYRIGHT 0
#define TT_NAME_ID_FONT_FAMILY 1
#define TT_NAME_ID_FONT_SUBFAMILY 2
@@ -806,7 +806,7 @@ FT_BEGIN_HEADER
#define TT_NAME_ID_PS_NAME 6
#define TT_NAME_ID_TRADEMARK 7
- /* the following values are from the OpenType spec */
+/* the following values are from the OpenType spec */
#define TT_NAME_ID_MANUFACTURER 8
#define TT_NAME_ID_DESIGNER 9
#define TT_NAME_ID_DESCRIPTION 10
@@ -814,388 +814,388 @@ FT_BEGIN_HEADER
#define TT_NAME_ID_DESIGNER_URL 12
#define TT_NAME_ID_LICENSE 13
#define TT_NAME_ID_LICENSE_URL 14
- /* number 15 is reserved */
+/* number 15 is reserved */
#define TT_NAME_ID_PREFERRED_FAMILY 16
#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
#define TT_NAME_ID_MAC_FULL_NAME 18
- /* The following code is new as of 2000-01-21 */
+/* The following code is new as of 2000-01-21 */
#define TT_NAME_ID_SAMPLE_TEXT 19
- /* This is new in OpenType 1.3 */
+/* This is new in OpenType 1.3 */
#define TT_NAME_ID_CID_FINDFONT_NAME 20
- /* This is new in OpenType 1.5 */
+/* This is new in OpenType 1.5 */
#define TT_NAME_ID_WWS_FAMILY 21
#define TT_NAME_ID_WWS_SUBFAMILY 22
- /*************************************************************************/
- /* */
- /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
- /* */
- /* Updated 08-Nov-2008. */
- /* */
+/*************************************************************************/
+/* */
+/* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
+/* */
+/* Updated 08-Nov-2008. */
+/* */
- /* Bit 0 Basic Latin */
+/* Bit 0 Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
- /* Bit 1 C1 Controls and Latin-1 Supplement */
+/* Bit 1 C1 Controls and Latin-1 Supplement */
#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
- /* Bit 2 Latin Extended-A */
+/* Bit 2 Latin Extended-A */
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
- /* Bit 3 Latin Extended-B */
+/* Bit 3 Latin Extended-B */
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
- /* Bit 4 IPA Extensions */
- /* Phonetic Extensions */
- /* Phonetic Extensions Supplement */
+/* Bit 4 IPA Extensions */
+/* Phonetic Extensions */
+/* Phonetic Extensions Supplement */
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
- /* U+1D00-U+1D7F */
- /* U+1D80-U+1DBF */
- /* Bit 5 Spacing Modifier Letters */
- /* Modifier Tone Letters */
+/* U+1D00-U+1D7F */
+/* U+1D80-U+1DBF */
+/* Bit 5 Spacing Modifier Letters */
+/* Modifier Tone Letters */
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
- /* U+A700-U+A71F */
- /* Bit 6 Combining Diacritical Marks */
- /* Combining Diacritical Marks Supplement */
+/* U+A700-U+A71F */
+/* Bit 6 Combining Diacritical Marks */
+/* Combining Diacritical Marks Supplement */
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
- /* U+1DC0-U+1DFF */
- /* Bit 7 Greek and Coptic */
+/* U+1DC0-U+1DFF */
+/* Bit 7 Greek and Coptic */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
- /* Bit 8 Coptic */
+/* Bit 8 Coptic */
#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
- /* Bit 9 Cyrillic */
- /* Cyrillic Supplement */
- /* Cyrillic Extended-A */
- /* Cyrillic Extended-B */
+/* Bit 9 Cyrillic */
+/* Cyrillic Supplement */
+/* Cyrillic Extended-A */
+/* Cyrillic Extended-B */
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
- /* U+0500-U+052F */
- /* U+2DE0-U+2DFF */
- /* U+A640-U+A69F */
- /* Bit 10 Armenian */
+/* U+0500-U+052F */
+/* U+2DE0-U+2DFF */
+/* U+A640-U+A69F */
+/* Bit 10 Armenian */
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
- /* Bit 11 Hebrew */
+/* Bit 11 Hebrew */
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
- /* Bit 12 Vai */
+/* Bit 12 Vai */
#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
- /* Bit 13 Arabic */
- /* Arabic Supplement */
+/* Bit 13 Arabic */
+/* Arabic Supplement */
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
- /* U+0750-U+077F */
- /* Bit 14 NKo */
+/* U+0750-U+077F */
+/* Bit 14 NKo */
#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
- /* Bit 15 Devanagari */
+/* Bit 15 Devanagari */
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
- /* Bit 16 Bengali */
+/* Bit 16 Bengali */
#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
- /* Bit 17 Gurmukhi */
+/* Bit 17 Gurmukhi */
#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
- /* Bit 18 Gujarati */
+/* Bit 18 Gujarati */
#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
- /* Bit 19 Oriya */
+/* Bit 19 Oriya */
#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
- /* Bit 20 Tamil */
+/* Bit 20 Tamil */
#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
- /* Bit 21 Telugu */
+/* Bit 21 Telugu */
#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
- /* Bit 22 Kannada */
+/* Bit 22 Kannada */
#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
- /* Bit 23 Malayalam */
+/* Bit 23 Malayalam */
#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
- /* Bit 24 Thai */
+/* Bit 24 Thai */
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
- /* Bit 25 Lao */
+/* Bit 25 Lao */
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
- /* Bit 26 Georgian */
- /* Georgian Supplement */
+/* Bit 26 Georgian */
+/* Georgian Supplement */
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
- /* U+2D00-U+2D2F */
- /* Bit 27 Balinese */
+/* U+2D00-U+2D2F */
+/* Bit 27 Balinese */
#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
- /* Bit 28 Hangul Jamo */
+/* Bit 28 Hangul Jamo */
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
- /* Bit 29 Latin Extended Additional */
- /* Latin Extended-C */
- /* Latin Extended-D */
+/* Bit 29 Latin Extended Additional */
+/* Latin Extended-C */
+/* Latin Extended-D */
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
- /* U+2C60-U+2C7F */
- /* U+A720-U+A7FF */
- /* Bit 30 Greek Extended */
+/* U+2C60-U+2C7F */
+/* U+A720-U+A7FF */
+/* Bit 30 Greek Extended */
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
- /* Bit 31 General Punctuation */
- /* Supplemental Punctuation */
+/* Bit 31 General Punctuation */
+/* Supplemental Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
- /* U+2E00-U+2E7F */
- /* Bit 32 Superscripts And Subscripts */
+/* U+2E00-U+2E7F */
+/* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
- /* Bit 33 Currency Symbols */
+/* Bit 33 Currency Symbols */
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
- /* Bit 34 Combining Diacritical Marks For Symbols */
+/* Bit 34 Combining Diacritical Marks For Symbols */
#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
- /* Bit 35 Letterlike Symbols */
+/* Bit 35 Letterlike Symbols */
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
- /* Bit 36 Number Forms */
+/* Bit 36 Number Forms */
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
- /* Bit 37 Arrows */
- /* Supplemental Arrows-A */
- /* Supplemental Arrows-B */
- /* Miscellaneous Symbols and Arrows */
+/* Bit 37 Arrows */
+/* Supplemental Arrows-A */
+/* Supplemental Arrows-B */
+/* Miscellaneous Symbols and Arrows */
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
- /* U+27F0-U+27FF */
- /* U+2900-U+297F */
- /* U+2B00-U+2BFF */
- /* Bit 38 Mathematical Operators */
- /* Supplemental Mathematical Operators */
- /* Miscellaneous Mathematical Symbols-A */
- /* Miscellaneous Mathematical Symbols-B */
+/* U+27F0-U+27FF */
+/* U+2900-U+297F */
+/* U+2B00-U+2BFF */
+/* Bit 38 Mathematical Operators */
+/* Supplemental Mathematical Operators */
+/* Miscellaneous Mathematical Symbols-A */
+/* Miscellaneous Mathematical Symbols-B */
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
- /* U+2A00-U+2AFF */
- /* U+27C0-U+27EF */
- /* U+2980-U+29FF */
- /* Bit 39 Miscellaneous Technical */
+/* U+2A00-U+2AFF */
+/* U+27C0-U+27EF */
+/* U+2980-U+29FF */
+/* Bit 39 Miscellaneous Technical */
#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
- /* Bit 40 Control Pictures */
+/* Bit 40 Control Pictures */
#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
- /* Bit 41 Optical Character Recognition */
+/* Bit 41 Optical Character Recognition */
#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
- /* Bit 42 Enclosed Alphanumerics */
+/* Bit 42 Enclosed Alphanumerics */
#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
- /* Bit 43 Box Drawing */
+/* Bit 43 Box Drawing */
#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
- /* Bit 44 Block Elements */
+/* Bit 44 Block Elements */
#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
- /* Bit 45 Geometric Shapes */
+/* Bit 45 Geometric Shapes */
#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
- /* Bit 46 Miscellaneous Symbols */
+/* Bit 46 Miscellaneous Symbols */
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
- /* Bit 47 Dingbats */
+/* Bit 47 Dingbats */
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
- /* Bit 48 CJK Symbols and Punctuation */
+/* Bit 48 CJK Symbols and Punctuation */
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
- /* Bit 49 Hiragana */
+/* Bit 49 Hiragana */
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
- /* Bit 50 Katakana */
- /* Katakana Phonetic Extensions */
+/* Bit 50 Katakana */
+/* Katakana Phonetic Extensions */
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
- /* U+31F0-U+31FF */
- /* Bit 51 Bopomofo */
- /* Bopomofo Extended */
+/* U+31F0-U+31FF */
+/* Bit 51 Bopomofo */
+/* Bopomofo Extended */
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
- /* U+31A0-U+31BF */
- /* Bit 52 Hangul Compatibility Jamo */
+/* U+31A0-U+31BF */
+/* Bit 52 Hangul Compatibility Jamo */
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
- /* Bit 53 Phags-Pa */
+/* Bit 53 Phags-Pa */
#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
#define TT_UCR_PHAGSPA
- /* Bit 54 Enclosed CJK Letters and Months */
+/* Bit 54 Enclosed CJK Letters and Months */
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
- /* Bit 55 CJK Compatibility */
+/* Bit 55 CJK Compatibility */
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
- /* Bit 56 Hangul Syllables */
+/* Bit 56 Hangul Syllables */
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
- /* Bit 57 High Surrogates */
- /* High Private Use Surrogates */
- /* Low Surrogates */
- /* */
- /* According to OpenType specs v.1.3+, */
- /* setting bit 57 implies that there is */
- /* at least one codepoint beyond the */
- /* Basic Multilingual Plane that is */
- /* supported by this font. So it really */
- /* means >= U+10000 */
+/* Bit 57 High Surrogates */
+/* High Private Use Surrogates */
+/* Low Surrogates */
+/* */
+/* According to OpenType specs v.1.3+, */
+/* setting bit 57 implies that there is */
+/* at least one codepoint beyond the */
+/* Basic Multilingual Plane that is */
+/* supported by this font. So it really */
+/* means >= U+10000 */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
- /* U+DB80-U+DBFF */
- /* U+DC00-U+DFFF */
+/* U+DB80-U+DBFF */
+/* U+DC00-U+DFFF */
#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
- /* Bit 58 Phoenician */
+/* Bit 58 Phoenician */
#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
- /* Bit 59 CJK Unified Ideographs */
- /* CJK Radicals Supplement */
- /* Kangxi Radicals */
- /* Ideographic Description Characters */
- /* CJK Unified Ideographs Extension A */
- /* CJK Unified Ideographs Extension B */
- /* Kanbun */
+/* Bit 59 CJK Unified Ideographs */
+/* CJK Radicals Supplement */
+/* Kangxi Radicals */
+/* Ideographic Description Characters */
+/* CJK Unified Ideographs Extension A */
+/* CJK Unified Ideographs Extension B */
+/* Kanbun */
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
- /* U+2E80-U+2EFF */
- /* U+2F00-U+2FDF */
- /* U+2FF0-U+2FFF */
- /* U+3400-U+4DB5 */
- /*U+20000-U+2A6DF*/
- /* U+3190-U+319F */
- /* Bit 60 Private Use */
+/* U+2E80-U+2EFF */
+/* U+2F00-U+2FDF */
+/* U+2FF0-U+2FFF */
+/* U+3400-U+4DB5 */
+/*U+20000-U+2A6DF*/
+/* U+3190-U+319F */
+/* Bit 60 Private Use */
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
- /* Bit 61 CJK Strokes */
- /* CJK Compatibility Ideographs */
- /* CJK Compatibility Ideographs Supplement */
+/* Bit 61 CJK Strokes */
+/* CJK Compatibility Ideographs */
+/* CJK Compatibility Ideographs Supplement */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
- /* U+F900-U+FAFF */
- /*U+2F800-U+2FA1F*/
- /* Bit 62 Alphabetic Presentation Forms */
+/* U+F900-U+FAFF */
+/*U+2F800-U+2FA1F*/
+/* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
- /* Bit 63 Arabic Presentation Forms-A */
+/* Bit 63 Arabic Presentation Forms-A */
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
- /* Bit 64 Combining Half Marks */
+/* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
- /* Bit 65 Vertical forms */
- /* CJK Compatibility Forms */
+/* Bit 65 Vertical forms */
+/* CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
- /* U+FE30-U+FE4F */
- /* Bit 66 Small Form Variants */
+/* U+FE30-U+FE4F */
+/* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
- /* Bit 67 Arabic Presentation Forms-B */
+/* Bit 67 Arabic Presentation Forms-B */
#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
- /* Bit 68 Halfwidth and Fullwidth Forms */
+/* Bit 68 Halfwidth and Fullwidth Forms */
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
- /* Bit 69 Specials */
+/* Bit 69 Specials */
#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
- /* Bit 70 Tibetan */
+/* Bit 70 Tibetan */
#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
- /* Bit 71 Syriac */
+/* Bit 71 Syriac */
#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
- /* Bit 72 Thaana */
+/* Bit 72 Thaana */
#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
- /* Bit 73 Sinhala */
+/* Bit 73 Sinhala */
#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
- /* Bit 74 Myanmar */
+/* Bit 74 Myanmar */
#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
- /* Bit 75 Ethiopic */
- /* Ethiopic Supplement */
- /* Ethiopic Extended */
+/* Bit 75 Ethiopic */
+/* Ethiopic Supplement */
+/* Ethiopic Extended */
#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
- /* U+1380-U+139F */
- /* U+2D80-U+2DDF */
- /* Bit 76 Cherokee */
+/* U+1380-U+139F */
+/* U+2D80-U+2DDF */
+/* Bit 76 Cherokee */
#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
- /* Bit 77 Unified Canadian Aboriginal Syllabics */
+/* Bit 77 Unified Canadian Aboriginal Syllabics */
#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
- /* Bit 78 Ogham */
+/* Bit 78 Ogham */
#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
- /* Bit 79 Runic */
+/* Bit 79 Runic */
#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
- /* Bit 80 Khmer */
- /* Khmer Symbols */
+/* Bit 80 Khmer */
+/* Khmer Symbols */
#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
- /* U+19E0-U+19FF */
- /* Bit 81 Mongolian */
+/* U+19E0-U+19FF */
+/* Bit 81 Mongolian */
#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
- /* Bit 82 Braille Patterns */
+/* Bit 82 Braille Patterns */
#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
- /* Bit 83 Yi Syllables */
- /* Yi Radicals */
+/* Bit 83 Yi Syllables */
+/* Yi Radicals */
#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
- /* U+A490-U+A4CF */
- /* Bit 84 Tagalog */
- /* Hanunoo */
- /* Buhid */
- /* Tagbanwa */
+/* U+A490-U+A4CF */
+/* Bit 84 Tagalog */
+/* Hanunoo */
+/* Buhid */
+/* Tagbanwa */
#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
- /* U+1720-U+173F */
- /* U+1740-U+175F */
- /* U+1760-U+177F */
- /* Bit 85 Old Italic */
+/* U+1720-U+173F */
+/* U+1740-U+175F */
+/* U+1760-U+177F */
+/* Bit 85 Old Italic */
#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
- /* Bit 86 Gothic */
+/* Bit 86 Gothic */
#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
- /* Bit 87 Deseret */
+/* Bit 87 Deseret */
#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
- /* Bit 88 Byzantine Musical Symbols */
- /* Musical Symbols */
- /* Ancient Greek Musical Notation */
+/* Bit 88 Byzantine Musical Symbols */
+/* Musical Symbols */
+/* Ancient Greek Musical Notation */
#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
- /*U+1D100-U+1D1FF*/
- /*U+1D200-U+1D24F*/
- /* Bit 89 Mathematical Alphanumeric Symbols */
+/*U+1D100-U+1D1FF*/
+/*U+1D200-U+1D24F*/
+/* Bit 89 Mathematical Alphanumeric Symbols */
#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
- /* Bit 90 Private Use (plane 15) */
- /* Private Use (plane 16) */
+/* Bit 90 Private Use (plane 15) */
+/* Private Use (plane 16) */
#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
- /*U+100000-U+10FFFD*/
- /* Bit 91 Variation Selectors */
- /* Variation Selectors Supplement */
+/*U+100000-U+10FFFD*/
+/* Bit 91 Variation Selectors */
+/* Variation Selectors Supplement */
#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
- /*U+E0100-U+E01EF*/
- /* Bit 92 Tags */
+/*U+E0100-U+E01EF*/
+/* Bit 92 Tags */
#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
- /* Bit 93 Limbu */
+/* Bit 93 Limbu */
#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
- /* Bit 94 Tai Le */
+/* Bit 94 Tai Le */
#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
- /* Bit 95 New Tai Lue */
+/* Bit 95 New Tai Lue */
#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
- /* Bit 96 Buginese */
+/* Bit 96 Buginese */
#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
- /* Bit 97 Glagolitic */
+/* Bit 97 Glagolitic */
#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
- /* Bit 98 Tifinagh */
+/* Bit 98 Tifinagh */
#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
- /* Bit 99 Yijing Hexagram Symbols */
+/* Bit 99 Yijing Hexagram Symbols */
#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
- /* Bit 100 Syloti Nagri */
+/* Bit 100 Syloti Nagri */
#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
- /* Bit 101 Linear B Syllabary */
- /* Linear B Ideograms */
- /* Aegean Numbers */
+/* Bit 101 Linear B Syllabary */
+/* Linear B Ideograms */
+/* Aegean Numbers */
#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
- /*U+10080-U+100FF*/
- /*U+10100-U+1013F*/
- /* Bit 102 Ancient Greek Numbers */
+/*U+10080-U+100FF*/
+/*U+10100-U+1013F*/
+/* Bit 102 Ancient Greek Numbers */
#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
- /* Bit 103 Ugaritic */
+/* Bit 103 Ugaritic */
#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
- /* Bit 104 Old Persian */
+/* Bit 104 Old Persian */
#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
- /* Bit 105 Shavian */
+/* Bit 105 Shavian */
#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
- /* Bit 106 Osmanya */
+/* Bit 106 Osmanya */
#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
- /* Bit 107 Cypriot Syllabary */
+/* Bit 107 Cypriot Syllabary */
#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
- /* Bit 108 Kharoshthi */
+/* Bit 108 Kharoshthi */
#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
- /* Bit 109 Tai Xuan Jing Symbols */
+/* Bit 109 Tai Xuan Jing Symbols */
#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
- /* Bit 110 Cuneiform */
- /* Cuneiform Numbers and Punctuation */
+/* Bit 110 Cuneiform */
+/* Cuneiform Numbers and Punctuation */
#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
- /*U+12400-U+1247F*/
- /* Bit 111 Counting Rod Numerals */
+/*U+12400-U+1247F*/
+/* Bit 111 Counting Rod Numerals */
#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
- /* Bit 112 Sundanese */
+/* Bit 112 Sundanese */
#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
- /* Bit 113 Lepcha */
+/* Bit 113 Lepcha */
#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
- /* Bit 114 Ol Chiki */
+/* Bit 114 Ol Chiki */
#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
- /* Bit 115 Saurashtra */
+/* Bit 115 Saurashtra */
#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
- /* Bit 116 Kayah Li */
+/* Bit 116 Kayah Li */
#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
- /* Bit 117 Rejang */
+/* Bit 117 Rejang */
#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
- /* Bit 118 Cham */
+/* Bit 118 Cham */
#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
- /* Bit 119 Ancient Symbols */
+/* Bit 119 Ancient Symbols */
#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
- /* Bit 120 Phaistos Disc */
+/* Bit 120 Phaistos Disc */
#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
- /* Bit 121 Carian */
- /* Lycian */
- /* Lydian */
+/* Bit 121 Carian */
+/* Lycian */
+/* Lydian */
#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
- /*U+10280-U+1029F*/
- /*U+10920-U+1093F*/
- /* Bit 122 Domino Tiles */
- /* Mahjong Tiles */
+/*U+10280-U+1029F*/
+/*U+10920-U+1093F*/
+/* Bit 122 Domino Tiles */
+/* Mahjong Tiles */
#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
- /*U+1F000-U+1F02F*/
- /* Bit 123-127 Reserved for process-internal usage */
+/*U+1F000-U+1F02F*/
+/* Bit 123-127 Reserved for process-internal usage */
- /*************************************************************************/
- /* */
- /* Some compilers have a very limited length of identifiers. */
- /* */
+/*************************************************************************/
+/* */
+/* Some compilers have a very limited length of identifiers. */
+/* */
#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
#define HAVE_LIMIT_ON_IDENTS
#endif
@@ -1204,17 +1204,17 @@ FT_BEGIN_HEADER
#ifndef HAVE_LIMIT_ON_IDENTS
- /*************************************************************************/
- /* */
- /* Here some alias #defines in order to be clearer. */
- /* */
- /* These are not always #defined to stay within the 31~character limit */
- /* which some compilers have. */
- /* */
- /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
- /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
- /* If you get a warning with such a compiler, use the -i40 switch. */
- /* */
+/*************************************************************************/
+/* */
+/* Here some alias #defines in order to be clearer. */
+/* */
+/* These are not always #defined to stay within the 31~character limit */
+/* which some compilers have. */
+/* */
+/* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
+/* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
+/* If you get a warning with such a compiler, use the -i40 switch. */
+/* */
#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
TT_UCR_ARABIC_PRESENTATIONS_A
#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/tttables.h b/thirdparties/common/include/libfreetype/freetype2/freetype/tttables.h
index fe07117..3bdfc45 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/tttables.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/tttables.h
@@ -33,35 +33,34 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* truetype_tables */
- /* */
- /* <Title> */
- /* TrueType Tables */
- /* */
- /* <Abstract> */
- /* TrueType specific table types and functions. */
- /* */
- /* <Description> */
- /* This section contains the definition of TrueType-specific tables */
- /* as well as some routines used to access and process them. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Header */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType font header table. All */
- /* fields follow the TrueType specification. */
- /* */
- typedef struct TT_Header_
- {
+/*************************************************************************/
+/* */
+/* <Section> */
+/* truetype_tables */
+/* */
+/* <Title> */
+/* TrueType Tables */
+/* */
+/* <Abstract> */
+/* TrueType specific table types and functions. */
+/* */
+/* <Description> */
+/* This section contains the definition of TrueType-specific tables */
+/* as well as some routines used to access and process them. */
+/* */
+/*************************************************************************/
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_Header */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType font header table. All */
+/* fields follow the TrueType specification. */
+/* */
+typedef struct TT_Header_ {
FT_Fixed Table_Version;
FT_Fixed Font_Revision;
@@ -86,99 +85,98 @@ FT_BEGIN_HEADER
FT_Short Index_To_Loc_Format;
FT_Short Glyph_Data_Format;
- } TT_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HoriHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType horizontal header, the `hhea' */
- /* table, as well as the corresponding horizontal metrics table, */
- /* i.e., the `hmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of all */
- /* glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoAscender' field */
- /* of the OS/2 table instead if you want */
- /* the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the distance */
- /* from the baseline to the bottom-most of */
- /* all glyph points found in the font. It */
- /* is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Width_Max :: This field is the maximum of all advance */
- /* widths found in the font. It can be */
- /* used to compute the maximum width of an */
- /* arbitrary string of text. */
- /* */
- /* min_Left_Side_Bearing :: The minimum left side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Right_Side_Bearing :: The minimum right side bearing of all */
- /* glyphs within the font. */
- /* */
- /* xMax_Extent :: The maximum horizontal extent (i.e., the */
- /* `width' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* Reserved :: 8~reserved bytes. */
- /* */
- /* metric_Data_Format :: Always~0. */
- /* */
- /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
- /* table -- this value can be smaller than */
- /* the total number of glyphs in the font. */
- /* */
- /* long_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields which */
- /* are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_HoriHeader_
- {
+} TT_Header;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_HoriHeader */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType horizontal header, the `hhea' */
+/* table, as well as the corresponding horizontal metrics table, */
+/* i.e., the `hmtx' table. */
+/* */
+/* <Fields> */
+/* Version :: The table version. */
+/* */
+/* Ascender :: The font's ascender, i.e., the distance */
+/* from the baseline to the top-most of all */
+/* glyph points found in the font. */
+/* */
+/* This value is invalid in many fonts, as */
+/* it is usually set by the font designer, */
+/* and often reflects only a portion of the */
+/* glyphs found in the font (maybe ASCII). */
+/* */
+/* You should use the `sTypoAscender' field */
+/* of the OS/2 table instead if you want */
+/* the correct one. */
+/* */
+/* Descender :: The font's descender, i.e., the distance */
+/* from the baseline to the bottom-most of */
+/* all glyph points found in the font. It */
+/* is negative. */
+/* */
+/* This value is invalid in many fonts, as */
+/* it is usually set by the font designer, */
+/* and often reflects only a portion of the */
+/* glyphs found in the font (maybe ASCII). */
+/* */
+/* You should use the `sTypoDescender' */
+/* field of the OS/2 table instead if you */
+/* want the correct one. */
+/* */
+/* Line_Gap :: The font's line gap, i.e., the distance */
+/* to add to the ascender and descender to */
+/* get the BTB, i.e., the */
+/* baseline-to-baseline distance for the */
+/* font. */
+/* */
+/* advance_Width_Max :: This field is the maximum of all advance */
+/* widths found in the font. It can be */
+/* used to compute the maximum width of an */
+/* arbitrary string of text. */
+/* */
+/* min_Left_Side_Bearing :: The minimum left side bearing of all */
+/* glyphs within the font. */
+/* */
+/* min_Right_Side_Bearing :: The minimum right side bearing of all */
+/* glyphs within the font. */
+/* */
+/* xMax_Extent :: The maximum horizontal extent (i.e., the */
+/* `width' of a glyph's bounding box) for */
+/* all glyphs in the font. */
+/* */
+/* caret_Slope_Rise :: The rise coefficient of the cursor's */
+/* slope of the cursor (slope=rise/run). */
+/* */
+/* caret_Slope_Run :: The run coefficient of the cursor's */
+/* slope. */
+/* */
+/* Reserved :: 8~reserved bytes. */
+/* */
+/* metric_Data_Format :: Always~0. */
+/* */
+/* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
+/* table -- this value can be smaller than */
+/* the total number of glyphs in the font. */
+/* */
+/* long_metrics :: A pointer into the `hmtx' table. */
+/* */
+/* short_metrics :: A pointer into the `hmtx' table. */
+/* */
+/* <Note> */
+/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+/* be identical except for the names of their fields which */
+/* are different. */
+/* */
+/* This ensures that a single function in the `ttload' */
+/* module is able to read both the horizontal and vertical */
+/* headers. */
+/* */
+typedef struct TT_HoriHeader_ {
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
@@ -205,106 +203,105 @@ FT_BEGIN_HEADER
void* long_metrics;
void* short_metrics;
- } TT_HoriHeader;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_VertHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType vertical header, the `vhea' */
- /* table, as well as the corresponding vertical metrics table, i.e., */
- /* the `vmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of */
- /* all glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoAscender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the */
- /* distance from the baseline to the */
- /* bottom-most of all glyph points found */
- /* in the font. It is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Height_Max :: This field is the maximum of all */
- /* advance heights found in the font. It */
- /* can be used to compute the maximum */
- /* height of an arbitrary string of text. */
- /* */
- /* min_Top_Side_Bearing :: The minimum top side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
- /* glyphs within the font. */
- /* */
- /* yMax_Extent :: The maximum vertical extent (i.e., the */
- /* `height' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* caret_Offset :: The cursor's offset for slanted fonts. */
- /* This value is `reserved' in vmtx */
- /* version 1.0. */
- /* */
- /* Reserved :: 8~reserved bytes. */
- /* */
- /* metric_Data_Format :: Always~0. */
- /* */
- /* number_Of_HMetrics :: Number of VMetrics entries in the */
- /* `vmtx' table -- this value can be */
- /* smaller than the total number of glyphs */
- /* in the font. */
- /* */
- /* long_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields which */
- /* are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_VertHeader_
- {
+} TT_HoriHeader;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_VertHeader */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType vertical header, the `vhea' */
+/* table, as well as the corresponding vertical metrics table, i.e., */
+/* the `vmtx' table. */
+/* */
+/* <Fields> */
+/* Version :: The table version. */
+/* */
+/* Ascender :: The font's ascender, i.e., the distance */
+/* from the baseline to the top-most of */
+/* all glyph points found in the font. */
+/* */
+/* This value is invalid in many fonts, as */
+/* it is usually set by the font designer, */
+/* and often reflects only a portion of */
+/* the glyphs found in the font (maybe */
+/* ASCII). */
+/* */
+/* You should use the `sTypoAscender' */
+/* field of the OS/2 table instead if you */
+/* want the correct one. */
+/* */
+/* Descender :: The font's descender, i.e., the */
+/* distance from the baseline to the */
+/* bottom-most of all glyph points found */
+/* in the font. It is negative. */
+/* */
+/* This value is invalid in many fonts, as */
+/* it is usually set by the font designer, */
+/* and often reflects only a portion of */
+/* the glyphs found in the font (maybe */
+/* ASCII). */
+/* */
+/* You should use the `sTypoDescender' */
+/* field of the OS/2 table instead if you */
+/* want the correct one. */
+/* */
+/* Line_Gap :: The font's line gap, i.e., the distance */
+/* to add to the ascender and descender to */
+/* get the BTB, i.e., the */
+/* baseline-to-baseline distance for the */
+/* font. */
+/* */
+/* advance_Height_Max :: This field is the maximum of all */
+/* advance heights found in the font. It */
+/* can be used to compute the maximum */
+/* height of an arbitrary string of text. */
+/* */
+/* min_Top_Side_Bearing :: The minimum top side bearing of all */
+/* glyphs within the font. */
+/* */
+/* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
+/* glyphs within the font. */
+/* */
+/* yMax_Extent :: The maximum vertical extent (i.e., the */
+/* `height' of a glyph's bounding box) for */
+/* all glyphs in the font. */
+/* */
+/* caret_Slope_Rise :: The rise coefficient of the cursor's */
+/* slope of the cursor (slope=rise/run). */
+/* */
+/* caret_Slope_Run :: The run coefficient of the cursor's */
+/* slope. */
+/* */
+/* caret_Offset :: The cursor's offset for slanted fonts. */
+/* This value is `reserved' in vmtx */
+/* version 1.0. */
+/* */
+/* Reserved :: 8~reserved bytes. */
+/* */
+/* metric_Data_Format :: Always~0. */
+/* */
+/* number_Of_HMetrics :: Number of VMetrics entries in the */
+/* `vmtx' table -- this value can be */
+/* smaller than the total number of glyphs */
+/* in the font. */
+/* */
+/* long_metrics :: A pointer into the `vmtx' table. */
+/* */
+/* short_metrics :: A pointer into the `vmtx' table. */
+/* */
+/* <Note> */
+/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+/* be identical except for the names of their fields which */
+/* are different. */
+/* */
+/* This ensures that a single function in the `ttload' */
+/* module is able to read both the horizontal and vertical */
+/* headers. */
+/* */
+typedef struct TT_VertHeader_ {
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
@@ -331,24 +328,23 @@ FT_BEGIN_HEADER
void* long_metrics;
void* short_metrics;
- } TT_VertHeader;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_OS2 */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType OS/2 table. This is the long */
- /* table version. All fields comply to the TrueType specification. */
- /* */
- /* Note that we now support old Mac fonts which do not include an */
- /* OS/2 table. In this case, the `version' field is always set to */
- /* 0xFFFF. */
- /* */
- typedef struct TT_OS2_
- {
+} TT_VertHeader;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_OS2 */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType OS/2 table. This is the long */
+/* table version. All fields comply to the TrueType specification. */
+/* */
+/* Note that we now support old Mac fonts which do not include an */
+/* OS/2 table. In this case, the `version' field is always set to */
+/* 0xFFFF. */
+/* */
+typedef struct TT_OS2_ {
FT_UShort version; /* 0x0001 - more or 0xFFFF */
FT_Short xAvgCharWidth;
FT_UShort usWeightClass;
@@ -397,22 +393,21 @@ FT_BEGIN_HEADER
FT_UShort usBreakChar;
FT_UShort usMaxContext;
- } TT_OS2;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Postscript */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType PostScript table. All fields */
- /* comply to the TrueType specification. This structure does not */
- /* reference the PostScript glyph names, which can be nevertheless */
- /* accessed with the `ttpost' module. */
- /* */
- typedef struct TT_Postscript_
- {
+} TT_OS2;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_Postscript */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType PostScript table. All fields */
+/* comply to the TrueType specification. This structure does not */
+/* reference the PostScript glyph names, which can be nevertheless */
+/* accessed with the `ttpost' module. */
+/* */
+typedef struct TT_Postscript_ {
FT_Fixed FormatType;
FT_Fixed italicAngle;
FT_Short underlinePosition;
@@ -426,20 +421,19 @@ FT_BEGIN_HEADER
/* Glyph names follow in the file, but we don't */
/* load them by default. See the ttpost.c file. */
- } TT_Postscript;
+} TT_Postscript;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_PCLT */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType PCLT table. All fields */
- /* comply to the TrueType specification. */
- /* */
- typedef struct TT_PCLT_
- {
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_PCLT */
+/* */
+/* <Description> */
+/* A structure used to model a TrueType PCLT table. All fields */
+/* comply to the TrueType specification. */
+/* */
+typedef struct TT_PCLT_ {
FT_Fixed Version;
FT_ULong FontNumber;
FT_UShort Pitch;
@@ -456,77 +450,76 @@ FT_BEGIN_HEADER
FT_Byte SerifStyle;
FT_Byte Reserved;
- } TT_PCLT;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_MaxProfile */
- /* */
- /* <Description> */
- /* The maximum profile is a table containing many max values which */
- /* can be used to pre-allocate arrays. This ensures that no memory */
- /* allocation occurs during a glyph load. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* */
- /* numGlyphs :: The number of glyphs in this TrueType */
- /* font. */
- /* */
- /* maxPoints :: The maximum number of points in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositePoints'. */
- /* */
- /* maxContours :: The maximum number of contours in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositeContours'. */
- /* */
- /* maxCompositePoints :: The maximum number of points in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxPoints'. */
- /* */
- /* maxCompositeContours :: The maximum number of contours in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxContours'. */
- /* */
- /* maxZones :: The maximum number of zones used for */
- /* glyph hinting. */
- /* */
- /* maxTwilightPoints :: The maximum number of points in the */
- /* twilight zone used for glyph hinting. */
- /* */
- /* maxStorage :: The maximum number of elements in the */
- /* storage area used for glyph hinting. */
- /* */
- /* maxFunctionDefs :: The maximum number of function */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxInstructionDefs :: The maximum number of instruction */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxStackElements :: The maximum number of stack elements used */
- /* during bytecode interpretation. */
- /* */
- /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
- /* used for glyph hinting. */
- /* */
- /* maxComponentElements :: The maximum number of simple (i.e., non- */
- /* composite) glyphs in a composite glyph. */
- /* */
- /* maxComponentDepth :: The maximum nesting depth of composite */
- /* glyphs. */
- /* */
- /* <Note> */
- /* This structure is only used during font loading. */
- /* */
- typedef struct TT_MaxProfile_
- {
+} TT_PCLT;
+
+
+/*************************************************************************/
+/* */
+/* <Struct> */
+/* TT_MaxProfile */
+/* */
+/* <Description> */
+/* The maximum profile is a table containing many max values which */
+/* can be used to pre-allocate arrays. This ensures that no memory */
+/* allocation occurs during a glyph load. */
+/* */
+/* <Fields> */
+/* version :: The version number. */
+/* */
+/* numGlyphs :: The number of glyphs in this TrueType */
+/* font. */
+/* */
+/* maxPoints :: The maximum number of points in a */
+/* non-composite TrueType glyph. See also */
+/* the structure element */
+/* `maxCompositePoints'. */
+/* */
+/* maxContours :: The maximum number of contours in a */
+/* non-composite TrueType glyph. See also */
+/* the structure element */
+/* `maxCompositeContours'. */
+/* */
+/* maxCompositePoints :: The maximum number of points in a */
+/* composite TrueType glyph. See also the */
+/* structure element `maxPoints'. */
+/* */
+/* maxCompositeContours :: The maximum number of contours in a */
+/* composite TrueType glyph. See also the */
+/* structure element `maxContours'. */
+/* */
+/* maxZones :: The maximum number of zones used for */
+/* glyph hinting. */
+/* */
+/* maxTwilightPoints :: The maximum number of points in the */
+/* twilight zone used for glyph hinting. */
+/* */
+/* maxStorage :: The maximum number of elements in the */
+/* storage area used for glyph hinting. */
+/* */
+/* maxFunctionDefs :: The maximum number of function */
+/* definitions in the TrueType bytecode for */
+/* this font. */
+/* */
+/* maxInstructionDefs :: The maximum number of instruction */
+/* definitions in the TrueType bytecode for */
+/* this font. */
+/* */
+/* maxStackElements :: The maximum number of stack elements used */
+/* during bytecode interpretation. */
+/* */
+/* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
+/* used for glyph hinting. */
+/* */
+/* maxComponentElements :: The maximum number of simple (i.e., non- */
+/* composite) glyphs in a composite glyph. */
+/* */
+/* maxComponentDepth :: The maximum nesting depth of composite */
+/* glyphs. */
+/* */
+/* <Note> */
+/* This structure is only used during font loading. */
+/* */
+typedef struct TT_MaxProfile_ {
FT_Fixed version;
FT_UShort numGlyphs;
FT_UShort maxPoints;
@@ -543,20 +536,19 @@ FT_BEGIN_HEADER
FT_UShort maxComponentElements;
FT_UShort maxComponentDepth;
- } TT_MaxProfile;
+} TT_MaxProfile;
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Sfnt_Tag */
- /* */
- /* <Description> */
- /* An enumeration used to specify the index of an SFNT table. */
- /* Used in the @FT_Get_Sfnt_Table API function. */
- /* */
- typedef enum FT_Sfnt_Tag_
- {
+/*************************************************************************/
+/* */
+/* <Enum> */
+/* FT_Sfnt_Tag */
+/* */
+/* <Description> */
+/* An enumeration used to specify the index of an SFNT table. */
+/* Used in the @FT_Get_Sfnt_Table API function. */
+/* */
+typedef enum FT_Sfnt_Tag_ {
ft_sfnt_head = 0, /* TT_Header */
ft_sfnt_maxp = 1, /* TT_MaxProfile */
ft_sfnt_os2 = 2, /* TT_OS2 */
@@ -567,206 +559,206 @@ FT_BEGIN_HEADER
sfnt_max /* internal end mark */
- } FT_Sfnt_Tag;
-
- /* */
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Table */
- /* */
- /* <Description> */
- /* Return a pointer to a given SFNT table within a face. */
- /* */
- /* <Input> */
- /* face :: A handle to the source. */
- /* */
- /* tag :: The index of the SFNT table. */
- /* */
- /* <Return> */
- /* A type-less pointer to the table. This will be~0 in case of */
- /* error, or if the corresponding table was not found *OR* loaded */
- /* from the file. */
- /* */
- /* Use a typecast according to `tag' to access the structure */
- /* elements. */
- /* */
- /* <Note> */
- /* The table is owned by the face object and disappears with it. */
- /* */
- /* This function is only useful to access SFNT tables that are loaded */
- /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
- /* a list. */
- /* */
- /* Here an example how to access the `vhea' table: */
- /* */
- /* { */
- /* TT_VertHeader* vert_header; */
- /* */
- /* */
- /* vert_header = */
- /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */
- /* } */
- /* */
- FT_EXPORT( void* )
- FT_Get_Sfnt_Table( FT_Face face,
- FT_Sfnt_Tag tag );
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Load_Sfnt_Table
- *
- * @description:
- * Load any font table into client memory.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * tag ::
- * The four-byte tag of the table to load. Use the value~0 if you want
- * to access the whole font file. Otherwise, you can use one of the
- * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
- * one with @FT_MAKE_TAG.
- *
- * offset ::
- * The starting offset in the table (or file if tag == 0).
- *
- * @output:
- * buffer ::
- * The target buffer address. The client must ensure that the memory
- * array is big enough to hold the data.
- *
- * @inout:
- * length ::
- * If the `length' parameter is NULL, then try to load the whole table.
- * Return an error code if it fails.
- *
- * Else, if `*length' is~0, exit immediately while returning the
- * table's (or file) full size in it.
- *
- * Else the number of bytes to read from the table or file, from the
- * starting offset.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If you need to determine the table's length you should first call this
- * function with `*length' set to~0, as in the following example:
- *
- * {
- * FT_ULong length = 0;
- *
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
- * if ( error ) { ... table does not exist ... }
- *
- * buffer = malloc( length );
- * if ( buffer == NULL ) { ... not enough memory ... }
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
- * if ( error ) { ... could not load table ... }
- * }
- */
- FT_EXPORT( FT_Error )
- FT_Load_Sfnt_Table( FT_Face face,
- FT_ULong tag,
- FT_Long offset,
- FT_Byte* buffer,
- FT_ULong* length );
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Sfnt_Table_Info
- *
- * @description:
- * Return information on an SFNT table.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * table_index ::
- * The index of an SFNT table. The function returns
- * FT_Err_Table_Missing for an invalid value.
- *
- * @inout:
- * tag ::
- * The name tag of the SFNT table. If the value is NULL, `table_index'
- * is ignored, and `length' returns the number of SFNT tables in the
- * font.
- *
- * @output:
- * length ::
- * The length of the SFNT table (or the number of SFNT tables, depending
- * on `tag').
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * While parsing fonts, FreeType handles SFNT tables with length zero as
- * missing.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Sfnt_Table_Info( FT_Face face,
- FT_UInt table_index,
- FT_ULong *tag,
- FT_ULong *length );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_CMap_Language_ID */
- /* */
- /* <Description> */
- /* Return TrueType/sfnt specific cmap language ID. Definitions of */
- /* language ID values are in `freetype/ttnameid.h'. */
- /* */
- /* <Input> */
- /* charmap :: */
- /* The target charmap. */
- /* */
- /* <Return> */
- /* The language ID of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, just return~0 as the default value. */
- /* */
- /* For a format~14 cmap (to access Unicode IVS), the return value is */
- /* 0xFFFFFFFF. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_CMap_Language_ID( FT_CharMap charmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_CMap_Format */
- /* */
- /* <Description> */
- /* Return TrueType/sfnt specific cmap format. */
- /* */
- /* <Input> */
- /* charmap :: */
- /* The target charmap. */
- /* */
- /* <Return> */
- /* The format of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, return -1. */
- /* */
- FT_EXPORT( FT_Long )
- FT_Get_CMap_Format( FT_CharMap charmap );
-
- /* */
+} FT_Sfnt_Tag;
+
+/* */
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_Sfnt_Table */
+/* */
+/* <Description> */
+/* Return a pointer to a given SFNT table within a face. */
+/* */
+/* <Input> */
+/* face :: A handle to the source. */
+/* */
+/* tag :: The index of the SFNT table. */
+/* */
+/* <Return> */
+/* A type-less pointer to the table. This will be~0 in case of */
+/* error, or if the corresponding table was not found *OR* loaded */
+/* from the file. */
+/* */
+/* Use a typecast according to `tag' to access the structure */
+/* elements. */
+/* */
+/* <Note> */
+/* The table is owned by the face object and disappears with it. */
+/* */
+/* This function is only useful to access SFNT tables that are loaded */
+/* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
+/* a list. */
+/* */
+/* Here an example how to access the `vhea' table: */
+/* */
+/* { */
+/* TT_VertHeader* vert_header; */
+/* */
+/* */
+/* vert_header = */
+/* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */
+/* } */
+/* */
+FT_EXPORT( void* )
+FT_Get_Sfnt_Table( FT_Face face,
+ FT_Sfnt_Tag tag );
+
+
+/**************************************************************************
+ *
+ * @function:
+ * FT_Load_Sfnt_Table
+ *
+ * @description:
+ * Load any font table into client memory.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * tag ::
+ * The four-byte tag of the table to load. Use the value~0 if you want
+ * to access the whole font file. Otherwise, you can use one of the
+ * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
+ * one with @FT_MAKE_TAG.
+ *
+ * offset ::
+ * The starting offset in the table (or file if tag == 0).
+ *
+ * @output:
+ * buffer ::
+ * The target buffer address. The client must ensure that the memory
+ * array is big enough to hold the data.
+ *
+ * @inout:
+ * length ::
+ * If the `length' parameter is NULL, then try to load the whole table.
+ * Return an error code if it fails.
+ *
+ * Else, if `*length' is~0, exit immediately while returning the
+ * table's (or file) full size in it.
+ *
+ * Else the number of bytes to read from the table or file, from the
+ * starting offset.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If you need to determine the table's length you should first call this
+ * function with `*length' set to~0, as in the following example:
+ *
+ * {
+ * FT_ULong length = 0;
+ *
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
+ * if ( error ) { ... table does not exist ... }
+ *
+ * buffer = malloc( length );
+ * if ( buffer == NULL ) { ... not enough memory ... }
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
+ * if ( error ) { ... could not load table ... }
+ * }
+ */
+FT_EXPORT( FT_Error )
+FT_Load_Sfnt_Table( FT_Face face,
+ FT_ULong tag,
+ FT_Long offset,
+ FT_Byte* buffer,
+ FT_ULong* length );
+
+
+/**************************************************************************
+ *
+ * @function:
+ * FT_Sfnt_Table_Info
+ *
+ * @description:
+ * Return information on an SFNT table.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * table_index ::
+ * The index of an SFNT table. The function returns
+ * FT_Err_Table_Missing for an invalid value.
+ *
+ * @inout:
+ * tag ::
+ * The name tag of the SFNT table. If the value is NULL, `table_index'
+ * is ignored, and `length' returns the number of SFNT tables in the
+ * font.
+ *
+ * @output:
+ * length ::
+ * The length of the SFNT table (or the number of SFNT tables, depending
+ * on `tag').
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * While parsing fonts, FreeType handles SFNT tables with length zero as
+ * missing.
+ *
+ */
+FT_EXPORT( FT_Error )
+FT_Sfnt_Table_Info( FT_Face face,
+ FT_UInt table_index,
+ FT_ULong *tag,
+ FT_ULong *length );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_CMap_Language_ID */
+/* */
+/* <Description> */
+/* Return TrueType/sfnt specific cmap language ID. Definitions of */
+/* language ID values are in `freetype/ttnameid.h'. */
+/* */
+/* <Input> */
+/* charmap :: */
+/* The target charmap. */
+/* */
+/* <Return> */
+/* The language ID of `charmap'. If `charmap' doesn't belong to a */
+/* TrueType/sfnt face, just return~0 as the default value. */
+/* */
+/* For a format~14 cmap (to access Unicode IVS), the return value is */
+/* 0xFFFFFFFF. */
+/* */
+FT_EXPORT( FT_ULong )
+FT_Get_CMap_Language_ID( FT_CharMap charmap );
+
+
+/*************************************************************************/
+/* */
+/* <Function> */
+/* FT_Get_CMap_Format */
+/* */
+/* <Description> */
+/* Return TrueType/sfnt specific cmap format. */
+/* */
+/* <Input> */
+/* charmap :: */
+/* The target charmap. */
+/* */
+/* <Return> */
+/* The format of `charmap'. If `charmap' doesn't belong to a */
+/* TrueType/sfnt face, return -1. */
+/* */
+FT_EXPORT( FT_Long )
+FT_Get_CMap_Format( FT_CharMap charmap );
+
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/freetype2/freetype/ttunpat.h b/thirdparties/common/include/libfreetype/freetype2/freetype/ttunpat.h
index a016275..b7d5db8 100755
--- a/thirdparties/common/include/libfreetype/freetype2/freetype/ttunpat.h
+++ b/thirdparties/common/include/libfreetype/freetype2/freetype/ttunpat.h
@@ -35,20 +35,20 @@
FT_BEGIN_HEADER
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_UNPATENTED_HINTING
- *
- * @description:
- * A constant used as the tag of an @FT_Parameter structure to indicate
- * that unpatented methods only should be used by the TrueType bytecode
- * interpreter for a typeface opened by @FT_Open_Face.
- *
- */
+/***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_UNPATENTED_HINTING
+ *
+ * @description:
+ * A constant used as the tag of an @FT_Parameter structure to indicate
+ * that unpatented methods only should be used by the TrueType bytecode
+ * interpreter for a typeface opened by @FT_Open_Face.
+ *
+ */
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
- /* */
+/* */
FT_END_HEADER
diff --git a/thirdparties/common/include/libfreetype/ft2build.h b/thirdparties/common/include/libfreetype/ft2build.h
index 6a3b8d9..92698f8 100755
--- a/thirdparties/common/include/libfreetype/ft2build.h
+++ b/thirdparties/common/include/libfreetype/ft2build.h
@@ -16,43 +16,43 @@
/***************************************************************************/
- /*************************************************************************/
- /* */
- /* This is a Unix-specific version of <ft2build.h> that should be used */
- /* exclusively *after* installation of the library. */
- /* */
- /* It assumes that `/usr/local/include/freetype2' (or whatever is */
- /* returned by the `freetype-config --cflags' or `pkg-config --cflags' */
- /* command) is in your compilation include path. */
- /* */
- /* We don't need to do anything special in this release. However, for */
- /* a future FreeType 2 release, the following installation changes will */
- /* be performed: */
- /* */
- /* - The contents of `freetype-2.x/include/freetype' will be installed */
- /* to `/usr/local/include/freetype2' instead of */
- /* `/usr/local/include/freetype2/freetype'. */
- /* */
- /* - This file will #include <freetype2/config/ftheader.h>, instead */
- /* of <freetype/config/ftheader.h>. */
- /* */
- /* - The contents of `ftheader.h' will be processed with `sed' to */
- /* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */
- /* */
- /* - Adding `/usr/local/include/freetype2' to your compilation include */
- /* path will not be necessary anymore. */
- /* */
- /* These changes will be transparent to client applications which use */
- /* freetype-config (or pkg-config). No modifications will be necessary */
- /* to compile with the new scheme. */
- /* */
- /*************************************************************************/
+/*************************************************************************/
+/* */
+/* This is a Unix-specific version of <ft2build.h> that should be used */
+/* exclusively *after* installation of the library. */
+/* */
+/* It assumes that `/usr/local/include/freetype2' (or whatever is */
+/* returned by the `freetype-config --cflags' or `pkg-config --cflags' */
+/* command) is in your compilation include path. */
+/* */
+/* We don't need to do anything special in this release. However, for */
+/* a future FreeType 2 release, the following installation changes will */
+/* be performed: */
+/* */
+/* - The contents of `freetype-2.x/include/freetype' will be installed */
+/* to `/usr/local/include/freetype2' instead of */
+/* `/usr/local/include/freetype2/freetype'. */
+/* */
+/* - This file will #include <freetype2/config/ftheader.h>, instead */
+/* of <freetype/config/ftheader.h>. */
+/* */
+/* - The contents of `ftheader.h' will be processed with `sed' to */
+/* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */
+/* */
+/* - Adding `/usr/local/include/freetype2' to your compilation include */
+/* path will not be necessary anymore. */
+/* */
+/* These changes will be transparent to client applications which use */
+/* freetype-config (or pkg-config). No modifications will be necessary */
+/* to compile with the new scheme. */
+/* */
+/*************************************************************************/
#ifndef __FT2_BUILD_UNIX_H__
#define __FT2_BUILD_UNIX_H__
- /* `<prefix>/include/freetype2' must be in your current inclusion path */
+/* `<prefix>/include/freetype2' must be in your current inclusion path */
#include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_UNIX_H__ */
diff --git a/thirdparties/common/include/libxml2/libxml/DOCBparser.h b/thirdparties/common/include/libxml2/libxml/DOCBparser.h
index 9394fa7..8fa4db3 100755
--- a/thirdparties/common/include/libxml2/libxml/DOCBparser.h
+++ b/thirdparties/common/include/libxml2/libxml/DOCBparser.h
@@ -42,50 +42,50 @@ typedef xmlDocPtr docbDocPtr;
* There is only few public functions.
*/
XMLPUBFUN int XMLCALL
- docbEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
+docbEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseDoc (xmlChar *cur,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
+docbSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
XMLPUBFUN docbDocPtr XMLCALL
- docbParseDoc (xmlChar *cur,
- const char *encoding);
+docbParseDoc (xmlChar *cur,
+ const char *encoding);
XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseFile (const char *filename,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
+docbSAXParseFile (const char *filename,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
XMLPUBFUN docbDocPtr XMLCALL
- docbParseFile (const char *filename,
- const char *encoding);
+docbParseFile (const char *filename,
+ const char *encoding);
/**
* Interfaces for the Push mode.
*/
XMLPUBFUN void XMLCALL
- docbFreeParserCtxt (docbParserCtxtPtr ctxt);
+docbFreeParserCtxt (docbParserCtxtPtr ctxt);
XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
+docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
- docbParseChunk (docbParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+docbParseChunk (docbParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreateFileParserCtxt(const char *filename,
- const char *encoding);
+docbCreateFileParserCtxt(const char *filename,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- docbParseDocument (docbParserCtxtPtr ctxt);
+docbParseDocument (docbParserCtxtPtr ctxt);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/HTMLparser.h b/thirdparties/common/include/libxml2/libxml/HTMLparser.h
index 551186c..ec434f8 100755
--- a/thirdparties/common/include/libxml2/libxml/HTMLparser.h
+++ b/thirdparties/common/include/libxml2/libxml/HTMLparser.h
@@ -51,16 +51,16 @@ struct _htmlElemDesc {
char isinline; /* is this a block 0 or inline 1 element */
const char *desc; /* the description */
-/* NRK Jan.2003
- * New fields encapsulating HTML structure
- *
- * Bugs:
- * This is a very limited representation. It fails to tell us when
- * an element *requires* subelements (we only have whether they're
- * allowed or not), and it doesn't tell us where CDATA and PCDATA
- * are allowed. Some element relationships are not fully represented:
- * these are flagged with the word MODIFIER
- */
+ /* NRK Jan.2003
+ * New fields encapsulating HTML structure
+ *
+ * Bugs:
+ * This is a very limited representation. It fails to tell us when
+ * an element *requires* subelements (we only have whether they're
+ * allowed or not), and it doesn't tell us where CDATA and PCDATA
+ * are allowed. Some element relationships are not fully represented:
+ * these are flagged with the word MODIFIER
+ */
const char** subelts; /* allowed sub-elements of this element */
const char* defaultsubelt; /* subelement for suggested auto-repair
if necessary or NULL */
@@ -84,87 +84,87 @@ struct _htmlEntityDesc {
* There is only few public functions.
*/
XMLPUBFUN const htmlElemDesc * XMLCALL
- htmlTagLookup (const xmlChar *tag);
+htmlTagLookup (const xmlChar *tag);
XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityLookup(const xmlChar *name);
+htmlEntityLookup(const xmlChar *name);
XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityValueLookup(unsigned int value);
+htmlEntityValueLookup(unsigned int value);
XMLPUBFUN int XMLCALL
- htmlIsAutoClosed(htmlDocPtr doc,
- htmlNodePtr elem);
+htmlIsAutoClosed(htmlDocPtr doc,
+ htmlNodePtr elem);
XMLPUBFUN int XMLCALL
- htmlAutoCloseTag(htmlDocPtr doc,
- const xmlChar *name,
- htmlNodePtr elem);
+htmlAutoCloseTag(htmlDocPtr doc,
+ const xmlChar *name,
+ htmlNodePtr elem);
XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlParseEntityRef(htmlParserCtxtPtr ctxt,
- const xmlChar **str);
+htmlParseEntityRef(htmlParserCtxtPtr ctxt,
+ const xmlChar **str);
XMLPUBFUN int XMLCALL
- htmlParseCharRef(htmlParserCtxtPtr ctxt);
+htmlParseCharRef(htmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- htmlParseElement(htmlParserCtxtPtr ctxt);
+htmlParseElement(htmlParserCtxtPtr ctxt);
XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlNewParserCtxt(void);
+htmlNewParserCtxt(void);
XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreateMemoryParserCtxt(const char *buffer,
- int size);
+htmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
XMLPUBFUN int XMLCALL
- htmlParseDocument(htmlParserCtxtPtr ctxt);
+htmlParseDocument(htmlParserCtxtPtr ctxt);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseDoc (xmlChar *cur,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
+htmlSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseDoc (xmlChar *cur,
- const char *encoding);
+htmlParseDoc (xmlChar *cur,
+ const char *encoding);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseFile(const char *filename,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
+htmlSAXParseFile(const char *filename,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseFile (const char *filename,
- const char *encoding);
+htmlParseFile (const char *filename,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- UTF8ToHtml (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+UTF8ToHtml (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
XMLPUBFUN int XMLCALL
- htmlEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
+htmlEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
XMLPUBFUN int XMLCALL
- htmlIsScriptAttribute(const xmlChar *name);
+htmlIsScriptAttribute(const xmlChar *name);
XMLPUBFUN int XMLCALL
- htmlHandleOmittedElem(int val);
+htmlHandleOmittedElem(int val);
#ifdef LIBXML_PUSH_ENABLED
/**
* Interfaces for the Push mode.
*/
XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
+htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
- htmlParseChunk (htmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+htmlParseChunk (htmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
XMLPUBFUN void XMLCALL
- htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
+htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -189,78 +189,78 @@ typedef enum {
} htmlParserOption;
XMLPUBFUN void XMLCALL
- htmlCtxtReset (htmlParserCtxtPtr ctxt);
+htmlCtxtReset (htmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
- int options);
+htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFile (const char *URL,
- const char *encoding,
- int options);
+htmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/* NRK/Jan2003: further knowledge of HTML structure
*/
typedef enum {
- HTML_NA = 0 , /* something we don't check at all */
- HTML_INVALID = 0x1 ,
- HTML_DEPRECATED = 0x2 ,
- HTML_VALID = 0x4 ,
- HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
+ HTML_NA = 0 , /* something we don't check at all */
+ HTML_INVALID = 0x1 ,
+ HTML_DEPRECATED = 0x2 ,
+ HTML_VALID = 0x4 ,
+ HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
} htmlStatus ;
/* Using htmlElemDesc rather than name here, to emphasise the fact
diff --git a/thirdparties/common/include/libxml2/libxml/HTMLtree.h b/thirdparties/common/include/libxml2/libxml/HTMLtree.h
index c0e1103..c5258ca 100755
--- a/thirdparties/common/include/libxml2/libxml/HTMLtree.h
+++ b/thirdparties/common/include/libxml2/libxml/HTMLtree.h
@@ -60,81 +60,81 @@ extern "C" {
#define HTML_PI_NODE XML_PI_NODE
XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDoc (const xmlChar *URI,
- const xmlChar *ExternalID);
+htmlNewDoc (const xmlChar *URI,
+ const xmlChar *ExternalID);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDocNoDtD (const xmlChar *URI,
- const xmlChar *ExternalID);
+htmlNewDocNoDtD (const xmlChar *URI,
+ const xmlChar *ExternalID);
XMLPUBFUN const xmlChar * XMLCALL
- htmlGetMetaEncoding (htmlDocPtr doc);
+htmlGetMetaEncoding (htmlDocPtr doc);
XMLPUBFUN int XMLCALL
- htmlSetMetaEncoding (htmlDocPtr doc,
- const xmlChar *encoding);
+htmlSetMetaEncoding (htmlDocPtr doc,
+ const xmlChar *encoding);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- htmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
+htmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
XMLPUBFUN void XMLCALL
- htmlDocDumpMemoryFormat (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
+htmlDocDumpMemoryFormat (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
XMLPUBFUN int XMLCALL
- htmlDocDump (FILE *f,
- xmlDocPtr cur);
+htmlDocDump (FILE *f,
+ xmlDocPtr cur);
XMLPUBFUN int XMLCALL
- htmlSaveFile (const char *filename,
- xmlDocPtr cur);
+htmlSaveFile (const char *filename,
+ xmlDocPtr cur);
XMLPUBFUN int XMLCALL
- htmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur);
+htmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
XMLPUBFUN void XMLCALL
- htmlNodeDumpFile (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur);
+htmlNodeDumpFile (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- htmlNodeDumpFileFormat (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
+htmlNodeDumpFileFormat (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN int XMLCALL
- htmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
+htmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- htmlSaveFileFormat (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+htmlSaveFileFormat (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN void XMLCALL
- htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
+htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN void XMLCALL
- htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
+htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
XMLPUBFUN void XMLCALL
- htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN void XMLCALL
- htmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding);
+htmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL
- htmlIsBooleanAttr (const xmlChar *name);
+htmlIsBooleanAttr (const xmlChar *name);
#ifdef __cplusplus
diff --git a/thirdparties/common/include/libxml2/libxml/SAX.h b/thirdparties/common/include/libxml2/libxml/SAX.h
index 20093ce..e113753 100755
--- a/thirdparties/common/include/libxml2/libxml/SAX.h
+++ b/thirdparties/common/include/libxml2/libxml/SAX.h
@@ -24,143 +24,143 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- getPublicId (void *ctx);
+getPublicId (void *ctx);
XMLPUBFUN const xmlChar * XMLCALL
- getSystemId (void *ctx);
+getSystemId (void *ctx);
XMLPUBFUN void XMLCALL
- setDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
+setDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
XMLPUBFUN int XMLCALL
- getLineNumber (void *ctx);
+getLineNumber (void *ctx);
XMLPUBFUN int XMLCALL
- getColumnNumber (void *ctx);
+getColumnNumber (void *ctx);
XMLPUBFUN int XMLCALL
- isStandalone (void *ctx);
+isStandalone (void *ctx);
XMLPUBFUN int XMLCALL
- hasInternalSubset (void *ctx);
+hasInternalSubset (void *ctx);
XMLPUBFUN int XMLCALL
- hasExternalSubset (void *ctx);
+hasExternalSubset (void *ctx);
XMLPUBFUN void XMLCALL
- internalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+internalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN void XMLCALL
- externalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+externalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlEntityPtr XMLCALL
- getEntity (void *ctx,
- const xmlChar *name);
+getEntity (void *ctx,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- getParameterEntity (void *ctx,
- const xmlChar *name);
+getParameterEntity (void *ctx,
+ const xmlChar *name);
XMLPUBFUN xmlParserInputPtr XMLCALL
- resolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+resolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
XMLPUBFUN void XMLCALL
- entityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- attributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- elementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- notationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- unparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+entityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+attributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+elementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+notationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+unparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
XMLPUBFUN void XMLCALL
- startDocument (void *ctx);
+startDocument (void *ctx);
XMLPUBFUN void XMLCALL
- endDocument (void *ctx);
+endDocument (void *ctx);
XMLPUBFUN void XMLCALL
- attribute (void *ctx,
- const xmlChar *fullname,
- const xmlChar *value);
+attribute (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- startElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
+startElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
XMLPUBFUN void XMLCALL
- endElement (void *ctx,
- const xmlChar *name);
+endElement (void *ctx,
+ const xmlChar *name);
XMLPUBFUN void XMLCALL
- reference (void *ctx,
- const xmlChar *name);
+reference (void *ctx,
+ const xmlChar *name);
XMLPUBFUN void XMLCALL
- characters (void *ctx,
- const xmlChar *ch,
- int len);
+characters (void *ctx,
+ const xmlChar *ch,
+ int len);
XMLPUBFUN void XMLCALL
- ignorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
+ignorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
XMLPUBFUN void XMLCALL
- processingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
+processingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
XMLPUBFUN void XMLCALL
- globalNamespace (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
+globalNamespace (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
XMLPUBFUN void XMLCALL
- setNamespace (void *ctx,
- const xmlChar *name);
+setNamespace (void *ctx,
+ const xmlChar *name);
XMLPUBFUN xmlNsPtr XMLCALL
- getNamespace (void *ctx);
+getNamespace (void *ctx);
XMLPUBFUN int XMLCALL
- checkNamespace (void *ctx,
- xmlChar *nameSpace);
+checkNamespace (void *ctx,
+ xmlChar *nameSpace);
XMLPUBFUN void XMLCALL
- namespaceDecl (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
+namespaceDecl (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
XMLPUBFUN void XMLCALL
- comment (void *ctx,
- const xmlChar *value);
+comment (void *ctx,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- cdataBlock (void *ctx,
- const xmlChar *value,
- int len);
+cdataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN void XMLCALL
- initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
- int warning);
+initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
XMLPUBFUN void XMLCALL
- inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#ifdef LIBXML_DOCB_ENABLED
XMLPUBFUN void XMLCALL
- initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#endif /* LIBXML_SAX1_ENABLED */
diff --git a/thirdparties/common/include/libxml2/libxml/SAX2.h b/thirdparties/common/include/libxml2/libxml/SAX2.h
index daafd17..722f0f9 100755
--- a/thirdparties/common/include/libxml2/libxml/SAX2.h
+++ b/thirdparties/common/include/libxml2/libxml/SAX2.h
@@ -22,154 +22,154 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetPublicId (void *ctx);
+xmlSAX2GetPublicId (void *ctx);
XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetSystemId (void *ctx);
+xmlSAX2GetSystemId (void *ctx);
XMLPUBFUN void XMLCALL
- xmlSAX2SetDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
+xmlSAX2SetDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
XMLPUBFUN int XMLCALL
- xmlSAX2GetLineNumber (void *ctx);
+xmlSAX2GetLineNumber (void *ctx);
XMLPUBFUN int XMLCALL
- xmlSAX2GetColumnNumber (void *ctx);
+xmlSAX2GetColumnNumber (void *ctx);
XMLPUBFUN int XMLCALL
- xmlSAX2IsStandalone (void *ctx);
+xmlSAX2IsStandalone (void *ctx);
XMLPUBFUN int XMLCALL
- xmlSAX2HasInternalSubset (void *ctx);
+xmlSAX2HasInternalSubset (void *ctx);
XMLPUBFUN int XMLCALL
- xmlSAX2HasExternalSubset (void *ctx);
+xmlSAX2HasExternalSubset (void *ctx);
XMLPUBFUN void XMLCALL
- xmlSAX2InternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlSAX2InternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN void XMLCALL
- xmlSAX2ExternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlSAX2ExternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetEntity (void *ctx,
- const xmlChar *name);
+xmlSAX2GetEntity (void *ctx,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetParameterEntity (void *ctx,
- const xmlChar *name);
+xmlSAX2GetParameterEntity (void *ctx,
+ const xmlChar *name);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlSAX2ResolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+xmlSAX2ResolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
XMLPUBFUN void XMLCALL
- xmlSAX2EntityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- xmlSAX2AttributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- xmlSAX2ElementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlSAX2NotationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- xmlSAX2UnparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+xmlSAX2EntityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlSAX2AttributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+xmlSAX2ElementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlSAX2NotationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+xmlSAX2UnparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
XMLPUBFUN void XMLCALL
- xmlSAX2StartDocument (void *ctx);
+xmlSAX2StartDocument (void *ctx);
XMLPUBFUN void XMLCALL
- xmlSAX2EndDocument (void *ctx);
+xmlSAX2EndDocument (void *ctx);
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
XMLPUBFUN void XMLCALL
- xmlSAX2StartElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
+xmlSAX2StartElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
XMLPUBFUN void XMLCALL
- xmlSAX2EndElement (void *ctx,
- const xmlChar *name);
+xmlSAX2EndElement (void *ctx,
+ const xmlChar *name);
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
XMLPUBFUN void XMLCALL
- xmlSAX2StartElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
-XMLPUBFUN void XMLCALL
- xmlSAX2Reference (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlSAX2Characters (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2IgnorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2ProcessingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
-XMLPUBFUN void XMLCALL
- xmlSAX2Comment (void *ctx,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlSAX2CDataBlock (void *ctx,
- const xmlChar *value,
- int len);
+xmlSAX2StartElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
+XMLPUBFUN void XMLCALL
+xmlSAX2Reference (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSAX2Characters (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2IgnorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2ProcessingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
+XMLPUBFUN void XMLCALL
+xmlSAX2Comment (void *ctx,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+xmlSAX2CDataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlSAXDefaultVersion (int version);
+xmlSAXDefaultVersion (int version);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN int XMLCALL
- xmlSAXVersion (xmlSAXHandler *hdlr,
- int version);
+xmlSAXVersion (xmlSAXHandler *hdlr,
+ int version);
XMLPUBFUN void XMLCALL
- xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
- int warning);
+xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
XMLPUBFUN void XMLCALL
- xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
+xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
XMLPUBFUN void XMLCALL
- htmlDefaultSAXHandlerInit (void);
+htmlDefaultSAXHandlerInit (void);
#endif
#ifdef LIBXML_DOCB_ENABLED
XMLPUBFUN void XMLCALL
- xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
+xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
XMLPUBFUN void XMLCALL
- docbDefaultSAXHandlerInit (void);
+docbDefaultSAXHandlerInit (void);
#endif
XMLPUBFUN void XMLCALL
- xmlDefaultSAXHandlerInit (void);
+xmlDefaultSAXHandlerInit (void);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/c14n.h b/thirdparties/common/include/libxml2/libxml/c14n.h
index b8971d9..ed14c94 100755
--- a/thirdparties/common/include/libxml2/libxml/c14n.h
+++ b/thirdparties/common/include/libxml2/libxml/c14n.h
@@ -62,32 +62,33 @@ typedef enum {
XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
XML_C14N_1_1 = 2 /* C14N 1.1 spec */
-} xmlC14NMode;
+}
+xmlC14NMode;
XMLPUBFUN int XMLCALL
- xmlC14NDocSaveTo (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NDocSaveTo (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
XMLPUBFUN int XMLCALL
- xmlC14NDocDumpMemory (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlChar **doc_txt_ptr);
+xmlC14NDocDumpMemory (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlChar **doc_txt_ptr);
XMLPUBFUN int XMLCALL
- xmlC14NDocSave (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- const char* filename,
- int compression);
+xmlC14NDocSave (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ const char* filename,
+ int compression);
/**
@@ -104,17 +105,17 @@ XMLPUBFUN int XMLCALL
* Returns 1 if the node should be included
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
- xmlNodePtr node,
- xmlNodePtr parent);
+ xmlNodePtr node,
+ xmlNodePtr parent);
XMLPUBFUN int XMLCALL
- xmlC14NExecute (xmlDocPtr doc,
- xmlC14NIsVisibleCallback is_visible_callback,
- void* user_data,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NExecute (xmlDocPtr doc,
+ xmlC14NIsVisibleCallback is_visible_callback,
+ void* user_data,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/catalog.h b/thirdparties/common/include/libxml2/libxml/catalog.h
index 5a13f51..e3fa031 100755
--- a/thirdparties/common/include/libxml2/libxml/catalog.h
+++ b/thirdparties/common/include/libxml2/libxml/catalog.h
@@ -51,7 +51,8 @@ typedef enum {
XML_CATA_PREFER_NONE = 0,
XML_CATA_PREFER_PUBLIC = 1,
XML_CATA_PREFER_SYSTEM
-} xmlCatalogPrefer;
+}
+xmlCatalogPrefer;
typedef enum {
XML_CATA_ALLOW_NONE = 0,
@@ -67,113 +68,113 @@ typedef xmlCatalog *xmlCatalogPtr;
* Operations on a given catalog.
*/
XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlNewCatalog (int sgml);
+xmlNewCatalog (int sgml);
XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadACatalog (const char *filename);
+xmlLoadACatalog (const char *filename);
XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadSGMLSuperCatalog (const char *filename);
+xmlLoadSGMLSuperCatalog (const char *filename);
XMLPUBFUN int XMLCALL
- xmlConvertSGMLCatalog (xmlCatalogPtr catal);
+xmlConvertSGMLCatalog (xmlCatalogPtr catal);
XMLPUBFUN int XMLCALL
- xmlACatalogAdd (xmlCatalogPtr catal,
- const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
+xmlACatalogAdd (xmlCatalogPtr catal,
+ const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
XMLPUBFUN int XMLCALL
- xmlACatalogRemove (xmlCatalogPtr catal,
- const xmlChar *value);
+xmlACatalogRemove (xmlCatalogPtr catal,
+ const xmlChar *value);
XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolve (xmlCatalogPtr catal,
- const xmlChar *pubID,
- const xmlChar *sysID);
+xmlACatalogResolve (xmlCatalogPtr catal,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveSystem(xmlCatalogPtr catal,
- const xmlChar *sysID);
+xmlACatalogResolveSystem(xmlCatalogPtr catal,
+ const xmlChar *sysID);
XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolvePublic(xmlCatalogPtr catal,
- const xmlChar *pubID);
+xmlACatalogResolvePublic(xmlCatalogPtr catal,
+ const xmlChar *pubID);
XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveURI (xmlCatalogPtr catal,
- const xmlChar *URI);
+xmlACatalogResolveURI (xmlCatalogPtr catal,
+ const xmlChar *URI);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlACatalogDump (xmlCatalogPtr catal,
- FILE *out);
+xmlACatalogDump (xmlCatalogPtr catal,
+ FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeCatalog (xmlCatalogPtr catal);
+xmlFreeCatalog (xmlCatalogPtr catal);
XMLPUBFUN int XMLCALL
- xmlCatalogIsEmpty (xmlCatalogPtr catal);
+xmlCatalogIsEmpty (xmlCatalogPtr catal);
/*
* Global operations.
*/
XMLPUBFUN void XMLCALL
- xmlInitializeCatalog (void);
+xmlInitializeCatalog (void);
XMLPUBFUN int XMLCALL
- xmlLoadCatalog (const char *filename);
+xmlLoadCatalog (const char *filename);
XMLPUBFUN void XMLCALL
- xmlLoadCatalogs (const char *paths);
+xmlLoadCatalogs (const char *paths);
XMLPUBFUN void XMLCALL
- xmlCatalogCleanup (void);
+xmlCatalogCleanup (void);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlCatalogDump (FILE *out);
+xmlCatalogDump (FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolve (const xmlChar *pubID,
- const xmlChar *sysID);
+xmlCatalogResolve (const xmlChar *pubID,
+ const xmlChar *sysID);
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveSystem (const xmlChar *sysID);
+xmlCatalogResolveSystem (const xmlChar *sysID);
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolvePublic (const xmlChar *pubID);
+xmlCatalogResolvePublic (const xmlChar *pubID);
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveURI (const xmlChar *URI);
+xmlCatalogResolveURI (const xmlChar *URI);
XMLPUBFUN int XMLCALL
- xmlCatalogAdd (const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
+xmlCatalogAdd (const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
XMLPUBFUN int XMLCALL
- xmlCatalogRemove (const xmlChar *value);
+xmlCatalogRemove (const xmlChar *value);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseCatalogFile (const char *filename);
+xmlParseCatalogFile (const char *filename);
XMLPUBFUN int XMLCALL
- xmlCatalogConvert (void);
+xmlCatalogConvert (void);
/*
* Strictly minimal interfaces for per-document catalogs used
* by the parser.
*/
XMLPUBFUN void XMLCALL
- xmlCatalogFreeLocal (void *catalogs);
+xmlCatalogFreeLocal (void *catalogs);
XMLPUBFUN void * XMLCALL
- xmlCatalogAddLocal (void *catalogs,
- const xmlChar *URL);
+xmlCatalogAddLocal (void *catalogs,
+ const xmlChar *URL);
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolve (void *catalogs,
- const xmlChar *pubID,
- const xmlChar *sysID);
+xmlCatalogLocalResolve (void *catalogs,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolveURI(void *catalogs,
- const xmlChar *URI);
+xmlCatalogLocalResolveURI(void *catalogs,
+ const xmlChar *URI);
/*
* Preference settings.
*/
XMLPUBFUN int XMLCALL
- xmlCatalogSetDebug (int level);
+xmlCatalogSetDebug (int level);
XMLPUBFUN xmlCatalogPrefer XMLCALL
- xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
+xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
XMLPUBFUN void XMLCALL
- xmlCatalogSetDefaults (xmlCatalogAllow allow);
+xmlCatalogSetDefaults (xmlCatalogAllow allow);
XMLPUBFUN xmlCatalogAllow XMLCALL
- xmlCatalogGetDefaults (void);
+xmlCatalogGetDefaults (void);
/* DEPRECATED interfaces */
XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetSystem (const xmlChar *sysID);
+xmlCatalogGetSystem (const xmlChar *sysID);
XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetPublic (const xmlChar *pubID);
+xmlCatalogGetPublic (const xmlChar *pubID);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/chvalid.h b/thirdparties/common/include/libxml2/libxml/chvalid.h
index fb43016..d650b0b 100755
--- a/thirdparties/common/include/libxml2/libxml/chvalid.h
+++ b/thirdparties/common/include/libxml2/libxml/chvalid.h
@@ -52,7 +52,7 @@ struct _xmlChRangeGroup {
* Range checking routine
*/
XMLPUBFUN int XMLCALL
- xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
+xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
/**
@@ -208,21 +208,21 @@ XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
xmlIsPubidChar_ch((c)) : 0)
XMLPUBFUN int XMLCALL
- xmlIsBaseChar(unsigned int ch);
+xmlIsBaseChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsBlank(unsigned int ch);
+xmlIsBlank(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsChar(unsigned int ch);
+xmlIsChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsCombining(unsigned int ch);
+xmlIsCombining(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsDigit(unsigned int ch);
+xmlIsDigit(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsExtender(unsigned int ch);
+xmlIsExtender(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsIdeographic(unsigned int ch);
+xmlIsIdeographic(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsPubidChar(unsigned int ch);
+xmlIsPubidChar(unsigned int ch);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/debugXML.h b/thirdparties/common/include/libxml2/libxml/debugXML.h
index 5b3be13..4de83a8 100755
--- a/thirdparties/common/include/libxml2/libxml/debugXML.h
+++ b/thirdparties/common/include/libxml2/libxml/debugXML.h
@@ -26,40 +26,40 @@ extern "C" {
* The standard Dump routines.
*/
XMLPUBFUN void XMLCALL
- xmlDebugDumpString (FILE *output,
- const xmlChar *str);
+xmlDebugDumpString (FILE *output,
+ const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlDebugDumpAttr (FILE *output,
- xmlAttrPtr attr,
- int depth);
+xmlDebugDumpAttr (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpAttrList (FILE *output,
- xmlAttrPtr attr,
- int depth);
+xmlDebugDumpAttrList (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpOneNode (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpOneNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNode (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNodeList (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpNodeList (FILE *output,
+ xmlNodePtr node,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocumentHead(FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpDocumentHead(FILE *output,
+ xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocument (FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpDocument (FILE *output,
+ xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDTD (FILE *output,
- xmlDtdPtr dtd);
+xmlDebugDumpDTD (FILE *output,
+ xmlDtdPtr dtd);
XMLPUBFUN void XMLCALL
- xmlDebugDumpEntities (FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpEntities (FILE *output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -68,8 +68,8 @@ XMLPUBFUN void XMLCALL
****************************************************************/
XMLPUBFUN int XMLCALL
- xmlDebugCheckDocument (FILE * output,
- xmlDocPtr doc);
+xmlDebugCheckDocument (FILE * output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -78,12 +78,12 @@ XMLPUBFUN int XMLCALL
****************************************************************/
XMLPUBFUN void XMLCALL
- xmlLsOneNode (FILE *output, xmlNodePtr node);
+xmlLsOneNode (FILE *output, xmlNodePtr node);
XMLPUBFUN int XMLCALL
- xmlLsCountNode (xmlNodePtr node);
+xmlLsCountNode (xmlNodePtr node);
XMLPUBFUN const char * XMLCALL
- xmlBoolToText (int boolval);
+xmlBoolToText (int boolval);
/****************************************************************
* *
@@ -133,79 +133,79 @@ struct _xmlShellCtxt {
*/
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN void XMLCALL
- xmlShellPrintXPathError (int errorType,
- const char *arg);
+xmlShellPrintXPathError (int errorType,
+ const char *arg);
XMLPUBFUN void XMLCALL
- xmlShellPrintXPathResult(xmlXPathObjectPtr list);
+xmlShellPrintXPathResult(xmlXPathObjectPtr list);
XMLPUBFUN int XMLCALL
- xmlShellList (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellList (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellBase (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellBase (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellDir (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellDir (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellLoad (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellLoad (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlShellPrintNode (xmlNodePtr node);
+xmlShellPrintNode (xmlNodePtr node);
XMLPUBFUN int XMLCALL
- xmlShellCat (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellCat (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellWrite (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellWrite (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellSave (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellSave (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN int XMLCALL
- xmlShellValidate (xmlShellCtxtPtr ctxt,
- char *dtd,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellValidate (xmlShellCtxtPtr ctxt,
+ char *dtd,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_VALID_ENABLED */
XMLPUBFUN int XMLCALL
- xmlShellDu (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr tree,
- xmlNodePtr node2);
+xmlShellDu (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr tree,
+ xmlNodePtr node2);
XMLPUBFUN int XMLCALL
- xmlShellPwd (xmlShellCtxtPtr ctxt,
- char *buffer,
- xmlNodePtr node,
- xmlNodePtr node2);
+xmlShellPwd (xmlShellCtxtPtr ctxt,
+ char *buffer,
+ xmlNodePtr node,
+ xmlNodePtr node2);
/*
* The Shell interface.
*/
XMLPUBFUN void XMLCALL
- xmlShell (xmlDocPtr doc,
- char *filename,
- xmlShellReadlineFunc input,
- FILE *output);
+xmlShell (xmlDocPtr doc,
+ char *filename,
+ xmlShellReadlineFunc input,
+ FILE *output);
#endif /* LIBXML_XPATH_ENABLED */
diff --git a/thirdparties/common/include/libxml2/libxml/dict.h b/thirdparties/common/include/libxml2/libxml/dict.h
index 7022ec8..354ec6f 100755
--- a/thirdparties/common/include/libxml2/libxml/dict.h
+++ b/thirdparties/common/include/libxml2/libxml/dict.h
@@ -34,45 +34,45 @@ XMLPUBFUN int XMLCALL xmlInitializeDict(void);
* Constructor and destructor.
*/
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreate (void);
+xmlDictCreate (void);
XMLPUBFUN size_t XMLCALL
- xmlDictSetLimit (xmlDictPtr dict,
- size_t limit);
+xmlDictSetLimit (xmlDictPtr dict,
+ size_t limit);
XMLPUBFUN size_t XMLCALL
- xmlDictGetUsage (xmlDictPtr dict);
+xmlDictGetUsage (xmlDictPtr dict);
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreateSub(xmlDictPtr sub);
+xmlDictCreateSub(xmlDictPtr sub);
XMLPUBFUN int XMLCALL
- xmlDictReference(xmlDictPtr dict);
+xmlDictReference(xmlDictPtr dict);
XMLPUBFUN void XMLCALL
- xmlDictFree (xmlDictPtr dict);
+xmlDictFree (xmlDictPtr dict);
/*
* Lookup of entry in the dictionnary.
*/
XMLPUBFUN const xmlChar * XMLCALL
- xmlDictLookup (xmlDictPtr dict,
- const xmlChar *name,
- int len);
+xmlDictLookup (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlDictExists (xmlDictPtr dict,
- const xmlChar *name,
- int len);
+xmlDictExists (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlDictQLookup (xmlDictPtr dict,
- const xmlChar *prefix,
- const xmlChar *name);
+xmlDictQLookup (xmlDictPtr dict,
+ const xmlChar *prefix,
+ const xmlChar *name);
XMLPUBFUN int XMLCALL
- xmlDictOwns (xmlDictPtr dict,
- const xmlChar *str);
+xmlDictOwns (xmlDictPtr dict,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlDictSize (xmlDictPtr dict);
+xmlDictSize (xmlDictPtr dict);
/*
* Cleanup function
*/
XMLPUBFUN void XMLCALL
- xmlDictCleanup (void);
+xmlDictCleanup (void);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/encoding.h b/thirdparties/common/include/libxml2/libxml/encoding.h
index 7967cc6..93b7f06 100755
--- a/thirdparties/common/include/libxml2/libxml/encoding.h
+++ b/thirdparties/common/include/libxml2/libxml/encoding.h
@@ -80,7 +80,8 @@ typedef enum {
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
-} xmlCharEncoding;
+}
+xmlCharEncoding;
/**
* xmlCharEncodingInputFunc:
@@ -99,7 +100,7 @@ typedef enum {
* The value of @outlen after return is the number of octets consumed.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/**
@@ -121,7 +122,7 @@ typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
* The value of @outlen after return is the number of octets produced.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/*
@@ -130,8 +131,8 @@ typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
*/
#ifdef LIBXML_ICU_ENABLED
struct _uconv_t {
- UConverter *uconv; /* for conversion between an encoding and UTF-16 */
- UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
+ UConverter *uconv; /* for conversion between an encoding and UTF-16 */
+ UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
};
typedef struct _uconv_t uconv_t;
#endif
@@ -164,75 +165,75 @@ extern "C" {
* Interfaces for encoding handlers.
*/
XMLPUBFUN void XMLCALL
- xmlInitCharEncodingHandlers (void);
+xmlInitCharEncodingHandlers (void);
XMLPUBFUN void XMLCALL
- xmlCleanupCharEncodingHandlers (void);
+xmlCleanupCharEncodingHandlers (void);
XMLPUBFUN void XMLCALL
- xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
+xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlGetCharEncodingHandler (xmlCharEncoding enc);
+xmlGetCharEncodingHandler (xmlCharEncoding enc);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlFindCharEncodingHandler (const char *name);
+xmlFindCharEncodingHandler (const char *name);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlNewCharEncodingHandler (const char *name,
- xmlCharEncodingInputFunc input,
- xmlCharEncodingOutputFunc output);
+xmlNewCharEncodingHandler (const char *name,
+ xmlCharEncodingInputFunc input,
+ xmlCharEncodingOutputFunc output);
/*
* Interfaces for encoding names and aliases.
*/
XMLPUBFUN int XMLCALL
- xmlAddEncodingAlias (const char *name,
- const char *alias);
+xmlAddEncodingAlias (const char *name,
+ const char *alias);
XMLPUBFUN int XMLCALL
- xmlDelEncodingAlias (const char *alias);
+xmlDelEncodingAlias (const char *alias);
XMLPUBFUN const char * XMLCALL
- xmlGetEncodingAlias (const char *alias);
+xmlGetEncodingAlias (const char *alias);
XMLPUBFUN void XMLCALL
- xmlCleanupEncodingAliases (void);
+xmlCleanupEncodingAliases (void);
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlParseCharEncoding (const char *name);
+xmlParseCharEncoding (const char *name);
XMLPUBFUN const char * XMLCALL
- xmlGetCharEncodingName (xmlCharEncoding enc);
+xmlGetCharEncodingName (xmlCharEncoding enc);
/*
* Interfaces directly used by the parsers.
*/
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlDetectCharEncoding (const unsigned char *in,
- int len);
+xmlDetectCharEncoding (const unsigned char *in,
+ int len);
XMLPUBFUN int XMLCALL
- xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
+xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
XMLPUBFUN int XMLCALL
- xmlCharEncInFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
+xmlCharEncInFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
XMLPUBFUN int XMLCALL
- xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
+xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
XMLPUBFUN int XMLCALL
- xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
+xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
/*
* Export a few useful functions
*/
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL
- UTF8Toisolat1 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+UTF8Toisolat1 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL
- isolat1ToUTF8 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+isolat1ToUTF8 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/entities.h b/thirdparties/common/include/libxml2/libxml/entities.h
index 1e91189..0e4ac33 100755
--- a/thirdparties/common/include/libxml2/libxml/entities.h
+++ b/thirdparties/common/include/libxml2/libxml/entities.h
@@ -28,7 +28,8 @@ typedef enum {
XML_INTERNAL_PARAMETER_ENTITY = 4,
XML_EXTERNAL_PARAMETER_ENTITY = 5,
XML_INTERNAL_PREDEFINED_ENTITY = 6
-} xmlEntityType;
+}
+xmlEntityType;
/*
* An unit of storage for an entity, contains the string, the value
@@ -57,9 +58,9 @@ struct _xmlEntity {
const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */
- /* this is also used to count entites
- * references done from that entity
- * and if it contains '<' */
+ /* this is also used to count entites
+ * references done from that entity
+ * and if it contains '<' */
};
/*
@@ -76,71 +77,71 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlInitializePredefinedEntities (void);
+xmlInitializePredefinedEntities (void);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlNewEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlNewEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDocEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDocEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDtdEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDtdEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetPredefinedEntity (const xmlChar *name);
+xmlGetPredefinedEntity (const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDocEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDocEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDtdEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDtdEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetParameterEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetParameterEntity (xmlDocPtr doc,
+ const xmlChar *name);
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN const xmlChar * XMLCALL
- xmlEncodeEntities (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntities (xmlDocPtr doc,
+ const xmlChar *input);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeEntitiesReentrant(xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntitiesReentrant(xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeSpecialChars (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeSpecialChars (xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCreateEntitiesTable (void);
+xmlCreateEntitiesTable (void);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
+xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
+xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpEntitiesTable (xmlBufferPtr buf,
- xmlEntitiesTablePtr table);
+xmlDumpEntitiesTable (xmlBufferPtr buf,
+ xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL
- xmlDumpEntityDecl (xmlBufferPtr buf,
- xmlEntityPtr ent);
+xmlDumpEntityDecl (xmlBufferPtr buf,
+ xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlCleanupPredefinedEntities(void);
+xmlCleanupPredefinedEntities(void);
#endif /* LIBXML_LEGACY_ENABLED */
diff --git a/thirdparties/common/include/libxml2/libxml/globals.h b/thirdparties/common/include/libxml2/libxml/globals.h
index 9d688e0..4803e85 100755
--- a/thirdparties/common/include/libxml2/libxml/globals.h
+++ b/thirdparties/common/include/libxml2/libxml/globals.h
@@ -115,52 +115,51 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState
-{
- const char *xmlParserVersion;
+struct _xmlGlobalState {
+ const char *xmlParserVersion;
- xmlSAXLocator xmlDefaultSAXLocator;
- xmlSAXHandlerV1 xmlDefaultSAXHandler;
- xmlSAXHandlerV1 docbDefaultSAXHandler;
- xmlSAXHandlerV1 htmlDefaultSAXHandler;
+ xmlSAXLocator xmlDefaultSAXLocator;
+ xmlSAXHandlerV1 xmlDefaultSAXHandler;
+ xmlSAXHandlerV1 docbDefaultSAXHandler;
+ xmlSAXHandlerV1 htmlDefaultSAXHandler;
- xmlFreeFunc xmlFree;
- xmlMallocFunc xmlMalloc;
- xmlStrdupFunc xmlMemStrdup;
- xmlReallocFunc xmlRealloc;
+ xmlFreeFunc xmlFree;
+ xmlMallocFunc xmlMalloc;
+ xmlStrdupFunc xmlMemStrdup;
+ xmlReallocFunc xmlRealloc;
- xmlGenericErrorFunc xmlGenericError;
- xmlStructuredErrorFunc xmlStructuredError;
- void *xmlGenericErrorContext;
+ xmlGenericErrorFunc xmlGenericError;
+ xmlStructuredErrorFunc xmlStructuredError;
+ void *xmlGenericErrorContext;
- int oldXMLWDcompatibility;
+ int oldXMLWDcompatibility;
- xmlBufferAllocationScheme xmlBufferAllocScheme;
- int xmlDefaultBufferSize;
+ xmlBufferAllocationScheme xmlBufferAllocScheme;
+ int xmlDefaultBufferSize;
- int xmlSubstituteEntitiesDefaultValue;
- int xmlDoValidityCheckingDefaultValue;
- int xmlGetWarningsDefaultValue;
- int xmlKeepBlanksDefaultValue;
- int xmlLineNumbersDefaultValue;
- int xmlLoadExtDtdDefaultValue;
- int xmlParserDebugEntities;
- int xmlPedanticParserDefaultValue;
+ int xmlSubstituteEntitiesDefaultValue;
+ int xmlDoValidityCheckingDefaultValue;
+ int xmlGetWarningsDefaultValue;
+ int xmlKeepBlanksDefaultValue;
+ int xmlLineNumbersDefaultValue;
+ int xmlLoadExtDtdDefaultValue;
+ int xmlParserDebugEntities;
+ int xmlPedanticParserDefaultValue;
- int xmlSaveNoEmptyTags;
- int xmlIndentTreeOutput;
- const char *xmlTreeIndentString;
+ int xmlSaveNoEmptyTags;
+ int xmlIndentTreeOutput;
+ const char *xmlTreeIndentString;
- xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
- xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+ xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+ xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
- xmlMallocFunc xmlMallocAtomic;
- xmlError xmlLastError;
+ xmlMallocFunc xmlMallocAtomic;
+ xmlError xmlLastError;
- xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
- xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
+ xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
+ xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
- void *xmlStructuredErrorContext;
+ void *xmlStructuredErrorContext;
};
#ifdef __cplusplus
@@ -183,9 +182,9 @@ XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNo
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
- xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
+xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
- xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
+xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */
/*
@@ -349,7 +348,7 @@ XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
#endif
-XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlGenericErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlGenericErrorContext \
(*(__xmlGenericErrorContext()))
@@ -357,7 +356,7 @@ XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
XMLPUBVAR void * xmlGenericErrorContext;
#endif
-XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlStructuredErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlStructuredErrorContext \
(*(__xmlStructuredErrorContext()))
@@ -383,7 +382,7 @@ XMLPUBVAR int xmlIndentTreeOutput;
#endif
XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
-XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
+XMLPUBFUN const char ** XMLCALL __xmlTreeIndentString(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlTreeIndentString \
(*(__xmlTreeIndentString()))
@@ -428,7 +427,7 @@ XMLPUBVAR int xmlParserDebugEntities;
#endif
XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
-XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
+XMLPUBFUN const char ** XMLCALL __xmlParserVersion(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlParserVersion \
(*(__xmlParserVersion()))
diff --git a/thirdparties/common/include/libxml2/libxml/hash.h b/thirdparties/common/include/libxml2/libxml/hash.h
index dc8ab7e..0ecea8f 100755
--- a/thirdparties/common/include/libxml2/libxml/hash.h
+++ b/thirdparties/common/include/libxml2/libxml/hash.h
@@ -97,136 +97,136 @@ typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
* Callback when scanning data in a hash with the full scanner.
*/
typedef void (*xmlHashScannerFull)(void *payload, void *data,
- const xmlChar *name, const xmlChar *name2,
- const xmlChar *name3);
+ const xmlChar *name, const xmlChar *name2,
+ const xmlChar *name3);
/*
* Constructor and destructor.
*/
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreate (int size);
+xmlHashCreate (int size);
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreateDict(int size,
- xmlDictPtr dict);
+xmlHashCreateDict(int size,
+ xmlDictPtr dict);
XMLPUBFUN void XMLCALL
- xmlHashFree (xmlHashTablePtr table,
- xmlHashDeallocator f);
+xmlHashFree (xmlHashTablePtr table,
+ xmlHashDeallocator f);
/*
* Add a new entry to the hash table.
*/
XMLPUBFUN int XMLCALL
- xmlHashAddEntry (xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata);
+xmlHashAddEntry (xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata);
XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry(xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata,
- xmlHashDeallocator f);
+xmlHashUpdateEntry(xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata,
+ xmlHashDeallocator f);
XMLPUBFUN int XMLCALL
- xmlHashAddEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata);
+xmlHashAddEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata);
XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata,
- xmlHashDeallocator f);
+xmlHashUpdateEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata,
+ xmlHashDeallocator f);
XMLPUBFUN int XMLCALL
- xmlHashAddEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata);
+xmlHashAddEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata);
XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata,
- xmlHashDeallocator f);
+xmlHashUpdateEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata,
+ xmlHashDeallocator f);
/*
* Remove an entry from the hash table.
*/
XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
- xmlHashDeallocator f);
+xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
+ xmlHashDeallocator f);
XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, xmlHashDeallocator f);
+xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, xmlHashDeallocator f);
XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, const xmlChar *name3,
- xmlHashDeallocator f);
+xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, const xmlChar *name3,
+ xmlHashDeallocator f);
/*
* Retrieve the userdata.
*/
XMLPUBFUN void * XMLCALL
- xmlHashLookup (xmlHashTablePtr table,
- const xmlChar *name);
+xmlHashLookup (xmlHashTablePtr table,
+ const xmlChar *name);
XMLPUBFUN void * XMLCALL
- xmlHashLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2);
+xmlHashLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2);
XMLPUBFUN void * XMLCALL
- xmlHashLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3);
+xmlHashLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3);
XMLPUBFUN void * XMLCALL
- xmlHashQLookup (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix);
+xmlHashQLookup (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix);
XMLPUBFUN void * XMLCALL
- xmlHashQLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2);
+xmlHashQLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2);
XMLPUBFUN void * XMLCALL
- xmlHashQLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2,
- const xmlChar *name3,
- const xmlChar *prefix3);
+xmlHashQLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2,
+ const xmlChar *name3,
+ const xmlChar *prefix3);
/*
* Helpers.
*/
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCopy (xmlHashTablePtr table,
- xmlHashCopier f);
+xmlHashCopy (xmlHashTablePtr table,
+ xmlHashCopier f);
XMLPUBFUN int XMLCALL
- xmlHashSize (xmlHashTablePtr table);
+xmlHashSize (xmlHashTablePtr table);
XMLPUBFUN void XMLCALL
- xmlHashScan (xmlHashTablePtr table,
- xmlHashScanner f,
- void *data);
+xmlHashScan (xmlHashTablePtr table,
+ xmlHashScanner f,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlHashScan3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScanner f,
- void *data);
+xmlHashScan3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScanner f,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlHashScanFull (xmlHashTablePtr table,
- xmlHashScannerFull f,
- void *data);
+xmlHashScanFull (xmlHashTablePtr table,
+ xmlHashScannerFull f,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlHashScanFull3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScannerFull f,
- void *data);
+xmlHashScanFull3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScannerFull f,
+ void *data);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/list.h b/thirdparties/common/include/libxml2/libxml/list.h
index 0504e0c..7bd8e37 100755
--- a/thirdparties/common/include/libxml2/libxml/list.h
+++ b/thirdparties/common/include/libxml2/libxml/list.h
@@ -53,79 +53,79 @@ typedef int (*xmlListWalker) (const void *data, const void *user);
/* Creation/Deletion */
XMLPUBFUN xmlListPtr XMLCALL
- xmlListCreate (xmlListDeallocator deallocator,
- xmlListDataCompare compare);
+xmlListCreate (xmlListDeallocator deallocator,
+ xmlListDataCompare compare);
XMLPUBFUN void XMLCALL
- xmlListDelete (xmlListPtr l);
+xmlListDelete (xmlListPtr l);
/* Basic Operators */
XMLPUBFUN void * XMLCALL
- xmlListSearch (xmlListPtr l,
- void *data);
+xmlListSearch (xmlListPtr l,
+ void *data);
XMLPUBFUN void * XMLCALL
- xmlListReverseSearch (xmlListPtr l,
- void *data);
+xmlListReverseSearch (xmlListPtr l,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlListInsert (xmlListPtr l,
- void *data) ;
+xmlListInsert (xmlListPtr l,
+ void *data) ;
XMLPUBFUN int XMLCALL
- xmlListAppend (xmlListPtr l,
- void *data) ;
+xmlListAppend (xmlListPtr l,
+ void *data) ;
XMLPUBFUN int XMLCALL
- xmlListRemoveFirst (xmlListPtr l,
- void *data);
+xmlListRemoveFirst (xmlListPtr l,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlListRemoveLast (xmlListPtr l,
- void *data);
+xmlListRemoveLast (xmlListPtr l,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlListRemoveAll (xmlListPtr l,
- void *data);
+xmlListRemoveAll (xmlListPtr l,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlListClear (xmlListPtr l);
+xmlListClear (xmlListPtr l);
XMLPUBFUN int XMLCALL
- xmlListEmpty (xmlListPtr l);
+xmlListEmpty (xmlListPtr l);
XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListFront (xmlListPtr l);
+xmlListFront (xmlListPtr l);
XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListEnd (xmlListPtr l);
+xmlListEnd (xmlListPtr l);
XMLPUBFUN int XMLCALL
- xmlListSize (xmlListPtr l);
+xmlListSize (xmlListPtr l);
XMLPUBFUN void XMLCALL
- xmlListPopFront (xmlListPtr l);
+xmlListPopFront (xmlListPtr l);
XMLPUBFUN void XMLCALL
- xmlListPopBack (xmlListPtr l);
+xmlListPopBack (xmlListPtr l);
XMLPUBFUN int XMLCALL
- xmlListPushFront (xmlListPtr l,
- void *data);
+xmlListPushFront (xmlListPtr l,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlListPushBack (xmlListPtr l,
- void *data);
+xmlListPushBack (xmlListPtr l,
+ void *data);
/* Advanced Operators */
XMLPUBFUN void XMLCALL
- xmlListReverse (xmlListPtr l);
+xmlListReverse (xmlListPtr l);
XMLPUBFUN void XMLCALL
- xmlListSort (xmlListPtr l);
+xmlListSort (xmlListPtr l);
XMLPUBFUN void XMLCALL
- xmlListWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
+xmlListWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
XMLPUBFUN void XMLCALL
- xmlListReverseWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
+xmlListReverseWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
XMLPUBFUN void XMLCALL
- xmlListMerge (xmlListPtr l1,
- xmlListPtr l2);
+xmlListMerge (xmlListPtr l1,
+ xmlListPtr l2);
XMLPUBFUN xmlListPtr XMLCALL
- xmlListDup (const xmlListPtr old);
+xmlListDup (const xmlListPtr old);
XMLPUBFUN int XMLCALL
- xmlListCopy (xmlListPtr cur,
- const xmlListPtr old);
+xmlListCopy (xmlListPtr cur,
+ const xmlListPtr old);
/* Link operators */
XMLPUBFUN void * XMLCALL
- xmlLinkGetData (xmlLinkPtr lk);
+xmlLinkGetData (xmlLinkPtr lk);
/* xmlListUnique() */
/* xmlListSwap */
diff --git a/thirdparties/common/include/libxml2/libxml/nanoftp.h b/thirdparties/common/include/libxml2/libxml/nanoftp.h
index abb4bf7..63581a5 100755
--- a/thirdparties/common/include/libxml2/libxml/nanoftp.h
+++ b/thirdparties/common/include/libxml2/libxml/nanoftp.h
@@ -58,11 +58,11 @@ extern "C" {
* Note that only one of year and day:minute are specified.
*/
typedef void (*ftpListCallback) (void *userData,
- const char *filename, const char *attrib,
- const char *owner, const char *group,
- unsigned long size, int links, int year,
- const char *month, int day, int hour,
- int minute);
+ const char *filename, const char *attrib,
+ const char *owner, const char *group,
+ unsigned long size, int links, int year,
+ const char *month, int day, int hour,
+ int minute);
/**
* ftpDataCallback:
* @userData: the user provided context
@@ -72,89 +72,89 @@ typedef void (*ftpListCallback) (void *userData,
* A callback for the xmlNanoFTPGet command.
*/
typedef void (*ftpDataCallback) (void *userData,
- const char *data,
- int len);
+ const char *data,
+ int len);
/*
* Init
*/
XMLPUBFUN void XMLCALL
- xmlNanoFTPInit (void);
+xmlNanoFTPInit (void);
XMLPUBFUN void XMLCALL
- xmlNanoFTPCleanup (void);
+xmlNanoFTPCleanup (void);
/*
* Creating/freeing contexts.
*/
XMLPUBFUN void * XMLCALL
- xmlNanoFTPNewCtxt (const char *URL);
+xmlNanoFTPNewCtxt (const char *URL);
XMLPUBFUN void XMLCALL
- xmlNanoFTPFreeCtxt (void * ctx);
+xmlNanoFTPFreeCtxt (void * ctx);
XMLPUBFUN void * XMLCALL
- xmlNanoFTPConnectTo (const char *server,
- int port);
+xmlNanoFTPConnectTo (const char *server,
+ int port);
/*
* Opening/closing session connections.
*/
XMLPUBFUN void * XMLCALL
- xmlNanoFTPOpen (const char *URL);
+xmlNanoFTPOpen (const char *URL);
XMLPUBFUN int XMLCALL
- xmlNanoFTPConnect (void *ctx);
+xmlNanoFTPConnect (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoFTPClose (void *ctx);
+xmlNanoFTPClose (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoFTPQuit (void *ctx);
+xmlNanoFTPQuit (void *ctx);
XMLPUBFUN void XMLCALL
- xmlNanoFTPScanProxy (const char *URL);
+xmlNanoFTPScanProxy (const char *URL);
XMLPUBFUN void XMLCALL
- xmlNanoFTPProxy (const char *host,
- int port,
- const char *user,
- const char *passwd,
- int type);
+xmlNanoFTPProxy (const char *host,
+ int port,
+ const char *user,
+ const char *passwd,
+ int type);
XMLPUBFUN int XMLCALL
- xmlNanoFTPUpdateURL (void *ctx,
- const char *URL);
+xmlNanoFTPUpdateURL (void *ctx,
+ const char *URL);
/*
* Rather internal commands.
*/
XMLPUBFUN int XMLCALL
- xmlNanoFTPGetResponse (void *ctx);
+xmlNanoFTPGetResponse (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoFTPCheckResponse (void *ctx);
+xmlNanoFTPCheckResponse (void *ctx);
/*
* CD/DIR/GET handlers.
*/
XMLPUBFUN int XMLCALL
- xmlNanoFTPCwd (void *ctx,
- const char *directory);
+xmlNanoFTPCwd (void *ctx,
+ const char *directory);
XMLPUBFUN int XMLCALL
- xmlNanoFTPDele (void *ctx,
- const char *file);
+xmlNanoFTPDele (void *ctx,
+ const char *file);
XMLPUBFUN SOCKET XMLCALL
- xmlNanoFTPGetConnection (void *ctx);
+xmlNanoFTPGetConnection (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoFTPCloseConnection(void *ctx);
+xmlNanoFTPCloseConnection(void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoFTPList (void *ctx,
- ftpListCallback callback,
- void *userData,
- const char *filename);
+xmlNanoFTPList (void *ctx,
+ ftpListCallback callback,
+ void *userData,
+ const char *filename);
XMLPUBFUN SOCKET XMLCALL
- xmlNanoFTPGetSocket (void *ctx,
- const char *filename);
+xmlNanoFTPGetSocket (void *ctx,
+ const char *filename);
XMLPUBFUN int XMLCALL
- xmlNanoFTPGet (void *ctx,
- ftpDataCallback callback,
- void *userData,
- const char *filename);
+xmlNanoFTPGet (void *ctx,
+ ftpDataCallback callback,
+ void *userData,
+ const char *filename);
XMLPUBFUN int XMLCALL
- xmlNanoFTPRead (void *ctx,
- void *dest,
- int len);
+xmlNanoFTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/nanohttp.h b/thirdparties/common/include/libxml2/libxml/nanohttp.h
index 22b8fb4..8fca6e6 100755
--- a/thirdparties/common/include/libxml2/libxml/nanohttp.h
+++ b/thirdparties/common/include/libxml2/libxml/nanohttp.h
@@ -19,60 +19,60 @@
extern "C" {
#endif
XMLPUBFUN void XMLCALL
- xmlNanoHTTPInit (void);
+xmlNanoHTTPInit (void);
XMLPUBFUN void XMLCALL
- xmlNanoHTTPCleanup (void);
+xmlNanoHTTPCleanup (void);
XMLPUBFUN void XMLCALL
- xmlNanoHTTPScanProxy (const char *URL);
+xmlNanoHTTPScanProxy (const char *URL);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPFetch (const char *URL,
- const char *filename,
- char **contentType);
+xmlNanoHTTPFetch (const char *URL,
+ const char *filename,
+ char **contentType);
XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethod (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- const char *headers,
- int ilen);
+xmlNanoHTTPMethod (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ const char *headers,
+ int ilen);
XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethodRedir (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- char **redir,
- const char *headers,
- int ilen);
+xmlNanoHTTPMethodRedir (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ char **redir,
+ const char *headers,
+ int ilen);
XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpen (const char *URL,
- char **contentType);
+xmlNanoHTTPOpen (const char *URL,
+ char **contentType);
XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpenRedir (const char *URL,
- char **contentType,
- char **redir);
+xmlNanoHTTPOpenRedir (const char *URL,
+ char **contentType,
+ char **redir);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPReturnCode (void *ctx);
+xmlNanoHTTPReturnCode (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPAuthHeader (void *ctx);
+xmlNanoHTTPAuthHeader (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPRedir (void *ctx);
+xmlNanoHTTPRedir (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPContentLength( void * ctx );
+xmlNanoHTTPContentLength( void * ctx );
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPEncoding (void *ctx);
+xmlNanoHTTPEncoding (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPMimeType (void *ctx);
+xmlNanoHTTPMimeType (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPRead (void *ctx,
- void *dest,
- int len);
+xmlNanoHTTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL
- xmlNanoHTTPSave (void *ctxt,
- const char *filename);
+xmlNanoHTTPSave (void *ctxt,
+ const char *filename);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL
- xmlNanoHTTPClose (void *ctx);
+xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/parser.h b/thirdparties/common/include/libxml2/libxml/parser.h
index 3f5730d..2df46fe 100755
--- a/thirdparties/common/include/libxml2/libxml/parser.h
+++ b/thirdparties/common/include/libxml2/libxml/parser.h
@@ -87,20 +87,20 @@ typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
struct _xmlParserNodeInfo {
- const struct _xmlNode* node;
- /* Position & line # that text that created the node begins & ends on */
- unsigned long begin_pos;
- unsigned long begin_line;
- unsigned long end_pos;
- unsigned long end_line;
+ const struct _xmlNode* node;
+ /* Position & line # that text that created the node begins & ends on */
+ unsigned long begin_pos;
+ unsigned long begin_line;
+ unsigned long end_pos;
+ unsigned long end_line;
};
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
struct _xmlParserNodeInfoSeq {
- unsigned long maximum;
- unsigned long length;
- xmlParserNodeInfo* buffer;
+ unsigned long maximum;
+ unsigned long length;
+ xmlParserNodeInfo* buffer;
};
/**
@@ -229,7 +229,7 @@ struct _xmlParserCtxt {
const xmlChar *name; /* Current parsed Node */
int nameNr; /* Depth of the parsing stack */
int nameMax; /* Max depth of the parsing stack */
- const xmlChar * *nameTab; /* array of nodes */
+ const xmlChar **nameTab; /* array of nodes */
long nbChars; /* number of xmlChar processed */
long checkIndex; /* used by progressive parsing lookup */
@@ -261,7 +261,7 @@ struct _xmlParserCtxt {
int recovery; /* run in recovery mode */
int progressive; /* is this a progressive parsing */
xmlDictPtr dict; /* dictionnary for the parser */
- const xmlChar * *atts; /* array for the attributes callbacks */
+ const xmlChar **atts; /* array for the attributes callbacks */
int maxatts; /* the size of the array */
int docdict; /* use strings from dict to build tree */
@@ -278,9 +278,9 @@ struct _xmlParserCtxt {
int sax2; /* operating in the new SAX mode */
int nsNr; /* the number of inherited namespaces */
int nsMax; /* the size of the arrays */
- const xmlChar * *nsTab; /* the array of prefix/namespace name */
+ const xmlChar **nsTab; /* the array of prefix/namespace name */
int *attallocs; /* which attribute were allocated */
- void * *pushTab; /* array of data for push */
+ void **pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
int nsWellFormed; /* is the document XML Nanespace okay */
@@ -348,8 +348,8 @@ struct _xmlSAXLocator {
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* internalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -360,9 +360,9 @@ typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
* Callback on internal subset declaration.
*/
typedef void (*internalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* externalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -373,9 +373,9 @@ typedef void (*internalSubsetSAXFunc) (void *ctx,
* Callback on external subset declaration.
*/
typedef void (*externalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* getEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -386,7 +386,7 @@ typedef void (*externalSubsetSAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* getParameterEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -397,7 +397,7 @@ typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* entityDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -410,11 +410,11 @@ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
* An entity definition has been parsed.
*/
typedef void (*entityDeclSAXFunc) (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
/**
* notationDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -425,9 +425,9 @@ typedef void (*entityDeclSAXFunc) (void *ctx,
* What to do when a notation declaration has been parsed.
*/
typedef void (*notationDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* attributeDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -441,12 +441,12 @@ typedef void (*notationDeclSAXFunc)(void *ctx,
* An attribute definition has been parsed.
*/
typedef void (*attributeDeclSAXFunc)(void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
/**
* elementDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -457,9 +457,9 @@ typedef void (*attributeDeclSAXFunc)(void *ctx,
* An element definition has been parsed.
*/
typedef void (*elementDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
/**
* unparsedEntityDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -471,10 +471,10 @@ typedef void (*elementDeclSAXFunc)(void *ctx,
* What to do when an unparsed entity declaration is parsed.
*/
typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
/**
* setDocumentLocatorSAXFunc:
* @ctx: the user data (XML parser context)
@@ -484,7 +484,7 @@ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
* Everything is available on the context, so this is useless in our case.
*/
typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
- xmlSAXLocatorPtr loc);
+ xmlSAXLocatorPtr loc);
/**
* startDocumentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -508,8 +508,8 @@ typedef void (*endDocumentSAXFunc) (void *ctx);
* Called when an opening tag has been processed.
*/
typedef void (*startElementSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar **atts);
+ const xmlChar *name,
+ const xmlChar **atts);
/**
* endElementSAXFunc:
* @ctx: the user data (XML parser context)
@@ -518,7 +518,7 @@ typedef void (*startElementSAXFunc) (void *ctx,
* Called when the end of an element has been detected.
*/
typedef void (*endElementSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* attributeSAXFunc:
* @ctx: the user data (XML parser context)
@@ -531,8 +531,8 @@ typedef void (*endElementSAXFunc) (void *ctx,
* the element.
*/
typedef void (*attributeSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *value);
+ const xmlChar *name,
+ const xmlChar *value);
/**
* referenceSAXFunc:
* @ctx: the user data (XML parser context)
@@ -541,7 +541,7 @@ typedef void (*attributeSAXFunc) (void *ctx,
* Called when an entity reference is detected.
*/
typedef void (*referenceSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* charactersSAXFunc:
* @ctx: the user data (XML parser context)
@@ -551,8 +551,8 @@ typedef void (*referenceSAXFunc) (void *ctx,
* Receiving some chars from the parser.
*/
typedef void (*charactersSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* ignorableWhitespaceSAXFunc:
* @ctx: the user data (XML parser context)
@@ -563,8 +563,8 @@ typedef void (*charactersSAXFunc) (void *ctx,
* UNUSED: by default the DOM building will use characters.
*/
typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* processingInstructionSAXFunc:
* @ctx: the user data (XML parser context)
@@ -574,8 +574,8 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
* A processing instruction has been parsed.
*/
typedef void (*processingInstructionSAXFunc) (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
+ const xmlChar *target,
+ const xmlChar *data);
/**
* commentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -584,7 +584,7 @@ typedef void (*processingInstructionSAXFunc) (void *ctx,
* A comment has been parsed.
*/
typedef void (*commentSAXFunc) (void *ctx,
- const xmlChar *value);
+ const xmlChar *value);
/**
* cdataBlockSAXFunc:
* @ctx: the user data (XML parser context)
@@ -594,9 +594,9 @@ typedef void (*commentSAXFunc) (void *ctx,
* Called when a pcdata block has been parsed.
*/
typedef void (*cdataBlockSAXFunc) (
- void *ctx,
- const xmlChar *value,
- int len);
+ void *ctx,
+ const xmlChar *value,
+ int len);
/**
* warningSAXFunc:
* @ctx: an XML parser context
@@ -606,7 +606,7 @@ typedef void (*cdataBlockSAXFunc) (
* Display and format a warning messages, callback.
*/
typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* errorSAXFunc:
* @ctx: an XML parser context
@@ -616,7 +616,7 @@ typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
* Display and format an error messages, callback.
*/
typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* fatalErrorSAXFunc:
* @ctx: an XML parser context
@@ -628,7 +628,7 @@ typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
* get all the callbacks for errors.
*/
typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* isStandaloneSAXFunc:
* @ctx: the user data (XML parser context)
@@ -690,14 +690,14 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
*/
typedef void (*startElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
/**
* endElementNsSAX2Func:
@@ -711,9 +711,9 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
*/
typedef void (*endElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
struct _xmlSAXHandler {
@@ -800,8 +800,8 @@ struct _xmlSAXHandlerV1 {
* Returns the entity input parser.
*/
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
- const char *ID,
- xmlParserCtxtPtr context);
+ const char *ID,
+ xmlParserCtxtPtr context);
#ifdef __cplusplus
}
@@ -820,191 +820,191 @@ extern "C" {
* Init/Cleanup
*/
XMLPUBFUN void XMLCALL
- xmlInitParser (void);
+xmlInitParser (void);
XMLPUBFUN void XMLCALL
- xmlCleanupParser (void);
+xmlCleanupParser (void);
/*
* Input functions
*/
XMLPUBFUN int XMLCALL
- xmlParserInputRead (xmlParserInputPtr in,
- int len);
+xmlParserInputRead (xmlParserInputPtr in,
+ int len);
XMLPUBFUN int XMLCALL
- xmlParserInputGrow (xmlParserInputPtr in,
- int len);
+xmlParserInputGrow (xmlParserInputPtr in,
+ int len);
/*
* Basic parsing Interfaces
*/
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseDoc (const xmlChar *cur);
+xmlParseDoc (const xmlChar *cur);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseFile (const char *filename);
+xmlParseFile (const char *filename);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseMemory (const char *buffer,
- int size);
+xmlParseMemory (const char *buffer,
+ int size);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN int XMLCALL
- xmlSubstituteEntitiesDefault(int val);
+xmlSubstituteEntitiesDefault(int val);
XMLPUBFUN int XMLCALL
- xmlKeepBlanksDefault (int val);
+xmlKeepBlanksDefault (int val);
XMLPUBFUN void XMLCALL
- xmlStopParser (xmlParserCtxtPtr ctxt);
+xmlStopParser (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlPedanticParserDefault(int val);
+xmlPedanticParserDefault(int val);
XMLPUBFUN int XMLCALL
- xmlLineNumbersDefault (int val);
+xmlLineNumbersDefault (int val);
#ifdef LIBXML_SAX1_ENABLED
/*
* Recovery mode
*/
XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverDoc (const xmlChar *cur);
+xmlRecoverDoc (const xmlChar *cur);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverMemory (const char *buffer,
- int size);
+xmlRecoverMemory (const char *buffer,
+ int size);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverFile (const char *filename);
+xmlRecoverFile (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
/*
* Less common routines and SAX interfaces
*/
XMLPUBFUN int XMLCALL
- xmlParseDocument (xmlParserCtxtPtr ctxt);
+xmlParseDocument (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
+xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *filename);
+xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *filename);
XMLPUBFUN int XMLCALL
- xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *buffer,
- int size);
+xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *buffer,
+ int size);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseDoc (xmlSAXHandlerPtr sax,
- const xmlChar *cur,
- int recovery);
+xmlSAXParseDoc (xmlSAXHandlerPtr sax,
+ const xmlChar *cur,
+ int recovery);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemory (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery);
+xmlSAXParseMemory (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery,
- void *data);
+xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery,
+ void *data);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFile (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery);
+xmlSAXParseFile (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery,
- void *data);
+xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery,
+ void *data);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseEntity (xmlSAXHandlerPtr sax,
- const char *filename);
+xmlSAXParseEntity (xmlSAXHandlerPtr sax,
+ const char *filename);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseEntity (const char *filename);
+xmlParseEntity (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlSAXParseDTD (xmlSAXHandlerPtr sax,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlSAXParseDTD (xmlSAXHandlerPtr sax,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlParseDTD (const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlParseDTD (const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlIOParseDTD (xmlSAXHandlerPtr sax,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+xmlIOParseDTD (xmlSAXHandlerPtr sax,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
#endif /* LIBXML_VALID_ENABLE */
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemory(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst);
+xmlParseBalancedChunkMemory(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN xmlParserErrors XMLCALL
- xmlParseInNodeContext (xmlNodePtr node,
- const char *data,
- int datalen,
- int options,
- xmlNodePtr *lst);
+xmlParseInNodeContext (xmlNodePtr node,
+ const char *data,
+ int datalen,
+ int options,
+ xmlNodePtr *lst);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst,
- int recover);
+xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst,
+ int recover);
XMLPUBFUN int XMLCALL
- xmlParseExternalEntity (xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+xmlParseExternalEntity (xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN int XMLCALL
- xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
/*
* Parser contexts handling.
*/
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlNewParserCtxt (void);
+xmlNewParserCtxt (void);
XMLPUBFUN int XMLCALL
- xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
+xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
+xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
+xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN void XMLCALL
- xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
- const xmlChar* buffer,
- const char *filename);
+xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
+ const xmlChar* buffer,
+ const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateDocParserCtxt (const xmlChar *cur);
+xmlCreateDocParserCtxt (const xmlChar *cur);
#ifdef LIBXML_LEGACY_ENABLED
/*
* Reading/setting optional parsing features.
*/
XMLPUBFUN int XMLCALL
- xmlGetFeaturesList (int *len,
- const char **result);
+xmlGetFeaturesList (int *len,
+ const char **result);
XMLPUBFUN int XMLCALL
- xmlGetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *result);
+xmlGetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *result);
XMLPUBFUN int XMLCALL
- xmlSetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *value);
+xmlSetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *value);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef LIBXML_PUSH_ENABLED
@@ -1012,16 +1012,16 @@ XMLPUBFUN int XMLCALL
* Interfaces for the Push mode.
*/
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename);
+xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename);
XMLPUBFUN int XMLCALL
- xmlParseChunk (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+xmlParseChunk (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
/*
@@ -1029,53 +1029,53 @@ XMLPUBFUN int XMLCALL
*/
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
- void *user_data,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
+xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
+ void *user_data,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
/*
* Node infos.
*/
XMLPUBFUN const xmlParserNodeInfo* XMLCALL
- xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
- const xmlNodePtr node);
+xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
+ const xmlNodePtr node);
XMLPUBFUN void XMLCALL
- xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
XMLPUBFUN void XMLCALL
- xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
XMLPUBFUN unsigned long XMLCALL
- xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
- const xmlNodePtr node);
+xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
+ const xmlNodePtr node);
XMLPUBFUN void XMLCALL
- xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
- const xmlParserNodeInfoPtr info);
+xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
+ const xmlParserNodeInfoPtr info);
/*
* External entities handling actually implemented in xmlIO.
*/
XMLPUBFUN void XMLCALL
- xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
+xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
XMLPUBFUN xmlExternalEntityLoader XMLCALL
- xmlGetExternalEntityLoader(void);
+xmlGetExternalEntityLoader(void);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlLoadExternalEntity (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+xmlLoadExternalEntity (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
/*
* Index lookup, actually implemented in the encoding module
*/
XMLPUBFUN long XMLCALL
- xmlByteConsumed (xmlParserCtxtPtr ctxt);
+xmlByteConsumed (xmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -1115,75 +1115,75 @@ typedef enum {
} xmlParserOption;
XMLPUBFUN void XMLCALL
- xmlCtxtReset (xmlParserCtxtPtr ctxt);
+xmlCtxtReset (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- const char *filename,
- const char *encoding);
+xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ const char *filename,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
- int options);
+xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFile (const char *URL,
- const char *encoding,
- int options);
+xmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Library wide options
@@ -1233,7 +1233,7 @@ typedef enum {
} xmlFeature;
XMLPUBFUN int XMLCALL
- xmlHasFeature (xmlFeature feature);
+xmlHasFeature (xmlFeature feature);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/parserInternals.h b/thirdparties/common/include/libxml2/libxml/parserInternals.h
index 6065320..0b05911 100755
--- a/thirdparties/common/include/libxml2/libxml/parserInternals.h
+++ b/thirdparties/common/include/libxml2/libxml/parserInternals.h
@@ -322,177 +322,177 @@ XMLPUBFUN int XMLCALL xmlIsLetter (int c);
* Parser context.
*/
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateFileParserCtxt (const char *filename);
+xmlCreateFileParserCtxt (const char *filename);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateURLParserCtxt (const char *filename,
- int options);
+xmlCreateURLParserCtxt (const char *filename,
+ int options);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateMemoryParserCtxt(const char *buffer,
- int size);
+xmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateEntityParserCtxt(const xmlChar *URL,
- const xmlChar *ID,
- const xmlChar *base);
+xmlCreateEntityParserCtxt(const xmlChar *URL,
+ const xmlChar *ID,
+ const xmlChar *base);
XMLPUBFUN int XMLCALL
- xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncoding enc);
+xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
- xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncodingHandlerPtr handler);
+xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncodingHandlerPtr handler);
XMLPUBFUN int XMLCALL
- xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler);
+xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input,
+ xmlCharEncodingHandlerPtr handler);
#ifdef IN_LIBXML
/* internal error reporting */
XMLPUBFUN void XMLCALL
- __xmlErrEncoding (xmlParserCtxtPtr ctxt,
- xmlParserErrors xmlerr,
- const char *msg,
- const xmlChar * str1,
- const xmlChar * str2);
+__xmlErrEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserErrors xmlerr,
+ const char *msg,
+ const xmlChar * str1,
+ const xmlChar * str2);
#endif
/**
* Input Streams.
*/
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
- const xmlChar *buffer);
+xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
+ const xmlChar *buffer);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
+xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
XMLPUBFUN int XMLCALL
- xmlPushInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input);
+xmlPushInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input);
XMLPUBFUN xmlChar XMLCALL
- xmlPopInput (xmlParserCtxtPtr ctxt);
+xmlPopInput (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlFreeInputStream (xmlParserInputPtr input);
+xmlFreeInputStream (xmlParserInputPtr input);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
- const char *filename);
+xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
+ const char *filename);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputStream (xmlParserCtxtPtr ctxt);
+xmlNewInputStream (xmlParserCtxtPtr ctxt);
/**
* Namespaces.
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName (xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlChar **prefix);
+xmlSplitQName (xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlChar **prefix);
/**
* Generic production rules.
*/
XMLPUBFUN const xmlChar * XMLCALL
- xmlParseName (xmlParserCtxtPtr ctxt);
+xmlParseName (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseNmtoken (xmlParserCtxtPtr ctxt);
+xmlParseNmtoken (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseEntityValue (xmlParserCtxtPtr ctxt,
- xmlChar **orig);
+xmlParseEntityValue (xmlParserCtxtPtr ctxt,
+ xmlChar **orig);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseAttValue (xmlParserCtxtPtr ctxt);
+xmlParseAttValue (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
+xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
+xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseCharData (xmlParserCtxtPtr ctxt,
- int cdata);
+xmlParseCharData (xmlParserCtxtPtr ctxt,
+ int cdata);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseExternalID (xmlParserCtxtPtr ctxt,
- xmlChar **publicID,
- int strict);
+xmlParseExternalID (xmlParserCtxtPtr ctxt,
+ xmlChar **publicID,
+ int strict);
XMLPUBFUN void XMLCALL
- xmlParseComment (xmlParserCtxtPtr ctxt);
+xmlParseComment (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL
- xmlParsePITarget (xmlParserCtxtPtr ctxt);
+xmlParsePITarget (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParsePI (xmlParserCtxtPtr ctxt);
+xmlParsePI (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
+xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
+xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
- xmlChar **value);
+xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseNotationType (xmlParserCtxtPtr ctxt);
+xmlParseNotationType (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
+xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
+xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
XMLPUBFUN int XMLCALL
- xmlParseAttributeType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
+xmlParseAttributeType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
XMLPUBFUN void XMLCALL
- xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
+xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementMixedContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
+xmlParseElementMixedContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementChildrenContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
+xmlParseElementChildrenContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
XMLPUBFUN int XMLCALL
- xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlElementContentPtr *result);
+xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlElementContentPtr *result);
XMLPUBFUN int XMLCALL
- xmlParseElementDecl (xmlParserCtxtPtr ctxt);
+xmlParseElementDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
+xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlParseCharRef (xmlParserCtxtPtr ctxt);
+xmlParseCharRef (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlParseEntityRef (xmlParserCtxtPtr ctxt);
+xmlParseEntityRef (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseReference (xmlParserCtxtPtr ctxt);
+xmlParseReference (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParsePEReference (xmlParserCtxtPtr ctxt);
+xmlParsePEReference (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
+xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN const xmlChar * XMLCALL
- xmlParseAttribute (xmlParserCtxtPtr ctxt,
- xmlChar **value);
+xmlParseAttribute (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
XMLPUBFUN const xmlChar * XMLCALL
- xmlParseStartTag (xmlParserCtxtPtr ctxt);
+xmlParseStartTag (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseEndTag (xmlParserCtxtPtr ctxt);
+xmlParseEndTag (xmlParserCtxtPtr ctxt);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN void XMLCALL
- xmlParseCDSect (xmlParserCtxtPtr ctxt);
+xmlParseCDSect (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseContent (xmlParserCtxtPtr ctxt);
+xmlParseContent (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseElement (xmlParserCtxtPtr ctxt);
+xmlParseElement (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionNum (xmlParserCtxtPtr ctxt);
+xmlParseVersionNum (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
+xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseEncName (xmlParserCtxtPtr ctxt);
+xmlParseEncName (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL
- xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
+xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlParseSDDecl (xmlParserCtxtPtr ctxt);
+xmlParseSDDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
+xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseTextDecl (xmlParserCtxtPtr ctxt);
+xmlParseTextDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseMisc (xmlParserCtxtPtr ctxt);
+xmlParseMisc (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* XML_SUBSTITUTE_NONE:
*
@@ -519,41 +519,41 @@ XMLPUBFUN void XMLCALL
#define XML_SUBSTITUTE_BOTH 3
XMLPUBFUN xmlChar * XMLCALL
- xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
XMLPUBFUN xmlChar * XMLCALL
- xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
- xmlNodePtr value);
+ xmlNodePtr value);
XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr value);
+ xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
- const xmlChar *value);
+ const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- int *len);
+ const xmlChar *cur,
+ int *len);
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
@@ -561,12 +561,12 @@ XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
* Really core function shared with HTML parser.
*/
XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
- int *len);
+ int *len);
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
- int val);
+ int val);
XMLPUBFUN int XMLCALL xmlCopyChar (int len,
- xmlChar *out,
- int val);
+ xmlChar *out,
+ int val);
XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
@@ -576,7 +576,7 @@ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
*/
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
- const char *encoding);
+ const char *encoding);
#endif
/*
@@ -594,38 +594,38 @@ XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filenam
* provenance of a chunk of nodes inherited from an entity replacement.
*/
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
- xmlNodePtr firstNode,
- xmlNodePtr lastNode);
+ xmlNodePtr firstNode,
+ xmlNodePtr lastNode);
XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
XMLPUBFUN xmlChar * XMLCALL
- xmlParseQuotedString (xmlParserCtxtPtr ctxt);
+xmlParseQuotedString (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseNamespace (xmlParserCtxtPtr ctxt);
+xmlParseNamespace (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
+xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlScanName (xmlParserCtxtPtr ctxt);
+xmlScanName (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
+xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
- xmlChar **prefix);
+xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
+ xmlChar **prefix);
/**
* Entities
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlDecodeEntities (xmlParserCtxtPtr ctxt,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlDecodeEntities (xmlParserCtxtPtr ctxt,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
XMLPUBFUN void XMLCALL
- xmlHandleEntity (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
+xmlHandleEntity (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
#endif /* LIBXML_LEGACY_ENABLED */
@@ -634,8 +634,8 @@ XMLPUBFUN void XMLCALL
* internal only
*/
XMLPUBFUN void XMLCALL
- xmlErrMemory (xmlParserCtxtPtr ctxt,
- const char *extra);
+xmlErrMemory (xmlParserCtxtPtr ctxt,
+ const char *extra);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/common/include/libxml2/libxml/pattern.h b/thirdparties/common/include/libxml2/libxml/pattern.h
index 97d2cd2..a697145 100755
--- a/thirdparties/common/include/libxml2/libxml/pattern.h
+++ b/thirdparties/common/include/libxml2/libxml/pattern.h
@@ -44,53 +44,53 @@ typedef enum {
} xmlPatternFlags;
XMLPUBFUN void XMLCALL
- xmlFreePattern (xmlPatternPtr comp);
+xmlFreePattern (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreePatternList (xmlPatternPtr comp);
+xmlFreePatternList (xmlPatternPtr comp);
XMLPUBFUN xmlPatternPtr XMLCALL
- xmlPatterncompile (const xmlChar *pattern,
- xmlDict *dict,
- int flags,
- const xmlChar **namespaces);
+xmlPatterncompile (const xmlChar *pattern,
+ xmlDict *dict,
+ int flags,
+ const xmlChar **namespaces);
XMLPUBFUN int XMLCALL
- xmlPatternMatch (xmlPatternPtr comp,
- xmlNodePtr node);
+xmlPatternMatch (xmlPatternPtr comp,
+ xmlNodePtr node);
/* streaming interfaces */
typedef struct _xmlStreamCtxt xmlStreamCtxt;
typedef xmlStreamCtxt *xmlStreamCtxtPtr;
XMLPUBFUN int XMLCALL
- xmlPatternStreamable (xmlPatternPtr comp);
+xmlPatternStreamable (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMaxDepth (xmlPatternPtr comp);
+xmlPatternMaxDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMinDepth (xmlPatternPtr comp);
+xmlPatternMinDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternFromRoot (xmlPatternPtr comp);
+xmlPatternFromRoot (xmlPatternPtr comp);
XMLPUBFUN xmlStreamCtxtPtr XMLCALL
- xmlPatternGetStreamCtxt (xmlPatternPtr comp);
+xmlPatternGetStreamCtxt (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
+xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamPushNode (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns,
- int nodeType);
+xmlStreamPushNode (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns,
+ int nodeType);
XMLPUBFUN int XMLCALL
- xmlStreamPush (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPush (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPushAttr (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPushAttr (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPop (xmlStreamCtxtPtr stream);
+xmlStreamPop (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
+xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/relaxng.h b/thirdparties/common/include/libxml2/libxml/relaxng.h
index bdb0a7d..59695c4 100755
--- a/thirdparties/common/include/libxml2/libxml/relaxng.h
+++ b/thirdparties/common/include/libxml2/libxml/relaxng.h
@@ -113,96 +113,96 @@ typedef enum {
} xmlRelaxNGParserFlag;
XMLPUBFUN int XMLCALL
- xmlRelaxNGInitTypes (void);
+xmlRelaxNGInitTypes (void);
XMLPUBFUN void XMLCALL
- xmlRelaxNGCleanupTypes (void);
+xmlRelaxNGCleanupTypes (void);
/*
* Interfaces for parsing.
*/
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewParserCtxt (const char *URL);
+xmlRelaxNGNewParserCtxt (const char *URL);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewMemParserCtxt (const char *buffer,
- int size);
+xmlRelaxNGNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
+xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
- int flag);
+xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
+ int flag);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserStructuredErrors(
- xmlRelaxNGParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlRelaxNGSetParserStructuredErrors(
+ xmlRelaxNGParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN xmlRelaxNGPtr XMLCALL
- xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFree (xmlRelaxNGPtr schema);
+xmlRelaxNGFree (xmlRelaxNGPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlRelaxNGDump (FILE *output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDump (FILE *output,
+ xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGDumpTree (FILE * output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDumpTree (FILE * output,
+ xmlRelaxNGPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror, void *ctx);
+xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror, void *ctx);
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
- xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
+xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
+xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc);
/*
* Interfaces for progressive validation when possible
*/
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
+xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/schemasInternals.h b/thirdparties/common/include/libxml2/libxml/schemasInternals.h
index 4f0ca9a..67dd50e 100755
--- a/thirdparties/common/include/libxml2/libxml/schemasInternals.h
+++ b/thirdparties/common/include/libxml2/libxml/schemasInternals.h
@@ -74,7 +74,8 @@ typedef enum {
XML_SCHEMAS_BASE64BINARY,
XML_SCHEMAS_ANYTYPE,
XML_SCHEMAS_ANYSIMPLETYPE
-} xmlSchemaValType;
+}
+xmlSchemaValType;
/*
* XML Schemas defines multiple type of types.
@@ -698,11 +699,11 @@ struct _xmlSchemaType {
* references have been resolved.
*/
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
- /**
- * XML_SCHEMAS_ELEM_CIRCULAR:
- *
- * a helper flag for the search of circular references.
- */
+/**
+* XML_SCHEMAS_ELEM_CIRCULAR:
+*
+* a helper flag for the search of circular references.
+*/
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
/**
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
diff --git a/thirdparties/common/include/libxml2/libxml/schematron.h b/thirdparties/common/include/libxml2/libxml/schematron.h
index 364eaec..8c835ad 100755
--- a/thirdparties/common/include/libxml2/libxml/schematron.h
+++ b/thirdparties/common/include/libxml2/libxml/schematron.h
@@ -29,7 +29,8 @@ typedef enum {
XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */
XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
-} xmlSchematronValidOptions;
+}
+xmlSchematronValidOptions;
/**
* The schemas related types are kept internal
@@ -70,14 +71,14 @@ typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
* Interfaces for parsing.
*/
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewParserCtxt (const char *URL);
+xmlSchematronNewParserCtxt (const char *URL);
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewMemParserCtxt(const char *buffer,
- int size);
+xmlSchematronNewMemParserCtxt(const char *buffer,
+ int size);
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
+xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
+xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
/*****
XMLPUBFUN void XMLCALL
xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
@@ -93,17 +94,17 @@ XMLPUBFUN int XMLCALL
xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
*****/
XMLPUBFUN xmlSchematronPtr XMLCALL
- xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
+xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchematronFree (xmlSchematronPtr schema);
+xmlSchematronFree (xmlSchematronPtr schema);
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlSchematronSetValidStructuredErrors(
- xmlSchematronValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchematronSetValidStructuredErrors(
+ xmlSchematronValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
/******
XMLPUBFUN void XMLCALL
xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
@@ -126,13 +127,13 @@ XMLPUBFUN int XMLCALL
*******/
XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
- xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
- int options);
+xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
+ int options);
XMLPUBFUN void XMLCALL
- xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
+xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
- xmlDocPtr instance);
+xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
+ xmlDocPtr instance);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/threads.h b/thirdparties/common/include/libxml2/libxml/threads.h
index d31f16a..b9db53e 100755
--- a/thirdparties/common/include/libxml2/libxml/threads.h
+++ b/thirdparties/common/include/libxml2/libxml/threads.h
@@ -37,40 +37,40 @@ typedef xmlRMutex *xmlRMutexPtr;
extern "C" {
#endif
XMLPUBFUN xmlMutexPtr XMLCALL
- xmlNewMutex (void);
+xmlNewMutex (void);
XMLPUBFUN void XMLCALL
- xmlMutexLock (xmlMutexPtr tok);
+xmlMutexLock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlMutexUnlock (xmlMutexPtr tok);
+xmlMutexUnlock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeMutex (xmlMutexPtr tok);
+xmlFreeMutex (xmlMutexPtr tok);
XMLPUBFUN xmlRMutexPtr XMLCALL
- xmlNewRMutex (void);
+xmlNewRMutex (void);
XMLPUBFUN void XMLCALL
- xmlRMutexLock (xmlRMutexPtr tok);
+xmlRMutexLock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlRMutexUnlock (xmlRMutexPtr tok);
+xmlRMutexUnlock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeRMutex (xmlRMutexPtr tok);
+xmlFreeRMutex (xmlRMutexPtr tok);
/*
* Library wide APIs.
*/
XMLPUBFUN void XMLCALL
- xmlInitThreads (void);
+xmlInitThreads (void);
XMLPUBFUN void XMLCALL
- xmlLockLibrary (void);
+xmlLockLibrary (void);
XMLPUBFUN void XMLCALL
- xmlUnlockLibrary(void);
+xmlUnlockLibrary(void);
XMLPUBFUN int XMLCALL
- xmlGetThreadId (void);
+xmlGetThreadId (void);
XMLPUBFUN int XMLCALL
- xmlIsMainThread (void);
+xmlIsMainThread (void);
XMLPUBFUN void XMLCALL
- xmlCleanupThreads(void);
+xmlCleanupThreads(void);
XMLPUBFUN xmlGlobalStatePtr XMLCALL
- xmlGetGlobalState(void);
+xmlGetGlobalState(void);
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
diff --git a/thirdparties/common/include/libxml2/libxml/tree.h b/thirdparties/common/include/libxml2/libxml/tree.h
index 7e06686..b08d863 100755
--- a/thirdparties/common/include/libxml2/libxml/tree.h
+++ b/thirdparties/common/include/libxml2/libxml/tree.h
@@ -177,7 +177,7 @@ typedef enum {
XML_XINCLUDE_START= 19,
XML_XINCLUDE_END= 20
#ifdef LIBXML_DOCB_ENABLED
- ,XML_DOCB_DOCUMENT_NODE= 21
+ ,XML_DOCB_DOCUMENT_NODE= 21
#endif
} xmlElementType;
@@ -600,9 +600,9 @@ typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
* Returns an xmlNsPtr or NULL in case of an error.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr node,
- const xmlChar *nsName,
- const xmlChar *nsPrefix);
+ xmlNodePtr node,
+ const xmlChar *nsName,
+ const xmlChar *nsPrefix);
/**
* xmlDOMWrapCtxt:
@@ -656,478 +656,478 @@ struct _xmlDOMWrapCtxt {
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
XMLPUBFUN int XMLCALL
- xmlValidateNCName (const xmlChar *value,
- int space);
+xmlValidateNCName (const xmlChar *value,
+ int space);
#endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int XMLCALL
- xmlValidateQName (const xmlChar *value,
- int space);
+xmlValidateQName (const xmlChar *value,
+ int space);
XMLPUBFUN int XMLCALL
- xmlValidateName (const xmlChar *value,
- int space);
+xmlValidateName (const xmlChar *value,
+ int space);
XMLPUBFUN int XMLCALL
- xmlValidateNMToken (const xmlChar *value,
- int space);
+xmlValidateNMToken (const xmlChar *value,
+ int space);
#endif
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildQName (const xmlChar *ncname,
- const xmlChar *prefix,
- xmlChar *memory,
- int len);
+xmlBuildQName (const xmlChar *ncname,
+ const xmlChar *prefix,
+ xmlChar *memory,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName2 (const xmlChar *name,
- xmlChar **prefix);
+xmlSplitQName2 (const xmlChar *name,
+ xmlChar **prefix);
XMLPUBFUN const xmlChar * XMLCALL
- xmlSplitQName3 (const xmlChar *name,
- int *len);
+xmlSplitQName3 (const xmlChar *name,
+ int *len);
/*
* Handling Buffers, the old ones see @xmlBuf for the new ones.
*/
XMLPUBFUN void XMLCALL
- xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
+xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
XMLPUBFUN xmlBufferAllocationScheme XMLCALL
- xmlGetBufferAllocationScheme(void);
+xmlGetBufferAllocationScheme(void);
XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreate (void);
+xmlBufferCreate (void);
XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateSize (size_t size);
+xmlBufferCreateSize (size_t size);
XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateStatic (void *mem,
- size_t size);
+xmlBufferCreateStatic (void *mem,
+ size_t size);
XMLPUBFUN int XMLCALL
- xmlBufferResize (xmlBufferPtr buf,
- unsigned int size);
+xmlBufferResize (xmlBufferPtr buf,
+ unsigned int size);
XMLPUBFUN void XMLCALL
- xmlBufferFree (xmlBufferPtr buf);
+xmlBufferFree (xmlBufferPtr buf);
XMLPUBFUN int XMLCALL
- xmlBufferDump (FILE *file,
- xmlBufferPtr buf);
+xmlBufferDump (FILE *file,
+ xmlBufferPtr buf);
XMLPUBFUN int XMLCALL
- xmlBufferAdd (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
+xmlBufferAdd (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
XMLPUBFUN int XMLCALL
- xmlBufferAddHead (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
+xmlBufferAddHead (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
XMLPUBFUN int XMLCALL
- xmlBufferCat (xmlBufferPtr buf,
- const xmlChar *str);
+xmlBufferCat (xmlBufferPtr buf,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlBufferCCat (xmlBufferPtr buf,
- const char *str);
+xmlBufferCCat (xmlBufferPtr buf,
+ const char *str);
XMLPUBFUN int XMLCALL
- xmlBufferShrink (xmlBufferPtr buf,
- unsigned int len);
+xmlBufferShrink (xmlBufferPtr buf,
+ unsigned int len);
XMLPUBFUN int XMLCALL
- xmlBufferGrow (xmlBufferPtr buf,
- unsigned int len);
+xmlBufferGrow (xmlBufferPtr buf,
+ unsigned int len);
XMLPUBFUN void XMLCALL
- xmlBufferEmpty (xmlBufferPtr buf);
+xmlBufferEmpty (xmlBufferPtr buf);
XMLPUBFUN const xmlChar* XMLCALL
- xmlBufferContent (const xmlBufferPtr buf);
+xmlBufferContent (const xmlBufferPtr buf);
XMLPUBFUN xmlChar* XMLCALL
- xmlBufferDetach (xmlBufferPtr buf);
+xmlBufferDetach (xmlBufferPtr buf);
XMLPUBFUN void XMLCALL
- xmlBufferSetAllocationScheme(xmlBufferPtr buf,
- xmlBufferAllocationScheme scheme);
+xmlBufferSetAllocationScheme(xmlBufferPtr buf,
+ xmlBufferAllocationScheme scheme);
XMLPUBFUN int XMLCALL
- xmlBufferLength (const xmlBufferPtr buf);
+xmlBufferLength (const xmlBufferPtr buf);
/*
* Creating/freeing new structures.
*/
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCreateIntSubset (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlCreateIntSubset (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlNewDtd (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+xmlNewDtd (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlGetIntSubset (xmlDocPtr doc);
+xmlGetIntSubset (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlFreeDtd (xmlDtdPtr cur);
+xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewGlobalNs (xmlDocPtr doc,
- const xmlChar *href,
- const xmlChar *prefix);
+xmlNewGlobalNs (xmlDocPtr doc,
+ const xmlChar *href,
+ const xmlChar *prefix);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewNs (xmlNodePtr node,
- const xmlChar *href,
- const xmlChar *prefix);
+xmlNewNs (xmlNodePtr node,
+ const xmlChar *href,
+ const xmlChar *prefix);
XMLPUBFUN void XMLCALL
- xmlFreeNs (xmlNsPtr cur);
+xmlFreeNs (xmlNsPtr cur);
XMLPUBFUN void XMLCALL
- xmlFreeNsList (xmlNsPtr cur);
+xmlFreeNsList (xmlNsPtr cur);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlNewDoc (const xmlChar *version);
+xmlNewDoc (const xmlChar *version);
XMLPUBFUN void XMLCALL
- xmlFreeDoc (xmlDocPtr cur);
+xmlFreeDoc (xmlDocPtr cur);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewDocProp (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *value);
+xmlNewDocProp (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *value);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
+xmlNewProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
#endif
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
+xmlNewNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsPropEatName (xmlNodePtr node,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *value);
+xmlNewNsPropEatName (xmlNodePtr node,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- xmlFreePropList (xmlAttrPtr cur);
+xmlFreePropList (xmlAttrPtr cur);
XMLPUBFUN void XMLCALL
- xmlFreeProp (xmlAttrPtr cur);
+xmlFreeProp (xmlAttrPtr cur);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyProp (xmlNodePtr target,
- xmlAttrPtr cur);
+xmlCopyProp (xmlNodePtr target,
+ xmlAttrPtr cur);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyPropList (xmlNodePtr target,
- xmlAttrPtr cur);
+xmlCopyPropList (xmlNodePtr target,
+ xmlAttrPtr cur);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCopyDtd (xmlDtdPtr dtd);
+xmlCopyDtd (xmlDtdPtr dtd);
#endif /* LIBXML_TREE_ENABLED */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCopyDoc (xmlDocPtr doc,
- int recursive);
+xmlCopyDoc (xmlDocPtr doc,
+ int recursive);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Creating new nodes.
*/
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+xmlNewDocNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNodeEatName (xmlDocPtr doc,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *content);
+xmlNewDocNodeEatName (xmlDocPtr doc,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNode (xmlNsPtr ns,
- const xmlChar *name);
+xmlNewNode (xmlNsPtr ns,
+ const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNodeEatName (xmlNsPtr ns,
- xmlChar *name);
+xmlNewNodeEatName (xmlNsPtr ns,
+ xmlChar *name);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+xmlNewChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
#endif
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocText (xmlDocPtr doc,
- const xmlChar *content);
+xmlNewDocText (xmlDocPtr doc,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewText (const xmlChar *content);
+xmlNewText (const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocPI (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *content);
+xmlNewDocPI (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewPI (const xmlChar *name,
- const xmlChar *content);
+xmlNewPI (const xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocTextLen (xmlDocPtr doc,
- const xmlChar *content,
- int len);
+xmlNewDocTextLen (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextLen (const xmlChar *content,
- int len);
+xmlNewTextLen (const xmlChar *content,
+ int len);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocComment (xmlDocPtr doc,
- const xmlChar *content);
+xmlNewDocComment (xmlDocPtr doc,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewComment (const xmlChar *content);
+xmlNewComment (const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCDataBlock (xmlDocPtr doc,
- const xmlChar *content,
- int len);
+xmlNewCDataBlock (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCharRef (xmlDocPtr doc,
- const xmlChar *name);
+xmlNewCharRef (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewReference (xmlDocPtr doc,
- const xmlChar *name);
+xmlNewReference (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNode (const xmlNodePtr node,
- int recursive);
+xmlCopyNode (const xmlNodePtr node,
+ int recursive);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNode (const xmlNodePtr node,
- xmlDocPtr doc,
- int recursive);
+xmlDocCopyNode (const xmlNodePtr node,
+ xmlDocPtr doc,
+ int recursive);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNodeList (xmlDocPtr doc,
- const xmlNodePtr node);
+xmlDocCopyNodeList (xmlDocPtr doc,
+ const xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNodeList (const xmlNodePtr node);
+xmlCopyNodeList (const xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+xmlNewTextChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocRawNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+xmlNewDocRawNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocFragment (xmlDocPtr doc);
+xmlNewDocFragment (xmlDocPtr doc);
#endif /* LIBXML_TREE_ENABLED */
/*
* Navigating.
*/
XMLPUBFUN long XMLCALL
- xmlGetLineNo (xmlNodePtr node);
+xmlGetLineNo (xmlNodePtr node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNodePath (xmlNodePtr node);
+xmlGetNodePath (xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocGetRootElement (xmlDocPtr doc);
+xmlDocGetRootElement (xmlDocPtr doc);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlGetLastChild (xmlNodePtr parent);
+xmlGetLastChild (xmlNodePtr parent);
XMLPUBFUN int XMLCALL
- xmlNodeIsText (xmlNodePtr node);
+xmlNodeIsText (xmlNodePtr node);
XMLPUBFUN int XMLCALL
- xmlIsBlankNode (xmlNodePtr node);
+xmlIsBlankNode (xmlNodePtr node);
/*
* Changing the structure.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocSetRootElement (xmlDocPtr doc,
- xmlNodePtr root);
+xmlDocSetRootElement (xmlDocPtr doc,
+ xmlNodePtr root);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void XMLCALL
- xmlNodeSetName (xmlNodePtr cur,
- const xmlChar *name);
+xmlNodeSetName (xmlNodePtr cur,
+ const xmlChar *name);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChild (xmlNodePtr parent,
- xmlNodePtr cur);
+xmlAddChild (xmlNodePtr parent,
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChildList (xmlNodePtr parent,
- xmlNodePtr cur);
+xmlAddChildList (xmlNodePtr parent,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL
- xmlReplaceNode (xmlNodePtr old,
- xmlNodePtr cur);
+xmlReplaceNode (xmlNodePtr old,
+ xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddPrevSibling (xmlNodePtr cur,
- xmlNodePtr elem);
+xmlAddPrevSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddSibling (xmlNodePtr cur,
- xmlNodePtr elem);
+xmlAddSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddNextSibling (xmlNodePtr cur,
- xmlNodePtr elem);
+xmlAddNextSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
XMLPUBFUN void XMLCALL
- xmlUnlinkNode (xmlNodePtr cur);
+xmlUnlinkNode (xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextMerge (xmlNodePtr first,
- xmlNodePtr second);
+xmlTextMerge (xmlNodePtr first,
+ xmlNodePtr second);
XMLPUBFUN int XMLCALL
- xmlTextConcat (xmlNodePtr node,
- const xmlChar *content,
- int len);
+xmlTextConcat (xmlNodePtr node,
+ const xmlChar *content,
+ int len);
XMLPUBFUN void XMLCALL
- xmlFreeNodeList (xmlNodePtr cur);
+xmlFreeNodeList (xmlNodePtr cur);
XMLPUBFUN void XMLCALL
- xmlFreeNode (xmlNodePtr cur);
+xmlFreeNode (xmlNodePtr cur);
XMLPUBFUN void XMLCALL
- xmlSetTreeDoc (xmlNodePtr tree,
- xmlDocPtr doc);
+xmlSetTreeDoc (xmlNodePtr tree,
+ xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSetListDoc (xmlNodePtr list,
- xmlDocPtr doc);
+xmlSetListDoc (xmlNodePtr list,
+ xmlDocPtr doc);
/*
* Namespaces.
*/
XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNs (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *nameSpace);
+xmlSearchNs (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *nameSpace);
XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNsByHref (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *href);
+xmlSearchNsByHref (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *href);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNsPtr * XMLCALL
- xmlGetNsList (xmlDocPtr doc,
- xmlNodePtr node);
+xmlGetNsList (xmlDocPtr doc,
+ xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
XMLPUBFUN void XMLCALL
- xmlSetNs (xmlNodePtr node,
- xmlNsPtr ns);
+xmlSetNs (xmlNodePtr node,
+ xmlNsPtr ns);
XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespace (xmlNsPtr cur);
+xmlCopyNamespace (xmlNsPtr cur);
XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespaceList (xmlNsPtr cur);
+xmlCopyNamespaceList (xmlNsPtr cur);
/*
* Changing the content.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
+xmlSetProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
+xmlSetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNoNsProp (xmlNodePtr node,
- const xmlChar *name);
+xmlGetNoNsProp (xmlNodePtr node,
+ const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL
- xmlGetProp (xmlNodePtr node,
- const xmlChar *name);
+xmlGetProp (xmlNodePtr node,
+ const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasProp (xmlNodePtr node,
- const xmlChar *name);
+xmlHasProp (xmlNodePtr node,
+ const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
+xmlHasNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
+xmlGetNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringGetNodeList (xmlDocPtr doc,
- const xmlChar *value);
+xmlStringGetNodeList (xmlDocPtr doc,
+ const xmlChar *value);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringLenGetNodeList (xmlDocPtr doc,
- const xmlChar *value,
- int len);
+xmlStringLenGetNodeList (xmlDocPtr doc,
+ const xmlChar *value,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+xmlNodeListGetString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetRawString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+xmlNodeListGetRawString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlNodeSetContent (xmlNodePtr cur,
- const xmlChar *content);
+xmlNodeSetContent (xmlNodePtr cur,
+ const xmlChar *content);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void XMLCALL
- xmlNodeSetContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
+xmlNodeSetContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlNodeAddContent (xmlNodePtr cur,
- const xmlChar *content);
+xmlNodeAddContent (xmlNodePtr cur,
+ const xmlChar *content);
XMLPUBFUN void XMLCALL
- xmlNodeAddContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
+xmlNodeAddContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetContent (xmlNodePtr cur);
+xmlNodeGetContent (xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlNodeBufGetContent (xmlBufferPtr buffer,
- xmlNodePtr cur);
+xmlNodeBufGetContent (xmlBufferPtr buffer,
+ xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlBufGetNodeContent (xmlBufPtr buf,
- xmlNodePtr cur);
+xmlBufGetNodeContent (xmlBufPtr buf,
+ xmlNodePtr cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetLang (xmlNodePtr cur);
+xmlNodeGetLang (xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlNodeGetSpacePreserve (xmlNodePtr cur);
+xmlNodeGetSpacePreserve (xmlNodePtr cur);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void XMLCALL
- xmlNodeSetLang (xmlNodePtr cur,
- const xmlChar *lang);
+xmlNodeSetLang (xmlNodePtr cur,
+ const xmlChar *lang);
XMLPUBFUN void XMLCALL
- xmlNodeSetSpacePreserve (xmlNodePtr cur,
- int val);
+xmlNodeSetSpacePreserve (xmlNodePtr cur,
+ int val);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetBase (xmlDocPtr doc,
- xmlNodePtr cur);
+xmlNodeGetBase (xmlDocPtr doc,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN void XMLCALL
- xmlNodeSetBase (xmlNodePtr cur,
- const xmlChar *uri);
+xmlNodeSetBase (xmlNodePtr cur,
+ const xmlChar *uri);
#endif
/*
* Removing content.
*/
XMLPUBFUN int XMLCALL
- xmlRemoveProp (xmlAttrPtr cur);
+xmlRemoveProp (xmlAttrPtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int XMLCALL
- xmlUnsetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name);
+xmlUnsetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name);
XMLPUBFUN int XMLCALL
- xmlUnsetProp (xmlNodePtr node,
- const xmlChar *name);
+xmlUnsetProp (xmlNodePtr node,
+ const xmlChar *name);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Internal, don't use.
*/
XMLPUBFUN void XMLCALL
- xmlBufferWriteCHAR (xmlBufferPtr buf,
- const xmlChar *string);
+xmlBufferWriteCHAR (xmlBufferPtr buf,
+ const xmlChar *string);
XMLPUBFUN void XMLCALL
- xmlBufferWriteChar (xmlBufferPtr buf,
- const char *string);
+xmlBufferWriteChar (xmlBufferPtr buf,
+ const char *string);
XMLPUBFUN void XMLCALL
- xmlBufferWriteQuotedString(xmlBufferPtr buf,
- const xmlChar *string);
+xmlBufferWriteQuotedString(xmlBufferPtr buf,
+ const xmlChar *string);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlAttrPtr attr,
- const xmlChar *string);
+ xmlDocPtr doc,
+ xmlAttrPtr attr,
+ const xmlChar *string);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_TREE_ENABLED
@@ -1135,8 +1135,8 @@ XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
* Namespace handling.
*/
XMLPUBFUN int XMLCALL
- xmlReconciliateNs (xmlDocPtr doc,
- xmlNodePtr tree);
+xmlReconciliateNs (xmlDocPtr doc,
+ xmlNodePtr tree);
#endif
#ifdef LIBXML_OUTPUT_ENABLED
@@ -1144,137 +1144,137 @@ XMLPUBFUN int XMLCALL
* Saving.
*/
XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
+xmlDocDumpFormatMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
XMLPUBFUN void XMLCALL
- xmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
+xmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
XMLPUBFUN void XMLCALL
- xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding);
+xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding);
XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding,
- int format);
+xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding,
+ int format);
XMLPUBFUN int XMLCALL
- xmlDocFormatDump (FILE *f,
- xmlDocPtr cur,
- int format);
+xmlDocFormatDump (FILE *f,
+ xmlDocPtr cur,
+ int format);
XMLPUBFUN int XMLCALL
- xmlDocDump (FILE *f,
- xmlDocPtr cur);
+xmlDocDump (FILE *f,
+ xmlDocPtr cur);
XMLPUBFUN void XMLCALL
- xmlElemDump (FILE *f,
- xmlDocPtr doc,
- xmlNodePtr cur);
+xmlElemDump (FILE *f,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlSaveFile (const char *filename,
- xmlDocPtr cur);
+xmlSaveFile (const char *filename,
+ xmlDocPtr cur);
XMLPUBFUN int XMLCALL
- xmlSaveFormatFile (const char *filename,
- xmlDocPtr cur,
- int format);
+xmlSaveFormatFile (const char *filename,
+ xmlDocPtr cur,
+ int format);
XMLPUBFUN size_t XMLCALL
- xmlBufNodeDump (xmlBufPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format);
+xmlBufNodeDump (xmlBufPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format);
XMLPUBFUN int XMLCALL
- xmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format);
+xmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format);
XMLPUBFUN int XMLCALL
- xmlSaveFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
+xmlSaveFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN void XMLCALL
- xmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format,
- const char *encoding);
+xmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- xmlSaveFormatFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+xmlSaveFormatFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
XMLPUBFUN int XMLCALL
- xmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
+xmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* XHTML
*/
XMLPUBFUN int XMLCALL
- xmlIsXHTML (const xmlChar *systemID,
- const xmlChar *publicID);
+xmlIsXHTML (const xmlChar *systemID,
+ const xmlChar *publicID);
/*
* Compression.
*/
XMLPUBFUN int XMLCALL
- xmlGetDocCompressMode (xmlDocPtr doc);
+xmlGetDocCompressMode (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSetDocCompressMode (xmlDocPtr doc,
- int mode);
+xmlSetDocCompressMode (xmlDocPtr doc,
+ int mode);
XMLPUBFUN int XMLCALL
- xmlGetCompressMode (void);
+xmlGetCompressMode (void);
XMLPUBFUN void XMLCALL
- xmlSetCompressMode (int mode);
+xmlSetCompressMode (int mode);
/*
* DOM-wrapper helper functions.
*/
XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL
- xmlDOMWrapNewCtxt (void);
+xmlDOMWrapNewCtxt (void);
XMLPUBFUN void XMLCALL
- xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
+xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr elem,
- int options);
+xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
+ xmlNodePtr elem,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int options);
+xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr node,
- int options);
+xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr node,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlNodePtr *clonedNode,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int deep,
- int options);
+xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlNodePtr *clonedNode,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int deep,
+ int options);
#ifdef LIBXML_TREE_ENABLED
/*
@@ -1282,15 +1282,15 @@ XMLPUBFUN int XMLCALL
* traversal.
*/
XMLPUBFUN unsigned long XMLCALL
- xmlChildElementCount (xmlNodePtr parent);
+xmlChildElementCount (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNextElementSibling (xmlNodePtr node);
+xmlNextElementSibling (xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlFirstElementChild (xmlNodePtr parent);
+xmlFirstElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlLastElementChild (xmlNodePtr parent);
+xmlLastElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlPreviousElementSibling (xmlNodePtr node);
+xmlPreviousElementSibling (xmlNodePtr node);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/uri.h b/thirdparties/common/include/libxml2/libxml/uri.h
index db48262..599c3e3 100755
--- a/thirdparties/common/include/libxml2/libxml/uri.h
+++ b/thirdparties/common/include/libxml2/libxml/uri.h
@@ -50,43 +50,43 @@ struct _xmlURI {
* xmlNodePtr cur);
*/
XMLPUBFUN xmlURIPtr XMLCALL
- xmlCreateURI (void);
+xmlCreateURI (void);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildRelativeURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildRelativeURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURI (const char *str);
+xmlParseURI (const char *str);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURIRaw (const char *str,
- int raw);
+xmlParseURIRaw (const char *str,
+ int raw);
XMLPUBFUN int XMLCALL
- xmlParseURIReference (xmlURIPtr uri,
- const char *str);
+xmlParseURIReference (xmlURIPtr uri,
+ const char *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlSaveUri (xmlURIPtr uri);
+xmlSaveUri (xmlURIPtr uri);
XMLPUBFUN void XMLCALL
- xmlPrintURI (FILE *stream,
- xmlURIPtr uri);
+xmlPrintURI (FILE *stream,
+ xmlURIPtr uri);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscapeStr (const xmlChar *str,
- const xmlChar *list);
+xmlURIEscapeStr (const xmlChar *str,
+ const xmlChar *list);
XMLPUBFUN char * XMLCALL
- xmlURIUnescapeString (const char *str,
- int len,
- char *target);
+xmlURIUnescapeString (const char *str,
+ int len,
+ char *target);
XMLPUBFUN int XMLCALL
- xmlNormalizeURIPath (char *path);
+xmlNormalizeURIPath (char *path);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscape (const xmlChar *str);
+xmlURIEscape (const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlFreeURI (xmlURIPtr uri);
+xmlFreeURI (xmlURIPtr uri);
XMLPUBFUN xmlChar* XMLCALL
- xmlCanonicPath (const xmlChar *path);
+xmlCanonicPath (const xmlChar *path);
XMLPUBFUN xmlChar* XMLCALL
- xmlPathToURI (const xmlChar *path);
+xmlPathToURI (const xmlChar *path);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/valid.h b/thirdparties/common/include/libxml2/libxml/valid.h
index 2bc7b38..b67a9d6 100755
--- a/thirdparties/common/include/libxml2/libxml/valid.h
+++ b/thirdparties/common/include/libxml2/libxml/valid.h
@@ -40,8 +40,8 @@ typedef xmlValidState *xmlValidStatePtr;
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlValidityWarningFunc:
@@ -55,8 +55,8 @@ typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
#ifdef IN_LIBXML
/**
@@ -151,155 +151,155 @@ typedef xmlRefTable *xmlRefTablePtr;
/* Notation */
XMLPUBFUN xmlNotationPtr XMLCALL
- xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *PublicID,
- const xmlChar *SystemID);
+xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *PublicID,
+ const xmlChar *SystemID);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNotationTablePtr XMLCALL
- xmlCopyNotationTable (xmlNotationTablePtr table);
+xmlCopyNotationTable (xmlNotationTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeNotationTable (xmlNotationTablePtr table);
+xmlFreeNotationTable (xmlNotationTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpNotationDecl (xmlBufferPtr buf,
- xmlNotationPtr nota);
+xmlDumpNotationDecl (xmlBufferPtr buf,
+ xmlNotationPtr nota);
XMLPUBFUN void XMLCALL
- xmlDumpNotationTable (xmlBufferPtr buf,
- xmlNotationTablePtr table);
+xmlDumpNotationTable (xmlBufferPtr buf,
+ xmlNotationTablePtr table);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Element Content */
/* the non Doc version are being deprecated */
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewElementContent (const xmlChar *name,
- xmlElementContentType type);
+xmlNewElementContent (const xmlChar *name,
+ xmlElementContentType type);
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyElementContent (xmlElementContentPtr content);
+xmlCopyElementContent (xmlElementContentPtr content);
XMLPUBFUN void XMLCALL
- xmlFreeElementContent (xmlElementContentPtr cur);
+xmlFreeElementContent (xmlElementContentPtr cur);
/* the new versions with doc argument */
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewDocElementContent (xmlDocPtr doc,
- const xmlChar *name,
- xmlElementContentType type);
+xmlNewDocElementContent (xmlDocPtr doc,
+ const xmlChar *name,
+ xmlElementContentType type);
XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr content);
+xmlCopyDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr content);
XMLPUBFUN void XMLCALL
- xmlFreeDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr cur);
+xmlFreeDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr cur);
XMLPUBFUN void XMLCALL
- xmlSnprintfElementContent(char *buf,
- int size,
- xmlElementContentPtr content,
- int englob);
+xmlSnprintfElementContent(char *buf,
+ int size,
+ xmlElementContentPtr content,
+ int englob);
#ifdef LIBXML_OUTPUT_ENABLED
/* DEPRECATED */
XMLPUBFUN void XMLCALL
- xmlSprintfElementContent(char *buf,
- xmlElementContentPtr content,
- int englob);
+xmlSprintfElementContent(char *buf,
+ xmlElementContentPtr content,
+ int englob);
#endif /* LIBXML_OUTPUT_ENABLED */
/* DEPRECATED */
/* Element */
XMLPUBFUN xmlElementPtr XMLCALL
- xmlAddElementDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- xmlElementTypeVal type,
- xmlElementContentPtr content);
+xmlAddElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ xmlElementTypeVal type,
+ xmlElementContentPtr content);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlElementTablePtr XMLCALL
- xmlCopyElementTable (xmlElementTablePtr table);
+xmlCopyElementTable (xmlElementTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeElementTable (xmlElementTablePtr table);
+xmlFreeElementTable (xmlElementTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpElementTable (xmlBufferPtr buf,
- xmlElementTablePtr table);
+xmlDumpElementTable (xmlBufferPtr buf,
+ xmlElementTablePtr table);
XMLPUBFUN void XMLCALL
- xmlDumpElementDecl (xmlBufferPtr buf,
- xmlElementPtr elem);
+xmlDumpElementDecl (xmlBufferPtr buf,
+ xmlElementPtr elem);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */
XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCreateEnumeration (const xmlChar *name);
+xmlCreateEnumeration (const xmlChar *name);
XMLPUBFUN void XMLCALL
- xmlFreeEnumeration (xmlEnumerationPtr cur);
+xmlFreeEnumeration (xmlEnumerationPtr cur);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCopyEnumeration (xmlEnumerationPtr cur);
+xmlCopyEnumeration (xmlEnumerationPtr cur);
#endif /* LIBXML_TREE_ENABLED */
/* Attribute */
XMLPUBFUN xmlAttributePtr XMLCALL
- xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *ns,
- xmlAttributeType type,
- xmlAttributeDefault def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *ns,
+ xmlAttributeType type,
+ xmlAttributeDefault def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlAttributeTablePtr XMLCALL
- xmlCopyAttributeTable (xmlAttributeTablePtr table);
+xmlCopyAttributeTable (xmlAttributeTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeAttributeTable (xmlAttributeTablePtr table);
+xmlFreeAttributeTable (xmlAttributeTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpAttributeTable (xmlBufferPtr buf,
- xmlAttributeTablePtr table);
+xmlDumpAttributeTable (xmlBufferPtr buf,
+ xmlAttributeTablePtr table);
XMLPUBFUN void XMLCALL
- xmlDumpAttributeDecl (xmlBufferPtr buf,
- xmlAttributePtr attr);
+xmlDumpAttributeDecl (xmlBufferPtr buf,
+ xmlAttributePtr attr);
#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */
XMLPUBFUN xmlIDPtr XMLCALL
- xmlAddID (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
+xmlAddID (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
XMLPUBFUN void XMLCALL
- xmlFreeIDTable (xmlIDTablePtr table);
+xmlFreeIDTable (xmlIDTablePtr table);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlGetID (xmlDocPtr doc,
- const xmlChar *ID);
+xmlGetID (xmlDocPtr doc,
+ const xmlChar *ID);
XMLPUBFUN int XMLCALL
- xmlIsID (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
+xmlIsID (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
XMLPUBFUN int XMLCALL
- xmlRemoveID (xmlDocPtr doc,
- xmlAttrPtr attr);
+xmlRemoveID (xmlDocPtr doc,
+ xmlAttrPtr attr);
/* IDREFs */
XMLPUBFUN xmlRefPtr XMLCALL
- xmlAddRef (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
+xmlAddRef (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
XMLPUBFUN void XMLCALL
- xmlFreeRefTable (xmlRefTablePtr table);
+xmlFreeRefTable (xmlRefTablePtr table);
XMLPUBFUN int XMLCALL
- xmlIsRef (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
+xmlIsRef (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
XMLPUBFUN int XMLCALL
- xmlRemoveRef (xmlDocPtr doc,
- xmlAttrPtr attr);
+xmlRemoveRef (xmlDocPtr doc,
+ xmlAttrPtr attr);
XMLPUBFUN xmlListPtr XMLCALL
- xmlGetRefs (xmlDocPtr doc,
- const xmlChar *ID);
+xmlGetRefs (xmlDocPtr doc,
+ const xmlChar *ID);
/**
* The public function calls related to validity checking.
@@ -307,149 +307,149 @@ XMLPUBFUN xmlListPtr XMLCALL
#ifdef LIBXML_VALID_ENABLED
/* Allocate/Release Validation Contexts */
XMLPUBFUN xmlValidCtxtPtr XMLCALL
- xmlNewValidCtxt(void);
+xmlNewValidCtxt(void);
XMLPUBFUN void XMLCALL
- xmlFreeValidCtxt(xmlValidCtxtPtr);
+xmlFreeValidCtxt(xmlValidCtxtPtr);
XMLPUBFUN int XMLCALL
- xmlValidateRoot (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlValidateRoot (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlElementPtr elem);
+xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlElementPtr elem);
XMLPUBFUN xmlChar * XMLCALL
- xmlValidNormalizeAttributeValue(xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
+xmlValidNormalizeAttributeValue(xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
XMLPUBFUN xmlChar * XMLCALL
- xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
+xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlAttributePtr attr);
+xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlAttributePtr attr);
XMLPUBFUN int XMLCALL
- xmlValidateAttributeValue(xmlAttributeType type,
- const xmlChar *value);
+xmlValidateAttributeValue(xmlAttributeType type,
+ const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNotationPtr nota);
+xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNotationPtr nota);
XMLPUBFUN int XMLCALL
- xmlValidateDtd (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlDtdPtr dtd);
+xmlValidateDtd (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlDtdPtr dtd);
XMLPUBFUN int XMLCALL
- xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlValidateDocument (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlValidateDocument (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlValidateElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlValidateElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlValidateOneElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlValidateOneElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr,
- const xmlChar *value);
+xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr,
+ const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *prefix,
- xmlNsPtr ns,
- const xmlChar *value);
+xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *prefix,
+ xmlNsPtr ns,
+ const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
#endif /* LIBXML_VALID_ENABLED */
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int XMLCALL
- xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *notationName);
+xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *notationName);
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
XMLPUBFUN int XMLCALL
- xmlIsMixedElement (xmlDocPtr doc,
- const xmlChar *name);
+xmlIsMixedElement (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name);
+xmlGetDtdAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name);
XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *prefix);
+xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *prefix);
XMLPUBFUN xmlNotationPtr XMLCALL
- xmlGetDtdNotationDesc (xmlDtdPtr dtd,
- const xmlChar *name);
+xmlGetDtdNotationDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdQElementDesc (xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *prefix);
+xmlGetDtdQElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *prefix);
XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdElementDesc (xmlDtdPtr dtd,
- const xmlChar *name);
+xmlGetDtdElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN int XMLCALL
- xmlValidGetPotentialChildren(xmlElementContent *ctree,
- const xmlChar **names,
- int *len,
- int max);
+xmlValidGetPotentialChildren(xmlElementContent *ctree,
+ const xmlChar **names,
+ int *len,
+ int max);
XMLPUBFUN int XMLCALL
- xmlValidGetValidElements(xmlNode *prev,
- xmlNode *next,
- const xmlChar **names,
- int max);
+xmlValidGetValidElements(xmlNode *prev,
+ xmlNode *next,
+ const xmlChar **names,
+ int max);
XMLPUBFUN int XMLCALL
- xmlValidateNameValue (const xmlChar *value);
+xmlValidateNameValue (const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateNamesValue (const xmlChar *value);
+xmlValidateNamesValue (const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateNmtokenValue (const xmlChar *value);
+xmlValidateNmtokenValue (const xmlChar *value);
XMLPUBFUN int XMLCALL
- xmlValidateNmtokensValue(const xmlChar *value);
+xmlValidateNmtokensValue(const xmlChar *value);
#ifdef LIBXML_REGEXP_ENABLED
/*
* Validation based on the regexp support
*/
XMLPUBFUN int XMLCALL
- xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
- xmlElementPtr elem);
+xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
+ xmlElementPtr elem);
XMLPUBFUN int XMLCALL
- xmlValidatePushElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
+xmlValidatePushElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
XMLPUBFUN int XMLCALL
- xmlValidatePushCData (xmlValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
+xmlValidatePushCData (xmlValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
XMLPUBFUN int XMLCALL
- xmlValidatePopElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
+xmlValidatePopElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
#endif /* LIBXML_REGEXP_ENABLED */
#endif /* LIBXML_VALID_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/common/include/libxml2/libxml/xinclude.h b/thirdparties/common/include/libxml2/libxml/xinclude.h
index 863ab25..e6b79cb 100755
--- a/thirdparties/common/include/libxml2/libxml/xinclude.h
+++ b/thirdparties/common/include/libxml2/libxml/xinclude.h
@@ -90,36 +90,36 @@ typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
* standalone processing
*/
XMLPUBFUN int XMLCALL
- xmlXIncludeProcess (xmlDocPtr doc);
+xmlXIncludeProcess (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlags (xmlDocPtr doc,
- int flags);
+xmlXIncludeProcessFlags (xmlDocPtr doc,
+ int flags);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlagsData(xmlDocPtr doc,
- int flags,
- void *data);
+xmlXIncludeProcessFlagsData(xmlDocPtr doc,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
- int flags,
- void *data);
+xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTree (xmlNodePtr tree);
+xmlXIncludeProcessTree (xmlNodePtr tree);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
- int flags);
+xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
+ int flags);
/*
* contextual processing
*/
XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL
- xmlXIncludeNewContext (xmlDocPtr doc);
+xmlXIncludeNewContext (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
- int flags);
+xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
+ int flags);
XMLPUBFUN void XMLCALL
- xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
+xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
- xmlNodePtr tree);
+xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
+ xmlNodePtr tree);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/xlink.h b/thirdparties/common/include/libxml2/libxml/xlink.h
index a209a99..adf3fc5 100755
--- a/thirdparties/common/include/libxml2/libxml/xlink.h
+++ b/thirdparties/common/include/libxml2/libxml/xlink.h
@@ -80,10 +80,10 @@ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
*/
typedef void
(*xlinkSimpleLinkFunk) (void *ctx,
- xmlNodePtr node,
- const xlinkHRef href,
- const xlinkRole role,
- const xlinkTitle title);
+ xmlNodePtr node,
+ const xlinkHRef href,
+ const xlinkRole role,
+ const xlinkTitle title);
/**
* xlinkExtendedLinkFunk:
@@ -105,18 +105,18 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkFunk)(void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbArcs,
- const xlinkRole *from,
- const xlinkRole *to,
- xlinkShow *show,
- xlinkActuate *actuate,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbArcs,
+ const xlinkRole *from,
+ const xlinkRole *to,
+ xlinkShow *show,
+ xlinkActuate *actuate,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* xlinkExtendedLinkSetFunk:
@@ -133,13 +133,13 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkSetFunk) (void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* This is the structure containing a set of Links detection callbacks.
@@ -161,24 +161,24 @@ struct _xlinkHandler {
*/
XMLPUBFUN xlinkNodeDetectFunc XMLCALL
- xlinkGetDefaultDetect (void);
+xlinkGetDefaultDetect (void);
XMLPUBFUN void XMLCALL
- xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
+xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
/*
* Routines to set/get the default handlers.
*/
XMLPUBFUN xlinkHandlerPtr XMLCALL
- xlinkGetDefaultHandler (void);
+xlinkGetDefaultHandler (void);
XMLPUBFUN void XMLCALL
- xlinkSetDefaultHandler (xlinkHandlerPtr handler);
+xlinkSetDefaultHandler (xlinkHandlerPtr handler);
/*
* Link detection module itself.
*/
XMLPUBFUN xlinkType XMLCALL
- xlinkIsLink (xmlDocPtr doc,
- xmlNodePtr node);
+xlinkIsLink (xmlDocPtr doc,
+ xmlNodePtr node);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlIO.h b/thirdparties/common/include/libxml2/libxml/xmlIO.h
index 6c241a8..7ddba9a 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlIO.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlIO.h
@@ -98,7 +98,7 @@ typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
* Returns the number of bytes written or -1 in case of error
*/
typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
- int len);
+ int len);
/**
* xmlOutputCloseCallback:
* @context: an Output context
@@ -156,191 +156,191 @@ struct _xmlOutputBuffer {
* Interfaces for input
*/
XMLPUBFUN void XMLCALL
- xmlCleanupInputCallbacks (void);
+xmlCleanupInputCallbacks (void);
XMLPUBFUN int XMLCALL
- xmlPopInputCallbacks (void);
+xmlPopInputCallbacks (void);
XMLPUBFUN void XMLCALL
- xmlRegisterDefaultInputCallbacks (void);
+xmlRegisterDefaultInputCallbacks (void);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlAllocParserInputBuffer (xmlCharEncoding enc);
+xmlAllocParserInputBuffer (xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFilename (const char *URI,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFilename (const char *URI,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFile (FILE *file,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFile (FILE *file,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFd (int fd,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFd (int fd,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateMem (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateMem (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateStatic (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateStatic (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
- xmlParserInputBufferRead (xmlParserInputBufferPtr in,
- int len);
+xmlParserInputBufferRead (xmlParserInputBufferPtr in,
+ int len);
XMLPUBFUN int XMLCALL
- xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
- int len);
+xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
+ int len);
XMLPUBFUN int XMLCALL
- xmlParserInputBufferPush (xmlParserInputBufferPtr in,
- int len,
- const char *buf);
+xmlParserInputBufferPush (xmlParserInputBufferPtr in,
+ int len,
+ const char *buf);
XMLPUBFUN void XMLCALL
- xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
+xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
XMLPUBFUN char * XMLCALL
- xmlParserGetDirectory (const char *filename);
+xmlParserGetDirectory (const char *filename);
XMLPUBFUN int XMLCALL
- xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
- xmlInputOpenCallback openFunc,
- xmlInputReadCallback readFunc,
- xmlInputCloseCallback closeFunc);
+xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
+ xmlInputOpenCallback openFunc,
+ xmlInputReadCallback readFunc,
+ xmlInputCloseCallback closeFunc);
xmlParserInputBufferPtr
- __xmlParserInputBufferCreateFilename(const char *URI,
- xmlCharEncoding enc);
+__xmlParserInputBufferCreateFilename(const char *URI,
+ xmlCharEncoding enc);
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Interfaces for output
*/
XMLPUBFUN void XMLCALL
- xmlCleanupOutputCallbacks (void);
+xmlCleanupOutputCallbacks (void);
XMLPUBFUN void XMLCALL
- xmlRegisterDefaultOutputCallbacks(void);
+xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
+xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFilename (const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+xmlOutputBufferCreateFilename (const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFile (FILE *file,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFile (FILE *file,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFd (int fd,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFd (int fd,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
- xmlOutputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
+ xmlOutputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncodingHandlerPtr encoder);
/* Couple of APIs to get the output without digging into the buffers */
XMLPUBFUN const xmlChar * XMLCALL
- xmlOutputBufferGetContent (xmlOutputBufferPtr out);
+xmlOutputBufferGetContent (xmlOutputBufferPtr out);
XMLPUBFUN size_t XMLCALL
- xmlOutputBufferGetSize (xmlOutputBufferPtr out);
+xmlOutputBufferGetSize (xmlOutputBufferPtr out);
XMLPUBFUN int XMLCALL
- xmlOutputBufferWrite (xmlOutputBufferPtr out,
- int len,
- const char *buf);
+xmlOutputBufferWrite (xmlOutputBufferPtr out,
+ int len,
+ const char *buf);
XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteString (xmlOutputBufferPtr out,
- const char *str);
+xmlOutputBufferWriteString (xmlOutputBufferPtr out,
+ const char *str);
XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
- const xmlChar *str,
- xmlCharEncodingOutputFunc escaping);
+xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
+ const xmlChar *str,
+ xmlCharEncodingOutputFunc escaping);
XMLPUBFUN int XMLCALL
- xmlOutputBufferFlush (xmlOutputBufferPtr out);
+xmlOutputBufferFlush (xmlOutputBufferPtr out);
XMLPUBFUN int XMLCALL
- xmlOutputBufferClose (xmlOutputBufferPtr out);
+xmlOutputBufferClose (xmlOutputBufferPtr out);
XMLPUBFUN int XMLCALL
- xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
- xmlOutputOpenCallback openFunc,
- xmlOutputWriteCallback writeFunc,
- xmlOutputCloseCallback closeFunc);
+xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
+ xmlOutputOpenCallback openFunc,
+ xmlOutputWriteCallback writeFunc,
+ xmlOutputCloseCallback closeFunc);
xmlOutputBufferPtr
- __xmlOutputBufferCreateFilename(const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+__xmlOutputBufferCreateFilename(const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
#ifdef LIBXML_HTTP_ENABLED
/* This function only exists if HTTP support built into the library */
XMLPUBFUN void XMLCALL
- xmlRegisterHTTPPostCallbacks (void );
+xmlRegisterHTTPPostCallbacks (void );
#endif /* LIBXML_HTTP_ENABLED */
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr ret);
+xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr ret);
/*
* A predefined entity loader disabling network accesses
*/
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNoNetExternalEntityLoader (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+xmlNoNetExternalEntityLoader (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
/*
* xmlNormalizeWindowsPath is obsolete, don't use it.
* Check xmlCanonicPath in uri.h for a better alternative.
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlNormalizeWindowsPath (const xmlChar *path);
+xmlNormalizeWindowsPath (const xmlChar *path);
XMLPUBFUN int XMLCALL
- xmlCheckFilename (const char *path);
+xmlCheckFilename (const char *path);
/**
* Default 'file://' protocol callbacks
*/
XMLPUBFUN int XMLCALL
- xmlFileMatch (const char *filename);
+xmlFileMatch (const char *filename);
XMLPUBFUN void * XMLCALL
- xmlFileOpen (const char *filename);
+xmlFileOpen (const char *filename);
XMLPUBFUN int XMLCALL
- xmlFileRead (void * context,
- char * buffer,
- int len);
+xmlFileRead (void * context,
+ char * buffer,
+ int len);
XMLPUBFUN int XMLCALL
- xmlFileClose (void * context);
+xmlFileClose (void * context);
/**
* Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_ENABLED
XMLPUBFUN int XMLCALL
- xmlIOHTTPMatch (const char *filename);
+xmlIOHTTPMatch (const char *filename);
XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpen (const char *filename);
+xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpenW (const char * post_uri,
- int compression );
+xmlIOHTTPOpenW (const char * post_uri,
+ int compression );
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL
- xmlIOHTTPRead (void * context,
- char * buffer,
- int len);
+xmlIOHTTPRead (void * context,
+ char * buffer,
+ int len);
XMLPUBFUN int XMLCALL
- xmlIOHTTPClose (void * context);
+xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */
/**
@@ -348,15 +348,15 @@ XMLPUBFUN int XMLCALL
*/
#ifdef LIBXML_FTP_ENABLED
XMLPUBFUN int XMLCALL
- xmlIOFTPMatch (const char *filename);
+xmlIOFTPMatch (const char *filename);
XMLPUBFUN void * XMLCALL
- xmlIOFTPOpen (const char *filename);
+xmlIOFTPOpen (const char *filename);
XMLPUBFUN int XMLCALL
- xmlIOFTPRead (void * context,
- char * buffer,
- int len);
+xmlIOFTPRead (void * context,
+ char * buffer,
+ int len);
XMLPUBFUN int XMLCALL
- xmlIOFTPClose (void * context);
+xmlIOFTPClose (void * context);
#endif /* LIBXML_FTP_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/common/include/libxml2/libxml/xmlautomata.h b/thirdparties/common/include/libxml2/libxml/xmlautomata.h
index bf1b131..1a49117 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlautomata.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlautomata.h
@@ -41,100 +41,100 @@ typedef xmlAutomataState *xmlAutomataStatePtr;
* Building API
*/
XMLPUBFUN xmlAutomataPtr XMLCALL
- xmlNewAutomata (void);
+xmlNewAutomata (void);
XMLPUBFUN void XMLCALL
- xmlFreeAutomata (xmlAutomataPtr am);
+xmlFreeAutomata (xmlAutomataPtr am);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataGetInitState (xmlAutomataPtr am);
+xmlAutomataGetInitState (xmlAutomataPtr am);
XMLPUBFUN int XMLCALL
- xmlAutomataSetFinalState (xmlAutomataPtr am,
- xmlAutomataStatePtr state);
+xmlAutomataSetFinalState (xmlAutomataPtr am,
+ xmlAutomataStatePtr state);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewState (xmlAutomataPtr am);
+xmlAutomataNewState (xmlAutomataPtr am);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- void *data);
+xmlAutomataNewTransition (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
+xmlAutomataNewTransition2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewNegTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
+xmlAutomataNewNegTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
+xmlAutomataNewCountTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
+xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
+xmlAutomataNewOnceTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
+xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewAllTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int lax);
+xmlAutomataNewAllTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int lax);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewEpsilon (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to);
+xmlAutomataNewEpsilon (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountedTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
+xmlAutomataNewCountedTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCounterTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
+xmlAutomataNewCounterTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
XMLPUBFUN int XMLCALL
- xmlAutomataNewCounter (xmlAutomataPtr am,
- int min,
- int max);
+xmlAutomataNewCounter (xmlAutomataPtr am,
+ int min,
+ int max);
XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlAutomataCompile (xmlAutomataPtr am);
+xmlAutomataCompile (xmlAutomataPtr am);
XMLPUBFUN int XMLCALL
- xmlAutomataIsDeterminist (xmlAutomataPtr am);
+xmlAutomataIsDeterminist (xmlAutomataPtr am);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlerror.h b/thirdparties/common/include/libxml2/libxml/xmlerror.h
index 537a396..48fd444 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlerror.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlerror.h
@@ -26,7 +26,8 @@ typedef enum {
XML_ERR_WARNING = 1, /* A simple warning */
XML_ERR_ERROR = 2, /* A recoverable error */
XML_ERR_FATAL = 3 /* A fatal error */
-} xmlErrorLevel;
+}
+xmlErrorLevel;
/**
* xmlErrorDomain:
@@ -843,8 +844,8 @@ typedef enum {
* no parsing or validity context available .
*/
typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlStructuredErrorFunc:
* @userData: user provided data for the error callback
@@ -860,84 +861,84 @@ typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr erro
* xmlGenericError and xmlGenericErrorContext.
*/
XMLPUBFUN void XMLCALL
- xmlSetGenericErrorFunc (void *ctx,
- xmlGenericErrorFunc handler);
+xmlSetGenericErrorFunc (void *ctx,
+ xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
- initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
+initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
XMLPUBFUN void XMLCALL
- xmlSetStructuredErrorFunc (void *ctx,
- xmlStructuredErrorFunc handler);
+xmlSetStructuredErrorFunc (void *ctx,
+ xmlStructuredErrorFunc handler);
/*
* Default message routines used by SAX and Valid context for error
* and warning reporting.
*/
XMLPUBFUN void XMLCDECL
- xmlParserError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileInfo (xmlParserInputPtr input);
+xmlParserPrintFileInfo (xmlParserInputPtr input);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileContext (xmlParserInputPtr input);
+xmlParserPrintFileContext (xmlParserInputPtr input);
/*
* Extended error information routines
*/
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlGetLastError (void);
+xmlGetLastError (void);
XMLPUBFUN void XMLCALL
- xmlResetLastError (void);
+xmlResetLastError (void);
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlCtxtGetLastError (void *ctx);
+xmlCtxtGetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlCtxtResetLastError (void *ctx);
+xmlCtxtResetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlResetError (xmlErrorPtr err);
+xmlResetError (xmlErrorPtr err);
XMLPUBFUN int XMLCALL
- xmlCopyError (xmlErrorPtr from,
- xmlErrorPtr to);
+xmlCopyError (xmlErrorPtr from,
+ xmlErrorPtr to);
#ifdef IN_LIBXML
/*
* Internal callback reporting routine
*/
XMLPUBFUN void XMLCALL
- __xmlRaiseError (xmlStructuredErrorFunc schannel,
- xmlGenericErrorFunc channel,
- void *data,
- void *ctx,
- void *node,
- int domain,
- int code,
- xmlErrorLevel level,
- const char *file,
- int line,
- const char *str1,
- const char *str2,
- const char *str3,
- int int1,
- int col,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(16,17);
+__xmlRaiseError (xmlStructuredErrorFunc schannel,
+ xmlGenericErrorFunc channel,
+ void *data,
+ void *ctx,
+ void *node,
+ int domain,
+ int code,
+ xmlErrorLevel level,
+ const char *file,
+ int line,
+ const char *str1,
+ const char *str2,
+ const char *str3,
+ int int1,
+ int col,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(16,17);
XMLPUBFUN void XMLCALL
- __xmlSimpleError (int domain,
- int code,
- xmlNodePtr node,
- const char *msg,
- const char *extra);
+__xmlSimpleError (int domain,
+ int code,
+ xmlNodePtr node,
+ const char *msg,
+ const char *extra);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlexports.h b/thirdparties/common/include/libxml2/libxml/xmlexports.h
index 2c79f81..864c3d9 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlexports.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlexports.h
@@ -52,104 +52,104 @@
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #if defined(LIBXML_FASTCALL)
- #define XMLCALL __fastcall
- #else
- #define XMLCALL __cdecl
- #endif
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#if defined(LIBXML_FASTCALL)
+#define XMLCALL __fastcall
+#else
+#define XMLCALL __cdecl
+#endif
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport) extern
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- /*
- * if defined(IN_LIBXML) this raises problems on mingw with msys
- * _imp__xmlFree listed as missing. Try to workaround the problem
- * by also making that declaration when compiling client code.
- */
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+/*
+ * if defined(IN_LIBXML) this raises problems on mingw with msys
+ * _imp__xmlFree listed as missing. Try to workaround the problem
+ * by also making that declaration when compiling client code.
+ */
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport) extern
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Cygwin platform, GNU compiler */
#if defined(_WIN32) && defined(__CYGWIN__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
#endif
/* Compatibility */
diff --git a/thirdparties/common/include/libxml2/libxml/xmlmemory.h b/thirdparties/common/include/libxml2/libxml/xmlmemory.h
index 17e375a..58e6e5c 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlmemory.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlmemory.h
@@ -101,70 +101,70 @@ LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup;
* allocations useful for garbage collected memory allocators
*/
XMLPUBFUN int XMLCALL
- xmlMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlMallocFunc mallocAtomicFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlGcMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlMallocFunc mallocAtomicFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlMallocFunc *mallocAtomicFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlGcMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlMallocFunc *mallocAtomicFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
/*
* Initialization of the memory layer.
*/
XMLPUBFUN int XMLCALL
- xmlInitMemory (void);
+xmlInitMemory (void);
/*
* Cleanup of the memory layer.
*/
XMLPUBFUN void XMLCALL
- xmlCleanupMemory (void);
+xmlCleanupMemory (void);
/*
* These are specific to the XML debug memory wrapper.
*/
XMLPUBFUN int XMLCALL
- xmlMemUsed (void);
+xmlMemUsed (void);
XMLPUBFUN int XMLCALL
- xmlMemBlocks (void);
+xmlMemBlocks (void);
XMLPUBFUN void XMLCALL
- xmlMemDisplay (FILE *fp);
+xmlMemDisplay (FILE *fp);
XMLPUBFUN void XMLCALL
- xmlMemDisplayLast(FILE *fp, long nbBytes);
+xmlMemDisplayLast(FILE *fp, long nbBytes);
XMLPUBFUN void XMLCALL
- xmlMemShow (FILE *fp, int nr);
+xmlMemShow (FILE *fp, int nr);
XMLPUBFUN void XMLCALL
- xmlMemoryDump (void);
+xmlMemoryDump (void);
XMLPUBFUN void * XMLCALL
- xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlMemRealloc (void *ptr,size_t size);
+xmlMemRealloc (void *ptr,size_t size);
XMLPUBFUN void XMLCALL
- xmlMemFree (void *ptr);
+xmlMemFree (void *ptr);
XMLPUBFUN char * XMLCALL
- xmlMemoryStrdup (const char *str);
+xmlMemoryStrdup (const char *str);
XMLPUBFUN void * XMLCALL
- xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
+xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
XMLPUBFUN void * XMLCALL
- xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN char * XMLCALL
- xmlMemStrdupLoc (const char *str, const char *file, int line);
+xmlMemStrdupLoc (const char *str, const char *file, int line);
#ifdef DEBUG_MEMORY_LOCATION
diff --git a/thirdparties/common/include/libxml2/libxml/xmlmodule.h b/thirdparties/common/include/libxml2/libxml/xmlmodule.h
index 9667820..ef4720c 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlmodule.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlmodule.h
@@ -38,11 +38,11 @@ typedef enum {
} xmlModuleOption;
XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename,
- int options);
+ int options);
XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module,
- const char* name,
- void **result);
+ const char* name,
+ void **result);
XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module);
diff --git a/thirdparties/common/include/libxml2/libxml/xmlreader.h b/thirdparties/common/include/libxml2/libxml/xmlreader.h
index 2c99e3a..1c87e82 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlreader.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlreader.h
@@ -33,7 +33,8 @@ typedef enum {
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
XML_PARSER_SEVERITY_WARNING = 3,
XML_PARSER_SEVERITY_ERROR = 4
-} xmlParserSeverities;
+}
+xmlParserSeverities;
#ifdef LIBXML_READER_ENABLED
@@ -109,16 +110,16 @@ typedef xmlTextReader *xmlTextReaderPtr;
* Constructors & Destructor
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReader (xmlParserInputBufferPtr input,
- const char *URI);
+xmlNewTextReader (xmlParserInputBufferPtr input,
+ const char *URI);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReaderFilename(const char *URI);
+xmlNewTextReaderFilename(const char *URI);
XMLPUBFUN void XMLCALL
- xmlFreeTextReader (xmlTextReaderPtr reader);
+xmlFreeTextReader (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetup(xmlTextReaderPtr reader,
+xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options);
@@ -126,263 +127,263 @@ XMLPUBFUN int XMLCALL
* Iterators
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderRead (xmlTextReaderPtr reader);
+xmlTextReaderRead (xmlTextReaderPtr reader);
#ifdef LIBXML_WRITER_ENABLED
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
+xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
+xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
#endif
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadString (xmlTextReaderPtr reader);
+xmlTextReaderReadString (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
+xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
/*
* Attributes of the node
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
+xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderDepth (xmlTextReaderPtr reader);
+xmlTextReaderDepth (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
+xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasValue(xmlTextReaderPtr reader);
+xmlTextReaderHasValue(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsDefault (xmlTextReaderPtr reader);
+xmlTextReaderIsDefault (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
+xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNodeType (xmlTextReaderPtr reader);
+xmlTextReaderNodeType (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
+xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadState (xmlTextReaderPtr reader);
+xmlTextReaderReadState (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
+xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
+xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstName (xmlTextReaderPtr reader);
+xmlTextReaderConstName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
+xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstString (xmlTextReaderPtr reader,
- const xmlChar *str);
+xmlTextReaderConstString (xmlTextReaderPtr reader,
+ const xmlChar *str);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstValue (xmlTextReaderPtr reader);
+xmlTextReaderConstValue (xmlTextReaderPtr reader);
/*
* use the Const version of the routine for
* better performance and simpler code
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocalName (xmlTextReaderPtr reader);
+xmlTextReaderLocalName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderName (xmlTextReaderPtr reader);
+xmlTextReaderName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderPrefix (xmlTextReaderPtr reader);
+xmlTextReaderPrefix (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderValue (xmlTextReaderPtr reader);
+xmlTextReaderValue (xmlTextReaderPtr reader);
/*
* Methods of the XmlTextReader
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderClose (xmlTextReaderPtr reader);
+xmlTextReaderClose (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
- int no);
+xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
+xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
- const xmlChar *prefix);
+xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
+ const xmlChar *prefix);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
- int no);
+xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
+xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNormalization (xmlTextReaderPtr reader);
+xmlTextReaderNormalization (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
+xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
/*
* Extensions
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
- int prop,
- int value);
+xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
+ int prop,
+ int value);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
- int prop);
+xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
+ int prop);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
+xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderPreserve (xmlTextReaderPtr reader);
+xmlTextReaderPreserve (xmlTextReaderPtr reader);
#ifdef LIBXML_PATTERN_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
- const xmlChar *pattern,
- const xmlChar **namespaces);
+xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
+ const xmlChar *pattern,
+ const xmlChar **namespaces);
#endif /* LIBXML_PATTERN_ENABLED */
XMLPUBFUN xmlDocPtr XMLCALL
- xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
+xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderExpand (xmlTextReaderPtr reader);
+xmlTextReaderExpand (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNext (xmlTextReaderPtr reader);
+xmlTextReaderNext (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNextSibling (xmlTextReaderPtr reader);
+xmlTextReaderNextSibling (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsValid (xmlTextReaderPtr reader);
+xmlTextReaderIsValid (xmlTextReaderPtr reader);
#ifdef LIBXML_SCHEMAS_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
- const char *rng);
+xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
+ const char *rng);
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
- xmlRelaxNGValidCtxtPtr ctxt,
- int options);
+xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
+ xmlRelaxNGValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
- xmlRelaxNGPtr schema);
+xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
+ xmlRelaxNGPtr schema);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
- const char *xsd);
+xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
+ const char *xsd);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
- xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
+ xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetSchema (xmlTextReaderPtr reader,
- xmlSchemaPtr schema);
+xmlTextReaderSetSchema (xmlTextReaderPtr reader,
+ xmlSchemaPtr schema);
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
+xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderStandalone (xmlTextReaderPtr reader);
+xmlTextReaderStandalone (xmlTextReaderPtr reader);
/*
* Index lookup
*/
XMLPUBFUN long XMLCALL
- xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
+xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
/*
* New more complete APIs for simpler creation and reuse of readers
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderWalker (xmlDocPtr doc);
+xmlReaderWalker (xmlDocPtr doc);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForDoc (const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForDoc (const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFile (const char *filename,
- const char *encoding,
- int options);
+xmlReaderForFile (const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
-
-XMLPUBFUN int XMLCALL
- xmlReaderNewWalker (xmlTextReaderPtr reader,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlReaderNewDoc (xmlTextReaderPtr reader,
- const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFile (xmlTextReaderPtr reader,
- const char *filename,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewMemory (xmlTextReaderPtr reader,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFd (xmlTextReaderPtr reader,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewIO (xmlTextReaderPtr reader,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
+
+XMLPUBFUN int XMLCALL
+xmlReaderNewWalker (xmlTextReaderPtr reader,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlReaderNewDoc (xmlTextReaderPtr reader,
+ const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFile (xmlTextReaderPtr reader,
+ const char *filename,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewMemory (xmlTextReaderPtr reader,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFd (xmlTextReaderPtr reader,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewIO (xmlTextReaderPtr reader,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Error handling extensions
*/
@@ -398,25 +399,25 @@ typedef void * xmlTextReaderLocatorPtr;
* Signature of an error callback from a reader parser
*/
typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
- const char *msg,
- xmlParserSeverities severity,
- xmlTextReaderLocatorPtr locator);
+ const char *msg,
+ xmlParserSeverities severity,
+ xmlTextReaderLocatorPtr locator);
XMLPUBFUN int XMLCALL
- xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc f,
- void *arg);
+xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
- xmlStructuredErrorFunc f,
- void *arg);
+xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
+ xmlStructuredErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc *f,
- void **arg);
+xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc *f,
+ void **arg);
#endif /* LIBXML_READER_ENABLED */
diff --git a/thirdparties/common/include/libxml2/libxml/xmlregexp.h b/thirdparties/common/include/libxml2/libxml/xmlregexp.h
index 7009645..f81664d 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlregexp.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlregexp.h
@@ -49,16 +49,16 @@ extern "C" {
* The POSIX like API
*/
XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlRegexpCompile (const xmlChar *regexp);
+xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpExec (xmlRegexpPtr comp,
- const xmlChar *value);
+xmlRegexpExec (xmlRegexpPtr comp,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- xmlRegexpPrint (FILE *output,
- xmlRegexpPtr regexp);
+xmlRegexpPrint (FILE *output,
+ xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpIsDeterminist(xmlRegexpPtr comp);
+xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:
@@ -70,42 +70,42 @@ XMLPUBFUN int XMLCALL
* Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
- const xmlChar *token,
- void *transdata,
- void *inputdata);
+ const xmlChar *token,
+ void *transdata,
+ void *inputdata);
/*
* The progressive API
*/
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
- xmlRegNewExecCtxt (xmlRegexpPtr comp,
- xmlRegExecCallbacks callback,
- void *data);
+xmlRegNewExecCtxt (xmlRegexpPtr comp,
+ xmlRegExecCallbacks callback,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
+xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- void *data);
+xmlRegExecPushString(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- const xmlChar *value2,
- void *data);
+xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ const xmlChar *value2,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
XMLPUBFUN int XMLCALL
- xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
- const xmlChar **string,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
+ const xmlChar **string,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
#ifdef LIBXML_EXPR_ENABLED
/*
* Formal regular expression handling
@@ -117,15 +117,15 @@ typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
XMLPUBFUN void XMLCALL
- xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
+xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
XMLPUBFUN xmlExpCtxtPtr XMLCALL
- xmlExpNewCtxt (int maxNodes,
- xmlDictPtr dict);
+xmlExpNewCtxt (int maxNodes,
+ xmlDictPtr dict);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/* Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
@@ -151,67 +151,67 @@ XMLPUBVAR xmlExpNodePtr emptyExp;
* Expressions are reference counted internally
*/
XMLPUBFUN void XMLCALL
- xmlExpFree (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr);
+xmlExpFree (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr);
XMLPUBFUN void XMLCALL
- xmlExpRef (xmlExpNodePtr expr);
+xmlExpRef (xmlExpNodePtr expr);
/*
* constructors can be either manual or from a string
*/
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpParse (xmlExpCtxtPtr ctxt,
- const char *expr);
+xmlExpParse (xmlExpCtxtPtr ctxt,
+ const char *expr);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewAtom (xmlExpCtxtPtr ctxt,
- const xmlChar *name,
- int len);
+xmlExpNewAtom (xmlExpCtxtPtr ctxt,
+ const xmlChar *name,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewOr (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewOr (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewSeq (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewSeq (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewRange (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr subset,
- int min,
- int max);
+xmlExpNewRange (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr subset,
+ int min,
+ int max);
/*
* The really interesting APIs
*/
XMLPUBFUN int XMLCALL
- xmlExpIsNillable(xmlExpNodePtr expr);
+xmlExpIsNillable(xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpMaxToken (xmlExpNodePtr expr);
+xmlExpMaxToken (xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**langList,
- int len);
+xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**langList,
+ int len);
XMLPUBFUN int XMLCALL
- xmlExpGetStart (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**tokList,
- int len);
+xmlExpGetStart (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**tokList,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpStringDerive(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar *str,
- int len);
+xmlExpStringDerive(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar *str,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpExpDerive (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpExpDerive (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN int XMLCALL
- xmlExpSubsume (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpSubsume (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN void XMLCALL
- xmlExpDump (xmlBufferPtr buf,
- xmlExpNodePtr expr);
+xmlExpDump (xmlBufferPtr buf,
+ xmlExpNodePtr expr);
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlsave.h b/thirdparties/common/include/libxml2/libxml/xmlsave.h
index fb329b2..5f5407b 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlsave.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlsave.h
@@ -30,55 +30,56 @@ typedef enum {
XML_SAVE_FORMAT = 1<<0, /* format save output */
XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */
- XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
- XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
- XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
- XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
- XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
-} xmlSaveOption;
+ XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
+ XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
+ XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
+ XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
+ XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
+}
+xmlSaveOption;
typedef struct _xmlSaveCtxt xmlSaveCtxt;
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToFd (int fd,
- const char *encoding,
- int options);
+xmlSaveToFd (int fd,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToFilename (const char *filename,
- const char *encoding,
- int options);
+xmlSaveToFilename (const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToBuffer (xmlBufferPtr buffer,
- const char *encoding,
- int options);
+xmlSaveToBuffer (xmlBufferPtr buffer,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToIO (xmlOutputWriteCallback iowrite,
- xmlOutputCloseCallback ioclose,
- void *ioctx,
- const char *encoding,
- int options);
+xmlSaveToIO (xmlOutputWriteCallback iowrite,
+ xmlOutputCloseCallback ioclose,
+ void *ioctx,
+ const char *encoding,
+ int options);
XMLPUBFUN long XMLCALL
- xmlSaveDoc (xmlSaveCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlSaveDoc (xmlSaveCtxtPtr ctxt,
+ xmlDocPtr doc);
XMLPUBFUN long XMLCALL
- xmlSaveTree (xmlSaveCtxtPtr ctxt,
- xmlNodePtr node);
+xmlSaveTree (xmlSaveCtxtPtr ctxt,
+ xmlNodePtr node);
XMLPUBFUN int XMLCALL
- xmlSaveFlush (xmlSaveCtxtPtr ctxt);
+xmlSaveFlush (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSaveClose (xmlSaveCtxtPtr ctxt);
+xmlSaveClose (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
- xmlCharEncodingOutputFunc escape);
+xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
+ xmlCharEncodingOutputFunc escape);
XMLPUBFUN int XMLCALL
- xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
- xmlCharEncodingOutputFunc escape);
+xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
+ xmlCharEncodingOutputFunc escape);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libxml2/libxml/xmlschemas.h b/thirdparties/common/include/libxml2/libxml/xmlschemas.h
index 97930c7..2fc2b30 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlschemas.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlschemas.h
@@ -27,32 +27,33 @@ extern "C" {
*/
typedef enum {
XML_SCHEMAS_ERR_OK = 0,
- XML_SCHEMAS_ERR_NOROOT = 1,
- XML_SCHEMAS_ERR_UNDECLAREDELEM,
- XML_SCHEMAS_ERR_NOTTOPLEVEL,
- XML_SCHEMAS_ERR_MISSING,
- XML_SCHEMAS_ERR_WRONGELEM,
- XML_SCHEMAS_ERR_NOTYPE,
- XML_SCHEMAS_ERR_NOROLLBACK,
- XML_SCHEMAS_ERR_ISABSTRACT,
- XML_SCHEMAS_ERR_NOTEMPTY,
- XML_SCHEMAS_ERR_ELEMCONT,
- XML_SCHEMAS_ERR_HAVEDEFAULT,
- XML_SCHEMAS_ERR_NOTNILLABLE,
- XML_SCHEMAS_ERR_EXTRACONTENT,
- XML_SCHEMAS_ERR_INVALIDATTR,
- XML_SCHEMAS_ERR_INVALIDELEM,
- XML_SCHEMAS_ERR_NOTDETERMINIST,
- XML_SCHEMAS_ERR_CONSTRUCT,
- XML_SCHEMAS_ERR_INTERNAL,
- XML_SCHEMAS_ERR_NOTSIMPLE,
- XML_SCHEMAS_ERR_ATTRUNKNOWN,
- XML_SCHEMAS_ERR_ATTRINVALID,
- XML_SCHEMAS_ERR_VALUE,
- XML_SCHEMAS_ERR_FACET,
- XML_SCHEMAS_ERR_,
- XML_SCHEMAS_ERR_XXX
-} xmlSchemaValidError;
+ XML_SCHEMAS_ERR_NOROOT = 1,
+ XML_SCHEMAS_ERR_UNDECLAREDELEM,
+ XML_SCHEMAS_ERR_NOTTOPLEVEL,
+ XML_SCHEMAS_ERR_MISSING,
+ XML_SCHEMAS_ERR_WRONGELEM,
+ XML_SCHEMAS_ERR_NOTYPE,
+ XML_SCHEMAS_ERR_NOROLLBACK,
+ XML_SCHEMAS_ERR_ISABSTRACT,
+ XML_SCHEMAS_ERR_NOTEMPTY,
+ XML_SCHEMAS_ERR_ELEMCONT,
+ XML_SCHEMAS_ERR_HAVEDEFAULT,
+ XML_SCHEMAS_ERR_NOTNILLABLE,
+ XML_SCHEMAS_ERR_EXTRACONTENT,
+ XML_SCHEMAS_ERR_INVALIDATTR,
+ XML_SCHEMAS_ERR_INVALIDELEM,
+ XML_SCHEMAS_ERR_NOTDETERMINIST,
+ XML_SCHEMAS_ERR_CONSTRUCT,
+ XML_SCHEMAS_ERR_INTERNAL,
+ XML_SCHEMAS_ERR_NOTSIMPLE,
+ XML_SCHEMAS_ERR_ATTRUNKNOWN,
+ XML_SCHEMAS_ERR_ATTRINVALID,
+ XML_SCHEMAS_ERR_VALUE,
+ XML_SCHEMAS_ERR_FACET,
+ XML_SCHEMAS_ERR_,
+ XML_SCHEMAS_ERR_XXX
+}
+xmlSchemaValidError;
/*
* ATTENTION: Change xmlSchemaSetValidOptions's check
@@ -66,9 +67,9 @@ typedef enum {
*/
typedef enum {
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
- /* Default/fixed: create an attribute node
- * or an element's text node on the instance.
- */
+ /* Default/fixed: create an attribute node
+ * or an element's text node on the instance.
+ */
} xmlSchemaValidOption;
/*
@@ -93,7 +94,7 @@ typedef xmlSchema *xmlSchemaPtr;
* Signature of an error callback from an XSD validation
*/
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
- (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlSchemaValidityWarningFunc:
@@ -104,7 +105,7 @@ typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
* Signature of a warning callback from an XSD validation
*/
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc)
- (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* A schemas validation context
@@ -129,95 +130,95 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
*/
typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx,
- const char **file, unsigned long *line);
+ const char **file, unsigned long *line);
/*
* Interfaces for parsing.
*/
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewParserCtxt (const char *URL);
+xmlSchemaNewParserCtxt (const char *URL);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewMemParserCtxt (const char *buffer,
- int size);
+xmlSchemaNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
+xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc * err,
- xmlSchemaValidityWarningFunc * warn,
- void **ctx);
+xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc * err,
+ xmlSchemaValidityWarningFunc * warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaPtr XMLCALL
- xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaFree (xmlSchemaPtr schema);
+xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlSchemaDump (FILE *output,
- xmlSchemaPtr schema);
+xmlSchemaDump (FILE *output,
+ xmlSchemaPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc *err,
- xmlSchemaValidityWarningFunc *warn,
- void **ctx);
+xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc *err,
+ xmlSchemaValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN void XMLCALL
- xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
- const char *filename);
+xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
+ const char *filename);
XMLPUBFUN int XMLCALL
- xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
- xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
+xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
- xmlDocPtr instance);
+xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
+ xmlDocPtr instance);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
- xmlNodePtr elem);
+xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc,
- xmlSAXHandlerPtr sax,
- void *user_data);
+xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc,
+ xmlSAXHandlerPtr sax,
+ void *user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
- const char * filename,
- int options);
+xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
+ const char * filename,
+ int options);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
/*
* Interface to insert Schemas SAX validation in a SAX stream
@@ -226,17 +227,17 @@ typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
- xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
- xmlSAXHandlerPtr *sax,
- void **user_data);
+xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
+ xmlSAXHandlerPtr *sax,
+ void **user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
+xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
XMLPUBFUN void XMLCALL
- xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
- xmlSchemaValidityLocatorFunc f,
- void *ctxt);
+xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
+ xmlSchemaValidityLocatorFunc f,
+ void *ctxt);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlschemastypes.h b/thirdparties/common/include/libxml2/libxml/xmlschemastypes.h
index 35d48d4..4c94162 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlschemastypes.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlschemastypes.h
@@ -28,120 +28,121 @@ typedef enum {
XML_SCHEMA_WHITESPACE_PRESERVE = 1,
XML_SCHEMA_WHITESPACE_REPLACE = 2,
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
-} xmlSchemaWhitespaceValueType;
+}
+xmlSchemaWhitespaceValueType;
XMLPUBFUN void XMLCALL
- xmlSchemaInitTypes (void);
+xmlSchemaInitTypes (void);
XMLPUBFUN void XMLCALL
- xmlSchemaCleanupTypes (void);
+xmlSchemaCleanupTypes (void);
XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetPredefinedType (const xmlChar *name,
- const xmlChar *ns);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacet (xmlSchemaTypePtr base,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
- xmlSchemaWhitespaceValueType fws,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- xmlSchemaWhitespaceValueType ws);
+xmlSchemaGetPredefinedType (const xmlChar *name,
+ const xmlChar *ns);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacet (xmlSchemaTypePtr base,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
+ xmlSchemaWhitespaceValueType fws,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ xmlSchemaWhitespaceValueType ws);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeValue (xmlSchemaValPtr val);
+xmlSchemaFreeValue (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaFacetPtr XMLCALL
- xmlSchemaNewFacet (void);
+xmlSchemaNewFacet (void);
XMLPUBFUN int XMLCALL
- xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
- xmlSchemaTypePtr typeDecl,
- xmlSchemaParserCtxtPtr ctxt,
- const xmlChar *name);
+xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
+ xmlSchemaTypePtr typeDecl,
+ xmlSchemaParserCtxtPtr ctxt,
+ const xmlChar *name);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
+xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
XMLPUBFUN int XMLCALL
- xmlSchemaCompareValues (xmlSchemaValPtr x,
- xmlSchemaValPtr y);
+xmlSchemaCompareValues (xmlSchemaValPtr x,
+ xmlSchemaValPtr y);
XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
+xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
- const xmlChar *value,
- unsigned long actualLen,
- unsigned long *expectedLen);
+xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ unsigned long actualLen,
+ unsigned long *expectedLen);
XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInType (xmlSchemaValType type);
+xmlSchemaGetBuiltInType (xmlSchemaValType type);
XMLPUBFUN int XMLCALL
- xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
- int facetType);
+xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
+ int facetType);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaCollapseString (const xmlChar *value);
+xmlSchemaCollapseString (const xmlChar *value);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaWhiteSpaceReplace (const xmlChar *value);
+xmlSchemaWhiteSpaceReplace (const xmlChar *value);
XMLPUBFUN unsigned long XMLCALL
- xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValue (xmlSchemaValPtr val,
- const xmlChar **retValue);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
- const xmlChar **retValue,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValueAppend (xmlSchemaValPtr prev,
- xmlSchemaValPtr cur);
+xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValue (xmlSchemaValPtr val,
+ const xmlChar **retValue);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
+ const xmlChar **retValue,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValueAppend (xmlSchemaValPtr prev,
+ xmlSchemaValPtr cur);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaValueGetNext (xmlSchemaValPtr cur);
+xmlSchemaValueGetNext (xmlSchemaValPtr cur);
XMLPUBFUN const xmlChar * XMLCALL
- xmlSchemaValueGetAsString (xmlSchemaValPtr val);
+xmlSchemaValueGetAsString (xmlSchemaValPtr val);
XMLPUBFUN int XMLCALL
- xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
+xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewStringValue (xmlSchemaValType type,
- const xmlChar *value);
+xmlSchemaNewStringValue (xmlSchemaValType type,
+ const xmlChar *value);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewNOTATIONValue (const xmlChar *name,
- const xmlChar *ns);
+xmlSchemaNewNOTATIONValue (const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewQNameValue (const xmlChar *namespaceName,
- const xmlChar *localName);
+xmlSchemaNewQNameValue (const xmlChar *namespaceName,
+ const xmlChar *localName);
XMLPUBFUN int XMLCALL
- xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
- xmlSchemaWhitespaceValueType xws,
- xmlSchemaValPtr y,
- xmlSchemaWhitespaceValueType yws);
+xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
+ xmlSchemaWhitespaceValueType xws,
+ xmlSchemaValPtr y,
+ xmlSchemaWhitespaceValueType yws);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaCopyValue (xmlSchemaValPtr val);
+xmlSchemaCopyValue (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValType XMLCALL
- xmlSchemaGetValType (xmlSchemaValPtr val);
+xmlSchemaGetValType (xmlSchemaValPtr val);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlstring.h b/thirdparties/common/include/libxml2/libxml/xmlstring.h
index 2036236..60508f9 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlstring.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlstring.h
@@ -38,101 +38,101 @@ typedef unsigned char xmlChar;
* xmlChar handling
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlStrdup (const xmlChar *cur);
+xmlStrdup (const xmlChar *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrndup (const xmlChar *cur,
- int len);
+xmlStrndup (const xmlChar *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrndup (const char *cur,
- int len);
+xmlCharStrndup (const char *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrdup (const char *cur);
+xmlCharStrdup (const char *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrsub (const xmlChar *str,
- int start,
- int len);
+xmlStrsub (const xmlChar *str,
+ int start,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrchr (const xmlChar *str,
- xmlChar val);
+xmlStrchr (const xmlChar *str,
+ xmlChar val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrstr (const xmlChar *str,
- const xmlChar *val);
+xmlStrstr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrcasestr (const xmlChar *str,
- const xmlChar *val);
+xmlStrcasestr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN int XMLCALL
- xmlStrcmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrcasecmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcasecmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncasecmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncasecmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrEqual (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrEqual (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrQEqual (const xmlChar *pref,
- const xmlChar *name,
- const xmlChar *str);
+xmlStrQEqual (const xmlChar *pref,
+ const xmlChar *name,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlStrlen (const xmlChar *str);
+xmlStrlen (const xmlChar *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrcat (xmlChar *cur,
- const xmlChar *add);
+xmlStrcat (xmlChar *cur,
+ const xmlChar *add);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncat (xmlChar *cur,
- const xmlChar *add,
- int len);
+xmlStrncat (xmlChar *cur,
+ const xmlChar *add,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncatNew (const xmlChar *str1,
- const xmlChar *str2,
- int len);
-XMLPUBFUN int XMLCALL
- xmlStrPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- ...);
-XMLPUBFUN int XMLCALL
- xmlStrVPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- va_list ap);
+xmlStrncatNew (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlStrPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ ...);
+XMLPUBFUN int XMLCALL
+xmlStrVPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ va_list ap);
XMLPUBFUN int XMLCALL
- xmlGetUTF8Char (const unsigned char *utf,
- int *len);
+xmlGetUTF8Char (const unsigned char *utf,
+ int *len);
XMLPUBFUN int XMLCALL
- xmlCheckUTF8 (const unsigned char *utf);
+xmlCheckUTF8 (const unsigned char *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Strsize (const xmlChar *utf,
- int len);
+xmlUTF8Strsize (const xmlChar *utf,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strndup (const xmlChar *utf,
- int len);
+xmlUTF8Strndup (const xmlChar *utf,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlUTF8Strpos (const xmlChar *utf,
- int pos);
+xmlUTF8Strpos (const xmlChar *utf,
+ int pos);
XMLPUBFUN int XMLCALL
- xmlUTF8Strloc (const xmlChar *utf,
- const xmlChar *utfchar);
+xmlUTF8Strloc (const xmlChar *utf,
+ const xmlChar *utfchar);
XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strsub (const xmlChar *utf,
- int start,
- int len);
+xmlUTF8Strsub (const xmlChar *utf,
+ int start,
+ int len);
XMLPUBFUN int XMLCALL
- xmlUTF8Strlen (const xmlChar *utf);
+xmlUTF8Strlen (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Size (const xmlChar *utf);
+xmlUTF8Size (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Charcmp (const xmlChar *utf1,
- const xmlChar *utf2);
+xmlUTF8Charcmp (const xmlChar *utf1,
+ const xmlChar *utf2);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xmlversion.h b/thirdparties/common/include/libxml2/libxml/xmlversion.h
index 456b44a..c63299b 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlversion.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlversion.h
@@ -388,7 +388,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the string suffix used by dynamic modules (usually shared libraries)
*/
-#define LIBXML_MODULE_EXTENSION ".dll"
+#define LIBXML_MODULE_EXTENSION ".dll"
#endif
/**
diff --git a/thirdparties/common/include/libxml2/libxml/xmlwriter.h b/thirdparties/common/include/libxml2/libxml/xmlwriter.h
index dd5add3..b568a1d 100755
--- a/thirdparties/common/include/libxml2/libxml/xmlwriter.h
+++ b/thirdparties/common/include/libxml2/libxml/xmlwriter.h
@@ -23,26 +23,26 @@
extern "C" {
#endif
- typedef struct _xmlTextWriter xmlTextWriter;
- typedef xmlTextWriter *xmlTextWriterPtr;
+typedef struct _xmlTextWriter xmlTextWriter;
+typedef xmlTextWriter *xmlTextWriterPtr;
/*
* Constructors & Destructor
*/
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriter(xmlOutputBufferPtr out);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterFilename(const char *uri, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
- int compression);
- XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriter(xmlOutputBufferPtr out);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterFilename(const char *uri, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
+ int compression);
+XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
/*
* Functions
@@ -52,220 +52,220 @@ extern "C" {
/*
* Document
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDocument(xmlTextWriterPtr writer,
- const char *version,
- const char *encoding,
- const char *standalone);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDocument(xmlTextWriterPtr writer,
+ const char *version,
+ const char *encoding,
+ const char *standalone);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
+ writer);
/*
* Comments
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
- writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
- writer,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
+ writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ content);
/*
* Elements
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
+ writer);
/*
* Elements conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* Text
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
- const xmlChar * content, int len);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
- writer,
- const char
- *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
- writer,
- const char
- *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
+ const xmlChar * content, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
/*
* Attributes
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
+ writer);
/*
* Attributes conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* PI's
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartPI(xmlTextWriterPtr writer,
- const xmlChar * target);
- XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartPI(xmlTextWriterPtr writer,
+ const xmlChar * target);
+XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
/*
* PI conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWritePI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWritePI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const xmlChar * content);
/**
* xmlTextWriterWriteProcessingInstruction:
@@ -277,57 +277,57 @@ extern "C" {
/*
* CDATA
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
/*
* CDATA conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
+ const xmlChar * content);
/*
* DTD
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
/*
* DTD conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * subset);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * subset);
/**
* xmlTextWriterWriteDocType:
@@ -339,145 +339,145 @@ extern "C" {
/*
* DTD element definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
+ writer);
/*
* DTD element definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD attribute list definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
+ writer);
/*
* DTD attribute list definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD entity definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
- int pe, const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
+ int pe, const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
+ writer);
/*
* DTD entity definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(4,5);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(4,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * ndataid);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
- writer,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar *
- ndataid);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
- writer, int pe,
- const xmlChar * name,
- const xmlChar *
- pubid,
- const xmlChar *
- sysid,
- const xmlChar *
- ndataid,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(4,5);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(4,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * ndataid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
+ writer,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar *
+ ndataid);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
+ writer, int pe,
+ const xmlChar * name,
+ const xmlChar *
+ pubid,
+ const xmlChar *
+ sysid,
+ const xmlChar *
+ ndataid,
+ const xmlChar *
+ content);
/*
* DTD notation definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
/*
* Indentation
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
- const xmlChar * str);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
+ const xmlChar * str);
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
/*
* misc
*/
- XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xpath.h b/thirdparties/common/include/libxml2/libxml/xpath.h
index d96776c..dc082ef 100755
--- a/thirdparties/common/include/libxml2/libxml/xpath.h
+++ b/thirdparties/common/include/libxml2/libxml/xpath.h
@@ -166,7 +166,7 @@ struct _xmlXPathVariable {
*/
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
- int nargs);
+ int nargs);
/*
* Extra function: a name and a evaluation function.
@@ -192,7 +192,7 @@ struct _xmlXPathFunct {
*/
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr cur);
+ xmlXPathObjectPtr cur);
/*
* Extra axis: a name and an axis function.
@@ -233,8 +233,8 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
* Returns the XPath object value or NULL if not found.
*/
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFuncLookupFunc:
@@ -248,8 +248,8 @@ typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
* Returns the XPath function or NULL if not found.
*/
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFlags:
@@ -438,116 +438,116 @@ XMLPUBVAR double xmlXPathNINF;
XMLPUBFUN void XMLCALL
- xmlXPathFreeObject (xmlXPathObjectPtr obj);
+xmlXPathFreeObject (xmlXPathObjectPtr obj);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetCreate (xmlNodePtr val);
+xmlXPathNodeSetCreate (xmlNodePtr val);
XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
+xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
+xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathObjectCopy (xmlXPathObjectPtr val);
+xmlXPathObjectCopy (xmlXPathObjectPtr val);
XMLPUBFUN int XMLCALL
- xmlXPathCmpNodes (xmlNodePtr node1,
- xmlNodePtr node2);
+xmlXPathCmpNodes (xmlNodePtr node1,
+ xmlNodePtr node2);
/**
* Conversion functions to basic types.
*/
XMLPUBFUN int XMLCALL
- xmlXPathCastNumberToBoolean (double val);
+xmlXPathCastNumberToBoolean (double val);
XMLPUBFUN int XMLCALL
- xmlXPathCastStringToBoolean (const xmlChar * val);
+xmlXPathCastStringToBoolean (const xmlChar * val);
XMLPUBFUN int XMLCALL
- xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
+xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
XMLPUBFUN int XMLCALL
- xmlXPathCastToBoolean (xmlXPathObjectPtr val);
+xmlXPathCastToBoolean (xmlXPathObjectPtr val);
XMLPUBFUN double XMLCALL
- xmlXPathCastBooleanToNumber (int val);
+xmlXPathCastBooleanToNumber (int val);
XMLPUBFUN double XMLCALL
- xmlXPathCastStringToNumber (const xmlChar * val);
+xmlXPathCastStringToNumber (const xmlChar * val);
XMLPUBFUN double XMLCALL
- xmlXPathCastNodeToNumber (xmlNodePtr node);
+xmlXPathCastNodeToNumber (xmlNodePtr node);
XMLPUBFUN double XMLCALL
- xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
+xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
XMLPUBFUN double XMLCALL
- xmlXPathCastToNumber (xmlXPathObjectPtr val);
+xmlXPathCastToNumber (xmlXPathObjectPtr val);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastBooleanToString (int val);
+xmlXPathCastBooleanToString (int val);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNumberToString (double val);
+xmlXPathCastNumberToString (double val);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeToString (xmlNodePtr node);
+xmlXPathCastNodeToString (xmlNodePtr node);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
+xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastToString (xmlXPathObjectPtr val);
+xmlXPathCastToString (xmlXPathObjectPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertBoolean (xmlXPathObjectPtr val);
+xmlXPathConvertBoolean (xmlXPathObjectPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertNumber (xmlXPathObjectPtr val);
+xmlXPathConvertNumber (xmlXPathObjectPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertString (xmlXPathObjectPtr val);
+xmlXPathConvertString (xmlXPathObjectPtr val);
/**
* Context handling.
*/
XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPathNewContext (xmlDocPtr doc);
+xmlXPathNewContext (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlXPathFreeContext (xmlXPathContextPtr ctxt);
+xmlXPathFreeContext (xmlXPathContextPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
- int active,
- int value,
- int options);
+xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
+ int active,
+ int value,
+ int options);
/**
* Evaluation functions.
*/
XMLPUBFUN long XMLCALL
- xmlXPathOrderDocElems (xmlDocPtr doc);
+xmlXPathOrderDocElems (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXPathSetContextNode (xmlNodePtr node,
- xmlXPathContextPtr ctx);
+xmlXPathSetContextNode (xmlNodePtr node,
+ xmlXPathContextPtr ctx);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNodeEval (xmlNodePtr node,
- const xmlChar *str,
- xmlXPathContextPtr ctx);
+xmlXPathNodeEval (xmlNodePtr node,
+ const xmlChar *str,
+ xmlXPathContextPtr ctx);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
+xmlXPathEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEvalExpression (const xmlChar *str,
- xmlXPathContextPtr ctxt);
+xmlXPathEvalExpression (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
- xmlXPathObjectPtr res);
+xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
+ xmlXPathObjectPtr res);
/**
* Separate compilation/evaluation entry points.
*/
XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCompile (const xmlChar *str);
+xmlXPathCompile (const xmlChar *str);
XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
- const xmlChar *str);
+xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
+ const xmlChar *str);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctx);
+xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctx);
XMLPUBFUN int XMLCALL
- xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctxt);
+xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
+xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
#endif /* LIBXML_XPATH_ENABLED */
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN void XMLCALL
- xmlXPathInit (void);
+xmlXPathInit (void);
XMLPUBFUN int XMLCALL
- xmlXPathIsNaN (double val);
+xmlXPathIsNaN (double val);
XMLPUBFUN int XMLCALL
- xmlXPathIsInf (double val);
+xmlXPathIsInf (double val);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/libxml2/libxml/xpathInternals.h b/thirdparties/common/include/libxml2/libxml/xpathInternals.h
index 70c9db9..c150b64 100755
--- a/thirdparties/common/include/libxml2/libxml/xpathInternals.h
+++ b/thirdparties/common/include/libxml2/libxml/xpathInternals.h
@@ -101,15 +101,15 @@ extern "C" {
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
XMLPUBFUN int XMLCALL
- xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
+xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
XMLPUBFUN double XMLCALL
- xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
+xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathPopString (xmlXPathParserContextPtr ctxt);
+xmlXPathPopString (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
+xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
XMLPUBFUN void * XMLCALL
- xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
+xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/**
* xmlXPathReturnBoolean:
@@ -332,89 +332,89 @@ XMLPUBFUN void * XMLCALL
*/
XMLPUBFUN void XMLCALL
- xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
- xmlXPathVariableLookupFunc f,
- void *data);
+xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
+ xmlXPathVariableLookupFunc f,
+ void *data);
/*
* Function Lookup forwarding.
*/
XMLPUBFUN void XMLCALL
- xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
- xmlXPathFuncLookupFunc f,
- void *funcCtxt);
+xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
+ xmlXPathFuncLookupFunc f,
+ void *funcCtxt);
/*
* Error reporting.
*/
XMLPUBFUN void XMLCALL
- xmlXPatherror (xmlXPathParserContextPtr ctxt,
- const char *file,
- int line,
- int no);
+xmlXPatherror (xmlXPathParserContextPtr ctxt,
+ const char *file,
+ int line,
+ int no);
XMLPUBFUN void XMLCALL
- xmlXPathErr (xmlXPathParserContextPtr ctxt,
- int error);
+xmlXPathErr (xmlXPathParserContextPtr ctxt,
+ int error);
#ifdef LIBXML_DEBUG_ENABLED
XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpObject (FILE *output,
- xmlXPathObjectPtr cur,
- int depth);
+xmlXPathDebugDumpObject (FILE *output,
+ xmlXPathObjectPtr cur,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpCompExpr(FILE *output,
- xmlXPathCompExprPtr comp,
- int depth);
+xmlXPathDebugDumpCompExpr(FILE *output,
+ xmlXPathCompExprPtr comp,
+ int depth);
#endif
/**
* NodeSet handling.
*/
XMLPUBFUN int XMLCALL
- xmlXPathNodeSetContains (xmlNodeSetPtr cur,
- xmlNodePtr val);
+xmlXPathNodeSetContains (xmlNodeSetPtr cur,
+ xmlNodePtr val);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDifference (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathDifference (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathIntersection (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathIntersection (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
+xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinct (xmlNodeSetPtr nodes);
+xmlXPathDistinct (xmlNodeSetPtr nodes);
XMLPUBFUN int XMLCALL
- xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
+xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeading (xmlNodeSetPtr nodes,
- xmlNodePtr node);
+xmlXPathNodeLeading (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeading (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathLeading (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
+xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
- xmlNodePtr node);
+xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailing (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+xmlXPathTrailing (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
/**
@@ -422,131 +422,131 @@ XMLPUBFUN xmlNodeSetPtr XMLCALL
*/
XMLPUBFUN int XMLCALL
- xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
- const xmlChar *prefix,
- const xmlChar *ns_uri);
+xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix,
+ const xmlChar *ns_uri);
XMLPUBFUN const xmlChar * XMLCALL
- xmlXPathNsLookup (xmlXPathContextPtr ctxt,
- const xmlChar *prefix);
+xmlXPathNsLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix);
XMLPUBFUN void XMLCALL
- xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
+xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathFunction f);
+xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathFunction f);
XMLPUBFUN int XMLCALL
- xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathFunction f);
+xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathFunction f);
XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathObjectPtr value);
+xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathObjectPtr value);
XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathObjectPtr value);
+xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathObjectPtr value);
XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
+xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
XMLPUBFUN void XMLCALL
- xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
+xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
+xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
XMLPUBFUN void XMLCALL
- xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
+xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
/**
* Utilities to extend XPath.
*/
XMLPUBFUN xmlXPathParserContextPtr XMLCALL
- xmlXPathNewParserContext (const xmlChar *str,
- xmlXPathContextPtr ctxt);
+xmlXPathNewParserContext (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
+xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
/* TODO: remap to xmlXPathValuePop and Push. */
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- valuePop (xmlXPathParserContextPtr ctxt);
+valuePop (xmlXPathParserContextPtr ctxt);
XMLPUBFUN int XMLCALL
- valuePush (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr value);
+valuePush (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr value);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewString (const xmlChar *val);
+xmlXPathNewString (const xmlChar *val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewCString (const char *val);
+xmlXPathNewCString (const char *val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapString (xmlChar *val);
+xmlXPathWrapString (xmlChar *val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapCString (char * val);
+xmlXPathWrapCString (char * val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewFloat (double val);
+xmlXPathNewFloat (double val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewBoolean (int val);
+xmlXPathNewBoolean (int val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSet (xmlNodePtr val);
+xmlXPathNewNodeSet (xmlNodePtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewValueTree (xmlNodePtr val);
+xmlXPathNewValueTree (xmlNodePtr val);
XMLPUBFUN int XMLCALL
- xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
- xmlNodePtr val);
+xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
+ xmlNodePtr val);
XMLPUBFUN int XMLCALL
- xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
- xmlNodePtr val);
+xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
+ xmlNodePtr val);
XMLPUBFUN int XMLCALL
- xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
- xmlNodePtr node,
- xmlNsPtr ns);
+xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
+ xmlNodePtr node,
+ xmlNsPtr ns);
XMLPUBFUN void XMLCALL
- xmlXPathNodeSetSort (xmlNodeSetPtr set);
+xmlXPathNodeSetSort (xmlNodeSetPtr set);
XMLPUBFUN void XMLCALL
- xmlXPathRoot (xmlXPathParserContextPtr ctxt);
+xmlXPathRoot (xmlXPathParserContextPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
+xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseName (xmlXPathParserContextPtr ctxt);
+xmlXPathParseName (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
+xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
/*
* Existing functions.
*/
XMLPUBFUN double XMLCALL
- xmlXPathStringEvalNumber (const xmlChar *str);
+xmlXPathStringEvalNumber (const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr res);
+xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr res);
XMLPUBFUN void XMLCALL
- xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
+xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
- xmlNodeSetPtr val2);
+xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
+ xmlNodeSetPtr val2);
XMLPUBFUN void XMLCALL
- xmlXPathNodeSetDel (xmlNodeSetPtr cur,
- xmlNodePtr val);
+xmlXPathNodeSetDel (xmlNodeSetPtr cur,
+ xmlNodePtr val);
XMLPUBFUN void XMLCALL
- xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
- int val);
+xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
+ int val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSetList (xmlNodeSetPtr val);
+xmlXPathNewNodeSetList (xmlNodeSetPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapNodeSet (xmlNodeSetPtr val);
+xmlXPathWrapNodeSet (xmlNodeSetPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapExternal (void *val);
+xmlXPathWrapExternal (void *val);
XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
@@ -564,31 +564,31 @@ XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
* Some of the axis navigation routines.
*/
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
/*
* The official core of XPath functions.
*/
diff --git a/thirdparties/common/include/libxml2/libxml/xpointer.h b/thirdparties/common/include/libxml2/libxml/xpointer.h
index b99112b..7cb05e8 100755
--- a/thirdparties/common/include/libxml2/libxml/xpointer.h
+++ b/thirdparties/common/include/libxml2/libxml/xpointer.h
@@ -44,68 +44,68 @@ struct _xmlLocationSet {
*/
XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
+xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
XMLPUBFUN void XMLCALL
- xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
+xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
- xmlLocationSetPtr val2);
+xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
+ xmlLocationSetPtr val2);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRange (xmlNodePtr start,
- int startindex,
- xmlNodePtr end,
- int endindex);
+xmlXPtrNewRange (xmlNodePtr start,
+ int startindex,
+ xmlNodePtr end,
+ int endindex);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
- xmlXPathObjectPtr end);
+xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
+ xmlXPathObjectPtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodePoint (xmlNodePtr start,
- xmlXPathObjectPtr end);
+xmlXPtrNewRangeNodePoint (xmlNodePtr start,
+ xmlXPathObjectPtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
- xmlNodePtr end);
+xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
+ xmlNodePtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodes (xmlNodePtr start,
- xmlNodePtr end);
+xmlXPtrNewRangeNodes (xmlNodePtr start,
+ xmlNodePtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodes (xmlNodePtr start,
- xmlNodePtr end);
+xmlXPtrNewLocationSetNodes (xmlNodePtr start,
+ xmlNodePtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
+xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodeObject (xmlNodePtr start,
- xmlXPathObjectPtr end);
+xmlXPtrNewRangeNodeObject (xmlNodePtr start,
+ xmlXPathObjectPtr end);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewCollapsedRange (xmlNodePtr start);
+xmlXPtrNewCollapsedRange (xmlNodePtr start);
XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
+xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
+xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
+xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
- int val);
+xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
+ int val);
/*
* Functions.
*/
XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPtrNewContext (xmlDocPtr doc,
- xmlNodePtr here,
- xmlNodePtr origin);
+xmlXPtrNewContext (xmlDocPtr doc,
+ xmlNodePtr here,
+ xmlNodePtr origin);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
+xmlXPtrEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
XMLPUBFUN void XMLCALL
- xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
- int nargs);
+xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
+ int nargs);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
+xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
XMLPUBFUN void XMLCALL
- xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
+xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/compare.h b/thirdparties/common/include/libyuv/libyuv/compare.h
index 9dbb0c5..062343b 100755
--- a/thirdparties/common/include/libyuv/libyuv/compare.h
+++ b/thirdparties/common/include/libyuv/libyuv/compare.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/convert.h b/thirdparties/common/include/libyuv/libyuv/convert.h
index 96843f9..0174b79 100755
--- a/thirdparties/common/include/libyuv/libyuv/convert.h
+++ b/thirdparties/common/include/libyuv/libyuv/convert.h
@@ -18,7 +18,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/convert_argb.h b/thirdparties/common/include/libyuv/libyuv/convert_argb.h
index 47ca947..2edc856 100755
--- a/thirdparties/common/include/libyuv/libyuv/convert_argb.h
+++ b/thirdparties/common/include/libyuv/libyuv/convert_argb.h
@@ -24,7 +24,8 @@
// TODO(fbarchard): Some of these functions lack parameter setting.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/convert_from.h b/thirdparties/common/include/libyuv/libyuv/convert_from.h
index c6eb894..8c72b39 100755
--- a/thirdparties/common/include/libyuv/libyuv/convert_from.h
+++ b/thirdparties/common/include/libyuv/libyuv/convert_from.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/cpu_id.h b/thirdparties/common/include/libyuv/libyuv/cpu_id.h
index e964383..99bd197 100755
--- a/thirdparties/common/include/libyuv/libyuv/cpu_id.h
+++ b/thirdparties/common/include/libyuv/libyuv/cpu_id.h
@@ -12,7 +12,8 @@
#define INCLUDE_LIBYUV_CPU_ID_H_
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -36,10 +37,11 @@ static const int kCpuHasAVX = 0x200;
// Detect CPU has SSE2 etc.
// Test_flag parameter should be one of kCpuHas constants above.
// returns non-zero if instruction set is detected
-static __inline int TestCpuFlag(int test_flag) {
- extern int cpu_info_;
- extern int InitCpuFlags();
- return (cpu_info_ ? cpu_info_ : InitCpuFlags()) & test_flag;
+static __inline int TestCpuFlag(int test_flag)
+{
+ extern int cpu_info_;
+ extern int InitCpuFlags();
+ return (cpu_info_ ? cpu_info_ : InitCpuFlags()) & test_flag;
}
// For testing, allow CPU flags to be disabled.
diff --git a/thirdparties/common/include/libyuv/libyuv/format_conversion.h b/thirdparties/common/include/libyuv/libyuv/format_conversion.h
index b91cdd7..d37d5c5 100755
--- a/thirdparties/common/include/libyuv/libyuv/format_conversion.h
+++ b/thirdparties/common/include/libyuv/libyuv/format_conversion.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h b/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h
index c8576e9..a68fad4 100755
--- a/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h
+++ b/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h
@@ -17,17 +17,18 @@ struct jpeg_common_struct;
struct jpeg_decompress_struct;
struct jpeg_source_mgr;
-namespace libyuv {
+namespace libyuv
+{
static const uint32 kUnknownDataSize = 0xFFFFFFFF;
enum JpegSubsamplingType {
- kJpegYuv420,
- kJpegYuv422,
- kJpegYuv411,
- kJpegYuv444,
- kJpegYuv400,
- kJpegUnknown
+ kJpegYuv420,
+ kJpegYuv422,
+ kJpegYuv411,
+ kJpegYuv444,
+ kJpegYuv400,
+ kJpegUnknown
};
struct SetJmpErrorMgr;
@@ -39,146 +40,147 @@ struct SetJmpErrorMgr;
// MJPEG frames.
//
// See http://tools.ietf.org/html/rfc2435
-class MJpegDecoder {
- public:
- typedef void (*CallbackFunction)(void* opaque,
- const uint8* const* data,
- const int* strides,
- int rows);
-
- static const int kColorSpaceUnknown;
- static const int kColorSpaceGrayscale;
- static const int kColorSpaceRgb;
- static const int kColorSpaceYCbCr;
- static const int kColorSpaceCMYK;
- static const int kColorSpaceYCCK;
-
- MJpegDecoder();
- ~MJpegDecoder();
-
- // Loads a new frame, reads its headers, and determines the uncompressed
- // image format. Returns true if image looks valid and format is supported.
- // If return value is true, then the values for all the following getters
- // are populated.
- // src_len is the size of the compressed mjpeg frame in bytes.
- bool LoadFrame(const uint8* src, size_t src_len);
+class MJpegDecoder
+{
+public:
+ typedef void (*CallbackFunction)(void* opaque,
+ const uint8* const* data,
+ const int* strides,
+ int rows);
+
+ static const int kColorSpaceUnknown;
+ static const int kColorSpaceGrayscale;
+ static const int kColorSpaceRgb;
+ static const int kColorSpaceYCbCr;
+ static const int kColorSpaceCMYK;
+ static const int kColorSpaceYCCK;
+
+ MJpegDecoder();
+ ~MJpegDecoder();
+
+ // Loads a new frame, reads its headers, and determines the uncompressed
+ // image format. Returns true if image looks valid and format is supported.
+ // If return value is true, then the values for all the following getters
+ // are populated.
+ // src_len is the size of the compressed mjpeg frame in bytes.
+ bool LoadFrame(const uint8* src, size_t src_len);
- // Returns width of the last loaded frame in pixels.
- int GetWidth();
+ // Returns width of the last loaded frame in pixels.
+ int GetWidth();
+
+ // Returns height of the last loaded frame in pixels.
+ int GetHeight();
- // Returns height of the last loaded frame in pixels.
- int GetHeight();
+ // Returns format of the last loaded frame. The return value is one of the
+ // kColorSpace* constants.
+ int GetColorSpace();
- // Returns format of the last loaded frame. The return value is one of the
- // kColorSpace* constants.
- int GetColorSpace();
+ // Number of color components in the color space.
+ int GetNumComponents();
+
+ // Sample factors of the n-th component.
+ int GetHorizSampFactor(int component);
+
+ int GetVertSampFactor(int component);
+
+ int GetHorizSubSampFactor(int component);
+
+ int GetVertSubSampFactor(int component);
+
+ // Public for testability
+ int GetImageScanlinesPerImcuRow();
+
+ // Public for testability
+ int GetComponentScanlinesPerImcuRow(int component);
+
+ // Width of a component in bytes.
+ int GetComponentWidth(int component);
+
+ // Height of a component.
+ int GetComponentHeight(int component);
+
+ // Width of a component in bytes with padding for DCTSIZE. Public for testing.
+ int GetComponentStride(int component);
+
+ // Size of a component in bytes.
+ int GetComponentSize(int component);
+
+ // Call this after LoadFrame() if you decide you don't want to decode it
+ // after all.
+ bool UnloadFrame();
+
+ // Decodes the entire image into a one-buffer-per-color-component format.
+ // dst_width must match exactly. dst_height must be <= to image height; if
+ // less, the image is cropped. "planes" must have size equal to at least
+ // GetNumComponents() and they must point to non-overlapping buffers of size
+ // at least GetComponentSize(i). The pointers in planes are incremented
+ // to point to after the end of the written data.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ bool DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
+
+ // Decodes the entire image and passes the data via repeated calls to a
+ // callback function. Each call will get the data for a whole number of
+ // image scanlines.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ bool DecodeToCallback(CallbackFunction fn, void* opaque,
+ int dst_width, int dst_height);
+
+ // The helper function which recognizes the jpeg sub-sampling type.
+ static JpegSubsamplingType JpegSubsamplingTypeHelper(
+ int* subsample_x, int* subsample_y, int number_of_components);
+
+private:
+ struct Buffer {
+ const uint8* data;
+ int len;
+ };
+
+ struct BufferVector {
+ Buffer* buffers;
+ int len;
+ int pos;
+ };
+
+ // Methods that are passed to jpeglib.
+ static int fill_input_buffer(jpeg_decompress_struct* cinfo);
+ static void init_source(jpeg_decompress_struct* cinfo);
+ static void skip_input_data(jpeg_decompress_struct* cinfo,
+ long num_bytes); // NOLINT
+ static void term_source(jpeg_decompress_struct* cinfo);
- // Number of color components in the color space.
- int GetNumComponents();
-
- // Sample factors of the n-th component.
- int GetHorizSampFactor(int component);
-
- int GetVertSampFactor(int component);
-
- int GetHorizSubSampFactor(int component);
-
- int GetVertSubSampFactor(int component);
-
- // Public for testability
- int GetImageScanlinesPerImcuRow();
-
- // Public for testability
- int GetComponentScanlinesPerImcuRow(int component);
-
- // Width of a component in bytes.
- int GetComponentWidth(int component);
-
- // Height of a component.
- int GetComponentHeight(int component);
-
- // Width of a component in bytes with padding for DCTSIZE. Public for testing.
- int GetComponentStride(int component);
-
- // Size of a component in bytes.
- int GetComponentSize(int component);
-
- // Call this after LoadFrame() if you decide you don't want to decode it
- // after all.
- bool UnloadFrame();
-
- // Decodes the entire image into a one-buffer-per-color-component format.
- // dst_width must match exactly. dst_height must be <= to image height; if
- // less, the image is cropped. "planes" must have size equal to at least
- // GetNumComponents() and they must point to non-overlapping buffers of size
- // at least GetComponentSize(i). The pointers in planes are incremented
- // to point to after the end of the written data.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- bool DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
-
- // Decodes the entire image and passes the data via repeated calls to a
- // callback function. Each call will get the data for a whole number of
- // image scanlines.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- bool DecodeToCallback(CallbackFunction fn, void* opaque,
- int dst_width, int dst_height);
-
- // The helper function which recognizes the jpeg sub-sampling type.
- static JpegSubsamplingType JpegSubsamplingTypeHelper(
- int* subsample_x, int* subsample_y, int number_of_components);
-
- private:
- struct Buffer {
- const uint8* data;
- int len;
- };
-
- struct BufferVector {
- Buffer* buffers;
- int len;
- int pos;
- };
-
- // Methods that are passed to jpeglib.
- static int fill_input_buffer(jpeg_decompress_struct* cinfo);
- static void init_source(jpeg_decompress_struct* cinfo);
- static void skip_input_data(jpeg_decompress_struct* cinfo,
- long num_bytes); // NOLINT
- static void term_source(jpeg_decompress_struct* cinfo);
+ static void ErrorHandler(jpeg_common_struct* cinfo);
+
+ void AllocOutputBuffers(int num_outbufs);
+ void DestroyOutputBuffers();
- static void ErrorHandler(jpeg_common_struct* cinfo);
-
- void AllocOutputBuffers(int num_outbufs);
- void DestroyOutputBuffers();
+ bool StartDecode();
+ bool FinishDecode();
- bool StartDecode();
- bool FinishDecode();
+ void SetScanlinePointers(uint8** data);
+ bool DecodeImcuRow();
- void SetScanlinePointers(uint8** data);
- bool DecodeImcuRow();
+ int GetComponentScanlinePadding(int component);
- int GetComponentScanlinePadding(int component);
+ // A buffer holding the input data for a frame.
+ Buffer buf_;
+ BufferVector buf_vec_;
- // A buffer holding the input data for a frame.
- Buffer buf_;
- BufferVector buf_vec_;
+ jpeg_decompress_struct* decompress_struct_;
+ jpeg_source_mgr* source_mgr_;
+ SetJmpErrorMgr* error_mgr_;
- jpeg_decompress_struct* decompress_struct_;
- jpeg_source_mgr* source_mgr_;
- SetJmpErrorMgr* error_mgr_;
+ // true iff at least one component has scanline padding. (i.e.,
+ // GetComponentScanlinePadding() != 0.)
+ bool has_scanline_padding_;
- // true iff at least one component has scanline padding. (i.e.,
- // GetComponentScanlinePadding() != 0.)
- bool has_scanline_padding_;
-
- // Temporaries used to point to scanline outputs.
- int num_outbufs_; // Outermost size of all arrays below.
- uint8*** scanlines_;
- int* scanlines_sizes_;
- // Temporary buffer used for decoding when we can't decode directly to the
- // output buffers. Large enough for just one iMCU row.
- uint8** databuf_;
- int* databuf_strides_;
+ // Temporaries used to point to scanline outputs.
+ int num_outbufs_; // Outermost size of all arrays below.
+ uint8*** scanlines_;
+ int* scanlines_sizes_;
+ // Temporary buffer used for decoding when we can't decode directly to the
+ // output buffers. Large enough for just one iMCU row.
+ uint8** databuf_;
+ int* databuf_strides_;
};
} // namespace libyuv
diff --git a/thirdparties/common/include/libyuv/libyuv/planar_functions.h b/thirdparties/common/include/libyuv/libyuv/planar_functions.h
index d411966..0cb322b 100755
--- a/thirdparties/common/include/libyuv/libyuv/planar_functions.h
+++ b/thirdparties/common/include/libyuv/libyuv/planar_functions.h
@@ -18,7 +18,8 @@
#include "libyuv/convert_argb.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/rotate.h b/thirdparties/common/include/libyuv/libyuv/rotate.h
index 8766ec3..6ec46f6 100755
--- a/thirdparties/common/include/libyuv/libyuv/rotate.h
+++ b/thirdparties/common/include/libyuv/libyuv/rotate.h
@@ -14,21 +14,22 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported rotation.
enum RotationMode {
- kRotate0 = 0, // No rotation.
- kRotate90 = 90, // Rotate 90 degrees clockwise.
- kRotate180 = 180, // Rotate 180 degrees.
- kRotate270 = 270, // Rotate 270 degrees clockwise.
-
- // Deprecated.
- kRotateNone = 0,
- kRotateClockwise = 90,
- kRotateCounterClockwise = 270,
+ kRotate0 = 0, // No rotation.
+ kRotate90 = 90, // Rotate 90 degrees clockwise.
+ kRotate180 = 180, // Rotate 180 degrees.
+ kRotate270 = 270, // Rotate 270 degrees clockwise.
+
+ // Deprecated.
+ kRotateNone = 0,
+ kRotateClockwise = 90,
+ kRotateCounterClockwise = 270,
};
// Rotate I420 frame
diff --git a/thirdparties/common/include/libyuv/libyuv/rotate_argb.h b/thirdparties/common/include/libyuv/libyuv/rotate_argb.h
index 54fbc69..0bbf5db 100755
--- a/thirdparties/common/include/libyuv/libyuv/rotate_argb.h
+++ b/thirdparties/common/include/libyuv/libyuv/rotate_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h" // For RotationMode.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/scale.h b/thirdparties/common/include/libyuv/libyuv/scale.h
index e7e7c38..be073ae 100755
--- a/thirdparties/common/include/libyuv/libyuv/scale.h
+++ b/thirdparties/common/include/libyuv/libyuv/scale.h
@@ -14,15 +14,16 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported filtering
enum FilterMode {
- kFilterNone = 0, // Point sample; Fastest
- kFilterBilinear = 1, // Faster than box, but lower quality scaling down.
- kFilterBox = 2 // Highest quality
+ kFilterNone = 0, // Point sample; Fastest
+ kFilterBilinear = 1, // Faster than box, but lower quality scaling down.
+ kFilterBox = 2 // Highest quality
};
// Scale a YUV plane.
diff --git a/thirdparties/common/include/libyuv/libyuv/scale_argb.h b/thirdparties/common/include/libyuv/libyuv/scale_argb.h
index cc11c4e..dea237c 100755
--- a/thirdparties/common/include/libyuv/libyuv/scale_argb.h
+++ b/thirdparties/common/include/libyuv/libyuv/scale_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/scale.h" // For FilterMode
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/common/include/libyuv/libyuv/video_common.h b/thirdparties/common/include/libyuv/libyuv/video_common.h
index 49b7532..b64e078 100755
--- a/thirdparties/common/include/libyuv/libyuv/video_common.h
+++ b/thirdparties/common/include/libyuv/libyuv/video_common.h
@@ -16,7 +16,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -38,111 +39,111 @@ extern "C" {
// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12
enum FourCC {
- // Canonical fourcc codes used in our code.
- FOURCC_I420 = FOURCC('I', '4', '2', '0'),
- FOURCC_I422 = FOURCC('I', '4', '2', '2'),
- FOURCC_I444 = FOURCC('I', '4', '4', '4'),
- FOURCC_I411 = FOURCC('I', '4', '1', '1'),
- FOURCC_I400 = FOURCC('I', '4', '0', '0'),
- FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
- FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
- FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
- FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
- FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
- FOURCC_M420 = FOURCC('M', '4', '2', '0'),
- FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
- FOURCC_V210 = FOURCC('V', '2', '1', '0'),
- FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
- FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
- FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
- FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
- FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // bgr565.
- FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // abgr1555.
- FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444.
- FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
- FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
- FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
- FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
- FOURCC_H264 = FOURCC('H', '2', '6', '4'),
- // Next four are Bayer RGB formats. The four characters define the order of
- // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom.
- FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
- FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
- FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
- FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
-
- // Aliases for canonical fourcc codes, replaced with their canonical
- // equivalents by CanonicalFourCC().
- FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
- FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Alias for I420.
- FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
- FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
- FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
- FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
- FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
- FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY.
- FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
- FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
- FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
- FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
- FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
-
- // Match any fourcc.
- FOURCC_ANY = 0xFFFFFFFF,
+ // Canonical fourcc codes used in our code.
+ FOURCC_I420 = FOURCC('I', '4', '2', '0'),
+ FOURCC_I422 = FOURCC('I', '4', '2', '2'),
+ FOURCC_I444 = FOURCC('I', '4', '4', '4'),
+ FOURCC_I411 = FOURCC('I', '4', '1', '1'),
+ FOURCC_I400 = FOURCC('I', '4', '0', '0'),
+ FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
+ FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
+ FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
+ FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
+ FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
+ FOURCC_M420 = FOURCC('M', '4', '2', '0'),
+ FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
+ FOURCC_V210 = FOURCC('V', '2', '1', '0'),
+ FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
+ FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
+ FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
+ FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
+ FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // bgr565.
+ FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // abgr1555.
+ FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444.
+ FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
+ FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
+ FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
+ FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
+ FOURCC_H264 = FOURCC('H', '2', '6', '4'),
+ // Next four are Bayer RGB formats. The four characters define the order of
+ // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom.
+ FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
+ FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
+ FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
+ FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
+
+ // Aliases for canonical fourcc codes, replaced with their canonical
+ // equivalents by CanonicalFourCC().
+ FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
+ FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Alias for I420.
+ FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
+ FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
+ FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
+ FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
+ FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
+ FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY.
+ FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
+ FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
+ FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
+ FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
+ FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
+
+ // Match any fourcc.
+ FOURCC_ANY = 0xFFFFFFFF,
};
enum FourCCBpp {
- // Canonical fourcc codes used in our code.
- FOURCC_BPP_I420 = 12,
- FOURCC_BPP_I422 = 16,
- FOURCC_BPP_I444 = 24,
- FOURCC_BPP_I411 = 12,
- FOURCC_BPP_I400 = 8,
- FOURCC_BPP_YV12 = 12,
- FOURCC_BPP_YV16 = 16,
- FOURCC_BPP_YV24 = 24,
- FOURCC_BPP_YUY2 = 16,
- FOURCC_BPP_UYVY = 16,
- FOURCC_BPP_M420 = 12,
- FOURCC_BPP_Q420 = 12,
- FOURCC_BPP_V210 = 22, // 22.5 actually
- FOURCC_BPP_24BG = 24,
- FOURCC_BPP_ABGR = 32,
- FOURCC_BPP_BGRA = 32,
- FOURCC_BPP_ARGB = 32,
- FOURCC_BPP_RGBP = 16,
- FOURCC_BPP_RGBO = 16,
- FOURCC_BPP_R444 = 16,
- FOURCC_BPP_RAW = 24,
- FOURCC_BPP_NV21 = 12,
- FOURCC_BPP_NV12 = 12,
- FOURCC_BPP_MJPG = 0, // 0 means unknown.
- FOURCC_BPP_H264 = 0,
- // Next four are Bayer RGB formats. The four characters define the order of
- // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom.
- FOURCC_BPP_RGGB = 8,
- FOURCC_BPP_BGGR = 8,
- FOURCC_BPP_GRBG = 8,
- FOURCC_BPP_GBRG = 8,
-
- // Aliases for canonical fourcc codes, replaced with their canonical
- // equivalents by CanonicalFourCC().
- FOURCC_BPP_IYUV = 12,
- FOURCC_BPP_YU12 = 12,
- FOURCC_BPP_YU16 = 16,
- FOURCC_BPP_YU24 = 24,
- FOURCC_BPP_YUYV = 16,
- FOURCC_BPP_YUVS = 16,
- FOURCC_BPP_HDYC = 16,
- FOURCC_BPP_2VUY = 16,
- FOURCC_BPP_JPEG = 1,
- FOURCC_BPP_DMB1 = 1,
- FOURCC_BPP_BA81 = 8,
- FOURCC_BPP_RGB3 = 24,
- FOURCC_BPP_BGR3 = 24,
-
- // Match any fourcc.
- FOURCC_BPP_ANY = 0, // 0 means unknown.
+ // Canonical fourcc codes used in our code.
+ FOURCC_BPP_I420 = 12,
+ FOURCC_BPP_I422 = 16,
+ FOURCC_BPP_I444 = 24,
+ FOURCC_BPP_I411 = 12,
+ FOURCC_BPP_I400 = 8,
+ FOURCC_BPP_YV12 = 12,
+ FOURCC_BPP_YV16 = 16,
+ FOURCC_BPP_YV24 = 24,
+ FOURCC_BPP_YUY2 = 16,
+ FOURCC_BPP_UYVY = 16,
+ FOURCC_BPP_M420 = 12,
+ FOURCC_BPP_Q420 = 12,
+ FOURCC_BPP_V210 = 22, // 22.5 actually
+ FOURCC_BPP_24BG = 24,
+ FOURCC_BPP_ABGR = 32,
+ FOURCC_BPP_BGRA = 32,
+ FOURCC_BPP_ARGB = 32,
+ FOURCC_BPP_RGBP = 16,
+ FOURCC_BPP_RGBO = 16,
+ FOURCC_BPP_R444 = 16,
+ FOURCC_BPP_RAW = 24,
+ FOURCC_BPP_NV21 = 12,
+ FOURCC_BPP_NV12 = 12,
+ FOURCC_BPP_MJPG = 0, // 0 means unknown.
+ FOURCC_BPP_H264 = 0,
+ // Next four are Bayer RGB formats. The four characters define the order of
+ // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom.
+ FOURCC_BPP_RGGB = 8,
+ FOURCC_BPP_BGGR = 8,
+ FOURCC_BPP_GRBG = 8,
+ FOURCC_BPP_GBRG = 8,
+
+ // Aliases for canonical fourcc codes, replaced with their canonical
+ // equivalents by CanonicalFourCC().
+ FOURCC_BPP_IYUV = 12,
+ FOURCC_BPP_YU12 = 12,
+ FOURCC_BPP_YU16 = 16,
+ FOURCC_BPP_YU24 = 24,
+ FOURCC_BPP_YUYV = 16,
+ FOURCC_BPP_YUVS = 16,
+ FOURCC_BPP_HDYC = 16,
+ FOURCC_BPP_2VUY = 16,
+ FOURCC_BPP_JPEG = 1,
+ FOURCC_BPP_DMB1 = 1,
+ FOURCC_BPP_BA81 = 8,
+ FOURCC_BPP_RGB3 = 24,
+ FOURCC_BPP_BGR3 = 24,
+
+ // Match any fourcc.
+ FOURCC_BPP_ANY = 0, // 0 means unknown.
};
// Converts fourcc aliases into canonical ones.
diff --git a/thirdparties/common/include/ogg/ogg.h b/thirdparties/common/include/ogg/ogg.h
index cea5c16..431dbe9 100755
--- a/thirdparties/common/include/ogg/ogg.h
+++ b/thirdparties/common/include/ogg/ogg.h
@@ -25,62 +25,62 @@ extern "C" {
#include <ogg/os_types.h>
typedef struct {
- void *iov_base;
- size_t iov_len;
+ void *iov_base;
+ size_t iov_len;
} ogg_iovec_t;
typedef struct {
- long endbyte;
- int endbit;
+ long endbyte;
+ int endbit;
- unsigned char *buffer;
- unsigned char *ptr;
- long storage;
+ unsigned char *buffer;
+ unsigned char *ptr;
+ long storage;
} oggpack_buffer;
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
typedef struct {
- unsigned char *header;
- long header_len;
- unsigned char *body;
- long body_len;
+ unsigned char *header;
+ long header_len;
+ unsigned char *body;
+ long body_len;
} ogg_page;
/* ogg_stream_state contains the current encode/decode state of a logical
Ogg bitstream **********************************************************/
typedef struct {
- unsigned char *body_data; /* bytes from packet bodies */
- long body_storage; /* storage elements allocated */
- long body_fill; /* elements stored; fill mark */
- long body_returned; /* elements of fill returned */
+ unsigned char *body_data; /* bytes from packet bodies */
+ long body_storage; /* storage elements allocated */
+ long body_fill; /* elements stored; fill mark */
+ long body_returned; /* elements of fill returned */
- int *lacing_vals; /* The values that will go to the segment table */
- ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
+ int *lacing_vals; /* The values that will go to the segment table */
+ ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
this way, but it is simple coupled to the
lacing fifo */
- long lacing_storage;
- long lacing_fill;
- long lacing_packet;
- long lacing_returned;
+ long lacing_storage;
+ long lacing_fill;
+ long lacing_packet;
+ long lacing_returned;
- unsigned char header[282]; /* working space for header encode */
- int header_fill;
+ unsigned char header[282]; /* working space for header encode */
+ int header_fill;
- int e_o_s; /* set when we have buffered the last packet in the
+ int e_o_s; /* set when we have buffered the last packet in the
logical bitstream */
- int b_o_s; /* set after we've written the initial page
+ int b_o_s; /* set after we've written the initial page
of a logical bitstream */
- long serialno;
- long pageno;
- ogg_int64_t packetno; /* sequence number for decode; the framing
+ long serialno;
+ long pageno;
+ ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
layer) also knows about the gap */
- ogg_int64_t granulepos;
+ ogg_int64_t granulepos;
} ogg_stream_state;
@@ -88,14 +88,14 @@ typedef struct {
to a single raw Ogg/Vorbis packet *************************************/
typedef struct {
- unsigned char *packet;
- long bytes;
- long b_o_s;
- long e_o_s;
+ unsigned char *packet;
+ long bytes;
+ long b_o_s;
+ long e_o_s;
- ogg_int64_t granulepos;
+ ogg_int64_t granulepos;
- ogg_int64_t packetno; /* sequence number for decode; the framing
+ ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
@@ -103,14 +103,14 @@ typedef struct {
} ogg_packet;
typedef struct {
- unsigned char *data;
- int storage;
- int fill;
- int returned;
-
- int unsynced;
- int headerbytes;
- int bodybytes;
+ unsigned char *data;
+ int storage;
+ int fill;
+ int returned;
+
+ int unsynced;
+ int headerbytes;
+ int bodybytes;
} ogg_sync_state;
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
diff --git a/thirdparties/common/include/ogg/os_types.h b/thirdparties/common/include/ogg/os_types.h
index d6691b7..8265988 100755
--- a/thirdparties/common/include/ogg/os_types.h
+++ b/thirdparties/common/include/ogg/os_types.h
@@ -24,119 +24,119 @@
#define _ogg_realloc realloc
#define _ogg_free free
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <stdint.h>
- typedef int16_t ogg_int16_t;
- typedef uint16_t ogg_uint16_t;
- typedef int32_t ogg_int32_t;
- typedef uint32_t ogg_uint32_t;
- typedef int64_t ogg_int64_t;
- typedef uint64_t ogg_uint64_t;
+typedef int16_t ogg_int16_t;
+typedef uint16_t ogg_uint16_t;
+typedef int32_t ogg_int32_t;
+typedef uint32_t ogg_uint32_t;
+typedef int64_t ogg_int64_t;
+typedef uint64_t ogg_uint64_t;
# elif defined(__MINGW32__)
# include <sys/types.h>
- typedef short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
- typedef int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long ogg_int64_t;
- typedef unsigned long long ogg_uint64_t;
+typedef short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long ogg_int64_t;
+typedef unsigned long long ogg_uint64_t;
# elif defined(__MWERKS__)
- typedef long long ogg_int64_t;
- typedef int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
+typedef long long ogg_int64_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int64 ogg_int64_t;
- typedef __int32 ogg_int32_t;
- typedef unsigned __int32 ogg_uint32_t;
- typedef __int16 ogg_int16_t;
- typedef unsigned __int16 ogg_uint16_t;
+/* MSVC/Borland */
+typedef __int64 ogg_int64_t;
+typedef __int32 ogg_int32_t;
+typedef unsigned __int32 ogg_uint32_t;
+typedef __int16 ogg_int16_t;
+typedef unsigned __int16 ogg_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 ogg_int16_t;
- typedef UInt16 ogg_uint16_t;
- typedef SInt32 ogg_int32_t;
- typedef UInt32 ogg_uint32_t;
- typedef SInt64 ogg_int64_t;
+typedef SInt16 ogg_int16_t;
+typedef UInt16 ogg_uint16_t;
+typedef SInt32 ogg_int32_t;
+typedef UInt32 ogg_uint32_t;
+typedef SInt64 ogg_int64_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <inttypes.h>
- typedef int16_t ogg_int16_t;
- typedef uint16_t ogg_uint16_t;
- typedef int32_t ogg_int32_t;
- typedef uint32_t ogg_uint32_t;
- typedef int64_t ogg_int64_t;
+typedef int16_t ogg_int16_t;
+typedef uint16_t ogg_uint16_t;
+typedef int32_t ogg_int32_t;
+typedef uint32_t ogg_uint32_t;
+typedef int64_t ogg_int64_t;
#elif defined(__HAIKU__)
- /* Haiku */
+/* Haiku */
# include <sys/types.h>
- typedef short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
- typedef int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long ogg_int64_t;
+typedef short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long ogg_int64_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t ogg_int16_t;
- typedef uint16_t ogg_uint16_t;
- typedef int32_t ogg_int32_t;
- typedef uint32_t ogg_uint32_t;
- typedef int64_t ogg_int64_t;
+typedef int16_t ogg_int16_t;
+typedef uint16_t ogg_uint16_t;
+typedef int32_t ogg_int32_t;
+typedef uint32_t ogg_uint32_t;
+typedef int64_t ogg_int64_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
- typedef int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long ogg_int64_t;
+/* OS/2 GCC */
+typedef short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long ogg_int64_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short ogg_int16_t;
- typedef int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long ogg_int64_t;
+/* DJGPP */
+typedef short ogg_int16_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long ogg_int64_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef long ogg_int64_t;
- typedef int ogg_int32_t;
- typedef unsigned ogg_uint32_t;
- typedef short ogg_int16_t;
+/* PS2 EE */
+typedef long ogg_int64_t;
+typedef int ogg_int32_t;
+typedef unsigned ogg_uint32_t;
+typedef short ogg_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
- typedef signed int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long int ogg_int64_t;
+/* Symbian GCC */
+typedef signed short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef signed int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long int ogg_int64_t;
#elif defined(__TMS320C6X__)
- /* TI C64x compiler */
- typedef signed short ogg_int16_t;
- typedef unsigned short ogg_uint16_t;
- typedef signed int ogg_int32_t;
- typedef unsigned int ogg_uint32_t;
- typedef long long int ogg_int64_t;
+/* TI C64x compiler */
+typedef signed short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef signed int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long long int ogg_int64_t;
#else
diff --git a/thirdparties/common/include/openssl/asn1.h b/thirdparties/common/include/openssl/asn1.h
index 68e791f..c51d3bb 100755
--- a/thirdparties/common/include/openssl/asn1.h
+++ b/thirdparties/common/include/openssl/asn1.h
@@ -158,7 +158,7 @@ extern "C" {
# define SMIME_OLDMIME 0x400
# define SMIME_CRLFEOL 0x800
# define SMIME_STREAM 0x1000
- struct X509_algor_st;
+struct X509_algor_st;
DECLARE_STACK_OF(X509_ALGOR)
# define DECLARE_ASN1_SET_OF(type)/* filled in by mkstack.pl */
@@ -769,7 +769,7 @@ typedef struct BIT_STRING_BITNAME_st {
(ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
- /* for the is_set parameter to i2d_ASN1_SET */
+/* for the is_set parameter to i2d_ASN1_SET */
# define IS_SEQUENCE 0
# define IS_SET 1
@@ -800,10 +800,10 @@ int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
ASN1_STRING *ASN1_STRING_type_new(int type);
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
- /*
- * Since this is used to store all sorts of things, via macros, for now,
- * make its data void *
- */
+/*
+ * Since this is used to store all sorts of things, via macros, for now,
+ * make its data void *
+ */
int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
int ASN1_STRING_length(const ASN1_STRING *x);
@@ -855,10 +855,10 @@ time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
- time_t t);
+ time_t t);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
- time_t t, int offset_day,
- long offset_sec);
+ time_t t, int offset_day,
+ long offset_sec);
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
int ASN1_TIME_diff(int *pday, int *psec,
const ASN1_TIME *from, const ASN1_TIME *to);
@@ -898,7 +898,7 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
int offset_day, long offset_sec);
int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME
- **out);
+ **out);
int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,
@@ -1059,8 +1059,8 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num,
unsigned char *data, int max_len);
STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
- d2i_of_void *d2i,
- void (*free_func) (OPENSSL_BLOCK));
+ d2i_of_void *d2i,
+ void (*free_func) (OPENSSL_BLOCK));
unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d,
unsigned char **buf, int *len);
void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
diff --git a/thirdparties/common/include/openssl/bio.h b/thirdparties/common/include/openssl/bio.h
index 7878fb1..965f933 100755
--- a/thirdparties/common/include/openssl/bio.h
+++ b/thirdparties/common/include/openssl/bio.h
@@ -757,9 +757,9 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag);
int BIO_dgram_is_sctp(BIO *bio);
int BIO_dgram_sctp_notification_cb(BIO *b,
void (*handle_notifications) (BIO *bio,
- void
- *context,
- void *buf),
+ void
+ *context,
+ void *buf),
void *context);
int BIO_dgram_sctp_wait_for_dry(BIO *b);
int BIO_dgram_sctp_msg_waiting(BIO *b);
diff --git a/thirdparties/common/include/openssl/bn.h b/thirdparties/common/include/openssl/bn.h
index 78709d3..5f24cba 100755
--- a/thirdparties/common/include/openssl/bn.h
+++ b/thirdparties/common/include/openssl/bn.h
@@ -280,7 +280,7 @@ extern "C" {
# ifndef OPENSSL_NO_DEPRECATED
# define BN_FLG_FREE 0x8000
- /* used for debuging */
+/* used for debuging */
# endif
# define BN_set_flags(b,n) ((b)->flags|=(n))
# define BN_get_flags(b,n) ((b)->flags&(n))
@@ -609,11 +609,11 @@ void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
int (*bn_mod_exp) (BIGNUM *r,
- const BIGNUM *a,
- const BIGNUM *p,
- const BIGNUM *m,
- BN_CTX *ctx,
- BN_MONT_CTX *m_ctx),
+ const BIGNUM *a,
+ const BIGNUM *p,
+ const BIGNUM *m,
+ BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx),
BN_MONT_CTX *m_ctx);
# ifndef OPENSSL_NO_DEPRECATED
diff --git a/thirdparties/common/include/openssl/cms.h b/thirdparties/common/include/openssl/cms.h
index e6c7f96..fe72417 100755
--- a/thirdparties/common/include/openssl/cms.h
+++ b/thirdparties/common/include/openssl/cms.h
@@ -164,8 +164,8 @@ int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
BIO *dcont, BIO *out, unsigned int flags);
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
- const unsigned char *key,
- size_t keylen, unsigned int flags);
+ const unsigned char *key,
+ size_t keylen, unsigned int flags);
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
const unsigned char *key, size_t keylen);
@@ -197,23 +197,23 @@ int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
- X509 *recip, unsigned int flags);
+ X509 *recip, unsigned int flags);
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
EVP_PKEY **pk, X509 **recip,
X509_ALGOR **palg);
int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
- ASN1_OCTET_STRING **keyid,
- X509_NAME **issuer,
- ASN1_INTEGER **sno);
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer,
+ ASN1_INTEGER **sno);
CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
- unsigned char *key, size_t keylen,
- unsigned char *id, size_t idlen,
- ASN1_GENERALIZEDTIME *date,
- ASN1_OBJECT *otherTypeId,
- ASN1_TYPE *otherType);
+ unsigned char *key, size_t keylen,
+ unsigned char *id, size_t idlen,
+ ASN1_GENERALIZEDTIME *date,
+ ASN1_OBJECT *otherTypeId,
+ ASN1_TYPE *otherType);
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
X509_ALGOR **palg,
@@ -233,11 +233,11 @@ int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
ossl_ssize_t passlen);
CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
- int iter, int wrap_nid,
- int pbe_nid,
- unsigned char *pass,
- ossl_ssize_t passlen,
- const EVP_CIPHER *kekciph);
+ int iter, int wrap_nid,
+ int pbe_nid,
+ unsigned char *pass,
+ ossl_ssize_t passlen,
+ const EVP_CIPHER *kekciph);
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
@@ -331,10 +331,10 @@ void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
- int allorfirst,
- STACK_OF(GENERAL_NAMES)
- *receiptList, STACK_OF(GENERAL_NAMES)
- *receiptsTo);
+ int allorfirst,
+ STACK_OF(GENERAL_NAMES)
+ *receiptList, STACK_OF(GENERAL_NAMES)
+ *receiptsTo);
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
ASN1_STRING **pcid,
diff --git a/thirdparties/common/include/openssl/conf_api.h b/thirdparties/common/include/openssl/conf_api.h
index e478f7d..719ff92 100755
--- a/thirdparties/common/include/openssl/conf_api.h
+++ b/thirdparties/common/include/openssl/conf_api.h
@@ -72,7 +72,7 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
- const char *section);
+ const char *section);
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
char *_CONF_get_string(const CONF *conf, const char *section,
diff --git a/thirdparties/common/include/openssl/crypto.h b/thirdparties/common/include/openssl/crypto.h
index c450d7a..2dd0443 100755
--- a/thirdparties/common/include/openssl/crypto.h
+++ b/thirdparties/common/include/openssl/crypto.h
@@ -435,14 +435,14 @@ int CRYPTO_get_new_lockid(char *name);
int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
void CRYPTO_lock(int mode, int type, const char *file, int line);
void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
- const char *file, int line));
+ const char *file, int line));
void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
- const char *file, int line);
+ const char *file, int line);
void CRYPTO_set_add_lock_callback(int (*func)
- (int *num, int mount, int type,
- const char *file, int line));
+ (int *num, int mount, int type,
+ const char *file, int line));
int (*CRYPTO_get_add_lock_callback(void)) (int *num, int mount, int type,
- const char *file, int line);
+ const char *file, int line);
/* Don't use this structure directly. */
typedef struct crypto_threadid_st {
@@ -473,24 +473,24 @@ void CRYPTO_destroy_dynlockid(int i);
struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value
*(*dyn_create_function) (const char
- *file,
- int line));
+ *file,
+ int line));
void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
- (int mode,
- struct CRYPTO_dynlock_value *l,
- const char *file, int line));
+ (int mode,
+ struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
- (struct CRYPTO_dynlock_value *l,
- const char *file, int line));
+ (struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
struct CRYPTO_dynlock_value
*(*CRYPTO_get_dynlock_create_callback(void)) (const char *file, int line);
void (*CRYPTO_get_dynlock_lock_callback(void)) (int mode,
- struct CRYPTO_dynlock_value
- *l, const char *file,
- int line);
+ struct CRYPTO_dynlock_value
+ *l, const char *file,
+ int line);
void (*CRYPTO_get_dynlock_destroy_callback(void)) (struct CRYPTO_dynlock_value
- *l, const char *file,
- int line);
+ *l, const char *file,
+ int line);
/*
* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- call
@@ -502,13 +502,13 @@ int CRYPTO_set_locked_mem_functions(void *(*m) (size_t),
void (*free_func) (void *));
int CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),
void *(*r) (void *, size_t, const char *,
- int), void (*f) (void *));
+ int), void (*f) (void *));
int CRYPTO_set_locked_mem_ex_functions(void *(*m) (size_t, const char *, int),
void (*free_func) (void *));
int CRYPTO_set_mem_debug_functions(void (*m)
- (void *, int, const char *, int, int),
+ (void *, int, const char *, int, int),
void (*r) (void *, void *, int,
- const char *, int, int),
+ const char *, int, int),
void (*f) (void *, int), void (*so) (long),
long (*go) (void));
void CRYPTO_get_mem_functions(void *(**m) (size_t),
@@ -518,14 +518,14 @@ void CRYPTO_get_locked_mem_functions(void *(**m) (size_t),
void (**f) (void *));
void CRYPTO_get_mem_ex_functions(void *(**m) (size_t, const char *, int),
void *(**r) (void *, size_t, const char *,
- int), void (**f) (void *));
+ int), void (**f) (void *));
void CRYPTO_get_locked_mem_ex_functions(void
*(**m) (size_t, const char *, int),
void (**f) (void *));
void CRYPTO_get_mem_debug_functions(void (**m)
- (void *, int, const char *, int, int),
+ (void *, int, const char *, int, int),
void (**r) (void *, void *, int,
- const char *, int, int),
+ const char *, int, int),
void (**f) (void *, int),
void (**so) (long), long (**go) (void));
diff --git a/thirdparties/common/include/openssl/dsa.h b/thirdparties/common/include/openssl/dsa.h
index 545358f..af8d8d2 100755
--- a/thirdparties/common/include/openssl/dsa.h
+++ b/thirdparties/common/include/openssl/dsa.h
@@ -206,7 +206,7 @@ void DSA_free(DSA *r);
/* "up" the DSA object's reference count */
int DSA_up_ref(DSA *r);
int DSA_size(const DSA *);
- /* next 4 return -1 on error */
+/* next 4 return -1 on error */
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
int DSA_sign(int type, const unsigned char *dgst, int dlen,
unsigned char *sig, unsigned int *siglen, DSA *dsa);
@@ -226,7 +226,7 @@ DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
DSA *DSA_generate_parameters(int bits,
unsigned char *seed, int seed_len,
int *counter_ret, unsigned long *h_ret, void
- (*callback) (int, int, void *), void *cb_arg);
+ (*callback) (int, int, void *), void *cb_arg);
# endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
diff --git a/thirdparties/common/include/openssl/dso.h b/thirdparties/common/include/openssl/dso.h
index 7c4a1dc..24b5655 100755
--- a/thirdparties/common/include/openssl/dso.h
+++ b/thirdparties/common/include/openssl/dso.h
@@ -157,7 +157,7 @@ typedef struct dso_meth_st {
* libraries at all, let alone a DSO_METHOD implemented for them.
*/
DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname);
-/* I don't think this would actually be used in any circumstances. */
+ /* I don't think this would actually be used in any circumstances. */
# if 0
/* Unbinds a variable */
int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr);
diff --git a/thirdparties/common/include/openssl/ec.h b/thirdparties/common/include/openssl/ec.h
index 98edfdf..020dcaa 100755
--- a/thirdparties/common/include/openssl/ec.h
+++ b/thirdparties/common/include/openssl/ec.h
@@ -103,28 +103,29 @@ extern "C" {
/** Enum for the point conversion form as defined in X9.62 (ECDSA)
* for the encoding of a elliptic curve point (x,y) */
typedef enum {
- /** the point is encoded as z||x, where the octet z specifies
- * which solution of the quadratic equation y is */
+ /** the point is encoded as z||x, where the octet z specifies
+ * which solution of the quadratic equation y is */
POINT_CONVERSION_COMPRESSED = 2,
- /** the point is encoded as z||x||y, where z is the octet 0x02 */
+ /** the point is encoded as z||x||y, where z is the octet 0x02 */
POINT_CONVERSION_UNCOMPRESSED = 4,
- /** the point is encoded as z||x||y, where the octet z specifies
- * which solution of the quadratic equation y is */
+ /** the point is encoded as z||x||y, where the octet z specifies
+ * which solution of the quadratic equation y is */
POINT_CONVERSION_HYBRID = 6
-} point_conversion_form_t;
+}
+point_conversion_form_t;
typedef struct ec_method_st EC_METHOD;
typedef struct ec_group_st
- /*-
- EC_METHOD *meth;
- -- field definition
- -- curve coefficients
- -- optional generator with associated information (order, cofactor)
- -- optional extra data (precomputed table for fast computation of multiples of generator)
- -- ASN1 stuff
- */
- EC_GROUP;
+/*-
+ EC_METHOD *meth;
+ -- field definition
+ -- curve coefficients
+ -- optional generator with associated information (order, cofactor)
+ -- optional extra data (precomputed table for fast computation of multiples of generator)
+ -- ASN1 stuff
+*/
+ EC_GROUP;
typedef struct ec_point_st EC_POINT;
@@ -471,9 +472,9 @@ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
- EC_POINT *p, const BIGNUM *x,
- const BIGNUM *y, const BIGNUM *z,
- BN_CTX *ctx);
+ EC_POINT *p, const BIGNUM *x,
+ const BIGNUM *y, const BIGNUM *z,
+ BN_CTX *ctx);
/** Gets the jacobian projective coordinates of a EC_POINT over GFp
* \param group underlying EC_GROUP object
@@ -485,9 +486,9 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
- const EC_POINT *p, BIGNUM *x,
- BIGNUM *y, BIGNUM *z,
- BN_CTX *ctx);
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BIGNUM *z,
+ BN_CTX *ctx);
/** Sets the affine coordinates of a EC_POINT over GFp
* \param group underlying EC_GROUP object
@@ -522,8 +523,8 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,
- EC_POINT *p, const BIGNUM *x,
- int y_bit, BN_CTX *ctx);
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
# ifndef OPENSSL_NO_EC2M
/** Sets the affine coordinates of a EC_POINT over GF2m
* \param group underlying EC_GROUP object
@@ -534,8 +535,8 @@ int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
- const BIGNUM *x, const BIGNUM *y,
- BN_CTX *ctx);
+ const BIGNUM *x, const BIGNUM *y,
+ BN_CTX *ctx);
/** Gets the affine coordinates of a EC_POINT over GF2m
* \param group underlying EC_GROUP object
@@ -546,8 +547,8 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
- const EC_POINT *p, BIGNUM *x,
- BIGNUM *y, BN_CTX *ctx);
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BN_CTX *ctx);
/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
* \param group underlying EC_GROUP object
@@ -558,8 +559,8 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
* \return 1 on success and 0 if an error occured
*/
int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group,
- EC_POINT *p, const BIGNUM *x,
- int y_bit, BN_CTX *ctx);
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
# endif
/** Encodes a EC_POINT object to a octet string
* \param group underlying EC_GROUP object
@@ -884,7 +885,7 @@ int EC_KEY_check_key(const EC_KEY *key);
* \return 1 on success and 0 otherwise.
*/
int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
- BIGNUM *y);
+ BIGNUM *y);
/********************************************************************/
/* de- and encoding functions for SEC1 ECPrivateKey */
diff --git a/thirdparties/common/include/openssl/ecdh.h b/thirdparties/common/include/openssl/ecdh.h
index 25348b3..d688275 100755
--- a/thirdparties/common/include/openssl/ecdh.h
+++ b/thirdparties/common/include/openssl/ecdh.h
@@ -95,7 +95,7 @@ int ECDH_set_method(EC_KEY *, const ECDH_METHOD *);
int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,
- void *out, size_t *outlen));
+ void *out, size_t *outlen));
int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
*new_func, CRYPTO_EX_dup *dup_func,
diff --git a/thirdparties/common/include/openssl/ecdsa.h b/thirdparties/common/include/openssl/ecdsa.h
index c4016ac..a919198 100755
--- a/thirdparties/common/include/openssl/ecdsa.h
+++ b/thirdparties/common/include/openssl/ecdsa.h
@@ -261,10 +261,10 @@ void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);
void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char
- *dgst, int dgst_len,
- const BIGNUM *inv,
- const BIGNUM *rp,
- EC_KEY *eckey));
+ *dgst, int dgst_len,
+ const BIGNUM *inv,
+ const BIGNUM *rp,
+ EC_KEY *eckey));
/** Set the ECDSA_sign_setup function in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
@@ -273,9 +273,9 @@ void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
int (*ecdsa_sign_setup) (EC_KEY *eckey,
- BN_CTX *ctx,
- BIGNUM **kinv,
- BIGNUM **r));
+ BN_CTX *ctx,
+ BIGNUM **kinv,
+ BIGNUM **r));
/** Set the ECDSA_do_verify function in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
@@ -284,9 +284,9 @@ void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,
int (*ecdsa_do_verify) (const unsigned char
- *dgst, int dgst_len,
- const ECDSA_SIG *sig,
- EC_KEY *eckey));
+ *dgst, int dgst_len,
+ const ECDSA_SIG *sig,
+ EC_KEY *eckey));
void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);
diff --git a/thirdparties/common/include/openssl/engine.h b/thirdparties/common/include/openssl/engine.h
index bd7b591..dba27c3 100755
--- a/thirdparties/common/include/openssl/engine.h
+++ b/thirdparties/common/include/openssl/engine.h
@@ -299,16 +299,16 @@ extern "C" {
/* Flags specific to the nCipher "chil" engine */
# define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
- /*
- * Depending on the value of the (long)i argument, this sets or
- * unsets the SimpleForkCheck flag in the CHIL API to enable or
- * disable checking and workarounds for applications that fork().
- */
+/*
+ * Depending on the value of the (long)i argument, this sets or
+ * unsets the SimpleForkCheck flag in the CHIL API to enable or
+ * disable checking and workarounds for applications that fork().
+ */
# define ENGINE_CTRL_CHIL_NO_LOCKING 101
- /*
- * This prevents the initialisation function from providing mutex
- * callbacks to the nCipher library.
- */
+/*
+ * This prevents the initialisation function from providing mutex
+ * callbacks to the nCipher library.
+ */
/*
* If an ENGINE supports its own specific control commands and wishes the
@@ -336,14 +336,14 @@ typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
void (*f) (void));
/* Generic load_key function pointer */
typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
- UI_METHOD *ui_method,
- void *callback_data);
+ UI_METHOD *ui_method,
+ void *callback_data);
typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
- STACK_OF(X509_NAME) *ca_dn,
- X509 **pcert, EVP_PKEY **pkey,
- STACK_OF(X509) **pother,
- UI_METHOD *ui_method,
- void *callback_data);
+ STACK_OF(X509_NAME) *ca_dn,
+ X509 **pcert, EVP_PKEY **pkey,
+ STACK_OF(X509) **pother,
+ UI_METHOD *ui_method,
+ void *callback_data);
/*-
* These callback types are for an ENGINE's handler for cipher and digest logic.
* These handlers have these prototypes;
@@ -366,7 +366,7 @@ typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
const int **, int);
typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
- const int **, int);
+ const int **, int);
/*
* STRUCTURE functions ... all of these functions deal with pointers to
* ENGINE structures where the pointers have a "structural reference". This
@@ -567,8 +567,8 @@ int ENGINE_set_load_privkey_function(ENGINE *e,
ENGINE_LOAD_KEY_PTR loadpriv_f);
int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
- ENGINE_SSL_CLIENT_CERT_PTR
- loadssl_f);
+ ENGINE_SSL_CLIENT_CERT_PTR
+ loadssl_f);
int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
@@ -612,7 +612,7 @@ ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
- *e);
+ *e);
ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
@@ -622,11 +622,11 @@ const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
- const char *str,
- int len);
+ const char *str,
+ int len);
const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
- const char *str,
- int len);
+ const char *str,
+ int len);
const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
int ENGINE_get_flags(const ENGINE *e);
@@ -763,7 +763,7 @@ typedef struct st_dynamic_MEM_fns {
typedef void (*dyn_lock_locking_cb) (int, int, const char *, int);
typedef int (*dyn_lock_add_lock_cb) (int *, int, int, const char *, int);
typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb) (const char *,
- int);
+ int);
typedef void (*dyn_dynlock_lock_cb) (int, struct CRYPTO_dynlock_value *,
const char *, int);
typedef void (*dyn_dynlock_destroy_cb) (struct CRYPTO_dynlock_value *,
diff --git a/thirdparties/common/include/openssl/err.h b/thirdparties/common/include/openssl/err.h
index 585aa8b..488a6f7 100755
--- a/thirdparties/common/include/openssl/err.h
+++ b/thirdparties/common/include/openssl/err.h
@@ -329,7 +329,7 @@ unsigned long ERR_peek_error_line_data(const char **file, int *line,
unsigned long ERR_peek_last_error(void);
unsigned long ERR_peek_last_error_line(const char **file, int *line);
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
- const char **data, int *flags);
+ const char **data, int *flags);
void ERR_clear_error(void);
char *ERR_error_string(unsigned long e, char *buf);
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
diff --git a/thirdparties/common/include/openssl/evp.h b/thirdparties/common/include/openssl/evp.h
index 47abbac..df0dead 100755
--- a/thirdparties/common/include/openssl/evp.h
+++ b/thirdparties/common/include/openssl/evp.h
@@ -928,15 +928,15 @@ void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
const char *from, const char *to, void *x),
void *arg);
void EVP_CIPHER_do_all_sorted(void (*fn)
- (const EVP_CIPHER *ciph, const char *from,
- const char *to, void *x), void *arg);
+ (const EVP_CIPHER *ciph, const char *from,
+ const char *to, void *x), void *arg);
void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
const char *from, const char *to, void *x),
void *arg);
void EVP_MD_do_all_sorted(void (*fn)
- (const EVP_MD *ciph, const char *from,
- const char *to, void *x), void *arg);
+ (const EVP_MD *ciph, const char *from,
+ const char *to, void *x), void *arg);
int EVP_PKEY_decrypt_old(unsigned char *dec_key,
const unsigned char *enc_key, int enc_key_len,
@@ -1063,7 +1063,7 @@ int EVP_PKEY_asn1_get_count(void);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
- const char *str, int len);
+ const char *str, int len);
int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
int EVP_PKEY_asn1_add_alias(int to, int from);
int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
@@ -1080,47 +1080,47 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
int (*pub_decode) (EVP_PKEY *pk,
- X509_PUBKEY *pub),
+ X509_PUBKEY *pub),
int (*pub_encode) (X509_PUBKEY *pub,
- const EVP_PKEY *pk),
+ const EVP_PKEY *pk),
int (*pub_cmp) (const EVP_PKEY *a,
- const EVP_PKEY *b),
+ const EVP_PKEY *b),
int (*pub_print) (BIO *out,
- const EVP_PKEY *pkey,
- int indent, ASN1_PCTX *pctx),
+ const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx),
int (*pkey_size) (const EVP_PKEY *pk),
int (*pkey_bits) (const EVP_PKEY *pk));
void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
int (*priv_decode) (EVP_PKEY *pk,
- PKCS8_PRIV_KEY_INFO
- *p8inf),
+ PKCS8_PRIV_KEY_INFO
+ *p8inf),
int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8,
- const EVP_PKEY *pk),
+ const EVP_PKEY *pk),
int (*priv_print) (BIO *out,
- const EVP_PKEY *pkey,
- int indent,
- ASN1_PCTX *pctx));
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
int (*param_decode) (EVP_PKEY *pkey,
- const unsigned char **pder,
- int derlen),
+ const unsigned char **pder,
+ int derlen),
int (*param_encode) (const EVP_PKEY *pkey,
- unsigned char **pder),
+ unsigned char **pder),
int (*param_missing) (const EVP_PKEY *pk),
int (*param_copy) (EVP_PKEY *to,
- const EVP_PKEY *from),
+ const EVP_PKEY *from),
int (*param_cmp) (const EVP_PKEY *a,
- const EVP_PKEY *b),
+ const EVP_PKEY *b),
int (*param_print) (BIO *out,
- const EVP_PKEY *pkey,
- int indent,
- ASN1_PCTX *pctx));
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
void (*pkey_free) (EVP_PKEY *pkey));
void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
int (*pkey_ctrl) (EVP_PKEY *pkey, int op,
- long arg1, void *arg2));
+ long arg1, void *arg2));
# define EVP_PKEY_OP_UNDEFINED 0
# define EVP_PKEY_OP_PARAMGEN (1<<1)
@@ -1261,7 +1261,7 @@ void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
int (*copy) (EVP_PKEY_CTX *dst,
- EVP_PKEY_CTX *src));
+ EVP_PKEY_CTX *src));
void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
void (*cleanup) (EVP_PKEY_CTX *ctx));
@@ -1269,84 +1269,84 @@ void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
int (*paramgen_init) (EVP_PKEY_CTX *ctx),
int (*paramgen) (EVP_PKEY_CTX *ctx,
- EVP_PKEY *pkey));
+ EVP_PKEY *pkey));
void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
int (*keygen_init) (EVP_PKEY_CTX *ctx),
int (*keygen) (EVP_PKEY_CTX *ctx,
- EVP_PKEY *pkey));
+ EVP_PKEY *pkey));
void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
int (*sign_init) (EVP_PKEY_CTX *ctx),
int (*sign) (EVP_PKEY_CTX *ctx,
- unsigned char *sig, size_t *siglen,
- const unsigned char *tbs,
- size_t tbslen));
+ unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
int (*verify_init) (EVP_PKEY_CTX *ctx),
int (*verify) (EVP_PKEY_CTX *ctx,
- const unsigned char *sig,
- size_t siglen,
- const unsigned char *tbs,
- size_t tbslen));
+ const unsigned char *sig,
+ size_t siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
int (*verify_recover_init) (EVP_PKEY_CTX
- *ctx),
+ *ctx),
int (*verify_recover) (EVP_PKEY_CTX
- *ctx,
- unsigned char
- *sig,
- size_t *siglen,
- const unsigned
- char *tbs,
- size_t tbslen));
+ *ctx,
+ unsigned char
+ *sig,
+ size_t *siglen,
+ const unsigned
+ char *tbs,
+ size_t tbslen));
void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
int (*signctx_init) (EVP_PKEY_CTX *ctx,
- EVP_MD_CTX *mctx),
+ EVP_MD_CTX *mctx),
int (*signctx) (EVP_PKEY_CTX *ctx,
- unsigned char *sig,
- size_t *siglen,
- EVP_MD_CTX *mctx));
+ unsigned char *sig,
+ size_t *siglen,
+ EVP_MD_CTX *mctx));
void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
- EVP_MD_CTX *mctx),
+ EVP_MD_CTX *mctx),
int (*verifyctx) (EVP_PKEY_CTX *ctx,
- const unsigned char *sig,
- int siglen,
- EVP_MD_CTX *mctx));
+ const unsigned char *sig,
+ int siglen,
+ EVP_MD_CTX *mctx));
void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
int (*encrypt_init) (EVP_PKEY_CTX *ctx),
int (*encryptfn) (EVP_PKEY_CTX *ctx,
- unsigned char *out,
- size_t *outlen,
- const unsigned char *in,
- size_t inlen));
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
int (*decrypt_init) (EVP_PKEY_CTX *ctx),
int (*decrypt) (EVP_PKEY_CTX *ctx,
- unsigned char *out,
- size_t *outlen,
- const unsigned char *in,
- size_t inlen));
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
int (*derive_init) (EVP_PKEY_CTX *ctx),
int (*derive) (EVP_PKEY_CTX *ctx,
- unsigned char *key,
- size_t *keylen));
+ unsigned char *key,
+ size_t *keylen));
void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
- void *p2),
+ void *p2),
int (*ctrl_str) (EVP_PKEY_CTX *ctx,
- const char *type,
- const char *value));
+ const char *type,
+ const char *value));
void EVP_add_alg_module(void);
diff --git a/thirdparties/common/include/openssl/ocsp.h b/thirdparties/common/include/openssl/ocsp.h
index ca2ee76..89c052b 100755
--- a/thirdparties/common/include/openssl/ocsp.h
+++ b/thirdparties/common/include/openssl/ocsp.h
@@ -274,26 +274,26 @@ typedef struct ocsp_response_data_st {
* signature BIT STRING,
* certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
*/
- /*
- * Note 1: The value for "signature" is specified in the OCSP rfc2560 as
- * follows: "The value for the signature SHALL be computed on the hash of
- * the DER encoding ResponseData." This means that you must hash the
- * DER-encoded tbsResponseData, and then run it through a crypto-signing
- * function, which will (at least w/RSA) do a hash-'n'-private-encrypt
- * operation. This seems a bit odd, but that's the spec. Also note that
- * the data structures do not leave anywhere to independently specify the
- * algorithm used for the initial hash. So, we look at the
- * signature-specification algorithm, and try to do something intelligent.
- * -- Kathy Weinhold, CertCo
- */
- /*
- * Note 2: It seems that the mentioned passage from RFC 2560 (section
- * 4.2.1) is open for interpretation. I've done tests against another
- * responder, and found that it doesn't do the double hashing that the RFC
- * seems to say one should. Therefore, all relevant functions take a flag
- * saying which variant should be used. -- Richard Levitte, OpenSSL team
- * and CeloCom
- */
+/*
+ * Note 1: The value for "signature" is specified in the OCSP rfc2560 as
+ * follows: "The value for the signature SHALL be computed on the hash of
+ * the DER encoding ResponseData." This means that you must hash the
+ * DER-encoded tbsResponseData, and then run it through a crypto-signing
+ * function, which will (at least w/RSA) do a hash-'n'-private-encrypt
+ * operation. This seems a bit odd, but that's the spec. Also note that
+ * the data structures do not leave anywhere to independently specify the
+ * algorithm used for the initial hash. So, we look at the
+ * signature-specification algorithm, and try to do something intelligent.
+ * -- Kathy Weinhold, CertCo
+ */
+/*
+ * Note 2: It seems that the mentioned passage from RFC 2560 (section
+ * 4.2.1) is open for interpretation. I've done tests against another
+ * responder, and found that it doesn't do the double hashing that the RFC
+ * seems to say one should. Therefore, all relevant functions take a flag
+ * saying which variant should be used. -- Richard Levitte, OpenSSL team
+ * and CeloCom
+ */
typedef struct ocsp_basic_response_st {
OCSP_RESPDATA *tbsResponseData;
X509_ALGOR *signatureAlgorithm;
diff --git a/thirdparties/common/include/openssl/opensslconf.h b/thirdparties/common/include/openssl/opensslconf.h
index ae38745..8d1f983 100755
--- a/thirdparties/common/include/openssl/opensslconf.h
+++ b/thirdparties/common/include/openssl/opensslconf.h
@@ -223,7 +223,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
@@ -236,11 +236,11 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
# define DES_PTR
# define DES_RISC2
#elif defined ( _AIX ) /* RS6000 */
- /* Unknown */
+/* Unknown */
#elif defined( __hpux ) /* HP-PA */
- /* Unknown */
+/* Unknown */
#elif defined( __aux ) /* 68K */
- /* Unknown */
+/* Unknown */
#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
# define DES_UNROLL
#elif defined( __sgi ) /* Newer MIPS */
diff --git a/thirdparties/common/include/openssl/ossl_typ.h b/thirdparties/common/include/openssl/ossl_typ.h
index 9144ea2..65572c7 100755
--- a/thirdparties/common/include/openssl/ossl_typ.h
+++ b/thirdparties/common/include/openssl/ossl_typ.h
@@ -188,7 +188,7 @@ typedef struct DIST_POINT_st DIST_POINT;
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
- /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
+/* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */
# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */
diff --git a/thirdparties/common/include/openssl/pem.h b/thirdparties/common/include/openssl/pem.h
index d3b23fc..3f6e7a1 100755
--- a/thirdparties/common/include/openssl/pem.h
+++ b/thirdparties/common/include/openssl/pem.h
@@ -138,10 +138,10 @@ extern "C" {
# define PEM_STRING_PARAMETERS "PARAMETERS"
# define PEM_STRING_CMS "CMS"
- /*
- * Note that this structure is initialised by PEM_SealInit and cleaned up
- * by PEM_SealFinal (at least for now)
- */
+/*
+ * Note that this structure is initialised by PEM_SealInit and cleaned up
+ * by PEM_SealFinal (at least for now)
+ */
typedef struct PEM_Encode_Seal_st {
EVP_ENCODE_CTX encode;
EVP_MD_CTX md;
@@ -182,9 +182,9 @@ typedef struct pem_ctx_st {
int num_recipient;
PEM_USER **recipient;
-/*-
- XXX(ben): don#t think this is used!
- STACK *x509_chain; / * certificate chain */
+ /*-
+ XXX(ben): don#t think this is used!
+ STACK *x509_chain; / * certificate chain */
EVP_MD *md; /* signature type */
int md_enc; /* is the md encrypted or not? */
@@ -194,9 +194,9 @@ typedef struct pem_ctx_st {
EVP_CIPHER *dec; /* date encryption cipher */
int key_len; /* key length */
unsigned char *key; /* key */
- /*-
- unused, and wrong size
- unsigned char iv[8]; */
+ /*-
+ unused, and wrong size
+ unsigned char iv[8]; */
int data_enc; /* is the data encrypted */
int data_len;
@@ -411,7 +411,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
pem_password_cb *cb, void *u);
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
- pem_password_cb *cb, void *u);
+ pem_password_cb *cb, void *u);
int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
unsigned char *kstr, int klen,
pem_password_cb *cd, void *u);
diff --git a/thirdparties/common/include/openssl/pkcs12.h b/thirdparties/common/include/openssl/pkcs12.h
index a39adf5..31c781a 100755
--- a/thirdparties/common/include/openssl/pkcs12.h
+++ b/thirdparties/common/include/openssl/pkcs12.h
@@ -175,12 +175,12 @@ X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
- int nid1, int nid2);
+ int nid1, int nid2);
PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass,
int passlen);
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag,
- const char *pass, int passlen);
+ const char *pass, int passlen);
X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
const char *pass, int passlen, unsigned char *salt,
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
@@ -194,7 +194,7 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
unsigned char *salt, int saltlen, int iter,
STACK_OF(PKCS12_SAFEBAG) *bags);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
- int passlen);
+ int passlen);
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);
@@ -218,9 +218,9 @@ void *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
const char *pass, int passlen,
ASN1_OCTET_STRING *oct, int zbuf);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
- const ASN1_ITEM *it,
- const char *pass, int passlen,
- void *obj, int zbuf);
+ const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ void *obj, int zbuf);
PKCS12 *PKCS12_init(int mode);
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
int saltlen, int id, int iter, int n,
diff --git a/thirdparties/common/include/openssl/pkcs7.h b/thirdparties/common/include/openssl/pkcs7.h
index b51b386..49d9a3b 100755
--- a/thirdparties/common/include/openssl/pkcs7.h
+++ b/thirdparties/common/include/openssl/pkcs7.h
@@ -339,8 +339,8 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags);
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
- X509 *signcert, EVP_PKEY *pkey,
- const EVP_MD *md, int flags);
+ X509 *signcert, EVP_PKEY *pkey,
+ const EVP_MD *md, int flags);
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
diff --git a/thirdparties/common/include/openssl/rsa.h b/thirdparties/common/include/openssl/rsa.h
index d2ee374..8bc95d0 100755
--- a/thirdparties/common/include/openssl/rsa.h
+++ b/thirdparties/common/include/openssl/rsa.h
@@ -324,14 +324,14 @@ int RSA_size(const RSA *rsa);
/* Deprecated version */
# ifndef OPENSSL_NO_DEPRECATED
RSA *RSA_generate_key(int bits, unsigned long e, void
- (*callback) (int, int, void *), void *cb_arg);
+ (*callback) (int, int, void *), void *cb_arg);
# endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
int RSA_check_key(const RSA *);
- /* next 4 return -1 on error */
+/* next 4 return -1 on error */
int RSA_public_encrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int RSA_private_encrypt(int flen, const unsigned char *from,
diff --git a/thirdparties/common/include/openssl/srp.h b/thirdparties/common/include/openssl/srp.h
index d072536..ae363d4 100755
--- a/thirdparties/common/include/openssl/srp.h
+++ b/thirdparties/common/include/openssl/srp.h
@@ -95,7 +95,7 @@ DECLARE_STACK_OF(SRP_user_pwd)
typedef struct SRP_VBASE_st {
STACK_OF(SRP_user_pwd) *users_pwd;
STACK_OF(SRP_gN_cache) *gN_cache;
-/* to simulate a user */
+ /* to simulate a user */
char *seed_key;
BIGNUM *default_g;
BIGNUM *default_N;
diff --git a/thirdparties/common/include/openssl/ssl.h b/thirdparties/common/include/openssl/ssl.h
index a6d845d..f79cea6 100755
--- a/thirdparties/common/include/openssl/ssl.h
+++ b/thirdparties/common/include/openssl/ssl.h
@@ -388,12 +388,12 @@ typedef struct srtp_protection_profile_st {
DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s,
- const unsigned char *data,
- int len, void *arg);
+ const unsigned char *data,
+ int len, void *arg);
typedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret,
- int *secret_len,
- STACK_OF(SSL_CIPHER) *peer_ciphers,
- SSL_CIPHER **cipher, void *arg);
+ int *secret_len,
+ STACK_OF(SSL_CIPHER) *peer_ciphers,
+ SSL_CIPHER **cipher, void *arg);
# ifndef OPENSSL_NO_TLSEXT
@@ -833,8 +833,8 @@ struct ssl_session_st {
void SSL_CTX_set_msg_callback(SSL_CTX *ctx,
void (*cb) (int write_p, int version,
- int content_type, const void *buf,
- size_t len, SSL *ssl, void *arg));
+ int content_type, const void *buf,
+ size_t len, SSL *ssl, void *arg));
void SSL_set_msg_callback(SSL *ssl,
void (*cb) (int write_p, int version,
int content_type, const void *buf,
@@ -879,10 +879,10 @@ int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key);
# if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
# define SSL_MAX_CERT_LIST_DEFAULT 1024*30
- /* 30k max cert list :-) */
+/* 30k max cert list :-) */
# else
# define SSL_MAX_CERT_LIST_DEFAULT 1024*100
- /* 100k max cert list :-) */
+/* 100k max cert list :-) */
# endif
# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
@@ -1092,7 +1092,7 @@ struct ssl_ctx_st {
/* draft-rescorla-tls-opaque-prf-input-00.txt information */
int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput,
- size_t len, void *arg);
+ size_t len, void *arg);
void *tlsext_opaque_prf_input_callback_arg;
# endif
@@ -1224,64 +1224,64 @@ LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx);
void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,
int (*new_session_cb) (struct ssl_st *ssl,
- SSL_SESSION *sess));
+ SSL_SESSION *sess));
int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
- SSL_SESSION *sess);
+ SSL_SESSION *sess);
void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
void (*remove_session_cb) (struct ssl_ctx_st
- *ctx,
- SSL_SESSION
- *sess));
+ *ctx,
+ SSL_SESSION
+ *sess));
void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx,
- SSL_SESSION *sess);
+ SSL_SESSION *sess);
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
SSL_SESSION *(*get_session_cb) (struct ssl_st
- *ssl,
- unsigned char
- *data, int len,
- int *copy));
+ *ssl,
+ unsigned char
+ *data, int len,
+ int *copy));
SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
- unsigned char *Data,
- int len, int *copy);
+ unsigned char *Data,
+ int len, int *copy);
void SSL_CTX_set_info_callback(SSL_CTX *ctx,
void (*cb) (const SSL *ssl, int type,
- int val));
+ int val));
void (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type,
- int val);
+ int val);
void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
int (*client_cert_cb) (SSL *ssl, X509 **x509,
- EVP_PKEY **pkey));
+ EVP_PKEY **pkey));
int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509,
- EVP_PKEY **pkey);
+ EVP_PKEY **pkey);
# ifndef OPENSSL_NO_ENGINE
int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
# endif
void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,
int (*app_gen_cookie_cb) (SSL *ssl,
- unsigned char
- *cookie,
- unsigned int
- *cookie_len));
+ unsigned char
+ *cookie,
+ unsigned int
+ *cookie_len));
void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
int (*app_verify_cookie_cb) (SSL *ssl,
- unsigned char
- *cookie,
- unsigned int
- cookie_len));
+ unsigned char
+ *cookie,
+ unsigned int
+ cookie_len));
# ifndef OPENSSL_NO_NEXTPROTONEG
void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,
- int (*cb) (SSL *ssl,
- const unsigned char
- **out,
- unsigned int *outlen,
- void *arg), void *arg);
+ int (*cb) (SSL *ssl,
+ const unsigned char
+ **out,
+ unsigned int *outlen,
+ void *arg), void *arg);
void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,
int (*cb) (SSL *ssl,
- unsigned char **out,
- unsigned char *outlen,
- const unsigned char *in,
- unsigned int inlen,
- void *arg), void *arg);
+ unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
unsigned *len);
# endif
@@ -1303,11 +1303,11 @@ int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,
unsigned protos_len);
void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx,
int (*cb) (SSL *ssl,
- const unsigned char **out,
- unsigned char *outlen,
- const unsigned char *in,
- unsigned int inlen,
- void *arg), void *arg);
+ const unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
unsigned *len);
@@ -1320,62 +1320,62 @@ void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
# define PSK_MAX_PSK_LEN 256
void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
unsigned int (*psk_client_callback) (SSL
- *ssl,
- const
- char
- *hint,
- char
- *identity,
- unsigned
- int
- max_identity_len,
- unsigned
- char
- *psk,
- unsigned
- int
- max_psk_len));
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
void SSL_set_psk_client_callback(SSL *ssl,
unsigned int (*psk_client_callback) (SSL
- *ssl,
- const
- char
- *hint,
- char
- *identity,
- unsigned
- int
- max_identity_len,
- unsigned
- char
- *psk,
- unsigned
- int
- max_psk_len));
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx,
unsigned int (*psk_server_callback) (SSL
- *ssl,
- const
- char
- *identity,
- unsigned
- char
- *psk,
- unsigned
- int
- max_psk_len));
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
void SSL_set_psk_server_callback(SSL *ssl,
unsigned int (*psk_server_callback) (SSL
- *ssl,
- const
- char
- *identity,
- unsigned
- char
- *psk,
- unsigned
- int
- max_psk_len));
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint);
int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint);
const char *SSL_get_psk_identity_hint(const SSL *s);
@@ -1653,12 +1653,12 @@ struct ssl_st {
STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
/* What's been chosen */
SRTP_PROTECTION_PROFILE *srtp_profile;
- /*-
- * Is use of the Heartbeat extension negotiated?
- * 0: disabled
- * 1: enabled
- * 2: enabled, but not allowed to send Requests
- */
+ /*-
+ * Is use of the Heartbeat extension negotiated?
+ * 0: disabled
+ * 1: enabled
+ * 2: enabled, but not allowed to send Requests
+ */
unsigned int tlsext_heartbeat;
/* Indicates if a HeartbeatRequest is in flight */
unsigned int tlsext_hb_pending;
@@ -2257,7 +2257,7 @@ STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int,
- X509_STORE_CTX *);
+ X509_STORE_CTX *);
void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,
int (*callback) (int, X509_STORE_CTX *));
void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth);
@@ -2309,7 +2309,7 @@ int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);
int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,
char *(*cb) (SSL *, void *));
int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,
- int (*cb) (SSL *, void *));
+ int (*cb) (SSL *, void *));
int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
int (*cb) (SSL *, int *, void *));
int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);
@@ -2448,7 +2448,7 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
void SSL_set_info_callback(SSL *ssl,
void (*cb) (const SSL *ssl, int type, int val));
void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,
- int val);
+ int val);
int SSL_state(const SSL *ssl);
void SSL_set_state(SSL *ssl, int state);
@@ -2504,20 +2504,20 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void);
# define SSL_set_max_send_fragment(ssl,m) \
SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
- /* NB: the keylength is only applicable when is_export is true */
+/* NB: the keylength is only applicable when is_export is true */
# ifndef OPENSSL_NO_RSA
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
RSA *(*cb) (SSL *ssl, int is_export,
- int keylength));
+ int keylength));
void SSL_set_tmp_rsa_callback(SSL *ssl,
RSA *(*cb) (SSL *ssl, int is_export,
- int keylength));
+ int keylength));
# endif
# ifndef OPENSSL_NO_DH
void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
DH *(*dh) (SSL *ssl, int is_export,
- int keylength));
+ int keylength));
void SSL_set_tmp_dh_callback(SSL *ssl,
DH *(*dh) (SSL *ssl, int is_export,
int keylength));
@@ -2525,10 +2525,10 @@ void SSL_set_tmp_dh_callback(SSL *ssl,
# ifndef OPENSSL_NO_ECDH
void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
EC_KEY *(*ecdh) (SSL *ssl, int is_export,
- int keylength));
+ int keylength));
void SSL_set_tmp_ecdh_callback(SSL *ssl,
EC_KEY *(*ecdh) (SSL *ssl, int is_export,
- int keylength));
+ int keylength));
# endif
# ifndef OPENSSL_NO_COMP
@@ -2537,7 +2537,7 @@ const COMP_METHOD *SSL_get_current_expansion(SSL *s);
const char *SSL_COMP_get_name(const COMP_METHOD *comp);
STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
- *meths);
+ *meths);
void SSL_COMP_free_compression_methods(void);
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
# else
diff --git a/thirdparties/common/include/openssl/ssl2.h b/thirdparties/common/include/openssl/ssl2.h
index 03c7dd8..499d921 100755
--- a/thirdparties/common/include/openssl/ssl2.h
+++ b/thirdparties/common/include/openssl/ssl2.h
@@ -137,7 +137,7 @@ extern "C" {
# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u
# else
# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u
- /* 2^15-1 */
+/* 2^15-1 */
# endif
# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383/* 2^14-1 */
diff --git a/thirdparties/common/include/openssl/ssl3.h b/thirdparties/common/include/openssl/ssl3.h
index e681d50..8c0c7fb 100755
--- a/thirdparties/common/include/openssl/ssl3.h
+++ b/thirdparties/common/include/openssl/ssl3.h
@@ -284,14 +284,14 @@ extern "C" {
# define SSL3_HM_HEADER_LENGTH 4
# ifndef SSL3_ALIGN_PAYLOAD
- /*
- * Some will argue that this increases memory footprint, but it's not
- * actually true. Point is that malloc has to return at least 64-bit aligned
- * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
- * Suggested pre-gaping simply moves these wasted bytes from the end of
- * allocated region to its front, but makes data payload aligned, which
- * improves performance:-)
- */
+/*
+ * Some will argue that this increases memory footprint, but it's not
+ * actually true. Point is that malloc has to return at least 64-bit aligned
+ * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
+ * Suggested pre-gaping simply moves these wasted bytes from the end of
+ * allocated region to its front, but makes data payload aligned, which
+ * improves performance:-)
+ */
# define SSL3_ALIGN_PAYLOAD 8
# else
# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0
diff --git a/thirdparties/common/include/openssl/stack.h b/thirdparties/common/include/openssl/stack.h
index eb07216..539e95e 100755
--- a/thirdparties/common/include/openssl/stack.h
+++ b/thirdparties/common/include/openssl/stack.h
@@ -95,7 +95,7 @@ void *sk_shift(_STACK *st);
void *sk_pop(_STACK *st);
void sk_zero(_STACK *st);
int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
- (const void *, const void *);
+(const void *, const void *);
_STACK *sk_dup(_STACK *st);
void sk_sort(_STACK *st);
int sk_is_sorted(const _STACK *st);
diff --git a/thirdparties/common/include/openssl/ts.h b/thirdparties/common/include/openssl/ts.h
index 16eccbb..3f87394 100755
--- a/thirdparties/common/include/openssl/ts.h
+++ b/thirdparties/common/include/openssl/ts.h
@@ -341,8 +341,8 @@ ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);
int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);
ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
- const unsigned char **pp,
- long length);
+ const unsigned char **pp,
+ long length);
ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
ESS_CERT_ID *ESS_CERT_ID_new(void);
@@ -561,7 +561,7 @@ int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,
* '3' msec, '6' usec, and so on. Default is 0.
*/
int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,
- unsigned clock_precision_digits);
+ unsigned clock_precision_digits);
/* At most we accept usec precision. */
# define TS_MAX_CLOCK_PRECISION_DIGITS 6
diff --git a/thirdparties/common/include/openssl/ui.h b/thirdparties/common/include/openssl/ui.h
index b917eda..9f3371a 100755
--- a/thirdparties/common/include/openssl/ui.h
+++ b/thirdparties/common/include/openssl/ui.h
@@ -329,18 +329,18 @@ int UI_method_set_reader(UI_METHOD *method,
int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
int UI_method_set_prompt_constructor(UI_METHOD *method,
char *(*prompt_constructor) (UI *ui,
- const char
- *object_desc,
- const char
- *object_name));
+ const char
+ *object_desc,
+ const char
+ *object_name));
int (*UI_method_get_opener(UI_METHOD *method)) (UI *);
int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *);
int (*UI_method_get_flusher(UI_METHOD *method)) (UI *);
int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *);
int (*UI_method_get_closer(UI_METHOD *method)) (UI *);
char *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *,
- const char *,
- const char *);
+ const char *,
+ const char *);
/*
* The following functions are helpers for method writers to access relevant
diff --git a/thirdparties/common/include/openssl/x509.h b/thirdparties/common/include/openssl/x509.h
index 99337b8..eefd08f 100755
--- a/thirdparties/common/include/openssl/x509.h
+++ b/thirdparties/common/include/openssl/x509.h
@@ -184,7 +184,7 @@ struct X509_name_st {
# else
char *bytes;
# endif
-/* unsigned long hash; Keep the hash around for lookups */
+ /* unsigned long hash; Keep the hash around for lookups */
unsigned char *canon_enc;
int canon_enclen;
} /* X509_NAME */ ;
@@ -550,7 +550,7 @@ typedef struct PBE2PARAM_st {
} PBE2PARAM;
typedef struct PBKDF2PARAM_st {
-/* Usually OCTET STRING but could be anything */
+ /* Usually OCTET STRING but could be anything */
ASN1_TYPE *salt;
ASN1_INTEGER *iter;
ASN1_INTEGER *keylength;
@@ -609,11 +609,11 @@ void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),
int (*crl_free) (X509_CRL *crl),
int (*crl_lookup) (X509_CRL *crl,
- X509_REVOKED **ret,
- ASN1_INTEGER *ser,
- X509_NAME *issuer),
+ X509_REVOKED **ret,
+ ASN1_INTEGER *ser,
+ X509_NAME *issuer),
int (*crl_verify) (X509_CRL *crl,
- EVP_PKEY *pk));
+ EVP_PKEY *pk));
void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
@@ -696,7 +696,7 @@ int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
- PKCS8_PRIV_KEY_INFO **p8inf);
+ PKCS8_PRIV_KEY_INFO **p8inf);
int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
@@ -735,7 +735,7 @@ int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
- PKCS8_PRIV_KEY_INFO **p8inf);
+ PKCS8_PRIV_KEY_INFO **p8inf);
int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
@@ -843,7 +843,7 @@ int X509_keyid_set1(X509 *x, unsigned char *id, int len);
unsigned char *X509_alias_get0(X509 *x, int *len);
unsigned char *X509_keyid_get0(X509 *x, int *len);
int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
- int);
+ int);
int X509_TRUST_set(int *t, int trust);
int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
@@ -1030,19 +1030,19 @@ int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
unsigned char *bytes, int len, int loc,
int set);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
- const char *field, int type,
- const unsigned char *bytes,
- int len);
+ const char *field, int type,
+ const unsigned char *bytes,
+ int len);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
- int type, unsigned char *bytes,
- int len);
+ int type, unsigned char *bytes,
+ int len);
int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
const unsigned char *bytes, int len, int loc,
int set);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
- ASN1_OBJECT *obj, int type,
- const unsigned char *bytes,
- int len);
+ ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes,
+ int len);
int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj);
int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
const unsigned char *bytes, int len);
@@ -1059,7 +1059,7 @@ int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
- X509_EXTENSION *ex, int loc);
+ X509_EXTENSION *ex, int loc);
int X509_get_ext_count(X509 *x);
int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
@@ -1096,11 +1096,11 @@ int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
unsigned long flags);
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
- int nid, int crit,
- ASN1_OCTET_STRING *data);
+ int nid, int crit,
+ ASN1_OCTET_STRING *data);
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
- ASN1_OBJECT *obj, int crit,
- ASN1_OCTET_STRING *data);
+ ASN1_OBJECT *obj, int crit,
+ ASN1_OCTET_STRING *data);
int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj);
int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
@@ -1116,34 +1116,34 @@ int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
- X509_ATTRIBUTE *attr);
+ X509_ATTRIBUTE *attr);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
- **x, const ASN1_OBJECT *obj,
- int type,
- const unsigned char *bytes,
- int len);
+ **x, const ASN1_OBJECT *obj,
+ int type,
+ const unsigned char *bytes,
+ int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
- **x, int nid, int type,
- const unsigned char *bytes,
- int len);
+ **x, int nid, int type,
+ const unsigned char *bytes,
+ int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
- **x, const char *attrname,
- int type,
- const unsigned char *bytes,
- int len);
+ **x, const char *attrname,
+ int type,
+ const unsigned char *bytes,
+ int len);
void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj,
int lastpos, int type);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
- int atrtype, const void *data,
- int len);
+ int atrtype, const void *data,
+ int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
- const ASN1_OBJECT *obj,
- int atrtype, const void *data,
- int len);
+ const ASN1_OBJECT *obj,
+ int atrtype, const void *data,
+ int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
- const char *atrname, int type,
- const unsigned char *bytes,
- int len);
+ const char *atrname, int type,
+ const unsigned char *bytes,
+ int len);
int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
const void *data, int len);
diff --git a/thirdparties/common/include/openssl/x509_vfy.h b/thirdparties/common/include/openssl/x509_vfy.h
index a6f0df5..281228c 100755
--- a/thirdparties/common/include/openssl/x509_vfy.h
+++ b/thirdparties/common/include/openssl/x509_vfy.h
@@ -448,7 +448,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
X509_NAME *name);
X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
- int type, X509_NAME *name);
+ int type, X509_NAME *name);
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
X509_OBJECT *x);
void X509_OBJECT_up_ref_count(X509_OBJECT *a);
@@ -468,8 +468,8 @@ void X509_STORE_set_verify_cb(X509_STORE *ctx,
void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX
- *ctx,
- X509_NAME *nm));
+ *ctx,
+ X509_NAME *nm));
X509_STORE_CTX *X509_STORE_CTX_new(void);
@@ -612,28 +612,28 @@ void X509_policy_tree_free(X509_POLICY_TREE *tree);
int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
- int i);
+ int i);
STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const
- X509_POLICY_TREE
- *tree);
+ X509_POLICY_TREE
+ *tree);
STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const
- X509_POLICY_TREE
- *tree);
+ X509_POLICY_TREE
+ *tree);
int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level,
- int i);
+ int i);
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
- X509_POLICY_NODE
- *node);
+ X509_POLICY_NODE
+ *node);
const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
- *node);
+ *node);
#ifdef __cplusplus
}
diff --git a/thirdparties/common/include/openssl/x509v3.h b/thirdparties/common/include/openssl/x509v3.h
index f5c6156..756faac 100755
--- a/thirdparties/common/include/openssl/x509v3.h
+++ b/thirdparties/common/include/openssl/x509v3.h
@@ -85,8 +85,8 @@ typedef void (*X509V3_EXT_FREE) (void *);
typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
typedef int (*X509V3_EXT_I2D) (void *, unsigned char **);
typedef STACK_OF(CONF_VALUE) *
- (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext,
- STACK_OF(CONF_VALUE) *extlist);
+(*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext,
+ STACK_OF(CONF_VALUE) *extlist);
typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method,
struct v3_ext_ctx *ctx,
STACK_OF(CONF_VALUE) *values);
@@ -104,20 +104,20 @@ typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method,
struct v3_ext_method {
int ext_nid;
int ext_flags;
-/* If this is set the following four fields are ignored */
+ /* If this is set the following four fields are ignored */
ASN1_ITEM_EXP *it;
-/* Old style ASN1 calls */
+ /* Old style ASN1 calls */
X509V3_EXT_NEW ext_new;
X509V3_EXT_FREE ext_free;
X509V3_EXT_D2I d2i;
X509V3_EXT_I2D i2d;
-/* The following pair is used for string extensions */
+ /* The following pair is used for string extensions */
X509V3_EXT_I2S i2s;
X509V3_EXT_S2I s2i;
-/* The following pair is used for multi-valued extensions */
+ /* The following pair is used for multi-valued extensions */
X509V3_EXT_I2V i2v;
X509V3_EXT_V2I v2i;
-/* The following are used for raw extensions */
+ /* The following are used for raw extensions */
X509V3_EXT_I2R i2r;
X509V3_EXT_R2I r2i;
void *usr_data; /* Any extension specific data */
@@ -140,7 +140,7 @@ struct v3_ext_ctx {
X509_CRL *crl;
X509V3_CONF_METHOD *db_meth;
void *db;
-/* Maybe more here */
+ /* Maybe more here */
};
typedef struct v3_ext_method X509V3_EXT_METHOD;
@@ -229,7 +229,7 @@ typedef struct DIST_POINT_NAME_st {
GENERAL_NAMES *fullname;
STACK_OF(X509_NAME_ENTRY) *relativename;
} name;
-/* If relativename then this contains the full distribution point name */
+ /* If relativename then this contains the full distribution point name */
X509_NAME *dpname;
} DIST_POINT_NAME;
/* All existing reasons */
@@ -530,8 +530,8 @@ ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *nval);
STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
- ASN1_BIT_STRING *bits,
- STACK_OF(CONF_VALUE) *extlist);
+ ASN1_BIT_STRING *bits,
+ STACK_OF(CONF_VALUE) *extlist);
STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
GENERAL_NAME *gen,
@@ -559,7 +559,7 @@ int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
ASN1_OCTET_STRING *ia5);
ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
- X509V3_CTX *ctx, char *str);
+ X509V3_CTX *ctx, char *str);
DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a);
diff --git a/thirdparties/common/include/opus/opus.h b/thirdparties/common/include/opus/opus.h
index 847a07c..74f2d1c 100755
--- a/thirdparties/common/include/opus/opus.h
+++ b/thirdparties/common/include/opus/opus.h
@@ -525,12 +525,12 @@ OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
* @returns number of frames
*/
OPUS_EXPORT int opus_packet_parse(
- const unsigned char *data,
- opus_int32 len,
- unsigned char *out_toc,
- const unsigned char *frames[48],
- short size[48],
- int *payload_offset
+ const unsigned char *data,
+ opus_int32 len,
+ unsigned char *out_toc,
+ const unsigned char *frames[48],
+ short size[48],
+ int *payload_offset
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Gets the bandwidth of an Opus packet.
diff --git a/thirdparties/common/include/opus/opus_multistream.h b/thirdparties/common/include/opus/opus_multistream.h
index 658067f..8e8c6b7 100755
--- a/thirdparties/common/include/opus/opus_multistream.h
+++ b/thirdparties/common/include/opus/opus_multistream.h
@@ -201,8 +201,8 @@ typedef struct OpusMSDecoder OpusMSDecoder;
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
/** Allocates and initializes a multistream encoder state.
@@ -249,13 +249,13 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Initialize a previously allocated multistream encoder state.
@@ -307,13 +307,13 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_crea
* on failure.
*/
OPUS_EXPORT int opus_multistream_encoder_init(
- OpusMSEncoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application
+ OpusMSEncoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Encodes a multistream Opus frame.
@@ -392,11 +392,11 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
* negative error code (see @ref opus_errorcodes) on failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float(
- OpusMSEncoder *st,
- const float *pcm,
- int frame_size,
- unsigned char *data,
- opus_int32 max_data_bytes
+ OpusMSEncoder *st,
+ const float *pcm,
+ int frame_size,
+ unsigned char *data,
+ opus_int32 max_data_bytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Frees an <code>OpusMSEncoder</code> allocated by
@@ -440,8 +440,8 @@ OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
/** Allocates and initializes a multistream decoder state.
@@ -474,12 +474,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Intialize a previously allocated decoder state object.
@@ -517,12 +517,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea
* on failure.
*/
OPUS_EXPORT int opus_multistream_decoder_init(
- OpusMSDecoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping
+ OpusMSDecoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Decode a multistream Opus packet.
diff --git a/thirdparties/common/include/opus/opus_types.h b/thirdparties/common/include/opus/opus_types.h
index b28e03a..85a2ed8 100755
--- a/thirdparties/common/include/opus/opus_types.h
+++ b/thirdparties/common/include/opus/opus_types.h
@@ -37,114 +37,114 @@
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#include <stdint.h>
- typedef int16_t opus_int16;
- typedef uint16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef uint32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef uint16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef uint32_t opus_uint32;
#elif defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t opus_int32;
- typedef _G_uint32_t opus_uint32;
- typedef _G_int16 opus_int16;
- typedef _G_uint16 opus_uint16;
+typedef _G_int32_t opus_int32;
+typedef _G_uint32_t opus_uint32;
+typedef _G_int16 opus_int16;
+typedef _G_uint16 opus_uint16;
# elif defined(__MINGW32__)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
# elif defined(__MWERKS__)
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
# else
- /* MSVC/Borland */
- typedef __int32 opus_int32;
- typedef unsigned __int32 opus_uint32;
- typedef __int16 opus_int16;
- typedef unsigned __int16 opus_uint16;
+/* MSVC/Borland */
+typedef __int32 opus_int32;
+typedef unsigned __int32 opus_uint32;
+typedef __int16 opus_int16;
+typedef unsigned __int16 opus_uint16;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 opus_int16;
- typedef UInt16 opus_uint16;
- typedef SInt32 opus_int32;
- typedef UInt32 opus_uint32;
+typedef SInt16 opus_int16;
+typedef UInt16 opus_uint16;
+typedef SInt32 opus_int32;
+typedef UInt32 opus_uint32;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t opus_int16;
- typedef u_int16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef u_int16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16 opus_int16;
- typedef u_int16 opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16 opus_int16;
+typedef u_int16 opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* OS/2 GCC */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* DJGPP */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(R5900)
- /* PS2 EE */
- typedef int opus_int32;
- typedef unsigned opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+/* PS2 EE */
+typedef int opus_int32;
+typedef unsigned opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short opus_int16;
- typedef unsigned short opus_uint16;
- typedef signed int opus_int32;
- typedef unsigned int opus_uint32;
+/* Symbian GCC */
+typedef signed short opus_int16;
+typedef unsigned short opus_uint16;
+typedef signed int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef long opus_int32;
- typedef unsigned long opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef long opus_int32;
+typedef unsigned long opus_uint32;
#elif defined(CONFIG_TI_C6X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#else
- /* Give up, take a reasonable guess */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* Give up, take a reasonable guess */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#endif
diff --git a/thirdparties/common/include/speex/speex.h b/thirdparties/common/include/speex/speex.h
index 82ba016..0eb560e 100755
--- a/thirdparties/common/include/speex/speex.h
+++ b/thirdparties/common/include/speex/speex.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
-/** Struct defining a Speex mode */
+/** Struct defining a Speex mode */
typedef struct SpeexMode {
- /** Pointer to the low-level mode data */
- const void *mode;
+ /** Pointer to the low-level mode data */
+ const void *mode;
+
+ /** Pointer to the mode query function */
+ mode_query_func query;
- /** Pointer to the mode query function */
- mode_query_func query;
-
- /** The name of the mode (you should not rely on this to identify the mode)*/
- const char *modeName;
+ /** The name of the mode (you should not rely on this to identify the mode)*/
+ const char *modeName;
- /**ID of the mode*/
- int modeID;
+ /**ID of the mode*/
+ int modeID;
- /**Version number of the bitstream (incremented every time we break
- bitstream compatibility*/
- int bitstream_version;
+ /**Version number of the bitstream (incremented every time we break
+ bitstream compatibility*/
+ int bitstream_version;
- /** Pointer to encoder initialization function */
- encoder_init_func enc_init;
+ /** Pointer to encoder initialization function */
+ encoder_init_func enc_init;
- /** Pointer to encoder destruction function */
- encoder_destroy_func enc_destroy;
+ /** Pointer to encoder destruction function */
+ encoder_destroy_func enc_destroy;
- /** Pointer to frame encoding function */
- encode_func enc;
+ /** Pointer to frame encoding function */
+ encode_func enc;
- /** Pointer to decoder initialization function */
- decoder_init_func dec_init;
+ /** Pointer to decoder initialization function */
+ decoder_init_func dec_init;
- /** Pointer to decoder destruction function */
- decoder_destroy_func dec_destroy;
+ /** Pointer to decoder destruction function */
+ decoder_destroy_func dec_destroy;
- /** Pointer to frame decoding function */
- decode_func dec;
+ /** Pointer to frame decoding function */
+ decode_func dec;
- /** ioctl-like requests for encoder */
- encoder_ctl_func enc_ctl;
+ /** ioctl-like requests for encoder */
+ encoder_ctl_func enc_ctl;
- /** ioctl-like requests for decoder */
- decoder_ctl_func dec_ctl;
+ /** ioctl-like requests for decoder */
+ decoder_ctl_func dec_ctl;
} SpeexMode;
/**
- * Returns a handle to a newly created Speex encoder state structure. For now,
- * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
- * may be added. Note that for now if you have more than one channels to
+ * Returns a handle to a newly created Speex encoder state structure. For now,
+ * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
+ * may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
- * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
+ * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
-/** Frees all resources associated to an existing Speex encoder state.
+/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
- @param in Frame that will be encoded with a +-2^15 range. This data MAY be
- overwritten by the encoder and should be considered uninitialised
+ @param in Frame that will be encoded with a +-2^15 range. This data MAY be
+ overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
@@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int speex_encoder_ctl(void *state, int request, void *ptr);
-/** Returns a handle to a newly created decoder state structure. For now,
+/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
- */
+ */
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
diff --git a/thirdparties/common/include/speex/speex_bits.h b/thirdparties/common/include/speex/speex_bits.h
index a26fb4c..dd3b752 100755
--- a/thirdparties/common/include/speex/speex_bits.h
+++ b/thirdparties/common/include/speex/speex_bits.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,15 +47,15 @@ extern "C" {
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
- char *chars; /**< "raw" data */
- int nbBits; /**< Total number of bits stored in the stream*/
- int charPtr; /**< Position of the byte "cursor" */
- int bitPtr; /**< Position of the bit "cursor" within the current char */
- int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
- int overflow;/**< Set to one if we try to read past the valid data */
- int buf_size;/**< Allocated size for buffer */
- int reserved1; /**< Reserved for future use */
- void *reserved2; /**< Reserved for future use */
+ char *chars; /**< "raw" data */
+ int nbBits; /**< Total number of bits stored in the stream*/
+ int charPtr; /**< Position of the byte "cursor" */
+ int bitPtr; /**< Position of the bit "cursor" within the current char */
+ int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
+ int overflow;/**< Set to one if we try to read past the valid data */
+ int buf_size;/**< Allocated size for buffer */
+ int reserved1; /**< Reserved for future use */
+ void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int speex_bits_nbytes(SpeexBits *bits);
-/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
- *
+/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
+ *
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
- * "cursor" position
- *
+ * "cursor" position
+ *
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
-/** Advances the position of the "bit cursor" in the stream
+/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int speex_bits_remaining(SpeexBits *bits);
-/** Insert a terminator so that the data can be sent as a packet while auto-detecting
- * the number of frames in each packet
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting
+ * the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
diff --git a/thirdparties/common/include/speex/speex_buffer.h b/thirdparties/common/include/speex/speex_buffer.h
index df56f5f..909bd6d 100755
--- a/thirdparties/common/include/speex/speex_buffer.h
+++ b/thirdparties/common/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/thirdparties/common/include/speex/speex_callbacks.h b/thirdparties/common/include/speex/speex_callbacks.h
index 6f450b3..27b5649 100755
--- a/thirdparties/common/include/speex/speex_callbacks.h
+++ b/thirdparties/common/include/speex/speex_callbacks.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
- int callback_id; /**< ID associated to the callback */
- speex_callback_func func; /**< Callback handler function */
- void *data; /**< Data that will be sent to the handler */
- void *reserved1; /**< Reserved for future use */
- int reserved2; /**< Reserved for future use */
+ int callback_id; /**< ID associated to the callback */
+ speex_callback_func func; /**< Callback handler function */
+ void *data; /**< Data that will be sent to the handler */
+ void *reserved1; /**< Reserved for future use */
+ int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
diff --git a/thirdparties/common/include/speex/speex_echo.h b/thirdparties/common/include/speex/speex_echo.h
index 53bcd28..582e1cc 100755
--- a/thirdparties/common/include/speex/speex_echo.h
+++ b/thirdparties/common/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/thirdparties/common/include/speex/speex_header.h b/thirdparties/common/include/speex/speex_header.h
index f85b249..4cc15df 100755
--- a/thirdparties/common/include/speex/speex_header.h
+++ b/thirdparties/common/include/speex/speex_header.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,21 +57,21 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
- char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
- char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
- spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
- spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
- spx_int32_t rate; /**< Sampling rate used */
- spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
- spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
- spx_int32_t nb_channels; /**< Number of channels encoded */
- spx_int32_t bitrate; /**< Bit-rate used */
- spx_int32_t frame_size; /**< Size of frames */
- spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
- spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
- spx_int32_t extra_headers; /**< Number of additional headers after the comments */
- spx_int32_t reserved1; /**< Reserved for future use, must be zero */
- spx_int32_t reserved2; /**< Reserved for future use, must be zero */
+ char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
+ char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
+ spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
+ spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
+ spx_int32_t rate; /**< Sampling rate used */
+ spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
+ spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
+ spx_int32_t nb_channels; /**< Number of channels encoded */
+ spx_int32_t bitrate; /**< Bit-rate used */
+ spx_int32_t frame_size; /**< Size of frames */
+ spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
+ spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
+ spx_int32_t extra_headers; /**< Number of additional headers after the comments */
+ spx_int32_t reserved1; /**< Reserved for future use, must be zero */
+ spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
diff --git a/thirdparties/common/include/speex/speex_jitter.h b/thirdparties/common/include/speex/speex_jitter.h
index d68674b..e6f0321 100755
--- a/thirdparties/common/include/speex/speex_jitter.h
+++ b/thirdparties/common/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
- char *data; /**< Data bytes contained in the packet */
- spx_uint32_t len; /**< Length of the packet in bytes */
- spx_uint32_t timestamp; /**< Timestamp for the packet */
- spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
- spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
- spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
+ char *data; /**< Data bytes contained in the packet */
+ spx_uint32_t len; /**< Length of the packet in bytes */
+ spx_uint32_t timestamp; /**< Timestamp for the packet */
+ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
+ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
+ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/common/include/speex/speex_preprocess.h b/thirdparties/common/include/speex/speex_preprocess.h
index f8eef2c..5cd3710 100755
--- a/thirdparties/common/include/speex/speex_preprocess.h
+++ b/thirdparties/common/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/common/include/speex/speex_resampler.h b/thirdparties/common/include/speex/speex_resampler.h
index 54eef8d..4aefa61 100755
--- a/thirdparties/common/include/speex/speex_resampler.h
+++ b/thirdparties/common/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,7 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
@@ -99,13 +99,13 @@ extern "C" {
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
- RESAMPLER_ERR_SUCCESS = 0,
- RESAMPLER_ERR_ALLOC_FAILED = 1,
- RESAMPLER_ERR_BAD_STATE = 2,
- RESAMPLER_ERR_INVALID_ARG = 3,
- RESAMPLER_ERR_PTR_OVERLAP = 4,
-
- RESAMPLER_ERR_MAX_ERROR
+ RESAMPLER_ERR_SUCCESS = 0,
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
+ RESAMPLER_ERR_BAD_STATE = 2,
+ RESAMPLER_ERR_INVALID_ARG = 3,
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
+
+ RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
@@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
-
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
+
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
/** Destroy a resampler state.
* @param st Resampler state
@@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
@@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
- int quality);
+int speex_resampler_set_quality(SpeexResamplerState *st,
+ int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
- spx_uint32_t stride);
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
+ spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
- spx_uint32_t *stride);
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
+ spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
@@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/thirdparties/common/include/speex/speex_stereo.h b/thirdparties/common/include/speex/speex_stereo.h
index a259713..f33704d 100755
--- a/thirdparties/common/include/speex/speex_stereo.h
+++ b/thirdparties/common/include/speex/speex_stereo.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -48,12 +48,12 @@ extern "C" {
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
- float balance; /**< Left/right balance info */
- float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
- float smooth_left; /**< Smoothed left channel gain */
- float smooth_right; /**< Smoothed right channel gain */
- float reserved1; /**< Reserved for future use */
- float reserved2; /**< Reserved for future use */
+ float balance; /**< Left/right balance info */
+ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
+ float smooth_left; /**< Smoothed left channel gain */
+ float smooth_right; /**< Smoothed right channel gain */
+ float reserved1; /**< Reserved for future use */
+ float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
diff --git a/thirdparties/common/include/speex/speex_types.h b/thirdparties/common/include/speex/speex_types.h
index 852fed8..fa8f806 100755
--- a/thirdparties/common/include/speex/speex_types.h
+++ b/thirdparties/common/include/speex/speex_types.h
@@ -22,100 +22,100 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t spx_int32_t;
- typedef _G_uint32_t spx_uint32_t;
- typedef _G_int16_t spx_int16_t;
- typedef _G_uint16_t spx_uint16_t;
+typedef _G_int32_t spx_int32_t;
+typedef _G_uint32_t spx_uint32_t;
+typedef _G_int16_t spx_int16_t;
+typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int32 spx_int32_t;
- typedef unsigned __int32 spx_uint32_t;
- typedef __int16 spx_int16_t;
- typedef unsigned __int16 spx_uint16_t;
+/* MSVC/Borland */
+typedef __int32 spx_int32_t;
+typedef unsigned __int32 spx_uint32_t;
+typedef __int16 spx_int16_t;
+typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 spx_int16_t;
- typedef UInt16 spx_uint16_t;
- typedef SInt32 spx_int32_t;
- typedef UInt32 spx_uint32_t;
+typedef SInt16 spx_int16_t;
+typedef UInt16 spx_uint16_t;
+typedef SInt32 spx_int32_t;
+typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* OS/2 GCC */
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short spx_int16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* DJGPP */
+typedef short spx_int16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef int spx_int32_t;
- typedef unsigned spx_uint32_t;
- typedef short spx_int16_t;
+/* PS2 EE */
+typedef int spx_int32_t;
+typedef unsigned spx_uint32_t;
+typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef signed int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* Symbian GCC */
+typedef signed short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef signed int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef long spx_int32_t;
- typedef unsigned long spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef long spx_int32_t;
+typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#else
diff --git a/thirdparties/common/include/theora/codec.h b/thirdparties/common/include/theora/codec.h
index 5c26696..4e7e3dc 100755
--- a/thirdparties/common/include/theora/codec.h
+++ b/thirdparties/common/include/theora/codec.h
@@ -16,7 +16,7 @@
********************************************************************/
/**\mainpage
- *
+ *
* \section intro Introduction
*
* This is the documentation for <tt>libtheora</tt> C API.
@@ -32,14 +32,14 @@
*
* \subsection Organization
*
- * The functions documented here are actually subdivided into three
+ * The functions documented here are actually subdivided into three
* separate libraries:
* - <tt>libtheoraenc</tt> contains the encoder interface,
* described in \ref encfuncs.
* - <tt>libtheoradec</tt> contains the decoder interface and
* routines shared with the encoder.
* You must also link to this if you link to <tt>libtheoraenc</tt>.
- * The routines in this library are described in \ref decfuncs and
+ * The routines in this library are described in \ref decfuncs and
* \ref basefuncs.
* - <tt>libtheora</tt> contains the \ref oldfuncs.
*
@@ -95,39 +95,40 @@ extern "C" {
* See <a href="http://www.theora.org/doc/Theora.pdf">the Theora
* specification</a>, Chapter 4, for exact details on the meaning
* of each of these color spaces.*/
-typedef enum{
- /**The color space was not specified at the encoder.
- It may be conveyed by an external means.*/
- TH_CS_UNSPECIFIED,
- /**A color space designed for NTSC content.*/
- TH_CS_ITU_REC_470M,
- /**A color space designed for PAL/SECAM content.*/
- TH_CS_ITU_REC_470BG,
- /**The total number of currently defined color spaces.*/
- TH_CS_NSPACES
-}th_colorspace;
+typedef enum {
+ /**The color space was not specified at the encoder.
+ It may be conveyed by an external means.*/
+ TH_CS_UNSPECIFIED,
+ /**A color space designed for NTSC content.*/
+ TH_CS_ITU_REC_470M,
+ /**A color space designed for PAL/SECAM content.*/
+ TH_CS_ITU_REC_470BG,
+ /**The total number of currently defined color spaces.*/
+ TH_CS_NSPACES
+}
+th_colorspace;
/**The currently defined pixel format tags.
* See <a href="http://www.theora.org/doc/Theora.pdf">the Theora
* specification</a>, Section 4.4, for details on the precise sample
* locations.*/
-typedef enum{
- /**Chroma decimation by 2 in both the X and Y directions (4:2:0).
- The Cb and Cr chroma planes are half the width and half the
- height of the luma plane.*/
- TH_PF_420,
- /**Currently reserved.*/
- TH_PF_RSVD,
- /**Chroma decimation by 2 in the X direction (4:2:2).
- The Cb and Cr chroma planes are half the width of the luma plane, but full
- height.*/
- TH_PF_422,
- /**No chroma decimation (4:4:4).
- The Cb and Cr chroma planes are full width and full height.*/
- TH_PF_444,
- /**The total number of currently defined pixel formats.*/
- TH_PF_NFORMATS
-}th_pixel_fmt;
+typedef enum {
+ /**Chroma decimation by 2 in both the X and Y directions (4:2:0).
+ The Cb and Cr chroma planes are half the width and half the
+ height of the luma plane.*/
+ TH_PF_420,
+ /**Currently reserved.*/
+ TH_PF_RSVD,
+ /**Chroma decimation by 2 in the X direction (4:2:2).
+ The Cb and Cr chroma planes are half the width of the luma plane, but full
+ height.*/
+ TH_PF_422,
+ /**No chroma decimation (4:4:4).
+ The Cb and Cr chroma planes are full width and full height.*/
+ TH_PF_444,
+ /**The total number of currently defined pixel formats.*/
+ TH_PF_NFORMATS
+} th_pixel_fmt;
@@ -139,16 +140,16 @@ typedef enum{
* The encoder accepts both positive \a stride values (top-down in memory)
* and negative (bottom-up in memory).
* The decoder currently always generates images with positive strides.*/
-typedef struct{
- /**The width of this plane.*/
- int width;
- /**The height of this plane.*/
- int height;
- /**The offset in bytes between successive rows.*/
- int stride;
- /**A pointer to the beginning of the first row.*/
- unsigned char *data;
-}th_img_plane;
+typedef struct {
+ /**The width of this plane.*/
+ int width;
+ /**The height of this plane.*/
+ int height;
+ /**The offset in bytes between successive rows.*/
+ int stride;
+ /**A pointer to the beginning of the first row.*/
+ unsigned char *data;
+} th_img_plane;
/**A complete image buffer for an uncompressed frame.
* The chroma planes may be decimated by a factor of two in either
@@ -168,7 +169,7 @@ typedef struct{
typedef th_img_plane th_ycbcr_buffer[3];
/**Theora bitstream information.
- * This contains the basic playback parameters for a stream, and corresponds to
+ * This contains the basic playback parameters for a stream, and corresponds to
* the initial 'info' header packet.
* To initialize an encoder, the application fills in this structure and
* passes it to th_encode_alloc().
@@ -201,100 +202,100 @@ typedef th_img_plane th_ycbcr_buffer[3];
* the overall frame itself.
* The frame aspect ratio can be computed from pixel aspect ratio using the
* image dimensions.*/
-typedef struct{
- /**\name Theora version
- * Bitstream version information.*/
- /*@{*/
- unsigned char version_major;
- unsigned char version_minor;
- unsigned char version_subminor;
- /*@}*/
- /**The encoded frame width.
- * This must be a multiple of 16, and less than 1048576.*/
- ogg_uint32_t frame_width;
- /**The encoded frame height.
- * This must be a multiple of 16, and less than 1048576.*/
- ogg_uint32_t frame_height;
- /**The displayed picture width.
- * This must be no larger than width.*/
- ogg_uint32_t pic_width;
- /**The displayed picture height.
- * This must be no larger than height.*/
- ogg_uint32_t pic_height;
- /**The X offset of the displayed picture.
- * This must be no larger than #frame_width-#pic_width or 255, whichever is
- * smaller.*/
- ogg_uint32_t pic_x;
- /**The Y offset of the displayed picture.
- * This must be no larger than #frame_height-#pic_height, and
- * #frame_height-#pic_height-#pic_y must be no larger than 255.
- * This slightly funny restriction is due to the fact that the offset is
- * specified from the top of the image for consistency with the standard
- * graphics left-handed coordinate system used throughout this API, while
- * it is stored in the encoded stream as an offset from the bottom.*/
- ogg_uint32_t pic_y;
- /**\name Frame rate
- * The frame rate, as a fraction.
- * If either is 0, the frame rate is undefined.*/
- /*@{*/
- ogg_uint32_t fps_numerator;
- ogg_uint32_t fps_denominator;
- /*@}*/
- /**\name Aspect ratio
- * The aspect ratio of the pixels.
- * If either value is zero, the aspect ratio is undefined.
- * If not specified by any external means, 1:1 should be assumed.
- * The aspect ratio of the full picture can be computed as
- * \code
- * aspect_numerator*pic_width/(aspect_denominator*pic_height).
- * \endcode */
- /*@{*/
- ogg_uint32_t aspect_numerator;
- ogg_uint32_t aspect_denominator;
- /*@}*/
- /**The color space.*/
- th_colorspace colorspace;
- /**The pixel format.*/
- th_pixel_fmt pixel_fmt;
- /**The target bit-rate in bits per second.
- If initializing an encoder with this struct, set this field to a non-zero
- value to activate CBR encoding by default.*/
- int target_bitrate;
- /**The target quality level.
- Valid values range from 0 to 63, inclusive, with higher values giving
- higher quality.
- If initializing an encoder with this struct, and #target_bitrate is set
- to zero, VBR encoding at this quality will be activated by default.*/
- /*Currently this is set so that a qi of 0 corresponds to distortions of 24
- times the JND, and each increase by 16 halves that value.
- This gives us fine discrimination at low qualities, yet effective rate
- control at high qualities.
- The qi value 63 is special, however.
- For this, the highest quality, we use one half of a JND for our threshold.
- Due to the lower bounds placed on allowable quantizers in Theora, we will
- not actually be able to achieve quality this good, but this should
- provide as close to visually lossless quality as Theora is capable of.
- We could lift the quantizer restrictions without breaking VP3.1
- compatibility, but this would result in quantized coefficients that are
- too large for the current bitstream to be able to store.
- We'd have to redesign the token syntax to store these large coefficients,
- which would make transcoding complex.*/
- int quality;
- /**The amount to shift to extract the last keyframe number from the granule
- * position.
- * This can be at most 31.
- * th_info_init() will set this to a default value (currently <tt>6</tt>,
- * which is good for streaming applications), but you can set it to 0 to
- * make every frame a keyframe.
- * The maximum distance between key frames is
- * <tt>1<<#keyframe_granule_shift</tt>.
- * The keyframe frequency can be more finely controlled with
- * #TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, which can also be adjusted
- * during encoding (for example, to force the next frame to be a keyframe),
- * but it cannot be set larger than the amount permitted by this field after
- * the headers have been output.*/
- int keyframe_granule_shift;
-}th_info;
+typedef struct {
+ /**\name Theora version
+ * Bitstream version information.*/
+ /*@{*/
+ unsigned char version_major;
+ unsigned char version_minor;
+ unsigned char version_subminor;
+ /*@}*/
+ /**The encoded frame width.
+ * This must be a multiple of 16, and less than 1048576.*/
+ ogg_uint32_t frame_width;
+ /**The encoded frame height.
+ * This must be a multiple of 16, and less than 1048576.*/
+ ogg_uint32_t frame_height;
+ /**The displayed picture width.
+ * This must be no larger than width.*/
+ ogg_uint32_t pic_width;
+ /**The displayed picture height.
+ * This must be no larger than height.*/
+ ogg_uint32_t pic_height;
+ /**The X offset of the displayed picture.
+ * This must be no larger than #frame_width-#pic_width or 255, whichever is
+ * smaller.*/
+ ogg_uint32_t pic_x;
+ /**The Y offset of the displayed picture.
+ * This must be no larger than #frame_height-#pic_height, and
+ * #frame_height-#pic_height-#pic_y must be no larger than 255.
+ * This slightly funny restriction is due to the fact that the offset is
+ * specified from the top of the image for consistency with the standard
+ * graphics left-handed coordinate system used throughout this API, while
+ * it is stored in the encoded stream as an offset from the bottom.*/
+ ogg_uint32_t pic_y;
+ /**\name Frame rate
+ * The frame rate, as a fraction.
+ * If either is 0, the frame rate is undefined.*/
+ /*@{*/
+ ogg_uint32_t fps_numerator;
+ ogg_uint32_t fps_denominator;
+ /*@}*/
+ /**\name Aspect ratio
+ * The aspect ratio of the pixels.
+ * If either value is zero, the aspect ratio is undefined.
+ * If not specified by any external means, 1:1 should be assumed.
+ * The aspect ratio of the full picture can be computed as
+ * \code
+ * aspect_numerator*pic_width/(aspect_denominator*pic_height).
+ * \endcode */
+ /*@{*/
+ ogg_uint32_t aspect_numerator;
+ ogg_uint32_t aspect_denominator;
+ /*@}*/
+ /**The color space.*/
+ th_colorspace colorspace;
+ /**The pixel format.*/
+ th_pixel_fmt pixel_fmt;
+ /**The target bit-rate in bits per second.
+ If initializing an encoder with this struct, set this field to a non-zero
+ value to activate CBR encoding by default.*/
+ int target_bitrate;
+ /**The target quality level.
+ Valid values range from 0 to 63, inclusive, with higher values giving
+ higher quality.
+ If initializing an encoder with this struct, and #target_bitrate is set
+ to zero, VBR encoding at this quality will be activated by default.*/
+ /*Currently this is set so that a qi of 0 corresponds to distortions of 24
+ times the JND, and each increase by 16 halves that value.
+ This gives us fine discrimination at low qualities, yet effective rate
+ control at high qualities.
+ The qi value 63 is special, however.
+ For this, the highest quality, we use one half of a JND for our threshold.
+ Due to the lower bounds placed on allowable quantizers in Theora, we will
+ not actually be able to achieve quality this good, but this should
+ provide as close to visually lossless quality as Theora is capable of.
+ We could lift the quantizer restrictions without breaking VP3.1
+ compatibility, but this would result in quantized coefficients that are
+ too large for the current bitstream to be able to store.
+ We'd have to redesign the token syntax to store these large coefficients,
+ which would make transcoding complex.*/
+ int quality;
+ /**The amount to shift to extract the last keyframe number from the granule
+ * position.
+ * This can be at most 31.
+ * th_info_init() will set this to a default value (currently <tt>6</tt>,
+ * which is good for streaming applications), but you can set it to 0 to
+ * make every frame a keyframe.
+ * The maximum distance between key frames is
+ * <tt>1<<#keyframe_granule_shift</tt>.
+ * The keyframe frequency can be more finely controlled with
+ * #TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, which can also be adjusted
+ * during encoding (for example, to force the next frame to be a keyframe),
+ * but it cannot be set larger than the amount permitted by this field after
+ * the headers have been output.*/
+ int keyframe_granule_shift;
+} th_info;
/**The comment information.
*
@@ -320,17 +321,17 @@ typedef struct{
* possibly containing null characters, and so the length array should be
* treated as their authoritative length.
*/
-typedef struct th_comment{
- /**The array of comment string vectors.*/
- char **user_comments;
- /**An array of the corresponding length of each vector, in bytes.*/
- int *comment_lengths;
- /**The total number of comment strings.*/
- int comments;
- /**The null-terminated vendor string.
- This identifies the software used to encode the stream.*/
- char *vendor;
-}th_comment;
+typedef struct th_comment {
+ /**The array of comment string vectors.*/
+ char **user_comments;
+ /**An array of the corresponding length of each vector, in bytes.*/
+ int *comment_lengths;
+ /**The total number of comment strings.*/
+ int comments;
+ /**The null-terminated vendor string.
+ This identifies the software used to encode the stream.*/
+ char *vendor;
+} th_comment;
@@ -338,16 +339,16 @@ typedef struct th_comment{
typedef unsigned char th_quant_base[64];
/**A set of \a qi ranges.*/
-typedef struct{
- /**The number of ranges in the set.*/
- int nranges;
- /**The size of each of the #nranges ranges.
- These must sum to 63.*/
- const int *sizes;
- /**#nranges <tt>+1</tt> base matrices.
- Matrices \a i and <tt>i+1</tt> form the endpoints of range \a i.*/
- const th_quant_base *base_matrices;
-}th_quant_ranges;
+typedef struct {
+ /**The number of ranges in the set.*/
+ int nranges;
+ /**The size of each of the #nranges ranges.
+ These must sum to 63.*/
+ const int *sizes;
+ /**#nranges <tt>+1</tt> base matrices.
+ Matrices \a i and <tt>i+1</tt> form the endpoints of range \a i.*/
+ const th_quant_base *base_matrices;
+} th_quant_ranges;
/**A complete set of quantization parameters.
The quantizer for each coefficient is calculated as:
@@ -406,16 +407,16 @@ typedef struct{
These two conditions ensure that the actual quantizer for a given \a qti,
\a pli, and \a ci does not increase as \a qi increases.
This is not required by the decoder.*/
-typedef struct{
- /**The DC scaling factors.*/
- ogg_uint16_t dc_scale[64];
- /**The AC scaling factors.*/
- ogg_uint16_t ac_scale[64];
- /**The loop filter limit values.*/
- unsigned char loop_filter_limits[64];
- /**The \a qi ranges for each \a ci and \a pli.*/
- th_quant_ranges qi_ranges[2][3];
-}th_quant_info;
+typedef struct {
+ /**The DC scaling factors.*/
+ ogg_uint16_t dc_scale[64];
+ /**The AC scaling factors.*/
+ ogg_uint16_t ac_scale[64];
+ /**The loop filter limit values.*/
+ unsigned char loop_filter_limits[64];
+ /**The \a qi ranges for each \a ci and \a pli.*/
+ th_quant_ranges qi_ranges[2][3];
+} th_quant_info;
@@ -435,14 +436,14 @@ typedef struct{
* The complete table in the first group of 16 does not have to be in the same
* place as the complete table in the other groups, but the complete tables in
* the remaining four groups must all be in the same place.*/
-typedef struct{
- /**The bit pattern for the code, with the LSbit of the pattern aligned in
- * the LSbit of the word.*/
- ogg_uint32_t pattern;
- /**The number of bits in the code.
- * This must be between 0 and 32, inclusive.*/
- int nbits;
-}th_huff_code;
+typedef struct {
+ /**The bit pattern for the code, with the LSbit of the pattern aligned in
+ * the LSbit of the word.*/
+ ogg_uint32_t pattern;
+ /**The number of bits in the code.
+ * This must be between 0 and 32, inclusive.*/
+ int nbits;
+} th_huff_code;
diff --git a/thirdparties/common/include/theora/theora.h b/thirdparties/common/include/theora/theora.h
index af6eb6f..084502f 100755
--- a/thirdparties/common/include/theora/theora.h
+++ b/thirdparties/common/include/theora/theora.h
@@ -34,41 +34,41 @@ extern "C"
*
* \section intro Introduction
*
- * This is the documentation for the libtheora legacy C API, declared in
+ * This is the documentation for the libtheora legacy C API, declared in
* the theora.h header, which describes the old interface used before
* the 1.0 release. This API was widely deployed for several years and
- * remains supported, but for new code we recommend the cleaner API
+ * remains supported, but for new code we recommend the cleaner API
* declared in theoradec.h and theoraenc.h.
*
* libtheora is the reference implementation for
* <a href="http://www.theora.org/">Theora</a>, a free video codec.
* Theora is derived from On2's VP3 codec with improved integration with
* Ogg multimedia formats by <a href="http://www.xiph.org/">Xiph.Org</a>.
- *
+ *
* \section overview Overview
*
- * This library will both decode and encode theora packets to/from raw YUV
+ * This library will both decode and encode theora packets to/from raw YUV
* frames. In either case, the packets will most likely either come from or
- * need to be embedded in an Ogg stream. Use
- * <a href="http://xiph.org/ogg/">libogg</a> or
+ * need to be embedded in an Ogg stream. Use
+ * <a href="http://xiph.org/ogg/">libogg</a> or
* <a href="http://www.annodex.net/software/liboggz/index.html">liboggz</a>
* to extract/package these packets.
*
* \section decoding Decoding Process
*
* Decoding can be separated into the following steps:
- * -# initialise theora_info and theora_comment structures using
+ * -# initialise theora_info and theora_comment structures using
* theora_info_init() and theora_comment_init():
\verbatim
theora_info info;
theora_comment comment;
-
+
theora_info_init(&info);
theora_comment_init(&comment);
\endverbatim
- * -# retrieve header packets from Ogg stream (there should be 3) and decode
- * into theora_info and theora_comment structures using
- * theora_decode_header(). See \ref identification for more information on
+ * -# retrieve header packets from Ogg stream (there should be 3) and decode
+ * into theora_info and theora_comment structures using
+ * theora_decode_header(). See \ref identification for more information on
* identifying which packets are theora packets.
\verbatim
int i;
@@ -79,14 +79,14 @@ extern "C"
}
\endverbatim
* -# initialise the decoder based on the information retrieved into the
- * theora_info struct by theora_decode_header(). You will need a
+ * theora_info struct by theora_decode_header(). You will need a
* theora_state struct.
\verbatim
theora_state state;
-
+
theora_decode_init(&state, &info);
\endverbatim
- * -# pass in packets and retrieve decoded frames! See the yuv_buffer
+ * -# pass in packets and retrieve decoded frames! See the yuv_buffer
* documentation for information on how to retrieve raw YUV data.
\verbatim
yuf_buffer buffer;
@@ -96,20 +96,20 @@ extern "C"
theora_decode_YUVout(&state, &buffer);
}
\endverbatim
- *
+ *
*
* \subsection identification Identifying Theora Packets
*
- * All streams inside an Ogg file have a unique serial_no attached to the
- * stream. Typically, you will want to
- * - retrieve the serial_no for each b_o_s (beginning of stream) page
- * encountered within the Ogg file;
- * - test the first (only) packet on that page to determine if it is a theora
+ * All streams inside an Ogg file have a unique serial_no attached to the
+ * stream. Typically, you will want to
+ * - retrieve the serial_no for each b_o_s (beginning of stream) page
+ * encountered within the Ogg file;
+ * - test the first (only) packet on that page to determine if it is a theora
* packet;
- * - once you have found a theora b_o_s page then use the retrieved serial_no
+ * - once you have found a theora b_o_s page then use the retrieved serial_no
* to identify future packets belonging to the same theora stream.
- *
- * Note that you \e cannot use theora_packet_isheader() to determine if a
+ *
+ * Note that you \e cannot use theora_packet_isheader() to determine if a
* packet is a theora packet or not, as this function does not perform any
* checking beyond whether a header bit is present. Instead, use the
* theora_decode_header() function and check the return value; or examine the
@@ -124,9 +124,9 @@ extern "C"
* A YUV buffer for passing uncompressed frames to and from the codec.
* This holds a Y'CbCr frame in planar format. The CbCr planes can be
* subsampled and have their own separate dimensions and row stride
- * offsets. Note that the strides may be negative in some
+ * offsets. Note that the strides may be negative in some
* configurations. For theora the width and height of the largest plane
- * must be a multiple of 16. The actual meaningful picture size and
+ * must be a multiple of 16. The actual meaningful picture size and
* offset are stored in the theora_info structure; frames returned by
* the decoder may need to be cropped for display.
*
@@ -135,8 +135,8 @@ extern "C"
* are ordered from left to right.
*
* During decode, the yuv_buffer struct is allocated by the user, but all
- * fields (including luma and chroma pointers) are filled by the library.
- * These pointers address library-internal memory and their contents should
+ * fields (including luma and chroma pointers) are filled by the library.
+ * These pointers address library-internal memory and their contents should
* not be modified.
*
* Conversely, during encode the user allocates the struct and fills out all
@@ -162,10 +162,10 @@ typedef struct {
* A Colorspace.
*/
typedef enum {
- OC_CS_UNSPECIFIED, /**< The colorspace is unknown or unspecified */
- OC_CS_ITU_REC_470M, /**< This is the best option for 'NTSC' content */
- OC_CS_ITU_REC_470BG, /**< This is the best option for 'PAL' content */
- OC_CS_NSPACES /**< This marks the end of the defined colorspaces */
+ OC_CS_UNSPECIFIED, /**< The colorspace is unknown or unspecified */
+ OC_CS_ITU_REC_470M, /**< This is the best option for 'NTSC' content */
+ OC_CS_ITU_REC_470BG, /**< This is the best option for 'PAL' content */
+ OC_CS_NSPACES /**< This marks the end of the defined colorspaces */
} theora_colorspace;
/**
@@ -176,17 +176,17 @@ typedef enum {
* exact definitions.
*/
typedef enum {
- OC_PF_420, /**< Chroma subsampling by 2 in each direction (4:2:0) */
- OC_PF_RSVD, /**< Reserved value */
- OC_PF_422, /**< Horizonatal chroma subsampling by 2 (4:2:2) */
- OC_PF_444, /**< No chroma subsampling at all (4:4:4) */
+ OC_PF_420, /**< Chroma subsampling by 2 in each direction (4:2:0) */
+ OC_PF_RSVD, /**< Reserved value */
+ OC_PF_422, /**< Horizonatal chroma subsampling by 2 (4:2:2) */
+ OC_PF_444, /**< No chroma subsampling at all (4:4:4) */
} theora_pixelformat;
/**
* Theora bitstream info.
* Contains the basic playback parameters for a stream,
* corresponding to the initial 'info' header packet.
- *
+ *
* Encoded theora frames must be a multiple of 16 in width and height.
* To handle other frame sizes, a crop rectangle is specified in
* frame_height and frame_width, offset_x and * offset_y. The offset
@@ -198,69 +198,69 @@ typedef enum {
* fraction. Aspect ratio is also stored as a rational fraction, and
* refers to the aspect ratio of the frame pixels, not of the
* overall frame itself.
- *
+ *
* See <a href="http://svn.xiph.org/trunk/theora/examples/encoder_example.c">
* examples/encoder_example.c</a> for usage examples of the
* other paramters and good default settings for the encoder parameters.
*/
typedef struct {
- ogg_uint32_t width; /**< encoded frame width */
- ogg_uint32_t height; /**< encoded frame height */
- ogg_uint32_t frame_width; /**< display frame width */
- ogg_uint32_t frame_height; /**< display frame height */
- ogg_uint32_t offset_x; /**< horizontal offset of the displayed frame */
- ogg_uint32_t offset_y; /**< vertical offset of the displayed frame */
- ogg_uint32_t fps_numerator; /**< frame rate numerator **/
- ogg_uint32_t fps_denominator; /**< frame rate denominator **/
- ogg_uint32_t aspect_numerator; /**< pixel aspect ratio numerator */
- ogg_uint32_t aspect_denominator; /**< pixel aspect ratio denominator */
- theora_colorspace colorspace; /**< colorspace */
- int target_bitrate; /**< nominal bitrate in bits per second */
- int quality; /**< Nominal quality setting, 0-63 */
- int quick_p; /**< Quick encode/decode */
-
- /* decode only */
- unsigned char version_major;
- unsigned char version_minor;
- unsigned char version_subminor;
-
- void *codec_setup;
-
- /* encode only */
- int dropframes_p;
- int keyframe_auto_p;
- ogg_uint32_t keyframe_frequency;
- ogg_uint32_t keyframe_frequency_force; /* also used for decode init to
+ ogg_uint32_t width; /**< encoded frame width */
+ ogg_uint32_t height; /**< encoded frame height */
+ ogg_uint32_t frame_width; /**< display frame width */
+ ogg_uint32_t frame_height; /**< display frame height */
+ ogg_uint32_t offset_x; /**< horizontal offset of the displayed frame */
+ ogg_uint32_t offset_y; /**< vertical offset of the displayed frame */
+ ogg_uint32_t fps_numerator; /**< frame rate numerator **/
+ ogg_uint32_t fps_denominator; /**< frame rate denominator **/
+ ogg_uint32_t aspect_numerator; /**< pixel aspect ratio numerator */
+ ogg_uint32_t aspect_denominator; /**< pixel aspect ratio denominator */
+ theora_colorspace colorspace; /**< colorspace */
+ int target_bitrate; /**< nominal bitrate in bits per second */
+ int quality; /**< Nominal quality setting, 0-63 */
+ int quick_p; /**< Quick encode/decode */
+
+ /* decode only */
+ unsigned char version_major;
+ unsigned char version_minor;
+ unsigned char version_subminor;
+
+ void *codec_setup;
+
+ /* encode only */
+ int dropframes_p;
+ int keyframe_auto_p;
+ ogg_uint32_t keyframe_frequency;
+ ogg_uint32_t keyframe_frequency_force; /* also used for decode init to
get granpos shift correct */
- ogg_uint32_t keyframe_data_target_bitrate;
- ogg_int32_t keyframe_auto_threshold;
- ogg_uint32_t keyframe_mindistance;
- ogg_int32_t noise_sensitivity;
- ogg_int32_t sharpness;
+ ogg_uint32_t keyframe_data_target_bitrate;
+ ogg_int32_t keyframe_auto_threshold;
+ ogg_uint32_t keyframe_mindistance;
+ ogg_int32_t noise_sensitivity;
+ ogg_int32_t sharpness;
- theora_pixelformat pixelformat; /**< chroma subsampling mode to expect */
+ theora_pixelformat pixelformat; /**< chroma subsampling mode to expect */
} theora_info;
/** Codec internal state and context.
*/
-typedef struct{
- theora_info *i;
- ogg_int64_t granulepos;
+typedef struct {
+ theora_info *i;
+ ogg_int64_t granulepos;
- void *internal_encode;
- void *internal_decode;
+ void *internal_encode;
+ void *internal_decode;
} theora_state;
-/**
+/**
* Comment header metadata.
*
* This structure holds the in-stream metadata corresponding to
* the 'comment' header packet.
*
* Meta data is stored as a series of (tag, value) pairs, in
- * length-encoded string vectors. The first occurence of the
+ * length-encoded string vectors. The first occurence of the
* '=' character delimits the tag and value. A particular tag
* may occur more than once. The character set encoding for
* the strings is always UTF-8, but the tag names are limited
@@ -272,11 +272,11 @@ typedef struct{
* and so the length array should be treated as authoritative
* for their length.
*/
-typedef struct theora_comment{
- char **user_comments; /**< An array of comment string vectors */
- int *comment_lengths; /**< An array of corresponding string vector lengths in bytes */
- int comments; /**< The total number of comment string vectors */
- char *vendor; /**< The vendor string identifying the encoder, null terminated */
+typedef struct theora_comment {
+ char **user_comments; /**< An array of comment string vectors */
+ int *comment_lengths; /**< An array of corresponding string vector lengths in bytes */
+ int comments; /**< The total number of comment string vectors */
+ char *vendor; /**< The vendor string identifying the encoder, null terminated */
} theora_comment;
@@ -285,7 +285,7 @@ typedef struct theora_comment{
/* \anchor decctlcodes_old
* These are the available request codes for theora_control()
* when called with a decoder instance.
- * By convention decoder control codes are odd, to distinguish
+ * By convention decoder control codes are odd, to distinguish
* them from \ref encctlcodes_old "encoder control codes" which
* are even.
*
@@ -306,7 +306,7 @@ typedef struct theora_comment{
#define TH_DECCTL_GET_PPLEVEL_MAX (1)
/**Set the post-processing level.
- * Sets the level of post-processing to use when decoding the
+ * Sets the level of post-processing to use when decoding the
* compressed stream. This must be a value between zero (off)
* and the maximum returned by TH_DECCTL_GET_PPLEVEL_MAX.
*/
@@ -345,9 +345,9 @@ typedef struct theora_comment{
* \param[in] buf #th_quant_info
* \retval OC_FAULT \a theora_state is <tt>NULL</tt>.
* \retval OC_EINVAL Encoding has already begun, the quantization parameters
- * are not acceptable to this version of the encoder,
- * \a buf is <tt>NULL</tt> and \a buf_sz is not zero,
- * or \a buf is non-<tt>NULL</tt> and \a buf_sz is
+ * are not acceptable to this version of the encoder,
+ * \a buf is <tt>NULL</tt> and \a buf_sz is not zero,
+ * or \a buf is non-<tt>NULL</tt> and \a buf_sz is
* not <tt>sizeof(#th_quant_info)</tt>.
* \retval OC_IMPL Not supported by this implementation.*/
#define TH_ENCCTL_SET_QUANT_PARAMS (2)
@@ -424,7 +424,7 @@ typedef struct theora_comment{
#define OC_NEWPACKET -25 /**< Packet is an (ignorable) unhandled extension */
#define OC_DUPFRAME 1 /**< Packet is a dropped frame */
-/**
+/**
* Retrieve a human-readable string to identify the encoder vendor and version.
* \returns A version string.
*/
@@ -462,7 +462,7 @@ extern int theora_encode_init(theora_state *th, theora_info *ti);
extern int theora_encode_YUVin(theora_state *t, yuv_buffer *yuv);
/**
- * Request the next packet of encoded video.
+ * Request the next packet of encoded video.
* The encoded data is placed in a user-provided ogg_packet structure.
* \param t A theora_state handle previously initialized for encoding.
* \param last_p whether this is the last packet the encoder should produce.
@@ -581,8 +581,8 @@ extern int theora_decode_packetin(theora_state *th,ogg_packet *op);
* \param th A theora_state handle previously initialized for decoding.
* \param yuv A yuv_buffer in which libtheora should place the decoded data.
* Note that the buffer struct itself is allocated by the user, but
- * that the luma and chroma pointers will be filled in by the
- * library. Also note that these luma and chroma regions should be
+ * that the luma and chroma pointers will be filled in by the
+ * library. Also note that these luma and chroma regions should be
* considered read-only by the user.
* \retval 0 Success
*/
@@ -617,22 +617,22 @@ extern int theora_packet_iskeyframe(ogg_packet *op);
/**
* Report the granulepos shift radix
*
- * When embedded in Ogg, Theora uses a two-part granulepos,
+ * When embedded in Ogg, Theora uses a two-part granulepos,
* splitting the 64-bit field into two pieces. The more-significant
* section represents the frame count at the last keyframe,
* and the less-significant section represents the count of
* frames since the last keyframe. In this way the overall
* field is still non-decreasing with time, but usefully encodes
* a pointer to the last keyframe, which is necessary for
- * correctly restarting decode after a seek.
+ * correctly restarting decode after a seek.
*
* This function reports the number of bits used to represent
* the distance to the last keyframe, and thus how the granulepos
* field must be shifted or masked to obtain the two parts.
- *
+ *
* Since libtheora returns compressed data in an ogg_packet
* structure, this may be generally useful even if the Theora
- * packets are not being used in an Ogg container.
+ * packets are not being used in an Ogg container.
*
* \param ti A previously initialized theora_info struct
* \returns The bit shift dividing the two granulepos fields
@@ -644,7 +644,7 @@ int theora_granule_shift(theora_info *ti);
/**
* Convert a granulepos to an absolute frame index, starting at 0.
* The granulepos is interpreted in the context of a given theora_state handle.
- *
+ *
* Note that while the granulepos encodes the frame count (i.e. starting
* from 1) this call returns the frame index, starting from zero. Thus
* One can calculate the presentation time by multiplying the index by
@@ -671,7 +671,7 @@ extern ogg_int64_t theora_granule_frame(theora_state *th,ogg_int64_t granulepos)
* be displayed.
* It is not the presentation time.
* \retval -1. The given granulepos is undefined (i.e. negative), or
- * \retval -1. The function has been disabled because floating
+ * \retval -1. The function has been disabled because floating
* point support is not available.
*/
extern double theora_granule_time(theora_state *th,ogg_int64_t granulepos);
@@ -699,7 +699,7 @@ extern void theora_clear(theora_state *t);
/**
* Initialize an allocated theora_comment structure
- * \param tc An allocated theora_comment structure
+ * \param tc An allocated theora_comment structure
**/
extern void theora_comment_init(theora_comment *tc);
@@ -720,7 +720,7 @@ extern void theora_comment_add(theora_comment *tc, char *comment);
/**
* Add a comment to an initialized theora_comment structure.
* \param tc A previously initialized theora comment structure
- * \param tag A null-terminated string containing the tag
+ * \param tag A null-terminated string containing the tag
* associated with the comment.
* \param value The corresponding value as a null-terminated string
*
@@ -730,7 +730,7 @@ extern void theora_comment_add(theora_comment *tc, char *comment);
* the theora_comment structure directly.
**/
extern void theora_comment_add_tag(theora_comment *tc,
- char *tag, char *value);
+ char *tag, char *value);
/**
* Look up a comment value by tag.
@@ -752,9 +752,9 @@ extern char *theora_comment_query(theora_comment *tc, char *tag, int count);
* \param tc An initialized theora_comment structure
* \param tag The tag to look up
* \returns The number on instances of a particular tag.
- *
+ *
* Call this first when querying for a specific tag and then interate
- * over the number of instances with separate calls to
+ * over the number of instances with separate calls to
* theora_comment_query() to retrieve all instances in order.
**/
extern int theora_comment_query_count(theora_comment *tc, char *tag);
@@ -769,7 +769,7 @@ extern void theora_comment_clear(theora_comment *tc);
* This is used to provide advanced control the encoding process.
* \param th A #theora_state handle.
* \param req The control code to process.
- * See \ref encctlcodes_old "the list of available
+ * See \ref encctlcodes_old "the list of available
* control codes" for details.
* \param buf The parameters for this control code.
* \param buf_sz The size of the parameter buffer.*/
diff --git a/thirdparties/common/include/theora/theoradec.h b/thirdparties/common/include/theora/theoradec.h
index b20f0e3..29e7eb1 100755
--- a/thirdparties/common/include/theora/theoradec.h
+++ b/thirdparties/common/include/theora/theoradec.h
@@ -136,16 +136,16 @@ extern "C" {
* I.e., this section contains fragment rows
* <tt>\a _yfrag0 ...\a _yfrag_end -1</tt>.*/
typedef void (*th_stripe_decoded_func)(void *_ctx,th_ycbcr_buffer _buf,
- int _yfrag0,int _yfrag_end);
+ int _yfrag0,int _yfrag_end);
/**The striped decode callback data to pass to #TH_DECCTL_SET_STRIPE_CB.*/
-typedef struct{
- /**An application-provided context pointer.
- * This will be passed back verbatim to the application.*/
- void *ctx;
- /**The callback function pointer.*/
- th_stripe_decoded_func stripe_decoded;
-}th_stripe_callback;
+typedef struct {
+ /**An application-provided context pointer.
+ * This will be passed back verbatim to the application.*/
+ void *ctx;
+ /**The callback function pointer.*/
+ th_stripe_decoded_func stripe_decoded;
+} th_stripe_callback;
@@ -171,7 +171,7 @@ typedef struct th_setup_info th_setup_info;
/**\defgroup decfuncs Functions for Decoding*/
/*@{*/
/**\name Functions for decoding
- * You must link to <tt>libtheoradec</tt> if you use any of the
+ * You must link to <tt>libtheoradec</tt> if you use any of the
* functions in this section.
*
* The functions are listed in the order they are used in a typical decode.
@@ -229,7 +229,7 @@ typedef struct th_setup_info th_setup_info;
* \retval TH_ENOTFORMAT The packet was not a Theora header.
*/
extern int th_decode_headerin(th_info *_info,th_comment *_tc,
- th_setup_info **_setup,ogg_packet *_op);
+ th_setup_info **_setup,ogg_packet *_op);
/**Allocates a decoder instance.
*
* <b>Security Warning:</b> The Theora format supports very large frame sizes,
@@ -253,7 +253,7 @@ extern int th_decode_headerin(th_info *_info,th_comment *_tc,
* \return The initialized #th_dec_ctx handle.
* \retval NULL If the decoding parameters were invalid.*/
extern th_dec_ctx *th_decode_alloc(const th_info *_info,
- const th_setup_info *_setup);
+ const th_setup_info *_setup);
/**Releases all storage used for the decoder setup information.
* This should be called after you no longer want to create any decoders for
* a stream whose headers you have parsed with th_decode_headerin().
@@ -269,7 +269,7 @@ extern void th_setup_free(th_setup_info *_setup);
* \param _buf The parameters for this control code.
* \param _buf_sz The size of the parameter buffer.*/
extern int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf,
- size_t _buf_sz);
+ size_t _buf_sz);
/**Submits a packet containing encoded video data to the decoder.
* \param _dec A #th_dec_ctx handle.
* \param _op An <tt>ogg_packet</tt> containing encoded video data.
@@ -292,7 +292,7 @@ extern int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf,
* \retval TH_EIMPL The video data uses bitstream features which this
* library does not support.*/
extern int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op,
- ogg_int64_t *_granpos);
+ ogg_int64_t *_granpos);
/**Outputs the next available frame of decoded Y'CbCr data.
* If a striped decode callback has been set with #TH_DECCTL_SET_STRIPE_CB,
* then the application does not need to call this function.
@@ -309,7 +309,7 @@ extern int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op,
* \retval TH_EFAULT \a _dec or \a _ycbcr was <tt>NULL</tt>.
*/
extern int th_decode_ycbcr_out(th_dec_ctx *_dec,
- th_ycbcr_buffer _ycbcr);
+ th_ycbcr_buffer _ycbcr);
/**Frees an allocated decoder instance.
* \param _dec A #th_dec_ctx handle.*/
extern void th_decode_free(th_dec_ctx *_dec);
diff --git a/thirdparties/common/include/theora/theoraenc.h b/thirdparties/common/include/theora/theoraenc.h
index fdf2ab2..8ed3c77 100755
--- a/thirdparties/common/include/theora/theoraenc.h
+++ b/thirdparties/common/include/theora/theoraenc.h
@@ -58,7 +58,7 @@ extern "C" {
*
* \param[in] _buf #th_quant_info
* \retval TH_EFAULT \a _enc_ctx is <tt>NULL</tt>.
- * \retval TH_EINVAL Encoding has already begun, \a _buf is
+ * \retval TH_EINVAL Encoding has already begun, \a _buf is
* <tt>NULL</tt> and \a _buf_sz is not zero,
* or \a _buf is non-<tt>NULL</tt> and
* \a _buf_sz is not <tt>sizeof(#th_quant_info)</tt>.
@@ -368,7 +368,7 @@ extern const th_quant_info TH_VP31_QUANT_INFO;
/**The Huffman tables used by VP3.*/
extern const th_huff_code
- TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
+TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
@@ -437,7 +437,7 @@ extern int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,size_t _buf_sz);
* \retval 0 No packet was produced, and no more header packets remain.
* \retval TH_EFAULT \a _enc, \a _comments, or \a _op was <tt>NULL</tt>.*/
extern int th_encode_flushheader(th_enc_ctx *_enc,
- th_comment *_comments,ogg_packet *_op);
+ th_comment *_comments,ogg_packet *_op);
/**Submits an uncompressed frame to the encoder.
* \param _enc A #th_enc_ctx handle.
* \param _ycbcr A buffer of Y'CbCr data to encode.
diff --git a/thirdparties/common/include/vorbis/codec.h b/thirdparties/common/include/vorbis/codec.h
index 999aa33..b217590 100755
--- a/thirdparties/common/include/vorbis/codec.h
+++ b/thirdparties/common/include/vorbis/codec.h
@@ -25,97 +25,97 @@ extern "C"
#include <ogg/ogg.h>
-typedef struct vorbis_info{
- int version;
- int channels;
- long rate;
-
- /* The below bitrate declarations are *hints*.
- Combinations of the three values carry the following implications:
-
- all three set to the same value:
- implies a fixed rate bitstream
- only nominal set:
- implies a VBR stream that averages the nominal bitrate. No hard
- upper/lower limit
- upper and or lower set:
- implies a VBR bitstream that obeys the bitrate limits. nominal
- may also be set to give a nominal rate.
- none set:
- the coder does not care to speculate.
- */
-
- long bitrate_upper;
- long bitrate_nominal;
- long bitrate_lower;
- long bitrate_window;
-
- void *codec_setup;
+typedef struct vorbis_info {
+ int version;
+ int channels;
+ long rate;
+
+ /* The below bitrate declarations are *hints*.
+ Combinations of the three values carry the following implications:
+
+ all three set to the same value:
+ implies a fixed rate bitstream
+ only nominal set:
+ implies a VBR stream that averages the nominal bitrate. No hard
+ upper/lower limit
+ upper and or lower set:
+ implies a VBR bitstream that obeys the bitrate limits. nominal
+ may also be set to give a nominal rate.
+ none set:
+ the coder does not care to speculate.
+ */
+
+ long bitrate_upper;
+ long bitrate_nominal;
+ long bitrate_lower;
+ long bitrate_window;
+
+ void *codec_setup;
} vorbis_info;
/* vorbis_dsp_state buffers the current vorbis audio
analysis/synthesis state. The DSP state belongs to a specific
logical bitstream ****************************************************/
-typedef struct vorbis_dsp_state{
- int analysisp;
- vorbis_info *vi;
+typedef struct vorbis_dsp_state {
+ int analysisp;
+ vorbis_info *vi;
- float **pcm;
- float **pcmret;
- int pcm_storage;
- int pcm_current;
- int pcm_returned;
+ float **pcm;
+ float **pcmret;
+ int pcm_storage;
+ int pcm_current;
+ int pcm_returned;
- int preextrapolate;
- int eofflag;
+ int preextrapolate;
+ int eofflag;
- long lW;
- long W;
- long nW;
- long centerW;
+ long lW;
+ long W;
+ long nW;
+ long centerW;
- ogg_int64_t granulepos;
- ogg_int64_t sequence;
+ ogg_int64_t granulepos;
+ ogg_int64_t sequence;
- ogg_int64_t glue_bits;
- ogg_int64_t time_bits;
- ogg_int64_t floor_bits;
- ogg_int64_t res_bits;
+ ogg_int64_t glue_bits;
+ ogg_int64_t time_bits;
+ ogg_int64_t floor_bits;
+ ogg_int64_t res_bits;
- void *backend_state;
+ void *backend_state;
} vorbis_dsp_state;
-typedef struct vorbis_block{
- /* necessary stream state for linking to the framing abstraction */
- float **pcm; /* this is a pointer into local storage */
- oggpack_buffer opb;
-
- long lW;
- long W;
- long nW;
- int pcmend;
- int mode;
-
- int eofflag;
- ogg_int64_t granulepos;
- ogg_int64_t sequence;
- vorbis_dsp_state *vd; /* For read-only access of configuration */
-
- /* local storage to avoid remallocing; it's up to the mapping to
- structure it */
- void *localstore;
- long localtop;
- long localalloc;
- long totaluse;
- struct alloc_chain *reap;
-
- /* bitmetrics for the frame */
- long glue_bits;
- long time_bits;
- long floor_bits;
- long res_bits;
-
- void *internal;
+typedef struct vorbis_block {
+ /* necessary stream state for linking to the framing abstraction */
+ float **pcm; /* this is a pointer into local storage */
+ oggpack_buffer opb;
+
+ long lW;
+ long W;
+ long nW;
+ int pcmend;
+ int mode;
+
+ int eofflag;
+ ogg_int64_t granulepos;
+ ogg_int64_t sequence;
+ vorbis_dsp_state *vd; /* For read-only access of configuration */
+
+ /* local storage to avoid remallocing; it's up to the mapping to
+ structure it */
+ void *localstore;
+ long localtop;
+ long localalloc;
+ long totaluse;
+ struct alloc_chain *reap;
+
+ /* bitmetrics for the frame */
+ long glue_bits;
+ long time_bits;
+ long floor_bits;
+ long res_bits;
+
+ void *internal;
} vorbis_block;
@@ -124,9 +124,9 @@ the analysis/synthesis stream; it belongs to a specific logical
bitstream, but is independent from other vorbis_blocks belonging to
that logical bitstream. *************************************************/
-struct alloc_chain{
- void *ptr;
- struct alloc_chain *next;
+struct alloc_chain {
+ void *ptr;
+ struct alloc_chain *next;
};
/* vorbis_info contains all the setup information specific to the
@@ -137,13 +137,13 @@ struct alloc_chain{
/* the comments are not part of vorbis_info so that vorbis_info can be
static storage */
-typedef struct vorbis_comment{
- /* unlimited user comment fields. libvorbis writes 'libvorbis'
- whatever vendor is set to in encode */
- char **user_comments;
- int *comment_lengths;
- int comments;
- char *vendor;
+typedef struct vorbis_comment {
+ /* unlimited user comment fields. libvorbis writes 'libvorbis'
+ whatever vendor is set to in encode */
+ char **user_comments;
+ int *comment_lengths;
+ int comments;
+ char *vendor;
} vorbis_comment;
@@ -186,10 +186,10 @@ extern const char *vorbis_version_string(void);
extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
- vorbis_comment *vc,
- ogg_packet *op,
- ogg_packet *op_comm,
- ogg_packet *op_code);
+ vorbis_comment *vc,
+ ogg_packet *op,
+ ogg_packet *op_comm,
+ ogg_packet *op_code);
extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
@@ -197,12 +197,12 @@ extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
extern int vorbis_bitrate_addblock(vorbis_block *vb);
extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
- ogg_packet *op);
+ ogg_packet *op);
/* Vorbis PRIMITIVES: synthesis layer *******************************/
extern int vorbis_synthesis_idheader(ogg_packet *op);
extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
- ogg_packet *op);
+ ogg_packet *op);
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
diff --git a/thirdparties/common/include/vorbis/vorbisenc.h b/thirdparties/common/include/vorbis/vorbisenc.h
index 02332b5..de05787 100755
--- a/thirdparties/common/include/vorbis/vorbisenc.h
+++ b/thirdparties/common/include/vorbis/vorbisenc.h
@@ -127,10 +127,10 @@ extern int vorbis_encode_setup_managed(vorbis_info *vi,
* \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request.
*/
extern int vorbis_encode_setup_vbr(vorbis_info *vi,
- long channels,
- long rate,
+ long channels,
+ long rate,
- float quality
+ float quality
);
/**
@@ -160,7 +160,7 @@ extern int vorbis_encode_init_vbr(vorbis_info *vi,
long rate,
float base_quality
- );
+ );
/**
* This function performs the last stage of three-step encoding setup, as
@@ -231,31 +231,31 @@ extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
* configuration.
*/
struct ovectl_ratemanage_arg {
- int management_active; /**< nonzero if bitrate management is active*/
-/** hard lower limit (in kilobits per second) below which the stream bitrate
- will never be allowed for any given bitrate_hard_window seconds of time.*/
- long bitrate_hard_min;
-/** hard upper limit (in kilobits per second) above which the stream bitrate
- will never be allowed for any given bitrate_hard_window seconds of time.*/
- long bitrate_hard_max;
-/** the window period (in seconds) used to regulate the hard bitrate minimum
- and maximum*/
- double bitrate_hard_window;
-/** soft lower limit (in kilobits per second) below which the average bitrate
- tracker will start nudging the bitrate higher.*/
- long bitrate_av_lo;
-/** soft upper limit (in kilobits per second) above which the average bitrate
- tracker will start nudging the bitrate lower.*/
- long bitrate_av_hi;
-/** the window period (in seconds) used to regulate the average bitrate
- minimum and maximum.*/
- double bitrate_av_window;
-/** Regulates the relative centering of the average and hard windows; in
- libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but
- followed the average window regulation. In libvorbis 1.1 a bit-reservoir
- interface replaces the old windowing interface; the older windowing
- interface is simulated and this field has no effect.*/
- double bitrate_av_window_center;
+ int management_active; /**< nonzero if bitrate management is active*/
+ /** hard lower limit (in kilobits per second) below which the stream bitrate
+ will never be allowed for any given bitrate_hard_window seconds of time.*/
+ long bitrate_hard_min;
+ /** hard upper limit (in kilobits per second) above which the stream bitrate
+ will never be allowed for any given bitrate_hard_window seconds of time.*/
+ long bitrate_hard_max;
+ /** the window period (in seconds) used to regulate the hard bitrate minimum
+ and maximum*/
+ double bitrate_hard_window;
+ /** soft lower limit (in kilobits per second) below which the average bitrate
+ tracker will start nudging the bitrate higher.*/
+ long bitrate_av_lo;
+ /** soft upper limit (in kilobits per second) above which the average bitrate
+ tracker will start nudging the bitrate lower.*/
+ long bitrate_av_hi;
+ /** the window period (in seconds) used to regulate the average bitrate
+ minimum and maximum.*/
+ double bitrate_av_window;
+ /** Regulates the relative centering of the average and hard windows; in
+ libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but
+ followed the average window regulation. In libvorbis 1.1 a bit-reservoir
+ interface replaces the old windowing interface; the older windowing
+ interface is simulated and this field has no effect.*/
+ double bitrate_av_window_center;
};
/**
@@ -268,25 +268,25 @@ struct ovectl_ratemanage_arg {
*
*/
struct ovectl_ratemanage2_arg {
- int management_active; /**< nonzero if bitrate management is active */
-/** Lower allowed bitrate limit in kilobits per second */
- long bitrate_limit_min_kbps;
-/** Upper allowed bitrate limit in kilobits per second */
- long bitrate_limit_max_kbps;
- long bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits */
-/** Regulates the bitrate reservoir's preferred fill level in a range from 0.0
- * to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0
- * buffers against future sudden drops in instantaneous bitrate. Default is
- * 0.1
- */
- double bitrate_limit_reservoir_bias;
-/** Average bitrate setting in kilobits per second */
- long bitrate_average_kbps;
-/** Slew rate limit setting for average bitrate adjustment; sets the minimum
- * time in seconds the bitrate tracker may swing from one extreme to the
- * other when boosting or damping average bitrate.
- */
- double bitrate_average_damping;
+ int management_active; /**< nonzero if bitrate management is active */
+ /** Lower allowed bitrate limit in kilobits per second */
+ long bitrate_limit_min_kbps;
+ /** Upper allowed bitrate limit in kilobits per second */
+ long bitrate_limit_max_kbps;
+ long bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits */
+ /** Regulates the bitrate reservoir's preferred fill level in a range from 0.0
+ * to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0
+ * buffers against future sudden drops in instantaneous bitrate. Default is
+ * 0.1
+ */
+ double bitrate_limit_reservoir_bias;
+ /** Average bitrate setting in kilobits per second */
+ long bitrate_average_kbps;
+ /** Slew rate limit setting for average bitrate adjustment; sets the minimum
+ * time in seconds the bitrate tracker may swing from one extreme to the
+ * other when boosting or damping average bitrate.
+ */
+ double bitrate_average_damping;
};
@@ -378,7 +378,7 @@ struct ovectl_ratemanage2_arg {
*/
#define OV_ECTL_COUPLING_SET 0x41
- /* deprecated rate management supported only for compatibility */
+/* deprecated rate management supported only for compatibility */
/**
* Old interface to querying bitrate management settings.
diff --git a/thirdparties/common/include/vorbis/vorbisfile.h b/thirdparties/common/include/vorbis/vorbisfile.h
index 9271331..9ff52cb 100755
--- a/thirdparties/common/include/vorbis/vorbisfile.h
+++ b/thirdparties/common/include/vorbis/vorbisfile.h
@@ -37,10 +37,10 @@ extern "C"
* unseekable
*/
typedef struct {
- size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
- int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
- int (*close_func) (void *datasource);
- long (*tell_func) (void *datasource);
+ size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
+ int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
+ int (*close_func) (void *datasource);
+ long (*tell_func) (void *datasource);
} ov_callbacks;
#ifndef OV_EXCLUDE_STATIC_CALLBACKS
@@ -50,15 +50,18 @@ typedef struct {
* ov_open() to avoid problems with incompatible crt.o version linking
* issues. */
-static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
- if(f==NULL)return(-1);
+static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence)
+{
+ if(f==NULL) {
+ return(-1);
+ }
#ifdef __MINGW32__
- return fseeko64(f,off,whence);
+ return fseeko64(f,off,whence);
#elif defined (_WIN32)
- return _fseeki64(f,off,whence);
+ return _fseeki64(f,off,whence);
#else
- return fseek(f,off,whence);
+ return fseek(f,off,whence);
#endif
}
@@ -73,31 +76,31 @@ static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
*/
static ov_callbacks OV_CALLBACKS_DEFAULT = {
- (size_t (*)(void *, size_t, size_t, void *)) fread,
- (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
- (int (*)(void *)) fclose,
- (long (*)(void *)) ftell
+ (size_t (*)(void *, size_t, size_t, void *)) fread,
+ (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
+ (int (*)(void *)) fclose,
+ (long (*)(void *)) ftell
};
static ov_callbacks OV_CALLBACKS_NOCLOSE = {
- (size_t (*)(void *, size_t, size_t, void *)) fread,
- (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
- (int (*)(void *)) NULL,
- (long (*)(void *)) ftell
+ (size_t (*)(void *, size_t, size_t, void *)) fread,
+ (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
+ (int (*)(void *)) NULL,
+ (long (*)(void *)) ftell
};
static ov_callbacks OV_CALLBACKS_STREAMONLY = {
- (size_t (*)(void *, size_t, size_t, void *)) fread,
- (int (*)(void *, ogg_int64_t, int)) NULL,
- (int (*)(void *)) fclose,
- (long (*)(void *)) NULL
+ (size_t (*)(void *, size_t, size_t, void *)) fread,
+ (int (*)(void *, ogg_int64_t, int)) NULL,
+ (int (*)(void *)) fclose,
+ (long (*)(void *)) NULL
};
static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
- (size_t (*)(void *, size_t, size_t, void *)) fread,
- (int (*)(void *, ogg_int64_t, int)) NULL,
- (int (*)(void *)) NULL,
- (long (*)(void *)) NULL
+ (size_t (*)(void *, size_t, size_t, void *)) fread,
+ (int (*)(void *, ogg_int64_t, int)) NULL,
+ (int (*)(void *)) NULL,
+ (long (*)(void *)) NULL
};
#endif
@@ -109,39 +112,39 @@ static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
#define INITSET 4
typedef struct OggVorbis_File {
- void *datasource; /* Pointer to a FILE *, etc. */
- int seekable;
- ogg_int64_t offset;
- ogg_int64_t end;
- ogg_sync_state oy;
-
- /* If the FILE handle isn't seekable (eg, a pipe), only the current
- stream appears */
- int links;
- ogg_int64_t *offsets;
- ogg_int64_t *dataoffsets;
- long *serialnos;
- ogg_int64_t *pcmlengths; /* overloaded to maintain binary
+ void *datasource; /* Pointer to a FILE *, etc. */
+ int seekable;
+ ogg_int64_t offset;
+ ogg_int64_t end;
+ ogg_sync_state oy;
+
+ /* If the FILE handle isn't seekable (eg, a pipe), only the current
+ stream appears */
+ int links;
+ ogg_int64_t *offsets;
+ ogg_int64_t *dataoffsets;
+ long *serialnos;
+ ogg_int64_t *pcmlengths; /* overloaded to maintain binary
compatibility; x2 size, stores both
beginning and end values */
- vorbis_info *vi;
- vorbis_comment *vc;
+ vorbis_info *vi;
+ vorbis_comment *vc;
- /* Decoding working state local storage */
- ogg_int64_t pcm_offset;
- int ready_state;
- long current_serialno;
- int current_link;
+ /* Decoding working state local storage */
+ ogg_int64_t pcm_offset;
+ int ready_state;
+ long current_serialno;
+ int current_link;
- double bittrack;
- double samptrack;
+ double bittrack;
+ double samptrack;
- ogg_stream_state os; /* take physical pages, weld into a logical
+ ogg_stream_state os; /* take physical pages, weld into a logical
stream of packets */
- vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
- vorbis_block vb; /* local working space for packet->PCM decode */
+ vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
+ vorbis_block vb; /* local working space for packet->PCM decode */
- ov_callbacks callbacks;
+ ov_callbacks callbacks;
} OggVorbis_File;
@@ -150,11 +153,11 @@ extern int ov_clear(OggVorbis_File *vf);
extern int ov_fopen(const char *path,OggVorbis_File *vf);
extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
- const char *initial, long ibytes, ov_callbacks callbacks);
+ const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
- const char *initial, long ibytes, ov_callbacks callbacks);
+ const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);
extern long ov_bitrate(OggVorbis_File *vf,int i);
@@ -189,8 +192,8 @@ extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
int *bitstream);
extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
- int bigendianp,int word,int sgned,int *bitstream,
- void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
+ int bigendianp,int word,int sgned,int *bitstream,
+ void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
int bigendianp,int word,int sgned,int *bitstream);
extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
diff --git a/thirdparties/common/include/webrtc/gain_control.h b/thirdparties/common/include/webrtc/gain_control.h
index 8af5c71..99490ec 100755
--- a/thirdparties/common/include/webrtc/gain_control.h
+++ b/thirdparties/common/include/webrtc/gain_control.h
@@ -23,22 +23,19 @@
// Warnings
#define AGC_BAD_PARAMETER_WARNING 18050
-enum
-{
+enum {
kAgcModeUnchanged,
kAgcModeAdaptiveAnalog,
kAgcModeAdaptiveDigital,
kAgcModeFixedDigital
};
-enum
-{
+enum {
kAgcFalse = 0,
kAgcTrue
};
-typedef struct
-{
+typedef struct {
WebRtc_Word16 targetLevelDbfs; // default 3 (-3 dBOv)
WebRtc_Word16 compressionGaindB; // default 9 dB
WebRtc_UWord8 limiterEnable; // default kAgcTrue (on)
diff --git a/thirdparties/common/include/wels/codec_api.h b/thirdparties/common/include/wels/codec_api.h
index 6db86f5..f7347f6 100755
--- a/thirdparties/common/include/wels/codec_api.h
+++ b/thirdparties/common/include/wels/codec_api.h
@@ -51,85 +51,87 @@ typedef unsigned char bool;
#endif
#ifdef __cplusplus
-class ISVCEncoder {
- public:
- /*
- * return: CM_RETURN: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
- virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
-
- virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
-
- virtual int EXTAPI Uninitialize() = 0;
-
- /*
- * return: 0 - success; otherwise -failed;
- */
- virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
-
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
-
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
-
- /************************************************************************
- * InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,..
- ************************************************************************/
- /*
- * return: CM_RETURN: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
- virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
- virtual ~ISVCEncoder() {}
+class ISVCEncoder
+{
+public:
+ /*
+ * return: CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
+ virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
+
+ virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
+
+ virtual int EXTAPI Uninitialize() = 0;
+
+ /*
+ * return: 0 - success; otherwise -failed;
+ */
+ virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
+ /*
+ * return: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
+
+ /*
+ * return: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
+
+ /*
+ * return: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
+
+ /************************************************************************
+ * InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,..
+ ************************************************************************/
+ /*
+ * return: CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
+ virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
+ virtual ~ISVCEncoder() {}
};
-class ISVCDecoder {
- public:
- virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
- virtual long EXTAPI Uninitialize() = 0;
-
- virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- int* pStride,
- int& iWidth,
- int& iHeight) = 0;
- /*
- * return: 0 - success; otherwise -failed;
- */
- virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- SBufferInfo* pDstInfo) = 0;
-
- /*
- * this API does not work for now!! This is for future use to support non-I420 color format output.
- */
- virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char* pDst,
- int iDstStride,
- int& iDstLen,
- int& iWidth,
- int& iHeight,
- int& iColorFormat) = 0;
-
- /*************************************************************************
- * OutDataFormat, Eos Flag, EC method, ...
- *************************************************************************/
- virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
- virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
- virtual ~ISVCDecoder() {}
+class ISVCDecoder
+{
+public:
+ virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
+ virtual long EXTAPI Uninitialize() = 0;
+
+ virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ int* pStride,
+ int& iWidth,
+ int& iHeight) = 0;
+ /*
+ * return: 0 - success; otherwise -failed;
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo) = 0;
+
+ /*
+ * this API does not work for now!! This is for future use to support non-I420 color format output.
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char* pDst,
+ int iDstStride,
+ int& iDstLen,
+ int& iWidth,
+ int& iHeight,
+ int& iColorFormat) = 0;
+
+ /*************************************************************************
+ * OutDataFormat, Eos Flag, EC method, ...
+ *************************************************************************/
+ virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
+ virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
+ virtual ~ISVCDecoder() {}
};
@@ -141,53 +143,53 @@ typedef struct ISVCEncoderVtbl ISVCEncoderVtbl;
typedef const ISVCEncoderVtbl* ISVCEncoder;
struct ISVCEncoderVtbl {
-int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam);
-int (*InitializeExt) (ISVCEncoder*, const SEncParamExt* pParam);
+ int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam);
+ int (*InitializeExt) (ISVCEncoder*, const SEncParamExt* pParam);
-int (*GetDefaultParams) (ISVCEncoder*, SEncParamExt* pParam);
+ int (*GetDefaultParams) (ISVCEncoder*, SEncParamExt* pParam);
-int (*Uninitialize) (ISVCEncoder*);
+ int (*Uninitialize) (ISVCEncoder*);
-int (*EncodeFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
-int (*EncodeParameterSets) (ISVCEncoder*, SFrameBSInfo* pBsInfo);
+ int (*EncodeFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
+ int (*EncodeParameterSets) (ISVCEncoder*, SFrameBSInfo* pBsInfo);
-int (*PauseFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
+ int (*PauseFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
-int (*ForceIntraFrame) (ISVCEncoder*, bool bIDR);
+ int (*ForceIntraFrame) (ISVCEncoder*, bool bIDR);
-int (*SetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
-int (*GetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
+ int (*SetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
+ int (*GetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
};
typedef struct ISVCDecoderVtbl ISVCDecoderVtbl;
typedef const ISVCDecoderVtbl* ISVCDecoder;
struct ISVCDecoderVtbl {
-long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
-long (*Uninitialize) (ISVCDecoder*);
-
-DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- int* pStride,
- int* iWidth,
- int* iHeight);
-
-DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- SBufferInfo* pDstInfo);
-
-DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char* pDst,
- int iDstStride,
- int* iDstLen,
- int* iWidth,
- int* iHeight,
- int* iColorFormat);
-
-long (*SetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
-long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
+ long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
+ long (*Uninitialize) (ISVCDecoder*);
+
+ DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ int* pStride,
+ int* iWidth,
+ int* iHeight);
+
+ DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo);
+
+ DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char* pDst,
+ int iDstStride,
+ int* iDstLen,
+ int* iWidth,
+ int* iHeight,
+ int* iColorFormat);
+
+ long (*SetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
+ long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
};
#endif
diff --git a/thirdparties/common/include/wels/codec_app_def.h b/thirdparties/common/include/wels/codec_app_def.h
index 7b34d4b..0e4c1cb 100755
--- a/thirdparties/common/include/wels/codec_app_def.h
+++ b/thirdparties/common/include/wels/codec_app_def.h
@@ -51,373 +51,373 @@
#define AUTO_REF_PIC_COUNT -1 // encoder selects the number of reference frame automatically
typedef enum {
- /* Errors derived from bitstream parsing */
- dsErrorFree = 0x00, /* Bitstream error-free */
- dsFramePending = 0x01, /* Need more throughput to generate a frame output, */
- dsRefLost = 0x02, /* layer lost at reference frame with temporal id 0 */
- dsBitstreamError = 0x04, /* Error bitstreams(maybe broken internal frame) the decoder cared */
- dsDepLayerLost = 0x08, /* Dependented layer is ever lost */
- dsNoParamSets = 0x10, /* No parameter set NALs involved */
- dsDataErrorConcealed = 0x20, /* current data Error concealed specified */
-
- /* Errors derived from logic level */
- dsInvalidArgument = 0x1000, /* Invalid argument specified */
- dsInitialOptExpected = 0x2000, /* Initializing operation is expected */
- dsOutOfMemory = 0x4000, /* Out of memory due to new request */
- /* ANY OTHERS? */
- dsDstBufNeedExpand = 0x8000 /* Actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size */
+ /* Errors derived from bitstream parsing */
+ dsErrorFree = 0x00, /* Bitstream error-free */
+ dsFramePending = 0x01, /* Need more throughput to generate a frame output, */
+ dsRefLost = 0x02, /* layer lost at reference frame with temporal id 0 */
+ dsBitstreamError = 0x04, /* Error bitstreams(maybe broken internal frame) the decoder cared */
+ dsDepLayerLost = 0x08, /* Dependented layer is ever lost */
+ dsNoParamSets = 0x10, /* No parameter set NALs involved */
+ dsDataErrorConcealed = 0x20, /* current data Error concealed specified */
+
+ /* Errors derived from logic level */
+ dsInvalidArgument = 0x1000, /* Invalid argument specified */
+ dsInitialOptExpected = 0x2000, /* Initializing operation is expected */
+ dsOutOfMemory = 0x4000, /* Out of memory due to new request */
+ /* ANY OTHERS? */
+ dsDstBufNeedExpand = 0x8000 /* Actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size */
} DECODING_STATE;
/* Option types introduced in SVC encoder application */
typedef enum {
- ENCODER_OPTION_DATAFORMAT = 0,
- ENCODER_OPTION_IDR_INTERVAL,
- ENCODER_OPTION_SVC_ENCODE_PARAM_BASE,
- ENCODER_OPTION_SVC_ENCODE_PARAM_EXT,
- ENCODER_OPTION_FRAME_RATE,
- ENCODER_OPTION_BITRATE,
- ENCODER_OPTION_MAX_BITRATE,
- ENCODER_OPTION_INTER_SPATIAL_PRED,
- ENCODER_OPTION_RC_MODE,
- ENCODER_PADDING_PADDING,
-
- ENCODER_OPTION_PROFILE,
- ENCODER_OPTION_LEVEL,
- ENCODER_OPTION_NUMBER_REF,
- ENCODER_OPTION_DELIVERY_STATUS,
-
- ENCODER_LTR_RECOVERY_REQUEST,
- ENCODER_LTR_MARKING_FEEDBACK,
- ENCOCER_LTR_MARKING_PERIOD,
- ENCODER_OPTION_LTR,
-
- ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
- ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
- ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
-
- ENCODER_OPTION_CURRENT_PATH,
- ENCODER_OPTION_DUMP_FILE,
- ENCODER_OPTION_TRACE_LEVEL,
- ENCODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
- ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,
+ ENCODER_OPTION_DATAFORMAT = 0,
+ ENCODER_OPTION_IDR_INTERVAL,
+ ENCODER_OPTION_SVC_ENCODE_PARAM_BASE,
+ ENCODER_OPTION_SVC_ENCODE_PARAM_EXT,
+ ENCODER_OPTION_FRAME_RATE,
+ ENCODER_OPTION_BITRATE,
+ ENCODER_OPTION_MAX_BITRATE,
+ ENCODER_OPTION_INTER_SPATIAL_PRED,
+ ENCODER_OPTION_RC_MODE,
+ ENCODER_PADDING_PADDING,
+
+ ENCODER_OPTION_PROFILE,
+ ENCODER_OPTION_LEVEL,
+ ENCODER_OPTION_NUMBER_REF,
+ ENCODER_OPTION_DELIVERY_STATUS,
+
+ ENCODER_LTR_RECOVERY_REQUEST,
+ ENCODER_LTR_MARKING_FEEDBACK,
+ ENCOCER_LTR_MARKING_PERIOD,
+ ENCODER_OPTION_LTR,
+
+ ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
+ ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
+ ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
+
+ ENCODER_OPTION_CURRENT_PATH,
+ ENCODER_OPTION_DUMP_FILE,
+ ENCODER_OPTION_TRACE_LEVEL,
+ ENCODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
+ ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,
} ENCODER_OPTION;
/* Option types introduced in decoder application */
typedef enum {
- DECODER_OPTION_DATAFORMAT = 0, /* Set color space of decoding output frame */
- DECODER_OPTION_END_OF_STREAM, /* Indicate bitstream of the final frame to be decoded */
- DECODER_OPTION_VCL_NAL, //feedback whether or not have VCL NAL in current AU for application layer
- DECODER_OPTION_TEMPORAL_ID, //feedback temporal id for application layer
- DECODER_OPTION_FRAME_NUM, //feedback current decoded frame number
- DECODER_OPTION_IDR_PIC_ID, // feedback current frame belong to which IDR period
- DECODER_OPTION_LTR_MARKING_FLAG, // feedback wether current frame mark a LTR
- DECODER_OPTION_LTR_MARKED_FRAME_NUM, // feedback frame num marked by current Frame
- DECODER_OPTION_ERROR_CON_IDC, //not finished yet, indicate decoder error concealment status, in progress
- DECODER_OPTION_TRACE_LEVEL,
- DECODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
- DECODER_OPTION_TRACE_CALLBACK_CONTEXT,
+ DECODER_OPTION_DATAFORMAT = 0, /* Set color space of decoding output frame */
+ DECODER_OPTION_END_OF_STREAM, /* Indicate bitstream of the final frame to be decoded */
+ DECODER_OPTION_VCL_NAL, //feedback whether or not have VCL NAL in current AU for application layer
+ DECODER_OPTION_TEMPORAL_ID, //feedback temporal id for application layer
+ DECODER_OPTION_FRAME_NUM, //feedback current decoded frame number
+ DECODER_OPTION_IDR_PIC_ID, // feedback current frame belong to which IDR period
+ DECODER_OPTION_LTR_MARKING_FLAG, // feedback wether current frame mark a LTR
+ DECODER_OPTION_LTR_MARKED_FRAME_NUM, // feedback frame num marked by current Frame
+ DECODER_OPTION_ERROR_CON_IDC, //not finished yet, indicate decoder error concealment status, in progress
+ DECODER_OPTION_TRACE_LEVEL,
+ DECODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
+ DECODER_OPTION_TRACE_CALLBACK_CONTEXT,
} DECODER_OPTION;
//enuerate the types of error concealment methods
typedef enum {
- ERROR_CON_DISABLE = 0,
- ERROR_CON_FRAME_COPY,
- ERROR_CON_SLICE_COPY,
+ ERROR_CON_DISABLE = 0,
+ ERROR_CON_FRAME_COPY,
+ ERROR_CON_SLICE_COPY,
} ERROR_CON_IDC;
typedef enum { //feedback that whether or not have VCL NAL in current AU
- FEEDBACK_NON_VCL_NAL = 0,
- FEEDBACK_VCL_NAL,
- FEEDBACK_UNKNOWN_NAL
+ FEEDBACK_NON_VCL_NAL = 0,
+ FEEDBACK_VCL_NAL,
+ FEEDBACK_UNKNOWN_NAL
} FEEDBACK_VCL_NAL_IN_AU;
/* Type of layer being encoded */
typedef enum {
- NON_VIDEO_CODING_LAYER = 0,
- VIDEO_CODING_LAYER = 1
+ NON_VIDEO_CODING_LAYER = 0,
+ VIDEO_CODING_LAYER = 1
} LAYER_TYPE;
typedef enum {
- SPATIAL_LAYER_0 = 0,
- SPATIAL_LAYER_1 = 1,
- SPATIAL_LAYER_2 = 2,
- SPATIAL_LAYER_3 = 3,
- SPATIAL_LAYER_ALL = 4,
+ SPATIAL_LAYER_0 = 0,
+ SPATIAL_LAYER_1 = 1,
+ SPATIAL_LAYER_2 = 2,
+ SPATIAL_LAYER_3 = 3,
+ SPATIAL_LAYER_ALL = 4,
} LAYER_NUM;
//enumerate the type of video bitstream which is provided to decoder
typedef enum {
- VIDEO_BITSTREAM_AVC = 0,
- VIDEO_BITSTREAM_SVC = 1,
- VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC,
+ VIDEO_BITSTREAM_AVC = 0,
+ VIDEO_BITSTREAM_SVC = 1,
+ VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC,
} VIDEO_BITSTREAM_TYPE;
typedef enum {
- NO_RECOVERY_REQUSET = 0,
- LTR_RECOVERY_REQUEST = 1,
- IDR_RECOVERY_REQUEST = 2,
- NO_LTR_MARKING_FEEDBACK = 3,
- LTR_MARKING_SUCCESS = 4,
- LTR_MARKING_FAILED = 5,
+ NO_RECOVERY_REQUSET = 0,
+ LTR_RECOVERY_REQUEST = 1,
+ IDR_RECOVERY_REQUEST = 2,
+ NO_LTR_MARKING_FEEDBACK = 3,
+ LTR_MARKING_SUCCESS = 4,
+ LTR_MARKING_FAILED = 5,
} KEY_FRAME_REQUEST_TYPE;
typedef struct {
- unsigned int uiFeedbackType; //IDR request or LTR recovery request
- unsigned int uiIDRPicId; // distinguish request from different IDR
- int iLastCorrectFrameNum;
- int iCurrentFrameNum; //specify current decoder frame_num.
+ unsigned int uiFeedbackType; //IDR request or LTR recovery request
+ unsigned int uiIDRPicId; // distinguish request from different IDR
+ int iLastCorrectFrameNum;
+ int iCurrentFrameNum; //specify current decoder frame_num.
} SLTRRecoverRequest;
typedef struct {
- unsigned int uiFeedbackType; //mark failed or successful
- unsigned int uiIDRPicId; // distinguish request from different IDR
- int iLTRFrameNum; //specify current decoder frame_num
+ unsigned int uiFeedbackType; //mark failed or successful
+ unsigned int uiIDRPicId; // distinguish request from different IDR
+ int iLTRFrameNum; //specify current decoder frame_num
} SLTRMarkingFeedback;
typedef struct {
- unsigned int
- uiSliceMbNum[MAX_SLICES_NUM_TMP]; //here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
- unsigned int uiSliceNum;
- unsigned int uiSliceSizeConstraint;
+ unsigned int
+ uiSliceMbNum[MAX_SLICES_NUM_TMP]; //here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
+ unsigned int uiSliceNum;
+ unsigned int uiSliceSizeConstraint;
} SSliceArgument;//not all the elements in this argument will be used, how it will be used depends on uiSliceMode; see below
typedef enum {
- SM_SINGLE_SLICE = 0, // | SliceNum==1
- SM_FIXEDSLCNUM_SLICE = 1, // | according to SliceNum | Enabled dynamic slicing for multi-thread
- SM_RASTER_SLICE = 2, // | according to SlicesAssign | Need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
- SM_ROWMB_SLICE = 3, // | according to PictureMBHeight | Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
- SM_DYN_SLICE = 4, // | according to SliceSize | Dynamic slicing (have no idea about slice_nums until encoding current frame)
- SM_AUTO_SLICE = 5, // | according to thread number
- SM_RESERVED = 6
+ SM_SINGLE_SLICE = 0, // | SliceNum==1
+ SM_FIXEDSLCNUM_SLICE = 1, // | according to SliceNum | Enabled dynamic slicing for multi-thread
+ SM_RASTER_SLICE = 2, // | according to SlicesAssign | Need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
+ SM_ROWMB_SLICE = 3, // | according to PictureMBHeight | Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
+ SM_DYN_SLICE = 4, // | according to SliceSize | Dynamic slicing (have no idea about slice_nums until encoding current frame)
+ SM_AUTO_SLICE = 5, // | according to thread number
+ SM_RESERVED = 6
} SliceModeEnum;
typedef enum {
- RC_QUALITY_MODE = 0, //Quality mode
- RC_BITRATE_MODE = 1, //Bitrate mode
- RC_LOW_BW_MODE = 2, //bitrate limited mode
- RC_OFF_MODE = -1, // rate control off mode
+ RC_QUALITY_MODE = 0, //Quality mode
+ RC_BITRATE_MODE = 1, //Bitrate mode
+ RC_LOW_BW_MODE = 2, //bitrate limited mode
+ RC_OFF_MODE = -1, // rate control off mode
} RC_MODES;
typedef enum {
- PRO_UNKNOWN = 0,
- PRO_BASELINE = 66,
- PRO_MAIN = 77,
- PRO_EXTENDED = 88,
- PRO_HIGH = 100,
- PRO_HIGH10 = 110,
- PRO_HIGH422 = 122,
- PRO_HIGH444 = 144,
- PRO_CAVLC444 = 244,
-
- PRO_SCALABLE_BASELINE = 83,
- PRO_SCALABLE_HIGH = 86,
+ PRO_UNKNOWN = 0,
+ PRO_BASELINE = 66,
+ PRO_MAIN = 77,
+ PRO_EXTENDED = 88,
+ PRO_HIGH = 100,
+ PRO_HIGH10 = 110,
+ PRO_HIGH422 = 122,
+ PRO_HIGH444 = 144,
+ PRO_CAVLC444 = 244,
+
+ PRO_SCALABLE_BASELINE = 83,
+ PRO_SCALABLE_HIGH = 86,
} EProfileIdc;
typedef enum {
- LEVEL_UNKNOWN,
- LEVEL_1_0,
- LEVEL_1_B,
- LEVEL_1_1,
- LEVEL_1_2,
- LEVEL_1_3,
- LEVEL_2_0,
- LEVEL_2_1,
- LEVEL_2_2,
- LEVEL_3_0,
- LEVEL_3_1,
- LEVEL_3_2,
- LEVEL_4_0,
- LEVEL_4_1,
- LEVEL_4_2,
- LEVEL_5_0,
- LEVEL_5_1,
- LEVEL_5_2
+ LEVEL_UNKNOWN,
+ LEVEL_1_0,
+ LEVEL_1_B,
+ LEVEL_1_1,
+ LEVEL_1_2,
+ LEVEL_1_3,
+ LEVEL_2_0,
+ LEVEL_2_1,
+ LEVEL_2_2,
+ LEVEL_3_0,
+ LEVEL_3_1,
+ LEVEL_3_2,
+ LEVEL_4_0,
+ LEVEL_4_1,
+ LEVEL_4_2,
+ LEVEL_5_0,
+ LEVEL_5_1,
+ LEVEL_5_2
} ELevelIdc;
enum {
- WELS_LOG_QUIET = 0x00, // Quiet mode
- WELS_LOG_ERROR = 1 << 0, // Error log iLevel
- WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
- WELS_LOG_INFO = 1 << 2, // Information log iLevel
- WELS_LOG_DEBUG = 1 << 3, // Debug log, critical algo log
- WELS_LOG_DETAIL = 1 << 4, // per packet/frame log
- WELS_LOG_RESV = 1 << 5, // Resversed log iLevel
- WELS_LOG_LEVEL_COUNT = 6,
- WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
+ WELS_LOG_QUIET = 0x00, // Quiet mode
+ WELS_LOG_ERROR = 1 << 0, // Error log iLevel
+ WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
+ WELS_LOG_INFO = 1 << 2, // Information log iLevel
+ WELS_LOG_DEBUG = 1 << 3, // Debug log, critical algo log
+ WELS_LOG_DETAIL = 1 << 4, // per packet/frame log
+ WELS_LOG_RESV = 1 << 5, // Resversed log iLevel
+ WELS_LOG_LEVEL_COUNT = 6,
+ WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
};
typedef struct {
- SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
- SSliceArgument sSliceArgument;
+ SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
+ SSliceArgument sSliceArgument;
} SSliceConfig;
typedef struct {
- int iVideoWidth; // video size in cx specified for a layer
- int iVideoHeight; // video size in cy specified for a layer
- float fFrameRate; // frame rate specified for a layer
- int iSpatialBitrate; // target bitrate for a spatial layer
- int iMaxSpatialBitrate;
- EProfileIdc uiProfileIdc; // value of profile IDC (PRO_UNKNOWN for auto-detection)
- ELevelIdc uiLevelIdc;
- int iDLayerQp;
-
- SSliceConfig sSliceCfg;
+ int iVideoWidth; // video size in cx specified for a layer
+ int iVideoHeight; // video size in cy specified for a layer
+ float fFrameRate; // frame rate specified for a layer
+ int iSpatialBitrate; // target bitrate for a spatial layer
+ int iMaxSpatialBitrate;
+ EProfileIdc uiProfileIdc; // value of profile IDC (PRO_UNKNOWN for auto-detection)
+ ELevelIdc uiLevelIdc;
+ int iDLayerQp;
+
+ SSliceConfig sSliceCfg;
} SSpatialLayerConfig;
typedef enum {
- CAMERA_VIDEO_REAL_TIME, //camera video signal
- SCREEN_CONTENT_REAL_TIME,//screen content signal
+ CAMERA_VIDEO_REAL_TIME, //camera video signal
+ SCREEN_CONTENT_REAL_TIME,//screen content signal
} EUsageType;
// TODO: Refine the parameters definition.
// SVC Encoding Parameters
typedef struct TagEncParamBase {
- EUsageType
- iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
- int iInputCsp; // color space of input sequence
+ EUsageType
+ iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
+ int iInputCsp; // color space of input sequence
- int iPicWidth; // width of picture in samples
- int iPicHeight; // height of picture in samples
- int iTargetBitrate; // target bitrate desired
- RC_MODES iRCMode; // RC mode
- float fMaxFrameRate; // input maximal frame rate
+ int iPicWidth; // width of picture in samples
+ int iPicHeight; // height of picture in samples
+ int iTargetBitrate; // target bitrate desired
+ RC_MODES iRCMode; // RC mode
+ float fMaxFrameRate; // input maximal frame rate
} SEncParamBase, *PEncParamBase;
typedef struct TagEncParamExt {
- EUsageType
- iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
- int iInputCsp; // color space of input sequence
-
- int iPicWidth; // width of picture in samples
- int iPicHeight; // height of picture in samples
- int iTargetBitrate; // target bitrate desired
- RC_MODES iRCMode; // RC mode
- float fMaxFrameRate; // input maximal frame rate
-
- int iTemporalLayerNum; // layer number at temporal level
- int iSpatialLayerNum; // layer number at spatial level
- SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
-
- unsigned int uiIntraPeriod; // period of Intra frame
- int iNumRefFrame; // number of reference frame used
- unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
- bool bEnableSpsPpsIdAddition;
- bool bPrefixNalAddingCtrl;
- bool bEnableSSEI;
- int iPaddingFlag; // 0:disable padding;1:padding
- int iEntropyCodingModeFlag;
-
- /* rc control */
- bool bEnableFrameSkip; // allow skipping frames to keep the bitrate within limits
- int iMaxBitrate; // max bitrate desired
- int iMaxQp;
- int iMinQp;
- unsigned int uiMaxNalSize;
-
- /*LTR settings*/
- bool bEnableLongTermReference; // 0: on, 1: off
- int iLTRRefNum;
- unsigned int iLtrMarkPeriod;
-
- /* multi-thread settings*/
- unsigned short
- iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
-
- /* Deblocking loop filter */
- int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
- int iLoopFilterAlphaC0Offset;// AlphaOffset: valid range [-6, 6], default 0
- int iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
- /*pre-processing feature*/
- bool bEnableDenoise; // denoise control
- bool bEnableBackgroundDetection;// background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
- bool bEnableAdaptiveQuant; // adaptive quantization control
- bool bEnableFrameCroppingFlag;// enable frame cropping flag: TRUE always in application
- bool bEnableSceneChangeDetect;
+ EUsageType
+ iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
+ int iInputCsp; // color space of input sequence
+
+ int iPicWidth; // width of picture in samples
+ int iPicHeight; // height of picture in samples
+ int iTargetBitrate; // target bitrate desired
+ RC_MODES iRCMode; // RC mode
+ float fMaxFrameRate; // input maximal frame rate
+
+ int iTemporalLayerNum; // layer number at temporal level
+ int iSpatialLayerNum; // layer number at spatial level
+ SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
+
+ unsigned int uiIntraPeriod; // period of Intra frame
+ int iNumRefFrame; // number of reference frame used
+ unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
+ bool bEnableSpsPpsIdAddition;
+ bool bPrefixNalAddingCtrl;
+ bool bEnableSSEI;
+ int iPaddingFlag; // 0:disable padding;1:padding
+ int iEntropyCodingModeFlag;
+
+ /* rc control */
+ bool bEnableFrameSkip; // allow skipping frames to keep the bitrate within limits
+ int iMaxBitrate; // max bitrate desired
+ int iMaxQp;
+ int iMinQp;
+ unsigned int uiMaxNalSize;
+
+ /*LTR settings*/
+ bool bEnableLongTermReference; // 0: on, 1: off
+ int iLTRRefNum;
+ unsigned int iLtrMarkPeriod;
+
+ /* multi-thread settings*/
+ unsigned short
+ iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
+
+ /* Deblocking loop filter */
+ int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
+ int iLoopFilterAlphaC0Offset;// AlphaOffset: valid range [-6, 6], default 0
+ int iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
+ /*pre-processing feature*/
+ bool bEnableDenoise; // denoise control
+ bool bEnableBackgroundDetection;// background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
+ bool bEnableAdaptiveQuant; // adaptive quantization control
+ bool bEnableFrameCroppingFlag;// enable frame cropping flag: TRUE always in application
+ bool bEnableSceneChangeDetect;
} SEncParamExt;
//Define a new struct to show the property of video bitstream.
typedef struct {
- unsigned int size; //size of the struct
- VIDEO_BITSTREAM_TYPE eVideoBsType;
+ unsigned int size; //size of the struct
+ VIDEO_BITSTREAM_TYPE eVideoBsType;
} SVideoProperty;
/* SVC Decoding Parameters, reserved here and potential applicable in the future */
typedef struct TagSVCDecodingParam {
- char* pFileNameRestructed; // File name of restructed frame used for PSNR calculation based debug
+ char* pFileNameRestructed; // File name of restructed frame used for PSNR calculation based debug
- int iOutputColorFormat; // color space format to be outputed, EVideoFormatType specified in codec_def.h
- unsigned int uiCpuLoad; // CPU load
- unsigned char uiTargetDqLayer; // Setting target dq layer id
+ int iOutputColorFormat; // color space format to be outputed, EVideoFormatType specified in codec_def.h
+ unsigned int uiCpuLoad; // CPU load
+ unsigned char uiTargetDqLayer; // Setting target dq layer id
- unsigned char uiEcActiveFlag; // Whether active error concealment feature in decoder
+ unsigned char uiEcActiveFlag; // Whether active error concealment feature in decoder
- SVideoProperty sVideoProperty;
+ SVideoProperty sVideoProperty;
} SDecodingParam, *PDecodingParam;
/* Bitstream inforamtion of a layer being encoded */
typedef struct {
- unsigned char uiTemporalId;
- unsigned char uiSpatialId;
- unsigned char uiQualityId;
+ unsigned char uiTemporalId;
+ unsigned char uiSpatialId;
+ unsigned char uiQualityId;
- unsigned char uiLayerType;
+ unsigned char uiLayerType;
- int iNalCount; // Count number of NAL coded already
- int* pNalLengthInByte; // Length of NAL size in byte from 0 to iNalCount-1
- unsigned char* pBsBuf; // Buffer of bitstream contained
+ int iNalCount; // Count number of NAL coded already
+ int* pNalLengthInByte; // Length of NAL size in byte from 0 to iNalCount-1
+ unsigned char* pBsBuf; // Buffer of bitstream contained
} SLayerBSInfo, *PLayerBSInfo;
typedef struct {
- int iTemporalId; // Temporal ID
- //The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
- //predicted from any picture on any higher layer.
- int iSubSeqId; //refer to D.2.11 Sub-sequence information SEI message semantics
+ int iTemporalId; // Temporal ID
+ //The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
+ //predicted from any picture on any higher layer.
+ int iSubSeqId; //refer to D.2.11 Sub-sequence information SEI message semantics
- int iLayerNum;
- SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
+ int iLayerNum;
+ SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
- EVideoFrameType eFrameType;
- long long uiTimeStamp;
+ EVideoFrameType eFrameType;
+ long long uiTimeStamp;
} SFrameBSInfo, *PFrameBSInfo;
typedef struct Source_Picture_s {
- int iColorFormat; // color space type
- int iStride[4]; // stride for each plane pData
- unsigned char* pData[4]; // plane pData
- int iPicWidth; // luma picture width in x coordinate
- int iPicHeight; // luma picture height in y coordinate
- long long uiTimeStamp;
+ int iColorFormat; // color space type
+ int iStride[4]; // stride for each plane pData
+ unsigned char* pData[4]; // plane pData
+ int iPicWidth; // luma picture width in x coordinate
+ int iPicHeight; // luma picture height in y coordinate
+ long long uiTimeStamp;
} SSourcePicture;
typedef struct TagBitrateInfo {
- LAYER_NUM iLayer;
- int iBitrate; //the maximum bitrate
+ LAYER_NUM iLayer;
+ int iBitrate; //the maximum bitrate
} SBitrateInfo;
typedef struct TagDumpLayer {
- int iLayer;
- char* pFileName;
+ int iLayer;
+ char* pFileName;
} SDumpLayer;
typedef struct TagProfileInfo {
- int iLayer;
- EProfileIdc uiProfileIdc; //the profile info
+ int iLayer;
+ EProfileIdc uiProfileIdc; //the profile info
} SProfileInfo;
typedef struct TagLevelInfo {
- int iLayer;
- ELevelIdc uiLevelIdc; //the level info
+ int iLayer;
+ ELevelIdc uiLevelIdc; //the level info
} SLevelInfo;
typedef struct TagDeliveryStatus {
- int iDropNum; //the number of video frames that are dropped continuously before delivery to encoder, which is used by screen content.
- int iDropFrameType; // the frame type that is dropped
- int iDropFrameSize; // the frame size that is dropped
+ int iDropNum; //the number of video frames that are dropped continuously before delivery to encoder, which is used by screen content.
+ int iDropFrameType; // the frame type that is dropped
+ int iDropFrameSize; // the frame size that is dropped
} SDeliveryStatus;
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
diff --git a/thirdparties/common/include/wels/codec_def.h b/thirdparties/common/include/wels/codec_def.h
index de3110e..dfc89cd 100755
--- a/thirdparties/common/include/wels/codec_def.h
+++ b/thirdparties/common/include/wels/codec_def.h
@@ -34,66 +34,66 @@
#define WELS_VIDEO_CODEC_DEFINITION_H__
typedef enum {
- /*rgb color formats*/
- videoFormatRGB = 1,
- videoFormatRGBA = 2,
- videoFormatRGB555 = 3,
- videoFormatRGB565 = 4,
- videoFormatBGR = 5,
- videoFormatBGRA = 6,
- videoFormatABGR = 7,
- videoFormatARGB = 8,
-
- /*yuv color formats*/
- videoFormatYUY2 = 20,
- videoFormatYVYU = 21,
- videoFormatUYVY = 22,
- videoFormatI420 = 23, //same as IYUV
- videoFormatYV12 = 24,
- videoFormatInternal = 25, // Only Used for SVC decoder testbed
-
- videoFormatNV12 = 26, // new format for output by DXVA decoding
-
- videoFormatVFlip = 0x80000000
+ /*rgb color formats*/
+ videoFormatRGB = 1,
+ videoFormatRGBA = 2,
+ videoFormatRGB555 = 3,
+ videoFormatRGB565 = 4,
+ videoFormatBGR = 5,
+ videoFormatBGRA = 6,
+ videoFormatABGR = 7,
+ videoFormatARGB = 8,
+
+ /*yuv color formats*/
+ videoFormatYUY2 = 20,
+ videoFormatYVYU = 21,
+ videoFormatUYVY = 22,
+ videoFormatI420 = 23, //same as IYUV
+ videoFormatYV12 = 24,
+ videoFormatInternal = 25, // Only Used for SVC decoder testbed
+
+ videoFormatNV12 = 26, // new format for output by DXVA decoding
+
+ videoFormatVFlip = 0x80000000
} EVideoFormatType;
typedef enum {
- videoFrameTypeInvalid, /* Encoder not ready or parameters are invalidate */
- videoFrameTypeIDR, /* This type is only available for H264 if this frame is key frame, then return this type */
- videoFrameTypeI, /* I frame type */
- videoFrameTypeP, /* P frame type */
- videoFrameTypeSkip, /* Skip the frame based encoder kernel */
- videoFrameTypeIPMixed, /* Frame type introduced I and P slices are mixing */
+ videoFrameTypeInvalid, /* Encoder not ready or parameters are invalidate */
+ videoFrameTypeIDR, /* This type is only available for H264 if this frame is key frame, then return this type */
+ videoFrameTypeI, /* I frame type */
+ videoFrameTypeP, /* P frame type */
+ videoFrameTypeSkip, /* Skip the frame based encoder kernel */
+ videoFrameTypeIPMixed, /* Frame type introduced I and P slices are mixing */
} EVideoFrameType;
typedef enum {
- cmResultSuccess,
- cmInitParaError, /*Parameters are invalid */
- cmUnkonwReason,
- cmMallocMemeError, /*Malloc a memory error*/
- cmInitExpected, /*Initial action is expected*/
- cmUnsupportedData,
+ cmResultSuccess,
+ cmInitParaError, /*Parameters are invalid */
+ cmUnkonwReason,
+ cmMallocMemeError, /*Malloc a memory error*/
+ cmInitExpected, /*Initial action is expected*/
+ cmUnsupportedData,
} CM_RETURN;
/* nal unit type */
enum ENalUnitType {
- NAL_UNKNOWN = 0,
- NAL_SLICE = 1,
- NAL_SLICE_DPA = 2,
- NAL_SLICE_DPB = 3,
- NAL_SLICE_DPC = 4,
- NAL_SLICE_IDR = 5, /* ref_idc != 0 */
- NAL_SEI = 6, /* ref_idc == 0 */
- NAL_SPS = 7,
- NAL_PPS = 8
- /* ref_idc == 0 for 6,9,10,11,12 */
+ NAL_UNKNOWN = 0,
+ NAL_SLICE = 1,
+ NAL_SLICE_DPA = 2,
+ NAL_SLICE_DPB = 3,
+ NAL_SLICE_DPC = 4,
+ NAL_SLICE_IDR = 5, /* ref_idc != 0 */
+ NAL_SEI = 6, /* ref_idc == 0 */
+ NAL_SPS = 7,
+ NAL_PPS = 8
+ /* ref_idc == 0 for 6,9,10,11,12 */
};
/* NRI: eNalRefIdc */
enum ENalPriority {
- NAL_PRIORITY_DISPOSABLE = 0,
- NAL_PRIORITY_LOW = 1,
- NAL_PRIORITY_HIGH = 2,
- NAL_PRIORITY_HIGHEST = 3,
+ NAL_PRIORITY_DISPOSABLE = 0,
+ NAL_PRIORITY_LOW = 1,
+ NAL_PRIORITY_HIGH = 2,
+ NAL_PRIORITY_HIGHEST = 3,
};
#define IS_PARAMETER_SET_NAL(eNalRefIdc, eNalType) \
@@ -108,30 +108,30 @@ enum ENalPriority {
/* Error Tools definition */
typedef unsigned short ERR_TOOL;
enum {
- ET_NONE = 0x00, // NONE Error Tools
- ET_IP_SCALE = 0x01, // IP Scalable
- ET_FMO = 0x02, // Flexible Macroblock Ordering
- ET_IR_R1 = 0x04, // Intra Refresh in predifined 2% MB
- ET_IR_R2 = 0x08, // Intra Refresh in predifined 5% MB
- ET_IR_R3 = 0x10, // Intra Refresh in predifined 10% MB
- ET_FEC_HALF = 0x20, // Forward Error Correction in 50% redundency mode
- ET_FEC_FULL = 0x40, // Forward Error Correction in 100% redundency mode
- ET_RFS = 0x80, // Reference Frame Selection
+ ET_NONE = 0x00, // NONE Error Tools
+ ET_IP_SCALE = 0x01, // IP Scalable
+ ET_FMO = 0x02, // Flexible Macroblock Ordering
+ ET_IR_R1 = 0x04, // Intra Refresh in predifined 2% MB
+ ET_IR_R2 = 0x08, // Intra Refresh in predifined 5% MB
+ ET_IR_R3 = 0x10, // Intra Refresh in predifined 10% MB
+ ET_FEC_HALF = 0x20, // Forward Error Correction in 50% redundency mode
+ ET_FEC_FULL = 0x40, // Forward Error Correction in 100% redundency mode
+ ET_RFS = 0x80, // Reference Frame Selection
};
/* information of coded Slice(=NAL)(s) */
typedef struct SliceInformation {
- unsigned char* pBufferOfSlices; // base buffer of coded slice(s)
- int iCodedSliceCount; // number of coded slices
- unsigned int* pLengthOfSlices; // array of slices length accordingly by number of slice
- int iFecType; // FEC type[0, 50%FEC, 100%FEC]
- unsigned char uiSliceIdx; // index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
- unsigned char uiSliceCount; // count number of slice in frame [FMO: 2-8; No FMO: 1]
- char iFrameIndex; // index of frame[-1, .., idr_interval-1]
- unsigned char uiNalRefIdc; // NRI, priority level of slice(NAL)
- unsigned char uiNalType; // NAL type
- unsigned char
- uiContainingFinalNal; // whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
+ unsigned char* pBufferOfSlices; // base buffer of coded slice(s)
+ int iCodedSliceCount; // number of coded slices
+ unsigned int* pLengthOfSlices; // array of slices length accordingly by number of slice
+ int iFecType; // FEC type[0, 50%FEC, 100%FEC]
+ unsigned char uiSliceIdx; // index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
+ unsigned char uiSliceCount; // count number of slice in frame [FMO: 2-8; No FMO: 1]
+ char iFrameIndex; // index of frame[-1, .., idr_interval-1]
+ unsigned char uiNalRefIdc; // NRI, priority level of slice(NAL)
+ unsigned char uiNalType; // NAL type
+ unsigned char
+ uiContainingFinalNal; // whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
} SliceInfo, *PSliceInfo;
@@ -147,44 +147,44 @@ typedef struct SliceInformation {
/* thresholds of the initial, maximal and minimal rate */
typedef struct {
- int iWidth; // frame width
- int iHeight; // frame height
- int iThresholdOfInitRate; // threshold of initial rate
- int iThresholdOfMaxRate; // threshold of maximal rate
- int iThresholdOfMinRate; // threshold of minimal rate
- int iMinThresholdFrameRate; //min frame rate min
- int iSkipFrameRate; //skip to frame rate min
- int iSkipFrameStep; //how many frames to skip
+ int iWidth; // frame width
+ int iHeight; // frame height
+ int iThresholdOfInitRate; // threshold of initial rate
+ int iThresholdOfMaxRate; // threshold of maximal rate
+ int iThresholdOfMinRate; // threshold of minimal rate
+ int iMinThresholdFrameRate; //min frame rate min
+ int iSkipFrameRate; //skip to frame rate min
+ int iSkipFrameStep; //how many frames to skip
} SRateThresholds, *PRateThresholds;
typedef struct TagSysMemBuffer {
- int iWidth; //width of decoded pic for display
- int iHeight; //height of decoded pic for display
- int iFormat; // type is "EVideoFormatType"
- int iStride[2]; //stride of 2 component
+ int iWidth; //width of decoded pic for display
+ int iHeight; //height of decoded pic for display
+ int iFormat; // type is "EVideoFormatType"
+ int iStride[2]; //stride of 2 component
} SSysMEMBuffer;
typedef struct TagBufferInfo {
- int iBufferStatus; // 0: one frame data is not ready; 1: one frame data is ready
- union {
- SSysMEMBuffer sSystemBuffer;
- } UsrData;
+ int iBufferStatus; // 0: one frame data is not ready; 1: one frame data is ready
+ union {
+ SSysMEMBuffer sSystemBuffer;
+ } UsrData;
} SBufferInfo;
/* Constants related to transmission rate at various resolutions */
static const SRateThresholds ksRateThrMap[4] = {
- // initial-maximal-minimal
- {CIF_WIDTH, CIF_HEIGHT, 225000, 384000, 96000, 3, 1, 1}, // CIF
- {QVGA_WIDTH, QVGA_HEIGHT, 192000, 320000, 80000, -1, -1, -1}, // QVGA
- {QCIF_WIDTH, QCIF_HEIGHT, 150000, 256000, 64000, 8, 4, 2}, // QCIF
- {SQCIF_WIDTH, SQCIF_HEIGHT, 120000, 192000, 48000, 5, 3, 1} // SQCIF
+ // initial-maximal-minimal
+ {CIF_WIDTH, CIF_HEIGHT, 225000, 384000, 96000, 3, 1, 1}, // CIF
+ {QVGA_WIDTH, QVGA_HEIGHT, 192000, 320000, 80000, -1, -1, -1}, // QVGA
+ {QCIF_WIDTH, QCIF_HEIGHT, 150000, 256000, 64000, 8, 4, 2}, // QCIF
+ {SQCIF_WIDTH, SQCIF_HEIGHT, 120000, 192000, 48000, 5, 3, 1} // SQCIF
};
// In a GOP, multiple of the key frame number, derived from
// the number of layers(index or array below)
static const char kiKeyNumMultiple[] = {
- 1, 1, 2, 4, 8, 16,
+ 1, 1, 2, 4, 8, 16,
};
#endif//WELS_VIDEO_CODEC_DEFINITION_H__
diff --git a/thirdparties/iphone/include/g729b/dtx.h b/thirdparties/iphone/include/g729b/dtx.h
index d0cc6ac..c8af076 100755
--- a/thirdparties/iphone/include/g729b/dtx.h
+++ b/thirdparties/iphone/include/g729b/dtx.h
@@ -13,36 +13,36 @@
/* Encoder DTX/CNG functions */
void Init_Cod_cng(void);
void Cod_cng(
- Word16 *exc, /* (i/o) : excitation array */
- Word16 pastVad, /* (i) : previous VAD decision */
- Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
- Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
- Word16 *ana, /* (o) : coded SID parameters */
- Word16 freq_prev[MA_NP][M],
- /* (i/o) : previous LPS for quantization */
- Word16 *seed /* (i/o) : random generator seed */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 pastVad, /* (i) : previous VAD decision */
+ Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
+ Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
+ Word16 *ana, /* (o) : coded SID parameters */
+ Word16 freq_prev[MA_NP][M],
+ /* (i/o) : previous LPS for quantization */
+ Word16 *seed /* (i/o) : random generator seed */
);
void Update_cng(
- Word16 *r_h, /* (i) : MSB of frame autocorrelation */
- Word16 exp_r, /* (i) : scaling factor associated */
- Word16 Vad /* (i) : current Vad decision */
+ Word16 *r_h, /* (i) : MSB of frame autocorrelation */
+ Word16 exp_r, /* (i) : scaling factor associated */
+ Word16 Vad /* (i) : current Vad decision */
);
/* SID gain Quantization */
void Qua_Sidgain(
- Word16 *ener, /* (i) array of energies */
- Word16 *sh_ener, /* (i) corresponding scaling factors */
- Word16 nb_ener, /* (i) number of energies or */
- Word16 *enerq, /* (o) decoded energies in dB */
- Word16 *idx /* (o) SID gain quantization index */
+ Word16 *ener, /* (i) array of energies */
+ Word16 *sh_ener, /* (i) corresponding scaling factors */
+ Word16 nb_ener, /* (i) number of energies or */
+ Word16 *enerq, /* (o) decoded energies in dB */
+ Word16 *idx /* (o) SID gain quantization index */
);
/* CNG excitation generation */
void Calc_exc_rand(
- Word16 cur_gain, /* (i) : target sample gain */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *seed, /* (i) : current Vad decision */
- Flag flag_cod /* (i) : encoder/decoder flag */
+ Word16 cur_gain, /* (i) : target sample gain */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *seed, /* (i) : current Vad decision */
+ Flag flag_cod /* (i) : encoder/decoder flag */
);
/* SID LSP Quantization */
@@ -54,16 +54,16 @@ void Update_decfreq_prev(Word16 x[MA_NP][M]);
/* Decoder CNG generation */
void Init_Dec_cng(void);
void Dec_cng(
- Word16 past_ftyp, /* (i) : past frame type */
- Word16 sid_sav, /* (i) : energy to recover SID gain */
- Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
- Word16 *parm, /* (i) : coded SID parameters */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *lsp_old, /* (i/o) : previous lsp */
- Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
- Word16 *seed, /* (i/o) : random generator seed */
- Word16 freq_prev[MA_NP][M]
- /* (i/o) : previous LPS for quantization */
+ Word16 past_ftyp, /* (i) : past frame type */
+ Word16 sid_sav, /* (i) : energy to recover SID gain */
+ Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
+ Word16 *parm, /* (i) : coded SID parameters */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *lsp_old, /* (i/o) : previous lsp */
+ Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
+ Word16 *seed, /* (i/o) : random generator seed */
+ Word16 freq_prev[MA_NP][M]
+ /* (i/o) : previous LPS for quantization */
);
Word16 read_frame(FILE *f_serial, Word16 *parm);
@@ -92,7 +92,7 @@ Word16 read_frame(FILE *f_serial, Word16 *parm);
#define RATE_0 0 /* 0 bit/s rate */
/* CNG excitation generation constant */
- /* alpha = 0.5 */
+/* alpha = 0.5 */
#define FRAC1 19043 /* (sqrt(40)xalpha/2 - 1) * 32768 */
#define K0 24576 /* (1 - alpha ** 2) in Q15 */
#define G_MAX 5000
diff --git a/thirdparties/iphone/include/g729b/ld8a.h b/thirdparties/iphone/include/g729b/ld8a.h
index 0f95011..7a847b8 100755
--- a/thirdparties/iphone/include/g729b/ld8a.h
+++ b/thirdparties/iphone/include/g729b/ld8a.h
@@ -43,18 +43,18 @@
*-------------------------------*/
Word32 Inv_sqrt( /* (o) Q30 : output value (range: 0<=val<1) */
- Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
+ Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
);
void Log2(
- Word32 L_x, /* (i) Q0 : input value */
- Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
- Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
+ Word32 L_x, /* (i) Q0 : input value */
+ Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
+ Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
);
Word32 Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffffff) */
- Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
- Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
+ Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
+ Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
);
/*-------------------------------*
@@ -65,13 +65,13 @@ void Init_Pre_Process(void);
void Init_Post_Process(void);
void Pre_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
void Post_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
/*----------------------------------*
@@ -81,20 +81,20 @@ void Post_Process(
void Init_Coder_ld8a(void);
void Coder_ld8a(
- Word16 ana[], /* output : Analysis parameters */
- Word16 frame,
- Word16 vad_enable
+ Word16 ana[], /* output : Analysis parameters */
+ Word16 frame,
+ Word16 vad_enable
);
void Init_Decod_ld8a(void);
void Decod_ld8a(
- Word16 parm[], /* (i) : vector of synthesis parameters
+ Word16 parm[], /* (i) : vector of synthesis parameters
parm[0] = bad frame indicator (bfi) */
- Word16 synth[], /* (o) : synthesis speech */
- Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
- Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
- Word16 *Vad /* (o) : VAD */
+ Word16 synth[], /* (o) : synthesis speech */
+ Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
+ Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
+ Word16 *Vad /* (o) : VAD */
);
/*-------------------------------*
@@ -102,84 +102,84 @@ void Decod_ld8a(
*-------------------------------*/
void Autocorr(
- Word16 x[], /* (i) : Input signal */
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (o) : Autocorrelations (msb) */
- Word16 r_l[], /* (o) : Autocorrelations (lsb) */
- Word16 *exp_R0
+ Word16 x[], /* (i) : Input signal */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (o) : Autocorrelations (msb) */
+ Word16 r_l[], /* (o) : Autocorrelations (lsb) */
+ Word16 *exp_R0
);
void Lag_window(
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
- Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
+ Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
);
void Levinson(
- Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
- Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
- Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
- Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
- Word16 *Err /* (o) : Residual energy */
+ Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
+ Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
+ Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
+ Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
+ Word16 *Err /* (o) : Residual energy */
);
void Az_lsp(
- Word16 a[], /* (i) Q12 : predictor coefficients */
- Word16 lsp[], /* (o) Q15 : line spectral pairs */
- Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
+ Word16 a[], /* (i) Q12 : predictor coefficients */
+ Word16 lsp[], /* (o) Q15 : line spectral pairs */
+ Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
);
void Lsp_Az(
- Word16 lsp[], /* (i) Q15 : line spectral frequencies */
- Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
+ Word16 lsp[], /* (i) Q15 : line spectral frequencies */
+ Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
);
void Lsf_lsp(
- Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 m /* (i) : LPC order */
);
void Int_qlpc(
- Word16 lsp_old[], /* input : LSP vector of past frame */
- Word16 lsp_new[], /* input : LSP vector of present frame */
- Word16 Az[] /* output: interpolated Az() for the 2 subframes */
+ Word16 lsp_old[], /* input : LSP vector of past frame */
+ Word16 lsp_new[], /* input : LSP vector of present frame */
+ Word16 Az[] /* output: interpolated Az() for the 2 subframes */
);
void Weight_Az(
- Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
- Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
- Word16 m, /* (i) : LPC order. */
- Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
+ Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
+ Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
+ Word16 m, /* (i) : LPC order. */
+ Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
);
void Residu(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
- Word16 y[], /* (o) : residual signal */
- Word16 lg /* (i) : size of filtering */
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
+ Word16 y[], /* (o) : residual signal */
+ Word16 lg /* (i) : size of filtering */
);
void Syn_filt(
- Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
- Word16 x[], /* (i) : input signal */
- Word16 y[], /* (o) : output signal */
- Word16 lg, /* (i) : size of filtering */
- Word16 mem[], /* (i/o) : memory associated with this filtering. */
- Word16 update /* (i) : 0=no update, 1=update of memory. */
+ Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
+ Word16 x[], /* (i) : input signal */
+ Word16 y[], /* (o) : output signal */
+ Word16 lg, /* (i) : size of filtering */
+ Word16 mem[], /* (i/o) : memory associated with this filtering. */
+ Word16 update /* (i) : 0=no update, 1=update of memory. */
);
void Convolve(
- Word16 x[], /* (i) : input vector */
- Word16 h[], /* (i) Q12 : impulse response */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector size */
+ Word16 x[], /* (i) : input vector */
+ Word16 h[], /* (i) Q12 : impulse response */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector size */
);
/*--------------------------------------------------------------------------*
@@ -195,75 +195,75 @@ void Convolve(
*-----------------------*/
Word16 Pitch_ol_fast( /* output: open loop pitch lag */
- Word16 signal[], /* input : signal used to compute the open loop pitch */
- /* signal[-pit_max] to signal[-1] should be known */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 L_frame /* input : length of frame to compute pitch */
+ Word16 signal[], /* input : signal used to compute the open loop pitch */
+ /* signal[-pit_max] to signal[-1] should be known */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 L_frame /* input : length of frame to compute pitch */
);
Word16 Pitch_fr3_fast(/* (o) : pitch period. */
- Word16 exc[], /* (i) : excitation buffer */
- Word16 xn[], /* (i) : target vector */
- Word16 h[], /* (i) Q12 : impulse response of filters. */
- Word16 L_subfr, /* (i) : Length of subframe */
- Word16 t0_min, /* (i) : minimum value in the searched range. */
- Word16 t0_max, /* (i) : maximum value in the searched range. */
- Word16 i_subfr, /* (i) : indicator for first subframe. */
- Word16 *pit_frac /* (o) : chosen fraction. */
+ Word16 exc[], /* (i) : excitation buffer */
+ Word16 xn[], /* (i) : target vector */
+ Word16 h[], /* (i) Q12 : impulse response of filters. */
+ Word16 L_subfr, /* (i) : Length of subframe */
+ Word16 t0_min, /* (i) : minimum value in the searched range. */
+ Word16 t0_max, /* (i) : maximum value in the searched range. */
+ Word16 i_subfr, /* (i) : indicator for first subframe. */
+ Word16 *pit_frac /* (o) : chosen fraction. */
);
Word16 G_pitch( /* (o) Q14 : Gain of pitch lag saturated to 1.2 */
- Word16 xn[], /* (i) : Pitch target. */
- Word16 y1[], /* (i) : Filtered adaptive codebook. */
- Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
- Word16 L_subfr /* (i) : Length of subframe. */
+ Word16 xn[], /* (i) : Pitch target. */
+ Word16 y1[], /* (i) : Filtered adaptive codebook. */
+ Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
+ Word16 L_subfr /* (i) : Length of subframe. */
);
Word16 Enc_lag3( /* output: Return index of encoding */
- Word16 T0, /* input : Pitch delay */
- Word16 T0_frac, /* input : Fractional pitch delay */
- Word16 *T0_min, /* in/out: Minimum search delay */
- Word16 *T0_max, /* in/out: Maximum search delay */
- Word16 pit_min, /* input : Minimum pitch delay */
- Word16 pit_max, /* input : Maximum pitch delay */
- Word16 pit_flag /* input : Flag for 1st subframe */
+ Word16 T0, /* input : Pitch delay */
+ Word16 T0_frac, /* input : Fractional pitch delay */
+ Word16 *T0_min, /* in/out: Minimum search delay */
+ Word16 *T0_max, /* in/out: Maximum search delay */
+ Word16 pit_min, /* input : Minimum pitch delay */
+ Word16 pit_max, /* input : Maximum pitch delay */
+ Word16 pit_flag /* input : Flag for 1st subframe */
);
void Dec_lag3( /* output: return integer pitch lag */
- Word16 index, /* input : received pitch index */
- Word16 pit_min, /* input : minimum pitch lag */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 i_subfr, /* input : subframe flag */
- Word16 *T0, /* output: integer part of pitch lag */
- Word16 *T0_frac /* output: fractional part of pitch lag */
+ Word16 index, /* input : received pitch index */
+ Word16 pit_min, /* input : minimum pitch lag */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 i_subfr, /* input : subframe flag */
+ Word16 *T0, /* output: integer part of pitch lag */
+ Word16 *T0_frac /* output: fractional part of pitch lag */
);
Word16 Interpol_3( /* (o) : interpolated value */
- Word16 *x, /* (i) : input vector */
- Word16 frac /* (i) : fraction */
+ Word16 *x, /* (i) : input vector */
+ Word16 frac /* (i) : fraction */
);
void Pred_lt_3(
- Word16 exc[], /* in/out: excitation buffer */
- Word16 T0, /* input : integer pitch lag */
- Word16 frac, /* input : fraction of lag */
- Word16 L_subfr /* input : subframe size */
+ Word16 exc[], /* in/out: excitation buffer */
+ Word16 T0, /* input : integer pitch lag */
+ Word16 frac, /* input : fraction of lag */
+ Word16 L_subfr /* input : subframe size */
);
Word16 Parity_Pitch( /* output: parity bit (XOR of 6 MSB bits) */
- Word16 pitch_index /* input : index for which parity to compute */
+ Word16 pitch_index /* input : index for which parity to compute */
);
Word16 Check_Parity_Pitch( /* output: 0 = no error, 1= error */
- Word16 pitch_index, /* input : index of parameter */
- Word16 parity /* input : parity bit */
+ Word16 pitch_index, /* input : index of parameter */
+ Word16 parity /* input : parity bit */
);
void Cor_h_X(
- Word16 h[], /* (i) Q12 :Impulse response of filters */
- Word16 X[], /* (i) :Target vector */
- Word16 D[] /* (o) :Correlations between h[] and D[] */
- /* Normalized to 13 bits */
+ Word16 h[], /* (i) Q12 :Impulse response of filters */
+ Word16 X[], /* (i) :Target vector */
+ Word16 D[] /* (o) :Correlations between h[] and D[] */
+ /* Normalized to 13 bits */
);
/*-----------------------*
@@ -284,19 +284,19 @@ void Cor_h_X(
#define _1_16 (Word16)( 2048)
Word16 ACELP_Code_A( /* (o) :index of pulses positions */
- Word16 x[], /* (i) :Target vector */
- Word16 h[], /* (i) Q12 :Inpulse response of filters */
- Word16 T0, /* (i) :Pitch lag */
- Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
- Word16 code[], /* (o) Q13 :Innovative codebook */
- Word16 y[], /* (o) Q12 :Filtered innovative codebook */
- Word16 *sign /* (o) :Signs of 4 pulses */
+ Word16 x[], /* (i) :Target vector */
+ Word16 h[], /* (i) Q12 :Inpulse response of filters */
+ Word16 T0, /* (i) :Pitch lag */
+ Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
+ Word16 code[], /* (o) Q13 :Innovative codebook */
+ Word16 y[], /* (o) Q12 :Filtered innovative codebook */
+ Word16 *sign /* (o) :Signs of 4 pulses */
);
void Decod_ACELP(
- Word16 sign, /* (i) : signs of 4 pulses. */
- Word16 index, /* (i) : Positions of the 4 pulses. */
- Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
+ Word16 sign, /* (i) : signs of 4 pulses. */
+ Word16 index, /* (i) : Positions of the 4 pulses. */
+ Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
);
/*--------------------------------------------------------------------------*
* LSP constant parameters *
@@ -328,152 +328,152 @@ void Decod_ACELP(
*-------------------------------*/
void Lsf_lsp2(
- Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf2(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 m /* (i) : LPC order */
);
void Qua_lsp(
- Word16 lsp[], /* (i) Q15 : Unquantized LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
- Word16 ana[] /* (o) : indexes */
+ Word16 lsp[], /* (i) Q15 : Unquantized LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
+ Word16 ana[] /* (o) : indexes */
);
void Get_wegt(
- Word16 flsp[], /* Q13 */
- Word16 wegt[] /* Q11 -> normalized */
+ Word16 flsp[], /* Q13 */
+ Word16 wegt[] /* Q11 -> normalized */
);
void Lsp_encw_reset(
- void
+ void
);
void Lsp_qua_cs(
- Word16 flsp_in[M], /* Q13 */
- Word16 lspq_out[M], /* Q13 */
- Word16 *code
+ Word16 flsp_in[M], /* Q13 */
+ Word16 lspq_out[M], /* Q13 */
+ Word16 *code
);
void Lsp_expand_1(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_1_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_get_quant(
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 code0,
- Word16 code1,
- Word16 code2,
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 lspq[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 code0,
+ Word16 code1,
+ Word16 code2,
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 lspq[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_get_tdist(
- Word16 wegt[], /* normalized */
- Word16 buf[], /* Q13 */
- Word32 *L_tdist, /* Q27 */
- Word16 rbuf[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 wegt[], /* normalized */
+ Word16 buf[], /* Q13 */
+ Word32 *L_tdist, /* Q27 */
+ Word16 rbuf[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_last_select(
- Word32 L_tdist[], /* Q27 */
- Word16 *mode_index
+ Word32 L_tdist[], /* Q27 */
+ Word16 *mode_index
);
void Lsp_pre_select(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 *cand
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 *cand
);
void Lsp_select_1(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_select_2(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_stability(
- Word16 buf[] /* Q13 */
+ Word16 buf[] /* Q13 */
);
void Relspwed(
- Word16 lsp[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspq[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 fg[MODE][MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum[MODE][M], /* Q15 */
- Word16 fg_sum_inv[MODE][M], /* Q12 */
- Word16 code_ana[]
+ Word16 lsp[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspq[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 fg[MODE][MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum[MODE][M], /* Q15 */
+ Word16 fg_sum_inv[MODE][M], /* Q12 */
+ Word16 code_ana[]
);
void D_lsp(
- Word16 prm[], /* (i) : indexes of the selected LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
- Word16 erase /* (i) : frame erase information */
+ Word16 prm[], /* (i) : indexes of the selected LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
+ Word16 erase /* (i) : frame erase information */
);
void Lsp_decw_reset(
- void
+ void
);
void Lsp_iqua_cs(
- Word16 prm[], /* input : codes of the selected LSP*/
- Word16 lsp_q[], /* output: Quantized LSP parameters*/
- Word16 erase /* input : frame erase information */
+ Word16 prm[], /* input : codes of the selected LSP*/
+ Word16 lsp_q[], /* output: Quantized LSP parameters*/
+ Word16 erase /* input : frame erase information */
);
void Lsp_prev_compose(
- Word16 lsp_ele[], /* Q13 */
- Word16 lsp[], /* Q13 */
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lsp_ele[], /* Q13 */
+ Word16 lsp[], /* Q13 */
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_prev_extract(
- Word16 lsp[M], /* Q13 */
- Word16 lsp_ele[M], /* Q13 */
- Word16 fg[MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum_inv[M] /* Q12 */
+ Word16 lsp[M], /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 fg[MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum_inv[M] /* Q12 */
);
void Lsp_prev_update(
- Word16 lsp_ele[M], /* Q13 */
- Word16 freq_prev[MA_NP][M] /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 freq_prev[MA_NP][M] /* Q13 */
);
/*-------------------------------*
@@ -493,48 +493,48 @@ void Lsp_prev_update(
*--------------------------------------------------------------------------*/
Word16 Qua_gain(
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
- /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
- Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod, /* (o) Q1 : Code gain. */
- Word16 tameflag /* (i) : flag set to 1 if taming is needed */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
+ /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
+ Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod, /* (o) Q1 : Code gain. */
+ Word16 tameflag /* (i) : flag set to 1 if taming is needed */
);
void Dec_gain(
- Word16 index, /* (i) : Index of quantization. */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 bfi, /* (i) : Bad frame indicator */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod /* (o) Q1 : Code gain. */
+ Word16 index, /* (i) : Index of quantization. */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 bfi, /* (i) : Bad frame indicator */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod /* (o) Q1 : Code gain. */
);
void Gain_predict(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
- Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
+ Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
);
void Gain_update(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
);
void Gain_update_erasure(
- Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
+ Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
);
void Corr_xy2(
- Word16 xn[], /* (i) Q0 :Target vector. */
- Word16 y1[], /* (i) Q0 :Adaptive codebook. */
- Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
- Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
- Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
+ Word16 xn[], /* (i) Q0 :Target vector. */
+ Word16 y1[], /* (i) Q0 :Adaptive codebook. */
+ Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
+ Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
+ Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
);
/*-----------------------*
@@ -570,31 +570,31 @@ void bits2prm_ld8k(Word16 bits[], Word16 prm[]);
void Init_Post_Filter(void);
void Post_Filter(
- Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
- Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
- Word16 *T, /* input : decoded pitch lags in all subframes */
- Word16 Vad
+ Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
+ Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
+ Word16 *T, /* input : decoded pitch lags in all subframes */
+ Word16 Vad
);
void pit_pst_filt(
- Word16 *signal, /* (i) : input signal */
- Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
- Word16 t0_min, /* (i) : minimum value in the searched range */
- Word16 t0_max, /* (i) : maximum value in the searched range */
- Word16 L_subfr, /* (i) : size of filtering */
- Word16 *signal_pst /* (o) : harmonically postfiltered signal */
+ Word16 *signal, /* (i) : input signal */
+ Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
+ Word16 t0_min, /* (i) : minimum value in the searched range */
+ Word16 t0_max, /* (i) : maximum value in the searched range */
+ Word16 L_subfr, /* (i) : size of filtering */
+ Word16 *signal_pst /* (o) : harmonically postfiltered signal */
);
void preemphasis(
- Word16 *signal, /* (i/o) : input signal overwritten by the output */
- Word16 g, /* (i) Q15 : preemphasis coefficient */
- Word16 L /* (i) : size of filtering */
+ Word16 *signal, /* (i/o) : input signal overwritten by the output */
+ Word16 g, /* (i) Q15 : preemphasis coefficient */
+ Word16 L /* (i) : size of filtering */
);
void agc(
- Word16 *sig_in, /* (i) : postfilter input signal */
- Word16 *sig_out, /* (i/o) : postfilter output signal */
- Word16 l_trm /* (i) : subframe size */
+ Word16 *sig_in, /* (i) : postfilter input signal */
+ Word16 *sig_out, /* (i/o) : postfilter output signal */
+ Word16 l_trm /* (i) : subframe size */
);
/*--------------------------------------------------------------------------*
@@ -615,14 +615,14 @@ Word16 test_err(Word16 t0, Word16 t0_frac);
*--------------------------------------------------------------------------*/
void Copy(
- Word16 x[], /* (i) : input vector */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector length */
+ Word16 x[], /* (i) : input vector */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector length */
);
void Set_zero(
- Word16 x[], /* (o) : vector to clear */
- Word16 L /* (i) : length of vector */
+ Word16 x[], /* (o) : vector to clear */
+ Word16 L /* (i) : length of vector */
);
Word16 Random(Word16 *seed);
diff --git a/thirdparties/iphone/include/g729b/octet.h b/thirdparties/iphone/include/g729b/octet.h
index e75827a..61adecb 100755
--- a/thirdparties/iphone/include/g729b/octet.h
+++ b/thirdparties/iphone/include/g729b/octet.h
@@ -7,8 +7,8 @@
*/
/* Definition for Octet Transmission mode */
-/* When Annex B is used for transmission systems that operate on octet boundary,
- an extra bit (with value zero) will be packed at the end of a SID bit stream.
+/* When Annex B is used for transmission systems that operate on octet boundary,
+ an extra bit (with value zero) will be packed at the end of a SID bit stream.
This will change the number of bits in a SID bit stream from 15 bits to
16 bits (i.e., 2 bytes).
*/
diff --git a/thirdparties/iphone/include/g729b/sid.h b/thirdparties/iphone/include/g729b/sid.h
index 3aae1eb..a9b539b 100755
--- a/thirdparties/iphone/include/g729b/sid.h
+++ b/thirdparties/iphone/include/g729b/sid.h
@@ -14,8 +14,8 @@
void Init_lsfq_noise(void);
void lsfq_noise(Word16 *lsp_new, Word16 *lspq,
Word16 freq_prev[MA_NP][M], Word16 *idx);
-void sid_lsfq_decode(Word16 *index, Word16 *lspq,
- Word16 freq_prev[MA_NP][M]);
+void sid_lsfq_decode(Word16 *index, Word16 *lspq,
+ Word16 freq_prev[MA_NP][M]);
diff --git a/thirdparties/iphone/include/g729b/tab_ld8a.h b/thirdparties/iphone/include/g729b/tab_ld8a.h
index 0cb1b3e..08410d9 100755
--- a/thirdparties/iphone/include/g729b/tab_ld8a.h
+++ b/thirdparties/iphone/include/g729b/tab_ld8a.h
@@ -40,7 +40,7 @@ extern Word16 a100[3];
extern Word16 b140[3];
extern Word16 a140[3];
extern Word16 bitsno[PRM_SIZE];
-extern Word16 bitsno2[4];
+extern Word16 bitsno2[4];
extern Word16 tabpow[33];
extern Word16 tablog[33];
extern Word16 tabsqr[49];
diff --git a/thirdparties/iphone/include/g729b/vad.h b/thirdparties/iphone/include/g729b/vad.h
index fb7a67e..d455071 100755
--- a/thirdparties/iphone/include/g729b/vad.h
+++ b/thirdparties/iphone/include/g729b/vad.h
@@ -17,14 +17,14 @@
void vad_init(void);
void vad(
- Word16 rc,
- Word16 *lsf,
- Word16 *r_h,
- Word16 *r_l,
- Word16 exp_R0,
- Word16 *sigpp,
- Word16 frm_count,
- Word16 prev_marker,
- Word16 pprev_marker,
- Word16 *marker);
+ Word16 rc,
+ Word16 *lsf,
+ Word16 *r_h,
+ Word16 *r_l,
+ Word16 exp_R0,
+ Word16 *sigpp,
+ Word16 frm_count,
+ Word16 prev_marker,
+ Word16 pprev_marker,
+ Word16 *marker);
diff --git a/thirdparties/iphone/include/gsm.h b/thirdparties/iphone/include/gsm.h
index 4714ab6..5df6c99 100755
--- a/thirdparties/iphone/include/gsm.h
+++ b/thirdparties/iphone/include/gsm.h
@@ -55,7 +55,7 @@ typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */
#define GSM_OPT_FRAME_CHAIN 6
extern gsm gsm_create GSM_P((void));
-extern void gsm_destroy GSM_P((gsm));
+extern void gsm_destroy GSM_P((gsm));
extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *));
extern int gsm_option GSM_P((gsm, int, int *));
diff --git a/thirdparties/iphone/include/libavcodec/avcodec.h b/thirdparties/iphone/include/libavcodec/avcodec.h
index dc317dc..020f29f 100755
--- a/thirdparties/iphone/include/libavcodec/avcodec.h
+++ b/thirdparties/iphone/include/libavcodec/avcodec.h
@@ -559,7 +559,7 @@ enum Motion_Est_ID {
/**
* @ingroup lavc_decoding
*/
-enum AVDiscard{
+enum AVDiscard {
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
AVDISCARD_NONE =-16, ///< discard nothing
@@ -570,7 +570,7 @@ enum AVDiscard{
AVDISCARD_ALL = 48, ///< discard all
};
-enum AVColorPrimaries{
+enum AVColorPrimaries {
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_BT470M = 4,
@@ -581,7 +581,7 @@ enum AVColorPrimaries{
AVCOL_PRI_NB , ///< Not part of ABI
};
-enum AVColorTransferCharacteristic{
+enum AVColorTransferCharacteristic {
AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361
AVCOL_TRC_UNSPECIFIED = 2,
AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@@ -590,7 +590,7 @@ enum AVColorTransferCharacteristic{
AVCOL_TRC_NB , ///< Not part of ABI
};
-enum AVColorSpace{
+enum AVColorSpace {
AVCOL_SPC_RGB = 0,
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVCOL_SPC_UNSPECIFIED = 2,
@@ -603,7 +603,7 @@ enum AVColorSpace{
};
#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
-enum AVColorRange{
+enum AVColorRange {
AVCOL_RANGE_UNSPECIFIED = 0,
AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
@@ -615,7 +615,7 @@ enum AVColorRange{
* 1 2 1-6 are possible chroma positions
* X X 5 6 X 0 is undefined/unknown position
*/
-enum AVChromaLocation{
+enum AVChromaLocation {
AVCHROMA_LOC_UNSPECIFIED = 0,
AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default
AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263
@@ -642,7 +642,7 @@ enum AVAudioServiceType {
/**
* @ingroup lavc_encoding
*/
-typedef struct RcOverride{
+typedef struct RcOverride {
int start_frame;
int end_frame;
int qscale; // If this is 0 then quality_factor will be used instead.
@@ -832,7 +832,7 @@ typedef struct RcOverride{
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
*/
-typedef struct AVPanScan{
+typedef struct AVPanScan {
/**
* id
* - encoding: Set by user.
@@ -854,7 +854,7 @@ typedef struct AVPanScan{
* - decoding: Set by libavcodec.
*/
int16_t position[3][2];
-}AVPanScan;
+} AVPanScan;
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
@@ -1826,7 +1826,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int prediction_method;
+ int prediction_method;
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
@@ -2585,11 +2585,11 @@ typedef struct AVCodecContext {
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
int rtp_payload_size; /* The size of the RTP payload: the coder will */
- /* do its best to deliver a chunk with size */
- /* below rtp_payload_size, the chunk will start */
- /* with a start code on some codecs like H.263. */
- /* This doesn't take account of any particular */
- /* headers inside the transmitted RTP payload. */
+ /* do its best to deliver a chunk with size */
+ /* below rtp_payload_size, the chunk will start */
+ /* with a start code on some codecs like H.263. */
+ /* This doesn't take account of any particular */
+ /* headers inside the transmitted RTP payload. */
/* statistics, used for 2-pass encoding */
int mv_bits;
@@ -2816,7 +2816,7 @@ typedef struct AVCodecContext {
* - encoding: Set by libavcodec.
* - decoding: Set by user.
*/
- int bits_per_coded_sample;
+ int bits_per_coded_sample;
/**
* Bits per sample/pixel of internal libavcodec pixel/sample format.
@@ -2830,7 +2830,7 @@ typedef struct AVCodecContext {
* - encoding: unused
* - decoding: Set by user.
*/
- int lowres;
+ int lowres;
/**
* the picture in the bitstream
@@ -2920,14 +2920,14 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int nsse_weight;
+ int nsse_weight;
/**
* profile
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int profile;
+ int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100
@@ -2997,7 +2997,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int level;
+ int level;
#define FF_LEVEL_UNKNOWN -99
/**
@@ -3851,8 +3851,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
* used or zero if no frame data was decompressed (used) from the input AVPacket.
*/
attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt);
+ int *frame_size_ptr,
+ AVPacket *avpkt);
#endif
/**
@@ -3933,8 +3933,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- const AVPacket *avpkt);
+ int *got_picture_ptr,
+ const AVPacket *avpkt);
/**
* Decode a subtitle message.
@@ -3953,8 +3953,8 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr,
+ AVPacket *avpkt);
/**
* @defgroup lavc_parsing Frame parsing
@@ -4208,8 +4208,8 @@ AVCodec *avcodec_find_encoder_by_name(const char *name);
* of bytes used to encode the data read from the input buffer.
*/
int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples);
+ uint8_t *buf, int buf_size,
+ const short *samples);
#endif
/**
@@ -4481,7 +4481,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
* Pad image.
*/
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
+ int padtop, int padbottom, int padleft, int padright, int *color);
/**
* @}
@@ -4569,7 +4569,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
*/
attribute_deprecated
enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */
/**
@@ -4590,8 +4590,8 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
* @return The best pixel format to convert to or -1 if none was found.
*/
enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list,
- enum PixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum PixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
/**
* Find the best pixel format to convert to given a certain source pixel
@@ -4624,16 +4624,16 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* @return The best pixel format to convert to or -1 if none was found.
*/
enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
- enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
attribute_deprecated
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
- enum PixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum PixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
#else
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
- enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
#endif
@@ -4850,10 +4850,10 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
* Lock operation used by lockmgr
*/
enum AVLockOp {
- AV_LOCK_CREATE, ///< Create a mutex
- AV_LOCK_OBTAIN, ///< Lock the mutex
- AV_LOCK_RELEASE, ///< Unlock the mutex
- AV_LOCK_DESTROY, ///< Free mutex resources
+ AV_LOCK_CREATE, ///< Create a mutex
+ AV_LOCK_OBTAIN, ///< Lock the mutex
+ AV_LOCK_RELEASE, ///< Unlock the mutex
+ AV_LOCK_DESTROY, ///< Free mutex resources
};
/**
diff --git a/thirdparties/iphone/include/libavcodec/old_codec_ids.h b/thirdparties/iphone/include/libavcodec/old_codec_ids.h
index ded4cc7..e0d3d7e 100755
--- a/thirdparties/iphone/include/libavcodec/old_codec_ids.h
+++ b/thirdparties/iphone/include/libavcodec/old_codec_ids.h
@@ -29,370 +29,370 @@
* Do not add new items to this list. Use the AVCodecID enum instead.
*/
- CODEC_ID_NONE = AV_CODEC_ID_NONE,
+CODEC_ID_NONE = AV_CODEC_ID_NONE,
- /* video codecs */
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
- CODEC_ID_MPEG2VIDEO_XVMC,
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_SNOW,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_DXA,
- CODEC_ID_DNXHD,
- CODEC_ID_THP,
- CODEC_ID_SGI,
- CODEC_ID_C93,
- CODEC_ID_BETHSOFTVID,
- CODEC_ID_PTX,
- CODEC_ID_TXD,
- CODEC_ID_VP6A,
- CODEC_ID_AMV,
- CODEC_ID_VB,
- CODEC_ID_PCX,
- CODEC_ID_SUNRAST,
- CODEC_ID_INDEO4,
- CODEC_ID_INDEO5,
- CODEC_ID_MIMIC,
- CODEC_ID_RL2,
- CODEC_ID_ESCAPE124,
- CODEC_ID_DIRAC,
- CODEC_ID_BFI,
- CODEC_ID_CMV,
- CODEC_ID_MOTIONPIXELS,
- CODEC_ID_TGV,
- CODEC_ID_TGQ,
- CODEC_ID_TQI,
- CODEC_ID_AURA,
- CODEC_ID_AURA2,
- CODEC_ID_V210X,
- CODEC_ID_TMV,
- CODEC_ID_V210,
- CODEC_ID_DPX,
- CODEC_ID_MAD,
- CODEC_ID_FRWU,
- CODEC_ID_FLASHSV2,
- CODEC_ID_CDGRAPHICS,
- CODEC_ID_R210,
- CODEC_ID_ANM,
- CODEC_ID_BINKVIDEO,
- CODEC_ID_IFF_ILBM,
- CODEC_ID_IFF_BYTERUN1,
- CODEC_ID_KGV1,
- CODEC_ID_YOP,
- CODEC_ID_VP8,
- CODEC_ID_PICTOR,
- CODEC_ID_ANSI,
- CODEC_ID_A64_MULTI,
- CODEC_ID_A64_MULTI5,
- CODEC_ID_R10K,
- CODEC_ID_MXPEG,
- CODEC_ID_LAGARITH,
- CODEC_ID_PRORES,
- CODEC_ID_JV,
- CODEC_ID_DFA,
- CODEC_ID_WMV3IMAGE,
- CODEC_ID_VC1IMAGE,
- CODEC_ID_UTVIDEO,
- CODEC_ID_BMV_VIDEO,
- CODEC_ID_VBLE,
- CODEC_ID_DXTORY,
- CODEC_ID_V410,
- CODEC_ID_XWD,
- CODEC_ID_CDXL,
- CODEC_ID_XBM,
- CODEC_ID_ZEROCODEC,
- CODEC_ID_MSS1,
- CODEC_ID_MSA1,
- CODEC_ID_TSCC2,
- CODEC_ID_MTS2,
- CODEC_ID_CLLC,
- CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
+/* video codecs */
+CODEC_ID_MPEG1VIDEO,
+CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+CODEC_ID_MPEG2VIDEO_XVMC,
+CODEC_ID_H261,
+CODEC_ID_H263,
+CODEC_ID_RV10,
+CODEC_ID_RV20,
+CODEC_ID_MJPEG,
+CODEC_ID_MJPEGB,
+CODEC_ID_LJPEG,
+CODEC_ID_SP5X,
+CODEC_ID_JPEGLS,
+CODEC_ID_MPEG4,
+CODEC_ID_RAWVIDEO,
+CODEC_ID_MSMPEG4V1,
+CODEC_ID_MSMPEG4V2,
+CODEC_ID_MSMPEG4V3,
+CODEC_ID_WMV1,
+CODEC_ID_WMV2,
+CODEC_ID_H263P,
+CODEC_ID_H263I,
+CODEC_ID_FLV1,
+CODEC_ID_SVQ1,
+CODEC_ID_SVQ3,
+CODEC_ID_DVVIDEO,
+CODEC_ID_HUFFYUV,
+CODEC_ID_CYUV,
+CODEC_ID_H264,
+CODEC_ID_INDEO3,
+CODEC_ID_VP3,
+CODEC_ID_THEORA,
+CODEC_ID_ASV1,
+CODEC_ID_ASV2,
+CODEC_ID_FFV1,
+CODEC_ID_4XM,
+CODEC_ID_VCR1,
+CODEC_ID_CLJR,
+CODEC_ID_MDEC,
+CODEC_ID_ROQ,
+CODEC_ID_INTERPLAY_VIDEO,
+CODEC_ID_XAN_WC3,
+CODEC_ID_XAN_WC4,
+CODEC_ID_RPZA,
+CODEC_ID_CINEPAK,
+CODEC_ID_WS_VQA,
+CODEC_ID_MSRLE,
+CODEC_ID_MSVIDEO1,
+CODEC_ID_IDCIN,
+CODEC_ID_8BPS,
+CODEC_ID_SMC,
+CODEC_ID_FLIC,
+CODEC_ID_TRUEMOTION1,
+CODEC_ID_VMDVIDEO,
+CODEC_ID_MSZH,
+CODEC_ID_ZLIB,
+CODEC_ID_QTRLE,
+CODEC_ID_SNOW,
+CODEC_ID_TSCC,
+CODEC_ID_ULTI,
+CODEC_ID_QDRAW,
+CODEC_ID_VIXL,
+CODEC_ID_QPEG,
+CODEC_ID_PNG,
+CODEC_ID_PPM,
+CODEC_ID_PBM,
+CODEC_ID_PGM,
+CODEC_ID_PGMYUV,
+CODEC_ID_PAM,
+CODEC_ID_FFVHUFF,
+CODEC_ID_RV30,
+CODEC_ID_RV40,
+CODEC_ID_VC1,
+CODEC_ID_WMV3,
+CODEC_ID_LOCO,
+CODEC_ID_WNV1,
+CODEC_ID_AASC,
+CODEC_ID_INDEO2,
+CODEC_ID_FRAPS,
+CODEC_ID_TRUEMOTION2,
+CODEC_ID_BMP,
+CODEC_ID_CSCD,
+CODEC_ID_MMVIDEO,
+CODEC_ID_ZMBV,
+CODEC_ID_AVS,
+CODEC_ID_SMACKVIDEO,
+CODEC_ID_NUV,
+CODEC_ID_KMVC,
+CODEC_ID_FLASHSV,
+CODEC_ID_CAVS,
+CODEC_ID_JPEG2000,
+CODEC_ID_VMNC,
+CODEC_ID_VP5,
+CODEC_ID_VP6,
+CODEC_ID_VP6F,
+CODEC_ID_TARGA,
+CODEC_ID_DSICINVIDEO,
+CODEC_ID_TIERTEXSEQVIDEO,
+CODEC_ID_TIFF,
+CODEC_ID_GIF,
+CODEC_ID_DXA,
+CODEC_ID_DNXHD,
+CODEC_ID_THP,
+CODEC_ID_SGI,
+CODEC_ID_C93,
+CODEC_ID_BETHSOFTVID,
+CODEC_ID_PTX,
+CODEC_ID_TXD,
+CODEC_ID_VP6A,
+CODEC_ID_AMV,
+CODEC_ID_VB,
+CODEC_ID_PCX,
+CODEC_ID_SUNRAST,
+CODEC_ID_INDEO4,
+CODEC_ID_INDEO5,
+CODEC_ID_MIMIC,
+CODEC_ID_RL2,
+CODEC_ID_ESCAPE124,
+CODEC_ID_DIRAC,
+CODEC_ID_BFI,
+CODEC_ID_CMV,
+CODEC_ID_MOTIONPIXELS,
+CODEC_ID_TGV,
+CODEC_ID_TGQ,
+CODEC_ID_TQI,
+CODEC_ID_AURA,
+CODEC_ID_AURA2,
+CODEC_ID_V210X,
+CODEC_ID_TMV,
+CODEC_ID_V210,
+CODEC_ID_DPX,
+CODEC_ID_MAD,
+CODEC_ID_FRWU,
+CODEC_ID_FLASHSV2,
+CODEC_ID_CDGRAPHICS,
+CODEC_ID_R210,
+CODEC_ID_ANM,
+CODEC_ID_BINKVIDEO,
+CODEC_ID_IFF_ILBM,
+CODEC_ID_IFF_BYTERUN1,
+CODEC_ID_KGV1,
+CODEC_ID_YOP,
+CODEC_ID_VP8,
+CODEC_ID_PICTOR,
+CODEC_ID_ANSI,
+CODEC_ID_A64_MULTI,
+CODEC_ID_A64_MULTI5,
+CODEC_ID_R10K,
+CODEC_ID_MXPEG,
+CODEC_ID_LAGARITH,
+CODEC_ID_PRORES,
+CODEC_ID_JV,
+CODEC_ID_DFA,
+CODEC_ID_WMV3IMAGE,
+CODEC_ID_VC1IMAGE,
+CODEC_ID_UTVIDEO,
+CODEC_ID_BMV_VIDEO,
+CODEC_ID_VBLE,
+CODEC_ID_DXTORY,
+CODEC_ID_V410,
+CODEC_ID_XWD,
+CODEC_ID_CDXL,
+CODEC_ID_XBM,
+CODEC_ID_ZEROCODEC,
+CODEC_ID_MSS1,
+CODEC_ID_MSA1,
+CODEC_ID_TSCC2,
+CODEC_ID_MTS2,
+CODEC_ID_CLLC,
+CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
+CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
+CODEC_ID_EXR = MKBETAG('0','E','X','R'),
+CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
- CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
+CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
+CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
+CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
+CODEC_ID_V308 = MKBETAG('V','3','0','8'),
+CODEC_ID_V408 = MKBETAG('V','4','0','8'),
+CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
+CODEC_ID_SANM = MKBETAG('S','A','N','M'),
+CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- /* various PCM "codecs" */
- CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
- CODEC_ID_PCM_S16LE = 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
- CODEC_ID_PCM_ZORK,
- CODEC_ID_PCM_S16LE_PLANAR,
- CODEC_ID_PCM_DVD,
- CODEC_ID_PCM_F32BE,
- CODEC_ID_PCM_F32LE,
- CODEC_ID_PCM_F64BE,
- CODEC_ID_PCM_F64LE,
- CODEC_ID_PCM_BLURAY,
- CODEC_ID_PCM_LXF,
- CODEC_ID_S302M,
- CODEC_ID_PCM_S8_PLANAR,
+/* various PCM "codecs" */
+CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
+CODEC_ID_PCM_S16LE = 0x10000,
+CODEC_ID_PCM_S16BE,
+CODEC_ID_PCM_U16LE,
+CODEC_ID_PCM_U16BE,
+CODEC_ID_PCM_S8,
+CODEC_ID_PCM_U8,
+CODEC_ID_PCM_MULAW,
+CODEC_ID_PCM_ALAW,
+CODEC_ID_PCM_S32LE,
+CODEC_ID_PCM_S32BE,
+CODEC_ID_PCM_U32LE,
+CODEC_ID_PCM_U32BE,
+CODEC_ID_PCM_S24LE,
+CODEC_ID_PCM_S24BE,
+CODEC_ID_PCM_U24LE,
+CODEC_ID_PCM_U24BE,
+CODEC_ID_PCM_S24DAUD,
+CODEC_ID_PCM_ZORK,
+CODEC_ID_PCM_S16LE_PLANAR,
+CODEC_ID_PCM_DVD,
+CODEC_ID_PCM_F32BE,
+CODEC_ID_PCM_F32LE,
+CODEC_ID_PCM_F64BE,
+CODEC_ID_PCM_F64LE,
+CODEC_ID_PCM_BLURAY,
+CODEC_ID_PCM_LXF,
+CODEC_ID_S302M,
+CODEC_ID_PCM_S8_PLANAR,
- /* various ADPCM codecs */
- CODEC_ID_ADPCM_IMA_QT = 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
- CODEC_ID_ADPCM_THP,
- CODEC_ID_ADPCM_IMA_AMV,
- CODEC_ID_ADPCM_EA_R1,
- CODEC_ID_ADPCM_EA_R3,
- CODEC_ID_ADPCM_EA_R2,
- CODEC_ID_ADPCM_IMA_EA_SEAD,
- CODEC_ID_ADPCM_IMA_EA_EACS,
- CODEC_ID_ADPCM_EA_XAS,
- CODEC_ID_ADPCM_EA_MAXIS_XA,
- CODEC_ID_ADPCM_IMA_ISS,
- CODEC_ID_ADPCM_G722,
- CODEC_ID_ADPCM_IMA_APC,
- CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+/* various ADPCM codecs */
+CODEC_ID_ADPCM_IMA_QT = 0x11000,
+CODEC_ID_ADPCM_IMA_WAV,
+CODEC_ID_ADPCM_IMA_DK3,
+CODEC_ID_ADPCM_IMA_DK4,
+CODEC_ID_ADPCM_IMA_WS,
+CODEC_ID_ADPCM_IMA_SMJPEG,
+CODEC_ID_ADPCM_MS,
+CODEC_ID_ADPCM_4XM,
+CODEC_ID_ADPCM_XA,
+CODEC_ID_ADPCM_ADX,
+CODEC_ID_ADPCM_EA,
+CODEC_ID_ADPCM_G726,
+CODEC_ID_ADPCM_CT,
+CODEC_ID_ADPCM_SWF,
+CODEC_ID_ADPCM_YAMAHA,
+CODEC_ID_ADPCM_SBPRO_4,
+CODEC_ID_ADPCM_SBPRO_3,
+CODEC_ID_ADPCM_SBPRO_2,
+CODEC_ID_ADPCM_THP,
+CODEC_ID_ADPCM_IMA_AMV,
+CODEC_ID_ADPCM_EA_R1,
+CODEC_ID_ADPCM_EA_R3,
+CODEC_ID_ADPCM_EA_R2,
+CODEC_ID_ADPCM_IMA_EA_SEAD,
+CODEC_ID_ADPCM_IMA_EA_EACS,
+CODEC_ID_ADPCM_EA_XAS,
+CODEC_ID_ADPCM_EA_MAXIS_XA,
+CODEC_ID_ADPCM_IMA_ISS,
+CODEC_ID_ADPCM_G722,
+CODEC_ID_ADPCM_IMA_APC,
+CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
- /* AMR */
- CODEC_ID_AMR_NB = 0x12000,
- CODEC_ID_AMR_WB,
+/* AMR */
+CODEC_ID_AMR_NB = 0x12000,
+CODEC_ID_AMR_WB,
- /* RealAudio codecs*/
- CODEC_ID_RA_144 = 0x13000,
- CODEC_ID_RA_288,
+/* RealAudio codecs*/
+CODEC_ID_RA_144 = 0x13000,
+CODEC_ID_RA_288,
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM = 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
+/* various DPCM codecs */
+CODEC_ID_ROQ_DPCM = 0x14000,
+CODEC_ID_INTERPLAY_DPCM,
+CODEC_ID_XAN_DPCM,
+CODEC_ID_SOL_DPCM,
- /* audio codecs */
- CODEC_ID_MP2 = 0x15000,
- CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
- CODEC_ID_AAC,
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM, ///< as in Berlin toast format
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
- CODEC_ID_MLP,
- CODEC_ID_GSM_MS, /* as found in WAV */
- CODEC_ID_ATRAC3,
- CODEC_ID_VOXWARE,
- CODEC_ID_APE,
- CODEC_ID_NELLYMOSER,
- CODEC_ID_MUSEPACK8,
- CODEC_ID_SPEEX,
- CODEC_ID_WMAVOICE,
- CODEC_ID_WMAPRO,
- CODEC_ID_WMALOSSLESS,
- CODEC_ID_ATRAC3P,
- CODEC_ID_EAC3,
- CODEC_ID_SIPR,
- CODEC_ID_MP1,
- CODEC_ID_TWINVQ,
- CODEC_ID_TRUEHD,
- CODEC_ID_MP4ALS,
- CODEC_ID_ATRAC1,
- CODEC_ID_BINKAUDIO_RDFT,
- CODEC_ID_BINKAUDIO_DCT,
- CODEC_ID_AAC_LATM,
- CODEC_ID_QDMC,
- CODEC_ID_CELT,
- CODEC_ID_G723_1,
- CODEC_ID_G729,
- CODEC_ID_8SVX_EXP,
- CODEC_ID_8SVX_FIB,
- CODEC_ID_BMV_AUDIO,
- CODEC_ID_RALF,
- CODEC_ID_IAC,
- CODEC_ID_ILBC,
- CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
- CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
+/* audio codecs */
+CODEC_ID_MP2 = 0x15000,
+CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+CODEC_ID_AAC,
+CODEC_ID_AC3,
+CODEC_ID_DTS,
+CODEC_ID_VORBIS,
+CODEC_ID_DVAUDIO,
+CODEC_ID_WMAV1,
+CODEC_ID_WMAV2,
+CODEC_ID_MACE3,
+CODEC_ID_MACE6,
+CODEC_ID_VMDAUDIO,
+CODEC_ID_FLAC,
+CODEC_ID_MP3ADU,
+CODEC_ID_MP3ON4,
+CODEC_ID_SHORTEN,
+CODEC_ID_ALAC,
+CODEC_ID_WESTWOOD_SND1,
+CODEC_ID_GSM, ///< as in Berlin toast format
+CODEC_ID_QDM2,
+CODEC_ID_COOK,
+CODEC_ID_TRUESPEECH,
+CODEC_ID_TTA,
+CODEC_ID_SMACKAUDIO,
+CODEC_ID_QCELP,
+CODEC_ID_WAVPACK,
+CODEC_ID_DSICINAUDIO,
+CODEC_ID_IMC,
+CODEC_ID_MUSEPACK7,
+CODEC_ID_MLP,
+CODEC_ID_GSM_MS, /* as found in WAV */
+CODEC_ID_ATRAC3,
+CODEC_ID_VOXWARE,
+CODEC_ID_APE,
+CODEC_ID_NELLYMOSER,
+CODEC_ID_MUSEPACK8,
+CODEC_ID_SPEEX,
+CODEC_ID_WMAVOICE,
+CODEC_ID_WMAPRO,
+CODEC_ID_WMALOSSLESS,
+CODEC_ID_ATRAC3P,
+CODEC_ID_EAC3,
+CODEC_ID_SIPR,
+CODEC_ID_MP1,
+CODEC_ID_TWINVQ,
+CODEC_ID_TRUEHD,
+CODEC_ID_MP4ALS,
+CODEC_ID_ATRAC1,
+CODEC_ID_BINKAUDIO_RDFT,
+CODEC_ID_BINKAUDIO_DCT,
+CODEC_ID_AAC_LATM,
+CODEC_ID_QDMC,
+CODEC_ID_CELT,
+CODEC_ID_G723_1,
+CODEC_ID_G729,
+CODEC_ID_8SVX_EXP,
+CODEC_ID_8SVX_FIB,
+CODEC_ID_BMV_AUDIO,
+CODEC_ID_RALF,
+CODEC_ID_IAC,
+CODEC_ID_ILBC,
+CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
+CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
+CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
+CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
+CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
+CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
- /* subtitle codecs */
- CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
- CODEC_ID_DVD_SUBTITLE = 0x17000,
- CODEC_ID_DVB_SUBTITLE,
- CODEC_ID_TEXT, ///< raw UTF-8 text
- CODEC_ID_XSUB,
- CODEC_ID_SSA,
- CODEC_ID_MOV_TEXT,
- CODEC_ID_HDMV_PGS_SUBTITLE,
- CODEC_ID_DVB_TELETEXT,
- CODEC_ID_SRT,
- CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
+/* subtitle codecs */
+CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
+CODEC_ID_DVD_SUBTITLE = 0x17000,
+CODEC_ID_DVB_SUBTITLE,
+CODEC_ID_TEXT, ///< raw UTF-8 text
+CODEC_ID_XSUB,
+CODEC_ID_SSA,
+CODEC_ID_MOV_TEXT,
+CODEC_ID_HDMV_PGS_SUBTITLE,
+CODEC_ID_DVB_TELETEXT,
+CODEC_ID_SRT,
+CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
+CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
+CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
+CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
+CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
+CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
- /* other specific kind of codecs (generally used for attachments) */
- CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
- CODEC_ID_TTF = 0x18000,
- CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
+/* other specific kind of codecs (generally used for attachments) */
+CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
+CODEC_ID_TTF = 0x18000,
+CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
+CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
+CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
+CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
- CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
- CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
- CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+ CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
- CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
+ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/thirdparties/iphone/include/libavcodec/opt.h b/thirdparties/iphone/include/libavcodec/opt.h
index 9f0da72..5e58351 100755
--- a/thirdparties/iphone/include/libavcodec/opt.h
+++ b/thirdparties/iphone/include/libavcodec/opt.h
@@ -30,7 +30,7 @@
#include "libavutil/rational.h"
#include "avcodec.h"
-enum AVOptionType{
+enum AVOptionType {
FF_OPT_TYPE_FLAGS,
FF_OPT_TYPE_INT,
FF_OPT_TYPE_INT64,
@@ -119,14 +119,14 @@ typedef struct AVOption2 {
double max; ///< maximum valid value for the option
int flags;
-/*
-#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM 8
-#define AV_OPT_FLAG_VIDEO_PARAM 16
-#define AV_OPT_FLAG_SUBTITLE_PARAM 32
-*/
+ /*
+ #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
+ #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
+ #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
+ #define AV_OPT_FLAG_AUDIO_PARAM 8
+ #define AV_OPT_FLAG_VIDEO_PARAM 16
+ #define AV_OPT_FLAG_SUBTITLE_PARAM 32
+ */
//FIXME think about enc-audio, ... style flags
/**
diff --git a/thirdparties/iphone/include/libavcodec/xvmc.h b/thirdparties/iphone/include/libavcodec/xvmc.h
index b2bf518..373d9aa 100755
--- a/thirdparties/iphone/include/libavcodec/xvmc.h
+++ b/thirdparties/iphone/include/libavcodec/xvmc.h
@@ -101,8 +101,8 @@ struct xvmc_pix_fmt {
*/
XvMCSurface* p_surface;
-/** Set by the decoder before calling ff_draw_horiz_band(),
- needed by the XvMCRenderSurface function. */
+ /** Set by the decoder before calling ff_draw_horiz_band(),
+ needed by the XvMCRenderSurface function. */
//@{
/** Pointer to the surface used as past reference
- application - unchanged
diff --git a/thirdparties/iphone/include/libavfilter/avcodec.h b/thirdparties/iphone/include/libavfilter/avcodec.h
index 5f4209a..8dee966 100755
--- a/thirdparties/iphone/include/libavfilter/avcodec.h
+++ b/thirdparties/iphone/include/libavfilter/avcodec.h
@@ -63,7 +63,7 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms);
+ int perms);
/**
* Create and return a buffer reference from the data and properties
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms);
+ const AVFrame *frame,
+ int perms);
#ifdef FF_API_FILL_FRAME
/**
@@ -87,7 +87,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
*/
attribute_deprecated
int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *samplesref);
+ const AVFilterBufferRef *samplesref);
/**
* Fill an AVFrame with the information stored in picref.
@@ -100,7 +100,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
*/
attribute_deprecated
int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *picref);
+ const AVFilterBufferRef *picref);
/**
* Fill an AVFrame with information stored in ref.
diff --git a/thirdparties/iphone/include/libavfilter/avfilter.h b/thirdparties/iphone/include/libavfilter/avfilter.h
index d66bc00..29aa562 100755
--- a/thirdparties/iphone/include/libavfilter/avfilter.h
+++ b/thirdparties/iphone/include/libavfilter/avfilter.h
@@ -753,7 +753,7 @@ int avfilter_config_links(AVFilterContext *filter);
*/
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum PixelFormat format);
+ int w, int h, enum PixelFormat format);
/**
* Create an audio buffer reference wrapped around an already
@@ -767,11 +767,11 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin
* @param channel_layout the channel layout of the buffer
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ uint64_t channel_layout);
#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
diff --git a/thirdparties/iphone/include/libavformat/avformat.h b/thirdparties/iphone/include/libavformat/avformat.h
index f7779e7..3245b22 100755
--- a/thirdparties/iphone/include/libavformat/avformat.h
+++ b/thirdparties/iphone/include/libavformat/avformat.h
@@ -360,9 +360,9 @@ typedef struct AVProbeData {
#else
#define AVFMT_TS_NONSTRICT 0x20000
#endif
- /**< Format does not require strictly
- increasing timestamps, but they must
- still be monotonic */
+/**< Format does not require strictly
+ increasing timestamps, but they must
+ still be monotonic */
#define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */
@@ -1311,7 +1311,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
#if FF_API_PKT_DUMP
attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
- int dump_payload);
+ int dump_payload);
#endif
#if FF_API_ALLOC_OUTPUT_CONTEXT
@@ -1320,8 +1320,8 @@ attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
*/
attribute_deprecated
AVFormatContext *avformat_alloc_output_context(const char *format,
- AVOutputFormat *oformat,
- const char *filename);
+ AVOutputFormat *oformat,
+ const char *filename);
#endif
/**
@@ -1768,8 +1768,8 @@ AVOutputFormat *av_guess_format(const char *short_name,
* Guess the codec ID based upon muxer and filename.
*/
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
- const char *filename, const char *mime_type,
- enum AVMediaType type);
+ const char *filename, const char *mime_type,
+ enum AVMediaType type);
/**
* Get timing information for the data currently output.
diff --git a/thirdparties/iphone/include/libavformat/avio.h b/thirdparties/iphone/include/libavformat/avio.h
index b16d26f..e298363 100755
--- a/thirdparties/iphone/include/libavformat/avio.h
+++ b/thirdparties/iphone/include/libavformat/avio.h
@@ -120,26 +120,26 @@ typedef struct AVIOContext {
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t maxsize;
+ int64_t maxsize;
- /**
- * avio_read and avio_write should if possible be satisfied directly
- * instead of going through a buffer, and avio_seek will always
- * call the underlying seek function directly.
- */
- int direct;
+ /**
+ * avio_read and avio_write should if possible be satisfied directly
+ * instead of going through a buffer, and avio_seek will always
+ * call the underlying seek function directly.
+ */
+ int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t bytes_read;
+ int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int seek_count;
+ int seek_count;
} AVIOContext;
/* unbuffered I/O */
@@ -177,13 +177,13 @@ int avio_check(const char *url, int flags);
* @return Allocated AVIOContext or NULL on failure.
*/
AVIOContext *avio_alloc_context(
- unsigned char *buffer,
- int buffer_size,
- int write_flag,
- void *opaque,
- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
- int64_t (*seek)(void *opaque, int64_t offset, int whence));
+ unsigned char *buffer,
+ int buffer_size,
+ int write_flag,
+ void *opaque,
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int64_t (*seek)(void *opaque, int64_t offset, int whence));
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
diff --git a/thirdparties/iphone/include/libavutil/avstring.h b/thirdparties/iphone/include/libavutil/avstring.h
index f73d6e7..30b8dc5 100755
--- a/thirdparties/iphone/include/libavutil/avstring.h
+++ b/thirdparties/iphone/include/libavutil/avstring.h
@@ -175,8 +175,9 @@ char *av_strtok(char *s, const char *delim, char **saveptr);
*/
static inline int av_toupper(int c)
{
- if (c >= 'a' && c <= 'z')
+ if (c >= 'a' && c <= 'z') {
c ^= 0x20;
+ }
return c;
}
@@ -185,8 +186,9 @@ static inline int av_toupper(int c)
*/
static inline int av_tolower(int c)
{
- if (c >= 'A' && c <= 'Z')
+ if (c >= 'A' && c <= 'Z') {
c ^= 0x20;
+ }
return c;
}
diff --git a/thirdparties/iphone/include/libavutil/base64.h b/thirdparties/iphone/include/libavutil/base64.h
index b095576..d262295 100755
--- a/thirdparties/iphone/include/libavutil/base64.h
+++ b/thirdparties/iphone/include/libavutil/base64.h
@@ -58,8 +58,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
- /**
- * @}
- */
+/**
+ * @}
+ */
#endif /* AVUTIL_BASE64_H */
diff --git a/thirdparties/iphone/include/libavutil/bprint.h b/thirdparties/iphone/include/libavutil/bprint.h
index 2bef18d..db7a6d3 100755
--- a/thirdparties/iphone/include/libavutil/bprint.h
+++ b/thirdparties/iphone/include/libavutil/bprint.h
@@ -73,12 +73,12 @@
*/
typedef struct AVBPrint {
FF_PAD_STRUCTURE(1024,
- char *str; /** string so far */
- unsigned len; /** length so far */
- unsigned size; /** allocated memory */
- unsigned size_max; /** maximum allocated memory */
- char reserved_internal_buffer[1];
- )
+ char *str; /** string so far */
+ unsigned len; /** length so far */
+ unsigned size; /** allocated memory */
+ unsigned size_max; /** maximum allocated memory */
+ char reserved_internal_buffer[1];
+ )
} AVBPrint;
/**
diff --git a/thirdparties/iphone/include/libavutil/common.h b/thirdparties/iphone/include/libavutil/common.h
index 3e3baab..b7ab0e9 100755
--- a/thirdparties/iphone/include/libavutil/common.h
+++ b/thirdparties/iphone/include/libavutil/common.h
@@ -114,9 +114,15 @@ static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
*/
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
{
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -126,8 +132,12 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
*/
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
- if (a&(~0xFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -137,8 +147,12 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
*/
static av_always_inline av_const int8_t av_clip_int8_c(int a)
{
- if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
- else return a;
+ if ((a+0x80) & ~0xFF) {
+ return (a>>31) ^ 0x7F;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -148,8 +162,12 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
- if (a&(~0xFFFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFFFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -159,8 +177,12 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
*/
static av_always_inline av_const int16_t av_clip_int16_c(int a)
{
- if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
- else return a;
+ if ((a+0x8000) & ~0xFFFF) {
+ return (a>>31) ^ 0x7FFF;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -170,8 +192,12 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a)
*/
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
{
- if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
- else return (int32_t)a;
+ if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) {
+ return (a>>63) ^ 0x7FFFFFFF;
+ }
+ else {
+ return (int32_t)a;
+ }
}
/**
@@ -182,8 +208,12 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
- if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
- else return a;
+ if (a & ~((1<<p) - 1)) {
+ return -a >> 31 & ((1<<p) - 1);
+ }
+ else {
+ return a;
+ }
}
/**
@@ -219,9 +249,15 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
*/
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
{
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/** Compute ceil(log2(x)).
@@ -306,7 +342,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
val += (hi<<10) + 0x10000;\
}\
}\
-
+
/**
* @def PUT_UTF8(val, tmp, PUT_BYTE)
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
@@ -370,7 +406,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
PUT_16BIT\
}\
}\
-
+
#include "mem.h"
diff --git a/thirdparties/iphone/include/libavutil/cpu.h b/thirdparties/iphone/include/libavutil/cpu.h
index de15ee3..30b3d89 100755
--- a/thirdparties/iphone/include/libavutil/cpu.h
+++ b/thirdparties/iphone/include/libavutil/cpu.h
@@ -25,7 +25,7 @@
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
- /* lower 16 bits - CPU features */
+/* lower 16 bits - CPU features */
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
diff --git a/thirdparties/iphone/include/libavutil/crc.h b/thirdparties/iphone/include/libavutil/crc.h
index 1265054..5e04de6 100755
--- a/thirdparties/iphone/include/libavutil/crc.h
+++ b/thirdparties/iphone/include/libavutil/crc.h
@@ -34,7 +34,7 @@ typedef enum {
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
+} AVCRCId;
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
const AVCRC *av_crc_get_table(AVCRCId crc_id);
diff --git a/thirdparties/iphone/include/libavutil/fifo.h b/thirdparties/iphone/include/libavutil/fifo.h
index ff66c95..eba8941 100755
--- a/thirdparties/iphone/include/libavutil/fifo.h
+++ b/thirdparties/iphone/include/libavutil/fifo.h
@@ -134,10 +134,12 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
{
uint8_t *ptr = f->rptr + offs;
- if (ptr >= f->end)
+ if (ptr >= f->end) {
ptr = f->buffer + (ptr - f->end);
- else if (ptr < f->buffer)
+ }
+ else if (ptr < f->buffer) {
ptr = f->end - (f->buffer - ptr);
+ }
return ptr;
}
diff --git a/thirdparties/iphone/include/libavutil/intreadwrite.h b/thirdparties/iphone/include/libavutil/intreadwrite.h
index 7c68ead..cf0e3f8 100755
--- a/thirdparties/iphone/include/libavutil/intreadwrite.h
+++ b/thirdparties/iphone/include/libavutil/intreadwrite.h
@@ -185,9 +185,15 @@ typedef union {
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+union unaligned_64 {
+ uint64_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_32 {
+ uint32_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_16 {
+ uint16_t l;
+} __attribute__((packed)) av_alias;
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
diff --git a/thirdparties/iphone/include/libavutil/lfg.h b/thirdparties/iphone/include/libavutil/lfg.h
index 854ffce..8b4dfd5 100755
--- a/thirdparties/iphone/include/libavutil/lfg.h
+++ b/thirdparties/iphone/include/libavutil/lfg.h
@@ -35,7 +35,8 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
* Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case.
*/
-static inline unsigned int av_lfg_get(AVLFG *c){
+static inline unsigned int av_lfg_get(AVLFG *c)
+{
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
return c->state[c->index++ & 63];
}
@@ -45,7 +46,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){
*
* Please also consider av_lfg_get() above, it is faster.
*/
-static inline unsigned int av_mlfg_get(AVLFG *c){
+static inline unsigned int av_mlfg_get(AVLFG *c)
+{
unsigned int a= c->state[(c->index-55) & 63];
unsigned int b= c->state[(c->index-24) & 63];
return c->state[c->index++ & 63] = 2*a*b+a+b;
diff --git a/thirdparties/iphone/include/libavutil/log.h b/thirdparties/iphone/include/libavutil/log.h
index ba7315f..303a863 100755
--- a/thirdparties/iphone/include/libavutil/log.h
+++ b/thirdparties/iphone/include/libavutil/log.h
@@ -38,7 +38,7 @@ typedef enum {
AV_CLASS_CATEGORY_SWSCALER,
AV_CLASS_CATEGORY_SWRESAMPLER,
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
-}AVClassCategory;
+} AVClassCategory;
/**
* Describe the class of an AVClass context structure. That is an
diff --git a/thirdparties/iphone/include/libavutil/mem.h b/thirdparties/iphone/include/libavutil/mem.h
index 212dbf1..fefe6fa 100755
--- a/thirdparties/iphone/include/libavutil/mem.h
+++ b/thirdparties/iphone/include/libavutil/mem.h
@@ -39,36 +39,36 @@
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
#elif defined(__TI_COMPILER_VERSION__)
- #define DECLARE_ALIGNED(n,t,v) \
+#define DECLARE_ALIGNED(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
t __attribute__((aligned(n))) v
- #define DECLARE_ASM_CONST(n,t,v) \
+#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
#elif defined(__GNUC__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
+#define DECLARE_ALIGNED(n,t,v) t v
+#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
- #define av_malloc_attrib __attribute__((__malloc__))
+#define av_malloc_attrib __attribute__((__malloc__))
#else
- #define av_malloc_attrib
+#define av_malloc_attrib
#endif
#if AV_GCC_VERSION_AT_LEAST(4,3)
- #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
#else
- #define av_alloc_size(...)
+#define av_alloc_size(...)
#endif
/**
@@ -92,8 +92,9 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
*/
av_alloc_size(1,2) static inline void *av_malloc_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_malloc(nmemb * size);
}
@@ -165,8 +166,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
*/
av_alloc_size(1,2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_mallocz(nmemb * size);
}
@@ -205,8 +207,9 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r)
size_t t = a * b;
/* Hack inspired from glibc: only try the division if nelem and elsize
* are both greater than sqrt(SIZE_MAX). */
- if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
+ if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) {
return AVERROR(EINVAL);
+ }
*r = t;
return 0;
}
diff --git a/thirdparties/iphone/include/libavutil/opt.h b/thirdparties/iphone/include/libavutil/opt.h
index 285d854..f3bdae3 100755
--- a/thirdparties/iphone/include/libavutil/opt.h
+++ b/thirdparties/iphone/include/libavutil/opt.h
@@ -215,7 +215,7 @@
* before the file is actually opened.
*/
-enum AVOptionType{
+enum AVOptionType {
AV_OPT_TYPE_FLAGS,
AV_OPT_TYPE_INT,
AV_OPT_TYPE_INT64,
diff --git a/thirdparties/iphone/include/libavutil/pixdesc.h b/thirdparties/iphone/include/libavutil/pixdesc.h
index 1fa916a..851b604 100755
--- a/thirdparties/iphone/include/libavutil/pixdesc.h
+++ b/thirdparties/iphone/include/libavutil/pixdesc.h
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include "pixfmt.h"
-typedef struct AVComponentDescriptor{
+typedef struct AVComponentDescriptor {
uint16_t plane :2; ///< which of the 4 planes contains the component
/**
@@ -41,7 +41,7 @@ typedef struct AVComponentDescriptor{
uint16_t offset_plus1 :3;
uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
-}AVComponentDescriptor;
+} AVComponentDescriptor;
/**
* Descriptor that unambiguously describes how the bits of a pixel are
@@ -52,7 +52,7 @@ typedef struct AVComponentDescriptor{
* and all the YUV variants) AVPixFmtDescriptor just stores how values
* are stored not what these values represent.
*/
-typedef struct AVPixFmtDescriptor{
+typedef struct AVPixFmtDescriptor {
const char *name;
uint8_t nb_components; ///< The number of components each pixel has, (1-4)
@@ -84,7 +84,7 @@ typedef struct AVPixFmtDescriptor{
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
*/
AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
+} AVPixFmtDescriptor;
#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
diff --git a/thirdparties/iphone/include/libavutil/rational.h b/thirdparties/iphone/include/libavutil/rational.h
index 417e29e..84ce7a0 100755
--- a/thirdparties/iphone/include/libavutil/rational.h
+++ b/thirdparties/iphone/include/libavutil/rational.h
@@ -40,7 +40,7 @@
/**
* rational number numerator/denominator
*/
-typedef struct AVRational{
+typedef struct AVRational {
int num; ///< numerator
int den; ///< denominator
} AVRational;
@@ -52,13 +52,22 @@ typedef struct AVRational{
* @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
* values is of the form 0/0
*/
-static inline int av_cmp_q(AVRational a, AVRational b){
+static inline int av_cmp_q(AVRational a, AVRational b)
+{
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
- if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
- else if(b.den && a.den) return 0;
- else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
- else return INT_MIN;
+ if(tmp) {
+ return ((tmp ^ a.den ^ b.den)>>63)|1;
+ }
+ else if(b.den && a.den) {
+ return 0;
+ }
+ else if(a.num && b.num) {
+ return (a.num>>31) - (b.num>>31);
+ }
+ else {
+ return INT_MIN;
+ }
}
/**
@@ -66,7 +75,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){
* @param a rational to convert
* @return (double) a
*/
-static inline double av_q2d(AVRational a){
+static inline double av_q2d(AVRational a)
+{
return a.num / (double) a.den;
}
diff --git a/thirdparties/iphone/include/libavutil/timestamp.h b/thirdparties/iphone/include/libavutil/timestamp.h
index c7348d8..6b46998 100755
--- a/thirdparties/iphone/include/libavutil/timestamp.h
+++ b/thirdparties/iphone/include/libavutil/timestamp.h
@@ -38,8 +38,12 @@
*/
static inline char *av_ts_make_string(char *buf, int64_t ts)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ }
return buf;
}
@@ -60,8 +64,12 @@ static inline char *av_ts_make_string(char *buf, int64_t ts)
*/
static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ }
return buf;
}
diff --git a/thirdparties/iphone/include/libswresample/swresample.h b/thirdparties/iphone/include/libswresample/swresample.h
index ac87207..cf73401 100755
--- a/thirdparties/iphone/include/libswresample/swresample.h
+++ b/thirdparties/iphone/include/libswresample/swresample.h
@@ -137,7 +137,7 @@ void swr_free(struct SwrContext **s);
* @return number of samples output per channel, negative value on error
*/
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
- const uint8_t **in , int in_count);
+ const uint8_t **in , int in_count);
/**
* Convert the next timestamp from input to output
diff --git a/thirdparties/iphone/include/libyuv/libyuv/compare.h b/thirdparties/iphone/include/libyuv/libyuv/compare.h
index 5dfac7c..8463a4c 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/compare.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/compare.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/convert.h b/thirdparties/iphone/include/libyuv/libyuv/convert.h
index 1bd45c8..e447d64 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/convert.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/convert.h
@@ -18,7 +18,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/convert_argb.h b/thirdparties/iphone/include/libyuv/libyuv/convert_argb.h
index a18014c..eaa14bc 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/convert_argb.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/convert_argb.h
@@ -24,7 +24,8 @@
// TODO(fbarchard): Some of these functions lack parameter setting.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/convert_from.h b/thirdparties/iphone/include/libyuv/libyuv/convert_from.h
index b1cf57f..a9c9cdb 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/convert_from.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/convert_from.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/convert_from_argb.h b/thirdparties/iphone/include/libyuv/libyuv/convert_from_argb.h
index 90f43af..a08bb1d 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/convert_from_argb.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/convert_from_argb.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/cpu_id.h b/thirdparties/iphone/include/libyuv/libyuv/cpu_id.h
index dc858a8..d36213c 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/cpu_id.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/cpu_id.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -55,9 +56,10 @@ int ArmCpuCaps(const char* cpuinfo_name);
// Detect CPU has SSE2 etc.
// Test_flag parameter should be one of kCpuHas constants above.
// returns non-zero if instruction set is detected
-static __inline int TestCpuFlag(int test_flag) {
- LIBYUV_API extern int cpu_info_;
- return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag;
+static __inline int TestCpuFlag(int test_flag)
+{
+ LIBYUV_API extern int cpu_info_;
+ return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag;
}
// For testing, allow CPU flags to be disabled.
diff --git a/thirdparties/iphone/include/libyuv/libyuv/format_conversion.h b/thirdparties/iphone/include/libyuv/libyuv/format_conversion.h
index b18bf05..8cf6e4b 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/format_conversion.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/format_conversion.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/mjpeg_decoder.h b/thirdparties/iphone/include/libyuv/libyuv/mjpeg_decoder.h
index 8423121..bb51204 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/mjpeg_decoder.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/mjpeg_decoder.h
@@ -20,7 +20,8 @@ struct jpeg_common_struct;
struct jpeg_decompress_struct;
struct jpeg_source_mgr;
-namespace libyuv {
+namespace libyuv
+{
#ifdef __cplusplus
extern "C" {
@@ -35,23 +36,23 @@ LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size);
static const uint32 kUnknownDataSize = 0xFFFFFFFF;
enum JpegSubsamplingType {
- kJpegYuv420,
- kJpegYuv422,
- kJpegYuv411,
- kJpegYuv444,
- kJpegYuv400,
- kJpegUnknown
+ kJpegYuv420,
+ kJpegYuv422,
+ kJpegYuv411,
+ kJpegYuv444,
+ kJpegYuv400,
+ kJpegUnknown
};
struct Buffer {
- const uint8* data;
- int len;
+ const uint8* data;
+ int len;
};
struct BufferVector {
- Buffer* buffers;
- int len;
- int pos;
+ Buffer* buffers;
+ int len;
+ int pos;
};
struct SetJmpErrorMgr;
@@ -63,127 +64,128 @@ struct SetJmpErrorMgr;
// MJPEG frames.
//
// See http://tools.ietf.org/html/rfc2435
-class LIBYUV_API MJpegDecoder {
- public:
- typedef void (*CallbackFunction)(void* opaque,
- const uint8* const* data,
- const int* strides,
- int rows);
+class LIBYUV_API MJpegDecoder
+{
+public:
+ typedef void (*CallbackFunction)(void* opaque,
+ const uint8* const* data,
+ const int* strides,
+ int rows);
- static const int kColorSpaceUnknown;
- static const int kColorSpaceGrayscale;
- static const int kColorSpaceRgb;
- static const int kColorSpaceYCbCr;
- static const int kColorSpaceCMYK;
- static const int kColorSpaceYCCK;
+ static const int kColorSpaceUnknown;
+ static const int kColorSpaceGrayscale;
+ static const int kColorSpaceRgb;
+ static const int kColorSpaceYCbCr;
+ static const int kColorSpaceCMYK;
+ static const int kColorSpaceYCCK;
- MJpegDecoder();
- ~MJpegDecoder();
+ MJpegDecoder();
+ ~MJpegDecoder();
- // Loads a new frame, reads its headers, and determines the uncompressed
- // image format.
- // Returns LIBYUV_TRUE if image looks valid and format is supported.
- // If return value is LIBYUV_TRUE, then the values for all the following
- // getters are populated.
- // src_len is the size of the compressed mjpeg frame in bytes.
- LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len);
-
- // Returns width of the last loaded frame in pixels.
- int GetWidth();
-
- // Returns height of the last loaded frame in pixels.
- int GetHeight();
-
- // Returns format of the last loaded frame. The return value is one of the
- // kColorSpace* constants.
- int GetColorSpace();
-
- // Number of color components in the color space.
- int GetNumComponents();
-
- // Sample factors of the n-th component.
- int GetHorizSampFactor(int component);
-
- int GetVertSampFactor(int component);
-
- int GetHorizSubSampFactor(int component);
-
- int GetVertSubSampFactor(int component);
-
- // Public for testability.
- int GetImageScanlinesPerImcuRow();
-
- // Public for testability.
- int GetComponentScanlinesPerImcuRow(int component);
-
- // Width of a component in bytes.
- int GetComponentWidth(int component);
-
- // Height of a component.
- int GetComponentHeight(int component);
-
- // Width of a component in bytes with padding for DCTSIZE. Public for testing.
- int GetComponentStride(int component);
-
- // Size of a component in bytes.
- int GetComponentSize(int component);
-
- // Call this after LoadFrame() if you decide you don't want to decode it
- // after all.
- LIBYUV_BOOL UnloadFrame();
-
- // Decodes the entire image into a one-buffer-per-color-component format.
- // dst_width must match exactly. dst_height must be <= to image height; if
- // less, the image is cropped. "planes" must have size equal to at least
- // GetNumComponents() and they must point to non-overlapping buffers of size
- // at least GetComponentSize(i). The pointers in planes are incremented
- // to point to after the end of the written data.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
-
- // Decodes the entire image and passes the data via repeated calls to a
- // callback function. Each call will get the data for a whole number of
- // image scanlines.
- // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
- LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque,
- int dst_width, int dst_height);
-
- // The helper function which recognizes the jpeg sub-sampling type.
- static JpegSubsamplingType JpegSubsamplingTypeHelper(
- int* subsample_x, int* subsample_y, int number_of_components);
-
- private:
- void AllocOutputBuffers(int num_outbufs);
- void DestroyOutputBuffers();
-
- LIBYUV_BOOL StartDecode();
- LIBYUV_BOOL FinishDecode();
-
- void SetScanlinePointers(uint8** data);
- LIBYUV_BOOL DecodeImcuRow();
-
- int GetComponentScanlinePadding(int component);
-
- // A buffer holding the input data for a frame.
- Buffer buf_;
- BufferVector buf_vec_;
+ // Loads a new frame, reads its headers, and determines the uncompressed
+ // image format.
+ // Returns LIBYUV_TRUE if image looks valid and format is supported.
+ // If return value is LIBYUV_TRUE, then the values for all the following
+ // getters are populated.
+ // src_len is the size of the compressed mjpeg frame in bytes.
+ LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len);
+
+ // Returns width of the last loaded frame in pixels.
+ int GetWidth();
+
+ // Returns height of the last loaded frame in pixels.
+ int GetHeight();
+
+ // Returns format of the last loaded frame. The return value is one of the
+ // kColorSpace* constants.
+ int GetColorSpace();
+
+ // Number of color components in the color space.
+ int GetNumComponents();
+
+ // Sample factors of the n-th component.
+ int GetHorizSampFactor(int component);
+
+ int GetVertSampFactor(int component);
+
+ int GetHorizSubSampFactor(int component);
+
+ int GetVertSubSampFactor(int component);
+
+ // Public for testability.
+ int GetImageScanlinesPerImcuRow();
+
+ // Public for testability.
+ int GetComponentScanlinesPerImcuRow(int component);
+
+ // Width of a component in bytes.
+ int GetComponentWidth(int component);
+
+ // Height of a component.
+ int GetComponentHeight(int component);
+
+ // Width of a component in bytes with padding for DCTSIZE. Public for testing.
+ int GetComponentStride(int component);
+
+ // Size of a component in bytes.
+ int GetComponentSize(int component);
+
+ // Call this after LoadFrame() if you decide you don't want to decode it
+ // after all.
+ LIBYUV_BOOL UnloadFrame();
+
+ // Decodes the entire image into a one-buffer-per-color-component format.
+ // dst_width must match exactly. dst_height must be <= to image height; if
+ // less, the image is cropped. "planes" must have size equal to at least
+ // GetNumComponents() and they must point to non-overlapping buffers of size
+ // at least GetComponentSize(i). The pointers in planes are incremented
+ // to point to after the end of the written data.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
+
+ // Decodes the entire image and passes the data via repeated calls to a
+ // callback function. Each call will get the data for a whole number of
+ // image scanlines.
+ // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
+ LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque,
+ int dst_width, int dst_height);
+
+ // The helper function which recognizes the jpeg sub-sampling type.
+ static JpegSubsamplingType JpegSubsamplingTypeHelper(
+ int* subsample_x, int* subsample_y, int number_of_components);
+
+private:
+ void AllocOutputBuffers(int num_outbufs);
+ void DestroyOutputBuffers();
+
+ LIBYUV_BOOL StartDecode();
+ LIBYUV_BOOL FinishDecode();
+
+ void SetScanlinePointers(uint8** data);
+ LIBYUV_BOOL DecodeImcuRow();
+
+ int GetComponentScanlinePadding(int component);
+
+ // A buffer holding the input data for a frame.
+ Buffer buf_;
+ BufferVector buf_vec_;
- jpeg_decompress_struct* decompress_struct_;
- jpeg_source_mgr* source_mgr_;
- SetJmpErrorMgr* error_mgr_;
+ jpeg_decompress_struct* decompress_struct_;
+ jpeg_source_mgr* source_mgr_;
+ SetJmpErrorMgr* error_mgr_;
- // LIBYUV_TRUE iff at least one component has scanline padding. (i.e.,
- // GetComponentScanlinePadding() != 0.)
- LIBYUV_BOOL has_scanline_padding_;
+ // LIBYUV_TRUE iff at least one component has scanline padding. (i.e.,
+ // GetComponentScanlinePadding() != 0.)
+ LIBYUV_BOOL has_scanline_padding_;
- // Temporaries used to point to scanline outputs.
- int num_outbufs_; // Outermost size of all arrays below.
- uint8*** scanlines_;
- int* scanlines_sizes_;
- // Temporary buffer used for decoding when we can't decode directly to the
- // output buffers. Large enough for just one iMCU row.
- uint8** databuf_;
- int* databuf_strides_;
+ // Temporaries used to point to scanline outputs.
+ int num_outbufs_; // Outermost size of all arrays below.
+ uint8*** scanlines_;
+ int* scanlines_sizes_;
+ // Temporary buffer used for decoding when we can't decode directly to the
+ // output buffers. Large enough for just one iMCU row.
+ uint8** databuf_;
+ int* databuf_strides_;
};
} // namespace libyuv
diff --git a/thirdparties/iphone/include/libyuv/libyuv/planar_functions.h b/thirdparties/iphone/include/libyuv/libyuv/planar_functions.h
index d10a169..da75f3c 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/planar_functions.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/planar_functions.h
@@ -18,7 +18,8 @@
#include "libyuv/convert_argb.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/rotate.h b/thirdparties/iphone/include/libyuv/libyuv/rotate.h
index 8af60b8..58bc1c2 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/rotate.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/rotate.h
@@ -14,22 +14,24 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported rotation.
typedef enum RotationMode {
- kRotate0 = 0, // No rotation.
- kRotate90 = 90, // Rotate 90 degrees clockwise.
- kRotate180 = 180, // Rotate 180 degrees.
- kRotate270 = 270, // Rotate 270 degrees clockwise.
-
- // Deprecated.
- kRotateNone = 0,
- kRotateClockwise = 90,
- kRotateCounterClockwise = 270,
-} RotationModeEnum;
+ kRotate0 = 0, // No rotation.
+ kRotate90 = 90, // Rotate 90 degrees clockwise.
+ kRotate180 = 180, // Rotate 180 degrees.
+ kRotate270 = 270, // Rotate 270 degrees clockwise.
+
+ // Deprecated.
+ kRotateNone = 0,
+ kRotateClockwise = 90,
+ kRotateCounterClockwise = 270,
+}
+RotationModeEnum;
// Rotate I420 frame.
LIBYUV_API
diff --git a/thirdparties/iphone/include/libyuv/libyuv/rotate_argb.h b/thirdparties/iphone/include/libyuv/libyuv/rotate_argb.h
index 660ff55..349707c 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/rotate_argb.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/rotate_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/rotate.h" // For RotationMode.
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/row.h b/thirdparties/iphone/include/libyuv/libyuv/row.h
index d81deac..97a08ff 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/row.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/row.h
@@ -16,7 +16,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -227,7 +228,7 @@ extern "C" {
// TODO(fbarchard): Port AVX2 to inline.
#if !defined(LIBYUV_DISABLE_X86) && defined(HAVE_YASM)
(defined(_M_IX86) || defined(_M_X64) || \
- defined(__x86_64__) || defined(__i386__))
+ defined(__x86_64__) || defined(__i386__))
#define HAS_MERGEUVROW_AVX2
#define HAS_MERGEUVROW_MMX
#define HAS_SPLITUVROW_AVX2
@@ -448,48 +449,48 @@ extern "C" {
#if defined(_MSC_VER) && !defined(__CLR_VER)
#define SIMD_ALIGNED(var) __declspec(align(16)) var
-typedef __declspec(align(16)) int16 vec16[8];
-typedef __declspec(align(16)) int32 vec32[4];
-typedef __declspec(align(16)) int8 vec8[16];
-typedef __declspec(align(16)) uint16 uvec16[8];
-typedef __declspec(align(16)) uint32 uvec32[4];
-typedef __declspec(align(16)) uint8 uvec8[16];
-typedef __declspec(align(32)) int16 lvec16[16];
-typedef __declspec(align(32)) int32 lvec32[8];
-typedef __declspec(align(32)) int8 lvec8[32];
-typedef __declspec(align(32)) uint16 ulvec16[16];
-typedef __declspec(align(32)) uint32 ulvec32[8];
-typedef __declspec(align(32)) uint8 ulvec8[32];
+ typedef __declspec(align(16)) int16 vec16[8];
+ typedef __declspec(align(16)) int32 vec32[4];
+ typedef __declspec(align(16)) int8 vec8[16];
+ typedef __declspec(align(16)) uint16 uvec16[8];
+ typedef __declspec(align(16)) uint32 uvec32[4];
+ typedef __declspec(align(16)) uint8 uvec8[16];
+ typedef __declspec(align(32)) int16 lvec16[16];
+ typedef __declspec(align(32)) int32 lvec32[8];
+ typedef __declspec(align(32)) int8 lvec8[32];
+ typedef __declspec(align(32)) uint16 ulvec16[16];
+ typedef __declspec(align(32)) uint32 ulvec32[8];
+ typedef __declspec(align(32)) uint8 ulvec8[32];
#elif defined(__GNUC__)
// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
#define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
-typedef int16 __attribute__((vector_size(16))) vec16;
-typedef int32 __attribute__((vector_size(16))) vec32;
-typedef int8 __attribute__((vector_size(16))) vec8;
-typedef uint16 __attribute__((vector_size(16))) uvec16;
-typedef uint32 __attribute__((vector_size(16))) uvec32;
-typedef uint8 __attribute__((vector_size(16))) uvec8;
-typedef int16 __attribute__((vector_size(32))) lvec16;
-typedef int32 __attribute__((vector_size(32))) lvec32;
-typedef int8 __attribute__((vector_size(32))) lvec8;
-typedef uint16 __attribute__((vector_size(32))) ulvec16;
-typedef uint32 __attribute__((vector_size(32))) ulvec32;
-typedef uint8 __attribute__((vector_size(32))) ulvec8;
+ typedef int16 __attribute__((vector_size(16))) vec16;
+ typedef int32 __attribute__((vector_size(16))) vec32;
+ typedef int8 __attribute__((vector_size(16))) vec8;
+ typedef uint16 __attribute__((vector_size(16))) uvec16;
+ typedef uint32 __attribute__((vector_size(16))) uvec32;
+ typedef uint8 __attribute__((vector_size(16))) uvec8;
+ typedef int16 __attribute__((vector_size(32))) lvec16;
+ typedef int32 __attribute__((vector_size(32))) lvec32;
+ typedef int8 __attribute__((vector_size(32))) lvec8;
+ typedef uint16 __attribute__((vector_size(32))) ulvec16;
+ typedef uint32 __attribute__((vector_size(32))) ulvec32;
+ typedef uint8 __attribute__((vector_size(32))) ulvec8;
#else
#define SIMD_ALIGNED(var) var
-typedef int16 vec16[8];
-typedef int32 vec32[4];
-typedef int8 vec8[16];
-typedef uint16 uvec16[8];
-typedef uint32 uvec32[4];
-typedef uint8 uvec8[16];
-typedef int16 lvec16[16];
-typedef int32 lvec32[8];
-typedef int8 lvec8[32];
-typedef uint16 ulvec16[16];
-typedef uint32 ulvec32[8];
-typedef uint8 ulvec8[32];
+ typedef int16 vec16[8];
+ typedef int32 vec32[4];
+ typedef int8 vec8[16];
+ typedef uint16 uvec16[8];
+ typedef uint32 uvec32[4];
+ typedef uint8 uvec8[16];
+ typedef int16 lvec16[16];
+ typedef int32 lvec32[8];
+ typedef int8 lvec8[32];
+ typedef uint16 ulvec16[16];
+ typedef uint32 ulvec32[8];
+ typedef uint8 ulvec8[32];
#endif
#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
@@ -560,1180 +561,1180 @@ typedef uint8 ulvec8[32];
#endif
#endif
-void I444ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_bgra,
- int width);
-void I422ToABGRRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_abgr,
- int width);
-void I422ToRGBARow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgba,
- int width);
-void I422ToRGB24Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-void I422ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb565,
- int width);
-void I422ToARGB1555Row_NEON(const uint8* src_y,
+ void I444ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb1555,
+ uint8* dst_argb,
int width);
-void I422ToARGB4444Row_NEON(const uint8* src_y,
+ void I411ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb4444,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_bgra,
+ int width);
+ void I422ToABGRRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_abgr,
+ int width);
+ void I422ToRGBARow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToRGB24Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb24,
+ int width);
+ void I422ToRAWRow_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_raw,
+ int width);
+ void I422ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb565,
+ int width);
+ void I422ToARGB1555Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb1555,
+ int width);
+ void I422ToARGB4444Row_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb4444,
+ int width);
+ void NV12ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_NEON(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_rgb565,
+ int width);
+ void NV21ToRGB565Row_NEON(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_rgb565,
+ int width);
+ void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_NEON(const uint8* src_uyvy,
+ uint8* dst_argb,
int width);
-void NV12ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_NEON(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_rgb565,
- int width);
-void NV21ToRGB565Row_NEON(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_rgb565,
- int width);
-void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_NEON(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
-void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
- int pix);
-void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int pix);
-void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24,
- uint8* dst_u, uint8* dst_v, int pix);
-void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw,
- uint8* dst_u, uint8* dst_v, int pix);
-void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555,
- uint8* dst_u, uint8* dst_v, int pix);
-void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444,
- uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
-void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix);
-void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
-void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
-void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
-void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
-void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
-void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
-void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix);
-void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
-void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
-void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
-
-void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
+ void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix);
-void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra,
+ void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra,
uint8* dst_u, uint8* dst_v, int pix);
-void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr,
+ void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr,
uint8* dst_u, uint8* dst_v, int pix);
-void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba,
+ void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba,
uint8* dst_u, uint8* dst_v, int pix);
-void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24,
+ void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24,
uint8* dst_u, uint8* dst_v, int pix);
-void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw,
+ void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw,
uint8* dst_u, uint8* dst_v, int pix);
-void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565,
+ void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
- int src_stride_argb1555,
+ void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
+ void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
+ void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
+ void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
+ void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
+ void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
+ void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
+ void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix);
+ void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
+ void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
+ void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
+
+ void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
- int src_stride_argb4444,
+ void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra,
- uint8* dst_u, uint8* dst_v, int width);
-void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr,
- uint8* dst_u, uint8* dst_v, int width);
-void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba,
- uint8* dst_u, uint8* dst_v, int width);
-void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24,
- uint8* dst_u, uint8* dst_v, int width);
-void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw,
- uint8* dst_u, uint8* dst_v, int width);
-void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555,
+ void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
+ int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
+ int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr,
uint8* dst_u, uint8* dst_v, int width);
-void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444,
+ void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba,
uint8* dst_u, uint8* dst_v, int width);
+ void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw,
+ uint8* dst_u, uint8* dst_v, int width);
+ void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
+ void ARGBToUV444Row_SSSE3(const uint8* src_argb,
uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_SSSE3(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb,
+ void ARGBToUV422Row_SSSE3(const uint8* src_argb,
uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV444Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV422Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
-void ARGBToUV411Row_C(const uint8* src_argb,
- uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV444Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV422Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
+ void ARGBToUV411Row_C(const uint8* src_argb,
+ uint8* dst_u, uint8* dst_v, int width);
-void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
-void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
-void MirrorRow_SSE2(const uint8* src, uint8* dst, int width);
-void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
-void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width);
-void MirrorRow_C(const uint8* src, uint8* dst, int width);
+ void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
+ void MirrorRow_SSE2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
+ void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width);
+ void MirrorRow_C(const uint8* src, uint8* dst, int width);
-void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int width);
+ void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int width);
-void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int width);
-
-void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
-void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
-
-void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
-void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
- int pix);
-void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+
+ void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
+ void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
+
+ void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
+ void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int pix);
+ void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
+ void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
+ int pix);
-void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
- int width);
-void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
-void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
-void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width);
+ void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
+ void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
+ int width);
-void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
-void CopyRow_AVX(const uint8* src, uint8* dst, int count);
-void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
-void CopyRow_X86(const uint8* src, uint8* dst, int count);
-void CopyRow_NEON(const uint8* src, uint8* dst, int count);
-void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
-void CopyRow_C(const uint8* src, uint8* dst, int count);
-
-void CopyRow_16_C(const uint16* src, uint16* dst, int count);
-
-void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-
-void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
-void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
-void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
-
-void SetRow_X86(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_X86(uint8* dst, uint32 v32, int width,
- int dst_stride, int height);
-void SetRow_NEON(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width,
- int dst_stride, int height);
-void SetRow_C(uint8* dst, uint32 v32, int count);
-void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
- int height);
+ void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
+ void CopyRow_AVX(const uint8* src, uint8* dst, int count);
+ void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
+ void CopyRow_X86(const uint8* src, uint8* dst, int count);
+ void CopyRow_NEON(const uint8* src, uint8* dst, int count);
+ void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
+ void CopyRow_C(const uint8* src, uint8* dst, int count);
+
+ void CopyRow_16_C(const uint16* src, uint16* dst, int count);
+
+ void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+
+ void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
+ void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
+ void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
+
+ void SetRow_X86(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_X86(uint8* dst, uint32 v32, int width,
+ int dst_stride, int height);
+ void SetRow_NEON(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width,
+ int dst_stride, int height);
+ void SetRow_C(uint8* dst, uint32 v32, int count);
+ void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
+ int height);
// ARGBShufflers for BGRAToARGB etc.
-void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb,
- const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb,
const uint8* shuffler, int pix);
-
-void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb,
- int pix);
-void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb,
- int pix);
-
-void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb,
- int pix);
-void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb,
- int pix);
-void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix);
-void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
-void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
-void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb,
- int pix);
-void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb,
+ void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+ void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ const uint8* shuffler, int pix);
+
+ void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb,
int pix);
-void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb,
+ void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb,
int pix);
-void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
-void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
-void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb,
- int pix);
-void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb,
+
+ void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb,
int pix);
-void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb,
+ void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb,
int pix);
-
-void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
-void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix);
-
-void I444ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void NV12ToARGBRow_C(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToRGB565Row_C(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_C(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_C(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void YUY2ToARGBRow_C(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_C(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_bgra,
- int width);
-void I422ToABGRRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_abgr,
- int width);
-void I422ToRGBARow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgba,
- int width);
-void I422ToRGB24Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-void I422ToARGB4444Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb4444,
- int width);
-void I422ToARGB1555Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb4444,
- int width);
-void I422ToRGB565Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb565,
- int width);
-void YToARGBRow_C(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_AVX2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_AVX2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRGBARow_AVX2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_AVX2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I444ToARGBRow_SSSE3(const uint8* src_y,
+ void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix);
+ void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
+ void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
+ void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb,
+ int pix);
+ void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb,
+ int pix);
+ void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb,
+ int pix);
+ void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
+ void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
+ void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb,
+ int pix);
+ void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb,
+ int pix);
+ void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb,
+ int pix);
+
+ void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
+ void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix);
+
+ void I444ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGBRow_SSSE3(const uint8* src_y,
+ void I422ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I411ToARGBRow_SSSE3(const uint8* src_y,
+ void I411ToARGBRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void NV12ToARGBRow_SSSE3(const uint8* src_y,
+ void NV12ToARGBRow_C(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToARGBRow_SSSE3(const uint8* src_y,
- const uint8* src_vu,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_SSSE3(const uint8* src_y,
- const uint8* src_uv,
+ void NV21ToRGB565Row_C(const uint8* src_y,
+ const uint8* src_vu,
uint8* dst_argb,
int width);
-void NV21ToRGB565Row_SSSE3(const uint8* src_y,
- const uint8* src_vu,
+ void NV12ToRGB565Row_C(const uint8* src_y,
+ const uint8* src_uv,
uint8* dst_argb,
int width);
-void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
+ void NV21ToARGBRow_C(const uint8* src_y,
+ const uint8* src_vu,
uint8* dst_argb,
int width);
-void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
+ void YUY2ToARGBRow_C(const uint8* src_yuy2,
uint8* dst_argb,
int width);
-void I422ToBGRARow_SSSE3(const uint8* src_y,
+ void UYVYToARGBRow_C(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_bgra,
int width);
-void I422ToABGRRow_SSSE3(const uint8* src_y,
+ void I422ToABGRRow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_abgr,
int width);
-void I422ToRGBARow_SSSE3(const uint8* src_y,
+ void I422ToRGBARow_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_rgba,
int width);
-void I422ToARGB4444Row_SSSE3(const uint8* src_y,
+ void I422ToRGB24Row_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgb24,
+ int width);
+ void I422ToRAWRow_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_raw,
+ int width);
+ void I422ToARGB4444Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_argb4444,
int width);
-void I422ToARGB1555Row_SSSE3(const uint8* src_y,
+ void I422ToARGB1555Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_argb4444,
int width);
-void I422ToRGB565Row_SSSE3(const uint8* src_y,
+ void I422ToRGB565Row_C(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_rgb565,
int width);
-void I422ToRGB24Row_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_rgb24,
- int width);
-void I422ToRAWRow_SSSE3(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_raw,
- int width);
-void I422ToARGBRow_Any_AVX2(const uint8* src_y,
+ void YToARGBRow_C(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_AVX2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToBGRARow_Any_AVX2(const uint8* src_y,
+ void I422ToBGRARow_AVX2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToRGBARow_Any_AVX2(const uint8* src_y,
+ void I422ToRGBARow_AVX2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToABGRRow_Any_AVX2(const uint8* src_y,
+ void I422ToABGRRow_AVX2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I444ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I422ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I411ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void I411ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void NV12ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
+ void NV21ToARGBRow_SSSE3(const uint8* src_y,
const uint8* src_vu,
uint8* dst_argb,
int width);
-void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void NV12ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
int width);
-void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void NV21ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_vu,
uint8* dst_argb,
int width);
-void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
+ void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
uint8* dst_argb,
int width);
-void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
+ void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
uint8* dst_argb,
int width);
-void I422ToBGRARow_Any_SSSE3(const uint8* src_y,
+ void I422ToBGRARow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_bgra,
int width);
-void I422ToABGRRow_Any_SSSE3(const uint8* src_y,
+ void I422ToABGRRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_abgr,
int width);
-void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
+ void I422ToRGBARow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_rgba,
int width);
-void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
+ void I422ToARGB4444Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
-void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
+ void I422ToARGB1555Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
-void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ void I422ToRGB565Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_rgba,
+ uint8* dst_argb,
int width);
-void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
+ void I422ToRGB24Row_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_rgb24,
int width);
-void I422ToRAWRow_Any_SSSE3(const uint8* src_y,
+ void I422ToRAWRow_SSSE3(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
- uint8* dst_argb,
+ uint8* dst_raw,
int width);
-void YToARGBRow_SSE2(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void YToARGBRow_NEON(const uint8* src_y,
- uint8* dst_argb,
- int width);
-void YToARGBRow_Any_SSE2(const uint8* src_y,
+ void I422ToARGBRow_Any_AVX2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Any_AVX2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGBARow_Any_AVX2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_Any_AVX2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I411ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_vu,
+ uint8* dst_argb,
+ int width);
+ void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_bgra,
+ int width);
+ void I422ToABGRRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_abgr,
+ int width);
+ void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_rgba,
+ int width);
+ void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRAWRow_Any_SSSE3(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void YToARGBRow_SSE2(const uint8* src_y,
uint8* dst_argb,
int width);
-void YToARGBRow_Any_NEON(const uint8* src_y,
+ void YToARGBRow_NEON(const uint8* src_y,
uint8* dst_argb,
int width);
+ void YToARGBRow_Any_SSE2(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
+ void YToARGBRow_Any_NEON(const uint8* src_y,
+ uint8* dst_argb,
+ int width);
// ARGB preattenuated alpha blend.
-void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
// ARGB multiply images. Same API as Blend, but these require
// pointer and width alignment for SSE2.
-void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
+ void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
// ARGB add images.
-void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
+ void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
// ARGB subtract images. Same API as Blend, but these require
// pointer and width alignment for SSE2.
-void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1,
- uint8* dst_argb, int width);
-void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+ void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1,
uint8* dst_argb, int width);
-
-void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
-
-void I444ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I411ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRGBARow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRGB24Row_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToRAWRow_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
+ void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
+ uint8* dst_argb, int width);
+
+ void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+ void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
+
+ void I444ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
+ void I422ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
-void I422ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void NV12ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToARGBRow_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void NV21ToRGB565Row_Any_NEON(const uint8* src_y,
- const uint8* src_uv,
- uint8* dst_argb,
- int width);
-void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
- uint8* dst_argb,
- int width);
-void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_argb,
- int width);
-
-void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_C(const uint8* src_yuy2,
- uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2,
+ void I411ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGBARow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGB24Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRAWRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void NV12ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToARGBRow_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void NV21ToRGB565Row_Any_NEON(const uint8* src_y,
+ const uint8* src_uv,
+ uint8* dst_argb,
+ int width);
+ void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
+ uint8* dst_argb,
+ int width);
+ void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+ void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_argb,
+ int width);
+
+ void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
+ void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2,
+ void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
+ void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
-void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2,
+ void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
+ void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_NEON(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-
-void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_C(const uint8* src_uyvy,
- uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_C(const uint8* src_yuy2,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
+ void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
+ void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy,
+ void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
+ void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
-void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy,
+ void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
+ void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_NEON(const uint8* src_uyvy,
uint8* dst_u, uint8* dst_v, int pix);
-void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer,
- uint32 selector, int pix);
-void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_C(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
+ void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+ void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
+ uint8* dst_u, uint8* dst_v, int pix);
+
+ void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer,
- uint32 selector, int pix);
-void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer,
uint32 selector, int pix);
-void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer,
- uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer,
+ uint32 selector, int pix);
+ void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ uint32 selector, int pix);
+ void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer,
uint32 /* selector */, int pix);
-void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer,
uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
+ void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
+ uint32 /* selector */, int pix);
-void I422ToYUY2Row_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_C(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_SSE2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_SSE2(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
+ void I422ToYUY2Row_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_C(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_SSE2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_yuy2, int width);
-void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
+ void I422ToUYVYRow_SSE2(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_uyvy, int width);
-void I422ToYUY2Row_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_yuy2, int width);
-void I422ToUYVYRow_NEON(const uint8* src_y,
- const uint8* src_u,
- const uint8* src_v,
- uint8* dst_uyvy, int width);
-void I422ToYUY2Row_Any_NEON(const uint8* src_y,
+ void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_yuy2, int width);
-void I422ToUYVYRow_Any_NEON(const uint8* src_y,
+ void I422ToUYVYRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_uyvy, int width);
+ void I422ToYUY2Row_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_yuy2, int width);
+ void I422ToUYVYRow_Any_NEON(const uint8* src_y,
+ const uint8* src_u,
+ const uint8* src_v,
+ uint8* dst_uyvy, int width);
// Effects related row functions.
-void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
- int width);
+ void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
+ int width);
// Inverse table for unattenuate, shared by C and SSE2.
-extern const uint32 fixed_invtbl8[256];
-void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
- int width);
-void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
- int width);
-
-void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
-void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
-
-void ARGBSepiaRow_C(uint8* dst_argb, int width);
-void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
-void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
-
-void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb,
- const int8* matrix_argb, int width);
-void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ extern const uint32 fixed_invtbl8[256];
+ void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+ void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
+ int width);
+
+ void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
+ void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
+
+ void ARGBSepiaRow_C(uint8* dst_argb, int width);
+ void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
+ void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
+
+ void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb,
const int8* matrix_argb, int width);
-void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb,
- const int8* matrix_argb, int width);
-
-void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
-void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
-
-void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
-void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
-
-void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size,
- int interval_offset, int width);
-
-void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
-void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
-void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width,
- uint32 value);
+ void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ const int8* matrix_argb, int width);
+ void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb,
+ const int8* matrix_argb, int width);
+
+ void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
+ void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
+
+ void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
+ void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
+
+ void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+ void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+ void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size,
+ int interval_offset, int width);
+
+ void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
+ void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
+ void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width,
+ uint32 value);
// Used for blur.
-void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft,
- int width, int area, uint8* dst, int count);
-void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum,
- const int32* previous_cumsum, int width);
-
-void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft,
- int width, int area, uint8* dst, int count);
-void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum,
- const int32* previous_cumsum, int width);
-
-LIBYUV_API
-void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
- uint8* dst_argb, const float* uv_dudv, int width);
-LIBYUV_API
-void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
- uint8* dst_argb, const float* uv_dudv, int width);
+ void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft,
+ int width, int area, uint8* dst, int count);
+ void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum,
+ const int32* previous_cumsum, int width);
+
+ void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft,
+ int width, int area, uint8* dst, int count);
+ void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum,
+ const int32* previous_cumsum, int width);
+
+ LIBYUV_API
+ void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
+ uint8* dst_argb, const float* uv_dudv, int width);
+ LIBYUV_API
+ void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
+ uint8* dst_argb, const float* uv_dudv, int width);
// Used for I420Scale, ARGBScale, and ARGBInterpolate.
-void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr,
- int width, int source_y_fraction);
-void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
- ptrdiff_t src_stride_ptr, int width,
- int source_y_fraction);
-void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr,
+ int width, int source_y_fraction);
+ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
+ void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride_ptr, int width,
int source_y_fraction);
-
-void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr,
- ptrdiff_t src_stride_ptr,
- int width, int source_y_fraction);
+ void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+ void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
+ ptrdiff_t src_stride_ptr, int width,
+ int source_y_fraction);
+
+ void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr,
+ ptrdiff_t src_stride_ptr,
+ int width, int source_y_fraction);
// Sobel images.
-void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2,
- uint8* dst_sobelx, int width);
-void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1,
- const uint8* src_y2, uint8* dst_sobelx, int width);
-void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1,
- const uint8* src_y2, uint8* dst_sobelx, int width);
-void SobelYRow_C(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1,
- uint8* dst_sobely, int width);
-void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_y, int width);
-void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
- uint8* dst_argb, int width);
-
-void ARGBPolynomialRow_C(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
-void ARGBPolynomialRow_SSE2(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
-void ARGBPolynomialRow_AVX2(const uint8* src_argb,
- uint8* dst_argb, const float* poly,
- int width);
+ void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2,
+ uint8* dst_sobelx, int width);
+ void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1,
+ const uint8* src_y2, uint8* dst_sobelx, int width);
+ void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1,
+ const uint8* src_y2, uint8* dst_sobelx, int width);
+ void SobelYRow_C(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1,
+ uint8* dst_sobely, int width);
+ void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_y, int width);
+ void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+ void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
+ uint8* dst_argb, int width);
+
+ void ARGBPolynomialRow_C(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
+ void ARGBPolynomialRow_SSE2(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
+ void ARGBPolynomialRow_AVX2(const uint8* src_argb,
+ uint8* dst_argb, const float* poly,
+ int width);
-void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width,
- const uint8* luma, uint32 lumacoeff);
-void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
- int width,
+ void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width,
const uint8* luma, uint32 lumacoeff);
+ void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
+ int width,
+ const uint8* luma, uint32 lumacoeff);
#ifdef __cplusplus
} // extern "C"
diff --git a/thirdparties/iphone/include/libyuv/libyuv/scale.h b/thirdparties/iphone/include/libyuv/libyuv/scale.h
index 102158d..b096962 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/scale.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/scale.h
@@ -14,17 +14,19 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
// Supported filtering.
typedef enum FilterMode {
- kFilterNone = 0, // Point sample; Fastest.
- kFilterLinear = 1, // Filter horizontally only.
- kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
- kFilterBox = 3 // Highest quality.
-} FilterModeEnum;
+ kFilterNone = 0, // Point sample; Fastest.
+ kFilterLinear = 1, // Filter horizontally only.
+ kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
+ kFilterBox = 3 // Highest quality.
+}
+FilterModeEnum;
// Scale a YUV plane.
LIBYUV_API
@@ -75,24 +77,24 @@ int I420Scale_16(const uint16* src_y, int src_stride_y,
#ifdef __cplusplus
// Legacy API. Deprecated.
-LIBYUV_API
-int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
- int src_stride_y, int src_stride_u, int src_stride_v,
- int src_width, int src_height,
- uint8* dst_y, uint8* dst_u, uint8* dst_v,
- int dst_stride_y, int dst_stride_u, int dst_stride_v,
- int dst_width, int dst_height,
- LIBYUV_BOOL interpolate);
+ LIBYUV_API
+ int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
+ int src_stride_y, int src_stride_u, int src_stride_v,
+ int src_width, int src_height,
+ uint8* dst_y, uint8* dst_u, uint8* dst_v,
+ int dst_stride_y, int dst_stride_u, int dst_stride_v,
+ int dst_width, int dst_height,
+ LIBYUV_BOOL interpolate);
// Legacy API. Deprecated.
-LIBYUV_API
-int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
- uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
- LIBYUV_BOOL interpolate);
+ LIBYUV_API
+ int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
+ uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
+ LIBYUV_BOOL interpolate);
// For testing, allow disabling of specialized scalers.
-LIBYUV_API
-void SetUseReferenceImpl(LIBYUV_BOOL use);
+ LIBYUV_API
+ void SetUseReferenceImpl(LIBYUV_BOOL use);
#endif // __cplusplus
#ifdef __cplusplus
diff --git a/thirdparties/iphone/include/libyuv/libyuv/scale_argb.h b/thirdparties/iphone/include/libyuv/libyuv/scale_argb.h
index 0c9b362..9058a78 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/scale_argb.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/scale_argb.h
@@ -15,7 +15,8 @@
#include "libyuv/scale.h" // For FilterMode
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/scale_row.h b/thirdparties/iphone/include/libyuv/libyuv/scale_row.h
index 27aa04b..9fad7f3 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/scale_row.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/scale_row.h
@@ -14,7 +14,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
diff --git a/thirdparties/iphone/include/libyuv/libyuv/video_common.h b/thirdparties/iphone/include/libyuv/libyuv/video_common.h
index 91acc2f..849c3fc 100755
--- a/thirdparties/iphone/include/libyuv/libyuv/video_common.h
+++ b/thirdparties/iphone/include/libyuv/libyuv/video_common.h
@@ -16,7 +16,8 @@
#include "libyuv/basic_types.h"
#ifdef __cplusplus
-namespace libyuv {
+namespace libyuv
+{
extern "C" {
#endif
@@ -48,131 +49,131 @@ extern "C" {
// Primary formats should convert in 1 efficient step.
// Secondary formats are converted in 2 steps.
// Auxilliary formats call primary converters.
-enum FourCC {
- // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
- FOURCC_I420 = FOURCC('I', '4', '2', '0'),
- FOURCC_I422 = FOURCC('I', '4', '2', '2'),
- FOURCC_I444 = FOURCC('I', '4', '4', '4'),
- FOURCC_I411 = FOURCC('I', '4', '1', '1'),
- FOURCC_I400 = FOURCC('I', '4', '0', '0'),
- FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
- FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
- FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
- FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
-
- // 2 Secondary YUV formats: row biplanar.
- FOURCC_M420 = FOURCC('M', '4', '2', '0'),
- FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
-
- // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp.
- FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
- FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
- FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
- FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
- FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
- FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
- FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
- FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
- FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
-
- // 4 Secondary RGB formats: 4 Bayer Patterns.
- FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
- FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
- FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
- FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
-
- // 1 Primary Compressed YUV format.
- FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
-
- // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
- FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
- FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
- FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
- FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
- FOURCC_J420 = FOURCC('J', '4', '2', '0'),
- FOURCC_J400 = FOURCC('J', '4', '0', '0'),
-
- // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
- FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
- FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
- FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
- FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
- FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
- FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
- FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
- FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
- FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
- FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
- FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
- FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
- FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
- FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
- FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
- FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
- FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
-
- // 1 Auxiliary compressed YUV format set aside for capturer.
- FOURCC_H264 = FOURCC('H', '2', '6', '4'),
-
- // Match any fourcc.
- FOURCC_ANY = -1,
-};
-
-enum FourCCBpp {
- // Canonical fourcc codes used in our code.
- FOURCC_BPP_I420 = 12,
- FOURCC_BPP_I422 = 16,
- FOURCC_BPP_I444 = 24,
- FOURCC_BPP_I411 = 12,
- FOURCC_BPP_I400 = 8,
- FOURCC_BPP_NV21 = 12,
- FOURCC_BPP_NV12 = 12,
- FOURCC_BPP_YUY2 = 16,
- FOURCC_BPP_UYVY = 16,
- FOURCC_BPP_M420 = 12,
- FOURCC_BPP_Q420 = 12,
- FOURCC_BPP_ARGB = 32,
- FOURCC_BPP_BGRA = 32,
- FOURCC_BPP_ABGR = 32,
- FOURCC_BPP_RGBA = 32,
- FOURCC_BPP_24BG = 24,
- FOURCC_BPP_RAW = 24,
- FOURCC_BPP_RGBP = 16,
- FOURCC_BPP_RGBO = 16,
- FOURCC_BPP_R444 = 16,
- FOURCC_BPP_RGGB = 8,
- FOURCC_BPP_BGGR = 8,
- FOURCC_BPP_GRBG = 8,
- FOURCC_BPP_GBRG = 8,
- FOURCC_BPP_YV12 = 12,
- FOURCC_BPP_YV16 = 16,
- FOURCC_BPP_YV24 = 24,
- FOURCC_BPP_YU12 = 12,
- FOURCC_BPP_J420 = 12,
- FOURCC_BPP_J400 = 8,
- FOURCC_BPP_MJPG = 0, // 0 means unknown.
- FOURCC_BPP_H264 = 0,
- FOURCC_BPP_IYUV = 12,
- FOURCC_BPP_YU16 = 16,
- FOURCC_BPP_YU24 = 24,
- FOURCC_BPP_YUYV = 16,
- FOURCC_BPP_YUVS = 16,
- FOURCC_BPP_HDYC = 16,
- FOURCC_BPP_2VUY = 16,
- FOURCC_BPP_JPEG = 1,
- FOURCC_BPP_DMB1 = 1,
- FOURCC_BPP_BA81 = 8,
- FOURCC_BPP_RGB3 = 24,
- FOURCC_BPP_BGR3 = 24,
- FOURCC_BPP_CM32 = 32,
- FOURCC_BPP_CM24 = 24,
-
- // Match any fourcc.
- FOURCC_BPP_ANY = 0, // 0 means unknown.
-};
+ enum FourCC {
+ // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
+ FOURCC_I420 = FOURCC('I', '4', '2', '0'),
+ FOURCC_I422 = FOURCC('I', '4', '2', '2'),
+ FOURCC_I444 = FOURCC('I', '4', '4', '4'),
+ FOURCC_I411 = FOURCC('I', '4', '1', '1'),
+ FOURCC_I400 = FOURCC('I', '4', '0', '0'),
+ FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
+ FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
+ FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
+ FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
+
+ // 2 Secondary YUV formats: row biplanar.
+ FOURCC_M420 = FOURCC('M', '4', '2', '0'),
+ FOURCC_Q420 = FOURCC('Q', '4', '2', '0'),
+
+ // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp.
+ FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
+ FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
+ FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
+ FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
+ FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
+ FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
+ FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
+ FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
+ FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
+
+ // 4 Secondary RGB formats: 4 Bayer Patterns.
+ FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
+ FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
+ FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
+ FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
+
+ // 1 Primary Compressed YUV format.
+ FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
+
+ // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
+ FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
+ FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
+ FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
+ FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
+ FOURCC_J420 = FOURCC('J', '4', '2', '0'),
+ FOURCC_J400 = FOURCC('J', '4', '0', '0'),
+
+ // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
+ FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
+ FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
+ FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
+ FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
+ FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
+ FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
+ FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
+ FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
+ FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
+ FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
+ FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
+ FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
+ FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
+ FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
+ FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
+ FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
+ FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
+
+ // 1 Auxiliary compressed YUV format set aside for capturer.
+ FOURCC_H264 = FOURCC('H', '2', '6', '4'),
+
+ // Match any fourcc.
+ FOURCC_ANY = -1,
+ };
+
+ enum FourCCBpp {
+ // Canonical fourcc codes used in our code.
+ FOURCC_BPP_I420 = 12,
+ FOURCC_BPP_I422 = 16,
+ FOURCC_BPP_I444 = 24,
+ FOURCC_BPP_I411 = 12,
+ FOURCC_BPP_I400 = 8,
+ FOURCC_BPP_NV21 = 12,
+ FOURCC_BPP_NV12 = 12,
+ FOURCC_BPP_YUY2 = 16,
+ FOURCC_BPP_UYVY = 16,
+ FOURCC_BPP_M420 = 12,
+ FOURCC_BPP_Q420 = 12,
+ FOURCC_BPP_ARGB = 32,
+ FOURCC_BPP_BGRA = 32,
+ FOURCC_BPP_ABGR = 32,
+ FOURCC_BPP_RGBA = 32,
+ FOURCC_BPP_24BG = 24,
+ FOURCC_BPP_RAW = 24,
+ FOURCC_BPP_RGBP = 16,
+ FOURCC_BPP_RGBO = 16,
+ FOURCC_BPP_R444 = 16,
+ FOURCC_BPP_RGGB = 8,
+ FOURCC_BPP_BGGR = 8,
+ FOURCC_BPP_GRBG = 8,
+ FOURCC_BPP_GBRG = 8,
+ FOURCC_BPP_YV12 = 12,
+ FOURCC_BPP_YV16 = 16,
+ FOURCC_BPP_YV24 = 24,
+ FOURCC_BPP_YU12 = 12,
+ FOURCC_BPP_J420 = 12,
+ FOURCC_BPP_J400 = 8,
+ FOURCC_BPP_MJPG = 0, // 0 means unknown.
+ FOURCC_BPP_H264 = 0,
+ FOURCC_BPP_IYUV = 12,
+ FOURCC_BPP_YU16 = 16,
+ FOURCC_BPP_YU24 = 24,
+ FOURCC_BPP_YUYV = 16,
+ FOURCC_BPP_YUVS = 16,
+ FOURCC_BPP_HDYC = 16,
+ FOURCC_BPP_2VUY = 16,
+ FOURCC_BPP_JPEG = 1,
+ FOURCC_BPP_DMB1 = 1,
+ FOURCC_BPP_BA81 = 8,
+ FOURCC_BPP_RGB3 = 24,
+ FOURCC_BPP_BGR3 = 24,
+ FOURCC_BPP_CM32 = 32,
+ FOURCC_BPP_CM24 = 24,
+
+ // Match any fourcc.
+ FOURCC_BPP_ANY = 0, // 0 means unknown.
+ };
// Converts fourcc aliases into canonical ones.
-LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
+ LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
#ifdef __cplusplus
} // extern "C"
diff --git a/thirdparties/iphone/include/net/_route.h b/thirdparties/iphone/include/net/_route.h
index a7e26c8..2d801bc 100755
--- a/thirdparties/iphone/include/net/_route.h
+++ b/thirdparties/iphone/include/net/_route.h
@@ -2,7 +2,7 @@
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
+ *
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
@@ -11,10 +11,10 @@
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
- *
+ *
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
+ *
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
@@ -22,7 +22,7 @@
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
- *
+ *
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
@@ -87,17 +87,17 @@ struct route;
* retransmission behavior and are included in the routing structure.
*/
struct rt_metrics {
- u_int32_t rmx_locks; /* Kernel must leave these values alone */
- u_int32_t rmx_mtu; /* MTU for this path */
- u_int32_t rmx_hopcount; /* max hops expected */
- int32_t rmx_expire; /* lifetime for route, e.g. redirect */
- u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
- u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
- u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
- u_int32_t rmx_rtt; /* estimated round trip time */
- u_int32_t rmx_rttvar; /* estimated rtt variance */
- u_int32_t rmx_pksent; /* packets sent using this route */
- u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
+ u_int32_t rmx_locks; /* Kernel must leave these values alone */
+ u_int32_t rmx_mtu; /* MTU for this path */
+ u_int32_t rmx_hopcount; /* max hops expected */
+ int32_t rmx_expire; /* lifetime for route, e.g. redirect */
+ u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
+ u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
+ u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
+ u_int32_t rmx_rtt; /* estimated round trip time */
+ u_int32_t rmx_rttvar; /* estimated rtt variance */
+ u_int32_t rmx_pksent; /* packets sent using this route */
+ u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
};
/*
@@ -134,57 +134,57 @@ struct rt_metrics {
#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
#define RTF_WASCLONED 0x20000 /* route generated through cloning */
#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
- /* 0x80000 unused */
+/* 0x80000 unused */
#define RTF_PINNED 0x100000 /* future use */
#define RTF_LOCAL 0x200000 /* route represents a local address */
#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */
#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */
- /* 0x4000000 and up unassigned */
+/* 0x4000000 and up unassigned */
/*
* Routing statistics.
*/
struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
+ short rts_badredirect; /* bogus redirect calls */
+ short rts_dynamic; /* routes created by redirects */
+ short rts_newgateway; /* routes modified by redirects */
+ short rts_unreach; /* lookups which failed */
+ short rts_wildcard; /* lookups satisfied by a wildcard */
};
/*
* Structures for routing messages.
*/
struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_int32_t rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_index; /* index for associated ifp */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ pid_t rtm_pid; /* identify sender */
+ int rtm_seq; /* for sender to identify action */
+ int rtm_errno; /* why failed */
+ int rtm_use; /* from rtentry */
+ u_int32_t rtm_inits; /* which metrics we are initializing */
+ struct rt_metrics rtm_rmx; /* metrics themselves */
};
struct rt_msghdr2 {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- int32_t rtm_refcnt; /* reference count */
- int rtm_parentflags; /* flags of the parent route */
- int rtm_reserved; /* reserved field set to 0 */
- int rtm_use; /* from rtentry */
- u_int32_t rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_index; /* index for associated ifp */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ int32_t rtm_refcnt; /* reference count */
+ int rtm_parentflags; /* flags of the parent route */
+ int rtm_reserved; /* reserved field set to 0 */
+ int rtm_use; /* from rtentry */
+ u_int32_t rtm_inits; /* which metrics we are initializing */
+ struct rt_metrics rtm_rmx; /* metrics themselves */
};
@@ -251,17 +251,17 @@ struct rt_msghdr2 {
#define RTAX_MAX 8 /* size of array to allocate */
struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
+ int rti_addrs;
+ struct sockaddr *rti_info[RTAX_MAX];
};
struct route_cb {
- int ip_count;
- int ip6_count;
- int ipx_count;
- int ns_count;
- int iso_count;
- int any_count;
+ int ip_count;
+ int ip6_count;
+ int ipx_count;
+ int ns_count;
+ int iso_count;
+ int any_count;
};
diff --git a/thirdparties/iphone/include/opencore-amrnb/interf_enc.h b/thirdparties/iphone/include/opencore-amrnb/interf_enc.h
index b89b0c7..42b0df4 100755
--- a/thirdparties/iphone/include/opencore-amrnb/interf_enc.h
+++ b/thirdparties/iphone/include/opencore-amrnb/interf_enc.h
@@ -26,16 +26,16 @@ extern "C" {
#ifndef AMRNB_WRAPPER_INTERNAL
/* Copied from enc/src/gsmamr_enc.h */
enum Mode {
- MR475 = 0,/* 4.75 kbps */
- MR515, /* 5.15 kbps */
- MR59, /* 5.90 kbps */
- MR67, /* 6.70 kbps */
- MR74, /* 7.40 kbps */
- MR795, /* 7.95 kbps */
- MR102, /* 10.2 kbps */
- MR122, /* 12.2 kbps */
- MRDTX, /* DTX */
- N_MODES /* Not Used */
+ MR475 = 0,/* 4.75 kbps */
+ MR515, /* 5.15 kbps */
+ MR59, /* 5.90 kbps */
+ MR67, /* 6.70 kbps */
+ MR74, /* 7.40 kbps */
+ MR795, /* 7.95 kbps */
+ MR102, /* 10.2 kbps */
+ MR122, /* 12.2 kbps */
+ MRDTX, /* DTX */
+ N_MODES /* Not Used */
};
#endif
diff --git a/thirdparties/iphone/include/speex/speex.h b/thirdparties/iphone/include/speex/speex.h
index 82ba016..0eb560e 100755
--- a/thirdparties/iphone/include/speex/speex.h
+++ b/thirdparties/iphone/include/speex/speex.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
-/** Struct defining a Speex mode */
+/** Struct defining a Speex mode */
typedef struct SpeexMode {
- /** Pointer to the low-level mode data */
- const void *mode;
+ /** Pointer to the low-level mode data */
+ const void *mode;
+
+ /** Pointer to the mode query function */
+ mode_query_func query;
- /** Pointer to the mode query function */
- mode_query_func query;
-
- /** The name of the mode (you should not rely on this to identify the mode)*/
- const char *modeName;
+ /** The name of the mode (you should not rely on this to identify the mode)*/
+ const char *modeName;
- /**ID of the mode*/
- int modeID;
+ /**ID of the mode*/
+ int modeID;
- /**Version number of the bitstream (incremented every time we break
- bitstream compatibility*/
- int bitstream_version;
+ /**Version number of the bitstream (incremented every time we break
+ bitstream compatibility*/
+ int bitstream_version;
- /** Pointer to encoder initialization function */
- encoder_init_func enc_init;
+ /** Pointer to encoder initialization function */
+ encoder_init_func enc_init;
- /** Pointer to encoder destruction function */
- encoder_destroy_func enc_destroy;
+ /** Pointer to encoder destruction function */
+ encoder_destroy_func enc_destroy;
- /** Pointer to frame encoding function */
- encode_func enc;
+ /** Pointer to frame encoding function */
+ encode_func enc;
- /** Pointer to decoder initialization function */
- decoder_init_func dec_init;
+ /** Pointer to decoder initialization function */
+ decoder_init_func dec_init;
- /** Pointer to decoder destruction function */
- decoder_destroy_func dec_destroy;
+ /** Pointer to decoder destruction function */
+ decoder_destroy_func dec_destroy;
- /** Pointer to frame decoding function */
- decode_func dec;
+ /** Pointer to frame decoding function */
+ decode_func dec;
- /** ioctl-like requests for encoder */
- encoder_ctl_func enc_ctl;
+ /** ioctl-like requests for encoder */
+ encoder_ctl_func enc_ctl;
- /** ioctl-like requests for decoder */
- decoder_ctl_func dec_ctl;
+ /** ioctl-like requests for decoder */
+ decoder_ctl_func dec_ctl;
} SpeexMode;
/**
- * Returns a handle to a newly created Speex encoder state structure. For now,
- * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
- * may be added. Note that for now if you have more than one channels to
+ * Returns a handle to a newly created Speex encoder state structure. For now,
+ * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
+ * may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
- * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
+ * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
-/** Frees all resources associated to an existing Speex encoder state.
+/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
- @param in Frame that will be encoded with a +-2^15 range. This data MAY be
- overwritten by the encoder and should be considered uninitialised
+ @param in Frame that will be encoded with a +-2^15 range. This data MAY be
+ overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
@@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int speex_encoder_ctl(void *state, int request, void *ptr);
-/** Returns a handle to a newly created decoder state structure. For now,
+/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
- */
+ */
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
diff --git a/thirdparties/iphone/include/speex/speex_bits.h b/thirdparties/iphone/include/speex/speex_bits.h
index a26fb4c..dd3b752 100755
--- a/thirdparties/iphone/include/speex/speex_bits.h
+++ b/thirdparties/iphone/include/speex/speex_bits.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,15 +47,15 @@ extern "C" {
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
- char *chars; /**< "raw" data */
- int nbBits; /**< Total number of bits stored in the stream*/
- int charPtr; /**< Position of the byte "cursor" */
- int bitPtr; /**< Position of the bit "cursor" within the current char */
- int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
- int overflow;/**< Set to one if we try to read past the valid data */
- int buf_size;/**< Allocated size for buffer */
- int reserved1; /**< Reserved for future use */
- void *reserved2; /**< Reserved for future use */
+ char *chars; /**< "raw" data */
+ int nbBits; /**< Total number of bits stored in the stream*/
+ int charPtr; /**< Position of the byte "cursor" */
+ int bitPtr; /**< Position of the bit "cursor" within the current char */
+ int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
+ int overflow;/**< Set to one if we try to read past the valid data */
+ int buf_size;/**< Allocated size for buffer */
+ int reserved1; /**< Reserved for future use */
+ void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int speex_bits_nbytes(SpeexBits *bits);
-/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
- *
+/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
+ *
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
- * "cursor" position
- *
+ * "cursor" position
+ *
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
-/** Advances the position of the "bit cursor" in the stream
+/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int speex_bits_remaining(SpeexBits *bits);
-/** Insert a terminator so that the data can be sent as a packet while auto-detecting
- * the number of frames in each packet
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting
+ * the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
diff --git a/thirdparties/iphone/include/speex/speex_buffer.h b/thirdparties/iphone/include/speex/speex_buffer.h
index df56f5f..909bd6d 100755
--- a/thirdparties/iphone/include/speex/speex_buffer.h
+++ b/thirdparties/iphone/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/thirdparties/iphone/include/speex/speex_callbacks.h b/thirdparties/iphone/include/speex/speex_callbacks.h
index 6f450b3..27b5649 100755
--- a/thirdparties/iphone/include/speex/speex_callbacks.h
+++ b/thirdparties/iphone/include/speex/speex_callbacks.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
- int callback_id; /**< ID associated to the callback */
- speex_callback_func func; /**< Callback handler function */
- void *data; /**< Data that will be sent to the handler */
- void *reserved1; /**< Reserved for future use */
- int reserved2; /**< Reserved for future use */
+ int callback_id; /**< ID associated to the callback */
+ speex_callback_func func; /**< Callback handler function */
+ void *data; /**< Data that will be sent to the handler */
+ void *reserved1; /**< Reserved for future use */
+ int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
diff --git a/thirdparties/iphone/include/speex/speex_echo.h b/thirdparties/iphone/include/speex/speex_echo.h
index 53bcd28..582e1cc 100755
--- a/thirdparties/iphone/include/speex/speex_echo.h
+++ b/thirdparties/iphone/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/thirdparties/iphone/include/speex/speex_header.h b/thirdparties/iphone/include/speex/speex_header.h
index f85b249..4cc15df 100755
--- a/thirdparties/iphone/include/speex/speex_header.h
+++ b/thirdparties/iphone/include/speex/speex_header.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,21 +57,21 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
- char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
- char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
- spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
- spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
- spx_int32_t rate; /**< Sampling rate used */
- spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
- spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
- spx_int32_t nb_channels; /**< Number of channels encoded */
- spx_int32_t bitrate; /**< Bit-rate used */
- spx_int32_t frame_size; /**< Size of frames */
- spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
- spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
- spx_int32_t extra_headers; /**< Number of additional headers after the comments */
- spx_int32_t reserved1; /**< Reserved for future use, must be zero */
- spx_int32_t reserved2; /**< Reserved for future use, must be zero */
+ char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
+ char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
+ spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
+ spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
+ spx_int32_t rate; /**< Sampling rate used */
+ spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
+ spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
+ spx_int32_t nb_channels; /**< Number of channels encoded */
+ spx_int32_t bitrate; /**< Bit-rate used */
+ spx_int32_t frame_size; /**< Size of frames */
+ spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
+ spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
+ spx_int32_t extra_headers; /**< Number of additional headers after the comments */
+ spx_int32_t reserved1; /**< Reserved for future use, must be zero */
+ spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
diff --git a/thirdparties/iphone/include/speex/speex_jitter.h b/thirdparties/iphone/include/speex/speex_jitter.h
index d68674b..e6f0321 100755
--- a/thirdparties/iphone/include/speex/speex_jitter.h
+++ b/thirdparties/iphone/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
- char *data; /**< Data bytes contained in the packet */
- spx_uint32_t len; /**< Length of the packet in bytes */
- spx_uint32_t timestamp; /**< Timestamp for the packet */
- spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
- spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
- spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
+ char *data; /**< Data bytes contained in the packet */
+ spx_uint32_t len; /**< Length of the packet in bytes */
+ spx_uint32_t timestamp; /**< Timestamp for the packet */
+ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
+ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
+ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/iphone/include/speex/speex_preprocess.h b/thirdparties/iphone/include/speex/speex_preprocess.h
index f8eef2c..5cd3710 100755
--- a/thirdparties/iphone/include/speex/speex_preprocess.h
+++ b/thirdparties/iphone/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/iphone/include/speex/speex_resampler.h b/thirdparties/iphone/include/speex/speex_resampler.h
index 54eef8d..4aefa61 100755
--- a/thirdparties/iphone/include/speex/speex_resampler.h
+++ b/thirdparties/iphone/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,7 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
@@ -99,13 +99,13 @@ extern "C" {
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
- RESAMPLER_ERR_SUCCESS = 0,
- RESAMPLER_ERR_ALLOC_FAILED = 1,
- RESAMPLER_ERR_BAD_STATE = 2,
- RESAMPLER_ERR_INVALID_ARG = 3,
- RESAMPLER_ERR_PTR_OVERLAP = 4,
-
- RESAMPLER_ERR_MAX_ERROR
+ RESAMPLER_ERR_SUCCESS = 0,
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
+ RESAMPLER_ERR_BAD_STATE = 2,
+ RESAMPLER_ERR_INVALID_ARG = 3,
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
+
+ RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
@@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
-
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
+
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
/** Destroy a resampler state.
* @param st Resampler state
@@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
@@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
- int quality);
+int speex_resampler_set_quality(SpeexResamplerState *st,
+ int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
- spx_uint32_t stride);
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
+ spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
- spx_uint32_t *stride);
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
+ spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
@@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/thirdparties/iphone/include/speex/speex_stereo.h b/thirdparties/iphone/include/speex/speex_stereo.h
index a259713..f33704d 100755
--- a/thirdparties/iphone/include/speex/speex_stereo.h
+++ b/thirdparties/iphone/include/speex/speex_stereo.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -48,12 +48,12 @@ extern "C" {
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
- float balance; /**< Left/right balance info */
- float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
- float smooth_left; /**< Smoothed left channel gain */
- float smooth_right; /**< Smoothed right channel gain */
- float reserved1; /**< Reserved for future use */
- float reserved2; /**< Reserved for future use */
+ float balance; /**< Left/right balance info */
+ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
+ float smooth_left; /**< Smoothed left channel gain */
+ float smooth_right; /**< Smoothed right channel gain */
+ float reserved1; /**< Reserved for future use */
+ float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
diff --git a/thirdparties/iphone/include/speex/speex_types.h b/thirdparties/iphone/include/speex/speex_types.h
index 737c5fa..b262aac 100755
--- a/thirdparties/iphone/include/speex/speex_types.h
+++ b/thirdparties/iphone/include/speex/speex_types.h
@@ -22,107 +22,107 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t spx_int32_t;
- typedef _G_uint32_t spx_uint32_t;
- typedef _G_int16_t spx_int16_t;
- typedef _G_uint16_t spx_uint16_t;
+typedef _G_int32_t spx_int32_t;
+typedef _G_uint32_t spx_uint32_t;
+typedef _G_int16_t spx_int16_t;
+typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int32 spx_int32_t;
- typedef unsigned __int32 spx_uint32_t;
- typedef __int16 spx_int16_t;
- typedef unsigned __int16 spx_uint16_t;
+/* MSVC/Borland */
+typedef __int32 spx_int32_t;
+typedef unsigned __int32 spx_uint32_t;
+typedef __int16 spx_int16_t;
+typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 spx_int16_t;
- typedef UInt16 spx_uint16_t;
- typedef SInt32 spx_int32_t;
- typedef UInt32 spx_uint32_t;
+typedef SInt16 spx_int16_t;
+typedef UInt16 spx_uint16_t;
+typedef SInt32 spx_int32_t;
+typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* OS/2 GCC */
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short spx_int16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* DJGPP */
+typedef short spx_int16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef int spx_int32_t;
- typedef unsigned spx_uint32_t;
- typedef short spx_int16_t;
+/* PS2 EE */
+typedef int spx_int32_t;
+typedef unsigned spx_uint32_t;
+typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef signed int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* Symbian GCC */
+typedef signed short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef signed int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef long spx_int32_t;
- typedef unsigned long spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef long spx_int32_t;
+typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif ANDROID
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#else
diff --git a/thirdparties/iphone/include/srtp/aes.h b/thirdparties/iphone/include/srtp/aes.h
index 2881337..97fdb63 100755
--- a/thirdparties/iphone/include/srtp/aes.h
+++ b/thirdparties/iphone/include/srtp/aes.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -55,19 +55,19 @@
/* aes internals */
typedef struct {
- v128_t round[15];
- int num_rounds;
+ v128_t round[15];
+ int num_rounds;
} aes_expanded_key_t;
err_status_t
aes_expand_encryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
err_status_t
aes_expand_decryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
void
aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
@@ -77,7 +77,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
#if 0
/*
- * internal functions
+ * internal functions
*/
void
@@ -85,6 +85,6 @@ aes_init_sbox(void);
void
aes_compute_tables(void);
-#endif
+#endif
#endif /* _AES_H */
diff --git a/thirdparties/iphone/include/srtp/aes_cbc.h b/thirdparties/iphone/include/srtp/aes_cbc.h
index bc4e41a..7abd6d6 100755
--- a/thirdparties/iphone/include/srtp/aes_cbc.h
+++ b/thirdparties/iphone/include/srtp/aes_cbc.h
@@ -15,36 +15,36 @@
#include "cipher.h"
typedef struct {
- v128_t state; /* cipher chaining state */
- v128_t previous; /* previous ciphertext block */
- aes_expanded_key_t expanded_key; /* the cipher key */
+ v128_t state; /* cipher chaining state */
+ v128_t previous; /* previous ciphertext block */
+ aes_expanded_key_t expanded_key; /* the cipher key */
} aes_cbc_ctx_t;
err_status_t
aes_cbc_set_key(aes_cbc_ctx_t *c,
- const unsigned char *key);
+ const unsigned char *key);
err_status_t
-aes_cbc_encrypt(aes_cbc_ctx_t *c,
- unsigned char *buf,
- unsigned int *bytes_in_data);
+aes_cbc_encrypt(aes_cbc_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *bytes_in_data);
err_status_t
-aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
- int key_len, cipher_direction_t dir);
+aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
+ int key_len, cipher_direction_t dir);
err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv);
err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
#endif /* AES_CBC_H */
diff --git a/thirdparties/iphone/include/srtp/aes_icm.h b/thirdparties/iphone/include/srtp/aes_icm.h
index dac0cdc..6ed032e 100755
--- a/thirdparties/iphone/include/srtp/aes_icm.h
+++ b/thirdparties/iphone/include/srtp/aes_icm.h
@@ -15,43 +15,43 @@
#include "cipher.h"
typedef struct {
- v128_t counter; /* holds the counter value */
- v128_t offset; /* initial offset value */
- v128_t keystream_buffer; /* buffers bytes of keystream */
- aes_expanded_key_t expanded_key; /* the cipher key */
- int bytes_in_buffer; /* number of unused bytes in buffer */
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
} aes_icm_ctx_t;
err_status_t
aes_icm_context_init(aes_icm_ctx_t *c,
- const unsigned char *key,
- int key_len);
+ const unsigned char *key,
+ int key_len);
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv);
err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
aes_icm_output(aes_icm_ctx_t *c,
- unsigned char *buf, int bytes_to_output);
+ unsigned char *buf, int bytes_to_output);
-err_status_t
+err_status_t
aes_icm_dealloc(cipher_t *c);
-
-err_status_t
-aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
- unsigned char *buf,
- unsigned int *enc_len,
- int forIsmacryp);
-
-err_status_t
-aes_icm_alloc_ismacryp(cipher_t **c,
- int key_len,
- int forIsmacryp);
+
+err_status_t
+aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *enc_len,
+ int forIsmacryp);
+
+err_status_t
+aes_icm_alloc_ismacryp(cipher_t **c,
+ int key_len,
+ int forIsmacryp);
#endif /* AES_ICM_H */
diff --git a/thirdparties/iphone/include/srtp/alloc.h b/thirdparties/iphone/include/srtp/alloc.h
index 5980eed..306e5f4 100755
--- a/thirdparties/iphone/include/srtp/alloc.h
+++ b/thirdparties/iphone/include/srtp/alloc.h
@@ -1,32 +1,32 @@
/*
* alloc.h
*
- * interface to memory allocation and deallocation, with optional debugging
+ * interface to memory allocation and deallocation, with optional debugging
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/iphone/include/srtp/auth.h b/thirdparties/iphone/include/srtp/auth.h
index 5b5e4b2..4d03d08 100755
--- a/thirdparties/iphone/include/srtp/auth.h
+++ b/thirdparties/iphone/include/srtp/auth.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "err.h" /* error codes */
#include "crypto.h" /* for auth_type_id_t */
#include "crypto_types.h" /* for values of auth_type_id_t */
@@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer;
typedef struct auth_t *auth_pointer_t;
typedef err_status_t (*auth_alloc_func)
- (auth_pointer_t *ap, int key_len, int out_len);
+(auth_pointer_t *ap, int key_len, int out_len);
typedef err_status_t (*auth_init_func)
- (void *state, const uint8_t *key, int key_len);
+(void *state, const uint8_t *key, int key_len);
typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap);
typedef err_status_t (*auth_compute_func)
- (void *state, uint8_t *buffer, int octets_to_auth,
- int tag_len, uint8_t *tag);
+(void *state, uint8_t *buffer, int octets_to_auth,
+ int tag_len, uint8_t *tag);
typedef err_status_t (*auth_update_func)
- (void *state, uint8_t *buffer, int octets_to_auth);
+(void *state, uint8_t *buffer, int octets_to_auth);
typedef err_status_t (*auth_start_func)(void *state);
-
+
/* some syntactic sugar on these function types */
#define auth_type_alloc(at, a, klen, outlen) \
@@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a);
*/
typedef struct auth_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- int data_length_octets; /* octets in data */
- uint8_t *data; /* data */
- int tag_length_octets; /* octets in tag */
- uint8_t *tag; /* tag */
- struct auth_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ int data_length_octets; /* octets in data */
+ uint8_t *data; /* data */
+ int tag_length_octets; /* octets in tag */
+ uint8_t *tag; /* tag */
+ struct auth_test_case_t *next_test_case; /* pointer to next testcase */
} auth_test_case_t;
/* auth_type_t */
typedef struct auth_type_t {
- auth_alloc_func alloc;
- auth_dealloc_func dealloc;
- auth_init_func init;
- auth_compute_func compute;
- auth_update_func update;
- auth_start_func start;
- char *description;
- int ref_count;
- auth_test_case_t *test_data;
- debug_module_t *debug;
- auth_type_id_t id;
+ auth_alloc_func alloc;
+ auth_dealloc_func dealloc;
+ auth_init_func init;
+ auth_compute_func compute;
+ auth_update_func update;
+ auth_start_func start;
+ char *description;
+ int ref_count;
+ auth_test_case_t *test_data;
+ debug_module_t *debug;
+ auth_type_id_t id;
} auth_type_t;
typedef struct auth_t {
- auth_type_t *type;
- void *state;
- int out_len; /* length of output tag in octets */
- int key_len; /* length of key in octets */
- int prefix_len; /* length of keystream prefix */
+ auth_type_t *type;
+ void *state;
+ int out_len; /* length of output tag in octets */
+ int key_len; /* length of key in octets */
+ int prefix_len; /* length of keystream prefix */
} auth_t;
-/*
+/*
* auth_type_self_test() tests an auth_type against test cases
* provided in an array of values of key/message/tag that is known to
* be good
@@ -151,7 +151,7 @@ typedef struct auth_t {
err_status_t
auth_type_self_test(const auth_type_t *at);
-/*
+/*
* auth_type_test() tests an auth_type against external test cases
* provided in an array of values of key/message/tag that is known to
* be good
diff --git a/thirdparties/iphone/include/srtp/cipher.h b/thirdparties/iphone/include/srtp/cipher.h
index eff6dd1..9529153 100755
--- a/thirdparties/iphone/include/srtp/cipher.h
+++ b/thirdparties/iphone/include/srtp/cipher.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CIPHER_H
#define CIPHER_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "rdbx.h" /* for xtd_seq_num_t */
#include "err.h" /* for error codes */
#include "crypto.h" /* for cipher_type_id_t */
@@ -54,17 +54,17 @@
/**
- * @brief cipher_direction_t defines a particular cipher operation.
+ * @brief cipher_direction_t defines a particular cipher operation.
*
* A cipher_direction_t is an enum that describes a particular cipher
* operation, i.e. encryption or decryption. For some ciphers, this
* distinction does not matter, but for others, it is essential.
*/
-typedef enum {
- direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
- direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
- direction_any /**< encryption or decryption */
+typedef enum {
+ direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
+ direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
+ direction_any /**< encryption or decryption */
} cipher_direction_t;
/*
@@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t;
typedef struct cipher_t *cipher_pointer_t;
/*
- * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
+ * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
*/
typedef err_status_t (*cipher_alloc_func_t)
- (cipher_pointer_t *cp, int key_len);
+(cipher_pointer_t *cp, int key_len);
-/*
+/*
* a cipher_init_func_t [re-]initializes a cipher_t with a given key
* and direction (i.e., encrypt or decrypt)
*/
@@ -97,24 +97,24 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp);
/* a cipher_set_segment_func_t sets the segment index of a cipher_t */
typedef err_status_t (*cipher_set_segment_func_t)
- (void *state, xtd_seq_num_t idx);
+(void *state, xtd_seq_num_t idx);
/* a cipher_encrypt_func_t encrypts data in-place */
typedef err_status_t (*cipher_encrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
/* a cipher_decrypt_func_t decrypts data in-place */
typedef err_status_t (*cipher_decrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
-/*
+/*
* a cipher_set_iv_func_t function sets the current initialization vector
*/
typedef err_status_t (*cipher_set_iv_func_t)
- (cipher_pointer_t cp, void *iv);
+(cipher_pointer_t cp, void *iv);
/*
* cipher_test_case_t is a (list of) key, salt, xtd_seq_num_t,
@@ -125,30 +125,30 @@ typedef err_status_t (*cipher_set_iv_func_t)
*/
typedef struct cipher_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- uint8_t *idx; /* packet index */
- int plaintext_length_octets; /* octets in plaintext */
- uint8_t *plaintext; /* plaintext */
- int ciphertext_length_octets; /* octets in plaintext */
- uint8_t *ciphertext; /* ciphertext */
- struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ uint8_t *idx; /* packet index */
+ int plaintext_length_octets; /* octets in plaintext */
+ uint8_t *plaintext; /* plaintext */
+ int ciphertext_length_octets; /* octets in plaintext */
+ uint8_t *ciphertext; /* ciphertext */
+ struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
} cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t {
- cipher_alloc_func_t alloc;
- cipher_dealloc_func_t dealloc;
- cipher_init_func_t init;
- cipher_encrypt_func_t encrypt;
- cipher_encrypt_func_t decrypt;
- cipher_set_iv_func_t set_iv;
- char *description;
- int ref_count;
- cipher_test_case_t *test_data;
- debug_module_t *debug;
- cipher_type_id_t id;
+ cipher_alloc_func_t alloc;
+ cipher_dealloc_func_t dealloc;
+ cipher_init_func_t init;
+ cipher_encrypt_func_t encrypt;
+ cipher_encrypt_func_t decrypt;
+ cipher_set_iv_func_t set_iv;
+ char *description;
+ int ref_count;
+ cipher_test_case_t *test_data;
+ debug_module_t *debug;
+ cipher_type_id_t id;
} cipher_type_t;
/*
@@ -157,11 +157,11 @@ typedef struct cipher_type_t {
*/
typedef struct cipher_t {
- cipher_type_t *type;
- void *state;
- int key_len;
+ cipher_type_t *type;
+ void *state;
+ int key_len;
#ifdef FORCE_64BIT_ALIGN
- int pad;
+ int pad;
#endif
} cipher_t;
@@ -181,7 +181,7 @@ typedef struct cipher_t {
#define cipher_set_iv(c, n) \
((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output);
@@ -193,9 +193,9 @@ int
cipher_get_key_length(const cipher_t *c);
-/*
- * cipher_type_self_test() tests a cipher against test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_self_test() tests a cipher against test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -203,9 +203,9 @@ err_status_t
cipher_type_self_test(const cipher_type_t *ct);
-/*
- * cipher_type_test() tests a cipher against external test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_test() tests a cipher against external test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -216,7 +216,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data);
/*
* cipher_bits_per_second(c, l, t) computes (and estimate of) the
* number of bits that a cipher implementation can encrypt in a second
- *
+ *
* c is a cipher (which MUST be allocated and initialized already), l
* is the length in octets of the test data to be encrypted, and t is
* the number of trials
diff --git a/thirdparties/iphone/include/srtp/crypto.h b/thirdparties/iphone/include/srtp/crypto.h
index 0e9667d..9d656fa 100755
--- a/thirdparties/iphone/include/srtp/crypto.h
+++ b/thirdparties/iphone/include/srtp/crypto.h
@@ -2,7 +2,7 @@
* crypto.h
*
* API for libcrypto
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -10,7 +10,7 @@
#ifndef CRYPTO_H
#define CRYPTO_H
-/**
+/**
* @brief A cipher_type_id_t is an identifier for a particular cipher
* type.
*
@@ -19,10 +19,10 @@
* NULL_CIPHER is avaliable; this cipher leaves the data unchanged,
* and can be selected to indicate that no encryption is to take
* place.
- *
+ *
* @ingroup Ciphers
*/
-typedef uint32_t cipher_type_id_t;
+typedef uint32_t cipher_type_id_t;
/**
* @brief An auth_type_id_t is an identifier for a particular authentication
@@ -33,7 +33,7 @@ typedef uint32_t cipher_type_id_t;
* avaliable; this authentication function performs no computation,
* and can be selected to indicate that no authentication is to take
* place.
- *
+ *
* @ingroup Authentication
*/
typedef uint32_t auth_type_id_t;
diff --git a/thirdparties/iphone/include/srtp/crypto_kernel.h b/thirdparties/iphone/include/srtp/crypto_kernel.h
index 1acf497..c496174 100755
--- a/thirdparties/iphone/include/srtp/crypto_kernel.h
+++ b/thirdparties/iphone/include/srtp/crypto_kernel.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,9 +46,9 @@
#ifndef CRYPTO_KERNEL
#define CRYPTO_KERNEL
-#include "rand_source.h"
+#include "rand_source.h"
#include "prng.h"
-#include "cipher.h"
+#include "cipher.h"
#include "auth.h"
#include "cryptoalg.h"
#include "stat.h"
@@ -65,37 +65,37 @@
*/
typedef enum {
- crypto_kernel_state_insecure,
- crypto_kernel_state_secure
+ crypto_kernel_state_insecure,
+ crypto_kernel_state_secure
} crypto_kernel_state_t;
-/*
- * linked list of cipher types
+/*
+ * linked list of cipher types
*/
typedef struct kernel_cipher_type {
- cipher_type_id_t id;
- cipher_type_t *cipher_type;
- struct kernel_cipher_type *next;
+ cipher_type_id_t id;
+ cipher_type_t *cipher_type;
+ struct kernel_cipher_type *next;
} kernel_cipher_type_t;
-/*
- * linked list of auth types
+/*
+ * linked list of auth types
*/
typedef struct kernel_auth_type {
- auth_type_id_t id;
- auth_type_t *auth_type;
- struct kernel_auth_type *next;
+ auth_type_id_t id;
+ auth_type_t *auth_type;
+ struct kernel_auth_type *next;
} kernel_auth_type_t;
/*
- * linked list of debug modules
+ * linked list of debug modules
*/
typedef struct kernel_debug_module {
- debug_module_t *mod;
- struct kernel_debug_module *next;
+ debug_module_t *mod;
+ struct kernel_debug_module *next;
} kernel_debug_module_t;
@@ -107,10 +107,10 @@ typedef struct kernel_debug_module {
*/
typedef struct {
- crypto_kernel_state_t state; /* current state of kernel */
- kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
- kernel_auth_type_t *auth_type_list; /* list of all auth func types */
- kernel_debug_module_t *debug_module_list; /* list of all debug modules */
+ crypto_kernel_state_t state; /* current state of kernel */
+ kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
+ kernel_auth_type_t *auth_type_list; /* list of all auth func types */
+ kernel_debug_module_t *debug_module_list; /* list of all debug modules */
} crypto_kernel_t;
@@ -125,10 +125,10 @@ typedef struct {
* crypto algorithms. Possible return values are:
*
* err_status_ok initialization successful
- * <other> init failure
+ * <other> init failure
*
* If any value other than err_status_ok is returned, the
- * crypto_kernel MUST NOT be used.
+ * crypto_kernel MUST NOT be used.
*/
err_status_t
@@ -142,7 +142,7 @@ crypto_kernel_init(void);
* values are:
*
* err_status_ok shutdown successful
- * <other> shutdown failure
+ * <other> shutdown failure
*
*/
@@ -155,7 +155,7 @@ crypto_kernel_shutdown(void);
* status report. Possible return values are:
*
* err_status_ok all tests were passed
- * <other> a test failed
+ * <other> a test failed
*
*/
@@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id);
/*
* crypto_kernel_replace_cipher_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the cipher_type id
* with a new one passed in externally. The new cipher must pass all the
* existing cipher_type's self tests as well as its own.
@@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id);
/*
* crypto_kernel_replace_auth_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the auth_type id
* with a new one passed in externally. The new auth type must pass all the
* existing auth_type's self tests as well as its own.
@@ -208,43 +208,43 @@ err_status_t
crypto_kernel_load_debug_module(debug_module_t *new_dm);
/*
- * crypto_kernel_alloc_cipher(id, cp, key_len);
+ * crypto_kernel_alloc_cipher(id, cp, key_len);
*
* allocates a cipher of type id at location *cp, with key length
* key_len octets. Return values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find cipher with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_cipher(cipher_type_id_t id,
- cipher_pointer_t *cp,
- int key_len);
+crypto_kernel_alloc_cipher(cipher_type_id_t id,
+ cipher_pointer_t *cp,
+ int key_len);
/*
- * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
+ * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
*
* allocates an auth function of type id at location *ap, with key
* length key_len octets and output tag length of tag_len. Return
* values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find auth with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_auth(auth_type_id_t id,
- auth_pointer_t *ap,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_auth(auth_type_id_t id,
+ auth_pointer_t *ap,
+ int key_len,
+ int tag_len);
/*
* crypto_kernel_set_debug_module(mod_name, v)
- *
+ *
* sets dynamic debugging to the value v (0 for off, 1 for on) for the
* debug module with the name mod_name
*
@@ -261,7 +261,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
- *
+ *
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
@@ -276,5 +276,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);
-
+
#endif /* CRYPTO_KERNEL */
diff --git a/thirdparties/iphone/include/srtp/crypto_math.h b/thirdparties/iphone/include/srtp/crypto_math.h
index 52f0837..4de3912 100755
--- a/thirdparties/iphone/include/srtp/crypto_math.h
+++ b/thirdparties/iphone/include/srtp/crypto_math.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ hex_string_to_v64(char *s);
/* the matrix A[] is stored in column format, i.e., A[i] is
the ith column of the matrix */
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
void
@@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
-/*
+/*
* the matrix A[] is stored in column format, i.e., A[i] is the ith
* column of the matrix
*/
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
@@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-
-#endif /* WORDS_BIGENDIAN */
+
+#endif /* WORDS_BIGENDIAN */
#endif
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
@@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -202,7 +202,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -211,10 +211,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
diff --git a/thirdparties/iphone/include/srtp/crypto_types.h b/thirdparties/iphone/include/srtp/crypto_types.h
index 3531710..06a05dc 100755
--- a/thirdparties/iphone/include/srtp/crypto_types.h
+++ b/thirdparties/iphone/include/srtp/crypto_types.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,14 +57,14 @@
* (UST) must be used in conjunction with a cipher other than the null
* cipher. These functions require a per-message pseudorandom input
* that is generated by the cipher.
- *
+ *
* The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the
* strongest available authentication function and cipher,
* respectively. They are resolved at compile time to the strongest
* available algorithm. The stronghold algorithms can serve as did
* the keep of a medieval fortification; they provide the strongest
* defense (or the last refuge).
- *
+ *
* @{
*/
@@ -72,7 +72,7 @@
* @defgroup Ciphers Cipher Types
*
* @brief Each cipher type is identified by an unsigned integer. The
- * cipher types available in this edition of libSRTP are given
+ * cipher types available in this edition of libSRTP are given
* by the #defines below.
*
* A cipher_type_id_t is an identifier for a cipher_type; only values
@@ -90,56 +90,56 @@
/**
* @brief The null cipher performs no encryption.
*
- * The NULL_CIPHER leaves its inputs unaltered, during both the
+ * The NULL_CIPHER leaves its inputs unaltered, during both the
* encryption and decryption operations. This cipher can be chosen
* to indicate that no encryption is to be performed.
*/
-#define NULL_CIPHER 0
+#define NULL_CIPHER 0
-/**
- * @brief AES Integer Counter Mode (AES ICM)
+/**
+ * @brief AES Integer Counter Mode (AES ICM)
*
- * AES ICM is the variant of counter mode that is used by Secure RTP.
+ * AES ICM is the variant of counter mode that is used by Secure RTP.
* This cipher uses a 16-, 24-, or 32-octet key concatenated with a
* 14-octet offset (or salt) value.
*/
-#define AES_ICM 1
+#define AES_ICM 1
-/**
- * @brief AES-128 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-128 Integer Counter Mode (AES ICM)
* AES-128 ICM is a deprecated alternate name for AES ICM.
*/
#define AES_128_ICM AES_ICM
/**
- * @brief SEAL 3.0
- *
+ * @brief SEAL 3.0
+ *
* SEAL is the Software-Optimized Encryption Algorithm of Coppersmith
* and Rogaway. Nota bene: this cipher is IBM proprietary.
*/
-#define SEAL 2
+#define SEAL 2
-/**
- * @brief AES Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES Cipher Block Chaining mode (AES CBC)
*
* AES CBC is the AES Cipher Block Chaining mode.
* This cipher uses a 16-, 24-, or 32-octet key.
*/
-#define AES_CBC 3
+#define AES_CBC 3
-/**
- * @brief AES-128 Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES-128 Cipher Block Chaining mode (AES CBC)
*
* AES-128 CBC is a deprecated alternate name for AES CBC.
*/
-#define AES_128_CBC AES_CBC
+#define AES_128_CBC AES_CBC
/**
* @brief Strongest available cipher.
*
* This identifier resolves to the strongest cipher type available.
*/
-#define STRONGHOLD_CIPHER AES_ICM
+#define STRONGHOLD_CIPHER AES_ICM
/**
* @}
@@ -149,14 +149,14 @@
/**
* @defgroup Authentication Authentication Function Types
- *
+ *
* @brief Each authentication function type is identified by an
* unsigned integer. The authentication function types available in
* this edition of libSRTP are given by the #defines below.
*
* An auth_type_id_t is an identifier for an authentication function type;
- * only values given by the #defines above (or those present in the
- * file crypto_types.h) should be used.
+ * only values given by the #defines above (or those present in the
+ * file crypto_types.h) should be used.
*
* The identifier STRONGHOLD_AUTH indicates the strongest available
* authentication function, allowing an application to choose the
@@ -173,8 +173,8 @@
*
* The NULL_AUTH function does nothing, and can be selected to indicate
* that authentication should not be performed.
- */
-#define NULL_AUTH 0
+ */
+#define NULL_AUTH 0
/**
* @brief UST with TMMH Version 2
@@ -184,15 +184,15 @@
* than the null cipher.
* with a cipher.
*/
-#define UST_TMMHv2 1
+#define UST_TMMHv2 1
/**
- * @brief (UST) AES-128 XORMAC
+ * @brief (UST) AES-128 XORMAC
*
* UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene:
* the XORMAC algorithm is IBM proprietary.
*/
-#define UST_AES_128_XMAC 2
+#define UST_AES_128_XMAC 2
/**
* @brief HMAC-SHA1
@@ -200,7 +200,7 @@
* HMAC_SHA1 implements the Hash-based MAC using the NIST Secure
* Hash Algorithm version 1 (SHA1).
*/
-#define HMAC_SHA1 3
+#define HMAC_SHA1 3
/**
* @brief Strongest available authentication function.
@@ -208,7 +208,7 @@
* This identifier resolves to the strongest available authentication
* function.
*/
-#define STRONGHOLD_AUTH HMAC_SHA1
+#define STRONGHOLD_AUTH HMAC_SHA1
/**
* @}
diff --git a/thirdparties/iphone/include/srtp/cryptoalg.h b/thirdparties/iphone/include/srtp/cryptoalg.h
index d9f0441..ad29fa0 100755
--- a/thirdparties/iphone/include/srtp/cryptoalg.h
+++ b/thirdparties/iphone/include/srtp/cryptoalg.h
@@ -2,31 +2,31 @@
* cryptoalg.h
*
* API for authenticated encryption crypto algorithms
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -61,10 +61,10 @@
* The function pointer cryptoalg_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated but not encrypted
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated but not encrypted
*
* @param clear_len length of data to be authenticated but not encrypted
*
@@ -79,34 +79,34 @@
* length of the ciphertext (after the call)
*
*/
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- const void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len);
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ const void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- const void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ const void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
@@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t;
int
cryptoalg_get_id(cryptoalg_t c);
-cryptoalg_t
+cryptoalg_t
cryptoalg_find_by_id(int id);
diff --git a/thirdparties/iphone/include/srtp/datatypes.h b/thirdparties/iphone/include/srtp/datatypes.h
index e16d895..314a73a 100755
--- a/thirdparties/iphone/include/srtp/datatypes.h
+++ b/thirdparties/iphone/include/srtp/datatypes.h
@@ -1,6 +1,6 @@
/*
* datatypes.h
- *
+ *
* data types for bit vectors and finite fields
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -65,31 +65,31 @@
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
-#define DATATYPES_USE_MACROS
+#define DATATYPES_USE_MACROS
typedef union {
- uint8_t v8[2];
- uint16_t value;
+ uint8_t v8[2];
+ uint16_t value;
} v16_t;
typedef union {
- uint8_t v8[4];
- uint16_t v16[2];
- uint32_t value;
+ uint8_t v8[4];
+ uint16_t v16[2];
+ uint32_t value;
} v32_t;
typedef union {
- uint8_t v8[8];
- uint16_t v16[4];
- uint32_t v32[2];
- uint64_t value;
+ uint8_t v8[8];
+ uint16_t v16[4];
+ uint32_t v32[2];
+ uint64_t value;
} v64_t;
typedef union {
- uint8_t v8[16];
- uint16_t v16[8];
- uint32_t v32[4];
- uint64_t v64[2];
+ uint8_t v8[16];
+ uint16_t v16[8];
+ uint32_t v32[4];
+ uint64_t v64[2];
} v128_t;
@@ -162,7 +162,7 @@ v128_right_shift(v128_t *x, int shift_index);
/*
* the following macros define the data manipulation functions
- *
+ *
* If DATATYPES_USE_MACROS is defined, then these macros are used
* directly (and function call overhead is avoided). Otherwise,
* the macros are used through the functions defined in datatypes.c
@@ -309,18 +309,18 @@ v128_right_shift(v128_t *x, int shift_index);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* 0 */
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -346,7 +346,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -355,10 +355,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
@@ -379,7 +379,7 @@ octet_string_set_to_zero(uint8_t *s, int len);
#ifndef SRTP_KERNEL_LINUX
-/*
+/*
* Convert big endian integers to CPU byte order.
*/
#ifdef WORDS_BIGENDIAN
@@ -395,10 +395,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
-static inline uint32_t be32_to_cpu(uint32_t v) {
- /* optimized for x86. */
- asm("bswap %0" : "=r" (v) : "0" (v));
- return v;
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ /* optimized for x86. */
+ asm("bswap %0" : "=r" (v) : "0" (v));
+ return v;
}
# else /* HAVE_X86 */
# ifdef HAVE_NETINET_IN_H
@@ -409,15 +410,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) {
# define be32_to_cpu(x) ntohl((x))
# endif /* HAVE_X86 */
-static inline uint64_t be64_to_cpu(uint64_t v) {
+static inline uint64_t be64_to_cpu(uint64_t v)
+{
# ifdef NO_64BIT_MATH
- /* use the make64 functions to do 64-bit math */
- v = make64(htonl(low32(v)),htonl(high32(v)));
+ /* use the make64 functions to do 64-bit math */
+ v = make64(htonl(low32(v)),htonl(high32(v)));
# else
- /* use the native 64-bit math */
- v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
+ /* use the native 64-bit math */
+ v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
# endif
- return v;
+ return v;
}
#endif /* ! SRTP_KERNEL_LINUX */
@@ -425,22 +427,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) {
#endif /* WORDS_BIGENDIAN */
/*
- * functions manipulating bitvector_t
+ * functions manipulating bitvector_t
*
* A bitvector_t consists of an array of words and an integer
* representing the number of significant bits stored in the array.
* The bits are packed as follows: the least significant bit is that
* of word[0], while the most significant bit is the nth most
* significant bit of word[m], where length = bits_per_word * m + n.
- *
+ *
*/
#define bits_per_word 32
#define bytes_per_word 4
typedef struct {
- uint32_t length;
- uint32_t *word;
+ uint32_t length;
+ uint32_t *word;
} bitvector_t;
diff --git a/thirdparties/iphone/include/srtp/ekt.h b/thirdparties/iphone/include/srtp/ekt.h
index b0d888b..d7f9854 100755
--- a/thirdparties/iphone/include/srtp/ekt.h
+++ b/thirdparties/iphone/include/srtp/ekt.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2005 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,12 +45,12 @@
/*
- * EKT implementation strategy
- *
+ * EKT implementation strategy
+ *
* use stream_template approach
*
* in srtp_unprotect, when a new stream appears, check if template has
- * EKT defined, and if it does, then apply EKT processing
+ * EKT defined, and if it does, then apply EKT processing
*
* question: will we want to allow key-sharing templates in addition
* to EKT templates? could define a new ssrc_type_t that's associated
@@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt);
*/
typedef struct ekt_policy_ctx_t {
- ekt_spi_t spi; /* security parameter index */
- uint8_t ekt_cipher_type;
- uint8_t *ekt_key;
- struct ekt_policy_ctx_t *next_ekt_policy;
+ ekt_spi_t spi; /* security parameter index */
+ uint8_t ekt_cipher_type;
+ uint8_t *ekt_key;
+ struct ekt_policy_ctx_t *next_ekt_policy;
} ekt_policy_ctx_t;
@@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t {
*/
typedef struct ekt_data_t {
- ekt_spi_t spi;
- uint8_t ekt_cipher_type;
- aes_expanded_key_t ekt_enc_key;
- aes_expanded_key_t ekt_dec_key;
- struct ekt_data_t *next_ekt_data;
+ ekt_spi_t spi;
+ uint8_t ekt_cipher_type;
+ aes_expanded_key_t ekt_enc_key;
+ aes_expanded_key_t ekt_dec_key;
+ struct ekt_data_t *next_ekt_data;
} ekt_data_t;
/*
@@ -116,39 +116,39 @@ typedef struct ekt_data_t {
*/
typedef struct ekt_stream_ctx_t {
- ekt_data_t *data;
- uint16_t isn; /* initial sequence number */
- uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
+ ekt_data_t *data;
+ uint16_t isn; /* initial sequence number */
+ uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
} ekt_stream_ctx_t;
-err_status_t
+err_status_t
ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy);
err_status_t
-ekt_stream_init(ekt_stream_t e,
- ekt_spi_t spi,
- void *ekt_key,
- unsigned ekt_cipher_type);
+ekt_stream_init(ekt_stream_t e,
+ ekt_spi_t spi,
+ void *ekt_key,
+ unsigned ekt_cipher_type);
err_status_t
ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p);
-
+
err_status_t
-srtp_stream_init_from_ekt(srtp_stream_t stream,
- const void *srtcp_hdr,
- unsigned pkt_octet_len);
-
+srtp_stream_init_from_ekt(srtp_stream_t stream,
+ const void *srtcp_hdr,
+ unsigned pkt_octet_len);
+
void
ekt_write_data(ekt_stream_t ekt,
- uint8_t *base_tag,
- unsigned base_tag_len,
- int *packet_len,
- xtd_seq_num_t pkt_index);
+ uint8_t *base_tag,
+ unsigned base_tag_len,
+ int *packet_len,
+ xtd_seq_num_t pkt_index);
/*
* We handle EKT by performing some additional steps before
@@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt,
*/
err_status_t
-ekt_tag_verification_preproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ekt_tag_verification_preproces(uint8_t *pkt_tag,
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
err_status_t
ekt_tag_verification_postproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
/*
@@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag,
* Master Key, the SRTP ROC, the Initial Sequence Number, and SPI
* fields. The Base Authentication Tag field is set to the all-zero
* value
- *
+ *
* When EKT is not used, this function is a no-op.
- *
+ *
*/
err_status_t
srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s,
- uint8_t *pkt_tag,
- unsigned pkt_octet_len);
+ uint8_t *pkt_tag,
+ unsigned pkt_octet_len);
/* it's not clear that a tag_generation_postprocess function is needed */
diff --git a/thirdparties/iphone/include/srtp/err.h b/thirdparties/iphone/include/srtp/err.h
index 1a6e170..9a318e5 100755
--- a/thirdparties/iphone/include/srtp/err.h
+++ b/thirdparties/iphone/include/srtp/err.h
@@ -1,32 +1,32 @@
/*
* err.h
- *
+ *
* error status codes
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,9 +50,9 @@
/**
* @defgroup Error Error Codes
- *
+ *
* Error status codes are represented by the enumeration err_status_t.
- *
+ *
* @{
*/
@@ -66,31 +66,31 @@
*
*/
typedef enum {
- err_status_ok = 0, /**< nothing to report */
- err_status_fail = 1, /**< unspecified failure */
- err_status_bad_param = 2, /**< unsupported parameter */
- err_status_alloc_fail = 3, /**< couldn't allocate memory */
- err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
- err_status_init_fail = 5, /**< couldn't initialize */
- err_status_terminus = 6, /**< can't process as much data as requested */
- err_status_auth_fail = 7, /**< authentication failure */
- err_status_cipher_fail = 8, /**< cipher failure */
- err_status_replay_fail = 9, /**< replay check failed (bad index) */
- err_status_replay_old = 10, /**< replay check failed (index too old) */
- err_status_algo_fail = 11, /**< algorithm failed test routine */
- err_status_no_such_op = 12, /**< unsupported operation */
- err_status_no_ctx = 13, /**< no appropriate context found */
- err_status_cant_check = 14, /**< unable to perform desired validation */
- err_status_key_expired = 15, /**< can't use key any more */
- err_status_socket_err = 16, /**< error in use of socket */
- err_status_signal_err = 17, /**< error in use POSIX signals */
- err_status_nonce_bad = 18, /**< nonce check failed */
- err_status_read_fail = 19, /**< couldn't read data */
- err_status_write_fail = 20, /**< couldn't write data */
- err_status_parse_err = 21, /**< error pasring data */
- err_status_encode_err = 22, /**< error encoding data */
- err_status_semaphore_err = 23,/**< error while using semaphores */
- err_status_pfkey_err = 24 /**< error while using pfkey */
+ err_status_ok = 0, /**< nothing to report */
+ err_status_fail = 1, /**< unspecified failure */
+ err_status_bad_param = 2, /**< unsupported parameter */
+ err_status_alloc_fail = 3, /**< couldn't allocate memory */
+ err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
+ err_status_init_fail = 5, /**< couldn't initialize */
+ err_status_terminus = 6, /**< can't process as much data as requested */
+ err_status_auth_fail = 7, /**< authentication failure */
+ err_status_cipher_fail = 8, /**< cipher failure */
+ err_status_replay_fail = 9, /**< replay check failed (bad index) */
+ err_status_replay_old = 10, /**< replay check failed (index too old) */
+ err_status_algo_fail = 11, /**< algorithm failed test routine */
+ err_status_no_such_op = 12, /**< unsupported operation */
+ err_status_no_ctx = 13, /**< no appropriate context found */
+ err_status_cant_check = 14, /**< unable to perform desired validation */
+ err_status_key_expired = 15, /**< can't use key any more */
+ err_status_socket_err = 16, /**< error in use of socket */
+ err_status_signal_err = 17, /**< error in use POSIX signals */
+ err_status_nonce_bad = 18, /**< nonce check failed */
+ err_status_read_fail = 19, /**< couldn't read data */
+ err_status_write_fail = 20, /**< couldn't write data */
+ err_status_parse_err = 21, /**< error pasring data */
+ err_status_encode_err = 22, /**< error encoding data */
+ err_status_semaphore_err = 23,/**< error while using semaphores */
+ err_status_pfkey_err = 24 /**< error while using pfkey */
} err_status_t;
/**
@@ -98,15 +98,15 @@ typedef enum {
*/
typedef enum {
- err_level_emergency = 0,
- err_level_alert,
- err_level_critical,
- err_level_error,
- err_level_warning,
- err_level_notice,
- err_level_info,
- err_level_debug,
- err_level_none
+ err_level_emergency = 0,
+ err_level_alert,
+ err_level_critical,
+ err_level_error,
+ err_level_warning,
+ err_level_notice,
+ err_level_info,
+ err_level_debug,
+ err_level_none
} err_reporting_level_t;
/*
@@ -144,8 +144,8 @@ err_report(int priority, char *format, ...);
*/
typedef struct {
- int on; /* 1 if debugging is on, 0 if it is off */
- char *name; /* printable name for debug module */
+ int on; /* 1 if debugging is on, 0 if it is off */
+ char *name; /* printable name for debug module */
} debug_module_t;
#ifdef ENABLE_DEBUGGING
diff --git a/thirdparties/iphone/include/srtp/getopt_s.h b/thirdparties/iphone/include/srtp/getopt_s.h
index 2a6ece3..d3dc33d 100755
--- a/thirdparties/iphone/include/srtp/getopt_s.h
+++ b/thirdparties/iphone/include/srtp/getopt_s.h
@@ -7,26 +7,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,11 +45,11 @@
#ifndef GETOPT_S_H
#define GETOPT_S_H
-/*
+/*
* getopt_s(), optarg_s, and optind_s are small, locally defined
* versions of the POSIX standard getopt() interface.
*/
-
+
int
getopt_s(int argc, char * const argv[], const char *optstring);
diff --git a/thirdparties/iphone/include/srtp/gf2_8.h b/thirdparties/iphone/include/srtp/gf2_8.h
index 098d37c..bbbabdf 100755
--- a/thirdparties/iphone/include/srtp/gf2_8.h
+++ b/thirdparties/iphone/include/srtp/gf2_8.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,13 +54,13 @@ typedef uint8_t gf2_8;
#define gf2_8_field_polynomial 0x1B
/*
- * gf2_8_shift(x) returns
+ * gf2_8_shift(x) returns
*/
/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
+ * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
+ * operation, using the field representation from AES; that is, the
+ * next gf2_8 value in the cyclic representation of that field. The
* value z should be an uint8_t.
*/
diff --git a/thirdparties/iphone/include/srtp/hmac.h b/thirdparties/iphone/include/srtp/hmac.h
index 262c0e2..77468ab 100755
--- a/thirdparties/iphone/include/srtp/hmac.h
+++ b/thirdparties/iphone/include/srtp/hmac.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,9 +50,9 @@
#include "sha1.h"
typedef struct {
- uint8_t opad[64];
- sha1_ctx_t ctx;
- sha1_ctx_t init_ctx;
+ uint8_t opad[64];
+ sha1_ctx_t ctx;
+ sha1_ctx_t init_ctx;
} hmac_ctx_t;
err_status_t
@@ -72,7 +72,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets);
err_status_t
hmac_compute(hmac_ctx_t *state, const void *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* HMAC_H */
diff --git a/thirdparties/iphone/include/srtp/integers.h b/thirdparties/iphone/include/srtp/integers.h
index 7010efd..91935eb 100755
--- a/thirdparties/iphone/include/srtp/integers.h
+++ b/thirdparties/iphone/include/srtp/integers.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -125,7 +125,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \
(((unsigned char *) (addr))[1] << 16) | \
(((unsigned char *) (addr))[2] << 8) | \
- (((unsigned char *) (addr))[3]))
+ (((unsigned char *) (addr))[3]))
#else
#define PUT_32(addr,value) \
{ \
@@ -137,7 +137,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \
(((unsigned char *) (addr))[2] << 16) | \
(((unsigned char *) (addr))[1] << 8) | \
- (((unsigned char *) (addr))[0]))
+ (((unsigned char *) (addr))[0]))
#endif // WORDS_BIGENDIAN
#else
#define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value)
diff --git a/thirdparties/iphone/include/srtp/kernel_compat.h b/thirdparties/iphone/include/srtp/kernel_compat.h
index 59d1898..36559f7 100755
--- a/thirdparties/iphone/include/srtp/kernel_compat.h
+++ b/thirdparties/iphone/include/srtp/kernel_compat.h
@@ -1,6 +1,6 @@
/*
* kernel_compat.h
- *
+ *
* Compatibility stuff for building in kernel context where standard
* C headers and library are not available.
*
@@ -8,26 +8,26 @@
* Ingate Systems AB
*/
/*
- *
+ *
* Copyright(c) 2005 Ingate Systems AB
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the author(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -70,9 +70,9 @@
static inline int rand(void)
{
- uint32_t temp;
- get_random_bytes(&temp, sizeof(temp));
- return temp % (RAND_MAX+1);
+ uint32_t temp;
+ get_random_bytes(&temp, sizeof(temp));
+ return temp % (RAND_MAX+1);
}
/* stdio/stdlib implementation. */
diff --git a/thirdparties/iphone/include/srtp/key.h b/thirdparties/iphone/include/srtp/key.h
index e7e0744..340547f 100755
--- a/thirdparties/iphone/include/srtp/key.h
+++ b/thirdparties/iphone/include/srtp/key.h
@@ -2,31 +2,31 @@
* key.h
*
* key usage limits enforcement
- *
+ *
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
typedef struct key_limit_ctx_t *key_limit_t;
typedef enum {
- key_event_normal,
- key_event_soft_limit,
- key_event_hard_limit
+ key_event_normal,
+ key_event_soft_limit,
+ key_event_hard_limit
} key_event_t;
err_status_t
@@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key);
key_event_t
key_limit_update(key_limit_t key);
-typedef enum {
- key_state_normal,
- key_state_past_soft_limit,
- key_state_expired
+typedef enum {
+ key_state_normal,
+ key_state_past_soft_limit,
+ key_state_expired
} key_state_t;
typedef struct key_limit_ctx_t {
- xtd_seq_num_t num_left;
- key_state_t state;
+ xtd_seq_num_t num_left;
+ key_state_t state;
} key_limit_ctx_t;
#endif /* KEY_H */
diff --git a/thirdparties/iphone/include/srtp/null_auth.h b/thirdparties/iphone/include/srtp/null_auth.h
index 44f9a4a..54c0296 100755
--- a/thirdparties/iphone/include/srtp/null_auth.h
+++ b/thirdparties/iphone/include/srtp/null_auth.h
@@ -7,26 +7,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#include "auth.h"
typedef struct {
- char foo;
+ char foo;
} null_auth_ctx_t;
err_status_t
@@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len);
err_status_t
null_auth_compute (null_auth_ctx_t *state, uint8_t *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* NULL_AUTH_H */
diff --git a/thirdparties/iphone/include/srtp/null_cipher.h b/thirdparties/iphone/include/srtp/null_cipher.h
index 39da59a..63d272d 100755
--- a/thirdparties/iphone/include/srtp/null_cipher.h
+++ b/thirdparties/iphone/include/srtp/null_cipher.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,7 +52,7 @@
#include "cipher.h"
typedef struct {
- char foo ;/* empty, for now */
+ char foo ;/* empty, for now */
} null_cipher_ctx_t;
@@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len);
err_status_t
null_cipher_set_segment(null_cipher_ctx_t *c,
- unsigned long segment_index);
+ unsigned long segment_index);
err_status_t
null_cipher_encrypt(null_cipher_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
null_cipher_encrypt_aligned(null_cipher_ctx_t *c,
- unsigned char *buf, int bytes_to_encr);
+ unsigned char *buf, int bytes_to_encr);
#endif /* NULL_CIPHER_H */
diff --git a/thirdparties/iphone/include/srtp/prng.h b/thirdparties/iphone/include/srtp/prng.h
index fb96b5e..148b07a 100755
--- a/thirdparties/iphone/include/srtp/prng.h
+++ b/thirdparties/iphone/include/srtp/prng.h
@@ -21,10 +21,10 @@
*/
typedef struct {
- v128_t state; /* state data */
- aes_expanded_key_t key; /* secret key */
- uint32_t octet_count; /* number of octets output since last init */
- rand_source_func_t rand; /* random source for re-initialization */
+ v128_t state; /* state data */
+ aes_expanded_key_t key; /* secret key */
+ uint32_t octet_count; /* number of octets output since last init */
+ rand_source_func_t rand; /* random source for re-initialization */
} x917_prng_t;
err_status_t
@@ -39,9 +39,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
*/
typedef struct {
- uint32_t octet_count; /* number of octets output since last init */
- aes_icm_ctx_t state; /* state data */
- rand_source_func_t rand; /* random source for re-initialization */
+ uint32_t octet_count; /* number of octets output since last init */
+ aes_icm_ctx_t state; /* state data */
+ rand_source_func_t rand; /* random source for re-initialization */
} ctr_prng_t;
err_status_t
diff --git a/thirdparties/iphone/include/srtp/rand_source.h b/thirdparties/iphone/include/srtp/rand_source.h
index b4c2110..d2e52ce 100755
--- a/thirdparties/iphone/include/srtp/rand_source.h
+++ b/thirdparties/iphone/include/srtp/rand_source.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -60,7 +60,7 @@ rand_source_init(void);
* and returns an error code. This error code should be checked,
* and if a failure is reported, the data in the buffer MUST NOT
* be used.
- *
+ *
* warning: If the return code is not checked, then non-random
* data may inadvertently be used.
*
@@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length);
err_status_t
rand_source_deinit(void);
-/*
+/*
* function prototype for a random source function
*
* A rand_source_func_t writes num_octets at the location indicated by
@@ -86,6 +86,6 @@ rand_source_deinit(void);
*/
typedef err_status_t (*rand_source_func_t)
- (void *dest, uint32_t num_octets);
+(void *dest, uint32_t num_octets);
#endif /* RAND_SOURCE */
diff --git a/thirdparties/iphone/include/srtp/rdb.h b/thirdparties/iphone/include/srtp/rdb.h
index 2ccb144..2432fae 100755
--- a/thirdparties/iphone/include/srtp/rdb.h
+++ b/thirdparties/iphone/include/srtp/rdb.h
@@ -21,11 +21,11 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
} rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8*sizeof(v128_t))
/*
* rdb init
@@ -49,7 +49,7 @@ rdb_init(rdb_t *rdb);
*/
err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+rdb_check(const rdb_t *rdb, uint32_t rdb_index);
/*
* rdb_add_index
@@ -64,18 +64,18 @@ err_status_t
rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions rdb_increment() and rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
* rdb_t upon which rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
+ *
* err_status_ok no problem
* err_status_key_expired sequence number too high
*
@@ -91,4 +91,4 @@ uint32_t
rdb_get_value(const rdb_t *rdb);
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
diff --git a/thirdparties/iphone/include/srtp/rdbx.h b/thirdparties/iphone/include/srtp/rdbx.h
index 146fb42..88055c2 100755
--- a/thirdparties/iphone/include/srtp/rdbx.h
+++ b/thirdparties/iphone/include/srtp/rdbx.h
@@ -14,7 +14,7 @@
#include "datatypes.h"
#include "err.h"
-/* #define ROC_TEST */
+/* #define ROC_TEST */
#ifndef ROC_TEST
@@ -33,7 +33,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
- * sequence number.
+ * sequence number.
*/
typedef uint64_t xtd_seq_num_t;
@@ -45,8 +45,8 @@ typedef uint64_t xtd_seq_num_t;
*/
typedef struct {
- xtd_seq_num_t index;
- bitvector_t bitmask;
+ xtd_seq_num_t index;
+ bitvector_t bitmask;
} rdbx_t;
@@ -73,7 +73,7 @@ rdbx_dealloc(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
- *
+ *
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
@@ -82,8 +82,8 @@ rdbx_dealloc(rdbx_t *rdbx);
int
rdbx_estimate_index(const rdbx_t *rdbx,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
@@ -98,7 +98,7 @@ rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
- *
+ *
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
@@ -116,7 +116,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta);
* to have the rollover counter value roc. If that value is less than
* the current rollover counter value, then the function returns
* err_status_replay_old; otherwise, err_status_ok is returned.
- *
+ *
*/
err_status_t
@@ -125,7 +125,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc);
/*
* rdbx_get_roc(rdbx) returns the value of the rollover counter for
* the rdbx_t pointed to by rdbx
- *
+ *
*/
xtd_seq_num_t
@@ -160,7 +160,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
- *
+ *
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
@@ -170,8 +170,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
int
index_guess(const xtd_seq_num_t *local,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
#endif /* RDBX_H */
diff --git a/thirdparties/iphone/include/srtp/rtp.h b/thirdparties/iphone/include/srtp/rtp.h
index 0e0119c..9b97ab6 100755
--- a/thirdparties/iphone/include/srtp/rtp.h
+++ b/thirdparties/iphone/include/srtp/rtp.h
@@ -1,6 +1,6 @@
/*
* rtp.h
- *
+ *
* rtp interface for srtp reference implementation
*
* David A. McGrew
@@ -15,26 +15,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -73,12 +73,12 @@ int
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
int
-rtp_receiver_init(rtp_receiver_t rcvr, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_receiver_init(rtp_receiver_t rcvr, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
int
-rtp_sender_init(rtp_sender_t sender, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_sender_init(rtp_sender_t sender, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
/*
* srtp_sender_init(...) initializes an rtp_sender_t
@@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
@@ -112,13 +112,13 @@ int
rtp_receiver_deinit_srtp(rtp_receiver_t sender);
-rtp_sender_t
+rtp_sender_t
rtp_sender_alloc(void);
void
rtp_sender_dealloc(rtp_sender_t rtp_ctx);
-rtp_receiver_t
+rtp_receiver_t
rtp_receiver_alloc(void);
void
@@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
*/
#define RTP_HEADER_LEN 12
-/*
+/*
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
*/
#define RTP_MAX_BUF_LEN 16384
diff --git a/thirdparties/iphone/include/srtp/rtp_priv.h b/thirdparties/iphone/include/srtp/rtp_priv.h
index 1421386..088cdbe 100755
--- a/thirdparties/iphone/include/srtp/rtp_priv.h
+++ b/thirdparties/iphone/include/srtp/rtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,22 +52,22 @@
typedef srtp_hdr_t rtp_hdr_t;
typedef struct {
- srtp_hdr_t header;
- char body[RTP_MAX_BUF_LEN];
+ srtp_hdr_t header;
+ char body[RTP_MAX_BUF_LEN];
} rtp_msg_t;
typedef struct rtp_sender_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* reciever's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* reciever's address */
} rtp_sender_ctx_t;
typedef struct rtp_receiver_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* receiver's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* receiver's address */
} rtp_receiver_ctx_t;
diff --git a/thirdparties/iphone/include/srtp/sha1.h b/thirdparties/iphone/include/srtp/sha1.h
index e3af4d4..65ecee4 100755
--- a/thirdparties/iphone/include/srtp/sha1.h
+++ b/thirdparties/iphone/include/srtp/sha1.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,17 +51,17 @@
#include "datatypes.h"
typedef struct {
- uint32_t H[5]; /* state vector */
- uint32_t M[16]; /* message buffer */
- int octets_in_buffer; /* octets of message in buffer */
- uint32_t num_bits_in_msg; /* total number of bits in message */
+ uint32_t H[5]; /* state vector */
+ uint32_t M[16]; /* message buffer */
+ int octets_in_buffer; /* octets of message in buffer */
+ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/*
* sha1(&ctx, msg, len, output) hashes the len octets starting at msg
* into the SHA1 context, then writes the result to the 20 octets at
* output
- *
+ *
*/
void
@@ -69,10 +69,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/*
* sha1_init(&ctx) initializes the SHA1 context ctx
- *
+ *
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
- *
+ *
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
@@ -90,7 +90,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
- * setup algorithm.
+ * setup algorithm.
*/
/*
@@ -104,5 +104,5 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
-
+
#endif /* SHA1_H */
diff --git a/thirdparties/iphone/include/srtp/srtp.h b/thirdparties/iphone/include/srtp/srtp.h
index eb95e7d..6f6fc9c 100755
--- a/thirdparties/iphone/include/srtp/srtp.h
+++ b/thirdparties/iphone/include/srtp/srtp.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,7 +50,7 @@
extern "C" {
#endif
-#include "crypto_kernel.h"
+#include "crypto_kernel.h"
/**
* @defgroup SRTP Secure RTP
@@ -76,7 +76,7 @@ extern "C" {
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
-#define SRTP_MAX_TAG_LEN 12
+#define SRTP_MAX_TAG_LEN 12
/**
* SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer
@@ -86,85 +86,86 @@ extern "C" {
*
* @brief the maximum number of octets added by srtp_protect().
*/
-#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
+#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
-/*
+/*
* nota bene: since libSRTP doesn't support the use of the MKI, the
* SRTP_MAX_TRAILER_LEN value is just the maximum tag length
*/
/**
- * @brief sec_serv_t describes a set of security services.
+ * @brief sec_serv_t describes a set of security services.
*
* A sec_serv_t enumeration is used to describe the particular
* security services that will be applied by a particular crypto
- * policy (or other mechanism).
+ * policy (or other mechanism).
*/
typedef enum {
- sec_serv_none = 0, /**< no services */
- sec_serv_conf = 1, /**< confidentiality */
- sec_serv_auth = 2, /**< authentication */
- sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
-} sec_serv_t;
+ sec_serv_none = 0, /**< no services */
+ sec_serv_conf = 1, /**< confidentiality */
+ sec_serv_auth = 2, /**< authentication */
+ sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
+}
+sec_serv_t;
-/**
+/**
* @brief crypto_policy_t describes a particular crypto policy that
* can be applied to an SRTP stream.
*
* A crypto_policy_t describes a particular cryptographic policy that
* can be applied to an SRTP or SRTCP stream. An SRTP session policy
- * consists of a list of these policies, one for each SRTP stream
+ * consists of a list of these policies, one for each SRTP stream
* in the session.
*/
typedef struct crypto_policy_t {
- cipher_type_id_t cipher_type; /**< An integer representing
+ cipher_type_id_t cipher_type; /**< An integer representing
* the type of cipher. */
- int cipher_key_len; /**< The length of the cipher key
+ int cipher_key_len; /**< The length of the cipher key
* in octets. */
- auth_type_id_t auth_type; /**< An integer representing the
+ auth_type_id_t auth_type; /**< An integer representing the
* authentication function. */
- int auth_key_len; /**< The length of the authentication
+ int auth_key_len; /**< The length of the authentication
* function key in octets. */
- int auth_tag_len; /**< The length of the authentication
+ int auth_tag_len; /**< The length of the authentication
* tag in octets. */
- sec_serv_t sec_serv; /**< The flag indicating the security
+ sec_serv_t sec_serv; /**< The flag indicating the security
* services to be applied. */
} crypto_policy_t;
-/**
+/**
* @brief ssrc_type_t describes the type of an SSRC.
- *
+ *
* An ssrc_type_t enumeration is used to indicate a type of SSRC. See
* @ref srtp_policy_t for more informataion.
*/
-typedef enum {
- ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
- ssrc_specific = 1, /**< Indicates a specific SSRC value */
- ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
+typedef enum {
+ ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
+ ssrc_specific = 1, /**< Indicates a specific SSRC value */
+ ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
(i.e. a value that is used in the
function srtp_unprotect()) */
- ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
- (i.e. a value that is used in the
+ ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
+ (i.e. a value that is used in the
function srtp_protect()) */
} ssrc_type_t;
/**
* @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
- *
+ *
* An ssrc_t represents a particular SSRC value (if its type is
* ssrc_specific), or a wildcard SSRC value that will match all
* outbound SSRCs (if its type is ssrc_any_outbound) or all inbound
- * SSRCs (if its type is ssrc_any_inbound).
+ * SSRCs (if its type is ssrc_any_inbound).
*
*/
-typedef struct {
- ssrc_type_t type; /**< The type of this particular SSRC */
- unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
+typedef struct {
+ ssrc_type_t type; /**< The type of this particular SSRC */
+ unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
} ssrc_t;
@@ -180,8 +181,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t;
typedef struct ekt_stream_ctx_t *ekt_stream_t;
-/**
- * @brief represents the policy for an SRTP session.
+/**
+ * @brief represents the policy for an SRTP session.
*
* A single srtp_policy_t struct represents the policy for a single
* SRTP stream, and a linked list of these elements represents the
@@ -190,7 +191,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* master key for that stream, the SSRC describing that stream, or a
* flag indicating a `wildcard' SSRC value, and a `next' field that
* holds a pointer to the next element in the list of policy elements,
- * or NULL if it is the last element.
+ * or NULL if it is the last element.
*
* The wildcard value SSRC_ANY_INBOUND matches any SSRC from an
* inbound stream that for which there is no explicit SSRC entry in
@@ -201,33 +202,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* is intentional, and it allows libSRTP to ensure that no security
* lapses result from accidental re-use of SSRC values during key
* sharing.
- *
- *
+ *
+ *
* @warning The final element of the list @b must have its `next' pointer
* set to NULL.
*/
typedef struct srtp_policy_t {
- ssrc_t ssrc; /**< The SSRC value of stream, or the
- * flags SSRC_ANY_INBOUND or
+ ssrc_t ssrc; /**< The SSRC value of stream, or the
+ * flags SSRC_ANY_INBOUND or
* SSRC_ANY_OUTBOUND if key sharing
* is used for this policy element.
*/
- crypto_policy_t rtp; /**< SRTP crypto policy. */
- crypto_policy_t rtcp; /**< SRTCP crypto policy. */
- unsigned char *key; /**< Pointer to the SRTP master key for
+ crypto_policy_t rtp; /**< SRTP crypto policy. */
+ crypto_policy_t rtcp; /**< SRTCP crypto policy. */
+ unsigned char *key; /**< Pointer to the SRTP master key for
* this stream. */
- ekt_policy_t ekt; /**< Pointer to the EKT policy structure
- * for this stream (if any) */
- unsigned long window_size; /**< The window size to use for replay
+ ekt_policy_t ekt; /**< Pointer to the EKT policy structure
+ * for this stream (if any) */
+ unsigned long window_size; /**< The window size to use for replay
* protection. */
- int allow_repeat_tx; /**< Whether retransmissions of
+ int allow_repeat_tx; /**< Whether retransmissions of
* packets with the same sequence number
* are allowed. (Note that such repeated
* transmissions must have the same RTP
* payload, or a severe security weakness
* is introduced!) */
- struct srtp_policy_t *next; /**< Pointer to next stream policy. */
+ struct srtp_policy_t *next; /**< Pointer to next stream policy. */
} srtp_policy_t;
@@ -237,7 +238,7 @@ typedef struct srtp_policy_t {
* @brief An srtp_t points to an SRTP session structure.
*
* The typedef srtp_t is a pointer to a structure that represents
- * an SRTP session. This datatype is intentially opaque in
+ * an SRTP session. This datatype is intentially opaque in
* order to separate the interface from the implementation.
*
* An SRTP session consists of all of the traffic sent to the RTP and
@@ -254,11 +255,11 @@ typedef struct srtp_ctx_t *srtp_t;
*
* The typedef srtp_stream_t is a pointer to a structure that
* represents an SRTP stream. This datatype is intentionally
- * opaque in order to separate the interface from the implementation.
- *
+ * opaque in order to separate the interface from the implementation.
+ *
* An SRTP stream consists of all of the traffic sent to an SRTP
* session by a single participant. A session can be viewed as
- * a set of streams.
+ * a set of streams.
*
*/
typedef struct srtp_stream_ctx_t *srtp_stream_t;
@@ -266,7 +267,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t;
/**
- * @brief srtp_init() initializes the srtp library.
+ * @brief srtp_init() initializes the srtp library.
*
* @warning This function @b must be called before any other srtp
* functions.
@@ -287,14 +288,14 @@ srtp_shutdown(void);
/**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
- *
+ *
* The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP
* protection to the RTP packet rtp_hdr (which has length *len_ptr) using
* the SRTP context ctx. If err_status_ok is returned, then rtp_hdr
* points to the resulting SRTP packet and *len_ptr is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
- *
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
@@ -314,7 +315,7 @@ srtp_shutdown(void);
* complete SRTP packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok no problems
* - err_status_replay_fail rtp sequence number was non-increasing
* - @e other failure in cryptographic mechanisms
@@ -322,7 +323,7 @@ srtp_shutdown(void);
err_status_t
srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
-
+
/**
* @brief srtp_unprotect() is the Secure RTP receiver-side packet
* processing function.
@@ -333,12 +334,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* err_status_ok is returned, then srtp_hdr points to the resulting
* RTP packet and *len_ptr is the number of octets in that packet;
* otherwise, no assumptions should be made about the value of either
- * data elements.
- *
+ * data elements.
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
- *
+ *
* @warning This function assumes that the SRTP packet is aligned on a
* 32-bit boundary.
*
@@ -355,9 +356,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* complete rtp packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTP packet is valid.
- * - err_status_auth_fail if the SRTP packet failed the message
+ * - err_status_auth_fail if the SRTP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has
* already been processed and accepted).
@@ -377,14 +378,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
* key.
*
* @param session is the SRTP session to which the policy is to be added.
- *
+ *
* @param policy is the srtp_policy_t struct that describes the policy
* for the session. The struct may be a single element, or it may be
* the head of a list, in which case each element of the list is
* processed. It may also be NULL, in which case streams should be added
* later using srtp_add_stream(). The final element of the list @b must
* have its `next' field set to NULL.
- *
+ *
* @return
* - err_status_ok if creation succeded.
* - err_status_alloc_fail if allocation failed.
@@ -398,7 +399,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
/**
* @brief srtp_add_stream() allocates and initializes an SRTP stream
* within a given SRTP session.
- *
+ *
* The function call srtp_add_stream(session, policy) allocates and
* initializes a new SRTP stream within a given, previously created
* session, applying the policy given as the other argument to that
@@ -411,13 +412,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
*/
err_status_t
-srtp_add_stream(srtp_t session,
- const srtp_policy_t *policy);
+srtp_add_stream(srtp_t session,
+ const srtp_policy_t *policy);
/**
* @brief srtp_remove_stream() deallocates an SRTP stream.
- *
+ *
* The function call srtp_remove_stream(session, ssrc) removes
* the SRTP stream with the SSRC value ssrc from the SRTP session
* context given by the argument session.
@@ -429,7 +430,7 @@ srtp_add_stream(srtp_t session,
*
* @warning Wildcard SSRC values cannot be removed from a
* session.
- *
+ *
* @return
* - err_status_ok if the stream deallocation succeded.
* - [other] otherwise.
@@ -443,8 +444,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* @brief crypto_policy_set_rtp_default() sets a crypto policy
* structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTP
* protection, as defined in the specification. This function is a
@@ -453,9 +454,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -465,8 +466,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* @brief crypto_policy_set_rtcp_default() sets a crypto policy
* structure to the SRTP default policy for RTCP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTCP
* protection, as defined in the specification. This function is a
@@ -475,9 +476,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -487,15 +488,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto
* policy structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a
* synonym for crypto_policy_set_rtp_default(). It conforms to the
* naming convention used in RFC 4568 (SDP Security Descriptions for
* Media Streams).
- *
+ *
* @return void.
- *
+ *
*/
#define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p)
@@ -505,8 +506,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto
* policy structure to a short-authentication tag policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568.
@@ -516,7 +517,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -529,7 +530,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -541,14 +542,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto
* policy structure to an encryption-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Counter Mode), but to use no authentication method. This
* policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5
* of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -560,7 +561,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -571,14 +572,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto
* policy structure to an authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80
* bit authentication tag to provide message authentication, but to
* use no encryption. This policy is NOT RECOMMENDED for SRTP unless
- * there is a requirement to forego encryption.
- *
+ * there is a requirement to forego encryption.
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -586,10 +587,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @warning This policy is NOT RECOMMENDED for SRTP unless there is a
- * requirement to forego encryption.
+ * requirement to forego encryption.
*
* @return void.
- *
+ *
*/
void
@@ -598,18 +599,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
/**
* @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto
- * policy structure to a encryption and authentication policy using AES-256
+ * policy structure to a encryption and authentication policy using AES-256
* for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_80 as defined in
* draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256
* Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit
* authentication tag.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -617,7 +618,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
@@ -628,8 +629,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* policy structure to a short-authentication tag policy using AES-256
* encryption.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_32 as defined in
@@ -639,7 +640,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -652,7 +653,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -662,7 +663,7 @@ crypto_policy_set_aes_cm_256_hmac_sha1_32(crypto_policy_t *p);
/**
* @brief srtp_dealloc() deallocates storage for an SRTP session
* context.
- *
+ *
* The function call srtp_dealloc(s) deallocates storage for the
* SRTP session context s. This function should be called no more
* than one time for each of the contexts allocated by the function
@@ -680,7 +681,7 @@ srtp_dealloc(srtp_t s);
/*
- * @brief identifies a particular SRTP profile
+ * @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters). These
@@ -688,13 +689,13 @@ srtp_dealloc(srtp_t s);
*/
typedef enum {
- srtp_profile_reserved = 0,
- srtp_profile_aes128_cm_sha1_80 = 1,
- srtp_profile_aes128_cm_sha1_32 = 2,
- srtp_profile_aes256_cm_sha1_80 = 3,
- srtp_profile_aes256_cm_sha1_32 = 4,
- srtp_profile_null_sha1_80 = 5,
- srtp_profile_null_sha1_32 = 6,
+ srtp_profile_reserved = 0,
+ srtp_profile_aes128_cm_sha1_80 = 1,
+ srtp_profile_aes128_cm_sha1_32 = 2,
+ srtp_profile_aes256_cm_sha1_80 = 3,
+ srtp_profile_aes256_cm_sha1_32 = 4,
+ srtp_profile_null_sha1_80 = 5,
+ srtp_profile_null_sha1_32 = 6,
} srtp_profile_t;
@@ -702,26 +703,26 @@ typedef enum {
* @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy
* structure to the appropriate value for RTP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
+ srtp_profile_t profile);
@@ -730,26 +731,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
* @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy
* structure to the appropriate value for RTCP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTCP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
+ srtp_profile_t profile);
/**
* @brief returns the master key length for a given SRTP profile
@@ -767,18 +768,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile);
/**
* @brief appends the salt to the key
*
- * The function call append_salt_to_key(k, klen, s, slen)
+ * The function call append_salt_to_key(k, klen, s, slen)
* copies the string s to the location at klen bytes following
- * the location k.
+ * the location k.
*
* @warning There must be at least bytes_in_salt + bytes_in_key bytes
* available at the location pointed to by key.
- *
+ *
*/
void
append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
- unsigned char *salt, unsigned int bytes_in_salt);
+ unsigned char *salt, unsigned int bytes_in_salt);
@@ -790,7 +791,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
/**
* @defgroup SRTCP Secure RTCP
- * @ingroup SRTP
+ * @ingroup SRTP
*
* @brief Secure RTCP functions are used to protect RTCP traffic.
*
@@ -798,26 +799,26 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* traffic in much the same way as it does RTP traffic. The function
* srtp_protect_rtcp() applies cryptographic protections to outbound
* RTCP packets, and srtp_unprotect_rtcp() verifies the protections on
- * inbound RTCP packets.
+ * inbound RTCP packets.
*
* A note on the naming convention: srtp_protect_rtcp() has an srtp_t
* as its first argument, and thus has `srtp_' as its prefix. The
- * trailing `_rtcp' indicates the protocol on which it acts.
- *
+ * trailing `_rtcp' indicates the protocol on which it acts.
+ *
* @{
*/
/**
* @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet
* processing function.
- *
+ *
* The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies
* SRTCP protection to the RTCP packet rtcp_hdr (which has length
* *len_ptr) using the SRTP session context ctx. If err_status_ok is
* returned, then rtp_hdr points to the resulting SRTCP packet and
* *len_ptr is the number of octets in that packet; otherwise, no
* assumptions should be made about the value of either data elements.
- *
+ *
* @warning This function assumes that it can write the authentication
* tag into the location in memory immediately following the RTCP
* packet, and assumes that the RTCP packet is aligned on a 32-bit
@@ -834,14 +835,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* was returned. Otherwise, the value of the data to which it points
* is undefined.
*
- * @return
+ * @return
* - err_status_ok if there were no problems.
- * - [other] if there was a failure in
+ * - [other] if there was a failure in
* the cryptographic mechanisms.
*/
-
-err_status_t
+
+err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
/**
@@ -855,7 +856,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* to the resulting RTCP packet and *len_ptr is the number of octets
* in that packet; otherwise, no assumptions should be made about the
* value of either data elements.
- *
+ *
* @warning This function assumes that the SRTCP packet is aligned on a
* 32-bit boundary.
*
@@ -873,9 +874,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* returned. Otherwise, the value of the data to which it points is
* undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTCP packet is valid.
- * - err_status_auth_fail if the SRTCP packet failed the message
+ * - err_status_auth_fail if the SRTCP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTCP packet is a replay (e.g. has
* already been processed and accepted).
@@ -883,7 +884,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
*
*/
-err_status_t
+err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
/**
@@ -894,10 +895,10 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @defgroup SRTPevents SRTP events and callbacks
* @ingroup SRTP
*
- * @brief libSRTP can use a user-provided callback function to
+ * @brief libSRTP can use a user-provided callback function to
* handle events.
*
- *
+ *
* libSRTP allows a user to provide a callback function to handle
* events that need to be dealt with outside of the data plane (see
* the enum srtp_event_t for a description of these events). Dealing
@@ -918,8 +919,8 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @brief srtp_event_t defines events that need to be handled
*
* The enum srtp_event_t defines events that need to be handled
- * outside the `data plane', such as SSRC collisions and
- * key expirations.
+ * outside the `data plane', such as SSRC collisions and
+ * key expirations.
*
* When a key expires or the maximum number of packets has been
* reached, an SRTP stream will enter an `expired' state in which no
@@ -932,33 +933,33 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* latter case, all of the streams in the session will expire.
*/
-typedef enum {
- event_ssrc_collision, /**<
- * An SSRC collision occured.
+typedef enum {
+ event_ssrc_collision, /**<
+ * An SSRC collision occured.
*/
- event_key_soft_limit, /**< An SRTP stream reached the soft key
- * usage limit and will expire soon.
+ event_key_soft_limit, /**< An SRTP stream reached the soft key
+ * usage limit and will expire soon.
*/
- event_key_hard_limit, /**< An SRTP stream reached the hard
+ event_key_hard_limit, /**< An SRTP stream reached the hard
* key usage limit and has expired.
*/
- event_packet_index_limit /**< An SRTP stream reached the hard
- * packet limit (2^48 packets).
+ event_packet_index_limit /**< An SRTP stream reached the hard
+ * packet limit (2^48 packets).
*/
} srtp_event_t;
/**
- * @brief srtp_event_data_t is the structure passed as a callback to
+ * @brief srtp_event_data_t is the structure passed as a callback to
* the event handler function
*
* The struct srtp_event_data_t holds the data passed to the event
- * handler function.
+ * handler function.
*/
typedef struct srtp_event_data_t {
- srtp_t session; /**< The session in which the event happend. */
- srtp_stream_t stream; /**< The stream in which the event happend. */
- srtp_event_t event; /**< An enum indicating the type of event. */
+ srtp_t session; /**< The session in which the event happend. */
+ srtp_stream_t stream; /**< The stream in which the event happend. */
+ srtp_event_t event; /**< An enum indicating the type of event. */
} srtp_event_data_t;
/**
@@ -976,7 +977,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data);
/**
* @brief sets the event handler to the function supplied by the caller.
- *
+ *
* The function call srtp_install_event_handler(func) sets the event
* handler function to the value func. The value NULL is acceptable
* as an argument; in this case, events will be ignored rather than
diff --git a/thirdparties/iphone/include/srtp/srtp_priv.h b/thirdparties/iphone/include/srtp/srtp_priv.h
index cf2274e..997a115 100755
--- a/thirdparties/iphone/include/srtp/srtp_priv.h
+++ b/thirdparties/iphone/include/srtp/srtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,56 +54,56 @@
* an srtp_hdr_t represents the srtp header
*
* in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
- *
+ *
* (note that this definition follows that of RFC 1889 Appendix A, but
* is not identical)
*/
-
+
#ifndef WORDS_BIGENDIAN
/*
* srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
- * this structure should be declared "unsigned int" instead of
+ * this structure should be declared "unsigned int" instead of
* "unsigned char", but doing so causes the MS compiler to not
* fully pack the bit fields.
*/
typedef struct {
- unsigned char cc:4; /* CSRC count */
- unsigned char x:1; /* header extension flag */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:7; /* payload type */
- unsigned char m:1; /* marker bit */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char x:1; /* header extension flag */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:7; /* payload type */
+ unsigned char m:1; /* marker bit */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char x:1; /* header extension flag */
- unsigned char cc:4; /* CSRC count */
- unsigned char m:1; /* marker bit */
- unsigned pt:7; /* payload type */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char x:1; /* header extension flag */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char m:1; /* marker bit */
+ unsigned pt:7; /* payload type */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#endif
typedef struct {
- uint16_t profile_specific; /* profile-specific info */
- uint16_t length; /* number of 32-bit words in extension */
+ uint16_t profile_specific; /* profile-specific info */
+ uint16_t length; /* number of 32-bit words in extension */
} srtp_hdr_xtnd_t;
/*
- * srtcp_hdr_t represents a secure rtcp header
+ * srtcp_hdr_t represents a secure rtcp header
*
* in this implementation, an srtcp header is assumed to be 32-bit
* alinged
@@ -112,53 +112,53 @@ typedef struct {
#ifndef WORDS_BIGENDIAN
typedef struct {
- unsigned char rc:5; /* reception report count */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char rc:5; /* reception report count */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int index:31; /* srtcp packet index in network order! */
- unsigned int e:1; /* encrypted? 1=yes */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int index:31; /* srtcp packet index in network order! */
+ unsigned int e:1; /* encrypted? 1=yes */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char rc:5; /* reception report count */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char rc:5; /* reception report count */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int version:2; /* protocol version */
- unsigned int p:1; /* padding flag */
- unsigned int count:5; /* varies by packet type */
- unsigned int pt:8; /* payload type */
- uint16_t length; /* len of uint32s of packet less header */
+ unsigned int version:2; /* protocol version */
+ unsigned int p:1; /* padding flag */
+ unsigned int count:5; /* varies by packet type */
+ unsigned int pt:8; /* payload type */
+ uint16_t length; /* len of uint32s of packet less header */
} rtcp_common_t;
typedef struct {
- unsigned int e:1; /* encrypted? 1=yes */
- unsigned int index:31; /* srtcp packet index */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int e:1; /* encrypted? 1=yes */
+ unsigned int index:31; /* srtcp packet index */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#endif
/*
- * the following declarations are libSRTP internal functions
+ * the following declarations are libSRTP internal functions
*/
/*
@@ -166,7 +166,7 @@ typedef struct {
* to ssrc, or NULL if no stream exists for that ssrc
*/
-srtp_stream_t
+srtp_stream_t
srtp_get_stream(srtp_t srtp, uint32_t ssrc);
@@ -180,47 +180,47 @@ err_status_t
srtp_stream_init_keys(srtp_stream_t srtp, const void *key);
/*
- * srtp_stream_init(s, p) initializes the srtp_stream_t s to
+ * srtp_stream_init(s, p) initializes the srtp_stream_t s to
* use the policy at the location p
*/
err_status_t
-srtp_stream_init(srtp_stream_t srtp,
- const srtp_policy_t *p);
+srtp_stream_init(srtp_stream_t srtp,
+ const srtp_policy_t *p);
/*
- * libsrtp internal datatypes
+ * libsrtp internal datatypes
*/
-typedef enum direction_t {
- dir_unknown = 0,
- dir_srtp_sender = 1,
- dir_srtp_receiver = 2
+typedef enum direction_t {
+ dir_unknown = 0,
+ dir_srtp_sender = 1,
+ dir_srtp_receiver = 2
} direction_t;
-/*
+/*
* an srtp_stream_t has its own SSRC, encryption key, authentication
* key, sequence number, and replay database
- *
+ *
* note that the keys might not actually be unique, in which case the
* cipher_t and auth_t pointers will point to the same structures
*/
typedef struct srtp_stream_ctx_t {
- uint32_t ssrc;
- cipher_t *rtp_cipher;
- auth_t *rtp_auth;
- rdbx_t rtp_rdbx;
- sec_serv_t rtp_services;
- cipher_t *rtcp_cipher;
- auth_t *rtcp_auth;
- rdb_t rtcp_rdb;
- sec_serv_t rtcp_services;
- key_limit_ctx_t *limit;
- direction_t direction;
- int allow_repeat_tx;
- ekt_stream_t ekt;
- struct srtp_stream_ctx_t *next; /* linked list of streams */
+ uint32_t ssrc;
+ cipher_t *rtp_cipher;
+ auth_t *rtp_auth;
+ rdbx_t rtp_rdbx;
+ sec_serv_t rtp_services;
+ cipher_t *rtcp_cipher;
+ auth_t *rtcp_auth;
+ rdb_t rtcp_rdb;
+ sec_serv_t rtcp_services;
+ key_limit_ctx_t *limit;
+ direction_t direction;
+ int allow_repeat_tx;
+ ekt_stream_t ekt;
+ struct srtp_stream_ctx_t *next; /* linked list of streams */
} srtp_stream_ctx_t;
@@ -229,8 +229,8 @@ typedef struct srtp_stream_ctx_t {
*/
typedef struct srtp_ctx_t {
- srtp_stream_ctx_t *stream_list; /* linked list of streams */
- srtp_stream_ctx_t *stream_template; /* act as template for other streams */
+ srtp_stream_ctx_t *stream_list; /* linked list of streams */
+ srtp_stream_ctx_t *stream_template; /* act as template for other streams */
} srtp_ctx_t;
@@ -239,7 +239,7 @@ typedef struct srtp_ctx_t {
* srtp_handle_event(srtp, srtm, evnt) calls the event handling
* function, if there is one.
*
- * This macro is not included in the documentation as it is
+ * This macro is not included in the documentation as it is
* an internal-only function.
*/
@@ -250,7 +250,7 @@ typedef struct srtp_ctx_t {
data.stream = strm; \
data.event = evnt; \
srtp_event_handler(&data); \
-}
+}
#endif /* SRTP_PRIV_H */
diff --git a/thirdparties/iphone/include/srtp/stat.h b/thirdparties/iphone/include/srtp/stat.h
index e28b131..a67a380 100755
--- a/thirdparties/iphone/include/srtp/stat.h
+++ b/thirdparties/iphone/include/srtp/stat.h
@@ -1,6 +1,6 @@
/*
* stats.h
- *
+ *
* interface to statistical test functions
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright(c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/iphone/include/srtp/ut_sim.h b/thirdparties/iphone/include/srtp/ut_sim.h
index c25feeb..bd7d015 100755
--- a/thirdparties/iphone/include/srtp/ut_sim.h
+++ b/thirdparties/iphone/include/srtp/ut_sim.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,12 +54,12 @@
#define UT_BUF 160 /* maximum amount of packet reorder */
typedef struct {
- uint32_t index;
- uint32_t buffer[UT_BUF];
+ uint32_t index;
+ uint32_t buffer[UT_BUF];
} ut_connection;
/*
- * ut_init(&u) initializes the ut_connection
+ * ut_init(&u) initializes the ut_connection
*
* this function should always be the first one called on a new
* ut_connection
diff --git a/thirdparties/iphone/include/srtp/xfm.h b/thirdparties/iphone/include/srtp/xfm.h
index 5837149..a5e393f 100755
--- a/thirdparties/iphone/include/srtp/xfm.h
+++ b/thirdparties/iphone/include/srtp/xfm.h
@@ -2,7 +2,7 @@
* xfm.h
*
* interface for abstract crypto transform
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -28,12 +28,12 @@
* The function pointer xfm_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated only
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated only
*
- * @param clear_len length of data to be authenticated only
+ * @param clear_len length of data to be authenticated only
*
* @param iv location to write the Initialization Vector (IV)
*
@@ -45,38 +45,38 @@
* encrypted and authenticated (before the function call), and the
* length of the ciphertext (after the call)
*
- * @param auth_tag location to write auth tag
+ * @param auth_tag location to write auth tag
*/
-typedef err_status_t (*xfm_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len,
- void *auth_tag
- );
-
-typedef
+typedef err_status_t (*xfm_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len,
+ void *auth_tag
+);
+
+typedef
err_status_t (*xfm_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len, /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len, /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- void *auth_tag /* location of auth tag */
- );
+ void *auth_tag /* location of auth tag */
+);
typedef struct xfm_ctx_t {
- xfm_func_t func;
- xfm_inv_t inv;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
+ xfm_func_t func;
+ xfm_inv_t inv;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
} xfm_ctx_t;
typedef xfm_ctx_t *xfm_t;
@@ -89,35 +89,35 @@ typedef xfm_ctx_t *xfm_t;
/* cryptoalgo - 5/28 */
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *opaque,
- unsigned *opaque_len
- );
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *opaque,
+ unsigned *opaque_len
+);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
diff --git a/thirdparties/iphone/include/vpx/svc_context.h b/thirdparties/iphone/include/vpx/svc_context.h
index 5d0fbbd..40701cc 100755
--- a/thirdparties/iphone/include/vpx/svc_context.h
+++ b/thirdparties/iphone/include/vpx/svc_context.h
@@ -24,28 +24,29 @@ extern "C" {
#endif
typedef enum SVC_ENCODING_MODE {
- INTER_LAYER_PREDICTION_I,
- ALT_INTER_LAYER_PREDICTION_IP,
- INTER_LAYER_PREDICTION_IP,
- USE_GOLDEN_FRAME
-} SVC_ENCODING_MODE;
+ INTER_LAYER_PREDICTION_I,
+ ALT_INTER_LAYER_PREDICTION_IP,
+ INTER_LAYER_PREDICTION_IP,
+ USE_GOLDEN_FRAME
+}
+SVC_ENCODING_MODE;
typedef enum SVC_LOG_LEVEL {
- SVC_LOG_ERROR,
- SVC_LOG_INFO,
- SVC_LOG_DEBUG
+ SVC_LOG_ERROR,
+ SVC_LOG_INFO,
+ SVC_LOG_DEBUG
} SVC_LOG_LEVEL;
typedef struct {
- // public interface to svc_command options
- int spatial_layers; // number of layers
- SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
- SVC_LOG_LEVEL log_level; // amount of information to display
- int log_print; // when set, printf log messages instead of returning the
- // message with svc_get_message
-
- // private storage for vpx_svc_encode
- void *internal;
+ // public interface to svc_command options
+ int spatial_layers; // number of layers
+ SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
+ SVC_LOG_LEVEL log_level; // amount of information to display
+ int log_print; // when set, printf log messages instead of returning the
+ // message with svc_get_message
+
+ // private storage for vpx_svc_encode
+ void *internal;
} SvcContext;
/**
@@ -73,7 +74,7 @@ vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
* e.g., "4/16,5/16,7/16,11/16,16/16"
*/
vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx,
- const char *scale_factors);
+ const char *scale_factors);
/**
* initialize SVC encoding
@@ -128,9 +129,9 @@ char *vpx_svc_get_rc_stats_buffer(const SvcContext *svc_ctx);
* return spatial resolution of the specified layer
*/
vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
- int layer,
- unsigned int *width,
- unsigned int *height);
+ int layer,
+ unsigned int *width,
+ unsigned int *height);
/**
* return number of frames that have been encoded
*/
diff --git a/thirdparties/iphone/include/vpx/vp8.h b/thirdparties/iphone/include/vpx/vp8.h
index 2a31af6..f748314 100755
--- a/thirdparties/iphone/include/vpx/vp8.h
+++ b/thirdparties/iphone/include/vpx/vp8.h
@@ -42,21 +42,21 @@ extern "C" {
* The set of macros define the control functions of VP8 interface
*/
enum vp8_com_control_id {
- VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
- VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
- VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
- VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
- VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
- VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
- VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
+ VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
+ VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
+ VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
+ VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
+ VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
+ VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
+ VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
- /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
- * for its control ids. These should be migrated to something like the
- * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
- */
- VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
- VP8_COMMON_CTRL_ID_MAX,
- VP8_DECODER_CTRL_ID_START = 256
+ /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
+ * for its control ids. These should be migrated to something like the
+ * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
+ */
+ VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
+ VP8_COMMON_CTRL_ID_MAX,
+ VP8_DECODER_CTRL_ID_START = 256
};
/*!\brief post process flags
@@ -64,15 +64,15 @@ enum vp8_com_control_id {
* The set of macros define VP8 decoder post processing flags
*/
enum vp8_postproc_level {
- VP8_NOFILTERING = 0,
- VP8_DEBLOCK = 1 << 0,
- VP8_DEMACROBLOCK = 1 << 1,
- VP8_ADDNOISE = 1 << 2,
- VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
- VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
- VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
- VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
- VP8_MFQE = 1 << 10
+ VP8_NOFILTERING = 0,
+ VP8_DEBLOCK = 1 << 0,
+ VP8_DEMACROBLOCK = 1 << 1,
+ VP8_ADDNOISE = 1 << 2,
+ VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
+ VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
+ VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
+ VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
+ VP8_MFQE = 1 << 10
};
/*!\brief post process flags
@@ -83,9 +83,9 @@ enum vp8_postproc_level {
*/
typedef struct vp8_postproc_cfg {
- int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
- int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
- int noise_level; /**< the strength of additive noise, valid range [0, 16] */
+ int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
+ int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
+ int noise_level; /**< the strength of additive noise, valid range [0, 16] */
} vp8_postproc_cfg_t;
/*!\brief reference frame type
@@ -93,9 +93,9 @@ typedef struct vp8_postproc_cfg {
* The set of macros define the type of VP8 reference frames
*/
typedef enum vpx_ref_frame_type {
- VP8_LAST_FRAME = 1,
- VP8_GOLD_FRAME = 2,
- VP8_ALTR_FRAME = 4
+ VP8_LAST_FRAME = 1,
+ VP8_GOLD_FRAME = 2,
+ VP8_ALTR_FRAME = 4
} vpx_ref_frame_type_t;
/*!\brief reference frame data struct
@@ -103,8 +103,8 @@ typedef enum vpx_ref_frame_type {
* Define the data struct to access vp8 reference frames.
*/
typedef struct vpx_ref_frame {
- vpx_ref_frame_type_t frame_type; /**< which reference frame */
- vpx_image_t img; /**< reference frame data in image format */
+ vpx_ref_frame_type_t frame_type; /**< which reference frame */
+ vpx_image_t img; /**< reference frame data in image format */
} vpx_ref_frame_t;
/*!\brief VP9 specific reference frame data struct
@@ -112,8 +112,8 @@ typedef struct vpx_ref_frame {
* Define the data struct to access vp9 reference frames.
*/
typedef struct vp9_ref_frame {
- int idx; /**< frame index to get (input) */
- vpx_image_t img; /**< img structure to populate (output) */
+ int idx; /**< frame index to get (input) */
+ vpx_image_t img; /**< img structure to populate (output) */
} vp9_ref_frame_t;
/*!\brief vp8 decoder control function parameter type
diff --git a/thirdparties/iphone/include/vpx/vp8cx.h b/thirdparties/iphone/include/vpx/vp8cx.h
index 75caad8..5ff0350 100755
--- a/thirdparties/iphone/include/vpx/vp8cx.h
+++ b/thirdparties/iphone/include/vpx/vp8cx.h
@@ -129,256 +129,256 @@ extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
* \sa #vpx_codec_control
*/
enum vp8e_enc_control_id {
- VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
- VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
- VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
- VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
- VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
- VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
- /*!\brief control function to set vp8 encoder cpuused
- *
- * Changes in this value influences, among others, the encoder's selection
- * of motion estimation methods. Values greater than 0 will increase encoder
- * speed at the expense of quality.
- * The full set of adjustments can be found in
- * onyx_if.c:vp8_set_speed_features().
- * \todo List highlights of the changes at various levels.
- *
- * \note Valid range: -16..16
- */
- VP8E_SET_CPUUSED = 13,
- VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
- /*!\brief control function to set noise sensitivity
- *
- * 0: off, 1: OnYOnly, 2: OnYUV,
- * 3: OnYUVAggressive, 4: Adaptive
- */
- VP8E_SET_NOISE_SENSITIVITY,
- VP8E_SET_SHARPNESS, /**< control function to set sharpness */
- VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
- VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
- VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
+ VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
+ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
+ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
+ VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
+ VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
+ VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
+ /*!\brief control function to set vp8 encoder cpuused
+ *
+ * Changes in this value influences, among others, the encoder's selection
+ * of motion estimation methods. Values greater than 0 will increase encoder
+ * speed at the expense of quality.
+ * The full set of adjustments can be found in
+ * onyx_if.c:vp8_set_speed_features().
+ * \todo List highlights of the changes at various levels.
+ *
+ * \note Valid range: -16..16
+ */
+ VP8E_SET_CPUUSED = 13,
+ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
+ /*!\brief control function to set noise sensitivity
+ *
+ * 0: off, 1: OnYOnly, 2: OnYUV,
+ * 3: OnYUVAggressive, 4: Adaptive
+ */
+ VP8E_SET_NOISE_SENSITIVITY,
+ VP8E_SET_SHARPNESS, /**< control function to set sharpness */
+ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
+ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
+ VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
encoder for the last frame using the internal
scale */
- VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
+ VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
encoder for the last frame, using the 0..63
scale as used by the rc_*_quantizer config
parameters */
- VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
- VP8E_SET_ARNR_STRENGTH, //!< control function to set the filter
- //!< strength for the arf
-
- /*!\deprecated control function to set the filter type to use for the arf */
- VP8E_SET_ARNR_TYPE,
-
- VP8E_SET_TUNING, /**< control function to set visual tuning */
- /*!\brief control function to set constrained quality level
- *
- * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
- * set to #VPX_CQ.
- * \note Valid range: 0..63
- */
- VP8E_SET_CQ_LEVEL,
-
- /*!\brief Max data rate for Intra frames
- *
- * This value controls additional clamping on the maximum size of a
- * keyframe. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * unlimited, or no additional clamping beyond the codec's built-in
- * algorithm.
- *
- * For example, to allocate no more than 4.5 frames worth of bitrate
- * to a keyframe, set this to 450.
- *
- */
- VP8E_SET_MAX_INTRA_BITRATE_PCT,
- VP8E_SET_FRAME_FLAGS, /**< control function to set reference and update frame flags */
-
- /*!\brief Max data rate for Inter frames
- *
- * This value controls additional clamping on the maximum size of an
- * inter frame. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * unlimited, or no additional clamping beyond the codec's built-in
- * algorithm.
- *
- * For example, to allow no more than 4.5 frames worth of bitrate
- * to an inter frame, set this to 450.
- *
- */
- VP8E_SET_MAX_INTER_BITRATE_PCT,
-
- /*!\brief Boost percentage for Golden Frame in CBR mode
- *
- * This value controls the amount of boost given to Golden Frame in
- * CBR mode. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * the feature is off, i.e., no golden frame boost in CBR mode and
- * average bitrate target is used.
- *
- * For example, to allow 100% more bits, i.e, 2X, in a golden frame
- * than average frame, set this to 100.
- *
- */
- VP8E_SET_GF_CBR_BOOST_PCT,
-
- /*!\brief Codec control function to set the temporal layer id
- *
- * For temporal scalability: this control allows the application to set the
- * layer id for each frame to be encoded. Note that this control must be set
- * for every frame prior to encoding. The usage of this control function
- * supersedes the internal temporal pattern counter, which is now deprecated.
- */
- VP8E_SET_TEMPORAL_LAYER_ID,
-
- VP8E_SET_SCREEN_CONTENT_MODE, /**<control function to set encoder screen content mode */
-
- /*!\brief Codec control function to set lossless encoding mode
- *
- * VP9 can operate in lossless encoding mode, in which the bitstream
- * produced will be able to decode and reconstruct a perfect copy of
- * input source. This control function provides a mean to switch encoder
- * into lossless coding mode(1) or normal coding mode(0) that may be lossy.
- * 0 = lossy coding mode
- * 1 = lossless coding mode
- *
- * By default, encoder operates in normal coding mode (maybe lossy).
- */
- VP9E_SET_LOSSLESS,
-
- /*!\brief Codec control function to set number of tile columns
- *
- * In encoding and decoding, VP9 allows an input image frame be partitioned
- * into separated vertical tile columns, which can be encoded or decoded
- * independently. This enables easy implementation of parallel encoding and
- * decoding. This control requests the encoder to use column tiles in
- * encoding an input frame, with number of tile columns (in Log2 unit) as
- * the parameter:
- * 0 = 1 tile column
- * 1 = 2 tile columns
- * 2 = 4 tile columns
- * .....
- * n = 2**n tile columns
- * The requested tile columns will be capped by encoder based on image size
- * limitation (The minimum width of a tile column is 256 pixel, the maximum
- * is 4096).
- *
- * By default, the value is 0, i.e. one single column tile for entire image.
- */
- VP9E_SET_TILE_COLUMNS,
-
- /*!\brief Codec control function to set number of tile rows
- *
- * In encoding and decoding, VP9 allows an input image frame be partitioned
- * into separated horizontal tile rows. Tile rows are encoded or decoded
- * sequentially. Even though encoding/decoding of later tile rows depends on
- * earlier ones, this allows the encoder to output data packets for tile rows
- * prior to completely processing all tile rows in a frame, thereby reducing
- * the latency in processing between input and output. The parameter
- * for this control describes the number of tile rows, which has a valid
- * range [0, 2]:
- * 0 = 1 tile row
- * 1 = 2 tile rows
- * 2 = 4 tile rows
- *
- * By default, the value is 0, i.e. one single row tile for entire image.
- */
- VP9E_SET_TILE_ROWS,
-
- /*!\brief Codec control function to enable frame parallel decoding feature
- *
- * VP9 has a bitstream feature to reduce decoding dependency between frames
- * by turning off backward update of probability context used in encoding
- * and decoding. This allows staged parallel processing of more than one
- * video frames in the decoder. This control function provides a mean to
- * turn this feature on or off for bitstreams produced by encoder.
- *
- * By default, this feature is off.
- */
- VP9E_SET_FRAME_PARALLEL_DECODING,
-
- /*!\brief Codec control function to set adaptive quantization mode
- *
- * VP9 has a segment based feature that allows encoder to adaptively change
- * quantization parameter for each segment within a frame to improve the
- * subjective quality. This control makes encoder operate in one of the
- * several AQ_modes supported.
- *
- * By default, encoder operates with AQ_Mode 0(adaptive quantization off).
- */
- VP9E_SET_AQ_MODE,
-
- /*!\brief Codec control function to enable/disable periodic Q boost
- *
- * One VP9 encoder speed feature is to enable quality boost by lowering
- * frame level Q periodically. This control function provides a mean to
- * turn on/off this feature.
- * 0 = off
- * 1 = on
- *
- * By default, the encoder is allowed to use this feature for appropriate
- * encoding modes.
- */
- VP9E_SET_FRAME_PERIODIC_BOOST,
-
- /*!\brief control function to set noise sensitivity
- *
- * 0: off, 1: OnYOnly
- */
- VP9E_SET_NOISE_SENSITIVITY,
-
- /*!\brief control function to turn on/off SVC in encoder.
- * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not
- * support SVC in its current encoding mode
- * 0: off, 1: on
- */
- VP9E_SET_SVC,
-
- /*!\brief control function to set parameters for SVC.
- * \note Parameters contain min_q, max_q, scaling factor for each of the
- * SVC layers.
- */
- VP9E_SET_SVC_PARAMETERS,
-
- /*!\brief control function to set svc layer for spatial and temporal.
- * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
- * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
- * temporal layer.
- */
- VP9E_SET_SVC_LAYER_ID,
-
- /*!\brief control function to set content type.
- * \note Valid parameter range:
- * VP9E_CONTENT_DEFAULT = Regular video content (Default)
- * VP9E_CONTENT_SCREEN = Screen capture content
- */
- VP9E_SET_TUNE_CONTENT,
-
- /*!\brief control function to get svc layer ID.
- * \note The layer ID returned is for the data packet from the registered
- * callback function.
- */
- VP9E_GET_SVC_LAYER_ID,
-
- /*!\brief control function to register callback for getting per layer packet.
- * \note Parameter for this control function is a structure with a callback
- * function and a pointer to private data used by the callback.
- */
- VP9E_REGISTER_CX_CALLBACK,
-
- /*!\brief control function to set color space info.
- * \note Valid ranges: 0..7, default is "UNKNOWN".
- * 0 = UNKNOWN,
- * 1 = BT_601
- * 2 = BT_709
- * 3 = SMPTE_170
- * 4 = SMPTE_240
- * 5 = BT_2020
- * 6 = RESERVED
- * 7 = SRGB
- */
- VP9E_SET_COLOR_SPACE,
+ VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
+ VP8E_SET_ARNR_STRENGTH, //!< control function to set the filter
+ //!< strength for the arf
+
+ /*!\deprecated control function to set the filter type to use for the arf */
+ VP8E_SET_ARNR_TYPE,
+
+ VP8E_SET_TUNING, /**< control function to set visual tuning */
+ /*!\brief control function to set constrained quality level
+ *
+ * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
+ * set to #VPX_CQ.
+ * \note Valid range: 0..63
+ */
+ VP8E_SET_CQ_LEVEL,
+
+ /*!\brief Max data rate for Intra frames
+ *
+ * This value controls additional clamping on the maximum size of a
+ * keyframe. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * unlimited, or no additional clamping beyond the codec's built-in
+ * algorithm.
+ *
+ * For example, to allocate no more than 4.5 frames worth of bitrate
+ * to a keyframe, set this to 450.
+ *
+ */
+ VP8E_SET_MAX_INTRA_BITRATE_PCT,
+ VP8E_SET_FRAME_FLAGS, /**< control function to set reference and update frame flags */
+
+ /*!\brief Max data rate for Inter frames
+ *
+ * This value controls additional clamping on the maximum size of an
+ * inter frame. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * unlimited, or no additional clamping beyond the codec's built-in
+ * algorithm.
+ *
+ * For example, to allow no more than 4.5 frames worth of bitrate
+ * to an inter frame, set this to 450.
+ *
+ */
+ VP8E_SET_MAX_INTER_BITRATE_PCT,
+
+ /*!\brief Boost percentage for Golden Frame in CBR mode
+ *
+ * This value controls the amount of boost given to Golden Frame in
+ * CBR mode. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * the feature is off, i.e., no golden frame boost in CBR mode and
+ * average bitrate target is used.
+ *
+ * For example, to allow 100% more bits, i.e, 2X, in a golden frame
+ * than average frame, set this to 100.
+ *
+ */
+ VP8E_SET_GF_CBR_BOOST_PCT,
+
+ /*!\brief Codec control function to set the temporal layer id
+ *
+ * For temporal scalability: this control allows the application to set the
+ * layer id for each frame to be encoded. Note that this control must be set
+ * for every frame prior to encoding. The usage of this control function
+ * supersedes the internal temporal pattern counter, which is now deprecated.
+ */
+ VP8E_SET_TEMPORAL_LAYER_ID,
+
+ VP8E_SET_SCREEN_CONTENT_MODE, /**<control function to set encoder screen content mode */
+
+ /*!\brief Codec control function to set lossless encoding mode
+ *
+ * VP9 can operate in lossless encoding mode, in which the bitstream
+ * produced will be able to decode and reconstruct a perfect copy of
+ * input source. This control function provides a mean to switch encoder
+ * into lossless coding mode(1) or normal coding mode(0) that may be lossy.
+ * 0 = lossy coding mode
+ * 1 = lossless coding mode
+ *
+ * By default, encoder operates in normal coding mode (maybe lossy).
+ */
+ VP9E_SET_LOSSLESS,
+
+ /*!\brief Codec control function to set number of tile columns
+ *
+ * In encoding and decoding, VP9 allows an input image frame be partitioned
+ * into separated vertical tile columns, which can be encoded or decoded
+ * independently. This enables easy implementation of parallel encoding and
+ * decoding. This control requests the encoder to use column tiles in
+ * encoding an input frame, with number of tile columns (in Log2 unit) as
+ * the parameter:
+ * 0 = 1 tile column
+ * 1 = 2 tile columns
+ * 2 = 4 tile columns
+ * .....
+ * n = 2**n tile columns
+ * The requested tile columns will be capped by encoder based on image size
+ * limitation (The minimum width of a tile column is 256 pixel, the maximum
+ * is 4096).
+ *
+ * By default, the value is 0, i.e. one single column tile for entire image.
+ */
+ VP9E_SET_TILE_COLUMNS,
+
+ /*!\brief Codec control function to set number of tile rows
+ *
+ * In encoding and decoding, VP9 allows an input image frame be partitioned
+ * into separated horizontal tile rows. Tile rows are encoded or decoded
+ * sequentially. Even though encoding/decoding of later tile rows depends on
+ * earlier ones, this allows the encoder to output data packets for tile rows
+ * prior to completely processing all tile rows in a frame, thereby reducing
+ * the latency in processing between input and output. The parameter
+ * for this control describes the number of tile rows, which has a valid
+ * range [0, 2]:
+ * 0 = 1 tile row
+ * 1 = 2 tile rows
+ * 2 = 4 tile rows
+ *
+ * By default, the value is 0, i.e. one single row tile for entire image.
+ */
+ VP9E_SET_TILE_ROWS,
+
+ /*!\brief Codec control function to enable frame parallel decoding feature
+ *
+ * VP9 has a bitstream feature to reduce decoding dependency between frames
+ * by turning off backward update of probability context used in encoding
+ * and decoding. This allows staged parallel processing of more than one
+ * video frames in the decoder. This control function provides a mean to
+ * turn this feature on or off for bitstreams produced by encoder.
+ *
+ * By default, this feature is off.
+ */
+ VP9E_SET_FRAME_PARALLEL_DECODING,
+
+ /*!\brief Codec control function to set adaptive quantization mode
+ *
+ * VP9 has a segment based feature that allows encoder to adaptively change
+ * quantization parameter for each segment within a frame to improve the
+ * subjective quality. This control makes encoder operate in one of the
+ * several AQ_modes supported.
+ *
+ * By default, encoder operates with AQ_Mode 0(adaptive quantization off).
+ */
+ VP9E_SET_AQ_MODE,
+
+ /*!\brief Codec control function to enable/disable periodic Q boost
+ *
+ * One VP9 encoder speed feature is to enable quality boost by lowering
+ * frame level Q periodically. This control function provides a mean to
+ * turn on/off this feature.
+ * 0 = off
+ * 1 = on
+ *
+ * By default, the encoder is allowed to use this feature for appropriate
+ * encoding modes.
+ */
+ VP9E_SET_FRAME_PERIODIC_BOOST,
+
+ /*!\brief control function to set noise sensitivity
+ *
+ * 0: off, 1: OnYOnly
+ */
+ VP9E_SET_NOISE_SENSITIVITY,
+
+ /*!\brief control function to turn on/off SVC in encoder.
+ * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not
+ * support SVC in its current encoding mode
+ * 0: off, 1: on
+ */
+ VP9E_SET_SVC,
+
+ /*!\brief control function to set parameters for SVC.
+ * \note Parameters contain min_q, max_q, scaling factor for each of the
+ * SVC layers.
+ */
+ VP9E_SET_SVC_PARAMETERS,
+
+ /*!\brief control function to set svc layer for spatial and temporal.
+ * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
+ * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
+ * temporal layer.
+ */
+ VP9E_SET_SVC_LAYER_ID,
+
+ /*!\brief control function to set content type.
+ * \note Valid parameter range:
+ * VP9E_CONTENT_DEFAULT = Regular video content (Default)
+ * VP9E_CONTENT_SCREEN = Screen capture content
+ */
+ VP9E_SET_TUNE_CONTENT,
+
+ /*!\brief control function to get svc layer ID.
+ * \note The layer ID returned is for the data packet from the registered
+ * callback function.
+ */
+ VP9E_GET_SVC_LAYER_ID,
+
+ /*!\brief control function to register callback for getting per layer packet.
+ * \note Parameter for this control function is a structure with a callback
+ * function and a pointer to private data used by the callback.
+ */
+ VP9E_REGISTER_CX_CALLBACK,
+
+ /*!\brief control function to set color space info.
+ * \note Valid ranges: 0..7, default is "UNKNOWN".
+ * 0 = UNKNOWN,
+ * 1 = BT_601
+ * 2 = BT_709
+ * 3 = SMPTE_170
+ * 4 = SMPTE_240
+ * 5 = BT_2020
+ * 6 = RESERVED
+ * 7 = SRGB
+ */
+ VP9E_SET_COLOR_SPACE,
};
/*!\brief vpx 1-D scaling mode
@@ -386,10 +386,10 @@ enum vp8e_enc_control_id {
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d {
- VP8E_NORMAL = 0,
- VP8E_FOURFIVE = 1,
- VP8E_THREEFIVE = 2,
- VP8E_ONETWO = 3
+ VP8E_NORMAL = 0,
+ VP8E_FOURFIVE = 1,
+ VP8E_THREEFIVE = 2,
+ VP8E_ONETWO = 3
} VPX_SCALING_MODE;
@@ -400,17 +400,17 @@ typedef enum vpx_scaling_mode_1d {
*/
typedef struct vpx_roi_map {
- /*! An id between 0 and 3 for each 16x16 region within a frame. */
- unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
- // TODO(paulwilkins): broken for VP9 which has 8 segments
- // q and loop filter deltas for each segment
- // (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
- /*! Static breakout threshold for each segment. */
- unsigned int static_threshold[4];
+ /*! An id between 0 and 3 for each 16x16 region within a frame. */
+ unsigned char *roi_map;
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
+ // TODO(paulwilkins): broken for VP9 which has 8 segments
+ // q and loop filter deltas for each segment
+ // (see MAX_MB_SEGMENTS)
+ int delta_q[4]; /**< Quantizer deltas. */
+ int delta_lf[4]; /**< Loop filter deltas. */
+ /*! Static breakout threshold for each segment. */
+ unsigned int static_threshold[4];
} vpx_roi_map_t;
/*!\brief vpx active region map
@@ -421,9 +421,9 @@ typedef struct vpx_roi_map {
typedef struct vpx_active_map {
- unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
- unsigned int rows; /**< number of rows */
- unsigned int cols; /**< number of cols */
+ unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
+ unsigned int rows; /**< number of rows */
+ unsigned int cols; /**< number of cols */
} vpx_active_map_t;
/*!\brief vpx image scaling mode
@@ -432,8 +432,8 @@ typedef struct vpx_active_map {
*
*/
typedef struct vpx_scaling_mode {
- VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
- VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
+ VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
+ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
/*!\brief VP8 token partition mode
@@ -444,17 +444,17 @@ typedef struct vpx_scaling_mode {
*/
typedef enum {
- VP8_ONE_TOKENPARTITION = 0,
- VP8_TWO_TOKENPARTITION = 1,
- VP8_FOUR_TOKENPARTITION = 2,
- VP8_EIGHT_TOKENPARTITION = 3
+ VP8_ONE_TOKENPARTITION = 0,
+ VP8_TWO_TOKENPARTITION = 1,
+ VP8_FOUR_TOKENPARTITION = 2,
+ VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
/*!brief VP9 encoder content type */
typedef enum {
- VP9E_CONTENT_DEFAULT,
- VP9E_CONTENT_SCREEN,
- VP9E_CONTENT_INVALID
+ VP9E_CONTENT_DEFAULT,
+ VP9E_CONTENT_SCREEN,
+ VP9E_CONTENT_INVALID
} vp9e_tune_content;
/*!\brief VP8 model tuning parameters
@@ -463,8 +463,8 @@ typedef enum {
*
*/
typedef enum {
- VP8_TUNE_PSNR,
- VP8_TUNE_SSIM
+ VP8_TUNE_PSNR,
+ VP8_TUNE_SSIM
} vp8e_tuning;
/*!\brief vp9 svc layer parameters
@@ -475,8 +475,8 @@ typedef enum {
*
*/
typedef struct vpx_svc_layer_id {
- int spatial_layer_id; /**< Spatial layer id number. */
- int temporal_layer_id; /**< Temporal layer id number. */
+ int spatial_layer_id; /**< Spatial layer id number. */
+ int temporal_layer_id; /**< Temporal layer id number. */
} vpx_svc_layer_id_t;
/*!\brief VP8 encoder control function parameter type
diff --git a/thirdparties/iphone/include/vpx/vp8dx.h b/thirdparties/iphone/include/vpx/vp8dx.h
index c5475c4..7996b63 100755
--- a/thirdparties/iphone/include/vpx/vp8dx.h
+++ b/thirdparties/iphone/include/vpx/vp8dx.h
@@ -52,50 +52,50 @@ extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
* \sa #vpx_codec_control
*/
enum vp8_dec_control_id {
- /** control function to get info on which reference frames were updated
- * by the last decode
- */
- VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
-
- /** check if the indicated frame is corrupted */
- VP8D_GET_FRAME_CORRUPTED,
-
- /** control function to get info on which reference frames were used
- * by the last decode
- */
- VP8D_GET_LAST_REF_USED,
-
- /** decryption function to decrypt encoded buffer data immediately
- * before decoding. Takes a vpx_decrypt_init, which contains
- * a callback function and opaque context pointer.
- */
- VPXD_SET_DECRYPTOR,
- VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR,
-
- /** control function to get the display dimensions for the current frame. */
- VP9D_GET_DISPLAY_SIZE,
-
- /** control function to get the bit depth of the stream. */
- VP9D_GET_BIT_DEPTH,
-
- /** control function to set the byte alignment of the planes in the reference
- * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets
- * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly
- * follows Y plane, and V plane directly follows U plane. Default value is 0.
- */
- VP9_SET_BYTE_ALIGNMENT,
-
- /** control function to invert the decoding order to from right to left. The
- * function is used in a test to confirm the decoding independence of tile
- * columns. The function may be used in application where this order
- * of decoding is desired.
- *
- * TODO(yaowu): Rework the unit test that uses this control, and in a future
- * release, this test-only control shall be removed.
- */
- VP9_INVERT_TILE_DECODE_ORDER,
-
- VP8_DECODER_CTRL_ID_MAX
+ /** control function to get info on which reference frames were updated
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
+
+ /** check if the indicated frame is corrupted */
+ VP8D_GET_FRAME_CORRUPTED,
+
+ /** control function to get info on which reference frames were used
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_USED,
+
+ /** decryption function to decrypt encoded buffer data immediately
+ * before decoding. Takes a vpx_decrypt_init, which contains
+ * a callback function and opaque context pointer.
+ */
+ VPXD_SET_DECRYPTOR,
+ VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR,
+
+ /** control function to get the display dimensions for the current frame. */
+ VP9D_GET_DISPLAY_SIZE,
+
+ /** control function to get the bit depth of the stream. */
+ VP9D_GET_BIT_DEPTH,
+
+ /** control function to set the byte alignment of the planes in the reference
+ * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets
+ * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly
+ * follows Y plane, and V plane directly follows U plane. Default value is 0.
+ */
+ VP9_SET_BYTE_ALIGNMENT,
+
+ /** control function to invert the decoding order to from right to left. The
+ * function is used in a test to confirm the decoding independence of tile
+ * columns. The function may be used in application where this order
+ * of decoding is desired.
+ *
+ * TODO(yaowu): Rework the unit test that uses this control, and in a future
+ * release, this test-only control shall be removed.
+ */
+ VP9_INVERT_TILE_DECODE_ORDER,
+
+ VP8_DECODER_CTRL_ID_MAX
};
/** Decrypt n bytes of data from input -> output, using the decrypt_state
diff --git a/thirdparties/iphone/include/vpx/vpx_codec.h b/thirdparties/iphone/include/vpx/vpx_codec.h
index b25308e..237d625 100755
--- a/thirdparties/iphone/include/vpx/vpx_codec.h
+++ b/thirdparties/iphone/include/vpx/vpx_codec.h
@@ -46,7 +46,7 @@ extern "C" {
#include "./vpx_integer.h"
#include "./vpx_image.h"
- /*!\brief Decorator indicating a function is deprecated */
+/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
#if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__ ((deprecated))
@@ -67,7 +67,7 @@ extern "C" {
#endif
#endif /* DECLSPEC_DEPRECATED */
- /*!\brief Decorator indicating a function is potentially unused */
+/*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED
#elif __GNUC__
#define UNUSED __attribute__ ((unused))
@@ -75,18 +75,18 @@ extern "C" {
#define UNUSED
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
- /*!\brief Algorithm return codes */
- typedef enum {
+/*!\brief Algorithm return codes */
+typedef enum {
/*!\brief Operation completed without error */
VPX_CODEC_OK,
@@ -138,256 +138,256 @@ extern "C" {
*/
VPX_CODEC_LIST_END
- }
- vpx_codec_err_t;
+}
+vpx_codec_err_t;
- /*! \brief Codec capabilities bitfield
- *
- * Each codec advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
- typedef long vpx_codec_caps_t;
+/*! \brief Codec capabilities bitfield
+ *
+ * Each codec advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
+typedef long vpx_codec_caps_t;
#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
- typedef long vpx_codec_flags_t;
-
-
- /*!\brief Codec interface structure.
- *
- * Contains function pointers and other data private to the codec
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_codec_iface_t;
-
-
- /*!\brief Codec private data structure.
- *
- * Contains data private to the codec implementation. This structure is opaque
- * to the application.
- */
- typedef struct vpx_codec_priv vpx_codec_priv_t;
-
-
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef const void *vpx_codec_iter_t;
-
-
- /*!\brief Codec context structure
- *
- * All codecs \ref MUST support this context structure fully. In general,
- * this data should be considered private to the codec algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
- typedef struct vpx_codec_ctx {
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
+typedef long vpx_codec_flags_t;
+
+
+/*!\brief Codec interface structure.
+ *
+ * Contains function pointers and other data private to the codec
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_codec_iface_t;
+
+
+/*!\brief Codec private data structure.
+ *
+ * Contains data private to the codec implementation. This structure is opaque
+ * to the application.
+ */
+typedef struct vpx_codec_priv vpx_codec_priv_t;
+
+
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef const void *vpx_codec_iter_t;
+
+
+/*!\brief Codec context structure
+ *
+ * All codecs \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the codec algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
+typedef struct vpx_codec_ctx {
const char *name; /**< Printable interface name */
vpx_codec_iface_t *iface; /**< Interface pointers */
vpx_codec_err_t err; /**< Last returned error */
const char *err_detail; /**< Detailed info, if available */
vpx_codec_flags_t init_flags; /**< Flags passed at init time */
union {
- /**< Decoder Configuration Pointer */
- const struct vpx_codec_dec_cfg *dec;
- /**< Encoder Configuration Pointer */
- const struct vpx_codec_enc_cfg *enc;
- const void *raw;
+ /**< Decoder Configuration Pointer */
+ const struct vpx_codec_dec_cfg *dec;
+ /**< Encoder Configuration Pointer */
+ const struct vpx_codec_enc_cfg *enc;
+ const void *raw;
} config; /**< Configuration pointer aliasing union */
vpx_codec_priv_t *priv; /**< Algorithm private storage */
- } vpx_codec_ctx_t;
+} vpx_codec_ctx_t;
- /*!\brief Bit depth for codec
- * *
- * This enumeration determines the bit depth of the codec.
- */
- typedef enum vpx_bit_depth {
+/*!\brief Bit depth for codec
+ * *
+ * This enumeration determines the bit depth of the codec.
+ */
+typedef enum vpx_bit_depth {
VPX_BITS_8 = 8, /**< 8 bits */
VPX_BITS_10 = 10, /**< 10 bits */
VPX_BITS_12 = 12, /**< 12 bits */
- } vpx_bit_depth_t;
-
- /*
- * Library Version Number Interface
- *
- * For example, see the following sample return values:
- * vpx_codec_version() (1<<16 | 2<<8 | 3)
- * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
- * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
- */
-
- /*!\brief Return the version information (as an integer)
- *
- * Returns a packed encoding of the library version number. This will only include
- * the major.minor.patch component of the version number. Note that this encoded
- * value should be accessed through the macros provided, as the encoding may change
- * in the future.
- *
- */
- int vpx_codec_version(void);
+} vpx_bit_depth_t;
+
+/*
+ * Library Version Number Interface
+ *
+ * For example, see the following sample return values:
+ * vpx_codec_version() (1<<16 | 2<<8 | 3)
+ * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
+ * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
+ */
+
+/*!\brief Return the version information (as an integer)
+ *
+ * Returns a packed encoding of the library version number. This will only include
+ * the major.minor.patch component of the version number. Note that this encoded
+ * value should be accessed through the macros provided, as the encoding may change
+ * in the future.
+ *
+ */
+int vpx_codec_version(void);
#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */
#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */
#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */
- /*!\brief Return the version major number */
+/*!\brief Return the version major number */
#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff)
- /*!\brief Return the version minor number */
+/*!\brief Return the version minor number */
#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff)
- /*!\brief Return the version patch number */
+/*!\brief Return the version patch number */
#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff)
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable string containing the full library version number. This may
- * contain additional text following the three digit version number, as to indicate
- * release candidates, prerelease versions, etc.
- *
- */
- const char *vpx_codec_version_str(void);
-
-
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable "extra string". This is the component of the string returned
- * by vpx_codec_version_str() following the three digit version number.
- *
- */
- const char *vpx_codec_version_extra_str(void);
-
-
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_codec_build_config(void);
-
-
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given codec interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
-
-
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_codec_err_to_string(vpx_codec_err_t err);
-
-
- /*!\brief Retrieve error synopsis for codec context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Retrieve detailed error information for codec context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
-
-
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all codecs.
- * They represent the base case functionality expected of all codecs.
- */
-
- /*!\brief Destroy a codec instance
- *
- * Destroys a codec context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_CODEC_OK
- * The codec algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
-
-
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the codec
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_CODEC_ERROR if the request could not
- * be dispatched.
- *
- * Note that this function should not be used directly. Call the
- * #vpx_codec_control wrapper macro instead.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- *
- * \retval #VPX_CODEC_OK
- * The control request was processed.
- * \retval #VPX_CODEC_ERROR
- * The control request was not processed.
- * \retval #VPX_CODEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
- int ctrl_id,
- ...);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable string containing the full library version number. This may
+ * contain additional text following the three digit version number, as to indicate
+ * release candidates, prerelease versions, etc.
+ *
+ */
+const char *vpx_codec_version_str(void);
+
+
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable "extra string". This is the component of the string returned
+ * by vpx_codec_version_str() following the three digit version number.
+ *
+ */
+const char *vpx_codec_version_extra_str(void);
+
+
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_codec_build_config(void);
+
+
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given codec interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
+
+
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_codec_err_to_string(vpx_codec_err_t err);
+
+
+/*!\brief Retrieve error synopsis for codec context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Retrieve detailed error information for codec context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+
+
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all codecs.
+ * They represent the base case functionality expected of all codecs.
+ */
+
+/*!\brief Destroy a codec instance
+ *
+ * Destroys a codec context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_CODEC_OK
+ * The codec algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
+
+
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the codec
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_CODEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * Note that this function should not be used directly. Call the
+ * #vpx_codec_control wrapper macro instead.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ *
+ * \retval #VPX_CODEC_OK
+ * The control request was processed.
+ * \retval #VPX_CODEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
+ int ctrl_id,
+ ...);
#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS
# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data)
# define VPX_CTRL_USE_TYPE(id, typ)
@@ -395,30 +395,30 @@ extern "C" {
# define VPX_CTRL_VOID(id, typ)
#else
- /*!\brief vpx_codec_control wrapper macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_().
- *
- * \internal
- * It works by dispatching the call to the control function through a wrapper
- * function named with the id parameter.
- */
+/*!\brief vpx_codec_control wrapper macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_().
+ *
+ * \internal
+ * It works by dispatching the call to the control function through a wrapper
+ * function named with the id parameter.
+ */
# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\
/**<\hideinitializer*/
- /*!\brief vpx_codec_control type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It defines the type of the argument for a given
- * control identifier.
- *
- * \internal
- * It defines a static function with
- * the correctly typed arguments as a wrapper to the type-unsafe internal
- * function.
- */
+/*!\brief vpx_codec_control type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It defines the type of the argument for a given
+ * control identifier.
+ *
+ * \internal
+ * It defines a static function with
+ * the correctly typed arguments as a wrapper to the type-unsafe internal
+ * function.
+ */
# define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\
@@ -429,16 +429,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control deprecated type definition macro
- *
- * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
- * deprecated and should not be used. Consult the documentation for your
- * codec for more information.
- *
- * \internal
- * It defines a static function with the correctly typed arguments as a
- * wrapper to the type-unsafe internal function.
- */
+/*!\brief vpx_codec_control deprecated type definition macro
+ *
+ * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
+ * deprecated and should not be used. Consult the documentation for your
+ * codec for more information.
+ *
+ * \internal
+ * It defines a static function with the correctly typed arguments as a
+ * wrapper to the type-unsafe internal function.
+ */
# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\
@@ -449,16 +449,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control void type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It indicates that a given control identifier takes
- * no argument.
- *
- * \internal
- * It defines a static function without a data argument as a wrapper to the
- * type-unsafe internal function.
- */
+/*!\brief vpx_codec_control void type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It indicates that a given control identifier takes
+ * no argument.
+ *
+ * \internal
+ * It defines a static function without a data argument as a wrapper to the
+ * type-unsafe internal function.
+ */
# define VPX_CTRL_VOID(id) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\
@@ -471,7 +471,7 @@ extern "C" {
#endif
- /*!@} - end defgroup codec*/
+/*!@} - end defgroup codec*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/iphone/include/vpx/vpx_decoder.h b/thirdparties/iphone/include/vpx/vpx_decoder.h
index 62fd919..7fb13bd 100755
--- a/thirdparties/iphone/include/vpx/vpx_decoder.h
+++ b/thirdparties/iphone/include/vpx/vpx_decoder.h
@@ -32,24 +32,24 @@ extern "C" {
#include "./vpx_codec.h"
#include "./vpx_frame_buffer.h"
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_DECODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Decoder capabilities bitfield
- *
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
@@ -58,13 +58,13 @@ extern "C" {
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames
one fragment at a time */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based
multi-threading */
#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external
@@ -79,298 +79,298 @@ extern "C" {
#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based
multi-threading */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
- typedef struct vpx_codec_stream_info {
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
+typedef struct vpx_codec_stream_info {
unsigned int sz; /**< Size of this structure */
unsigned int w; /**< Width (or 0 for unknown/default) */
unsigned int h; /**< Height (or 0 for unknown/default) */
unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_codec_stream_info_t;
+} vpx_codec_stream_info_t;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialization Configurations
- *
- * This structure is used to pass init time configuration options to the
- * decoder.
- */
- typedef struct vpx_codec_dec_cfg {
+/*!\brief Initialization Configurations
+ *
+ * This structure is used to pass init time configuration options to the
+ * decoder.
+ */
+typedef struct vpx_codec_dec_cfg {
unsigned int threads; /**< Maximum number of threads to use, default 1 */
unsigned int w; /**< Width */
unsigned int h; /**< Height */
- } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
-
-
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_codec_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- const vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
- /*!\brief Convenience macro for vpx_codec_dec_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
+
+
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_codec_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ const vpx_codec_dec_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+/*!\brief Convenience macro for vpx_codec_dec_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_dec_init(ctx, iface, cfg, flags) \
vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
- * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
- * time stamp) order. Frames produced will always be in PTS (presentation
- * time stamp) order.
- * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
- * data and data_sz can contain a fragment of the encoded frame. Fragment
- * \#n must contain at least partition \#n, but can also contain subsequent
- * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
- * be empty. When no more data is available, this function should be called
- * with NULL as data and 0 as data_sz. The memory passed to this function
- * must be available until the frame has been decoded.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] deadline Soft deadline the decoder should attempt to meet,
- * in us. Set to zero for unlimited.
- *
- * \return Returns #VPX_CODEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_codec_err_t
- * for recoverability capabilities.
- */
- vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
- const uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- long deadline);
-
-
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
-
-
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_frame_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_frame */
-
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
-
-
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_slice_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_slice*/
-
- /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions
- *
- * The following section is required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability.
- * Calling this function for codecs that don't advertise this capability
- * will result in an error code being returned, usually VPX_CODEC_ERROR.
- *
- * \note
- * Currently this only works with VP9.
- * @{
- */
-
- /*!\brief Pass in external frame buffers for the decoder to use.
- *
- * Registers functions to be called when libvpx needs a frame buffer
- * to decode the current frame and a function to be called when libvpx does
- * not internally reference the frame buffer. This set function must
- * be called before the first call to decode or libvpx will assume the
- * default behavior of allocating frame buffers internally.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb_get Pointer to the get callback function
- * \param[in] cb_release Pointer to the release callback function
- * \param[in] cb_priv Callback's private data
- *
- * \retval #VPX_CODEC_OK
- * External frame buffers will be used by libvpx.
- * \retval #VPX_CODEC_INVALID_PARAM
- * One or more of the callbacks were NULL.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * using external frame buffers.
- *
- * \note
- * When decoding VP9, the application may be required to pass in at least
- * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
- * buffers.
- */
- vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
- vpx_codec_ctx_t *ctx,
- vpx_get_frame_buffer_cb_fn_t cb_get,
- vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
-
- /*!@} - end defgroup cap_external_frame_buffer */
-
- /*!@} - end defgroup decoder*/
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
+ * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
+ * time stamp) order. Frames produced will always be in PTS (presentation
+ * time stamp) order.
+ * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
+ * data and data_sz can contain a fragment of the encoded frame. Fragment
+ * \#n must contain at least partition \#n, but can also contain subsequent
+ * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
+ * be empty. When no more data is available, this function should be called
+ * with NULL as data and 0 as data_sz. The memory passed to this function
+ * must be available until the frame has been decoded.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] deadline Soft deadline the decoder should attempt to meet,
+ * in us. Set to zero for unlimited.
+ *
+ * \return Returns #VPX_CODEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_codec_err_t
+ * for recoverability capabilities.
+ */
+vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
+ const uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ long deadline);
+
+
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
+
+
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_frame_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_frame */
+
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
+
+
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_slice_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_slice*/
+
+/*!\defgroup cap_external_frame_buffer External Frame Buffer Functions
+ *
+ * The following section is required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability.
+ * Calling this function for codecs that don't advertise this capability
+ * will result in an error code being returned, usually VPX_CODEC_ERROR.
+ *
+ * \note
+ * Currently this only works with VP9.
+ * @{
+ */
+
+/*!\brief Pass in external frame buffers for the decoder to use.
+ *
+ * Registers functions to be called when libvpx needs a frame buffer
+ * to decode the current frame and a function to be called when libvpx does
+ * not internally reference the frame buffer. This set function must
+ * be called before the first call to decode or libvpx will assume the
+ * default behavior of allocating frame buffers internally.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb_get Pointer to the get callback function
+ * \param[in] cb_release Pointer to the release callback function
+ * \param[in] cb_priv Callback's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * External frame buffers will be used by libvpx.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * One or more of the callbacks were NULL.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * using external frame buffers.
+ *
+ * \note
+ * When decoding VP9, the application may be required to pass in at least
+ * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
+ * buffers.
+ */
+vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
+ vpx_codec_ctx_t *ctx,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
+
+/*!@} - end defgroup cap_external_frame_buffer */
+
+/*!@} - end defgroup decoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/iphone/include/vpx/vpx_encoder.h b/thirdparties/iphone/include/vpx/vpx_encoder.h
index 8f7bff5..4006856 100755
--- a/thirdparties/iphone/include/vpx/vpx_encoder.h
+++ b/thirdparties/iphone/include/vpx/vpx_encoder.h
@@ -31,18 +31,18 @@ extern "C" {
#include "./vpx_codec.h"
- /*! Temporal Scalability: Maximum length of the sequence defining frame
- * layer membership
- */
+/*! Temporal Scalability: Maximum length of the sequence defining frame
+ * layer membership
+ */
#define VPX_TS_MAX_PERIODICITY 16
- /*! Temporal Scalability: Maximum number of coding layers */
+/*! Temporal Scalability: Maximum number of coding layers */
#define VPX_TS_MAX_LAYERS 5
- /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
+/*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
- /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
+/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
#define MAX_LAYERS VPX_TS_MAX_LAYERS
/*! Spatial Scalability: Maximum number of coding layers */
@@ -51,78 +51,78 @@ extern "C" {
/*! Spatial Scalability: Default number of coding layers */
#define VPX_SS_DEFAULT_LAYERS 1
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Encoder capabilities bitfield
- *
- * Each encoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra
- * interfaces or functionality, and are not required to be supported
- * by an encoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Encoder capabilities bitfield
+ *
+ * Each encoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra
+ * interfaces or functionality, and are not required to be supported
+ * by an encoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
- /*! Can output one partition at a time. Each partition is returned in its
- * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
- * every partition but the last. In this mode all frames are always
- * returned partition by partition.
- */
+/*! Can output one partition at a time. Each partition is returned in its
+ * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
+ * every partition but the last. In this mode all frames are always
+ * returned partition by partition.
+ */
#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
/*! Can support input images at greater than 8 bitdepth.
*/
#define VPX_CODEC_CAP_HIGHBITDEPTH 0x40000
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow
- * for proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow
+ * for proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one
partition at a time. */
#define VPX_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
- /*!\brief Generic fixed size buffer structure
- *
- * This structure is able to hold a reference to any fixed size buffer.
- */
- typedef struct vpx_fixed_buf {
+/*!\brief Generic fixed size buffer structure
+ *
+ * This structure is able to hold a reference to any fixed size buffer.
+ */
+typedef struct vpx_fixed_buf {
void *buf; /**< Pointer to the data */
size_t sz; /**< Length of the buffer, in chars */
- } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
+} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
- /*!\brief Time Stamp Type
- *
- * An integer, which when multiplied by the stream's time base, provides
- * the absolute time of a sample.
- */
- typedef int64_t vpx_codec_pts_t;
+/*!\brief Time Stamp Type
+ *
+ * An integer, which when multiplied by the stream's time base, provides
+ * the absolute time of a sample.
+ */
+typedef int64_t vpx_codec_pts_t;
- /*!\brief Compressed Frame Flags
- *
- * This type represents a bitfield containing information about a compressed
- * frame that may be useful to an application. The most significant 16 bits
- * can be used by an algorithm to provide additional detail, for example to
- * support frame types that are codec specific (MPEG-1 D-frames for example)
- */
- typedef uint32_t vpx_codec_frame_flags_t;
+/*!\brief Compressed Frame Flags
+ *
+ * This type represents a bitfield containing information about a compressed
+ * frame that may be useful to an application. The most significant 16 bits
+ * can be used by an algorithm to provide additional detail, for example to
+ * support frame types that are codec specific (MPEG-1 D-frames for example)
+ */
+typedef uint32_t vpx_codec_frame_flags_t;
#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */
#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting
the stream (no future frame depends on
@@ -132,13 +132,13 @@ extern "C" {
#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded
frame */
- /*!\brief Error Resilient flags
- *
- * These flags define which error resilient features to enable in the
- * encoder. The flags are specified through the
- * vpx_codec_enc_cfg::g_error_resilient variable.
- */
- typedef uint32_t vpx_codec_er_flags_t;
+/*!\brief Error Resilient flags
+ *
+ * These flags define which error resilient features to enable in the
+ * encoder. The flags are specified through the
+ * vpx_codec_enc_cfg::g_error_resilient variable.
+ */
+typedef uint32_t vpx_codec_er_flags_t;
#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against
losses of whole frames */
#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are
@@ -150,13 +150,13 @@ extern "C" {
predicition is still done over
the partition boundary. */
- /*!\brief Encoder output packet variants
- *
- * This enumeration lists the different kinds of data packets that can be
- * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
- * extend this list to provide additional functionality.
- */
- enum vpx_codec_cx_pkt_kind {
+/*!\brief Encoder output packet variants
+ *
+ * This enumeration lists the different kinds of data packets that can be
+ * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
+ * extend this list to provide additional functionality.
+ */
+enum vpx_codec_cx_pkt_kind {
VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */
@@ -168,134 +168,134 @@ extern "C" {
VPX_CODEC_SPATIAL_SVC_LAYER_PSNR, /**< PSNR for each layer in this frame*/
#endif
VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
- };
+};
- /*!\brief Encoder output packet
- *
- * This structure contains the different kinds of output data the encoder
- * may produce while compressing a frame.
- */
- typedef struct vpx_codec_cx_pkt {
+/*!\brief Encoder output packet
+ *
+ * This structure contains the different kinds of output data the encoder
+ * may produce while compressing a frame.
+ */
+typedef struct vpx_codec_cx_pkt {
enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
union {
- struct {
- void *buf; /**< compressed data buffer */
- size_t sz; /**< length of compressed data */
- vpx_codec_pts_t pts; /**< time stamp to show frame
+ struct {
+ void *buf; /**< compressed data buffer */
+ size_t sz; /**< length of compressed data */
+ vpx_codec_pts_t pts; /**< time stamp to show frame
(in timebase units) */
- unsigned long duration; /**< duration to show frame
+ unsigned long duration; /**< duration to show frame
(in timebase units) */
- vpx_codec_frame_flags_t flags; /**< flags for this frame */
- int partition_id; /**< the partition id
+ vpx_codec_frame_flags_t flags; /**< flags for this frame */
+ int partition_id; /**< the partition id
defines the decoding order
of the partitions. Only
applicable when "output partition"
mode is enabled. First partition
has id 0.*/
- } frame; /**< data for compressed frame packet */
- vpx_fixed_buf_t twopass_stats; /**< data for two-pass packet */
- vpx_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */
- struct vpx_psnr_pkt {
- unsigned int samples[4]; /**< Number of samples, total/y/u/v */
- uint64_t sse[4]; /**< sum squared error, total/y/u/v */
- double psnr[4]; /**< PSNR, total/y/u/v */
- } psnr; /**< data for PSNR packet */
- vpx_fixed_buf_t raw; /**< data for arbitrary packets */
- // TODO(minghai): This is for testing purporses. The released library
- // can't depend on vpx_config.h
+ } frame; /**< data for compressed frame packet */
+ vpx_fixed_buf_t twopass_stats; /**< data for two-pass packet */
+ vpx_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */
+ struct vpx_psnr_pkt {
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
+ double psnr[4]; /**< PSNR, total/y/u/v */
+ } psnr; /**< data for PSNR packet */
+ vpx_fixed_buf_t raw; /**< data for arbitrary packets */
+ // TODO(minghai): This is for testing purporses. The released library
+ // can't depend on vpx_config.h
#if defined(CONFIG_SPATIAL_SVC) && CONFIG_SPATIAL_SVC
- size_t layer_sizes[VPX_SS_MAX_LAYERS];
- struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS];
+ size_t layer_sizes[VPX_SS_MAX_LAYERS];
+ struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS];
#endif
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
+ /* This packet size is fixed to allow codecs to extend this
+ * interface without having to manage storage for raw packets,
+ * i.e., if it's smaller than 128 bytes, you can store in the
+ * packet list directly.
+ */
+ char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
} data; /**< packet data */
- } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
+} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
- /*!\brief Encoder return output buffer callback
- *
- * This callback function, when registered, returns with packets when each
- * spatial layer is encoded.
- */
- // putting the definitions here for now. (agrange: find if there
- // is a better place for this)
- typedef void (* vpx_codec_enc_output_cx_pkt_cb_fn_t)(vpx_codec_cx_pkt_t *pkt,
- void *user_data);
+/*!\brief Encoder return output buffer callback
+ *
+ * This callback function, when registered, returns with packets when each
+ * spatial layer is encoded.
+ */
+// putting the definitions here for now. (agrange: find if there
+// is a better place for this)
+typedef void (* vpx_codec_enc_output_cx_pkt_cb_fn_t)(vpx_codec_cx_pkt_t *pkt,
+ void *user_data);
- /*!\brief Callback function pointer / user data pair storage */
- typedef struct vpx_codec_enc_output_cx_cb_pair {
+/*!\brief Callback function pointer / user data pair storage */
+typedef struct vpx_codec_enc_output_cx_cb_pair {
vpx_codec_enc_output_cx_pkt_cb_fn_t output_cx_pkt; /**< Callback function */
void *user_priv; /**< Pointer to private data */
- } vpx_codec_priv_output_cx_pkt_cb_pair_t;
+} vpx_codec_priv_output_cx_pkt_cb_pair_t;
- /*!\brief Rational Number
- *
- * This structure holds a fractional value.
- */
- typedef struct vpx_rational {
+/*!\brief Rational Number
+ *
+ * This structure holds a fractional value.
+ */
+typedef struct vpx_rational {
int num; /**< fraction numerator */
int den; /**< fraction denominator */
- } vpx_rational_t; /**< alias for struct vpx_rational */
+} vpx_rational_t; /**< alias for struct vpx_rational */
- /*!\brief Multi-pass Encoding Pass */
- enum vpx_enc_pass {
+/*!\brief Multi-pass Encoding Pass */
+enum vpx_enc_pass {
VPX_RC_ONE_PASS, /**< Single pass mode */
VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
- };
+};
- /*!\brief Rate control mode */
- enum vpx_rc_mode {
+/*!\brief Rate control mode */
+enum vpx_rc_mode {
VPX_VBR, /**< Variable Bit Rate (VBR) mode */
VPX_CBR, /**< Constant Bit Rate (CBR) mode */
VPX_CQ, /**< Constrained Quality (CQ) mode */
VPX_Q, /**< Constant Quality (Q) mode */
- };
-
-
- /*!\brief Keyframe placement mode.
- *
- * This enumeration determines whether keyframes are placed automatically by
- * the encoder or whether this behavior is disabled. Older releases of this
- * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
- * This name is confusing for this behavior, so the new symbols to be used
- * are VPX_KF_AUTO and VPX_KF_DISABLED.
- */
- enum vpx_kf_mode {
+};
+
+
+/*!\brief Keyframe placement mode.
+ *
+ * This enumeration determines whether keyframes are placed automatically by
+ * the encoder or whether this behavior is disabled. Older releases of this
+ * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
+ * This name is confusing for this behavior, so the new symbols to be used
+ * are VPX_KF_AUTO and VPX_KF_DISABLED.
+ */
+enum vpx_kf_mode {
VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
- };
+};
- /*!\brief Encoded Frame Flags
- *
- * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
- * per-frame boolean values. By convention, bits common to all codecs will be
- * named VPX_EFLAG_*, and bits specific to an algorithm will be named
- * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
- */
- typedef long vpx_enc_frame_flags_t;
+/*!\brief Encoded Frame Flags
+ *
+ * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
+ * per-frame boolean values. By convention, bits common to all codecs will be
+ * named VPX_EFLAG_*, and bits specific to an algorithm will be named
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
+ */
+typedef long vpx_enc_frame_flags_t;
#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */
- /*!\brief Encoder configuration structure
- *
- * This structure contains the encoder settings that have common representations
- * across all codecs. This doesn't imply that all codecs support all features,
- * however.
- */
- typedef struct vpx_codec_enc_cfg {
+/*!\brief Encoder configuration structure
+ *
+ * This structure contains the encoder settings that have common representations
+ * across all codecs. This doesn't imply that all codecs support all features,
+ * however.
+ */
+typedef struct vpx_codec_enc_cfg {
/*
* generic settings (g)
*/
@@ -729,150 +729,150 @@ extern "C" {
* ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1).
*/
unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
- } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
-
- /*!\brief vp9 svc extra configure parameters
- *
- * This defines max/min quantizers and scale factors for each layer
- *
- */
- typedef struct vpx_svc_parameters {
+} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+
+/*!\brief vp9 svc extra configure parameters
+ *
+ * This defines max/min quantizers and scale factors for each layer
+ *
+ */
+typedef struct vpx_svc_parameters {
int max_quantizers[VPX_SS_MAX_LAYERS]; /**< Max Q for each layer */
int min_quantizers[VPX_SS_MAX_LAYERS]; /**< Min Q for each layer */
int scaling_factor_num[VPX_SS_MAX_LAYERS]; /**< Scaling factor-numerator*/
int scaling_factor_den[VPX_SS_MAX_LAYERS]; /**< Scaling factor-denominator*/
- } vpx_svc_extra_cfg_t;
-
-
- /*!\brief Initialize an encoder instance
- *
- * Initializes a encoder context using the given interface. Applications
- * should call the vpx_codec_enc_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- const vpx_codec_enc_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_svc_extra_cfg_t;
+
+
+/*!\brief Initialize an encoder instance
+ *
+ * Initializes a encoder context using the given interface. Applications
+ * should call the vpx_codec_enc_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ const vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init(ctx, iface, cfg, flags) \
vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
- /*!\brief Initialize multi-encoder instance
- *
- * Initializes multi-encoder context using the given interface.
- * Applications should call the vpx_codec_enc_init_multi convenience macro
- * instead of this function directly, to ensure that the ABI version number
- * parameter is properly initialized.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] num_enc Total number of encoders.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] dsf Pointer to down-sampling factors.
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- int num_enc,
- vpx_codec_flags_t flags,
- vpx_rational_t *dsf,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Initialize multi-encoder instance
+ *
+ * Initializes multi-encoder context using the given interface.
+ * Applications should call the vpx_codec_enc_init_multi convenience macro
+ * instead of this function directly, to ensure that the ABI version number
+ * parameter is properly initialized.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] num_enc Total number of encoders.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] dsf Pointer to down-sampling factors.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ int num_enc,
+ vpx_codec_flags_t flags,
+ vpx_rational_t *dsf,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
VPX_ENCODER_ABI_VERSION)
- /*!\brief Get a default configuration
- *
- * Initializes a encoder configuration structure with default values. Supports
- * the notion of "usages" so that an algorithm may offer different default
- * settings depending on the user's intended goal. This function \ref SHOULD
- * be called by all applications to initialize the configuration structure
- * before specializing the configuration with application specific values.
- *
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[out] cfg Configuration buffer to populate
- * \param[in] usage End usage. Set to 0 or use codec specific values.
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- unsigned int usage);
-
-
- /*!\brief Set or change configuration
- *
- * Reconfigures an encoder instance according to the given configuration.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cfg Configuration buffer to use
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
- const vpx_codec_enc_cfg_t *cfg);
-
-
- /*!\brief Get global stream headers
- *
- * Retrieves a stream level global header packet, if supported by the codec.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval NULL
- * Encoder does not support global header
- * \retval Non-NULL
- * Pointer to buffer containing global header packet
- */
- vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
+/*!\brief Get a default configuration
+ *
+ * Initializes a encoder configuration structure with default values. Supports
+ * the notion of "usages" so that an algorithm may offer different default
+ * settings depending on the user's intended goal. This function \ref SHOULD
+ * be called by all applications to initialize the configuration structure
+ * before specializing the configuration with application specific values.
+ *
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[out] cfg Configuration buffer to populate
+ * \param[in] usage End usage. Set to 0 or use codec specific values.
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ unsigned int usage);
+
+
+/*!\brief Set or change configuration
+ *
+ * Reconfigures an encoder instance according to the given configuration.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cfg Configuration buffer to use
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
+ const vpx_codec_enc_cfg_t *cfg);
+
+
+/*!\brief Get global stream headers
+ *
+ * Retrieves a stream level global header packet, if supported by the codec.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval NULL
+ * Encoder does not support global header
+ * \retval Non-NULL
+ * Pointer to buffer containing global header packet
+ */
+vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to
@@ -881,141 +881,141 @@ extern "C" {
* VPx GOOD QUALITY mode. */
#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to
* VPx BEST QUALITY mode. */
- /*!\brief Encode a frame
- *
- * Encodes a video frame at the given "presentation time." The presentation
- * time stamp (PTS) \ref MUST be strictly increasing.
- *
- * The encoder supports the notion of a soft real-time deadline. Given a
- * non-zero value to the deadline parameter, the encoder will make a "best
- * effort" guarantee to return before the given time slice expires. It is
- * implicit that limiting the available time to encode will degrade the
- * output quality. The encoder can be given an unlimited time to produce the
- * best possible frame by specifying a deadline of '0'. This deadline
- * supercedes the VPx notion of "best quality, good quality, realtime".
- * Applications that wish to map these former settings to the new deadline
- * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
- * and #VPX_DL_BEST_QUALITY.
- *
- * When the last frame has been passed to the encoder, this function should
- * continue to be called, with the img parameter set to NULL. This will
- * signal the end-of-stream condition to the encoder and allow it to encode
- * any held buffers. Encoding is complete when vpx_codec_encode() is called
- * and vpx_codec_get_cx_data() returns no data.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] img Image data to encode, NULL to flush.
- * \param[in] pts Presentation time stamp, in timebase units.
- * \param[in] duration Duration to show frame, in timebase units.
- * \param[in] flags Flags to use for encoding this frame.
- * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
- const vpx_image_t *img,
- vpx_codec_pts_t pts,
- unsigned long duration,
- vpx_enc_frame_flags_t flags,
- unsigned long deadline);
-
- /*!\brief Set compressed data output buffer
- *
- * Sets the buffer that the codec should output the compressed data
- * into. This call effectively sets the buffer pointer returned in the
- * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
- * appended into this buffer. The buffer is preserved across frames,
- * so applications must periodically call this function after flushing
- * the accumulated compressed data to disk or to the network to reset
- * the pointer to the buffer's head.
- *
- * `pad_before` bytes will be skipped before writing the compressed
- * data, and `pad_after` bytes will be appended to the packet. The size
- * of the packet will be the sum of the size of the actual compressed
- * data, pad_before, and pad_after. The padding bytes will be preserved
- * (not overwritten).
- *
- * Note that calling this function does not guarantee that the returned
- * compressed data will be placed into the specified buffer. In the
- * event that the encoded data will not fit into the buffer provided,
- * the returned packet \ref MAY point to an internal buffer, as it would
- * if this call were never used. In this event, the output packet will
- * NOT have any padding, and the application must free space and copy it
- * to the proper place. This is of particular note in configurations
- * that may output multiple packets for a single encoded frame (e.g., lagged
- * encoding) or if the application does not reset the buffer periodically.
- *
- * Applications may restore the default behavior of the codec providing
- * the compressed data buffer by calling this function with a NULL
- * buffer.
- *
- * Applications \ref MUSTNOT call this function during iteration of
- * vpx_codec_get_cx_data().
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] buf Buffer to store compressed data into
- * \param[in] pad_before Bytes to skip before writing compressed data
- * \param[in] pad_after Bytes to skip after writing compressed data
- *
- * \retval #VPX_CODEC_OK
- * The buffer was set successfully.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
- const vpx_fixed_buf_t *buf,
- unsigned int pad_before,
- unsigned int pad_after);
-
-
- /*!\brief Encoded data iterator
- *
- * Iterates over a list of data packets to be passed from the encoder to the
- * application. The different kinds of packets available are enumerated in
- * #vpx_codec_cx_pkt_kind.
- *
- * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
- * muxer. Multiple compressed frames may be in the list.
- * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
- *
- * The application \ref MUST silently ignore any packet kinds that it does
- * not recognize or support.
- *
- * The data buffers returned from this function are only guaranteed to be
- * valid until the application makes another call to any vpx_codec_* function.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an output data packet (compressed frame data,
- * two-pass statistics, etc.) or NULL to signal end-of-list.
- *
- */
- const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Get Preview Frame
- *
- * Returns an image that can be used as a preview. Shows the image as it would
- * exist at the decompressor. The application \ref MUST NOT write into this
- * image buffer.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \return Returns a pointer to a preview image, or NULL if no image is
- * available.
- *
- */
- const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
-
-
- /*!@} - end defgroup encoder*/
+/*!\brief Encode a frame
+ *
+ * Encodes a video frame at the given "presentation time." The presentation
+ * time stamp (PTS) \ref MUST be strictly increasing.
+ *
+ * The encoder supports the notion of a soft real-time deadline. Given a
+ * non-zero value to the deadline parameter, the encoder will make a "best
+ * effort" guarantee to return before the given time slice expires. It is
+ * implicit that limiting the available time to encode will degrade the
+ * output quality. The encoder can be given an unlimited time to produce the
+ * best possible frame by specifying a deadline of '0'. This deadline
+ * supercedes the VPx notion of "best quality, good quality, realtime".
+ * Applications that wish to map these former settings to the new deadline
+ * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
+ * and #VPX_DL_BEST_QUALITY.
+ *
+ * When the last frame has been passed to the encoder, this function should
+ * continue to be called, with the img parameter set to NULL. This will
+ * signal the end-of-stream condition to the encoder and allow it to encode
+ * any held buffers. Encoding is complete when vpx_codec_encode() is called
+ * and vpx_codec_get_cx_data() returns no data.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] img Image data to encode, NULL to flush.
+ * \param[in] pts Presentation time stamp, in timebase units.
+ * \param[in] duration Duration to show frame, in timebase units.
+ * \param[in] flags Flags to use for encoding this frame.
+ * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned long duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned long deadline);
+
+/*!\brief Set compressed data output buffer
+ *
+ * Sets the buffer that the codec should output the compressed data
+ * into. This call effectively sets the buffer pointer returned in the
+ * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
+ * appended into this buffer. The buffer is preserved across frames,
+ * so applications must periodically call this function after flushing
+ * the accumulated compressed data to disk or to the network to reset
+ * the pointer to the buffer's head.
+ *
+ * `pad_before` bytes will be skipped before writing the compressed
+ * data, and `pad_after` bytes will be appended to the packet. The size
+ * of the packet will be the sum of the size of the actual compressed
+ * data, pad_before, and pad_after. The padding bytes will be preserved
+ * (not overwritten).
+ *
+ * Note that calling this function does not guarantee that the returned
+ * compressed data will be placed into the specified buffer. In the
+ * event that the encoded data will not fit into the buffer provided,
+ * the returned packet \ref MAY point to an internal buffer, as it would
+ * if this call were never used. In this event, the output packet will
+ * NOT have any padding, and the application must free space and copy it
+ * to the proper place. This is of particular note in configurations
+ * that may output multiple packets for a single encoded frame (e.g., lagged
+ * encoding) or if the application does not reset the buffer periodically.
+ *
+ * Applications may restore the default behavior of the codec providing
+ * the compressed data buffer by calling this function with a NULL
+ * buffer.
+ *
+ * Applications \ref MUSTNOT call this function during iteration of
+ * vpx_codec_get_cx_data().
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] buf Buffer to store compressed data into
+ * \param[in] pad_before Bytes to skip before writing compressed data
+ * \param[in] pad_after Bytes to skip after writing compressed data
+ *
+ * \retval #VPX_CODEC_OK
+ * The buffer was set successfully.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
+ const vpx_fixed_buf_t *buf,
+ unsigned int pad_before,
+ unsigned int pad_after);
+
+
+/*!\brief Encoded data iterator
+ *
+ * Iterates over a list of data packets to be passed from the encoder to the
+ * application. The different kinds of packets available are enumerated in
+ * #vpx_codec_cx_pkt_kind.
+ *
+ * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
+ * muxer. Multiple compressed frames may be in the list.
+ * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
+ *
+ * The application \ref MUST silently ignore any packet kinds that it does
+ * not recognize or support.
+ *
+ * The data buffers returned from this function are only guaranteed to be
+ * valid until the application makes another call to any vpx_codec_* function.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an output data packet (compressed frame data,
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
+ *
+ */
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Get Preview Frame
+ *
+ * Returns an image that can be used as a preview. Shows the image as it would
+ * exist at the decompressor. The application \ref MUST NOT write into this
+ * image buffer.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \return Returns a pointer to a preview image, or NULL if no image is
+ * available.
+ *
+ */
+const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
+
+
+/*!@} - end defgroup encoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/iphone/include/vpx/vpx_frame_buffer.h b/thirdparties/iphone/include/vpx/vpx_frame_buffer.h
index 41038b1..83b499e 100755
--- a/thirdparties/iphone/include/vpx/vpx_frame_buffer.h
+++ b/thirdparties/iphone/include/vpx/vpx_frame_buffer.h
@@ -34,9 +34,9 @@ extern "C" {
* This structure holds allocated frame buffers used by the decoder.
*/
typedef struct vpx_codec_frame_buffer {
- uint8_t *data; /**< Pointer to the data buffer */
- size_t size; /**< Size of data in bytes */
- void *priv; /**< Frame's private data */
+ uint8_t *data; /**< Pointer to the data buffer */
+ size_t size; /**< Size of data in bytes */
+ void *priv; /**< Frame's private data */
} vpx_codec_frame_buffer_t;
/*!\brief get frame buffer callback prototype
diff --git a/thirdparties/iphone/include/vpx/vpx_image.h b/thirdparties/iphone/include/vpx/vpx_image.h
index c06d351..ac5de63 100755
--- a/thirdparties/iphone/include/vpx/vpx_image.h
+++ b/thirdparties/iphone/include/vpx/vpx_image.h
@@ -20,14 +20,14 @@
extern "C" {
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_IMAGE_ABI_VERSION (3) /**<\hideinitializer*/
@@ -36,8 +36,8 @@ extern "C" {
#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel. */
#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
- /*!\brief List of supported image formats */
- typedef enum vpx_img_fmt {
+/*!\brief List of supported image formats */
+typedef enum vpx_img_fmt {
VPX_IMG_FMT_NONE,
VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
@@ -64,10 +64,11 @@ extern "C" {
VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH,
VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH,
VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH
- } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
+}
+vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
- /*!\brief List of supported color spaces */
- typedef enum vpx_color_space {
+/*!\brief List of supported color spaces */
+typedef enum vpx_color_space {
VPX_CS_UNKNOWN = 0, /**< Unknown */
VPX_CS_BT_601 = 1, /**< BT.601 */
VPX_CS_BT_709 = 2, /**< BT.709 */
@@ -76,10 +77,10 @@ extern "C" {
VPX_CS_BT_2020 = 5, /**< BT.2020 */
VPX_CS_RESERVED = 6, /**< Reserved */
VPX_CS_SRGB = 7 /**< sRGB */
- } vpx_color_space_t; /**< alias for enum vpx_color_space */
+} vpx_color_space_t; /**< alias for enum vpx_color_space */
- /**\brief Image Descriptor */
- typedef struct vpx_image {
+/**\brief Image Descriptor */
+typedef struct vpx_image {
vpx_img_fmt_t fmt; /**< Image Format */
vpx_color_space_t cs; /**< Color Space */
@@ -119,103 +120,103 @@ extern "C" {
int self_allocd; /**< private */
void *fb_priv; /**< Frame buffer data associated with the image. */
- } vpx_image_t; /**< alias for struct vpx_image */
+} vpx_image_t; /**< alias for struct vpx_image */
- /**\brief Representation of a rectangle on a surface */
- typedef struct vpx_image_rect {
+/**\brief Representation of a rectangle on a surface */
+typedef struct vpx_image_rect {
unsigned int x; /**< leftmost column */
unsigned int y; /**< topmost row */
unsigned int w; /**< width */
unsigned int h; /**< height */
- } vpx_image_rect_t; /**< alias for struct vpx_image_rect */
-
- /*!\brief Open a descriptor, allocating storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for the descriptor is allocated on the heap.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of the image buffer and
- * each row in the image(stride).
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_alloc(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align);
-
- /*!\brief Open a descriptor, using existing storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for descriptor has been allocated elsewhere, and a descriptor is
- * desired to "wrap" that storage.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of each row in the image.
- * \param[in] img_data Storage to use for the image
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_wrap(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align,
- unsigned char *img_data);
-
-
- /*!\brief Set the rectangle identifying the displayed portion of the image
- *
- * Updates the displayed rectangle (aka viewport) on the image surface to
- * match the specified coordinates and size.
- *
- * \param[in] img Image descriptor
- * \param[in] x leftmost column
- * \param[in] y topmost row
- * \param[in] w width
- * \param[in] h height
- *
- * \return 0 if the requested rectangle is valid, nonzero otherwise.
- */
- int vpx_img_set_rect(vpx_image_t *img,
- unsigned int x,
- unsigned int y,
- unsigned int w,
- unsigned int h);
-
-
- /*!\brief Flip the image vertically (top for bottom)
- *
- * Adjusts the image descriptor's pointers and strides to make the image
- * be referenced upside-down.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_flip(vpx_image_t *img);
-
- /*!\brief Close an image descriptor
- *
- * Frees all allocated storage associated with an image descriptor.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_free(vpx_image_t *img);
+} vpx_image_rect_t; /**< alias for struct vpx_image_rect */
+
+/*!\brief Open a descriptor, allocating storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for the descriptor is allocated on the heap.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of the image buffer and
+ * each row in the image(stride).
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_alloc(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align);
+
+/*!\brief Open a descriptor, using existing storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for descriptor has been allocated elsewhere, and a descriptor is
+ * desired to "wrap" that storage.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of each row in the image.
+ * \param[in] img_data Storage to use for the image
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_wrap(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align,
+ unsigned char *img_data);
+
+
+/*!\brief Set the rectangle identifying the displayed portion of the image
+ *
+ * Updates the displayed rectangle (aka viewport) on the image surface to
+ * match the specified coordinates and size.
+ *
+ * \param[in] img Image descriptor
+ * \param[in] x leftmost column
+ * \param[in] y topmost row
+ * \param[in] w width
+ * \param[in] h height
+ *
+ * \return 0 if the requested rectangle is valid, nonzero otherwise.
+ */
+int vpx_img_set_rect(vpx_image_t *img,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h);
+
+
+/*!\brief Flip the image vertically (top for bottom)
+ *
+ * Adjusts the image descriptor's pointers and strides to make the image
+ * be referenced upside-down.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_flip(vpx_image_t *img);
+
+/*!\brief Close an image descriptor
+ *
+ * Frees all allocated storage associated with an image descriptor.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_free(vpx_image_t *img);
#ifdef __cplusplus
} // extern "C"
diff --git a/thirdparties/mac/include/libavcodec/avcodec.h b/thirdparties/mac/include/libavcodec/avcodec.h
index c4db4d7..479a2a4 100755
--- a/thirdparties/mac/include/libavcodec/avcodec.h
+++ b/thirdparties/mac/include/libavcodec/avcodec.h
@@ -588,7 +588,7 @@ enum Motion_Est_ID {
/**
* @ingroup lavc_decoding
*/
-enum AVDiscard{
+enum AVDiscard {
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
AVDISCARD_NONE =-16, ///< discard nothing
@@ -599,7 +599,7 @@ enum AVDiscard{
AVDISCARD_ALL = 48, ///< discard all
};
-enum AVColorPrimaries{
+enum AVColorPrimaries {
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_BT470M = 4,
@@ -610,7 +610,7 @@ enum AVColorPrimaries{
AVCOL_PRI_NB , ///< Not part of ABI
};
-enum AVColorTransferCharacteristic{
+enum AVColorTransferCharacteristic {
AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361
AVCOL_TRC_UNSPECIFIED = 2,
AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@@ -619,7 +619,7 @@ enum AVColorTransferCharacteristic{
AVCOL_TRC_NB , ///< Not part of ABI
};
-enum AVColorSpace{
+enum AVColorSpace {
AVCOL_SPC_RGB = 0,
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVCOL_SPC_UNSPECIFIED = 2,
@@ -632,7 +632,7 @@ enum AVColorSpace{
};
#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
-enum AVColorRange{
+enum AVColorRange {
AVCOL_RANGE_UNSPECIFIED = 0,
AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
@@ -644,7 +644,7 @@ enum AVColorRange{
* 1 2 1-6 are possible chroma positions
* X X 5 6 X 0 is undefined/unknown position
*/
-enum AVChromaLocation{
+enum AVChromaLocation {
AVCHROMA_LOC_UNSPECIFIED = 0,
AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default
AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263
@@ -671,7 +671,7 @@ enum AVAudioServiceType {
/**
* @ingroup lavc_encoding
*/
-typedef struct RcOverride{
+typedef struct RcOverride {
int start_frame;
int end_frame;
int qscale; // If this is 0 then quality_factor will be used instead.
@@ -863,7 +863,7 @@ typedef struct RcOverride{
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
*/
-typedef struct AVPanScan{
+typedef struct AVPanScan {
/**
* id
* - encoding: Set by user.
@@ -885,7 +885,7 @@ typedef struct AVPanScan{
* - decoding: Set by libavcodec.
*/
int16_t position[3][2];
-}AVPanScan;
+} AVPanScan;
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
@@ -1929,7 +1929,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int prediction_method;
+ int prediction_method;
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
@@ -2699,11 +2699,11 @@ typedef struct AVCodecContext {
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
int rtp_payload_size; /* The size of the RTP payload: the coder will */
- /* do its best to deliver a chunk with size */
- /* below rtp_payload_size, the chunk will start */
- /* with a start code on some codecs like H.263. */
- /* This doesn't take account of any particular */
- /* headers inside the transmitted RTP payload. */
+ /* do its best to deliver a chunk with size */
+ /* below rtp_payload_size, the chunk will start */
+ /* with a start code on some codecs like H.263. */
+ /* This doesn't take account of any particular */
+ /* headers inside the transmitted RTP payload. */
/* statistics, used for 2-pass encoding */
int mv_bits;
@@ -2934,7 +2934,7 @@ typedef struct AVCodecContext {
* - encoding: Set by libavcodec.
* - decoding: Set by user.
*/
- int bits_per_coded_sample;
+ int bits_per_coded_sample;
/**
* Bits per sample/pixel of internal libavcodec pixel/sample format.
@@ -2948,7 +2948,7 @@ typedef struct AVCodecContext {
* - encoding: unused
* - decoding: Set by user.
*/
- int lowres;
+ int lowres;
/**
* the picture in the bitstream
@@ -3038,14 +3038,14 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int nsse_weight;
+ int nsse_weight;
/**
* profile
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int profile;
+ int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100
@@ -3115,7 +3115,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int level;
+ int level;
#define FF_LEVEL_UNKNOWN -99
/**
@@ -3992,8 +3992,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
* used or zero if no frame data was decompressed (used) from the input AVPacket.
*/
attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt);
+ int *frame_size_ptr,
+ AVPacket *avpkt);
#endif
/**
@@ -4074,8 +4074,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- const AVPacket *avpkt);
+ int *got_picture_ptr,
+ const AVPacket *avpkt);
/**
* Decode a subtitle message.
@@ -4094,8 +4094,8 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr,
+ AVPacket *avpkt);
/**
* @defgroup lavc_parsing Frame parsing
@@ -4353,8 +4353,8 @@ AVCodec *avcodec_find_encoder_by_name(const char *name);
* of bytes used to encode the data read from the input buffer.
*/
int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples);
+ uint8_t *buf, int buf_size,
+ const short *samples);
#endif
/**
@@ -4642,7 +4642,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
* Pad image.
*/
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
+ int padtop, int padbottom, int padleft, int padright, int *color);
/**
* @}
@@ -4745,7 +4745,7 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat
*/
attribute_deprecated
enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */
/**
@@ -4766,8 +4766,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelF
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
/**
* Find the best pixel format to convert to given a certain source pixel
@@ -4800,16 +4800,16 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
attribute_deprecated
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
#else
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
#endif
@@ -5033,10 +5033,10 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
* Lock operation used by lockmgr
*/
enum AVLockOp {
- AV_LOCK_CREATE, ///< Create a mutex
- AV_LOCK_OBTAIN, ///< Lock the mutex
- AV_LOCK_RELEASE, ///< Unlock the mutex
- AV_LOCK_DESTROY, ///< Free mutex resources
+ AV_LOCK_CREATE, ///< Create a mutex
+ AV_LOCK_OBTAIN, ///< Lock the mutex
+ AV_LOCK_RELEASE, ///< Unlock the mutex
+ AV_LOCK_DESTROY, ///< Free mutex resources
};
/**
diff --git a/thirdparties/mac/include/libavcodec/old_codec_ids.h b/thirdparties/mac/include/libavcodec/old_codec_ids.h
index ded4cc7..e0d3d7e 100755
--- a/thirdparties/mac/include/libavcodec/old_codec_ids.h
+++ b/thirdparties/mac/include/libavcodec/old_codec_ids.h
@@ -29,370 +29,370 @@
* Do not add new items to this list. Use the AVCodecID enum instead.
*/
- CODEC_ID_NONE = AV_CODEC_ID_NONE,
+CODEC_ID_NONE = AV_CODEC_ID_NONE,
- /* video codecs */
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
- CODEC_ID_MPEG2VIDEO_XVMC,
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_SNOW,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_DXA,
- CODEC_ID_DNXHD,
- CODEC_ID_THP,
- CODEC_ID_SGI,
- CODEC_ID_C93,
- CODEC_ID_BETHSOFTVID,
- CODEC_ID_PTX,
- CODEC_ID_TXD,
- CODEC_ID_VP6A,
- CODEC_ID_AMV,
- CODEC_ID_VB,
- CODEC_ID_PCX,
- CODEC_ID_SUNRAST,
- CODEC_ID_INDEO4,
- CODEC_ID_INDEO5,
- CODEC_ID_MIMIC,
- CODEC_ID_RL2,
- CODEC_ID_ESCAPE124,
- CODEC_ID_DIRAC,
- CODEC_ID_BFI,
- CODEC_ID_CMV,
- CODEC_ID_MOTIONPIXELS,
- CODEC_ID_TGV,
- CODEC_ID_TGQ,
- CODEC_ID_TQI,
- CODEC_ID_AURA,
- CODEC_ID_AURA2,
- CODEC_ID_V210X,
- CODEC_ID_TMV,
- CODEC_ID_V210,
- CODEC_ID_DPX,
- CODEC_ID_MAD,
- CODEC_ID_FRWU,
- CODEC_ID_FLASHSV2,
- CODEC_ID_CDGRAPHICS,
- CODEC_ID_R210,
- CODEC_ID_ANM,
- CODEC_ID_BINKVIDEO,
- CODEC_ID_IFF_ILBM,
- CODEC_ID_IFF_BYTERUN1,
- CODEC_ID_KGV1,
- CODEC_ID_YOP,
- CODEC_ID_VP8,
- CODEC_ID_PICTOR,
- CODEC_ID_ANSI,
- CODEC_ID_A64_MULTI,
- CODEC_ID_A64_MULTI5,
- CODEC_ID_R10K,
- CODEC_ID_MXPEG,
- CODEC_ID_LAGARITH,
- CODEC_ID_PRORES,
- CODEC_ID_JV,
- CODEC_ID_DFA,
- CODEC_ID_WMV3IMAGE,
- CODEC_ID_VC1IMAGE,
- CODEC_ID_UTVIDEO,
- CODEC_ID_BMV_VIDEO,
- CODEC_ID_VBLE,
- CODEC_ID_DXTORY,
- CODEC_ID_V410,
- CODEC_ID_XWD,
- CODEC_ID_CDXL,
- CODEC_ID_XBM,
- CODEC_ID_ZEROCODEC,
- CODEC_ID_MSS1,
- CODEC_ID_MSA1,
- CODEC_ID_TSCC2,
- CODEC_ID_MTS2,
- CODEC_ID_CLLC,
- CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
+/* video codecs */
+CODEC_ID_MPEG1VIDEO,
+CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+CODEC_ID_MPEG2VIDEO_XVMC,
+CODEC_ID_H261,
+CODEC_ID_H263,
+CODEC_ID_RV10,
+CODEC_ID_RV20,
+CODEC_ID_MJPEG,
+CODEC_ID_MJPEGB,
+CODEC_ID_LJPEG,
+CODEC_ID_SP5X,
+CODEC_ID_JPEGLS,
+CODEC_ID_MPEG4,
+CODEC_ID_RAWVIDEO,
+CODEC_ID_MSMPEG4V1,
+CODEC_ID_MSMPEG4V2,
+CODEC_ID_MSMPEG4V3,
+CODEC_ID_WMV1,
+CODEC_ID_WMV2,
+CODEC_ID_H263P,
+CODEC_ID_H263I,
+CODEC_ID_FLV1,
+CODEC_ID_SVQ1,
+CODEC_ID_SVQ3,
+CODEC_ID_DVVIDEO,
+CODEC_ID_HUFFYUV,
+CODEC_ID_CYUV,
+CODEC_ID_H264,
+CODEC_ID_INDEO3,
+CODEC_ID_VP3,
+CODEC_ID_THEORA,
+CODEC_ID_ASV1,
+CODEC_ID_ASV2,
+CODEC_ID_FFV1,
+CODEC_ID_4XM,
+CODEC_ID_VCR1,
+CODEC_ID_CLJR,
+CODEC_ID_MDEC,
+CODEC_ID_ROQ,
+CODEC_ID_INTERPLAY_VIDEO,
+CODEC_ID_XAN_WC3,
+CODEC_ID_XAN_WC4,
+CODEC_ID_RPZA,
+CODEC_ID_CINEPAK,
+CODEC_ID_WS_VQA,
+CODEC_ID_MSRLE,
+CODEC_ID_MSVIDEO1,
+CODEC_ID_IDCIN,
+CODEC_ID_8BPS,
+CODEC_ID_SMC,
+CODEC_ID_FLIC,
+CODEC_ID_TRUEMOTION1,
+CODEC_ID_VMDVIDEO,
+CODEC_ID_MSZH,
+CODEC_ID_ZLIB,
+CODEC_ID_QTRLE,
+CODEC_ID_SNOW,
+CODEC_ID_TSCC,
+CODEC_ID_ULTI,
+CODEC_ID_QDRAW,
+CODEC_ID_VIXL,
+CODEC_ID_QPEG,
+CODEC_ID_PNG,
+CODEC_ID_PPM,
+CODEC_ID_PBM,
+CODEC_ID_PGM,
+CODEC_ID_PGMYUV,
+CODEC_ID_PAM,
+CODEC_ID_FFVHUFF,
+CODEC_ID_RV30,
+CODEC_ID_RV40,
+CODEC_ID_VC1,
+CODEC_ID_WMV3,
+CODEC_ID_LOCO,
+CODEC_ID_WNV1,
+CODEC_ID_AASC,
+CODEC_ID_INDEO2,
+CODEC_ID_FRAPS,
+CODEC_ID_TRUEMOTION2,
+CODEC_ID_BMP,
+CODEC_ID_CSCD,
+CODEC_ID_MMVIDEO,
+CODEC_ID_ZMBV,
+CODEC_ID_AVS,
+CODEC_ID_SMACKVIDEO,
+CODEC_ID_NUV,
+CODEC_ID_KMVC,
+CODEC_ID_FLASHSV,
+CODEC_ID_CAVS,
+CODEC_ID_JPEG2000,
+CODEC_ID_VMNC,
+CODEC_ID_VP5,
+CODEC_ID_VP6,
+CODEC_ID_VP6F,
+CODEC_ID_TARGA,
+CODEC_ID_DSICINVIDEO,
+CODEC_ID_TIERTEXSEQVIDEO,
+CODEC_ID_TIFF,
+CODEC_ID_GIF,
+CODEC_ID_DXA,
+CODEC_ID_DNXHD,
+CODEC_ID_THP,
+CODEC_ID_SGI,
+CODEC_ID_C93,
+CODEC_ID_BETHSOFTVID,
+CODEC_ID_PTX,
+CODEC_ID_TXD,
+CODEC_ID_VP6A,
+CODEC_ID_AMV,
+CODEC_ID_VB,
+CODEC_ID_PCX,
+CODEC_ID_SUNRAST,
+CODEC_ID_INDEO4,
+CODEC_ID_INDEO5,
+CODEC_ID_MIMIC,
+CODEC_ID_RL2,
+CODEC_ID_ESCAPE124,
+CODEC_ID_DIRAC,
+CODEC_ID_BFI,
+CODEC_ID_CMV,
+CODEC_ID_MOTIONPIXELS,
+CODEC_ID_TGV,
+CODEC_ID_TGQ,
+CODEC_ID_TQI,
+CODEC_ID_AURA,
+CODEC_ID_AURA2,
+CODEC_ID_V210X,
+CODEC_ID_TMV,
+CODEC_ID_V210,
+CODEC_ID_DPX,
+CODEC_ID_MAD,
+CODEC_ID_FRWU,
+CODEC_ID_FLASHSV2,
+CODEC_ID_CDGRAPHICS,
+CODEC_ID_R210,
+CODEC_ID_ANM,
+CODEC_ID_BINKVIDEO,
+CODEC_ID_IFF_ILBM,
+CODEC_ID_IFF_BYTERUN1,
+CODEC_ID_KGV1,
+CODEC_ID_YOP,
+CODEC_ID_VP8,
+CODEC_ID_PICTOR,
+CODEC_ID_ANSI,
+CODEC_ID_A64_MULTI,
+CODEC_ID_A64_MULTI5,
+CODEC_ID_R10K,
+CODEC_ID_MXPEG,
+CODEC_ID_LAGARITH,
+CODEC_ID_PRORES,
+CODEC_ID_JV,
+CODEC_ID_DFA,
+CODEC_ID_WMV3IMAGE,
+CODEC_ID_VC1IMAGE,
+CODEC_ID_UTVIDEO,
+CODEC_ID_BMV_VIDEO,
+CODEC_ID_VBLE,
+CODEC_ID_DXTORY,
+CODEC_ID_V410,
+CODEC_ID_XWD,
+CODEC_ID_CDXL,
+CODEC_ID_XBM,
+CODEC_ID_ZEROCODEC,
+CODEC_ID_MSS1,
+CODEC_ID_MSA1,
+CODEC_ID_TSCC2,
+CODEC_ID_MTS2,
+CODEC_ID_CLLC,
+CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
+CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
+CODEC_ID_EXR = MKBETAG('0','E','X','R'),
+CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
- CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
+CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
+CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
+CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
+CODEC_ID_V308 = MKBETAG('V','3','0','8'),
+CODEC_ID_V408 = MKBETAG('V','4','0','8'),
+CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
+CODEC_ID_SANM = MKBETAG('S','A','N','M'),
+CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- /* various PCM "codecs" */
- CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
- CODEC_ID_PCM_S16LE = 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
- CODEC_ID_PCM_ZORK,
- CODEC_ID_PCM_S16LE_PLANAR,
- CODEC_ID_PCM_DVD,
- CODEC_ID_PCM_F32BE,
- CODEC_ID_PCM_F32LE,
- CODEC_ID_PCM_F64BE,
- CODEC_ID_PCM_F64LE,
- CODEC_ID_PCM_BLURAY,
- CODEC_ID_PCM_LXF,
- CODEC_ID_S302M,
- CODEC_ID_PCM_S8_PLANAR,
+/* various PCM "codecs" */
+CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
+CODEC_ID_PCM_S16LE = 0x10000,
+CODEC_ID_PCM_S16BE,
+CODEC_ID_PCM_U16LE,
+CODEC_ID_PCM_U16BE,
+CODEC_ID_PCM_S8,
+CODEC_ID_PCM_U8,
+CODEC_ID_PCM_MULAW,
+CODEC_ID_PCM_ALAW,
+CODEC_ID_PCM_S32LE,
+CODEC_ID_PCM_S32BE,
+CODEC_ID_PCM_U32LE,
+CODEC_ID_PCM_U32BE,
+CODEC_ID_PCM_S24LE,
+CODEC_ID_PCM_S24BE,
+CODEC_ID_PCM_U24LE,
+CODEC_ID_PCM_U24BE,
+CODEC_ID_PCM_S24DAUD,
+CODEC_ID_PCM_ZORK,
+CODEC_ID_PCM_S16LE_PLANAR,
+CODEC_ID_PCM_DVD,
+CODEC_ID_PCM_F32BE,
+CODEC_ID_PCM_F32LE,
+CODEC_ID_PCM_F64BE,
+CODEC_ID_PCM_F64LE,
+CODEC_ID_PCM_BLURAY,
+CODEC_ID_PCM_LXF,
+CODEC_ID_S302M,
+CODEC_ID_PCM_S8_PLANAR,
- /* various ADPCM codecs */
- CODEC_ID_ADPCM_IMA_QT = 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
- CODEC_ID_ADPCM_THP,
- CODEC_ID_ADPCM_IMA_AMV,
- CODEC_ID_ADPCM_EA_R1,
- CODEC_ID_ADPCM_EA_R3,
- CODEC_ID_ADPCM_EA_R2,
- CODEC_ID_ADPCM_IMA_EA_SEAD,
- CODEC_ID_ADPCM_IMA_EA_EACS,
- CODEC_ID_ADPCM_EA_XAS,
- CODEC_ID_ADPCM_EA_MAXIS_XA,
- CODEC_ID_ADPCM_IMA_ISS,
- CODEC_ID_ADPCM_G722,
- CODEC_ID_ADPCM_IMA_APC,
- CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+/* various ADPCM codecs */
+CODEC_ID_ADPCM_IMA_QT = 0x11000,
+CODEC_ID_ADPCM_IMA_WAV,
+CODEC_ID_ADPCM_IMA_DK3,
+CODEC_ID_ADPCM_IMA_DK4,
+CODEC_ID_ADPCM_IMA_WS,
+CODEC_ID_ADPCM_IMA_SMJPEG,
+CODEC_ID_ADPCM_MS,
+CODEC_ID_ADPCM_4XM,
+CODEC_ID_ADPCM_XA,
+CODEC_ID_ADPCM_ADX,
+CODEC_ID_ADPCM_EA,
+CODEC_ID_ADPCM_G726,
+CODEC_ID_ADPCM_CT,
+CODEC_ID_ADPCM_SWF,
+CODEC_ID_ADPCM_YAMAHA,
+CODEC_ID_ADPCM_SBPRO_4,
+CODEC_ID_ADPCM_SBPRO_3,
+CODEC_ID_ADPCM_SBPRO_2,
+CODEC_ID_ADPCM_THP,
+CODEC_ID_ADPCM_IMA_AMV,
+CODEC_ID_ADPCM_EA_R1,
+CODEC_ID_ADPCM_EA_R3,
+CODEC_ID_ADPCM_EA_R2,
+CODEC_ID_ADPCM_IMA_EA_SEAD,
+CODEC_ID_ADPCM_IMA_EA_EACS,
+CODEC_ID_ADPCM_EA_XAS,
+CODEC_ID_ADPCM_EA_MAXIS_XA,
+CODEC_ID_ADPCM_IMA_ISS,
+CODEC_ID_ADPCM_G722,
+CODEC_ID_ADPCM_IMA_APC,
+CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
- /* AMR */
- CODEC_ID_AMR_NB = 0x12000,
- CODEC_ID_AMR_WB,
+/* AMR */
+CODEC_ID_AMR_NB = 0x12000,
+CODEC_ID_AMR_WB,
- /* RealAudio codecs*/
- CODEC_ID_RA_144 = 0x13000,
- CODEC_ID_RA_288,
+/* RealAudio codecs*/
+CODEC_ID_RA_144 = 0x13000,
+CODEC_ID_RA_288,
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM = 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
+/* various DPCM codecs */
+CODEC_ID_ROQ_DPCM = 0x14000,
+CODEC_ID_INTERPLAY_DPCM,
+CODEC_ID_XAN_DPCM,
+CODEC_ID_SOL_DPCM,
- /* audio codecs */
- CODEC_ID_MP2 = 0x15000,
- CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
- CODEC_ID_AAC,
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM, ///< as in Berlin toast format
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
- CODEC_ID_MLP,
- CODEC_ID_GSM_MS, /* as found in WAV */
- CODEC_ID_ATRAC3,
- CODEC_ID_VOXWARE,
- CODEC_ID_APE,
- CODEC_ID_NELLYMOSER,
- CODEC_ID_MUSEPACK8,
- CODEC_ID_SPEEX,
- CODEC_ID_WMAVOICE,
- CODEC_ID_WMAPRO,
- CODEC_ID_WMALOSSLESS,
- CODEC_ID_ATRAC3P,
- CODEC_ID_EAC3,
- CODEC_ID_SIPR,
- CODEC_ID_MP1,
- CODEC_ID_TWINVQ,
- CODEC_ID_TRUEHD,
- CODEC_ID_MP4ALS,
- CODEC_ID_ATRAC1,
- CODEC_ID_BINKAUDIO_RDFT,
- CODEC_ID_BINKAUDIO_DCT,
- CODEC_ID_AAC_LATM,
- CODEC_ID_QDMC,
- CODEC_ID_CELT,
- CODEC_ID_G723_1,
- CODEC_ID_G729,
- CODEC_ID_8SVX_EXP,
- CODEC_ID_8SVX_FIB,
- CODEC_ID_BMV_AUDIO,
- CODEC_ID_RALF,
- CODEC_ID_IAC,
- CODEC_ID_ILBC,
- CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
- CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
+/* audio codecs */
+CODEC_ID_MP2 = 0x15000,
+CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+CODEC_ID_AAC,
+CODEC_ID_AC3,
+CODEC_ID_DTS,
+CODEC_ID_VORBIS,
+CODEC_ID_DVAUDIO,
+CODEC_ID_WMAV1,
+CODEC_ID_WMAV2,
+CODEC_ID_MACE3,
+CODEC_ID_MACE6,
+CODEC_ID_VMDAUDIO,
+CODEC_ID_FLAC,
+CODEC_ID_MP3ADU,
+CODEC_ID_MP3ON4,
+CODEC_ID_SHORTEN,
+CODEC_ID_ALAC,
+CODEC_ID_WESTWOOD_SND1,
+CODEC_ID_GSM, ///< as in Berlin toast format
+CODEC_ID_QDM2,
+CODEC_ID_COOK,
+CODEC_ID_TRUESPEECH,
+CODEC_ID_TTA,
+CODEC_ID_SMACKAUDIO,
+CODEC_ID_QCELP,
+CODEC_ID_WAVPACK,
+CODEC_ID_DSICINAUDIO,
+CODEC_ID_IMC,
+CODEC_ID_MUSEPACK7,
+CODEC_ID_MLP,
+CODEC_ID_GSM_MS, /* as found in WAV */
+CODEC_ID_ATRAC3,
+CODEC_ID_VOXWARE,
+CODEC_ID_APE,
+CODEC_ID_NELLYMOSER,
+CODEC_ID_MUSEPACK8,
+CODEC_ID_SPEEX,
+CODEC_ID_WMAVOICE,
+CODEC_ID_WMAPRO,
+CODEC_ID_WMALOSSLESS,
+CODEC_ID_ATRAC3P,
+CODEC_ID_EAC3,
+CODEC_ID_SIPR,
+CODEC_ID_MP1,
+CODEC_ID_TWINVQ,
+CODEC_ID_TRUEHD,
+CODEC_ID_MP4ALS,
+CODEC_ID_ATRAC1,
+CODEC_ID_BINKAUDIO_RDFT,
+CODEC_ID_BINKAUDIO_DCT,
+CODEC_ID_AAC_LATM,
+CODEC_ID_QDMC,
+CODEC_ID_CELT,
+CODEC_ID_G723_1,
+CODEC_ID_G729,
+CODEC_ID_8SVX_EXP,
+CODEC_ID_8SVX_FIB,
+CODEC_ID_BMV_AUDIO,
+CODEC_ID_RALF,
+CODEC_ID_IAC,
+CODEC_ID_ILBC,
+CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
+CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
+CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
+CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
+CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
+CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
- /* subtitle codecs */
- CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
- CODEC_ID_DVD_SUBTITLE = 0x17000,
- CODEC_ID_DVB_SUBTITLE,
- CODEC_ID_TEXT, ///< raw UTF-8 text
- CODEC_ID_XSUB,
- CODEC_ID_SSA,
- CODEC_ID_MOV_TEXT,
- CODEC_ID_HDMV_PGS_SUBTITLE,
- CODEC_ID_DVB_TELETEXT,
- CODEC_ID_SRT,
- CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
+/* subtitle codecs */
+CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
+CODEC_ID_DVD_SUBTITLE = 0x17000,
+CODEC_ID_DVB_SUBTITLE,
+CODEC_ID_TEXT, ///< raw UTF-8 text
+CODEC_ID_XSUB,
+CODEC_ID_SSA,
+CODEC_ID_MOV_TEXT,
+CODEC_ID_HDMV_PGS_SUBTITLE,
+CODEC_ID_DVB_TELETEXT,
+CODEC_ID_SRT,
+CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
+CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
+CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
+CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
+CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
+CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
- /* other specific kind of codecs (generally used for attachments) */
- CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
- CODEC_ID_TTF = 0x18000,
- CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
+/* other specific kind of codecs (generally used for attachments) */
+CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
+CODEC_ID_TTF = 0x18000,
+CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
+CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
+CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
+CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
- CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
- CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
- CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+ CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
- CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
+ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/thirdparties/mac/include/libavcodec/vdpau.h b/thirdparties/mac/include/libavcodec/vdpau.h
index df2aace..fe1d3b7 100755
--- a/thirdparties/mac/include/libavcodec/vdpau.h
+++ b/thirdparties/mac/include/libavcodec/vdpau.h
@@ -104,12 +104,12 @@ typedef struct AVVDPAUContext {
*/
int bitstream_buffers_used;
- /**
- * Table of bitstream buffers.
- * The user is responsible for freeing this buffer using av_freep().
- *
- * Set by libavcodec.
- */
+ /**
+ * Table of bitstream buffers.
+ * The user is responsible for freeing this buffer using av_freep().
+ *
+ * Set by libavcodec.
+ */
VdpBitstreamBuffer *bitstream_buffers;
} AVVDPAUContext;
diff --git a/thirdparties/mac/include/libavcodec/xvmc.h b/thirdparties/mac/include/libavcodec/xvmc.h
index b2bf518..373d9aa 100755
--- a/thirdparties/mac/include/libavcodec/xvmc.h
+++ b/thirdparties/mac/include/libavcodec/xvmc.h
@@ -101,8 +101,8 @@ struct xvmc_pix_fmt {
*/
XvMCSurface* p_surface;
-/** Set by the decoder before calling ff_draw_horiz_band(),
- needed by the XvMCRenderSurface function. */
+ /** Set by the decoder before calling ff_draw_horiz_band(),
+ needed by the XvMCRenderSurface function. */
//@{
/** Pointer to the surface used as past reference
- application - unchanged
diff --git a/thirdparties/mac/include/libavfilter/avcodec.h b/thirdparties/mac/include/libavfilter/avcodec.h
index 5f4209a..8dee966 100755
--- a/thirdparties/mac/include/libavfilter/avcodec.h
+++ b/thirdparties/mac/include/libavfilter/avcodec.h
@@ -63,7 +63,7 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms);
+ int perms);
/**
* Create and return a buffer reference from the data and properties
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms);
+ const AVFrame *frame,
+ int perms);
#ifdef FF_API_FILL_FRAME
/**
@@ -87,7 +87,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
*/
attribute_deprecated
int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *samplesref);
+ const AVFilterBufferRef *samplesref);
/**
* Fill an AVFrame with the information stored in picref.
@@ -100,7 +100,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
*/
attribute_deprecated
int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *picref);
+ const AVFilterBufferRef *picref);
/**
* Fill an AVFrame with information stored in ref.
diff --git a/thirdparties/mac/include/libavfilter/avfilter.h b/thirdparties/mac/include/libavfilter/avfilter.h
index 1c80167..69c028e 100755
--- a/thirdparties/mac/include/libavfilter/avfilter.h
+++ b/thirdparties/mac/include/libavfilter/avfilter.h
@@ -714,7 +714,7 @@ int avfilter_config_links(AVFilterContext *filter);
*/
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum AVPixelFormat format);
+ int w, int h, enum AVPixelFormat format);
/**
* Create an audio buffer reference wrapped around an already
@@ -731,11 +731,11 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin
* @param channel_layout the channel layout of the buffer
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ uint64_t channel_layout);
/**
* Create an audio buffer reference wrapped around an already
* allocated samples buffer.
@@ -750,12 +750,12 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
* must be either 0 or consistent with channels
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- int channels,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ int channels,
+ uint64_t channel_layout);
diff --git a/thirdparties/mac/include/libavformat/avformat.h b/thirdparties/mac/include/libavformat/avformat.h
index d23d0e8..575b088 100755
--- a/thirdparties/mac/include/libavformat/avformat.h
+++ b/thirdparties/mac/include/libavformat/avformat.h
@@ -367,9 +367,9 @@ typedef struct AVProbeData {
#else
#define AVFMT_TS_NONSTRICT 0x20000
#endif
- /**< Format does not require strictly
- increasing timestamps, but they must
- still be monotonic */
+/**< Format does not require strictly
+ increasing timestamps, but they must
+ still be monotonic */
#define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */
@@ -1378,7 +1378,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
#if FF_API_PKT_DUMP
attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
- int dump_payload);
+ int dump_payload);
#endif
#if FF_API_ALLOC_OUTPUT_CONTEXT
@@ -1387,8 +1387,8 @@ attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
*/
attribute_deprecated
AVFormatContext *avformat_alloc_output_context(const char *format,
- AVOutputFormat *oformat,
- const char *filename);
+ AVOutputFormat *oformat,
+ const char *filename);
#endif
/**
@@ -1835,8 +1835,8 @@ AVOutputFormat *av_guess_format(const char *short_name,
* Guess the codec ID based upon muxer and filename.
*/
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
- const char *filename, const char *mime_type,
- enum AVMediaType type);
+ const char *filename, const char *mime_type,
+ enum AVMediaType type);
/**
* Get timing information for the data currently output.
diff --git a/thirdparties/mac/include/libavformat/avio.h b/thirdparties/mac/include/libavformat/avio.h
index 17b341d..4623814 100755
--- a/thirdparties/mac/include/libavformat/avio.h
+++ b/thirdparties/mac/include/libavformat/avio.h
@@ -120,26 +120,26 @@ typedef struct AVIOContext {
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t maxsize;
+ int64_t maxsize;
- /**
- * avio_read and avio_write should if possible be satisfied directly
- * instead of going through a buffer, and avio_seek will always
- * call the underlying seek function directly.
- */
- int direct;
+ /**
+ * avio_read and avio_write should if possible be satisfied directly
+ * instead of going through a buffer, and avio_seek will always
+ * call the underlying seek function directly.
+ */
+ int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t bytes_read;
+ int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int seek_count;
+ int seek_count;
} AVIOContext;
/* unbuffered I/O */
@@ -177,13 +177,13 @@ int avio_check(const char *url, int flags);
* @return Allocated AVIOContext or NULL on failure.
*/
AVIOContext *avio_alloc_context(
- unsigned char *buffer,
- int buffer_size,
- int write_flag,
- void *opaque,
- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
- int64_t (*seek)(void *opaque, int64_t offset, int whence));
+ unsigned char *buffer,
+ int buffer_size,
+ int write_flag,
+ void *opaque,
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int64_t (*seek)(void *opaque, int64_t offset, int whence));
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
diff --git a/thirdparties/mac/include/libavutil/avstring.h b/thirdparties/mac/include/libavutil/avstring.h
index 5b078f1..00ecca7 100755
--- a/thirdparties/mac/include/libavutil/avstring.h
+++ b/thirdparties/mac/include/libavutil/avstring.h
@@ -214,8 +214,9 @@ static inline int av_isspace(int c)
*/
static inline int av_toupper(int c)
{
- if (c >= 'a' && c <= 'z')
+ if (c >= 'a' && c <= 'z') {
c ^= 0x20;
+ }
return c;
}
@@ -224,8 +225,9 @@ static inline int av_toupper(int c)
*/
static inline int av_tolower(int c)
{
- if (c >= 'A' && c <= 'Z')
+ if (c >= 'A' && c <= 'Z') {
c ^= 0x20;
+ }
return c;
}
diff --git a/thirdparties/mac/include/libavutil/base64.h b/thirdparties/mac/include/libavutil/base64.h
index 514498e..0f2be64 100755
--- a/thirdparties/mac/include/libavutil/base64.h
+++ b/thirdparties/mac/include/libavutil/base64.h
@@ -60,8 +60,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
- /**
- * @}
- */
+/**
+ * @}
+ */
#endif /* AVUTIL_BASE64_H */
diff --git a/thirdparties/mac/include/libavutil/bprint.h b/thirdparties/mac/include/libavutil/bprint.h
index df78916..6dafdc7 100755
--- a/thirdparties/mac/include/libavutil/bprint.h
+++ b/thirdparties/mac/include/libavutil/bprint.h
@@ -74,12 +74,12 @@
*/
typedef struct AVBPrint {
FF_PAD_STRUCTURE(1024,
- char *str; /** string so far */
- unsigned len; /** length so far */
- unsigned size; /** allocated memory */
- unsigned size_max; /** maximum allocated memory */
- char reserved_internal_buffer[1];
- )
+ char *str; /** string so far */
+ unsigned len; /** length so far */
+ unsigned size; /** allocated memory */
+ unsigned size_max; /** maximum allocated memory */
+ char reserved_internal_buffer[1];
+ )
} AVBPrint;
/**
diff --git a/thirdparties/mac/include/libavutil/common.h b/thirdparties/mac/include/libavutil/common.h
index beaf9f7..ede062e 100755
--- a/thirdparties/mac/include/libavutil/common.h
+++ b/thirdparties/mac/include/libavutil/common.h
@@ -97,11 +97,19 @@ av_const int av_log2_16bit(unsigned v);
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -114,11 +122,19 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -128,8 +144,12 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in
*/
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
- if (a&(~0xFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -139,8 +159,12 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
*/
static av_always_inline av_const int8_t av_clip_int8_c(int a)
{
- if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
- else return a;
+ if ((a+0x80) & ~0xFF) {
+ return (a>>31) ^ 0x7F;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -150,8 +174,12 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
- if (a&(~0xFFFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFFFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -161,8 +189,12 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
*/
static av_always_inline av_const int16_t av_clip_int16_c(int a)
{
- if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
- else return a;
+ if ((a+0x8000) & ~0xFFFF) {
+ return (a>>31) ^ 0x7FFF;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -172,8 +204,12 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a)
*/
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
{
- if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
- else return (int32_t)a;
+ if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) {
+ return (a>>63) ^ 0x7FFFFFFF;
+ }
+ else {
+ return (int32_t)a;
+ }
}
/**
@@ -184,8 +220,12 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
- if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
- else return a;
+ if (a & ~((1<<p) - 1)) {
+ return -a >> 31 & ((1<<p) - 1);
+ }
+ else {
+ return a;
+ }
}
/**
@@ -222,11 +262,19 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/** Compute ceil(log2(x)).
@@ -312,7 +360,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
val += (hi<<10) + 0x10000;\
}\
}\
-
+
/**
* @def PUT_UTF8(val, tmp, PUT_BYTE)
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
@@ -376,7 +424,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
PUT_16BIT\
}\
}\
-
+
#include "mem.h"
diff --git a/thirdparties/mac/include/libavutil/cpu.h b/thirdparties/mac/include/libavutil/cpu.h
index c8f34e0..7cb1a50 100755
--- a/thirdparties/mac/include/libavutil/cpu.h
+++ b/thirdparties/mac/include/libavutil/cpu.h
@@ -25,7 +25,7 @@
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
- /* lower 16 bits - CPU features */
+/* lower 16 bits - CPU features */
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
diff --git a/thirdparties/mac/include/libavutil/crc.h b/thirdparties/mac/include/libavutil/crc.h
index 2bdfca8..63e7605 100755
--- a/thirdparties/mac/include/libavutil/crc.h
+++ b/thirdparties/mac/include/libavutil/crc.h
@@ -34,7 +34,7 @@ typedef enum {
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
+} AVCRCId;
/**
* Initialize a CRC table.
diff --git a/thirdparties/mac/include/libavutil/fifo.h b/thirdparties/mac/include/libavutil/fifo.h
index 849b9a6..f56149b 100755
--- a/thirdparties/mac/include/libavutil/fifo.h
+++ b/thirdparties/mac/include/libavutil/fifo.h
@@ -134,10 +134,12 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
{
uint8_t *ptr = f->rptr + offs;
- if (ptr >= f->end)
+ if (ptr >= f->end) {
ptr = f->buffer + (ptr - f->end);
- else if (ptr < f->buffer)
+ }
+ else if (ptr < f->buffer) {
ptr = f->end - (f->buffer - ptr);
+ }
return ptr;
}
diff --git a/thirdparties/mac/include/libavutil/intreadwrite.h b/thirdparties/mac/include/libavutil/intreadwrite.h
index 7ee6977..1d6db92 100755
--- a/thirdparties/mac/include/libavutil/intreadwrite.h
+++ b/thirdparties/mac/include/libavutil/intreadwrite.h
@@ -209,9 +209,15 @@ typedef union {
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+union unaligned_64 {
+ uint64_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_32 {
+ uint32_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_16 {
+ uint16_t l;
+} __attribute__((packed)) av_alias;
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
diff --git a/thirdparties/mac/include/libavutil/lfg.h b/thirdparties/mac/include/libavutil/lfg.h
index ec90562..301d6da 100755
--- a/thirdparties/mac/include/libavutil/lfg.h
+++ b/thirdparties/mac/include/libavutil/lfg.h
@@ -35,7 +35,8 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
* Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case.
*/
-static inline unsigned int av_lfg_get(AVLFG *c){
+static inline unsigned int av_lfg_get(AVLFG *c)
+{
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
return c->state[c->index++ & 63];
}
@@ -45,7 +46,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){
*
* Please also consider av_lfg_get() above, it is faster.
*/
-static inline unsigned int av_mlfg_get(AVLFG *c){
+static inline unsigned int av_mlfg_get(AVLFG *c)
+{
unsigned int a= c->state[(c->index-55) & 63];
unsigned int b= c->state[(c->index-24) & 63];
return c->state[c->index++ & 63] = 2*a*b+a+b;
diff --git a/thirdparties/mac/include/libavutil/log.h b/thirdparties/mac/include/libavutil/log.h
index 7ea95fa..5dc45c1 100755
--- a/thirdparties/mac/include/libavutil/log.h
+++ b/thirdparties/mac/include/libavutil/log.h
@@ -38,7 +38,7 @@ typedef enum {
AV_CLASS_CATEGORY_SWSCALER,
AV_CLASS_CATEGORY_SWRESAMPLER,
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
-}AVClassCategory;
+} AVClassCategory;
struct AVOptionRanges;
diff --git a/thirdparties/mac/include/libavutil/mem.h b/thirdparties/mac/include/libavutil/mem.h
index ced9453..a7b3d9f 100755
--- a/thirdparties/mac/include/libavutil/mem.h
+++ b/thirdparties/mac/include/libavutil/mem.h
@@ -40,36 +40,36 @@
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
#elif defined(__TI_COMPILER_VERSION__)
- #define DECLARE_ALIGNED(n,t,v) \
+#define DECLARE_ALIGNED(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
t __attribute__((aligned(n))) v
- #define DECLARE_ASM_CONST(n,t,v) \
+#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
#elif defined(__GNUC__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
+#define DECLARE_ALIGNED(n,t,v) t v
+#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
- #define av_malloc_attrib __attribute__((__malloc__))
+#define av_malloc_attrib __attribute__((__malloc__))
#else
- #define av_malloc_attrib
+#define av_malloc_attrib
#endif
#if AV_GCC_VERSION_AT_LEAST(4,3)
- #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
#else
- #define av_alloc_size(...)
+#define av_alloc_size(...)
#endif
/**
@@ -93,8 +93,9 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
*/
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_malloc(nmemb * size);
}
@@ -166,8 +167,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
*/
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_mallocz(nmemb * size);
}
@@ -206,8 +208,9 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r)
size_t t = a * b;
/* Hack inspired from glibc: only try the division if nelem and elsize
* are both greater than sqrt(SIZE_MAX). */
- if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
+ if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) {
return AVERROR(EINVAL);
+ }
*r = t;
return 0;
}
diff --git a/thirdparties/mac/include/libavutil/old_pix_fmts.h b/thirdparties/mac/include/libavutil/old_pix_fmts.h
index 57b6992..a804f03 100755
--- a/thirdparties/mac/include/libavutil/old_pix_fmts.h
+++ b/thirdparties/mac/include/libavutil/old_pix_fmts.h
@@ -28,144 +28,144 @@
*
* Do not add new items to this list. Use the AVPixelFormat enum instead.
*/
- PIX_FMT_NONE = AV_PIX_FMT_NONE,
- PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
- PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
- PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+PIX_FMT_NONE = AV_PIX_FMT_NONE,
+PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+PIX_FMT_GRAY8, ///< Y , 8bpp
+PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+PIX_FMT_XVMC_MPEG2_IDCT,
+PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
- PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
- PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
- PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
- PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
- PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
- PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
- PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
- PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
- PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
- PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
- PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
- PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
- PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
- PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
- PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
- PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
- PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
- PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
- PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
- PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
- PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
- PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
- PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
+PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
- //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
- //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
- //is better
- PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
+//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
+//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
+//is better
+PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
- PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
- PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
- PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
- PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
- PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
- PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
+PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
+PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
+PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
+PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
+PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
+PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
+PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
- PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
- PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
- PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
- PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
- PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
+PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
+PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
+PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
+PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
- PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
- PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
- PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
- PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
+PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
+PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
+PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
+PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
- PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/thirdparties/mac/include/libavutil/opt.h b/thirdparties/mac/include/libavutil/opt.h
index baf1b82..05f6f4b 100755
--- a/thirdparties/mac/include/libavutil/opt.h
+++ b/thirdparties/mac/include/libavutil/opt.h
@@ -217,7 +217,7 @@
* before the file is actually opened.
*/
-enum AVOptionType{
+enum AVOptionType {
AV_OPT_TYPE_FLAGS,
AV_OPT_TYPE_INT,
AV_OPT_TYPE_INT64,
diff --git a/thirdparties/mac/include/libavutil/pixdesc.h b/thirdparties/mac/include/libavutil/pixdesc.h
index ca0722e..4caa15b 100755
--- a/thirdparties/mac/include/libavutil/pixdesc.h
+++ b/thirdparties/mac/include/libavutil/pixdesc.h
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include "pixfmt.h"
-typedef struct AVComponentDescriptor{
+typedef struct AVComponentDescriptor {
uint16_t plane :2; ///< which of the 4 planes contains the component
/**
@@ -41,7 +41,7 @@ typedef struct AVComponentDescriptor{
uint16_t offset_plus1 :3;
uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
-}AVComponentDescriptor;
+} AVComponentDescriptor;
/**
* Descriptor that unambiguously describes how the bits of a pixel are
@@ -52,7 +52,7 @@ typedef struct AVComponentDescriptor{
* and all the YUV variants) AVPixFmtDescriptor just stores how values
* are stored not what these values represent.
*/
-typedef struct AVPixFmtDescriptor{
+typedef struct AVPixFmtDescriptor {
const char *name;
uint8_t nb_components; ///< The number of components each pixel has, (1-4)
@@ -84,7 +84,7 @@ typedef struct AVPixFmtDescriptor{
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
*/
AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
+} AVPixFmtDescriptor;
#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
diff --git a/thirdparties/mac/include/libavutil/rational.h b/thirdparties/mac/include/libavutil/rational.h
index 417e29e..84ce7a0 100755
--- a/thirdparties/mac/include/libavutil/rational.h
+++ b/thirdparties/mac/include/libavutil/rational.h
@@ -40,7 +40,7 @@
/**
* rational number numerator/denominator
*/
-typedef struct AVRational{
+typedef struct AVRational {
int num; ///< numerator
int den; ///< denominator
} AVRational;
@@ -52,13 +52,22 @@ typedef struct AVRational{
* @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
* values is of the form 0/0
*/
-static inline int av_cmp_q(AVRational a, AVRational b){
+static inline int av_cmp_q(AVRational a, AVRational b)
+{
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
- if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
- else if(b.den && a.den) return 0;
- else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
- else return INT_MIN;
+ if(tmp) {
+ return ((tmp ^ a.den ^ b.den)>>63)|1;
+ }
+ else if(b.den && a.den) {
+ return 0;
+ }
+ else if(a.num && b.num) {
+ return (a.num>>31) - (b.num>>31);
+ }
+ else {
+ return INT_MIN;
+ }
}
/**
@@ -66,7 +75,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){
* @param a rational to convert
* @return (double) a
*/
-static inline double av_q2d(AVRational a){
+static inline double av_q2d(AVRational a)
+{
return a.num / (double) a.den;
}
diff --git a/thirdparties/mac/include/libavutil/timestamp.h b/thirdparties/mac/include/libavutil/timestamp.h
index c7348d8..6b46998 100755
--- a/thirdparties/mac/include/libavutil/timestamp.h
+++ b/thirdparties/mac/include/libavutil/timestamp.h
@@ -38,8 +38,12 @@
*/
static inline char *av_ts_make_string(char *buf, int64_t ts)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ }
return buf;
}
@@ -60,8 +64,12 @@ static inline char *av_ts_make_string(char *buf, int64_t ts)
*/
static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ }
return buf;
}
diff --git a/thirdparties/mac/include/libswresample/swresample.h b/thirdparties/mac/include/libswresample/swresample.h
index 95e8a5a..d7e3027 100755
--- a/thirdparties/mac/include/libswresample/swresample.h
+++ b/thirdparties/mac/include/libswresample/swresample.h
@@ -214,7 +214,7 @@ void swr_free(struct SwrContext **s);
* @return number of samples output per channel, negative value on error
*/
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
- const uint8_t **in , int in_count);
+ const uint8_t **in , int in_count);
/**
* Convert the next timestamp from input to output
diff --git a/thirdparties/mac/include/opus/opus.h b/thirdparties/mac/include/opus/opus.h
index 93a53a2..3bc4526 100755
--- a/thirdparties/mac/include/opus/opus.h
+++ b/thirdparties/mac/include/opus/opus.h
@@ -525,12 +525,12 @@ OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
* @returns number of frames
*/
OPUS_EXPORT int opus_packet_parse(
- const unsigned char *data,
- opus_int32 len,
- unsigned char *out_toc,
- const unsigned char *frames[48],
- opus_int16 size[48],
- int *payload_offset
+ const unsigned char *data,
+ opus_int32 len,
+ unsigned char *out_toc,
+ const unsigned char *frames[48],
+ opus_int16 size[48],
+ int *payload_offset
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Gets the bandwidth of an Opus packet.
diff --git a/thirdparties/mac/include/opus/opus_multistream.h b/thirdparties/mac/include/opus/opus_multistream.h
index ae59979..e0fe282 100755
--- a/thirdparties/mac/include/opus/opus_multistream.h
+++ b/thirdparties/mac/include/opus/opus_multistream.h
@@ -201,13 +201,13 @@ typedef struct OpusMSDecoder OpusMSDecoder;
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size(
- int channels,
- int mapping_family
+ int channels,
+ int mapping_family
);
@@ -255,24 +255,24 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application,
+ int *error
) OPUS_ARG_NONNULL(5);
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create(
- opus_int32 Fs,
- int channels,
- int mapping_family,
- int *streams,
- int *coupled_streams,
- unsigned char *mapping,
- int application,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int mapping_family,
+ int *streams,
+ int *coupled_streams,
+ unsigned char *mapping,
+ int application,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Initialize a previously allocated multistream encoder state.
@@ -324,24 +324,24 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_enc
* on failure.
*/
OPUS_EXPORT int opus_multistream_encoder_init(
- OpusMSEncoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int application
+ OpusMSEncoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int application
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
OPUS_EXPORT int opus_multistream_surround_encoder_init(
- OpusMSEncoder *st,
- opus_int32 Fs,
- int channels,
- int mapping_family,
- int *streams,
- int *coupled_streams,
- unsigned char *mapping,
- int application
+ OpusMSEncoder *st,
+ opus_int32 Fs,
+ int channels,
+ int mapping_family,
+ int *streams,
+ int *coupled_streams,
+ unsigned char *mapping,
+ int application
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Encodes a multistream Opus frame.
@@ -420,11 +420,11 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
* negative error code (see @ref opus_errorcodes) on failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float(
- OpusMSEncoder *st,
- const float *pcm,
- int frame_size,
- unsigned char *data,
- opus_int32 max_data_bytes
+ OpusMSEncoder *st,
+ const float *pcm,
+ int frame_size,
+ unsigned char *data,
+ opus_int32 max_data_bytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Frees an <code>OpusMSEncoder</code> allocated by
@@ -468,8 +468,8 @@ OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...
* (see @ref opus_errorcodes) on error.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size(
- int streams,
- int coupled_streams
+ int streams,
+ int coupled_streams
);
/** Allocates and initializes a multistream decoder state.
@@ -502,12 +502,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size
* failure.
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping,
- int *error
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping,
+ int *error
) OPUS_ARG_NONNULL(5);
/** Intialize a previously allocated decoder state object.
@@ -545,12 +545,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea
* on failure.
*/
OPUS_EXPORT int opus_multistream_decoder_init(
- OpusMSDecoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- const unsigned char *mapping
+ OpusMSDecoder *st,
+ opus_int32 Fs,
+ int channels,
+ int streams,
+ int coupled_streams,
+ const unsigned char *mapping
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
/** Decode a multistream Opus packet.
diff --git a/thirdparties/mac/include/opus/opus_types.h b/thirdparties/mac/include/opus/opus_types.h
index b28e03a..85a2ed8 100755
--- a/thirdparties/mac/include/opus/opus_types.h
+++ b/thirdparties/mac/include/opus/opus_types.h
@@ -37,114 +37,114 @@
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#include <stdint.h>
- typedef int16_t opus_int16;
- typedef uint16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef uint32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef uint16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef uint32_t opus_uint32;
#elif defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t opus_int32;
- typedef _G_uint32_t opus_uint32;
- typedef _G_int16 opus_int16;
- typedef _G_uint16 opus_uint16;
+typedef _G_int32_t opus_int32;
+typedef _G_uint32_t opus_uint32;
+typedef _G_int16 opus_int16;
+typedef _G_uint16 opus_uint16;
# elif defined(__MINGW32__)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
# elif defined(__MWERKS__)
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
# else
- /* MSVC/Borland */
- typedef __int32 opus_int32;
- typedef unsigned __int32 opus_uint32;
- typedef __int16 opus_int16;
- typedef unsigned __int16 opus_uint16;
+/* MSVC/Borland */
+typedef __int32 opus_int32;
+typedef unsigned __int32 opus_uint32;
+typedef __int16 opus_int16;
+typedef unsigned __int16 opus_uint16;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 opus_int16;
- typedef UInt16 opus_uint16;
- typedef SInt32 opus_int32;
- typedef UInt32 opus_uint32;
+typedef SInt16 opus_int16;
+typedef UInt16 opus_uint16;
+typedef SInt32 opus_int32;
+typedef UInt32 opus_uint32;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t opus_int16;
- typedef u_int16_t opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16_t opus_int16;
+typedef u_int16_t opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16 opus_int16;
- typedef u_int16 opus_uint16;
- typedef int32_t opus_int32;
- typedef u_int32_t opus_uint32;
+typedef int16 opus_int16;
+typedef u_int16 opus_uint16;
+typedef int32_t opus_int32;
+typedef u_int32_t opus_uint32;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* OS/2 GCC */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* DJGPP */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(R5900)
- /* PS2 EE */
- typedef int opus_int32;
- typedef unsigned opus_uint32;
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
+/* PS2 EE */
+typedef int opus_int32;
+typedef unsigned opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short opus_int16;
- typedef unsigned short opus_uint16;
- typedef signed int opus_int32;
- typedef unsigned int opus_uint32;
+/* Symbian GCC */
+typedef signed short opus_int16;
+typedef unsigned short opus_uint16;
+typedef signed int opus_int32;
+typedef unsigned int opus_uint32;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef long opus_int32;
- typedef unsigned long opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef long opus_int32;
+typedef unsigned long opus_uint32;
#elif defined(CONFIG_TI_C6X)
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#else
- /* Give up, take a reasonable guess */
- typedef short opus_int16;
- typedef unsigned short opus_uint16;
- typedef int opus_int32;
- typedef unsigned int opus_uint32;
+/* Give up, take a reasonable guess */
+typedef short opus_int16;
+typedef unsigned short opus_uint16;
+typedef int opus_int32;
+typedef unsigned int opus_uint32;
#endif
diff --git a/thirdparties/mac/include/speex/speex.h b/thirdparties/mac/include/speex/speex.h
index 82ba016..0eb560e 100755
--- a/thirdparties/mac/include/speex/speex.h
+++ b/thirdparties/mac/include/speex/speex.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
-/** Struct defining a Speex mode */
+/** Struct defining a Speex mode */
typedef struct SpeexMode {
- /** Pointer to the low-level mode data */
- const void *mode;
+ /** Pointer to the low-level mode data */
+ const void *mode;
+
+ /** Pointer to the mode query function */
+ mode_query_func query;
- /** Pointer to the mode query function */
- mode_query_func query;
-
- /** The name of the mode (you should not rely on this to identify the mode)*/
- const char *modeName;
+ /** The name of the mode (you should not rely on this to identify the mode)*/
+ const char *modeName;
- /**ID of the mode*/
- int modeID;
+ /**ID of the mode*/
+ int modeID;
- /**Version number of the bitstream (incremented every time we break
- bitstream compatibility*/
- int bitstream_version;
+ /**Version number of the bitstream (incremented every time we break
+ bitstream compatibility*/
+ int bitstream_version;
- /** Pointer to encoder initialization function */
- encoder_init_func enc_init;
+ /** Pointer to encoder initialization function */
+ encoder_init_func enc_init;
- /** Pointer to encoder destruction function */
- encoder_destroy_func enc_destroy;
+ /** Pointer to encoder destruction function */
+ encoder_destroy_func enc_destroy;
- /** Pointer to frame encoding function */
- encode_func enc;
+ /** Pointer to frame encoding function */
+ encode_func enc;
- /** Pointer to decoder initialization function */
- decoder_init_func dec_init;
+ /** Pointer to decoder initialization function */
+ decoder_init_func dec_init;
- /** Pointer to decoder destruction function */
- decoder_destroy_func dec_destroy;
+ /** Pointer to decoder destruction function */
+ decoder_destroy_func dec_destroy;
- /** Pointer to frame decoding function */
- decode_func dec;
+ /** Pointer to frame decoding function */
+ decode_func dec;
- /** ioctl-like requests for encoder */
- encoder_ctl_func enc_ctl;
+ /** ioctl-like requests for encoder */
+ encoder_ctl_func enc_ctl;
- /** ioctl-like requests for decoder */
- decoder_ctl_func dec_ctl;
+ /** ioctl-like requests for decoder */
+ decoder_ctl_func dec_ctl;
} SpeexMode;
/**
- * Returns a handle to a newly created Speex encoder state structure. For now,
- * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
- * may be added. Note that for now if you have more than one channels to
+ * Returns a handle to a newly created Speex encoder state structure. For now,
+ * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
+ * may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
- * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
+ * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
-/** Frees all resources associated to an existing Speex encoder state.
+/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
- @param in Frame that will be encoded with a +-2^15 range. This data MAY be
- overwritten by the encoder and should be considered uninitialised
+ @param in Frame that will be encoded with a +-2^15 range. This data MAY be
+ overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
@@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int speex_encoder_ctl(void *state, int request, void *ptr);
-/** Returns a handle to a newly created decoder state structure. For now,
+/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
- */
+ */
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
diff --git a/thirdparties/mac/include/speex/speex_bits.h b/thirdparties/mac/include/speex/speex_bits.h
index a26fb4c..dd3b752 100755
--- a/thirdparties/mac/include/speex/speex_bits.h
+++ b/thirdparties/mac/include/speex/speex_bits.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,15 +47,15 @@ extern "C" {
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
- char *chars; /**< "raw" data */
- int nbBits; /**< Total number of bits stored in the stream*/
- int charPtr; /**< Position of the byte "cursor" */
- int bitPtr; /**< Position of the bit "cursor" within the current char */
- int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
- int overflow;/**< Set to one if we try to read past the valid data */
- int buf_size;/**< Allocated size for buffer */
- int reserved1; /**< Reserved for future use */
- void *reserved2; /**< Reserved for future use */
+ char *chars; /**< "raw" data */
+ int nbBits; /**< Total number of bits stored in the stream*/
+ int charPtr; /**< Position of the byte "cursor" */
+ int bitPtr; /**< Position of the bit "cursor" within the current char */
+ int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
+ int overflow;/**< Set to one if we try to read past the valid data */
+ int buf_size;/**< Allocated size for buffer */
+ int reserved1; /**< Reserved for future use */
+ void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int speex_bits_nbytes(SpeexBits *bits);
-/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
- *
+/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
+ *
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
- * "cursor" position
- *
+ * "cursor" position
+ *
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
-/** Advances the position of the "bit cursor" in the stream
+/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int speex_bits_remaining(SpeexBits *bits);
-/** Insert a terminator so that the data can be sent as a packet while auto-detecting
- * the number of frames in each packet
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting
+ * the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
diff --git a/thirdparties/mac/include/speex/speex_buffer.h b/thirdparties/mac/include/speex/speex_buffer.h
index df56f5f..909bd6d 100755
--- a/thirdparties/mac/include/speex/speex_buffer.h
+++ b/thirdparties/mac/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/thirdparties/mac/include/speex/speex_callbacks.h b/thirdparties/mac/include/speex/speex_callbacks.h
index 6f450b3..27b5649 100755
--- a/thirdparties/mac/include/speex/speex_callbacks.h
+++ b/thirdparties/mac/include/speex/speex_callbacks.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
- int callback_id; /**< ID associated to the callback */
- speex_callback_func func; /**< Callback handler function */
- void *data; /**< Data that will be sent to the handler */
- void *reserved1; /**< Reserved for future use */
- int reserved2; /**< Reserved for future use */
+ int callback_id; /**< ID associated to the callback */
+ speex_callback_func func; /**< Callback handler function */
+ void *data; /**< Data that will be sent to the handler */
+ void *reserved1; /**< Reserved for future use */
+ int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
diff --git a/thirdparties/mac/include/speex/speex_echo.h b/thirdparties/mac/include/speex/speex_echo.h
index 53bcd28..582e1cc 100755
--- a/thirdparties/mac/include/speex/speex_echo.h
+++ b/thirdparties/mac/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/thirdparties/mac/include/speex/speex_header.h b/thirdparties/mac/include/speex/speex_header.h
index f85b249..4cc15df 100755
--- a/thirdparties/mac/include/speex/speex_header.h
+++ b/thirdparties/mac/include/speex/speex_header.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,21 +57,21 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
- char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
- char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
- spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
- spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
- spx_int32_t rate; /**< Sampling rate used */
- spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
- spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
- spx_int32_t nb_channels; /**< Number of channels encoded */
- spx_int32_t bitrate; /**< Bit-rate used */
- spx_int32_t frame_size; /**< Size of frames */
- spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
- spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
- spx_int32_t extra_headers; /**< Number of additional headers after the comments */
- spx_int32_t reserved1; /**< Reserved for future use, must be zero */
- spx_int32_t reserved2; /**< Reserved for future use, must be zero */
+ char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
+ char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
+ spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
+ spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
+ spx_int32_t rate; /**< Sampling rate used */
+ spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
+ spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
+ spx_int32_t nb_channels; /**< Number of channels encoded */
+ spx_int32_t bitrate; /**< Bit-rate used */
+ spx_int32_t frame_size; /**< Size of frames */
+ spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
+ spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
+ spx_int32_t extra_headers; /**< Number of additional headers after the comments */
+ spx_int32_t reserved1; /**< Reserved for future use, must be zero */
+ spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
diff --git a/thirdparties/mac/include/speex/speex_jitter.h b/thirdparties/mac/include/speex/speex_jitter.h
index d68674b..e6f0321 100755
--- a/thirdparties/mac/include/speex/speex_jitter.h
+++ b/thirdparties/mac/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
- char *data; /**< Data bytes contained in the packet */
- spx_uint32_t len; /**< Length of the packet in bytes */
- spx_uint32_t timestamp; /**< Timestamp for the packet */
- spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
- spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
- spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
+ char *data; /**< Data bytes contained in the packet */
+ spx_uint32_t len; /**< Length of the packet in bytes */
+ spx_uint32_t timestamp; /**< Timestamp for the packet */
+ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
+ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
+ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/mac/include/speex/speex_preprocess.h b/thirdparties/mac/include/speex/speex_preprocess.h
index f8eef2c..5cd3710 100755
--- a/thirdparties/mac/include/speex/speex_preprocess.h
+++ b/thirdparties/mac/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/mac/include/speex/speex_resampler.h b/thirdparties/mac/include/speex/speex_resampler.h
index 54eef8d..4aefa61 100755
--- a/thirdparties/mac/include/speex/speex_resampler.h
+++ b/thirdparties/mac/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,7 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
@@ -99,13 +99,13 @@ extern "C" {
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
- RESAMPLER_ERR_SUCCESS = 0,
- RESAMPLER_ERR_ALLOC_FAILED = 1,
- RESAMPLER_ERR_BAD_STATE = 2,
- RESAMPLER_ERR_INVALID_ARG = 3,
- RESAMPLER_ERR_PTR_OVERLAP = 4,
-
- RESAMPLER_ERR_MAX_ERROR
+ RESAMPLER_ERR_SUCCESS = 0,
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
+ RESAMPLER_ERR_BAD_STATE = 2,
+ RESAMPLER_ERR_INVALID_ARG = 3,
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
+
+ RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
@@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
-
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
+
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
/** Destroy a resampler state.
* @param st Resampler state
@@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
@@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
- int quality);
+int speex_resampler_set_quality(SpeexResamplerState *st,
+ int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
- spx_uint32_t stride);
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
+ spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
- spx_uint32_t *stride);
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
+ spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
@@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/thirdparties/mac/include/speex/speex_stereo.h b/thirdparties/mac/include/speex/speex_stereo.h
index a259713..f33704d 100755
--- a/thirdparties/mac/include/speex/speex_stereo.h
+++ b/thirdparties/mac/include/speex/speex_stereo.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -48,12 +48,12 @@ extern "C" {
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
- float balance; /**< Left/right balance info */
- float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
- float smooth_left; /**< Smoothed left channel gain */
- float smooth_right; /**< Smoothed right channel gain */
- float reserved1; /**< Reserved for future use */
- float reserved2; /**< Reserved for future use */
+ float balance; /**< Left/right balance info */
+ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
+ float smooth_left; /**< Smoothed left channel gain */
+ float smooth_right; /**< Smoothed right channel gain */
+ float reserved1; /**< Reserved for future use */
+ float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
diff --git a/thirdparties/mac/include/speex/speex_types.h b/thirdparties/mac/include/speex/speex_types.h
index 852fed8..fa8f806 100755
--- a/thirdparties/mac/include/speex/speex_types.h
+++ b/thirdparties/mac/include/speex/speex_types.h
@@ -22,100 +22,100 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t spx_int32_t;
- typedef _G_uint32_t spx_uint32_t;
- typedef _G_int16_t spx_int16_t;
- typedef _G_uint16_t spx_uint16_t;
+typedef _G_int32_t spx_int32_t;
+typedef _G_uint32_t spx_uint32_t;
+typedef _G_int16_t spx_int16_t;
+typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int32 spx_int32_t;
- typedef unsigned __int32 spx_uint32_t;
- typedef __int16 spx_int16_t;
- typedef unsigned __int16 spx_uint16_t;
+/* MSVC/Borland */
+typedef __int32 spx_int32_t;
+typedef unsigned __int32 spx_uint32_t;
+typedef __int16 spx_int16_t;
+typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 spx_int16_t;
- typedef UInt16 spx_uint16_t;
- typedef SInt32 spx_int32_t;
- typedef UInt32 spx_uint32_t;
+typedef SInt16 spx_int16_t;
+typedef UInt16 spx_uint16_t;
+typedef SInt32 spx_int32_t;
+typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* OS/2 GCC */
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short spx_int16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* DJGPP */
+typedef short spx_int16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef int spx_int32_t;
- typedef unsigned spx_uint32_t;
- typedef short spx_int16_t;
+/* PS2 EE */
+typedef int spx_int32_t;
+typedef unsigned spx_uint32_t;
+typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef signed int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* Symbian GCC */
+typedef signed short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef signed int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef long spx_int32_t;
- typedef unsigned long spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef long spx_int32_t;
+typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#else
diff --git a/thirdparties/mac/include/srtp/aes.h b/thirdparties/mac/include/srtp/aes.h
index d88ce40..0d5e01c 100755
--- a/thirdparties/mac/include/srtp/aes.h
+++ b/thirdparties/mac/include/srtp/aes.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -53,19 +53,19 @@
/* aes internals */
typedef struct {
- v128_t round[15];
- int num_rounds;
+ v128_t round[15];
+ int num_rounds;
} aes_expanded_key_t;
err_status_t
aes_expand_encryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
err_status_t
aes_expand_decryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
void
aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
@@ -75,7 +75,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
#if 0
/*
- * internal functions
+ * internal functions
*/
void
@@ -83,6 +83,6 @@ aes_init_sbox(void);
void
aes_compute_tables(void);
-#endif
+#endif
#endif /* _AES_H */
diff --git a/thirdparties/mac/include/srtp/aes_cbc.h b/thirdparties/mac/include/srtp/aes_cbc.h
index 4fda390..14fb658 100755
--- a/thirdparties/mac/include/srtp/aes_cbc.h
+++ b/thirdparties/mac/include/srtp/aes_cbc.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,38 +51,38 @@
#include "cipher.h"
typedef struct {
- v128_t state; /* cipher chaining state */
- v128_t previous; /* previous ciphertext block */
- uint8_t key[32];
- int key_len;
- aes_expanded_key_t expanded_key; /* the cipher key */
+ v128_t state; /* cipher chaining state */
+ v128_t previous; /* previous ciphertext block */
+ uint8_t key[32];
+ int key_len;
+ aes_expanded_key_t expanded_key; /* the cipher key */
} aes_cbc_ctx_t;
err_status_t
aes_cbc_set_key(aes_cbc_ctx_t *c,
- const unsigned char *key);
+ const unsigned char *key);
err_status_t
-aes_cbc_encrypt(aes_cbc_ctx_t *c,
- unsigned char *buf,
- unsigned int *bytes_in_data);
+aes_cbc_encrypt(aes_cbc_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *bytes_in_data);
err_status_t
-aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
- int key_len);
+aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
+ int key_len);
err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction);
err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
#endif /* AES_CBC_H */
diff --git a/thirdparties/mac/include/srtp/aes_gcm_ossl.h b/thirdparties/mac/include/srtp/aes_gcm_ossl.h
index 8e7711d..827ecd3 100755
--- a/thirdparties/mac/include/srtp/aes_gcm_ossl.h
+++ b/thirdparties/mac/include/srtp/aes_gcm_ossl.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,11 +52,11 @@
#include <openssl/aes.h>
typedef struct {
- v256_t key;
- int key_size;
- int tag_len;
- EVP_CIPHER_CTX ctx;
- cipher_direction_t dir;
+ v256_t key;
+ int key_size;
+ int tag_len;
+ EVP_CIPHER_CTX ctx;
+ cipher_direction_t dir;
} aes_gcm_ctx_t;
#endif /* AES_GCM_OSSL_H */
diff --git a/thirdparties/mac/include/srtp/aes_icm.h b/thirdparties/mac/include/srtp/aes_icm.h
index 1a2fd82..f4505ec 100755
--- a/thirdparties/mac/include/srtp/aes_icm.h
+++ b/thirdparties/mac/include/srtp/aes_icm.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,43 +51,43 @@
#include "cipher.h"
typedef struct {
- v128_t counter; /* holds the counter value */
- v128_t offset; /* initial offset value */
- v128_t keystream_buffer; /* buffers bytes of keystream */
- aes_expanded_key_t expanded_key; /* the cipher key */
- int bytes_in_buffer; /* number of unused bytes in buffer */
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
} aes_icm_ctx_t;
err_status_t
aes_icm_context_init(aes_icm_ctx_t *c,
- const unsigned char *key,
- int key_len);
+ const unsigned char *key,
+ int key_len);
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction);
err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
aes_icm_output(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int bytes_to_output);
+ unsigned char *buf, unsigned int bytes_to_output);
-err_status_t
+err_status_t
aes_icm_dealloc(cipher_t *c);
-
-err_status_t
-aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
- unsigned char *buf,
- unsigned int *enc_len,
- int forIsmacryp);
-
-err_status_t
-aes_icm_alloc_ismacryp(cipher_t **c,
- int key_len,
- int forIsmacryp);
+
+err_status_t
+aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *enc_len,
+ int forIsmacryp);
+
+err_status_t
+aes_icm_alloc_ismacryp(cipher_t **c,
+ int key_len,
+ int forIsmacryp);
uint16_t
aes_icm_bytes_encrypted(aes_icm_ctx_t *c);
diff --git a/thirdparties/mac/include/srtp/alloc.h b/thirdparties/mac/include/srtp/alloc.h
index 5980eed..306e5f4 100755
--- a/thirdparties/mac/include/srtp/alloc.h
+++ b/thirdparties/mac/include/srtp/alloc.h
@@ -1,32 +1,32 @@
/*
* alloc.h
*
- * interface to memory allocation and deallocation, with optional debugging
+ * interface to memory allocation and deallocation, with optional debugging
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/mac/include/srtp/auth.h b/thirdparties/mac/include/srtp/auth.h
index 5b5e4b2..4d03d08 100755
--- a/thirdparties/mac/include/srtp/auth.h
+++ b/thirdparties/mac/include/srtp/auth.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "err.h" /* error codes */
#include "crypto.h" /* for auth_type_id_t */
#include "crypto_types.h" /* for values of auth_type_id_t */
@@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer;
typedef struct auth_t *auth_pointer_t;
typedef err_status_t (*auth_alloc_func)
- (auth_pointer_t *ap, int key_len, int out_len);
+(auth_pointer_t *ap, int key_len, int out_len);
typedef err_status_t (*auth_init_func)
- (void *state, const uint8_t *key, int key_len);
+(void *state, const uint8_t *key, int key_len);
typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap);
typedef err_status_t (*auth_compute_func)
- (void *state, uint8_t *buffer, int octets_to_auth,
- int tag_len, uint8_t *tag);
+(void *state, uint8_t *buffer, int octets_to_auth,
+ int tag_len, uint8_t *tag);
typedef err_status_t (*auth_update_func)
- (void *state, uint8_t *buffer, int octets_to_auth);
+(void *state, uint8_t *buffer, int octets_to_auth);
typedef err_status_t (*auth_start_func)(void *state);
-
+
/* some syntactic sugar on these function types */
#define auth_type_alloc(at, a, klen, outlen) \
@@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a);
*/
typedef struct auth_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- int data_length_octets; /* octets in data */
- uint8_t *data; /* data */
- int tag_length_octets; /* octets in tag */
- uint8_t *tag; /* tag */
- struct auth_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ int data_length_octets; /* octets in data */
+ uint8_t *data; /* data */
+ int tag_length_octets; /* octets in tag */
+ uint8_t *tag; /* tag */
+ struct auth_test_case_t *next_test_case; /* pointer to next testcase */
} auth_test_case_t;
/* auth_type_t */
typedef struct auth_type_t {
- auth_alloc_func alloc;
- auth_dealloc_func dealloc;
- auth_init_func init;
- auth_compute_func compute;
- auth_update_func update;
- auth_start_func start;
- char *description;
- int ref_count;
- auth_test_case_t *test_data;
- debug_module_t *debug;
- auth_type_id_t id;
+ auth_alloc_func alloc;
+ auth_dealloc_func dealloc;
+ auth_init_func init;
+ auth_compute_func compute;
+ auth_update_func update;
+ auth_start_func start;
+ char *description;
+ int ref_count;
+ auth_test_case_t *test_data;
+ debug_module_t *debug;
+ auth_type_id_t id;
} auth_type_t;
typedef struct auth_t {
- auth_type_t *type;
- void *state;
- int out_len; /* length of output tag in octets */
- int key_len; /* length of key in octets */
- int prefix_len; /* length of keystream prefix */
+ auth_type_t *type;
+ void *state;
+ int out_len; /* length of output tag in octets */
+ int key_len; /* length of key in octets */
+ int prefix_len; /* length of keystream prefix */
} auth_t;
-/*
+/*
* auth_type_self_test() tests an auth_type against test cases
* provided in an array of values of key/message/tag that is known to
* be good
@@ -151,7 +151,7 @@ typedef struct auth_t {
err_status_t
auth_type_self_test(const auth_type_t *at);
-/*
+/*
* auth_type_test() tests an auth_type against external test cases
* provided in an array of values of key/message/tag that is known to
* be good
diff --git a/thirdparties/mac/include/srtp/cipher.h b/thirdparties/mac/include/srtp/cipher.h
index d0d6b57..20bd360 100755
--- a/thirdparties/mac/include/srtp/cipher.h
+++ b/thirdparties/mac/include/srtp/cipher.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CIPHER_H
#define CIPHER_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "rdbx.h" /* for xtd_seq_num_t */
#include "err.h" /* for error codes */
#include "crypto.h" /* for cipher_type_id_t */
@@ -54,17 +54,17 @@
/**
- * @brief cipher_direction_t defines a particular cipher operation.
+ * @brief cipher_direction_t defines a particular cipher operation.
*
* A cipher_direction_t is an enum that describes a particular cipher
* operation, i.e. encryption or decryption. For some ciphers, this
* distinction does not matter, but for others, it is essential.
*/
-typedef enum {
- direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
- direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
- direction_any /**< encryption or decryption */
+typedef enum {
+ direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
+ direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
+ direction_any /**< encryption or decryption */
} cipher_direction_t;
/*
@@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t;
typedef struct cipher_t *cipher_pointer_t;
/*
- * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
+ * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
*/
typedef err_status_t (*cipher_alloc_func_t)
- (cipher_pointer_t *cp, int key_len, int tag_len);
+(cipher_pointer_t *cp, int key_len, int tag_len);
-/*
+/*
* a cipher_init_func_t [re-]initializes a cipher_t with a given key
*/
@@ -96,38 +96,38 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp);
/* a cipher_set_segment_func_t sets the segment index of a cipher_t */
typedef err_status_t (*cipher_set_segment_func_t)
- (void *state, xtd_seq_num_t idx);
+(void *state, xtd_seq_num_t idx);
-/*
- * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
+/*
+ * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
*/
typedef err_status_t (*cipher_set_aad_func_t)
- (void *state, uint8_t *aad, unsigned int aad_len);
+(void *state, uint8_t *aad, unsigned int aad_len);
/* a cipher_encrypt_func_t encrypts data in-place */
typedef err_status_t (*cipher_encrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
/* a cipher_decrypt_func_t decrypts data in-place */
typedef err_status_t (*cipher_decrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
-/*
+/*
* a cipher_set_iv_func_t function sets the current initialization vector
*/
typedef err_status_t (*cipher_set_iv_func_t)
- (cipher_pointer_t cp, void *iv, cipher_direction_t direction);
+(cipher_pointer_t cp, void *iv, cipher_direction_t direction);
/*
* a cipher_get_tag_funct_t function is used to get the authentication
* tag that was calculated by an AEAD cipher.
*/
typedef err_status_t (*cipher_get_tag_func_t)
- (void *state, void *tag, int *len);
+(void *state, void *tag, int *len);
/*
@@ -139,35 +139,35 @@ typedef err_status_t (*cipher_get_tag_func_t)
*/
typedef struct cipher_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- uint8_t *idx; /* packet index */
- int plaintext_length_octets; /* octets in plaintext */
- uint8_t *plaintext; /* plaintext */
- int ciphertext_length_octets; /* octets in plaintext */
- uint8_t *ciphertext; /* ciphertext */
- int aad_length_octets; /* octets in AAD */
- uint8_t *aad; /* AAD */
- int tag_length_octets; /* Length of AEAD tag */
- struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ uint8_t *idx; /* packet index */
+ int plaintext_length_octets; /* octets in plaintext */
+ uint8_t *plaintext; /* plaintext */
+ int ciphertext_length_octets; /* octets in plaintext */
+ uint8_t *ciphertext; /* ciphertext */
+ int aad_length_octets; /* octets in AAD */
+ uint8_t *aad; /* AAD */
+ int tag_length_octets; /* Length of AEAD tag */
+ struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
} cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t {
- cipher_alloc_func_t alloc;
- cipher_dealloc_func_t dealloc;
- cipher_init_func_t init;
- cipher_set_aad_func_t set_aad;
- cipher_encrypt_func_t encrypt;
- cipher_encrypt_func_t decrypt;
- cipher_set_iv_func_t set_iv;
- cipher_get_tag_func_t get_tag;
- char *description;
- int ref_count;
- cipher_test_case_t *test_data;
- debug_module_t *debug;
- cipher_type_id_t id;
+ cipher_alloc_func_t alloc;
+ cipher_dealloc_func_t dealloc;
+ cipher_init_func_t init;
+ cipher_set_aad_func_t set_aad;
+ cipher_encrypt_func_t encrypt;
+ cipher_encrypt_func_t decrypt;
+ cipher_set_iv_func_t set_iv;
+ cipher_get_tag_func_t get_tag;
+ char *description;
+ int ref_count;
+ cipher_test_case_t *test_data;
+ debug_module_t *debug;
+ cipher_type_id_t id;
} cipher_type_t;
/*
@@ -176,10 +176,10 @@ typedef struct cipher_type_t {
*/
typedef struct cipher_t {
- cipher_type_t *type;
- void *state;
- int key_len;
- int algorithm;
+ cipher_type_t *type;
+ void *state;
+ int key_len;
+ int algorithm;
} cipher_t;
/* some syntactic sugar on these function types */
@@ -201,11 +201,11 @@ typedef struct cipher_t {
#define cipher_set_iv(c, n, dir) \
((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n), (dir))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
#define cipher_set_aad(c, a, l) \
(((c) && (((c)->type)->set_aad)) ? \
(((c)->type)->set_aad(((c)->state), (a), (l))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output);
@@ -217,9 +217,9 @@ int
cipher_get_key_length(const cipher_t *c);
-/*
- * cipher_type_self_test() tests a cipher against test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_self_test() tests a cipher against test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -227,9 +227,9 @@ err_status_t
cipher_type_self_test(const cipher_type_t *ct);
-/*
- * cipher_type_test() tests a cipher against external test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_test() tests a cipher against external test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -240,7 +240,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data);
/*
* cipher_bits_per_second(c, l, t) computes (and estimate of) the
* number of bits that a cipher implementation can encrypt in a second
- *
+ *
* c is a cipher (which MUST be allocated and initialized already), l
* is the length in octets of the test data to be encrypted, and t is
* the number of trials
diff --git a/thirdparties/mac/include/srtp/crypto.h b/thirdparties/mac/include/srtp/crypto.h
index ab6f6be..5d60934 100755
--- a/thirdparties/mac/include/srtp/crypto.h
+++ b/thirdparties/mac/include/srtp/crypto.h
@@ -2,32 +2,32 @@
* crypto.h
*
* API for libcrypto
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CRYPTO_H
#define CRYPTO_H
-/**
+/**
* @brief A cipher_type_id_t is an identifier for a particular cipher
* type.
*
@@ -55,10 +55,10 @@
* NULL_CIPHER is avaliable; this cipher leaves the data unchanged,
* and can be selected to indicate that no encryption is to take
* place.
- *
+ *
* @ingroup Ciphers
*/
-typedef uint32_t cipher_type_id_t;
+typedef uint32_t cipher_type_id_t;
/**
* @brief An auth_type_id_t is an identifier for a particular authentication
@@ -69,7 +69,7 @@ typedef uint32_t cipher_type_id_t;
* avaliable; this authentication function performs no computation,
* and can be selected to indicate that no authentication is to take
* place.
- *
+ *
* @ingroup Authentication
*/
typedef uint32_t auth_type_id_t;
diff --git a/thirdparties/mac/include/srtp/crypto_kernel.h b/thirdparties/mac/include/srtp/crypto_kernel.h
index caccfa0..9e2c5f7 100755
--- a/thirdparties/mac/include/srtp/crypto_kernel.h
+++ b/thirdparties/mac/include/srtp/crypto_kernel.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,9 +46,9 @@
#ifndef CRYPTO_KERNEL
#define CRYPTO_KERNEL
-#include "rand_source.h"
+#include "rand_source.h"
#include "prng.h"
-#include "cipher.h"
+#include "cipher.h"
#include "auth.h"
#include "cryptoalg.h"
#include "stat.h"
@@ -65,37 +65,37 @@
*/
typedef enum {
- crypto_kernel_state_insecure,
- crypto_kernel_state_secure
+ crypto_kernel_state_insecure,
+ crypto_kernel_state_secure
} crypto_kernel_state_t;
-/*
- * linked list of cipher types
+/*
+ * linked list of cipher types
*/
typedef struct kernel_cipher_type {
- cipher_type_id_t id;
- cipher_type_t *cipher_type;
- struct kernel_cipher_type *next;
+ cipher_type_id_t id;
+ cipher_type_t *cipher_type;
+ struct kernel_cipher_type *next;
} kernel_cipher_type_t;
-/*
- * linked list of auth types
+/*
+ * linked list of auth types
*/
typedef struct kernel_auth_type {
- auth_type_id_t id;
- auth_type_t *auth_type;
- struct kernel_auth_type *next;
+ auth_type_id_t id;
+ auth_type_t *auth_type;
+ struct kernel_auth_type *next;
} kernel_auth_type_t;
/*
- * linked list of debug modules
+ * linked list of debug modules
*/
typedef struct kernel_debug_module {
- debug_module_t *mod;
- struct kernel_debug_module *next;
+ debug_module_t *mod;
+ struct kernel_debug_module *next;
} kernel_debug_module_t;
@@ -107,10 +107,10 @@ typedef struct kernel_debug_module {
*/
typedef struct {
- crypto_kernel_state_t state; /* current state of kernel */
- kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
- kernel_auth_type_t *auth_type_list; /* list of all auth func types */
- kernel_debug_module_t *debug_module_list; /* list of all debug modules */
+ crypto_kernel_state_t state; /* current state of kernel */
+ kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
+ kernel_auth_type_t *auth_type_list; /* list of all auth func types */
+ kernel_debug_module_t *debug_module_list; /* list of all debug modules */
} crypto_kernel_t;
@@ -125,10 +125,10 @@ typedef struct {
* crypto algorithms. Possible return values are:
*
* err_status_ok initialization successful
- * <other> init failure
+ * <other> init failure
*
* If any value other than err_status_ok is returned, the
- * crypto_kernel MUST NOT be used.
+ * crypto_kernel MUST NOT be used.
*/
err_status_t
@@ -142,7 +142,7 @@ crypto_kernel_init(void);
* values are:
*
* err_status_ok shutdown successful
- * <other> shutdown failure
+ * <other> shutdown failure
*
*/
@@ -155,7 +155,7 @@ crypto_kernel_shutdown(void);
* status report. Possible return values are:
*
* err_status_ok all tests were passed
- * <other> a test failed
+ * <other> a test failed
*
*/
@@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id);
/*
* crypto_kernel_replace_cipher_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the cipher_type id
* with a new one passed in externally. The new cipher must pass all the
* existing cipher_type's self tests as well as its own.
@@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id);
/*
* crypto_kernel_replace_auth_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the auth_type id
* with a new one passed in externally. The new auth type must pass all the
* existing auth_type's self tests as well as its own.
@@ -208,44 +208,44 @@ err_status_t
crypto_kernel_load_debug_module(debug_module_t *new_dm);
/*
- * crypto_kernel_alloc_cipher(id, cp, key_len);
+ * crypto_kernel_alloc_cipher(id, cp, key_len);
*
* allocates a cipher of type id at location *cp, with key length
* key_len octets. Return values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find cipher with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_cipher(cipher_type_id_t id,
- cipher_pointer_t *cp,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_cipher(cipher_type_id_t id,
+ cipher_pointer_t *cp,
+ int key_len,
+ int tag_len);
/*
- * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
+ * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
*
* allocates an auth function of type id at location *ap, with key
* length key_len octets and output tag length of tag_len. Return
* values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find auth with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_auth(auth_type_id_t id,
- auth_pointer_t *ap,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_auth(auth_type_id_t id,
+ auth_pointer_t *ap,
+ int key_len,
+ int tag_len);
/*
* crypto_kernel_set_debug_module(mod_name, v)
- *
+ *
* sets dynamic debugging to the value v (0 for off, 1 for on) for the
* debug module with the name mod_name
*
@@ -262,7 +262,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
- *
+ *
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
@@ -277,5 +277,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);
-
+
#endif /* CRYPTO_KERNEL */
diff --git a/thirdparties/mac/include/srtp/crypto_math.h b/thirdparties/mac/include/srtp/crypto_math.h
index 52f0837..4de3912 100755
--- a/thirdparties/mac/include/srtp/crypto_math.h
+++ b/thirdparties/mac/include/srtp/crypto_math.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ hex_string_to_v64(char *s);
/* the matrix A[] is stored in column format, i.e., A[i] is
the ith column of the matrix */
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
void
@@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
-/*
+/*
* the matrix A[] is stored in column format, i.e., A[i] is the ith
* column of the matrix
*/
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
@@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-
-#endif /* WORDS_BIGENDIAN */
+
+#endif /* WORDS_BIGENDIAN */
#endif
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
@@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -202,7 +202,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -211,10 +211,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
diff --git a/thirdparties/mac/include/srtp/crypto_types.h b/thirdparties/mac/include/srtp/crypto_types.h
index dbb50c3..0699862 100755
--- a/thirdparties/mac/include/srtp/crypto_types.h
+++ b/thirdparties/mac/include/srtp/crypto_types.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,14 +57,14 @@
* (UST) must be used in conjunction with a cipher other than the null
* cipher. These functions require a per-message pseudorandom input
* that is generated by the cipher.
- *
+ *
* The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the
* strongest available authentication function and cipher,
* respectively. They are resolved at compile time to the strongest
* available algorithm. The stronghold algorithms can serve as did
* the keep of a medieval fortification; they provide the strongest
* defense (or the last refuge).
- *
+ *
* @{
*/
@@ -72,7 +72,7 @@
* @defgroup Ciphers Cipher Types
*
* @brief Each cipher type is identified by an unsigned integer. The
- * cipher types available in this edition of libSRTP are given
+ * cipher types available in this edition of libSRTP are given
* by the #defines below.
*
* A cipher_type_id_t is an identifier for a cipher_type; only values
@@ -90,84 +90,84 @@
/**
* @brief The null cipher performs no encryption.
*
- * The NULL_CIPHER leaves its inputs unaltered, during both the
+ * The NULL_CIPHER leaves its inputs unaltered, during both the
* encryption and decryption operations. This cipher can be chosen
* to indicate that no encryption is to be performed.
*/
-#define NULL_CIPHER 0
+#define NULL_CIPHER 0
-/**
- * @brief AES Integer Counter Mode (AES ICM)
+/**
+ * @brief AES Integer Counter Mode (AES ICM)
*
- * AES ICM is the variant of counter mode that is used by Secure RTP.
+ * AES ICM is the variant of counter mode that is used by Secure RTP.
* This cipher uses a 16-, 24-, or 32-octet key concatenated with a
* 14-octet offset (or salt) value.
*/
-#define AES_ICM 1
+#define AES_ICM 1
-/**
- * @brief AES-128 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-128 Integer Counter Mode (AES ICM)
* AES-128 ICM is a deprecated alternate name for AES ICM.
*/
#define AES_128_ICM AES_ICM
/**
- * @brief SEAL 3.0
- *
+ * @brief SEAL 3.0
+ *
* SEAL is the Software-Optimized Encryption Algorithm of Coppersmith
* and Rogaway. Nota bene: this cipher is IBM proprietary.
*/
-#define SEAL 2
+#define SEAL 2
-/**
- * @brief AES Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES Cipher Block Chaining mode (AES CBC)
*
* AES CBC is the AES Cipher Block Chaining mode.
* This cipher uses a 16-, 24-, or 32-octet key.
*/
-#define AES_CBC 3
+#define AES_CBC 3
-/**
- * @brief AES-128 Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES-128 Cipher Block Chaining mode (AES CBC)
*
* AES-128 CBC is a deprecated alternate name for AES CBC.
*/
-#define AES_128_CBC AES_CBC
+#define AES_128_CBC AES_CBC
/**
* @brief Strongest available cipher.
*
* This identifier resolves to the strongest cipher type available.
*/
-#define STRONGHOLD_CIPHER AES_ICM
+#define STRONGHOLD_CIPHER AES_ICM
-/**
- * @brief AES-192 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-192 Integer Counter Mode (AES ICM)
* AES-192 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_192_ICM 4
+#define AES_192_ICM 4
-/**
- * @brief AES-256 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-256 Integer Counter Mode (AES ICM)
* AES-256 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_256_ICM 5
+#define AES_256_ICM 5
-/**
- * @brief AES-128_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-128_GCM Galois Counter Mode (AES GCM)
*
- * AES-128 GCM is the variant of galois counter mode that is used by
+ * AES-128 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 16-octet key.
*/
-#define AES_128_GCM 6
+#define AES_128_GCM 6
-/**
- * @brief AES-256_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-256_GCM Galois Counter Mode (AES GCM)
*
- * AES-256 GCM is the variant of galois counter mode that is used by
+ * AES-256 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 32-octet key.
*/
-#define AES_256_GCM 7
+#define AES_256_GCM 7
/**
* @}
@@ -177,14 +177,14 @@
/**
* @defgroup Authentication Authentication Function Types
- *
+ *
* @brief Each authentication function type is identified by an
* unsigned integer. The authentication function types available in
* this edition of libSRTP are given by the #defines below.
*
* An auth_type_id_t is an identifier for an authentication function type;
- * only values given by the #defines above (or those present in the
- * file crypto_types.h) should be used.
+ * only values given by the #defines above (or those present in the
+ * file crypto_types.h) should be used.
*
* The identifier STRONGHOLD_AUTH indicates the strongest available
* authentication function, allowing an application to choose the
@@ -201,8 +201,8 @@
*
* The NULL_AUTH function does nothing, and can be selected to indicate
* that authentication should not be performed.
- */
-#define NULL_AUTH 0
+ */
+#define NULL_AUTH 0
/**
* @brief UST with TMMH Version 2
@@ -212,15 +212,15 @@
* than the null cipher.
* with a cipher.
*/
-#define UST_TMMHv2 1
+#define UST_TMMHv2 1
/**
- * @brief (UST) AES-128 XORMAC
+ * @brief (UST) AES-128 XORMAC
*
* UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene:
* the XORMAC algorithm is IBM proprietary.
*/
-#define UST_AES_128_XMAC 2
+#define UST_AES_128_XMAC 2
/**
* @brief HMAC-SHA1
@@ -228,7 +228,7 @@
* HMAC_SHA1 implements the Hash-based MAC using the NIST Secure
* Hash Algorithm version 1 (SHA1).
*/
-#define HMAC_SHA1 3
+#define HMAC_SHA1 3
/**
* @brief Strongest available authentication function.
@@ -236,7 +236,7 @@
* This identifier resolves to the strongest available authentication
* function.
*/
-#define STRONGHOLD_AUTH HMAC_SHA1
+#define STRONGHOLD_AUTH HMAC_SHA1
/**
* @}
diff --git a/thirdparties/mac/include/srtp/cryptoalg.h b/thirdparties/mac/include/srtp/cryptoalg.h
index d9f0441..ad29fa0 100755
--- a/thirdparties/mac/include/srtp/cryptoalg.h
+++ b/thirdparties/mac/include/srtp/cryptoalg.h
@@ -2,31 +2,31 @@
* cryptoalg.h
*
* API for authenticated encryption crypto algorithms
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -61,10 +61,10 @@
* The function pointer cryptoalg_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated but not encrypted
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated but not encrypted
*
* @param clear_len length of data to be authenticated but not encrypted
*
@@ -79,34 +79,34 @@
* length of the ciphertext (after the call)
*
*/
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- const void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len);
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ const void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- const void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ const void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
@@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t;
int
cryptoalg_get_id(cryptoalg_t c);
-cryptoalg_t
+cryptoalg_t
cryptoalg_find_by_id(int id);
diff --git a/thirdparties/mac/include/srtp/datatypes.h b/thirdparties/mac/include/srtp/datatypes.h
index b18435f..b29a0f0 100755
--- a/thirdparties/mac/include/srtp/datatypes.h
+++ b/thirdparties/mac/include/srtp/datatypes.h
@@ -1,6 +1,6 @@
/*
* datatypes.h
- *
+ *
* data types for bit vectors and finite fields
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -65,31 +65,31 @@
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
-#define DATATYPES_USE_MACROS
+#define DATATYPES_USE_MACROS
typedef union {
- uint8_t v8[2];
- uint16_t value;
+ uint8_t v8[2];
+ uint16_t value;
} v16_t;
typedef union {
- uint8_t v8[4];
- uint16_t v16[2];
- uint32_t value;
+ uint8_t v8[4];
+ uint16_t v16[2];
+ uint32_t value;
} v32_t;
typedef union {
- uint8_t v8[8];
- uint16_t v16[4];
- uint32_t v32[2];
- uint64_t value;
+ uint8_t v8[8];
+ uint16_t v16[4];
+ uint32_t v32[2];
+ uint64_t value;
} v64_t;
typedef union {
- uint8_t v8[16];
- uint16_t v16[8];
- uint32_t v32[4];
- uint64_t v64[2];
+ uint8_t v8[16];
+ uint16_t v16[8];
+ uint32_t v32[4];
+ uint64_t v64[2];
} v128_t;
typedef union {
@@ -168,7 +168,7 @@ v128_right_shift(v128_t *x, int shift_index);
/*
* the following macros define the data manipulation functions
- *
+ *
* If DATATYPES_USE_MACROS is defined, then these macros are used
* directly (and function call overhead is avoided). Otherwise,
* the macros are used through the functions defined in datatypes.c
@@ -315,18 +315,18 @@ v128_right_shift(v128_t *x, int shift_index);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* 0 */
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -352,7 +352,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -361,10 +361,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
@@ -383,9 +383,9 @@ void
octet_string_set_to_zero(uint8_t *s, int len);
-#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H)
+#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H)
-/*
+/*
* Convert big endian integers to CPU byte order.
*/
#ifdef WORDS_BIGENDIAN
@@ -401,10 +401,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
-static inline uint32_t be32_to_cpu(uint32_t v) {
- /* optimized for x86. */
- asm("bswap %0" : "=r" (v) : "0" (v));
- return v;
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ /* optimized for x86. */
+ asm("bswap %0" : "=r" (v) : "0" (v));
+ return v;
}
# else /* HAVE_X86 */
# ifdef HAVE_NETINET_IN_H
@@ -415,15 +416,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) {
# define be32_to_cpu(x) ntohl((x))
# endif /* HAVE_X86 */
-static inline uint64_t be64_to_cpu(uint64_t v) {
+static inline uint64_t be64_to_cpu(uint64_t v)
+{
# ifdef NO_64BIT_MATH
- /* use the make64 functions to do 64-bit math */
- v = make64(htonl(low32(v)),htonl(high32(v)));
+ /* use the make64 functions to do 64-bit math */
+ v = make64(htonl(low32(v)),htonl(high32(v)));
# else
- /* use the native 64-bit math */
- v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
+ /* use the native 64-bit math */
+ v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
# endif
- return v;
+ return v;
}
#endif /* ! SRTP_KERNEL_LINUX */
@@ -431,22 +433,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) {
#endif /* WORDS_BIGENDIAN */
/*
- * functions manipulating bitvector_t
+ * functions manipulating bitvector_t
*
* A bitvector_t consists of an array of words and an integer
* representing the number of significant bits stored in the array.
* The bits are packed as follows: the least significant bit is that
* of word[0], while the most significant bit is the nth most
* significant bit of word[m], where length = bits_per_word * m + n.
- *
+ *
*/
#define bits_per_word 32
#define bytes_per_word 4
typedef struct {
- uint32_t length;
- uint32_t *word;
+ uint32_t length;
+ uint32_t *word;
} bitvector_t;
diff --git a/thirdparties/mac/include/srtp/ekt.h b/thirdparties/mac/include/srtp/ekt.h
index b0d888b..d7f9854 100755
--- a/thirdparties/mac/include/srtp/ekt.h
+++ b/thirdparties/mac/include/srtp/ekt.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2005 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,12 +45,12 @@
/*
- * EKT implementation strategy
- *
+ * EKT implementation strategy
+ *
* use stream_template approach
*
* in srtp_unprotect, when a new stream appears, check if template has
- * EKT defined, and if it does, then apply EKT processing
+ * EKT defined, and if it does, then apply EKT processing
*
* question: will we want to allow key-sharing templates in addition
* to EKT templates? could define a new ssrc_type_t that's associated
@@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt);
*/
typedef struct ekt_policy_ctx_t {
- ekt_spi_t spi; /* security parameter index */
- uint8_t ekt_cipher_type;
- uint8_t *ekt_key;
- struct ekt_policy_ctx_t *next_ekt_policy;
+ ekt_spi_t spi; /* security parameter index */
+ uint8_t ekt_cipher_type;
+ uint8_t *ekt_key;
+ struct ekt_policy_ctx_t *next_ekt_policy;
} ekt_policy_ctx_t;
@@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t {
*/
typedef struct ekt_data_t {
- ekt_spi_t spi;
- uint8_t ekt_cipher_type;
- aes_expanded_key_t ekt_enc_key;
- aes_expanded_key_t ekt_dec_key;
- struct ekt_data_t *next_ekt_data;
+ ekt_spi_t spi;
+ uint8_t ekt_cipher_type;
+ aes_expanded_key_t ekt_enc_key;
+ aes_expanded_key_t ekt_dec_key;
+ struct ekt_data_t *next_ekt_data;
} ekt_data_t;
/*
@@ -116,39 +116,39 @@ typedef struct ekt_data_t {
*/
typedef struct ekt_stream_ctx_t {
- ekt_data_t *data;
- uint16_t isn; /* initial sequence number */
- uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
+ ekt_data_t *data;
+ uint16_t isn; /* initial sequence number */
+ uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
} ekt_stream_ctx_t;
-err_status_t
+err_status_t
ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy);
err_status_t
-ekt_stream_init(ekt_stream_t e,
- ekt_spi_t spi,
- void *ekt_key,
- unsigned ekt_cipher_type);
+ekt_stream_init(ekt_stream_t e,
+ ekt_spi_t spi,
+ void *ekt_key,
+ unsigned ekt_cipher_type);
err_status_t
ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p);
-
+
err_status_t
-srtp_stream_init_from_ekt(srtp_stream_t stream,
- const void *srtcp_hdr,
- unsigned pkt_octet_len);
-
+srtp_stream_init_from_ekt(srtp_stream_t stream,
+ const void *srtcp_hdr,
+ unsigned pkt_octet_len);
+
void
ekt_write_data(ekt_stream_t ekt,
- uint8_t *base_tag,
- unsigned base_tag_len,
- int *packet_len,
- xtd_seq_num_t pkt_index);
+ uint8_t *base_tag,
+ unsigned base_tag_len,
+ int *packet_len,
+ xtd_seq_num_t pkt_index);
/*
* We handle EKT by performing some additional steps before
@@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt,
*/
err_status_t
-ekt_tag_verification_preproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ekt_tag_verification_preproces(uint8_t *pkt_tag,
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
err_status_t
ekt_tag_verification_postproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
/*
@@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag,
* Master Key, the SRTP ROC, the Initial Sequence Number, and SPI
* fields. The Base Authentication Tag field is set to the all-zero
* value
- *
+ *
* When EKT is not used, this function is a no-op.
- *
+ *
*/
err_status_t
srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s,
- uint8_t *pkt_tag,
- unsigned pkt_octet_len);
+ uint8_t *pkt_tag,
+ unsigned pkt_octet_len);
/* it's not clear that a tag_generation_postprocess function is needed */
diff --git a/thirdparties/mac/include/srtp/err.h b/thirdparties/mac/include/srtp/err.h
index 4f401a6..bf8f87a 100755
--- a/thirdparties/mac/include/srtp/err.h
+++ b/thirdparties/mac/include/srtp/err.h
@@ -1,32 +1,32 @@
/*
* err.h
- *
+ *
* error status codes
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
/**
* @defgroup Error Error Codes
- *
+ *
* Error status codes are represented by the enumeration err_status_t.
- *
+ *
* @{
*/
@@ -67,31 +67,31 @@
*
*/
typedef enum {
- err_status_ok = 0, /**< nothing to report */
- err_status_fail = 1, /**< unspecified failure */
- err_status_bad_param = 2, /**< unsupported parameter */
- err_status_alloc_fail = 3, /**< couldn't allocate memory */
- err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
- err_status_init_fail = 5, /**< couldn't initialize */
- err_status_terminus = 6, /**< can't process as much data as requested */
- err_status_auth_fail = 7, /**< authentication failure */
- err_status_cipher_fail = 8, /**< cipher failure */
- err_status_replay_fail = 9, /**< replay check failed (bad index) */
- err_status_replay_old = 10, /**< replay check failed (index too old) */
- err_status_algo_fail = 11, /**< algorithm failed test routine */
- err_status_no_such_op = 12, /**< unsupported operation */
- err_status_no_ctx = 13, /**< no appropriate context found */
- err_status_cant_check = 14, /**< unable to perform desired validation */
- err_status_key_expired = 15, /**< can't use key any more */
- err_status_socket_err = 16, /**< error in use of socket */
- err_status_signal_err = 17, /**< error in use POSIX signals */
- err_status_nonce_bad = 18, /**< nonce check failed */
- err_status_read_fail = 19, /**< couldn't read data */
- err_status_write_fail = 20, /**< couldn't write data */
- err_status_parse_err = 21, /**< error parsing data */
- err_status_encode_err = 22, /**< error encoding data */
- err_status_semaphore_err = 23,/**< error while using semaphores */
- err_status_pfkey_err = 24 /**< error while using pfkey */
+ err_status_ok = 0, /**< nothing to report */
+ err_status_fail = 1, /**< unspecified failure */
+ err_status_bad_param = 2, /**< unsupported parameter */
+ err_status_alloc_fail = 3, /**< couldn't allocate memory */
+ err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
+ err_status_init_fail = 5, /**< couldn't initialize */
+ err_status_terminus = 6, /**< can't process as much data as requested */
+ err_status_auth_fail = 7, /**< authentication failure */
+ err_status_cipher_fail = 8, /**< cipher failure */
+ err_status_replay_fail = 9, /**< replay check failed (bad index) */
+ err_status_replay_old = 10, /**< replay check failed (index too old) */
+ err_status_algo_fail = 11, /**< algorithm failed test routine */
+ err_status_no_such_op = 12, /**< unsupported operation */
+ err_status_no_ctx = 13, /**< no appropriate context found */
+ err_status_cant_check = 14, /**< unable to perform desired validation */
+ err_status_key_expired = 15, /**< can't use key any more */
+ err_status_socket_err = 16, /**< error in use of socket */
+ err_status_signal_err = 17, /**< error in use POSIX signals */
+ err_status_nonce_bad = 18, /**< nonce check failed */
+ err_status_read_fail = 19, /**< couldn't read data */
+ err_status_write_fail = 20, /**< couldn't write data */
+ err_status_parse_err = 21, /**< error parsing data */
+ err_status_encode_err = 22, /**< error encoding data */
+ err_status_semaphore_err = 23,/**< error while using semaphores */
+ err_status_pfkey_err = 24 /**< error while using pfkey */
} err_status_t;
/**
@@ -99,15 +99,15 @@ typedef enum {
*/
typedef enum {
- err_level_emergency = 0,
- err_level_alert,
- err_level_critical,
- err_level_error,
- err_level_warning,
- err_level_notice,
- err_level_info,
- err_level_debug,
- err_level_none
+ err_level_emergency = 0,
+ err_level_alert,
+ err_level_critical,
+ err_level_error,
+ err_level_warning,
+ err_level_notice,
+ err_level_info,
+ err_level_debug,
+ err_level_none
} err_reporting_level_t;
/*
@@ -145,8 +145,8 @@ err_report(int priority, const char *format, ...);
*/
typedef struct {
- int on; /* 1 if debugging is on, 0 if it is off */
- const char *name; /* printable name for debug module */
+ int on; /* 1 if debugging is on, 0 if it is off */
+ const char *name; /* printable name for debug module */
} debug_module_t;
#ifdef ENABLE_DEBUGGING
diff --git a/thirdparties/mac/include/srtp/getopt_s.h b/thirdparties/mac/include/srtp/getopt_s.h
index 2a6ece3..d3dc33d 100755
--- a/thirdparties/mac/include/srtp/getopt_s.h
+++ b/thirdparties/mac/include/srtp/getopt_s.h
@@ -7,26 +7,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,11 +45,11 @@
#ifndef GETOPT_S_H
#define GETOPT_S_H
-/*
+/*
* getopt_s(), optarg_s, and optind_s are small, locally defined
* versions of the POSIX standard getopt() interface.
*/
-
+
int
getopt_s(int argc, char * const argv[], const char *optstring);
diff --git a/thirdparties/mac/include/srtp/gf2_8.h b/thirdparties/mac/include/srtp/gf2_8.h
index 098d37c..bbbabdf 100755
--- a/thirdparties/mac/include/srtp/gf2_8.h
+++ b/thirdparties/mac/include/srtp/gf2_8.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,13 +54,13 @@ typedef uint8_t gf2_8;
#define gf2_8_field_polynomial 0x1B
/*
- * gf2_8_shift(x) returns
+ * gf2_8_shift(x) returns
*/
/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
+ * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
+ * operation, using the field representation from AES; that is, the
+ * next gf2_8 value in the cyclic representation of that field. The
* value z should be an uint8_t.
*/
diff --git a/thirdparties/mac/include/srtp/hmac.h b/thirdparties/mac/include/srtp/hmac.h
index 875f45c..a1639bf 100755
--- a/thirdparties/mac/include/srtp/hmac.h
+++ b/thirdparties/mac/include/srtp/hmac.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,12 +50,12 @@
#include "sha1.h"
typedef struct {
- uint8_t opad[64];
- sha1_ctx_t ctx;
- sha1_ctx_t init_ctx;
+ uint8_t opad[64];
+ sha1_ctx_t ctx;
+ sha1_ctx_t init_ctx;
#ifdef OPENSSL
- int ctx_initialized;
- int init_ctx_initialized;
+ int ctx_initialized;
+ int init_ctx_initialized;
#endif
} hmac_ctx_t;
@@ -76,7 +76,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets);
err_status_t
hmac_compute(hmac_ctx_t *state, const void *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* HMAC_H */
diff --git a/thirdparties/mac/include/srtp/integers.h b/thirdparties/mac/include/srtp/integers.h
index ed77210..90cfac6 100755
--- a/thirdparties/mac/include/srtp/integers.h
+++ b/thirdparties/mac/include/srtp/integers.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -124,7 +124,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \
(((unsigned char *) (addr))[1] << 16) | \
(((unsigned char *) (addr))[2] << 8) | \
- (((unsigned char *) (addr))[3]))
+ (((unsigned char *) (addr))[3]))
#else
#define PUT_32(addr,value) \
{ \
@@ -136,7 +136,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \
(((unsigned char *) (addr))[2] << 16) | \
(((unsigned char *) (addr))[1] << 8) | \
- (((unsigned char *) (addr))[0]))
+ (((unsigned char *) (addr))[0]))
#endif // WORDS_BIGENDIAN
#else
#define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value)
diff --git a/thirdparties/mac/include/srtp/kernel_compat.h b/thirdparties/mac/include/srtp/kernel_compat.h
index 59d1898..36559f7 100755
--- a/thirdparties/mac/include/srtp/kernel_compat.h
+++ b/thirdparties/mac/include/srtp/kernel_compat.h
@@ -1,6 +1,6 @@
/*
* kernel_compat.h
- *
+ *
* Compatibility stuff for building in kernel context where standard
* C headers and library are not available.
*
@@ -8,26 +8,26 @@
* Ingate Systems AB
*/
/*
- *
+ *
* Copyright(c) 2005 Ingate Systems AB
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the author(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -70,9 +70,9 @@
static inline int rand(void)
{
- uint32_t temp;
- get_random_bytes(&temp, sizeof(temp));
- return temp % (RAND_MAX+1);
+ uint32_t temp;
+ get_random_bytes(&temp, sizeof(temp));
+ return temp % (RAND_MAX+1);
}
/* stdio/stdlib implementation. */
diff --git a/thirdparties/mac/include/srtp/key.h b/thirdparties/mac/include/srtp/key.h
index e7e0744..340547f 100755
--- a/thirdparties/mac/include/srtp/key.h
+++ b/thirdparties/mac/include/srtp/key.h
@@ -2,31 +2,31 @@
* key.h
*
* key usage limits enforcement
- *
+ *
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
typedef struct key_limit_ctx_t *key_limit_t;
typedef enum {
- key_event_normal,
- key_event_soft_limit,
- key_event_hard_limit
+ key_event_normal,
+ key_event_soft_limit,
+ key_event_hard_limit
} key_event_t;
err_status_t
@@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key);
key_event_t
key_limit_update(key_limit_t key);
-typedef enum {
- key_state_normal,
- key_state_past_soft_limit,
- key_state_expired
+typedef enum {
+ key_state_normal,
+ key_state_past_soft_limit,
+ key_state_expired
} key_state_t;
typedef struct key_limit_ctx_t {
- xtd_seq_num_t num_left;
- key_state_t state;
+ xtd_seq_num_t num_left;
+ key_state_t state;
} key_limit_ctx_t;
#endif /* KEY_H */
diff --git a/thirdparties/mac/include/srtp/null_auth.h b/thirdparties/mac/include/srtp/null_auth.h
index 44f9a4a..54c0296 100755
--- a/thirdparties/mac/include/srtp/null_auth.h
+++ b/thirdparties/mac/include/srtp/null_auth.h
@@ -7,26 +7,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#include "auth.h"
typedef struct {
- char foo;
+ char foo;
} null_auth_ctx_t;
err_status_t
@@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len);
err_status_t
null_auth_compute (null_auth_ctx_t *state, uint8_t *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* NULL_AUTH_H */
diff --git a/thirdparties/mac/include/srtp/null_cipher.h b/thirdparties/mac/include/srtp/null_cipher.h
index 39da59a..63d272d 100755
--- a/thirdparties/mac/include/srtp/null_cipher.h
+++ b/thirdparties/mac/include/srtp/null_cipher.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,7 +52,7 @@
#include "cipher.h"
typedef struct {
- char foo ;/* empty, for now */
+ char foo ;/* empty, for now */
} null_cipher_ctx_t;
@@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len);
err_status_t
null_cipher_set_segment(null_cipher_ctx_t *c,
- unsigned long segment_index);
+ unsigned long segment_index);
err_status_t
null_cipher_encrypt(null_cipher_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
null_cipher_encrypt_aligned(null_cipher_ctx_t *c,
- unsigned char *buf, int bytes_to_encr);
+ unsigned char *buf, int bytes_to_encr);
#endif /* NULL_CIPHER_H */
diff --git a/thirdparties/mac/include/srtp/prng.h b/thirdparties/mac/include/srtp/prng.h
index c5ec230..dc19994 100755
--- a/thirdparties/mac/include/srtp/prng.h
+++ b/thirdparties/mac/include/srtp/prng.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -62,10 +62,10 @@
*/
typedef struct {
- v128_t state; /* state data */
- aes_expanded_key_t key; /* secret key */
- uint32_t octet_count; /* number of octets output since last init */
- rand_source_func_t rand; /* random source for re-initialization */
+ v128_t state; /* state data */
+ aes_expanded_key_t key; /* secret key */
+ uint32_t octet_count; /* number of octets output since last init */
+ rand_source_func_t rand; /* random source for re-initialization */
} x917_prng_t;
err_status_t
@@ -80,9 +80,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
*/
typedef struct {
- uint32_t octet_count; /* number of octets output since last init */
- aes_icm_ctx_t state; /* state data */
- rand_source_func_t rand; /* random source for re-initialization */
+ uint32_t octet_count; /* number of octets output since last init */
+ aes_icm_ctx_t state; /* state data */
+ rand_source_func_t rand; /* random source for re-initialization */
} ctr_prng_t;
err_status_t
diff --git a/thirdparties/mac/include/srtp/rand_source.h b/thirdparties/mac/include/srtp/rand_source.h
index b4c2110..d2e52ce 100755
--- a/thirdparties/mac/include/srtp/rand_source.h
+++ b/thirdparties/mac/include/srtp/rand_source.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -60,7 +60,7 @@ rand_source_init(void);
* and returns an error code. This error code should be checked,
* and if a failure is reported, the data in the buffer MUST NOT
* be used.
- *
+ *
* warning: If the return code is not checked, then non-random
* data may inadvertently be used.
*
@@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length);
err_status_t
rand_source_deinit(void);
-/*
+/*
* function prototype for a random source function
*
* A rand_source_func_t writes num_octets at the location indicated by
@@ -86,6 +86,6 @@ rand_source_deinit(void);
*/
typedef err_status_t (*rand_source_func_t)
- (void *dest, uint32_t num_octets);
+(void *dest, uint32_t num_octets);
#endif /* RAND_SOURCE */
diff --git a/thirdparties/mac/include/srtp/rdb.h b/thirdparties/mac/include/srtp/rdb.h
index 300c569..ecbfa76 100755
--- a/thirdparties/mac/include/srtp/rdb.h
+++ b/thirdparties/mac/include/srtp/rdb.h
@@ -9,26 +9,26 @@
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,11 +57,11 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
} rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8*sizeof(v128_t))
/*
* rdb init
@@ -85,7 +85,7 @@ rdb_init(rdb_t *rdb);
*/
err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+rdb_check(const rdb_t *rdb, uint32_t rdb_index);
/*
* rdb_add_index
@@ -100,18 +100,18 @@ err_status_t
rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions rdb_increment() and rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
* rdb_t upon which rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
+ *
* err_status_ok no problem
* err_status_key_expired sequence number too high
*
@@ -127,4 +127,4 @@ uint32_t
rdb_get_value(const rdb_t *rdb);
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
diff --git a/thirdparties/mac/include/srtp/rdbx.h b/thirdparties/mac/include/srtp/rdbx.h
index 4b8dd22..9d612c7 100755
--- a/thirdparties/mac/include/srtp/rdbx.h
+++ b/thirdparties/mac/include/srtp/rdbx.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,7 +50,7 @@
#include "datatypes.h"
#include "err.h"
-/* #define ROC_TEST */
+/* #define ROC_TEST */
#ifndef ROC_TEST
@@ -69,7 +69,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
- * sequence number.
+ * sequence number.
*/
typedef uint64_t xtd_seq_num_t;
@@ -81,8 +81,8 @@ typedef uint64_t xtd_seq_num_t;
*/
typedef struct {
- xtd_seq_num_t index;
- bitvector_t bitmask;
+ xtd_seq_num_t index;
+ bitvector_t bitmask;
} rdbx_t;
@@ -109,7 +109,7 @@ rdbx_dealloc(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
- *
+ *
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
@@ -118,8 +118,8 @@ rdbx_dealloc(rdbx_t *rdbx);
int
rdbx_estimate_index(const rdbx_t *rdbx,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
@@ -134,7 +134,7 @@ rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
- *
+ *
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
@@ -152,7 +152,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta);
* to have the rollover counter value roc. If that value is less than
* the current rollover counter value, then the function returns
* err_status_replay_old; otherwise, err_status_ok is returned.
- *
+ *
*/
err_status_t
@@ -161,7 +161,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc);
/*
* rdbx_get_roc(rdbx) returns the value of the rollover counter for
* the rdbx_t pointed to by rdbx
- *
+ *
*/
xtd_seq_num_t
@@ -196,7 +196,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
- *
+ *
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
@@ -206,8 +206,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
int
index_guess(const xtd_seq_num_t *local,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
#endif /* RDBX_H */
diff --git a/thirdparties/mac/include/srtp/rtp.h b/thirdparties/mac/include/srtp/rtp.h
index 0e0119c..9b97ab6 100755
--- a/thirdparties/mac/include/srtp/rtp.h
+++ b/thirdparties/mac/include/srtp/rtp.h
@@ -1,6 +1,6 @@
/*
* rtp.h
- *
+ *
* rtp interface for srtp reference implementation
*
* David A. McGrew
@@ -15,26 +15,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -73,12 +73,12 @@ int
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
int
-rtp_receiver_init(rtp_receiver_t rcvr, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_receiver_init(rtp_receiver_t rcvr, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
int
-rtp_sender_init(rtp_sender_t sender, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_sender_init(rtp_sender_t sender, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
/*
* srtp_sender_init(...) initializes an rtp_sender_t
@@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
@@ -112,13 +112,13 @@ int
rtp_receiver_deinit_srtp(rtp_receiver_t sender);
-rtp_sender_t
+rtp_sender_t
rtp_sender_alloc(void);
void
rtp_sender_dealloc(rtp_sender_t rtp_ctx);
-rtp_receiver_t
+rtp_receiver_t
rtp_receiver_alloc(void);
void
@@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
*/
#define RTP_HEADER_LEN 12
-/*
+/*
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
*/
#define RTP_MAX_BUF_LEN 16384
diff --git a/thirdparties/mac/include/srtp/rtp_priv.h b/thirdparties/mac/include/srtp/rtp_priv.h
index 1421386..088cdbe 100755
--- a/thirdparties/mac/include/srtp/rtp_priv.h
+++ b/thirdparties/mac/include/srtp/rtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,22 +52,22 @@
typedef srtp_hdr_t rtp_hdr_t;
typedef struct {
- srtp_hdr_t header;
- char body[RTP_MAX_BUF_LEN];
+ srtp_hdr_t header;
+ char body[RTP_MAX_BUF_LEN];
} rtp_msg_t;
typedef struct rtp_sender_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* reciever's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* reciever's address */
} rtp_sender_ctx_t;
typedef struct rtp_receiver_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* receiver's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* receiver's address */
} rtp_receiver_ctx_t;
diff --git a/thirdparties/mac/include/srtp/sha1.h b/thirdparties/mac/include/srtp/sha1.h
index f1744ce..64637b5 100755
--- a/thirdparties/mac/include/srtp/sha1.h
+++ b/thirdparties/mac/include/srtp/sha1.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#define SHA1_H
#ifdef HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#include "err.h"
@@ -93,17 +93,17 @@ static inline void sha1_final (sha1_ctx_t *ctx, uint32_t *output)
#include "datatypes.h"
typedef struct {
- uint32_t H[5]; /* state vector */
- uint32_t M[16]; /* message buffer */
- int octets_in_buffer; /* octets of message in buffer */
- uint32_t num_bits_in_msg; /* total number of bits in message */
+ uint32_t H[5]; /* state vector */
+ uint32_t M[16]; /* message buffer */
+ int octets_in_buffer; /* octets of message in buffer */
+ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/*
* sha1(&ctx, msg, len, output) hashes the len octets starting at msg
* into the SHA1 context, then writes the result to the 20 octets at
* output
- *
+ *
*/
void
@@ -111,10 +111,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/*
* sha1_init(&ctx) initializes the SHA1 context ctx
- *
+ *
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
- *
+ *
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
@@ -132,7 +132,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
- * setup algorithm.
+ * setup algorithm.
*/
/*
@@ -148,5 +148,5 @@ void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
#endif /* else OPENSSL */
-
+
#endif /* SHA1_H */
diff --git a/thirdparties/mac/include/srtp/srtp.h b/thirdparties/mac/include/srtp/srtp.h
index 81af519..1ab10b8 100755
--- a/thirdparties/mac/include/srtp/srtp.h
+++ b/thirdparties/mac/include/srtp/srtp.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,7 +51,7 @@ extern "C" {
#endif
#include <stdint.h>
-#include "crypto.h"
+#include "crypto.h"
#include "crypto_types.h"
#include "err.h"
@@ -79,7 +79,7 @@ extern "C" {
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
-#define SRTP_MAX_TAG_LEN 16
+#define SRTP_MAX_TAG_LEN 16
/**
* SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer
@@ -89,10 +89,10 @@ extern "C" {
*
* @brief the maximum number of octets added by srtp_protect().
*/
-#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
+#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
/*
- * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
+ * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
* GCM mode. GCM mode requires an IV. The SALT value is used
* as part of the IV formation logic applied to each RTP packet.
*/
@@ -103,83 +103,84 @@ extern "C" {
-/*
+/*
* nota bene: since libSRTP doesn't support the use of the MKI, the
* SRTP_MAX_TRAILER_LEN value is just the maximum tag length
*/
/**
- * @brief sec_serv_t describes a set of security services.
+ * @brief sec_serv_t describes a set of security services.
*
* A sec_serv_t enumeration is used to describe the particular
* security services that will be applied by a particular crypto
- * policy (or other mechanism).
+ * policy (or other mechanism).
*/
typedef enum {
- sec_serv_none = 0, /**< no services */
- sec_serv_conf = 1, /**< confidentiality */
- sec_serv_auth = 2, /**< authentication */
- sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
-} sec_serv_t;
+ sec_serv_none = 0, /**< no services */
+ sec_serv_conf = 1, /**< confidentiality */
+ sec_serv_auth = 2, /**< authentication */
+ sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
+}
+sec_serv_t;
-/**
+/**
* @brief crypto_policy_t describes a particular crypto policy that
* can be applied to an SRTP stream.
*
* A crypto_policy_t describes a particular cryptographic policy that
* can be applied to an SRTP or SRTCP stream. An SRTP session policy
- * consists of a list of these policies, one for each SRTP stream
+ * consists of a list of these policies, one for each SRTP stream
* in the session.
*/
typedef struct crypto_policy_t {
- cipher_type_id_t cipher_type; /**< An integer representing
+ cipher_type_id_t cipher_type; /**< An integer representing
* the type of cipher. */
- int cipher_key_len; /**< The length of the cipher key
+ int cipher_key_len; /**< The length of the cipher key
* in octets. */
- auth_type_id_t auth_type; /**< An integer representing the
+ auth_type_id_t auth_type; /**< An integer representing the
* authentication function. */
- int auth_key_len; /**< The length of the authentication
+ int auth_key_len; /**< The length of the authentication
* function key in octets. */
- int auth_tag_len; /**< The length of the authentication
+ int auth_tag_len; /**< The length of the authentication
* tag in octets. */
- sec_serv_t sec_serv; /**< The flag indicating the security
+ sec_serv_t sec_serv; /**< The flag indicating the security
* services to be applied. */
} crypto_policy_t;
-/**
+/**
* @brief ssrc_type_t describes the type of an SSRC.
- *
+ *
* An ssrc_type_t enumeration is used to indicate a type of SSRC. See
* @ref srtp_policy_t for more informataion.
*/
-typedef enum {
- ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
- ssrc_specific = 1, /**< Indicates a specific SSRC value */
- ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
+typedef enum {
+ ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
+ ssrc_specific = 1, /**< Indicates a specific SSRC value */
+ ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
(i.e. a value that is used in the
function srtp_unprotect()) */
- ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
- (i.e. a value that is used in the
+ ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
+ (i.e. a value that is used in the
function srtp_protect()) */
} ssrc_type_t;
/**
* @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
- *
+ *
* An ssrc_t represents a particular SSRC value (if its type is
* ssrc_specific), or a wildcard SSRC value that will match all
* outbound SSRCs (if its type is ssrc_any_outbound) or all inbound
- * SSRCs (if its type is ssrc_any_inbound).
+ * SSRCs (if its type is ssrc_any_inbound).
*
*/
-typedef struct {
- ssrc_type_t type; /**< The type of this particular SSRC */
- unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
+typedef struct {
+ ssrc_type_t type; /**< The type of this particular SSRC */
+ unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
} ssrc_t;
@@ -195,8 +196,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t;
typedef struct ekt_stream_ctx_t *ekt_stream_t;
-/**
- * @brief represents the policy for an SRTP session.
+/**
+ * @brief represents the policy for an SRTP session.
*
* A single srtp_policy_t struct represents the policy for a single
* SRTP stream, and a linked list of these elements represents the
@@ -205,7 +206,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* master key for that stream, the SSRC describing that stream, or a
* flag indicating a `wildcard' SSRC value, and a `next' field that
* holds a pointer to the next element in the list of policy elements,
- * or NULL if it is the last element.
+ * or NULL if it is the last element.
*
* The wildcard value SSRC_ANY_INBOUND matches any SSRC from an
* inbound stream that for which there is no explicit SSRC entry in
@@ -216,33 +217,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* is intentional, and it allows libSRTP to ensure that no security
* lapses result from accidental re-use of SSRC values during key
* sharing.
- *
- *
+ *
+ *
* @warning The final element of the list @b must have its `next' pointer
* set to NULL.
*/
typedef struct srtp_policy_t {
- ssrc_t ssrc; /**< The SSRC value of stream, or the
- * flags SSRC_ANY_INBOUND or
+ ssrc_t ssrc; /**< The SSRC value of stream, or the
+ * flags SSRC_ANY_INBOUND or
* SSRC_ANY_OUTBOUND if key sharing
* is used for this policy element.
*/
- crypto_policy_t rtp; /**< SRTP crypto policy. */
- crypto_policy_t rtcp; /**< SRTCP crypto policy. */
- unsigned char *key; /**< Pointer to the SRTP master key for
+ crypto_policy_t rtp; /**< SRTP crypto policy. */
+ crypto_policy_t rtcp; /**< SRTCP crypto policy. */
+ unsigned char *key; /**< Pointer to the SRTP master key for
* this stream. */
- ekt_policy_t ekt; /**< Pointer to the EKT policy structure
- * for this stream (if any) */
- unsigned long window_size; /**< The window size to use for replay
+ ekt_policy_t ekt; /**< Pointer to the EKT policy structure
+ * for this stream (if any) */
+ unsigned long window_size; /**< The window size to use for replay
* protection. */
- int allow_repeat_tx; /**< Whether retransmissions of
+ int allow_repeat_tx; /**< Whether retransmissions of
* packets with the same sequence number
* are allowed. (Note that such repeated
* transmissions must have the same RTP
* payload, or a severe security weakness
* is introduced!) */
- struct srtp_policy_t *next; /**< Pointer to next stream policy. */
+ struct srtp_policy_t *next; /**< Pointer to next stream policy. */
} srtp_policy_t;
@@ -252,7 +253,7 @@ typedef struct srtp_policy_t {
* @brief An srtp_t points to an SRTP session structure.
*
* The typedef srtp_t is a pointer to a structure that represents
- * an SRTP session. This datatype is intentially opaque in
+ * an SRTP session. This datatype is intentially opaque in
* order to separate the interface from the implementation.
*
* An SRTP session consists of all of the traffic sent to the RTP and
@@ -269,11 +270,11 @@ typedef struct srtp_ctx_t *srtp_t;
*
* The typedef srtp_stream_t is a pointer to a structure that
* represents an SRTP stream. This datatype is intentionally
- * opaque in order to separate the interface from the implementation.
- *
+ * opaque in order to separate the interface from the implementation.
+ *
* An SRTP stream consists of all of the traffic sent to an SRTP
* session by a single participant. A session can be viewed as
- * a set of streams.
+ * a set of streams.
*
*/
typedef struct srtp_stream_ctx_t *srtp_stream_t;
@@ -281,7 +282,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t;
/**
- * @brief srtp_init() initializes the srtp library.
+ * @brief srtp_init() initializes the srtp library.
*
* @warning This function @b must be called before any other srtp
* functions.
@@ -302,14 +303,14 @@ srtp_shutdown(void);
/**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
- *
+ *
* The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP
* protection to the RTP packet rtp_hdr (which has length *len_ptr) using
* the SRTP context ctx. If err_status_ok is returned, then rtp_hdr
* points to the resulting SRTP packet and *len_ptr is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
- *
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
@@ -319,11 +320,11 @@ srtp_shutdown(void);
* packet, and assumes that the RTP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
- * into the location in memory immediately following the RTP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
+ * into the location in memory immediately following the RTP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtp_hdr is a pointer to the RTP packet (before the call); after
@@ -334,7 +335,7 @@ srtp_shutdown(void);
* complete SRTP packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok no problems
* - err_status_replay_fail rtp sequence number was non-increasing
* - @e other failure in cryptographic mechanisms
@@ -342,7 +343,7 @@ srtp_shutdown(void);
err_status_t
srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
-
+
/**
* @brief srtp_unprotect() is the Secure RTP receiver-side packet
* processing function.
@@ -353,12 +354,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* err_status_ok is returned, then srtp_hdr points to the resulting
* RTP packet and *len_ptr is the number of octets in that packet;
* otherwise, no assumptions should be made about the value of either
- * data elements.
- *
+ * data elements.
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
- *
+ *
* @warning This function assumes that the SRTP packet is aligned on a
* 32-bit boundary.
*
@@ -374,9 +375,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* complete rtp packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTP packet is valid.
- * - err_status_auth_fail if the SRTP packet failed the message
+ * - err_status_auth_fail if the SRTP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has
* already been processed and accepted).
@@ -397,14 +398,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
*
* @param session is a pointer to the SRTP session to which the policy is
* to be added.
- *
+ *
* @param policy is the srtp_policy_t struct that describes the policy
* for the session. The struct may be a single element, or it may be
* the head of a list, in which case each element of the list is
* processed. It may also be NULL, in which case streams should be added
* later using srtp_add_stream(). The final element of the list @b must
* have its `next' field set to NULL.
- *
+ *
* @return
* - err_status_ok if creation succeded.
* - err_status_alloc_fail if allocation failed.
@@ -418,7 +419,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
/**
* @brief srtp_add_stream() allocates and initializes an SRTP stream
* within a given SRTP session.
- *
+ *
* The function call srtp_add_stream(session, policy) allocates and
* initializes a new SRTP stream within a given, previously created
* session, applying the policy given as the other argument to that
@@ -431,13 +432,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
*/
err_status_t
-srtp_add_stream(srtp_t session,
- const srtp_policy_t *policy);
+srtp_add_stream(srtp_t session,
+ const srtp_policy_t *policy);
/**
* @brief srtp_remove_stream() deallocates an SRTP stream.
- *
+ *
* The function call srtp_remove_stream(session, ssrc) removes
* the SRTP stream with the SSRC value ssrc from the SRTP session
* context given by the argument session.
@@ -449,7 +450,7 @@ srtp_add_stream(srtp_t session,
*
* @warning Wildcard SSRC values cannot be removed from a
* session.
- *
+ *
* @return
* - err_status_ok if the stream deallocation succeded.
* - [other] otherwise.
@@ -463,8 +464,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* @brief crypto_policy_set_rtp_default() sets a crypto policy
* structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTP
* protection, as defined in the specification. This function is a
@@ -473,9 +474,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -485,8 +486,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* @brief crypto_policy_set_rtcp_default() sets a crypto policy
* structure to the SRTP default policy for RTCP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTCP
* protection, as defined in the specification. This function is a
@@ -495,9 +496,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -507,15 +508,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto
* policy structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a
* synonym for crypto_policy_set_rtp_default(). It conforms to the
* naming convention used in RFC 4568 (SDP Security Descriptions for
* Media Streams).
- *
+ *
* @return void.
- *
+ *
*/
#define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p)
@@ -525,8 +526,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto
* policy structure to a short-authentication tag policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568.
@@ -536,7 +537,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -549,7 +550,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -561,14 +562,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto
* policy structure to an encryption-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Counter Mode), but to use no authentication method. This
* policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5
* of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -580,7 +581,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -591,14 +592,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto
* policy structure to an authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80
* bit authentication tag to provide message authentication, but to
* use no encryption. This policy is NOT RECOMMENDED for SRTP unless
- * there is a requirement to forego encryption.
- *
+ * there is a requirement to forego encryption.
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -606,10 +607,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @warning This policy is NOT RECOMMENDED for SRTP unless there is a
- * requirement to forego encryption.
+ * requirement to forego encryption.
*
* @return void.
- *
+ *
*/
void
@@ -618,18 +619,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
/**
* @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto
- * policy structure to a encryption and authentication policy using AES-256
+ * policy structure to a encryption and authentication policy using AES-256
* for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_80 as defined in
* draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256
* Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit
* authentication tag.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -637,7 +638,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
@@ -648,8 +649,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* policy structure to a short-authentication tag policy using AES-256
* encryption.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_32 as defined in
@@ -659,7 +660,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -672,7 +673,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -710,14 +711,14 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -725,7 +726,7 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
@@ -734,14 +735,14 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -749,7 +750,7 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
@@ -758,14 +759,14 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -773,7 +774,7 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
@@ -782,14 +783,14 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -797,7 +798,7 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
@@ -806,14 +807,14 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_16_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -821,7 +822,7 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
@@ -830,14 +831,14 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_16_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -845,7 +846,7 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
@@ -854,7 +855,7 @@ crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
/**
* @brief srtp_dealloc() deallocates storage for an SRTP session
* context.
- *
+ *
* The function call srtp_dealloc(s) deallocates storage for the
* SRTP session context s. This function should be called no more
* than one time for each of the contexts allocated by the function
@@ -872,7 +873,7 @@ srtp_dealloc(srtp_t s);
/*
- * @brief identifies a particular SRTP profile
+ * @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters). These
@@ -880,13 +881,13 @@ srtp_dealloc(srtp_t s);
*/
typedef enum {
- srtp_profile_reserved = 0,
- srtp_profile_aes128_cm_sha1_80 = 1,
- srtp_profile_aes128_cm_sha1_32 = 2,
- srtp_profile_aes256_cm_sha1_80 = 3,
- srtp_profile_aes256_cm_sha1_32 = 4,
- srtp_profile_null_sha1_80 = 5,
- srtp_profile_null_sha1_32 = 6,
+ srtp_profile_reserved = 0,
+ srtp_profile_aes128_cm_sha1_80 = 1,
+ srtp_profile_aes128_cm_sha1_32 = 2,
+ srtp_profile_aes256_cm_sha1_80 = 3,
+ srtp_profile_aes256_cm_sha1_32 = 4,
+ srtp_profile_null_sha1_80 = 5,
+ srtp_profile_null_sha1_32 = 6,
} srtp_profile_t;
@@ -894,26 +895,26 @@ typedef enum {
* @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy
* structure to the appropriate value for RTP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
+ srtp_profile_t profile);
@@ -922,26 +923,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
* @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy
* structure to the appropriate value for RTCP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTCP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
+ srtp_profile_t profile);
/**
* @brief returns the master key length for a given SRTP profile
@@ -959,18 +960,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile);
/**
* @brief appends the salt to the key
*
- * The function call append_salt_to_key(k, klen, s, slen)
+ * The function call append_salt_to_key(k, klen, s, slen)
* copies the string s to the location at klen bytes following
- * the location k.
+ * the location k.
*
* @warning There must be at least bytes_in_salt + bytes_in_key bytes
* available at the location pointed to by key.
- *
+ *
*/
void
append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
- unsigned char *salt, unsigned int bytes_in_salt);
+ unsigned char *salt, unsigned int bytes_in_salt);
@@ -982,7 +983,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
/**
* @defgroup SRTCP Secure RTCP
- * @ingroup SRTP
+ * @ingroup SRTP
*
* @brief Secure RTCP functions are used to protect RTCP traffic.
*
@@ -990,36 +991,36 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* traffic in much the same way as it does RTP traffic. The function
* srtp_protect_rtcp() applies cryptographic protections to outbound
* RTCP packets, and srtp_unprotect_rtcp() verifies the protections on
- * inbound RTCP packets.
+ * inbound RTCP packets.
*
* A note on the naming convention: srtp_protect_rtcp() has an srtp_t
* as its first argument, and thus has `srtp_' as its prefix. The
- * trailing `_rtcp' indicates the protocol on which it acts.
- *
+ * trailing `_rtcp' indicates the protocol on which it acts.
+ *
* @{
*/
/**
* @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet
* processing function.
- *
+ *
* The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies
* SRTCP protection to the RTCP packet rtcp_hdr (which has length
* *len_ptr) using the SRTP session context ctx. If err_status_ok is
* returned, then rtp_hdr points to the resulting SRTCP packet and
* *len_ptr is the number of octets in that packet; otherwise, no
* assumptions should be made about the value of either data elements.
- *
+ *
* @warning This function assumes that it can write the authentication
* tag into the location in memory immediately following the RTCP
* packet, and assumes that the RTCP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
- * into the location in memory immediately following the RTCP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
+ * into the location in memory immediately following the RTCP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTCP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtcp_hdr is a pointer to the RTCP packet (before the call); after
@@ -1031,14 +1032,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* was returned. Otherwise, the value of the data to which it points
* is undefined.
*
- * @return
+ * @return
* - err_status_ok if there were no problems.
- * - [other] if there was a failure in
+ * - [other] if there was a failure in
* the cryptographic mechanisms.
*/
-
-err_status_t
+
+err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
/**
@@ -1052,7 +1053,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* to the resulting RTCP packet and *len_ptr is the number of octets
* in that packet; otherwise, no assumptions should be made about the
* value of either data elements.
- *
+ *
* @warning This function assumes that the SRTCP packet is aligned on a
* 32-bit boundary.
*
@@ -1070,9 +1071,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* returned. Otherwise, the value of the data to which it points is
* undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTCP packet is valid.
- * - err_status_auth_fail if the SRTCP packet failed the message
+ * - err_status_auth_fail if the SRTCP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTCP packet is a replay (e.g. has
* already been processed and accepted).
@@ -1080,7 +1081,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
*
*/
-err_status_t
+err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
/**
@@ -1142,10 +1143,10 @@ srtp_get_user_data(srtp_t ctx);
* @defgroup SRTPevents SRTP events and callbacks
* @ingroup SRTP
*
- * @brief libSRTP can use a user-provided callback function to
+ * @brief libSRTP can use a user-provided callback function to
* handle events.
*
- *
+ *
* libSRTP allows a user to provide a callback function to handle
* events that need to be dealt with outside of the data plane (see
* the enum srtp_event_t for a description of these events). Dealing
@@ -1166,8 +1167,8 @@ srtp_get_user_data(srtp_t ctx);
* @brief srtp_event_t defines events that need to be handled
*
* The enum srtp_event_t defines events that need to be handled
- * outside the `data plane', such as SSRC collisions and
- * key expirations.
+ * outside the `data plane', such as SSRC collisions and
+ * key expirations.
*
* When a key expires or the maximum number of packets has been
* reached, an SRTP stream will enter an `expired' state in which no
@@ -1180,33 +1181,33 @@ srtp_get_user_data(srtp_t ctx);
* latter case, all of the streams in the session will expire.
*/
-typedef enum {
- event_ssrc_collision, /**<
- * An SSRC collision occured.
+typedef enum {
+ event_ssrc_collision, /**<
+ * An SSRC collision occured.
*/
- event_key_soft_limit, /**< An SRTP stream reached the soft key
- * usage limit and will expire soon.
+ event_key_soft_limit, /**< An SRTP stream reached the soft key
+ * usage limit and will expire soon.
*/
- event_key_hard_limit, /**< An SRTP stream reached the hard
+ event_key_hard_limit, /**< An SRTP stream reached the hard
* key usage limit and has expired.
*/
- event_packet_index_limit /**< An SRTP stream reached the hard
- * packet limit (2^48 packets).
+ event_packet_index_limit /**< An SRTP stream reached the hard
+ * packet limit (2^48 packets).
*/
} srtp_event_t;
/**
- * @brief srtp_event_data_t is the structure passed as a callback to
+ * @brief srtp_event_data_t is the structure passed as a callback to
* the event handler function
*
* The struct srtp_event_data_t holds the data passed to the event
- * handler function.
+ * handler function.
*/
typedef struct srtp_event_data_t {
- srtp_t session; /**< The session in which the event happend. */
- srtp_stream_t stream; /**< The stream in which the event happend. */
- srtp_event_t event; /**< An enum indicating the type of event. */
+ srtp_t session; /**< The session in which the event happend. */
+ srtp_stream_t stream; /**< The stream in which the event happend. */
+ srtp_event_t event; /**< An enum indicating the type of event. */
} srtp_event_data_t;
/**
@@ -1224,7 +1225,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data);
/**
* @brief sets the event handler to the function supplied by the caller.
- *
+ *
* The function call srtp_install_event_handler(func) sets the event
* handler function to the value func. The value NULL is acceptable
* as an argument; in this case, events will be ignored rather than
@@ -1239,14 +1240,14 @@ err_status_t
srtp_install_event_handler(srtp_event_handler_func_t func);
/**
- * @brief Returns the version string of the library.
- *
+ * @brief Returns the version string of the library.
+ *
*/
const char *srtp_get_version_string(void);
/**
- * @brief Returns the numeric representation of the library version.
- *
+ * @brief Returns the numeric representation of the library version.
+ *
*/
unsigned int srtp_get_version(void);
diff --git a/thirdparties/mac/include/srtp/srtp_priv.h b/thirdparties/mac/include/srtp/srtp_priv.h
index 170df5b..f925c1f 100755
--- a/thirdparties/mac/include/srtp/srtp_priv.h
+++ b/thirdparties/mac/include/srtp/srtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -64,56 +64,56 @@
* an srtp_hdr_t represents the srtp header
*
* in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
- *
+ *
* (note that this definition follows that of RFC 1889 Appendix A, but
* is not identical)
*/
-
+
#ifndef WORDS_BIGENDIAN
/*
* srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
- * this structure should be declared "unsigned int" instead of
+ * this structure should be declared "unsigned int" instead of
* "unsigned char", but doing so causes the MS compiler to not
* fully pack the bit fields.
*/
typedef struct {
- unsigned char cc:4; /* CSRC count */
- unsigned char x:1; /* header extension flag */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:7; /* payload type */
- unsigned char m:1; /* marker bit */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char x:1; /* header extension flag */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:7; /* payload type */
+ unsigned char m:1; /* marker bit */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char x:1; /* header extension flag */
- unsigned char cc:4; /* CSRC count */
- unsigned char m:1; /* marker bit */
- unsigned char pt:7; /* payload type */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char x:1; /* header extension flag */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char m:1; /* marker bit */
+ unsigned char pt:7; /* payload type */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#endif
typedef struct {
- uint16_t profile_specific; /* profile-specific info */
- uint16_t length; /* number of 32-bit words in extension */
+ uint16_t profile_specific; /* profile-specific info */
+ uint16_t length; /* number of 32-bit words in extension */
} srtp_hdr_xtnd_t;
/*
- * srtcp_hdr_t represents a secure rtcp header
+ * srtcp_hdr_t represents a secure rtcp header
*
* in this implementation, an srtcp header is assumed to be 32-bit
* alinged
@@ -122,53 +122,53 @@ typedef struct {
#ifndef WORDS_BIGENDIAN
typedef struct {
- unsigned char rc:5; /* reception report count */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char rc:5; /* reception report count */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int index:31; /* srtcp packet index in network order! */
- unsigned int e:1; /* encrypted? 1=yes */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int index:31; /* srtcp packet index in network order! */
+ unsigned int e:1; /* encrypted? 1=yes */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char rc:5; /* reception report count */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char rc:5; /* reception report count */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int version:2; /* protocol version */
- unsigned int p:1; /* padding flag */
- unsigned int count:5; /* varies by packet type */
- unsigned int pt:8; /* payload type */
- uint16_t length; /* len of uint32s of packet less header */
+ unsigned int version:2; /* protocol version */
+ unsigned int p:1; /* padding flag */
+ unsigned int count:5; /* varies by packet type */
+ unsigned int pt:8; /* payload type */
+ uint16_t length; /* len of uint32s of packet less header */
} rtcp_common_t;
typedef struct {
- unsigned int e:1; /* encrypted? 1=yes */
- unsigned int index:31; /* srtcp packet index */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int e:1; /* encrypted? 1=yes */
+ unsigned int index:31; /* srtcp packet index */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#endif
/*
- * the following declarations are libSRTP internal functions
+ * the following declarations are libSRTP internal functions
*/
/*
@@ -176,7 +176,7 @@ typedef struct {
* to ssrc, or NULL if no stream exists for that ssrc
*/
-srtp_stream_t
+srtp_stream_t
srtp_get_stream(srtp_t srtp, uint32_t ssrc);
@@ -190,49 +190,49 @@ err_status_t
srtp_stream_init_keys(srtp_stream_t srtp, const void *key);
/*
- * srtp_stream_init(s, p) initializes the srtp_stream_t s to
+ * srtp_stream_init(s, p) initializes the srtp_stream_t s to
* use the policy at the location p
*/
err_status_t
-srtp_stream_init(srtp_stream_t srtp,
- const srtp_policy_t *p);
+srtp_stream_init(srtp_stream_t srtp,
+ const srtp_policy_t *p);
/*
- * libsrtp internal datatypes
+ * libsrtp internal datatypes
*/
-typedef enum direction_t {
- dir_unknown = 0,
- dir_srtp_sender = 1,
- dir_srtp_receiver = 2
+typedef enum direction_t {
+ dir_unknown = 0,
+ dir_srtp_sender = 1,
+ dir_srtp_receiver = 2
} direction_t;
-/*
+/*
* an srtp_stream_t has its own SSRC, encryption key, authentication
* key, sequence number, and replay database
- *
+ *
* note that the keys might not actually be unique, in which case the
* cipher_t and auth_t pointers will point to the same structures
*/
typedef struct srtp_stream_ctx_t {
- uint32_t ssrc;
- cipher_t *rtp_cipher;
- auth_t *rtp_auth;
- rdbx_t rtp_rdbx;
- sec_serv_t rtp_services;
- cipher_t *rtcp_cipher;
- auth_t *rtcp_auth;
- rdb_t rtcp_rdb;
- sec_serv_t rtcp_services;
- key_limit_ctx_t *limit;
- direction_t direction;
- int allow_repeat_tx;
- ekt_stream_t ekt;
- uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */
- uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */
- struct srtp_stream_ctx_t *next; /* linked list of streams */
+ uint32_t ssrc;
+ cipher_t *rtp_cipher;
+ auth_t *rtp_auth;
+ rdbx_t rtp_rdbx;
+ sec_serv_t rtp_services;
+ cipher_t *rtcp_cipher;
+ auth_t *rtcp_auth;
+ rdb_t rtcp_rdb;
+ sec_serv_t rtcp_services;
+ key_limit_ctx_t *limit;
+ direction_t direction;
+ int allow_repeat_tx;
+ ekt_stream_t ekt;
+ uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */
+ uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */
+ struct srtp_stream_ctx_t *next; /* linked list of streams */
} srtp_stream_ctx_t;
@@ -241,9 +241,9 @@ typedef struct srtp_stream_ctx_t {
*/
typedef struct srtp_ctx_t {
- srtp_stream_ctx_t *stream_list; /* linked list of streams */
- srtp_stream_ctx_t *stream_template; /* act as template for other streams */
- void *user_data; /* user custom data */
+ srtp_stream_ctx_t *stream_list; /* linked list of streams */
+ srtp_stream_ctx_t *stream_template; /* act as template for other streams */
+ void *user_data; /* user custom data */
} srtp_ctx_t;
@@ -252,7 +252,7 @@ typedef struct srtp_ctx_t {
* srtp_handle_event(srtp, srtm, evnt) calls the event handling
* function, if there is one.
*
- * This macro is not included in the documentation as it is
+ * This macro is not included in the documentation as it is
* an internal-only function.
*/
@@ -263,7 +263,7 @@ typedef struct srtp_ctx_t {
data.stream = strm; \
data.event = evnt; \
srtp_event_handler(&data); \
-}
+}
#endif /* SRTP_PRIV_H */
diff --git a/thirdparties/mac/include/srtp/stat.h b/thirdparties/mac/include/srtp/stat.h
index e28b131..a67a380 100755
--- a/thirdparties/mac/include/srtp/stat.h
+++ b/thirdparties/mac/include/srtp/stat.h
@@ -1,6 +1,6 @@
/*
* stats.h
- *
+ *
* interface to statistical test functions
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright(c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/mac/include/srtp/ut_sim.h b/thirdparties/mac/include/srtp/ut_sim.h
index c25feeb..bd7d015 100755
--- a/thirdparties/mac/include/srtp/ut_sim.h
+++ b/thirdparties/mac/include/srtp/ut_sim.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,12 +54,12 @@
#define UT_BUF 160 /* maximum amount of packet reorder */
typedef struct {
- uint32_t index;
- uint32_t buffer[UT_BUF];
+ uint32_t index;
+ uint32_t buffer[UT_BUF];
} ut_connection;
/*
- * ut_init(&u) initializes the ut_connection
+ * ut_init(&u) initializes the ut_connection
*
* this function should always be the first one called on a new
* ut_connection
diff --git a/thirdparties/mac/include/srtp/xfm.h b/thirdparties/mac/include/srtp/xfm.h
index 80774f9..f46a672 100755
--- a/thirdparties/mac/include/srtp/xfm.h
+++ b/thirdparties/mac/include/srtp/xfm.h
@@ -2,32 +2,32 @@
* xfm.h
*
* interface for abstract crypto transform
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -64,12 +64,12 @@
* The function pointer xfm_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated only
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated only
*
- * @param clear_len length of data to be authenticated only
+ * @param clear_len length of data to be authenticated only
*
* @param iv location to write the Initialization Vector (IV)
*
@@ -81,38 +81,38 @@
* encrypted and authenticated (before the function call), and the
* length of the ciphertext (after the call)
*
- * @param auth_tag location to write auth tag
+ * @param auth_tag location to write auth tag
*/
-typedef err_status_t (*xfm_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len,
- void *auth_tag
- );
-
-typedef
+typedef err_status_t (*xfm_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len,
+ void *auth_tag
+);
+
+typedef
err_status_t (*xfm_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len, /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len, /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- void *auth_tag /* location of auth tag */
- );
+ void *auth_tag /* location of auth tag */
+);
typedef struct xfm_ctx_t {
- xfm_func_t func;
- xfm_inv_t inv;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
+ xfm_func_t func;
+ xfm_inv_t inv;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
} xfm_ctx_t;
typedef xfm_ctx_t *xfm_t;
@@ -125,35 +125,35 @@ typedef xfm_ctx_t *xfm_t;
/* cryptoalgo - 5/28 */
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *opaque,
- unsigned *opaque_len
- );
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *opaque,
+ unsigned *opaque_len
+);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
diff --git a/thirdparties/mac/include/vpx/vp8.h b/thirdparties/mac/include/vpx/vp8.h
index 2952203..1a6c594 100755
--- a/thirdparties/mac/include/vpx/vp8.h
+++ b/thirdparties/mac/include/vpx/vp8.h
@@ -36,8 +36,7 @@
*
* The set of macros define the control functions of VP8 interface
*/
-enum vp8_com_control_id
-{
+enum vp8_com_control_id {
VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
@@ -53,8 +52,7 @@ enum vp8_com_control_id
*
* The set of macros define VP8 decoder post processing flags
*/
-enum vp8_postproc_level
-{
+enum vp8_postproc_level {
VP8_NOFILTERING = 0,
VP8_DEBLOCK = 1<<0,
VP8_DEMACROBLOCK = 1<<1,
@@ -73,8 +71,7 @@ enum vp8_postproc_level
* to VP8_DEBLOCK and deblocking_level to 1.
*/
-typedef struct vp8_postproc_cfg
-{
+typedef struct vp8_postproc_cfg {
int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
int noise_level; /**< the strength of additive noise, valid range [0, 16] */
@@ -84,8 +81,7 @@ typedef struct vp8_postproc_cfg
*
* The set of macros define the type of VP8 reference frames
*/
-typedef enum vpx_ref_frame_type
-{
+typedef enum vpx_ref_frame_type {
VP8_LAST_FRAME = 1,
VP8_GOLD_FRAME = 2,
VP8_ALTR_FRAME = 4
@@ -96,8 +92,7 @@ typedef enum vpx_ref_frame_type
* define the data struct to access vp8 reference frames
*/
-typedef struct vpx_ref_frame
-{
+typedef struct vpx_ref_frame {
vpx_ref_frame_type_t frame_type; /**< which reference frame */
vpx_image_t img; /**< reference frame data in image format */
} vpx_ref_frame_t;
diff --git a/thirdparties/mac/include/vpx/vp8cx.h b/thirdparties/mac/include/vpx/vp8cx.h
index 0af631c..0afdeab 100755
--- a/thirdparties/mac/include/vpx/vp8cx.h
+++ b/thirdparties/mac/include/vpx/vp8cx.h
@@ -121,8 +121,7 @@ extern vpx_codec_iface_t* vpx_codec_vp8_cx(void);
*
* \sa #vpx_codec_control
*/
-enum vp8e_enc_control_id
-{
+enum vp8e_enc_control_id {
VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
@@ -184,8 +183,7 @@ enum vp8e_enc_control_id
*
* This set of constants define 1-D vpx scaling modes
*/
-typedef enum vpx_scaling_mode_1d
-{
+typedef enum vpx_scaling_mode_1d {
VP8E_NORMAL = 0,
VP8E_FOURFIVE = 1,
VP8E_THREEFIVE = 2,
@@ -199,8 +197,7 @@ typedef enum vpx_scaling_mode_1d
*
*/
-typedef struct vpx_roi_map
-{
+typedef struct vpx_roi_map {
unsigned char *roi_map; /**< specify an id between 0 and 3 for each 16x16 region within a frame */
unsigned int rows; /**< number of rows */
unsigned int cols; /**< number of cols */
@@ -216,8 +213,7 @@ typedef struct vpx_roi_map
*/
-typedef struct vpx_active_map
-{
+typedef struct vpx_active_map {
unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
unsigned int rows; /**< number of rows */
unsigned int cols; /**< number of cols */
@@ -228,8 +224,7 @@ typedef struct vpx_active_map
* This defines the data structure for image scaling mode
*
*/
-typedef struct vpx_scaling_mode
-{
+typedef struct vpx_scaling_mode {
VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
@@ -239,8 +234,7 @@ typedef struct vpx_scaling_mode
* This defines VP8 encoding mode
*
*/
-typedef enum
-{
+typedef enum {
VP8_BEST_QUALITY_ENCODING,
VP8_GOOD_QUALITY_ENCODING,
VP8_REAL_TIME_ENCODING
@@ -253,8 +247,7 @@ typedef enum
*
*/
-typedef enum
-{
+typedef enum {
VP8_ONE_TOKENPARTITION = 0,
VP8_TWO_TOKENPARTITION = 1,
VP8_FOUR_TOKENPARTITION = 2,
@@ -267,8 +260,7 @@ typedef enum
* Changes the encoder to tune for certain types of input material.
*
*/
-typedef enum
-{
+typedef enum {
VP8_TUNE_PSNR,
VP8_TUNE_SSIM
} vp8e_tuning;
diff --git a/thirdparties/mac/include/vpx/vp8dx.h b/thirdparties/mac/include/vpx/vp8dx.h
index 8661035..d8a5534 100755
--- a/thirdparties/mac/include/vpx/vp8dx.h
+++ b/thirdparties/mac/include/vpx/vp8dx.h
@@ -45,8 +45,7 @@ extern vpx_codec_iface_t* vpx_codec_vp8_dx(void);
*
* \sa #vpx_codec_control
*/
-enum vp8_dec_control_id
-{
+enum vp8_dec_control_id {
/** control function to get info on which reference frames were updated
* by the last decode
*/
diff --git a/thirdparties/mac/include/vpx/vp8e.h b/thirdparties/mac/include/vpx/vp8e.h
index ca907c9..4ad8d22 100755
--- a/thirdparties/mac/include/vpx/vp8e.h
+++ b/thirdparties/mac/include/vpx/vp8e.h
@@ -24,8 +24,7 @@
DECLSPEC_DEPRECATED extern vpx_codec_iface_t vpx_enc_vp8_algo DEPRECATED;
-enum
-{
+enum {
VP8E_SET_REFERENCE = VP8_SET_REFERENCE,
VP8E_COPY_REFERENCE = VP8_COPY_REFERENCE,
VP8E_SET_PREVIEWPP = VP8_SET_POSTPROC,
diff --git a/thirdparties/mac/include/vpx/vpx_codec.h b/thirdparties/mac/include/vpx/vpx_codec.h
index d92e165..cad4078 100755
--- a/thirdparties/mac/include/vpx/vpx_codec.h
+++ b/thirdparties/mac/include/vpx/vpx_codec.h
@@ -45,7 +45,7 @@ extern "C" {
#include "vpx_integer.h"
#include "vpx_image.h"
- /*!\brief Decorator indicating a function is deprecated */
+/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
#if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__ ((deprecated))
@@ -59,7 +59,7 @@ extern "C" {
#endif
#endif
- /*!\brief Decorator indicating a function is potentially unused */
+/*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED
#elif __GNUC__
#define UNUSED __attribute__ ((unused))
@@ -67,312 +67,310 @@ extern "C" {
#define UNUSED
#endif
- /*!\brief Current ABI version number
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
+#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
+
+/*!\brief Algorithm return codes */
+typedef enum {
+ /*!\brief Operation completed without error */
+ VPX_CODEC_OK,
+
+ /*!\brief Unspecified error */
+ VPX_CODEC_ERROR,
+
+ /*!\brief Memory operation failed */
+ VPX_CODEC_MEM_ERROR,
+
+ /*!\brief ABI version mismatch */
+ VPX_CODEC_ABI_MISMATCH,
+
+ /*!\brief Algorithm does not have required capability */
+ VPX_CODEC_INCAPABLE,
+
+ /*!\brief The given bitstream is not supported.
+ *
+ * The bitstream was unable to be parsed at the highest level. The decoder
+ * is unable to proceed. This error \ref SHOULD be treated as fatal to the
+ * stream. */
+ VPX_CODEC_UNSUP_BITSTREAM,
+
+ /*!\brief Encoded bitstream uses an unsupported feature
*
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
+ * The decoder does not implement a feature required by the encoder. This
+ * return code should only be used for features that prevent future
+ * pictures from being properly decoded. This error \ref MAY be treated as
+ * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
*/
-#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
+ VPX_CODEC_UNSUP_FEATURE,
- /*!\brief Algorithm return codes */
- typedef enum {
- /*!\brief Operation completed without error */
- VPX_CODEC_OK,
-
- /*!\brief Unspecified error */
- VPX_CODEC_ERROR,
-
- /*!\brief Memory operation failed */
- VPX_CODEC_MEM_ERROR,
-
- /*!\brief ABI version mismatch */
- VPX_CODEC_ABI_MISMATCH,
-
- /*!\brief Algorithm does not have required capability */
- VPX_CODEC_INCAPABLE,
-
- /*!\brief The given bitstream is not supported.
- *
- * The bitstream was unable to be parsed at the highest level. The decoder
- * is unable to proceed. This error \ref SHOULD be treated as fatal to the
- * stream. */
- VPX_CODEC_UNSUP_BITSTREAM,
-
- /*!\brief Encoded bitstream uses an unsupported feature
- *
- * The decoder does not implement a feature required by the encoder. This
- * return code should only be used for features that prevent future
- * pictures from being properly decoded. This error \ref MAY be treated as
- * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
- */
- VPX_CODEC_UNSUP_FEATURE,
-
- /*!\brief The coded data for this stream is corrupt or incomplete
- *
- * There was a problem decoding the current frame. This return code
- * should only be used for failures that prevent future pictures from
- * being properly decoded. This error \ref MAY be treated as fatal to the
- * stream or \ref MAY be treated as fatal to the current GOP. If decoding
- * is continued for the current GOP, artifacts may be present.
- */
- VPX_CODEC_CORRUPT_FRAME,
-
- /*!\brief An application-supplied parameter is not valid.
- *
- */
- VPX_CODEC_INVALID_PARAM,
-
- /*!\brief An iterator reached the end of list.
- *
- */
- VPX_CODEC_LIST_END
-
- }
- vpx_codec_err_t;
-
-
- /*! \brief Codec capabilities bitfield
+ /*!\brief The coded data for this stream is corrupt or incomplete
*
- * Each codec advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported.
+ * There was a problem decoding the current frame. This return code
+ * should only be used for failures that prevent future pictures from
+ * being properly decoded. This error \ref MAY be treated as fatal to the
+ * stream or \ref MAY be treated as fatal to the current GOP. If decoding
+ * is continued for the current GOP, artifacts may be present.
+ */
+ VPX_CODEC_CORRUPT_FRAME,
+
+ /*!\brief An application-supplied parameter is not valid.
+ *
+ */
+ VPX_CODEC_INVALID_PARAM,
+
+ /*!\brief An iterator reached the end of list.
*
- * The available flags are specified by VPX_CODEC_CAP_* defines.
*/
- typedef long vpx_codec_caps_t;
+ VPX_CODEC_LIST_END
+
+}
+vpx_codec_err_t;
+
+
+/*! \brief Codec capabilities bitfield
+ *
+ * Each codec advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
+typedef long vpx_codec_caps_t;
#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
#define VPX_CODEC_CAP_XMA 0x4 /**< Supports eXternal Memory Allocation */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
- typedef long vpx_codec_flags_t;
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
+typedef long vpx_codec_flags_t;
#define VPX_CODEC_USE_XMA 0x00000001 /**< Use eXternal Memory Allocation mode */
- /*!\brief Codec interface structure.
- *
- * Contains function pointers and other data private to the codec
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_codec_iface_t;
+/*!\brief Codec interface structure.
+ *
+ * Contains function pointers and other data private to the codec
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_codec_iface_t;
- /*!\brief Codec private data structure.
- *
- * Contains data private to the codec implementation. This structure is opaque
- * to the application.
- */
- typedef struct vpx_codec_priv vpx_codec_priv_t;
+/*!\brief Codec private data structure.
+ *
+ * Contains data private to the codec implementation. This structure is opaque
+ * to the application.
+ */
+typedef struct vpx_codec_priv vpx_codec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef const void *vpx_codec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef const void *vpx_codec_iter_t;
- /*!\brief Codec context structure
- *
- * All codecs \ref MUST support this context structure fully. In general,
- * this data should be considered private to the codec algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
- typedef struct vpx_codec_ctx
- {
- const char *name; /**< Printable interface name */
- vpx_codec_iface_t *iface; /**< Interface pointers */
- vpx_codec_err_t err; /**< Last returned error */
- const char *err_detail; /**< Detailed info, if available */
- vpx_codec_flags_t init_flags; /**< Flags passed at init time */
- union
- {
- struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
- struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
- void *raw;
- } config; /**< Configuration pointer aliasing union */
- vpx_codec_priv_t *priv; /**< Algorithm private storage */
- } vpx_codec_ctx_t;
+/*!\brief Codec context structure
+ *
+ * All codecs \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the codec algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
+typedef struct vpx_codec_ctx {
+ const char *name; /**< Printable interface name */
+ vpx_codec_iface_t *iface; /**< Interface pointers */
+ vpx_codec_err_t err; /**< Last returned error */
+ const char *err_detail; /**< Detailed info, if available */
+ vpx_codec_flags_t init_flags; /**< Flags passed at init time */
+ union {
+ struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
+ struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
+ void *raw;
+ } config; /**< Configuration pointer aliasing union */
+ vpx_codec_priv_t *priv; /**< Algorithm private storage */
+} vpx_codec_ctx_t;
- /*
- * Library Version Number Interface
- *
- * For example, see the following sample return values:
- * vpx_codec_version() (1<<16 | 2<<8 | 3)
- * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
- * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
- */
+/*
+ * Library Version Number Interface
+ *
+ * For example, see the following sample return values:
+ * vpx_codec_version() (1<<16 | 2<<8 | 3)
+ * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
+ * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
+ */
- /*!\brief Return the version information (as an integer)
- *
- * Returns a packed encoding of the library version number. This will only include
- * the major.minor.patch component of the version number. Note that this encoded
- * value should be accessed through the macros provided, as the encoding may change
- * in the future.
- *
- */
- int vpx_codec_version(void);
+/*!\brief Return the version information (as an integer)
+ *
+ * Returns a packed encoding of the library version number. This will only include
+ * the major.minor.patch component of the version number. Note that this encoded
+ * value should be accessed through the macros provided, as the encoding may change
+ * in the future.
+ *
+ */
+int vpx_codec_version(void);
#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */
#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */
#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */
- /*!\brief Return the version major number */
+/*!\brief Return the version major number */
#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff)
- /*!\brief Return the version minor number */
+/*!\brief Return the version minor number */
#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff)
- /*!\brief Return the version patch number */
+/*!\brief Return the version patch number */
#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff)
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable string containing the full library version number. This may
- * contain additional text following the three digit version number, as to indicate
- * release candidates, prerelease versions, etc.
- *
- */
- const char *vpx_codec_version_str(void);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable string containing the full library version number. This may
+ * contain additional text following the three digit version number, as to indicate
+ * release candidates, prerelease versions, etc.
+ *
+ */
+const char *vpx_codec_version_str(void);
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable "extra string". This is the component of the string returned
- * by vpx_codec_version_str() following the three digit version number.
- *
- */
- const char *vpx_codec_version_extra_str(void);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable "extra string". This is the component of the string returned
+ * by vpx_codec_version_str() following the three digit version number.
+ *
+ */
+const char *vpx_codec_version_extra_str(void);
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_codec_build_config(void);
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_codec_build_config(void);
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given codec interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given codec interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_codec_err_to_string(vpx_codec_err_t err);
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_codec_err_to_string(vpx_codec_err_t err);
- /*!\brief Retrieve error synopsis for codec context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+/*!\brief Retrieve error synopsis for codec context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
- /*!\brief Retrieve detailed error information for codec context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+/*!\brief Retrieve detailed error information for codec context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all codecs.
- * They represent the base case functionality expected of all codecs.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all codecs.
+ * They represent the base case functionality expected of all codecs.
+ */
- /*!\brief Destroy a codec instance
- *
- * Destroys a codec context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_CODEC_OK
- * The codec algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
+/*!\brief Destroy a codec instance
+ *
+ * Destroys a codec context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_CODEC_OK
+ * The codec algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the codec
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_CODEC_ERROR if the request could not
- * be dispatched.
- *
- * Note that this function should not be used directly. Call the
- * #vpx_codec_control wrapper macro instead.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- *
- * \retval #VPX_CODEC_OK
- * The control request was processed.
- * \retval #VPX_CODEC_ERROR
- * The control request was not processed.
- * \retval #VPX_CODEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
- int ctrl_id,
- ...);
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the codec
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_CODEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * Note that this function should not be used directly. Call the
+ * #vpx_codec_control wrapper macro instead.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ *
+ * \retval #VPX_CODEC_OK
+ * The control request was processed.
+ * \retval #VPX_CODEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
+ int ctrl_id,
+ ...);
#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS
# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data)
# define VPX_CTRL_USE_TYPE(id, typ)
@@ -380,30 +378,30 @@ extern "C" {
# define VPX_CTRL_VOID(id, typ)
#else
- /*!\brief vpx_codec_control wrapper macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_().
- *
- * \internal
- * It works by dispatching the call to the control function through a wrapper
- * function named with the id parameter.
- */
+/*!\brief vpx_codec_control wrapper macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_().
+ *
+ * \internal
+ * It works by dispatching the call to the control function through a wrapper
+ * function named with the id parameter.
+ */
# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\
/**<\hideinitializer*/
- /*!\brief vpx_codec_control type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It defines the type of the argument for a given
- * control identifier.
- *
- * \internal
- * It defines a static function with
- * the correctly typed arguments as a wrapper to the type-unsafe internal
- * function.
- */
+/*!\brief vpx_codec_control type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It defines the type of the argument for a given
+ * control identifier.
+ *
+ * \internal
+ * It defines a static function with
+ * the correctly typed arguments as a wrapper to the type-unsafe internal
+ * function.
+ */
# define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\
@@ -414,16 +412,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control deprecated type definition macro
- *
- * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
- * deprecated and should not be used. Consult the documentation for your
- * codec for more information.
- *
- * \internal
- * It defines a static function with the correctly typed arguments as a
- * wrapper to the type-unsafe internal function.
- */
+/*!\brief vpx_codec_control deprecated type definition macro
+ *
+ * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
+ * deprecated and should not be used. Consult the documentation for your
+ * codec for more information.
+ *
+ * \internal
+ * It defines a static function with the correctly typed arguments as a
+ * wrapper to the type-unsafe internal function.
+ */
# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\
@@ -434,16 +432,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control void type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It indicates that a given control identifier takes
- * no argument.
- *
- * \internal
- * It defines a static function without a data argument as a wrapper to the
- * type-unsafe internal function.
- */
+/*!\brief vpx_codec_control void type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It indicates that a given control identifier takes
+ * no argument.
+ *
+ * \internal
+ * It defines a static function without a data argument as a wrapper to the
+ * type-unsafe internal function.
+ */
# define VPX_CTRL_VOID(id) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\
@@ -457,95 +455,94 @@ extern "C" {
#endif
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all codecs
- * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_INCAPABLE
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all codecs
+ * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_INCAPABLE
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the codec in the request phase, and by the calling
- * application once the requested allocation has been performed.
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the codec in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
+typedef struct vpx_codec_mmap {
+ /*
+ * The following members are set by the codec when requesting a segment
*/
- typedef struct vpx_codec_mmap
- {
- /*
- * The following members are set by the codec when requesting a segment
- */
- unsigned int id; /**< identifier for the segment's contents */
- unsigned long sz; /**< size of the segment, in bytes */
- unsigned int align; /**< required alignment of the segment, in bytes */
- unsigned int flags; /**< bitfield containing segment properties */
+ unsigned int id; /**< identifier for the segment's contents */
+ unsigned long sz; /**< size of the segment, in bytes */
+ unsigned int align; /**< required alignment of the segment, in bytes */
+ unsigned int flags; /**< bitfield containing segment properties */
#define VPX_CODEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */
#define VPX_CODEC_MEM_WRONLY 0x2 /**< Segment need not be readable */
#define VPX_CODEC_MEM_FAST 0x4 /**< Place in fast memory, if available */
- /* The following members are to be filled in by the allocation function */
- void *base; /**< pointer to the allocated segment */
- void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */
- void *priv; /**< allocator private storage */
- } vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
+ /* The following members are to be filled in by the allocation function */
+ void *base; /**< pointer to the allocated segment */
+ void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */
+ void *priv; /**< allocator private storage */
+} vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. In cases where the
- * stream is not available at allocation time, a fixed size must be requested.
- * The codec will not be able to operate on streams larger than the size used at
- * allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_CODEC_OK
- * The memory map entry was populated.
- * \retval #VPX_CODEC_ERROR
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmap,
- vpx_codec_iter_t *iter);
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. In cases where the
+ * stream is not available at allocation time, a fixed size must be requested.
+ * The codec will not be able to operate on streams larger than the size used at
+ * allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_CODEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_CODEC_ERROR
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmap,
+ vpx_codec_iter_t *iter);
- /*!\brief Identify allocated segments to codec instance
- *
- * Stores a list of allocated segments in the codec. Segments \ref MUST be
- * passed in the order they are read from vpx_codec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_CODEC_OK
- * The segment was stored in the codec context.
- * \retval #VPX_CODEC_INCAPABLE
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
+/*!\brief Identify allocated segments to codec instance
+ *
+ * Stores a list of allocated segments in the codec. Segments \ref MUST be
+ * passed in the order they are read from vpx_codec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_CODEC_OK
+ * The segment was stored in the codec context.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
- */
- vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmaps,
- unsigned int num_maps);
+ */
+vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmaps,
+ unsigned int num_maps);
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup codec*/
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup codec*/
#endif
diff --git a/thirdparties/mac/include/vpx/vpx_decoder.h b/thirdparties/mac/include/vpx/vpx_decoder.h
index 7992cc4..d47a21e 100755
--- a/thirdparties/mac/include/vpx/vpx_decoder.h
+++ b/thirdparties/mac/include/vpx/vpx_decoder.h
@@ -32,24 +32,24 @@ extern "C" {
#define VPX_DECODER_H
#include "vpx_codec.h"
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Decoder capabilities bitfield
- *
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
@@ -58,13 +58,13 @@ extern "C" {
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames
one fragment at a time */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */
#define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded
frames */
@@ -72,255 +72,253 @@ extern "C" {
passed to the decoder one
fragment at a time */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
- typedef struct vpx_codec_stream_info
- {
- unsigned int sz; /**< Size of this structure */
- unsigned int w; /**< Width (or 0 for unknown/default) */
- unsigned int h; /**< Height (or 0 for unknown/default) */
- unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_codec_stream_info_t;
-
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
-
-
- /*!\brief Initialization Configurations
- *
- * This structure is used to pass init time configuration options to the
- * decoder.
- */
- typedef struct vpx_codec_dec_cfg
- {
- unsigned int threads; /**< Maximum number of threads to use, default 1 */
- unsigned int w; /**< Width */
- unsigned int h; /**< Height */
- } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
-
-
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_codec_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
- /*!\brief Convenience macro for vpx_codec_dec_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
+typedef struct vpx_codec_stream_info {
+ unsigned int sz; /**< Size of this structure */
+ unsigned int w; /**< Width (or 0 for unknown/default) */
+ unsigned int h; /**< Height (or 0 for unknown/default) */
+ unsigned int is_kf; /**< Current frame is a keyframe */
+} vpx_codec_stream_info_t;
+
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
+
+
+/*!\brief Initialization Configurations
+ *
+ * This structure is used to pass init time configuration options to the
+ * decoder.
+ */
+typedef struct vpx_codec_dec_cfg {
+ unsigned int threads; /**< Maximum number of threads to use, default 1 */
+ unsigned int w; /**< Width */
+ unsigned int h; /**< Height */
+} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
+
+
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_codec_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_dec_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+/*!\brief Convenience macro for vpx_codec_dec_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_dec_init(ctx, iface, cfg, flags) \
vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
- * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
- * time stamp) order. Frames produced will always be in PTS (presentation
- * time stamp) order.
- * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
- * data and data_sz can contain a fragment of the encoded frame. Fragment
- * \#n must contain at least partition \#n, but can also contain subsequent
- * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
- * be empty. When no more data is available, this function should be called
- * with NULL as data and 0 as data_sz. The memory passed to this function
- * must be available until the frame has been decoded.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] deadline Soft deadline the decoder should attempt to meet,
- * in us. Set to zero for unlimited.
- *
- * \return Returns #VPX_CODEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_codec_err_t
- * for recoverability capabilities.
- */
- vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
- const uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- long deadline);
-
-
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
-
-
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_frame_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_frame */
-
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
-
-
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_slice_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_slice*/
-
- /*!@} - end defgroup decoder*/
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
+ * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
+ * time stamp) order. Frames produced will always be in PTS (presentation
+ * time stamp) order.
+ * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
+ * data and data_sz can contain a fragment of the encoded frame. Fragment
+ * \#n must contain at least partition \#n, but can also contain subsequent
+ * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
+ * be empty. When no more data is available, this function should be called
+ * with NULL as data and 0 as data_sz. The memory passed to this function
+ * must be available until the frame has been decoded.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] deadline Soft deadline the decoder should attempt to meet,
+ * in us. Set to zero for unlimited.
+ *
+ * \return Returns #VPX_CODEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_codec_err_t
+ * for recoverability capabilities.
+ */
+vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
+ const uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ long deadline);
+
+
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
+
+
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_frame_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_frame */
+
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
+
+
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_slice_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_slice*/
+
+/*!@} - end defgroup decoder*/
#endif
diff --git a/thirdparties/mac/include/vpx/vpx_decoder_compat.h b/thirdparties/mac/include/vpx/vpx_decoder_compat.h
index 8adc1b9..13046e1 100755
--- a/thirdparties/mac/include/vpx/vpx_decoder_compat.h
+++ b/thirdparties/mac/include/vpx/vpx_decoder_compat.h
@@ -30,555 +30,552 @@ extern "C" {
#ifndef VPX_DECODER_COMPAT_H
#define VPX_DECODER_COMPAT_H
- /*!\brief Decoder algorithm return codes */
- typedef enum {
- /*!\brief Operation completed without error */
- VPX_DEC_OK = VPX_CODEC_OK,
-
- /*!\brief Unspecified error */
- VPX_DEC_ERROR = VPX_CODEC_ERROR,
-
- /*!\brief Memory operation failed */
- VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR,
-
- /*!\brief ABI version mismatch */
- VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH,
-
- /*!\brief The given bitstream is not supported.
- *
- * The bitstream was unable to be parsed at the highest level. The decoder
- * is unable to proceed. This error \ref SHOULD be treated as fatal to the
- * stream. */
- VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM,
-
- /*!\brief Encoded bitstream uses an unsupported feature
- *
- * The decoder does not implement a feature required by the encoder. This
- * return code should only be used for features that prevent future
- * pictures from being properly decoded. This error \ref MAY be treated as
- * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
- */
- VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE,
-
- /*!\brief The coded data for this stream is corrupt or incomplete
- *
- * There was a problem decoding the current frame. This return code
- * should only be used for failures that prevent future pictures from
- * being properly decoded. This error \ref MAY be treated as fatal to the
- * stream or \ref MAY be treated as fatal to the current GOP. If decoding
- * is continued for the current GOP, artifacts may be present.
- */
- VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME,
-
- /*!\brief An application-supplied parameter is not valid.
- *
- */
- VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM,
-
- /*!\brief An iterator reached the end of list.
- *
- */
- VPX_DEC_LIST_END = VPX_CODEC_LIST_END
-
- }
- vpx_dec_err_t;
-
- /*! \brief Decoder capabilities bitfield
+/*!\brief Decoder algorithm return codes */
+typedef enum {
+ /*!\brief Operation completed without error */
+ VPX_DEC_OK = VPX_CODEC_OK,
+
+ /*!\brief Unspecified error */
+ VPX_DEC_ERROR = VPX_CODEC_ERROR,
+
+ /*!\brief Memory operation failed */
+ VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR,
+
+ /*!\brief ABI version mismatch */
+ VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH,
+
+ /*!\brief The given bitstream is not supported.
+ *
+ * The bitstream was unable to be parsed at the highest level. The decoder
+ * is unable to proceed. This error \ref SHOULD be treated as fatal to the
+ * stream. */
+ VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM,
+
+ /*!\brief Encoded bitstream uses an unsupported feature
+ *
+ * The decoder does not implement a feature required by the encoder. This
+ * return code should only be used for features that prevent future
+ * pictures from being properly decoded. This error \ref MAY be treated as
+ * fatal to the stream or \ref MAY be treated as fatal to the current GOP.
+ */
+ VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE,
+
+ /*!\brief The coded data for this stream is corrupt or incomplete
*
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
+ * There was a problem decoding the current frame. This return code
+ * should only be used for failures that prevent future pictures from
+ * being properly decoded. This error \ref MAY be treated as fatal to the
+ * stream or \ref MAY be treated as fatal to the current GOP. If decoding
+ * is continued for the current GOP, artifacts may be present.
+ */
+ VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME,
+
+ /*!\brief An application-supplied parameter is not valid.
+ *
+ */
+ VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM,
+
+ /*!\brief An iterator reached the end of list.
*
- * The available flags are specified by VPX_DEC_CAP_* defines.
*/
- typedef int vpx_dec_caps_t;
+ VPX_DEC_LIST_END = VPX_CODEC_LIST_END
+
+}
+vpx_dec_err_t;
+
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_DEC_CAP_* defines.
+ */
+typedef int vpx_dec_caps_t;
#define VPX_DEC_CAP_PUT_SLICE 0x0001 /**< Will issue put_slice callbacks */
#define VPX_DEC_CAP_PUT_FRAME 0x0002 /**< Will issue put_frame callbacks */
#define VPX_DEC_CAP_XMA 0x0004 /**< Supports eXternal Memory Allocation */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
#if 1
- typedef vpx_codec_stream_info_t vpx_dec_stream_info_t;
+typedef vpx_codec_stream_info_t vpx_dec_stream_info_t;
#else
- typedef struct
- {
- unsigned int sz; /**< Size of this structure */
- unsigned int w; /**< Width (or 0 for unknown/default) */
- unsigned int h; /**< Height (or 0 for unknown/default) */
- unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_dec_stream_info_t;
+typedef struct {
+ unsigned int sz; /**< Size of this structure */
+ unsigned int w; /**< Width (or 0 for unknown/default) */
+ unsigned int h; /**< Height (or 0 for unknown/default) */
+ unsigned int is_kf; /**< Current frame is a keyframe */
+} vpx_dec_stream_info_t;
#endif
- /*!\brief Decoder interface structure.
- *
- * Contains function pointers and other data private to the decoder
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_dec_iface_t;
- typedef struct vpx_codec_priv vpx_dec_priv_t;
+/*!\brief Decoder interface structure.
+ *
+ * Contains function pointers and other data private to the decoder
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_dec_iface_t;
+typedef struct vpx_codec_priv vpx_dec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef vpx_codec_iter_t vpx_dec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef vpx_codec_iter_t vpx_dec_iter_t;
- /*!\brief Decoder context structure
- *
- * All decoders \ref MUST support this context structure fully. In general,
- * this data should be considered private to the decoder algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
+/*!\brief Decoder context structure
+ *
+ * All decoders \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the decoder algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
#if 1
- typedef vpx_codec_ctx_t vpx_dec_ctx_t;
+typedef vpx_codec_ctx_t vpx_dec_ctx_t;
#else
- typedef struct
- {
- const char *name; /**< Printable interface name */
- vpx_dec_iface_t *iface; /**< Interface pointers */
- vpx_dec_err_t err; /**< Last returned error */
- vpx_dec_priv_t *priv; /**< Algorithm private storage */
- } vpx_dec_ctx_t;
+typedef struct {
+ const char *name; /**< Printable interface name */
+ vpx_dec_iface_t *iface; /**< Interface pointers */
+ vpx_dec_err_t err; /**< Last returned error */
+ vpx_dec_priv_t *priv; /**< Algorithm private storage */
+} vpx_dec_ctx_t;
#endif
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_dec_build_config(void) DEPRECATED;
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_dec_build_config(void) DEPRECATED;
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given decoder interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED;
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given decoder interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED;
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED;
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED;
- /*!\brief Retrieve error synopsis for decoder context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Retrieve error synopsis for decoder context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED;
- /*!\brief Retrieve detailed error information for decoder context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Retrieve detailed error information for decoder context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx,
- vpx_dec_iface_t *iface,
- int ver) DEPRECATED;
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx,
+ vpx_dec_iface_t *iface,
+ int ver) DEPRECATED;
#define vpx_dec_init(ctx, iface) \
vpx_dec_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)
- /*!\brief Destroy a decoder instance
- *
- * Destroys a decoder context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED;
+/*!\brief Destroy a decoder instance
+ *
+ * Destroys a decoder context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED;
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED;
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED;
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_DEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_dec_stream_info_t *si) DEPRECATED;
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_DEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_dec_stream_info_t *si) DEPRECATED;
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_DEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx,
- vpx_dec_stream_info_t *si) DEPRECATED;
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_DEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx,
+ vpx_dec_stream_info_t *si) DEPRECATED;
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the decoder
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_DEC_ERROR if the request could not
- * be dispatched.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- * \param[in,out] data Data to exchange with algorithm instance.
- *
- * \retval #VPX_DEC_OK
- * The control request was processed.
- * \retval #VPX_DEC_ERROR
- * The control request was not processed.
- * \retval #VPX_DEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx,
- int ctrl_id,
- void *data) DEPRECATED;
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the decoder
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_DEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ * \param[in,out] data Data to exchange with algorithm instance.
+ *
+ * \retval #VPX_DEC_OK
+ * The control request was processed.
+ * \retval #VPX_DEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_DEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx,
+ int ctrl_id,
+ void *data) DEPRECATED;
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and
- * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data
- * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will
- * always be in PTS (presentation time stamp) order.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_DEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] rel_pts PTS relative to the previous frame, in us. If
- * unknown or unavailable, set to zero.
- *
- * \return Returns #VPX_DEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_dec_err_t
- * for recoverability capabilities.
- */
- vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx,
- uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- int rel_pts) DEPRECATED;
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and
+ * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data
+ * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will
+ * always be in PTS (presentation time stamp) order.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_DEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] rel_pts PTS relative to the previous frame, in us. If
+ * unknown or unavailable, set to zero.
+ *
+ * \return Returns #VPX_DEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_dec_err_t
+ * for recoverability capabilities.
+ */
+vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx,
+ uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ int rel_pts) DEPRECATED;
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx,
- vpx_dec_iter_t *iter) DEPRECATED;
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx,
+ vpx_dec_iter_t *iter) DEPRECATED;
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_DEC_OK
- * Callback successfully registered.
- * \retval #VPX_DEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx,
- vpx_dec_put_frame_cb_fn_t cb,
- void *user_priv) DEPRECATED;
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_DEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_DEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx,
+ vpx_dec_put_frame_cb_fn_t cb,
+ void *user_priv) DEPRECATED;
- /*!@} - end defgroup cap_put_frame */
+/*!@} - end defgroup cap_put_frame */
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_DEC_OK
- * Callback successfully registered.
- * \retval #VPX_DEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx,
- vpx_dec_put_slice_cb_fn_t cb,
- void *user_priv) DEPRECATED;
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_DEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_DEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx,
+ vpx_dec_put_slice_cb_fn_t cb,
+ void *user_priv) DEPRECATED;
- /*!@} - end defgroup cap_put_slice*/
+/*!@} - end defgroup cap_put_slice*/
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_DEC_ERROR
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_DEC_ERROR
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the decoder in the request phase, and by the calling
- * application once the requested allocation has been performed.
- */
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the decoder in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
#if 1
#define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */
#define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */
#define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */
- typedef struct vpx_codec_mmap vpx_dec_mmap_t;
+typedef struct vpx_codec_mmap vpx_dec_mmap_t;
#else
- typedef struct vpx_dec_mmap
- {
- /*
- * The following members are set by the codec when requesting a segment
- */
- unsigned int id; /**< identifier for the segment's contents */
- unsigned long sz; /**< size of the segment, in bytes */
- unsigned int align; /**< required alignment of the segment, in bytes */
- unsigned int flags; /**< bitfield containing segment properties */
+typedef struct vpx_dec_mmap {
+ /*
+ * The following members are set by the codec when requesting a segment
+ */
+ unsigned int id; /**< identifier for the segment's contents */
+ unsigned long sz; /**< size of the segment, in bytes */
+ unsigned int align; /**< required alignment of the segment, in bytes */
+ unsigned int flags; /**< bitfield containing segment properties */
#define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */
#define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */
#define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */
- /* The following members are to be filled in by the allocation function */
- void *base; /**< pointer to the allocated segment */
- void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */
- void *priv; /**< allocator private storage */
- } vpx_dec_mmap_t;
+ /* The following members are to be filled in by the allocation function */
+ void *base; /**< pointer to the allocated segment */
+ void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */
+ void *priv; /**< allocator private storage */
+} vpx_dec_mmap_t;
#endif
- /*!\brief Initialize a decoder instance in external allocation mode
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_dec_xma_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_DEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- */
- vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx,
- vpx_dec_iface_t *iface,
- int ver) DEPRECATED;
+/*!\brief Initialize a decoder instance in external allocation mode
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_dec_xma_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_DEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ */
+vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx,
+ vpx_dec_iface_t *iface,
+ int ver) DEPRECATED;
#define vpx_dec_xma_init(ctx, iface) \
vpx_dec_xma_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_DEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. This means that
- * the stream info structure must be known at allocation time. It can be
- * populated with the vpx_dec_peek_stream_info() function. In cases where the
- * stream to be decoded is not available at allocation time, a fixed size must
- * be requested. The decoder will not be able to decode streams larger than
- * the size used at allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in] si Pointer to the stream info.
- * \param[in out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_DEC_OK
- * The memory map entry was populated.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- * \retval #VPX_DEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx,
- vpx_dec_mmap_t *mmap,
- const vpx_dec_stream_info_t *si,
- vpx_dec_iter_t *iter) DEPRECATED;
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_DEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. This means that
+ * the stream info structure must be known at allocation time. It can be
+ * populated with the vpx_dec_peek_stream_info() function. In cases where the
+ * stream to be decoded is not available at allocation time, a fixed size must
+ * be requested. The decoder will not be able to decode streams larger than
+ * the size used at allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in] si Pointer to the stream info.
+ * \param[in out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_DEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx,
+ vpx_dec_mmap_t *mmap,
+ const vpx_dec_stream_info_t *si,
+ vpx_dec_iter_t *iter) DEPRECATED;
- /*!\brief Identify allocated segments to decoder instance
- *
- * Stores a list of allocated segments in the decoder. Segments \ref MUST be
- * passed in the order they are read from vpx_dec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_DEC_OK
- * The segment was stored in the decoder context.
- * \retval #VPX_DEC_ERROR
- * Decoder does not support XMA mode.
- * \retval #VPX_DEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
+/*!\brief Identify allocated segments to decoder instance
+ *
+ * Stores a list of allocated segments in the decoder. Segments \ref MUST be
+ * passed in the order they are read from vpx_dec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_DEC_OK
+ * The segment was stored in the decoder context.
+ * \retval #VPX_DEC_ERROR
+ * Decoder does not support XMA mode.
+ * \retval #VPX_DEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
- */
- vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx,
- vpx_dec_mmap_t *mmaps,
- unsigned int num_maps) DEPRECATED;
+ */
+vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx,
+ vpx_dec_mmap_t *mmaps,
+ unsigned int num_maps) DEPRECATED;
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup decoder*/
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup decoder*/
#endif
diff --git a/thirdparties/mac/include/vpx/vpx_encoder.h b/thirdparties/mac/include/vpx/vpx_encoder.h
index 239036e..749531e 100755
--- a/thirdparties/mac/include/vpx/vpx_encoder.h
+++ b/thirdparties/mac/include/vpx/vpx_encoder.h
@@ -46,75 +46,74 @@ extern "C" {
/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
#define MAX_LAYERS VPX_TS_MAX_LAYERS
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Encoder capabilities bitfield
- *
- * Each encoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra
- * interfaces or functionality, and are not required to be supported
- * by an encoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Encoder capabilities bitfield
+ *
+ * Each encoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra
+ * interfaces or functionality, and are not required to be supported
+ * by an encoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
- /*! Can output one partition at a time. Each partition is returned in its
- * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
- * every partition but the last. In this mode all frames are always
- * returned partition by partition.
- */
+/*! Can output one partition at a time. Each partition is returned in its
+ * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
+ * every partition but the last. In this mode all frames are always
+ * returned partition by partition.
+ */
#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow
- * for proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow
+ * for proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one
partition at a time. */
- /*!\brief Generic fixed size buffer structure
- *
- * This structure is able to hold a reference to any fixed size buffer.
- */
- typedef struct vpx_fixed_buf
- {
- void *buf; /**< Pointer to the data */
- size_t sz; /**< Length of the buffer, in chars */
- } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
+/*!\brief Generic fixed size buffer structure
+ *
+ * This structure is able to hold a reference to any fixed size buffer.
+ */
+typedef struct vpx_fixed_buf {
+ void *buf; /**< Pointer to the data */
+ size_t sz; /**< Length of the buffer, in chars */
+} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
- /*!\brief Time Stamp Type
- *
- * An integer, which when multiplied by the stream's time base, provides
- * the absolute time of a sample.
- */
- typedef int64_t vpx_codec_pts_t;
+/*!\brief Time Stamp Type
+ *
+ * An integer, which when multiplied by the stream's time base, provides
+ * the absolute time of a sample.
+ */
+typedef int64_t vpx_codec_pts_t;
- /*!\brief Compressed Frame Flags
- *
- * This type represents a bitfield containing information about a compressed
- * frame that may be useful to an application. The most significant 16 bits
- * can be used by an algorithm to provide additional detail, for example to
- * support frame types that are codec specific (MPEG-1 D-frames for example)
- */
- typedef uint32_t vpx_codec_frame_flags_t;
+/*!\brief Compressed Frame Flags
+ *
+ * This type represents a bitfield containing information about a compressed
+ * frame that may be useful to an application. The most significant 16 bits
+ * can be used by an algorithm to provide additional detail, for example to
+ * support frame types that are codec specific (MPEG-1 D-frames for example)
+ */
+typedef uint32_t vpx_codec_frame_flags_t;
#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */
#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting
the stream (no future frame depends on
@@ -124,13 +123,13 @@ extern "C" {
#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded
frame */
- /*!\brief Error Resilient flags
- *
- * These flags define which error resilient features to enable in the
- * encoder. The flags are specified through the
- * vpx_codec_enc_cfg::g_error_resilient variable.
- */
- typedef uint32_t vpx_codec_er_flags_t;
+/*!\brief Error Resilient flags
+ *
+ * These flags define which error resilient features to enable in the
+ * encoder. The flags are specified through the
+ * vpx_codec_enc_cfg::g_error_resilient variable.
+ */
+typedef uint32_t vpx_codec_er_flags_t;
#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against
losses of whole frames */
#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are
@@ -142,645 +141,635 @@ extern "C" {
predicition is still done over
the partition boundary. */
- /*!\brief Encoder output packet variants
- *
- * This enumeration lists the different kinds of data packets that can be
- * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
- * extend this list to provide additional functionality.
- */
- enum vpx_codec_cx_pkt_kind
- {
- VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
- VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
- VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
- VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
- };
+/*!\brief Encoder output packet variants
+ *
+ * This enumeration lists the different kinds of data packets that can be
+ * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
+ * extend this list to provide additional functionality.
+ */
+enum vpx_codec_cx_pkt_kind {
+ VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
+ VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
+ VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
+ VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
+};
- /*!\brief Encoder output packet
- *
- * This structure contains the different kinds of output data the encoder
- * may produce while compressing a frame.
- */
- typedef struct vpx_codec_cx_pkt
- {
- enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
- union
- {
- struct
- {
- void *buf; /**< compressed data buffer */
- size_t sz; /**< length of compressed data */
- vpx_codec_pts_t pts; /**< time stamp to show frame
+/*!\brief Encoder output packet
+ *
+ * This structure contains the different kinds of output data the encoder
+ * may produce while compressing a frame.
+ */
+typedef struct vpx_codec_cx_pkt {
+ enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
+ union {
+ struct {
+ void *buf; /**< compressed data buffer */
+ size_t sz; /**< length of compressed data */
+ vpx_codec_pts_t pts; /**< time stamp to show frame
(in timebase units) */
- unsigned long duration; /**< duration to show frame
+ unsigned long duration; /**< duration to show frame
(in timebase units) */
- vpx_codec_frame_flags_t flags; /**< flags for this frame */
- int partition_id; /**< the partition id
+ vpx_codec_frame_flags_t flags; /**< flags for this frame */
+ int partition_id; /**< the partition id
defines the decoding order
of the partitions. Only
applicable when "output partition"
mode is enabled. First partition
has id 0.*/
- } frame; /**< data for compressed frame packet */
- struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
- struct vpx_psnr_pkt
- {
- unsigned int samples[4]; /**< Number of samples, total/y/u/v */
- uint64_t sse[4]; /**< sum squared error, total/y/u/v */
- double psnr[4]; /**< PSNR, total/y/u/v */
- } psnr; /**< data for PSNR packet */
- struct vpx_fixed_buf raw; /**< data for arbitrary packets */
+ } frame; /**< data for compressed frame packet */
+ struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
+ struct vpx_psnr_pkt {
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
+ double psnr[4]; /**< PSNR, total/y/u/v */
+ } psnr; /**< data for PSNR packet */
+ struct vpx_fixed_buf raw; /**< data for arbitrary packets */
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
- } data; /**< packet data */
- } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
+ /* This packet size is fixed to allow codecs to extend this
+ * interface without having to manage storage for raw packets,
+ * i.e., if it's smaller than 128 bytes, you can store in the
+ * packet list directly.
+ */
+ char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
+ } data; /**< packet data */
+} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
- /*!\brief Rational Number
- *
- * This structure holds a fractional value.
- */
- typedef struct vpx_rational
- {
- int num; /**< fraction numerator */
- int den; /**< fraction denominator */
- } vpx_rational_t; /**< alias for struct vpx_rational */
+/*!\brief Rational Number
+ *
+ * This structure holds a fractional value.
+ */
+typedef struct vpx_rational {
+ int num; /**< fraction numerator */
+ int den; /**< fraction denominator */
+} vpx_rational_t; /**< alias for struct vpx_rational */
- /*!\brief Multi-pass Encoding Pass */
- enum vpx_enc_pass
- {
- VPX_RC_ONE_PASS, /**< Single pass mode */
- VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
- VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
- };
+/*!\brief Multi-pass Encoding Pass */
+enum vpx_enc_pass {
+ VPX_RC_ONE_PASS, /**< Single pass mode */
+ VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
+ VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
+};
- /*!\brief Rate control mode */
- enum vpx_rc_mode
- {
- VPX_VBR, /**< Variable Bit Rate (VBR) mode */
- VPX_CBR, /**< Constant Bit Rate (CBR) mode */
- VPX_CQ /**< Constant Quality (CQ) mode */
- };
+/*!\brief Rate control mode */
+enum vpx_rc_mode {
+ VPX_VBR, /**< Variable Bit Rate (VBR) mode */
+ VPX_CBR, /**< Constant Bit Rate (CBR) mode */
+ VPX_CQ /**< Constant Quality (CQ) mode */
+};
- /*!\brief Keyframe placement mode.
- *
- * This enumeration determines whether keyframes are placed automatically by
- * the encoder or whether this behavior is disabled. Older releases of this
- * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
- * This name is confusing for this behavior, so the new symbols to be used
- * are VPX_KF_AUTO and VPX_KF_DISABLED.
- */
- enum vpx_kf_mode
- {
- VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
- VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
- VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
- };
+/*!\brief Keyframe placement mode.
+ *
+ * This enumeration determines whether keyframes are placed automatically by
+ * the encoder or whether this behavior is disabled. Older releases of this
+ * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
+ * This name is confusing for this behavior, so the new symbols to be used
+ * are VPX_KF_AUTO and VPX_KF_DISABLED.
+ */
+enum vpx_kf_mode {
+ VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
+ VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
+ VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
+};
- /*!\brief Encoded Frame Flags
- *
- * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
- * per-frame boolean values. By convention, bits common to all codecs will be
- * named VPX_EFLAG_*, and bits specific to an algorithm will be named
- * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
- */
- typedef long vpx_enc_frame_flags_t;
+/*!\brief Encoded Frame Flags
+ *
+ * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
+ * per-frame boolean values. By convention, bits common to all codecs will be
+ * named VPX_EFLAG_*, and bits specific to an algorithm will be named
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
+ */
+typedef long vpx_enc_frame_flags_t;
#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */
- /*!\brief Encoder configuration structure
+/*!\brief Encoder configuration structure
+ *
+ * This structure contains the encoder settings that have common representations
+ * across all codecs. This doesn't imply that all codecs support all features,
+ * however.
+ */
+typedef struct vpx_codec_enc_cfg {
+ /*
+ * generic settings (g)
+ */
+
+ /*!\brief Algorithm specific "usage" value
*
- * This structure contains the encoder settings that have common representations
- * across all codecs. This doesn't imply that all codecs support all features,
- * however.
+ * Algorithms may define multiple values for usage, which may convey the
+ * intent of how the application intends to use the stream. If this value
+ * is non-zero, consult the documentation for the codec to determine its
+ * meaning.
*/
- typedef struct vpx_codec_enc_cfg
- {
- /*
- * generic settings (g)
- */
+ unsigned int g_usage;
- /*!\brief Algorithm specific "usage" value
- *
- * Algorithms may define multiple values for usage, which may convey the
- * intent of how the application intends to use the stream. If this value
- * is non-zero, consult the documentation for the codec to determine its
- * meaning.
- */
- unsigned int g_usage;
+ /*!\brief Maximum number of threads to use
+ *
+ * For multi-threaded implementations, use no more than this number of
+ * threads. The codec may use fewer threads than allowed. The value
+ * 0 is equivalent to the value 1.
+ */
+ unsigned int g_threads;
- /*!\brief Maximum number of threads to use
- *
- * For multi-threaded implementations, use no more than this number of
- * threads. The codec may use fewer threads than allowed. The value
- * 0 is equivalent to the value 1.
- */
- unsigned int g_threads;
+
+ /*!\brief Bitstream profile to use
+ *
+ * Some codecs support a notion of multiple bitstream profiles. Typically
+ * this maps to a set of features that are turned on or off. Often the
+ * profile to use is determined by the features of the intended decoder.
+ * Consult the documentation for the codec to determine the valid values
+ * for this parameter, or set to zero for a sane default.
+ */
+ unsigned int g_profile; /**< profile of bitstream to use */
- /*!\brief Bitstream profile to use
- *
- * Some codecs support a notion of multiple bitstream profiles. Typically
- * this maps to a set of features that are turned on or off. Often the
- * profile to use is determined by the features of the intended decoder.
- * Consult the documentation for the codec to determine the valid values
- * for this parameter, or set to zero for a sane default.
- */
- unsigned int g_profile; /**< profile of bitstream to use */
+ /*!\brief Width of the frame
+ *
+ * This value identifies the presentation resolution of the frame,
+ * in pixels. Note that the frames passed as input to the encoder must
+ * have this resolution. Frames will be presented by the decoder in this
+ * resolution, independent of any spatial resampling the encoder may do.
+ */
+ unsigned int g_w;
- /*!\brief Width of the frame
- *
- * This value identifies the presentation resolution of the frame,
- * in pixels. Note that the frames passed as input to the encoder must
- * have this resolution. Frames will be presented by the decoder in this
- * resolution, independent of any spatial resampling the encoder may do.
- */
- unsigned int g_w;
+ /*!\brief Height of the frame
+ *
+ * This value identifies the presentation resolution of the frame,
+ * in pixels. Note that the frames passed as input to the encoder must
+ * have this resolution. Frames will be presented by the decoder in this
+ * resolution, independent of any spatial resampling the encoder may do.
+ */
+ unsigned int g_h;
- /*!\brief Height of the frame
- *
- * This value identifies the presentation resolution of the frame,
- * in pixels. Note that the frames passed as input to the encoder must
- * have this resolution. Frames will be presented by the decoder in this
- * resolution, independent of any spatial resampling the encoder may do.
- */
- unsigned int g_h;
-
-
- /*!\brief Stream timebase units
- *
- * Indicates the smallest interval of time, in seconds, used by the stream.
- * For fixed frame rate material, or variable frame rate material where
- * frames are timed at a multiple of a given clock (ex: video capture),
- * the \ref RECOMMENDED method is to set the timebase to the reciprocal
- * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the
- * pts to correspond to the frame number, which can be handy. For
- * re-encoding video from containers with absolute time timestamps, the
- * \ref RECOMMENDED method is to set the timebase to that of the parent
- * container or multimedia framework (ex: 1/1000 for ms, as in FLV).
- */
- struct vpx_rational g_timebase;
+ /*!\brief Stream timebase units
+ *
+ * Indicates the smallest interval of time, in seconds, used by the stream.
+ * For fixed frame rate material, or variable frame rate material where
+ * frames are timed at a multiple of a given clock (ex: video capture),
+ * the \ref RECOMMENDED method is to set the timebase to the reciprocal
+ * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the
+ * pts to correspond to the frame number, which can be handy. For
+ * re-encoding video from containers with absolute time timestamps, the
+ * \ref RECOMMENDED method is to set the timebase to that of the parent
+ * container or multimedia framework (ex: 1/1000 for ms, as in FLV).
+ */
+ struct vpx_rational g_timebase;
- /*!\brief Enable error resilient modes.
- *
- * The error resilient bitfield indicates to the encoder which features
- * it should enable to take measures for streaming over lossy or noisy
- * links.
- */
- vpx_codec_er_flags_t g_error_resilient;
+ /*!\brief Enable error resilient modes.
+ *
+ * The error resilient bitfield indicates to the encoder which features
+ * it should enable to take measures for streaming over lossy or noisy
+ * links.
+ */
+ vpx_codec_er_flags_t g_error_resilient;
- /*!\brief Multi-pass Encoding Mode
- *
- * This value should be set to the current phase for multi-pass encoding.
- * For single pass, set to #VPX_RC_ONE_PASS.
- */
- enum vpx_enc_pass g_pass;
-
-
- /*!\brief Allow lagged encoding
- *
- * If set, this value allows the encoder to consume a number of input
- * frames before producing output frames. This allows the encoder to
- * base decisions for the current frame on future frames. This does
- * increase the latency of the encoding pipeline, so it is not appropriate
- * in all situations (ex: realtime encoding).
- *
- * Note that this is a maximum value -- the encoder may produce frames
- * sooner than the given limit. Set this value to 0 to disable this
- * feature.
- */
- unsigned int g_lag_in_frames;
+ /*!\brief Multi-pass Encoding Mode
+ *
+ * This value should be set to the current phase for multi-pass encoding.
+ * For single pass, set to #VPX_RC_ONE_PASS.
+ */
+ enum vpx_enc_pass g_pass;
- /*
- * rate control settings (rc)
- */
+ /*!\brief Allow lagged encoding
+ *
+ * If set, this value allows the encoder to consume a number of input
+ * frames before producing output frames. This allows the encoder to
+ * base decisions for the current frame on future frames. This does
+ * increase the latency of the encoding pipeline, so it is not appropriate
+ * in all situations (ex: realtime encoding).
+ *
+ * Note that this is a maximum value -- the encoder may produce frames
+ * sooner than the given limit. Set this value to 0 to disable this
+ * feature.
+ */
+ unsigned int g_lag_in_frames;
- /*!\brief Temporal resampling configuration, if supported by the codec.
- *
- * Temporal resampling allows the codec to "drop" frames as a strategy to
- * meet its target data rate. This can cause temporal discontinuities in
- * the encoded video, which may appear as stuttering during playback. This
- * trade-off is often acceptable, but for many applications is not. It can
- * be disabled in these cases.
- *
- * Note that not all codecs support this feature. All vpx VPx codecs do.
- * For other codecs, consult the documentation for that algorithm.
- *
- * This threshold is described as a percentage of the target data buffer.
- * When the data buffer falls below this percentage of fullness, a
- * dropped frame is indicated. Set the threshold to zero (0) to disable
- * this feature.
- */
- unsigned int rc_dropframe_thresh;
+ /*
+ * rate control settings (rc)
+ */
- /*!\brief Enable/disable spatial resampling, if supported by the codec.
- *
- * Spatial resampling allows the codec to compress a lower resolution
- * version of the frame, which is then upscaled by the encoder to the
- * correct presentation resolution. This increases visual quality at
- * low data rates, at the expense of CPU time on the encoder/decoder.
- */
- unsigned int rc_resize_allowed;
+ /*!\brief Temporal resampling configuration, if supported by the codec.
+ *
+ * Temporal resampling allows the codec to "drop" frames as a strategy to
+ * meet its target data rate. This can cause temporal discontinuities in
+ * the encoded video, which may appear as stuttering during playback. This
+ * trade-off is often acceptable, but for many applications is not. It can
+ * be disabled in these cases.
+ *
+ * Note that not all codecs support this feature. All vpx VPx codecs do.
+ * For other codecs, consult the documentation for that algorithm.
+ *
+ * This threshold is described as a percentage of the target data buffer.
+ * When the data buffer falls below this percentage of fullness, a
+ * dropped frame is indicated. Set the threshold to zero (0) to disable
+ * this feature.
+ */
+ unsigned int rc_dropframe_thresh;
- /*!\brief Spatial resampling up watermark.
- *
- * This threshold is described as a percentage of the target data buffer.
- * When the data buffer rises above this percentage of fullness, the
- * encoder will step up to a higher resolution version of the frame.
- */
- unsigned int rc_resize_up_thresh;
+ /*!\brief Enable/disable spatial resampling, if supported by the codec.
+ *
+ * Spatial resampling allows the codec to compress a lower resolution
+ * version of the frame, which is then upscaled by the encoder to the
+ * correct presentation resolution. This increases visual quality at
+ * low data rates, at the expense of CPU time on the encoder/decoder.
+ */
+ unsigned int rc_resize_allowed;
- /*!\brief Spatial resampling down watermark.
- *
- * This threshold is described as a percentage of the target data buffer.
- * When the data buffer falls below this percentage of fullness, the
- * encoder will step down to a lower resolution version of the frame.
- */
- unsigned int rc_resize_down_thresh;
+ /*!\brief Spatial resampling up watermark.
+ *
+ * This threshold is described as a percentage of the target data buffer.
+ * When the data buffer rises above this percentage of fullness, the
+ * encoder will step up to a higher resolution version of the frame.
+ */
+ unsigned int rc_resize_up_thresh;
- /*!\brief Rate control algorithm to use.
- *
- * Indicates whether the end usage of this stream is to be streamed over
- * a bandwidth constrained link, indicating that Constant Bit Rate (CBR)
- * mode should be used, or whether it will be played back on a high
- * bandwidth link, as from a local disk, where higher variations in
- * bitrate are acceptable.
- */
- enum vpx_rc_mode rc_end_usage;
+ /*!\brief Spatial resampling down watermark.
+ *
+ * This threshold is described as a percentage of the target data buffer.
+ * When the data buffer falls below this percentage of fullness, the
+ * encoder will step down to a lower resolution version of the frame.
+ */
+ unsigned int rc_resize_down_thresh;
- /*!\brief Two-pass stats buffer.
- *
- * A buffer containing all of the stats packets produced in the first
- * pass, concatenated.
- */
- struct vpx_fixed_buf rc_twopass_stats_in;
+ /*!\brief Rate control algorithm to use.
+ *
+ * Indicates whether the end usage of this stream is to be streamed over
+ * a bandwidth constrained link, indicating that Constant Bit Rate (CBR)
+ * mode should be used, or whether it will be played back on a high
+ * bandwidth link, as from a local disk, where higher variations in
+ * bitrate are acceptable.
+ */
+ enum vpx_rc_mode rc_end_usage;
- /*!\brief Target data rate
- *
- * Target bandwidth to use for this stream, in kilobits per second.
- */
- unsigned int rc_target_bitrate;
+ /*!\brief Two-pass stats buffer.
+ *
+ * A buffer containing all of the stats packets produced in the first
+ * pass, concatenated.
+ */
+ struct vpx_fixed_buf rc_twopass_stats_in;
- /*
- * quantizer settings
- */
+ /*!\brief Target data rate
+ *
+ * Target bandwidth to use for this stream, in kilobits per second.
+ */
+ unsigned int rc_target_bitrate;
- /*!\brief Minimum (Best Quality) Quantizer
- *
- * The quantizer is the most direct control over the quality of the
- * encoded image. The range of valid values for the quantizer is codec
- * specific. Consult the documentation for the codec to determine the
- * values to use. To determine the range programmatically, call
- * vpx_codec_enc_config_default() with a usage value of 0.
- */
- unsigned int rc_min_quantizer;
+ /*
+ * quantizer settings
+ */
- /*!\brief Maximum (Worst Quality) Quantizer
- *
- * The quantizer is the most direct control over the quality of the
- * encoded image. The range of valid values for the quantizer is codec
- * specific. Consult the documentation for the codec to determine the
- * values to use. To determine the range programmatically, call
- * vpx_codec_enc_config_default() with a usage value of 0.
- */
- unsigned int rc_max_quantizer;
+ /*!\brief Minimum (Best Quality) Quantizer
+ *
+ * The quantizer is the most direct control over the quality of the
+ * encoded image. The range of valid values for the quantizer is codec
+ * specific. Consult the documentation for the codec to determine the
+ * values to use. To determine the range programmatically, call
+ * vpx_codec_enc_config_default() with a usage value of 0.
+ */
+ unsigned int rc_min_quantizer;
- /*
- * bitrate tolerance
- */
+ /*!\brief Maximum (Worst Quality) Quantizer
+ *
+ * The quantizer is the most direct control over the quality of the
+ * encoded image. The range of valid values for the quantizer is codec
+ * specific. Consult the documentation for the codec to determine the
+ * values to use. To determine the range programmatically, call
+ * vpx_codec_enc_config_default() with a usage value of 0.
+ */
+ unsigned int rc_max_quantizer;
- /*!\brief Rate control adaptation undershoot control
- *
- * This value, expressed as a percentage of the target bitrate,
- * controls the maximum allowed adaptation speed of the codec.
- * This factor controls the maximum amount of bits that can
- * be subtracted from the target bitrate in order to compensate
- * for prior overshoot.
- *
- * Valid values in the range 0-1000.
- */
- unsigned int rc_undershoot_pct;
-
-
- /*!\brief Rate control adaptation overshoot control
- *
- * This value, expressed as a percentage of the target bitrate,
- * controls the maximum allowed adaptation speed of the codec.
- * This factor controls the maximum amount of bits that can
- * be added to the target bitrate in order to compensate for
- * prior undershoot.
- *
- * Valid values in the range 0-1000.
- */
- unsigned int rc_overshoot_pct;
+ /*
+ * bitrate tolerance
+ */
- /*
- * decoder buffer model parameters
- */
+ /*!\brief Rate control adaptation undershoot control
+ *
+ * This value, expressed as a percentage of the target bitrate,
+ * controls the maximum allowed adaptation speed of the codec.
+ * This factor controls the maximum amount of bits that can
+ * be subtracted from the target bitrate in order to compensate
+ * for prior overshoot.
+ *
+ * Valid values in the range 0-1000.
+ */
+ unsigned int rc_undershoot_pct;
- /*!\brief Decoder Buffer Size
- *
- * This value indicates the amount of data that may be buffered by the
- * decoding application. Note that this value is expressed in units of
- * time (milliseconds). For example, a value of 5000 indicates that the
- * client will buffer (at least) 5000ms worth of encoded data. Use the
- * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if
- * necessary.
- */
- unsigned int rc_buf_sz;
+ /*!\brief Rate control adaptation overshoot control
+ *
+ * This value, expressed as a percentage of the target bitrate,
+ * controls the maximum allowed adaptation speed of the codec.
+ * This factor controls the maximum amount of bits that can
+ * be added to the target bitrate in order to compensate for
+ * prior undershoot.
+ *
+ * Valid values in the range 0-1000.
+ */
+ unsigned int rc_overshoot_pct;
- /*!\brief Decoder Buffer Initial Size
- *
- * This value indicates the amount of data that will be buffered by the
- * decoding application prior to beginning playback. This value is
- * expressed in units of time (milliseconds). Use the target bitrate
- * (#rc_target_bitrate) to convert to bits/bytes, if necessary.
- */
- unsigned int rc_buf_initial_sz;
+ /*
+ * decoder buffer model parameters
+ */
- /*!\brief Decoder Buffer Optimal Size
- *
- * This value indicates the amount of data that the encoder should try
- * to maintain in the decoder's buffer. This value is expressed in units
- * of time (milliseconds). Use the target bitrate (#rc_target_bitrate)
- * to convert to bits/bytes, if necessary.
- */
- unsigned int rc_buf_optimal_sz;
+ /*!\brief Decoder Buffer Size
+ *
+ * This value indicates the amount of data that may be buffered by the
+ * decoding application. Note that this value is expressed in units of
+ * time (milliseconds). For example, a value of 5000 indicates that the
+ * client will buffer (at least) 5000ms worth of encoded data. Use the
+ * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if
+ * necessary.
+ */
+ unsigned int rc_buf_sz;
- /*
- * 2 pass rate control parameters
- */
+ /*!\brief Decoder Buffer Initial Size
+ *
+ * This value indicates the amount of data that will be buffered by the
+ * decoding application prior to beginning playback. This value is
+ * expressed in units of time (milliseconds). Use the target bitrate
+ * (#rc_target_bitrate) to convert to bits/bytes, if necessary.
+ */
+ unsigned int rc_buf_initial_sz;
- /*!\brief Two-pass mode CBR/VBR bias
- *
- * Bias, expressed on a scale of 0 to 100, for determining target size
- * for the current frame. The value 0 indicates the optimal CBR mode
- * value should be used. The value 100 indicates the optimal VBR mode
- * value should be used. Values in between indicate which way the
- * encoder should "lean."
- */
- unsigned int rc_2pass_vbr_bias_pct; /**< RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) */
+ /*!\brief Decoder Buffer Optimal Size
+ *
+ * This value indicates the amount of data that the encoder should try
+ * to maintain in the decoder's buffer. This value is expressed in units
+ * of time (milliseconds). Use the target bitrate (#rc_target_bitrate)
+ * to convert to bits/bytes, if necessary.
+ */
+ unsigned int rc_buf_optimal_sz;
- /*!\brief Two-pass mode per-GOP minimum bitrate
- *
- * This value, expressed as a percentage of the target bitrate, indicates
- * the minimum bitrate to be used for a single GOP (aka "section")
- */
- unsigned int rc_2pass_vbr_minsection_pct;
+ /*
+ * 2 pass rate control parameters
+ */
- /*!\brief Two-pass mode per-GOP maximum bitrate
- *
- * This value, expressed as a percentage of the target bitrate, indicates
- * the maximum bitrate to be used for a single GOP (aka "section")
- */
- unsigned int rc_2pass_vbr_maxsection_pct;
+ /*!\brief Two-pass mode CBR/VBR bias
+ *
+ * Bias, expressed on a scale of 0 to 100, for determining target size
+ * for the current frame. The value 0 indicates the optimal CBR mode
+ * value should be used. The value 100 indicates the optimal VBR mode
+ * value should be used. Values in between indicate which way the
+ * encoder should "lean."
+ */
+ unsigned int rc_2pass_vbr_bias_pct; /**< RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) */
- /*
- * keyframing settings (kf)
- */
+ /*!\brief Two-pass mode per-GOP minimum bitrate
+ *
+ * This value, expressed as a percentage of the target bitrate, indicates
+ * the minimum bitrate to be used for a single GOP (aka "section")
+ */
+ unsigned int rc_2pass_vbr_minsection_pct;
- /*!\brief Keyframe placement mode
- *
- * This value indicates whether the encoder should place keyframes at a
- * fixed interval, or determine the optimal placement automatically
- * (as governed by the #kf_min_dist and #kf_max_dist parameters)
- */
- enum vpx_kf_mode kf_mode;
+ /*!\brief Two-pass mode per-GOP maximum bitrate
+ *
+ * This value, expressed as a percentage of the target bitrate, indicates
+ * the maximum bitrate to be used for a single GOP (aka "section")
+ */
+ unsigned int rc_2pass_vbr_maxsection_pct;
- /*!\brief Keyframe minimum interval
- *
- * This value, expressed as a number of frames, prevents the encoder from
- * placing a keyframe nearer than kf_min_dist to the previous keyframe. At
- * least kf_min_dist frames non-keyframes will be coded before the next
- * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval.
- */
- unsigned int kf_min_dist;
+ /*
+ * keyframing settings (kf)
+ */
- /*!\brief Keyframe maximum interval
- *
- * This value, expressed as a number of frames, forces the encoder to code
- * a keyframe if one has not been coded in the last kf_max_dist frames.
- * A value of 0 implies all frames will be keyframes. Set kf_min_dist
- * equal to kf_max_dist for a fixed interval.
- */
- unsigned int kf_max_dist;
+ /*!\brief Keyframe placement mode
+ *
+ * This value indicates whether the encoder should place keyframes at a
+ * fixed interval, or determine the optimal placement automatically
+ * (as governed by the #kf_min_dist and #kf_max_dist parameters)
+ */
+ enum vpx_kf_mode kf_mode;
- /*
- * Temporal scalability settings (ts)
- */
- /*!\brief Number of coding layers
- *
- * This value specifies the number of coding layers to be used.
- */
- unsigned int ts_number_layers;
+ /*!\brief Keyframe minimum interval
+ *
+ * This value, expressed as a number of frames, prevents the encoder from
+ * placing a keyframe nearer than kf_min_dist to the previous keyframe. At
+ * least kf_min_dist frames non-keyframes will be coded before the next
+ * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval.
+ */
+ unsigned int kf_min_dist;
- /*!\brief Target bitrate for each layer
- *
- * These values specify the target coding bitrate for each coding layer.
- */
- unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS];
- /*!\brief Frame rate decimation factor for each layer
- *
- * These values specify the frame rate decimation factors to apply
- * to each layer.
- */
- unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS];
-
- /*!\brief Length of the sequence defining frame layer membership
- *
- * This value specifies the length of the sequence that defines the
- * membership of frames to layers. For example, if ts_periodicity=8 then
- * frames are assigned to coding layers with a repeated sequence of
- * length 8.
- */
- unsigned int ts_periodicity;
-
- /*!\brief Template defining the membership of frames to coding layers
- *
- * This array defines the membership of frames to coding layers. For a
- * 2-layer encoding that assigns even numbered frames to one layer (0)
- * and odd numbered frames to a second layer (1) with ts_periodicity=8,
- * then ts_layer_id = (0,1,0,1,0,1,0,1).
- */
- unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
- } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+ /*!\brief Keyframe maximum interval
+ *
+ * This value, expressed as a number of frames, forces the encoder to code
+ * a keyframe if one has not been coded in the last kf_max_dist frames.
+ * A value of 0 implies all frames will be keyframes. Set kf_min_dist
+ * equal to kf_max_dist for a fixed interval.
+ */
+ unsigned int kf_max_dist;
+ /*
+ * Temporal scalability settings (ts)
+ */
- /*!\brief Initialize an encoder instance
+ /*!\brief Number of coding layers
*
- * Initializes a encoder context using the given interface. Applications
- * should call the vpx_codec_enc_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
+ * This value specifies the number of coding layers to be used.
+ */
+ unsigned int ts_number_layers;
+
+ /*!\brief Target bitrate for each layer
*
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
+ * These values specify the target coding bitrate for each coding layer.
+ */
+ unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS];
+
+ /*!\brief Frame rate decimation factor for each layer
*
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
+ * These values specify the frame rate decimation factors to apply
+ * to each layer.
*/
- vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
+ unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS];
+ /*!\brief Length of the sequence defining frame layer membership
+ *
+ * This value specifies the length of the sequence that defines the
+ * membership of frames to layers. For example, if ts_periodicity=8 then
+ * frames are assigned to coding layers with a repeated sequence of
+ * length 8.
+ */
+ unsigned int ts_periodicity;
- /*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ /*!\brief Template defining the membership of frames to coding layers
*
- * Ensures the ABI version parameter is properly set.
+ * This array defines the membership of frames to coding layers. For a
+ * 2-layer encoding that assigns even numbered frames to one layer (0)
+ * and odd numbered frames to a second layer (1) with ts_periodicity=8,
+ * then ts_layer_id = (0,1,0,1,0,1,0,1).
*/
+ unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
+} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+
+
+/*!\brief Initialize an encoder instance
+ *
+ * Initializes a encoder context using the given interface. Applications
+ * should call the vpx_codec_enc_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init(ctx, iface, cfg, flags) \
vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
- /*!\brief Initialize multi-encoder instance
- *
- * Initializes multi-encoder context using the given interface.
- * Applications should call the vpx_codec_enc_init_multi convenience macro
- * instead of this function directly, to ensure that the ABI version number
- * parameter is properly initialized.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] num_enc Total number of encoders.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] dsf Pointer to down-sampling factors.
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- int num_enc,
- vpx_codec_flags_t flags,
- vpx_rational_t *dsf,
- int ver);
+/*!\brief Initialize multi-encoder instance
+ *
+ * Initializes multi-encoder context using the given interface.
+ * Applications should call the vpx_codec_enc_init_multi convenience macro
+ * instead of this function directly, to ensure that the ABI version number
+ * parameter is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] num_enc Total number of encoders.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] dsf Pointer to down-sampling factors.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ int num_enc,
+ vpx_codec_flags_t flags,
+ vpx_rational_t *dsf,
+ int ver);
- /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
VPX_ENCODER_ABI_VERSION)
- /*!\brief Get a default configuration
- *
- * Initializes a encoder configuration structure with default values. Supports
- * the notion of "usages" so that an algorithm may offer different default
- * settings depending on the user's intended goal. This function \ref SHOULD
- * be called by all applications to initialize the configuration structure
- * before specializing the configuration with application specific values.
- *
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[out] cfg Configuration buffer to populate
- * \param[in] usage End usage. Set to 0 or use codec specific values.
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- unsigned int usage);
+/*!\brief Get a default configuration
+ *
+ * Initializes a encoder configuration structure with default values. Supports
+ * the notion of "usages" so that an algorithm may offer different default
+ * settings depending on the user's intended goal. This function \ref SHOULD
+ * be called by all applications to initialize the configuration structure
+ * before specializing the configuration with application specific values.
+ *
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[out] cfg Configuration buffer to populate
+ * \param[in] usage End usage. Set to 0 or use codec specific values.
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ unsigned int usage);
- /*!\brief Set or change configuration
- *
- * Reconfigures an encoder instance according to the given configuration.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cfg Configuration buffer to use
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
- const vpx_codec_enc_cfg_t *cfg);
+/*!\brief Set or change configuration
+ *
+ * Reconfigures an encoder instance according to the given configuration.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cfg Configuration buffer to use
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
+ const vpx_codec_enc_cfg_t *cfg);
- /*!\brief Get global stream headers
- *
- * Retrieves a stream level global header packet, if supported by the codec.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval NULL
- * Encoder does not support global header
- * \retval Non-NULL
- * Pointer to buffer containing global header packet
- */
- vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
+/*!\brief Get global stream headers
+ *
+ * Retrieves a stream level global header packet, if supported by the codec.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval NULL
+ * Encoder does not support global header
+ * \retval Non-NULL
+ * Pointer to buffer containing global header packet
+ */
+vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to
@@ -789,141 +778,141 @@ extern "C" {
* VPx GOOD QUALITY mode. */
#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to
* VPx BEST QUALITY mode. */
- /*!\brief Encode a frame
- *
- * Encodes a video frame at the given "presentation time." The presentation
- * time stamp (PTS) \ref MUST be strictly increasing.
- *
- * The encoder supports the notion of a soft real-time deadline. Given a
- * non-zero value to the deadline parameter, the encoder will make a "best
- * effort" guarantee to return before the given time slice expires. It is
- * implicit that limiting the available time to encode will degrade the
- * output quality. The encoder can be given an unlimited time to produce the
- * best possible frame by specifying a deadline of '0'. This deadline
- * supercedes the VPx notion of "best quality, good quality, realtime".
- * Applications that wish to map these former settings to the new deadline
- * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
- * and #VPX_DL_BEST_QUALITY.
- *
- * When the last frame has been passed to the encoder, this function should
- * continue to be called, with the img parameter set to NULL. This will
- * signal the end-of-stream condition to the encoder and allow it to encode
- * any held buffers. Encoding is complete when vpx_codec_encode() is called
- * and vpx_codec_get_cx_data() returns no data.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] img Image data to encode, NULL to flush.
- * \param[in] pts Presentation time stamp, in timebase units.
- * \param[in] duration Duration to show frame, in timebase units.
- * \param[in] flags Flags to use for encoding this frame.
- * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
- const vpx_image_t *img,
- vpx_codec_pts_t pts,
- unsigned long duration,
- vpx_enc_frame_flags_t flags,
- unsigned long deadline);
-
- /*!\brief Set compressed data output buffer
- *
- * Sets the buffer that the codec should output the compressed data
- * into. This call effectively sets the buffer pointer returned in the
- * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
- * appended into this buffer. The buffer is preserved across frames,
- * so applications must periodically call this function after flushing
- * the accumulated compressed data to disk or to the network to reset
- * the pointer to the buffer's head.
- *
- * `pad_before` bytes will be skipped before writing the compressed
- * data, and `pad_after` bytes will be appended to the packet. The size
- * of the packet will be the sum of the size of the actual compressed
- * data, pad_before, and pad_after. The padding bytes will be preserved
- * (not overwritten).
- *
- * Note that calling this function does not guarantee that the returned
- * compressed data will be placed into the specified buffer. In the
- * event that the encoded data will not fit into the buffer provided,
- * the returned packet \ref MAY point to an internal buffer, as it would
- * if this call were never used. In this event, the output packet will
- * NOT have any padding, and the application must free space and copy it
- * to the proper place. This is of particular note in configurations
- * that may output multiple packets for a single encoded frame (e.g., lagged
- * encoding) or if the application does not reset the buffer periodically.
- *
- * Applications may restore the default behavior of the codec providing
- * the compressed data buffer by calling this function with a NULL
- * buffer.
- *
- * Applications \ref MUSTNOT call this function during iteration of
- * vpx_codec_get_cx_data().
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] buf Buffer to store compressed data into
- * \param[in] pad_before Bytes to skip before writing compressed data
- * \param[in] pad_after Bytes to skip after writing compressed data
- *
- * \retval #VPX_CODEC_OK
- * The buffer was set successfully.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
- const vpx_fixed_buf_t *buf,
- unsigned int pad_before,
- unsigned int pad_after);
+/*!\brief Encode a frame
+ *
+ * Encodes a video frame at the given "presentation time." The presentation
+ * time stamp (PTS) \ref MUST be strictly increasing.
+ *
+ * The encoder supports the notion of a soft real-time deadline. Given a
+ * non-zero value to the deadline parameter, the encoder will make a "best
+ * effort" guarantee to return before the given time slice expires. It is
+ * implicit that limiting the available time to encode will degrade the
+ * output quality. The encoder can be given an unlimited time to produce the
+ * best possible frame by specifying a deadline of '0'. This deadline
+ * supercedes the VPx notion of "best quality, good quality, realtime".
+ * Applications that wish to map these former settings to the new deadline
+ * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
+ * and #VPX_DL_BEST_QUALITY.
+ *
+ * When the last frame has been passed to the encoder, this function should
+ * continue to be called, with the img parameter set to NULL. This will
+ * signal the end-of-stream condition to the encoder and allow it to encode
+ * any held buffers. Encoding is complete when vpx_codec_encode() is called
+ * and vpx_codec_get_cx_data() returns no data.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] img Image data to encode, NULL to flush.
+ * \param[in] pts Presentation time stamp, in timebase units.
+ * \param[in] duration Duration to show frame, in timebase units.
+ * \param[in] flags Flags to use for encoding this frame.
+ * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned long duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned long deadline);
+
+/*!\brief Set compressed data output buffer
+ *
+ * Sets the buffer that the codec should output the compressed data
+ * into. This call effectively sets the buffer pointer returned in the
+ * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
+ * appended into this buffer. The buffer is preserved across frames,
+ * so applications must periodically call this function after flushing
+ * the accumulated compressed data to disk or to the network to reset
+ * the pointer to the buffer's head.
+ *
+ * `pad_before` bytes will be skipped before writing the compressed
+ * data, and `pad_after` bytes will be appended to the packet. The size
+ * of the packet will be the sum of the size of the actual compressed
+ * data, pad_before, and pad_after. The padding bytes will be preserved
+ * (not overwritten).
+ *
+ * Note that calling this function does not guarantee that the returned
+ * compressed data will be placed into the specified buffer. In the
+ * event that the encoded data will not fit into the buffer provided,
+ * the returned packet \ref MAY point to an internal buffer, as it would
+ * if this call were never used. In this event, the output packet will
+ * NOT have any padding, and the application must free space and copy it
+ * to the proper place. This is of particular note in configurations
+ * that may output multiple packets for a single encoded frame (e.g., lagged
+ * encoding) or if the application does not reset the buffer periodically.
+ *
+ * Applications may restore the default behavior of the codec providing
+ * the compressed data buffer by calling this function with a NULL
+ * buffer.
+ *
+ * Applications \ref MUSTNOT call this function during iteration of
+ * vpx_codec_get_cx_data().
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] buf Buffer to store compressed data into
+ * \param[in] pad_before Bytes to skip before writing compressed data
+ * \param[in] pad_after Bytes to skip after writing compressed data
+ *
+ * \retval #VPX_CODEC_OK
+ * The buffer was set successfully.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
+ const vpx_fixed_buf_t *buf,
+ unsigned int pad_before,
+ unsigned int pad_after);
- /*!\brief Encoded data iterator
- *
- * Iterates over a list of data packets to be passed from the encoder to the
- * application. The different kinds of packets available are enumerated in
- * #vpx_codec_cx_pkt_kind.
- *
- * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
- * muxer. Multiple compressed frames may be in the list.
- * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
- *
- * The application \ref MUST silently ignore any packet kinds that it does
- * not recognize or support.
- *
- * The data buffers returned from this function are only guaranteed to be
- * valid until the application makes another call to any vpx_codec_* function.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an output data packet (compressed frame data,
- * two-pass statistics, etc.) or NULL to signal end-of-list.
- *
- */
- const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
+/*!\brief Encoded data iterator
+ *
+ * Iterates over a list of data packets to be passed from the encoder to the
+ * application. The different kinds of packets available are enumerated in
+ * #vpx_codec_cx_pkt_kind.
+ *
+ * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
+ * muxer. Multiple compressed frames may be in the list.
+ * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
+ *
+ * The application \ref MUST silently ignore any packet kinds that it does
+ * not recognize or support.
+ *
+ * The data buffers returned from this function are only guaranteed to be
+ * valid until the application makes another call to any vpx_codec_* function.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an output data packet (compressed frame data,
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
+ *
+ */
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
- /*!\brief Get Preview Frame
- *
- * Returns an image that can be used as a preview. Shows the image as it would
- * exist at the decompressor. The application \ref MUST NOT write into this
- * image buffer.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \return Returns a pointer to a preview image, or NULL if no image is
- * available.
- *
- */
- const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
+/*!\brief Get Preview Frame
+ *
+ * Returns an image that can be used as a preview. Shows the image as it would
+ * exist at the decompressor. The application \ref MUST NOT write into this
+ * image buffer.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \return Returns a pointer to a preview image, or NULL if no image is
+ * available.
+ *
+ */
+const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
- /*!@} - end defgroup encoder*/
+/*!@} - end defgroup encoder*/
#endif
#ifdef __cplusplus
diff --git a/thirdparties/mac/include/vpx/vpx_image.h b/thirdparties/mac/include/vpx/vpx_image.h
index 3e42447..b3e6ed7 100755
--- a/thirdparties/mac/include/vpx/vpx_image.h
+++ b/thirdparties/mac/include/vpx/vpx_image.h
@@ -20,14 +20,14 @@ extern "C" {
#ifndef VPX_IMAGE_H
#define VPX_IMAGE_H
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/
@@ -36,41 +36,41 @@ extern "C" {
#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component */
- /*!\brief List of supported image formats */
- typedef enum vpx_img_fmt {
- VPX_IMG_FMT_NONE,
- VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
- VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
- VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */
- VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */
- VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */
- VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */
- VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */
- VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */
- VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */
- VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */
- VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */
- VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */
- VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */
- VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */
- VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2,
- VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */
- VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format with vpx color space */
- }
- vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
+/*!\brief List of supported image formats */
+typedef enum vpx_img_fmt {
+ VPX_IMG_FMT_NONE,
+ VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
+ VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
+ VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */
+ VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */
+ VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */
+ VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */
+ VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */
+ VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */
+ VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */
+ VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */
+ VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */
+ VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */
+ VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */
+ VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */
+ VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2,
+ VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */
+ VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format with vpx color space */
+}
+vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
#define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_IMG_FMT_PLANAR */
#define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_IMG_FMT_UV_FLIP */
#define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_IMG_FMT_HAS_ALPHA */
- /*!\brief Deprecated list of supported image formats
- * \deprecated New code should use #vpx_img_fmt
- */
+/*!\brief Deprecated list of supported image formats
+ * \deprecated New code should use #vpx_img_fmt
+ */
#define img_fmt vpx_img_fmt
- /*!\brief alias for enum img_fmt.
- * \deprecated New code should use #vpx_img_fmt_t
- */
+/*!\brief alias for enum img_fmt.
+ * \deprecated New code should use #vpx_img_fmt_t
+ */
#define img_fmt_t vpx_img_fmt_t
#define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_FMT_NONE */
@@ -93,24 +93,23 @@ extern "C" {
#define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_FMT_VPXI420 */
#endif /* VPX_CODEC_DISABLE_COMPAT */
- /**\brief Image Descriptor */
- typedef struct vpx_image
- {
- vpx_img_fmt_t fmt; /**< Image Format */
+/**\brief Image Descriptor */
+typedef struct vpx_image {
+ vpx_img_fmt_t fmt; /**< Image Format */
- /* Image storage dimensions */
- unsigned int w; /**< Stored image width */
- unsigned int h; /**< Stored image height */
+ /* Image storage dimensions */
+ unsigned int w; /**< Stored image width */
+ unsigned int h; /**< Stored image height */
- /* Image display dimensions */
- unsigned int d_w; /**< Displayed image width */
- unsigned int d_h; /**< Displayed image height */
+ /* Image display dimensions */
+ unsigned int d_w; /**< Displayed image width */
+ unsigned int d_h; /**< Displayed image height */
- /* Chroma subsampling info */
- unsigned int x_chroma_shift; /**< subsampling order, X */
- unsigned int y_chroma_shift; /**< subsampling order, Y */
+ /* Chroma subsampling info */
+ unsigned int x_chroma_shift; /**< subsampling order, X */
+ unsigned int y_chroma_shift; /**< subsampling order, Y */
- /* Image data pointers. */
+ /* Image data pointers. */
#define VPX_PLANE_PACKED 0 /**< To be used for all packed formats */
#define VPX_PLANE_Y 0 /**< Y (Luminance) plane */
#define VPX_PLANE_U 1 /**< U (Chroma) plane */
@@ -123,119 +122,118 @@ extern "C" {
#define PLANE_V VPX_PLANE_V
#define PLANE_ALPHA VPX_PLANE_ALPHA
#endif
- unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */
- int stride[4]; /**< stride between rows for each plane */
+ unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */
+ int stride[4]; /**< stride between rows for each plane */
- int bps; /**< bits per sample (for packed formats) */
+ int bps; /**< bits per sample (for packed formats) */
- /* The following member may be set by the application to associate data
- * with this image.
- */
- void *user_priv; /**< may be set by the application to associate data
+ /* The following member may be set by the application to associate data
+ * with this image.
+ */
+ void *user_priv; /**< may be set by the application to associate data
* with this image. */
- /* The following members should be treated as private. */
- unsigned char *img_data; /**< private */
- int img_data_owner; /**< private */
- int self_allocd; /**< private */
- } vpx_image_t; /**< alias for struct vpx_image */
-
- /**\brief Representation of a rectangle on a surface */
- typedef struct vpx_image_rect
- {
- unsigned int x; /**< leftmost column */
- unsigned int y; /**< topmost row */
- unsigned int w; /**< width */
- unsigned int h; /**< height */
- } vpx_image_rect_t; /**< alias for struct vpx_image_rect */
-
- /*!\brief Open a descriptor, allocating storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for the descriptor is allocated on the heap.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of the image buffer and
- * each row in the image(stride).
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_alloc(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align);
-
- /*!\brief Open a descriptor, using existing storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for descriptor has been allocated elsewhere, and a descriptor is
- * desired to "wrap" that storage.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of each row in the image.
- * \param[in] img_data Storage to use for the image
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_wrap(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align,
- unsigned char *img_data);
-
-
- /*!\brief Set the rectangle identifying the displayed portion of the image
- *
- * Updates the displayed rectangle (aka viewport) on the image surface to
- * match the specified coordinates and size.
- *
- * \param[in] img Image descriptor
- * \param[in] x leftmost column
- * \param[in] y topmost row
- * \param[in] w width
- * \param[in] h height
- *
- * \return 0 if the requested rectangle is valid, nonzero otherwise.
- */
- int vpx_img_set_rect(vpx_image_t *img,
- unsigned int x,
- unsigned int y,
- unsigned int w,
- unsigned int h);
-
-
- /*!\brief Flip the image vertically (top for bottom)
- *
- * Adjusts the image descriptor's pointers and strides to make the image
- * be referenced upside-down.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_flip(vpx_image_t *img);
+ /* The following members should be treated as private. */
+ unsigned char *img_data; /**< private */
+ int img_data_owner; /**< private */
+ int self_allocd; /**< private */
+} vpx_image_t; /**< alias for struct vpx_image */
+
+/**\brief Representation of a rectangle on a surface */
+typedef struct vpx_image_rect {
+ unsigned int x; /**< leftmost column */
+ unsigned int y; /**< topmost row */
+ unsigned int w; /**< width */
+ unsigned int h; /**< height */
+} vpx_image_rect_t; /**< alias for struct vpx_image_rect */
+
+/*!\brief Open a descriptor, allocating storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for the descriptor is allocated on the heap.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of the image buffer and
+ * each row in the image(stride).
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_alloc(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align);
- /*!\brief Close an image descriptor
- *
- * Frees all allocated storage associated with an image descriptor.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_free(vpx_image_t *img);
+/*!\brief Open a descriptor, using existing storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for descriptor has been allocated elsewhere, and a descriptor is
+ * desired to "wrap" that storage.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of each row in the image.
+ * \param[in] img_data Storage to use for the image
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_wrap(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align,
+ unsigned char *img_data);
+
+
+/*!\brief Set the rectangle identifying the displayed portion of the image
+ *
+ * Updates the displayed rectangle (aka viewport) on the image surface to
+ * match the specified coordinates and size.
+ *
+ * \param[in] img Image descriptor
+ * \param[in] x leftmost column
+ * \param[in] y topmost row
+ * \param[in] w width
+ * \param[in] h height
+ *
+ * \return 0 if the requested rectangle is valid, nonzero otherwise.
+ */
+int vpx_img_set_rect(vpx_image_t *img,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h);
+
+
+/*!\brief Flip the image vertically (top for bottom)
+ *
+ * Adjusts the image descriptor's pointers and strides to make the image
+ * be referenced upside-down.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_flip(vpx_image_t *img);
+
+/*!\brief Close an image descriptor
+ *
+ * Frees all allocated storage associated with an image descriptor.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_free(vpx_image_t *img);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/mac/include/webrtc/echo_cancellation.h b/thirdparties/mac/include/webrtc/echo_cancellation.h
index dc64a34..7ca1f26 100755
--- a/thirdparties/mac/include/webrtc/echo_cancellation.h
+++ b/thirdparties/mac/include/webrtc/echo_cancellation.h
@@ -24,36 +24,36 @@
#define AEC_BAD_PARAMETER_WARNING 12050
enum {
- kAecNlpConservative = 0,
- kAecNlpModerate,
- kAecNlpAggressive
+ kAecNlpConservative = 0,
+ kAecNlpModerate,
+ kAecNlpAggressive
};
enum {
- kAecFalse = 0,
- kAecTrue
+ kAecFalse = 0,
+ kAecTrue
};
typedef struct {
- int16_t nlpMode; // default kAecNlpModerate
- int16_t skewMode; // default kAecFalse
- int16_t metricsMode; // default kAecFalse
- int delay_logging; // default kAecFalse
- // float realSkew;
+ int16_t nlpMode; // default kAecNlpModerate
+ int16_t skewMode; // default kAecFalse
+ int16_t metricsMode; // default kAecFalse
+ int delay_logging; // default kAecFalse
+ // float realSkew;
} AecConfig;
typedef struct {
- int instant;
- int average;
- int max;
- int min;
+ int instant;
+ int average;
+ int max;
+ int min;
} AecLevel;
typedef struct {
- AecLevel rerl;
- AecLevel erl;
- AecLevel erle;
- AecLevel aNlp;
+ AecLevel rerl;
+ AecLevel erl;
+ AecLevel erle;
+ AecLevel aNlp;
} AecMetrics;
struct AecCore;
diff --git a/thirdparties/s60/include/curl/curl.h b/thirdparties/s60/include/curl/curl.h
index 973fdcc..0897d98 100755
--- a/thirdparties/s60/include/curl/curl.h
+++ b/thirdparties/s60/include/curl/curl.h
@@ -128,19 +128,19 @@ typedef int curl_socket_t;
#endif /* curl_socket_typedef */
struct curl_httppost {
- struct curl_httppost *next; /* next entry in the list */
- char *name; /* pointer to allocated name */
- long namelength; /* length of name length */
- char *contents; /* pointer to allocated data contents */
- long contentslength; /* length of contents field */
- char *buffer; /* pointer to allocated buffer contents */
- long bufferlength; /* length of buffer field */
- char *contenttype; /* Content-Type */
- struct curl_slist* contentheader; /* list of extra headers for this form */
- struct curl_httppost *more; /* if one field name has more than one
+ struct curl_httppost *next; /* next entry in the list */
+ char *name; /* pointer to allocated name */
+ long namelength; /* length of name length */
+ char *contents; /* pointer to allocated data contents */
+ long contentslength; /* length of contents field */
+ char *buffer; /* pointer to allocated buffer contents */
+ long bufferlength; /* length of buffer field */
+ char *contenttype; /* Content-Type */
+ struct curl_slist* contentheader; /* list of extra headers for this form */
+ struct curl_httppost *more; /* if one field name has more than one
file, this link should link to following
files */
- long flags; /* as defined below */
+ long flags; /* as defined below */
#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
@@ -154,10 +154,10 @@ struct curl_httppost {
and pass the given pointer as custom
pointer */
- char *showfilename; /* The file name to show. If not set, the
+ char *showfilename; /* The file name to show. If not set, the
actual file name will be used (if this
is a file part) */
- void *userp; /* custom pointer used for
+ void *userp; /* custom pointer used for
HTTPPOST_CALLBACK posts */
};
@@ -168,10 +168,10 @@ typedef int (*curl_progress_callback)(void *clientp,
double ulnow);
#ifndef CURL_MAX_WRITE_SIZE
- /* Tests have proven that 20K is a very bad buffer size for uploads on
- Windows, while 16K for some odd reason performed a lot better.
- We do the ifndef check to allow this value to easier be changed at build
- time for those who feel adventurous. */
+/* Tests have proven that 20K is a very bad buffer size for uploads on
+ Windows, while 16K for some odd reason performed a lot better.
+ We do the ifndef check to allow this value to easier be changed at build
+ time for those who feel adventurous. */
#define CURL_MAX_WRITE_SIZE 16384
#endif
/* This is a magic return code for the write callback that, when returned,
@@ -199,13 +199,13 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_READFUNC_PAUSE 0x10000001
typedef size_t (*curl_read_callback)(char *buffer,
- size_t size,
- size_t nitems,
- void *instream);
+ size_t size,
+ size_t nitems,
+ void *instream);
typedef enum {
- CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
- CURLSOCKTYPE_LAST /* never use */
+ CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
+ CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
typedef int (*curl_sockopt_callback)(void *clientp,
@@ -213,13 +213,13 @@ typedef int (*curl_sockopt_callback)(void *clientp,
curlsocktype purpose);
struct curl_sockaddr {
- int family;
- int socktype;
- int protocol;
- unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
+ int family;
+ int socktype;
+ int protocol;
+ unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
turned really ugly and painful on the systems that
lack this type */
- struct sockaddr addr;
+ struct sockaddr addr;
};
typedef curl_socket_t
@@ -228,7 +228,7 @@ typedef curl_socket_t
struct curl_sockaddr *address);
#ifndef CURL_NO_OLDIES
- /* not used since 7.10.8, will be removed in a future release */
+/* not used since 7.10.8, will be removed in a future release */
typedef int (*curl_passwd_callback)(void *clientp,
const char *prompt,
char *buffer,
@@ -236,21 +236,21 @@ typedef int (*curl_passwd_callback)(void *clientp,
#endif
typedef enum {
- CURLIOE_OK, /* I/O operation successful */
- CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
- CURLIOE_FAILRESTART, /* failed to restart the read */
- CURLIOE_LAST /* never use */
+ CURLIOE_OK, /* I/O operation successful */
+ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
+ CURLIOE_FAILRESTART, /* failed to restart the read */
+ CURLIOE_LAST /* never use */
} curlioerr;
typedef enum {
- CURLIOCMD_NOP, /* no operation */
- CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
- CURLIOCMD_LAST /* never use */
+ CURLIOCMD_NOP, /* no operation */
+ CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
+ CURLIOCMD_LAST /* never use */
} curliocmd;
typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
- int cmd,
- void *clientp);
+ int cmd,
+ void *clientp);
/*
* The following typedef's are signatures of malloc, free, realloc, strdup and
@@ -266,22 +266,22 @@ typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
/* the kind of data that is passed to information_callback*/
typedef enum {
- CURLINFO_TEXT = 0,
- CURLINFO_HEADER_IN, /* 1 */
- CURLINFO_HEADER_OUT, /* 2 */
- CURLINFO_DATA_IN, /* 3 */
- CURLINFO_DATA_OUT, /* 4 */
- CURLINFO_SSL_DATA_IN, /* 5 */
- CURLINFO_SSL_DATA_OUT, /* 6 */
- CURLINFO_END
+ CURLINFO_TEXT = 0,
+ CURLINFO_HEADER_IN, /* 1 */
+ CURLINFO_HEADER_OUT, /* 2 */
+ CURLINFO_DATA_IN, /* 3 */
+ CURLINFO_DATA_OUT, /* 4 */
+ CURLINFO_SSL_DATA_IN, /* 5 */
+ CURLINFO_SSL_DATA_OUT, /* 6 */
+ CURLINFO_END
} curl_infotype;
typedef int (*curl_debug_callback)
- (CURL *handle, /* the handle/transfer this concerns */
- curl_infotype type, /* what kind of data */
- char *data, /* points to the data */
- size_t size, /* size of the data pointed to */
- void *userptr); /* whatever the user please */
+(CURL *handle, /* the handle/transfer this concerns */
+ curl_infotype type, /* what kind of data */
+ char *data, /* points to the data */
+ size_t size, /* size of the data pointed to */
+ void *userptr); /* whatever the user please */
/* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
@@ -291,114 +291,114 @@ typedef int (*curl_debug_callback)
*/
typedef enum {
- CURLE_OK = 0,
- CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
- CURLE_FAILED_INIT, /* 2 */
- CURLE_URL_MALFORMAT, /* 3 */
- CURLE_OBSOLETE4, /* 4 - NOT USED */
- CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
- CURLE_COULDNT_RESOLVE_HOST, /* 6 */
- CURLE_COULDNT_CONNECT, /* 7 */
- CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
- CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
+ CURLE_OK = 0,
+ CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
+ CURLE_FAILED_INIT, /* 2 */
+ CURLE_URL_MALFORMAT, /* 3 */
+ CURLE_OBSOLETE4, /* 4 - NOT USED */
+ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
+ CURLE_COULDNT_RESOLVE_HOST, /* 6 */
+ CURLE_COULDNT_CONNECT, /* 7 */
+ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
+ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
- CURLE_OBSOLETE10, /* 10 - NOT USED */
- CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
- CURLE_OBSOLETE12, /* 12 - NOT USED */
- CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
- CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
- CURLE_FTP_CANT_GET_HOST, /* 15 */
- CURLE_OBSOLETE16, /* 16 - NOT USED */
- CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
- CURLE_PARTIAL_FILE, /* 18 */
- CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
- CURLE_OBSOLETE20, /* 20 - NOT USED */
- CURLE_QUOTE_ERROR, /* 21 - quote command failure */
- CURLE_HTTP_RETURNED_ERROR, /* 22 */
- CURLE_WRITE_ERROR, /* 23 */
- CURLE_OBSOLETE24, /* 24 - NOT USED */
- CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
- CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
- CURLE_OUT_OF_MEMORY, /* 27 */
- /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
- instead of a memory allocation error if CURL_DOES_CONVERSIONS
- is defined
- */
- CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
- CURLE_OBSOLETE29, /* 29 - NOT USED */
- CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
- CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
- CURLE_OBSOLETE32, /* 32 - NOT USED */
- CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
- CURLE_HTTP_POST_ERROR, /* 34 */
- CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
- CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
- CURLE_FILE_COULDNT_READ_FILE, /* 37 */
- CURLE_LDAP_CANNOT_BIND, /* 38 */
- CURLE_LDAP_SEARCH_FAILED, /* 39 */
- CURLE_OBSOLETE40, /* 40 - NOT USED */
- CURLE_FUNCTION_NOT_FOUND, /* 41 */
- CURLE_ABORTED_BY_CALLBACK, /* 42 */
- CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
- CURLE_OBSOLETE44, /* 44 - NOT USED */
- CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
- CURLE_OBSOLETE46, /* 46 - NOT USED */
- CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
- CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
- CURLE_OBSOLETE50, /* 50 - NOT USED */
- CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
+ CURLE_OBSOLETE10, /* 10 - NOT USED */
+ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
+ CURLE_OBSOLETE12, /* 12 - NOT USED */
+ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
+ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
+ CURLE_FTP_CANT_GET_HOST, /* 15 */
+ CURLE_OBSOLETE16, /* 16 - NOT USED */
+ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
+ CURLE_PARTIAL_FILE, /* 18 */
+ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
+ CURLE_OBSOLETE20, /* 20 - NOT USED */
+ CURLE_QUOTE_ERROR, /* 21 - quote command failure */
+ CURLE_HTTP_RETURNED_ERROR, /* 22 */
+ CURLE_WRITE_ERROR, /* 23 */
+ CURLE_OBSOLETE24, /* 24 - NOT USED */
+ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
+ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
+ CURLE_OUT_OF_MEMORY, /* 27 */
+ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
+ instead of a memory allocation error if CURL_DOES_CONVERSIONS
+ is defined
+ */
+ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
+ CURLE_OBSOLETE29, /* 29 - NOT USED */
+ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
+ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
+ CURLE_OBSOLETE32, /* 32 - NOT USED */
+ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
+ CURLE_HTTP_POST_ERROR, /* 34 */
+ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
+ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
+ CURLE_FILE_COULDNT_READ_FILE, /* 37 */
+ CURLE_LDAP_CANNOT_BIND, /* 38 */
+ CURLE_LDAP_SEARCH_FAILED, /* 39 */
+ CURLE_OBSOLETE40, /* 40 - NOT USED */
+ CURLE_FUNCTION_NOT_FOUND, /* 41 */
+ CURLE_ABORTED_BY_CALLBACK, /* 42 */
+ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
+ CURLE_OBSOLETE44, /* 44 - NOT USED */
+ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
+ CURLE_OBSOLETE46, /* 46 - NOT USED */
+ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
+ CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
+ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
+ CURLE_OBSOLETE50, /* 50 - NOT USED */
+ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
wasn't verified fine */
- CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
- CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
- CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
+ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
+ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
+ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
default */
- CURLE_SEND_ERROR, /* 55 - failed sending network data */
- CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
- CURLE_OBSOLETE57, /* 57 - NOT IN USE */
- CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
- CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
- CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
- CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
- CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
- CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
- CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
+ CURLE_SEND_ERROR, /* 55 - failed sending network data */
+ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
+ CURLE_OBSOLETE57, /* 57 - NOT IN USE */
+ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
+ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
+ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
+ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
+ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
+ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
+ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
+ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
that failed */
- CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
- CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
+ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
+ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
accepted and we failed to login */
- CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
- CURLE_TFTP_PERM, /* 69 - permission problem on server */
- CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
- CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
- CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
- CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
- CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
- CURLE_CONV_FAILED, /* 75 - conversion failed */
- CURLE_CONV_REQD, /* 76 - caller must register conversion
+ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
+ CURLE_TFTP_PERM, /* 69 - permission problem on server */
+ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
+ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
+ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
+ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
+ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
+ CURLE_CONV_FAILED, /* 75 - conversion failed */
+ CURLE_CONV_REQD, /* 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION */
- CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
+ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
- CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
- CURLE_SSH, /* 79 - error from the SSH layer, somewhat
+ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
+ CURLE_SSH, /* 79 - error from the SSH layer, somewhat
generic so the error message will be of
interest when this has happened */
- CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
+ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
connection */
- CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
+ CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
wait till it's ready and try again (Added
in 7.18.2) */
- CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
+ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
wrong format (Added in 7.19.0) */
- CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
+ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
7.19.0) */
- CURL_LAST /* never use! */
+ CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -456,20 +456,20 @@ typedef enum {
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
- void *ssl_ctx, /* actually an
+ void *ssl_ctx, /* actually an
OpenSSL SSL_CTX */
- void *userptr);
+ void *userptr);
typedef enum {
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
+ CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
+ CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
+ CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
+ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
+ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
+ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
host name rather than the IP address. added
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
@@ -494,51 +494,51 @@ typedef enum {
#define CURL_ERROR_SIZE 256
struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
+ const char *key; /* points to a zero-terminated string encoded with base64
if len is zero, otherwise to the "raw" data */
- size_t len;
- enum type {
- CURLKHTYPE_UNKNOWN,
- CURLKHTYPE_RSA1,
- CURLKHTYPE_RSA,
- CURLKHTYPE_DSS
- } keytype;
+ size_t len;
+ enum type {
+ CURLKHTYPE_UNKNOWN,
+ CURLKHTYPE_RSA1,
+ CURLKHTYPE_RSA,
+ CURLKHTYPE_DSS
+ } keytype;
};
/* this is the set of return values expected from the curl_sshkeycallback
callback */
enum curl_khstat {
- CURLKHSTAT_FINE_ADD_TO_FILE,
- CURLKHSTAT_FINE,
- CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
+ CURLKHSTAT_FINE_ADD_TO_FILE,
+ CURLKHSTAT_FINE,
+ CURLKHSTAT_REJECT, /* reject the connection, return an error */
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
this causes a CURLE_DEFER error but otherwise the
connection will be left intact etc */
- CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
+ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
};
/* this is the set of status codes pass in to the callback */
enum curl_khmatch {
- CURLKHMATCH_OK, /* match */
- CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
- CURLKHMATCH_MISSING, /* no matching host/key found */
- CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
+ CURLKHMATCH_OK, /* match */
+ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
+ CURLKHMATCH_MISSING, /* no matching host/key found */
+ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
};
typedef int
- (*curl_sshkeycallback) (CURL *easy, /* easy handle */
- const struct curl_khkey *knownkey, /* known */
- const struct curl_khkey *foundkey, /* found */
- enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
+(*curl_sshkeycallback) (CURL *easy, /* easy handle */
+ const struct curl_khkey *knownkey, /* known */
+ const struct curl_khkey *foundkey, /* found */
+ enum curl_khmatch, /* libcurl's view on the keys */
+ void *clientp); /* custom pointer passed from app */
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
- CURLUSESSL_NONE, /* do not attempt to use SSL */
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
- CURLUSESSL_ALL, /* SSL for all communication or fail */
- CURLUSESSL_LAST /* not an option, never use */
+ CURLUSESSL_NONE, /* do not attempt to use SSL */
+ CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
+ CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
+ CURLUSESSL_ALL, /* SSL for all communication or fail */
+ CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -557,38 +557,38 @@ typedef enum {
/* parameter for the CURLOPT_FTP_SSL_CCC option */
typedef enum {
- CURLFTPSSL_CCC_NONE, /* do not send CCC */
- CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
- CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
- CURLFTPSSL_CCC_LAST /* not an option, never use */
+ CURLFTPSSL_CCC_NONE, /* do not send CCC */
+ CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
+ CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
+ CURLFTPSSL_CCC_LAST /* not an option, never use */
} curl_ftpccc;
/* parameter for the CURLOPT_FTPSSLAUTH option */
typedef enum {
- CURLFTPAUTH_DEFAULT, /* let libcurl decide */
- CURLFTPAUTH_SSL, /* use "AUTH SSL" */
- CURLFTPAUTH_TLS, /* use "AUTH TLS" */
- CURLFTPAUTH_LAST /* not an option, never use */
+ CURLFTPAUTH_DEFAULT, /* let libcurl decide */
+ CURLFTPAUTH_SSL, /* use "AUTH SSL" */
+ CURLFTPAUTH_TLS, /* use "AUTH TLS" */
+ CURLFTPAUTH_LAST /* not an option, never use */
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
typedef enum {
- CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
- CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
+ CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic */
- CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! */
- CURLFTP_CREATE_DIR_LAST /* not an option, never use */
+ CURLFTP_CREATE_DIR_LAST /* not an option, never use */
} curl_ftpcreatedir;
/* parameter for the CURLOPT_FTP_FILEMETHOD option */
typedef enum {
- CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
- CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
- CURLFTPMETHOD_NOCWD, /* no CWD at all */
- CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
- CURLFTPMETHOD_LAST /* not an option, never use */
+ CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
+ CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
+ CURLFTPMETHOD_NOCWD, /* no CWD at all */
+ CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
+ CURLFTPMETHOD_LAST /* not an option, never use */
} curl_ftpmethod;
/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
@@ -638,632 +638,632 @@ typedef enum {
*/
typedef enum {
- /* This is the FILE * or void * the regular output should be written to. */
- CINIT(FILE, OBJECTPOINT, 1),
+ /* This is the FILE * or void * the regular output should be written to. */
+ CINIT(FILE, OBJECTPOINT, 1),
+
+ /* The full URL to get/put */
+ CINIT(URL, OBJECTPOINT, 2),
+
+ /* Port number to connect to, if other than default. */
+ CINIT(PORT, LONG, 3),
- /* The full URL to get/put */
- CINIT(URL, OBJECTPOINT, 2),
+ /* Name of proxy to use. */
+ CINIT(PROXY, OBJECTPOINT, 4),
- /* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
+ /* "name:password" to use when fetching. */
+ CINIT(USERPWD, OBJECTPOINT, 5),
- /* Name of proxy to use. */
- CINIT(PROXY, OBJECTPOINT, 4),
+ /* "name:password" to use with proxy. */
+ CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
- /* "name:password" to use when fetching. */
- CINIT(USERPWD, OBJECTPOINT, 5),
+ /* Range to get, specified as an ASCII string. */
+ CINIT(RANGE, OBJECTPOINT, 7),
- /* "name:password" to use with proxy. */
- CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
+ /* not used */
- /* Range to get, specified as an ASCII string. */
- CINIT(RANGE, OBJECTPOINT, 7),
+ /* Specified file stream to upload from (use as input): */
+ CINIT(INFILE, OBJECTPOINT, 9),
- /* not used */
+ /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
+ * bytes big. If this is not used, error messages go to stderr instead: */
+ CINIT(ERRORBUFFER, OBJECTPOINT, 10),
- /* Specified file stream to upload from (use as input): */
- CINIT(INFILE, OBJECTPOINT, 9),
+ /* Function that will be called to store the output (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
- /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
- * bytes big. If this is not used, error messages go to stderr instead: */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
+ /* Function that will be called to read the input (instead of fread). The
+ * parameters will use fread() syntax, make sure to follow them. */
+ CINIT(READFUNCTION, FUNCTIONPOINT, 12),
- /* Function that will be called to store the output (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
+ /* Time-out the read operation after this amount of seconds */
+ CINIT(TIMEOUT, LONG, 13),
- /* Function that will be called to read the input (instead of fread). The
- * parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
+ /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
+ * how large the file being sent really is. That allows better error
+ * checking and better verifies that the upload was successful. -1 means
+ * unknown size.
+ *
+ * For large file support, there is also a _LARGE version of the key
+ * which takes an off_t type, allowing platforms with larger off_t
+ * sizes to handle larger files. See below for INFILESIZE_LARGE.
+ */
+ CINIT(INFILESIZE, LONG, 14),
- /* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
+ /* POST static input fields. */
+ CINIT(POSTFIELDS, OBJECTPOINT, 15),
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
- * how large the file being sent really is. That allows better error
- * checking and better verifies that the upload was successful. -1 means
- * unknown size.
- *
- * For large file support, there is also a _LARGE version of the key
- * which takes an off_t type, allowing platforms with larger off_t
- * sizes to handle larger files. See below for INFILESIZE_LARGE.
- */
- CINIT(INFILESIZE, LONG, 14),
+ /* Set the referrer page (needed by some CGIs) */
+ CINIT(REFERER, OBJECTPOINT, 16),
- /* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
+ /* Set the FTP PORT string (interface name, named or numerical IP address)
+ Use i.e '-' to use default address. */
+ CINIT(FTPPORT, OBJECTPOINT, 17),
- /* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, OBJECTPOINT, 16),
+ /* Set the User-Agent string (examined by some CGIs) */
+ CINIT(USERAGENT, OBJECTPOINT, 18),
- /* Set the FTP PORT string (interface name, named or numerical IP address)
- Use i.e '-' to use default address. */
- CINIT(FTPPORT, OBJECTPOINT, 17),
+ /* If the download receives less than "low speed limit" bytes/second
+ * during "low speed time" seconds, the operations is aborted.
+ * You could i.e if you have a pretty high speed connection, abort if
+ * it is less than 2000 bytes/sec during 20 seconds.
+ */
- /* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, OBJECTPOINT, 18),
+ /* Set the "low speed limit" */
+ CINIT(LOW_SPEED_LIMIT, LONG, 19),
- /* If the download receives less than "low speed limit" bytes/second
- * during "low speed time" seconds, the operations is aborted.
- * You could i.e if you have a pretty high speed connection, abort if
- * it is less than 2000 bytes/sec during 20 seconds.
- */
+ /* Set the "low speed time" */
+ CINIT(LOW_SPEED_TIME, LONG, 20),
- /* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
+ /* Set the continuation offset.
+ *
+ * Note there is also a _LARGE version of this key which uses
+ * off_t types, allowing for large file offsets on platforms which
+ * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
+ */
+ CINIT(RESUME_FROM, LONG, 21),
- /* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
+ /* Set cookie in request: */
+ CINIT(COOKIE, OBJECTPOINT, 22),
- /* Set the continuation offset.
- *
- * Note there is also a _LARGE version of this key which uses
- * off_t types, allowing for large file offsets on platforms which
- * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
- */
- CINIT(RESUME_FROM, LONG, 21),
+ /* This points to a linked list of headers, struct curl_slist kind */
+ CINIT(HTTPHEADER, OBJECTPOINT, 23),
- /* Set cookie in request: */
- CINIT(COOKIE, OBJECTPOINT, 22),
+ /* This points to a linked list of post entries, struct curl_httppost */
+ CINIT(HTTPPOST, OBJECTPOINT, 24),
- /* This points to a linked list of headers, struct curl_slist kind */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
+ /* name of the file keeping your private SSL-certificate */
+ CINIT(SSLCERT, OBJECTPOINT, 25),
- /* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
+ /* password for the SSL or SSH private key */
+ CINIT(KEYPASSWD, OBJECTPOINT, 26),
- /* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, OBJECTPOINT, 25),
+ /* send TYPE parameter? */
+ CINIT(CRLF, LONG, 27),
- /* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, OBJECTPOINT, 26),
+ /* send linked-list of QUOTE commands */
+ CINIT(QUOTE, OBJECTPOINT, 28),
- /* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
+ /* send FILE * or void * to store headers to, if you use a callback it
+ is simply passed to the callback unmodified */
+ CINIT(WRITEHEADER, OBJECTPOINT, 29),
- /* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
+ /* point to a file to read the initial cookies from, also enables
+ "cookie awareness" */
+ CINIT(COOKIEFILE, OBJECTPOINT, 31),
- /* send FILE * or void * to store headers to, if you use a callback it
- is simply passed to the callback unmodified */
- CINIT(WRITEHEADER, OBJECTPOINT, 29),
+ /* What version to specifically try to use.
+ See CURL_SSLVERSION defines below. */
+ CINIT(SSLVERSION, LONG, 32),
- /* point to a file to read the initial cookies from, also enables
- "cookie awareness" */
- CINIT(COOKIEFILE, OBJECTPOINT, 31),
+ /* What kind of HTTP time condition to use, see defines */
+ CINIT(TIMECONDITION, LONG, 33),
- /* What version to specifically try to use.
- See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
+ /* Time to use with the above condition. Specified in number of seconds
+ since 1 Jan 1970 */
+ CINIT(TIMEVALUE, LONG, 34),
- /* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
+ /* 35 = OBSOLETE */
- /* Time to use with the above condition. Specified in number of seconds
- since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
+ /* Custom request, for customizing the get command like
+ HTTP: DELETE, TRACE and others
+ FTP: to use a different list command
+ */
+ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
- /* 35 = OBSOLETE */
+ /* HTTP request, for odd commands like DELETE, TRACE and others */
+ CINIT(STDERR, OBJECTPOINT, 37),
- /* Custom request, for customizing the get command like
- HTTP: DELETE, TRACE and others
- FTP: to use a different list command
- */
- CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
+ /* 38 is not used */
+
+ /* send linked-list of post-transfer QUOTE commands */
+ CINIT(POSTQUOTE, OBJECTPOINT, 39),
+
+ /* Pass a pointer to string of the output using full variable-replacement
+ as described elsewhere. */
+ CINIT(WRITEINFO, OBJECTPOINT, 40),
+
+ CINIT(VERBOSE, LONG, 41), /* talk a lot */
+ CINIT(HEADER, LONG, 42), /* throw the header out too */
+ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
+ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
+ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
+ CINIT(UPLOAD, LONG, 46), /* this is an upload */
+ CINIT(POST, LONG, 47), /* HTTP POST method */
+ CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+
+ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+
+ /* Specify whether to read the user+password from the .netrc or the URL.
+ * This must be one of the CURL_NETRC_* enums below. */
+ CINIT(NETRC, LONG, 51),
+
+ CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+
+ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
+ CINIT(PUT, LONG, 54), /* HTTP PUT */
+
+ /* 55 = OBSOLETE */
- /* HTTP request, for odd commands like DELETE, TRACE and others */
- CINIT(STDERR, OBJECTPOINT, 37),
+ /* Function that will be called instead of the internal progress display
+ * function. This function should be defined as the curl_progress_callback
+ * prototype defines. */
+ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
- /* 38 is not used */
+ /* Data passed to the progress callback */
+ CINIT(PROGRESSDATA, OBJECTPOINT, 57),
- /* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
+ /* We want the referrer field set automatically when following locations */
+ CINIT(AUTOREFERER, LONG, 58),
- /* Pass a pointer to string of the output using full variable-replacement
- as described elsewhere. */
- CINIT(WRITEINFO, OBJECTPOINT, 40),
+ /* Port of the proxy, can be set in the proxy string as well with:
+ "[host]:[port]" */
+ CINIT(PROXYPORT, LONG, 59),
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+ /* size of the POST input data, if strlen() is not good to use */
+ CINIT(POSTFIELDSIZE, LONG, 60),
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+ /* tunnel non-http operations through a HTTP proxy */
+ CINIT(HTTPPROXYTUNNEL, LONG, 61),
- /* Specify whether to read the user+password from the .netrc or the URL.
- * This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
+ /* Set the interface string to use as outgoing network interface */
+ CINIT(INTERFACE, OBJECTPOINT, 62),
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+ /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
+ * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
+ * is set but doesn't match one of these, 'private' will be used. */
+ CINIT(KRBLEVEL, OBJECTPOINT, 63),
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
+ /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
+ CINIT(SSL_VERIFYPEER, LONG, 64),
- /* 55 = OBSOLETE */
+ /* The CApath or CAfile used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAINFO, OBJECTPOINT, 65),
- /* Function that will be called instead of the internal progress display
- * function. This function should be defined as the curl_progress_callback
- * prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
+ /* 66 = OBSOLETE */
+ /* 67 = OBSOLETE */
- /* Data passed to the progress callback */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
+ /* Maximum number of http redirects to follow */
+ CINIT(MAXREDIRS, LONG, 68),
- /* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
+ /* Pass a long set to 1 to get the date of the requested document (if
+ possible)! Pass a zero to shut it off. */
+ CINIT(FILETIME, LONG, 69),
- /* Port of the proxy, can be set in the proxy string as well with:
- "[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
+ /* This points to a linked list of telnet options */
+ CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
- /* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
+ /* Max amount of cached alive connections */
+ CINIT(MAXCONNECTS, LONG, 71),
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
+ /* What policy to use when closing connections when the cache is filled
+ up */
+ CINIT(CLOSEPOLICY, LONG, 72),
- /* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, OBJECTPOINT, 62),
+ /* 73 = OBSOLETE */
- /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
- * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
- * is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, OBJECTPOINT, 63),
+ /* Set to explicitly use a new connection for the upcoming transfer.
+ Do not use this unless you're absolutely sure of this, as it makes the
+ operation slower and is less friendly for the network. */
+ CINIT(FRESH_CONNECT, LONG, 74),
- /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
+ /* Set to explicitly forbid the upcoming transfer's connection to be re-used
+ when done. Do not use this unless you're absolutely sure of this, as it
+ makes the operation slower and is less friendly for the network. */
+ CINIT(FORBID_REUSE, LONG, 75),
- /* The CApath or CAfile used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, OBJECTPOINT, 65),
+ /* Set to a file name that contains random data for libcurl to use to
+ seed the random engine when doing SSL connects. */
+ CINIT(RANDOM_FILE, OBJECTPOINT, 76),
- /* 66 = OBSOLETE */
- /* 67 = OBSOLETE */
+ /* Set to the Entropy Gathering Daemon socket pathname */
+ CINIT(EGDSOCKET, OBJECTPOINT, 77),
- /* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
+ /* Time-out connect operations after this amount of seconds, if connects
+ are OK within this time, then fine... This only aborts the connect
+ phase. [Only works on unix-style/SIGALRM operating systems] */
+ CINIT(CONNECTTIMEOUT, LONG, 78),
- /* Pass a long set to 1 to get the date of the requested document (if
- possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
+ /* Function that will be called to store headers (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
- /* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
+ /* Set this to force the HTTP request to get back to GET. Only really usable
+ if POST, PUT or a custom request have been used first.
+ */
+ CINIT(HTTPGET, LONG, 80),
+
+ /* Set if we should verify the Common name from the peer certificate in ssl
+ * handshake, set 1 to check existence, 2 to ensure that it matches the
+ * provided hostname. */
+ CINIT(SSL_VERIFYHOST, LONG, 81),
+
+ /* Specify which file name to write all known cookies in after completed
+ operation. Set file name to "-" (dash) to make it go to stdout. */
+ CINIT(COOKIEJAR, OBJECTPOINT, 82),
+
+ /* Specify which SSL ciphers to use */
+ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+
+ /* Specify which HTTP version to use! This must be set to one of the
+ CURL_HTTP_VERSION* enums set below. */
+ CINIT(HTTP_VERSION, LONG, 84),
+
+ /* Specifically switch on or off the FTP engine's use of the EPSV command. By
+ default, that one will always be attempted before the more traditional
+ PASV command. */
+ CINIT(FTP_USE_EPSV, LONG, 85),
+
+ /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
+ CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+
+ /* name of the file keeping your private SSL-key */
+ CINIT(SSLKEY, OBJECTPOINT, 87),
- /* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
+ /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
+ CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
- /* What policy to use when closing connections when the cache is filled
- up */
- CINIT(CLOSEPOLICY, LONG, 72),
+ /* crypto engine for the SSL-sub system */
+ CINIT(SSLENGINE, OBJECTPOINT, 89),
- /* 73 = OBSOLETE */
+ /* set the crypto engine for the SSL-sub system as default
+ the param has no meaning...
+ */
+ CINIT(SSLENGINE_DEFAULT, LONG, 90),
+
+ /* Non-zero value means to use the global dns cache */
+ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+
+ /* DNS cache timeout */
+ CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+
+ /* send linked-list of pre-transfer QUOTE commands */
+ CINIT(PREQUOTE, OBJECTPOINT, 93),
- /* Set to explicitly use a new connection for the upcoming transfer.
- Do not use this unless you're absolutely sure of this, as it makes the
- operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
+ /* set the debug function */
+ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
- when done. Do not use this unless you're absolutely sure of this, as it
- makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
+ /* set the data for the debug function */
+ CINIT(DEBUGDATA, OBJECTPOINT, 95),
- /* Set to a file name that contains random data for libcurl to use to
- seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, OBJECTPOINT, 76),
+ /* mark this as start of a cookie session */
+ CINIT(COOKIESESSION, LONG, 96),
- /* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, OBJECTPOINT, 77),
+ /* The CApath directory used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAPATH, OBJECTPOINT, 97),
- /* Time-out connect operations after this amount of seconds, if connects
- are OK within this time, then fine... This only aborts the connect
- phase. [Only works on unix-style/SIGALRM operating systems] */
- CINIT(CONNECTTIMEOUT, LONG, 78),
+ /* Instruct libcurl to use a smaller receive buffer */
+ CINIT(BUFFERSIZE, LONG, 98),
- /* Function that will be called to store headers (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
+ /* Instruct libcurl to not use any signal/alarm handlers, even when using
+ timeouts. This option is useful for multi-threaded applications.
+ See libcurl-the-guide for more background information. */
+ CINIT(NOSIGNAL, LONG, 99),
- /* Set this to force the HTTP request to get back to GET. Only really usable
- if POST, PUT or a custom request have been used first.
- */
- CINIT(HTTPGET, LONG, 80),
+ /* Provide a CURLShare for mutexing non-ts data */
+ CINIT(SHARE, OBJECTPOINT, 100),
- /* Set if we should verify the Common name from the peer certificate in ssl
- * handshake, set 1 to check existence, 2 to ensure that it matches the
- * provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
+ /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
+ CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
+ CINIT(PROXYTYPE, LONG, 101),
- /* Specify which file name to write all known cookies in after completed
- operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, OBJECTPOINT, 82),
+ /* Set the Accept-Encoding string. Use this to tell a server you would like
+ the response to be compressed. */
+ CINIT(ENCODING, OBJECTPOINT, 102),
- /* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+ /* Set pointer to private data */
+ CINIT(PRIVATE, OBJECTPOINT, 103),
- /* Specify which HTTP version to use! This must be set to one of the
- CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
+ /* Set aliases for HTTP 200 in the HTTP Response header */
+ CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
- /* Specifically switch on or off the FTP engine's use of the EPSV command. By
- default, that one will always be attempted before the more traditional
- PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
+ /* Continue to send authentication (user+password) when following locations,
+ even when hostname changed. This can potentially send off the name
+ and password to whatever host the server decides. */
+ CINIT(UNRESTRICTED_AUTH, LONG, 105),
- /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+ /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
+ also disables the LPRT attempt). By default, those ones will always be
+ attempted before the good old traditional PORT command. */
+ CINIT(FTP_USE_EPRT, LONG, 106),
- /* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, OBJECTPOINT, 87),
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_USERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(HTTPAUTH, LONG, 107),
- /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
+ /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
+ in second argument. The function must be matching the
+ curl_ssl_ctx_callback proto. */
+ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
- /* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, OBJECTPOINT, 89),
+ /* Set the userdata for the ssl context callback function's third
+ argument */
+ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
- /* set the crypto engine for the SSL-sub system as default
- the param has no meaning...
- */
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
+ /* FTP Option that causes missing dirs to be created on the remote server.
+ In 7.19.4 we introduced the convenience enums for this option using the
+ CURLFTP_CREATE_DIR prefix.
+ */
+ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
- /* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(PROXYAUTH, LONG, 111),
- /* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+ /* FTP option that changes the timeout, in seconds, associated with
+ getting a response. This is different from transfer timeout time and
+ essentially places a demand on the FTP server to acknowledge commands
+ in a timely manner. */
+ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
- /* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
+ /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
+ tell libcurl to resolve names to those IP versions only. This only has
+ affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
+ CINIT(IPRESOLVE, LONG, 113),
- /* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
+ /* Set this option to limit the size of a file that will be downloaded from
+ an HTTP or FTP server.
- /* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
+ Note there is also _LARGE version which adds large file support for
+ platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
+ CINIT(MAXFILESIZE, LONG, 114),
- /* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
+ /* See the comment for INFILESIZE above, but in short, specifies
+ * the size of the file being uploaded. -1 means unknown.
+ */
+ CINIT(INFILESIZE_LARGE, OFF_T, 115),
- /* The CApath directory used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, OBJECTPOINT, 97),
+ /* Sets the continuation offset. There is also a LONG version of this;
+ * look above for RESUME_FROM.
+ */
+ CINIT(RESUME_FROM_LARGE, OFF_T, 116),
- /* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
-
- /* Instruct libcurl to not use any signal/alarm handlers, even when using
- timeouts. This option is useful for multi-threaded applications.
- See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
-
- /* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
-
- /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
- CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
-
- /* Set the Accept-Encoding string. Use this to tell a server you would like
- the response to be compressed. */
- CINIT(ENCODING, OBJECTPOINT, 102),
-
- /* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
-
- /* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
-
- /* Continue to send authentication (user+password) when following locations,
- even when hostname changed. This can potentially send off the name
- and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
-
- /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
- also disables the LPRT attempt). By default, those ones will always be
- attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_USERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
-
- /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
- in second argument. The function must be matching the
- curl_ssl_ctx_callback proto. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
-
- /* Set the userdata for the ssl context callback function's third
- argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
-
- /* FTP Option that causes missing dirs to be created on the remote server.
- In 7.19.4 we introduced the convenience enums for this option using the
- CURLFTP_CREATE_DIR prefix.
- */
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
-
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-
- /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
-
- /* Set this option to limit the size of a file that will be downloaded from
- an HTTP or FTP server.
-
- Note there is also _LARGE version which adds large file support for
- platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
-
- /* See the comment for INFILESIZE above, but in short, specifies
- * the size of the file being uploaded. -1 means unknown.
- */
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
-
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
- */
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
-
- /* Sets the maximum size of data that will be downloaded from
- * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
- */
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
-
- /* Set this option to the file name of your .netrc file you want libcurl
- to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
- a poor attempt to find the user's home directory and check for a .netrc
- file in there. */
- CINIT(NETRC_FILE, OBJECTPOINT, 118),
-
- /* Enable SSL/TLS for FTP, pick one of:
- CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
- CURLFTPSSL_CONTROL - SSL for the control connection or fail
- CURLFTPSSL_ALL - SSL for all communication or fail
- */
- CINIT(USE_SSL, LONG, 119),
-
- /* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
-
- /* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
-
- /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 123 OBSOLETE. Gone in 7.16.0 */
- /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 127 OBSOLETE. Gone in 7.16.0 */
- /* 128 OBSOLETE. Gone in 7.16.0 */
-
- /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
- can be used to change libcurl's default action which is to first try
- "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
- response has been received.
-
- Available parameters are:
- CURLFTPAUTH_DEFAULT - let libcurl decide
- CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
- CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
- */
- CINIT(FTPSSLAUTH, LONG, 129),
-
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
-
- /* 132 OBSOLETE. Gone in 7.16.0 */
- /* 133 OBSOLETE. Gone in 7.16.0 */
-
- /* zero terminated string for pass on to the FTP server when asked for
- "account" info */
- CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
-
- /* feed cookies into cookie engine */
- CINIT(COOKIELIST, OBJECTPOINT, 135),
-
- /* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
-
- /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
- response. Typically used for FTP-SSL purposes but is not restricted to
- that. libcurl will then instead use the same IP address it used for the
- control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
-
- /* Select "file method" to use when doing FTP, see the curl_ftpmethod
- above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
-
- /* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
-
- /* Number of ports to try, including the first one set with LOCALPORT.
- Thus, setting it to 1 will make no additional attempts but the first.
- */
- CINIT(LOCALPORTRANGE, LONG, 140),
-
- /* no transfer, set up connection and let application use the socket by
- extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
-
- /* Function that will be called to convert from the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
-
- /* Function that will be called to convert to the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
-
- /* Function that will be called to convert from UTF8
- (instead of using the iconv calls in libcurl)
- Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
-
- /* if the connection proceeds too quickly then need to slow it down */
- /* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
-
- /* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
-
- /* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
-
- /* set to 0 to disable session ID re-use for this transfer, default is
- enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
+ /* Sets the maximum size of data that will be downloaded from
+ * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
+ */
+ CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
+
+ /* Set this option to the file name of your .netrc file you want libcurl
+ to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
+ a poor attempt to find the user's home directory and check for a .netrc
+ file in there. */
+ CINIT(NETRC_FILE, OBJECTPOINT, 118),
+
+ /* Enable SSL/TLS for FTP, pick one of:
+ CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
+ CURLFTPSSL_CONTROL - SSL for the control connection or fail
+ CURLFTPSSL_ALL - SSL for all communication or fail
+ */
+ CINIT(USE_SSL, LONG, 119),
+
+ /* The _LARGE version of the standard POSTFIELDSIZE option */
+ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+
+ /* Enable/disable the TCP Nagle algorithm */
+ CINIT(TCP_NODELAY, LONG, 121),
+
+ /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 123 OBSOLETE. Gone in 7.16.0 */
+ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 127 OBSOLETE. Gone in 7.16.0 */
+ /* 128 OBSOLETE. Gone in 7.16.0 */
+
+ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
+ can be used to change libcurl's default action which is to first try
+ "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
+ response has been received.
+
+ Available parameters are:
+ CURLFTPAUTH_DEFAULT - let libcurl decide
+ CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
+ CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
+ */
+ CINIT(FTPSSLAUTH, LONG, 129),
+
+ CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
+ CINIT(IOCTLDATA, OBJECTPOINT, 131),
+
+ /* 132 OBSOLETE. Gone in 7.16.0 */
+ /* 133 OBSOLETE. Gone in 7.16.0 */
+
+ /* zero terminated string for pass on to the FTP server when asked for
+ "account" info */
+ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
+
+ /* feed cookies into cookie engine */
+ CINIT(COOKIELIST, OBJECTPOINT, 135),
+
+ /* ignore Content-Length */
+ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
+
+ /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
+ response. Typically used for FTP-SSL purposes but is not restricted to
+ that. libcurl will then instead use the same IP address it used for the
+ control connection. */
+ CINIT(FTP_SKIP_PASV_IP, LONG, 137),
+
+ /* Select "file method" to use when doing FTP, see the curl_ftpmethod
+ above. */
+ CINIT(FTP_FILEMETHOD, LONG, 138),
+
+ /* Local port number to bind the socket to */
+ CINIT(LOCALPORT, LONG, 139),
+
+ /* Number of ports to try, including the first one set with LOCALPORT.
+ Thus, setting it to 1 will make no additional attempts but the first.
+ */
+ CINIT(LOCALPORTRANGE, LONG, 140),
+
+ /* no transfer, set up connection and let application use the socket by
+ extracting it with CURLINFO_LASTSOCKET */
+ CINIT(CONNECT_ONLY, LONG, 141),
+
+ /* Function that will be called to convert from the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
+
+ /* Function that will be called to convert to the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
+
+ /* Function that will be called to convert from UTF8
+ (instead of using the iconv calls in libcurl)
+ Note that this is used only for SSL certificate processing */
+ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
+
+ /* if the connection proceeds too quickly then need to slow it down */
+ /* limit-rate: maximum number of bytes per second to send or receive */
+ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
+ CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+
+ /* Pointer to command string to send if USER/PASS fails. */
+ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
+
+ /* callback function for setting socket options */
+ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
+ CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
+
+ /* set to 0 to disable session ID re-use for this transfer, default is
+ enabled (== 1) */
+ CINIT(SSL_SESSIONID_CACHE, LONG, 150),
- /* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
-
- /* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
+ /* allowed SSH authentication methods */
+ CINIT(SSH_AUTH_TYPES, LONG, 151),
+
+ /* Used by scp/sftp to do public/private key authentication */
+ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
+ CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
- /* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
+ /* Send CCC (Clear Command Channel) after authentication */
+ CINIT(FTP_SSL_CCC, LONG, 154),
- /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
-
- /* set to zero to disable the libcurl's decoding and thus pass the raw body
- data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
+ /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
+ CINIT(TIMEOUT_MS, LONG, 155),
+ CINIT(CONNECTTIMEOUT_MS, LONG, 156),
+
+ /* set to zero to disable the libcurl's decoding and thus pass the raw body
+ data to the application even when it is encoded/compressed */
+ CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
+ CINIT(HTTP_CONTENT_DECODING, LONG, 158),
- /* Permission used when creating new files and directories on the remote
- server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
+ /* Permission used when creating new files and directories on the remote
+ server for protocols that support it, SFTP/SCP/FILE */
+ CINIT(NEW_FILE_PERMS, LONG, 159),
+ CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
- /* Set the behaviour of POST when redirecting. Values must be set to one
- of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
+ /* Set the behaviour of POST when redirecting. Values must be set to one
+ of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
+ CINIT(POSTREDIR, LONG, 161),
- /* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
+ /* used by scp/sftp to verify the host's public key */
+ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
- /* Callback function for opening socket (instead of socket(2)). Optionally,
- callback is able change the address or refuse to connect returning
- CURL_SOCKET_BAD. The callback should have type
- curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
+ /* Callback function for opening socket (instead of socket(2)). Optionally,
+ callback is able change the address or refuse to connect returning
+ CURL_SOCKET_BAD. The callback should have type
+ curl_opensocket_callback */
+ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
+ CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
- /* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
+ /* POST volatile input fields. */
+ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
- /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
+ /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
+ CINIT(PROXY_TRANSFER_MODE, LONG, 166),
- /* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
+ /* Callback function for seeking in the input stream */
+ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
+ CINIT(SEEKDATA, OBJECTPOINT, 168),
- /* CRL file */
- CINIT(CRLFILE, OBJECTPOINT, 169),
+ /* CRL file */
+ CINIT(CRLFILE, OBJECTPOINT, 169),
- /* Issuer certificate */
- CINIT(ISSUERCERT, OBJECTPOINT, 170),
+ /* Issuer certificate */
+ CINIT(ISSUERCERT, OBJECTPOINT, 170),
- /* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
+ /* (IPv6) Address scope */
+ CINIT(ADDRESS_SCOPE, LONG, 171),
- /* Collect certificate chain info and allow it to get retrievable with
- CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
- working with OpenSSL-powered builds. */
- CINIT(CERTINFO, LONG, 172),
+ /* Collect certificate chain info and allow it to get retrievable with
+ CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
+ working with OpenSSL-powered builds. */
+ CINIT(CERTINFO, LONG, 172),
- /* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, OBJECTPOINT, 173),
- CINIT(PASSWORD, OBJECTPOINT, 174),
+ /* "name" and "pwd" to use when fetching. */
+ CINIT(USERNAME, OBJECTPOINT, 173),
+ CINIT(PASSWORD, OBJECTPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
- CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
-
- /* Comma separated list of hostnames defining no-proxy zones. These should
- match both hostnames directly, and hostnames within a domain. For
- example, local.com will match local.com and www.local.com, but NOT
- notlocal.com or www.notlocal.com. For compatibility with other
- implementations of this, .local.com will be considered to be the same as
- local.com. A single * is the only valid wildcard, and effectively
- disables the use of proxy. */
- CINIT(NOPROXY, OBJECTPOINT, 177),
-
- /* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
-
- /* set the bitmask for the protocols that are allowed to be used for the
- transfer, which thus helps the app which takes URLs from users or other
- external inputs and want to restrict what protocol(s) to deal
- with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
-
- /* set the bitmask for the protocols that libcurl is allowed to follow to,
- as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
-
- /* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
-
- /* set the SSH host key callback, must point to a curl_sshkeycallback
- function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
-
- /* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
-
- CURLOPT_LASTENTRY /* the last unused */
+ CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
+ CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
+
+ /* Comma separated list of hostnames defining no-proxy zones. These should
+ match both hostnames directly, and hostnames within a domain. For
+ example, local.com will match local.com and www.local.com, but NOT
+ notlocal.com or www.notlocal.com. For compatibility with other
+ implementations of this, .local.com will be considered to be the same as
+ local.com. A single * is the only valid wildcard, and effectively
+ disables the use of proxy. */
+ CINIT(NOPROXY, OBJECTPOINT, 177),
+
+ /* block size for TFTP transfers */
+ CINIT(TFTP_BLKSIZE, LONG, 178),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
+
+ /* set the bitmask for the protocols that are allowed to be used for the
+ transfer, which thus helps the app which takes URLs from users or other
+ external inputs and want to restrict what protocol(s) to deal
+ with. Defaults to CURLPROTO_ALL. */
+ CINIT(PROTOCOLS, LONG, 181),
+
+ /* set the bitmask for the protocols that libcurl is allowed to follow to,
+ as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
+ to be set in both bitmasks to be allowed to get redirected to. Defaults
+ to all protocols except FILE and SCP. */
+ CINIT(REDIR_PROTOCOLS, LONG, 182),
+
+ /* set the SSH knownhost file name to use */
+ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+
+ /* set the SSH host key callback custom pointer */
+ CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+
+ CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -1294,49 +1294,49 @@ typedef enum {
#endif
- /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
- name resolves addresses using more than one IP protocol version, this
- option might be handy to force libcurl to use a specific IP version. */
+/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
+ name resolves addresses using more than one IP protocol version, this
+ option might be handy to force libcurl to use a specific IP version. */
#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
versions that your system allows */
#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
- /* three convenient "aliases" that follow the name scheme better */
+/* three convenient "aliases" that follow the name scheme better */
#define CURLOPT_WRITEDATA CURLOPT_FILE
#define CURLOPT_READDATA CURLOPT_INFILE
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
+/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
enum {
- CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
+ CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
like the library to choose the best possible
for us! */
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
+ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
+ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
+ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
- /* These enums are for use with the CURLOPT_NETRC option. */
+/* These enums are for use with the CURLOPT_NETRC option. */
enum CURL_NETRC_OPTION {
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
+ CURL_NETRC_IGNORED, /* The .netrc will never be read.
* This is the default. */
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
+ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
* to one in the .netrc. */
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
+ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
* Unless one is set programmatically, the .netrc
* will be queried. */
- CURL_NETRC_LAST
+ CURL_NETRC_LAST
};
enum {
- CURL_SSLVERSION_DEFAULT,
- CURL_SSLVERSION_TLSv1,
- CURL_SSLVERSION_SSLv2,
- CURL_SSLVERSION_SSLv3,
+ CURL_SSLVERSION_DEFAULT,
+ CURL_SSLVERSION_TLSv1,
+ CURL_SSLVERSION_SSLv2,
+ CURL_SSLVERSION_SSLv3,
- CURL_SSLVERSION_LAST /* never use, keep last */
+ CURL_SSLVERSION_LAST /* never use, keep last */
};
/* symbols to use with CURLOPT_POSTREDIR.
@@ -1349,13 +1349,13 @@ enum {
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
typedef enum {
- CURL_TIMECOND_NONE,
+ CURL_TIMECOND_NONE,
- CURL_TIMECOND_IFMODSINCE,
- CURL_TIMECOND_IFUNMODSINCE,
- CURL_TIMECOND_LASTMOD,
+ CURL_TIMECOND_IFMODSINCE,
+ CURL_TIMECOND_IFUNMODSINCE,
+ CURL_TIMECOND_LASTMOD,
- CURL_TIMECOND_LAST
+ CURL_TIMECOND_LAST
} curl_TimeCond;
@@ -1377,41 +1377,41 @@ CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
#endif
typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
-
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
-
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
-
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
-
- CURLFORM_LASTENTRY /* the last unused */
+ CFINIT(NOTHING), /********* the first one is unused ************/
+
+ /* */
+ CFINIT(COPYNAME),
+ CFINIT(PTRNAME),
+ CFINIT(NAMELENGTH),
+ CFINIT(COPYCONTENTS),
+ CFINIT(PTRCONTENTS),
+ CFINIT(CONTENTSLENGTH),
+ CFINIT(FILECONTENT),
+ CFINIT(ARRAY),
+ CFINIT(OBSOLETE),
+ CFINIT(FILE),
+
+ CFINIT(BUFFER),
+ CFINIT(BUFFERPTR),
+ CFINIT(BUFFERLENGTH),
+
+ CFINIT(CONTENTTYPE),
+ CFINIT(CONTENTHEADER),
+ CFINIT(FILENAME),
+ CFINIT(END),
+ CFINIT(OBSOLETE2),
+
+ CFINIT(STREAM),
+
+ CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
#undef CFINIT /* done */
/* structure to be used as parameter for CURLFORM_ARRAY */
struct curl_forms {
- CURLformoption option;
- const char *value;
+ CURLformoption option;
+ const char *value;
};
/* use this for multipart formpost building */
@@ -1431,17 +1431,17 @@ struct curl_forms {
*
***************************************************************************/
typedef enum {
- CURL_FORMADD_OK, /* first, no error */
+ CURL_FORMADD_OK, /* first, no error */
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
+ CURL_FORMADD_MEMORY,
+ CURL_FORMADD_OPTION_TWICE,
+ CURL_FORMADD_NULL,
+ CURL_FORMADD_UNKNOWN_OPTION,
+ CURL_FORMADD_INCOMPLETE,
+ CURL_FORMADD_ILLEGAL_ARRAY,
+ CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
- CURL_FORMADD_LAST /* last */
+ CURL_FORMADD_LAST /* last */
} CURLFORMcode;
/*
@@ -1581,11 +1581,11 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* memory management routines like malloc, free etc.
*/
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
- curl_malloc_callback m,
- curl_free_callback f,
- curl_realloc_callback r,
- curl_strdup_callback s,
- curl_calloc_callback c);
+ curl_malloc_callback m,
+ curl_free_callback f,
+ curl_realloc_callback r,
+ curl_strdup_callback s,
+ curl_calloc_callback c);
/*
* NAME curl_global_cleanup()
@@ -1599,8 +1599,8 @@ CURL_EXTERN void curl_global_cleanup(void);
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
- char *data;
- struct curl_slist *next;
+ char *data;
+ struct curl_slist *next;
};
/*
@@ -1612,7 +1612,7 @@ struct curl_slist {
* first. Returns the new list, after appending.
*/
CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
+ const char *);
/*
* NAME curl_slist_free_all()
@@ -1637,8 +1637,8 @@ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
/* info about the certificate chain, only for OpenSSL builds. Asked
for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
- int num_of_certs; /* number of certificates with information */
- struct curl_slist **certinfo; /* for each index in this array, there's a
+ int num_of_certs; /* number of certificates with information */
+ struct curl_slist **certinfo; /* for each index in this array, there's a
linked list with textual information in the
format "name: value" */
};
@@ -1651,45 +1651,45 @@ struct curl_certinfo {
#define CURLINFO_TYPEMASK 0xf00000
typedef enum {
- CURLINFO_NONE, /* first, never use this */
- CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
- CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
- CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
- CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
- CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
- CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
- CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
- CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
- CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
- CURLINFO_FILETIME = CURLINFO_LONG + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
- CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
- CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
- CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
- CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
- CURLINFO_PRIVATE = CURLINFO_STRING + 21,
- CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
- CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
- CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
- CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
- CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
- CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
- CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
- CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
- CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
- CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
- CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
- CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
- CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
- /* Fill in new entries below here! */
-
- CURLINFO_LASTONE = 35
+ CURLINFO_NONE, /* first, never use this */
+ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
+ CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
+ CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
+ CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
+ CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
+ CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
+ CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
+ CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
+ CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
+ CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
+ CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
+ CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
+ CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
+ CURLINFO_FILETIME = CURLINFO_LONG + 14,
+ CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
+ CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
+ CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
+ CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
+ CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
+ CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
+ CURLINFO_PRIVATE = CURLINFO_STRING + 21,
+ CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
+ CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
+ CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
+ CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
+ CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
+ CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
+ CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
+ CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
+ CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
+ CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
+ CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
+ CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
+ CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
+ CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
+ /* Fill in new entries below here! */
+
+ CURLINFO_LASTONE = 35
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -1697,15 +1697,15 @@ typedef enum {
#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
typedef enum {
- CURLCLOSEPOLICY_NONE, /* first, never use this */
+ CURLCLOSEPOLICY_NONE, /* first, never use this */
- CURLCLOSEPOLICY_OLDEST,
- CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
- CURLCLOSEPOLICY_LEAST_TRAFFIC,
- CURLCLOSEPOLICY_SLOWEST,
- CURLCLOSEPOLICY_CALLBACK,
+ CURLCLOSEPOLICY_OLDEST,
+ CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
+ CURLCLOSEPOLICY_LEAST_TRAFFIC,
+ CURLCLOSEPOLICY_SLOWEST,
+ CURLCLOSEPOLICY_CALLBACK,
- CURLCLOSEPOLICY_LAST /* last, never use this */
+ CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
#define CURL_GLOBAL_SSL (1<<0)
@@ -1721,25 +1721,25 @@ typedef enum {
/* Different data locks for a single share */
typedef enum {
- CURL_LOCK_DATA_NONE = 0,
- /* CURL_LOCK_DATA_SHARE is used internally to say that
- * the locking is just made to change the internal state of the share
- * itself.
- */
- CURL_LOCK_DATA_SHARE,
- CURL_LOCK_DATA_COOKIE,
- CURL_LOCK_DATA_DNS,
- CURL_LOCK_DATA_SSL_SESSION,
- CURL_LOCK_DATA_CONNECT,
- CURL_LOCK_DATA_LAST
+ CURL_LOCK_DATA_NONE = 0,
+ /* CURL_LOCK_DATA_SHARE is used internally to say that
+ * the locking is just made to change the internal state of the share
+ * itself.
+ */
+ CURL_LOCK_DATA_SHARE,
+ CURL_LOCK_DATA_COOKIE,
+ CURL_LOCK_DATA_DNS,
+ CURL_LOCK_DATA_SSL_SESSION,
+ CURL_LOCK_DATA_CONNECT,
+ CURL_LOCK_DATA_LAST
} curl_lock_data;
/* Different lock access types */
typedef enum {
- CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
- CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
- CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
- CURL_LOCK_ACCESS_LAST /* never use */
+ CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
+ CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
+ CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
+ CURL_LOCK_ACCESS_LAST /* never use */
} curl_lock_access;
typedef void (*curl_lock_function)(CURL *handle,
@@ -1753,23 +1753,23 @@ typedef void (*curl_unlock_function)(CURL *handle,
typedef void CURLSH;
typedef enum {
- CURLSHE_OK, /* all is fine */
- CURLSHE_BAD_OPTION, /* 1 */
- CURLSHE_IN_USE, /* 2 */
- CURLSHE_INVALID, /* 3 */
- CURLSHE_NOMEM, /* out of memory */
- CURLSHE_LAST /* never use */
+ CURLSHE_OK, /* all is fine */
+ CURLSHE_BAD_OPTION, /* 1 */
+ CURLSHE_IN_USE, /* 2 */
+ CURLSHE_INVALID, /* 3 */
+ CURLSHE_NOMEM, /* out of memory */
+ CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
- CURLSHOPT_NONE, /* don't use */
- CURLSHOPT_SHARE, /* specify a data type to share */
- CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
- CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
- CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
- CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
+ CURLSHOPT_NONE, /* don't use */
+ CURLSHOPT_SHARE, /* specify a data type to share */
+ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
+ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
+ CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
+ CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
callback functions */
- CURLSHOPT_LAST /* never use */
+ CURLSHOPT_LAST /* never use */
} CURLSHoption;
CURL_EXTERN CURLSH *curl_share_init(void);
@@ -1781,11 +1781,11 @@ CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
*/
typedef enum {
- CURLVERSION_FIRST,
- CURLVERSION_SECOND,
- CURLVERSION_THIRD,
- CURLVERSION_FOURTH,
- CURLVERSION_LAST /* never actually use this */
+ CURLVERSION_FIRST,
+ CURLVERSION_SECOND,
+ CURLVERSION_THIRD,
+ CURLVERSION_FOURTH,
+ CURLVERSION_LAST /* never actually use this */
} CURLversion;
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
@@ -1796,30 +1796,30 @@ typedef enum {
#define CURLVERSION_NOW CURLVERSION_FOURTH
typedef struct {
- CURLversion age; /* age of the returned struct */
- const char *version; /* LIBCURL_VERSION */
- unsigned int version_num; /* LIBCURL_VERSION_NUM */
- const char *host; /* OS/host/cpu/machine when configured */
- int features; /* bitmask, see defines below */
- const char *ssl_version; /* human readable string */
- long ssl_version_num; /* not used anymore, always 0 */
- const char *libz_version; /* human readable string */
- /* protocols is terminated by an entry with a NULL protoname */
- const char * const *protocols;
-
- /* The fields below this were added in CURLVERSION_SECOND */
- const char *ares;
- int ares_num;
-
- /* This field was added in CURLVERSION_THIRD */
- const char *libidn;
-
- /* These field were added in CURLVERSION_FOURTH */
-
- /* Same as '_libiconv_version' if built with HAVE_ICONV */
- int iconv_ver_num;
-
- const char *libssh_version; /* human readable string */
+ CURLversion age; /* age of the returned struct */
+ const char *version; /* LIBCURL_VERSION */
+ unsigned int version_num; /* LIBCURL_VERSION_NUM */
+ const char *host; /* OS/host/cpu/machine when configured */
+ int features; /* bitmask, see defines below */
+ const char *ssl_version; /* human readable string */
+ long ssl_version_num; /* not used anymore, always 0 */
+ const char *libz_version; /* human readable string */
+ /* protocols is terminated by an entry with a NULL protoname */
+ const char * const *protocols;
+
+ /* The fields below this were added in CURLVERSION_SECOND */
+ const char *ares;
+ int ares_num;
+
+ /* This field was added in CURLVERSION_THIRD */
+ const char *libidn;
+
+ /* These field were added in CURLVERSION_FOURTH */
+
+ /* Same as '_libiconv_version' if built with HAVE_ICONV */
+ int iconv_ver_num;
+
+ const char *libssh_version; /* human readable string */
} curl_version_info_data;
diff --git a/thirdparties/s60/include/curl/curlbuild.h b/thirdparties/s60/include/curl/curlbuild.h
index 115457b..dcb5b9d 100755
--- a/thirdparties/s60/include/curl/curlbuild.h
+++ b/thirdparties/s60/include/curl/curlbuild.h
@@ -111,52 +111,52 @@
#ifdef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
+Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
#endif
#ifdef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
#endif
/* ================================================================ */
@@ -554,7 +554,7 @@
#else
# error "Unknown non-configure build target!"
- Error Compilation_aborted_Unknown_non_configure_build_target
+Error Compilation_aborted_Unknown_non_configure_build_target
#endif
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
@@ -572,13 +572,13 @@
/* Data type definition of curl_socklen_t. */
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
- typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
+typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
#endif
/* Data type definition of curl_off_t. */
#ifdef CURL_TYPEOF_CURL_OFF_T
- typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
+typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
#endif
#endif /* __CURL_CURLBUILD_H */
diff --git a/thirdparties/s60/include/curl/curlrules.h b/thirdparties/s60/include/curl/curlrules.h
index 4401873..c676ed1 100755
--- a/thirdparties/s60/include/curl/curlrules.h
+++ b/thirdparties/s60/include/curl/curlrules.h
@@ -78,52 +78,52 @@
#ifndef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
+Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
#endif
#ifndef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
#endif
/*
@@ -140,8 +140,8 @@
*/
typedef char
- __curl_rule_01__
- [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
+__curl_rule_01__
+[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
/*
* Verify that the size previously defined and expected for
@@ -150,8 +150,8 @@ typedef char
*/
typedef char
- __curl_rule_02__
- [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
+__curl_rule_02__
+[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
/*
* Verify at compile time that the size of curl_off_t as reported
@@ -160,8 +160,8 @@ typedef char
*/
typedef char
- __curl_rule_03__
- [CurlchkszGE(curl_off_t, long)];
+__curl_rule_03__
+[CurlchkszGE(curl_off_t, long)];
/*
* Verify that the size previously defined and expected for
@@ -170,8 +170,8 @@ typedef char
*/
typedef char
- __curl_rule_04__
- [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
+__curl_rule_04__
+[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
/*
* Verify at compile time that the size of curl_socklen_t as reported
@@ -180,14 +180,14 @@ typedef char
*/
typedef char
- __curl_rule_05__
- [CurlchkszGE(curl_socklen_t, int)];
+__curl_rule_05__
+[CurlchkszGE(curl_socklen_t, int)];
/* ================================================================ */
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
/* ================================================================ */
-/*
+/*
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
* these to be visible and exported by the external libcurl interface API,
* while also making them visible to the library internals, simply including
@@ -206,10 +206,10 @@ typedef char
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
defined(__ILEC400__)
- /* This compiler is believed to have an ISO compatible preprocessor */
+/* This compiler is believed to have an ISO compatible preprocessor */
#define CURL_ISOCPP
#else
- /* This compiler is believed NOT to have an ISO compatible preprocessor */
+/* This compiler is believed NOT to have an ISO compatible preprocessor */
#undef CURL_ISOCPP
#endif
diff --git a/thirdparties/s60/include/curl/multi.h b/thirdparties/s60/include/curl/multi.h
index 153f772..a71fe42 100755
--- a/thirdparties/s60/include/curl/multi.h
+++ b/thirdparties/s60/include/curl/multi.h
@@ -56,16 +56,16 @@ extern "C" {
typedef void CURLM;
typedef enum {
- CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
+ CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
curl_multi_socket*() soon */
- CURLM_OK,
- CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
- CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
- CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
- CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
- CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
- CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
- CURLM_LAST
+ CURLM_OK,
+ CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
+ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
+ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
+ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
+ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
+ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
+ CURLM_LAST
} CURLMcode;
/* just to make code nicer when using curl_multi_socket() you can now check
@@ -74,19 +74,19 @@ typedef enum {
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
typedef enum {
- CURLMSG_NONE, /* first, not used */
- CURLMSG_DONE, /* This easy handle has completed. 'result' contains
+ CURLMSG_NONE, /* first, not used */
+ CURLMSG_DONE, /* This easy handle has completed. 'result' contains
the CURLcode of the transfer */
- CURLMSG_LAST /* last, not used */
+ CURLMSG_LAST /* last, not used */
} CURLMSG;
struct CURLMsg {
- CURLMSG msg; /* what this message means */
- CURL *easy_handle; /* the handle it concerns */
- union {
- void *whatever; /* message-specific data */
- CURLcode result; /* return code for transfer */
- } data;
+ CURLMSG msg; /* what this message means */
+ CURL *easy_handle; /* the handle it concerns */
+ union {
+ void *whatever; /* message-specific data */
+ CURLcode result; /* return code for transfer */
+ } data;
};
typedef struct CURLMsg CURLMsg;
@@ -107,62 +107,62 @@ CURL_EXTERN CURLM *curl_multi_init(void);
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_remove_handle()
- *
- * Desc: removes a curl handle from the multi stack again
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_remove_handle()
+ *
+ * Desc: removes a curl handle from the multi stack again
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_fdset()
- *
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
- * poll() on. We want curl_multi_perform() called as soon as one of
- * them are ready.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_fdset()
+ *
+ * Desc: Ask curl for its fd_set sets. The app can use these to select() or
+ * poll() on. We want curl_multi_perform() called as soon as one of
+ * them are ready.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
fd_set *exc_fd_set,
int *max_fd);
- /*
- * Name: curl_multi_perform()
- *
- * Desc: When the app thinks there's data available for curl it calls this
- * function to read/write whatever there is right now. This returns
- * as soon as the reads and writes are done. This function does not
- * require that there actually is data available for reading or that
- * data can be written, it can be called just in case. It returns
- * the number of handles that still transfer data in the second
- * argument's integer-pointer.
- *
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
- * returns errors etc regarding the whole multi stack. There might
- * still have occurred problems on invidual transfers even when this
- * returns OK.
- */
+/*
+ * Name: curl_multi_perform()
+ *
+ * Desc: When the app thinks there's data available for curl it calls this
+ * function to read/write whatever there is right now. This returns
+ * as soon as the reads and writes are done. This function does not
+ * require that there actually is data available for reading or that
+ * data can be written, it can be called just in case. It returns
+ * the number of handles that still transfer data in the second
+ * argument's integer-pointer.
+ *
+ * Returns: CURLMcode type, general multi error code. *NOTE* that this only
+ * returns errors etc regarding the whole multi stack. There might
+ * still have occurred problems on invidual transfers even when this
+ * returns OK.
+ */
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
- int *running_handles);
-
- /*
- * Name: curl_multi_cleanup()
- *
- * Desc: Cleans up and removes a whole multi stack. It does not free or
- * touch any individual easy handles in any way. We need to define
- * in what state those handles will be if this function is called
- * in the middle of a transfer.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ int *running_handles);
+
+/*
+ * Name: curl_multi_cleanup()
+ *
+ * Desc: Cleans up and removes a whole multi stack. It does not free or
+ * touch any individual easy handles in any way. We need to define
+ * in what state those handles will be if this function is called
+ * in the middle of a transfer.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
@@ -194,7 +194,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* to.
*/
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
- int *msgs_in_queue);
+ int *msgs_in_queue);
/*
* Name: curl_multi_strerror()
@@ -246,20 +246,20 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
* Returns: The callback should return zero.
*/
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
- long timeout_ms, /* see above */
- void *userp); /* private callback
+ long timeout_ms, /* see above */
+ void *userp); /* private callback
pointer */
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
- curl_socket_t s,
- int ev_bitmask,
- int *running_handles);
+ curl_socket_t s,
+ int ev_bitmask,
+ int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
+ int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
@@ -278,7 +278,7 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
- long *milliseconds);
+ long *milliseconds);
#undef CINIT /* re-using the same name as in curl.h */
@@ -294,25 +294,25 @@ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
#endif
typedef enum {
- /* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
+ /* This is the socket callback function pointer */
+ CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
- /* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
+ /* This is the argument passed to the socket callback */
+ CINIT(SOCKETDATA, OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
+ CINIT(PIPELINING, LONG, 3),
- /* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+ /* This is the timer callback function pointer */
+ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
- /* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
+ /* This is the argument passed to the timer callback */
+ CINIT(TIMERDATA, OBJECTPOINT, 5),
- /* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
+ /* maximum number of entries in the connection cache */
+ CINIT(MAXCONNECTS, LONG, 6),
- CURLMOPT_LASTENTRY /* the last unused */
+ CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
diff --git a/thirdparties/s60/include/curl/stdcheaders.h b/thirdparties/s60/include/curl/stdcheaders.h
index f739d7f..0ff0be0 100755
--- a/thirdparties/s60/include/curl/stdcheaders.h
+++ b/thirdparties/s60/include/curl/stdcheaders.h
@@ -1,10 +1,10 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -12,7 +12,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
diff --git a/thirdparties/s60/include/curl/typecheck-gcc.h b/thirdparties/s60/include/curl/typecheck-gcc.h
index 9788305..781aa2d 100755
--- a/thirdparties/s60/include/curl/typecheck-gcc.h
+++ b/thirdparties/s60/include/curl/typecheck-gcc.h
@@ -123,56 +123,56 @@ __extension__ ({ \
__attribute__((noinline)) id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
- "curl_easy_setopt expects a long argument for this option")
+ "curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
- "curl_easy_setopt expects a curl_off_t argument for this option")
+ "curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
- "curl_easy_setopt expects a string (char* or char[]) argument for this option"
- )
+ "curl_easy_setopt expects a string (char* or char[]) argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
- "curl_easy_setopt expects a curl_write_callback argument for this option")
+ "curl_easy_setopt expects a curl_write_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
- "curl_easy_setopt expects a curl_read_callback argument for this option")
+ "curl_easy_setopt expects a curl_read_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
- "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
+ "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
- "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
+ "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
- "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
- )
+ "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
- "curl_easy_setopt expects a curl_progress_callback argument for this option")
+ "curl_easy_setopt expects a curl_progress_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
- "curl_easy_setopt expects a curl_debug_callback argument for this option")
+ "curl_easy_setopt expects a curl_debug_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
- "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
+ "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
- "curl_easy_setopt expects a curl_conv_callback argument for this option")
+ "curl_easy_setopt expects a curl_conv_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
- "curl_easy_setopt expects a curl_seek_callback argument for this option")
+ "curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
- "curl_easy_setopt expects a private data pointer as argument for this option")
+ "curl_easy_setopt expects a private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
- "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
+ "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
- "curl_easy_setopt expects a FILE* argument for this option")
+ "curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
- "curl_easy_setopt expects a void* or char* argument for this option")
+ "curl_easy_setopt expects a void* or char* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
- "curl_easy_setopt expects a struct curl_httppost* argument for this option")
+ "curl_easy_setopt expects a struct curl_httppost* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
- "curl_easy_setopt expects a struct curl_slist* argument for this option")
+ "curl_easy_setopt expects a struct curl_slist* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
- "curl_easy_setopt expects a CURLSH* argument for this option")
+ "curl_easy_setopt expects a CURLSH* argument for this option")
_CURL_WARNING(_curl_easy_getinfo_err_string,
- "curl_easy_getinfo expects a pointer to char * for this info")
+ "curl_easy_getinfo expects a pointer to char * for this info")
_CURL_WARNING(_curl_easy_getinfo_err_long,
- "curl_easy_getinfo expects a pointer to long for this info")
+ "curl_easy_getinfo expects a pointer to long for this info")
_CURL_WARNING(_curl_easy_getinfo_err_double,
- "curl_easy_getinfo expects a pointer to double for this info")
+ "curl_easy_getinfo expects a pointer to double for this info")
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
- "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
+ "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
/* groups of curl_easy_setops options that take the same type of argument */
@@ -457,13 +457,13 @@ typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
_curl_callback_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (_curl_opensocket_callback1)
- (void *, curlsocktype, struct curl_sockaddr *);
+(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback2)
- (void *, curlsocktype, const struct curl_sockaddr *);
+(void *, curlsocktype, const struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback3)
- (const void *, curlsocktype, struct curl_sockaddr *);
+(const void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback4)
- (const void *, curlsocktype, const struct curl_sockaddr *);
+(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
#define _curl_is_progress_cb(expr) \
@@ -472,9 +472,9 @@ typedef curl_socket_t (_curl_opensocket_callback4)
_curl_callback_compatible((expr), _curl_progress_callback1) || \
_curl_callback_compatible((expr), _curl_progress_callback2))
typedef int (_curl_progress_callback1)(void *,
- double, double, double, double);
+ double, double, double, double);
typedef int (_curl_progress_callback2)(const void *,
- double, double, double, double);
+ double, double, double, double);
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
#define _curl_is_debug_cb(expr) \
@@ -485,13 +485,13 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
typedef int (_curl_debug_callback1) (CURL *,
- curl_infotype, char *, size_t, void *);
+ curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
- curl_infotype, char *, size_t, const void *);
+ curl_infotype, char *, size_t, const void *);
typedef int (_curl_debug_callback3) (CURL *,
- curl_infotype, const char *, size_t, void *);
+ curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
- curl_infotype, const char *, size_t, const void *);
+ curl_infotype, const char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
diff --git a/thirdparties/s60/include/libxml/DOCBparser.h b/thirdparties/s60/include/libxml/DOCBparser.h
index 461d4ee..8fa4db3 100755
--- a/thirdparties/s60/include/libxml/DOCBparser.h
+++ b/thirdparties/s60/include/libxml/DOCBparser.h
@@ -42,50 +42,50 @@ typedef xmlDocPtr docbDocPtr;
* There is only few public functions.
*/
XMLPUBFUN int XMLCALL
- docbEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
+docbEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
-XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseDoc (xmlChar *cur,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN docbDocPtr XMLCALL
- docbParseDoc (xmlChar *cur,
- const char *encoding);
-XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseFile (const char *filename,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN docbDocPtr XMLCALL
- docbParseFile (const char *filename,
- const char *encoding);
+XMLPUBFUN docbDocPtr XMLCALL
+docbSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN docbDocPtr XMLCALL
+docbParseDoc (xmlChar *cur,
+ const char *encoding);
+XMLPUBFUN docbDocPtr XMLCALL
+docbSAXParseFile (const char *filename,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN docbDocPtr XMLCALL
+docbParseFile (const char *filename,
+ const char *encoding);
/**
* Interfaces for the Push mode.
*/
-XMLPUBFUN void XMLCALL
- docbFreeParserCtxt (docbParserCtxtPtr ctxt);
-XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- docbParseChunk (docbParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
-XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreateFileParserCtxt(const char *filename,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- docbParseDocument (docbParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+docbFreeParserCtxt (docbParserCtxtPtr ctxt);
+XMLPUBFUN docbParserCtxtPtr XMLCALL
+docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+docbParseChunk (docbParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
+XMLPUBFUN docbParserCtxtPtr XMLCALL
+docbCreateFileParserCtxt(const char *filename,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+docbParseDocument (docbParserCtxtPtr ctxt);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/HTMLparser.h b/thirdparties/s60/include/libxml/HTMLparser.h
index 05905e4..b4ea632 100755
--- a/thirdparties/s60/include/libxml/HTMLparser.h
+++ b/thirdparties/s60/include/libxml/HTMLparser.h
@@ -51,16 +51,16 @@ struct _htmlElemDesc {
char isinline; /* is this a block 0 or inline 1 element */
const char *desc; /* the description */
-/* NRK Jan.2003
- * New fields encapsulating HTML structure
- *
- * Bugs:
- * This is a very limited representation. It fails to tell us when
- * an element *requires* subelements (we only have whether they're
- * allowed or not), and it doesn't tell us where CDATA and PCDATA
- * are allowed. Some element relationships are not fully represented:
- * these are flagged with the word MODIFIER
- */
+ /* NRK Jan.2003
+ * New fields encapsulating HTML structure
+ *
+ * Bugs:
+ * This is a very limited representation. It fails to tell us when
+ * an element *requires* subelements (we only have whether they're
+ * allowed or not), and it doesn't tell us where CDATA and PCDATA
+ * are allowed. Some element relationships are not fully represented:
+ * these are flagged with the word MODIFIER
+ */
const char** subelts; /* allowed sub-elements of this element */
const char* defaultsubelt; /* subelement for suggested auto-repair
if necessary or NULL */
@@ -83,88 +83,88 @@ struct _htmlEntityDesc {
/*
* There is only few public functions.
*/
-XMLPUBFUN const htmlElemDesc * XMLCALL
- htmlTagLookup (const xmlChar *tag);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityLookup(const xmlChar *name);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityValueLookup(unsigned int value);
+XMLPUBFUN const htmlElemDesc * XMLCALL
+htmlTagLookup (const xmlChar *tag);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlEntityLookup(const xmlChar *name);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlEntityValueLookup(unsigned int value);
-XMLPUBFUN int XMLCALL
- htmlIsAutoClosed(htmlDocPtr doc,
- htmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- htmlAutoCloseTag(htmlDocPtr doc,
- const xmlChar *name,
- htmlNodePtr elem);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlParseEntityRef(htmlParserCtxtPtr ctxt,
- const xmlChar **str);
-XMLPUBFUN int XMLCALL
- htmlParseCharRef(htmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- htmlParseElement(htmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+htmlIsAutoClosed(htmlDocPtr doc,
+ htmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+htmlAutoCloseTag(htmlDocPtr doc,
+ const xmlChar *name,
+ htmlNodePtr elem);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlParseEntityRef(htmlParserCtxtPtr ctxt,
+ const xmlChar **str);
+XMLPUBFUN int XMLCALL
+htmlParseCharRef(htmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+htmlParseElement(htmlParserCtxtPtr ctxt);
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlNewParserCtxt(void);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlNewParserCtxt(void);
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreateMemoryParserCtxt(const char *buffer,
- int size);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
-XMLPUBFUN int XMLCALL
- htmlParseDocument(htmlParserCtxtPtr ctxt);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseDoc (xmlChar *cur,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseDoc (xmlChar *cur,
- const char *encoding);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseFile(const char *filename,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseFile (const char *filename,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- UTF8ToHtml (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
-XMLPUBFUN int XMLCALL
- htmlEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
-XMLPUBFUN int XMLCALL
- htmlIsScriptAttribute(const xmlChar *name);
-XMLPUBFUN int XMLCALL
- htmlHandleOmittedElem(int val);
+XMLPUBFUN int XMLCALL
+htmlParseDocument(htmlParserCtxtPtr ctxt);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlParseDoc (xmlChar *cur,
+ const char *encoding);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlSAXParseFile(const char *filename,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlParseFile (const char *filename,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+UTF8ToHtml (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
+XMLPUBFUN int XMLCALL
+htmlEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
+XMLPUBFUN int XMLCALL
+htmlIsScriptAttribute(const xmlChar *name);
+XMLPUBFUN int XMLCALL
+htmlHandleOmittedElem(int val);
#ifdef LIBXML_PUSH_ENABLED
/**
* Interfaces for the Push mode.
*/
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- htmlParseChunk (htmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+htmlParseChunk (htmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
-XMLPUBFUN void XMLCALL
- htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -186,78 +186,78 @@ typedef enum {
} htmlParserOption;
XMLPUBFUN void XMLCALL
- htmlCtxtReset (htmlParserCtxtPtr ctxt);
+htmlCtxtReset (htmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
- int options);
+htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFile (const char *URL,
- const char *encoding,
- int options);
+htmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/* NRK/Jan2003: further knowledge of HTML structure
*/
typedef enum {
- HTML_NA = 0 , /* something we don't check at all */
- HTML_INVALID = 0x1 ,
- HTML_DEPRECATED = 0x2 ,
- HTML_VALID = 0x4 ,
- HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
+ HTML_NA = 0 , /* something we don't check at all */
+ HTML_INVALID = 0x1 ,
+ HTML_DEPRECATED = 0x2 ,
+ HTML_VALID = 0x4 ,
+ HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
} htmlStatus ;
/* Using htmlElemDesc rather than name here, to emphasise the fact
diff --git a/thirdparties/s60/include/libxml/HTMLtree.h b/thirdparties/s60/include/libxml/HTMLtree.h
index 6ea8207..c5258ca 100755
--- a/thirdparties/s60/include/libxml/HTMLtree.h
+++ b/thirdparties/s60/include/libxml/HTMLtree.h
@@ -60,81 +60,81 @@ extern "C" {
#define HTML_PI_NODE XML_PI_NODE
XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDoc (const xmlChar *URI,
- const xmlChar *ExternalID);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDocNoDtD (const xmlChar *URI,
- const xmlChar *ExternalID);
-XMLPUBFUN const xmlChar * XMLCALL
- htmlGetMetaEncoding (htmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- htmlSetMetaEncoding (htmlDocPtr doc,
- const xmlChar *encoding);
+htmlNewDoc (const xmlChar *URI,
+ const xmlChar *ExternalID);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlNewDocNoDtD (const xmlChar *URI,
+ const xmlChar *ExternalID);
+XMLPUBFUN const xmlChar * XMLCALL
+htmlGetMetaEncoding (htmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+htmlSetMetaEncoding (htmlDocPtr doc,
+ const xmlChar *encoding);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- htmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
-XMLPUBFUN void XMLCALL
- htmlDocDumpMemoryFormat (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
-XMLPUBFUN int XMLCALL
- htmlDocDump (FILE *f,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- htmlSaveFile (const char *filename,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- htmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpFile (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- htmlNodeDumpFileFormat (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN int XMLCALL
- htmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- htmlSaveFileFormat (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+XMLPUBFUN void XMLCALL
+htmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
+XMLPUBFUN void XMLCALL
+htmlDocDumpMemoryFormat (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
+XMLPUBFUN int XMLCALL
+htmlDocDump (FILE *f,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+htmlSaveFile (const char *filename,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+htmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpFile (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+htmlNodeDumpFileFormat (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN int XMLCALL
+htmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+htmlSaveFileFormat (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN void XMLCALL
- htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN void XMLCALL
+htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- htmlIsBooleanAttr (const xmlChar *name);
+XMLPUBFUN int XMLCALL
+htmlIsBooleanAttr (const xmlChar *name);
#ifdef __cplusplus
diff --git a/thirdparties/s60/include/libxml/SAX.h b/thirdparties/s60/include/libxml/SAX.h
index 0ca161b..e113753 100755
--- a/thirdparties/s60/include/libxml/SAX.h
+++ b/thirdparties/s60/include/libxml/SAX.h
@@ -24,143 +24,143 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- getPublicId (void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL
- getSystemId (void *ctx);
-XMLPUBFUN void XMLCALL
- setDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
-
-XMLPUBFUN int XMLCALL
- getLineNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- getColumnNumber (void *ctx);
+getPublicId (void *ctx);
+XMLPUBFUN const xmlChar * XMLCALL
+getSystemId (void *ctx);
+XMLPUBFUN void XMLCALL
+setDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
+
+XMLPUBFUN int XMLCALL
+getLineNumber (void *ctx);
+XMLPUBFUN int XMLCALL
+getColumnNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- isStandalone (void *ctx);
-XMLPUBFUN int XMLCALL
- hasInternalSubset (void *ctx);
-XMLPUBFUN int XMLCALL
- hasExternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+isStandalone (void *ctx);
+XMLPUBFUN int XMLCALL
+hasInternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+hasExternalSubset (void *ctx);
-XMLPUBFUN void XMLCALL
- internalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL
- externalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL
- getEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
- getParameterEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- resolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+internalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+externalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlEntityPtr XMLCALL
+getEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlEntityPtr XMLCALL
+getParameterEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+resolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- entityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- attributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- elementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- notationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- unparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+XMLPUBFUN void XMLCALL
+entityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+attributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+elementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+notationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+unparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
-XMLPUBFUN void XMLCALL
- startDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- endDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- attribute (void *ctx,
- const xmlChar *fullname,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- startElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
-XMLPUBFUN void XMLCALL
- endElement (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- reference (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- characters (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- ignorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- processingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
-XMLPUBFUN void XMLCALL
- globalNamespace (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- setNamespace (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlNsPtr XMLCALL
- getNamespace (void *ctx);
-XMLPUBFUN int XMLCALL
- checkNamespace (void *ctx,
- xmlChar *nameSpace);
-XMLPUBFUN void XMLCALL
- namespaceDecl (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- comment (void *ctx,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- cdataBlock (void *ctx,
- const xmlChar *value,
- int len);
+XMLPUBFUN void XMLCALL
+startDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+endDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+attribute (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+startElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
+XMLPUBFUN void XMLCALL
+endElement (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+reference (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+characters (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+ignorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+processingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
+XMLPUBFUN void XMLCALL
+globalNamespace (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+setNamespace (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlNsPtr XMLCALL
+getNamespace (void *ctx);
+XMLPUBFUN int XMLCALL
+checkNamespace (void *ctx,
+ xmlChar *nameSpace);
+XMLPUBFUN void XMLCALL
+namespaceDecl (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+comment (void *ctx,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+cdataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL
- initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
- int warning);
+XMLPUBFUN void XMLCALL
+initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL
- inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+XMLPUBFUN void XMLCALL
+inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL
- initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+XMLPUBFUN void XMLCALL
+initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#endif /* LIBXML_SAX1_ENABLED */
diff --git a/thirdparties/s60/include/libxml/SAX2.h b/thirdparties/s60/include/libxml/SAX2.h
index 8d2db02..722f0f9 100755
--- a/thirdparties/s60/include/libxml/SAX2.h
+++ b/thirdparties/s60/include/libxml/SAX2.h
@@ -22,154 +22,154 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetPublicId (void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetSystemId (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2SetDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
-
-XMLPUBFUN int XMLCALL
- xmlSAX2GetLineNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2GetColumnNumber (void *ctx);
+xmlSAX2GetPublicId (void *ctx);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlSAX2GetSystemId (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2SetDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
+
+XMLPUBFUN int XMLCALL
+xmlSAX2GetLineNumber (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2GetColumnNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2IsStandalone (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2HasInternalSubset (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2HasExternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2IsStandalone (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2HasInternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2HasExternalSubset (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2InternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL
- xmlSAX2ExternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetParameterEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlSAX2ResolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+xmlSAX2InternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+xmlSAX2ExternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlSAX2GetEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlSAX2GetParameterEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlSAX2ResolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- xmlSAX2EntityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- xmlSAX2AttributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- xmlSAX2ElementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlSAX2NotationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- xmlSAX2UnparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+XMLPUBFUN void XMLCALL
+xmlSAX2EntityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlSAX2AttributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+xmlSAX2ElementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlSAX2NotationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+xmlSAX2UnparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
-XMLPUBFUN void XMLCALL
- xmlSAX2StartDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2StartDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndDocument (void *ctx);
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlSAX2StartElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndElement (void *ctx,
- const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSAX2StartElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndElement (void *ctx,
+ const xmlChar *name);
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
XMLPUBFUN void XMLCALL
- xmlSAX2StartElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
-XMLPUBFUN void XMLCALL
- xmlSAX2Reference (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlSAX2Characters (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2IgnorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2ProcessingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
-XMLPUBFUN void XMLCALL
- xmlSAX2Comment (void *ctx,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlSAX2CDataBlock (void *ctx,
- const xmlChar *value,
- int len);
+xmlSAX2StartElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
+XMLPUBFUN void XMLCALL
+xmlSAX2Reference (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSAX2Characters (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2IgnorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2ProcessingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
+XMLPUBFUN void XMLCALL
+xmlSAX2Comment (void *ctx,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+xmlSAX2CDataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlSAXDefaultVersion (int version);
+xmlSAXDefaultVersion (int version);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN int XMLCALL
- xmlSAXVersion (xmlSAXHandler *hdlr,
- int version);
-XMLPUBFUN void XMLCALL
- xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
- int warning);
+xmlSAXVersion (xmlSAXHandler *hdlr,
+ int version);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL
- htmlDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
+XMLPUBFUN void XMLCALL
+htmlDefaultSAXHandlerInit (void);
#endif
#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL
- docbDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
+XMLPUBFUN void XMLCALL
+docbDefaultSAXHandlerInit (void);
#endif
-XMLPUBFUN void XMLCALL
- xmlDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlDefaultSAXHandlerInit (void);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/c14n.h b/thirdparties/s60/include/libxml/c14n.h
index 3011af7..ed14c94 100755
--- a/thirdparties/s60/include/libxml/c14n.h
+++ b/thirdparties/s60/include/libxml/c14n.h
@@ -54,7 +54,7 @@ extern "C" {
/*
* xmlC14NMode:
- *
+ *
* Predefined values for C14N modes
*
*/
@@ -62,32 +62,33 @@ typedef enum {
XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
XML_C14N_1_1 = 2 /* C14N 1.1 spec */
-} xmlC14NMode;
+}
+xmlC14NMode;
XMLPUBFUN int XMLCALL
- xmlC14NDocSaveTo (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NDocSaveTo (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
XMLPUBFUN int XMLCALL
- xmlC14NDocDumpMemory (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlChar **doc_txt_ptr);
+xmlC14NDocDumpMemory (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlChar **doc_txt_ptr);
XMLPUBFUN int XMLCALL
- xmlC14NDocSave (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- const char* filename,
- int compression);
+xmlC14NDocSave (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ const char* filename,
+ int compression);
/**
@@ -104,17 +105,17 @@ XMLPUBFUN int XMLCALL
* Returns 1 if the node should be included
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
- xmlNodePtr node,
- xmlNodePtr parent);
+ xmlNodePtr node,
+ xmlNodePtr parent);
XMLPUBFUN int XMLCALL
- xmlC14NExecute (xmlDocPtr doc,
- xmlC14NIsVisibleCallback is_visible_callback,
- void* user_data,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NExecute (xmlDocPtr doc,
+ xmlC14NIsVisibleCallback is_visible_callback,
+ void* user_data,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/catalog.h b/thirdparties/s60/include/libxml/catalog.h
index b444137..e3fa031 100755
--- a/thirdparties/s60/include/libxml/catalog.h
+++ b/thirdparties/s60/include/libxml/catalog.h
@@ -51,7 +51,8 @@ typedef enum {
XML_CATA_PREFER_NONE = 0,
XML_CATA_PREFER_PUBLIC = 1,
XML_CATA_PREFER_SYSTEM
-} xmlCatalogPrefer;
+}
+xmlCatalogPrefer;
typedef enum {
XML_CATA_ALLOW_NONE = 0,
@@ -67,113 +68,113 @@ typedef xmlCatalog *xmlCatalogPtr;
* Operations on a given catalog.
*/
XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlNewCatalog (int sgml);
-XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadACatalog (const char *filename);
-XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadSGMLSuperCatalog (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlConvertSGMLCatalog (xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL
- xmlACatalogAdd (xmlCatalogPtr catal,
- const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
-XMLPUBFUN int XMLCALL
- xmlACatalogRemove (xmlCatalogPtr catal,
- const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolve (xmlCatalogPtr catal,
- const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveSystem(xmlCatalogPtr catal,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolvePublic(xmlCatalogPtr catal,
- const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveURI (xmlCatalogPtr catal,
- const xmlChar *URI);
+xmlNewCatalog (int sgml);
+XMLPUBFUN xmlCatalogPtr XMLCALL
+xmlLoadACatalog (const char *filename);
+XMLPUBFUN xmlCatalogPtr XMLCALL
+xmlLoadSGMLSuperCatalog (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlConvertSGMLCatalog (xmlCatalogPtr catal);
+XMLPUBFUN int XMLCALL
+xmlACatalogAdd (xmlCatalogPtr catal,
+ const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
+XMLPUBFUN int XMLCALL
+xmlACatalogRemove (xmlCatalogPtr catal,
+ const xmlChar *value);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolve (xmlCatalogPtr catal,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolveSystem(xmlCatalogPtr catal,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolvePublic(xmlCatalogPtr catal,
+ const xmlChar *pubID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolveURI (xmlCatalogPtr catal,
+ const xmlChar *URI);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlACatalogDump (xmlCatalogPtr catal,
- FILE *out);
+XMLPUBFUN void XMLCALL
+xmlACatalogDump (xmlCatalogPtr catal,
+ FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeCatalog (xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL
- xmlCatalogIsEmpty (xmlCatalogPtr catal);
+XMLPUBFUN void XMLCALL
+xmlFreeCatalog (xmlCatalogPtr catal);
+XMLPUBFUN int XMLCALL
+xmlCatalogIsEmpty (xmlCatalogPtr catal);
/*
* Global operations.
*/
-XMLPUBFUN void XMLCALL
- xmlInitializeCatalog (void);
-XMLPUBFUN int XMLCALL
- xmlLoadCatalog (const char *filename);
-XMLPUBFUN void XMLCALL
- xmlLoadCatalogs (const char *paths);
-XMLPUBFUN void XMLCALL
- xmlCatalogCleanup (void);
+XMLPUBFUN void XMLCALL
+xmlInitializeCatalog (void);
+XMLPUBFUN int XMLCALL
+xmlLoadCatalog (const char *filename);
+XMLPUBFUN void XMLCALL
+xmlLoadCatalogs (const char *paths);
+XMLPUBFUN void XMLCALL
+xmlCatalogCleanup (void);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlCatalogDump (FILE *out);
+XMLPUBFUN void XMLCALL
+xmlCatalogDump (FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolve (const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveSystem (const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolvePublic (const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveURI (const xmlChar *URI);
-XMLPUBFUN int XMLCALL
- xmlCatalogAdd (const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
-XMLPUBFUN int XMLCALL
- xmlCatalogRemove (const xmlChar *value);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseCatalogFile (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlCatalogConvert (void);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolve (const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolveSystem (const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolvePublic (const xmlChar *pubID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolveURI (const xmlChar *URI);
+XMLPUBFUN int XMLCALL
+xmlCatalogAdd (const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
+XMLPUBFUN int XMLCALL
+xmlCatalogRemove (const xmlChar *value);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseCatalogFile (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlCatalogConvert (void);
/*
* Strictly minimal interfaces for per-document catalogs used
* by the parser.
*/
-XMLPUBFUN void XMLCALL
- xmlCatalogFreeLocal (void *catalogs);
-XMLPUBFUN void * XMLCALL
- xmlCatalogAddLocal (void *catalogs,
- const xmlChar *URL);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolve (void *catalogs,
- const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolveURI(void *catalogs,
- const xmlChar *URI);
+XMLPUBFUN void XMLCALL
+xmlCatalogFreeLocal (void *catalogs);
+XMLPUBFUN void * XMLCALL
+xmlCatalogAddLocal (void *catalogs,
+ const xmlChar *URL);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogLocalResolve (void *catalogs,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogLocalResolveURI(void *catalogs,
+ const xmlChar *URI);
/*
* Preference settings.
*/
-XMLPUBFUN int XMLCALL
- xmlCatalogSetDebug (int level);
-XMLPUBFUN xmlCatalogPrefer XMLCALL
- xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
-XMLPUBFUN void XMLCALL
- xmlCatalogSetDefaults (xmlCatalogAllow allow);
-XMLPUBFUN xmlCatalogAllow XMLCALL
- xmlCatalogGetDefaults (void);
+XMLPUBFUN int XMLCALL
+xmlCatalogSetDebug (int level);
+XMLPUBFUN xmlCatalogPrefer XMLCALL
+xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
+XMLPUBFUN void XMLCALL
+xmlCatalogSetDefaults (xmlCatalogAllow allow);
+XMLPUBFUN xmlCatalogAllow XMLCALL
+xmlCatalogGetDefaults (void);
/* DEPRECATED interfaces */
-XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetSystem (const xmlChar *sysID);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetPublic (const xmlChar *pubID);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlCatalogGetSystem (const xmlChar *sysID);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlCatalogGetPublic (const xmlChar *pubID);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/chvalid.h b/thirdparties/s60/include/libxml/chvalid.h
index fb43016..d650b0b 100755
--- a/thirdparties/s60/include/libxml/chvalid.h
+++ b/thirdparties/s60/include/libxml/chvalid.h
@@ -52,7 +52,7 @@ struct _xmlChRangeGroup {
* Range checking routine
*/
XMLPUBFUN int XMLCALL
- xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
+xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
/**
@@ -208,21 +208,21 @@ XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
xmlIsPubidChar_ch((c)) : 0)
XMLPUBFUN int XMLCALL
- xmlIsBaseChar(unsigned int ch);
+xmlIsBaseChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsBlank(unsigned int ch);
+xmlIsBlank(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsChar(unsigned int ch);
+xmlIsChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsCombining(unsigned int ch);
+xmlIsCombining(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsDigit(unsigned int ch);
+xmlIsDigit(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsExtender(unsigned int ch);
+xmlIsExtender(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsIdeographic(unsigned int ch);
+xmlIsIdeographic(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsPubidChar(unsigned int ch);
+xmlIsPubidChar(unsigned int ch);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/debugXML.h b/thirdparties/s60/include/libxml/debugXML.h
index 5a9d20b..64cdb0c 100755
--- a/thirdparties/s60/include/libxml/debugXML.h
+++ b/thirdparties/s60/include/libxml/debugXML.h
@@ -25,41 +25,41 @@ extern "C" {
/*
* The standard Dump routines.
*/
-XMLPUBFUN void XMLCALL
- xmlDebugDumpString (FILE *output,
- const xmlChar *str);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpAttr (FILE *output,
- xmlAttrPtr attr,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpAttrList (FILE *output,
- xmlAttrPtr attr,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpOneNode (FILE *output,
- xmlNodePtr node,
- int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNode (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpString (FILE *output,
+ const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNodeList (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpAttr (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocumentHead(FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpAttrList (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocument (FILE *output,
- xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpDTD (FILE *output,
- xmlDtdPtr dtd);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpEntities (FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpOneNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpNodeList (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDocumentHead(FILE *output,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDocument (FILE *output,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDTD (FILE *output,
+ xmlDtdPtr dtd);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpEntities (FILE *output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -68,8 +68,8 @@ XMLPUBFUN void XMLCALL
****************************************************************/
XMLPUBFUN int XMLCALL
- xmlDebugCheckDocument (FILE * output,
- xmlDocPtr doc);
+xmlDebugCheckDocument (FILE * output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -77,13 +77,13 @@ XMLPUBFUN int XMLCALL
* *
****************************************************************/
-XMLPUBFUN void XMLCALL
- xmlLsOneNode (FILE *output, xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlLsCountNode (xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlLsOneNode (FILE *output, xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlLsCountNode (xmlNodePtr node);
-XMLPUBFUN const char * XMLCALL
- xmlBoolToText (int boolval);
+XMLPUBFUN const char * XMLCALL
+xmlBoolToText (int boolval);
/****************************************************************
* *
@@ -133,80 +133,80 @@ struct _xmlShellCtxt {
*/
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-
-XMLPUBFUN void XMLCALL
- xmlShellPrintXPathError (int errorType,
- const char *arg);
-XMLPUBFUN void XMLCALL
- xmlShellPrintXPathResult(xmlXPathObjectPtr list);
-XMLPUBFUN int XMLCALL
- xmlShellList (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellBase (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellDir (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellLoad (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+ xmlNodePtr node,
+ xmlNodePtr node2);
+
+XMLPUBFUN void XMLCALL
+xmlShellPrintXPathError (int errorType,
+ const char *arg);
+XMLPUBFUN void XMLCALL
+xmlShellPrintXPathResult(xmlXPathObjectPtr list);
+XMLPUBFUN int XMLCALL
+xmlShellList (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellBase (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellDir (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellLoad (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlShellPrintNode (xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlShellCat (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellWrite (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellSave (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN void XMLCALL
+xmlShellPrintNode (xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlShellCat (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellWrite (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellSave (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int XMLCALL
- xmlShellValidate (xmlShellCtxtPtr ctxt,
- char *dtd,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellValidate (xmlShellCtxtPtr ctxt,
+ char *dtd,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_VALID_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlShellDu (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr tree,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellPwd (xmlShellCtxtPtr ctxt,
- char *buffer,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellDu (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr tree,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellPwd (xmlShellCtxtPtr ctxt,
+ char *buffer,
+ xmlNodePtr node,
+ xmlNodePtr node2);
/*
* The Shell interface.
*/
-XMLPUBFUN void XMLCALL
- xmlShell (xmlDocPtr doc,
- char *filename,
- xmlShellReadlineFunc input,
- FILE *output);
-
+XMLPUBFUN void XMLCALL
+xmlShell (xmlDocPtr doc,
+ char *filename,
+ xmlShellReadlineFunc input,
+ FILE *output);
+
#endif /* LIBXML_XPATH_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/s60/include/libxml/dict.h b/thirdparties/s60/include/libxml/dict.h
index abb8339..618f7cc 100755
--- a/thirdparties/s60/include/libxml/dict.h
+++ b/thirdparties/s60/include/libxml/dict.h
@@ -28,40 +28,40 @@ typedef xmlDict *xmlDictPtr;
* Constructor and destructor.
*/
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreate (void);
+xmlDictCreate (void);
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreateSub(xmlDictPtr sub);
+xmlDictCreateSub(xmlDictPtr sub);
XMLPUBFUN int XMLCALL
- xmlDictReference(xmlDictPtr dict);
-XMLPUBFUN void XMLCALL
- xmlDictFree (xmlDictPtr dict);
+xmlDictReference(xmlDictPtr dict);
+XMLPUBFUN void XMLCALL
+xmlDictFree (xmlDictPtr dict);
/*
* Lookup of entry in the dictionnary.
*/
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictLookup (xmlDictPtr dict,
- const xmlChar *name,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictExists (xmlDictPtr dict,
- const xmlChar *name,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictQLookup (xmlDictPtr dict,
- const xmlChar *prefix,
- const xmlChar *name);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictLookup (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictExists (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictQLookup (xmlDictPtr dict,
+ const xmlChar *prefix,
+ const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlDictOwns (xmlDictPtr dict,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlDictOwns (xmlDictPtr dict,
- const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlDictSize (xmlDictPtr dict);
+xmlDictSize (xmlDictPtr dict);
/*
* Cleanup function
*/
XMLPUBFUN void XMLCALL
- xmlDictCleanup (void);
+xmlDictCleanup (void);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/encoding.h b/thirdparties/s60/include/libxml/encoding.h
index c74b25f..c0b3208 100755
--- a/thirdparties/s60/include/libxml/encoding.h
+++ b/thirdparties/s60/include/libxml/encoding.h
@@ -77,7 +77,8 @@ typedef enum {
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
-} xmlCharEncoding;
+}
+xmlCharEncoding;
/**
* xmlCharEncodingInputFunc:
@@ -96,7 +97,7 @@ typedef enum {
* The value of @outlen after return is the number of octets consumed.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/**
@@ -118,7 +119,7 @@ typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
* The value of @outlen after return is the number of octets produced.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/*
@@ -149,76 +150,76 @@ extern "C" {
/*
* Interfaces for encoding handlers.
*/
-XMLPUBFUN void XMLCALL
- xmlInitCharEncodingHandlers (void);
-XMLPUBFUN void XMLCALL
- xmlCleanupCharEncodingHandlers (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN void XMLCALL
+xmlInitCharEncodingHandlers (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupCharEncodingHandlers (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlGetCharEncodingHandler (xmlCharEncoding enc);
+xmlGetCharEncodingHandler (xmlCharEncoding enc);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlFindCharEncodingHandler (const char *name);
+xmlFindCharEncodingHandler (const char *name);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlNewCharEncodingHandler (const char *name,
- xmlCharEncodingInputFunc input,
- xmlCharEncodingOutputFunc output);
+xmlNewCharEncodingHandler (const char *name,
+ xmlCharEncodingInputFunc input,
+ xmlCharEncodingOutputFunc output);
/*
* Interfaces for encoding names and aliases.
*/
-XMLPUBFUN int XMLCALL
- xmlAddEncodingAlias (const char *name,
- const char *alias);
-XMLPUBFUN int XMLCALL
- xmlDelEncodingAlias (const char *alias);
+XMLPUBFUN int XMLCALL
+xmlAddEncodingAlias (const char *name,
+ const char *alias);
+XMLPUBFUN int XMLCALL
+xmlDelEncodingAlias (const char *alias);
XMLPUBFUN const char * XMLCALL
- xmlGetEncodingAlias (const char *alias);
-XMLPUBFUN void XMLCALL
- xmlCleanupEncodingAliases (void);
+xmlGetEncodingAlias (const char *alias);
+XMLPUBFUN void XMLCALL
+xmlCleanupEncodingAliases (void);
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlParseCharEncoding (const char *name);
+xmlParseCharEncoding (const char *name);
XMLPUBFUN const char * XMLCALL
- xmlGetCharEncodingName (xmlCharEncoding enc);
+xmlGetCharEncodingName (xmlCharEncoding enc);
/*
* Interfaces directly used by the parsers.
*/
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlDetectCharEncoding (const unsigned char *in,
- int len);
-
-XMLPUBFUN int XMLCALL
- xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
-
-XMLPUBFUN int XMLCALL
- xmlCharEncInFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
+xmlDetectCharEncoding (const unsigned char *in,
+ int len);
+
+XMLPUBFUN int XMLCALL
+xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
+
+XMLPUBFUN int XMLCALL
+xmlCharEncInFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
+XMLPUBFUN int XMLCALL
+xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
XMLPUBFUN int XMLCALL
- xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
-XMLPUBFUN int XMLCALL
- xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
+xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
/*
* Export a few useful functions
*/
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL
- UTF8Toisolat1 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+XMLPUBFUN int XMLCALL
+UTF8Toisolat1 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- isolat1ToUTF8 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+XMLPUBFUN int XMLCALL
+isolat1ToUTF8 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/entities.h b/thirdparties/s60/include/libxml/entities.h
index cefb97f..fde38c7 100755
--- a/thirdparties/s60/include/libxml/entities.h
+++ b/thirdparties/s60/include/libxml/entities.h
@@ -28,7 +28,8 @@ typedef enum {
XML_INTERNAL_PARAMETER_ENTITY = 4,
XML_EXTERNAL_PARAMETER_ENTITY = 5,
XML_INTERNAL_PREDEFINED_ENTITY = 6
-} xmlEntityType;
+}
+xmlEntityType;
/*
* An unit of storage for an entity, contains the string, the value
@@ -57,8 +58,8 @@ struct _xmlEntity {
const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */
- /* this is also used to count entites
- * references done from that entity */
+ /* this is also used to count entites
+ * references done from that entity */
};
/*
@@ -75,71 +76,71 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlInitializePredefinedEntities (void);
+xmlInitializePredefinedEntities (void);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlNewEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlNewEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDocEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDocEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDtdEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDtdEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetPredefinedEntity (const xmlChar *name);
+xmlGetPredefinedEntity (const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDocEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDocEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDtdEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDtdEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetParameterEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetParameterEntity (xmlDocPtr doc,
+ const xmlChar *name);
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN const xmlChar * XMLCALL
- xmlEncodeEntities (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntities (xmlDocPtr doc,
+ const xmlChar *input);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeEntitiesReentrant(xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntitiesReentrant(xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeSpecialChars (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeSpecialChars (xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCreateEntitiesTable (void);
+xmlCreateEntitiesTable (void);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
+xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
+xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpEntitiesTable (xmlBufferPtr buf,
- xmlEntitiesTablePtr table);
+xmlDumpEntitiesTable (xmlBufferPtr buf,
+ xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL
- xmlDumpEntityDecl (xmlBufferPtr buf,
- xmlEntityPtr ent);
+xmlDumpEntityDecl (xmlBufferPtr buf,
+ xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlCleanupPredefinedEntities(void);
+xmlCleanupPredefinedEntities(void);
#endif /* LIBXML_LEGACY_ENABLED */
diff --git a/thirdparties/s60/include/libxml/globals.h b/thirdparties/s60/include/libxml/globals.h
index 9d688e0..4803e85 100755
--- a/thirdparties/s60/include/libxml/globals.h
+++ b/thirdparties/s60/include/libxml/globals.h
@@ -115,52 +115,51 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState
-{
- const char *xmlParserVersion;
+struct _xmlGlobalState {
+ const char *xmlParserVersion;
- xmlSAXLocator xmlDefaultSAXLocator;
- xmlSAXHandlerV1 xmlDefaultSAXHandler;
- xmlSAXHandlerV1 docbDefaultSAXHandler;
- xmlSAXHandlerV1 htmlDefaultSAXHandler;
+ xmlSAXLocator xmlDefaultSAXLocator;
+ xmlSAXHandlerV1 xmlDefaultSAXHandler;
+ xmlSAXHandlerV1 docbDefaultSAXHandler;
+ xmlSAXHandlerV1 htmlDefaultSAXHandler;
- xmlFreeFunc xmlFree;
- xmlMallocFunc xmlMalloc;
- xmlStrdupFunc xmlMemStrdup;
- xmlReallocFunc xmlRealloc;
+ xmlFreeFunc xmlFree;
+ xmlMallocFunc xmlMalloc;
+ xmlStrdupFunc xmlMemStrdup;
+ xmlReallocFunc xmlRealloc;
- xmlGenericErrorFunc xmlGenericError;
- xmlStructuredErrorFunc xmlStructuredError;
- void *xmlGenericErrorContext;
+ xmlGenericErrorFunc xmlGenericError;
+ xmlStructuredErrorFunc xmlStructuredError;
+ void *xmlGenericErrorContext;
- int oldXMLWDcompatibility;
+ int oldXMLWDcompatibility;
- xmlBufferAllocationScheme xmlBufferAllocScheme;
- int xmlDefaultBufferSize;
+ xmlBufferAllocationScheme xmlBufferAllocScheme;
+ int xmlDefaultBufferSize;
- int xmlSubstituteEntitiesDefaultValue;
- int xmlDoValidityCheckingDefaultValue;
- int xmlGetWarningsDefaultValue;
- int xmlKeepBlanksDefaultValue;
- int xmlLineNumbersDefaultValue;
- int xmlLoadExtDtdDefaultValue;
- int xmlParserDebugEntities;
- int xmlPedanticParserDefaultValue;
+ int xmlSubstituteEntitiesDefaultValue;
+ int xmlDoValidityCheckingDefaultValue;
+ int xmlGetWarningsDefaultValue;
+ int xmlKeepBlanksDefaultValue;
+ int xmlLineNumbersDefaultValue;
+ int xmlLoadExtDtdDefaultValue;
+ int xmlParserDebugEntities;
+ int xmlPedanticParserDefaultValue;
- int xmlSaveNoEmptyTags;
- int xmlIndentTreeOutput;
- const char *xmlTreeIndentString;
+ int xmlSaveNoEmptyTags;
+ int xmlIndentTreeOutput;
+ const char *xmlTreeIndentString;
- xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
- xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+ xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+ xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
- xmlMallocFunc xmlMallocAtomic;
- xmlError xmlLastError;
+ xmlMallocFunc xmlMallocAtomic;
+ xmlError xmlLastError;
- xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
- xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
+ xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
+ xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
- void *xmlStructuredErrorContext;
+ void *xmlStructuredErrorContext;
};
#ifdef __cplusplus
@@ -183,9 +182,9 @@ XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNo
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
- xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
+xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
- xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
+xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */
/*
@@ -349,7 +348,7 @@ XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
#endif
-XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlGenericErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlGenericErrorContext \
(*(__xmlGenericErrorContext()))
@@ -357,7 +356,7 @@ XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
XMLPUBVAR void * xmlGenericErrorContext;
#endif
-XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlStructuredErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlStructuredErrorContext \
(*(__xmlStructuredErrorContext()))
@@ -383,7 +382,7 @@ XMLPUBVAR int xmlIndentTreeOutput;
#endif
XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
-XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
+XMLPUBFUN const char ** XMLCALL __xmlTreeIndentString(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlTreeIndentString \
(*(__xmlTreeIndentString()))
@@ -428,7 +427,7 @@ XMLPUBVAR int xmlParserDebugEntities;
#endif
XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
-XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
+XMLPUBFUN const char ** XMLCALL __xmlParserVersion(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlParserVersion \
(*(__xmlParserVersion()))
diff --git a/thirdparties/s60/include/libxml/hash.h b/thirdparties/s60/include/libxml/hash.h
index 7fe4be7..b6171e4 100755
--- a/thirdparties/s60/include/libxml/hash.h
+++ b/thirdparties/s60/include/libxml/hash.h
@@ -1,6 +1,6 @@
/*
* Summary: Chained hash tables
- * Description: This module implements the hash table support used in
+ * Description: This module implements the hash table support used in
* various places in the library.
*
* Copy: See Copyright for the status of this software.
@@ -97,136 +97,136 @@ typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
* Callback when scanning data in a hash with the full scanner.
*/
typedef void (*xmlHashScannerFull)(void *payload, void *data,
- const xmlChar *name, const xmlChar *name2,
- const xmlChar *name3);
+ const xmlChar *name, const xmlChar *name2,
+ const xmlChar *name3);
/*
* Constructor and destructor.
*/
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreate (int size);
+xmlHashCreate (int size);
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreateDict(int size,
- xmlDictPtr dict);
-XMLPUBFUN void XMLCALL
- xmlHashFree (xmlHashTablePtr table,
- xmlHashDeallocator f);
+xmlHashCreateDict(int size,
+ xmlDictPtr dict);
+XMLPUBFUN void XMLCALL
+xmlHashFree (xmlHashTablePtr table,
+ xmlHashDeallocator f);
/*
* Add a new entry to the hash table.
*/
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry (xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry(xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata,
- xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry (xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry(xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata,
+ xmlHashDeallocator f);
/*
* Remove an entry from the hash table.
*/
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, const xmlChar *name3,
- xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, const xmlChar *name3,
+ xmlHashDeallocator f);
/*
* Retrieve the userdata.
*/
-XMLPUBFUN void * XMLCALL
- xmlHashLookup (xmlHashTablePtr table,
- const xmlChar *name);
-XMLPUBFUN void * XMLCALL
- xmlHashLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2);
-XMLPUBFUN void * XMLCALL
- xmlHashLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2,
- const xmlChar *name3,
- const xmlChar *prefix3);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup (xmlHashTablePtr table,
+ const xmlChar *name);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2,
+ const xmlChar *name3,
+ const xmlChar *prefix3);
/*
* Helpers.
*/
-XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCopy (xmlHashTablePtr table,
- xmlHashCopier f);
-XMLPUBFUN int XMLCALL
- xmlHashSize (xmlHashTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlHashScan (xmlHashTablePtr table,
- xmlHashScanner f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScan3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScanner f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScanFull (xmlHashTablePtr table,
- xmlHashScannerFull f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScanFull3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScannerFull f,
- void *data);
+XMLPUBFUN xmlHashTablePtr XMLCALL
+xmlHashCopy (xmlHashTablePtr table,
+ xmlHashCopier f);
+XMLPUBFUN int XMLCALL
+xmlHashSize (xmlHashTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlHashScan (xmlHashTablePtr table,
+ xmlHashScanner f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScan3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScanner f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScanFull (xmlHashTablePtr table,
+ xmlHashScannerFull f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScanFull3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScannerFull f,
+ void *data);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/list.h b/thirdparties/s60/include/libxml/list.h
index 1d83482..7bd8e37 100755
--- a/thirdparties/s60/include/libxml/list.h
+++ b/thirdparties/s60/include/libxml/list.h
@@ -1,6 +1,6 @@
/*
* Summary: lists interfaces
- * Description: this module implement the list support used in
+ * Description: this module implement the list support used in
* various place in the library.
*
* Copy: See Copyright for the status of this software.
@@ -53,79 +53,79 @@ typedef int (*xmlListWalker) (const void *data, const void *user);
/* Creation/Deletion */
XMLPUBFUN xmlListPtr XMLCALL
- xmlListCreate (xmlListDeallocator deallocator,
- xmlListDataCompare compare);
-XMLPUBFUN void XMLCALL
- xmlListDelete (xmlListPtr l);
+xmlListCreate (xmlListDeallocator deallocator,
+ xmlListDataCompare compare);
+XMLPUBFUN void XMLCALL
+xmlListDelete (xmlListPtr l);
/* Basic Operators */
-XMLPUBFUN void * XMLCALL
- xmlListSearch (xmlListPtr l,
- void *data);
-XMLPUBFUN void * XMLCALL
- xmlListReverseSearch (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListInsert (xmlListPtr l,
- void *data) ;
-XMLPUBFUN int XMLCALL
- xmlListAppend (xmlListPtr l,
- void *data) ;
-XMLPUBFUN int XMLCALL
- xmlListRemoveFirst (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListRemoveLast (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListRemoveAll (xmlListPtr l,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlListClear (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListEmpty (xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListFront (xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListEnd (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListSize (xmlListPtr l);
+XMLPUBFUN void * XMLCALL
+xmlListSearch (xmlListPtr l,
+ void *data);
+XMLPUBFUN void * XMLCALL
+xmlListReverseSearch (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListInsert (xmlListPtr l,
+ void *data) ;
+XMLPUBFUN int XMLCALL
+xmlListAppend (xmlListPtr l,
+ void *data) ;
+XMLPUBFUN int XMLCALL
+xmlListRemoveFirst (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListRemoveLast (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListRemoveAll (xmlListPtr l,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlListClear (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListEmpty (xmlListPtr l);
+XMLPUBFUN xmlLinkPtr XMLCALL
+xmlListFront (xmlListPtr l);
+XMLPUBFUN xmlLinkPtr XMLCALL
+xmlListEnd (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListSize (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListPopFront (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListPopBack (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListPushFront (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListPushBack (xmlListPtr l,
- void *data);
+XMLPUBFUN void XMLCALL
+xmlListPopFront (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListPopBack (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListPushFront (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListPushBack (xmlListPtr l,
+ void *data);
/* Advanced Operators */
-XMLPUBFUN void XMLCALL
- xmlListReverse (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListSort (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
-XMLPUBFUN void XMLCALL
- xmlListReverseWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
-XMLPUBFUN void XMLCALL
- xmlListMerge (xmlListPtr l1,
- xmlListPtr l2);
-XMLPUBFUN xmlListPtr XMLCALL
- xmlListDup (const xmlListPtr old);
-XMLPUBFUN int XMLCALL
- xmlListCopy (xmlListPtr cur,
- const xmlListPtr old);
+XMLPUBFUN void XMLCALL
+xmlListReverse (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListSort (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
+XMLPUBFUN void XMLCALL
+xmlListReverseWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
+XMLPUBFUN void XMLCALL
+xmlListMerge (xmlListPtr l1,
+ xmlListPtr l2);
+XMLPUBFUN xmlListPtr XMLCALL
+xmlListDup (const xmlListPtr old);
+XMLPUBFUN int XMLCALL
+xmlListCopy (xmlListPtr cur,
+ const xmlListPtr old);
/* Link operators */
-XMLPUBFUN void * XMLCALL
- xmlLinkGetData (xmlLinkPtr lk);
+XMLPUBFUN void * XMLCALL
+xmlLinkGetData (xmlLinkPtr lk);
/* xmlListUnique() */
/* xmlListSwap */
diff --git a/thirdparties/s60/include/libxml/nanoftp.h b/thirdparties/s60/include/libxml/nanoftp.h
index e3c28a0..9a63cd2 100755
--- a/thirdparties/s60/include/libxml/nanoftp.h
+++ b/thirdparties/s60/include/libxml/nanoftp.h
@@ -7,7 +7,7 @@
*
* Author: Daniel Veillard
*/
-
+
#ifndef __NANO_FTP_H__
#define __NANO_FTP_H__
@@ -20,7 +20,7 @@ extern "C" {
#endif
/**
- * ftpListCallback:
+ * ftpListCallback:
* @userData: user provided data for the callback
* @filename: the file name (including "->" when links are shown)
* @attrib: the attribute string
@@ -38,13 +38,13 @@ extern "C" {
* Note that only one of year and day:minute are specified.
*/
typedef void (*ftpListCallback) (void *userData,
- const char *filename, const char *attrib,
- const char *owner, const char *group,
- unsigned long size, int links, int year,
- const char *month, int day, int hour,
- int minute);
+ const char *filename, const char *attrib,
+ const char *owner, const char *group,
+ unsigned long size, int links, int year,
+ const char *month, int day, int hour,
+ int minute);
/**
- * ftpDataCallback:
+ * ftpDataCallback:
* @userData: the user provided context
* @data: the data received
* @len: its size in bytes
@@ -52,89 +52,89 @@ typedef void (*ftpListCallback) (void *userData,
* A callback for the xmlNanoFTPGet command.
*/
typedef void (*ftpDataCallback) (void *userData,
- const char *data,
- int len);
+ const char *data,
+ int len);
/*
* Init
*/
XMLPUBFUN void XMLCALL
- xmlNanoFTPInit (void);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPCleanup (void);
+xmlNanoFTPInit (void);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPCleanup (void);
/*
* Creating/freeing contexts.
*/
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPNewCtxt (const char *URL);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPFreeCtxt (void * ctx);
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPConnectTo (const char *server,
- int port);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPNewCtxt (const char *URL);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPFreeCtxt (void * ctx);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPConnectTo (const char *server,
+ int port);
/*
* Opening/closing session connections.
*/
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPOpen (const char *URL);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPConnect (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPClose (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPQuit (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPScanProxy (const char *URL);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPProxy (const char *host,
- int port,
- const char *user,
- const char *passwd,
- int type);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPUpdateURL (void *ctx,
- const char *URL);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPOpen (const char *URL);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPConnect (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPClose (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPQuit (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPScanProxy (const char *URL);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPProxy (const char *host,
+ int port,
+ const char *user,
+ const char *passwd,
+ int type);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPUpdateURL (void *ctx,
+ const char *URL);
/*
* Rather internal commands.
*/
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetResponse (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCheckResponse (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetResponse (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCheckResponse (void *ctx);
/*
* CD/DIR/GET handlers.
*/
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCwd (void *ctx,
- const char *directory);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPDele (void *ctx,
- const char *file);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCwd (void *ctx,
+ const char *directory);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPDele (void *ctx,
+ const char *file);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetConnection (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCloseConnection(void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPList (void *ctx,
- ftpListCallback callback,
- void *userData,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetSocket (void *ctx,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGet (void *ctx,
- ftpDataCallback callback,
- void *userData,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPRead (void *ctx,
- void *dest,
- int len);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetConnection (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCloseConnection(void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPList (void *ctx,
+ ftpListCallback callback,
+ void *userData,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetSocket (void *ctx,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGet (void *ctx,
+ ftpDataCallback callback,
+ void *userData,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/nanohttp.h b/thirdparties/s60/include/libxml/nanohttp.h
index 1d8ac24..8fca6e6 100755
--- a/thirdparties/s60/include/libxml/nanohttp.h
+++ b/thirdparties/s60/include/libxml/nanohttp.h
@@ -7,7 +7,7 @@
*
* Author: Daniel Veillard
*/
-
+
#ifndef __NANO_HTTP_H__
#define __NANO_HTTP_H__
@@ -19,60 +19,60 @@
extern "C" {
#endif
XMLPUBFUN void XMLCALL
- xmlNanoHTTPInit (void);
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPCleanup (void);
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPScanProxy (const char *URL);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPFetch (const char *URL,
- const char *filename,
- char **contentType);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethod (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- const char *headers,
- int ilen);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethodRedir (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- char **redir,
- const char *headers,
- int ilen);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpen (const char *URL,
- char **contentType);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpenRedir (const char *URL,
- char **contentType,
- char **redir);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPReturnCode (void *ctx);
-XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPAuthHeader (void *ctx);
+xmlNanoHTTPInit (void);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPCleanup (void);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPScanProxy (const char *URL);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPFetch (const char *URL,
+ const char *filename,
+ char **contentType);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPMethod (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ const char *headers,
+ int ilen);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPMethodRedir (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ char **redir,
+ const char *headers,
+ int ilen);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPOpen (const char *URL,
+ char **contentType);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPOpenRedir (const char *URL,
+ char **contentType,
+ char **redir);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPReturnCode (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPRedir (void *ctx);
+xmlNanoHTTPAuthHeader (void *ctx);
+XMLPUBFUN const char * XMLCALL
+xmlNanoHTTPRedir (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPContentLength( void * ctx );
+xmlNanoHTTPContentLength( void * ctx );
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPEncoding (void *ctx);
+xmlNanoHTTPEncoding (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPMimeType (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPRead (void *ctx,
- void *dest,
- int len);
+xmlNanoHTTPMimeType (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPSave (void *ctxt,
- const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPSave (void *ctxt,
+ const char *filename);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPClose (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/parser.h b/thirdparties/s60/include/libxml/parser.h
index 148ee03..0748924 100755
--- a/thirdparties/s60/include/libxml/parser.h
+++ b/thirdparties/s60/include/libxml/parser.h
@@ -80,27 +80,27 @@ struct _xmlParserInput {
* xmlParserNodeInfo:
*
* The parser can be asked to collect Node informations, i.e. at what
- * place in the file they were detected.
+ * place in the file they were detected.
* NOTE: This is off by default and not very well tested.
*/
typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
struct _xmlParserNodeInfo {
- const struct _xmlNode* node;
- /* Position & line # that text that created the node begins & ends on */
- unsigned long begin_pos;
- unsigned long begin_line;
- unsigned long end_pos;
- unsigned long end_line;
+ const struct _xmlNode* node;
+ /* Position & line # that text that created the node begins & ends on */
+ unsigned long begin_pos;
+ unsigned long begin_line;
+ unsigned long end_pos;
+ unsigned long end_line;
};
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
struct _xmlParserNodeInfoSeq {
- unsigned long maximum;
- unsigned long length;
- xmlParserNodeInfo* buffer;
+ unsigned long maximum;
+ unsigned long length;
+ xmlParserNodeInfo* buffer;
};
/**
@@ -221,7 +221,7 @@ struct _xmlParserCtxt {
xmlValidCtxt vctxt; /* The validity context */
xmlParserInputState instate; /* current type of input */
- int token; /* next char look-ahead */
+ int token; /* next char look-ahead */
char *directory; /* the data directory */
@@ -229,7 +229,7 @@ struct _xmlParserCtxt {
const xmlChar *name; /* Current parsed Node */
int nameNr; /* Depth of the parsing stack */
int nameMax; /* Max depth of the parsing stack */
- const xmlChar * *nameTab; /* array of nodes */
+ const xmlChar **nameTab; /* array of nodes */
long nbChars; /* number of xmlChar processed */
long checkIndex; /* used by progressive parsing lookup */
@@ -261,7 +261,7 @@ struct _xmlParserCtxt {
int recovery; /* run in recovery mode */
int progressive; /* is this a progressive parsing */
xmlDictPtr dict; /* dictionnary for the parser */
- const xmlChar * *atts; /* array for the attributes callbacks */
+ const xmlChar **atts; /* array for the attributes callbacks */
int maxatts; /* the size of the array */
int docdict; /* use strings from dict to build tree */
@@ -278,9 +278,9 @@ struct _xmlParserCtxt {
int sax2; /* operating in the new SAX mode */
int nsNr; /* the number of inherited namespaces */
int nsMax; /* the size of the arrays */
- const xmlChar * *nsTab; /* the array of prefix/namespace name */
+ const xmlChar **nsTab; /* the array of prefix/namespace name */
int *attallocs; /* which attribute were allocated */
- void * *pushTab; /* array of data for push */
+ void **pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
int nsWellFormed; /* is the document XML Nanespace okay */
@@ -339,8 +339,8 @@ struct _xmlSAXLocator {
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* internalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -351,9 +351,9 @@ typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
* Callback on internal subset declaration.
*/
typedef void (*internalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* externalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -364,9 +364,9 @@ typedef void (*internalSubsetSAXFunc) (void *ctx,
* Callback on external subset declaration.
*/
typedef void (*externalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* getEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -377,7 +377,7 @@ typedef void (*externalSubsetSAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* getParameterEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -388,12 +388,12 @@ typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* entityDeclSAXFunc:
* @ctx: the user data (XML parser context)
- * @name: the entity name
- * @type: the entity type
+ * @name: the entity name
+ * @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
@@ -401,11 +401,11 @@ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
* An entity definition has been parsed.
*/
typedef void (*entityDeclSAXFunc) (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
/**
* notationDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -416,15 +416,15 @@ typedef void (*entityDeclSAXFunc) (void *ctx,
* What to do when a notation declaration has been parsed.
*/
typedef void (*notationDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* attributeDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @elem: the name of the element
- * @fullname: the attribute name
- * @type: the attribute type
+ * @fullname: the attribute name
+ * @type: the attribute type
* @def: the type of default value
* @defaultValue: the attribute default value
* @tree: the tree of enumerated value set
@@ -432,25 +432,25 @@ typedef void (*notationDeclSAXFunc)(void *ctx,
* An attribute definition has been parsed.
*/
typedef void (*attributeDeclSAXFunc)(void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
/**
* elementDeclSAXFunc:
* @ctx: the user data (XML parser context)
- * @name: the element name
- * @type: the element type
+ * @name: the element name
+ * @type: the element type
* @content: the element value tree
*
* An element definition has been parsed.
*/
typedef void (*elementDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
/**
* unparsedEntityDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -462,10 +462,10 @@ typedef void (*elementDeclSAXFunc)(void *ctx,
* What to do when an unparsed entity declaration is parsed.
*/
typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
/**
* setDocumentLocatorSAXFunc:
* @ctx: the user data (XML parser context)
@@ -475,7 +475,7 @@ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
* Everything is available on the context, so this is useless in our case.
*/
typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
- xmlSAXLocatorPtr loc);
+ xmlSAXLocatorPtr loc);
/**
* startDocumentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -499,8 +499,8 @@ typedef void (*endDocumentSAXFunc) (void *ctx);
* Called when an opening tag has been processed.
*/
typedef void (*startElementSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar **atts);
+ const xmlChar *name,
+ const xmlChar **atts);
/**
* endElementSAXFunc:
* @ctx: the user data (XML parser context)
@@ -509,7 +509,7 @@ typedef void (*startElementSAXFunc) (void *ctx,
* Called when the end of an element has been detected.
*/
typedef void (*endElementSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* attributeSAXFunc:
* @ctx: the user data (XML parser context)
@@ -522,17 +522,17 @@ typedef void (*endElementSAXFunc) (void *ctx,
* the element.
*/
typedef void (*attributeSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *value);
+ const xmlChar *name,
+ const xmlChar *value);
/**
* referenceSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The entity name
*
- * Called when an entity reference is detected.
+ * Called when an entity reference is detected.
*/
typedef void (*referenceSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* charactersSAXFunc:
* @ctx: the user data (XML parser context)
@@ -542,8 +542,8 @@ typedef void (*referenceSAXFunc) (void *ctx,
* Receiving some chars from the parser.
*/
typedef void (*charactersSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* ignorableWhitespaceSAXFunc:
* @ctx: the user data (XML parser context)
@@ -554,8 +554,8 @@ typedef void (*charactersSAXFunc) (void *ctx,
* UNUSED: by default the DOM building will use characters.
*/
typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* processingInstructionSAXFunc:
* @ctx: the user data (XML parser context)
@@ -565,8 +565,8 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
* A processing instruction has been parsed.
*/
typedef void (*processingInstructionSAXFunc) (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
+ const xmlChar *target,
+ const xmlChar *data);
/**
* commentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -575,7 +575,7 @@ typedef void (*processingInstructionSAXFunc) (void *ctx,
* A comment has been parsed.
*/
typedef void (*commentSAXFunc) (void *ctx,
- const xmlChar *value);
+ const xmlChar *value);
/**
* cdataBlockSAXFunc:
* @ctx: the user data (XML parser context)
@@ -585,41 +585,41 @@ typedef void (*commentSAXFunc) (void *ctx,
* Called when a pcdata block has been parsed.
*/
typedef void (*cdataBlockSAXFunc) (
- void *ctx,
- const xmlChar *value,
- int len);
+ void *ctx,
+ const xmlChar *value,
+ int len);
/**
* warningSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format a warning messages, callback.
*/
typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* errorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format an error messages, callback.
*/
typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* fatalErrorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format fatal error messages, callback.
* Note: so far fatalError() SAX callbacks are not used, error()
* get all the callbacks for errors.
*/
typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* isStandaloneSAXFunc:
* @ctx: the user data (XML parser context)
@@ -681,15 +681,15 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
*/
typedef void (*startElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
-
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
+
/**
* endElementNsSAX2Func:
* @ctx: the user data (XML parser context)
@@ -702,9 +702,9 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
*/
typedef void (*endElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
struct _xmlSAXHandler {
@@ -784,15 +784,15 @@ struct _xmlSAXHandlerV1 {
* xmlExternalEntityLoader:
* @URL: The System ID of the resource requested
* @ID: The Public ID of the resource requested
- * @context: the XML parser context
+ * @context: the XML parser context
*
* External entity loaders types.
*
* Returns the entity input parser.
*/
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
- const char *ID,
- xmlParserCtxtPtr context);
+ const char *ID,
+ xmlParserCtxtPtr context);
#ifdef __cplusplus
}
@@ -810,263 +810,263 @@ extern "C" {
/*
* Init/Cleanup
*/
-XMLPUBFUN void XMLCALL
- xmlInitParser (void);
-XMLPUBFUN void XMLCALL
- xmlCleanupParser (void);
+XMLPUBFUN void XMLCALL
+xmlInitParser (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupParser (void);
/*
* Input functions
*/
-XMLPUBFUN int XMLCALL
- xmlParserInputRead (xmlParserInputPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputGrow (xmlParserInputPtr in,
- int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputRead (xmlParserInputPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputGrow (xmlParserInputPtr in,
+ int len);
/*
* Basic parsing Interfaces
*/
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseDoc (const xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseFile (const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseMemory (const char *buffer,
- int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseDoc (const xmlChar *cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseFile (const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseMemory (const char *buffer,
+ int size);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlSubstituteEntitiesDefault(int val);
-XMLPUBFUN int XMLCALL
- xmlKeepBlanksDefault (int val);
-XMLPUBFUN void XMLCALL
- xmlStopParser (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlPedanticParserDefault(int val);
-XMLPUBFUN int XMLCALL
- xmlLineNumbersDefault (int val);
+XMLPUBFUN int XMLCALL
+xmlSubstituteEntitiesDefault(int val);
+XMLPUBFUN int XMLCALL
+xmlKeepBlanksDefault (int val);
+XMLPUBFUN void XMLCALL
+xmlStopParser (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlPedanticParserDefault(int val);
+XMLPUBFUN int XMLCALL
+xmlLineNumbersDefault (int val);
#ifdef LIBXML_SAX1_ENABLED
/*
- * Recovery mode
+ * Recovery mode
*/
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverDoc (const xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverMemory (const char *buffer,
- int size);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverFile (const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverDoc (const xmlChar *cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverMemory (const char *buffer,
+ int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverFile (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
/*
* Less common routines and SAX interfaces
*/
-XMLPUBFUN int XMLCALL
- xmlParseDocument (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseDocument (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *buffer,
- int size);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseDoc (xmlSAXHandlerPtr sax,
- const xmlChar *cur,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemory (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery,
- void *data);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFile (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery,
- void *data);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseEntity (xmlSAXHandlerPtr sax,
- const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseEntity (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *buffer,
+ int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseDoc (xmlSAXHandlerPtr sax,
+ const xmlChar *cur,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseMemory (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery,
+ void *data);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseFile (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery,
+ void *data);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseEntity (xmlSAXHandlerPtr sax,
+ const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseEntity (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlSAXParseDTD (xmlSAXHandlerPtr sax,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlParseDTD (const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlIOParseDTD (xmlSAXHandlerPtr sax,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlSAXParseDTD (xmlSAXHandlerPtr sax,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlParseDTD (const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlIOParseDTD (xmlSAXHandlerPtr sax,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
#endif /* LIBXML_VALID_ENABLE */
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemory(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseBalancedChunkMemory(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN xmlParserErrors XMLCALL
- xmlParseInNodeContext (xmlNodePtr node,
- const char *data,
- int datalen,
- int options,
- xmlNodePtr *lst);
+xmlParseInNodeContext (xmlNodePtr node,
+ const char *data,
+ int datalen,
+ int options,
+ xmlNodePtr *lst);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst,
- int recover);
-XMLPUBFUN int XMLCALL
- xmlParseExternalEntity (xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst,
+ int recover);
+XMLPUBFUN int XMLCALL
+xmlParseExternalEntity (xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
/*
* Parser contexts handling.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlNewParserCtxt (void);
-XMLPUBFUN int XMLCALL
- xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlNewParserCtxt (void);
+XMLPUBFUN int XMLCALL
+xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
- const xmlChar* buffer,
- const char *filename);
+XMLPUBFUN void XMLCALL
+xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
+ const xmlChar* buffer,
+ const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateDocParserCtxt (const xmlChar *cur);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateDocParserCtxt (const xmlChar *cur);
#ifdef LIBXML_LEGACY_ENABLED
/*
* Reading/setting optional parsing features.
*/
-XMLPUBFUN int XMLCALL
- xmlGetFeaturesList (int *len,
- const char **result);
-XMLPUBFUN int XMLCALL
- xmlGetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *result);
-XMLPUBFUN int XMLCALL
- xmlSetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *value);
+XMLPUBFUN int XMLCALL
+xmlGetFeaturesList (int *len,
+ const char **result);
+XMLPUBFUN int XMLCALL
+xmlGetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *result);
+XMLPUBFUN int XMLCALL
+xmlSetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *value);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef LIBXML_PUSH_ENABLED
/*
* Interfaces for the Push mode.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlParseChunk (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlParseChunk (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
/*
* Special I/O mode.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
- void *user_data,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
+ void *user_data,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
/*
* Node infos.
*/
XMLPUBFUN const xmlParserNodeInfo* XMLCALL
- xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
- const xmlNodePtr node);
-XMLPUBFUN void XMLCALL
- xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN void XMLCALL
- xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN unsigned long XMLCALL
- xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
- const xmlNodePtr node);
-XMLPUBFUN void XMLCALL
- xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
- const xmlParserNodeInfoPtr info);
+xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
+ const xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+XMLPUBFUN void XMLCALL
+xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+XMLPUBFUN unsigned long XMLCALL
+xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
+ const xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
+ const xmlParserNodeInfoPtr info);
/*
* External entities handling actually implemented in xmlIO.
*/
-XMLPUBFUN void XMLCALL
- xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
+XMLPUBFUN void XMLCALL
+xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
XMLPUBFUN xmlExternalEntityLoader XMLCALL
- xmlGetExternalEntityLoader(void);
+xmlGetExternalEntityLoader(void);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlLoadExternalEntity (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+xmlLoadExternalEntity (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
/*
* Index lookup, actually implemented in the encoding module
*/
XMLPUBFUN long XMLCALL
- xmlByteConsumed (xmlParserCtxtPtr ctxt);
+xmlByteConsumed (xmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -1104,75 +1104,75 @@ typedef enum {
} xmlParserOption;
XMLPUBFUN void XMLCALL
- xmlCtxtReset (xmlParserCtxtPtr ctxt);
+xmlCtxtReset (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- const char *filename,
- const char *encoding);
+xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ const char *filename,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
- int options);
+xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFile (const char *URL,
- const char *encoding,
- int options);
+xmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Library wide options
@@ -1220,7 +1220,7 @@ typedef enum {
} xmlFeature;
XMLPUBFUN int XMLCALL
- xmlHasFeature (xmlFeature feature);
+xmlHasFeature (xmlFeature feature);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/parserInternals.h b/thirdparties/s60/include/libxml/parserInternals.h
index a5e75b5..d81d65c 100755
--- a/thirdparties/s60/include/libxml/parserInternals.h
+++ b/thirdparties/s60/include/libxml/parserInternals.h
@@ -153,7 +153,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*
* Always false (all combining chars > 0xff)
*/
-#define IS_COMBINING_CH(c) 0
+#define IS_COMBINING_CH(c) 0
/**
* IS_EXTENDER:
@@ -194,7 +194,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
* Macro to check the following production in the XML spec:
*
*
- * [84] Letter ::= BaseChar | Ideographic
+ * [84] Letter ::= BaseChar | Ideographic
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
@@ -288,178 +288,178 @@ XMLPUBFUN int XMLCALL xmlIsLetter (int c);
/**
* Parser context.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateFileParserCtxt (const char *filename);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateURLParserCtxt (const char *filename,
- int options);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateMemoryParserCtxt(const char *buffer,
- int size);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateEntityParserCtxt(const xmlChar *URL,
- const xmlChar *ID,
- const xmlChar *base);
-XMLPUBFUN int XMLCALL
- xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncodingHandlerPtr handler);
-XMLPUBFUN int XMLCALL
- xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateFileParserCtxt (const char *filename);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateURLParserCtxt (const char *filename,
+ int options);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateEntityParserCtxt(const xmlChar *URL,
+ const xmlChar *ID,
+ const xmlChar *base);
+XMLPUBFUN int XMLCALL
+xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN int XMLCALL
+xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input,
+ xmlCharEncodingHandlerPtr handler);
#ifdef IN_LIBXML
/* internal error reporting */
XMLPUBFUN void XMLCALL
- __xmlErrEncoding (xmlParserCtxtPtr ctxt,
- xmlParserErrors xmlerr,
- const char *msg,
- const xmlChar * str1,
- const xmlChar * str2);
+__xmlErrEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserErrors xmlerr,
+ const char *msg,
+ const xmlChar * str1,
+ const xmlChar * str2);
#endif
/**
* Input Streams.
*/
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
- const xmlChar *buffer);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
-XMLPUBFUN int XMLCALL
- xmlPushInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input);
-XMLPUBFUN xmlChar XMLCALL
- xmlPopInput (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlFreeInputStream (xmlParserInputPtr input);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
- const char *filename);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputStream (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
+ const xmlChar *buffer);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
+XMLPUBFUN int XMLCALL
+xmlPushInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input);
+XMLPUBFUN xmlChar XMLCALL
+xmlPopInput (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlFreeInputStream (xmlParserInputPtr input);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
+ const char *filename);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewInputStream (xmlParserCtxtPtr ctxt);
/**
* Namespaces.
*/
-XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName (xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlChar **prefix);
+XMLPUBFUN xmlChar * XMLCALL
+xmlSplitQName (xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlChar **prefix);
/**
* Generic production rules.
*/
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseNmtoken (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseEntityValue (xmlParserCtxtPtr ctxt,
- xmlChar **orig);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseAttValue (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseCharData (xmlParserCtxtPtr ctxt,
- int cdata);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseExternalID (xmlParserCtxtPtr ctxt,
- xmlChar **publicID,
- int strict);
-XMLPUBFUN void XMLCALL
- xmlParseComment (xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParsePITarget (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParsePI (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
- xmlChar **value);
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseNotationType (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
-XMLPUBFUN int XMLCALL
- xmlParseAttributeType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
-XMLPUBFUN void XMLCALL
- xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementMixedContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementChildrenContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
-XMLPUBFUN int XMLCALL
- xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlElementContentPtr *result);
-XMLPUBFUN int XMLCALL
- xmlParseElementDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseCharRef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlParseEntityRef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseReference (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParsePEReference (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseNmtoken (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseEntityValue (xmlParserCtxtPtr ctxt,
+ xmlChar **orig);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseAttValue (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseCharData (xmlParserCtxtPtr ctxt,
+ int cdata);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseExternalID (xmlParserCtxtPtr ctxt,
+ xmlChar **publicID,
+ int strict);
+XMLPUBFUN void XMLCALL
+xmlParseComment (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParsePITarget (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParsePI (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlParseNotationType (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
+XMLPUBFUN int XMLCALL
+xmlParseAttributeType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
+XMLPUBFUN void XMLCALL
+xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlParseElementMixedContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlParseElementChildrenContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
+XMLPUBFUN int XMLCALL
+xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlElementContentPtr *result);
+XMLPUBFUN int XMLCALL
+xmlParseElementDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseCharRef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlParseEntityRef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseReference (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParsePEReference (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseAttribute (xmlParserCtxtPtr ctxt,
- xmlChar **value);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseStartTag (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseEndTag (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseAttribute (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseStartTag (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseEndTag (xmlParserCtxtPtr ctxt);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlParseCDSect (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseContent (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseElement (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionNum (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseEncName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseSDDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseTextDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseMisc (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+xmlParseCDSect (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseContent (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseElement (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseVersionNum (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseEncName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseSDDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseTextDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseMisc (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* XML_SUBSTITUTE_NONE:
*
@@ -486,41 +486,41 @@ XMLPUBFUN void XMLCALL
#define XML_SUBSTITUTE_BOTH 3
XMLPUBFUN xmlChar * XMLCALL
- xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
XMLPUBFUN xmlChar * XMLCALL
- xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
- xmlNodePtr value);
+ xmlNodePtr value);
XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr value);
+ xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
- const xmlChar *value);
+ const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- int *len);
+ const xmlChar *cur,
+ int *len);
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
@@ -528,12 +528,12 @@ XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
* Really core function shared with HTML parser.
*/
XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
- int *len);
+ int *len);
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
- int val);
+ int val);
XMLPUBFUN int XMLCALL xmlCopyChar (int len,
- xmlChar *out,
- int val);
+ xmlChar *out,
+ int val);
XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
@@ -543,7 +543,7 @@ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
*/
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
- const char *encoding);
+ const char *encoding);
#endif
/*
@@ -561,38 +561,38 @@ XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filenam
* provenance of a chunk of nodes inherited from an entity replacement.
*/
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
- xmlNodePtr firstNode,
- xmlNodePtr lastNode);
-
+ xmlNodePtr firstNode,
+ xmlNodePtr lastNode);
+
XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseQuotedString (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseQuotedString (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseNamespace (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlScanName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
+xmlParseNamespace (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlScanName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
- xmlChar **prefix);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
+ xmlChar **prefix);
/**
* Entities
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlDecodeEntities (xmlParserCtxtPtr ctxt,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
-XMLPUBFUN void XMLCALL
- xmlHandleEntity (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
+xmlDecodeEntities (xmlParserCtxtPtr ctxt,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
+XMLPUBFUN void XMLCALL
+xmlHandleEntity (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
#endif /* LIBXML_LEGACY_ENABLED */
@@ -601,8 +601,8 @@ XMLPUBFUN void XMLCALL
* internal only
*/
XMLPUBFUN void XMLCALL
- xmlErrMemory (xmlParserCtxtPtr ctxt,
- const char *extra);
+xmlErrMemory (xmlParserCtxtPtr ctxt,
+ const char *extra);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/s60/include/libxml/pattern.h b/thirdparties/s60/include/libxml/pattern.h
index 97d2cd2..a697145 100755
--- a/thirdparties/s60/include/libxml/pattern.h
+++ b/thirdparties/s60/include/libxml/pattern.h
@@ -44,53 +44,53 @@ typedef enum {
} xmlPatternFlags;
XMLPUBFUN void XMLCALL
- xmlFreePattern (xmlPatternPtr comp);
+xmlFreePattern (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreePatternList (xmlPatternPtr comp);
+xmlFreePatternList (xmlPatternPtr comp);
XMLPUBFUN xmlPatternPtr XMLCALL
- xmlPatterncompile (const xmlChar *pattern,
- xmlDict *dict,
- int flags,
- const xmlChar **namespaces);
+xmlPatterncompile (const xmlChar *pattern,
+ xmlDict *dict,
+ int flags,
+ const xmlChar **namespaces);
XMLPUBFUN int XMLCALL
- xmlPatternMatch (xmlPatternPtr comp,
- xmlNodePtr node);
+xmlPatternMatch (xmlPatternPtr comp,
+ xmlNodePtr node);
/* streaming interfaces */
typedef struct _xmlStreamCtxt xmlStreamCtxt;
typedef xmlStreamCtxt *xmlStreamCtxtPtr;
XMLPUBFUN int XMLCALL
- xmlPatternStreamable (xmlPatternPtr comp);
+xmlPatternStreamable (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMaxDepth (xmlPatternPtr comp);
+xmlPatternMaxDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMinDepth (xmlPatternPtr comp);
+xmlPatternMinDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternFromRoot (xmlPatternPtr comp);
+xmlPatternFromRoot (xmlPatternPtr comp);
XMLPUBFUN xmlStreamCtxtPtr XMLCALL
- xmlPatternGetStreamCtxt (xmlPatternPtr comp);
+xmlPatternGetStreamCtxt (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
+xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamPushNode (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns,
- int nodeType);
+xmlStreamPushNode (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns,
+ int nodeType);
XMLPUBFUN int XMLCALL
- xmlStreamPush (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPush (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPushAttr (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPushAttr (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPop (xmlStreamCtxtPtr stream);
+xmlStreamPop (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
+xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/relaxng.h b/thirdparties/s60/include/libxml/relaxng.h
index bdb0a7d..59695c4 100755
--- a/thirdparties/s60/include/libxml/relaxng.h
+++ b/thirdparties/s60/include/libxml/relaxng.h
@@ -113,96 +113,96 @@ typedef enum {
} xmlRelaxNGParserFlag;
XMLPUBFUN int XMLCALL
- xmlRelaxNGInitTypes (void);
+xmlRelaxNGInitTypes (void);
XMLPUBFUN void XMLCALL
- xmlRelaxNGCleanupTypes (void);
+xmlRelaxNGCleanupTypes (void);
/*
* Interfaces for parsing.
*/
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewParserCtxt (const char *URL);
+xmlRelaxNGNewParserCtxt (const char *URL);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewMemParserCtxt (const char *buffer,
- int size);
+xmlRelaxNGNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
+xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
- int flag);
+xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
+ int flag);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserStructuredErrors(
- xmlRelaxNGParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlRelaxNGSetParserStructuredErrors(
+ xmlRelaxNGParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN xmlRelaxNGPtr XMLCALL
- xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFree (xmlRelaxNGPtr schema);
+xmlRelaxNGFree (xmlRelaxNGPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlRelaxNGDump (FILE *output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDump (FILE *output,
+ xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGDumpTree (FILE * output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDumpTree (FILE * output,
+ xmlRelaxNGPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror, void *ctx);
+xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror, void *ctx);
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
- xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
+xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
+xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc);
/*
* Interfaces for progressive validation when possible
*/
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
+xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/schemasInternals.h b/thirdparties/s60/include/libxml/schemasInternals.h
index b68a6e1..67dd50e 100755
--- a/thirdparties/s60/include/libxml/schemasInternals.h
+++ b/thirdparties/s60/include/libxml/schemasInternals.h
@@ -74,7 +74,8 @@ typedef enum {
XML_SCHEMAS_BASE64BINARY,
XML_SCHEMAS_ANYTYPE,
XML_SCHEMAS_ANYSIMPLETYPE
-} xmlSchemaValType;
+}
+xmlSchemaValType;
/*
* XML Schemas defines multiple type of types.
@@ -104,8 +105,8 @@ typedef enum {
XML_SCHEMA_TYPE_IDC_UNIQUE,
XML_SCHEMA_TYPE_IDC_KEY,
XML_SCHEMA_TYPE_IDC_KEYREF,
- XML_SCHEMA_TYPE_PARTICLE = 25,
- XML_SCHEMA_TYPE_ATTRIBUTE_USE,
+ XML_SCHEMA_TYPE_PARTICLE = 25,
+ XML_SCHEMA_TYPE_ATTRIBUTE_USE,
XML_SCHEMA_FACET_MININCLUSIVE = 1000,
XML_SCHEMA_FACET_MINEXCLUSIVE,
XML_SCHEMA_FACET_MAXINCLUSIVE,
@@ -698,11 +699,11 @@ struct _xmlSchemaType {
* references have been resolved.
*/
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
- /**
- * XML_SCHEMAS_ELEM_CIRCULAR:
- *
- * a helper flag for the search of circular references.
- */
+/**
+* XML_SCHEMAS_ELEM_CIRCULAR:
+*
+* a helper flag for the search of circular references.
+*/
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
/**
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
diff --git a/thirdparties/s60/include/libxml/schematron.h b/thirdparties/s60/include/libxml/schematron.h
index f442826..8c835ad 100755
--- a/thirdparties/s60/include/libxml/schematron.h
+++ b/thirdparties/s60/include/libxml/schematron.h
@@ -29,7 +29,8 @@ typedef enum {
XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */
XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
-} xmlSchematronValidOptions;
+}
+xmlSchematronValidOptions;
/**
* The schemas related types are kept internal
@@ -69,17 +70,17 @@ typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
/*
* Interfaces for parsing.
*/
-XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewParserCtxt (const char *URL);
-XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewMemParserCtxt(const char *buffer,
- int size);
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
- xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
+xmlSchematronNewParserCtxt (const char *URL);
+XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
+xmlSchematronNewMemParserCtxt(const char *buffer,
+ int size);
+XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
+xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
/*****
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
xmlSchematronValidityErrorFunc err,
xmlSchematronValidityWarningFunc warn,
@@ -92,20 +93,20 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
*****/
-XMLPUBFUN xmlSchematronPtr XMLCALL
- xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlSchematronFree (xmlSchematronPtr schema);
+XMLPUBFUN xmlSchematronPtr XMLCALL
+xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlSchematronFree (xmlSchematronPtr schema);
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlSchematronSetValidStructuredErrors(
- xmlSchematronValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchematronSetValidStructuredErrors(
+ xmlSchematronValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
/******
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
xmlSchematronValidityErrorFunc err,
xmlSchematronValidityWarningFunc warn,
@@ -125,14 +126,14 @@ XMLPUBFUN int XMLCALL
xmlNodePtr elem);
*******/
-XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
- xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
- int options);
-XMLPUBFUN void XMLCALL
- xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
- xmlDocPtr instance);
+XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
+xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
+ int options);
+XMLPUBFUN void XMLCALL
+xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
+ xmlDocPtr instance);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/threads.h b/thirdparties/s60/include/libxml/threads.h
index d31f16a..b9db53e 100755
--- a/thirdparties/s60/include/libxml/threads.h
+++ b/thirdparties/s60/include/libxml/threads.h
@@ -37,40 +37,40 @@ typedef xmlRMutex *xmlRMutexPtr;
extern "C" {
#endif
XMLPUBFUN xmlMutexPtr XMLCALL
- xmlNewMutex (void);
+xmlNewMutex (void);
XMLPUBFUN void XMLCALL
- xmlMutexLock (xmlMutexPtr tok);
+xmlMutexLock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlMutexUnlock (xmlMutexPtr tok);
+xmlMutexUnlock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeMutex (xmlMutexPtr tok);
+xmlFreeMutex (xmlMutexPtr tok);
XMLPUBFUN xmlRMutexPtr XMLCALL
- xmlNewRMutex (void);
+xmlNewRMutex (void);
XMLPUBFUN void XMLCALL
- xmlRMutexLock (xmlRMutexPtr tok);
+xmlRMutexLock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlRMutexUnlock (xmlRMutexPtr tok);
+xmlRMutexUnlock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeRMutex (xmlRMutexPtr tok);
+xmlFreeRMutex (xmlRMutexPtr tok);
/*
* Library wide APIs.
*/
XMLPUBFUN void XMLCALL
- xmlInitThreads (void);
+xmlInitThreads (void);
XMLPUBFUN void XMLCALL
- xmlLockLibrary (void);
+xmlLockLibrary (void);
XMLPUBFUN void XMLCALL
- xmlUnlockLibrary(void);
+xmlUnlockLibrary(void);
XMLPUBFUN int XMLCALL
- xmlGetThreadId (void);
+xmlGetThreadId (void);
XMLPUBFUN int XMLCALL
- xmlIsMainThread (void);
+xmlIsMainThread (void);
XMLPUBFUN void XMLCALL
- xmlCleanupThreads(void);
+xmlCleanupThreads(void);
XMLPUBFUN xmlGlobalStatePtr XMLCALL
- xmlGetGlobalState(void);
+xmlGetGlobalState(void);
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
diff --git a/thirdparties/s60/include/libxml/tree.h b/thirdparties/s60/include/libxml/tree.h
index b733589..286a977 100755
--- a/thirdparties/s60/include/libxml/tree.h
+++ b/thirdparties/s60/include/libxml/tree.h
@@ -139,7 +139,7 @@ typedef enum {
XML_XINCLUDE_START= 19,
XML_XINCLUDE_END= 20
#ifdef LIBXML_DOCB_ENABLED
- ,XML_DOCB_DOCUMENT_NODE= 21
+ ,XML_DOCB_DOCUMENT_NODE= 21
#endif
} xmlElementType;
@@ -479,7 +479,7 @@ struct _xmlNode {
/**
* XML_GET_LINE:
*
- * Macro to extract the line number of an element node.
+ * Macro to extract the line number of an element node.
*/
#define XML_GET_LINE(n) \
(xmlGetLineNo(n))
@@ -522,7 +522,7 @@ struct _xmlDoc {
/* End of common part */
int compression;/* level of zlib compression */
- int standalone; /* standalone document (no external refs)
+ int standalone; /* standalone document (no external refs)
1 if standalone="yes"
0 if standalone="no"
-1 if there is no XML declaration
@@ -553,18 +553,18 @@ typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
/**
* xmlDOMWrapAcquireNsFunction:
* @ctxt: a DOM wrapper context
- * @node: the context node (element or attribute)
+ * @node: the context node (element or attribute)
* @nsName: the requested namespace name
- * @nsPrefix: the requested namespace prefix
+ * @nsPrefix: the requested namespace prefix
*
* A function called to acquire namespaces (xmlNs) from the wrapper.
*
* Returns an xmlNsPtr or NULL in case of an error.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr node,
- const xmlChar *nsName,
- const xmlChar *nsPrefix);
+ xmlNodePtr node,
+ const xmlChar *nsName,
+ const xmlChar *nsPrefix);
/**
* xmlDOMWrapCtxt:
@@ -602,7 +602,7 @@ struct _xmlDOMWrapCtxt {
/**
* xmlRootNode:
*
- * Macro for compatibility naming layer with libxml1. Maps
+ * Macro for compatibility naming layer with libxml1. Maps
* to "children".
*/
#ifndef xmlRootNode
@@ -618,612 +618,612 @@ struct _xmlDOMWrapCtxt {
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
XMLPUBFUN int XMLCALL
- xmlValidateNCName (const xmlChar *value,
- int space);
+xmlValidateNCName (const xmlChar *value,
+ int space);
#endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlValidateQName (const xmlChar *value,
- int space);
-XMLPUBFUN int XMLCALL
- xmlValidateName (const xmlChar *value,
- int space);
-XMLPUBFUN int XMLCALL
- xmlValidateNMToken (const xmlChar *value,
- int space);
+XMLPUBFUN int XMLCALL
+xmlValidateQName (const xmlChar *value,
+ int space);
+XMLPUBFUN int XMLCALL
+xmlValidateName (const xmlChar *value,
+ int space);
+XMLPUBFUN int XMLCALL
+xmlValidateNMToken (const xmlChar *value,
+ int space);
#endif
-XMLPUBFUN xmlChar * XMLCALL
- xmlBuildQName (const xmlChar *ncname,
- const xmlChar *prefix,
- xmlChar *memory,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName2 (const xmlChar *name,
- xmlChar **prefix);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlSplitQName3 (const xmlChar *name,
- int *len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlBuildQName (const xmlChar *ncname,
+ const xmlChar *prefix,
+ xmlChar *memory,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlSplitQName2 (const xmlChar *name,
+ xmlChar **prefix);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlSplitQName3 (const xmlChar *name,
+ int *len);
/*
* Handling Buffers.
*/
-XMLPUBFUN void XMLCALL
- xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL
- xmlGetBufferAllocationScheme(void);
-
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreate (void);
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateSize (size_t size);
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateStatic (void *mem,
- size_t size);
-XMLPUBFUN int XMLCALL
- xmlBufferResize (xmlBufferPtr buf,
- unsigned int size);
-XMLPUBFUN void XMLCALL
- xmlBufferFree (xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL
- xmlBufferDump (FILE *file,
- xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL
- xmlBufferAdd (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
-XMLPUBFUN int XMLCALL
- xmlBufferAddHead (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
-XMLPUBFUN int XMLCALL
- xmlBufferCat (xmlBufferPtr buf,
- const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlBufferCCat (xmlBufferPtr buf,
- const char *str);
-XMLPUBFUN int XMLCALL
- xmlBufferShrink (xmlBufferPtr buf,
- unsigned int len);
-XMLPUBFUN int XMLCALL
- xmlBufferGrow (xmlBufferPtr buf,
- unsigned int len);
-XMLPUBFUN void XMLCALL
- xmlBufferEmpty (xmlBufferPtr buf);
-XMLPUBFUN const xmlChar* XMLCALL
- xmlBufferContent (const xmlBufferPtr buf);
-XMLPUBFUN void XMLCALL
- xmlBufferSetAllocationScheme(xmlBufferPtr buf,
- xmlBufferAllocationScheme scheme);
-XMLPUBFUN int XMLCALL
- xmlBufferLength (const xmlBufferPtr buf);
+XMLPUBFUN void XMLCALL
+xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
+XMLPUBFUN xmlBufferAllocationScheme XMLCALL
+xmlGetBufferAllocationScheme(void);
+
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreate (void);
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreateSize (size_t size);
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreateStatic (void *mem,
+ size_t size);
+XMLPUBFUN int XMLCALL
+xmlBufferResize (xmlBufferPtr buf,
+ unsigned int size);
+XMLPUBFUN void XMLCALL
+xmlBufferFree (xmlBufferPtr buf);
+XMLPUBFUN int XMLCALL
+xmlBufferDump (FILE *file,
+ xmlBufferPtr buf);
+XMLPUBFUN int XMLCALL
+xmlBufferAdd (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlBufferAddHead (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlBufferCat (xmlBufferPtr buf,
+ const xmlChar *str);
+XMLPUBFUN int XMLCALL
+xmlBufferCCat (xmlBufferPtr buf,
+ const char *str);
+XMLPUBFUN int XMLCALL
+xmlBufferShrink (xmlBufferPtr buf,
+ unsigned int len);
+XMLPUBFUN int XMLCALL
+xmlBufferGrow (xmlBufferPtr buf,
+ unsigned int len);
+XMLPUBFUN void XMLCALL
+xmlBufferEmpty (xmlBufferPtr buf);
+XMLPUBFUN const xmlChar* XMLCALL
+xmlBufferContent (const xmlBufferPtr buf);
+XMLPUBFUN void XMLCALL
+xmlBufferSetAllocationScheme(xmlBufferPtr buf,
+ xmlBufferAllocationScheme scheme);
+XMLPUBFUN int XMLCALL
+xmlBufferLength (const xmlBufferPtr buf);
/*
* Creating/freeing new structures.
*/
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCreateIntSubset (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlNewDtd (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlGetIntSubset (xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlFreeDtd (xmlDtdPtr cur);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlCreateIntSubset (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlNewDtd (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlGetIntSubset (xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewGlobalNs (xmlDocPtr doc,
- const xmlChar *href,
- const xmlChar *prefix);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlNewGlobalNs (xmlDocPtr doc,
+ const xmlChar *href,
+ const xmlChar *prefix);
#endif /* LIBXML_LEGACY_ENABLED */
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewNs (xmlNodePtr node,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- xmlFreeNs (xmlNsPtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeNsList (xmlNsPtr cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlNewDoc (const xmlChar *version);
-XMLPUBFUN void XMLCALL
- xmlFreeDoc (xmlDocPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewDocProp (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlNewNs (xmlNodePtr node,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+xmlFreeNs (xmlNsPtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeNsList (xmlNsPtr cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlNewDoc (const xmlChar *version);
+XMLPUBFUN void XMLCALL
+xmlFreeDoc (xmlDocPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewDocProp (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *value);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
#endif
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsPropEatName (xmlNodePtr node,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlFreePropList (xmlAttrPtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeProp (xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyProp (xmlNodePtr target,
- xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyPropList (xmlNodePtr target,
- xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewNsPropEatName (xmlNodePtr node,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+xmlFreePropList (xmlAttrPtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeProp (xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlCopyProp (xmlNodePtr target,
+ xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlCopyPropList (xmlNodePtr target,
+ xmlAttrPtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCopyDtd (xmlDtdPtr dtd);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlCopyDtd (xmlDtdPtr dtd);
#endif /* LIBXML_TREE_ENABLED */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlCopyDoc (xmlDocPtr doc,
- int recursive);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlCopyDoc (xmlDocPtr doc,
+ int recursive);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Creating new nodes.
*/
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNodeEatName (xmlDocPtr doc,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNode (xmlNsPtr ns,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNodeEatName (xmlNsPtr ns,
- xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocNodeEatName (xmlDocPtr doc,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewNode (xmlNsPtr ns,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewNodeEatName (xmlNsPtr ns,
+ xmlChar *name);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
#endif
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocText (xmlDocPtr doc,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewText (const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocPI (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewPI (const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocTextLen (xmlDocPtr doc,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextLen (const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocComment (xmlDocPtr doc,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewComment (const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCDataBlock (xmlDocPtr doc,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCharRef (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewReference (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNode (const xmlNodePtr node,
- int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNode (const xmlNodePtr node,
- xmlDocPtr doc,
- int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNodeList (xmlDocPtr doc,
- const xmlNodePtr node);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNodeList (const xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocText (xmlDocPtr doc,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewText (const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocPI (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewPI (const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocTextLen (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewTextLen (const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocComment (xmlDocPtr doc,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewComment (const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewCDataBlock (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewCharRef (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewReference (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlCopyNode (const xmlNodePtr node,
+ int recursive);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocCopyNode (const xmlNodePtr node,
+ xmlDocPtr doc,
+ int recursive);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocCopyNodeList (xmlDocPtr doc,
+ const xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlCopyNodeList (const xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocRawNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocFragment (xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewTextChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocRawNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocFragment (xmlDocPtr doc);
#endif /* LIBXML_TREE_ENABLED */
/*
* Navigating.
*/
-XMLPUBFUN long XMLCALL
- xmlGetLineNo (xmlNodePtr node);
+XMLPUBFUN long XMLCALL
+xmlGetLineNo (xmlNodePtr node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNodePath (xmlNodePtr node);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNodePath (xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocGetRootElement (xmlDocPtr doc);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlGetLastChild (xmlNodePtr parent);
-XMLPUBFUN int XMLCALL
- xmlNodeIsText (xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlIsBlankNode (xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocGetRootElement (xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlGetLastChild (xmlNodePtr parent);
+XMLPUBFUN int XMLCALL
+xmlNodeIsText (xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlIsBlankNode (xmlNodePtr node);
/*
* Changing the structure.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocSetRootElement (xmlDocPtr doc,
- xmlNodePtr root);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocSetRootElement (xmlDocPtr doc,
+ xmlNodePtr root);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetName (xmlNodePtr cur,
- const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlNodeSetName (xmlNodePtr cur,
+ const xmlChar *name);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChild (xmlNodePtr parent,
- xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChildList (xmlNodePtr parent,
- xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddChild (xmlNodePtr parent,
+ xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddChildList (xmlNodePtr parent,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlReplaceNode (xmlNodePtr old,
- xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlReplaceNode (xmlNodePtr old,
+ xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddPrevSibling (xmlNodePtr cur,
- xmlNodePtr elem);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddPrevSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddSibling (xmlNodePtr cur,
- xmlNodePtr elem);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddNextSibling (xmlNodePtr cur,
- xmlNodePtr elem);
-XMLPUBFUN void XMLCALL
- xmlUnlinkNode (xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextMerge (xmlNodePtr first,
- xmlNodePtr second);
-XMLPUBFUN int XMLCALL
- xmlTextConcat (xmlNodePtr node,
- const xmlChar *content,
- int len);
-XMLPUBFUN void XMLCALL
- xmlFreeNodeList (xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeNode (xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- xmlSetTreeDoc (xmlNodePtr tree,
- xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlSetListDoc (xmlNodePtr list,
- xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddNextSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
+XMLPUBFUN void XMLCALL
+xmlUnlinkNode (xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlTextMerge (xmlNodePtr first,
+ xmlNodePtr second);
+XMLPUBFUN int XMLCALL
+xmlTextConcat (xmlNodePtr node,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlFreeNodeList (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeNode (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlSetTreeDoc (xmlNodePtr tree,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlSetListDoc (xmlNodePtr list,
+ xmlDocPtr doc);
/*
* Namespaces.
*/
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNs (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNsByHref (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *href);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlSearchNs (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlSearchNsByHref (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *href);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNsPtr * XMLCALL
- xmlGetNsList (xmlDocPtr doc,
- xmlNodePtr node);
+XMLPUBFUN xmlNsPtr * XMLCALL
+xmlGetNsList (xmlDocPtr doc,
+ xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
-XMLPUBFUN void XMLCALL
- xmlSetNs (xmlNodePtr node,
- xmlNsPtr ns);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespace (xmlNsPtr cur);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespaceList (xmlNsPtr cur);
+XMLPUBFUN void XMLCALL
+xmlSetNs (xmlNodePtr node,
+ xmlNsPtr ns);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlCopyNamespace (xmlNsPtr cur);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlCopyNamespaceList (xmlNsPtr cur);
/*
* Changing the content.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlSetProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlSetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNoNsProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringGetNodeList (xmlDocPtr doc,
- const xmlChar *value);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringLenGetNodeList (xmlDocPtr doc,
- const xmlChar *value,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNoNsProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlHasProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlHasNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlStringGetNodeList (xmlDocPtr doc,
+ const xmlChar *value);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlStringLenGetNodeList (xmlDocPtr doc,
+ const xmlChar *value,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeListGetString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetRawString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeListGetRawString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNodeSetContent (xmlNodePtr cur,
- const xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlNodeSetContent (xmlNodePtr cur,
+ const xmlChar *content);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
+XMLPUBFUN void XMLCALL
+xmlNodeSetContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNodeAddContent (xmlNodePtr cur,
- const xmlChar *content);
-XMLPUBFUN void XMLCALL
- xmlNodeAddContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetContent (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlNodeAddContent (xmlNodePtr cur,
+ const xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlNodeAddContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetContent (xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+xmlNodeBufGetContent (xmlBufferPtr buffer,
+ xmlNodePtr cur);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetLang (xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlNodeBufGetContent (xmlBufferPtr buffer,
- xmlNodePtr cur);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetLang (xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- xmlNodeGetSpacePreserve (xmlNodePtr cur);
+xmlNodeGetSpacePreserve (xmlNodePtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetLang (xmlNodePtr cur,
- const xmlChar *lang);
-XMLPUBFUN void XMLCALL
- xmlNodeSetSpacePreserve (xmlNodePtr cur,
- int val);
+XMLPUBFUN void XMLCALL
+xmlNodeSetLang (xmlNodePtr cur,
+ const xmlChar *lang);
+XMLPUBFUN void XMLCALL
+xmlNodeSetSpacePreserve (xmlNodePtr cur,
+ int val);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetBase (xmlDocPtr doc,
- xmlNodePtr cur);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetBase (xmlDocPtr doc,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlNodeSetBase (xmlNodePtr cur,
- const xmlChar *uri);
+XMLPUBFUN void XMLCALL
+xmlNodeSetBase (xmlNodePtr cur,
+ const xmlChar *uri);
#endif
/*
* Removing content.
*/
-XMLPUBFUN int XMLCALL
- xmlRemoveProp (xmlAttrPtr cur);
+XMLPUBFUN int XMLCALL
+xmlRemoveProp (xmlAttrPtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlUnsetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name);
-XMLPUBFUN int XMLCALL
- xmlUnsetProp (xmlNodePtr node,
- const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlUnsetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlUnsetProp (xmlNodePtr node,
+ const xmlChar *name);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Internal, don't use.
*/
-XMLPUBFUN void XMLCALL
- xmlBufferWriteCHAR (xmlBufferPtr buf,
- const xmlChar *string);
-XMLPUBFUN void XMLCALL
- xmlBufferWriteChar (xmlBufferPtr buf,
- const char *string);
-XMLPUBFUN void XMLCALL
- xmlBufferWriteQuotedString(xmlBufferPtr buf,
- const xmlChar *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteCHAR (xmlBufferPtr buf,
+ const xmlChar *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteChar (xmlBufferPtr buf,
+ const char *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteQuotedString(xmlBufferPtr buf,
+ const xmlChar *string);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlAttrPtr attr,
- const xmlChar *string);
+ xmlDocPtr doc,
+ xmlAttrPtr attr,
+ const xmlChar *string);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_TREE_ENABLED
/*
* Namespace handling.
*/
-XMLPUBFUN int XMLCALL
- xmlReconciliateNs (xmlDocPtr doc,
- xmlNodePtr tree);
+XMLPUBFUN int XMLCALL
+xmlReconciliateNs (xmlDocPtr doc,
+ xmlNodePtr tree);
#endif
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Saving.
*/
-XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
-XMLPUBFUN void XMLCALL
- xmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
-XMLPUBFUN void XMLCALL
- xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding);
-XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding,
- int format);
-XMLPUBFUN int XMLCALL
- xmlDocFormatDump (FILE *f,
- xmlDocPtr cur,
- int format);
-XMLPUBFUN int XMLCALL
- xmlDocDump (FILE *f,
- xmlDocPtr cur);
-XMLPUBFUN void XMLCALL
- xmlElemDump (FILE *f,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- xmlSaveFile (const char *filename,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFile (const char *filename,
- xmlDocPtr cur,
- int format);
-XMLPUBFUN int XMLCALL
- xmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- xmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format,
- const char *encoding);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
+XMLPUBFUN void XMLCALL
+xmlDocDumpFormatMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
+XMLPUBFUN void XMLCALL
+xmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
+XMLPUBFUN void XMLCALL
+xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding);
+XMLPUBFUN void XMLCALL
+xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlDocFormatDump (FILE *f,
+ xmlDocPtr cur,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlDocDump (FILE *f,
+ xmlDocPtr cur);
+XMLPUBFUN void XMLCALL
+xmlElemDump (FILE *f,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+xmlSaveFile (const char *filename,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFile (const char *filename,
+ xmlDocPtr cur,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+xmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format,
+ const char *encoding);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* XHTML
*/
-XMLPUBFUN int XMLCALL
- xmlIsXHTML (const xmlChar *systemID,
- const xmlChar *publicID);
+XMLPUBFUN int XMLCALL
+xmlIsXHTML (const xmlChar *systemID,
+ const xmlChar *publicID);
/*
* Compression.
*/
-XMLPUBFUN int XMLCALL
- xmlGetDocCompressMode (xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlSetDocCompressMode (xmlDocPtr doc,
- int mode);
-XMLPUBFUN int XMLCALL
- xmlGetCompressMode (void);
-XMLPUBFUN void XMLCALL
- xmlSetCompressMode (int mode);
+XMLPUBFUN int XMLCALL
+xmlGetDocCompressMode (xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlSetDocCompressMode (xmlDocPtr doc,
+ int mode);
+XMLPUBFUN int XMLCALL
+xmlGetCompressMode (void);
+XMLPUBFUN void XMLCALL
+xmlSetCompressMode (int mode);
/*
* DOM-wrapper helper functions.
*/
XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL
- xmlDOMWrapNewCtxt (void);
+xmlDOMWrapNewCtxt (void);
XMLPUBFUN void XMLCALL
- xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
+xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr elem,
- int options);
+xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
+ xmlNodePtr elem,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int options);
+xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr node,
- int options);
+xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr node,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlNodePtr *clonedNode,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int deep,
- int options);
+xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlNodePtr *clonedNode,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int deep,
+ int options);
#ifdef LIBXML_TREE_ENABLED
/*
@@ -1231,15 +1231,15 @@ XMLPUBFUN int XMLCALL
* traversal.
*/
XMLPUBFUN unsigned long XMLCALL
- xmlChildElementCount (xmlNodePtr parent);
+xmlChildElementCount (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNextElementSibling (xmlNodePtr node);
+xmlNextElementSibling (xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlFirstElementChild (xmlNodePtr parent);
+xmlFirstElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlLastElementChild (xmlNodePtr parent);
+xmlLastElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlPreviousElementSibling (xmlNodePtr node);
+xmlPreviousElementSibling (xmlNodePtr node);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/uri.h b/thirdparties/s60/include/libxml/uri.h
index db48262..599c3e3 100755
--- a/thirdparties/s60/include/libxml/uri.h
+++ b/thirdparties/s60/include/libxml/uri.h
@@ -50,43 +50,43 @@ struct _xmlURI {
* xmlNodePtr cur);
*/
XMLPUBFUN xmlURIPtr XMLCALL
- xmlCreateURI (void);
+xmlCreateURI (void);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildRelativeURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildRelativeURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURI (const char *str);
+xmlParseURI (const char *str);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURIRaw (const char *str,
- int raw);
+xmlParseURIRaw (const char *str,
+ int raw);
XMLPUBFUN int XMLCALL
- xmlParseURIReference (xmlURIPtr uri,
- const char *str);
+xmlParseURIReference (xmlURIPtr uri,
+ const char *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlSaveUri (xmlURIPtr uri);
+xmlSaveUri (xmlURIPtr uri);
XMLPUBFUN void XMLCALL
- xmlPrintURI (FILE *stream,
- xmlURIPtr uri);
+xmlPrintURI (FILE *stream,
+ xmlURIPtr uri);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscapeStr (const xmlChar *str,
- const xmlChar *list);
+xmlURIEscapeStr (const xmlChar *str,
+ const xmlChar *list);
XMLPUBFUN char * XMLCALL
- xmlURIUnescapeString (const char *str,
- int len,
- char *target);
+xmlURIUnescapeString (const char *str,
+ int len,
+ char *target);
XMLPUBFUN int XMLCALL
- xmlNormalizeURIPath (char *path);
+xmlNormalizeURIPath (char *path);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscape (const xmlChar *str);
+xmlURIEscape (const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlFreeURI (xmlURIPtr uri);
+xmlFreeURI (xmlURIPtr uri);
XMLPUBFUN xmlChar* XMLCALL
- xmlCanonicPath (const xmlChar *path);
+xmlCanonicPath (const xmlChar *path);
XMLPUBFUN xmlChar* XMLCALL
- xmlPathToURI (const xmlChar *path);
+xmlPathToURI (const xmlChar *path);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/valid.h b/thirdparties/s60/include/libxml/valid.h
index a2307f1..b67a9d6 100755
--- a/thirdparties/s60/include/libxml/valid.h
+++ b/thirdparties/s60/include/libxml/valid.h
@@ -40,8 +40,8 @@ typedef xmlValidState *xmlValidStatePtr;
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlValidityWarningFunc:
@@ -55,8 +55,8 @@ typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
#ifdef IN_LIBXML
/**
@@ -150,306 +150,306 @@ typedef struct _xmlHashTable xmlRefTable;
typedef xmlRefTable *xmlRefTablePtr;
/* Notation */
-XMLPUBFUN xmlNotationPtr XMLCALL
- xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *PublicID,
- const xmlChar *SystemID);
+XMLPUBFUN xmlNotationPtr XMLCALL
+xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *PublicID,
+ const xmlChar *SystemID);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNotationTablePtr XMLCALL
- xmlCopyNotationTable (xmlNotationTablePtr table);
+XMLPUBFUN xmlNotationTablePtr XMLCALL
+xmlCopyNotationTable (xmlNotationTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeNotationTable (xmlNotationTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeNotationTable (xmlNotationTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpNotationDecl (xmlBufferPtr buf,
- xmlNotationPtr nota);
-XMLPUBFUN void XMLCALL
- xmlDumpNotationTable (xmlBufferPtr buf,
- xmlNotationTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpNotationDecl (xmlBufferPtr buf,
+ xmlNotationPtr nota);
+XMLPUBFUN void XMLCALL
+xmlDumpNotationTable (xmlBufferPtr buf,
+ xmlNotationTablePtr table);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Element Content */
/* the non Doc version are being deprecated */
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewElementContent (const xmlChar *name,
- xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyElementContent (xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlFreeElementContent (xmlElementContentPtr cur);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlNewElementContent (const xmlChar *name,
+ xmlElementContentType type);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlCopyElementContent (xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlFreeElementContent (xmlElementContentPtr cur);
/* the new versions with doc argument */
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewDocElementContent (xmlDocPtr doc,
- const xmlChar *name,
- xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlFreeDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr cur);
-XMLPUBFUN void XMLCALL
- xmlSnprintfElementContent(char *buf,
- int size,
- xmlElementContentPtr content,
- int englob);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlNewDocElementContent (xmlDocPtr doc,
+ const xmlChar *name,
+ xmlElementContentType type);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlCopyDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlFreeDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr cur);
+XMLPUBFUN void XMLCALL
+xmlSnprintfElementContent(char *buf,
+ int size,
+ xmlElementContentPtr content,
+ int englob);
#ifdef LIBXML_OUTPUT_ENABLED
/* DEPRECATED */
-XMLPUBFUN void XMLCALL
- xmlSprintfElementContent(char *buf,
- xmlElementContentPtr content,
- int englob);
+XMLPUBFUN void XMLCALL
+xmlSprintfElementContent(char *buf,
+ xmlElementContentPtr content,
+ int englob);
#endif /* LIBXML_OUTPUT_ENABLED */
/* DEPRECATED */
/* Element */
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlAddElementDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- xmlElementTypeVal type,
- xmlElementContentPtr content);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlAddElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ xmlElementTypeVal type,
+ xmlElementContentPtr content);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlElementTablePtr XMLCALL
- xmlCopyElementTable (xmlElementTablePtr table);
+XMLPUBFUN xmlElementTablePtr XMLCALL
+xmlCopyElementTable (xmlElementTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeElementTable (xmlElementTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeElementTable (xmlElementTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpElementTable (xmlBufferPtr buf,
- xmlElementTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlDumpElementDecl (xmlBufferPtr buf,
- xmlElementPtr elem);
+XMLPUBFUN void XMLCALL
+xmlDumpElementTable (xmlBufferPtr buf,
+ xmlElementTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpElementDecl (xmlBufferPtr buf,
+ xmlElementPtr elem);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCreateEnumeration (const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlFreeEnumeration (xmlEnumerationPtr cur);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlCreateEnumeration (const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlFreeEnumeration (xmlEnumerationPtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCopyEnumeration (xmlEnumerationPtr cur);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlCopyEnumeration (xmlEnumerationPtr cur);
#endif /* LIBXML_TREE_ENABLED */
/* Attribute */
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *ns,
- xmlAttributeType type,
- xmlAttributeDefault def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *ns,
+ xmlAttributeType type,
+ xmlAttributeDefault def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlAttributeTablePtr XMLCALL
- xmlCopyAttributeTable (xmlAttributeTablePtr table);
+XMLPUBFUN xmlAttributeTablePtr XMLCALL
+xmlCopyAttributeTable (xmlAttributeTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeAttributeTable (xmlAttributeTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeAttributeTable (xmlAttributeTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpAttributeTable (xmlBufferPtr buf,
- xmlAttributeTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlDumpAttributeDecl (xmlBufferPtr buf,
- xmlAttributePtr attr);
+XMLPUBFUN void XMLCALL
+xmlDumpAttributeTable (xmlBufferPtr buf,
+ xmlAttributeTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpAttributeDecl (xmlBufferPtr buf,
+ xmlAttributePtr attr);
#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */
-XMLPUBFUN xmlIDPtr XMLCALL
- xmlAddID (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL
- xmlFreeIDTable (xmlIDTablePtr table);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlGetID (xmlDocPtr doc,
- const xmlChar *ID);
-XMLPUBFUN int XMLCALL
- xmlIsID (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL
- xmlRemoveID (xmlDocPtr doc,
- xmlAttrPtr attr);
+XMLPUBFUN xmlIDPtr XMLCALL
+xmlAddID (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
+XMLPUBFUN void XMLCALL
+xmlFreeIDTable (xmlIDTablePtr table);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlGetID (xmlDocPtr doc,
+ const xmlChar *ID);
+XMLPUBFUN int XMLCALL
+xmlIsID (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
+XMLPUBFUN int XMLCALL
+xmlRemoveID (xmlDocPtr doc,
+ xmlAttrPtr attr);
/* IDREFs */
-XMLPUBFUN xmlRefPtr XMLCALL
- xmlAddRef (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL
- xmlFreeRefTable (xmlRefTablePtr table);
-XMLPUBFUN int XMLCALL
- xmlIsRef (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL
- xmlRemoveRef (xmlDocPtr doc,
- xmlAttrPtr attr);
-XMLPUBFUN xmlListPtr XMLCALL
- xmlGetRefs (xmlDocPtr doc,
- const xmlChar *ID);
+XMLPUBFUN xmlRefPtr XMLCALL
+xmlAddRef (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
+XMLPUBFUN void XMLCALL
+xmlFreeRefTable (xmlRefTablePtr table);
+XMLPUBFUN int XMLCALL
+xmlIsRef (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
+XMLPUBFUN int XMLCALL
+xmlRemoveRef (xmlDocPtr doc,
+ xmlAttrPtr attr);
+XMLPUBFUN xmlListPtr XMLCALL
+xmlGetRefs (xmlDocPtr doc,
+ const xmlChar *ID);
/**
* The public function calls related to validity checking.
*/
#ifdef LIBXML_VALID_ENABLED
/* Allocate/Release Validation Contexts */
-XMLPUBFUN xmlValidCtxtPtr XMLCALL
- xmlNewValidCtxt(void);
-XMLPUBFUN void XMLCALL
- xmlFreeValidCtxt(xmlValidCtxtPtr);
-
-XMLPUBFUN int XMLCALL
- xmlValidateRoot (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlElementPtr elem);
-XMLPUBFUN xmlChar * XMLCALL
- xmlValidNormalizeAttributeValue(xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL
- xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlAttributePtr attr);
-XMLPUBFUN int XMLCALL
- xmlValidateAttributeValue(xmlAttributeType type,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNotationPtr nota);
-XMLPUBFUN int XMLCALL
- xmlValidateDtd (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlDtdPtr dtd);
-XMLPUBFUN int XMLCALL
- xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateDocument (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- xmlValidateOneElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *prefix,
- xmlNsPtr ns,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+XMLPUBFUN xmlValidCtxtPtr XMLCALL
+xmlNewValidCtxt(void);
+XMLPUBFUN void XMLCALL
+xmlFreeValidCtxt(xmlValidCtxtPtr);
+
+XMLPUBFUN int XMLCALL
+xmlValidateRoot (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlElementPtr elem);
+XMLPUBFUN xmlChar * XMLCALL
+xmlValidNormalizeAttributeValue(xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlChar * XMLCALL
+xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlAttributePtr attr);
+XMLPUBFUN int XMLCALL
+xmlValidateAttributeValue(xmlAttributeType type,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNotationPtr nota);
+XMLPUBFUN int XMLCALL
+xmlValidateDtd (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlDtdPtr dtd);
+XMLPUBFUN int XMLCALL
+xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateDocument (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+xmlValidateOneElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *prefix,
+ xmlNsPtr ns,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
#endif /* LIBXML_VALID_ENABLED */
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *notationName);
+XMLPUBFUN int XMLCALL
+xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *notationName);
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlIsMixedElement (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN xmlNotationPtr XMLCALL
- xmlGetDtdNotationDesc (xmlDtdPtr dtd,
- const xmlChar *name);
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdQElementDesc (xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdElementDesc (xmlDtdPtr dtd,
- const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlIsMixedElement (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlGetDtdAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN xmlNotationPtr XMLCALL
+xmlGetDtdNotationDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlGetDtdQElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlGetDtdElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int XMLCALL
- xmlValidGetPotentialChildren(xmlElementContent *ctree,
- const xmlChar **names,
- int *len,
- int max);
-
-XMLPUBFUN int XMLCALL
- xmlValidGetValidElements(xmlNode *prev,
- xmlNode *next,
- const xmlChar **names,
- int max);
-XMLPUBFUN int XMLCALL
- xmlValidateNameValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNamesValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNmtokenValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNmtokensValue(const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidGetPotentialChildren(xmlElementContent *ctree,
+ const xmlChar **names,
+ int *len,
+ int max);
+
+XMLPUBFUN int XMLCALL
+xmlValidGetValidElements(xmlNode *prev,
+ xmlNode *next,
+ const xmlChar **names,
+ int max);
+XMLPUBFUN int XMLCALL
+xmlValidateNameValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNamesValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNmtokenValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNmtokensValue(const xmlChar *value);
#ifdef LIBXML_REGEXP_ENABLED
/*
* Validation based on the regexp support
*/
-XMLPUBFUN int XMLCALL
- xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
- xmlElementPtr elem);
-
-XMLPUBFUN int XMLCALL
- xmlValidatePushElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
-XMLPUBFUN int XMLCALL
- xmlValidatePushCData (xmlValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
-XMLPUBFUN int XMLCALL
- xmlValidatePopElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
+XMLPUBFUN int XMLCALL
+xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
+ xmlElementPtr elem);
+
+XMLPUBFUN int XMLCALL
+xmlValidatePushElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
+XMLPUBFUN int XMLCALL
+xmlValidatePushCData (xmlValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlValidatePopElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
#endif /* LIBXML_REGEXP_ENABLED */
#endif /* LIBXML_VALID_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/s60/include/libxml/xinclude.h b/thirdparties/s60/include/libxml/xinclude.h
index 863ab25..e6b79cb 100755
--- a/thirdparties/s60/include/libxml/xinclude.h
+++ b/thirdparties/s60/include/libxml/xinclude.h
@@ -90,36 +90,36 @@ typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
* standalone processing
*/
XMLPUBFUN int XMLCALL
- xmlXIncludeProcess (xmlDocPtr doc);
+xmlXIncludeProcess (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlags (xmlDocPtr doc,
- int flags);
+xmlXIncludeProcessFlags (xmlDocPtr doc,
+ int flags);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlagsData(xmlDocPtr doc,
- int flags,
- void *data);
+xmlXIncludeProcessFlagsData(xmlDocPtr doc,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
- int flags,
- void *data);
+xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTree (xmlNodePtr tree);
+xmlXIncludeProcessTree (xmlNodePtr tree);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
- int flags);
+xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
+ int flags);
/*
* contextual processing
*/
XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL
- xmlXIncludeNewContext (xmlDocPtr doc);
+xmlXIncludeNewContext (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
- int flags);
+xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
+ int flags);
XMLPUBFUN void XMLCALL
- xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
+xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
- xmlNodePtr tree);
+xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
+ xmlNodePtr tree);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/xlink.h b/thirdparties/s60/include/libxml/xlink.h
index 083c7ed..adf3fc5 100755
--- a/thirdparties/s60/include/libxml/xlink.h
+++ b/thirdparties/s60/include/libxml/xlink.h
@@ -57,7 +57,7 @@ typedef enum {
* xlinkNodeDetectFunc:
* @ctx: user data pointer
* @node: the node to check
- *
+ *
* This is the prototype for the link detection routine.
* It calls the default link detection callbacks upon link detection.
*/
@@ -80,10 +80,10 @@ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
*/
typedef void
(*xlinkSimpleLinkFunk) (void *ctx,
- xmlNodePtr node,
- const xlinkHRef href,
- const xlinkRole role,
- const xlinkTitle title);
+ xmlNodePtr node,
+ const xlinkHRef href,
+ const xlinkRole role,
+ const xlinkTitle title);
/**
* xlinkExtendedLinkFunk:
@@ -105,18 +105,18 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkFunk)(void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbArcs,
- const xlinkRole *from,
- const xlinkRole *to,
- xlinkShow *show,
- xlinkActuate *actuate,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbArcs,
+ const xlinkRole *from,
+ const xlinkRole *to,
+ xlinkShow *show,
+ xlinkActuate *actuate,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* xlinkExtendedLinkSetFunk:
@@ -133,13 +133,13 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkSetFunk) (void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* This is the structure containing a set of Links detection callbacks.
@@ -157,28 +157,28 @@ struct _xlinkHandler {
/*
* The default detection routine, can be overridden, they call the default
- * detection callbacks.
+ * detection callbacks.
*/
-XMLPUBFUN xlinkNodeDetectFunc XMLCALL
- xlinkGetDefaultDetect (void);
-XMLPUBFUN void XMLCALL
- xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
+XMLPUBFUN xlinkNodeDetectFunc XMLCALL
+xlinkGetDefaultDetect (void);
+XMLPUBFUN void XMLCALL
+xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
/*
* Routines to set/get the default handlers.
*/
-XMLPUBFUN xlinkHandlerPtr XMLCALL
- xlinkGetDefaultHandler (void);
-XMLPUBFUN void XMLCALL
- xlinkSetDefaultHandler (xlinkHandlerPtr handler);
+XMLPUBFUN xlinkHandlerPtr XMLCALL
+xlinkGetDefaultHandler (void);
+XMLPUBFUN void XMLCALL
+xlinkSetDefaultHandler (xlinkHandlerPtr handler);
/*
* Link detection module itself.
*/
-XMLPUBFUN xlinkType XMLCALL
- xlinkIsLink (xmlDocPtr doc,
- xmlNodePtr node);
+XMLPUBFUN xlinkType XMLCALL
+xlinkIsLink (xmlDocPtr doc,
+ xmlNodePtr node);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xmlIO.h b/thirdparties/s60/include/libxml/xmlIO.h
index eea9ed6..bef40bb 100755
--- a/thirdparties/s60/include/libxml/xmlIO.h
+++ b/thirdparties/s60/include/libxml/xmlIO.h
@@ -26,7 +26,7 @@ extern "C" {
* xmlInputMatchCallback:
* @filename: the filename or URI
*
- * Callback used in the I/O Input API to detect if the current handler
+ * Callback used in the I/O Input API to detect if the current handler
* can provide input fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
@@ -72,7 +72,7 @@ typedef int (XMLCALL *xmlInputCloseCallback) (void * context);
* xmlOutputMatchCallback:
* @filename: the filename or URI
*
- * Callback used in the I/O Output API to detect if the current handler
+ * Callback used in the I/O Output API to detect if the current handler
* can provide output fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
@@ -98,7 +98,7 @@ typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
* Returns the number of bytes written or -1 in case of error
*/
typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
- int len);
+ int len);
/**
* xmlOutputCloseCallback:
* @context: an Output context
@@ -126,9 +126,9 @@ struct _xmlParserInputBuffer {
void* context;
xmlInputReadCallback readcallback;
xmlInputCloseCallback closecallback;
-
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-
+
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
@@ -142,9 +142,9 @@ struct _xmlOutputBuffer {
void* context;
xmlOutputWriteCallback writecallback;
xmlOutputCloseCallback closecallback;
-
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-
+
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
xmlBufferPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */
@@ -155,202 +155,202 @@ struct _xmlOutputBuffer {
/*
* Interfaces for input
*/
-XMLPUBFUN void XMLCALL
- xmlCleanupInputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupInputCallbacks (void);
XMLPUBFUN int XMLCALL
- xmlPopInputCallbacks (void);
+xmlPopInputCallbacks (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterDefaultInputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterDefaultInputCallbacks (void);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlAllocParserInputBuffer (xmlCharEncoding enc);
+xmlAllocParserInputBuffer (xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFilename (const char *URI,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFilename (const char *URI,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFile (FILE *file,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFile (FILE *file,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFd (int fd,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFd (int fd,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateMem (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateMem (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateStatic (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateStatic (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferRead (xmlParserInputBufferPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferPush (xmlParserInputBufferPtr in,
- int len,
- const char *buf);
-XMLPUBFUN void XMLCALL
- xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
-XMLPUBFUN char * XMLCALL
- xmlParserGetDirectory (const char *filename);
-
-XMLPUBFUN int XMLCALL
- xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
- xmlInputOpenCallback openFunc,
- xmlInputReadCallback readFunc,
- xmlInputCloseCallback closeFunc);
+xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferRead (xmlParserInputBufferPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferPush (xmlParserInputBufferPtr in,
+ int len,
+ const char *buf);
+XMLPUBFUN void XMLCALL
+xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
+XMLPUBFUN char * XMLCALL
+xmlParserGetDirectory (const char *filename);
+
+XMLPUBFUN int XMLCALL
+xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
+ xmlInputOpenCallback openFunc,
+ xmlInputReadCallback readFunc,
+ xmlInputCloseCallback closeFunc);
xmlParserInputBufferPtr
- __xmlParserInputBufferCreateFilename(const char *URI,
- xmlCharEncoding enc);
+__xmlParserInputBufferCreateFilename(const char *URI,
+ xmlCharEncoding enc);
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Interfaces for output
*/
-XMLPUBFUN void XMLCALL
- xmlCleanupOutputCallbacks (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterDefaultOutputCallbacks(void);
+XMLPUBFUN void XMLCALL
+xmlCleanupOutputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
+xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFilename (const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+xmlOutputBufferCreateFilename (const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFile (FILE *file,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFile (FILE *file,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFd (int fd,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFd (int fd,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
- xmlOutputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWrite (xmlOutputBufferPtr out,
- int len,
- const char *buf);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteString (xmlOutputBufferPtr out,
- const char *str);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
- const xmlChar *str,
- xmlCharEncodingOutputFunc escaping);
-
-XMLPUBFUN int XMLCALL
- xmlOutputBufferFlush (xmlOutputBufferPtr out);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferClose (xmlOutputBufferPtr out);
-
-XMLPUBFUN int XMLCALL
- xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
- xmlOutputOpenCallback openFunc,
- xmlOutputWriteCallback writeFunc,
- xmlOutputCloseCallback closeFunc);
+xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
+ xmlOutputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncodingHandlerPtr encoder);
+
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWrite (xmlOutputBufferPtr out,
+ int len,
+ const char *buf);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWriteString (xmlOutputBufferPtr out,
+ const char *str);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
+ const xmlChar *str,
+ xmlCharEncodingOutputFunc escaping);
+
+XMLPUBFUN int XMLCALL
+xmlOutputBufferFlush (xmlOutputBufferPtr out);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferClose (xmlOutputBufferPtr out);
+
+XMLPUBFUN int XMLCALL
+xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
+ xmlOutputOpenCallback openFunc,
+ xmlOutputWriteCallback writeFunc,
+ xmlOutputCloseCallback closeFunc);
xmlOutputBufferPtr
- __xmlOutputBufferCreateFilename(const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+__xmlOutputBufferCreateFilename(const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
#ifdef LIBXML_HTTP_ENABLED
/* This function only exists if HTTP support built into the library */
-XMLPUBFUN void XMLCALL
- xmlRegisterHTTPPostCallbacks (void );
+XMLPUBFUN void XMLCALL
+xmlRegisterHTTPPostCallbacks (void );
#endif /* LIBXML_HTTP_ENABLED */
-
+
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr ret);
+xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr ret);
/*
* A predefined entity loader disabling network accesses
*/
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNoNetExternalEntityLoader (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNoNetExternalEntityLoader (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
-/*
- * xmlNormalizeWindowsPath is obsolete, don't use it.
+/*
+ * xmlNormalizeWindowsPath is obsolete, don't use it.
* Check xmlCanonicPath in uri.h for a better alternative.
*/
-XMLPUBFUN xmlChar * XMLCALL
- xmlNormalizeWindowsPath (const xmlChar *path);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNormalizeWindowsPath (const xmlChar *path);
-XMLPUBFUN int XMLCALL
- xmlCheckFilename (const char *path);
+XMLPUBFUN int XMLCALL
+xmlCheckFilename (const char *path);
/**
- * Default 'file://' protocol callbacks
+ * Default 'file://' protocol callbacks
*/
-XMLPUBFUN int XMLCALL
- xmlFileMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlFileOpen (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlFileRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlFileClose (void * context);
+XMLPUBFUN int XMLCALL
+xmlFileMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlFileOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlFileRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlFileClose (void * context);
/**
- * Default 'http://' protocol callbacks
+ * Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_ENABLED
-XMLPUBFUN int XMLCALL
- xmlIOHTTPMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpenW (const char * post_uri,
- int compression );
+XMLPUBFUN void * XMLCALL
+xmlIOHTTPOpenW (const char * post_uri,
+ int compression );
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlIOHTTPRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlIOHTTPClose (void * context);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */
/**
- * Default 'ftp://' protocol callbacks
+ * Default 'ftp://' protocol callbacks
*/
-#ifdef LIBXML_FTP_ENABLED
-XMLPUBFUN int XMLCALL
- xmlIOFTPMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlIOFTPOpen (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlIOFTPRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlIOFTPClose (void * context);
+#ifdef LIBXML_FTP_ENABLED
+XMLPUBFUN int XMLCALL
+xmlIOFTPMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlIOFTPOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlIOFTPRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlIOFTPClose (void * context);
#endif /* LIBXML_FTP_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/s60/include/libxml/xmlautomata.h b/thirdparties/s60/include/libxml/xmlautomata.h
index f98b55e..1a49117 100755
--- a/thirdparties/s60/include/libxml/xmlautomata.h
+++ b/thirdparties/s60/include/libxml/xmlautomata.h
@@ -40,105 +40,105 @@ typedef xmlAutomataState *xmlAutomataStatePtr;
/*
* Building API
*/
-XMLPUBFUN xmlAutomataPtr XMLCALL
- xmlNewAutomata (void);
-XMLPUBFUN void XMLCALL
- xmlFreeAutomata (xmlAutomataPtr am);
+XMLPUBFUN xmlAutomataPtr XMLCALL
+xmlNewAutomata (void);
+XMLPUBFUN void XMLCALL
+xmlFreeAutomata (xmlAutomataPtr am);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataGetInitState (xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL
- xmlAutomataSetFinalState (xmlAutomataPtr am,
- xmlAutomataStatePtr state);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewState (xmlAutomataPtr am);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewNegTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
+xmlAutomataGetInitState (xmlAutomataPtr am);
+XMLPUBFUN int XMLCALL
+xmlAutomataSetFinalState (xmlAutomataPtr am,
+ xmlAutomataStatePtr state);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewState (xmlAutomataPtr am);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewTransition (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewTransition2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewNegTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewAllTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int lax);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewEpsilon (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountedTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCounterTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
-XMLPUBFUN int XMLCALL
- xmlAutomataNewCounter (xmlAutomataPtr am,
- int min,
- int max);
+xmlAutomataNewCountTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewOnceTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewAllTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int lax);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewEpsilon (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCountedTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCounterTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
+XMLPUBFUN int XMLCALL
+xmlAutomataNewCounter (xmlAutomataPtr am,
+ int min,
+ int max);
-XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlAutomataCompile (xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL
- xmlAutomataIsDeterminist (xmlAutomataPtr am);
+XMLPUBFUN xmlRegexpPtr XMLCALL
+xmlAutomataCompile (xmlAutomataPtr am);
+XMLPUBFUN int XMLCALL
+xmlAutomataIsDeterminist (xmlAutomataPtr am);
#ifdef __cplusplus
}
-#endif
+#endif
#endif /* LIBXML_AUTOMATA_ENABLED */
#endif /* LIBXML_REGEXP_ENABLED */
diff --git a/thirdparties/s60/include/libxml/xmlerror.h b/thirdparties/s60/include/libxml/xmlerror.h
index e924211..0702229 100755
--- a/thirdparties/s60/include/libxml/xmlerror.h
+++ b/thirdparties/s60/include/libxml/xmlerror.h
@@ -26,7 +26,8 @@ typedef enum {
XML_ERR_WARNING = 1, /* A simple warning */
XML_ERR_ERROR = 2, /* A recoverable error */
XML_ERR_FATAL = 3 /* A fatal error */
-} xmlErrorLevel;
+}
+xmlErrorLevel;
/**
* xmlErrorDomain:
@@ -842,8 +843,8 @@ typedef enum {
* no parsing or validity context available .
*/
typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlStructuredErrorFunc:
* @userData: user provided data for the error callback
@@ -859,84 +860,84 @@ typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr erro
* xmlGenericError and xmlGenericErrorContext.
*/
XMLPUBFUN void XMLCALL
- xmlSetGenericErrorFunc (void *ctx,
- xmlGenericErrorFunc handler);
+xmlSetGenericErrorFunc (void *ctx,
+ xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
- initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
+initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
XMLPUBFUN void XMLCALL
- xmlSetStructuredErrorFunc (void *ctx,
- xmlStructuredErrorFunc handler);
+xmlSetStructuredErrorFunc (void *ctx,
+ xmlStructuredErrorFunc handler);
/*
* Default message routines used by SAX and Valid context for error
* and warning reporting.
*/
XMLPUBFUN void XMLCDECL
- xmlParserError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileInfo (xmlParserInputPtr input);
+xmlParserPrintFileInfo (xmlParserInputPtr input);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileContext (xmlParserInputPtr input);
+xmlParserPrintFileContext (xmlParserInputPtr input);
/*
* Extended error information routines
*/
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlGetLastError (void);
+xmlGetLastError (void);
XMLPUBFUN void XMLCALL
- xmlResetLastError (void);
+xmlResetLastError (void);
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlCtxtGetLastError (void *ctx);
+xmlCtxtGetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlCtxtResetLastError (void *ctx);
+xmlCtxtResetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlResetError (xmlErrorPtr err);
+xmlResetError (xmlErrorPtr err);
XMLPUBFUN int XMLCALL
- xmlCopyError (xmlErrorPtr from,
- xmlErrorPtr to);
+xmlCopyError (xmlErrorPtr from,
+ xmlErrorPtr to);
#ifdef IN_LIBXML
/*
* Internal callback reporting routine
*/
XMLPUBFUN void XMLCALL
- __xmlRaiseError (xmlStructuredErrorFunc schannel,
- xmlGenericErrorFunc channel,
- void *data,
- void *ctx,
- void *node,
- int domain,
- int code,
- xmlErrorLevel level,
- const char *file,
- int line,
- const char *str1,
- const char *str2,
- const char *str3,
- int int1,
- int col,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(16,17);
+__xmlRaiseError (xmlStructuredErrorFunc schannel,
+ xmlGenericErrorFunc channel,
+ void *data,
+ void *ctx,
+ void *node,
+ int domain,
+ int code,
+ xmlErrorLevel level,
+ const char *file,
+ int line,
+ const char *str1,
+ const char *str2,
+ const char *str3,
+ int int1,
+ int col,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(16,17);
XMLPUBFUN void XMLCALL
- __xmlSimpleError (int domain,
- int code,
- xmlNodePtr node,
- const char *msg,
- const char *extra);
+__xmlSimpleError (int domain,
+ int code,
+ xmlNodePtr node,
+ const char *msg,
+ const char *extra);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xmlexports.h b/thirdparties/s60/include/libxml/xmlexports.h
index b90659f..0c65eac 100755
--- a/thirdparties/s60/include/libxml/xmlexports.h
+++ b/thirdparties/s60/include/libxml/xmlexports.h
@@ -43,7 +43,7 @@
/**
* XMLCDECL:
*
- * Macro which declares the calling convention for exported functions that
+ * Macro which declares the calling convention for exported functions that
* use '...'.
*/
#define XMLCDECL
@@ -52,104 +52,104 @@
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #if defined(LIBXML_FASTCALL)
- #define XMLCALL __fastcall
- #else
- #define XMLCALL __cdecl
- #endif
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#if defined(LIBXML_FASTCALL)
+#define XMLCALL __fastcall
+#else
+#define XMLCALL __cdecl
+#endif
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport) extern
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- /*
- * if defined(IN_LIBXML) this raises problems on mingw with msys
- * _imp__xmlFree listed as missing. Try to workaround the problem
- * by also making that declaration when compiling client code.
- */
- #if !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+/*
+ * if defined(IN_LIBXML) this raises problems on mingw with msys
+ * _imp__xmlFree listed as missing. Try to workaround the problem
+ * by also making that declaration when compiling client code.
+ */
+#if !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Cygwin platform, GNU compiler */
#if defined(_WIN32) && defined(__CYGWIN__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
#endif
/* Compatibility */
diff --git a/thirdparties/s60/include/libxml/xmlmemory.h b/thirdparties/s60/include/libxml/xmlmemory.h
index 17e375a..58e6e5c 100755
--- a/thirdparties/s60/include/libxml/xmlmemory.h
+++ b/thirdparties/s60/include/libxml/xmlmemory.h
@@ -101,70 +101,70 @@ LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup;
* allocations useful for garbage collected memory allocators
*/
XMLPUBFUN int XMLCALL
- xmlMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlMallocFunc mallocAtomicFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlGcMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlMallocFunc mallocAtomicFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlMallocFunc *mallocAtomicFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlGcMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlMallocFunc *mallocAtomicFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
/*
* Initialization of the memory layer.
*/
XMLPUBFUN int XMLCALL
- xmlInitMemory (void);
+xmlInitMemory (void);
/*
* Cleanup of the memory layer.
*/
XMLPUBFUN void XMLCALL
- xmlCleanupMemory (void);
+xmlCleanupMemory (void);
/*
* These are specific to the XML debug memory wrapper.
*/
XMLPUBFUN int XMLCALL
- xmlMemUsed (void);
+xmlMemUsed (void);
XMLPUBFUN int XMLCALL
- xmlMemBlocks (void);
+xmlMemBlocks (void);
XMLPUBFUN void XMLCALL
- xmlMemDisplay (FILE *fp);
+xmlMemDisplay (FILE *fp);
XMLPUBFUN void XMLCALL
- xmlMemDisplayLast(FILE *fp, long nbBytes);
+xmlMemDisplayLast(FILE *fp, long nbBytes);
XMLPUBFUN void XMLCALL
- xmlMemShow (FILE *fp, int nr);
+xmlMemShow (FILE *fp, int nr);
XMLPUBFUN void XMLCALL
- xmlMemoryDump (void);
+xmlMemoryDump (void);
XMLPUBFUN void * XMLCALL
- xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlMemRealloc (void *ptr,size_t size);
+xmlMemRealloc (void *ptr,size_t size);
XMLPUBFUN void XMLCALL
- xmlMemFree (void *ptr);
+xmlMemFree (void *ptr);
XMLPUBFUN char * XMLCALL
- xmlMemoryStrdup (const char *str);
+xmlMemoryStrdup (const char *str);
XMLPUBFUN void * XMLCALL
- xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
+xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
XMLPUBFUN void * XMLCALL
- xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN char * XMLCALL
- xmlMemStrdupLoc (const char *str, const char *file, int line);
+xmlMemStrdupLoc (const char *str, const char *file, int line);
#ifdef DEBUG_MEMORY_LOCATION
diff --git a/thirdparties/s60/include/libxml/xmlmodule.h b/thirdparties/s60/include/libxml/xmlmodule.h
index 8f4a560..ef4720c 100755
--- a/thirdparties/s60/include/libxml/xmlmodule.h
+++ b/thirdparties/s60/include/libxml/xmlmodule.h
@@ -38,11 +38,11 @@ typedef enum {
} xmlModuleOption;
XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename,
- int options);
+ int options);
XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module,
- const char* name,
- void **result);
+ const char* name,
+ void **result);
XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module);
@@ -50,7 +50,7 @@ XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module);
#ifdef __cplusplus
}
-#endif
+#endif
#endif /* LIBXML_MODULES_ENABLED */
diff --git a/thirdparties/s60/include/libxml/xmlreader.h b/thirdparties/s60/include/libxml/xmlreader.h
index 6964482..3226646 100755
--- a/thirdparties/s60/include/libxml/xmlreader.h
+++ b/thirdparties/s60/include/libxml/xmlreader.h
@@ -33,7 +33,8 @@ typedef enum {
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
XML_PARSER_SEVERITY_WARNING = 3,
XML_PARSER_SEVERITY_ERROR = 4
-} xmlParserSeverities;
+}
+xmlParserSeverities;
#ifdef LIBXML_READER_ENABLED
@@ -109,16 +110,16 @@ typedef xmlTextReader *xmlTextReaderPtr;
* Constructors & Destructor
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReader (xmlParserInputBufferPtr input,
- const char *URI);
+xmlNewTextReader (xmlParserInputBufferPtr input,
+ const char *URI);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReaderFilename(const char *URI);
+xmlNewTextReaderFilename(const char *URI);
XMLPUBFUN void XMLCALL
- xmlFreeTextReader (xmlTextReaderPtr reader);
+xmlFreeTextReader (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetup(xmlTextReaderPtr reader,
+xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options);
@@ -126,258 +127,258 @@ XMLPUBFUN int XMLCALL
* Iterators
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderRead (xmlTextReaderPtr reader);
+xmlTextReaderRead (xmlTextReaderPtr reader);
#ifdef LIBXML_WRITER_ENABLED
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
+xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
+xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
#endif
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadString (xmlTextReaderPtr reader);
+xmlTextReaderReadString (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
+xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
/*
* Attributes of the node
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
+xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderDepth (xmlTextReaderPtr reader);
+xmlTextReaderDepth (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
+xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasValue(xmlTextReaderPtr reader);
+xmlTextReaderHasValue(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsDefault (xmlTextReaderPtr reader);
+xmlTextReaderIsDefault (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
+xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNodeType (xmlTextReaderPtr reader);
+xmlTextReaderNodeType (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
+xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadState (xmlTextReaderPtr reader);
+xmlTextReaderReadState (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
+xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
+xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstName (xmlTextReaderPtr reader);
+xmlTextReaderConstName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
+xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstString (xmlTextReaderPtr reader,
- const xmlChar *str);
+xmlTextReaderConstString (xmlTextReaderPtr reader,
+ const xmlChar *str);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstValue (xmlTextReaderPtr reader);
+xmlTextReaderConstValue (xmlTextReaderPtr reader);
/*
* use the Const version of the routine for
* better performance and simpler code
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocalName (xmlTextReaderPtr reader);
+xmlTextReaderLocalName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderName (xmlTextReaderPtr reader);
+xmlTextReaderName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderPrefix (xmlTextReaderPtr reader);
+xmlTextReaderPrefix (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderValue (xmlTextReaderPtr reader);
+xmlTextReaderValue (xmlTextReaderPtr reader);
/*
* Methods of the XmlTextReader
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderClose (xmlTextReaderPtr reader);
+xmlTextReaderClose (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
- int no);
+xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
+xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
- const xmlChar *prefix);
+xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
+ const xmlChar *prefix);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
- int no);
+xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
+xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNormalization (xmlTextReaderPtr reader);
+xmlTextReaderNormalization (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
+xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
/*
* Extensions
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
- int prop,
- int value);
+xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
+ int prop,
+ int value);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
- int prop);
+xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
+ int prop);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
+xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderPreserve (xmlTextReaderPtr reader);
+xmlTextReaderPreserve (xmlTextReaderPtr reader);
#ifdef LIBXML_PATTERN_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
- const xmlChar *pattern,
- const xmlChar **namespaces);
+xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
+ const xmlChar *pattern,
+ const xmlChar **namespaces);
#endif /* LIBXML_PATTERN_ENABLED */
XMLPUBFUN xmlDocPtr XMLCALL
- xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
+xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderExpand (xmlTextReaderPtr reader);
+xmlTextReaderExpand (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNext (xmlTextReaderPtr reader);
+xmlTextReaderNext (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNextSibling (xmlTextReaderPtr reader);
+xmlTextReaderNextSibling (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsValid (xmlTextReaderPtr reader);
+xmlTextReaderIsValid (xmlTextReaderPtr reader);
#ifdef LIBXML_SCHEMAS_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
- const char *rng);
+xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
+ const char *rng);
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
- xmlRelaxNGPtr schema);
+xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
+ xmlRelaxNGPtr schema);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
- const char *xsd);
+xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
+ const char *xsd);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
- xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
+ xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetSchema (xmlTextReaderPtr reader,
- xmlSchemaPtr schema);
+xmlTextReaderSetSchema (xmlTextReaderPtr reader,
+ xmlSchemaPtr schema);
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
+xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderStandalone (xmlTextReaderPtr reader);
+xmlTextReaderStandalone (xmlTextReaderPtr reader);
/*
* Index lookup
*/
XMLPUBFUN long XMLCALL
- xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
+xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
/*
* New more complete APIs for simpler creation and reuse of readers
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderWalker (xmlDocPtr doc);
+xmlReaderWalker (xmlDocPtr doc);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForDoc (const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForDoc (const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFile (const char *filename,
- const char *encoding,
- int options);
+xmlReaderForFile (const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
-
-XMLPUBFUN int XMLCALL
- xmlReaderNewWalker (xmlTextReaderPtr reader,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlReaderNewDoc (xmlTextReaderPtr reader,
- const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFile (xmlTextReaderPtr reader,
- const char *filename,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewMemory (xmlTextReaderPtr reader,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFd (xmlTextReaderPtr reader,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewIO (xmlTextReaderPtr reader,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
+
+XMLPUBFUN int XMLCALL
+xmlReaderNewWalker (xmlTextReaderPtr reader,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlReaderNewDoc (xmlTextReaderPtr reader,
+ const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFile (xmlTextReaderPtr reader,
+ const char *filename,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewMemory (xmlTextReaderPtr reader,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFd (xmlTextReaderPtr reader,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewIO (xmlTextReaderPtr reader,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Error handling extensions
*/
@@ -393,26 +394,26 @@ typedef void * xmlTextReaderLocatorPtr;
* Signature of an error callback from a reader parser
*/
typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
- const char *msg,
- xmlParserSeverities severity,
- xmlTextReaderLocatorPtr locator);
+ const char *msg,
+ xmlParserSeverities severity,
+ xmlTextReaderLocatorPtr locator);
XMLPUBFUN int XMLCALL
- xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc f,
- void *arg);
+xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
- xmlStructuredErrorFunc f,
- void *arg);
+xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
+ xmlStructuredErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc *f,
- void **arg);
+xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc *f,
+ void **arg);
#endif /* LIBXML_READER_ENABLED */
diff --git a/thirdparties/s60/include/libxml/xmlregexp.h b/thirdparties/s60/include/libxml/xmlregexp.h
index 7009645..f81664d 100755
--- a/thirdparties/s60/include/libxml/xmlregexp.h
+++ b/thirdparties/s60/include/libxml/xmlregexp.h
@@ -49,16 +49,16 @@ extern "C" {
* The POSIX like API
*/
XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlRegexpCompile (const xmlChar *regexp);
+xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpExec (xmlRegexpPtr comp,
- const xmlChar *value);
+xmlRegexpExec (xmlRegexpPtr comp,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- xmlRegexpPrint (FILE *output,
- xmlRegexpPtr regexp);
+xmlRegexpPrint (FILE *output,
+ xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpIsDeterminist(xmlRegexpPtr comp);
+xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:
@@ -70,42 +70,42 @@ XMLPUBFUN int XMLCALL
* Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
- const xmlChar *token,
- void *transdata,
- void *inputdata);
+ const xmlChar *token,
+ void *transdata,
+ void *inputdata);
/*
* The progressive API
*/
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
- xmlRegNewExecCtxt (xmlRegexpPtr comp,
- xmlRegExecCallbacks callback,
- void *data);
+xmlRegNewExecCtxt (xmlRegexpPtr comp,
+ xmlRegExecCallbacks callback,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
+xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- void *data);
+xmlRegExecPushString(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- const xmlChar *value2,
- void *data);
+xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ const xmlChar *value2,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
XMLPUBFUN int XMLCALL
- xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
- const xmlChar **string,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
+ const xmlChar **string,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
#ifdef LIBXML_EXPR_ENABLED
/*
* Formal regular expression handling
@@ -117,15 +117,15 @@ typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
XMLPUBFUN void XMLCALL
- xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
+xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
XMLPUBFUN xmlExpCtxtPtr XMLCALL
- xmlExpNewCtxt (int maxNodes,
- xmlDictPtr dict);
+xmlExpNewCtxt (int maxNodes,
+ xmlDictPtr dict);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/* Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
@@ -151,67 +151,67 @@ XMLPUBVAR xmlExpNodePtr emptyExp;
* Expressions are reference counted internally
*/
XMLPUBFUN void XMLCALL
- xmlExpFree (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr);
+xmlExpFree (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr);
XMLPUBFUN void XMLCALL
- xmlExpRef (xmlExpNodePtr expr);
+xmlExpRef (xmlExpNodePtr expr);
/*
* constructors can be either manual or from a string
*/
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpParse (xmlExpCtxtPtr ctxt,
- const char *expr);
+xmlExpParse (xmlExpCtxtPtr ctxt,
+ const char *expr);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewAtom (xmlExpCtxtPtr ctxt,
- const xmlChar *name,
- int len);
+xmlExpNewAtom (xmlExpCtxtPtr ctxt,
+ const xmlChar *name,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewOr (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewOr (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewSeq (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewSeq (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewRange (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr subset,
- int min,
- int max);
+xmlExpNewRange (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr subset,
+ int min,
+ int max);
/*
* The really interesting APIs
*/
XMLPUBFUN int XMLCALL
- xmlExpIsNillable(xmlExpNodePtr expr);
+xmlExpIsNillable(xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpMaxToken (xmlExpNodePtr expr);
+xmlExpMaxToken (xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**langList,
- int len);
+xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**langList,
+ int len);
XMLPUBFUN int XMLCALL
- xmlExpGetStart (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**tokList,
- int len);
+xmlExpGetStart (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**tokList,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpStringDerive(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar *str,
- int len);
+xmlExpStringDerive(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar *str,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpExpDerive (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpExpDerive (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN int XMLCALL
- xmlExpSubsume (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpSubsume (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN void XMLCALL
- xmlExpDump (xmlBufferPtr buf,
- xmlExpNodePtr expr);
+xmlExpDump (xmlBufferPtr buf,
+ xmlExpNodePtr expr);
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xmlsave.h b/thirdparties/s60/include/libxml/xmlsave.h
index 4201b4d..d1b07dc 100755
--- a/thirdparties/s60/include/libxml/xmlsave.h
+++ b/thirdparties/s60/include/libxml/xmlsave.h
@@ -30,54 +30,55 @@ typedef enum {
XML_SAVE_FORMAT = 1<<0, /* format save output */
XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */
- XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
- XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
- XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
- XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */
-} xmlSaveOption;
+ XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
+ XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
+ XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
+ XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */
+}
+xmlSaveOption;
typedef struct _xmlSaveCtxt xmlSaveCtxt;
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToFd (int fd,
- const char *encoding,
- int options);
+xmlSaveToFd (int fd,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToFilename (const char *filename,
- const char *encoding,
- int options);
+xmlSaveToFilename (const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToBuffer (xmlBufferPtr buffer,
- const char *encoding,
- int options);
+xmlSaveToBuffer (xmlBufferPtr buffer,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
- xmlSaveToIO (xmlOutputWriteCallback iowrite,
- xmlOutputCloseCallback ioclose,
- void *ioctx,
- const char *encoding,
- int options);
+xmlSaveToIO (xmlOutputWriteCallback iowrite,
+ xmlOutputCloseCallback ioclose,
+ void *ioctx,
+ const char *encoding,
+ int options);
XMLPUBFUN long XMLCALL
- xmlSaveDoc (xmlSaveCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlSaveDoc (xmlSaveCtxtPtr ctxt,
+ xmlDocPtr doc);
XMLPUBFUN long XMLCALL
- xmlSaveTree (xmlSaveCtxtPtr ctxt,
- xmlNodePtr node);
+xmlSaveTree (xmlSaveCtxtPtr ctxt,
+ xmlNodePtr node);
XMLPUBFUN int XMLCALL
- xmlSaveFlush (xmlSaveCtxtPtr ctxt);
+xmlSaveFlush (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSaveClose (xmlSaveCtxtPtr ctxt);
+xmlSaveClose (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
- xmlCharEncodingOutputFunc escape);
+xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
+ xmlCharEncodingOutputFunc escape);
XMLPUBFUN int XMLCALL
- xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
- xmlCharEncodingOutputFunc escape);
+xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
+ xmlCharEncodingOutputFunc escape);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/xmlschemas.h b/thirdparties/s60/include/libxml/xmlschemas.h
index 752bc3a..9d86c67 100755
--- a/thirdparties/s60/include/libxml/xmlschemas.h
+++ b/thirdparties/s60/include/libxml/xmlschemas.h
@@ -27,32 +27,33 @@ extern "C" {
*/
typedef enum {
XML_SCHEMAS_ERR_OK = 0,
- XML_SCHEMAS_ERR_NOROOT = 1,
- XML_SCHEMAS_ERR_UNDECLAREDELEM,
- XML_SCHEMAS_ERR_NOTTOPLEVEL,
- XML_SCHEMAS_ERR_MISSING,
- XML_SCHEMAS_ERR_WRONGELEM,
- XML_SCHEMAS_ERR_NOTYPE,
- XML_SCHEMAS_ERR_NOROLLBACK,
- XML_SCHEMAS_ERR_ISABSTRACT,
- XML_SCHEMAS_ERR_NOTEMPTY,
- XML_SCHEMAS_ERR_ELEMCONT,
- XML_SCHEMAS_ERR_HAVEDEFAULT,
- XML_SCHEMAS_ERR_NOTNILLABLE,
- XML_SCHEMAS_ERR_EXTRACONTENT,
- XML_SCHEMAS_ERR_INVALIDATTR,
- XML_SCHEMAS_ERR_INVALIDELEM,
- XML_SCHEMAS_ERR_NOTDETERMINIST,
- XML_SCHEMAS_ERR_CONSTRUCT,
- XML_SCHEMAS_ERR_INTERNAL,
- XML_SCHEMAS_ERR_NOTSIMPLE,
- XML_SCHEMAS_ERR_ATTRUNKNOWN,
- XML_SCHEMAS_ERR_ATTRINVALID,
- XML_SCHEMAS_ERR_VALUE,
- XML_SCHEMAS_ERR_FACET,
- XML_SCHEMAS_ERR_,
- XML_SCHEMAS_ERR_XXX
-} xmlSchemaValidError;
+ XML_SCHEMAS_ERR_NOROOT = 1,
+ XML_SCHEMAS_ERR_UNDECLAREDELEM,
+ XML_SCHEMAS_ERR_NOTTOPLEVEL,
+ XML_SCHEMAS_ERR_MISSING,
+ XML_SCHEMAS_ERR_WRONGELEM,
+ XML_SCHEMAS_ERR_NOTYPE,
+ XML_SCHEMAS_ERR_NOROLLBACK,
+ XML_SCHEMAS_ERR_ISABSTRACT,
+ XML_SCHEMAS_ERR_NOTEMPTY,
+ XML_SCHEMAS_ERR_ELEMCONT,
+ XML_SCHEMAS_ERR_HAVEDEFAULT,
+ XML_SCHEMAS_ERR_NOTNILLABLE,
+ XML_SCHEMAS_ERR_EXTRACONTENT,
+ XML_SCHEMAS_ERR_INVALIDATTR,
+ XML_SCHEMAS_ERR_INVALIDELEM,
+ XML_SCHEMAS_ERR_NOTDETERMINIST,
+ XML_SCHEMAS_ERR_CONSTRUCT,
+ XML_SCHEMAS_ERR_INTERNAL,
+ XML_SCHEMAS_ERR_NOTSIMPLE,
+ XML_SCHEMAS_ERR_ATTRUNKNOWN,
+ XML_SCHEMAS_ERR_ATTRINVALID,
+ XML_SCHEMAS_ERR_VALUE,
+ XML_SCHEMAS_ERR_FACET,
+ XML_SCHEMAS_ERR_,
+ XML_SCHEMAS_ERR_XXX
+}
+xmlSchemaValidError;
/*
* ATTENTION: Change xmlSchemaSetValidOptions's check
@@ -66,9 +67,9 @@ typedef enum {
*/
typedef enum {
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
- /* Default/fixed: create an attribute node
- * or an element's text node on the instance.
- */
+ /* Default/fixed: create an attribute node
+ * or an element's text node on the instance.
+ */
} xmlSchemaValidOption;
/*
@@ -117,86 +118,86 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
* Interfaces for parsing.
*/
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewParserCtxt (const char *URL);
+xmlSchemaNewParserCtxt (const char *URL);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewMemParserCtxt (const char *buffer,
- int size);
+xmlSchemaNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
+xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc * err,
- xmlSchemaValidityWarningFunc * warn,
- void **ctx);
+xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc * err,
+ xmlSchemaValidityWarningFunc * warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaPtr XMLCALL
- xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaFree (xmlSchemaPtr schema);
+xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlSchemaDump (FILE *output,
- xmlSchemaPtr schema);
+xmlSchemaDump (FILE *output,
+ xmlSchemaPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc *err,
- xmlSchemaValidityWarningFunc *warn,
- void **ctx);
+xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc *err,
+ xmlSchemaValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
- xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
+xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
- xmlDocPtr instance);
+xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
+ xmlDocPtr instance);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
- xmlNodePtr elem);
+xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc,
- xmlSAXHandlerPtr sax,
- void *user_data);
+xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc,
+ xmlSAXHandlerPtr sax,
+ void *user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
- const char * filename,
- int options);
+xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
+ const char * filename,
+ int options);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
/*
* Interface to insert Schemas SAX validation in a SAX stream
@@ -205,11 +206,11 @@ typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
- xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
- xmlSAXHandlerPtr *sax,
- void **user_data);
+xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
+ xmlSAXHandlerPtr *sax,
+ void **user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
+xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/xmlschemastypes.h b/thirdparties/s60/include/libxml/xmlschemastypes.h
index 9a3a7a1..4c94162 100755
--- a/thirdparties/s60/include/libxml/xmlschemastypes.h
+++ b/thirdparties/s60/include/libxml/xmlschemastypes.h
@@ -28,120 +28,121 @@ typedef enum {
XML_SCHEMA_WHITESPACE_PRESERVE = 1,
XML_SCHEMA_WHITESPACE_REPLACE = 2,
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
-} xmlSchemaWhitespaceValueType;
+}
+xmlSchemaWhitespaceValueType;
-XMLPUBFUN void XMLCALL
- xmlSchemaInitTypes (void);
-XMLPUBFUN void XMLCALL
- xmlSchemaCleanupTypes (void);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetPredefinedType (const xmlChar *name,
- const xmlChar *ns);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacet (xmlSchemaTypePtr base,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
- xmlSchemaWhitespaceValueType fws,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN void XMLCALL
- xmlSchemaFreeValue (xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaFacetPtr XMLCALL
- xmlSchemaNewFacet (void);
-XMLPUBFUN int XMLCALL
- xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
- xmlSchemaTypePtr typeDecl,
- xmlSchemaParserCtxtPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
- xmlSchemaCompareValues (xmlSchemaValPtr x,
- xmlSchemaValPtr y);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
- const xmlChar *value,
- unsigned long actualLen,
- unsigned long *expectedLen);
+XMLPUBFUN void XMLCALL
+xmlSchemaInitTypes (void);
+XMLPUBFUN void XMLCALL
+xmlSchemaCleanupTypes (void);
+XMLPUBFUN xmlSchemaTypePtr XMLCALL
+xmlSchemaGetPredefinedType (const xmlChar *name,
+ const xmlChar *ns);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacet (xmlSchemaTypePtr base,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
+ xmlSchemaWhitespaceValueType fws,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN void XMLCALL
+xmlSchemaFreeValue (xmlSchemaValPtr val);
+XMLPUBFUN xmlSchemaFacetPtr XMLCALL
+xmlSchemaNewFacet (void);
+XMLPUBFUN int XMLCALL
+xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
+ xmlSchemaTypePtr typeDecl,
+ xmlSchemaParserCtxtPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
+XMLPUBFUN int XMLCALL
+xmlSchemaCompareValues (xmlSchemaValPtr x,
+ xmlSchemaValPtr y);
XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInType (xmlSchemaValType type);
+xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
XMLPUBFUN int XMLCALL
- xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
- int facetType);
+xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ unsigned long actualLen,
+ unsigned long *expectedLen);
+XMLPUBFUN xmlSchemaTypePtr XMLCALL
+xmlSchemaGetBuiltInType (xmlSchemaValType type);
+XMLPUBFUN int XMLCALL
+xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
+ int facetType);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaCollapseString (const xmlChar *value);
+xmlSchemaCollapseString (const xmlChar *value);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaWhiteSpaceReplace (const xmlChar *value);
+xmlSchemaWhiteSpaceReplace (const xmlChar *value);
XMLPUBFUN unsigned long XMLCALL
- xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValue (xmlSchemaValPtr val,
- const xmlChar **retValue);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
- const xmlChar **retValue,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValueAppend (xmlSchemaValPtr prev,
- xmlSchemaValPtr cur);
+xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValue (xmlSchemaValPtr val,
+ const xmlChar **retValue);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
+ const xmlChar **retValue,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValueAppend (xmlSchemaValPtr prev,
+ xmlSchemaValPtr cur);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaValueGetNext (xmlSchemaValPtr cur);
+xmlSchemaValueGetNext (xmlSchemaValPtr cur);
XMLPUBFUN const xmlChar * XMLCALL
- xmlSchemaValueGetAsString (xmlSchemaValPtr val);
+xmlSchemaValueGetAsString (xmlSchemaValPtr val);
XMLPUBFUN int XMLCALL
- xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
+xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewStringValue (xmlSchemaValType type,
- const xmlChar *value);
+xmlSchemaNewStringValue (xmlSchemaValType type,
+ const xmlChar *value);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewNOTATIONValue (const xmlChar *name,
- const xmlChar *ns);
+xmlSchemaNewNOTATIONValue (const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewQNameValue (const xmlChar *namespaceName,
- const xmlChar *localName);
+xmlSchemaNewQNameValue (const xmlChar *namespaceName,
+ const xmlChar *localName);
XMLPUBFUN int XMLCALL
- xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
- xmlSchemaWhitespaceValueType xws,
- xmlSchemaValPtr y,
- xmlSchemaWhitespaceValueType yws);
+xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
+ xmlSchemaWhitespaceValueType xws,
+ xmlSchemaValPtr y,
+ xmlSchemaWhitespaceValueType yws);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaCopyValue (xmlSchemaValPtr val);
+xmlSchemaCopyValue (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValType XMLCALL
- xmlSchemaGetValType (xmlSchemaValPtr val);
+xmlSchemaGetValType (xmlSchemaValPtr val);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xmlstring.h b/thirdparties/s60/include/libxml/xmlstring.h
index 0bc6888..60508f9 100755
--- a/thirdparties/s60/include/libxml/xmlstring.h
+++ b/thirdparties/s60/include/libxml/xmlstring.h
@@ -38,101 +38,101 @@ typedef unsigned char xmlChar;
* xmlChar handling
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlStrdup (const xmlChar *cur);
+xmlStrdup (const xmlChar *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrndup (const xmlChar *cur,
- int len);
+xmlStrndup (const xmlChar *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrndup (const char *cur,
- int len);
+xmlCharStrndup (const char *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrdup (const char *cur);
+xmlCharStrdup (const char *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrsub (const xmlChar *str,
- int start,
- int len);
+xmlStrsub (const xmlChar *str,
+ int start,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrchr (const xmlChar *str,
- xmlChar val);
+xmlStrchr (const xmlChar *str,
+ xmlChar val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrstr (const xmlChar *str,
- const xmlChar *val);
+xmlStrstr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrcasestr (const xmlChar *str,
- const xmlChar *val);
+xmlStrcasestr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN int XMLCALL
- xmlStrcmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrcasecmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcasecmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncasecmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncasecmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrEqual (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrEqual (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrQEqual (const xmlChar *pref,
- const xmlChar *name,
- const xmlChar *str);
+xmlStrQEqual (const xmlChar *pref,
+ const xmlChar *name,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlStrlen (const xmlChar *str);
+xmlStrlen (const xmlChar *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrcat (xmlChar *cur,
- const xmlChar *add);
+xmlStrcat (xmlChar *cur,
+ const xmlChar *add);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncat (xmlChar *cur,
- const xmlChar *add,
- int len);
+xmlStrncat (xmlChar *cur,
+ const xmlChar *add,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncatNew (const xmlChar *str1,
- const xmlChar *str2,
- int len);
-XMLPUBFUN int XMLCALL
- xmlStrPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- ...);
-XMLPUBFUN int XMLCALL
- xmlStrVPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- va_list ap);
+xmlStrncatNew (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlStrPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ ...);
+XMLPUBFUN int XMLCALL
+xmlStrVPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ va_list ap);
XMLPUBFUN int XMLCALL
- xmlGetUTF8Char (const unsigned char *utf,
- int *len);
+xmlGetUTF8Char (const unsigned char *utf,
+ int *len);
XMLPUBFUN int XMLCALL
- xmlCheckUTF8 (const unsigned char *utf);
+xmlCheckUTF8 (const unsigned char *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Strsize (const xmlChar *utf,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strndup (const xmlChar *utf,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlUTF8Strpos (const xmlChar *utf,
- int pos);
+xmlUTF8Strsize (const xmlChar *utf,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlUTF8Strndup (const xmlChar *utf,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlUTF8Strpos (const xmlChar *utf,
+ int pos);
XMLPUBFUN int XMLCALL
- xmlUTF8Strloc (const xmlChar *utf,
- const xmlChar *utfchar);
-XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strsub (const xmlChar *utf,
- int start,
- int len);
+xmlUTF8Strloc (const xmlChar *utf,
+ const xmlChar *utfchar);
+XMLPUBFUN xmlChar * XMLCALL
+xmlUTF8Strsub (const xmlChar *utf,
+ int start,
+ int len);
XMLPUBFUN int XMLCALL
- xmlUTF8Strlen (const xmlChar *utf);
+xmlUTF8Strlen (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Size (const xmlChar *utf);
+xmlUTF8Size (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Charcmp (const xmlChar *utf1,
- const xmlChar *utf2);
+xmlUTF8Charcmp (const xmlChar *utf1,
+ const xmlChar *utf2);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xmlversion.h b/thirdparties/s60/include/libxml/xmlversion.h
index 46d443b..1765a45 100755
--- a/thirdparties/s60/include/libxml/xmlversion.h
+++ b/thirdparties/s60/include/libxml/xmlversion.h
@@ -370,7 +370,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the string suffix used by dynamic modules (usually shared libraries)
*/
-#define LIBXML_MODULE_EXTENSION ""
+#define LIBXML_MODULE_EXTENSION ""
#endif
/**
diff --git a/thirdparties/s60/include/libxml/xmlwriter.h b/thirdparties/s60/include/libxml/xmlwriter.h
index 91e683c..5785c84 100755
--- a/thirdparties/s60/include/libxml/xmlwriter.h
+++ b/thirdparties/s60/include/libxml/xmlwriter.h
@@ -24,26 +24,26 @@
extern "C" {
#endif
- typedef struct _xmlTextWriter xmlTextWriter;
- typedef xmlTextWriter *xmlTextWriterPtr;
+typedef struct _xmlTextWriter xmlTextWriter;
+typedef xmlTextWriter *xmlTextWriterPtr;
/*
* Constructors & Destructor
*/
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriter(xmlOutputBufferPtr out);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterFilename(const char *uri, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
- int compression);
- XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriter(xmlOutputBufferPtr out);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterFilename(const char *uri, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
+ int compression);
+XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
/*
* Functions
@@ -53,220 +53,220 @@ extern "C" {
/*
* Document
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDocument(xmlTextWriterPtr writer,
- const char *version,
- const char *encoding,
- const char *standalone);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDocument(xmlTextWriterPtr writer,
+ const char *version,
+ const char *encoding,
+ const char *standalone);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
+ writer);
/*
* Comments
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
- writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
- writer,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
+ writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ content);
/*
* Elements
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
+ writer);
/*
* Elements conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* Text
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
- const xmlChar * content, int len);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
- writer,
- const char
- *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
- writer,
- const char
- *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
+ const xmlChar * content, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
/*
* Attributes
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
+ writer);
/*
* Attributes conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* PI's
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartPI(xmlTextWriterPtr writer,
- const xmlChar * target);
- XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartPI(xmlTextWriterPtr writer,
+ const xmlChar * target);
+XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
/*
* PI conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWritePI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWritePI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const xmlChar * content);
/**
* xmlTextWriterWriteProcessingInstruction:
@@ -278,57 +278,57 @@ extern "C" {
/*
* CDATA
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
/*
* CDATA conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
+ const xmlChar * content);
/*
* DTD
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
/*
* DTD conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * subset);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * subset);
/**
* xmlTextWriterWriteDocType:
@@ -340,141 +340,141 @@ extern "C" {
/*
* DTD element definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
+ writer);
/*
* DTD element definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD attribute list definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
+ writer);
/*
* DTD attribute list definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD entity definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
- int pe, const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
+ int pe, const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
+ writer);
/*
* DTD entity definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(4,5);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(4,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * ndataid);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
- writer,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar *
- ndataid);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
- writer, int pe,
- const xmlChar * name,
- const xmlChar *
- pubid,
- const xmlChar *
- sysid,
- const xmlChar *
- ndataid,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(4,5);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(4,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * ndataid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
+ writer,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar *
+ ndataid);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
+ writer, int pe,
+ const xmlChar * name,
+ const xmlChar *
+ pubid,
+ const xmlChar *
+ sysid,
+ const xmlChar *
+ ndataid,
+ const xmlChar *
+ content);
/*
* DTD notation definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
/*
* Indentation
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
- const xmlChar * str);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
+ const xmlChar * str);
/*
* misc
*/
- XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xpath.h b/thirdparties/s60/include/libxml/xpath.h
index 1a9e30e..a728f00 100755
--- a/thirdparties/s60/include/libxml/xpath.h
+++ b/thirdparties/s60/include/libxml/xpath.h
@@ -33,7 +33,7 @@
extern "C" {
#endif
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
-
+
#ifdef LIBXML_XPATH_ENABLED
typedef struct _xmlXPathContext xmlXPathContext;
@@ -164,7 +164,7 @@ struct _xmlXPathVariable {
*/
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
- int nargs);
+ int nargs);
/*
* Extra function: a name and a evaluation function.
@@ -190,7 +190,7 @@ struct _xmlXPathFunct {
*/
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr cur);
+ xmlXPathObjectPtr cur);
/*
* Extra axis: a name and an axis function.
@@ -231,8 +231,8 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
* Returns the XPath object value or NULL if not found.
*/
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFuncLookupFunc:
@@ -246,8 +246,8 @@ typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
* Returns the XPath function or NULL if not found.
*/
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFlags:
@@ -271,11 +271,11 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
*
* Expression evaluation occurs with respect to a context.
* he context consists of:
- * - a node (the context node)
- * - a node list (the context node list)
- * - a set of variable bindings
- * - a function library
- * - the set of namespace declarations in scope for the expression
+ * - a node (the context node)
+ * - a node list (the context node list)
+ * - a set of variable bindings
+ * - a function library
+ * - the set of namespace declarations in scope for the expression
* Following the switch to hash tables, this need to be trimmed up at
* the next binary incompatible release.
* The node may be modified when the context is passed to libxml2
@@ -433,110 +433,110 @@ XMLPUBVAR double xmlXPathNINF;
(((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))
-XMLPUBFUN void XMLCALL
- xmlXPathFreeObject (xmlXPathObjectPtr obj);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetCreate (xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathObjectCopy (xmlXPathObjectPtr val);
-XMLPUBFUN int XMLCALL
- xmlXPathCmpNodes (xmlNodePtr node1,
- xmlNodePtr node2);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeObject (xmlXPathObjectPtr obj);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeSetCreate (xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathObjectCopy (xmlXPathObjectPtr val);
+XMLPUBFUN int XMLCALL
+xmlXPathCmpNodes (xmlNodePtr node1,
+ xmlNodePtr node2);
/**
* Conversion functions to basic types.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathCastNumberToBoolean (double val);
-XMLPUBFUN int XMLCALL
- xmlXPathCastStringToBoolean (const xmlChar * val);
-XMLPUBFUN int XMLCALL
- xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
-XMLPUBFUN int XMLCALL
- xmlXPathCastToBoolean (xmlXPathObjectPtr val);
-
-XMLPUBFUN double XMLCALL
- xmlXPathCastBooleanToNumber (int val);
-XMLPUBFUN double XMLCALL
- xmlXPathCastStringToNumber (const xmlChar * val);
-XMLPUBFUN double XMLCALL
- xmlXPathCastNodeToNumber (xmlNodePtr node);
-XMLPUBFUN double XMLCALL
- xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
-XMLPUBFUN double XMLCALL
- xmlXPathCastToNumber (xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastBooleanToString (int val);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNumberToString (double val);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeToString (xmlNodePtr node);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastToString (xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertBoolean (xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertNumber (xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertString (xmlXPathObjectPtr val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastNumberToBoolean (double val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastStringToBoolean (const xmlChar * val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
+XMLPUBFUN int XMLCALL
+xmlXPathCastToBoolean (xmlXPathObjectPtr val);
+
+XMLPUBFUN double XMLCALL
+xmlXPathCastBooleanToNumber (int val);
+XMLPUBFUN double XMLCALL
+xmlXPathCastStringToNumber (const xmlChar * val);
+XMLPUBFUN double XMLCALL
+xmlXPathCastNodeToNumber (xmlNodePtr node);
+XMLPUBFUN double XMLCALL
+xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
+XMLPUBFUN double XMLCALL
+xmlXPathCastToNumber (xmlXPathObjectPtr val);
+
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastBooleanToString (int val);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNumberToString (double val);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNodeToString (xmlNodePtr node);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastToString (xmlXPathObjectPtr val);
+
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertBoolean (xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertNumber (xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertString (xmlXPathObjectPtr val);
/**
* Context handling.
*/
-XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPathNewContext (xmlDocPtr doc);
+XMLPUBFUN xmlXPathContextPtr XMLCALL
+xmlXPathNewContext (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlXPathFreeContext (xmlXPathContextPtr ctxt);
+xmlXPathFreeContext (xmlXPathContextPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
- int active,
- int value,
- int options);
+xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
+ int active,
+ int value,
+ int options);
/**
* Evaluation functions.
*/
-XMLPUBFUN long XMLCALL
- xmlXPathOrderDocElems (xmlDocPtr doc);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEvalExpression (const xmlChar *str,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
- xmlXPathObjectPtr res);
+XMLPUBFUN long XMLCALL
+xmlXPathOrderDocElems (xmlDocPtr doc);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathEvalExpression (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
+ xmlXPathObjectPtr res);
/**
* Separate compilation/evaluation entry points.
*/
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCompile (const xmlChar *str);
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
- const xmlChar *str);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctx);
-XMLPUBFUN int XMLCALL
- xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
+XMLPUBFUN xmlXPathCompExprPtr XMLCALL
+xmlXPathCompile (const xmlChar *str);
+XMLPUBFUN xmlXPathCompExprPtr XMLCALL
+xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
+ const xmlChar *str);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN int XMLCALL
+xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
#endif /* LIBXML_XPATH_ENABLED */
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlXPathInit (void);
+XMLPUBFUN void XMLCALL
+xmlXPathInit (void);
XMLPUBFUN int XMLCALL
- xmlXPathIsNaN (double val);
+xmlXPathIsNaN (double val);
XMLPUBFUN int XMLCALL
- xmlXPathIsInf (double val);
+xmlXPathIsInf (double val);
#ifdef __cplusplus
}
diff --git a/thirdparties/s60/include/libxml/xpathInternals.h b/thirdparties/s60/include/libxml/xpathInternals.h
index dcd5243..6a17e2d 100755
--- a/thirdparties/s60/include/libxml/xpathInternals.h
+++ b/thirdparties/s60/include/libxml/xpathInternals.h
@@ -100,16 +100,16 @@ extern "C" {
*/
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
-XMLPUBFUN int XMLCALL
- xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN double XMLCALL
- xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathPopString (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void * XMLCALL
- xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN double XMLCALL
+xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathPopString (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN void * XMLCALL
+xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/**
* xmlXPathReturnBoolean:
@@ -329,222 +329,222 @@ XMLPUBFUN void * XMLCALL
* Variable Lookup forwarding.
*/
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
- xmlXPathVariableLookupFunc f,
- void *data);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
+ xmlXPathVariableLookupFunc f,
+ void *data);
/*
* Function Lookup forwarding.
*/
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
- xmlXPathFuncLookupFunc f,
- void *funcCtxt);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
+ xmlXPathFuncLookupFunc f,
+ void *funcCtxt);
/*
* Error reporting.
*/
-XMLPUBFUN void XMLCALL
- xmlXPatherror (xmlXPathParserContextPtr ctxt,
- const char *file,
- int line,
- int no);
+XMLPUBFUN void XMLCALL
+xmlXPatherror (xmlXPathParserContextPtr ctxt,
+ const char *file,
+ int line,
+ int no);
XMLPUBFUN void XMLCALL
- xmlXPathErr (xmlXPathParserContextPtr ctxt,
- int error);
+xmlXPathErr (xmlXPathParserContextPtr ctxt,
+ int error);
#ifdef LIBXML_DEBUG_ENABLED
-XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpObject (FILE *output,
- xmlXPathObjectPtr cur,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpCompExpr(FILE *output,
- xmlXPathCompExprPtr comp,
- int depth);
+XMLPUBFUN void XMLCALL
+xmlXPathDebugDumpObject (FILE *output,
+ xmlXPathObjectPtr cur,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlXPathDebugDumpCompExpr(FILE *output,
+ xmlXPathCompExprPtr comp,
+ int depth);
#endif
/**
* NodeSet handling.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathNodeSetContains (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDifference (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathIntersection (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinct (xmlNodeSetPtr nodes);
-
-XMLPUBFUN int XMLCALL
- xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeading (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeading (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailing (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+XMLPUBFUN int XMLCALL
+xmlXPathNodeSetContains (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDifference (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathIntersection (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDistinct (xmlNodeSetPtr nodes);
+
+XMLPUBFUN int XMLCALL
+xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeLeading (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathLeading (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathTrailing (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
/**
* Extending a context.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
- const xmlChar *prefix,
- const xmlChar *ns_uri);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlXPathNsLookup (xmlXPathContextPtr ctxt,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
-
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathFunction f);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathFunction f);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathObjectPtr value);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathObjectPtr value);
-XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix,
+ const xmlChar *ns_uri);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlXPathNsLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
+
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathFunction f);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathFunction f);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathObjectPtr value);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathObjectPtr value);
+XMLPUBFUN xmlXPathFunction XMLCALL
+xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN xmlXPathFunction XMLCALL
+xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
/**
* Utilities to extend XPath.
*/
XMLPUBFUN xmlXPathParserContextPtr XMLCALL
- xmlXPathNewParserContext (const xmlChar *str,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
+xmlXPathNewParserContext (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
/* TODO: remap to xmlXPathValuePop and Push. */
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- valuePop (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN int XMLCALL
- valuePush (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr value);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewString (const xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewCString (const char *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapString (xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapCString (char * val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewFloat (double val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewBoolean (int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSet (xmlNodePtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewValueTree (xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
- xmlNodePtr node,
- xmlNsPtr ns);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetSort (xmlNodeSetPtr set);
-
-XMLPUBFUN void XMLCALL
- xmlXPathRoot (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseName (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+valuePop (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+valuePush (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr value);
+
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewString (const xmlChar *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewCString (const char *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapString (xmlChar *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapCString (char * val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewFloat (double val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewBoolean (int val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewNodeSet (xmlNodePtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewValueTree (xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
+ xmlNodePtr node,
+ xmlNsPtr ns);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetSort (xmlNodeSetPtr set);
+
+XMLPUBFUN void XMLCALL
+xmlXPathRoot (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathParseName (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
/*
* Existing functions.
*/
-XMLPUBFUN double XMLCALL
- xmlXPathStringEvalNumber (const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr res);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
- xmlNodeSetPtr val2);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetDel (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
- int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSetList (xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapNodeSet (xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapExternal (void *val);
+XMLPUBFUN double XMLCALL
+xmlXPathStringEvalNumber (const xmlChar *str);
+XMLPUBFUN int XMLCALL
+xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr res);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
+ xmlNodeSetPtr val2);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetDel (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
+ int val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewNodeSetList (xmlNodeSetPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapNodeSet (xmlNodeSetPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapExternal (void *val);
XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
@@ -562,31 +562,31 @@ XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
* Some of the axis navigation routines.
*/
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
/*
* The official core of XPath functions.
*/
@@ -621,7 +621,7 @@ XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, in
* Really internal functions
*/
XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns);
-
+
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/libxml/xpointer.h b/thirdparties/s60/include/libxml/xpointer.h
index dde1dfb..7cb05e8 100755
--- a/thirdparties/s60/include/libxml/xpointer.h
+++ b/thirdparties/s60/include/libxml/xpointer.h
@@ -7,7 +7,7 @@
*
* Added support for the element() scheme described in:
* W3C Proposed Recommendation 13 November 2002
- * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
+ * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
*
* Copy: See Copyright for the status of this software.
*
@@ -43,69 +43,69 @@ struct _xmlLocationSet {
* Handling of location sets.
*/
-XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
-XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
- xmlLocationSetPtr val2);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRange (xmlNodePtr start,
- int startindex,
- xmlNodePtr end,
- int endindex);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodePoint (xmlNodePtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodes (xmlNodePtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodes (xmlNodePtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodeObject (xmlNodePtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewCollapsedRange (xmlNodePtr start);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
- int val);
+XMLPUBFUN xmlLocationSetPtr XMLCALL
+xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
+XMLPUBFUN xmlLocationSetPtr XMLCALL
+xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
+ xmlLocationSetPtr val2);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRange (xmlNodePtr start,
+ int startindex,
+ xmlNodePtr end,
+ int endindex);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodePoint (xmlNodePtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodes (xmlNodePtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewLocationSetNodes (xmlNodePtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodeObject (xmlNodePtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewCollapsedRange (xmlNodePtr start);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
+ int val);
/*
* Functions.
*/
-XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPtrNewContext (xmlDocPtr doc,
- xmlNodePtr here,
- xmlNodePtr origin);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
-XMLPUBFUN void XMLCALL
- xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
- int nargs);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL
- xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlXPathContextPtr XMLCALL
+xmlXPtrNewContext (xmlDocPtr doc,
+ xmlNodePtr here,
+ xmlNodePtr origin);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN void XMLCALL
+xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
+ int nargs);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
+XMLPUBFUN void XMLCALL
+xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/s60/include/smc/statemap.h b/thirdparties/s60/include/smc/statemap.h
index 2fe7b85..201d683 100755
--- a/thirdparties/s60/include/smc/statemap.h
+++ b/thirdparties/s60/include/smc/statemap.h
@@ -6,21 +6,21 @@
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
- *
+ *
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
- *
+ *
* The Original Code is State Machine Compiler (SMC).
- *
+ *
* The Initial Developer of the Original Code is Charles W. Rapp.
- *
+ *
* Port to C by Francois Perrad, francois.perrad@gadz.org
* Copyright 2004, Francois Perrad.
* All Rights Reserved.
*
- * Contributor(s):
+ * Contributor(s):
*
* Description
*
@@ -54,8 +54,7 @@
const char *_name; \
int _id;
-struct State
-{
+struct State {
STATE_MEMBERS
};
@@ -76,8 +75,7 @@ struct State
const char * _transition; \
int _debug_flag;
-struct FSMContext
-{
+struct FSMContext {
FSM_MEMBERS(_)
};
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/bv16.h b/thirdparties/win32/include/BroadVoice16/bv16/bv16.h
index 90f7973..685a476 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/bv16.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/bv16.h
@@ -20,28 +20,28 @@
/*****************************************************************************
- bv16.h :
+ bv16.h :
$Log$
******************************************************************************/
void Reset_BV16_Encoder(
-struct BV16_Encoder_State *cs);
+ struct BV16_Encoder_State *cs);
void BV16_Encode(
-struct BV16_Bit_Stream *bs,
-struct BV16_Encoder_State *cs,
-Word16 *inx);
+ struct BV16_Bit_Stream *bs,
+ struct BV16_Encoder_State *cs,
+ Word16 *inx);
void Reset_BV16_Decoder(
-struct BV16_Decoder_State *ds);
+ struct BV16_Decoder_State *ds);
void BV16_Decode(
-struct BV16_Bit_Stream *bs,
-struct BV16_Decoder_State *ds,
-Word16 *xq);
+ struct BV16_Bit_Stream *bs,
+ struct BV16_Decoder_State *ds,
+ Word16 *xq);
void BV16_PLC(
-struct BV16_Decoder_State *ds,
-Word16 *x);
+ struct BV16_Decoder_State *ds,
+ Word16 *x);
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/bv16cnst.h b/thirdparties/win32/include/BroadVoice16/bv16/bv16cnst.h
index bd07214..b2a2eb0 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/bv16cnst.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/bv16cnst.h
@@ -37,7 +37,7 @@
#define MAXPP1 (MAXPP+1)/* MAXimum Pitch Period + 1 */
/* Quantization parameters */
-#define VDIM 4 /* excitation vector dimension */
+#define VDIM 4 /* excitation vector dimension */
#define CBSZ 16 /* excitation codebook size */
#define PPCBSZ 32 /* pitch predictor codebook size */
#define LGPORDER 8 /* Log-Gain Predictor OODER */
@@ -120,7 +120,7 @@
#define M2 MAXPPD1
#define HDECF (DECF/2)
-/* Front-end 150 Hz highpass filter */
+/* Front-end 150 Hz highpass filter */
#define HPO 2 /* High-pass filter order */
/* LPC weighting filter */
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/bv16externs.h b/thirdparties/win32/include/BroadVoice16/bv16/bv16externs.h
index 6d7ce95..6bc8f3e 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/bv16externs.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/bv16externs.h
@@ -60,98 +60,98 @@ extern Word16 cccb[];
/* Function Prototypes */
Word32 estlevel(
-Word32 lg,
-Word32 *level,
-Word32 *lmax,
-Word32 *lmin,
-Word32 *lmean,
-Word32 *x1,
-Word16 ngfae,
-Word16 nggalgc,
-Word16 *estl_alpha_min); /* Q15 */
+ Word32 lg,
+ Word32 *level,
+ Word32 *lmax,
+ Word32 *lmin,
+ Word32 *lmean,
+ Word32 *x1,
+ Word16 ngfae,
+ Word16 nggalgc,
+ Word16 *estl_alpha_min); /* Q15 */
void excdec_w_synth(
-Word16 *xq, /* (o) Q0 quantized signal vector */
-Word16 *ltsym, /* (i/o) Q16 quantized excitation signal vector */
-Word16 *stsym, /* (i/o) Q0 short-term predictor memory */
-Word16 *idx, /* (o) quantizer codebook index for uq[] vector */
-Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
-Word16 *cb, /* (i) Q0 codebook */
-Word16 pp, /* pitch period (# of 8 kHz samples) */
-Word16 *aq, /* (i) Q12 short-term predictor coefficients */
-Word16 gain_exp, /* gain_exp of current sub-frame */
-Word32 *EE
+ Word16 *xq, /* (o) Q0 quantized signal vector */
+ Word16 *ltsym, /* (i/o) Q16 quantized excitation signal vector */
+ Word16 *stsym, /* (i/o) Q0 short-term predictor memory */
+ Word16 *idx, /* (o) quantizer codebook index for uq[] vector */
+ Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
+ Word16 *cb, /* (i) Q0 codebook */
+ Word16 pp, /* pitch period (# of 8 kHz samples) */
+ Word16 *aq, /* (i) Q12 short-term predictor coefficients */
+ Word16 gain_exp, /* gain_exp of current sub-frame */
+ Word32 *EE
);
Word32 gaindec(
-Word32 *lgq, /* Q25 */
-Word16 gidx,
-Word16 *lgpm, /* Q11 */
-Word32 *prevlg, /* Q25 */
-Word32 level, /* Q25 */
-Word16 *nggalgc,
-Word32 *lg_el);
+ Word32 *lgq, /* Q25 */
+ Word16 gidx,
+ Word16 *lgpm, /* Q11 */
+ Word32 *prevlg, /* Q25 */
+ Word32 level, /* Q25 */
+ Word16 *nggalgc,
+ Word32 *lg_el);
void gainplc(Word32 E, Word16 *lgeqm, Word32 *lgqm);
void lspdec(
-Word16 *lspq, /* Q15 */
-Word16 *lspidx,
-Word16 *lsppm, /* Q15 */
-Word16 *lspqlast);
+ Word16 *lspq, /* Q15 */
+ Word16 *lspidx,
+ Word16 *lsppm, /* Q15 */
+ Word16 *lspqlast);
void lspdecplc(
-Word16 *lspq, /* Q15 */
-Word16 *lsppm); /* Q15 */
+ Word16 *lspq, /* Q15 */
+ Word16 *lsppm); /* Q15 */
Word16 coarsepitch(
-Word16 *xw, /* (i) Q1 weighted low-band signal frame */
-struct BV16_Encoder_State *c); /* (i/o) coder state */
+ Word16 *xw, /* (i) Q1 weighted low-band signal frame */
+ struct BV16_Encoder_State *c); /* (i/o) coder state */
Word16 refinepitch(
-Word16 *x,
-Word16 cpp,
-Word16 *ppt);
+ Word16 *x,
+ Word16 cpp,
+ Word16 *ppt);
Word16 pitchtapquan(
-Word16 *x,
-Word16 pp,
-Word16 *b,
-Word32 *re);
+ Word16 *x,
+ Word16 pp,
+ Word16 *b,
+ Word32 *re);
void excquan(
-Word16 *idx, /* quantizer codebook index for uq[] vector */
-Word16 *s, /* (i) Q0 input signal vector */
-Word16 *aq, /* (i) Q12 noise feedback filter coefficient array */
-Word16 *fsz, /* (i) Q12 short-term noise feedback filter - numerator */
-Word16 *fsp, /* (i) Q12 short-term noise feedback filter - denominator */
-Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
-Word16 beta, /* (i) Q13 coefficient of pitch feedback filter */
-Word16 *stsym, /* (i/o) Q0 filter memory */
-Word16 *ltsym, /* (i/0) Q0 long-term synthesis filter memory */
-Word16 *ltnfm, /* (i/o) Q0 long-term noise feedback filter memory */
-Word16 *stnfz, /* (i/o) Q0 filter memory */
-Word16 *stnfp, /* (i/o) Q0 filter memory */
-Word16 *cb, /* (i) scalar quantizer codebook - normalized by gain_exp */
-Word16 pp, /* pitch period (# of 8 kHz samples) */
-Word16 gain_exp
+ Word16 *idx, /* quantizer codebook index for uq[] vector */
+ Word16 *s, /* (i) Q0 input signal vector */
+ Word16 *aq, /* (i) Q12 noise feedback filter coefficient array */
+ Word16 *fsz, /* (i) Q12 short-term noise feedback filter - numerator */
+ Word16 *fsp, /* (i) Q12 short-term noise feedback filter - denominator */
+ Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
+ Word16 beta, /* (i) Q13 coefficient of pitch feedback filter */
+ Word16 *stsym, /* (i/o) Q0 filter memory */
+ Word16 *ltsym, /* (i/0) Q0 long-term synthesis filter memory */
+ Word16 *ltnfm, /* (i/o) Q0 long-term noise feedback filter memory */
+ Word16 *stnfz, /* (i/o) Q0 filter memory */
+ Word16 *stnfp, /* (i/o) Q0 filter memory */
+ Word16 *cb, /* (i) scalar quantizer codebook - normalized by gain_exp */
+ Word16 pp, /* pitch period (# of 8 kHz samples) */
+ Word16 gain_exp
);
Word16 gainquan(
-Word32 *gainq, /* Q18 */
-Word32 *ee, /* Q3 */
-Word16 *lgpm, /* Q11 */
-Word32 *prevlg, /* Q25 */
-Word32 level); /* Q25 */
+ Word32 *gainq, /* Q18 */
+ Word32 *ee, /* Q3 */
+ Word16 *lgpm, /* Q11 */
+ Word32 *prevlg, /* Q25 */
+ Word32 level); /* Q25 */
void lspquan(
-Word16 *lspq,
-Word16 *lspidx,
-Word16 *lsp,
-Word16 *lsppm);
+ Word16 *lspq,
+ Word16 *lspidx,
+ Word16 *lsp,
+ Word16 *lsppm);
void preprocess(
-struct BV16_Encoder_State *cs,
-Word16 *output, /* (o) Q0 output signal, less factor 1.5 */
-Word16 *input, /* (i) Q0 input signal */
-Word16 N); /* length of signal */
+ struct BV16_Encoder_State *cs,
+ Word16 *output, /* (o) Q0 output signal, less factor 1.5 */
+ Word16 *input, /* (i) Q0 input signal */
+ Word16 N); /* length of signal */
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/bv16strct.h b/thirdparties/win32/include/BroadVoice16/bv16/bv16strct.h
index d0877cb..974f8fe 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/bv16strct.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/bv16strct.h
@@ -29,66 +29,66 @@
#define BV16STRCT_H
struct BV16_Decoder_State {
-Word16 stsym[LPCO];
-Word16 ltsym[LTMOFF];
-Word16 xq[XQOFF];
-Word16 lsppm[LPCO*LSPPORDER];
-Word16 lgpm[LGPORDER];
-Word16 lsplast[LPCO];
-Word32 prevlg[2];
-Word32 lmax;
-Word32 lmin;
-Word32 lmean;
-Word32 x1;
-Word32 level;
-Word16 pp_last;
-Word16 cfecount;
-Word16 ngfae;
-Word16 bq_last[3];
-Word16 nggalgc;
-Word16 estl_alpha_min;
-UWord32 idum;
-Word16 per; /* Q15 */
-Word32 E;
-Word16 atplc[LPCO+1];
-Word16 ma_a;
-Word16 b_prv[2];
-Word16 pp_prv;
+ Word16 stsym[LPCO];
+ Word16 ltsym[LTMOFF];
+ Word16 xq[XQOFF];
+ Word16 lsppm[LPCO*LSPPORDER];
+ Word16 lgpm[LGPORDER];
+ Word16 lsplast[LPCO];
+ Word32 prevlg[2];
+ Word32 lmax;
+ Word32 lmin;
+ Word32 lmean;
+ Word32 x1;
+ Word32 level;
+ Word16 pp_last;
+ Word16 cfecount;
+ Word16 ngfae;
+ Word16 bq_last[3];
+ Word16 nggalgc;
+ Word16 estl_alpha_min;
+ UWord32 idum;
+ Word16 per; /* Q15 */
+ Word32 E;
+ Word16 atplc[LPCO+1];
+ Word16 ma_a;
+ Word16 b_prv[2];
+ Word16 pp_prv;
};
struct BV16_Encoder_State {
-Word32 prevlg[2];
-Word32 lmax;
-Word32 lmin;
-Word32 lmean;
-Word32 x1;
-Word32 level;
-Word16 x[XOFF]; /* Signal memory */
-Word16 xwd[XDOFF]; /* Memory of DECF:1 decimated version of xw() */
-Word16 xwd_exp; /* or block floating-point in coarptch.c */
-Word16 dq[XOFF]; /* Q0 - Quantized short-term pred error */
-Word16 dfm_h[DFO]; /* Decimated xwd() filter memory */
-Word16 dfm_l[DFO];
-Word16 stwpm[LPCO]; /* Q0 - Short-term weighting all-pole filter memory */
-Word16 stsym[LPCO]; /* Q0 - Short-term synthesis filter memory */
-Word16 stnfz[NSTORDER]; /* Q0 - Short-term noise feedback filter memory - zero section */
-Word16 stnfp[NSTORDER]; /* Q0 - Short-term noise feedback filter memory - pole section */
-Word16 ltnfm[MAXPP1]; /* Q0 - Long-term noise feedback filter memory */
-Word16 lsplast[LPCO];
-Word16 lsppm[LPCO*LSPPORDER]; /* Q15 - LSP Predictor Memory */
-Word16 lgpm[LGPORDER]; /* Q11 - Log-Gain Predictor Memory */
-Word16 cpplast; /* Pitch period pf the previous frame */
-Word16 hpfzm[HPO];
-Word16 hpfpm[2*HPO];
-Word16 old_A[1+LPCO]; /* Q12 - LPC of previous frame */
+ Word32 prevlg[2];
+ Word32 lmax;
+ Word32 lmin;
+ Word32 lmean;
+ Word32 x1;
+ Word32 level;
+ Word16 x[XOFF]; /* Signal memory */
+ Word16 xwd[XDOFF]; /* Memory of DECF:1 decimated version of xw() */
+ Word16 xwd_exp; /* or block floating-point in coarptch.c */
+ Word16 dq[XOFF]; /* Q0 - Quantized short-term pred error */
+ Word16 dfm_h[DFO]; /* Decimated xwd() filter memory */
+ Word16 dfm_l[DFO];
+ Word16 stwpm[LPCO]; /* Q0 - Short-term weighting all-pole filter memory */
+ Word16 stsym[LPCO]; /* Q0 - Short-term synthesis filter memory */
+ Word16 stnfz[NSTORDER]; /* Q0 - Short-term noise feedback filter memory - zero section */
+ Word16 stnfp[NSTORDER]; /* Q0 - Short-term noise feedback filter memory - pole section */
+ Word16 ltnfm[MAXPP1]; /* Q0 - Long-term noise feedback filter memory */
+ Word16 lsplast[LPCO];
+ Word16 lsppm[LPCO*LSPPORDER]; /* Q15 - LSP Predictor Memory */
+ Word16 lgpm[LGPORDER]; /* Q11 - Log-Gain Predictor Memory */
+ Word16 cpplast; /* Pitch period pf the previous frame */
+ Word16 hpfzm[HPO];
+ Word16 hpfpm[2*HPO];
+ Word16 old_A[1+LPCO]; /* Q12 - LPC of previous frame */
};
struct BV16_Bit_Stream {
-Word16 lspidx[2];
-Word16 ppidx;
-Word16 bqidx;
-Word16 gidx;
-Word16 qvidx[FRSZ/VDIM];
+ Word16 lspidx[2];
+ Word16 ppidx;
+ Word16 bqidx;
+ Word16 gidx;
+ Word16 qvidx[FRSZ/VDIM];
};
#endif /* BV16STRCT_H */
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/g192.h b/thirdparties/win32/include/BroadVoice16/bv16/g192.h
index c1562c2..bd6fe0a 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/g192.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/g192.h
@@ -20,7 +20,7 @@
/*****************************************************************************
- g192.h : BV16 G.192
+ g192.h : BV16 G.192
$Log$
******************************************************************************/
diff --git a/thirdparties/win32/include/BroadVoice16/bv16/postfilt.h b/thirdparties/win32/include/BroadVoice16/bv16/postfilt.h
index 5054148..b1fcbd3 100755
--- a/thirdparties/win32/include/BroadVoice16/bv16/postfilt.h
+++ b/thirdparties/win32/include/BroadVoice16/bv16/postfilt.h
@@ -26,9 +26,9 @@
******************************************************************************/
void postfilter(
-Word16 *s, /* input : quantized speech signal */
-Word16 pp, /* input : pitch period */
-Word16 *ma_a,
-Word16 *b_prv,
-Word16 *pp_prv,
-Word16 *e); /* output: enhanced speech signal */
+ Word16 *s, /* input : quantized speech signal */
+ Word16 pp, /* input : pitch period */
+ Word16 *ma_a,
+ Word16 *b_prv,
+ Word16 *pp_prv,
+ Word16 *e); /* output: enhanced speech signal */
diff --git a/thirdparties/win32/include/BroadVoice16/bvcommon/bvcommon.h b/thirdparties/win32/include/BroadVoice16/bvcommon/bvcommon.h
index 4b285a3..dd9636b 100755
--- a/thirdparties/win32/include/BroadVoice16/bvcommon/bvcommon.h
+++ b/thirdparties/win32/include/BroadVoice16/bvcommon/bvcommon.h
@@ -56,73 +56,73 @@ extern Word16 pp9cb[];
/* Function prototypes */
void azfilter(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 m, /* (i) : LPC order */
- Word16 x[], /* (i) Q0 : input signal samples, incl. past */
- Word16 y[], /* (o) Q0 : filtered output signal */
- Word16 lg /* (i) : size of filtering */
- );
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 m, /* (i) : LPC order */
+ Word16 x[], /* (i) Q0 : input signal samples, incl. past */
+ Word16 y[], /* (o) Q0 : filtered output signal */
+ Word16 lg /* (i) : size of filtering */
+);
void apfilter(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 m, /* (i) : LPC order */
- Word16 x[], /* (i) Q0 : input signal */
- Word16 y[], /* (o) Q0 : output signal */
- Word16 lg, /* (i) : size of filtering */
- Word16 mem[], /* (i/o) Q0: filter memory */
- Word16 update /* (i) : memory update flag */
- );
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 m, /* (i) : LPC order */
+ Word16 x[], /* (i) Q0 : input signal */
+ Word16 y[], /* (o) Q0 : output signal */
+ Word16 lg, /* (i) : size of filtering */
+ Word16 mem[], /* (i/o) Q0: filter memory */
+ Word16 update /* (i) : memory update flag */
+);
void lsp2a(
-Word16 lsp[], /* (i) Q15 : line spectral frequencies */
-Word16 a[]); /* (o) Q12 : predictor coefficients (order = 10) */
+ Word16 lsp[], /* (i) Q15 : line spectral frequencies */
+ Word16 a[]); /* (o) Q12 : predictor coefficients (order = 10) */
void stblz_lsp(
-Word16 *lsp, /* Q15 */
-Word16 order);
+ Word16 *lsp, /* Q15 */
+ Word16 order);
Word16 stblchck(
-Word16 *x,
-Word16 vdim);
+ Word16 *x,
+ Word16 vdim);
void a2lsp(
-Word16 a[], /* (i) Q12 : predictor coefficients */
-Word16 lsp[], /* (o) Q15 : line spectral frequencies */
-Word16 old_lsp[]); /* (i) : old lsp[] (in case not found 10 roots) */
+ Word16 a[], /* (i) Q12 : predictor coefficients */
+ Word16 lsp[], /* (o) Q15 : line spectral frequencies */
+ Word16 old_lsp[]); /* (i) : old lsp[] (in case not found 10 roots) */
void Autocorr(
- Word32 r[], /* (o) : Autocorrelations */
- Word16 x[], /* (i) : Input signal */
- Word16 window[],/* (i) : LPC Analysis window */
- Word16 l_window,/* (i) : window length */
- Word16 m); /* (i) : LPC order */
+ Word32 r[], /* (o) : Autocorrelations */
+ Word16 x[], /* (i) : Input signal */
+ Word16 window[],/* (i) : LPC Analysis window */
+ Word16 l_window,/* (i) : window length */
+ Word16 m); /* (i) : LPC order */
void Spectral_Smoothing(
-Word16 m, /* (i) : LPC order */
-Word32 rl[], /* (i/o) : Autocorrelations lags */
-Word16 lag_h[], /* (i) : SST coefficients (msb) */
-Word16 lag_l[]); /* (i) : SST coefficients (lsb) */
+ Word16 m, /* (i) : LPC order */
+ Word32 rl[], /* (i/o) : Autocorrelations lags */
+ Word16 lag_h[], /* (i) : SST coefficients (msb) */
+ Word16 lag_l[]); /* (i) : SST coefficients (lsb) */
void Levinson(
- Word32 r32[], /* (i) : r32[] double precision vector of autocorrelation coefficients */
- Word16 a[], /* (o) : a[] in Q12 - LPC coefficients */
- Word16 old_a[], /* (i/o): old_a[] in Q12 - previous LPC coefficients */
- Word16 m); /* (i) : LPC order */
+ Word32 r32[], /* (i) : r32[] double precision vector of autocorrelation coefficients */
+ Word16 a[], /* (o) : a[] in Q12 - LPC coefficients */
+ Word16 old_a[], /* (i/o): old_a[] in Q12 - previous LPC coefficients */
+ Word16 m); /* (i) : LPC order */
void pp3dec(
-Word16 idx,
-Word16 *b);
+ Word16 idx,
+ Word16 *b);
void vqdec(
-Word16 *xq,
-Word16 idx,
-Word16 *cb,
-Word16 vdim);
+ Word16 *xq,
+ Word16 idx,
+ Word16 *cb,
+ Word16 vdim);
#ifdef _MSC_VER
#include "math.h"
static __inline double round(double val)
-{
+{
return floor(val + 0.5);
}
#endif
diff --git a/thirdparties/win32/include/BroadVoice16/bvcommon/mathutil.h b/thirdparties/win32/include/BroadVoice16/bvcommon/mathutil.h
index 17198cd..7f6c353 100755
--- a/thirdparties/win32/include/BroadVoice16/bvcommon/mathutil.h
+++ b/thirdparties/win32/include/BroadVoice16/bvcommon/mathutil.h
@@ -20,21 +20,21 @@
/*****************************************************************************
- fixmath.h : Common Fixed-Point Library:
+ fixmath.h : Common Fixed-Point Library:
$Log$
******************************************************************************/
Word32 Pow2( /* Q0 output */
- Word16 int_comp, /* Q0 Integer part */
- Word16 frac_comp /* Q15 frac_compal part */
- );
+ Word16 int_comp, /* Q0 Integer part */
+ Word16 frac_comp /* Q15 frac_compal part */
+);
void Log2(
- Word32 x, /* (i) input */
- Word16 *int_comp, /* Q0 integer part */
- Word16 *frac_comp /* Q15 fractional part */
- );
+ Word32 x, /* (i) input */
+ Word16 *int_comp, /* Q0 integer part */
+ Word16 *frac_comp /* Q15 fractional part */
+);
void sqrt_i(Word16 x_man, Word16 x_exp, Word16 *y_man, Word16 *y_exp);
Word16 sqrts(Word16 x);
diff --git a/thirdparties/win32/include/BroadVoice16/bvcommon/typedef.h b/thirdparties/win32/include/BroadVoice16/bvcommon/typedef.h
index 769f372..d8f378e 100755
--- a/thirdparties/win32/include/BroadVoice16/bvcommon/typedef.h
+++ b/thirdparties/win32/include/BroadVoice16/bvcommon/typedef.h
@@ -20,7 +20,7 @@
/*****************************************************************************
- typedef.h : Common Fixed-Point Library:
+ typedef.h : Common Fixed-Point Library:
$Log$
******************************************************************************/
diff --git a/thirdparties/win32/include/BroadVoice16/bvcommon/utility.h b/thirdparties/win32/include/BroadVoice16/bvcommon/utility.h
index c0a3cfe..49aafa4 100755
--- a/thirdparties/win32/include/BroadVoice16/bvcommon/utility.h
+++ b/thirdparties/win32/include/BroadVoice16/bvcommon/utility.h
@@ -20,7 +20,7 @@
/*****************************************************************************
- utility.h : Common Fixed-Point Library:
+ utility.h : Common Fixed-Point Library:
$Log$
******************************************************************************/
diff --git a/thirdparties/win32/include/cuda/types.h b/thirdparties/win32/include/cuda/types.h
index c7be519..e4941e5 100755
--- a/thirdparties/win32/include/cuda/types.h
+++ b/thirdparties/win32/include/cuda/types.h
@@ -18,26 +18,25 @@
extern "C" {
#endif
-struct NVEncoderParams
-{
+struct NVEncoderParams {
char configFile[256];
char inputFile[256];
char outputFile[256];
- int measure_psnr;
- int measure_fps;
- int force_device;
- int iSurfaceFormat;
- int iPictureType;
- int nDeviceMemPitch;
-
- int iCodecType; // NVVE_CODEC_TYPE,
- int GPU_count; // Choose the specific GPU count
- int GPU_devID; // Choose the specific GPU device ID
- int iUseDeviceMem; // CUDA with DEVICE_MEMORY_INPUT (for encoding)
- int iForcedGPU; // NVVE_FORCE_GPU_SELECTION //F22
+ int measure_psnr;
+ int measure_fps;
+ int force_device;
+ int iSurfaceFormat;
+ int iPictureType;
+ int nDeviceMemPitch;
+
+ int iCodecType; // NVVE_CODEC_TYPE,
+ int GPU_count; // Choose the specific GPU count
+ int GPU_devID; // Choose the specific GPU device ID
+ int iUseDeviceMem; // CUDA with DEVICE_MEMORY_INPUT (for encoding)
+ int iForcedGPU; // NVVE_FORCE_GPU_SELECTION //F22
int iOutputSize[2]; // NVVE_OUT_SIZE,
int iInputSize[2]; // NVVE_IN_SIZE,
- float fAspectRatio; //
+ float fAspectRatio; //
int iAspectRatio[3]; // NVVE_ASPECT_RATIO,
NVVE_FIELD_MODE Fieldmode; // NVVE_FIELD_ENC_MODE,
int iP_Interval; // NVVE_P_INTERVAL,
@@ -60,10 +59,10 @@ struct NVEncoderParams
int iDisableCabac; // NVVE_DISABLE_CABAC,
int iNaluFramingType; // NVVE_CONFIGURE_NALU_FRAMING_TYPE
int iDisableSPSPPS; // NVVE_DISABLE_SPS_PPS
- NVVE_GPUOffloadLevel GPUOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL
- NVVE_GPUOffloadLevel MaxOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL_MAX
- int iSliceCnt; // NVVE_SLICE_COUNT //F19
- int iMultiGPU; // NVVE_MULTI_GPU //F21
+ NVVE_GPUOffloadLevel GPUOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL
+ NVVE_GPUOffloadLevel MaxOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL_MAX
+ int iSliceCnt; // NVVE_SLICE_COUNT //F19
+ int iMultiGPU; // NVVE_MULTI_GPU //F21
int iDeviceMemInput; // NVVE_DEVICE_MEMORY_INPUT //F23
// NVVE_STAT_NUM_CODED_FRAMES,
@@ -81,29 +80,27 @@ struct NVEncoderParams
};
typedef struct {
- char *name;
- char *yuv_type;
- int bpp;
+ char *name;
+ char *yuv_type;
+ int bpp;
} _sYUVParams;
-static _sYUVParams sSurfaceFormat[] =
-{
- { "UYVY", "4:2:2", 16 },
- { "YUY2", "4:2:2", 16 },
- { "YV12", "4:2:0", 12 },
- { "NV12", "4:2:0", 12 },
- { "IYUV", "4:2:0", 12 },
- { NULL , 0 }
+static _sYUVParams sSurfaceFormat[] = {
+ { "UYVY", "4:2:2", 16 },
+ { "YUY2", "4:2:2", 16 },
+ { "YV12", "4:2:0", 12 },
+ { "NV12", "4:2:0", 12 },
+ { "IYUV", "4:2:0", 12 },
+ { NULL , 0 }
};
typedef struct {
- char *name;
- int params;
+ char *name;
+ int params;
} _sNVVEEncodeParams;
-static _sNVVEEncodeParams sNVVE_EncodeParams[] =
-{
- { "UNDEFINED", 1 },
+static _sNVVEEncodeParams sNVVE_EncodeParams[] = {
+ { "UNDEFINED", 1 },
{ "NVVE_OUT_SIZE", 2 },
{ "NVVE_ASPECT_RATIO", 3 },
{ "NVVE_FIELD_ENC_MODE", 1 },
@@ -111,7 +108,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] =
{ "NVVE_IDR_PERIOD", 1 },
{ "NVVE_DYNAMIC_GOP", 1 },
{ "NVVE_RC_TYPE", 1 },
- { "NVVE_AVG_BITRATE", 1 },
+ { "NVVE_AVG_BITRATE", 1 },
{ "NVVE_PEAK_BITRATE", 1 },
{ "NVVE_QP_LEVEL_INTRA", 1 },
{ "NVVE_QP_LEVEL_INTER_P", 1 },
@@ -124,7 +121,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] =
{ "NVVE_CLEAR_STAT (DS)", 1 }, //DShow only
{ "NVVE_SET_DEINTERLACE", 1 },
{ "NVVE_PRESETS", 1 },
- { "NVVE_IN_SIZE", 2 },
+ { "NVVE_IN_SIZE", 2 },
{ "NVVE_STAT_NUM_CODED_FRAMES (DS)", 1 }, //DShow only
{ "NVVE_STAT_NUM_RECEIVED_FRAMES (DS)", 1 }, //DShow only
{ "NVVE_STAT_BITRATE (DS)", 1 }, //DShow only
@@ -138,7 +135,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] =
{ "NVVE_STAT_PERF_FPS (DS)", 1 }, //DShow only
{ "NVVE_STAT_PERF_AVG_TIME (DS)", 1 }, //DShow only
{ "NVVE_DISABLE_CABAC", 1 },
- { "NVVE_CONFIGURE_NALU_FRAMING_TYPE", 1 },
+ { "NVVE_CONFIGURE_NALU_FRAMING_TYPE", 1 },
{ "NVVE_DISABLE_SPS_PPS", 1 },
{ "NVVE_SLICE_COUNT", 1 },
{ "NVVE_GPU_OFFLOAD_LEVEL", 1 },
@@ -147,91 +144,91 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] =
{ "NVVE_GET_GPU_COUNT", 1 },
{ "NVVE_GET_GPU_ATTRIBUTES", 1 },
{ "NVVE_FORCE_GPU_SELECTION", 1 },
- { "NVVE_DEVICE_MEMORY_INPUT", 1 },
- { "NVVE_DEVICE_CTX_LOCK", 1 },
- { NULL, 0 }
+ { "NVVE_DEVICE_MEMORY_INPUT", 1 },
+ { "NVVE_DEVICE_CTX_LOCK", 1 },
+ { NULL, 0 }
};
static _sNVVEEncodeParams sProfileName[] = {
- { "Baseline", 0x42 },
- { "Main" , 0x4d },
- { "High" , 0x64 },
- { NULL , 0 }
+ { "Baseline", 0x42 },
+ { "Main" , 0x4d },
+ { "High" , 0x64 },
+ { NULL , 0 }
};
static _sNVVEEncodeParams sProfileLevel[] = {
- { "1.0", 0x0a },
- { "1.1", 0x0b },
- { "1.2", 0x0c },
- { "1.3", 0x0d },
- { "2.0", 0x14 },
- { "2.1", 0x15 },
- { "2.2", 0x16 },
- { "3.0", 0x1e },
- { "3.1", 0x1f },
- { "3.2", 0x20 },
- { "4.0", 0x28 },
- { "4.1", 0x29 },
- { "4.2", 0x29 },
- { "5.0", 0x32 },
- { "5.1", 0x33 },
- { "Auto", 0xff },
- { NULL , 0 }
+ { "1.0", 0x0a },
+ { "1.1", 0x0b },
+ { "1.2", 0x0c },
+ { "1.3", 0x0d },
+ { "2.0", 0x14 },
+ { "2.1", 0x15 },
+ { "2.2", 0x16 },
+ { "3.0", 0x1e },
+ { "3.1", 0x1f },
+ { "3.2", 0x20 },
+ { "4.0", 0x28 },
+ { "4.1", 0x29 },
+ { "4.2", 0x29 },
+ { "5.0", 0x32 },
+ { "5.1", 0x33 },
+ { "Auto", 0xff },
+ { NULL , 0 }
};
inline char * sProfileIDX2Char(_sNVVEEncodeParams *pProfile, int ID)
{
- int index;
- for (index = 0; pProfile[index].name != NULL; index++) {
- if (pProfile[index].params == ID) {
- // found the profile return the string
- return pProfile[index].name;
- }
- }
- return NULL;
+ int index;
+ for (index = 0; pProfile[index].name != NULL; index++) {
+ if (pProfile[index].params == ID) {
+ // found the profile return the string
+ return pProfile[index].name;
+ }
+ }
+ return NULL;
}
static char *sVideoEncodePresets[] = {
- "PSP ( 320x 240)",
- "iPod/iPhone ( 320x 240)",
- "AVCHD",
- "BluRay",
- "HDV_1440",
- "ZuneHD",
- "FlipCam",
- NULL
+ "PSP ( 320x 240)",
+ "iPod/iPhone ( 320x 240)",
+ "AVCHD",
+ "BluRay",
+ "HDV_1440",
+ "ZuneHD",
+ "FlipCam",
+ NULL
};
static char *sGPUOffloadLevel[] = {
- "CPU PEL processing",
- "Motion Estimation",
- "Full Encode",
- NULL
+ "CPU PEL processing",
+ "Motion Estimation",
+ "Full Encode",
+ NULL
};
static char *sPictureType[] = {
- "Frame Mode",
- "Field Mode (top first)",
- "Field Mode (bottom first)",
- "Field Mode (picaff) unsupported",
- NULL
+ "Frame Mode",
+ "Field Mode (top first)",
+ "Field Mode (bottom first)",
+ "Field Mode (picaff) unsupported",
+ NULL
};
static char *sPictureStructure[] = {
- "Unknown",
- "Top Field",
- "Bottom Field",
- "Frame Picture",
- NULL
+ "Unknown",
+ "Top Field",
+ "Bottom Field",
+ "Frame Picture",
+ NULL
};
// Rate Control Method (NVVE_RC_TYPE)
static char *sNVVE_RateCtrlType[] = {
- "Rate Control CQP",
+ "Rate Control CQP",
"Rate Control VBR",
- "Rate Control CBR with QP",
- "Rate Control VBR with Min QP",
- NULL
+ "Rate Control CBR with QP",
+ "Rate Control VBR with Min QP",
+ NULL
};
#ifdef __cplusplus
diff --git a/thirdparties/win32/include/curl/curl.h b/thirdparties/win32/include/curl/curl.h
index 973fdcc..0897d98 100755
--- a/thirdparties/win32/include/curl/curl.h
+++ b/thirdparties/win32/include/curl/curl.h
@@ -128,19 +128,19 @@ typedef int curl_socket_t;
#endif /* curl_socket_typedef */
struct curl_httppost {
- struct curl_httppost *next; /* next entry in the list */
- char *name; /* pointer to allocated name */
- long namelength; /* length of name length */
- char *contents; /* pointer to allocated data contents */
- long contentslength; /* length of contents field */
- char *buffer; /* pointer to allocated buffer contents */
- long bufferlength; /* length of buffer field */
- char *contenttype; /* Content-Type */
- struct curl_slist* contentheader; /* list of extra headers for this form */
- struct curl_httppost *more; /* if one field name has more than one
+ struct curl_httppost *next; /* next entry in the list */
+ char *name; /* pointer to allocated name */
+ long namelength; /* length of name length */
+ char *contents; /* pointer to allocated data contents */
+ long contentslength; /* length of contents field */
+ char *buffer; /* pointer to allocated buffer contents */
+ long bufferlength; /* length of buffer field */
+ char *contenttype; /* Content-Type */
+ struct curl_slist* contentheader; /* list of extra headers for this form */
+ struct curl_httppost *more; /* if one field name has more than one
file, this link should link to following
files */
- long flags; /* as defined below */
+ long flags; /* as defined below */
#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
@@ -154,10 +154,10 @@ struct curl_httppost {
and pass the given pointer as custom
pointer */
- char *showfilename; /* The file name to show. If not set, the
+ char *showfilename; /* The file name to show. If not set, the
actual file name will be used (if this
is a file part) */
- void *userp; /* custom pointer used for
+ void *userp; /* custom pointer used for
HTTPPOST_CALLBACK posts */
};
@@ -168,10 +168,10 @@ typedef int (*curl_progress_callback)(void *clientp,
double ulnow);
#ifndef CURL_MAX_WRITE_SIZE
- /* Tests have proven that 20K is a very bad buffer size for uploads on
- Windows, while 16K for some odd reason performed a lot better.
- We do the ifndef check to allow this value to easier be changed at build
- time for those who feel adventurous. */
+/* Tests have proven that 20K is a very bad buffer size for uploads on
+ Windows, while 16K for some odd reason performed a lot better.
+ We do the ifndef check to allow this value to easier be changed at build
+ time for those who feel adventurous. */
#define CURL_MAX_WRITE_SIZE 16384
#endif
/* This is a magic return code for the write callback that, when returned,
@@ -199,13 +199,13 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_READFUNC_PAUSE 0x10000001
typedef size_t (*curl_read_callback)(char *buffer,
- size_t size,
- size_t nitems,
- void *instream);
+ size_t size,
+ size_t nitems,
+ void *instream);
typedef enum {
- CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
- CURLSOCKTYPE_LAST /* never use */
+ CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
+ CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
typedef int (*curl_sockopt_callback)(void *clientp,
@@ -213,13 +213,13 @@ typedef int (*curl_sockopt_callback)(void *clientp,
curlsocktype purpose);
struct curl_sockaddr {
- int family;
- int socktype;
- int protocol;
- unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
+ int family;
+ int socktype;
+ int protocol;
+ unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
turned really ugly and painful on the systems that
lack this type */
- struct sockaddr addr;
+ struct sockaddr addr;
};
typedef curl_socket_t
@@ -228,7 +228,7 @@ typedef curl_socket_t
struct curl_sockaddr *address);
#ifndef CURL_NO_OLDIES
- /* not used since 7.10.8, will be removed in a future release */
+/* not used since 7.10.8, will be removed in a future release */
typedef int (*curl_passwd_callback)(void *clientp,
const char *prompt,
char *buffer,
@@ -236,21 +236,21 @@ typedef int (*curl_passwd_callback)(void *clientp,
#endif
typedef enum {
- CURLIOE_OK, /* I/O operation successful */
- CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
- CURLIOE_FAILRESTART, /* failed to restart the read */
- CURLIOE_LAST /* never use */
+ CURLIOE_OK, /* I/O operation successful */
+ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
+ CURLIOE_FAILRESTART, /* failed to restart the read */
+ CURLIOE_LAST /* never use */
} curlioerr;
typedef enum {
- CURLIOCMD_NOP, /* no operation */
- CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
- CURLIOCMD_LAST /* never use */
+ CURLIOCMD_NOP, /* no operation */
+ CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
+ CURLIOCMD_LAST /* never use */
} curliocmd;
typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
- int cmd,
- void *clientp);
+ int cmd,
+ void *clientp);
/*
* The following typedef's are signatures of malloc, free, realloc, strdup and
@@ -266,22 +266,22 @@ typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
/* the kind of data that is passed to information_callback*/
typedef enum {
- CURLINFO_TEXT = 0,
- CURLINFO_HEADER_IN, /* 1 */
- CURLINFO_HEADER_OUT, /* 2 */
- CURLINFO_DATA_IN, /* 3 */
- CURLINFO_DATA_OUT, /* 4 */
- CURLINFO_SSL_DATA_IN, /* 5 */
- CURLINFO_SSL_DATA_OUT, /* 6 */
- CURLINFO_END
+ CURLINFO_TEXT = 0,
+ CURLINFO_HEADER_IN, /* 1 */
+ CURLINFO_HEADER_OUT, /* 2 */
+ CURLINFO_DATA_IN, /* 3 */
+ CURLINFO_DATA_OUT, /* 4 */
+ CURLINFO_SSL_DATA_IN, /* 5 */
+ CURLINFO_SSL_DATA_OUT, /* 6 */
+ CURLINFO_END
} curl_infotype;
typedef int (*curl_debug_callback)
- (CURL *handle, /* the handle/transfer this concerns */
- curl_infotype type, /* what kind of data */
- char *data, /* points to the data */
- size_t size, /* size of the data pointed to */
- void *userptr); /* whatever the user please */
+(CURL *handle, /* the handle/transfer this concerns */
+ curl_infotype type, /* what kind of data */
+ char *data, /* points to the data */
+ size_t size, /* size of the data pointed to */
+ void *userptr); /* whatever the user please */
/* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
@@ -291,114 +291,114 @@ typedef int (*curl_debug_callback)
*/
typedef enum {
- CURLE_OK = 0,
- CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
- CURLE_FAILED_INIT, /* 2 */
- CURLE_URL_MALFORMAT, /* 3 */
- CURLE_OBSOLETE4, /* 4 - NOT USED */
- CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
- CURLE_COULDNT_RESOLVE_HOST, /* 6 */
- CURLE_COULDNT_CONNECT, /* 7 */
- CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
- CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
+ CURLE_OK = 0,
+ CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
+ CURLE_FAILED_INIT, /* 2 */
+ CURLE_URL_MALFORMAT, /* 3 */
+ CURLE_OBSOLETE4, /* 4 - NOT USED */
+ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
+ CURLE_COULDNT_RESOLVE_HOST, /* 6 */
+ CURLE_COULDNT_CONNECT, /* 7 */
+ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
+ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
- CURLE_OBSOLETE10, /* 10 - NOT USED */
- CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
- CURLE_OBSOLETE12, /* 12 - NOT USED */
- CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
- CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
- CURLE_FTP_CANT_GET_HOST, /* 15 */
- CURLE_OBSOLETE16, /* 16 - NOT USED */
- CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
- CURLE_PARTIAL_FILE, /* 18 */
- CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
- CURLE_OBSOLETE20, /* 20 - NOT USED */
- CURLE_QUOTE_ERROR, /* 21 - quote command failure */
- CURLE_HTTP_RETURNED_ERROR, /* 22 */
- CURLE_WRITE_ERROR, /* 23 */
- CURLE_OBSOLETE24, /* 24 - NOT USED */
- CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
- CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
- CURLE_OUT_OF_MEMORY, /* 27 */
- /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
- instead of a memory allocation error if CURL_DOES_CONVERSIONS
- is defined
- */
- CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
- CURLE_OBSOLETE29, /* 29 - NOT USED */
- CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
- CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
- CURLE_OBSOLETE32, /* 32 - NOT USED */
- CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
- CURLE_HTTP_POST_ERROR, /* 34 */
- CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
- CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
- CURLE_FILE_COULDNT_READ_FILE, /* 37 */
- CURLE_LDAP_CANNOT_BIND, /* 38 */
- CURLE_LDAP_SEARCH_FAILED, /* 39 */
- CURLE_OBSOLETE40, /* 40 - NOT USED */
- CURLE_FUNCTION_NOT_FOUND, /* 41 */
- CURLE_ABORTED_BY_CALLBACK, /* 42 */
- CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
- CURLE_OBSOLETE44, /* 44 - NOT USED */
- CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
- CURLE_OBSOLETE46, /* 46 - NOT USED */
- CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
- CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
- CURLE_OBSOLETE50, /* 50 - NOT USED */
- CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
+ CURLE_OBSOLETE10, /* 10 - NOT USED */
+ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
+ CURLE_OBSOLETE12, /* 12 - NOT USED */
+ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
+ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
+ CURLE_FTP_CANT_GET_HOST, /* 15 */
+ CURLE_OBSOLETE16, /* 16 - NOT USED */
+ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
+ CURLE_PARTIAL_FILE, /* 18 */
+ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
+ CURLE_OBSOLETE20, /* 20 - NOT USED */
+ CURLE_QUOTE_ERROR, /* 21 - quote command failure */
+ CURLE_HTTP_RETURNED_ERROR, /* 22 */
+ CURLE_WRITE_ERROR, /* 23 */
+ CURLE_OBSOLETE24, /* 24 - NOT USED */
+ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
+ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
+ CURLE_OUT_OF_MEMORY, /* 27 */
+ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
+ instead of a memory allocation error if CURL_DOES_CONVERSIONS
+ is defined
+ */
+ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
+ CURLE_OBSOLETE29, /* 29 - NOT USED */
+ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
+ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
+ CURLE_OBSOLETE32, /* 32 - NOT USED */
+ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
+ CURLE_HTTP_POST_ERROR, /* 34 */
+ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
+ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
+ CURLE_FILE_COULDNT_READ_FILE, /* 37 */
+ CURLE_LDAP_CANNOT_BIND, /* 38 */
+ CURLE_LDAP_SEARCH_FAILED, /* 39 */
+ CURLE_OBSOLETE40, /* 40 - NOT USED */
+ CURLE_FUNCTION_NOT_FOUND, /* 41 */
+ CURLE_ABORTED_BY_CALLBACK, /* 42 */
+ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
+ CURLE_OBSOLETE44, /* 44 - NOT USED */
+ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
+ CURLE_OBSOLETE46, /* 46 - NOT USED */
+ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
+ CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
+ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
+ CURLE_OBSOLETE50, /* 50 - NOT USED */
+ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
wasn't verified fine */
- CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
- CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
- CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
+ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
+ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
+ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
default */
- CURLE_SEND_ERROR, /* 55 - failed sending network data */
- CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
- CURLE_OBSOLETE57, /* 57 - NOT IN USE */
- CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
- CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
- CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
- CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
- CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
- CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
- CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
+ CURLE_SEND_ERROR, /* 55 - failed sending network data */
+ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
+ CURLE_OBSOLETE57, /* 57 - NOT IN USE */
+ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
+ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
+ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
+ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
+ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
+ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
+ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
+ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
that failed */
- CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
- CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
+ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
+ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
accepted and we failed to login */
- CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
- CURLE_TFTP_PERM, /* 69 - permission problem on server */
- CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
- CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
- CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
- CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
- CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
- CURLE_CONV_FAILED, /* 75 - conversion failed */
- CURLE_CONV_REQD, /* 76 - caller must register conversion
+ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
+ CURLE_TFTP_PERM, /* 69 - permission problem on server */
+ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
+ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
+ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
+ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
+ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
+ CURLE_CONV_FAILED, /* 75 - conversion failed */
+ CURLE_CONV_REQD, /* 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION */
- CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
+ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
- CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
- CURLE_SSH, /* 79 - error from the SSH layer, somewhat
+ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
+ CURLE_SSH, /* 79 - error from the SSH layer, somewhat
generic so the error message will be of
interest when this has happened */
- CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
+ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
connection */
- CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
+ CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
wait till it's ready and try again (Added
in 7.18.2) */
- CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
+ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
wrong format (Added in 7.19.0) */
- CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
+ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
7.19.0) */
- CURL_LAST /* never use! */
+ CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -456,20 +456,20 @@ typedef enum {
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
- void *ssl_ctx, /* actually an
+ void *ssl_ctx, /* actually an
OpenSSL SSL_CTX */
- void *userptr);
+ void *userptr);
typedef enum {
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
+ CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
+ CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
+ CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
+ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
+ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
+ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
host name rather than the IP address. added
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
@@ -494,51 +494,51 @@ typedef enum {
#define CURL_ERROR_SIZE 256
struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
+ const char *key; /* points to a zero-terminated string encoded with base64
if len is zero, otherwise to the "raw" data */
- size_t len;
- enum type {
- CURLKHTYPE_UNKNOWN,
- CURLKHTYPE_RSA1,
- CURLKHTYPE_RSA,
- CURLKHTYPE_DSS
- } keytype;
+ size_t len;
+ enum type {
+ CURLKHTYPE_UNKNOWN,
+ CURLKHTYPE_RSA1,
+ CURLKHTYPE_RSA,
+ CURLKHTYPE_DSS
+ } keytype;
};
/* this is the set of return values expected from the curl_sshkeycallback
callback */
enum curl_khstat {
- CURLKHSTAT_FINE_ADD_TO_FILE,
- CURLKHSTAT_FINE,
- CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
+ CURLKHSTAT_FINE_ADD_TO_FILE,
+ CURLKHSTAT_FINE,
+ CURLKHSTAT_REJECT, /* reject the connection, return an error */
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
this causes a CURLE_DEFER error but otherwise the
connection will be left intact etc */
- CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
+ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
};
/* this is the set of status codes pass in to the callback */
enum curl_khmatch {
- CURLKHMATCH_OK, /* match */
- CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
- CURLKHMATCH_MISSING, /* no matching host/key found */
- CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
+ CURLKHMATCH_OK, /* match */
+ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
+ CURLKHMATCH_MISSING, /* no matching host/key found */
+ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
};
typedef int
- (*curl_sshkeycallback) (CURL *easy, /* easy handle */
- const struct curl_khkey *knownkey, /* known */
- const struct curl_khkey *foundkey, /* found */
- enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
+(*curl_sshkeycallback) (CURL *easy, /* easy handle */
+ const struct curl_khkey *knownkey, /* known */
+ const struct curl_khkey *foundkey, /* found */
+ enum curl_khmatch, /* libcurl's view on the keys */
+ void *clientp); /* custom pointer passed from app */
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
- CURLUSESSL_NONE, /* do not attempt to use SSL */
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
- CURLUSESSL_ALL, /* SSL for all communication or fail */
- CURLUSESSL_LAST /* not an option, never use */
+ CURLUSESSL_NONE, /* do not attempt to use SSL */
+ CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
+ CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
+ CURLUSESSL_ALL, /* SSL for all communication or fail */
+ CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -557,38 +557,38 @@ typedef enum {
/* parameter for the CURLOPT_FTP_SSL_CCC option */
typedef enum {
- CURLFTPSSL_CCC_NONE, /* do not send CCC */
- CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
- CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
- CURLFTPSSL_CCC_LAST /* not an option, never use */
+ CURLFTPSSL_CCC_NONE, /* do not send CCC */
+ CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
+ CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
+ CURLFTPSSL_CCC_LAST /* not an option, never use */
} curl_ftpccc;
/* parameter for the CURLOPT_FTPSSLAUTH option */
typedef enum {
- CURLFTPAUTH_DEFAULT, /* let libcurl decide */
- CURLFTPAUTH_SSL, /* use "AUTH SSL" */
- CURLFTPAUTH_TLS, /* use "AUTH TLS" */
- CURLFTPAUTH_LAST /* not an option, never use */
+ CURLFTPAUTH_DEFAULT, /* let libcurl decide */
+ CURLFTPAUTH_SSL, /* use "AUTH SSL" */
+ CURLFTPAUTH_TLS, /* use "AUTH TLS" */
+ CURLFTPAUTH_LAST /* not an option, never use */
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
typedef enum {
- CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
- CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
+ CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic */
- CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! */
- CURLFTP_CREATE_DIR_LAST /* not an option, never use */
+ CURLFTP_CREATE_DIR_LAST /* not an option, never use */
} curl_ftpcreatedir;
/* parameter for the CURLOPT_FTP_FILEMETHOD option */
typedef enum {
- CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
- CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
- CURLFTPMETHOD_NOCWD, /* no CWD at all */
- CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
- CURLFTPMETHOD_LAST /* not an option, never use */
+ CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
+ CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
+ CURLFTPMETHOD_NOCWD, /* no CWD at all */
+ CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
+ CURLFTPMETHOD_LAST /* not an option, never use */
} curl_ftpmethod;
/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
@@ -638,632 +638,632 @@ typedef enum {
*/
typedef enum {
- /* This is the FILE * or void * the regular output should be written to. */
- CINIT(FILE, OBJECTPOINT, 1),
+ /* This is the FILE * or void * the regular output should be written to. */
+ CINIT(FILE, OBJECTPOINT, 1),
+
+ /* The full URL to get/put */
+ CINIT(URL, OBJECTPOINT, 2),
+
+ /* Port number to connect to, if other than default. */
+ CINIT(PORT, LONG, 3),
- /* The full URL to get/put */
- CINIT(URL, OBJECTPOINT, 2),
+ /* Name of proxy to use. */
+ CINIT(PROXY, OBJECTPOINT, 4),
- /* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
+ /* "name:password" to use when fetching. */
+ CINIT(USERPWD, OBJECTPOINT, 5),
- /* Name of proxy to use. */
- CINIT(PROXY, OBJECTPOINT, 4),
+ /* "name:password" to use with proxy. */
+ CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
- /* "name:password" to use when fetching. */
- CINIT(USERPWD, OBJECTPOINT, 5),
+ /* Range to get, specified as an ASCII string. */
+ CINIT(RANGE, OBJECTPOINT, 7),
- /* "name:password" to use with proxy. */
- CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
+ /* not used */
- /* Range to get, specified as an ASCII string. */
- CINIT(RANGE, OBJECTPOINT, 7),
+ /* Specified file stream to upload from (use as input): */
+ CINIT(INFILE, OBJECTPOINT, 9),
- /* not used */
+ /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
+ * bytes big. If this is not used, error messages go to stderr instead: */
+ CINIT(ERRORBUFFER, OBJECTPOINT, 10),
- /* Specified file stream to upload from (use as input): */
- CINIT(INFILE, OBJECTPOINT, 9),
+ /* Function that will be called to store the output (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
- /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
- * bytes big. If this is not used, error messages go to stderr instead: */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
+ /* Function that will be called to read the input (instead of fread). The
+ * parameters will use fread() syntax, make sure to follow them. */
+ CINIT(READFUNCTION, FUNCTIONPOINT, 12),
- /* Function that will be called to store the output (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
+ /* Time-out the read operation after this amount of seconds */
+ CINIT(TIMEOUT, LONG, 13),
- /* Function that will be called to read the input (instead of fread). The
- * parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
+ /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
+ * how large the file being sent really is. That allows better error
+ * checking and better verifies that the upload was successful. -1 means
+ * unknown size.
+ *
+ * For large file support, there is also a _LARGE version of the key
+ * which takes an off_t type, allowing platforms with larger off_t
+ * sizes to handle larger files. See below for INFILESIZE_LARGE.
+ */
+ CINIT(INFILESIZE, LONG, 14),
- /* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
+ /* POST static input fields. */
+ CINIT(POSTFIELDS, OBJECTPOINT, 15),
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
- * how large the file being sent really is. That allows better error
- * checking and better verifies that the upload was successful. -1 means
- * unknown size.
- *
- * For large file support, there is also a _LARGE version of the key
- * which takes an off_t type, allowing platforms with larger off_t
- * sizes to handle larger files. See below for INFILESIZE_LARGE.
- */
- CINIT(INFILESIZE, LONG, 14),
+ /* Set the referrer page (needed by some CGIs) */
+ CINIT(REFERER, OBJECTPOINT, 16),
- /* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
+ /* Set the FTP PORT string (interface name, named or numerical IP address)
+ Use i.e '-' to use default address. */
+ CINIT(FTPPORT, OBJECTPOINT, 17),
- /* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, OBJECTPOINT, 16),
+ /* Set the User-Agent string (examined by some CGIs) */
+ CINIT(USERAGENT, OBJECTPOINT, 18),
- /* Set the FTP PORT string (interface name, named or numerical IP address)
- Use i.e '-' to use default address. */
- CINIT(FTPPORT, OBJECTPOINT, 17),
+ /* If the download receives less than "low speed limit" bytes/second
+ * during "low speed time" seconds, the operations is aborted.
+ * You could i.e if you have a pretty high speed connection, abort if
+ * it is less than 2000 bytes/sec during 20 seconds.
+ */
- /* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, OBJECTPOINT, 18),
+ /* Set the "low speed limit" */
+ CINIT(LOW_SPEED_LIMIT, LONG, 19),
- /* If the download receives less than "low speed limit" bytes/second
- * during "low speed time" seconds, the operations is aborted.
- * You could i.e if you have a pretty high speed connection, abort if
- * it is less than 2000 bytes/sec during 20 seconds.
- */
+ /* Set the "low speed time" */
+ CINIT(LOW_SPEED_TIME, LONG, 20),
- /* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
+ /* Set the continuation offset.
+ *
+ * Note there is also a _LARGE version of this key which uses
+ * off_t types, allowing for large file offsets on platforms which
+ * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
+ */
+ CINIT(RESUME_FROM, LONG, 21),
- /* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
+ /* Set cookie in request: */
+ CINIT(COOKIE, OBJECTPOINT, 22),
- /* Set the continuation offset.
- *
- * Note there is also a _LARGE version of this key which uses
- * off_t types, allowing for large file offsets on platforms which
- * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
- */
- CINIT(RESUME_FROM, LONG, 21),
+ /* This points to a linked list of headers, struct curl_slist kind */
+ CINIT(HTTPHEADER, OBJECTPOINT, 23),
- /* Set cookie in request: */
- CINIT(COOKIE, OBJECTPOINT, 22),
+ /* This points to a linked list of post entries, struct curl_httppost */
+ CINIT(HTTPPOST, OBJECTPOINT, 24),
- /* This points to a linked list of headers, struct curl_slist kind */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
+ /* name of the file keeping your private SSL-certificate */
+ CINIT(SSLCERT, OBJECTPOINT, 25),
- /* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
+ /* password for the SSL or SSH private key */
+ CINIT(KEYPASSWD, OBJECTPOINT, 26),
- /* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, OBJECTPOINT, 25),
+ /* send TYPE parameter? */
+ CINIT(CRLF, LONG, 27),
- /* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, OBJECTPOINT, 26),
+ /* send linked-list of QUOTE commands */
+ CINIT(QUOTE, OBJECTPOINT, 28),
- /* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
+ /* send FILE * or void * to store headers to, if you use a callback it
+ is simply passed to the callback unmodified */
+ CINIT(WRITEHEADER, OBJECTPOINT, 29),
- /* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
+ /* point to a file to read the initial cookies from, also enables
+ "cookie awareness" */
+ CINIT(COOKIEFILE, OBJECTPOINT, 31),
- /* send FILE * or void * to store headers to, if you use a callback it
- is simply passed to the callback unmodified */
- CINIT(WRITEHEADER, OBJECTPOINT, 29),
+ /* What version to specifically try to use.
+ See CURL_SSLVERSION defines below. */
+ CINIT(SSLVERSION, LONG, 32),
- /* point to a file to read the initial cookies from, also enables
- "cookie awareness" */
- CINIT(COOKIEFILE, OBJECTPOINT, 31),
+ /* What kind of HTTP time condition to use, see defines */
+ CINIT(TIMECONDITION, LONG, 33),
- /* What version to specifically try to use.
- See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
+ /* Time to use with the above condition. Specified in number of seconds
+ since 1 Jan 1970 */
+ CINIT(TIMEVALUE, LONG, 34),
- /* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
+ /* 35 = OBSOLETE */
- /* Time to use with the above condition. Specified in number of seconds
- since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
+ /* Custom request, for customizing the get command like
+ HTTP: DELETE, TRACE and others
+ FTP: to use a different list command
+ */
+ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
- /* 35 = OBSOLETE */
+ /* HTTP request, for odd commands like DELETE, TRACE and others */
+ CINIT(STDERR, OBJECTPOINT, 37),
- /* Custom request, for customizing the get command like
- HTTP: DELETE, TRACE and others
- FTP: to use a different list command
- */
- CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
+ /* 38 is not used */
+
+ /* send linked-list of post-transfer QUOTE commands */
+ CINIT(POSTQUOTE, OBJECTPOINT, 39),
+
+ /* Pass a pointer to string of the output using full variable-replacement
+ as described elsewhere. */
+ CINIT(WRITEINFO, OBJECTPOINT, 40),
+
+ CINIT(VERBOSE, LONG, 41), /* talk a lot */
+ CINIT(HEADER, LONG, 42), /* throw the header out too */
+ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
+ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
+ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
+ CINIT(UPLOAD, LONG, 46), /* this is an upload */
+ CINIT(POST, LONG, 47), /* HTTP POST method */
+ CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+
+ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+
+ /* Specify whether to read the user+password from the .netrc or the URL.
+ * This must be one of the CURL_NETRC_* enums below. */
+ CINIT(NETRC, LONG, 51),
+
+ CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+
+ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
+ CINIT(PUT, LONG, 54), /* HTTP PUT */
+
+ /* 55 = OBSOLETE */
- /* HTTP request, for odd commands like DELETE, TRACE and others */
- CINIT(STDERR, OBJECTPOINT, 37),
+ /* Function that will be called instead of the internal progress display
+ * function. This function should be defined as the curl_progress_callback
+ * prototype defines. */
+ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
- /* 38 is not used */
+ /* Data passed to the progress callback */
+ CINIT(PROGRESSDATA, OBJECTPOINT, 57),
- /* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
+ /* We want the referrer field set automatically when following locations */
+ CINIT(AUTOREFERER, LONG, 58),
- /* Pass a pointer to string of the output using full variable-replacement
- as described elsewhere. */
- CINIT(WRITEINFO, OBJECTPOINT, 40),
+ /* Port of the proxy, can be set in the proxy string as well with:
+ "[host]:[port]" */
+ CINIT(PROXYPORT, LONG, 59),
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+ /* size of the POST input data, if strlen() is not good to use */
+ CINIT(POSTFIELDSIZE, LONG, 60),
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+ /* tunnel non-http operations through a HTTP proxy */
+ CINIT(HTTPPROXYTUNNEL, LONG, 61),
- /* Specify whether to read the user+password from the .netrc or the URL.
- * This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
+ /* Set the interface string to use as outgoing network interface */
+ CINIT(INTERFACE, OBJECTPOINT, 62),
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+ /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
+ * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
+ * is set but doesn't match one of these, 'private' will be used. */
+ CINIT(KRBLEVEL, OBJECTPOINT, 63),
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
+ /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
+ CINIT(SSL_VERIFYPEER, LONG, 64),
- /* 55 = OBSOLETE */
+ /* The CApath or CAfile used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAINFO, OBJECTPOINT, 65),
- /* Function that will be called instead of the internal progress display
- * function. This function should be defined as the curl_progress_callback
- * prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
+ /* 66 = OBSOLETE */
+ /* 67 = OBSOLETE */
- /* Data passed to the progress callback */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
+ /* Maximum number of http redirects to follow */
+ CINIT(MAXREDIRS, LONG, 68),
- /* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
+ /* Pass a long set to 1 to get the date of the requested document (if
+ possible)! Pass a zero to shut it off. */
+ CINIT(FILETIME, LONG, 69),
- /* Port of the proxy, can be set in the proxy string as well with:
- "[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
+ /* This points to a linked list of telnet options */
+ CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
- /* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
+ /* Max amount of cached alive connections */
+ CINIT(MAXCONNECTS, LONG, 71),
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
+ /* What policy to use when closing connections when the cache is filled
+ up */
+ CINIT(CLOSEPOLICY, LONG, 72),
- /* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, OBJECTPOINT, 62),
+ /* 73 = OBSOLETE */
- /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
- * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
- * is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, OBJECTPOINT, 63),
+ /* Set to explicitly use a new connection for the upcoming transfer.
+ Do not use this unless you're absolutely sure of this, as it makes the
+ operation slower and is less friendly for the network. */
+ CINIT(FRESH_CONNECT, LONG, 74),
- /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
+ /* Set to explicitly forbid the upcoming transfer's connection to be re-used
+ when done. Do not use this unless you're absolutely sure of this, as it
+ makes the operation slower and is less friendly for the network. */
+ CINIT(FORBID_REUSE, LONG, 75),
- /* The CApath or CAfile used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, OBJECTPOINT, 65),
+ /* Set to a file name that contains random data for libcurl to use to
+ seed the random engine when doing SSL connects. */
+ CINIT(RANDOM_FILE, OBJECTPOINT, 76),
- /* 66 = OBSOLETE */
- /* 67 = OBSOLETE */
+ /* Set to the Entropy Gathering Daemon socket pathname */
+ CINIT(EGDSOCKET, OBJECTPOINT, 77),
- /* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
+ /* Time-out connect operations after this amount of seconds, if connects
+ are OK within this time, then fine... This only aborts the connect
+ phase. [Only works on unix-style/SIGALRM operating systems] */
+ CINIT(CONNECTTIMEOUT, LONG, 78),
- /* Pass a long set to 1 to get the date of the requested document (if
- possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
+ /* Function that will be called to store headers (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
- /* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
+ /* Set this to force the HTTP request to get back to GET. Only really usable
+ if POST, PUT or a custom request have been used first.
+ */
+ CINIT(HTTPGET, LONG, 80),
+
+ /* Set if we should verify the Common name from the peer certificate in ssl
+ * handshake, set 1 to check existence, 2 to ensure that it matches the
+ * provided hostname. */
+ CINIT(SSL_VERIFYHOST, LONG, 81),
+
+ /* Specify which file name to write all known cookies in after completed
+ operation. Set file name to "-" (dash) to make it go to stdout. */
+ CINIT(COOKIEJAR, OBJECTPOINT, 82),
+
+ /* Specify which SSL ciphers to use */
+ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+
+ /* Specify which HTTP version to use! This must be set to one of the
+ CURL_HTTP_VERSION* enums set below. */
+ CINIT(HTTP_VERSION, LONG, 84),
+
+ /* Specifically switch on or off the FTP engine's use of the EPSV command. By
+ default, that one will always be attempted before the more traditional
+ PASV command. */
+ CINIT(FTP_USE_EPSV, LONG, 85),
+
+ /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
+ CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+
+ /* name of the file keeping your private SSL-key */
+ CINIT(SSLKEY, OBJECTPOINT, 87),
- /* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
+ /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
+ CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
- /* What policy to use when closing connections when the cache is filled
- up */
- CINIT(CLOSEPOLICY, LONG, 72),
+ /* crypto engine for the SSL-sub system */
+ CINIT(SSLENGINE, OBJECTPOINT, 89),
- /* 73 = OBSOLETE */
+ /* set the crypto engine for the SSL-sub system as default
+ the param has no meaning...
+ */
+ CINIT(SSLENGINE_DEFAULT, LONG, 90),
+
+ /* Non-zero value means to use the global dns cache */
+ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+
+ /* DNS cache timeout */
+ CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+
+ /* send linked-list of pre-transfer QUOTE commands */
+ CINIT(PREQUOTE, OBJECTPOINT, 93),
- /* Set to explicitly use a new connection for the upcoming transfer.
- Do not use this unless you're absolutely sure of this, as it makes the
- operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
+ /* set the debug function */
+ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
- when done. Do not use this unless you're absolutely sure of this, as it
- makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
+ /* set the data for the debug function */
+ CINIT(DEBUGDATA, OBJECTPOINT, 95),
- /* Set to a file name that contains random data for libcurl to use to
- seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, OBJECTPOINT, 76),
+ /* mark this as start of a cookie session */
+ CINIT(COOKIESESSION, LONG, 96),
- /* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, OBJECTPOINT, 77),
+ /* The CApath directory used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAPATH, OBJECTPOINT, 97),
- /* Time-out connect operations after this amount of seconds, if connects
- are OK within this time, then fine... This only aborts the connect
- phase. [Only works on unix-style/SIGALRM operating systems] */
- CINIT(CONNECTTIMEOUT, LONG, 78),
+ /* Instruct libcurl to use a smaller receive buffer */
+ CINIT(BUFFERSIZE, LONG, 98),
- /* Function that will be called to store headers (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
+ /* Instruct libcurl to not use any signal/alarm handlers, even when using
+ timeouts. This option is useful for multi-threaded applications.
+ See libcurl-the-guide for more background information. */
+ CINIT(NOSIGNAL, LONG, 99),
- /* Set this to force the HTTP request to get back to GET. Only really usable
- if POST, PUT or a custom request have been used first.
- */
- CINIT(HTTPGET, LONG, 80),
+ /* Provide a CURLShare for mutexing non-ts data */
+ CINIT(SHARE, OBJECTPOINT, 100),
- /* Set if we should verify the Common name from the peer certificate in ssl
- * handshake, set 1 to check existence, 2 to ensure that it matches the
- * provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
+ /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
+ CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
+ CINIT(PROXYTYPE, LONG, 101),
- /* Specify which file name to write all known cookies in after completed
- operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, OBJECTPOINT, 82),
+ /* Set the Accept-Encoding string. Use this to tell a server you would like
+ the response to be compressed. */
+ CINIT(ENCODING, OBJECTPOINT, 102),
- /* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+ /* Set pointer to private data */
+ CINIT(PRIVATE, OBJECTPOINT, 103),
- /* Specify which HTTP version to use! This must be set to one of the
- CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
+ /* Set aliases for HTTP 200 in the HTTP Response header */
+ CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
- /* Specifically switch on or off the FTP engine's use of the EPSV command. By
- default, that one will always be attempted before the more traditional
- PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
+ /* Continue to send authentication (user+password) when following locations,
+ even when hostname changed. This can potentially send off the name
+ and password to whatever host the server decides. */
+ CINIT(UNRESTRICTED_AUTH, LONG, 105),
- /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+ /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
+ also disables the LPRT attempt). By default, those ones will always be
+ attempted before the good old traditional PORT command. */
+ CINIT(FTP_USE_EPRT, LONG, 106),
- /* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, OBJECTPOINT, 87),
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_USERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(HTTPAUTH, LONG, 107),
- /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
+ /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
+ in second argument. The function must be matching the
+ curl_ssl_ctx_callback proto. */
+ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
- /* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, OBJECTPOINT, 89),
+ /* Set the userdata for the ssl context callback function's third
+ argument */
+ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
- /* set the crypto engine for the SSL-sub system as default
- the param has no meaning...
- */
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
+ /* FTP Option that causes missing dirs to be created on the remote server.
+ In 7.19.4 we introduced the convenience enums for this option using the
+ CURLFTP_CREATE_DIR prefix.
+ */
+ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
- /* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(PROXYAUTH, LONG, 111),
- /* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+ /* FTP option that changes the timeout, in seconds, associated with
+ getting a response. This is different from transfer timeout time and
+ essentially places a demand on the FTP server to acknowledge commands
+ in a timely manner. */
+ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
- /* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
+ /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
+ tell libcurl to resolve names to those IP versions only. This only has
+ affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
+ CINIT(IPRESOLVE, LONG, 113),
- /* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
+ /* Set this option to limit the size of a file that will be downloaded from
+ an HTTP or FTP server.
- /* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
+ Note there is also _LARGE version which adds large file support for
+ platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
+ CINIT(MAXFILESIZE, LONG, 114),
- /* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
+ /* See the comment for INFILESIZE above, but in short, specifies
+ * the size of the file being uploaded. -1 means unknown.
+ */
+ CINIT(INFILESIZE_LARGE, OFF_T, 115),
- /* The CApath directory used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, OBJECTPOINT, 97),
+ /* Sets the continuation offset. There is also a LONG version of this;
+ * look above for RESUME_FROM.
+ */
+ CINIT(RESUME_FROM_LARGE, OFF_T, 116),
- /* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
-
- /* Instruct libcurl to not use any signal/alarm handlers, even when using
- timeouts. This option is useful for multi-threaded applications.
- See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
-
- /* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
-
- /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
- CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
-
- /* Set the Accept-Encoding string. Use this to tell a server you would like
- the response to be compressed. */
- CINIT(ENCODING, OBJECTPOINT, 102),
-
- /* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
-
- /* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
-
- /* Continue to send authentication (user+password) when following locations,
- even when hostname changed. This can potentially send off the name
- and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
-
- /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
- also disables the LPRT attempt). By default, those ones will always be
- attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_USERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
-
- /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
- in second argument. The function must be matching the
- curl_ssl_ctx_callback proto. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
-
- /* Set the userdata for the ssl context callback function's third
- argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
-
- /* FTP Option that causes missing dirs to be created on the remote server.
- In 7.19.4 we introduced the convenience enums for this option using the
- CURLFTP_CREATE_DIR prefix.
- */
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
-
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-
- /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
-
- /* Set this option to limit the size of a file that will be downloaded from
- an HTTP or FTP server.
-
- Note there is also _LARGE version which adds large file support for
- platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
-
- /* See the comment for INFILESIZE above, but in short, specifies
- * the size of the file being uploaded. -1 means unknown.
- */
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
-
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
- */
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
-
- /* Sets the maximum size of data that will be downloaded from
- * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
- */
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
-
- /* Set this option to the file name of your .netrc file you want libcurl
- to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
- a poor attempt to find the user's home directory and check for a .netrc
- file in there. */
- CINIT(NETRC_FILE, OBJECTPOINT, 118),
-
- /* Enable SSL/TLS for FTP, pick one of:
- CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
- CURLFTPSSL_CONTROL - SSL for the control connection or fail
- CURLFTPSSL_ALL - SSL for all communication or fail
- */
- CINIT(USE_SSL, LONG, 119),
-
- /* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
-
- /* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
-
- /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 123 OBSOLETE. Gone in 7.16.0 */
- /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 127 OBSOLETE. Gone in 7.16.0 */
- /* 128 OBSOLETE. Gone in 7.16.0 */
-
- /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
- can be used to change libcurl's default action which is to first try
- "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
- response has been received.
-
- Available parameters are:
- CURLFTPAUTH_DEFAULT - let libcurl decide
- CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
- CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
- */
- CINIT(FTPSSLAUTH, LONG, 129),
-
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
-
- /* 132 OBSOLETE. Gone in 7.16.0 */
- /* 133 OBSOLETE. Gone in 7.16.0 */
-
- /* zero terminated string for pass on to the FTP server when asked for
- "account" info */
- CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
-
- /* feed cookies into cookie engine */
- CINIT(COOKIELIST, OBJECTPOINT, 135),
-
- /* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
-
- /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
- response. Typically used for FTP-SSL purposes but is not restricted to
- that. libcurl will then instead use the same IP address it used for the
- control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
-
- /* Select "file method" to use when doing FTP, see the curl_ftpmethod
- above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
-
- /* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
-
- /* Number of ports to try, including the first one set with LOCALPORT.
- Thus, setting it to 1 will make no additional attempts but the first.
- */
- CINIT(LOCALPORTRANGE, LONG, 140),
-
- /* no transfer, set up connection and let application use the socket by
- extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
-
- /* Function that will be called to convert from the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
-
- /* Function that will be called to convert to the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
-
- /* Function that will be called to convert from UTF8
- (instead of using the iconv calls in libcurl)
- Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
-
- /* if the connection proceeds too quickly then need to slow it down */
- /* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
-
- /* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
-
- /* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
-
- /* set to 0 to disable session ID re-use for this transfer, default is
- enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
+ /* Sets the maximum size of data that will be downloaded from
+ * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
+ */
+ CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
+
+ /* Set this option to the file name of your .netrc file you want libcurl
+ to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
+ a poor attempt to find the user's home directory and check for a .netrc
+ file in there. */
+ CINIT(NETRC_FILE, OBJECTPOINT, 118),
+
+ /* Enable SSL/TLS for FTP, pick one of:
+ CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
+ CURLFTPSSL_CONTROL - SSL for the control connection or fail
+ CURLFTPSSL_ALL - SSL for all communication or fail
+ */
+ CINIT(USE_SSL, LONG, 119),
+
+ /* The _LARGE version of the standard POSTFIELDSIZE option */
+ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+
+ /* Enable/disable the TCP Nagle algorithm */
+ CINIT(TCP_NODELAY, LONG, 121),
+
+ /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 123 OBSOLETE. Gone in 7.16.0 */
+ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 127 OBSOLETE. Gone in 7.16.0 */
+ /* 128 OBSOLETE. Gone in 7.16.0 */
+
+ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
+ can be used to change libcurl's default action which is to first try
+ "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
+ response has been received.
+
+ Available parameters are:
+ CURLFTPAUTH_DEFAULT - let libcurl decide
+ CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
+ CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
+ */
+ CINIT(FTPSSLAUTH, LONG, 129),
+
+ CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
+ CINIT(IOCTLDATA, OBJECTPOINT, 131),
+
+ /* 132 OBSOLETE. Gone in 7.16.0 */
+ /* 133 OBSOLETE. Gone in 7.16.0 */
+
+ /* zero terminated string for pass on to the FTP server when asked for
+ "account" info */
+ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
+
+ /* feed cookies into cookie engine */
+ CINIT(COOKIELIST, OBJECTPOINT, 135),
+
+ /* ignore Content-Length */
+ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
+
+ /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
+ response. Typically used for FTP-SSL purposes but is not restricted to
+ that. libcurl will then instead use the same IP address it used for the
+ control connection. */
+ CINIT(FTP_SKIP_PASV_IP, LONG, 137),
+
+ /* Select "file method" to use when doing FTP, see the curl_ftpmethod
+ above. */
+ CINIT(FTP_FILEMETHOD, LONG, 138),
+
+ /* Local port number to bind the socket to */
+ CINIT(LOCALPORT, LONG, 139),
+
+ /* Number of ports to try, including the first one set with LOCALPORT.
+ Thus, setting it to 1 will make no additional attempts but the first.
+ */
+ CINIT(LOCALPORTRANGE, LONG, 140),
+
+ /* no transfer, set up connection and let application use the socket by
+ extracting it with CURLINFO_LASTSOCKET */
+ CINIT(CONNECT_ONLY, LONG, 141),
+
+ /* Function that will be called to convert from the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
+
+ /* Function that will be called to convert to the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
+
+ /* Function that will be called to convert from UTF8
+ (instead of using the iconv calls in libcurl)
+ Note that this is used only for SSL certificate processing */
+ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
+
+ /* if the connection proceeds too quickly then need to slow it down */
+ /* limit-rate: maximum number of bytes per second to send or receive */
+ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
+ CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+
+ /* Pointer to command string to send if USER/PASS fails. */
+ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
+
+ /* callback function for setting socket options */
+ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
+ CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
+
+ /* set to 0 to disable session ID re-use for this transfer, default is
+ enabled (== 1) */
+ CINIT(SSL_SESSIONID_CACHE, LONG, 150),
- /* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
-
- /* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
+ /* allowed SSH authentication methods */
+ CINIT(SSH_AUTH_TYPES, LONG, 151),
+
+ /* Used by scp/sftp to do public/private key authentication */
+ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
+ CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
- /* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
+ /* Send CCC (Clear Command Channel) after authentication */
+ CINIT(FTP_SSL_CCC, LONG, 154),
- /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
-
- /* set to zero to disable the libcurl's decoding and thus pass the raw body
- data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
+ /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
+ CINIT(TIMEOUT_MS, LONG, 155),
+ CINIT(CONNECTTIMEOUT_MS, LONG, 156),
+
+ /* set to zero to disable the libcurl's decoding and thus pass the raw body
+ data to the application even when it is encoded/compressed */
+ CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
+ CINIT(HTTP_CONTENT_DECODING, LONG, 158),
- /* Permission used when creating new files and directories on the remote
- server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
+ /* Permission used when creating new files and directories on the remote
+ server for protocols that support it, SFTP/SCP/FILE */
+ CINIT(NEW_FILE_PERMS, LONG, 159),
+ CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
- /* Set the behaviour of POST when redirecting. Values must be set to one
- of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
+ /* Set the behaviour of POST when redirecting. Values must be set to one
+ of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
+ CINIT(POSTREDIR, LONG, 161),
- /* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
+ /* used by scp/sftp to verify the host's public key */
+ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
- /* Callback function for opening socket (instead of socket(2)). Optionally,
- callback is able change the address or refuse to connect returning
- CURL_SOCKET_BAD. The callback should have type
- curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
+ /* Callback function for opening socket (instead of socket(2)). Optionally,
+ callback is able change the address or refuse to connect returning
+ CURL_SOCKET_BAD. The callback should have type
+ curl_opensocket_callback */
+ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
+ CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
- /* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
+ /* POST volatile input fields. */
+ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
- /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
+ /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
+ CINIT(PROXY_TRANSFER_MODE, LONG, 166),
- /* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
+ /* Callback function for seeking in the input stream */
+ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
+ CINIT(SEEKDATA, OBJECTPOINT, 168),
- /* CRL file */
- CINIT(CRLFILE, OBJECTPOINT, 169),
+ /* CRL file */
+ CINIT(CRLFILE, OBJECTPOINT, 169),
- /* Issuer certificate */
- CINIT(ISSUERCERT, OBJECTPOINT, 170),
+ /* Issuer certificate */
+ CINIT(ISSUERCERT, OBJECTPOINT, 170),
- /* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
+ /* (IPv6) Address scope */
+ CINIT(ADDRESS_SCOPE, LONG, 171),
- /* Collect certificate chain info and allow it to get retrievable with
- CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
- working with OpenSSL-powered builds. */
- CINIT(CERTINFO, LONG, 172),
+ /* Collect certificate chain info and allow it to get retrievable with
+ CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
+ working with OpenSSL-powered builds. */
+ CINIT(CERTINFO, LONG, 172),
- /* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, OBJECTPOINT, 173),
- CINIT(PASSWORD, OBJECTPOINT, 174),
+ /* "name" and "pwd" to use when fetching. */
+ CINIT(USERNAME, OBJECTPOINT, 173),
+ CINIT(PASSWORD, OBJECTPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
- CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
-
- /* Comma separated list of hostnames defining no-proxy zones. These should
- match both hostnames directly, and hostnames within a domain. For
- example, local.com will match local.com and www.local.com, but NOT
- notlocal.com or www.notlocal.com. For compatibility with other
- implementations of this, .local.com will be considered to be the same as
- local.com. A single * is the only valid wildcard, and effectively
- disables the use of proxy. */
- CINIT(NOPROXY, OBJECTPOINT, 177),
-
- /* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
-
- /* set the bitmask for the protocols that are allowed to be used for the
- transfer, which thus helps the app which takes URLs from users or other
- external inputs and want to restrict what protocol(s) to deal
- with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
-
- /* set the bitmask for the protocols that libcurl is allowed to follow to,
- as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
-
- /* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
-
- /* set the SSH host key callback, must point to a curl_sshkeycallback
- function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
-
- /* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
-
- CURLOPT_LASTENTRY /* the last unused */
+ CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
+ CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
+
+ /* Comma separated list of hostnames defining no-proxy zones. These should
+ match both hostnames directly, and hostnames within a domain. For
+ example, local.com will match local.com and www.local.com, but NOT
+ notlocal.com or www.notlocal.com. For compatibility with other
+ implementations of this, .local.com will be considered to be the same as
+ local.com. A single * is the only valid wildcard, and effectively
+ disables the use of proxy. */
+ CINIT(NOPROXY, OBJECTPOINT, 177),
+
+ /* block size for TFTP transfers */
+ CINIT(TFTP_BLKSIZE, LONG, 178),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
+
+ /* set the bitmask for the protocols that are allowed to be used for the
+ transfer, which thus helps the app which takes URLs from users or other
+ external inputs and want to restrict what protocol(s) to deal
+ with. Defaults to CURLPROTO_ALL. */
+ CINIT(PROTOCOLS, LONG, 181),
+
+ /* set the bitmask for the protocols that libcurl is allowed to follow to,
+ as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
+ to be set in both bitmasks to be allowed to get redirected to. Defaults
+ to all protocols except FILE and SCP. */
+ CINIT(REDIR_PROTOCOLS, LONG, 182),
+
+ /* set the SSH knownhost file name to use */
+ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+
+ /* set the SSH host key callback custom pointer */
+ CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+
+ CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -1294,49 +1294,49 @@ typedef enum {
#endif
- /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
- name resolves addresses using more than one IP protocol version, this
- option might be handy to force libcurl to use a specific IP version. */
+/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
+ name resolves addresses using more than one IP protocol version, this
+ option might be handy to force libcurl to use a specific IP version. */
#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
versions that your system allows */
#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
- /* three convenient "aliases" that follow the name scheme better */
+/* three convenient "aliases" that follow the name scheme better */
#define CURLOPT_WRITEDATA CURLOPT_FILE
#define CURLOPT_READDATA CURLOPT_INFILE
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
+/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
enum {
- CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
+ CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
like the library to choose the best possible
for us! */
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
+ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
+ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
+ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
- /* These enums are for use with the CURLOPT_NETRC option. */
+/* These enums are for use with the CURLOPT_NETRC option. */
enum CURL_NETRC_OPTION {
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
+ CURL_NETRC_IGNORED, /* The .netrc will never be read.
* This is the default. */
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
+ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
* to one in the .netrc. */
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
+ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
* Unless one is set programmatically, the .netrc
* will be queried. */
- CURL_NETRC_LAST
+ CURL_NETRC_LAST
};
enum {
- CURL_SSLVERSION_DEFAULT,
- CURL_SSLVERSION_TLSv1,
- CURL_SSLVERSION_SSLv2,
- CURL_SSLVERSION_SSLv3,
+ CURL_SSLVERSION_DEFAULT,
+ CURL_SSLVERSION_TLSv1,
+ CURL_SSLVERSION_SSLv2,
+ CURL_SSLVERSION_SSLv3,
- CURL_SSLVERSION_LAST /* never use, keep last */
+ CURL_SSLVERSION_LAST /* never use, keep last */
};
/* symbols to use with CURLOPT_POSTREDIR.
@@ -1349,13 +1349,13 @@ enum {
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
typedef enum {
- CURL_TIMECOND_NONE,
+ CURL_TIMECOND_NONE,
- CURL_TIMECOND_IFMODSINCE,
- CURL_TIMECOND_IFUNMODSINCE,
- CURL_TIMECOND_LASTMOD,
+ CURL_TIMECOND_IFMODSINCE,
+ CURL_TIMECOND_IFUNMODSINCE,
+ CURL_TIMECOND_LASTMOD,
- CURL_TIMECOND_LAST
+ CURL_TIMECOND_LAST
} curl_TimeCond;
@@ -1377,41 +1377,41 @@ CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
#endif
typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
-
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
-
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
-
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
-
- CURLFORM_LASTENTRY /* the last unused */
+ CFINIT(NOTHING), /********* the first one is unused ************/
+
+ /* */
+ CFINIT(COPYNAME),
+ CFINIT(PTRNAME),
+ CFINIT(NAMELENGTH),
+ CFINIT(COPYCONTENTS),
+ CFINIT(PTRCONTENTS),
+ CFINIT(CONTENTSLENGTH),
+ CFINIT(FILECONTENT),
+ CFINIT(ARRAY),
+ CFINIT(OBSOLETE),
+ CFINIT(FILE),
+
+ CFINIT(BUFFER),
+ CFINIT(BUFFERPTR),
+ CFINIT(BUFFERLENGTH),
+
+ CFINIT(CONTENTTYPE),
+ CFINIT(CONTENTHEADER),
+ CFINIT(FILENAME),
+ CFINIT(END),
+ CFINIT(OBSOLETE2),
+
+ CFINIT(STREAM),
+
+ CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
#undef CFINIT /* done */
/* structure to be used as parameter for CURLFORM_ARRAY */
struct curl_forms {
- CURLformoption option;
- const char *value;
+ CURLformoption option;
+ const char *value;
};
/* use this for multipart formpost building */
@@ -1431,17 +1431,17 @@ struct curl_forms {
*
***************************************************************************/
typedef enum {
- CURL_FORMADD_OK, /* first, no error */
+ CURL_FORMADD_OK, /* first, no error */
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
+ CURL_FORMADD_MEMORY,
+ CURL_FORMADD_OPTION_TWICE,
+ CURL_FORMADD_NULL,
+ CURL_FORMADD_UNKNOWN_OPTION,
+ CURL_FORMADD_INCOMPLETE,
+ CURL_FORMADD_ILLEGAL_ARRAY,
+ CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
- CURL_FORMADD_LAST /* last */
+ CURL_FORMADD_LAST /* last */
} CURLFORMcode;
/*
@@ -1581,11 +1581,11 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* memory management routines like malloc, free etc.
*/
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
- curl_malloc_callback m,
- curl_free_callback f,
- curl_realloc_callback r,
- curl_strdup_callback s,
- curl_calloc_callback c);
+ curl_malloc_callback m,
+ curl_free_callback f,
+ curl_realloc_callback r,
+ curl_strdup_callback s,
+ curl_calloc_callback c);
/*
* NAME curl_global_cleanup()
@@ -1599,8 +1599,8 @@ CURL_EXTERN void curl_global_cleanup(void);
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
- char *data;
- struct curl_slist *next;
+ char *data;
+ struct curl_slist *next;
};
/*
@@ -1612,7 +1612,7 @@ struct curl_slist {
* first. Returns the new list, after appending.
*/
CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
+ const char *);
/*
* NAME curl_slist_free_all()
@@ -1637,8 +1637,8 @@ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
/* info about the certificate chain, only for OpenSSL builds. Asked
for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
- int num_of_certs; /* number of certificates with information */
- struct curl_slist **certinfo; /* for each index in this array, there's a
+ int num_of_certs; /* number of certificates with information */
+ struct curl_slist **certinfo; /* for each index in this array, there's a
linked list with textual information in the
format "name: value" */
};
@@ -1651,45 +1651,45 @@ struct curl_certinfo {
#define CURLINFO_TYPEMASK 0xf00000
typedef enum {
- CURLINFO_NONE, /* first, never use this */
- CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
- CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
- CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
- CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
- CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
- CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
- CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
- CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
- CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
- CURLINFO_FILETIME = CURLINFO_LONG + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
- CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
- CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
- CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
- CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
- CURLINFO_PRIVATE = CURLINFO_STRING + 21,
- CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
- CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
- CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
- CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
- CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
- CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
- CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
- CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
- CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
- CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
- CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
- CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
- CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
- /* Fill in new entries below here! */
-
- CURLINFO_LASTONE = 35
+ CURLINFO_NONE, /* first, never use this */
+ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
+ CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
+ CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
+ CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
+ CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
+ CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
+ CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
+ CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
+ CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
+ CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
+ CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
+ CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
+ CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
+ CURLINFO_FILETIME = CURLINFO_LONG + 14,
+ CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
+ CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
+ CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
+ CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
+ CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
+ CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
+ CURLINFO_PRIVATE = CURLINFO_STRING + 21,
+ CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
+ CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
+ CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
+ CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
+ CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
+ CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
+ CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
+ CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
+ CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
+ CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
+ CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
+ CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
+ CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
+ CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
+ /* Fill in new entries below here! */
+
+ CURLINFO_LASTONE = 35
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -1697,15 +1697,15 @@ typedef enum {
#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
typedef enum {
- CURLCLOSEPOLICY_NONE, /* first, never use this */
+ CURLCLOSEPOLICY_NONE, /* first, never use this */
- CURLCLOSEPOLICY_OLDEST,
- CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
- CURLCLOSEPOLICY_LEAST_TRAFFIC,
- CURLCLOSEPOLICY_SLOWEST,
- CURLCLOSEPOLICY_CALLBACK,
+ CURLCLOSEPOLICY_OLDEST,
+ CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
+ CURLCLOSEPOLICY_LEAST_TRAFFIC,
+ CURLCLOSEPOLICY_SLOWEST,
+ CURLCLOSEPOLICY_CALLBACK,
- CURLCLOSEPOLICY_LAST /* last, never use this */
+ CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
#define CURL_GLOBAL_SSL (1<<0)
@@ -1721,25 +1721,25 @@ typedef enum {
/* Different data locks for a single share */
typedef enum {
- CURL_LOCK_DATA_NONE = 0,
- /* CURL_LOCK_DATA_SHARE is used internally to say that
- * the locking is just made to change the internal state of the share
- * itself.
- */
- CURL_LOCK_DATA_SHARE,
- CURL_LOCK_DATA_COOKIE,
- CURL_LOCK_DATA_DNS,
- CURL_LOCK_DATA_SSL_SESSION,
- CURL_LOCK_DATA_CONNECT,
- CURL_LOCK_DATA_LAST
+ CURL_LOCK_DATA_NONE = 0,
+ /* CURL_LOCK_DATA_SHARE is used internally to say that
+ * the locking is just made to change the internal state of the share
+ * itself.
+ */
+ CURL_LOCK_DATA_SHARE,
+ CURL_LOCK_DATA_COOKIE,
+ CURL_LOCK_DATA_DNS,
+ CURL_LOCK_DATA_SSL_SESSION,
+ CURL_LOCK_DATA_CONNECT,
+ CURL_LOCK_DATA_LAST
} curl_lock_data;
/* Different lock access types */
typedef enum {
- CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
- CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
- CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
- CURL_LOCK_ACCESS_LAST /* never use */
+ CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
+ CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
+ CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
+ CURL_LOCK_ACCESS_LAST /* never use */
} curl_lock_access;
typedef void (*curl_lock_function)(CURL *handle,
@@ -1753,23 +1753,23 @@ typedef void (*curl_unlock_function)(CURL *handle,
typedef void CURLSH;
typedef enum {
- CURLSHE_OK, /* all is fine */
- CURLSHE_BAD_OPTION, /* 1 */
- CURLSHE_IN_USE, /* 2 */
- CURLSHE_INVALID, /* 3 */
- CURLSHE_NOMEM, /* out of memory */
- CURLSHE_LAST /* never use */
+ CURLSHE_OK, /* all is fine */
+ CURLSHE_BAD_OPTION, /* 1 */
+ CURLSHE_IN_USE, /* 2 */
+ CURLSHE_INVALID, /* 3 */
+ CURLSHE_NOMEM, /* out of memory */
+ CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
- CURLSHOPT_NONE, /* don't use */
- CURLSHOPT_SHARE, /* specify a data type to share */
- CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
- CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
- CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
- CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
+ CURLSHOPT_NONE, /* don't use */
+ CURLSHOPT_SHARE, /* specify a data type to share */
+ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
+ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
+ CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
+ CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
callback functions */
- CURLSHOPT_LAST /* never use */
+ CURLSHOPT_LAST /* never use */
} CURLSHoption;
CURL_EXTERN CURLSH *curl_share_init(void);
@@ -1781,11 +1781,11 @@ CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
*/
typedef enum {
- CURLVERSION_FIRST,
- CURLVERSION_SECOND,
- CURLVERSION_THIRD,
- CURLVERSION_FOURTH,
- CURLVERSION_LAST /* never actually use this */
+ CURLVERSION_FIRST,
+ CURLVERSION_SECOND,
+ CURLVERSION_THIRD,
+ CURLVERSION_FOURTH,
+ CURLVERSION_LAST /* never actually use this */
} CURLversion;
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
@@ -1796,30 +1796,30 @@ typedef enum {
#define CURLVERSION_NOW CURLVERSION_FOURTH
typedef struct {
- CURLversion age; /* age of the returned struct */
- const char *version; /* LIBCURL_VERSION */
- unsigned int version_num; /* LIBCURL_VERSION_NUM */
- const char *host; /* OS/host/cpu/machine when configured */
- int features; /* bitmask, see defines below */
- const char *ssl_version; /* human readable string */
- long ssl_version_num; /* not used anymore, always 0 */
- const char *libz_version; /* human readable string */
- /* protocols is terminated by an entry with a NULL protoname */
- const char * const *protocols;
-
- /* The fields below this were added in CURLVERSION_SECOND */
- const char *ares;
- int ares_num;
-
- /* This field was added in CURLVERSION_THIRD */
- const char *libidn;
-
- /* These field were added in CURLVERSION_FOURTH */
-
- /* Same as '_libiconv_version' if built with HAVE_ICONV */
- int iconv_ver_num;
-
- const char *libssh_version; /* human readable string */
+ CURLversion age; /* age of the returned struct */
+ const char *version; /* LIBCURL_VERSION */
+ unsigned int version_num; /* LIBCURL_VERSION_NUM */
+ const char *host; /* OS/host/cpu/machine when configured */
+ int features; /* bitmask, see defines below */
+ const char *ssl_version; /* human readable string */
+ long ssl_version_num; /* not used anymore, always 0 */
+ const char *libz_version; /* human readable string */
+ /* protocols is terminated by an entry with a NULL protoname */
+ const char * const *protocols;
+
+ /* The fields below this were added in CURLVERSION_SECOND */
+ const char *ares;
+ int ares_num;
+
+ /* This field was added in CURLVERSION_THIRD */
+ const char *libidn;
+
+ /* These field were added in CURLVERSION_FOURTH */
+
+ /* Same as '_libiconv_version' if built with HAVE_ICONV */
+ int iconv_ver_num;
+
+ const char *libssh_version; /* human readable string */
} curl_version_info_data;
diff --git a/thirdparties/win32/include/curl/curlbuild.h b/thirdparties/win32/include/curl/curlbuild.h
index 205e9f4..55bfbe7 100755
--- a/thirdparties/win32/include/curl/curlbuild.h
+++ b/thirdparties/win32/include/curl/curlbuild.h
@@ -61,52 +61,52 @@
#ifdef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
+Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
#endif
#ifdef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
#endif
/* ================================================================ */
diff --git a/thirdparties/win32/include/curl/curlrules.h b/thirdparties/win32/include/curl/curlrules.h
index 4401873..c676ed1 100755
--- a/thirdparties/win32/include/curl/curlrules.h
+++ b/thirdparties/win32/include/curl/curlrules.h
@@ -78,52 +78,52 @@
#ifndef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
+Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
#endif
#ifndef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
#endif
/*
@@ -140,8 +140,8 @@
*/
typedef char
- __curl_rule_01__
- [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
+__curl_rule_01__
+[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
/*
* Verify that the size previously defined and expected for
@@ -150,8 +150,8 @@ typedef char
*/
typedef char
- __curl_rule_02__
- [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
+__curl_rule_02__
+[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
/*
* Verify at compile time that the size of curl_off_t as reported
@@ -160,8 +160,8 @@ typedef char
*/
typedef char
- __curl_rule_03__
- [CurlchkszGE(curl_off_t, long)];
+__curl_rule_03__
+[CurlchkszGE(curl_off_t, long)];
/*
* Verify that the size previously defined and expected for
@@ -170,8 +170,8 @@ typedef char
*/
typedef char
- __curl_rule_04__
- [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
+__curl_rule_04__
+[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
/*
* Verify at compile time that the size of curl_socklen_t as reported
@@ -180,14 +180,14 @@ typedef char
*/
typedef char
- __curl_rule_05__
- [CurlchkszGE(curl_socklen_t, int)];
+__curl_rule_05__
+[CurlchkszGE(curl_socklen_t, int)];
/* ================================================================ */
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
/* ================================================================ */
-/*
+/*
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
* these to be visible and exported by the external libcurl interface API,
* while also making them visible to the library internals, simply including
@@ -206,10 +206,10 @@ typedef char
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
defined(__ILEC400__)
- /* This compiler is believed to have an ISO compatible preprocessor */
+/* This compiler is believed to have an ISO compatible preprocessor */
#define CURL_ISOCPP
#else
- /* This compiler is believed NOT to have an ISO compatible preprocessor */
+/* This compiler is believed NOT to have an ISO compatible preprocessor */
#undef CURL_ISOCPP
#endif
diff --git a/thirdparties/win32/include/curl/multi.h b/thirdparties/win32/include/curl/multi.h
index 153f772..a71fe42 100755
--- a/thirdparties/win32/include/curl/multi.h
+++ b/thirdparties/win32/include/curl/multi.h
@@ -56,16 +56,16 @@ extern "C" {
typedef void CURLM;
typedef enum {
- CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
+ CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
curl_multi_socket*() soon */
- CURLM_OK,
- CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
- CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
- CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
- CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
- CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
- CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
- CURLM_LAST
+ CURLM_OK,
+ CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
+ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
+ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
+ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
+ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
+ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
+ CURLM_LAST
} CURLMcode;
/* just to make code nicer when using curl_multi_socket() you can now check
@@ -74,19 +74,19 @@ typedef enum {
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
typedef enum {
- CURLMSG_NONE, /* first, not used */
- CURLMSG_DONE, /* This easy handle has completed. 'result' contains
+ CURLMSG_NONE, /* first, not used */
+ CURLMSG_DONE, /* This easy handle has completed. 'result' contains
the CURLcode of the transfer */
- CURLMSG_LAST /* last, not used */
+ CURLMSG_LAST /* last, not used */
} CURLMSG;
struct CURLMsg {
- CURLMSG msg; /* what this message means */
- CURL *easy_handle; /* the handle it concerns */
- union {
- void *whatever; /* message-specific data */
- CURLcode result; /* return code for transfer */
- } data;
+ CURLMSG msg; /* what this message means */
+ CURL *easy_handle; /* the handle it concerns */
+ union {
+ void *whatever; /* message-specific data */
+ CURLcode result; /* return code for transfer */
+ } data;
};
typedef struct CURLMsg CURLMsg;
@@ -107,62 +107,62 @@ CURL_EXTERN CURLM *curl_multi_init(void);
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_remove_handle()
- *
- * Desc: removes a curl handle from the multi stack again
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_remove_handle()
+ *
+ * Desc: removes a curl handle from the multi stack again
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_fdset()
- *
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
- * poll() on. We want curl_multi_perform() called as soon as one of
- * them are ready.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_fdset()
+ *
+ * Desc: Ask curl for its fd_set sets. The app can use these to select() or
+ * poll() on. We want curl_multi_perform() called as soon as one of
+ * them are ready.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
fd_set *exc_fd_set,
int *max_fd);
- /*
- * Name: curl_multi_perform()
- *
- * Desc: When the app thinks there's data available for curl it calls this
- * function to read/write whatever there is right now. This returns
- * as soon as the reads and writes are done. This function does not
- * require that there actually is data available for reading or that
- * data can be written, it can be called just in case. It returns
- * the number of handles that still transfer data in the second
- * argument's integer-pointer.
- *
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
- * returns errors etc regarding the whole multi stack. There might
- * still have occurred problems on invidual transfers even when this
- * returns OK.
- */
+/*
+ * Name: curl_multi_perform()
+ *
+ * Desc: When the app thinks there's data available for curl it calls this
+ * function to read/write whatever there is right now. This returns
+ * as soon as the reads and writes are done. This function does not
+ * require that there actually is data available for reading or that
+ * data can be written, it can be called just in case. It returns
+ * the number of handles that still transfer data in the second
+ * argument's integer-pointer.
+ *
+ * Returns: CURLMcode type, general multi error code. *NOTE* that this only
+ * returns errors etc regarding the whole multi stack. There might
+ * still have occurred problems on invidual transfers even when this
+ * returns OK.
+ */
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
- int *running_handles);
-
- /*
- * Name: curl_multi_cleanup()
- *
- * Desc: Cleans up and removes a whole multi stack. It does not free or
- * touch any individual easy handles in any way. We need to define
- * in what state those handles will be if this function is called
- * in the middle of a transfer.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ int *running_handles);
+
+/*
+ * Name: curl_multi_cleanup()
+ *
+ * Desc: Cleans up and removes a whole multi stack. It does not free or
+ * touch any individual easy handles in any way. We need to define
+ * in what state those handles will be if this function is called
+ * in the middle of a transfer.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
@@ -194,7 +194,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* to.
*/
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
- int *msgs_in_queue);
+ int *msgs_in_queue);
/*
* Name: curl_multi_strerror()
@@ -246,20 +246,20 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
* Returns: The callback should return zero.
*/
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
- long timeout_ms, /* see above */
- void *userp); /* private callback
+ long timeout_ms, /* see above */
+ void *userp); /* private callback
pointer */
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
- curl_socket_t s,
- int ev_bitmask,
- int *running_handles);
+ curl_socket_t s,
+ int ev_bitmask,
+ int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
+ int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
@@ -278,7 +278,7 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
- long *milliseconds);
+ long *milliseconds);
#undef CINIT /* re-using the same name as in curl.h */
@@ -294,25 +294,25 @@ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
#endif
typedef enum {
- /* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
+ /* This is the socket callback function pointer */
+ CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
- /* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
+ /* This is the argument passed to the socket callback */
+ CINIT(SOCKETDATA, OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
+ CINIT(PIPELINING, LONG, 3),
- /* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+ /* This is the timer callback function pointer */
+ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
- /* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
+ /* This is the argument passed to the timer callback */
+ CINIT(TIMERDATA, OBJECTPOINT, 5),
- /* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
+ /* maximum number of entries in the connection cache */
+ CINIT(MAXCONNECTS, LONG, 6),
- CURLMOPT_LASTENTRY /* the last unused */
+ CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
diff --git a/thirdparties/win32/include/curl/stdcheaders.h b/thirdparties/win32/include/curl/stdcheaders.h
index f739d7f..0ff0be0 100755
--- a/thirdparties/win32/include/curl/stdcheaders.h
+++ b/thirdparties/win32/include/curl/stdcheaders.h
@@ -1,10 +1,10 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -12,7 +12,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
diff --git a/thirdparties/win32/include/curl/typecheck-gcc.h b/thirdparties/win32/include/curl/typecheck-gcc.h
index 9788305..781aa2d 100755
--- a/thirdparties/win32/include/curl/typecheck-gcc.h
+++ b/thirdparties/win32/include/curl/typecheck-gcc.h
@@ -123,56 +123,56 @@ __extension__ ({ \
__attribute__((noinline)) id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
- "curl_easy_setopt expects a long argument for this option")
+ "curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
- "curl_easy_setopt expects a curl_off_t argument for this option")
+ "curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
- "curl_easy_setopt expects a string (char* or char[]) argument for this option"
- )
+ "curl_easy_setopt expects a string (char* or char[]) argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
- "curl_easy_setopt expects a curl_write_callback argument for this option")
+ "curl_easy_setopt expects a curl_write_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
- "curl_easy_setopt expects a curl_read_callback argument for this option")
+ "curl_easy_setopt expects a curl_read_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
- "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
+ "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
- "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
+ "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
- "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
- )
+ "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
- "curl_easy_setopt expects a curl_progress_callback argument for this option")
+ "curl_easy_setopt expects a curl_progress_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
- "curl_easy_setopt expects a curl_debug_callback argument for this option")
+ "curl_easy_setopt expects a curl_debug_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
- "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
+ "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
- "curl_easy_setopt expects a curl_conv_callback argument for this option")
+ "curl_easy_setopt expects a curl_conv_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
- "curl_easy_setopt expects a curl_seek_callback argument for this option")
+ "curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
- "curl_easy_setopt expects a private data pointer as argument for this option")
+ "curl_easy_setopt expects a private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
- "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
+ "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
- "curl_easy_setopt expects a FILE* argument for this option")
+ "curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
- "curl_easy_setopt expects a void* or char* argument for this option")
+ "curl_easy_setopt expects a void* or char* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
- "curl_easy_setopt expects a struct curl_httppost* argument for this option")
+ "curl_easy_setopt expects a struct curl_httppost* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
- "curl_easy_setopt expects a struct curl_slist* argument for this option")
+ "curl_easy_setopt expects a struct curl_slist* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
- "curl_easy_setopt expects a CURLSH* argument for this option")
+ "curl_easy_setopt expects a CURLSH* argument for this option")
_CURL_WARNING(_curl_easy_getinfo_err_string,
- "curl_easy_getinfo expects a pointer to char * for this info")
+ "curl_easy_getinfo expects a pointer to char * for this info")
_CURL_WARNING(_curl_easy_getinfo_err_long,
- "curl_easy_getinfo expects a pointer to long for this info")
+ "curl_easy_getinfo expects a pointer to long for this info")
_CURL_WARNING(_curl_easy_getinfo_err_double,
- "curl_easy_getinfo expects a pointer to double for this info")
+ "curl_easy_getinfo expects a pointer to double for this info")
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
- "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
+ "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
/* groups of curl_easy_setops options that take the same type of argument */
@@ -457,13 +457,13 @@ typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
_curl_callback_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (_curl_opensocket_callback1)
- (void *, curlsocktype, struct curl_sockaddr *);
+(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback2)
- (void *, curlsocktype, const struct curl_sockaddr *);
+(void *, curlsocktype, const struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback3)
- (const void *, curlsocktype, struct curl_sockaddr *);
+(const void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback4)
- (const void *, curlsocktype, const struct curl_sockaddr *);
+(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
#define _curl_is_progress_cb(expr) \
@@ -472,9 +472,9 @@ typedef curl_socket_t (_curl_opensocket_callback4)
_curl_callback_compatible((expr), _curl_progress_callback1) || \
_curl_callback_compatible((expr), _curl_progress_callback2))
typedef int (_curl_progress_callback1)(void *,
- double, double, double, double);
+ double, double, double, double);
typedef int (_curl_progress_callback2)(const void *,
- double, double, double, double);
+ double, double, double, double);
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
#define _curl_is_debug_cb(expr) \
@@ -485,13 +485,13 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
typedef int (_curl_debug_callback1) (CURL *,
- curl_infotype, char *, size_t, void *);
+ curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
- curl_infotype, char *, size_t, const void *);
+ curl_infotype, char *, size_t, const void *);
typedef int (_curl_debug_callback3) (CURL *,
- curl_infotype, const char *, size_t, void *);
+ curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
- curl_infotype, const char *, size_t, const void *);
+ curl_infotype, const char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
diff --git a/thirdparties/win32/include/directshow/amextra.h b/thirdparties/win32/include/directshow/amextra.h
index 3caf64c..df3f74e 100755
--- a/thirdparties/win32/include/directshow/amextra.h
+++ b/thirdparties/win32/include/directshow/amextra.h
@@ -34,7 +34,7 @@ public:
__inout HRESULT *phr,
__in_opt LPCWSTR pName);
#endif
-
+
// Override methods to track end of stream state
STDMETHODIMP EndOfStream();
STDMETHODIMP EndFlush();
diff --git a/thirdparties/win32/include/directshow/amfilter.h b/thirdparties/win32/include/directshow/amfilter.h
index 8646bc0..b86ece5 100755
--- a/thirdparties/win32/include/directshow/amfilter.h
+++ b/thirdparties/win32/include/directshow/amfilter.h
@@ -54,7 +54,7 @@ class CMemAllocator; // Implements memory buffer allocation
//=====================================================================
class AM_NOVTABLE CBaseMediaFilter : public CUnknown,
- public IMediaFilter
+ public IMediaFilter
{
protected:
@@ -67,7 +67,7 @@ protected:
CRefTime m_tStart;
CLSID m_clsid; // This filters clsid
- // used for serialization
+ // used for serialization
CCritSec *m_pLock; // Object we use for locking
public:
@@ -76,7 +76,7 @@ public:
__in_opt LPCTSTR pName,
__inout_opt LPUNKNOWN pUnk,
__in CCritSec *pLock,
- REFCLSID clsid);
+ REFCLSID clsid);
virtual ~CBaseMediaFilter();
@@ -146,18 +146,18 @@ public:
class AM_NOVTABLE CBaseFilter : public CUnknown, // Handles an IUnknown
- public IBaseFilter, // The Filter Interface
- public IAMovieSetup // For un/registration
+ public IBaseFilter, // The Filter Interface
+ public IAMovieSetup // For un/registration
{
-friend class CBasePin;
+ friend class CBasePin;
protected:
FILTER_STATE m_State; // current state: running, paused
IReferenceClock *m_pClock; // this graph's ref clock
CRefTime m_tStart; // offset from stream time to reference time
CLSID m_clsid; // This filters clsid
- // used for serialization
+ // used for serialization
CCritSec *m_pLock; // Object we use for locking
WCHAR *m_pName; // Full filter name
@@ -171,26 +171,26 @@ public:
__in_opt LPCTSTR pName, // Object description
__inout_opt LPUNKNOWN pUnk, // IUnknown of delegating object
__in CCritSec *pLock, // Object who maintains lock
- REFCLSID clsid); // The clsid to be used to serialize this filter
+ REFCLSID clsid); // The clsid to be used to serialize this filter
CBaseFilter(
__in_opt LPCTSTR pName, // Object description
__in_opt LPUNKNOWN pUnk, // IUnknown of delegating object
__in CCritSec *pLock, // Object who maintains lock
- REFCLSID clsid, // The clsid to be used to serialize this filter
+ REFCLSID clsid, // The clsid to be used to serialize this filter
__inout HRESULT *phr); // General OLE return code
#ifdef UNICODE
CBaseFilter(
__in_opt LPCSTR pName, // Object description
__in_opt LPUNKNOWN pUnk, // IUnknown of delegating object
__in CCritSec *pLock, // Object who maintains lock
- REFCLSID clsid); // The clsid to be used to serialize this filter
+ REFCLSID clsid); // The clsid to be used to serialize this filter
CBaseFilter(
__in_opt LPCSTR pName, // Object description
__in_opt LPUNKNOWN pUnk, // IUnknown of delegating object
__in CCritSec *pLock, // Object who maintains lock
- REFCLSID clsid, // The clsid to be used to serialize this filter
+ REFCLSID clsid, // The clsid to be used to serialize this filter
__inout HRESULT *phr); // General OLE return code
#endif
~CBaseFilter();
@@ -253,7 +253,7 @@ public:
// pin enumerator
STDMETHODIMP EnumPins(
- __deref_out IEnumPins ** ppEnum);
+ __deref_out IEnumPins ** ppEnum);
// default behaviour of FindPin assumes pin ids are their names
@@ -263,18 +263,18 @@ public:
);
STDMETHODIMP QueryFilterInfo(
- __out FILTER_INFO * pInfo);
+ __out FILTER_INFO * pInfo);
STDMETHODIMP JoinFilterGraph(
- __inout_opt IFilterGraph * pGraph,
- __in_opt LPCWSTR pName);
+ __inout_opt IFilterGraph * pGraph,
+ __in_opt LPCWSTR pName);
// return a Vendor information string. Optional - may return E_NOTIMPL.
// memory returned should be freed using CoTaskMemFree
// default implementation returns E_NOTIMPL
STDMETHODIMP QueryVendorInfo(
- __deref_out LPWSTR* pVendorInfo
- );
+ __deref_out LPWSTR* pVendorInfo
+ );
// --- helper methods ---
@@ -314,7 +314,9 @@ public:
// --- setup helper methods ---
// (override to return filters setup data)
- virtual __out_opt LPAMOVIESETUP_FILTER GetSetupData(){ return NULL; }
+ virtual __out_opt LPAMOVIESETUP_FILTER GetSetupData() {
+ return NULL;
+ }
};
@@ -339,7 +341,7 @@ protected:
bool m_bRunTimeError; // Run time error generated
bool m_bCanReconnectWhenActive; // OK to reconnect when active
bool m_bTryMyTypesFirst; // When connecting enumerate
- // this pin's types first
+ // this pin's types first
CBaseFilter *m_pFilter; // Filter we were created by
IQualityControl *m_pQSink; // Target for Quality messages
LONG m_TypeVersion; // Holds current type version
@@ -376,17 +378,17 @@ protected:
// try all the media types in this enumerator - for each that
// we accept, try to connect using ReceiveConnection.
HRESULT TryMediaTypes(
- IPin *pReceivePin, // connect to this pin
- __in_opt const CMediaType *pmt, // proposed type from Connect
- IEnumMediaTypes *pEnum); // try this enumerator
+ IPin *pReceivePin, // connect to this pin
+ __in_opt const CMediaType *pmt, // proposed type from Connect
+ IEnumMediaTypes *pEnum); // try this enumerator
// establish a connection with a suitable mediatype. Needs to
// propose a media type if the pmt pointer is null or partially
// specified - use TryMediaTypes on both our and then the other pin's
// enumerator until we find one that works.
HRESULT AgreeMediaType(
- IPin *pReceivePin, // connect to this pin
- const CMediaType *pmt); // proposed type from Connect
+ IPin *pReceivePin, // connect to this pin
+ const CMediaType *pmt); // proposed type from Connect
public:
@@ -441,7 +443,7 @@ public:
);
STDMETHODIMP QueryDirection(
- __out PIN_DIRECTION * pPinDir
+ __out PIN_DIRECTION * pPinDir
);
STDMETHODIMP QueryId(
@@ -466,10 +468,12 @@ public:
// all visible output pins and vice versa.
// apPin can be NULL if nPin==0 (not otherwise).
STDMETHODIMP QueryInternalConnections(
- __out_ecount_part(*nPin,*nPin) IPin* *apPin, // array of IPin*
+ __out_ecount_part(*nPin,*nPin) IPin**apPin, // array of IPin*
__inout ULONG *nPin // on input, the number of slots
- // on output the number of pins
- ) { return E_NOTIMPL; }
+ // on output the number of pins
+ ) {
+ return E_NOTIMPL;
+ }
// Called when no more data will be sent
STDMETHODIMP EndOfStream(void);
@@ -481,9 +485,9 @@ public:
// returns S_OK.
// Override this to pass downstream.
STDMETHODIMP NewSegment(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop,
- double dRate);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
//================================================================================
// IQualityControl methods
@@ -496,9 +500,13 @@ public:
// --- helper methods ---
// Returns true if the pin is connected. false otherwise.
- BOOL IsConnected(void) {return (m_Connected != NULL); };
+ BOOL IsConnected(void) {
+ return (m_Connected != NULL);
+ };
// Return the pin this is connected to (if any)
- IPin * GetConnected() { return m_Connected; };
+ IPin * GetConnected() {
+ return m_Connected;
+ };
// Check if our filter is currently stopped
BOOL IsStopped() {
@@ -548,16 +556,16 @@ public:
}
// Access name
- LPWSTR Name() { return m_pName; };
+ LPWSTR Name() {
+ return m_pName;
+ };
// Can reconnectwhen active?
- void SetReconnectWhenActive(bool bCanReconnect)
- {
+ void SetReconnectWhenActive(bool bCanReconnect) {
m_bCanReconnectWhenActive = bCanReconnect;
}
- bool CanReconnectWhenActive()
- {
+ bool CanReconnectWhenActive() {
return m_bCanReconnectWhenActive;
}
@@ -590,8 +598,8 @@ class CEnumPins : public IEnumPins // The interface we support
typedef CGenericList<CBasePin> CPinList;
CPinList m_PinCache; // These pointers have not been AddRef'ed and
- // so they should not be dereferenced. They are
- // merely kept to ID which pins have been enumerated.
+ // so they should not be dereferenced. They are
+ // merely kept to ID which pins have been enumerated.
#ifdef DEBUG
DWORD m_dwCookie;
@@ -716,7 +724,7 @@ protected:
IMemAllocator *m_pAllocator;
IMemInputPin *m_pInputPin; // interface on the downstreaminput pin
- // set up in CheckConnect when we connect.
+ // set up in CheckConnect when we connect.
public:
@@ -791,9 +799,9 @@ public:
// deliver NewSegment to connected pin - you will need to
// override this if you queue any data in your output pin.
virtual HRESULT DeliverNewSegment(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop,
- double dRate);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
//================================================================================
// IQualityControl methods
@@ -817,7 +825,7 @@ public:
//=====================================================================
class AM_NOVTABLE CBaseInputPin : public CBasePin,
- public IMemInputPin
+ public IMemInputPin
{
protected:
@@ -866,8 +874,8 @@ public:
// tell the input pin which allocator the output pin is actually
// going to use.
STDMETHODIMP NotifyAllocator(
- IMemAllocator * pAllocator,
- BOOL bReadOnly);
+ IMemAllocator * pAllocator,
+ BOOL bReadOnly);
// do something with this media sample
STDMETHODIMP Receive(IMediaSample *pSample);
@@ -947,7 +955,7 @@ public:
//
class CDynamicOutputPin : public CBaseOutputPin,
- public IPinFlowControl
+ public IPinFlowControl
{
public:
#ifdef UNICODE
@@ -981,11 +989,11 @@ public:
// Set graph config info
void SetConfigInfo(IGraphConfig *pGraphConfig, HANDLE hStopEvent);
- #ifdef DEBUG
+#ifdef DEBUG
virtual HRESULT Deliver(IMediaSample *pSample);
virtual HRESULT DeliverEndOfStream(void);
virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- #endif // DEBUG
+#endif // DEBUG
HRESULT DeliverBeginFlush(void);
HRESULT DeliverEndFlush(void);
@@ -999,12 +1007,12 @@ public:
virtual bool StreamingThreadUsingOutputPin(void);
HRESULT ChangeOutputFormat
- (
+ (
const AM_MEDIA_TYPE *pmt,
REFERENCE_TIME tSegmentStart,
REFERENCE_TIME tSegmentStop,
double dSegmentRate
- );
+ );
HRESULT ChangeMediaType(const CMediaType *pmt);
HRESULT DynamicReconnect(const CMediaType *pmt);
@@ -1018,8 +1026,7 @@ protected:
static HRESULT WaitEvent(HANDLE hEvent);
- enum BLOCK_STATE
- {
+ enum BLOCK_STATE {
NOT_BLOCKED,
PENDING,
BLOCKED
@@ -1075,9 +1082,9 @@ private:
HRESULT Initialize(void);
HRESULT ChangeMediaTypeHelper(const CMediaType *pmt);
- #ifdef DEBUG
+#ifdef DEBUG
void AssertValid(void);
- #endif // DEBUG
+#endif // DEBUG
};
class CAutoUsingOutputPin
@@ -1101,8 +1108,7 @@ inline CAutoUsingOutputPin::CAutoUsingOutputPin( __in CDynamicOutputPin* pOutput
ASSERT( S_OK == *phr );
HRESULT hr = pOutputPin->StartUsingOutputPin();
- if( FAILED( hr ) )
- {
+ if( FAILED( hr ) ) {
*phr = hr;
return;
}
@@ -1112,8 +1118,7 @@ inline CAutoUsingOutputPin::CAutoUsingOutputPin( __in CDynamicOutputPin* pOutput
inline CAutoUsingOutputPin::~CAutoUsingOutputPin()
{
- if( NULL != m_pOutputPin )
- {
+ if( NULL != m_pOutputPin ) {
m_pOutputPin->StopUsingOutputPin();
}
}
@@ -1209,9 +1214,9 @@ protected:
we do no internal processing on it we leave it as a pointer */
DWORD m_dwFlags; /* Flags for this sample */
- /* Type specific flags are packed
- into the top word
- */
+ /* Type specific flags are packed
+ into the top word
+ */
DWORD m_dwTypeSpecificFlags; /* Media type specific flags */
__field_ecount_opt(m_cbBuffer) LPBYTE m_pBuffer; /* Pointer to the complete buffer */
LONG m_lActual; /* Length of data in this sample */
@@ -1298,14 +1303,14 @@ public:
// get the media times for this sample
STDMETHODIMP GetMediaTime(
- __out LONGLONG * pTimeStart,
- __out LONGLONG * pTimeEnd
+ __out LONGLONG * pTimeStart,
+ __out LONGLONG * pTimeEnd
);
// Set the media times for this sample
STDMETHODIMP SetMediaTime(
- __in_opt LONGLONG * pTimeStart,
- __in_opt LONGLONG * pTimeEnd
+ __in_opt LONGLONG * pTimeStart,
+ __in_opt LONGLONG * pTimeEnd
);
// Set and get properties (IMediaSample2)
@@ -1337,15 +1342,14 @@ public:
//=====================================================================
class AM_NOVTABLE CBaseAllocator : public CUnknown,// A non delegating IUnknown
- public IMemAllocatorCallbackTemp, // The interface we support
- public CCritSec // Provides object locking
+ public IMemAllocatorCallbackTemp, // The interface we support
+ public CCritSec // Provides object locking
{
class CSampleList;
friend class CSampleList;
/* Trick to get at protected member in CMediaSample */
- static CMediaSample * &NextSample(__in CMediaSample *pSample)
- {
+ static CMediaSample * &NextSample(__in CMediaSample *pSample) {
return pSample->m_pNext;
};
@@ -1355,23 +1359,26 @@ class AM_NOVTABLE CBaseAllocator : public CUnknown,// A non delegating IUnknown
public:
CSampleList() : m_List(NULL), m_nOnList(0) {};
#ifdef DEBUG
- ~CSampleList()
- {
+ ~CSampleList() {
ASSERT(m_nOnList == 0);
};
#endif
- CMediaSample *Head() const { return m_List; };
- CMediaSample *Next(__in CMediaSample *pSample) const { return CBaseAllocator::NextSample(pSample); };
- int GetCount() const { return m_nOnList; };
- void Add(__inout CMediaSample *pSample)
- {
+ CMediaSample *Head() const {
+ return m_List;
+ };
+ CMediaSample *Next(__in CMediaSample *pSample) const {
+ return CBaseAllocator::NextSample(pSample);
+ };
+ int GetCount() const {
+ return m_nOnList;
+ };
+ void Add(__inout CMediaSample *pSample) {
ASSERT(pSample != NULL);
CBaseAllocator::NextSample(pSample) = m_List;
m_List = pSample;
m_nOnList++;
};
- CMediaSample *RemoveHead()
- {
+ CMediaSample *RemoveHead() {
CMediaSample *pSample = m_List;
if (pSample != NULL) {
m_List = CBaseAllocator::NextSample(m_List);
@@ -1470,12 +1477,12 @@ public:
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
STDMETHODIMP SetProperties(
- __in ALLOCATOR_PROPERTIES* pRequest,
- __out ALLOCATOR_PROPERTIES* pActual);
+ __in ALLOCATOR_PROPERTIES* pRequest,
+ __out ALLOCATOR_PROPERTIES* pActual);
// return the properties actually being used on this allocator
STDMETHODIMP GetProperties(
- __out ALLOCATOR_PROPERTIES* pProps);
+ __out ALLOCATOR_PROPERTIES* pProps);
// override Commit to allocate memory. We handle the GetBuffer
//state changes
@@ -1511,7 +1518,9 @@ public:
void NotifySample();
// Notify that we're waiting for a sample
- void SetWaiting() { m_lWaiting++; };
+ void SetWaiting() {
+ m_lWaiting++;
+ };
};
@@ -1557,8 +1566,8 @@ public:
static CUnknown *CreateInstance(__inout_opt LPUNKNOWN, __inout HRESULT *);
STDMETHODIMP SetProperties(
- __in ALLOCATOR_PROPERTIES* pRequest,
- __out ALLOCATOR_PROPERTIES* pActual);
+ __in ALLOCATOR_PROPERTIES* pRequest,
+ __out ALLOCATOR_PROPERTIES* pActual);
CMemAllocator(__in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *);
#ifdef UNICODE
@@ -1570,8 +1579,8 @@ public:
// helper used by IAMovieSetup implementation
STDAPI
AMovieSetupRegisterFilter( const AMOVIESETUP_FILTER * const psetupdata
- , IFilterMapper * pIFM
- , BOOL bRegister );
+ , IFilterMapper * pIFM
+ , BOOL bRegister );
///////////////////////////////////////////////////////////////////////////
diff --git a/thirdparties/win32/include/directshow/cache.h b/thirdparties/win32/include/directshow/cache.h
index a2d5752..4a38253 100755
--- a/thirdparties/win32/include/directshow/cache.h
+++ b/thirdparties/win32/include/directshow/cache.h
@@ -31,7 +31,8 @@
#define __CACHE__
-class CCache : CBaseObject {
+class CCache : CBaseObject
+{
/* Make copy constructor and assignment operator inaccessible */
@@ -67,7 +68,9 @@ public:
void RemoveAll(void);
/* Return the cache size which is set during construction */
- INT GetCacheSize(void) const {return m_iCacheSize;};
+ INT GetCacheSize(void) const {
+ return m_iCacheSize;
+ };
};
#endif /* __CACHE__ */
diff --git a/thirdparties/win32/include/directshow/checkbmi.h b/thirdparties/win32/include/directshow/checkbmi.h
index 9761dae..882d3fc 100755
--- a/thirdparties/win32/include/directshow/checkbmi.h
+++ b/thirdparties/win32/include/directshow/checkbmi.h
@@ -8,7 +8,8 @@ extern "C" {
#endif
// Helper
-__inline BOOL MultiplyCheckOverflow(DWORD a, DWORD b, __deref_out_range(==, a * b) DWORD *pab) {
+__inline BOOL MultiplyCheckOverflow(DWORD a, DWORD b, __deref_out_range(==, a * b) DWORD *pab)
+{
*pab = a * b;
if ((a == 0) || (((*pab) / a) == b)) {
return TRUE;
@@ -43,8 +44,8 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader(
// Reject bad parameters - do the size check first to avoid reading bad memory
if (cbSize < sizeof(BITMAPINFOHEADER) ||
- pbmi->biSize < sizeof(BITMAPINFOHEADER) ||
- pbmi->biSize > 4096) {
+ pbmi->biSize < sizeof(BITMAPINFOHEADER) ||
+ pbmi->biSize > 4096) {
return FALSE;
}
@@ -78,7 +79,7 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader(
// Also don't allow huge values > 1GB which might cause arithmetic
// errors for users
if (dwSizeImage > 0x40000000 ||
- pbmi->biSizeImage > 0x40000000) {
+ pbmi->biSizeImage > 0x40000000) {
return FALSE;
}
@@ -89,13 +90,14 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader(
if (pbmi->biClrUsed == 0 && pbmi->biBitCount <= 8 && pbmi->biBitCount > 0) {
dwClrUsed = (1 << pbmi->biBitCount);
- } else {
+ }
+ else {
dwClrUsed = pbmi->biClrUsed;
}
// Check total size
if (cbSize < pbmi->biSize + dwClrUsed * sizeof(RGBQUAD) +
- (pbmi->biCompression == BI_BITFIELDS ? 3 * sizeof(DWORD) : 0)) {
+ (pbmi->biCompression == BI_BITFIELDS ? 3 * sizeof(DWORD) : 0)) {
return FALSE;
}
diff --git a/thirdparties/win32/include/directshow/combase.h b/thirdparties/win32/include/directshow/combase.h
index 44ca535..c917923 100755
--- a/thirdparties/win32/include/directshow/combase.h
+++ b/thirdparties/win32/include/directshow/combase.h
@@ -113,13 +113,12 @@ AMOVIESETUP_MEDIATYPE, * PAMOVIESETUP_MEDIATYPE, * FAR LPAMOVIESETUP_MEDIATYPE;
typedef REGFILTERPINS
AMOVIESETUP_PIN, * PAMOVIESETUP_PIN, * FAR LPAMOVIESETUP_PIN;
-typedef struct _AMOVIESETUP_FILTER
-{
- const CLSID * clsID;
- const WCHAR * strName;
- DWORD dwMerit;
- UINT nPins;
- const AMOVIESETUP_PIN * lpPin;
+typedef struct _AMOVIESETUP_FILTER {
+ const CLSID * clsID;
+ const WCHAR * strName;
+ DWORD dwMerit;
+ UINT nPins;
+ const AMOVIESETUP_PIN * lpPin;
}
AMOVIESETUP_FILTER, * PAMOVIESETUP_FILTER, * FAR LPAMOVIESETUP_FILTER;
@@ -198,7 +197,7 @@ public:
support, and an implementation of the core non delegating IUnknown */
class AM_NOVTABLE CUnknown : public INonDelegatingUnknown,
- public CBaseObject
+ public CBaseObject
{
private:
const LPUNKNOWN m_pUnknown; /* Owner of this object */
@@ -257,7 +256,8 @@ typedef void (CALLBACK *LPFNInitRoutine)(BOOL bLoading, const CLSID *rclsid);
/* Create one of these per object class in an array so that
the default class factory code can create new instances */
-class CFactoryTemplate {
+class CFactoryTemplate
+{
public:
diff --git a/thirdparties/win32/include/directshow/cprop.h b/thirdparties/win32/include/directshow/cprop.h
index a030f8f..99151f0 100755
--- a/thirdparties/win32/include/directshow/cprop.h
+++ b/thirdparties/win32/include/directshow/cprop.h
@@ -58,7 +58,7 @@ public:
#ifdef UNICODE
CBasePropertyPage(__in_opt LPCSTR pName,
__inout_opt LPUNKNOWN pUnk,
- int DialogId,
+ int DialogId,
int TitleId);
#endif
virtual ~CBasePropertyPage() { };
@@ -66,11 +66,21 @@ public:
// Override these virtual methods
- virtual HRESULT OnConnect(IUnknown *pUnknown) { return NOERROR; };
- virtual HRESULT OnDisconnect() { return NOERROR; };
- virtual HRESULT OnActivate() { return NOERROR; };
- virtual HRESULT OnDeactivate() { return NOERROR; };
- virtual HRESULT OnApplyChanges() { return NOERROR; };
+ virtual HRESULT OnConnect(IUnknown *pUnknown) {
+ return NOERROR;
+ };
+ virtual HRESULT OnDisconnect() {
+ return NOERROR;
+ };
+ virtual HRESULT OnActivate() {
+ return NOERROR;
+ };
+ virtual HRESULT OnDeactivate() {
+ return NOERROR;
+ };
+ virtual HRESULT OnApplyChanges() {
+ return NOERROR;
+ };
virtual INT_PTR OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
// These implement an IPropertyPage interface
@@ -85,10 +95,16 @@ public:
STDMETHODIMP SetObjects(ULONG cObjects, __in_ecount_opt(cObjects) LPUNKNOWN *ppUnk);
STDMETHODIMP Show(UINT nCmdShow);
STDMETHODIMP Move(LPCRECT prect);
- STDMETHODIMP IsPageDirty(void) { return m_bDirty ? S_OK : S_FALSE; }
+ STDMETHODIMP IsPageDirty(void) {
+ return m_bDirty ? S_OK : S_FALSE;
+ }
STDMETHODIMP Apply(void);
- STDMETHODIMP Help(LPCWSTR lpszHelpDir) { return E_NOTIMPL; }
- STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg) { return E_NOTIMPL; }
+ STDMETHODIMP Help(LPCWSTR lpszHelpDir) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg) {
+ return E_NOTIMPL;
+ }
};
#endif // __CPROP__
diff --git a/thirdparties/win32/include/directshow/ctlutil.h b/thirdparties/win32/include/directshow/ctlutil.h
index e3f7085..e851339 100755
--- a/thirdparties/win32/include/directshow/ctlutil.h
+++ b/thirdparties/win32/include/directshow/ctlutil.h
@@ -36,17 +36,17 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- REFIID riid,
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ REFIID riid,
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
};
@@ -69,26 +69,26 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
};
@@ -111,26 +111,26 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
};
@@ -155,26 +155,26 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
};
@@ -183,20 +183,19 @@ public:
// and REFERENCE_TIME (essentially a LONGLONG) within filters.
// this class converts between the two
-class COARefTime : public CRefTime {
+class COARefTime : public CRefTime
+{
public:
COARefTime() {
};
COARefTime(CRefTime t)
- : CRefTime(t)
- {
+ : CRefTime(t) {
};
COARefTime(REFERENCE_TIME t)
- : CRefTime(t)
- {
+ : CRefTime(t) {
};
COARefTime(double d) {
@@ -221,53 +220,43 @@ public:
return *this;
}
- inline BOOL operator==(const COARefTime& rt)
- {
+ inline BOOL operator==(const COARefTime& rt) {
return m_time == rt.m_time;
};
- inline BOOL operator!=(const COARefTime& rt)
- {
+ inline BOOL operator!=(const COARefTime& rt) {
return m_time != rt.m_time;
};
- inline BOOL operator < (const COARefTime& rt)
- {
+ inline BOOL operator < (const COARefTime& rt) {
return m_time < rt.m_time;
};
- inline BOOL operator > (const COARefTime& rt)
- {
+ inline BOOL operator > (const COARefTime& rt) {
return m_time > rt.m_time;
};
- inline BOOL operator >= (const COARefTime& rt)
- {
+ inline BOOL operator >= (const COARefTime& rt) {
return m_time >= rt.m_time;
};
- inline BOOL operator <= (const COARefTime& rt)
- {
+ inline BOOL operator <= (const COARefTime& rt) {
return m_time <= rt.m_time;
};
- inline COARefTime operator+(const COARefTime& rt)
- {
+ inline COARefTime operator+(const COARefTime& rt) {
return COARefTime(m_time + rt.m_time);
};
- inline COARefTime operator-(const COARefTime& rt)
- {
+ inline COARefTime operator-(const COARefTime& rt) {
return COARefTime(m_time - rt.m_time);
};
- inline COARefTime operator*(LONG l)
- {
+ inline COARefTime operator*(LONG l) {
return COARefTime(m_time * l);
};
- inline COARefTime operator/(LONG l)
- {
+ inline COARefTime operator/(LONG l) {
return COARefTime(m_time / l);
};
@@ -327,12 +316,12 @@ public:
STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat);
STDMETHODIMP IsFormatSupported( const GUID * pFormat);
STDMETHODIMP QueryPreferredFormat( __out GUID *pFormat);
- STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget,
+ STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget,
__in_opt const GUID * pTargetFormat,
- LONGLONG Source,
+ LONGLONG Source,
__in_opt const GUID * pSourceFormat );
STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags
- , __inout_opt LONGLONG * pStop, DWORD StopFlags );
+ , __inout_opt LONGLONG * pStop, DWORD StopFlags );
STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );
STDMETHODIMP GetCurrentPosition( __out LONGLONG * pCurrent );
@@ -410,26 +399,26 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
};
@@ -453,31 +442,30 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
STDMETHODIMP GetPreferredAspectRatio(
- __out long *plAspectX,
- __out long *plAspectY)
- {
+ __out long *plAspectX,
+ __out long *plAspectY) {
return E_NOTIMPL;
}
};
@@ -503,26 +491,26 @@ public:
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
STDMETHODIMP GetTypeInfo(
- UINT itinfo,
- LCID lcid,
- __deref_out ITypeInfo ** pptinfo);
+ UINT itinfo,
+ LCID lcid,
+ __deref_out ITypeInfo ** pptinfo);
STDMETHODIMP GetIDsOfNames(
- REFIID riid,
- __in_ecount(cNames) LPOLESTR * rgszNames,
- UINT cNames,
- LCID lcid,
- __out_ecount(cNames) DISPID * rgdispid);
+ REFIID riid,
+ __in_ecount(cNames) LPOLESTR * rgszNames,
+ UINT cNames,
+ LCID lcid,
+ __out_ecount(cNames) DISPID * rgdispid);
STDMETHODIMP Invoke(
- DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- __in DISPPARAMS * pdispparams,
- __out_opt VARIANT * pvarResult,
- __out_opt EXCEPINFO * pexcepinfo,
- __out_opt UINT * puArgErr);
+ DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ __in DISPPARAMS * pdispparams,
+ __out_opt VARIANT * pvarResult,
+ __out_opt EXCEPINFO * pexcepinfo,
+ __out_opt UINT * puArgErr);
};
@@ -591,13 +579,13 @@ public:
STDMETHODIMP GetCurrentPosition(__out LONGLONG *pCurrent);
STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities );
STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities );
- STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget,
+ STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget,
__in_opt const GUID * pTargetFormat,
- LONGLONG Source,
+ LONGLONG Source,
__in_opt const GUID * pSourceFormat );
STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags
- , __inout_opt LONGLONG * pStop, DWORD StopFlags );
+ , __inout_opt LONGLONG * pStop, DWORD StopFlags );
STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );
@@ -667,7 +655,7 @@ public:
class CDeferredCommand
: public CUnknown,
- public IDeferredCommand
+ public IDeferredCommand
{
public:
@@ -685,7 +673,7 @@ public:
__out VARIANT* pvarResult,
__out short* puArgErr,
BOOL bStream
- );
+ );
DECLARE_IUNKNOWN
@@ -695,11 +683,11 @@ public:
// IDeferredCommand methods
STDMETHODIMP Cancel();
STDMETHODIMP Confidence(
- __out LONG* pConfidence);
+ __out LONG* pConfidence);
STDMETHODIMP Postpone(
- REFTIME newtime);
+ REFTIME newtime);
STDMETHODIMP GetHResult(
- __out HRESULT* phrResult);
+ __out HRESULT* phrResult);
// other public methods
@@ -709,7 +697,7 @@ public:
// returns TRUE if streamtime, FALSE if presentation time
BOOL IsStreamTime() {
- return m_bStream;
+ return m_bStream;
};
CRefTime GetTime() {
diff --git a/thirdparties/win32/include/directshow/ddmm.h b/thirdparties/win32/include/directshow/ddmm.h
index c773d58..b11f1e8 100755
--- a/thirdparties/win32/include/directshow/ddmm.h
+++ b/thirdparties/win32/include/directshow/ddmm.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// File: DDMM.h
//
-// Desc: DirectShow base classes - efines routines for using DirectDraw
+// Desc: DirectShow base classes - efines routines for using DirectDraw
// on a multimonitor system.
//
// Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved.
diff --git a/thirdparties/win32/include/directshow/dllsetup.h b/thirdparties/win32/include/directshow/dllsetup.h
index aaac2ec..73babf2 100755
--- a/thirdparties/win32/include/directshow/dllsetup.h
+++ b/thirdparties/win32/include/directshow/dllsetup.h
@@ -41,6 +41,6 @@ STDAPI EliminateSubKey( HKEY, LPCTSTR );
STDAPI
AMovieSetupRegisterFilter2( const AMOVIESETUP_FILTER * const psetupdata
- , IFilterMapper2 * pIFM2
- , BOOL bRegister );
+ , IFilterMapper2 * pIFM2
+ , BOOL bRegister );
diff --git a/thirdparties/win32/include/directshow/dsschedule.h b/thirdparties/win32/include/directshow/dsschedule.h
index a81c576..8348f7b 100755
--- a/thirdparties/win32/include/directshow/dsschedule.h
+++ b/thirdparties/win32/include/directshow/dsschedule.h
@@ -31,7 +31,9 @@ public:
REFERENCE_TIME Advise( const REFERENCE_TIME & rtTime );
// Get the event handle which will be set if advise time requires re-evaluation.
- HANDLE GetEvent() const { return m_ev; }
+ HANDLE GetEvent() const {
+ return m_ev;
+ }
private:
// We define the nodes that will be used in our singly linked list
@@ -40,8 +42,8 @@ private:
class CAdvisePacket
{
public:
- CAdvisePacket()
- {}
+ CAdvisePacket() {
+ }
CAdvisePacket * m_next;
DWORD_PTR m_dwAdviseCookie;
@@ -50,40 +52,40 @@ private:
HANDLE m_hNotify; // Handle to event or semephore
BOOL m_bPeriodic; // TRUE => Periodic event
- CAdvisePacket( CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time)
- {}
+ CAdvisePacket( CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) {
+ }
- void InsertAfter( CAdvisePacket * p )
- {
+ void InsertAfter( CAdvisePacket * p ) {
p->m_next = m_next;
m_next = p;
}
- int IsZ() const // That is, is it the node that represents the end of the list
- { return m_next == 0; }
+ int IsZ() const { // That is, is it the node that represents the end of the list
+ return m_next == 0;
+ }
- CAdvisePacket * RemoveNext()
- {
+ CAdvisePacket * RemoveNext() {
CAdvisePacket *const next = m_next;
CAdvisePacket *const new_next = next->m_next;
m_next = new_next;
return next;
}
- void DeleteNext()
- {
+ void DeleteNext() {
delete RemoveNext();
}
- CAdvisePacket * Next() const
- {
+ CAdvisePacket * Next() const {
CAdvisePacket * result = m_next;
- if (result->IsZ()) result = 0;
+ if (result->IsZ()) {
+ result = 0;
+ }
return result;
}
- DWORD_PTR Cookie() const
- { return m_dwAdviseCookie; }
+ DWORD_PTR Cookie() const {
+ return m_dwAdviseCookie;
+ }
};
// Structure is:
diff --git a/thirdparties/win32/include/directshow/dxmperf.h b/thirdparties/win32/include/directshow/dxmperf.h
index dc58ad7..29b4859 100755
--- a/thirdparties/win32/include/directshow/dxmperf.h
+++ b/thirdparties/win32/include/directshow/dxmperf.h
@@ -19,7 +19,8 @@ extern "C" unsigned __int64 __getReg( int whichReg );
#endif // _IA64_
-inline ULONGLONG _RDTSC( void ) {
+inline ULONGLONG _RDTSC( void )
+{
#ifdef _X86_
LARGE_INTEGER li;
__asm {
@@ -216,7 +217,7 @@ inline ULONGLONG _RDTSC( void ) {
perfData.data.sampleDuration = (msecs); \
PerflogTraceEvent ((PEVENT_TRACE_HEADER) &perfData); \
} \
-
+
inline
VOID PERFLOG_STREAMTRACE(
@@ -227,10 +228,9 @@ VOID PERFLOG_STREAMTRACE(
ULONGLONG Data2,
ULONGLONG Data3,
ULONGLONG Data4
- )
+)
{
- if (Level <= PerflogModuleLevel)
- {
+ if (Level <= PerflogModuleLevel) {
PERFINFO_WMI_STREAMTRACE perfData;
memset( &perfData, 0, sizeof( perfData ) );
perfData.header.Size = sizeof( perfData );
diff --git a/thirdparties/win32/include/directshow/fourcc.h b/thirdparties/win32/include/directshow/fourcc.h
index f4f71e9..168396c 100755
--- a/thirdparties/win32/include/directshow/fourcc.h
+++ b/thirdparties/win32/include/directshow/fourcc.h
@@ -51,7 +51,8 @@ private:
#define GUID_Data4_2 0x719b3800
inline void
-FOURCCMap::InitGUID() {
+FOURCCMap::InitGUID()
+{
Data2 = GUID_Data2;
Data3 = GUID_Data3;
((DWORD *)Data4)[0] = GUID_Data4_1;
@@ -59,7 +60,8 @@ FOURCCMap::InitGUID() {
}
inline
-FOURCCMap::FOURCCMap() {
+FOURCCMap::FOURCCMap()
+{
InitGUID();
SetFOURCC( DWORD(0));
}
diff --git a/thirdparties/win32/include/directshow/msgthrd.h b/thirdparties/win32/include/directshow/msgthrd.h
index 208f03c..16ab25e 100755
--- a/thirdparties/win32/include/directshow/msgthrd.h
+++ b/thirdparties/win32/include/directshow/msgthrd.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// File: MsgThrd.h
//
-// Desc: DirectShow base classes - provides support for a worker thread
+// Desc: DirectShow base classes - provides support for a worker thread
// class to which one can asynchronously post messages.
//
// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
@@ -10,7 +10,8 @@
// Message class - really just a structure.
//
-class CMsg {
+class CMsg
+{
public:
UINT uMsg;
DWORD dwFlags;
@@ -29,7 +30,8 @@ public:
// that it is prompted to perform particaular tasks by responding to messages
// posted to its message queue.
//
-class AM_NOVTABLE CMsgThread {
+class AM_NOVTABLE CMsgThread
+{
private:
static DWORD WINAPI DefaultThreadProc(__inout LPVOID lpParam);
DWORD m_ThreadId;
@@ -47,13 +49,12 @@ protected:
public:
CMsgThread()
: m_ThreadId(0),
- m_hThread(NULL),
- m_lWaiting(0),
- m_hSem(NULL),
- // make a list with a cache of 5 items
- m_ThreadQueue(NAME("MsgThread list"), 5)
- {
- }
+ m_hThread(NULL),
+ m_lWaiting(0),
+ m_hSem(NULL),
+ // make a list with a cache of 5 items
+ m_ThreadQueue(NAME("MsgThread list"), 5) {
+ }
~CMsgThread();
// override this if you want to block on other things as well
diff --git a/thirdparties/win32/include/directshow/mtype.h b/thirdparties/win32/include/directshow/mtype.h
index 9402f06..0a5d189 100755
--- a/thirdparties/win32/include/directshow/mtype.h
+++ b/thirdparties/win32/include/directshow/mtype.h
@@ -15,7 +15,8 @@
types etc. Has same data members as the struct AM_MEDIA_TYPE defined
in the streams IDL file, but also has (non-virtual) functions */
-class CMediaType : public _AMMediaType {
+class CMediaType : public _AMMediaType
+{
public:
@@ -36,13 +37,21 @@ public:
BOOL IsValid() const;
- const GUID *Type() const { return &majortype;} ;
+ const GUID *Type() const {
+ return &majortype;
+ } ;
void SetType(const GUID *);
- const GUID *Subtype() const { return &subtype;} ;
+ const GUID *Subtype() const {
+ return &subtype;
+ } ;
void SetSubtype(const GUID *);
- BOOL IsFixedSize() const {return bFixedSizeSamples; };
- BOOL IsTemporalCompressed() const {return bTemporalCompression; };
+ BOOL IsFixedSize() const {
+ return bFixedSizeSamples;
+ };
+ BOOL IsTemporalCompressed() const {
+ return bTemporalCompression;
+ };
ULONG GetSampleSize() const;
void SetSampleSize(ULONG sz);
@@ -52,11 +61,17 @@ public:
// read/write pointer to format - can't change length without
// calling SetFormat, AllocFormatBuffer or ReallocFormatBuffer
- BYTE* Format() const {return pbFormat; };
- ULONG FormatLength() const { return cbFormat; };
+ BYTE* Format() const {
+ return pbFormat;
+ };
+ ULONG FormatLength() const {
+ return cbFormat;
+ };
void SetFormatType(const GUID *);
- const GUID *FormatType() const {return &formattype; };
+ const GUID *FormatType() const {
+ return &formattype;
+ };
BOOL SetFormat(__in_bcount(length) BYTE *pFormat, ULONG length);
void ResetFormatBuffer();
BYTE* AllocFormatBuffer(ULONG length);
diff --git a/thirdparties/win32/include/directshow/outputq.h b/thirdparties/win32/include/directshow/outputq.h
index 7e60b53..b3cec61 100755
--- a/thirdparties/win32/include/directshow/outputq.h
+++ b/thirdparties/win32/include/directshow/outputq.h
@@ -2,7 +2,7 @@
// File: OutputQ.h
//
// Desc: DirectShow base classes - defines the COutputQueue class, which
-// makes a queue of samples and sends them to an output pin. The
+// makes a queue of samples and sends them to an output pin. The
// class will optionally send the samples to the pin directly.
//
// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
@@ -19,13 +19,13 @@ public:
__inout HRESULT *phr, // 'Return code'
BOOL bAuto = TRUE, // Ask pin if blocks
BOOL bQueue = TRUE, // Send through queue (ignored if
- // bAuto set)
+ // bAuto set)
LONG lBatchSize = 1, // Batch
BOOL bBatchExact = FALSE,// Batch exactly to BatchSize
LONG lListSize = // Likely number in the list
- DEFAULTCACHE,
+ DEFAULTCACHE,
DWORD dwPriority = // Priority of thread to create
- THREAD_PRIORITY_NORMAL,
+ THREAD_PRIORITY_NORMAL,
bool bFlushingOpt = false // flushing optimization
);
~COutputQueue();
@@ -35,16 +35,16 @@ public:
// re-enable receives (pass this downstream)
void EndFlush(); // Complete flush of samples - downstream
- // pin guaranteed not to block at this stage
+ // pin guaranteed not to block at this stage
void EOS(); // Call this on End of stream
void SendAnyway(); // Send batched samples anyway (if bBatchExact set)
void NewSegment(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop,
- double dRate);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
HRESULT Receive(IMediaSample *pSample);
@@ -65,16 +65,14 @@ public:
protected:
static DWORD WINAPI InitialThreadProc(__in LPVOID pv);
DWORD ThreadProc();
- BOOL IsQueued()
- {
+ BOOL IsQueued() {
return m_List != NULL;
};
// The critical section MUST be held when this is called
void QueueSample(IMediaSample *pSample);
- BOOL IsSpecialSample(IMediaSample *pSample)
- {
+ BOOL IsSpecialSample(IMediaSample *pSample) {
return (DWORD_PTR)pSample > (DWORD_PTR)(LONG_PTR)(-16);
};
@@ -87,10 +85,10 @@ protected:
protected:
// Queue 'messages'
- #define SEND_PACKET ((IMediaSample *)(LONG_PTR)(-2)) // Send batch
- #define EOS_PACKET ((IMediaSample *)(LONG_PTR)(-3)) // End of stream
- #define RESET_PACKET ((IMediaSample *)(LONG_PTR)(-4)) // Reset m_hr
- #define NEW_SEGMENT ((IMediaSample *)(LONG_PTR)(-5)) // send NewSegment
+#define SEND_PACKET ((IMediaSample *)(LONG_PTR)(-2)) // Send batch
+#define EOS_PACKET ((IMediaSample *)(LONG_PTR)(-3)) // End of stream
+#define RESET_PACKET ((IMediaSample *)(LONG_PTR)(-4)) // Reset m_hr
+#define NEW_SEGMENT ((IMediaSample *)(LONG_PTR)(-5)) // send NewSegment
// new segment packet is always followed by one of these
struct NewSegmentPacket {
diff --git a/thirdparties/win32/include/directshow/perflog.h b/thirdparties/win32/include/directshow/perflog.h
index 05d6404..7d2ca39 100755
--- a/thirdparties/win32/include/directshow/perflog.h
+++ b/thirdparties/win32/include/directshow/perflog.h
@@ -17,22 +17,22 @@ BOOL
PerflogInitIfEnabled(
IN HINSTANCE hInstance,
__in PPERFLOG_LOGGING_PARAMS LogParams
- );
+);
BOOL
PerflogInitialize (
__in PPERFLOG_LOGGING_PARAMS LogParams
- );
+);
VOID
PerflogShutdown (
VOID
- );
+);
VOID
PerflogTraceEvent (
__in PEVENT_TRACE_HEADER Event
- );
+);
extern ULONG PerflogEnableFlags;
extern UCHAR PerflogEnableLevel;
@@ -48,9 +48,9 @@ VOID
PerflogTraceEventLevel(
ULONG Level,
__in PEVENT_TRACE_HEADER Event
- );
+);
VOID
PerflogTraceEvent (
__in PEVENT_TRACE_HEADER Event
- );
+);
diff --git a/thirdparties/win32/include/directshow/perfstruct.h b/thirdparties/win32/include/directshow/perfstruct.h
index b57657c..3c365e4 100755
--- a/thirdparties/win32/include/directshow/perfstruct.h
+++ b/thirdparties/win32/include/directshow/perfstruct.h
@@ -15,49 +15,49 @@
// {28CF047A-2437-4b24-B653-B9446A419A69}
DEFINE_GUID(GUID_DSHOW_CTL,
-0x28cf047a, 0x2437, 0x4b24, 0xb6, 0x53, 0xb9, 0x44, 0x6a, 0x41, 0x9a, 0x69);
+ 0x28cf047a, 0x2437, 0x4b24, 0xb6, 0x53, 0xb9, 0x44, 0x6a, 0x41, 0x9a, 0x69);
// {D0DA7AD6-AE80-4de5-AAFC-C126711E7593}
DEFINE_GUID(GUID_VIDEOREND,
-0xd0da7ad6, 0xae80, 0x4de5, 0xaa, 0xfc, 0xc1, 0x26, 0x71, 0x1e, 0x75, 0x93);
+ 0xd0da7ad6, 0xae80, 0x4de5, 0xaa, 0xfc, 0xc1, 0x26, 0x71, 0x1e, 0x75, 0x93);
// {DC70AC3E-93E5-48db-88AB-E42064EC276A}
DEFINE_GUID(GUID_DSOUNDGLITCH,
-0xdc70ac3e, 0x93e5, 0x48db, 0x88, 0xab, 0xe4, 0x20, 0x64, 0xec, 0x27, 0x6a);
+ 0xdc70ac3e, 0x93e5, 0x48db, 0x88, 0xab, 0xe4, 0x20, 0x64, 0xec, 0x27, 0x6a);
// {3d7e7d93-2fc8-4a07-a719-e0922ff2899}
DEFINE_GUID(GUID_STREAMTRACE,
-0x3d7e7d93, 0x2fc8, 0x4a07, 0xa7, 0x19, 0xe0, 0x92, 0x2f, 0xf2, 0x89, 0x9e);
+ 0x3d7e7d93, 0x2fc8, 0x4a07, 0xa7, 0x19, 0xe0, 0x92, 0x2f, 0xf2, 0x89, 0x9e);
// AZFIX: the following GUIDs aren't useful right now.
// {3C33F7F5-EE54-493c-BA25-1656539C05AC}
DEFINE_GUID(GUID_GETTIME,
-0x3c33f7f5, 0xee54, 0x493c, 0xba, 0x25, 0x16, 0x56, 0x53, 0x9c, 0x5, 0xac);
+ 0x3c33f7f5, 0xee54, 0x493c, 0xba, 0x25, 0x16, 0x56, 0x53, 0x9c, 0x5, 0xac);
// {CC44B44D-8169-4952-9E4A-A4E13295E492}
DEFINE_GUID(GUID_AUDIOREND,
-0xcc44b44d, 0x8169, 0x4952, 0x9e, 0x4a, 0xa4, 0xe1, 0x32, 0x95, 0xe4, 0x92);
+ 0xcc44b44d, 0x8169, 0x4952, 0x9e, 0x4a, 0xa4, 0xe1, 0x32, 0x95, 0xe4, 0x92);
// {775D19BF-4D8B-4de6-8DC9-66BAC7B310A2}
DEFINE_GUID(GUID_FRAMEDROP,
-0x775d19bf, 0x4d8b, 0x4de6, 0x8d, 0xc9, 0x66, 0xba, 0xc7, 0xb3, 0x10, 0xa2);
+ 0x775d19bf, 0x4d8b, 0x4de6, 0x8d, 0xc9, 0x66, 0xba, 0xc7, 0xb3, 0x10, 0xa2);
// {56D29065-EFBE-42dc-8C29-E325DC9C27D5}
DEFINE_GUID(GUID_AUDIOBREAK,
-0x56d29065, 0xefbe, 0x42dc, 0x8c, 0x29, 0xe3, 0x25, 0xdc, 0x9c, 0x27, 0xd5);
+ 0x56d29065, 0xefbe, 0x42dc, 0x8c, 0x29, 0xe3, 0x25, 0xdc, 0x9c, 0x27, 0xd5);
// {E1E6EA87-95A8-497e-BFBA-0295AEBCC707}
DEFINE_GUID(GUID_AUDIORECV,
-0xe1e6ea87, 0x95a8, 0x497e, 0xbf, 0xba, 0x2, 0x95, 0xae, 0xbc, 0xc7, 0x7);
+ 0xe1e6ea87, 0x95a8, 0x497e, 0xbf, 0xba, 0x2, 0x95, 0xae, 0xbc, 0xc7, 0x7);
// {10F7768A-B1E7-4242-AD90-A2D44683D9F0}
DEFINE_GUID(GUID_AUDIOSLAVE,
-0x10f7768a, 0xb1e7, 0x4242, 0xad, 0x90, 0xa2, 0xd4, 0x46, 0x83, 0xd9, 0xf0);
+ 0x10f7768a, 0xb1e7, 0x4242, 0xad, 0x90, 0xa2, 0xd4, 0x46, 0x83, 0xd9, 0xf0);
// {8983803D-691A-49bc-8FF6-962A39C0198F}
DEFINE_GUID(GUID_AUDIOADDBREAK,
-0x8983803d, 0x691a, 0x49bc, 0x8f, 0xf6, 0x96, 0x2a, 0x39, 0xc0, 0x19, 0x8f);
+ 0x8983803d, 0x691a, 0x49bc, 0x8f, 0xf6, 0x96, 0x2a, 0x39, 0xc0, 0x19, 0x8f);
#define GLITCHTYPE_DSOUNDFIRSTGOOD 0
#define GLITCHTYPE_DSOUNDFIRSTBAD 1
diff --git a/thirdparties/win32/include/directshow/pstream.h b/thirdparties/win32/include/directshow/pstream.h
index 2e278ab..a7a7db8 100755
--- a/thirdparties/win32/include/directshow/pstream.h
+++ b/thirdparties/win32/include/directshow/pstream.h
@@ -44,60 +44,71 @@
// Implements IPersistStream.
// See 'OLE Programmers Reference (Vol 1):Structured Storage Overview' for
// more implementation information.
-class CPersistStream : public IPersistStream {
- private:
+class CPersistStream : public IPersistStream
+{
+private:
- // Internal state:
+ // Internal state:
- protected:
- DWORD mPS_dwFileVersion; // version number of file (being read)
- BOOL mPS_fDirty;
+protected:
+ DWORD mPS_dwFileVersion; // version number of file (being read)
+ BOOL mPS_fDirty;
- public:
+public:
- // IPersistStream methods
+ // IPersistStream methods
- STDMETHODIMP IsDirty()
- {return (mPS_fDirty ? S_OK : S_FALSE);} // note FALSE means clean
- STDMETHODIMP Load(LPSTREAM pStm);
- STDMETHODIMP Save(LPSTREAM pStm, BOOL fClearDirty);
- STDMETHODIMP GetSizeMax(__out ULARGE_INTEGER * pcbSize)
- // Allow 24 bytes for version.
- { pcbSize->QuadPart = 12*sizeof(WCHAR)+SizeMax(); return NOERROR; }
+ STDMETHODIMP IsDirty() {
+ return (mPS_fDirty ? S_OK : S_FALSE); // note FALSE means clean
+ }
+ STDMETHODIMP Load(LPSTREAM pStm);
+ STDMETHODIMP Save(LPSTREAM pStm, BOOL fClearDirty);
+ STDMETHODIMP GetSizeMax(__out ULARGE_INTEGER * pcbSize)
+ // Allow 24 bytes for version.
+ {
+ pcbSize->QuadPart = 12*sizeof(WCHAR)+SizeMax();
+ return NOERROR;
+ }
- // implementation
+ // implementation
- CPersistStream(IUnknown *punk, __inout HRESULT *phr);
- ~CPersistStream();
+ CPersistStream(IUnknown *punk, __inout HRESULT *phr);
+ ~CPersistStream();
- HRESULT SetDirty(BOOL fDirty)
- { mPS_fDirty = fDirty; return NOERROR;}
+ HRESULT SetDirty(BOOL fDirty) {
+ mPS_fDirty = fDirty;
+ return NOERROR;
+ }
- // override to reveal IPersist & IPersistStream
- // STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ // override to reveal IPersist & IPersistStream
+ // STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- // --- IPersist ---
+ // --- IPersist ---
- // You must override this to provide your own class id
- STDMETHODIMP GetClassID(__out CLSID *pClsid) PURE;
+ // You must override this to provide your own class id
+ STDMETHODIMP GetClassID(__out CLSID *pClsid) PURE;
- // overrideable if you want
- // file version number. Override it if you ever change format
- virtual DWORD GetSoftwareVersion(void) { return 0; }
+ // overrideable if you want
+ // file version number. Override it if you ever change format
+ virtual DWORD GetSoftwareVersion(void) {
+ return 0;
+ }
- //=========================================================================
- // OVERRIDE THESE to read and write your data
- // OVERRIDE THESE to read and write your data
- // OVERRIDE THESE to read and write your data
+ //=========================================================================
+ // OVERRIDE THESE to read and write your data
+ // OVERRIDE THESE to read and write your data
+ // OVERRIDE THESE to read and write your data
- virtual int SizeMax() {return 0;}
- virtual HRESULT WriteToStream(IStream *pStream);
- virtual HRESULT ReadFromStream(IStream *pStream);
- //=========================================================================
+ virtual int SizeMax() {
+ return 0;
+ }
+ virtual HRESULT WriteToStream(IStream *pStream);
+ virtual HRESULT ReadFromStream(IStream *pStream);
+ //=========================================================================
- private:
+private:
};
diff --git a/thirdparties/win32/include/directshow/pullpin.h b/thirdparties/win32/include/directshow/pullpin.h
index db4f407..e79f595 100755
--- a/thirdparties/win32/include/directshow/pullpin.h
+++ b/thirdparties/win32/include/directshow/pullpin.h
@@ -30,9 +30,9 @@ class CPullPin : public CAMThread
BOOL m_bSync;
enum ThreadMsg {
- TM_Pause, // stop pulling and wait for next message
- TM_Start, // start pulling
- TM_Exit, // stop and exit
+ TM_Pause, // stop pulling and wait for next message
+ TM_Start, // start pulling
+ TM_Exit, // stop and exit
};
ThreadMsg m_State;
@@ -57,18 +57,18 @@ class CPullPin : public CAMThread
// called from ProcessAsync to queue and collect requests
HRESULT QueueSample(
- __inout REFERENCE_TIME& tCurrent,
- REFERENCE_TIME tAlignStop,
- BOOL bDiscontinuity);
+ __inout REFERENCE_TIME& tCurrent,
+ REFERENCE_TIME tAlignStop,
+ BOOL bDiscontinuity);
HRESULT CollectAndDeliver(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop);
HRESULT DeliverSample(
- IMediaSample* pSample,
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop);
+ IMediaSample* pSample,
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop);
protected:
IMemAllocator * m_pAlloc;
@@ -94,8 +94,8 @@ public:
// optional IMemAllocator interface is offered as a preferred allocator
// but no error occurs if it can't be met.
virtual HRESULT DecideAllocator(
- IMemAllocator* pAlloc,
- __inout_opt ALLOCATOR_PROPERTIES * pProps);
+ IMemAllocator* pAlloc,
+ __inout_opt ALLOCATOR_PROPERTIES * pProps);
// set start and stop position. if active, will start immediately at
// the new position. Default is 0 to duration
@@ -112,20 +112,20 @@ public:
// helper functions
LONGLONG AlignDown(LONGLONG ll, LONG lAlign) {
- // aligning downwards is just truncation
- return ll & ~(lAlign-1);
+ // aligning downwards is just truncation
+ return ll & ~(lAlign-1);
};
LONGLONG AlignUp(LONGLONG ll, LONG lAlign) {
- // align up: round up to next boundary
- return (ll + (lAlign -1)) & ~(lAlign -1);
+ // align up: round up to next boundary
+ return (ll + (lAlign -1)) & ~(lAlign -1);
};
// GetReader returns the (addrefed) IAsyncReader interface
// for SyncRead etc
IAsyncReader* GetReader() {
- m_pReader->AddRef();
- return m_pReader;
+ m_pReader->AddRef();
+ return m_pReader;
};
// -- pure --
diff --git a/thirdparties/win32/include/directshow/refclock.h b/thirdparties/win32/include/directshow/refclock.h
index df822e0..f310321 100755
--- a/thirdparties/win32/include/directshow/refclock.h
+++ b/thirdparties/win32/include/directshow/refclock.h
@@ -72,14 +72,14 @@ inline LONGLONG WINAPI ConvertToMilliseconds(const REFERENCE_TIME& RT)
*/
class CBaseReferenceClock
-: public CUnknown, public IReferenceClock, public CCritSec, public IReferenceClockTimerControl
+ : public CUnknown, public IReferenceClock, public CCritSec, public IReferenceClockTimerControl
{
protected:
virtual ~CBaseReferenceClock(); // Don't let me be created on the stack!
public:
- CBaseReferenceClock(__in_opt LPCTSTR pName,
- __inout_opt LPUNKNOWN pUnk,
- __inout HRESULT *phr,
+ CBaseReferenceClock(__in_opt LPCTSTR pName,
+ __inout_opt LPUNKNOWN pUnk,
+ __inout HRESULT *phr,
__inout_opt CAMSchedule * pSched = 0 );
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv);
@@ -136,7 +136,9 @@ public:
/* Provide a method for correcting drift */
STDMETHODIMP SetTimeDelta( const REFERENCE_TIME& TimeDelta );
- CAMSchedule * GetSchedule() const { return m_pSchedule; }
+ CAMSchedule * GetSchedule() const {
+ return m_pSchedule;
+ }
// IReferenceClockTimerControl methods
//
@@ -161,8 +163,8 @@ private:
// Thread stuff
public:
- void TriggerThread() // Wakes thread up. Need to do this if
- { // time to next advise needs reevaluating.
+ void TriggerThread() { // Wakes thread up. Need to do this if
+ // time to next advise needs reevaluating.
EXECUTE_ASSERT(SetEvent(m_pSchedule->GetEvent()));
}
diff --git a/thirdparties/win32/include/directshow/reftime.h b/thirdparties/win32/include/directshow/reftime.h
index 0ed32f6..3ddd4ab 100755
--- a/thirdparties/win32/include/directshow/reftime.h
+++ b/thirdparties/win32/include/directshow/reftime.h
@@ -56,56 +56,46 @@ public:
REFERENCE_TIME m_time;
- inline CRefTime()
- {
+ inline CRefTime() {
// default to 0 time
m_time = 0;
};
- inline CRefTime(LONG msecs)
- {
+ inline CRefTime(LONG msecs) {
m_time = MILLISECONDS_TO_100NS_UNITS(msecs);
};
- inline CRefTime(REFERENCE_TIME rt)
- {
+ inline CRefTime(REFERENCE_TIME rt) {
m_time = rt;
};
- inline operator REFERENCE_TIME() const
- {
+ inline operator REFERENCE_TIME() const {
return m_time;
};
- inline CRefTime& operator=(const CRefTime& rt)
- {
+ inline CRefTime& operator=(const CRefTime& rt) {
m_time = rt.m_time;
return *this;
};
- inline CRefTime& operator=(const LONGLONG ll)
- {
+ inline CRefTime& operator=(const LONGLONG ll) {
m_time = ll;
return *this;
};
- inline CRefTime& operator+=(const CRefTime& rt)
- {
+ inline CRefTime& operator+=(const CRefTime& rt) {
return (*this = *this + rt);
};
- inline CRefTime& operator-=(const CRefTime& rt)
- {
+ inline CRefTime& operator-=(const CRefTime& rt) {
return (*this = *this - rt);
};
- inline LONG Millisecs(void)
- {
+ inline LONG Millisecs(void) {
return (LONG)(m_time / (UNITS / MILLISECONDS));
};
- inline LONGLONG GetUnits(void)
- {
+ inline LONGLONG GetUnits(void) {
return m_time;
};
};
diff --git a/thirdparties/win32/include/directshow/renbase.h b/thirdparties/win32/include/directshow/renbase.h
index 8634c6b..dedaea5 100755
--- a/thirdparties/win32/include/directshow/renbase.h
+++ b/thirdparties/win32/include/directshow/renbase.h
@@ -49,8 +49,7 @@ public:
STDMETHODIMP Receive(IMediaSample *pMediaSample);
// Helper
- IMemAllocator inline *Allocator() const
- {
+ IMemAllocator inline *Allocator() const {
return m_pAllocator;
}
};
@@ -86,13 +85,13 @@ protected:
BOOL m_bRepaintStatus; // Can we signal an EC_REPAINT
// Avoid some deadlocks by tracking filter during stop
volatile BOOL m_bInReceive; // Inside Receive between PrepareReceive
- // And actually processing the sample
+ // And actually processing the sample
REFERENCE_TIME m_SignalTime; // Time when we signal EC_COMPLETE
UINT m_EndOfStreamTimer; // Used to signal end of stream
CCritSec m_ObjectCreationLock; // This lock protects the creation and
- // of m_pPosition and m_pInputPin. It
- // ensures that two threads cannot create
- // either object simultaneously.
+ // of m_pPosition and m_pInputPin. It
+ // ensures that two threads cannot create
+ // either object simultaneously.
public:
@@ -119,18 +118,34 @@ public:
// Return internal information about this filter
- BOOL IsEndOfStream() { return m_bEOS; };
- BOOL IsEndOfStreamDelivered() { return m_bEOSDelivered; };
- BOOL IsStreaming() { return m_bStreaming; };
- void SetAbortSignal(BOOL bAbort) { m_bAbort = bAbort; };
+ BOOL IsEndOfStream() {
+ return m_bEOS;
+ };
+ BOOL IsEndOfStreamDelivered() {
+ return m_bEOSDelivered;
+ };
+ BOOL IsStreaming() {
+ return m_bStreaming;
+ };
+ void SetAbortSignal(BOOL bAbort) {
+ m_bAbort = bAbort;
+ };
virtual void OnReceiveFirstSample(IMediaSample *pMediaSample) { };
- CAMEvent *GetRenderEvent() { return &m_RenderEvent; };
+ CAMEvent *GetRenderEvent() {
+ return &m_RenderEvent;
+ };
// Permit access to the transition state
- void Ready() { m_evComplete.Set(); };
- void NotReady() { m_evComplete.Reset(); };
- BOOL CheckReady() { return m_evComplete.Check(); };
+ void Ready() {
+ m_evComplete.Set();
+ };
+ void NotReady() {
+ m_evComplete.Reset();
+ };
+ BOOL CheckReady() {
+ return m_evComplete.Check();
+ };
virtual int GetPinCount();
virtual CBasePin *GetPin(int n);
@@ -152,15 +167,19 @@ public:
virtual void OnRenderStart(IMediaSample *pMediaSample);
virtual void OnRenderEnd(IMediaSample *pMediaSample);
- virtual HRESULT OnStartStreaming() { return NOERROR; };
- virtual HRESULT OnStopStreaming() { return NOERROR; };
+ virtual HRESULT OnStartStreaming() {
+ return NOERROR;
+ };
+ virtual HRESULT OnStopStreaming() {
+ return NOERROR;
+ };
virtual void OnWaitStart() { };
virtual void OnWaitEnd() { };
virtual void PrepareRender() { };
#ifdef PERF
REFERENCE_TIME m_trRenderStart; // Just before we started drawing
- // Set in OnRenderStart, Used in OnRenderEnd
+ // Set in OnRenderStart, Used in OnRenderEnd
int m_idBaseStamp; // MSR_id for frame time stamp
int m_idBaseRenderTime; // MSR_id for true wait time
int m_idBaseAccuracy; // MSR_id for time frame is late (int)
@@ -248,8 +267,8 @@ public:
// Spot the bug in this macro - I can't. but it doesn't work!
class CBaseVideoRenderer : public CBaseRenderer, // Base renderer class
- public IQualProp, // Property page guff
- public IQualityControl // Allow throttling
+ public IQualProp, // Property page guff
+ public IQualityControl // Allow throttling
{
protected:
@@ -271,19 +290,19 @@ protected:
// We therefore need to know whether we are playing frames early or not.
int m_nNormal; // The number of consecutive frames
- // drawn at their normal time (not early)
- // -1 means we just dropped a frame.
+ // drawn at their normal time (not early)
+ // -1 means we just dropped a frame.
#ifdef PERF
BOOL m_bDrawLateFrames; // Don't drop any frames (debug and I'm
- // not keen on people using it!)
+ // not keen on people using it!)
#endif
BOOL m_bSupplierHandlingQuality;// The response to Quality messages says
- // our supplier is handling things.
- // We will allow things to go extra late
- // before dropping frames. We will play
- // very early after he has dropped one.
+ // our supplier is handling things.
+ // We will allow things to go extra late
+ // before dropping frames. We will play
+ // very early after he has dropped one.
// Control of scheduling, frame dropping etc.
// We need to know where the time is being spent so as to tell whether
@@ -313,7 +332,7 @@ protected:
int m_trRenderAvg; // Time frames are taking to blt
int m_trRenderLast; // Time for last frame blt
int m_tRenderStart; // Just before we started drawing (mSec)
- // derived from timeGetTime.
+ // derived from timeGetTime.
// When frames are dropped we will play the next frame as early as we can.
// If it was a false alarm and the machine is fast we slide gently back to
@@ -335,8 +354,8 @@ protected:
// controls whether we bother to drop a frame or whether we reckon that
// we're doing well enough that we can stand a one-frame glitch.
int m_trWaitAvg; // Average of last few wait times
- // (actually we just average how early
- // we were). Negative here means LATE.
+ // (actually we just average how early
+ // we were). Negative here means LATE.
// The average inter-frame time.
// This is used to calculate the proportion of the time used by the
@@ -363,7 +382,7 @@ protected:
//int m_idSendQuality; // MSR_id for timing the notifications per se
#endif // PERF
REFERENCE_TIME m_trRememberStampForPerf; // original time stamp of frame
- // with no earliness fudges etc.
+ // with no earliness fudges etc.
#ifdef PERF
REFERENCE_TIME m_trRememberFrameForPerf; // time when previous frame rendered
@@ -378,7 +397,7 @@ protected:
int m_cFramesDropped; // cumulative frames dropped IN THE RENDERER
int m_cFramesDrawn; // Frames since streaming started seen BY THE
- // RENDERER (some may be dropped upstream)
+ // RENDERER (some may be dropped upstream)
// Next two support average sync offset and standard deviation of sync offset.
LONGLONG m_iTotAcc; // Sum of accuracies in mSec
@@ -398,8 +417,8 @@ protected:
int m_trFrame; // hold onto inter-frame time
int m_tStreamingStart; // if streaming then time streaming started
- // else time of last streaming session
- // used for property page statistics
+ // else time of last streaming session
+ // used for property page statistics
#ifdef PERF
LONGLONG m_llTimeOffset; // timeGetTime()*10000+m_llTimeOffset==ref time
#endif
diff --git a/thirdparties/win32/include/directshow/schedule.h b/thirdparties/win32/include/directshow/schedule.h
index 65ed402..d270c1e 100755
--- a/thirdparties/win32/include/directshow/schedule.h
+++ b/thirdparties/win32/include/directshow/schedule.h
@@ -31,7 +31,9 @@ public:
REFERENCE_TIME Advise( const REFERENCE_TIME & rtTime );
// Get the event handle which will be set if advise time requires re-evaluation.
- HANDLE GetEvent() const { return m_ev; }
+ HANDLE GetEvent() const {
+ return m_ev;
+ }
private:
// We define the nodes that will be used in our singly linked list
@@ -40,8 +42,8 @@ private:
class CAdvisePacket
{
public:
- CAdvisePacket()
- {}
+ CAdvisePacket() {
+ }
CAdvisePacket * m_next;
DWORD_PTR m_dwAdviseCookie;
@@ -50,40 +52,40 @@ private:
HANDLE m_hNotify; // Handle to event or semephore
BOOL m_bPeriodic; // TRUE => Periodic event
- CAdvisePacket( __inout_opt CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time)
- {}
+ CAdvisePacket( __inout_opt CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) {
+ }
- void InsertAfter( __inout CAdvisePacket * p )
- {
+ void InsertAfter( __inout CAdvisePacket * p ) {
p->m_next = m_next;
m_next = p;
}
- int IsZ() const // That is, is it the node that represents the end of the list
- { return m_next == 0; }
+ int IsZ() const { // That is, is it the node that represents the end of the list
+ return m_next == 0;
+ }
- CAdvisePacket * RemoveNext()
- {
+ CAdvisePacket * RemoveNext() {
CAdvisePacket *const next = m_next;
CAdvisePacket *const new_next = next->m_next;
m_next = new_next;
return next;
}
- void DeleteNext()
- {
+ void DeleteNext() {
delete RemoveNext();
}
- CAdvisePacket * Next() const
- {
+ CAdvisePacket * Next() const {
CAdvisePacket * result = m_next;
- if (result->IsZ()) result = 0;
+ if (result->IsZ()) {
+ result = 0;
+ }
return result;
}
- DWORD_PTR Cookie() const
- { return m_dwAdviseCookie; }
+ DWORD_PTR Cookie() const {
+ return m_dwAdviseCookie;
+ }
};
// Structure is:
diff --git a/thirdparties/win32/include/directshow/source.h b/thirdparties/win32/include/directshow/source.h
index e6e451b..3270d56 100755
--- a/thirdparties/win32/include/directshow/source.h
+++ b/thirdparties/win32/include/directshow/source.h
@@ -40,7 +40,8 @@ class CSourceStream; // The class that will handle each pin
//
// Override construction to provide a means of creating
// CSourceStream derived objects - ie a way of creating pins.
-class CSource : public CBaseFilter {
+class CSource : public CBaseFilter
+{
public:
CSource(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN lpunk, CLSID clsid, __inout HRESULT *phr);
@@ -56,7 +57,9 @@ public:
// -- Utilities --
- CCritSec* pStateLock(void) { return &m_cStateLock; } // provide our critical section
+ CCritSec* pStateLock(void) {
+ return &m_cStateLock; // provide our critical section
+ }
HRESULT AddPin(__in CSourceStream *);
HRESULT RemovePin(__in CSourceStream *);
@@ -67,11 +70,11 @@ public:
);
int FindPinNumber(__in IPin *iPin);
-
+
protected:
int m_iPins; // The number of pins on this filter. Updated by CSourceStream
- // constructors & destructors.
+ // constructors & destructors.
CSourceStream **m_paStreams; // the pins on this filter.
CCritSec m_cStateLock; // Lock this to serialize function accesses to the filter state
@@ -85,7 +88,8 @@ protected:
// Use this class to manage a stream of data that comes from a
// pin.
// Uses a worker thread to put data on the pin.
-class CSourceStream : public CAMThread, public CBaseOutputPin {
+class CSourceStream : public CAMThread, public CBaseOutputPin
+{
public:
CSourceStream(__in_opt LPCTSTR pObjectName,
@@ -119,9 +123,15 @@ protected:
// Called as the thread is created/destroyed - use to perform
// jobs such as start/stop streaming mode
// If OnThreadCreate returns an error the thread will exit.
- virtual HRESULT OnThreadCreate(void) {return NOERROR;};
- virtual HRESULT OnThreadDestroy(void) {return NOERROR;};
- virtual HRESULT OnThreadStartPlay(void) {return NOERROR;};
+ virtual HRESULT OnThreadCreate(void) {
+ return NOERROR;
+ };
+ virtual HRESULT OnThreadDestroy(void) {
+ return NOERROR;
+ };
+ virtual HRESULT OnThreadStartPlay(void) {
+ return NOERROR;
+ };
// *
// * Worker Thread
@@ -133,15 +143,29 @@ protected:
public:
// thread commands
enum Command {CMD_INIT, CMD_PAUSE, CMD_RUN, CMD_STOP, CMD_EXIT};
- HRESULT Init(void) { return CallWorker(CMD_INIT); }
- HRESULT Exit(void) { return CallWorker(CMD_EXIT); }
- HRESULT Run(void) { return CallWorker(CMD_RUN); }
- HRESULT Pause(void) { return CallWorker(CMD_PAUSE); }
- HRESULT Stop(void) { return CallWorker(CMD_STOP); }
+ HRESULT Init(void) {
+ return CallWorker(CMD_INIT);
+ }
+ HRESULT Exit(void) {
+ return CallWorker(CMD_EXIT);
+ }
+ HRESULT Run(void) {
+ return CallWorker(CMD_RUN);
+ }
+ HRESULT Pause(void) {
+ return CallWorker(CMD_PAUSE);
+ }
+ HRESULT Stop(void) {
+ return CallWorker(CMD_STOP);
+ }
protected:
- Command GetRequest(void) { return (Command) CAMThread::GetRequest(); }
- BOOL CheckRequest(Command *pCom) { return CAMThread::CheckRequest( (DWORD *) pCom); }
+ Command GetRequest(void) {
+ return (Command) CAMThread::GetRequest();
+ }
+ BOOL CheckRequest(Command *pCom) {
+ return CAMThread::CheckRequest( (DWORD *) pCom);
+ }
// override these if you want to add thread commands
virtual DWORD ThreadProc(void); // the thread function
@@ -161,7 +185,9 @@ protected:
// This will only be called by the default implementations
// of CheckMediaType and GetMediaType(int, CMediaType*)
// You must override this fn. or the above 2!
- virtual HRESULT GetMediaType(__inout CMediaType *pMediaType) {return E_UNEXPECTED;}
+ virtual HRESULT GetMediaType(__inout CMediaType *pMediaType) {
+ return E_UNEXPECTED;
+ }
STDMETHODIMP QueryId(
__deref_out LPWSTR * Id
diff --git a/thirdparties/win32/include/directshow/streams.h b/thirdparties/win32/include/directshow/streams.h
index 72c6fd0..e021680 100755
--- a/thirdparties/win32/include/directshow/streams.h
+++ b/thirdparties/win32/include/directshow/streams.h
@@ -45,10 +45,10 @@
#ifndef NUMELMS
#if _WIN32_WINNT < 0x0600
- #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
+#define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
#else
- #define NUMELMS(aa) ARRAYSIZE(aa)
-#endif
+#define NUMELMS(aa) ARRAYSIZE(aa)
+#endif
#endif
///////////////////////////////////////////////////////////////////////////
@@ -56,7 +56,7 @@
// the applicaiton is being compiled with the headers from Visual C++ 6.0.
/////////////////////////////////////////////////// ////////////////////////
#ifndef InterlockedExchangePointer
- #define InterlockedExchangePointer(Target, Value) \
+#define InterlockedExchangePointer(Target, Value) \
(PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
#endif
@@ -70,7 +70,7 @@ typedef struct {
WORD wReserved; /* If neither applies, set to zero. */
} Samples;
DWORD dwChannelMask; /* which channels are */
- /* present in stream */
+ /* present in stream */
GUID SubFormat;
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
#endif // !_WAVEFORMATEXTENSIBLE_
@@ -80,48 +80,48 @@ typedef struct {
#endif // !defined(WAVE_FORMAT_EXTENSIBLE)
#ifndef GetWindowLongPtr
- #define GetWindowLongPtrA GetWindowLongA
- #define GetWindowLongPtrW GetWindowLongW
- #ifdef UNICODE
- #define GetWindowLongPtr GetWindowLongPtrW
- #else
- #define GetWindowLongPtr GetWindowLongPtrA
- #endif // !UNICODE
+#define GetWindowLongPtrA GetWindowLongA
+#define GetWindowLongPtrW GetWindowLongW
+#ifdef UNICODE
+#define GetWindowLongPtr GetWindowLongPtrW
+#else
+#define GetWindowLongPtr GetWindowLongPtrA
+#endif // !UNICODE
#endif // !GetWindowLongPtr
#ifndef SetWindowLongPtr
- #define SetWindowLongPtrA SetWindowLongA
- #define SetWindowLongPtrW SetWindowLongW
- #ifdef UNICODE
- #define SetWindowLongPtr SetWindowLongPtrW
- #else
- #define SetWindowLongPtr SetWindowLongPtrA
- #endif // !UNICODE
+#define SetWindowLongPtrA SetWindowLongA
+#define SetWindowLongPtrW SetWindowLongW
+#ifdef UNICODE
+#define SetWindowLongPtr SetWindowLongPtrW
+#else
+#define SetWindowLongPtr SetWindowLongPtrA
+#endif // !UNICODE
#endif // !SetWindowLongPtr
#ifndef GWLP_WNDPROC
- #define GWLP_WNDPROC (-4)
+#define GWLP_WNDPROC (-4)
#endif
#ifndef GWLP_HINSTANCE
- #define GWLP_HINSTANCE (-6)
+#define GWLP_HINSTANCE (-6)
#endif
#ifndef GWLP_HWNDPARENT
- #define GWLP_HWNDPARENT (-8)
+#define GWLP_HWNDPARENT (-8)
#endif
#ifndef GWLP_USERDATA
- #define GWLP_USERDATA (-21)
+#define GWLP_USERDATA (-21)
#endif
#ifndef GWLP_ID
- #define GWLP_ID (-12)
+#define GWLP_ID (-12)
#endif
#ifndef DWLP_MSGRESULT
- #define DWLP_MSGRESULT 0
+#define DWLP_MSGRESULT 0
#endif
-#ifndef DWLP_DLGPROC
- #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
+#ifndef DWLP_DLGPROC
+#define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
#endif
#ifndef DWLP_USER
- #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
+#define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
#endif
@@ -195,8 +195,8 @@ LONG_PTR _SetWindowLongPtr(HWND hwnd, int nIndex, T p)
#else
- #ifdef DEBUG
- #pragma message("STREAMS.H included TWICE")
- #endif
+#ifdef DEBUG
+#pragma message("STREAMS.H included TWICE")
+#endif
#endif // __STREAMS__
diff --git a/thirdparties/win32/include/directshow/strmctl.h b/thirdparties/win32/include/directshow/strmctl.h
index 4077e6c..b0a019b 100755
--- a/thirdparties/win32/include/directshow/strmctl.h
+++ b/thirdparties/win32/include/directshow/strmctl.h
@@ -14,15 +14,15 @@ class CBaseStreamControl : public IAMStreamControl
{
public:
// Used by the implementation
- enum StreamControlState
- { STREAM_FLOWING = 0x1000,
- STREAM_DISCARDING
+ enum StreamControlState {
+ STREAM_FLOWING = 0x1000,
+ STREAM_DISCARDING
};
private:
enum StreamControlState m_StreamState; // Current stream state
enum StreamControlState m_StreamStateOnStop; // State after next stop
- // (i.e.Blocking or Discarding)
+ // (i.e.Blocking or Discarding)
REFERENCE_TIME m_tStartTime; // MAX_TIME implies none
REFERENCE_TIME m_tStopTime; // MAX_TIME implies none
@@ -51,14 +51,14 @@ private:
// Your pin must also expose IAMStreamControl when QI'd for it!
//
IReferenceClock * m_pRefClock; // Need it to set advises
- // Filter must tell us via
- // SetSyncSource
+ // Filter must tell us via
+ // SetSyncSource
IMediaEventSink * m_pSink; // Event sink
- // Filter must tell us after it
- // creates it in JoinFilterGraph()
+ // Filter must tell us after it
+ // creates it in JoinFilterGraph()
FILTER_STATE m_FilterState; // Just need it!
- // Filter must tell us via
- // NotifyFilterState
+ // Filter must tell us via
+ // NotifyFilterState
REFERENCE_TIME m_tRunStart; // Per the Run call to the filter
// This guy will return one of the three StreamControlState's. Here's what
@@ -72,7 +72,7 @@ private:
// fires, call me back - I've changed my mind.
//
enum StreamControlState CheckSampleTimes( __in const REFERENCE_TIME * pSampleStart,
- __in const REFERENCE_TIME * pSampleStop );
+ __in const REFERENCE_TIME * pSampleStop );
public:
// You don't have to tell us much when we're created, but there are other
@@ -90,18 +90,21 @@ public:
// We need a clock to see what time it is. This is for the
// "discard in a timely fashion" logic. If we discard everything as
// quick as possible, a whole 60 minute file could get discarded in the
- // first 10 seconds, and if somebody wants to turn streaming on at 30
+ // first 10 seconds, and if somebody wants to turn streaming on at 30
// minutes into the file, and they make the call more than a few seconds
// after the graph is run, it may be too late!
// So we hold every sample until it's time has gone, then we discard it.
// The filter should call this when it gets a SetSyncSource
//
- void SetSyncSource( IReferenceClock * pRefClock )
- {
- CAutoLock lck(&m_CritSec);
- if (m_pRefClock) m_pRefClock->Release();
- m_pRefClock = pRefClock;
- if (m_pRefClock) m_pRefClock->AddRef();
+ void SetSyncSource( IReferenceClock * pRefClock ) {
+ CAutoLock lck(&m_CritSec);
+ if (m_pRefClock) {
+ m_pRefClock->Release();
+ }
+ m_pRefClock = pRefClock;
+ if (m_pRefClock) {
+ m_pRefClock->AddRef();
+ }
}
// Set event sink for notifications
@@ -130,10 +133,10 @@ public:
// muting and unmuting of the stream.
STDMETHODIMP StopAt( const REFERENCE_TIME * ptStop = NULL,
- BOOL bSendExtra = FALSE,
- DWORD dwCookie = 0 );
+ BOOL bSendExtra = FALSE,
+ DWORD dwCookie = 0 );
STDMETHODIMP StartAt( const REFERENCE_TIME * ptStart = NULL,
- DWORD dwCookie = 0 );
+ DWORD dwCookie = 0 );
STDMETHODIMP GetInfo( __out AM_STREAM_INFO *pInfo);
// Helper function for pin's receive method. Call this with
@@ -149,9 +152,15 @@ private:
// These don't require locking, but we are relying on the fact that
// m_StreamState can be retrieved with integrity, and is a snap shot that
// may have just been, or may be just about to be, changed.
- HANDLE GetStreamEventHandle() const { return m_StreamEvent; }
- enum StreamControlState GetStreamState() const { return m_StreamState; }
- BOOL IsStreaming() const { return m_StreamState == STREAM_FLOWING; }
+ HANDLE GetStreamEventHandle() const {
+ return m_StreamEvent;
+ }
+ enum StreamControlState GetStreamState() const {
+ return m_StreamState;
+ }
+ BOOL IsStreaming() const {
+ return m_StreamState == STREAM_FLOWING;
+ }
};
#endif
diff --git a/thirdparties/win32/include/directshow/transfrm.h b/thirdparties/win32/include/directshow/transfrm.h
index 36c2e0d..39f40ce 100755
--- a/thirdparties/win32/include/directshow/transfrm.h
+++ b/thirdparties/win32/include/directshow/transfrm.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// File: Transfrm.h
//
-// Desc: DirectShow base classes - defines classes from which simple
+// Desc: DirectShow base classes - defines classes from which simple
// transform codecs may be derived.
//
// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
@@ -53,8 +53,7 @@ public:
__in_opt LPCWSTR pName);
#endif
- STDMETHODIMP QueryId(__deref_out LPWSTR * Id)
- {
+ STDMETHODIMP QueryId(__deref_out LPWSTR * Id) {
return AMGetWideString(L"In", Id);
}
@@ -88,16 +87,18 @@ public:
STDMETHODIMP EndFlush(void);
STDMETHODIMP NewSegment(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop,
- double dRate);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
// Check if it's OK to process samples
virtual HRESULT CheckStreaming();
// Media type
public:
- CMediaType& CurrentMediaType() { return m_mt; };
+ CMediaType& CurrentMediaType() {
+ return m_mt;
+ };
};
@@ -136,8 +137,7 @@ public:
// --- CBaseOutputPin ------------
- STDMETHODIMP QueryId(__deref_out LPWSTR * Id)
- {
+ STDMETHODIMP QueryId(__deref_out LPWSTR * Id) {
return AMGetWideString(L"Out", Id);
}
@@ -156,8 +156,8 @@ public:
// called from CBaseOutputPin during connection to ask for
// the count and size of buffers we need.
HRESULT DecideBufferSize(
- IMemAllocator * pAlloc,
- __inout ALLOCATOR_PROPERTIES *pProp);
+ IMemAllocator * pAlloc,
+ __inout ALLOCATOR_PROPERTIES *pProp);
// returns the preferred formats for a pin
HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType);
@@ -167,7 +167,9 @@ public:
// Media type
public:
- CMediaType& CurrentMediaType() { return m_mt; };
+ CMediaType& CurrentMediaType() {
+ return m_mt;
+ };
};
@@ -215,8 +217,8 @@ public:
// call the SetProperties function with appropriate arguments
virtual HRESULT DecideBufferSize(
- IMemAllocator * pAllocator,
- __inout ALLOCATOR_PROPERTIES *pprop) PURE;
+ IMemAllocator * pAllocator,
+ __inout ALLOCATOR_PROPERTIES *pprop) PURE;
// override to suggest OUTPUT pin media types
virtual HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType) PURE;
@@ -253,15 +255,16 @@ public:
virtual HRESULT BeginFlush(void);
virtual HRESULT EndFlush(void);
virtual HRESULT NewSegment(
- REFERENCE_TIME tStart,
- REFERENCE_TIME tStop,
- double dRate);
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
#ifdef PERF
// Override to register performance measurement with a less generic string
// You should do this to avoid confusion with other filters
- virtual void RegisterPerfId()
- {m_idTransform = MSR_REGISTER(TEXT("Transform"));}
+ virtual void RegisterPerfId() {
+ m_idTransform = MSR_REGISTER(TEXT("Transform"));
+ }
#endif // PERF
diff --git a/thirdparties/win32/include/directshow/transip.h b/thirdparties/win32/include/directshow/transip.h
index 45fb4e9..b24fc3b 100755
--- a/thirdparties/win32/include/directshow/transip.h
+++ b/thirdparties/win32/include/directshow/transip.h
@@ -72,15 +72,18 @@ public:
// Allow the filter to see what allocator we have
// N.B. This does NOT AddRef
- __out IMemAllocator * PeekAllocator() const
- { return m_pAllocator; }
+ __out IMemAllocator * PeekAllocator() const {
+ return m_pAllocator;
+ }
// Pass this on downstream if it ever gets called.
STDMETHODIMP GetAllocatorRequirements(__out ALLOCATOR_PROPERTIES *pProps);
HRESULT CompleteConnect(IPin *pReceivePin);
- inline const BOOL ReadOnly() { return m_bReadOnly ; }
+ inline const BOOL ReadOnly() {
+ return m_bReadOnly ;
+ }
}; // CTransInPlaceInputPin
@@ -122,13 +125,15 @@ public:
// Also called by input pin's GetAllocator()
void SetAllocator(IMemAllocator * pAllocator);
- __out_opt IMemInputPin * ConnectedIMemInputPin()
- { return m_pInputPin; }
+ __out_opt IMemInputPin * ConnectedIMemInputPin() {
+ return m_pInputPin;
+ }
// Allow the filter to see what allocator we have
// N.B. This does NOT AddRef
- __out IMemAllocator * PeekAllocator() const
- { return m_pAllocator; }
+ __out IMemAllocator * PeekAllocator() const {
+ return m_pAllocator;
+ }
HRESULT CompleteConnect(IPin *pReceivePin);
@@ -162,10 +167,10 @@ public:
// We override EnumMediaTypes to bypass the transform class enumerator
// which would otherwise call this.
- HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType)
- { DbgBreak("CTransInPlaceFilter::GetMediaType should never be called");
- return E_UNEXPECTED;
- }
+ HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType) {
+ DbgBreak("CTransInPlaceFilter::GetMediaType should never be called");
+ return E_UNEXPECTED;
+ }
// This is called when we actually have to provide our own allocator.
HRESULT DecideBufferSize(IMemAllocator*, __inout ALLOCATOR_PROPERTIES *);
@@ -174,8 +179,7 @@ public:
// class to call CheckInputType with the assumption that the type
// does not change. In Debug builds some calls will be made and
// we just ensure that they do not assert.
- HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut)
- {
+ HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut) {
return S_OK;
};
@@ -202,8 +206,9 @@ public:
#ifdef PERF
// Override to register performance measurement with a less generic string
// You should do this to avoid confusion with other filters
- virtual void RegisterPerfId()
- {m_idTransInPlace = MSR_REGISTER(TEXT("TransInPlace"));}
+ virtual void RegisterPerfId() {
+ m_idTransInPlace = MSR_REGISTER(TEXT("TransInPlace"));
+ }
#endif // PERF
@@ -223,25 +228,21 @@ protected:
friend class CTransInPlaceInputPin;
friend class CTransInPlaceOutputPin;
- __out CTransInPlaceInputPin *InputPin() const
- {
+ __out CTransInPlaceInputPin *InputPin() const {
return (CTransInPlaceInputPin *)m_pInput;
};
- __out CTransInPlaceOutputPin *OutputPin() const
- {
+ __out CTransInPlaceOutputPin *OutputPin() const {
return (CTransInPlaceOutputPin *)m_pOutput;
};
// Helper to see if the input and output types match
- BOOL TypesMatch()
- {
+ BOOL TypesMatch() {
return InputPin()->CurrentMediaType() ==
OutputPin()->CurrentMediaType();
}
// Are the input and output allocators different?
- BOOL UsingDifferentAllocators() const
- {
+ BOOL UsingDifferentAllocators() const {
return InputPin()->PeekAllocator() != OutputPin()->PeekAllocator();
}
}; // CTransInPlaceFilter
diff --git a/thirdparties/win32/include/directshow/vtrans.h b/thirdparties/win32/include/directshow/vtrans.h
index 7122392..a787dbc 100755
--- a/thirdparties/win32/include/directshow/vtrans.h
+++ b/thirdparties/win32/include/directshow/vtrans.h
@@ -13,7 +13,7 @@
class CVideoTransformFilter : public CTransformFilter
{
- public:
+public:
CVideoTransformFilter(__in_opt LPCTSTR, __inout_opt LPUNKNOWN, REFCLSID clsid);
~CVideoTransformFilter();
@@ -62,7 +62,7 @@ class CVideoTransformFilter : public CTransformFilter
}
#endif
- protected:
+protected:
// =========== QUALITY MANAGEMENT IMPLEMENTATION ========================
// Frames are assumed to come in three types:
@@ -101,10 +101,10 @@ class CVideoTransformFilter : public CTransformFilter
// the quality management here if you have B-frames.
int m_nKeyFramePeriod; // the largest observed interval between type 1 frames
- // 1 means every frame is type 1, 2 means every other.
+ // 1 means every frame is type 1, 2 means every other.
int m_nFramesSinceKeyFrame; // Used to count frames since the last type 1.
- // becomes the new m_nKeyFramePeriod if greater.
+ // becomes the new m_nKeyFramePeriod if greater.
BOOL m_bSkipping; // we are skipping to the next type 1 frame
@@ -126,7 +126,7 @@ class CVideoTransformFilter : public CTransformFilter
BOOL ShouldSkipFrame(IMediaSample * pIn);
int m_itrLate; // lateness from last Quality message
- // (this overflows at 214 secs late).
+ // (this overflows at 214 secs late).
int m_tDecodeStart; // timeGetTime when decode started.
int m_itrAvgDecode; // Average decode time in reference units.
diff --git a/thirdparties/win32/include/directshow/winctrl.h b/thirdparties/win32/include/directshow/winctrl.h
index f18ba82..9c0ddda 100755
--- a/thirdparties/win32/include/directshow/winctrl.h
+++ b/thirdparties/win32/include/directshow/winctrl.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// File: WinCtrl.h
//
-// Desc: DirectShow base classes - defines classes for video control
+// Desc: DirectShow base classes - defines classes for video control
// interfaces.
//
// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
@@ -36,13 +36,20 @@ public:
HRESULT DoSetWindowStyle(long Style,long WindowLong);
HRESULT DoGetWindowStyle(__out long *pStyle,long WindowLong);
- BOOL IsAutoShowEnabled() { return m_bAutoShow; };
- COLORREF GetBorderColour() { return m_BorderColour; };
- HWND GetOwnerWindow() { return m_hwndOwner; };
- BOOL IsCursorHidden() { return m_bCursorHidden; };
-
- inline BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
+ BOOL IsAutoShowEnabled() {
+ return m_bAutoShow;
+ };
+ COLORREF GetBorderColour() {
+ return m_BorderColour;
+ };
+ HWND GetOwnerWindow() {
+ return m_hwndOwner;
+ };
+ BOOL IsCursorHidden() {
+ return m_bCursorHidden;
+ };
+
+ inline BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) {
return ::PossiblyEatMessage(m_hwndDrain, uMsg, wParam, lParam);
}
@@ -106,7 +113,7 @@ public:
STDMETHODIMP SetWindowPosition(long Left,long Top,long Width,long Height);
STDMETHODIMP GetWindowPosition(__out long *pLeft,__out long *pTop,__out long *pWidth,__out long *pHeight);
STDMETHODIMP GetRestorePosition(__out long *pLeft,__out long *pTop,__out long *pWidth,__out long *pHeight);
- STDMETHODIMP HideCursor(long HideCursor);
+ STDMETHODIMP HideCursor(long HideCursor);
STDMETHODIMP IsCursorHidden(__out long *CursorHidden);
};
@@ -156,7 +163,9 @@ public:
__in RECT *pSourceRect);
// Override this if you want notifying when the rectangles change
- virtual HRESULT OnUpdateRectangles() { return NOERROR; };
+ virtual HRESULT OnUpdateRectangles() {
+ return NOERROR;
+ };
virtual HRESULT OnVideoSizeChange();
// Derived classes must call this to set the pin the filter is using
diff --git a/thirdparties/win32/include/directshow/winutil.h b/thirdparties/win32/include/directshow/winutil.h
index 641b53a..89a5eaf 100755
--- a/thirdparties/win32/include/directshow/winutil.h
+++ b/thirdparties/win32/include/directshow/winutil.h
@@ -59,8 +59,8 @@ protected:
BOOL m_bDoGetDC; // Should this window get a DC
bool m_bDoPostToDestroy; // Use PostMessage to destroy
CCritSec m_PaletteLock; // This lock protects m_hPalette.
- // It should be held anytime the
- // program use the value of m_hPalette.
+ // It should be held anytime the
+ // program use the value of m_hPalette.
// Maps windows message procedure into C++ methods
friend LRESULT CALLBACK WndProc(HWND hwnd, // Window handle
@@ -96,8 +96,7 @@ public:
void PaintWindow(BOOL bErase);
void DoSetWindowForeground(BOOL bFocus);
virtual HRESULT SetPalette(HPALETTE hPalette);
- void SetRealize(BOOL bRealize)
- {
+ void SetRealize(BOOL bRealize) {
m_bNoRealize = !bRealize;
}
@@ -109,8 +108,9 @@ public:
void LockPaletteLock();
void UnlockPaletteLock();
- virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
- { return FALSE; };
+ virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ return FALSE;
+ };
// Access our window information
@@ -121,9 +121,9 @@ public:
HDC GetMemoryHDC();
HDC GetWindowHDC();
- #ifdef DEBUG
+#ifdef DEBUG
HPALETTE GetPalette();
- #endif // DEBUG
+#endif // DEBUG
// This is the window procedure the derived object should override
@@ -135,9 +135,9 @@ public:
// Must be overriden to return class and window styles
virtual LPTSTR GetClassWindowStyles(
- __out DWORD *pClassStyles, // Class styles
- __out DWORD *pWindowStyles, // Window styles
- __out DWORD *pWindowStylesEx) PURE; // Extended styles
+ __out DWORD *pClassStyles, // Class styles
+ __out DWORD *pWindowStyles, // Window styles
+ __out DWORD *pWindowStylesEx) PURE; // Extended styles
};
@@ -350,8 +350,7 @@ public:
BOOL ShouldUpdate(const VIDEOINFOHEADER *pNewInfo,const VIDEOINFOHEADER *pOldInfo);
HRESULT PreparePalette(const CMediaType *pmtNew,const CMediaType *pmtOld,__in LPSTR szDevice);
- BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
- {
+ BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst) {
return m_pDrawImage->DrawVideoImageHere(hdc, pMediaSample, lprcSrc,lprcDst);
}
};
diff --git a/thirdparties/win32/include/directshow/wxdebug.h b/thirdparties/win32/include/directshow/wxdebug.h
index 62efffb..29478de 100755
--- a/thirdparties/win32/include/directshow/wxdebug.h
+++ b/thirdparties/win32/include/directshow/wxdebug.h
@@ -51,12 +51,13 @@ enum { LOG_TIMING = 0x01, // Timing and performance measurements
LOG_CUSTOM3 = 0x80,
LOG_CUSTOM4 = 0x100,
LOG_CUSTOM5 = 0x200,
-};
+ };
#define LOG_FORCIBLY_SET 0x80000000
enum { CDISP_HEX = 0x01,
- CDISP_DEC = 0x02};
+ CDISP_DEC = 0x02
+ };
// For each object created derived from CBaseObject (in debug builds) we
// create a descriptor that holds it's name (statically allocated memory)
@@ -75,148 +76,148 @@ typedef struct tag_ObjectDesc {
#ifdef DEBUG
- #define NAME(x) TEXT(x)
+#define NAME(x) TEXT(x)
- // These are used internally by the debug library (PRIVATE)
+// These are used internally by the debug library (PRIVATE)
- void WINAPI DbgInitKeyLevels(HKEY hKey, bool fTakeMax);
- void WINAPI DbgInitGlobalSettings(bool fTakeMax);
- void WINAPI DbgInitModuleSettings(bool fTakeMax);
- void WINAPI DbgInitModuleName();
- DWORD WINAPI DbgRegisterObjectCreation(
- LPCSTR szObjectName, LPCWSTR wszObjectName);
+void WINAPI DbgInitKeyLevels(HKEY hKey, bool fTakeMax);
+void WINAPI DbgInitGlobalSettings(bool fTakeMax);
+void WINAPI DbgInitModuleSettings(bool fTakeMax);
+void WINAPI DbgInitModuleName();
+DWORD WINAPI DbgRegisterObjectCreation(
+ LPCSTR szObjectName, LPCWSTR wszObjectName);
- BOOL WINAPI DbgRegisterObjectDestruction(DWORD dwCookie);
+BOOL WINAPI DbgRegisterObjectDestruction(DWORD dwCookie);
- // These are the PUBLIC entry points
+// These are the PUBLIC entry points
- BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level);
- void WINAPI DbgSetModuleLevel(DWORD Type,DWORD Level);
- void WINAPI DbgSetAutoRefreshLevels(bool fAuto);
+BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level);
+void WINAPI DbgSetModuleLevel(DWORD Type,DWORD Level);
+void WINAPI DbgSetAutoRefreshLevels(bool fAuto);
- // Initialise the library with the module handle
+// Initialise the library with the module handle
- void WINAPI DbgInitialise(HINSTANCE hInst);
- void WINAPI DbgTerminate();
+void WINAPI DbgInitialise(HINSTANCE hInst);
+void WINAPI DbgTerminate();
- void WINAPI DbgDumpObjectRegister();
+void WINAPI DbgDumpObjectRegister();
- // Display error and logging to the user
+// Display error and logging to the user
- void WINAPI DbgAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
- void WINAPI DbgBreakPoint(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
- void WINAPI DbgBreakPoint(LPCTSTR pFileName,INT iLine,__format_string LPCTSTR szFormatString,...);
+void WINAPI DbgAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
+void WINAPI DbgBreakPoint(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
+void WINAPI DbgBreakPoint(LPCTSTR pFileName,INT iLine,__format_string LPCTSTR szFormatString,...);
- void WINAPI DbgKernelAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
- void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCTSTR pFormat,...);
+void WINAPI DbgKernelAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine);
+void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCTSTR pFormat,...);
#ifdef UNICODE
- void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCSTR pFormat,...);
- void WINAPI DbgAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
- void WINAPI DbgBreakPoint(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
- void WINAPI DbgKernelAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
+void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCSTR pFormat,...);
+void WINAPI DbgAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
+void WINAPI DbgBreakPoint(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
+void WINAPI DbgKernelAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine);
#endif
- void WINAPI DbgOutString(LPCTSTR psz);
+void WINAPI DbgOutString(LPCTSTR psz);
- // Debug infinite wait stuff
- DWORD WINAPI DbgWaitForSingleObject(HANDLE h);
- DWORD WINAPI DbgWaitForMultipleObjects(DWORD nCount,
- __in_ecount(nCount) CONST HANDLE *lpHandles,
- BOOL bWaitAll);
- void WINAPI DbgSetWaitTimeout(DWORD dwTimeout);
+// Debug infinite wait stuff
+DWORD WINAPI DbgWaitForSingleObject(HANDLE h);
+DWORD WINAPI DbgWaitForMultipleObjects(DWORD nCount,
+ __in_ecount(nCount) CONST HANDLE *lpHandles,
+ BOOL bWaitAll);
+void WINAPI DbgSetWaitTimeout(DWORD dwTimeout);
#ifdef __strmif_h__
- // Display a media type: Terse at level 2, verbose at level 5
- void WINAPI DisplayType(LPCTSTR label, const AM_MEDIA_TYPE *pmtIn);
+// Display a media type: Terse at level 2, verbose at level 5
+void WINAPI DisplayType(LPCTSTR label, const AM_MEDIA_TYPE *pmtIn);
- // Dump lots of information about a filter graph
- void WINAPI DumpGraph(IFilterGraph *pGraph, DWORD dwLevel);
+// Dump lots of information about a filter graph
+void WINAPI DumpGraph(IFilterGraph *pGraph, DWORD dwLevel);
#endif
- #define KASSERT(_x_) if (!(_x_)) \
+#define KASSERT(_x_) if (!(_x_)) \
DbgKernelAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__)
- // Break on the debugger without putting up a message box
- // message goes to debugger instead
+// Break on the debugger without putting up a message box
+// message goes to debugger instead
- #define KDbgBreak(_x_) \
+#define KDbgBreak(_x_) \
DbgKernelAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__)
- // We chose a common name for our ASSERT macro, MFC also uses this name
- // So long as the implementation evaluates the condition and handles it
- // then we will be ok. Rather than override the behaviour expected we
- // will leave whatever first defines ASSERT as the handler (i.e. MFC)
- #ifndef ASSERT
- #define ASSERT(_x_) if (!(_x_)) \
+// We chose a common name for our ASSERT macro, MFC also uses this name
+// So long as the implementation evaluates the condition and handles it
+// then we will be ok. Rather than override the behaviour expected we
+// will leave whatever first defines ASSERT as the handler (i.e. MFC)
+#ifndef ASSERT
+#define ASSERT(_x_) if (!(_x_)) \
DbgAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__)
- #endif
+#endif
- #define DbgAssertAligned( _ptr_, _alignment_ ) ASSERT( ((DWORD_PTR) (_ptr_)) % (_alignment_) == 0)
+#define DbgAssertAligned( _ptr_, _alignment_ ) ASSERT( ((DWORD_PTR) (_ptr_)) % (_alignment_) == 0)
- // Put up a message box informing the user of a halt
- // condition in the program
+// Put up a message box informing the user of a halt
+// condition in the program
- #define DbgBreak(_x_) \
+#define DbgBreak(_x_) \
DbgBreakPoint(TEXT(#_x_),TEXT(__FILE__),__LINE__)
- #define EXECUTE_ASSERT(_x_) ASSERT(_x_)
- #define DbgLog(_x_) DbgLogInfo _x_
- // MFC style trace macros
+#define EXECUTE_ASSERT(_x_) ASSERT(_x_)
+#define DbgLog(_x_) DbgLogInfo _x_
+// MFC style trace macros
- #define NOTE(_x_) DbgLog((LOG_TRACE,5,TEXT(_x_)))
- #define NOTE1(_x_,a) DbgLog((LOG_TRACE,5,TEXT(_x_),a))
- #define NOTE2(_x_,a,b) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b))
- #define NOTE3(_x_,a,b,c) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c))
- #define NOTE4(_x_,a,b,c,d) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d))
- #define NOTE5(_x_,a,b,c,d,e) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d,e))
+#define NOTE(_x_) DbgLog((LOG_TRACE,5,TEXT(_x_)))
+#define NOTE1(_x_,a) DbgLog((LOG_TRACE,5,TEXT(_x_),a))
+#define NOTE2(_x_,a,b) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b))
+#define NOTE3(_x_,a,b,c) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c))
+#define NOTE4(_x_,a,b,c,d) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d))
+#define NOTE5(_x_,a,b,c,d,e) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d,e))
#else
- // Retail builds make public debug functions inert - WARNING the source
- // files do not define or build any of the entry points in debug builds
- // (public entry points compile to nothing) so if you go trying to call
- // any of the private entry points in your source they won't compile
+// Retail builds make public debug functions inert - WARNING the source
+// files do not define or build any of the entry points in debug builds
+// (public entry points compile to nothing) so if you go trying to call
+// any of the private entry points in your source they won't compile
- #define NAME(_x_) ((LPTSTR) NULL)
+#define NAME(_x_) ((LPTSTR) NULL)
- #define DbgInitialise(hInst)
- #define DbgTerminate()
- #define DbgLog(_x_) 0
- #define DbgOutString(psz)
- #define DbgAssertAligned( _ptr_, _alignment_ ) 0
+#define DbgInitialise(hInst)
+#define DbgTerminate()
+#define DbgLog(_x_) 0
+#define DbgOutString(psz)
+#define DbgAssertAligned( _ptr_, _alignment_ ) 0
- #define DbgRegisterObjectCreation(pObjectName)
- #define DbgRegisterObjectDestruction(dwCookie)
- #define DbgDumpObjectRegister()
+#define DbgRegisterObjectCreation(pObjectName)
+#define DbgRegisterObjectDestruction(dwCookie)
+#define DbgDumpObjectRegister()
- #define DbgCheckModuleLevel(Type,Level)
- #define DbgSetModuleLevel(Type,Level)
- #define DbgSetAutoRefreshLevels(fAuto)
+#define DbgCheckModuleLevel(Type,Level)
+#define DbgSetModuleLevel(Type,Level)
+#define DbgSetAutoRefreshLevels(fAuto)
- #define DbgWaitForSingleObject(h) WaitForSingleObject(h, INFINITE)
- #define DbgWaitForMultipleObjects(nCount, lpHandles, bWaitAll) \
+#define DbgWaitForSingleObject(h) WaitForSingleObject(h, INFINITE)
+#define DbgWaitForMultipleObjects(nCount, lpHandles, bWaitAll) \
WaitForMultipleObjects(nCount, lpHandles, bWaitAll, INFINITE)
- #define DbgSetWaitTimeout(dwTimeout)
+#define DbgSetWaitTimeout(dwTimeout)
- #define KDbgBreak(_x_)
- #define DbgBreak(_x_)
+#define KDbgBreak(_x_)
+#define DbgBreak(_x_)
- #define KASSERT(_x_) ((void)0)
- #ifndef ASSERT
- #define ASSERT(_x_) ((void)0)
- #endif
- #define EXECUTE_ASSERT(_x_) ((void)(_x_))
+#define KASSERT(_x_) ((void)0)
+#ifndef ASSERT
+#define ASSERT(_x_) ((void)0)
+#endif
+#define EXECUTE_ASSERT(_x_) ((void)(_x_))
- // MFC style trace macros
+// MFC style trace macros
- #define NOTE(_x_) ((void)0)
- #define NOTE1(_x_,a) ((void)0)
- #define NOTE2(_x_,a,b) ((void)0)
- #define NOTE3(_x_,a,b,c) ((void)0)
- #define NOTE4(_x_,a,b,c,d) ((void)0)
- #define NOTE5(_x_,a,b,c,d,e) ((void)0)
+#define NOTE(_x_) ((void)0)
+#define NOTE1(_x_,a) ((void)0)
+#define NOTE2(_x_,a,b) ((void)0)
+#define NOTE3(_x_,a,b,c) ((void)0)
+#define NOTE4(_x_,a,b,c,d) ((void)0)
+#define NOTE5(_x_,a,b,c,d,e) ((void)0)
- #define DisplayType(label, pmtIn) ((void)0)
- #define DumpGraph(pGraph, label) ((void)0)
+#define DisplayType(label, pmtIn) ((void)0)
+#define DumpGraph(pGraph, label) ((void)0)
#endif
@@ -246,37 +247,38 @@ typedef struct tag_ObjectDesc {
#ifdef _OBJBASE_H_
- // Outputting GUID names. If you want to include the name
- // associated with a GUID (eg CLSID_...) then
- //
- // GuidNames[yourGUID]
- //
- // Returns the name defined in uuids.h as a string
-
- typedef struct {
- CHAR *szName;
- GUID guid;
- } GUID_STRING_ENTRY;
-
- class CGuidNameList {
- public:
- CHAR *operator [] (const GUID& guid);
- };
+// Outputting GUID names. If you want to include the name
+// associated with a GUID (eg CLSID_...) then
+//
+// GuidNames[yourGUID]
+//
+// Returns the name defined in uuids.h as a string
- extern CGuidNameList GuidNames;
+typedef struct {
+ CHAR *szName;
+ GUID guid;
+} GUID_STRING_ENTRY;
+
+class CGuidNameList
+{
+public:
+ CHAR *operator [] (const GUID& guid);
+};
+
+extern CGuidNameList GuidNames;
#endif
#ifndef REMIND
- // REMIND macro - generates warning as reminder to complete coding
- // (eg) usage:
- //
- // #pragma message (REMIND("Add automation support"))
+// REMIND macro - generates warning as reminder to complete coding
+// (eg) usage:
+//
+// #pragma message (REMIND("Add automation support"))
- #define QUOTE(x) #x
- #define QQUOTE(y) QUOTE(y)
- #define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) ") : " str
+#define QUOTE(x) #x
+#define QQUOTE(y) QUOTE(y)
+#define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) ") : " str
#endif
// Method to display objects in a useful format
@@ -289,7 +291,9 @@ typedef struct tag_ObjectDesc {
class CDispBasic
{
public:
- CDispBasic() { m_pString = m_String; };
+ CDispBasic() {
+ m_pString = m_String;
+ };
~CDispBasic();
protected:
PTCHAR m_pString; // normally points to m_String... unless too much data
@@ -311,8 +315,7 @@ public:
~CDisp();
// Implement cast to (LPCTSTR) as parameter to logger
- operator LPCTSTR()
- {
+ operator LPCTSTR() {
return (LPCTSTR)m_pString;
};
};
@@ -328,11 +331,13 @@ private:
static const TCHAR _szLeaving[];
public:
CAutoTrace(LPCTSTR szBlkName, const int level = 15)
- : _szBlkName(szBlkName), _level(level)
- {DbgLog((LOG_TRACE, _level, _szEntering, _szBlkName));}
+ : _szBlkName(szBlkName), _level(level) {
+ DbgLog((LOG_TRACE, _level, _szEntering, _szBlkName));
+ }
- ~CAutoTrace()
- {DbgLog((LOG_TRACE, _level, _szLeaving, _szBlkName));}
+ ~CAutoTrace() {
+ DbgLog((LOG_TRACE, _level, _szLeaving, _szBlkName));
+ }
};
#if defined (__FUNCTION__)
diff --git a/thirdparties/win32/include/directshow/wxlist.h b/thirdparties/win32/include/directshow/wxlist.h
index 931893d..fd8024f 100755
--- a/thirdparties/win32/include/directshow/wxlist.h
+++ b/thirdparties/win32/include/directshow/wxlist.h
@@ -27,30 +27,32 @@
#ifndef __WXLIST__
#define __WXLIST__
- /* A POSITION represents (in some fashion that's opaque) a cursor
- on the list that can be set to identify any element. NULL is
- a valid value and several operations regard NULL as the position
- "one step off the end of the list". (In an n element list there
- are n+1 places to insert and NULL is that "n+1-th" value).
- The POSITION of an element in the list is only invalidated if
- that element is deleted. Move operations may mean that what
- was a valid POSITION in one list is now a valid POSITION in
- a different list.
-
- Some operations which at first sight are illegal are allowed as
- harmless no-ops. For instance RemoveHead is legal on an empty
- list and it returns NULL. This allows an atomic way to test if
- there is an element there, and if so, get it. The two operations
- AddTail and RemoveHead thus implement a MONITOR (See Hoare's paper).
-
- Single element operations return POSITIONs, non-NULL means it worked.
- whole list operations return a BOOL. TRUE means it all worked.
-
- This definition is the same as the POSITION type for MFCs, so we must
- avoid defining it twice.
- */
+/* A POSITION represents (in some fashion that's opaque) a cursor
+ on the list that can be set to identify any element. NULL is
+ a valid value and several operations regard NULL as the position
+ "one step off the end of the list". (In an n element list there
+ are n+1 places to insert and NULL is that "n+1-th" value).
+ The POSITION of an element in the list is only invalidated if
+ that element is deleted. Move operations may mean that what
+ was a valid POSITION in one list is now a valid POSITION in
+ a different list.
+
+ Some operations which at first sight are illegal are allowed as
+ harmless no-ops. For instance RemoveHead is legal on an empty
+ list and it returns NULL. This allows an atomic way to test if
+ there is an element there, and if so, get it. The two operations
+ AddTail and RemoveHead thus implement a MONITOR (See Hoare's paper).
+
+ Single element operations return POSITIONs, non-NULL means it worked.
+ whole list operations return a BOOL. TRUE means it all worked.
+
+ This definition is the same as the POSITION type for MFCs, so we must
+ avoid defining it twice.
+*/
#ifndef __AFX_H__
-struct __POSITION { int unused; };
+struct __POSITION {
+ int unused;
+};
typedef __POSITION* POSITION;
#endif
@@ -61,22 +63,24 @@ const int DEFAULTCACHE = 10; /* Default node object cache size */
to the object that it looks after.
All of these pointers can be retrieved or set through member functions.
*/
-class CBaseList
+class CBaseList
#ifdef DEBUG
: public CBaseObject
#endif
{
/* Making these classes inherit from CBaseObject does nothing
functionally but it allows us to check there are no memory
- leaks in debug builds.
+ leaks in debug builds.
*/
public:
#ifdef DEBUG
- class CNode : public CBaseObject {
+ class CNode : public CBaseObject
+ {
#else
- class CNode {
+ class CNode
+ {
#endif
CNode *m_pPrev; /* Previous node in the list */
@@ -95,36 +99,48 @@ public:
/* Return the previous node before this one */
- __out CNode *Prev() const { return m_pPrev; };
+ __out CNode *Prev() const {
+ return m_pPrev;
+ };
/* Return the next node after this one */
- __out CNode *Next() const { return m_pNext; };
+ __out CNode *Next() const {
+ return m_pNext;
+ };
/* Set the previous node before this one */
- void SetPrev(__in_opt CNode *p) { m_pPrev = p; };
+ void SetPrev(__in_opt CNode *p) {
+ m_pPrev = p;
+ };
/* Set the next node after this one */
- void SetNext(__in_opt CNode *p) { m_pNext = p; };
+ void SetNext(__in_opt CNode *p) {
+ m_pNext = p;
+ };
/* Get the pointer to the object for this node */
- __out void *GetData() const { return m_pObject; };
+ __out void *GetData() const {
+ return m_pObject;
+ };
/* Set the pointer to the object for this node */
- void SetData(__in void *p) { m_pObject = p; };
+ void SetData(__in void *p) {
+ m_pObject = p;
+ };
};
class CNodeCache
{
public:
CNodeCache(INT iCacheSize) : m_iCacheSize(iCacheSize),
- m_pHead(NULL),
- m_iUsed(0)
- {};
+ m_pHead(NULL),
+ m_iUsed(0) {
+ };
~CNodeCache() {
CNode *pNode = m_pHead;
while (pNode) {
@@ -133,24 +149,24 @@ public:
delete pCurrent;
}
};
- void AddToCache(__inout CNode *pNode)
- {
+ void AddToCache(__inout CNode *pNode) {
if (m_iUsed < m_iCacheSize) {
pNode->SetNext(m_pHead);
m_pHead = pNode;
m_iUsed++;
- } else {
+ }
+ else {
delete pNode;
}
};
- CNode *RemoveFromCache()
- {
+ CNode *RemoveFromCache() {
CNode *pNode = m_pHead;
if (pNode != NULL) {
m_pHead = pNode->Next();
m_iUsed--;
ASSERT(m_iUsed >= 0);
- } else {
+ }
+ else {
ASSERT(m_iUsed == 0);
}
return pNode;
@@ -258,8 +274,7 @@ public:
in ALL cases. All the other arguments probably are reflections
of the algebraic point.
*/
- __out_opt POSITION Next(__in_opt POSITION pos) const
- {
+ __out_opt POSITION Next(__in_opt POSITION pos) const {
if (pos == NULL) {
return (POSITION) m_pFirst;
}
@@ -268,8 +283,7 @@ public:
} //Next
// See Next
- __out_opt POSITION Prev(__in_opt POSITION pos) const
- {
+ __out_opt POSITION Prev(__in_opt POSITION pos) const {
if (pos == NULL) {
return (POSITION) m_pLast;
}
@@ -380,9 +394,9 @@ public:
Return the position of the new object, NULL if it fails
Existing POSITIONs in *this are undisturbed, including p.
*/
- protected:
+protected:
__out_opt POSITION AddBeforeI(__in_opt POSITION p, __in void * pObj);
- public:
+public:
/* Add the list *pList to *this before position p in *this
AddAfter(NULL,x) adds x to the start - equivalent to AddHead
@@ -479,7 +493,7 @@ public:
/* set cursor to the position of each element of list in turn */
- #define TRAVERSELIST(list, cursor) \
+#define TRAVERSELIST(list, cursor) \
for ( cursor = (list).GetHeadPosition() \
; cursor!=NULL \
; cursor = (list).Next(cursor) \
@@ -489,7 +503,7 @@ public:
/* set cursor to the position of each element of list in turn
in reverse order
*/
- #define REVERSETRAVERSELIST(list, cursor) \
+#define REVERSETRAVERSELIST(list, cursor) \
for ( cursor = (list).GetTailPosition() \
; cursor!=NULL \
; cursor = (list).Prev(cursor) \
@@ -504,42 +518,76 @@ public:
INT iItems,
BOOL bLock = TRUE,
BOOL bAlert = FALSE) :
- CBaseList(pName, iItems) {
+ CBaseList(pName, iItems) {
UNREFERENCED_PARAMETER(bAlert);
UNREFERENCED_PARAMETER(bLock);
};
CGenericList(__in_opt LPCTSTR pName) :
- CBaseList(pName) {
+ CBaseList(pName) {
};
- __out_opt POSITION GetHeadPosition() const { return (POSITION)m_pFirst; }
- __out_opt POSITION GetTailPosition() const { return (POSITION)m_pLast; }
- int GetCount() const { return m_Count; }
-
- __out OBJECT *GetNext(__inout POSITION& rp) const { return (OBJECT *) GetNextI(rp); }
-
- __out_opt OBJECT *Get(__in_opt POSITION p) const { return (OBJECT *) GetI(p); }
- __out OBJECT *GetValid(__in POSITION p) const { return (OBJECT *) GetValidI(p); }
- __out_opt OBJECT *GetHead() const { return Get(GetHeadPosition()); }
-
- __out_opt OBJECT *RemoveHead() { return (OBJECT *) RemoveHeadI(); }
-
- __out_opt OBJECT *RemoveTail() { return (OBJECT *) RemoveTailI(); }
-
- __out_opt OBJECT *Remove(__in_opt POSITION p) { return (OBJECT *) RemoveI(p); }
- __out_opt POSITION AddBefore(__in_opt POSITION p, __in OBJECT * pObj) { return AddBeforeI(p, pObj); }
- __out_opt POSITION AddAfter(__in_opt POSITION p, __in OBJECT * pObj) { return AddAfterI(p, pObj); }
- __out_opt POSITION AddHead(__in OBJECT * pObj) { return AddHeadI(pObj); }
- __out_opt POSITION AddTail(__in OBJECT * pObj) { return AddTailI(pObj); }
- BOOL AddTail(__in CGenericList<OBJECT> *pList)
- { return CBaseList::AddTail((CBaseList *) pList); }
- BOOL AddHead(__in CGenericList<OBJECT> *pList)
- { return CBaseList::AddHead((CBaseList *) pList); }
- BOOL AddAfter(__in_opt POSITION p, __in CGenericList<OBJECT> *pList)
- { return CBaseList::AddAfter(p, (CBaseList *) pList); };
- BOOL AddBefore(__in_opt POSITION p, __in CGenericList<OBJECT> *pList)
- { return CBaseList::AddBefore(p, (CBaseList *) pList); };
- __out_opt POSITION Find( __in OBJECT * pObj) const { return FindI(pObj); }
+ __out_opt POSITION GetHeadPosition() const {
+ return (POSITION)m_pFirst;
+ }
+ __out_opt POSITION GetTailPosition() const {
+ return (POSITION)m_pLast;
+ }
+ int GetCount() const {
+ return m_Count;
+ }
+
+ __out OBJECT *GetNext(__inout POSITION& rp) const {
+ return (OBJECT *) GetNextI(rp);
+ }
+
+ __out_opt OBJECT *Get(__in_opt POSITION p) const {
+ return (OBJECT *) GetI(p);
+ }
+ __out OBJECT *GetValid(__in POSITION p) const {
+ return (OBJECT *) GetValidI(p);
+ }
+ __out_opt OBJECT *GetHead() const {
+ return Get(GetHeadPosition());
+ }
+
+ __out_opt OBJECT *RemoveHead() {
+ return (OBJECT *) RemoveHeadI();
+ }
+
+ __out_opt OBJECT *RemoveTail() {
+ return (OBJECT *) RemoveTailI();
+ }
+
+ __out_opt OBJECT *Remove(__in_opt POSITION p) {
+ return (OBJECT *) RemoveI(p);
+ }
+ __out_opt POSITION AddBefore(__in_opt POSITION p, __in OBJECT * pObj) {
+ return AddBeforeI(p, pObj);
+ }
+ __out_opt POSITION AddAfter(__in_opt POSITION p, __in OBJECT * pObj) {
+ return AddAfterI(p, pObj);
+ }
+ __out_opt POSITION AddHead(__in OBJECT * pObj) {
+ return AddHeadI(pObj);
+ }
+ __out_opt POSITION AddTail(__in OBJECT * pObj) {
+ return AddTailI(pObj);
+ }
+ BOOL AddTail(__in CGenericList<OBJECT> *pList) {
+ return CBaseList::AddTail((CBaseList *) pList);
+ }
+ BOOL AddHead(__in CGenericList<OBJECT> *pList) {
+ return CBaseList::AddHead((CBaseList *) pList);
+ }
+ BOOL AddAfter(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) {
+ return CBaseList::AddAfter(p, (CBaseList *) pList);
+ };
+ BOOL AddBefore(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) {
+ return CBaseList::AddBefore(p, (CBaseList *) pList);
+ };
+ __out_opt POSITION Find( __in OBJECT * pObj) const {
+ return FindI(pObj);
+ }
}; // end of class declaration
diff --git a/thirdparties/win32/include/directshow/wxutil.h b/thirdparties/win32/include/directshow/wxutil.h
index 3bfc2d2..db2149d 100755
--- a/thirdparties/win32/include/directshow/wxutil.h
+++ b/thirdparties/win32/include/directshow/wxutil.h
@@ -15,7 +15,8 @@
#pragma warning(disable: 4705)
// wrapper for whatever critical section we have
-class CCritSec {
+class CCritSec
+{
// make copy constructor and assignment operator inaccessible
@@ -66,21 +67,22 @@ public:
//
#ifdef DEBUG
- BOOL WINAPI CritCheckIn(CCritSec * pcCrit);
- BOOL WINAPI CritCheckIn(const CCritSec * pcCrit);
- BOOL WINAPI CritCheckOut(CCritSec * pcCrit);
- BOOL WINAPI CritCheckOut(const CCritSec * pcCrit);
- void WINAPI DbgLockTrace(CCritSec * pcCrit, BOOL fTrace);
+BOOL WINAPI CritCheckIn(CCritSec * pcCrit);
+BOOL WINAPI CritCheckIn(const CCritSec * pcCrit);
+BOOL WINAPI CritCheckOut(CCritSec * pcCrit);
+BOOL WINAPI CritCheckOut(const CCritSec * pcCrit);
+void WINAPI DbgLockTrace(CCritSec * pcCrit, BOOL fTrace);
#else
- #define CritCheckIn(x) TRUE
- #define CritCheckOut(x) TRUE
- #define DbgLockTrace(pc, fT)
+#define CritCheckIn(x) TRUE
+#define CritCheckOut(x) TRUE
+#define DbgLockTrace(pc, fT)
#endif
// locks a critical section, and unlocks it automatically
// when the lock goes out of scope
-class CAutoLock {
+class CAutoLock
+{
// make copy constructor and assignment operator inaccessible
@@ -91,8 +93,7 @@ protected:
CCritSec * m_pLock;
public:
- CAutoLock(CCritSec * plock)
- {
+ CAutoLock(CCritSec * plock) {
m_pLock = plock;
m_pLock->Lock();
};
@@ -121,14 +122,22 @@ public:
~CAMEvent();
// Cast to HANDLE - we don't support this as an lvalue
- operator HANDLE () const { return m_hEvent; };
+ operator HANDLE () const {
+ return m_hEvent;
+ };
- void Set() {EXECUTE_ASSERT(SetEvent(m_hEvent));};
+ void Set() {
+ EXECUTE_ASSERT(SetEvent(m_hEvent));
+ };
BOOL Wait(DWORD dwTimeout = INFINITE) {
- return (WaitForSingleObject(m_hEvent, dwTimeout) == WAIT_OBJECT_0);
+ return (WaitForSingleObject(m_hEvent, dwTimeout) == WAIT_OBJECT_0);
+ };
+ void Reset() {
+ ResetEvent(m_hEvent);
+ };
+ BOOL Check() {
+ return Wait(0);
};
- void Reset() { ResetEvent(m_hEvent); };
- BOOL Check() { return Wait(0); };
};
@@ -155,7 +164,8 @@ public:
#ifdef AM_NOVTABLE
// simple thread class supports creation of worker thread, synchronization
// and communication. Can be derived to simplify parameter passing
-class AM_NOVTABLE CAMThread {
+class AM_NOVTABLE CAMThread
+{
// make copy constructor and assignment operator inaccessible
@@ -211,11 +221,11 @@ public:
// ThreadExists
// Return TRUE if the thread exists. FALSE otherwise
- BOOL ThreadExists(void) const
- {
+ BOOL ThreadExists(void) const {
if (m_hThread == 0) {
return FALSE;
- } else {
+ }
+ else {
return TRUE;
}
}
@@ -231,10 +241,14 @@ public:
// If you want to do WaitForMultipleObjects you'll need to include
// this handle in your wait list or you won't be responsive
- HANDLE GetRequestHandle() const { return m_EventSend; };
+ HANDLE GetRequestHandle() const {
+ return m_EventSend;
+ };
// Find out what the request was
- DWORD GetRequestParam() const { return m_dwParam; };
+ DWORD GetRequestParam() const {
+ return m_dwParam;
+ };
// call CoInitializeEx (COINIT_DISABLE_OLE1DDE) if
// available. S_FALSE means it's not available.
@@ -258,7 +272,8 @@ public:
#define DEFAULT_QUEUESIZE 2
-template <class T> class CQueue {
+template <class T> class CQueue
+{
private:
HANDLE hSemPut; // Semaphore controlling queue "putting"
HANDLE hSemGet; // Semaphore controlling queue "getting"
@@ -375,9 +390,9 @@ inline void * __cdecl memchrInternal(const void *buf, int chr, size_t cnt)
repne scasb // look for the byte in the byte stream
jnz exit_memchr // Z flag set if byte found
dec edi // scasb always increments edi even when it
- // finds the required byte
+ // finds the required byte
mov pRet, edi
-exit_memchr:
+ exit_memchr:
}
return pRet;
@@ -482,38 +497,65 @@ IUnknown* QzAtlComPtrAssign(__deref_inout_opt IUnknown** pp, __in_opt IUnknown*
template <class T>
class QzCComPtr
{
-public:
- typedef T _PtrClass;
- QzCComPtr() {p=NULL;}
- QzCComPtr(T* lp)
- {
- if ((p = lp) != NULL)
- p->AddRef();
- }
- QzCComPtr(const QzCComPtr<T>& lp)
- {
- if ((p = lp.p) != NULL)
- p->AddRef();
- }
- ~QzCComPtr() {if (p) p->Release();}
- void Release() {if (p) p->Release(); p=NULL;}
- operator T*() {return (T*)p;}
- T& operator*() {ASSERT(p!=NULL); return *p; }
- //The assert on operator& usually indicates a bug. If this is really
- //what is needed, however, take the address of the p member explicitly.
- T** operator&() { ASSERT(p==NULL); return &p; }
- T* operator->() { ASSERT(p!=NULL); return p; }
- T* operator=(T* lp){return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp);}
- T* operator=(const QzCComPtr<T>& lp)
- {
- return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp.p);
- }
+ public:
+ typedef T _PtrClass;
+ QzCComPtr() {
+ p=NULL;
+ }
+ QzCComPtr(T* lp) {
+ if ((p = lp) != NULL) {
+ p->AddRef();
+ }
+ }
+ QzCComPtr(const QzCComPtr<T>& lp) {
+ if ((p = lp.p) != NULL) {
+ p->AddRef();
+ }
+ }
+ ~QzCComPtr() {
+ if (p) {
+ p->Release();
+ }
+ }
+ void Release() {
+ if (p) {
+ p->Release();
+ }
+ p=NULL;
+ }
+ operator T*() {
+ return (T*)p;
+ }
+ T& operator*() {
+ ASSERT(p!=NULL);
+ return *p;
+ }
+ //The assert on operator& usually indicates a bug. If this is really
+ //what is needed, however, take the address of the p member explicitly.
+ T** operator&() {
+ ASSERT(p==NULL);
+ return &p;
+ }
+ T* operator->() {
+ ASSERT(p!=NULL);
+ return p;
+ }
+ T* operator=(T* lp) {
+ return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp);
+ }
+ T* operator=(const QzCComPtr<T>& lp) {
+ return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp.p);
+ }
#if _MSC_VER>1020
- bool operator!(){return (p == NULL);}
+ bool operator!() {
+ return (p == NULL);
+ }
#else
- BOOL operator!(){return (p == NULL) ? TRUE : FALSE;}
+ BOOL operator!() {
+ return (p == NULL) ? TRUE : FALSE;
+ }
#endif
- T* p;
+ T* p;
};
MMRESULT CompatibleTimeSetEvent( UINT uDelay, UINT uResolution, __in LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent );
diff --git a/thirdparties/win32/include/g729a/LD8A.H b/thirdparties/win32/include/g729a/LD8A.H
index e9b7359..6e027f9 100755
--- a/thirdparties/win32/include/g729a/LD8A.H
+++ b/thirdparties/win32/include/g729a/LD8A.H
@@ -42,18 +42,18 @@
*-------------------------------*/
Word32 Inv_sqrt( /* (o) Q30 : output value (range: 0<=val<1) */
- Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
+ Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
);
void Log2(
- Word32 L_x, /* (i) Q0 : input value */
- Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
- Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
+ Word32 L_x, /* (i) Q0 : input value */
+ Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
+ Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
);
Word32 Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffffff) */
- Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
- Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
+ Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
+ Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
);
/*-------------------------------*
@@ -64,13 +64,13 @@ void Init_Pre_Process(void);
void Init_Post_Process(void);
void Pre_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
void Post_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
/*----------------------------------*
@@ -80,17 +80,17 @@ void Post_Process(
void Init_Coder_ld8a(void);
void Coder_ld8a(
- Word16 ana[] /* output : Analysis parameters */
+ Word16 ana[] /* output : Analysis parameters */
);
void Init_Decod_ld8a(void);
void Decod_ld8a(
- Word16 parm[], /* (i) : vector of synthesis parameters
+ Word16 parm[], /* (i) : vector of synthesis parameters
parm[0] = bad frame indicator (bfi) */
- Word16 synth[], /* (o) : synthesis speech */
- Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
- Word16 *T2 /* (o) : decoded pitch lag in 2 subframes */
+ Word16 synth[], /* (o) : synthesis speech */
+ Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
+ Word16 *T2 /* (o) : decoded pitch lag in 2 subframes */
);
/*-------------------------------*
@@ -98,82 +98,82 @@ void Decod_ld8a(
*-------------------------------*/
void Autocorr(
- Word16 x[], /* (i) : Input signal */
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (o) : Autocorrelations (msb) */
- Word16 r_l[] /* (o) : Autocorrelations (lsb) */
+ Word16 x[], /* (i) : Input signal */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (o) : Autocorrelations (msb) */
+ Word16 r_l[] /* (o) : Autocorrelations (lsb) */
);
void Lag_window(
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
- Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
+ Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
);
void Levinson(
- Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
- Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
- Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
- Word16 rc[] /* (o) Q15 : rc[M] Relection coefficients. */
+ Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
+ Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
+ Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
+ Word16 rc[] /* (o) Q15 : rc[M] Relection coefficients. */
);
void Az_lsp(
- Word16 a[], /* (i) Q12 : predictor coefficients */
- Word16 lsp[], /* (o) Q15 : line spectral pairs */
- Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
+ Word16 a[], /* (i) Q12 : predictor coefficients */
+ Word16 lsp[], /* (o) Q15 : line spectral pairs */
+ Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
);
void Lsp_Az(
- Word16 lsp[], /* (i) Q15 : line spectral frequencies */
- Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
+ Word16 lsp[], /* (i) Q15 : line spectral frequencies */
+ Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
);
void Lsf_lsp(
- Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 m /* (i) : LPC order */
);
void Int_qlpc(
- Word16 lsp_old[], /* input : LSP vector of past frame */
- Word16 lsp_new[], /* input : LSP vector of present frame */
- Word16 Az[] /* output: interpolated Az() for the 2 subframes */
+ Word16 lsp_old[], /* input : LSP vector of past frame */
+ Word16 lsp_new[], /* input : LSP vector of present frame */
+ Word16 Az[] /* output: interpolated Az() for the 2 subframes */
);
void Weight_Az(
- Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
- Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
- Word16 m, /* (i) : LPC order. */
- Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
+ Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
+ Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
+ Word16 m, /* (i) : LPC order. */
+ Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
);
void Residu(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
- Word16 y[], /* (o) : residual signal */
- Word16 lg /* (i) : size of filtering */
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
+ Word16 y[], /* (o) : residual signal */
+ Word16 lg /* (i) : size of filtering */
);
void Syn_filt(
- Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
- Word16 x[], /* (i) : input signal */
- Word16 y[], /* (o) : output signal */
- Word16 lg, /* (i) : size of filtering */
- Word16 mem[], /* (i/o) : memory associated with this filtering. */
- Word16 update /* (i) : 0=no update, 1=update of memory. */
+ Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
+ Word16 x[], /* (i) : input signal */
+ Word16 y[], /* (o) : output signal */
+ Word16 lg, /* (i) : size of filtering */
+ Word16 mem[], /* (i/o) : memory associated with this filtering. */
+ Word16 update /* (i) : 0=no update, 1=update of memory. */
);
void Convolve(
- Word16 x[], /* (i) : input vector */
- Word16 h[], /* (i) Q12 : impulse response */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector size */
+ Word16 x[], /* (i) : input vector */
+ Word16 h[], /* (i) Q12 : impulse response */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector size */
);
/*--------------------------------------------------------------------------*
@@ -189,75 +189,75 @@ void Convolve(
*-----------------------*/
Word16 Pitch_ol_fast( /* output: open loop pitch lag */
- Word16 signal[], /* input : signal used to compute the open loop pitch */
- /* signal[-pit_max] to signal[-1] should be known */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 L_frame /* input : length of frame to compute pitch */
+ Word16 signal[], /* input : signal used to compute the open loop pitch */
+ /* signal[-pit_max] to signal[-1] should be known */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 L_frame /* input : length of frame to compute pitch */
);
Word16 Pitch_fr3_fast(/* (o) : pitch period. */
- Word16 exc[], /* (i) : excitation buffer */
- Word16 xn[], /* (i) : target vector */
- Word16 h[], /* (i) Q12 : impulse response of filters. */
- Word16 L_subfr, /* (i) : Length of subframe */
- Word16 t0_min, /* (i) : minimum value in the searched range. */
- Word16 t0_max, /* (i) : maximum value in the searched range. */
- Word16 i_subfr, /* (i) : indicator for first subframe. */
- Word16 *pit_frac /* (o) : chosen fraction. */
+ Word16 exc[], /* (i) : excitation buffer */
+ Word16 xn[], /* (i) : target vector */
+ Word16 h[], /* (i) Q12 : impulse response of filters. */
+ Word16 L_subfr, /* (i) : Length of subframe */
+ Word16 t0_min, /* (i) : minimum value in the searched range. */
+ Word16 t0_max, /* (i) : maximum value in the searched range. */
+ Word16 i_subfr, /* (i) : indicator for first subframe. */
+ Word16 *pit_frac /* (o) : chosen fraction. */
);
Word16 G_pitch( /* (o) Q14 : Gain of pitch lag saturated to 1.2 */
- Word16 xn[], /* (i) : Pitch target. */
- Word16 y1[], /* (i) : Filtered adaptive codebook. */
- Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
- Word16 L_subfr /* (i) : Length of subframe. */
+ Word16 xn[], /* (i) : Pitch target. */
+ Word16 y1[], /* (i) : Filtered adaptive codebook. */
+ Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
+ Word16 L_subfr /* (i) : Length of subframe. */
);
Word16 Enc_lag3( /* output: Return index of encoding */
- Word16 T0, /* input : Pitch delay */
- Word16 T0_frac, /* input : Fractional pitch delay */
- Word16 *T0_min, /* in/out: Minimum search delay */
- Word16 *T0_max, /* in/out: Maximum search delay */
- Word16 pit_min, /* input : Minimum pitch delay */
- Word16 pit_max, /* input : Maximum pitch delay */
- Word16 pit_flag /* input : Flag for 1st subframe */
+ Word16 T0, /* input : Pitch delay */
+ Word16 T0_frac, /* input : Fractional pitch delay */
+ Word16 *T0_min, /* in/out: Minimum search delay */
+ Word16 *T0_max, /* in/out: Maximum search delay */
+ Word16 pit_min, /* input : Minimum pitch delay */
+ Word16 pit_max, /* input : Maximum pitch delay */
+ Word16 pit_flag /* input : Flag for 1st subframe */
);
void Dec_lag3( /* output: return integer pitch lag */
- Word16 index, /* input : received pitch index */
- Word16 pit_min, /* input : minimum pitch lag */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 i_subfr, /* input : subframe flag */
- Word16 *T0, /* output: integer part of pitch lag */
- Word16 *T0_frac /* output: fractional part of pitch lag */
+ Word16 index, /* input : received pitch index */
+ Word16 pit_min, /* input : minimum pitch lag */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 i_subfr, /* input : subframe flag */
+ Word16 *T0, /* output: integer part of pitch lag */
+ Word16 *T0_frac /* output: fractional part of pitch lag */
);
Word16 Interpol_3( /* (o) : interpolated value */
- Word16 *x, /* (i) : input vector */
- Word16 frac /* (i) : fraction */
+ Word16 *x, /* (i) : input vector */
+ Word16 frac /* (i) : fraction */
);
void Pred_lt_3(
- Word16 exc[], /* in/out: excitation buffer */
- Word16 T0, /* input : integer pitch lag */
- Word16 frac, /* input : fraction of lag */
- Word16 L_subfr /* input : subframe size */
+ Word16 exc[], /* in/out: excitation buffer */
+ Word16 T0, /* input : integer pitch lag */
+ Word16 frac, /* input : fraction of lag */
+ Word16 L_subfr /* input : subframe size */
);
Word16 Parity_Pitch( /* output: parity bit (XOR of 6 MSB bits) */
- Word16 pitch_index /* input : index for which parity to compute */
+ Word16 pitch_index /* input : index for which parity to compute */
);
Word16 Check_Parity_Pitch( /* output: 0 = no error, 1= error */
- Word16 pitch_index, /* input : index of parameter */
- Word16 parity /* input : parity bit */
+ Word16 pitch_index, /* input : index of parameter */
+ Word16 parity /* input : parity bit */
);
void Cor_h_X(
- Word16 h[], /* (i) Q12 :Impulse response of filters */
- Word16 X[], /* (i) :Target vector */
- Word16 D[] /* (o) :Correlations between h[] and D[] */
- /* Normalized to 13 bits */
+ Word16 h[], /* (i) Q12 :Impulse response of filters */
+ Word16 X[], /* (i) :Target vector */
+ Word16 D[] /* (o) :Correlations between h[] and D[] */
+ /* Normalized to 13 bits */
);
/*-----------------------*
@@ -278,19 +278,19 @@ void Cor_h_X(
#define _1_16 (Word16)( 2048)
Word16 ACELP_Code_A( /* (o) :index of pulses positions */
- Word16 x[], /* (i) :Target vector */
- Word16 h[], /* (i) Q12 :Inpulse response of filters */
- Word16 T0, /* (i) :Pitch lag */
- Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
- Word16 code[], /* (o) Q13 :Innovative codebook */
- Word16 y[], /* (o) Q12 :Filtered innovative codebook */
- Word16 *sign /* (o) :Signs of 4 pulses */
+ Word16 x[], /* (i) :Target vector */
+ Word16 h[], /* (i) Q12 :Inpulse response of filters */
+ Word16 T0, /* (i) :Pitch lag */
+ Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
+ Word16 code[], /* (o) Q13 :Innovative codebook */
+ Word16 y[], /* (o) Q12 :Filtered innovative codebook */
+ Word16 *sign /* (o) :Signs of 4 pulses */
);
void Decod_ACELP(
- Word16 sign, /* (i) : signs of 4 pulses. */
- Word16 index, /* (i) : Positions of the 4 pulses. */
- Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
+ Word16 sign, /* (i) : signs of 4 pulses. */
+ Word16 index, /* (i) : Positions of the 4 pulses. */
+ Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
);
/*--------------------------------------------------------------------------*
* LSP constant parameters *
@@ -322,152 +322,152 @@ void Decod_ACELP(
*-------------------------------*/
void Lsf_lsp2(
- Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf2(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 m /* (i) : LPC order */
);
void Qua_lsp(
- Word16 lsp[], /* (i) Q15 : Unquantized LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
- Word16 ana[] /* (o) : indexes */
+ Word16 lsp[], /* (i) Q15 : Unquantized LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
+ Word16 ana[] /* (o) : indexes */
);
void Get_wegt(
- Word16 flsp[], /* Q13 */
- Word16 wegt[] /* Q11 -> normalized */
+ Word16 flsp[], /* Q13 */
+ Word16 wegt[] /* Q11 -> normalized */
);
void Lsp_encw_reset(
- void
+ void
);
void Lsp_qua_cs(
- Word16 flsp_in[M], /* Q13 */
- Word16 lspq_out[M], /* Q13 */
- Word16 *code
+ Word16 flsp_in[M], /* Q13 */
+ Word16 lspq_out[M], /* Q13 */
+ Word16 *code
);
void Lsp_expand_1(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_1_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_get_quant(
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 code0,
- Word16 code1,
- Word16 code2,
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 lspq[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 code0,
+ Word16 code1,
+ Word16 code2,
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 lspq[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_get_tdist(
- Word16 wegt[], /* normalized */
- Word16 buf[], /* Q13 */
- Word32 *L_tdist, /* Q27 */
- Word16 rbuf[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 wegt[], /* normalized */
+ Word16 buf[], /* Q13 */
+ Word32 *L_tdist, /* Q27 */
+ Word16 rbuf[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_last_select(
- Word32 L_tdist[], /* Q27 */
- Word16 *mode_index
+ Word32 L_tdist[], /* Q27 */
+ Word16 *mode_index
);
void Lsp_pre_select(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 *cand
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 *cand
);
void Lsp_select_1(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_select_2(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_stability(
- Word16 buf[] /* Q13 */
+ Word16 buf[] /* Q13 */
);
void Relspwed(
- Word16 lsp[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspq[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 fg[MODE][MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum[MODE][M], /* Q15 */
- Word16 fg_sum_inv[MODE][M], /* Q12 */
- Word16 code_ana[]
+ Word16 lsp[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspq[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 fg[MODE][MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum[MODE][M], /* Q15 */
+ Word16 fg_sum_inv[MODE][M], /* Q12 */
+ Word16 code_ana[]
);
void D_lsp(
- Word16 prm[], /* (i) : indexes of the selected LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
- Word16 erase /* (i) : frame erase information */
+ Word16 prm[], /* (i) : indexes of the selected LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
+ Word16 erase /* (i) : frame erase information */
);
void Lsp_decw_reset(
- void
+ void
);
void Lsp_iqua_cs(
- Word16 prm[], /* input : codes of the selected LSP*/
- Word16 lsp_q[], /* output: Quantized LSP parameters*/
- Word16 erase /* input : frame erase information */
+ Word16 prm[], /* input : codes of the selected LSP*/
+ Word16 lsp_q[], /* output: Quantized LSP parameters*/
+ Word16 erase /* input : frame erase information */
);
void Lsp_prev_compose(
- Word16 lsp_ele[], /* Q13 */
- Word16 lsp[], /* Q13 */
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lsp_ele[], /* Q13 */
+ Word16 lsp[], /* Q13 */
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_prev_extract(
- Word16 lsp[M], /* Q13 */
- Word16 lsp_ele[M], /* Q13 */
- Word16 fg[MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum_inv[M] /* Q12 */
+ Word16 lsp[M], /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 fg[MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum_inv[M] /* Q12 */
);
void Lsp_prev_update(
- Word16 lsp_ele[M], /* Q13 */
- Word16 freq_prev[MA_NP][M] /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 freq_prev[MA_NP][M] /* Q13 */
);
/*-------------------------------*
@@ -487,48 +487,48 @@ void Lsp_prev_update(
*--------------------------------------------------------------------------*/
Word16 Qua_gain(
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
- /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
- Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod, /* (o) Q1 : Code gain. */
- Word16 tameflag /* (i) : flag set to 1 if taming is needed */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
+ /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
+ Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod, /* (o) Q1 : Code gain. */
+ Word16 tameflag /* (i) : flag set to 1 if taming is needed */
);
void Dec_gain(
- Word16 index, /* (i) : Index of quantization. */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 bfi, /* (i) : Bad frame indicator */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod /* (o) Q1 : Code gain. */
+ Word16 index, /* (i) : Index of quantization. */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 bfi, /* (i) : Bad frame indicator */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod /* (o) Q1 : Code gain. */
);
void Gain_predict(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
- Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
+ Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
);
void Gain_update(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
);
void Gain_update_erasure(
- Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
+ Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
);
void Corr_xy2(
- Word16 xn[], /* (i) Q0 :Target vector. */
- Word16 y1[], /* (i) Q0 :Adaptive codebook. */
- Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
- Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
- Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
+ Word16 xn[], /* (i) Q0 :Target vector. */
+ Word16 y1[], /* (i) Q0 :Adaptive codebook. */
+ Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
+ Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
+ Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
);
/*-----------------------*
@@ -564,30 +564,30 @@ void bits2prm_ld8k(Word16 bits[], Word16 prm[]);
void Init_Post_Filter(void);
void Post_Filter(
- Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
- Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
- Word16 *T /* input : decoded pitch lags in all subframes */
+ Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
+ Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
+ Word16 *T /* input : decoded pitch lags in all subframes */
);
void pit_pst_filt(
- Word16 *signal, /* (i) : input signal */
- Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
- Word16 t0_min, /* (i) : minimum value in the searched range */
- Word16 t0_max, /* (i) : maximum value in the searched range */
- Word16 L_subfr, /* (i) : size of filtering */
- Word16 *signal_pst /* (o) : harmonically postfiltered signal */
+ Word16 *signal, /* (i) : input signal */
+ Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
+ Word16 t0_min, /* (i) : minimum value in the searched range */
+ Word16 t0_max, /* (i) : maximum value in the searched range */
+ Word16 L_subfr, /* (i) : size of filtering */
+ Word16 *signal_pst /* (o) : harmonically postfiltered signal */
);
void preemphasis(
- Word16 *signal, /* (i/o) : input signal overwritten by the output */
- Word16 g, /* (i) Q15 : preemphasis coefficient */
- Word16 L /* (i) : size of filtering */
+ Word16 *signal, /* (i/o) : input signal overwritten by the output */
+ Word16 g, /* (i) Q15 : preemphasis coefficient */
+ Word16 L /* (i) : size of filtering */
);
void agc(
- Word16 *sig_in, /* (i) : postfilter input signal */
- Word16 *sig_out, /* (i/o) : postfilter output signal */
- Word16 l_trm /* (i) : subframe size */
+ Word16 *sig_in, /* (i) : postfilter input signal */
+ Word16 *sig_out, /* (i/o) : postfilter output signal */
+ Word16 l_trm /* (i) : subframe size */
);
/*--------------------------------------------------------------------------*
@@ -608,14 +608,14 @@ Word16 test_err(Word16 t0, Word16 t0_frac);
*--------------------------------------------------------------------------*/
void Copy(
- Word16 x[], /* (i) : input vector */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector length */
+ Word16 x[], /* (i) : input vector */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector length */
);
void Set_zero(
- Word16 x[], /* (o) : vector to clear */
- Word16 L /* (i) : length of vector */
+ Word16 x[], /* (o) : vector to clear */
+ Word16 L /* (i) : length of vector */
);
Word16 Random(void);
diff --git a/thirdparties/win32/include/g729b/dtx.h b/thirdparties/win32/include/g729b/dtx.h
index d0cc6ac..c8af076 100755
--- a/thirdparties/win32/include/g729b/dtx.h
+++ b/thirdparties/win32/include/g729b/dtx.h
@@ -13,36 +13,36 @@
/* Encoder DTX/CNG functions */
void Init_Cod_cng(void);
void Cod_cng(
- Word16 *exc, /* (i/o) : excitation array */
- Word16 pastVad, /* (i) : previous VAD decision */
- Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
- Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
- Word16 *ana, /* (o) : coded SID parameters */
- Word16 freq_prev[MA_NP][M],
- /* (i/o) : previous LPS for quantization */
- Word16 *seed /* (i/o) : random generator seed */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 pastVad, /* (i) : previous VAD decision */
+ Word16 *lsp_old_q, /* (i/o) : previous quantized lsp */
+ Word16 *Aq, /* (o) : set of interpolated LPC coefficients */
+ Word16 *ana, /* (o) : coded SID parameters */
+ Word16 freq_prev[MA_NP][M],
+ /* (i/o) : previous LPS for quantization */
+ Word16 *seed /* (i/o) : random generator seed */
);
void Update_cng(
- Word16 *r_h, /* (i) : MSB of frame autocorrelation */
- Word16 exp_r, /* (i) : scaling factor associated */
- Word16 Vad /* (i) : current Vad decision */
+ Word16 *r_h, /* (i) : MSB of frame autocorrelation */
+ Word16 exp_r, /* (i) : scaling factor associated */
+ Word16 Vad /* (i) : current Vad decision */
);
/* SID gain Quantization */
void Qua_Sidgain(
- Word16 *ener, /* (i) array of energies */
- Word16 *sh_ener, /* (i) corresponding scaling factors */
- Word16 nb_ener, /* (i) number of energies or */
- Word16 *enerq, /* (o) decoded energies in dB */
- Word16 *idx /* (o) SID gain quantization index */
+ Word16 *ener, /* (i) array of energies */
+ Word16 *sh_ener, /* (i) corresponding scaling factors */
+ Word16 nb_ener, /* (i) number of energies or */
+ Word16 *enerq, /* (o) decoded energies in dB */
+ Word16 *idx /* (o) SID gain quantization index */
);
/* CNG excitation generation */
void Calc_exc_rand(
- Word16 cur_gain, /* (i) : target sample gain */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *seed, /* (i) : current Vad decision */
- Flag flag_cod /* (i) : encoder/decoder flag */
+ Word16 cur_gain, /* (i) : target sample gain */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *seed, /* (i) : current Vad decision */
+ Flag flag_cod /* (i) : encoder/decoder flag */
);
/* SID LSP Quantization */
@@ -54,16 +54,16 @@ void Update_decfreq_prev(Word16 x[MA_NP][M]);
/* Decoder CNG generation */
void Init_Dec_cng(void);
void Dec_cng(
- Word16 past_ftyp, /* (i) : past frame type */
- Word16 sid_sav, /* (i) : energy to recover SID gain */
- Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
- Word16 *parm, /* (i) : coded SID parameters */
- Word16 *exc, /* (i/o) : excitation array */
- Word16 *lsp_old, /* (i/o) : previous lsp */
- Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
- Word16 *seed, /* (i/o) : random generator seed */
- Word16 freq_prev[MA_NP][M]
- /* (i/o) : previous LPS for quantization */
+ Word16 past_ftyp, /* (i) : past frame type */
+ Word16 sid_sav, /* (i) : energy to recover SID gain */
+ Word16 sh_sid_sav, /* (i) : corresponding scaling factor */
+ Word16 *parm, /* (i) : coded SID parameters */
+ Word16 *exc, /* (i/o) : excitation array */
+ Word16 *lsp_old, /* (i/o) : previous lsp */
+ Word16 *A_t, /* (o) : set of interpolated LPC coefficients */
+ Word16 *seed, /* (i/o) : random generator seed */
+ Word16 freq_prev[MA_NP][M]
+ /* (i/o) : previous LPS for quantization */
);
Word16 read_frame(FILE *f_serial, Word16 *parm);
@@ -92,7 +92,7 @@ Word16 read_frame(FILE *f_serial, Word16 *parm);
#define RATE_0 0 /* 0 bit/s rate */
/* CNG excitation generation constant */
- /* alpha = 0.5 */
+/* alpha = 0.5 */
#define FRAC1 19043 /* (sqrt(40)xalpha/2 - 1) * 32768 */
#define K0 24576 /* (1 - alpha ** 2) in Q15 */
#define G_MAX 5000
diff --git a/thirdparties/win32/include/g729b/ld8a.h b/thirdparties/win32/include/g729b/ld8a.h
index 0f95011..7a847b8 100755
--- a/thirdparties/win32/include/g729b/ld8a.h
+++ b/thirdparties/win32/include/g729b/ld8a.h
@@ -43,18 +43,18 @@
*-------------------------------*/
Word32 Inv_sqrt( /* (o) Q30 : output value (range: 0<=val<1) */
- Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
+ Word32 L_x /* (i) Q0 : input value (range: 0<=val<=7fffffff) */
);
void Log2(
- Word32 L_x, /* (i) Q0 : input value */
- Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
- Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
+ Word32 L_x, /* (i) Q0 : input value */
+ Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */
+ Word16 *fraction /* (o) Q15: Fractionnal part of Log2. (range: 0<=val<1) */
);
Word32 Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffffff) */
- Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
- Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
+ Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */
+ Word16 fraction /* (i) Q15 : Fractionnal part. (range: 0.0<=val<1.0) */
);
/*-------------------------------*
@@ -65,13 +65,13 @@ void Init_Pre_Process(void);
void Init_Post_Process(void);
void Pre_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
void Post_Process(
- Word16 signal[], /* Input/output signal */
- Word16 lg /* Length of signal */
+ Word16 signal[], /* Input/output signal */
+ Word16 lg /* Length of signal */
);
/*----------------------------------*
@@ -81,20 +81,20 @@ void Post_Process(
void Init_Coder_ld8a(void);
void Coder_ld8a(
- Word16 ana[], /* output : Analysis parameters */
- Word16 frame,
- Word16 vad_enable
+ Word16 ana[], /* output : Analysis parameters */
+ Word16 frame,
+ Word16 vad_enable
);
void Init_Decod_ld8a(void);
void Decod_ld8a(
- Word16 parm[], /* (i) : vector of synthesis parameters
+ Word16 parm[], /* (i) : vector of synthesis parameters
parm[0] = bad frame indicator (bfi) */
- Word16 synth[], /* (o) : synthesis speech */
- Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
- Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
- Word16 *Vad /* (o) : VAD */
+ Word16 synth[], /* (o) : synthesis speech */
+ Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */
+ Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */
+ Word16 *Vad /* (o) : VAD */
);
/*-------------------------------*
@@ -102,84 +102,84 @@ void Decod_ld8a(
*-------------------------------*/
void Autocorr(
- Word16 x[], /* (i) : Input signal */
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (o) : Autocorrelations (msb) */
- Word16 r_l[], /* (o) : Autocorrelations (lsb) */
- Word16 *exp_R0
+ Word16 x[], /* (i) : Input signal */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (o) : Autocorrelations (msb) */
+ Word16 r_l[], /* (o) : Autocorrelations (lsb) */
+ Word16 *exp_R0
);
void Lag_window(
- Word16 m, /* (i) : LPC order */
- Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
- Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
+ Word16 m, /* (i) : LPC order */
+ Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
+ Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
);
void Levinson(
- Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
- Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
- Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
- Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
- Word16 *Err /* (o) : Residual energy */
+ Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
+ Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
+ Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */
+ Word16 rc[], /* (o) Q15 : rc[M] Relection coefficients. */
+ Word16 *Err /* (o) : Residual energy */
);
void Az_lsp(
- Word16 a[], /* (i) Q12 : predictor coefficients */
- Word16 lsp[], /* (o) Q15 : line spectral pairs */
- Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
+ Word16 a[], /* (i) Q12 : predictor coefficients */
+ Word16 lsp[], /* (o) Q15 : line spectral pairs */
+ Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
);
void Lsp_Az(
- Word16 lsp[], /* (i) Q15 : line spectral frequencies */
- Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
+ Word16 lsp[], /* (i) Q15 : line spectral frequencies */
+ Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */
);
void Lsf_lsp(
- Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */
+ Word16 m /* (i) : LPC order */
);
void Int_qlpc(
- Word16 lsp_old[], /* input : LSP vector of past frame */
- Word16 lsp_new[], /* input : LSP vector of present frame */
- Word16 Az[] /* output: interpolated Az() for the 2 subframes */
+ Word16 lsp_old[], /* input : LSP vector of past frame */
+ Word16 lsp_new[], /* input : LSP vector of present frame */
+ Word16 Az[] /* output: interpolated Az() for the 2 subframes */
);
void Weight_Az(
- Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
- Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
- Word16 m, /* (i) : LPC order. */
- Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
+ Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */
+ Word16 gamma, /* (i) Q15 : Spectral expansion factor. */
+ Word16 m, /* (i) : LPC order. */
+ Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */
);
void Residu(
- Word16 a[], /* (i) Q12 : prediction coefficients */
- Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
- Word16 y[], /* (o) : residual signal */
- Word16 lg /* (i) : size of filtering */
+ Word16 a[], /* (i) Q12 : prediction coefficients */
+ Word16 x[], /* (i) : speech (values x[-m..-1] are needed (m=10) */
+ Word16 y[], /* (o) : residual signal */
+ Word16 lg /* (i) : size of filtering */
);
void Syn_filt(
- Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
- Word16 x[], /* (i) : input signal */
- Word16 y[], /* (o) : output signal */
- Word16 lg, /* (i) : size of filtering */
- Word16 mem[], /* (i/o) : memory associated with this filtering. */
- Word16 update /* (i) : 0=no update, 1=update of memory. */
+ Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */
+ Word16 x[], /* (i) : input signal */
+ Word16 y[], /* (o) : output signal */
+ Word16 lg, /* (i) : size of filtering */
+ Word16 mem[], /* (i/o) : memory associated with this filtering. */
+ Word16 update /* (i) : 0=no update, 1=update of memory. */
);
void Convolve(
- Word16 x[], /* (i) : input vector */
- Word16 h[], /* (i) Q12 : impulse response */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector size */
+ Word16 x[], /* (i) : input vector */
+ Word16 h[], /* (i) Q12 : impulse response */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector size */
);
/*--------------------------------------------------------------------------*
@@ -195,75 +195,75 @@ void Convolve(
*-----------------------*/
Word16 Pitch_ol_fast( /* output: open loop pitch lag */
- Word16 signal[], /* input : signal used to compute the open loop pitch */
- /* signal[-pit_max] to signal[-1] should be known */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 L_frame /* input : length of frame to compute pitch */
+ Word16 signal[], /* input : signal used to compute the open loop pitch */
+ /* signal[-pit_max] to signal[-1] should be known */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 L_frame /* input : length of frame to compute pitch */
);
Word16 Pitch_fr3_fast(/* (o) : pitch period. */
- Word16 exc[], /* (i) : excitation buffer */
- Word16 xn[], /* (i) : target vector */
- Word16 h[], /* (i) Q12 : impulse response of filters. */
- Word16 L_subfr, /* (i) : Length of subframe */
- Word16 t0_min, /* (i) : minimum value in the searched range. */
- Word16 t0_max, /* (i) : maximum value in the searched range. */
- Word16 i_subfr, /* (i) : indicator for first subframe. */
- Word16 *pit_frac /* (o) : chosen fraction. */
+ Word16 exc[], /* (i) : excitation buffer */
+ Word16 xn[], /* (i) : target vector */
+ Word16 h[], /* (i) Q12 : impulse response of filters. */
+ Word16 L_subfr, /* (i) : Length of subframe */
+ Word16 t0_min, /* (i) : minimum value in the searched range. */
+ Word16 t0_max, /* (i) : maximum value in the searched range. */
+ Word16 i_subfr, /* (i) : indicator for first subframe. */
+ Word16 *pit_frac /* (o) : chosen fraction. */
);
Word16 G_pitch( /* (o) Q14 : Gain of pitch lag saturated to 1.2 */
- Word16 xn[], /* (i) : Pitch target. */
- Word16 y1[], /* (i) : Filtered adaptive codebook. */
- Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
- Word16 L_subfr /* (i) : Length of subframe. */
+ Word16 xn[], /* (i) : Pitch target. */
+ Word16 y1[], /* (i) : Filtered adaptive codebook. */
+ Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */
+ Word16 L_subfr /* (i) : Length of subframe. */
);
Word16 Enc_lag3( /* output: Return index of encoding */
- Word16 T0, /* input : Pitch delay */
- Word16 T0_frac, /* input : Fractional pitch delay */
- Word16 *T0_min, /* in/out: Minimum search delay */
- Word16 *T0_max, /* in/out: Maximum search delay */
- Word16 pit_min, /* input : Minimum pitch delay */
- Word16 pit_max, /* input : Maximum pitch delay */
- Word16 pit_flag /* input : Flag for 1st subframe */
+ Word16 T0, /* input : Pitch delay */
+ Word16 T0_frac, /* input : Fractional pitch delay */
+ Word16 *T0_min, /* in/out: Minimum search delay */
+ Word16 *T0_max, /* in/out: Maximum search delay */
+ Word16 pit_min, /* input : Minimum pitch delay */
+ Word16 pit_max, /* input : Maximum pitch delay */
+ Word16 pit_flag /* input : Flag for 1st subframe */
);
void Dec_lag3( /* output: return integer pitch lag */
- Word16 index, /* input : received pitch index */
- Word16 pit_min, /* input : minimum pitch lag */
- Word16 pit_max, /* input : maximum pitch lag */
- Word16 i_subfr, /* input : subframe flag */
- Word16 *T0, /* output: integer part of pitch lag */
- Word16 *T0_frac /* output: fractional part of pitch lag */
+ Word16 index, /* input : received pitch index */
+ Word16 pit_min, /* input : minimum pitch lag */
+ Word16 pit_max, /* input : maximum pitch lag */
+ Word16 i_subfr, /* input : subframe flag */
+ Word16 *T0, /* output: integer part of pitch lag */
+ Word16 *T0_frac /* output: fractional part of pitch lag */
);
Word16 Interpol_3( /* (o) : interpolated value */
- Word16 *x, /* (i) : input vector */
- Word16 frac /* (i) : fraction */
+ Word16 *x, /* (i) : input vector */
+ Word16 frac /* (i) : fraction */
);
void Pred_lt_3(
- Word16 exc[], /* in/out: excitation buffer */
- Word16 T0, /* input : integer pitch lag */
- Word16 frac, /* input : fraction of lag */
- Word16 L_subfr /* input : subframe size */
+ Word16 exc[], /* in/out: excitation buffer */
+ Word16 T0, /* input : integer pitch lag */
+ Word16 frac, /* input : fraction of lag */
+ Word16 L_subfr /* input : subframe size */
);
Word16 Parity_Pitch( /* output: parity bit (XOR of 6 MSB bits) */
- Word16 pitch_index /* input : index for which parity to compute */
+ Word16 pitch_index /* input : index for which parity to compute */
);
Word16 Check_Parity_Pitch( /* output: 0 = no error, 1= error */
- Word16 pitch_index, /* input : index of parameter */
- Word16 parity /* input : parity bit */
+ Word16 pitch_index, /* input : index of parameter */
+ Word16 parity /* input : parity bit */
);
void Cor_h_X(
- Word16 h[], /* (i) Q12 :Impulse response of filters */
- Word16 X[], /* (i) :Target vector */
- Word16 D[] /* (o) :Correlations between h[] and D[] */
- /* Normalized to 13 bits */
+ Word16 h[], /* (i) Q12 :Impulse response of filters */
+ Word16 X[], /* (i) :Target vector */
+ Word16 D[] /* (o) :Correlations between h[] and D[] */
+ /* Normalized to 13 bits */
);
/*-----------------------*
@@ -284,19 +284,19 @@ void Cor_h_X(
#define _1_16 (Word16)( 2048)
Word16 ACELP_Code_A( /* (o) :index of pulses positions */
- Word16 x[], /* (i) :Target vector */
- Word16 h[], /* (i) Q12 :Inpulse response of filters */
- Word16 T0, /* (i) :Pitch lag */
- Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
- Word16 code[], /* (o) Q13 :Innovative codebook */
- Word16 y[], /* (o) Q12 :Filtered innovative codebook */
- Word16 *sign /* (o) :Signs of 4 pulses */
+ Word16 x[], /* (i) :Target vector */
+ Word16 h[], /* (i) Q12 :Inpulse response of filters */
+ Word16 T0, /* (i) :Pitch lag */
+ Word16 pitch_sharp, /* (i) Q14 :Last quantized pitch gain */
+ Word16 code[], /* (o) Q13 :Innovative codebook */
+ Word16 y[], /* (o) Q12 :Filtered innovative codebook */
+ Word16 *sign /* (o) :Signs of 4 pulses */
);
void Decod_ACELP(
- Word16 sign, /* (i) : signs of 4 pulses. */
- Word16 index, /* (i) : Positions of the 4 pulses. */
- Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
+ Word16 sign, /* (i) : signs of 4 pulses. */
+ Word16 index, /* (i) : Positions of the 4 pulses. */
+ Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */
);
/*--------------------------------------------------------------------------*
* LSP constant parameters *
@@ -328,152 +328,152 @@ void Decod_ACELP(
*-------------------------------*/
void Lsf_lsp2(
- Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 m /* (i) : LPC order */
+ Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 lsp[], /* (o) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 m /* (i) : LPC order */
);
void Lsp_lsf2(
- Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
- Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
- Word16 m /* (i) : LPC order */
+ Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */
+ Word16 lsf[], /* (o) Q13 : lsf[m] (range: 0.0<=val<PI) */
+ Word16 m /* (i) : LPC order */
);
void Qua_lsp(
- Word16 lsp[], /* (i) Q15 : Unquantized LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
- Word16 ana[] /* (o) : indexes */
+ Word16 lsp[], /* (i) Q15 : Unquantized LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP */
+ Word16 ana[] /* (o) : indexes */
);
void Get_wegt(
- Word16 flsp[], /* Q13 */
- Word16 wegt[] /* Q11 -> normalized */
+ Word16 flsp[], /* Q13 */
+ Word16 wegt[] /* Q11 -> normalized */
);
void Lsp_encw_reset(
- void
+ void
);
void Lsp_qua_cs(
- Word16 flsp_in[M], /* Q13 */
- Word16 lspq_out[M], /* Q13 */
- Word16 *code
+ Word16 flsp_in[M], /* Q13 */
+ Word16 lspq_out[M], /* Q13 */
+ Word16 *code
);
void Lsp_expand_1(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_expand_1_2(
- Word16 buf[], /* Q13 */
- Word16 gap /* Q13 */
+ Word16 buf[], /* Q13 */
+ Word16 gap /* Q13 */
);
void Lsp_get_quant(
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 code0,
- Word16 code1,
- Word16 code2,
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 lspq[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 code0,
+ Word16 code1,
+ Word16 code2,
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 lspq[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_get_tdist(
- Word16 wegt[], /* normalized */
- Word16 buf[], /* Q13 */
- Word32 *L_tdist, /* Q27 */
- Word16 rbuf[], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 wegt[], /* normalized */
+ Word16 buf[], /* Q13 */
+ Word32 *L_tdist, /* Q27 */
+ Word16 rbuf[], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_last_select(
- Word32 L_tdist[], /* Q27 */
- Word16 *mode_index
+ Word32 L_tdist[], /* Q27 */
+ Word16 *mode_index
);
void Lsp_pre_select(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 *cand
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 *cand
);
void Lsp_select_1(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_select_2(
- Word16 rbuf[], /* Q13 */
- Word16 lspcb1[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspcb2[][M], /* Q13 */
- Word16 *index
+ Word16 rbuf[], /* Q13 */
+ Word16 lspcb1[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 *index
);
void Lsp_stability(
- Word16 buf[] /* Q13 */
+ Word16 buf[] /* Q13 */
);
void Relspwed(
- Word16 lsp[], /* Q13 */
- Word16 wegt[], /* normalized */
- Word16 lspq[], /* Q13 */
- Word16 lspcb1[][M], /* Q13 */
- Word16 lspcb2[][M], /* Q13 */
- Word16 fg[MODE][MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum[MODE][M], /* Q15 */
- Word16 fg_sum_inv[MODE][M], /* Q12 */
- Word16 code_ana[]
+ Word16 lsp[], /* Q13 */
+ Word16 wegt[], /* normalized */
+ Word16 lspq[], /* Q13 */
+ Word16 lspcb1[][M], /* Q13 */
+ Word16 lspcb2[][M], /* Q13 */
+ Word16 fg[MODE][MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum[MODE][M], /* Q15 */
+ Word16 fg_sum_inv[MODE][M], /* Q12 */
+ Word16 code_ana[]
);
void D_lsp(
- Word16 prm[], /* (i) : indexes of the selected LSP */
- Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
- Word16 erase /* (i) : frame erase information */
+ Word16 prm[], /* (i) : indexes of the selected LSP */
+ Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */
+ Word16 erase /* (i) : frame erase information */
);
void Lsp_decw_reset(
- void
+ void
);
void Lsp_iqua_cs(
- Word16 prm[], /* input : codes of the selected LSP*/
- Word16 lsp_q[], /* output: Quantized LSP parameters*/
- Word16 erase /* input : frame erase information */
+ Word16 prm[], /* input : codes of the selected LSP*/
+ Word16 lsp_q[], /* output: Quantized LSP parameters*/
+ Word16 erase /* input : frame erase information */
);
void Lsp_prev_compose(
- Word16 lsp_ele[], /* Q13 */
- Word16 lsp[], /* Q13 */
- Word16 fg[][M], /* Q15 */
- Word16 freq_prev[][M], /* Q13 */
- Word16 fg_sum[] /* Q15 */
+ Word16 lsp_ele[], /* Q13 */
+ Word16 lsp[], /* Q13 */
+ Word16 fg[][M], /* Q15 */
+ Word16 freq_prev[][M], /* Q13 */
+ Word16 fg_sum[] /* Q15 */
);
void Lsp_prev_extract(
- Word16 lsp[M], /* Q13 */
- Word16 lsp_ele[M], /* Q13 */
- Word16 fg[MA_NP][M], /* Q15 */
- Word16 freq_prev[MA_NP][M], /* Q13 */
- Word16 fg_sum_inv[M] /* Q12 */
+ Word16 lsp[M], /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 fg[MA_NP][M], /* Q15 */
+ Word16 freq_prev[MA_NP][M], /* Q13 */
+ Word16 fg_sum_inv[M] /* Q12 */
);
void Lsp_prev_update(
- Word16 lsp_ele[M], /* Q13 */
- Word16 freq_prev[MA_NP][M] /* Q13 */
+ Word16 lsp_ele[M], /* Q13 */
+ Word16 freq_prev[MA_NP][M] /* Q13 */
);
/*-------------------------------*
@@ -493,48 +493,48 @@ void Lsp_prev_update(
*--------------------------------------------------------------------------*/
Word16 Qua_gain(
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
- /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
- Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod, /* (o) Q1 : Code gain. */
- Word16 tameflag /* (i) : flag set to 1 if taming is needed */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 g_coeff[], /* (i) : Correlations <xn y1> -2<y1 y1> */
+ /* <y2,y2>, -2<xn,y2>, 2<y1,y2> */
+ Word16 exp_coeff[],/* (i) : Q-Format g_coeff[] */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod, /* (o) Q1 : Code gain. */
+ Word16 tameflag /* (i) : flag set to 1 if taming is needed */
);
void Dec_gain(
- Word16 index, /* (i) : Index of quantization. */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 bfi, /* (i) : Bad frame indicator */
- Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
- Word16 *gain_cod /* (o) Q1 : Code gain. */
+ Word16 index, /* (i) : Index of quantization. */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 bfi, /* (i) : Bad frame indicator */
+ Word16 *gain_pit, /* (o) Q14 : Pitch gain. */
+ Word16 *gain_cod /* (o) Q1 : Code gain. */
);
void Gain_predict(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word16 code[], /* (i) Q13 : Innovative vector. */
- Word16 L_subfr, /* (i) : Subframe length. */
- Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
- Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word16 code[], /* (i) Q13 : Innovative vector. */
+ Word16 L_subfr, /* (i) : Subframe length. */
+ Word16 *gcode0, /* (o) Qxx : Predicted codebook gain */
+ Word16 *exp_gcode0 /* (o) : Q-Format(gcode0) */
);
void Gain_update(
- Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
- Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
+ Word16 past_qua_en[],/* (i) Q10 :Past quantized energies */
+ Word32 L_gbk12 /* (i) Q13 : gbk1[indice1][1]+gbk2[indice2][1] */
);
void Gain_update_erasure(
- Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
+ Word16 past_qua_en[]/* (i) Q10 :Past quantized energies */
);
void Corr_xy2(
- Word16 xn[], /* (i) Q0 :Target vector. */
- Word16 y1[], /* (i) Q0 :Adaptive codebook. */
- Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
- Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
- Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
+ Word16 xn[], /* (i) Q0 :Target vector. */
+ Word16 y1[], /* (i) Q0 :Adaptive codebook. */
+ Word16 y2[], /* (i) Q12 :Filtered innovative vector. */
+ Word16 g_coeff[], /* (o) Q[exp]:Correlations between xn,y1,y2 */
+ Word16 exp_g_coeff[] /* (o) :Q-format of g_coeff[] */
);
/*-----------------------*
@@ -570,31 +570,31 @@ void bits2prm_ld8k(Word16 bits[], Word16 prm[]);
void Init_Post_Filter(void);
void Post_Filter(
- Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
- Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
- Word16 *T, /* input : decoded pitch lags in all subframes */
- Word16 Vad
+ Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */
+ Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */
+ Word16 *T, /* input : decoded pitch lags in all subframes */
+ Word16 Vad
);
void pit_pst_filt(
- Word16 *signal, /* (i) : input signal */
- Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
- Word16 t0_min, /* (i) : minimum value in the searched range */
- Word16 t0_max, /* (i) : maximum value in the searched range */
- Word16 L_subfr, /* (i) : size of filtering */
- Word16 *signal_pst /* (o) : harmonically postfiltered signal */
+ Word16 *signal, /* (i) : input signal */
+ Word16 *scal_sig, /* (i) : input signal (scaled, divided by 4) */
+ Word16 t0_min, /* (i) : minimum value in the searched range */
+ Word16 t0_max, /* (i) : maximum value in the searched range */
+ Word16 L_subfr, /* (i) : size of filtering */
+ Word16 *signal_pst /* (o) : harmonically postfiltered signal */
);
void preemphasis(
- Word16 *signal, /* (i/o) : input signal overwritten by the output */
- Word16 g, /* (i) Q15 : preemphasis coefficient */
- Word16 L /* (i) : size of filtering */
+ Word16 *signal, /* (i/o) : input signal overwritten by the output */
+ Word16 g, /* (i) Q15 : preemphasis coefficient */
+ Word16 L /* (i) : size of filtering */
);
void agc(
- Word16 *sig_in, /* (i) : postfilter input signal */
- Word16 *sig_out, /* (i/o) : postfilter output signal */
- Word16 l_trm /* (i) : subframe size */
+ Word16 *sig_in, /* (i) : postfilter input signal */
+ Word16 *sig_out, /* (i/o) : postfilter output signal */
+ Word16 l_trm /* (i) : subframe size */
);
/*--------------------------------------------------------------------------*
@@ -615,14 +615,14 @@ Word16 test_err(Word16 t0, Word16 t0_frac);
*--------------------------------------------------------------------------*/
void Copy(
- Word16 x[], /* (i) : input vector */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector length */
+ Word16 x[], /* (i) : input vector */
+ Word16 y[], /* (o) : output vector */
+ Word16 L /* (i) : vector length */
);
void Set_zero(
- Word16 x[], /* (o) : vector to clear */
- Word16 L /* (i) : length of vector */
+ Word16 x[], /* (o) : vector to clear */
+ Word16 L /* (i) : length of vector */
);
Word16 Random(Word16 *seed);
diff --git a/thirdparties/win32/include/g729b/octet.h b/thirdparties/win32/include/g729b/octet.h
index e75827a..61adecb 100755
--- a/thirdparties/win32/include/g729b/octet.h
+++ b/thirdparties/win32/include/g729b/octet.h
@@ -7,8 +7,8 @@
*/
/* Definition for Octet Transmission mode */
-/* When Annex B is used for transmission systems that operate on octet boundary,
- an extra bit (with value zero) will be packed at the end of a SID bit stream.
+/* When Annex B is used for transmission systems that operate on octet boundary,
+ an extra bit (with value zero) will be packed at the end of a SID bit stream.
This will change the number of bits in a SID bit stream from 15 bits to
16 bits (i.e., 2 bytes).
*/
diff --git a/thirdparties/win32/include/g729b/sid.h b/thirdparties/win32/include/g729b/sid.h
index 3aae1eb..a9b539b 100755
--- a/thirdparties/win32/include/g729b/sid.h
+++ b/thirdparties/win32/include/g729b/sid.h
@@ -14,8 +14,8 @@
void Init_lsfq_noise(void);
void lsfq_noise(Word16 *lsp_new, Word16 *lspq,
Word16 freq_prev[MA_NP][M], Word16 *idx);
-void sid_lsfq_decode(Word16 *index, Word16 *lspq,
- Word16 freq_prev[MA_NP][M]);
+void sid_lsfq_decode(Word16 *index, Word16 *lspq,
+ Word16 freq_prev[MA_NP][M]);
diff --git a/thirdparties/win32/include/g729b/tab_ld8a.h b/thirdparties/win32/include/g729b/tab_ld8a.h
index 0cb1b3e..08410d9 100755
--- a/thirdparties/win32/include/g729b/tab_ld8a.h
+++ b/thirdparties/win32/include/g729b/tab_ld8a.h
@@ -40,7 +40,7 @@ extern Word16 a100[3];
extern Word16 b140[3];
extern Word16 a140[3];
extern Word16 bitsno[PRM_SIZE];
-extern Word16 bitsno2[4];
+extern Word16 bitsno2[4];
extern Word16 tabpow[33];
extern Word16 tablog[33];
extern Word16 tabsqr[49];
diff --git a/thirdparties/win32/include/g729b/vad.h b/thirdparties/win32/include/g729b/vad.h
index fb7a67e..d455071 100755
--- a/thirdparties/win32/include/g729b/vad.h
+++ b/thirdparties/win32/include/g729b/vad.h
@@ -17,14 +17,14 @@
void vad_init(void);
void vad(
- Word16 rc,
- Word16 *lsf,
- Word16 *r_h,
- Word16 *r_l,
- Word16 exp_R0,
- Word16 *sigpp,
- Word16 frm_count,
- Word16 prev_marker,
- Word16 pprev_marker,
- Word16 *marker);
+ Word16 rc,
+ Word16 *lsf,
+ Word16 *r_h,
+ Word16 *r_l,
+ Word16 exp_R0,
+ Word16 *sigpp,
+ Word16 frm_count,
+ Word16 prev_marker,
+ Word16 pprev_marker,
+ Word16 *marker);
diff --git a/thirdparties/win32/include/ilbc/FrameClassify.h b/thirdparties/win32/include/ilbc/FrameClassify.h
index d8666b5..7025281 100755
--- a/thirdparties/win32/include/ilbc/FrameClassify.h
+++ b/thirdparties/win32/include/ilbc/FrameClassify.h
@@ -1,27 +1,27 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- FrameClassify.h
+ FrameClassify.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_FRAMECLASSIFY_H
- #define __iLBC_FRAMECLASSIFY_H
+#ifndef __iLBC_FRAMECLASSIFY_H
+#define __iLBC_FRAMECLASSIFY_H
- int FrameClassify( /* index to the max-energy sub-frame */
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i/o) the encoder state structure */
- float *residual /* (i) lpc residual signal */
- );
+int FrameClassify( /* index to the max-energy sub-frame */
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i/o) the encoder state structure */
+ float *residual /* (i) lpc residual signal */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/LPCdecode.h b/thirdparties/win32/include/ilbc/LPCdecode.h
index b7fa417..1c8f7a8 100755
--- a/thirdparties/win32/include/ilbc/LPCdecode.h
+++ b/thirdparties/win32/include/ilbc/LPCdecode.h
@@ -1,42 +1,42 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- LPC_decode.h
+ LPC_decode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LPC_DECODE_H
- #define __iLBC_LPC_DECODE_H
+#ifndef __iLBC_LPC_DECODE_H
+#define __iLBC_LPC_DECODE_H
- void LSFinterpolate2a_dec(
- float *a, /* (o) lpc coefficients for a sub-frame */
- float *lsf1, /* (i) first lsf coefficient vector */
- float *lsf2, /* (i) second lsf coefficient vector */
- float coef, /* (i) interpolation weight */
- int length /* (i) length of lsf vectors */
- );
+void LSFinterpolate2a_dec(
+ float *a, /* (o) lpc coefficients for a sub-frame */
+ float *lsf1, /* (i) first lsf coefficient vector */
+ float *lsf2, /* (i) second lsf coefficient vector */
+ float coef, /* (i) interpolation weight */
+ int length /* (i) length of lsf vectors */
+);
- void SimplelsfDEQ(
- float *lsfdeq, /* (o) dequantized lsf coefficients */
- int *index, /* (i) quantization index */
- int lpc_n /* (i) number of LPCs */
- );
+void SimplelsfDEQ(
+ float *lsfdeq, /* (o) dequantized lsf coefficients */
+ int *index, /* (i) quantization index */
+ int lpc_n /* (i) number of LPCs */
+);
- void DecoderInterpolateLSF(
- float *syntdenum, /* (o) synthesis filter coefficients */
- float *weightdenum, /* (o) weighting denumerator
+void DecoderInterpolateLSF(
+ float *syntdenum, /* (o) synthesis filter coefficients */
+ float *weightdenum, /* (o) weighting denumerator
coefficients */
- float *lsfdeq, /* (i) dequantized lsf coefficients */
- int length, /* (i) length of lsf coefficient vector */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i) the decoder state structure */
- );
+ float *lsfdeq, /* (i) dequantized lsf coefficients */
+ int length, /* (i) length of lsf coefficient vector */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i) the decoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/LPCencode.h b/thirdparties/win32/include/ilbc/LPCencode.h
index 17bae5f..4643c56 100755
--- a/thirdparties/win32/include/ilbc/LPCencode.h
+++ b/thirdparties/win32/include/ilbc/LPCencode.h
@@ -1,27 +1,27 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- LPCencode.h
+ LPCencode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LPCENCOD_H
- #define __iLBC_LPCENCOD_H
+#ifndef __iLBC_LPCENCOD_H
+#define __iLBC_LPCENCOD_H
- void LPCencode(
- float *syntdenum, /* (i/o) synthesis filter coefficients
+void LPCencode(
+ float *syntdenum, /* (i/o) synthesis filter coefficients
before/after encoding */
- float *weightdenum, /* (i/o) weighting denumerator coefficients
+ float *weightdenum, /* (i/o) weighting denumerator coefficients
before/after encoding */
- int *lsf_index, /* (o) lsf quantization index */
- float *data, /* (i) lsf coefficients to quantize */
- iLBC_Enc_Inst_t *iLBCenc_inst
- /* (i/o) the encoder state structure */
- );
+ int *lsf_index, /* (o) lsf quantization index */
+ float *data, /* (i) lsf coefficients to quantize */
+ iLBC_Enc_Inst_t *iLBCenc_inst
+ /* (i/o) the encoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/StateConstructW.h b/thirdparties/win32/include/ilbc/StateConstructW.h
index 4e40a73..46e7f78 100755
--- a/thirdparties/win32/include/ilbc/StateConstructW.h
+++ b/thirdparties/win32/include/ilbc/StateConstructW.h
@@ -1,8 +1,8 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- StateConstructW.h
+ StateConstructW.h
@@ -10,22 +10,22 @@
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_STATECONSTRUCTW_H
- #define __iLBC_STATECONSTRUCTW_H
+#ifndef __iLBC_STATECONSTRUCTW_H
+#define __iLBC_STATECONSTRUCTW_H
- void StateConstructW(
- int idxForMax, /* (i) 6-bit index for the quantization of
+void StateConstructW(
+ int idxForMax, /* (i) 6-bit index for the quantization of
max amplitude */
- int *idxVec, /* (i) vector of quantization indexes */
- float *syntDenum, /* (i) synthesis filter denumerator */
- float *out, /* (o) the decoded state vector */
- int len /* (i) length of a state vector */
- );
+ int *idxVec, /* (i) vector of quantization indexes */
+ float *syntDenum, /* (i) synthesis filter denumerator */
+ float *out, /* (o) the decoded state vector */
+ int len /* (i) length of a state vector */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/StateSearchW.h b/thirdparties/win32/include/ilbc/StateSearchW.h
index cc9449b..638c6f3 100755
--- a/thirdparties/win32/include/ilbc/StateSearchW.h
+++ b/thirdparties/win32/include/ilbc/StateSearchW.h
@@ -1,46 +1,46 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- StateSearchW.h
+ StateSearchW.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_STATESEARCHW_H
- #define __iLBC_STATESEARCHW_H
+#ifndef __iLBC_STATESEARCHW_H
+#define __iLBC_STATESEARCHW_H
- void AbsQuantW(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) Encoder instance */
- float *in, /* (i) vector to encode */
- float *syntDenum, /* (i) denominator of synthesis filter */
- float *weightDenum, /* (i) denominator of weighting filter */
- int *out, /* (o) vector of quantizer indexes */
- int len, /* (i) length of vector to encode and
+void AbsQuantW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *in, /* (i) vector to encode */
+ float *syntDenum, /* (i) denominator of synthesis filter */
+ float *weightDenum, /* (i) denominator of weighting filter */
+ int *out, /* (o) vector of quantizer indexes */
+ int len, /* (i) length of vector to encode and
vector of quantizer indexes */
- int state_first /* (i) position of start state in the
+ int state_first /* (i) position of start state in the
80 vec */
- );
-
- void StateSearchW(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) Encoder instance */
- float *residual,/* (i) target residual vector */
- float *syntDenum, /* (i) lpc synthesis filter */
- float *weightDenum, /* (i) weighting filter denuminator */
- int *idxForMax, /* (o) quantizer index for maximum
+);
+
+void StateSearchW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *residual,/* (i) target residual vector */
+ float *syntDenum, /* (i) lpc synthesis filter */
+ float *weightDenum, /* (i) weighting filter denuminator */
+ int *idxForMax, /* (o) quantizer index for maximum
amplitude */
- int *idxVec, /* (o) vector of quantization indexes */
- int len, /* (i) length of all vectors */
- int state_first /* (i) position of start state in the
+ int *idxVec, /* (o) vector of quantization indexes */
+ int len, /* (i) length of all vectors */
+ int state_first /* (i) position of start state in the
80 vec */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/anaFilter.h b/thirdparties/win32/include/ilbc/anaFilter.h
index 47388f2..924cea5 100755
--- a/thirdparties/win32/include/ilbc/anaFilter.h
+++ b/thirdparties/win32/include/ilbc/anaFilter.h
@@ -1,30 +1,30 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- anaFilter.h
+ anaFilter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ANAFILTER_H
- #define __iLBC_ANAFILTER_H
+#ifndef __iLBC_ANAFILTER_H
+#define __iLBC_ANAFILTER_H
- void anaFilter(
+void anaFilter(
- float *In, /* (i) Signal to be filtered */
- float *a, /* (i) LP parameters */
- int len,/* (i) Length of signal */
- float *Out, /* (o) Filtered signal */
- float *mem /* (i/o) Filter state */
- );
+ float *In, /* (i) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len,/* (i) Length of signal */
+ float *Out, /* (o) Filtered signal */
+ float *mem /* (i/o) Filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/constants.h b/thirdparties/win32/include/ilbc/constants.h
index 6b37aed..5880edb 100755
--- a/thirdparties/win32/include/ilbc/constants.h
+++ b/thirdparties/win32/include/ilbc/constants.h
@@ -1,21 +1,21 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- constants.h
+ constants.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_CONSTANTS_H
- #define __iLBC_CONSTANTS_H
+#ifndef __iLBC_CONSTANTS_H
+#define __iLBC_CONSTANTS_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- /* ULP bit allocation */
+/* ULP bit allocation */
@@ -23,53 +23,53 @@
- extern const iLBC_ULP_Inst_t ULP_20msTbl;
- extern const iLBC_ULP_Inst_t ULP_30msTbl;
+extern const iLBC_ULP_Inst_t ULP_20msTbl;
+extern const iLBC_ULP_Inst_t ULP_30msTbl;
- /* high pass filters */
+/* high pass filters */
- extern float hpi_zero_coefsTbl[];
- extern float hpi_pole_coefsTbl[];
- extern float hpo_zero_coefsTbl[];
- extern float hpo_pole_coefsTbl[];
+extern float hpi_zero_coefsTbl[];
+extern float hpi_pole_coefsTbl[];
+extern float hpo_zero_coefsTbl[];
+extern float hpo_pole_coefsTbl[];
- /* low pass filters */
- extern float lpFilt_coefsTbl[];
+/* low pass filters */
+extern float lpFilt_coefsTbl[];
- /* LPC analysis and quantization */
+/* LPC analysis and quantization */
- extern float lpc_winTbl[];
- extern float lpc_asymwinTbl[];
- extern float lpc_lagwinTbl[];
- extern float lsfCbTbl[];
- extern float lsfmeanTbl[];
- extern int dim_lsfCbTbl[];
- extern int size_lsfCbTbl[];
- extern float lsf_weightTbl_30ms[];
- extern float lsf_weightTbl_20ms[];
+extern float lpc_winTbl[];
+extern float lpc_asymwinTbl[];
+extern float lpc_lagwinTbl[];
+extern float lsfCbTbl[];
+extern float lsfmeanTbl[];
+extern int dim_lsfCbTbl[];
+extern int size_lsfCbTbl[];
+extern float lsf_weightTbl_30ms[];
+extern float lsf_weightTbl_20ms[];
- /* state quantization tables */
+/* state quantization tables */
- extern float state_sq3Tbl[];
- extern float state_frgqTbl[];
+extern float state_sq3Tbl[];
+extern float state_frgqTbl[];
- /* gain quantization tables */
+/* gain quantization tables */
- extern float gain_sq3Tbl[];
- extern float gain_sq4Tbl[];
- extern float gain_sq5Tbl[];
+extern float gain_sq3Tbl[];
+extern float gain_sq4Tbl[];
+extern float gain_sq5Tbl[];
- /* adaptive codebook definitions */
+/* adaptive codebook definitions */
- extern int search_rangeTbl[5][CB_NSTAGES];
- extern int memLfTbl[];
- extern int stMemLTbl;
- extern float cbfiltersTbl[CB_FILTERLEN];
+extern int search_rangeTbl[5][CB_NSTAGES];
+extern int memLfTbl[];
+extern int stMemLTbl;
+extern float cbfiltersTbl[CB_FILTERLEN];
- /* enhancer definitions */
+/* enhancer definitions */
- extern float polyphaserTbl[];
- extern float enh_plocsTbl[];
+extern float polyphaserTbl[];
+extern float enh_plocsTbl[];
@@ -77,5 +77,5 @@
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/createCB.h b/thirdparties/win32/include/ilbc/createCB.h
index 526405a..7fe91d3 100755
--- a/thirdparties/win32/include/ilbc/createCB.h
+++ b/thirdparties/win32/include/ilbc/createCB.h
@@ -1,19 +1,19 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- createCB.h
+ createCB.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_CREATECB_H
- #define __iLBC_CREATECB_H
+#ifndef __iLBC_CREATECB_H
+#define __iLBC_CREATECB_H
- void filteredCBvecs(
- float *cbvectors, /* (o) Codebook vector for the
+void filteredCBvecs(
+ float *cbvectors, /* (o) Codebook vector for the
higher section */
@@ -21,38 +21,38 @@
- float *mem, /* (i) Buffer to create codebook
+ float *mem, /* (i) Buffer to create codebook
vectors from */
- int lMem /* (i) Length of buffer */
- );
-
- void searchAugmentedCB(
- int low, /* (i) Start index for the search */
- int high, /* (i) End index for the search */
- int stage, /* (i) Current stage */
- int startIndex, /* (i) CB index for the first
+ int lMem /* (i) Length of buffer */
+);
+
+void searchAugmentedCB(
+ int low, /* (i) Start index for the search */
+ int high, /* (i) End index for the search */
+ int stage, /* (i) Current stage */
+ int startIndex, /* (i) CB index for the first
augmented vector */
- float *target, /* (i) Target vector for encoding */
- float *buffer, /* (i) Pointer to the end of the
+ float *target, /* (i) Target vector for encoding */
+ float *buffer, /* (i) Pointer to the end of the
buffer for augmented codebook
construction */
- float *max_measure, /* (i/o) Currently maximum measure */
- int *best_index,/* (o) Currently the best index */
- float *gain, /* (o) Currently the best gain */
- float *energy, /* (o) Energy of augmented
+ float *max_measure, /* (i/o) Currently maximum measure */
+ int *best_index,/* (o) Currently the best index */
+ float *gain, /* (o) Currently the best gain */
+ float *energy, /* (o) Energy of augmented
codebook vectors */
- float *invenergy/* (o) Inv energy of aug codebook
+ float *invenergy/* (o) Inv energy of aug codebook
vectors */
- );
+);
- void createAugmentedVec(
- int index, /* (i) Index for the aug vector
+void createAugmentedVec(
+ int index, /* (i) Index for the aug vector
to be created */
- float *buffer, /* (i) Pointer to the end of the
+ float *buffer, /* (i) Pointer to the end of the
buffer for augmented codebook
construction */
- float *cbVec /* (o) The construced codebook vector */
- );
+ float *cbVec /* (o) The construced codebook vector */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/doCPLC.h b/thirdparties/win32/include/ilbc/doCPLC.h
index e84ed83..4767c72 100755
--- a/thirdparties/win32/include/ilbc/doCPLC.h
+++ b/thirdparties/win32/include/ilbc/doCPLC.h
@@ -1,28 +1,28 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- doCPLC.h
+ doCPLC.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_DOLPC_H
- #define __iLBC_DOLPC_H
+#ifndef __iLBC_DOLPC_H
+#define __iLBC_DOLPC_H
- void doThePLC(
- float *PLCresidual, /* (o) concealed residual */
- float *PLClpc, /* (o) concealed LP parameters */
- int PLI, /* (i) packet loss indicator
+void doThePLC(
+ float *PLCresidual, /* (o) concealed residual */
+ float *PLClpc, /* (o) concealed LP parameters */
+ int PLI, /* (i) packet loss indicator
0 - no PL, 1 = PL */
- float *decresidual, /* (i) decoded residual */
- float *lpc, /* (i) decoded LPC (only used for no PL) */
- int inlag, /* (i) pitch lag */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i/o) decoder instance */
- );
-
- #endif
+ float *decresidual, /* (i) decoded residual */
+ float *lpc, /* (i) decoded LPC (only used for no PL) */
+ int inlag, /* (i) pitch lag */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) decoder instance */
+);
+
+#endif
diff --git a/thirdparties/win32/include/ilbc/enhancer.h b/thirdparties/win32/include/ilbc/enhancer.h
index bbdfa14..e4f7f0f 100755
--- a/thirdparties/win32/include/ilbc/enhancer.h
+++ b/thirdparties/win32/include/ilbc/enhancer.h
@@ -1,36 +1,36 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- enhancer.h
+ enhancer.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __ENHANCER_H
- #define __ENHANCER_H
+#ifndef __ENHANCER_H
+#define __ENHANCER_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- float xCorrCoef(
- float *target, /* (i) first array */
- float *regressor, /* (i) second array */
- int subl /* (i) dimension arrays */
- );
+float xCorrCoef(
+ float *target, /* (i) first array */
+ float *regressor, /* (i) second array */
+ int subl /* (i) dimension arrays */
+);
- int enhancerInterface(
- float *out, /* (o) the enhanced recidual signal */
- float *in, /* (i) the recidual signal to enhance */
- iLBC_Dec_Inst_t *iLBCdec_inst
- /* (i/o) the decoder state structure */
- );
+int enhancerInterface(
+ float *out, /* (o) the enhanced recidual signal */
+ float *in, /* (i) the recidual signal to enhance */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) the decoder state structure */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/filter.h b/thirdparties/win32/include/ilbc/filter.h
index 0b9b8b5..a7bbec1 100755
--- a/thirdparties/win32/include/ilbc/filter.h
+++ b/thirdparties/win32/include/ilbc/filter.h
@@ -1,13 +1,13 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- filter.h
+ filter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
@@ -15,11 +15,11 @@
- #ifndef __iLBC_FILTER_H
- #define __iLBC_FILTER_H
+#ifndef __iLBC_FILTER_H
+#define __iLBC_FILTER_H
- void AllPoleFilter(
- float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
+void AllPoleFilter(
+ float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
InOut[-1] contain the state of the
filter (delayed samples). InOut[0] to
InOut[lengthInOut-1] contain the filter
@@ -27,41 +27,41 @@
InOut[-1] is unchanged and InOut[0] to
InOut[lengthInOut-1] contain filtered
samples */
- float *Coef,/* (i) filter coefficients, Coef[0] is assumed
+ float *Coef,/* (i) filter coefficients, Coef[0] is assumed
to be 1.0 */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef /* (i) number of filter coefficients */
- );
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef /* (i) number of filter coefficients */
+);
- void AllZeroFilter(
- float *In, /* (i) In[0] to In[lengthInOut-1] contain
+void AllZeroFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain
filter input samples */
- float *Coef,/* (i) filter coefficients (Coef[0] is assumed
+ float *Coef,/* (i) filter coefficients (Coef[0] is assumed
to be 1.0) */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef, /* (i) number of filter coefficients */
- float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
contain the filter state, on exit Out[0]
to Out[lengthInOut-1] contain filtered
samples */
- );
+);
- void ZeroPoleFilter(
- float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
+void ZeroPoleFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
input samples In[-orderCoef] to In[-1]
contain state of all-zero section */
- float *ZeroCoef,/* (i) filter coefficients for all-zero
+ float *ZeroCoef,/* (i) filter coefficients for all-zero
section (ZeroCoef[0] is assumed to
be 1.0) */
- float *PoleCoef,/* (i) filter coefficients for all-pole section
+ float *PoleCoef,/* (i) filter coefficients for all-pole section
(ZeroCoef[0] is assumed to be 1.0) */
- int lengthInOut,/* (i) number of input/output samples */
- int orderCoef, /* (i) number of filter coefficients */
- float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
contain state of all-pole section. On
exit Out[0] to Out[lengthInOut-1]
contain filtered samples */
- );
+);
@@ -69,13 +69,13 @@
- void DownSample (
- float *In, /* (i) input samples */
- float *Coef, /* (i) filter coefficients */
- int lengthIn, /* (i) number of input samples */
- float *state, /* (i) filter state */
- float *Out /* (o) downsampled output */
- );
+void DownSample (
+ float *In, /* (i) input samples */
+ float *Coef, /* (i) filter coefficients */
+ int lengthIn, /* (i) number of input samples */
+ float *state, /* (i) filter state */
+ float *Out /* (o) downsampled output */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/gainquant.h b/thirdparties/win32/include/ilbc/gainquant.h
index cc7418c..b0480a8 100755
--- a/thirdparties/win32/include/ilbc/gainquant.h
+++ b/thirdparties/win32/include/ilbc/gainquant.h
@@ -1,29 +1,29 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- gainquant.h
+ gainquant.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_GAINQUANT_H
- #define __iLBC_GAINQUANT_H
+#ifndef __iLBC_GAINQUANT_H
+#define __iLBC_GAINQUANT_H
- float gainquant(/* (o) quantized gain value */
- float in, /* (i) gain value */
- float maxIn,/* (i) maximum of gain value */
- int cblen, /* (i) number of quantization indices */
- int *index /* (o) quantization index */
- );
+float gainquant(/* (o) quantized gain value */
+ float in, /* (i) gain value */
+ float maxIn,/* (i) maximum of gain value */
+ int cblen, /* (i) number of quantization indices */
+ int *index /* (o) quantization index */
+);
- float gaindequant( /* (o) quantized gain value */
- int index, /* (i) quantization index */
- float maxIn,/* (i) maximum of unquantized gain */
- int cblen /* (i) number of quantization indices */
- );
+float gaindequant( /* (o) quantized gain value */
+ int index, /* (i) quantization index */
+ float maxIn,/* (i) maximum of unquantized gain */
+ int cblen /* (i) number of quantization indices */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/getCBvec.h b/thirdparties/win32/include/ilbc/getCBvec.h
index 50cc6cd..36b27e6 100755
--- a/thirdparties/win32/include/ilbc/getCBvec.h
+++ b/thirdparties/win32/include/ilbc/getCBvec.h
@@ -1,24 +1,24 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- getCBvec.h
+ getCBvec.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_GETCBVEC_H
- #define __iLBC_GETCBVEC_H
+#ifndef __iLBC_GETCBVEC_H
+#define __iLBC_GETCBVEC_H
- void getCBvec(
- float *cbvec, /* (o) Constructed codebook vector */
- float *mem, /* (i) Codebook buffer */
- int index, /* (i) Codebook index */
- int lMem, /* (i) Length of codebook buffer */
- int cbveclen/* (i) Codebook vector length */
- );
+void getCBvec(
+ float *cbvec, /* (o) Constructed codebook vector */
+ float *mem, /* (i) Codebook buffer */
+ int index, /* (i) Codebook index */
+ int lMem, /* (i) Length of codebook buffer */
+ int cbveclen/* (i) Codebook vector length */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/helpfun.h b/thirdparties/win32/include/ilbc/helpfun.h
index 8b20452..10f09ec 100755
--- a/thirdparties/win32/include/ilbc/helpfun.h
+++ b/thirdparties/win32/include/ilbc/helpfun.h
@@ -1,95 +1,95 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- helpfun.h
+ helpfun.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HELPFUN_H
- #define __iLBC_HELPFUN_H
+#ifndef __iLBC_HELPFUN_H
+#define __iLBC_HELPFUN_H
- void autocorr(
- float *r, /* (o) autocorrelation vector */
- const float *x, /* (i) data vector */
- int N, /* (i) length of data vector */
- int order /* largest lag for calculated
+void autocorr(
+ float *r, /* (o) autocorrelation vector */
+ const float *x, /* (i) data vector */
+ int N, /* (i) length of data vector */
+ int order /* largest lag for calculated
autocorrelations */
- );
+);
- void window(
- float *z, /* (o) the windowed data */
- const float *x, /* (i) the original data vector */
- const float *y, /* (i) the window */
- int N /* (i) length of all vectors */
- );
+void window(
+ float *z, /* (o) the windowed data */
+ const float *x, /* (i) the original data vector */
+ const float *y, /* (i) the window */
+ int N /* (i) length of all vectors */
+);
- void levdurb(
- float *a, /* (o) lpc coefficient vector starting
+void levdurb(
+ float *a, /* (o) lpc coefficient vector starting
with 1.0 */
- float *k, /* (o) reflection coefficients */
- float *r, /* (i) autocorrelation vector */
- int order /* (i) order of lpc filter */
- );
+ float *k, /* (o) reflection coefficients */
+ float *r, /* (i) autocorrelation vector */
+ int order /* (i) order of lpc filter */
+);
- void interpolate(
+void interpolate(
- float *out, /* (o) the interpolated vector */
- float *in1, /* (i) the first vector for the
+ float *out, /* (o) the interpolated vector */
+ float *in1, /* (i) the first vector for the
interpolation */
- float *in2, /* (i) the second vector for the
+ float *in2, /* (i) the second vector for the
interpolation */
- float coef, /* (i) interpolation weights */
- int length /* (i) length of all vectors */
- );
+ float coef, /* (i) interpolation weights */
+ int length /* (i) length of all vectors */
+);
- void bwexpand(
- float *out, /* (o) the bandwidth expanded lpc
+void bwexpand(
+ float *out, /* (o) the bandwidth expanded lpc
coefficients */
- float *in, /* (i) the lpc coefficients before bandwidth
+ float *in, /* (i) the lpc coefficients before bandwidth
expansion */
- float coef, /* (i) the bandwidth expansion factor */
- int length /* (i) the length of lpc coefficient vectors */
- );
-
- void vq(
- float *Xq, /* (o) the quantized vector */
- int *index, /* (o) the quantization index */
- const float *CB,/* (i) the vector quantization codebook */
- float *X, /* (i) the vector to quantize */
- int n_cb, /* (i) the number of vectors in the codebook */
- int dim /* (i) the dimension of all vectors */
- );
-
- void SplitVQ(
- float *qX, /* (o) the quantized vector */
- int *index, /* (o) a vector of indexes for all vector
+ float coef, /* (i) the bandwidth expansion factor */
+ int length /* (i) the length of lpc coefficient vectors */
+);
+
+void vq(
+ float *Xq, /* (o) the quantized vector */
+ int *index, /* (o) the quantization index */
+ const float *CB,/* (i) the vector quantization codebook */
+ float *X, /* (i) the vector to quantize */
+ int n_cb, /* (i) the number of vectors in the codebook */
+ int dim /* (i) the dimension of all vectors */
+);
+
+void SplitVQ(
+ float *qX, /* (o) the quantized vector */
+ int *index, /* (o) a vector of indexes for all vector
codebooks in the split */
- float *X, /* (i) the vector to quantize */
- const float *CB,/* (i) the quantizer codebook */
- int nsplit, /* the number of vector splits */
- const int *dim, /* the dimension of X and qX */
- const int *cbsize /* the number of vectors in the codebook */
- );
+ float *X, /* (i) the vector to quantize */
+ const float *CB,/* (i) the quantizer codebook */
+ int nsplit, /* the number of vector splits */
+ const int *dim, /* the dimension of X and qX */
+ const int *cbsize /* the number of vectors in the codebook */
+);
- void sort_sq(
- float *xq, /* (o) the quantized value */
- int *index, /* (o) the quantization index */
- float x, /* (i) the value to quantize */
- const float *cb,/* (i) the quantization codebook */
- int cb_size /* (i) the size of the quantization codebook */
- );
+void sort_sq(
+ float *xq, /* (o) the quantized value */
+ int *index, /* (o) the quantization index */
+ float x, /* (i) the value to quantize */
+ const float *cb,/* (i) the quantization codebook */
+ int cb_size /* (i) the size of the quantization codebook */
+);
- int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
+int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
@@ -97,11 +97,11 @@
nonstable ones */
- float *lsf, /* (i) a table of lsf vectors */
- int dim, /* (i) the dimension of each lsf vector */
- int NoAn /* (i) the number of lsf vectors in the
+ float *lsf, /* (i) a table of lsf vectors */
+ int dim, /* (i) the dimension of each lsf vector */
+ int NoAn /* (i) the number of lsf vectors in the
table */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/hpInput.h b/thirdparties/win32/include/ilbc/hpInput.h
index 69160c4..96ebbc5 100755
--- a/thirdparties/win32/include/ilbc/hpInput.h
+++ b/thirdparties/win32/include/ilbc/hpInput.h
@@ -1,23 +1,23 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- hpInput.h
+ hpInput.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HPINPUT_H
- #define __iLBC_HPINPUT_H
+#ifndef __iLBC_HPINPUT_H
+#define __iLBC_HPINPUT_H
- void hpInput(
- float *In, /* (i) vector to filter */
- int len, /* (i) length of vector to filter */
- float *Out, /* (o) the resulting filtered vector */
- float *mem /* (i/o) the filter state */
- );
+void hpInput(
+ float *In, /* (i) vector to filter */
+ int len, /* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/hpOutput.h b/thirdparties/win32/include/ilbc/hpOutput.h
index 08a679c..8510213 100755
--- a/thirdparties/win32/include/ilbc/hpOutput.h
+++ b/thirdparties/win32/include/ilbc/hpOutput.h
@@ -1,23 +1,23 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- hpOutput.h
+ hpOutput.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_HPOUTPUT_H
- #define __iLBC_HPOUTPUT_H
+#ifndef __iLBC_HPOUTPUT_H
+#define __iLBC_HPOUTPUT_H
- void hpOutput(
- float *In, /* (i) vector to filter */
- int len,/* (i) length of vector to filter */
- float *Out, /* (o) the resulting filtered vector */
- float *mem /* (i/o) the filter state */
- );
+void hpOutput(
+ float *In, /* (i) vector to filter */
+ int len,/* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/iCBConstruct.h b/thirdparties/win32/include/ilbc/iCBConstruct.h
index e63ba34..6fe1b10 100755
--- a/thirdparties/win32/include/ilbc/iCBConstruct.h
+++ b/thirdparties/win32/include/ilbc/iCBConstruct.h
@@ -1,11 +1,11 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iCBConstruct.h
+ iCBConstruct.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
@@ -13,28 +13,28 @@
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ICBCONSTRUCT_H
- #define __iLBC_ICBCONSTRUCT_H
+#ifndef __iLBC_ICBCONSTRUCT_H
+#define __iLBC_ICBCONSTRUCT_H
- void index_conv_enc(
- int *index /* (i/o) Codebook indexes */
- );
+void index_conv_enc(
+ int *index /* (i/o) Codebook indexes */
+);
- void index_conv_dec(
- int *index /* (i/o) Codebook indexes */
- );
+void index_conv_dec(
+ int *index /* (i/o) Codebook indexes */
+);
- void iCBConstruct(
- float *decvector, /* (o) Decoded vector */
- int *index, /* (i) Codebook indices */
- int *gain_index,/* (i) Gain quantization indices */
- float *mem, /* (i) Buffer for codevector construction */
- int lMem, /* (i) Length of buffer */
- int veclen, /* (i) Length of vector */
- int nStages /* (i) Number of codebook stages */
- );
+void iCBConstruct(
+ float *decvector, /* (o) Decoded vector */
+ int *index, /* (i) Codebook indices */
+ int *gain_index,/* (i) Gain quantization indices */
+ float *mem, /* (i) Buffer for codevector construction */
+ int lMem, /* (i) Length of buffer */
+ int veclen, /* (i) Length of vector */
+ int nStages /* (i) Number of codebook stages */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/iCBSearch.h b/thirdparties/win32/include/ilbc/iCBSearch.h
index da7dc6c..f0fd843 100755
--- a/thirdparties/win32/include/ilbc/iCBSearch.h
+++ b/thirdparties/win32/include/ilbc/iCBSearch.h
@@ -1,16 +1,16 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iCBSearch.h
+ iCBSearch.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ICBSEARCH_H
- #define __iLBC_ICBSEARCH_H
+#ifndef __iLBC_ICBSEARCH_H
+#define __iLBC_ICBSEARCH_H
@@ -18,20 +18,20 @@
- void iCBSearch(
- iLBC_Enc_Inst_t *iLBCenc_inst,
- /* (i) the encoder state structure */
- int *index, /* (o) Codebook indices */
- int *gain_index,/* (o) Gain quantization indices */
- float *intarget,/* (i) Target vector for encoding */
- float *mem, /* (i) Buffer for codebook construction */
- int lMem, /* (i) Length of buffer */
- int lTarget, /* (i) Length of vector */
- int nStages, /* (i) Number of codebook stages */
- float *weightDenum, /* (i) weighting filter coefficients */
- float *weightState, /* (i) weighting filter state */
- int block /* (i) the sub-block number */
- );
+void iCBSearch(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) the encoder state structure */
+ int *index, /* (o) Codebook indices */
+ int *gain_index,/* (o) Gain quantization indices */
+ float *intarget,/* (i) Target vector for encoding */
+ float *mem, /* (i) Buffer for codebook construction */
+ int lMem, /* (i) Length of buffer */
+ int lTarget, /* (i) Length of vector */
+ int nStages, /* (i) Number of codebook stages */
+ float *weightDenum, /* (i) weighting filter coefficients */
+ float *weightState, /* (i) weighting filter state */
+ int block /* (i) the sub-block number */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/iLBC_decode.h b/thirdparties/win32/include/ilbc/iLBC_decode.h
index 7557041..8b9f3de 100755
--- a/thirdparties/win32/include/ilbc/iLBC_decode.h
+++ b/thirdparties/win32/include/ilbc/iLBC_decode.h
@@ -1,34 +1,34 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_decode.h
+ iLBC_decode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ILBCDECODE_H
- #define __iLBC_ILBCDECODE_H
+#ifndef __iLBC_ILBCDECODE_H
+#define __iLBC_ILBCDECODE_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- short initDecode( /* (o) Number of decoded
+short initDecode( /* (o) Number of decoded
samples */
- iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
- int mode, /* (i) frame size mode */
- int use_enhancer /* (i) 1 to use enhancer
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
+ int mode, /* (i) frame size mode */
+ int use_enhancer /* (i) 1 to use enhancer
0 to run without
enhancer */
- );
+);
- void iLBC_decode(
- float *decblock, /* (o) decoded signal block */
- unsigned char *bytes, /* (i) encoded signal bits */
- iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
+void iLBC_decode(
+ float *decblock, /* (o) decoded signal block */
+ unsigned char *bytes, /* (i) encoded signal bits */
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
structure */
- int mode /* (i) 0: bad packet, PLC,
+ int mode /* (i) 0: bad packet, PLC,
1: normal */
@@ -36,7 +36,7 @@
- );
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/iLBC_define.h b/thirdparties/win32/include/ilbc/iLBC_define.h
index 904f370..f8d31ce 100755
--- a/thirdparties/win32/include/ilbc/iLBC_define.h
+++ b/thirdparties/win32/include/ilbc/iLBC_define.h
@@ -1,220 +1,220 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_define.h
+ iLBC_define.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
- #include <string.h>
+******************************************************************/
+#include <string.h>
- #ifndef __iLBC_ILBCDEFINE_H
- #define __iLBC_ILBCDEFINE_H
+#ifndef __iLBC_ILBCDEFINE_H
+#define __iLBC_ILBCDEFINE_H
- /* general codec settings */
+/* general codec settings */
- #define FS (float)8000.0
- #define BLOCKL_20MS 160
- #define BLOCKL_30MS 240
- #define BLOCKL_MAX 240
- #define NSUB_20MS 4
- #define NSUB_30MS 6
- #define NSUB_MAX 6
- #define NASUB_20MS 2
+#define FS (float)8000.0
+#define BLOCKL_20MS 160
+#define BLOCKL_30MS 240
+#define BLOCKL_MAX 240
+#define NSUB_20MS 4
+#define NSUB_30MS 6
+#define NSUB_MAX 6
+#define NASUB_20MS 2
- #define NASUB_30MS 4
- #define NASUB_MAX 4
- #define SUBL 40
- #define STATE_LEN 80
- #define STATE_SHORT_LEN_30MS 58
- #define STATE_SHORT_LEN_20MS 57
+#define NASUB_30MS 4
+#define NASUB_MAX 4
+#define SUBL 40
+#define STATE_LEN 80
+#define STATE_SHORT_LEN_30MS 58
+#define STATE_SHORT_LEN_20MS 57
- /* LPC settings */
+/* LPC settings */
- #define LPC_FILTERORDER 10
- #define LPC_CHIRP_SYNTDENUM (float)0.9025
- #define LPC_CHIRP_WEIGHTDENUM (float)0.4222
- #define LPC_LOOKBACK 60
- #define LPC_N_20MS 1
- #define LPC_N_30MS 2
- #define LPC_N_MAX 2
- #define LPC_ASYMDIFF 20
- #define LPC_BW (float)60.0
- #define LPC_WN (float)1.0001
- #define LSF_NSPLIT 3
- #define LSF_NUMBER_OF_STEPS 4
- #define LPC_HALFORDER (LPC_FILTERORDER/2)
+#define LPC_FILTERORDER 10
+#define LPC_CHIRP_SYNTDENUM (float)0.9025
+#define LPC_CHIRP_WEIGHTDENUM (float)0.4222
+#define LPC_LOOKBACK 60
+#define LPC_N_20MS 1
+#define LPC_N_30MS 2
+#define LPC_N_MAX 2
+#define LPC_ASYMDIFF 20
+#define LPC_BW (float)60.0
+#define LPC_WN (float)1.0001
+#define LSF_NSPLIT 3
+#define LSF_NUMBER_OF_STEPS 4
+#define LPC_HALFORDER (LPC_FILTERORDER/2)
- /* cb settings */
+/* cb settings */
- #define CB_NSTAGES 3
- #define CB_EXPAND 2
- #define CB_MEML 147
- #define CB_FILTERLEN 2*4
- #define CB_HALFFILTERLEN 4
- #define CB_RESRANGE 34
- #define CB_MAXGAIN (float)1.3
+#define CB_NSTAGES 3
+#define CB_EXPAND 2
+#define CB_MEML 147
+#define CB_FILTERLEN 2*4
+#define CB_HALFFILTERLEN 4
+#define CB_RESRANGE 34
+#define CB_MAXGAIN (float)1.3
- /* enhancer */
+/* enhancer */
- #define ENH_BLOCKL 80 /* block length */
- #define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
- #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks
+#define ENH_BLOCKL 80 /* block length */
+#define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
+#define ENH_HL 3 /* 2*ENH_HL+1 is number blocks
in said second sequence */
- #define ENH_SLOP 2 /* max difference estimated and
+#define ENH_SLOP 2 /* max difference estimated and
correct pitch period */
- #define ENH_PLOCSL 20 /* pitch-estimates and pitch-
+#define ENH_PLOCSL 20 /* pitch-estimates and pitch-
locations buffer length */
- #define ENH_OVERHANG 2
- #define ENH_UPS0 4 /* upsampling rate */
- #define ENH_FL0 3 /* 2*FLO+1 is the length of
+#define ENH_OVERHANG 2
+#define ENH_UPS0 4 /* upsampling rate */
+#define ENH_FL0 3 /* 2*FLO+1 is the length of
each filter */
- #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0)
+#define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0)
- #define ENH_CORRDIM (2*ENH_SLOP+1)
- #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL)
- #define ENH_NBLOCKS_EXTRA 5
- #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS +
+#define ENH_CORRDIM (2*ENH_SLOP+1)
+#define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL)
+#define ENH_NBLOCKS_EXTRA 5
+#define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS +
ENH_NBLOCKS_EXTRA */
- #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL
- #define ENH_ALPHA0 (float)0.05
+#define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL
+#define ENH_ALPHA0 (float)0.05
- /* Down sampling */
+/* Down sampling */
- #define FILTERORDER_DS 7
- #define DELAY_DS 3
- #define FACTOR_DS 2
+#define FILTERORDER_DS 7
+#define DELAY_DS 3
+#define FACTOR_DS 2
- /* bit stream defs */
+/* bit stream defs */
- #define NO_OF_BYTES_20MS 38
- #define NO_OF_BYTES_30MS 50
- #define NO_OF_WORDS_20MS 19
- #define NO_OF_WORDS_30MS 25
- #define STATE_BITS 3
- #define BYTE_LEN 8
- #define ULP_CLASSES 3
+#define NO_OF_BYTES_20MS 38
+#define NO_OF_BYTES_30MS 50
+#define NO_OF_WORDS_20MS 19
+#define NO_OF_WORDS_30MS 25
+#define STATE_BITS 3
+#define BYTE_LEN 8
+#define ULP_CLASSES 3
- /* help parameters */
+/* help parameters */
- #define FLOAT_MAX (float)1.0e37
- #define EPS (float)2.220446049250313e-016
- #define PI (float)3.14159265358979323846
- #define MIN_SAMPLE -32768
- #define MAX_SAMPLE 32767
- #define TWO_PI (float)6.283185307
- #define PI2 (float)0.159154943
+#define FLOAT_MAX (float)1.0e37
+#define EPS (float)2.220446049250313e-016
+#define PI (float)3.14159265358979323846
+#define MIN_SAMPLE -32768
+#define MAX_SAMPLE 32767
+#define TWO_PI (float)6.283185307
+#define PI2 (float)0.159154943
- /* type definition encoder instance */
- typedef struct iLBC_ULP_Inst_t_ {
- int lsf_bits[6][ULP_CLASSES+2];
- int start_bits[ULP_CLASSES+2];
- int startfirst_bits[ULP_CLASSES+2];
- int scale_bits[ULP_CLASSES+2];
- int state_bits[ULP_CLASSES+2];
- int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
- int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
- int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
- int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
- } iLBC_ULP_Inst_t;
+/* type definition encoder instance */
+typedef struct iLBC_ULP_Inst_t_ {
+ int lsf_bits[6][ULP_CLASSES+2];
+ int start_bits[ULP_CLASSES+2];
+ int startfirst_bits[ULP_CLASSES+2];
+ int scale_bits[ULP_CLASSES+2];
+ int state_bits[ULP_CLASSES+2];
+ int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
+ int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
+ int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+ int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+} iLBC_ULP_Inst_t;
- /* type definition encoder instance */
+/* type definition encoder instance */
- typedef struct iLBC_Enc_Inst_t_ {
+typedef struct iLBC_Enc_Inst_t_ {
- /* flag for frame size mode */
- int mode;
+ /* flag for frame size mode */
+ int mode;
- /* basic parameters for different frame sizes */
- int blockl;
- int nsub;
- int nasub;
- int no_of_bytes, no_of_words;
- int lpc_n;
- int state_short_len;
- const iLBC_ULP_Inst_t *ULP_inst;
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
- /* analysis filter state */
- float anaMem[LPC_FILTERORDER];
+ /* analysis filter state */
+ float anaMem[LPC_FILTERORDER];
- /* old lsf parameters for interpolation */
- float lsfold[LPC_FILTERORDER];
- float lsfdeqold[LPC_FILTERORDER];
+ /* old lsf parameters for interpolation */
+ float lsfold[LPC_FILTERORDER];
+ float lsfdeqold[LPC_FILTERORDER];
- /* signal buffer for LP analysis */
- float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
+ /* signal buffer for LP analysis */
+ float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
- /* state of input HP filter */
- float hpimem[4];
+ /* state of input HP filter */
+ float hpimem[4];
- } iLBC_Enc_Inst_t;
+} iLBC_Enc_Inst_t;
- /* type definition decoder instance */
- typedef struct iLBC_Dec_Inst_t_ {
+/* type definition decoder instance */
+typedef struct iLBC_Dec_Inst_t_ {
- /* flag for frame size mode */
- int mode;
+ /* flag for frame size mode */
+ int mode;
- /* basic parameters for different frame sizes */
- int blockl;
- int nsub;
- int nasub;
- int no_of_bytes, no_of_words;
- int lpc_n;
- int state_short_len;
- const iLBC_ULP_Inst_t *ULP_inst;
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
- /* synthesis filter state */
- float syntMem[LPC_FILTERORDER];
+ /* synthesis filter state */
+ float syntMem[LPC_FILTERORDER];
- /* old LSF for interpolation */
+ /* old LSF for interpolation */
- float lsfdeqold[LPC_FILTERORDER];
+ float lsfdeqold[LPC_FILTERORDER];
- /* pitch lag estimated in enhancer and used in PLC */
- int last_lag;
+ /* pitch lag estimated in enhancer and used in PLC */
+ int last_lag;
- /* PLC state information */
- int prevLag, consPLICount, prevPLI, prev_enh_pl;
- float prevLpc[LPC_FILTERORDER+1];
- float prevResidual[NSUB_MAX*SUBL];
- float per;
- unsigned long seed;
+ /* PLC state information */
+ int prevLag, consPLICount, prevPLI, prev_enh_pl;
+ float prevLpc[LPC_FILTERORDER+1];
+ float prevResidual[NSUB_MAX*SUBL];
+ float per;
+ unsigned long seed;
- /* previous synthesis filter parameters */
- float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
+ /* previous synthesis filter parameters */
+ float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
- /* state of output HP filter */
- float hpomem[4];
+ /* state of output HP filter */
+ float hpomem[4];
- /* enhancer state information */
- int use_enhancer;
- float enh_buf[ENH_BUFL];
- float enh_period[ENH_NBLOCKS_TOT];
+ /* enhancer state information */
+ int use_enhancer;
+ float enh_buf[ENH_BUFL];
+ float enh_period[ENH_NBLOCKS_TOT];
- } iLBC_Dec_Inst_t;
+} iLBC_Dec_Inst_t;
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/iLBC_encode.h b/thirdparties/win32/include/ilbc/iLBC_encode.h
index b993416..a1a26df 100755
--- a/thirdparties/win32/include/ilbc/iLBC_encode.h
+++ b/thirdparties/win32/include/ilbc/iLBC_encode.h
@@ -1,35 +1,35 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- iLBC_encode.h
+ iLBC_encode.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_ILBCENCODE_H
- #define __iLBC_ILBCENCODE_H
+#ifndef __iLBC_ILBCENCODE_H
+#define __iLBC_ILBCENCODE_H
- #include "iLBC_define.h"
+#include "iLBC_define.h"
- short initEncode( /* (o) Number of bytes
+short initEncode( /* (o) Number of bytes
encoded */
- iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
- int mode /* (i) frame size mode */
- );
+ iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
+ int mode /* (i) frame size mode */
+);
- void iLBC_encode(
+void iLBC_encode(
- unsigned char *bytes, /* (o) encoded data bits iLBC */
- float *block, /* (o) speech vector to
+ unsigned char *bytes, /* (o) encoded data bits iLBC */
+ float *block, /* (o) speech vector to
encode */
- iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
+ iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
state */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/lsf.h b/thirdparties/win32/include/ilbc/lsf.h
index 2cea08c..b1d180f 100755
--- a/thirdparties/win32/include/ilbc/lsf.h
+++ b/thirdparties/win32/include/ilbc/lsf.h
@@ -1,26 +1,26 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- lsf.h
+ lsf.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_LSF_H
- #define __iLBC_LSF_H
+#ifndef __iLBC_LSF_H
+#define __iLBC_LSF_H
- void a2lsf(
- float *freq,/* (o) lsf coefficients */
- float *a /* (i) lpc coefficients */
- );
+void a2lsf(
+ float *freq,/* (o) lsf coefficients */
+ float *a /* (i) lpc coefficients */
+);
- void lsf2a(
- float *a_coef, /* (o) lpc coefficients */
- float *freq /* (i) lsf coefficients */
- );
+void lsf2a(
+ float *a_coef, /* (o) lpc coefficients */
+ float *freq /* (i) lsf coefficients */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/packing.h b/thirdparties/win32/include/ilbc/packing.h
index 8bb1f36..f489f55 100755
--- a/thirdparties/win32/include/ilbc/packing.h
+++ b/thirdparties/win32/include/ilbc/packing.h
@@ -1,68 +1,68 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- packing.h
+ packing.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __PACKING_H
- #define __PACKING_H
+#ifndef __PACKING_H
+#define __PACKING_H
- void packsplit(
- int *index, /* (i) the value to split */
- int *firstpart, /* (o) the value specified by most
+void packsplit(
+ int *index, /* (i) the value to split */
+ int *firstpart, /* (o) the value specified by most
significant bits */
- int *rest, /* (o) the value specified by least
+ int *rest, /* (o) the value specified by least
significant bits */
- int bitno_firstpart, /* (i) number of bits in most
+ int bitno_firstpart, /* (i) number of bits in most
significant part */
- int bitno_total /* (i) number of bits in full range
+ int bitno_total /* (i) number of bits in full range
of value */
- );
+);
- void packcombine(
- int *index, /* (i/o) the msb value in the
+void packcombine(
+ int *index, /* (i/o) the msb value in the
combined value out */
- int rest, /* (i) the lsb value */
- int bitno_rest /* (i) the number of bits in the
+ int rest, /* (i) the lsb value */
+ int bitno_rest /* (i) the number of bits in the
lsb part */
- );
+);
- void dopack(
- unsigned char **bitstream, /* (i/o) on entrance pointer to
+void dopack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
place in bitstream to pack
new data, on exit pointer
to place in bitstream to
pack future data */
- int index, /* (i) the value to pack */
- int bitno, /* (i) the number of bits that the
+ int index, /* (i) the value to pack */
+ int bitno, /* (i) the number of bits that the
value will fit within */
- int *pos /* (i/o) write position in the
+ int *pos /* (i/o) write position in the
current byte */
- );
+);
- void unpack(
- unsigned char **bitstream, /* (i/o) on entrance pointer to
+void unpack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
place in bitstream to
unpack new data from, on
exit pointer to place in
bitstream to unpack future
data from */
- int *index, /* (o) resulting value */
- int bitno, /* (i) number of bits used to
+ int *index, /* (o) resulting value */
+ int bitno, /* (i) number of bits used to
represent the value */
- int *pos /* (i/o) read position in the
+ int *pos /* (i/o) read position in the
current byte */
- );
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/ilbc/syntFilter.h b/thirdparties/win32/include/ilbc/syntFilter.h
index 0dc4d3d..71ab4e0 100755
--- a/thirdparties/win32/include/ilbc/syntFilter.h
+++ b/thirdparties/win32/include/ilbc/syntFilter.h
@@ -1,23 +1,23 @@
- /******************************************************************
+/******************************************************************
- iLBC Speech Coder ANSI-C Source Code
+ iLBC Speech Coder ANSI-C Source Code
- syntFilter.h
+ syntFilter.h
- Copyright (C) The Internet Society (2004).
- All Rights Reserved.
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
- ******************************************************************/
+******************************************************************/
- #ifndef __iLBC_SYNTFILTER_H
- #define __iLBC_SYNTFILTER_H
+#ifndef __iLBC_SYNTFILTER_H
+#define __iLBC_SYNTFILTER_H
- void syntFilter(
- float *Out, /* (i/o) Signal to be filtered */
- float *a, /* (i) LP parameters */
- int len, /* (i) Length of signal */
- float *mem /* (i/o) Filter state */
- );
+void syntFilter(
+ float *Out, /* (i/o) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len, /* (i) Length of signal */
+ float *mem /* (i/o) Filter state */
+);
- #endif
+#endif
diff --git a/thirdparties/win32/include/inttypes.h b/thirdparties/win32/include/inttypes.h
index 4b3828a..2304cea 100755
--- a/thirdparties/win32/include/inttypes.h
+++ b/thirdparties/win32/include/inttypes.h
@@ -1,32 +1,32 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
// Copyright (c) 2006 Alexander Chemeris
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
-//
+//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
-//
+//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
+//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
@@ -45,8 +45,8 @@
// 7.8 Format conversion of integer types
typedef struct {
- intmax_t quot;
- intmax_t rem;
+ intmax_t quot;
+ intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
@@ -279,18 +279,18 @@ _inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
- imaxdiv_t result;
+ imaxdiv_t result;
- result.quot = numer / denom;
- result.rem = numer % denom;
+ result.quot = numer / denom;
+ result.rem = numer % denom;
- if (numer < 0 && result.rem > 0) {
- // did division wrong; must fix up
- ++result.quot;
- result.rem -= denom;
- }
+ if (numer < 0 && result.rem > 0) {
+ // did division wrong; must fix up
+ ++result.quot;
+ result.rem -= denom;
+ }
- return result;
+ return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
diff --git a/thirdparties/win32/include/libavcodec/avcodec.h b/thirdparties/win32/include/libavcodec/avcodec.h
index c4db4d7..479a2a4 100755
--- a/thirdparties/win32/include/libavcodec/avcodec.h
+++ b/thirdparties/win32/include/libavcodec/avcodec.h
@@ -588,7 +588,7 @@ enum Motion_Est_ID {
/**
* @ingroup lavc_decoding
*/
-enum AVDiscard{
+enum AVDiscard {
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
AVDISCARD_NONE =-16, ///< discard nothing
@@ -599,7 +599,7 @@ enum AVDiscard{
AVDISCARD_ALL = 48, ///< discard all
};
-enum AVColorPrimaries{
+enum AVColorPrimaries {
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_BT470M = 4,
@@ -610,7 +610,7 @@ enum AVColorPrimaries{
AVCOL_PRI_NB , ///< Not part of ABI
};
-enum AVColorTransferCharacteristic{
+enum AVColorTransferCharacteristic {
AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361
AVCOL_TRC_UNSPECIFIED = 2,
AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@@ -619,7 +619,7 @@ enum AVColorTransferCharacteristic{
AVCOL_TRC_NB , ///< Not part of ABI
};
-enum AVColorSpace{
+enum AVColorSpace {
AVCOL_SPC_RGB = 0,
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVCOL_SPC_UNSPECIFIED = 2,
@@ -632,7 +632,7 @@ enum AVColorSpace{
};
#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
-enum AVColorRange{
+enum AVColorRange {
AVCOL_RANGE_UNSPECIFIED = 0,
AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
@@ -644,7 +644,7 @@ enum AVColorRange{
* 1 2 1-6 are possible chroma positions
* X X 5 6 X 0 is undefined/unknown position
*/
-enum AVChromaLocation{
+enum AVChromaLocation {
AVCHROMA_LOC_UNSPECIFIED = 0,
AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default
AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263
@@ -671,7 +671,7 @@ enum AVAudioServiceType {
/**
* @ingroup lavc_encoding
*/
-typedef struct RcOverride{
+typedef struct RcOverride {
int start_frame;
int end_frame;
int qscale; // If this is 0 then quality_factor will be used instead.
@@ -863,7 +863,7 @@ typedef struct RcOverride{
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
*/
-typedef struct AVPanScan{
+typedef struct AVPanScan {
/**
* id
* - encoding: Set by user.
@@ -885,7 +885,7 @@ typedef struct AVPanScan{
* - decoding: Set by libavcodec.
*/
int16_t position[3][2];
-}AVPanScan;
+} AVPanScan;
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
@@ -1929,7 +1929,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int prediction_method;
+ int prediction_method;
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
@@ -2699,11 +2699,11 @@ typedef struct AVCodecContext {
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
int rtp_payload_size; /* The size of the RTP payload: the coder will */
- /* do its best to deliver a chunk with size */
- /* below rtp_payload_size, the chunk will start */
- /* with a start code on some codecs like H.263. */
- /* This doesn't take account of any particular */
- /* headers inside the transmitted RTP payload. */
+ /* do its best to deliver a chunk with size */
+ /* below rtp_payload_size, the chunk will start */
+ /* with a start code on some codecs like H.263. */
+ /* This doesn't take account of any particular */
+ /* headers inside the transmitted RTP payload. */
/* statistics, used for 2-pass encoding */
int mv_bits;
@@ -2934,7 +2934,7 @@ typedef struct AVCodecContext {
* - encoding: Set by libavcodec.
* - decoding: Set by user.
*/
- int bits_per_coded_sample;
+ int bits_per_coded_sample;
/**
* Bits per sample/pixel of internal libavcodec pixel/sample format.
@@ -2948,7 +2948,7 @@ typedef struct AVCodecContext {
* - encoding: unused
* - decoding: Set by user.
*/
- int lowres;
+ int lowres;
/**
* the picture in the bitstream
@@ -3038,14 +3038,14 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: unused
*/
- int nsse_weight;
+ int nsse_weight;
/**
* profile
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int profile;
+ int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100
@@ -3115,7 +3115,7 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
- int level;
+ int level;
#define FF_LEVEL_UNKNOWN -99
/**
@@ -3992,8 +3992,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
* used or zero if no frame data was decompressed (used) from the input AVPacket.
*/
attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt);
+ int *frame_size_ptr,
+ AVPacket *avpkt);
#endif
/**
@@ -4074,8 +4074,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
* used or zero if no frame could be decompressed.
*/
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- const AVPacket *avpkt);
+ int *got_picture_ptr,
+ const AVPacket *avpkt);
/**
* Decode a subtitle message.
@@ -4094,8 +4094,8 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr,
+ AVPacket *avpkt);
/**
* @defgroup lavc_parsing Frame parsing
@@ -4353,8 +4353,8 @@ AVCodec *avcodec_find_encoder_by_name(const char *name);
* of bytes used to encode the data read from the input buffer.
*/
int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples);
+ uint8_t *buf, int buf_size,
+ const short *samples);
#endif
/**
@@ -4642,7 +4642,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
* Pad image.
*/
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
+ int padtop, int padbottom, int padleft, int padright, int *color);
/**
* @}
@@ -4745,7 +4745,7 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat
*/
attribute_deprecated
enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */
/**
@@ -4766,8 +4766,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelF
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
/**
* Find the best pixel format to convert to given a certain source pixel
@@ -4800,16 +4800,16 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt
* @return The best pixel format to convert to or -1 if none was found.
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
attribute_deprecated
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
- enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
#else
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
- enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
#endif
@@ -5033,10 +5033,10 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
* Lock operation used by lockmgr
*/
enum AVLockOp {
- AV_LOCK_CREATE, ///< Create a mutex
- AV_LOCK_OBTAIN, ///< Lock the mutex
- AV_LOCK_RELEASE, ///< Unlock the mutex
- AV_LOCK_DESTROY, ///< Free mutex resources
+ AV_LOCK_CREATE, ///< Create a mutex
+ AV_LOCK_OBTAIN, ///< Lock the mutex
+ AV_LOCK_RELEASE, ///< Unlock the mutex
+ AV_LOCK_DESTROY, ///< Free mutex resources
};
/**
diff --git a/thirdparties/win32/include/libavcodec/old_codec_ids.h b/thirdparties/win32/include/libavcodec/old_codec_ids.h
index ded4cc7..e0d3d7e 100755
--- a/thirdparties/win32/include/libavcodec/old_codec_ids.h
+++ b/thirdparties/win32/include/libavcodec/old_codec_ids.h
@@ -29,370 +29,370 @@
* Do not add new items to this list. Use the AVCodecID enum instead.
*/
- CODEC_ID_NONE = AV_CODEC_ID_NONE,
+CODEC_ID_NONE = AV_CODEC_ID_NONE,
- /* video codecs */
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
- CODEC_ID_MPEG2VIDEO_XVMC,
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_SNOW,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_DXA,
- CODEC_ID_DNXHD,
- CODEC_ID_THP,
- CODEC_ID_SGI,
- CODEC_ID_C93,
- CODEC_ID_BETHSOFTVID,
- CODEC_ID_PTX,
- CODEC_ID_TXD,
- CODEC_ID_VP6A,
- CODEC_ID_AMV,
- CODEC_ID_VB,
- CODEC_ID_PCX,
- CODEC_ID_SUNRAST,
- CODEC_ID_INDEO4,
- CODEC_ID_INDEO5,
- CODEC_ID_MIMIC,
- CODEC_ID_RL2,
- CODEC_ID_ESCAPE124,
- CODEC_ID_DIRAC,
- CODEC_ID_BFI,
- CODEC_ID_CMV,
- CODEC_ID_MOTIONPIXELS,
- CODEC_ID_TGV,
- CODEC_ID_TGQ,
- CODEC_ID_TQI,
- CODEC_ID_AURA,
- CODEC_ID_AURA2,
- CODEC_ID_V210X,
- CODEC_ID_TMV,
- CODEC_ID_V210,
- CODEC_ID_DPX,
- CODEC_ID_MAD,
- CODEC_ID_FRWU,
- CODEC_ID_FLASHSV2,
- CODEC_ID_CDGRAPHICS,
- CODEC_ID_R210,
- CODEC_ID_ANM,
- CODEC_ID_BINKVIDEO,
- CODEC_ID_IFF_ILBM,
- CODEC_ID_IFF_BYTERUN1,
- CODEC_ID_KGV1,
- CODEC_ID_YOP,
- CODEC_ID_VP8,
- CODEC_ID_PICTOR,
- CODEC_ID_ANSI,
- CODEC_ID_A64_MULTI,
- CODEC_ID_A64_MULTI5,
- CODEC_ID_R10K,
- CODEC_ID_MXPEG,
- CODEC_ID_LAGARITH,
- CODEC_ID_PRORES,
- CODEC_ID_JV,
- CODEC_ID_DFA,
- CODEC_ID_WMV3IMAGE,
- CODEC_ID_VC1IMAGE,
- CODEC_ID_UTVIDEO,
- CODEC_ID_BMV_VIDEO,
- CODEC_ID_VBLE,
- CODEC_ID_DXTORY,
- CODEC_ID_V410,
- CODEC_ID_XWD,
- CODEC_ID_CDXL,
- CODEC_ID_XBM,
- CODEC_ID_ZEROCODEC,
- CODEC_ID_MSS1,
- CODEC_ID_MSA1,
- CODEC_ID_TSCC2,
- CODEC_ID_MTS2,
- CODEC_ID_CLLC,
- CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
+/* video codecs */
+CODEC_ID_MPEG1VIDEO,
+CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+CODEC_ID_MPEG2VIDEO_XVMC,
+CODEC_ID_H261,
+CODEC_ID_H263,
+CODEC_ID_RV10,
+CODEC_ID_RV20,
+CODEC_ID_MJPEG,
+CODEC_ID_MJPEGB,
+CODEC_ID_LJPEG,
+CODEC_ID_SP5X,
+CODEC_ID_JPEGLS,
+CODEC_ID_MPEG4,
+CODEC_ID_RAWVIDEO,
+CODEC_ID_MSMPEG4V1,
+CODEC_ID_MSMPEG4V2,
+CODEC_ID_MSMPEG4V3,
+CODEC_ID_WMV1,
+CODEC_ID_WMV2,
+CODEC_ID_H263P,
+CODEC_ID_H263I,
+CODEC_ID_FLV1,
+CODEC_ID_SVQ1,
+CODEC_ID_SVQ3,
+CODEC_ID_DVVIDEO,
+CODEC_ID_HUFFYUV,
+CODEC_ID_CYUV,
+CODEC_ID_H264,
+CODEC_ID_INDEO3,
+CODEC_ID_VP3,
+CODEC_ID_THEORA,
+CODEC_ID_ASV1,
+CODEC_ID_ASV2,
+CODEC_ID_FFV1,
+CODEC_ID_4XM,
+CODEC_ID_VCR1,
+CODEC_ID_CLJR,
+CODEC_ID_MDEC,
+CODEC_ID_ROQ,
+CODEC_ID_INTERPLAY_VIDEO,
+CODEC_ID_XAN_WC3,
+CODEC_ID_XAN_WC4,
+CODEC_ID_RPZA,
+CODEC_ID_CINEPAK,
+CODEC_ID_WS_VQA,
+CODEC_ID_MSRLE,
+CODEC_ID_MSVIDEO1,
+CODEC_ID_IDCIN,
+CODEC_ID_8BPS,
+CODEC_ID_SMC,
+CODEC_ID_FLIC,
+CODEC_ID_TRUEMOTION1,
+CODEC_ID_VMDVIDEO,
+CODEC_ID_MSZH,
+CODEC_ID_ZLIB,
+CODEC_ID_QTRLE,
+CODEC_ID_SNOW,
+CODEC_ID_TSCC,
+CODEC_ID_ULTI,
+CODEC_ID_QDRAW,
+CODEC_ID_VIXL,
+CODEC_ID_QPEG,
+CODEC_ID_PNG,
+CODEC_ID_PPM,
+CODEC_ID_PBM,
+CODEC_ID_PGM,
+CODEC_ID_PGMYUV,
+CODEC_ID_PAM,
+CODEC_ID_FFVHUFF,
+CODEC_ID_RV30,
+CODEC_ID_RV40,
+CODEC_ID_VC1,
+CODEC_ID_WMV3,
+CODEC_ID_LOCO,
+CODEC_ID_WNV1,
+CODEC_ID_AASC,
+CODEC_ID_INDEO2,
+CODEC_ID_FRAPS,
+CODEC_ID_TRUEMOTION2,
+CODEC_ID_BMP,
+CODEC_ID_CSCD,
+CODEC_ID_MMVIDEO,
+CODEC_ID_ZMBV,
+CODEC_ID_AVS,
+CODEC_ID_SMACKVIDEO,
+CODEC_ID_NUV,
+CODEC_ID_KMVC,
+CODEC_ID_FLASHSV,
+CODEC_ID_CAVS,
+CODEC_ID_JPEG2000,
+CODEC_ID_VMNC,
+CODEC_ID_VP5,
+CODEC_ID_VP6,
+CODEC_ID_VP6F,
+CODEC_ID_TARGA,
+CODEC_ID_DSICINVIDEO,
+CODEC_ID_TIERTEXSEQVIDEO,
+CODEC_ID_TIFF,
+CODEC_ID_GIF,
+CODEC_ID_DXA,
+CODEC_ID_DNXHD,
+CODEC_ID_THP,
+CODEC_ID_SGI,
+CODEC_ID_C93,
+CODEC_ID_BETHSOFTVID,
+CODEC_ID_PTX,
+CODEC_ID_TXD,
+CODEC_ID_VP6A,
+CODEC_ID_AMV,
+CODEC_ID_VB,
+CODEC_ID_PCX,
+CODEC_ID_SUNRAST,
+CODEC_ID_INDEO4,
+CODEC_ID_INDEO5,
+CODEC_ID_MIMIC,
+CODEC_ID_RL2,
+CODEC_ID_ESCAPE124,
+CODEC_ID_DIRAC,
+CODEC_ID_BFI,
+CODEC_ID_CMV,
+CODEC_ID_MOTIONPIXELS,
+CODEC_ID_TGV,
+CODEC_ID_TGQ,
+CODEC_ID_TQI,
+CODEC_ID_AURA,
+CODEC_ID_AURA2,
+CODEC_ID_V210X,
+CODEC_ID_TMV,
+CODEC_ID_V210,
+CODEC_ID_DPX,
+CODEC_ID_MAD,
+CODEC_ID_FRWU,
+CODEC_ID_FLASHSV2,
+CODEC_ID_CDGRAPHICS,
+CODEC_ID_R210,
+CODEC_ID_ANM,
+CODEC_ID_BINKVIDEO,
+CODEC_ID_IFF_ILBM,
+CODEC_ID_IFF_BYTERUN1,
+CODEC_ID_KGV1,
+CODEC_ID_YOP,
+CODEC_ID_VP8,
+CODEC_ID_PICTOR,
+CODEC_ID_ANSI,
+CODEC_ID_A64_MULTI,
+CODEC_ID_A64_MULTI5,
+CODEC_ID_R10K,
+CODEC_ID_MXPEG,
+CODEC_ID_LAGARITH,
+CODEC_ID_PRORES,
+CODEC_ID_JV,
+CODEC_ID_DFA,
+CODEC_ID_WMV3IMAGE,
+CODEC_ID_VC1IMAGE,
+CODEC_ID_UTVIDEO,
+CODEC_ID_BMV_VIDEO,
+CODEC_ID_VBLE,
+CODEC_ID_DXTORY,
+CODEC_ID_V410,
+CODEC_ID_XWD,
+CODEC_ID_CDXL,
+CODEC_ID_XBM,
+CODEC_ID_ZEROCODEC,
+CODEC_ID_MSS1,
+CODEC_ID_MSA1,
+CODEC_ID_TSCC2,
+CODEC_ID_MTS2,
+CODEC_ID_CLLC,
+CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
+CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
+CODEC_ID_EXR = MKBETAG('0','E','X','R'),
+CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
- CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
+CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
+CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
+CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
+CODEC_ID_V308 = MKBETAG('V','3','0','8'),
+CODEC_ID_V408 = MKBETAG('V','4','0','8'),
+CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
+CODEC_ID_SANM = MKBETAG('S','A','N','M'),
+CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- /* various PCM "codecs" */
- CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
- CODEC_ID_PCM_S16LE = 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
- CODEC_ID_PCM_ZORK,
- CODEC_ID_PCM_S16LE_PLANAR,
- CODEC_ID_PCM_DVD,
- CODEC_ID_PCM_F32BE,
- CODEC_ID_PCM_F32LE,
- CODEC_ID_PCM_F64BE,
- CODEC_ID_PCM_F64LE,
- CODEC_ID_PCM_BLURAY,
- CODEC_ID_PCM_LXF,
- CODEC_ID_S302M,
- CODEC_ID_PCM_S8_PLANAR,
+/* various PCM "codecs" */
+CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
+CODEC_ID_PCM_S16LE = 0x10000,
+CODEC_ID_PCM_S16BE,
+CODEC_ID_PCM_U16LE,
+CODEC_ID_PCM_U16BE,
+CODEC_ID_PCM_S8,
+CODEC_ID_PCM_U8,
+CODEC_ID_PCM_MULAW,
+CODEC_ID_PCM_ALAW,
+CODEC_ID_PCM_S32LE,
+CODEC_ID_PCM_S32BE,
+CODEC_ID_PCM_U32LE,
+CODEC_ID_PCM_U32BE,
+CODEC_ID_PCM_S24LE,
+CODEC_ID_PCM_S24BE,
+CODEC_ID_PCM_U24LE,
+CODEC_ID_PCM_U24BE,
+CODEC_ID_PCM_S24DAUD,
+CODEC_ID_PCM_ZORK,
+CODEC_ID_PCM_S16LE_PLANAR,
+CODEC_ID_PCM_DVD,
+CODEC_ID_PCM_F32BE,
+CODEC_ID_PCM_F32LE,
+CODEC_ID_PCM_F64BE,
+CODEC_ID_PCM_F64LE,
+CODEC_ID_PCM_BLURAY,
+CODEC_ID_PCM_LXF,
+CODEC_ID_S302M,
+CODEC_ID_PCM_S8_PLANAR,
- /* various ADPCM codecs */
- CODEC_ID_ADPCM_IMA_QT = 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
- CODEC_ID_ADPCM_THP,
- CODEC_ID_ADPCM_IMA_AMV,
- CODEC_ID_ADPCM_EA_R1,
- CODEC_ID_ADPCM_EA_R3,
- CODEC_ID_ADPCM_EA_R2,
- CODEC_ID_ADPCM_IMA_EA_SEAD,
- CODEC_ID_ADPCM_IMA_EA_EACS,
- CODEC_ID_ADPCM_EA_XAS,
- CODEC_ID_ADPCM_EA_MAXIS_XA,
- CODEC_ID_ADPCM_IMA_ISS,
- CODEC_ID_ADPCM_G722,
- CODEC_ID_ADPCM_IMA_APC,
- CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+/* various ADPCM codecs */
+CODEC_ID_ADPCM_IMA_QT = 0x11000,
+CODEC_ID_ADPCM_IMA_WAV,
+CODEC_ID_ADPCM_IMA_DK3,
+CODEC_ID_ADPCM_IMA_DK4,
+CODEC_ID_ADPCM_IMA_WS,
+CODEC_ID_ADPCM_IMA_SMJPEG,
+CODEC_ID_ADPCM_MS,
+CODEC_ID_ADPCM_4XM,
+CODEC_ID_ADPCM_XA,
+CODEC_ID_ADPCM_ADX,
+CODEC_ID_ADPCM_EA,
+CODEC_ID_ADPCM_G726,
+CODEC_ID_ADPCM_CT,
+CODEC_ID_ADPCM_SWF,
+CODEC_ID_ADPCM_YAMAHA,
+CODEC_ID_ADPCM_SBPRO_4,
+CODEC_ID_ADPCM_SBPRO_3,
+CODEC_ID_ADPCM_SBPRO_2,
+CODEC_ID_ADPCM_THP,
+CODEC_ID_ADPCM_IMA_AMV,
+CODEC_ID_ADPCM_EA_R1,
+CODEC_ID_ADPCM_EA_R3,
+CODEC_ID_ADPCM_EA_R2,
+CODEC_ID_ADPCM_IMA_EA_SEAD,
+CODEC_ID_ADPCM_IMA_EA_EACS,
+CODEC_ID_ADPCM_EA_XAS,
+CODEC_ID_ADPCM_EA_MAXIS_XA,
+CODEC_ID_ADPCM_IMA_ISS,
+CODEC_ID_ADPCM_G722,
+CODEC_ID_ADPCM_IMA_APC,
+CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
- /* AMR */
- CODEC_ID_AMR_NB = 0x12000,
- CODEC_ID_AMR_WB,
+/* AMR */
+CODEC_ID_AMR_NB = 0x12000,
+CODEC_ID_AMR_WB,
- /* RealAudio codecs*/
- CODEC_ID_RA_144 = 0x13000,
- CODEC_ID_RA_288,
+/* RealAudio codecs*/
+CODEC_ID_RA_144 = 0x13000,
+CODEC_ID_RA_288,
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM = 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
+/* various DPCM codecs */
+CODEC_ID_ROQ_DPCM = 0x14000,
+CODEC_ID_INTERPLAY_DPCM,
+CODEC_ID_XAN_DPCM,
+CODEC_ID_SOL_DPCM,
- /* audio codecs */
- CODEC_ID_MP2 = 0x15000,
- CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
- CODEC_ID_AAC,
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM, ///< as in Berlin toast format
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
- CODEC_ID_MLP,
- CODEC_ID_GSM_MS, /* as found in WAV */
- CODEC_ID_ATRAC3,
- CODEC_ID_VOXWARE,
- CODEC_ID_APE,
- CODEC_ID_NELLYMOSER,
- CODEC_ID_MUSEPACK8,
- CODEC_ID_SPEEX,
- CODEC_ID_WMAVOICE,
- CODEC_ID_WMAPRO,
- CODEC_ID_WMALOSSLESS,
- CODEC_ID_ATRAC3P,
- CODEC_ID_EAC3,
- CODEC_ID_SIPR,
- CODEC_ID_MP1,
- CODEC_ID_TWINVQ,
- CODEC_ID_TRUEHD,
- CODEC_ID_MP4ALS,
- CODEC_ID_ATRAC1,
- CODEC_ID_BINKAUDIO_RDFT,
- CODEC_ID_BINKAUDIO_DCT,
- CODEC_ID_AAC_LATM,
- CODEC_ID_QDMC,
- CODEC_ID_CELT,
- CODEC_ID_G723_1,
- CODEC_ID_G729,
- CODEC_ID_8SVX_EXP,
- CODEC_ID_8SVX_FIB,
- CODEC_ID_BMV_AUDIO,
- CODEC_ID_RALF,
- CODEC_ID_IAC,
- CODEC_ID_ILBC,
- CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
- CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
+/* audio codecs */
+CODEC_ID_MP2 = 0x15000,
+CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+CODEC_ID_AAC,
+CODEC_ID_AC3,
+CODEC_ID_DTS,
+CODEC_ID_VORBIS,
+CODEC_ID_DVAUDIO,
+CODEC_ID_WMAV1,
+CODEC_ID_WMAV2,
+CODEC_ID_MACE3,
+CODEC_ID_MACE6,
+CODEC_ID_VMDAUDIO,
+CODEC_ID_FLAC,
+CODEC_ID_MP3ADU,
+CODEC_ID_MP3ON4,
+CODEC_ID_SHORTEN,
+CODEC_ID_ALAC,
+CODEC_ID_WESTWOOD_SND1,
+CODEC_ID_GSM, ///< as in Berlin toast format
+CODEC_ID_QDM2,
+CODEC_ID_COOK,
+CODEC_ID_TRUESPEECH,
+CODEC_ID_TTA,
+CODEC_ID_SMACKAUDIO,
+CODEC_ID_QCELP,
+CODEC_ID_WAVPACK,
+CODEC_ID_DSICINAUDIO,
+CODEC_ID_IMC,
+CODEC_ID_MUSEPACK7,
+CODEC_ID_MLP,
+CODEC_ID_GSM_MS, /* as found in WAV */
+CODEC_ID_ATRAC3,
+CODEC_ID_VOXWARE,
+CODEC_ID_APE,
+CODEC_ID_NELLYMOSER,
+CODEC_ID_MUSEPACK8,
+CODEC_ID_SPEEX,
+CODEC_ID_WMAVOICE,
+CODEC_ID_WMAPRO,
+CODEC_ID_WMALOSSLESS,
+CODEC_ID_ATRAC3P,
+CODEC_ID_EAC3,
+CODEC_ID_SIPR,
+CODEC_ID_MP1,
+CODEC_ID_TWINVQ,
+CODEC_ID_TRUEHD,
+CODEC_ID_MP4ALS,
+CODEC_ID_ATRAC1,
+CODEC_ID_BINKAUDIO_RDFT,
+CODEC_ID_BINKAUDIO_DCT,
+CODEC_ID_AAC_LATM,
+CODEC_ID_QDMC,
+CODEC_ID_CELT,
+CODEC_ID_G723_1,
+CODEC_ID_G729,
+CODEC_ID_8SVX_EXP,
+CODEC_ID_8SVX_FIB,
+CODEC_ID_BMV_AUDIO,
+CODEC_ID_RALF,
+CODEC_ID_IAC,
+CODEC_ID_ILBC,
+CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
+CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
+CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
+CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
+CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
+CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
- /* subtitle codecs */
- CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
- CODEC_ID_DVD_SUBTITLE = 0x17000,
- CODEC_ID_DVB_SUBTITLE,
- CODEC_ID_TEXT, ///< raw UTF-8 text
- CODEC_ID_XSUB,
- CODEC_ID_SSA,
- CODEC_ID_MOV_TEXT,
- CODEC_ID_HDMV_PGS_SUBTITLE,
- CODEC_ID_DVB_TELETEXT,
- CODEC_ID_SRT,
- CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
+/* subtitle codecs */
+CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
+CODEC_ID_DVD_SUBTITLE = 0x17000,
+CODEC_ID_DVB_SUBTITLE,
+CODEC_ID_TEXT, ///< raw UTF-8 text
+CODEC_ID_XSUB,
+CODEC_ID_SSA,
+CODEC_ID_MOV_TEXT,
+CODEC_ID_HDMV_PGS_SUBTITLE,
+CODEC_ID_DVB_TELETEXT,
+CODEC_ID_SRT,
+CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
+CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
+CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
+CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
+CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
+CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
- /* other specific kind of codecs (generally used for attachments) */
- CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
- CODEC_ID_TTF = 0x18000,
- CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
+/* other specific kind of codecs (generally used for attachments) */
+CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
+CODEC_ID_TTF = 0x18000,
+CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
+CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
+CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
+CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
- CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
- CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
- CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+ CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
- CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
+ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/thirdparties/win32/include/libavcodec/opt.h b/thirdparties/win32/include/libavcodec/opt.h
index 55ca4ea..e212bf2 100755
--- a/thirdparties/win32/include/libavcodec/opt.h
+++ b/thirdparties/win32/include/libavcodec/opt.h
@@ -30,7 +30,7 @@
#include "libavutil/rational.h"
#include "avcodec.h"
-enum AVOptionType{
+enum AVOptionType {
FF_OPT_TYPE_FLAGS,
FF_OPT_TYPE_INT,
FF_OPT_TYPE_INT64,
@@ -119,14 +119,14 @@ typedef struct AVOption2 {
double max; ///< maximum valid value for the option
int flags;
-/*
-#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM 8
-#define AV_OPT_FLAG_VIDEO_PARAM 16
-#define AV_OPT_FLAG_SUBTITLE_PARAM 32
-*/
+ /*
+ #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
+ #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
+ #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
+ #define AV_OPT_FLAG_AUDIO_PARAM 8
+ #define AV_OPT_FLAG_VIDEO_PARAM 16
+ #define AV_OPT_FLAG_SUBTITLE_PARAM 32
+ */
//FIXME think about enc-audio, ... style flags
/**
diff --git a/thirdparties/win32/include/libavcodec/vdpau.h b/thirdparties/win32/include/libavcodec/vdpau.h
index df2aace..fe1d3b7 100755
--- a/thirdparties/win32/include/libavcodec/vdpau.h
+++ b/thirdparties/win32/include/libavcodec/vdpau.h
@@ -104,12 +104,12 @@ typedef struct AVVDPAUContext {
*/
int bitstream_buffers_used;
- /**
- * Table of bitstream buffers.
- * The user is responsible for freeing this buffer using av_freep().
- *
- * Set by libavcodec.
- */
+ /**
+ * Table of bitstream buffers.
+ * The user is responsible for freeing this buffer using av_freep().
+ *
+ * Set by libavcodec.
+ */
VdpBitstreamBuffer *bitstream_buffers;
} AVVDPAUContext;
diff --git a/thirdparties/win32/include/libavcodec/xvmc.h b/thirdparties/win32/include/libavcodec/xvmc.h
index b2bf518..373d9aa 100755
--- a/thirdparties/win32/include/libavcodec/xvmc.h
+++ b/thirdparties/win32/include/libavcodec/xvmc.h
@@ -101,8 +101,8 @@ struct xvmc_pix_fmt {
*/
XvMCSurface* p_surface;
-/** Set by the decoder before calling ff_draw_horiz_band(),
- needed by the XvMCRenderSurface function. */
+ /** Set by the decoder before calling ff_draw_horiz_band(),
+ needed by the XvMCRenderSurface function. */
//@{
/** Pointer to the surface used as past reference
- application - unchanged
diff --git a/thirdparties/win32/include/libavfilter/avcodec.h b/thirdparties/win32/include/libavfilter/avcodec.h
index 5f4209a..8dee966 100755
--- a/thirdparties/win32/include/libavfilter/avcodec.h
+++ b/thirdparties/win32/include/libavfilter/avcodec.h
@@ -63,7 +63,7 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms);
+ int perms);
/**
* Create and return a buffer reference from the data and properties
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms);
+ const AVFrame *frame,
+ int perms);
#ifdef FF_API_FILL_FRAME
/**
@@ -87,7 +87,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
*/
attribute_deprecated
int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *samplesref);
+ const AVFilterBufferRef *samplesref);
/**
* Fill an AVFrame with the information stored in picref.
@@ -100,7 +100,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
*/
attribute_deprecated
int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
- const AVFilterBufferRef *picref);
+ const AVFilterBufferRef *picref);
/**
* Fill an AVFrame with information stored in ref.
diff --git a/thirdparties/win32/include/libavfilter/avfilter.h b/thirdparties/win32/include/libavfilter/avfilter.h
index 1c80167..69c028e 100755
--- a/thirdparties/win32/include/libavfilter/avfilter.h
+++ b/thirdparties/win32/include/libavfilter/avfilter.h
@@ -714,7 +714,7 @@ int avfilter_config_links(AVFilterContext *filter);
*/
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum AVPixelFormat format);
+ int w, int h, enum AVPixelFormat format);
/**
* Create an audio buffer reference wrapped around an already
@@ -731,11 +731,11 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin
* @param channel_layout the channel layout of the buffer
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ uint64_t channel_layout);
/**
* Create an audio buffer reference wrapped around an already
* allocated samples buffer.
@@ -750,12 +750,12 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
* must be either 0 or consistent with channels
*/
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- int channels,
- uint64_t channel_layout);
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ int channels,
+ uint64_t channel_layout);
diff --git a/thirdparties/win32/include/libavformat/avformat.h b/thirdparties/win32/include/libavformat/avformat.h
index d23d0e8..575b088 100755
--- a/thirdparties/win32/include/libavformat/avformat.h
+++ b/thirdparties/win32/include/libavformat/avformat.h
@@ -367,9 +367,9 @@ typedef struct AVProbeData {
#else
#define AVFMT_TS_NONSTRICT 0x20000
#endif
- /**< Format does not require strictly
- increasing timestamps, but they must
- still be monotonic */
+/**< Format does not require strictly
+ increasing timestamps, but they must
+ still be monotonic */
#define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */
@@ -1378,7 +1378,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
#if FF_API_PKT_DUMP
attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
- int dump_payload);
+ int dump_payload);
#endif
#if FF_API_ALLOC_OUTPUT_CONTEXT
@@ -1387,8 +1387,8 @@ attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
*/
attribute_deprecated
AVFormatContext *avformat_alloc_output_context(const char *format,
- AVOutputFormat *oformat,
- const char *filename);
+ AVOutputFormat *oformat,
+ const char *filename);
#endif
/**
@@ -1835,8 +1835,8 @@ AVOutputFormat *av_guess_format(const char *short_name,
* Guess the codec ID based upon muxer and filename.
*/
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
- const char *filename, const char *mime_type,
- enum AVMediaType type);
+ const char *filename, const char *mime_type,
+ enum AVMediaType type);
/**
* Get timing information for the data currently output.
diff --git a/thirdparties/win32/include/libavformat/avio.h b/thirdparties/win32/include/libavformat/avio.h
index 17b341d..4623814 100755
--- a/thirdparties/win32/include/libavformat/avio.h
+++ b/thirdparties/win32/include/libavformat/avio.h
@@ -120,26 +120,26 @@ typedef struct AVIOContext {
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t maxsize;
+ int64_t maxsize;
- /**
- * avio_read and avio_write should if possible be satisfied directly
- * instead of going through a buffer, and avio_seek will always
- * call the underlying seek function directly.
- */
- int direct;
+ /**
+ * avio_read and avio_write should if possible be satisfied directly
+ * instead of going through a buffer, and avio_seek will always
+ * call the underlying seek function directly.
+ */
+ int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int64_t bytes_read;
+ int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
- int seek_count;
+ int seek_count;
} AVIOContext;
/* unbuffered I/O */
@@ -177,13 +177,13 @@ int avio_check(const char *url, int flags);
* @return Allocated AVIOContext or NULL on failure.
*/
AVIOContext *avio_alloc_context(
- unsigned char *buffer,
- int buffer_size,
- int write_flag,
- void *opaque,
- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
- int64_t (*seek)(void *opaque, int64_t offset, int whence));
+ unsigned char *buffer,
+ int buffer_size,
+ int write_flag,
+ void *opaque,
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+ int64_t (*seek)(void *opaque, int64_t offset, int whence));
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
diff --git a/thirdparties/win32/include/libavutil/avstring.h b/thirdparties/win32/include/libavutil/avstring.h
index 5b078f1..00ecca7 100755
--- a/thirdparties/win32/include/libavutil/avstring.h
+++ b/thirdparties/win32/include/libavutil/avstring.h
@@ -214,8 +214,9 @@ static inline int av_isspace(int c)
*/
static inline int av_toupper(int c)
{
- if (c >= 'a' && c <= 'z')
+ if (c >= 'a' && c <= 'z') {
c ^= 0x20;
+ }
return c;
}
@@ -224,8 +225,9 @@ static inline int av_toupper(int c)
*/
static inline int av_tolower(int c)
{
- if (c >= 'A' && c <= 'Z')
+ if (c >= 'A' && c <= 'Z') {
c ^= 0x20;
+ }
return c;
}
diff --git a/thirdparties/win32/include/libavutil/base64.h b/thirdparties/win32/include/libavutil/base64.h
index 514498e..0f2be64 100755
--- a/thirdparties/win32/include/libavutil/base64.h
+++ b/thirdparties/win32/include/libavutil/base64.h
@@ -60,8 +60,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
- /**
- * @}
- */
+/**
+ * @}
+ */
#endif /* AVUTIL_BASE64_H */
diff --git a/thirdparties/win32/include/libavutil/bprint.h b/thirdparties/win32/include/libavutil/bprint.h
index df78916..6dafdc7 100755
--- a/thirdparties/win32/include/libavutil/bprint.h
+++ b/thirdparties/win32/include/libavutil/bprint.h
@@ -74,12 +74,12 @@
*/
typedef struct AVBPrint {
FF_PAD_STRUCTURE(1024,
- char *str; /** string so far */
- unsigned len; /** length so far */
- unsigned size; /** allocated memory */
- unsigned size_max; /** maximum allocated memory */
- char reserved_internal_buffer[1];
- )
+ char *str; /** string so far */
+ unsigned len; /** length so far */
+ unsigned size; /** allocated memory */
+ unsigned size_max; /** maximum allocated memory */
+ char reserved_internal_buffer[1];
+ )
} AVBPrint;
/**
diff --git a/thirdparties/win32/include/libavutil/common.h b/thirdparties/win32/include/libavutil/common.h
index beaf9f7..ede062e 100755
--- a/thirdparties/win32/include/libavutil/common.h
+++ b/thirdparties/win32/include/libavutil/common.h
@@ -97,11 +97,19 @@ av_const int av_log2_16bit(unsigned v);
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -114,11 +122,19 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -128,8 +144,12 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in
*/
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
- if (a&(~0xFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -139,8 +159,12 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
*/
static av_always_inline av_const int8_t av_clip_int8_c(int a)
{
- if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
- else return a;
+ if ((a+0x80) & ~0xFF) {
+ return (a>>31) ^ 0x7F;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -150,8 +174,12 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
- if (a&(~0xFFFF)) return (-a)>>31;
- else return a;
+ if (a&(~0xFFFF)) {
+ return (-a)>>31;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -161,8 +189,12 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
*/
static av_always_inline av_const int16_t av_clip_int16_c(int a)
{
- if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
- else return a;
+ if ((a+0x8000) & ~0xFFFF) {
+ return (a>>31) ^ 0x7FFF;
+ }
+ else {
+ return a;
+ }
}
/**
@@ -172,8 +204,12 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a)
*/
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
{
- if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
- else return (int32_t)a;
+ if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) {
+ return (a>>63) ^ 0x7FFFFFFF;
+ }
+ else {
+ return (int32_t)a;
+ }
}
/**
@@ -184,8 +220,12 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
- if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
- else return a;
+ if (a & ~((1<<p) - 1)) {
+ return -a >> 31 & ((1<<p) - 1);
+ }
+ else {
+ return a;
+ }
}
/**
@@ -222,11 +262,19 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
{
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
- if (amin > amax) abort();
+ if (amin > amax) {
+ abort();
+ }
#endif
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
+ if (a < amin) {
+ return amin;
+ }
+ else if (a > amax) {
+ return amax;
+ }
+ else {
+ return a;
+ }
}
/** Compute ceil(log2(x)).
@@ -312,7 +360,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
val += (hi<<10) + 0x10000;\
}\
}\
-
+
/**
* @def PUT_UTF8(val, tmp, PUT_BYTE)
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
@@ -376,7 +424,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
PUT_16BIT\
}\
}\
-
+
#include "mem.h"
diff --git a/thirdparties/win32/include/libavutil/cpu.h b/thirdparties/win32/include/libavutil/cpu.h
index c8f34e0..7cb1a50 100755
--- a/thirdparties/win32/include/libavutil/cpu.h
+++ b/thirdparties/win32/include/libavutil/cpu.h
@@ -25,7 +25,7 @@
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
- /* lower 16 bits - CPU features */
+/* lower 16 bits - CPU features */
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
diff --git a/thirdparties/win32/include/libavutil/crc.h b/thirdparties/win32/include/libavutil/crc.h
index 2bdfca8..63e7605 100755
--- a/thirdparties/win32/include/libavutil/crc.h
+++ b/thirdparties/win32/include/libavutil/crc.h
@@ -34,7 +34,7 @@ typedef enum {
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
+} AVCRCId;
/**
* Initialize a CRC table.
diff --git a/thirdparties/win32/include/libavutil/fifo.h b/thirdparties/win32/include/libavutil/fifo.h
index 849b9a6..f56149b 100755
--- a/thirdparties/win32/include/libavutil/fifo.h
+++ b/thirdparties/win32/include/libavutil/fifo.h
@@ -134,10 +134,12 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
{
uint8_t *ptr = f->rptr + offs;
- if (ptr >= f->end)
+ if (ptr >= f->end) {
ptr = f->buffer + (ptr - f->end);
- else if (ptr < f->buffer)
+ }
+ else if (ptr < f->buffer) {
ptr = f->end - (f->buffer - ptr);
+ }
return ptr;
}
diff --git a/thirdparties/win32/include/libavutil/intreadwrite.h b/thirdparties/win32/include/libavutil/intreadwrite.h
index 7ee6977..1d6db92 100755
--- a/thirdparties/win32/include/libavutil/intreadwrite.h
+++ b/thirdparties/win32/include/libavutil/intreadwrite.h
@@ -209,9 +209,15 @@ typedef union {
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+union unaligned_64 {
+ uint64_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_32 {
+ uint32_t l;
+} __attribute__((packed)) av_alias;
+union unaligned_16 {
+ uint16_t l;
+} __attribute__((packed)) av_alias;
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
diff --git a/thirdparties/win32/include/libavutil/lfg.h b/thirdparties/win32/include/libavutil/lfg.h
index ec90562..301d6da 100755
--- a/thirdparties/win32/include/libavutil/lfg.h
+++ b/thirdparties/win32/include/libavutil/lfg.h
@@ -35,7 +35,8 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
* Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case.
*/
-static inline unsigned int av_lfg_get(AVLFG *c){
+static inline unsigned int av_lfg_get(AVLFG *c)
+{
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
return c->state[c->index++ & 63];
}
@@ -45,7 +46,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){
*
* Please also consider av_lfg_get() above, it is faster.
*/
-static inline unsigned int av_mlfg_get(AVLFG *c){
+static inline unsigned int av_mlfg_get(AVLFG *c)
+{
unsigned int a= c->state[(c->index-55) & 63];
unsigned int b= c->state[(c->index-24) & 63];
return c->state[c->index++ & 63] = 2*a*b+a+b;
diff --git a/thirdparties/win32/include/libavutil/log.h b/thirdparties/win32/include/libavutil/log.h
index 7ea95fa..5dc45c1 100755
--- a/thirdparties/win32/include/libavutil/log.h
+++ b/thirdparties/win32/include/libavutil/log.h
@@ -38,7 +38,7 @@ typedef enum {
AV_CLASS_CATEGORY_SWSCALER,
AV_CLASS_CATEGORY_SWRESAMPLER,
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
-}AVClassCategory;
+} AVClassCategory;
struct AVOptionRanges;
diff --git a/thirdparties/win32/include/libavutil/mem.h b/thirdparties/win32/include/libavutil/mem.h
index ced9453..a7b3d9f 100755
--- a/thirdparties/win32/include/libavutil/mem.h
+++ b/thirdparties/win32/include/libavutil/mem.h
@@ -40,36 +40,36 @@
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
#elif defined(__TI_COMPILER_VERSION__)
- #define DECLARE_ALIGNED(n,t,v) \
+#define DECLARE_ALIGNED(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
t __attribute__((aligned(n))) v
- #define DECLARE_ASM_CONST(n,t,v) \
+#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
#elif defined(__GNUC__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
+#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
+#define DECLARE_ALIGNED(n,t,v) t v
+#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
- #define av_malloc_attrib __attribute__((__malloc__))
+#define av_malloc_attrib __attribute__((__malloc__))
#else
- #define av_malloc_attrib
+#define av_malloc_attrib
#endif
#if AV_GCC_VERSION_AT_LEAST(4,3)
- #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
#else
- #define av_alloc_size(...)
+#define av_alloc_size(...)
#endif
/**
@@ -93,8 +93,9 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
*/
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_malloc(nmemb * size);
}
@@ -166,8 +167,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
*/
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (size <= 0 || nmemb >= INT_MAX / size) {
return NULL;
+ }
return av_mallocz(nmemb * size);
}
@@ -206,8 +208,9 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r)
size_t t = a * b;
/* Hack inspired from glibc: only try the division if nelem and elsize
* are both greater than sqrt(SIZE_MAX). */
- if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
+ if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) {
return AVERROR(EINVAL);
+ }
*r = t;
return 0;
}
diff --git a/thirdparties/win32/include/libavutil/old_pix_fmts.h b/thirdparties/win32/include/libavutil/old_pix_fmts.h
index 57b6992..a804f03 100755
--- a/thirdparties/win32/include/libavutil/old_pix_fmts.h
+++ b/thirdparties/win32/include/libavutil/old_pix_fmts.h
@@ -28,144 +28,144 @@
*
* Do not add new items to this list. Use the AVPixelFormat enum instead.
*/
- PIX_FMT_NONE = AV_PIX_FMT_NONE,
- PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
- PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
- PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+PIX_FMT_NONE = AV_PIX_FMT_NONE,
+PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+PIX_FMT_GRAY8, ///< Y , 8bpp
+PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+PIX_FMT_XVMC_MPEG2_IDCT,
+PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
- PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
- PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
- PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
- PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
- PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
- PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
- PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
- PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
- PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
- PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
- PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
- PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
- PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
- PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
- PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
- PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
- PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
- PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
- PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
- PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
- PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
- PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
- PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
+PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
- //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
- //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
- //is better
- PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
+//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
+//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
+//is better
+PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
- PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
- PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
- PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
- PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
- PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
- PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
+PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
+PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
+PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
+PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
+PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
+PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
+PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
#endif
- PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
- PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
- PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
- PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
- PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
- PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
+PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
+PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
+PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
+PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
- PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
- PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
- PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
- PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
+PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
+PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
+PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
+PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
- PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/thirdparties/win32/include/libavutil/opt.h b/thirdparties/win32/include/libavutil/opt.h
index baf1b82..05f6f4b 100755
--- a/thirdparties/win32/include/libavutil/opt.h
+++ b/thirdparties/win32/include/libavutil/opt.h
@@ -217,7 +217,7 @@
* before the file is actually opened.
*/
-enum AVOptionType{
+enum AVOptionType {
AV_OPT_TYPE_FLAGS,
AV_OPT_TYPE_INT,
AV_OPT_TYPE_INT64,
diff --git a/thirdparties/win32/include/libavutil/pixdesc.h b/thirdparties/win32/include/libavutil/pixdesc.h
index ca0722e..4caa15b 100755
--- a/thirdparties/win32/include/libavutil/pixdesc.h
+++ b/thirdparties/win32/include/libavutil/pixdesc.h
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include "pixfmt.h"
-typedef struct AVComponentDescriptor{
+typedef struct AVComponentDescriptor {
uint16_t plane :2; ///< which of the 4 planes contains the component
/**
@@ -41,7 +41,7 @@ typedef struct AVComponentDescriptor{
uint16_t offset_plus1 :3;
uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
-}AVComponentDescriptor;
+} AVComponentDescriptor;
/**
* Descriptor that unambiguously describes how the bits of a pixel are
@@ -52,7 +52,7 @@ typedef struct AVComponentDescriptor{
* and all the YUV variants) AVPixFmtDescriptor just stores how values
* are stored not what these values represent.
*/
-typedef struct AVPixFmtDescriptor{
+typedef struct AVPixFmtDescriptor {
const char *name;
uint8_t nb_components; ///< The number of components each pixel has, (1-4)
@@ -84,7 +84,7 @@ typedef struct AVPixFmtDescriptor{
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
*/
AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
+} AVPixFmtDescriptor;
#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
diff --git a/thirdparties/win32/include/libavutil/rational.h b/thirdparties/win32/include/libavutil/rational.h
index 417e29e..84ce7a0 100755
--- a/thirdparties/win32/include/libavutil/rational.h
+++ b/thirdparties/win32/include/libavutil/rational.h
@@ -40,7 +40,7 @@
/**
* rational number numerator/denominator
*/
-typedef struct AVRational{
+typedef struct AVRational {
int num; ///< numerator
int den; ///< denominator
} AVRational;
@@ -52,13 +52,22 @@ typedef struct AVRational{
* @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
* values is of the form 0/0
*/
-static inline int av_cmp_q(AVRational a, AVRational b){
+static inline int av_cmp_q(AVRational a, AVRational b)
+{
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
- if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
- else if(b.den && a.den) return 0;
- else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
- else return INT_MIN;
+ if(tmp) {
+ return ((tmp ^ a.den ^ b.den)>>63)|1;
+ }
+ else if(b.den && a.den) {
+ return 0;
+ }
+ else if(a.num && b.num) {
+ return (a.num>>31) - (b.num>>31);
+ }
+ else {
+ return INT_MIN;
+ }
}
/**
@@ -66,7 +75,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){
* @param a rational to convert
* @return (double) a
*/
-static inline double av_q2d(AVRational a){
+static inline double av_q2d(AVRational a)
+{
return a.num / (double) a.den;
}
diff --git a/thirdparties/win32/include/libavutil/timestamp.h b/thirdparties/win32/include/libavutil/timestamp.h
index c7348d8..6b46998 100755
--- a/thirdparties/win32/include/libavutil/timestamp.h
+++ b/thirdparties/win32/include/libavutil/timestamp.h
@@ -38,8 +38,12 @@
*/
static inline char *av_ts_make_string(char *buf, int64_t ts)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts);
+ }
return buf;
}
@@ -60,8 +64,12 @@ static inline char *av_ts_make_string(char *buf, int64_t ts)
*/
static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
{
- if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
- else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ if (ts == AV_NOPTS_VALUE) {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
+ }
+ else {
+ snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
+ }
return buf;
}
diff --git a/thirdparties/win32/include/libswresample/swresample.h b/thirdparties/win32/include/libswresample/swresample.h
index 95e8a5a..d7e3027 100755
--- a/thirdparties/win32/include/libswresample/swresample.h
+++ b/thirdparties/win32/include/libswresample/swresample.h
@@ -214,7 +214,7 @@ void swr_free(struct SwrContext **s);
* @return number of samples output per channel, negative value on error
*/
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
- const uint8_t **in , int in_count);
+ const uint8_t **in , int in_count);
/**
* Convert the next timestamp from input to output
diff --git a/thirdparties/win32/include/opencore-amrnb/interf_enc.h b/thirdparties/win32/include/opencore-amrnb/interf_enc.h
index b89b0c7..42b0df4 100755
--- a/thirdparties/win32/include/opencore-amrnb/interf_enc.h
+++ b/thirdparties/win32/include/opencore-amrnb/interf_enc.h
@@ -26,16 +26,16 @@ extern "C" {
#ifndef AMRNB_WRAPPER_INTERNAL
/* Copied from enc/src/gsmamr_enc.h */
enum Mode {
- MR475 = 0,/* 4.75 kbps */
- MR515, /* 5.15 kbps */
- MR59, /* 5.90 kbps */
- MR67, /* 6.70 kbps */
- MR74, /* 7.40 kbps */
- MR795, /* 7.95 kbps */
- MR102, /* 10.2 kbps */
- MR122, /* 12.2 kbps */
- MRDTX, /* DTX */
- N_MODES /* Not Used */
+ MR475 = 0,/* 4.75 kbps */
+ MR515, /* 5.15 kbps */
+ MR59, /* 5.90 kbps */
+ MR67, /* 6.70 kbps */
+ MR74, /* 7.40 kbps */
+ MR795, /* 7.95 kbps */
+ MR102, /* 10.2 kbps */
+ MR122, /* 12.2 kbps */
+ MRDTX, /* DTX */
+ N_MODES /* Not Used */
};
#endif
diff --git a/thirdparties/win32/include/pthread/implement.h b/thirdparties/win32/include/pthread/implement.h
index 3d96483..8506db3 100755
--- a/thirdparties/win32/include/pthread/implement.h
+++ b/thirdparties/win32/include/pthread/implement.h
@@ -10,25 +10,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -98,78 +98,75 @@ typedef VOID (APIENTRY *PAPCFUNC)(DWORD dwParam);
#define int64_t _int64
#endif
-typedef enum
-{
- /*
- * This enumeration represents the state of the thread;
- * The thread is still "alive" if the numeric value of the
- * state is greater or equal "PThreadStateRunning".
- */
- PThreadStateInitial = 0, /* Thread not running */
- PThreadStateRunning, /* Thread alive & kicking */
- PThreadStateSuspended, /* Thread alive but suspended */
- PThreadStateCancelPending, /* Thread alive but is */
- /* has cancelation pending. */
- PThreadStateCanceling, /* Thread alive but is */
- /* in the process of terminating */
- /* due to a cancellation request */
- PThreadStateException, /* Thread alive but exiting */
- /* due to an exception */
- PThreadStateLast
+typedef enum {
+ /*
+ * This enumeration represents the state of the thread;
+ * The thread is still "alive" if the numeric value of the
+ * state is greater or equal "PThreadStateRunning".
+ */
+ PThreadStateInitial = 0, /* Thread not running */
+ PThreadStateRunning, /* Thread alive & kicking */
+ PThreadStateSuspended, /* Thread alive but suspended */
+ PThreadStateCancelPending, /* Thread alive but is */
+ /* has cancelation pending. */
+ PThreadStateCanceling, /* Thread alive but is */
+ /* in the process of terminating */
+ /* due to a cancellation request */
+ PThreadStateException, /* Thread alive but exiting */
+ /* due to an exception */
+ PThreadStateLast
}
PThreadState;
typedef struct ptw32_thread_t_ ptw32_thread_t;
-struct ptw32_thread_t_
-{
+struct ptw32_thread_t_ {
#ifdef _UWIN
- DWORD dummy[5];
+ DWORD dummy[5];
#endif
- DWORD thread;
- HANDLE threadH; /* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
- pthread_t ptHandle; /* This thread's permanent pthread_t handle */
- ptw32_thread_t * prevReuse; /* Links threads on reuse stack */
- volatile PThreadState state;
- void *exitStatus;
- void *parms;
- int ptErrno;
- int detachState;
- pthread_mutex_t threadLock; /* Used for serialised access to public thread state */
- int sched_priority; /* As set, not as currently is */
- pthread_mutex_t cancelLock; /* Used for async-cancel safety */
- int cancelState;
- int cancelType;
- HANDLE cancelEvent;
+ DWORD thread;
+ HANDLE threadH; /* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
+ pthread_t ptHandle; /* This thread's permanent pthread_t handle */
+ ptw32_thread_t * prevReuse; /* Links threads on reuse stack */
+ volatile PThreadState state;
+ void *exitStatus;
+ void *parms;
+ int ptErrno;
+ int detachState;
+ pthread_mutex_t threadLock; /* Used for serialised access to public thread state */
+ int sched_priority; /* As set, not as currently is */
+ pthread_mutex_t cancelLock; /* Used for async-cancel safety */
+ int cancelState;
+ int cancelType;
+ HANDLE cancelEvent;
#ifdef __CLEANUP_C
- jmp_buf start_mark;
+ jmp_buf start_mark;
#endif /* __CLEANUP_C */
#if HAVE_SIGSET_T
- sigset_t sigmask;
+ sigset_t sigmask;
#endif /* HAVE_SIGSET_T */
- int implicit:1;
- void *keys;
- void *nextAssoc;
+ int implicit:1;
+ void *keys;
+ void *nextAssoc;
};
-/*
+/*
* Special value to mark attribute objects as valid.
*/
#define PTW32_ATTR_VALID ((unsigned long) 0xC4C0FFEE)
-struct pthread_attr_t_
-{
- unsigned long valid;
- void *stackaddr;
- size_t stacksize;
- int detachstate;
- struct sched_param param;
- int inheritsched;
- int contentionscope;
+struct pthread_attr_t_ {
+ unsigned long valid;
+ void *stackaddr;
+ size_t stacksize;
+ int detachstate;
+ struct sched_param param;
+ int inheritsched;
+ int contentionscope;
#if HAVE_SIGSET_T
- sigset_t sigmask;
+ sigset_t sigmask;
#endif /* HAVE_SIGSET_T */
};
@@ -182,40 +179,37 @@ struct pthread_attr_t_
* ====================
*/
-struct sem_t_
-{
- int value;
- pthread_mutex_t lock;
- HANDLE sem;
+struct sem_t_ {
+ int value;
+ pthread_mutex_t lock;
+ HANDLE sem;
#ifdef NEED_SEM
- int leftToUnblock;
+ int leftToUnblock;
#endif
};
#define PTW32_OBJECT_AUTO_INIT ((void *) -1)
#define PTW32_OBJECT_INVALID NULL
-struct pthread_mutex_t_
-{
- LONG lock_idx; /* Provides exclusive access to mutex state
+struct pthread_mutex_t_ {
+ LONG lock_idx; /* Provides exclusive access to mutex state
via the Interlocked* mechanism.
0: unlocked/free.
1: locked - no other waiters.
-1: locked - with possible other waiters.
*/
- int recursive_count; /* Number of unlocks a thread needs to perform
+ int recursive_count; /* Number of unlocks a thread needs to perform
before the lock is released (recursive
mutexes only). */
- int kind; /* Mutex type. */
- pthread_t ownerThread;
- HANDLE event; /* Mutex release notification to waiting
+ int kind; /* Mutex type. */
+ pthread_t ownerThread;
+ HANDLE event; /* Mutex release notification to waiting
threads. */
};
-struct pthread_mutexattr_t_
-{
- int pshared;
- int kind;
+struct pthread_mutexattr_t_ {
+ int pshared;
+ int kind;
};
/*
@@ -239,101 +233,90 @@ struct pthread_mutexattr_t_
#define PTW32_SPIN_LOCKED (2)
#define PTW32_SPIN_USE_MUTEX (3)
-struct pthread_spinlock_t_
-{
- long interlock; /* Locking element for multi-cpus. */
- union
- {
- int cpus; /* No. of cpus if multi cpus, or */
- pthread_mutex_t mutex; /* mutex if single cpu. */
- } u;
+struct pthread_spinlock_t_ {
+ long interlock; /* Locking element for multi-cpus. */
+ union {
+ int cpus; /* No. of cpus if multi cpus, or */
+ pthread_mutex_t mutex; /* mutex if single cpu. */
+ } u;
};
-struct pthread_barrier_t_
-{
- unsigned int nCurrentBarrierHeight;
- unsigned int nInitialBarrierHeight;
- int iStep;
- int pshared;
- sem_t semBarrierBreeched[2];
+struct pthread_barrier_t_ {
+ unsigned int nCurrentBarrierHeight;
+ unsigned int nInitialBarrierHeight;
+ int iStep;
+ int pshared;
+ sem_t semBarrierBreeched[2];
};
-struct pthread_barrierattr_t_
-{
- int pshared;
+struct pthread_barrierattr_t_ {
+ int pshared;
};
-struct pthread_key_t_
-{
- DWORD key;
- void (*destructor) (void *);
- pthread_mutex_t keyLock;
- void *threads;
+struct pthread_key_t_ {
+ DWORD key;
+ void (*destructor) (void *);
+ pthread_mutex_t keyLock;
+ void *threads;
};
typedef struct ThreadParms ThreadParms;
typedef struct ThreadKeyAssoc ThreadKeyAssoc;
-struct ThreadParms
-{
- pthread_t tid;
- void *(*start) (void *);
- void *arg;
+struct ThreadParms {
+ pthread_t tid;
+ void *(*start) (void *);
+ void *arg;
};
-struct pthread_cond_t_
-{
- long nWaitersBlocked; /* Number of threads blocked */
- long nWaitersGone; /* Number of threads timed out */
- long nWaitersToUnblock; /* Number of threads to unblock */
- sem_t semBlockQueue; /* Queue up threads waiting for the */
- /* condition to become signalled */
- sem_t semBlockLock; /* Semaphore that guards access to */
- /* | waiters blocked count/block queue */
- /* +-> Mandatory Sync.LEVEL-1 */
- pthread_mutex_t mtxUnblockLock; /* Mutex that guards access to */
- /* | waiters (to)unblock(ed) counts */
- /* +-> Optional* Sync.LEVEL-2 */
- pthread_cond_t next; /* Doubly linked list */
- pthread_cond_t prev;
+struct pthread_cond_t_ {
+ long nWaitersBlocked; /* Number of threads blocked */
+ long nWaitersGone; /* Number of threads timed out */
+ long nWaitersToUnblock; /* Number of threads to unblock */
+ sem_t semBlockQueue; /* Queue up threads waiting for the */
+ /* condition to become signalled */
+ sem_t semBlockLock; /* Semaphore that guards access to */
+ /* | waiters blocked count/block queue */
+ /* +-> Mandatory Sync.LEVEL-1 */
+ pthread_mutex_t mtxUnblockLock; /* Mutex that guards access to */
+ /* | waiters (to)unblock(ed) counts */
+ /* +-> Optional* Sync.LEVEL-2 */
+ pthread_cond_t next; /* Doubly linked list */
+ pthread_cond_t prev;
};
-struct pthread_condattr_t_
-{
- int pshared;
+struct pthread_condattr_t_ {
+ int pshared;
};
#define PTW32_RWLOCK_MAGIC 0xfacade2
-struct pthread_rwlock_t_
-{
- pthread_mutex_t mtxExclusiveAccess;
- pthread_mutex_t mtxSharedAccessCompleted;
- pthread_cond_t cndSharedAccessCompleted;
- int nSharedAccessCount;
- int nExclusiveAccessCount;
- int nCompletedSharedAccessCount;
- int nMagic;
+struct pthread_rwlock_t_ {
+ pthread_mutex_t mtxExclusiveAccess;
+ pthread_mutex_t mtxSharedAccessCompleted;
+ pthread_cond_t cndSharedAccessCompleted;
+ int nSharedAccessCount;
+ int nExclusiveAccessCount;
+ int nCompletedSharedAccessCount;
+ int nMagic;
};
-struct pthread_rwlockattr_t_
-{
- int pshared;
+struct pthread_rwlockattr_t_ {
+ int pshared;
};
/*
* MCS lock queue node - see ptw32_MCS_lock.c
*/
-struct ptw32_mcs_node_t_
-{
- struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */
- struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */
- LONG readyFlag; /* set after lock is released by
+struct ptw32_mcs_node_t_ {
+ struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */
+ struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */
+ LONG readyFlag; /* set after lock is released by
predecessor */
- LONG nextFlag; /* set after 'next' ptr is set by
+ LONG nextFlag; /* set after 'next' ptr is set by
successor */
};
@@ -341,112 +324,111 @@ typedef struct ptw32_mcs_node_t_ ptw32_mcs_local_node_t;
typedef struct ptw32_mcs_node_t_ *ptw32_mcs_lock_t;
-struct ThreadKeyAssoc
-{
- /*
- * Purpose:
- * This structure creates an association between a thread and a key.
- * It is used to implement the implicit invocation of a user defined
- * destroy routine for thread specific data registered by a user upon
- * exiting a thread.
- *
- * Graphically, the arrangement is as follows, where:
- *
- * K - Key with destructor
- * (head of chain is key->threads)
- * T - Thread that has called pthread_setspecific(Kn)
- * (head of chain is thread->keys)
- * A - Association. Each association is a node at the
- * intersection of two doubly-linked lists.
- *
- * T1 T2 T3
- * | | |
- * | | |
- * K1 -----+-----A-----A----->
- * | | |
- * | | |
- * K2 -----A-----A-----+----->
- * | | |
- * | | |
- * K3 -----A-----+-----A----->
- * | | |
- * | | |
- * V V V
- *
- * Access to the association is guarded by two locks: the key's
- * general lock (guarding the row) and the thread's general
- * lock (guarding the column). This avoids the need for a
- * dedicated lock for each association, which not only consumes
- * more handles but requires that: before the lock handle can
- * be released - both the key must be deleted and the thread
- * must have called the destructor. The two-lock arrangement
- * allows the resources to be freed as soon as either thread or
- * key is concluded.
- *
- * To avoid deadlock: whenever both locks are required, the key
- * and thread locks are always acquired in the order: key lock
- * then thread lock. An exception to this exists when a thread
- * calls the destructors, however this is done carefully to
- * avoid deadlock.
- *
- * An association is created when a thread first calls
- * pthread_setspecific() on a key that has a specified
- * destructor.
- *
- * An association is destroyed either immediately after the
- * thread calls the key destructor function on thread exit, or
- * when the key is deleted.
- *
- * Attributes:
- * thread
- * reference to the thread that owns the
- * association. This is actually the pointer to the
- * thread struct itself. Since the association is
- * destroyed before the thread exits, this can never
- * point to a different logical thread to the one that
- * created the assoc, i.e. after thread struct reuse.
- *
- * key
- * reference to the key that owns the association.
- *
- * nextKey
- * The pthread_t->keys attribute is the head of a
- * chain of associations that runs through the nextKey
- * link. This chain provides the 1 to many relationship
- * between a pthread_t and all pthread_key_t on which
- * it called pthread_setspecific.
- *
- * prevKey
- * Similarly.
- *
- * nextThread
- * The pthread_key_t->threads attribute is the head of
- * a chain of assoctiations that runs through the
- * nextThreads link. This chain provides the 1 to many
- * relationship between a pthread_key_t and all the
- * PThreads that have called pthread_setspecific for
- * this pthread_key_t.
- *
- * prevThread
- * Similarly.
- *
- * Notes:
- * 1) As soon as either the key or the thread is no longer
- * referencing the association, it can be destroyed. The
- * association will be removed from both chains.
- *
- * 2) Under WIN32, an association is only created by
- * pthread_setspecific if the user provided a
- * destroyRoutine when they created the key.
- *
- *
- */
- ptw32_thread_t * thread;
- pthread_key_t key;
- ThreadKeyAssoc *nextKey;
- ThreadKeyAssoc *nextThread;
- ThreadKeyAssoc *prevKey;
- ThreadKeyAssoc *prevThread;
+struct ThreadKeyAssoc {
+ /*
+ * Purpose:
+ * This structure creates an association between a thread and a key.
+ * It is used to implement the implicit invocation of a user defined
+ * destroy routine for thread specific data registered by a user upon
+ * exiting a thread.
+ *
+ * Graphically, the arrangement is as follows, where:
+ *
+ * K - Key with destructor
+ * (head of chain is key->threads)
+ * T - Thread that has called pthread_setspecific(Kn)
+ * (head of chain is thread->keys)
+ * A - Association. Each association is a node at the
+ * intersection of two doubly-linked lists.
+ *
+ * T1 T2 T3
+ * | | |
+ * | | |
+ * K1 -----+-----A-----A----->
+ * | | |
+ * | | |
+ * K2 -----A-----A-----+----->
+ * | | |
+ * | | |
+ * K3 -----A-----+-----A----->
+ * | | |
+ * | | |
+ * V V V
+ *
+ * Access to the association is guarded by two locks: the key's
+ * general lock (guarding the row) and the thread's general
+ * lock (guarding the column). This avoids the need for a
+ * dedicated lock for each association, which not only consumes
+ * more handles but requires that: before the lock handle can
+ * be released - both the key must be deleted and the thread
+ * must have called the destructor. The two-lock arrangement
+ * allows the resources to be freed as soon as either thread or
+ * key is concluded.
+ *
+ * To avoid deadlock: whenever both locks are required, the key
+ * and thread locks are always acquired in the order: key lock
+ * then thread lock. An exception to this exists when a thread
+ * calls the destructors, however this is done carefully to
+ * avoid deadlock.
+ *
+ * An association is created when a thread first calls
+ * pthread_setspecific() on a key that has a specified
+ * destructor.
+ *
+ * An association is destroyed either immediately after the
+ * thread calls the key destructor function on thread exit, or
+ * when the key is deleted.
+ *
+ * Attributes:
+ * thread
+ * reference to the thread that owns the
+ * association. This is actually the pointer to the
+ * thread struct itself. Since the association is
+ * destroyed before the thread exits, this can never
+ * point to a different logical thread to the one that
+ * created the assoc, i.e. after thread struct reuse.
+ *
+ * key
+ * reference to the key that owns the association.
+ *
+ * nextKey
+ * The pthread_t->keys attribute is the head of a
+ * chain of associations that runs through the nextKey
+ * link. This chain provides the 1 to many relationship
+ * between a pthread_t and all pthread_key_t on which
+ * it called pthread_setspecific.
+ *
+ * prevKey
+ * Similarly.
+ *
+ * nextThread
+ * The pthread_key_t->threads attribute is the head of
+ * a chain of assoctiations that runs through the
+ * nextThreads link. This chain provides the 1 to many
+ * relationship between a pthread_key_t and all the
+ * PThreads that have called pthread_setspecific for
+ * this pthread_key_t.
+ *
+ * prevThread
+ * Similarly.
+ *
+ * Notes:
+ * 1) As soon as either the key or the thread is no longer
+ * referencing the association, it can be destroyed. The
+ * association will be removed from both chains.
+ *
+ * 2) Under WIN32, an association is only created by
+ * pthread_setspecific if the user provided a
+ * destroyRoutine when they created the key.
+ *
+ *
+ */
+ ptw32_thread_t * thread;
+ pthread_key_t key;
+ ThreadKeyAssoc *nextKey;
+ ThreadKeyAssoc *nextThread;
+ ThreadKeyAssoc *prevKey;
+ ThreadKeyAssoc *prevThread;
};
@@ -512,8 +494,8 @@ struct ThreadKeyAssoc
/* Declared in global.c */
extern PTW32_INTERLOCKED_LONG (WINAPI *
- ptw32_interlocked_compare_exchange)
- (PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG);
+ ptw32_interlocked_compare_exchange)
+(PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG);
/* Declared in pthread_cancel.c */
extern DWORD (*ptw32_register_cancelation) (PAPCFUNC, HANDLE, DWORD);
@@ -561,79 +543,79 @@ extern "C"
* =====================
*/
- int ptw32_is_attr (const pthread_attr_t * attr);
+int ptw32_is_attr (const pthread_attr_t * attr);
- int ptw32_cond_check_need_init (pthread_cond_t * cond);
- int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
- int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
+int ptw32_cond_check_need_init (pthread_cond_t * cond);
+int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
+int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
- PTW32_INTERLOCKED_LONG WINAPI
- ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
- PTW32_INTERLOCKED_LONG value,
- PTW32_INTERLOCKED_LONG comparand);
+PTW32_INTERLOCKED_LONG WINAPI
+ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
+ PTW32_INTERLOCKED_LONG value,
+ PTW32_INTERLOCKED_LONG comparand);
- LONG WINAPI
- ptw32_InterlockedExchange (LPLONG location,
- LONG value);
+LONG WINAPI
+ptw32_InterlockedExchange (LPLONG location,
+ LONG value);
- DWORD
- ptw32_RegisterCancelation (PAPCFUNC callback,
- HANDLE threadH, DWORD callback_arg);
+DWORD
+ptw32_RegisterCancelation (PAPCFUNC callback,
+ HANDLE threadH, DWORD callback_arg);
- int ptw32_processInitialize (void);
+int ptw32_processInitialize (void);
- void ptw32_processTerminate (void);
+void ptw32_processTerminate (void);
- void ptw32_threadDestroy (pthread_t tid);
+void ptw32_threadDestroy (pthread_t tid);
- void ptw32_pop_cleanup_all (int execute);
+void ptw32_pop_cleanup_all (int execute);
- pthread_t ptw32_new (void);
+pthread_t ptw32_new (void);
- pthread_t ptw32_threadReusePop (void);
+pthread_t ptw32_threadReusePop (void);
- void ptw32_threadReusePush (pthread_t thread);
+void ptw32_threadReusePush (pthread_t thread);
- int ptw32_getprocessors (int *count);
+int ptw32_getprocessors (int *count);
- int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
+int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
- void ptw32_rwlock_cancelwrwait (void *arg);
+void ptw32_rwlock_cancelwrwait (void *arg);
#if ! defined (__MINGW32__) || defined (__MSVCRT__)
- unsigned __stdcall
+unsigned __stdcall
#else
- void
+void
#endif
- ptw32_threadStart (void *vthreadParms);
+ptw32_threadStart (void *vthreadParms);
- void ptw32_callUserDestroyRoutines (pthread_t thread);
+void ptw32_callUserDestroyRoutines (pthread_t thread);
- int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
+int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
- void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
+void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
- int ptw32_semwait (sem_t * sem);
+int ptw32_semwait (sem_t * sem);
- DWORD ptw32_relmillisecs (const struct timespec * abstime);
+DWORD ptw32_relmillisecs (const struct timespec * abstime);
- void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
+void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
- void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node);
+void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node);
#ifdef NEED_FTIME
- void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft);
- void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts);
+void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft);
+void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts);
#endif
/* Declared in misc.c */
#ifdef NEED_CALLOC
#define calloc(n, s) ptw32_calloc(n, s)
- void *ptw32_calloc (size_t n, size_t s);
+void *ptw32_calloc (size_t n, size_t s);
#endif
/* Declared in private.c */
- void ptw32_throw (DWORD exception);
+void ptw32_throw (DWORD exception);
#ifdef __cplusplus
}
@@ -646,13 +628,13 @@ extern "C"
extern "C"
{
# endif
- _CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
- unsigned, void *);
- _CRTIMP void __cdecl _endthread (void);
- _CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
- unsigned (__stdcall *) (void *),
- void *, unsigned, unsigned *);
- _CRTIMP void __cdecl _endthreadex (unsigned);
+_CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
+ unsigned, void *);
+_CRTIMP void __cdecl _endthread (void);
+_CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
+ unsigned (__stdcall *) (void *),
+ void *, unsigned, unsigned *);
+_CRTIMP void __cdecl _endthreadex (unsigned);
# ifdef __cplusplus
}
# endif
@@ -684,7 +666,7 @@ extern "C"
*/
#if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(NEED_CREATETHREAD)
-/*
+/*
* Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
* in order to avoid warnings because of return type
*/
diff --git a/thirdparties/win32/include/pthread/pthread.h b/thirdparties/win32/include/pthread/pthread.h
index a1f9aa1..1b061b6 100755
--- a/thirdparties/win32/include/pthread/pthread.h
+++ b/thirdparties/win32/include/pthread/pthread.h
@@ -5,25 +5,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -231,8 +231,8 @@ typedef unsigned long DWORD_PTR;
* Boolean values to make us independent of system includes.
*/
enum {
- PTW32_FALSE = 0,
- PTW32_TRUE = (! PTW32_FALSE)
+ PTW32_FALSE = 0,
+ PTW32_TRUE = (! PTW32_FALSE)
};
/*
@@ -305,8 +305,8 @@ enum {
#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1
struct timespec {
- long tv_sec;
- long tv_nsec;
+ long tv_sec;
+ long tv_nsec;
};
#endif /* HAVE_STRUCT_TIMESPEC */
@@ -314,7 +314,7 @@ struct timespec {
#define SIG_BLOCK 0
#endif /* SIG_BLOCK */
-#ifndef SIG_UNBLOCK
+#ifndef SIG_UNBLOCK
#define SIG_UNBLOCK 1
#endif /* SIG_UNBLOCK */
@@ -505,14 +505,14 @@ extern "C"
#undef _POSIX_THREAD_THREADS_MAX
#define _POSIX_THREAD_THREADS_MAX 64
- /* Arbitrary value */
+/* Arbitrary value */
#undef PTHREAD_THREADS_MAX
#define PTHREAD_THREADS_MAX 2019
#undef _POSIX_SEM_NSEMS_MAX
#define _POSIX_SEM_NSEMS_MAX 256
- /* Arbitrary value */
+/* Arbitrary value */
#undef SEM_NSEMS_MAX
#define SEM_NSEMS_MAX 1024
@@ -592,47 +592,47 @@ typedef struct pthread_barrierattr_t_ * pthread_barrierattr_t;
*/
enum {
-/*
- * pthread_attr_{get,set}detachstate
- */
- PTHREAD_CREATE_JOINABLE = 0, /* Default */
- PTHREAD_CREATE_DETACHED = 1,
-
-/*
- * pthread_attr_{get,set}inheritsched
- */
- PTHREAD_INHERIT_SCHED = 0,
- PTHREAD_EXPLICIT_SCHED = 1, /* Default */
-
-/*
- * pthread_{get,set}scope
- */
- PTHREAD_SCOPE_PROCESS = 0,
- PTHREAD_SCOPE_SYSTEM = 1, /* Default */
-
-/*
- * pthread_setcancelstate paramters
- */
- PTHREAD_CANCEL_ENABLE = 0, /* Default */
- PTHREAD_CANCEL_DISABLE = 1,
-
-/*
- * pthread_setcanceltype parameters
- */
- PTHREAD_CANCEL_ASYNCHRONOUS = 0,
- PTHREAD_CANCEL_DEFERRED = 1, /* Default */
-
-/*
- * pthread_mutexattr_{get,set}pshared
- * pthread_condattr_{get,set}pshared
- */
- PTHREAD_PROCESS_PRIVATE = 0,
- PTHREAD_PROCESS_SHARED = 1,
-
-/*
- * pthread_barrier_wait
- */
- PTHREAD_BARRIER_SERIAL_THREAD = -1
+ /*
+ * pthread_attr_{get,set}detachstate
+ */
+ PTHREAD_CREATE_JOINABLE = 0, /* Default */
+ PTHREAD_CREATE_DETACHED = 1,
+
+ /*
+ * pthread_attr_{get,set}inheritsched
+ */
+ PTHREAD_INHERIT_SCHED = 0,
+ PTHREAD_EXPLICIT_SCHED = 1, /* Default */
+
+ /*
+ * pthread_{get,set}scope
+ */
+ PTHREAD_SCOPE_PROCESS = 0,
+ PTHREAD_SCOPE_SYSTEM = 1, /* Default */
+
+ /*
+ * pthread_setcancelstate paramters
+ */
+ PTHREAD_CANCEL_ENABLE = 0, /* Default */
+ PTHREAD_CANCEL_DISABLE = 1,
+
+ /*
+ * pthread_setcanceltype parameters
+ */
+ PTHREAD_CANCEL_ASYNCHRONOUS = 0,
+ PTHREAD_CANCEL_DEFERRED = 1, /* Default */
+
+ /*
+ * pthread_mutexattr_{get,set}pshared
+ * pthread_condattr_{get,set}pshared
+ */
+ PTHREAD_PROCESS_PRIVATE = 0,
+ PTHREAD_PROCESS_SHARED = 1,
+
+ /*
+ * pthread_barrier_wait
+ */
+ PTHREAD_BARRIER_SERIAL_THREAD = -1
};
/*
@@ -654,12 +654,11 @@ enum {
*/
#define PTHREAD_ONCE_INIT { PTW32_FALSE, 0, 0, 0}
-struct pthread_once_t_
-{
- int done; /* indicates if user function has been executed */
- void * lock;
- int reserved1;
- int reserved2;
+struct pthread_once_t_ {
+ int done; /* indicates if user function has been executed */
+ void * lock;
+ int reserved1;
+ int reserved2;
};
@@ -690,19 +689,18 @@ struct pthread_once_t_
/*
* Mutex types.
*/
-enum
-{
- /* Compatibility with LinuxThreads */
- PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP,
- /* For compatibility with POSIX */
- PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+enum {
+ /* Compatibility with LinuxThreads */
+ PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP,
+ /* For compatibility with POSIX */
+ PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
};
@@ -719,17 +717,16 @@ typedef void (* PTW32_CDECL ptw32_cleanup_callback_t)(void *);
#pragma warning( default : 4229 )
#endif
-struct ptw32_cleanup_t
-{
- ptw32_cleanup_callback_t routine;
- void *arg;
- struct ptw32_cleanup_t *prev;
+struct ptw32_cleanup_t {
+ ptw32_cleanup_callback_t routine;
+ void *arg;
+ struct ptw32_cleanup_t *prev;
};
#ifdef __CLEANUP_SEH
- /*
- * WIN32 SEH version of cancel cleanup.
- */
+/*
+ * WIN32 SEH version of cancel cleanup.
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
@@ -739,7 +736,7 @@ struct ptw32_cleanup_t
_cleanup.arg = (_arg); \
__try \
{ \
-
+
#define pthread_cleanup_pop( _execute ) \
} \
__finally \
@@ -755,16 +752,16 @@ struct ptw32_cleanup_t
#ifdef __CLEANUP_C
- /*
- * C implementation of PThreads cancel cleanup
- */
+/*
+ * C implementation of PThreads cancel cleanup
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
ptw32_cleanup_t _cleanup; \
\
ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \
-
+
#define pthread_cleanup_pop( _execute ) \
(void) ptw32_pop_cleanup( _execute ); \
}
@@ -773,71 +770,69 @@ struct ptw32_cleanup_t
#ifdef __CLEANUP_CXX
- /*
- * C++ version of cancel cleanup.
- * - John E. Bossom.
- */
-
- class PThreadCleanup {
- /*
- * PThreadCleanup
- *
- * Purpose
- * This class is a C++ helper class that is
- * used to implement pthread_cleanup_push/
- * pthread_cleanup_pop.
- * The destructor of this class automatically
- * pops the pushed cleanup routine regardless
- * of how the code exits the scope
- * (i.e. such as by an exception)
- */
- ptw32_cleanup_callback_t cleanUpRout;
- void * obj;
- int executeIt;
-
- public:
- PThreadCleanup() :
- cleanUpRout( 0 ),
- obj( 0 ),
- executeIt( 0 )
- /*
- * No cleanup performed
- */
- {
- }
-
- PThreadCleanup(
- ptw32_cleanup_callback_t routine,
- void * arg ) :
- cleanUpRout( routine ),
- obj( arg ),
- executeIt( 1 )
- /*
- * Registers a cleanup routine for 'arg'
- */
- {
- }
-
- ~PThreadCleanup()
- {
- if ( executeIt && ((void *) cleanUpRout != (void *) 0) )
- {
- (void) (*cleanUpRout)( obj );
- }
- }
-
- void execute( int exec )
- {
- executeIt = exec;
- }
- };
-
- /*
- * C++ implementation of PThreads cancel cleanup;
- * This implementation takes advantage of a helper
- * class who's destructor automatically calls the
- * cleanup routine if we exit our scope weirdly
- */
+/*
+ * C++ version of cancel cleanup.
+ * - John E. Bossom.
+ */
+
+class PThreadCleanup
+{
+ /*
+ * PThreadCleanup
+ *
+ * Purpose
+ * This class is a C++ helper class that is
+ * used to implement pthread_cleanup_push/
+ * pthread_cleanup_pop.
+ * The destructor of this class automatically
+ * pops the pushed cleanup routine regardless
+ * of how the code exits the scope
+ * (i.e. such as by an exception)
+ */
+ ptw32_cleanup_callback_t cleanUpRout;
+ void * obj;
+ int executeIt;
+
+public:
+ PThreadCleanup() :
+ cleanUpRout( 0 ),
+ obj( 0 ),
+ executeIt( 0 )
+/*
+ * No cleanup performed
+ */
+ {
+ }
+
+ PThreadCleanup(
+ ptw32_cleanup_callback_t routine,
+ void * arg ) :
+ cleanUpRout( routine ),
+ obj( arg ),
+ executeIt( 1 )
+/*
+ * Registers a cleanup routine for 'arg'
+ */
+ {
+ }
+
+ ~PThreadCleanup() {
+ if ( executeIt && ((void *) cleanUpRout != (void *) 0) ) {
+ (void) (*cleanUpRout)( obj );
+ }
+ }
+
+ void execute( int exec ) {
+ executeIt = exec;
+ }
+};
+
+/*
+ * C++ implementation of PThreads cancel cleanup;
+ * This implementation takes advantage of a helper
+ * class who's destructor automatically calls the
+ * cleanup routine if we exit our scope weirdly
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \
@@ -873,98 +868,98 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_init (pthread_attr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_destroy (pthread_attr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getdetachstate (const pthread_attr_t * attr,
- int *detachstate);
+ int *detachstate);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstackaddr (const pthread_attr_t * attr,
- void **stackaddr);
+ void **stackaddr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstacksize (const pthread_attr_t * attr,
- size_t * stacksize);
+ size_t * stacksize);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setdetachstate (pthread_attr_t * attr,
- int detachstate);
+ int detachstate);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstackaddr (pthread_attr_t * attr,
- void *stackaddr);
+ void *stackaddr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstacksize (pthread_attr_t * attr,
- size_t stacksize);
+ size_t stacksize);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedparam (const pthread_attr_t *attr,
- struct sched_param *param);
+ struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
- const struct sched_param *param);
+ const struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
- int);
+ int);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (pthread_attr_t *,
- int *);
+ int *);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr,
- int inheritsched);
+ int inheritsched);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(pthread_attr_t * attr,
- int * inheritsched);
+ int * inheritsched);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setscope (pthread_attr_t *,
- int);
+ int);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
- int *);
+ int *);
/*
* PThread Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid,
- const pthread_attr_t * attr,
- void *(*start) (void *),
- void *arg);
+ const pthread_attr_t * attr,
+ void *(*start) (void *),
+ void *arg);
PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid);
PTW32_DLLPORT int PTW32_CDECL pthread_equal (pthread_t t1,
- pthread_t t2);
+ pthread_t t2);
PTW32_DLLPORT void PTW32_CDECL pthread_exit (void *value_ptr);
PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread,
- void **value_ptr);
+ void **value_ptr);
PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void);
PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread);
PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state,
- int *oldstate);
+ int *oldstate);
PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type,
- int *oldtype);
+ int *oldtype);
PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void);
PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
- void (*init_routine) (void));
+ void (*init_routine) (void));
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);
PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
- void (*routine) (void *),
- void *arg);
+ void (*routine) (void *),
+ void *arg);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
/*
* Thread Specific Data Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key,
- void (*destructor) (void *));
+ void (*destructor) (void *));
PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key);
PTW32_DLLPORT int PTW32_CDECL pthread_setspecific (pthread_key_t key,
- const void *value);
+ const void *value);
PTW32_DLLPORT void * PTW32_CDECL pthread_getspecific (pthread_key_t key);
@@ -977,11 +972,11 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_init (pthread_mutexattr_t * attr
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_destroy (pthread_mutexattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getpshared (const pthread_mutexattr_t
- * attr,
- int *pshared);
+ * attr,
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t * attr,
- int pshared);
+ int pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind);
@@ -994,24 +989,24 @@ PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_init (pthread_barrierattr_t *
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_destroy (pthread_barrierattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_getpshared (const pthread_barrierattr_t
- * attr,
- int *pshared);
+ * attr,
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_setpshared (pthread_barrierattr_t * attr,
- int pshared);
+ int pshared);
/*
* Mutex Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex,
- const pthread_mutexattr_t * attr);
+ const pthread_mutexattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t *mutex,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex);
@@ -1034,8 +1029,8 @@ PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock);
* Barrier Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_init (pthread_barrier_t * barrier,
- const pthread_barrierattr_t * attr,
- unsigned int count);
+ const pthread_barrierattr_t * attr,
+ unsigned int count);
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barrier);
@@ -1049,25 +1044,25 @@ PTW32_DLLPORT int PTW32_CDECL pthread_condattr_init (pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_destroy (pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_getpshared (const pthread_condattr_t * attr,
- int *pshared);
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * attr,
- int pshared);
+ int pshared);
/*
* Condition Variable Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_cond_init (pthread_cond_t * cond,
- const pthread_condattr_t * attr);
+ const pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_destroy (pthread_cond_t * cond);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_wait (pthread_cond_t * cond,
- pthread_mutex_t * mutex);
+ pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond,
- pthread_mutex_t * mutex,
- const struct timespec *abstime);
+ pthread_mutex_t * mutex,
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_signal (pthread_cond_t * cond);
@@ -1077,22 +1072,22 @@ PTW32_DLLPORT int PTW32_CDECL pthread_cond_broadcast (pthread_cond_t * cond);
* Scheduling
*/
PTW32_DLLPORT int PTW32_CDECL pthread_setschedparam (pthread_t thread,
- int policy,
- const struct sched_param *param);
+ int policy,
+ const struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_getschedparam (pthread_t thread,
- int *policy,
- struct sched_param *param);
+ int *policy,
+ struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_setconcurrency (int);
-
+
PTW32_DLLPORT int PTW32_CDECL pthread_getconcurrency (void);
/*
* Read-Write Lock Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_init(pthread_rwlock_t *lock,
- const pthread_rwlockattr_t *attr);
+ const pthread_rwlockattr_t *attr);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_destroy(pthread_rwlock_t *lock);
@@ -1103,12 +1098,12 @@ PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_trywrlock(pthread_rwlock_t *);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_rdlock(pthread_rwlock_t *lock);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedrdlock(pthread_rwlock_t *lock,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_wrlock(pthread_rwlock_t *lock);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedwrlock(pthread_rwlock_t *lock,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_unlock(pthread_rwlock_t *lock);
@@ -1117,10 +1112,10 @@ PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_init (pthread_rwlockattr_t * at
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr,
- int *pshared);
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr,
- int pshared);
+ int pshared);
#if PTW32_LEVEL >= PTW32_LEVEL_MAX - 1
@@ -1138,9 +1133,9 @@ PTW32_DLLPORT int PTW32_CDECL pthread_kill(pthread_t thread, int sig);
* Compatibility with Linux.
*/
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr,
- int kind);
+ int kind);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr,
- int *kind);
+ int *kind);
/*
* Possibly supported by other POSIX threads implementations
@@ -1162,8 +1157,8 @@ PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_detach_np(void);
*/
PTW32_DLLPORT int PTW32_CDECL pthread_win32_test_features_np(int);
enum ptw32_features {
- PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
- PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
+ PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
+ PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
};
/*
@@ -1203,7 +1198,7 @@ PTW32_DLLPORT HANDLE PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread)
*/
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableWait (HANDLE waitHandle);
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
- DWORD timeout);
+ DWORD timeout);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
@@ -1212,11 +1207,11 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
*/
#ifndef _UWIN
# if defined(NEED_ERRNO)
- PTW32_DLLPORT int * PTW32_CDECL _errno( void );
+PTW32_DLLPORT int * PTW32_CDECL _errno( void );
# else
# ifndef errno
# if (defined(_MT) || defined(_DLL))
- __declspec(dllimport) extern int * __cdecl _errno(void);
+__declspec(dllimport) extern int * __cdecl _errno(void);
# define errno (*_errno())
# endif
# endif
@@ -1267,22 +1262,22 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
#ifdef __cplusplus
-/*
- * Internal exceptions
- */
-class ptw32_exception {};
-class ptw32_exception_cancel : public ptw32_exception {};
-class ptw32_exception_exit : public ptw32_exception {};
+ /*
+ * Internal exceptions
+ */
+ class ptw32_exception {};
+ class ptw32_exception_cancel : public ptw32_exception {};
+ class ptw32_exception_exit : public ptw32_exception {};
#endif
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
-/* FIXME: This is only required if the library was built using SEH */
-/*
- * Get internal SEH tag
- */
-PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
+ /* FIXME: This is only required if the library was built using SEH */
+ /*
+ * Get internal SEH tag
+ */
+ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
@@ -1290,10 +1285,10 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#ifdef __CLEANUP_SEH
-/*
- * Redefine the SEH __except keyword to ensure that applications
- * propagate our internal exceptions up to the library's internal handlers.
- */
+ /*
+ * Redefine the SEH __except keyword to ensure that applications
+ * propagate our internal exceptions up to the library's internal handlers.
+ */
#define __except( E ) \
__except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \
? EXCEPTION_CONTINUE_SEARCH : ( E ) )
@@ -1302,15 +1297,15 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#ifdef __CLEANUP_CXX
-/*
- * Redefine the C++ catch keyword to ensure that applications
- * propagate our internal exceptions up to the library's internal handlers.
- */
+ /*
+ * Redefine the C++ catch keyword to ensure that applications
+ * propagate our internal exceptions up to the library's internal handlers.
+ */
#ifdef _MSC_VER
- /*
- * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
- * if you want Pthread-Win32 cancelation and pthread_exit to work.
- */
+ /*
+ * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
+ * if you want Pthread-Win32 cancelation and pthread_exit to work.
+ */
#ifndef PtW32NoCatchWarn
diff --git a/thirdparties/win32/include/pthread/sched.h b/thirdparties/win32/include/pthread/sched.h
index 3dfd4a8..cd17f4f 100755
--- a/thirdparties/win32/include/pthread/sched.h
+++ b/thirdparties/win32/include/pthread/sched.h
@@ -3,7 +3,7 @@
*
* Purpose:
* Provides an implementation of POSIX realtime extensions
- * as defined in
+ * as defined in
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
@@ -12,25 +12,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -127,15 +127,15 @@ typedef int pid_t;
/* Thread scheduling policies */
enum {
- SCHED_OTHER = 0,
- SCHED_FIFO,
- SCHED_RR,
- SCHED_MIN = SCHED_OTHER,
- SCHED_MAX = SCHED_RR
+ SCHED_OTHER = 0,
+ SCHED_FIFO,
+ SCHED_RR,
+ SCHED_MIN = SCHED_OTHER,
+ SCHED_MAX = SCHED_RR
};
struct sched_param {
- int sched_priority;
+ int sched_priority;
};
#ifdef __cplusplus
diff --git a/thirdparties/win32/include/pthread/semaphore.h b/thirdparties/win32/include/pthread/semaphore.h
index f00cf9c..98be3fa 100755
--- a/thirdparties/win32/include/pthread/semaphore.h
+++ b/thirdparties/win32/include/pthread/semaphore.h
@@ -12,25 +12,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -127,8 +127,8 @@ typedef unsigned int mode_t;
typedef struct sem_t_ * sem_t;
PTW32_DLLPORT int __cdecl sem_init (sem_t * sem,
- int pshared,
- unsigned int value);
+ int pshared,
+ unsigned int value);
PTW32_DLLPORT int __cdecl sem_destroy (sem_t * sem);
@@ -137,24 +137,24 @@ PTW32_DLLPORT int __cdecl sem_trywait (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_wait (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_timedwait (sem_t * sem,
- const struct timespec * abstime);
+ const struct timespec * abstime);
PTW32_DLLPORT int __cdecl sem_post (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_post_multiple (sem_t * sem,
- int count);
+ int count);
PTW32_DLLPORT int __cdecl sem_open (const char * name,
- int oflag,
- mode_t mode,
- unsigned int value);
+ int oflag,
+ mode_t mode,
+ unsigned int value);
PTW32_DLLPORT int __cdecl sem_close (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_unlink (const char * name);
PTW32_DLLPORT int __cdecl sem_getvalue (sem_t * sem,
- int * sval);
+ int * sval);
#ifdef __cplusplus
} /* End of extern "C" */
diff --git a/thirdparties/win32/include/speex/speex.h b/thirdparties/win32/include/speex/speex.h
index 82ba016..0eb560e 100755
--- a/thirdparties/win32/include/speex/speex.h
+++ b/thirdparties/win32/include/speex/speex.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
-/** Struct defining a Speex mode */
+/** Struct defining a Speex mode */
typedef struct SpeexMode {
- /** Pointer to the low-level mode data */
- const void *mode;
+ /** Pointer to the low-level mode data */
+ const void *mode;
+
+ /** Pointer to the mode query function */
+ mode_query_func query;
- /** Pointer to the mode query function */
- mode_query_func query;
-
- /** The name of the mode (you should not rely on this to identify the mode)*/
- const char *modeName;
+ /** The name of the mode (you should not rely on this to identify the mode)*/
+ const char *modeName;
- /**ID of the mode*/
- int modeID;
+ /**ID of the mode*/
+ int modeID;
- /**Version number of the bitstream (incremented every time we break
- bitstream compatibility*/
- int bitstream_version;
+ /**Version number of the bitstream (incremented every time we break
+ bitstream compatibility*/
+ int bitstream_version;
- /** Pointer to encoder initialization function */
- encoder_init_func enc_init;
+ /** Pointer to encoder initialization function */
+ encoder_init_func enc_init;
- /** Pointer to encoder destruction function */
- encoder_destroy_func enc_destroy;
+ /** Pointer to encoder destruction function */
+ encoder_destroy_func enc_destroy;
- /** Pointer to frame encoding function */
- encode_func enc;
+ /** Pointer to frame encoding function */
+ encode_func enc;
- /** Pointer to decoder initialization function */
- decoder_init_func dec_init;
+ /** Pointer to decoder initialization function */
+ decoder_init_func dec_init;
- /** Pointer to decoder destruction function */
- decoder_destroy_func dec_destroy;
+ /** Pointer to decoder destruction function */
+ decoder_destroy_func dec_destroy;
- /** Pointer to frame decoding function */
- decode_func dec;
+ /** Pointer to frame decoding function */
+ decode_func dec;
- /** ioctl-like requests for encoder */
- encoder_ctl_func enc_ctl;
+ /** ioctl-like requests for encoder */
+ encoder_ctl_func enc_ctl;
- /** ioctl-like requests for decoder */
- decoder_ctl_func dec_ctl;
+ /** ioctl-like requests for decoder */
+ decoder_ctl_func dec_ctl;
} SpeexMode;
/**
- * Returns a handle to a newly created Speex encoder state structure. For now,
- * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
- * may be added. Note that for now if you have more than one channels to
+ * Returns a handle to a newly created Speex encoder state structure. For now,
+ * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
+ * may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
- * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
+ * @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
-/** Frees all resources associated to an existing Speex encoder state.
+/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
- @param in Frame that will be encoded with a +-2^15 range. This data MAY be
- overwritten by the encoder and should be considered uninitialised
+ @param in Frame that will be encoded with a +-2^15 range. This data MAY be
+ overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
@@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int speex_encoder_ctl(void *state, int request, void *ptr);
-/** Returns a handle to a newly created decoder state structure. For now,
+/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
- */
+ */
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
diff --git a/thirdparties/win32/include/speex/speex_bits.h b/thirdparties/win32/include/speex/speex_bits.h
index a26fb4c..dd3b752 100755
--- a/thirdparties/win32/include/speex/speex_bits.h
+++ b/thirdparties/win32/include/speex/speex_bits.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,15 +47,15 @@ extern "C" {
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
- char *chars; /**< "raw" data */
- int nbBits; /**< Total number of bits stored in the stream*/
- int charPtr; /**< Position of the byte "cursor" */
- int bitPtr; /**< Position of the bit "cursor" within the current char */
- int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
- int overflow;/**< Set to one if we try to read past the valid data */
- int buf_size;/**< Allocated size for buffer */
- int reserved1; /**< Reserved for future use */
- void *reserved2; /**< Reserved for future use */
+ char *chars; /**< "raw" data */
+ int nbBits; /**< Total number of bits stored in the stream*/
+ int charPtr; /**< Position of the byte "cursor" */
+ int bitPtr; /**< Position of the bit "cursor" within the current char */
+ int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
+ int overflow;/**< Set to one if we try to read past the valid data */
+ int buf_size;/**< Allocated size for buffer */
+ int reserved1; /**< Reserved for future use */
+ void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
- *
+ *
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int speex_bits_nbytes(SpeexBits *bits);
-/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
- *
+/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
+ *
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
- * "cursor" position
- *
+ * "cursor" position
+ *
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
-/** Advances the position of the "bit cursor" in the stream
+/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int speex_bits_remaining(SpeexBits *bits);
-/** Insert a terminator so that the data can be sent as a packet while auto-detecting
- * the number of frames in each packet
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting
+ * the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
diff --git a/thirdparties/win32/include/speex/speex_buffer.h b/thirdparties/win32/include/speex/speex_buffer.h
index df56f5f..909bd6d 100755
--- a/thirdparties/win32/include/speex/speex_buffer.h
+++ b/thirdparties/win32/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/thirdparties/win32/include/speex/speex_callbacks.h b/thirdparties/win32/include/speex/speex_callbacks.h
index 6f450b3..27b5649 100755
--- a/thirdparties/win32/include/speex/speex_callbacks.h
+++ b/thirdparties/win32/include/speex/speex_callbacks.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
- int callback_id; /**< ID associated to the callback */
- speex_callback_func func; /**< Callback handler function */
- void *data; /**< Data that will be sent to the handler */
- void *reserved1; /**< Reserved for future use */
- int reserved2; /**< Reserved for future use */
+ int callback_id; /**< ID associated to the callback */
+ speex_callback_func func; /**< Callback handler function */
+ void *data; /**< Data that will be sent to the handler */
+ void *reserved1; /**< Reserved for future use */
+ int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
diff --git a/thirdparties/win32/include/speex/speex_echo.h b/thirdparties/win32/include/speex/speex_echo.h
index 53bcd28..582e1cc 100755
--- a/thirdparties/win32/include/speex/speex_echo.h
+++ b/thirdparties/win32/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/thirdparties/win32/include/speex/speex_header.h b/thirdparties/win32/include/speex/speex_header.h
index f85b249..4cc15df 100755
--- a/thirdparties/win32/include/speex/speex_header.h
+++ b/thirdparties/win32/include/speex/speex_header.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,21 +57,21 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
- char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
- char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
- spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
- spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
- spx_int32_t rate; /**< Sampling rate used */
- spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
- spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
- spx_int32_t nb_channels; /**< Number of channels encoded */
- spx_int32_t bitrate; /**< Bit-rate used */
- spx_int32_t frame_size; /**< Size of frames */
- spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
- spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
- spx_int32_t extra_headers; /**< Number of additional headers after the comments */
- spx_int32_t reserved1; /**< Reserved for future use, must be zero */
- spx_int32_t reserved2; /**< Reserved for future use, must be zero */
+ char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
+ char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
+ spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
+ spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
+ spx_int32_t rate; /**< Sampling rate used */
+ spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
+ spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
+ spx_int32_t nb_channels; /**< Number of channels encoded */
+ spx_int32_t bitrate; /**< Bit-rate used */
+ spx_int32_t frame_size; /**< Size of frames */
+ spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
+ spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
+ spx_int32_t extra_headers; /**< Number of additional headers after the comments */
+ spx_int32_t reserved1; /**< Reserved for future use, must be zero */
+ spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
diff --git a/thirdparties/win32/include/speex/speex_jitter.h b/thirdparties/win32/include/speex/speex_jitter.h
index d68674b..e6f0321 100755
--- a/thirdparties/win32/include/speex/speex_jitter.h
+++ b/thirdparties/win32/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
- char *data; /**< Data bytes contained in the packet */
- spx_uint32_t len; /**< Length of the packet in bytes */
- spx_uint32_t timestamp; /**< Timestamp for the packet */
- spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
- spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
- spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
+ char *data; /**< Data bytes contained in the packet */
+ spx_uint32_t len; /**< Length of the packet in bytes */
+ spx_uint32_t timestamp; /**< Timestamp for the packet */
+ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
+ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
+ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/win32/include/speex/speex_preprocess.h b/thirdparties/win32/include/speex/speex_preprocess.h
index f8eef2c..5cd3710 100755
--- a/thirdparties/win32/include/speex/speex_preprocess.h
+++ b/thirdparties/win32/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/thirdparties/win32/include/speex/speex_resampler.h b/thirdparties/win32/include/speex/speex_resampler.h
index 54eef8d..4aefa61 100755
--- a/thirdparties/win32/include/speex/speex_resampler.h
+++ b/thirdparties/win32/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,7 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
@@ -99,13 +99,13 @@ extern "C" {
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
- RESAMPLER_ERR_SUCCESS = 0,
- RESAMPLER_ERR_ALLOC_FAILED = 1,
- RESAMPLER_ERR_BAD_STATE = 2,
- RESAMPLER_ERR_INVALID_ARG = 3,
- RESAMPLER_ERR_PTR_OVERLAP = 4,
-
- RESAMPLER_ERR_MAX_ERROR
+ RESAMPLER_ERR_SUCCESS = 0,
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
+ RESAMPLER_ERR_BAD_STATE = 2,
+ RESAMPLER_ERR_INVALID_ARG = 3,
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
+
+ RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
@@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
-
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
+
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
- int quality,
- int *err);
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
+ int quality,
+ int *err);
/** Destroy a resampler state.
* @param st Resampler state
@@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
+ spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
@@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
- spx_uint32_t *out_len);
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate);
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
@@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
- int quality);
+int speex_resampler_set_quality(SpeexResamplerState *st,
+ int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
- spx_uint32_t stride);
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
+ spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
- spx_uint32_t *stride);
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
+ spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
@@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/thirdparties/win32/include/speex/speex_stereo.h b/thirdparties/win32/include/speex/speex_stereo.h
index a259713..f33704d 100755
--- a/thirdparties/win32/include/speex/speex_stereo.h
+++ b/thirdparties/win32/include/speex/speex_stereo.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -48,12 +48,12 @@ extern "C" {
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
- float balance; /**< Left/right balance info */
- float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
- float smooth_left; /**< Smoothed left channel gain */
- float smooth_right; /**< Smoothed right channel gain */
- float reserved1; /**< Reserved for future use */
- float reserved2; /**< Reserved for future use */
+ float balance; /**< Left/right balance info */
+ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
+ float smooth_left; /**< Smoothed left channel gain */
+ float smooth_right; /**< Smoothed right channel gain */
+ float reserved1; /**< Reserved for future use */
+ float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
diff --git a/thirdparties/win32/include/speex/speex_types.h b/thirdparties/win32/include/speex/speex_types.h
index 32dd8fe..590c76c 100755
--- a/thirdparties/win32/include/speex/speex_types.h
+++ b/thirdparties/win32/include/speex/speex_types.h
@@ -22,107 +22,107 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
- typedef _G_int32_t spx_int32_t;
- typedef _G_uint32_t spx_uint32_t;
- typedef _G_int16_t spx_int16_t;
- typedef _G_uint16_t spx_uint16_t;
+typedef _G_int32_t spx_int32_t;
+typedef _G_uint32_t spx_uint32_t;
+typedef _G_int16_t spx_int16_t;
+typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
# else
- /* MSVC/Borland */
- typedef __int32 spx_int32_t;
- typedef unsigned __int32 spx_uint32_t;
- typedef __int16 spx_int16_t;
- typedef unsigned __int16 spx_uint16_t;
+/* MSVC/Borland */
+typedef __int32 spx_int32_t;
+typedef unsigned __int32 spx_uint32_t;
+typedef __int16 spx_int16_t;
+typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
- typedef SInt16 spx_int16_t;
- typedef UInt16 spx_uint16_t;
- typedef SInt32 spx_int32_t;
- typedef UInt32 spx_uint32_t;
+typedef SInt16 spx_int16_t;
+typedef UInt16 spx_uint16_t;
+typedef SInt32 spx_int32_t;
+typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
- /* Be */
+/* Be */
# include <inttypes.h>
- typedef int16_t spx_int16_t;
- typedef u_int16_t spx_uint16_t;
- typedef int32_t spx_int32_t;
- typedef u_int32_t spx_uint32_t;
+typedef int16_t spx_int16_t;
+typedef u_int16_t spx_uint16_t;
+typedef int32_t spx_int32_t;
+typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
- /* OS/2 GCC */
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* OS/2 GCC */
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
- /* DJGPP */
- typedef short spx_int16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* DJGPP */
+typedef short spx_int16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(R5900)
- /* PS2 EE */
- typedef int spx_int32_t;
- typedef unsigned spx_uint32_t;
- typedef short spx_int16_t;
+/* PS2 EE */
+typedef int spx_int32_t;
+typedef unsigned spx_uint32_t;
+typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
- /* Symbian GCC */
- typedef signed short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef signed int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+/* Symbian GCC */
+typedef signed short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef signed int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef long spx_int32_t;
- typedef unsigned long spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef long spx_int32_t;
+typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#elif ANDROID
- typedef short spx_int16_t;
- typedef unsigned short spx_uint16_t;
- typedef int spx_int32_t;
- typedef unsigned int spx_uint32_t;
+typedef short spx_int16_t;
+typedef unsigned short spx_uint16_t;
+typedef int spx_int32_t;
+typedef unsigned int spx_uint32_t;
#else
diff --git a/thirdparties/win32/include/srtp/aes.h b/thirdparties/win32/include/srtp/aes.h
index d88ce40..0d5e01c 100755
--- a/thirdparties/win32/include/srtp/aes.h
+++ b/thirdparties/win32/include/srtp/aes.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -53,19 +53,19 @@
/* aes internals */
typedef struct {
- v128_t round[15];
- int num_rounds;
+ v128_t round[15];
+ int num_rounds;
} aes_expanded_key_t;
err_status_t
aes_expand_encryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
err_status_t
aes_expand_decryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
void
aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
@@ -75,7 +75,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
#if 0
/*
- * internal functions
+ * internal functions
*/
void
@@ -83,6 +83,6 @@ aes_init_sbox(void);
void
aes_compute_tables(void);
-#endif
+#endif
#endif /* _AES_H */
diff --git a/thirdparties/win32/include/srtp/aes_cbc.h b/thirdparties/win32/include/srtp/aes_cbc.h
index f92591d..b2f3b76 100755
--- a/thirdparties/win32/include/srtp/aes_cbc.h
+++ b/thirdparties/win32/include/srtp/aes_cbc.h
@@ -15,38 +15,38 @@
#include "cipher.h"
typedef struct {
- v128_t state; /* cipher chaining state */
- v128_t previous; /* previous ciphertext block */
- uint8_t key[32];
- int key_len;
- aes_expanded_key_t expanded_key; /* the cipher key */
+ v128_t state; /* cipher chaining state */
+ v128_t previous; /* previous ciphertext block */
+ uint8_t key[32];
+ int key_len;
+ aes_expanded_key_t expanded_key; /* the cipher key */
} aes_cbc_ctx_t;
err_status_t
aes_cbc_set_key(aes_cbc_ctx_t *c,
- const unsigned char *key);
+ const unsigned char *key);
err_status_t
-aes_cbc_encrypt(aes_cbc_ctx_t *c,
- unsigned char *buf,
- unsigned int *bytes_in_data);
+aes_cbc_encrypt(aes_cbc_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *bytes_in_data);
err_status_t
-aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
- int key_len);
+aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
+ int key_len);
err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction);
err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
#endif /* AES_CBC_H */
diff --git a/thirdparties/win32/include/srtp/aes_gcm_ossl.h b/thirdparties/win32/include/srtp/aes_gcm_ossl.h
index 8e7711d..827ecd3 100755
--- a/thirdparties/win32/include/srtp/aes_gcm_ossl.h
+++ b/thirdparties/win32/include/srtp/aes_gcm_ossl.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,11 +52,11 @@
#include <openssl/aes.h>
typedef struct {
- v256_t key;
- int key_size;
- int tag_len;
- EVP_CIPHER_CTX ctx;
- cipher_direction_t dir;
+ v256_t key;
+ int key_size;
+ int tag_len;
+ EVP_CIPHER_CTX ctx;
+ cipher_direction_t dir;
} aes_gcm_ctx_t;
#endif /* AES_GCM_OSSL_H */
diff --git a/thirdparties/win32/include/srtp/aes_icm.h b/thirdparties/win32/include/srtp/aes_icm.h
index 8b9f4ce..9e04f36 100755
--- a/thirdparties/win32/include/srtp/aes_icm.h
+++ b/thirdparties/win32/include/srtp/aes_icm.h
@@ -15,43 +15,43 @@
#include "cipher.h"
typedef struct {
- v128_t counter; /* holds the counter value */
- v128_t offset; /* initial offset value */
- v128_t keystream_buffer; /* buffers bytes of keystream */
- aes_expanded_key_t expanded_key; /* the cipher key */
- int bytes_in_buffer; /* number of unused bytes in buffer */
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
} aes_icm_ctx_t;
err_status_t
aes_icm_context_init(aes_icm_ctx_t *c,
- const unsigned char *key,
- int key_len);
+ const unsigned char *key,
+ int key_len);
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction);
err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
aes_icm_output(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int bytes_to_output);
+ unsigned char *buf, unsigned int bytes_to_output);
-err_status_t
+err_status_t
aes_icm_dealloc(cipher_t *c);
-
-err_status_t
-aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
- unsigned char *buf,
- unsigned int *enc_len,
- int forIsmacryp);
-
-err_status_t
-aes_icm_alloc_ismacryp(cipher_t **c,
- int key_len,
- int forIsmacryp);
+
+err_status_t
+aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *enc_len,
+ int forIsmacryp);
+
+err_status_t
+aes_icm_alloc_ismacryp(cipher_t **c,
+ int key_len,
+ int forIsmacryp);
uint16_t
aes_icm_bytes_encrypted(aes_icm_ctx_t *c);
diff --git a/thirdparties/win32/include/srtp/alloc.h b/thirdparties/win32/include/srtp/alloc.h
index 5980eed..306e5f4 100755
--- a/thirdparties/win32/include/srtp/alloc.h
+++ b/thirdparties/win32/include/srtp/alloc.h
@@ -1,32 +1,32 @@
/*
* alloc.h
*
- * interface to memory allocation and deallocation, with optional debugging
+ * interface to memory allocation and deallocation, with optional debugging
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/win32/include/srtp/auth.h b/thirdparties/win32/include/srtp/auth.h
index 5b5e4b2..4d03d08 100755
--- a/thirdparties/win32/include/srtp/auth.h
+++ b/thirdparties/win32/include/srtp/auth.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "err.h" /* error codes */
#include "crypto.h" /* for auth_type_id_t */
#include "crypto_types.h" /* for values of auth_type_id_t */
@@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer;
typedef struct auth_t *auth_pointer_t;
typedef err_status_t (*auth_alloc_func)
- (auth_pointer_t *ap, int key_len, int out_len);
+(auth_pointer_t *ap, int key_len, int out_len);
typedef err_status_t (*auth_init_func)
- (void *state, const uint8_t *key, int key_len);
+(void *state, const uint8_t *key, int key_len);
typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap);
typedef err_status_t (*auth_compute_func)
- (void *state, uint8_t *buffer, int octets_to_auth,
- int tag_len, uint8_t *tag);
+(void *state, uint8_t *buffer, int octets_to_auth,
+ int tag_len, uint8_t *tag);
typedef err_status_t (*auth_update_func)
- (void *state, uint8_t *buffer, int octets_to_auth);
+(void *state, uint8_t *buffer, int octets_to_auth);
typedef err_status_t (*auth_start_func)(void *state);
-
+
/* some syntactic sugar on these function types */
#define auth_type_alloc(at, a, klen, outlen) \
@@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a);
*/
typedef struct auth_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- int data_length_octets; /* octets in data */
- uint8_t *data; /* data */
- int tag_length_octets; /* octets in tag */
- uint8_t *tag; /* tag */
- struct auth_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ int data_length_octets; /* octets in data */
+ uint8_t *data; /* data */
+ int tag_length_octets; /* octets in tag */
+ uint8_t *tag; /* tag */
+ struct auth_test_case_t *next_test_case; /* pointer to next testcase */
} auth_test_case_t;
/* auth_type_t */
typedef struct auth_type_t {
- auth_alloc_func alloc;
- auth_dealloc_func dealloc;
- auth_init_func init;
- auth_compute_func compute;
- auth_update_func update;
- auth_start_func start;
- char *description;
- int ref_count;
- auth_test_case_t *test_data;
- debug_module_t *debug;
- auth_type_id_t id;
+ auth_alloc_func alloc;
+ auth_dealloc_func dealloc;
+ auth_init_func init;
+ auth_compute_func compute;
+ auth_update_func update;
+ auth_start_func start;
+ char *description;
+ int ref_count;
+ auth_test_case_t *test_data;
+ debug_module_t *debug;
+ auth_type_id_t id;
} auth_type_t;
typedef struct auth_t {
- auth_type_t *type;
- void *state;
- int out_len; /* length of output tag in octets */
- int key_len; /* length of key in octets */
- int prefix_len; /* length of keystream prefix */
+ auth_type_t *type;
+ void *state;
+ int out_len; /* length of output tag in octets */
+ int key_len; /* length of key in octets */
+ int prefix_len; /* length of keystream prefix */
} auth_t;
-/*
+/*
* auth_type_self_test() tests an auth_type against test cases
* provided in an array of values of key/message/tag that is known to
* be good
@@ -151,7 +151,7 @@ typedef struct auth_t {
err_status_t
auth_type_self_test(const auth_type_t *at);
-/*
+/*
* auth_type_test() tests an auth_type against external test cases
* provided in an array of values of key/message/tag that is known to
* be good
diff --git a/thirdparties/win32/include/srtp/cipher.h b/thirdparties/win32/include/srtp/cipher.h
index d0d6b57..20bd360 100755
--- a/thirdparties/win32/include/srtp/cipher.h
+++ b/thirdparties/win32/include/srtp/cipher.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CIPHER_H
#define CIPHER_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "rdbx.h" /* for xtd_seq_num_t */
#include "err.h" /* for error codes */
#include "crypto.h" /* for cipher_type_id_t */
@@ -54,17 +54,17 @@
/**
- * @brief cipher_direction_t defines a particular cipher operation.
+ * @brief cipher_direction_t defines a particular cipher operation.
*
* A cipher_direction_t is an enum that describes a particular cipher
* operation, i.e. encryption or decryption. For some ciphers, this
* distinction does not matter, but for others, it is essential.
*/
-typedef enum {
- direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
- direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
- direction_any /**< encryption or decryption */
+typedef enum {
+ direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
+ direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
+ direction_any /**< encryption or decryption */
} cipher_direction_t;
/*
@@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t;
typedef struct cipher_t *cipher_pointer_t;
/*
- * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
+ * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
*/
typedef err_status_t (*cipher_alloc_func_t)
- (cipher_pointer_t *cp, int key_len, int tag_len);
+(cipher_pointer_t *cp, int key_len, int tag_len);
-/*
+/*
* a cipher_init_func_t [re-]initializes a cipher_t with a given key
*/
@@ -96,38 +96,38 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp);
/* a cipher_set_segment_func_t sets the segment index of a cipher_t */
typedef err_status_t (*cipher_set_segment_func_t)
- (void *state, xtd_seq_num_t idx);
+(void *state, xtd_seq_num_t idx);
-/*
- * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
+/*
+ * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
*/
typedef err_status_t (*cipher_set_aad_func_t)
- (void *state, uint8_t *aad, unsigned int aad_len);
+(void *state, uint8_t *aad, unsigned int aad_len);
/* a cipher_encrypt_func_t encrypts data in-place */
typedef err_status_t (*cipher_encrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
/* a cipher_decrypt_func_t decrypts data in-place */
typedef err_status_t (*cipher_decrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
-/*
+/*
* a cipher_set_iv_func_t function sets the current initialization vector
*/
typedef err_status_t (*cipher_set_iv_func_t)
- (cipher_pointer_t cp, void *iv, cipher_direction_t direction);
+(cipher_pointer_t cp, void *iv, cipher_direction_t direction);
/*
* a cipher_get_tag_funct_t function is used to get the authentication
* tag that was calculated by an AEAD cipher.
*/
typedef err_status_t (*cipher_get_tag_func_t)
- (void *state, void *tag, int *len);
+(void *state, void *tag, int *len);
/*
@@ -139,35 +139,35 @@ typedef err_status_t (*cipher_get_tag_func_t)
*/
typedef struct cipher_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- uint8_t *idx; /* packet index */
- int plaintext_length_octets; /* octets in plaintext */
- uint8_t *plaintext; /* plaintext */
- int ciphertext_length_octets; /* octets in plaintext */
- uint8_t *ciphertext; /* ciphertext */
- int aad_length_octets; /* octets in AAD */
- uint8_t *aad; /* AAD */
- int tag_length_octets; /* Length of AEAD tag */
- struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ uint8_t *idx; /* packet index */
+ int plaintext_length_octets; /* octets in plaintext */
+ uint8_t *plaintext; /* plaintext */
+ int ciphertext_length_octets; /* octets in plaintext */
+ uint8_t *ciphertext; /* ciphertext */
+ int aad_length_octets; /* octets in AAD */
+ uint8_t *aad; /* AAD */
+ int tag_length_octets; /* Length of AEAD tag */
+ struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
} cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t {
- cipher_alloc_func_t alloc;
- cipher_dealloc_func_t dealloc;
- cipher_init_func_t init;
- cipher_set_aad_func_t set_aad;
- cipher_encrypt_func_t encrypt;
- cipher_encrypt_func_t decrypt;
- cipher_set_iv_func_t set_iv;
- cipher_get_tag_func_t get_tag;
- char *description;
- int ref_count;
- cipher_test_case_t *test_data;
- debug_module_t *debug;
- cipher_type_id_t id;
+ cipher_alloc_func_t alloc;
+ cipher_dealloc_func_t dealloc;
+ cipher_init_func_t init;
+ cipher_set_aad_func_t set_aad;
+ cipher_encrypt_func_t encrypt;
+ cipher_encrypt_func_t decrypt;
+ cipher_set_iv_func_t set_iv;
+ cipher_get_tag_func_t get_tag;
+ char *description;
+ int ref_count;
+ cipher_test_case_t *test_data;
+ debug_module_t *debug;
+ cipher_type_id_t id;
} cipher_type_t;
/*
@@ -176,10 +176,10 @@ typedef struct cipher_type_t {
*/
typedef struct cipher_t {
- cipher_type_t *type;
- void *state;
- int key_len;
- int algorithm;
+ cipher_type_t *type;
+ void *state;
+ int key_len;
+ int algorithm;
} cipher_t;
/* some syntactic sugar on these function types */
@@ -201,11 +201,11 @@ typedef struct cipher_t {
#define cipher_set_iv(c, n, dir) \
((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n), (dir))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
#define cipher_set_aad(c, a, l) \
(((c) && (((c)->type)->set_aad)) ? \
(((c)->type)->set_aad(((c)->state), (a), (l))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output);
@@ -217,9 +217,9 @@ int
cipher_get_key_length(const cipher_t *c);
-/*
- * cipher_type_self_test() tests a cipher against test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_self_test() tests a cipher against test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -227,9 +227,9 @@ err_status_t
cipher_type_self_test(const cipher_type_t *ct);
-/*
- * cipher_type_test() tests a cipher against external test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_test() tests a cipher against external test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -240,7 +240,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data);
/*
* cipher_bits_per_second(c, l, t) computes (and estimate of) the
* number of bits that a cipher implementation can encrypt in a second
- *
+ *
* c is a cipher (which MUST be allocated and initialized already), l
* is the length in octets of the test data to be encrypted, and t is
* the number of trials
diff --git a/thirdparties/win32/include/srtp/crypto.h b/thirdparties/win32/include/srtp/crypto.h
index 0e9667d..9d656fa 100755
--- a/thirdparties/win32/include/srtp/crypto.h
+++ b/thirdparties/win32/include/srtp/crypto.h
@@ -2,7 +2,7 @@
* crypto.h
*
* API for libcrypto
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -10,7 +10,7 @@
#ifndef CRYPTO_H
#define CRYPTO_H
-/**
+/**
* @brief A cipher_type_id_t is an identifier for a particular cipher
* type.
*
@@ -19,10 +19,10 @@
* NULL_CIPHER is avaliable; this cipher leaves the data unchanged,
* and can be selected to indicate that no encryption is to take
* place.
- *
+ *
* @ingroup Ciphers
*/
-typedef uint32_t cipher_type_id_t;
+typedef uint32_t cipher_type_id_t;
/**
* @brief An auth_type_id_t is an identifier for a particular authentication
@@ -33,7 +33,7 @@ typedef uint32_t cipher_type_id_t;
* avaliable; this authentication function performs no computation,
* and can be selected to indicate that no authentication is to take
* place.
- *
+ *
* @ingroup Authentication
*/
typedef uint32_t auth_type_id_t;
diff --git a/thirdparties/win32/include/srtp/crypto_kernel.h b/thirdparties/win32/include/srtp/crypto_kernel.h
index caccfa0..9e2c5f7 100755
--- a/thirdparties/win32/include/srtp/crypto_kernel.h
+++ b/thirdparties/win32/include/srtp/crypto_kernel.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,9 +46,9 @@
#ifndef CRYPTO_KERNEL
#define CRYPTO_KERNEL
-#include "rand_source.h"
+#include "rand_source.h"
#include "prng.h"
-#include "cipher.h"
+#include "cipher.h"
#include "auth.h"
#include "cryptoalg.h"
#include "stat.h"
@@ -65,37 +65,37 @@
*/
typedef enum {
- crypto_kernel_state_insecure,
- crypto_kernel_state_secure
+ crypto_kernel_state_insecure,
+ crypto_kernel_state_secure
} crypto_kernel_state_t;
-/*
- * linked list of cipher types
+/*
+ * linked list of cipher types
*/
typedef struct kernel_cipher_type {
- cipher_type_id_t id;
- cipher_type_t *cipher_type;
- struct kernel_cipher_type *next;
+ cipher_type_id_t id;
+ cipher_type_t *cipher_type;
+ struct kernel_cipher_type *next;
} kernel_cipher_type_t;
-/*
- * linked list of auth types
+/*
+ * linked list of auth types
*/
typedef struct kernel_auth_type {
- auth_type_id_t id;
- auth_type_t *auth_type;
- struct kernel_auth_type *next;
+ auth_type_id_t id;
+ auth_type_t *auth_type;
+ struct kernel_auth_type *next;
} kernel_auth_type_t;
/*
- * linked list of debug modules
+ * linked list of debug modules
*/
typedef struct kernel_debug_module {
- debug_module_t *mod;
- struct kernel_debug_module *next;
+ debug_module_t *mod;
+ struct kernel_debug_module *next;
} kernel_debug_module_t;
@@ -107,10 +107,10 @@ typedef struct kernel_debug_module {
*/
typedef struct {
- crypto_kernel_state_t state; /* current state of kernel */
- kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
- kernel_auth_type_t *auth_type_list; /* list of all auth func types */
- kernel_debug_module_t *debug_module_list; /* list of all debug modules */
+ crypto_kernel_state_t state; /* current state of kernel */
+ kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
+ kernel_auth_type_t *auth_type_list; /* list of all auth func types */
+ kernel_debug_module_t *debug_module_list; /* list of all debug modules */
} crypto_kernel_t;
@@ -125,10 +125,10 @@ typedef struct {
* crypto algorithms. Possible return values are:
*
* err_status_ok initialization successful
- * <other> init failure
+ * <other> init failure
*
* If any value other than err_status_ok is returned, the
- * crypto_kernel MUST NOT be used.
+ * crypto_kernel MUST NOT be used.
*/
err_status_t
@@ -142,7 +142,7 @@ crypto_kernel_init(void);
* values are:
*
* err_status_ok shutdown successful
- * <other> shutdown failure
+ * <other> shutdown failure
*
*/
@@ -155,7 +155,7 @@ crypto_kernel_shutdown(void);
* status report. Possible return values are:
*
* err_status_ok all tests were passed
- * <other> a test failed
+ * <other> a test failed
*
*/
@@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id);
/*
* crypto_kernel_replace_cipher_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the cipher_type id
* with a new one passed in externally. The new cipher must pass all the
* existing cipher_type's self tests as well as its own.
@@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id);
/*
* crypto_kernel_replace_auth_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the auth_type id
* with a new one passed in externally. The new auth type must pass all the
* existing auth_type's self tests as well as its own.
@@ -208,44 +208,44 @@ err_status_t
crypto_kernel_load_debug_module(debug_module_t *new_dm);
/*
- * crypto_kernel_alloc_cipher(id, cp, key_len);
+ * crypto_kernel_alloc_cipher(id, cp, key_len);
*
* allocates a cipher of type id at location *cp, with key length
* key_len octets. Return values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find cipher with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_cipher(cipher_type_id_t id,
- cipher_pointer_t *cp,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_cipher(cipher_type_id_t id,
+ cipher_pointer_t *cp,
+ int key_len,
+ int tag_len);
/*
- * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
+ * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
*
* allocates an auth function of type id at location *ap, with key
* length key_len octets and output tag length of tag_len. Return
* values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find auth with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_auth(auth_type_id_t id,
- auth_pointer_t *ap,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_auth(auth_type_id_t id,
+ auth_pointer_t *ap,
+ int key_len,
+ int tag_len);
/*
* crypto_kernel_set_debug_module(mod_name, v)
- *
+ *
* sets dynamic debugging to the value v (0 for off, 1 for on) for the
* debug module with the name mod_name
*
@@ -262,7 +262,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
- *
+ *
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
@@ -277,5 +277,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);
-
+
#endif /* CRYPTO_KERNEL */
diff --git a/thirdparties/win32/include/srtp/crypto_math.h b/thirdparties/win32/include/srtp/crypto_math.h
index 52f0837..4de3912 100755
--- a/thirdparties/win32/include/srtp/crypto_math.h
+++ b/thirdparties/win32/include/srtp/crypto_math.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ hex_string_to_v64(char *s);
/* the matrix A[] is stored in column format, i.e., A[i] is
the ith column of the matrix */
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
void
@@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
-/*
+/*
* the matrix A[] is stored in column format, i.e., A[i] is the ith
* column of the matrix
*/
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
@@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-
-#endif /* WORDS_BIGENDIAN */
+
+#endif /* WORDS_BIGENDIAN */
#endif
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
@@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -202,7 +202,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -211,10 +211,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
diff --git a/thirdparties/win32/include/srtp/crypto_types.h b/thirdparties/win32/include/srtp/crypto_types.h
index dbb50c3..0699862 100755
--- a/thirdparties/win32/include/srtp/crypto_types.h
+++ b/thirdparties/win32/include/srtp/crypto_types.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,14 +57,14 @@
* (UST) must be used in conjunction with a cipher other than the null
* cipher. These functions require a per-message pseudorandom input
* that is generated by the cipher.
- *
+ *
* The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the
* strongest available authentication function and cipher,
* respectively. They are resolved at compile time to the strongest
* available algorithm. The stronghold algorithms can serve as did
* the keep of a medieval fortification; they provide the strongest
* defense (or the last refuge).
- *
+ *
* @{
*/
@@ -72,7 +72,7 @@
* @defgroup Ciphers Cipher Types
*
* @brief Each cipher type is identified by an unsigned integer. The
- * cipher types available in this edition of libSRTP are given
+ * cipher types available in this edition of libSRTP are given
* by the #defines below.
*
* A cipher_type_id_t is an identifier for a cipher_type; only values
@@ -90,84 +90,84 @@
/**
* @brief The null cipher performs no encryption.
*
- * The NULL_CIPHER leaves its inputs unaltered, during both the
+ * The NULL_CIPHER leaves its inputs unaltered, during both the
* encryption and decryption operations. This cipher can be chosen
* to indicate that no encryption is to be performed.
*/
-#define NULL_CIPHER 0
+#define NULL_CIPHER 0
-/**
- * @brief AES Integer Counter Mode (AES ICM)
+/**
+ * @brief AES Integer Counter Mode (AES ICM)
*
- * AES ICM is the variant of counter mode that is used by Secure RTP.
+ * AES ICM is the variant of counter mode that is used by Secure RTP.
* This cipher uses a 16-, 24-, or 32-octet key concatenated with a
* 14-octet offset (or salt) value.
*/
-#define AES_ICM 1
+#define AES_ICM 1
-/**
- * @brief AES-128 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-128 Integer Counter Mode (AES ICM)
* AES-128 ICM is a deprecated alternate name for AES ICM.
*/
#define AES_128_ICM AES_ICM
/**
- * @brief SEAL 3.0
- *
+ * @brief SEAL 3.0
+ *
* SEAL is the Software-Optimized Encryption Algorithm of Coppersmith
* and Rogaway. Nota bene: this cipher is IBM proprietary.
*/
-#define SEAL 2
+#define SEAL 2
-/**
- * @brief AES Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES Cipher Block Chaining mode (AES CBC)
*
* AES CBC is the AES Cipher Block Chaining mode.
* This cipher uses a 16-, 24-, or 32-octet key.
*/
-#define AES_CBC 3
+#define AES_CBC 3
-/**
- * @brief AES-128 Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES-128 Cipher Block Chaining mode (AES CBC)
*
* AES-128 CBC is a deprecated alternate name for AES CBC.
*/
-#define AES_128_CBC AES_CBC
+#define AES_128_CBC AES_CBC
/**
* @brief Strongest available cipher.
*
* This identifier resolves to the strongest cipher type available.
*/
-#define STRONGHOLD_CIPHER AES_ICM
+#define STRONGHOLD_CIPHER AES_ICM
-/**
- * @brief AES-192 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-192 Integer Counter Mode (AES ICM)
* AES-192 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_192_ICM 4
+#define AES_192_ICM 4
-/**
- * @brief AES-256 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-256 Integer Counter Mode (AES ICM)
* AES-256 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_256_ICM 5
+#define AES_256_ICM 5
-/**
- * @brief AES-128_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-128_GCM Galois Counter Mode (AES GCM)
*
- * AES-128 GCM is the variant of galois counter mode that is used by
+ * AES-128 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 16-octet key.
*/
-#define AES_128_GCM 6
+#define AES_128_GCM 6
-/**
- * @brief AES-256_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-256_GCM Galois Counter Mode (AES GCM)
*
- * AES-256 GCM is the variant of galois counter mode that is used by
+ * AES-256 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 32-octet key.
*/
-#define AES_256_GCM 7
+#define AES_256_GCM 7
/**
* @}
@@ -177,14 +177,14 @@
/**
* @defgroup Authentication Authentication Function Types
- *
+ *
* @brief Each authentication function type is identified by an
* unsigned integer. The authentication function types available in
* this edition of libSRTP are given by the #defines below.
*
* An auth_type_id_t is an identifier for an authentication function type;
- * only values given by the #defines above (or those present in the
- * file crypto_types.h) should be used.
+ * only values given by the #defines above (or those present in the
+ * file crypto_types.h) should be used.
*
* The identifier STRONGHOLD_AUTH indicates the strongest available
* authentication function, allowing an application to choose the
@@ -201,8 +201,8 @@
*
* The NULL_AUTH function does nothing, and can be selected to indicate
* that authentication should not be performed.
- */
-#define NULL_AUTH 0
+ */
+#define NULL_AUTH 0
/**
* @brief UST with TMMH Version 2
@@ -212,15 +212,15 @@
* than the null cipher.
* with a cipher.
*/
-#define UST_TMMHv2 1
+#define UST_TMMHv2 1
/**
- * @brief (UST) AES-128 XORMAC
+ * @brief (UST) AES-128 XORMAC
*
* UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene:
* the XORMAC algorithm is IBM proprietary.
*/
-#define UST_AES_128_XMAC 2
+#define UST_AES_128_XMAC 2
/**
* @brief HMAC-SHA1
@@ -228,7 +228,7 @@
* HMAC_SHA1 implements the Hash-based MAC using the NIST Secure
* Hash Algorithm version 1 (SHA1).
*/
-#define HMAC_SHA1 3
+#define HMAC_SHA1 3
/**
* @brief Strongest available authentication function.
@@ -236,7 +236,7 @@
* This identifier resolves to the strongest available authentication
* function.
*/
-#define STRONGHOLD_AUTH HMAC_SHA1
+#define STRONGHOLD_AUTH HMAC_SHA1
/**
* @}
diff --git a/thirdparties/win32/include/srtp/cryptoalg.h b/thirdparties/win32/include/srtp/cryptoalg.h
index d9f0441..ad29fa0 100755
--- a/thirdparties/win32/include/srtp/cryptoalg.h
+++ b/thirdparties/win32/include/srtp/cryptoalg.h
@@ -2,31 +2,31 @@
* cryptoalg.h
*
* API for authenticated encryption crypto algorithms
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -61,10 +61,10 @@
* The function pointer cryptoalg_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated but not encrypted
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated but not encrypted
*
* @param clear_len length of data to be authenticated but not encrypted
*
@@ -79,34 +79,34 @@
* length of the ciphertext (after the call)
*
*/
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- const void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len);
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ const void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- const void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ const void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
@@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t;
int
cryptoalg_get_id(cryptoalg_t c);
-cryptoalg_t
+cryptoalg_t
cryptoalg_find_by_id(int id);
diff --git a/thirdparties/win32/include/srtp/datatypes.h b/thirdparties/win32/include/srtp/datatypes.h
index b18435f..b29a0f0 100755
--- a/thirdparties/win32/include/srtp/datatypes.h
+++ b/thirdparties/win32/include/srtp/datatypes.h
@@ -1,6 +1,6 @@
/*
* datatypes.h
- *
+ *
* data types for bit vectors and finite fields
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -65,31 +65,31 @@
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
-#define DATATYPES_USE_MACROS
+#define DATATYPES_USE_MACROS
typedef union {
- uint8_t v8[2];
- uint16_t value;
+ uint8_t v8[2];
+ uint16_t value;
} v16_t;
typedef union {
- uint8_t v8[4];
- uint16_t v16[2];
- uint32_t value;
+ uint8_t v8[4];
+ uint16_t v16[2];
+ uint32_t value;
} v32_t;
typedef union {
- uint8_t v8[8];
- uint16_t v16[4];
- uint32_t v32[2];
- uint64_t value;
+ uint8_t v8[8];
+ uint16_t v16[4];
+ uint32_t v32[2];
+ uint64_t value;
} v64_t;
typedef union {
- uint8_t v8[16];
- uint16_t v16[8];
- uint32_t v32[4];
- uint64_t v64[2];
+ uint8_t v8[16];
+ uint16_t v16[8];
+ uint32_t v32[4];
+ uint64_t v64[2];
} v128_t;
typedef union {
@@ -168,7 +168,7 @@ v128_right_shift(v128_t *x, int shift_index);
/*
* the following macros define the data manipulation functions
- *
+ *
* If DATATYPES_USE_MACROS is defined, then these macros are used
* directly (and function call overhead is avoided). Otherwise,
* the macros are used through the functions defined in datatypes.c
@@ -315,18 +315,18 @@ v128_right_shift(v128_t *x, int shift_index);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* 0 */
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -352,7 +352,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -361,10 +361,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
@@ -383,9 +383,9 @@ void
octet_string_set_to_zero(uint8_t *s, int len);
-#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H)
+#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H)
-/*
+/*
* Convert big endian integers to CPU byte order.
*/
#ifdef WORDS_BIGENDIAN
@@ -401,10 +401,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
-static inline uint32_t be32_to_cpu(uint32_t v) {
- /* optimized for x86. */
- asm("bswap %0" : "=r" (v) : "0" (v));
- return v;
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ /* optimized for x86. */
+ asm("bswap %0" : "=r" (v) : "0" (v));
+ return v;
}
# else /* HAVE_X86 */
# ifdef HAVE_NETINET_IN_H
@@ -415,15 +416,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) {
# define be32_to_cpu(x) ntohl((x))
# endif /* HAVE_X86 */
-static inline uint64_t be64_to_cpu(uint64_t v) {
+static inline uint64_t be64_to_cpu(uint64_t v)
+{
# ifdef NO_64BIT_MATH
- /* use the make64 functions to do 64-bit math */
- v = make64(htonl(low32(v)),htonl(high32(v)));
+ /* use the make64 functions to do 64-bit math */
+ v = make64(htonl(low32(v)),htonl(high32(v)));
# else
- /* use the native 64-bit math */
- v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
+ /* use the native 64-bit math */
+ v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
# endif
- return v;
+ return v;
}
#endif /* ! SRTP_KERNEL_LINUX */
@@ -431,22 +433,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) {
#endif /* WORDS_BIGENDIAN */
/*
- * functions manipulating bitvector_t
+ * functions manipulating bitvector_t
*
* A bitvector_t consists of an array of words and an integer
* representing the number of significant bits stored in the array.
* The bits are packed as follows: the least significant bit is that
* of word[0], while the most significant bit is the nth most
* significant bit of word[m], where length = bits_per_word * m + n.
- *
+ *
*/
#define bits_per_word 32
#define bytes_per_word 4
typedef struct {
- uint32_t length;
- uint32_t *word;
+ uint32_t length;
+ uint32_t *word;
} bitvector_t;
diff --git a/thirdparties/win32/include/srtp/ekt.h b/thirdparties/win32/include/srtp/ekt.h
index b0d888b..d7f9854 100755
--- a/thirdparties/win32/include/srtp/ekt.h
+++ b/thirdparties/win32/include/srtp/ekt.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2005 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,12 +45,12 @@
/*
- * EKT implementation strategy
- *
+ * EKT implementation strategy
+ *
* use stream_template approach
*
* in srtp_unprotect, when a new stream appears, check if template has
- * EKT defined, and if it does, then apply EKT processing
+ * EKT defined, and if it does, then apply EKT processing
*
* question: will we want to allow key-sharing templates in addition
* to EKT templates? could define a new ssrc_type_t that's associated
@@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt);
*/
typedef struct ekt_policy_ctx_t {
- ekt_spi_t spi; /* security parameter index */
- uint8_t ekt_cipher_type;
- uint8_t *ekt_key;
- struct ekt_policy_ctx_t *next_ekt_policy;
+ ekt_spi_t spi; /* security parameter index */
+ uint8_t ekt_cipher_type;
+ uint8_t *ekt_key;
+ struct ekt_policy_ctx_t *next_ekt_policy;
} ekt_policy_ctx_t;
@@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t {
*/
typedef struct ekt_data_t {
- ekt_spi_t spi;
- uint8_t ekt_cipher_type;
- aes_expanded_key_t ekt_enc_key;
- aes_expanded_key_t ekt_dec_key;
- struct ekt_data_t *next_ekt_data;
+ ekt_spi_t spi;
+ uint8_t ekt_cipher_type;
+ aes_expanded_key_t ekt_enc_key;
+ aes_expanded_key_t ekt_dec_key;
+ struct ekt_data_t *next_ekt_data;
} ekt_data_t;
/*
@@ -116,39 +116,39 @@ typedef struct ekt_data_t {
*/
typedef struct ekt_stream_ctx_t {
- ekt_data_t *data;
- uint16_t isn; /* initial sequence number */
- uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
+ ekt_data_t *data;
+ uint16_t isn; /* initial sequence number */
+ uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN];
} ekt_stream_ctx_t;
-err_status_t
+err_status_t
ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy);
err_status_t
-ekt_stream_init(ekt_stream_t e,
- ekt_spi_t spi,
- void *ekt_key,
- unsigned ekt_cipher_type);
+ekt_stream_init(ekt_stream_t e,
+ ekt_spi_t spi,
+ void *ekt_key,
+ unsigned ekt_cipher_type);
err_status_t
ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p);
-
+
err_status_t
-srtp_stream_init_from_ekt(srtp_stream_t stream,
- const void *srtcp_hdr,
- unsigned pkt_octet_len);
-
+srtp_stream_init_from_ekt(srtp_stream_t stream,
+ const void *srtcp_hdr,
+ unsigned pkt_octet_len);
+
void
ekt_write_data(ekt_stream_t ekt,
- uint8_t *base_tag,
- unsigned base_tag_len,
- int *packet_len,
- xtd_seq_num_t pkt_index);
+ uint8_t *base_tag,
+ unsigned base_tag_len,
+ int *packet_len,
+ xtd_seq_num_t pkt_index);
/*
* We handle EKT by performing some additional steps before
@@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt,
*/
err_status_t
-ekt_tag_verification_preproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ekt_tag_verification_preproces(uint8_t *pkt_tag,
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
err_status_t
ekt_tag_verification_postproces(uint8_t *pkt_tag,
- uint8_t *pkt_tag_copy,
- unsigned tag_len);
+ uint8_t *pkt_tag_copy,
+ unsigned tag_len);
/*
@@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag,
* Master Key, the SRTP ROC, the Initial Sequence Number, and SPI
* fields. The Base Authentication Tag field is set to the all-zero
* value
- *
+ *
* When EKT is not used, this function is a no-op.
- *
+ *
*/
err_status_t
srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s,
- uint8_t *pkt_tag,
- unsigned pkt_octet_len);
+ uint8_t *pkt_tag,
+ unsigned pkt_octet_len);
/* it's not clear that a tag_generation_postprocess function is needed */
diff --git a/thirdparties/win32/include/srtp/err.h b/thirdparties/win32/include/srtp/err.h
index 4f401a6..bf8f87a 100755
--- a/thirdparties/win32/include/srtp/err.h
+++ b/thirdparties/win32/include/srtp/err.h
@@ -1,32 +1,32 @@
/*
* err.h
- *
+ *
* error status codes
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
/**
* @defgroup Error Error Codes
- *
+ *
* Error status codes are represented by the enumeration err_status_t.
- *
+ *
* @{
*/
@@ -67,31 +67,31 @@
*
*/
typedef enum {
- err_status_ok = 0, /**< nothing to report */
- err_status_fail = 1, /**< unspecified failure */
- err_status_bad_param = 2, /**< unsupported parameter */
- err_status_alloc_fail = 3, /**< couldn't allocate memory */
- err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
- err_status_init_fail = 5, /**< couldn't initialize */
- err_status_terminus = 6, /**< can't process as much data as requested */
- err_status_auth_fail = 7, /**< authentication failure */
- err_status_cipher_fail = 8, /**< cipher failure */
- err_status_replay_fail = 9, /**< replay check failed (bad index) */
- err_status_replay_old = 10, /**< replay check failed (index too old) */
- err_status_algo_fail = 11, /**< algorithm failed test routine */
- err_status_no_such_op = 12, /**< unsupported operation */
- err_status_no_ctx = 13, /**< no appropriate context found */
- err_status_cant_check = 14, /**< unable to perform desired validation */
- err_status_key_expired = 15, /**< can't use key any more */
- err_status_socket_err = 16, /**< error in use of socket */
- err_status_signal_err = 17, /**< error in use POSIX signals */
- err_status_nonce_bad = 18, /**< nonce check failed */
- err_status_read_fail = 19, /**< couldn't read data */
- err_status_write_fail = 20, /**< couldn't write data */
- err_status_parse_err = 21, /**< error parsing data */
- err_status_encode_err = 22, /**< error encoding data */
- err_status_semaphore_err = 23,/**< error while using semaphores */
- err_status_pfkey_err = 24 /**< error while using pfkey */
+ err_status_ok = 0, /**< nothing to report */
+ err_status_fail = 1, /**< unspecified failure */
+ err_status_bad_param = 2, /**< unsupported parameter */
+ err_status_alloc_fail = 3, /**< couldn't allocate memory */
+ err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
+ err_status_init_fail = 5, /**< couldn't initialize */
+ err_status_terminus = 6, /**< can't process as much data as requested */
+ err_status_auth_fail = 7, /**< authentication failure */
+ err_status_cipher_fail = 8, /**< cipher failure */
+ err_status_replay_fail = 9, /**< replay check failed (bad index) */
+ err_status_replay_old = 10, /**< replay check failed (index too old) */
+ err_status_algo_fail = 11, /**< algorithm failed test routine */
+ err_status_no_such_op = 12, /**< unsupported operation */
+ err_status_no_ctx = 13, /**< no appropriate context found */
+ err_status_cant_check = 14, /**< unable to perform desired validation */
+ err_status_key_expired = 15, /**< can't use key any more */
+ err_status_socket_err = 16, /**< error in use of socket */
+ err_status_signal_err = 17, /**< error in use POSIX signals */
+ err_status_nonce_bad = 18, /**< nonce check failed */
+ err_status_read_fail = 19, /**< couldn't read data */
+ err_status_write_fail = 20, /**< couldn't write data */
+ err_status_parse_err = 21, /**< error parsing data */
+ err_status_encode_err = 22, /**< error encoding data */
+ err_status_semaphore_err = 23,/**< error while using semaphores */
+ err_status_pfkey_err = 24 /**< error while using pfkey */
} err_status_t;
/**
@@ -99,15 +99,15 @@ typedef enum {
*/
typedef enum {
- err_level_emergency = 0,
- err_level_alert,
- err_level_critical,
- err_level_error,
- err_level_warning,
- err_level_notice,
- err_level_info,
- err_level_debug,
- err_level_none
+ err_level_emergency = 0,
+ err_level_alert,
+ err_level_critical,
+ err_level_error,
+ err_level_warning,
+ err_level_notice,
+ err_level_info,
+ err_level_debug,
+ err_level_none
} err_reporting_level_t;
/*
@@ -145,8 +145,8 @@ err_report(int priority, const char *format, ...);
*/
typedef struct {
- int on; /* 1 if debugging is on, 0 if it is off */
- const char *name; /* printable name for debug module */
+ int on; /* 1 if debugging is on, 0 if it is off */
+ const char *name; /* printable name for debug module */
} debug_module_t;
#ifdef ENABLE_DEBUGGING
diff --git a/thirdparties/win32/include/srtp/getopt_s.h b/thirdparties/win32/include/srtp/getopt_s.h
index 2a6ece3..d3dc33d 100755
--- a/thirdparties/win32/include/srtp/getopt_s.h
+++ b/thirdparties/win32/include/srtp/getopt_s.h
@@ -7,26 +7,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -45,11 +45,11 @@
#ifndef GETOPT_S_H
#define GETOPT_S_H
-/*
+/*
* getopt_s(), optarg_s, and optind_s are small, locally defined
* versions of the POSIX standard getopt() interface.
*/
-
+
int
getopt_s(int argc, char * const argv[], const char *optstring);
diff --git a/thirdparties/win32/include/srtp/gf2_8.h b/thirdparties/win32/include/srtp/gf2_8.h
index 098d37c..bbbabdf 100755
--- a/thirdparties/win32/include/srtp/gf2_8.h
+++ b/thirdparties/win32/include/srtp/gf2_8.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,13 +54,13 @@ typedef uint8_t gf2_8;
#define gf2_8_field_polynomial 0x1B
/*
- * gf2_8_shift(x) returns
+ * gf2_8_shift(x) returns
*/
/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
+ * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
+ * operation, using the field representation from AES; that is, the
+ * next gf2_8 value in the cyclic representation of that field. The
* value z should be an uint8_t.
*/
diff --git a/thirdparties/win32/include/srtp/hmac.h b/thirdparties/win32/include/srtp/hmac.h
index 875f45c..a1639bf 100755
--- a/thirdparties/win32/include/srtp/hmac.h
+++ b/thirdparties/win32/include/srtp/hmac.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,12 +50,12 @@
#include "sha1.h"
typedef struct {
- uint8_t opad[64];
- sha1_ctx_t ctx;
- sha1_ctx_t init_ctx;
+ uint8_t opad[64];
+ sha1_ctx_t ctx;
+ sha1_ctx_t init_ctx;
#ifdef OPENSSL
- int ctx_initialized;
- int init_ctx_initialized;
+ int ctx_initialized;
+ int init_ctx_initialized;
#endif
} hmac_ctx_t;
@@ -76,7 +76,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets);
err_status_t
hmac_compute(hmac_ctx_t *state, const void *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* HMAC_H */
diff --git a/thirdparties/win32/include/srtp/integers.h b/thirdparties/win32/include/srtp/integers.h
index ed77210..90cfac6 100755
--- a/thirdparties/win32/include/srtp/integers.h
+++ b/thirdparties/win32/include/srtp/integers.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -124,7 +124,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \
(((unsigned char *) (addr))[1] << 16) | \
(((unsigned char *) (addr))[2] << 8) | \
- (((unsigned char *) (addr))[3]))
+ (((unsigned char *) (addr))[3]))
#else
#define PUT_32(addr,value) \
{ \
@@ -136,7 +136,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \
(((unsigned char *) (addr))[2] << 16) | \
(((unsigned char *) (addr))[1] << 8) | \
- (((unsigned char *) (addr))[0]))
+ (((unsigned char *) (addr))[0]))
#endif // WORDS_BIGENDIAN
#else
#define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value)
diff --git a/thirdparties/win32/include/srtp/kernel_compat.h b/thirdparties/win32/include/srtp/kernel_compat.h
index 59d1898..36559f7 100755
--- a/thirdparties/win32/include/srtp/kernel_compat.h
+++ b/thirdparties/win32/include/srtp/kernel_compat.h
@@ -1,6 +1,6 @@
/*
* kernel_compat.h
- *
+ *
* Compatibility stuff for building in kernel context where standard
* C headers and library are not available.
*
@@ -8,26 +8,26 @@
* Ingate Systems AB
*/
/*
- *
+ *
* Copyright(c) 2005 Ingate Systems AB
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the author(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -70,9 +70,9 @@
static inline int rand(void)
{
- uint32_t temp;
- get_random_bytes(&temp, sizeof(temp));
- return temp % (RAND_MAX+1);
+ uint32_t temp;
+ get_random_bytes(&temp, sizeof(temp));
+ return temp % (RAND_MAX+1);
}
/* stdio/stdlib implementation. */
diff --git a/thirdparties/win32/include/srtp/key.h b/thirdparties/win32/include/srtp/key.h
index e7e0744..340547f 100755
--- a/thirdparties/win32/include/srtp/key.h
+++ b/thirdparties/win32/include/srtp/key.h
@@ -2,31 +2,31 @@
* key.h
*
* key usage limits enforcement
- *
+ *
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
typedef struct key_limit_ctx_t *key_limit_t;
typedef enum {
- key_event_normal,
- key_event_soft_limit,
- key_event_hard_limit
+ key_event_normal,
+ key_event_soft_limit,
+ key_event_hard_limit
} key_event_t;
err_status_t
@@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key);
key_event_t
key_limit_update(key_limit_t key);
-typedef enum {
- key_state_normal,
- key_state_past_soft_limit,
- key_state_expired
+typedef enum {
+ key_state_normal,
+ key_state_past_soft_limit,
+ key_state_expired
} key_state_t;
typedef struct key_limit_ctx_t {
- xtd_seq_num_t num_left;
- key_state_t state;
+ xtd_seq_num_t num_left;
+ key_state_t state;
} key_limit_ctx_t;
#endif /* KEY_H */
diff --git a/thirdparties/win32/include/srtp/null_auth.h b/thirdparties/win32/include/srtp/null_auth.h
index 44f9a4a..54c0296 100755
--- a/thirdparties/win32/include/srtp/null_auth.h
+++ b/thirdparties/win32/include/srtp/null_auth.h
@@ -7,26 +7,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#include "auth.h"
typedef struct {
- char foo;
+ char foo;
} null_auth_ctx_t;
err_status_t
@@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len);
err_status_t
null_auth_compute (null_auth_ctx_t *state, uint8_t *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* NULL_AUTH_H */
diff --git a/thirdparties/win32/include/srtp/null_cipher.h b/thirdparties/win32/include/srtp/null_cipher.h
index 39da59a..63d272d 100755
--- a/thirdparties/win32/include/srtp/null_cipher.h
+++ b/thirdparties/win32/include/srtp/null_cipher.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,7 +52,7 @@
#include "cipher.h"
typedef struct {
- char foo ;/* empty, for now */
+ char foo ;/* empty, for now */
} null_cipher_ctx_t;
@@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len);
err_status_t
null_cipher_set_segment(null_cipher_ctx_t *c,
- unsigned long segment_index);
+ unsigned long segment_index);
err_status_t
null_cipher_encrypt(null_cipher_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
null_cipher_encrypt_aligned(null_cipher_ctx_t *c,
- unsigned char *buf, int bytes_to_encr);
+ unsigned char *buf, int bytes_to_encr);
#endif /* NULL_CIPHER_H */
diff --git a/thirdparties/win32/include/srtp/prng.h b/thirdparties/win32/include/srtp/prng.h
index c493383..b59ea63 100755
--- a/thirdparties/win32/include/srtp/prng.h
+++ b/thirdparties/win32/include/srtp/prng.h
@@ -26,10 +26,10 @@
*/
typedef struct {
- v128_t state; /* state data */
- aes_expanded_key_t key; /* secret key */
- uint32_t octet_count; /* number of octets output since last init */
- rand_source_func_t rand; /* random source for re-initialization */
+ v128_t state; /* state data */
+ aes_expanded_key_t key; /* secret key */
+ uint32_t octet_count; /* number of octets output since last init */
+ rand_source_func_t rand; /* random source for re-initialization */
} x917_prng_t;
err_status_t
@@ -44,9 +44,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
*/
typedef struct {
- uint32_t octet_count; /* number of octets output since last init */
- aes_icm_ctx_t state; /* state data */
- rand_source_func_t rand; /* random source for re-initialization */
+ uint32_t octet_count; /* number of octets output since last init */
+ aes_icm_ctx_t state; /* state data */
+ rand_source_func_t rand; /* random source for re-initialization */
} ctr_prng_t;
err_status_t
diff --git a/thirdparties/win32/include/srtp/rand_source.h b/thirdparties/win32/include/srtp/rand_source.h
index b4c2110..d2e52ce 100755
--- a/thirdparties/win32/include/srtp/rand_source.h
+++ b/thirdparties/win32/include/srtp/rand_source.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -60,7 +60,7 @@ rand_source_init(void);
* and returns an error code. This error code should be checked,
* and if a failure is reported, the data in the buffer MUST NOT
* be used.
- *
+ *
* warning: If the return code is not checked, then non-random
* data may inadvertently be used.
*
@@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length);
err_status_t
rand_source_deinit(void);
-/*
+/*
* function prototype for a random source function
*
* A rand_source_func_t writes num_octets at the location indicated by
@@ -86,6 +86,6 @@ rand_source_deinit(void);
*/
typedef err_status_t (*rand_source_func_t)
- (void *dest, uint32_t num_octets);
+(void *dest, uint32_t num_octets);
#endif /* RAND_SOURCE */
diff --git a/thirdparties/win32/include/srtp/rdb.h b/thirdparties/win32/include/srtp/rdb.h
index 2ccb144..2432fae 100755
--- a/thirdparties/win32/include/srtp/rdb.h
+++ b/thirdparties/win32/include/srtp/rdb.h
@@ -21,11 +21,11 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
} rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8*sizeof(v128_t))
/*
* rdb init
@@ -49,7 +49,7 @@ rdb_init(rdb_t *rdb);
*/
err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+rdb_check(const rdb_t *rdb, uint32_t rdb_index);
/*
* rdb_add_index
@@ -64,18 +64,18 @@ err_status_t
rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions rdb_increment() and rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
* rdb_t upon which rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
+ *
* err_status_ok no problem
* err_status_key_expired sequence number too high
*
@@ -91,4 +91,4 @@ uint32_t
rdb_get_value(const rdb_t *rdb);
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
diff --git a/thirdparties/win32/include/srtp/rdbx.h b/thirdparties/win32/include/srtp/rdbx.h
index 146fb42..88055c2 100755
--- a/thirdparties/win32/include/srtp/rdbx.h
+++ b/thirdparties/win32/include/srtp/rdbx.h
@@ -14,7 +14,7 @@
#include "datatypes.h"
#include "err.h"
-/* #define ROC_TEST */
+/* #define ROC_TEST */
#ifndef ROC_TEST
@@ -33,7 +33,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
- * sequence number.
+ * sequence number.
*/
typedef uint64_t xtd_seq_num_t;
@@ -45,8 +45,8 @@ typedef uint64_t xtd_seq_num_t;
*/
typedef struct {
- xtd_seq_num_t index;
- bitvector_t bitmask;
+ xtd_seq_num_t index;
+ bitvector_t bitmask;
} rdbx_t;
@@ -73,7 +73,7 @@ rdbx_dealloc(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
- *
+ *
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
@@ -82,8 +82,8 @@ rdbx_dealloc(rdbx_t *rdbx);
int
rdbx_estimate_index(const rdbx_t *rdbx,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
@@ -98,7 +98,7 @@ rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
- *
+ *
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
@@ -116,7 +116,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta);
* to have the rollover counter value roc. If that value is less than
* the current rollover counter value, then the function returns
* err_status_replay_old; otherwise, err_status_ok is returned.
- *
+ *
*/
err_status_t
@@ -125,7 +125,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc);
/*
* rdbx_get_roc(rdbx) returns the value of the rollover counter for
* the rdbx_t pointed to by rdbx
- *
+ *
*/
xtd_seq_num_t
@@ -160,7 +160,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
- *
+ *
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
@@ -170,8 +170,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
int
index_guess(const xtd_seq_num_t *local,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
#endif /* RDBX_H */
diff --git a/thirdparties/win32/include/srtp/rtp.h b/thirdparties/win32/include/srtp/rtp.h
index 0e0119c..9b97ab6 100755
--- a/thirdparties/win32/include/srtp/rtp.h
+++ b/thirdparties/win32/include/srtp/rtp.h
@@ -1,6 +1,6 @@
/*
* rtp.h
- *
+ *
* rtp interface for srtp reference implementation
*
* David A. McGrew
@@ -15,26 +15,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -73,12 +73,12 @@ int
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
int
-rtp_receiver_init(rtp_receiver_t rcvr, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_receiver_init(rtp_receiver_t rcvr, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
int
-rtp_sender_init(rtp_sender_t sender, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_sender_init(rtp_sender_t sender, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
/*
* srtp_sender_init(...) initializes an rtp_sender_t
@@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
@@ -112,13 +112,13 @@ int
rtp_receiver_deinit_srtp(rtp_receiver_t sender);
-rtp_sender_t
+rtp_sender_t
rtp_sender_alloc(void);
void
rtp_sender_dealloc(rtp_sender_t rtp_ctx);
-rtp_receiver_t
+rtp_receiver_t
rtp_receiver_alloc(void);
void
@@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
*/
#define RTP_HEADER_LEN 12
-/*
+/*
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
*/
#define RTP_MAX_BUF_LEN 16384
diff --git a/thirdparties/win32/include/srtp/rtp_priv.h b/thirdparties/win32/include/srtp/rtp_priv.h
index 1421386..088cdbe 100755
--- a/thirdparties/win32/include/srtp/rtp_priv.h
+++ b/thirdparties/win32/include/srtp/rtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,22 +52,22 @@
typedef srtp_hdr_t rtp_hdr_t;
typedef struct {
- srtp_hdr_t header;
- char body[RTP_MAX_BUF_LEN];
+ srtp_hdr_t header;
+ char body[RTP_MAX_BUF_LEN];
} rtp_msg_t;
typedef struct rtp_sender_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* reciever's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* reciever's address */
} rtp_sender_ctx_t;
typedef struct rtp_receiver_ctx_t {
- rtp_msg_t message;
- int socket;
- srtp_ctx_t *srtp_ctx;
- struct sockaddr_in addr; /* receiver's address */
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* receiver's address */
} rtp_receiver_ctx_t;
diff --git a/thirdparties/win32/include/srtp/sha1.h b/thirdparties/win32/include/srtp/sha1.h
index 84d1c65..d0abeea 100755
--- a/thirdparties/win32/include/srtp/sha1.h
+++ b/thirdparties/win32/include/srtp/sha1.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -89,17 +89,17 @@ inline void sha1_final (sha1_ctx_t *ctx, uint32_t *output)
#include "datatypes.h"
typedef struct {
- uint32_t H[5]; /* state vector */
- uint32_t M[16]; /* message buffer */
- int octets_in_buffer; /* octets of message in buffer */
- uint32_t num_bits_in_msg; /* total number of bits in message */
+ uint32_t H[5]; /* state vector */
+ uint32_t M[16]; /* message buffer */
+ int octets_in_buffer; /* octets of message in buffer */
+ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/*
* sha1(&ctx, msg, len, output) hashes the len octets starting at msg
* into the SHA1 context, then writes the result to the 20 octets at
* output
- *
+ *
*/
void
@@ -107,10 +107,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/*
* sha1_init(&ctx) initializes the SHA1 context ctx
- *
+ *
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
- *
+ *
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
@@ -128,7 +128,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
- * setup algorithm.
+ * setup algorithm.
*/
/*
@@ -144,5 +144,5 @@ void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
#endif /* else OPENSSL */
-
+
#endif /* SHA1_H */
diff --git a/thirdparties/win32/include/srtp/srtp.h b/thirdparties/win32/include/srtp/srtp.h
index 48416d3..137baee 100755
--- a/thirdparties/win32/include/srtp/srtp.h
+++ b/thirdparties/win32/include/srtp/srtp.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,7 +51,7 @@ extern "C" {
#endif
#include <stdint.h>
-#include "crypto.h"
+#include "crypto.h"
#include "crypto_types.h"
#include "err.h"
@@ -79,7 +79,7 @@ extern "C" {
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
-#define SRTP_MAX_TAG_LEN 12
+#define SRTP_MAX_TAG_LEN 12
/**
* SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer
@@ -89,10 +89,10 @@ extern "C" {
*
* @brief the maximum number of octets added by srtp_protect().
*/
-#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
+#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
/*
- * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
+ * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
* GCM mode. GCM mode requires an IV. The SALT value is used
* as part of the IV formation logic applied to each RTP packet.
*/
@@ -103,83 +103,84 @@ extern "C" {
-/*
+/*
* nota bene: since libSRTP doesn't support the use of the MKI, the
* SRTP_MAX_TRAILER_LEN value is just the maximum tag length
*/
/**
- * @brief sec_serv_t describes a set of security services.
+ * @brief sec_serv_t describes a set of security services.
*
* A sec_serv_t enumeration is used to describe the particular
* security services that will be applied by a particular crypto
- * policy (or other mechanism).
+ * policy (or other mechanism).
*/
typedef enum {
- sec_serv_none = 0, /**< no services */
- sec_serv_conf = 1, /**< confidentiality */
- sec_serv_auth = 2, /**< authentication */
- sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
-} sec_serv_t;
+ sec_serv_none = 0, /**< no services */
+ sec_serv_conf = 1, /**< confidentiality */
+ sec_serv_auth = 2, /**< authentication */
+ sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
+}
+sec_serv_t;
-/**
+/**
* @brief crypto_policy_t describes a particular crypto policy that
* can be applied to an SRTP stream.
*
* A crypto_policy_t describes a particular cryptographic policy that
* can be applied to an SRTP or SRTCP stream. An SRTP session policy
- * consists of a list of these policies, one for each SRTP stream
+ * consists of a list of these policies, one for each SRTP stream
* in the session.
*/
typedef struct crypto_policy_t {
- cipher_type_id_t cipher_type; /**< An integer representing
+ cipher_type_id_t cipher_type; /**< An integer representing
* the type of cipher. */
- int cipher_key_len; /**< The length of the cipher key
+ int cipher_key_len; /**< The length of the cipher key
* in octets. */
- auth_type_id_t auth_type; /**< An integer representing the
+ auth_type_id_t auth_type; /**< An integer representing the
* authentication function. */
- int auth_key_len; /**< The length of the authentication
+ int auth_key_len; /**< The length of the authentication
* function key in octets. */
- int auth_tag_len; /**< The length of the authentication
+ int auth_tag_len; /**< The length of the authentication
* tag in octets. */
- sec_serv_t sec_serv; /**< The flag indicating the security
+ sec_serv_t sec_serv; /**< The flag indicating the security
* services to be applied. */
} crypto_policy_t;
-/**
+/**
* @brief ssrc_type_t describes the type of an SSRC.
- *
+ *
* An ssrc_type_t enumeration is used to indicate a type of SSRC. See
* @ref srtp_policy_t for more informataion.
*/
-typedef enum {
- ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
- ssrc_specific = 1, /**< Indicates a specific SSRC value */
- ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
+typedef enum {
+ ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
+ ssrc_specific = 1, /**< Indicates a specific SSRC value */
+ ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
(i.e. a value that is used in the
function srtp_unprotect()) */
- ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
- (i.e. a value that is used in the
+ ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
+ (i.e. a value that is used in the
function srtp_protect()) */
} ssrc_type_t;
/**
* @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
- *
+ *
* An ssrc_t represents a particular SSRC value (if its type is
* ssrc_specific), or a wildcard SSRC value that will match all
* outbound SSRCs (if its type is ssrc_any_outbound) or all inbound
- * SSRCs (if its type is ssrc_any_inbound).
+ * SSRCs (if its type is ssrc_any_inbound).
*
*/
-typedef struct {
- ssrc_type_t type; /**< The type of this particular SSRC */
- unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
+typedef struct {
+ ssrc_type_t type; /**< The type of this particular SSRC */
+ unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
} ssrc_t;
@@ -195,8 +196,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t;
typedef struct ekt_stream_ctx_t *ekt_stream_t;
-/**
- * @brief represents the policy for an SRTP session.
+/**
+ * @brief represents the policy for an SRTP session.
*
* A single srtp_policy_t struct represents the policy for a single
* SRTP stream, and a linked list of these elements represents the
@@ -205,7 +206,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* master key for that stream, the SSRC describing that stream, or a
* flag indicating a `wildcard' SSRC value, and a `next' field that
* holds a pointer to the next element in the list of policy elements,
- * or NULL if it is the last element.
+ * or NULL if it is the last element.
*
* The wildcard value SSRC_ANY_INBOUND matches any SSRC from an
* inbound stream that for which there is no explicit SSRC entry in
@@ -216,33 +217,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* is intentional, and it allows libSRTP to ensure that no security
* lapses result from accidental re-use of SSRC values during key
* sharing.
- *
- *
+ *
+ *
* @warning The final element of the list @b must have its `next' pointer
* set to NULL.
*/
typedef struct srtp_policy_t {
- ssrc_t ssrc; /**< The SSRC value of stream, or the
- * flags SSRC_ANY_INBOUND or
+ ssrc_t ssrc; /**< The SSRC value of stream, or the
+ * flags SSRC_ANY_INBOUND or
* SSRC_ANY_OUTBOUND if key sharing
* is used for this policy element.
*/
- crypto_policy_t rtp; /**< SRTP crypto policy. */
- crypto_policy_t rtcp; /**< SRTCP crypto policy. */
- unsigned char *key; /**< Pointer to the SRTP master key for
+ crypto_policy_t rtp; /**< SRTP crypto policy. */
+ crypto_policy_t rtcp; /**< SRTCP crypto policy. */
+ unsigned char *key; /**< Pointer to the SRTP master key for
* this stream. */
- ekt_policy_t ekt; /**< Pointer to the EKT policy structure
- * for this stream (if any) */
- unsigned long window_size; /**< The window size to use for replay
+ ekt_policy_t ekt; /**< Pointer to the EKT policy structure
+ * for this stream (if any) */
+ unsigned long window_size; /**< The window size to use for replay
* protection. */
- int allow_repeat_tx; /**< Whether retransmissions of
+ int allow_repeat_tx; /**< Whether retransmissions of
* packets with the same sequence number
* are allowed. (Note that such repeated
* transmissions must have the same RTP
* payload, or a severe security weakness
* is introduced!) */
- struct srtp_policy_t *next; /**< Pointer to next stream policy. */
+ struct srtp_policy_t *next; /**< Pointer to next stream policy. */
} srtp_policy_t;
@@ -252,7 +253,7 @@ typedef struct srtp_policy_t {
* @brief An srtp_t points to an SRTP session structure.
*
* The typedef srtp_t is a pointer to a structure that represents
- * an SRTP session. This datatype is intentially opaque in
+ * an SRTP session. This datatype is intentially opaque in
* order to separate the interface from the implementation.
*
* An SRTP session consists of all of the traffic sent to the RTP and
@@ -269,11 +270,11 @@ typedef struct srtp_ctx_t *srtp_t;
*
* The typedef srtp_stream_t is a pointer to a structure that
* represents an SRTP stream. This datatype is intentionally
- * opaque in order to separate the interface from the implementation.
- *
+ * opaque in order to separate the interface from the implementation.
+ *
* An SRTP stream consists of all of the traffic sent to an SRTP
* session by a single participant. A session can be viewed as
- * a set of streams.
+ * a set of streams.
*
*/
typedef struct srtp_stream_ctx_t *srtp_stream_t;
@@ -281,7 +282,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t;
/**
- * @brief srtp_init() initializes the srtp library.
+ * @brief srtp_init() initializes the srtp library.
*
* @warning This function @b must be called before any other srtp
* functions.
@@ -302,14 +303,14 @@ srtp_shutdown(void);
/**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
- *
+ *
* The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP
* protection to the RTP packet rtp_hdr (which has length *len_ptr) using
* the SRTP context ctx. If err_status_ok is returned, then rtp_hdr
* points to the resulting SRTP packet and *len_ptr is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
- *
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
@@ -319,11 +320,11 @@ srtp_shutdown(void);
* packet, and assumes that the RTP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
- * into the location in memory immediately following the RTP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
+ * into the location in memory immediately following the RTP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtp_hdr is a pointer to the RTP packet (before the call); after
@@ -334,7 +335,7 @@ srtp_shutdown(void);
* complete SRTP packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok no problems
* - err_status_replay_fail rtp sequence number was non-increasing
* - @e other failure in cryptographic mechanisms
@@ -342,7 +343,7 @@ srtp_shutdown(void);
err_status_t
srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
-
+
/**
* @brief srtp_unprotect() is the Secure RTP receiver-side packet
* processing function.
@@ -353,12 +354,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* err_status_ok is returned, then srtp_hdr points to the resulting
* RTP packet and *len_ptr is the number of octets in that packet;
* otherwise, no assumptions should be made about the value of either
- * data elements.
- *
+ * data elements.
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
- *
+ *
* @warning This function assumes that the SRTP packet is aligned on a
* 32-bit boundary.
*
@@ -374,9 +375,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* complete rtp packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTP packet is valid.
- * - err_status_auth_fail if the SRTP packet failed the message
+ * - err_status_auth_fail if the SRTP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has
* already been processed and accepted).
@@ -397,14 +398,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
*
* @param session is a pointer to the SRTP session to which the policy is
* to be added.
- *
+ *
* @param policy is the srtp_policy_t struct that describes the policy
* for the session. The struct may be a single element, or it may be
* the head of a list, in which case each element of the list is
* processed. It may also be NULL, in which case streams should be added
* later using srtp_add_stream(). The final element of the list @b must
* have its `next' field set to NULL.
- *
+ *
* @return
* - err_status_ok if creation succeded.
* - err_status_alloc_fail if allocation failed.
@@ -418,7 +419,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
/**
* @brief srtp_add_stream() allocates and initializes an SRTP stream
* within a given SRTP session.
- *
+ *
* The function call srtp_add_stream(session, policy) allocates and
* initializes a new SRTP stream within a given, previously created
* session, applying the policy given as the other argument to that
@@ -431,13 +432,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
*/
err_status_t
-srtp_add_stream(srtp_t session,
- const srtp_policy_t *policy);
+srtp_add_stream(srtp_t session,
+ const srtp_policy_t *policy);
/**
* @brief srtp_remove_stream() deallocates an SRTP stream.
- *
+ *
* The function call srtp_remove_stream(session, ssrc) removes
* the SRTP stream with the SSRC value ssrc from the SRTP session
* context given by the argument session.
@@ -449,7 +450,7 @@ srtp_add_stream(srtp_t session,
*
* @warning Wildcard SSRC values cannot be removed from a
* session.
- *
+ *
* @return
* - err_status_ok if the stream deallocation succeded.
* - [other] otherwise.
@@ -463,8 +464,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* @brief crypto_policy_set_rtp_default() sets a crypto policy
* structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTP
* protection, as defined in the specification. This function is a
@@ -473,9 +474,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -485,8 +486,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* @brief crypto_policy_set_rtcp_default() sets a crypto policy
* structure to the SRTP default policy for RTCP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTCP
* protection, as defined in the specification. This function is a
@@ -495,9 +496,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -507,15 +508,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto
* policy structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a
* synonym for crypto_policy_set_rtp_default(). It conforms to the
* naming convention used in RFC 4568 (SDP Security Descriptions for
* Media Streams).
- *
+ *
* @return void.
- *
+ *
*/
#define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p)
@@ -525,8 +526,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto
* policy structure to a short-authentication tag policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568.
@@ -536,7 +537,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -549,7 +550,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -561,14 +562,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto
* policy structure to an encryption-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Counter Mode), but to use no authentication method. This
* policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5
* of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -580,7 +581,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -591,14 +592,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto
* policy structure to an authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80
* bit authentication tag to provide message authentication, but to
* use no encryption. This policy is NOT RECOMMENDED for SRTP unless
- * there is a requirement to forego encryption.
- *
+ * there is a requirement to forego encryption.
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -606,10 +607,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @warning This policy is NOT RECOMMENDED for SRTP unless there is a
- * requirement to forego encryption.
+ * requirement to forego encryption.
*
* @return void.
- *
+ *
*/
void
@@ -618,18 +619,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
/**
* @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto
- * policy structure to a encryption and authentication policy using AES-256
+ * policy structure to a encryption and authentication policy using AES-256
* for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_80 as defined in
* draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256
* Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit
* authentication tag.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -637,7 +638,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
@@ -648,8 +649,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* policy structure to a short-authentication tag policy using AES-256
* encryption.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_32 as defined in
@@ -659,7 +660,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -672,7 +673,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -710,14 +711,14 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -725,7 +726,7 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
@@ -734,14 +735,14 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -749,7 +750,7 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
@@ -758,14 +759,14 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -773,7 +774,7 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
@@ -782,14 +783,14 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -797,7 +798,7 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
@@ -806,14 +807,14 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_16_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -821,7 +822,7 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
@@ -830,14 +831,14 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_16_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -845,7 +846,7 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
@@ -854,7 +855,7 @@ crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
/**
* @brief srtp_dealloc() deallocates storage for an SRTP session
* context.
- *
+ *
* The function call srtp_dealloc(s) deallocates storage for the
* SRTP session context s. This function should be called no more
* than one time for each of the contexts allocated by the function
@@ -872,7 +873,7 @@ srtp_dealloc(srtp_t s);
/*
- * @brief identifies a particular SRTP profile
+ * @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters). These
@@ -880,13 +881,13 @@ srtp_dealloc(srtp_t s);
*/
typedef enum {
- srtp_profile_reserved = 0,
- srtp_profile_aes128_cm_sha1_80 = 1,
- srtp_profile_aes128_cm_sha1_32 = 2,
- srtp_profile_aes256_cm_sha1_80 = 3,
- srtp_profile_aes256_cm_sha1_32 = 4,
- srtp_profile_null_sha1_80 = 5,
- srtp_profile_null_sha1_32 = 6,
+ srtp_profile_reserved = 0,
+ srtp_profile_aes128_cm_sha1_80 = 1,
+ srtp_profile_aes128_cm_sha1_32 = 2,
+ srtp_profile_aes256_cm_sha1_80 = 3,
+ srtp_profile_aes256_cm_sha1_32 = 4,
+ srtp_profile_null_sha1_80 = 5,
+ srtp_profile_null_sha1_32 = 6,
} srtp_profile_t;
@@ -894,26 +895,26 @@ typedef enum {
* @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy
* structure to the appropriate value for RTP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
+ srtp_profile_t profile);
@@ -922,26 +923,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
* @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy
* structure to the appropriate value for RTCP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTCP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
+ srtp_profile_t profile);
/**
* @brief returns the master key length for a given SRTP profile
@@ -959,18 +960,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile);
/**
* @brief appends the salt to the key
*
- * The function call append_salt_to_key(k, klen, s, slen)
+ * The function call append_salt_to_key(k, klen, s, slen)
* copies the string s to the location at klen bytes following
- * the location k.
+ * the location k.
*
* @warning There must be at least bytes_in_salt + bytes_in_key bytes
* available at the location pointed to by key.
- *
+ *
*/
void
append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
- unsigned char *salt, unsigned int bytes_in_salt);
+ unsigned char *salt, unsigned int bytes_in_salt);
@@ -982,7 +983,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
/**
* @defgroup SRTCP Secure RTCP
- * @ingroup SRTP
+ * @ingroup SRTP
*
* @brief Secure RTCP functions are used to protect RTCP traffic.
*
@@ -990,36 +991,36 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* traffic in much the same way as it does RTP traffic. The function
* srtp_protect_rtcp() applies cryptographic protections to outbound
* RTCP packets, and srtp_unprotect_rtcp() verifies the protections on
- * inbound RTCP packets.
+ * inbound RTCP packets.
*
* A note on the naming convention: srtp_protect_rtcp() has an srtp_t
* as its first argument, and thus has `srtp_' as its prefix. The
- * trailing `_rtcp' indicates the protocol on which it acts.
- *
+ * trailing `_rtcp' indicates the protocol on which it acts.
+ *
* @{
*/
/**
* @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet
* processing function.
- *
+ *
* The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies
* SRTCP protection to the RTCP packet rtcp_hdr (which has length
* *len_ptr) using the SRTP session context ctx. If err_status_ok is
* returned, then rtp_hdr points to the resulting SRTCP packet and
* *len_ptr is the number of octets in that packet; otherwise, no
* assumptions should be made about the value of either data elements.
- *
+ *
* @warning This function assumes that it can write the authentication
* tag into the location in memory immediately following the RTCP
* packet, and assumes that the RTCP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
- * into the location in memory immediately following the RTCP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
+ * into the location in memory immediately following the RTCP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTCP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtcp_hdr is a pointer to the RTCP packet (before the call); after
@@ -1031,14 +1032,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* was returned. Otherwise, the value of the data to which it points
* is undefined.
*
- * @return
+ * @return
* - err_status_ok if there were no problems.
- * - [other] if there was a failure in
+ * - [other] if there was a failure in
* the cryptographic mechanisms.
*/
-
-err_status_t
+
+err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
/**
@@ -1052,7 +1053,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* to the resulting RTCP packet and *len_ptr is the number of octets
* in that packet; otherwise, no assumptions should be made about the
* value of either data elements.
- *
+ *
* @warning This function assumes that the SRTCP packet is aligned on a
* 32-bit boundary.
*
@@ -1070,9 +1071,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* returned. Otherwise, the value of the data to which it points is
* undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTCP packet is valid.
- * - err_status_auth_fail if the SRTCP packet failed the message
+ * - err_status_auth_fail if the SRTCP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTCP packet is a replay (e.g. has
* already been processed and accepted).
@@ -1080,7 +1081,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
*
*/
-err_status_t
+err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
/**
@@ -1142,10 +1143,10 @@ srtp_get_user_data(srtp_t ctx);
* @defgroup SRTPevents SRTP events and callbacks
* @ingroup SRTP
*
- * @brief libSRTP can use a user-provided callback function to
+ * @brief libSRTP can use a user-provided callback function to
* handle events.
*
- *
+ *
* libSRTP allows a user to provide a callback function to handle
* events that need to be dealt with outside of the data plane (see
* the enum srtp_event_t for a description of these events). Dealing
@@ -1166,8 +1167,8 @@ srtp_get_user_data(srtp_t ctx);
* @brief srtp_event_t defines events that need to be handled
*
* The enum srtp_event_t defines events that need to be handled
- * outside the `data plane', such as SSRC collisions and
- * key expirations.
+ * outside the `data plane', such as SSRC collisions and
+ * key expirations.
*
* When a key expires or the maximum number of packets has been
* reached, an SRTP stream will enter an `expired' state in which no
@@ -1180,33 +1181,33 @@ srtp_get_user_data(srtp_t ctx);
* latter case, all of the streams in the session will expire.
*/
-typedef enum {
- event_ssrc_collision, /**<
- * An SSRC collision occured.
+typedef enum {
+ event_ssrc_collision, /**<
+ * An SSRC collision occured.
*/
- event_key_soft_limit, /**< An SRTP stream reached the soft key
- * usage limit and will expire soon.
+ event_key_soft_limit, /**< An SRTP stream reached the soft key
+ * usage limit and will expire soon.
*/
- event_key_hard_limit, /**< An SRTP stream reached the hard
+ event_key_hard_limit, /**< An SRTP stream reached the hard
* key usage limit and has expired.
*/
- event_packet_index_limit /**< An SRTP stream reached the hard
- * packet limit (2^48 packets).
+ event_packet_index_limit /**< An SRTP stream reached the hard
+ * packet limit (2^48 packets).
*/
} srtp_event_t;
/**
- * @brief srtp_event_data_t is the structure passed as a callback to
+ * @brief srtp_event_data_t is the structure passed as a callback to
* the event handler function
*
* The struct srtp_event_data_t holds the data passed to the event
- * handler function.
+ * handler function.
*/
typedef struct srtp_event_data_t {
- srtp_t session; /**< The session in which the event happend. */
- srtp_stream_t stream; /**< The stream in which the event happend. */
- srtp_event_t event; /**< An enum indicating the type of event. */
+ srtp_t session; /**< The session in which the event happend. */
+ srtp_stream_t stream; /**< The stream in which the event happend. */
+ srtp_event_t event; /**< An enum indicating the type of event. */
} srtp_event_data_t;
/**
@@ -1224,7 +1225,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data);
/**
* @brief sets the event handler to the function supplied by the caller.
- *
+ *
* The function call srtp_install_event_handler(func) sets the event
* handler function to the value func. The value NULL is acceptable
* as an argument; in this case, events will be ignored rather than
@@ -1239,14 +1240,14 @@ err_status_t
srtp_install_event_handler(srtp_event_handler_func_t func);
/**
- * @brief Returns the version string of the library.
- *
+ * @brief Returns the version string of the library.
+ *
*/
const char *srtp_get_version_string(void);
/**
- * @brief Returns the numeric representation of the library version.
- *
+ * @brief Returns the numeric representation of the library version.
+ *
*/
unsigned int srtp_get_version(void);
diff --git a/thirdparties/win32/include/srtp/srtp_priv.h b/thirdparties/win32/include/srtp/srtp_priv.h
index 170df5b..f925c1f 100755
--- a/thirdparties/win32/include/srtp/srtp_priv.h
+++ b/thirdparties/win32/include/srtp/srtp_priv.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -64,56 +64,56 @@
* an srtp_hdr_t represents the srtp header
*
* in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
- *
+ *
* (note that this definition follows that of RFC 1889 Appendix A, but
* is not identical)
*/
-
+
#ifndef WORDS_BIGENDIAN
/*
* srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
- * this structure should be declared "unsigned int" instead of
+ * this structure should be declared "unsigned int" instead of
* "unsigned char", but doing so causes the MS compiler to not
* fully pack the bit fields.
*/
typedef struct {
- unsigned char cc:4; /* CSRC count */
- unsigned char x:1; /* header extension flag */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:7; /* payload type */
- unsigned char m:1; /* marker bit */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char x:1; /* header extension flag */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:7; /* payload type */
+ unsigned char m:1; /* marker bit */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char x:1; /* header extension flag */
- unsigned char cc:4; /* CSRC count */
- unsigned char m:1; /* marker bit */
- unsigned char pt:7; /* payload type */
- uint16_t seq; /* sequence number */
- uint32_t ts; /* timestamp */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char x:1; /* header extension flag */
+ unsigned char cc:4; /* CSRC count */
+ unsigned char m:1; /* marker bit */
+ unsigned char pt:7; /* payload type */
+ uint16_t seq; /* sequence number */
+ uint32_t ts; /* timestamp */
+ uint32_t ssrc; /* synchronization source */
} srtp_hdr_t;
#endif
typedef struct {
- uint16_t profile_specific; /* profile-specific info */
- uint16_t length; /* number of 32-bit words in extension */
+ uint16_t profile_specific; /* profile-specific info */
+ uint16_t length; /* number of 32-bit words in extension */
} srtp_hdr_xtnd_t;
/*
- * srtcp_hdr_t represents a secure rtcp header
+ * srtcp_hdr_t represents a secure rtcp header
*
* in this implementation, an srtcp header is assumed to be 32-bit
* alinged
@@ -122,53 +122,53 @@ typedef struct {
#ifndef WORDS_BIGENDIAN
typedef struct {
- unsigned char rc:5; /* reception report count */
- unsigned char p:1; /* padding flag */
- unsigned char version:2; /* protocol version */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char rc:5; /* reception report count */
+ unsigned char p:1; /* padding flag */
+ unsigned char version:2; /* protocol version */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int index:31; /* srtcp packet index in network order! */
- unsigned int e:1; /* encrypted? 1=yes */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int index:31; /* srtcp packet index in network order! */
+ unsigned int e:1; /* encrypted? 1=yes */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#else /* BIG_ENDIAN */
typedef struct {
- unsigned char version:2; /* protocol version */
- unsigned char p:1; /* padding flag */
- unsigned char rc:5; /* reception report count */
- unsigned char pt:8; /* payload type */
- uint16_t len; /* length */
- uint32_t ssrc; /* synchronization source */
+ unsigned char version:2; /* protocol version */
+ unsigned char p:1; /* padding flag */
+ unsigned char rc:5; /* reception report count */
+ unsigned char pt:8; /* payload type */
+ uint16_t len; /* length */
+ uint32_t ssrc; /* synchronization source */
} srtcp_hdr_t;
typedef struct {
- unsigned int version:2; /* protocol version */
- unsigned int p:1; /* padding flag */
- unsigned int count:5; /* varies by packet type */
- unsigned int pt:8; /* payload type */
- uint16_t length; /* len of uint32s of packet less header */
+ unsigned int version:2; /* protocol version */
+ unsigned int p:1; /* padding flag */
+ unsigned int count:5; /* varies by packet type */
+ unsigned int pt:8; /* payload type */
+ uint16_t length; /* len of uint32s of packet less header */
} rtcp_common_t;
typedef struct {
- unsigned int e:1; /* encrypted? 1=yes */
- unsigned int index:31; /* srtcp packet index */
- /* optional mikey/etc go here */
- /* and then the variable-length auth tag */
+ unsigned int e:1; /* encrypted? 1=yes */
+ unsigned int index:31; /* srtcp packet index */
+ /* optional mikey/etc go here */
+ /* and then the variable-length auth tag */
} srtcp_trailer_t;
#endif
/*
- * the following declarations are libSRTP internal functions
+ * the following declarations are libSRTP internal functions
*/
/*
@@ -176,7 +176,7 @@ typedef struct {
* to ssrc, or NULL if no stream exists for that ssrc
*/
-srtp_stream_t
+srtp_stream_t
srtp_get_stream(srtp_t srtp, uint32_t ssrc);
@@ -190,49 +190,49 @@ err_status_t
srtp_stream_init_keys(srtp_stream_t srtp, const void *key);
/*
- * srtp_stream_init(s, p) initializes the srtp_stream_t s to
+ * srtp_stream_init(s, p) initializes the srtp_stream_t s to
* use the policy at the location p
*/
err_status_t
-srtp_stream_init(srtp_stream_t srtp,
- const srtp_policy_t *p);
+srtp_stream_init(srtp_stream_t srtp,
+ const srtp_policy_t *p);
/*
- * libsrtp internal datatypes
+ * libsrtp internal datatypes
*/
-typedef enum direction_t {
- dir_unknown = 0,
- dir_srtp_sender = 1,
- dir_srtp_receiver = 2
+typedef enum direction_t {
+ dir_unknown = 0,
+ dir_srtp_sender = 1,
+ dir_srtp_receiver = 2
} direction_t;
-/*
+/*
* an srtp_stream_t has its own SSRC, encryption key, authentication
* key, sequence number, and replay database
- *
+ *
* note that the keys might not actually be unique, in which case the
* cipher_t and auth_t pointers will point to the same structures
*/
typedef struct srtp_stream_ctx_t {
- uint32_t ssrc;
- cipher_t *rtp_cipher;
- auth_t *rtp_auth;
- rdbx_t rtp_rdbx;
- sec_serv_t rtp_services;
- cipher_t *rtcp_cipher;
- auth_t *rtcp_auth;
- rdb_t rtcp_rdb;
- sec_serv_t rtcp_services;
- key_limit_ctx_t *limit;
- direction_t direction;
- int allow_repeat_tx;
- ekt_stream_t ekt;
- uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */
- uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */
- struct srtp_stream_ctx_t *next; /* linked list of streams */
+ uint32_t ssrc;
+ cipher_t *rtp_cipher;
+ auth_t *rtp_auth;
+ rdbx_t rtp_rdbx;
+ sec_serv_t rtp_services;
+ cipher_t *rtcp_cipher;
+ auth_t *rtcp_auth;
+ rdb_t rtcp_rdb;
+ sec_serv_t rtcp_services;
+ key_limit_ctx_t *limit;
+ direction_t direction;
+ int allow_repeat_tx;
+ ekt_stream_t ekt;
+ uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */
+ uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */
+ struct srtp_stream_ctx_t *next; /* linked list of streams */
} srtp_stream_ctx_t;
@@ -241,9 +241,9 @@ typedef struct srtp_stream_ctx_t {
*/
typedef struct srtp_ctx_t {
- srtp_stream_ctx_t *stream_list; /* linked list of streams */
- srtp_stream_ctx_t *stream_template; /* act as template for other streams */
- void *user_data; /* user custom data */
+ srtp_stream_ctx_t *stream_list; /* linked list of streams */
+ srtp_stream_ctx_t *stream_template; /* act as template for other streams */
+ void *user_data; /* user custom data */
} srtp_ctx_t;
@@ -252,7 +252,7 @@ typedef struct srtp_ctx_t {
* srtp_handle_event(srtp, srtm, evnt) calls the event handling
* function, if there is one.
*
- * This macro is not included in the documentation as it is
+ * This macro is not included in the documentation as it is
* an internal-only function.
*/
@@ -263,7 +263,7 @@ typedef struct srtp_ctx_t {
data.stream = strm; \
data.event = evnt; \
srtp_event_handler(&data); \
-}
+}
#endif /* SRTP_PRIV_H */
diff --git a/thirdparties/win32/include/srtp/stat.h b/thirdparties/win32/include/srtp/stat.h
index e28b131..a67a380 100755
--- a/thirdparties/win32/include/srtp/stat.h
+++ b/thirdparties/win32/include/srtp/stat.h
@@ -1,6 +1,6 @@
/*
* stats.h
- *
+ *
* interface to statistical test functions
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright(c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/win32/include/srtp/ut_sim.h b/thirdparties/win32/include/srtp/ut_sim.h
index c25feeb..bd7d015 100755
--- a/thirdparties/win32/include/srtp/ut_sim.h
+++ b/thirdparties/win32/include/srtp/ut_sim.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,12 +54,12 @@
#define UT_BUF 160 /* maximum amount of packet reorder */
typedef struct {
- uint32_t index;
- uint32_t buffer[UT_BUF];
+ uint32_t index;
+ uint32_t buffer[UT_BUF];
} ut_connection;
/*
- * ut_init(&u) initializes the ut_connection
+ * ut_init(&u) initializes the ut_connection
*
* this function should always be the first one called on a new
* ut_connection
diff --git a/thirdparties/win32/include/srtp/xfm.h b/thirdparties/win32/include/srtp/xfm.h
index 5837149..a5e393f 100755
--- a/thirdparties/win32/include/srtp/xfm.h
+++ b/thirdparties/win32/include/srtp/xfm.h
@@ -2,7 +2,7 @@
* xfm.h
*
* interface for abstract crypto transform
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -28,12 +28,12 @@
* The function pointer xfm_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated only
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated only
*
- * @param clear_len length of data to be authenticated only
+ * @param clear_len length of data to be authenticated only
*
* @param iv location to write the Initialization Vector (IV)
*
@@ -45,38 +45,38 @@
* encrypted and authenticated (before the function call), and the
* length of the ciphertext (after the call)
*
- * @param auth_tag location to write auth tag
+ * @param auth_tag location to write auth tag
*/
-typedef err_status_t (*xfm_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len,
- void *auth_tag
- );
-
-typedef
+typedef err_status_t (*xfm_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len,
+ void *auth_tag
+);
+
+typedef
err_status_t (*xfm_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len, /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len, /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- void *auth_tag /* location of auth tag */
- );
+ void *auth_tag /* location of auth tag */
+);
typedef struct xfm_ctx_t {
- xfm_func_t func;
- xfm_inv_t inv;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
+ xfm_func_t func;
+ xfm_inv_t inv;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
} xfm_ctx_t;
typedef xfm_ctx_t *xfm_t;
@@ -89,35 +89,35 @@ typedef xfm_ctx_t *xfm_t;
/* cryptoalgo - 5/28 */
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *opaque,
- unsigned *opaque_len
- );
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *opaque,
+ unsigned *opaque_len
+);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
diff --git a/thirdparties/win32/include/stdint.h b/thirdparties/win32/include/stdint.h
index 89ff614..18249b0 100755
--- a/thirdparties/win32/include/stdint.h
+++ b/thirdparties/win32/include/stdint.h
@@ -1,32 +1,32 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
// Copyright (c) 2006-2008 Alexander Chemeris
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
-//
+//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
-//
+//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
+//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
@@ -76,19 +76,19 @@ extern "C" {
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
- typedef signed char int8_t;
- typedef signed short int16_t;
- typedef signed int int32_t;
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
- typedef unsigned int uint32_t;
+typedef signed char int8_t;
+typedef signed short int16_t;
+typedef signed int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
#else
- typedef signed __int8 int8_t;
- typedef signed __int16 int16_t;
- typedef signed __int32 int32_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
+typedef signed __int8 int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
@@ -116,11 +116,11 @@ typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
- typedef signed __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
+typedef signed __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
- typedef _W64 signed int intptr_t;
- typedef _W64 unsigned int uintptr_t;
+typedef _W64 signed int intptr_t;
+typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
diff --git a/thirdparties/win32/include/vpx/svc_context.h b/thirdparties/win32/include/vpx/svc_context.h
index f4933f8..9916fd4 100755
--- a/thirdparties/win32/include/vpx/svc_context.h
+++ b/thirdparties/win32/include/vpx/svc_context.h
@@ -24,29 +24,30 @@ extern "C" {
#endif
typedef enum SVC_ENCODING_MODE {
- INTER_LAYER_PREDICTION_I,
- ALT_INTER_LAYER_PREDICTION_IP,
- INTER_LAYER_PREDICTION_IP,
- USE_GOLDEN_FRAME
-} SVC_ENCODING_MODE;
+ INTER_LAYER_PREDICTION_I,
+ ALT_INTER_LAYER_PREDICTION_IP,
+ INTER_LAYER_PREDICTION_IP,
+ USE_GOLDEN_FRAME
+}
+SVC_ENCODING_MODE;
typedef enum SVC_LOG_LEVEL {
- SVC_LOG_ERROR,
- SVC_LOG_INFO,
- SVC_LOG_DEBUG
+ SVC_LOG_ERROR,
+ SVC_LOG_INFO,
+ SVC_LOG_DEBUG
} SVC_LOG_LEVEL;
typedef struct {
- // public interface to svc_command options
- int spatial_layers; // number of layers
- int first_frame_full_size; // set to one to force first frame full size
- SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
- SVC_LOG_LEVEL log_level; // amount of information to display
- int log_print; // when set, printf log messages instead of returning the
- // message with svc_get_message
-
- // private storage for vpx_svc_encode
- void *internal;
+ // public interface to svc_command options
+ int spatial_layers; // number of layers
+ int first_frame_full_size; // set to one to force first frame full size
+ SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
+ SVC_LOG_LEVEL log_level; // amount of information to display
+ int log_print; // when set, printf log messages instead of returning the
+ // message with svc_get_message
+
+ // private storage for vpx_svc_encode
+ void *internal;
} SvcContext;
/**
@@ -73,7 +74,7 @@ vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
* e.g., "4/16,5/16,7/16,11/16,16/16"
*/
vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx,
- const char *scale_factors);
+ const char *scale_factors);
/**
* initialize SVC encoding
@@ -117,9 +118,9 @@ void *vpx_svc_get_buffer(const SvcContext *svc_ctx);
* return spatial resolution of the specified layer
*/
vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
- int layer,
- unsigned int *width,
- unsigned int *height);
+ int layer,
+ unsigned int *width,
+ unsigned int *height);
/**
* return number of frames that have been encoded
*/
diff --git a/thirdparties/win32/include/vpx/vp8.h b/thirdparties/win32/include/vpx/vp8.h
index 056fa7a..3361ffc 100755
--- a/thirdparties/win32/include/vpx/vp8.h
+++ b/thirdparties/win32/include/vpx/vp8.h
@@ -42,21 +42,21 @@ extern "C" {
* The set of macros define the control functions of VP8 interface
*/
enum vp8_com_control_id {
- VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
- VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
- VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
- VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
- VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
- VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
- VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
+ VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
+ VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
+ VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
+ VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
+ VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
+ VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
+ VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
- /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
- * for its control ids. These should be migrated to something like the
- * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
- */
- VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
- VP8_COMMON_CTRL_ID_MAX,
- VP8_DECODER_CTRL_ID_START = 256
+ /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
+ * for its control ids. These should be migrated to something like the
+ * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
+ */
+ VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
+ VP8_COMMON_CTRL_ID_MAX,
+ VP8_DECODER_CTRL_ID_START = 256
};
/*!\brief post process flags
@@ -64,15 +64,15 @@ enum vp8_com_control_id {
* The set of macros define VP8 decoder post processing flags
*/
enum vp8_postproc_level {
- VP8_NOFILTERING = 0,
- VP8_DEBLOCK = 1 << 0,
- VP8_DEMACROBLOCK = 1 << 1,
- VP8_ADDNOISE = 1 << 2,
- VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
- VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
- VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
- VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
- VP8_MFQE = 1 << 10
+ VP8_NOFILTERING = 0,
+ VP8_DEBLOCK = 1 << 0,
+ VP8_DEMACROBLOCK = 1 << 1,
+ VP8_ADDNOISE = 1 << 2,
+ VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
+ VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
+ VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
+ VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
+ VP8_MFQE = 1 << 10
};
/*!\brief post process flags
@@ -83,9 +83,9 @@ enum vp8_postproc_level {
*/
typedef struct vp8_postproc_cfg {
- int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
- int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
- int noise_level; /**< the strength of additive noise, valid range [0, 16] */
+ int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
+ int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
+ int noise_level; /**< the strength of additive noise, valid range [0, 16] */
} vp8_postproc_cfg_t;
/*!\brief reference frame type
@@ -93,9 +93,9 @@ typedef struct vp8_postproc_cfg {
* The set of macros define the type of VP8 reference frames
*/
typedef enum vpx_ref_frame_type {
- VP8_LAST_FRAME = 1,
- VP8_GOLD_FRAME = 2,
- VP8_ALTR_FRAME = 4
+ VP8_LAST_FRAME = 1,
+ VP8_GOLD_FRAME = 2,
+ VP8_ALTR_FRAME = 4
} vpx_ref_frame_type_t;
/*!\brief reference frame data struct
@@ -103,8 +103,8 @@ typedef enum vpx_ref_frame_type {
* Define the data struct to access vp8 reference frames.
*/
typedef struct vpx_ref_frame {
- vpx_ref_frame_type_t frame_type; /**< which reference frame */
- vpx_image_t img; /**< reference frame data in image format */
+ vpx_ref_frame_type_t frame_type; /**< which reference frame */
+ vpx_image_t img; /**< reference frame data in image format */
} vpx_ref_frame_t;
/*!\brief VP9 specific reference frame data struct
@@ -112,8 +112,8 @@ typedef struct vpx_ref_frame {
* Define the data struct to access vp9 reference frames.
*/
typedef struct vp9_ref_frame {
- int idx; /**< frame index to get (input) */
- vpx_image_t img; /**< img structure to populate (output) */
+ int idx; /**< frame index to get (input) */
+ vpx_image_t img; /**< img structure to populate (output) */
} vp9_ref_frame_t;
/*!\brief vp8 decoder control function parameter type
diff --git a/thirdparties/win32/include/vpx/vp8cx.h b/thirdparties/win32/include/vpx/vp8cx.h
index c0424f1..17a0075 100755
--- a/thirdparties/win32/include/vpx/vp8cx.h
+++ b/thirdparties/win32/include/vpx/vp8cx.h
@@ -131,72 +131,72 @@ extern vpx_codec_iface_t *vpx_codec_vp9x_cx(void);
* \sa #vpx_codec_control
*/
enum vp8e_enc_control_id {
- VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
- VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
- VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
- VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
- VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
- VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
- /*!\brief control function to set vp8 encoder cpuused
- *
- * Changes in this value influences, among others, the encoder's selection
- * of motion estimation methods. Values greater than 0 will increase encoder
- * speed at the expense of quality.
- * The full set of adjustments can be found in
- * onyx_if.c:vp8_set_speed_features().
- * \todo List highlights of the changes at various levels.
- *
- * \note Valid range: -16..16
- */
- VP8E_SET_CPUUSED = 13,
- VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
- VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
- VP8E_SET_SHARPNESS, /**< control function to set sharpness */
- VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
- VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
- VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
+ VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
+ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
+ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
+ VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
+ VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
+ VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
+ /*!\brief control function to set vp8 encoder cpuused
+ *
+ * Changes in this value influences, among others, the encoder's selection
+ * of motion estimation methods. Values greater than 0 will increase encoder
+ * speed at the expense of quality.
+ * The full set of adjustments can be found in
+ * onyx_if.c:vp8_set_speed_features().
+ * \todo List highlights of the changes at various levels.
+ *
+ * \note Valid range: -16..16
+ */
+ VP8E_SET_CPUUSED = 13,
+ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
+ VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
+ VP8E_SET_SHARPNESS, /**< control function to set sharpness */
+ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
+ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
+ VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
encoder for the last frame using the internal
scale */
- VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
+ VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
encoder for the last frame, using the 0..63
scale as used by the rc_*_quantizer config
parameters */
- VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
- VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
- VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
- VP8E_SET_TUNING, /**< control function to set visual tuning */
- /*!\brief control function to set constrained quality level
- *
- * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
- * set to #VPX_CQ.
- * \note Valid range: 0..63
- */
- VP8E_SET_CQ_LEVEL,
-
- /*!\brief Max data rate for Intra frames
- *
- * This value controls additional clamping on the maximum size of a
- * keyframe. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * unlimited, or no additional clamping beyond the codec's built-in
- * algorithm.
- *
- * For example, to allocate no more than 4.5 frames worth of bitrate
- * to a keyframe, set this to 450.
- *
- */
- VP8E_SET_MAX_INTRA_BITRATE_PCT,
-
-
- /* TODO(jkoleszar): Move to vp9cx.h */
- VP9E_SET_LOSSLESS,
- VP9E_SET_TILE_COLUMNS,
- VP9E_SET_TILE_ROWS,
- VP9E_SET_FRAME_PARALLEL_DECODING,
- VP9E_SET_AQ_MODE,
-
- VP9E_SET_SVC,
- VP9E_SET_SVC_PARAMETERS
+ VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
+ VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
+ VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
+ VP8E_SET_TUNING, /**< control function to set visual tuning */
+ /*!\brief control function to set constrained quality level
+ *
+ * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
+ * set to #VPX_CQ.
+ * \note Valid range: 0..63
+ */
+ VP8E_SET_CQ_LEVEL,
+
+ /*!\brief Max data rate for Intra frames
+ *
+ * This value controls additional clamping on the maximum size of a
+ * keyframe. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * unlimited, or no additional clamping beyond the codec's built-in
+ * algorithm.
+ *
+ * For example, to allocate no more than 4.5 frames worth of bitrate
+ * to a keyframe, set this to 450.
+ *
+ */
+ VP8E_SET_MAX_INTRA_BITRATE_PCT,
+
+
+ /* TODO(jkoleszar): Move to vp9cx.h */
+ VP9E_SET_LOSSLESS,
+ VP9E_SET_TILE_COLUMNS,
+ VP9E_SET_TILE_ROWS,
+ VP9E_SET_FRAME_PARALLEL_DECODING,
+ VP9E_SET_AQ_MODE,
+
+ VP9E_SET_SVC,
+ VP9E_SET_SVC_PARAMETERS
};
/*!\brief vpx 1-D scaling mode
@@ -204,10 +204,10 @@ enum vp8e_enc_control_id {
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d {
- VP8E_NORMAL = 0,
- VP8E_FOURFIVE = 1,
- VP8E_THREEFIVE = 2,
- VP8E_ONETWO = 3
+ VP8E_NORMAL = 0,
+ VP8E_FOURFIVE = 1,
+ VP8E_THREEFIVE = 2,
+ VP8E_ONETWO = 3
} VPX_SCALING_MODE;
@@ -218,17 +218,17 @@ typedef enum vpx_scaling_mode_1d {
*/
typedef struct vpx_roi_map {
- /*! An id between 0 and 3 for each 16x16 region within a frame. */
- unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
- // TODO(paulwilkins): broken for VP9 which has 8 segments
- // q and loop filter deltas for each segment
- // (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
- /*! Static breakout threshold for each segment. */
- unsigned int static_threshold[4];
+ /*! An id between 0 and 3 for each 16x16 region within a frame. */
+ unsigned char *roi_map;
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
+ // TODO(paulwilkins): broken for VP9 which has 8 segments
+ // q and loop filter deltas for each segment
+ // (see MAX_MB_SEGMENTS)
+ int delta_q[4]; /**< Quantizer deltas. */
+ int delta_lf[4]; /**< Loop filter deltas. */
+ /*! Static breakout threshold for each segment. */
+ unsigned int static_threshold[4];
} vpx_roi_map_t;
/*!\brief vpx active region map
@@ -239,9 +239,9 @@ typedef struct vpx_roi_map {
typedef struct vpx_active_map {
- unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
- unsigned int rows; /**< number of rows */
- unsigned int cols; /**< number of cols */
+ unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
+ unsigned int rows; /**< number of rows */
+ unsigned int cols; /**< number of cols */
} vpx_active_map_t;
/*!\brief vpx image scaling mode
@@ -250,8 +250,8 @@ typedef struct vpx_active_map {
*
*/
typedef struct vpx_scaling_mode {
- VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
- VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
+ VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
+ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
/*!\brief VP8 token partition mode
@@ -262,10 +262,10 @@ typedef struct vpx_scaling_mode {
*/
typedef enum {
- VP8_ONE_TOKENPARTITION = 0,
- VP8_TWO_TOKENPARTITION = 1,
- VP8_FOUR_TOKENPARTITION = 2,
- VP8_EIGHT_TOKENPARTITION = 3
+ VP8_ONE_TOKENPARTITION = 0,
+ VP8_TWO_TOKENPARTITION = 1,
+ VP8_FOUR_TOKENPARTITION = 2,
+ VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
@@ -275,8 +275,8 @@ typedef enum {
*
*/
typedef enum {
- VP8_TUNE_PSNR,
- VP8_TUNE_SSIM
+ VP8_TUNE_PSNR,
+ VP8_TUNE_SSIM
} vp8e_tuning;
/*!\brief vp9 svc parameters
@@ -285,16 +285,16 @@ typedef enum {
*
*/
typedef struct vpx_svc_parameters {
- unsigned int width; /**< width of current spatial layer */
- unsigned int height; /**< height of current spatial layer */
- int layer; /**< current layer number - 0 = base */
- int flags; /**< encode frame flags */
- int max_quantizer; /**< max quantizer for current layer */
- int min_quantizer; /**< min quantizer for current layer */
- int distance_from_i_frame; /**< frame number within current gop */
- int lst_fb_idx; /**< last frame frame buffer index */
- int gld_fb_idx; /**< golden frame frame buffer index */
- int alt_fb_idx; /**< alt reference frame frame buffer index */
+ unsigned int width; /**< width of current spatial layer */
+ unsigned int height; /**< height of current spatial layer */
+ int layer; /**< current layer number - 0 = base */
+ int flags; /**< encode frame flags */
+ int max_quantizer; /**< max quantizer for current layer */
+ int min_quantizer; /**< min quantizer for current layer */
+ int distance_from_i_frame; /**< frame number within current gop */
+ int lst_fb_idx; /**< last frame frame buffer index */
+ int gld_fb_idx; /**< golden frame frame buffer index */
+ int alt_fb_idx; /**< alt reference frame frame buffer index */
} vpx_svc_parameters_t;
/*!\brief VP8 encoder control function parameter type
diff --git a/thirdparties/win32/include/vpx/vp8dx.h b/thirdparties/win32/include/vpx/vp8dx.h
index d3093c4..d96bf57 100755
--- a/thirdparties/win32/include/vpx/vp8dx.h
+++ b/thirdparties/win32/include/vpx/vp8dx.h
@@ -54,29 +54,29 @@ extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
* \sa #vpx_codec_control
*/
enum vp8_dec_control_id {
- /** control function to get info on which reference frames were updated
- * by the last decode
- */
- VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
+ /** control function to get info on which reference frames were updated
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
- /** check if the indicated frame is corrupted */
- VP8D_GET_FRAME_CORRUPTED,
+ /** check if the indicated frame is corrupted */
+ VP8D_GET_FRAME_CORRUPTED,
- /** control function to get info on which reference frames were used
- * by the last decode
- */
- VP8D_GET_LAST_REF_USED,
+ /** control function to get info on which reference frames were used
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_USED,
- /** decryption function to decrypt encoded buffer data immediately
- * before decoding. Takes a vp8_decrypt_init, which contains
- * a callback function and opaque context pointer.
- */
- VP8D_SET_DECRYPTOR,
+ /** decryption function to decrypt encoded buffer data immediately
+ * before decoding. Takes a vp8_decrypt_init, which contains
+ * a callback function and opaque context pointer.
+ */
+ VP8D_SET_DECRYPTOR,
- /** For testing. */
- VP9_INVERT_TILE_DECODE_ORDER,
+ /** For testing. */
+ VP9_INVERT_TILE_DECODE_ORDER,
- VP8_DECODER_CTRL_ID_MAX
+ VP8_DECODER_CTRL_ID_MAX
};
/*!\brief Structure to hold decryption state
diff --git a/thirdparties/win32/include/vpx/vpx_codec.h b/thirdparties/win32/include/vpx/vpx_codec.h
index 3ea36d6..ad1c08a 100755
--- a/thirdparties/win32/include/vpx/vpx_codec.h
+++ b/thirdparties/win32/include/vpx/vpx_codec.h
@@ -46,7 +46,7 @@ extern "C" {
#include "vpx_integer.h"
#include "vpx_image.h"
- /*!\brief Decorator indicating a function is deprecated */
+/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
#if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__ ((deprecated))
@@ -67,7 +67,7 @@ extern "C" {
#endif
#endif /* DECLSPEC_DEPRECATED */
- /*!\brief Decorator indicating a function is potentially unused */
+/*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED
#elif __GNUC__
#define UNUSED __attribute__ ((unused))
@@ -75,18 +75,18 @@ extern "C" {
#define UNUSED
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
- /*!\brief Algorithm return codes */
- typedef enum {
+/*!\brief Algorithm return codes */
+typedef enum {
/*!\brief Operation completed without error */
VPX_CODEC_OK,
@@ -138,247 +138,247 @@ extern "C" {
*/
VPX_CODEC_LIST_END
- }
- vpx_codec_err_t;
+}
+vpx_codec_err_t;
- /*! \brief Codec capabilities bitfield
- *
- * Each codec advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
- typedef long vpx_codec_caps_t;
+/*! \brief Codec capabilities bitfield
+ *
+ * Each codec advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
+typedef long vpx_codec_caps_t;
#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
#define VPX_CODEC_CAP_XMA 0x4 /**< Supports eXternal Memory Allocation */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
- typedef long vpx_codec_flags_t;
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
+typedef long vpx_codec_flags_t;
#define VPX_CODEC_USE_XMA 0x00000001 /**< Use eXternal Memory Allocation mode */
- /*!\brief Codec interface structure.
- *
- * Contains function pointers and other data private to the codec
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_codec_iface_t;
+/*!\brief Codec interface structure.
+ *
+ * Contains function pointers and other data private to the codec
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_codec_iface_t;
- /*!\brief Codec private data structure.
- *
- * Contains data private to the codec implementation. This structure is opaque
- * to the application.
- */
- typedef struct vpx_codec_priv vpx_codec_priv_t;
+/*!\brief Codec private data structure.
+ *
+ * Contains data private to the codec implementation. This structure is opaque
+ * to the application.
+ */
+typedef struct vpx_codec_priv vpx_codec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef const void *vpx_codec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef const void *vpx_codec_iter_t;
- /*!\brief Codec context structure
- *
- * All codecs \ref MUST support this context structure fully. In general,
- * this data should be considered private to the codec algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
- typedef struct vpx_codec_ctx {
+/*!\brief Codec context structure
+ *
+ * All codecs \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the codec algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
+typedef struct vpx_codec_ctx {
const char *name; /**< Printable interface name */
vpx_codec_iface_t *iface; /**< Interface pointers */
vpx_codec_err_t err; /**< Last returned error */
const char *err_detail; /**< Detailed info, if available */
vpx_codec_flags_t init_flags; /**< Flags passed at init time */
union {
- struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
- struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
- void *raw;
+ struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
+ struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
+ void *raw;
} config; /**< Configuration pointer aliasing union */
vpx_codec_priv_t *priv; /**< Algorithm private storage */
- } vpx_codec_ctx_t;
-
-
- /*
- * Library Version Number Interface
- *
- * For example, see the following sample return values:
- * vpx_codec_version() (1<<16 | 2<<8 | 3)
- * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
- * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
- */
-
- /*!\brief Return the version information (as an integer)
- *
- * Returns a packed encoding of the library version number. This will only include
- * the major.minor.patch component of the version number. Note that this encoded
- * value should be accessed through the macros provided, as the encoding may change
- * in the future.
- *
- */
- int vpx_codec_version(void);
+} vpx_codec_ctx_t;
+
+
+/*
+ * Library Version Number Interface
+ *
+ * For example, see the following sample return values:
+ * vpx_codec_version() (1<<16 | 2<<8 | 3)
+ * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
+ * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
+ */
+
+/*!\brief Return the version information (as an integer)
+ *
+ * Returns a packed encoding of the library version number. This will only include
+ * the major.minor.patch component of the version number. Note that this encoded
+ * value should be accessed through the macros provided, as the encoding may change
+ * in the future.
+ *
+ */
+int vpx_codec_version(void);
#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */
#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */
#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */
- /*!\brief Return the version major number */
+/*!\brief Return the version major number */
#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff)
- /*!\brief Return the version minor number */
+/*!\brief Return the version minor number */
#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff)
- /*!\brief Return the version patch number */
+/*!\brief Return the version patch number */
#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff)
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable string containing the full library version number. This may
- * contain additional text following the three digit version number, as to indicate
- * release candidates, prerelease versions, etc.
- *
- */
- const char *vpx_codec_version_str(void);
-
-
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable "extra string". This is the component of the string returned
- * by vpx_codec_version_str() following the three digit version number.
- *
- */
- const char *vpx_codec_version_extra_str(void);
-
-
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_codec_build_config(void);
-
-
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given codec interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
-
-
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_codec_err_to_string(vpx_codec_err_t err);
-
-
- /*!\brief Retrieve error synopsis for codec context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Retrieve detailed error information for codec context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
-
-
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all codecs.
- * They represent the base case functionality expected of all codecs.
- */
-
- /*!\brief Destroy a codec instance
- *
- * Destroys a codec context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_CODEC_OK
- * The codec algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
-
-
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the codec
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_CODEC_ERROR if the request could not
- * be dispatched.
- *
- * Note that this function should not be used directly. Call the
- * #vpx_codec_control wrapper macro instead.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- *
- * \retval #VPX_CODEC_OK
- * The control request was processed.
- * \retval #VPX_CODEC_ERROR
- * The control request was not processed.
- * \retval #VPX_CODEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
- int ctrl_id,
- ...);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable string containing the full library version number. This may
+ * contain additional text following the three digit version number, as to indicate
+ * release candidates, prerelease versions, etc.
+ *
+ */
+const char *vpx_codec_version_str(void);
+
+
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable "extra string". This is the component of the string returned
+ * by vpx_codec_version_str() following the three digit version number.
+ *
+ */
+const char *vpx_codec_version_extra_str(void);
+
+
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_codec_build_config(void);
+
+
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given codec interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
+
+
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_codec_err_to_string(vpx_codec_err_t err);
+
+
+/*!\brief Retrieve error synopsis for codec context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Retrieve detailed error information for codec context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+
+
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all codecs.
+ * They represent the base case functionality expected of all codecs.
+ */
+
+/*!\brief Destroy a codec instance
+ *
+ * Destroys a codec context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_CODEC_OK
+ * The codec algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
+
+
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the codec
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_CODEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * Note that this function should not be used directly. Call the
+ * #vpx_codec_control wrapper macro instead.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ *
+ * \retval #VPX_CODEC_OK
+ * The control request was processed.
+ * \retval #VPX_CODEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
+ int ctrl_id,
+ ...);
#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS
# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data)
# define VPX_CTRL_USE_TYPE(id, typ)
@@ -386,30 +386,30 @@ extern "C" {
# define VPX_CTRL_VOID(id, typ)
#else
- /*!\brief vpx_codec_control wrapper macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_().
- *
- * \internal
- * It works by dispatching the call to the control function through a wrapper
- * function named with the id parameter.
- */
+/*!\brief vpx_codec_control wrapper macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_().
+ *
+ * \internal
+ * It works by dispatching the call to the control function through a wrapper
+ * function named with the id parameter.
+ */
# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\
/**<\hideinitializer*/
- /*!\brief vpx_codec_control type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It defines the type of the argument for a given
- * control identifier.
- *
- * \internal
- * It defines a static function with
- * the correctly typed arguments as a wrapper to the type-unsafe internal
- * function.
- */
+/*!\brief vpx_codec_control type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It defines the type of the argument for a given
+ * control identifier.
+ *
+ * \internal
+ * It defines a static function with
+ * the correctly typed arguments as a wrapper to the type-unsafe internal
+ * function.
+ */
# define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\
@@ -420,16 +420,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control deprecated type definition macro
- *
- * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
- * deprecated and should not be used. Consult the documentation for your
- * codec for more information.
- *
- * \internal
- * It defines a static function with the correctly typed arguments as a
- * wrapper to the type-unsafe internal function.
- */
+/*!\brief vpx_codec_control deprecated type definition macro
+ *
+ * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
+ * deprecated and should not be used. Consult the documentation for your
+ * codec for more information.
+ *
+ * \internal
+ * It defines a static function with the correctly typed arguments as a
+ * wrapper to the type-unsafe internal function.
+ */
# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\
@@ -440,16 +440,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control void type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It indicates that a given control identifier takes
- * no argument.
- *
- * \internal
- * It defines a static function without a data argument as a wrapper to the
- * type-unsafe internal function.
- */
+/*!\brief vpx_codec_control void type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It indicates that a given control identifier takes
+ * no argument.
+ *
+ * \internal
+ * It defines a static function without a data argument as a wrapper to the
+ * type-unsafe internal function.
+ */
# define VPX_CTRL_VOID(id) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\
@@ -463,23 +463,23 @@ extern "C" {
#endif
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all codecs
- * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_INCAPABLE
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all codecs
+ * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_INCAPABLE
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the codec in the request phase, and by the calling
- * application once the requested allocation has been performed.
- */
- typedef struct vpx_codec_mmap {
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the codec in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
+typedef struct vpx_codec_mmap {
/*
* The following members are set by the codec when requesting a segment
*/
@@ -495,62 +495,62 @@ extern "C" {
void *base; /**< pointer to the allocated segment */
void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */
void *priv; /**< allocator private storage */
- } vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
-
-
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. In cases where the
- * stream is not available at allocation time, a fixed size must be requested.
- * The codec will not be able to operate on streams larger than the size used at
- * allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_CODEC_OK
- * The memory map entry was populated.
- * \retval #VPX_CODEC_ERROR
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmap,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Identify allocated segments to codec instance
- *
- * Stores a list of allocated segments in the codec. Segments \ref MUST be
- * passed in the order they are read from vpx_codec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_CODEC_OK
- * The segment was stored in the codec context.
- * \retval #VPX_CODEC_INCAPABLE
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
-
- */
- vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmaps,
- unsigned int num_maps);
-
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup codec*/
+} vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
+
+
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. In cases where the
+ * stream is not available at allocation time, a fixed size must be requested.
+ * The codec will not be able to operate on streams larger than the size used at
+ * allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_CODEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_CODEC_ERROR
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmap,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Identify allocated segments to codec instance
+ *
+ * Stores a list of allocated segments in the codec. Segments \ref MUST be
+ * passed in the order they are read from vpx_codec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_CODEC_OK
+ * The segment was stored in the codec context.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
+
+ */
+vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmaps,
+ unsigned int num_maps);
+
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup codec*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/win32/include/vpx/vpx_decoder.h b/thirdparties/win32/include/vpx/vpx_decoder.h
index 2dcd024..424849d 100755
--- a/thirdparties/win32/include/vpx/vpx_decoder.h
+++ b/thirdparties/win32/include/vpx/vpx_decoder.h
@@ -31,24 +31,24 @@ extern "C" {
#include "vpx_codec.h"
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Decoder capabilities bitfield
- *
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
@@ -57,13 +57,13 @@ extern "C" {
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames
one fragment at a time */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based
multi-threading */
@@ -76,257 +76,257 @@ extern "C" {
#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based
multi-threading */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
- typedef struct vpx_codec_stream_info {
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
+typedef struct vpx_codec_stream_info {
unsigned int sz; /**< Size of this structure */
unsigned int w; /**< Width (or 0 for unknown/default) */
unsigned int h; /**< Height (or 0 for unknown/default) */
unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_codec_stream_info_t;
+} vpx_codec_stream_info_t;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialization Configurations
- *
- * This structure is used to pass init time configuration options to the
- * decoder.
- */
- typedef struct vpx_codec_dec_cfg {
+/*!\brief Initialization Configurations
+ *
+ * This structure is used to pass init time configuration options to the
+ * decoder.
+ */
+typedef struct vpx_codec_dec_cfg {
unsigned int threads; /**< Maximum number of threads to use, default 1 */
unsigned int w; /**< Width */
unsigned int h; /**< Height */
- } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
-
-
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_codec_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
- /*!\brief Convenience macro for vpx_codec_dec_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
+
+
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_codec_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_dec_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+/*!\brief Convenience macro for vpx_codec_dec_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_dec_init(ctx, iface, cfg, flags) \
vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
- * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
- * time stamp) order. Frames produced will always be in PTS (presentation
- * time stamp) order.
- * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
- * data and data_sz can contain a fragment of the encoded frame. Fragment
- * \#n must contain at least partition \#n, but can also contain subsequent
- * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
- * be empty. When no more data is available, this function should be called
- * with NULL as data and 0 as data_sz. The memory passed to this function
- * must be available until the frame has been decoded.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] deadline Soft deadline the decoder should attempt to meet,
- * in us. Set to zero for unlimited.
- *
- * \return Returns #VPX_CODEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_codec_err_t
- * for recoverability capabilities.
- */
- vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
- const uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- long deadline);
-
-
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
-
-
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_frame_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_frame */
-
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
-
-
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_slice_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_slice*/
-
- /*!@} - end defgroup decoder*/
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
+ * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
+ * time stamp) order. Frames produced will always be in PTS (presentation
+ * time stamp) order.
+ * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
+ * data and data_sz can contain a fragment of the encoded frame. Fragment
+ * \#n must contain at least partition \#n, but can also contain subsequent
+ * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
+ * be empty. When no more data is available, this function should be called
+ * with NULL as data and 0 as data_sz. The memory passed to this function
+ * must be available until the frame has been decoded.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] deadline Soft deadline the decoder should attempt to meet,
+ * in us. Set to zero for unlimited.
+ *
+ * \return Returns #VPX_CODEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_codec_err_t
+ * for recoverability capabilities.
+ */
+vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
+ const uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ long deadline);
+
+
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
+
+
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_frame_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_frame */
+
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
+
+
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_slice_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_slice*/
+
+/*!@} - end defgroup decoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/win32/include/vpx/vpx_encoder.h b/thirdparties/win32/include/vpx/vpx_encoder.h
index 56752cf..8c9399a 100755
--- a/thirdparties/win32/include/vpx/vpx_encoder.h
+++ b/thirdparties/win32/include/vpx/vpx_encoder.h
@@ -31,18 +31,18 @@ extern "C" {
#include "vpx_codec.h"
- /*! Temporal Scalability: Maximum length of the sequence defining frame
- * layer membership
- */
+/*! Temporal Scalability: Maximum length of the sequence defining frame
+ * layer membership
+ */
#define VPX_TS_MAX_PERIODICITY 16
- /*! Temporal Scalability: Maximum number of coding layers */
+/*! Temporal Scalability: Maximum number of coding layers */
#define VPX_TS_MAX_LAYERS 5
- /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
+/*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
- /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
+/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
#define MAX_LAYERS VPX_TS_MAX_LAYERS
/*! Spatial Scalability: Maximum number of coding layers */
@@ -51,74 +51,74 @@ extern "C" {
/*! Spatial Scalability: Default number of coding layers */
#define VPX_SS_DEFAULT_LAYERS 3
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Encoder capabilities bitfield
- *
- * Each encoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra
- * interfaces or functionality, and are not required to be supported
- * by an encoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Encoder capabilities bitfield
+ *
+ * Each encoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra
+ * interfaces or functionality, and are not required to be supported
+ * by an encoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
- /*! Can output one partition at a time. Each partition is returned in its
- * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
- * every partition but the last. In this mode all frames are always
- * returned partition by partition.
- */
+/*! Can output one partition at a time. Each partition is returned in its
+ * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
+ * every partition but the last. In this mode all frames are always
+ * returned partition by partition.
+ */
#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow
- * for proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow
+ * for proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one
partition at a time. */
- /*!\brief Generic fixed size buffer structure
- *
- * This structure is able to hold a reference to any fixed size buffer.
- */
- typedef struct vpx_fixed_buf {
+/*!\brief Generic fixed size buffer structure
+ *
+ * This structure is able to hold a reference to any fixed size buffer.
+ */
+typedef struct vpx_fixed_buf {
void *buf; /**< Pointer to the data */
size_t sz; /**< Length of the buffer, in chars */
- } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
+} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
- /*!\brief Time Stamp Type
- *
- * An integer, which when multiplied by the stream's time base, provides
- * the absolute time of a sample.
- */
- typedef int64_t vpx_codec_pts_t;
+/*!\brief Time Stamp Type
+ *
+ * An integer, which when multiplied by the stream's time base, provides
+ * the absolute time of a sample.
+ */
+typedef int64_t vpx_codec_pts_t;
- /*!\brief Compressed Frame Flags
- *
- * This type represents a bitfield containing information about a compressed
- * frame that may be useful to an application. The most significant 16 bits
- * can be used by an algorithm to provide additional detail, for example to
- * support frame types that are codec specific (MPEG-1 D-frames for example)
- */
- typedef uint32_t vpx_codec_frame_flags_t;
+/*!\brief Compressed Frame Flags
+ *
+ * This type represents a bitfield containing information about a compressed
+ * frame that may be useful to an application. The most significant 16 bits
+ * can be used by an algorithm to provide additional detail, for example to
+ * support frame types that are codec specific (MPEG-1 D-frames for example)
+ */
+typedef uint32_t vpx_codec_frame_flags_t;
#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */
#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting
the stream (no future frame depends on
@@ -128,13 +128,13 @@ extern "C" {
#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded
frame */
- /*!\brief Error Resilient flags
- *
- * These flags define which error resilient features to enable in the
- * encoder. The flags are specified through the
- * vpx_codec_enc_cfg::g_error_resilient variable.
- */
- typedef uint32_t vpx_codec_er_flags_t;
+/*!\brief Error Resilient flags
+ *
+ * These flags define which error resilient features to enable in the
+ * encoder. The flags are specified through the
+ * vpx_codec_enc_cfg::g_error_resilient variable.
+ */
+typedef uint32_t vpx_codec_er_flags_t;
#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against
losses of whole frames */
#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are
@@ -146,122 +146,122 @@ extern "C" {
predicition is still done over
the partition boundary. */
- /*!\brief Encoder output packet variants
- *
- * This enumeration lists the different kinds of data packets that can be
- * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
- * extend this list to provide additional functionality.
- */
- enum vpx_codec_cx_pkt_kind {
+/*!\brief Encoder output packet variants
+ *
+ * This enumeration lists the different kinds of data packets that can be
+ * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
+ * extend this list to provide additional functionality.
+ */
+enum vpx_codec_cx_pkt_kind {
VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
- };
+};
- /*!\brief Encoder output packet
- *
- * This structure contains the different kinds of output data the encoder
- * may produce while compressing a frame.
- */
- typedef struct vpx_codec_cx_pkt {
+/*!\brief Encoder output packet
+ *
+ * This structure contains the different kinds of output data the encoder
+ * may produce while compressing a frame.
+ */
+typedef struct vpx_codec_cx_pkt {
enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
union {
- struct {
- void *buf; /**< compressed data buffer */
- size_t sz; /**< length of compressed data */
- vpx_codec_pts_t pts; /**< time stamp to show frame
+ struct {
+ void *buf; /**< compressed data buffer */
+ size_t sz; /**< length of compressed data */
+ vpx_codec_pts_t pts; /**< time stamp to show frame
(in timebase units) */
- unsigned long duration; /**< duration to show frame
+ unsigned long duration; /**< duration to show frame
(in timebase units) */
- vpx_codec_frame_flags_t flags; /**< flags for this frame */
- int partition_id; /**< the partition id
+ vpx_codec_frame_flags_t flags; /**< flags for this frame */
+ int partition_id; /**< the partition id
defines the decoding order
of the partitions. Only
applicable when "output partition"
mode is enabled. First partition
has id 0.*/
- } frame; /**< data for compressed frame packet */
- struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
- struct vpx_psnr_pkt {
- unsigned int samples[4]; /**< Number of samples, total/y/u/v */
- uint64_t sse[4]; /**< sum squared error, total/y/u/v */
- double psnr[4]; /**< PSNR, total/y/u/v */
- } psnr; /**< data for PSNR packet */
- struct vpx_fixed_buf raw; /**< data for arbitrary packets */
-
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
+ } frame; /**< data for compressed frame packet */
+ struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
+ struct vpx_psnr_pkt {
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
+ double psnr[4]; /**< PSNR, total/y/u/v */
+ } psnr; /**< data for PSNR packet */
+ struct vpx_fixed_buf raw; /**< data for arbitrary packets */
+
+ /* This packet size is fixed to allow codecs to extend this
+ * interface without having to manage storage for raw packets,
+ * i.e., if it's smaller than 128 bytes, you can store in the
+ * packet list directly.
+ */
+ char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
} data; /**< packet data */
- } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
+} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
- /*!\brief Rational Number
- *
- * This structure holds a fractional value.
- */
- typedef struct vpx_rational {
+/*!\brief Rational Number
+ *
+ * This structure holds a fractional value.
+ */
+typedef struct vpx_rational {
int num; /**< fraction numerator */
int den; /**< fraction denominator */
- } vpx_rational_t; /**< alias for struct vpx_rational */
+} vpx_rational_t; /**< alias for struct vpx_rational */
- /*!\brief Multi-pass Encoding Pass */
- enum vpx_enc_pass {
+/*!\brief Multi-pass Encoding Pass */
+enum vpx_enc_pass {
VPX_RC_ONE_PASS, /**< Single pass mode */
VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
- };
+};
- /*!\brief Rate control mode */
- enum vpx_rc_mode {
+/*!\brief Rate control mode */
+enum vpx_rc_mode {
VPX_VBR, /**< Variable Bit Rate (VBR) mode */
VPX_CBR, /**< Constant Bit Rate (CBR) mode */
VPX_CQ, /**< Constrained Quality (CQ) mode */
VPX_Q, /**< Constant Quality (Q) mode */
- };
-
-
- /*!\brief Keyframe placement mode.
- *
- * This enumeration determines whether keyframes are placed automatically by
- * the encoder or whether this behavior is disabled. Older releases of this
- * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
- * This name is confusing for this behavior, so the new symbols to be used
- * are VPX_KF_AUTO and VPX_KF_DISABLED.
- */
- enum vpx_kf_mode {
+};
+
+
+/*!\brief Keyframe placement mode.
+ *
+ * This enumeration determines whether keyframes are placed automatically by
+ * the encoder or whether this behavior is disabled. Older releases of this
+ * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
+ * This name is confusing for this behavior, so the new symbols to be used
+ * are VPX_KF_AUTO and VPX_KF_DISABLED.
+ */
+enum vpx_kf_mode {
VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
- };
+};
- /*!\brief Encoded Frame Flags
- *
- * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
- * per-frame boolean values. By convention, bits common to all codecs will be
- * named VPX_EFLAG_*, and bits specific to an algorithm will be named
- * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
- */
- typedef long vpx_enc_frame_flags_t;
+/*!\brief Encoded Frame Flags
+ *
+ * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
+ * per-frame boolean values. By convention, bits common to all codecs will be
+ * named VPX_EFLAG_*, and bits specific to an algorithm will be named
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
+ */
+typedef long vpx_enc_frame_flags_t;
#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */
- /*!\brief Encoder configuration structure
- *
- * This structure contains the encoder settings that have common representations
- * across all codecs. This doesn't imply that all codecs support all features,
- * however.
- */
- typedef struct vpx_codec_enc_cfg {
+/*!\brief Encoder configuration structure
+ *
+ * This structure contains the encoder settings that have common representations
+ * across all codecs. This doesn't imply that all codecs support all features,
+ * however.
+ */
+typedef struct vpx_codec_enc_cfg {
/*
* generic settings (g)
*/
@@ -646,146 +646,146 @@ extern "C" {
* then ts_layer_id = (0,1,0,1,0,1,0,1).
*/
unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
- } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
-
-
- /*!\brief Initialize an encoder instance
- *
- * Initializes a encoder context using the given interface. Applications
- * should call the vpx_codec_enc_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+
+
+/*!\brief Initialize an encoder instance
+ *
+ * Initializes a encoder context using the given interface. Applications
+ * should call the vpx_codec_enc_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init(ctx, iface, cfg, flags) \
vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
- /*!\brief Initialize multi-encoder instance
- *
- * Initializes multi-encoder context using the given interface.
- * Applications should call the vpx_codec_enc_init_multi convenience macro
- * instead of this function directly, to ensure that the ABI version number
- * parameter is properly initialized.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] num_enc Total number of encoders.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] dsf Pointer to down-sampling factors.
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- int num_enc,
- vpx_codec_flags_t flags,
- vpx_rational_t *dsf,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Initialize multi-encoder instance
+ *
+ * Initializes multi-encoder context using the given interface.
+ * Applications should call the vpx_codec_enc_init_multi convenience macro
+ * instead of this function directly, to ensure that the ABI version number
+ * parameter is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] num_enc Total number of encoders.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] dsf Pointer to down-sampling factors.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ int num_enc,
+ vpx_codec_flags_t flags,
+ vpx_rational_t *dsf,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
VPX_ENCODER_ABI_VERSION)
- /*!\brief Get a default configuration
- *
- * Initializes a encoder configuration structure with default values. Supports
- * the notion of "usages" so that an algorithm may offer different default
- * settings depending on the user's intended goal. This function \ref SHOULD
- * be called by all applications to initialize the configuration structure
- * before specializing the configuration with application specific values.
- *
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[out] cfg Configuration buffer to populate
- * \param[in] usage End usage. Set to 0 or use codec specific values.
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- unsigned int usage);
-
-
- /*!\brief Set or change configuration
- *
- * Reconfigures an encoder instance according to the given configuration.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cfg Configuration buffer to use
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
- const vpx_codec_enc_cfg_t *cfg);
-
-
- /*!\brief Get global stream headers
- *
- * Retrieves a stream level global header packet, if supported by the codec.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval NULL
- * Encoder does not support global header
- * \retval Non-NULL
- * Pointer to buffer containing global header packet
- */
- vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
+/*!\brief Get a default configuration
+ *
+ * Initializes a encoder configuration structure with default values. Supports
+ * the notion of "usages" so that an algorithm may offer different default
+ * settings depending on the user's intended goal. This function \ref SHOULD
+ * be called by all applications to initialize the configuration structure
+ * before specializing the configuration with application specific values.
+ *
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[out] cfg Configuration buffer to populate
+ * \param[in] usage End usage. Set to 0 or use codec specific values.
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ unsigned int usage);
+
+
+/*!\brief Set or change configuration
+ *
+ * Reconfigures an encoder instance according to the given configuration.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cfg Configuration buffer to use
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
+ const vpx_codec_enc_cfg_t *cfg);
+
+
+/*!\brief Get global stream headers
+ *
+ * Retrieves a stream level global header packet, if supported by the codec.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval NULL
+ * Encoder does not support global header
+ * \retval Non-NULL
+ * Pointer to buffer containing global header packet
+ */
+vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to
@@ -794,141 +794,141 @@ extern "C" {
* VPx GOOD QUALITY mode. */
#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to
* VPx BEST QUALITY mode. */
- /*!\brief Encode a frame
- *
- * Encodes a video frame at the given "presentation time." The presentation
- * time stamp (PTS) \ref MUST be strictly increasing.
- *
- * The encoder supports the notion of a soft real-time deadline. Given a
- * non-zero value to the deadline parameter, the encoder will make a "best
- * effort" guarantee to return before the given time slice expires. It is
- * implicit that limiting the available time to encode will degrade the
- * output quality. The encoder can be given an unlimited time to produce the
- * best possible frame by specifying a deadline of '0'. This deadline
- * supercedes the VPx notion of "best quality, good quality, realtime".
- * Applications that wish to map these former settings to the new deadline
- * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
- * and #VPX_DL_BEST_QUALITY.
- *
- * When the last frame has been passed to the encoder, this function should
- * continue to be called, with the img parameter set to NULL. This will
- * signal the end-of-stream condition to the encoder and allow it to encode
- * any held buffers. Encoding is complete when vpx_codec_encode() is called
- * and vpx_codec_get_cx_data() returns no data.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] img Image data to encode, NULL to flush.
- * \param[in] pts Presentation time stamp, in timebase units.
- * \param[in] duration Duration to show frame, in timebase units.
- * \param[in] flags Flags to use for encoding this frame.
- * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
- const vpx_image_t *img,
- vpx_codec_pts_t pts,
- unsigned long duration,
- vpx_enc_frame_flags_t flags,
- unsigned long deadline);
-
- /*!\brief Set compressed data output buffer
- *
- * Sets the buffer that the codec should output the compressed data
- * into. This call effectively sets the buffer pointer returned in the
- * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
- * appended into this buffer. The buffer is preserved across frames,
- * so applications must periodically call this function after flushing
- * the accumulated compressed data to disk or to the network to reset
- * the pointer to the buffer's head.
- *
- * `pad_before` bytes will be skipped before writing the compressed
- * data, and `pad_after` bytes will be appended to the packet. The size
- * of the packet will be the sum of the size of the actual compressed
- * data, pad_before, and pad_after. The padding bytes will be preserved
- * (not overwritten).
- *
- * Note that calling this function does not guarantee that the returned
- * compressed data will be placed into the specified buffer. In the
- * event that the encoded data will not fit into the buffer provided,
- * the returned packet \ref MAY point to an internal buffer, as it would
- * if this call were never used. In this event, the output packet will
- * NOT have any padding, and the application must free space and copy it
- * to the proper place. This is of particular note in configurations
- * that may output multiple packets for a single encoded frame (e.g., lagged
- * encoding) or if the application does not reset the buffer periodically.
- *
- * Applications may restore the default behavior of the codec providing
- * the compressed data buffer by calling this function with a NULL
- * buffer.
- *
- * Applications \ref MUSTNOT call this function during iteration of
- * vpx_codec_get_cx_data().
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] buf Buffer to store compressed data into
- * \param[in] pad_before Bytes to skip before writing compressed data
- * \param[in] pad_after Bytes to skip after writing compressed data
- *
- * \retval #VPX_CODEC_OK
- * The buffer was set successfully.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
- const vpx_fixed_buf_t *buf,
- unsigned int pad_before,
- unsigned int pad_after);
-
-
- /*!\brief Encoded data iterator
- *
- * Iterates over a list of data packets to be passed from the encoder to the
- * application. The different kinds of packets available are enumerated in
- * #vpx_codec_cx_pkt_kind.
- *
- * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
- * muxer. Multiple compressed frames may be in the list.
- * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
- *
- * The application \ref MUST silently ignore any packet kinds that it does
- * not recognize or support.
- *
- * The data buffers returned from this function are only guaranteed to be
- * valid until the application makes another call to any vpx_codec_* function.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an output data packet (compressed frame data,
- * two-pass statistics, etc.) or NULL to signal end-of-list.
- *
- */
- const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Get Preview Frame
- *
- * Returns an image that can be used as a preview. Shows the image as it would
- * exist at the decompressor. The application \ref MUST NOT write into this
- * image buffer.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \return Returns a pointer to a preview image, or NULL if no image is
- * available.
- *
- */
- const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
-
-
- /*!@} - end defgroup encoder*/
+/*!\brief Encode a frame
+ *
+ * Encodes a video frame at the given "presentation time." The presentation
+ * time stamp (PTS) \ref MUST be strictly increasing.
+ *
+ * The encoder supports the notion of a soft real-time deadline. Given a
+ * non-zero value to the deadline parameter, the encoder will make a "best
+ * effort" guarantee to return before the given time slice expires. It is
+ * implicit that limiting the available time to encode will degrade the
+ * output quality. The encoder can be given an unlimited time to produce the
+ * best possible frame by specifying a deadline of '0'. This deadline
+ * supercedes the VPx notion of "best quality, good quality, realtime".
+ * Applications that wish to map these former settings to the new deadline
+ * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
+ * and #VPX_DL_BEST_QUALITY.
+ *
+ * When the last frame has been passed to the encoder, this function should
+ * continue to be called, with the img parameter set to NULL. This will
+ * signal the end-of-stream condition to the encoder and allow it to encode
+ * any held buffers. Encoding is complete when vpx_codec_encode() is called
+ * and vpx_codec_get_cx_data() returns no data.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] img Image data to encode, NULL to flush.
+ * \param[in] pts Presentation time stamp, in timebase units.
+ * \param[in] duration Duration to show frame, in timebase units.
+ * \param[in] flags Flags to use for encoding this frame.
+ * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned long duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned long deadline);
+
+/*!\brief Set compressed data output buffer
+ *
+ * Sets the buffer that the codec should output the compressed data
+ * into. This call effectively sets the buffer pointer returned in the
+ * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
+ * appended into this buffer. The buffer is preserved across frames,
+ * so applications must periodically call this function after flushing
+ * the accumulated compressed data to disk or to the network to reset
+ * the pointer to the buffer's head.
+ *
+ * `pad_before` bytes will be skipped before writing the compressed
+ * data, and `pad_after` bytes will be appended to the packet. The size
+ * of the packet will be the sum of the size of the actual compressed
+ * data, pad_before, and pad_after. The padding bytes will be preserved
+ * (not overwritten).
+ *
+ * Note that calling this function does not guarantee that the returned
+ * compressed data will be placed into the specified buffer. In the
+ * event that the encoded data will not fit into the buffer provided,
+ * the returned packet \ref MAY point to an internal buffer, as it would
+ * if this call were never used. In this event, the output packet will
+ * NOT have any padding, and the application must free space and copy it
+ * to the proper place. This is of particular note in configurations
+ * that may output multiple packets for a single encoded frame (e.g., lagged
+ * encoding) or if the application does not reset the buffer periodically.
+ *
+ * Applications may restore the default behavior of the codec providing
+ * the compressed data buffer by calling this function with a NULL
+ * buffer.
+ *
+ * Applications \ref MUSTNOT call this function during iteration of
+ * vpx_codec_get_cx_data().
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] buf Buffer to store compressed data into
+ * \param[in] pad_before Bytes to skip before writing compressed data
+ * \param[in] pad_after Bytes to skip after writing compressed data
+ *
+ * \retval #VPX_CODEC_OK
+ * The buffer was set successfully.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
+ const vpx_fixed_buf_t *buf,
+ unsigned int pad_before,
+ unsigned int pad_after);
+
+
+/*!\brief Encoded data iterator
+ *
+ * Iterates over a list of data packets to be passed from the encoder to the
+ * application. The different kinds of packets available are enumerated in
+ * #vpx_codec_cx_pkt_kind.
+ *
+ * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
+ * muxer. Multiple compressed frames may be in the list.
+ * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
+ *
+ * The application \ref MUST silently ignore any packet kinds that it does
+ * not recognize or support.
+ *
+ * The data buffers returned from this function are only guaranteed to be
+ * valid until the application makes another call to any vpx_codec_* function.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an output data packet (compressed frame data,
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
+ *
+ */
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Get Preview Frame
+ *
+ * Returns an image that can be used as a preview. Shows the image as it would
+ * exist at the decompressor. The application \ref MUST NOT write into this
+ * image buffer.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \return Returns a pointer to a preview image, or NULL if no image is
+ * available.
+ *
+ */
+const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
+
+
+/*!@} - end defgroup encoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/win32/include/vpx/vpx_image.h b/thirdparties/win32/include/vpx/vpx_image.h
index c304bac..514dd7a 100755
--- a/thirdparties/win32/include/vpx/vpx_image.h
+++ b/thirdparties/win32/include/vpx/vpx_image.h
@@ -20,14 +20,14 @@ extern "C" {
#ifndef VPX_IMAGE_H
#define VPX_IMAGE_H
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/
@@ -36,8 +36,8 @@ extern "C" {
#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component */
- /*!\brief List of supported image formats */
- typedef enum vpx_img_fmt {
+/*!\brief List of supported image formats */
+typedef enum vpx_img_fmt {
VPX_IMG_FMT_NONE,
VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
@@ -59,20 +59,21 @@ extern "C" {
VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5,
VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6,
VPX_IMG_FMT_444A = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_HAS_ALPHA | 7
- } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
+}
+vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
#define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_IMG_FMT_PLANAR */
#define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_IMG_FMT_UV_FLIP */
#define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_IMG_FMT_HAS_ALPHA */
- /*!\brief Deprecated list of supported image formats
- * \deprecated New code should use #vpx_img_fmt
- */
+/*!\brief Deprecated list of supported image formats
+ * \deprecated New code should use #vpx_img_fmt
+ */
#define img_fmt vpx_img_fmt
- /*!\brief alias for enum img_fmt.
- * \deprecated New code should use #vpx_img_fmt_t
- */
+/*!\brief alias for enum img_fmt.
+ * \deprecated New code should use #vpx_img_fmt_t
+ */
#define img_fmt_t vpx_img_fmt_t
#define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_FMT_NONE */
@@ -95,8 +96,8 @@ extern "C" {
#define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_FMT_VPXI420 */
#endif /* VPX_CODEC_DISABLE_COMPAT */
- /**\brief Image Descriptor */
- typedef struct vpx_image {
+/**\brief Image Descriptor */
+typedef struct vpx_image {
vpx_img_fmt_t fmt; /**< Image Format */
/* Image storage dimensions */
@@ -139,103 +140,103 @@ extern "C" {
unsigned char *img_data; /**< private */
int img_data_owner; /**< private */
int self_allocd; /**< private */
- } vpx_image_t; /**< alias for struct vpx_image */
+} vpx_image_t; /**< alias for struct vpx_image */
- /**\brief Representation of a rectangle on a surface */
- typedef struct vpx_image_rect {
+/**\brief Representation of a rectangle on a surface */
+typedef struct vpx_image_rect {
unsigned int x; /**< leftmost column */
unsigned int y; /**< topmost row */
unsigned int w; /**< width */
unsigned int h; /**< height */
- } vpx_image_rect_t; /**< alias for struct vpx_image_rect */
-
- /*!\brief Open a descriptor, allocating storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for the descriptor is allocated on the heap.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of the image buffer and
- * each row in the image(stride).
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_alloc(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align);
-
- /*!\brief Open a descriptor, using existing storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for descriptor has been allocated elsewhere, and a descriptor is
- * desired to "wrap" that storage.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of each row in the image.
- * \param[in] img_data Storage to use for the image
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_wrap(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align,
- unsigned char *img_data);
-
-
- /*!\brief Set the rectangle identifying the displayed portion of the image
- *
- * Updates the displayed rectangle (aka viewport) on the image surface to
- * match the specified coordinates and size.
- *
- * \param[in] img Image descriptor
- * \param[in] x leftmost column
- * \param[in] y topmost row
- * \param[in] w width
- * \param[in] h height
- *
- * \return 0 if the requested rectangle is valid, nonzero otherwise.
- */
- int vpx_img_set_rect(vpx_image_t *img,
- unsigned int x,
- unsigned int y,
- unsigned int w,
- unsigned int h);
-
-
- /*!\brief Flip the image vertically (top for bottom)
- *
- * Adjusts the image descriptor's pointers and strides to make the image
- * be referenced upside-down.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_flip(vpx_image_t *img);
-
- /*!\brief Close an image descriptor
- *
- * Frees all allocated storage associated with an image descriptor.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_free(vpx_image_t *img);
+} vpx_image_rect_t; /**< alias for struct vpx_image_rect */
+
+/*!\brief Open a descriptor, allocating storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for the descriptor is allocated on the heap.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of the image buffer and
+ * each row in the image(stride).
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_alloc(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align);
+
+/*!\brief Open a descriptor, using existing storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for descriptor has been allocated elsewhere, and a descriptor is
+ * desired to "wrap" that storage.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of each row in the image.
+ * \param[in] img_data Storage to use for the image
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_wrap(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align,
+ unsigned char *img_data);
+
+
+/*!\brief Set the rectangle identifying the displayed portion of the image
+ *
+ * Updates the displayed rectangle (aka viewport) on the image surface to
+ * match the specified coordinates and size.
+ *
+ * \param[in] img Image descriptor
+ * \param[in] x leftmost column
+ * \param[in] y topmost row
+ * \param[in] w width
+ * \param[in] h height
+ *
+ * \return 0 if the requested rectangle is valid, nonzero otherwise.
+ */
+int vpx_img_set_rect(vpx_image_t *img,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h);
+
+
+/*!\brief Flip the image vertically (top for bottom)
+ *
+ * Adjusts the image descriptor's pointers and strides to make the image
+ * be referenced upside-down.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_flip(vpx_image_t *img);
+
+/*!\brief Close an image descriptor
+ *
+ * Frees all allocated storage associated with an image descriptor.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_free(vpx_image_t *img);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/curl/curl.h b/thirdparties/wince/include/curl/curl.h
index 3277362..30fd993 100755
--- a/thirdparties/wince/include/curl/curl.h
+++ b/thirdparties/wince/include/curl/curl.h
@@ -133,19 +133,19 @@ typedef int curl_socket_t;
#endif /* curl_socket_typedef */
struct curl_httppost {
- struct curl_httppost *next; /* next entry in the list */
- char *name; /* pointer to allocated name */
- long namelength; /* length of name length */
- char *contents; /* pointer to allocated data contents */
- long contentslength; /* length of contents field */
- char *buffer; /* pointer to allocated buffer contents */
- long bufferlength; /* length of buffer field */
- char *contenttype; /* Content-Type */
- struct curl_slist* contentheader; /* list of extra headers for this form */
- struct curl_httppost *more; /* if one field name has more than one
+ struct curl_httppost *next; /* next entry in the list */
+ char *name; /* pointer to allocated name */
+ long namelength; /* length of name length */
+ char *contents; /* pointer to allocated data contents */
+ long contentslength; /* length of contents field */
+ char *buffer; /* pointer to allocated buffer contents */
+ long bufferlength; /* length of buffer field */
+ char *contenttype; /* Content-Type */
+ struct curl_slist* contentheader; /* list of extra headers for this form */
+ struct curl_httppost *more; /* if one field name has more than one
file, this link should link to following
files */
- long flags; /* as defined below */
+ long flags; /* as defined below */
#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
@@ -159,10 +159,10 @@ struct curl_httppost {
and pass the given pointer as custom
pointer */
- char *showfilename; /* The file name to show. If not set, the
+ char *showfilename; /* The file name to show. If not set, the
actual file name will be used (if this
is a file part) */
- void *userp; /* custom pointer used for
+ void *userp; /* custom pointer used for
HTTPPOST_CALLBACK posts */
};
@@ -173,10 +173,10 @@ typedef int (*curl_progress_callback)(void *clientp,
double ulnow);
#ifndef CURL_MAX_WRITE_SIZE
- /* Tests have proven that 20K is a very bad buffer size for uploads on
- Windows, while 16K for some odd reason performed a lot better.
- We do the ifndef check to allow this value to easier be changed at build
- time for those who feel adventurous. */
+/* Tests have proven that 20K is a very bad buffer size for uploads on
+ Windows, while 16K for some odd reason performed a lot better.
+ We do the ifndef check to allow this value to easier be changed at build
+ time for those who feel adventurous. */
#define CURL_MAX_WRITE_SIZE 16384
#endif
/* This is a magic return code for the write callback that, when returned,
@@ -204,13 +204,13 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_READFUNC_PAUSE 0x10000001
typedef size_t (*curl_read_callback)(char *buffer,
- size_t size,
- size_t nitems,
- void *instream);
+ size_t size,
+ size_t nitems,
+ void *instream);
typedef enum {
- CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
- CURLSOCKTYPE_LAST /* never use */
+ CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
+ CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
typedef int (*curl_sockopt_callback)(void *clientp,
@@ -218,13 +218,13 @@ typedef int (*curl_sockopt_callback)(void *clientp,
curlsocktype purpose);
struct curl_sockaddr {
- int family;
- int socktype;
- int protocol;
- unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
+ int family;
+ int socktype;
+ int protocol;
+ unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
turned really ugly and painful on the systems that
lack this type */
- struct sockaddr addr;
+ struct sockaddr addr;
};
typedef curl_socket_t
@@ -233,7 +233,7 @@ typedef curl_socket_t
struct curl_sockaddr *address);
#ifndef CURL_NO_OLDIES
- /* not used since 7.10.8, will be removed in a future release */
+/* not used since 7.10.8, will be removed in a future release */
typedef int (*curl_passwd_callback)(void *clientp,
const char *prompt,
char *buffer,
@@ -241,21 +241,21 @@ typedef int (*curl_passwd_callback)(void *clientp,
#endif
typedef enum {
- CURLIOE_OK, /* I/O operation successful */
- CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
- CURLIOE_FAILRESTART, /* failed to restart the read */
- CURLIOE_LAST /* never use */
+ CURLIOE_OK, /* I/O operation successful */
+ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
+ CURLIOE_FAILRESTART, /* failed to restart the read */
+ CURLIOE_LAST /* never use */
} curlioerr;
typedef enum {
- CURLIOCMD_NOP, /* no operation */
- CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
- CURLIOCMD_LAST /* never use */
+ CURLIOCMD_NOP, /* no operation */
+ CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
+ CURLIOCMD_LAST /* never use */
} curliocmd;
typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
- int cmd,
- void *clientp);
+ int cmd,
+ void *clientp);
/*
* The following typedef's are signatures of malloc, free, realloc, strdup and
@@ -271,22 +271,22 @@ typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
/* the kind of data that is passed to information_callback*/
typedef enum {
- CURLINFO_TEXT = 0,
- CURLINFO_HEADER_IN, /* 1 */
- CURLINFO_HEADER_OUT, /* 2 */
- CURLINFO_DATA_IN, /* 3 */
- CURLINFO_DATA_OUT, /* 4 */
- CURLINFO_SSL_DATA_IN, /* 5 */
- CURLINFO_SSL_DATA_OUT, /* 6 */
- CURLINFO_END
+ CURLINFO_TEXT = 0,
+ CURLINFO_HEADER_IN, /* 1 */
+ CURLINFO_HEADER_OUT, /* 2 */
+ CURLINFO_DATA_IN, /* 3 */
+ CURLINFO_DATA_OUT, /* 4 */
+ CURLINFO_SSL_DATA_IN, /* 5 */
+ CURLINFO_SSL_DATA_OUT, /* 6 */
+ CURLINFO_END
} curl_infotype;
typedef int (*curl_debug_callback)
- (CURL *handle, /* the handle/transfer this concerns */
- curl_infotype type, /* what kind of data */
- char *data, /* points to the data */
- size_t size, /* size of the data pointed to */
- void *userptr); /* whatever the user please */
+(CURL *handle, /* the handle/transfer this concerns */
+ curl_infotype type, /* what kind of data */
+ char *data, /* points to the data */
+ size_t size, /* size of the data pointed to */
+ void *userptr); /* whatever the user please */
/* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
@@ -296,114 +296,114 @@ typedef int (*curl_debug_callback)
*/
typedef enum {
- CURLE_OK = 0,
- CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
- CURLE_FAILED_INIT, /* 2 */
- CURLE_URL_MALFORMAT, /* 3 */
- CURLE_OBSOLETE4, /* 4 - NOT USED */
- CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
- CURLE_COULDNT_RESOLVE_HOST, /* 6 */
- CURLE_COULDNT_CONNECT, /* 7 */
- CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
- CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
+ CURLE_OK = 0,
+ CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
+ CURLE_FAILED_INIT, /* 2 */
+ CURLE_URL_MALFORMAT, /* 3 */
+ CURLE_OBSOLETE4, /* 4 - NOT USED */
+ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
+ CURLE_COULDNT_RESOLVE_HOST, /* 6 */
+ CURLE_COULDNT_CONNECT, /* 7 */
+ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
+ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
- CURLE_OBSOLETE10, /* 10 - NOT USED */
- CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
- CURLE_OBSOLETE12, /* 12 - NOT USED */
- CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
- CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
- CURLE_FTP_CANT_GET_HOST, /* 15 */
- CURLE_OBSOLETE16, /* 16 - NOT USED */
- CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
- CURLE_PARTIAL_FILE, /* 18 */
- CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
- CURLE_OBSOLETE20, /* 20 - NOT USED */
- CURLE_QUOTE_ERROR, /* 21 - quote command failure */
- CURLE_HTTP_RETURNED_ERROR, /* 22 */
- CURLE_WRITE_ERROR, /* 23 */
- CURLE_OBSOLETE24, /* 24 - NOT USED */
- CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
- CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
- CURLE_OUT_OF_MEMORY, /* 27 */
- /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
- instead of a memory allocation error if CURL_DOES_CONVERSIONS
- is defined
- */
- CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
- CURLE_OBSOLETE29, /* 29 - NOT USED */
- CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
- CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
- CURLE_OBSOLETE32, /* 32 - NOT USED */
- CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
- CURLE_HTTP_POST_ERROR, /* 34 */
- CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
- CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
- CURLE_FILE_COULDNT_READ_FILE, /* 37 */
- CURLE_LDAP_CANNOT_BIND, /* 38 */
- CURLE_LDAP_SEARCH_FAILED, /* 39 */
- CURLE_OBSOLETE40, /* 40 - NOT USED */
- CURLE_FUNCTION_NOT_FOUND, /* 41 */
- CURLE_ABORTED_BY_CALLBACK, /* 42 */
- CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
- CURLE_OBSOLETE44, /* 44 - NOT USED */
- CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
- CURLE_OBSOLETE46, /* 46 - NOT USED */
- CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
- CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
- CURLE_OBSOLETE50, /* 50 - NOT USED */
- CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
+ CURLE_OBSOLETE10, /* 10 - NOT USED */
+ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
+ CURLE_OBSOLETE12, /* 12 - NOT USED */
+ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
+ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
+ CURLE_FTP_CANT_GET_HOST, /* 15 */
+ CURLE_OBSOLETE16, /* 16 - NOT USED */
+ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
+ CURLE_PARTIAL_FILE, /* 18 */
+ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
+ CURLE_OBSOLETE20, /* 20 - NOT USED */
+ CURLE_QUOTE_ERROR, /* 21 - quote command failure */
+ CURLE_HTTP_RETURNED_ERROR, /* 22 */
+ CURLE_WRITE_ERROR, /* 23 */
+ CURLE_OBSOLETE24, /* 24 - NOT USED */
+ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
+ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
+ CURLE_OUT_OF_MEMORY, /* 27 */
+ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
+ instead of a memory allocation error if CURL_DOES_CONVERSIONS
+ is defined
+ */
+ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
+ CURLE_OBSOLETE29, /* 29 - NOT USED */
+ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
+ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
+ CURLE_OBSOLETE32, /* 32 - NOT USED */
+ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
+ CURLE_HTTP_POST_ERROR, /* 34 */
+ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
+ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
+ CURLE_FILE_COULDNT_READ_FILE, /* 37 */
+ CURLE_LDAP_CANNOT_BIND, /* 38 */
+ CURLE_LDAP_SEARCH_FAILED, /* 39 */
+ CURLE_OBSOLETE40, /* 40 - NOT USED */
+ CURLE_FUNCTION_NOT_FOUND, /* 41 */
+ CURLE_ABORTED_BY_CALLBACK, /* 42 */
+ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
+ CURLE_OBSOLETE44, /* 44 - NOT USED */
+ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
+ CURLE_OBSOLETE46, /* 46 - NOT USED */
+ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
+ CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
+ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
+ CURLE_OBSOLETE50, /* 50 - NOT USED */
+ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
wasn't verified fine */
- CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
- CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
- CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
+ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
+ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
+ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
default */
- CURLE_SEND_ERROR, /* 55 - failed sending network data */
- CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
- CURLE_OBSOLETE57, /* 57 - NOT IN USE */
- CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
- CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
- CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
- CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
- CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
- CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
- CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
+ CURLE_SEND_ERROR, /* 55 - failed sending network data */
+ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
+ CURLE_OBSOLETE57, /* 57 - NOT IN USE */
+ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
+ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
+ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
+ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
+ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
+ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
+ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
+ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
that failed */
- CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
- CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
+ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
+ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
accepted and we failed to login */
- CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
- CURLE_TFTP_PERM, /* 69 - permission problem on server */
- CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
- CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
- CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
- CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
- CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
- CURLE_CONV_FAILED, /* 75 - conversion failed */
- CURLE_CONV_REQD, /* 76 - caller must register conversion
+ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
+ CURLE_TFTP_PERM, /* 69 - permission problem on server */
+ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
+ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
+ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
+ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
+ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
+ CURLE_CONV_FAILED, /* 75 - conversion failed */
+ CURLE_CONV_REQD, /* 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION */
- CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
+ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
- CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
- CURLE_SSH, /* 79 - error from the SSH layer, somewhat
+ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
+ CURLE_SSH, /* 79 - error from the SSH layer, somewhat
generic so the error message will be of
interest when this has happened */
- CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
+ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
connection */
- CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
+ CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
wait till it's ready and try again (Added
in 7.18.2) */
- CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
+ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
wrong format (Added in 7.19.0) */
- CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
+ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
7.19.0) */
- CURL_LAST /* never use! */
+ CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -461,20 +461,20 @@ typedef enum {
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
- void *ssl_ctx, /* actually an
+ void *ssl_ctx, /* actually an
OpenSSL SSL_CTX */
- void *userptr);
+ void *userptr);
typedef enum {
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
+ CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
+ CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
+ CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
+ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
+ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
+ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
host name rather than the IP address. added
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
@@ -499,51 +499,51 @@ typedef enum {
#define CURL_ERROR_SIZE 256
struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
+ const char *key; /* points to a zero-terminated string encoded with base64
if len is zero, otherwise to the "raw" data */
- size_t len;
- enum type {
- CURLKHTYPE_UNKNOWN,
- CURLKHTYPE_RSA1,
- CURLKHTYPE_RSA,
- CURLKHTYPE_DSS
- } keytype;
+ size_t len;
+ enum type {
+ CURLKHTYPE_UNKNOWN,
+ CURLKHTYPE_RSA1,
+ CURLKHTYPE_RSA,
+ CURLKHTYPE_DSS
+ } keytype;
};
/* this is the set of return values expected from the curl_sshkeycallback
callback */
enum curl_khstat {
- CURLKHSTAT_FINE_ADD_TO_FILE,
- CURLKHSTAT_FINE,
- CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
+ CURLKHSTAT_FINE_ADD_TO_FILE,
+ CURLKHSTAT_FINE,
+ CURLKHSTAT_REJECT, /* reject the connection, return an error */
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
this causes a CURLE_DEFER error but otherwise the
connection will be left intact etc */
- CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
+ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
};
/* this is the set of status codes pass in to the callback */
enum curl_khmatch {
- CURLKHMATCH_OK, /* match */
- CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
- CURLKHMATCH_MISSING, /* no matching host/key found */
- CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
+ CURLKHMATCH_OK, /* match */
+ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
+ CURLKHMATCH_MISSING, /* no matching host/key found */
+ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
};
typedef int
- (*curl_sshkeycallback) (CURL *easy, /* easy handle */
- const struct curl_khkey *knownkey, /* known */
- const struct curl_khkey *foundkey, /* found */
- enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
+(*curl_sshkeycallback) (CURL *easy, /* easy handle */
+ const struct curl_khkey *knownkey, /* known */
+ const struct curl_khkey *foundkey, /* found */
+ enum curl_khmatch, /* libcurl's view on the keys */
+ void *clientp); /* custom pointer passed from app */
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
- CURLUSESSL_NONE, /* do not attempt to use SSL */
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
- CURLUSESSL_ALL, /* SSL for all communication or fail */
- CURLUSESSL_LAST /* not an option, never use */
+ CURLUSESSL_NONE, /* do not attempt to use SSL */
+ CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
+ CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
+ CURLUSESSL_ALL, /* SSL for all communication or fail */
+ CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -562,38 +562,38 @@ typedef enum {
/* parameter for the CURLOPT_FTP_SSL_CCC option */
typedef enum {
- CURLFTPSSL_CCC_NONE, /* do not send CCC */
- CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
- CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
- CURLFTPSSL_CCC_LAST /* not an option, never use */
+ CURLFTPSSL_CCC_NONE, /* do not send CCC */
+ CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
+ CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
+ CURLFTPSSL_CCC_LAST /* not an option, never use */
} curl_ftpccc;
/* parameter for the CURLOPT_FTPSSLAUTH option */
typedef enum {
- CURLFTPAUTH_DEFAULT, /* let libcurl decide */
- CURLFTPAUTH_SSL, /* use "AUTH SSL" */
- CURLFTPAUTH_TLS, /* use "AUTH TLS" */
- CURLFTPAUTH_LAST /* not an option, never use */
+ CURLFTPAUTH_DEFAULT, /* let libcurl decide */
+ CURLFTPAUTH_SSL, /* use "AUTH SSL" */
+ CURLFTPAUTH_TLS, /* use "AUTH TLS" */
+ CURLFTPAUTH_LAST /* not an option, never use */
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
typedef enum {
- CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
- CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
+ CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic */
- CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
+ CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! */
- CURLFTP_CREATE_DIR_LAST /* not an option, never use */
+ CURLFTP_CREATE_DIR_LAST /* not an option, never use */
} curl_ftpcreatedir;
/* parameter for the CURLOPT_FTP_FILEMETHOD option */
typedef enum {
- CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
- CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
- CURLFTPMETHOD_NOCWD, /* no CWD at all */
- CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
- CURLFTPMETHOD_LAST /* not an option, never use */
+ CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
+ CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
+ CURLFTPMETHOD_NOCWD, /* no CWD at all */
+ CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
+ CURLFTPMETHOD_LAST /* not an option, never use */
} curl_ftpmethod;
/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
@@ -643,632 +643,632 @@ typedef enum {
*/
typedef enum {
- /* This is the FILE * or void * the regular output should be written to. */
- CINIT(FILE, OBJECTPOINT, 1),
+ /* This is the FILE * or void * the regular output should be written to. */
+ CINIT(FILE, OBJECTPOINT, 1),
+
+ /* The full URL to get/put */
+ CINIT(URL, OBJECTPOINT, 2),
+
+ /* Port number to connect to, if other than default. */
+ CINIT(PORT, LONG, 3),
- /* The full URL to get/put */
- CINIT(URL, OBJECTPOINT, 2),
+ /* Name of proxy to use. */
+ CINIT(PROXY, OBJECTPOINT, 4),
- /* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
+ /* "name:password" to use when fetching. */
+ CINIT(USERPWD, OBJECTPOINT, 5),
- /* Name of proxy to use. */
- CINIT(PROXY, OBJECTPOINT, 4),
+ /* "name:password" to use with proxy. */
+ CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
- /* "name:password" to use when fetching. */
- CINIT(USERPWD, OBJECTPOINT, 5),
+ /* Range to get, specified as an ASCII string. */
+ CINIT(RANGE, OBJECTPOINT, 7),
- /* "name:password" to use with proxy. */
- CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
+ /* not used */
- /* Range to get, specified as an ASCII string. */
- CINIT(RANGE, OBJECTPOINT, 7),
+ /* Specified file stream to upload from (use as input): */
+ CINIT(INFILE, OBJECTPOINT, 9),
- /* not used */
+ /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
+ * bytes big. If this is not used, error messages go to stderr instead: */
+ CINIT(ERRORBUFFER, OBJECTPOINT, 10),
- /* Specified file stream to upload from (use as input): */
- CINIT(INFILE, OBJECTPOINT, 9),
+ /* Function that will be called to store the output (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
- /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
- * bytes big. If this is not used, error messages go to stderr instead: */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
+ /* Function that will be called to read the input (instead of fread). The
+ * parameters will use fread() syntax, make sure to follow them. */
+ CINIT(READFUNCTION, FUNCTIONPOINT, 12),
- /* Function that will be called to store the output (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
+ /* Time-out the read operation after this amount of seconds */
+ CINIT(TIMEOUT, LONG, 13),
- /* Function that will be called to read the input (instead of fread). The
- * parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
+ /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
+ * how large the file being sent really is. That allows better error
+ * checking and better verifies that the upload was successful. -1 means
+ * unknown size.
+ *
+ * For large file support, there is also a _LARGE version of the key
+ * which takes an off_t type, allowing platforms with larger off_t
+ * sizes to handle larger files. See below for INFILESIZE_LARGE.
+ */
+ CINIT(INFILESIZE, LONG, 14),
- /* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
+ /* POST static input fields. */
+ CINIT(POSTFIELDS, OBJECTPOINT, 15),
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
- * how large the file being sent really is. That allows better error
- * checking and better verifies that the upload was successful. -1 means
- * unknown size.
- *
- * For large file support, there is also a _LARGE version of the key
- * which takes an off_t type, allowing platforms with larger off_t
- * sizes to handle larger files. See below for INFILESIZE_LARGE.
- */
- CINIT(INFILESIZE, LONG, 14),
+ /* Set the referrer page (needed by some CGIs) */
+ CINIT(REFERER, OBJECTPOINT, 16),
- /* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
+ /* Set the FTP PORT string (interface name, named or numerical IP address)
+ Use i.e '-' to use default address. */
+ CINIT(FTPPORT, OBJECTPOINT, 17),
- /* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, OBJECTPOINT, 16),
+ /* Set the User-Agent string (examined by some CGIs) */
+ CINIT(USERAGENT, OBJECTPOINT, 18),
- /* Set the FTP PORT string (interface name, named or numerical IP address)
- Use i.e '-' to use default address. */
- CINIT(FTPPORT, OBJECTPOINT, 17),
+ /* If the download receives less than "low speed limit" bytes/second
+ * during "low speed time" seconds, the operations is aborted.
+ * You could i.e if you have a pretty high speed connection, abort if
+ * it is less than 2000 bytes/sec during 20 seconds.
+ */
- /* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, OBJECTPOINT, 18),
+ /* Set the "low speed limit" */
+ CINIT(LOW_SPEED_LIMIT, LONG, 19),
- /* If the download receives less than "low speed limit" bytes/second
- * during "low speed time" seconds, the operations is aborted.
- * You could i.e if you have a pretty high speed connection, abort if
- * it is less than 2000 bytes/sec during 20 seconds.
- */
+ /* Set the "low speed time" */
+ CINIT(LOW_SPEED_TIME, LONG, 20),
- /* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
+ /* Set the continuation offset.
+ *
+ * Note there is also a _LARGE version of this key which uses
+ * off_t types, allowing for large file offsets on platforms which
+ * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
+ */
+ CINIT(RESUME_FROM, LONG, 21),
- /* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
+ /* Set cookie in request: */
+ CINIT(COOKIE, OBJECTPOINT, 22),
- /* Set the continuation offset.
- *
- * Note there is also a _LARGE version of this key which uses
- * off_t types, allowing for large file offsets on platforms which
- * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
- */
- CINIT(RESUME_FROM, LONG, 21),
+ /* This points to a linked list of headers, struct curl_slist kind */
+ CINIT(HTTPHEADER, OBJECTPOINT, 23),
- /* Set cookie in request: */
- CINIT(COOKIE, OBJECTPOINT, 22),
+ /* This points to a linked list of post entries, struct curl_httppost */
+ CINIT(HTTPPOST, OBJECTPOINT, 24),
- /* This points to a linked list of headers, struct curl_slist kind */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
+ /* name of the file keeping your private SSL-certificate */
+ CINIT(SSLCERT, OBJECTPOINT, 25),
- /* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
+ /* password for the SSL or SSH private key */
+ CINIT(KEYPASSWD, OBJECTPOINT, 26),
- /* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, OBJECTPOINT, 25),
+ /* send TYPE parameter? */
+ CINIT(CRLF, LONG, 27),
- /* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, OBJECTPOINT, 26),
+ /* send linked-list of QUOTE commands */
+ CINIT(QUOTE, OBJECTPOINT, 28),
- /* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
+ /* send FILE * or void * to store headers to, if you use a callback it
+ is simply passed to the callback unmodified */
+ CINIT(WRITEHEADER, OBJECTPOINT, 29),
- /* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
+ /* point to a file to read the initial cookies from, also enables
+ "cookie awareness" */
+ CINIT(COOKIEFILE, OBJECTPOINT, 31),
- /* send FILE * or void * to store headers to, if you use a callback it
- is simply passed to the callback unmodified */
- CINIT(WRITEHEADER, OBJECTPOINT, 29),
+ /* What version to specifically try to use.
+ See CURL_SSLVERSION defines below. */
+ CINIT(SSLVERSION, LONG, 32),
- /* point to a file to read the initial cookies from, also enables
- "cookie awareness" */
- CINIT(COOKIEFILE, OBJECTPOINT, 31),
+ /* What kind of HTTP time condition to use, see defines */
+ CINIT(TIMECONDITION, LONG, 33),
- /* What version to specifically try to use.
- See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
+ /* Time to use with the above condition. Specified in number of seconds
+ since 1 Jan 1970 */
+ CINIT(TIMEVALUE, LONG, 34),
- /* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
+ /* 35 = OBSOLETE */
- /* Time to use with the above condition. Specified in number of seconds
- since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
+ /* Custom request, for customizing the get command like
+ HTTP: DELETE, TRACE and others
+ FTP: to use a different list command
+ */
+ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
- /* 35 = OBSOLETE */
+ /* HTTP request, for odd commands like DELETE, TRACE and others */
+ CINIT(STDERR, OBJECTPOINT, 37),
- /* Custom request, for customizing the get command like
- HTTP: DELETE, TRACE and others
- FTP: to use a different list command
- */
- CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
+ /* 38 is not used */
+
+ /* send linked-list of post-transfer QUOTE commands */
+ CINIT(POSTQUOTE, OBJECTPOINT, 39),
+
+ /* Pass a pointer to string of the output using full variable-replacement
+ as described elsewhere. */
+ CINIT(WRITEINFO, OBJECTPOINT, 40),
+
+ CINIT(VERBOSE, LONG, 41), /* talk a lot */
+ CINIT(HEADER, LONG, 42), /* throw the header out too */
+ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
+ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
+ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
+ CINIT(UPLOAD, LONG, 46), /* this is an upload */
+ CINIT(POST, LONG, 47), /* HTTP POST method */
+ CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+
+ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+
+ /* Specify whether to read the user+password from the .netrc or the URL.
+ * This must be one of the CURL_NETRC_* enums below. */
+ CINIT(NETRC, LONG, 51),
+
+ CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+
+ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
+ CINIT(PUT, LONG, 54), /* HTTP PUT */
+
+ /* 55 = OBSOLETE */
- /* HTTP request, for odd commands like DELETE, TRACE and others */
- CINIT(STDERR, OBJECTPOINT, 37),
+ /* Function that will be called instead of the internal progress display
+ * function. This function should be defined as the curl_progress_callback
+ * prototype defines. */
+ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
- /* 38 is not used */
+ /* Data passed to the progress callback */
+ CINIT(PROGRESSDATA, OBJECTPOINT, 57),
- /* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
+ /* We want the referrer field set automatically when following locations */
+ CINIT(AUTOREFERER, LONG, 58),
- /* Pass a pointer to string of the output using full variable-replacement
- as described elsewhere. */
- CINIT(WRITEINFO, OBJECTPOINT, 40),
+ /* Port of the proxy, can be set in the proxy string as well with:
+ "[host]:[port]" */
+ CINIT(PROXYPORT, LONG, 59),
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+ /* size of the POST input data, if strlen() is not good to use */
+ CINIT(POSTFIELDSIZE, LONG, 60),
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+ /* tunnel non-http operations through a HTTP proxy */
+ CINIT(HTTPPROXYTUNNEL, LONG, 61),
- /* Specify whether to read the user+password from the .netrc or the URL.
- * This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
+ /* Set the interface string to use as outgoing network interface */
+ CINIT(INTERFACE, OBJECTPOINT, 62),
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+ /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
+ * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
+ * is set but doesn't match one of these, 'private' will be used. */
+ CINIT(KRBLEVEL, OBJECTPOINT, 63),
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
+ /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
+ CINIT(SSL_VERIFYPEER, LONG, 64),
- /* 55 = OBSOLETE */
+ /* The CApath or CAfile used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAINFO, OBJECTPOINT, 65),
- /* Function that will be called instead of the internal progress display
- * function. This function should be defined as the curl_progress_callback
- * prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
+ /* 66 = OBSOLETE */
+ /* 67 = OBSOLETE */
- /* Data passed to the progress callback */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
+ /* Maximum number of http redirects to follow */
+ CINIT(MAXREDIRS, LONG, 68),
- /* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
+ /* Pass a long set to 1 to get the date of the requested document (if
+ possible)! Pass a zero to shut it off. */
+ CINIT(FILETIME, LONG, 69),
- /* Port of the proxy, can be set in the proxy string as well with:
- "[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
+ /* This points to a linked list of telnet options */
+ CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
- /* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
+ /* Max amount of cached alive connections */
+ CINIT(MAXCONNECTS, LONG, 71),
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
+ /* What policy to use when closing connections when the cache is filled
+ up */
+ CINIT(CLOSEPOLICY, LONG, 72),
- /* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, OBJECTPOINT, 62),
+ /* 73 = OBSOLETE */
- /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
- * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
- * is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, OBJECTPOINT, 63),
+ /* Set to explicitly use a new connection for the upcoming transfer.
+ Do not use this unless you're absolutely sure of this, as it makes the
+ operation slower and is less friendly for the network. */
+ CINIT(FRESH_CONNECT, LONG, 74),
- /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
+ /* Set to explicitly forbid the upcoming transfer's connection to be re-used
+ when done. Do not use this unless you're absolutely sure of this, as it
+ makes the operation slower and is less friendly for the network. */
+ CINIT(FORBID_REUSE, LONG, 75),
- /* The CApath or CAfile used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, OBJECTPOINT, 65),
+ /* Set to a file name that contains random data for libcurl to use to
+ seed the random engine when doing SSL connects. */
+ CINIT(RANDOM_FILE, OBJECTPOINT, 76),
- /* 66 = OBSOLETE */
- /* 67 = OBSOLETE */
+ /* Set to the Entropy Gathering Daemon socket pathname */
+ CINIT(EGDSOCKET, OBJECTPOINT, 77),
- /* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
+ /* Time-out connect operations after this amount of seconds, if connects
+ are OK within this time, then fine... This only aborts the connect
+ phase. [Only works on unix-style/SIGALRM operating systems] */
+ CINIT(CONNECTTIMEOUT, LONG, 78),
- /* Pass a long set to 1 to get the date of the requested document (if
- possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
+ /* Function that will be called to store headers (instead of fwrite). The
+ * parameters will use fwrite() syntax, make sure to follow them. */
+ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
- /* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
+ /* Set this to force the HTTP request to get back to GET. Only really usable
+ if POST, PUT or a custom request have been used first.
+ */
+ CINIT(HTTPGET, LONG, 80),
+
+ /* Set if we should verify the Common name from the peer certificate in ssl
+ * handshake, set 1 to check existence, 2 to ensure that it matches the
+ * provided hostname. */
+ CINIT(SSL_VERIFYHOST, LONG, 81),
+
+ /* Specify which file name to write all known cookies in after completed
+ operation. Set file name to "-" (dash) to make it go to stdout. */
+ CINIT(COOKIEJAR, OBJECTPOINT, 82),
+
+ /* Specify which SSL ciphers to use */
+ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+
+ /* Specify which HTTP version to use! This must be set to one of the
+ CURL_HTTP_VERSION* enums set below. */
+ CINIT(HTTP_VERSION, LONG, 84),
+
+ /* Specifically switch on or off the FTP engine's use of the EPSV command. By
+ default, that one will always be attempted before the more traditional
+ PASV command. */
+ CINIT(FTP_USE_EPSV, LONG, 85),
+
+ /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
+ CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+
+ /* name of the file keeping your private SSL-key */
+ CINIT(SSLKEY, OBJECTPOINT, 87),
- /* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
+ /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
+ CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
- /* What policy to use when closing connections when the cache is filled
- up */
- CINIT(CLOSEPOLICY, LONG, 72),
+ /* crypto engine for the SSL-sub system */
+ CINIT(SSLENGINE, OBJECTPOINT, 89),
- /* 73 = OBSOLETE */
+ /* set the crypto engine for the SSL-sub system as default
+ the param has no meaning...
+ */
+ CINIT(SSLENGINE_DEFAULT, LONG, 90),
+
+ /* Non-zero value means to use the global dns cache */
+ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+
+ /* DNS cache timeout */
+ CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+
+ /* send linked-list of pre-transfer QUOTE commands */
+ CINIT(PREQUOTE, OBJECTPOINT, 93),
- /* Set to explicitly use a new connection for the upcoming transfer.
- Do not use this unless you're absolutely sure of this, as it makes the
- operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
+ /* set the debug function */
+ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
- when done. Do not use this unless you're absolutely sure of this, as it
- makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
+ /* set the data for the debug function */
+ CINIT(DEBUGDATA, OBJECTPOINT, 95),
- /* Set to a file name that contains random data for libcurl to use to
- seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, OBJECTPOINT, 76),
+ /* mark this as start of a cookie session */
+ CINIT(COOKIESESSION, LONG, 96),
- /* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, OBJECTPOINT, 77),
+ /* The CApath directory used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(CAPATH, OBJECTPOINT, 97),
- /* Time-out connect operations after this amount of seconds, if connects
- are OK within this time, then fine... This only aborts the connect
- phase. [Only works on unix-style/SIGALRM operating systems] */
- CINIT(CONNECTTIMEOUT, LONG, 78),
+ /* Instruct libcurl to use a smaller receive buffer */
+ CINIT(BUFFERSIZE, LONG, 98),
- /* Function that will be called to store headers (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
+ /* Instruct libcurl to not use any signal/alarm handlers, even when using
+ timeouts. This option is useful for multi-threaded applications.
+ See libcurl-the-guide for more background information. */
+ CINIT(NOSIGNAL, LONG, 99),
- /* Set this to force the HTTP request to get back to GET. Only really usable
- if POST, PUT or a custom request have been used first.
- */
- CINIT(HTTPGET, LONG, 80),
+ /* Provide a CURLShare for mutexing non-ts data */
+ CINIT(SHARE, OBJECTPOINT, 100),
- /* Set if we should verify the Common name from the peer certificate in ssl
- * handshake, set 1 to check existence, 2 to ensure that it matches the
- * provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
+ /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
+ CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
+ CINIT(PROXYTYPE, LONG, 101),
- /* Specify which file name to write all known cookies in after completed
- operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, OBJECTPOINT, 82),
+ /* Set the Accept-Encoding string. Use this to tell a server you would like
+ the response to be compressed. */
+ CINIT(ENCODING, OBJECTPOINT, 102),
- /* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+ /* Set pointer to private data */
+ CINIT(PRIVATE, OBJECTPOINT, 103),
- /* Specify which HTTP version to use! This must be set to one of the
- CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
+ /* Set aliases for HTTP 200 in the HTTP Response header */
+ CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
- /* Specifically switch on or off the FTP engine's use of the EPSV command. By
- default, that one will always be attempted before the more traditional
- PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
+ /* Continue to send authentication (user+password) when following locations,
+ even when hostname changed. This can potentially send off the name
+ and password to whatever host the server decides. */
+ CINIT(UNRESTRICTED_AUTH, LONG, 105),
- /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+ /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
+ also disables the LPRT attempt). By default, those ones will always be
+ attempted before the good old traditional PORT command. */
+ CINIT(FTP_USE_EPRT, LONG, 106),
- /* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, OBJECTPOINT, 87),
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_USERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(HTTPAUTH, LONG, 107),
- /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
+ /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
+ in second argument. The function must be matching the
+ curl_ssl_ctx_callback proto. */
+ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
- /* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, OBJECTPOINT, 89),
+ /* Set the userdata for the ssl context callback function's third
+ argument */
+ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
- /* set the crypto engine for the SSL-sub system as default
- the param has no meaning...
- */
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
+ /* FTP Option that causes missing dirs to be created on the remote server.
+ In 7.19.4 we introduced the convenience enums for this option using the
+ CURLFTP_CREATE_DIR prefix.
+ */
+ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
- /* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+ /* Set this to a bitmask value to enable the particular authentications
+ methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
+ Note that setting multiple bits may cause extra network round-trips. */
+ CINIT(PROXYAUTH, LONG, 111),
- /* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+ /* FTP option that changes the timeout, in seconds, associated with
+ getting a response. This is different from transfer timeout time and
+ essentially places a demand on the FTP server to acknowledge commands
+ in a timely manner. */
+ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
- /* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
+ /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
+ tell libcurl to resolve names to those IP versions only. This only has
+ affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
+ CINIT(IPRESOLVE, LONG, 113),
- /* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
+ /* Set this option to limit the size of a file that will be downloaded from
+ an HTTP or FTP server.
- /* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
+ Note there is also _LARGE version which adds large file support for
+ platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
+ CINIT(MAXFILESIZE, LONG, 114),
- /* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
+ /* See the comment for INFILESIZE above, but in short, specifies
+ * the size of the file being uploaded. -1 means unknown.
+ */
+ CINIT(INFILESIZE_LARGE, OFF_T, 115),
- /* The CApath directory used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, OBJECTPOINT, 97),
+ /* Sets the continuation offset. There is also a LONG version of this;
+ * look above for RESUME_FROM.
+ */
+ CINIT(RESUME_FROM_LARGE, OFF_T, 116),
- /* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
-
- /* Instruct libcurl to not use any signal/alarm handlers, even when using
- timeouts. This option is useful for multi-threaded applications.
- See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
-
- /* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
-
- /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
- CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
-
- /* Set the Accept-Encoding string. Use this to tell a server you would like
- the response to be compressed. */
- CINIT(ENCODING, OBJECTPOINT, 102),
-
- /* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
-
- /* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
-
- /* Continue to send authentication (user+password) when following locations,
- even when hostname changed. This can potentially send off the name
- and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
-
- /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
- also disables the LPRT attempt). By default, those ones will always be
- attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_USERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
-
- /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
- in second argument. The function must be matching the
- curl_ssl_ctx_callback proto. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
-
- /* Set the userdata for the ssl context callback function's third
- argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
-
- /* FTP Option that causes missing dirs to be created on the remote server.
- In 7.19.4 we introduced the convenience enums for this option using the
- CURLFTP_CREATE_DIR prefix.
- */
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
-
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-
- /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
-
- /* Set this option to limit the size of a file that will be downloaded from
- an HTTP or FTP server.
-
- Note there is also _LARGE version which adds large file support for
- platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
-
- /* See the comment for INFILESIZE above, but in short, specifies
- * the size of the file being uploaded. -1 means unknown.
- */
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
-
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
- */
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
-
- /* Sets the maximum size of data that will be downloaded from
- * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
- */
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
-
- /* Set this option to the file name of your .netrc file you want libcurl
- to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
- a poor attempt to find the user's home directory and check for a .netrc
- file in there. */
- CINIT(NETRC_FILE, OBJECTPOINT, 118),
-
- /* Enable SSL/TLS for FTP, pick one of:
- CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
- CURLFTPSSL_CONTROL - SSL for the control connection or fail
- CURLFTPSSL_ALL - SSL for all communication or fail
- */
- CINIT(USE_SSL, LONG, 119),
-
- /* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
-
- /* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
-
- /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 123 OBSOLETE. Gone in 7.16.0 */
- /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 127 OBSOLETE. Gone in 7.16.0 */
- /* 128 OBSOLETE. Gone in 7.16.0 */
-
- /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
- can be used to change libcurl's default action which is to first try
- "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
- response has been received.
-
- Available parameters are:
- CURLFTPAUTH_DEFAULT - let libcurl decide
- CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
- CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
- */
- CINIT(FTPSSLAUTH, LONG, 129),
-
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
-
- /* 132 OBSOLETE. Gone in 7.16.0 */
- /* 133 OBSOLETE. Gone in 7.16.0 */
-
- /* zero terminated string for pass on to the FTP server when asked for
- "account" info */
- CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
-
- /* feed cookies into cookie engine */
- CINIT(COOKIELIST, OBJECTPOINT, 135),
-
- /* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
-
- /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
- response. Typically used for FTP-SSL purposes but is not restricted to
- that. libcurl will then instead use the same IP address it used for the
- control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
-
- /* Select "file method" to use when doing FTP, see the curl_ftpmethod
- above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
-
- /* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
-
- /* Number of ports to try, including the first one set with LOCALPORT.
- Thus, setting it to 1 will make no additional attempts but the first.
- */
- CINIT(LOCALPORTRANGE, LONG, 140),
-
- /* no transfer, set up connection and let application use the socket by
- extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
-
- /* Function that will be called to convert from the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
-
- /* Function that will be called to convert to the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
-
- /* Function that will be called to convert from UTF8
- (instead of using the iconv calls in libcurl)
- Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
-
- /* if the connection proceeds too quickly then need to slow it down */
- /* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
-
- /* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
-
- /* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
-
- /* set to 0 to disable session ID re-use for this transfer, default is
- enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
+ /* Sets the maximum size of data that will be downloaded from
+ * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
+ */
+ CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
+
+ /* Set this option to the file name of your .netrc file you want libcurl
+ to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
+ a poor attempt to find the user's home directory and check for a .netrc
+ file in there. */
+ CINIT(NETRC_FILE, OBJECTPOINT, 118),
+
+ /* Enable SSL/TLS for FTP, pick one of:
+ CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
+ CURLFTPSSL_CONTROL - SSL for the control connection or fail
+ CURLFTPSSL_ALL - SSL for all communication or fail
+ */
+ CINIT(USE_SSL, LONG, 119),
+
+ /* The _LARGE version of the standard POSTFIELDSIZE option */
+ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+
+ /* Enable/disable the TCP Nagle algorithm */
+ CINIT(TCP_NODELAY, LONG, 121),
+
+ /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 123 OBSOLETE. Gone in 7.16.0 */
+ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
+ /* 127 OBSOLETE. Gone in 7.16.0 */
+ /* 128 OBSOLETE. Gone in 7.16.0 */
+
+ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
+ can be used to change libcurl's default action which is to first try
+ "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
+ response has been received.
+
+ Available parameters are:
+ CURLFTPAUTH_DEFAULT - let libcurl decide
+ CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
+ CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
+ */
+ CINIT(FTPSSLAUTH, LONG, 129),
+
+ CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
+ CINIT(IOCTLDATA, OBJECTPOINT, 131),
+
+ /* 132 OBSOLETE. Gone in 7.16.0 */
+ /* 133 OBSOLETE. Gone in 7.16.0 */
+
+ /* zero terminated string for pass on to the FTP server when asked for
+ "account" info */
+ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
+
+ /* feed cookies into cookie engine */
+ CINIT(COOKIELIST, OBJECTPOINT, 135),
+
+ /* ignore Content-Length */
+ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
+
+ /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
+ response. Typically used for FTP-SSL purposes but is not restricted to
+ that. libcurl will then instead use the same IP address it used for the
+ control connection. */
+ CINIT(FTP_SKIP_PASV_IP, LONG, 137),
+
+ /* Select "file method" to use when doing FTP, see the curl_ftpmethod
+ above. */
+ CINIT(FTP_FILEMETHOD, LONG, 138),
+
+ /* Local port number to bind the socket to */
+ CINIT(LOCALPORT, LONG, 139),
+
+ /* Number of ports to try, including the first one set with LOCALPORT.
+ Thus, setting it to 1 will make no additional attempts but the first.
+ */
+ CINIT(LOCALPORTRANGE, LONG, 140),
+
+ /* no transfer, set up connection and let application use the socket by
+ extracting it with CURLINFO_LASTSOCKET */
+ CINIT(CONNECT_ONLY, LONG, 141),
+
+ /* Function that will be called to convert from the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
+
+ /* Function that will be called to convert to the
+ network encoding (instead of using the iconv calls in libcurl) */
+ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
+
+ /* Function that will be called to convert from UTF8
+ (instead of using the iconv calls in libcurl)
+ Note that this is used only for SSL certificate processing */
+ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
+
+ /* if the connection proceeds too quickly then need to slow it down */
+ /* limit-rate: maximum number of bytes per second to send or receive */
+ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
+ CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+
+ /* Pointer to command string to send if USER/PASS fails. */
+ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
+
+ /* callback function for setting socket options */
+ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
+ CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
+
+ /* set to 0 to disable session ID re-use for this transfer, default is
+ enabled (== 1) */
+ CINIT(SSL_SESSIONID_CACHE, LONG, 150),
- /* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
-
- /* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
+ /* allowed SSH authentication methods */
+ CINIT(SSH_AUTH_TYPES, LONG, 151),
+
+ /* Used by scp/sftp to do public/private key authentication */
+ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
+ CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
- /* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
+ /* Send CCC (Clear Command Channel) after authentication */
+ CINIT(FTP_SSL_CCC, LONG, 154),
- /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
-
- /* set to zero to disable the libcurl's decoding and thus pass the raw body
- data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
+ /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
+ CINIT(TIMEOUT_MS, LONG, 155),
+ CINIT(CONNECTTIMEOUT_MS, LONG, 156),
+
+ /* set to zero to disable the libcurl's decoding and thus pass the raw body
+ data to the application even when it is encoded/compressed */
+ CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
+ CINIT(HTTP_CONTENT_DECODING, LONG, 158),
- /* Permission used when creating new files and directories on the remote
- server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
+ /* Permission used when creating new files and directories on the remote
+ server for protocols that support it, SFTP/SCP/FILE */
+ CINIT(NEW_FILE_PERMS, LONG, 159),
+ CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
- /* Set the behaviour of POST when redirecting. Values must be set to one
- of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
+ /* Set the behaviour of POST when redirecting. Values must be set to one
+ of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
+ CINIT(POSTREDIR, LONG, 161),
- /* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
+ /* used by scp/sftp to verify the host's public key */
+ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
- /* Callback function for opening socket (instead of socket(2)). Optionally,
- callback is able change the address or refuse to connect returning
- CURL_SOCKET_BAD. The callback should have type
- curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
+ /* Callback function for opening socket (instead of socket(2)). Optionally,
+ callback is able change the address or refuse to connect returning
+ CURL_SOCKET_BAD. The callback should have type
+ curl_opensocket_callback */
+ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
+ CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
- /* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
+ /* POST volatile input fields. */
+ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
- /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
+ /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
+ CINIT(PROXY_TRANSFER_MODE, LONG, 166),
- /* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
+ /* Callback function for seeking in the input stream */
+ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
+ CINIT(SEEKDATA, OBJECTPOINT, 168),
- /* CRL file */
- CINIT(CRLFILE, OBJECTPOINT, 169),
+ /* CRL file */
+ CINIT(CRLFILE, OBJECTPOINT, 169),
- /* Issuer certificate */
- CINIT(ISSUERCERT, OBJECTPOINT, 170),
+ /* Issuer certificate */
+ CINIT(ISSUERCERT, OBJECTPOINT, 170),
- /* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
+ /* (IPv6) Address scope */
+ CINIT(ADDRESS_SCOPE, LONG, 171),
- /* Collect certificate chain info and allow it to get retrievable with
- CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
- working with OpenSSL-powered builds. */
- CINIT(CERTINFO, LONG, 172),
+ /* Collect certificate chain info and allow it to get retrievable with
+ CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
+ working with OpenSSL-powered builds. */
+ CINIT(CERTINFO, LONG, 172),
- /* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, OBJECTPOINT, 173),
- CINIT(PASSWORD, OBJECTPOINT, 174),
+ /* "name" and "pwd" to use when fetching. */
+ CINIT(USERNAME, OBJECTPOINT, 173),
+ CINIT(PASSWORD, OBJECTPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
- CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
-
- /* Comma separated list of hostnames defining no-proxy zones. These should
- match both hostnames directly, and hostnames within a domain. For
- example, local.com will match local.com and www.local.com, but NOT
- notlocal.com or www.notlocal.com. For compatibility with other
- implementations of this, .local.com will be considered to be the same as
- local.com. A single * is the only valid wildcard, and effectively
- disables the use of proxy. */
- CINIT(NOPROXY, OBJECTPOINT, 177),
-
- /* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
-
- /* set the bitmask for the protocols that are allowed to be used for the
- transfer, which thus helps the app which takes URLs from users or other
- external inputs and want to restrict what protocol(s) to deal
- with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
-
- /* set the bitmask for the protocols that libcurl is allowed to follow to,
- as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
-
- /* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
-
- /* set the SSH host key callback, must point to a curl_sshkeycallback
- function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
-
- /* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
-
- CURLOPT_LASTENTRY /* the last unused */
+ CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
+ CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
+
+ /* Comma separated list of hostnames defining no-proxy zones. These should
+ match both hostnames directly, and hostnames within a domain. For
+ example, local.com will match local.com and www.local.com, but NOT
+ notlocal.com or www.notlocal.com. For compatibility with other
+ implementations of this, .local.com will be considered to be the same as
+ local.com. A single * is the only valid wildcard, and effectively
+ disables the use of proxy. */
+ CINIT(NOPROXY, OBJECTPOINT, 177),
+
+ /* block size for TFTP transfers */
+ CINIT(TFTP_BLKSIZE, LONG, 178),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
+
+ /* Socks Service */
+ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
+
+ /* set the bitmask for the protocols that are allowed to be used for the
+ transfer, which thus helps the app which takes URLs from users or other
+ external inputs and want to restrict what protocol(s) to deal
+ with. Defaults to CURLPROTO_ALL. */
+ CINIT(PROTOCOLS, LONG, 181),
+
+ /* set the bitmask for the protocols that libcurl is allowed to follow to,
+ as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
+ to be set in both bitmasks to be allowed to get redirected to. Defaults
+ to all protocols except FILE and SCP. */
+ CINIT(REDIR_PROTOCOLS, LONG, 182),
+
+ /* set the SSH knownhost file name to use */
+ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+
+ /* set the SSH host key callback custom pointer */
+ CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+
+ CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -1299,49 +1299,49 @@ typedef enum {
#endif
- /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
- name resolves addresses using more than one IP protocol version, this
- option might be handy to force libcurl to use a specific IP version. */
+/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
+ name resolves addresses using more than one IP protocol version, this
+ option might be handy to force libcurl to use a specific IP version. */
#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
versions that your system allows */
#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
- /* three convenient "aliases" that follow the name scheme better */
+/* three convenient "aliases" that follow the name scheme better */
#define CURLOPT_WRITEDATA CURLOPT_FILE
#define CURLOPT_READDATA CURLOPT_INFILE
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
+/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
enum {
- CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
+ CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
like the library to choose the best possible
for us! */
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
+ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
+ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
+ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
- /* These enums are for use with the CURLOPT_NETRC option. */
+/* These enums are for use with the CURLOPT_NETRC option. */
enum CURL_NETRC_OPTION {
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
+ CURL_NETRC_IGNORED, /* The .netrc will never be read.
* This is the default. */
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
+ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
* to one in the .netrc. */
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
+ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
* Unless one is set programmatically, the .netrc
* will be queried. */
- CURL_NETRC_LAST
+ CURL_NETRC_LAST
};
enum {
- CURL_SSLVERSION_DEFAULT,
- CURL_SSLVERSION_TLSv1,
- CURL_SSLVERSION_SSLv2,
- CURL_SSLVERSION_SSLv3,
+ CURL_SSLVERSION_DEFAULT,
+ CURL_SSLVERSION_TLSv1,
+ CURL_SSLVERSION_SSLv2,
+ CURL_SSLVERSION_SSLv3,
- CURL_SSLVERSION_LAST /* never use, keep last */
+ CURL_SSLVERSION_LAST /* never use, keep last */
};
/* symbols to use with CURLOPT_POSTREDIR.
@@ -1354,13 +1354,13 @@ enum {
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
typedef enum {
- CURL_TIMECOND_NONE,
+ CURL_TIMECOND_NONE,
- CURL_TIMECOND_IFMODSINCE,
- CURL_TIMECOND_IFUNMODSINCE,
- CURL_TIMECOND_LASTMOD,
+ CURL_TIMECOND_IFMODSINCE,
+ CURL_TIMECOND_IFUNMODSINCE,
+ CURL_TIMECOND_LASTMOD,
- CURL_TIMECOND_LAST
+ CURL_TIMECOND_LAST
} curl_TimeCond;
@@ -1382,41 +1382,41 @@ CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
#endif
typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
-
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
-
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
-
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
-
- CURLFORM_LASTENTRY /* the last unused */
+ CFINIT(NOTHING), /********* the first one is unused ************/
+
+ /* */
+ CFINIT(COPYNAME),
+ CFINIT(PTRNAME),
+ CFINIT(NAMELENGTH),
+ CFINIT(COPYCONTENTS),
+ CFINIT(PTRCONTENTS),
+ CFINIT(CONTENTSLENGTH),
+ CFINIT(FILECONTENT),
+ CFINIT(ARRAY),
+ CFINIT(OBSOLETE),
+ CFINIT(FILE),
+
+ CFINIT(BUFFER),
+ CFINIT(BUFFERPTR),
+ CFINIT(BUFFERLENGTH),
+
+ CFINIT(CONTENTTYPE),
+ CFINIT(CONTENTHEADER),
+ CFINIT(FILENAME),
+ CFINIT(END),
+ CFINIT(OBSOLETE2),
+
+ CFINIT(STREAM),
+
+ CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
#undef CFINIT /* done */
/* structure to be used as parameter for CURLFORM_ARRAY */
struct curl_forms {
- CURLformoption option;
- const char *value;
+ CURLformoption option;
+ const char *value;
};
/* use this for multipart formpost building */
@@ -1436,17 +1436,17 @@ struct curl_forms {
*
***************************************************************************/
typedef enum {
- CURL_FORMADD_OK, /* first, no error */
+ CURL_FORMADD_OK, /* first, no error */
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
+ CURL_FORMADD_MEMORY,
+ CURL_FORMADD_OPTION_TWICE,
+ CURL_FORMADD_NULL,
+ CURL_FORMADD_UNKNOWN_OPTION,
+ CURL_FORMADD_INCOMPLETE,
+ CURL_FORMADD_ILLEGAL_ARRAY,
+ CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
- CURL_FORMADD_LAST /* last */
+ CURL_FORMADD_LAST /* last */
} CURLFORMcode;
/*
@@ -1586,11 +1586,11 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* memory management routines like malloc, free etc.
*/
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
- curl_malloc_callback m,
- curl_free_callback f,
- curl_realloc_callback r,
- curl_strdup_callback s,
- curl_calloc_callback c);
+ curl_malloc_callback m,
+ curl_free_callback f,
+ curl_realloc_callback r,
+ curl_strdup_callback s,
+ curl_calloc_callback c);
/*
* NAME curl_global_cleanup()
@@ -1604,8 +1604,8 @@ CURL_EXTERN void curl_global_cleanup(void);
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
- char *data;
- struct curl_slist *next;
+ char *data;
+ struct curl_slist *next;
};
/*
@@ -1617,7 +1617,7 @@ struct curl_slist {
* first. Returns the new list, after appending.
*/
CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
+ const char *);
/*
* NAME curl_slist_free_all()
@@ -1642,8 +1642,8 @@ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
/* info about the certificate chain, only for OpenSSL builds. Asked
for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
- int num_of_certs; /* number of certificates with information */
- struct curl_slist **certinfo; /* for each index in this array, there's a
+ int num_of_certs; /* number of certificates with information */
+ struct curl_slist **certinfo; /* for each index in this array, there's a
linked list with textual information in the
format "name: value" */
};
@@ -1656,45 +1656,45 @@ struct curl_certinfo {
#define CURLINFO_TYPEMASK 0xf00000
typedef enum {
- CURLINFO_NONE, /* first, never use this */
- CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
- CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
- CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
- CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
- CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
- CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
- CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
- CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
- CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
- CURLINFO_FILETIME = CURLINFO_LONG + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
- CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
- CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
- CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
- CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
- CURLINFO_PRIVATE = CURLINFO_STRING + 21,
- CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
- CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
- CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
- CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
- CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
- CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
- CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
- CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
- CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
- CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
- CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
- CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
- CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
- /* Fill in new entries below here! */
-
- CURLINFO_LASTONE = 35
+ CURLINFO_NONE, /* first, never use this */
+ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
+ CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
+ CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
+ CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
+ CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
+ CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
+ CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
+ CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
+ CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
+ CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
+ CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
+ CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
+ CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
+ CURLINFO_FILETIME = CURLINFO_LONG + 14,
+ CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
+ CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
+ CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
+ CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
+ CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
+ CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
+ CURLINFO_PRIVATE = CURLINFO_STRING + 21,
+ CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
+ CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
+ CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
+ CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
+ CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
+ CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
+ CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
+ CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
+ CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
+ CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
+ CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
+ CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
+ CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
+ CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
+ /* Fill in new entries below here! */
+
+ CURLINFO_LASTONE = 35
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -1702,15 +1702,15 @@ typedef enum {
#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
typedef enum {
- CURLCLOSEPOLICY_NONE, /* first, never use this */
+ CURLCLOSEPOLICY_NONE, /* first, never use this */
- CURLCLOSEPOLICY_OLDEST,
- CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
- CURLCLOSEPOLICY_LEAST_TRAFFIC,
- CURLCLOSEPOLICY_SLOWEST,
- CURLCLOSEPOLICY_CALLBACK,
+ CURLCLOSEPOLICY_OLDEST,
+ CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
+ CURLCLOSEPOLICY_LEAST_TRAFFIC,
+ CURLCLOSEPOLICY_SLOWEST,
+ CURLCLOSEPOLICY_CALLBACK,
- CURLCLOSEPOLICY_LAST /* last, never use this */
+ CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
#define CURL_GLOBAL_SSL (1<<0)
@@ -1726,25 +1726,25 @@ typedef enum {
/* Different data locks for a single share */
typedef enum {
- CURL_LOCK_DATA_NONE = 0,
- /* CURL_LOCK_DATA_SHARE is used internally to say that
- * the locking is just made to change the internal state of the share
- * itself.
- */
- CURL_LOCK_DATA_SHARE,
- CURL_LOCK_DATA_COOKIE,
- CURL_LOCK_DATA_DNS,
- CURL_LOCK_DATA_SSL_SESSION,
- CURL_LOCK_DATA_CONNECT,
- CURL_LOCK_DATA_LAST
+ CURL_LOCK_DATA_NONE = 0,
+ /* CURL_LOCK_DATA_SHARE is used internally to say that
+ * the locking is just made to change the internal state of the share
+ * itself.
+ */
+ CURL_LOCK_DATA_SHARE,
+ CURL_LOCK_DATA_COOKIE,
+ CURL_LOCK_DATA_DNS,
+ CURL_LOCK_DATA_SSL_SESSION,
+ CURL_LOCK_DATA_CONNECT,
+ CURL_LOCK_DATA_LAST
} curl_lock_data;
/* Different lock access types */
typedef enum {
- CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
- CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
- CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
- CURL_LOCK_ACCESS_LAST /* never use */
+ CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
+ CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
+ CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
+ CURL_LOCK_ACCESS_LAST /* never use */
} curl_lock_access;
typedef void (*curl_lock_function)(CURL *handle,
@@ -1758,23 +1758,23 @@ typedef void (*curl_unlock_function)(CURL *handle,
typedef void CURLSH;
typedef enum {
- CURLSHE_OK, /* all is fine */
- CURLSHE_BAD_OPTION, /* 1 */
- CURLSHE_IN_USE, /* 2 */
- CURLSHE_INVALID, /* 3 */
- CURLSHE_NOMEM, /* out of memory */
- CURLSHE_LAST /* never use */
+ CURLSHE_OK, /* all is fine */
+ CURLSHE_BAD_OPTION, /* 1 */
+ CURLSHE_IN_USE, /* 2 */
+ CURLSHE_INVALID, /* 3 */
+ CURLSHE_NOMEM, /* out of memory */
+ CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
- CURLSHOPT_NONE, /* don't use */
- CURLSHOPT_SHARE, /* specify a data type to share */
- CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
- CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
- CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
- CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
+ CURLSHOPT_NONE, /* don't use */
+ CURLSHOPT_SHARE, /* specify a data type to share */
+ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
+ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
+ CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
+ CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
callback functions */
- CURLSHOPT_LAST /* never use */
+ CURLSHOPT_LAST /* never use */
} CURLSHoption;
CURL_EXTERN CURLSH *curl_share_init(void);
@@ -1786,11 +1786,11 @@ CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
*/
typedef enum {
- CURLVERSION_FIRST,
- CURLVERSION_SECOND,
- CURLVERSION_THIRD,
- CURLVERSION_FOURTH,
- CURLVERSION_LAST /* never actually use this */
+ CURLVERSION_FIRST,
+ CURLVERSION_SECOND,
+ CURLVERSION_THIRD,
+ CURLVERSION_FOURTH,
+ CURLVERSION_LAST /* never actually use this */
} CURLversion;
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
@@ -1801,30 +1801,30 @@ typedef enum {
#define CURLVERSION_NOW CURLVERSION_FOURTH
typedef struct {
- CURLversion age; /* age of the returned struct */
- const char *version; /* LIBCURL_VERSION */
- unsigned int version_num; /* LIBCURL_VERSION_NUM */
- const char *host; /* OS/host/cpu/machine when configured */
- int features; /* bitmask, see defines below */
- const char *ssl_version; /* human readable string */
- long ssl_version_num; /* not used anymore, always 0 */
- const char *libz_version; /* human readable string */
- /* protocols is terminated by an entry with a NULL protoname */
- const char * const *protocols;
-
- /* The fields below this were added in CURLVERSION_SECOND */
- const char *ares;
- int ares_num;
-
- /* This field was added in CURLVERSION_THIRD */
- const char *libidn;
-
- /* These field were added in CURLVERSION_FOURTH */
-
- /* Same as '_libiconv_version' if built with HAVE_ICONV */
- int iconv_ver_num;
-
- const char *libssh_version; /* human readable string */
+ CURLversion age; /* age of the returned struct */
+ const char *version; /* LIBCURL_VERSION */
+ unsigned int version_num; /* LIBCURL_VERSION_NUM */
+ const char *host; /* OS/host/cpu/machine when configured */
+ int features; /* bitmask, see defines below */
+ const char *ssl_version; /* human readable string */
+ long ssl_version_num; /* not used anymore, always 0 */
+ const char *libz_version; /* human readable string */
+ /* protocols is terminated by an entry with a NULL protoname */
+ const char * const *protocols;
+
+ /* The fields below this were added in CURLVERSION_SECOND */
+ const char *ares;
+ int ares_num;
+
+ /* This field was added in CURLVERSION_THIRD */
+ const char *libidn;
+
+ /* These field were added in CURLVERSION_FOURTH */
+
+ /* Same as '_libiconv_version' if built with HAVE_ICONV */
+ int iconv_ver_num;
+
+ const char *libssh_version; /* human readable string */
} curl_version_info_data;
diff --git a/thirdparties/wince/include/curl/curlbuild.h b/thirdparties/wince/include/curl/curlbuild.h
index 9cb3473..b482cbb 100755
--- a/thirdparties/wince/include/curl/curlbuild.h
+++ b/thirdparties/wince/include/curl/curlbuild.h
@@ -111,52 +111,52 @@
#ifdef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
+Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
#endif
#ifdef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
+Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
#endif
/* ================================================================ */
@@ -554,7 +554,7 @@
#else
# error "Unknown non-configure build target!"
- Error Compilation_aborted_Unknown_non_configure_build_target
+Error Compilation_aborted_Unknown_non_configure_build_target
#endif
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
@@ -572,13 +572,13 @@
/* Data type definition of curl_socklen_t. */
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
- typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
+typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
#endif
/* Data type definition of curl_off_t. */
#ifdef CURL_TYPEOF_CURL_OFF_T
- typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
+typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
#endif
#endif /* __CURL_CURLBUILD_H */
diff --git a/thirdparties/wince/include/curl/curlrules.h b/thirdparties/wince/include/curl/curlrules.h
index 4401873..c676ed1 100755
--- a/thirdparties/wince/include/curl/curlrules.h
+++ b/thirdparties/wince/include/curl/curlrules.h
@@ -78,52 +78,52 @@
#ifndef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
+Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
#endif
#ifndef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
+Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
+Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
#endif
/*
@@ -140,8 +140,8 @@
*/
typedef char
- __curl_rule_01__
- [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
+__curl_rule_01__
+[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
/*
* Verify that the size previously defined and expected for
@@ -150,8 +150,8 @@ typedef char
*/
typedef char
- __curl_rule_02__
- [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
+__curl_rule_02__
+[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
/*
* Verify at compile time that the size of curl_off_t as reported
@@ -160,8 +160,8 @@ typedef char
*/
typedef char
- __curl_rule_03__
- [CurlchkszGE(curl_off_t, long)];
+__curl_rule_03__
+[CurlchkszGE(curl_off_t, long)];
/*
* Verify that the size previously defined and expected for
@@ -170,8 +170,8 @@ typedef char
*/
typedef char
- __curl_rule_04__
- [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
+__curl_rule_04__
+[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
/*
* Verify at compile time that the size of curl_socklen_t as reported
@@ -180,14 +180,14 @@ typedef char
*/
typedef char
- __curl_rule_05__
- [CurlchkszGE(curl_socklen_t, int)];
+__curl_rule_05__
+[CurlchkszGE(curl_socklen_t, int)];
/* ================================================================ */
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
/* ================================================================ */
-/*
+/*
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
* these to be visible and exported by the external libcurl interface API,
* while also making them visible to the library internals, simply including
@@ -206,10 +206,10 @@ typedef char
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
defined(__ILEC400__)
- /* This compiler is believed to have an ISO compatible preprocessor */
+/* This compiler is believed to have an ISO compatible preprocessor */
#define CURL_ISOCPP
#else
- /* This compiler is believed NOT to have an ISO compatible preprocessor */
+/* This compiler is believed NOT to have an ISO compatible preprocessor */
#undef CURL_ISOCPP
#endif
diff --git a/thirdparties/wince/include/curl/multi.h b/thirdparties/wince/include/curl/multi.h
index 153f772..a71fe42 100755
--- a/thirdparties/wince/include/curl/multi.h
+++ b/thirdparties/wince/include/curl/multi.h
@@ -56,16 +56,16 @@ extern "C" {
typedef void CURLM;
typedef enum {
- CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
+ CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
curl_multi_socket*() soon */
- CURLM_OK,
- CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
- CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
- CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
- CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
- CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
- CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
- CURLM_LAST
+ CURLM_OK,
+ CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
+ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
+ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
+ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
+ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
+ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
+ CURLM_LAST
} CURLMcode;
/* just to make code nicer when using curl_multi_socket() you can now check
@@ -74,19 +74,19 @@ typedef enum {
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
typedef enum {
- CURLMSG_NONE, /* first, not used */
- CURLMSG_DONE, /* This easy handle has completed. 'result' contains
+ CURLMSG_NONE, /* first, not used */
+ CURLMSG_DONE, /* This easy handle has completed. 'result' contains
the CURLcode of the transfer */
- CURLMSG_LAST /* last, not used */
+ CURLMSG_LAST /* last, not used */
} CURLMSG;
struct CURLMsg {
- CURLMSG msg; /* what this message means */
- CURL *easy_handle; /* the handle it concerns */
- union {
- void *whatever; /* message-specific data */
- CURLcode result; /* return code for transfer */
- } data;
+ CURLMSG msg; /* what this message means */
+ CURL *easy_handle; /* the handle it concerns */
+ union {
+ void *whatever; /* message-specific data */
+ CURLcode result; /* return code for transfer */
+ } data;
};
typedef struct CURLMsg CURLMsg;
@@ -107,62 +107,62 @@ CURL_EXTERN CURLM *curl_multi_init(void);
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_remove_handle()
- *
- * Desc: removes a curl handle from the multi stack again
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_remove_handle()
+ *
+ * Desc: removes a curl handle from the multi stack again
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_fdset()
- *
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
- * poll() on. We want curl_multi_perform() called as soon as one of
- * them are ready.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ CURL *curl_handle);
+
+/*
+ * Name: curl_multi_fdset()
+ *
+ * Desc: Ask curl for its fd_set sets. The app can use these to select() or
+ * poll() on. We want curl_multi_perform() called as soon as one of
+ * them are ready.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
fd_set *exc_fd_set,
int *max_fd);
- /*
- * Name: curl_multi_perform()
- *
- * Desc: When the app thinks there's data available for curl it calls this
- * function to read/write whatever there is right now. This returns
- * as soon as the reads and writes are done. This function does not
- * require that there actually is data available for reading or that
- * data can be written, it can be called just in case. It returns
- * the number of handles that still transfer data in the second
- * argument's integer-pointer.
- *
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
- * returns errors etc regarding the whole multi stack. There might
- * still have occurred problems on invidual transfers even when this
- * returns OK.
- */
+/*
+ * Name: curl_multi_perform()
+ *
+ * Desc: When the app thinks there's data available for curl it calls this
+ * function to read/write whatever there is right now. This returns
+ * as soon as the reads and writes are done. This function does not
+ * require that there actually is data available for reading or that
+ * data can be written, it can be called just in case. It returns
+ * the number of handles that still transfer data in the second
+ * argument's integer-pointer.
+ *
+ * Returns: CURLMcode type, general multi error code. *NOTE* that this only
+ * returns errors etc regarding the whole multi stack. There might
+ * still have occurred problems on invidual transfers even when this
+ * returns OK.
+ */
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
- int *running_handles);
-
- /*
- * Name: curl_multi_cleanup()
- *
- * Desc: Cleans up and removes a whole multi stack. It does not free or
- * touch any individual easy handles in any way. We need to define
- * in what state those handles will be if this function is called
- * in the middle of a transfer.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+ int *running_handles);
+
+/*
+ * Name: curl_multi_cleanup()
+ *
+ * Desc: Cleans up and removes a whole multi stack. It does not free or
+ * touch any individual easy handles in any way. We need to define
+ * in what state those handles will be if this function is called
+ * in the middle of a transfer.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
@@ -194,7 +194,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* to.
*/
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
- int *msgs_in_queue);
+ int *msgs_in_queue);
/*
* Name: curl_multi_strerror()
@@ -246,20 +246,20 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
* Returns: The callback should return zero.
*/
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
- long timeout_ms, /* see above */
- void *userp); /* private callback
+ long timeout_ms, /* see above */
+ void *userp); /* private callback
pointer */
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
- curl_socket_t s,
- int ev_bitmask,
- int *running_handles);
+ curl_socket_t s,
+ int ev_bitmask,
+ int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
+ int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
@@ -278,7 +278,7 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
- long *milliseconds);
+ long *milliseconds);
#undef CINIT /* re-using the same name as in curl.h */
@@ -294,25 +294,25 @@ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
#endif
typedef enum {
- /* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
+ /* This is the socket callback function pointer */
+ CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
- /* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
+ /* This is the argument passed to the socket callback */
+ CINIT(SOCKETDATA, OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
+ CINIT(PIPELINING, LONG, 3),
- /* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+ /* This is the timer callback function pointer */
+ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
- /* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
+ /* This is the argument passed to the timer callback */
+ CINIT(TIMERDATA, OBJECTPOINT, 5),
- /* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
+ /* maximum number of entries in the connection cache */
+ CINIT(MAXCONNECTS, LONG, 6),
- CURLMOPT_LASTENTRY /* the last unused */
+ CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
diff --git a/thirdparties/wince/include/curl/stdcheaders.h b/thirdparties/wince/include/curl/stdcheaders.h
index f739d7f..0ff0be0 100755
--- a/thirdparties/wince/include/curl/stdcheaders.h
+++ b/thirdparties/wince/include/curl/stdcheaders.h
@@ -1,10 +1,10 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -12,7 +12,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
diff --git a/thirdparties/wince/include/curl/typecheck-gcc.h b/thirdparties/wince/include/curl/typecheck-gcc.h
index 9788305..781aa2d 100755
--- a/thirdparties/wince/include/curl/typecheck-gcc.h
+++ b/thirdparties/wince/include/curl/typecheck-gcc.h
@@ -123,56 +123,56 @@ __extension__ ({ \
__attribute__((noinline)) id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
- "curl_easy_setopt expects a long argument for this option")
+ "curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
- "curl_easy_setopt expects a curl_off_t argument for this option")
+ "curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
- "curl_easy_setopt expects a string (char* or char[]) argument for this option"
- )
+ "curl_easy_setopt expects a string (char* or char[]) argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
- "curl_easy_setopt expects a curl_write_callback argument for this option")
+ "curl_easy_setopt expects a curl_write_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
- "curl_easy_setopt expects a curl_read_callback argument for this option")
+ "curl_easy_setopt expects a curl_read_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
- "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
+ "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
- "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
+ "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
- "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
- )
+ "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
+ )
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
- "curl_easy_setopt expects a curl_progress_callback argument for this option")
+ "curl_easy_setopt expects a curl_progress_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
- "curl_easy_setopt expects a curl_debug_callback argument for this option")
+ "curl_easy_setopt expects a curl_debug_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
- "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
+ "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
- "curl_easy_setopt expects a curl_conv_callback argument for this option")
+ "curl_easy_setopt expects a curl_conv_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
- "curl_easy_setopt expects a curl_seek_callback argument for this option")
+ "curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
- "curl_easy_setopt expects a private data pointer as argument for this option")
+ "curl_easy_setopt expects a private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
- "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
+ "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
- "curl_easy_setopt expects a FILE* argument for this option")
+ "curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
- "curl_easy_setopt expects a void* or char* argument for this option")
+ "curl_easy_setopt expects a void* or char* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
- "curl_easy_setopt expects a struct curl_httppost* argument for this option")
+ "curl_easy_setopt expects a struct curl_httppost* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
- "curl_easy_setopt expects a struct curl_slist* argument for this option")
+ "curl_easy_setopt expects a struct curl_slist* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
- "curl_easy_setopt expects a CURLSH* argument for this option")
+ "curl_easy_setopt expects a CURLSH* argument for this option")
_CURL_WARNING(_curl_easy_getinfo_err_string,
- "curl_easy_getinfo expects a pointer to char * for this info")
+ "curl_easy_getinfo expects a pointer to char * for this info")
_CURL_WARNING(_curl_easy_getinfo_err_long,
- "curl_easy_getinfo expects a pointer to long for this info")
+ "curl_easy_getinfo expects a pointer to long for this info")
_CURL_WARNING(_curl_easy_getinfo_err_double,
- "curl_easy_getinfo expects a pointer to double for this info")
+ "curl_easy_getinfo expects a pointer to double for this info")
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
- "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
+ "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
/* groups of curl_easy_setops options that take the same type of argument */
@@ -457,13 +457,13 @@ typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
_curl_callback_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (_curl_opensocket_callback1)
- (void *, curlsocktype, struct curl_sockaddr *);
+(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback2)
- (void *, curlsocktype, const struct curl_sockaddr *);
+(void *, curlsocktype, const struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback3)
- (const void *, curlsocktype, struct curl_sockaddr *);
+(const void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (_curl_opensocket_callback4)
- (const void *, curlsocktype, const struct curl_sockaddr *);
+(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
#define _curl_is_progress_cb(expr) \
@@ -472,9 +472,9 @@ typedef curl_socket_t (_curl_opensocket_callback4)
_curl_callback_compatible((expr), _curl_progress_callback1) || \
_curl_callback_compatible((expr), _curl_progress_callback2))
typedef int (_curl_progress_callback1)(void *,
- double, double, double, double);
+ double, double, double, double);
typedef int (_curl_progress_callback2)(const void *,
- double, double, double, double);
+ double, double, double, double);
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
#define _curl_is_debug_cb(expr) \
@@ -485,13 +485,13 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
typedef int (_curl_debug_callback1) (CURL *,
- curl_infotype, char *, size_t, void *);
+ curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
- curl_infotype, char *, size_t, const void *);
+ curl_infotype, char *, size_t, const void *);
typedef int (_curl_debug_callback3) (CURL *,
- curl_infotype, const char *, size_t, void *);
+ curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
- curl_infotype, const char *, size_t, const void *);
+ curl_infotype, const char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
diff --git a/thirdparties/wince/include/inttypes.h b/thirdparties/wince/include/inttypes.h
index 4b3828a..2304cea 100755
--- a/thirdparties/wince/include/inttypes.h
+++ b/thirdparties/wince/include/inttypes.h
@@ -1,32 +1,32 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
// Copyright (c) 2006 Alexander Chemeris
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
-//
+//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
-//
+//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
+//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
@@ -45,8 +45,8 @@
// 7.8 Format conversion of integer types
typedef struct {
- intmax_t quot;
- intmax_t rem;
+ intmax_t quot;
+ intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
@@ -279,18 +279,18 @@ _inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
- imaxdiv_t result;
+ imaxdiv_t result;
- result.quot = numer / denom;
- result.rem = numer % denom;
+ result.quot = numer / denom;
+ result.rem = numer % denom;
- if (numer < 0 && result.rem > 0) {
- // did division wrong; must fix up
- ++result.quot;
- result.rem -= denom;
- }
+ if (numer < 0 && result.rem > 0) {
+ // did division wrong; must fix up
+ ++result.quot;
+ result.rem -= denom;
+ }
- return result;
+ return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
diff --git a/thirdparties/wince/include/libxml/DOCBparser.h b/thirdparties/wince/include/libxml/DOCBparser.h
index 461d4ee..8fa4db3 100755
--- a/thirdparties/wince/include/libxml/DOCBparser.h
+++ b/thirdparties/wince/include/libxml/DOCBparser.h
@@ -42,50 +42,50 @@ typedef xmlDocPtr docbDocPtr;
* There is only few public functions.
*/
XMLPUBFUN int XMLCALL
- docbEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
+docbEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
-XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseDoc (xmlChar *cur,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN docbDocPtr XMLCALL
- docbParseDoc (xmlChar *cur,
- const char *encoding);
-XMLPUBFUN docbDocPtr XMLCALL
- docbSAXParseFile (const char *filename,
- const char *encoding,
- docbSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN docbDocPtr XMLCALL
- docbParseFile (const char *filename,
- const char *encoding);
+XMLPUBFUN docbDocPtr XMLCALL
+docbSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN docbDocPtr XMLCALL
+docbParseDoc (xmlChar *cur,
+ const char *encoding);
+XMLPUBFUN docbDocPtr XMLCALL
+docbSAXParseFile (const char *filename,
+ const char *encoding,
+ docbSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN docbDocPtr XMLCALL
+docbParseFile (const char *filename,
+ const char *encoding);
/**
* Interfaces for the Push mode.
*/
-XMLPUBFUN void XMLCALL
- docbFreeParserCtxt (docbParserCtxtPtr ctxt);
-XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- docbParseChunk (docbParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
-XMLPUBFUN docbParserCtxtPtr XMLCALL
- docbCreateFileParserCtxt(const char *filename,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- docbParseDocument (docbParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+docbFreeParserCtxt (docbParserCtxtPtr ctxt);
+XMLPUBFUN docbParserCtxtPtr XMLCALL
+docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+docbParseChunk (docbParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
+XMLPUBFUN docbParserCtxtPtr XMLCALL
+docbCreateFileParserCtxt(const char *filename,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+docbParseDocument (docbParserCtxtPtr ctxt);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/HTMLparser.h b/thirdparties/wince/include/libxml/HTMLparser.h
index 05905e4..b4ea632 100755
--- a/thirdparties/wince/include/libxml/HTMLparser.h
+++ b/thirdparties/wince/include/libxml/HTMLparser.h
@@ -51,16 +51,16 @@ struct _htmlElemDesc {
char isinline; /* is this a block 0 or inline 1 element */
const char *desc; /* the description */
-/* NRK Jan.2003
- * New fields encapsulating HTML structure
- *
- * Bugs:
- * This is a very limited representation. It fails to tell us when
- * an element *requires* subelements (we only have whether they're
- * allowed or not), and it doesn't tell us where CDATA and PCDATA
- * are allowed. Some element relationships are not fully represented:
- * these are flagged with the word MODIFIER
- */
+ /* NRK Jan.2003
+ * New fields encapsulating HTML structure
+ *
+ * Bugs:
+ * This is a very limited representation. It fails to tell us when
+ * an element *requires* subelements (we only have whether they're
+ * allowed or not), and it doesn't tell us where CDATA and PCDATA
+ * are allowed. Some element relationships are not fully represented:
+ * these are flagged with the word MODIFIER
+ */
const char** subelts; /* allowed sub-elements of this element */
const char* defaultsubelt; /* subelement for suggested auto-repair
if necessary or NULL */
@@ -83,88 +83,88 @@ struct _htmlEntityDesc {
/*
* There is only few public functions.
*/
-XMLPUBFUN const htmlElemDesc * XMLCALL
- htmlTagLookup (const xmlChar *tag);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityLookup(const xmlChar *name);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlEntityValueLookup(unsigned int value);
+XMLPUBFUN const htmlElemDesc * XMLCALL
+htmlTagLookup (const xmlChar *tag);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlEntityLookup(const xmlChar *name);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlEntityValueLookup(unsigned int value);
-XMLPUBFUN int XMLCALL
- htmlIsAutoClosed(htmlDocPtr doc,
- htmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- htmlAutoCloseTag(htmlDocPtr doc,
- const xmlChar *name,
- htmlNodePtr elem);
-XMLPUBFUN const htmlEntityDesc * XMLCALL
- htmlParseEntityRef(htmlParserCtxtPtr ctxt,
- const xmlChar **str);
-XMLPUBFUN int XMLCALL
- htmlParseCharRef(htmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- htmlParseElement(htmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+htmlIsAutoClosed(htmlDocPtr doc,
+ htmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+htmlAutoCloseTag(htmlDocPtr doc,
+ const xmlChar *name,
+ htmlNodePtr elem);
+XMLPUBFUN const htmlEntityDesc * XMLCALL
+htmlParseEntityRef(htmlParserCtxtPtr ctxt,
+ const xmlChar **str);
+XMLPUBFUN int XMLCALL
+htmlParseCharRef(htmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+htmlParseElement(htmlParserCtxtPtr ctxt);
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlNewParserCtxt(void);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlNewParserCtxt(void);
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreateMemoryParserCtxt(const char *buffer,
- int size);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
-XMLPUBFUN int XMLCALL
- htmlParseDocument(htmlParserCtxtPtr ctxt);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseDoc (xmlChar *cur,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseDoc (xmlChar *cur,
- const char *encoding);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlSAXParseFile(const char *filename,
- const char *encoding,
- htmlSAXHandlerPtr sax,
- void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlParseFile (const char *filename,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- UTF8ToHtml (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
-XMLPUBFUN int XMLCALL
- htmlEncodeEntities(unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen, int quoteChar);
-XMLPUBFUN int XMLCALL
- htmlIsScriptAttribute(const xmlChar *name);
-XMLPUBFUN int XMLCALL
- htmlHandleOmittedElem(int val);
+XMLPUBFUN int XMLCALL
+htmlParseDocument(htmlParserCtxtPtr ctxt);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlSAXParseDoc (xmlChar *cur,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlParseDoc (xmlChar *cur,
+ const char *encoding);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlSAXParseFile(const char *filename,
+ const char *encoding,
+ htmlSAXHandlerPtr sax,
+ void *userData);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlParseFile (const char *filename,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+UTF8ToHtml (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
+XMLPUBFUN int XMLCALL
+htmlEncodeEntities(unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen, int quoteChar);
+XMLPUBFUN int XMLCALL
+htmlIsScriptAttribute(const xmlChar *name);
+XMLPUBFUN int XMLCALL
+htmlHandleOmittedElem(int val);
#ifdef LIBXML_PUSH_ENABLED
/**
* Interfaces for the Push mode.
*/
-XMLPUBFUN htmlParserCtxtPtr XMLCALL
- htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- htmlParseChunk (htmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+XMLPUBFUN htmlParserCtxtPtr XMLCALL
+htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+htmlParseChunk (htmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
-XMLPUBFUN void XMLCALL
- htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -186,78 +186,78 @@ typedef enum {
} htmlParserOption;
XMLPUBFUN void XMLCALL
- htmlCtxtReset (htmlParserCtxtPtr ctxt);
+htmlCtxtReset (htmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
- int options);
+htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFile (const char *URL,
- const char *encoding,
- int options);
+htmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN htmlDocPtr XMLCALL
- htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/* NRK/Jan2003: further knowledge of HTML structure
*/
typedef enum {
- HTML_NA = 0 , /* something we don't check at all */
- HTML_INVALID = 0x1 ,
- HTML_DEPRECATED = 0x2 ,
- HTML_VALID = 0x4 ,
- HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
+ HTML_NA = 0 , /* something we don't check at all */
+ HTML_INVALID = 0x1 ,
+ HTML_DEPRECATED = 0x2 ,
+ HTML_VALID = 0x4 ,
+ HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
} htmlStatus ;
/* Using htmlElemDesc rather than name here, to emphasise the fact
diff --git a/thirdparties/wince/include/libxml/HTMLtree.h b/thirdparties/wince/include/libxml/HTMLtree.h
index 6ea8207..c5258ca 100755
--- a/thirdparties/wince/include/libxml/HTMLtree.h
+++ b/thirdparties/wince/include/libxml/HTMLtree.h
@@ -60,81 +60,81 @@ extern "C" {
#define HTML_PI_NODE XML_PI_NODE
XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDoc (const xmlChar *URI,
- const xmlChar *ExternalID);
-XMLPUBFUN htmlDocPtr XMLCALL
- htmlNewDocNoDtD (const xmlChar *URI,
- const xmlChar *ExternalID);
-XMLPUBFUN const xmlChar * XMLCALL
- htmlGetMetaEncoding (htmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- htmlSetMetaEncoding (htmlDocPtr doc,
- const xmlChar *encoding);
+htmlNewDoc (const xmlChar *URI,
+ const xmlChar *ExternalID);
+XMLPUBFUN htmlDocPtr XMLCALL
+htmlNewDocNoDtD (const xmlChar *URI,
+ const xmlChar *ExternalID);
+XMLPUBFUN const xmlChar * XMLCALL
+htmlGetMetaEncoding (htmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+htmlSetMetaEncoding (htmlDocPtr doc,
+ const xmlChar *encoding);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- htmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
-XMLPUBFUN void XMLCALL
- htmlDocDumpMemoryFormat (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
-XMLPUBFUN int XMLCALL
- htmlDocDump (FILE *f,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- htmlSaveFile (const char *filename,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- htmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpFile (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- htmlNodeDumpFileFormat (FILE *out,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN int XMLCALL
- htmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- htmlSaveFileFormat (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
+XMLPUBFUN void XMLCALL
+htmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
+XMLPUBFUN void XMLCALL
+htmlDocDumpMemoryFormat (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
+XMLPUBFUN int XMLCALL
+htmlDocDump (FILE *f,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+htmlSaveFile (const char *filename,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+htmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpFile (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+htmlNodeDumpFileFormat (FILE *out,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN int XMLCALL
+htmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+htmlSaveFileFormat (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN void XMLCALL
- htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- htmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- const char *encoding);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN void XMLCALL
+htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+htmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- htmlIsBooleanAttr (const xmlChar *name);
+XMLPUBFUN int XMLCALL
+htmlIsBooleanAttr (const xmlChar *name);
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/libxml/SAX.h b/thirdparties/wince/include/libxml/SAX.h
index 0ca161b..e113753 100755
--- a/thirdparties/wince/include/libxml/SAX.h
+++ b/thirdparties/wince/include/libxml/SAX.h
@@ -24,143 +24,143 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- getPublicId (void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL
- getSystemId (void *ctx);
-XMLPUBFUN void XMLCALL
- setDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
-
-XMLPUBFUN int XMLCALL
- getLineNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- getColumnNumber (void *ctx);
+getPublicId (void *ctx);
+XMLPUBFUN const xmlChar * XMLCALL
+getSystemId (void *ctx);
+XMLPUBFUN void XMLCALL
+setDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
+
+XMLPUBFUN int XMLCALL
+getLineNumber (void *ctx);
+XMLPUBFUN int XMLCALL
+getColumnNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- isStandalone (void *ctx);
-XMLPUBFUN int XMLCALL
- hasInternalSubset (void *ctx);
-XMLPUBFUN int XMLCALL
- hasExternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+isStandalone (void *ctx);
+XMLPUBFUN int XMLCALL
+hasInternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+hasExternalSubset (void *ctx);
-XMLPUBFUN void XMLCALL
- internalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL
- externalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL
- getEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
- getParameterEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- resolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+internalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+externalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlEntityPtr XMLCALL
+getEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlEntityPtr XMLCALL
+getParameterEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+resolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- entityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- attributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- elementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- notationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- unparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+XMLPUBFUN void XMLCALL
+entityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+attributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+elementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+notationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+unparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
-XMLPUBFUN void XMLCALL
- startDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- endDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- attribute (void *ctx,
- const xmlChar *fullname,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- startElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
-XMLPUBFUN void XMLCALL
- endElement (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- reference (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- characters (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- ignorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- processingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
-XMLPUBFUN void XMLCALL
- globalNamespace (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- setNamespace (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlNsPtr XMLCALL
- getNamespace (void *ctx);
-XMLPUBFUN int XMLCALL
- checkNamespace (void *ctx,
- xmlChar *nameSpace);
-XMLPUBFUN void XMLCALL
- namespaceDecl (void *ctx,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- comment (void *ctx,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- cdataBlock (void *ctx,
- const xmlChar *value,
- int len);
+XMLPUBFUN void XMLCALL
+startDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+endDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+attribute (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+startElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
+XMLPUBFUN void XMLCALL
+endElement (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+reference (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+characters (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+ignorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+processingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
+XMLPUBFUN void XMLCALL
+globalNamespace (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+setNamespace (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlNsPtr XMLCALL
+getNamespace (void *ctx);
+XMLPUBFUN int XMLCALL
+checkNamespace (void *ctx,
+ xmlChar *nameSpace);
+XMLPUBFUN void XMLCALL
+namespaceDecl (void *ctx,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+comment (void *ctx,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+cdataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL
- initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
- int warning);
+XMLPUBFUN void XMLCALL
+initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL
- inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+XMLPUBFUN void XMLCALL
+inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL
- initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
+XMLPUBFUN void XMLCALL
+initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#endif /* LIBXML_SAX1_ENABLED */
diff --git a/thirdparties/wince/include/libxml/SAX2.h b/thirdparties/wince/include/libxml/SAX2.h
index 8d2db02..722f0f9 100755
--- a/thirdparties/wince/include/libxml/SAX2.h
+++ b/thirdparties/wince/include/libxml/SAX2.h
@@ -22,154 +22,154 @@
extern "C" {
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetPublicId (void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlSAX2GetSystemId (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2SetDocumentLocator (void *ctx,
- xmlSAXLocatorPtr loc);
-
-XMLPUBFUN int XMLCALL
- xmlSAX2GetLineNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2GetColumnNumber (void *ctx);
+xmlSAX2GetPublicId (void *ctx);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlSAX2GetSystemId (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2SetDocumentLocator (void *ctx,
+ xmlSAXLocatorPtr loc);
+
+XMLPUBFUN int XMLCALL
+xmlSAX2GetLineNumber (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2GetColumnNumber (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2IsStandalone (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2HasInternalSubset (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlSAX2HasExternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2IsStandalone (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2HasInternalSubset (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlSAX2HasExternalSubset (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2InternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL
- xmlSAX2ExternalSubset (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlSAX2GetParameterEntity (void *ctx,
- const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlSAX2ResolveEntity (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+xmlSAX2InternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+xmlSAX2ExternalSubset (void *ctx,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlSAX2GetEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlSAX2GetParameterEntity (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlSAX2ResolveEntity (void *ctx,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- xmlSAX2EntityDecl (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
-XMLPUBFUN void XMLCALL
- xmlSAX2AttributeDecl (void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL
- xmlSAX2ElementDecl (void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlSAX2NotationDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
-XMLPUBFUN void XMLCALL
- xmlSAX2UnparsedEntityDecl (void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+XMLPUBFUN void XMLCALL
+xmlSAX2EntityDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlSAX2AttributeDecl (void *ctx,
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
+XMLPUBFUN void XMLCALL
+xmlSAX2ElementDecl (void *ctx,
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlSAX2NotationDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
+XMLPUBFUN void XMLCALL
+xmlSAX2UnparsedEntityDecl (void *ctx,
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
-XMLPUBFUN void XMLCALL
- xmlSAX2StartDocument (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2StartDocument (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndDocument (void *ctx);
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlSAX2StartElement (void *ctx,
- const xmlChar *fullname,
- const xmlChar **atts);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndElement (void *ctx,
- const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSAX2StartElement (void *ctx,
+ const xmlChar *fullname,
+ const xmlChar **atts);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndElement (void *ctx,
+ const xmlChar *name);
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
XMLPUBFUN void XMLCALL
- xmlSAX2StartElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
-XMLPUBFUN void XMLCALL
- xmlSAX2EndElementNs (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
-XMLPUBFUN void XMLCALL
- xmlSAX2Reference (void *ctx,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlSAX2Characters (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2IgnorableWhitespace (void *ctx,
- const xmlChar *ch,
- int len);
-XMLPUBFUN void XMLCALL
- xmlSAX2ProcessingInstruction (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
-XMLPUBFUN void XMLCALL
- xmlSAX2Comment (void *ctx,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlSAX2CDataBlock (void *ctx,
- const xmlChar *value,
- int len);
+xmlSAX2StartElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
+XMLPUBFUN void XMLCALL
+xmlSAX2EndElementNs (void *ctx,
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
+XMLPUBFUN void XMLCALL
+xmlSAX2Reference (void *ctx,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSAX2Characters (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2IgnorableWhitespace (void *ctx,
+ const xmlChar *ch,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlSAX2ProcessingInstruction (void *ctx,
+ const xmlChar *target,
+ const xmlChar *data);
+XMLPUBFUN void XMLCALL
+xmlSAX2Comment (void *ctx,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+xmlSAX2CDataBlock (void *ctx,
+ const xmlChar *value,
+ int len);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN int XMLCALL
- xmlSAXDefaultVersion (int version);
+xmlSAXDefaultVersion (int version);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN int XMLCALL
- xmlSAXVersion (xmlSAXHandler *hdlr,
- int version);
-XMLPUBFUN void XMLCALL
- xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
- int warning);
+xmlSAXVersion (xmlSAXHandler *hdlr,
+ int version);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
+ int warning);
#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL
- htmlDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
+XMLPUBFUN void XMLCALL
+htmlDefaultSAXHandlerInit (void);
#endif
#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL
- docbDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
+XMLPUBFUN void XMLCALL
+docbDefaultSAXHandlerInit (void);
#endif
-XMLPUBFUN void XMLCALL
- xmlDefaultSAXHandlerInit (void);
+XMLPUBFUN void XMLCALL
+xmlDefaultSAXHandlerInit (void);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/c14n.h b/thirdparties/wince/include/libxml/c14n.h
index 3011af7..ed14c94 100755
--- a/thirdparties/wince/include/libxml/c14n.h
+++ b/thirdparties/wince/include/libxml/c14n.h
@@ -54,7 +54,7 @@ extern "C" {
/*
* xmlC14NMode:
- *
+ *
* Predefined values for C14N modes
*
*/
@@ -62,32 +62,33 @@ typedef enum {
XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
XML_C14N_1_1 = 2 /* C14N 1.1 spec */
-} xmlC14NMode;
+}
+xmlC14NMode;
XMLPUBFUN int XMLCALL
- xmlC14NDocSaveTo (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NDocSaveTo (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
XMLPUBFUN int XMLCALL
- xmlC14NDocDumpMemory (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlChar **doc_txt_ptr);
+xmlC14NDocDumpMemory (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlChar **doc_txt_ptr);
XMLPUBFUN int XMLCALL
- xmlC14NDocSave (xmlDocPtr doc,
- xmlNodeSetPtr nodes,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- const char* filename,
- int compression);
+xmlC14NDocSave (xmlDocPtr doc,
+ xmlNodeSetPtr nodes,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ const char* filename,
+ int compression);
/**
@@ -104,17 +105,17 @@ XMLPUBFUN int XMLCALL
* Returns 1 if the node should be included
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
- xmlNodePtr node,
- xmlNodePtr parent);
+ xmlNodePtr node,
+ xmlNodePtr parent);
XMLPUBFUN int XMLCALL
- xmlC14NExecute (xmlDocPtr doc,
- xmlC14NIsVisibleCallback is_visible_callback,
- void* user_data,
- int mode, /* a xmlC14NMode */
- xmlChar **inclusive_ns_prefixes,
- int with_comments,
- xmlOutputBufferPtr buf);
+xmlC14NExecute (xmlDocPtr doc,
+ xmlC14NIsVisibleCallback is_visible_callback,
+ void* user_data,
+ int mode, /* a xmlC14NMode */
+ xmlChar **inclusive_ns_prefixes,
+ int with_comments,
+ xmlOutputBufferPtr buf);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/catalog.h b/thirdparties/wince/include/libxml/catalog.h
index b444137..e3fa031 100755
--- a/thirdparties/wince/include/libxml/catalog.h
+++ b/thirdparties/wince/include/libxml/catalog.h
@@ -51,7 +51,8 @@ typedef enum {
XML_CATA_PREFER_NONE = 0,
XML_CATA_PREFER_PUBLIC = 1,
XML_CATA_PREFER_SYSTEM
-} xmlCatalogPrefer;
+}
+xmlCatalogPrefer;
typedef enum {
XML_CATA_ALLOW_NONE = 0,
@@ -67,113 +68,113 @@ typedef xmlCatalog *xmlCatalogPtr;
* Operations on a given catalog.
*/
XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlNewCatalog (int sgml);
-XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadACatalog (const char *filename);
-XMLPUBFUN xmlCatalogPtr XMLCALL
- xmlLoadSGMLSuperCatalog (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlConvertSGMLCatalog (xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL
- xmlACatalogAdd (xmlCatalogPtr catal,
- const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
-XMLPUBFUN int XMLCALL
- xmlACatalogRemove (xmlCatalogPtr catal,
- const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolve (xmlCatalogPtr catal,
- const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveSystem(xmlCatalogPtr catal,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolvePublic(xmlCatalogPtr catal,
- const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlACatalogResolveURI (xmlCatalogPtr catal,
- const xmlChar *URI);
+xmlNewCatalog (int sgml);
+XMLPUBFUN xmlCatalogPtr XMLCALL
+xmlLoadACatalog (const char *filename);
+XMLPUBFUN xmlCatalogPtr XMLCALL
+xmlLoadSGMLSuperCatalog (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlConvertSGMLCatalog (xmlCatalogPtr catal);
+XMLPUBFUN int XMLCALL
+xmlACatalogAdd (xmlCatalogPtr catal,
+ const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
+XMLPUBFUN int XMLCALL
+xmlACatalogRemove (xmlCatalogPtr catal,
+ const xmlChar *value);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolve (xmlCatalogPtr catal,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolveSystem(xmlCatalogPtr catal,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolvePublic(xmlCatalogPtr catal,
+ const xmlChar *pubID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlACatalogResolveURI (xmlCatalogPtr catal,
+ const xmlChar *URI);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlACatalogDump (xmlCatalogPtr catal,
- FILE *out);
+XMLPUBFUN void XMLCALL
+xmlACatalogDump (xmlCatalogPtr catal,
+ FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeCatalog (xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL
- xmlCatalogIsEmpty (xmlCatalogPtr catal);
+XMLPUBFUN void XMLCALL
+xmlFreeCatalog (xmlCatalogPtr catal);
+XMLPUBFUN int XMLCALL
+xmlCatalogIsEmpty (xmlCatalogPtr catal);
/*
* Global operations.
*/
-XMLPUBFUN void XMLCALL
- xmlInitializeCatalog (void);
-XMLPUBFUN int XMLCALL
- xmlLoadCatalog (const char *filename);
-XMLPUBFUN void XMLCALL
- xmlLoadCatalogs (const char *paths);
-XMLPUBFUN void XMLCALL
- xmlCatalogCleanup (void);
+XMLPUBFUN void XMLCALL
+xmlInitializeCatalog (void);
+XMLPUBFUN int XMLCALL
+xmlLoadCatalog (const char *filename);
+XMLPUBFUN void XMLCALL
+xmlLoadCatalogs (const char *paths);
+XMLPUBFUN void XMLCALL
+xmlCatalogCleanup (void);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlCatalogDump (FILE *out);
+XMLPUBFUN void XMLCALL
+xmlCatalogDump (FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolve (const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveSystem (const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolvePublic (const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogResolveURI (const xmlChar *URI);
-XMLPUBFUN int XMLCALL
- xmlCatalogAdd (const xmlChar *type,
- const xmlChar *orig,
- const xmlChar *replace);
-XMLPUBFUN int XMLCALL
- xmlCatalogRemove (const xmlChar *value);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseCatalogFile (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlCatalogConvert (void);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolve (const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolveSystem (const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolvePublic (const xmlChar *pubID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogResolveURI (const xmlChar *URI);
+XMLPUBFUN int XMLCALL
+xmlCatalogAdd (const xmlChar *type,
+ const xmlChar *orig,
+ const xmlChar *replace);
+XMLPUBFUN int XMLCALL
+xmlCatalogRemove (const xmlChar *value);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseCatalogFile (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlCatalogConvert (void);
/*
* Strictly minimal interfaces for per-document catalogs used
* by the parser.
*/
-XMLPUBFUN void XMLCALL
- xmlCatalogFreeLocal (void *catalogs);
-XMLPUBFUN void * XMLCALL
- xmlCatalogAddLocal (void *catalogs,
- const xmlChar *URL);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolve (void *catalogs,
- const xmlChar *pubID,
- const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL
- xmlCatalogLocalResolveURI(void *catalogs,
- const xmlChar *URI);
+XMLPUBFUN void XMLCALL
+xmlCatalogFreeLocal (void *catalogs);
+XMLPUBFUN void * XMLCALL
+xmlCatalogAddLocal (void *catalogs,
+ const xmlChar *URL);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogLocalResolve (void *catalogs,
+ const xmlChar *pubID,
+ const xmlChar *sysID);
+XMLPUBFUN xmlChar * XMLCALL
+xmlCatalogLocalResolveURI(void *catalogs,
+ const xmlChar *URI);
/*
* Preference settings.
*/
-XMLPUBFUN int XMLCALL
- xmlCatalogSetDebug (int level);
-XMLPUBFUN xmlCatalogPrefer XMLCALL
- xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
-XMLPUBFUN void XMLCALL
- xmlCatalogSetDefaults (xmlCatalogAllow allow);
-XMLPUBFUN xmlCatalogAllow XMLCALL
- xmlCatalogGetDefaults (void);
+XMLPUBFUN int XMLCALL
+xmlCatalogSetDebug (int level);
+XMLPUBFUN xmlCatalogPrefer XMLCALL
+xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
+XMLPUBFUN void XMLCALL
+xmlCatalogSetDefaults (xmlCatalogAllow allow);
+XMLPUBFUN xmlCatalogAllow XMLCALL
+xmlCatalogGetDefaults (void);
/* DEPRECATED interfaces */
-XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetSystem (const xmlChar *sysID);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlCatalogGetPublic (const xmlChar *pubID);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlCatalogGetSystem (const xmlChar *sysID);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlCatalogGetPublic (const xmlChar *pubID);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/chvalid.h b/thirdparties/wince/include/libxml/chvalid.h
index fb43016..d650b0b 100755
--- a/thirdparties/wince/include/libxml/chvalid.h
+++ b/thirdparties/wince/include/libxml/chvalid.h
@@ -52,7 +52,7 @@ struct _xmlChRangeGroup {
* Range checking routine
*/
XMLPUBFUN int XMLCALL
- xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
+xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
/**
@@ -208,21 +208,21 @@ XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
xmlIsPubidChar_ch((c)) : 0)
XMLPUBFUN int XMLCALL
- xmlIsBaseChar(unsigned int ch);
+xmlIsBaseChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsBlank(unsigned int ch);
+xmlIsBlank(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsChar(unsigned int ch);
+xmlIsChar(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsCombining(unsigned int ch);
+xmlIsCombining(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsDigit(unsigned int ch);
+xmlIsDigit(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsExtender(unsigned int ch);
+xmlIsExtender(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsIdeographic(unsigned int ch);
+xmlIsIdeographic(unsigned int ch);
XMLPUBFUN int XMLCALL
- xmlIsPubidChar(unsigned int ch);
+xmlIsPubidChar(unsigned int ch);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/debugXML.h b/thirdparties/wince/include/libxml/debugXML.h
index 5a9d20b..64cdb0c 100755
--- a/thirdparties/wince/include/libxml/debugXML.h
+++ b/thirdparties/wince/include/libxml/debugXML.h
@@ -25,41 +25,41 @@ extern "C" {
/*
* The standard Dump routines.
*/
-XMLPUBFUN void XMLCALL
- xmlDebugDumpString (FILE *output,
- const xmlChar *str);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpAttr (FILE *output,
- xmlAttrPtr attr,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpAttrList (FILE *output,
- xmlAttrPtr attr,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpOneNode (FILE *output,
- xmlNodePtr node,
- int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNode (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpString (FILE *output,
+ const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlDebugDumpNodeList (FILE *output,
- xmlNodePtr node,
- int depth);
+xmlDebugDumpAttr (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocumentHead(FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpAttrList (FILE *output,
+ xmlAttrPtr attr,
+ int depth);
XMLPUBFUN void XMLCALL
- xmlDebugDumpDocument (FILE *output,
- xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpDTD (FILE *output,
- xmlDtdPtr dtd);
-XMLPUBFUN void XMLCALL
- xmlDebugDumpEntities (FILE *output,
- xmlDocPtr doc);
+xmlDebugDumpOneNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpNode (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpNodeList (FILE *output,
+ xmlNodePtr node,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDocumentHead(FILE *output,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDocument (FILE *output,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpDTD (FILE *output,
+ xmlDtdPtr dtd);
+XMLPUBFUN void XMLCALL
+xmlDebugDumpEntities (FILE *output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -68,8 +68,8 @@ XMLPUBFUN void XMLCALL
****************************************************************/
XMLPUBFUN int XMLCALL
- xmlDebugCheckDocument (FILE * output,
- xmlDocPtr doc);
+xmlDebugCheckDocument (FILE * output,
+ xmlDocPtr doc);
/****************************************************************
* *
@@ -77,13 +77,13 @@ XMLPUBFUN int XMLCALL
* *
****************************************************************/
-XMLPUBFUN void XMLCALL
- xmlLsOneNode (FILE *output, xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlLsCountNode (xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlLsOneNode (FILE *output, xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlLsCountNode (xmlNodePtr node);
-XMLPUBFUN const char * XMLCALL
- xmlBoolToText (int boolval);
+XMLPUBFUN const char * XMLCALL
+xmlBoolToText (int boolval);
/****************************************************************
* *
@@ -133,80 +133,80 @@ struct _xmlShellCtxt {
*/
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-
-XMLPUBFUN void XMLCALL
- xmlShellPrintXPathError (int errorType,
- const char *arg);
-XMLPUBFUN void XMLCALL
- xmlShellPrintXPathResult(xmlXPathObjectPtr list);
-XMLPUBFUN int XMLCALL
- xmlShellList (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellBase (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellDir (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellLoad (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+ xmlNodePtr node,
+ xmlNodePtr node2);
+
+XMLPUBFUN void XMLCALL
+xmlShellPrintXPathError (int errorType,
+ const char *arg);
+XMLPUBFUN void XMLCALL
+xmlShellPrintXPathResult(xmlXPathObjectPtr list);
+XMLPUBFUN int XMLCALL
+xmlShellList (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellBase (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellDir (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellLoad (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlShellPrintNode (xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlShellCat (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellWrite (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellSave (xmlShellCtxtPtr ctxt,
- char *filename,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN void XMLCALL
+xmlShellPrintNode (xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlShellCat (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellWrite (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellSave (xmlShellCtxtPtr ctxt,
+ char *filename,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int XMLCALL
- xmlShellValidate (xmlShellCtxtPtr ctxt,
- char *dtd,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellValidate (xmlShellCtxtPtr ctxt,
+ char *dtd,
+ xmlNodePtr node,
+ xmlNodePtr node2);
#endif /* LIBXML_VALID_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlShellDu (xmlShellCtxtPtr ctxt,
- char *arg,
- xmlNodePtr tree,
- xmlNodePtr node2);
-XMLPUBFUN int XMLCALL
- xmlShellPwd (xmlShellCtxtPtr ctxt,
- char *buffer,
- xmlNodePtr node,
- xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellDu (xmlShellCtxtPtr ctxt,
+ char *arg,
+ xmlNodePtr tree,
+ xmlNodePtr node2);
+XMLPUBFUN int XMLCALL
+xmlShellPwd (xmlShellCtxtPtr ctxt,
+ char *buffer,
+ xmlNodePtr node,
+ xmlNodePtr node2);
/*
* The Shell interface.
*/
-XMLPUBFUN void XMLCALL
- xmlShell (xmlDocPtr doc,
- char *filename,
- xmlShellReadlineFunc input,
- FILE *output);
-
+XMLPUBFUN void XMLCALL
+xmlShell (xmlDocPtr doc,
+ char *filename,
+ xmlShellReadlineFunc input,
+ FILE *output);
+
#endif /* LIBXML_XPATH_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/libxml/dict.h b/thirdparties/wince/include/libxml/dict.h
index abb8339..618f7cc 100755
--- a/thirdparties/wince/include/libxml/dict.h
+++ b/thirdparties/wince/include/libxml/dict.h
@@ -28,40 +28,40 @@ typedef xmlDict *xmlDictPtr;
* Constructor and destructor.
*/
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreate (void);
+xmlDictCreate (void);
XMLPUBFUN xmlDictPtr XMLCALL
- xmlDictCreateSub(xmlDictPtr sub);
+xmlDictCreateSub(xmlDictPtr sub);
XMLPUBFUN int XMLCALL
- xmlDictReference(xmlDictPtr dict);
-XMLPUBFUN void XMLCALL
- xmlDictFree (xmlDictPtr dict);
+xmlDictReference(xmlDictPtr dict);
+XMLPUBFUN void XMLCALL
+xmlDictFree (xmlDictPtr dict);
/*
* Lookup of entry in the dictionnary.
*/
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictLookup (xmlDictPtr dict,
- const xmlChar *name,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictExists (xmlDictPtr dict,
- const xmlChar *name,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlDictQLookup (xmlDictPtr dict,
- const xmlChar *prefix,
- const xmlChar *name);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictLookup (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictExists (xmlDictPtr dict,
+ const xmlChar *name,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlDictQLookup (xmlDictPtr dict,
+ const xmlChar *prefix,
+ const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlDictOwns (xmlDictPtr dict,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlDictOwns (xmlDictPtr dict,
- const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlDictSize (xmlDictPtr dict);
+xmlDictSize (xmlDictPtr dict);
/*
* Cleanup function
*/
XMLPUBFUN void XMLCALL
- xmlDictCleanup (void);
+xmlDictCleanup (void);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/encoding.h b/thirdparties/wince/include/libxml/encoding.h
index c74b25f..c0b3208 100755
--- a/thirdparties/wince/include/libxml/encoding.h
+++ b/thirdparties/wince/include/libxml/encoding.h
@@ -77,7 +77,8 @@ typedef enum {
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
-} xmlCharEncoding;
+}
+xmlCharEncoding;
/**
* xmlCharEncodingInputFunc:
@@ -96,7 +97,7 @@ typedef enum {
* The value of @outlen after return is the number of octets consumed.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/**
@@ -118,7 +119,7 @@ typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
* The value of @outlen after return is the number of octets produced.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen);
+ const unsigned char *in, int *inlen);
/*
@@ -149,76 +150,76 @@ extern "C" {
/*
* Interfaces for encoding handlers.
*/
-XMLPUBFUN void XMLCALL
- xmlInitCharEncodingHandlers (void);
-XMLPUBFUN void XMLCALL
- xmlCleanupCharEncodingHandlers (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN void XMLCALL
+xmlInitCharEncodingHandlers (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupCharEncodingHandlers (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlGetCharEncodingHandler (xmlCharEncoding enc);
+xmlGetCharEncodingHandler (xmlCharEncoding enc);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlFindCharEncodingHandler (const char *name);
+xmlFindCharEncodingHandler (const char *name);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
- xmlNewCharEncodingHandler (const char *name,
- xmlCharEncodingInputFunc input,
- xmlCharEncodingOutputFunc output);
+xmlNewCharEncodingHandler (const char *name,
+ xmlCharEncodingInputFunc input,
+ xmlCharEncodingOutputFunc output);
/*
* Interfaces for encoding names and aliases.
*/
-XMLPUBFUN int XMLCALL
- xmlAddEncodingAlias (const char *name,
- const char *alias);
-XMLPUBFUN int XMLCALL
- xmlDelEncodingAlias (const char *alias);
+XMLPUBFUN int XMLCALL
+xmlAddEncodingAlias (const char *name,
+ const char *alias);
+XMLPUBFUN int XMLCALL
+xmlDelEncodingAlias (const char *alias);
XMLPUBFUN const char * XMLCALL
- xmlGetEncodingAlias (const char *alias);
-XMLPUBFUN void XMLCALL
- xmlCleanupEncodingAliases (void);
+xmlGetEncodingAlias (const char *alias);
+XMLPUBFUN void XMLCALL
+xmlCleanupEncodingAliases (void);
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlParseCharEncoding (const char *name);
+xmlParseCharEncoding (const char *name);
XMLPUBFUN const char * XMLCALL
- xmlGetCharEncodingName (xmlCharEncoding enc);
+xmlGetCharEncodingName (xmlCharEncoding enc);
/*
* Interfaces directly used by the parsers.
*/
XMLPUBFUN xmlCharEncoding XMLCALL
- xmlDetectCharEncoding (const unsigned char *in,
- int len);
-
-XMLPUBFUN int XMLCALL
- xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
-
-XMLPUBFUN int XMLCALL
- xmlCharEncInFunc (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
+xmlDetectCharEncoding (const unsigned char *in,
+ int len);
+
+XMLPUBFUN int XMLCALL
+xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
+
+XMLPUBFUN int XMLCALL
+xmlCharEncInFunc (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
+XMLPUBFUN int XMLCALL
+xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
+ xmlBufferPtr out,
+ xmlBufferPtr in);
XMLPUBFUN int XMLCALL
- xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
- xmlBufferPtr out,
- xmlBufferPtr in);
-XMLPUBFUN int XMLCALL
- xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
+xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
/*
* Export a few useful functions
*/
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL
- UTF8Toisolat1 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+XMLPUBFUN int XMLCALL
+UTF8Toisolat1 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- isolat1ToUTF8 (unsigned char *out,
- int *outlen,
- const unsigned char *in,
- int *inlen);
+XMLPUBFUN int XMLCALL
+isolat1ToUTF8 (unsigned char *out,
+ int *outlen,
+ const unsigned char *in,
+ int *inlen);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/entities.h b/thirdparties/wince/include/libxml/entities.h
index cefb97f..fde38c7 100755
--- a/thirdparties/wince/include/libxml/entities.h
+++ b/thirdparties/wince/include/libxml/entities.h
@@ -28,7 +28,8 @@ typedef enum {
XML_INTERNAL_PARAMETER_ENTITY = 4,
XML_EXTERNAL_PARAMETER_ENTITY = 5,
XML_INTERNAL_PREDEFINED_ENTITY = 6
-} xmlEntityType;
+}
+xmlEntityType;
/*
* An unit of storage for an entity, contains the string, the value
@@ -57,8 +58,8 @@ struct _xmlEntity {
const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */
- /* this is also used to count entites
- * references done from that entity */
+ /* this is also used to count entites
+ * references done from that entity */
};
/*
@@ -75,71 +76,71 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlInitializePredefinedEntities (void);
+xmlInitializePredefinedEntities (void);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlNewEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlNewEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDocEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDocEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlAddDtdEntity (xmlDocPtr doc,
- const xmlChar *name,
- int type,
- const xmlChar *ExternalID,
- const xmlChar *SystemID,
- const xmlChar *content);
+xmlAddDtdEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetPredefinedEntity (const xmlChar *name);
+xmlGetPredefinedEntity (const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDocEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDocEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDtdEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetDtdEntity (xmlDocPtr doc,
+ const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetParameterEntity (xmlDocPtr doc,
- const xmlChar *name);
+xmlGetParameterEntity (xmlDocPtr doc,
+ const xmlChar *name);
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN const xmlChar * XMLCALL
- xmlEncodeEntities (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntities (xmlDocPtr doc,
+ const xmlChar *input);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeEntitiesReentrant(xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeEntitiesReentrant(xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeSpecialChars (xmlDocPtr doc,
- const xmlChar *input);
+xmlEncodeSpecialChars (xmlDocPtr doc,
+ const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCreateEntitiesTable (void);
+xmlCreateEntitiesTable (void);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
- xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
+xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
- xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
+xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlDumpEntitiesTable (xmlBufferPtr buf,
- xmlEntitiesTablePtr table);
+xmlDumpEntitiesTable (xmlBufferPtr buf,
+ xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL
- xmlDumpEntityDecl (xmlBufferPtr buf,
- xmlEntityPtr ent);
+xmlDumpEntityDecl (xmlBufferPtr buf,
+ xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void XMLCALL
- xmlCleanupPredefinedEntities(void);
+xmlCleanupPredefinedEntities(void);
#endif /* LIBXML_LEGACY_ENABLED */
diff --git a/thirdparties/wince/include/libxml/globals.h b/thirdparties/wince/include/libxml/globals.h
index 9d688e0..4803e85 100755
--- a/thirdparties/wince/include/libxml/globals.h
+++ b/thirdparties/wince/include/libxml/globals.h
@@ -115,52 +115,51 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState
-{
- const char *xmlParserVersion;
+struct _xmlGlobalState {
+ const char *xmlParserVersion;
- xmlSAXLocator xmlDefaultSAXLocator;
- xmlSAXHandlerV1 xmlDefaultSAXHandler;
- xmlSAXHandlerV1 docbDefaultSAXHandler;
- xmlSAXHandlerV1 htmlDefaultSAXHandler;
+ xmlSAXLocator xmlDefaultSAXLocator;
+ xmlSAXHandlerV1 xmlDefaultSAXHandler;
+ xmlSAXHandlerV1 docbDefaultSAXHandler;
+ xmlSAXHandlerV1 htmlDefaultSAXHandler;
- xmlFreeFunc xmlFree;
- xmlMallocFunc xmlMalloc;
- xmlStrdupFunc xmlMemStrdup;
- xmlReallocFunc xmlRealloc;
+ xmlFreeFunc xmlFree;
+ xmlMallocFunc xmlMalloc;
+ xmlStrdupFunc xmlMemStrdup;
+ xmlReallocFunc xmlRealloc;
- xmlGenericErrorFunc xmlGenericError;
- xmlStructuredErrorFunc xmlStructuredError;
- void *xmlGenericErrorContext;
+ xmlGenericErrorFunc xmlGenericError;
+ xmlStructuredErrorFunc xmlStructuredError;
+ void *xmlGenericErrorContext;
- int oldXMLWDcompatibility;
+ int oldXMLWDcompatibility;
- xmlBufferAllocationScheme xmlBufferAllocScheme;
- int xmlDefaultBufferSize;
+ xmlBufferAllocationScheme xmlBufferAllocScheme;
+ int xmlDefaultBufferSize;
- int xmlSubstituteEntitiesDefaultValue;
- int xmlDoValidityCheckingDefaultValue;
- int xmlGetWarningsDefaultValue;
- int xmlKeepBlanksDefaultValue;
- int xmlLineNumbersDefaultValue;
- int xmlLoadExtDtdDefaultValue;
- int xmlParserDebugEntities;
- int xmlPedanticParserDefaultValue;
+ int xmlSubstituteEntitiesDefaultValue;
+ int xmlDoValidityCheckingDefaultValue;
+ int xmlGetWarningsDefaultValue;
+ int xmlKeepBlanksDefaultValue;
+ int xmlLineNumbersDefaultValue;
+ int xmlLoadExtDtdDefaultValue;
+ int xmlParserDebugEntities;
+ int xmlPedanticParserDefaultValue;
- int xmlSaveNoEmptyTags;
- int xmlIndentTreeOutput;
- const char *xmlTreeIndentString;
+ int xmlSaveNoEmptyTags;
+ int xmlIndentTreeOutput;
+ const char *xmlTreeIndentString;
- xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
- xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+ xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+ xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
- xmlMallocFunc xmlMallocAtomic;
- xmlError xmlLastError;
+ xmlMallocFunc xmlMallocAtomic;
+ xmlError xmlLastError;
- xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
- xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
+ xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
+ xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
- void *xmlStructuredErrorContext;
+ void *xmlStructuredErrorContext;
};
#ifdef __cplusplus
@@ -183,9 +182,9 @@ XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNo
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
- xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
+xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
- xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
+xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */
/*
@@ -349,7 +348,7 @@ XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
#endif
-XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlGenericErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlGenericErrorContext \
(*(__xmlGenericErrorContext()))
@@ -357,7 +356,7 @@ XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
XMLPUBVAR void * xmlGenericErrorContext;
#endif
-XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void);
+XMLPUBFUN void ** XMLCALL __xmlStructuredErrorContext(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlStructuredErrorContext \
(*(__xmlStructuredErrorContext()))
@@ -383,7 +382,7 @@ XMLPUBVAR int xmlIndentTreeOutput;
#endif
XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
-XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
+XMLPUBFUN const char ** XMLCALL __xmlTreeIndentString(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlTreeIndentString \
(*(__xmlTreeIndentString()))
@@ -428,7 +427,7 @@ XMLPUBVAR int xmlParserDebugEntities;
#endif
XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
-XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
+XMLPUBFUN const char ** XMLCALL __xmlParserVersion(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlParserVersion \
(*(__xmlParserVersion()))
diff --git a/thirdparties/wince/include/libxml/hash.h b/thirdparties/wince/include/libxml/hash.h
index 7fe4be7..b6171e4 100755
--- a/thirdparties/wince/include/libxml/hash.h
+++ b/thirdparties/wince/include/libxml/hash.h
@@ -1,6 +1,6 @@
/*
* Summary: Chained hash tables
- * Description: This module implements the hash table support used in
+ * Description: This module implements the hash table support used in
* various places in the library.
*
* Copy: See Copyright for the status of this software.
@@ -97,136 +97,136 @@ typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
* Callback when scanning data in a hash with the full scanner.
*/
typedef void (*xmlHashScannerFull)(void *payload, void *data,
- const xmlChar *name, const xmlChar *name2,
- const xmlChar *name3);
+ const xmlChar *name, const xmlChar *name2,
+ const xmlChar *name3);
/*
* Constructor and destructor.
*/
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreate (int size);
+xmlHashCreate (int size);
XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCreateDict(int size,
- xmlDictPtr dict);
-XMLPUBFUN void XMLCALL
- xmlHashFree (xmlHashTablePtr table,
- xmlHashDeallocator f);
+xmlHashCreateDict(int size,
+ xmlDictPtr dict);
+XMLPUBFUN void XMLCALL
+xmlHashFree (xmlHashTablePtr table,
+ xmlHashDeallocator f);
/*
* Add a new entry to the hash table.
*/
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry (xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry(xmlHashTablePtr table,
- const xmlChar *name,
- void *userdata,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry2(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- void *userdata,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashAddEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata);
-XMLPUBFUN int XMLCALL
- xmlHashUpdateEntry3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- void *userdata,
- xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry (xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry(xmlHashTablePtr table,
+ const xmlChar *name,
+ void *userdata,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry2(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ void *userdata,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashAddEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata);
+XMLPUBFUN int XMLCALL
+xmlHashUpdateEntry3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ void *userdata,
+ xmlHashDeallocator f);
/*
* Remove an entry from the hash table.
*/
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
- xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL
- xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
- const xmlChar *name2, const xmlChar *name3,
- xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
+ xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, xmlHashDeallocator f);
+XMLPUBFUN int XMLCALL
+xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
+ const xmlChar *name2, const xmlChar *name3,
+ xmlHashDeallocator f);
/*
* Retrieve the userdata.
*/
-XMLPUBFUN void * XMLCALL
- xmlHashLookup (xmlHashTablePtr table,
- const xmlChar *name);
-XMLPUBFUN void * XMLCALL
- xmlHashLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2);
-XMLPUBFUN void * XMLCALL
- xmlHashLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup2 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2);
-XMLPUBFUN void * XMLCALL
- xmlHashQLookup3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *prefix,
- const xmlChar *name2,
- const xmlChar *prefix2,
- const xmlChar *name3,
- const xmlChar *prefix3);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup (xmlHashTablePtr table,
+ const xmlChar *name);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2);
+XMLPUBFUN void * XMLCALL
+xmlHashLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup2 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2);
+XMLPUBFUN void * XMLCALL
+xmlHashQLookup3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *prefix,
+ const xmlChar *name2,
+ const xmlChar *prefix2,
+ const xmlChar *name3,
+ const xmlChar *prefix3);
/*
* Helpers.
*/
-XMLPUBFUN xmlHashTablePtr XMLCALL
- xmlHashCopy (xmlHashTablePtr table,
- xmlHashCopier f);
-XMLPUBFUN int XMLCALL
- xmlHashSize (xmlHashTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlHashScan (xmlHashTablePtr table,
- xmlHashScanner f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScan3 (xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScanner f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScanFull (xmlHashTablePtr table,
- xmlHashScannerFull f,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlHashScanFull3(xmlHashTablePtr table,
- const xmlChar *name,
- const xmlChar *name2,
- const xmlChar *name3,
- xmlHashScannerFull f,
- void *data);
+XMLPUBFUN xmlHashTablePtr XMLCALL
+xmlHashCopy (xmlHashTablePtr table,
+ xmlHashCopier f);
+XMLPUBFUN int XMLCALL
+xmlHashSize (xmlHashTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlHashScan (xmlHashTablePtr table,
+ xmlHashScanner f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScan3 (xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScanner f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScanFull (xmlHashTablePtr table,
+ xmlHashScannerFull f,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlHashScanFull3(xmlHashTablePtr table,
+ const xmlChar *name,
+ const xmlChar *name2,
+ const xmlChar *name3,
+ xmlHashScannerFull f,
+ void *data);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/list.h b/thirdparties/wince/include/libxml/list.h
index 1d83482..7bd8e37 100755
--- a/thirdparties/wince/include/libxml/list.h
+++ b/thirdparties/wince/include/libxml/list.h
@@ -1,6 +1,6 @@
/*
* Summary: lists interfaces
- * Description: this module implement the list support used in
+ * Description: this module implement the list support used in
* various place in the library.
*
* Copy: See Copyright for the status of this software.
@@ -53,79 +53,79 @@ typedef int (*xmlListWalker) (const void *data, const void *user);
/* Creation/Deletion */
XMLPUBFUN xmlListPtr XMLCALL
- xmlListCreate (xmlListDeallocator deallocator,
- xmlListDataCompare compare);
-XMLPUBFUN void XMLCALL
- xmlListDelete (xmlListPtr l);
+xmlListCreate (xmlListDeallocator deallocator,
+ xmlListDataCompare compare);
+XMLPUBFUN void XMLCALL
+xmlListDelete (xmlListPtr l);
/* Basic Operators */
-XMLPUBFUN void * XMLCALL
- xmlListSearch (xmlListPtr l,
- void *data);
-XMLPUBFUN void * XMLCALL
- xmlListReverseSearch (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListInsert (xmlListPtr l,
- void *data) ;
-XMLPUBFUN int XMLCALL
- xmlListAppend (xmlListPtr l,
- void *data) ;
-XMLPUBFUN int XMLCALL
- xmlListRemoveFirst (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListRemoveLast (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListRemoveAll (xmlListPtr l,
- void *data);
-XMLPUBFUN void XMLCALL
- xmlListClear (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListEmpty (xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListFront (xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL
- xmlListEnd (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListSize (xmlListPtr l);
+XMLPUBFUN void * XMLCALL
+xmlListSearch (xmlListPtr l,
+ void *data);
+XMLPUBFUN void * XMLCALL
+xmlListReverseSearch (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListInsert (xmlListPtr l,
+ void *data) ;
+XMLPUBFUN int XMLCALL
+xmlListAppend (xmlListPtr l,
+ void *data) ;
+XMLPUBFUN int XMLCALL
+xmlListRemoveFirst (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListRemoveLast (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListRemoveAll (xmlListPtr l,
+ void *data);
+XMLPUBFUN void XMLCALL
+xmlListClear (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListEmpty (xmlListPtr l);
+XMLPUBFUN xmlLinkPtr XMLCALL
+xmlListFront (xmlListPtr l);
+XMLPUBFUN xmlLinkPtr XMLCALL
+xmlListEnd (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListSize (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListPopFront (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListPopBack (xmlListPtr l);
-XMLPUBFUN int XMLCALL
- xmlListPushFront (xmlListPtr l,
- void *data);
-XMLPUBFUN int XMLCALL
- xmlListPushBack (xmlListPtr l,
- void *data);
+XMLPUBFUN void XMLCALL
+xmlListPopFront (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListPopBack (xmlListPtr l);
+XMLPUBFUN int XMLCALL
+xmlListPushFront (xmlListPtr l,
+ void *data);
+XMLPUBFUN int XMLCALL
+xmlListPushBack (xmlListPtr l,
+ void *data);
/* Advanced Operators */
-XMLPUBFUN void XMLCALL
- xmlListReverse (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListSort (xmlListPtr l);
-XMLPUBFUN void XMLCALL
- xmlListWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
-XMLPUBFUN void XMLCALL
- xmlListReverseWalk (xmlListPtr l,
- xmlListWalker walker,
- const void *user);
-XMLPUBFUN void XMLCALL
- xmlListMerge (xmlListPtr l1,
- xmlListPtr l2);
-XMLPUBFUN xmlListPtr XMLCALL
- xmlListDup (const xmlListPtr old);
-XMLPUBFUN int XMLCALL
- xmlListCopy (xmlListPtr cur,
- const xmlListPtr old);
+XMLPUBFUN void XMLCALL
+xmlListReverse (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListSort (xmlListPtr l);
+XMLPUBFUN void XMLCALL
+xmlListWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
+XMLPUBFUN void XMLCALL
+xmlListReverseWalk (xmlListPtr l,
+ xmlListWalker walker,
+ const void *user);
+XMLPUBFUN void XMLCALL
+xmlListMerge (xmlListPtr l1,
+ xmlListPtr l2);
+XMLPUBFUN xmlListPtr XMLCALL
+xmlListDup (const xmlListPtr old);
+XMLPUBFUN int XMLCALL
+xmlListCopy (xmlListPtr cur,
+ const xmlListPtr old);
/* Link operators */
-XMLPUBFUN void * XMLCALL
- xmlLinkGetData (xmlLinkPtr lk);
+XMLPUBFUN void * XMLCALL
+xmlLinkGetData (xmlLinkPtr lk);
/* xmlListUnique() */
/* xmlListSwap */
diff --git a/thirdparties/wince/include/libxml/nanoftp.h b/thirdparties/wince/include/libxml/nanoftp.h
index e3c28a0..9a63cd2 100755
--- a/thirdparties/wince/include/libxml/nanoftp.h
+++ b/thirdparties/wince/include/libxml/nanoftp.h
@@ -7,7 +7,7 @@
*
* Author: Daniel Veillard
*/
-
+
#ifndef __NANO_FTP_H__
#define __NANO_FTP_H__
@@ -20,7 +20,7 @@ extern "C" {
#endif
/**
- * ftpListCallback:
+ * ftpListCallback:
* @userData: user provided data for the callback
* @filename: the file name (including "->" when links are shown)
* @attrib: the attribute string
@@ -38,13 +38,13 @@ extern "C" {
* Note that only one of year and day:minute are specified.
*/
typedef void (*ftpListCallback) (void *userData,
- const char *filename, const char *attrib,
- const char *owner, const char *group,
- unsigned long size, int links, int year,
- const char *month, int day, int hour,
- int minute);
+ const char *filename, const char *attrib,
+ const char *owner, const char *group,
+ unsigned long size, int links, int year,
+ const char *month, int day, int hour,
+ int minute);
/**
- * ftpDataCallback:
+ * ftpDataCallback:
* @userData: the user provided context
* @data: the data received
* @len: its size in bytes
@@ -52,89 +52,89 @@ typedef void (*ftpListCallback) (void *userData,
* A callback for the xmlNanoFTPGet command.
*/
typedef void (*ftpDataCallback) (void *userData,
- const char *data,
- int len);
+ const char *data,
+ int len);
/*
* Init
*/
XMLPUBFUN void XMLCALL
- xmlNanoFTPInit (void);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPCleanup (void);
+xmlNanoFTPInit (void);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPCleanup (void);
/*
* Creating/freeing contexts.
*/
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPNewCtxt (const char *URL);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPFreeCtxt (void * ctx);
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPConnectTo (const char *server,
- int port);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPNewCtxt (const char *URL);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPFreeCtxt (void * ctx);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPConnectTo (const char *server,
+ int port);
/*
* Opening/closing session connections.
*/
-XMLPUBFUN void * XMLCALL
- xmlNanoFTPOpen (const char *URL);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPConnect (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPClose (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPQuit (void *ctx);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPScanProxy (const char *URL);
-XMLPUBFUN void XMLCALL
- xmlNanoFTPProxy (const char *host,
- int port,
- const char *user,
- const char *passwd,
- int type);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPUpdateURL (void *ctx,
- const char *URL);
+XMLPUBFUN void * XMLCALL
+xmlNanoFTPOpen (const char *URL);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPConnect (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPClose (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPQuit (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPScanProxy (const char *URL);
+XMLPUBFUN void XMLCALL
+xmlNanoFTPProxy (const char *host,
+ int port,
+ const char *user,
+ const char *passwd,
+ int type);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPUpdateURL (void *ctx,
+ const char *URL);
/*
* Rather internal commands.
*/
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetResponse (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCheckResponse (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetResponse (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCheckResponse (void *ctx);
/*
* CD/DIR/GET handlers.
*/
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCwd (void *ctx,
- const char *directory);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPDele (void *ctx,
- const char *file);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCwd (void *ctx,
+ const char *directory);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPDele (void *ctx,
+ const char *file);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetConnection (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPCloseConnection(void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPList (void *ctx,
- ftpListCallback callback,
- void *userData,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGetSocket (void *ctx,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPGet (void *ctx,
- ftpDataCallback callback,
- void *userData,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlNanoFTPRead (void *ctx,
- void *dest,
- int len);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetConnection (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPCloseConnection(void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPList (void *ctx,
+ ftpListCallback callback,
+ void *userData,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGetSocket (void *ctx,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPGet (void *ctx,
+ ftpDataCallback callback,
+ void *userData,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoFTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/nanohttp.h b/thirdparties/wince/include/libxml/nanohttp.h
index 1d8ac24..8fca6e6 100755
--- a/thirdparties/wince/include/libxml/nanohttp.h
+++ b/thirdparties/wince/include/libxml/nanohttp.h
@@ -7,7 +7,7 @@
*
* Author: Daniel Veillard
*/
-
+
#ifndef __NANO_HTTP_H__
#define __NANO_HTTP_H__
@@ -19,60 +19,60 @@
extern "C" {
#endif
XMLPUBFUN void XMLCALL
- xmlNanoHTTPInit (void);
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPCleanup (void);
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPScanProxy (const char *URL);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPFetch (const char *URL,
- const char *filename,
- char **contentType);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethod (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- const char *headers,
- int ilen);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPMethodRedir (const char *URL,
- const char *method,
- const char *input,
- char **contentType,
- char **redir,
- const char *headers,
- int ilen);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpen (const char *URL,
- char **contentType);
-XMLPUBFUN void * XMLCALL
- xmlNanoHTTPOpenRedir (const char *URL,
- char **contentType,
- char **redir);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPReturnCode (void *ctx);
-XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPAuthHeader (void *ctx);
+xmlNanoHTTPInit (void);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPCleanup (void);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPScanProxy (const char *URL);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPFetch (const char *URL,
+ const char *filename,
+ char **contentType);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPMethod (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ const char *headers,
+ int ilen);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPMethodRedir (const char *URL,
+ const char *method,
+ const char *input,
+ char **contentType,
+ char **redir,
+ const char *headers,
+ int ilen);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPOpen (const char *URL,
+ char **contentType);
+XMLPUBFUN void * XMLCALL
+xmlNanoHTTPOpenRedir (const char *URL,
+ char **contentType,
+ char **redir);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPReturnCode (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPRedir (void *ctx);
+xmlNanoHTTPAuthHeader (void *ctx);
+XMLPUBFUN const char * XMLCALL
+xmlNanoHTTPRedir (void *ctx);
XMLPUBFUN int XMLCALL
- xmlNanoHTTPContentLength( void * ctx );
+xmlNanoHTTPContentLength( void * ctx );
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPEncoding (void *ctx);
+xmlNanoHTTPEncoding (void *ctx);
XMLPUBFUN const char * XMLCALL
- xmlNanoHTTPMimeType (void *ctx);
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPRead (void *ctx,
- void *dest,
- int len);
+xmlNanoHTTPMimeType (void *ctx);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPRead (void *ctx,
+ void *dest,
+ int len);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL
- xmlNanoHTTPSave (void *ctxt,
- const char *filename);
+XMLPUBFUN int XMLCALL
+xmlNanoHTTPSave (void *ctxt,
+ const char *filename);
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNanoHTTPClose (void *ctx);
+XMLPUBFUN void XMLCALL
+xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/parser.h b/thirdparties/wince/include/libxml/parser.h
index 148ee03..0748924 100755
--- a/thirdparties/wince/include/libxml/parser.h
+++ b/thirdparties/wince/include/libxml/parser.h
@@ -80,27 +80,27 @@ struct _xmlParserInput {
* xmlParserNodeInfo:
*
* The parser can be asked to collect Node informations, i.e. at what
- * place in the file they were detected.
+ * place in the file they were detected.
* NOTE: This is off by default and not very well tested.
*/
typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
struct _xmlParserNodeInfo {
- const struct _xmlNode* node;
- /* Position & line # that text that created the node begins & ends on */
- unsigned long begin_pos;
- unsigned long begin_line;
- unsigned long end_pos;
- unsigned long end_line;
+ const struct _xmlNode* node;
+ /* Position & line # that text that created the node begins & ends on */
+ unsigned long begin_pos;
+ unsigned long begin_line;
+ unsigned long end_pos;
+ unsigned long end_line;
};
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
struct _xmlParserNodeInfoSeq {
- unsigned long maximum;
- unsigned long length;
- xmlParserNodeInfo* buffer;
+ unsigned long maximum;
+ unsigned long length;
+ xmlParserNodeInfo* buffer;
};
/**
@@ -221,7 +221,7 @@ struct _xmlParserCtxt {
xmlValidCtxt vctxt; /* The validity context */
xmlParserInputState instate; /* current type of input */
- int token; /* next char look-ahead */
+ int token; /* next char look-ahead */
char *directory; /* the data directory */
@@ -229,7 +229,7 @@ struct _xmlParserCtxt {
const xmlChar *name; /* Current parsed Node */
int nameNr; /* Depth of the parsing stack */
int nameMax; /* Max depth of the parsing stack */
- const xmlChar * *nameTab; /* array of nodes */
+ const xmlChar **nameTab; /* array of nodes */
long nbChars; /* number of xmlChar processed */
long checkIndex; /* used by progressive parsing lookup */
@@ -261,7 +261,7 @@ struct _xmlParserCtxt {
int recovery; /* run in recovery mode */
int progressive; /* is this a progressive parsing */
xmlDictPtr dict; /* dictionnary for the parser */
- const xmlChar * *atts; /* array for the attributes callbacks */
+ const xmlChar **atts; /* array for the attributes callbacks */
int maxatts; /* the size of the array */
int docdict; /* use strings from dict to build tree */
@@ -278,9 +278,9 @@ struct _xmlParserCtxt {
int sax2; /* operating in the new SAX mode */
int nsNr; /* the number of inherited namespaces */
int nsMax; /* the size of the arrays */
- const xmlChar * *nsTab; /* the array of prefix/namespace name */
+ const xmlChar **nsTab; /* the array of prefix/namespace name */
int *attallocs; /* which attribute were allocated */
- void * *pushTab; /* array of data for push */
+ void **pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
int nsWellFormed; /* is the document XML Nanespace okay */
@@ -339,8 +339,8 @@ struct _xmlSAXLocator {
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* internalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -351,9 +351,9 @@ typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
* Callback on internal subset declaration.
*/
typedef void (*internalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* externalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
@@ -364,9 +364,9 @@ typedef void (*internalSubsetSAXFunc) (void *ctx,
* Callback on external subset declaration.
*/
typedef void (*externalSubsetSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* getEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -377,7 +377,7 @@ typedef void (*externalSubsetSAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* getParameterEntitySAXFunc:
* @ctx: the user data (XML parser context)
@@ -388,12 +388,12 @@ typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
* Returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* entityDeclSAXFunc:
* @ctx: the user data (XML parser context)
- * @name: the entity name
- * @type: the entity type
+ * @name: the entity name
+ * @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
@@ -401,11 +401,11 @@ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
* An entity definition has been parsed.
*/
typedef void (*entityDeclSAXFunc) (void *ctx,
- const xmlChar *name,
- int type,
- const xmlChar *publicId,
- const xmlChar *systemId,
- xmlChar *content);
+ const xmlChar *name,
+ int type,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ xmlChar *content);
/**
* notationDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -416,15 +416,15 @@ typedef void (*entityDeclSAXFunc) (void *ctx,
* What to do when a notation declaration has been parsed.
*/
typedef void (*notationDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId);
/**
* attributeDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @elem: the name of the element
- * @fullname: the attribute name
- * @type: the attribute type
+ * @fullname: the attribute name
+ * @type: the attribute type
* @def: the type of default value
* @defaultValue: the attribute default value
* @tree: the tree of enumerated value set
@@ -432,25 +432,25 @@ typedef void (*notationDeclSAXFunc)(void *ctx,
* An attribute definition has been parsed.
*/
typedef void (*attributeDeclSAXFunc)(void *ctx,
- const xmlChar *elem,
- const xmlChar *fullname,
- int type,
- int def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+ const xmlChar *elem,
+ const xmlChar *fullname,
+ int type,
+ int def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
/**
* elementDeclSAXFunc:
* @ctx: the user data (XML parser context)
- * @name: the element name
- * @type: the element type
+ * @name: the element name
+ * @type: the element type
* @content: the element value tree
*
* An element definition has been parsed.
*/
typedef void (*elementDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- int type,
- xmlElementContentPtr content);
+ const xmlChar *name,
+ int type,
+ xmlElementContentPtr content);
/**
* unparsedEntityDeclSAXFunc:
* @ctx: the user data (XML parser context)
@@ -462,10 +462,10 @@ typedef void (*elementDeclSAXFunc)(void *ctx,
* What to do when an unparsed entity declaration is parsed.
*/
typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
- const xmlChar *name,
- const xmlChar *publicId,
- const xmlChar *systemId,
- const xmlChar *notationName);
+ const xmlChar *name,
+ const xmlChar *publicId,
+ const xmlChar *systemId,
+ const xmlChar *notationName);
/**
* setDocumentLocatorSAXFunc:
* @ctx: the user data (XML parser context)
@@ -475,7 +475,7 @@ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
* Everything is available on the context, so this is useless in our case.
*/
typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
- xmlSAXLocatorPtr loc);
+ xmlSAXLocatorPtr loc);
/**
* startDocumentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -499,8 +499,8 @@ typedef void (*endDocumentSAXFunc) (void *ctx);
* Called when an opening tag has been processed.
*/
typedef void (*startElementSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar **atts);
+ const xmlChar *name,
+ const xmlChar **atts);
/**
* endElementSAXFunc:
* @ctx: the user data (XML parser context)
@@ -509,7 +509,7 @@ typedef void (*startElementSAXFunc) (void *ctx,
* Called when the end of an element has been detected.
*/
typedef void (*endElementSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* attributeSAXFunc:
* @ctx: the user data (XML parser context)
@@ -522,17 +522,17 @@ typedef void (*endElementSAXFunc) (void *ctx,
* the element.
*/
typedef void (*attributeSAXFunc) (void *ctx,
- const xmlChar *name,
- const xmlChar *value);
+ const xmlChar *name,
+ const xmlChar *value);
/**
* referenceSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The entity name
*
- * Called when an entity reference is detected.
+ * Called when an entity reference is detected.
*/
typedef void (*referenceSAXFunc) (void *ctx,
- const xmlChar *name);
+ const xmlChar *name);
/**
* charactersSAXFunc:
* @ctx: the user data (XML parser context)
@@ -542,8 +542,8 @@ typedef void (*referenceSAXFunc) (void *ctx,
* Receiving some chars from the parser.
*/
typedef void (*charactersSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* ignorableWhitespaceSAXFunc:
* @ctx: the user data (XML parser context)
@@ -554,8 +554,8 @@ typedef void (*charactersSAXFunc) (void *ctx,
* UNUSED: by default the DOM building will use characters.
*/
typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
- const xmlChar *ch,
- int len);
+ const xmlChar *ch,
+ int len);
/**
* processingInstructionSAXFunc:
* @ctx: the user data (XML parser context)
@@ -565,8 +565,8 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
* A processing instruction has been parsed.
*/
typedef void (*processingInstructionSAXFunc) (void *ctx,
- const xmlChar *target,
- const xmlChar *data);
+ const xmlChar *target,
+ const xmlChar *data);
/**
* commentSAXFunc:
* @ctx: the user data (XML parser context)
@@ -575,7 +575,7 @@ typedef void (*processingInstructionSAXFunc) (void *ctx,
* A comment has been parsed.
*/
typedef void (*commentSAXFunc) (void *ctx,
- const xmlChar *value);
+ const xmlChar *value);
/**
* cdataBlockSAXFunc:
* @ctx: the user data (XML parser context)
@@ -585,41 +585,41 @@ typedef void (*commentSAXFunc) (void *ctx,
* Called when a pcdata block has been parsed.
*/
typedef void (*cdataBlockSAXFunc) (
- void *ctx,
- const xmlChar *value,
- int len);
+ void *ctx,
+ const xmlChar *value,
+ int len);
/**
* warningSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format a warning messages, callback.
*/
typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* errorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format an error messages, callback.
*/
typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* fatalErrorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
- *
+ *
* Display and format fatal error messages, callback.
* Note: so far fatalError() SAX callbacks are not used, error()
* get all the callbacks for errors.
*/
typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx,
- const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* isStandaloneSAXFunc:
* @ctx: the user data (XML parser context)
@@ -681,15 +681,15 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
*/
typedef void (*startElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI,
- int nb_namespaces,
- const xmlChar **namespaces,
- int nb_attributes,
- int nb_defaulted,
- const xmlChar **attributes);
-
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI,
+ int nb_namespaces,
+ const xmlChar **namespaces,
+ int nb_attributes,
+ int nb_defaulted,
+ const xmlChar **attributes);
+
/**
* endElementNsSAX2Func:
* @ctx: the user data (XML parser context)
@@ -702,9 +702,9 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
*/
typedef void (*endElementNsSAX2Func) (void *ctx,
- const xmlChar *localname,
- const xmlChar *prefix,
- const xmlChar *URI);
+ const xmlChar *localname,
+ const xmlChar *prefix,
+ const xmlChar *URI);
struct _xmlSAXHandler {
@@ -784,15 +784,15 @@ struct _xmlSAXHandlerV1 {
* xmlExternalEntityLoader:
* @URL: The System ID of the resource requested
* @ID: The Public ID of the resource requested
- * @context: the XML parser context
+ * @context: the XML parser context
*
* External entity loaders types.
*
* Returns the entity input parser.
*/
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
- const char *ID,
- xmlParserCtxtPtr context);
+ const char *ID,
+ xmlParserCtxtPtr context);
#ifdef __cplusplus
}
@@ -810,263 +810,263 @@ extern "C" {
/*
* Init/Cleanup
*/
-XMLPUBFUN void XMLCALL
- xmlInitParser (void);
-XMLPUBFUN void XMLCALL
- xmlCleanupParser (void);
+XMLPUBFUN void XMLCALL
+xmlInitParser (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupParser (void);
/*
* Input functions
*/
-XMLPUBFUN int XMLCALL
- xmlParserInputRead (xmlParserInputPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputGrow (xmlParserInputPtr in,
- int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputRead (xmlParserInputPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputGrow (xmlParserInputPtr in,
+ int len);
/*
* Basic parsing Interfaces
*/
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseDoc (const xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseFile (const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseMemory (const char *buffer,
- int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseDoc (const xmlChar *cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseFile (const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseMemory (const char *buffer,
+ int size);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlSubstituteEntitiesDefault(int val);
-XMLPUBFUN int XMLCALL
- xmlKeepBlanksDefault (int val);
-XMLPUBFUN void XMLCALL
- xmlStopParser (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlPedanticParserDefault(int val);
-XMLPUBFUN int XMLCALL
- xmlLineNumbersDefault (int val);
+XMLPUBFUN int XMLCALL
+xmlSubstituteEntitiesDefault(int val);
+XMLPUBFUN int XMLCALL
+xmlKeepBlanksDefault (int val);
+XMLPUBFUN void XMLCALL
+xmlStopParser (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlPedanticParserDefault(int val);
+XMLPUBFUN int XMLCALL
+xmlLineNumbersDefault (int val);
#ifdef LIBXML_SAX1_ENABLED
/*
- * Recovery mode
+ * Recovery mode
*/
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverDoc (const xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverMemory (const char *buffer,
- int size);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlRecoverFile (const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverDoc (const xmlChar *cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverMemory (const char *buffer,
+ int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlRecoverFile (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
/*
* Less common routines and SAX interfaces
*/
-XMLPUBFUN int XMLCALL
- xmlParseDocument (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseDocument (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
- void *user_data,
- const char *buffer,
- int size);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseDoc (xmlSAXHandlerPtr sax,
- const xmlChar *cur,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemory (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
- const char *buffer,
- int size,
- int recovery,
- void *data);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFile (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
- const char *filename,
- int recovery,
- void *data);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlSAXParseEntity (xmlSAXHandlerPtr sax,
- const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlParseEntity (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *buffer,
+ int size);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseDoc (xmlSAXHandlerPtr sax,
+ const xmlChar *cur,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseMemory (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
+ const char *buffer,
+ int size,
+ int recovery,
+ void *data);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseFile (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
+ const char *filename,
+ int recovery,
+ void *data);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlSAXParseEntity (xmlSAXHandlerPtr sax,
+ const char *filename);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlParseEntity (const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlSAXParseDTD (xmlSAXHandlerPtr sax,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlParseDTD (const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlIOParseDTD (xmlSAXHandlerPtr sax,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlSAXParseDTD (xmlSAXHandlerPtr sax,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlParseDTD (const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlIOParseDTD (xmlSAXHandlerPtr sax,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
#endif /* LIBXML_VALID_ENABLE */
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemory(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseBalancedChunkMemory(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN xmlParserErrors XMLCALL
- xmlParseInNodeContext (xmlNodePtr node,
- const char *data,
- int datalen,
- int options,
- xmlNodePtr *lst);
+xmlParseInNodeContext (xmlNodePtr node,
+ const char *data,
+ int datalen,
+ int options,
+ xmlNodePtr *lst);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
- xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *string,
- xmlNodePtr *lst,
- int recover);
-XMLPUBFUN int XMLCALL
- xmlParseExternalEntity (xmlDocPtr doc,
- xmlSAXHandlerPtr sax,
- void *user_data,
- int depth,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *string,
+ xmlNodePtr *lst,
+ int recover);
+XMLPUBFUN int XMLCALL
+xmlParseExternalEntity (xmlDocPtr doc,
+ xmlSAXHandlerPtr sax,
+ void *user_data,
+ int depth,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
- const xmlChar *URL,
- const xmlChar *ID,
- xmlNodePtr *lst);
+XMLPUBFUN int XMLCALL
+xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
+ const xmlChar *URL,
+ const xmlChar *ID,
+ xmlNodePtr *lst);
/*
* Parser contexts handling.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlNewParserCtxt (void);
-XMLPUBFUN int XMLCALL
- xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlNewParserCtxt (void);
+XMLPUBFUN int XMLCALL
+xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL
- xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
- const xmlChar* buffer,
- const char *filename);
+XMLPUBFUN void XMLCALL
+xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
+ const xmlChar* buffer,
+ const char *filename);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateDocParserCtxt (const xmlChar *cur);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateDocParserCtxt (const xmlChar *cur);
#ifdef LIBXML_LEGACY_ENABLED
/*
* Reading/setting optional parsing features.
*/
-XMLPUBFUN int XMLCALL
- xmlGetFeaturesList (int *len,
- const char **result);
-XMLPUBFUN int XMLCALL
- xmlGetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *result);
-XMLPUBFUN int XMLCALL
- xmlSetFeature (xmlParserCtxtPtr ctxt,
- const char *name,
- void *value);
+XMLPUBFUN int XMLCALL
+xmlGetFeaturesList (int *len,
+ const char **result);
+XMLPUBFUN int XMLCALL
+xmlGetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *result);
+XMLPUBFUN int XMLCALL
+xmlSetFeature (xmlParserCtxtPtr ctxt,
+ const char *name,
+ void *value);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef LIBXML_PUSH_ENABLED
/*
* Interfaces for the Push mode.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
- void *user_data,
- const char *chunk,
- int size,
- const char *filename);
-XMLPUBFUN int XMLCALL
- xmlParseChunk (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- int terminate);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
+ void *user_data,
+ const char *chunk,
+ int size,
+ const char *filename);
+XMLPUBFUN int XMLCALL
+xmlParseChunk (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ int terminate);
#endif /* LIBXML_PUSH_ENABLED */
/*
* Special I/O mode.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
- void *user_data,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
+ void *user_data,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc);
/*
* Node infos.
*/
XMLPUBFUN const xmlParserNodeInfo* XMLCALL
- xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
- const xmlNodePtr node);
-XMLPUBFUN void XMLCALL
- xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN void XMLCALL
- xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN unsigned long XMLCALL
- xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
- const xmlNodePtr node);
-XMLPUBFUN void XMLCALL
- xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
- const xmlParserNodeInfoPtr info);
+xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
+ const xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+XMLPUBFUN void XMLCALL
+xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
+XMLPUBFUN unsigned long XMLCALL
+xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
+ const xmlNodePtr node);
+XMLPUBFUN void XMLCALL
+xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
+ const xmlParserNodeInfoPtr info);
/*
* External entities handling actually implemented in xmlIO.
*/
-XMLPUBFUN void XMLCALL
- xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
+XMLPUBFUN void XMLCALL
+xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
XMLPUBFUN xmlExternalEntityLoader XMLCALL
- xmlGetExternalEntityLoader(void);
+xmlGetExternalEntityLoader(void);
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlLoadExternalEntity (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+xmlLoadExternalEntity (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
/*
* Index lookup, actually implemented in the encoding module
*/
XMLPUBFUN long XMLCALL
- xmlByteConsumed (xmlParserCtxtPtr ctxt);
+xmlByteConsumed (xmlParserCtxtPtr ctxt);
/*
* New set of simpler/more flexible APIs
@@ -1104,75 +1104,75 @@ typedef enum {
} xmlParserOption;
XMLPUBFUN void XMLCALL
- xmlCtxtReset (xmlParserCtxtPtr ctxt);
+xmlCtxtReset (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
- const char *chunk,
- int size,
- const char *filename,
- const char *encoding);
+xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
+ const char *chunk,
+ int size,
+ const char *filename,
+ const char *encoding);
XMLPUBFUN int XMLCALL
- xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
- int options);
+xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadDoc (const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadDoc (const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFile (const char *URL,
- const char *encoding,
- int options);
+xmlReadFile (const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlReadIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReadIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
+ const xmlChar *cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
- const char *filename,
- const char *encoding,
- int options);
+xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
+ const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlDocPtr XMLCALL
- xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Library wide options
@@ -1220,7 +1220,7 @@ typedef enum {
} xmlFeature;
XMLPUBFUN int XMLCALL
- xmlHasFeature (xmlFeature feature);
+xmlHasFeature (xmlFeature feature);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/parserInternals.h b/thirdparties/wince/include/libxml/parserInternals.h
index a5e75b5..d81d65c 100755
--- a/thirdparties/wince/include/libxml/parserInternals.h
+++ b/thirdparties/wince/include/libxml/parserInternals.h
@@ -153,7 +153,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*
* Always false (all combining chars > 0xff)
*/
-#define IS_COMBINING_CH(c) 0
+#define IS_COMBINING_CH(c) 0
/**
* IS_EXTENDER:
@@ -194,7 +194,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
* Macro to check the following production in the XML spec:
*
*
- * [84] Letter ::= BaseChar | Ideographic
+ * [84] Letter ::= BaseChar | Ideographic
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
@@ -288,178 +288,178 @@ XMLPUBFUN int XMLCALL xmlIsLetter (int c);
/**
* Parser context.
*/
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateFileParserCtxt (const char *filename);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateURLParserCtxt (const char *filename,
- int options);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateMemoryParserCtxt(const char *buffer,
- int size);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlCreateEntityParserCtxt(const xmlChar *URL,
- const xmlChar *ID,
- const xmlChar *base);
-XMLPUBFUN int XMLCALL
- xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
- xmlCharEncodingHandlerPtr handler);
-XMLPUBFUN int XMLCALL
- xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateFileParserCtxt (const char *filename);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateURLParserCtxt (const char *filename,
+ int options);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateMemoryParserCtxt(const char *buffer,
+ int size);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+xmlCreateEntityParserCtxt(const xmlChar *URL,
+ const xmlChar *ID,
+ const xmlChar *base);
+XMLPUBFUN int XMLCALL
+xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
+ xmlCharEncodingHandlerPtr handler);
+XMLPUBFUN int XMLCALL
+xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input,
+ xmlCharEncodingHandlerPtr handler);
#ifdef IN_LIBXML
/* internal error reporting */
XMLPUBFUN void XMLCALL
- __xmlErrEncoding (xmlParserCtxtPtr ctxt,
- xmlParserErrors xmlerr,
- const char *msg,
- const xmlChar * str1,
- const xmlChar * str2);
+__xmlErrEncoding (xmlParserCtxtPtr ctxt,
+ xmlParserErrors xmlerr,
+ const char *msg,
+ const xmlChar * str1,
+ const xmlChar * str2);
#endif
/**
* Input Streams.
*/
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
- const xmlChar *buffer);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
-XMLPUBFUN int XMLCALL
- xmlPushInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr input);
-XMLPUBFUN xmlChar XMLCALL
- xmlPopInput (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlFreeInputStream (xmlParserInputPtr input);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
- const char *filename);
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNewInputStream (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
+ const xmlChar *buffer);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
+XMLPUBFUN int XMLCALL
+xmlPushInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr input);
+XMLPUBFUN xmlChar XMLCALL
+xmlPopInput (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlFreeInputStream (xmlParserInputPtr input);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
+ const char *filename);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNewInputStream (xmlParserCtxtPtr ctxt);
/**
* Namespaces.
*/
-XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName (xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlChar **prefix);
+XMLPUBFUN xmlChar * XMLCALL
+xmlSplitQName (xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlChar **prefix);
/**
* Generic production rules.
*/
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseNmtoken (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseEntityValue (xmlParserCtxtPtr ctxt,
- xmlChar **orig);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseAttValue (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseCharData (xmlParserCtxtPtr ctxt,
- int cdata);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseExternalID (xmlParserCtxtPtr ctxt,
- xmlChar **publicID,
- int strict);
-XMLPUBFUN void XMLCALL
- xmlParseComment (xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParsePITarget (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParsePI (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
- xmlChar **value);
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseNotationType (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
-XMLPUBFUN int XMLCALL
- xmlParseAttributeType (xmlParserCtxtPtr ctxt,
- xmlEnumerationPtr *tree);
-XMLPUBFUN void XMLCALL
- xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementMixedContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlParseElementChildrenContentDecl
- (xmlParserCtxtPtr ctxt,
- int inputchk);
-XMLPUBFUN int XMLCALL
- xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
- const xmlChar *name,
- xmlElementContentPtr *result);
-XMLPUBFUN int XMLCALL
- xmlParseElementDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseCharRef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEntityPtr XMLCALL
- xmlParseEntityRef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseReference (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParsePEReference (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseNmtoken (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseEntityValue (xmlParserCtxtPtr ctxt,
+ xmlChar **orig);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseAttValue (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseCharData (xmlParserCtxtPtr ctxt,
+ int cdata);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseExternalID (xmlParserCtxtPtr ctxt,
+ xmlChar **publicID,
+ int strict);
+XMLPUBFUN void XMLCALL
+xmlParseComment (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParsePITarget (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParsePI (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlParseNotationType (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
+XMLPUBFUN int XMLCALL
+xmlParseAttributeType (xmlParserCtxtPtr ctxt,
+ xmlEnumerationPtr *tree);
+XMLPUBFUN void XMLCALL
+xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlParseElementMixedContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlParseElementChildrenContentDecl
+(xmlParserCtxtPtr ctxt,
+ int inputchk);
+XMLPUBFUN int XMLCALL
+xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
+ const xmlChar *name,
+ xmlElementContentPtr *result);
+XMLPUBFUN int XMLCALL
+xmlParseElementDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseCharRef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlEntityPtr XMLCALL
+xmlParseEntityRef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseReference (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParsePEReference (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseAttribute (xmlParserCtxtPtr ctxt,
- xmlChar **value);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseStartTag (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseEndTag (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseAttribute (xmlParserCtxtPtr ctxt,
+ xmlChar **value);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseStartTag (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseEndTag (xmlParserCtxtPtr ctxt);
#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlParseCDSect (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseContent (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseElement (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionNum (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseEncName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlParseSDDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseTextDecl (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseMisc (xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
+XMLPUBFUN void XMLCALL
+xmlParseCDSect (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseContent (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseElement (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseVersionNum (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseEncName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlParseSDDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseTextDecl (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseMisc (xmlParserCtxtPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
/**
* XML_SUBSTITUTE_NONE:
*
@@ -486,41 +486,41 @@ XMLPUBFUN void XMLCALL
#define XML_SUBSTITUTE_BOTH 3
XMLPUBFUN xmlChar * XMLCALL
- xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
XMLPUBFUN xmlChar * XMLCALL
- xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
- const xmlChar *str,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
+xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
+ const xmlChar *str,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
- xmlNodePtr value);
+ xmlNodePtr value);
XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr value);
+ xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
- const xmlChar *value);
+ const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
- const xmlChar *cur,
- int *len);
+ const xmlChar *cur,
+ int *len);
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
@@ -528,12 +528,12 @@ XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
* Really core function shared with HTML parser.
*/
XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
- int *len);
+ int *len);
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
- int val);
+ int val);
XMLPUBFUN int XMLCALL xmlCopyChar (int len,
- xmlChar *out,
- int val);
+ xmlChar *out,
+ int val);
XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
@@ -543,7 +543,7 @@ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
*/
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
- const char *encoding);
+ const char *encoding);
#endif
/*
@@ -561,38 +561,38 @@ XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filenam
* provenance of a chunk of nodes inherited from an entity replacement.
*/
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
- xmlNodePtr firstNode,
- xmlNodePtr lastNode);
-
+ xmlNodePtr firstNode,
+ xmlNodePtr lastNode);
+
XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
-XMLPUBFUN xmlChar * XMLCALL
- xmlParseQuotedString (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlParseQuotedString (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlParseNamespace (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlScanName (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
+xmlParseNamespace (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlScanName (xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
- xmlChar **prefix);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
+ xmlChar **prefix);
/**
* Entities
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlDecodeEntities (xmlParserCtxtPtr ctxt,
- int len,
- int what,
- xmlChar end,
- xmlChar end2,
- xmlChar end3);
-XMLPUBFUN void XMLCALL
- xmlHandleEntity (xmlParserCtxtPtr ctxt,
- xmlEntityPtr entity);
+xmlDecodeEntities (xmlParserCtxtPtr ctxt,
+ int len,
+ int what,
+ xmlChar end,
+ xmlChar end2,
+ xmlChar end3);
+XMLPUBFUN void XMLCALL
+xmlHandleEntity (xmlParserCtxtPtr ctxt,
+ xmlEntityPtr entity);
#endif /* LIBXML_LEGACY_ENABLED */
@@ -601,8 +601,8 @@ XMLPUBFUN void XMLCALL
* internal only
*/
XMLPUBFUN void XMLCALL
- xmlErrMemory (xmlParserCtxtPtr ctxt,
- const char *extra);
+xmlErrMemory (xmlParserCtxtPtr ctxt,
+ const char *extra);
#endif
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/libxml/pattern.h b/thirdparties/wince/include/libxml/pattern.h
index 97d2cd2..a697145 100755
--- a/thirdparties/wince/include/libxml/pattern.h
+++ b/thirdparties/wince/include/libxml/pattern.h
@@ -44,53 +44,53 @@ typedef enum {
} xmlPatternFlags;
XMLPUBFUN void XMLCALL
- xmlFreePattern (xmlPatternPtr comp);
+xmlFreePattern (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreePatternList (xmlPatternPtr comp);
+xmlFreePatternList (xmlPatternPtr comp);
XMLPUBFUN xmlPatternPtr XMLCALL
- xmlPatterncompile (const xmlChar *pattern,
- xmlDict *dict,
- int flags,
- const xmlChar **namespaces);
+xmlPatterncompile (const xmlChar *pattern,
+ xmlDict *dict,
+ int flags,
+ const xmlChar **namespaces);
XMLPUBFUN int XMLCALL
- xmlPatternMatch (xmlPatternPtr comp,
- xmlNodePtr node);
+xmlPatternMatch (xmlPatternPtr comp,
+ xmlNodePtr node);
/* streaming interfaces */
typedef struct _xmlStreamCtxt xmlStreamCtxt;
typedef xmlStreamCtxt *xmlStreamCtxtPtr;
XMLPUBFUN int XMLCALL
- xmlPatternStreamable (xmlPatternPtr comp);
+xmlPatternStreamable (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMaxDepth (xmlPatternPtr comp);
+xmlPatternMaxDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternMinDepth (xmlPatternPtr comp);
+xmlPatternMinDepth (xmlPatternPtr comp);
XMLPUBFUN int XMLCALL
- xmlPatternFromRoot (xmlPatternPtr comp);
+xmlPatternFromRoot (xmlPatternPtr comp);
XMLPUBFUN xmlStreamCtxtPtr XMLCALL
- xmlPatternGetStreamCtxt (xmlPatternPtr comp);
+xmlPatternGetStreamCtxt (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
- xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
+xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamPushNode (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns,
- int nodeType);
+xmlStreamPushNode (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns,
+ int nodeType);
XMLPUBFUN int XMLCALL
- xmlStreamPush (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPush (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPushAttr (xmlStreamCtxtPtr stream,
- const xmlChar *name,
- const xmlChar *ns);
+xmlStreamPushAttr (xmlStreamCtxtPtr stream,
+ const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN int XMLCALL
- xmlStreamPop (xmlStreamCtxtPtr stream);
+xmlStreamPop (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
- xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
+xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/relaxng.h b/thirdparties/wince/include/libxml/relaxng.h
index bdb0a7d..59695c4 100755
--- a/thirdparties/wince/include/libxml/relaxng.h
+++ b/thirdparties/wince/include/libxml/relaxng.h
@@ -113,96 +113,96 @@ typedef enum {
} xmlRelaxNGParserFlag;
XMLPUBFUN int XMLCALL
- xmlRelaxNGInitTypes (void);
+xmlRelaxNGInitTypes (void);
XMLPUBFUN void XMLCALL
- xmlRelaxNGCleanupTypes (void);
+xmlRelaxNGCleanupTypes (void);
/*
* Interfaces for parsing.
*/
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewParserCtxt (const char *URL);
+xmlRelaxNGNewParserCtxt (const char *URL);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewMemParserCtxt (const char *buffer,
- int size);
+xmlRelaxNGNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
- xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
+xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
- int flag);
+xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
+ int flag);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetParserStructuredErrors(
- xmlRelaxNGParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlRelaxNGSetParserStructuredErrors(
+ xmlRelaxNGParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN xmlRelaxNGPtr XMLCALL
- xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
+xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFree (xmlRelaxNGPtr schema);
+xmlRelaxNGFree (xmlRelaxNGPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlRelaxNGDump (FILE *output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDump (FILE *output,
+ xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGDumpTree (FILE * output,
- xmlRelaxNGPtr schema);
+xmlRelaxNGDumpTree (FILE * output,
+ xmlRelaxNGPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc err,
- xmlRelaxNGValidityWarningFunc warn,
- void *ctx);
+xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc err,
+ xmlRelaxNGValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlRelaxNGValidityErrorFunc *err,
- xmlRelaxNGValidityWarningFunc *warn,
- void **ctx);
+xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlRelaxNGValidityErrorFunc *err,
+ xmlRelaxNGValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN void XMLCALL
- xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror, void *ctx);
+xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror, void *ctx);
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
- xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
+xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
- xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
+xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc);
+xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc);
/*
* Interfaces for progressive validation when possible
*/
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
+xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
+xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/schemasInternals.h b/thirdparties/wince/include/libxml/schemasInternals.h
index b68a6e1..67dd50e 100755
--- a/thirdparties/wince/include/libxml/schemasInternals.h
+++ b/thirdparties/wince/include/libxml/schemasInternals.h
@@ -74,7 +74,8 @@ typedef enum {
XML_SCHEMAS_BASE64BINARY,
XML_SCHEMAS_ANYTYPE,
XML_SCHEMAS_ANYSIMPLETYPE
-} xmlSchemaValType;
+}
+xmlSchemaValType;
/*
* XML Schemas defines multiple type of types.
@@ -104,8 +105,8 @@ typedef enum {
XML_SCHEMA_TYPE_IDC_UNIQUE,
XML_SCHEMA_TYPE_IDC_KEY,
XML_SCHEMA_TYPE_IDC_KEYREF,
- XML_SCHEMA_TYPE_PARTICLE = 25,
- XML_SCHEMA_TYPE_ATTRIBUTE_USE,
+ XML_SCHEMA_TYPE_PARTICLE = 25,
+ XML_SCHEMA_TYPE_ATTRIBUTE_USE,
XML_SCHEMA_FACET_MININCLUSIVE = 1000,
XML_SCHEMA_FACET_MINEXCLUSIVE,
XML_SCHEMA_FACET_MAXINCLUSIVE,
@@ -698,11 +699,11 @@ struct _xmlSchemaType {
* references have been resolved.
*/
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
- /**
- * XML_SCHEMAS_ELEM_CIRCULAR:
- *
- * a helper flag for the search of circular references.
- */
+/**
+* XML_SCHEMAS_ELEM_CIRCULAR:
+*
+* a helper flag for the search of circular references.
+*/
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
/**
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
diff --git a/thirdparties/wince/include/libxml/threads.h b/thirdparties/wince/include/libxml/threads.h
index d31f16a..b9db53e 100755
--- a/thirdparties/wince/include/libxml/threads.h
+++ b/thirdparties/wince/include/libxml/threads.h
@@ -37,40 +37,40 @@ typedef xmlRMutex *xmlRMutexPtr;
extern "C" {
#endif
XMLPUBFUN xmlMutexPtr XMLCALL
- xmlNewMutex (void);
+xmlNewMutex (void);
XMLPUBFUN void XMLCALL
- xmlMutexLock (xmlMutexPtr tok);
+xmlMutexLock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlMutexUnlock (xmlMutexPtr tok);
+xmlMutexUnlock (xmlMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeMutex (xmlMutexPtr tok);
+xmlFreeMutex (xmlMutexPtr tok);
XMLPUBFUN xmlRMutexPtr XMLCALL
- xmlNewRMutex (void);
+xmlNewRMutex (void);
XMLPUBFUN void XMLCALL
- xmlRMutexLock (xmlRMutexPtr tok);
+xmlRMutexLock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlRMutexUnlock (xmlRMutexPtr tok);
+xmlRMutexUnlock (xmlRMutexPtr tok);
XMLPUBFUN void XMLCALL
- xmlFreeRMutex (xmlRMutexPtr tok);
+xmlFreeRMutex (xmlRMutexPtr tok);
/*
* Library wide APIs.
*/
XMLPUBFUN void XMLCALL
- xmlInitThreads (void);
+xmlInitThreads (void);
XMLPUBFUN void XMLCALL
- xmlLockLibrary (void);
+xmlLockLibrary (void);
XMLPUBFUN void XMLCALL
- xmlUnlockLibrary(void);
+xmlUnlockLibrary(void);
XMLPUBFUN int XMLCALL
- xmlGetThreadId (void);
+xmlGetThreadId (void);
XMLPUBFUN int XMLCALL
- xmlIsMainThread (void);
+xmlIsMainThread (void);
XMLPUBFUN void XMLCALL
- xmlCleanupThreads(void);
+xmlCleanupThreads(void);
XMLPUBFUN xmlGlobalStatePtr XMLCALL
- xmlGetGlobalState(void);
+xmlGetGlobalState(void);
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
diff --git a/thirdparties/wince/include/libxml/tree.h b/thirdparties/wince/include/libxml/tree.h
index b733589..286a977 100755
--- a/thirdparties/wince/include/libxml/tree.h
+++ b/thirdparties/wince/include/libxml/tree.h
@@ -139,7 +139,7 @@ typedef enum {
XML_XINCLUDE_START= 19,
XML_XINCLUDE_END= 20
#ifdef LIBXML_DOCB_ENABLED
- ,XML_DOCB_DOCUMENT_NODE= 21
+ ,XML_DOCB_DOCUMENT_NODE= 21
#endif
} xmlElementType;
@@ -479,7 +479,7 @@ struct _xmlNode {
/**
* XML_GET_LINE:
*
- * Macro to extract the line number of an element node.
+ * Macro to extract the line number of an element node.
*/
#define XML_GET_LINE(n) \
(xmlGetLineNo(n))
@@ -522,7 +522,7 @@ struct _xmlDoc {
/* End of common part */
int compression;/* level of zlib compression */
- int standalone; /* standalone document (no external refs)
+ int standalone; /* standalone document (no external refs)
1 if standalone="yes"
0 if standalone="no"
-1 if there is no XML declaration
@@ -553,18 +553,18 @@ typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
/**
* xmlDOMWrapAcquireNsFunction:
* @ctxt: a DOM wrapper context
- * @node: the context node (element or attribute)
+ * @node: the context node (element or attribute)
* @nsName: the requested namespace name
- * @nsPrefix: the requested namespace prefix
+ * @nsPrefix: the requested namespace prefix
*
* A function called to acquire namespaces (xmlNs) from the wrapper.
*
* Returns an xmlNsPtr or NULL in case of an error.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr node,
- const xmlChar *nsName,
- const xmlChar *nsPrefix);
+ xmlNodePtr node,
+ const xmlChar *nsName,
+ const xmlChar *nsPrefix);
/**
* xmlDOMWrapCtxt:
@@ -602,7 +602,7 @@ struct _xmlDOMWrapCtxt {
/**
* xmlRootNode:
*
- * Macro for compatibility naming layer with libxml1. Maps
+ * Macro for compatibility naming layer with libxml1. Maps
* to "children".
*/
#ifndef xmlRootNode
@@ -618,612 +618,612 @@ struct _xmlDOMWrapCtxt {
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
XMLPUBFUN int XMLCALL
- xmlValidateNCName (const xmlChar *value,
- int space);
+xmlValidateNCName (const xmlChar *value,
+ int space);
#endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlValidateQName (const xmlChar *value,
- int space);
-XMLPUBFUN int XMLCALL
- xmlValidateName (const xmlChar *value,
- int space);
-XMLPUBFUN int XMLCALL
- xmlValidateNMToken (const xmlChar *value,
- int space);
+XMLPUBFUN int XMLCALL
+xmlValidateQName (const xmlChar *value,
+ int space);
+XMLPUBFUN int XMLCALL
+xmlValidateName (const xmlChar *value,
+ int space);
+XMLPUBFUN int XMLCALL
+xmlValidateNMToken (const xmlChar *value,
+ int space);
#endif
-XMLPUBFUN xmlChar * XMLCALL
- xmlBuildQName (const xmlChar *ncname,
- const xmlChar *prefix,
- xmlChar *memory,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlSplitQName2 (const xmlChar *name,
- xmlChar **prefix);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlSplitQName3 (const xmlChar *name,
- int *len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlBuildQName (const xmlChar *ncname,
+ const xmlChar *prefix,
+ xmlChar *memory,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlSplitQName2 (const xmlChar *name,
+ xmlChar **prefix);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlSplitQName3 (const xmlChar *name,
+ int *len);
/*
* Handling Buffers.
*/
-XMLPUBFUN void XMLCALL
- xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL
- xmlGetBufferAllocationScheme(void);
-
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreate (void);
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateSize (size_t size);
-XMLPUBFUN xmlBufferPtr XMLCALL
- xmlBufferCreateStatic (void *mem,
- size_t size);
-XMLPUBFUN int XMLCALL
- xmlBufferResize (xmlBufferPtr buf,
- unsigned int size);
-XMLPUBFUN void XMLCALL
- xmlBufferFree (xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL
- xmlBufferDump (FILE *file,
- xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL
- xmlBufferAdd (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
-XMLPUBFUN int XMLCALL
- xmlBufferAddHead (xmlBufferPtr buf,
- const xmlChar *str,
- int len);
-XMLPUBFUN int XMLCALL
- xmlBufferCat (xmlBufferPtr buf,
- const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlBufferCCat (xmlBufferPtr buf,
- const char *str);
-XMLPUBFUN int XMLCALL
- xmlBufferShrink (xmlBufferPtr buf,
- unsigned int len);
-XMLPUBFUN int XMLCALL
- xmlBufferGrow (xmlBufferPtr buf,
- unsigned int len);
-XMLPUBFUN void XMLCALL
- xmlBufferEmpty (xmlBufferPtr buf);
-XMLPUBFUN const xmlChar* XMLCALL
- xmlBufferContent (const xmlBufferPtr buf);
-XMLPUBFUN void XMLCALL
- xmlBufferSetAllocationScheme(xmlBufferPtr buf,
- xmlBufferAllocationScheme scheme);
-XMLPUBFUN int XMLCALL
- xmlBufferLength (const xmlBufferPtr buf);
+XMLPUBFUN void XMLCALL
+xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
+XMLPUBFUN xmlBufferAllocationScheme XMLCALL
+xmlGetBufferAllocationScheme(void);
+
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreate (void);
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreateSize (size_t size);
+XMLPUBFUN xmlBufferPtr XMLCALL
+xmlBufferCreateStatic (void *mem,
+ size_t size);
+XMLPUBFUN int XMLCALL
+xmlBufferResize (xmlBufferPtr buf,
+ unsigned int size);
+XMLPUBFUN void XMLCALL
+xmlBufferFree (xmlBufferPtr buf);
+XMLPUBFUN int XMLCALL
+xmlBufferDump (FILE *file,
+ xmlBufferPtr buf);
+XMLPUBFUN int XMLCALL
+xmlBufferAdd (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlBufferAddHead (xmlBufferPtr buf,
+ const xmlChar *str,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlBufferCat (xmlBufferPtr buf,
+ const xmlChar *str);
+XMLPUBFUN int XMLCALL
+xmlBufferCCat (xmlBufferPtr buf,
+ const char *str);
+XMLPUBFUN int XMLCALL
+xmlBufferShrink (xmlBufferPtr buf,
+ unsigned int len);
+XMLPUBFUN int XMLCALL
+xmlBufferGrow (xmlBufferPtr buf,
+ unsigned int len);
+XMLPUBFUN void XMLCALL
+xmlBufferEmpty (xmlBufferPtr buf);
+XMLPUBFUN const xmlChar* XMLCALL
+xmlBufferContent (const xmlBufferPtr buf);
+XMLPUBFUN void XMLCALL
+xmlBufferSetAllocationScheme(xmlBufferPtr buf,
+ xmlBufferAllocationScheme scheme);
+XMLPUBFUN int XMLCALL
+xmlBufferLength (const xmlBufferPtr buf);
/*
* Creating/freeing new structures.
*/
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCreateIntSubset (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlNewDtd (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *ExternalID,
- const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlGetIntSubset (xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlFreeDtd (xmlDtdPtr cur);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlCreateIntSubset (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlNewDtd (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlGetIntSubset (xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewGlobalNs (xmlDocPtr doc,
- const xmlChar *href,
- const xmlChar *prefix);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlNewGlobalNs (xmlDocPtr doc,
+ const xmlChar *href,
+ const xmlChar *prefix);
#endif /* LIBXML_LEGACY_ENABLED */
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlNewNs (xmlNodePtr node,
- const xmlChar *href,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- xmlFreeNs (xmlNsPtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeNsList (xmlNsPtr cur);
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlNewDoc (const xmlChar *version);
-XMLPUBFUN void XMLCALL
- xmlFreeDoc (xmlDocPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewDocProp (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlNewNs (xmlNodePtr node,
+ const xmlChar *href,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+xmlFreeNs (xmlNsPtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeNsList (xmlNsPtr cur);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlNewDoc (const xmlChar *version);
+XMLPUBFUN void XMLCALL
+xmlFreeDoc (xmlDocPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewDocProp (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *value);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
#endif
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlNewNsPropEatName (xmlNodePtr node,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlFreePropList (xmlAttrPtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeProp (xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyProp (xmlNodePtr target,
- xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlCopyPropList (xmlNodePtr target,
- xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlNewNsPropEatName (xmlNodePtr node,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN void XMLCALL
+xmlFreePropList (xmlAttrPtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeProp (xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlCopyProp (xmlNodePtr target,
+ xmlAttrPtr cur);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlCopyPropList (xmlNodePtr target,
+ xmlAttrPtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL
- xmlCopyDtd (xmlDtdPtr dtd);
+XMLPUBFUN xmlDtdPtr XMLCALL
+xmlCopyDtd (xmlDtdPtr dtd);
#endif /* LIBXML_TREE_ENABLED */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlDocPtr XMLCALL
- xmlCopyDoc (xmlDocPtr doc,
- int recursive);
+XMLPUBFUN xmlDocPtr XMLCALL
+xmlCopyDoc (xmlDocPtr doc,
+ int recursive);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Creating new nodes.
*/
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocNodeEatName (xmlDocPtr doc,
- xmlNsPtr ns,
- xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNode (xmlNsPtr ns,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewNodeEatName (xmlNsPtr ns,
- xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocNodeEatName (xmlDocPtr doc,
+ xmlNsPtr ns,
+ xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewNode (xmlNsPtr ns,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewNodeEatName (xmlNsPtr ns,
+ xmlChar *name);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
#endif
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocText (xmlDocPtr doc,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewText (const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocPI (xmlDocPtr doc,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewPI (const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocTextLen (xmlDocPtr doc,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextLen (const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocComment (xmlDocPtr doc,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewComment (const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCDataBlock (xmlDocPtr doc,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewCharRef (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewReference (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNode (const xmlNodePtr node,
- int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNode (const xmlNodePtr node,
- xmlDocPtr doc,
- int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNodeList (xmlDocPtr doc,
- const xmlNodePtr node);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNodeList (const xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocText (xmlDocPtr doc,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewText (const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocPI (xmlDocPtr doc,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewPI (const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocTextLen (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewTextLen (const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocComment (xmlDocPtr doc,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewComment (const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewCDataBlock (xmlDocPtr doc,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewCharRef (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewReference (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlCopyNode (const xmlNodePtr node,
+ int recursive);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocCopyNode (const xmlNodePtr node,
+ xmlDocPtr doc,
+ int recursive);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocCopyNodeList (xmlDocPtr doc,
+ const xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlCopyNodeList (const xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewTextChild (xmlNodePtr parent,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocRawNode (xmlDocPtr doc,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocFragment (xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewTextChild (xmlNodePtr parent,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocRawNode (xmlDocPtr doc,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *content);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlNewDocFragment (xmlDocPtr doc);
#endif /* LIBXML_TREE_ENABLED */
/*
* Navigating.
*/
-XMLPUBFUN long XMLCALL
- xmlGetLineNo (xmlNodePtr node);
+XMLPUBFUN long XMLCALL
+xmlGetLineNo (xmlNodePtr node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNodePath (xmlNodePtr node);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNodePath (xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocGetRootElement (xmlDocPtr doc);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlGetLastChild (xmlNodePtr parent);
-XMLPUBFUN int XMLCALL
- xmlNodeIsText (xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlIsBlankNode (xmlNodePtr node);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocGetRootElement (xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlGetLastChild (xmlNodePtr parent);
+XMLPUBFUN int XMLCALL
+xmlNodeIsText (xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlIsBlankNode (xmlNodePtr node);
/*
* Changing the structure.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocSetRootElement (xmlDocPtr doc,
- xmlNodePtr root);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlDocSetRootElement (xmlDocPtr doc,
+ xmlNodePtr root);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetName (xmlNodePtr cur,
- const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlNodeSetName (xmlNodePtr cur,
+ const xmlChar *name);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChild (xmlNodePtr parent,
- xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddChildList (xmlNodePtr parent,
- xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddChild (xmlNodePtr parent,
+ xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddChildList (xmlNodePtr parent,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlReplaceNode (xmlNodePtr old,
- xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlReplaceNode (xmlNodePtr old,
+ xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddPrevSibling (xmlNodePtr cur,
- xmlNodePtr elem);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddPrevSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddSibling (xmlNodePtr cur,
- xmlNodePtr elem);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlAddNextSibling (xmlNodePtr cur,
- xmlNodePtr elem);
-XMLPUBFUN void XMLCALL
- xmlUnlinkNode (xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextMerge (xmlNodePtr first,
- xmlNodePtr second);
-XMLPUBFUN int XMLCALL
- xmlTextConcat (xmlNodePtr node,
- const xmlChar *content,
- int len);
-XMLPUBFUN void XMLCALL
- xmlFreeNodeList (xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- xmlFreeNode (xmlNodePtr cur);
-XMLPUBFUN void XMLCALL
- xmlSetTreeDoc (xmlNodePtr tree,
- xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlSetListDoc (xmlNodePtr list,
- xmlDocPtr doc);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlAddNextSibling (xmlNodePtr cur,
+ xmlNodePtr elem);
+XMLPUBFUN void XMLCALL
+xmlUnlinkNode (xmlNodePtr cur);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlTextMerge (xmlNodePtr first,
+ xmlNodePtr second);
+XMLPUBFUN int XMLCALL
+xmlTextConcat (xmlNodePtr node,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN void XMLCALL
+xmlFreeNodeList (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlFreeNode (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlSetTreeDoc (xmlNodePtr tree,
+ xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlSetListDoc (xmlNodePtr list,
+ xmlDocPtr doc);
/*
* Namespaces.
*/
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNs (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlSearchNsByHref (xmlDocPtr doc,
- xmlNodePtr node,
- const xmlChar *href);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlSearchNs (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlSearchNsByHref (xmlDocPtr doc,
+ xmlNodePtr node,
+ const xmlChar *href);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNsPtr * XMLCALL
- xmlGetNsList (xmlDocPtr doc,
- xmlNodePtr node);
+XMLPUBFUN xmlNsPtr * XMLCALL
+xmlGetNsList (xmlDocPtr doc,
+ xmlNodePtr node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
-XMLPUBFUN void XMLCALL
- xmlSetNs (xmlNodePtr node,
- xmlNsPtr ns);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespace (xmlNsPtr cur);
-XMLPUBFUN xmlNsPtr XMLCALL
- xmlCopyNamespaceList (xmlNsPtr cur);
+XMLPUBFUN void XMLCALL
+xmlSetNs (xmlNodePtr node,
+ xmlNsPtr ns);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlCopyNamespace (xmlNsPtr cur);
+XMLPUBFUN xmlNsPtr XMLCALL
+xmlCopyNamespaceList (xmlNsPtr cur);
/*
* Changing the content.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlSetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name,
- const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlSetProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlSetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name,
+ const xmlChar *value);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNoNsProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasProp (xmlNodePtr node,
- const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlChar * XMLCALL
- xmlGetNsProp (xmlNodePtr node,
- const xmlChar *name,
- const xmlChar *nameSpace);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringGetNodeList (xmlDocPtr doc,
- const xmlChar *value);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringLenGetNodeList (xmlDocPtr doc,
- const xmlChar *value,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNoNsProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlHasProp (xmlNodePtr node,
+ const xmlChar *name);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlHasNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlChar * XMLCALL
+xmlGetNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *nameSpace);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlStringGetNodeList (xmlDocPtr doc,
+ const xmlChar *value);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlStringLenGetNodeList (xmlDocPtr doc,
+ const xmlChar *value,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeListGetString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetRawString (xmlDocPtr doc,
- xmlNodePtr list,
- int inLine);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeListGetRawString (xmlDocPtr doc,
+ xmlNodePtr list,
+ int inLine);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNodeSetContent (xmlNodePtr cur,
- const xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlNodeSetContent (xmlNodePtr cur,
+ const xmlChar *content);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
+XMLPUBFUN void XMLCALL
+xmlNodeSetContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlNodeAddContent (xmlNodePtr cur,
- const xmlChar *content);
-XMLPUBFUN void XMLCALL
- xmlNodeAddContentLen (xmlNodePtr cur,
- const xmlChar *content,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetContent (xmlNodePtr cur);
+XMLPUBFUN void XMLCALL
+xmlNodeAddContent (xmlNodePtr cur,
+ const xmlChar *content);
+XMLPUBFUN void XMLCALL
+xmlNodeAddContentLen (xmlNodePtr cur,
+ const xmlChar *content,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetContent (xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+xmlNodeBufGetContent (xmlBufferPtr buffer,
+ xmlNodePtr cur);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetLang (xmlNodePtr cur);
XMLPUBFUN int XMLCALL
- xmlNodeBufGetContent (xmlBufferPtr buffer,
- xmlNodePtr cur);
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetLang (xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- xmlNodeGetSpacePreserve (xmlNodePtr cur);
+xmlNodeGetSpacePreserve (xmlNodePtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL
- xmlNodeSetLang (xmlNodePtr cur,
- const xmlChar *lang);
-XMLPUBFUN void XMLCALL
- xmlNodeSetSpacePreserve (xmlNodePtr cur,
- int val);
+XMLPUBFUN void XMLCALL
+xmlNodeSetLang (xmlNodePtr cur,
+ const xmlChar *lang);
+XMLPUBFUN void XMLCALL
+xmlNodeSetSpacePreserve (xmlNodePtr cur,
+ int val);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetBase (xmlDocPtr doc,
- xmlNodePtr cur);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNodeGetBase (xmlDocPtr doc,
+ xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlNodeSetBase (xmlNodePtr cur,
- const xmlChar *uri);
+XMLPUBFUN void XMLCALL
+xmlNodeSetBase (xmlNodePtr cur,
+ const xmlChar *uri);
#endif
/*
* Removing content.
*/
-XMLPUBFUN int XMLCALL
- xmlRemoveProp (xmlAttrPtr cur);
+XMLPUBFUN int XMLCALL
+xmlRemoveProp (xmlAttrPtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlUnsetNsProp (xmlNodePtr node,
- xmlNsPtr ns,
- const xmlChar *name);
-XMLPUBFUN int XMLCALL
- xmlUnsetProp (xmlNodePtr node,
- const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlUnsetNsProp (xmlNodePtr node,
+ xmlNsPtr ns,
+ const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlUnsetProp (xmlNodePtr node,
+ const xmlChar *name);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Internal, don't use.
*/
-XMLPUBFUN void XMLCALL
- xmlBufferWriteCHAR (xmlBufferPtr buf,
- const xmlChar *string);
-XMLPUBFUN void XMLCALL
- xmlBufferWriteChar (xmlBufferPtr buf,
- const char *string);
-XMLPUBFUN void XMLCALL
- xmlBufferWriteQuotedString(xmlBufferPtr buf,
- const xmlChar *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteCHAR (xmlBufferPtr buf,
+ const xmlChar *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteChar (xmlBufferPtr buf,
+ const char *string);
+XMLPUBFUN void XMLCALL
+xmlBufferWriteQuotedString(xmlBufferPtr buf,
+ const xmlChar *string);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlAttrPtr attr,
- const xmlChar *string);
+ xmlDocPtr doc,
+ xmlAttrPtr attr,
+ const xmlChar *string);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_TREE_ENABLED
/*
* Namespace handling.
*/
-XMLPUBFUN int XMLCALL
- xmlReconciliateNs (xmlDocPtr doc,
- xmlNodePtr tree);
+XMLPUBFUN int XMLCALL
+xmlReconciliateNs (xmlDocPtr doc,
+ xmlNodePtr tree);
#endif
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Saving.
*/
-XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size,
- int format);
-XMLPUBFUN void XMLCALL
- xmlDocDumpMemory (xmlDocPtr cur,
- xmlChar **mem,
- int *size);
-XMLPUBFUN void XMLCALL
- xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding);
-XMLPUBFUN void XMLCALL
- xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
- xmlChar **doc_txt_ptr,
- int * doc_txt_len,
- const char *txt_encoding,
- int format);
-XMLPUBFUN int XMLCALL
- xmlDocFormatDump (FILE *f,
- xmlDocPtr cur,
- int format);
-XMLPUBFUN int XMLCALL
- xmlDocDump (FILE *f,
- xmlDocPtr cur);
-XMLPUBFUN void XMLCALL
- xmlElemDump (FILE *f,
- xmlDocPtr doc,
- xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
- xmlSaveFile (const char *filename,
- xmlDocPtr cur);
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFile (const char *filename,
- xmlDocPtr cur,
- int format);
-XMLPUBFUN int XMLCALL
- xmlNodeDump (xmlBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding);
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-XMLPUBFUN void XMLCALL
- xmlNodeDumpOutput (xmlOutputBufferPtr buf,
- xmlDocPtr doc,
- xmlNodePtr cur,
- int level,
- int format,
- const char *encoding);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFormatFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding,
- int format);
-
-XMLPUBFUN int XMLCALL
- xmlSaveFileEnc (const char *filename,
- xmlDocPtr cur,
- const char *encoding);
+XMLPUBFUN void XMLCALL
+xmlDocDumpFormatMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size,
+ int format);
+XMLPUBFUN void XMLCALL
+xmlDocDumpMemory (xmlDocPtr cur,
+ xmlChar **mem,
+ int *size);
+XMLPUBFUN void XMLCALL
+xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding);
+XMLPUBFUN void XMLCALL
+xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
+ xmlChar **doc_txt_ptr,
+ int * doc_txt_len,
+ const char *txt_encoding,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlDocFormatDump (FILE *f,
+ xmlDocPtr cur,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlDocDump (FILE *f,
+ xmlDocPtr cur);
+XMLPUBFUN void XMLCALL
+xmlElemDump (FILE *f,
+ xmlDocPtr doc,
+ xmlNodePtr cur);
+XMLPUBFUN int XMLCALL
+xmlSaveFile (const char *filename,
+ xmlDocPtr cur);
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFile (const char *filename,
+ xmlDocPtr cur,
+ int format);
+XMLPUBFUN int XMLCALL
+xmlNodeDump (xmlBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding);
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+XMLPUBFUN void XMLCALL
+xmlNodeDumpOutput (xmlOutputBufferPtr buf,
+ xmlDocPtr doc,
+ xmlNodePtr cur,
+ int level,
+ int format,
+ const char *encoding);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFormatFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding,
+ int format);
+
+XMLPUBFUN int XMLCALL
+xmlSaveFileEnc (const char *filename,
+ xmlDocPtr cur,
+ const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* XHTML
*/
-XMLPUBFUN int XMLCALL
- xmlIsXHTML (const xmlChar *systemID,
- const xmlChar *publicID);
+XMLPUBFUN int XMLCALL
+xmlIsXHTML (const xmlChar *systemID,
+ const xmlChar *publicID);
/*
* Compression.
*/
-XMLPUBFUN int XMLCALL
- xmlGetDocCompressMode (xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlSetDocCompressMode (xmlDocPtr doc,
- int mode);
-XMLPUBFUN int XMLCALL
- xmlGetCompressMode (void);
-XMLPUBFUN void XMLCALL
- xmlSetCompressMode (int mode);
+XMLPUBFUN int XMLCALL
+xmlGetDocCompressMode (xmlDocPtr doc);
+XMLPUBFUN void XMLCALL
+xmlSetDocCompressMode (xmlDocPtr doc,
+ int mode);
+XMLPUBFUN int XMLCALL
+xmlGetCompressMode (void);
+XMLPUBFUN void XMLCALL
+xmlSetCompressMode (int mode);
/*
* DOM-wrapper helper functions.
*/
XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL
- xmlDOMWrapNewCtxt (void);
+xmlDOMWrapNewCtxt (void);
XMLPUBFUN void XMLCALL
- xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
+xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
- xmlNodePtr elem,
- int options);
+xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
+ xmlNodePtr elem,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int options);
+xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr node,
- int options);
+xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr node,
+ int options);
XMLPUBFUN int XMLCALL
- xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
- xmlDocPtr sourceDoc,
- xmlNodePtr node,
- xmlNodePtr *clonedNode,
- xmlDocPtr destDoc,
- xmlNodePtr destParent,
- int deep,
- int options);
+xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
+ xmlDocPtr sourceDoc,
+ xmlNodePtr node,
+ xmlNodePtr *clonedNode,
+ xmlDocPtr destDoc,
+ xmlNodePtr destParent,
+ int deep,
+ int options);
#ifdef LIBXML_TREE_ENABLED
/*
@@ -1231,15 +1231,15 @@ XMLPUBFUN int XMLCALL
* traversal.
*/
XMLPUBFUN unsigned long XMLCALL
- xmlChildElementCount (xmlNodePtr parent);
+xmlChildElementCount (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNextElementSibling (xmlNodePtr node);
+xmlNextElementSibling (xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlFirstElementChild (xmlNodePtr parent);
+xmlFirstElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlLastElementChild (xmlNodePtr parent);
+xmlLastElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlPreviousElementSibling (xmlNodePtr node);
+xmlPreviousElementSibling (xmlNodePtr node);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/uri.h b/thirdparties/wince/include/libxml/uri.h
index db48262..599c3e3 100755
--- a/thirdparties/wince/include/libxml/uri.h
+++ b/thirdparties/wince/include/libxml/uri.h
@@ -50,43 +50,43 @@ struct _xmlURI {
* xmlNodePtr cur);
*/
XMLPUBFUN xmlURIPtr XMLCALL
- xmlCreateURI (void);
+xmlCreateURI (void);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlChar * XMLCALL
- xmlBuildRelativeURI (const xmlChar *URI,
- const xmlChar *base);
+xmlBuildRelativeURI (const xmlChar *URI,
+ const xmlChar *base);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURI (const char *str);
+xmlParseURI (const char *str);
XMLPUBFUN xmlURIPtr XMLCALL
- xmlParseURIRaw (const char *str,
- int raw);
+xmlParseURIRaw (const char *str,
+ int raw);
XMLPUBFUN int XMLCALL
- xmlParseURIReference (xmlURIPtr uri,
- const char *str);
+xmlParseURIReference (xmlURIPtr uri,
+ const char *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlSaveUri (xmlURIPtr uri);
+xmlSaveUri (xmlURIPtr uri);
XMLPUBFUN void XMLCALL
- xmlPrintURI (FILE *stream,
- xmlURIPtr uri);
+xmlPrintURI (FILE *stream,
+ xmlURIPtr uri);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscapeStr (const xmlChar *str,
- const xmlChar *list);
+xmlURIEscapeStr (const xmlChar *str,
+ const xmlChar *list);
XMLPUBFUN char * XMLCALL
- xmlURIUnescapeString (const char *str,
- int len,
- char *target);
+xmlURIUnescapeString (const char *str,
+ int len,
+ char *target);
XMLPUBFUN int XMLCALL
- xmlNormalizeURIPath (char *path);
+xmlNormalizeURIPath (char *path);
XMLPUBFUN xmlChar * XMLCALL
- xmlURIEscape (const xmlChar *str);
+xmlURIEscape (const xmlChar *str);
XMLPUBFUN void XMLCALL
- xmlFreeURI (xmlURIPtr uri);
+xmlFreeURI (xmlURIPtr uri);
XMLPUBFUN xmlChar* XMLCALL
- xmlCanonicPath (const xmlChar *path);
+xmlCanonicPath (const xmlChar *path);
XMLPUBFUN xmlChar* XMLCALL
- xmlPathToURI (const xmlChar *path);
+xmlPathToURI (const xmlChar *path);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/valid.h b/thirdparties/wince/include/libxml/valid.h
index a2307f1..b67a9d6 100755
--- a/thirdparties/wince/include/libxml/valid.h
+++ b/thirdparties/wince/include/libxml/valid.h
@@ -40,8 +40,8 @@ typedef xmlValidState *xmlValidStatePtr;
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlValidityWarningFunc:
@@ -55,8 +55,8 @@ typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
* oriented function similar to an *printf function.
*/
typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
#ifdef IN_LIBXML
/**
@@ -150,306 +150,306 @@ typedef struct _xmlHashTable xmlRefTable;
typedef xmlRefTable *xmlRefTablePtr;
/* Notation */
-XMLPUBFUN xmlNotationPtr XMLCALL
- xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *PublicID,
- const xmlChar *SystemID);
+XMLPUBFUN xmlNotationPtr XMLCALL
+xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *PublicID,
+ const xmlChar *SystemID);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNotationTablePtr XMLCALL
- xmlCopyNotationTable (xmlNotationTablePtr table);
+XMLPUBFUN xmlNotationTablePtr XMLCALL
+xmlCopyNotationTable (xmlNotationTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeNotationTable (xmlNotationTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeNotationTable (xmlNotationTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpNotationDecl (xmlBufferPtr buf,
- xmlNotationPtr nota);
-XMLPUBFUN void XMLCALL
- xmlDumpNotationTable (xmlBufferPtr buf,
- xmlNotationTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpNotationDecl (xmlBufferPtr buf,
+ xmlNotationPtr nota);
+XMLPUBFUN void XMLCALL
+xmlDumpNotationTable (xmlBufferPtr buf,
+ xmlNotationTablePtr table);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Element Content */
/* the non Doc version are being deprecated */
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewElementContent (const xmlChar *name,
- xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyElementContent (xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlFreeElementContent (xmlElementContentPtr cur);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlNewElementContent (const xmlChar *name,
+ xmlElementContentType type);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlCopyElementContent (xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlFreeElementContent (xmlElementContentPtr cur);
/* the new versions with doc argument */
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlNewDocElementContent (xmlDocPtr doc,
- const xmlChar *name,
- xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL
- xmlCopyDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL
- xmlFreeDocElementContent(xmlDocPtr doc,
- xmlElementContentPtr cur);
-XMLPUBFUN void XMLCALL
- xmlSnprintfElementContent(char *buf,
- int size,
- xmlElementContentPtr content,
- int englob);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlNewDocElementContent (xmlDocPtr doc,
+ const xmlChar *name,
+ xmlElementContentType type);
+XMLPUBFUN xmlElementContentPtr XMLCALL
+xmlCopyDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr content);
+XMLPUBFUN void XMLCALL
+xmlFreeDocElementContent(xmlDocPtr doc,
+ xmlElementContentPtr cur);
+XMLPUBFUN void XMLCALL
+xmlSnprintfElementContent(char *buf,
+ int size,
+ xmlElementContentPtr content,
+ int englob);
#ifdef LIBXML_OUTPUT_ENABLED
/* DEPRECATED */
-XMLPUBFUN void XMLCALL
- xmlSprintfElementContent(char *buf,
- xmlElementContentPtr content,
- int englob);
+XMLPUBFUN void XMLCALL
+xmlSprintfElementContent(char *buf,
+ xmlElementContentPtr content,
+ int englob);
#endif /* LIBXML_OUTPUT_ENABLED */
/* DEPRECATED */
/* Element */
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlAddElementDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *name,
- xmlElementTypeVal type,
- xmlElementContentPtr content);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlAddElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *name,
+ xmlElementTypeVal type,
+ xmlElementContentPtr content);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlElementTablePtr XMLCALL
- xmlCopyElementTable (xmlElementTablePtr table);
+XMLPUBFUN xmlElementTablePtr XMLCALL
+xmlCopyElementTable (xmlElementTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeElementTable (xmlElementTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeElementTable (xmlElementTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpElementTable (xmlBufferPtr buf,
- xmlElementTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlDumpElementDecl (xmlBufferPtr buf,
- xmlElementPtr elem);
+XMLPUBFUN void XMLCALL
+xmlDumpElementTable (xmlBufferPtr buf,
+ xmlElementTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpElementDecl (xmlBufferPtr buf,
+ xmlElementPtr elem);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCreateEnumeration (const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlFreeEnumeration (xmlEnumerationPtr cur);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlCreateEnumeration (const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlFreeEnumeration (xmlEnumerationPtr cur);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlEnumerationPtr XMLCALL
- xmlCopyEnumeration (xmlEnumerationPtr cur);
+XMLPUBFUN xmlEnumerationPtr XMLCALL
+xmlCopyEnumeration (xmlEnumerationPtr cur);
#endif /* LIBXML_TREE_ENABLED */
/* Attribute */
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
- xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *ns,
- xmlAttributeType type,
- xmlAttributeDefault def,
- const xmlChar *defaultValue,
- xmlEnumerationPtr tree);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
+ xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *ns,
+ xmlAttributeType type,
+ xmlAttributeDefault def,
+ const xmlChar *defaultValue,
+ xmlEnumerationPtr tree);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlAttributeTablePtr XMLCALL
- xmlCopyAttributeTable (xmlAttributeTablePtr table);
+XMLPUBFUN xmlAttributeTablePtr XMLCALL
+xmlCopyAttributeTable (xmlAttributeTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
- xmlFreeAttributeTable (xmlAttributeTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlFreeAttributeTable (xmlAttributeTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
- xmlDumpAttributeTable (xmlBufferPtr buf,
- xmlAttributeTablePtr table);
-XMLPUBFUN void XMLCALL
- xmlDumpAttributeDecl (xmlBufferPtr buf,
- xmlAttributePtr attr);
+XMLPUBFUN void XMLCALL
+xmlDumpAttributeTable (xmlBufferPtr buf,
+ xmlAttributeTablePtr table);
+XMLPUBFUN void XMLCALL
+xmlDumpAttributeDecl (xmlBufferPtr buf,
+ xmlAttributePtr attr);
#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */
-XMLPUBFUN xmlIDPtr XMLCALL
- xmlAddID (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL
- xmlFreeIDTable (xmlIDTablePtr table);
-XMLPUBFUN xmlAttrPtr XMLCALL
- xmlGetID (xmlDocPtr doc,
- const xmlChar *ID);
-XMLPUBFUN int XMLCALL
- xmlIsID (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL
- xmlRemoveID (xmlDocPtr doc,
- xmlAttrPtr attr);
+XMLPUBFUN xmlIDPtr XMLCALL
+xmlAddID (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
+XMLPUBFUN void XMLCALL
+xmlFreeIDTable (xmlIDTablePtr table);
+XMLPUBFUN xmlAttrPtr XMLCALL
+xmlGetID (xmlDocPtr doc,
+ const xmlChar *ID);
+XMLPUBFUN int XMLCALL
+xmlIsID (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
+XMLPUBFUN int XMLCALL
+xmlRemoveID (xmlDocPtr doc,
+ xmlAttrPtr attr);
/* IDREFs */
-XMLPUBFUN xmlRefPtr XMLCALL
- xmlAddRef (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *value,
- xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL
- xmlFreeRefTable (xmlRefTablePtr table);
-XMLPUBFUN int XMLCALL
- xmlIsRef (xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL
- xmlRemoveRef (xmlDocPtr doc,
- xmlAttrPtr attr);
-XMLPUBFUN xmlListPtr XMLCALL
- xmlGetRefs (xmlDocPtr doc,
- const xmlChar *ID);
+XMLPUBFUN xmlRefPtr XMLCALL
+xmlAddRef (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *value,
+ xmlAttrPtr attr);
+XMLPUBFUN void XMLCALL
+xmlFreeRefTable (xmlRefTablePtr table);
+XMLPUBFUN int XMLCALL
+xmlIsRef (xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr);
+XMLPUBFUN int XMLCALL
+xmlRemoveRef (xmlDocPtr doc,
+ xmlAttrPtr attr);
+XMLPUBFUN xmlListPtr XMLCALL
+xmlGetRefs (xmlDocPtr doc,
+ const xmlChar *ID);
/**
* The public function calls related to validity checking.
*/
#ifdef LIBXML_VALID_ENABLED
/* Allocate/Release Validation Contexts */
-XMLPUBFUN xmlValidCtxtPtr XMLCALL
- xmlNewValidCtxt(void);
-XMLPUBFUN void XMLCALL
- xmlFreeValidCtxt(xmlValidCtxtPtr);
-
-XMLPUBFUN int XMLCALL
- xmlValidateRoot (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlElementPtr elem);
-XMLPUBFUN xmlChar * XMLCALL
- xmlValidNormalizeAttributeValue(xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL
- xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *name,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlAttributePtr attr);
-XMLPUBFUN int XMLCALL
- xmlValidateAttributeValue(xmlAttributeType type,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNotationPtr nota);
-XMLPUBFUN int XMLCALL
- xmlValidateDtd (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlDtdPtr dtd);
-XMLPUBFUN int XMLCALL
- xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateDocument (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlValidateElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- xmlValidateOneElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
- xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- xmlAttrPtr attr,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *prefix,
- xmlNsPtr ns,
- const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
- xmlDocPtr doc);
+XMLPUBFUN xmlValidCtxtPtr XMLCALL
+xmlNewValidCtxt(void);
+XMLPUBFUN void XMLCALL
+xmlFreeValidCtxt(xmlValidCtxtPtr);
+
+XMLPUBFUN int XMLCALL
+xmlValidateRoot (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlElementPtr elem);
+XMLPUBFUN xmlChar * XMLCALL
+xmlValidNormalizeAttributeValue(xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN xmlChar * XMLCALL
+xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *name,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlAttributePtr attr);
+XMLPUBFUN int XMLCALL
+xmlValidateAttributeValue(xmlAttributeType type,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNotationPtr nota);
+XMLPUBFUN int XMLCALL
+xmlValidateDtd (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlDtdPtr dtd);
+XMLPUBFUN int XMLCALL
+xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateDocument (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlValidateElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+xmlValidateOneElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem);
+XMLPUBFUN int XMLCALL
+xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ xmlAttrPtr attr,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *prefix,
+ xmlNsPtr ns,
+ const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc);
#endif /* LIBXML_VALID_ENABLED */
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL
- xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- const xmlChar *notationName);
+XMLPUBFUN int XMLCALL
+xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ const xmlChar *notationName);
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlIsMixedElement (xmlDocPtr doc,
- const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL
- xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
- const xmlChar *elem,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN xmlNotationPtr XMLCALL
- xmlGetDtdNotationDesc (xmlDtdPtr dtd,
- const xmlChar *name);
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdQElementDesc (xmlDtdPtr dtd,
- const xmlChar *name,
- const xmlChar *prefix);
-XMLPUBFUN xmlElementPtr XMLCALL
- xmlGetDtdElementDesc (xmlDtdPtr dtd,
- const xmlChar *name);
+XMLPUBFUN int XMLCALL
+xmlIsMixedElement (xmlDocPtr doc,
+ const xmlChar *name);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlGetDtdAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name);
+XMLPUBFUN xmlAttributePtr XMLCALL
+xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
+ const xmlChar *elem,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN xmlNotationPtr XMLCALL
+xmlGetDtdNotationDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlGetDtdQElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name,
+ const xmlChar *prefix);
+XMLPUBFUN xmlElementPtr XMLCALL
+xmlGetDtdElementDesc (xmlDtdPtr dtd,
+ const xmlChar *name);
#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int XMLCALL
- xmlValidGetPotentialChildren(xmlElementContent *ctree,
- const xmlChar **names,
- int *len,
- int max);
-
-XMLPUBFUN int XMLCALL
- xmlValidGetValidElements(xmlNode *prev,
- xmlNode *next,
- const xmlChar **names,
- int max);
-XMLPUBFUN int XMLCALL
- xmlValidateNameValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNamesValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNmtokenValue (const xmlChar *value);
-XMLPUBFUN int XMLCALL
- xmlValidateNmtokensValue(const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidGetPotentialChildren(xmlElementContent *ctree,
+ const xmlChar **names,
+ int *len,
+ int max);
+
+XMLPUBFUN int XMLCALL
+xmlValidGetValidElements(xmlNode *prev,
+ xmlNode *next,
+ const xmlChar **names,
+ int max);
+XMLPUBFUN int XMLCALL
+xmlValidateNameValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNamesValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNmtokenValue (const xmlChar *value);
+XMLPUBFUN int XMLCALL
+xmlValidateNmtokensValue(const xmlChar *value);
#ifdef LIBXML_REGEXP_ENABLED
/*
* Validation based on the regexp support
*/
-XMLPUBFUN int XMLCALL
- xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
- xmlElementPtr elem);
-
-XMLPUBFUN int XMLCALL
- xmlValidatePushElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
-XMLPUBFUN int XMLCALL
- xmlValidatePushCData (xmlValidCtxtPtr ctxt,
- const xmlChar *data,
- int len);
-XMLPUBFUN int XMLCALL
- xmlValidatePopElement (xmlValidCtxtPtr ctxt,
- xmlDocPtr doc,
- xmlNodePtr elem,
- const xmlChar *qname);
+XMLPUBFUN int XMLCALL
+xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
+ xmlElementPtr elem);
+
+XMLPUBFUN int XMLCALL
+xmlValidatePushElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
+XMLPUBFUN int XMLCALL
+xmlValidatePushCData (xmlValidCtxtPtr ctxt,
+ const xmlChar *data,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlValidatePopElement (xmlValidCtxtPtr ctxt,
+ xmlDocPtr doc,
+ xmlNodePtr elem,
+ const xmlChar *qname);
#endif /* LIBXML_REGEXP_ENABLED */
#endif /* LIBXML_VALID_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/libxml/xinclude.h b/thirdparties/wince/include/libxml/xinclude.h
index 863ab25..e6b79cb 100755
--- a/thirdparties/wince/include/libxml/xinclude.h
+++ b/thirdparties/wince/include/libxml/xinclude.h
@@ -90,36 +90,36 @@ typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
* standalone processing
*/
XMLPUBFUN int XMLCALL
- xmlXIncludeProcess (xmlDocPtr doc);
+xmlXIncludeProcess (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlags (xmlDocPtr doc,
- int flags);
+xmlXIncludeProcessFlags (xmlDocPtr doc,
+ int flags);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessFlagsData(xmlDocPtr doc,
- int flags,
- void *data);
+xmlXIncludeProcessFlagsData(xmlDocPtr doc,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
- int flags,
- void *data);
+xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
+ int flags,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTree (xmlNodePtr tree);
+xmlXIncludeProcessTree (xmlNodePtr tree);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
- int flags);
+xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
+ int flags);
/*
* contextual processing
*/
XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL
- xmlXIncludeNewContext (xmlDocPtr doc);
+xmlXIncludeNewContext (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
- xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
- int flags);
+xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
+ int flags);
XMLPUBFUN void XMLCALL
- xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
+xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
- xmlNodePtr tree);
+xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
+ xmlNodePtr tree);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/xlink.h b/thirdparties/wince/include/libxml/xlink.h
index 083c7ed..adf3fc5 100755
--- a/thirdparties/wince/include/libxml/xlink.h
+++ b/thirdparties/wince/include/libxml/xlink.h
@@ -57,7 +57,7 @@ typedef enum {
* xlinkNodeDetectFunc:
* @ctx: user data pointer
* @node: the node to check
- *
+ *
* This is the prototype for the link detection routine.
* It calls the default link detection callbacks upon link detection.
*/
@@ -80,10 +80,10 @@ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
*/
typedef void
(*xlinkSimpleLinkFunk) (void *ctx,
- xmlNodePtr node,
- const xlinkHRef href,
- const xlinkRole role,
- const xlinkTitle title);
+ xmlNodePtr node,
+ const xlinkHRef href,
+ const xlinkRole role,
+ const xlinkTitle title);
/**
* xlinkExtendedLinkFunk:
@@ -105,18 +105,18 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkFunk)(void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbArcs,
- const xlinkRole *from,
- const xlinkRole *to,
- xlinkShow *show,
- xlinkActuate *actuate,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbArcs,
+ const xlinkRole *from,
+ const xlinkRole *to,
+ xlinkShow *show,
+ xlinkActuate *actuate,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* xlinkExtendedLinkSetFunk:
@@ -133,13 +133,13 @@ typedef void
*/
typedef void
(*xlinkExtendedLinkSetFunk) (void *ctx,
- xmlNodePtr node,
- int nbLocators,
- const xlinkHRef *hrefs,
- const xlinkRole *roles,
- int nbTitles,
- const xlinkTitle *titles,
- const xmlChar **langs);
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
/**
* This is the structure containing a set of Links detection callbacks.
@@ -157,28 +157,28 @@ struct _xlinkHandler {
/*
* The default detection routine, can be overridden, they call the default
- * detection callbacks.
+ * detection callbacks.
*/
-XMLPUBFUN xlinkNodeDetectFunc XMLCALL
- xlinkGetDefaultDetect (void);
-XMLPUBFUN void XMLCALL
- xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
+XMLPUBFUN xlinkNodeDetectFunc XMLCALL
+xlinkGetDefaultDetect (void);
+XMLPUBFUN void XMLCALL
+xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
/*
* Routines to set/get the default handlers.
*/
-XMLPUBFUN xlinkHandlerPtr XMLCALL
- xlinkGetDefaultHandler (void);
-XMLPUBFUN void XMLCALL
- xlinkSetDefaultHandler (xlinkHandlerPtr handler);
+XMLPUBFUN xlinkHandlerPtr XMLCALL
+xlinkGetDefaultHandler (void);
+XMLPUBFUN void XMLCALL
+xlinkSetDefaultHandler (xlinkHandlerPtr handler);
/*
* Link detection module itself.
*/
-XMLPUBFUN xlinkType XMLCALL
- xlinkIsLink (xmlDocPtr doc,
- xmlNodePtr node);
+XMLPUBFUN xlinkType XMLCALL
+xlinkIsLink (xmlDocPtr doc,
+ xmlNodePtr node);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xmlIO.h b/thirdparties/wince/include/libxml/xmlIO.h
index eea9ed6..bef40bb 100755
--- a/thirdparties/wince/include/libxml/xmlIO.h
+++ b/thirdparties/wince/include/libxml/xmlIO.h
@@ -26,7 +26,7 @@ extern "C" {
* xmlInputMatchCallback:
* @filename: the filename or URI
*
- * Callback used in the I/O Input API to detect if the current handler
+ * Callback used in the I/O Input API to detect if the current handler
* can provide input fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
@@ -72,7 +72,7 @@ typedef int (XMLCALL *xmlInputCloseCallback) (void * context);
* xmlOutputMatchCallback:
* @filename: the filename or URI
*
- * Callback used in the I/O Output API to detect if the current handler
+ * Callback used in the I/O Output API to detect if the current handler
* can provide output fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
@@ -98,7 +98,7 @@ typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
* Returns the number of bytes written or -1 in case of error
*/
typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
- int len);
+ int len);
/**
* xmlOutputCloseCallback:
* @context: an Output context
@@ -126,9 +126,9 @@ struct _xmlParserInputBuffer {
void* context;
xmlInputReadCallback readcallback;
xmlInputCloseCallback closecallback;
-
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-
+
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
@@ -142,9 +142,9 @@ struct _xmlOutputBuffer {
void* context;
xmlOutputWriteCallback writecallback;
xmlOutputCloseCallback closecallback;
-
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-
+
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
xmlBufferPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */
@@ -155,202 +155,202 @@ struct _xmlOutputBuffer {
/*
* Interfaces for input
*/
-XMLPUBFUN void XMLCALL
- xmlCleanupInputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlCleanupInputCallbacks (void);
XMLPUBFUN int XMLCALL
- xmlPopInputCallbacks (void);
+xmlPopInputCallbacks (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterDefaultInputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterDefaultInputCallbacks (void);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlAllocParserInputBuffer (xmlCharEncoding enc);
+xmlAllocParserInputBuffer (xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFilename (const char *URI,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFilename (const char *URI,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFile (FILE *file,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFile (FILE *file,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateFd (int fd,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateFd (int fd,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateMem (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateMem (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateStatic (const char *mem, int size,
- xmlCharEncoding enc);
+xmlParserInputBufferCreateStatic (const char *mem, int size,
+ xmlCharEncoding enc);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferRead (xmlParserInputBufferPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
- int len);
-XMLPUBFUN int XMLCALL
- xmlParserInputBufferPush (xmlParserInputBufferPtr in,
- int len,
- const char *buf);
-XMLPUBFUN void XMLCALL
- xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
-XMLPUBFUN char * XMLCALL
- xmlParserGetDirectory (const char *filename);
-
-XMLPUBFUN int XMLCALL
- xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
- xmlInputOpenCallback openFunc,
- xmlInputReadCallback readFunc,
- xmlInputCloseCallback closeFunc);
+xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncoding enc);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferRead (xmlParserInputBufferPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlParserInputBufferPush (xmlParserInputBufferPtr in,
+ int len,
+ const char *buf);
+XMLPUBFUN void XMLCALL
+xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
+XMLPUBFUN char * XMLCALL
+xmlParserGetDirectory (const char *filename);
+
+XMLPUBFUN int XMLCALL
+xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
+ xmlInputOpenCallback openFunc,
+ xmlInputReadCallback readFunc,
+ xmlInputCloseCallback closeFunc);
xmlParserInputBufferPtr
- __xmlParserInputBufferCreateFilename(const char *URI,
- xmlCharEncoding enc);
+__xmlParserInputBufferCreateFilename(const char *URI,
+ xmlCharEncoding enc);
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Interfaces for output
*/
-XMLPUBFUN void XMLCALL
- xmlCleanupOutputCallbacks (void);
-XMLPUBFUN void XMLCALL
- xmlRegisterDefaultOutputCallbacks(void);
+XMLPUBFUN void XMLCALL
+xmlCleanupOutputCallbacks (void);
+XMLPUBFUN void XMLCALL
+xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
+xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFilename (const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+xmlOutputBufferCreateFilename (const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFile (FILE *file,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFile (FILE *file,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateFd (int fd,
- xmlCharEncodingHandlerPtr encoder);
+xmlOutputBufferCreateFd (int fd,
+ xmlCharEncodingHandlerPtr encoder);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
- xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
- xmlOutputCloseCallback ioclose,
- void *ioctx,
- xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWrite (xmlOutputBufferPtr out,
- int len,
- const char *buf);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteString (xmlOutputBufferPtr out,
- const char *str);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
- const xmlChar *str,
- xmlCharEncodingOutputFunc escaping);
-
-XMLPUBFUN int XMLCALL
- xmlOutputBufferFlush (xmlOutputBufferPtr out);
-XMLPUBFUN int XMLCALL
- xmlOutputBufferClose (xmlOutputBufferPtr out);
-
-XMLPUBFUN int XMLCALL
- xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
- xmlOutputOpenCallback openFunc,
- xmlOutputWriteCallback writeFunc,
- xmlOutputCloseCallback closeFunc);
+xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
+ xmlOutputCloseCallback ioclose,
+ void *ioctx,
+ xmlCharEncodingHandlerPtr encoder);
+
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWrite (xmlOutputBufferPtr out,
+ int len,
+ const char *buf);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWriteString (xmlOutputBufferPtr out,
+ const char *str);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
+ const xmlChar *str,
+ xmlCharEncodingOutputFunc escaping);
+
+XMLPUBFUN int XMLCALL
+xmlOutputBufferFlush (xmlOutputBufferPtr out);
+XMLPUBFUN int XMLCALL
+xmlOutputBufferClose (xmlOutputBufferPtr out);
+
+XMLPUBFUN int XMLCALL
+xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
+ xmlOutputOpenCallback openFunc,
+ xmlOutputWriteCallback writeFunc,
+ xmlOutputCloseCallback closeFunc);
xmlOutputBufferPtr
- __xmlOutputBufferCreateFilename(const char *URI,
- xmlCharEncodingHandlerPtr encoder,
- int compression);
+__xmlOutputBufferCreateFilename(const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
#ifdef LIBXML_HTTP_ENABLED
/* This function only exists if HTTP support built into the library */
-XMLPUBFUN void XMLCALL
- xmlRegisterHTTPPostCallbacks (void );
+XMLPUBFUN void XMLCALL
+xmlRegisterHTTPPostCallbacks (void );
#endif /* LIBXML_HTTP_ENABLED */
-
+
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
- xmlParserInputPtr ret);
+xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
+ xmlParserInputPtr ret);
/*
* A predefined entity loader disabling network accesses
*/
-XMLPUBFUN xmlParserInputPtr XMLCALL
- xmlNoNetExternalEntityLoader (const char *URL,
- const char *ID,
- xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserInputPtr XMLCALL
+xmlNoNetExternalEntityLoader (const char *URL,
+ const char *ID,
+ xmlParserCtxtPtr ctxt);
-/*
- * xmlNormalizeWindowsPath is obsolete, don't use it.
+/*
+ * xmlNormalizeWindowsPath is obsolete, don't use it.
* Check xmlCanonicPath in uri.h for a better alternative.
*/
-XMLPUBFUN xmlChar * XMLCALL
- xmlNormalizeWindowsPath (const xmlChar *path);
+XMLPUBFUN xmlChar * XMLCALL
+xmlNormalizeWindowsPath (const xmlChar *path);
-XMLPUBFUN int XMLCALL
- xmlCheckFilename (const char *path);
+XMLPUBFUN int XMLCALL
+xmlCheckFilename (const char *path);
/**
- * Default 'file://' protocol callbacks
+ * Default 'file://' protocol callbacks
*/
-XMLPUBFUN int XMLCALL
- xmlFileMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlFileOpen (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlFileRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlFileClose (void * context);
+XMLPUBFUN int XMLCALL
+xmlFileMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlFileOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlFileRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlFileClose (void * context);
/**
- * Default 'http://' protocol callbacks
+ * Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_ENABLED
-XMLPUBFUN int XMLCALL
- xmlIOHTTPMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void * XMLCALL
- xmlIOHTTPOpenW (const char * post_uri,
- int compression );
+XMLPUBFUN void * XMLCALL
+xmlIOHTTPOpenW (const char * post_uri,
+ int compression );
#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL
- xmlIOHTTPRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlIOHTTPClose (void * context);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */
/**
- * Default 'ftp://' protocol callbacks
+ * Default 'ftp://' protocol callbacks
*/
-#ifdef LIBXML_FTP_ENABLED
-XMLPUBFUN int XMLCALL
- xmlIOFTPMatch (const char *filename);
-XMLPUBFUN void * XMLCALL
- xmlIOFTPOpen (const char *filename);
-XMLPUBFUN int XMLCALL
- xmlIOFTPRead (void * context,
- char * buffer,
- int len);
-XMLPUBFUN int XMLCALL
- xmlIOFTPClose (void * context);
+#ifdef LIBXML_FTP_ENABLED
+XMLPUBFUN int XMLCALL
+xmlIOFTPMatch (const char *filename);
+XMLPUBFUN void * XMLCALL
+xmlIOFTPOpen (const char *filename);
+XMLPUBFUN int XMLCALL
+xmlIOFTPRead (void * context,
+ char * buffer,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlIOFTPClose (void * context);
#endif /* LIBXML_FTP_ENABLED */
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/libxml/xmlautomata.h b/thirdparties/wince/include/libxml/xmlautomata.h
index f98b55e..1a49117 100755
--- a/thirdparties/wince/include/libxml/xmlautomata.h
+++ b/thirdparties/wince/include/libxml/xmlautomata.h
@@ -40,105 +40,105 @@ typedef xmlAutomataState *xmlAutomataStatePtr;
/*
* Building API
*/
-XMLPUBFUN xmlAutomataPtr XMLCALL
- xmlNewAutomata (void);
-XMLPUBFUN void XMLCALL
- xmlFreeAutomata (xmlAutomataPtr am);
+XMLPUBFUN xmlAutomataPtr XMLCALL
+xmlNewAutomata (void);
+XMLPUBFUN void XMLCALL
+xmlFreeAutomata (xmlAutomataPtr am);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataGetInitState (xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL
- xmlAutomataSetFinalState (xmlAutomataPtr am,
- xmlAutomataStatePtr state);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewState (xmlAutomataPtr am);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewTransition2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewNegTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- void *data);
+xmlAutomataGetInitState (xmlAutomataPtr am);
+XMLPUBFUN int XMLCALL
+xmlAutomataSetFinalState (xmlAutomataPtr am,
+ xmlAutomataStatePtr state);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewState (xmlAutomataPtr am);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewTransition (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewTransition2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewNegTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- int min,
- int max,
- void *data);
XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- const xmlChar *token,
- const xmlChar *token2,
- int min,
- int max,
- void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewAllTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int lax);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewEpsilon (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCountedTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
- xmlAutomataNewCounterTrans (xmlAutomataPtr am,
- xmlAutomataStatePtr from,
- xmlAutomataStatePtr to,
- int counter);
-XMLPUBFUN int XMLCALL
- xmlAutomataNewCounter (xmlAutomataPtr am,
- int min,
- int max);
+xmlAutomataNewCountTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewOnceTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ const xmlChar *token,
+ const xmlChar *token2,
+ int min,
+ int max,
+ void *data);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewAllTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int lax);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewEpsilon (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCountedTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
+XMLPUBFUN xmlAutomataStatePtr XMLCALL
+xmlAutomataNewCounterTrans (xmlAutomataPtr am,
+ xmlAutomataStatePtr from,
+ xmlAutomataStatePtr to,
+ int counter);
+XMLPUBFUN int XMLCALL
+xmlAutomataNewCounter (xmlAutomataPtr am,
+ int min,
+ int max);
-XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlAutomataCompile (xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL
- xmlAutomataIsDeterminist (xmlAutomataPtr am);
+XMLPUBFUN xmlRegexpPtr XMLCALL
+xmlAutomataCompile (xmlAutomataPtr am);
+XMLPUBFUN int XMLCALL
+xmlAutomataIsDeterminist (xmlAutomataPtr am);
#ifdef __cplusplus
}
-#endif
+#endif
#endif /* LIBXML_AUTOMATA_ENABLED */
#endif /* LIBXML_REGEXP_ENABLED */
diff --git a/thirdparties/wince/include/libxml/xmlerror.h b/thirdparties/wince/include/libxml/xmlerror.h
index e924211..0702229 100755
--- a/thirdparties/wince/include/libxml/xmlerror.h
+++ b/thirdparties/wince/include/libxml/xmlerror.h
@@ -26,7 +26,8 @@ typedef enum {
XML_ERR_WARNING = 1, /* A simple warning */
XML_ERR_ERROR = 2, /* A recoverable error */
XML_ERR_FATAL = 3 /* A fatal error */
-} xmlErrorLevel;
+}
+xmlErrorLevel;
/**
* xmlErrorDomain:
@@ -842,8 +843,8 @@ typedef enum {
* no parsing or validity context available .
*/
typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlStructuredErrorFunc:
* @userData: user provided data for the error callback
@@ -859,84 +860,84 @@ typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr erro
* xmlGenericError and xmlGenericErrorContext.
*/
XMLPUBFUN void XMLCALL
- xmlSetGenericErrorFunc (void *ctx,
- xmlGenericErrorFunc handler);
+xmlSetGenericErrorFunc (void *ctx,
+ xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
- initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
+initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
XMLPUBFUN void XMLCALL
- xmlSetStructuredErrorFunc (void *ctx,
- xmlStructuredErrorFunc handler);
+xmlSetStructuredErrorFunc (void *ctx,
+ xmlStructuredErrorFunc handler);
/*
* Default message routines used by SAX and Valid context for error
* and warning reporting.
*/
XMLPUBFUN void XMLCDECL
- xmlParserError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityError (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityError (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCDECL
- xmlParserValidityWarning (void *ctx,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(2,3);
+xmlParserValidityWarning (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileInfo (xmlParserInputPtr input);
+xmlParserPrintFileInfo (xmlParserInputPtr input);
XMLPUBFUN void XMLCALL
- xmlParserPrintFileContext (xmlParserInputPtr input);
+xmlParserPrintFileContext (xmlParserInputPtr input);
/*
* Extended error information routines
*/
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlGetLastError (void);
+xmlGetLastError (void);
XMLPUBFUN void XMLCALL
- xmlResetLastError (void);
+xmlResetLastError (void);
XMLPUBFUN xmlErrorPtr XMLCALL
- xmlCtxtGetLastError (void *ctx);
+xmlCtxtGetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlCtxtResetLastError (void *ctx);
+xmlCtxtResetLastError (void *ctx);
XMLPUBFUN void XMLCALL
- xmlResetError (xmlErrorPtr err);
+xmlResetError (xmlErrorPtr err);
XMLPUBFUN int XMLCALL
- xmlCopyError (xmlErrorPtr from,
- xmlErrorPtr to);
+xmlCopyError (xmlErrorPtr from,
+ xmlErrorPtr to);
#ifdef IN_LIBXML
/*
* Internal callback reporting routine
*/
XMLPUBFUN void XMLCALL
- __xmlRaiseError (xmlStructuredErrorFunc schannel,
- xmlGenericErrorFunc channel,
- void *data,
- void *ctx,
- void *node,
- int domain,
- int code,
- xmlErrorLevel level,
- const char *file,
- int line,
- const char *str1,
- const char *str2,
- const char *str3,
- int int1,
- int col,
- const char *msg,
- ...) LIBXML_ATTR_FORMAT(16,17);
+__xmlRaiseError (xmlStructuredErrorFunc schannel,
+ xmlGenericErrorFunc channel,
+ void *data,
+ void *ctx,
+ void *node,
+ int domain,
+ int code,
+ xmlErrorLevel level,
+ const char *file,
+ int line,
+ const char *str1,
+ const char *str2,
+ const char *str3,
+ int int1,
+ int col,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(16,17);
XMLPUBFUN void XMLCALL
- __xmlSimpleError (int domain,
- int code,
- xmlNodePtr node,
- const char *msg,
- const char *extra);
+__xmlSimpleError (int domain,
+ int code,
+ xmlNodePtr node,
+ const char *msg,
+ const char *extra);
#endif
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xmlexports.h b/thirdparties/wince/include/libxml/xmlexports.h
index b90659f..0c65eac 100755
--- a/thirdparties/wince/include/libxml/xmlexports.h
+++ b/thirdparties/wince/include/libxml/xmlexports.h
@@ -43,7 +43,7 @@
/**
* XMLCDECL:
*
- * Macro which declares the calling convention for exported functions that
+ * Macro which declares the calling convention for exported functions that
* use '...'.
*/
#define XMLCDECL
@@ -52,104 +52,104 @@
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #if defined(LIBXML_FASTCALL)
- #define XMLCALL __fastcall
- #else
- #define XMLCALL __cdecl
- #endif
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#if defined(LIBXML_FASTCALL)
+#define XMLCALL __fastcall
+#else
+#define XMLCALL __cdecl
+#endif
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport) extern
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- /*
- * if defined(IN_LIBXML) this raises problems on mingw with msys
- * _imp__xmlFree listed as missing. Try to workaround the problem
- * by also making that declaration when compiling client code.
- */
- #if !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
- #if !defined _REENTRANT
- #define _REENTRANT
- #endif
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+/*
+ * if defined(IN_LIBXML) this raises problems on mingw with msys
+ * _imp__xmlFree listed as missing. Try to workaround the problem
+ * by also making that declaration when compiling client code.
+ */
+#if !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR extern
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
+#if !defined _REENTRANT
+#define _REENTRANT
+#endif
#endif
/* Cygwin platform, GNU compiler */
#if defined(_WIN32) && defined(__CYGWIN__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
+#undef XMLPUBFUN
+#undef XMLPUBVAR
+#undef XMLCALL
+#undef XMLCDECL
+#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#define XMLPUBFUN __declspec(dllexport)
+#define XMLPUBVAR __declspec(dllexport)
+#else
+#define XMLPUBFUN
+#if !defined(LIBXML_STATIC)
+#define XMLPUBVAR __declspec(dllimport) extern
+#else
+#define XMLPUBVAR
+#endif
+#endif
+#define XMLCALL __cdecl
+#define XMLCDECL __cdecl
#endif
/* Compatibility */
diff --git a/thirdparties/wince/include/libxml/xmlmemory.h b/thirdparties/wince/include/libxml/xmlmemory.h
index 17e375a..58e6e5c 100755
--- a/thirdparties/wince/include/libxml/xmlmemory.h
+++ b/thirdparties/wince/include/libxml/xmlmemory.h
@@ -101,70 +101,70 @@ LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup;
* allocations useful for garbage collected memory allocators
*/
XMLPUBFUN int XMLCALL
- xmlMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemSetup (xmlFreeFunc freeFunc,
- xmlMallocFunc mallocFunc,
- xmlMallocFunc mallocAtomicFunc,
- xmlReallocFunc reallocFunc,
- xmlStrdupFunc strdupFunc);
+xmlGcMemSetup (xmlFreeFunc freeFunc,
+ xmlMallocFunc mallocFunc,
+ xmlMallocFunc mallocAtomicFunc,
+ xmlReallocFunc reallocFunc,
+ xmlStrdupFunc strdupFunc);
XMLPUBFUN int XMLCALL
- xmlGcMemGet (xmlFreeFunc *freeFunc,
- xmlMallocFunc *mallocFunc,
- xmlMallocFunc *mallocAtomicFunc,
- xmlReallocFunc *reallocFunc,
- xmlStrdupFunc *strdupFunc);
+xmlGcMemGet (xmlFreeFunc *freeFunc,
+ xmlMallocFunc *mallocFunc,
+ xmlMallocFunc *mallocAtomicFunc,
+ xmlReallocFunc *reallocFunc,
+ xmlStrdupFunc *strdupFunc);
/*
* Initialization of the memory layer.
*/
XMLPUBFUN int XMLCALL
- xmlInitMemory (void);
+xmlInitMemory (void);
/*
* Cleanup of the memory layer.
*/
XMLPUBFUN void XMLCALL
- xmlCleanupMemory (void);
+xmlCleanupMemory (void);
/*
* These are specific to the XML debug memory wrapper.
*/
XMLPUBFUN int XMLCALL
- xmlMemUsed (void);
+xmlMemUsed (void);
XMLPUBFUN int XMLCALL
- xmlMemBlocks (void);
+xmlMemBlocks (void);
XMLPUBFUN void XMLCALL
- xmlMemDisplay (FILE *fp);
+xmlMemDisplay (FILE *fp);
XMLPUBFUN void XMLCALL
- xmlMemDisplayLast(FILE *fp, long nbBytes);
+xmlMemDisplayLast(FILE *fp, long nbBytes);
XMLPUBFUN void XMLCALL
- xmlMemShow (FILE *fp, int nr);
+xmlMemShow (FILE *fp, int nr);
XMLPUBFUN void XMLCALL
- xmlMemoryDump (void);
+xmlMemoryDump (void);
XMLPUBFUN void * XMLCALL
- xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlMemRealloc (void *ptr,size_t size);
+xmlMemRealloc (void *ptr,size_t size);
XMLPUBFUN void XMLCALL
- xmlMemFree (void *ptr);
+xmlMemFree (void *ptr);
XMLPUBFUN char * XMLCALL
- xmlMemoryStrdup (const char *str);
+xmlMemoryStrdup (const char *str);
XMLPUBFUN void * XMLCALL
- xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN void * XMLCALL
- xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
+xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
XMLPUBFUN void * XMLCALL
- xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
+xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XMLPUBFUN char * XMLCALL
- xmlMemStrdupLoc (const char *str, const char *file, int line);
+xmlMemStrdupLoc (const char *str, const char *file, int line);
#ifdef DEBUG_MEMORY_LOCATION
diff --git a/thirdparties/wince/include/libxml/xmlmodule.h b/thirdparties/wince/include/libxml/xmlmodule.h
index 8f4a560..ef4720c 100755
--- a/thirdparties/wince/include/libxml/xmlmodule.h
+++ b/thirdparties/wince/include/libxml/xmlmodule.h
@@ -38,11 +38,11 @@ typedef enum {
} xmlModuleOption;
XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename,
- int options);
+ int options);
XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module,
- const char* name,
- void **result);
+ const char* name,
+ void **result);
XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module);
@@ -50,7 +50,7 @@ XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module);
#ifdef __cplusplus
}
-#endif
+#endif
#endif /* LIBXML_MODULES_ENABLED */
diff --git a/thirdparties/wince/include/libxml/xmlreader.h b/thirdparties/wince/include/libxml/xmlreader.h
index 6964482..3226646 100755
--- a/thirdparties/wince/include/libxml/xmlreader.h
+++ b/thirdparties/wince/include/libxml/xmlreader.h
@@ -33,7 +33,8 @@ typedef enum {
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
XML_PARSER_SEVERITY_WARNING = 3,
XML_PARSER_SEVERITY_ERROR = 4
-} xmlParserSeverities;
+}
+xmlParserSeverities;
#ifdef LIBXML_READER_ENABLED
@@ -109,16 +110,16 @@ typedef xmlTextReader *xmlTextReaderPtr;
* Constructors & Destructor
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReader (xmlParserInputBufferPtr input,
- const char *URI);
+xmlNewTextReader (xmlParserInputBufferPtr input,
+ const char *URI);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlNewTextReaderFilename(const char *URI);
+xmlNewTextReaderFilename(const char *URI);
XMLPUBFUN void XMLCALL
- xmlFreeTextReader (xmlTextReaderPtr reader);
+xmlFreeTextReader (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetup(xmlTextReaderPtr reader,
+xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options);
@@ -126,258 +127,258 @@ XMLPUBFUN int XMLCALL
* Iterators
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderRead (xmlTextReaderPtr reader);
+xmlTextReaderRead (xmlTextReaderPtr reader);
#ifdef LIBXML_WRITER_ENABLED
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
+xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
+xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
#endif
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderReadString (xmlTextReaderPtr reader);
+xmlTextReaderReadString (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
+xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
/*
* Attributes of the node
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
+xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderDepth (xmlTextReaderPtr reader);
+xmlTextReaderDepth (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
+xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderHasValue(xmlTextReaderPtr reader);
+xmlTextReaderHasValue(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsDefault (xmlTextReaderPtr reader);
+xmlTextReaderIsDefault (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
+xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNodeType (xmlTextReaderPtr reader);
+xmlTextReaderNodeType (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
+xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderReadState (xmlTextReaderPtr reader);
+xmlTextReaderReadState (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
+xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
+xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstName (xmlTextReaderPtr reader);
+xmlTextReaderConstName (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
+xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstString (xmlTextReaderPtr reader,
- const xmlChar *str);
+xmlTextReaderConstString (xmlTextReaderPtr reader,
+ const xmlChar *str);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstValue (xmlTextReaderPtr reader);
+xmlTextReaderConstValue (xmlTextReaderPtr reader);
/*
* use the Const version of the routine for
* better performance and simpler code
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderBaseUri (xmlTextReaderPtr reader);
+xmlTextReaderBaseUri (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocalName (xmlTextReaderPtr reader);
+xmlTextReaderLocalName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderName (xmlTextReaderPtr reader);
+xmlTextReaderName (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
+xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderPrefix (xmlTextReaderPtr reader);
+xmlTextReaderPrefix (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderXmlLang (xmlTextReaderPtr reader);
+xmlTextReaderXmlLang (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderValue (xmlTextReaderPtr reader);
+xmlTextReaderValue (xmlTextReaderPtr reader);
/*
* Methods of the XmlTextReader
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderClose (xmlTextReaderPtr reader);
+xmlTextReaderClose (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
- int no);
+xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
- xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
+xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
- const xmlChar *prefix);
+xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
+ const xmlChar *prefix);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
- int no);
+xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
+ int no);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
- const xmlChar *name);
+xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
+ const xmlChar *name);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
- const xmlChar *localName,
- const xmlChar *namespaceURI);
+xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
+ const xmlChar *localName,
+ const xmlChar *namespaceURI);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
+xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
+xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNormalization (xmlTextReaderPtr reader);
+xmlTextReaderNormalization (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
+xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
/*
* Extensions
*/
XMLPUBFUN int XMLCALL
- xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
- int prop,
- int value);
+xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
+ int prop,
+ int value);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
- int prop);
+xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
+ int prop);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
+xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
+xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderPreserve (xmlTextReaderPtr reader);
+xmlTextReaderPreserve (xmlTextReaderPtr reader);
#ifdef LIBXML_PATTERN_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
- const xmlChar *pattern,
- const xmlChar **namespaces);
+xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
+ const xmlChar *pattern,
+ const xmlChar **namespaces);
#endif /* LIBXML_PATTERN_ENABLED */
XMLPUBFUN xmlDocPtr XMLCALL
- xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
+xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlTextReaderExpand (xmlTextReaderPtr reader);
+xmlTextReaderExpand (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNext (xmlTextReaderPtr reader);
+xmlTextReaderNext (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderNextSibling (xmlTextReaderPtr reader);
+xmlTextReaderNextSibling (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderIsValid (xmlTextReaderPtr reader);
+xmlTextReaderIsValid (xmlTextReaderPtr reader);
#ifdef LIBXML_SCHEMAS_ENABLED
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
- const char *rng);
+xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
+ const char *rng);
XMLPUBFUN int XMLCALL
- xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
- xmlRelaxNGPtr schema);
+xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
+ xmlRelaxNGPtr schema);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
- const char *xsd);
+xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
+ const char *xsd);
XMLPUBFUN int XMLCALL
- xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
- xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
+ xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlTextReaderSetSchema (xmlTextReaderPtr reader,
- xmlSchemaPtr schema);
+xmlTextReaderSetSchema (xmlTextReaderPtr reader,
+ xmlSchemaPtr schema);
#endif
XMLPUBFUN const xmlChar * XMLCALL
- xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
+xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
- xmlTextReaderStandalone (xmlTextReaderPtr reader);
+xmlTextReaderStandalone (xmlTextReaderPtr reader);
/*
* Index lookup
*/
XMLPUBFUN long XMLCALL
- xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
+xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
/*
* New more complete APIs for simpler creation and reuse of readers
*/
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderWalker (xmlDocPtr doc);
+xmlReaderWalker (xmlDocPtr doc);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForDoc (const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForDoc (const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFile (const char *filename,
- const char *encoding,
- int options);
+xmlReaderForFile (const char *filename,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForMemory (const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForMemory (const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForFd (int fd,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForFd (int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
XMLPUBFUN xmlTextReaderPtr XMLCALL
- xmlReaderForIO (xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
-
-XMLPUBFUN int XMLCALL
- xmlReaderNewWalker (xmlTextReaderPtr reader,
- xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
- xmlReaderNewDoc (xmlTextReaderPtr reader,
- const xmlChar * cur,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFile (xmlTextReaderPtr reader,
- const char *filename,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewMemory (xmlTextReaderPtr reader,
- const char *buffer,
- int size,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewFd (xmlTextReaderPtr reader,
- int fd,
- const char *URL,
- const char *encoding,
- int options);
-XMLPUBFUN int XMLCALL
- xmlReaderNewIO (xmlTextReaderPtr reader,
- xmlInputReadCallback ioread,
- xmlInputCloseCallback ioclose,
- void *ioctx,
- const char *URL,
- const char *encoding,
- int options);
+xmlReaderForIO (xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
+
+XMLPUBFUN int XMLCALL
+xmlReaderNewWalker (xmlTextReaderPtr reader,
+ xmlDocPtr doc);
+XMLPUBFUN int XMLCALL
+xmlReaderNewDoc (xmlTextReaderPtr reader,
+ const xmlChar * cur,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFile (xmlTextReaderPtr reader,
+ const char *filename,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewMemory (xmlTextReaderPtr reader,
+ const char *buffer,
+ int size,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewFd (xmlTextReaderPtr reader,
+ int fd,
+ const char *URL,
+ const char *encoding,
+ int options);
+XMLPUBFUN int XMLCALL
+xmlReaderNewIO (xmlTextReaderPtr reader,
+ xmlInputReadCallback ioread,
+ xmlInputCloseCallback ioclose,
+ void *ioctx,
+ const char *URL,
+ const char *encoding,
+ int options);
/*
* Error handling extensions
*/
@@ -393,26 +394,26 @@ typedef void * xmlTextReaderLocatorPtr;
* Signature of an error callback from a reader parser
*/
typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
- const char *msg,
- xmlParserSeverities severity,
- xmlTextReaderLocatorPtr locator);
+ const char *msg,
+ xmlParserSeverities severity,
+ xmlTextReaderLocatorPtr locator);
XMLPUBFUN int XMLCALL
- xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
XMLPUBFUN xmlChar * XMLCALL
- xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
+xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc f,
- void *arg);
+xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
- xmlStructuredErrorFunc f,
- void *arg);
+xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
+ xmlStructuredErrorFunc f,
+ void *arg);
XMLPUBFUN void XMLCALL
- xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc *f,
- void **arg);
+xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc *f,
+ void **arg);
#endif /* LIBXML_READER_ENABLED */
diff --git a/thirdparties/wince/include/libxml/xmlregexp.h b/thirdparties/wince/include/libxml/xmlregexp.h
index 7009645..f81664d 100755
--- a/thirdparties/wince/include/libxml/xmlregexp.h
+++ b/thirdparties/wince/include/libxml/xmlregexp.h
@@ -49,16 +49,16 @@ extern "C" {
* The POSIX like API
*/
XMLPUBFUN xmlRegexpPtr XMLCALL
- xmlRegexpCompile (const xmlChar *regexp);
+xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpExec (xmlRegexpPtr comp,
- const xmlChar *value);
+xmlRegexpExec (xmlRegexpPtr comp,
+ const xmlChar *value);
XMLPUBFUN void XMLCALL
- xmlRegexpPrint (FILE *output,
- xmlRegexpPtr regexp);
+xmlRegexpPrint (FILE *output,
+ xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
- xmlRegexpIsDeterminist(xmlRegexpPtr comp);
+xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:
@@ -70,42 +70,42 @@ XMLPUBFUN int XMLCALL
* Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
- const xmlChar *token,
- void *transdata,
- void *inputdata);
+ const xmlChar *token,
+ void *transdata,
+ void *inputdata);
/*
* The progressive API
*/
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
- xmlRegNewExecCtxt (xmlRegexpPtr comp,
- xmlRegExecCallbacks callback,
- void *data);
+xmlRegNewExecCtxt (xmlRegexpPtr comp,
+ xmlRegExecCallbacks callback,
+ void *data);
XMLPUBFUN void XMLCALL
- xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
+xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- void *data);
+xmlRegExecPushString(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
- const xmlChar *value,
- const xmlChar *value2,
- void *data);
+xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
+ const xmlChar *value,
+ const xmlChar *value2,
+ void *data);
XMLPUBFUN int XMLCALL
- xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
XMLPUBFUN int XMLCALL
- xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
- const xmlChar **string,
- int *nbval,
- int *nbneg,
- xmlChar **values,
- int *terminal);
+xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
+ const xmlChar **string,
+ int *nbval,
+ int *nbneg,
+ xmlChar **values,
+ int *terminal);
#ifdef LIBXML_EXPR_ENABLED
/*
* Formal regular expression handling
@@ -117,15 +117,15 @@ typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
XMLPUBFUN void XMLCALL
- xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
+xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
XMLPUBFUN xmlExpCtxtPtr XMLCALL
- xmlExpNewCtxt (int maxNodes,
- xmlDictPtr dict);
+xmlExpNewCtxt (int maxNodes,
+ xmlDictPtr dict);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
+xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/* Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
@@ -151,67 +151,67 @@ XMLPUBVAR xmlExpNodePtr emptyExp;
* Expressions are reference counted internally
*/
XMLPUBFUN void XMLCALL
- xmlExpFree (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr);
+xmlExpFree (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr);
XMLPUBFUN void XMLCALL
- xmlExpRef (xmlExpNodePtr expr);
+xmlExpRef (xmlExpNodePtr expr);
/*
* constructors can be either manual or from a string
*/
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpParse (xmlExpCtxtPtr ctxt,
- const char *expr);
+xmlExpParse (xmlExpCtxtPtr ctxt,
+ const char *expr);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewAtom (xmlExpCtxtPtr ctxt,
- const xmlChar *name,
- int len);
+xmlExpNewAtom (xmlExpCtxtPtr ctxt,
+ const xmlChar *name,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewOr (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewOr (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewSeq (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr left,
- xmlExpNodePtr right);
+xmlExpNewSeq (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr left,
+ xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpNewRange (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr subset,
- int min,
- int max);
+xmlExpNewRange (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr subset,
+ int min,
+ int max);
/*
* The really interesting APIs
*/
XMLPUBFUN int XMLCALL
- xmlExpIsNillable(xmlExpNodePtr expr);
+xmlExpIsNillable(xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpMaxToken (xmlExpNodePtr expr);
+xmlExpMaxToken (xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
- xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**langList,
- int len);
+xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**langList,
+ int len);
XMLPUBFUN int XMLCALL
- xmlExpGetStart (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar**tokList,
- int len);
+xmlExpGetStart (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar**tokList,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpStringDerive(xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- const xmlChar *str,
- int len);
+xmlExpStringDerive(xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ const xmlChar *str,
+ int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
- xmlExpExpDerive (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpExpDerive (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN int XMLCALL
- xmlExpSubsume (xmlExpCtxtPtr ctxt,
- xmlExpNodePtr expr,
- xmlExpNodePtr sub);
+xmlExpSubsume (xmlExpCtxtPtr ctxt,
+ xmlExpNodePtr expr,
+ xmlExpNodePtr sub);
XMLPUBFUN void XMLCALL
- xmlExpDump (xmlBufferPtr buf,
- xmlExpNodePtr expr);
+xmlExpDump (xmlBufferPtr buf,
+ xmlExpNodePtr expr);
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xmlschemas.h b/thirdparties/wince/include/libxml/xmlschemas.h
index 752bc3a..9d86c67 100755
--- a/thirdparties/wince/include/libxml/xmlschemas.h
+++ b/thirdparties/wince/include/libxml/xmlschemas.h
@@ -27,32 +27,33 @@ extern "C" {
*/
typedef enum {
XML_SCHEMAS_ERR_OK = 0,
- XML_SCHEMAS_ERR_NOROOT = 1,
- XML_SCHEMAS_ERR_UNDECLAREDELEM,
- XML_SCHEMAS_ERR_NOTTOPLEVEL,
- XML_SCHEMAS_ERR_MISSING,
- XML_SCHEMAS_ERR_WRONGELEM,
- XML_SCHEMAS_ERR_NOTYPE,
- XML_SCHEMAS_ERR_NOROLLBACK,
- XML_SCHEMAS_ERR_ISABSTRACT,
- XML_SCHEMAS_ERR_NOTEMPTY,
- XML_SCHEMAS_ERR_ELEMCONT,
- XML_SCHEMAS_ERR_HAVEDEFAULT,
- XML_SCHEMAS_ERR_NOTNILLABLE,
- XML_SCHEMAS_ERR_EXTRACONTENT,
- XML_SCHEMAS_ERR_INVALIDATTR,
- XML_SCHEMAS_ERR_INVALIDELEM,
- XML_SCHEMAS_ERR_NOTDETERMINIST,
- XML_SCHEMAS_ERR_CONSTRUCT,
- XML_SCHEMAS_ERR_INTERNAL,
- XML_SCHEMAS_ERR_NOTSIMPLE,
- XML_SCHEMAS_ERR_ATTRUNKNOWN,
- XML_SCHEMAS_ERR_ATTRINVALID,
- XML_SCHEMAS_ERR_VALUE,
- XML_SCHEMAS_ERR_FACET,
- XML_SCHEMAS_ERR_,
- XML_SCHEMAS_ERR_XXX
-} xmlSchemaValidError;
+ XML_SCHEMAS_ERR_NOROOT = 1,
+ XML_SCHEMAS_ERR_UNDECLAREDELEM,
+ XML_SCHEMAS_ERR_NOTTOPLEVEL,
+ XML_SCHEMAS_ERR_MISSING,
+ XML_SCHEMAS_ERR_WRONGELEM,
+ XML_SCHEMAS_ERR_NOTYPE,
+ XML_SCHEMAS_ERR_NOROLLBACK,
+ XML_SCHEMAS_ERR_ISABSTRACT,
+ XML_SCHEMAS_ERR_NOTEMPTY,
+ XML_SCHEMAS_ERR_ELEMCONT,
+ XML_SCHEMAS_ERR_HAVEDEFAULT,
+ XML_SCHEMAS_ERR_NOTNILLABLE,
+ XML_SCHEMAS_ERR_EXTRACONTENT,
+ XML_SCHEMAS_ERR_INVALIDATTR,
+ XML_SCHEMAS_ERR_INVALIDELEM,
+ XML_SCHEMAS_ERR_NOTDETERMINIST,
+ XML_SCHEMAS_ERR_CONSTRUCT,
+ XML_SCHEMAS_ERR_INTERNAL,
+ XML_SCHEMAS_ERR_NOTSIMPLE,
+ XML_SCHEMAS_ERR_ATTRUNKNOWN,
+ XML_SCHEMAS_ERR_ATTRINVALID,
+ XML_SCHEMAS_ERR_VALUE,
+ XML_SCHEMAS_ERR_FACET,
+ XML_SCHEMAS_ERR_,
+ XML_SCHEMAS_ERR_XXX
+}
+xmlSchemaValidError;
/*
* ATTENTION: Change xmlSchemaSetValidOptions's check
@@ -66,9 +67,9 @@ typedef enum {
*/
typedef enum {
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
- /* Default/fixed: create an attribute node
- * or an element's text node on the instance.
- */
+ /* Default/fixed: create an attribute node
+ * or an element's text node on the instance.
+ */
} xmlSchemaValidOption;
/*
@@ -117,86 +118,86 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
* Interfaces for parsing.
*/
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewParserCtxt (const char *URL);
+xmlSchemaNewParserCtxt (const char *URL);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewMemParserCtxt (const char *buffer,
- int size);
+xmlSchemaNewMemParserCtxt (const char *buffer,
+ int size);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
- xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
+xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc * err,
- xmlSchemaValidityWarningFunc * warn,
- void **ctx);
+xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc * err,
+ xmlSchemaValidityWarningFunc * warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaPtr XMLCALL
- xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
+xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
- xmlSchemaFree (xmlSchemaPtr schema);
+xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
- xmlSchemaDump (FILE *output,
- xmlSchemaPtr schema);
+xmlSchemaDump (FILE *output,
+ xmlSchemaPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc err,
- xmlSchemaValidityWarningFunc warn,
- void *ctx);
+xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc err,
+ xmlSchemaValidityWarningFunc warn,
+ void *ctx);
XMLPUBFUN void XMLCALL
- xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
- xmlStructuredErrorFunc serror,
- void *ctx);
+xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
+ xmlStructuredErrorFunc serror,
+ void *ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
- xmlSchemaValidityErrorFunc *err,
- xmlSchemaValidityWarningFunc *warn,
- void **ctx);
+xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
+ xmlSchemaValidityErrorFunc *err,
+ xmlSchemaValidityWarningFunc *warn,
+ void **ctx);
XMLPUBFUN int XMLCALL
- xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
- int options);
+xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
+ int options);
XMLPUBFUN int XMLCALL
- xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
- xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
+xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
XMLPUBFUN void XMLCALL
- xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
- xmlDocPtr instance);
+xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
+ xmlDocPtr instance);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
- xmlNodePtr elem);
+xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
+ xmlNodePtr elem);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
- xmlParserInputBufferPtr input,
- xmlCharEncoding enc,
- xmlSAXHandlerPtr sax,
- void *user_data);
+xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
+ xmlParserInputBufferPtr input,
+ xmlCharEncoding enc,
+ xmlSAXHandlerPtr sax,
+ void *user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
- const char * filename,
- int options);
+xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
+ const char * filename,
+ int options);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
- xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
+xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
/*
* Interface to insert Schemas SAX validation in a SAX stream
@@ -205,11 +206,11 @@ typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
- xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
- xmlSAXHandlerPtr *sax,
- void **user_data);
+xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
+ xmlSAXHandlerPtr *sax,
+ void **user_data);
XMLPUBFUN int XMLCALL
- xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
+xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/xmlschemastypes.h b/thirdparties/wince/include/libxml/xmlschemastypes.h
index 9a3a7a1..4c94162 100755
--- a/thirdparties/wince/include/libxml/xmlschemastypes.h
+++ b/thirdparties/wince/include/libxml/xmlschemastypes.h
@@ -28,120 +28,121 @@ typedef enum {
XML_SCHEMA_WHITESPACE_PRESERVE = 1,
XML_SCHEMA_WHITESPACE_REPLACE = 2,
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
-} xmlSchemaWhitespaceValueType;
+}
+xmlSchemaWhitespaceValueType;
-XMLPUBFUN void XMLCALL
- xmlSchemaInitTypes (void);
-XMLPUBFUN void XMLCALL
- xmlSchemaCleanupTypes (void);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetPredefinedType (const xmlChar *name,
- const xmlChar *ns);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacet (xmlSchemaTypePtr base,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
- xmlSchemaWhitespaceValueType fws,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN void XMLCALL
- xmlSchemaFreeValue (xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaFacetPtr XMLCALL
- xmlSchemaNewFacet (void);
-XMLPUBFUN int XMLCALL
- xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
- xmlSchemaTypePtr typeDecl,
- xmlSchemaParserCtxtPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN void XMLCALL
- xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
- xmlSchemaCompareValues (xmlSchemaValPtr x,
- xmlSchemaValPtr y);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
- const xmlChar *value,
- unsigned long actualLen,
- unsigned long *expectedLen);
+XMLPUBFUN void XMLCALL
+xmlSchemaInitTypes (void);
+XMLPUBFUN void XMLCALL
+xmlSchemaCleanupTypes (void);
+XMLPUBFUN xmlSchemaTypePtr XMLCALL
+xmlSchemaGetPredefinedType (const xmlChar *name,
+ const xmlChar *ns);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacet (xmlSchemaTypePtr base,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
+ xmlSchemaWhitespaceValueType fws,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN void XMLCALL
+xmlSchemaFreeValue (xmlSchemaValPtr val);
+XMLPUBFUN xmlSchemaFacetPtr XMLCALL
+xmlSchemaNewFacet (void);
+XMLPUBFUN int XMLCALL
+xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
+ xmlSchemaTypePtr typeDecl,
+ xmlSchemaParserCtxtPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN void XMLCALL
+xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
+XMLPUBFUN int XMLCALL
+xmlSchemaCompareValues (xmlSchemaValPtr x,
+ xmlSchemaValPtr y);
XMLPUBFUN xmlSchemaTypePtr XMLCALL
- xmlSchemaGetBuiltInType (xmlSchemaValType type);
+xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
XMLPUBFUN int XMLCALL
- xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
- int facetType);
+xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ unsigned long actualLen,
+ unsigned long *expectedLen);
+XMLPUBFUN xmlSchemaTypePtr XMLCALL
+xmlSchemaGetBuiltInType (xmlSchemaValType type);
+XMLPUBFUN int XMLCALL
+xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
+ int facetType);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaCollapseString (const xmlChar *value);
+xmlSchemaCollapseString (const xmlChar *value);
XMLPUBFUN xmlChar * XMLCALL
- xmlSchemaWhiteSpaceReplace (const xmlChar *value);
+xmlSchemaWhiteSpaceReplace (const xmlChar *value);
XMLPUBFUN unsigned long XMLCALL
- xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
- xmlSchemaFacetPtr facet,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length);
-XMLPUBFUN int XMLCALL
- xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
- xmlSchemaValType valType,
- const xmlChar *value,
- xmlSchemaValPtr val,
- unsigned long *length,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
- const xmlChar *value,
- xmlSchemaValPtr *val,
- xmlNodePtr node);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValue (xmlSchemaValPtr val,
- const xmlChar **retValue);
-XMLPUBFUN int XMLCALL
- xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
- const xmlChar **retValue,
- xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
- xmlSchemaValueAppend (xmlSchemaValPtr prev,
- xmlSchemaValPtr cur);
+xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
+ xmlSchemaFacetPtr facet,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length);
+XMLPUBFUN int XMLCALL
+xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
+ xmlSchemaValType valType,
+ const xmlChar *value,
+ xmlSchemaValPtr val,
+ unsigned long *length,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
+ const xmlChar *value,
+ xmlSchemaValPtr *val,
+ xmlNodePtr node);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValue (xmlSchemaValPtr val,
+ const xmlChar **retValue);
+XMLPUBFUN int XMLCALL
+xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
+ const xmlChar **retValue,
+ xmlSchemaWhitespaceValueType ws);
+XMLPUBFUN int XMLCALL
+xmlSchemaValueAppend (xmlSchemaValPtr prev,
+ xmlSchemaValPtr cur);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaValueGetNext (xmlSchemaValPtr cur);
+xmlSchemaValueGetNext (xmlSchemaValPtr cur);
XMLPUBFUN const xmlChar * XMLCALL
- xmlSchemaValueGetAsString (xmlSchemaValPtr val);
+xmlSchemaValueGetAsString (xmlSchemaValPtr val);
XMLPUBFUN int XMLCALL
- xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
+xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewStringValue (xmlSchemaValType type,
- const xmlChar *value);
+xmlSchemaNewStringValue (xmlSchemaValType type,
+ const xmlChar *value);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewNOTATIONValue (const xmlChar *name,
- const xmlChar *ns);
+xmlSchemaNewNOTATIONValue (const xmlChar *name,
+ const xmlChar *ns);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaNewQNameValue (const xmlChar *namespaceName,
- const xmlChar *localName);
+xmlSchemaNewQNameValue (const xmlChar *namespaceName,
+ const xmlChar *localName);
XMLPUBFUN int XMLCALL
- xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
- xmlSchemaWhitespaceValueType xws,
- xmlSchemaValPtr y,
- xmlSchemaWhitespaceValueType yws);
+xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
+ xmlSchemaWhitespaceValueType xws,
+ xmlSchemaValPtr y,
+ xmlSchemaWhitespaceValueType yws);
XMLPUBFUN xmlSchemaValPtr XMLCALL
- xmlSchemaCopyValue (xmlSchemaValPtr val);
+xmlSchemaCopyValue (xmlSchemaValPtr val);
XMLPUBFUN xmlSchemaValType XMLCALL
- xmlSchemaGetValType (xmlSchemaValPtr val);
+xmlSchemaGetValType (xmlSchemaValPtr val);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xmlstring.h b/thirdparties/wince/include/libxml/xmlstring.h
index 0bc6888..60508f9 100755
--- a/thirdparties/wince/include/libxml/xmlstring.h
+++ b/thirdparties/wince/include/libxml/xmlstring.h
@@ -38,101 +38,101 @@ typedef unsigned char xmlChar;
* xmlChar handling
*/
XMLPUBFUN xmlChar * XMLCALL
- xmlStrdup (const xmlChar *cur);
+xmlStrdup (const xmlChar *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrndup (const xmlChar *cur,
- int len);
+xmlStrndup (const xmlChar *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrndup (const char *cur,
- int len);
+xmlCharStrndup (const char *cur,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlCharStrdup (const char *cur);
+xmlCharStrdup (const char *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrsub (const xmlChar *str,
- int start,
- int len);
+xmlStrsub (const xmlChar *str,
+ int start,
+ int len);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrchr (const xmlChar *str,
- xmlChar val);
+xmlStrchr (const xmlChar *str,
+ xmlChar val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrstr (const xmlChar *str,
- const xmlChar *val);
+xmlStrstr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN const xmlChar * XMLCALL
- xmlStrcasestr (const xmlChar *str,
- const xmlChar *val);
+xmlStrcasestr (const xmlChar *str,
+ const xmlChar *val);
XMLPUBFUN int XMLCALL
- xmlStrcmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrcasecmp (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrcasecmp (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrncasecmp (const xmlChar *str1,
- const xmlChar *str2,
- int len);
+xmlStrncasecmp (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
XMLPUBFUN int XMLCALL
- xmlStrEqual (const xmlChar *str1,
- const xmlChar *str2);
+xmlStrEqual (const xmlChar *str1,
+ const xmlChar *str2);
XMLPUBFUN int XMLCALL
- xmlStrQEqual (const xmlChar *pref,
- const xmlChar *name,
- const xmlChar *str);
+xmlStrQEqual (const xmlChar *pref,
+ const xmlChar *name,
+ const xmlChar *str);
XMLPUBFUN int XMLCALL
- xmlStrlen (const xmlChar *str);
+xmlStrlen (const xmlChar *str);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrcat (xmlChar *cur,
- const xmlChar *add);
+xmlStrcat (xmlChar *cur,
+ const xmlChar *add);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncat (xmlChar *cur,
- const xmlChar *add,
- int len);
+xmlStrncat (xmlChar *cur,
+ const xmlChar *add,
+ int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlStrncatNew (const xmlChar *str1,
- const xmlChar *str2,
- int len);
-XMLPUBFUN int XMLCALL
- xmlStrPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- ...);
-XMLPUBFUN int XMLCALL
- xmlStrVPrintf (xmlChar *buf,
- int len,
- const xmlChar *msg,
- va_list ap);
+xmlStrncatNew (const xmlChar *str1,
+ const xmlChar *str2,
+ int len);
+XMLPUBFUN int XMLCALL
+xmlStrPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ ...);
+XMLPUBFUN int XMLCALL
+xmlStrVPrintf (xmlChar *buf,
+ int len,
+ const xmlChar *msg,
+ va_list ap);
XMLPUBFUN int XMLCALL
- xmlGetUTF8Char (const unsigned char *utf,
- int *len);
+xmlGetUTF8Char (const unsigned char *utf,
+ int *len);
XMLPUBFUN int XMLCALL
- xmlCheckUTF8 (const unsigned char *utf);
+xmlCheckUTF8 (const unsigned char *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Strsize (const xmlChar *utf,
- int len);
-XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strndup (const xmlChar *utf,
- int len);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlUTF8Strpos (const xmlChar *utf,
- int pos);
+xmlUTF8Strsize (const xmlChar *utf,
+ int len);
+XMLPUBFUN xmlChar * XMLCALL
+xmlUTF8Strndup (const xmlChar *utf,
+ int len);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlUTF8Strpos (const xmlChar *utf,
+ int pos);
XMLPUBFUN int XMLCALL
- xmlUTF8Strloc (const xmlChar *utf,
- const xmlChar *utfchar);
-XMLPUBFUN xmlChar * XMLCALL
- xmlUTF8Strsub (const xmlChar *utf,
- int start,
- int len);
+xmlUTF8Strloc (const xmlChar *utf,
+ const xmlChar *utfchar);
+XMLPUBFUN xmlChar * XMLCALL
+xmlUTF8Strsub (const xmlChar *utf,
+ int start,
+ int len);
XMLPUBFUN int XMLCALL
- xmlUTF8Strlen (const xmlChar *utf);
+xmlUTF8Strlen (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Size (const xmlChar *utf);
+xmlUTF8Size (const xmlChar *utf);
XMLPUBFUN int XMLCALL
- xmlUTF8Charcmp (const xmlChar *utf1,
- const xmlChar *utf2);
+xmlUTF8Charcmp (const xmlChar *utf1,
+ const xmlChar *utf2);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xmlversion.h b/thirdparties/wince/include/libxml/xmlversion.h
index 46d443b..1765a45 100755
--- a/thirdparties/wince/include/libxml/xmlversion.h
+++ b/thirdparties/wince/include/libxml/xmlversion.h
@@ -370,7 +370,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the string suffix used by dynamic modules (usually shared libraries)
*/
-#define LIBXML_MODULE_EXTENSION ""
+#define LIBXML_MODULE_EXTENSION ""
#endif
/**
diff --git a/thirdparties/wince/include/libxml/xmlwriter.h b/thirdparties/wince/include/libxml/xmlwriter.h
index 91e683c..5785c84 100755
--- a/thirdparties/wince/include/libxml/xmlwriter.h
+++ b/thirdparties/wince/include/libxml/xmlwriter.h
@@ -24,26 +24,26 @@
extern "C" {
#endif
- typedef struct _xmlTextWriter xmlTextWriter;
- typedef xmlTextWriter *xmlTextWriterPtr;
+typedef struct _xmlTextWriter xmlTextWriter;
+typedef xmlTextWriter *xmlTextWriterPtr;
/*
* Constructors & Destructor
*/
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriter(xmlOutputBufferPtr out);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterFilename(const char *uri, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
- XMLPUBFUN xmlTextWriterPtr XMLCALL
- xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
- int compression);
- XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriter(xmlOutputBufferPtr out);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterFilename(const char *uri, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
+XMLPUBFUN xmlTextWriterPtr XMLCALL
+xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
+ int compression);
+XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
/*
* Functions
@@ -53,220 +53,220 @@ extern "C" {
/*
* Document
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDocument(xmlTextWriterPtr writer,
- const char *version,
- const char *encoding,
- const char *standalone);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDocument(xmlTextWriterPtr writer,
+ const char *version,
+ const char *encoding,
+ const char *standalone);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
+ writer);
/*
* Comments
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
- writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
- writer,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
+ writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ content);
/*
* Elements
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
+ writer);
/*
* Elements conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar * name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar * name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* Text
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
- const xmlChar * content, int len);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
- writer,
- const char
- *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
- writer,
- const char
- *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
- const char *data,
- int start, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
+ const xmlChar * content, int len);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
+ writer,
+ const char
+ *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
+ const char *data,
+ int start, int len);
/*
* Attributes
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI);
- XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI);
+XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
+ writer);
/*
* Attributes conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
- writer,
- const xmlChar * name,
- const xmlChar *
- content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
- const xmlChar * prefix,
- const xmlChar * name,
- const xmlChar * namespaceURI,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
- writer,
- const xmlChar *
- prefix,
- const xmlChar *
- name,
- const xmlChar *
- namespaceURI,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
+ writer,
+ const xmlChar * name,
+ const xmlChar *
+ content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
+ const xmlChar * prefix,
+ const xmlChar * name,
+ const xmlChar * namespaceURI,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ prefix,
+ const xmlChar *
+ name,
+ const xmlChar *
+ namespaceURI,
+ const xmlChar *
+ content);
/*
* PI's
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartPI(xmlTextWriterPtr writer,
- const xmlChar * target);
- XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartPI(xmlTextWriterPtr writer,
+ const xmlChar * target);
+XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
/*
* PI conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWritePI(xmlTextWriterPtr writer,
- const xmlChar * target,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWritePI(xmlTextWriterPtr writer,
+ const xmlChar * target,
+ const xmlChar * content);
/**
* xmlTextWriterWriteProcessingInstruction:
@@ -278,57 +278,57 @@ extern "C" {
/*
* CDATA
*/
- XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
- XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
/*
* CDATA conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(2,3);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(2,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
- const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(2,3);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(2,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
+ const xmlChar * content);
/*
* DTD
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
/*
* DTD conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(5,6);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const char *format, va_list argptr)
- LIBXML_ATTR_FORMAT(5,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * subset);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(5,6);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const char *format, va_list argptr)
+LIBXML_ATTR_FORMAT(5,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * subset);
/**
* xmlTextWriterWriteDocType:
@@ -340,141 +340,141 @@ extern "C" {
/*
* DTD element definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
+ writer);
/*
* DTD element definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD attribute list definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
+ writer);
/*
* DTD attribute list definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(3,4);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(3,0);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
- writer,
- const xmlChar *
- name,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(3,4);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(3,0);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
+ writer,
+ const xmlChar *
+ name,
+ const xmlChar *
+ content);
/*
* DTD entity definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
- int pe, const xmlChar * name);
- XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
- writer);
+XMLPUBFUN int XMLCALL
+xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
+ int pe, const xmlChar * name);
+XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
+ writer);
/*
* DTD entity definition conveniency functions
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format, ...)
- LIBXML_ATTR_FORMAT(4,5);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const char *format,
- va_list argptr)
- LIBXML_ATTR_FORMAT(4,0);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * content);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
- int pe,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar * ndataid);
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
- writer,
- const xmlChar * pubid,
- const xmlChar * sysid,
- const xmlChar *
- ndataid);
- XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
- writer, int pe,
- const xmlChar * name,
- const xmlChar *
- pubid,
- const xmlChar *
- sysid,
- const xmlChar *
- ndataid,
- const xmlChar *
- content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format, ...)
+LIBXML_ATTR_FORMAT(4,5);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const char *format,
+ va_list argptr)
+LIBXML_ATTR_FORMAT(4,0);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * content);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
+ int pe,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar * ndataid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
+ writer,
+ const xmlChar * pubid,
+ const xmlChar * sysid,
+ const xmlChar *
+ ndataid);
+XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
+ writer, int pe,
+ const xmlChar * name,
+ const xmlChar *
+ pubid,
+ const xmlChar *
+ sysid,
+ const xmlChar *
+ ndataid,
+ const xmlChar *
+ content);
/*
* DTD notation definition
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
- const xmlChar * name,
- const xmlChar * pubid,
- const xmlChar * sysid);
+XMLPUBFUN int XMLCALL
+xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
+ const xmlChar * name,
+ const xmlChar * pubid,
+ const xmlChar * sysid);
/*
* Indentation
*/
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
- XMLPUBFUN int XMLCALL
- xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
- const xmlChar * str);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
+XMLPUBFUN int XMLCALL
+xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
+ const xmlChar * str);
/*
* misc
*/
- XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
+XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xpath.h b/thirdparties/wince/include/libxml/xpath.h
index 1a9e30e..a728f00 100755
--- a/thirdparties/wince/include/libxml/xpath.h
+++ b/thirdparties/wince/include/libxml/xpath.h
@@ -33,7 +33,7 @@
extern "C" {
#endif
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
-
+
#ifdef LIBXML_XPATH_ENABLED
typedef struct _xmlXPathContext xmlXPathContext;
@@ -164,7 +164,7 @@ struct _xmlXPathVariable {
*/
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
- int nargs);
+ int nargs);
/*
* Extra function: a name and a evaluation function.
@@ -190,7 +190,7 @@ struct _xmlXPathFunct {
*/
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr cur);
+ xmlXPathObjectPtr cur);
/*
* Extra axis: a name and an axis function.
@@ -231,8 +231,8 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
* Returns the XPath object value or NULL if not found.
*/
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFuncLookupFunc:
@@ -246,8 +246,8 @@ typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
* Returns the XPath function or NULL if not found.
*/
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
+ const xmlChar *name,
+ const xmlChar *ns_uri);
/**
* xmlXPathFlags:
@@ -271,11 +271,11 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
*
* Expression evaluation occurs with respect to a context.
* he context consists of:
- * - a node (the context node)
- * - a node list (the context node list)
- * - a set of variable bindings
- * - a function library
- * - the set of namespace declarations in scope for the expression
+ * - a node (the context node)
+ * - a node list (the context node list)
+ * - a set of variable bindings
+ * - a function library
+ * - the set of namespace declarations in scope for the expression
* Following the switch to hash tables, this need to be trimmed up at
* the next binary incompatible release.
* The node may be modified when the context is passed to libxml2
@@ -433,110 +433,110 @@ XMLPUBVAR double xmlXPathNINF;
(((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))
-XMLPUBFUN void XMLCALL
- xmlXPathFreeObject (xmlXPathObjectPtr obj);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetCreate (xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathObjectCopy (xmlXPathObjectPtr val);
-XMLPUBFUN int XMLCALL
- xmlXPathCmpNodes (xmlNodePtr node1,
- xmlNodePtr node2);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeObject (xmlXPathObjectPtr obj);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeSetCreate (xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathObjectCopy (xmlXPathObjectPtr val);
+XMLPUBFUN int XMLCALL
+xmlXPathCmpNodes (xmlNodePtr node1,
+ xmlNodePtr node2);
/**
* Conversion functions to basic types.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathCastNumberToBoolean (double val);
-XMLPUBFUN int XMLCALL
- xmlXPathCastStringToBoolean (const xmlChar * val);
-XMLPUBFUN int XMLCALL
- xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
-XMLPUBFUN int XMLCALL
- xmlXPathCastToBoolean (xmlXPathObjectPtr val);
-
-XMLPUBFUN double XMLCALL
- xmlXPathCastBooleanToNumber (int val);
-XMLPUBFUN double XMLCALL
- xmlXPathCastStringToNumber (const xmlChar * val);
-XMLPUBFUN double XMLCALL
- xmlXPathCastNodeToNumber (xmlNodePtr node);
-XMLPUBFUN double XMLCALL
- xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
-XMLPUBFUN double XMLCALL
- xmlXPathCastToNumber (xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastBooleanToString (int val);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNumberToString (double val);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeToString (xmlNodePtr node);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathCastToString (xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertBoolean (xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertNumber (xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathConvertString (xmlXPathObjectPtr val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastNumberToBoolean (double val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastStringToBoolean (const xmlChar * val);
+XMLPUBFUN int XMLCALL
+xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
+XMLPUBFUN int XMLCALL
+xmlXPathCastToBoolean (xmlXPathObjectPtr val);
+
+XMLPUBFUN double XMLCALL
+xmlXPathCastBooleanToNumber (int val);
+XMLPUBFUN double XMLCALL
+xmlXPathCastStringToNumber (const xmlChar * val);
+XMLPUBFUN double XMLCALL
+xmlXPathCastNodeToNumber (xmlNodePtr node);
+XMLPUBFUN double XMLCALL
+xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
+XMLPUBFUN double XMLCALL
+xmlXPathCastToNumber (xmlXPathObjectPtr val);
+
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastBooleanToString (int val);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNumberToString (double val);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNodeToString (xmlNodePtr node);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathCastToString (xmlXPathObjectPtr val);
+
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertBoolean (xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertNumber (xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathConvertString (xmlXPathObjectPtr val);
/**
* Context handling.
*/
-XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPathNewContext (xmlDocPtr doc);
+XMLPUBFUN xmlXPathContextPtr XMLCALL
+xmlXPathNewContext (xmlDocPtr doc);
XMLPUBFUN void XMLCALL
- xmlXPathFreeContext (xmlXPathContextPtr ctxt);
+xmlXPathFreeContext (xmlXPathContextPtr ctxt);
XMLPUBFUN int XMLCALL
- xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
- int active,
- int value,
- int options);
+xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
+ int active,
+ int value,
+ int options);
/**
* Evaluation functions.
*/
-XMLPUBFUN long XMLCALL
- xmlXPathOrderDocElems (xmlDocPtr doc);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathEvalExpression (const xmlChar *str,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN int XMLCALL
- xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
- xmlXPathObjectPtr res);
+XMLPUBFUN long XMLCALL
+xmlXPathOrderDocElems (xmlDocPtr doc);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathEvalExpression (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
+ xmlXPathObjectPtr res);
/**
* Separate compilation/evaluation entry points.
*/
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCompile (const xmlChar *str);
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL
- xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
- const xmlChar *str);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctx);
-XMLPUBFUN int XMLCALL
- xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
+XMLPUBFUN xmlXPathCompExprPtr XMLCALL
+xmlXPathCompile (const xmlChar *str);
+XMLPUBFUN xmlXPathCompExprPtr XMLCALL
+xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
+ const xmlChar *str);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN int XMLCALL
+xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
#endif /* LIBXML_XPATH_ENABLED */
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN void XMLCALL
- xmlXPathInit (void);
+XMLPUBFUN void XMLCALL
+xmlXPathInit (void);
XMLPUBFUN int XMLCALL
- xmlXPathIsNaN (double val);
+xmlXPathIsNaN (double val);
XMLPUBFUN int XMLCALL
- xmlXPathIsInf (double val);
+xmlXPathIsInf (double val);
#ifdef __cplusplus
}
diff --git a/thirdparties/wince/include/libxml/xpathInternals.h b/thirdparties/wince/include/libxml/xpathInternals.h
index dcd5243..6a17e2d 100755
--- a/thirdparties/wince/include/libxml/xpathInternals.h
+++ b/thirdparties/wince/include/libxml/xpathInternals.h
@@ -100,16 +100,16 @@ extern "C" {
*/
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
-XMLPUBFUN int XMLCALL
- xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN double XMLCALL
- xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathPopString (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void * XMLCALL
- xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN double XMLCALL
+xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathPopString (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN void * XMLCALL
+xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/**
* xmlXPathReturnBoolean:
@@ -329,222 +329,222 @@ XMLPUBFUN void * XMLCALL
* Variable Lookup forwarding.
*/
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
- xmlXPathVariableLookupFunc f,
- void *data);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
+ xmlXPathVariableLookupFunc f,
+ void *data);
/*
* Function Lookup forwarding.
*/
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
- xmlXPathFuncLookupFunc f,
- void *funcCtxt);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
+ xmlXPathFuncLookupFunc f,
+ void *funcCtxt);
/*
* Error reporting.
*/
-XMLPUBFUN void XMLCALL
- xmlXPatherror (xmlXPathParserContextPtr ctxt,
- const char *file,
- int line,
- int no);
+XMLPUBFUN void XMLCALL
+xmlXPatherror (xmlXPathParserContextPtr ctxt,
+ const char *file,
+ int line,
+ int no);
XMLPUBFUN void XMLCALL
- xmlXPathErr (xmlXPathParserContextPtr ctxt,
- int error);
+xmlXPathErr (xmlXPathParserContextPtr ctxt,
+ int error);
#ifdef LIBXML_DEBUG_ENABLED
-XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpObject (FILE *output,
- xmlXPathObjectPtr cur,
- int depth);
-XMLPUBFUN void XMLCALL
- xmlXPathDebugDumpCompExpr(FILE *output,
- xmlXPathCompExprPtr comp,
- int depth);
+XMLPUBFUN void XMLCALL
+xmlXPathDebugDumpObject (FILE *output,
+ xmlXPathObjectPtr cur,
+ int depth);
+XMLPUBFUN void XMLCALL
+xmlXPathDebugDumpCompExpr(FILE *output,
+ xmlXPathCompExprPtr comp,
+ int depth);
#endif
/**
* NodeSet handling.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathNodeSetContains (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDifference (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathIntersection (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathDistinct (xmlNodeSetPtr nodes);
-
-XMLPUBFUN int XMLCALL
- xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeLeading (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathLeading (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
- xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathTrailing (xmlNodeSetPtr nodes1,
- xmlNodeSetPtr nodes2);
+XMLPUBFUN int XMLCALL
+xmlXPathNodeSetContains (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDifference (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathIntersection (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathDistinct (xmlNodeSetPtr nodes);
+
+XMLPUBFUN int XMLCALL
+xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeLeading (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathLeading (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
+ xmlNodePtr node);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathTrailing (xmlNodeSetPtr nodes1,
+ xmlNodeSetPtr nodes2);
/**
* Extending a context.
*/
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
- const xmlChar *prefix,
- const xmlChar *ns_uri);
-XMLPUBFUN const xmlChar * XMLCALL
- xmlXPathNsLookup (xmlXPathContextPtr ctxt,
- const xmlChar *prefix);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
-
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathFunction f);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathFunction f);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- xmlXPathObjectPtr value);
-XMLPUBFUN int XMLCALL
- xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri,
- xmlXPathObjectPtr value);
-XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN xmlXPathFunction XMLCALL
- xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
- const xmlChar *name);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
- const xmlChar *name,
- const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix,
+ const xmlChar *ns_uri);
+XMLPUBFUN const xmlChar * XMLCALL
+xmlXPathNsLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *prefix);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
+
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathFunction f);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathFunction f);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ xmlXPathObjectPtr value);
+XMLPUBFUN int XMLCALL
+xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri,
+ xmlXPathObjectPtr value);
+XMLPUBFUN xmlXPathFunction XMLCALL
+xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN xmlXPathFunction XMLCALL
+xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
+ const xmlChar *name);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
+ const xmlChar *name,
+ const xmlChar *ns_uri);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
/**
* Utilities to extend XPath.
*/
XMLPUBFUN xmlXPathParserContextPtr XMLCALL
- xmlXPathNewParserContext (const xmlChar *str,
- xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
+xmlXPathNewParserContext (const xmlChar *str,
+ xmlXPathContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
/* TODO: remap to xmlXPathValuePop and Push. */
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- valuePop (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN int XMLCALL
- valuePush (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr value);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewString (const xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewCString (const char *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapString (xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapCString (char * val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewFloat (double val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewBoolean (int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSet (xmlNodePtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewValueTree (xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
- xmlNodePtr node,
- xmlNsPtr ns);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetSort (xmlNodeSetPtr set);
-
-XMLPUBFUN void XMLCALL
- xmlXPathRoot (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL
- xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseName (xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL
- xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+valuePop (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN int XMLCALL
+valuePush (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr value);
+
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewString (const xmlChar *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewCString (const char *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapString (xmlChar *val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapCString (char * val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewFloat (double val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewBoolean (int val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewNodeSet (xmlNodePtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewValueTree (xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
+ xmlNodePtr node,
+ xmlNsPtr ns);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetSort (xmlNodeSetPtr set);
+
+XMLPUBFUN void XMLCALL
+xmlXPathRoot (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN void XMLCALL
+xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathParseName (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlChar * XMLCALL
+xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
/*
* Existing functions.
*/
-XMLPUBFUN double XMLCALL
- xmlXPathStringEvalNumber (const xmlChar *str);
-XMLPUBFUN int XMLCALL
- xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
- xmlXPathObjectPtr res);
-XMLPUBFUN void XMLCALL
- xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL
- xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
- xmlNodeSetPtr val2);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetDel (xmlNodeSetPtr cur,
- xmlNodePtr val);
-XMLPUBFUN void XMLCALL
- xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
- int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathNewNodeSetList (xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapNodeSet (xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPathWrapExternal (void *val);
+XMLPUBFUN double XMLCALL
+xmlXPathStringEvalNumber (const xmlChar *str);
+XMLPUBFUN int XMLCALL
+xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
+ xmlXPathObjectPtr res);
+XMLPUBFUN void XMLCALL
+xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
+XMLPUBFUN xmlNodeSetPtr XMLCALL
+xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
+ xmlNodeSetPtr val2);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetDel (xmlNodeSetPtr cur,
+ xmlNodePtr val);
+XMLPUBFUN void XMLCALL
+xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
+ int val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathNewNodeSetList (xmlNodeSetPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapNodeSet (xmlNodeSetPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPathWrapExternal (void *val);
XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
@@ -562,31 +562,31 @@ XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
* Some of the axis navigation routines.
*/
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
- xmlNodePtr cur);
+ xmlNodePtr cur);
/*
* The official core of XPath functions.
*/
@@ -621,7 +621,7 @@ XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, in
* Really internal functions
*/
XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns);
-
+
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/libxml/xpointer.h b/thirdparties/wince/include/libxml/xpointer.h
index dde1dfb..7cb05e8 100755
--- a/thirdparties/wince/include/libxml/xpointer.h
+++ b/thirdparties/wince/include/libxml/xpointer.h
@@ -7,7 +7,7 @@
*
* Added support for the element() scheme described in:
* W3C Proposed Recommendation 13 November 2002
- * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
+ * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
*
* Copy: See Copyright for the status of this software.
*
@@ -43,69 +43,69 @@ struct _xmlLocationSet {
* Handling of location sets.
*/
-XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
-XMLPUBFUN xmlLocationSetPtr XMLCALL
- xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
- xmlLocationSetPtr val2);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRange (xmlNodePtr start,
- int startindex,
- xmlNodePtr end,
- int endindex);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodePoint (xmlNodePtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodes (xmlNodePtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodes (xmlNodePtr start,
- xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewRangeNodeObject (xmlNodePtr start,
- xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrNewCollapsedRange (xmlNodePtr start);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
- xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL
- xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
- int val);
+XMLPUBFUN xmlLocationSetPtr XMLCALL
+xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
+XMLPUBFUN xmlLocationSetPtr XMLCALL
+xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
+ xmlLocationSetPtr val2);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRange (xmlNodePtr start,
+ int startindex,
+ xmlNodePtr end,
+ int endindex);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodePoint (xmlNodePtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodes (xmlNodePtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewLocationSetNodes (xmlNodePtr start,
+ xmlNodePtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewRangeNodeObject (xmlNodePtr start,
+ xmlXPathObjectPtr end);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrNewCollapsedRange (xmlNodePtr start);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
+ xmlXPathObjectPtr val);
+XMLPUBFUN void XMLCALL
+xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
+ int val);
/*
* Functions.
*/
-XMLPUBFUN xmlXPathContextPtr XMLCALL
- xmlXPtrNewContext (xmlDocPtr doc,
- xmlNodePtr here,
- xmlNodePtr origin);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL
- xmlXPtrEval (const xmlChar *str,
- xmlXPathContextPtr ctx);
-XMLPUBFUN void XMLCALL
- xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
- int nargs);
-XMLPUBFUN xmlNodePtr XMLCALL
- xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL
- xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
+XMLPUBFUN xmlXPathContextPtr XMLCALL
+xmlXPtrNewContext (xmlDocPtr doc,
+ xmlNodePtr here,
+ xmlNodePtr origin);
+XMLPUBFUN xmlXPathObjectPtr XMLCALL
+xmlXPtrEval (const xmlChar *str,
+ xmlXPathContextPtr ctx);
+XMLPUBFUN void XMLCALL
+xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
+ int nargs);
+XMLPUBFUN xmlNodePtr XMLCALL
+xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
+XMLPUBFUN void XMLCALL
+xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/pthread/implement.h b/thirdparties/wince/include/pthread/implement.h
index 3d96483..8506db3 100755
--- a/thirdparties/wince/include/pthread/implement.h
+++ b/thirdparties/wince/include/pthread/implement.h
@@ -10,25 +10,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -98,78 +98,75 @@ typedef VOID (APIENTRY *PAPCFUNC)(DWORD dwParam);
#define int64_t _int64
#endif
-typedef enum
-{
- /*
- * This enumeration represents the state of the thread;
- * The thread is still "alive" if the numeric value of the
- * state is greater or equal "PThreadStateRunning".
- */
- PThreadStateInitial = 0, /* Thread not running */
- PThreadStateRunning, /* Thread alive & kicking */
- PThreadStateSuspended, /* Thread alive but suspended */
- PThreadStateCancelPending, /* Thread alive but is */
- /* has cancelation pending. */
- PThreadStateCanceling, /* Thread alive but is */
- /* in the process of terminating */
- /* due to a cancellation request */
- PThreadStateException, /* Thread alive but exiting */
- /* due to an exception */
- PThreadStateLast
+typedef enum {
+ /*
+ * This enumeration represents the state of the thread;
+ * The thread is still "alive" if the numeric value of the
+ * state is greater or equal "PThreadStateRunning".
+ */
+ PThreadStateInitial = 0, /* Thread not running */
+ PThreadStateRunning, /* Thread alive & kicking */
+ PThreadStateSuspended, /* Thread alive but suspended */
+ PThreadStateCancelPending, /* Thread alive but is */
+ /* has cancelation pending. */
+ PThreadStateCanceling, /* Thread alive but is */
+ /* in the process of terminating */
+ /* due to a cancellation request */
+ PThreadStateException, /* Thread alive but exiting */
+ /* due to an exception */
+ PThreadStateLast
}
PThreadState;
typedef struct ptw32_thread_t_ ptw32_thread_t;
-struct ptw32_thread_t_
-{
+struct ptw32_thread_t_ {
#ifdef _UWIN
- DWORD dummy[5];
+ DWORD dummy[5];
#endif
- DWORD thread;
- HANDLE threadH; /* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
- pthread_t ptHandle; /* This thread's permanent pthread_t handle */
- ptw32_thread_t * prevReuse; /* Links threads on reuse stack */
- volatile PThreadState state;
- void *exitStatus;
- void *parms;
- int ptErrno;
- int detachState;
- pthread_mutex_t threadLock; /* Used for serialised access to public thread state */
- int sched_priority; /* As set, not as currently is */
- pthread_mutex_t cancelLock; /* Used for async-cancel safety */
- int cancelState;
- int cancelType;
- HANDLE cancelEvent;
+ DWORD thread;
+ HANDLE threadH; /* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
+ pthread_t ptHandle; /* This thread's permanent pthread_t handle */
+ ptw32_thread_t * prevReuse; /* Links threads on reuse stack */
+ volatile PThreadState state;
+ void *exitStatus;
+ void *parms;
+ int ptErrno;
+ int detachState;
+ pthread_mutex_t threadLock; /* Used for serialised access to public thread state */
+ int sched_priority; /* As set, not as currently is */
+ pthread_mutex_t cancelLock; /* Used for async-cancel safety */
+ int cancelState;
+ int cancelType;
+ HANDLE cancelEvent;
#ifdef __CLEANUP_C
- jmp_buf start_mark;
+ jmp_buf start_mark;
#endif /* __CLEANUP_C */
#if HAVE_SIGSET_T
- sigset_t sigmask;
+ sigset_t sigmask;
#endif /* HAVE_SIGSET_T */
- int implicit:1;
- void *keys;
- void *nextAssoc;
+ int implicit:1;
+ void *keys;
+ void *nextAssoc;
};
-/*
+/*
* Special value to mark attribute objects as valid.
*/
#define PTW32_ATTR_VALID ((unsigned long) 0xC4C0FFEE)
-struct pthread_attr_t_
-{
- unsigned long valid;
- void *stackaddr;
- size_t stacksize;
- int detachstate;
- struct sched_param param;
- int inheritsched;
- int contentionscope;
+struct pthread_attr_t_ {
+ unsigned long valid;
+ void *stackaddr;
+ size_t stacksize;
+ int detachstate;
+ struct sched_param param;
+ int inheritsched;
+ int contentionscope;
#if HAVE_SIGSET_T
- sigset_t sigmask;
+ sigset_t sigmask;
#endif /* HAVE_SIGSET_T */
};
@@ -182,40 +179,37 @@ struct pthread_attr_t_
* ====================
*/
-struct sem_t_
-{
- int value;
- pthread_mutex_t lock;
- HANDLE sem;
+struct sem_t_ {
+ int value;
+ pthread_mutex_t lock;
+ HANDLE sem;
#ifdef NEED_SEM
- int leftToUnblock;
+ int leftToUnblock;
#endif
};
#define PTW32_OBJECT_AUTO_INIT ((void *) -1)
#define PTW32_OBJECT_INVALID NULL
-struct pthread_mutex_t_
-{
- LONG lock_idx; /* Provides exclusive access to mutex state
+struct pthread_mutex_t_ {
+ LONG lock_idx; /* Provides exclusive access to mutex state
via the Interlocked* mechanism.
0: unlocked/free.
1: locked - no other waiters.
-1: locked - with possible other waiters.
*/
- int recursive_count; /* Number of unlocks a thread needs to perform
+ int recursive_count; /* Number of unlocks a thread needs to perform
before the lock is released (recursive
mutexes only). */
- int kind; /* Mutex type. */
- pthread_t ownerThread;
- HANDLE event; /* Mutex release notification to waiting
+ int kind; /* Mutex type. */
+ pthread_t ownerThread;
+ HANDLE event; /* Mutex release notification to waiting
threads. */
};
-struct pthread_mutexattr_t_
-{
- int pshared;
- int kind;
+struct pthread_mutexattr_t_ {
+ int pshared;
+ int kind;
};
/*
@@ -239,101 +233,90 @@ struct pthread_mutexattr_t_
#define PTW32_SPIN_LOCKED (2)
#define PTW32_SPIN_USE_MUTEX (3)
-struct pthread_spinlock_t_
-{
- long interlock; /* Locking element for multi-cpus. */
- union
- {
- int cpus; /* No. of cpus if multi cpus, or */
- pthread_mutex_t mutex; /* mutex if single cpu. */
- } u;
+struct pthread_spinlock_t_ {
+ long interlock; /* Locking element for multi-cpus. */
+ union {
+ int cpus; /* No. of cpus if multi cpus, or */
+ pthread_mutex_t mutex; /* mutex if single cpu. */
+ } u;
};
-struct pthread_barrier_t_
-{
- unsigned int nCurrentBarrierHeight;
- unsigned int nInitialBarrierHeight;
- int iStep;
- int pshared;
- sem_t semBarrierBreeched[2];
+struct pthread_barrier_t_ {
+ unsigned int nCurrentBarrierHeight;
+ unsigned int nInitialBarrierHeight;
+ int iStep;
+ int pshared;
+ sem_t semBarrierBreeched[2];
};
-struct pthread_barrierattr_t_
-{
- int pshared;
+struct pthread_barrierattr_t_ {
+ int pshared;
};
-struct pthread_key_t_
-{
- DWORD key;
- void (*destructor) (void *);
- pthread_mutex_t keyLock;
- void *threads;
+struct pthread_key_t_ {
+ DWORD key;
+ void (*destructor) (void *);
+ pthread_mutex_t keyLock;
+ void *threads;
};
typedef struct ThreadParms ThreadParms;
typedef struct ThreadKeyAssoc ThreadKeyAssoc;
-struct ThreadParms
-{
- pthread_t tid;
- void *(*start) (void *);
- void *arg;
+struct ThreadParms {
+ pthread_t tid;
+ void *(*start) (void *);
+ void *arg;
};
-struct pthread_cond_t_
-{
- long nWaitersBlocked; /* Number of threads blocked */
- long nWaitersGone; /* Number of threads timed out */
- long nWaitersToUnblock; /* Number of threads to unblock */
- sem_t semBlockQueue; /* Queue up threads waiting for the */
- /* condition to become signalled */
- sem_t semBlockLock; /* Semaphore that guards access to */
- /* | waiters blocked count/block queue */
- /* +-> Mandatory Sync.LEVEL-1 */
- pthread_mutex_t mtxUnblockLock; /* Mutex that guards access to */
- /* | waiters (to)unblock(ed) counts */
- /* +-> Optional* Sync.LEVEL-2 */
- pthread_cond_t next; /* Doubly linked list */
- pthread_cond_t prev;
+struct pthread_cond_t_ {
+ long nWaitersBlocked; /* Number of threads blocked */
+ long nWaitersGone; /* Number of threads timed out */
+ long nWaitersToUnblock; /* Number of threads to unblock */
+ sem_t semBlockQueue; /* Queue up threads waiting for the */
+ /* condition to become signalled */
+ sem_t semBlockLock; /* Semaphore that guards access to */
+ /* | waiters blocked count/block queue */
+ /* +-> Mandatory Sync.LEVEL-1 */
+ pthread_mutex_t mtxUnblockLock; /* Mutex that guards access to */
+ /* | waiters (to)unblock(ed) counts */
+ /* +-> Optional* Sync.LEVEL-2 */
+ pthread_cond_t next; /* Doubly linked list */
+ pthread_cond_t prev;
};
-struct pthread_condattr_t_
-{
- int pshared;
+struct pthread_condattr_t_ {
+ int pshared;
};
#define PTW32_RWLOCK_MAGIC 0xfacade2
-struct pthread_rwlock_t_
-{
- pthread_mutex_t mtxExclusiveAccess;
- pthread_mutex_t mtxSharedAccessCompleted;
- pthread_cond_t cndSharedAccessCompleted;
- int nSharedAccessCount;
- int nExclusiveAccessCount;
- int nCompletedSharedAccessCount;
- int nMagic;
+struct pthread_rwlock_t_ {
+ pthread_mutex_t mtxExclusiveAccess;
+ pthread_mutex_t mtxSharedAccessCompleted;
+ pthread_cond_t cndSharedAccessCompleted;
+ int nSharedAccessCount;
+ int nExclusiveAccessCount;
+ int nCompletedSharedAccessCount;
+ int nMagic;
};
-struct pthread_rwlockattr_t_
-{
- int pshared;
+struct pthread_rwlockattr_t_ {
+ int pshared;
};
/*
* MCS lock queue node - see ptw32_MCS_lock.c
*/
-struct ptw32_mcs_node_t_
-{
- struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */
- struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */
- LONG readyFlag; /* set after lock is released by
+struct ptw32_mcs_node_t_ {
+ struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */
+ struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */
+ LONG readyFlag; /* set after lock is released by
predecessor */
- LONG nextFlag; /* set after 'next' ptr is set by
+ LONG nextFlag; /* set after 'next' ptr is set by
successor */
};
@@ -341,112 +324,111 @@ typedef struct ptw32_mcs_node_t_ ptw32_mcs_local_node_t;
typedef struct ptw32_mcs_node_t_ *ptw32_mcs_lock_t;
-struct ThreadKeyAssoc
-{
- /*
- * Purpose:
- * This structure creates an association between a thread and a key.
- * It is used to implement the implicit invocation of a user defined
- * destroy routine for thread specific data registered by a user upon
- * exiting a thread.
- *
- * Graphically, the arrangement is as follows, where:
- *
- * K - Key with destructor
- * (head of chain is key->threads)
- * T - Thread that has called pthread_setspecific(Kn)
- * (head of chain is thread->keys)
- * A - Association. Each association is a node at the
- * intersection of two doubly-linked lists.
- *
- * T1 T2 T3
- * | | |
- * | | |
- * K1 -----+-----A-----A----->
- * | | |
- * | | |
- * K2 -----A-----A-----+----->
- * | | |
- * | | |
- * K3 -----A-----+-----A----->
- * | | |
- * | | |
- * V V V
- *
- * Access to the association is guarded by two locks: the key's
- * general lock (guarding the row) and the thread's general
- * lock (guarding the column). This avoids the need for a
- * dedicated lock for each association, which not only consumes
- * more handles but requires that: before the lock handle can
- * be released - both the key must be deleted and the thread
- * must have called the destructor. The two-lock arrangement
- * allows the resources to be freed as soon as either thread or
- * key is concluded.
- *
- * To avoid deadlock: whenever both locks are required, the key
- * and thread locks are always acquired in the order: key lock
- * then thread lock. An exception to this exists when a thread
- * calls the destructors, however this is done carefully to
- * avoid deadlock.
- *
- * An association is created when a thread first calls
- * pthread_setspecific() on a key that has a specified
- * destructor.
- *
- * An association is destroyed either immediately after the
- * thread calls the key destructor function on thread exit, or
- * when the key is deleted.
- *
- * Attributes:
- * thread
- * reference to the thread that owns the
- * association. This is actually the pointer to the
- * thread struct itself. Since the association is
- * destroyed before the thread exits, this can never
- * point to a different logical thread to the one that
- * created the assoc, i.e. after thread struct reuse.
- *
- * key
- * reference to the key that owns the association.
- *
- * nextKey
- * The pthread_t->keys attribute is the head of a
- * chain of associations that runs through the nextKey
- * link. This chain provides the 1 to many relationship
- * between a pthread_t and all pthread_key_t on which
- * it called pthread_setspecific.
- *
- * prevKey
- * Similarly.
- *
- * nextThread
- * The pthread_key_t->threads attribute is the head of
- * a chain of assoctiations that runs through the
- * nextThreads link. This chain provides the 1 to many
- * relationship between a pthread_key_t and all the
- * PThreads that have called pthread_setspecific for
- * this pthread_key_t.
- *
- * prevThread
- * Similarly.
- *
- * Notes:
- * 1) As soon as either the key or the thread is no longer
- * referencing the association, it can be destroyed. The
- * association will be removed from both chains.
- *
- * 2) Under WIN32, an association is only created by
- * pthread_setspecific if the user provided a
- * destroyRoutine when they created the key.
- *
- *
- */
- ptw32_thread_t * thread;
- pthread_key_t key;
- ThreadKeyAssoc *nextKey;
- ThreadKeyAssoc *nextThread;
- ThreadKeyAssoc *prevKey;
- ThreadKeyAssoc *prevThread;
+struct ThreadKeyAssoc {
+ /*
+ * Purpose:
+ * This structure creates an association between a thread and a key.
+ * It is used to implement the implicit invocation of a user defined
+ * destroy routine for thread specific data registered by a user upon
+ * exiting a thread.
+ *
+ * Graphically, the arrangement is as follows, where:
+ *
+ * K - Key with destructor
+ * (head of chain is key->threads)
+ * T - Thread that has called pthread_setspecific(Kn)
+ * (head of chain is thread->keys)
+ * A - Association. Each association is a node at the
+ * intersection of two doubly-linked lists.
+ *
+ * T1 T2 T3
+ * | | |
+ * | | |
+ * K1 -----+-----A-----A----->
+ * | | |
+ * | | |
+ * K2 -----A-----A-----+----->
+ * | | |
+ * | | |
+ * K3 -----A-----+-----A----->
+ * | | |
+ * | | |
+ * V V V
+ *
+ * Access to the association is guarded by two locks: the key's
+ * general lock (guarding the row) and the thread's general
+ * lock (guarding the column). This avoids the need for a
+ * dedicated lock for each association, which not only consumes
+ * more handles but requires that: before the lock handle can
+ * be released - both the key must be deleted and the thread
+ * must have called the destructor. The two-lock arrangement
+ * allows the resources to be freed as soon as either thread or
+ * key is concluded.
+ *
+ * To avoid deadlock: whenever both locks are required, the key
+ * and thread locks are always acquired in the order: key lock
+ * then thread lock. An exception to this exists when a thread
+ * calls the destructors, however this is done carefully to
+ * avoid deadlock.
+ *
+ * An association is created when a thread first calls
+ * pthread_setspecific() on a key that has a specified
+ * destructor.
+ *
+ * An association is destroyed either immediately after the
+ * thread calls the key destructor function on thread exit, or
+ * when the key is deleted.
+ *
+ * Attributes:
+ * thread
+ * reference to the thread that owns the
+ * association. This is actually the pointer to the
+ * thread struct itself. Since the association is
+ * destroyed before the thread exits, this can never
+ * point to a different logical thread to the one that
+ * created the assoc, i.e. after thread struct reuse.
+ *
+ * key
+ * reference to the key that owns the association.
+ *
+ * nextKey
+ * The pthread_t->keys attribute is the head of a
+ * chain of associations that runs through the nextKey
+ * link. This chain provides the 1 to many relationship
+ * between a pthread_t and all pthread_key_t on which
+ * it called pthread_setspecific.
+ *
+ * prevKey
+ * Similarly.
+ *
+ * nextThread
+ * The pthread_key_t->threads attribute is the head of
+ * a chain of assoctiations that runs through the
+ * nextThreads link. This chain provides the 1 to many
+ * relationship between a pthread_key_t and all the
+ * PThreads that have called pthread_setspecific for
+ * this pthread_key_t.
+ *
+ * prevThread
+ * Similarly.
+ *
+ * Notes:
+ * 1) As soon as either the key or the thread is no longer
+ * referencing the association, it can be destroyed. The
+ * association will be removed from both chains.
+ *
+ * 2) Under WIN32, an association is only created by
+ * pthread_setspecific if the user provided a
+ * destroyRoutine when they created the key.
+ *
+ *
+ */
+ ptw32_thread_t * thread;
+ pthread_key_t key;
+ ThreadKeyAssoc *nextKey;
+ ThreadKeyAssoc *nextThread;
+ ThreadKeyAssoc *prevKey;
+ ThreadKeyAssoc *prevThread;
};
@@ -512,8 +494,8 @@ struct ThreadKeyAssoc
/* Declared in global.c */
extern PTW32_INTERLOCKED_LONG (WINAPI *
- ptw32_interlocked_compare_exchange)
- (PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG);
+ ptw32_interlocked_compare_exchange)
+(PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG);
/* Declared in pthread_cancel.c */
extern DWORD (*ptw32_register_cancelation) (PAPCFUNC, HANDLE, DWORD);
@@ -561,79 +543,79 @@ extern "C"
* =====================
*/
- int ptw32_is_attr (const pthread_attr_t * attr);
+int ptw32_is_attr (const pthread_attr_t * attr);
- int ptw32_cond_check_need_init (pthread_cond_t * cond);
- int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
- int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
+int ptw32_cond_check_need_init (pthread_cond_t * cond);
+int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
+int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
- PTW32_INTERLOCKED_LONG WINAPI
- ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
- PTW32_INTERLOCKED_LONG value,
- PTW32_INTERLOCKED_LONG comparand);
+PTW32_INTERLOCKED_LONG WINAPI
+ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
+ PTW32_INTERLOCKED_LONG value,
+ PTW32_INTERLOCKED_LONG comparand);
- LONG WINAPI
- ptw32_InterlockedExchange (LPLONG location,
- LONG value);
+LONG WINAPI
+ptw32_InterlockedExchange (LPLONG location,
+ LONG value);
- DWORD
- ptw32_RegisterCancelation (PAPCFUNC callback,
- HANDLE threadH, DWORD callback_arg);
+DWORD
+ptw32_RegisterCancelation (PAPCFUNC callback,
+ HANDLE threadH, DWORD callback_arg);
- int ptw32_processInitialize (void);
+int ptw32_processInitialize (void);
- void ptw32_processTerminate (void);
+void ptw32_processTerminate (void);
- void ptw32_threadDestroy (pthread_t tid);
+void ptw32_threadDestroy (pthread_t tid);
- void ptw32_pop_cleanup_all (int execute);
+void ptw32_pop_cleanup_all (int execute);
- pthread_t ptw32_new (void);
+pthread_t ptw32_new (void);
- pthread_t ptw32_threadReusePop (void);
+pthread_t ptw32_threadReusePop (void);
- void ptw32_threadReusePush (pthread_t thread);
+void ptw32_threadReusePush (pthread_t thread);
- int ptw32_getprocessors (int *count);
+int ptw32_getprocessors (int *count);
- int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
+int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
- void ptw32_rwlock_cancelwrwait (void *arg);
+void ptw32_rwlock_cancelwrwait (void *arg);
#if ! defined (__MINGW32__) || defined (__MSVCRT__)
- unsigned __stdcall
+unsigned __stdcall
#else
- void
+void
#endif
- ptw32_threadStart (void *vthreadParms);
+ptw32_threadStart (void *vthreadParms);
- void ptw32_callUserDestroyRoutines (pthread_t thread);
+void ptw32_callUserDestroyRoutines (pthread_t thread);
- int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
+int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
- void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
+void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
- int ptw32_semwait (sem_t * sem);
+int ptw32_semwait (sem_t * sem);
- DWORD ptw32_relmillisecs (const struct timespec * abstime);
+DWORD ptw32_relmillisecs (const struct timespec * abstime);
- void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
+void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
- void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node);
+void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node);
#ifdef NEED_FTIME
- void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft);
- void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts);
+void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft);
+void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts);
#endif
/* Declared in misc.c */
#ifdef NEED_CALLOC
#define calloc(n, s) ptw32_calloc(n, s)
- void *ptw32_calloc (size_t n, size_t s);
+void *ptw32_calloc (size_t n, size_t s);
#endif
/* Declared in private.c */
- void ptw32_throw (DWORD exception);
+void ptw32_throw (DWORD exception);
#ifdef __cplusplus
}
@@ -646,13 +628,13 @@ extern "C"
extern "C"
{
# endif
- _CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
- unsigned, void *);
- _CRTIMP void __cdecl _endthread (void);
- _CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
- unsigned (__stdcall *) (void *),
- void *, unsigned, unsigned *);
- _CRTIMP void __cdecl _endthreadex (unsigned);
+_CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
+ unsigned, void *);
+_CRTIMP void __cdecl _endthread (void);
+_CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
+ unsigned (__stdcall *) (void *),
+ void *, unsigned, unsigned *);
+_CRTIMP void __cdecl _endthreadex (unsigned);
# ifdef __cplusplus
}
# endif
@@ -684,7 +666,7 @@ extern "C"
*/
#if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(NEED_CREATETHREAD)
-/*
+/*
* Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
* in order to avoid warnings because of return type
*/
diff --git a/thirdparties/wince/include/pthread/pthread.h b/thirdparties/wince/include/pthread/pthread.h
index a1f9aa1..1b061b6 100755
--- a/thirdparties/wince/include/pthread/pthread.h
+++ b/thirdparties/wince/include/pthread/pthread.h
@@ -5,25 +5,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -231,8 +231,8 @@ typedef unsigned long DWORD_PTR;
* Boolean values to make us independent of system includes.
*/
enum {
- PTW32_FALSE = 0,
- PTW32_TRUE = (! PTW32_FALSE)
+ PTW32_FALSE = 0,
+ PTW32_TRUE = (! PTW32_FALSE)
};
/*
@@ -305,8 +305,8 @@ enum {
#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1
struct timespec {
- long tv_sec;
- long tv_nsec;
+ long tv_sec;
+ long tv_nsec;
};
#endif /* HAVE_STRUCT_TIMESPEC */
@@ -314,7 +314,7 @@ struct timespec {
#define SIG_BLOCK 0
#endif /* SIG_BLOCK */
-#ifndef SIG_UNBLOCK
+#ifndef SIG_UNBLOCK
#define SIG_UNBLOCK 1
#endif /* SIG_UNBLOCK */
@@ -505,14 +505,14 @@ extern "C"
#undef _POSIX_THREAD_THREADS_MAX
#define _POSIX_THREAD_THREADS_MAX 64
- /* Arbitrary value */
+/* Arbitrary value */
#undef PTHREAD_THREADS_MAX
#define PTHREAD_THREADS_MAX 2019
#undef _POSIX_SEM_NSEMS_MAX
#define _POSIX_SEM_NSEMS_MAX 256
- /* Arbitrary value */
+/* Arbitrary value */
#undef SEM_NSEMS_MAX
#define SEM_NSEMS_MAX 1024
@@ -592,47 +592,47 @@ typedef struct pthread_barrierattr_t_ * pthread_barrierattr_t;
*/
enum {
-/*
- * pthread_attr_{get,set}detachstate
- */
- PTHREAD_CREATE_JOINABLE = 0, /* Default */
- PTHREAD_CREATE_DETACHED = 1,
-
-/*
- * pthread_attr_{get,set}inheritsched
- */
- PTHREAD_INHERIT_SCHED = 0,
- PTHREAD_EXPLICIT_SCHED = 1, /* Default */
-
-/*
- * pthread_{get,set}scope
- */
- PTHREAD_SCOPE_PROCESS = 0,
- PTHREAD_SCOPE_SYSTEM = 1, /* Default */
-
-/*
- * pthread_setcancelstate paramters
- */
- PTHREAD_CANCEL_ENABLE = 0, /* Default */
- PTHREAD_CANCEL_DISABLE = 1,
-
-/*
- * pthread_setcanceltype parameters
- */
- PTHREAD_CANCEL_ASYNCHRONOUS = 0,
- PTHREAD_CANCEL_DEFERRED = 1, /* Default */
-
-/*
- * pthread_mutexattr_{get,set}pshared
- * pthread_condattr_{get,set}pshared
- */
- PTHREAD_PROCESS_PRIVATE = 0,
- PTHREAD_PROCESS_SHARED = 1,
-
-/*
- * pthread_barrier_wait
- */
- PTHREAD_BARRIER_SERIAL_THREAD = -1
+ /*
+ * pthread_attr_{get,set}detachstate
+ */
+ PTHREAD_CREATE_JOINABLE = 0, /* Default */
+ PTHREAD_CREATE_DETACHED = 1,
+
+ /*
+ * pthread_attr_{get,set}inheritsched
+ */
+ PTHREAD_INHERIT_SCHED = 0,
+ PTHREAD_EXPLICIT_SCHED = 1, /* Default */
+
+ /*
+ * pthread_{get,set}scope
+ */
+ PTHREAD_SCOPE_PROCESS = 0,
+ PTHREAD_SCOPE_SYSTEM = 1, /* Default */
+
+ /*
+ * pthread_setcancelstate paramters
+ */
+ PTHREAD_CANCEL_ENABLE = 0, /* Default */
+ PTHREAD_CANCEL_DISABLE = 1,
+
+ /*
+ * pthread_setcanceltype parameters
+ */
+ PTHREAD_CANCEL_ASYNCHRONOUS = 0,
+ PTHREAD_CANCEL_DEFERRED = 1, /* Default */
+
+ /*
+ * pthread_mutexattr_{get,set}pshared
+ * pthread_condattr_{get,set}pshared
+ */
+ PTHREAD_PROCESS_PRIVATE = 0,
+ PTHREAD_PROCESS_SHARED = 1,
+
+ /*
+ * pthread_barrier_wait
+ */
+ PTHREAD_BARRIER_SERIAL_THREAD = -1
};
/*
@@ -654,12 +654,11 @@ enum {
*/
#define PTHREAD_ONCE_INIT { PTW32_FALSE, 0, 0, 0}
-struct pthread_once_t_
-{
- int done; /* indicates if user function has been executed */
- void * lock;
- int reserved1;
- int reserved2;
+struct pthread_once_t_ {
+ int done; /* indicates if user function has been executed */
+ void * lock;
+ int reserved1;
+ int reserved2;
};
@@ -690,19 +689,18 @@ struct pthread_once_t_
/*
* Mutex types.
*/
-enum
-{
- /* Compatibility with LinuxThreads */
- PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP,
- /* For compatibility with POSIX */
- PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+enum {
+ /* Compatibility with LinuxThreads */
+ PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP,
+ /* For compatibility with POSIX */
+ PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP,
+ PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
};
@@ -719,17 +717,16 @@ typedef void (* PTW32_CDECL ptw32_cleanup_callback_t)(void *);
#pragma warning( default : 4229 )
#endif
-struct ptw32_cleanup_t
-{
- ptw32_cleanup_callback_t routine;
- void *arg;
- struct ptw32_cleanup_t *prev;
+struct ptw32_cleanup_t {
+ ptw32_cleanup_callback_t routine;
+ void *arg;
+ struct ptw32_cleanup_t *prev;
};
#ifdef __CLEANUP_SEH
- /*
- * WIN32 SEH version of cancel cleanup.
- */
+/*
+ * WIN32 SEH version of cancel cleanup.
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
@@ -739,7 +736,7 @@ struct ptw32_cleanup_t
_cleanup.arg = (_arg); \
__try \
{ \
-
+
#define pthread_cleanup_pop( _execute ) \
} \
__finally \
@@ -755,16 +752,16 @@ struct ptw32_cleanup_t
#ifdef __CLEANUP_C
- /*
- * C implementation of PThreads cancel cleanup
- */
+/*
+ * C implementation of PThreads cancel cleanup
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
ptw32_cleanup_t _cleanup; \
\
ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \
-
+
#define pthread_cleanup_pop( _execute ) \
(void) ptw32_pop_cleanup( _execute ); \
}
@@ -773,71 +770,69 @@ struct ptw32_cleanup_t
#ifdef __CLEANUP_CXX
- /*
- * C++ version of cancel cleanup.
- * - John E. Bossom.
- */
-
- class PThreadCleanup {
- /*
- * PThreadCleanup
- *
- * Purpose
- * This class is a C++ helper class that is
- * used to implement pthread_cleanup_push/
- * pthread_cleanup_pop.
- * The destructor of this class automatically
- * pops the pushed cleanup routine regardless
- * of how the code exits the scope
- * (i.e. such as by an exception)
- */
- ptw32_cleanup_callback_t cleanUpRout;
- void * obj;
- int executeIt;
-
- public:
- PThreadCleanup() :
- cleanUpRout( 0 ),
- obj( 0 ),
- executeIt( 0 )
- /*
- * No cleanup performed
- */
- {
- }
-
- PThreadCleanup(
- ptw32_cleanup_callback_t routine,
- void * arg ) :
- cleanUpRout( routine ),
- obj( arg ),
- executeIt( 1 )
- /*
- * Registers a cleanup routine for 'arg'
- */
- {
- }
-
- ~PThreadCleanup()
- {
- if ( executeIt && ((void *) cleanUpRout != (void *) 0) )
- {
- (void) (*cleanUpRout)( obj );
- }
- }
-
- void execute( int exec )
- {
- executeIt = exec;
- }
- };
-
- /*
- * C++ implementation of PThreads cancel cleanup;
- * This implementation takes advantage of a helper
- * class who's destructor automatically calls the
- * cleanup routine if we exit our scope weirdly
- */
+/*
+ * C++ version of cancel cleanup.
+ * - John E. Bossom.
+ */
+
+class PThreadCleanup
+{
+ /*
+ * PThreadCleanup
+ *
+ * Purpose
+ * This class is a C++ helper class that is
+ * used to implement pthread_cleanup_push/
+ * pthread_cleanup_pop.
+ * The destructor of this class automatically
+ * pops the pushed cleanup routine regardless
+ * of how the code exits the scope
+ * (i.e. such as by an exception)
+ */
+ ptw32_cleanup_callback_t cleanUpRout;
+ void * obj;
+ int executeIt;
+
+public:
+ PThreadCleanup() :
+ cleanUpRout( 0 ),
+ obj( 0 ),
+ executeIt( 0 )
+/*
+ * No cleanup performed
+ */
+ {
+ }
+
+ PThreadCleanup(
+ ptw32_cleanup_callback_t routine,
+ void * arg ) :
+ cleanUpRout( routine ),
+ obj( arg ),
+ executeIt( 1 )
+/*
+ * Registers a cleanup routine for 'arg'
+ */
+ {
+ }
+
+ ~PThreadCleanup() {
+ if ( executeIt && ((void *) cleanUpRout != (void *) 0) ) {
+ (void) (*cleanUpRout)( obj );
+ }
+ }
+
+ void execute( int exec ) {
+ executeIt = exec;
+ }
+};
+
+/*
+ * C++ implementation of PThreads cancel cleanup;
+ * This implementation takes advantage of a helper
+ * class who's destructor automatically calls the
+ * cleanup routine if we exit our scope weirdly
+ */
#define pthread_cleanup_push( _rout, _arg ) \
{ \
PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \
@@ -873,98 +868,98 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_init (pthread_attr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_destroy (pthread_attr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getdetachstate (const pthread_attr_t * attr,
- int *detachstate);
+ int *detachstate);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstackaddr (const pthread_attr_t * attr,
- void **stackaddr);
+ void **stackaddr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstacksize (const pthread_attr_t * attr,
- size_t * stacksize);
+ size_t * stacksize);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setdetachstate (pthread_attr_t * attr,
- int detachstate);
+ int detachstate);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstackaddr (pthread_attr_t * attr,
- void *stackaddr);
+ void *stackaddr);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstacksize (pthread_attr_t * attr,
- size_t stacksize);
+ size_t stacksize);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedparam (const pthread_attr_t *attr,
- struct sched_param *param);
+ struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
- const struct sched_param *param);
+ const struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
- int);
+ int);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (pthread_attr_t *,
- int *);
+ int *);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr,
- int inheritsched);
+ int inheritsched);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(pthread_attr_t * attr,
- int * inheritsched);
+ int * inheritsched);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setscope (pthread_attr_t *,
- int);
+ int);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
- int *);
+ int *);
/*
* PThread Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid,
- const pthread_attr_t * attr,
- void *(*start) (void *),
- void *arg);
+ const pthread_attr_t * attr,
+ void *(*start) (void *),
+ void *arg);
PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid);
PTW32_DLLPORT int PTW32_CDECL pthread_equal (pthread_t t1,
- pthread_t t2);
+ pthread_t t2);
PTW32_DLLPORT void PTW32_CDECL pthread_exit (void *value_ptr);
PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread,
- void **value_ptr);
+ void **value_ptr);
PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void);
PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread);
PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state,
- int *oldstate);
+ int *oldstate);
PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type,
- int *oldtype);
+ int *oldtype);
PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void);
PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
- void (*init_routine) (void));
+ void (*init_routine) (void));
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);
PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
- void (*routine) (void *),
- void *arg);
+ void (*routine) (void *),
+ void *arg);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
/*
* Thread Specific Data Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key,
- void (*destructor) (void *));
+ void (*destructor) (void *));
PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key);
PTW32_DLLPORT int PTW32_CDECL pthread_setspecific (pthread_key_t key,
- const void *value);
+ const void *value);
PTW32_DLLPORT void * PTW32_CDECL pthread_getspecific (pthread_key_t key);
@@ -977,11 +972,11 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_init (pthread_mutexattr_t * attr
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_destroy (pthread_mutexattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getpshared (const pthread_mutexattr_t
- * attr,
- int *pshared);
+ * attr,
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t * attr,
- int pshared);
+ int pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind);
@@ -994,24 +989,24 @@ PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_init (pthread_barrierattr_t *
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_destroy (pthread_barrierattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_getpshared (const pthread_barrierattr_t
- * attr,
- int *pshared);
+ * attr,
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_setpshared (pthread_barrierattr_t * attr,
- int pshared);
+ int pshared);
/*
* Mutex Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex,
- const pthread_mutexattr_t * attr);
+ const pthread_mutexattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t *mutex,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex);
@@ -1034,8 +1029,8 @@ PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock);
* Barrier Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_init (pthread_barrier_t * barrier,
- const pthread_barrierattr_t * attr,
- unsigned int count);
+ const pthread_barrierattr_t * attr,
+ unsigned int count);
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barrier);
@@ -1049,25 +1044,25 @@ PTW32_DLLPORT int PTW32_CDECL pthread_condattr_init (pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_destroy (pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_getpshared (const pthread_condattr_t * attr,
- int *pshared);
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * attr,
- int pshared);
+ int pshared);
/*
* Condition Variable Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_cond_init (pthread_cond_t * cond,
- const pthread_condattr_t * attr);
+ const pthread_condattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_destroy (pthread_cond_t * cond);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_wait (pthread_cond_t * cond,
- pthread_mutex_t * mutex);
+ pthread_mutex_t * mutex);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond,
- pthread_mutex_t * mutex,
- const struct timespec *abstime);
+ pthread_mutex_t * mutex,
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_cond_signal (pthread_cond_t * cond);
@@ -1077,22 +1072,22 @@ PTW32_DLLPORT int PTW32_CDECL pthread_cond_broadcast (pthread_cond_t * cond);
* Scheduling
*/
PTW32_DLLPORT int PTW32_CDECL pthread_setschedparam (pthread_t thread,
- int policy,
- const struct sched_param *param);
+ int policy,
+ const struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_getschedparam (pthread_t thread,
- int *policy,
- struct sched_param *param);
+ int *policy,
+ struct sched_param *param);
PTW32_DLLPORT int PTW32_CDECL pthread_setconcurrency (int);
-
+
PTW32_DLLPORT int PTW32_CDECL pthread_getconcurrency (void);
/*
* Read-Write Lock Functions
*/
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_init(pthread_rwlock_t *lock,
- const pthread_rwlockattr_t *attr);
+ const pthread_rwlockattr_t *attr);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_destroy(pthread_rwlock_t *lock);
@@ -1103,12 +1098,12 @@ PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_trywrlock(pthread_rwlock_t *);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_rdlock(pthread_rwlock_t *lock);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedrdlock(pthread_rwlock_t *lock,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_wrlock(pthread_rwlock_t *lock);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedwrlock(pthread_rwlock_t *lock,
- const struct timespec *abstime);
+ const struct timespec *abstime);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_unlock(pthread_rwlock_t *lock);
@@ -1117,10 +1112,10 @@ PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_init (pthread_rwlockattr_t * at
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr,
- int *pshared);
+ int *pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr,
- int pshared);
+ int pshared);
#if PTW32_LEVEL >= PTW32_LEVEL_MAX - 1
@@ -1138,9 +1133,9 @@ PTW32_DLLPORT int PTW32_CDECL pthread_kill(pthread_t thread, int sig);
* Compatibility with Linux.
*/
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr,
- int kind);
+ int kind);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr,
- int *kind);
+ int *kind);
/*
* Possibly supported by other POSIX threads implementations
@@ -1162,8 +1157,8 @@ PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_detach_np(void);
*/
PTW32_DLLPORT int PTW32_CDECL pthread_win32_test_features_np(int);
enum ptw32_features {
- PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
- PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
+ PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
+ PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
};
/*
@@ -1203,7 +1198,7 @@ PTW32_DLLPORT HANDLE PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread)
*/
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableWait (HANDLE waitHandle);
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
- DWORD timeout);
+ DWORD timeout);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
@@ -1212,11 +1207,11 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
*/
#ifndef _UWIN
# if defined(NEED_ERRNO)
- PTW32_DLLPORT int * PTW32_CDECL _errno( void );
+PTW32_DLLPORT int * PTW32_CDECL _errno( void );
# else
# ifndef errno
# if (defined(_MT) || defined(_DLL))
- __declspec(dllimport) extern int * __cdecl _errno(void);
+__declspec(dllimport) extern int * __cdecl _errno(void);
# define errno (*_errno())
# endif
# endif
@@ -1267,22 +1262,22 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
#ifdef __cplusplus
-/*
- * Internal exceptions
- */
-class ptw32_exception {};
-class ptw32_exception_cancel : public ptw32_exception {};
-class ptw32_exception_exit : public ptw32_exception {};
+ /*
+ * Internal exceptions
+ */
+ class ptw32_exception {};
+ class ptw32_exception_cancel : public ptw32_exception {};
+ class ptw32_exception_exit : public ptw32_exception {};
#endif
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
-/* FIXME: This is only required if the library was built using SEH */
-/*
- * Get internal SEH tag
- */
-PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
+ /* FIXME: This is only required if the library was built using SEH */
+ /*
+ * Get internal SEH tag
+ */
+ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
@@ -1290,10 +1285,10 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#ifdef __CLEANUP_SEH
-/*
- * Redefine the SEH __except keyword to ensure that applications
- * propagate our internal exceptions up to the library's internal handlers.
- */
+ /*
+ * Redefine the SEH __except keyword to ensure that applications
+ * propagate our internal exceptions up to the library's internal handlers.
+ */
#define __except( E ) \
__except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \
? EXCEPTION_CONTINUE_SEARCH : ( E ) )
@@ -1302,15 +1297,15 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
#ifdef __CLEANUP_CXX
-/*
- * Redefine the C++ catch keyword to ensure that applications
- * propagate our internal exceptions up to the library's internal handlers.
- */
+ /*
+ * Redefine the C++ catch keyword to ensure that applications
+ * propagate our internal exceptions up to the library's internal handlers.
+ */
#ifdef _MSC_VER
- /*
- * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
- * if you want Pthread-Win32 cancelation and pthread_exit to work.
- */
+ /*
+ * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
+ * if you want Pthread-Win32 cancelation and pthread_exit to work.
+ */
#ifndef PtW32NoCatchWarn
diff --git a/thirdparties/wince/include/pthread/sched.h b/thirdparties/wince/include/pthread/sched.h
index 3dfd4a8..cd17f4f 100755
--- a/thirdparties/wince/include/pthread/sched.h
+++ b/thirdparties/wince/include/pthread/sched.h
@@ -3,7 +3,7 @@
*
* Purpose:
* Provides an implementation of POSIX realtime extensions
- * as defined in
+ * as defined in
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
@@ -12,25 +12,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -127,15 +127,15 @@ typedef int pid_t;
/* Thread scheduling policies */
enum {
- SCHED_OTHER = 0,
- SCHED_FIFO,
- SCHED_RR,
- SCHED_MIN = SCHED_OTHER,
- SCHED_MAX = SCHED_RR
+ SCHED_OTHER = 0,
+ SCHED_FIFO,
+ SCHED_RR,
+ SCHED_MIN = SCHED_OTHER,
+ SCHED_MAX = SCHED_RR
};
struct sched_param {
- int sched_priority;
+ int sched_priority;
};
#ifdef __cplusplus
diff --git a/thirdparties/wince/include/pthread/semaphore.h b/thirdparties/wince/include/pthread/semaphore.h
index f00cf9c..98be3fa 100755
--- a/thirdparties/wince/include/pthread/semaphore.h
+++ b/thirdparties/wince/include/pthread/semaphore.h
@@ -12,25 +12,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -127,8 +127,8 @@ typedef unsigned int mode_t;
typedef struct sem_t_ * sem_t;
PTW32_DLLPORT int __cdecl sem_init (sem_t * sem,
- int pshared,
- unsigned int value);
+ int pshared,
+ unsigned int value);
PTW32_DLLPORT int __cdecl sem_destroy (sem_t * sem);
@@ -137,24 +137,24 @@ PTW32_DLLPORT int __cdecl sem_trywait (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_wait (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_timedwait (sem_t * sem,
- const struct timespec * abstime);
+ const struct timespec * abstime);
PTW32_DLLPORT int __cdecl sem_post (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_post_multiple (sem_t * sem,
- int count);
+ int count);
PTW32_DLLPORT int __cdecl sem_open (const char * name,
- int oflag,
- mode_t mode,
- unsigned int value);
+ int oflag,
+ mode_t mode,
+ unsigned int value);
PTW32_DLLPORT int __cdecl sem_close (sem_t * sem);
PTW32_DLLPORT int __cdecl sem_unlink (const char * name);
PTW32_DLLPORT int __cdecl sem_getvalue (sem_t * sem,
- int * sval);
+ int * sval);
#ifdef __cplusplus
} /* End of extern "C" */
diff --git a/thirdparties/wince/include/smc/statemap.h b/thirdparties/wince/include/smc/statemap.h
index 2fe7b85..201d683 100755
--- a/thirdparties/wince/include/smc/statemap.h
+++ b/thirdparties/wince/include/smc/statemap.h
@@ -6,21 +6,21 @@
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
- *
+ *
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
- *
+ *
* The Original Code is State Machine Compiler (SMC).
- *
+ *
* The Initial Developer of the Original Code is Charles W. Rapp.
- *
+ *
* Port to C by Francois Perrad, francois.perrad@gadz.org
* Copyright 2004, Francois Perrad.
* All Rights Reserved.
*
- * Contributor(s):
+ * Contributor(s):
*
* Description
*
@@ -54,8 +54,7 @@
const char *_name; \
int _id;
-struct State
-{
+struct State {
STATE_MEMBERS
};
@@ -76,8 +75,7 @@ struct State
const char * _transition; \
int _debug_flag;
-struct FSMContext
-{
+struct FSMContext {
FSM_MEMBERS(_)
};
diff --git a/thirdparties/wince/include/srtp/aes.h b/thirdparties/wince/include/srtp/aes.h
index 2881337..97fdb63 100755
--- a/thirdparties/wince/include/srtp/aes.h
+++ b/thirdparties/wince/include/srtp/aes.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -55,19 +55,19 @@
/* aes internals */
typedef struct {
- v128_t round[15];
- int num_rounds;
+ v128_t round[15];
+ int num_rounds;
} aes_expanded_key_t;
err_status_t
aes_expand_encryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
err_status_t
aes_expand_decryption_key(const uint8_t *key,
- int key_len,
- aes_expanded_key_t *expanded_key);
+ int key_len,
+ aes_expanded_key_t *expanded_key);
void
aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
@@ -77,7 +77,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
#if 0
/*
- * internal functions
+ * internal functions
*/
void
@@ -85,6 +85,6 @@ aes_init_sbox(void);
void
aes_compute_tables(void);
-#endif
+#endif
#endif /* _AES_H */
diff --git a/thirdparties/wince/include/srtp/aes_cbc.h b/thirdparties/wince/include/srtp/aes_cbc.h
index f92591d..b2f3b76 100755
--- a/thirdparties/wince/include/srtp/aes_cbc.h
+++ b/thirdparties/wince/include/srtp/aes_cbc.h
@@ -15,38 +15,38 @@
#include "cipher.h"
typedef struct {
- v128_t state; /* cipher chaining state */
- v128_t previous; /* previous ciphertext block */
- uint8_t key[32];
- int key_len;
- aes_expanded_key_t expanded_key; /* the cipher key */
+ v128_t state; /* cipher chaining state */
+ v128_t previous; /* previous ciphertext block */
+ uint8_t key[32];
+ int key_len;
+ aes_expanded_key_t expanded_key; /* the cipher key */
} aes_cbc_ctx_t;
err_status_t
aes_cbc_set_key(aes_cbc_ctx_t *c,
- const unsigned char *key);
+ const unsigned char *key);
err_status_t
-aes_cbc_encrypt(aes_cbc_ctx_t *c,
- unsigned char *buf,
- unsigned int *bytes_in_data);
+aes_cbc_encrypt(aes_cbc_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *bytes_in_data);
err_status_t
-aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
- int key_len);
+aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
+ int key_len);
err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction);
err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
- unsigned char *data,
- unsigned int *bytes_in_data);
+ unsigned char *data,
+ unsigned int *bytes_in_data);
#endif /* AES_CBC_H */
diff --git a/thirdparties/wince/include/srtp/aes_gcm_ossl.h b/thirdparties/wince/include/srtp/aes_gcm_ossl.h
index 8e7711d..827ecd3 100755
--- a/thirdparties/wince/include/srtp/aes_gcm_ossl.h
+++ b/thirdparties/wince/include/srtp/aes_gcm_ossl.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,11 +52,11 @@
#include <openssl/aes.h>
typedef struct {
- v256_t key;
- int key_size;
- int tag_len;
- EVP_CIPHER_CTX ctx;
- cipher_direction_t dir;
+ v256_t key;
+ int key_size;
+ int tag_len;
+ EVP_CIPHER_CTX ctx;
+ cipher_direction_t dir;
} aes_gcm_ctx_t;
#endif /* AES_GCM_OSSL_H */
diff --git a/thirdparties/wince/include/srtp/aes_icm.h b/thirdparties/wince/include/srtp/aes_icm.h
index 685a6d4..982e11a 100755
--- a/thirdparties/wince/include/srtp/aes_icm.h
+++ b/thirdparties/wince/include/srtp/aes_icm.h
@@ -15,43 +15,43 @@
#include "cipher.h"
typedef struct {
- v128_t counter; /* holds the counter value */
- v128_t offset; /* initial offset value */
- v128_t keystream_buffer; /* buffers bytes of keystream */
- aes_expanded_key_t expanded_key; /* the cipher key */
- int bytes_in_buffer; /* number of unused bytes in buffer */
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
} aes_icm_ctx_t;
err_status_t
aes_icm_context_init(aes_icm_ctx_t *c,
- const unsigned char *key,
- int key_len);
+ const unsigned char *key,
+ int key_len);
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction);
err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
aes_icm_output(aes_icm_ctx_t *c,
- unsigned char *buf, int bytes_to_output);
+ unsigned char *buf, int bytes_to_output);
-err_status_t
+err_status_t
aes_icm_dealloc(cipher_t *c);
-
-err_status_t
-aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
- unsigned char *buf,
- unsigned int *enc_len,
- int forIsmacryp);
-
-err_status_t
-aes_icm_alloc_ismacryp(cipher_t **c,
- int key_len,
- int forIsmacryp);
+
+err_status_t
+aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
+ unsigned char *buf,
+ unsigned int *enc_len,
+ int forIsmacryp);
+
+err_status_t
+aes_icm_alloc_ismacryp(cipher_t **c,
+ int key_len,
+ int forIsmacryp);
uint16_t
aes_icm_bytes_encrypted(aes_icm_ctx_t *c);
diff --git a/thirdparties/wince/include/srtp/alloc.h b/thirdparties/wince/include/srtp/alloc.h
index 5980eed..306e5f4 100755
--- a/thirdparties/wince/include/srtp/alloc.h
+++ b/thirdparties/wince/include/srtp/alloc.h
@@ -1,32 +1,32 @@
/*
* alloc.h
*
- * interface to memory allocation and deallocation, with optional debugging
+ * interface to memory allocation and deallocation, with optional debugging
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/wince/include/srtp/auth.h b/thirdparties/wince/include/srtp/auth.h
index 5b5e4b2..4d03d08 100755
--- a/thirdparties/wince/include/srtp/auth.h
+++ b/thirdparties/wince/include/srtp/auth.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "err.h" /* error codes */
#include "crypto.h" /* for auth_type_id_t */
#include "crypto_types.h" /* for values of auth_type_id_t */
@@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer;
typedef struct auth_t *auth_pointer_t;
typedef err_status_t (*auth_alloc_func)
- (auth_pointer_t *ap, int key_len, int out_len);
+(auth_pointer_t *ap, int key_len, int out_len);
typedef err_status_t (*auth_init_func)
- (void *state, const uint8_t *key, int key_len);
+(void *state, const uint8_t *key, int key_len);
typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap);
typedef err_status_t (*auth_compute_func)
- (void *state, uint8_t *buffer, int octets_to_auth,
- int tag_len, uint8_t *tag);
+(void *state, uint8_t *buffer, int octets_to_auth,
+ int tag_len, uint8_t *tag);
typedef err_status_t (*auth_update_func)
- (void *state, uint8_t *buffer, int octets_to_auth);
+(void *state, uint8_t *buffer, int octets_to_auth);
typedef err_status_t (*auth_start_func)(void *state);
-
+
/* some syntactic sugar on these function types */
#define auth_type_alloc(at, a, klen, outlen) \
@@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a);
*/
typedef struct auth_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- int data_length_octets; /* octets in data */
- uint8_t *data; /* data */
- int tag_length_octets; /* octets in tag */
- uint8_t *tag; /* tag */
- struct auth_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ int data_length_octets; /* octets in data */
+ uint8_t *data; /* data */
+ int tag_length_octets; /* octets in tag */
+ uint8_t *tag; /* tag */
+ struct auth_test_case_t *next_test_case; /* pointer to next testcase */
} auth_test_case_t;
/* auth_type_t */
typedef struct auth_type_t {
- auth_alloc_func alloc;
- auth_dealloc_func dealloc;
- auth_init_func init;
- auth_compute_func compute;
- auth_update_func update;
- auth_start_func start;
- char *description;
- int ref_count;
- auth_test_case_t *test_data;
- debug_module_t *debug;
- auth_type_id_t id;
+ auth_alloc_func alloc;
+ auth_dealloc_func dealloc;
+ auth_init_func init;
+ auth_compute_func compute;
+ auth_update_func update;
+ auth_start_func start;
+ char *description;
+ int ref_count;
+ auth_test_case_t *test_data;
+ debug_module_t *debug;
+ auth_type_id_t id;
} auth_type_t;
typedef struct auth_t {
- auth_type_t *type;
- void *state;
- int out_len; /* length of output tag in octets */
- int key_len; /* length of key in octets */
- int prefix_len; /* length of keystream prefix */
+ auth_type_t *type;
+ void *state;
+ int out_len; /* length of output tag in octets */
+ int key_len; /* length of key in octets */
+ int prefix_len; /* length of keystream prefix */
} auth_t;
-/*
+/*
* auth_type_self_test() tests an auth_type against test cases
* provided in an array of values of key/message/tag that is known to
* be good
@@ -151,7 +151,7 @@ typedef struct auth_t {
err_status_t
auth_type_self_test(const auth_type_t *at);
-/*
+/*
* auth_type_test() tests an auth_type against external test cases
* provided in an array of values of key/message/tag that is known to
* be good
diff --git a/thirdparties/wince/include/srtp/cipher.h b/thirdparties/wince/include/srtp/cipher.h
index d0d6b57..20bd360 100755
--- a/thirdparties/wince/include/srtp/cipher.h
+++ b/thirdparties/wince/include/srtp/cipher.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,7 +46,7 @@
#ifndef CIPHER_H
#define CIPHER_H
-#include "datatypes.h"
+#include "datatypes.h"
#include "rdbx.h" /* for xtd_seq_num_t */
#include "err.h" /* for error codes */
#include "crypto.h" /* for cipher_type_id_t */
@@ -54,17 +54,17 @@
/**
- * @brief cipher_direction_t defines a particular cipher operation.
+ * @brief cipher_direction_t defines a particular cipher operation.
*
* A cipher_direction_t is an enum that describes a particular cipher
* operation, i.e. encryption or decryption. For some ciphers, this
* distinction does not matter, but for others, it is essential.
*/
-typedef enum {
- direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
- direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
- direction_any /**< encryption or decryption */
+typedef enum {
+ direction_encrypt, /**< encryption (convert plaintext to ciphertext) */
+ direction_decrypt, /**< decryption (convert ciphertext to plaintext) */
+ direction_any /**< encryption or decryption */
} cipher_direction_t;
/*
@@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t;
typedef struct cipher_t *cipher_pointer_t;
/*
- * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
+ * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t
*/
typedef err_status_t (*cipher_alloc_func_t)
- (cipher_pointer_t *cp, int key_len, int tag_len);
+(cipher_pointer_t *cp, int key_len, int tag_len);
-/*
+/*
* a cipher_init_func_t [re-]initializes a cipher_t with a given key
*/
@@ -96,38 +96,38 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp);
/* a cipher_set_segment_func_t sets the segment index of a cipher_t */
typedef err_status_t (*cipher_set_segment_func_t)
- (void *state, xtd_seq_num_t idx);
+(void *state, xtd_seq_num_t idx);
-/*
- * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
+/*
+ * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers
*/
typedef err_status_t (*cipher_set_aad_func_t)
- (void *state, uint8_t *aad, unsigned int aad_len);
+(void *state, uint8_t *aad, unsigned int aad_len);
/* a cipher_encrypt_func_t encrypts data in-place */
typedef err_status_t (*cipher_encrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
/* a cipher_decrypt_func_t decrypts data in-place */
typedef err_status_t (*cipher_decrypt_func_t)
- (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
+(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
-/*
+/*
* a cipher_set_iv_func_t function sets the current initialization vector
*/
typedef err_status_t (*cipher_set_iv_func_t)
- (cipher_pointer_t cp, void *iv, cipher_direction_t direction);
+(cipher_pointer_t cp, void *iv, cipher_direction_t direction);
/*
* a cipher_get_tag_funct_t function is used to get the authentication
* tag that was calculated by an AEAD cipher.
*/
typedef err_status_t (*cipher_get_tag_func_t)
- (void *state, void *tag, int *len);
+(void *state, void *tag, int *len);
/*
@@ -139,35 +139,35 @@ typedef err_status_t (*cipher_get_tag_func_t)
*/
typedef struct cipher_test_case_t {
- int key_length_octets; /* octets in key */
- uint8_t *key; /* key */
- uint8_t *idx; /* packet index */
- int plaintext_length_octets; /* octets in plaintext */
- uint8_t *plaintext; /* plaintext */
- int ciphertext_length_octets; /* octets in plaintext */
- uint8_t *ciphertext; /* ciphertext */
- int aad_length_octets; /* octets in AAD */
- uint8_t *aad; /* AAD */
- int tag_length_octets; /* Length of AEAD tag */
- struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
+ int key_length_octets; /* octets in key */
+ uint8_t *key; /* key */
+ uint8_t *idx; /* packet index */
+ int plaintext_length_octets; /* octets in plaintext */
+ uint8_t *plaintext; /* plaintext */
+ int ciphertext_length_octets; /* octets in plaintext */
+ uint8_t *ciphertext; /* ciphertext */
+ int aad_length_octets; /* octets in AAD */
+ uint8_t *aad; /* AAD */
+ int tag_length_octets; /* Length of AEAD tag */
+ struct cipher_test_case_t *next_test_case; /* pointer to next testcase */
} cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t {
- cipher_alloc_func_t alloc;
- cipher_dealloc_func_t dealloc;
- cipher_init_func_t init;
- cipher_set_aad_func_t set_aad;
- cipher_encrypt_func_t encrypt;
- cipher_encrypt_func_t decrypt;
- cipher_set_iv_func_t set_iv;
- cipher_get_tag_func_t get_tag;
- char *description;
- int ref_count;
- cipher_test_case_t *test_data;
- debug_module_t *debug;
- cipher_type_id_t id;
+ cipher_alloc_func_t alloc;
+ cipher_dealloc_func_t dealloc;
+ cipher_init_func_t init;
+ cipher_set_aad_func_t set_aad;
+ cipher_encrypt_func_t encrypt;
+ cipher_encrypt_func_t decrypt;
+ cipher_set_iv_func_t set_iv;
+ cipher_get_tag_func_t get_tag;
+ char *description;
+ int ref_count;
+ cipher_test_case_t *test_data;
+ debug_module_t *debug;
+ cipher_type_id_t id;
} cipher_type_t;
/*
@@ -176,10 +176,10 @@ typedef struct cipher_type_t {
*/
typedef struct cipher_t {
- cipher_type_t *type;
- void *state;
- int key_len;
- int algorithm;
+ cipher_type_t *type;
+ void *state;
+ int key_len;
+ int algorithm;
} cipher_t;
/* some syntactic sugar on these function types */
@@ -201,11 +201,11 @@ typedef struct cipher_t {
#define cipher_set_iv(c, n, dir) \
((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n), (dir))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
#define cipher_set_aad(c, a, l) \
(((c) && (((c)->type)->set_aad)) ? \
(((c)->type)->set_aad(((c)->state), (a), (l))) : \
- err_status_no_such_op)
+ err_status_no_such_op)
err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output);
@@ -217,9 +217,9 @@ int
cipher_get_key_length(const cipher_t *c);
-/*
- * cipher_type_self_test() tests a cipher against test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_self_test() tests a cipher against test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -227,9 +227,9 @@ err_status_t
cipher_type_self_test(const cipher_type_t *ct);
-/*
- * cipher_type_test() tests a cipher against external test cases provided in
- * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
+/*
+ * cipher_type_test() tests a cipher against external test cases provided in
+ * an array of values of key/xtd_seq_num_t/plaintext/ciphertext
* that is known to be good
*/
@@ -240,7 +240,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data);
/*
* cipher_bits_per_second(c, l, t) computes (and estimate of) the
* number of bits that a cipher implementation can encrypt in a second
- *
+ *
* c is a cipher (which MUST be allocated and initialized already), l
* is the length in octets of the test data to be encrypted, and t is
* the number of trials
diff --git a/thirdparties/wince/include/srtp/crypto.h b/thirdparties/wince/include/srtp/crypto.h
index 0e9667d..9d656fa 100755
--- a/thirdparties/wince/include/srtp/crypto.h
+++ b/thirdparties/wince/include/srtp/crypto.h
@@ -2,7 +2,7 @@
* crypto.h
*
* API for libcrypto
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -10,7 +10,7 @@
#ifndef CRYPTO_H
#define CRYPTO_H
-/**
+/**
* @brief A cipher_type_id_t is an identifier for a particular cipher
* type.
*
@@ -19,10 +19,10 @@
* NULL_CIPHER is avaliable; this cipher leaves the data unchanged,
* and can be selected to indicate that no encryption is to take
* place.
- *
+ *
* @ingroup Ciphers
*/
-typedef uint32_t cipher_type_id_t;
+typedef uint32_t cipher_type_id_t;
/**
* @brief An auth_type_id_t is an identifier for a particular authentication
@@ -33,7 +33,7 @@ typedef uint32_t cipher_type_id_t;
* avaliable; this authentication function performs no computation,
* and can be selected to indicate that no authentication is to take
* place.
- *
+ *
* @ingroup Authentication
*/
typedef uint32_t auth_type_id_t;
diff --git a/thirdparties/wince/include/srtp/crypto_kernel.h b/thirdparties/wince/include/srtp/crypto_kernel.h
index caccfa0..9e2c5f7 100755
--- a/thirdparties/wince/include/srtp/crypto_kernel.h
+++ b/thirdparties/wince/include/srtp/crypto_kernel.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -46,9 +46,9 @@
#ifndef CRYPTO_KERNEL
#define CRYPTO_KERNEL
-#include "rand_source.h"
+#include "rand_source.h"
#include "prng.h"
-#include "cipher.h"
+#include "cipher.h"
#include "auth.h"
#include "cryptoalg.h"
#include "stat.h"
@@ -65,37 +65,37 @@
*/
typedef enum {
- crypto_kernel_state_insecure,
- crypto_kernel_state_secure
+ crypto_kernel_state_insecure,
+ crypto_kernel_state_secure
} crypto_kernel_state_t;
-/*
- * linked list of cipher types
+/*
+ * linked list of cipher types
*/
typedef struct kernel_cipher_type {
- cipher_type_id_t id;
- cipher_type_t *cipher_type;
- struct kernel_cipher_type *next;
+ cipher_type_id_t id;
+ cipher_type_t *cipher_type;
+ struct kernel_cipher_type *next;
} kernel_cipher_type_t;
-/*
- * linked list of auth types
+/*
+ * linked list of auth types
*/
typedef struct kernel_auth_type {
- auth_type_id_t id;
- auth_type_t *auth_type;
- struct kernel_auth_type *next;
+ auth_type_id_t id;
+ auth_type_t *auth_type;
+ struct kernel_auth_type *next;
} kernel_auth_type_t;
/*
- * linked list of debug modules
+ * linked list of debug modules
*/
typedef struct kernel_debug_module {
- debug_module_t *mod;
- struct kernel_debug_module *next;
+ debug_module_t *mod;
+ struct kernel_debug_module *next;
} kernel_debug_module_t;
@@ -107,10 +107,10 @@ typedef struct kernel_debug_module {
*/
typedef struct {
- crypto_kernel_state_t state; /* current state of kernel */
- kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
- kernel_auth_type_t *auth_type_list; /* list of all auth func types */
- kernel_debug_module_t *debug_module_list; /* list of all debug modules */
+ crypto_kernel_state_t state; /* current state of kernel */
+ kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */
+ kernel_auth_type_t *auth_type_list; /* list of all auth func types */
+ kernel_debug_module_t *debug_module_list; /* list of all debug modules */
} crypto_kernel_t;
@@ -125,10 +125,10 @@ typedef struct {
* crypto algorithms. Possible return values are:
*
* err_status_ok initialization successful
- * <other> init failure
+ * <other> init failure
*
* If any value other than err_status_ok is returned, the
- * crypto_kernel MUST NOT be used.
+ * crypto_kernel MUST NOT be used.
*/
err_status_t
@@ -142,7 +142,7 @@ crypto_kernel_init(void);
* values are:
*
* err_status_ok shutdown successful
- * <other> shutdown failure
+ * <other> shutdown failure
*
*/
@@ -155,7 +155,7 @@ crypto_kernel_shutdown(void);
* status report. Possible return values are:
*
* err_status_ok all tests were passed
- * <other> a test failed
+ * <other> a test failed
*
*/
@@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id);
/*
* crypto_kernel_replace_cipher_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the cipher_type id
* with a new one passed in externally. The new cipher must pass all the
* existing cipher_type's self tests as well as its own.
@@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id);
/*
* crypto_kernel_replace_auth_type(ct, id)
- *
+ *
* replaces the crypto kernel's existing cipher for the auth_type id
* with a new one passed in externally. The new auth type must pass all the
* existing auth_type's self tests as well as its own.
@@ -208,44 +208,44 @@ err_status_t
crypto_kernel_load_debug_module(debug_module_t *new_dm);
/*
- * crypto_kernel_alloc_cipher(id, cp, key_len);
+ * crypto_kernel_alloc_cipher(id, cp, key_len);
*
* allocates a cipher of type id at location *cp, with key length
* key_len octets. Return values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find cipher with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_cipher(cipher_type_id_t id,
- cipher_pointer_t *cp,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_cipher(cipher_type_id_t id,
+ cipher_pointer_t *cp,
+ int key_len,
+ int tag_len);
/*
- * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
+ * crypto_kernel_alloc_auth(id, ap, key_len, tag_len);
*
* allocates an auth function of type id at location *ap, with key
* length key_len octets and output tag length of tag_len. Return
* values are:
- *
+ *
* err_status_ok no problems
* err_status_alloc_fail an allocation failure occured
* err_status_fail couldn't find auth with identifier 'id'
*/
err_status_t
-crypto_kernel_alloc_auth(auth_type_id_t id,
- auth_pointer_t *ap,
- int key_len,
- int tag_len);
+crypto_kernel_alloc_auth(auth_type_id_t id,
+ auth_pointer_t *ap,
+ int key_len,
+ int tag_len);
/*
* crypto_kernel_set_debug_module(mod_name, v)
- *
+ *
* sets dynamic debugging to the value v (0 for off, 1 for on) for the
* debug module with the name mod_name
*
@@ -262,7 +262,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
- *
+ *
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
@@ -277,5 +277,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v);
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);
-
+
#endif /* CRYPTO_KERNEL */
diff --git a/thirdparties/wince/include/srtp/crypto_math.h b/thirdparties/wince/include/srtp/crypto_math.h
index 52f0837..4de3912 100755
--- a/thirdparties/wince/include/srtp/crypto_math.h
+++ b/thirdparties/wince/include/srtp/crypto_math.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ hex_string_to_v64(char *s);
/* the matrix A[] is stored in column format, i.e., A[i] is
the ith column of the matrix */
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
void
@@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
-/*
+/*
* the matrix A[] is stored in column format, i.e., A[i] is the ith
* column of the matrix
*/
-uint8_t
+uint8_t
A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
@@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-
-#endif /* WORDS_BIGENDIAN */
+
+#endif /* WORDS_BIGENDIAN */
#endif
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
@@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -202,7 +202,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -211,10 +211,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
diff --git a/thirdparties/wince/include/srtp/crypto_types.h b/thirdparties/wince/include/srtp/crypto_types.h
index dbb50c3..0699862 100755
--- a/thirdparties/wince/include/srtp/crypto_types.h
+++ b/thirdparties/wince/include/srtp/crypto_types.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006,2013 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -57,14 +57,14 @@
* (UST) must be used in conjunction with a cipher other than the null
* cipher. These functions require a per-message pseudorandom input
* that is generated by the cipher.
- *
+ *
* The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the
* strongest available authentication function and cipher,
* respectively. They are resolved at compile time to the strongest
* available algorithm. The stronghold algorithms can serve as did
* the keep of a medieval fortification; they provide the strongest
* defense (or the last refuge).
- *
+ *
* @{
*/
@@ -72,7 +72,7 @@
* @defgroup Ciphers Cipher Types
*
* @brief Each cipher type is identified by an unsigned integer. The
- * cipher types available in this edition of libSRTP are given
+ * cipher types available in this edition of libSRTP are given
* by the #defines below.
*
* A cipher_type_id_t is an identifier for a cipher_type; only values
@@ -90,84 +90,84 @@
/**
* @brief The null cipher performs no encryption.
*
- * The NULL_CIPHER leaves its inputs unaltered, during both the
+ * The NULL_CIPHER leaves its inputs unaltered, during both the
* encryption and decryption operations. This cipher can be chosen
* to indicate that no encryption is to be performed.
*/
-#define NULL_CIPHER 0
+#define NULL_CIPHER 0
-/**
- * @brief AES Integer Counter Mode (AES ICM)
+/**
+ * @brief AES Integer Counter Mode (AES ICM)
*
- * AES ICM is the variant of counter mode that is used by Secure RTP.
+ * AES ICM is the variant of counter mode that is used by Secure RTP.
* This cipher uses a 16-, 24-, or 32-octet key concatenated with a
* 14-octet offset (or salt) value.
*/
-#define AES_ICM 1
+#define AES_ICM 1
-/**
- * @brief AES-128 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-128 Integer Counter Mode (AES ICM)
* AES-128 ICM is a deprecated alternate name for AES ICM.
*/
#define AES_128_ICM AES_ICM
/**
- * @brief SEAL 3.0
- *
+ * @brief SEAL 3.0
+ *
* SEAL is the Software-Optimized Encryption Algorithm of Coppersmith
* and Rogaway. Nota bene: this cipher is IBM proprietary.
*/
-#define SEAL 2
+#define SEAL 2
-/**
- * @brief AES Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES Cipher Block Chaining mode (AES CBC)
*
* AES CBC is the AES Cipher Block Chaining mode.
* This cipher uses a 16-, 24-, or 32-octet key.
*/
-#define AES_CBC 3
+#define AES_CBC 3
-/**
- * @brief AES-128 Cipher Block Chaining mode (AES CBC)
+/**
+ * @brief AES-128 Cipher Block Chaining mode (AES CBC)
*
* AES-128 CBC is a deprecated alternate name for AES CBC.
*/
-#define AES_128_CBC AES_CBC
+#define AES_128_CBC AES_CBC
/**
* @brief Strongest available cipher.
*
* This identifier resolves to the strongest cipher type available.
*/
-#define STRONGHOLD_CIPHER AES_ICM
+#define STRONGHOLD_CIPHER AES_ICM
-/**
- * @brief AES-192 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-192 Integer Counter Mode (AES ICM)
* AES-192 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_192_ICM 4
+#define AES_192_ICM 4
-/**
- * @brief AES-256 Integer Counter Mode (AES ICM)
+/**
+ * @brief AES-256 Integer Counter Mode (AES ICM)
* AES-256 ICM is a deprecated alternate name for AES ICM.
*/
-#define AES_256_ICM 5
+#define AES_256_ICM 5
-/**
- * @brief AES-128_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-128_GCM Galois Counter Mode (AES GCM)
*
- * AES-128 GCM is the variant of galois counter mode that is used by
+ * AES-128 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 16-octet key.
*/
-#define AES_128_GCM 6
+#define AES_128_GCM 6
-/**
- * @brief AES-256_GCM Galois Counter Mode (AES GCM)
+/**
+ * @brief AES-256_GCM Galois Counter Mode (AES GCM)
*
- * AES-256 GCM is the variant of galois counter mode that is used by
+ * AES-256 GCM is the variant of galois counter mode that is used by
* Secure RTP. This cipher uses a 32-octet key.
*/
-#define AES_256_GCM 7
+#define AES_256_GCM 7
/**
* @}
@@ -177,14 +177,14 @@
/**
* @defgroup Authentication Authentication Function Types
- *
+ *
* @brief Each authentication function type is identified by an
* unsigned integer. The authentication function types available in
* this edition of libSRTP are given by the #defines below.
*
* An auth_type_id_t is an identifier for an authentication function type;
- * only values given by the #defines above (or those present in the
- * file crypto_types.h) should be used.
+ * only values given by the #defines above (or those present in the
+ * file crypto_types.h) should be used.
*
* The identifier STRONGHOLD_AUTH indicates the strongest available
* authentication function, allowing an application to choose the
@@ -201,8 +201,8 @@
*
* The NULL_AUTH function does nothing, and can be selected to indicate
* that authentication should not be performed.
- */
-#define NULL_AUTH 0
+ */
+#define NULL_AUTH 0
/**
* @brief UST with TMMH Version 2
@@ -212,15 +212,15 @@
* than the null cipher.
* with a cipher.
*/
-#define UST_TMMHv2 1
+#define UST_TMMHv2 1
/**
- * @brief (UST) AES-128 XORMAC
+ * @brief (UST) AES-128 XORMAC
*
* UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene:
* the XORMAC algorithm is IBM proprietary.
*/
-#define UST_AES_128_XMAC 2
+#define UST_AES_128_XMAC 2
/**
* @brief HMAC-SHA1
@@ -228,7 +228,7 @@
* HMAC_SHA1 implements the Hash-based MAC using the NIST Secure
* Hash Algorithm version 1 (SHA1).
*/
-#define HMAC_SHA1 3
+#define HMAC_SHA1 3
/**
* @brief Strongest available authentication function.
@@ -236,7 +236,7 @@
* This identifier resolves to the strongest available authentication
* function.
*/
-#define STRONGHOLD_AUTH HMAC_SHA1
+#define STRONGHOLD_AUTH HMAC_SHA1
/**
* @}
diff --git a/thirdparties/wince/include/srtp/cryptoalg.h b/thirdparties/wince/include/srtp/cryptoalg.h
index d9f0441..ad29fa0 100755
--- a/thirdparties/wince/include/srtp/cryptoalg.h
+++ b/thirdparties/wince/include/srtp/cryptoalg.h
@@ -2,31 +2,31 @@
* cryptoalg.h
*
* API for authenticated encryption crypto algorithms
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -61,10 +61,10 @@
* The function pointer cryptoalg_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated but not encrypted
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated but not encrypted
*
* @param clear_len length of data to be authenticated but not encrypted
*
@@ -79,34 +79,34 @@
* length of the ciphertext (after the call)
*
*/
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- const void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len);
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ const void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- const void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ const void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
@@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t;
int
cryptoalg_get_id(cryptoalg_t c);
-cryptoalg_t
+cryptoalg_t
cryptoalg_find_by_id(int id);
diff --git a/thirdparties/wince/include/srtp/datatypes.h b/thirdparties/wince/include/srtp/datatypes.h
index 4630208..6c23c50 100755
--- a/thirdparties/wince/include/srtp/datatypes.h
+++ b/thirdparties/wince/include/srtp/datatypes.h
@@ -1,6 +1,6 @@
/*
* datatypes.h
- *
+ *
* data types for bit vectors and finite fields
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -65,31 +65,31 @@
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
-#define DATATYPES_USE_MACROS
+#define DATATYPES_USE_MACROS
typedef union {
- uint8_t v8[2];
- uint16_t value;
+ uint8_t v8[2];
+ uint16_t value;
} v16_t;
typedef union {
- uint8_t v8[4];
- uint16_t v16[2];
- uint32_t value;
+ uint8_t v8[4];
+ uint16_t v16[2];
+ uint32_t value;
} v32_t;
typedef union {
- uint8_t v8[8];
- uint16_t v16[4];
- uint32_t v32[2];
- uint64_t value;
+ uint8_t v8[8];
+ uint16_t v16[4];
+ uint32_t v32[2];
+ uint64_t value;
} v64_t;
typedef union {
- uint8_t v8[16];
- uint16_t v16[8];
- uint32_t v32[4];
- uint64_t v64[2];
+ uint8_t v8[16];
+ uint16_t v16[8];
+ uint32_t v32[4];
+ uint64_t v64[2];
} v128_t;
typedef union {
@@ -168,7 +168,7 @@ v128_right_shift(v128_t *x, int shift_index);
/*
* the following macros define the data manipulation functions
- *
+ *
* If DATATYPES_USE_MACROS is defined, then these macros are used
* directly (and function call overhead is avoided). Otherwise,
* the macros are used through the functions defined in datatypes.c
@@ -315,18 +315,18 @@ v128_right_shift(v128_t *x, int shift_index);
+ htonl(tmp >> 32); \
z->v32[0] = ntohl((uint32_t) tmp); \
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* 0 */
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
#define v128_and(z, x, y) _v128_and(z, x, y)
#define v128_or(z, x, y) _v128_or(z, x, y)
-#define v128_complement(x) _v128_complement(x)
+#define v128_complement(x) _v128_complement(x)
#define v128_is_eq(x, y) _v128_is_eq(x, y)
#define v128_xor_eq(x, y) _v128_xor_eq(x, y)
#define v128_get_bit(x, i) _v128_get_bit(x, i)
@@ -352,7 +352,7 @@ void
v128_and(v128_t *z, v128_t *x, v128_t *y);
void
-v128_or(v128_t *z, v128_t *x, v128_t *y);
+v128_or(v128_t *z, v128_t *x, v128_t *y);
void
v128_complement(v128_t *x);
@@ -361,10 +361,10 @@ int
v128_get_bit(const v128_t *x, int i);
void
-v128_set_bit(v128_t *x, int i) ;
+v128_set_bit(v128_t *x, int i) ;
void
-v128_clear_bit(v128_t *x, int i);
+v128_clear_bit(v128_t *x, int i);
void
v128_set_bit_to(v128_t *x, int i, int y);
@@ -385,7 +385,7 @@ octet_string_set_to_zero(uint8_t *s, int len);
#ifndef SRTP_KERNEL_LINUX
-/*
+/*
* Convert big endian integers to CPU byte order.
*/
#ifdef WORDS_BIGENDIAN
@@ -401,10 +401,11 @@ octet_string_set_to_zero(uint8_t *s, int len);
#if defined(__GNUC__) && defined(HAVE_X86)
/* Fall back. */
-static __inline uint32_t be32_to_cpu(uint32_t v) {
- /* optimized for x86. */
- asm("bswap %0" : "=r" (v) : "0" (v));
- return v;
+static __inline uint32_t be32_to_cpu(uint32_t v)
+{
+ /* optimized for x86. */
+ asm("bswap %0" : "=r" (v) : "0" (v));
+ return v;
}
# else /* HAVE_X86 */
# ifdef HAVE_NETINET_IN_H
@@ -415,15 +416,16 @@ static __inline uint32_t be32_to_cpu(uint32_t v) {
# define be32_to_cpu(x) ntohl((x))
# endif /* HAVE_X86 */
-static __inline uint64_t be64_to_cpu(uint64_t v) {
+static __inline uint64_t be64_to_cpu(uint64_t v)
+{
# ifdef NO_64BIT_MATH
- /* use the make64 functions to do 64-bit math */
- v = make64(htonl(low32(v)),htonl(high32(v)));
+ /* use the make64 functions to do 64-bit math */
+ v = make64(htonl(low32(v)),htonl(high32(v)));
# else
- /* use the native 64-bit math */
- v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
+ /* use the native 64-bit math */
+ v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32));
# endif
- return v;
+ return v;
}
#endif /* ! SRTP_KERNEL_LINUX */
@@ -431,22 +433,22 @@ static __inline uint64_t be64_to_cpu(uint64_t v) {
#endif /* WORDS_BIGENDIAN */
/*
- * functions manipulating bitvector_t
+ * functions manipulating bitvector_t
*
* A bitvector_t consists of an array of words and an integer
* representing the number of significant bits stored in the array.
* The bits are packed as follows: the least significant bit is that
* of word[0], while the most significant bit is the nth most
* significant bit of word[m], where length = bits_per_word * m + n.
- *
+ *
*/
#define bits_per_word 32
#define bytes_per_word 4
typedef struct {
- uint32_t length;
- uint32_t *word;
+ uint32_t length;
+ uint32_t *word;
} bitvector_t;
diff --git a/thirdparties/wince/include/srtp/err.h b/thirdparties/wince/include/srtp/err.h
index e54514d..ff3d492 100755
--- a/thirdparties/wince/include/srtp/err.h
+++ b/thirdparties/wince/include/srtp/err.h
@@ -1,32 +1,32 @@
/*
* err.h
- *
+ *
* error status codes
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,9 +50,9 @@
/**
* @defgroup Error Error Codes
- *
+ *
* Error status codes are represented by the enumeration err_status_t.
- *
+ *
* @{
*/
@@ -66,31 +66,31 @@
*
*/
typedef enum {
- err_status_ok = 0, /**< nothing to report */
- err_status_fail = 1, /**< unspecified failure */
- err_status_bad_param = 2, /**< unsupported parameter */
- err_status_alloc_fail = 3, /**< couldn't allocate memory */
- err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
- err_status_init_fail = 5, /**< couldn't initialize */
- err_status_terminus = 6, /**< can't process as much data as requested */
- err_status_auth_fail = 7, /**< authentication failure */
- err_status_cipher_fail = 8, /**< cipher failure */
- err_status_replay_fail = 9, /**< replay check failed (bad index) */
- err_status_replay_old = 10, /**< replay check failed (index too old) */
- err_status_algo_fail = 11, /**< algorithm failed test routine */
- err_status_no_such_op = 12, /**< unsupported operation */
- err_status_no_ctx = 13, /**< no appropriate context found */
- err_status_cant_check = 14, /**< unable to perform desired validation */
- err_status_key_expired = 15, /**< can't use key any more */
- err_status_socket_err = 16, /**< error in use of socket */
- err_status_signal_err = 17, /**< error in use POSIX signals */
- err_status_nonce_bad = 18, /**< nonce check failed */
- err_status_read_fail = 19, /**< couldn't read data */
- err_status_write_fail = 20, /**< couldn't write data */
- err_status_parse_err = 21, /**< error parsing data */
- err_status_encode_err = 22, /**< error encoding data */
- err_status_semaphore_err = 23,/**< error while using semaphores */
- err_status_pfkey_err = 24 /**< error while using pfkey */
+ err_status_ok = 0, /**< nothing to report */
+ err_status_fail = 1, /**< unspecified failure */
+ err_status_bad_param = 2, /**< unsupported parameter */
+ err_status_alloc_fail = 3, /**< couldn't allocate memory */
+ err_status_dealloc_fail = 4, /**< couldn't deallocate properly */
+ err_status_init_fail = 5, /**< couldn't initialize */
+ err_status_terminus = 6, /**< can't process as much data as requested */
+ err_status_auth_fail = 7, /**< authentication failure */
+ err_status_cipher_fail = 8, /**< cipher failure */
+ err_status_replay_fail = 9, /**< replay check failed (bad index) */
+ err_status_replay_old = 10, /**< replay check failed (index too old) */
+ err_status_algo_fail = 11, /**< algorithm failed test routine */
+ err_status_no_such_op = 12, /**< unsupported operation */
+ err_status_no_ctx = 13, /**< no appropriate context found */
+ err_status_cant_check = 14, /**< unable to perform desired validation */
+ err_status_key_expired = 15, /**< can't use key any more */
+ err_status_socket_err = 16, /**< error in use of socket */
+ err_status_signal_err = 17, /**< error in use POSIX signals */
+ err_status_nonce_bad = 18, /**< nonce check failed */
+ err_status_read_fail = 19, /**< couldn't read data */
+ err_status_write_fail = 20, /**< couldn't write data */
+ err_status_parse_err = 21, /**< error parsing data */
+ err_status_encode_err = 22, /**< error encoding data */
+ err_status_semaphore_err = 23,/**< error while using semaphores */
+ err_status_pfkey_err = 24 /**< error while using pfkey */
} err_status_t;
/**
@@ -98,15 +98,15 @@ typedef enum {
*/
typedef enum {
- err_level_emergency = 0,
- err_level_alert,
- err_level_critical,
- err_level_error,
- err_level_warning,
- err_level_notice,
- err_level_info,
- err_level_debug,
- err_level_none
+ err_level_emergency = 0,
+ err_level_alert,
+ err_level_critical,
+ err_level_error,
+ err_level_warning,
+ err_level_notice,
+ err_level_info,
+ err_level_debug,
+ err_level_none
} err_reporting_level_t;
/*
@@ -144,8 +144,8 @@ err_report(int priority, char *format, ...);
*/
typedef struct {
- int on; /* 1 if debugging is on, 0 if it is off */
- char *name; /* printable name for debug module */
+ int on; /* 1 if debugging is on, 0 if it is off */
+ char *name; /* printable name for debug module */
} debug_module_t;
#ifdef ENABLE_DEBUGGING
diff --git a/thirdparties/wince/include/srtp/gf2_8.h b/thirdparties/wince/include/srtp/gf2_8.h
index 098d37c..bbbabdf 100755
--- a/thirdparties/wince/include/srtp/gf2_8.h
+++ b/thirdparties/wince/include/srtp/gf2_8.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -54,13 +54,13 @@ typedef uint8_t gf2_8;
#define gf2_8_field_polynomial 0x1B
/*
- * gf2_8_shift(x) returns
+ * gf2_8_shift(x) returns
*/
/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
+ * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
+ * operation, using the field representation from AES; that is, the
+ * next gf2_8 value in the cyclic representation of that field. The
* value z should be an uint8_t.
*/
diff --git a/thirdparties/wince/include/srtp/hmac.h b/thirdparties/wince/include/srtp/hmac.h
index 875f45c..a1639bf 100755
--- a/thirdparties/wince/include/srtp/hmac.h
+++ b/thirdparties/wince/include/srtp/hmac.h
@@ -8,26 +8,26 @@
*
*/
/*
- *
+ *
* Copyright (c) 2001-2006,2013, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,12 +50,12 @@
#include "sha1.h"
typedef struct {
- uint8_t opad[64];
- sha1_ctx_t ctx;
- sha1_ctx_t init_ctx;
+ uint8_t opad[64];
+ sha1_ctx_t ctx;
+ sha1_ctx_t init_ctx;
#ifdef OPENSSL
- int ctx_initialized;
- int init_ctx_initialized;
+ int ctx_initialized;
+ int init_ctx_initialized;
#endif
} hmac_ctx_t;
@@ -76,7 +76,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets);
err_status_t
hmac_compute(hmac_ctx_t *state, const void *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* HMAC_H */
diff --git a/thirdparties/wince/include/srtp/integers.h b/thirdparties/wince/include/srtp/integers.h
index 7010efd..91935eb 100755
--- a/thirdparties/wince/include/srtp/integers.h
+++ b/thirdparties/wince/include/srtp/integers.h
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -125,7 +125,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \
(((unsigned char *) (addr))[1] << 16) | \
(((unsigned char *) (addr))[2] << 8) | \
- (((unsigned char *) (addr))[3]))
+ (((unsigned char *) (addr))[3]))
#else
#define PUT_32(addr,value) \
{ \
@@ -137,7 +137,7 @@ extern uint32_t low32(uint64_t value);
#define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \
(((unsigned char *) (addr))[2] << 16) | \
(((unsigned char *) (addr))[1] << 8) | \
- (((unsigned char *) (addr))[0]))
+ (((unsigned char *) (addr))[0]))
#endif // WORDS_BIGENDIAN
#else
#define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value)
diff --git a/thirdparties/wince/include/srtp/kernel_compat.h b/thirdparties/wince/include/srtp/kernel_compat.h
index 0d4052e..e559b20 100755
--- a/thirdparties/wince/include/srtp/kernel_compat.h
+++ b/thirdparties/wince/include/srtp/kernel_compat.h
@@ -1,6 +1,6 @@
/*
* kernel_compat.h
- *
+ *
* Compatibility stuff for building in kernel context where standard
* C headers and library are not available.
*
@@ -8,26 +8,26 @@
* Ingate Systems AB
*/
/*
- *
+ *
* Copyright(c) 2005 Ingate Systems AB
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the author(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -70,9 +70,9 @@
static __inline int rand(void)
{
- uint32_t temp;
- get_random_bytes(&temp, sizeof(temp));
- return temp % (RAND_MAX+1);
+ uint32_t temp;
+ get_random_bytes(&temp, sizeof(temp));
+ return temp % (RAND_MAX+1);
}
/* stdio/stdlib implementation. */
diff --git a/thirdparties/wince/include/srtp/key.h b/thirdparties/wince/include/srtp/key.h
index e7e0744..340547f 100755
--- a/thirdparties/wince/include/srtp/key.h
+++ b/thirdparties/wince/include/srtp/key.h
@@ -2,31 +2,31 @@
* key.h
*
* key usage limits enforcement
- *
+ *
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -51,9 +51,9 @@
typedef struct key_limit_ctx_t *key_limit_t;
typedef enum {
- key_event_normal,
- key_event_soft_limit,
- key_event_hard_limit
+ key_event_normal,
+ key_event_soft_limit,
+ key_event_hard_limit
} key_event_t;
err_status_t
@@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key);
key_event_t
key_limit_update(key_limit_t key);
-typedef enum {
- key_state_normal,
- key_state_past_soft_limit,
- key_state_expired
+typedef enum {
+ key_state_normal,
+ key_state_past_soft_limit,
+ key_state_expired
} key_state_t;
typedef struct key_limit_ctx_t {
- xtd_seq_num_t num_left;
- key_state_t state;
+ xtd_seq_num_t num_left;
+ key_state_t state;
} key_limit_ctx_t;
#endif /* KEY_H */
diff --git a/thirdparties/wince/include/srtp/null_auth.h b/thirdparties/wince/include/srtp/null_auth.h
index 44f9a4a..54c0296 100755
--- a/thirdparties/wince/include/srtp/null_auth.h
+++ b/thirdparties/wince/include/srtp/null_auth.h
@@ -7,26 +7,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -48,7 +48,7 @@
#include "auth.h"
typedef struct {
- char foo;
+ char foo;
} null_auth_ctx_t;
err_status_t
@@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len);
err_status_t
null_auth_compute (null_auth_ctx_t *state, uint8_t *message,
- int msg_octets, int tag_len, uint8_t *result);
+ int msg_octets, int tag_len, uint8_t *result);
#endif /* NULL_AUTH_H */
diff --git a/thirdparties/wince/include/srtp/null_cipher.h b/thirdparties/wince/include/srtp/null_cipher.h
index 39da59a..63d272d 100755
--- a/thirdparties/wince/include/srtp/null_cipher.h
+++ b/thirdparties/wince/include/srtp/null_cipher.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -52,7 +52,7 @@
#include "cipher.h"
typedef struct {
- char foo ;/* empty, for now */
+ char foo ;/* empty, for now */
} null_cipher_ctx_t;
@@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len);
err_status_t
null_cipher_set_segment(null_cipher_ctx_t *c,
- unsigned long segment_index);
+ unsigned long segment_index);
err_status_t
null_cipher_encrypt(null_cipher_ctx_t *c,
- unsigned char *buf, unsigned int *bytes_to_encr);
+ unsigned char *buf, unsigned int *bytes_to_encr);
err_status_t
null_cipher_encrypt_aligned(null_cipher_ctx_t *c,
- unsigned char *buf, int bytes_to_encr);
+ unsigned char *buf, int bytes_to_encr);
#endif /* NULL_CIPHER_H */
diff --git a/thirdparties/wince/include/srtp/prng.h b/thirdparties/wince/include/srtp/prng.h
index c493383..b59ea63 100755
--- a/thirdparties/wince/include/srtp/prng.h
+++ b/thirdparties/wince/include/srtp/prng.h
@@ -26,10 +26,10 @@
*/
typedef struct {
- v128_t state; /* state data */
- aes_expanded_key_t key; /* secret key */
- uint32_t octet_count; /* number of octets output since last init */
- rand_source_func_t rand; /* random source for re-initialization */
+ v128_t state; /* state data */
+ aes_expanded_key_t key; /* secret key */
+ uint32_t octet_count; /* number of octets output since last init */
+ rand_source_func_t rand; /* random source for re-initialization */
} x917_prng_t;
err_status_t
@@ -44,9 +44,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
*/
typedef struct {
- uint32_t octet_count; /* number of octets output since last init */
- aes_icm_ctx_t state; /* state data */
- rand_source_func_t rand; /* random source for re-initialization */
+ uint32_t octet_count; /* number of octets output since last init */
+ aes_icm_ctx_t state; /* state data */
+ rand_source_func_t rand; /* random source for re-initialization */
} ctr_prng_t;
err_status_t
diff --git a/thirdparties/wince/include/srtp/rand_source.h b/thirdparties/wince/include/srtp/rand_source.h
index b4c2110..d2e52ce 100755
--- a/thirdparties/wince/include/srtp/rand_source.h
+++ b/thirdparties/wince/include/srtp/rand_source.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -60,7 +60,7 @@ rand_source_init(void);
* and returns an error code. This error code should be checked,
* and if a failure is reported, the data in the buffer MUST NOT
* be used.
- *
+ *
* warning: If the return code is not checked, then non-random
* data may inadvertently be used.
*
@@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length);
err_status_t
rand_source_deinit(void);
-/*
+/*
* function prototype for a random source function
*
* A rand_source_func_t writes num_octets at the location indicated by
@@ -86,6 +86,6 @@ rand_source_deinit(void);
*/
typedef err_status_t (*rand_source_func_t)
- (void *dest, uint32_t num_octets);
+(void *dest, uint32_t num_octets);
#endif /* RAND_SOURCE */
diff --git a/thirdparties/wince/include/srtp/rdb.h b/thirdparties/wince/include/srtp/rdb.h
index 2ccb144..2432fae 100755
--- a/thirdparties/wince/include/srtp/rdb.h
+++ b/thirdparties/wince/include/srtp/rdb.h
@@ -21,11 +21,11 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
} rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8*sizeof(v128_t))
/*
* rdb init
@@ -49,7 +49,7 @@ rdb_init(rdb_t *rdb);
*/
err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+rdb_check(const rdb_t *rdb, uint32_t rdb_index);
/*
* rdb_add_index
@@ -64,18 +64,18 @@ err_status_t
rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions rdb_increment() and rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
* rdb_t upon which rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
+ *
* err_status_ok no problem
* err_status_key_expired sequence number too high
*
@@ -91,4 +91,4 @@ uint32_t
rdb_get_value(const rdb_t *rdb);
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
diff --git a/thirdparties/wince/include/srtp/rdbx.h b/thirdparties/wince/include/srtp/rdbx.h
index 146fb42..88055c2 100755
--- a/thirdparties/wince/include/srtp/rdbx.h
+++ b/thirdparties/wince/include/srtp/rdbx.h
@@ -14,7 +14,7 @@
#include "datatypes.h"
#include "err.h"
-/* #define ROC_TEST */
+/* #define ROC_TEST */
#ifndef ROC_TEST
@@ -33,7 +33,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
- * sequence number.
+ * sequence number.
*/
typedef uint64_t xtd_seq_num_t;
@@ -45,8 +45,8 @@ typedef uint64_t xtd_seq_num_t;
*/
typedef struct {
- xtd_seq_num_t index;
- bitvector_t bitmask;
+ xtd_seq_num_t index;
+ bitvector_t bitmask;
} rdbx_t;
@@ -73,7 +73,7 @@ rdbx_dealloc(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
- *
+ *
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
@@ -82,8 +82,8 @@ rdbx_dealloc(rdbx_t *rdbx);
int
rdbx_estimate_index(const rdbx_t *rdbx,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
@@ -98,7 +98,7 @@ rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
- *
+ *
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
@@ -116,7 +116,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta);
* to have the rollover counter value roc. If that value is less than
* the current rollover counter value, then the function returns
* err_status_replay_old; otherwise, err_status_ok is returned.
- *
+ *
*/
err_status_t
@@ -125,7 +125,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc);
/*
* rdbx_get_roc(rdbx) returns the value of the rollover counter for
* the rdbx_t pointed to by rdbx
- *
+ *
*/
xtd_seq_num_t
@@ -160,7 +160,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
- *
+ *
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
@@ -170,8 +170,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s);
int
index_guess(const xtd_seq_num_t *local,
- xtd_seq_num_t *guess,
- sequence_number_t s);
+ xtd_seq_num_t *guess,
+ sequence_number_t s);
#endif /* RDBX_H */
diff --git a/thirdparties/wince/include/srtp/rtp.h b/thirdparties/wince/include/srtp/rtp.h
index 0e0119c..9b97ab6 100755
--- a/thirdparties/wince/include/srtp/rtp.h
+++ b/thirdparties/wince/include/srtp/rtp.h
@@ -1,6 +1,6 @@
/*
* rtp.h
- *
+ *
* rtp interface for srtp reference implementation
*
* David A. McGrew
@@ -15,26 +15,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -73,12 +73,12 @@ int
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
int
-rtp_receiver_init(rtp_receiver_t rcvr, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_receiver_init(rtp_receiver_t rcvr, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
int
-rtp_sender_init(rtp_sender_t sender, int sock,
- struct sockaddr_in addr, unsigned int ssrc);
+rtp_sender_init(rtp_sender_t sender, int sock,
+ struct sockaddr_in addr, unsigned int ssrc);
/*
* srtp_sender_init(...) initializes an rtp_sender_t
@@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
- struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
- unsigned char *input_key /* master key/salt in hex */
- );
+ struct sockaddr_in name, /* socket name */
+ sec_serv_t security_services, /* sec. servs. to be used */
+ unsigned char *input_key /* master key/salt in hex */
+ );
int
@@ -112,13 +112,13 @@ int
rtp_receiver_deinit_srtp(rtp_receiver_t sender);
-rtp_sender_t
+rtp_sender_t
rtp_sender_alloc(void);
void
rtp_sender_dealloc(rtp_sender_t rtp_ctx);
-rtp_receiver_t
+rtp_receiver_t
rtp_receiver_alloc(void);
void
@@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
*/
#define RTP_HEADER_LEN 12
-/*
+/*
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
*/
#define RTP_MAX_BUF_LEN 16384
diff --git a/thirdparties/wince/include/srtp/sha1.h b/thirdparties/wince/include/srtp/sha1.h
index eb83684..5878d51 100755
--- a/thirdparties/wince/include/srtp/sha1.h
+++ b/thirdparties/wince/include/srtp/sha1.h
@@ -9,26 +9,26 @@
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -88,17 +88,17 @@ void __inline sha1_final (sha1_ctx_t *ctx, uint32_t *output)
#include "datatypes.h"
typedef struct {
- uint32_t H[5]; /* state vector */
- uint32_t M[16]; /* message buffer */
- int octets_in_buffer; /* octets of message in buffer */
- uint32_t num_bits_in_msg; /* total number of bits in message */
+ uint32_t H[5]; /* state vector */
+ uint32_t M[16]; /* message buffer */
+ int octets_in_buffer; /* octets of message in buffer */
+ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/*
* sha1(&ctx, msg, len, output) hashes the len octets starting at msg
* into the SHA1 context, then writes the result to the 20 octets at
* output
- *
+ *
*/
void
@@ -106,10 +106,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/*
* sha1_init(&ctx) initializes the SHA1 context ctx
- *
+ *
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
- *
+ *
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
@@ -127,7 +127,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
- * setup algorithm.
+ * setup algorithm.
*/
/*
@@ -143,5 +143,5 @@ void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
#endif /* else OPENSSL */
-
+
#endif /* SHA1_H */
diff --git a/thirdparties/wince/include/srtp/srtp.h b/thirdparties/wince/include/srtp/srtp.h
index 11ea33d..4e0a7c5 100755
--- a/thirdparties/wince/include/srtp/srtp.h
+++ b/thirdparties/wince/include/srtp/srtp.h
@@ -7,26 +7,26 @@
* Cisco Systems, Inc.
*/
/*
- *
+ *
* Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -50,7 +50,7 @@
extern "C" {
#endif
-#include "crypto_kernel.h"
+#include "crypto_kernel.h"
/**
* @defgroup SRTP Secure RTP
@@ -76,7 +76,7 @@ extern "C" {
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
-#define SRTP_MAX_TAG_LEN 12
+#define SRTP_MAX_TAG_LEN 12
/**
* SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer
@@ -86,10 +86,10 @@ extern "C" {
*
* @brief the maximum number of octets added by srtp_protect().
*/
-#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
+#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN
/*
- * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
+ * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
* GCM mode. GCM mode requires an IV. The SALT value is used
* as part of the IV formation logic applied to each RTP packet.
*/
@@ -99,83 +99,84 @@ extern "C" {
#define AES_256_GCM_KEYSIZE_WSALT SRTP_AEAD_SALT_LEN + 32
-/*
+/*
* nota bene: since libSRTP doesn't support the use of the MKI, the
* SRTP_MAX_TRAILER_LEN value is just the maximum tag length
*/
/**
- * @brief sec_serv_t describes a set of security services.
+ * @brief sec_serv_t describes a set of security services.
*
* A sec_serv_t enumeration is used to describe the particular
* security services that will be applied by a particular crypto
- * policy (or other mechanism).
+ * policy (or other mechanism).
*/
typedef enum {
- sec_serv_none = 0, /**< no services */
- sec_serv_conf = 1, /**< confidentiality */
- sec_serv_auth = 2, /**< authentication */
- sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
-} sec_serv_t;
+ sec_serv_none = 0, /**< no services */
+ sec_serv_conf = 1, /**< confidentiality */
+ sec_serv_auth = 2, /**< authentication */
+ sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */
+}
+sec_serv_t;
-/**
+/**
* @brief crypto_policy_t describes a particular crypto policy that
* can be applied to an SRTP stream.
*
* A crypto_policy_t describes a particular cryptographic policy that
* can be applied to an SRTP or SRTCP stream. An SRTP session policy
- * consists of a list of these policies, one for each SRTP stream
+ * consists of a list of these policies, one for each SRTP stream
* in the session.
*/
typedef struct crypto_policy_t {
- cipher_type_id_t cipher_type; /**< An integer representing
+ cipher_type_id_t cipher_type; /**< An integer representing
* the type of cipher. */
- int cipher_key_len; /**< The length of the cipher key
+ int cipher_key_len; /**< The length of the cipher key
* in octets. */
- auth_type_id_t auth_type; /**< An integer representing the
+ auth_type_id_t auth_type; /**< An integer representing the
* authentication function. */
- int auth_key_len; /**< The length of the authentication
+ int auth_key_len; /**< The length of the authentication
* function key in octets. */
- int auth_tag_len; /**< The length of the authentication
+ int auth_tag_len; /**< The length of the authentication
* tag in octets. */
- sec_serv_t sec_serv; /**< The flag indicating the security
+ sec_serv_t sec_serv; /**< The flag indicating the security
* services to be applied. */
} crypto_policy_t;
-/**
+/**
* @brief ssrc_type_t describes the type of an SSRC.
- *
+ *
* An ssrc_type_t enumeration is used to indicate a type of SSRC. See
* @ref srtp_policy_t for more informataion.
*/
-typedef enum {
- ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
- ssrc_specific = 1, /**< Indicates a specific SSRC value */
- ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
+typedef enum {
+ ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */
+ ssrc_specific = 1, /**< Indicates a specific SSRC value */
+ ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value
(i.e. a value that is used in the
function srtp_unprotect()) */
- ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
- (i.e. a value that is used in the
+ ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value
+ (i.e. a value that is used in the
function srtp_protect()) */
} ssrc_type_t;
/**
* @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
- *
+ *
* An ssrc_t represents a particular SSRC value (if its type is
* ssrc_specific), or a wildcard SSRC value that will match all
* outbound SSRCs (if its type is ssrc_any_outbound) or all inbound
- * SSRCs (if its type is ssrc_any_inbound).
+ * SSRCs (if its type is ssrc_any_inbound).
*
*/
-typedef struct {
- ssrc_type_t type; /**< The type of this particular SSRC */
- unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
+typedef struct {
+ ssrc_type_t type; /**< The type of this particular SSRC */
+ unsigned int value; /**< The value of this SSRC, if it is not a wildcard */
} ssrc_t;
@@ -191,8 +192,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t;
typedef struct ekt_stream_ctx_t *ekt_stream_t;
-/**
- * @brief represents the policy for an SRTP session.
+/**
+ * @brief represents the policy for an SRTP session.
*
* A single srtp_policy_t struct represents the policy for a single
* SRTP stream, and a linked list of these elements represents the
@@ -201,7 +202,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* master key for that stream, the SSRC describing that stream, or a
* flag indicating a `wildcard' SSRC value, and a `next' field that
* holds a pointer to the next element in the list of policy elements,
- * or NULL if it is the last element.
+ * or NULL if it is the last element.
*
* The wildcard value SSRC_ANY_INBOUND matches any SSRC from an
* inbound stream that for which there is no explicit SSRC entry in
@@ -212,33 +213,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t;
* is intentional, and it allows libSRTP to ensure that no security
* lapses result from accidental re-use of SSRC values during key
* sharing.
- *
- *
+ *
+ *
* @warning The final element of the list @b must have its `next' pointer
* set to NULL.
*/
typedef struct srtp_policy_t {
- ssrc_t ssrc; /**< The SSRC value of stream, or the
- * flags SSRC_ANY_INBOUND or
+ ssrc_t ssrc; /**< The SSRC value of stream, or the
+ * flags SSRC_ANY_INBOUND or
* SSRC_ANY_OUTBOUND if key sharing
* is used for this policy element.
*/
- crypto_policy_t rtp; /**< SRTP crypto policy. */
- crypto_policy_t rtcp; /**< SRTCP crypto policy. */
- unsigned char *key; /**< Pointer to the SRTP master key for
+ crypto_policy_t rtp; /**< SRTP crypto policy. */
+ crypto_policy_t rtcp; /**< SRTCP crypto policy. */
+ unsigned char *key; /**< Pointer to the SRTP master key for
* this stream. */
- ekt_policy_t ekt; /**< Pointer to the EKT policy structure
- * for this stream (if any) */
- unsigned long window_size; /**< The window size to use for replay
+ ekt_policy_t ekt; /**< Pointer to the EKT policy structure
+ * for this stream (if any) */
+ unsigned long window_size; /**< The window size to use for replay
* protection. */
- int allow_repeat_tx; /**< Whether retransmissions of
+ int allow_repeat_tx; /**< Whether retransmissions of
* packets with the same sequence number
* are allowed. (Note that such repeated
* transmissions must have the same RTP
* payload, or a severe security weakness
* is introduced!) */
- struct srtp_policy_t *next; /**< Pointer to next stream policy. */
+ struct srtp_policy_t *next; /**< Pointer to next stream policy. */
} srtp_policy_t;
@@ -248,7 +249,7 @@ typedef struct srtp_policy_t {
* @brief An srtp_t points to an SRTP session structure.
*
* The typedef srtp_t is a pointer to a structure that represents
- * an SRTP session. This datatype is intentially opaque in
+ * an SRTP session. This datatype is intentially opaque in
* order to separate the interface from the implementation.
*
* An SRTP session consists of all of the traffic sent to the RTP and
@@ -265,11 +266,11 @@ typedef struct srtp_ctx_t *srtp_t;
*
* The typedef srtp_stream_t is a pointer to a structure that
* represents an SRTP stream. This datatype is intentionally
- * opaque in order to separate the interface from the implementation.
- *
+ * opaque in order to separate the interface from the implementation.
+ *
* An SRTP stream consists of all of the traffic sent to an SRTP
* session by a single participant. A session can be viewed as
- * a set of streams.
+ * a set of streams.
*
*/
typedef struct srtp_stream_ctx_t *srtp_stream_t;
@@ -277,7 +278,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t;
/**
- * @brief srtp_init() initializes the srtp library.
+ * @brief srtp_init() initializes the srtp library.
*
* @warning This function @b must be called before any other srtp
* functions.
@@ -298,14 +299,14 @@ srtp_shutdown(void);
/**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
- *
+ *
* The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP
* protection to the RTP packet rtp_hdr (which has length *len_ptr) using
* the SRTP context ctx. If err_status_ok is returned, then rtp_hdr
* points to the resulting SRTP packet and *len_ptr is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
- *
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
@@ -315,11 +316,11 @@ srtp_shutdown(void);
* packet, and assumes that the RTP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
- * into the location in memory immediately following the RTP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN
+ * into the location in memory immediately following the RTP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtp_hdr is a pointer to the RTP packet (before the call); after
@@ -330,7 +331,7 @@ srtp_shutdown(void);
* complete SRTP packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok no problems
* - err_status_replay_fail rtp sequence number was non-increasing
* - @e other failure in cryptographic mechanisms
@@ -338,7 +339,7 @@ srtp_shutdown(void);
err_status_t
srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
-
+
/**
* @brief srtp_unprotect() is the Secure RTP receiver-side packet
* processing function.
@@ -349,12 +350,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* err_status_ok is returned, then srtp_hdr points to the resulting
* RTP packet and *len_ptr is the number of octets in that packet;
* otherwise, no assumptions should be made about the value of either
- * data elements.
- *
+ * data elements.
+ *
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
- *
+ *
* @warning This function assumes that the SRTP packet is aligned on a
* 32-bit boundary.
*
@@ -371,9 +372,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
* complete rtp packet after the call, if err_status_ok was returned.
* Otherwise, the value of the data to which it points is undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTP packet is valid.
- * - err_status_auth_fail if the SRTP packet failed the message
+ * - err_status_auth_fail if the SRTP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has
* already been processed and accepted).
@@ -393,14 +394,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
* key.
*
* @param session is the SRTP session to which the policy is to be added.
- *
+ *
* @param policy is the srtp_policy_t struct that describes the policy
* for the session. The struct may be a single element, or it may be
* the head of a list, in which case each element of the list is
* processed. It may also be NULL, in which case streams should be added
* later using srtp_add_stream(). The final element of the list @b must
* have its `next' field set to NULL.
- *
+ *
* @return
* - err_status_ok if creation succeded.
* - err_status_alloc_fail if allocation failed.
@@ -414,7 +415,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
/**
* @brief srtp_add_stream() allocates and initializes an SRTP stream
* within a given SRTP session.
- *
+ *
* The function call srtp_add_stream(session, policy) allocates and
* initializes a new SRTP stream within a given, previously created
* session, applying the policy given as the other argument to that
@@ -427,13 +428,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy);
*/
err_status_t
-srtp_add_stream(srtp_t session,
- const srtp_policy_t *policy);
+srtp_add_stream(srtp_t session,
+ const srtp_policy_t *policy);
/**
* @brief srtp_remove_stream() deallocates an SRTP stream.
- *
+ *
* The function call srtp_remove_stream(session, ssrc) removes
* the SRTP stream with the SSRC value ssrc from the SRTP session
* context given by the argument session.
@@ -445,7 +446,7 @@ srtp_add_stream(srtp_t session,
*
* @warning Wildcard SSRC values cannot be removed from a
* session.
- *
+ *
* @return
* - err_status_ok if the stream deallocation succeded.
* - [other] otherwise.
@@ -459,8 +460,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* @brief crypto_policy_set_rtp_default() sets a crypto policy
* structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTP
* protection, as defined in the specification. This function is a
@@ -469,9 +470,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -481,8 +482,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* @brief crypto_policy_set_rtcp_default() sets a crypto policy
* structure to the SRTP default policy for RTCP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&p) sets the
* crypto_policy_t at location p to the SRTP default policy for RTCP
* protection, as defined in the specification. This function is a
@@ -491,9 +492,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p);
* with this function call. Doing so may allow your code to be
* forward compatible with later versions of libSRTP that include more
* elements in the crypto_policy_t datatype.
- *
+ *
* @return void.
- *
+ *
*/
void
@@ -503,15 +504,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto
* policy structure to the SRTP default policy for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a
* synonym for crypto_policy_set_rtp_default(). It conforms to the
* naming convention used in RFC 4568 (SDP Security Descriptions for
* Media Streams).
- *
+ *
* @return void.
- *
+ *
*/
#define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p)
@@ -521,8 +522,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto
* policy structure to a short-authentication tag policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568.
@@ -532,7 +533,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -545,7 +546,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -557,14 +558,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto
* policy structure to an encryption-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Counter Mode), but to use no authentication method. This
* policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5
* of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -576,7 +577,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p);
* Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -587,14 +588,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto
* policy structure to an authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80
* bit authentication tag to provide message authentication, but to
* use no encryption. This policy is NOT RECOMMENDED for SRTP unless
- * there is a requirement to forego encryption.
- *
+ * there is a requirement to forego encryption.
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -602,10 +603,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @warning This policy is NOT RECOMMENDED for SRTP unless there is a
- * requirement to forego encryption.
+ * requirement to forego encryption.
*
* @return void.
- *
+ *
*/
void
@@ -614,18 +615,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
/**
* @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto
- * policy structure to a encryption and authentication policy using AES-256
+ * policy structure to a encryption and authentication policy using AES-256
* for RTP protection.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_80 as defined in
* draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256
* Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit
* authentication tag.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -633,7 +634,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
@@ -644,8 +645,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* policy structure to a short-authentication tag policy using AES-256
* encryption.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p)
* sets the crypto_policy_t at location p to use policy
* AES_CM_256_HMAC_SHA1_32 as defined in
@@ -655,7 +656,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* considered adequate only for protecting audio and video media that
* use a stateless playback function. See Section 7.5 of RFC 3711
* (http://www.ietf.org/rfc/rfc3711.txt).
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -668,7 +669,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p);
* (http://www.ietf.org/rfc/rfc3711.txt).
*
* @return void.
- *
+ *
*/
void
@@ -706,14 +707,14 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -721,7 +722,7 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
@@ -730,14 +731,14 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -745,7 +746,7 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
@@ -754,14 +755,14 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -769,7 +770,7 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
@@ -778,14 +779,14 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto
* policy structure to an AEAD authentication-only policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_8_only_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
- * applies confidentiality and authentication to the RTP packets,
+ * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy
+ * applies confidentiality and authentication to the RTP packets,
* but only authentication to the RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -793,7 +794,7 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
@@ -802,14 +803,14 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_128_16_auth() sets a crypto
* policy structure to an AEAD encryption policy.
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_128_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
* (AES-128 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -817,7 +818,7 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
@@ -826,14 +827,14 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* @brief crypto_policy_set_aes_gcm_256_16_auth() sets a crypto
* policy structure to an AEAD encryption policy
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_aes_gcm_256_16_auth(&p) sets
* the crypto_policy_t at location p to use the SRTP default cipher
- * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
+ * (AES-256 Galois Counter Mode) with 16 octet auth tag. This
* policy applies confidentiality and authentication to both the
* RTP and RTCP packets.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
@@ -841,7 +842,7 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p);
* include more elements in the crypto_policy_t datatype.
*
* @return void.
- *
+ *
*/
void
crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
@@ -850,7 +851,7 @@ crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p);
/**
* @brief srtp_dealloc() deallocates storage for an SRTP session
* context.
- *
+ *
* The function call srtp_dealloc(s) deallocates storage for the
* SRTP session context s. This function should be called no more
* than one time for each of the contexts allocated by the function
@@ -868,7 +869,7 @@ srtp_dealloc(srtp_t s);
/*
- * @brief identifies a particular SRTP profile
+ * @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters). These
@@ -876,13 +877,13 @@ srtp_dealloc(srtp_t s);
*/
typedef enum {
- srtp_profile_reserved = 0,
- srtp_profile_aes128_cm_sha1_80 = 1,
- srtp_profile_aes128_cm_sha1_32 = 2,
- srtp_profile_aes256_cm_sha1_80 = 3,
- srtp_profile_aes256_cm_sha1_32 = 4,
- srtp_profile_null_sha1_80 = 5,
- srtp_profile_null_sha1_32 = 6,
+ srtp_profile_reserved = 0,
+ srtp_profile_aes128_cm_sha1_80 = 1,
+ srtp_profile_aes128_cm_sha1_32 = 2,
+ srtp_profile_aes256_cm_sha1_80 = 3,
+ srtp_profile_aes256_cm_sha1_32 = 4,
+ srtp_profile_null_sha1_80 = 5,
+ srtp_profile_null_sha1_32 = 6,
} srtp_profile_t;
@@ -890,26 +891,26 @@ typedef enum {
* @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy
* structure to the appropriate value for RTP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
+ srtp_profile_t profile);
@@ -918,26 +919,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy,
* @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy
* structure to the appropriate value for RTCP based on an srtp_profile_t
*
- * @param p is a pointer to the policy structure to be set
- *
+ * @param p is a pointer to the policy structure to be set
+ *
* The function call crypto_policy_set_rtcp_default(&policy, profile)
* sets the crypto_policy_t at location policy to the policy for RTCP
* protection, as defined by the srtp_profile_t profile.
- *
+ *
* This function is a convenience that helps to avoid dealing directly
* with the policy data structure. You are encouraged to initialize
* policy elements with this function call. Doing so may allow your
* code to be forward compatible with later versions of libSRTP that
* include more elements in the crypto_policy_t datatype.
- *
+ *
* @return values
* - err_status_ok no problems were encountered
- * - err_status_bad_param the profile is not supported
- *
+ * - err_status_bad_param the profile is not supported
+ *
*/
err_status_t
-crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
- srtp_profile_t profile);
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy,
+ srtp_profile_t profile);
/**
* @brief returns the master key length for a given SRTP profile
@@ -955,18 +956,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile);
/**
* @brief appends the salt to the key
*
- * The function call append_salt_to_key(k, klen, s, slen)
+ * The function call append_salt_to_key(k, klen, s, slen)
* copies the string s to the location at klen bytes following
- * the location k.
+ * the location k.
*
* @warning There must be at least bytes_in_salt + bytes_in_key bytes
* available at the location pointed to by key.
- *
+ *
*/
void
append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
- unsigned char *salt, unsigned int bytes_in_salt);
+ unsigned char *salt, unsigned int bytes_in_salt);
@@ -978,7 +979,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
/**
* @defgroup SRTCP Secure RTCP
- * @ingroup SRTP
+ * @ingroup SRTP
*
* @brief Secure RTCP functions are used to protect RTCP traffic.
*
@@ -986,36 +987,36 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* traffic in much the same way as it does RTP traffic. The function
* srtp_protect_rtcp() applies cryptographic protections to outbound
* RTCP packets, and srtp_unprotect_rtcp() verifies the protections on
- * inbound RTCP packets.
+ * inbound RTCP packets.
*
* A note on the naming convention: srtp_protect_rtcp() has an srtp_t
* as its first argument, and thus has `srtp_' as its prefix. The
- * trailing `_rtcp' indicates the protocol on which it acts.
- *
+ * trailing `_rtcp' indicates the protocol on which it acts.
+ *
* @{
*/
/**
* @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet
* processing function.
- *
+ *
* The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies
* SRTCP protection to the RTCP packet rtcp_hdr (which has length
* *len_ptr) using the SRTP session context ctx. If err_status_ok is
* returned, then rtp_hdr points to the resulting SRTCP packet and
* *len_ptr is the number of octets in that packet; otherwise, no
* assumptions should be made about the value of either data elements.
- *
+ *
* @warning This function assumes that it can write the authentication
* tag into the location in memory immediately following the RTCP
* packet, and assumes that the RTCP packet is aligned on a 32-bit
* boundary.
*
- * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
- * into the location in memory immediately following the RTCP packet.
- * Callers MUST ensure that this much writable memory is available in
+ * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4
+ * into the location in memory immediately following the RTCP packet.
+ * Callers MUST ensure that this much writable memory is available in
* the buffer that holds the RTCP packet.
- *
+ *
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtcp_hdr is a pointer to the RTCP packet (before the call); after
@@ -1027,14 +1028,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
* was returned. Otherwise, the value of the data to which it points
* is undefined.
*
- * @return
+ * @return
* - err_status_ok if there were no problems.
- * - [other] if there was a failure in
+ * - [other] if there was a failure in
* the cryptographic mechanisms.
*/
-
-err_status_t
+
+err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
/**
@@ -1048,7 +1049,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* to the resulting RTCP packet and *len_ptr is the number of octets
* in that packet; otherwise, no assumptions should be made about the
* value of either data elements.
- *
+ *
* @warning This function assumes that the SRTCP packet is aligned on a
* 32-bit boundary.
*
@@ -1066,9 +1067,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
* returned. Otherwise, the value of the data to which it points is
* undefined.
*
- * @return
+ * @return
* - err_status_ok if the RTCP packet is valid.
- * - err_status_auth_fail if the SRTCP packet failed the message
+ * - err_status_auth_fail if the SRTCP packet failed the message
* authentication check.
* - err_status_replay_fail if the SRTCP packet is a replay (e.g. has
* already been processed and accepted).
@@ -1076,7 +1077,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
*
*/
-err_status_t
+err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
/**
@@ -1087,10 +1088,10 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @defgroup SRTPevents SRTP events and callbacks
* @ingroup SRTP
*
- * @brief libSRTP can use a user-provided callback function to
+ * @brief libSRTP can use a user-provided callback function to
* handle events.
*
- *
+ *
* libSRTP allows a user to provide a callback function to handle
* events that need to be dealt with outside of the data plane (see
* the enum srtp_event_t for a description of these events). Dealing
@@ -1111,8 +1112,8 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* @brief srtp_event_t defines events that need to be handled
*
* The enum srtp_event_t defines events that need to be handled
- * outside the `data plane', such as SSRC collisions and
- * key expirations.
+ * outside the `data plane', such as SSRC collisions and
+ * key expirations.
*
* When a key expires or the maximum number of packets has been
* reached, an SRTP stream will enter an `expired' state in which no
@@ -1125,33 +1126,33 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
* latter case, all of the streams in the session will expire.
*/
-typedef enum {
- event_ssrc_collision, /**<
- * An SSRC collision occured.
+typedef enum {
+ event_ssrc_collision, /**<
+ * An SSRC collision occured.
*/
- event_key_soft_limit, /**< An SRTP stream reached the soft key
- * usage limit and will expire soon.
+ event_key_soft_limit, /**< An SRTP stream reached the soft key
+ * usage limit and will expire soon.
*/
- event_key_hard_limit, /**< An SRTP stream reached the hard
+ event_key_hard_limit, /**< An SRTP stream reached the hard
* key usage limit and has expired.
*/
- event_packet_index_limit /**< An SRTP stream reached the hard
- * packet limit (2^48 packets).
+ event_packet_index_limit /**< An SRTP stream reached the hard
+ * packet limit (2^48 packets).
*/
} srtp_event_t;
/**
- * @brief srtp_event_data_t is the structure passed as a callback to
+ * @brief srtp_event_data_t is the structure passed as a callback to
* the event handler function
*
* The struct srtp_event_data_t holds the data passed to the event
- * handler function.
+ * handler function.
*/
typedef struct srtp_event_data_t {
- srtp_t session; /**< The session in which the event happend. */
- srtp_stream_t stream; /**< The stream in which the event happend. */
- srtp_event_t event; /**< An enum indicating the type of event. */
+ srtp_t session; /**< The session in which the event happend. */
+ srtp_stream_t stream; /**< The stream in which the event happend. */
+ srtp_event_t event; /**< An enum indicating the type of event. */
} srtp_event_data_t;
/**
@@ -1169,7 +1170,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data);
/**
* @brief sets the event handler to the function supplied by the caller.
- *
+ *
* The function call srtp_install_event_handler(func) sets the event
* handler function to the value func. The value NULL is acceptable
* as an argument; in this case, events will be ignored rather than
diff --git a/thirdparties/wince/include/srtp/stat.h b/thirdparties/wince/include/srtp/stat.h
index e28b131..a67a380 100755
--- a/thirdparties/wince/include/srtp/stat.h
+++ b/thirdparties/wince/include/srtp/stat.h
@@ -1,6 +1,6 @@
/*
* stats.h
- *
+ *
* interface to statistical test functions
*
* David A. McGrew
@@ -8,26 +8,26 @@
*/
/*
- *
+ *
* Copyright(c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
diff --git a/thirdparties/wince/include/srtp/xfm.h b/thirdparties/wince/include/srtp/xfm.h
index 5837149..a5e393f 100755
--- a/thirdparties/wince/include/srtp/xfm.h
+++ b/thirdparties/wince/include/srtp/xfm.h
@@ -2,7 +2,7 @@
* xfm.h
*
* interface for abstract crypto transform
- *
+ *
* David A. McGrew
* Cisco Systems, Inc.
*/
@@ -28,12 +28,12 @@
* The function pointer xfm_func_t points to a function that
* implements a crypto transform, and provides a uniform API for
* accessing crypto mechanisms.
- *
- * @param key location of secret key
*
- * @param clear data to be authenticated only
+ * @param key location of secret key
+ *
+ * @param clear data to be authenticated only
*
- * @param clear_len length of data to be authenticated only
+ * @param clear_len length of data to be authenticated only
*
* @param iv location to write the Initialization Vector (IV)
*
@@ -45,38 +45,38 @@
* encrypted and authenticated (before the function call), and the
* length of the ciphertext (after the call)
*
- * @param auth_tag location to write auth tag
+ * @param auth_tag location to write auth tag
*/
-typedef err_status_t (*xfm_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *protect,
- unsigned *protected_len,
- void *auth_tag
- );
-
-typedef
+typedef err_status_t (*xfm_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *protect,
+ unsigned *protected_len,
+ void *auth_tag
+);
+
+typedef
err_status_t (*xfm_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len, /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len, /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- void *auth_tag /* location of auth tag */
- );
+ void *auth_tag /* location of auth tag */
+);
typedef struct xfm_ctx_t {
- xfm_func_t func;
- xfm_inv_t inv;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
+ xfm_func_t func;
+ xfm_inv_t inv;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
} xfm_ctx_t;
typedef xfm_ctx_t *xfm_t;
@@ -89,35 +89,35 @@ typedef xfm_ctx_t *xfm_t;
/* cryptoalgo - 5/28 */
-
-typedef err_status_t (*cryptoalg_func_t)
- (void *key,
- void *clear,
- unsigned clear_len,
- void *iv,
- void *opaque,
- unsigned *opaque_len
- );
-
-typedef
+
+typedef err_status_t (*cryptoalg_func_t)
+(void *key,
+ void *clear,
+ unsigned clear_len,
+ void *iv,
+ void *opaque,
+ unsigned *opaque_len
+);
+
+typedef
err_status_t (*cryptoalg_inv_t)
- (void *key, /* location of secret key */
- void *clear, /* data to be authenticated only */
- unsigned clear_len, /* length of data to be authenticated only */
- void *iv, /* location of iv */
- void *opaque, /* data to be decrypted and authenticated */
- unsigned *opaque_len /* location of the length of data to be
- * decrypted and authd (before and after)
+(void *key, /* location of secret key */
+ void *clear, /* data to be authenticated only */
+ unsigned clear_len, /* length of data to be authenticated only */
+ void *iv, /* location of iv */
+ void *opaque, /* data to be decrypted and authenticated */
+ unsigned *opaque_len /* location of the length of data to be
+ * decrypted and authd (before and after)
*/
- );
+);
typedef struct cryptoalg_ctx_t {
- cryptoalg_func_t enc;
- cryptoalg_inv_t dec;
- unsigned key_len;
- unsigned iv_len;
- unsigned auth_tag_len;
- unsigned max_expansion;
+ cryptoalg_func_t enc;
+ cryptoalg_inv_t dec;
+ unsigned key_len;
+ unsigned iv_len;
+ unsigned auth_tag_len;
+ unsigned max_expansion;
} cryptoalg_ctx_t;
typedef cryptoalg_ctx_t *cryptoalg_t;
diff --git a/thirdparties/wince/include/stdint.h b/thirdparties/wince/include/stdint.h
index 89ff614..18249b0 100755
--- a/thirdparties/wince/include/stdint.h
+++ b/thirdparties/wince/include/stdint.h
@@ -1,32 +1,32 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
// Copyright (c) 2006-2008 Alexander Chemeris
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
-//
+//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
-//
+//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
+//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
@@ -76,19 +76,19 @@ extern "C" {
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
- typedef signed char int8_t;
- typedef signed short int16_t;
- typedef signed int int32_t;
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
- typedef unsigned int uint32_t;
+typedef signed char int8_t;
+typedef signed short int16_t;
+typedef signed int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
#else
- typedef signed __int8 int8_t;
- typedef signed __int16 int16_t;
- typedef signed __int32 int32_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
+typedef signed __int8 int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
@@ -116,11 +116,11 @@ typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
- typedef signed __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
+typedef signed __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
- typedef _W64 signed int intptr_t;
- typedef _W64 unsigned int uintptr_t;
+typedef _W64 signed int intptr_t;
+typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
diff --git a/thirdparties/wince/include/vpx/svc_context.h b/thirdparties/wince/include/vpx/svc_context.h
index 5d0fbbd..40701cc 100755
--- a/thirdparties/wince/include/vpx/svc_context.h
+++ b/thirdparties/wince/include/vpx/svc_context.h
@@ -24,28 +24,29 @@ extern "C" {
#endif
typedef enum SVC_ENCODING_MODE {
- INTER_LAYER_PREDICTION_I,
- ALT_INTER_LAYER_PREDICTION_IP,
- INTER_LAYER_PREDICTION_IP,
- USE_GOLDEN_FRAME
-} SVC_ENCODING_MODE;
+ INTER_LAYER_PREDICTION_I,
+ ALT_INTER_LAYER_PREDICTION_IP,
+ INTER_LAYER_PREDICTION_IP,
+ USE_GOLDEN_FRAME
+}
+SVC_ENCODING_MODE;
typedef enum SVC_LOG_LEVEL {
- SVC_LOG_ERROR,
- SVC_LOG_INFO,
- SVC_LOG_DEBUG
+ SVC_LOG_ERROR,
+ SVC_LOG_INFO,
+ SVC_LOG_DEBUG
} SVC_LOG_LEVEL;
typedef struct {
- // public interface to svc_command options
- int spatial_layers; // number of layers
- SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
- SVC_LOG_LEVEL log_level; // amount of information to display
- int log_print; // when set, printf log messages instead of returning the
- // message with svc_get_message
-
- // private storage for vpx_svc_encode
- void *internal;
+ // public interface to svc_command options
+ int spatial_layers; // number of layers
+ SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
+ SVC_LOG_LEVEL log_level; // amount of information to display
+ int log_print; // when set, printf log messages instead of returning the
+ // message with svc_get_message
+
+ // private storage for vpx_svc_encode
+ void *internal;
} SvcContext;
/**
@@ -73,7 +74,7 @@ vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
* e.g., "4/16,5/16,7/16,11/16,16/16"
*/
vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx,
- const char *scale_factors);
+ const char *scale_factors);
/**
* initialize SVC encoding
@@ -128,9 +129,9 @@ char *vpx_svc_get_rc_stats_buffer(const SvcContext *svc_ctx);
* return spatial resolution of the specified layer
*/
vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
- int layer,
- unsigned int *width,
- unsigned int *height);
+ int layer,
+ unsigned int *width,
+ unsigned int *height);
/**
* return number of frames that have been encoded
*/
diff --git a/thirdparties/wince/include/vpx/vp8.h b/thirdparties/wince/include/vpx/vp8.h
index 2a31af6..f748314 100755
--- a/thirdparties/wince/include/vpx/vp8.h
+++ b/thirdparties/wince/include/vpx/vp8.h
@@ -42,21 +42,21 @@ extern "C" {
* The set of macros define the control functions of VP8 interface
*/
enum vp8_com_control_id {
- VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
- VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
- VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
- VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
- VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
- VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
- VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
+ VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
+ VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
+ VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
+ VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
+ VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
+ VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
+ VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
- /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
- * for its control ids. These should be migrated to something like the
- * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
- */
- VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
- VP8_COMMON_CTRL_ID_MAX,
- VP8_DECODER_CTRL_ID_START = 256
+ /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
+ * for its control ids. These should be migrated to something like the
+ * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
+ */
+ VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
+ VP8_COMMON_CTRL_ID_MAX,
+ VP8_DECODER_CTRL_ID_START = 256
};
/*!\brief post process flags
@@ -64,15 +64,15 @@ enum vp8_com_control_id {
* The set of macros define VP8 decoder post processing flags
*/
enum vp8_postproc_level {
- VP8_NOFILTERING = 0,
- VP8_DEBLOCK = 1 << 0,
- VP8_DEMACROBLOCK = 1 << 1,
- VP8_ADDNOISE = 1 << 2,
- VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
- VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
- VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
- VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
- VP8_MFQE = 1 << 10
+ VP8_NOFILTERING = 0,
+ VP8_DEBLOCK = 1 << 0,
+ VP8_DEMACROBLOCK = 1 << 1,
+ VP8_ADDNOISE = 1 << 2,
+ VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */
+ VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */
+ VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */
+ VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */
+ VP8_MFQE = 1 << 10
};
/*!\brief post process flags
@@ -83,9 +83,9 @@ enum vp8_postproc_level {
*/
typedef struct vp8_postproc_cfg {
- int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
- int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
- int noise_level; /**< the strength of additive noise, valid range [0, 16] */
+ int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
+ int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */
+ int noise_level; /**< the strength of additive noise, valid range [0, 16] */
} vp8_postproc_cfg_t;
/*!\brief reference frame type
@@ -93,9 +93,9 @@ typedef struct vp8_postproc_cfg {
* The set of macros define the type of VP8 reference frames
*/
typedef enum vpx_ref_frame_type {
- VP8_LAST_FRAME = 1,
- VP8_GOLD_FRAME = 2,
- VP8_ALTR_FRAME = 4
+ VP8_LAST_FRAME = 1,
+ VP8_GOLD_FRAME = 2,
+ VP8_ALTR_FRAME = 4
} vpx_ref_frame_type_t;
/*!\brief reference frame data struct
@@ -103,8 +103,8 @@ typedef enum vpx_ref_frame_type {
* Define the data struct to access vp8 reference frames.
*/
typedef struct vpx_ref_frame {
- vpx_ref_frame_type_t frame_type; /**< which reference frame */
- vpx_image_t img; /**< reference frame data in image format */
+ vpx_ref_frame_type_t frame_type; /**< which reference frame */
+ vpx_image_t img; /**< reference frame data in image format */
} vpx_ref_frame_t;
/*!\brief VP9 specific reference frame data struct
@@ -112,8 +112,8 @@ typedef struct vpx_ref_frame {
* Define the data struct to access vp9 reference frames.
*/
typedef struct vp9_ref_frame {
- int idx; /**< frame index to get (input) */
- vpx_image_t img; /**< img structure to populate (output) */
+ int idx; /**< frame index to get (input) */
+ vpx_image_t img; /**< img structure to populate (output) */
} vp9_ref_frame_t;
/*!\brief vp8 decoder control function parameter type
diff --git a/thirdparties/wince/include/vpx/vp8cx.h b/thirdparties/wince/include/vpx/vp8cx.h
index 8944a26..bec3720 100755
--- a/thirdparties/wince/include/vpx/vp8cx.h
+++ b/thirdparties/wince/include/vpx/vp8cx.h
@@ -129,79 +129,79 @@ extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
* \sa #vpx_codec_control
*/
enum vp8e_enc_control_id {
- VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
- VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
- VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
- VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
- VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
- VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
- /*!\brief control function to set vp8 encoder cpuused
- *
- * Changes in this value influences, among others, the encoder's selection
- * of motion estimation methods. Values greater than 0 will increase encoder
- * speed at the expense of quality.
- * The full set of adjustments can be found in
- * onyx_if.c:vp8_set_speed_features().
- * \todo List highlights of the changes at various levels.
- *
- * \note Valid range: -16..16
- */
- VP8E_SET_CPUUSED = 13,
- VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
- VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
- VP8E_SET_SHARPNESS, /**< control function to set sharpness */
- VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
- VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
- VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
+ VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */
+ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */
+ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */
+ VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */
+ VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */
+ VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */
+ /*!\brief control function to set vp8 encoder cpuused
+ *
+ * Changes in this value influences, among others, the encoder's selection
+ * of motion estimation methods. Values greater than 0 will increase encoder
+ * speed at the expense of quality.
+ * The full set of adjustments can be found in
+ * onyx_if.c:vp8_set_speed_features().
+ * \todo List highlights of the changes at various levels.
+ *
+ * \note Valid range: -16..16
+ */
+ VP8E_SET_CPUUSED = 13,
+ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
+ VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */
+ VP8E_SET_SHARPNESS, /**< control function to set sharpness */
+ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
+ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
+ VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the
encoder for the last frame using the internal
scale */
- VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
+ VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the
encoder for the last frame, using the 0..63
scale as used by the rc_*_quantizer config
parameters */
- VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
- VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
- VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
- VP8E_SET_TUNING, /**< control function to set visual tuning */
- /*!\brief control function to set constrained quality level
- *
- * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
- * set to #VPX_CQ.
- * \note Valid range: 0..63
- */
- VP8E_SET_CQ_LEVEL,
-
- /*!\brief Max data rate for Intra frames
- *
- * This value controls additional clamping on the maximum size of a
- * keyframe. It is expressed as a percentage of the average
- * per-frame bitrate, with the special (and default) value 0 meaning
- * unlimited, or no additional clamping beyond the codec's built-in
- * algorithm.
- *
- * For example, to allocate no more than 4.5 frames worth of bitrate
- * to a keyframe, set this to 450.
- *
- */
- VP8E_SET_MAX_INTRA_BITRATE_PCT,
-
-
- /* TODO(jkoleszar): Move to vp9cx.h */
- VP9E_SET_LOSSLESS,
- VP9E_SET_TILE_COLUMNS,
- VP9E_SET_TILE_ROWS,
- VP9E_SET_FRAME_PARALLEL_DECODING,
- VP9E_SET_AQ_MODE,
- VP9E_SET_FRAME_PERIODIC_BOOST,
-
- VP9E_SET_SVC,
- VP9E_SET_SVC_PARAMETERS,
- /*!\brief control function to set svc layer for spatial and temporal.
- * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
- * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
- * temporal layer.
- */
- VP9E_SET_SVC_LAYER_ID
+ VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/
+ VP8E_SET_ARNR_STRENGTH, /**< control function to set the filter strength for the arf */
+ VP8E_SET_ARNR_TYPE, /**< control function to set the type of filter to use for the arf*/
+ VP8E_SET_TUNING, /**< control function to set visual tuning */
+ /*!\brief control function to set constrained quality level
+ *
+ * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
+ * set to #VPX_CQ.
+ * \note Valid range: 0..63
+ */
+ VP8E_SET_CQ_LEVEL,
+
+ /*!\brief Max data rate for Intra frames
+ *
+ * This value controls additional clamping on the maximum size of a
+ * keyframe. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * unlimited, or no additional clamping beyond the codec's built-in
+ * algorithm.
+ *
+ * For example, to allocate no more than 4.5 frames worth of bitrate
+ * to a keyframe, set this to 450.
+ *
+ */
+ VP8E_SET_MAX_INTRA_BITRATE_PCT,
+
+
+ /* TODO(jkoleszar): Move to vp9cx.h */
+ VP9E_SET_LOSSLESS,
+ VP9E_SET_TILE_COLUMNS,
+ VP9E_SET_TILE_ROWS,
+ VP9E_SET_FRAME_PARALLEL_DECODING,
+ VP9E_SET_AQ_MODE,
+ VP9E_SET_FRAME_PERIODIC_BOOST,
+
+ VP9E_SET_SVC,
+ VP9E_SET_SVC_PARAMETERS,
+ /*!\brief control function to set svc layer for spatial and temporal.
+ * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
+ * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
+ * temporal layer.
+ */
+ VP9E_SET_SVC_LAYER_ID
};
/*!\brief vpx 1-D scaling mode
@@ -209,10 +209,10 @@ enum vp8e_enc_control_id {
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d {
- VP8E_NORMAL = 0,
- VP8E_FOURFIVE = 1,
- VP8E_THREEFIVE = 2,
- VP8E_ONETWO = 3
+ VP8E_NORMAL = 0,
+ VP8E_FOURFIVE = 1,
+ VP8E_THREEFIVE = 2,
+ VP8E_ONETWO = 3
} VPX_SCALING_MODE;
@@ -223,17 +223,17 @@ typedef enum vpx_scaling_mode_1d {
*/
typedef struct vpx_roi_map {
- /*! An id between 0 and 3 for each 16x16 region within a frame. */
- unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
- // TODO(paulwilkins): broken for VP9 which has 8 segments
- // q and loop filter deltas for each segment
- // (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
- /*! Static breakout threshold for each segment. */
- unsigned int static_threshold[4];
+ /*! An id between 0 and 3 for each 16x16 region within a frame. */
+ unsigned char *roi_map;
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
+ // TODO(paulwilkins): broken for VP9 which has 8 segments
+ // q and loop filter deltas for each segment
+ // (see MAX_MB_SEGMENTS)
+ int delta_q[4]; /**< Quantizer deltas. */
+ int delta_lf[4]; /**< Loop filter deltas. */
+ /*! Static breakout threshold for each segment. */
+ unsigned int static_threshold[4];
} vpx_roi_map_t;
/*!\brief vpx active region map
@@ -244,9 +244,9 @@ typedef struct vpx_roi_map {
typedef struct vpx_active_map {
- unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
- unsigned int rows; /**< number of rows */
- unsigned int cols; /**< number of cols */
+ unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
+ unsigned int rows; /**< number of rows */
+ unsigned int cols; /**< number of cols */
} vpx_active_map_t;
/*!\brief vpx image scaling mode
@@ -255,8 +255,8 @@ typedef struct vpx_active_map {
*
*/
typedef struct vpx_scaling_mode {
- VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
- VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
+ VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
+ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
/*!\brief VP8 token partition mode
@@ -267,10 +267,10 @@ typedef struct vpx_scaling_mode {
*/
typedef enum {
- VP8_ONE_TOKENPARTITION = 0,
- VP8_TWO_TOKENPARTITION = 1,
- VP8_FOUR_TOKENPARTITION = 2,
- VP8_EIGHT_TOKENPARTITION = 3
+ VP8_ONE_TOKENPARTITION = 0,
+ VP8_TWO_TOKENPARTITION = 1,
+ VP8_FOUR_TOKENPARTITION = 2,
+ VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
@@ -280,8 +280,8 @@ typedef enum {
*
*/
typedef enum {
- VP8_TUNE_PSNR,
- VP8_TUNE_SSIM
+ VP8_TUNE_PSNR,
+ VP8_TUNE_SSIM
} vp8e_tuning;
/*!\brief vp9 svc parameters
@@ -290,17 +290,17 @@ typedef enum {
*
*/
typedef struct vpx_svc_parameters {
- unsigned int width; /**< width of current spatial layer */
- unsigned int height; /**< height of current spatial layer */
- int spatial_layer; /**< current spatial layer number - 0 = base */
- int temporal_layer; /**< current temporal layer number - 0 = base */
- int flags; /**< encode frame flags */
- int max_quantizer; /**< max quantizer for current layer */
- int min_quantizer; /**< min quantizer for current layer */
- int distance_from_i_frame; /**< frame number within current gop */
- int lst_fb_idx; /**< last frame frame buffer index */
- int gld_fb_idx; /**< golden frame frame buffer index */
- int alt_fb_idx; /**< alt reference frame frame buffer index */
+ unsigned int width; /**< width of current spatial layer */
+ unsigned int height; /**< height of current spatial layer */
+ int spatial_layer; /**< current spatial layer number - 0 = base */
+ int temporal_layer; /**< current temporal layer number - 0 = base */
+ int flags; /**< encode frame flags */
+ int max_quantizer; /**< max quantizer for current layer */
+ int min_quantizer; /**< min quantizer for current layer */
+ int distance_from_i_frame; /**< frame number within current gop */
+ int lst_fb_idx; /**< last frame frame buffer index */
+ int gld_fb_idx; /**< golden frame frame buffer index */
+ int alt_fb_idx; /**< alt reference frame frame buffer index */
} vpx_svc_parameters_t;
/*!\brief vp9 svc layer parameters
@@ -311,8 +311,8 @@ typedef struct vpx_svc_parameters {
*
*/
typedef struct vpx_svc_layer_id {
- int spatial_layer_id; /**< Spatial layer id number. */
- int temporal_layer_id; /**< Temporal layer id number. */
+ int spatial_layer_id; /**< Spatial layer id number. */
+ int temporal_layer_id; /**< Temporal layer id number. */
} vpx_svc_layer_id_t;
/*!\brief VP8 encoder control function parameter type
diff --git a/thirdparties/wince/include/vpx/vp8dx.h b/thirdparties/wince/include/vpx/vp8dx.h
index bd7f19c..a0f19fe 100755
--- a/thirdparties/wince/include/vpx/vp8dx.h
+++ b/thirdparties/wince/include/vpx/vp8dx.h
@@ -52,33 +52,33 @@ extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
* \sa #vpx_codec_control
*/
enum vp8_dec_control_id {
- /** control function to get info on which reference frames were updated
- * by the last decode
- */
- VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
+ /** control function to get info on which reference frames were updated
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
- /** check if the indicated frame is corrupted */
- VP8D_GET_FRAME_CORRUPTED,
+ /** check if the indicated frame is corrupted */
+ VP8D_GET_FRAME_CORRUPTED,
- /** control function to get info on which reference frames were used
- * by the last decode
- */
- VP8D_GET_LAST_REF_USED,
+ /** control function to get info on which reference frames were used
+ * by the last decode
+ */
+ VP8D_GET_LAST_REF_USED,
- /** decryption function to decrypt encoded buffer data immediately
- * before decoding. Takes a vpx_decrypt_init, which contains
- * a callback function and opaque context pointer.
- */
- VPXD_SET_DECRYPTOR,
- VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR,
+ /** decryption function to decrypt encoded buffer data immediately
+ * before decoding. Takes a vpx_decrypt_init, which contains
+ * a callback function and opaque context pointer.
+ */
+ VPXD_SET_DECRYPTOR,
+ VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR,
- /** control function to get the display dimensions for the current frame. */
- VP9D_GET_DISPLAY_SIZE,
+ /** control function to get the display dimensions for the current frame. */
+ VP9D_GET_DISPLAY_SIZE,
- /** For testing. */
- VP9_INVERT_TILE_DECODE_ORDER,
+ /** For testing. */
+ VP9_INVERT_TILE_DECODE_ORDER,
- VP8_DECODER_CTRL_ID_MAX
+ VP8_DECODER_CTRL_ID_MAX
};
/** Decrypt n bytes of data from input -> output, using the decrypt_state
diff --git a/thirdparties/wince/include/vpx/vpx_codec.h b/thirdparties/wince/include/vpx/vpx_codec.h
index 03d2dec..3708e88 100755
--- a/thirdparties/wince/include/vpx/vpx_codec.h
+++ b/thirdparties/wince/include/vpx/vpx_codec.h
@@ -46,7 +46,7 @@ extern "C" {
#include "./vpx_integer.h"
#include "./vpx_image.h"
- /*!\brief Decorator indicating a function is deprecated */
+/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
#if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__ ((deprecated))
@@ -67,7 +67,7 @@ extern "C" {
#endif
#endif /* DECLSPEC_DEPRECATED */
- /*!\brief Decorator indicating a function is potentially unused */
+/*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED
#elif __GNUC__
#define UNUSED __attribute__ ((unused))
@@ -75,18 +75,18 @@ extern "C" {
#define UNUSED
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/
- /*!\brief Algorithm return codes */
- typedef enum {
+/*!\brief Algorithm return codes */
+typedef enum {
/*!\brief Operation completed without error */
VPX_CODEC_OK,
@@ -138,247 +138,247 @@ extern "C" {
*/
VPX_CODEC_LIST_END
- }
- vpx_codec_err_t;
+}
+vpx_codec_err_t;
- /*! \brief Codec capabilities bitfield
- *
- * Each codec advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
- typedef long vpx_codec_caps_t;
+/*! \brief Codec capabilities bitfield
+ *
+ * Each codec advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
+typedef long vpx_codec_caps_t;
#define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
#define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
#define VPX_CODEC_CAP_XMA 0x4 /**< Supports eXternal Memory Allocation */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
- typedef long vpx_codec_flags_t;
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
+typedef long vpx_codec_flags_t;
#define VPX_CODEC_USE_XMA 0x00000001 /**< Use eXternal Memory Allocation mode */
- /*!\brief Codec interface structure.
- *
- * Contains function pointers and other data private to the codec
- * implementation. This structure is opaque to the application.
- */
- typedef const struct vpx_codec_iface vpx_codec_iface_t;
+/*!\brief Codec interface structure.
+ *
+ * Contains function pointers and other data private to the codec
+ * implementation. This structure is opaque to the application.
+ */
+typedef const struct vpx_codec_iface vpx_codec_iface_t;
- /*!\brief Codec private data structure.
- *
- * Contains data private to the codec implementation. This structure is opaque
- * to the application.
- */
- typedef struct vpx_codec_priv vpx_codec_priv_t;
+/*!\brief Codec private data structure.
+ *
+ * Contains data private to the codec implementation. This structure is opaque
+ * to the application.
+ */
+typedef struct vpx_codec_priv vpx_codec_priv_t;
- /*!\brief Iterator
- *
- * Opaque storage used for iterating over lists.
- */
- typedef const void *vpx_codec_iter_t;
+/*!\brief Iterator
+ *
+ * Opaque storage used for iterating over lists.
+ */
+typedef const void *vpx_codec_iter_t;
- /*!\brief Codec context structure
- *
- * All codecs \ref MUST support this context structure fully. In general,
- * this data should be considered private to the codec algorithm, and
- * not be manipulated or examined by the calling application. Applications
- * may reference the 'name' member to get a printable description of the
- * algorithm.
- */
- typedef struct vpx_codec_ctx {
+/*!\brief Codec context structure
+ *
+ * All codecs \ref MUST support this context structure fully. In general,
+ * this data should be considered private to the codec algorithm, and
+ * not be manipulated or examined by the calling application. Applications
+ * may reference the 'name' member to get a printable description of the
+ * algorithm.
+ */
+typedef struct vpx_codec_ctx {
const char *name; /**< Printable interface name */
vpx_codec_iface_t *iface; /**< Interface pointers */
vpx_codec_err_t err; /**< Last returned error */
const char *err_detail; /**< Detailed info, if available */
vpx_codec_flags_t init_flags; /**< Flags passed at init time */
union {
- struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
- struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
- void *raw;
+ struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */
+ struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */
+ void *raw;
} config; /**< Configuration pointer aliasing union */
vpx_codec_priv_t *priv; /**< Algorithm private storage */
- } vpx_codec_ctx_t;
-
-
- /*
- * Library Version Number Interface
- *
- * For example, see the following sample return values:
- * vpx_codec_version() (1<<16 | 2<<8 | 3)
- * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
- * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
- */
-
- /*!\brief Return the version information (as an integer)
- *
- * Returns a packed encoding of the library version number. This will only include
- * the major.minor.patch component of the version number. Note that this encoded
- * value should be accessed through the macros provided, as the encoding may change
- * in the future.
- *
- */
- int vpx_codec_version(void);
+} vpx_codec_ctx_t;
+
+
+/*
+ * Library Version Number Interface
+ *
+ * For example, see the following sample return values:
+ * vpx_codec_version() (1<<16 | 2<<8 | 3)
+ * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba"
+ * vpx_codec_version_extra_str() "rc1-16-gec6a1ba"
+ */
+
+/*!\brief Return the version information (as an integer)
+ *
+ * Returns a packed encoding of the library version number. This will only include
+ * the major.minor.patch component of the version number. Note that this encoded
+ * value should be accessed through the macros provided, as the encoding may change
+ * in the future.
+ *
+ */
+int vpx_codec_version(void);
#define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */
#define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */
#define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */
- /*!\brief Return the version major number */
+/*!\brief Return the version major number */
#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff)
- /*!\brief Return the version minor number */
+/*!\brief Return the version minor number */
#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff)
- /*!\brief Return the version patch number */
+/*!\brief Return the version patch number */
#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff)
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable string containing the full library version number. This may
- * contain additional text following the three digit version number, as to indicate
- * release candidates, prerelease versions, etc.
- *
- */
- const char *vpx_codec_version_str(void);
-
-
- /*!\brief Return the version information (as a string)
- *
- * Returns a printable "extra string". This is the component of the string returned
- * by vpx_codec_version_str() following the three digit version number.
- *
- */
- const char *vpx_codec_version_extra_str(void);
-
-
- /*!\brief Return the build configuration
- *
- * Returns a printable string containing an encoded version of the build
- * configuration. This may be useful to vpx support.
- *
- */
- const char *vpx_codec_build_config(void);
-
-
- /*!\brief Return the name for a given interface
- *
- * Returns a human readable string for name of the given codec interface.
- *
- * \param[in] iface Interface pointer
- *
- */
- const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
-
-
- /*!\brief Convert error number to printable string
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] err Error number.
- *
- */
- const char *vpx_codec_err_to_string(vpx_codec_err_t err);
-
-
- /*!\brief Retrieve error synopsis for codec context
- *
- * Returns a human readable string for the last error returned by the
- * algorithm. The returned error will be one line and will not contain
- * any newline characters.
- *
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- */
- const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Retrieve detailed error information for codec context
- *
- * Returns a human readable string providing detailed information about
- * the last error.
- *
- * \param[in] ctx Pointer to this instance's context.
- *
- * \retval NULL
- * No detailed information is available.
- */
- const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
-
-
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all codecs.
- * They represent the base case functionality expected of all codecs.
- */
-
- /*!\brief Destroy a codec instance
- *
- * Destroys a codec context, freeing any associated memory buffers.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval #VPX_CODEC_OK
- * The codec algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
-
-
- /*!\brief Get the capabilities of an algorithm.
- *
- * Retrieves the capabilities bitfield from the algorithm's interface.
- *
- * \param[in] iface Pointer to the algorithm interface
- *
- */
- vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
-
-
- /*!\brief Control algorithm
- *
- * This function is used to exchange algorithm specific data with the codec
- * instance. This can be used to implement features specific to a particular
- * algorithm.
- *
- * This wrapper function dispatches the request to the helper function
- * associated with the given ctrl_id. It tries to call this function
- * transparently, but will return #VPX_CODEC_ERROR if the request could not
- * be dispatched.
- *
- * Note that this function should not be used directly. Call the
- * #vpx_codec_control wrapper macro instead.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] ctrl_id Algorithm specific control identifier
- *
- * \retval #VPX_CODEC_OK
- * The control request was processed.
- * \retval #VPX_CODEC_ERROR
- * The control request was not processed.
- * \retval #VPX_CODEC_INVALID_PARAM
- * The data was not valid.
- */
- vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
- int ctrl_id,
- ...);
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable string containing the full library version number. This may
+ * contain additional text following the three digit version number, as to indicate
+ * release candidates, prerelease versions, etc.
+ *
+ */
+const char *vpx_codec_version_str(void);
+
+
+/*!\brief Return the version information (as a string)
+ *
+ * Returns a printable "extra string". This is the component of the string returned
+ * by vpx_codec_version_str() following the three digit version number.
+ *
+ */
+const char *vpx_codec_version_extra_str(void);
+
+
+/*!\brief Return the build configuration
+ *
+ * Returns a printable string containing an encoded version of the build
+ * configuration. This may be useful to vpx support.
+ *
+ */
+const char *vpx_codec_build_config(void);
+
+
+/*!\brief Return the name for a given interface
+ *
+ * Returns a human readable string for name of the given codec interface.
+ *
+ * \param[in] iface Interface pointer
+ *
+ */
+const char *vpx_codec_iface_name(vpx_codec_iface_t *iface);
+
+
+/*!\brief Convert error number to printable string
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] err Error number.
+ *
+ */
+const char *vpx_codec_err_to_string(vpx_codec_err_t err);
+
+
+/*!\brief Retrieve error synopsis for codec context
+ *
+ * Returns a human readable string for the last error returned by the
+ * algorithm. The returned error will be one line and will not contain
+ * any newline characters.
+ *
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ */
+const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Retrieve detailed error information for codec context
+ *
+ * Returns a human readable string providing detailed information about
+ * the last error.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ *
+ * \retval NULL
+ * No detailed information is available.
+ */
+const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+
+
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all codecs.
+ * They represent the base case functionality expected of all codecs.
+ */
+
+/*!\brief Destroy a codec instance
+ *
+ * Destroys a codec context, freeing any associated memory buffers.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval #VPX_CODEC_OK
+ * The codec algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
+
+
+/*!\brief Get the capabilities of an algorithm.
+ *
+ * Retrieves the capabilities bitfield from the algorithm's interface.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ *
+ */
+vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface);
+
+
+/*!\brief Control algorithm
+ *
+ * This function is used to exchange algorithm specific data with the codec
+ * instance. This can be used to implement features specific to a particular
+ * algorithm.
+ *
+ * This wrapper function dispatches the request to the helper function
+ * associated with the given ctrl_id. It tries to call this function
+ * transparently, but will return #VPX_CODEC_ERROR if the request could not
+ * be dispatched.
+ *
+ * Note that this function should not be used directly. Call the
+ * #vpx_codec_control wrapper macro instead.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] ctrl_id Algorithm specific control identifier
+ *
+ * \retval #VPX_CODEC_OK
+ * The control request was processed.
+ * \retval #VPX_CODEC_ERROR
+ * The control request was not processed.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * The data was not valid.
+ */
+vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
+ int ctrl_id,
+ ...);
#if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS
# define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data)
# define VPX_CTRL_USE_TYPE(id, typ)
@@ -386,30 +386,30 @@ extern "C" {
# define VPX_CTRL_VOID(id, typ)
#else
- /*!\brief vpx_codec_control wrapper macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_().
- *
- * \internal
- * It works by dispatching the call to the control function through a wrapper
- * function named with the id parameter.
- */
+/*!\brief vpx_codec_control wrapper macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_().
+ *
+ * \internal
+ * It works by dispatching the call to the control function through a wrapper
+ * function named with the id parameter.
+ */
# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\
/**<\hideinitializer*/
- /*!\brief vpx_codec_control type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It defines the type of the argument for a given
- * control identifier.
- *
- * \internal
- * It defines a static function with
- * the correctly typed arguments as a wrapper to the type-unsafe internal
- * function.
- */
+/*!\brief vpx_codec_control type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It defines the type of the argument for a given
+ * control identifier.
+ *
+ * \internal
+ * It defines a static function with
+ * the correctly typed arguments as a wrapper to the type-unsafe internal
+ * function.
+ */
# define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\
@@ -420,16 +420,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control deprecated type definition macro
- *
- * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
- * deprecated and should not be used. Consult the documentation for your
- * codec for more information.
- *
- * \internal
- * It defines a static function with the correctly typed arguments as a
- * wrapper to the type-unsafe internal function.
- */
+/*!\brief vpx_codec_control deprecated type definition macro
+ *
+ * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is
+ * deprecated and should not be used. Consult the documentation for your
+ * codec for more information.
+ *
+ * \internal
+ * It defines a static function with the correctly typed arguments as a
+ * wrapper to the type-unsafe internal function.
+ */
# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\
@@ -440,16 +440,16 @@ extern "C" {
} /**<\hideinitializer*/
- /*!\brief vpx_codec_control void type definition macro
- *
- * This macro allows for type safe conversions across the variadic parameter
- * to vpx_codec_control_(). It indicates that a given control identifier takes
- * no argument.
- *
- * \internal
- * It defines a static function without a data argument as a wrapper to the
- * type-unsafe internal function.
- */
+/*!\brief vpx_codec_control void type definition macro
+ *
+ * This macro allows for type safe conversions across the variadic parameter
+ * to vpx_codec_control_(). It indicates that a given control identifier takes
+ * no argument.
+ *
+ * \internal
+ * It defines a static function without a data argument as a wrapper to the
+ * type-unsafe internal function.
+ */
# define VPX_CTRL_VOID(id) \
static vpx_codec_err_t \
vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\
@@ -463,23 +463,23 @@ extern "C" {
#endif
- /*!\defgroup cap_xma External Memory Allocation Functions
- *
- * The following functions are required to be implemented for all codecs
- * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_INCAPABLE
- * @{
- */
+/*!\defgroup cap_xma External Memory Allocation Functions
+ *
+ * The following functions are required to be implemented for all codecs
+ * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_INCAPABLE
+ * @{
+ */
- /*!\brief Memory Map Entry
- *
- * This structure is used to contain the properties of a memory segment. It
- * is populated by the codec in the request phase, and by the calling
- * application once the requested allocation has been performed.
- */
- typedef struct vpx_codec_mmap {
+/*!\brief Memory Map Entry
+ *
+ * This structure is used to contain the properties of a memory segment. It
+ * is populated by the codec in the request phase, and by the calling
+ * application once the requested allocation has been performed.
+ */
+typedef struct vpx_codec_mmap {
/*
* The following members are set by the codec when requesting a segment
*/
@@ -495,62 +495,62 @@ extern "C" {
void *base; /**< pointer to the allocated segment */
void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */
void *priv; /**< allocator private storage */
- } vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
-
-
- /*!\brief Iterate over the list of segments to allocate.
- *
- * Iterates over a list of the segments to allocate. The iterator storage
- * should be initialized to NULL to start the iteration. Iteration is complete
- * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
- * allocate is dependent upon the size of the encoded stream. In cases where the
- * stream is not available at allocation time, a fixed size must be requested.
- * The codec will not be able to operate on streams larger than the size used at
- * allocation time.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[out] mmap Pointer to the memory map entry to populate.
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \retval #VPX_CODEC_OK
- * The memory map entry was populated.
- * \retval #VPX_CODEC_ERROR
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Unable to determine segment size from stream info.
- */
- vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmap,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Identify allocated segments to codec instance
- *
- * Stores a list of allocated segments in the codec. Segments \ref MUST be
- * passed in the order they are read from vpx_codec_get_mem_map(), but may be
- * passed in groups of any size. Segments \ref MUST be set only once. The
- * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
- * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
- * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] mmaps Pointer to the first memory map entry in the list.
- * \param[in] num_maps Number of entries being set at this time
- *
- * \retval #VPX_CODEC_OK
- * The segment was stored in the codec context.
- * \retval #VPX_CODEC_INCAPABLE
- * Codec does not support XMA mode.
- * \retval #VPX_CODEC_MEM_ERROR
- * Segment base address was not set, or segment was already stored.
-
- */
- vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmaps,
- unsigned int num_maps);
-
- /*!@} - end defgroup cap_xma*/
- /*!@} - end defgroup codec*/
+} vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */
+
+
+/*!\brief Iterate over the list of segments to allocate.
+ *
+ * Iterates over a list of the segments to allocate. The iterator storage
+ * should be initialized to NULL to start the iteration. Iteration is complete
+ * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to
+ * allocate is dependent upon the size of the encoded stream. In cases where the
+ * stream is not available at allocation time, a fixed size must be requested.
+ * The codec will not be able to operate on streams larger than the size used at
+ * allocation time.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[out] mmap Pointer to the memory map entry to populate.
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \retval #VPX_CODEC_OK
+ * The memory map entry was populated.
+ * \retval #VPX_CODEC_ERROR
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Unable to determine segment size from stream info.
+ */
+vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmap,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Identify allocated segments to codec instance
+ *
+ * Stores a list of allocated segments in the codec. Segments \ref MUST be
+ * passed in the order they are read from vpx_codec_get_mem_map(), but may be
+ * passed in groups of any size. Segments \ref MUST be set only once. The
+ * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member
+ * is non-NULL. If the segment requires cleanup handling (e.g., calling free()
+ * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] mmaps Pointer to the first memory map entry in the list.
+ * \param[in] num_maps Number of entries being set at this time
+ *
+ * \retval #VPX_CODEC_OK
+ * The segment was stored in the codec context.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Codec does not support XMA mode.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Segment base address was not set, or segment was already stored.
+
+ */
+vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmaps,
+ unsigned int num_maps);
+
+/*!@} - end defgroup cap_xma*/
+/*!@} - end defgroup codec*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/vpx/vpx_decoder.h b/thirdparties/wince/include/vpx/vpx_decoder.h
index ba18328..e0fb255 100755
--- a/thirdparties/wince/include/vpx/vpx_decoder.h
+++ b/thirdparties/wince/include/vpx/vpx_decoder.h
@@ -32,24 +32,24 @@ extern "C" {
#include "./vpx_codec.h"
#include "./vpx_frame_buffer.h"
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_DECODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Decoder capabilities bitfield
- *
- * Each decoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
- * or functionality, and are not required to be supported by a decoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Decoder capabilities bitfield
+ *
+ * Each decoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces
+ * or functionality, and are not required to be supported by a decoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
@@ -58,13 +58,13 @@ extern "C" {
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames
one fragment at a time */
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow for
- * proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow for
+ * proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based
multi-threading */
#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external
@@ -79,302 +79,302 @@ extern "C" {
#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based
multi-threading */
- /*!\brief Stream properties
- *
- * This structure is used to query or set properties of the decoded
- * stream. Algorithms may extend this structure with data specific
- * to their bitstream by setting the sz member appropriately.
- */
- typedef struct vpx_codec_stream_info {
+/*!\brief Stream properties
+ *
+ * This structure is used to query or set properties of the decoded
+ * stream. Algorithms may extend this structure with data specific
+ * to their bitstream by setting the sz member appropriately.
+ */
+typedef struct vpx_codec_stream_info {
unsigned int sz; /**< Size of this structure */
unsigned int w; /**< Width (or 0 for unknown/default) */
unsigned int h; /**< Height (or 0 for unknown/default) */
unsigned int is_kf; /**< Current frame is a keyframe */
- } vpx_codec_stream_info_t;
+} vpx_codec_stream_info_t;
- /* REQUIRED FUNCTIONS
- *
- * The following functions are required to be implemented for all decoders.
- * They represent the base case functionality expected of all decoders.
- */
+/* REQUIRED FUNCTIONS
+ *
+ * The following functions are required to be implemented for all decoders.
+ * They represent the base case functionality expected of all decoders.
+ */
- /*!\brief Initialization Configurations
- *
- * This structure is used to pass init time configuration options to the
- * decoder.
- */
- typedef struct vpx_codec_dec_cfg {
+/*!\brief Initialization Configurations
+ *
+ * This structure is used to pass init time configuration options to the
+ * decoder.
+ */
+typedef struct vpx_codec_dec_cfg {
unsigned int threads; /**< Maximum number of threads to use, default 1 */
unsigned int w; /**< Width */
unsigned int h; /**< Height */
- } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
-
-
- /*!\brief Initialize a decoder instance
- *
- * Initializes a decoder context using the given interface. Applications
- * should call the vpx_codec_dec_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_DECODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
- /*!\brief Convenience macro for vpx_codec_dec_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
+
+
+/*!\brief Initialize a decoder instance
+ *
+ * Initializes a decoder context using the given interface. Applications
+ * should call the vpx_codec_dec_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_DECODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_dec_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+/*!\brief Convenience macro for vpx_codec_dec_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_dec_init(ctx, iface, cfg, flags) \
vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
- /*!\brief Parse stream info from a buffer
- *
- * Performs high level parsing of the bitstream. Construction of a decoder
- * context is not necessary. Can be used to determine if the bitstream is
- * of the proper format, and to extract information from the stream.
- *
- * \param[in] iface Pointer to the algorithm interface
- * \param[in] data Pointer to a block of data to parse
- * \param[in] data_sz Size of the data buffer
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Return information about the current stream.
- *
- * Returns information about the stream that has been parsed during decoding.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] si Pointer to stream info to update. The size member
- * \ref MUST be properly initialized, but \ref MAY be
- * clobbered by the algorithm. This parameter \ref MAY
- * be NULL.
- *
- * \retval #VPX_CODEC_OK
- * Bitstream is parsable and stream information updated
- */
- vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
- vpx_codec_stream_info_t *si);
-
-
- /*!\brief Decode data
- *
- * Processes a buffer of coded data. If the processing results in a new
- * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
- * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
- * time stamp) order. Frames produced will always be in PTS (presentation
- * time stamp) order.
- * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
- * data and data_sz can contain a fragment of the encoded frame. Fragment
- * \#n must contain at least partition \#n, but can also contain subsequent
- * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
- * be empty. When no more data is available, this function should be called
- * with NULL as data and 0 as data_sz. The memory passed to this function
- * must be available until the frame has been decoded.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] data Pointer to this block of new coded data. If
- * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
- * for the previously decoded frame.
- * \param[in] data_sz Size of the coded data, in bytes.
- * \param[in] user_priv Application specific data to associate with
- * this frame.
- * \param[in] deadline Soft deadline the decoder should attempt to meet,
- * in us. Set to zero for unlimited.
- *
- * \return Returns #VPX_CODEC_OK if the coded data was processed completely
- * and future pictures can be decoded without error. Otherwise,
- * see the descriptions of the other error codes in ::vpx_codec_err_t
- * for recoverability capabilities.
- */
- vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
- const uint8_t *data,
- unsigned int data_sz,
- void *user_priv,
- long deadline);
-
-
- /*!\brief Decoded frames iterator
- *
- * Iterates over a list of the frames available for display. The iterator
- * storage should be initialized to NULL to start the iteration. Iteration is
- * complete when this function returns NULL.
- *
- * The list of available frames becomes valid upon completion of the
- * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an image, if one is ready for display. Frames
- * produced will always be in PTS (presentation time stamp) order.
- */
- vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\defgroup cap_put_frame Frame-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put frame callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of decoded image data.
- */
- typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
- const vpx_image_t *img);
-
-
- /*!\brief Register for notification of frame completion.
- *
- * Registers a given function to be called when a decoded frame is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_frame_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_frame */
-
- /*!\defgroup cap_put_slice Slice-Based Decoding Functions
- *
- * The following functions are required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
- * for codecs that don't advertise this capability will result in an error
- * code being returned, usually VPX_CODEC_ERROR
- * @{
- */
-
- /*!\brief put slice callback prototype
- *
- * This callback is invoked by the decoder to notify the application of
- * the availability of partially decoded image data. The
- */
- typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
- const vpx_image_t *img,
- const vpx_image_rect_t *valid,
- const vpx_image_rect_t *update);
-
-
- /*!\brief Register for notification of slice completion.
- *
- * Registers a given function to be called when a decoded slice is
- * available.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb Pointer to the callback function
- * \param[in] user_priv User's private data
- *
- * \retval #VPX_CODEC_OK
- * Callback successfully registered.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * posting slice completion.
- */
- vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
- vpx_codec_put_slice_cb_fn_t cb,
- void *user_priv);
-
-
- /*!@} - end defgroup cap_put_slice*/
-
- /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions
- *
- * The following section is required to be implemented for all decoders
- * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability.
- * Calling this function for codecs that don't advertise this capability
- * will result in an error code being returned, usually VPX_CODEC_ERROR.
- *
- * \note
- * Currently this only works with VP9.
- * @{
- */
-
- /*!\brief Pass in external frame buffers for the decoder to use.
- *
- * Registers functions to be called when libvpx needs a frame buffer
- * to decode the current frame and a function to be called when libvpx does
- * not internally reference the frame buffer. This set function must
- * be called before the first call to decode or libvpx will assume the
- * default behavior of allocating frame buffers internally.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cb_get Pointer to the get callback function
- * \param[in] cb_release Pointer to the release callback function
- * \param[in] cb_priv Callback's private data
- *
- * \retval #VPX_CODEC_OK
- * External frame buffers will be used by libvpx.
- * \retval #VPX_CODEC_INVALID_PARAM
- * One or more of the callbacks were NULL.
- * \retval #VPX_CODEC_ERROR
- * Decoder context not initialized, or algorithm not capable of
- * using external frame buffers.
- *
- * \note
- * When decoding VP9, the application may be required to pass in at least
- * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
- * buffers.
- */
- vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
- vpx_codec_ctx_t *ctx,
- vpx_get_frame_buffer_cb_fn_t cb_get,
- vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
-
- /*!@} - end defgroup cap_external_frame_buffer */
-
- /*!@} - end defgroup decoder*/
+/*!\brief Parse stream info from a buffer
+ *
+ * Performs high level parsing of the bitstream. Construction of a decoder
+ * context is not necessary. Can be used to determine if the bitstream is
+ * of the proper format, and to extract information from the stream.
+ *
+ * \param[in] iface Pointer to the algorithm interface
+ * \param[in] data Pointer to a block of data to parse
+ * \param[in] data_sz Size of the data buffer
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
+ const uint8_t *data,
+ unsigned int data_sz,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Return information about the current stream.
+ *
+ * Returns information about the stream that has been parsed during decoding.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] si Pointer to stream info to update. The size member
+ * \ref MUST be properly initialized, but \ref MAY be
+ * clobbered by the algorithm. This parameter \ref MAY
+ * be NULL.
+ *
+ * \retval #VPX_CODEC_OK
+ * Bitstream is parsable and stream information updated
+ */
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+ vpx_codec_stream_info_t *si);
+
+
+/*!\brief Decode data
+ *
+ * Processes a buffer of coded data. If the processing results in a new
+ * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be
+ * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode
+ * time stamp) order. Frames produced will always be in PTS (presentation
+ * time stamp) order.
+ * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled,
+ * data and data_sz can contain a fragment of the encoded frame. Fragment
+ * \#n must contain at least partition \#n, but can also contain subsequent
+ * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must
+ * be empty. When no more data is available, this function should be called
+ * with NULL as data and 0 as data_sz. The memory passed to this function
+ * must be available until the frame has been decoded.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] data Pointer to this block of new coded data. If
+ * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted
+ * for the previously decoded frame.
+ * \param[in] data_sz Size of the coded data, in bytes.
+ * \param[in] user_priv Application specific data to associate with
+ * this frame.
+ * \param[in] deadline Soft deadline the decoder should attempt to meet,
+ * in us. Set to zero for unlimited.
+ *
+ * \return Returns #VPX_CODEC_OK if the coded data was processed completely
+ * and future pictures can be decoded without error. Otherwise,
+ * see the descriptions of the other error codes in ::vpx_codec_err_t
+ * for recoverability capabilities.
+ */
+vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
+ const uint8_t *data,
+ unsigned int data_sz,
+ void *user_priv,
+ long deadline);
+
+
+/*!\brief Decoded frames iterator
+ *
+ * Iterates over a list of the frames available for display. The iterator
+ * storage should be initialized to NULL to start the iteration. Iteration is
+ * complete when this function returns NULL.
+ *
+ * The list of available frames becomes valid upon completion of the
+ * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an image, if one is ready for display. Frames
+ * produced will always be in PTS (presentation time stamp) order.
+ */
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\defgroup cap_put_frame Frame-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put frame callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of decoded image data.
+ */
+typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img);
+
+
+/*!\brief Register for notification of frame completion.
+ *
+ * Registers a given function to be called when a decoded frame is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_frame_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_frame */
+
+/*!\defgroup cap_put_slice Slice-Based Decoding Functions
+ *
+ * The following functions are required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions
+ * for codecs that don't advertise this capability will result in an error
+ * code being returned, usually VPX_CODEC_ERROR
+ * @{
+ */
+
+/*!\brief put slice callback prototype
+ *
+ * This callback is invoked by the decoder to notify the application of
+ * the availability of partially decoded image data. The
+ */
+typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
+ const vpx_image_t *img,
+ const vpx_image_rect_t *valid,
+ const vpx_image_rect_t *update);
+
+
+/*!\brief Register for notification of slice completion.
+ *
+ * Registers a given function to be called when a decoded slice is
+ * available.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb Pointer to the callback function
+ * \param[in] user_priv User's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * Callback successfully registered.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * posting slice completion.
+ */
+vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
+ vpx_codec_put_slice_cb_fn_t cb,
+ void *user_priv);
+
+
+/*!@} - end defgroup cap_put_slice*/
+
+/*!\defgroup cap_external_frame_buffer External Frame Buffer Functions
+ *
+ * The following section is required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability.
+ * Calling this function for codecs that don't advertise this capability
+ * will result in an error code being returned, usually VPX_CODEC_ERROR.
+ *
+ * \note
+ * Currently this only works with VP9.
+ * @{
+ */
+
+/*!\brief Pass in external frame buffers for the decoder to use.
+ *
+ * Registers functions to be called when libvpx needs a frame buffer
+ * to decode the current frame and a function to be called when libvpx does
+ * not internally reference the frame buffer. This set function must
+ * be called before the first call to decode or libvpx will assume the
+ * default behavior of allocating frame buffers internally.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb_get Pointer to the get callback function
+ * \param[in] cb_release Pointer to the release callback function
+ * \param[in] cb_priv Callback's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * External frame buffers will be used by libvpx.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * One or more of the callbacks were NULL.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * using external frame buffers.
+ *
+ * \note
+ * When decoding VP9, the application may be required to pass in at least
+ * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
+ * buffers.
+ */
+vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
+ vpx_codec_ctx_t *ctx,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
+
+/*!@} - end defgroup cap_external_frame_buffer */
+
+/*!@} - end defgroup decoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/vpx/vpx_encoder.h b/thirdparties/wince/include/vpx/vpx_encoder.h
index 571ad3f..940af44 100755
--- a/thirdparties/wince/include/vpx/vpx_encoder.h
+++ b/thirdparties/wince/include/vpx/vpx_encoder.h
@@ -31,18 +31,18 @@ extern "C" {
#include "./vpx_codec.h"
- /*! Temporal Scalability: Maximum length of the sequence defining frame
- * layer membership
- */
+/*! Temporal Scalability: Maximum length of the sequence defining frame
+ * layer membership
+ */
#define VPX_TS_MAX_PERIODICITY 16
- /*! Temporal Scalability: Maximum number of coding layers */
+/*! Temporal Scalability: Maximum number of coding layers */
#define VPX_TS_MAX_LAYERS 5
- /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
+/*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
- /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
+/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */
#define MAX_LAYERS VPX_TS_MAX_LAYERS
/*! Spatial Scalability: Maximum number of coding layers */
@@ -51,74 +51,74 @@ extern "C" {
/*! Spatial Scalability: Default number of coding layers */
#define VPX_SS_DEFAULT_LAYERS 1
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
- /*! \brief Encoder capabilities bitfield
- *
- * Each encoder advertises the capabilities it supports as part of its
- * ::vpx_codec_iface_t interface structure. Capabilities are extra
- * interfaces or functionality, and are not required to be supported
- * by an encoder.
- *
- * The available flags are specified by VPX_CODEC_CAP_* defines.
- */
+/*! \brief Encoder capabilities bitfield
+ *
+ * Each encoder advertises the capabilities it supports as part of its
+ * ::vpx_codec_iface_t interface structure. Capabilities are extra
+ * interfaces or functionality, and are not required to be supported
+ * by an encoder.
+ *
+ * The available flags are specified by VPX_CODEC_CAP_* defines.
+ */
#define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
- /*! Can output one partition at a time. Each partition is returned in its
- * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
- * every partition but the last. In this mode all frames are always
- * returned partition by partition.
- */
+/*! Can output one partition at a time. Each partition is returned in its
+ * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for
+ * every partition but the last. In this mode all frames are always
+ * returned partition by partition.
+ */
#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
- /*! \brief Initialization-time Feature Enabling
- *
- * Certain codec features must be known at initialization time, to allow
- * for proper memory allocation.
- *
- * The available flags are specified by VPX_CODEC_USE_* defines.
- */
+/*! \brief Initialization-time Feature Enabling
+ *
+ * Certain codec features must be known at initialization time, to allow
+ * for proper memory allocation.
+ *
+ * The available flags are specified by VPX_CODEC_USE_* defines.
+ */
#define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one
partition at a time. */
- /*!\brief Generic fixed size buffer structure
- *
- * This structure is able to hold a reference to any fixed size buffer.
- */
- typedef struct vpx_fixed_buf {
+/*!\brief Generic fixed size buffer structure
+ *
+ * This structure is able to hold a reference to any fixed size buffer.
+ */
+typedef struct vpx_fixed_buf {
void *buf; /**< Pointer to the data */
size_t sz; /**< Length of the buffer, in chars */
- } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
+} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */
- /*!\brief Time Stamp Type
- *
- * An integer, which when multiplied by the stream's time base, provides
- * the absolute time of a sample.
- */
- typedef int64_t vpx_codec_pts_t;
+/*!\brief Time Stamp Type
+ *
+ * An integer, which when multiplied by the stream's time base, provides
+ * the absolute time of a sample.
+ */
+typedef int64_t vpx_codec_pts_t;
- /*!\brief Compressed Frame Flags
- *
- * This type represents a bitfield containing information about a compressed
- * frame that may be useful to an application. The most significant 16 bits
- * can be used by an algorithm to provide additional detail, for example to
- * support frame types that are codec specific (MPEG-1 D-frames for example)
- */
- typedef uint32_t vpx_codec_frame_flags_t;
+/*!\brief Compressed Frame Flags
+ *
+ * This type represents a bitfield containing information about a compressed
+ * frame that may be useful to an application. The most significant 16 bits
+ * can be used by an algorithm to provide additional detail, for example to
+ * support frame types that are codec specific (MPEG-1 D-frames for example)
+ */
+typedef uint32_t vpx_codec_frame_flags_t;
#define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */
#define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting
the stream (no future frame depends on
@@ -128,13 +128,13 @@ extern "C" {
#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded
frame */
- /*!\brief Error Resilient flags
- *
- * These flags define which error resilient features to enable in the
- * encoder. The flags are specified through the
- * vpx_codec_enc_cfg::g_error_resilient variable.
- */
- typedef uint32_t vpx_codec_er_flags_t;
+/*!\brief Error Resilient flags
+ *
+ * These flags define which error resilient features to enable in the
+ * encoder. The flags are specified through the
+ * vpx_codec_enc_cfg::g_error_resilient variable.
+ */
+typedef uint32_t vpx_codec_er_flags_t;
#define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against
losses of whole frames */
#define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are
@@ -146,122 +146,122 @@ extern "C" {
predicition is still done over
the partition boundary. */
- /*!\brief Encoder output packet variants
- *
- * This enumeration lists the different kinds of data packets that can be
- * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
- * extend this list to provide additional functionality.
- */
- enum vpx_codec_cx_pkt_kind {
+/*!\brief Encoder output packet variants
+ *
+ * This enumeration lists the different kinds of data packets that can be
+ * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
+ * extend this list to provide additional functionality.
+ */
+enum vpx_codec_cx_pkt_kind {
VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
- };
+};
- /*!\brief Encoder output packet
- *
- * This structure contains the different kinds of output data the encoder
- * may produce while compressing a frame.
- */
- typedef struct vpx_codec_cx_pkt {
+/*!\brief Encoder output packet
+ *
+ * This structure contains the different kinds of output data the encoder
+ * may produce while compressing a frame.
+ */
+typedef struct vpx_codec_cx_pkt {
enum vpx_codec_cx_pkt_kind kind; /**< packet variant */
union {
- struct {
- void *buf; /**< compressed data buffer */
- size_t sz; /**< length of compressed data */
- vpx_codec_pts_t pts; /**< time stamp to show frame
+ struct {
+ void *buf; /**< compressed data buffer */
+ size_t sz; /**< length of compressed data */
+ vpx_codec_pts_t pts; /**< time stamp to show frame
(in timebase units) */
- unsigned long duration; /**< duration to show frame
+ unsigned long duration; /**< duration to show frame
(in timebase units) */
- vpx_codec_frame_flags_t flags; /**< flags for this frame */
- int partition_id; /**< the partition id
+ vpx_codec_frame_flags_t flags; /**< flags for this frame */
+ int partition_id; /**< the partition id
defines the decoding order
of the partitions. Only
applicable when "output partition"
mode is enabled. First partition
has id 0.*/
- } frame; /**< data for compressed frame packet */
- struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
- struct vpx_psnr_pkt {
- unsigned int samples[4]; /**< Number of samples, total/y/u/v */
- uint64_t sse[4]; /**< sum squared error, total/y/u/v */
- double psnr[4]; /**< PSNR, total/y/u/v */
- } psnr; /**< data for PSNR packet */
- struct vpx_fixed_buf raw; /**< data for arbitrary packets */
-
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
+ } frame; /**< data for compressed frame packet */
+ struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */
+ struct vpx_psnr_pkt {
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
+ double psnr[4]; /**< PSNR, total/y/u/v */
+ } psnr; /**< data for PSNR packet */
+ struct vpx_fixed_buf raw; /**< data for arbitrary packets */
+
+ /* This packet size is fixed to allow codecs to extend this
+ * interface without having to manage storage for raw packets,
+ * i.e., if it's smaller than 128 bytes, you can store in the
+ * packet list directly.
+ */
+ char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
} data; /**< packet data */
- } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
+} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */
- /*!\brief Rational Number
- *
- * This structure holds a fractional value.
- */
- typedef struct vpx_rational {
+/*!\brief Rational Number
+ *
+ * This structure holds a fractional value.
+ */
+typedef struct vpx_rational {
int num; /**< fraction numerator */
int den; /**< fraction denominator */
- } vpx_rational_t; /**< alias for struct vpx_rational */
+} vpx_rational_t; /**< alias for struct vpx_rational */
- /*!\brief Multi-pass Encoding Pass */
- enum vpx_enc_pass {
+/*!\brief Multi-pass Encoding Pass */
+enum vpx_enc_pass {
VPX_RC_ONE_PASS, /**< Single pass mode */
VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */
- };
+};
- /*!\brief Rate control mode */
- enum vpx_rc_mode {
+/*!\brief Rate control mode */
+enum vpx_rc_mode {
VPX_VBR, /**< Variable Bit Rate (VBR) mode */
VPX_CBR, /**< Constant Bit Rate (CBR) mode */
VPX_CQ, /**< Constrained Quality (CQ) mode */
VPX_Q, /**< Constant Quality (Q) mode */
- };
-
-
- /*!\brief Keyframe placement mode.
- *
- * This enumeration determines whether keyframes are placed automatically by
- * the encoder or whether this behavior is disabled. Older releases of this
- * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
- * This name is confusing for this behavior, so the new symbols to be used
- * are VPX_KF_AUTO and VPX_KF_DISABLED.
- */
- enum vpx_kf_mode {
+};
+
+
+/*!\brief Keyframe placement mode.
+ *
+ * This enumeration determines whether keyframes are placed automatically by
+ * the encoder or whether this behavior is disabled. Older releases of this
+ * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled.
+ * This name is confusing for this behavior, so the new symbols to be used
+ * are VPX_KF_AUTO and VPX_KF_DISABLED.
+ */
+enum vpx_kf_mode {
VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */
VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */
VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
- };
+};
- /*!\brief Encoded Frame Flags
- *
- * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
- * per-frame boolean values. By convention, bits common to all codecs will be
- * named VPX_EFLAG_*, and bits specific to an algorithm will be named
- * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
- */
- typedef long vpx_enc_frame_flags_t;
+/*!\brief Encoded Frame Flags
+ *
+ * This type indicates a bitfield to be passed to vpx_codec_encode(), defining
+ * per-frame boolean values. By convention, bits common to all codecs will be
+ * named VPX_EFLAG_*, and bits specific to an algorithm will be named
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
+ */
+typedef long vpx_enc_frame_flags_t;
#define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */
- /*!\brief Encoder configuration structure
- *
- * This structure contains the encoder settings that have common representations
- * across all codecs. This doesn't imply that all codecs support all features,
- * however.
- */
- typedef struct vpx_codec_enc_cfg {
+/*!\brief Encoder configuration structure
+ *
+ * This structure contains the encoder settings that have common representations
+ * across all codecs. This doesn't imply that all codecs support all features,
+ * however.
+ */
+typedef struct vpx_codec_enc_cfg {
/*
* generic settings (g)
*/
@@ -667,146 +667,146 @@ extern "C" {
* ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1).
*/
unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
- } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
-
-
- /*!\brief Initialize an encoder instance
- *
- * Initializes a encoder context using the given interface. Applications
- * should call the vpx_codec_enc_init convenience macro instead of this
- * function directly, to ensure that the ABI version number parameter
- * is properly initialized.
- *
- * If the library was configured with --disable-multithread, this call
- * is not thread safe and should be guarded with a lock if being used
- * in a multithreaded context.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
+
+
+/*!\brief Initialize an encoder instance
+ *
+ * Initializes a encoder context using the given interface. Applications
+ * should call the vpx_codec_enc_init convenience macro instead of this
+ * function directly, to ensure that the ABI version number parameter
+ * is properly initialized.
+ *
+ * If the library was configured with --disable-multithread, this call
+ * is not thread safe and should be guarded with a lock if being used
+ * in a multithreaded context.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_flags_t flags,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init(ctx, iface, cfg, flags) \
vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
- /*!\brief Initialize multi-encoder instance
- *
- * Initializes multi-encoder context using the given interface.
- * Applications should call the vpx_codec_enc_init_multi convenience macro
- * instead of this function directly, to ensure that the ABI version number
- * parameter is properly initialized.
- *
- * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
- * parameter), the storage pointed to by the cfg parameter must be
- * kept readable and stable until all memory maps have been set.
- *
- * \param[in] ctx Pointer to this instance's context.
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
- * \param[in] num_enc Total number of encoders.
- * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
- * \param[in] dsf Pointer to down-sampling factors.
- * \param[in] ver ABI version number. Must be set to
- * VPX_ENCODER_ABI_VERSION
- * \retval #VPX_CODEC_OK
- * The decoder algorithm initialized.
- * \retval #VPX_CODEC_MEM_ERROR
- * Memory allocation failed.
- */
- vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- int num_enc,
- vpx_codec_flags_t flags,
- vpx_rational_t *dsf,
- int ver);
-
-
- /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
- *
- * Ensures the ABI version parameter is properly set.
- */
+/*!\brief Initialize multi-encoder instance
+ *
+ * Initializes multi-encoder context using the given interface.
+ * Applications should call the vpx_codec_enc_init_multi convenience macro
+ * instead of this function directly, to ensure that the ABI version number
+ * parameter is properly initialized.
+ *
+ * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags
+ * parameter), the storage pointed to by the cfg parameter must be
+ * kept readable and stable until all memory maps have been set.
+ *
+ * \param[in] ctx Pointer to this instance's context.
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] num_enc Total number of encoders.
+ * \param[in] flags Bitfield of VPX_CODEC_USE_* flags
+ * \param[in] dsf Pointer to down-sampling factors.
+ * \param[in] ver ABI version number. Must be set to
+ * VPX_ENCODER_ABI_VERSION
+ * \retval #VPX_CODEC_OK
+ * The decoder algorithm initialized.
+ * \retval #VPX_CODEC_MEM_ERROR
+ * Memory allocation failed.
+ */
+vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ int num_enc,
+ vpx_codec_flags_t flags,
+ vpx_rational_t *dsf,
+ int ver);
+
+
+/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver()
+ *
+ * Ensures the ABI version parameter is properly set.
+ */
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
VPX_ENCODER_ABI_VERSION)
- /*!\brief Get a default configuration
- *
- * Initializes a encoder configuration structure with default values. Supports
- * the notion of "usages" so that an algorithm may offer different default
- * settings depending on the user's intended goal. This function \ref SHOULD
- * be called by all applications to initialize the configuration structure
- * before specializing the configuration with application specific values.
- *
- * \param[in] iface Pointer to the algorithm interface to use.
- * \param[out] cfg Configuration buffer to populate
- * \param[in] usage End usage. Set to 0 or use codec specific values.
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
- vpx_codec_enc_cfg_t *cfg,
- unsigned int usage);
-
-
- /*!\brief Set or change configuration
- *
- * Reconfigures an encoder instance according to the given configuration.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] cfg Configuration buffer to use
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, or the usage value was not recognized.
- */
- vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
- const vpx_codec_enc_cfg_t *cfg);
-
-
- /*!\brief Get global stream headers
- *
- * Retrieves a stream level global header packet, if supported by the codec.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \retval NULL
- * Encoder does not support global header
- * \retval Non-NULL
- * Pointer to buffer containing global header packet
- */
- vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
+/*!\brief Get a default configuration
+ *
+ * Initializes a encoder configuration structure with default values. Supports
+ * the notion of "usages" so that an algorithm may offer different default
+ * settings depending on the user's intended goal. This function \ref SHOULD
+ * be called by all applications to initialize the configuration structure
+ * before specializing the configuration with application specific values.
+ *
+ * \param[in] iface Pointer to the algorithm interface to use.
+ * \param[out] cfg Configuration buffer to populate
+ * \param[in] usage End usage. Set to 0 or use codec specific values.
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
+ vpx_codec_enc_cfg_t *cfg,
+ unsigned int usage);
+
+
+/*!\brief Set or change configuration
+ *
+ * Reconfigures an encoder instance according to the given configuration.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cfg Configuration buffer to use
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, or the usage value was not recognized.
+ */
+vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
+ const vpx_codec_enc_cfg_t *cfg);
+
+
+/*!\brief Get global stream headers
+ *
+ * Retrieves a stream level global header packet, if supported by the codec.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \retval NULL
+ * Encoder does not support global header
+ * \retval Non-NULL
+ * Pointer to buffer containing global header packet
+ */
+vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx);
#define VPX_DL_REALTIME (1) /**< deadline parameter analogous to
@@ -815,141 +815,141 @@ extern "C" {
* VPx GOOD QUALITY mode. */
#define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to
* VPx BEST QUALITY mode. */
- /*!\brief Encode a frame
- *
- * Encodes a video frame at the given "presentation time." The presentation
- * time stamp (PTS) \ref MUST be strictly increasing.
- *
- * The encoder supports the notion of a soft real-time deadline. Given a
- * non-zero value to the deadline parameter, the encoder will make a "best
- * effort" guarantee to return before the given time slice expires. It is
- * implicit that limiting the available time to encode will degrade the
- * output quality. The encoder can be given an unlimited time to produce the
- * best possible frame by specifying a deadline of '0'. This deadline
- * supercedes the VPx notion of "best quality, good quality, realtime".
- * Applications that wish to map these former settings to the new deadline
- * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
- * and #VPX_DL_BEST_QUALITY.
- *
- * When the last frame has been passed to the encoder, this function should
- * continue to be called, with the img parameter set to NULL. This will
- * signal the end-of-stream condition to the encoder and allow it to encode
- * any held buffers. Encoding is complete when vpx_codec_encode() is called
- * and vpx_codec_get_cx_data() returns no data.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] img Image data to encode, NULL to flush.
- * \param[in] pts Presentation time stamp, in timebase units.
- * \param[in] duration Duration to show frame, in timebase units.
- * \param[in] flags Flags to use for encoding this frame.
- * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
- *
- * \retval #VPX_CODEC_OK
- * The configuration was populated.
- * \retval #VPX_CODEC_INCAPABLE
- * Interface is not an encoder interface.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
- const vpx_image_t *img,
- vpx_codec_pts_t pts,
- unsigned long duration,
- vpx_enc_frame_flags_t flags,
- unsigned long deadline);
-
- /*!\brief Set compressed data output buffer
- *
- * Sets the buffer that the codec should output the compressed data
- * into. This call effectively sets the buffer pointer returned in the
- * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
- * appended into this buffer. The buffer is preserved across frames,
- * so applications must periodically call this function after flushing
- * the accumulated compressed data to disk or to the network to reset
- * the pointer to the buffer's head.
- *
- * `pad_before` bytes will be skipped before writing the compressed
- * data, and `pad_after` bytes will be appended to the packet. The size
- * of the packet will be the sum of the size of the actual compressed
- * data, pad_before, and pad_after. The padding bytes will be preserved
- * (not overwritten).
- *
- * Note that calling this function does not guarantee that the returned
- * compressed data will be placed into the specified buffer. In the
- * event that the encoded data will not fit into the buffer provided,
- * the returned packet \ref MAY point to an internal buffer, as it would
- * if this call were never used. In this event, the output packet will
- * NOT have any padding, and the application must free space and copy it
- * to the proper place. This is of particular note in configurations
- * that may output multiple packets for a single encoded frame (e.g., lagged
- * encoding) or if the application does not reset the buffer periodically.
- *
- * Applications may restore the default behavior of the codec providing
- * the compressed data buffer by calling this function with a NULL
- * buffer.
- *
- * Applications \ref MUSTNOT call this function during iteration of
- * vpx_codec_get_cx_data().
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in] buf Buffer to store compressed data into
- * \param[in] pad_before Bytes to skip before writing compressed data
- * \param[in] pad_after Bytes to skip after writing compressed data
- *
- * \retval #VPX_CODEC_OK
- * The buffer was set successfully.
- * \retval #VPX_CODEC_INVALID_PARAM
- * A parameter was NULL, the image format is unsupported, etc.
- */
- vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
- const vpx_fixed_buf_t *buf,
- unsigned int pad_before,
- unsigned int pad_after);
-
-
- /*!\brief Encoded data iterator
- *
- * Iterates over a list of data packets to be passed from the encoder to the
- * application. The different kinds of packets available are enumerated in
- * #vpx_codec_cx_pkt_kind.
- *
- * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
- * muxer. Multiple compressed frames may be in the list.
- * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
- *
- * The application \ref MUST silently ignore any packet kinds that it does
- * not recognize or support.
- *
- * The data buffers returned from this function are only guaranteed to be
- * valid until the application makes another call to any vpx_codec_* function.
- *
- * \param[in] ctx Pointer to this instance's context
- * \param[in,out] iter Iterator storage, initialized to NULL
- *
- * \return Returns a pointer to an output data packet (compressed frame data,
- * two-pass statistics, etc.) or NULL to signal end-of-list.
- *
- */
- const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter);
-
-
- /*!\brief Get Preview Frame
- *
- * Returns an image that can be used as a preview. Shows the image as it would
- * exist at the decompressor. The application \ref MUST NOT write into this
- * image buffer.
- *
- * \param[in] ctx Pointer to this instance's context
- *
- * \return Returns a pointer to a preview image, or NULL if no image is
- * available.
- *
- */
- const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
-
-
- /*!@} - end defgroup encoder*/
+/*!\brief Encode a frame
+ *
+ * Encodes a video frame at the given "presentation time." The presentation
+ * time stamp (PTS) \ref MUST be strictly increasing.
+ *
+ * The encoder supports the notion of a soft real-time deadline. Given a
+ * non-zero value to the deadline parameter, the encoder will make a "best
+ * effort" guarantee to return before the given time slice expires. It is
+ * implicit that limiting the available time to encode will degrade the
+ * output quality. The encoder can be given an unlimited time to produce the
+ * best possible frame by specifying a deadline of '0'. This deadline
+ * supercedes the VPx notion of "best quality, good quality, realtime".
+ * Applications that wish to map these former settings to the new deadline
+ * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY,
+ * and #VPX_DL_BEST_QUALITY.
+ *
+ * When the last frame has been passed to the encoder, this function should
+ * continue to be called, with the img parameter set to NULL. This will
+ * signal the end-of-stream condition to the encoder and allow it to encode
+ * any held buffers. Encoding is complete when vpx_codec_encode() is called
+ * and vpx_codec_get_cx_data() returns no data.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] img Image data to encode, NULL to flush.
+ * \param[in] pts Presentation time stamp, in timebase units.
+ * \param[in] duration Duration to show frame, in timebase units.
+ * \param[in] flags Flags to use for encoding this frame.
+ * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
+ *
+ * \retval #VPX_CODEC_OK
+ * The configuration was populated.
+ * \retval #VPX_CODEC_INCAPABLE
+ * Interface is not an encoder interface.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned long duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned long deadline);
+
+/*!\brief Set compressed data output buffer
+ *
+ * Sets the buffer that the codec should output the compressed data
+ * into. This call effectively sets the buffer pointer returned in the
+ * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
+ * appended into this buffer. The buffer is preserved across frames,
+ * so applications must periodically call this function after flushing
+ * the accumulated compressed data to disk or to the network to reset
+ * the pointer to the buffer's head.
+ *
+ * `pad_before` bytes will be skipped before writing the compressed
+ * data, and `pad_after` bytes will be appended to the packet. The size
+ * of the packet will be the sum of the size of the actual compressed
+ * data, pad_before, and pad_after. The padding bytes will be preserved
+ * (not overwritten).
+ *
+ * Note that calling this function does not guarantee that the returned
+ * compressed data will be placed into the specified buffer. In the
+ * event that the encoded data will not fit into the buffer provided,
+ * the returned packet \ref MAY point to an internal buffer, as it would
+ * if this call were never used. In this event, the output packet will
+ * NOT have any padding, and the application must free space and copy it
+ * to the proper place. This is of particular note in configurations
+ * that may output multiple packets for a single encoded frame (e.g., lagged
+ * encoding) or if the application does not reset the buffer periodically.
+ *
+ * Applications may restore the default behavior of the codec providing
+ * the compressed data buffer by calling this function with a NULL
+ * buffer.
+ *
+ * Applications \ref MUSTNOT call this function during iteration of
+ * vpx_codec_get_cx_data().
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] buf Buffer to store compressed data into
+ * \param[in] pad_before Bytes to skip before writing compressed data
+ * \param[in] pad_after Bytes to skip after writing compressed data
+ *
+ * \retval #VPX_CODEC_OK
+ * The buffer was set successfully.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * A parameter was NULL, the image format is unsupported, etc.
+ */
+vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
+ const vpx_fixed_buf_t *buf,
+ unsigned int pad_before,
+ unsigned int pad_after);
+
+
+/*!\brief Encoded data iterator
+ *
+ * Iterates over a list of data packets to be passed from the encoder to the
+ * application. The different kinds of packets available are enumerated in
+ * #vpx_codec_cx_pkt_kind.
+ *
+ * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's
+ * muxer. Multiple compressed frames may be in the list.
+ * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer.
+ *
+ * The application \ref MUST silently ignore any packet kinds that it does
+ * not recognize or support.
+ *
+ * The data buffers returned from this function are only guaranteed to be
+ * valid until the application makes another call to any vpx_codec_* function.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in,out] iter Iterator storage, initialized to NULL
+ *
+ * \return Returns a pointer to an output data packet (compressed frame data,
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
+ *
+ */
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter);
+
+
+/*!\brief Get Preview Frame
+ *
+ * Returns an image that can be used as a preview. Shows the image as it would
+ * exist at the decompressor. The application \ref MUST NOT write into this
+ * image buffer.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ *
+ * \return Returns a pointer to a preview image, or NULL if no image is
+ * available.
+ *
+ */
+const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
+
+
+/*!@} - end defgroup encoder*/
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/wince/include/vpx/vpx_frame_buffer.h b/thirdparties/wince/include/vpx/vpx_frame_buffer.h
index e69df4b..599c990 100755
--- a/thirdparties/wince/include/vpx/vpx_frame_buffer.h
+++ b/thirdparties/wince/include/vpx/vpx_frame_buffer.h
@@ -34,9 +34,9 @@ extern "C" {
* This structure holds allocated frame buffers used by the decoder.
*/
typedef struct vpx_codec_frame_buffer {
- uint8_t *data; /**< Pointer to the data buffer */
- size_t size; /**< Size of data in bytes */
- void *priv; /**< Frame's private data */
+ uint8_t *data; /**< Pointer to the data buffer */
+ size_t size; /**< Size of data in bytes */
+ void *priv; /**< Frame's private data */
} vpx_codec_frame_buffer_t;
/*!\brief get frame buffer callback prototype
diff --git a/thirdparties/wince/include/vpx/vpx_image.h b/thirdparties/wince/include/vpx/vpx_image.h
index d45b003..ca8d2a4 100755
--- a/thirdparties/wince/include/vpx/vpx_image.h
+++ b/thirdparties/wince/include/vpx/vpx_image.h
@@ -20,14 +20,14 @@
extern "C" {
#endif
- /*!\brief Current ABI version number
- *
- * \internal
- * If this file is altered in any way that changes the ABI, this value
- * must be bumped. Examples include, but are not limited to, changing
- * types, removing or reassigning enums, adding/removing/rearranging
- * fields to structures
- */
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures
+ */
#define VPX_IMAGE_ABI_VERSION (2) /**<\hideinitializer*/
@@ -36,8 +36,8 @@ extern "C" {
#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component */
#define VPX_IMG_FMT_HIGH 0x800 /**< Image uses 16bit framebuffer */
- /*!\brief List of supported image formats */
- typedef enum vpx_img_fmt {
+/*!\brief List of supported image formats */
+typedef enum vpx_img_fmt {
VPX_IMG_FMT_NONE,
VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */
@@ -62,20 +62,21 @@ extern "C" {
VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGH,
VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGH,
VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGH
- } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
+}
+vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
#define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_IMG_FMT_PLANAR */
#define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_IMG_FMT_UV_FLIP */
#define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_IMG_FMT_HAS_ALPHA */
- /*!\brief Deprecated list of supported image formats
- * \deprecated New code should use #vpx_img_fmt
- */
+/*!\brief Deprecated list of supported image formats
+ * \deprecated New code should use #vpx_img_fmt
+ */
#define img_fmt vpx_img_fmt
- /*!\brief alias for enum img_fmt.
- * \deprecated New code should use #vpx_img_fmt_t
- */
+/*!\brief alias for enum img_fmt.
+ * \deprecated New code should use #vpx_img_fmt_t
+ */
#define img_fmt_t vpx_img_fmt_t
#define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_FMT_NONE */
@@ -98,8 +99,8 @@ extern "C" {
#define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_FMT_VPXI420 */
#endif /* VPX_CODEC_DISABLE_COMPAT */
- /**\brief Image Descriptor */
- typedef struct vpx_image {
+/**\brief Image Descriptor */
+typedef struct vpx_image {
vpx_img_fmt_t fmt; /**< Image Format */
/* Image storage dimensions */
@@ -144,103 +145,103 @@ extern "C" {
int self_allocd; /**< private */
void *fb_priv; /**< Frame buffer data associated with the image. */
- } vpx_image_t; /**< alias for struct vpx_image */
+} vpx_image_t; /**< alias for struct vpx_image */
- /**\brief Representation of a rectangle on a surface */
- typedef struct vpx_image_rect {
+/**\brief Representation of a rectangle on a surface */
+typedef struct vpx_image_rect {
unsigned int x; /**< leftmost column */
unsigned int y; /**< topmost row */
unsigned int w; /**< width */
unsigned int h; /**< height */
- } vpx_image_rect_t; /**< alias for struct vpx_image_rect */
-
- /*!\brief Open a descriptor, allocating storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for the descriptor is allocated on the heap.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of the image buffer and
- * each row in the image(stride).
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_alloc(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align);
-
- /*!\brief Open a descriptor, using existing storage for the underlying image
- *
- * Returns a descriptor for storing an image of the given format. The
- * storage for descriptor has been allocated elsewhere, and a descriptor is
- * desired to "wrap" that storage.
- *
- * \param[in] img Pointer to storage for descriptor. If this parameter
- * is NULL, the storage for the descriptor will be
- * allocated on the heap.
- * \param[in] fmt Format for the image
- * \param[in] d_w Width of the image
- * \param[in] d_h Height of the image
- * \param[in] align Alignment, in bytes, of each row in the image.
- * \param[in] img_data Storage to use for the image
- *
- * \return Returns a pointer to the initialized image descriptor. If the img
- * parameter is non-null, the value of the img parameter will be
- * returned.
- */
- vpx_image_t *vpx_img_wrap(vpx_image_t *img,
- vpx_img_fmt_t fmt,
- unsigned int d_w,
- unsigned int d_h,
- unsigned int align,
- unsigned char *img_data);
-
-
- /*!\brief Set the rectangle identifying the displayed portion of the image
- *
- * Updates the displayed rectangle (aka viewport) on the image surface to
- * match the specified coordinates and size.
- *
- * \param[in] img Image descriptor
- * \param[in] x leftmost column
- * \param[in] y topmost row
- * \param[in] w width
- * \param[in] h height
- *
- * \return 0 if the requested rectangle is valid, nonzero otherwise.
- */
- int vpx_img_set_rect(vpx_image_t *img,
- unsigned int x,
- unsigned int y,
- unsigned int w,
- unsigned int h);
-
-
- /*!\brief Flip the image vertically (top for bottom)
- *
- * Adjusts the image descriptor's pointers and strides to make the image
- * be referenced upside-down.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_flip(vpx_image_t *img);
-
- /*!\brief Close an image descriptor
- *
- * Frees all allocated storage associated with an image descriptor.
- *
- * \param[in] img Image descriptor
- */
- void vpx_img_free(vpx_image_t *img);
+} vpx_image_rect_t; /**< alias for struct vpx_image_rect */
+
+/*!\brief Open a descriptor, allocating storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for the descriptor is allocated on the heap.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of the image buffer and
+ * each row in the image(stride).
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_alloc(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align);
+
+/*!\brief Open a descriptor, using existing storage for the underlying image
+ *
+ * Returns a descriptor for storing an image of the given format. The
+ * storage for descriptor has been allocated elsewhere, and a descriptor is
+ * desired to "wrap" that storage.
+ *
+ * \param[in] img Pointer to storage for descriptor. If this parameter
+ * is NULL, the storage for the descriptor will be
+ * allocated on the heap.
+ * \param[in] fmt Format for the image
+ * \param[in] d_w Width of the image
+ * \param[in] d_h Height of the image
+ * \param[in] align Alignment, in bytes, of each row in the image.
+ * \param[in] img_data Storage to use for the image
+ *
+ * \return Returns a pointer to the initialized image descriptor. If the img
+ * parameter is non-null, the value of the img parameter will be
+ * returned.
+ */
+vpx_image_t *vpx_img_wrap(vpx_image_t *img,
+ vpx_img_fmt_t fmt,
+ unsigned int d_w,
+ unsigned int d_h,
+ unsigned int align,
+ unsigned char *img_data);
+
+
+/*!\brief Set the rectangle identifying the displayed portion of the image
+ *
+ * Updates the displayed rectangle (aka viewport) on the image surface to
+ * match the specified coordinates and size.
+ *
+ * \param[in] img Image descriptor
+ * \param[in] x leftmost column
+ * \param[in] y topmost row
+ * \param[in] w width
+ * \param[in] h height
+ *
+ * \return 0 if the requested rectangle is valid, nonzero otherwise.
+ */
+int vpx_img_set_rect(vpx_image_t *img,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h);
+
+
+/*!\brief Flip the image vertically (top for bottom)
+ *
+ * Adjusts the image descriptor's pointers and strides to make the image
+ * be referenced upside-down.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_flip(vpx_image_t *img);
+
+/*!\brief Close an image descriptor
+ *
+ * Frees all allocated storage associated with an image descriptor.
+ *
+ * \param[in] img Image descriptor
+ */
+void vpx_img_free(vpx_image_t *img);
#ifdef __cplusplus
} // extern "C"
diff --git a/tinyBFCP/include/tinybfcp/tbfcp_session.h b/tinyBFCP/include/tinybfcp/tbfcp_session.h
index 82e57f6..db251d8 100755
--- a/tinyBFCP/include/tinybfcp/tbfcp_session.h
+++ b/tinyBFCP/include/tinybfcp/tbfcp_session.h
@@ -29,17 +29,16 @@ TBFCP_BEGIN_DECLS
struct tbfcp_session_s;
struct tbfcp_pkt_s;
-typedef enum tbfcp_session_event_type_e
-{
- tbfcp_session_event_type_inf_inc_msg,
- tbfcp_session_event_type_err_send_timedout
+typedef enum tbfcp_session_event_type_e {
+ tbfcp_session_event_type_inf_inc_msg,
+ tbfcp_session_event_type_err_send_timedout
}
tbfcp_session_event_type_t;
typedef struct tbfcp_session_event_xs {
- enum tbfcp_session_event_type_e e_type;
- const struct tbfcp_pkt_s* pc_pkt;
- const void* pc_usr_data;
+ enum tbfcp_session_event_type_e e_type;
+ const struct tbfcp_pkt_s* pc_pkt;
+ const void* pc_usr_data;
} tbfcp_session_event_xt;
typedef int (*tbfcp_session_callback_f)(const struct tbfcp_session_event_xs *e);
diff --git a/tinyBFCP/include/tinybfcp/tbfcp_types.h b/tinyBFCP/include/tinybfcp/tbfcp_types.h
index 561d7be..68899b1 100755
--- a/tinyBFCP/include/tinybfcp/tbfcp_types.h
+++ b/tinyBFCP/include/tinybfcp/tbfcp_types.h
@@ -101,9 +101,9 @@ typedef enum tbfcp_role_e {
} tbfcp_role_t;
typedef enum tbfcp_setup_e {
- tbfcp_setup_active = (1 << 0),
- tbfcp_setup_passive = (1 << 1),
- tbfcp_setup_actpass = (tbfcp_setup_active | tbfcp_setup_passive),
+ tbfcp_setup_active = (1 << 0),
+ tbfcp_setup_passive = (1 << 1),
+ tbfcp_setup_actpass = (tbfcp_setup_active | tbfcp_setup_passive),
} tbfcp_setup_t;
#if !defined(kBfcpSetupDefault)
# define kBfcpSetupDefault tbfcp_setup_actpass
diff --git a/tinyBFCP/src/tbfcp_attr.c b/tinyBFCP/src/tbfcp_attr.c
index 7b5359a..cc8e2a3 100755
--- a/tinyBFCP/src/tbfcp_attr.c
+++ b/tinyBFCP/src/tbfcp_attr.c
@@ -83,9 +83,9 @@ static int _tbfcp_attr_get_size_in_octetunits(const tbfcp_attr_t* pc_self, tsk_b
}
case tbfcp_attribute_format_OctetString: {
*p_size = (TBFCP_ATTR_HDR_SIZE_IN_OCTETS + ((const tbfcp_attr_octetstring_t*)pc_self)->OctetStringLength);
- if (with_padding) {
- ALIGN_ON_32BITS(*p_size);
- }
+ if (with_padding) {
+ ALIGN_ON_32BITS(*p_size);
+ }
return 0;
}
case tbfcp_attribute_format_Grouped: {
@@ -621,25 +621,25 @@ int tbfcp_attr_grouped_add_attr(tbfcp_attr_grouped_t* p_self, tbfcp_attr_t** p_a
int tbfcp_attr_grouped_find_at(const struct tbfcp_attr_grouped_s* pc_self, enum tbfcp_attribute_format_e e_format, tsk_size_t u_index, const struct tbfcp_attr_s** ppc_attr)
{
- tsk_size_t _u_index = 0;
- const tsk_list_item_t *pc_item;
- const struct tbfcp_attr_s* pc_attr;
- if (!pc_self || !ppc_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_attr = tsk_null;
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- pc_attr = (const struct tbfcp_attr_s*)pc_item->data;
- if (!pc_attr || pc_attr->format != e_format) {
- continue;
- }
- if (_u_index++ >= u_index) {
- *ppc_attr = pc_attr;
- break;
- }
- }
- return 0;
+ tsk_size_t _u_index = 0;
+ const tsk_list_item_t *pc_item;
+ const struct tbfcp_attr_s* pc_attr;
+ if (!pc_self || !ppc_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_attr = tsk_null;
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ pc_attr = (const struct tbfcp_attr_s*)pc_item->data;
+ if (!pc_attr || pc_attr->format != e_format) {
+ continue;
+ }
+ if (_u_index++ >= u_index) {
+ *ppc_attr = pc_attr;
+ break;
+ }
+ }
+ return 0;
}
static tsk_object_t* tbfcp_attr_grouped_ctor(tsk_object_t * self, va_list * app)
diff --git a/tinyBFCP/src/tbfcp_pkt.c b/tinyBFCP/src/tbfcp_pkt.c
index 0adff65..c311bbd 100755
--- a/tinyBFCP/src/tbfcp_pkt.c
+++ b/tinyBFCP/src/tbfcp_pkt.c
@@ -209,7 +209,7 @@ int tbfcp_pkt_write_with_padding(const tbfcp_pkt_t* pc_self, uint8_t* p_buff_ptr
p_buff_ptr[0] = (((uint8_t)pc_self->hdr.ver) << 5) | (pc_self->hdr.reserved & 0x7F);
p_buff_ptr[1] = (uint8_t)pc_self->hdr.primitive;
- *((uint32_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)((*p_written - TBFCP_PKT_HDR_SIZE_IN_OCTETS) >> 2));
+ *((uint32_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)((*p_written - TBFCP_PKT_HDR_SIZE_IN_OCTETS) >> 2));
*((uint32_t*)&p_buff_ptr[4]) = (uint32_t)tnet_htonl(pc_self->hdr.conf_id);
*((uint16_t*)&p_buff_ptr[8]) = tnet_htons(pc_self->hdr.transac_id);
*((uint16_t*)&p_buff_ptr[10]) = tnet_htons(pc_self->hdr.user_id);
@@ -301,25 +301,25 @@ int tbfcp_pkt_read(const uint8_t* pc_buff_ptr, tsk_size_t n_buff_size, tbfcp_pkt
int tbfcp_pkt_attr_find_at(const struct tbfcp_pkt_s* pc_self, enum tbfcp_attribute_format_e e_format, tsk_size_t u_index, const struct tbfcp_attr_s** ppc_attr)
{
- tsk_size_t _u_index = 0;
- const tsk_list_item_t *pc_item;
- const struct tbfcp_attr_s* pc_attr;
- if (!pc_self || !ppc_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_attr = tsk_null;
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- pc_attr = (const struct tbfcp_attr_s*)pc_item->data;
- if (!pc_attr || pc_attr->format != e_format) {
- continue;
- }
- if (_u_index++ >= u_index) {
- *ppc_attr = pc_attr;
- break;
- }
- }
- return 0;
+ tsk_size_t _u_index = 0;
+ const tsk_list_item_t *pc_item;
+ const struct tbfcp_attr_s* pc_attr;
+ if (!pc_self || !ppc_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_attr = tsk_null;
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ pc_attr = (const struct tbfcp_attr_s*)pc_item->data;
+ if (!pc_attr || pc_attr->format != e_format) {
+ continue;
+ }
+ if (_u_index++ >= u_index) {
+ *ppc_attr = pc_attr;
+ break;
+ }
+ }
+ return 0;
}
diff --git a/tinyBFCP/src/tbfcp_session.c b/tinyBFCP/src/tbfcp_session.c
index e67fdb2..8459e4a 100755
--- a/tinyBFCP/src/tbfcp_session.c
+++ b/tinyBFCP/src/tbfcp_session.c
@@ -28,12 +28,12 @@
#include "tsk_debug.h"
typedef struct tbfcp_udp_pkt_s {
- TSK_DECLARE_OBJECT;
- struct {
- tsk_timer_id_t u_id;
- uint64_t u_timeout;
- } timer;
- tbfcp_pkt_t *p_pkt;
+ TSK_DECLARE_OBJECT;
+ struct {
+ tsk_timer_id_t u_id;
+ uint64_t u_timeout;
+ } timer;
+ tbfcp_pkt_t *p_pkt;
} tbfcp_udp_pkt_t;
typedef tsk_list_t tbfcp_udp_pkts_L_t;
@@ -44,26 +44,26 @@ typedef struct tbfcp_session_s {
tsk_bool_t b_stopping;
tsk_bool_t b_prepared;
- tbfcp_udp_pkts_L_t *p_list_udp_pkts;
+ tbfcp_udp_pkts_L_t *p_list_udp_pkts;
- struct {
- tbfcp_session_callback_f f_fun;
- struct tbfcp_session_event_xs e;
- } cb;
+ struct {
+ tbfcp_session_callback_f f_fun;
+ struct tbfcp_session_event_xs e;
+ } cb;
- // Values received from the server in the 200 OK. Attributes from rfc4583
- struct {
- uint32_t u_conf_id;
- uint16_t u_user_id;
- uint16_t u_floor_id;
- }
- conf_ids;
+ // Values received from the server in the 200 OK. Attributes from rfc4583
+ struct {
+ uint32_t u_conf_id;
+ uint16_t u_user_id;
+ uint16_t u_floor_id;
+ }
+ conf_ids;
- enum tbfcp_role_e e_role_local;
- enum tbfcp_role_e e_role_remote;
+ enum tbfcp_role_e e_role_local;
+ enum tbfcp_role_e e_role_remote;
- enum tbfcp_setup_e e_setup_local;
- enum tbfcp_setup_e e_setup_remote;
+ enum tbfcp_setup_e e_setup_local;
+ enum tbfcp_setup_e e_setup_remote;
enum tnet_socket_type_e e_socket_type;
char* p_local_ip;
@@ -76,7 +76,7 @@ typedef struct tbfcp_session_s {
tnet_port_t u_remote_port;
struct sockaddr_storage remote_addr;
- struct tnet_nat_ctx_s* p_natt_ctx;
+ struct tnet_nat_ctx_s* p_natt_ctx;
struct tnet_ice_ctx_s* p_ice_ctx;
struct tnet_transport_s* p_transport;
@@ -125,17 +125,19 @@ static int _tbfcp_session_transport_layer_stream_cb(const tnet_transport_event_t
#define _tbfcp_session_raise_inf_inc_msg(_p_self, _pc_pkt) _tbfcp_session_raise(_p_self, tbfcp_session_event_type_inf_inc_msg, _pc_pkt)
#define _tbfcp_session_raise_err_send_timedout(_p_self, _pc_pkt) _tbfcp_session_raise(_p_self, tbfcp_session_event_type_err_send_timedout, _pc_pkt)
-static int __pred_find_udp_pkt_by_timer(const tsk_list_item_t *item, const void *u64_id) {
- if (item && item->data) {
- return (int)(((const struct tbfcp_udp_pkt_s *)item->data)->timer.u_id - *((const uint64_t*)u64_id));
- }
- return -1;
+static int __pred_find_udp_pkt_by_timer(const tsk_list_item_t *item, const void *u64_id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tbfcp_udp_pkt_s *)item->data)->timer.u_id - *((const uint64_t*)u64_id));
+ }
+ return -1;
}
-static int __pred_find_udp_pkt_by_transac_id(const tsk_list_item_t *item, const void *u16_transac_id) {
- if (item && item->data) {
- return (int)(((const struct tbfcp_udp_pkt_s *)item->data)->p_pkt->hdr.transac_id - *((const uint16_t*)u16_transac_id));
- }
- return -1;
+static int __pred_find_udp_pkt_by_transac_id(const tsk_list_item_t *item, const void *u16_transac_id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tbfcp_udp_pkt_s *)item->data)->p_pkt->hdr.transac_id - *((const uint16_t*)u16_transac_id));
+ }
+ return -1;
}
int tbfcp_session_create(tnet_socket_type_t e_socket_type, const char* pc_local_ip, tbfcp_session_t** pp_self)
@@ -191,13 +193,13 @@ int tbfcp_session_create_2(struct tnet_ice_ctx_s* p_ice_ctx, tbfcp_session_t** p
int tbfcp_session_set_callback(struct tbfcp_session_s* p_self, tbfcp_session_callback_f f_fun, const void* pc_usr_data)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- p_self->cb.f_fun = f_fun;
- p_self->cb.e.pc_usr_data = pc_usr_data;
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ p_self->cb.f_fun = f_fun;
+ p_self->cb.e.pc_usr_data = pc_usr_data;
+ return 0;
}
int tbfcp_session_set_ice_ctx(tbfcp_session_t* p_self, struct tnet_ice_ctx_s* p_ice_ctx)
@@ -251,7 +253,7 @@ int tbfcp_session_prepare(tbfcp_session_t* p_self)
return -3;
}
// set transport callback
- if ((ret = tnet_transport_set_callback(p_self->p_transport, TNET_SOCKET_TYPE_IS_DGRAM(p_self->e_socket_type) ? _tbfcp_session_transport_layer_dgram_cb : _tbfcp_session_transport_layer_stream_cb, p_self))) {
+ if ((ret = tnet_transport_set_callback(p_self->p_transport, TNET_SOCKET_TYPE_IS_DGRAM(p_self->e_socket_type) ? _tbfcp_session_transport_layer_dgram_cb : _tbfcp_session_transport_layer_stream_cb, p_self))) {
goto bail;
}
bfcp_local_ip = p_self->p_transport->master->ip;
@@ -318,10 +320,10 @@ int tbfcp_session_start(tbfcp_session_t* p_self)
TSK_DEBUG_ERROR("Invalid BFCP host:port [%s:%u]", p_self->p_remote_ip, p_self->u_remote_port);
goto bail;
}
- if ((ret = tnet_transport_set_natt_ctx(p_self->p_transport, p_self->p_natt_ctx))) {
- TSK_DEBUG_ERROR("Failed to start to set NATT ctx for the %s transport", kBfcpTransportFriendlyName);
- goto bail;
- }
+ if ((ret = tnet_transport_set_natt_ctx(p_self->p_transport, p_self->p_natt_ctx))) {
+ TSK_DEBUG_ERROR("Failed to start to set NATT ctx for the %s transport", kBfcpTransportFriendlyName);
+ goto bail;
+ }
// start the transport
if ((ret = tnet_transport_start(p_self->p_transport))) {
@@ -331,12 +333,12 @@ int tbfcp_session_start(tbfcp_session_t* p_self)
p_self->b_started = tsk_true;
- // Send hello now if UDP/DTLS. Otherwise (TCP/TLS), wait for the connection to complete.
- //if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->e_socket_type)) {
- // if ((ret = _tbfcp_session_send_Hello(p_self))) {
- // goto bail;
- // }
- //}
+ // Send hello now if UDP/DTLS. Otherwise (TCP/TLS), wait for the connection to complete.
+ //if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->e_socket_type)) {
+ // if ((ret = _tbfcp_session_send_Hello(p_self))) {
+ // goto bail;
+ // }
+ //}
bail:
// unlock()
@@ -346,19 +348,19 @@ bail:
int tbfcp_session_pause(tbfcp_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
if (!p_self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- // lock()
+ // lock()
tsk_safeobj_lock(p_self);
- goto bail;
+ goto bail;
bail:
- // unlock()
+ // unlock()
tsk_safeobj_unlock(p_self);
return ret;
}
@@ -371,7 +373,7 @@ int tbfcp_session_stop(tbfcp_session_t* p_self)
return -1;
}
- // FIXME: send FloorRelease if a FloorRequest is pending
+ // FIXME: send FloorRelease if a FloorRequest is pending
// lock()
tsk_safeobj_lock(p_self);
@@ -382,8 +384,8 @@ int tbfcp_session_stop(tbfcp_session_t* p_self)
goto bail;
}
- // remove all pending udp packets
- tsk_list_clear_items(p_self->p_list_udp_pkts);
+ // remove all pending udp packets
+ tsk_list_clear_items(p_self->p_list_udp_pkts);
p_self->b_stopping = tsk_true;
// this is a global timer shared by many components -> stopping it won't remove
@@ -409,7 +411,7 @@ int tbfcp_session_stop(tbfcp_session_t* p_self)
p_self->b_started = tsk_false;
p_self->b_stopping = tsk_false;
- p_self->b_prepared = tsk_false;
+ p_self->b_prepared = tsk_false;
bail:
// unlock()
@@ -419,13 +421,13 @@ bail:
int tbfcp_session_set_natt_ctx(tbfcp_session_t* p_self, struct tnet_nat_ctx_s* p_natt_ctx)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(p_self->p_natt_ctx);
- p_self->p_natt_ctx = tsk_object_ref(p_natt_ctx);
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(p_self->p_natt_ctx);
+ p_self->p_natt_ctx = tsk_object_ref(p_natt_ctx);
+ return 0;
}
int tbfcp_session_set_remote_address(tbfcp_session_t* p_self, const char* pc_ip, tnet_port_t u_port)
@@ -442,52 +444,52 @@ int tbfcp_session_set_remote_address(tbfcp_session_t* p_self, const char* pc_ip,
int tbfcp_session_set_remote_role(tbfcp_session_t* p_self, enum tbfcp_role_e e_role_remote)
{
- tsk_bool_t b_is_role_acceptable;
- int ret;
- if (!p_self) {
+ tsk_bool_t b_is_role_acceptable;
+ int ret;
+ if (!p_self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if ((ret = tbfcp_utils_is_role_acceptable(p_self->e_role_local, e_role_remote, &b_is_role_acceptable))) {
- return ret;
- }
- if (!b_is_role_acceptable) {
- TSK_DEBUG_ERROR("%d not acceptable as remote role because local role = %d", e_role_remote, p_self->e_role_local);
- return -2;
- }
- p_self->e_role_remote = e_role_remote;
- return 0;
+ if ((ret = tbfcp_utils_is_role_acceptable(p_self->e_role_local, e_role_remote, &b_is_role_acceptable))) {
+ return ret;
+ }
+ if (!b_is_role_acceptable) {
+ TSK_DEBUG_ERROR("%d not acceptable as remote role because local role = %d", e_role_remote, p_self->e_role_local);
+ return -2;
+ }
+ p_self->e_role_remote = e_role_remote;
+ return 0;
}
int tbfcp_session_set_remote_setup(struct tbfcp_session_s* p_self, enum tbfcp_setup_e e_setup_remote)
{
- tsk_bool_t b_is_setup_acceptable;
- int ret;
- if (!p_self) {
+ tsk_bool_t b_is_setup_acceptable;
+ int ret;
+ if (!p_self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if ((ret = tbfcp_utils_is_setup_acceptable(p_self->e_setup_local, e_setup_remote, &b_is_setup_acceptable))) {
- return ret;
- }
- if (!b_is_setup_acceptable) {
- TSK_DEBUG_ERROR("%d not acceptable as remote setup because local setup = %d", e_setup_remote, p_self->e_setup_local);
- return -2;
- }
- p_self->e_setup_remote = e_setup_remote;
- return 0;
+ if ((ret = tbfcp_utils_is_setup_acceptable(p_self->e_setup_local, e_setup_remote, &b_is_setup_acceptable))) {
+ return ret;
+ }
+ if (!b_is_setup_acceptable) {
+ TSK_DEBUG_ERROR("%d not acceptable as remote setup because local setup = %d", e_setup_remote, p_self->e_setup_local);
+ return -2;
+ }
+ p_self->e_setup_remote = e_setup_remote;
+ return 0;
}
int tbfcp_session_set_conf_ids(tbfcp_session_t* p_self, uint32_t u_conf_id, uint16_t u_user_id, uint16_t u_floor_id)
{
- if (!p_self) {
+ if (!p_self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- p_self->conf_ids.u_conf_id = u_conf_id;
- p_self->conf_ids.u_user_id = u_user_id;
- p_self->conf_ids.u_floor_id = u_floor_id;
- return 0;
+ p_self->conf_ids.u_conf_id = u_conf_id;
+ p_self->conf_ids.u_user_id = u_user_id;
+ p_self->conf_ids.u_floor_id = u_floor_id;
+ return 0;
}
int tbfcp_session_get_profile(const tbfcp_session_t* pc_self, const char** ppc_profile)
@@ -501,90 +503,90 @@ int tbfcp_session_get_profile(const tbfcp_session_t* pc_self, const char** ppc_p
int tbfcp_session_get_local_role(const tbfcp_session_t* pc_self, enum tbfcp_role_e *pe_role_local)
{
- if (!pc_self || !pe_role_local) {
+ if (!pc_self || !pe_role_local) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- *pe_role_local = pc_self->e_role_local;
- return 0;
+ *pe_role_local = pc_self->e_role_local;
+ return 0;
}
int tbfcp_session_get_local_setup(const struct tbfcp_session_s* pc_self, enum tbfcp_setup_e *pe_setup_local)
{
- if (!pc_self || !pe_setup_local) {
+ if (!pc_self || !pe_setup_local) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- *pe_setup_local = pc_self->e_setup_local;
- return 0;
+ *pe_setup_local = pc_self->e_setup_local;
+ return 0;
}
int tbfcp_session_get_local_address(const tbfcp_session_t* pc_self, const char** ppc_ip, tnet_port_t *pu_port)
{
- if (!pc_self || !ppc_ip || !pu_port) {
+ if (!pc_self || !ppc_ip || !pu_port) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- *ppc_ip = pc_self->p_local_public_ip;
- *pu_port = pc_self->u_local_public_port;
- return 0;
+ *ppc_ip = pc_self->p_local_public_ip;
+ *pu_port = pc_self->u_local_public_port;
+ return 0;
}
int tbfcp_session_create_pkt_Hello(struct tbfcp_session_s* p_self, struct tbfcp_pkt_s** pp_pkt)
{
- int ret;
- if (!p_self || !pp_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // lock()
+ int ret;
+ if (!p_self || !pp_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // lock()
tsk_safeobj_lock(p_self);
- if ((ret = tbfcp_pkt_create_Hello(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, pp_pkt))) {
- goto bail;
- }
+ if ((ret = tbfcp_pkt_create_Hello(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, pp_pkt))) {
+ goto bail;
+ }
bail:
- // lock()
+ // lock()
tsk_safeobj_unlock(p_self);
- return ret;
+ return ret;
}
int tbfcp_session_create_pkt_FloorRequest(struct tbfcp_session_s* p_self, struct tbfcp_pkt_s** pp_pkt)
{
- int ret;
- if (!p_self || !pp_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // lock()
+ int ret;
+ if (!p_self || !pp_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // lock()
tsk_safeobj_lock(p_self);
- if ((ret = tbfcp_pkt_create_FloorRequest_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, pp_pkt))) {
- goto bail;
- }
+ if ((ret = tbfcp_pkt_create_FloorRequest_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, pp_pkt))) {
+ goto bail;
+ }
bail:
- // lock()
+ // lock()
tsk_safeobj_unlock(p_self);
- return ret;
+ return ret;
}
int tbfcp_session_create_pkt_FloorRelease(struct tbfcp_session_s* p_self, struct tbfcp_pkt_s** pp_pkt)
{
- int ret;
- if (!p_self || !pp_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // lock()
+ int ret;
+ if (!p_self || !pp_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // lock()
tsk_safeobj_lock(p_self);
- if ((ret = tbfcp_pkt_create_FloorRelease_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, pp_pkt))) {
- goto bail;
- }
+ if ((ret = tbfcp_pkt_create_FloorRelease_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, pp_pkt))) {
+ goto bail;
+ }
bail:
- // lock()
+ // lock()
tsk_safeobj_unlock(p_self);
- return ret;
+ return ret;
}
static int _tbfcp_session_send_buff(tbfcp_session_t* p_self, const void* pc_buff_ptr, tsk_size_t u_buff_size)
@@ -609,9 +611,9 @@ static int _tbfcp_session_send_buff(tbfcp_session_t* p_self, const void* pc_buff
u_sent_bytes = tnet_transport_sendto(p_self->p_transport, p_self->p_transport->master->fd, (const struct sockaddr *)&p_self->remote_addr, pc_buff_ptr, u_buff_size);
}
else {
- TSK_DEBUG_ERROR("Not implemented yet");
- ret = -3;
- goto bail;
+ TSK_DEBUG_ERROR("Not implemented yet");
+ ret = -3;
+ goto bail;
}
if (u_sent_bytes != u_buff_size) {
@@ -629,7 +631,7 @@ bail:
int tbfcp_session_send_pkt(tbfcp_session_t* p_self, const tbfcp_pkt_t* pc_pkt)
{
int ret = 0;
- tbfcp_udp_pkt_t *p_udp_pkt = tsk_null;
+ tbfcp_udp_pkt_t *p_udp_pkt = tsk_null;
if (!p_self || !pc_pkt) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -639,31 +641,32 @@ int tbfcp_session_send_pkt(tbfcp_session_t* p_self, const tbfcp_pkt_t* pc_pkt)
tsk_safeobj_lock(p_self);
if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->e_socket_type)) {
- const tsk_list_item_t* pc_item = tsk_list_find_item_by_pred(p_self->p_list_udp_pkts, __pred_find_udp_pkt_by_transac_id, &pc_pkt->hdr.transac_id);
- if (pc_item) {
- p_udp_pkt = tsk_object_ref(TSK_OBJECT(pc_item->data));
- } else {
- tbfcp_udp_pkt_t *_p_udp_pkt = tsk_null;
- if ((ret = _tbfcp_udp_pkt_create(pc_pkt, &_p_udp_pkt))) {
- goto bail;
- }
- p_udp_pkt = tsk_object_ref(_p_udp_pkt);
- tsk_list_push_back_data(p_self->p_list_udp_pkts, (void**)&_p_udp_pkt);
- }
- }
- else {
- }
+ const tsk_list_item_t* pc_item = tsk_list_find_item_by_pred(p_self->p_list_udp_pkts, __pred_find_udp_pkt_by_transac_id, &pc_pkt->hdr.transac_id);
+ if (pc_item) {
+ p_udp_pkt = tsk_object_ref(TSK_OBJECT(pc_item->data));
+ }
+ else {
+ tbfcp_udp_pkt_t *_p_udp_pkt = tsk_null;
+ if ((ret = _tbfcp_udp_pkt_create(pc_pkt, &_p_udp_pkt))) {
+ goto bail;
+ }
+ p_udp_pkt = tsk_object_ref(_p_udp_pkt);
+ tsk_list_push_back_data(p_self->p_list_udp_pkts, (void**)&_p_udp_pkt);
+ }
+ }
+ else {
+ }
- if ((ret = _tbfcp_session_send_pkt(p_self, pc_pkt))) {
- goto bail;
- }
- if (p_udp_pkt) {
- p_udp_pkt->timer.u_id = tsk_timer_manager_schedule(p_self->timer.ph_global, p_udp_pkt->timer.u_timeout, _tbfcp_session_timer_callback, p_self);
- p_udp_pkt->timer.u_timeout += kBfcpTimerT1;
- }
+ if ((ret = _tbfcp_session_send_pkt(p_self, pc_pkt))) {
+ goto bail;
+ }
+ if (p_udp_pkt) {
+ p_udp_pkt->timer.u_id = tsk_timer_manager_schedule(p_self->timer.ph_global, p_udp_pkt->timer.u_timeout, _tbfcp_session_timer_callback, p_self);
+ p_udp_pkt->timer.u_timeout += kBfcpTimerT1;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(p_udp_pkt);
+ TSK_OBJECT_SAFE_FREE(p_udp_pkt);
// unlock()
tsk_safeobj_unlock(p_self);
return ret;
@@ -715,67 +718,67 @@ bail:
int _tbfcp_session_send_Hello(tbfcp_session_t* p_self)
{
- tbfcp_pkt_t* p_pkt = tsk_null;
- int ret;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tbfcp_pkt_create_Hello(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, &p_pkt))) {
- goto bail;
- }
- if ((ret = tbfcp_session_send_pkt(p_self, p_pkt))) {
- goto bail;
- }
-
+ tbfcp_pkt_t* p_pkt = tsk_null;
+ int ret;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tbfcp_pkt_create_Hello(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, &p_pkt))) {
+ goto bail;
+ }
+ if ((ret = tbfcp_session_send_pkt(p_self, p_pkt))) {
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(p_pkt);
- return ret;
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ return ret;
}
int _tbfcp_session_send_HelloAck(tbfcp_session_t* p_self, const tbfcp_pkt_t *pc_hello)
{
- tbfcp_pkt_t* p_pkt = tsk_null;
- int ret;
- if (!p_self || !pc_hello) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tbfcp_pkt_create_HelloAck_2(pc_hello->hdr.conf_id, pc_hello->hdr.transac_id, pc_hello->hdr.user_id, &p_pkt))) {
- goto bail;
- }
- if ((ret = _tbfcp_session_send_pkt(p_self, p_pkt))) {
- goto bail;
- }
-
+ tbfcp_pkt_t* p_pkt = tsk_null;
+ int ret;
+ if (!p_self || !pc_hello) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tbfcp_pkt_create_HelloAck_2(pc_hello->hdr.conf_id, pc_hello->hdr.transac_id, pc_hello->hdr.user_id, &p_pkt))) {
+ goto bail;
+ }
+ if ((ret = _tbfcp_session_send_pkt(p_self, p_pkt))) {
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(p_pkt);
- return ret;
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ return ret;
}
static int _tbfcp_session_send_FloorRequest(tbfcp_session_t* p_self)
{
- tbfcp_pkt_t* p_pkt = tsk_null;
- int ret;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tbfcp_pkt_create_FloorRequest_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, &p_pkt))) {
- goto bail;
- }
- if ((ret = tbfcp_session_send_pkt(p_self, p_pkt))) {
- goto bail;
- }
-
+ tbfcp_pkt_t* p_pkt = tsk_null;
+ int ret;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tbfcp_pkt_create_FloorRequest_2(p_self->conf_ids.u_conf_id, tbfcp_utils_rand_u16(), p_self->conf_ids.u_user_id, p_self->conf_ids.u_floor_id, &p_pkt))) {
+ goto bail;
+ }
+ if ((ret = tbfcp_session_send_pkt(p_self, p_pkt))) {
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(p_pkt);
- return ret;
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ return ret;
}
static int _tbfcp_session_process_incoming_pkt(tbfcp_session_t* p_self, const tbfcp_pkt_t *pc_pkt)
{
- int ret = 0;
+ int ret = 0;
if (!p_self || !pc_pkt) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -784,21 +787,21 @@ static int _tbfcp_session_process_incoming_pkt(tbfcp_session_t* p_self, const tb
// lock()
tsk_safeobj_lock(p_self);
- switch (pc_pkt->hdr.primitive) {
- case tbfcp_primitive_Hello:
- if ((ret = _tbfcp_session_send_HelloAck(p_self, pc_pkt))) {
- goto bail;
- }
- break;
- case tbfcp_primitive_HelloAck:
- default:
- break;
- }
+ switch (pc_pkt->hdr.primitive) {
+ case tbfcp_primitive_Hello:
+ if ((ret = _tbfcp_session_send_HelloAck(p_self, pc_pkt))) {
+ goto bail;
+ }
+ break;
+ case tbfcp_primitive_HelloAck:
+ default:
+ break;
+ }
- // raise event
- _tbfcp_session_raise_inf_inc_msg(p_self, pc_pkt);
- // remove request
- tsk_list_remove_item_by_pred(p_self->p_list_udp_pkts, __pred_find_udp_pkt_by_transac_id, &pc_pkt->hdr.transac_id);
+ // raise event
+ _tbfcp_session_raise_inf_inc_msg(p_self, pc_pkt);
+ // remove request
+ tsk_list_remove_item_by_pred(p_self->p_list_udp_pkts, __pred_find_udp_pkt_by_transac_id, &pc_pkt->hdr.transac_id);
bail:
// unlock()
@@ -871,22 +874,24 @@ static int _tbfcp_session_timer_schedule(tbfcp_session_t* p_self, _bfcp_timer_ty
static int _tbfcp_session_timer_callback(const void* pc_arg, tsk_timer_id_t timer_id)
{
tbfcp_session_t* p_session = (tbfcp_session_t*)pc_arg;
- const tsk_list_item_t* pc_item;
+ const tsk_list_item_t* pc_item;
tsk_safeobj_lock(p_session); // must
- if (!p_session->b_started) goto bail;
- pc_item = tsk_list_find_item_by_pred(p_session->p_list_udp_pkts, __pred_find_udp_pkt_by_timer, &timer_id);
- if (pc_item) {
- tbfcp_udp_pkt_t* pc_udp_pkt = (tbfcp_udp_pkt_t*)pc_item->data;
- if (pc_udp_pkt->timer.u_timeout <= kBfcpTimerT1Max) {
- tbfcp_session_send_pkt(p_session, pc_udp_pkt->p_pkt);
- }
- else {
- // raise event
- _tbfcp_session_raise_err_send_timedout(p_session, pc_udp_pkt->p_pkt);
- // remove pkt
- tsk_list_remove_item_by_pred(p_session->p_list_udp_pkts, __pred_find_udp_pkt_by_timer, &timer_id);
- }
- }
+ if (!p_session->b_started) {
+ goto bail;
+ }
+ pc_item = tsk_list_find_item_by_pred(p_session->p_list_udp_pkts, __pred_find_udp_pkt_by_timer, &timer_id);
+ if (pc_item) {
+ tbfcp_udp_pkt_t* pc_udp_pkt = (tbfcp_udp_pkt_t*)pc_item->data;
+ if (pc_udp_pkt->timer.u_timeout <= kBfcpTimerT1Max) {
+ tbfcp_session_send_pkt(p_session, pc_udp_pkt->p_pkt);
+ }
+ else {
+ // raise event
+ _tbfcp_session_raise_err_send_timedout(p_session, pc_udp_pkt->p_pkt);
+ // remove pkt
+ tsk_list_remove_item_by_pred(p_session->p_list_udp_pkts, __pred_find_udp_pkt_by_timer, &timer_id);
+ }
+ }
#if 0
if (p_session->timer.id_T1 == timer_id) {
p_session->timer.id_T1 = TSK_INVALID_TIMER_ID;
@@ -905,36 +910,36 @@ bail:
static int _tbfcp_session_transport_layer_dgram_cb(const tnet_transport_event_t* e)
{
tbfcp_session_t* p_session = (tbfcp_session_t*)e->callback_data;
- int ret;
- tbfcp_pkt_t* p_pkt = tsk_null;
- switch(e->type){
- case event_data: {
- break;
- }
- case event_closed:
- case event_connected:
- default:{
- return 0;
- }
- }
+ int ret;
+ tbfcp_pkt_t* p_pkt = tsk_null;
+ switch(e->type) {
+ case event_data: {
+ break;
+ }
+ case event_closed:
+ case event_connected:
+ default: {
+ return 0;
+ }
+ }
- if ((ret = tbfcp_pkt_read(e->data, e->size, &p_pkt))) {
- goto bail;
- }
- if ((ret = _tbfcp_session_process_incoming_pkt(p_session, p_pkt))) {
- goto bail;
- }
+ if ((ret = tbfcp_pkt_read(e->data, e->size, &p_pkt))) {
+ goto bail;
+ }
+ if ((ret = _tbfcp_session_process_incoming_pkt(p_session, p_pkt))) {
+ goto bail;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(p_pkt);
+ TSK_OBJECT_SAFE_FREE(p_pkt);
return ret;
}
static int _tbfcp_session_transport_layer_stream_cb(const tnet_transport_event_t* e)
{
- // tbfcp_session_t* p_session = (tbfcp_session_t*)e->callback_data;
- TSK_DEBUG_ERROR("Not implemented yet");
- return -1;
+ // tbfcp_session_t* p_session = (tbfcp_session_t*)e->callback_data;
+ TSK_DEBUG_ERROR("Not implemented yet");
+ return -1;
}
static tsk_object_t* tbfcp_session_ctor(tsk_object_t * self, va_list * app)
@@ -943,18 +948,18 @@ static tsk_object_t* tbfcp_session_ctor(tsk_object_t * self, va_list * app)
if (p_session) {
p_session->timer.id_T1 = TSK_INVALID_TIMER_ID;
p_session->timer.id_T2 = TSK_INVALID_TIMER_ID;
- if (!(p_session->p_list_udp_pkts = tsk_list_create())) {
- TSK_DEBUG_ERROR("Failed to create en empty list");
- return tsk_null;
- }
+ if (!(p_session->p_list_udp_pkts = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create en empty list");
+ return tsk_null;
+ }
// get a handle for the global timer manager
if (!(p_session->timer.ph_global = tsk_timer_mgr_global_ref())) {
TSK_DEBUG_ERROR("Failed to get a reference to the global timer");
return tsk_null;
}
p_session->u_local_port = TNET_SOCKET_PORT_ANY;
- p_session->e_role_local = kBfcpRoleDefault;
- p_session->e_setup_local = kBfcpSetupDefault;
+ p_session->e_role_local = kBfcpRoleDefault;
+ p_session->e_setup_local = kBfcpSetupDefault;
tsk_safeobj_init(p_session);
}
return self;
@@ -968,15 +973,15 @@ static tsk_object_t* tbfcp_session_dtor(tsk_object_t * self)
tbfcp_session_stop(p_session);
// release the handle for the global timer manager
tsk_timer_mgr_global_unref(&p_session->timer.ph_global);
-
+
TSK_FREE(p_session->p_local_ip);
TSK_FREE(p_session->p_local_public_ip);
TSK_FREE(p_session->p_remote_ip);
TSK_FREE(p_session->p_buff_send_ptr);
- TSK_OBJECT_SAFE_FREE(p_session->p_natt_ctx);
+ TSK_OBJECT_SAFE_FREE(p_session->p_natt_ctx);
TSK_OBJECT_SAFE_FREE(p_session->p_ice_ctx);
TSK_OBJECT_SAFE_FREE(p_session->p_transport);
- TSK_OBJECT_SAFE_FREE(p_session->p_list_udp_pkts);
+ TSK_OBJECT_SAFE_FREE(p_session->p_list_udp_pkts);
tsk_safeobj_deinit(p_session);
}
@@ -1000,18 +1005,18 @@ const tsk_object_def_t *tbfcp_session_def_t = &tbfcp_session_def_s;
static int _tbfcp_udp_pkt_create(const tbfcp_pkt_t *pc_pkt, tbfcp_udp_pkt_t** pp_pkt)
{
- extern const tsk_object_def_t *tbfcp_udp_pkt_def_t;
- if (!pc_pkt || !pp_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *pp_pkt = tsk_object_new(tbfcp_udp_pkt_def_t);
- if (!(*pp_pkt)) {
- TSK_DEBUG_ERROR("Failed to create object with type= 'tbfcp_udp_pkt_def_t'");
- return -2;
- }
- (*pp_pkt)->p_pkt = tsk_object_ref(TSK_OBJECT(pc_pkt));
- return 0;
+ extern const tsk_object_def_t *tbfcp_udp_pkt_def_t;
+ if (!pc_pkt || !pp_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *pp_pkt = tsk_object_new(tbfcp_udp_pkt_def_t);
+ if (!(*pp_pkt)) {
+ TSK_DEBUG_ERROR("Failed to create object with type= 'tbfcp_udp_pkt_def_t'");
+ return -2;
+ }
+ (*pp_pkt)->p_pkt = tsk_object_ref(TSK_OBJECT(pc_pkt));
+ return 0;
}
static tsk_object_t* tbfcp_udp_pkt_ctor(tsk_object_t * self, va_list * app)
@@ -1019,7 +1024,7 @@ static tsk_object_t* tbfcp_udp_pkt_ctor(tsk_object_t * self, va_list * app)
tbfcp_udp_pkt_t *p_udp_pkt = (tbfcp_udp_pkt_t *)self;
if (p_udp_pkt) {
p_udp_pkt->timer.u_timeout = kBfcpTimerT1;
- p_udp_pkt->timer.u_id = TSK_INVALID_TIMER_ID;
+ p_udp_pkt->timer.u_id = TSK_INVALID_TIMER_ID;
}
return self;
}
@@ -1027,8 +1032,8 @@ static tsk_object_t* tbfcp_udp_pkt_dtor(tsk_object_t * self)
{
tbfcp_udp_pkt_t *p_udp_pkt = (tbfcp_udp_pkt_t *)self;
if (p_udp_pkt) {
- TSK_OBJECT_SAFE_FREE(p_udp_pkt->p_pkt);
- TSK_DEBUG_INFO("*** tbfcp_udp_pkt_t destroyed ***");
+ TSK_OBJECT_SAFE_FREE(p_udp_pkt->p_pkt);
+ TSK_DEBUG_INFO("*** tbfcp_udp_pkt_t destroyed ***");
}
return self;
}
diff --git a/tinyBFCP/src/tbfcp_utils.c b/tinyBFCP/src/tbfcp_utils.c
index 7c0ff25..d07b67d 100755
--- a/tinyBFCP/src/tbfcp_utils.c
+++ b/tinyBFCP/src/tbfcp_utils.c
@@ -95,7 +95,7 @@ int tbfcp_utils_parse_role(const char* pc_role, enum tbfcp_role_e* pe_role)
int tbfcp_utils_get_setup(enum tbfcp_role_e e_setup, const char** ppc_setup)
{
- if (!ppc_setup) {
+ if (!ppc_setup) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -117,7 +117,7 @@ int tbfcp_utils_get_setup(enum tbfcp_role_e e_setup, const char** ppc_setup)
int tbfcp_utils_parse_setup(const char* pc_setup, enum tbfcp_setup_e* pe_setup)
{
- if (!pc_setup || !pe_setup) {
+ if (!pc_setup || !pe_setup) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -139,53 +139,53 @@ int tbfcp_utils_parse_setup(const char* pc_setup, enum tbfcp_setup_e* pe_setup)
int tbfcp_utils_is_role_acceptable(enum tbfcp_role_e e_role_local, enum tbfcp_role_e e_role_proposed, tsk_bool_t *pb_acceptable)
{
- if (!pb_acceptable) {
- TSK_DEBUG_ERROR("Invalid parameter");
+ if (!pb_acceptable) {
+ TSK_DEBUG_ERROR("Invalid parameter");
return -1;
- }
- switch (e_role_local) {
- case tbfcp_role_c_only:
- *pb_acceptable = (e_role_proposed == tbfcp_role_s_only || e_role_proposed == tbfcp_role_c_s);
- break;
- case tbfcp_role_s_only:
- *pb_acceptable = (e_role_proposed == tbfcp_role_c_only || e_role_proposed == tbfcp_role_c_s);
- break;
- case tbfcp_role_c_s:
- *pb_acceptable = tsk_true;
- break;
- default:
- *pb_acceptable = tsk_false;
- break;
- }
- return 0;
+ }
+ switch (e_role_local) {
+ case tbfcp_role_c_only:
+ *pb_acceptable = (e_role_proposed == tbfcp_role_s_only || e_role_proposed == tbfcp_role_c_s);
+ break;
+ case tbfcp_role_s_only:
+ *pb_acceptable = (e_role_proposed == tbfcp_role_c_only || e_role_proposed == tbfcp_role_c_s);
+ break;
+ case tbfcp_role_c_s:
+ *pb_acceptable = tsk_true;
+ break;
+ default:
+ *pb_acceptable = tsk_false;
+ break;
+ }
+ return 0;
}
int tbfcp_utils_is_setup_acceptable(enum tbfcp_setup_e e_setup_local, enum tbfcp_setup_e e_setup_proposed, tsk_bool_t *pb_acceptable)
{
- if (!pb_acceptable) {
- TSK_DEBUG_ERROR("Invalid parameter");
+ if (!pb_acceptable) {
+ TSK_DEBUG_ERROR("Invalid parameter");
return -1;
- }
- switch (e_setup_local) {
- case tbfcp_setup_active:
- *pb_acceptable = (e_setup_proposed == tbfcp_setup_passive || e_setup_proposed == tbfcp_setup_actpass);
- break;
- case tbfcp_setup_passive:
- *pb_acceptable = (e_setup_proposed == tbfcp_setup_active || e_setup_proposed == tbfcp_setup_actpass);
- break;
- case tbfcp_setup_actpass:
- *pb_acceptable = tsk_true;
- break;
- default:
- *pb_acceptable = tsk_false;
- break;
- }
- return 0;
+ }
+ switch (e_setup_local) {
+ case tbfcp_setup_active:
+ *pb_acceptable = (e_setup_proposed == tbfcp_setup_passive || e_setup_proposed == tbfcp_setup_actpass);
+ break;
+ case tbfcp_setup_passive:
+ *pb_acceptable = (e_setup_proposed == tbfcp_setup_active || e_setup_proposed == tbfcp_setup_actpass);
+ break;
+ case tbfcp_setup_actpass:
+ *pb_acceptable = tsk_true;
+ break;
+ default:
+ *pb_acceptable = tsk_false;
+ break;
+ }
+ return 0;
}
uint16_t tbfcp_utils_rand_u16()
{
- static long __rand = 0;
- long num = tsk_atomic_inc(&__rand);
- return ((num % 0xFF) << 8) | (tsk_time_epoch() % 0xFF);
+ static long __rand = 0;
+ long num = tsk_atomic_inc(&__rand);
+ return ((num % 0xFF) << 8) | (tsk_time_epoch() % 0xFF);
}
diff --git a/tinyDAV/include/tinydav.h b/tinyDAV/include/tinydav.h
index 31fd6f6..e1264d1 100755
--- a/tinyDAV/include/tinydav.h
+++ b/tinyDAV/include/tinydav.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
index d6b0673..5df148b 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,27 +33,26 @@ TDAV_BEGIN_DECLS
#include <alsa/asoundlib.h>
-typedef struct tdav_common_alsa_s
-{
- tsk_bool_t b_initialized;
- tsk_bool_t b_muted;
- tsk_bool_t b_started;
- tsk_bool_t b_prepared;
- tsk_bool_t b_paused;
- tsk_bool_t b_capture;
-
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- uint8_t* p_buff_ptr;
+typedef struct tdav_common_alsa_s {
+ tsk_bool_t b_initialized;
+ tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_paused;
+ tsk_bool_t b_capture;
+
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ uint8_t* p_buff_ptr;
+
+ int channels;
+ int sample_rate;
- int channels;
- int sample_rate;
-
- snd_pcm_t *p_handle;
- snd_pcm_hw_params_t *p_params;
- char* p_device_name;
+ snd_pcm_t *p_handle;
+ snd_pcm_hw_params_t *p_params;
+ char* p_device_name;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_common_alsa_t;
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
index ae9f0f9..362cd03 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
index 78fd4eb..74561c4 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
index 128681a..3db4e6a 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
index c7b1954..f278b4c 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -40,16 +40,15 @@ TDAV_BEGIN_DECLS
# define CoreAudioPlayBuffers 3
#endif
-typedef struct tdav_consumer_audioqueue_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
-
- tsk_bool_t started;
-
+typedef struct tdav_consumer_audioqueue_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+
+ tsk_bool_t started;
+
AudioStreamBasicDescription description;
AudioQueueRef queue;
AudioQueueBufferRef buffers[CoreAudioPlayBuffers];
-
+
tsk_size_t buffer_size;
}
tdav_consumer_audioqueue_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
index 509f787..ca48978 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -36,26 +36,25 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_consumer_audiounit_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
-
- tdav_audiounit_handle_t* audioUnitHandle;
- unsigned started:1;
- unsigned paused:1;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- tsk_ssize_t leftBytes;
- SpeexBuffer* buffer;
- tsk_size_t size;
- tsk_mutex_handle_t* mutex;
- } ring;
-
- tmedia_resampler_t *resampler;
+typedef struct tdav_consumer_audiounit_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+
+ tdav_audiounit_handle_t* audioUnitHandle;
+ unsigned started:1;
+ unsigned paused:1;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ tsk_ssize_t leftBytes;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ tsk_mutex_handle_t* mutex;
+ } ring;
+
+ tmedia_resampler_t *resampler;
}
tdav_consumer_audiounit_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
index 27c9b98..4a858a9 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -40,16 +40,15 @@ TDAV_BEGIN_DECLS
#define CoreAudioRecordBuffers 3
-typedef struct tdav_producer_audioqueue_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t started;
-
+typedef struct tdav_producer_audioqueue_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t started;
+
AudioStreamBasicDescription description;
AudioQueueRef queue;
AudioQueueBufferRef buffers[CoreAudioRecordBuffers];
-
+
tsk_size_t buffer_size;
}
tdav_producer_audioqueue_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
index c1a99cb..bcc44d7 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -35,23 +35,22 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_producer_audiounit_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tdav_audiounit_handle_t* audioUnitHandle;
- unsigned started:1;
- unsigned paused:1;
+typedef struct tdav_producer_audiounit_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tdav_audiounit_handle_t* audioUnitHandle;
+ unsigned started:1;
+ unsigned paused:1;
unsigned muted;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } ring;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } ring;
}
tdav_producer_audiounit_t;
diff --git a/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h b/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
index dbba1a8..1cc5331 100755
--- a/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
+++ b/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h b/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
index 1f68008..7252fa9 100755
--- a/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
+++ b/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h b/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
index 64deeef..278457b 100755
--- a/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
+++ b/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h b/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
index 2fa00ff..c32462b 100755
--- a/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
+++ b/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h b/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
index c561d84..4f8cc48 100755
--- a/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,15 +38,14 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_AUDIO(self) ((tdav_consumer_audio_t*)(self))
-typedef struct tdav_consumer_audio_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- struct tmedia_denoise_s* denoise;
- struct tmedia_resampler_s* resampler;
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_consumer_audio_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ struct tmedia_denoise_s* denoise;
+ struct tmedia_resampler_s* resampler;
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
index c6d2449..f248da1 100755
--- a/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
@@ -1,21 +1,21 @@
/* File from: http://cms.speakup.nl/tech/opensource/jitterbuffer/verslag-20051209.pdf/ */
/*******************************************************
- * jitterbuffer:
- * an application-independent jitterbuffer, which tries
+ * jitterbuffer:
+ * an application-independent jitterbuffer, which tries
* to achieve the maximum user perception during a call.
* For more information look at:
* http://www.speakup.nl/opensource/jitterbuffer/
*
* Copyright on this file is held by:
- * - Jesse Kaijen <jesse@speakup.nl>
+ * - Jesse Kaijen <jesse@speakup.nl>
* - SpeakUp <info@speakup.nl>
*
* Contributors:
* Jesse Kaijen <jesse@speakup.nl>
*
* Version: 1.1
- *
+ *
* Changelog:
* 1.0 => 1.1 (2006-03-24) (thanks to Micheal Jerris, freeswitch.org)
* - added MSVC 2005 project files
@@ -25,13 +25,13 @@
* This program is free software, distributed under the terms of:
* - the GNU Lesser (Library) General Public License
* - the Mozilla Public License
- *
+ *
* if you are interested in an different licence type, please contact us.
*
- * How to use the jitterbuffer, please look at the comments
+ * How to use the jitterbuffer, please look at the comments
* in the headerfile.
*
- * Further details on specific implementations,
+ * Further details on specific implementations,
* please look at the comments in the code file.
*/
@@ -48,26 +48,26 @@ TDAV_BEGIN_DECLS
* The header file consists of four parts.
* - configuration constants, structs and parameter definitions
* - functions
- * - How to use the jitterbuffer and
+ * - How to use the jitterbuffer and
* which responsibilities do YOU have
* - debug messages explained
*/
// configuration constants
-/* Number of historical timestamps to use in calculating jitter and jitterbuffer size */
+/* Number of historical timestamps to use in calculating jitter and jitterbuffer size */
#ifndef JB_HISTORY_SIZE
# define JB_HISTORY_SIZE 500
#endif
/* minimum jitterbuffer size, disabled if 0 */
#define JB_MIN_SIZE 0
-/* maximum jitterbuffer size, disabled if 0 */
+/* maximum jitterbuffer size, disabled if 0 */
#define JB_MAX_SIZE 0
- /* maximum successive interpolating frames, disabled if 0 */
+/* maximum successive interpolating frames, disabled if 0 */
#define JB_MAX_SUCCESSIVE_INTERP 0
/* amount of extra delay allowed before shrinking */
-#define JB_ALLOW_EXTRA_DELAY 30
+#define JB_ALLOW_EXTRA_DELAY 30
/* ms between growing */
#define JB_WAIT_GROW 60
/* ms between shrinking */
@@ -77,70 +77,70 @@ TDAV_BEGIN_DECLS
//structs
typedef struct jb_info {
- long frames_received; /* Number of frames received by the jitterbuffer */
- long frames_late; /* Number of frames that were late */
- long frames_lost; /* Number of frames that were lost */
- long frames_ooo; /* Number of frames that were Out Of Order */
- long frames_dropped; /* Number of frames that were dropped due shrinkage of the jitterbuffer */
- long frames_dropped_twice; /* Number of frames that were dropped because this timestamp was already in the jitterbuffer */
-
- long delay; /* Current delay due the jitterbuffer */
- long jitter; /* jitter measured within current history interval*/
- long losspct; /* recent lost frame percentage (network and jitterbuffer loss) */
-
- long delay_target; /* The delay where we want to grow to */
- long losspct_jb; /* recent lost percentage due the jitterbuffer */
- long last_voice_ms; /* the duration of the last voice frame */
- short silence; /* If we are in silence 1-yes 0-no */
- long iqr; /* Inter Quartile Range of current history, if the squareroot is taken it is a good estimate of jitter */
+ long frames_received; /* Number of frames received by the jitterbuffer */
+ long frames_late; /* Number of frames that were late */
+ long frames_lost; /* Number of frames that were lost */
+ long frames_ooo; /* Number of frames that were Out Of Order */
+ long frames_dropped; /* Number of frames that were dropped due shrinkage of the jitterbuffer */
+ long frames_dropped_twice; /* Number of frames that were dropped because this timestamp was already in the jitterbuffer */
+
+ long delay; /* Current delay due the jitterbuffer */
+ long jitter; /* jitter measured within current history interval*/
+ long losspct; /* recent lost frame percentage (network and jitterbuffer loss) */
+
+ long delay_target; /* The delay where we want to grow to */
+ long losspct_jb; /* recent lost percentage due the jitterbuffer */
+ long last_voice_ms; /* the duration of the last voice frame */
+ short silence; /* If we are in silence 1-yes 0-no */
+ long iqr; /* Inter Quartile Range of current history, if the squareroot is taken it is a good estimate of jitter */
} jb_info;
typedef struct jb_frame {
- void *data; /* the frame data */
- long ts; /* the senders timestamp */
- long ms; /* length of this frame in ms */
- int type; /* the type of frame */
- int codec; /* codec of this frame, undefined if nonvoice */
- struct jb_frame *next, *prev; /* pointers to the next and previous frames in the queue */
+ void *data; /* the frame data */
+ long ts; /* the senders timestamp */
+ long ms; /* length of this frame in ms */
+ int type; /* the type of frame */
+ int codec; /* codec of this frame, undefined if nonvoice */
+ struct jb_frame *next, *prev; /* pointers to the next and previous frames in the queue */
} jb_frame;
typedef struct jb_hist_element {
- long delay; /* difference between time of arrival and senders timestamp */
- long ts; /* senders timestamp */
- long ms; /* length of this frame in ms */
- int codec; /* wich codec this frame has */
-} jb_hist_element;
+ long delay; /* difference between time of arrival and senders timestamp */
+ long ts; /* senders timestamp */
+ long ms; /* length of this frame in ms */
+ int codec; /* wich codec this frame has */
+} jb_hist_element;
typedef struct jb_settings {
- /* settings */
- long min_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
- long max_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
- long max_successive_interp; /* the maximum count of successive interpolations before assuming silence */
- long extra_delay; /* amount of extra delay allowed before shrinking */
- long wait_grow; /* ms between growing */
- long wait_shrink; /* ms between shrinking */
- long max_diff; /* maximum number of milliseconds the jitterbuffer may be off */
+ /* settings */
+ long min_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
+ long max_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
+ long max_successive_interp; /* the maximum count of successive interpolations before assuming silence */
+ long extra_delay; /* amount of extra delay allowed before shrinking */
+ long wait_grow; /* ms between growing */
+ long wait_shrink; /* ms between shrinking */
+ long max_diff; /* maximum number of milliseconds the jitterbuffer may be off */
} jb_settings;
typedef struct jitterbuffer {
- struct jb_hist_element hist[JB_HISTORY_SIZE]; /* the history of the last received frames */
- long hist_sorted_delay[JB_HISTORY_SIZE]; /* a sorted buffer of the delays (lowest first) */
- long hist_sorted_timestamp[JB_HISTORY_SIZE]; /* a sorted buffer of the timestamps (lowest first) */
-
- int hist_pointer; /* points to index in history for next entry */
- long last_adjustment; /* the time of the last adjustment (growing or shrinking) */
- long next_voice_time; /* the next ts is to be read from the jb (senders timestamp) */
- long cnt_successive_interp; /* the count of consecutive interpolation frames */
- long silence_begin_ts; /* the time of the last CNG frame, when in silence */
- long min; /* the clock difference within current history interval */
- long current; /* the present jitterbuffer adjustment */
- long target; /* the target jitterbuffer adjustment */
- long last_delay; /* the delay of the last packet, used for calc. jitter */
-
- jb_frame *voiceframes; /* queued voiceframes */
- jb_frame *controlframes; /* queued controlframes */
- jb_settings settings; /* the settings of the jitterbuffer */
- jb_info info; /* the statistics of the jitterbuffer */
+ struct jb_hist_element hist[JB_HISTORY_SIZE]; /* the history of the last received frames */
+ long hist_sorted_delay[JB_HISTORY_SIZE]; /* a sorted buffer of the delays (lowest first) */
+ long hist_sorted_timestamp[JB_HISTORY_SIZE]; /* a sorted buffer of the timestamps (lowest first) */
+
+ int hist_pointer; /* points to index in history for next entry */
+ long last_adjustment; /* the time of the last adjustment (growing or shrinking) */
+ long next_voice_time; /* the next ts is to be read from the jb (senders timestamp) */
+ long cnt_successive_interp; /* the count of consecutive interpolation frames */
+ long silence_begin_ts; /* the time of the last CNG frame, when in silence */
+ long min; /* the clock difference within current history interval */
+ long current; /* the present jitterbuffer adjustment */
+ long target; /* the target jitterbuffer adjustment */
+ long last_delay; /* the delay of the last packet, used for calc. jitter */
+
+ jb_frame *voiceframes; /* queued voiceframes */
+ jb_frame *controlframes; /* queued controlframes */
+ jb_settings settings; /* the settings of the jitterbuffer */
+ jb_info info; /* the statistics of the jitterbuffer */
} jitterbuffer;
//parameter definitions
@@ -174,24 +174,24 @@ typedef struct jitterbuffer {
/*
* Creates a new jitterbuffer and sets the default settings.
- * Always use this function for creating a new jitterbuffer.
+ * Always use this function for creating a new jitterbuffer.
*/
jitterbuffer *jb_new();
/*
- * The control frames and possible personal settings are kept.
- * History and voice/silence frames are destroyed.
+ * The control frames and possible personal settings are kept.
+ * History and voice/silence frames are destroyed.
*/
void jb_reset(jitterbuffer *jb);
/*
* Resets the jitterbuffer totally, all the control/voice/silence frames are destroyed
- * default settings are put as well.
+ * default settings are put as well.
*/
void jb_reset_all(jitterbuffer *jb);
/*
- * Destroy the jitterbuffer and any frame within.
+ * Destroy the jitterbuffer and any frame within.
* Always use this function for destroying a jitterbuffer,
* otherwise there is a chance of memory leaking.
*/
@@ -204,7 +204,7 @@ void jb_destroy(jitterbuffer *jb);
void jb_set_settings(jitterbuffer *jb, jb_settings *settings);
/*
- * Get the statistics for the jitterbuffer.
+ * Get the statistics for the jitterbuffer.
* Copying the statistics directly for the jitterbuffer won't work because
* The statistics are only calculated when calling this function.
*/
@@ -248,7 +248,7 @@ void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now,
* Get a packet from the jitterbuffer if it's available.
* control packets have a higher priority above voice and silence packets
* they are always delivered as fast as possible. The delay of the jitterbuffer
- * doesn't work for these packets.
+ * doesn't work for these packets.
* @REQUIRE 1<interpl <= jb->settings->extra_delay (=default JB_ALLOW_EXTRA_DELAY)
*
* return will be:
diff --git a/tinyDAV/include/tinydav/audio/tdav_producer_audio.h b/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
index 47e0a4f..2cd3808 100755
--- a/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,9 +40,8 @@ TDAV_BEGIN_DECLS
#define TDAV_PRODUCER_AUDIO(self) ((tdav_producer_audio_t*)(self))
-typedef struct tdav_producer_audio_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_audio_s {
+ TMEDIA_DECLARE_PRODUCER;
}
tdav_producer_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_session_audio.h b/tinyDAV/include/tinydav/audio/tdav_session_audio.h
index e2ab66f..4f1403b 100755
--- a/tinyDAV/include/tinydav/audio/tdav_session_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_session_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,50 +39,49 @@ TDAV_BEGIN_DECLS
typedef tsk_list_t tdav_session_audio_dtmfe_L_t;
-typedef struct tdav_session_audio_s
-{
- TDAV_DECLARE_SESSION_AV;
-
- tsk_bool_t is_started;
-
- struct {
- unsigned started:1;
- tsk_timer_manager_handle_t* handle_mgr_global;
- } timer;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- struct {
- void* buffer;
- tsk_size_t buffer_size;
- struct tmedia_resampler_s* instance;
- } resampler;
- } encoder;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- struct {
- void* buffer;
- tsk_size_t buffer_size;
- struct tmedia_resampler_s* instance;
- } resampler;
- } decoder;
-
- struct tmedia_denoise_s* denoise;
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- tdav_session_audio_dtmfe_L_t* dtmf_events;
- tsk_bool_t is_sending_dtmf_events;
+typedef struct tdav_session_audio_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ tsk_bool_t is_started;
+
+ struct {
+ unsigned started:1;
+ tsk_timer_manager_handle_t* handle_mgr_global;
+ } timer;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+ struct tmedia_resampler_s* instance;
+ } resampler;
+ } encoder;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+ struct tmedia_resampler_s* instance;
+ } resampler;
+ } decoder;
+
+ struct tmedia_denoise_s* denoise;
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ tdav_session_audio_dtmfe_L_t* dtmf_events;
+ tsk_bool_t is_sending_dtmf_events;
}
tdav_session_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
index e80c7b5..4eaa53d 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,17 +39,16 @@
TDAV_BEGIN_DECLS
/** Speakuo JitterBufferr*/
-typedef struct tdav_speakup_jitterBuffer_s
-{
- TMEDIA_DECLARE_JITTER_BUFFER;
-
- jitterbuffer *jbuffer;
- uint8_t jcodec;
- uint64_t ref_timestamp;
- uint32_t frame_duration;
- uint32_t rate;
- uint32_t channels;
- uint32_t _10ms_size_bytes;
+typedef struct tdav_speakup_jitterBuffer_s {
+ TMEDIA_DECLARE_JITTER_BUFFER;
+
+ jitterbuffer *jbuffer;
+ uint8_t jcodec;
+ uint64_t ref_timestamp;
+ uint32_t frame_duration;
+ uint32_t rate;
+ uint32_t channels;
+ uint32_t _10ms_size_bytes;
}
tdav_speakup_jitterbuffer_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h b/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
index 3271066..fe6d90f 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
index 019db5d..f54525a 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h b/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
index 635882d..84d2296 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h b/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
index 7c5e956..69ab671 100755
--- a/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
+++ b/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h b/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
index 0da22e8..ab581e5 100755
--- a/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
+++ b/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h b/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
index e215769..9e58ef1 100755
--- a/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
+++ b/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h b/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
index 7e136cd..bb4f01d 100755
--- a/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
+++ b/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,20 +42,19 @@ TDAV_BEGIN_DECLS
#define TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT 4
-typedef struct tdav_consumer_waveapi_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct tdav_consumer_waveapi_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- tsk_bool_t started;
+ tsk_bool_t started;
- WAVEFORMATEX wfx;
- HWAVEOUT hWaveOut;
- LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT];
- tsk_size_t bytes_per_notif;
+ WAVEFORMATEX wfx;
+ HWAVEOUT hWaveOut;
+ LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT];
+ tsk_size_t bytes_per_notif;
- void* tid[1];
- HANDLE events[2];
- CRITICAL_SECTION cs;
+ void* tid[1];
+ HANDLE events[2];
+ CRITICAL_SECTION cs;
}
tdav_consumer_waveapi_t;
diff --git a/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h b/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
index 67614cf..593c7e8 100755
--- a/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
+++ b/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,20 +42,19 @@ TDAV_BEGIN_DECLS
#define TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT 4
-typedef struct tdav_producer_waveapi_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t started;
-
- WAVEFORMATEX wfx;
- HWAVEIN hWaveIn;
- LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT];
- tsk_size_t bytes_per_notif;
-
- void* tid[1];
- HANDLE events[2];
- CRITICAL_SECTION cs;
+typedef struct tdav_producer_waveapi_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t started;
+
+ WAVEFORMATEX wfx;
+ HWAVEIN hWaveIn;
+ LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT];
+ tsk_size_t bytes_per_notif;
+
+ void* tid[1];
+ HANDLE events[2];
+ CRITICAL_SECTION cs;
}
tdav_producer_waveapi_t;
diff --git a/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h b/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
index 5fbc057..e8c1e9e 100755
--- a/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
+++ b/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h b/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
index cb0e33e..d739ad0 100755
--- a/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
+++ b/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,38 +44,35 @@ TDAV_BEGIN_DECLS
#define TDAV_CODEC_AMR(self) ((tdav_codec_amr_t*)(self))
-typedef enum tdav_codec_amr_type_e
-{
- tdav_codec_amr_type_nb,
- tdav_codec_amr_type_wb,
+typedef enum tdav_codec_amr_type_e {
+ tdav_codec_amr_type_nb,
+ tdav_codec_amr_type_wb,
}
tdav_codec_amr_type_t;
-typedef enum tdav_codec_amr_mode_e
-{
- tdav_codec_amr_mode_oa,
- tdav_codec_amr_mode_be,
+typedef enum tdav_codec_amr_mode_e {
+ tdav_codec_amr_mode_oa,
+ tdav_codec_amr_mode_be,
}
tdav_codec_amr_mode_t;
/** Base class for all AMR codecs */
-typedef struct tdav_codec_amr_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- tdav_codec_amr_type_t type;
- tdav_codec_amr_mode_t mode;
-
- enum Mode encoder_mode;
- void* encoder;
- void* decoder;
-
- unsigned modes:16; /**< 0..7 for NB and 0..8 for WB plus SID, SPEECH_LOST, NO_DATA etc etc */
- unsigned mcp:2; /**< mode-change-periode (1 or 2) */
- unsigned mcc:2; /**< mode-change-capability (1 or 2) */
- unsigned mcn:1; /**< mode-change-neighnor (0 or 1) */
- unsigned crc:1; /**< 0 or 1 */
- unsigned robust_sorting:1; /**< robust-sorting (0 or 1) */
+typedef struct tdav_codec_amr_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ tdav_codec_amr_type_t type;
+ tdav_codec_amr_mode_t mode;
+
+ enum Mode encoder_mode;
+ void* encoder;
+ void* decoder;
+
+ unsigned modes:16; /**< 0..7 for NB and 0..8 for WB plus SID, SPEECH_LOST, NO_DATA etc etc */
+ unsigned mcp:2; /**< mode-change-periode (1 or 2) */
+ unsigned mcc:2; /**< mode-change-capability (1 or 2) */
+ unsigned mcn:1; /**< mode-change-neighnor (0 or 1) */
+ unsigned crc:1; /**< 0 or 1 */
+ unsigned robust_sorting:1; /**< robust-sorting (0 or 1) */
}
tdav_codec_amr_t;
diff --git a/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h b/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
index e0a0dca..f7ae4b8 100755
--- a/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
+++ b/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,9 +31,8 @@
TDAV_BEGIN_DECLS
/** BFCP codec */
-typedef struct tdav_codec_bfcp_s
-{
- TMEDIA_DECLARE_CODEC_BFCP;
+typedef struct tdav_codec_bfcp_s {
+ TMEDIA_DECLARE_CODEC_BFCP;
}
tdav_codec_bfcp_t;
diff --git a/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h b/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
index 3790a71..3bdf465 100755
--- a/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
+++ b/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,21 +40,20 @@
TDAV_BEGIN_DECLS
/** BV16 codec */
-typedef struct tdav_codec_bv16_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_bv16_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- struct {
- void *state;
- void *bs;
- void *x;
- } encoder;
+ struct {
+ void *state;
+ void *bs;
+ void *x;
+ } encoder;
- struct {
- void *state;
- void *bs;
- void *x;
- } decoder;
+ struct {
+ void *state;
+ void *bs;
+ void *x;
+ } decoder;
}
tdav_codec_bv16_t;
diff --git a/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h b/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
index 6082de7..378295f 100755
--- a/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
+++ b/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,9 +36,8 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_dtmf_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_dtmf_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_dtmf_t;
diff --git a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
index 80659b8..89ad3a1 100755
--- a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
+++ b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
index bfd9a50..447c97a 100755
--- a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
+++ b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g711/g711.h b/tinyDAV/include/tinydav/codecs/g711/g711.h
index cb79793..b8aec63 100755
--- a/tinyDAV/include/tinydav/codecs/g711/g711.h
+++ b/tinyDAV/include/tinydav/codecs/g711/g711.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h b/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
index 3343636..8efbead 100755
--- a/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
+++ b/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,16 +36,14 @@
TDAV_BEGIN_DECLS
/** G.711u codec */
-typedef struct tdav_codec_g711u_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_g711u_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_g711u_t;
/** G.711a codec */
-typedef struct tdav_codec_g711a_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_g711a_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_g711a_t;
diff --git a/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h b/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
index efa45ec..a2bc999 100755
--- a/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
+++ b/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
@@ -7,7 +7,7 @@
*
* Copyright (C) 2005 Steve Underwood
*
- * Despite my general liking of the GPL, I place my own contributions
+ * Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@@ -49,14 +49,12 @@ codec is considerably faster, and still fully compatible with wideband terminals
#define TDAV_INT16_MAX 32767
#define TDAV_INT16_MIN -32768
-enum
-{
+enum {
G722_SAMPLE_RATE_8000 = 0x0001,
G722_PACKED = 0x0002
};
-typedef struct
-{
+typedef struct {
/*! TRUE if the operating in the special ITU test mode, with the band split filters
disabled. */
int itu_test_mode;
@@ -70,8 +68,7 @@ typedef struct
/*! Signal history for the QMF */
int x[24];
- struct
- {
+ struct {
int s;
int sp;
int sz;
@@ -93,8 +90,7 @@ typedef struct
int out_bits;
} g722_encode_state_t;
-typedef struct
-{
+typedef struct {
/*! TRUE if the operating in the special ITU test mode, with the band split filters
disabled. */
int itu_test_mode;
@@ -108,8 +104,7 @@ typedef struct
/*! Signal history for the QMF */
int x[24];
- struct
- {
+ struct {
int s;
int sp;
int sz;
@@ -124,7 +119,7 @@ typedef struct
int nb;
int det;
} band[2];
-
+
unsigned int in_buffer;
int in_bits;
unsigned int out_buffer;
diff --git a/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h b/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
index 6484022..d710a7a 100755
--- a/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
+++ b/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h b/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
index 3b4ec05..6517f74 100755
--- a/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
+++ b/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,30 +43,29 @@
TDAV_BEGIN_DECLS
/** G.729abb codec */
-typedef struct tdav_codec_g729ab_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- struct{
- Word16 prm[PRM_SIZE+1]; /* Analysis parameters + frame type */
- Word16 serial[SERIAL_SIZE]; /* Output bitstream buffer */
-
- Word16 frame; /* frame counter */
-
- /* For G.729B */
- Word16 vad_enable;
- } encoder;
-
- struct{
- Word16 serial[SERIAL_SIZE]; /* Serial stream */
- Word16 synth_buf[L_FRAME+M], *synth; /* Synthesis */
- Word16 parm[PRM_SIZE+2]; /* Synthesis parameters */
- Word16 Az_dec[MP1*2]; /* Decoded Az for post-filter */
- Word16 T2[2]; /* Pitch lag for 2 subframes */
-
- /* For G.729B */
- Word16 Vad;
- } decoder;
+typedef struct tdav_codec_g729ab_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ struct {
+ Word16 prm[PRM_SIZE+1]; /* Analysis parameters + frame type */
+ Word16 serial[SERIAL_SIZE]; /* Output bitstream buffer */
+
+ Word16 frame; /* frame counter */
+
+ /* For G.729B */
+ Word16 vad_enable;
+ } encoder;
+
+ struct {
+ Word16 serial[SERIAL_SIZE]; /* Serial stream */
+ Word16 synth_buf[L_FRAME+M], *synth; /* Synthesis */
+ Word16 parm[PRM_SIZE+2]; /* Synthesis parameters */
+ Word16 Az_dec[MP1*2]; /* Decoded Az for post-filter */
+ Word16 T2[2]; /* Pitch lag for 2 subframes */
+
+ /* For G.729B */
+ Word16 Vad;
+ } decoder;
}
tdav_codec_g729ab_t;
diff --git a/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h b/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
index 1fff744..64c1136 100755
--- a/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
+++ b/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,12 +41,11 @@
TDAV_BEGIN_DECLS
/** GSM codec */
-typedef struct tdav_codec_gsm_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_gsm_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- gsm encoder;
- gsm decoder;
+ gsm encoder;
+ gsm decoder;
}
tdav_codec_gsm_t;
diff --git a/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h b/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
index 7f66a3a..f871efd 100755
--- a/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
+++ b/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,34 +44,33 @@ TDAV_BEGIN_DECLS
#define TDAV_CODEC_H261(self) ((tdav_codec_h261_t*)(self))
/** H.2261 codec */
-typedef struct tdav_codec_h261_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- // Encoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
- void* buffer;
- } encoder;
-
- // decoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
-
- void* accumulator;
- uint8_t ebit;
- tsk_size_t accumulator_pos;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_h261_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ // Encoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+ void* buffer;
+ } encoder;
+
+ // decoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+
+ void* accumulator;
+ uint8_t ebit;
+ tsk_size_t accumulator_pos;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h261_t;
diff --git a/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h b/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
index 6a2880f..b8a4abd 100755
--- a/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
+++ b/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
index 9de6fdd..57da492 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,7 +46,7 @@ tsk_bool_t tdav_codec_passthrough_h264_is_supported();
static inline tsk_bool_t tdav_codec_h264_is_ffmpeg_plugin(const tmedia_codec_plugin_def_t *plugin)
{
- return(plugin && ((plugin == tdav_codec_h264_base_plugin_def_t) || (plugin == tdav_codec_h264_main_plugin_def_t)));
+ return(plugin && ((plugin == tdav_codec_h264_base_plugin_def_t) || (plugin == tdav_codec_h264_main_plugin_def_t)));
}
TDAV_END_DECLS
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
index b464f12..bcd143b 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2014-2015 Mamadou DIOP.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
index 1cf2e97..b2e01ba 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -90,47 +90,44 @@ static const int32_t H264_LEVEL_TO_ZERO_BASED_INDEX[255] = {
};
// Because of FD, declare it here
-typedef enum packetization_mode_e{
- Unknown_Mode = -1,
- Single_NAL_Unit_Mode = 0, /* Single NAL mode (Only nals from 1-23 are allowed) */
- Non_Interleaved_Mode = 1, /* Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed */
- Interleaved_Mode = 2 /* 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A), and 29 (FU-B) are allowed.*/
+typedef enum packetization_mode_e {
+ Unknown_Mode = -1,
+ Single_NAL_Unit_Mode = 0, /* Single NAL mode (Only nals from 1-23 are allowed) */
+ Non_Interleaved_Mode = 1, /* Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed */
+ Interleaved_Mode = 2 /* 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A), and 29 (FU-B) are allowed.*/
}
packetization_mode_t;
-typedef struct tdav_codec_h264_common_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tdav_codec_h264_common_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
- profile_idc_t profile;
- uint8_t profile_iop;
- level_idc_t level;
- unsigned maxFS;
+ profile_idc_t profile;
+ uint8_t profile_iop;
+ level_idc_t level;
+ unsigned maxFS;
- packetization_mode_t pack_mode_remote; // remote packetization mode
- packetization_mode_t pack_mode_local; // local packetization mode
+ packetization_mode_t pack_mode_remote; // remote packetization mode
+ packetization_mode_t pack_mode_local; // local packetization mode
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
}
tdav_codec_h264_common_t;
#define TDAV_CODEC_H264_COMMON(self) ((tdav_codec_h264_common_t*)(self))
#define TDAV_DECLARE_CODEC_H264_COMMON tdav_codec_h264_common_t __video__
-typedef struct tdav_codec_h264_common_level_size_xs
-{
- level_idc_t level;
- unsigned width;
+typedef struct tdav_codec_h264_common_level_size_xs {
+ level_idc_t level;
+ unsigned width;
unsigned height;
- unsigned maxFS; // From "Table A-1 – Level limits"
+ unsigned maxFS; // From "Table A-1 – Level limits"
}
tdav_codec_h264_common_level_size_xt;
-static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_sizes [] =
-{
- {level_idc_1_0, 128, 96, 99},
+static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_sizes [] = {
+ {level_idc_1_0, 128, 96, 99},
#if 0
{level_idc_1_b, 128, 96, 99},
#endif
@@ -153,278 +150,289 @@ static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_s
static int tdav_codec_h264_common_size_from_level(level_idc_t level, unsigned *width, unsigned *height)
{
- tsk_size_t i;
- for(i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i){
- if(tdav_codec_h264_common_level_sizes[i].level == level){
- *width = tdav_codec_h264_common_level_sizes[i].width;
- *height = tdav_codec_h264_common_level_sizes[i].height;
- return 0;
- }
- }
- return -1;
+ tsk_size_t i;
+ for(i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i) {
+ if(tdav_codec_h264_common_level_sizes[i].level == level) {
+ *width = tdav_codec_h264_common_level_sizes[i].width;
+ *height = tdav_codec_h264_common_level_sizes[i].height;
+ return 0;
+ }
+ }
+ return -1;
}
static int tdav_codec_h264_common_size_from_fs(unsigned maxFS, unsigned *width, unsigned *height)
{
- tsk_size_t i;
- int ret = -1;
- for (i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i){
- if (tdav_codec_h264_common_level_sizes[i].maxFS <= maxFS){
- *width = tdav_codec_h264_common_level_sizes[i].width;
- *height = tdav_codec_h264_common_level_sizes[i].height;
- ret = 0;
- }
- else {
- break;
- }
- }
- return ret;
+ tsk_size_t i;
+ int ret = -1;
+ for (i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i) {
+ if (tdav_codec_h264_common_level_sizes[i].maxFS <= maxFS) {
+ *width = tdav_codec_h264_common_level_sizes[i].width;
+ *height = tdav_codec_h264_common_level_sizes[i].height;
+ ret = 0;
+ }
+ else {
+ break;
+ }
+ }
+ return ret;
}
static int tdav_codec_h264_common_level_from_size(unsigned width, unsigned height, level_idc_t *level)
{
- tsk_size_t i;
- unsigned maxFS = (((width + 15) >> 4) * ((height + 15) >> 4));
- static const tsk_size_t __tdav_codec_h264_common_level_sizes_count = sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]);
- for (i = 0; i < __tdav_codec_h264_common_level_sizes_count; ++i){
- if (/*tdav_codec_h264_common_level_sizes[i].maxFS*/ ((tdav_codec_h264_common_level_sizes[i].width * tdav_codec_h264_common_level_sizes[i].height) >> 8) >= maxFS){
- *level = tdav_codec_h264_common_level_sizes[i].level;
- return 0;
- }
- }
- TSK_DEBUG_WARN("Failed to find default level for size=(%ux%u)", width, height);
- *level = tdav_codec_h264_common_level_sizes[__tdav_codec_h264_common_level_sizes_count - 1].level;
- return 0;
+ tsk_size_t i;
+ unsigned maxFS = (((width + 15) >> 4) * ((height + 15) >> 4));
+ static const tsk_size_t __tdav_codec_h264_common_level_sizes_count = sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]);
+ for (i = 0; i < __tdav_codec_h264_common_level_sizes_count; ++i) {
+ if (/*tdav_codec_h264_common_level_sizes[i].maxFS*/ ((tdav_codec_h264_common_level_sizes[i].width * tdav_codec_h264_common_level_sizes[i].height) >> 8) >= maxFS) {
+ *level = tdav_codec_h264_common_level_sizes[i].level;
+ return 0;
+ }
+ }
+ TSK_DEBUG_WARN("Failed to find default level for size=(%ux%u)", width, height);
+ *level = tdav_codec_h264_common_level_sizes[__tdav_codec_h264_common_level_sizes_count - 1].level;
+ return 0;
}
static int tdav_codec_h264_common_init(tdav_codec_h264_common_t * h264)
{
- if (h264) {
- level_idc_t level;
- // because at this step 'tmedia_codec_init()' is not called yet and we need default size to compute the H.264 level
- if (TMEDIA_CODEC_VIDEO(h264)->out.width == 0 || TMEDIA_CODEC_VIDEO(h264)->in.width == 0) {
- unsigned width, height;
- tmedia_pref_video_size_t pref_size = tmedia_defaults_get_pref_video_size();
- if (tmedia_video_get_size(pref_size, &width, &height) == 0) {
- TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width;
- TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height;
- }
- }
- h264->maxFS = (((TMEDIA_CODEC_VIDEO(h264)->out.width + 15) >> 4) * ((TMEDIA_CODEC_VIDEO(h264)->out.height + 15) >> 4));
- if ((tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height, &level)) == 0){
- h264->maxFS = TSK_MIN((int32_t)h264->maxFS, MaxFS[H264_LEVEL_TO_ZERO_BASED_INDEX[level]]);
- h264->level = level;
- }
- h264->profile_iop = 0x80;
- h264->pack_mode_local = H264_PACKETIZATION_MODE;
- h264->pack_mode_remote = Unknown_Mode;
- }
- return 0;
+ if (h264) {
+ level_idc_t level;
+ // because at this step 'tmedia_codec_init()' is not called yet and we need default size to compute the H.264 level
+ if (TMEDIA_CODEC_VIDEO(h264)->out.width == 0 || TMEDIA_CODEC_VIDEO(h264)->in.width == 0) {
+ unsigned width, height;
+ tmedia_pref_video_size_t pref_size = tmedia_defaults_get_pref_video_size();
+ if (tmedia_video_get_size(pref_size, &width, &height) == 0) {
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height;
+ }
+ }
+ h264->maxFS = (((TMEDIA_CODEC_VIDEO(h264)->out.width + 15) >> 4) * ((TMEDIA_CODEC_VIDEO(h264)->out.height + 15) >> 4));
+ if ((tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height, &level)) == 0) {
+ h264->maxFS = TSK_MIN((int32_t)h264->maxFS, MaxFS[H264_LEVEL_TO_ZERO_BASED_INDEX[level]]);
+ h264->level = level;
+ }
+ h264->profile_iop = 0x80;
+ h264->pack_mode_local = H264_PACKETIZATION_MODE;
+ h264->pack_mode_remote = Unknown_Mode;
+ }
+ return 0;
}
static int tdav_codec_h264_common_deinit(tdav_codec_h264_common_t * h264)
{
- TSK_DEBUG_INFO("tdav_codec_h264_common_deinit");
- if(h264){
- tmedia_codec_video_deinit(TMEDIA_CODEC_VIDEO(h264));
- TSK_FREE(h264->rtp.ptr);
- h264->rtp.size = 0;
- }
- return 0;
+ TSK_DEBUG_INFO("tdav_codec_h264_common_deinit");
+ if(h264) {
+ tmedia_codec_video_deinit(TMEDIA_CODEC_VIDEO(h264));
+ TSK_FREE(h264->rtp.ptr);
+ h264->rtp.size = 0;
+ }
+ return 0;
}
static int tdav_codec_h264_common_get_profile_and_level(const char* fmtp, profile_idc_t *profile, level_idc_t *level)
{
- tsk_size_t size = tsk_strlen(fmtp);
- int start, end;
- int ret = -1;
-
- *profile = profile_idc_none;
- *level = level_idc_none;
-
- if((start = tsk_strindexOf(fmtp, size, "profile-level-id")) !=-1){
- tsk_param_t* param;
- if((end = (int)tsk_strindexOf((fmtp+start), (tsk_size_t)(size-start), ";")) == -1){
- end = (int)size;
- }
-
- if((param = tsk_params_parse_param((fmtp+start), (end-start)))){
- profile_idc_t p_idc;
- level_idc_t l_idc;
- if(param->value){
- tsk_strtrim_both(&param->value);
- }
-
- tdav_codec_h264_parse_profile(param->value, &p_idc, tsk_null, &l_idc);
-
- switch(p_idc){
- case profile_idc_baseline:
- case profile_idc_main:
- *profile = p_idc;
- *level = l_idc;
- ret = 0;
- break;
- case profile_idc_extended:
- case profile_idc_high:
- default:
- /* Not supported */
- break;
- }
-
- TSK_OBJECT_SAFE_FREE(param);
- }
- }
- return ret;
+ tsk_size_t size = tsk_strlen(fmtp);
+ int start, end;
+ int ret = -1;
+
+ *profile = profile_idc_none;
+ *level = level_idc_none;
+
+ if((start = tsk_strindexOf(fmtp, size, "profile-level-id")) !=-1) {
+ tsk_param_t* param;
+ if((end = (int)tsk_strindexOf((fmtp+start), (tsk_size_t)(size-start), ";")) == -1) {
+ end = (int)size;
+ }
+
+ if((param = tsk_params_parse_param((fmtp+start), (end-start)))) {
+ profile_idc_t p_idc;
+ level_idc_t l_idc;
+ if(param->value) {
+ tsk_strtrim_both(&param->value);
+ }
+
+ tdav_codec_h264_parse_profile(param->value, &p_idc, tsk_null, &l_idc);
+
+ switch(p_idc) {
+ case profile_idc_baseline:
+ case profile_idc_main:
+ *profile = p_idc;
+ *level = l_idc;
+ ret = 0;
+ break;
+ case profile_idc_extended:
+ case profile_idc_high:
+ default:
+ /* Not supported */
+ break;
+ }
+
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ }
+ return ret;
}
static tsk_bool_t tdav_codec_h264_common_sdp_att_match(tdav_codec_h264_common_t* h264, const char* att_name, const char* att_value)
{
- tsk_bool_t ret = tsk_true;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- TSK_DEBUG_INFO("[H.264] Trying to match [%s:%s]", att_name, att_value);
-
- if (tsk_striequals(att_name, "fmtp")) {
- int val_int;
- profile_idc_t profile;
- level_idc_t level;
- tsk_params_L_t* params;
-
- /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
- if (tdav_codec_h264_common_get_profile_and_level(att_value, &profile, &level) != 0) {
- TSK_DEBUG_ERROR("Not valid profile-level: %s", att_value);
- return tsk_false;
- }
- if (h264->profile != profile) {
- return tsk_false;
- }
- else{
- if (h264->level != level) {
- // change the output size only when the remote party request lower level. If it request higher (or same) level then, we send our preferred size.
- if (h264->level > level) {
- unsigned width, height;
- h264->level = TSK_MIN(h264->level, level);
- if (tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
- return tsk_false;
- }
- // Do not change our size if it match the requested level
- if (width < TMEDIA_CODEC_VIDEO(h264)->out.width || height < TMEDIA_CODEC_VIDEO(h264)->out.height) {
- // Set "out" size. We must not send more than "MaxFS".
- // Default "out" is equal to the preferred sized and initialized in init().
- // "TANDBERG/4120 (X7.2.2)" will terminate the call if frame size > maxFS
- TMEDIA_CODEC_VIDEO(h264)->out.width = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.width, width);
- TMEDIA_CODEC_VIDEO(h264)->out.height = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.height, height);
- }
- // Set default "in". Will be updated after receiving the first frame.
- TMEDIA_CODEC_VIDEO(h264)->in.width = width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = height;
- }
- }
- }
-
- /* e.g. profile-level-id=42e00a; packetization-mode=1; max-br=452; max-mbps=11880 */
- if ((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
-
- /* === max-br ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-br")) != -1) {
- // should compare "max-br"?
- TMEDIA_CODEC_VIDEO(h264)->out.max_br = val_int*1000;
- }
-
- /* === max-fs ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-fs")) != -1) {
- unsigned width_max, height_max, maxFS, currFS;
- currFS = (TMEDIA_CODEC_VIDEO(h264)->out.width * TMEDIA_CODEC_VIDEO(h264)->out.height) >> 8;
- maxFS = TSK_MIN(h264->maxFS/*preferred*/, (unsigned)val_int/*proposed*/); // make sure we'll never send more than we advertised
- if (currFS > maxFS) { // do not use default sizes when we already respect the MaxFS
- if (tdav_codec_h264_common_size_from_fs(maxFS, &width_max, &height_max) == 0) {
- TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width_max;
- TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height_max;
- }
- }
- }
-
- /* === max-mbps ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-mbps")) != -1) {
- // should compare "max-mbps"?
- TMEDIA_CODEC_VIDEO(h264)->out.max_mbps = val_int*1000;
- }
-
- /* === packetization-mode ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "packetization-mode")) != -1) {
- if ((packetization_mode_t)val_int == Single_NAL_Unit_Mode || (packetization_mode_t)val_int == Non_Interleaved_Mode) {
- TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote = (packetization_mode_t)val_int;
- TDAV_CODEC_H264_COMMON(h264)->pack_mode_local = TSK_MAX(TDAV_CODEC_H264_COMMON(h264)->pack_mode_local, TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote);
- }
- else {
- TSK_DEBUG_INFO("packetization-mode not matching");
- ret = tsk_false;
- goto bail;
- }
- }
- }
+ tsk_bool_t ret = tsk_true;
+ tsk_bool_t outsize_changed = tsk_false;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ TSK_DEBUG_INFO("[H.264] Trying to match [%s:%s]", att_name, att_value);
+
+ if (tsk_striequals(att_name, "fmtp")) {
+ int val_int;
+ profile_idc_t profile;
+ level_idc_t level;
+ tsk_params_L_t* params;
+
+ /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
+ if (tdav_codec_h264_common_get_profile_and_level(att_value, &profile, &level) != 0) {
+ TSK_DEBUG_ERROR("Not valid profile-level: %s", att_value);
+ return tsk_false;
+ }
+ if (h264->profile != profile) {
+ return tsk_false;
+ }
+ else {
+ if (h264->level != level) {
+ // change the output size only when the remote party request lower level. If it request higher (or same) level then, we send our preferred size.
+ if (h264->level > level) {
+ unsigned width, height;
+ h264->level = TSK_MIN(h264->level, level);
+ if (tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
+ return tsk_false;
+ }
+ // Do not change our size if it match the requested level
+ if (width < TMEDIA_CODEC_VIDEO(h264)->out.width || height < TMEDIA_CODEC_VIDEO(h264)->out.height) {
+ // Set "out" size. We must not send more than "MaxFS".
+ // Default "out" is equal to the preferred sized and initialized in init().
+ // "TANDBERG/4120 (X7.2.2)" will terminate the call if frame size > maxFS
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.width, width);
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.height, height);
+ outsize_changed = tsk_true;
+ }
+ // Set default "in". Will be updated after receiving the first frame.
+ TMEDIA_CODEC_VIDEO(h264)->in.width = width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = height;
+ }
+ }
+ }
+
+ /* e.g. profile-level-id=42e00a; packetization-mode=1; max-br=452; max-mbps=11880 */
+ if ((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+
+ /* === max-br ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-br")) != -1) {
+ // should compare "max-br"?
+ TMEDIA_CODEC_VIDEO(h264)->out.max_br = val_int*1000;
+ }
+
+ /* === max-fs ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-fs")) != -1) {
+ unsigned width_max, height_max, maxFS, currFS;
+ currFS = (TMEDIA_CODEC_VIDEO(h264)->out.width * TMEDIA_CODEC_VIDEO(h264)->out.height) >> 8;
+ maxFS = TSK_MIN(h264->maxFS/*preferred*/, (unsigned)val_int/*proposed*/); // make sure we'll never send more than we advertised
+ if (currFS > maxFS) { // do not use default sizes when we already respect the MaxFS
+ if (tdav_codec_h264_common_size_from_fs(maxFS, &width_max, &height_max) == 0) {
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width_max;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height_max;
+ outsize_changed = tsk_true;
+ }
+ }
+ }
+
+ /* === max-mbps ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-mbps")) != -1) {
+ // should compare "max-mbps"?
+ TMEDIA_CODEC_VIDEO(h264)->out.max_mbps = val_int*1000;
+ }
+
+ /* === packetization-mode ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "packetization-mode")) != -1) {
+ if ((packetization_mode_t)val_int == Single_NAL_Unit_Mode || (packetization_mode_t)val_int == Non_Interleaved_Mode) {
+ TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote = (packetization_mode_t)val_int;
+ TDAV_CODEC_H264_COMMON(h264)->pack_mode_local = TSK_MAX(TDAV_CODEC_H264_COMMON(h264)->pack_mode_local, TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote);
+ }
+ else {
+ TSK_DEBUG_INFO("packetization-mode not matching");
+ ret = tsk_false;
+ goto bail;
+ }
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(params);
- }
- else if(tsk_striequals(att_name, "imageattr")){
- unsigned in_width, in_height, out_width, out_height;
- unsigned width, height;
- tsk_size_t s;
- if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(h264)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0){
- return tsk_false;
- }
- // check that 'imageattr' is comform to H.264 'profile-level'
- if(tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0){
- return tsk_false;
- }
- if((s = ((width * height * 3) >> 1)) < ((in_width * in_height * 3) >> 1) || s < ((out_width * out_height * 3) >> 1)){
- return tsk_false;
- }
-
- TMEDIA_CODEC_VIDEO(h264)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(h264)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(h264)->out.height = out_height;
- }
-
- return ret;
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ unsigned width, height;
+ tsk_size_t s;
+ if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(h264)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ // check that 'imageattr' is comform to H.264 'profile-level'
+ if(tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
+ return tsk_false;
+ }
+ if((s = ((width * height * 3) >> 1)) < ((in_width * in_height * 3) >> 1) || s < ((out_width * out_height * 3) >> 1)) {
+ return tsk_false;
+ }
+
+ TMEDIA_CODEC_VIDEO(h264)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(h264)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = out_height;
+ outsize_changed = tsk_true;
+ }
+
+ // clamp the output size to the defined max range
+ if (outsize_changed && tmedia_defaults_get_adapt_video_size_range_enabled()) {
+ if (tmedia_codec_video_clamp_out_size_to_range_max(TMEDIA_CODEC_VIDEO(h264)) != 0) {
+ ret = tsk_false;
+ }
+ }
+
+ return ret;
}
static char* tdav_codec_h264_common_sdp_att_get(const tdav_codec_h264_common_t* h264, const char* att_name)
-{
- if(!h264 || !att_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if (tsk_striequals(att_name, "fmtp")) {
- char* fmtp = tsk_null;
+{
+ if(!h264 || !att_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if (tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
#if 1
- // Required by "TANDBERG/4120 (X7.2.2)" and CISCO TelePresence
- tsk_sprintf(&fmtp, "profile-level-id=%x;max-mbps=%d;max-fs=%d",
- ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)),
- MaxMBPS[H264_LEVEL_TO_ZERO_BASED_INDEX[h264->level]],
- h264->maxFS
- );
- // Do not restrict packetisation-mode until we knwon what the remote party supports
- if (h264->pack_mode_remote != Unknown_Mode) {
- tsk_strcat_2(&fmtp, ";packetization-mode=%d", h264->pack_mode_local);
- }
+ // Required by "TANDBERG/4120 (X7.2.2)" and CISCO TelePresence
+ tsk_sprintf(&fmtp, "profile-level-id=%x;max-mbps=%d;max-fs=%d",
+ ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)),
+ MaxMBPS[H264_LEVEL_TO_ZERO_BASED_INDEX[h264->level]],
+ h264->maxFS
+ );
+ // Do not restrict packetisation-mode until we knwon what the remote party supports
+ if (h264->pack_mode_remote != Unknown_Mode) {
+ tsk_strcat_2(&fmtp, ";packetization-mode=%d", h264->pack_mode_local);
+ }
#else
- tsk_sprintf(&fmtp, "profile-level-id=%x; packetization-mode=%d", ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)), h264->pack_mode);
+ tsk_sprintf(&fmtp, "profile-level-id=%x; packetization-mode=%d", ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)), h264->pack_mode);
#endif
- return fmtp;
- }
- else if(tsk_striequals(att_name, "imageattr")){
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(h264)->pref_size,
- TMEDIA_CODEC_VIDEO(h264)->in.width, TMEDIA_CODEC_VIDEO(h264)->in.height, TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height);
- }
- return tsk_null;
+ return fmtp;
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(h264)->pref_size,
+ TMEDIA_CODEC_VIDEO(h264)->in.width, TMEDIA_CODEC_VIDEO(h264)->in.height, TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height);
+ }
+ return tsk_null;
}
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
index 5dfae9c..e42a40d 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011-2014 Mamadou DIOP.
* Copyright (C) 2011-2014 Doubango Telecom <http://www.doubango.org>.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -69,38 +69,37 @@ typedef struct NVEncoderParams NVEncoderParams;
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_h264_cuda_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
-
- struct {
- NVEncoder context;
- NVEncoderParams ctx_params;
- NVVE_CallbackParams clb_params;
- void *buffer;
- tsk_size_t buffer_size;
- int64_t frame_count;
- } encoder;
-
- struct {
- tsk_mutex_handle_t *mutex;
- CUvideodecoder context;
- CUVIDDECODECREATEINFO info;
- CUvideoparser cu_parser;
- CUVIDPARSERPARAMS cu_paser_params;
- CUdevice cu_device;
- IDirect3D9 *dx_d3d;
- IDirect3DDevice9 *dx_d3ddevice;
- CUcontext cu_context;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- void *cu_buffer;
- tsk_size_t cu_buffer_size;
- tsk_size_t cu_buffer_pitch;
- tsk_bool_t cu_buffer_avail;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_h264_cuda_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
+
+ struct {
+ NVEncoder context;
+ NVEncoderParams ctx_params;
+ NVVE_CallbackParams clb_params;
+ void *buffer;
+ tsk_size_t buffer_size;
+ int64_t frame_count;
+ } encoder;
+
+ struct {
+ tsk_mutex_handle_t *mutex;
+ CUvideodecoder context;
+ CUVIDDECODECREATEINFO info;
+ CUvideoparser cu_parser;
+ CUVIDPARSERPARAMS cu_paser_params;
+ CUdevice cu_device;
+ IDirect3D9 *dx_d3d;
+ IDirect3DDevice9 *dx_d3ddevice;
+ CUcontext cu_context;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ void *cu_buffer;
+ tsk_size_t cu_buffer_size;
+ tsk_size_t cu_buffer_pitch;
+ tsk_bool_t cu_buffer_avail;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h264_cuda_t;
@@ -111,10 +110,10 @@ TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp30_plugi
tsk_bool_t tdav_codec_h264_cuda_is_supported();
static inline tsk_bool_t tdav_codec_h264_is_cuda_plugin(const tmedia_codec_plugin_def_t *plugin)
{
- if(plugin && (plugin == tdav_codec_h264_cuda_bp10_plugin_def_t || plugin == tdav_codec_h264_cuda_bp20_plugin_def_t || plugin == tdav_codec_h264_cuda_bp30_plugin_def_t)){
- return tsk_true;
- }
- return tsk_false;
+ if(plugin && (plugin == tdav_codec_h264_cuda_bp10_plugin_def_t || plugin == tdav_codec_h264_cuda_bp20_plugin_def_t || plugin == tdav_codec_h264_cuda_bp30_plugin_def_t)) {
+ return tsk_true;
+ }
+ return tsk_false;
}
TDAV_END_DECLS
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
index 88796e4..23c3cc8 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,48 +47,48 @@ struct tdav_codec_h264_common_s;
extern uint8_t H264_START_CODE_PREFIX[4];
typedef enum profile_idc_e {
- profile_idc_none = 0,
+ profile_idc_none = 0,
- profile_idc_baseline = 66,
- profile_idc_extended = 88,
- profile_idc_main = 77,
- profile_idc_high = 100
+ profile_idc_baseline = 66,
+ profile_idc_extended = 88,
+ profile_idc_main = 77,
+ profile_idc_high = 100
}
profile_idc_t;
typedef struct profile_iop_s {
- unsigned constraint_set0_flag:1;
- unsigned constraint_set1_flag:1;
- unsigned constraint_set2_flag:1;
- unsigned reserved_zero_5bits:5;
+ unsigned constraint_set0_flag:1;
+ unsigned constraint_set1_flag:1;
+ unsigned constraint_set2_flag:1;
+ unsigned reserved_zero_5bits:5;
}
profile_iop_t;
typedef enum level_idc_e {
- level_idc_none = 0,
-
- level_idc_1_0 = 10,
- level_idc_1_b = 14,
- level_idc_1_1 = 11,
- level_idc_1_2 = 12,
- level_idc_1_3 = 13,
- level_idc_2_0 = 20,
- level_idc_2_1 = 21,
- level_idc_2_2 = 22,
- level_idc_3_0 = 30,
- level_idc_3_1 = 31,
- level_idc_3_2 = 32,
- level_idc_4_0 = 40,
- level_idc_4_1 = 41,
- level_idc_4_2 = 42,
- level_idc_5_0 = 50,
- level_idc_5_1 = 51,
- level_idc_5_2 = 52,
+ level_idc_none = 0,
+
+ level_idc_1_0 = 10,
+ level_idc_1_b = 14,
+ level_idc_1_1 = 11,
+ level_idc_1_2 = 12,
+ level_idc_1_3 = 13,
+ level_idc_2_0 = 20,
+ level_idc_2_1 = 21,
+ level_idc_2_2 = 22,
+ level_idc_3_0 = 30,
+ level_idc_3_1 = 31,
+ level_idc_3_2 = 32,
+ level_idc_4_0 = 40,
+ level_idc_4_1 = 41,
+ level_idc_4_2 = 42,
+ level_idc_5_0 = 50,
+ level_idc_5_1 = 51,
+ level_idc_5_2 = 52,
}
level_idc_t;
-/* 5.2. Common Structure of the RTP Payload Format
+/* 5.2. Common Structure of the RTP Payload Format
Type Packet Type name Section
---------------------------------------------------------
0 undefined -
@@ -101,17 +101,17 @@ level_idc_t;
29 FU-B Fragmentation unit 5.8
30-31 undefined -
*/
-typedef enum nal_unit_type_e{
+typedef enum nal_unit_type_e {
undefined_0 = 0,
nal_unit,
stap_a = 24,
stap_b = 25,
mtap16 = 26,
- mtap24 = 27,
- fu_a = 28,
+ mtap24 = 27,
+ fu_a = 28,
fu_b = 29,
- undefined_30 = 30,
- undefined_31 = 31
+ undefined_30 = 30,
+ undefined_31 = 31
}
nal_unit_type_t;
diff --git a/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h b/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
index 4a48fad..ff66bba 100755
--- a/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
+++ b/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,15 +43,14 @@
TDAV_BEGIN_DECLS
/** iLBC codec */
-typedef struct tdav_codec_ilbc_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_ilbc_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- iLBC_Enc_Inst_t encoder;
- iLBC_Dec_Inst_t decoder;
+ iLBC_Enc_Inst_t encoder;
+ iLBC_Dec_Inst_t decoder;
- float encblock[BLOCKL_MAX];
- float decblock[BLOCKL_MAX];
+ float encblock[BLOCKL_MAX];
+ float decblock[BLOCKL_MAX];
}
tdav_codec_ilbc_t;
diff --git a/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h b/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
index c7bf35a..a159bd8 100755
--- a/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
+++ b/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h b/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
index 702c872..e7a908c 100755
--- a/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
+++ b/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,9 +32,8 @@
TDAV_BEGIN_DECLS
/** MSRP codec */
-typedef struct tdav_codec_msrp_s
-{
- TMEDIA_DECLARE_CODEC_MSRP;
+typedef struct tdav_codec_msrp_s {
+ TMEDIA_DECLARE_CODEC_MSRP;
}
tdav_codec_msrp_t;
diff --git a/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h b/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
index c505f6d..eb94c7f 100755
--- a/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
+++ b/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h b/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
index b577f02..b946878 100755
--- a/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
+++ b/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,37 +36,35 @@
#include "tinymedia/tmedia_codec.h"
-#include <speex/speex.h>
+#include <speex/speex.h>
TDAV_BEGIN_DECLS
-typedef enum tdav_codec_speex_type_e
-{
- tdav_codec_speex_type_nb,
- tdav_codec_speex_type_wb,
- tdav_codec_speex_type_uwb,
+typedef enum tdav_codec_speex_type_e {
+ tdav_codec_speex_type_nb,
+ tdav_codec_speex_type_wb,
+ tdav_codec_speex_type_uwb,
}
tdav_codec_speex_type_t;
/** Speex codec */
-typedef struct tdav_codec_speex_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- tdav_codec_speex_type_t type;
-
- struct{
- void* state;
- SpeexBits bits;
- tsk_size_t size;
- } encoder;
-
- struct {
- void* state;
- SpeexBits bits;
- spx_int16_t* buffer;
- tsk_size_t size;
- } decoder;
+typedef struct tdav_codec_speex_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ tdav_codec_speex_type_t type;
+
+ struct {
+ void* state;
+ SpeexBits bits;
+ tsk_size_t size;
+ } encoder;
+
+ struct {
+ void* state;
+ SpeexBits bits;
+ spx_int16_t* buffer;
+ tsk_size_t size;
+ } decoder;
}
tdav_codec_speex_t;
diff --git a/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h b/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
index 1b6d3c2..4fabfe5 100755
--- a/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
+++ b/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,9 +30,8 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_t140_s
-{
- TMEDIA_DECLARE_CODEC;
+typedef struct tdav_codec_t140_s {
+ TMEDIA_DECLARE_CODEC;
}
tdav_codec_t140_t;
diff --git a/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h b/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
index e0614ed..90d0428 100755
--- a/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
+++ b/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h b/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
index 38580ad..7424ffb 100755
--- a/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
+++ b/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
index d46a345..33db094 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,9 +39,8 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_MSRP(self) ((tdav_consumer_msrp_t*)(self))
-typedef struct tdav_consumer_msrp_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_msrp_s {
+ TMEDIA_DECLARE_CONSUMER;
}
tdav_consumer_msrp_t;
diff --git a/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
index df85248..4dc6178 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
index 6626ea9..7ee16b5 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,66 +40,63 @@
TDAV_BEGIN_DECLS
-typedef enum tdav_msrp_setup_e
-{
- msrp_setup_active,
- msrp_setup_passive,
- msrp_setup_actpass,
- msrp_setup_holdconn
+typedef enum tdav_msrp_setup_e {
+ msrp_setup_active,
+ msrp_setup_passive,
+ msrp_setup_actpass,
+ msrp_setup_holdconn
}
tdav_msrp_setup_t;
-typedef enum tdav_msrp_dir_e
-{
- tdav_msrp_dir_none = 0x00,
- tdav_msrp_dir_sendonly = 0x01 << 0,
- tdav_msrp_dir_recvonly = 0x01 << 1,
- tdav_msrp_dir_sendrecv = (tdav_msrp_dir_sendonly | tdav_msrp_dir_recvonly),
+typedef enum tdav_msrp_dir_e {
+ tdav_msrp_dir_none = 0x00,
+ tdav_msrp_dir_sendonly = 0x01 << 0,
+ tdav_msrp_dir_recvonly = 0x01 << 1,
+ tdav_msrp_dir_sendrecv = (tdav_msrp_dir_sendonly | tdav_msrp_dir_recvonly),
}
tdav_msrp_dir_t;
-typedef struct tdav_session_msrp_s
-{
- TMEDIA_DECLARE_SESSION_MSRP;
-
- tsk_bool_t useIPv6;
-
- tnet_transport_t *transport;
- tmsrp_config_t* config;
- tdav_msrp_setup_t setup;
- tnet_fd_t connectedFD; // FullDuplex Socket
- tmsrp_sender_t* sender;
- tmsrp_receiver_t* receiver;
-
- char* local_ip;
- //uint16_t local_port;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* natt_ctx;
-
- char* remote_ip;
- uint16_t remote_port;
-
- tdav_msrp_dir_t dir;
- char* neg_accept_type;
- char* neg_accept_w_type;
- char* accept_types;
- char* accept_w_types;
- uint64_t chunck_duration;
-
- struct {
- char* path; //full-path
- char* selector;
- char* disposition;
- char* date;
- char* icon;
- char* transfer_id;
- unsigned sent:1;
- } file;
-
- unsigned fresh_conn:1;
- unsigned offerer:1;
- unsigned send_bodiless:1;
+typedef struct tdav_session_msrp_s {
+ TMEDIA_DECLARE_SESSION_MSRP;
+
+ tsk_bool_t useIPv6;
+
+ tnet_transport_t *transport;
+ tmsrp_config_t* config;
+ tdav_msrp_setup_t setup;
+ tnet_fd_t connectedFD; // FullDuplex Socket
+ tmsrp_sender_t* sender;
+ tmsrp_receiver_t* receiver;
+
+ char* local_ip;
+ //uint16_t local_port;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* natt_ctx;
+
+ char* remote_ip;
+ uint16_t remote_port;
+
+ tdav_msrp_dir_t dir;
+ char* neg_accept_type;
+ char* neg_accept_w_type;
+ char* accept_types;
+ char* accept_w_types;
+ uint64_t chunck_duration;
+
+ struct {
+ char* path; //full-path
+ char* selector;
+ char* disposition;
+ char* date;
+ char* icon;
+ char* transfer_id;
+ unsigned sent:1;
+ } file;
+
+ unsigned fresh_conn:1;
+ unsigned offerer:1;
+ unsigned send_bodiless:1;
}
tdav_session_msrp_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h b/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
index 822786c..f1c5703 100755
--- a/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,18 +35,17 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_T140(self) ((tdav_consumer_t140_t*)(self))
-typedef struct tdav_consumer_t140_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_t140_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ tsk_bool_t started;
- tsk_bool_t started;
+ struct {
+ const void* context;
+ tmedia_session_t140_ondata_cb_f func;
+ } cb_ondata;
- struct{
- const void* context;
- tmedia_session_t140_ondata_cb_f func;
- } cb_ondata;
-
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_t140_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_producer_t140.h b/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
index 4e47326..51a1a21 100755
--- a/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,11 +32,10 @@ TDAV_BEGIN_DECLS
#define TDAV_PRODUCER_T140(self) ((tdav_producer_t140_t*)(self))
-typedef struct tdav_producer_t140_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- tsk_bool_t started;
+typedef struct tdav_producer_t140_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ tsk_bool_t started;
}
tdav_producer_t140_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_session_t140.h b/tinyDAV/include/tinydav/t140/tdav_session_t140.h
index a569d3a..9915708 100755
--- a/tinyDAV/include/tinydav/t140/tdav_session_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_session_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,59 +35,58 @@ TDAV_BEGIN_DECLS
typedef tsk_list_t tdav_session_t140_blocks_L_t;
-typedef struct tdav_session_t140_s
-{
- TDAV_DECLARE_SESSION_AV;
-
- tsk_bool_t started;
- tsk_timer_manager_handle_t *h_timer;
-
- struct{
- const void* context;
- tmedia_session_t140_ondata_cb_f func;
- } cb_ondata;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
- tsk_size_t buffer_idx;
-
- void* red_buffer;
- tsk_size_t red_buffer_size;
-
- tdav_session_t140_blocks_L_t* blocks;
- int64_t blocks_count;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_buffering;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_idle;
- } encoder;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- void* consumer_buffer;
- tsk_size_t consumer_buffer_size;
-
- tdav_session_t140_blocks_L_t* blocks;
- int64_t blocks_count;
- int32_t last_seq_num;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_pkt_loss;
- } decoder;
+typedef struct tdav_session_t140_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ tsk_bool_t started;
+ tsk_timer_manager_handle_t *h_timer;
+
+ struct {
+ const void* context;
+ tmedia_session_t140_ondata_cb_f func;
+ } cb_ondata;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+ tsk_size_t buffer_idx;
+
+ void* red_buffer;
+ tsk_size_t red_buffer_size;
+
+ tdav_session_t140_blocks_L_t* blocks;
+ int64_t blocks_count;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_buffering;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_idle;
+ } encoder;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ void* consumer_buffer;
+ tsk_size_t consumer_buffer_size;
+
+ tdav_session_t140_blocks_L_t* blocks;
+ int64_t blocks_count;
+ int32_t last_seq_num;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_pkt_loss;
+ } decoder;
}
tdav_session_t140_t;
diff --git a/tinyDAV/include/tinydav/tdav.h b/tinyDAV/include/tinydav/tdav.h
index 8318771..d9ec4df 100755
--- a/tinyDAV/include/tinydav/tdav.h
+++ b/tinyDAV/include/tinydav/tdav.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,48 +38,47 @@ TDAV_BEGIN_DECLS
// @tinyWRAP
// @deprecated: to be replaced by "tmedia_codec_id_t" in Doubango 3.0
-typedef enum tdav_codec_id_e
-{
- tdav_codec_id_none = tmedia_codec_id_none,
-
- tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
- tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
- tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
- tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
- tdav_codec_id_gsm = tmedia_codec_id_gsm,
- tdav_codec_id_pcma = tmedia_codec_id_pcma,
- tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
- tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
- tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
- tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
- tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
- tdav_codec_id_bv16 = tmedia_codec_id_bv16,
- tdav_codec_id_bv32 = tmedia_codec_id_bv32,
- tdav_codec_id_opus = tmedia_codec_id_opus,
- tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
- tdav_codec_id_g722 = tmedia_codec_id_g722,
-
- /* room for new Audio codecs */
-
- tdav_codec_id_h261 = tmedia_codec_id_h261,
- tdav_codec_id_h263 = tmedia_codec_id_h263,
- tdav_codec_id_h263p = tmedia_codec_id_h263p,
- tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
- tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
- tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
- tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
- tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
- tdav_codec_id_theora = tmedia_codec_id_theora,
- tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
- tdav_codec_id_vp8 = tmedia_codec_id_vp8,
+typedef enum tdav_codec_id_e {
+ tdav_codec_id_none = tmedia_codec_id_none,
+
+ tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
+ tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
+ tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
+ tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
+ tdav_codec_id_gsm = tmedia_codec_id_gsm,
+ tdav_codec_id_pcma = tmedia_codec_id_pcma,
+ tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
+ tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
+ tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
+ tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
+ tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
+ tdav_codec_id_bv16 = tmedia_codec_id_bv16,
+ tdav_codec_id_bv32 = tmedia_codec_id_bv32,
+ tdav_codec_id_opus = tmedia_codec_id_opus,
+ tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
+ tdav_codec_id_g722 = tmedia_codec_id_g722,
+
+ /* room for new Audio codecs */
+
+ tdav_codec_id_h261 = tmedia_codec_id_h261,
+ tdav_codec_id_h263 = tmedia_codec_id_h263,
+ tdav_codec_id_h263p = tmedia_codec_id_h263p,
+ tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
+ tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
+ tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
+ tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
+ tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
+ tdav_codec_id_theora = tmedia_codec_id_theora,
+ tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
+ tdav_codec_id_vp8 = tmedia_codec_id_vp8,
- /* room for new Video codecs */
+ /* room for new Video codecs */
- tdav_codec_id_t140 = tmedia_codec_id_t140,
- tdav_codec_id_red = tmedia_codec_id_red,
+ tdav_codec_id_t140 = tmedia_codec_id_t140,
+ tdav_codec_id_red = tmedia_codec_id_red,
}
tdav_codec_id_t;
diff --git a/tinyDAV/include/tinydav/tdav_apple.h b/tinyDAV/include/tinydav/tdav_apple.h
index 00a09d6..7b5fa86 100755
--- a/tinyDAV/include/tinydav/tdav_apple.h
+++ b/tinyDAV/include/tinydav/tdav_apple.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/tdav_session_av.h b/tinyDAV/include/tinydav/tdav_session_av.h
index 3460fbf..86ecd15 100755
--- a/tinyDAV/include/tinydav/tdav_session_av.h
+++ b/tinyDAV/include/tinydav/tdav_session_av.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
* Copyright (C) 2012 Diop Mamadou Ibrahima
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,26 +38,26 @@ TDAV_BEGIN_DECLS
#define TDAV_SESSION_AV(self) ((tdav_session_av_t*)(self))
-typedef struct tdav_session_av_s
-{
- TMEDIA_DECLARE_SESSION;
-
- tsk_bool_t use_ipv6;
- tsk_bool_t use_rtcp;
- tsk_bool_t use_rtcpmux;
- enum tmedia_type_e media_type;
- enum tmedia_profile_e media_profile;
- enum tmedia_mode_e avpf_mode_set;
- enum tmedia_mode_e avpf_mode_neg;
- tsk_bool_t is_fb_fir_neg; // a=rtcp-fb:* ccm fir
- tsk_bool_t is_fb_nack_neg; // a=rtcp-fb:* nack
- tsk_bool_t is_fb_googremb_neg; // a=rtcp-fb:* goog-remb
- tsk_bool_t use_srtp;
- tsk_bool_t is_webrtc2sip_mode_enabled;
- uint32_t rtp_ssrc;
-
- tmedia_srtp_type_t srtp_type;
- tmedia_srtp_mode_t srtp_mode;
+typedef struct tdav_session_av_s {
+ TMEDIA_DECLARE_SESSION;
+
+ tsk_bool_t use_ipv6;
+ tsk_bool_t use_rtcp;
+ tsk_bool_t use_rtcpmux;
+ enum tmedia_type_e media_type;
+ enum tmedia_profile_e media_profile;
+ enum tmedia_mode_e avpf_mode_set;
+ enum tmedia_mode_e avpf_mode_neg;
+ tsk_bool_t is_fb_fir_neg; // a=rtcp-fb:* ccm fir
+ tsk_bool_t is_fb_nack_neg; // a=rtcp-fb:* nack
+ tsk_bool_t is_fb_googremb_neg; // a=rtcp-fb:* goog-remb
+ tsk_bool_t is_fb_doubsjcng_neg; // a=rtcp-fb:* doubs-jcng
+ tsk_bool_t use_srtp;
+ tsk_bool_t is_webrtc2sip_mode_enabled;
+ uint32_t rtp_ssrc;
+
+ tmedia_srtp_type_t srtp_type;
+ tmedia_srtp_mode_t srtp_mode;
struct {
uint64_t count_last_time;
uint64_t count;
@@ -67,67 +67,67 @@ typedef struct tdav_session_av_s
uint64_t count;
} bytes_out;
uint64_t time_last_frame_loss_report; // from jb
- int32_t bandwidth_max_upload_kbps;
- int32_t bandwidth_max_download_kbps;
- int32_t fps;
- tsk_bool_t congestion_ctrl_enabled;
- tmedia_pref_video_size_t pref_size; // output
-
- /* sdp capabilities (RFC 5939) */
- struct tdav_sdp_caps_s* sdp_caps;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* natt_ctx;
- struct tnet_ice_ctx_s* ice_ctx;
-
- char* local_ip;
- char* remote_ip;
- uint16_t remote_port;
- struct tsdp_message_s* remote_sdp;
- struct tsdp_message_s* local_sdp;
-
- struct trtp_manager_s* rtp_manager;
-
- struct tmedia_consumer_s* consumer;
- struct tmedia_producer_s* producer;
-
- struct{
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new; // "new | existing"
- } local;
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new; // "new | existing"
- } remote;
- } dtls;
-
- struct{
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- uint16_t seq_num;
- uint32_t timestamp;
- } ulpfec;
-
- struct{
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- } red;
-
- struct{
- char* reason;
- tsk_bool_t is_fatal;
- void* tid[1];
- } last_error;
-
- // codec's payload type mapping used when bypassing is enabled
- struct{
- int8_t local;
- int8_t remote;
- int8_t neg;
- } pt_map;
-
- TSK_DECLARE_SAFEOBJ;
+ int32_t bandwidth_max_upload_kbps;
+ int32_t bandwidth_max_download_kbps;
+ int32_t fps;
+ tsk_bool_t congestion_ctrl_enabled;
+ tmedia_pref_video_size_t pref_size; // output
+
+ /* sdp capabilities (RFC 5939) */
+ struct tdav_sdp_caps_s* sdp_caps;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* natt_ctx;
+ struct tnet_ice_ctx_s* ice_ctx;
+
+ char* local_ip;
+ char* remote_ip;
+ uint16_t remote_port;
+ struct tsdp_message_s* remote_sdp;
+ struct tsdp_message_s* local_sdp;
+
+ struct trtp_manager_s* rtp_manager;
+
+ struct tmedia_consumer_s* consumer;
+ struct tmedia_producer_s* producer;
+
+ struct {
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new; // "new | existing"
+ } local;
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new; // "new | existing"
+ } remote;
+ } dtls;
+
+ struct {
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ uint16_t seq_num;
+ uint32_t timestamp;
+ } ulpfec;
+
+ struct {
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ } red;
+
+ struct {
+ char* reason;
+ tsk_bool_t is_fatal;
+ void* tid[1];
+ } last_error;
+
+ // codec's payload type mapping used when bypassing is enabled
+ struct {
+ int8_t local;
+ int8_t remote;
+ int8_t neg;
+ } pt_map;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_session_av_t;
diff --git a/tinyDAV/include/tinydav/tdav_win32.h b/tinyDAV/include/tinydav/tdav_win32.h
index cd31fe6..f4443d0 100755
--- a/tinyDAV/include/tinydav/tdav_win32.h
+++ b/tinyDAV/include/tinydav/tdav_win32.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h b/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
index 5609e9d..15b42b1 100755
--- a/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
+++ b/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h b/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
index f50901e..4c014b9 100755
--- a/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
+++ b/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h b/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
index 798f848..691f90a 100755
--- a/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
+++ b/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,17 +42,16 @@ TDAV_BEGIN_DECLS
typedef uint16_t tdav_video_frame_seq_nums[16];
typedef tsk_list_t tdav_video_frames_L_t;
-typedef struct tdav_video_frame_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tdav_video_frame_s {
+ TSK_DECLARE_OBJECT;
+
+ uint8_t payload_type;
+ uint32_t timestamp;
+ uint16_t highest_seq_num;
+ uint32_t ssrc;
+ trtp_rtp_packets_L_t* pkts;
- uint8_t payload_type;
- uint32_t timestamp;
- uint16_t highest_seq_num;
- uint32_t ssrc;
- trtp_rtp_packets_L_t* pkts;
-
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_video_frame_t;
diff --git a/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h b/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
index e47e18b..f4f2a5c 100755
--- a/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
+++ b/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,38 +39,36 @@
TDAV_BEGIN_DECLS
-typedef enum tdav_video_jb_cb_data_type_e
-{
- tdav_video_jb_cb_data_type_rtp,
- tdav_video_jb_cb_data_type_fl, // frame lost
- tdav_video_jb_cb_data_type_tmfr, // too many frames removed
- tdav_video_jb_cb_data_type_fdd, // average frame decoding duration
- tdav_video_jb_cb_data_type_fps_changed, // fps changed, detection done using the timestamp
+typedef enum tdav_video_jb_cb_data_type_e {
+ tdav_video_jb_cb_data_type_rtp,
+ tdav_video_jb_cb_data_type_fl, // frame lost
+ tdav_video_jb_cb_data_type_tmfr, // too many frames removed
+ tdav_video_jb_cb_data_type_fdd, // average frame decoding duration
+ tdav_video_jb_cb_data_type_fps_changed, // fps changed, detection done using the timestamp
}
tdav_video_jb_cb_data_type_t;
-typedef struct tdav_video_jb_cb_data_xs
-{
- tdav_video_jb_cb_data_type_t type;
- uint32_t ssrc;
- const void* usr_data;
- union{
- struct{
- const struct trtp_rtp_packet_s* pkt;
- }rtp;
- struct{
- uint16_t seq_num;
- tsk_size_t count;
- }fl;
- struct{
- uint32_t x_dur; // expected duration in milliseconds
- uint32_t a_dur; // actual duration in milliseconds
- }fdd;
- struct{
- uint32_t old;
- uint32_t new;
- }fps;
- };
+typedef struct tdav_video_jb_cb_data_xs {
+ tdav_video_jb_cb_data_type_t type;
+ uint32_t ssrc;
+ const void* usr_data;
+ union {
+ struct {
+ const struct trtp_rtp_packet_s* pkt;
+ } rtp;
+ struct {
+ uint16_t seq_num;
+ tsk_size_t count;
+ } fl;
+ struct {
+ uint32_t x_dur; // expected duration in milliseconds
+ uint32_t a_dur; // actual duration in milliseconds
+ } fdd;
+ struct {
+ uint32_t old;
+ uint32_t new;
+ } fps;
+ };
}
tdav_video_jb_cb_data_xt;
@@ -79,6 +77,7 @@ typedef int (*tdav_video_jb_cb_f)(const tdav_video_jb_cb_data_xt* data);
struct tdav_video_jb_s* tdav_video_jb_create();
int tdav_video_jb_set_callback(struct tdav_video_jb_s* self, tdav_video_jb_cb_f callback, const void* usr_data);
+int tdav_video_jb_get_qcong(struct tdav_video_jb_s* self, float* q);
int tdav_video_jb_start(struct tdav_video_jb_s* self);
int tdav_video_jb_put(struct tdav_video_jb_s* self, struct trtp_rtp_packet_s* rtp_pkt);
int tdav_video_jb_stop(struct tdav_video_jb_s* self);
diff --git a/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h b/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
index 277c1cc..57f8ce3 100755
--- a/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
+++ b/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h b/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
index d1ee296..839fa35 100755
--- a/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
+++ b/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/tdav_consumer_video.h b/tinyDAV/include/tinydav/video/tdav_consumer_video.h
index a2bb966..3901967 100755
--- a/tinyDAV/include/tinydav/video/tdav_consumer_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_consumer_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,13 +38,12 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_VIDEO(self) ((tdav_consumer_video_t*)(self))
-typedef struct tdav_consumer_video_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_consumer_video_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_video_t;
diff --git a/tinyDAV/include/tinydav/video/tdav_converter_video.h b/tinyDAV/include/tinydav/video/tdav_converter_video.h
index 2ab3144..a721467 100755
--- a/tinyDAV/include/tinydav/video/tdav_converter_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_converter_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/video/tdav_runnable_video.h b/tinyDAV/include/tinydav/video/tdav_runnable_video.h
index 4c8aef1..44204d0 100755
--- a/tinyDAV/include/tinydav/video/tdav_runnable_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_runnable_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,11 +35,10 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_runnable_video_s
-{
- TSK_DECLARE_RUNNABLE;
+typedef struct tdav_runnable_video_s {
+ TSK_DECLARE_RUNNABLE;
- const void* userdata;
+ const void* userdata;
}
tdav_runnable_video_t;
diff --git a/tinyDAV/include/tinydav/video/tdav_session_video.h b/tinyDAV/include/tinydav/video/tdav_session_video.h
index a1cb7d4..54cea1f 100755
--- a/tinyDAV/include/tinydav/video/tdav_session_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_session_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,91 +32,100 @@
#include "tinydav_config.h"
#include "tinydav/tdav_session_av.h"
+#include "tsk_timer.h"
TDAV_BEGIN_DECLS
-typedef enum tdav_session_video_pkt_loss_level_e
-{
- tdav_session_video_pkt_loss_level_low,
- tdav_session_video_pkt_loss_level_medium,
- tdav_session_video_pkt_loss_level_high,
+typedef enum tdav_session_video_pkt_loss_level_e {
+ tdav_session_video_pkt_loss_level_low,
+ tdav_session_video_pkt_loss_level_medium,
+ tdav_session_video_pkt_loss_level_high,
}
tdav_session_video_pkt_loss_level_t;
-typedef struct tdav_session_video_s
-{
- TDAV_DECLARE_SESSION_AV;
+typedef struct tdav_session_video_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ struct tdav_video_jb_s* jb;
+ tsk_bool_t jb_enabled;
+ tsk_bool_t zero_artifacts;
+ tsk_bool_t fps_changed;
+ tsk_bool_t started;
- struct tdav_video_jb_s* jb;
- tsk_bool_t jb_enabled;
- tsk_bool_t zero_artifacts;
- tsk_bool_t fps_changed;
- tsk_bool_t started;
+ struct {
+ tsk_timer_manager_handle_t* mgr;
+ tsk_timer_id_t id_qos;
+ } timer;
- struct{
- const void* context;
- tmedia_session_rtcp_onevent_cb_f func;
- } cb_rtcpevent;
+ struct {
+ const void* context;
+ tmedia_session_rtcp_onevent_cb_f func;
+ } cb_rtcpevent;
- struct{
- void* buffer;
- tsk_size_t buffer_size;
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
- int rotation;
+ int rotation;
tsk_bool_t scale_rotated_frames;
- void* conv_buffer;
- tsk_size_t conv_buffer_size;
-
- tdav_session_video_pkt_loss_level_t pkt_loss_level;
- int32_t pkt_loss_fact;
- int32_t pkt_loss_prob_good;
- int32_t pkt_loss_prob_bad;
-
- uint64_t last_frame_time;
-
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- tsk_mutex_handle_t* h_mutex;
- } encoder;
-
- struct{
- void* buffer;
- tsk_size_t buffer_size;
-
- void* conv_buffer;
- tsk_size_t conv_buffer_size;
-
- // latest decoded RTP seqnum
- uint16_t last_seqnum;
- // stream is corrupted if packets are lost
- tsk_bool_t stream_corrupted;
- uint64_t stream_corrupted_since;
- uint32_t last_corrupted_timestamp;
-
- uint8_t codec_payload_type;
- struct tmedia_codec_s* codec;
- uint64_t codec_decoded_frames_count;
- } decoder;
-
- struct {
- tsk_size_t consumerLastWidth;
- tsk_size_t consumerLastHeight;
- struct tmedia_converter_video_s* fromYUV420;
-
- tsk_size_t producerWidth;
- tsk_size_t producerHeight;
- tsk_size_t xProducerSize;
- struct tmedia_converter_video_s* toYUV420;
- } conv;
-
- struct{
- tsk_list_t* packets;
- tsk_size_t count;
- tsk_size_t max;
- uint64_t last_fir_time;
- uint64_t last_pli_time;
- } avpf;
+ void* conv_buffer;
+ tsk_size_t conv_buffer_size;
+
+ uint64_t last_frame_time;
+
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ tsk_mutex_handle_t* h_mutex;
+ } encoder;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ void* conv_buffer;
+ tsk_size_t conv_buffer_size;
+
+ // latest decoded RTP seqnum
+ uint16_t last_seqnum;
+ // stream is corrupted if packets are lost
+ tsk_bool_t stream_corrupted;
+ uint64_t stream_corrupted_since;
+ uint32_t last_corrupted_timestamp;
+
+ uint8_t codec_payload_type;
+ struct tmedia_codec_s* codec;
+ uint64_t codec_decoded_frames_count;
+ } decoder;
+
+ struct {
+ tsk_size_t consumerLastWidth;
+ tsk_size_t consumerLastHeight;
+ struct tmedia_converter_video_s* fromYUV420;
+
+ tsk_size_t producerWidth;
+ tsk_size_t producerHeight;
+ tsk_size_t xProducerSize;
+ struct tmedia_converter_video_s* toYUV420;
+ } conv;
+
+ struct {
+ tsk_list_t* packets;
+ tsk_size_t count;
+ tsk_size_t max;
+ uint64_t last_fir_time;
+ uint64_t last_pli_time;
+ } avpf;
+
+ unsigned q1_n;
+ unsigned q2_n;
+ unsigned q3_n;
+ unsigned q4_n;
+ unsigned q5_n;
+ unsigned in_avg_fps_n;
+ unsigned dec_avg_time_n;
+ unsigned enc_avg_time_n;
+ tsk_mutex_handle_t* h_mutex_qos;
}
tdav_session_video_t;
diff --git a/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h b/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
index 496bfcb..a0fe2ea 100755
--- a/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
+++ b/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h b/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
index 3bdd52c..ba41541 100755
--- a/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
+++ b/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h b/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
index 34d4254..c9b21e4 100755
--- a/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
+++ b/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav_config.h b/tinyDAV/include/tinydav_config.h
index 7feddec..3d6d10b 100755
--- a/tinyDAV/include/tinydav_config.h
+++ b/tinyDAV/include/tinydav_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -83,13 +83,13 @@
# define TDAV_BEGIN_DECLS extern "C" {
# define TDAV_END_DECLS }
#else
-# define TDAV_BEGIN_DECLS
+# define TDAV_BEGIN_DECLS
# define TDAV_END_DECLS
#endif
#ifdef _MSC_VER
#if HAVE_FFMPEG // FFMPeg warnings (treated as errors)
-# pragma warning (disable:4244)
+# pragma warning (disable:4244)
#endif
# if !defined(__cplusplus)
# define inline __inline
@@ -111,7 +111,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYDAV_CONFIG_H
diff --git a/tinyDAV/src/audio/alsa/tdav_common_alsa.c b/tinyDAV/src/audio/alsa/tdav_common_alsa.c
index d1deec8..becc310 100755
--- a/tinyDAV/src/audio/alsa/tdav_common_alsa.c
+++ b/tinyDAV/src/audio/alsa/tdav_common_alsa.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -28,247 +28,247 @@
int tdav_common_alsa_init(tdav_common_alsa_t* p_self)
{
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (p_self->b_initialized) {
- ALSA_DEBUG_WARN("Already initialized");
- return 0;
- }
- tsk_safeobj_init(p_self);
- p_self->b_initialized = tsk_true;
- return 0;
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (p_self->b_initialized) {
+ ALSA_DEBUG_WARN("Already initialized");
+ return 0;
+ }
+ tsk_safeobj_init(p_self);
+ p_self->b_initialized = tsk_true;
+ return 0;
}
int tdav_common_alsa_lock(tdav_common_alsa_t* p_self)
{
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return tsk_safeobj_lock(p_self);
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return tsk_safeobj_lock(p_self);
}
int tdav_common_alsa_unlock(tdav_common_alsa_t* p_self)
{
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return tsk_safeobj_unlock(p_self);
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return tsk_safeobj_unlock(p_self);
}
int tdav_common_alsa_prepare(tdav_common_alsa_t* p_self, tsk_bool_t is_capture, int ptime, int channels, int sample_rate)
{
- int err = 0, val;
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(p_self);
-
- if (p_self->b_prepared) {
- ALSA_DEBUG_WARN("Already prepared");
- goto bail;
- }
- if (!p_self->p_device_name) {
- p_self->p_device_name = strdup("default");
- }
- p_self->b_capture = is_capture;
-
- if ((err = snd_pcm_open(&p_self->p_handle, p_self->p_device_name, is_capture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, /*SND_PCM_NONBLOCK | SND_PCM_ASYNC*/0)) != 0) {
- ALSA_DEBUG_ERROR("Failed to open audio device %s (%s)", p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
- ALSA_DEBUG_INFO("device('%s') opened", p_self->p_device_name);
-
- if ((err = snd_pcm_hw_params_malloc(&p_self->p_params)) != 0) {
- ALSA_DEBUG_ERROR("Failed to allocate hardware parameter structure(%s)", snd_strerror(err));
- goto bail;
- }
-
- if ((err = snd_pcm_hw_params_any(p_self->p_handle, p_self->p_params)) < 0) {
- ALSA_DEBUG_ERROR("Failed to initialize hardware parameter structure (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- if ((err = snd_pcm_hw_params_set_access(p_self->p_handle, p_self->p_params, SND_PCM_ACCESS_RW_INTERLEAVED)) != 0) {
- ALSA_DEBUG_ERROR("Failed to set access type (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- if ((err = snd_pcm_hw_params_set_format(p_self->p_handle, p_self->p_params, SND_PCM_FORMAT_S16_LE)) != 0) {
- ALSA_DEBUG_ERROR("Failed to set sample format (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- val = sample_rate;
- if ((err = snd_pcm_hw_params_set_rate_near(p_self->p_handle, p_self->p_params, &val, 0)) != 0) {
- ALSA_DEBUG_ERROR("Failed to set sample rate (rate=%d, device=%s, err=%s)", p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
- ALSA_DEBUG_INFO("sample_rate: req=%d, resp=%d", sample_rate, val);
- p_self->sample_rate = val;
-
- val = channels;
- if ((err = snd_pcm_hw_params_set_channels_near(p_self->p_handle, p_self->p_params, &val)) != 0) {
- ALSA_DEBUG_ERROR("Failed to set channels (channels=%d, device=%s, err=%s)", p_self->channels, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
- ALSA_DEBUG_INFO("channels: req=%d, resp=%d", channels, val);
- p_self->channels = val;
-
- if (!is_capture) {
- unsigned int periods = ALSA_PLAYBACK_PERIODS;
- snd_pcm_uframes_t periodSize = (ptime * p_self->sample_rate * p_self->channels) / 1000;
- if ((err = snd_pcm_hw_params_set_periods_near(p_self->p_handle, p_self->p_params, &periods, 0)) != 0) {
- ALSA_DEBUG_ERROR ("Failed to set periods (val=%u, device=%s, err=%s)", periods, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- snd_pcm_uframes_t bufferSize = (periodSize * periods);
- if ((err = snd_pcm_hw_params_set_buffer_size(p_self->p_handle, p_self->p_params, bufferSize)) != 0) {
- ALSA_DEBUG_ERROR ("Failed to set buffer size (val=%lu, device=%s, err=%s)", bufferSize, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
- ALSA_DEBUG_INFO("periods=%u, buffersize=%lu", periods, bufferSize);
- }
-
- if ((err = snd_pcm_hw_params (p_self->p_handle, p_self->p_params)) != 0) {
- ALSA_DEBUG_ERROR ("Failed to set parameters (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
- if ((err = snd_pcm_prepare(p_self->p_handle)) != 0) {
- ALSA_DEBUG_ERROR ("Failed to prepare device (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- /*if (is_capture)*/ {
- p_self->n_buff_size_in_bytes = (ptime * p_self->sample_rate * (2/*SND_PCM_FORMAT_S16_LE*/ * p_self->channels)) / 1000;
- if (!(p_self->p_buff_ptr = tsk_realloc(p_self->p_buff_ptr, p_self->n_buff_size_in_bytes))) {
- ALSA_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_self->n_buff_size_in_bytes);
- err = -4;
- goto bail;
- }
- p_self->n_buff_size_in_samples = (p_self->n_buff_size_in_bytes >> 1/*SND_PCM_FORMAT_S16_LE*/);
- ALSA_DEBUG_INFO("n_buff_size_in_bytes=%u", p_self->n_buff_size_in_bytes);
- }
-
- ALSA_DEBUG_INFO("device('%s') prepared", p_self->p_device_name);
-
- // everything is OK
- p_self->b_prepared = tsk_true;
+ int err = 0, val;
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(p_self);
+
+ if (p_self->b_prepared) {
+ ALSA_DEBUG_WARN("Already prepared");
+ goto bail;
+ }
+ if (!p_self->p_device_name) {
+ p_self->p_device_name = strdup("default");
+ }
+ p_self->b_capture = is_capture;
+
+ if ((err = snd_pcm_open(&p_self->p_handle, p_self->p_device_name, is_capture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, /*SND_PCM_NONBLOCK | SND_PCM_ASYNC*/0)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to open audio device %s (%s)", p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+ ALSA_DEBUG_INFO("device('%s') opened", p_self->p_device_name);
+
+ if ((err = snd_pcm_hw_params_malloc(&p_self->p_params)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to allocate hardware parameter structure(%s)", snd_strerror(err));
+ goto bail;
+ }
+
+ if ((err = snd_pcm_hw_params_any(p_self->p_handle, p_self->p_params)) < 0) {
+ ALSA_DEBUG_ERROR("Failed to initialize hardware parameter structure (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ if ((err = snd_pcm_hw_params_set_access(p_self->p_handle, p_self->p_params, SND_PCM_ACCESS_RW_INTERLEAVED)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to set access type (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ if ((err = snd_pcm_hw_params_set_format(p_self->p_handle, p_self->p_params, SND_PCM_FORMAT_S16_LE)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to set sample format (device=%s, err=%s)", p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ val = sample_rate;
+ if ((err = snd_pcm_hw_params_set_rate_near(p_self->p_handle, p_self->p_params, &val, 0)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to set sample rate (rate=%d, device=%s, err=%s)", p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+ ALSA_DEBUG_INFO("sample_rate: req=%d, resp=%d", sample_rate, val);
+ p_self->sample_rate = val;
+
+ val = channels;
+ if ((err = snd_pcm_hw_params_set_channels_near(p_self->p_handle, p_self->p_params, &val)) != 0) {
+ ALSA_DEBUG_ERROR("Failed to set channels (channels=%d, device=%s, err=%s)", p_self->channels, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+ ALSA_DEBUG_INFO("channels: req=%d, resp=%d", channels, val);
+ p_self->channels = val;
+
+ if (!is_capture) {
+ unsigned int periods = ALSA_PLAYBACK_PERIODS;
+ snd_pcm_uframes_t periodSize = (ptime * p_self->sample_rate * p_self->channels) / 1000;
+ if ((err = snd_pcm_hw_params_set_periods_near(p_self->p_handle, p_self->p_params, &periods, 0)) != 0) {
+ ALSA_DEBUG_ERROR ("Failed to set periods (val=%u, device=%s, err=%s)", periods, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ snd_pcm_uframes_t bufferSize = (periodSize * periods);
+ if ((err = snd_pcm_hw_params_set_buffer_size(p_self->p_handle, p_self->p_params, bufferSize)) != 0) {
+ ALSA_DEBUG_ERROR ("Failed to set buffer size (val=%lu, device=%s, err=%s)", bufferSize, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+ ALSA_DEBUG_INFO("periods=%u, buffersize=%lu", periods, bufferSize);
+ }
+
+ if ((err = snd_pcm_hw_params (p_self->p_handle, p_self->p_params)) != 0) {
+ ALSA_DEBUG_ERROR ("Failed to set parameters (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+ if ((err = snd_pcm_prepare(p_self->p_handle)) != 0) {
+ ALSA_DEBUG_ERROR ("Failed to prepare device (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ /*if (is_capture)*/ {
+ p_self->n_buff_size_in_bytes = (ptime * p_self->sample_rate * (2/*SND_PCM_FORMAT_S16_LE*/ * p_self->channels)) / 1000;
+ if (!(p_self->p_buff_ptr = tsk_realloc(p_self->p_buff_ptr, p_self->n_buff_size_in_bytes))) {
+ ALSA_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_self->n_buff_size_in_bytes);
+ err = -4;
+ goto bail;
+ }
+ p_self->n_buff_size_in_samples = (p_self->n_buff_size_in_bytes >> 1/*SND_PCM_FORMAT_S16_LE*/);
+ ALSA_DEBUG_INFO("n_buff_size_in_bytes=%u", p_self->n_buff_size_in_bytes);
+ }
+
+ ALSA_DEBUG_INFO("device('%s') prepared", p_self->p_device_name);
+
+ // everything is OK
+ p_self->b_prepared = tsk_true;
bail:
- if (err) {
- tdav_common_alsa_unprepare(p_self);
- }
- tdav_common_alsa_unlock(p_self);
- return err;
+ if (err) {
+ tdav_common_alsa_unprepare(p_self);
+ }
+ tdav_common_alsa_unlock(p_self);
+ return err;
}
int tdav_common_alsa_unprepare(tdav_common_alsa_t* p_self)
{
- int err = 0;
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(p_self);
-
- if (p_self->b_started) {
- ALSA_DEBUG_ERROR("Must stop the capture device before unpreparing");
- err = -2;
- goto bail;
- }
-
- if (p_self->p_params) {
- snd_pcm_hw_params_free(p_self->p_params);
- p_self->p_params = tsk_null;
- }
- if (p_self->p_handle) {
- snd_pcm_close(p_self->p_handle);
- p_self->p_handle = tsk_null;
- }
- p_self->b_prepared = tsk_false;
-
- ALSA_DEBUG_INFO("device('%s') unprepared", p_self->p_device_name);
+ int err = 0;
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(p_self);
+
+ if (p_self->b_started) {
+ ALSA_DEBUG_ERROR("Must stop the capture device before unpreparing");
+ err = -2;
+ goto bail;
+ }
+
+ if (p_self->p_params) {
+ snd_pcm_hw_params_free(p_self->p_params);
+ p_self->p_params = tsk_null;
+ }
+ if (p_self->p_handle) {
+ snd_pcm_close(p_self->p_handle);
+ p_self->p_handle = tsk_null;
+ }
+ p_self->b_prepared = tsk_false;
+
+ ALSA_DEBUG_INFO("device('%s') unprepared", p_self->p_device_name);
bail:
- tdav_common_alsa_unlock(p_self);
- return err;
+ tdav_common_alsa_unlock(p_self);
+ return err;
}
int tdav_common_alsa_start(tdav_common_alsa_t* p_self)
{
- int err = 0;
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(p_self);
-
- if (p_self->b_started) {
- ALSA_DEBUG_WARN("Already started");
- err = - 3;
- goto bail;
- }
- if (!p_self->b_prepared) {
- ALSA_DEBUG_ERROR("Not prepared");
- err = -2;
- goto bail;
- }
-
- if ((err = snd_pcm_start(p_self->p_handle)) != 0) {
- ALSA_DEBUG_ERROR ("Failed to start device (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
- goto bail;
- }
-
- p_self->b_started = tsk_true;
- ALSA_DEBUG_INFO("device('%s') started", p_self->p_device_name);
+ int err = 0;
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(p_self);
+
+ if (p_self->b_started) {
+ ALSA_DEBUG_WARN("Already started");
+ err = - 3;
+ goto bail;
+ }
+ if (!p_self->b_prepared) {
+ ALSA_DEBUG_ERROR("Not prepared");
+ err = -2;
+ goto bail;
+ }
+
+ if ((err = snd_pcm_start(p_self->p_handle)) != 0) {
+ ALSA_DEBUG_ERROR ("Failed to start device (channels=%d, rate=%d, device=%s, err=%s)", p_self->channels, p_self->sample_rate, p_self->p_device_name, snd_strerror(err));
+ goto bail;
+ }
+
+ p_self->b_started = tsk_true;
+ ALSA_DEBUG_INFO("device('%s') started", p_self->p_device_name);
bail:
- tdav_common_alsa_unlock(p_self);
- return err;
+ tdav_common_alsa_unlock(p_self);
+ return err;
}
int tdav_common_alsa_stop(tdav_common_alsa_t* p_self)
{
- int err = 0;
- if (!p_self) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(p_self);
-
- if (p_self->b_started) {
- p_self->b_started = tsk_false;
- //err = snd_pcm_drain(p_self->p_handle);
- ALSA_DEBUG_INFO("device('%s') stopped", p_self->p_device_name);
- }
- if (p_self->b_prepared) {
- tdav_common_alsa_unprepare(p_self);
- }
+ int err = 0;
+ if (!p_self) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(p_self);
+
+ if (p_self->b_started) {
+ p_self->b_started = tsk_false;
+ //err = snd_pcm_drain(p_self->p_handle);
+ ALSA_DEBUG_INFO("device('%s') stopped", p_self->p_device_name);
+ }
+ if (p_self->b_prepared) {
+ tdav_common_alsa_unprepare(p_self);
+ }
bail:
- tdav_common_alsa_unlock(p_self);
- return err;
+ tdav_common_alsa_unlock(p_self);
+ return err;
}
int tdav_common_alsa_deinit(tdav_common_alsa_t* p_self)
{
- if (p_self && p_self->b_initialized) {
- tdav_common_alsa_stop(p_self);
- tdav_common_alsa_unprepare(p_self);
- TSK_FREE(p_self->p_device_name);
- TSK_FREE(p_self->p_buff_ptr);
- tsk_safeobj_deinit(p_self);
- p_self->b_initialized = tsk_false;
- }
- return 0;
+ if (p_self && p_self->b_initialized) {
+ tdav_common_alsa_stop(p_self);
+ tdav_common_alsa_unprepare(p_self);
+ TSK_FREE(p_self->p_device_name);
+ TSK_FREE(p_self->p_buff_ptr);
+ tsk_safeobj_deinit(p_self);
+ p_self->b_initialized = tsk_false;
+ }
+ return 0;
}
#endif /* HAVE_ALSA_ASOUNDLIB_H */
diff --git a/tinyDAV/src/audio/alsa/tdav_consumer_alsa.c b/tinyDAV/src/audio/alsa/tdav_consumer_alsa.c
index 65bfcd8..273862d 100755
--- a/tinyDAV/src/audio/alsa/tdav_consumer_alsa.c
+++ b/tinyDAV/src/audio/alsa/tdav_consumer_alsa.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,201 +26,200 @@
#define ALSA_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR("[ALSA Consumer] " FMT, ##__VA_ARGS__)
#define ALSA_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[ALSA Consumer] " FMT, ##__VA_ARGS__)
-typedef struct tdav_consumer_alsa_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct tdav_consumer_alsa_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- tsk_bool_t b_muted;
- tsk_bool_t b_started;
- tsk_bool_t b_paused;
+ tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_paused;
- tsk_thread_handle_t* tid[1];
-
- struct tdav_common_alsa_s alsa_common;
+ tsk_thread_handle_t* tid[1];
+
+ struct tdav_common_alsa_s alsa_common;
}
tdav_consumer_alsa_t;
static void* TSK_STDCALL _tdav_producer_alsa_playback_thread(void *param)
{
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)param;
- int err;
-
- ALSA_DEBUG_INFO("__playback_thread -- START");
-
- tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
-
- while (p_alsa->b_started) {
- tdav_common_alsa_lock(&p_alsa->alsa_common);
- //snd_pcm_wait(p_alsa->alsa_common.p_handle, 20);
- //ALSA_DEBUG_INFO ("get (%d)", p_alsa->alsa_common.n_buff_size_in_bytes);
- err = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(p_alsa), p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_bytes); // requires 16bits, thread-safe
- //ALSA_DEBUG_INFO ("get returned %d", err);
- if (err < p_alsa->alsa_common.n_buff_size_in_bytes) {
- memset(((uint8_t*)p_alsa->alsa_common.p_buff_ptr) + err, 0, (p_alsa->alsa_common.n_buff_size_in_bytes - err));
-
- }
- if ((err = snd_pcm_writei(p_alsa->alsa_common.p_handle, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_samples)) != p_alsa->alsa_common.n_buff_size_in_samples) {
- if (err == -EPIPE) { // pipe broken
- err = snd_pcm_recover(p_alsa->alsa_common.p_handle, err, 0);
- if (err == 0) {
- ALSA_DEBUG_INFO ("recovered");
- goto next;
- }
- }
- ALSA_DEBUG_ERROR ("Failed to read data from audio interface failed (%d->%s)", err, snd_strerror(err));
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- goto bail;
- }
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(p_alsa));
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)param;
+ int err;
+
+ ALSA_DEBUG_INFO("__playback_thread -- START");
+
+ tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
+
+ while (p_alsa->b_started) {
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
+ //snd_pcm_wait(p_alsa->alsa_common.p_handle, 20);
+ //ALSA_DEBUG_INFO ("get (%d)", p_alsa->alsa_common.n_buff_size_in_bytes);
+ err = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(p_alsa), p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_bytes); // requires 16bits, thread-safe
+ //ALSA_DEBUG_INFO ("get returned %d", err);
+ if (err < p_alsa->alsa_common.n_buff_size_in_bytes) {
+ memset(((uint8_t*)p_alsa->alsa_common.p_buff_ptr) + err, 0, (p_alsa->alsa_common.n_buff_size_in_bytes - err));
+
+ }
+ if ((err = snd_pcm_writei(p_alsa->alsa_common.p_handle, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_samples)) != p_alsa->alsa_common.n_buff_size_in_samples) {
+ if (err == -EPIPE) { // pipe broken
+ err = snd_pcm_recover(p_alsa->alsa_common.p_handle, err, 0);
+ if (err == 0) {
+ ALSA_DEBUG_INFO ("recovered");
+ goto next;
+ }
+ }
+ ALSA_DEBUG_ERROR ("Failed to read data from audio interface failed (%d->%s)", err, snd_strerror(err));
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ goto bail;
+ }
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(p_alsa));
next:
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- }
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ }
bail:
- ALSA_DEBUG_INFO("__playback_thread -- STOP");
- return tsk_null;
+ ALSA_DEBUG_INFO("__playback_thread -- STOP");
+ return tsk_null;
}
/* ============ Media Consumer Interface ================= */
static int tdav_consumer_alsa_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
- int ret = 0;
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
+ int ret = 0;
- ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
- return ret;
+ return ret;
}
static int tdav_consumer_alsa_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
- int err = 0;
- ALSA_DEBUG_INFO("******* tdav_consumer_alsa_prepare ******");
-
- if (! p_alsa || !codec && codec->plugin) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(&p_alsa->alsa_common);
-
- // Set using requested
- TMEDIA_CONSUMER(p_alsa)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(p_alsa)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(p_alsa)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- // Prepare
- err = tdav_common_alsa_prepare(&p_alsa->alsa_common, tsk_false/*is_record*/, TMEDIA_CONSUMER( p_alsa)->audio.ptime, TMEDIA_CONSUMER( p_alsa)->audio.in.channels, TMEDIA_CONSUMER( p_alsa)->audio.in.rate);
- if (err) {
- goto bail;
- }
-
- ALSA_DEBUG_INFO("prepared: req_channels=%d; req_rate=%d, resp_channels=%d; resp_rate=%d",
- TMEDIA_CONSUMER(p_alsa)->audio.in.channels, TMEDIA_CONSUMER(p_alsa)->audio.in.rate,
- p_alsa->alsa_common.channels, p_alsa->alsa_common.sample_rate);
-
- // Set using supported (up to the resampler to convert to requested)
- TMEDIA_CONSUMER(p_alsa)->audio.out.channels = p_alsa->alsa_common.channels;
- TMEDIA_CONSUMER(p_alsa)->audio.out.rate = p_alsa->alsa_common.sample_rate;
-
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
+ int err = 0;
+ ALSA_DEBUG_INFO("******* tdav_consumer_alsa_prepare ******");
+
+ if (! p_alsa || !codec && codec->plugin) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
+
+ // Set using requested
+ TMEDIA_CONSUMER(p_alsa)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(p_alsa)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(p_alsa)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ // Prepare
+ err = tdav_common_alsa_prepare(&p_alsa->alsa_common, tsk_false/*is_record*/, TMEDIA_CONSUMER( p_alsa)->audio.ptime, TMEDIA_CONSUMER( p_alsa)->audio.in.channels, TMEDIA_CONSUMER( p_alsa)->audio.in.rate);
+ if (err) {
+ goto bail;
+ }
+
+ ALSA_DEBUG_INFO("prepared: req_channels=%d; req_rate=%d, resp_channels=%d; resp_rate=%d",
+ TMEDIA_CONSUMER(p_alsa)->audio.in.channels, TMEDIA_CONSUMER(p_alsa)->audio.in.rate,
+ p_alsa->alsa_common.channels, p_alsa->alsa_common.sample_rate);
+
+ // Set using supported (up to the resampler to convert to requested)
+ TMEDIA_CONSUMER(p_alsa)->audio.out.channels = p_alsa->alsa_common.channels;
+ TMEDIA_CONSUMER(p_alsa)->audio.out.rate = p_alsa->alsa_common.sample_rate;
+
bail:
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- return err;
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ return err;
}
static int tdav_consumer_alsa_start(tmedia_consumer_t* self)
{
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
- int err = 0;
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
+ int err = 0;
+
+ ALSA_DEBUG_INFO("******* tdav_consumer_alsa_start ******");
- ALSA_DEBUG_INFO("******* tdav_consumer_alsa_start ******");
+ if (!p_alsa) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_alsa) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(&p_alsa->alsa_common);
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
- if (p_alsa->b_started) {
- ALSA_DEBUG_WARN("Already started");
- goto bail;
- }
+ if (p_alsa->b_started) {
+ ALSA_DEBUG_WARN("Already started");
+ goto bail;
+ }
- /* start device */
- err = tdav_common_alsa_start(&p_alsa->alsa_common);
- if (err) {
- goto bail;
- }
+ /* start device */
+ err = tdav_common_alsa_start(&p_alsa->alsa_common);
+ if (err) {
+ goto bail;
+ }
- /* start thread */
- p_alsa->b_started = tsk_true;
- tsk_thread_create(&p_alsa->tid[0], _tdav_producer_alsa_playback_thread, p_alsa);
+ /* start thread */
+ p_alsa->b_started = tsk_true;
+ tsk_thread_create(&p_alsa->tid[0], _tdav_producer_alsa_playback_thread, p_alsa);
- ALSA_DEBUG_INFO("started");
+ ALSA_DEBUG_INFO("started");
bail:
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- return err;
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ return err;
}
static int tdav_consumer_alsa_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- int err = 0;
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
-
- if (!p_alsa || !buffer || !size) {
- ALSA_DEBUG_ERROR("Invalid paramter");
- return -1;
- }
-
- //tdav_common_alsa_lock(&p_alsa->alsa_common);
-
- if (!p_alsa->b_started) {
- ALSA_DEBUG_WARN("Not started");
- err = -2;
- goto bail;
- }
-
- if ((err = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(p_alsa), buffer, size, proto_hdr))) {//thread-safe
- ALSA_DEBUG_WARN("Failed to put audio data to the jitter buffer");
- goto bail;
- }
-
+ int err = 0;
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
+
+ if (!p_alsa || !buffer || !size) {
+ ALSA_DEBUG_ERROR("Invalid paramter");
+ return -1;
+ }
+
+ //tdav_common_alsa_lock(&p_alsa->alsa_common);
+
+ if (!p_alsa->b_started) {
+ ALSA_DEBUG_WARN("Not started");
+ err = -2;
+ goto bail;
+ }
+
+ if ((err = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(p_alsa), buffer, size, proto_hdr))) {//thread-safe
+ ALSA_DEBUG_WARN("Failed to put audio data to the jitter buffer");
+ goto bail;
+ }
+
bail:
- //tdav_common_alsa_unlock(&p_alsa->alsa_common);
- return err;
+ //tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ return err;
}
static int tdav_consumer_alsa_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_consumer_alsa_stop(tmedia_consumer_t* self)
{
- tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
- int err;
-
- if (!p_alsa) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* should be done here */
- p_alsa->b_started = tsk_false;
-
- err = tdav_common_alsa_stop(&p_alsa->alsa_common);
-
- /* stop thread */
- if (p_alsa->tid[0]) {
- tsk_thread_join(&(p_alsa->tid[0]));
- }
-
- ALSA_DEBUG_INFO("stopped");
-
- return 0;
+ tdav_consumer_alsa_t* p_alsa = (tdav_consumer_alsa_t*)self;
+ int err;
+
+ if (!p_alsa) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* should be done here */
+ p_alsa->b_started = tsk_false;
+
+ err = tdav_common_alsa_stop(&p_alsa->alsa_common);
+
+ /* stop thread */
+ if (p_alsa->tid[0]) {
+ tsk_thread_join(&(p_alsa->tid[0]));
+ }
+
+ ALSA_DEBUG_INFO("stopped");
+
+ return 0;
}
@@ -230,58 +229,56 @@ static int tdav_consumer_alsa_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_alsa_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_alsa_t *p_alsa = self;
- if (p_alsa) {
- ALSA_DEBUG_INFO("create");
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(p_alsa));
- /* init self */
- tdav_common_alsa_init(&p_alsa->alsa_common);
- }
- return self;
+ tdav_consumer_alsa_t *p_alsa = self;
+ if (p_alsa) {
+ ALSA_DEBUG_INFO("create");
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(p_alsa));
+ /* init self */
+ tdav_common_alsa_init(&p_alsa->alsa_common);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_alsa_dtor(tsk_object_t * self)
-{
- tdav_consumer_alsa_t *p_alsa = self;
- if (p_alsa) {
- /* stop */
- if (p_alsa->b_started) {
- tdav_consumer_alsa_stop((tmedia_consumer_t*)p_alsa);
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(p_alsa));
- /* deinit self */
- tdav_common_alsa_deinit(&p_alsa->alsa_common);
-
- ALSA_DEBUG_INFO("*** destroyed ***");
- }
-
- return self;
+{
+ tdav_consumer_alsa_t *p_alsa = self;
+ if (p_alsa) {
+ /* stop */
+ if (p_alsa->b_started) {
+ tdav_consumer_alsa_stop((tmedia_consumer_t*)p_alsa);
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(p_alsa));
+ /* deinit self */
+ tdav_common_alsa_deinit(&p_alsa->alsa_common);
+
+ ALSA_DEBUG_INFO("*** destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_alsa_def_s =
-{
- sizeof(tdav_consumer_alsa_t),
- tdav_consumer_alsa_ctor,
- tdav_consumer_alsa_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_alsa_def_s = {
+ sizeof(tdav_consumer_alsa_t),
+ tdav_consumer_alsa_ctor,
+ tdav_consumer_alsa_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_alsa_plugin_def_s =
-{
- &tdav_consumer_alsa_def_s,
-
- tmedia_audio,
- "Linux ALSA consumer",
-
- tdav_consumer_alsa_set,
- tdav_consumer_alsa_prepare,
- tdav_consumer_alsa_start,
- tdav_consumer_alsa_consume,
- tdav_consumer_alsa_pause,
- tdav_consumer_alsa_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_alsa_plugin_def_s = {
+ &tdav_consumer_alsa_def_s,
+
+ tmedia_audio,
+ "Linux ALSA consumer",
+
+ tdav_consumer_alsa_set,
+ tdav_consumer_alsa_prepare,
+ tdav_consumer_alsa_start,
+ tdav_consumer_alsa_consume,
+ tdav_consumer_alsa_pause,
+ tdav_consumer_alsa_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_alsa_plugin_def_t = &tdav_consumer_alsa_plugin_def_s;
diff --git a/tinyDAV/src/audio/alsa/tdav_producer_alsa.c b/tinyDAV/src/audio/alsa/tdav_producer_alsa.c
index d5c4021..fc8d4e2 100755
--- a/tinyDAV/src/audio/alsa/tdav_producer_alsa.c
+++ b/tinyDAV/src/audio/alsa/tdav_producer_alsa.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,175 +26,174 @@
#define ALSA_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR("[ALSA Producer] " FMT, ##__VA_ARGS__)
#define ALSA_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[ALSA Producer] " FMT, ##__VA_ARGS__)
-typedef struct tdav_producer_alsa_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t b_muted;
- tsk_bool_t b_started;
- tsk_bool_t b_paused;
-
- tsk_thread_handle_t* tid[1];
-
- struct tdav_common_alsa_s alsa_common;
+typedef struct tdav_producer_alsa_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_paused;
+
+ tsk_thread_handle_t* tid[1];
+
+ struct tdav_common_alsa_s alsa_common;
}
tdav_producer_alsa_t;
static void* TSK_STDCALL _tdav_producer_alsa_record_thread(void *param)
{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)param;
- int err;
-
- ALSA_DEBUG_INFO("__record_thread -- START");
-
- tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
-
- while (p_alsa->b_started) {
- tdav_common_alsa_lock(&p_alsa->alsa_common);
- if ((err = snd_pcm_readi(p_alsa->alsa_common.p_handle, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_samples)) != p_alsa->alsa_common.n_buff_size_in_samples) {
- ALSA_DEBUG_ERROR ("Failed to read data from audio interface failed (%d->%s)", err, snd_strerror(err));
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- goto bail;
- }
- if (!p_alsa->b_muted && TMEDIA_PRODUCER(p_alsa)->enc_cb.callback) {
- TMEDIA_PRODUCER(p_alsa)->enc_cb.callback(TMEDIA_PRODUCER(p_alsa)->enc_cb.callback_data, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_bytes);
- }
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- }
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)param;
+ int err;
+
+ ALSA_DEBUG_INFO("__record_thread -- START");
+
+ tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
+
+ while (p_alsa->b_started) {
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
+ if ((err = snd_pcm_readi(p_alsa->alsa_common.p_handle, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_samples)) != p_alsa->alsa_common.n_buff_size_in_samples) {
+ ALSA_DEBUG_ERROR ("Failed to read data from audio interface failed (%d->%s)", err, snd_strerror(err));
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ goto bail;
+ }
+ if (!p_alsa->b_muted && TMEDIA_PRODUCER(p_alsa)->enc_cb.callback) {
+ TMEDIA_PRODUCER(p_alsa)->enc_cb.callback(TMEDIA_PRODUCER(p_alsa)->enc_cb.callback_data, p_alsa->alsa_common.p_buff_ptr, p_alsa->alsa_common.n_buff_size_in_bytes);
+ }
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ }
bail:
- ALSA_DEBUG_INFO("__record_thread -- STOP");
- return tsk_null;
+ ALSA_DEBUG_INFO("__record_thread -- STOP");
+ return tsk_null;
}
/* ============ Media Producer Interface ================= */
static int tdav_producer_alsa_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
- if (param->plugin_type == tmedia_ppt_producer) {
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "volume")) {
- return 0;
- }
- else if(tsk_striequals(param->key, "mute")){
- p_alsa->b_muted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+{
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
+ if (param->plugin_type == tmedia_ppt_producer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "volume")) {
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "mute")) {
+ p_alsa->b_muted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_alsa_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
- int err = 0;
- ALSA_DEBUG_INFO("******* tdav_producer_alsa_prepare ******");
-
- if (! p_alsa || !codec && codec->plugin) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(&p_alsa->alsa_common);
-
- // Set using requested
- TMEDIA_PRODUCER( p_alsa)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER( p_alsa)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER( p_alsa)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
-
- // Prepare
- err = tdav_common_alsa_prepare(&p_alsa->alsa_common, tsk_true/*is_capture*/, TMEDIA_PRODUCER( p_alsa)->audio.ptime, TMEDIA_PRODUCER( p_alsa)->audio.channels, TMEDIA_PRODUCER( p_alsa)->audio.rate);
- if (err) {
- goto bail;
- }
-
- ALSA_DEBUG_INFO("prepared: req_channels=%d; req_rate=%d, resp_channels=%d; resp_rate=%d",
- TMEDIA_PRODUCER(p_alsa)->audio.channels, TMEDIA_PRODUCER(p_alsa)->audio.rate,
- p_alsa->alsa_common.channels, p_alsa->alsa_common.sample_rate);
-
- // Set using supported (up to the resampler to convert to requested)
- TMEDIA_PRODUCER(p_alsa)->audio.channels = p_alsa->alsa_common.channels;
- TMEDIA_PRODUCER(p_alsa)->audio.rate = p_alsa->alsa_common.sample_rate;
-
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
+ int err = 0;
+ ALSA_DEBUG_INFO("******* tdav_producer_alsa_prepare ******");
+
+ if (! p_alsa || !codec && codec->plugin) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
+
+ // Set using requested
+ TMEDIA_PRODUCER( p_alsa)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER( p_alsa)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER( p_alsa)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+
+ // Prepare
+ err = tdav_common_alsa_prepare(&p_alsa->alsa_common, tsk_true/*is_capture*/, TMEDIA_PRODUCER( p_alsa)->audio.ptime, TMEDIA_PRODUCER( p_alsa)->audio.channels, TMEDIA_PRODUCER( p_alsa)->audio.rate);
+ if (err) {
+ goto bail;
+ }
+
+ ALSA_DEBUG_INFO("prepared: req_channels=%d; req_rate=%d, resp_channels=%d; resp_rate=%d",
+ TMEDIA_PRODUCER(p_alsa)->audio.channels, TMEDIA_PRODUCER(p_alsa)->audio.rate,
+ p_alsa->alsa_common.channels, p_alsa->alsa_common.sample_rate);
+
+ // Set using supported (up to the resampler to convert to requested)
+ TMEDIA_PRODUCER(p_alsa)->audio.channels = p_alsa->alsa_common.channels;
+ TMEDIA_PRODUCER(p_alsa)->audio.rate = p_alsa->alsa_common.sample_rate;
+
bail:
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- return err;
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ return err;
}
static int tdav_producer_alsa_start(tmedia_producer_t* self)
{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
- int err = 0;
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
+ int err = 0;
+
+ ALSA_DEBUG_INFO("******* tdav_producer_alsa_start ******");
- ALSA_DEBUG_INFO("******* tdav_producer_alsa_start ******");
+ if (!p_alsa) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_alsa) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_common_alsa_lock(&p_alsa->alsa_common);
+ tdav_common_alsa_lock(&p_alsa->alsa_common);
- if (p_alsa->b_started) {
- ALSA_DEBUG_WARN("Already started");
- goto bail;
- }
+ if (p_alsa->b_started) {
+ ALSA_DEBUG_WARN("Already started");
+ goto bail;
+ }
- /* start device */
- err = tdav_common_alsa_start(&p_alsa->alsa_common);
- if (err) {
- goto bail;
- }
+ /* start device */
+ err = tdav_common_alsa_start(&p_alsa->alsa_common);
+ if (err) {
+ goto bail;
+ }
- /* start thread */
- p_alsa->b_started = tsk_true;
- tsk_thread_create(&p_alsa->tid[0], _tdav_producer_alsa_record_thread, p_alsa);
+ /* start thread */
+ p_alsa->b_started = tsk_true;
+ tsk_thread_create(&p_alsa->tid[0], _tdav_producer_alsa_record_thread, p_alsa);
- ALSA_DEBUG_INFO("started");
+ ALSA_DEBUG_INFO("started");
bail:
- tdav_common_alsa_unlock(&p_alsa->alsa_common);
- return err;
+ tdav_common_alsa_unlock(&p_alsa->alsa_common);
+ return err;
}
static int tdav_producer_alsa_pause(tmedia_producer_t* self)
{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
- if (!p_alsa) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- ALSA_DEBUG_INFO("paused");
+ if (!p_alsa) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ ALSA_DEBUG_INFO("paused");
+
+ return 0;
}
static int tdav_producer_alsa_stop(tmedia_producer_t* self)
{
- tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
- int err;
-
- if (!p_alsa) {
- ALSA_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* should be done here */
- p_alsa->b_started = tsk_false;
-
- err = tdav_common_alsa_stop(&p_alsa->alsa_common);
-
- /* stop thread */
- if (p_alsa->tid[0]) {
- tsk_thread_join(&(p_alsa->tid[0]));
- }
-
- ALSA_DEBUG_INFO("stopped");
-
- return 0;
+ tdav_producer_alsa_t* p_alsa = (tdav_producer_alsa_t*)self;
+ int err;
+
+ if (!p_alsa) {
+ ALSA_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* should be done here */
+ p_alsa->b_started = tsk_false;
+
+ err = tdav_common_alsa_stop(&p_alsa->alsa_common);
+
+ /* stop thread */
+ if (p_alsa->tid[0]) {
+ tsk_thread_join(&(p_alsa->tid[0]));
+ }
+
+ ALSA_DEBUG_INFO("stopped");
+
+ return 0;
}
@@ -204,57 +203,55 @@ static int tdav_producer_alsa_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_alsa_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_alsa_t *p_alsa = (tdav_producer_alsa_t*)self;
- if (p_alsa) {
- ALSA_DEBUG_INFO("create");
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(p_alsa));
- /* init self */
- tdav_common_alsa_init(&p_alsa->alsa_common);
- }
- return self;
+ tdav_producer_alsa_t *p_alsa = (tdav_producer_alsa_t*)self;
+ if (p_alsa) {
+ ALSA_DEBUG_INFO("create");
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(p_alsa));
+ /* init self */
+ tdav_common_alsa_init(&p_alsa->alsa_common);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_alsa_dtor(tsk_object_t * self)
-{
- tdav_producer_alsa_t *p_alsa = (tdav_producer_alsa_t *)self;
- if (p_alsa) {
- /* stop */
- if (p_alsa->b_started) {
- tdav_producer_alsa_stop((tmedia_producer_t*)p_alsa);
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(p_alsa));
- /* deinit self */
- tdav_common_alsa_deinit(&p_alsa->alsa_common);
-
- ALSA_DEBUG_INFO("*** destroyed ***");
- }
-
- return self;
+{
+ tdav_producer_alsa_t *p_alsa = (tdav_producer_alsa_t *)self;
+ if (p_alsa) {
+ /* stop */
+ if (p_alsa->b_started) {
+ tdav_producer_alsa_stop((tmedia_producer_t*)p_alsa);
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(p_alsa));
+ /* deinit self */
+ tdav_common_alsa_deinit(&p_alsa->alsa_common);
+
+ ALSA_DEBUG_INFO("*** destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_alsa_def_s =
-{
- sizeof(tdav_producer_alsa_t),
- tdav_producer_alsa_ctor,
- tdav_producer_alsa_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_alsa_def_s = {
+ sizeof(tdav_producer_alsa_t),
+ tdav_producer_alsa_ctor,
+ tdav_producer_alsa_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_alsa_plugin_def_s =
-{
- &tdav_producer_alsa_def_s,
-
- tmedia_audio,
- "Linux ALSA producer",
-
- tdav_producer_alsa_set,
- tdav_producer_alsa_prepare,
- tdav_producer_alsa_start,
- tdav_producer_alsa_pause,
- tdav_producer_alsa_stop
+static const tmedia_producer_plugin_def_t tdav_producer_alsa_plugin_def_s = {
+ &tdav_producer_alsa_def_s,
+
+ tmedia_audio,
+ "Linux ALSA producer",
+
+ tdav_producer_alsa_set,
+ tdav_producer_alsa_prepare,
+ tdav_producer_alsa_start,
+ tdav_producer_alsa_pause,
+ tdav_producer_alsa_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_alsa_plugin_def_t = &tdav_producer_alsa_plugin_def_s;
diff --git a/tinyDAV/src/audio/coreaudio/tdav_audiounit.c b/tinyDAV/src/audio/coreaudio/tdav_audiounit.c
index dc11f10..d00f8ee 100755
--- a/tinyDAV/src/audio/coreaudio/tdav_audiounit.c
+++ b/tinyDAV/src/audio/coreaudio/tdav_audiounit.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -36,15 +36,15 @@ static UInt32 kZero = 0;
#endif /* TARGET_OS_IPHONE */
#if TARGET_OS_IPHONE
- #if TARGET_IPHONE_SIMULATOR // VoiceProcessingIO will give unexpected result on the simulator when using iOS 5
- #define kDoubangoAudioUnitSubType kAudioUnitSubType_RemoteIO
- #else // Echo cancellation, AGC, ...
- #define kDoubangoAudioUnitSubType kAudioUnitSubType_VoiceProcessingIO
- #endif
+#if TARGET_IPHONE_SIMULATOR // VoiceProcessingIO will give unexpected result on the simulator when using iOS 5
+#define kDoubangoAudioUnitSubType kAudioUnitSubType_RemoteIO
+#else // Echo cancellation, AGC, ...
+#define kDoubangoAudioUnitSubType kAudioUnitSubType_VoiceProcessingIO
+#endif
#elif TARGET_OS_MAC
- #define kDoubangoAudioUnitSubType kAudioUnitSubType_HALOutput
+#define kDoubangoAudioUnitSubType kAudioUnitSubType_HALOutput
#else
- #error "Unknown target"
+#error "Unknown target"
#endif
#undef kInputBus
@@ -52,21 +52,20 @@ static UInt32 kZero = 0;
#undef kOutputBus
#define kOutputBus 0
-typedef struct tdav_audiounit_instance_s
-{
- TSK_DECLARE_OBJECT;
- uint64_t session_id;
- uint32_t frame_duration;
- AudioComponentInstance audioUnit;
- struct{
- unsigned consumer:1;
- unsigned producer:1;
- } prepared;
- unsigned started:1;
+typedef struct tdav_audiounit_instance_s {
+ TSK_DECLARE_OBJECT;
+ uint64_t session_id;
+ uint32_t frame_duration;
+ AudioComponentInstance audioUnit;
+ struct {
+ unsigned consumer:1;
+ unsigned producer:1;
+ } prepared;
+ unsigned started:1;
unsigned interrupted:1;
-
- TSK_DECLARE_SAFEOBJ;
-
+
+ TSK_DECLARE_SAFEOBJ;
+
}
tdav_audiounit_instance_t;
TINYDAV_GEXTERN const tsk_object_def_t *tdav_audiounit_instance_def_t;
@@ -78,133 +77,133 @@ static tdav_audiounit_instances_L_t* __audioUnitInstances = tsk_null;
static int _tdav_audiounit_handle_signal_xxx_prepared(tdav_audiounit_handle_t* self, tsk_bool_t consumer)
{
- tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
- if(!inst || !inst->audioUnit){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(inst);
-
- if(consumer){
- inst->prepared.consumer = tsk_true;
- }
- else {
- inst->prepared.producer = tsk_true;
- }
-
- OSStatus status;
-
- // For iOS we are using full-duplex AudioUnit and we wait for both consumer and producer to be prepared
+ tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
+ if(!inst || !inst->audioUnit) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(inst);
+
+ if(consumer) {
+ inst->prepared.consumer = tsk_true;
+ }
+ else {
+ inst->prepared.producer = tsk_true;
+ }
+
+ OSStatus status;
+
+ // For iOS we are using full-duplex AudioUnit and we wait for both consumer and producer to be prepared
#if TARGET_OS_IPHONE
- if(inst->prepared.consumer && inst->prepared.producer)
+ if(inst->prepared.consumer && inst->prepared.producer)
#endif
- {
- status = AudioUnitInitialize(inst->audioUnit);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitInitialize failed with status =%ld", (signed long)status);
- tsk_safeobj_unlock(inst);
- return -2;
- }
- }
-
- tsk_safeobj_unlock(inst);
- return 0;
+ {
+ status = AudioUnitInitialize(inst->audioUnit);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitInitialize failed with status =%ld", (signed long)status);
+ tsk_safeobj_unlock(inst);
+ return -2;
+ }
+ }
+
+ tsk_safeobj_unlock(inst);
+ return 0;
}
tdav_audiounit_handle_t* tdav_audiounit_handle_create(uint64_t session_id)
{
- tdav_audiounit_instance_t* inst = tsk_null;
-
- // create audio unit component
- if(!__audioSystem){
- AudioComponentDescription audioDescription;
- audioDescription.componentType = kAudioUnitType_Output;
- audioDescription.componentSubType = kDoubangoAudioUnitSubType;
- audioDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
- audioDescription.componentFlags = 0;
- audioDescription.componentFlagsMask = 0;
- if((__audioSystem = AudioComponentFindNext(NULL, &audioDescription))){
- // leave blank
- }
- else {
- TSK_DEBUG_ERROR("Failed to find new audio component");
- goto done;
- }
-
- }
- // create list used to hold instances
- if(!__audioUnitInstances && !(__audioUnitInstances = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create new list");
- goto done;
- }
-
- //= lock the list
- tsk_list_lock(__audioUnitInstances);
-
- // For iOS we are using full-duplex AudioUnit and to keep it unique for both
- // the consumer and producer we use the session id.
+ tdav_audiounit_instance_t* inst = tsk_null;
+
+ // create audio unit component
+ if(!__audioSystem) {
+ AudioComponentDescription audioDescription;
+ audioDescription.componentType = kAudioUnitType_Output;
+ audioDescription.componentSubType = kDoubangoAudioUnitSubType;
+ audioDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
+ audioDescription.componentFlags = 0;
+ audioDescription.componentFlagsMask = 0;
+ if((__audioSystem = AudioComponentFindNext(NULL, &audioDescription))) {
+ // leave blank
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to find new audio component");
+ goto done;
+ }
+
+ }
+ // create list used to hold instances
+ if(!__audioUnitInstances && !(__audioUnitInstances = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create new list");
+ goto done;
+ }
+
+ //= lock the list
+ tsk_list_lock(__audioUnitInstances);
+
+ // For iOS we are using full-duplex AudioUnit and to keep it unique for both
+ // the consumer and producer we use the session id.
#if TARGET_OS_IPHONE
- // find the instance from the list
- const tsk_list_item_t* item;
- tsk_list_foreach(item,__audioUnitInstances){
- if(((tdav_audiounit_instance_t*)item->data)->session_id == session_id){
- inst = tsk_object_ref(item->data);
- goto done;
- }
- }
+ // find the instance from the list
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item,__audioUnitInstances) {
+ if(((tdav_audiounit_instance_t*)item->data)->session_id == session_id) {
+ inst = tsk_object_ref(item->data);
+ goto done;
+ }
+ }
#endif
-
- // create instance object and put it into the list
- if((inst = tsk_object_new(tdav_audiounit_instance_def_t))){
- OSStatus status = noErr;
- tdav_audiounit_instance_t* _inst;
-
- // create new instance
- if((status= AudioComponentInstanceNew(__audioSystem, &inst->audioUnit)) != noErr){
- TSK_DEBUG_ERROR("AudioComponentInstanceNew() failed with status=%ld", (signed long)status);
- TSK_OBJECT_SAFE_FREE(inst);
- goto done;
- }
- _inst = inst, _inst->session_id = session_id;
- tsk_list_push_back_data(__audioUnitInstances, (void**)&_inst);
- }
-
+
+ // create instance object and put it into the list
+ if((inst = tsk_object_new(tdav_audiounit_instance_def_t))) {
+ OSStatus status = noErr;
+ tdav_audiounit_instance_t* _inst;
+
+ // create new instance
+ if((status= AudioComponentInstanceNew(__audioSystem, &inst->audioUnit)) != noErr) {
+ TSK_DEBUG_ERROR("AudioComponentInstanceNew() failed with status=%ld", (signed long)status);
+ TSK_OBJECT_SAFE_FREE(inst);
+ goto done;
+ }
+ _inst = inst, _inst->session_id = session_id;
+ tsk_list_push_back_data(__audioUnitInstances, (void**)&_inst);
+ }
+
done:
- //= unlock the list
- tsk_list_unlock(__audioUnitInstances);
- return (tdav_audiounit_handle_t*)inst;
+ //= unlock the list
+ tsk_list_unlock(__audioUnitInstances);
+ return (tdav_audiounit_handle_t*)inst;
}
AudioComponentInstance tdav_audiounit_handle_get_instance(tdav_audiounit_handle_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- return ((tdav_audiounit_instance_t*)self)->audioUnit;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ return ((tdav_audiounit_instance_t*)self)->audioUnit;
}
int tdav_audiounit_handle_signal_consumer_prepared(tdav_audiounit_handle_t* self)
{
- return _tdav_audiounit_handle_signal_xxx_prepared(self, tsk_true);
+ return _tdav_audiounit_handle_signal_xxx_prepared(self, tsk_true);
}
int tdav_audiounit_handle_signal_producer_prepared(tdav_audiounit_handle_t* self)
{
- return _tdav_audiounit_handle_signal_xxx_prepared(self, tsk_false);
+ return _tdav_audiounit_handle_signal_xxx_prepared(self, tsk_false);
}
int tdav_audiounit_handle_start(tdav_audiounit_handle_t* self)
{
- tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
- OSStatus status = noErr;
- if(!inst || !inst->audioUnit){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(inst);
+ tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
+ OSStatus status = noErr;
+ if(!inst || !inst->audioUnit) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(inst);
status = (OSStatus)tdav_apple_enable_audio();
if (status == noErr) {
if ((!inst->started || inst->interrupted) && (status = AudioOutputUnitStart(inst->audioUnit))) {
@@ -215,106 +214,108 @@ int tdav_audiounit_handle_start(tdav_audiounit_handle_t* self)
TSK_DEBUG_ERROR("tdav_apple_enable_audio() failed with status=%ld", (signed long)status);
}
inst->started = (status == noErr) ? tsk_true : tsk_false;
- if (inst->started) inst->interrupted = 0;
- tsk_safeobj_unlock(inst);
- return status ? -2 : 0;
+ if (inst->started) {
+ inst->interrupted = 0;
+ }
+ tsk_safeobj_unlock(inst);
+ return status ? -2 : 0;
}
uint32_t tdav_audiounit_handle_get_frame_duration(tdav_audiounit_handle_t* self)
{
- if(self){
- return ((tdav_audiounit_instance_t*)self)->frame_duration;
- }
- return 0;
+ if(self) {
+ return ((tdav_audiounit_instance_t*)self)->frame_duration;
+ }
+ return 0;
}
int tdav_audiounit_handle_configure(tdav_audiounit_handle_t* self, tsk_bool_t consumer, uint32_t ptime, AudioStreamBasicDescription* audioFormat)
{
- OSStatus status = noErr;
- tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
-
- if(!inst || !audioFormat){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ OSStatus status = noErr;
+ tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
+
+ if(!inst || !audioFormat) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TARGET_OS_IPHONE
- // set preferred buffer size
- Float32 preferredBufferSize = ((Float32)ptime / 1000.f); // in seconds
- UInt32 size = sizeof(preferredBufferSize);
- status = AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof(preferredBufferSize), &preferredBufferSize);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration) failed with status=%d", (int)status);
- TSK_OBJECT_SAFE_FREE(inst);
- goto done;
- }
- status = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, &size, &preferredBufferSize);
- if(status == noErr){
- inst->frame_duration = (preferredBufferSize * 1000);
- TSK_DEBUG_INFO("Frame duration=%d", inst->frame_duration);
- }
- else {
- TSK_DEBUG_ERROR("AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, %f) failed", preferredBufferSize);
- }
-
-
- UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord;
- status = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_AudioCategory) failed with status code=%d", (int)status);
- goto done;
- }
-
+ // set preferred buffer size
+ Float32 preferredBufferSize = ((Float32)ptime / 1000.f); // in seconds
+ UInt32 size = sizeof(preferredBufferSize);
+ status = AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof(preferredBufferSize), &preferredBufferSize);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration) failed with status=%d", (int)status);
+ TSK_OBJECT_SAFE_FREE(inst);
+ goto done;
+ }
+ status = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, &size, &preferredBufferSize);
+ if(status == noErr) {
+ inst->frame_duration = (preferredBufferSize * 1000);
+ TSK_DEBUG_INFO("Frame duration=%d", inst->frame_duration);
+ }
+ else {
+ TSK_DEBUG_ERROR("AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, %f) failed", preferredBufferSize);
+ }
+
+
+ UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord;
+ status = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_AudioCategory) failed with status code=%d", (int)status);
+ goto done;
+ }
+
#elif TARGET_OS_MAC
#if 1
- // set preferred buffer size
- UInt32 preferredBufferSize = ((ptime * audioFormat->mSampleRate)/1000); // in bytes
- UInt32 size = sizeof(preferredBufferSize);
- status = AudioUnitSetProperty(inst->audioUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0, &preferredBufferSize, size);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
- }
- status = AudioUnitGetProperty(inst->audioUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0, &preferredBufferSize, &size);
- if(status == noErr){
- inst->frame_duration = ((preferredBufferSize * 1000)/audioFormat->mSampleRate);
- TSK_DEBUG_INFO("Frame duration=%d", inst->frame_duration);
- }
- else {
- TSK_DEBUG_ERROR("AudioUnitGetProperty(kAudioDevicePropertyBufferFrameSize, %lu) failed", (unsigned long)preferredBufferSize);
- }
+ // set preferred buffer size
+ UInt32 preferredBufferSize = ((ptime * audioFormat->mSampleRate)/1000); // in bytes
+ UInt32 size = sizeof(preferredBufferSize);
+ status = AudioUnitSetProperty(inst->audioUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0, &preferredBufferSize, size);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
+ }
+ status = AudioUnitGetProperty(inst->audioUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0, &preferredBufferSize, &size);
+ if(status == noErr) {
+ inst->frame_duration = ((preferredBufferSize * 1000)/audioFormat->mSampleRate);
+ TSK_DEBUG_INFO("Frame duration=%d", inst->frame_duration);
+ }
+ else {
+ TSK_DEBUG_ERROR("AudioUnitGetProperty(kAudioDevicePropertyBufferFrameSize, %lu) failed", (unsigned long)preferredBufferSize);
+ }
#endif
-
+
#endif
-
+
done:
- return (status == noErr) ? 0 : -2;
+ return (status == noErr) ? 0 : -2;
}
int tdav_audiounit_handle_mute(tdav_audiounit_handle_t* self, tsk_bool_t mute)
{
- tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
- if(!inst || !inst->audioUnit){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
+ if(!inst || !inst->audioUnit) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TARGET_OS_IPHONE
- OSStatus status = noErr;
- status = AudioUnitSetProperty(inst->audioUnit, kAUVoiceIOProperty_MuteOutput,
- kAudioUnitScope_Output, kOutputBus, mute ? &kOne : &kZero, mute ? sizeof(kOne) : sizeof(kZero));
-
- return (status == noErr) ? 0 : -2;
+ OSStatus status = noErr;
+ status = AudioUnitSetProperty(inst->audioUnit, kAUVoiceIOProperty_MuteOutput,
+ kAudioUnitScope_Output, kOutputBus, mute ? &kOne : &kZero, mute ? sizeof(kOne) : sizeof(kZero));
+
+ return (status == noErr) ? 0 : -2;
#else
- return 0;
+ return 0;
#endif
}
int tdav_audiounit_handle_interrupt(tdav_audiounit_handle_t* self, tsk_bool_t interrupt)
{
tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
- if (!inst){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!inst) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
OSStatus status = noErr;
if (inst->interrupted != interrupt && inst->started) {
if (interrupt) {
@@ -346,37 +347,38 @@ bail:
int tdav_audiounit_handle_stop(tdav_audiounit_handle_t* self)
{
- tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
- OSStatus status = noErr;
- if(!inst || (inst->started && !inst->audioUnit)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(inst);
- if(inst->started && (status = AudioOutputUnitStop(inst->audioUnit))){
- TSK_DEBUG_ERROR("AudioOutputUnitStop failed with status=%ld", (signed long)status);
- }
+ tdav_audiounit_instance_t* inst = (tdav_audiounit_instance_t*)self;
+ OSStatus status = noErr;
+ if(!inst || (inst->started && !inst->audioUnit)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(inst);
+ if(inst->started && (status = AudioOutputUnitStop(inst->audioUnit))) {
+ TSK_DEBUG_ERROR("AudioOutputUnitStop failed with status=%ld", (signed long)status);
+ }
inst->started = (status == noErr ? tsk_false : tsk_true);
- tsk_safeobj_unlock(inst);
- return (status != noErr) ? -2 : 0;
+ tsk_safeobj_unlock(inst);
+ return (status != noErr) ? -2 : 0;
}
-int tdav_audiounit_handle_destroy(tdav_audiounit_handle_t** self){
- if(!self || !*self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_lock(__audioUnitInstances);
- if(tsk_object_get_refcount(*self)==1){
- tsk_list_remove_item_by_data(__audioUnitInstances, *self);
- }
- else {
- tsk_object_unref(*self);
- }
- tsk_list_unlock(__audioUnitInstances);
- *self = tsk_null;
- return 0;
+int tdav_audiounit_handle_destroy(tdav_audiounit_handle_t** self)
+{
+ if(!self || !*self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_lock(__audioUnitInstances);
+ if(tsk_object_get_refcount(*self)==1) {
+ tsk_list_remove_item_by_data(__audioUnitInstances, *self);
+ }
+ else {
+ tsk_object_unref(*self);
+ }
+ tsk_list_unlock(__audioUnitInstances);
+ *self = tsk_null;
+ return 0;
}
//
@@ -384,39 +386,38 @@ int tdav_audiounit_handle_destroy(tdav_audiounit_handle_t** self){
//
static tsk_object_t* tdav_audiounit_instance_ctor(tsk_object_t * self, va_list * app)
{
- tdav_audiounit_instance_t* inst = self;
- if(inst){
- tsk_safeobj_init(inst);
- }
- return self;
+ tdav_audiounit_instance_t* inst = self;
+ if(inst) {
+ tsk_safeobj_init(inst);
+ }
+ return self;
}
static tsk_object_t* tdav_audiounit_instance_dtor(tsk_object_t * self)
-{
- tdav_audiounit_instance_t* inst = self;
- if(inst){
+{
+ tdav_audiounit_instance_t* inst = self;
+ if(inst) {
tsk_safeobj_lock(inst);
- if(inst->audioUnit){
+ if(inst->audioUnit) {
AudioUnitUninitialize(inst->audioUnit);
AudioComponentInstanceDispose(inst->audioUnit);
inst->audioUnit = tsk_null;
- }
+ }
tsk_safeobj_unlock(inst);
-
- tsk_safeobj_deinit(inst);
+
+ tsk_safeobj_deinit(inst);
TSK_DEBUG_INFO("*** AudioUnit Instance destroyed ***");
- }
- return self;
+ }
+ return self;
}
static int tdav_audiounit_instance_cmp(const tsk_object_t *_ai1, const tsk_object_t *_ai2)
{
- return (int)(_ai1 - _ai2);
+ return (int)(_ai1 - _ai2);
}
-static const tsk_object_def_t tdav_audiounit_instance_def_s =
-{
- sizeof(tdav_audiounit_instance_t),
- tdav_audiounit_instance_ctor,
- tdav_audiounit_instance_dtor,
- tdav_audiounit_instance_cmp,
+static const tsk_object_def_t tdav_audiounit_instance_def_s = {
+ sizeof(tdav_audiounit_instance_t),
+ tdav_audiounit_instance_ctor,
+ tdav_audiounit_instance_dtor,
+ tdav_audiounit_instance_cmp,
};
const tsk_object_def_t *tdav_audiounit_instance_def_t = &tdav_audiounit_instance_def_s;
diff --git a/tinyDAV/src/audio/coreaudio/tdav_consumer_audioqueue.c b/tinyDAV/src/audio/coreaudio/tdav_consumer_audioqueue.c
index 2f5fd90..882a988 100755
--- a/tinyDAV/src/audio/coreaudio/tdav_consumer_audioqueue.c
+++ b/tinyDAV/src/audio/coreaudio/tdav_consumer_audioqueue.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tdav_consumer_audioqueue.c
* @brief Audio Consumer for MacOSX and iOS platforms.
*
- * @authors
+ * @authors
* - Laurent Etiemble <laurent.etiemble(at)gmail.com>
* - Mamadou Diop <diopmamadou(at)doubango(dot)org>
*
@@ -40,22 +40,23 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-static void __handle_output_buffer(void *userdata, AudioQueueRef queue, AudioQueueBufferRef buffer) {
+static void __handle_output_buffer(void *userdata, AudioQueueRef queue, AudioQueueBufferRef buffer)
+{
tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)userdata;
-
+
if (!consumer->started) {
return;
}
-
- if(!tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(consumer), buffer->mAudioData, consumer->buffer_size)){
- // Put silence
- memset(buffer->mAudioData, 0, consumer->buffer_size);
- }
-
+
+ if(!tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(consumer), buffer->mAudioData, consumer->buffer_size)) {
+ // Put silence
+ memset(buffer->mAudioData, 0, consumer->buffer_size);
+ }
+
// Re-enqueue the buffer
AudioQueueEnqueueBuffer(consumer->queue, buffer, 0, NULL);
- // alert the jitter buffer
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(consumer));
+ // alert the jitter buffer
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(consumer));
}
/* ============ Media Consumer Interface ================= */
@@ -64,25 +65,25 @@ static void __handle_output_buffer(void *userdata, AudioQueueRef queue, AudioQue
int tdav_consumer_audioqueue_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
OSStatus ret;
- tsk_size_t i;
- tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
-
- if(!consumer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
- /* codec should have ptime */
-
- // Set audio category
+ tsk_size_t i;
+ tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
+
+ if(!consumer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+ /* codec should have ptime */
+
+ // Set audio category
#if TARGET_OS_IPHONE
- UInt32 category = kAudioSessionCategory_PlayAndRecord;
- AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
+ UInt32 category = kAudioSessionCategory_PlayAndRecord;
+ AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
#endif
-
+
// Create the audio stream description
AudioStreamBasicDescription *description = &(consumer->description);
description->mSampleRate = TMEDIA_CONSUMER(consumer)->audio.out.rate ? TMEDIA_CONSUMER(consumer)->audio.out.rate : TMEDIA_CONSUMER(consumer)->audio.in.rate;
@@ -94,107 +95,107 @@ int tdav_consumer_audioqueue_prepare(tmedia_consumer_t* self, const tmedia_codec
description->mBytesPerPacket = description->mBitsPerChannel / 8 * description->mChannelsPerFrame;
description->mBytesPerFrame = description->mBytesPerPacket;
description->mReserved = 0;
-
+
int packetperbuffer = 1000 / TMEDIA_CONSUMER(consumer)->audio.ptime;
consumer->buffer_size = description->mSampleRate * description->mBytesPerFrame / packetperbuffer;
-
+
// Create the playback audio queue
ret = AudioQueueNewOutput(&(consumer->description),
__handle_output_buffer,
consumer,
- NULL,
+ NULL,
NULL,
0,
&(consumer->queue));
-
+
for(i = 0; i < CoreAudioPlayBuffers; i++) {
// Create the buffer for the queue
ret = AudioQueueAllocateBuffer(consumer->queue, consumer->buffer_size, &(consumer->buffers[i]));
if (ret) {
break;
}
-
+
// Clear the data
memset(consumer->buffers[i]->mAudioData, 0, consumer->buffer_size);
consumer->buffers[i]->mAudioDataByteSize = consumer->buffer_size;
-
+
// Enqueue the buffer
ret = AudioQueueEnqueueBuffer(consumer->queue, consumer->buffers[i], 0, NULL);
if (ret) {
break;
}
}
-
- return ret;
+
+ return ret;
}
int tdav_consumer_audioqueue_start(tmedia_consumer_t* self)
{
OSStatus ret;
- tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(consumer->started){
- TSK_DEBUG_WARN("Consumer already started");
- return 0;
- }
-
- consumer->started = tsk_true;
+ tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(consumer->started) {
+ TSK_DEBUG_WARN("Consumer already started");
+ return 0;
+ }
+
+ consumer->started = tsk_true;
ret = AudioQueueStart(consumer->queue, NULL);
-
- return ret;
+
+ return ret;
}
int tdav_consumer_audioqueue_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
-
- if(!consumer || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // buffer is already decoded
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
+ tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
+
+ if(!consumer || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // buffer is already decoded
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
}
int tdav_consumer_audioqueue_pause(tmedia_consumer_t* self)
{
OSStatus ret;
- tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
+ tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
ret = AudioQueuePause(consumer->queue);
-
- return ret;
+
+ return ret;
}
int tdav_consumer_audioqueue_stop(tmedia_consumer_t* self)
{
OSStatus ret;
- tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!consumer->started){
- TSK_DEBUG_WARN("Consumer not started");
- return 0;
- }
-
- consumer->started = tsk_false;
+ tdav_consumer_audioqueue_t* consumer = (tdav_consumer_audioqueue_t*)self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!consumer->started) {
+ TSK_DEBUG_WARN("Consumer not started");
+ return 0;
+ }
+
+ consumer->started = tsk_false;
ret = AudioQueueStop(consumer->queue, false);
-
- return ret;
+
+ return ret;
}
//
@@ -203,64 +204,62 @@ int tdav_consumer_audioqueue_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_audioqueue_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_audioqueue_t *consumer = self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- }
- return self;
+ tdav_consumer_audioqueue_t *consumer = self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_audioqueue_dtor(tsk_object_t * self)
-{
- tdav_consumer_audioqueue_t *consumer = self;
- if(consumer){
- // Stop the consumer if not done
- if(consumer->started){
- tdav_consumer_audioqueue_stop(self);
- }
-
- // Free all buffers and dispose the queue
+{
+ tdav_consumer_audioqueue_t *consumer = self;
+ if(consumer) {
+ // Stop the consumer if not done
+ if(consumer->started) {
+ tdav_consumer_audioqueue_stop(self);
+ }
+
+ // Free all buffers and dispose the queue
if (consumer->queue) {
- tsk_size_t i;
-
- for(i=0; i<CoreAudioPlayBuffers; i++){
- AudioQueueFreeBuffer(consumer->queue, consumer->buffers[i]);
- }
-
+ tsk_size_t i;
+
+ for(i=0; i<CoreAudioPlayBuffers; i++) {
+ AudioQueueFreeBuffer(consumer->queue, consumer->buffers[i]);
+ }
+
AudioQueueDispose(consumer->queue, true);
}
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
- }
-
- return self;
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_audioqueue_def_s =
-{
- sizeof(tdav_consumer_audioqueue_t),
- tdav_consumer_audioqueue_ctor,
- tdav_consumer_audioqueue_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_audioqueue_def_s = {
+ sizeof(tdav_consumer_audioqueue_t),
+ tdav_consumer_audioqueue_ctor,
+ tdav_consumer_audioqueue_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_audioqueue_plugin_def_s =
-{
- &tdav_consumer_audioqueue_def_s,
-
- tmedia_audio,
- "Apple CoreAudio consumer(AudioQueue)",
-
- tdav_consumer_audioqueue_set,
- tdav_consumer_audioqueue_prepare,
- tdav_consumer_audioqueue_start,
- tdav_consumer_audioqueue_consume,
- tdav_consumer_audioqueue_pause,
- tdav_consumer_audioqueue_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_audioqueue_plugin_def_s = {
+ &tdav_consumer_audioqueue_def_s,
+
+ tmedia_audio,
+ "Apple CoreAudio consumer(AudioQueue)",
+
+ tdav_consumer_audioqueue_set,
+ tdav_consumer_audioqueue_prepare,
+ tdav_consumer_audioqueue_start,
+ tdav_consumer_audioqueue_consume,
+ tdav_consumer_audioqueue_pause,
+ tdav_consumer_audioqueue_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_audioqueue_plugin_def_t = &tdav_consumer_audioqueue_plugin_def_s;
diff --git a/tinyDAV/src/audio/coreaudio/tdav_consumer_audiounit.c b/tinyDAV/src/audio/coreaudio/tdav_consumer_audiounit.c
index 947d782..12ed8db 100755
--- a/tinyDAV/src/audio/coreaudio/tdav_consumer_audiounit.c
+++ b/tinyDAV/src/audio/coreaudio/tdav_consumer_audiounit.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -38,339 +38,340 @@
static tsk_size_t tdav_consumer_audiounit_get(tdav_consumer_audiounit_t* self, void* data, tsk_size_t size);
-static OSStatus __handle_output_buffer(void *inRefCon,
- AudioUnitRenderActionFlags *ioActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- UInt32 inNumberFrames,
- AudioBufferList *ioData) {
- OSStatus status = noErr;
- // tsk_size_t out_size;
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t* )inRefCon;
-
- if(!consumer->started || consumer->paused){
- goto done;
- }
-
- if(!ioData){
- TSK_DEBUG_ERROR("Invalid argument");
- status = kNoDataError;
- goto done;
- }
- // read from jitter buffer and fill ioData buffers
- tsk_mutex_lock(consumer->ring.mutex);
- for(int i=0; i<ioData->mNumberBuffers; i++){
- /* int ret = */ tdav_consumer_audiounit_get(consumer, ioData->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize);
- }
- tsk_mutex_unlock(consumer->ring.mutex);
-
-done:
+static OSStatus __handle_output_buffer(void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData)
+{
+ OSStatus status = noErr;
+ // tsk_size_t out_size;
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t* )inRefCon;
+
+ if(!consumer->started || consumer->paused) {
+ goto done;
+ }
+
+ if(!ioData) {
+ TSK_DEBUG_ERROR("Invalid argument");
+ status = kNoDataError;
+ goto done;
+ }
+ // read from jitter buffer and fill ioData buffers
+ tsk_mutex_lock(consumer->ring.mutex);
+ for(int i=0; i<ioData->mNumberBuffers; i++) {
+ /* int ret = */ tdav_consumer_audiounit_get(consumer, ioData->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize);
+ }
+ tsk_mutex_unlock(consumer->ring.mutex);
+
+done:
return status;
}
static tsk_size_t tdav_consumer_audiounit_get(tdav_consumer_audiounit_t* self, void* data, tsk_size_t size)
{
- tsk_ssize_t retSize = 0;
-
+ tsk_ssize_t retSize = 0;
+
#if DISABLE_JITTER_BUFFER
- retSize = speex_buffer_read(self->ring.buffer, data, size);
- if(retSize < size){
- memset(((uint8_t*)data)+retSize, 0, (size - retSize));
- }
+ retSize = speex_buffer_read(self->ring.buffer, data, size);
+ if(retSize < size) {
+ memset(((uint8_t*)data)+retSize, 0, (size - retSize));
+ }
#else
- self->ring.leftBytes += size;
- while (self->ring.leftBytes >= self->ring.chunck.size) {
- self->ring.leftBytes -= self->ring.chunck.size;
- retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->ring.chunck.buffer, self->ring.chunck.size);
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
- speex_buffer_write(self->ring.buffer, self->ring.chunck.buffer, retSize);
- }
- // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
- // many times can corrupt the buffer. At least on OS X 1.5
- if(speex_buffer_get_available(self->ring.buffer) >= size){
- retSize = (tsk_ssize_t)speex_buffer_read(self->ring.buffer, data, (int)size);
- }
- else{
- memset(data, 0, size);
- }
+ self->ring.leftBytes += size;
+ while (self->ring.leftBytes >= self->ring.chunck.size) {
+ self->ring.leftBytes -= self->ring.chunck.size;
+ retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(self), self->ring.chunck.buffer, self->ring.chunck.size);
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(self));
+ speex_buffer_write(self->ring.buffer, self->ring.chunck.buffer, retSize);
+ }
+ // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
+ // many times can corrupt the buffer. At least on OS X 1.5
+ if(speex_buffer_get_available(self->ring.buffer) >= size) {
+ retSize = (tsk_ssize_t)speex_buffer_read(self->ring.buffer, data, (int)size);
+ }
+ else {
+ memset(data, 0, size);
+ }
#endif
- return retSize;
+ return retSize;
}
/* ============ Media Consumer Interface ================= */
int tdav_consumer_audiounit_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
- if (param->plugin_type == tmedia_ppt_consumer) {
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "interrupt")) {
- int32_t interrupt = *((uint8_t*)param->value) ? 1 : 0;
+ if (param->plugin_type == tmedia_ppt_consumer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "interrupt")) {
+ int32_t interrupt = *((uint8_t*)param->value) ? 1 : 0;
return tdav_audiounit_handle_interrupt(consumer->audioUnitHandle, interrupt);
}
- }
- }
- return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ }
+ }
+ return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
static int tdav_consumer_audiounit_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- static UInt32 flagOne = 1;
- AudioStreamBasicDescription audioFormat;
+ static UInt32 flagOne = 1;
+ AudioStreamBasicDescription audioFormat;
#define kOutputBus 0
-
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
- OSStatus status = noErr;
-
- if(!consumer || !codec || !codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!consumer->audioUnitHandle){
- if(!(consumer->audioUnitHandle = tdav_audiounit_handle_create(TMEDIA_CONSUMER(consumer)->session_id))){
- TSK_DEBUG_ERROR("Failed to get audio unit instance for session with id=%lld", TMEDIA_CONSUMER(consumer)->session_id);
- return -3;
- }
- }
-
- // enable
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
- kAudioOutputUnitProperty_EnableIO,
- kAudioUnitScope_Output,
- kOutputBus,
- &flagOne,
- sizeof(flagOne));
- if(status){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%d", (int32_t)status);
- return -4;
- }
- else {
-
+
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
+ OSStatus status = noErr;
+
+ if(!consumer || !codec || !codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!consumer->audioUnitHandle) {
+ if(!(consumer->audioUnitHandle = tdav_audiounit_handle_create(TMEDIA_CONSUMER(consumer)->session_id))) {
+ TSK_DEBUG_ERROR("Failed to get audio unit instance for session with id=%lld", TMEDIA_CONSUMER(consumer)->session_id);
+ return -3;
+ }
+ }
+
+ // enable
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
+ kAudioOutputUnitProperty_EnableIO,
+ kAudioUnitScope_Output,
+ kOutputBus,
+ &flagOne,
+ sizeof(flagOne));
+ if(status) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%d", (int32_t)status);
+ return -4;
+ }
+ else {
+
#if !TARGET_OS_IPHONE // strange: TARGET_OS_MAC is equal to '1' on Smulator
- UInt32 param;
-
- // disable input
- param = 0;
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle), kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &param, sizeof(UInt32));
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
- return -4;
- }
-
- // set default audio device
- param = sizeof(AudioDeviceID);
- AudioDeviceID outputDeviceID;
- status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &param, &outputDeviceID);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice) failed with status=%ld", (signed long)status);
- return -4;
- }
-
- // set the current device to the default input unit
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
- kAudioOutputUnitProperty_CurrentDevice,
- kAudioUnitScope_Global,
- 0,
- &outputDeviceID,
- sizeof(AudioDeviceID));
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_CurrentDevice) failed with status=%ld", (signed long)status);
- return -4;
- }
-
+ UInt32 param;
+
+ // disable input
+ param = 0;
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle), kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &param, sizeof(UInt32));
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+
+ // set default audio device
+ param = sizeof(AudioDeviceID);
+ AudioDeviceID outputDeviceID;
+ status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &param, &outputDeviceID);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+
+ // set the current device to the default input unit
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
+ kAudioOutputUnitProperty_CurrentDevice,
+ kAudioUnitScope_Global,
+ 0,
+ &outputDeviceID,
+ sizeof(AudioDeviceID));
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_CurrentDevice) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+
#endif
- TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
+ TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
TSK_DEBUG_INFO("AudioUnit consumer: in.channels=%d, out.channles=%d, in.rate=%d, out.rate=%d, ptime=%d",
TMEDIA_CONSUMER(consumer)->audio.in.channels,
TMEDIA_CONSUMER(consumer)->audio.out.channels,
TMEDIA_CONSUMER(consumer)->audio.in.rate,
TMEDIA_CONSUMER(consumer)->audio.out.rate,
TMEDIA_CONSUMER(consumer)->audio.ptime);
-
- audioFormat.mSampleRate = TMEDIA_CONSUMER(consumer)->audio.out.rate ? TMEDIA_CONSUMER(consumer)->audio.out.rate : TMEDIA_CONSUMER(consumer)->audio.in.rate;
- audioFormat.mFormatID = kAudioFormatLinearPCM;
- audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
- audioFormat.mChannelsPerFrame = TMEDIA_CONSUMER(consumer)->audio.in.channels;
- audioFormat.mFramesPerPacket = 1;
- audioFormat.mBitsPerChannel = TMEDIA_CONSUMER(consumer)->audio.bits_per_sample;
- audioFormat.mBytesPerPacket = audioFormat.mBitsPerChannel / 8 * audioFormat.mChannelsPerFrame;
- audioFormat.mBytesPerFrame = audioFormat.mBytesPerPacket;
- audioFormat.mReserved = 0;
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- kOutputBus,
- &audioFormat,
- sizeof(audioFormat));
-
- if(status){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed with status=%ld", (signed long)status);
- return -5;
- }
- else {
- // configure
- if(tdav_audiounit_handle_configure(consumer->audioUnitHandle, tsk_true, TMEDIA_CONSUMER(consumer)->audio.ptime, &audioFormat)){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_set_rate(%d) failed", TMEDIA_CONSUMER(consumer)->audio.out.rate);
- return -4;
- }
-
- // set callback function
- AURenderCallbackStruct callback;
- callback.inputProc = __handle_output_buffer;
- callback.inputProcRefCon = consumer;
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
- kAudioUnitProperty_SetRenderCallback,
- kAudioUnitScope_Input,
- kOutputBus,
- &callback,
- sizeof(callback));
- if(status){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
- return -6;
- }
- }
- }
-
- // allocate the chunck buffer and create the ring
- consumer->ring.chunck.size = (TMEDIA_CONSUMER(consumer)->audio.ptime * audioFormat.mSampleRate * audioFormat.mBytesPerFrame) / 1000;
- consumer->ring.size = kRingPacketCount * consumer->ring.chunck.size;
- if(!(consumer->ring.chunck.buffer = tsk_realloc(consumer->ring.chunck.buffer, consumer->ring.chunck.size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return -7;
- }
- if(!consumer->ring.buffer){
- consumer->ring.buffer = speex_buffer_init((int)consumer->ring.size);
- }
- else {
- int ret;
- if((ret = (int)speex_buffer_resize(consumer->ring.buffer, (int)consumer->ring.size)) < 0){
- TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", (int)consumer->ring.size, ret);
- return ret;
- }
- }
- if(!consumer->ring.buffer){
- TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", (int)consumer->ring.size);
- return -8;
- }
- if(!consumer->ring.mutex && !(consumer->ring.mutex = tsk_mutex_create_2(tsk_false))){
- TSK_DEBUG_ERROR("Failed to create mutex");
- return -9;
- }
-
- // set maximum frames per slice as buffer size
- //UInt32 numFrames = (UInt32)consumer->ring.chunck.size;
- //status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
- // kAudioUnitProperty_MaximumFramesPerSlice,
- // kAudioUnitScope_Global,
- // 0,
- // &numFrames,
- // sizeof(numFrames));
- //if(status){
- // TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_MaximumFramesPerSlice, %u) failed with status=%d", (unsigned)numFrames, (int32_t)status);
- // return -6;
- //}
-
- TSK_DEBUG_INFO("AudioUnit consumer prepared");
+
+ audioFormat.mSampleRate = TMEDIA_CONSUMER(consumer)->audio.out.rate ? TMEDIA_CONSUMER(consumer)->audio.out.rate : TMEDIA_CONSUMER(consumer)->audio.in.rate;
+ audioFormat.mFormatID = kAudioFormatLinearPCM;
+ audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
+ audioFormat.mChannelsPerFrame = TMEDIA_CONSUMER(consumer)->audio.in.channels;
+ audioFormat.mFramesPerPacket = 1;
+ audioFormat.mBitsPerChannel = TMEDIA_CONSUMER(consumer)->audio.bits_per_sample;
+ audioFormat.mBytesPerPacket = audioFormat.mBitsPerChannel / 8 * audioFormat.mChannelsPerFrame;
+ audioFormat.mBytesPerFrame = audioFormat.mBytesPerPacket;
+ audioFormat.mReserved = 0;
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ kOutputBus,
+ &audioFormat,
+ sizeof(audioFormat));
+
+ if(status) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed with status=%ld", (signed long)status);
+ return -5;
+ }
+ else {
+ // configure
+ if(tdav_audiounit_handle_configure(consumer->audioUnitHandle, tsk_true, TMEDIA_CONSUMER(consumer)->audio.ptime, &audioFormat)) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_set_rate(%d) failed", TMEDIA_CONSUMER(consumer)->audio.out.rate);
+ return -4;
+ }
+
+ // set callback function
+ AURenderCallbackStruct callback;
+ callback.inputProc = __handle_output_buffer;
+ callback.inputProcRefCon = consumer;
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ kOutputBus,
+ &callback,
+ sizeof(callback));
+ if(status) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
+ return -6;
+ }
+ }
+ }
+
+ // allocate the chunck buffer and create the ring
+ consumer->ring.chunck.size = (TMEDIA_CONSUMER(consumer)->audio.ptime * audioFormat.mSampleRate * audioFormat.mBytesPerFrame) / 1000;
+ consumer->ring.size = kRingPacketCount * consumer->ring.chunck.size;
+ if(!(consumer->ring.chunck.buffer = tsk_realloc(consumer->ring.chunck.buffer, consumer->ring.chunck.size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return -7;
+ }
+ if(!consumer->ring.buffer) {
+ consumer->ring.buffer = speex_buffer_init((int)consumer->ring.size);
+ }
+ else {
+ int ret;
+ if((ret = (int)speex_buffer_resize(consumer->ring.buffer, (int)consumer->ring.size)) < 0) {
+ TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", (int)consumer->ring.size, ret);
+ return ret;
+ }
+ }
+ if(!consumer->ring.buffer) {
+ TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", (int)consumer->ring.size);
+ return -8;
+ }
+ if(!consumer->ring.mutex && !(consumer->ring.mutex = tsk_mutex_create_2(tsk_false))) {
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ return -9;
+ }
+
+ // set maximum frames per slice as buffer size
+ //UInt32 numFrames = (UInt32)consumer->ring.chunck.size;
+ //status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(consumer->audioUnitHandle),
+ // kAudioUnitProperty_MaximumFramesPerSlice,
+ // kAudioUnitScope_Global,
+ // 0,
+ // &numFrames,
+ // sizeof(numFrames));
+ //if(status){
+ // TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_MaximumFramesPerSlice, %u) failed with status=%d", (unsigned)numFrames, (int32_t)status);
+ // return -6;
+ //}
+
+ TSK_DEBUG_INFO("AudioUnit consumer prepared");
return tdav_audiounit_handle_signal_consumer_prepared(consumer->audioUnitHandle);
}
static int tdav_consumer_audiounit_start(tmedia_consumer_t* self)
{
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(consumer->paused){
- consumer->paused = tsk_false;
- }
- if(consumer->started){
- TSK_DEBUG_WARN("Already started");
- return 0;
- }
- else {
- int ret = tdav_audiounit_handle_start(consumer->audioUnitHandle);
- if(ret){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_start failed with error code=%d", ret);
- return ret;
- }
- }
- consumer->started = tsk_true;
- TSK_DEBUG_INFO("AudioUnit consumer started");
- return 0;
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(consumer->paused) {
+ consumer->paused = tsk_false;
+ }
+ if(consumer->started) {
+ TSK_DEBUG_WARN("Already started");
+ return 0;
+ }
+ else {
+ int ret = tdav_audiounit_handle_start(consumer->audioUnitHandle);
+ if(ret) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_start failed with error code=%d", ret);
+ return ret;
+ }
+ }
+ consumer->started = tsk_true;
+ TSK_DEBUG_INFO("AudioUnit consumer started");
+ return 0;
}
static int tdav_consumer_audiounit_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
-{
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
- if(!consumer || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+{
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
+ if(!consumer || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if DISABLE_JITTER_BUFFER
- {
- if(consumer->ring.buffer){
- tsk_mutex_lock(consumer->ring.mutex);
- speex_buffer_write(consumer->ring.buffer, (void*)buffer, size);
- tsk_mutex_unlock(consumer->ring.mutex);
- return 0;
- }
- return -2;
- }
+ {
+ if(consumer->ring.buffer) {
+ tsk_mutex_lock(consumer->ring.mutex);
+ speex_buffer_write(consumer->ring.buffer, (void*)buffer, size);
+ tsk_mutex_unlock(consumer->ring.mutex);
+ return 0;
+ }
+ return -2;
+ }
#else
- {
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
- }
+ {
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
+ }
#endif
}
static int tdav_consumer_audiounit_pause(tmedia_consumer_t* self)
{
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- consumer->paused = tsk_true;
- TSK_DEBUG_INFO("AudioUnit consumer paused");
- return 0;
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ consumer->paused = tsk_true;
+ TSK_DEBUG_INFO("AudioUnit consumer paused");
+ return 0;
}
static int tdav_consumer_audiounit_stop(tmedia_consumer_t* self)
{
- tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!consumer->started){
- TSK_DEBUG_INFO("Not started");
- return 0;
- }
- else {
- int ret = tdav_audiounit_handle_stop(consumer->audioUnitHandle);
- if(ret){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
- return ret;
- }
- }
+ tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!consumer->started) {
+ TSK_DEBUG_INFO("Not started");
+ return 0;
+ }
+ else {
+ int ret = tdav_audiounit_handle_stop(consumer->audioUnitHandle);
+ if(ret) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
+ return ret;
+ }
+ }
#if TARGET_OS_IPHONE
- //https://devforums.apple.com/thread/118595
- if(consumer->audioUnitHandle){
- tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
- }
+ //https://devforums.apple.com/thread/118595
+ if(consumer->audioUnitHandle) {
+ tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
+ }
#endif
-
- consumer->started = tsk_false;
- TSK_DEBUG_INFO("AudioUnit consumer stoppped");
- return 0;
-
+
+ consumer->started = tsk_false;
+ TSK_DEBUG_INFO("AudioUnit consumer stoppped");
+ return 0;
+
}
//
@@ -379,67 +380,65 @@ static int tdav_consumer_audiounit_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_audiounit_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_audiounit_t *consumer = self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- /* init self */
- }
- return self;
+ tdav_consumer_audiounit_t *consumer = self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_audiounit_dtor(tsk_object_t * self)
-{
- tdav_consumer_audiounit_t *consumer = self;
- if(consumer){
- /* deinit self */
- // Stop the consumer if not done
- if(consumer->started){
- tdav_consumer_audiounit_stop(self);
- }
- // destroy handle
- if(consumer->audioUnitHandle){
- tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
- }
- TSK_FREE(consumer->ring.chunck.buffer);
- if(consumer->ring.buffer){
- speex_buffer_destroy(consumer->ring.buffer);
- }
- if(consumer->ring.mutex){
- tsk_mutex_destroy(&consumer->ring.mutex);
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
+{
+ tdav_consumer_audiounit_t *consumer = self;
+ if(consumer) {
+ /* deinit self */
+ // Stop the consumer if not done
+ if(consumer->started) {
+ tdav_consumer_audiounit_stop(self);
+ }
+ // destroy handle
+ if(consumer->audioUnitHandle) {
+ tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
+ }
+ TSK_FREE(consumer->ring.chunck.buffer);
+ if(consumer->ring.buffer) {
+ speex_buffer_destroy(consumer->ring.buffer);
+ }
+ if(consumer->ring.mutex) {
+ tsk_mutex_destroy(&consumer->ring.mutex);
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
TSK_DEBUG_INFO("*** AudioUnit Consumer destroyed ***");
- }
-
- return self;
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_audiounit_def_s =
-{
- sizeof(tdav_consumer_audiounit_t),
- tdav_consumer_audiounit_ctor,
- tdav_consumer_audiounit_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_audiounit_def_s = {
+ sizeof(tdav_consumer_audiounit_t),
+ tdav_consumer_audiounit_ctor,
+ tdav_consumer_audiounit_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_audiounit_plugin_def_s =
-{
- &tdav_consumer_audiounit_def_s,
-
- tmedia_audio,
- "Apple CoreAudio consumer(AudioUnit)",
-
- tdav_consumer_audiounit_set,
- tdav_consumer_audiounit_prepare,
- tdav_consumer_audiounit_start,
- tdav_consumer_audiounit_consume,
- tdav_consumer_audiounit_pause,
- tdav_consumer_audiounit_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_audiounit_plugin_def_s = {
+ &tdav_consumer_audiounit_def_s,
+
+ tmedia_audio,
+ "Apple CoreAudio consumer(AudioUnit)",
+
+ tdav_consumer_audiounit_set,
+ tdav_consumer_audiounit_prepare,
+ tdav_consumer_audiounit_start,
+ tdav_consumer_audiounit_consume,
+ tdav_consumer_audiounit_pause,
+ tdav_consumer_audiounit_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_audiounit_plugin_def_t = &tdav_consumer_audiounit_plugin_def_s;
diff --git a/tinyDAV/src/audio/coreaudio/tdav_producer_audioqueue.c b/tinyDAV/src/audio/coreaudio/tdav_producer_audioqueue.c
index d96fd67..b99b202 100755
--- a/tinyDAV/src/audio/coreaudio/tdav_producer_audioqueue.c
+++ b/tinyDAV/src/audio/coreaudio/tdav_producer_audioqueue.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tdav_producer_audioqueue.c
* @brief Audio Producer for MacOSX and iOS platforms using AudioQueue.
*
- * @authors
+ * @authors
* - Laurent Etiemble <laurent.etiemble(at)gmail.com>
* - Mamadou Diop <diopmamadou(at)doubango(dot)org>
*
@@ -41,18 +41,19 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-static void __handle_input_buffer (void *userdata, AudioQueueRef queue, AudioQueueBufferRef buffer, const AudioTimeStamp *start_time, UInt32 number_packet_descriptions, const AudioStreamPacketDescription *packet_descriptions ) {
- tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)userdata;
-
+static void __handle_input_buffer (void *userdata, AudioQueueRef queue, AudioQueueBufferRef buffer, const AudioTimeStamp *start_time, UInt32 number_packet_descriptions, const AudioStreamPacketDescription *packet_descriptions )
+{
+ tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)userdata;
+
if (!producer->started) {
return;
}
-
- // Alert the session that there is new data to send
- if(TMEDIA_PRODUCER(producer)->enc_cb.callback) {
- TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer->mAudioData, buffer->mAudioDataByteSize);
- }
-
+
+ // Alert the session that there is new data to send
+ if(TMEDIA_PRODUCER(producer)->enc_cb.callback) {
+ TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, buffer->mAudioData, buffer->mAudioDataByteSize);
+ }
+
// Re-enqueue the buffer
AudioQueueEnqueueBuffer(producer->queue, buffer, 0, NULL);
}
@@ -63,24 +64,24 @@ static void __handle_input_buffer (void *userdata, AudioQueueRef queue, AudioQue
static int tdav_producer_audioqueue_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
OSStatus ret;
- tsk_size_t i;
- tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
-
- if(!producer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- /* codec should have ptime */
-
-
- // Set audio category
+ tsk_size_t i;
+ tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
+
+ if(!producer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ /* codec should have ptime */
+
+
+ // Set audio category
#if TARGET_OS_IPHONE
- UInt32 category = kAudioSessionCategory_PlayAndRecord;
- AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
+ UInt32 category = kAudioSessionCategory_PlayAndRecord;
+ AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
#endif
// Create the audio stream description
AudioStreamBasicDescription *description = &(producer->description);
@@ -93,95 +94,95 @@ static int tdav_producer_audioqueue_prepare(tmedia_producer_t* self, const tmedi
description->mBytesPerPacket = description->mBitsPerChannel / 8 * description->mChannelsPerFrame;
description->mBytesPerFrame = description->mBytesPerPacket;
description->mReserved = 0;
-
+
int packetperbuffer = 1000 / TMEDIA_PRODUCER(producer)->audio.ptime;
producer->buffer_size = description->mSampleRate * description->mBytesPerFrame / packetperbuffer;
-
+
// Create the record audio queue
ret = AudioQueueNewInput(&(producer->description),
- __handle_input_buffer,
- producer,
- NULL,
- kCFRunLoopCommonModes,
- 0,
- &(producer->queue));
-
+ __handle_input_buffer,
+ producer,
+ NULL,
+ kCFRunLoopCommonModes,
+ 0,
+ &(producer->queue));
+
for(i = 0; i < CoreAudioRecordBuffers; i++) {
// Create the buffer for the queue
ret = AudioQueueAllocateBuffer(producer->queue, producer->buffer_size, &(producer->buffers[i]));
if (ret) {
break;
}
-
+
// Clear the data
memset(producer->buffers[i]->mAudioData, 0, producer->buffer_size);
producer->buffers[i]->mAudioDataByteSize = producer->buffer_size;
-
+
// Enqueue the buffer
ret = AudioQueueEnqueueBuffer(producer->queue, producer->buffers[i], 0, NULL);
if (ret) {
break;
}
}
-
- return 0;
+
+ return 0;
}
static int tdav_producer_audioqueue_start(tmedia_producer_t* self)
{
OSStatus ret;
- tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(producer->started){
- TSK_DEBUG_WARN("Producer already started");
- return 0;
- }
-
- producer->started = tsk_true;
+ tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(producer->started) {
+ TSK_DEBUG_WARN("Producer already started");
+ return 0;
+ }
+
+ producer->started = tsk_true;
ret = AudioQueueStart(producer->queue, NULL);
-
- return ret;
+
+ return ret;
}
static int tdav_producer_audioqueue_pause(tmedia_producer_t* self)
{
OSStatus ret;
- tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
+ tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
ret = AudioQueuePause(producer->queue);
-
- return ret;
+
+ return ret;
}
static int tdav_producer_audioqueue_stop(tmedia_producer_t* self)
{
OSStatus ret;
- tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!producer->started){
- TSK_DEBUG_WARN("Producer not started");
- return 0;
- }
-
- producer->started = tsk_false;
+ tdav_producer_audioqueue_t* producer = (tdav_producer_audioqueue_t*)self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!producer->started) {
+ TSK_DEBUG_WARN("Producer not started");
+ return 0;
+ }
+
+ producer->started = tsk_false;
ret = AudioQueueStop(producer->queue, false);
-
- return ret;
+
+ return ret;
}
@@ -191,62 +192,60 @@ static int tdav_producer_audioqueue_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_audioqueue_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_audioqueue_t *producer = self;
- if(producer){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
- // TODO
- }
- return self;
+ tdav_producer_audioqueue_t *producer = self;
+ if(producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+ // TODO
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_audioqueue_dtor(tsk_object_t * self)
-{
- tdav_producer_audioqueue_t *producer = self;
- if(producer){
- // Stop the producer if not done
- if(producer->started){
- tdav_producer_audioqueue_stop(self);
- }
-
- // Free all buffers and dispose the queue
+{
+ tdav_producer_audioqueue_t *producer = self;
+ if(producer) {
+ // Stop the producer if not done
+ if(producer->started) {
+ tdav_producer_audioqueue_stop(self);
+ }
+
+ // Free all buffers and dispose the queue
if (producer->queue) {
- tsk_size_t i;
-
- for(i=0; i<CoreAudioRecordBuffers; i++){
- AudioQueueFreeBuffer(producer->queue, producer->buffers[i]);
- }
+ tsk_size_t i;
+
+ for(i=0; i<CoreAudioRecordBuffers; i++) {
+ AudioQueueFreeBuffer(producer->queue, producer->buffers[i]);
+ }
AudioQueueDispose(producer->queue, true);
}
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
- }
-
- return self;
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_audioqueue_def_s =
-{
- sizeof(tdav_producer_audioqueue_t),
- tdav_producer_audioqueue_ctor,
- tdav_producer_audioqueue_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_audioqueue_def_s = {
+ sizeof(tdav_producer_audioqueue_t),
+ tdav_producer_audioqueue_ctor,
+ tdav_producer_audioqueue_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_audioqueue_plugin_def_s =
-{
- &tdav_producer_audioqueue_def_s,
-
- tmedia_audio,
- "Apple CoreAudio producer (AudioQueue)",
-
- tdav_producer_audioqueue_set,
- tdav_producer_audioqueue_prepare,
- tdav_producer_audioqueue_start,
- tdav_producer_audioqueue_pause,
- tdav_producer_audioqueue_stop
+static const tmedia_producer_plugin_def_t tdav_producer_audioqueue_plugin_def_s = {
+ &tdav_producer_audioqueue_def_s,
+
+ tmedia_audio,
+ "Apple CoreAudio producer (AudioQueue)",
+
+ tdav_producer_audioqueue_set,
+ tdav_producer_audioqueue_prepare,
+ tdav_producer_audioqueue_start,
+ tdav_producer_audioqueue_pause,
+ tdav_producer_audioqueue_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_audioqueue_plugin_def_t = &tdav_producer_audioqueue_plugin_def_s;
diff --git a/tinyDAV/src/audio/coreaudio/tdav_producer_audiounit.c b/tinyDAV/src/audio/coreaudio/tdav_producer_audiounit.c
index a88261e..7f8af7e 100755
--- a/tinyDAV/src/audio/coreaudio/tdav_producer_audiounit.c
+++ b/tinyDAV/src/audio/coreaudio/tdav_producer_audiounit.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -35,322 +35,323 @@
#define kRingPacketCount 10
-static OSStatus __handle_input_buffer(void *inRefCon,
- AudioUnitRenderActionFlags *ioActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- UInt32 inNumberFrames,
- AudioBufferList *ioData) {
- OSStatus status = noErr;
- tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)inRefCon;
-
- // holder
- AudioBuffer buffer;
- buffer.mData = tsk_null;
- buffer.mDataByteSize = 0;
- buffer.mNumberChannels = TMEDIA_PRODUCER(producer)->audio.channels;
-
- // list of holders
- AudioBufferList buffers;
- buffers.mNumberBuffers = 1;
- buffers.mBuffers[0] = buffer;
-
- // render to get frames from the system
- status = AudioUnitRender(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- ioActionFlags,
- inTimeStamp,
- inBusNumber,
- inNumberFrames,
- &buffers);
- if(status == 0){
+static OSStatus __handle_input_buffer(void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData)
+{
+ OSStatus status = noErr;
+ tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)inRefCon;
+
+ // holder
+ AudioBuffer buffer;
+ buffer.mData = tsk_null;
+ buffer.mDataByteSize = 0;
+ buffer.mNumberChannels = TMEDIA_PRODUCER(producer)->audio.channels;
+
+ // list of holders
+ AudioBufferList buffers;
+ buffers.mNumberBuffers = 1;
+ buffers.mBuffers[0] = buffer;
+
+ // render to get frames from the system
+ status = AudioUnitRender(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ ioActionFlags,
+ inTimeStamp,
+ inBusNumber,
+ inNumberFrames,
+ &buffers);
+ if(status == 0) {
// must not be done on async thread: doing it gives bad audio quality when audio+video call is done with CPU consuming codec (e.g. speex or g729)
- speex_buffer_write(producer->ring.buffer, buffers.mBuffers[0].mData, buffers.mBuffers[0].mDataByteSize);
+ speex_buffer_write(producer->ring.buffer, buffers.mBuffers[0].mData, buffers.mBuffers[0].mDataByteSize);
int avail = speex_buffer_get_available(producer->ring.buffer);
while (producer->started && avail >= producer->ring.chunck.size) {
avail -= speex_buffer_read(producer->ring.buffer, (void*)producer->ring.chunck.buffer, (int)producer->ring.chunck.size);
TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data,
- producer->ring.chunck.buffer, producer->ring.chunck.size);
+ producer->ring.chunck.buffer, producer->ring.chunck.size);
}
- }
-
+ }
+
return status;
}
/* ============ Media Producer Interface ================= */
int tdav_producer_audiounit_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
+{
tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
- if(param->plugin_type == tmedia_ppt_producer){
- if(param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "mute")) {
- producer->muted = TSK_TO_INT32((uint8_t*)param->value);
- return tdav_audiounit_handle_mute(((tdav_producer_audiounit_t*)self)->audioUnitHandle, producer->muted);
- }
+ if(param->plugin_type == tmedia_ppt_producer) {
+ if(param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "mute")) {
+ producer->muted = TSK_TO_INT32((uint8_t*)param->value);
+ return tdav_audiounit_handle_mute(((tdav_producer_audiounit_t*)self)->audioUnitHandle, producer->muted);
+ }
else if (tsk_striequals(param->key, "interrupt")) {
- int32_t interrupt = *((uint8_t*)param->value) ? 1 : 0;
+ int32_t interrupt = *((uint8_t*)param->value) ? 1 : 0;
return tdav_audiounit_handle_interrupt(producer->audioUnitHandle, interrupt);
}
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_audiounit_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- static UInt32 flagOne = 1;
- UInt32 param;
- // static UInt32 flagZero = 0;
+ static UInt32 flagOne = 1;
+ UInt32 param;
+ // static UInt32 flagZero = 0;
#define kInputBus 1
-
- tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
- OSStatus status = noErr;
- AudioStreamBasicDescription audioFormat;
- AudioStreamBasicDescription deviceFormat;
-
- if(!producer || !codec || !codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!producer->audioUnitHandle){
- if(!(producer->audioUnitHandle = tdav_audiounit_handle_create(TMEDIA_PRODUCER(producer)->session_id))){
- TSK_DEBUG_ERROR("Failed to get audio unit instance for session with id=%lld", TMEDIA_PRODUCER(producer)->session_id);
- return -3;
- }
- }
-
- // enable
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioOutputUnitProperty_EnableIO,
- kAudioUnitScope_Input,
- kInputBus,
- &flagOne,
- sizeof(flagOne));
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
- return -4;
- }
- else {
+
+ tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
+ OSStatus status = noErr;
+ AudioStreamBasicDescription audioFormat;
+ AudioStreamBasicDescription deviceFormat;
+
+ if(!producer || !codec || !codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!producer->audioUnitHandle) {
+ if(!(producer->audioUnitHandle = tdav_audiounit_handle_create(TMEDIA_PRODUCER(producer)->session_id))) {
+ TSK_DEBUG_ERROR("Failed to get audio unit instance for session with id=%lld", TMEDIA_PRODUCER(producer)->session_id);
+ return -3;
+ }
+ }
+
+ // enable
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioOutputUnitProperty_EnableIO,
+ kAudioUnitScope_Input,
+ kInputBus,
+ &flagOne,
+ sizeof(flagOne));
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+ else {
#if !TARGET_OS_IPHONE // strange: TARGET_OS_MAC is equal to '1' on Smulator
- // disable output
- param = 0;
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioOutputUnitProperty_EnableIO,
- kAudioUnitScope_Output,
- 0,
- &param,
- sizeof(UInt32));
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
- return -4;
- }
-
- // set default audio device
- param = sizeof(AudioDeviceID);
- AudioDeviceID inputDeviceID;
- status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &param, &inputDeviceID);
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice) failed with status=%ld", (signed long)status);
- return -4;
- }
-
- // set the current device to the default input unit
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioOutputUnitProperty_CurrentDevice,
- kAudioUnitScope_Output,
- 0,
- &inputDeviceID,
- sizeof(AudioDeviceID));
- if(status != noErr){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_CurrentDevice) failed with status=%ld", (signed long)status);
- return -4;
- }
+ // disable output
+ param = 0;
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioOutputUnitProperty_EnableIO,
+ kAudioUnitScope_Output,
+ 0,
+ &param,
+ sizeof(UInt32));
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_EnableIO) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+
+ // set default audio device
+ param = sizeof(AudioDeviceID);
+ AudioDeviceID inputDeviceID;
+ status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &param, &inputDeviceID);
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice) failed with status=%ld", (signed long)status);
+ return -4;
+ }
+
+ // set the current device to the default input unit
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioOutputUnitProperty_CurrentDevice,
+ kAudioUnitScope_Output,
+ 0,
+ &inputDeviceID,
+ sizeof(AudioDeviceID));
+ if(status != noErr) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_CurrentDevice) failed with status=%ld", (signed long)status);
+ return -4;
+ }
#endif /* TARGET_OS_MAC */
-
- /* codec should have ptime */
- TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+
+ /* codec should have ptime */
+ TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
TSK_DEBUG_INFO("AudioUnit producer: channels=%d, rate=%d, ptime=%d",
TMEDIA_PRODUCER(producer)->audio.channels,
TMEDIA_PRODUCER(producer)->audio.rate,
TMEDIA_PRODUCER(producer)->audio.ptime);
-
- // get device format
- param = sizeof(AudioStreamBasicDescription);
- status = AudioUnitGetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- kInputBus,
- &deviceFormat, &param);
- if(status == noErr && deviceFormat.mSampleRate){
+
+ // get device format
+ param = sizeof(AudioStreamBasicDescription);
+ status = AudioUnitGetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ kInputBus,
+ &deviceFormat, &param);
+ if(status == noErr && deviceFormat.mSampleRate) {
#if TARGET_OS_IPHONE
- // iOS support 8Khz, 16kHz and 32kHz => do not override the sampleRate
+ // iOS support 8Khz, 16kHz and 32kHz => do not override the sampleRate
#elif TARGET_OS_MAC
- // For example, iSight supports only 48kHz
- TMEDIA_PRODUCER(producer)->audio.rate = deviceFormat.mSampleRate;
+ // For example, iSight supports only 48kHz
+ TMEDIA_PRODUCER(producer)->audio.rate = deviceFormat.mSampleRate;
#endif
- }
-
- // set format
- audioFormat.mSampleRate = TMEDIA_PRODUCER(producer)->audio.rate;
- audioFormat.mFormatID = kAudioFormatLinearPCM;
- audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved;
- audioFormat.mChannelsPerFrame = TMEDIA_PRODUCER(producer)->audio.channels;
- audioFormat.mFramesPerPacket = 1;
- audioFormat.mBitsPerChannel = TMEDIA_PRODUCER(producer)->audio.bits_per_sample;
- audioFormat.mBytesPerPacket = audioFormat.mBitsPerChannel / 8 * audioFormat.mChannelsPerFrame;
- audioFormat.mBytesPerFrame = audioFormat.mBytesPerPacket;
- audioFormat.mReserved = 0;
- if(audioFormat.mFormatID == kAudioFormatLinearPCM && audioFormat.mChannelsPerFrame == 1){
- audioFormat.mFormatFlags &= ~kLinearPCMFormatFlagIsNonInterleaved;
- }
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Output,
- kInputBus,
- &audioFormat,
- sizeof(audioFormat));
- if(status){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed with status=%ld", (signed long)status);
- return -5;
- }
- else {
-
- // configure
- if(tdav_audiounit_handle_configure(producer->audioUnitHandle, tsk_false, TMEDIA_PRODUCER(producer)->audio.ptime, &audioFormat)){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_set_rate(%d) failed", TMEDIA_PRODUCER(producer)->audio.rate);
- return -4;
- }
-
- // set callback function
- AURenderCallbackStruct callback;
- callback.inputProc = __handle_input_buffer;
- callback.inputProcRefCon = producer;
- status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- kAudioOutputUnitProperty_SetInputCallback,
- kAudioUnitScope_Output,
- kInputBus,
- &callback,
- sizeof(callback));
- if(status){
- TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
- return -6;
- }
- else {
- // disbale buffer allocation as we will provide ours
- //status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
- // kAudioUnitProperty_ShouldAllocateBuffer,
- // kAudioUnitScope_Output,
- // kInputBus,
- // &flagZero,
- // sizeof(flagZero));
-
- producer->ring.chunck.size = (TMEDIA_PRODUCER(producer)->audio.ptime * audioFormat.mSampleRate * audioFormat.mBytesPerFrame) / 1000;
- // allocate our chunck buffer
- if(!(producer->ring.chunck.buffer = tsk_realloc(producer->ring.chunck.buffer, producer->ring.chunck.size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return -7;
- }
- // create ringbuffer
- producer->ring.size = kRingPacketCount * producer->ring.chunck.size;
- if(!producer->ring.buffer){
- producer->ring.buffer = speex_buffer_init((int)producer->ring.size);
- }
- else {
- int ret;
- if((ret = speex_buffer_resize(producer->ring.buffer, producer->ring.size)) < 0){
- TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", (int)producer->ring.size, ret);
- return ret;
- }
- }
- if(!producer->ring.buffer){
- TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", (int)producer->ring.size);
- return -9;
- }
- }
-
- }
- }
-
- TSK_DEBUG_INFO("AudioUnit producer prepared");
- return tdav_audiounit_handle_signal_producer_prepared(producer->audioUnitHandle);;
+ }
+
+ // set format
+ audioFormat.mSampleRate = TMEDIA_PRODUCER(producer)->audio.rate;
+ audioFormat.mFormatID = kAudioFormatLinearPCM;
+ audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved;
+ audioFormat.mChannelsPerFrame = TMEDIA_PRODUCER(producer)->audio.channels;
+ audioFormat.mFramesPerPacket = 1;
+ audioFormat.mBitsPerChannel = TMEDIA_PRODUCER(producer)->audio.bits_per_sample;
+ audioFormat.mBytesPerPacket = audioFormat.mBitsPerChannel / 8 * audioFormat.mChannelsPerFrame;
+ audioFormat.mBytesPerFrame = audioFormat.mBytesPerPacket;
+ audioFormat.mReserved = 0;
+ if(audioFormat.mFormatID == kAudioFormatLinearPCM && audioFormat.mChannelsPerFrame == 1) {
+ audioFormat.mFormatFlags &= ~kLinearPCMFormatFlagIsNonInterleaved;
+ }
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Output,
+ kInputBus,
+ &audioFormat,
+ sizeof(audioFormat));
+ if(status) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed with status=%ld", (signed long)status);
+ return -5;
+ }
+ else {
+
+ // configure
+ if(tdav_audiounit_handle_configure(producer->audioUnitHandle, tsk_false, TMEDIA_PRODUCER(producer)->audio.ptime, &audioFormat)) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_set_rate(%d) failed", TMEDIA_PRODUCER(producer)->audio.rate);
+ return -4;
+ }
+
+ // set callback function
+ AURenderCallbackStruct callback;
+ callback.inputProc = __handle_input_buffer;
+ callback.inputProcRefCon = producer;
+ status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ kAudioOutputUnitProperty_SetInputCallback,
+ kAudioUnitScope_Output,
+ kInputBus,
+ &callback,
+ sizeof(callback));
+ if(status) {
+ TSK_DEBUG_ERROR("AudioUnitSetProperty(kAudioOutputUnitProperty_SetInputCallback) failed with status=%ld", (signed long)status);
+ return -6;
+ }
+ else {
+ // disbale buffer allocation as we will provide ours
+ //status = AudioUnitSetProperty(tdav_audiounit_handle_get_instance(producer->audioUnitHandle),
+ // kAudioUnitProperty_ShouldAllocateBuffer,
+ // kAudioUnitScope_Output,
+ // kInputBus,
+ // &flagZero,
+ // sizeof(flagZero));
+
+ producer->ring.chunck.size = (TMEDIA_PRODUCER(producer)->audio.ptime * audioFormat.mSampleRate * audioFormat.mBytesPerFrame) / 1000;
+ // allocate our chunck buffer
+ if(!(producer->ring.chunck.buffer = tsk_realloc(producer->ring.chunck.buffer, producer->ring.chunck.size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return -7;
+ }
+ // create ringbuffer
+ producer->ring.size = kRingPacketCount * producer->ring.chunck.size;
+ if(!producer->ring.buffer) {
+ producer->ring.buffer = speex_buffer_init((int)producer->ring.size);
+ }
+ else {
+ int ret;
+ if((ret = speex_buffer_resize(producer->ring.buffer, producer->ring.size)) < 0) {
+ TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", (int)producer->ring.size, ret);
+ return ret;
+ }
+ }
+ if(!producer->ring.buffer) {
+ TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", (int)producer->ring.size);
+ return -9;
+ }
+ }
+
+ }
+ }
+
+ TSK_DEBUG_INFO("AudioUnit producer prepared");
+ return tdav_audiounit_handle_signal_producer_prepared(producer->audioUnitHandle);;
}
static int tdav_producer_audiounit_start(tmedia_producer_t* self)
{
- tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(producer->paused){
- producer->paused = tsk_false;
- return tsk_false;
- }
-
- int ret;
- if(producer->started){
- TSK_DEBUG_WARN("Already started");
- return 0;
- }
- else {
- ret = tdav_audiounit_handle_start(producer->audioUnitHandle);
- if(ret){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_start failed with error code=%d", ret);
- return ret;
- }
- }
- producer->started = tsk_true;
-
+ tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(producer->paused) {
+ producer->paused = tsk_false;
+ return tsk_false;
+ }
+
+ int ret;
+ if(producer->started) {
+ TSK_DEBUG_WARN("Already started");
+ return 0;
+ }
+ else {
+ ret = tdav_audiounit_handle_start(producer->audioUnitHandle);
+ if(ret) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_start failed with error code=%d", ret);
+ return ret;
+ }
+ }
+ producer->started = tsk_true;
+
// apply parameters (because could be lost when the producer is restarted -handle recreated-)
ret = tdav_audiounit_handle_mute(producer->audioUnitHandle, producer->muted);
- TSK_DEBUG_INFO("AudioUnit producer started");
- return 0;
+ TSK_DEBUG_INFO("AudioUnit producer started");
+ return 0;
}
static int tdav_producer_audiounit_pause(tmedia_producer_t* self)
{
tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- producer->paused = tsk_true;
- TSK_DEBUG_INFO("AudioUnit producer paused");
- return 0;
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ producer->paused = tsk_true;
+ TSK_DEBUG_INFO("AudioUnit producer paused");
+ return 0;
}
static int tdav_producer_audiounit_stop(tmedia_producer_t* self)
{
tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!producer->started){
- TSK_DEBUG_INFO("Not started");
- return 0;
- }
- else {
- int ret = tdav_audiounit_handle_stop(producer->audioUnitHandle);
- if(ret){
- TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
- // do not return even if failed => we MUST stop the thread!
- }
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!producer->started) {
+ TSK_DEBUG_INFO("Not started");
+ return 0;
+ }
+ else {
+ int ret = tdav_audiounit_handle_stop(producer->audioUnitHandle);
+ if(ret) {
+ TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
+ // do not return even if failed => we MUST stop the thread!
+ }
#if TARGET_OS_IPHONE
- //https://devforums.apple.com/thread/118595
- if(producer->audioUnitHandle){
- tdav_audiounit_handle_destroy(&producer->audioUnitHandle);
- }
+ //https://devforums.apple.com/thread/118595
+ if(producer->audioUnitHandle) {
+ tdav_audiounit_handle_destroy(&producer->audioUnitHandle);
+ }
#endif
- }
- producer->started = tsk_false;
- TSK_DEBUG_INFO("AudioUnit producer stoppped");
- return 0;
+ }
+ producer->started = tsk_false;
+ TSK_DEBUG_INFO("AudioUnit producer stoppped");
+ return 0;
}
@@ -360,61 +361,59 @@ static int tdav_producer_audiounit_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_audiounit_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_audiounit_t *producer = self;
- if(producer){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
- }
- return self;
+ tdav_producer_audiounit_t *producer = self;
+ if(producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_audiounit_dtor(tsk_object_t * self)
-{
- tdav_producer_audiounit_t *producer = self;
- if(producer){
- // Stop the producer if not done
- if(producer->started){
- tdav_producer_audiounit_stop(self);
- }
-
- // Free all buffers and dispose the queue
+{
+ tdav_producer_audiounit_t *producer = self;
+ if(producer) {
+ // Stop the producer if not done
+ if(producer->started) {
+ tdav_producer_audiounit_stop(self);
+ }
+
+ // Free all buffers and dispose the queue
if (producer->audioUnitHandle) {
- tdav_audiounit_handle_destroy(&producer->audioUnitHandle);
+ tdav_audiounit_handle_destroy(&producer->audioUnitHandle);
}
TSK_FREE(producer->ring.chunck.buffer);
- if(producer->ring.buffer){
- speex_buffer_destroy(producer->ring.buffer);
- }
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
-
+ if(producer->ring.buffer) {
+ speex_buffer_destroy(producer->ring.buffer);
+ }
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
+
TSK_DEBUG_INFO("*** AudioUnit Producer destroyed ***");
- }
-
- return self;
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_audiounit_def_s =
-{
- sizeof(tdav_producer_audiounit_t),
- tdav_producer_audiounit_ctor,
- tdav_producer_audiounit_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_audiounit_def_s = {
+ sizeof(tdav_producer_audiounit_t),
+ tdav_producer_audiounit_ctor,
+ tdav_producer_audiounit_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_audiounit_plugin_def_s =
-{
- &tdav_producer_audiounit_def_s,
-
- tmedia_audio,
- "Apple CoreAudio producer (AudioUnit)",
-
- tdav_producer_audiounit_set,
- tdav_producer_audiounit_prepare,
- tdav_producer_audiounit_start,
- tdav_producer_audiounit_pause,
- tdav_producer_audiounit_stop
+static const tmedia_producer_plugin_def_t tdav_producer_audiounit_plugin_def_s = {
+ &tdav_producer_audiounit_def_s,
+
+ tmedia_audio,
+ "Apple CoreAudio producer (AudioUnit)",
+
+ tdav_producer_audiounit_set,
+ tdav_producer_audiounit_prepare,
+ tdav_producer_audiounit_start,
+ tdav_producer_audiounit_pause,
+ tdav_producer_audiounit_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_audiounit_plugin_def_t = &tdav_producer_audiounit_plugin_def_s;
diff --git a/tinyDAV/src/audio/directsound/tdav_consumer_dsound.c b/tinyDAV/src/audio/directsound/tdav_consumer_dsound.c
index 82e125b..cdf87f5 100755
--- a/tinyDAV/src/audio/directsound/tdav_consumer_dsound.c
+++ b/tinyDAV/src/audio/directsound/tdav_consumer_dsound.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,117 +48,116 @@ extern void tdav_win32_print_error(const char* func, HRESULT hr);
# define TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT 20
#endif /* TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT */
-typedef struct tdav_consumer_dsound_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct tdav_consumer_dsound_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- tsk_bool_t started;
- tsk_size_t bytes_per_notif_size;
- uint8_t* bytes_per_notif_ptr;
- tsk_thread_handle_t* tid[1];
+ tsk_bool_t started;
+ tsk_size_t bytes_per_notif_size;
+ uint8_t* bytes_per_notif_ptr;
+ tsk_thread_handle_t* tid[1];
- LPDIRECTSOUND device;
- LPDIRECTSOUNDBUFFER primaryBuffer;
- LPDIRECTSOUNDBUFFER secondaryBuffer;
- HANDLE notifEvents[TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT];
+ LPDIRECTSOUND device;
+ LPDIRECTSOUNDBUFFER primaryBuffer;
+ LPDIRECTSOUNDBUFFER secondaryBuffer;
+ HANDLE notifEvents[TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT];
}
tdav_consumer_dsound_t;
static _inline int32_t __convert_volume(int32_t volume)
{
- static const int32_t __step = (DSBVOLUME_MAX - DSBVOLUME_MIN) / 100;
- return (volume * __step) + DSBVOLUME_MIN;
+ static const int32_t __step = (DSBVOLUME_MAX - DSBVOLUME_MIN) / 100;
+ return (volume * __step) + DSBVOLUME_MIN;
}
static void* TSK_STDCALL _tdav_consumer_dsound_playback_thread(void *param)
{
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)param;
-
- HRESULT hr;
- LPVOID lpvAudio1, lpvAudio2;
- DWORD dwBytesAudio1, dwBytesAudio2, dwEvent;
- static const DWORD dwWriteCursor = 0;
- tsk_size_t out_size;
-
- TSK_DEBUG_INFO("_tdav_consumer_dsound_playback_thread -- START");
-
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
-
- while (dsound->started) {
- dwEvent = WaitForMultipleObjects(TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT, dsound->notifEvents, FALSE, INFINITE);
- if (!dsound->started) {
- break;
- }
-
- // lock
- hr = IDirectSoundBuffer_Lock(
- dsound->secondaryBuffer,
- dwWriteCursor/* Ignored because of DSBLOCK_FROMWRITECURSOR */,
- (DWORD)dsound->bytes_per_notif_size,
- &lpvAudio1, &dwBytesAudio1,
- &lpvAudio2, &dwBytesAudio2,
- DSBLOCK_FROMWRITECURSOR);
- if (hr != DS_OK) {
- tdav_win32_print_error("IDirectSoundBuffer_Lock", hr);
- goto next;
- }
-
- out_size = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(dsound), dsound->bytes_per_notif_ptr, dsound->bytes_per_notif_size);
- if (out_size < dsound->bytes_per_notif_size) {
- // fill with silence
- memset(&dsound->bytes_per_notif_ptr[out_size], 0, (dsound->bytes_per_notif_size - out_size));
- }
- if ((dwBytesAudio1 + dwBytesAudio2) == dsound->bytes_per_notif_size) {
- memcpy(lpvAudio1, dsound->bytes_per_notif_ptr, dwBytesAudio1);
- if (lpvAudio2 && dwBytesAudio2) {
- memcpy(lpvAudio2, &dsound->bytes_per_notif_ptr[dwBytesAudio1], dwBytesAudio2);
- }
- }
- else {
- TSK_DEBUG_ERROR("Not expected: %d+%d#%d", dwBytesAudio1, dwBytesAudio2, dsound->bytes_per_notif_size);
- }
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)param;
+
+ HRESULT hr;
+ LPVOID lpvAudio1, lpvAudio2;
+ DWORD dwBytesAudio1, dwBytesAudio2, dwEvent;
+ static const DWORD dwWriteCursor = 0;
+ tsk_size_t out_size;
+
+ TSK_DEBUG_INFO("_tdav_consumer_dsound_playback_thread -- START");
+
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
+
+ while (dsound->started) {
+ dwEvent = WaitForMultipleObjects(TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT, dsound->notifEvents, FALSE, INFINITE);
+ if (!dsound->started) {
+ break;
+ }
+
+ // lock
+ hr = IDirectSoundBuffer_Lock(
+ dsound->secondaryBuffer,
+ dwWriteCursor/* Ignored because of DSBLOCK_FROMWRITECURSOR */,
+ (DWORD)dsound->bytes_per_notif_size,
+ &lpvAudio1, &dwBytesAudio1,
+ &lpvAudio2, &dwBytesAudio2,
+ DSBLOCK_FROMWRITECURSOR);
+ if (hr != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_Lock", hr);
+ goto next;
+ }
+
+ out_size = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(dsound), dsound->bytes_per_notif_ptr, dsound->bytes_per_notif_size);
+ if (out_size < dsound->bytes_per_notif_size) {
+ // fill with silence
+ memset(&dsound->bytes_per_notif_ptr[out_size], 0, (dsound->bytes_per_notif_size - out_size));
+ }
+ if ((dwBytesAudio1 + dwBytesAudio2) == dsound->bytes_per_notif_size) {
+ memcpy(lpvAudio1, dsound->bytes_per_notif_ptr, dwBytesAudio1);
+ if (lpvAudio2 && dwBytesAudio2) {
+ memcpy(lpvAudio2, &dsound->bytes_per_notif_ptr[dwBytesAudio1], dwBytesAudio2);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Not expected: %d+%d#%d", dwBytesAudio1, dwBytesAudio2, dsound->bytes_per_notif_size);
+ }
#if 0
- memset(lpvAudio1, rand(), dwBytesAudio1);
+ memset(lpvAudio1, rand(), dwBytesAudio1);
#endif
- // unlock
- if ((hr = IDirectSoundBuffer_Unlock(dsound->secondaryBuffer, lpvAudio1, dwBytesAudio1, lpvAudio2, dwBytesAudio2)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundBuffer_UnLock", hr);
- goto next;
- }
+ // unlock
+ if ((hr = IDirectSoundBuffer_Unlock(dsound->secondaryBuffer, lpvAudio1, dwBytesAudio1, lpvAudio2, dwBytesAudio2)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_UnLock", hr);
+ goto next;
+ }
next:
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(dsound));
- }
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(dsound));
+ }
- TSK_DEBUG_INFO("_tdav_consumer_dsound_playback_thread -- STOP");
-
+ TSK_DEBUG_INFO("_tdav_consumer_dsound_playback_thread -- STOP");
- return tsk_null;
+
+ return tsk_null;
}
static int _tdav_consumer_dsound_unprepare(tdav_consumer_dsound_t *dsound)
{
- if(dsound){
- tsk_size_t i;
- if(dsound->primaryBuffer){
- IDirectSoundBuffer_Release(dsound->primaryBuffer);
- dsound->primaryBuffer = NULL;
- }
- if(dsound->secondaryBuffer){
- IDirectSoundBuffer_Release(dsound->secondaryBuffer);
- dsound->secondaryBuffer = NULL;
- }
- if(dsound->device){
- IDirectSound_Release(dsound->device);
- dsound->device = NULL;
- }
- for(i = 0; i<sizeof(dsound->notifEvents)/sizeof(dsound->notifEvents[0]); i++){
- if(dsound->notifEvents[i]){
- CloseHandle(dsound->notifEvents[i]);
- dsound->notifEvents[i] = NULL;
- }
- }
- }
- return 0;
+ if(dsound) {
+ tsk_size_t i;
+ if(dsound->primaryBuffer) {
+ IDirectSoundBuffer_Release(dsound->primaryBuffer);
+ dsound->primaryBuffer = NULL;
+ }
+ if(dsound->secondaryBuffer) {
+ IDirectSoundBuffer_Release(dsound->secondaryBuffer);
+ dsound->secondaryBuffer = NULL;
+ }
+ if(dsound->device) {
+ IDirectSound_Release(dsound->device);
+ dsound->device = NULL;
+ }
+ for(i = 0; i<sizeof(dsound->notifEvents)/sizeof(dsound->notifEvents[0]); i++) {
+ if(dsound->notifEvents[i]) {
+ CloseHandle(dsound->notifEvents[i]);
+ dsound->notifEvents[i] = NULL;
+ }
+ }
+ }
+ return 0;
}
@@ -166,232 +165,232 @@ static int _tdav_consumer_dsound_unprepare(tdav_consumer_dsound_t *dsound)
/* ============ Media Consumer Interface ================= */
static int tdav_consumer_dsound_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
- int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
-
- if(ret == 0){
- if(dsound->secondaryBuffer && tsk_striequals(param->key, "volume")){
- if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK){
- TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
- ret = -1;
- }
- }
- }
-
- return ret;
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
+ int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+
+ if(ret == 0) {
+ if(dsound->secondaryBuffer && tsk_striequals(param->key, "volume")) {
+ if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK) {
+ TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
+ ret = -1;
+ }
+ }
+ }
+
+ return ret;
}
static int tdav_consumer_dsound_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- HRESULT hr;
- HWND hWnd;
+ HRESULT hr;
+ HWND hWnd;
- WAVEFORMATEX wfx = {0};
- DSBUFFERDESC dsbd = {0};
+ WAVEFORMATEX wfx = {0};
+ DSBUFFERDESC dsbd = {0};
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
- if(!dsound){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!dsound) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(dsound->device || dsound->primaryBuffer || dsound->secondaryBuffer){
- TSK_DEBUG_ERROR("Consumer already prepared");
- return -2;
- }
+ if(dsound->device || dsound->primaryBuffer || dsound->secondaryBuffer) {
+ TSK_DEBUG_ERROR("Consumer already prepared");
+ return -2;
+ }
- TMEDIA_CONSUMER(dsound)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(dsound)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(dsound)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+ TMEDIA_CONSUMER(dsound)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(dsound)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(dsound)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
#if 0
- TMEDIA_CONSUMER(dsound)->audio.out.rate = 48000;
- TMEDIA_CONSUMER(dsound)->audio.out.channels = 2;
+ TMEDIA_CONSUMER(dsound)->audio.out.rate = 48000;
+ TMEDIA_CONSUMER(dsound)->audio.out.channels = 2;
#endif
- /* Create sound device */
- if((hr = DirectSoundCreate(NULL, &dsound->device, NULL) != DS_OK)){
- tdav_win32_print_error("DirectSoundCreate", hr);
- return -3;
- }
-
- /* Set CooperativeLevel */
- if((hWnd = GetForegroundWindow()) || (hWnd = GetDesktopWindow()) || (hWnd = GetConsoleWindow())){
- if((hr = IDirectSound_SetCooperativeLevel(dsound->device, hWnd, DSSCL_PRIORITY)) != DS_OK){
- tdav_win32_print_error("IDirectSound_SetCooperativeLevel", hr);
- return -2;
- }
- }
-
- /* Creates the primary buffer and apply format */
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_CONSUMER(dsound)->audio.out.channels ? TMEDIA_CONSUMER(dsound)->audio.out.channels : TMEDIA_CONSUMER(dsound)->audio.in.channels;
- wfx.nSamplesPerSec = TMEDIA_CONSUMER(dsound)->audio.out.rate ? TMEDIA_CONSUMER(dsound)->audio.out.rate : TMEDIA_CONSUMER(dsound)->audio.in.rate;
- wfx.wBitsPerSample = TMEDIA_CONSUMER(dsound)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- /* Average bytes (count) for each notification */
- dsound->bytes_per_notif_size = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(dsound)->audio.ptime)/1000);
- if(!(dsound->bytes_per_notif_ptr = tsk_realloc(dsound->bytes_per_notif_ptr, dsound->bytes_per_notif_size))){
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", dsound->bytes_per_notif_size);
- return -3;
- }
-
- dsbd.dwSize = sizeof(DSBUFFERDESC);
- dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
- dsbd.dwBufferBytes = 0;
- dsbd.lpwfxFormat = NULL;
-
- if((hr = IDirectSound_CreateSoundBuffer(dsound->device, &dsbd, &dsound->primaryBuffer, NULL)) != DS_OK){
- tdav_win32_print_error("IDirectSound_CreateSoundBuffer", hr);
- return -4;
- }
- if((hr = IDirectSoundBuffer_SetFormat(dsound->primaryBuffer, &wfx)) != DS_OK){
- tdav_win32_print_error("IDirectSoundBuffer_SetFormat", hr);
- return -5;
- }
-
- /* Creates the secondary buffer and apply format */
- dsbd.dwFlags = (DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLVOLUME);
- dsbd.dwBufferBytes = (DWORD)(TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT * dsound->bytes_per_notif_size);
- dsbd.lpwfxFormat = &wfx;
-
- if((hr = IDirectSound_CreateSoundBuffer(dsound->device, &dsbd, &dsound->secondaryBuffer, NULL)) != DS_OK){
- tdav_win32_print_error("IDirectSound_CreateSoundBuffer", hr);
- return -6;
- }
-
- /* Set Volume */
- if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK){
- TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
- }
-
- return 0;
+ /* Create sound device */
+ if((hr = DirectSoundCreate(NULL, &dsound->device, NULL) != DS_OK)) {
+ tdav_win32_print_error("DirectSoundCreate", hr);
+ return -3;
+ }
+
+ /* Set CooperativeLevel */
+ if((hWnd = GetForegroundWindow()) || (hWnd = GetDesktopWindow()) || (hWnd = GetConsoleWindow())) {
+ if((hr = IDirectSound_SetCooperativeLevel(dsound->device, hWnd, DSSCL_PRIORITY)) != DS_OK) {
+ tdav_win32_print_error("IDirectSound_SetCooperativeLevel", hr);
+ return -2;
+ }
+ }
+
+ /* Creates the primary buffer and apply format */
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_CONSUMER(dsound)->audio.out.channels ? TMEDIA_CONSUMER(dsound)->audio.out.channels : TMEDIA_CONSUMER(dsound)->audio.in.channels;
+ wfx.nSamplesPerSec = TMEDIA_CONSUMER(dsound)->audio.out.rate ? TMEDIA_CONSUMER(dsound)->audio.out.rate : TMEDIA_CONSUMER(dsound)->audio.in.rate;
+ wfx.wBitsPerSample = TMEDIA_CONSUMER(dsound)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ /* Average bytes (count) for each notification */
+ dsound->bytes_per_notif_size = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(dsound)->audio.ptime)/1000);
+ if(!(dsound->bytes_per_notif_ptr = tsk_realloc(dsound->bytes_per_notif_ptr, dsound->bytes_per_notif_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", dsound->bytes_per_notif_size);
+ return -3;
+ }
+
+ dsbd.dwSize = sizeof(DSBUFFERDESC);
+ dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
+ dsbd.dwBufferBytes = 0;
+ dsbd.lpwfxFormat = NULL;
+
+ if((hr = IDirectSound_CreateSoundBuffer(dsound->device, &dsbd, &dsound->primaryBuffer, NULL)) != DS_OK) {
+ tdav_win32_print_error("IDirectSound_CreateSoundBuffer", hr);
+ return -4;
+ }
+ if((hr = IDirectSoundBuffer_SetFormat(dsound->primaryBuffer, &wfx)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_SetFormat", hr);
+ return -5;
+ }
+
+ /* Creates the secondary buffer and apply format */
+ dsbd.dwFlags = (DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLVOLUME);
+ dsbd.dwBufferBytes = (DWORD)(TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT * dsound->bytes_per_notif_size);
+ dsbd.lpwfxFormat = &wfx;
+
+ if((hr = IDirectSound_CreateSoundBuffer(dsound->device, &dsbd, &dsound->secondaryBuffer, NULL)) != DS_OK) {
+ tdav_win32_print_error("IDirectSound_CreateSoundBuffer", hr);
+ return -6;
+ }
+
+ /* Set Volume */
+ if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK) {
+ TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
+ }
+
+ return 0;
}
static int tdav_consumer_dsound_start(tmedia_consumer_t* self)
{
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
-
- tsk_size_t i;
- HRESULT hr;
- LPDIRECTSOUNDNOTIFY lpDSBNotify;
- DSBPOSITIONNOTIFY pPosNotify[TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT] = {0};
-
- static DWORD dwMajorVersion = -1;
-
- // Get OS version
- if(dwMajorVersion == -1){
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- dwMajorVersion = osvi.dwMajorVersion;
- }
-
- if(!dsound){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!dsound->device || !dsound->primaryBuffer || !dsound->secondaryBuffer){
- TSK_DEBUG_ERROR("Consumer not prepared");
- return -2;
- }
-
- if(dsound->started){
- return 0;
- }
-
- if((hr = IDirectSoundBuffer_QueryInterface(dsound->secondaryBuffer, &IID_IDirectSoundNotify, (LPVOID*)&lpDSBNotify)) != DS_OK){
- tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
- return -3;
- }
-
- /* Events associated to notification points */
- for(i = 0; i<TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT; i++){
- dsound->notifEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
- // set notification point offset at the start of the buffer for Windows Vista and later and at the half of the buffer of XP and before
- pPosNotify[i].dwOffset = (DWORD)((dsound->bytes_per_notif_size * i) + (dwMajorVersion > 5 ? (dsound->bytes_per_notif_size >> 1) : 1));
- pPosNotify[i].hEventNotify = dsound->notifEvents[i];
- }
- if((hr = IDirectSoundNotify_SetNotificationPositions(lpDSBNotify, TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT, pPosNotify)) != DS_OK){
- IDirectSoundNotify_Release(lpDSBNotify);
- tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
- return -4;
- }
-
- if((hr = IDirectSoundNotify_Release(lpDSBNotify))){
- tdav_win32_print_error("IDirectSoundNotify_Release", hr);
- }
-
- /* Start the buffer */
- if((hr = IDirectSoundBuffer_Play(dsound->secondaryBuffer, 0, 0, DSBPLAY_LOOPING)) != DS_OK){
- tdav_win32_print_error("IDirectSoundNotify_Release", hr);
- return -5;
- }
-
- /* start the reader thread */
- dsound->started = tsk_true;
- tsk_thread_create(&dsound->tid[0], _tdav_consumer_dsound_playback_thread, dsound);
-
- return 0;
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
+
+ tsk_size_t i;
+ HRESULT hr;
+ LPDIRECTSOUNDNOTIFY lpDSBNotify;
+ DSBPOSITIONNOTIFY pPosNotify[TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT] = {0};
+
+ static DWORD dwMajorVersion = -1;
+
+ // Get OS version
+ if(dwMajorVersion == -1) {
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ dwMajorVersion = osvi.dwMajorVersion;
+ }
+
+ if(!dsound) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!dsound->device || !dsound->primaryBuffer || !dsound->secondaryBuffer) {
+ TSK_DEBUG_ERROR("Consumer not prepared");
+ return -2;
+ }
+
+ if(dsound->started) {
+ return 0;
+ }
+
+ if((hr = IDirectSoundBuffer_QueryInterface(dsound->secondaryBuffer, &IID_IDirectSoundNotify, (LPVOID*)&lpDSBNotify)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
+ return -3;
+ }
+
+ /* Events associated to notification points */
+ for(i = 0; i<TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT; i++) {
+ dsound->notifEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ // set notification point offset at the start of the buffer for Windows Vista and later and at the half of the buffer of XP and before
+ pPosNotify[i].dwOffset = (DWORD)((dsound->bytes_per_notif_size * i) + (dwMajorVersion > 5 ? (dsound->bytes_per_notif_size >> 1) : 1));
+ pPosNotify[i].hEventNotify = dsound->notifEvents[i];
+ }
+ if((hr = IDirectSoundNotify_SetNotificationPositions(lpDSBNotify, TDAV_DSOUND_CONSUMER_NOTIF_POS_COUNT, pPosNotify)) != DS_OK) {
+ IDirectSoundNotify_Release(lpDSBNotify);
+ tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
+ return -4;
+ }
+
+ if((hr = IDirectSoundNotify_Release(lpDSBNotify))) {
+ tdav_win32_print_error("IDirectSoundNotify_Release", hr);
+ }
+
+ /* Start the buffer */
+ if((hr = IDirectSoundBuffer_Play(dsound->secondaryBuffer, 0, 0, DSBPLAY_LOOPING)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundNotify_Release", hr);
+ return -5;
+ }
+
+ /* start the reader thread */
+ dsound->started = tsk_true;
+ tsk_thread_create(&dsound->tid[0], _tdav_consumer_dsound_playback_thread, dsound);
+
+ return 0;
}
static int tdav_consumer_dsound_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
-
- if(!dsound || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* buffer is already decoded */
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(dsound), buffer, size, proto_hdr);
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
+
+ if(!dsound || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* buffer is already decoded */
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(dsound), buffer, size, proto_hdr);
}
static int tdav_consumer_dsound_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_consumer_dsound_stop(tmedia_consumer_t* self)
{
- tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
-
- HRESULT hr;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!dsound->started){
- return 0;
- }
-
- /* should be done here */
- dsound->started = tsk_false;
-
- /* stop thread */
- if(dsound->tid[0]){
- tsk_thread_join(&(dsound->tid[0]));
- }
-
- if((hr = IDirectSoundBuffer_Stop(dsound->secondaryBuffer)) != DS_OK){
- tdav_win32_print_error("IDirectSoundBuffer_Stop", hr);
- }
- if((hr = IDirectSoundBuffer_SetCurrentPosition(dsound->secondaryBuffer, 0)) != DS_OK){
- tdav_win32_print_error("IDirectSoundBuffer_SetCurrentPosition", hr);
- }
-
- // unprepare
- // will be prepared again before calling next start()
- _tdav_consumer_dsound_unprepare(dsound);
-
- return 0;
+ tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
+
+ HRESULT hr;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!dsound->started) {
+ return 0;
+ }
+
+ /* should be done here */
+ dsound->started = tsk_false;
+
+ /* stop thread */
+ if(dsound->tid[0]) {
+ tsk_thread_join(&(dsound->tid[0]));
+ }
+
+ if((hr = IDirectSoundBuffer_Stop(dsound->secondaryBuffer)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_Stop", hr);
+ }
+ if((hr = IDirectSoundBuffer_SetCurrentPosition(dsound->secondaryBuffer, 0)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundBuffer_SetCurrentPosition", hr);
+ }
+
+ // unprepare
+ // will be prepared again before calling next start()
+ _tdav_consumer_dsound_unprepare(dsound);
+
+ return 0;
}
@@ -401,56 +400,54 @@ static int tdav_consumer_dsound_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_dsound_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_dsound_t *consumer = self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- /* init self */
-
- }
- return self;
+ tdav_consumer_dsound_t *consumer = self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_dsound_dtor(tsk_object_t * self)
-{
- tdav_consumer_dsound_t *dsound = self;
- if(dsound){
- /* stop */
- if(dsound->started){
- tdav_consumer_dsound_stop(self);
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(dsound));
- /* deinit self */
- _tdav_consumer_dsound_unprepare(dsound);
- TSK_FREE(dsound->bytes_per_notif_ptr);
- }
-
- return self;
+{
+ tdav_consumer_dsound_t *dsound = self;
+ if(dsound) {
+ /* stop */
+ if(dsound->started) {
+ tdav_consumer_dsound_stop(self);
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(dsound));
+ /* deinit self */
+ _tdav_consumer_dsound_unprepare(dsound);
+ TSK_FREE(dsound->bytes_per_notif_ptr);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_dsound_def_s =
-{
- sizeof(tdav_consumer_dsound_t),
- tdav_consumer_dsound_ctor,
- tdav_consumer_dsound_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_dsound_def_s = {
+ sizeof(tdav_consumer_dsound_t),
+ tdav_consumer_dsound_ctor,
+ tdav_consumer_dsound_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_dsound_plugin_def_s =
-{
- &tdav_consumer_dsound_def_s,
-
- tmedia_audio,
- "Microsoft DirectSound consumer",
-
- tdav_consumer_dsound_set,
- tdav_consumer_dsound_prepare,
- tdav_consumer_dsound_start,
- tdav_consumer_dsound_consume,
- tdav_consumer_dsound_pause,
- tdav_consumer_dsound_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_dsound_plugin_def_s = {
+ &tdav_consumer_dsound_def_s,
+
+ tmedia_audio,
+ "Microsoft DirectSound consumer",
+
+ tdav_consumer_dsound_set,
+ tdav_consumer_dsound_prepare,
+ tdav_consumer_dsound_start,
+ tdav_consumer_dsound_consume,
+ tdav_consumer_dsound_pause,
+ tdav_consumer_dsound_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_dsound_plugin_def_t = &tdav_consumer_dsound_plugin_def_s;
diff --git a/tinyDAV/src/audio/directsound/tdav_producer_dsound.c b/tinyDAV/src/audio/directsound/tdav_producer_dsound.c
index c5ae167..ab9ca6f 100755
--- a/tinyDAV/src/audio/directsound/tdav_producer_dsound.c
+++ b/tinyDAV/src/audio/directsound/tdav_producer_dsound.c
@@ -53,98 +53,97 @@ extern void tdav_win32_print_error(const char* func, HRESULT hr);
# define TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT 10
#endif /* TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT */
-typedef struct tdav_producer_dsound_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
+typedef struct tdav_producer_dsound_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
- tsk_bool_t started;
- tsk_bool_t mute;
- tsk_size_t bytes_per_notif_size;
- tsk_thread_handle_t* tid[1];
+ tsk_bool_t started;
+ tsk_bool_t mute;
+ tsk_size_t bytes_per_notif_size;
+ tsk_thread_handle_t* tid[1];
- LPDIRECTSOUNDCAPTURE device;
- LPDIRECTSOUNDCAPTUREBUFFER captureBuffer;
- HANDLE notifEvents[TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT];
+ LPDIRECTSOUNDCAPTURE device;
+ LPDIRECTSOUNDCAPTUREBUFFER captureBuffer;
+ HANDLE notifEvents[TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT];
}
tdav_producer_dsound_t;
static void* TSK_STDCALL _tdav_producer_dsound_record_thread(void *param)
{
- tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)param;
-
- HRESULT hr;
- LPVOID lpvAudio1, lpvAudio2;
- DWORD dwBytesAudio1, dwBytesAudio2, dwEvent, dwIndex;
-
- TSK_DEBUG_INFO("_tdav_producer_dsound_record_thread -- START");
-
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
-
- while (dsound->started) {
- dwEvent = WaitForMultipleObjects(TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT, dsound->notifEvents, FALSE, INFINITE);
- if (!dsound->started) {
- break;
- }
- if (dwEvent < WAIT_OBJECT_0 || dwEvent >(WAIT_OBJECT_0 + TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT)) {
- TSK_DEBUG_ERROR("Invalid dwEvent(%d)", dwEvent);
- break;
- }
- dwIndex = (dwEvent - WAIT_OBJECT_0);
-
- // lock
- if ((hr = IDirectSoundCaptureBuffer_Lock(dsound->captureBuffer, (DWORD)(dwIndex * dsound->bytes_per_notif_size), (DWORD)dsound->bytes_per_notif_size, &lpvAudio1, &dwBytesAudio1, &lpvAudio2, &dwBytesAudio2, 0)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCaptureBuffer_Lock", hr);
- continue;
- }
-
- if (TMEDIA_PRODUCER(dsound)->enc_cb.callback) {
+ tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)param;
+
+ HRESULT hr;
+ LPVOID lpvAudio1, lpvAudio2;
+ DWORD dwBytesAudio1, dwBytesAudio2, dwEvent, dwIndex;
+
+ TSK_DEBUG_INFO("_tdav_producer_dsound_record_thread -- START");
+
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
+
+ while (dsound->started) {
+ dwEvent = WaitForMultipleObjects(TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT, dsound->notifEvents, FALSE, INFINITE);
+ if (!dsound->started) {
+ break;
+ }
+ if (dwEvent < WAIT_OBJECT_0 || dwEvent >(WAIT_OBJECT_0 + TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT)) {
+ TSK_DEBUG_ERROR("Invalid dwEvent(%d)", dwEvent);
+ break;
+ }
+ dwIndex = (dwEvent - WAIT_OBJECT_0);
+
+ // lock
+ if ((hr = IDirectSoundCaptureBuffer_Lock(dsound->captureBuffer, (DWORD)(dwIndex * dsound->bytes_per_notif_size), (DWORD)dsound->bytes_per_notif_size, &lpvAudio1, &dwBytesAudio1, &lpvAudio2, &dwBytesAudio2, 0)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCaptureBuffer_Lock", hr);
+ continue;
+ }
+
+ if (TMEDIA_PRODUCER(dsound)->enc_cb.callback) {
#if SEND_SILENCE_ON_MUTE
- if (dsound->mute) {
- memset(lpvAudio1, 0, dwBytesAudio1);
- if(lpvAudio2){
- memset(lpvAudio2, 0, dwBytesAudio2);
- }
- }
+ if (dsound->mute) {
+ memset(lpvAudio1, 0, dwBytesAudio1);
+ if(lpvAudio2) {
+ memset(lpvAudio2, 0, dwBytesAudio2);
+ }
+ }
#endif
- TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
- if (lpvAudio2) {
- TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio2, dwBytesAudio2);
- }
- }
+ TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
+ if (lpvAudio2) {
+ TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio2, dwBytesAudio2);
+ }
+ }
- // unlock
- if ((hr = IDirectSoundCaptureBuffer_Unlock(dsound->captureBuffer, lpvAudio1, dwBytesAudio1, lpvAudio2, dwBytesAudio2)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCaptureBuffer_Unlock", hr);
- continue;
- }
- }
+ // unlock
+ if ((hr = IDirectSoundCaptureBuffer_Unlock(dsound->captureBuffer, lpvAudio1, dwBytesAudio1, lpvAudio2, dwBytesAudio2)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCaptureBuffer_Unlock", hr);
+ continue;
+ }
+ }
- TSK_DEBUG_INFO("_tdav_producer_dsound_record_thread -- STOP");
+ TSK_DEBUG_INFO("_tdav_producer_dsound_record_thread -- STOP");
- return tsk_null;
+ return tsk_null;
}
static int _tdav_producer_dsound_unprepare(tdav_producer_dsound_t* dsound)
{
- if (dsound) {
- tsk_size_t i;
- if (dsound->captureBuffer) {
- IDirectSoundCaptureBuffer_Release(dsound->captureBuffer);
- dsound->captureBuffer = NULL;
- }
- if (dsound->device) {
- IDirectSoundCapture_Release(dsound->device);
- dsound->device = NULL;
- }
- for (i = 0; i < (sizeof(dsound->notifEvents) / sizeof(dsound->notifEvents[0])); i++){
- if (dsound->notifEvents[i]) {
- CloseHandle(dsound->notifEvents[i]);
- dsound->notifEvents[i] = NULL;
- }
- }
- }
- return 0;
+ if (dsound) {
+ tsk_size_t i;
+ if (dsound->captureBuffer) {
+ IDirectSoundCaptureBuffer_Release(dsound->captureBuffer);
+ dsound->captureBuffer = NULL;
+ }
+ if (dsound->device) {
+ IDirectSoundCapture_Release(dsound->device);
+ dsound->device = NULL;
+ }
+ for (i = 0; i < (sizeof(dsound->notifEvents) / sizeof(dsound->notifEvents[0])); i++) {
+ if (dsound->notifEvents[i]) {
+ CloseHandle(dsound->notifEvents[i]);
+ dsound->notifEvents[i] = NULL;
+ }
+ }
+ }
+ return 0;
}
@@ -153,191 +152,191 @@ static int _tdav_producer_dsound_unprepare(tdav_producer_dsound_t* dsound)
/* ============ Media Producer Interface ================= */
static int tdav_producer_dsound_set(tmedia_producer_t* self, const tmedia_param_t* param)
{
- tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
- if (param->plugin_type == tmedia_ppt_producer) {
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "volume")) {
- return 0;
- }
- else if (tsk_striequals(param->key, "mute")) {
- dsound->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
+ if (param->plugin_type == tmedia_ppt_producer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "volume")) {
+ return 0;
+ }
+ else if (tsk_striequals(param->key, "mute")) {
+ dsound->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
#if !SEND_SILENCE_ON_MUTE
- if (dsound->started) {
- if (dsound->mute) {
- IDirectSoundCaptureBuffer_Stop(dsound->captureBuffer);
- }
- else {
- IDirectSoundCaptureBuffer_Start(dsound->captureBuffer, DSBPLAY_LOOPING);
- }
- }
+ if (dsound->started) {
+ if (dsound->mute) {
+ IDirectSoundCaptureBuffer_Stop(dsound->captureBuffer);
+ }
+ else {
+ IDirectSoundCaptureBuffer_Start(dsound->captureBuffer, DSBPLAY_LOOPING);
+ }
+ }
#endif
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_dsound_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- HRESULT hr;
+ HRESULT hr;
- WAVEFORMATEX wfx = { 0 };
- DSCBUFFERDESC dsbd = { 0 };
+ WAVEFORMATEX wfx = { 0 };
+ DSCBUFFERDESC dsbd = { 0 };
- tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
+ tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
- if (!dsound || !codec) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!dsound || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (dsound->device || dsound->captureBuffer) {
- TSK_DEBUG_ERROR("Producer already prepared");
- return -2;
- }
+ if (dsound->device || dsound->captureBuffer) {
+ TSK_DEBUG_ERROR("Producer already prepared");
+ return -2;
+ }
- TMEDIA_PRODUCER(dsound)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(dsound)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(dsound)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(dsound)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(dsound)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(dsound)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
#if 0
- TMEDIA_PRODUCER(dsound)->audio.rate = 48000;
- TMEDIA_PRODUCER(dsound)->audio.channels = 1;
+ TMEDIA_PRODUCER(dsound)->audio.rate = 48000;
+ TMEDIA_PRODUCER(dsound)->audio.channels = 1;
#endif
- /* Create capture device */
- if ((hr = DirectSoundCaptureCreate(NULL, &dsound->device, NULL) != DS_OK)) {
- tdav_win32_print_error("DirectSoundCaptureCreate", hr);
- return -3;
- }
-
- /* Creates the capture buffer */
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_PRODUCER(dsound)->audio.channels;
- wfx.nSamplesPerSec = TMEDIA_PRODUCER(dsound)->audio.rate;
- wfx.wBitsPerSample = TMEDIA_PRODUCER(dsound)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- /* Average bytes (count) for each notification */
- dsound->bytes_per_notif_size = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(dsound)->audio.ptime) / 1000);
-
- dsbd.dwSize = sizeof(DSCBUFFERDESC);
- dsbd.dwBufferBytes = (DWORD)(TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT * dsound->bytes_per_notif_size);
- dsbd.lpwfxFormat = &wfx;
-
- if ((hr = IDirectSoundCapture_CreateCaptureBuffer(dsound->device, &dsbd, &dsound->captureBuffer, NULL)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCapture_CreateCaptureBuffer", hr);
- return -4;
- }
-
- return 0;
+ /* Create capture device */
+ if ((hr = DirectSoundCaptureCreate(NULL, &dsound->device, NULL) != DS_OK)) {
+ tdav_win32_print_error("DirectSoundCaptureCreate", hr);
+ return -3;
+ }
+
+ /* Creates the capture buffer */
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_PRODUCER(dsound)->audio.channels;
+ wfx.nSamplesPerSec = TMEDIA_PRODUCER(dsound)->audio.rate;
+ wfx.wBitsPerSample = TMEDIA_PRODUCER(dsound)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ /* Average bytes (count) for each notification */
+ dsound->bytes_per_notif_size = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(dsound)->audio.ptime) / 1000);
+
+ dsbd.dwSize = sizeof(DSCBUFFERDESC);
+ dsbd.dwBufferBytes = (DWORD)(TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT * dsound->bytes_per_notif_size);
+ dsbd.lpwfxFormat = &wfx;
+
+ if ((hr = IDirectSoundCapture_CreateCaptureBuffer(dsound->device, &dsbd, &dsound->captureBuffer, NULL)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCapture_CreateCaptureBuffer", hr);
+ return -4;
+ }
+
+ return 0;
}
static int tdav_producer_dsound_start(tmedia_producer_t* self)
{
- tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
-
- tsk_size_t i;
- DWORD dwOffset;
- HRESULT hr;
- LPDIRECTSOUNDNOTIFY lpDSBNotify;
- DSBPOSITIONNOTIFY pPosNotify[TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT] = { 0 };
-
- if (!dsound) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!dsound->device || !dsound->captureBuffer) {
- TSK_DEBUG_ERROR("Producer not prepared");
- return -2;
- }
-
- if (dsound->started) {
- return 0;
- }
-
- if ((hr = IDirectSoundCaptureBuffer_QueryInterface(dsound->captureBuffer, &IID_IDirectSoundNotify, (LPVOID*)&lpDSBNotify)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCaptureBuffer_QueryInterface", hr);
- return -3;
- }
-
- /* Events associated to notification points */
- dwOffset = (DWORD)(dsound->bytes_per_notif_size - 1);
- for (i = 0; i < (sizeof(dsound->notifEvents) / sizeof(dsound->notifEvents[0])); i++){
- dsound->notifEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
- pPosNotify[i].dwOffset = dwOffset;
- pPosNotify[i].hEventNotify = dsound->notifEvents[i];
- dwOffset += (DWORD)dsound->bytes_per_notif_size;
- }
- if ((hr = IDirectSoundNotify_SetNotificationPositions(lpDSBNotify, TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT, pPosNotify)) != DS_OK) {
- IDirectSoundNotify_Release(lpDSBNotify);
- tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
- return -4;
- }
-
- if ((hr = IDirectSoundNotify_Release(lpDSBNotify))) {
- tdav_win32_print_error("IDirectSoundNotify_Release", hr);
- }
-
- /* Start the buffer */
- if ((hr = IDirectSoundCaptureBuffer_Start(dsound->captureBuffer, DSBPLAY_LOOPING)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCaptureBuffer_Start", hr);
- return -5;
- }
-
- /* start the reader thread */
- dsound->started = tsk_true;
- tsk_thread_create(&dsound->tid[0], _tdav_producer_dsound_record_thread, dsound);
-
- return 0;
+ tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
+
+ tsk_size_t i;
+ DWORD dwOffset;
+ HRESULT hr;
+ LPDIRECTSOUNDNOTIFY lpDSBNotify;
+ DSBPOSITIONNOTIFY pPosNotify[TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT] = { 0 };
+
+ if (!dsound) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!dsound->device || !dsound->captureBuffer) {
+ TSK_DEBUG_ERROR("Producer not prepared");
+ return -2;
+ }
+
+ if (dsound->started) {
+ return 0;
+ }
+
+ if ((hr = IDirectSoundCaptureBuffer_QueryInterface(dsound->captureBuffer, &IID_IDirectSoundNotify, (LPVOID*)&lpDSBNotify)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCaptureBuffer_QueryInterface", hr);
+ return -3;
+ }
+
+ /* Events associated to notification points */
+ dwOffset = (DWORD)(dsound->bytes_per_notif_size - 1);
+ for (i = 0; i < (sizeof(dsound->notifEvents) / sizeof(dsound->notifEvents[0])); i++) {
+ dsound->notifEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ pPosNotify[i].dwOffset = dwOffset;
+ pPosNotify[i].hEventNotify = dsound->notifEvents[i];
+ dwOffset += (DWORD)dsound->bytes_per_notif_size;
+ }
+ if ((hr = IDirectSoundNotify_SetNotificationPositions(lpDSBNotify, TDAV_DSOUND_PRODUCER_NOTIF_POS_COUNT, pPosNotify)) != DS_OK) {
+ IDirectSoundNotify_Release(lpDSBNotify);
+ tdav_win32_print_error("IDirectSoundBuffer_QueryInterface", hr);
+ return -4;
+ }
+
+ if ((hr = IDirectSoundNotify_Release(lpDSBNotify))) {
+ tdav_win32_print_error("IDirectSoundNotify_Release", hr);
+ }
+
+ /* Start the buffer */
+ if ((hr = IDirectSoundCaptureBuffer_Start(dsound->captureBuffer, DSBPLAY_LOOPING)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCaptureBuffer_Start", hr);
+ return -5;
+ }
+
+ /* start the reader thread */
+ dsound->started = tsk_true;
+ tsk_thread_create(&dsound->tid[0], _tdav_producer_dsound_record_thread, dsound);
+
+ return 0;
}
static int tdav_producer_dsound_pause(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_producer_dsound_stop(tmedia_producer_t* self)
{
- tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
+ tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)self;
- HRESULT hr;
+ HRESULT hr;
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!dsound->started) {
- return 0;
- }
+ if (!dsound->started) {
+ return 0;
+ }
- // should be done here
- dsound->started = tsk_false;
+ // should be done here
+ dsound->started = tsk_false;
#if !SEND_SILENCE_ON_MUTE
- if (dsound->mute && dsound->notifEvents[0]) {
- // thread is paused -> raise event now that "started" is equal to false
- SetEvent(dsound->notifEvents[0]);
- }
+ if (dsound->mute && dsound->notifEvents[0]) {
+ // thread is paused -> raise event now that "started" is equal to false
+ SetEvent(dsound->notifEvents[0]);
+ }
#endif
- // stop thread
- if (dsound->tid[0]) {
- tsk_thread_join(&(dsound->tid[0]));
- }
+ // stop thread
+ if (dsound->tid[0]) {
+ tsk_thread_join(&(dsound->tid[0]));
+ }
- if ((hr = IDirectSoundCaptureBuffer_Stop(dsound->captureBuffer)) != DS_OK) {
- tdav_win32_print_error("IDirectSoundCaptureBuffer_Stop", hr);
- }
+ if ((hr = IDirectSoundCaptureBuffer_Stop(dsound->captureBuffer)) != DS_OK) {
+ tdav_win32_print_error("IDirectSoundCaptureBuffer_Stop", hr);
+ }
- // unprepare
- // will be prepared again before next start()
- _tdav_producer_dsound_unprepare(dsound);
+ // unprepare
+ // will be prepared again before next start()
+ _tdav_producer_dsound_unprepare(dsound);
- return 0;
+ return 0;
}
@@ -347,54 +346,52 @@ static int tdav_producer_dsound_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_dsound_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_dsound_t *producer = self;
- if (producer) {
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
-
- }
- return self;
+ tdav_producer_dsound_t *producer = self;
+ if (producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_dsound_dtor(tsk_object_t * self)
{
- tdav_producer_dsound_t *dsound = self;
- if (dsound) {
- /* stop */
- if (dsound->started) {
- tdav_producer_dsound_stop(self);
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(dsound));
- /* deinit self */
- _tdav_producer_dsound_unprepare(dsound);
- }
-
- return self;
+ tdav_producer_dsound_t *dsound = self;
+ if (dsound) {
+ /* stop */
+ if (dsound->started) {
+ tdav_producer_dsound_stop(self);
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(dsound));
+ /* deinit self */
+ _tdav_producer_dsound_unprepare(dsound);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_dsound_def_s =
-{
- sizeof(tdav_producer_dsound_t),
- tdav_producer_dsound_ctor,
- tdav_producer_dsound_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_dsound_def_s = {
+ sizeof(tdav_producer_dsound_t),
+ tdav_producer_dsound_ctor,
+ tdav_producer_dsound_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_dsound_plugin_def_s =
-{
- &tdav_producer_dsound_def_s,
+static const tmedia_producer_plugin_def_t tdav_producer_dsound_plugin_def_s = {
+ &tdav_producer_dsound_def_s,
- tmedia_audio,
- "Microsoft DirectSound producer",
+ tmedia_audio,
+ "Microsoft DirectSound producer",
- tdav_producer_dsound_set,
- tdav_producer_dsound_prepare,
- tdav_producer_dsound_start,
- tdav_producer_dsound_pause,
- tdav_producer_dsound_stop
+ tdav_producer_dsound_set,
+ tdav_producer_dsound_prepare,
+ tdav_producer_dsound_start,
+ tdav_producer_dsound_pause,
+ tdav_producer_dsound_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_dsound_plugin_def_t = &tdav_producer_dsound_plugin_def_s;
diff --git a/tinyDAV/src/audio/oss/tdav_consumer_oss.c b/tinyDAV/src/audio/oss/tdav_consumer_oss.c
index 0370210..6ad43e7 100755
--- a/tinyDAV/src/audio/oss/tdav_consumer_oss.c
+++ b/tinyDAV/src/audio/oss/tdav_consumer_oss.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -39,287 +39,286 @@
#define OSS_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR("[OSS Consumer] " FMT, ##__VA_ARGS__)
#define OSS_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[OSS Consumer] " FMT, ##__VA_ARGS__)
-typedef struct tdav_consumer_oss_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
-
- tsk_bool_t b_started;
- tsk_bool_t b_prepared;
- tsk_bool_t b_muted;
- int n_bits_per_sample;
-
- int fd;
- tsk_thread_handle_t* tid[1];
-
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- uint8_t* p_buff_ptr;
-
- tsk_size_t n_buff16_size_in_bytes;
- tsk_size_t n_buff16_size_in_samples;
- uint16_t* p_buff16_ptr;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_consumer_oss_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+
+ tsk_bool_t b_started;
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_muted;
+ int n_bits_per_sample;
+
+ int fd;
+ tsk_thread_handle_t* tid[1];
+
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ uint8_t* p_buff_ptr;
+
+ tsk_size_t n_buff16_size_in_bytes;
+ tsk_size_t n_buff16_size_in_samples;
+ uint16_t* p_buff16_ptr;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_oss_t;
static int __oss_from_16bits_to_8bits(const void* p_src, void* p_dst, tsk_size_t n_samples)
{
- tsk_size_t i;
- uint16_t *_p_src = (uint16_t*)p_src;
- uint8_t *_p_dst = (uint8_t*)p_dst;
-
- if (!p_src || !p_dst || !n_samples) {
- OSS_DEBUG_ERROR("invalid parameter");
- return -1;
- }
- for (i = 0; i < n_samples; ++i) {
- _p_dst[i] = _p_src[i];
- }
- return 0;
+ tsk_size_t i;
+ uint16_t *_p_src = (uint16_t*)p_src;
+ uint8_t *_p_dst = (uint8_t*)p_dst;
+
+ if (!p_src || !p_dst || !n_samples) {
+ OSS_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+ for (i = 0; i < n_samples; ++i) {
+ _p_dst[i] = _p_src[i];
+ }
+ return 0;
}
static void* TSK_STDCALL _tdav_consumer_oss_playback_thread(void *param)
{
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)param;
- int err;
- void* p_buffer = ((p_oss->n_bits_per_sample == 8) ? (void*)p_oss->p_buff16_ptr: (void*)p_oss->p_buff_ptr);
- tsk_size_t n_buffer_in_bytes = (p_oss->n_bits_per_sample == 8) ? p_oss->n_buff16_size_in_bytes : p_oss->n_buff_size_in_bytes;
- tsk_size_t n_buffer_in_samples = p_oss->n_buff_size_in_samples;
-
- const void* _p_buffer;
- tsk_size_t _n_buffer_in_bytes;
-
- OSS_DEBUG_INFO("__playback_thread -- START");
-
- tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
-
- while (p_oss->b_started) {
- tsk_safeobj_lock(p_oss);
- err = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(p_oss), p_buffer, n_buffer_in_bytes); // requires 16bits, thread-safe
- if (err >= 0) {
- _p_buffer = p_buffer;
- _n_buffer_in_bytes = n_buffer_in_bytes;
- if (err < n_buffer_in_bytes) {
- memset(((uint8_t*)p_buffer) + err, 0, (n_buffer_in_bytes - err));
- }
- if (p_oss->n_bits_per_sample == 8) {
- __oss_from_16bits_to_8bits(p_buffer, p_oss->p_buff_ptr, n_buffer_in_samples);
- _p_buffer = p_oss->p_buff_ptr;
- _n_buffer_in_bytes >>= 1;
- }
- if ((err = write(p_oss->fd, _p_buffer, _n_buffer_in_bytes)) != _n_buffer_in_bytes) {
- OSS_DEBUG_ERROR ("Failed to read data from audio interface failed (%d -> %s)", err , strerror(errno));
- tsk_safeobj_unlock(p_oss);
- goto bail;
- }
- }
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(p_oss));
-
- tsk_safeobj_unlock(p_oss);
- }
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)param;
+ int err;
+ void* p_buffer = ((p_oss->n_bits_per_sample == 8) ? (void*)p_oss->p_buff16_ptr: (void*)p_oss->p_buff_ptr);
+ tsk_size_t n_buffer_in_bytes = (p_oss->n_bits_per_sample == 8) ? p_oss->n_buff16_size_in_bytes : p_oss->n_buff_size_in_bytes;
+ tsk_size_t n_buffer_in_samples = p_oss->n_buff_size_in_samples;
+
+ const void* _p_buffer;
+ tsk_size_t _n_buffer_in_bytes;
+
+ OSS_DEBUG_INFO("__playback_thread -- START");
+
+ tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
+
+ while (p_oss->b_started) {
+ tsk_safeobj_lock(p_oss);
+ err = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(p_oss), p_buffer, n_buffer_in_bytes); // requires 16bits, thread-safe
+ if (err >= 0) {
+ _p_buffer = p_buffer;
+ _n_buffer_in_bytes = n_buffer_in_bytes;
+ if (err < n_buffer_in_bytes) {
+ memset(((uint8_t*)p_buffer) + err, 0, (n_buffer_in_bytes - err));
+ }
+ if (p_oss->n_bits_per_sample == 8) {
+ __oss_from_16bits_to_8bits(p_buffer, p_oss->p_buff_ptr, n_buffer_in_samples);
+ _p_buffer = p_oss->p_buff_ptr;
+ _n_buffer_in_bytes >>= 1;
+ }
+ if ((err = write(p_oss->fd, _p_buffer, _n_buffer_in_bytes)) != _n_buffer_in_bytes) {
+ OSS_DEBUG_ERROR ("Failed to read data from audio interface failed (%d -> %s)", err , strerror(errno));
+ tsk_safeobj_unlock(p_oss);
+ goto bail;
+ }
+ }
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(p_oss));
+
+ tsk_safeobj_unlock(p_oss);
+ }
bail:
- OSS_DEBUG_INFO("__playback_thread -- STOP");
- return tsk_null;
+ OSS_DEBUG_INFO("__playback_thread -- STOP");
+ return tsk_null;
}
/* ============ Media Consumer Interface ================= */
static int tdav_consumer_oss_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
- int ret = 0;
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
+ int ret = 0;
- ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
- return ret;
+ return ret;
}
static int tdav_consumer_oss_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
- int err = 0, channels, sample_rate, bits_per_sample;
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
+ int err = 0, channels, sample_rate, bits_per_sample;
- if (!p_oss || !codec && codec->plugin) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_oss || !codec && codec->plugin) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_oss);
+ tsk_safeobj_lock(p_oss);
- if (p_oss->fd == -1) {
- if ((p_oss->fd = open("/dev/dsp", O_WRONLY)) < 0) {
- OSS_DEBUG_ERROR("open('/dev/dsp') failed: %s", strerror(errno));
- err = -2;
- goto bail;
- }
- }
+ if (p_oss->fd == -1) {
+ if ((p_oss->fd = open("/dev/dsp", O_WRONLY)) < 0) {
+ OSS_DEBUG_ERROR("open('/dev/dsp') failed: %s", strerror(errno));
+ err = -2;
+ goto bail;
+ }
+ }
- TMEDIA_CONSUMER(p_oss)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(p_oss)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
TMEDIA_CONSUMER(p_oss)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
TMEDIA_CONSUMER(p_oss)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- // Set using requested
- channels = TMEDIA_CONSUMER(p_oss)->audio.in.channels;
- sample_rate = TMEDIA_CONSUMER(p_oss)->audio.in.rate;
- bits_per_sample = TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample; // 16
-
- // Prepare
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_BITS, &bits_per_sample)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_BITS, %d) failed: %d->%s", bits_per_sample, err, strerror(errno));
- goto bail;
- }
- if (bits_per_sample != 16 && bits_per_sample != 8) {
- OSS_DEBUG_ERROR("bits_per_sample=%d not supported", bits_per_sample);
- err = -3;
- goto bail;
- }
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_CHANNELS, %d) failed: %d->%s", channels, err, strerror(errno));
- goto bail;
- }
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_RATE, &sample_rate)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_RATE, %d) failed: %d->%s", sample_rate, err, strerror(errno));
- goto bail;
- }
-
- p_oss->n_buff_size_in_bytes = (TMEDIA_CONSUMER(p_oss)->audio.ptime * sample_rate * ((bits_per_sample >> 3) * channels)) / 1000;
- if (!(p_oss->p_buff_ptr = tsk_realloc(p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes))) {
- OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
- err = -4;
- goto bail;
- }
- p_oss->n_buff_size_in_samples = (p_oss->n_buff_size_in_bytes / (bits_per_sample >> 3));
- if (bits_per_sample == 8) {
- p_oss->n_buff16_size_in_bytes = p_oss->n_buff_size_in_bytes << 1;
- if (!(p_oss->p_buff16_ptr = tsk_realloc(p_oss->p_buff16_ptr, p_oss->n_buff16_size_in_bytes))) {
- OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
- err = -5;
- goto bail;
- }
- p_oss->n_buff16_size_in_samples = p_oss->n_buff_size_in_samples;
- }
-
- OSS_DEBUG_INFO("prepared: req_bits_per_sample=%d; req_channels=%d; req_rate=%d, resp_bits_per_sample=%d; resp_channels=%d; resp_rate=%d /// n_buff_size_in_samples=%u;n_buff_size_in_bytes=%u",
- TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample, TMEDIA_CONSUMER(p_oss)->audio.in.channels, TMEDIA_CONSUMER(p_oss)->audio.in.rate,
- bits_per_sample, channels, sample_rate,
- p_oss->n_buff_size_in_samples, p_oss->n_buff_size_in_bytes);
-
- // Set using supported (up to the resampler to convert to requested)
- TMEDIA_CONSUMER(p_oss)->audio.out.channels = channels;
- TMEDIA_CONSUMER(p_oss)->audio.out.rate = sample_rate;
- // TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample = bits_per_sample;
-
- p_oss->n_bits_per_sample = bits_per_sample;
- p_oss->b_prepared = tsk_true;
+
+ // Set using requested
+ channels = TMEDIA_CONSUMER(p_oss)->audio.in.channels;
+ sample_rate = TMEDIA_CONSUMER(p_oss)->audio.in.rate;
+ bits_per_sample = TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample; // 16
+
+ // Prepare
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_BITS, &bits_per_sample)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_BITS, %d) failed: %d->%s", bits_per_sample, err, strerror(errno));
+ goto bail;
+ }
+ if (bits_per_sample != 16 && bits_per_sample != 8) {
+ OSS_DEBUG_ERROR("bits_per_sample=%d not supported", bits_per_sample);
+ err = -3;
+ goto bail;
+ }
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_CHANNELS, %d) failed: %d->%s", channels, err, strerror(errno));
+ goto bail;
+ }
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_RATE, &sample_rate)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_RATE, %d) failed: %d->%s", sample_rate, err, strerror(errno));
+ goto bail;
+ }
+
+ p_oss->n_buff_size_in_bytes = (TMEDIA_CONSUMER(p_oss)->audio.ptime * sample_rate * ((bits_per_sample >> 3) * channels)) / 1000;
+ if (!(p_oss->p_buff_ptr = tsk_realloc(p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes))) {
+ OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
+ err = -4;
+ goto bail;
+ }
+ p_oss->n_buff_size_in_samples = (p_oss->n_buff_size_in_bytes / (bits_per_sample >> 3));
+ if (bits_per_sample == 8) {
+ p_oss->n_buff16_size_in_bytes = p_oss->n_buff_size_in_bytes << 1;
+ if (!(p_oss->p_buff16_ptr = tsk_realloc(p_oss->p_buff16_ptr, p_oss->n_buff16_size_in_bytes))) {
+ OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
+ err = -5;
+ goto bail;
+ }
+ p_oss->n_buff16_size_in_samples = p_oss->n_buff_size_in_samples;
+ }
+
+ OSS_DEBUG_INFO("prepared: req_bits_per_sample=%d; req_channels=%d; req_rate=%d, resp_bits_per_sample=%d; resp_channels=%d; resp_rate=%d /// n_buff_size_in_samples=%u;n_buff_size_in_bytes=%u",
+ TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample, TMEDIA_CONSUMER(p_oss)->audio.in.channels, TMEDIA_CONSUMER(p_oss)->audio.in.rate,
+ bits_per_sample, channels, sample_rate,
+ p_oss->n_buff_size_in_samples, p_oss->n_buff_size_in_bytes);
+
+ // Set using supported (up to the resampler to convert to requested)
+ TMEDIA_CONSUMER(p_oss)->audio.out.channels = channels;
+ TMEDIA_CONSUMER(p_oss)->audio.out.rate = sample_rate;
+ // TMEDIA_CONSUMER(p_oss)->audio.bits_per_sample = bits_per_sample;
+
+ p_oss->n_bits_per_sample = bits_per_sample;
+ p_oss->b_prepared = tsk_true;
bail:
- if (err) {
- if (p_oss->fd != -1) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- }
- tsk_safeobj_unlock(p_oss);
-
- return err;
+ if (err) {
+ if (p_oss->fd != -1) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ }
+ tsk_safeobj_unlock(p_oss);
+
+ return err;
}
static int tdav_consumer_oss_start(tmedia_consumer_t* self)
{
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
- int err = 0;
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
+ int err = 0;
- if (! p_oss) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (! p_oss) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_oss);
+ tsk_safeobj_lock(p_oss);
- if (!p_oss->b_prepared) {
- OSS_DEBUG_WARN("Not prepared");
- err = -2;
- goto bail;
- }
+ if (!p_oss->b_prepared) {
+ OSS_DEBUG_WARN("Not prepared");
+ err = -2;
+ goto bail;
+ }
- if (p_oss->b_started) {
- OSS_DEBUG_WARN("Already started");
- goto bail;
- }
+ if (p_oss->b_started) {
+ OSS_DEBUG_WARN("Already started");
+ goto bail;
+ }
- /* start thread */
- p_oss->b_started = tsk_true;
- tsk_thread_create(&p_oss->tid[0], _tdav_consumer_oss_playback_thread, p_oss);
+ /* start thread */
+ p_oss->b_started = tsk_true;
+ tsk_thread_create(&p_oss->tid[0], _tdav_consumer_oss_playback_thread, p_oss);
- OSS_DEBUG_INFO("started");
+ OSS_DEBUG_INFO("started");
bail:
- tsk_safeobj_unlock(p_oss);
- return err;
+ tsk_safeobj_unlock(p_oss);
+ return err;
}
static int tdav_consumer_oss_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- int err = 0;
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
-
- if (!p_oss || !buffer || !size) {
- OSS_DEBUG_ERROR("Invalid paramter");
- return -1;
- }
-
- //tsk_safeobj_lock(p_oss);
-
- if (!p_oss->b_started) {
- OSS_DEBUG_WARN("Not started");
- err = -2;
- goto bail;
- }
- if ((err = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(p_oss), buffer, size, proto_hdr))/*thread-safe*/) {
- OSS_DEBUG_WARN("Failed to put audio data to the jitter buffer");
- goto bail;
- }
-
+ int err = 0;
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
+
+ if (!p_oss || !buffer || !size) {
+ OSS_DEBUG_ERROR("Invalid paramter");
+ return -1;
+ }
+
+ //tsk_safeobj_lock(p_oss);
+
+ if (!p_oss->b_started) {
+ OSS_DEBUG_WARN("Not started");
+ err = -2;
+ goto bail;
+ }
+ if ((err = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(p_oss), buffer, size, proto_hdr))/*thread-safe*/) {
+ OSS_DEBUG_WARN("Failed to put audio data to the jitter buffer");
+ goto bail;
+ }
+
bail:
- //tsk_safeobj_unlock(p_oss);
- return err;
+ //tsk_safeobj_unlock(p_oss);
+ return err;
}
static int tdav_consumer_oss_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_consumer_oss_stop(tmedia_consumer_t* self)
{
- tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
- int err;
-
- if (!p_oss) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_oss);
-
- /* should be done here */
- p_oss->b_started = tsk_false;
-
- /* stop thread */
- if (p_oss->tid[0]) {
- tsk_thread_join(&(p_oss->tid[0]));
- }
- if (p_oss->fd != -1) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- p_oss->b_prepared = tsk_false;
-
- OSS_DEBUG_INFO("stopped");
-
- tsk_safeobj_unlock(p_oss);
-
- return 0;
+ tdav_consumer_oss_t* p_oss = (tdav_consumer_oss_t*)self;
+ int err;
+
+ if (!p_oss) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_oss);
+
+ /* should be done here */
+ p_oss->b_started = tsk_false;
+
+ /* stop thread */
+ if (p_oss->tid[0]) {
+ tsk_thread_join(&(p_oss->tid[0]));
+ }
+ if (p_oss->fd != -1) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ p_oss->b_prepared = tsk_false;
+
+ OSS_DEBUG_INFO("stopped");
+
+ tsk_safeobj_unlock(p_oss);
+
+ return 0;
}
@@ -329,68 +328,66 @@ static int tdav_consumer_oss_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_oss_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_oss_t *p_oss = self;
- if (p_oss) {
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(p_oss));
- /* init self */
-
- p_oss->fd = -1;
- tsk_safeobj_init(p_oss);
-
- OSS_DEBUG_INFO("created");
- }
- return self;
+ tdav_consumer_oss_t *p_oss = self;
+ if (p_oss) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(p_oss));
+ /* init self */
+
+ p_oss->fd = -1;
+ tsk_safeobj_init(p_oss);
+
+ OSS_DEBUG_INFO("created");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_oss_dtor(tsk_object_t * self)
-{
- tdav_consumer_oss_t *p_oss = self;
- if (p_oss) {
-
- /* stop */
- if (p_oss->b_started) {
- tdav_consumer_oss_stop(self);
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(p_oss));
- /* deinit self */
- if (p_oss->fd > 0) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- TSK_FREE(p_oss->p_buff_ptr);
- TSK_FREE(p_oss->p_buff16_ptr);
- tsk_safeobj_deinit(p_oss);
-
- OSS_DEBUG_INFO("*** destroyed ***");
- }
-
- return self;
+{
+ tdav_consumer_oss_t *p_oss = self;
+ if (p_oss) {
+
+ /* stop */
+ if (p_oss->b_started) {
+ tdav_consumer_oss_stop(self);
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(p_oss));
+ /* deinit self */
+ if (p_oss->fd > 0) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ TSK_FREE(p_oss->p_buff_ptr);
+ TSK_FREE(p_oss->p_buff16_ptr);
+ tsk_safeobj_deinit(p_oss);
+
+ OSS_DEBUG_INFO("*** destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_oss_def_s =
-{
- sizeof(tdav_consumer_oss_t),
- tdav_consumer_oss_ctor,
- tdav_consumer_oss_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_oss_def_s = {
+ sizeof(tdav_consumer_oss_t),
+ tdav_consumer_oss_ctor,
+ tdav_consumer_oss_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_oss_plugin_def_s =
-{
- &tdav_consumer_oss_def_s,
-
- tmedia_audio,
- "Linux OSS consumer",
-
- tdav_consumer_oss_set,
- tdav_consumer_oss_prepare,
- tdav_consumer_oss_start,
- tdav_consumer_oss_consume,
- tdav_consumer_oss_pause,
- tdav_consumer_oss_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_oss_plugin_def_s = {
+ &tdav_consumer_oss_def_s,
+
+ tmedia_audio,
+ "Linux OSS consumer",
+
+ tdav_consumer_oss_set,
+ tdav_consumer_oss_prepare,
+ tdav_consumer_oss_start,
+ tdav_consumer_oss_consume,
+ tdav_consumer_oss_pause,
+ tdav_consumer_oss_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_oss_plugin_def_t = &tdav_consumer_oss_plugin_def_s;
diff --git a/tinyDAV/src/audio/oss/tdav_producer_oss.c b/tinyDAV/src/audio/oss/tdav_producer_oss.c
index d61fb96..61a7afa 100755
--- a/tinyDAV/src/audio/oss/tdav_producer_oss.c
+++ b/tinyDAV/src/audio/oss/tdav_producer_oss.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -39,264 +39,263 @@
#define OSS_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR("[OSS Producer] " FMT, ##__VA_ARGS__)
#define OSS_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[OSS Producer] " FMT, ##__VA_ARGS__)
-typedef struct tdav_producer_oss_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t b_started;
- tsk_bool_t b_prepared;
- tsk_bool_t b_muted;
- int n_bits_per_sample;
-
- int fd;
- tsk_thread_handle_t* tid[1];
-
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- uint8_t* p_buff_ptr;
-
- tsk_size_t n_buff16_size_in_bytes;
- tsk_size_t n_buff16_size_in_samples;
- uint16_t* p_buff16_ptr;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_producer_oss_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t b_started;
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_muted;
+ int n_bits_per_sample;
+
+ int fd;
+ tsk_thread_handle_t* tid[1];
+
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ uint8_t* p_buff_ptr;
+
+ tsk_size_t n_buff16_size_in_bytes;
+ tsk_size_t n_buff16_size_in_samples;
+ uint16_t* p_buff16_ptr;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_producer_oss_t;
static int __oss_from_8bits_to_16bits(const void* p_src, void* p_dst, tsk_size_t n_samples)
{
- tsk_size_t i;
- const uint8_t *_p_src = (const uint8_t*)p_src;
- uint16_t *_p_dst = (uint16_t*)p_dst;
-
- if (!p_src || !p_dst || !n_samples) {
- OSS_DEBUG_ERROR("invalid parameter");
- return -1;
- }
- for (i = 0; i < n_samples; ++i) {
- _p_dst[i] = _p_src[i];
- }
- return 0;
+ tsk_size_t i;
+ const uint8_t *_p_src = (const uint8_t*)p_src;
+ uint16_t *_p_dst = (uint16_t*)p_dst;
+
+ if (!p_src || !p_dst || !n_samples) {
+ OSS_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+ for (i = 0; i < n_samples; ++i) {
+ _p_dst[i] = _p_src[i];
+ }
+ return 0;
}
static void* TSK_STDCALL _tdav_producer_oss_record_thread(void *param)
{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)param;
- int err;
- const void* p_buffer = ((p_oss->n_bits_per_sample == 8) ? (const void*)p_oss->p_buff16_ptr: (const void*)p_oss->p_buff_ptr);
- tsk_size_t n_buffer_in_bytes = (p_oss->n_bits_per_sample == 8) ? p_oss->n_buff16_size_in_bytes : p_oss->n_buff_size_in_bytes;
-
- OSS_DEBUG_INFO("__record_thread -- START");
-
- tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
-
- while (p_oss->b_started) {
- tsk_safeobj_lock(p_oss);
- if ((err = read(p_oss->fd, p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes)) != p_oss->n_buff_size_in_bytes) {
- OSS_DEBUG_ERROR ("Failed to read data from audio interface failed (%d -> %s)", err , strerror(errno));
- tsk_safeobj_unlock(p_oss);
- goto bail;
- }
- if (p_oss->n_bits_per_sample == 8) {
- if ((err = __oss_from_8bits_to_16bits(p_oss->p_buff_ptr, p_oss->p_buff16_ptr, p_oss->n_buff_size_in_samples))) {
- tsk_safeobj_unlock(p_oss);
- goto bail;
- }
- }
- if (!p_oss->b_muted && TMEDIA_PRODUCER(p_oss)->enc_cb.callback) {
- TMEDIA_PRODUCER(p_oss)->enc_cb.callback(TMEDIA_PRODUCER(p_oss)->enc_cb.callback_data, p_buffer, n_buffer_in_bytes);
- }
- tsk_safeobj_unlock(p_oss);
- }
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)param;
+ int err;
+ const void* p_buffer = ((p_oss->n_bits_per_sample == 8) ? (const void*)p_oss->p_buff16_ptr: (const void*)p_oss->p_buff_ptr);
+ tsk_size_t n_buffer_in_bytes = (p_oss->n_bits_per_sample == 8) ? p_oss->n_buff16_size_in_bytes : p_oss->n_buff_size_in_bytes;
+
+ OSS_DEBUG_INFO("__record_thread -- START");
+
+ tsk_thread_set_priority_2(TSK_THREAD_PRIORITY_TIME_CRITICAL);
+
+ while (p_oss->b_started) {
+ tsk_safeobj_lock(p_oss);
+ if ((err = read(p_oss->fd, p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes)) != p_oss->n_buff_size_in_bytes) {
+ OSS_DEBUG_ERROR ("Failed to read data from audio interface failed (%d -> %s)", err , strerror(errno));
+ tsk_safeobj_unlock(p_oss);
+ goto bail;
+ }
+ if (p_oss->n_bits_per_sample == 8) {
+ if ((err = __oss_from_8bits_to_16bits(p_oss->p_buff_ptr, p_oss->p_buff16_ptr, p_oss->n_buff_size_in_samples))) {
+ tsk_safeobj_unlock(p_oss);
+ goto bail;
+ }
+ }
+ if (!p_oss->b_muted && TMEDIA_PRODUCER(p_oss)->enc_cb.callback) {
+ TMEDIA_PRODUCER(p_oss)->enc_cb.callback(TMEDIA_PRODUCER(p_oss)->enc_cb.callback_data, p_buffer, n_buffer_in_bytes);
+ }
+ tsk_safeobj_unlock(p_oss);
+ }
bail:
- OSS_DEBUG_INFO("__record_thread -- STOP");
- return tsk_null;
+ OSS_DEBUG_INFO("__record_thread -- STOP");
+ return tsk_null;
}
/* ============ Media Producer Interface ================= */
static int tdav_producer_oss_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
- if (param->plugin_type == tmedia_ppt_producer) {
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "volume")) {
- return 0;
- }
- else if(tsk_striequals(param->key, "mute")){
- p_oss->b_muted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+{
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+ if (param->plugin_type == tmedia_ppt_producer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "volume")) {
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "mute")) {
+ p_oss->b_muted = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_oss_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
- int err = 0, channels, sample_rate, bits_per_sample;
-
- if (!p_oss || !codec && codec->plugin) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_oss);
-
- if (p_oss->fd == -1) {
- if ((p_oss->fd = open("/dev/dsp", O_RDONLY)) < 0) {
- OSS_DEBUG_ERROR("open('/dev/dsp') failed: %s", strerror(errno));
- err = -2;
- goto bail;
- }
- }
-
- // Set using requested
- channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- sample_rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- bits_per_sample = TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample; // 16
-
- // Prepare
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_BITS, &bits_per_sample)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_BITS, %d) failed: %d->%s", bits_per_sample, err, strerror(errno));
- goto bail;
- }
- if (bits_per_sample != 16 && bits_per_sample != 8) {
- OSS_DEBUG_ERROR("bits_per_sample=%d not supported", bits_per_sample);
- err = -3;
- goto bail;
- }
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_CHANNELS, %d) failed: %d->%s", channels, err, strerror(errno));
- goto bail;
- }
- if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_RATE, &sample_rate)) != 0) {
- OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_RATE, %d) failed: %d->%s", sample_rate, err, strerror(errno));
- goto bail;
- }
-
- p_oss->n_buff_size_in_bytes = (TMEDIA_PRODUCER(p_oss)->audio.ptime * sample_rate * ((bits_per_sample >> 3) * channels)) / 1000;
- if (!(p_oss->p_buff_ptr = tsk_realloc(p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes))) {
- OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
- err = -4;
- goto bail;
- }
- p_oss->n_buff_size_in_samples = (p_oss->n_buff_size_in_bytes / (bits_per_sample >> 3));
- if (bits_per_sample == 8) {
- p_oss->n_buff16_size_in_bytes = p_oss->n_buff_size_in_bytes << 1;
- if (!(p_oss->p_buff16_ptr = tsk_realloc(p_oss->p_buff16_ptr, p_oss->n_buff16_size_in_bytes))) {
- OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
- err = -5;
- goto bail;
- }
- p_oss->n_buff16_size_in_samples = p_oss->n_buff_size_in_samples;
- }
-
- OSS_DEBUG_INFO("prepared: req_bits_per_sample=%d; req_channels=%d; req_rate=%d, resp_bits_per_sample=%d; resp_channels=%d; resp_rate=%d /// n_buff_size_in_samples=%u;n_buff_size_in_bytes=%u",
- TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample, TMEDIA_PRODUCER(p_oss)->audio.channels, TMEDIA_PRODUCER(p_oss)->audio.rate,
- bits_per_sample, channels, sample_rate,
- p_oss->n_buff_size_in_samples, p_oss->n_buff_size_in_bytes);
-
- // Set using supported (up to the resampler to convert to requested)
- TMEDIA_PRODUCER(p_oss)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(p_oss)->audio.channels = channels;
- TMEDIA_PRODUCER(p_oss)->audio.rate = sample_rate;
- // TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample = bits_per_sample;
-
- p_oss->n_bits_per_sample = bits_per_sample;
- p_oss->b_prepared = tsk_true;
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+ int err = 0, channels, sample_rate, bits_per_sample;
+
+ if (!p_oss || !codec && codec->plugin) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_oss);
+
+ if (p_oss->fd == -1) {
+ if ((p_oss->fd = open("/dev/dsp", O_RDONLY)) < 0) {
+ OSS_DEBUG_ERROR("open('/dev/dsp') failed: %s", strerror(errno));
+ err = -2;
+ goto bail;
+ }
+ }
+
+ // Set using requested
+ channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ sample_rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ bits_per_sample = TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample; // 16
+
+ // Prepare
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_BITS, &bits_per_sample)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_BITS, %d) failed: %d->%s", bits_per_sample, err, strerror(errno));
+ goto bail;
+ }
+ if (bits_per_sample != 16 && bits_per_sample != 8) {
+ OSS_DEBUG_ERROR("bits_per_sample=%d not supported", bits_per_sample);
+ err = -3;
+ goto bail;
+ }
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_CHANNELS, %d) failed: %d->%s", channels, err, strerror(errno));
+ goto bail;
+ }
+ if ((err = ioctl(p_oss->fd, SOUND_PCM_WRITE_RATE, &sample_rate)) != 0) {
+ OSS_DEBUG_ERROR("ioctl(SOUND_PCM_WRITE_RATE, %d) failed: %d->%s", sample_rate, err, strerror(errno));
+ goto bail;
+ }
+
+ p_oss->n_buff_size_in_bytes = (TMEDIA_PRODUCER(p_oss)->audio.ptime * sample_rate * ((bits_per_sample >> 3) * channels)) / 1000;
+ if (!(p_oss->p_buff_ptr = tsk_realloc(p_oss->p_buff_ptr, p_oss->n_buff_size_in_bytes))) {
+ OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
+ err = -4;
+ goto bail;
+ }
+ p_oss->n_buff_size_in_samples = (p_oss->n_buff_size_in_bytes / (bits_per_sample >> 3));
+ if (bits_per_sample == 8) {
+ p_oss->n_buff16_size_in_bytes = p_oss->n_buff_size_in_bytes << 1;
+ if (!(p_oss->p_buff16_ptr = tsk_realloc(p_oss->p_buff16_ptr, p_oss->n_buff16_size_in_bytes))) {
+ OSS_DEBUG_ERROR("Failed to allocate buffer with size = %u", p_oss->n_buff_size_in_bytes);
+ err = -5;
+ goto bail;
+ }
+ p_oss->n_buff16_size_in_samples = p_oss->n_buff_size_in_samples;
+ }
+
+ OSS_DEBUG_INFO("prepared: req_bits_per_sample=%d; req_channels=%d; req_rate=%d, resp_bits_per_sample=%d; resp_channels=%d; resp_rate=%d /// n_buff_size_in_samples=%u;n_buff_size_in_bytes=%u",
+ TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample, TMEDIA_PRODUCER(p_oss)->audio.channels, TMEDIA_PRODUCER(p_oss)->audio.rate,
+ bits_per_sample, channels, sample_rate,
+ p_oss->n_buff_size_in_samples, p_oss->n_buff_size_in_bytes);
+
+ // Set using supported (up to the resampler to convert to requested)
+ TMEDIA_PRODUCER(p_oss)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(p_oss)->audio.channels = channels;
+ TMEDIA_PRODUCER(p_oss)->audio.rate = sample_rate;
+ // TMEDIA_PRODUCER(p_oss)->audio.bits_per_sample = bits_per_sample;
+
+ p_oss->n_bits_per_sample = bits_per_sample;
+ p_oss->b_prepared = tsk_true;
bail:
- if (err) {
- if (p_oss->fd != -1) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- }
- tsk_safeobj_unlock(p_oss);
-
- return err;
+ if (err) {
+ if (p_oss->fd != -1) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ }
+ tsk_safeobj_unlock(p_oss);
+
+ return err;
}
static int tdav_producer_oss_start(tmedia_producer_t* self)
{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
- int err = 0;
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+ int err = 0;
- if (! p_oss) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (! p_oss) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_oss);
+ tsk_safeobj_lock(p_oss);
- if (!p_oss->b_prepared) {
- OSS_DEBUG_WARN("Not prepared");
- err = -2;
- goto bail;
- }
+ if (!p_oss->b_prepared) {
+ OSS_DEBUG_WARN("Not prepared");
+ err = -2;
+ goto bail;
+ }
- if (p_oss->b_started) {
- OSS_DEBUG_WARN("Already started");
- goto bail;
- }
+ if (p_oss->b_started) {
+ OSS_DEBUG_WARN("Already started");
+ goto bail;
+ }
- /* start thread */
- p_oss->b_started = tsk_true;
- tsk_thread_create(&p_oss->tid[0], _tdav_producer_oss_record_thread, p_oss);
+ /* start thread */
+ p_oss->b_started = tsk_true;
+ tsk_thread_create(&p_oss->tid[0], _tdav_producer_oss_record_thread, p_oss);
- OSS_DEBUG_INFO("started");
+ OSS_DEBUG_INFO("started");
bail:
- tsk_safeobj_unlock(p_oss);
- return err;
+ tsk_safeobj_unlock(p_oss);
+ return err;
}
static int tdav_producer_oss_pause(tmedia_producer_t* self)
{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+
+ if (!p_oss) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_oss) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- OSS_DEBUG_INFO("paused");
+ OSS_DEBUG_INFO("paused");
- return 0;
+ return 0;
}
static int tdav_producer_oss_stop(tmedia_producer_t* self)
{
- tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
- int err;
-
- if (!p_oss) {
- OSS_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_oss);
-
- /* should be done here */
- p_oss->b_started = tsk_false;
-
- /* stop thread */
- if (p_oss->tid[0]) {
- tsk_thread_join(&(p_oss->tid[0]));
- }
- if (p_oss->fd != -1) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- p_oss->b_prepared = tsk_false;
-
- OSS_DEBUG_INFO("stopped");
-
- tsk_safeobj_unlock(p_oss);
-
- return 0;
+ tdav_producer_oss_t* p_oss = (tdav_producer_oss_t*)self;
+ int err;
+
+ if (!p_oss) {
+ OSS_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_oss);
+
+ /* should be done here */
+ p_oss->b_started = tsk_false;
+
+ /* stop thread */
+ if (p_oss->tid[0]) {
+ tsk_thread_join(&(p_oss->tid[0]));
+ }
+ if (p_oss->fd != -1) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ p_oss->b_prepared = tsk_false;
+
+ OSS_DEBUG_INFO("stopped");
+
+ tsk_safeobj_unlock(p_oss);
+
+ return 0;
}
@@ -306,63 +305,61 @@ static int tdav_producer_oss_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_oss_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_oss_t *p_oss = (tdav_producer_oss_t*)self;
- if (p_oss) {
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(p_oss));
- /* init self */
- p_oss->fd = -1;
- tsk_safeobj_init(p_oss);
- }
- return self;
+ tdav_producer_oss_t *p_oss = (tdav_producer_oss_t*)self;
+ if (p_oss) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(p_oss));
+ /* init self */
+ p_oss->fd = -1;
+ tsk_safeobj_init(p_oss);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_oss_dtor(tsk_object_t * self)
-{
- tdav_producer_oss_t *p_oss = (tdav_producer_oss_t *)self;
- if (p_oss) {
- /* stop */
- if (p_oss->b_started) {
- tdav_producer_oss_stop((tmedia_producer_t*)p_oss);
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(p_oss));
- /* deinit self */
- if (p_oss->fd != -1) {
- close(p_oss->fd);
- p_oss->fd = -1;
- }
- TSK_FREE(p_oss->p_buff_ptr);
- TSK_FREE(p_oss->p_buff16_ptr);
- tsk_safeobj_deinit(p_oss);
-
- OSS_DEBUG_INFO("*** destroyed ***");
- }
-
- return self;
+{
+ tdav_producer_oss_t *p_oss = (tdav_producer_oss_t *)self;
+ if (p_oss) {
+ /* stop */
+ if (p_oss->b_started) {
+ tdav_producer_oss_stop((tmedia_producer_t*)p_oss);
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(p_oss));
+ /* deinit self */
+ if (p_oss->fd != -1) {
+ close(p_oss->fd);
+ p_oss->fd = -1;
+ }
+ TSK_FREE(p_oss->p_buff_ptr);
+ TSK_FREE(p_oss->p_buff16_ptr);
+ tsk_safeobj_deinit(p_oss);
+
+ OSS_DEBUG_INFO("*** destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_oss_def_s =
-{
- sizeof(tdav_producer_oss_t),
- tdav_producer_oss_ctor,
- tdav_producer_oss_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_oss_def_s = {
+ sizeof(tdav_producer_oss_t),
+ tdav_producer_oss_ctor,
+ tdav_producer_oss_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_oss_plugin_def_s =
-{
- &tdav_producer_oss_def_s,
-
- tmedia_audio,
- "Linux OSS producer",
-
- tdav_producer_oss_set,
- tdav_producer_oss_prepare,
- tdav_producer_oss_start,
- tdav_producer_oss_pause,
- tdav_producer_oss_stop
+static const tmedia_producer_plugin_def_t tdav_producer_oss_plugin_def_s = {
+ &tdav_producer_oss_def_s,
+
+ tmedia_audio,
+ "Linux OSS producer",
+
+ tdav_producer_oss_set,
+ tdav_producer_oss_prepare,
+ tdav_producer_oss_start,
+ tdav_producer_oss_pause,
+ tdav_producer_oss_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_oss_plugin_def_t = &tdav_producer_oss_plugin_def_s;
diff --git a/tinyDAV/src/audio/tdav_consumer_audio.c b/tinyDAV/src/audio/tdav_consumer_audio.c
index 73d9688..a07944d 100755
--- a/tinyDAV/src/audio/tdav_consumer_audio.c
+++ b/tinyDAV/src/audio/tdav_consumer_audio.c
@@ -36,7 +36,7 @@
#if TSK_UNDER_WINDOWS
# include <Winsock2.h> // timeval
#elif defined(__SYMBIAN32__)
-# include <_timeval.h>
+# include <_timeval.h>
#else
# include <sys/time.h>
#endif
@@ -51,29 +51,29 @@
/** Initialize audio consumer */
int tdav_consumer_audio_init(tdav_consumer_audio_t* self)
{
- int ret;
+ int ret;
- TSK_DEBUG_INFO("tdav_consumer_audio_init()");
+ TSK_DEBUG_INFO("tdav_consumer_audio_init()");
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* base */
- if ((ret = tmedia_consumer_init(TMEDIA_CONSUMER(self)))){
- return ret;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* base */
+ if ((ret = tmedia_consumer_init(TMEDIA_CONSUMER(self)))) {
+ return ret;
+ }
- /* self (should be update by prepare() by using the codec's info)*/
- TMEDIA_CONSUMER(self)->audio.bits_per_sample = TDAV_BITS_PER_SAMPLE_DEFAULT;
- TMEDIA_CONSUMER(self)->audio.ptime = TDAV_PTIME_DEFAULT;
- TMEDIA_CONSUMER(self)->audio.in.channels = TDAV_CHANNELS_DEFAULT;
- TMEDIA_CONSUMER(self)->audio.in.rate = TDAV_RATE_DEFAULT;
- TMEDIA_CONSUMER(self)->audio.gain = TSK_MIN(tmedia_defaults_get_audio_consumer_gain(), TDAV_AUDIO_GAIN_MAX);
+ /* self (should be update by prepare() by using the codec's info)*/
+ TMEDIA_CONSUMER(self)->audio.bits_per_sample = TDAV_BITS_PER_SAMPLE_DEFAULT;
+ TMEDIA_CONSUMER(self)->audio.ptime = TDAV_PTIME_DEFAULT;
+ TMEDIA_CONSUMER(self)->audio.in.channels = TDAV_CHANNELS_DEFAULT;
+ TMEDIA_CONSUMER(self)->audio.in.rate = TDAV_RATE_DEFAULT;
+ TMEDIA_CONSUMER(self)->audio.gain = TSK_MIN(tmedia_defaults_get_audio_consumer_gain(), TDAV_AUDIO_GAIN_MAX);
- tsk_safeobj_init(self);
+ tsk_safeobj_init(self);
- return 0;
+ return 0;
}
/**
@@ -87,159 +87,160 @@ int tdav_consumer_audio_init(tdav_consumer_audio_t* self)
*/
int tdav_consumer_audio_cmp(const tsk_object_t* consumer1, const tsk_object_t* consumer2)
{
- int ret;
- tsk_subsat_int32_ptr(consumer1, consumer2, &ret);
- return ret;
+ int ret;
+ tsk_subsat_int32_ptr(consumer1, consumer2, &ret);
+ return ret;
}
int tdav_consumer_audio_set(tdav_consumer_audio_t* self, const tmedia_param_t* param)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (param->plugin_type == tmedia_ppt_consumer){
- if (param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "gain")){
- int32_t gain = *((int32_t*)param->value);
- if (gain < TDAV_AUDIO_GAIN_MAX && gain >= 0){
- TMEDIA_CONSUMER(self)->audio.gain = (uint8_t)gain;
- TSK_DEBUG_INFO("audio consumer gain=%u", gain);
- }
- else{
- TSK_DEBUG_ERROR("%u is invalid as gain value", gain);
- return -2;
- }
- }
- else if (tsk_striequals(param->key, "volume")){
- TMEDIA_CONSUMER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
- TMEDIA_CONSUMER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_CONSUMER(self)->audio.volume, 100);
- }
- }
- }
-
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (param->plugin_type == tmedia_ppt_consumer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "gain")) {
+ int32_t gain = *((int32_t*)param->value);
+ if (gain < TDAV_AUDIO_GAIN_MAX && gain >= 0) {
+ TMEDIA_CONSUMER(self)->audio.gain = (uint8_t)gain;
+ TSK_DEBUG_INFO("audio consumer gain=%u", gain);
+ }
+ else {
+ TSK_DEBUG_ERROR("%u is invalid as gain value", gain);
+ return -2;
+ }
+ }
+ else if (tsk_striequals(param->key, "volume")) {
+ TMEDIA_CONSUMER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
+ TMEDIA_CONSUMER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_CONSUMER(self)->audio.volume, 100);
+ }
+ }
+ }
+
+ return 0;
}
/* put data (bytes not shorts) into the jitter buffer (consumers always have ptime of 20ms) */
int tdav_consumer_audio_put(tdav_consumer_audio_t* self, const void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- int ret;
+ int ret;
- if (!self || !data || !self->jitterbuffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !data || !self->jitterbuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
- if (!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened){
- uint32_t rate = TMEDIA_CONSUMER(self)->audio.out.rate ? TMEDIA_CONSUMER(self)->audio.out.rate : TMEDIA_CONSUMER(self)->audio.in.rate;
- uint32_t channels = TMEDIA_CONSUMER(self)->audio.out.channels ? TMEDIA_CONSUMER(self)->audio.out.channels : tmedia_defaults_get_audio_channels_playback();
- if ((ret = tmedia_jitterbuffer_open(self->jitterbuffer, TMEDIA_CONSUMER(self)->audio.ptime, rate, channels))){
- TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
- tsk_safeobj_unlock(self);
- return ret;
- }
- }
+ if (!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened) {
+ uint32_t rate = TMEDIA_CONSUMER(self)->audio.out.rate ? TMEDIA_CONSUMER(self)->audio.out.rate : TMEDIA_CONSUMER(self)->audio.in.rate;
+ uint32_t channels = TMEDIA_CONSUMER(self)->audio.out.channels ? TMEDIA_CONSUMER(self)->audio.out.channels : tmedia_defaults_get_audio_channels_playback();
+ if ((ret = tmedia_jitterbuffer_open(self->jitterbuffer, TMEDIA_CONSUMER(self)->audio.ptime, rate, channels))) {
+ TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
+ tsk_safeobj_unlock(self);
+ return ret;
+ }
+ }
- ret = tmedia_jitterbuffer_put(self->jitterbuffer, (void*)data, data_size, proto_hdr);
+ ret = tmedia_jitterbuffer_put(self->jitterbuffer, (void*)data, data_size, proto_hdr);
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return ret;
+ return ret;
}
/* get data from the jitter buffer (consumers should always have ptime of 20ms) */
tsk_size_t tdav_consumer_audio_get(tdav_consumer_audio_t* self, void* out_data, tsk_size_t out_size)
{
- tsk_size_t ret_size = 0;
- if (!self || !self->jitterbuffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_safeobj_lock(self);
-
- if (!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened){
- int ret;
- uint32_t frame_duration = TMEDIA_CONSUMER(self)->audio.ptime;
- uint32_t rate = TMEDIA_CONSUMER(self)->audio.out.rate ? TMEDIA_CONSUMER(self)->audio.out.rate : TMEDIA_CONSUMER(self)->audio.in.rate;
- uint32_t channels = TMEDIA_CONSUMER(self)->audio.out.channels ? TMEDIA_CONSUMER(self)->audio.out.channels : tmedia_defaults_get_audio_channels_playback();
- if ((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channels))){
- TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
- tsk_safeobj_unlock(self);
- return 0;
- }
- }
- ret_size = tmedia_jitterbuffer_get(TMEDIA_JITTER_BUFFER(self->jitterbuffer), out_data, out_size);
-
- tsk_safeobj_unlock(self);
-
- // denoiser
- if (self->denoise && self->denoise->opened && (self->denoise->echo_supp_enabled || self->denoise->noise_supp_enabled)) {
- if (self->denoise->echo_supp_enabled) {
- // Echo process last frame
- if (self->denoise->playback_frame && self->denoise->playback_frame->size) {
- tmedia_denoise_echo_playback(self->denoise, self->denoise->playback_frame->data, (uint32_t)self->denoise->playback_frame->size);
- }
- if (ret_size){
- // save
- tsk_buffer_copy(self->denoise->playback_frame, 0, out_data, ret_size);
- }
- }
+ tsk_size_t ret_size = 0;
+ if (!self || !self->jitterbuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if (!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened) {
+ int ret;
+ uint32_t frame_duration = TMEDIA_CONSUMER(self)->audio.ptime;
+ uint32_t rate = TMEDIA_CONSUMER(self)->audio.out.rate ? TMEDIA_CONSUMER(self)->audio.out.rate : TMEDIA_CONSUMER(self)->audio.in.rate;
+ uint32_t channels = TMEDIA_CONSUMER(self)->audio.out.channels ? TMEDIA_CONSUMER(self)->audio.out.channels : tmedia_defaults_get_audio_channels_playback();
+ if ((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channels))) {
+ TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
+ tsk_safeobj_unlock(self);
+ return 0;
+ }
+ }
+ ret_size = tmedia_jitterbuffer_get(TMEDIA_JITTER_BUFFER(self->jitterbuffer), out_data, out_size);
+
+ tsk_safeobj_unlock(self);
+
+ // denoiser
+ if (self->denoise && self->denoise->opened && (self->denoise->echo_supp_enabled || self->denoise->noise_supp_enabled)) {
+ if (self->denoise->echo_supp_enabled) {
+ // Echo process last frame
+ if (self->denoise->playback_frame && self->denoise->playback_frame->size) {
+ tmedia_denoise_echo_playback(self->denoise, self->denoise->playback_frame->data, (uint32_t)self->denoise->playback_frame->size);
+ }
+ if (ret_size) {
+ // save
+ tsk_buffer_copy(self->denoise->playback_frame, 0, out_data, ret_size);
+ }
+ }
#if 1 // suppress noise if not supported by remote party's encoder
- // suppress noise
- if (self->denoise->noise_supp_enabled && ret_size) {
- tmedia_denoise_process_playback(self->denoise, out_data, (uint32_t)ret_size);
- }
+ // suppress noise
+ if (self->denoise->noise_supp_enabled && ret_size) {
+ tmedia_denoise_process_playback(self->denoise, out_data, (uint32_t)ret_size);
+ }
#endif
- }
+ }
- return ret_size;
+ return ret_size;
}
int tdav_consumer_audio_tick(tdav_consumer_audio_t* self)
{
- if (!self || !self->jitterbuffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return tmedia_jitterbuffer_tick(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
+ if (!self || !self->jitterbuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return tmedia_jitterbuffer_tick(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
}
/* set denioiser */
void tdav_consumer_audio_set_denoise(tdav_consumer_audio_t* self, struct tmedia_denoise_s* denoise)
{
- tsk_safeobj_lock(self);
- TSK_OBJECT_SAFE_FREE(self->denoise);
- self->denoise = (struct tmedia_denoise_s*)tsk_object_ref(denoise);
- tsk_safeobj_unlock(self);
+ tsk_safeobj_lock(self);
+ TSK_OBJECT_SAFE_FREE(self->denoise);
+ self->denoise = (struct tmedia_denoise_s*)tsk_object_ref(denoise);
+ tsk_safeobj_unlock(self);
}
void tdav_consumer_audio_set_jitterbuffer(tdav_consumer_audio_t* self, struct tmedia_jitterbuffer_s* jitterbuffer)
{
- tsk_safeobj_lock(self);
- TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
- self->jitterbuffer = (struct tmedia_jitterbuffer_s*)tsk_object_ref(jitterbuffer);
- tsk_safeobj_unlock(self);
+ tsk_safeobj_lock(self);
+ TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
+ self->jitterbuffer = (struct tmedia_jitterbuffer_s*)tsk_object_ref(jitterbuffer);
+ tsk_safeobj_unlock(self);
}
/** Reset jitterbuffer */
-int tdav_consumer_audio_reset(tdav_consumer_audio_t* self){
- int ret;
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- ret = tmedia_jitterbuffer_reset(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
- tsk_safeobj_unlock(self);
-
- return ret;
+int tdav_consumer_audio_reset(tdav_consumer_audio_t* self)
+{
+ int ret;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ ret = tmedia_jitterbuffer_reset(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
/* tsk_safeobj_lock(self); */
@@ -248,25 +249,25 @@ int tdav_consumer_audio_reset(tdav_consumer_audio_t* self){
/** DeInitialize audio consumer */
int tdav_consumer_audio_deinit(tdav_consumer_audio_t* self)
{
- int ret;
+ int ret;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* base */
- if ((ret = tmedia_consumer_deinit(TMEDIA_CONSUMER(self)))){
- /* return ret; */
- }
+ /* base */
+ if ((ret = tmedia_consumer_deinit(TMEDIA_CONSUMER(self)))) {
+ /* return ret; */
+ }
- /* self */
- TSK_OBJECT_SAFE_FREE(self->denoise);
- TSK_OBJECT_SAFE_FREE(self->resampler);
- TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
+ /* self */
+ TSK_OBJECT_SAFE_FREE(self->denoise);
+ TSK_OBJECT_SAFE_FREE(self->resampler);
+ TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
- tsk_safeobj_deinit(self);
+ tsk_safeobj_deinit(self);
- return 0;
+ return 0;
}
diff --git a/tinyDAV/src/audio/tdav_jitterbuffer.c b/tinyDAV/src/audio/tdav_jitterbuffer.c
index 4fd1010..b2cd287 100755
--- a/tinyDAV/src/audio/tdav_jitterbuffer.c
+++ b/tinyDAV/src/audio/tdav_jitterbuffer.c
@@ -36,8 +36,8 @@
#include <string.h>
#include <limits.h>
-#define jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0)
-#define jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0)
+#define jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0)
+#define jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0)
#define jb_dbg(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
//public functions
@@ -47,38 +47,40 @@ void jb_reset_all(jitterbuffer *jb);
void jb_destroy(jitterbuffer *jb);
void jb_set_settings(jitterbuffer *jb, jb_settings *settings);
-void jb_get_info(jitterbuffer *jb, jb_info *stats);
-void jb_get_settings(jitterbuffer *jb, jb_settings *settings);
-float jb_guess_mos(float p, long d, int codec);
+void jb_get_info(jitterbuffer *jb, jb_info *stats);
+void jb_get_settings(jitterbuffer *jb, jb_settings *settings);
+float jb_guess_mos(float p, long d, int codec);
int jb_has_frames(jitterbuffer *jb);
-void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now, int codec);
+void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now, int codec);
int jb_get(jitterbuffer *jb, void **data, long now, long interpl);
//private functions
-static void set_default_settings(jitterbuffer *jb);
-static void reset(jitterbuffer *jb);
-static long find_pointer(long *array, long max_index, long value); static void frame_free(jb_frame *frame);
-
-static void put_control(jitterbuffer *jb, void *data, int type, long ts);
-static void put_voice(jitterbuffer *jb, void *data, int type, long ms, long ts, int codec);
-static void put_history(jitterbuffer *jb, long ts, long now, long ms, int codec);
+static void set_default_settings(jitterbuffer *jb);
+static void reset(jitterbuffer *jb);
+static long find_pointer(long *array, long max_index, long value);
+static void frame_free(jb_frame *frame);
+
+static void put_control(jitterbuffer *jb, void *data, int type, long ts);
+static void put_voice(jitterbuffer *jb, void *data, int type, long ms, long ts, int codec);
+static void put_history(jitterbuffer *jb, long ts, long now, long ms, int codec);
static void calculate_info(jitterbuffer *jb, long ts, long now, int codec);
-static int get_control(jitterbuffer *jb, void **data);
-static int get_voice(jitterbuffer *jb, void **data, long now, long interpl);
+static int get_control(jitterbuffer *jb, void **data);
+static int get_voice(jitterbuffer *jb, void **data, long now, long interpl);
static int get_voicecase(jitterbuffer *jb, void **data, long now, long interpl, long diff);
-static int get_next_frametype(jitterbuffer *jb, long ts);
-static long get_next_framets(jitterbuffer *jb);
-static jb_frame *get_frame(jitterbuffer *jb, long ts);
+static int get_next_frametype(jitterbuffer *jb, long ts);
+static long get_next_framets(jitterbuffer *jb);
+static jb_frame *get_frame(jitterbuffer *jb, long ts);
static jb_frame *get_all_frames(jitterbuffer *jb);
//debug...
-static jb_output_function_t warnf, errf, dbgf;
-void jb_setoutput(jb_output_function_t warn, jb_output_function_t err, jb_output_function_t dbg) {
+static jb_output_function_t warnf, errf, dbgf;
+void jb_setoutput(jb_output_function_t warn, jb_output_function_t err, jb_output_function_t dbg)
+{
warnf = warn;
errf = err;
dbgf = dbg;
@@ -90,74 +92,74 @@ void jb_setoutput(jb_output_function_t warn, jb_output_function_t err, jb_output
* return NULL if malloc doesn't work
* else return jb with default_settings.
*/
-jitterbuffer *jb_new()
+jitterbuffer *jb_new()
{
- jitterbuffer *jb;
-
- jb_dbg("N");
- jb = tsk_calloc(1, sizeof(jitterbuffer));
- if (!jb) {
- jb_err("cannot allocate jitterbuffer\n");
- return NULL;
- }
- set_default_settings(jb);
- reset(jb);
- return jb;
+ jitterbuffer *jb;
+
+ jb_dbg("N");
+ jb = tsk_calloc(1, sizeof(jitterbuffer));
+ if (!jb) {
+ jb_err("cannot allocate jitterbuffer\n");
+ return NULL;
+ }
+ set_default_settings(jb);
+ reset(jb);
+ return jb;
}
/***********
- * empty voice messages
- * reset statistics
+ * empty voice messages
+ * reset statistics
* keep the settings
*/
-void jb_reset(jitterbuffer *jb)
+void jb_reset(jitterbuffer *jb)
{
- jb_frame *frame;
-
- jb_dbg("R");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_reset()\n");
- return;
- }
-
- //free voice
- while(jb->voiceframes) {
- frame = get_all_frames(jb);
- frame_free(frame);
- }
- //reset stats
- memset(&(jb->info),0,sizeof(jb_info) );
- // set default settings
- reset(jb);
+ jb_frame *frame;
+
+ jb_dbg("R");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_reset()\n");
+ return;
+ }
+
+ //free voice
+ while(jb->voiceframes) {
+ frame = get_all_frames(jb);
+ frame_free(frame);
+ }
+ //reset stats
+ memset(&(jb->info),0,sizeof(jb_info) );
+ // set default settings
+ reset(jb);
}
/***********
* empty nonvoice messages
* empty voice messages
- * reset statistics
+ * reset statistics
* reset settings to default
*/
-void jb_reset_all(jitterbuffer *jb)
+void jb_reset_all(jitterbuffer *jb)
{
- jb_frame *frame;
-
- jb_dbg("r");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_reset_all()\n");
- return;
- }
-
- // free nonvoice
- while(jb->controlframes) {
- frame = jb->controlframes;
- jb->controlframes = frame->next;
- frame_free(frame);
- }
- // free voice and reset statistics is done by jb_reset
- jb_reset(jb);
- set_default_settings(jb);
+ jb_frame *frame;
+
+ jb_dbg("r");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_reset_all()\n");
+ return;
+ }
+
+ // free nonvoice
+ while(jb->controlframes) {
+ frame = jb->controlframes;
+ jb->controlframes = frame->next;
+ frame_free(frame);
+ }
+ // free voice and reset statistics is done by jb_reset
+ jb_reset(jb);
+ set_default_settings(jb);
}
@@ -166,54 +168,54 @@ void jb_reset_all(jitterbuffer *jb)
* free all the [non]voice frames with reset_all
* free the jitterbuffer
*/
-void jb_destroy(jitterbuffer *jb)
+void jb_destroy(jitterbuffer *jb)
{
- jb_dbg("D");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_destroy()\n");
- return;
- }
-
- jb_reset_all(jb);
- free(jb);
+ jb_dbg("D");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_destroy()\n");
+ return;
+ }
+
+ jb_reset_all(jb);
+ free(jb);
}
/***********
- * Set settings for the jitterbuffer.
+ * Set settings for the jitterbuffer.
* Only if a setting is defined it will be written
* in the jb->settings.
* This means that no setting can be set to zero
*/
-void jb_set_settings(jitterbuffer *jb, jb_settings *settings)
+void jb_set_settings(jitterbuffer *jb, jb_settings *settings)
{
- jb_dbg("S");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_set_settings()\n");
- return;
- }
-
- if (settings->min_jb) {
- jb->settings.min_jb = settings->min_jb;
- }
- if (settings->max_jb) {
- jb->settings.max_jb = settings->max_jb;
- }
- if (settings->max_successive_interp) {
- jb->settings.max_successive_interp = settings->max_successive_interp;
- }
- if (settings->extra_delay) {
- jb->settings.extra_delay = settings->extra_delay;
- }
- if (settings->wait_grow) {
- jb->settings.wait_grow = settings->wait_grow;
- }
- if (settings->wait_shrink) {
- jb->settings.wait_shrink = settings->wait_shrink;
- }
- if (settings->max_diff) {
- jb->settings.max_diff = settings->max_diff;
- }
+ jb_dbg("S");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_set_settings()\n");
+ return;
+ }
+
+ if (settings->min_jb) {
+ jb->settings.min_jb = settings->min_jb;
+ }
+ if (settings->max_jb) {
+ jb->settings.max_jb = settings->max_jb;
+ }
+ if (settings->max_successive_interp) {
+ jb->settings.max_successive_interp = settings->max_successive_interp;
+ }
+ if (settings->extra_delay) {
+ jb->settings.extra_delay = settings->extra_delay;
+ }
+ if (settings->wait_grow) {
+ jb->settings.wait_grow = settings->wait_grow;
+ }
+ if (settings->wait_shrink) {
+ jb->settings.wait_shrink = settings->wait_shrink;
+ }
+ if (settings->max_diff) {
+ jb->settings.max_diff = settings->max_diff;
+ }
}
@@ -223,34 +225,35 @@ void jb_set_settings(jitterbuffer *jb, jb_settings *settings)
* delay and delay_target will be calculated
* *stats = info
*/
-void jb_get_info(jitterbuffer *jb, jb_info *stats)
+void jb_get_info(jitterbuffer *jb, jb_info *stats)
{
- long max_index, pointer;
-
- jb_dbg("I");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_get_info()\n");
- return;
- }
-
- jb->info.delay = jb->current - jb->min;
- jb->info.delay_target = jb->target - jb->min;
-
- //calculate the losspct...
- max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ?
-jb->hist_pointer : JB_HISTORY_SIZE-1;
- if (max_index>1) {
- pointer = find_pointer(&jb->hist_sorted_delay[0], max_index,
-jb->current);
- jb->info.losspct = ((max_index - pointer)*100/max_index);
- if (jb->info.losspct < 0) {
- jb->info.losspct = 0;
- }
- } else {
- jb->info.losspct = 0;
- }
-
- *stats = jb->info;
+ long max_index, pointer;
+
+ jb_dbg("I");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_get_info()\n");
+ return;
+ }
+
+ jb->info.delay = jb->current - jb->min;
+ jb->info.delay_target = jb->target - jb->min;
+
+ //calculate the losspct...
+ max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ?
+ jb->hist_pointer : JB_HISTORY_SIZE-1;
+ if (max_index>1) {
+ pointer = find_pointer(&jb->hist_sorted_delay[0], max_index,
+ jb->current);
+ jb->info.losspct = ((max_index - pointer)*100/max_index);
+ if (jb->info.losspct < 0) {
+ jb->info.losspct = 0;
+ }
+ }
+ else {
+ jb->info.losspct = 0;
+ }
+
+ *stats = jb->info;
}
@@ -258,56 +261,56 @@ jb->current);
* gives the settings for this jitterbuffer
* *settings = settings
*/
-void jb_get_settings(jitterbuffer *jb, jb_settings *settings)
+void jb_get_settings(jitterbuffer *jb, jb_settings *settings)
{
- jb_dbg("S");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_get_settings()\n");
- return;
- }
-
- *settings = jb->settings;
+ jb_dbg("S");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_get_settings()\n");
+ return;
+ }
+
+ *settings = jb->settings;
}
/***********
- * returns an estimate on the MOS with given loss, delay and codec
+ * returns an estimate on the MOS with given loss, delay and codec
* if the formula is not present the default will be used
* please use the JB_CODEC_OTHER if you want to define your own formula
- *
+ *
*/
-float jb_guess_mos(float p, long d, int codec)
+float jb_guess_mos(float p, long d, int codec)
{
- float result;
-
- switch (codec) {
- case JB_CODEC_GSM_EFR:
- result = (4.31f - 0.23f*p - 0.0071f*d);
- break;
-
- case JB_CODEC_G723_1:
- result = (3.99f - 0.16f*p - 0.0071f*d);
- break;
-
- case JB_CODEC_G729:
- case JB_CODEC_G729A:
- result = (4.13f - 0.14f*p - 0.0071f*d);
- break;
+ float result;
+
+ switch (codec) {
+ case JB_CODEC_GSM_EFR:
+ result = (4.31f - 0.23f*p - 0.0071f*d);
+ break;
+
+ case JB_CODEC_G723_1:
+ result = (3.99f - 0.16f*p - 0.0071f*d);
+ break;
+
+ case JB_CODEC_G729:
+ case JB_CODEC_G729A:
+ result = (4.13f - 0.14f*p - 0.0071f*d);
+ break;
case JB_CODEC_G711x_PLC:
- result = (4.42f - 0.087f*p - 0.0071f*d);
- break;
+ result = (4.42f - 0.087f*p - 0.0071f*d);
+ break;
case JB_CODEC_G711x:
- result = (4.42f - 0.63f*p - 0.0071f*d);
- break;
-
+ result = (4.42f - 0.63f*p - 0.0071f*d);
+ break;
+
case JB_CODEC_OTHER:
default:
- result = (4.42f - 0.63f*p - 0.0071f*d);
+ result = (4.42f - 0.63f*p - 0.0071f*d);
- }
- return result;
+ }
+ return result;
}
@@ -316,69 +319,74 @@ float jb_guess_mos(float p, long d, int codec)
*/
int jb_has_frames(jitterbuffer *jb)
{
- jb_dbg("H");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_has_frames()\n");
- return JB_NOJB;
- }
-
- if(jb->controlframes || jb->voiceframes) {
- return JB_OK;
- } else {
- return JB_EMPTY;
- }
+ jb_dbg("H");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_has_frames()\n");
+ return JB_NOJB;
+ }
+
+ if(jb->controlframes || jb->voiceframes) {
+ return JB_OK;
+ }
+ else {
+ return JB_EMPTY;
+ }
}
/***********
- * Put a packet into the jitterbuffers
+ * Put a packet into the jitterbuffers
* Only the timestamps of voicepackets are put in the history
* this because the jitterbuffer only works for voicepackets
* don't put packets twice in history and queue (e.g. transmitting every frame twice)
* keep track of statistics
*/
-void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now, int codec)
-{
- long pointer, max_index;
-
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_put()\n");
- return;
- }
-
- jb->info.frames_received++;
-
- if (type == JB_TYPE_CONTROL) {
- //put the packet into the contol-queue of the jitterbuffer
- jb_dbg("pC");
- put_control(jb,data,type,ts);
-
- } else if (type == JB_TYPE_VOICE) {
- // only add voice that aren't already in the buffer
- max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE-1;
- pointer = find_pointer(&jb->hist_sorted_timestamp[0], max_index, ts);
- if (jb->hist_sorted_timestamp[pointer]==ts) { //timestamp already in queue
- jb_dbg("pT");
- free(data);
- jb->info.frames_dropped_twice++;
- } else { //add
- jb_dbg("pV");
- /* add voicepacket to history */
- put_history(jb,ts,now,ms,codec);
- /*calculate jitterbuffer size*/
- calculate_info(jb, ts, now, codec);
- /*put the packet into the queue of the jitterbuffer*/
- put_voice(jb,data,type,ms,ts,codec);
- }
-
- } else if (type == JB_TYPE_SILENCE){ //silence
- jb_dbg("pS");
- put_voice(jb,data,type,ms,ts,codec);
-
- } else {//should NEVER happen
- jb_err("jb_put(): type not known\n");
- free(data);
- }
+void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now, int codec)
+{
+ long pointer, max_index;
+
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_put()\n");
+ return;
+ }
+
+ jb->info.frames_received++;
+
+ if (type == JB_TYPE_CONTROL) {
+ //put the packet into the contol-queue of the jitterbuffer
+ jb_dbg("pC");
+ put_control(jb,data,type,ts);
+
+ }
+ else if (type == JB_TYPE_VOICE) {
+ // only add voice that aren't already in the buffer
+ max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE-1;
+ pointer = find_pointer(&jb->hist_sorted_timestamp[0], max_index, ts);
+ if (jb->hist_sorted_timestamp[pointer]==ts) { //timestamp already in queue
+ jb_dbg("pT");
+ free(data);
+ jb->info.frames_dropped_twice++;
+ }
+ else { //add
+ jb_dbg("pV");
+ /* add voicepacket to history */
+ put_history(jb,ts,now,ms,codec);
+ /*calculate jitterbuffer size*/
+ calculate_info(jb, ts, now, codec);
+ /*put the packet into the queue of the jitterbuffer*/
+ put_voice(jb,data,type,ms,ts,codec);
+ }
+
+ }
+ else if (type == JB_TYPE_SILENCE) { //silence
+ jb_dbg("pS");
+ put_voice(jb,data,type,ms,ts,codec);
+
+ }
+ else { //should NEVER happen
+ jb_err("jb_put(): type not known\n");
+ free(data);
+ }
}
@@ -389,48 +397,48 @@ void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now,
* returns JB_INTERP if interpolating is required
* returns JB_EMPTY if no voice frame is in the jitterbuffer (only during silence)
*/
-int jb_get(jitterbuffer *jb, void **data, long now, long interpl)
+int jb_get(jitterbuffer *jb, void **data, long now, long interpl)
{
- int result;
-
- jb_dbg("A");
- if (jb == NULL) {
- jb_err("no jitterbuffer in jb_get()\n");
- return JB_NOJB;
- }
-
- result = get_control(jb, data);
- if (result != JB_OK ) { //no control message available maybe there is voice...
- result = get_voice(jb, data, now, interpl);
- }
- return result;
+ int result;
+
+ jb_dbg("A");
+ if (jb == NULL) {
+ jb_err("no jitterbuffer in jb_get()\n");
+ return JB_NOJB;
+ }
+
+ result = get_control(jb, data);
+ if (result != JB_OK ) { //no control message available maybe there is voice...
+ result = get_voice(jb, data, now, interpl);
+ }
+ return result;
}
/***********
- * set all the settings to default
+ * set all the settings to default
*/
-static void set_default_settings(jitterbuffer *jb)
+static void set_default_settings(jitterbuffer *jb)
{
- jb->settings.min_jb = JB_MIN_SIZE;
- jb->settings.max_jb = JB_MAX_SIZE;
- jb->settings.max_successive_interp = JB_MAX_SUCCESSIVE_INTERP;
- jb->settings.extra_delay = JB_ALLOW_EXTRA_DELAY;
- jb->settings.wait_grow = JB_WAIT_GROW;
- jb->settings.wait_shrink = JB_WAIT_SHRINK;
- jb->settings.max_diff = JB_MAX_DIFF;
+ jb->settings.min_jb = JB_MIN_SIZE;
+ jb->settings.max_jb = JB_MAX_SIZE;
+ jb->settings.max_successive_interp = JB_MAX_SUCCESSIVE_INTERP;
+ jb->settings.extra_delay = JB_ALLOW_EXTRA_DELAY;
+ jb->settings.wait_grow = JB_WAIT_GROW;
+ jb->settings.wait_shrink = JB_WAIT_SHRINK;
+ jb->settings.max_diff = JB_MAX_DIFF;
}
/***********
- * reset the jitterbuffer so we can start in silence and
+ * reset the jitterbuffer so we can start in silence and
* we start with a new history
*/
static void reset(jitterbuffer *jb)
{
- jb->hist_pointer = 0; //start over
- jb->silence_begin_ts = 0; //no begin_ts defined
- jb->info.silence =1; //we always start in silence
+ jb->hist_pointer = 0; //start over
+ jb->silence_begin_ts = 0; //no begin_ts defined
+ jb->info.silence =1; //we always start in silence
}
@@ -442,214 +450,221 @@ static void reset(jitterbuffer *jb)
* if value doesn't exist return first pointer where array[low]>value
* int low; //the lowest index being examined
* int max_index; //the highest index being examined
- * int mid; //the middle index between low and max_index.
+ * int mid; //the middle index between low and max_index.
* mid ==(low+max_index)/2
* at the end low is the position of value or where array[low]>value
- */
-static long find_pointer(long *array, long max_index, long value)
+ */
+static long find_pointer(long *array, long max_index, long value)
{
- register long low, mid, high;
- low = 0;
- high = max_index;
- while (low<=high) {
- mid= (low+high)/2;
- if (array[mid] < value) {
- low = mid+1;
- } else {
- high = mid-1;
- }
- }
- while(low < max_index && (array[low]==array[(low+1)]) ) {
- low++;
- }
- return low;
+ register long low, mid, high;
+ low = 0;
+ high = max_index;
+ while (low<=high) {
+ mid= (low+high)/2;
+ if (array[mid] < value) {
+ low = mid+1;
+ }
+ else {
+ high = mid-1;
+ }
+ }
+ while(low < max_index && (array[low]==array[(low+1)]) ) {
+ low++;
+ }
+ return low;
}
/***********
* free the given frame, afterwards the framepointer is undefined
*/
-static void frame_free(jb_frame *frame)
+static void frame_free(jb_frame *frame)
{
- if (frame->data) {
- free(frame->data);
- }
- free(frame);
+ if (frame->data) {
+ free(frame->data);
+ }
+ free(frame);
}
/***********
* put a nonvoice frame into the nonvoice queue
*/
-static void put_control(jitterbuffer *jb, void *data, int type, long ts)
+static void put_control(jitterbuffer *jb, void *data, int type, long ts)
{
- jb_frame *frame, *p;
-
- frame = malloc(sizeof(jb_frame));
- if(!frame) {
- jb_err("cannot allocate frame\n");
- return;
- }
- frame->data = data;
- frame->ts = ts;
- frame->type = type;
- frame->next = NULL;
- data = NULL;//to avoid stealing memory
-
- p = jb->controlframes;
- if (p) { //there are already control messages
- if (ts < p->ts) {
- jb->controlframes = frame;
- frame->next = p;
- } else {
- while (p->next && (ts >=p->next->ts)) {//sort on timestamps! so find place to put...
- p = p->next;
- }
- if (p->next) {
- frame->next = p->next;
- }
- p->next = frame;
- }
- } else {
- jb->controlframes = frame;
- }
+ jb_frame *frame, *p;
+
+ frame = malloc(sizeof(jb_frame));
+ if(!frame) {
+ jb_err("cannot allocate frame\n");
+ return;
+ }
+ frame->data = data;
+ frame->ts = ts;
+ frame->type = type;
+ frame->next = NULL;
+ data = NULL;//to avoid stealing memory
+
+ p = jb->controlframes;
+ if (p) { //there are already control messages
+ if (ts < p->ts) {
+ jb->controlframes = frame;
+ frame->next = p;
+ }
+ else {
+ while (p->next && (ts >=p->next->ts)) {//sort on timestamps! so find place to put...
+ p = p->next;
+ }
+ if (p->next) {
+ frame->next = p->next;
+ }
+ p->next = frame;
+ }
+ }
+ else {
+ jb->controlframes = frame;
+ }
}
/***********
- * put a voice or silence frame into the jitterbuffer
+ * put a voice or silence frame into the jitterbuffer
*/
-static void put_voice(jitterbuffer *jb, void *data, int type, long ms, long ts, int codec)
+static void put_voice(jitterbuffer *jb, void *data, int type, long ms, long ts, int codec)
{
- jb_frame *frame, *p;
- frame = malloc(sizeof(jb_frame));
- if(!frame) {
- jb_err("cannot allocate frame\n");
- return;
- }
-
- frame->data = data;
- frame->ts = ts;
- frame->ms = ms;
- frame->type = type;
- frame->codec = codec;
-
- data = NULL; //to avoid stealing the memory location
- /*
- * frames are a circular list, jb->voiceframes points to to the lowest ts,
- * jb->voiceframes->prev points to the highest ts
- */
- if(!jb->voiceframes) { /* queue is empty */
- jb->voiceframes = frame;
- frame->next = frame;
- frame->prev = frame;
- } else {
- p = jb->voiceframes;
- if(ts < p->prev->ts) { //frame is out of order
- jb->info.frames_ooo++;
- }
- if (ts < p->ts) { //frame is lowest, let voiceframes point to it!
- jb->voiceframes = frame;
- } else {
- while(ts < p->prev->ts ) {
- p = p->prev;
- }
- }
- frame->next = p;
- frame->prev = p->prev;
- frame->next->prev = frame;
- frame->prev->next = frame;
- }
+ jb_frame *frame, *p;
+ frame = malloc(sizeof(jb_frame));
+ if(!frame) {
+ jb_err("cannot allocate frame\n");
+ return;
+ }
+
+ frame->data = data;
+ frame->ts = ts;
+ frame->ms = ms;
+ frame->type = type;
+ frame->codec = codec;
+
+ data = NULL; //to avoid stealing the memory location
+ /*
+ * frames are a circular list, jb->voiceframes points to to the lowest ts,
+ * jb->voiceframes->prev points to the highest ts
+ */
+ if(!jb->voiceframes) { /* queue is empty */
+ jb->voiceframes = frame;
+ frame->next = frame;
+ frame->prev = frame;
+ }
+ else {
+ p = jb->voiceframes;
+ if(ts < p->prev->ts) { //frame is out of order
+ jb->info.frames_ooo++;
+ }
+ if (ts < p->ts) { //frame is lowest, let voiceframes point to it!
+ jb->voiceframes = frame;
+ }
+ else {
+ while(ts < p->prev->ts ) {
+ p = p->prev;
+ }
+ }
+ frame->next = p;
+ frame->prev = p->prev;
+ frame->next->prev = frame;
+ frame->prev->next = frame;
+ }
}
/***********
* puts the timestamps of a received packet in the history of *jb
* for later calculations of the size of jitterbuffer *jb.
- *
- * summary of function:
- * - calculate delay difference
- * - delete old value from hist & sorted_history_delay & sorted_history_timestamp if needed
+ *
+ * summary of function:
+ * - calculate delay difference
+ * - delete old value from hist & sorted_history_delay & sorted_history_timestamp if needed
* - add new value to history & sorted_history_delay & sorted_history_timestamp
- * - we keep sorted_history_delay for calculations
+ * - we keep sorted_history_delay for calculations
* - we keep sorted_history_timestamp for ensuring each timestamp isn't put twice in the buffer.
*/
-static void put_history(jitterbuffer *jb, long ts, long now, long ms, int codec)
+static void put_history(jitterbuffer *jb, long ts, long now, long ms, int codec)
{
- jb_hist_element out, in;
- long max_index, pointer, location;
-
- // max_index is the highest possible index
- max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE-1;
- location = (jb->hist_pointer % JB_HISTORY_SIZE);
-
- // we want to delete a value from the jitterbuffer
- // only when we are through the history.
- if (jb->hist_pointer > JB_HISTORY_SIZE-1) {
- /* the value we need to delete from sorted histories */
- out = jb->hist[location];
- //delete delay from hist_sorted_delay
- pointer = find_pointer(&jb->hist_sorted_delay[0], max_index, out.delay);
- /* move over pointer is the position of kicked*/
- if (pointer<max_index) { //only move if we have something to move
- memmove( &(jb->hist_sorted_delay[pointer]),
- &(jb->hist_sorted_delay[pointer+1]),
- ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
- }
-
- //delete timestamp from hist_sorted_timestamp
- pointer = find_pointer(&jb->hist_sorted_timestamp[0], max_index, out.ts);
- /* move over pointer is the position of kicked*/
- if (pointer<max_index) { //only move if we have something to move
- memmove( &(jb->hist_sorted_timestamp[pointer]),
- &(jb->hist_sorted_timestamp[pointer+1]),
- ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
- }
- }
-
- in.delay = now - ts; //delay of current packet
- in.ts = ts; //timestamp of current packet
- in.ms = ms; //length of current packet
- in.codec = codec; //codec of current packet
-
- /* adding the new delay to the sorted history
- * first special cases:
- * - delay is the first history stamp
- * - delay > highest history stamp
- */
- if (max_index==0 || in.delay >= jb->hist_sorted_delay[max_index-1]) {
- jb->hist_sorted_delay[max_index] = in.delay;
- } else {
- pointer = find_pointer(&jb->hist_sorted_delay[0], (max_index-1), in.delay);
- /* move over and add delay */
- memmove( &(jb->hist_sorted_delay[pointer+1]),
- &(jb->hist_sorted_delay[pointer]),
- ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
- jb->hist_sorted_delay[pointer] = in.delay;
- }
-
- /* adding the new timestamp to the sorted history
- * first special cases:
- * - timestamp is the first history stamp
- * - timestamp > highest history stamp
- */
- if (max_index==0 || in.ts >= jb->hist_sorted_timestamp[max_index-1]) {
- jb->hist_sorted_timestamp[max_index] = in.ts;
- } else {
-
- pointer = find_pointer(&jb->hist_sorted_timestamp[0], (max_index-1), in.ts);
- /* move over and add timestamp */
- memmove( &(jb->hist_sorted_timestamp[pointer+1]),
- &(jb->hist_sorted_timestamp[pointer]),
- ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
- jb->hist_sorted_timestamp[pointer] = in.ts;
- }
-
- /* put the jb_hist_element in the history
- * then increase hist_pointer for next time
- */
- jb->hist[location] = in;
- jb->hist_pointer++;
+ jb_hist_element out, in;
+ long max_index, pointer, location;
+
+ // max_index is the highest possible index
+ max_index = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE-1;
+ location = (jb->hist_pointer % JB_HISTORY_SIZE);
+
+ // we want to delete a value from the jitterbuffer
+ // only when we are through the history.
+ if (jb->hist_pointer > JB_HISTORY_SIZE-1) {
+ /* the value we need to delete from sorted histories */
+ out = jb->hist[location];
+ //delete delay from hist_sorted_delay
+ pointer = find_pointer(&jb->hist_sorted_delay[0], max_index, out.delay);
+ /* move over pointer is the position of kicked*/
+ if (pointer<max_index) { //only move if we have something to move
+ memmove( &(jb->hist_sorted_delay[pointer]),
+ &(jb->hist_sorted_delay[pointer+1]),
+ ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
+ }
+
+ //delete timestamp from hist_sorted_timestamp
+ pointer = find_pointer(&jb->hist_sorted_timestamp[0], max_index, out.ts);
+ /* move over pointer is the position of kicked*/
+ if (pointer<max_index) { //only move if we have something to move
+ memmove( &(jb->hist_sorted_timestamp[pointer]),
+ &(jb->hist_sorted_timestamp[pointer+1]),
+ ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
+ }
+ }
+
+ in.delay = now - ts; //delay of current packet
+ in.ts = ts; //timestamp of current packet
+ in.ms = ms; //length of current packet
+ in.codec = codec; //codec of current packet
+
+ /* adding the new delay to the sorted history
+ * first special cases:
+ * - delay is the first history stamp
+ * - delay > highest history stamp
+ */
+ if (max_index==0 || in.delay >= jb->hist_sorted_delay[max_index-1]) {
+ jb->hist_sorted_delay[max_index] = in.delay;
+ }
+ else {
+ pointer = find_pointer(&jb->hist_sorted_delay[0], (max_index-1), in.delay);
+ /* move over and add delay */
+ memmove( &(jb->hist_sorted_delay[pointer+1]),
+ &(jb->hist_sorted_delay[pointer]),
+ ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
+ jb->hist_sorted_delay[pointer] = in.delay;
+ }
+
+ /* adding the new timestamp to the sorted history
+ * first special cases:
+ * - timestamp is the first history stamp
+ * - timestamp > highest history stamp
+ */
+ if (max_index==0 || in.ts >= jb->hist_sorted_timestamp[max_index-1]) {
+ jb->hist_sorted_timestamp[max_index] = in.ts;
+ }
+ else {
+
+ pointer = find_pointer(&jb->hist_sorted_timestamp[0], (max_index-1), in.ts);
+ /* move over and add timestamp */
+ memmove( &(jb->hist_sorted_timestamp[pointer+1]),
+ &(jb->hist_sorted_timestamp[pointer]),
+ ((JB_HISTORY_SIZE-(pointer+1)) * sizeof(long)) );
+ jb->hist_sorted_timestamp[pointer] = in.ts;
+ }
+
+ /* put the jb_hist_element in the history
+ * then increase hist_pointer for next time
+ */
+ jb->hist[location] = in;
+ jb->hist_pointer++;
}
@@ -659,123 +674,128 @@ static void put_history(jitterbuffer *jb, long ts, long now, long ms, int codec)
* Adaptive Playout Buffer Algorithm for Enhancing Perceived Quality of Streaming Applications
* by: Kouhei Fujimoto & Shingo Ata & Masayuki Murata
* http://www.nal.ics.es.osaka-u.ac.jp/achievements/web2002/pdf/journal/k-fujimo02TSJ-AdaptivePlayoutBuffer.pdf
- *
+ *
* it calculates jitter and minimum delay
* get the best delay for the specified codec
-
+
*/
-static void calculate_info(jitterbuffer *jb, long ts, long now, int codec)
+static void calculate_info(jitterbuffer *jb, long ts, long now, int codec)
{
- long diff, size, max_index, d, d1, d2, n;
- float p, p1, p2, A, B;
- //size = how many items there in the history
- size = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE;
- max_index = size-1;
-
- /*
- * the Inter-Quartile Range can be used for estimating jitter
- * http://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#variable
- * just take the square root of the iqr for jitter
- */
- jb->info.iqr = jb->hist_sorted_delay[max_index*3/4] - jb->hist_sorted_delay[max_index/4];
-
-
- /*
- * The RTP way of calculating jitter.
- * This one is used at the moment, although it is not correct.
- * But in this way the other side understands us.
- */
- diff = now - ts - jb->last_delay;
- if (!jb->last_delay) {
- diff = 0; //this to make sure we won't get odd jitter due first ts.
- }
- jb->last_delay = now - ts;
- if (diff <0){
- diff = -diff;
- }
- jb->info.jitter = jb->info.jitter + (diff - jb->info.jitter)/16;
-
- /* jb->min is minimum delay in hist_sorted_delay, we don't look at the lowest 2% */
- /* because sometimes there are odd delays in there */
- jb->min = jb->hist_sorted_delay[(max_index*2/100)];
-
- /*
- * calculating the preferred size of the jitterbuffer:
- * instead of calculating the optimum delay using the Pareto equation
- * I use look at the array of sorted delays and choose my optimum from there
- * always walk trough a percentage of the history this because imagine following tail:
- * [...., 12, 300, 301 ,302]
- * her we want to discard last three but that won't happen if we won't walk the array
- * the number of frames we walk depends on how scattered the sorted delays are.
- * For that we look at the iqr. The dependencies of the iqr are based on
- * tests we've done here in the lab. But are not optimized.
- */
- //init:
- //the higest delay..
- d = d1= d2 = jb->hist_sorted_delay[max_index]- jb->min;
- A=B=LONG_MIN;
- p = p2 =0;
- n=0;
- p1 = 5; //always look at the top 5%
- if (jb->info.iqr >200) { //with more jitter look at more delays
- p1=25;
- } else if (jb->info.iqr >100) {
- p1=20;
- } else if (jb->info.iqr >50){
- p1=11;
- }
-
- //find the optimum delay..
- while(max_index>10 && (B > A ||p2<p1)) { // By MDI: from ">=" to ">"
- //the packetloss with this delay
- p2 =(n*100.0f/size);
- // estimate MOS-value
- B = jb_guess_mos(p2,d2,codec);
- if (B > A) {
- p = p2;
- d = d2;
- A = B;
- }
- d1 = d2;
- //find next delay != delay so the same delay isn't calculated twice
- //don't look further if we have seen half of the history
- while((d2>=d1) && ((n*2)<max_index) ) {
- n++;
- d2 = jb->hist_sorted_delay[(max_index-n)] - jb->min;
- }
- }
- //the targeted size of the jitterbuffer
- if (jb->settings.min_jb && (jb->settings.min_jb > d) ) {
- jb->target = jb->min + jb->settings.min_jb;
- } else if (jb->settings.max_jb && (jb->settings.max_jb > d) ){
- jb->target = jb->min + jb->settings.max_jb;
- } else {
- jb->target = jb->min + d;
- }
+ long diff, size, max_index, d, d1, d2, n;
+ float p, p1, p2, A, B;
+ //size = how many items there in the history
+ size = (jb->hist_pointer < JB_HISTORY_SIZE) ? jb->hist_pointer : JB_HISTORY_SIZE;
+ max_index = size-1;
+
+ /*
+ * the Inter-Quartile Range can be used for estimating jitter
+ * http://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#variable
+ * just take the square root of the iqr for jitter
+ */
+ jb->info.iqr = jb->hist_sorted_delay[max_index*3/4] - jb->hist_sorted_delay[max_index/4];
+
+
+ /*
+ * The RTP way of calculating jitter.
+ * This one is used at the moment, although it is not correct.
+ * But in this way the other side understands us.
+ */
+ diff = now - ts - jb->last_delay;
+ if (!jb->last_delay) {
+ diff = 0; //this to make sure we won't get odd jitter due first ts.
+ }
+ jb->last_delay = now - ts;
+ if (diff <0) {
+ diff = -diff;
+ }
+ jb->info.jitter = jb->info.jitter + (diff - jb->info.jitter)/16;
+
+ /* jb->min is minimum delay in hist_sorted_delay, we don't look at the lowest 2% */
+ /* because sometimes there are odd delays in there */
+ jb->min = jb->hist_sorted_delay[(max_index*2/100)];
+
+ /*
+ * calculating the preferred size of the jitterbuffer:
+ * instead of calculating the optimum delay using the Pareto equation
+ * I use look at the array of sorted delays and choose my optimum from there
+ * always walk trough a percentage of the history this because imagine following tail:
+ * [...., 12, 300, 301 ,302]
+ * her we want to discard last three but that won't happen if we won't walk the array
+ * the number of frames we walk depends on how scattered the sorted delays are.
+ * For that we look at the iqr. The dependencies of the iqr are based on
+ * tests we've done here in the lab. But are not optimized.
+ */
+ //init:
+ //the higest delay..
+ d = d1= d2 = jb->hist_sorted_delay[max_index]- jb->min;
+ A=B=LONG_MIN;
+ p = p2 =0;
+ n=0;
+ p1 = 5; //always look at the top 5%
+ if (jb->info.iqr >200) { //with more jitter look at more delays
+ p1=25;
+ }
+ else if (jb->info.iqr >100) {
+ p1=20;
+ }
+ else if (jb->info.iqr >50) {
+ p1=11;
+ }
+
+ //find the optimum delay..
+ while(max_index>10 && (B > A ||p2<p1)) { // By MDI: from ">=" to ">"
+ //the packetloss with this delay
+ p2 =(n*100.0f/size);
+ // estimate MOS-value
+ B = jb_guess_mos(p2,d2,codec);
+ if (B > A) {
+ p = p2;
+ d = d2;
+ A = B;
+ }
+ d1 = d2;
+ //find next delay != delay so the same delay isn't calculated twice
+ //don't look further if we have seen half of the history
+ while((d2>=d1) && ((n*2)<max_index) ) {
+ n++;
+ d2 = jb->hist_sorted_delay[(max_index-n)] - jb->min;
+ }
+ }
+ //the targeted size of the jitterbuffer
+ if (jb->settings.min_jb && (jb->settings.min_jb > d) ) {
+ jb->target = jb->min + jb->settings.min_jb;
+ }
+ else if (jb->settings.max_jb && (jb->settings.max_jb > d) ) {
+ jb->target = jb->min + jb->settings.max_jb;
+ }
+ else {
+ jb->target = jb->min + d;
+ }
}
/***********
* if there is a nonvoice frame it will be returned [*data] and the frame
* will be made free
- */
-static int get_control(jitterbuffer *jb, void **data)
+ */
+static int get_control(jitterbuffer *jb, void **data)
{
- jb_frame *frame;
- int result;
-
- frame = jb->controlframes;
- if (frame) {
- jb_dbg("gC");
- *data = frame->data;
- frame->data = NULL;
- jb->controlframes = frame->next;
- frame_free(frame);
- result = JB_OK;
- } else {
- result = JB_NOFRAME;
- }
- return result;
+ jb_frame *frame;
+ int result;
+
+ frame = jb->controlframes;
+ if (frame) {
+ jb_dbg("gC");
+ *data = frame->data;
+ frame->data = NULL;
+ jb->controlframes = frame->next;
+ frame_free(frame);
+ result = JB_OK;
+ }
+ else {
+ result = JB_NOFRAME;
+ }
+ return result;
}
@@ -784,68 +804,72 @@ static int get_control(jitterbuffer *jb, void **data)
* returns JB_NOFRAME if it's no time to play voice and or no frame available
* returns JB_INTERP if interpolating is required
* returns JB_EMPTY if no voice frame is in the jitterbuffer (only during silence)
- *
+ *
* if the next frame is a silence frame we will go in silence-mode
* each new instance of the jitterbuffer will start in silence mode
* in silence mode we will set the jitterbuffer to the size we want
- * when we are not in silence mode get_voicecase will handle the rest.
+ * when we are not in silence mode get_voicecase will handle the rest.
*/
-static int get_voice(jitterbuffer *jb, void **data, long now, long interpl)
+static int get_voice(jitterbuffer *jb, void **data, long now, long interpl)
{
- jb_frame *frame;
- long diff;
- int result;
-
- diff = jb->target - jb->current;
-
- //if the next frame is a silence frame, go in silence mode...
- if((get_next_frametype(jb, now - jb->current) == JB_TYPE_SILENCE) ) {
- jb_dbg("gs");
- frame = get_frame(jb, now - jb->current);
- *data = frame->data;
- frame->data = NULL;
- jb->info.silence =1;
- jb->silence_begin_ts = frame->ts;
- frame_free(frame);
- result = JB_OK;
- } else {
- if(jb->info.silence) { // we are in silence
- /*
- * During silence we can set the jitterbuffer size to the size
- * we want...
- */
- if (diff) {
- jb->current = jb->target;
- }
- frame = get_frame(jb, now - jb->current);
- if (frame) {
- if (jb->silence_begin_ts && frame->ts < jb->silence_begin_ts) {
- jb_dbg("gL");
- /* voice frame is late, next!*/
- jb->info.frames_late++;
- frame_free(frame);
- result = get_voice(jb, data, now, interpl);
- } else {
- jb_dbg("gP");
- /* voice frame */
- jb->info.silence = 0;
- jb->silence_begin_ts = 0;
- jb->next_voice_time = frame->ts + frame->ms;
- jb->info.last_voice_ms = frame->ms;
- *data = frame->data;
- frame->data = NULL;
- frame_free(frame);
- result = JB_OK;
+ jb_frame *frame;
+ long diff;
+ int result;
+
+ diff = jb->target - jb->current;
+
+ //if the next frame is a silence frame, go in silence mode...
+ if((get_next_frametype(jb, now - jb->current) == JB_TYPE_SILENCE) ) {
+ jb_dbg("gs");
+ frame = get_frame(jb, now - jb->current);
+ *data = frame->data;
+ frame->data = NULL;
+ jb->info.silence =1;
+ jb->silence_begin_ts = frame->ts;
+ frame_free(frame);
+ result = JB_OK;
+ }
+ else {
+ if(jb->info.silence) { // we are in silence
+ /*
+ * During silence we can set the jitterbuffer size to the size
+ * we want...
+ */
+ if (diff) {
+ jb->current = jb->target;
+ }
+ frame = get_frame(jb, now - jb->current);
+ if (frame) {
+ if (jb->silence_begin_ts && frame->ts < jb->silence_begin_ts) {
+ jb_dbg("gL");
+ /* voice frame is late, next!*/
+ jb->info.frames_late++;
+ frame_free(frame);
+ result = get_voice(jb, data, now, interpl);
+ }
+ else {
+ jb_dbg("gP");
+ /* voice frame */
+ jb->info.silence = 0;
+ jb->silence_begin_ts = 0;
+ jb->next_voice_time = frame->ts + frame->ms;
+ jb->info.last_voice_ms = frame->ms;
+ *data = frame->data;
+ frame->data = NULL;
+ frame_free(frame);
+ result = JB_OK;
+ }
+ }
+ else { //no frame
+ jb_dbg("gS");
+ result = JB_EMPTY;
+ }
+ }
+ else { //voice case
+ result = get_voicecase(jb,data,now,interpl,diff);
}
- } else { //no frame
- jb_dbg("gS");
- result = JB_EMPTY;
- }
- } else { //voice case
- result = get_voicecase(jb,data,now,interpl,diff);
- }
- }
- return result;
+ }
+ return result;
}
@@ -856,117 +880,125 @@ static int get_voice(jitterbuffer *jb, void **data, long now, long interpl)
* - diff < 0, we may need to shrink
* - everything else
*/
-static int get_voicecase(jitterbuffer *jb, void **data, long now, long interpl, long diff)
+static int get_voicecase(jitterbuffer *jb, void **data, long now, long interpl, long diff)
{
- jb_frame *frame;
- int result;
-
- // * - difference is way off, reset
- if (diff > jb->settings.max_diff || -diff > jb->settings.max_diff) {
- jb_err("wakko diff in get_voicecase\n");
- reset(jb); //reset hist because the timestamps are wakko.
- result = JB_NOFRAME;
- //- diff > 0, we may need to grow
- } else if ((diff > 0) &&
- (now > (jb->last_adjustment + jb->settings.wait_grow)
- || (now + jb->current + interpl) < get_next_framets(jb) ) ) { //grow
- /* first try to grow */
- if (diff<interpl/2) {
- jb_dbg("ag");
- jb->current +=diff;
- } else {
- jb_dbg("aG");
- /* grow by interp frame len */
- jb->current += interpl;
- }
- jb->last_adjustment = now;
- result = get_voice(jb, data, now, interpl);
- //- diff < 0, we may need to shrink
- } else if ( (diff < 0)
- && (now > (jb->last_adjustment + jb->settings.wait_shrink))
- && ((-diff) > jb->settings.extra_delay) ) {
- /* now try to shrink
- * if there is a frame shrink by frame length
- * otherwise shrink by interpl
- */
- jb->last_adjustment = now;
-
- frame = get_frame(jb, now - jb->current);
- if(frame) {
- jb_dbg("as");
- /* shrink by frame size we're throwing out */
- jb->info.frames_dropped++;
- jb->current -= frame->ms;
- frame_free(frame);
- } else {
- jb_dbg("aS");
- /* shrink by interpl */
- jb->current -= interpl;
- }
- result = get_voice(jb, data, now, interpl);
- } else {
- /* if it is not the time to play a result = JB_NOFRAME
- * else We try to play a frame if a frame is available
- * and not late it is played otherwise
- * if available it is dropped and the next is tried
- * last option is interpolating
- */
- if (now - jb->current < jb->next_voice_time) {
- jb_dbg("aN");
- result = JB_NOFRAME;
- } else {
- frame = get_frame(jb, now - jb->current);
- if (frame) { //there is a frame
- /* voice frame is late */
- if(frame->ts < jb->next_voice_time) { //late
- jb_dbg("aL");
- jb->info.frames_late++;
- frame_free(frame);
- result = get_voice(jb, data, now, interpl);
- } else {
- jb_dbg("aP");
- /* normal case; return the frame, increment stuff */
- *data = frame->data;
- frame->data = NULL;
- jb->next_voice_time = frame->ts + frame->ms;
- jb->cnt_successive_interp = 0;
- frame_free(frame);
- result = JB_OK;
+ jb_frame *frame;
+ int result;
+
+ // * - difference is way off, reset
+ if (diff > jb->settings.max_diff || -diff > jb->settings.max_diff) {
+ jb_err("wakko diff in get_voicecase\n");
+ reset(jb); //reset hist because the timestamps are wakko.
+ result = JB_NOFRAME;
+ //- diff > 0, we may need to grow
+ }
+ else if ((diff > 0) &&
+ (now > (jb->last_adjustment + jb->settings.wait_grow)
+ || (now + jb->current + interpl) < get_next_framets(jb) ) ) { //grow
+ /* first try to grow */
+ if (diff<interpl/2) {
+ jb_dbg("ag");
+ jb->current +=diff;
}
- } else { // no frame, thus interpolate
- jb->cnt_successive_interp++;
- /* assume silence instead of continuing to interpolate */
- if (jb->settings.max_successive_interp && jb->cnt_successive_interp >= jb->settings.max_successive_interp) {
- jb->info.silence = 1;
- jb->silence_begin_ts = jb->next_voice_time;
+ else {
+ jb_dbg("aG");
+ /* grow by interp frame len */
+ jb->current += interpl;
}
- jb_dbg("aI");
- jb->next_voice_time += interpl;
- result = JB_INTERP;
- }
+ jb->last_adjustment = now;
+ result = get_voice(jb, data, now, interpl);
+ //- diff < 0, we may need to shrink
}
- }
- return result;
+ else if ( (diff < 0)
+ && (now > (jb->last_adjustment + jb->settings.wait_shrink))
+ && ((-diff) > jb->settings.extra_delay) ) {
+ /* now try to shrink
+ * if there is a frame shrink by frame length
+ * otherwise shrink by interpl
+ */
+ jb->last_adjustment = now;
+
+ frame = get_frame(jb, now - jb->current);
+ if(frame) {
+ jb_dbg("as");
+ /* shrink by frame size we're throwing out */
+ jb->info.frames_dropped++;
+ jb->current -= frame->ms;
+ frame_free(frame);
+ }
+ else {
+ jb_dbg("aS");
+ /* shrink by interpl */
+ jb->current -= interpl;
+ }
+ result = get_voice(jb, data, now, interpl);
+ }
+ else {
+ /* if it is not the time to play a result = JB_NOFRAME
+ * else We try to play a frame if a frame is available
+ * and not late it is played otherwise
+ * if available it is dropped and the next is tried
+ * last option is interpolating
+ */
+ if (now - jb->current < jb->next_voice_time) {
+ jb_dbg("aN");
+ result = JB_NOFRAME;
+ }
+ else {
+ frame = get_frame(jb, now - jb->current);
+ if (frame) { //there is a frame
+ /* voice frame is late */
+ if(frame->ts < jb->next_voice_time) { //late
+ jb_dbg("aL");
+ jb->info.frames_late++;
+ frame_free(frame);
+ result = get_voice(jb, data, now, interpl);
+ }
+ else {
+ jb_dbg("aP");
+ /* normal case; return the frame, increment stuff */
+ *data = frame->data;
+ frame->data = NULL;
+ jb->next_voice_time = frame->ts + frame->ms;
+ jb->cnt_successive_interp = 0;
+ frame_free(frame);
+ result = JB_OK;
+ }
+ }
+ else { // no frame, thus interpolate
+ jb->cnt_successive_interp++;
+ /* assume silence instead of continuing to interpolate */
+ if (jb->settings.max_successive_interp && jb->cnt_successive_interp >= jb->settings.max_successive_interp) {
+ jb->info.silence = 1;
+ jb->silence_begin_ts = jb->next_voice_time;
+ }
+ jb_dbg("aI");
+ jb->next_voice_time += interpl;
+ result = JB_INTERP;
+ }
+ }
+ }
+ return result;
}
/***********
- * if there are frames and next frame->ts is smaller or equal ts
+ * if there are frames and next frame->ts is smaller or equal ts
* return type of next frame.
* else return 0
*/
-static int get_next_frametype(jitterbuffer *jb, long ts)
+static int get_next_frametype(jitterbuffer *jb, long ts)
{
- jb_frame *frame;
- int result;
-
- result = 0;
- frame = jb->voiceframes;
- if (frame && frame->ts <= ts) {
- result = frame->type;
- }
- return result;
+ jb_frame *frame;
+ int result;
+
+ result = 0;
+ frame = jb->voiceframes;
+ if (frame && frame->ts <= ts) {
+ result = frame->type;
+ }
+ return result;
}
@@ -974,62 +1006,64 @@ static int get_next_frametype(jitterbuffer *jb, long ts)
* returns ts from next frame in jb->voiceframes
* or returns LONG_MAX if there is no frame
*/
-static long get_next_framets(jitterbuffer *jb)
+static long get_next_framets(jitterbuffer *jb)
{
- if (jb->voiceframes) {
- return jb->voiceframes->ts;
- }
- return LONG_MAX;
+ if (jb->voiceframes) {
+ return jb->voiceframes->ts;
+ }
+ return LONG_MAX;
}
/***********
- * if there is a frame in jb->voiceframes and
+ * if there is a frame in jb->voiceframes and
* has a timestamp smaller/equal to ts
- * this frame will be returned and
+ * this frame will be returned and
* removed from the queue
*/
-static jb_frame *get_frame(jitterbuffer *jb, long ts)
+static jb_frame *get_frame(jitterbuffer *jb, long ts)
{
- jb_frame *frame;
-
- frame = jb->voiceframes;
- if (frame && frame->ts <= ts) {
- if(frame->next == frame) {
- jb->voiceframes = NULL;
- } else {
- /* remove this frame */
- frame->prev->next = frame->next;
- frame->next->prev = frame->prev;
- jb->voiceframes = frame->next;
- }
- return frame;
- }
- return NULL;
+ jb_frame *frame;
+
+ frame = jb->voiceframes;
+ if (frame && frame->ts <= ts) {
+ if(frame->next == frame) {
+ jb->voiceframes = NULL;
+ }
+ else {
+ /* remove this frame */
+ frame->prev->next = frame->next;
+ frame->next->prev = frame->prev;
+ jb->voiceframes = frame->next;
+ }
+ return frame;
+ }
+ return NULL;
}
/***********
* if there is a frame in jb->voiceframes
- * this frame will be unconditionally returned and
+ * this frame will be unconditionally returned and
* removed from the queue
*/
-static jb_frame *get_all_frames(jitterbuffer *jb)
+static jb_frame *get_all_frames(jitterbuffer *jb)
{
- jb_frame *frame;
-
- frame = jb->voiceframes;
- if (frame) {
- if(frame->next == frame) {
- jb->voiceframes = NULL;
- } else {
- /* remove this frame */
- frame->prev->next = frame->next;
- frame->next->prev = frame->prev;
- jb->voiceframes = frame->next;
- }
- return frame;
- }
- return NULL;
+ jb_frame *frame;
+
+ frame = jb->voiceframes;
+ if (frame) {
+ if(frame->next == frame) {
+ jb->voiceframes = NULL;
+ }
+ else {
+ /* remove this frame */
+ frame->prev->next = frame->next;
+ frame->next->prev = frame->prev;
+ jb->voiceframes = frame->next;
+ }
+ return frame;
+ }
+ return NULL;
}
diff --git a/tinyDAV/src/audio/tdav_producer_audio.c b/tinyDAV/src/audio/tdav_producer_audio.c
index 8c73c9f..1c7e779 100755
--- a/tinyDAV/src/audio/tdav_producer_audio.c
+++ b/tinyDAV/src/audio/tdav_producer_audio.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,25 +45,25 @@
*/
int tdav_producer_audio_init(tdav_producer_audio_t* self)
{
- int ret;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* base */
- if((ret = tmedia_producer_init(TMEDIA_PRODUCER(self)))){
- return ret;
- }
-
- /* self (should be update by prepare() by using the codec's info)*/
- TMEDIA_PRODUCER(self)->audio.bits_per_sample = TDAV_PRODUCER_BITS_PER_SAMPLE_DEFAULT;
- TMEDIA_PRODUCER(self)->audio.channels = TDAV_PRODUCER_CHANNELS_DEFAULT;
- TMEDIA_PRODUCER(self)->audio.rate = TDAV_PRODUCER_RATE_DEFAULT;
- TMEDIA_PRODUCER(self)->audio.ptime = TDAV_PRODUCER_PTIME_DEFAULT;
- TMEDIA_PRODUCER(self)->audio.gain = TSK_MIN(tmedia_defaults_get_audio_producer_gain(), TDAV_PRODUCER_AUDIO_GAIN_MAX);
-
- return 0;
+ int ret;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* base */
+ if((ret = tmedia_producer_init(TMEDIA_PRODUCER(self)))) {
+ return ret;
+ }
+
+ /* self (should be update by prepare() by using the codec's info)*/
+ TMEDIA_PRODUCER(self)->audio.bits_per_sample = TDAV_PRODUCER_BITS_PER_SAMPLE_DEFAULT;
+ TMEDIA_PRODUCER(self)->audio.channels = TDAV_PRODUCER_CHANNELS_DEFAULT;
+ TMEDIA_PRODUCER(self)->audio.rate = TDAV_PRODUCER_RATE_DEFAULT;
+ TMEDIA_PRODUCER(self)->audio.ptime = TDAV_PRODUCER_PTIME_DEFAULT;
+ TMEDIA_PRODUCER(self)->audio.gain = TSK_MIN(tmedia_defaults_get_audio_producer_gain(), TDAV_PRODUCER_AUDIO_GAIN_MAX);
+
+ return 0;
}
/**
@@ -77,57 +77,57 @@ int tdav_producer_audio_init(tdav_producer_audio_t* self)
*/
int tdav_producer_audio_cmp(const tsk_object_t* producer1, const tsk_object_t* producer2)
{
- int ret;
- tsk_subsat_int32_ptr(producer1, producer2, &ret);
- return ret;
+ int ret;
+ tsk_subsat_int32_ptr(producer1, producer2, &ret);
+ return ret;
}
int tdav_producer_audio_set(tdav_producer_audio_t* self, const tmedia_param_t* param)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->plugin_type == tmedia_ppt_producer){
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "gain")){
- int32_t gain = *((int32_t*)param->value);
- if(gain<TDAV_PRODUCER_AUDIO_GAIN_MAX && gain>=0){
- TMEDIA_PRODUCER(self)->audio.gain = (uint8_t)gain;
- TSK_DEBUG_INFO("audio producer gain=%u", gain);
- }
- else{
- TSK_DEBUG_ERROR("%u is invalid as gain value", gain);
- return -2;
- }
- }
- else if(tsk_striequals(param->key, "volume")){
- TMEDIA_PRODUCER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
- TMEDIA_PRODUCER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_PRODUCER(self)->audio.volume, 100);
- TSK_DEBUG_INFO("audio producer volume=%u", TMEDIA_PRODUCER(self)->audio.volume);
- }
- }
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->plugin_type == tmedia_ppt_producer) {
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "gain")) {
+ int32_t gain = *((int32_t*)param->value);
+ if(gain<TDAV_PRODUCER_AUDIO_GAIN_MAX && gain>=0) {
+ TMEDIA_PRODUCER(self)->audio.gain = (uint8_t)gain;
+ TSK_DEBUG_INFO("audio producer gain=%u", gain);
+ }
+ else {
+ TSK_DEBUG_ERROR("%u is invalid as gain value", gain);
+ return -2;
+ }
+ }
+ else if(tsk_striequals(param->key, "volume")) {
+ TMEDIA_PRODUCER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
+ TMEDIA_PRODUCER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_PRODUCER(self)->audio.volume, 100);
+ TSK_DEBUG_INFO("audio producer volume=%u", TMEDIA_PRODUCER(self)->audio.volume);
+ }
+ }
+ }
+
+ return 0;
}
/** Deinitialize a producer
*/
int tdav_producer_audio_deinit(tdav_producer_audio_t* self)
{
- int ret;
+ int ret;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* base */
- if((ret = tmedia_producer_deinit(TMEDIA_PRODUCER(self)))){
- return ret;
- }
+ /* base */
+ if((ret = tmedia_producer_deinit(TMEDIA_PRODUCER(self)))) {
+ return ret;
+ }
- return ret;
+ return ret;
} \ No newline at end of file
diff --git a/tinyDAV/src/audio/tdav_session_audio.c b/tinyDAV/src/audio/tdav_session_audio.c
index f12e801..31c9b34 100755
--- a/tinyDAV/src/audio/tdav_session_audio.c
+++ b/tinyDAV/src/audio/tdav_session_audio.c
@@ -51,14 +51,13 @@ static void _tdav_session_audio_apply_gain(void* buffer, int len, int bps, int g
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size);
/* DTMF event object */
-typedef struct tdav_session_audio_dtmfe_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tdav_session_audio_dtmfe_s {
+ TSK_DECLARE_OBJECT;
- tsk_timer_id_t timer_id;
- trtp_rtp_packet_t* packet;
+ tsk_timer_id_t timer_id;
+ trtp_rtp_packet_t* packet;
- const tdav_session_audio_t* session;
+ const tdav_session_audio_t* session;
}
tdav_session_audio_dtmfe_t;
extern const tsk_object_def_t *tdav_session_audio_dtmfe_def_t;
@@ -66,230 +65,230 @@ extern const tsk_object_def_t *tdav_session_audio_dtmfe_def_t;
// RTP/RTCP callback (From the network to the consumer)
static int tdav_session_audio_rtp_cb(const void* callback_data, const struct trtp_rtp_packet_s* packet)
{
- tdav_session_audio_t* audio = (tdav_session_audio_t*)callback_data;
- tmedia_codec_t* codec = tsk_null;
- tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
- int ret = -1;
-
- if (!audio || !packet || !packet->header) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if (audio->is_started && base->consumer && base->consumer->is_started) {
- tsk_size_t out_size = 0;
-
- // Find the codec to use to decode the RTP payload
- if (!audio->decoder.codec || audio->decoder.payload_type != packet->header->payload_type) {
- tsk_istr_t format;
- TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
- tsk_itoa(packet->header->payload_type, &format);
- if (!(audio->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(audio)->neg_codecs, format)) || !audio->decoder.codec->plugin || !audio->decoder.codec->plugin->decode){
- TSK_DEBUG_ERROR("%s is not a valid payload for this session", format);
- ret = -2;
- goto bail;
- }
- audio->decoder.payload_type = packet->header->payload_type;
- }
- // ref() the codec to be able to use it short time after stop(SAFE_FREE(codec))
- if (!(codec = tsk_object_ref(TSK_OBJECT(audio->decoder.codec)))) {
- TSK_DEBUG_ERROR("Failed to get decoder codec");
- goto bail;
- }
-
- // Open codec if not already done
- if (!TMEDIA_CODEC(codec)->opened) {
- tsk_safeobj_lock(base);
- if ((ret = tmedia_codec_open(codec))) {
- tsk_safeobj_unlock(base);
- TSK_DEBUG_ERROR("Failed to open [%s] codec", codec->plugin->desc);
- TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
- goto bail;
- }
- tsk_safeobj_unlock(base);
- }
- // Decode data
- out_size = codec->plugin->decode(codec, packet->payload.data, packet->payload.size, &audio->decoder.buffer, &audio->decoder.buffer_size, packet->header);
- if (out_size && audio->is_started) { // check "is_started" again ...to be sure stop() not called by another thread
- void* buffer = audio->decoder.buffer;
- tsk_size_t size = out_size;
-
- // resample if needed
- if ((base->consumer->audio.out.rate && base->consumer->audio.out.rate != codec->in.rate) || (base->consumer->audio.out.channels && base->consumer->audio.out.channels != TMEDIA_CODEC_AUDIO(codec)->in.channels)) {
- tsk_size_t resampler_result_size = 0;
- int bytesPerSample = (base->consumer->audio.bits_per_sample >> 3);
-
- if (!audio->decoder.resampler.instance) {
- TSK_DEBUG_INFO("Create audio resampler(%s) for consumer: rate=%d->%d, channels=%d->%d, bytesPerSample=%d",
- codec->plugin->desc,
- codec->in.rate, base->consumer->audio.out.rate,
- TMEDIA_CODEC_AUDIO(codec)->in.channels, base->consumer->audio.out.channels,
- bytesPerSample);
- audio->decoder.resampler.instance = _tdav_session_audio_resampler_create(
- bytesPerSample,
- codec->in.rate, base->consumer->audio.out.rate,
- base->consumer->audio.ptime,
- TMEDIA_CODEC_AUDIO(codec)->in.channels, base->consumer->audio.out.channels,
- TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY,
- &audio->decoder.resampler.buffer, &audio->decoder.resampler.buffer_size
- );
- }
- if (!audio->decoder.resampler.instance) {
- TSK_DEBUG_ERROR("No resampler to handle data");
- ret = -5;
- goto bail;
- }
- if (!(resampler_result_size = tmedia_resampler_process(audio->decoder.resampler.instance, buffer, size / bytesPerSample, audio->decoder.resampler.buffer, audio->decoder.resampler.buffer_size / bytesPerSample))){
- TSK_DEBUG_ERROR("Failed to process audio resampler input buffer");
- ret = -6;
- goto bail;
- }
-
- buffer = audio->decoder.resampler.buffer;
- size = audio->decoder.resampler.buffer_size;
- }
-
- // adjust the gain
- if (base->consumer->audio.gain) {
- _tdav_session_audio_apply_gain(buffer, (int)size, base->consumer->audio.bits_per_sample, base->consumer->audio.gain);
- }
- // consume the frame
- tmedia_consumer_consume(base->consumer, buffer, size, packet->header);
- }
- }
- else {
- TSK_DEBUG_INFO("Session audio not ready");
- }
-
- // everything is ok
- ret = 0;
+ tdav_session_audio_t* audio = (tdav_session_audio_t*)callback_data;
+ tmedia_codec_t* codec = tsk_null;
+ tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+ int ret = -1;
+
+ if (!audio || !packet || !packet->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if (audio->is_started && base->consumer && base->consumer->is_started) {
+ tsk_size_t out_size = 0;
+
+ // Find the codec to use to decode the RTP payload
+ if (!audio->decoder.codec || audio->decoder.payload_type != packet->header->payload_type) {
+ tsk_istr_t format;
+ TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
+ tsk_itoa(packet->header->payload_type, &format);
+ if (!(audio->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(audio)->neg_codecs, format)) || !audio->decoder.codec->plugin || !audio->decoder.codec->plugin->decode) {
+ TSK_DEBUG_ERROR("%s is not a valid payload for this session", format);
+ ret = -2;
+ goto bail;
+ }
+ audio->decoder.payload_type = packet->header->payload_type;
+ }
+ // ref() the codec to be able to use it short time after stop(SAFE_FREE(codec))
+ if (!(codec = tsk_object_ref(TSK_OBJECT(audio->decoder.codec)))) {
+ TSK_DEBUG_ERROR("Failed to get decoder codec");
+ goto bail;
+ }
+
+ // Open codec if not already done
+ if (!TMEDIA_CODEC(codec)->opened) {
+ tsk_safeobj_lock(base);
+ if ((ret = tmedia_codec_open(codec))) {
+ tsk_safeobj_unlock(base);
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", codec->plugin->desc);
+ TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
+ goto bail;
+ }
+ tsk_safeobj_unlock(base);
+ }
+ // Decode data
+ out_size = codec->plugin->decode(codec, packet->payload.data, packet->payload.size, &audio->decoder.buffer, &audio->decoder.buffer_size, packet->header);
+ if (out_size && audio->is_started) { // check "is_started" again ...to be sure stop() not called by another thread
+ void* buffer = audio->decoder.buffer;
+ tsk_size_t size = out_size;
+
+ // resample if needed
+ if ((base->consumer->audio.out.rate && base->consumer->audio.out.rate != codec->in.rate) || (base->consumer->audio.out.channels && base->consumer->audio.out.channels != TMEDIA_CODEC_AUDIO(codec)->in.channels)) {
+ tsk_size_t resampler_result_size = 0;
+ int bytesPerSample = (base->consumer->audio.bits_per_sample >> 3);
+
+ if (!audio->decoder.resampler.instance) {
+ TSK_DEBUG_INFO("Create audio resampler(%s) for consumer: rate=%d->%d, channels=%d->%d, bytesPerSample=%d",
+ codec->plugin->desc,
+ codec->in.rate, base->consumer->audio.out.rate,
+ TMEDIA_CODEC_AUDIO(codec)->in.channels, base->consumer->audio.out.channels,
+ bytesPerSample);
+ audio->decoder.resampler.instance = _tdav_session_audio_resampler_create(
+ bytesPerSample,
+ codec->in.rate, base->consumer->audio.out.rate,
+ base->consumer->audio.ptime,
+ TMEDIA_CODEC_AUDIO(codec)->in.channels, base->consumer->audio.out.channels,
+ TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY,
+ &audio->decoder.resampler.buffer, &audio->decoder.resampler.buffer_size
+ );
+ }
+ if (!audio->decoder.resampler.instance) {
+ TSK_DEBUG_ERROR("No resampler to handle data");
+ ret = -5;
+ goto bail;
+ }
+ if (!(resampler_result_size = tmedia_resampler_process(audio->decoder.resampler.instance, buffer, size / bytesPerSample, audio->decoder.resampler.buffer, audio->decoder.resampler.buffer_size / bytesPerSample))) {
+ TSK_DEBUG_ERROR("Failed to process audio resampler input buffer");
+ ret = -6;
+ goto bail;
+ }
+
+ buffer = audio->decoder.resampler.buffer;
+ size = audio->decoder.resampler.buffer_size;
+ }
+
+ // adjust the gain
+ if (base->consumer->audio.gain) {
+ _tdav_session_audio_apply_gain(buffer, (int)size, base->consumer->audio.bits_per_sample, base->consumer->audio.gain);
+ }
+ // consume the frame
+ tmedia_consumer_consume(base->consumer, buffer, size, packet->header);
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("Session audio not ready");
+ }
+
+ // everything is ok
+ ret = 0;
bail:
- tsk_object_unref(TSK_OBJECT(codec));
- return ret;
+ tsk_object_unref(TSK_OBJECT(codec));
+ return ret;
}
// Producer callback (From the producer to the network). Will encode() data before sending
static int tdav_session_audio_producer_enc_cb(const void* callback_data, const void* buffer, tsk_size_t size)
{
- int ret = 0;
-
- tdav_session_audio_t* audio = (tdav_session_audio_t*)callback_data;
- tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
-
- if (!audio) {
- TSK_DEBUG_ERROR("Null session");
- return 0;
- }
-
- // do nothing if session is held
- // when the session is held the end user will get feedback he also has possibilities to put the consumer and producer on pause
- if (TMEDIA_SESSION(audio)->lo_held) {
- return 0;
- }
-
- // get best negotiated codec if not already done
- // the encoder codec could be null when session is renegotiated without re-starting (e.g. hold/resume)
- if (!audio->encoder.codec) {
- const tmedia_codec_t* codec;
- tsk_safeobj_lock(base);
- if (!(codec = tdav_session_av_get_best_neg_codec(base))) {
- TSK_DEBUG_ERROR("No codec matched");
- tsk_safeobj_unlock(base);
- return -2;
- }
- audio->encoder.codec = tsk_object_ref(TSK_OBJECT(codec));
- tsk_safeobj_unlock(base);
- }
-
- if (audio->is_started && base->rtp_manager && base->rtp_manager->is_started) {
- /* encode */
- tsk_size_t out_size = 0;
-
- // Open codec if not already done
- if (!audio->encoder.codec->opened) {
- tsk_safeobj_lock(base);
- if ((ret = tmedia_codec_open(audio->encoder.codec))) {
- tsk_safeobj_unlock(base);
- TSK_DEBUG_ERROR("Failed to open [%s] codec", audio->encoder.codec->plugin->desc);
- return -4;
- }
- tsk_safeobj_unlock(base);
- }
- // check if we're sending DTMF or not
- if (audio->is_sending_dtmf_events) {
- if (base->rtp_manager) {
- // increment the timestamp
- base->rtp_manager->rtp.timestamp += TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec)/*duration*/;
- }
- TSK_DEBUG_INFO("Skiping audio frame as we're sending DTMF...");
- return 0;
- }
-
- // resample if needed
- if (base->producer->audio.rate != audio->encoder.codec->out.rate || base->producer->audio.channels != TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels){
- tsk_size_t resampler_result_size = 0;
- int bytesPerSample = (base->producer->audio.bits_per_sample >> 3);
-
- if (!audio->encoder.resampler.instance){
- TSK_DEBUG_INFO("Create audio resampler(%s) for producer: rate=%d->%d, channels=%d->%d, bytesPerSample=%d",
- audio->encoder.codec->plugin->desc,
- base->producer->audio.rate, audio->encoder.codec->out.rate,
- base->producer->audio.channels, TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels,
- bytesPerSample);
- audio->encoder.resampler.instance = _tdav_session_audio_resampler_create(
- bytesPerSample,
- base->producer->audio.rate, audio->encoder.codec->out.rate,
- base->producer->audio.ptime,
- base->producer->audio.channels, TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels,
- TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY,
- &audio->encoder.resampler.buffer, &audio->encoder.resampler.buffer_size
- );
- }
- if (!audio->encoder.resampler.instance){
- TSK_DEBUG_ERROR("No resampler to handle data");
- ret = -1;
- goto done;
- }
- if (!(resampler_result_size = tmedia_resampler_process(audio->encoder.resampler.instance, buffer, size / bytesPerSample, audio->encoder.resampler.buffer, audio->encoder.resampler.buffer_size / bytesPerSample))){
- TSK_DEBUG_ERROR("Failed to process audio resampler input buffer");
- ret = -1;
- goto done;
- }
-
- buffer = audio->encoder.resampler.buffer;
- size = audio->encoder.resampler.buffer_size;
- }
-
- // Denoise (VAD, AGC, Noise suppression, ...)
- // Must be done after resampling
- if (audio->denoise){
- tsk_bool_t silence_or_noise = tsk_false;
- if (audio->denoise->echo_supp_enabled){
- ret = tmedia_denoise_process_record(TMEDIA_DENOISE(audio->denoise), (void*)buffer, (uint32_t)size, &silence_or_noise);
- }
- }
- // adjust the gain
- // Must be done after resampling
- if (base->producer->audio.gain){
- _tdav_session_audio_apply_gain((void*)buffer, (int)size, base->producer->audio.bits_per_sample, base->producer->audio.gain);
- }
-
- // Encode data
- if ((audio->encoder.codec = tsk_object_ref(audio->encoder.codec))){ /* Thread safeness (SIP reINVITE or UPDATE could update the encoder) */
- out_size = audio->encoder.codec->plugin->encode(audio->encoder.codec, buffer, size, &audio->encoder.buffer, &audio->encoder.buffer_size);
- if (out_size){
- trtp_manager_send_rtp(base->rtp_manager, audio->encoder.buffer, out_size, TMEDIA_CODEC_FRAME_DURATION_AUDIO_ENCODING(audio->encoder.codec), tsk_false/*Marker*/, tsk_true/*lastPacket*/);
- }
- tsk_object_unref(audio->encoder.codec);
- }
- else{
- TSK_DEBUG_WARN("No encoder");
- }
- }
+ int ret = 0;
+
+ tdav_session_audio_t* audio = (tdav_session_audio_t*)callback_data;
+ tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+
+ if (!audio) {
+ TSK_DEBUG_ERROR("Null session");
+ return 0;
+ }
+
+ // do nothing if session is held
+ // when the session is held the end user will get feedback he also has possibilities to put the consumer and producer on pause
+ if (TMEDIA_SESSION(audio)->lo_held) {
+ return 0;
+ }
+
+ // get best negotiated codec if not already done
+ // the encoder codec could be null when session is renegotiated without re-starting (e.g. hold/resume)
+ if (!audio->encoder.codec) {
+ const tmedia_codec_t* codec;
+ tsk_safeobj_lock(base);
+ if (!(codec = tdav_session_av_get_best_neg_codec(base))) {
+ TSK_DEBUG_ERROR("No codec matched");
+ tsk_safeobj_unlock(base);
+ return -2;
+ }
+ audio->encoder.codec = tsk_object_ref(TSK_OBJECT(codec));
+ tsk_safeobj_unlock(base);
+ }
+
+ if (audio->is_started && base->rtp_manager && base->rtp_manager->is_started) {
+ /* encode */
+ tsk_size_t out_size = 0;
+
+ // Open codec if not already done
+ if (!audio->encoder.codec->opened) {
+ tsk_safeobj_lock(base);
+ if ((ret = tmedia_codec_open(audio->encoder.codec))) {
+ tsk_safeobj_unlock(base);
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", audio->encoder.codec->plugin->desc);
+ return -4;
+ }
+ tsk_safeobj_unlock(base);
+ }
+ // check if we're sending DTMF or not
+ if (audio->is_sending_dtmf_events) {
+ if (base->rtp_manager) {
+ // increment the timestamp
+ base->rtp_manager->rtp.timestamp += TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec)/*duration*/;
+ }
+ TSK_DEBUG_INFO("Skiping audio frame as we're sending DTMF...");
+ return 0;
+ }
+
+ // resample if needed
+ if (base->producer->audio.rate != audio->encoder.codec->out.rate || base->producer->audio.channels != TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels) {
+ tsk_size_t resampler_result_size = 0;
+ int bytesPerSample = (base->producer->audio.bits_per_sample >> 3);
+
+ if (!audio->encoder.resampler.instance) {
+ TSK_DEBUG_INFO("Create audio resampler(%s) for producer: rate=%d->%d, channels=%d->%d, bytesPerSample=%d",
+ audio->encoder.codec->plugin->desc,
+ base->producer->audio.rate, audio->encoder.codec->out.rate,
+ base->producer->audio.channels, TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels,
+ bytesPerSample);
+ audio->encoder.resampler.instance = _tdav_session_audio_resampler_create(
+ bytesPerSample,
+ base->producer->audio.rate, audio->encoder.codec->out.rate,
+ base->producer->audio.ptime,
+ base->producer->audio.channels, TMEDIA_CODEC_AUDIO(audio->encoder.codec)->out.channels,
+ TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY,
+ &audio->encoder.resampler.buffer, &audio->encoder.resampler.buffer_size
+ );
+ }
+ if (!audio->encoder.resampler.instance) {
+ TSK_DEBUG_ERROR("No resampler to handle data");
+ ret = -1;
+ goto done;
+ }
+ if (!(resampler_result_size = tmedia_resampler_process(audio->encoder.resampler.instance, buffer, size / bytesPerSample, audio->encoder.resampler.buffer, audio->encoder.resampler.buffer_size / bytesPerSample))) {
+ TSK_DEBUG_ERROR("Failed to process audio resampler input buffer");
+ ret = -1;
+ goto done;
+ }
+
+ buffer = audio->encoder.resampler.buffer;
+ size = audio->encoder.resampler.buffer_size;
+ }
+
+ // Denoise (VAD, AGC, Noise suppression, ...)
+ // Must be done after resampling
+ if (audio->denoise) {
+ tsk_bool_t silence_or_noise = tsk_false;
+ if (audio->denoise->echo_supp_enabled) {
+ ret = tmedia_denoise_process_record(TMEDIA_DENOISE(audio->denoise), (void*)buffer, (uint32_t)size, &silence_or_noise);
+ }
+ }
+ // adjust the gain
+ // Must be done after resampling
+ if (base->producer->audio.gain) {
+ _tdav_session_audio_apply_gain((void*)buffer, (int)size, base->producer->audio.bits_per_sample, base->producer->audio.gain);
+ }
+
+ // Encode data
+ if ((audio->encoder.codec = tsk_object_ref(audio->encoder.codec))) { /* Thread safeness (SIP reINVITE or UPDATE could update the encoder) */
+ out_size = audio->encoder.codec->plugin->encode(audio->encoder.codec, buffer, size, &audio->encoder.buffer, &audio->encoder.buffer_size);
+ if (out_size) {
+ trtp_manager_send_rtp(base->rtp_manager, audio->encoder.buffer, out_size, TMEDIA_CODEC_FRAME_DURATION_AUDIO_ENCODING(audio->encoder.codec), tsk_false/*Marker*/, tsk_true/*lastPacket*/);
+ }
+ tsk_object_unref(audio->encoder.codec);
+ }
+ else {
+ TSK_DEBUG_WARN("No encoder");
+ }
+ }
done:
- return ret;
+ return ret;
}
@@ -297,512 +296,514 @@ done:
static int tdav_session_audio_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_session_audio_t* audio;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (tdav_session_av_set(TDAV_SESSION_AV(self), param) == tsk_true){
- return 0;
- }
-
- audio = (tdav_session_audio_t*)self;
-
- if (param->plugin_type == tmedia_ppt_consumer){
- TSK_DEBUG_ERROR("Not expected consumer_set(%s)", param->key);
- }
- else if (param->plugin_type == tmedia_ppt_producer){
- TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
- }
- else{
- if (param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "echo-supp")){
- if (audio->denoise){
- audio->denoise->echo_supp_enabled = (TSK_TO_INT32((uint8_t*)param->value) != 0);
- }
- }
- else if (tsk_striequals(param->key, "echo-tail")){
- if (audio->denoise){
- return tmedia_denoise_set(audio->denoise, param);
- }
- }
- }
- }
-
- return ret;
+ int ret = 0;
+ tdav_session_audio_t* audio;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (tdav_session_av_set(TDAV_SESSION_AV(self), param) == tsk_true) {
+ return 0;
+ }
+
+ audio = (tdav_session_audio_t*)self;
+
+ if (param->plugin_type == tmedia_ppt_consumer) {
+ TSK_DEBUG_ERROR("Not expected consumer_set(%s)", param->key);
+ }
+ else if (param->plugin_type == tmedia_ppt_producer) {
+ TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
+ }
+ else {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "echo-supp")) {
+ if (audio->denoise) {
+ audio->denoise->echo_supp_enabled = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+ }
+ }
+ else if (tsk_striequals(param->key, "echo-tail")) {
+ if (audio->denoise) {
+ return tmedia_denoise_set(audio->denoise, param);
+ }
+ }
+ }
+ }
+
+ return ret;
}
static int tdav_session_audio_get(tmedia_session_t* self, tmedia_param_t* param)
{
- if (!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // try with the base class to see if this option is supported or not
- if (tdav_session_av_get(TDAV_SESSION_AV(self), param) == tsk_true){
- return 0;
- }
- else {
- // the codec information is held by the session even if the user is authorized to request it for the consumer/producer
- if (param->value_type == tmedia_pvt_pobject){
- if (param->plugin_type == tmedia_ppt_consumer){
- TSK_DEBUG_ERROR("Not implemented");
- return -4;
- }
- else if (param->plugin_type == tmedia_ppt_producer){
- if (tsk_striequals("codec", param->key)) {
- const tmedia_codec_t* codec;
- if (!(codec = TDAV_SESSION_AUDIO(self)->encoder.codec)){
- codec = tdav_session_av_get_best_neg_codec((const tdav_session_av_t*)self); // up to the caller to release the object
- }
- *((tsk_object_t**)param->value) = tsk_object_ref(TSK_OBJECT(codec));
- return 0;
- }
- }
- else if (param->plugin_type == tmedia_ppt_session) {
- if (tsk_striequals(param->key, "codec-encoder")) {
- *((tsk_object_t**)param->value) = tsk_object_ref(TDAV_SESSION_AUDIO(self)->encoder.codec); // up to the caller to release the object
- return 0;
- }
- }
- }
- }
-
- TSK_DEBUG_WARN("This session doesn't support get(%s)", param->key);
- return -2;
+ if (!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // try with the base class to see if this option is supported or not
+ if (tdav_session_av_get(TDAV_SESSION_AV(self), param) == tsk_true) {
+ return 0;
+ }
+ else {
+ // the codec information is held by the session even if the user is authorized to request it for the consumer/producer
+ if (param->value_type == tmedia_pvt_pobject) {
+ if (param->plugin_type == tmedia_ppt_consumer) {
+ TSK_DEBUG_ERROR("Not implemented");
+ return -4;
+ }
+ else if (param->plugin_type == tmedia_ppt_producer) {
+ if (tsk_striequals("codec", param->key)) {
+ const tmedia_codec_t* codec;
+ if (!(codec = TDAV_SESSION_AUDIO(self)->encoder.codec)) {
+ codec = tdav_session_av_get_best_neg_codec((const tdav_session_av_t*)self); // up to the caller to release the object
+ }
+ *((tsk_object_t**)param->value) = tsk_object_ref(TSK_OBJECT(codec));
+ return 0;
+ }
+ }
+ else if (param->plugin_type == tmedia_ppt_session) {
+ if (tsk_striequals(param->key, "codec-encoder")) {
+ *((tsk_object_t**)param->value) = tsk_object_ref(TDAV_SESSION_AUDIO(self)->encoder.codec); // up to the caller to release the object
+ return 0;
+ }
+ }
+ }
+ }
+
+ TSK_DEBUG_WARN("This session doesn't support get(%s)", param->key);
+ return -2;
}
static int tdav_session_audio_prepare(tmedia_session_t* self)
{
- tdav_session_av_t* base = (tdav_session_av_t*)(self);
- int ret;
+ tdav_session_av_t* base = (tdav_session_av_t*)(self);
+ int ret;
- if ((ret = tdav_session_av_prepare(base))){
- TSK_DEBUG_ERROR("tdav_session_av_prepare(audio) failed");
- return ret;
- }
+ if ((ret = tdav_session_av_prepare(base))) {
+ TSK_DEBUG_ERROR("tdav_session_av_prepare(audio) failed");
+ return ret;
+ }
- if (base->rtp_manager){
- ret = trtp_manager_set_rtp_callback(base->rtp_manager, tdav_session_audio_rtp_cb, base);
- }
+ if (base->rtp_manager) {
+ ret = trtp_manager_set_rtp_callback(base->rtp_manager, tdav_session_audio_rtp_cb, base);
+ }
- return ret;
+ return ret;
}
static int tdav_session_audio_start(tmedia_session_t* self)
{
- int ret;
- tdav_session_audio_t* audio;
- const tmedia_codec_t* codec;
- tdav_session_av_t* base;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- audio = (tdav_session_audio_t*)self;
- base = (tdav_session_av_t*)self;
-
- if (audio->is_started) {
- TSK_DEBUG_INFO("Audio session already started");
- return 0;
- }
-
- if (!(codec = tdav_session_av_get_best_neg_codec(base))){
- TSK_DEBUG_ERROR("No codec matched");
- return -2;
- }
-
- TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
- audio->encoder.codec = tsk_object_ref((tsk_object_t*)codec);
-
- if ((ret = tdav_session_av_start(base, codec))){
- TSK_DEBUG_ERROR("tdav_session_av_start(audio) failed");
- return ret;
- }
-
- if (base->rtp_manager){
- /* Denoise (AEC, Noise Suppression, AGC)
- * tmedia_denoise_process_record() is called after resampling and before encoding which means sampling rate is equal to codec's rate
- * tmedia_denoise_echo_playback() is called before playback which means sampling rate is equal to consumer's rate
- */
- if (audio->denoise){
- uint32_t record_frame_size_samples = TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec);
- uint32_t record_sampling_rate = TMEDIA_CODEC_RATE_ENCODING(audio->encoder.codec);
- uint32_t record_channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(audio->encoder.codec);
-
- uint32_t playback_frame_size_samples = (base->consumer && base->consumer->audio.ptime && base->consumer->audio.out.rate && base->consumer->audio.out.channels)
- ? ((base->consumer->audio.ptime * base->consumer->audio.out.rate) / 1000) * base->consumer->audio.out.channels
- : TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_DECODING(audio->encoder.codec);
- uint32_t playback_sampling_rate = (base->consumer && base->consumer->audio.out.rate)
- ? base->consumer->audio.out.rate
- : TMEDIA_CODEC_RATE_DECODING(audio->encoder.codec);
- uint32_t playback_channels = (base->consumer && base->consumer->audio.out.channels)
- ? base->consumer->audio.out.channels
- : TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(audio->encoder.codec);
-
- TSK_DEBUG_INFO("Audio denoiser to be opened(record_frame_size_samples=%u, record_sampling_rate=%u, record_channels=%u, playback_frame_size_samples=%u, playback_sampling_rate=%u, playback_channels=%u)",
- record_frame_size_samples, record_sampling_rate, record_channels, playback_frame_size_samples, playback_sampling_rate, playback_channels);
-
- // close()
- tmedia_denoise_close(audio->denoise);
- // open() with new values
- tmedia_denoise_open(audio->denoise,
- record_frame_size_samples, record_sampling_rate, TSK_CLAMP(1, record_channels, 2),
- playback_frame_size_samples, playback_sampling_rate, TSK_CLAMP(1, playback_channels, 2));
- }
- }
-
- audio->is_started = (ret == 0);
-
- return ret;
+ int ret;
+ tdav_session_audio_t* audio;
+ const tmedia_codec_t* codec;
+ tdav_session_av_t* base;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ audio = (tdav_session_audio_t*)self;
+ base = (tdav_session_av_t*)self;
+
+ if (audio->is_started) {
+ TSK_DEBUG_INFO("Audio session already started");
+ return 0;
+ }
+
+ if (!(codec = tdav_session_av_get_best_neg_codec(base))) {
+ TSK_DEBUG_ERROR("No codec matched");
+ return -2;
+ }
+
+ TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
+ audio->encoder.codec = tsk_object_ref((tsk_object_t*)codec);
+
+ if ((ret = tdav_session_av_start(base, codec))) {
+ TSK_DEBUG_ERROR("tdav_session_av_start(audio) failed");
+ return ret;
+ }
+
+ if (base->rtp_manager) {
+ /* Denoise (AEC, Noise Suppression, AGC)
+ * tmedia_denoise_process_record() is called after resampling and before encoding which means sampling rate is equal to codec's rate
+ * tmedia_denoise_echo_playback() is called before playback which means sampling rate is equal to consumer's rate
+ */
+ if (audio->denoise) {
+ uint32_t record_frame_size_samples = TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec);
+ uint32_t record_sampling_rate = TMEDIA_CODEC_RATE_ENCODING(audio->encoder.codec);
+ uint32_t record_channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(audio->encoder.codec);
+
+ uint32_t playback_frame_size_samples = (base->consumer && base->consumer->audio.ptime && base->consumer->audio.out.rate && base->consumer->audio.out.channels)
+ ? ((base->consumer->audio.ptime * base->consumer->audio.out.rate) / 1000) * base->consumer->audio.out.channels
+ : TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_DECODING(audio->encoder.codec);
+ uint32_t playback_sampling_rate = (base->consumer && base->consumer->audio.out.rate)
+ ? base->consumer->audio.out.rate
+ : TMEDIA_CODEC_RATE_DECODING(audio->encoder.codec);
+ uint32_t playback_channels = (base->consumer && base->consumer->audio.out.channels)
+ ? base->consumer->audio.out.channels
+ : TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(audio->encoder.codec);
+
+ TSK_DEBUG_INFO("Audio denoiser to be opened(record_frame_size_samples=%u, record_sampling_rate=%u, record_channels=%u, playback_frame_size_samples=%u, playback_sampling_rate=%u, playback_channels=%u)",
+ record_frame_size_samples, record_sampling_rate, record_channels, playback_frame_size_samples, playback_sampling_rate, playback_channels);
+
+ // close()
+ tmedia_denoise_close(audio->denoise);
+ // open() with new values
+ tmedia_denoise_open(audio->denoise,
+ record_frame_size_samples, record_sampling_rate, TSK_CLAMP(1, record_channels, 2),
+ playback_frame_size_samples, playback_sampling_rate, TSK_CLAMP(1, playback_channels, 2));
+ }
+ }
+
+ audio->is_started = (ret == 0);
+
+ return ret;
}
static int tdav_session_audio_stop(tmedia_session_t* self)
{
- tdav_session_audio_t* audio = TDAV_SESSION_AUDIO(self);
- tdav_session_av_t* base = TDAV_SESSION_AV(self);
- int ret = tdav_session_av_stop(base);
- audio->is_started = tsk_false;
- TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
- TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
-
- // close the jitter buffer and denoiser to be sure it will be reopened and reinitialized if reINVITE or UPDATE
- // this is a "must" when the initial and updated sessions use codecs with different rate
- if (audio->jitterbuffer && audio->jitterbuffer->opened) {
- ret = tmedia_jitterbuffer_close(audio->jitterbuffer);
- }
- if (audio->denoise && audio->denoise->opened) {
- ret = tmedia_denoise_close(audio->denoise);
- }
- return ret;
+ tdav_session_audio_t* audio = TDAV_SESSION_AUDIO(self);
+ tdav_session_av_t* base = TDAV_SESSION_AV(self);
+ int ret = tdav_session_av_stop(base);
+ audio->is_started = tsk_false;
+ TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
+ TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
+
+ // close the jitter buffer and denoiser to be sure it will be reopened and reinitialized if reINVITE or UPDATE
+ // this is a "must" when the initial and updated sessions use codecs with different rate
+ if (audio->jitterbuffer && audio->jitterbuffer->opened) {
+ ret = tmedia_jitterbuffer_close(audio->jitterbuffer);
+ }
+ if (audio->denoise && audio->denoise->opened) {
+ ret = tmedia_denoise_close(audio->denoise);
+ }
+ return ret;
}
static int tdav_session_audio_send_dtmf(tmedia_session_t* self, uint8_t event)
{
- tdav_session_audio_t* audio;
- tdav_session_av_t* base;
- tmedia_codec_t* codec;
- int ret, rate = 8000, ptime = 20;
- uint16_t duration;
- tdav_session_audio_dtmfe_t *dtmfe, *copy;
- int format = 101;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- audio = (tdav_session_audio_t*)self;
- base = (tdav_session_av_t*)self;
-
- // Find the DTMF codec to use to use the RTP payload
- if ((codec = tmedia_codec_find_by_format(TMEDIA_SESSION(audio)->codecs, TMEDIA_CODEC_FORMAT_DTMF))){
- rate = (int)codec->out.rate;
- format = atoi(codec->neg_format ? codec->neg_format : codec->format);
- TSK_OBJECT_SAFE_FREE(codec);
- }
-
- /* do we have an RTP manager? */
- if (!base->rtp_manager){
- TSK_DEBUG_ERROR("No RTP manager associated to this session");
- return -2;
- }
-
- /* Create Events list */
- if (!audio->dtmf_events){
- audio->dtmf_events = tsk_list_create();
- }
-
- /* Create global reference to the timer manager */
- if (!audio->timer.handle_mgr_global){
- if (!(audio->timer.handle_mgr_global = tsk_timer_mgr_global_ref())){
- TSK_DEBUG_ERROR("Failed to create Global Timer Manager");
- return -3;
- }
- }
-
- /* Start the timer manager */
- if (!audio->timer.started){
- if ((ret = tsk_timer_manager_start(audio->timer.handle_mgr_global))){
- TSK_DEBUG_ERROR("Failed to start Global Timer Manager");
- return ret;
- }
- audio->timer.started = tsk_true;
- }
-
-
- /* RFC 4733 - 5. Examples
-
- +-------+-----------+------+--------+------+--------+--------+------+
- | Time | Event | M | Time- | Seq | Event | Dura- | E |
- | (ms) | | bit | stamp | No | Code | tion | bit |
- +-------+-----------+------+--------+------+--------+--------+------+
- | 0 | "9" | | | | | | |
- | | starts | | | | | | |
- | 50 | RTP | "1" | 0 | 1 | 9 | 400 | "0" |
- | | packet 1 | | | | | | |
- | | sent | | | | | | |
- | 100 | RTP | "0" | 0 | 2 | 9 | 800 | "0" |
- | | packet 2 | | | | | | |
- | | sent | | | | | | |
- | 150 | RTP | "0" | 0 | 3 | 9 | 1200 | "0" |
- | | packet 3 | | | | | | |
- | | sent | | | | | | |
- | 200 | RTP | "0" | 0 | 4 | 9 | 1600 | "0" |
- | | packet 4 | | | | | | |
- | | sent | | | | | | |
- | 200 | "9" ends | | | | | | |
- | 250 | RTP | "0" | 0 | 5 | 9 | 1600 | "1" |
- | | packet 4 | | | | | | |
- | | first | | | | | | |
- | | retrans- | | | | | | |
- | | mission | | | | | | |
- | 300 | RTP | "0" | 0 | 6 | 9 | 1600 | "1" |
- | | packet 4 | | | | | | |
- | | second | | | | | | |
- | | retrans- | | | | | | |
- | | mission | | | | | | |
- =====================================================================
- | 880 | First "1" | | | | | | |
- | | starts | | | | | | |
- | 930 | RTP | "1" | 7040 | 7 | 1 | 400 | "0" |
- | | packet 5 | | | | | | |
- | | sent | | | | | | |
- */
-
- // ref()(thread safeness)
- audio = tsk_object_ref(audio);
-
- // says we're sending DTMF digits to avoid mixing with audio (SRTP won't let this happen because of senquence numbers)
- // flag will be turned OFF when the list is empty
- audio->is_sending_dtmf_events = tsk_true;
-
- duration = TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec);
-
- // lock() list
- tsk_list_lock(audio->dtmf_events);
-
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 1, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_true, tsk_false);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 0, _tdav_session_audio_dtmfe_timercb, copy);
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 2, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 1, _tdav_session_audio_dtmfe_timercb, copy);
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 3, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 2, _tdav_session_audio_dtmfe_timercb, copy);
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 3, _tdav_session_audio_dtmfe_timercb, copy);
-
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_true);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 4, _tdav_session_audio_dtmfe_timercb, copy);
- copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_true);
- tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
- tsk_timer_mgr_global_schedule(ptime * 5, _tdav_session_audio_dtmfe_timercb, copy);
-
- // unlock() list
- tsk_list_unlock(audio->dtmf_events);
-
- // increment timestamp
- base->rtp_manager->rtp.timestamp += duration;
-
- // unref()(thread safeness)
- audio = tsk_object_unref(audio);
-
- return 0;
+ tdav_session_audio_t* audio;
+ tdav_session_av_t* base;
+ tmedia_codec_t* codec;
+ int ret, rate = 8000, ptime = 20;
+ uint16_t duration;
+ tdav_session_audio_dtmfe_t *dtmfe, *copy;
+ int format = 101;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ audio = (tdav_session_audio_t*)self;
+ base = (tdav_session_av_t*)self;
+
+ // Find the DTMF codec to use to use the RTP payload
+ if ((codec = tmedia_codec_find_by_format(TMEDIA_SESSION(audio)->codecs, TMEDIA_CODEC_FORMAT_DTMF))) {
+ rate = (int)codec->out.rate;
+ format = atoi(codec->neg_format ? codec->neg_format : codec->format);
+ TSK_OBJECT_SAFE_FREE(codec);
+ }
+
+ /* do we have an RTP manager? */
+ if (!base->rtp_manager) {
+ TSK_DEBUG_ERROR("No RTP manager associated to this session");
+ return -2;
+ }
+
+ /* Create Events list */
+ if (!audio->dtmf_events) {
+ audio->dtmf_events = tsk_list_create();
+ }
+
+ /* Create global reference to the timer manager */
+ if (!audio->timer.handle_mgr_global) {
+ if (!(audio->timer.handle_mgr_global = tsk_timer_mgr_global_ref())) {
+ TSK_DEBUG_ERROR("Failed to create Global Timer Manager");
+ return -3;
+ }
+ }
+
+ /* Start the timer manager */
+ if (!audio->timer.started) {
+ if ((ret = tsk_timer_manager_start(audio->timer.handle_mgr_global))) {
+ TSK_DEBUG_ERROR("Failed to start Global Timer Manager");
+ return ret;
+ }
+ audio->timer.started = tsk_true;
+ }
+
+
+ /* RFC 4733 - 5. Examples
+
+ +-------+-----------+------+--------+------+--------+--------+------+
+ | Time | Event | M | Time- | Seq | Event | Dura- | E |
+ | (ms) | | bit | stamp | No | Code | tion | bit |
+ +-------+-----------+------+--------+------+--------+--------+------+
+ | 0 | "9" | | | | | | |
+ | | starts | | | | | | |
+ | 50 | RTP | "1" | 0 | 1 | 9 | 400 | "0" |
+ | | packet 1 | | | | | | |
+ | | sent | | | | | | |
+ | 100 | RTP | "0" | 0 | 2 | 9 | 800 | "0" |
+ | | packet 2 | | | | | | |
+ | | sent | | | | | | |
+ | 150 | RTP | "0" | 0 | 3 | 9 | 1200 | "0" |
+ | | packet 3 | | | | | | |
+ | | sent | | | | | | |
+ | 200 | RTP | "0" | 0 | 4 | 9 | 1600 | "0" |
+ | | packet 4 | | | | | | |
+ | | sent | | | | | | |
+ | 200 | "9" ends | | | | | | |
+ | 250 | RTP | "0" | 0 | 5 | 9 | 1600 | "1" |
+ | | packet 4 | | | | | | |
+ | | first | | | | | | |
+ | | retrans- | | | | | | |
+ | | mission | | | | | | |
+ | 300 | RTP | "0" | 0 | 6 | 9 | 1600 | "1" |
+ | | packet 4 | | | | | | |
+ | | second | | | | | | |
+ | | retrans- | | | | | | |
+ | | mission | | | | | | |
+ =====================================================================
+ | 880 | First "1" | | | | | | |
+ | | starts | | | | | | |
+ | 930 | RTP | "1" | 7040 | 7 | 1 | 400 | "0" |
+ | | packet 5 | | | | | | |
+ | | sent | | | | | | |
+ */
+
+ // ref()(thread safeness)
+ audio = tsk_object_ref(audio);
+
+ // says we're sending DTMF digits to avoid mixing with audio (SRTP won't let this happen because of senquence numbers)
+ // flag will be turned OFF when the list is empty
+ audio->is_sending_dtmf_events = tsk_true;
+
+ duration = TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(audio->encoder.codec);
+
+ // lock() list
+ tsk_list_lock(audio->dtmf_events);
+
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 1, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_true, tsk_false);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 0, _tdav_session_audio_dtmfe_timercb, copy);
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 2, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 1, _tdav_session_audio_dtmfe_timercb, copy);
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 3, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 2, _tdav_session_audio_dtmfe_timercb, copy);
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_false);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 3, _tdav_session_audio_dtmfe_timercb, copy);
+
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_true);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 4, _tdav_session_audio_dtmfe_timercb, copy);
+ copy = dtmfe = _tdav_session_audio_dtmfe_create(audio, event, duration * 4, ++base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, (uint8_t)format, tsk_false, tsk_true);
+ tsk_list_push_back_data(audio->dtmf_events, (void**)&dtmfe);
+ tsk_timer_mgr_global_schedule(ptime * 5, _tdav_session_audio_dtmfe_timercb, copy);
+
+ // unlock() list
+ tsk_list_unlock(audio->dtmf_events);
+
+ // increment timestamp
+ base->rtp_manager->rtp.timestamp += duration;
+
+ // unref()(thread safeness)
+ audio = tsk_object_unref(audio);
+
+ return 0;
}
static int tdav_session_audio_pause(tmedia_session_t* self)
{
- return tdav_session_av_pause(TDAV_SESSION_AV(self));
+ return tdav_session_av_pause(TDAV_SESSION_AV(self));
}
static const tsdp_header_M_t* tdav_session_audio_get_lo(tmedia_session_t* self)
{
- tsk_bool_t updated = tsk_false;
- const tsdp_header_M_t* ret;
- tdav_session_av_t* base = TDAV_SESSION_AV(self);
+ tsk_bool_t updated = tsk_false;
+ const tsdp_header_M_t* ret;
+ tdav_session_av_t* base = TDAV_SESSION_AV(self);
- if (!(ret = tdav_session_av_get_lo(base, &updated))){
- TSK_DEBUG_ERROR("tdav_session_av_get_lo(audio) failed");
- return tsk_null;
- }
+ if (!(ret = tdav_session_av_get_lo(base, &updated))) {
+ TSK_DEBUG_ERROR("tdav_session_av_get_lo(audio) failed");
+ return tsk_null;
+ }
- if (updated){
- tsk_safeobj_lock(base);
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_AUDIO(self)->encoder.codec);
- tsk_safeobj_unlock(base);
- }
+ if (updated) {
+ tsk_safeobj_lock(base);
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_AUDIO(self)->encoder.codec);
+ tsk_safeobj_unlock(base);
+ }
- return ret;
+ return ret;
}
static int tdav_session_audio_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- int ret;
- tsk_bool_t updated = tsk_false;
- tdav_session_av_t* base = TDAV_SESSION_AV(self);
-
- if ((ret = tdav_session_av_set_ro(base, m, &updated))){
- TSK_DEBUG_ERROR("tdav_session_av_set_ro(audio) failed");
- return ret;
- }
-
- if (updated) {
- tsk_safeobj_lock(base);
- // reset audio jitter buffer (new Offer probably comes with new seq_nums or timestamps)
- if (base->consumer) {
- ret = tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(base->consumer));
- }
- // destroy encoder to force requesting new one
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_AUDIO(self)->encoder.codec);
- tsk_safeobj_unlock(base);
- }
-
- return ret;
+ int ret;
+ tsk_bool_t updated = tsk_false;
+ tdav_session_av_t* base = TDAV_SESSION_AV(self);
+
+ if ((ret = tdav_session_av_set_ro(base, m, &updated))) {
+ TSK_DEBUG_ERROR("tdav_session_av_set_ro(audio) failed");
+ return ret;
+ }
+
+ if (updated) {
+ tsk_safeobj_lock(base);
+ // reset audio jitter buffer (new Offer probably comes with new seq_nums or timestamps)
+ if (base->consumer) {
+ ret = tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(base->consumer));
+ }
+ // destroy encoder to force requesting new one
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_AUDIO(self)->encoder.codec);
+ tsk_safeobj_unlock(base);
+ }
+
+ return ret;
}
/* apply gain */
static void _tdav_session_audio_apply_gain(void* buffer, int len, int bps, int gain)
{
- register int i;
- int max_val;
-
- max_val = (1 << (bps - 1 - gain)) - 1;
-
- if (bps == 8) {
- int8_t *buff = buffer;
- for (i = 0; i < len; i++) {
- if (buff[i] > -max_val && buff[i] < max_val)
- buff[i] = buff[i] << gain;
- }
- }
- else if (bps == 16) {
- int16_t *buff = buffer;
- for (i = 0; i < len / 2; i++) {
- if (buff[i] > -max_val && buff[i] < max_val)
- buff[i] = buff[i] << gain;
- }
- }
+ register int i;
+ int max_val;
+
+ max_val = (1 << (bps - 1 - gain)) - 1;
+
+ if (bps == 8) {
+ int8_t *buff = buffer;
+ for (i = 0; i < len; i++) {
+ if (buff[i] > -max_val && buff[i] < max_val) {
+ buff[i] = buff[i] << gain;
+ }
+ }
+ }
+ else if (bps == 16) {
+ int16_t *buff = buffer;
+ for (i = 0; i < len / 2; i++) {
+ if (buff[i] > -max_val && buff[i] < max_val) {
+ buff[i] = buff[i] << gain;
+ }
+ }
+ }
}
/* Internal function used to create new DTMF event */
static tdav_session_audio_dtmfe_t* _tdav_session_audio_dtmfe_create(const tdav_session_audio_t* session, uint8_t event, uint16_t duration, uint32_t seq, uint32_t timestamp, uint8_t format, tsk_bool_t M, tsk_bool_t E)
{
- tdav_session_audio_dtmfe_t* dtmfe;
- const tdav_session_av_t* base = (const tdav_session_av_t*)session;
- static uint8_t volume = 10;
- static uint32_t ssrc = 0x5234A8;
-
- uint8_t pay[4] = { 0 };
-
- /* RFC 4733 - 2.3. Payload Format
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | event |E|R| volume | duration |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- if (!(dtmfe = tsk_object_new(tdav_session_audio_dtmfe_def_t))){
- TSK_DEBUG_ERROR("Failed to create new DTMF event");
- return tsk_null;
- }
- dtmfe->session = session;
-
- if (!(dtmfe->packet = trtp_rtp_packet_create((session && base->rtp_manager) ? base->rtp_manager->rtp.ssrc.local : ssrc, seq, timestamp, format, M))){
- TSK_DEBUG_ERROR("Failed to create DTMF RTP packet");
- TSK_OBJECT_SAFE_FREE(dtmfe);
- return tsk_null;
- }
-
- pay[0] = event;
- pay[1] |= ((E << 7) | (volume & 0x3F));
- pay[2] = (duration >> 8);
- pay[3] = (duration & 0xFF);
-
- /* set data */
- if ((dtmfe->packet->payload.data = tsk_calloc(sizeof(pay), sizeof(uint8_t)))){
- memcpy(dtmfe->packet->payload.data, pay, sizeof(pay));
- dtmfe->packet->payload.size = sizeof(pay);
- }
-
- return dtmfe;
+ tdav_session_audio_dtmfe_t* dtmfe;
+ const tdav_session_av_t* base = (const tdav_session_av_t*)session;
+ static uint8_t volume = 10;
+ static uint32_t ssrc = 0x5234A8;
+
+ uint8_t pay[4] = { 0 };
+
+ /* RFC 4733 - 2.3. Payload Format
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | event |E|R| volume | duration |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ if (!(dtmfe = tsk_object_new(tdav_session_audio_dtmfe_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create new DTMF event");
+ return tsk_null;
+ }
+ dtmfe->session = session;
+
+ if (!(dtmfe->packet = trtp_rtp_packet_create((session && base->rtp_manager) ? base->rtp_manager->rtp.ssrc.local : ssrc, seq, timestamp, format, M))) {
+ TSK_DEBUG_ERROR("Failed to create DTMF RTP packet");
+ TSK_OBJECT_SAFE_FREE(dtmfe);
+ return tsk_null;
+ }
+
+ pay[0] = event;
+ pay[1] |= ((E << 7) | (volume & 0x3F));
+ pay[2] = (duration >> 8);
+ pay[3] = (duration & 0xFF);
+
+ /* set data */
+ if ((dtmfe->packet->payload.data = tsk_calloc(sizeof(pay), sizeof(uint8_t)))) {
+ memcpy(dtmfe->packet->payload.data, pay, sizeof(pay));
+ dtmfe->packet->payload.size = sizeof(pay);
+ }
+
+ return dtmfe;
}
static int _tdav_session_audio_dtmfe_timercb(const void* arg, tsk_timer_id_t timer_id)
{
- tdav_session_audio_dtmfe_t* dtmfe = (tdav_session_audio_dtmfe_t*)arg;
- tdav_session_audio_t *audio;
+ tdav_session_audio_dtmfe_t* dtmfe = (tdav_session_audio_dtmfe_t*)arg;
+ tdav_session_audio_t *audio;
- if (!dtmfe || !dtmfe->session || !dtmfe->session->dtmf_events){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!dtmfe || !dtmfe->session || !dtmfe->session->dtmf_events) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* Send the data */
- TSK_DEBUG_INFO("Sending DTMF event...");
- trtp_manager_send_rtp_packet(TDAV_SESSION_AV(dtmfe->session)->rtp_manager, dtmfe->packet, tsk_false);
+ /* Send the data */
+ TSK_DEBUG_INFO("Sending DTMF event...");
+ trtp_manager_send_rtp_packet(TDAV_SESSION_AV(dtmfe->session)->rtp_manager, dtmfe->packet, tsk_false);
- audio = tsk_object_ref(TSK_OBJECT(dtmfe->session));
- tsk_list_lock(audio->dtmf_events);
- /* Remove and delete the event from the queue */
- tsk_list_remove_item_by_data(audio->dtmf_events, dtmfe);
- /* Check if there are pending events */
- audio->is_sending_dtmf_events = !TSK_LIST_IS_EMPTY(audio->dtmf_events);
- tsk_list_unlock(audio->dtmf_events);
- tsk_object_unref(audio);
+ audio = tsk_object_ref(TSK_OBJECT(dtmfe->session));
+ tsk_list_lock(audio->dtmf_events);
+ /* Remove and delete the event from the queue */
+ tsk_list_remove_item_by_data(audio->dtmf_events, dtmfe);
+ /* Check if there are pending events */
+ audio->is_sending_dtmf_events = !TSK_LIST_IS_EMPTY(audio->dtmf_events);
+ tsk_list_unlock(audio->dtmf_events);
+ tsk_object_unref(audio);
- return 0;
+ return 0;
}
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size)
{
- uint32_t resampler_buff_size;
- tmedia_resampler_t* resampler;
- int ret;
-
- if (out_channels > 2 || in_channels > 2) {
- TSK_DEBUG_ERROR("Invalid parameter: out_channels=%u, in_channels=%u", out_channels, in_channels);
- return tsk_null;
- }
-
- resampler_buff_size = (((out_freq * frame_duration) / 1000) * bytes_per_sample) << (out_channels == 2 ? 1 : 0);
-
- if (!(resampler = tmedia_resampler_create())) {
- TSK_DEBUG_ERROR("Failed to create audio resampler");
- return tsk_null;
- }
- else {
- if ((ret = tmedia_resampler_open(resampler, in_freq, out_freq, frame_duration, in_channels, out_channels, quality, 16))) {
- TSK_DEBUG_ERROR("Failed to open audio resampler (%d, %d, %d, %d, %d,%d) with retcode=%d", in_freq, out_freq, frame_duration, in_channels, out_channels, quality, ret);
- TSK_OBJECT_SAFE_FREE(resampler);
- goto done;
- }
- }
- // create temp resampler buffer
- if ((*resampler_buffer = tsk_realloc(*resampler_buffer, resampler_buff_size))) {
- *resampler_buffer_size = resampler_buff_size;
- }
- else {
- *resampler_buffer_size = 0;
- TSK_DEBUG_ERROR("Failed to allocate resampler buffer with size = %d", resampler_buff_size);
- TSK_OBJECT_SAFE_FREE(resampler);
- goto done;
- }
+ uint32_t resampler_buff_size;
+ tmedia_resampler_t* resampler;
+ int ret;
+
+ if (out_channels > 2 || in_channels > 2) {
+ TSK_DEBUG_ERROR("Invalid parameter: out_channels=%u, in_channels=%u", out_channels, in_channels);
+ return tsk_null;
+ }
+
+ resampler_buff_size = (((out_freq * frame_duration) / 1000) * bytes_per_sample) << (out_channels == 2 ? 1 : 0);
+
+ if (!(resampler = tmedia_resampler_create())) {
+ TSK_DEBUG_ERROR("Failed to create audio resampler");
+ return tsk_null;
+ }
+ else {
+ if ((ret = tmedia_resampler_open(resampler, in_freq, out_freq, frame_duration, in_channels, out_channels, quality, 16))) {
+ TSK_DEBUG_ERROR("Failed to open audio resampler (%d, %d, %d, %d, %d,%d) with retcode=%d", in_freq, out_freq, frame_duration, in_channels, out_channels, quality, ret);
+ TSK_OBJECT_SAFE_FREE(resampler);
+ goto done;
+ }
+ }
+ // create temp resampler buffer
+ if ((*resampler_buffer = tsk_realloc(*resampler_buffer, resampler_buff_size))) {
+ *resampler_buffer_size = resampler_buff_size;
+ }
+ else {
+ *resampler_buffer_size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate resampler buffer with size = %d", resampler_buff_size);
+ TSK_OBJECT_SAFE_FREE(resampler);
+ goto done;
+ }
done:
- return resampler;
+ return resampler;
}
//=================================================================================================
@@ -811,142 +812,139 @@ done:
/* constructor */
static tsk_object_t* tdav_session_audio_ctor(tsk_object_t * self, va_list * app)
{
- tdav_session_audio_t *audio = self;
- if (audio){
- int ret;
- tdav_session_av_t *base = TDAV_SESSION_AV(self);
-
- /* init() base */
- if ((ret = tdav_session_av_init(base, tmedia_audio)) != 0){
- TSK_DEBUG_ERROR("tdav_session_av_init(audio) failed");
- return tsk_null;
- }
-
- /* init() self */
- if (base->producer){
- tmedia_producer_set_enc_callback(base->producer, tdav_session_audio_producer_enc_cb, audio);
- }
- if (base->consumer){
- // It's important to create the denoiser and jitter buffer here as dynamic plugins (from shared libs) don't have access to the registry
- if (!(audio->denoise = tmedia_denoise_create())){
- TSK_DEBUG_WARN("No Audio denoiser found");
- }
- else{
- // IMPORTANT: This means that the consumer must be child of "tdav_consumer_audio_t" object
- tdav_consumer_audio_set_denoise(TDAV_CONSUMER_AUDIO(base->consumer), audio->denoise);
- }
-
- if (!(audio->jitterbuffer = tmedia_jitterbuffer_create(tmedia_audio))){
- TSK_DEBUG_ERROR("Failed to create jitter buffer");
- }
- else{
- ret = tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(audio->jitterbuffer));
- tdav_consumer_audio_set_jitterbuffer(TDAV_CONSUMER_AUDIO(base->consumer), audio->jitterbuffer);
- }
- }
- }
- return self;
+ tdav_session_audio_t *audio = self;
+ if (audio) {
+ int ret;
+ tdav_session_av_t *base = TDAV_SESSION_AV(self);
+
+ /* init() base */
+ if ((ret = tdav_session_av_init(base, tmedia_audio)) != 0) {
+ TSK_DEBUG_ERROR("tdav_session_av_init(audio) failed");
+ return tsk_null;
+ }
+
+ /* init() self */
+ if (base->producer) {
+ tmedia_producer_set_enc_callback(base->producer, tdav_session_audio_producer_enc_cb, audio);
+ }
+ if (base->consumer) {
+ // It's important to create the denoiser and jitter buffer here as dynamic plugins (from shared libs) don't have access to the registry
+ if (!(audio->denoise = tmedia_denoise_create())) {
+ TSK_DEBUG_WARN("No Audio denoiser found");
+ }
+ else {
+ // IMPORTANT: This means that the consumer must be child of "tdav_consumer_audio_t" object
+ tdav_consumer_audio_set_denoise(TDAV_CONSUMER_AUDIO(base->consumer), audio->denoise);
+ }
+
+ if (!(audio->jitterbuffer = tmedia_jitterbuffer_create(tmedia_audio))) {
+ TSK_DEBUG_ERROR("Failed to create jitter buffer");
+ }
+ else {
+ ret = tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(audio->jitterbuffer));
+ tdav_consumer_audio_set_jitterbuffer(TDAV_CONSUMER_AUDIO(base->consumer), audio->jitterbuffer);
+ }
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_session_audio_dtor(tsk_object_t * self)
{
- tdav_session_audio_t *audio = self;
- TSK_DEBUG_INFO("*** tdav_session_audio_t destroyed ***");
- if (audio){
- tdav_session_audio_stop((tmedia_session_t*)audio);
- // Do it in this order (deinit self first)
-
- /* Timer manager */
- if (audio->timer.started){
- if (audio->dtmf_events){
- /* Cancel all events */
- tsk_list_item_t* item;
- tsk_list_foreach(item, audio->dtmf_events){
- tsk_timer_mgr_global_cancel(((tdav_session_audio_dtmfe_t*)item->data)->timer_id);
- }
- }
- }
-
- tsk_timer_mgr_global_unref(&audio->timer.handle_mgr_global);
-
- /* CleanUp the DTMF events */
- TSK_OBJECT_SAFE_FREE(audio->dtmf_events);
-
- TSK_OBJECT_SAFE_FREE(audio->denoise);
- TSK_OBJECT_SAFE_FREE(audio->jitterbuffer);
-
- TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
- TSK_FREE(audio->encoder.buffer);
- TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
- TSK_FREE(audio->decoder.buffer);
-
- // free resamplers
- TSK_FREE(audio->encoder.resampler.buffer);
- TSK_OBJECT_SAFE_FREE(audio->encoder.resampler.instance);
- TSK_FREE(audio->decoder.resampler.buffer);
- TSK_OBJECT_SAFE_FREE(audio->decoder.resampler.instance);
-
- /* deinit base */
- tdav_session_av_deinit(TDAV_SESSION_AV(self));
-
- TSK_DEBUG_INFO("*** Audio session destroyed ***");
- }
-
- return self;
+ tdav_session_audio_t *audio = self;
+ TSK_DEBUG_INFO("*** tdav_session_audio_t destroyed ***");
+ if (audio) {
+ tdav_session_audio_stop((tmedia_session_t*)audio);
+ // Do it in this order (deinit self first)
+
+ /* Timer manager */
+ if (audio->timer.started) {
+ if (audio->dtmf_events) {
+ /* Cancel all events */
+ tsk_list_item_t* item;
+ tsk_list_foreach(item, audio->dtmf_events) {
+ tsk_timer_mgr_global_cancel(((tdav_session_audio_dtmfe_t*)item->data)->timer_id);
+ }
+ }
+ }
+
+ tsk_timer_mgr_global_unref(&audio->timer.handle_mgr_global);
+
+ /* CleanUp the DTMF events */
+ TSK_OBJECT_SAFE_FREE(audio->dtmf_events);
+
+ TSK_OBJECT_SAFE_FREE(audio->denoise);
+ TSK_OBJECT_SAFE_FREE(audio->jitterbuffer);
+
+ TSK_OBJECT_SAFE_FREE(audio->encoder.codec);
+ TSK_FREE(audio->encoder.buffer);
+ TSK_OBJECT_SAFE_FREE(audio->decoder.codec);
+ TSK_FREE(audio->decoder.buffer);
+
+ // free resamplers
+ TSK_FREE(audio->encoder.resampler.buffer);
+ TSK_OBJECT_SAFE_FREE(audio->encoder.resampler.instance);
+ TSK_FREE(audio->decoder.resampler.buffer);
+ TSK_OBJECT_SAFE_FREE(audio->decoder.resampler.instance);
+
+ /* deinit base */
+ tdav_session_av_deinit(TDAV_SESSION_AV(self));
+
+ TSK_DEBUG_INFO("*** Audio session destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_audio_def_s =
-{
- sizeof(tdav_session_audio_t),
- tdav_session_audio_ctor,
- tdav_session_audio_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tdav_session_audio_def_s = {
+ sizeof(tdav_session_audio_t),
+ tdav_session_audio_ctor,
+ tdav_session_audio_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tdav_session_audio_plugin_def_s =
-{
- &tdav_session_audio_def_s,
-
- tmedia_audio,
- "audio",
-
- tdav_session_audio_set,
- tdav_session_audio_get,
- tdav_session_audio_prepare,
- tdav_session_audio_start,
- tdav_session_audio_pause,
- tdav_session_audio_stop,
-
- /* Audio part */
- {
- tdav_session_audio_send_dtmf
- },
-
- tdav_session_audio_get_lo,
- tdav_session_audio_set_ro
+static const tmedia_session_plugin_def_t tdav_session_audio_plugin_def_s = {
+ &tdav_session_audio_def_s,
+
+ tmedia_audio,
+ "audio",
+
+ tdav_session_audio_set,
+ tdav_session_audio_get,
+ tdav_session_audio_prepare,
+ tdav_session_audio_start,
+ tdav_session_audio_pause,
+ tdav_session_audio_stop,
+
+ /* Audio part */
+ {
+ tdav_session_audio_send_dtmf
+ },
+
+ tdav_session_audio_get_lo,
+ tdav_session_audio_set_ro
};
const tmedia_session_plugin_def_t *tdav_session_audio_plugin_def_t = &tdav_session_audio_plugin_def_s;
-static const tmedia_session_plugin_def_t tdav_session_bfcpaudio_plugin_def_s =
-{
- &tdav_session_audio_def_s,
-
- tmedia_bfcp_audio,
- "audio",
-
- tdav_session_audio_set,
- tdav_session_audio_get,
- tdav_session_audio_prepare,
- tdav_session_audio_start,
- tdav_session_audio_pause,
- tdav_session_audio_stop,
-
- /* Audio part */
- {
- tdav_session_audio_send_dtmf
- },
-
- tdav_session_audio_get_lo,
- tdav_session_audio_set_ro
+static const tmedia_session_plugin_def_t tdav_session_bfcpaudio_plugin_def_s = {
+ &tdav_session_audio_def_s,
+
+ tmedia_bfcp_audio,
+ "audio",
+
+ tdav_session_audio_set,
+ tdav_session_audio_get,
+ tdav_session_audio_prepare,
+ tdav_session_audio_start,
+ tdav_session_audio_pause,
+ tdav_session_audio_stop,
+
+ /* Audio part */
+ {
+ tdav_session_audio_send_dtmf
+ },
+
+ tdav_session_audio_get_lo,
+ tdav_session_audio_set_ro
};
const tmedia_session_plugin_def_t *tdav_session_bfcpaudio_plugin_def_t = &tdav_session_bfcpaudio_plugin_def_s;
@@ -957,35 +955,34 @@ const tmedia_session_plugin_def_t *tdav_session_bfcpaudio_plugin_def_t = &tdav_s
//
static tsk_object_t* tdav_session_audio_dtmfe_ctor(tsk_object_t * self, va_list * app)
{
- tdav_session_audio_dtmfe_t *event = self;
- if (event){
- event->timer_id = TSK_INVALID_TIMER_ID;
- }
- return self;
+ tdav_session_audio_dtmfe_t *event = self;
+ if (event) {
+ event->timer_id = TSK_INVALID_TIMER_ID;
+ }
+ return self;
}
static tsk_object_t* tdav_session_audio_dtmfe_dtor(tsk_object_t * self)
{
- tdav_session_audio_dtmfe_t *event = self;
- if (event){
- TSK_OBJECT_SAFE_FREE(event->packet);
- }
+ tdav_session_audio_dtmfe_t *event = self;
+ if (event) {
+ TSK_OBJECT_SAFE_FREE(event->packet);
+ }
- return self;
+ return self;
}
static int tdav_session_audio_dtmfe_cmp(const tsk_object_t *_e1, const tsk_object_t *_e2)
{
- int ret;
- tsk_subsat_int32_ptr(_e1, _e2, &ret);
- return ret;
+ int ret;
+ tsk_subsat_int32_ptr(_e1, _e2, &ret);
+ return ret;
}
-static const tsk_object_def_t tdav_session_audio_dtmfe_def_s =
-{
- sizeof(tdav_session_audio_dtmfe_t),
- tdav_session_audio_dtmfe_ctor,
- tdav_session_audio_dtmfe_dtor,
- tdav_session_audio_dtmfe_cmp,
+static const tsk_object_def_t tdav_session_audio_dtmfe_def_s = {
+ sizeof(tdav_session_audio_dtmfe_t),
+ tdav_session_audio_dtmfe_ctor,
+ tdav_session_audio_dtmfe_dtor,
+ tdav_session_audio_dtmfe_cmp,
};
const tsk_object_def_t *tdav_session_audio_dtmfe_def_t = &tdav_session_audio_dtmfe_def_s;
diff --git a/tinyDAV/src/audio/tdav_speakup_jitterbuffer.c b/tinyDAV/src/audio/tdav_speakup_jitterbuffer.c
index cccc235..0c21e41 100755
--- a/tinyDAV/src/audio/tdav_speakup_jitterbuffer.c
+++ b/tinyDAV/src/audio/tdav_speakup_jitterbuffer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,7 +41,7 @@
#if TSK_UNDER_WINDOWS
# include <Winsock2.h> // timeval
#elif defined(__SYMBIAN32__)
-# include <_timeval.h>
+# include <_timeval.h>
#else
# include <sys/time.h>
#endif
@@ -52,171 +52,170 @@
static int tdav_speakup_jitterbuffer_set(tmedia_jitterbuffer_t *self, const tmedia_param_t* param)
{
- TSK_DEBUG_ERROR("Not implemented");
- return -2;
+ TSK_DEBUG_ERROR("Not implemented");
+ return -2;
}
static int tdav_speakup_jitterbuffer_open(tmedia_jitterbuffer_t* self, uint32_t frame_duration, uint32_t rate, uint32_t channels)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
- if(!jitterbuffer->jbuffer){
- if(!(jitterbuffer->jbuffer = jb_new())){
- TSK_DEBUG_ERROR("Failed to create new buffer");
- return -1;
- }
- jitterbuffer->jcodec = JB_CODEC_OTHER;
- }
- jitterbuffer->ref_timestamp = 0;
- jitterbuffer->frame_duration = frame_duration;
- jitterbuffer->rate = rate;
- jitterbuffer->channels = channels;
- jitterbuffer->_10ms_size_bytes = 160 * (rate/8000);
-
- return 0;
+ tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
+ if(!jitterbuffer->jbuffer) {
+ if(!(jitterbuffer->jbuffer = jb_new())) {
+ TSK_DEBUG_ERROR("Failed to create new buffer");
+ return -1;
+ }
+ jitterbuffer->jcodec = JB_CODEC_OTHER;
+ }
+ jitterbuffer->ref_timestamp = 0;
+ jitterbuffer->frame_duration = frame_duration;
+ jitterbuffer->rate = rate;
+ jitterbuffer->channels = channels;
+ jitterbuffer->_10ms_size_bytes = 160 * (rate/8000);
+
+ return 0;
}
static int tdav_speakup_jitterbuffer_tick(tmedia_jitterbuffer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_speakup_jitterbuffer_put(tmedia_jitterbuffer_t* self, void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+ tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
int i;
long now, ts;
void* _10ms_buf;
- uint8_t* pdata;
-
- if(!self || !data || !data_size || !jitterbuffer->jbuffer || !rtp_hdr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* synchronize the reference timestamp */
- if(!jitterbuffer->ref_timestamp){
- uint64_t now = tsk_time_now();
- struct timeval tv;
- long ts = (rtp_hdr->timestamp/(jitterbuffer->rate/1000));
- //=> Do not use (see clock_gettime() on linux): tsk_gettimeofday(&tv, tsk_null);
- tv.tv_sec = (long)(now)/1000;
- tv.tv_usec = (long)(now - (tv.tv_sec*1000))*1000;
-
- tv.tv_sec -= (ts / jitterbuffer->rate);
- tv.tv_usec -= (ts % jitterbuffer->rate) * 125;
- if((tv.tv_usec -= (tv.tv_usec % (TDAV_SPEAKUP_10MS * 10000))) <0){
- tv.tv_usec += 1000000;
- tv.tv_sec -= 1;
- }
- jitterbuffer->ref_timestamp = tsk_time_get_ms(&tv);
-
- switch(rtp_hdr->payload_type){
- case 8: /*TMEDIA_CODEC_FORMAT_G711a*/
- case 0: /* TMEDIA_CODEC_FORMAT_G711u */
- jitterbuffer->jcodec = JB_CODEC_G711x;
- break;
- case 18: /* TMEDIA_CODEC_FORMAT_G729 */
- jitterbuffer->jcodec = JB_CODEC_G729A;
- break;
- case 3: /* TMEDIA_CODEC_FORMAT_GSM */
- jitterbuffer->jcodec = JB_CODEC_GSM_EFR;
- break;
-
- default:
- jitterbuffer->jcodec = JB_CODEC_OTHER;
- break;
- }
- }
-
- // split as several 10ms frames
- now = (long) (tsk_time_now()-jitterbuffer->ref_timestamp);
- ts = (long)(rtp_hdr->timestamp/(jitterbuffer->rate/1000));
- pdata = (uint8_t*)data;
- for(i=0; i<(int)(data_size/jitterbuffer->_10ms_size_bytes);i++){
- if((_10ms_buf = tsk_calloc(jitterbuffer->_10ms_size_bytes, 1))){
- memcpy(_10ms_buf, &pdata[i*jitterbuffer->_10ms_size_bytes], jitterbuffer->_10ms_size_bytes);
- jb_put(jitterbuffer->jbuffer, _10ms_buf, JB_TYPE_VOICE, TDAV_SPEAKUP_10MS, ts, now, jitterbuffer->jcodec);
- _10ms_buf = tsk_null;
- }
- ts += TDAV_SPEAKUP_10MS;
- }
-
- return 0;
+ uint8_t* pdata;
+
+ if(!self || !data || !data_size || !jitterbuffer->jbuffer || !rtp_hdr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* synchronize the reference timestamp */
+ if(!jitterbuffer->ref_timestamp) {
+ uint64_t now = tsk_time_now();
+ struct timeval tv;
+ long ts = (rtp_hdr->timestamp/(jitterbuffer->rate/1000));
+ //=> Do not use (see clock_gettime() on linux): tsk_gettimeofday(&tv, tsk_null);
+ tv.tv_sec = (long)(now)/1000;
+ tv.tv_usec = (long)(now - (tv.tv_sec*1000))*1000;
+
+ tv.tv_sec -= (ts / jitterbuffer->rate);
+ tv.tv_usec -= (ts % jitterbuffer->rate) * 125;
+ if((tv.tv_usec -= (tv.tv_usec % (TDAV_SPEAKUP_10MS * 10000))) <0) {
+ tv.tv_usec += 1000000;
+ tv.tv_sec -= 1;
+ }
+ jitterbuffer->ref_timestamp = tsk_time_get_ms(&tv);
+
+ switch(rtp_hdr->payload_type) {
+ case 8: /*TMEDIA_CODEC_FORMAT_G711a*/
+ case 0: /* TMEDIA_CODEC_FORMAT_G711u */
+ jitterbuffer->jcodec = JB_CODEC_G711x;
+ break;
+ case 18: /* TMEDIA_CODEC_FORMAT_G729 */
+ jitterbuffer->jcodec = JB_CODEC_G729A;
+ break;
+ case 3: /* TMEDIA_CODEC_FORMAT_GSM */
+ jitterbuffer->jcodec = JB_CODEC_GSM_EFR;
+ break;
+
+ default:
+ jitterbuffer->jcodec = JB_CODEC_OTHER;
+ break;
+ }
+ }
+
+ // split as several 10ms frames
+ now = (long) (tsk_time_now()-jitterbuffer->ref_timestamp);
+ ts = (long)(rtp_hdr->timestamp/(jitterbuffer->rate/1000));
+ pdata = (uint8_t*)data;
+ for(i=0; i<(int)(data_size/jitterbuffer->_10ms_size_bytes); i++) {
+ if((_10ms_buf = tsk_calloc(jitterbuffer->_10ms_size_bytes, 1))) {
+ memcpy(_10ms_buf, &pdata[i*jitterbuffer->_10ms_size_bytes], jitterbuffer->_10ms_size_bytes);
+ jb_put(jitterbuffer->jbuffer, _10ms_buf, JB_TYPE_VOICE, TDAV_SPEAKUP_10MS, ts, now, jitterbuffer->jcodec);
+ _10ms_buf = tsk_null;
+ }
+ ts += TDAV_SPEAKUP_10MS;
+ }
+
+ return 0;
}
static tsk_size_t tdav_speakup_jitterbuffer_get(tmedia_jitterbuffer_t* self, void* out_data, tsk_size_t out_size)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
- int jret;
-
- int i, _10ms_count;
- long now;
- short* _10ms_buf = tsk_null;
- uint8_t* pout_data = (uint8_t*)out_data;
-
- if(!out_data || (out_size % jitterbuffer->_10ms_size_bytes)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- _10ms_count = (out_size/jitterbuffer->_10ms_size_bytes);
- now = (long) (tsk_time_now() - jitterbuffer->ref_timestamp);
- for(i=0; i<_10ms_count; i++){
-
- jret = jb_get(jitterbuffer->jbuffer, (void**)&_10ms_buf, now, TDAV_SPEAKUP_10MS);
- switch(jret){
- case JB_INTERP:
- TSK_DEBUG_INFO("JB_INTERP");
- jb_reset_all(jitterbuffer->jbuffer);
- memset(&pout_data[i*jitterbuffer->_10ms_size_bytes], 0, (_10ms_count*jitterbuffer->_10ms_size_bytes)-(i*jitterbuffer->_10ms_size_bytes));
- i = _10ms_count; // for exit
- break;
- case JB_OK:
- case JB_EMPTY:
- case JB_NOFRAME:
- case JB_NOJB:
- {
- if(_10ms_buf && (jret == JB_OK)){
- /* copy data */
- memcpy(&pout_data[i*jitterbuffer->_10ms_size_bytes], _10ms_buf, jitterbuffer->_10ms_size_bytes);
- }
- else{
- /* copy silence */
- memset(&pout_data[i*jitterbuffer->_10ms_size_bytes], 0, jitterbuffer->_10ms_size_bytes);
- }
- }
-
- default:
- break;
- }
- TSK_FREE(_10ms_buf);
- }
-
- return (_10ms_count * jitterbuffer->_10ms_size_bytes);
+ tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
+ int jret;
+
+ int i, _10ms_count;
+ long now;
+ short* _10ms_buf = tsk_null;
+ uint8_t* pout_data = (uint8_t*)out_data;
+
+ if(!out_data || (out_size % jitterbuffer->_10ms_size_bytes)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ _10ms_count = (out_size/jitterbuffer->_10ms_size_bytes);
+ now = (long) (tsk_time_now() - jitterbuffer->ref_timestamp);
+ for(i=0; i<_10ms_count; i++) {
+
+ jret = jb_get(jitterbuffer->jbuffer, (void**)&_10ms_buf, now, TDAV_SPEAKUP_10MS);
+ switch(jret) {
+ case JB_INTERP:
+ TSK_DEBUG_INFO("JB_INTERP");
+ jb_reset_all(jitterbuffer->jbuffer);
+ memset(&pout_data[i*jitterbuffer->_10ms_size_bytes], 0, (_10ms_count*jitterbuffer->_10ms_size_bytes)-(i*jitterbuffer->_10ms_size_bytes));
+ i = _10ms_count; // for exit
+ break;
+ case JB_OK:
+ case JB_EMPTY:
+ case JB_NOFRAME:
+ case JB_NOJB: {
+ if(_10ms_buf && (jret == JB_OK)) {
+ /* copy data */
+ memcpy(&pout_data[i*jitterbuffer->_10ms_size_bytes], _10ms_buf, jitterbuffer->_10ms_size_bytes);
+ }
+ else {
+ /* copy silence */
+ memset(&pout_data[i*jitterbuffer->_10ms_size_bytes], 0, jitterbuffer->_10ms_size_bytes);
+ }
+ }
+
+ default:
+ break;
+ }
+ TSK_FREE(_10ms_buf);
+ }
+
+ return (_10ms_count * jitterbuffer->_10ms_size_bytes);
}
static int tdav_speakup_jitterbuffer_reset(tmedia_jitterbuffer_t* self)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
- if(jitterbuffer->jbuffer){
- jb_reset_all(jitterbuffer->jbuffer);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("invalid parameter");
- return -1;
- }
+ tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
+ if(jitterbuffer->jbuffer) {
+ jb_reset_all(jitterbuffer->jbuffer);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
}
static int tdav_speakup_jitterbuffer_close(tmedia_jitterbuffer_t* self)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
- if(jitterbuffer->jbuffer){
- jb_destroy(jitterbuffer->jbuffer);
- jitterbuffer->jbuffer = tsk_null;
- }
- return 0;
+ tdav_speakup_jitterbuffer_t *jitterbuffer = (tdav_speakup_jitterbuffer_t *)self;
+ if(jitterbuffer->jbuffer) {
+ jb_destroy(jitterbuffer->jbuffer);
+ jitterbuffer->jbuffer = tsk_null;
+ }
+ return 0;
}
@@ -228,53 +227,51 @@ static int tdav_speakup_jitterbuffer_close(tmedia_jitterbuffer_t* self)
/* constructor */
static tsk_object_t* tdav_speakup_jitterbuffer_ctor(tsk_object_t * self, va_list * app)
{
- tdav_speakup_jitterbuffer_t *jitterbuffer = self;
- TSK_DEBUG_INFO("Create speekup jitter buffer");
- if(jitterbuffer){
- /* init base */
- tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(jitterbuffer));
- /* init self */
- }
- return self;
+ tdav_speakup_jitterbuffer_t *jitterbuffer = self;
+ TSK_DEBUG_INFO("Create speekup jitter buffer");
+ if(jitterbuffer) {
+ /* init base */
+ tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(jitterbuffer));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_speakup_jitterbuffer_dtor(tsk_object_t * self)
-{
- tdav_speakup_jitterbuffer_t *jitterbuffer = self;
- if(jitterbuffer){
- /* deinit base */
- tmedia_jitterbuffer_deinit(TMEDIA_JITTER_BUFFER(jitterbuffer));
- /* deinit self */
- if(jitterbuffer->jbuffer){
- jb_destroy(jitterbuffer->jbuffer);
- jitterbuffer->jbuffer = tsk_null;
- }
- }
-
- return self;
+{
+ tdav_speakup_jitterbuffer_t *jitterbuffer = self;
+ if(jitterbuffer) {
+ /* deinit base */
+ tmedia_jitterbuffer_deinit(TMEDIA_JITTER_BUFFER(jitterbuffer));
+ /* deinit self */
+ if(jitterbuffer->jbuffer) {
+ jb_destroy(jitterbuffer->jbuffer);
+ jitterbuffer->jbuffer = tsk_null;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_speakup_jitterbuffer_def_s =
-{
- sizeof(tdav_speakup_jitterbuffer_t),
- tdav_speakup_jitterbuffer_ctor,
- tdav_speakup_jitterbuffer_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_speakup_jitterbuffer_def_s = {
+ sizeof(tdav_speakup_jitterbuffer_t),
+ tdav_speakup_jitterbuffer_ctor,
+ tdav_speakup_jitterbuffer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_jitterbuffer_plugin_def_t tdav_speakup_jitterbuffer_plugin_def_s =
-{
- &tdav_speakup_jitterbuffer_def_s,
- tmedia_audio,
- "Audio/video JitterBuffer based on Speakup",
-
- tdav_speakup_jitterbuffer_set,
- tdav_speakup_jitterbuffer_open,
- tdav_speakup_jitterbuffer_tick,
- tdav_speakup_jitterbuffer_put,
- tdav_speakup_jitterbuffer_get,
- tdav_speakup_jitterbuffer_reset,
- tdav_speakup_jitterbuffer_close,
+static const tmedia_jitterbuffer_plugin_def_t tdav_speakup_jitterbuffer_plugin_def_s = {
+ &tdav_speakup_jitterbuffer_def_s,
+ tmedia_audio,
+ "Audio/video JitterBuffer based on Speakup",
+
+ tdav_speakup_jitterbuffer_set,
+ tdav_speakup_jitterbuffer_open,
+ tdav_speakup_jitterbuffer_tick,
+ tdav_speakup_jitterbuffer_put,
+ tdav_speakup_jitterbuffer_get,
+ tdav_speakup_jitterbuffer_reset,
+ tdav_speakup_jitterbuffer_close,
};
const tmedia_jitterbuffer_plugin_def_t *tdav_speakup_jitterbuffer_plugin_def_t = &tdav_speakup_jitterbuffer_plugin_def_s;
diff --git a/tinyDAV/src/audio/tdav_speex_denoise.c b/tinyDAV/src/audio/tdav_speex_denoise.c
index 4f344dd..ee2733e 100755
--- a/tinyDAV/src/audio/tdav_speex_denoise.c
+++ b/tinyDAV/src/audio/tdav_speex_denoise.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,205 +37,204 @@
#include <speex/speex_echo.h>
/** Speex denoiser*/
-typedef struct tdav_speex_denoise_s
-{
- TMEDIA_DECLARE_DENOISE;
+typedef struct tdav_speex_denoise_s {
+ TMEDIA_DECLARE_DENOISE;
- SpeexPreprocessState *preprocess_state_record;
- SpeexPreprocessState *preprocess_state_playback;
- SpeexEchoState *echo_state;
+ SpeexPreprocessState *preprocess_state_record;
+ SpeexPreprocessState *preprocess_state_playback;
+ SpeexEchoState *echo_state;
- spx_int16_t* echo_output_frame;
- uint32_t record_frame_size_samples, record_frame_size_bytes;
- uint32_t playback_frame_size_samples, playback_frame_size_bytes;
+ spx_int16_t* echo_output_frame;
+ uint32_t record_frame_size_samples, record_frame_size_bytes;
+ uint32_t playback_frame_size_samples, playback_frame_size_bytes;
}
tdav_speex_denoise_t;
static int tdav_speex_denoise_set(tmedia_denoise_t* _self, const tmedia_param_t* param)
{
- tdav_speex_denoise_t *self = (tdav_speex_denoise_t *)_self;
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "echo-tail")){
- int32_t echo_tail = *((int32_t*)param->value);
- TSK_DEBUG_INFO("speex_set_echo_tail(%d) ignore", echo_tail); // because Speex AEC just do not work (use WebRTC)
- return 0;
- }
- }
- return -1;
+ tdav_speex_denoise_t *self = (tdav_speex_denoise_t *)_self;
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "echo-tail")) {
+ int32_t echo_tail = *((int32_t*)param->value);
+ TSK_DEBUG_INFO("speex_set_echo_tail(%d) ignore", echo_tail); // because Speex AEC just do not work (use WebRTC)
+ return 0;
+ }
+ }
+ return -1;
}
static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t record_channels, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate, uint32_t playback_channels)
{
- tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
- float f;
- int i;
-
- if (!denoiser->echo_state && TMEDIA_DENOISE(denoiser)->echo_supp_enabled) {
- TSK_DEBUG_INFO("Init Aec frame_size[%u] filter_length[%u] SampleRate[%u]",
- (uint32_t)(record_frame_size_samples),TMEDIA_DENOISE(denoiser)->echo_tail*record_frame_size_samples, record_sampling_rate);
- if((denoiser->echo_state = speex_echo_state_init(record_frame_size_samples, TMEDIA_DENOISE(denoiser)->echo_tail))){
- speex_echo_ctl(denoiser->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &record_sampling_rate);
- }
- }
-
- if (!denoiser->preprocess_state_record && !denoiser->preprocess_state_playback) {
- denoiser->record_frame_size_samples = record_frame_size_samples;
- denoiser->record_frame_size_bytes = (record_frame_size_samples << 1);
- denoiser->playback_frame_size_samples = playback_frame_size_samples;
- denoiser->playback_frame_size_bytes = (playback_frame_size_samples << 1);
-
- if((denoiser->preprocess_state_record = speex_preprocess_state_init(record_frame_size_samples, record_sampling_rate))
- && (denoiser->preprocess_state_playback = speex_preprocess_state_init(playback_frame_size_samples, playback_sampling_rate))
- ){
-
- // Echo suppression
- if(denoiser->echo_state){
- int echo_supp , echo_supp_active = 0;
-
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_STATE, denoiser->echo_state);
-
- TSK_FREE(denoiser->echo_output_frame);
- denoiser->echo_output_frame = tsk_calloc(denoiser->record_frame_size_samples, sizeof(spx_int16_t));
-
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS , &echo_supp );
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
- TSK_DEBUG_INFO("AEC echo_supp level [%d] echo_supp_active level[%d] ", echo_supp , echo_supp_active);
- echo_supp = -60 ;
- echo_supp_active = -60 ;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS , &echo_supp );
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
- // TRACES
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS , &echo_supp );
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
- TSK_DEBUG_INFO("New aec echo_supp level [%d] echo_supp_active level[%d] ", echo_supp , echo_supp_active);
- }
-
- // Noise suppression
- if(TMEDIA_DENOISE(denoiser)->noise_supp_enabled){
- TSK_DEBUG_INFO("SpeexDSP: Noise supp enabled");
- i = 1;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_DENOISE, &i);
- speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_DENOISE, &i);
- i = TMEDIA_DENOISE(denoiser)->noise_supp_level;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
- speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
- }
- else{
- i = 0;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_DENOISE, &i);
- speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_DENOISE, &i);
- }
-
- // Automatic gain control
- if(TMEDIA_DENOISE(denoiser)->agc_enabled){
- float agc_level = TMEDIA_DENOISE(denoiser)->agc_level;
- TSK_DEBUG_INFO("SpeexDSP: AGC enabled");
-
- i = 1;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC, &i);
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC_LEVEL, &agc_level);
- }
- else{
- i = 0, f = 8000.0f;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC, &i);
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f);
- }
-
- // Voice Activity detection
- i = TMEDIA_DENOISE(denoiser)->vad_enabled ? 1 : 0;
- speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_VAD, &i);
-
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create Speex preprocessor state");
- return -2;
- }
- }
-
- return 0;
+ tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
+ float f;
+ int i;
+
+ if (!denoiser->echo_state && TMEDIA_DENOISE(denoiser)->echo_supp_enabled) {
+ TSK_DEBUG_INFO("Init Aec frame_size[%u] filter_length[%u] SampleRate[%u]",
+ (uint32_t)(record_frame_size_samples),TMEDIA_DENOISE(denoiser)->echo_tail*record_frame_size_samples, record_sampling_rate);
+ if((denoiser->echo_state = speex_echo_state_init(record_frame_size_samples, TMEDIA_DENOISE(denoiser)->echo_tail))) {
+ speex_echo_ctl(denoiser->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &record_sampling_rate);
+ }
+ }
+
+ if (!denoiser->preprocess_state_record && !denoiser->preprocess_state_playback) {
+ denoiser->record_frame_size_samples = record_frame_size_samples;
+ denoiser->record_frame_size_bytes = (record_frame_size_samples << 1);
+ denoiser->playback_frame_size_samples = playback_frame_size_samples;
+ denoiser->playback_frame_size_bytes = (playback_frame_size_samples << 1);
+
+ if((denoiser->preprocess_state_record = speex_preprocess_state_init(record_frame_size_samples, record_sampling_rate))
+ && (denoiser->preprocess_state_playback = speex_preprocess_state_init(playback_frame_size_samples, playback_sampling_rate))
+ ) {
+
+ // Echo suppression
+ if(denoiser->echo_state) {
+ int echo_supp , echo_supp_active = 0;
+
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_STATE, denoiser->echo_state);
+
+ TSK_FREE(denoiser->echo_output_frame);
+ denoiser->echo_output_frame = tsk_calloc(denoiser->record_frame_size_samples, sizeof(spx_int16_t));
+
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS , &echo_supp );
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
+ TSK_DEBUG_INFO("AEC echo_supp level [%d] echo_supp_active level[%d] ", echo_supp , echo_supp_active);
+ echo_supp = -60 ;
+ echo_supp_active = -60 ;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS , &echo_supp );
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
+ // TRACES
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS , &echo_supp );
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
+ TSK_DEBUG_INFO("New aec echo_supp level [%d] echo_supp_active level[%d] ", echo_supp , echo_supp_active);
+ }
+
+ // Noise suppression
+ if(TMEDIA_DENOISE(denoiser)->noise_supp_enabled) {
+ TSK_DEBUG_INFO("SpeexDSP: Noise supp enabled");
+ i = 1;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_DENOISE, &i);
+ speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_DENOISE, &i);
+ i = TMEDIA_DENOISE(denoiser)->noise_supp_level;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
+ speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
+ }
+ else {
+ i = 0;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_DENOISE, &i);
+ speex_preprocess_ctl(denoiser->preprocess_state_playback, SPEEX_PREPROCESS_SET_DENOISE, &i);
+ }
+
+ // Automatic gain control
+ if(TMEDIA_DENOISE(denoiser)->agc_enabled) {
+ float agc_level = TMEDIA_DENOISE(denoiser)->agc_level;
+ TSK_DEBUG_INFO("SpeexDSP: AGC enabled");
+
+ i = 1;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC, &i);
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC_LEVEL, &agc_level);
+ }
+ else {
+ i = 0, f = 8000.0f;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC, &i);
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f);
+ }
+
+ // Voice Activity detection
+ i = TMEDIA_DENOISE(denoiser)->vad_enabled ? 1 : 0;
+ speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_VAD, &i);
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create Speex preprocessor state");
+ return -2;
+ }
+ }
+
+ return 0;
}
static int tdav_speex_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
- tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
+ tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
- if(denoiser->record_frame_size_bytes != echo_frame_size_bytes){
- TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_frame_size_bytes, echo_frame_size_bytes);
- return -1;
- }
+ if(denoiser->record_frame_size_bytes != echo_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_frame_size_bytes, echo_frame_size_bytes);
+ return -1;
+ }
- if(denoiser->echo_state){
- speex_echo_playback(denoiser->echo_state, echo_frame);
- }
- return 0;
+ if(denoiser->echo_state) {
+ speex_echo_playback(denoiser->echo_state, echo_frame);
+ }
+ return 0;
}
static int tdav_speex_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
- tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
- int vad;
-
- if(denoiser->record_frame_size_bytes != audio_frame_size_bytes){
- TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_frame_size_bytes, audio_frame_size_bytes);
- return -1;
- }
-
- if(denoiser->preprocess_state_record){
- if(denoiser->echo_state && denoiser->echo_output_frame){
- speex_echo_capture(denoiser->echo_state, audio_frame, denoiser->echo_output_frame);
- memcpy(audio_frame, denoiser->echo_output_frame, denoiser->record_frame_size_bytes);
- }
- vad = speex_preprocess_run(denoiser->preprocess_state_record, audio_frame);
- if(!vad && TMEDIA_DENOISE(denoiser)->vad_enabled){
- *silence_or_noise = tsk_true;
- }
- }
-
- return 0;
+ tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
+ int vad;
+
+ if(denoiser->record_frame_size_bytes != audio_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->record_frame_size_bytes, audio_frame_size_bytes);
+ return -1;
+ }
+
+ if(denoiser->preprocess_state_record) {
+ if(denoiser->echo_state && denoiser->echo_output_frame) {
+ speex_echo_capture(denoiser->echo_state, audio_frame, denoiser->echo_output_frame);
+ memcpy(audio_frame, denoiser->echo_output_frame, denoiser->record_frame_size_bytes);
+ }
+ vad = speex_preprocess_run(denoiser->preprocess_state_record, audio_frame);
+ if(!vad && TMEDIA_DENOISE(denoiser)->vad_enabled) {
+ *silence_or_noise = tsk_true;
+ }
+ }
+
+ return 0;
}
static int tdav_speex_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
- tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
+ tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
- if(denoiser->playback_frame_size_bytes != audio_frame_size_bytes){
- TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->playback_frame_size_bytes, audio_frame_size_bytes);
- return -1;
- }
+ if(denoiser->playback_frame_size_bytes != audio_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->playback_frame_size_bytes, audio_frame_size_bytes);
+ return -1;
+ }
- if(denoiser->preprocess_state_playback){
- speex_preprocess_run(denoiser->preprocess_state_playback, audio_frame);
- }
- return 0;
+ if(denoiser->preprocess_state_playback) {
+ speex_preprocess_run(denoiser->preprocess_state_playback, audio_frame);
+ }
+ return 0;
}
static int tdav_speex_denoise_close(tmedia_denoise_t* self)
{
- tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
-
- if(denoiser->preprocess_state_record){
- speex_preprocess_state_destroy(denoiser->preprocess_state_record);
- denoiser->preprocess_state_record = tsk_null;
- }
- if(denoiser->preprocess_state_playback){
- speex_preprocess_state_destroy(denoiser->preprocess_state_playback);
- denoiser->preprocess_state_playback = tsk_null;
- }
- if(denoiser->echo_state){
- speex_echo_state_destroy(denoiser->echo_state);
- denoiser->echo_state = tsk_null;
- }
- TSK_FREE(denoiser->echo_output_frame);
-
- return 0;
+ tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
+
+ if(denoiser->preprocess_state_record) {
+ speex_preprocess_state_destroy(denoiser->preprocess_state_record);
+ denoiser->preprocess_state_record = tsk_null;
+ }
+ if(denoiser->preprocess_state_playback) {
+ speex_preprocess_state_destroy(denoiser->preprocess_state_playback);
+ denoiser->preprocess_state_playback = tsk_null;
+ }
+ if(denoiser->echo_state) {
+ speex_echo_state_destroy(denoiser->echo_state);
+ denoiser->echo_state = tsk_null;
+ }
+ TSK_FREE(denoiser->echo_output_frame);
+
+ return 0;
}
@@ -247,64 +246,62 @@ static int tdav_speex_denoise_close(tmedia_denoise_t* self)
/* constructor */
static tsk_object_t* tdav_speex_denoise_ctor(tsk_object_t * self, va_list * app)
{
- tdav_speex_denoise_t *denoise = self;
- if(denoise){
- /* init base */
- tmedia_denoise_init(TMEDIA_DENOISE(denoise));
- /* init self */
-
- TSK_DEBUG_INFO("Create SpeexDSP denoiser");
- }
- return self;
+ tdav_speex_denoise_t *denoise = self;
+ if(denoise) {
+ /* init base */
+ tmedia_denoise_init(TMEDIA_DENOISE(denoise));
+ /* init self */
+
+ TSK_DEBUG_INFO("Create SpeexDSP denoiser");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_speex_denoise_dtor(tsk_object_t * self)
-{
- tdav_speex_denoise_t *denoise = self;
- if(denoise){
- /* deinit base */
- tmedia_denoise_deinit(TMEDIA_DENOISE(denoise));
- /* deinit self */
- if(denoise->preprocess_state_record){
- speex_preprocess_state_destroy(denoise->preprocess_state_record);
- denoise->preprocess_state_record = tsk_null;
- }
- if(denoise->preprocess_state_playback){
- speex_preprocess_state_destroy(denoise->preprocess_state_playback);
- denoise->preprocess_state_playback = tsk_null;
- }
- if(denoise->echo_state){
- speex_echo_state_destroy(denoise->echo_state);
- denoise->echo_state = tsk_null;
- }
- TSK_FREE(denoise->echo_output_frame);
-
- TSK_DEBUG_INFO("*** SpeexDSP denoiser destroyed ***");
- }
-
- return self;
+{
+ tdav_speex_denoise_t *denoise = self;
+ if(denoise) {
+ /* deinit base */
+ tmedia_denoise_deinit(TMEDIA_DENOISE(denoise));
+ /* deinit self */
+ if(denoise->preprocess_state_record) {
+ speex_preprocess_state_destroy(denoise->preprocess_state_record);
+ denoise->preprocess_state_record = tsk_null;
+ }
+ if(denoise->preprocess_state_playback) {
+ speex_preprocess_state_destroy(denoise->preprocess_state_playback);
+ denoise->preprocess_state_playback = tsk_null;
+ }
+ if(denoise->echo_state) {
+ speex_echo_state_destroy(denoise->echo_state);
+ denoise->echo_state = tsk_null;
+ }
+ TSK_FREE(denoise->echo_output_frame);
+
+ TSK_DEBUG_INFO("*** SpeexDSP denoiser destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_speex_denoise_def_s =
-{
- sizeof(tdav_speex_denoise_t),
- tdav_speex_denoise_ctor,
- tdav_speex_denoise_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_speex_denoise_def_s = {
+ sizeof(tdav_speex_denoise_t),
+ tdav_speex_denoise_ctor,
+ tdav_speex_denoise_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_denoise_plugin_def_t tdav_speex_denoise_plugin_def_s =
-{
- &tdav_speex_denoise_def_s,
+static const tmedia_denoise_plugin_def_t tdav_speex_denoise_plugin_def_s = {
+ &tdav_speex_denoise_def_s,
- "Audio Denoiser based on SpeexDSP",
+ "Audio Denoiser based on SpeexDSP",
- tdav_speex_denoise_set,
- tdav_speex_denoise_open,
- tdav_speex_denoise_echo_playback,
- tdav_speex_denoise_process_record,
- tdav_speex_denoise_process_playback,
- tdav_speex_denoise_close,
+ tdav_speex_denoise_set,
+ tdav_speex_denoise_open,
+ tdav_speex_denoise_echo_playback,
+ tdav_speex_denoise_process_record,
+ tdav_speex_denoise_process_playback,
+ tdav_speex_denoise_close,
};
const tmedia_denoise_plugin_def_t *tdav_speex_denoise_plugin_def_t = &tdav_speex_denoise_plugin_def_s;
diff --git a/tinyDAV/src/audio/tdav_speex_jitterbuffer.c b/tinyDAV/src/audio/tdav_speex_jitterbuffer.c
index d4639b9..a83f49b 100755
--- a/tinyDAV/src/audio/tdav_speex_jitterbuffer.c
+++ b/tinyDAV/src/audio/tdav_speex_jitterbuffer.c
@@ -36,221 +36,220 @@
#include <speex/speex_jitter.h>
/** Speex JitterBuffer*/
-typedef struct tdav_speex_jitterBuffer_s
-{
- TMEDIA_DECLARE_JITTER_BUFFER;
-
- JitterBuffer* state;
- uint32_t rate;
- uint32_t frame_duration;
- uint32_t channels;
- uint32_t x_data_size; // expected data size
- uint16_t fake_seqnum; // if ptime mismatch then, reassembled pkt will have invalid seqnum
- struct {
- uint8_t* ptr;
- tsk_size_t size;
- tsk_size_t index;
- } buff;
-
- uint64_t num_pkt_in; // Number of incoming pkts since the last reset
- uint64_t num_pkt_miss; // Number of times we got consecutive "JITTER_BUFFER_MISSING" results
- uint64_t num_pkt_miss_max; // Max value for "num_pkt_miss" before reset()ing the jitter buffer
+typedef struct tdav_speex_jitterBuffer_s {
+ TMEDIA_DECLARE_JITTER_BUFFER;
+
+ JitterBuffer* state;
+ uint32_t rate;
+ uint32_t frame_duration;
+ uint32_t channels;
+ uint32_t x_data_size; // expected data size
+ uint16_t fake_seqnum; // if ptime mismatch then, reassembled pkt will have invalid seqnum
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ tsk_size_t index;
+ } buff;
+
+ uint64_t num_pkt_in; // Number of incoming pkts since the last reset
+ uint64_t num_pkt_miss; // Number of times we got consecutive "JITTER_BUFFER_MISSING" results
+ uint64_t num_pkt_miss_max; // Max value for "num_pkt_miss" before reset()ing the jitter buffer
}
tdav_speex_jitterbuffer_t;
static int tdav_speex_jitterbuffer_set(tmedia_jitterbuffer_t *self, const tmedia_param_t* param)
{
- TSK_DEBUG_ERROR("Not implemented");
- return -2;
+ TSK_DEBUG_ERROR("Not implemented");
+ return -2;
}
static int tdav_speex_jitterbuffer_open(tmedia_jitterbuffer_t* self, uint32_t frame_duration, uint32_t rate, uint32_t channels)
{
- tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
- spx_int32_t tmp;
-
- TSK_DEBUG_INFO("Open speex jb (ptime=%u, rate=%u)", frame_duration, rate);
-
- if (!(jitterbuffer->state = jitter_buffer_init((int)frame_duration))) {
- TSK_DEBUG_ERROR("jitter_buffer_init() failed");
- return -2;
- }
- jitterbuffer->rate = rate;
- jitterbuffer->frame_duration = frame_duration;
- jitterbuffer->channels = channels;
- jitterbuffer->x_data_size = ((frame_duration * jitterbuffer->rate) / 500) << (channels == 2 ? 1 : 0);
-
- jitterbuffer->num_pkt_in = 0;
- jitterbuffer->num_pkt_miss = 0;
- jitterbuffer->num_pkt_miss_max = (1000 / frame_duration) * 2; // 2 seconds missing --> "Houston, we have a problem"
-
- jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MARGIN, &tmp);
- TSK_DEBUG_INFO("Default Jitter buffer margin=%d", tmp);
- jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MAX_LATE_RATE, &tmp);
- TSK_DEBUG_INFO("Default Jitter max late rate=%d", tmp);
-
- if ((tmp = tmedia_defaults_get_jb_margin()) >= 0) {
- jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MARGIN, &tmp);
- TSK_DEBUG_INFO("New Jitter buffer margin=%d", tmp);
- }
- if ((tmp = tmedia_defaults_get_jb_max_late_rate()) >= 0) {
- jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MAX_LATE_RATE, &tmp);
- TSK_DEBUG_INFO("New Jitter buffer max late rate=%d", tmp);
- }
-
- return 0;
+ tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
+ spx_int32_t tmp;
+
+ TSK_DEBUG_INFO("Open speex jb (ptime=%u, rate=%u)", frame_duration, rate);
+
+ if (!(jitterbuffer->state = jitter_buffer_init((int)frame_duration))) {
+ TSK_DEBUG_ERROR("jitter_buffer_init() failed");
+ return -2;
+ }
+ jitterbuffer->rate = rate;
+ jitterbuffer->frame_duration = frame_duration;
+ jitterbuffer->channels = channels;
+ jitterbuffer->x_data_size = ((frame_duration * jitterbuffer->rate) / 500) << (channels == 2 ? 1 : 0);
+
+ jitterbuffer->num_pkt_in = 0;
+ jitterbuffer->num_pkt_miss = 0;
+ jitterbuffer->num_pkt_miss_max = (1000 / frame_duration) * 2; // 2 seconds missing --> "Houston, we have a problem"
+
+ jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MARGIN, &tmp);
+ TSK_DEBUG_INFO("Default Jitter buffer margin=%d", tmp);
+ jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MAX_LATE_RATE, &tmp);
+ TSK_DEBUG_INFO("Default Jitter max late rate=%d", tmp);
+
+ if ((tmp = tmedia_defaults_get_jb_margin()) >= 0) {
+ jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MARGIN, &tmp);
+ TSK_DEBUG_INFO("New Jitter buffer margin=%d", tmp);
+ }
+ if ((tmp = tmedia_defaults_get_jb_max_late_rate()) >= 0) {
+ jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MAX_LATE_RATE, &tmp);
+ TSK_DEBUG_INFO("New Jitter buffer max late rate=%d", tmp);
+ }
+
+ return 0;
}
static int tdav_speex_jitterbuffer_tick(tmedia_jitterbuffer_t* self)
{
- tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
- if (!jitterbuffer->state) {
- TSK_DEBUG_ERROR("Invalid state");
- return -1;
- }
- jitter_buffer_tick(jitterbuffer->state);
- return 0;
+ tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
+ if (!jitterbuffer->state) {
+ TSK_DEBUG_ERROR("Invalid state");
+ return -1;
+ }
+ jitter_buffer_tick(jitterbuffer->state);
+ return 0;
}
static int tdav_speex_jitterbuffer_put(tmedia_jitterbuffer_t* self, void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
- const trtp_rtp_header_t* rtp_hdr;
- JitterBufferPacket jb_packet;
- static uint16_t seq_num = 0;
-
- if (!data || !data_size || !proto_hdr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!jb->state) {
- TSK_DEBUG_ERROR("Invalid state");
- return -2;
- }
-
- rtp_hdr = TRTP_RTP_HEADER(proto_hdr);
-
- jb_packet.user_data = 0;
- jb_packet.span = jb->frame_duration;
- jb_packet.len = jb->x_data_size;
-
- if (jb->x_data_size == data_size) { /* ptime match */
- jb_packet.data = data;
- jb_packet.sequence = rtp_hdr->seq_num;
- jb_packet.timestamp = (rtp_hdr->seq_num * jb_packet.span);
- jitter_buffer_put(jb->state, &jb_packet);
- }
- else { /* ptime mismatch */
- tsk_size_t i;
- jb_packet.sequence = 0; // Ignore
- if ((jb->buff.index + data_size) > jb->buff.size) {
- if (!(jb->buff.ptr = tsk_realloc(jb->buff.ptr, (jb->buff.index + data_size)))) {
- jb->buff.size = 0;
- jb->buff.index = 0;
- return 0;
- }
- jb->buff.size = (jb->buff.index + data_size);
- }
-
- memcpy(&jb->buff.ptr[jb->buff.index], data, data_size);
- jb->buff.index += data_size;
-
- if (jb->buff.index >= jb->x_data_size) {
- tsk_size_t copied = 0;
- for (i = 0; (i + jb->x_data_size) <= jb->buff.index; i += jb->x_data_size) {
- jb_packet.data = (char*)&jb->buff.ptr[i];
- jb_packet.timestamp = (++jb->fake_seqnum * jb_packet.span);// reassembled pkt will have fake seqnum
- jitter_buffer_put(jb->state, &jb_packet);
- copied += jb->x_data_size;
- }
- if (copied == jb->buff.index) {
- // all copied
- jb->buff.index = 0;
- }
- else {
- memmove(&jb->buff.ptr[0], &jb->buff.ptr[copied], (jb->buff.index - copied));
- jb->buff.index -= copied;
- }
- }
- }
- ++jb->num_pkt_in;
-
- return 0;
+ tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
+ const trtp_rtp_header_t* rtp_hdr;
+ JitterBufferPacket jb_packet;
+ static uint16_t seq_num = 0;
+
+ if (!data || !data_size || !proto_hdr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!jb->state) {
+ TSK_DEBUG_ERROR("Invalid state");
+ return -2;
+ }
+
+ rtp_hdr = TRTP_RTP_HEADER(proto_hdr);
+
+ jb_packet.user_data = 0;
+ jb_packet.span = jb->frame_duration;
+ jb_packet.len = jb->x_data_size;
+
+ if (jb->x_data_size == data_size) { /* ptime match */
+ jb_packet.data = data;
+ jb_packet.sequence = rtp_hdr->seq_num;
+ jb_packet.timestamp = (rtp_hdr->seq_num * jb_packet.span);
+ jitter_buffer_put(jb->state, &jb_packet);
+ }
+ else { /* ptime mismatch */
+ tsk_size_t i;
+ jb_packet.sequence = 0; // Ignore
+ if ((jb->buff.index + data_size) > jb->buff.size) {
+ if (!(jb->buff.ptr = tsk_realloc(jb->buff.ptr, (jb->buff.index + data_size)))) {
+ jb->buff.size = 0;
+ jb->buff.index = 0;
+ return 0;
+ }
+ jb->buff.size = (jb->buff.index + data_size);
+ }
+
+ memcpy(&jb->buff.ptr[jb->buff.index], data, data_size);
+ jb->buff.index += data_size;
+
+ if (jb->buff.index >= jb->x_data_size) {
+ tsk_size_t copied = 0;
+ for (i = 0; (i + jb->x_data_size) <= jb->buff.index; i += jb->x_data_size) {
+ jb_packet.data = (char*)&jb->buff.ptr[i];
+ jb_packet.timestamp = (++jb->fake_seqnum * jb_packet.span);// reassembled pkt will have fake seqnum
+ jitter_buffer_put(jb->state, &jb_packet);
+ copied += jb->x_data_size;
+ }
+ if (copied == jb->buff.index) {
+ // all copied
+ jb->buff.index = 0;
+ }
+ else {
+ memmove(&jb->buff.ptr[0], &jb->buff.ptr[copied], (jb->buff.index - copied));
+ jb->buff.index -= copied;
+ }
+ }
+ }
+ ++jb->num_pkt_in;
+
+ return 0;
}
static tsk_size_t tdav_speex_jitterbuffer_get(tmedia_jitterbuffer_t* self, void* out_data, tsk_size_t out_size)
{
- tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
- JitterBufferPacket jb_packet;
- int ret, miss = 0;
- tsk_size_t ret_size = 0;
-
- if (!out_data || !out_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- if (!jb->state) {
- TSK_DEBUG_ERROR("Invalid state");
- return 0;
- }
- if (jb->x_data_size != out_size) { // consumer must request PTIME data
- TSK_DEBUG_WARN("%d not expected as frame size. %u<>%u", out_size, jb->frame_duration, (out_size * 500) / jb->rate);
- return 0;
- }
-
- jb_packet.data = out_data;
- jb_packet.len = (spx_uint32_t)out_size;
-
- if ((ret = jitter_buffer_get(jb->state, &jb_packet, jb->frame_duration/*(out_size * 500)/jb->rate*/, tsk_null)) != JITTER_BUFFER_OK) {
- ++jb->num_pkt_miss;
- switch (ret) {
- case JITTER_BUFFER_MISSING:
- /*TSK_DEBUG_INFO("JITTER_BUFFER_MISSING - %d", ret);*/
- if (jb->num_pkt_miss > jb->num_pkt_miss_max /*too much missing pkts*/ && jb->num_pkt_in > jb->num_pkt_miss_max/*we're really receiving pkts*/) {
- jb->num_pkt_miss = 0;
- self->plugin->reset(self);
- TSK_DEBUG_WARN("Too much missing audio pkts");
- }
- break;
- case JITTER_BUFFER_INSERTION:
- /*TSK_DEBUG_INFO("JITTER_BUFFER_INSERTION - %d", ret);*/
- break;
- default:
- TSK_DEBUG_INFO("jitter_buffer_get() failed - %d", ret);
- break;
- }
- // jitter_buffer_update_delay(jb->state, &jb_packet, NULL);
- //return 0;
- }
- else {
- jb->num_pkt_miss = 0; // reset
- ret_size = jb_packet.len;
- }
- //jitter_buffer_update_delay(jb->state, &jb_packet, NULL);
-
- return ret_size;
+ tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
+ JitterBufferPacket jb_packet;
+ int ret, miss = 0;
+ tsk_size_t ret_size = 0;
+
+ if (!out_data || !out_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ if (!jb->state) {
+ TSK_DEBUG_ERROR("Invalid state");
+ return 0;
+ }
+ if (jb->x_data_size != out_size) { // consumer must request PTIME data
+ TSK_DEBUG_WARN("%d not expected as frame size. %u<>%u", out_size, jb->frame_duration, (out_size * 500) / jb->rate);
+ return 0;
+ }
+
+ jb_packet.data = out_data;
+ jb_packet.len = (spx_uint32_t)out_size;
+
+ if ((ret = jitter_buffer_get(jb->state, &jb_packet, jb->frame_duration/*(out_size * 500)/jb->rate*/, tsk_null)) != JITTER_BUFFER_OK) {
+ ++jb->num_pkt_miss;
+ switch (ret) {
+ case JITTER_BUFFER_MISSING:
+ /*TSK_DEBUG_INFO("JITTER_BUFFER_MISSING - %d", ret);*/
+ if (jb->num_pkt_miss > jb->num_pkt_miss_max /*too much missing pkts*/ && jb->num_pkt_in > jb->num_pkt_miss_max/*we're really receiving pkts*/) {
+ jb->num_pkt_miss = 0;
+ self->plugin->reset(self);
+ TSK_DEBUG_WARN("Too much missing audio pkts");
+ }
+ break;
+ case JITTER_BUFFER_INSERTION:
+ /*TSK_DEBUG_INFO("JITTER_BUFFER_INSERTION - %d", ret);*/
+ break;
+ default:
+ TSK_DEBUG_INFO("jitter_buffer_get() failed - %d", ret);
+ break;
+ }
+ // jitter_buffer_update_delay(jb->state, &jb_packet, NULL);
+ //return 0;
+ }
+ else {
+ jb->num_pkt_miss = 0; // reset
+ ret_size = jb_packet.len;
+ }
+ //jitter_buffer_update_delay(jb->state, &jb_packet, NULL);
+
+ return ret_size;
}
static int tdav_speex_jitterbuffer_reset(tmedia_jitterbuffer_t* self)
{
- tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
- if (jb->state) {
- jitter_buffer_reset(jb->state);
- }
- jb->num_pkt_in = 0;
- jb->num_pkt_miss = 0;
- return 0;
+ tdav_speex_jitterbuffer_t *jb = (tdav_speex_jitterbuffer_t *)self;
+ if (jb->state) {
+ jitter_buffer_reset(jb->state);
+ }
+ jb->num_pkt_in = 0;
+ jb->num_pkt_miss = 0;
+ return 0;
}
static int tdav_speex_jitterbuffer_close(tmedia_jitterbuffer_t* self)
{
- tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
- if (jitterbuffer->state) {
- jitter_buffer_destroy(jitterbuffer->state);
- jitterbuffer->state = tsk_null;
- }
- return 0;
+ tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
+ if (jitterbuffer->state) {
+ jitter_buffer_destroy(jitterbuffer->state);
+ jitterbuffer->state = tsk_null;
+ }
+ return 0;
}
@@ -262,56 +261,54 @@ static int tdav_speex_jitterbuffer_close(tmedia_jitterbuffer_t* self)
/* constructor */
static tsk_object_t* tdav_speex_jitterbuffer_ctor(tsk_object_t * self, va_list * app)
{
- tdav_speex_jitterbuffer_t *jitterbuffer = self;
- TSK_DEBUG_INFO("Create SpeexDSP jitter buffer");
- if (jitterbuffer){
- /* init base */
- tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(jitterbuffer));
- /* init self */
- }
- return self;
+ tdav_speex_jitterbuffer_t *jitterbuffer = self;
+ TSK_DEBUG_INFO("Create SpeexDSP jitter buffer");
+ if (jitterbuffer) {
+ /* init base */
+ tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(jitterbuffer));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_speex_jitterbuffer_dtor(tsk_object_t * self)
{
- tdav_speex_jitterbuffer_t *jb = self;
- if (jb){
- /* deinit base */
- tmedia_jitterbuffer_deinit(TMEDIA_JITTER_BUFFER(jb));
- /* deinit self */
- if (jb->state){
- jitter_buffer_destroy(jb->state);
- jb->state = tsk_null;
- }
- TSK_FREE(jb->buff.ptr);
-
- TSK_DEBUG_INFO("*** SpeexDSP jb destroyed ***");
- }
-
- return self;
+ tdav_speex_jitterbuffer_t *jb = self;
+ if (jb) {
+ /* deinit base */
+ tmedia_jitterbuffer_deinit(TMEDIA_JITTER_BUFFER(jb));
+ /* deinit self */
+ if (jb->state) {
+ jitter_buffer_destroy(jb->state);
+ jb->state = tsk_null;
+ }
+ TSK_FREE(jb->buff.ptr);
+
+ TSK_DEBUG_INFO("*** SpeexDSP jb destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_speex_jitterbuffer_def_s =
-{
- sizeof(tdav_speex_jitterbuffer_t),
- tdav_speex_jitterbuffer_ctor,
- tdav_speex_jitterbuffer_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_speex_jitterbuffer_def_s = {
+ sizeof(tdav_speex_jitterbuffer_t),
+ tdav_speex_jitterbuffer_ctor,
+ tdav_speex_jitterbuffer_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_jitterbuffer_plugin_def_t tdav_speex_jitterbuffer_plugin_def_s =
-{
- &tdav_speex_jitterbuffer_def_s,
- tmedia_audio,
- "Audio JitterBuffer based on Speex",
-
- tdav_speex_jitterbuffer_set,
- tdav_speex_jitterbuffer_open,
- tdav_speex_jitterbuffer_tick,
- tdav_speex_jitterbuffer_put,
- tdav_speex_jitterbuffer_get,
- tdav_speex_jitterbuffer_reset,
- tdav_speex_jitterbuffer_close,
+static const tmedia_jitterbuffer_plugin_def_t tdav_speex_jitterbuffer_plugin_def_s = {
+ &tdav_speex_jitterbuffer_def_s,
+ tmedia_audio,
+ "Audio JitterBuffer based on Speex",
+
+ tdav_speex_jitterbuffer_set,
+ tdav_speex_jitterbuffer_open,
+ tdav_speex_jitterbuffer_tick,
+ tdav_speex_jitterbuffer_put,
+ tdav_speex_jitterbuffer_get,
+ tdav_speex_jitterbuffer_reset,
+ tdav_speex_jitterbuffer_close,
};
const tmedia_jitterbuffer_plugin_def_t *tdav_speex_jitterbuffer_plugin_def_t = &tdav_speex_jitterbuffer_plugin_def_s;
diff --git a/tinyDAV/src/audio/tdav_speex_resampler.c b/tinyDAV/src/audio/tdav_speex_resampler.c
index f71ddd2..75c51e5 100755
--- a/tinyDAV/src/audio/tdav_speex_resampler.c
+++ b/tinyDAV/src/audio/tdav_speex_resampler.c
@@ -29,168 +29,167 @@
#define TDAV_SPEEX_RESAMPLER_MAX_QUALITY 10
/** Speex resampler*/
-typedef struct tdav_speex_resampler_s
-{
- TMEDIA_DECLARE_RESAMPLER;
+typedef struct tdav_speex_resampler_s {
+ TMEDIA_DECLARE_RESAMPLER;
- tsk_size_t in_size;
- tsk_size_t out_size;
- uint32_t in_channels;
- uint32_t out_channels;
- uint32_t bytes_per_sample;
+ tsk_size_t in_size;
+ tsk_size_t out_size;
+ uint32_t in_channels;
+ uint32_t out_channels;
+ uint32_t bytes_per_sample;
- struct{
- void* ptr;
- tsk_size_t size_in_samples;
- } tmp_buffer;
+ struct {
+ void* ptr;
+ tsk_size_t size_in_samples;
+ } tmp_buffer;
- SpeexResamplerState *state;
+ SpeexResamplerState *state;
}
tdav_speex_resampler_t;
static int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, uint32_t bits_per_sample)
{
- tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
- int ret = 0;
- uint32_t bytes_per_sample = (bits_per_sample >> 3);
-
- if (in_channels != 1 && in_channels != 2) {
- TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
- return -1;
- }
- if (out_channels != 1 && out_channels != 2) {
- TSK_DEBUG_ERROR("%d not valid as output channel", out_channels);
- return -1;
- }
- if (bytes_per_sample != sizeof(spx_int16_t) && bytes_per_sample != sizeof(float)) {
- TSK_DEBUG_ERROR("%d not valid as bits_per_sample", bits_per_sample);
- return -1;
- }
-
- if (!(resampler->state = speex_resampler_init(in_channels, in_freq, out_freq, TSK_CLAMP(0, quality, TDAV_SPEEX_RESAMPLER_MAX_QUALITY), &ret))) {
- TSK_DEBUG_ERROR("speex_resampler_init() returned %d", ret);
- return -2;
- }
-
- resampler->bytes_per_sample = bytes_per_sample;
- resampler->in_size = ((in_freq * frame_duration) / 1000) << (in_channels == 2 ? 1 : 0);
- resampler->out_size = ((out_freq * frame_duration) / 1000) << (out_channels == 2 ? 1 : 0);
- resampler->in_channels = in_channels;
- resampler->out_channels = out_channels;
-
- if (in_channels != out_channels) {
- resampler->tmp_buffer.size_in_samples = ((TSK_MAX(in_freq, out_freq) * frame_duration) / 1000) << (TSK_MAX(in_channels, out_channels) == 2 ? 1 : 0);
- if (!(resampler->tmp_buffer.ptr = tsk_realloc(resampler->tmp_buffer.ptr, resampler->tmp_buffer.size_in_samples * resampler->bytes_per_sample))) {
- resampler->tmp_buffer.size_in_samples = 0;
- return -2;
- }
- }
-
- return 0;
+ tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
+ int ret = 0;
+ uint32_t bytes_per_sample = (bits_per_sample >> 3);
+
+ if (in_channels != 1 && in_channels != 2) {
+ TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
+ return -1;
+ }
+ if (out_channels != 1 && out_channels != 2) {
+ TSK_DEBUG_ERROR("%d not valid as output channel", out_channels);
+ return -1;
+ }
+ if (bytes_per_sample != sizeof(spx_int16_t) && bytes_per_sample != sizeof(float)) {
+ TSK_DEBUG_ERROR("%d not valid as bits_per_sample", bits_per_sample);
+ return -1;
+ }
+
+ if (!(resampler->state = speex_resampler_init(in_channels, in_freq, out_freq, TSK_CLAMP(0, quality, TDAV_SPEEX_RESAMPLER_MAX_QUALITY), &ret))) {
+ TSK_DEBUG_ERROR("speex_resampler_init() returned %d", ret);
+ return -2;
+ }
+
+ resampler->bytes_per_sample = bytes_per_sample;
+ resampler->in_size = ((in_freq * frame_duration) / 1000) << (in_channels == 2 ? 1 : 0);
+ resampler->out_size = ((out_freq * frame_duration) / 1000) << (out_channels == 2 ? 1 : 0);
+ resampler->in_channels = in_channels;
+ resampler->out_channels = out_channels;
+
+ if (in_channels != out_channels) {
+ resampler->tmp_buffer.size_in_samples = ((TSK_MAX(in_freq, out_freq) * frame_duration) / 1000) << (TSK_MAX(in_channels, out_channels) == 2 ? 1 : 0);
+ if (!(resampler->tmp_buffer.ptr = tsk_realloc(resampler->tmp_buffer.ptr, resampler->tmp_buffer.size_in_samples * resampler->bytes_per_sample))) {
+ resampler->tmp_buffer.size_in_samples = 0;
+ return -2;
+ }
+ }
+
+ return 0;
}
static tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const void* in_data, tsk_size_t in_size_in_sample, void* out_data, tsk_size_t out_size_in_sample)
{
- tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
- int err = RESAMPLER_ERR_SUCCESS;
- spx_uint32_t _out_size_in_sample = (spx_uint32_t)out_size_in_sample;
- if (!resampler->state || !out_data) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if (in_size_in_sample != resampler->in_size) {
- TSK_DEBUG_ERROR("Input data has wrong size");
- return 0;
- }
-
- if (out_size_in_sample < resampler->out_size) {
- TSK_DEBUG_ERROR("Output data is too short");
- return 0;
- }
-
- if (resampler->in_channels == resampler->out_channels) {
- if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
- err = speex_resampler_process_int(resampler->state, 0,
- (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample,
- (spx_int16_t *)out_data, &_out_size_in_sample);
- }
- else {
- err = speex_resampler_process_float(resampler->state, 0,
- (const float *)in_data, (spx_uint32_t *)&in_size_in_sample,
- (float *)out_data, &_out_size_in_sample);
- }
- }
- else {
- spx_uint32_t i, j;
- // in_channels = 1, out_channels = 2
- if (resampler->in_channels == 1) {
- if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
- err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample, resampler->tmp_buffer.ptr, &_out_size_in_sample);
- if (err == RESAMPLER_ERR_SUCCESS) {
- spx_int16_t* pout_data = (spx_int16_t*)(out_data);
- for (i = 0, j = 0; i < _out_size_in_sample; ++i, j += 2) {
- pout_data[j] = pout_data[j + 1] = *(((const spx_int16_t*)resampler->tmp_buffer.ptr) + i);
- }
- }
- }
- else {
- err = speex_resampler_process_float(resampler->state, 0, (const float *)in_data, (spx_uint32_t *)&in_size_in_sample, resampler->tmp_buffer.ptr, &_out_size_in_sample);
- if (err == RESAMPLER_ERR_SUCCESS) {
- float* pout_data = (float*)(out_data);
- for (i = 0, j = 0; i < _out_size_in_sample; ++i, j += 2) {
- pout_data[j] = pout_data[j + 1] = *(((const float*)resampler->tmp_buffer.ptr) + i);
- }
- }
- }
-
- }
- else {
- // in_channels = 2, out_channels = 1
- spx_uint32_t _out_size2_in_sample = (_out_size_in_sample << 1);
- if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
- err = speex_resampler_process_int(resampler->state, 0,
- (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample,
- (spx_int16_t *)resampler->tmp_buffer.ptr, &_out_size2_in_sample);
- if (err == RESAMPLER_ERR_SUCCESS) {
- spx_int16_t* pout_data = (spx_int16_t*)(out_data);
- _out_size_in_sample = (spx_uint32_t)resampler->out_size;
- for (i = 0, j = 0; j < _out_size2_in_sample; ++i, j += 2) {
- pout_data[i] = *(((const spx_int16_t*)resampler->tmp_buffer.ptr) + j);
- }
- }
- }
- else {
- err = speex_resampler_process_float(resampler->state, 0,
- (const float *)in_data, (spx_uint32_t *)&in_size_in_sample,
- (float *)resampler->tmp_buffer.ptr, &_out_size2_in_sample);
- if (err == RESAMPLER_ERR_SUCCESS) {
- float* pout_data = (float*)(out_data);
- for (i = 0, j = 0; j < _out_size2_in_sample; ++i, j += 2) {
- pout_data[i] = *(((const float*)resampler->tmp_buffer.ptr) + j);
- }
- }
- }
- }
- }
-
- if (err != RESAMPLER_ERR_SUCCESS) {
- TSK_DEBUG_ERROR("speex_resampler_process_int() failed with error code %d", err);
- return 0;
- }
- return (tsk_size_t)_out_size_in_sample;
+ tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
+ int err = RESAMPLER_ERR_SUCCESS;
+ spx_uint32_t _out_size_in_sample = (spx_uint32_t)out_size_in_sample;
+ if (!resampler->state || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if (in_size_in_sample != resampler->in_size) {
+ TSK_DEBUG_ERROR("Input data has wrong size");
+ return 0;
+ }
+
+ if (out_size_in_sample < resampler->out_size) {
+ TSK_DEBUG_ERROR("Output data is too short");
+ return 0;
+ }
+
+ if (resampler->in_channels == resampler->out_channels) {
+ if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
+ err = speex_resampler_process_int(resampler->state, 0,
+ (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample,
+ (spx_int16_t *)out_data, &_out_size_in_sample);
+ }
+ else {
+ err = speex_resampler_process_float(resampler->state, 0,
+ (const float *)in_data, (spx_uint32_t *)&in_size_in_sample,
+ (float *)out_data, &_out_size_in_sample);
+ }
+ }
+ else {
+ spx_uint32_t i, j;
+ // in_channels = 1, out_channels = 2
+ if (resampler->in_channels == 1) {
+ if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
+ err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample, resampler->tmp_buffer.ptr, &_out_size_in_sample);
+ if (err == RESAMPLER_ERR_SUCCESS) {
+ spx_int16_t* pout_data = (spx_int16_t*)(out_data);
+ for (i = 0, j = 0; i < _out_size_in_sample; ++i, j += 2) {
+ pout_data[j] = pout_data[j + 1] = *(((const spx_int16_t*)resampler->tmp_buffer.ptr) + i);
+ }
+ }
+ }
+ else {
+ err = speex_resampler_process_float(resampler->state, 0, (const float *)in_data, (spx_uint32_t *)&in_size_in_sample, resampler->tmp_buffer.ptr, &_out_size_in_sample);
+ if (err == RESAMPLER_ERR_SUCCESS) {
+ float* pout_data = (float*)(out_data);
+ for (i = 0, j = 0; i < _out_size_in_sample; ++i, j += 2) {
+ pout_data[j] = pout_data[j + 1] = *(((const float*)resampler->tmp_buffer.ptr) + i);
+ }
+ }
+ }
+
+ }
+ else {
+ // in_channels = 2, out_channels = 1
+ spx_uint32_t _out_size2_in_sample = (_out_size_in_sample << 1);
+ if (resampler->bytes_per_sample == sizeof(spx_int16_t)) {
+ err = speex_resampler_process_int(resampler->state, 0,
+ (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size_in_sample,
+ (spx_int16_t *)resampler->tmp_buffer.ptr, &_out_size2_in_sample);
+ if (err == RESAMPLER_ERR_SUCCESS) {
+ spx_int16_t* pout_data = (spx_int16_t*)(out_data);
+ _out_size_in_sample = (spx_uint32_t)resampler->out_size;
+ for (i = 0, j = 0; j < _out_size2_in_sample; ++i, j += 2) {
+ pout_data[i] = *(((const spx_int16_t*)resampler->tmp_buffer.ptr) + j);
+ }
+ }
+ }
+ else {
+ err = speex_resampler_process_float(resampler->state, 0,
+ (const float *)in_data, (spx_uint32_t *)&in_size_in_sample,
+ (float *)resampler->tmp_buffer.ptr, &_out_size2_in_sample);
+ if (err == RESAMPLER_ERR_SUCCESS) {
+ float* pout_data = (float*)(out_data);
+ for (i = 0, j = 0; j < _out_size2_in_sample; ++i, j += 2) {
+ pout_data[i] = *(((const float*)resampler->tmp_buffer.ptr) + j);
+ }
+ }
+ }
+ }
+ }
+
+ if (err != RESAMPLER_ERR_SUCCESS) {
+ TSK_DEBUG_ERROR("speex_resampler_process_int() failed with error code %d", err);
+ return 0;
+ }
+ return (tsk_size_t)_out_size_in_sample;
}
static int tdav_speex_resampler_close(tmedia_resampler_t* self)
{
- tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
+ tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
- if (resampler->state) {
- speex_resampler_destroy(resampler->state);
- resampler->state = tsk_null;
- }
- return 0;
+ if (resampler->state) {
+ speex_resampler_destroy(resampler->state);
+ resampler->state = tsk_null;
+ }
+ return 0;
}
@@ -202,51 +201,49 @@ static int tdav_speex_resampler_close(tmedia_resampler_t* self)
/* constructor */
static tsk_object_t* tdav_speex_resampler_ctor(tsk_object_t * self, va_list * app)
{
- tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
- if (resampler){
- /* init base */
- tmedia_resampler_init(TMEDIA_RESAMPLER(resampler));
- /* init self */
- }
- return self;
+ tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
+ if (resampler) {
+ /* init base */
+ tmedia_resampler_init(TMEDIA_RESAMPLER(resampler));
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_speex_resampler_dtor(tsk_object_t * self)
{
- tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
- if (resampler){
- /* deinit base */
- tmedia_resampler_deinit(TMEDIA_RESAMPLER(resampler));
- /* deinit self */
- if (resampler->state) {
- speex_resampler_destroy(resampler->state);
- resampler->state = tsk_null;
- }
- TSK_FREE(resampler->tmp_buffer.ptr);
-
- TSK_DEBUG_INFO("*** SpeexDSP resampler (plugin) destroyed ***");
- }
-
- return self;
+ tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
+ if (resampler) {
+ /* deinit base */
+ tmedia_resampler_deinit(TMEDIA_RESAMPLER(resampler));
+ /* deinit self */
+ if (resampler->state) {
+ speex_resampler_destroy(resampler->state);
+ resampler->state = tsk_null;
+ }
+ TSK_FREE(resampler->tmp_buffer.ptr);
+
+ TSK_DEBUG_INFO("*** SpeexDSP resampler (plugin) destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_speex_resampler_def_s =
-{
- sizeof(tdav_speex_resampler_t),
- tdav_speex_resampler_ctor,
- tdav_speex_resampler_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_speex_resampler_def_s = {
+ sizeof(tdav_speex_resampler_t),
+ tdav_speex_resampler_ctor,
+ tdav_speex_resampler_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_resampler_plugin_def_t tdav_speex_resampler_plugin_def_s =
-{
- &tdav_speex_resampler_def_s,
+static const tmedia_resampler_plugin_def_t tdav_speex_resampler_plugin_def_s = {
+ &tdav_speex_resampler_def_s,
- "Audio Resampler based on Speex",
+ "Audio Resampler based on Speex",
- tdav_speex_resampler_open,
- tdav_speex_resampler_process,
- tdav_speex_resampler_close,
+ tdav_speex_resampler_open,
+ tdav_speex_resampler_process,
+ tdav_speex_resampler_close,
};
const tmedia_resampler_plugin_def_t *tdav_speex_resampler_plugin_def_t = &tdav_speex_resampler_plugin_def_s;
diff --git a/tinyDAV/src/audio/tdav_webrtc_denoise.c b/tinyDAV/src/audio/tdav_webrtc_denoise.c
index 598470a..c69ab9e 100755
--- a/tinyDAV/src/audio/tdav_webrtc_denoise.c
+++ b/tinyDAV/src/audio/tdav_webrtc_denoise.c
@@ -51,34 +51,32 @@ typedef int16_t sample_t;
typedef float sample_t;
#endif
-typedef struct tdav_webrtc_pin_xs
-{
- uint32_t n_duration;
- uint32_t n_rate;
- uint32_t n_channels;
- uint32_t n_sample_size;
+typedef struct tdav_webrtc_pin_xs {
+ uint32_t n_duration;
+ uint32_t n_rate;
+ uint32_t n_channels;
+ uint32_t n_sample_size;
}
tdav_webrtc_pin_xt;
-typedef struct tdav_webrtc_resampler_s
-{
- TSK_DECLARE_OBJECT;
-
- tmedia_resampler_t* p_resampler;
- void* p_bufftmp_ptr; // used to convert float <->int16
- tsk_size_t n_bufftmp_size_in_bytes;
-
- struct {
- tdav_webrtc_pin_xt x_pin;
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- } in;
- struct {
- tdav_webrtc_pin_xt x_pin;
- void* p_buff_ptr;
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- } out;
+typedef struct tdav_webrtc_resampler_s {
+ TSK_DECLARE_OBJECT;
+
+ tmedia_resampler_t* p_resampler;
+ void* p_bufftmp_ptr; // used to convert float <->int16
+ tsk_size_t n_bufftmp_size_in_bytes;
+
+ struct {
+ tdav_webrtc_pin_xt x_pin;
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ } in;
+ struct {
+ tdav_webrtc_pin_xt x_pin;
+ void* p_buff_ptr;
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ } out;
}
tdav_webrtc_resampler_t;
@@ -86,447 +84,446 @@ static int _tdav_webrtc_resampler_create(const tdav_webrtc_pin_xt* p_pin_in, con
static int _tdav_webrtc_resampler_process(tdav_webrtc_resampler_t* p_self, const void* p_buff_ptr, tsk_size_t n_buff_size_in_bytes);
/** WebRTC denoiser (AEC, NS, AGC...) */
-typedef struct tdav_webrtc_denoise_s
-{
- TMEDIA_DECLARE_DENOISE;
+typedef struct tdav_webrtc_denoise_s {
+ TMEDIA_DECLARE_DENOISE;
- void *AEC_inst;
+ void *AEC_inst;
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
- SpeexPreprocessState *SpeexDenoiser_proc;
+ SpeexPreprocessState *SpeexDenoiser_proc;
#else
- TDAV_NsHandle *NS_inst;
+ TDAV_NsHandle *NS_inst;
#endif
- uint32_t echo_tail;
- uint32_t echo_skew;
-
- struct {
- tdav_webrtc_resampler_t* p_rpl_in2den; // input -> denoiser
- tdav_webrtc_resampler_t* p_rpl_den2in; // denoiser -> input
- } record;
- struct {
- tdav_webrtc_resampler_t* p_rpl_in2den; // input -> denoiser
- tdav_webrtc_resampler_t* p_rpl_den2in; // denoiser -> input
- } playback;
-
- struct {
- uint32_t nb_samples_per_process;
- uint32_t sampling_rate;
- uint32_t channels; // always "1"
- } neg;
-
- TSK_DECLARE_SAFEOBJ;
+ uint32_t echo_tail;
+ uint32_t echo_skew;
+
+ struct {
+ tdav_webrtc_resampler_t* p_rpl_in2den; // input -> denoiser
+ tdav_webrtc_resampler_t* p_rpl_den2in; // denoiser -> input
+ } record;
+ struct {
+ tdav_webrtc_resampler_t* p_rpl_in2den; // input -> denoiser
+ tdav_webrtc_resampler_t* p_rpl_den2in; // denoiser -> input
+ } playback;
+
+ struct {
+ uint32_t nb_samples_per_process;
+ uint32_t sampling_rate;
+ uint32_t channels; // always "1"
+ } neg;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_webrtc_denoise_t;
static int tdav_webrtc_denoise_set(tmedia_denoise_t* _self, const tmedia_param_t* param)
{
- tdav_webrtc_denoise_t *self = (tdav_webrtc_denoise_t *)_self;
- if (!self || !param) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "echo-tail")) {
- int32_t echo_tail = *((int32_t*)param->value);
- self->echo_tail = TSK_CLAMP(WEBRTC_MIN_ECHO_TAIL, echo_tail, WEBRTC_MAX_ECHO_TAIL);
- TSK_DEBUG_INFO("set_echo_tail (%d->%d)", echo_tail, self->echo_tail);
- return 0;
- }
- }
- return -1;
+ tdav_webrtc_denoise_t *self = (tdav_webrtc_denoise_t *)_self;
+ if (!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "echo-tail")) {
+ int32_t echo_tail = *((int32_t*)param->value);
+ self->echo_tail = TSK_CLAMP(WEBRTC_MIN_ECHO_TAIL, echo_tail, WEBRTC_MAX_ECHO_TAIL);
+ TSK_DEBUG_INFO("set_echo_tail (%d->%d)", echo_tail, self->echo_tail);
+ return 0;
+ }
+ }
+ return -1;
}
static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t record_channels, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate, uint32_t playback_channels)
{
- tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
- int ret;
- tdav_webrtc_pin_xt pin_record_in = { 0 }, pin_record_den = { 0 }, pin_playback_in = { 0 }, pin_playback_den = { 0 };
+ tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
+ int ret;
+ tdav_webrtc_pin_xt pin_record_in = { 0 }, pin_record_den = { 0 }, pin_playback_in = { 0 }, pin_playback_den = { 0 };
- if (!denoiser) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!denoiser) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (denoiser->AEC_inst ||
+ if (denoiser->AEC_inst ||
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
- denoiser->SpeexDenoiser_proc
+ denoiser->SpeexDenoiser_proc
#else
- denoiser->NS_inst
+ denoiser->NS_inst
#endif
- ){
- TSK_DEBUG_ERROR("Denoiser already initialized");
- return -2;
- }
-
- denoiser->echo_tail = TSK_CLAMP(WEBRTC_MIN_ECHO_TAIL, TMEDIA_DENOISE(denoiser)->echo_tail, WEBRTC_MAX_ECHO_TAIL);
- denoiser->echo_skew = TMEDIA_DENOISE(denoiser)->echo_skew;
- TSK_DEBUG_INFO("echo_tail=%d, echo_skew=%d, echo_supp_enabled=%d, noise_supp_enabled=%d", denoiser->echo_tail, denoiser->echo_skew, self->echo_supp_enabled, self->noise_supp_enabled);
-
- //
- // DENOISER
- //
+ ) {
+ TSK_DEBUG_ERROR("Denoiser already initialized");
+ return -2;
+ }
+
+ denoiser->echo_tail = TSK_CLAMP(WEBRTC_MIN_ECHO_TAIL, TMEDIA_DENOISE(denoiser)->echo_tail, WEBRTC_MAX_ECHO_TAIL);
+ denoiser->echo_skew = TMEDIA_DENOISE(denoiser)->echo_skew;
+ TSK_DEBUG_INFO("echo_tail=%d, echo_skew=%d, echo_supp_enabled=%d, noise_supp_enabled=%d", denoiser->echo_tail, denoiser->echo_skew, self->echo_supp_enabled, self->noise_supp_enabled);
+
+ //
+ // DENOISER
+ //
#if TDAV_UNDER_MOBILE // AECM= [8-16]k, AEC=[8-32]k
- denoiser->neg.sampling_rate = TSK_MIN(TSK_MAX(record_sampling_rate, playback_sampling_rate), 16000);
+ denoiser->neg.sampling_rate = TSK_MIN(TSK_MAX(record_sampling_rate, playback_sampling_rate), 16000);
#else
- denoiser->neg.sampling_rate = TSK_MIN(TSK_MAX(record_sampling_rate, playback_sampling_rate), 16000); // FIXME: 32000 accepted by echo_process fails
+ denoiser->neg.sampling_rate = TSK_MIN(TSK_MAX(record_sampling_rate, playback_sampling_rate), 16000); // FIXME: 32000 accepted by echo_process fails
#endif
- denoiser->neg.nb_samples_per_process = /*TSK_CLAMP(80,*/ ((denoiser->neg.sampling_rate * 10) / 1000)/*, 160)*/; // Supported by the module: "80"(10ms) and "160"(20ms)
- denoiser->neg.channels = 1;
-
- //
- // RECORD
- //
- TSK_OBJECT_SAFE_FREE(denoiser->record.p_rpl_den2in);
- TSK_OBJECT_SAFE_FREE(denoiser->record.p_rpl_in2den);
- pin_record_in.n_sample_size = sizeof(int16_t);
- pin_record_in.n_rate = record_sampling_rate;
- pin_record_in.n_channels = record_channels;
- pin_record_in.n_duration = (((record_frame_size_samples * 1000) / record_sampling_rate)) / record_channels;
- pin_record_den.n_sample_size = sizeof(sample_t);
- pin_record_den.n_rate = denoiser->neg.sampling_rate;
-
- pin_record_den.n_channels = 1;
- pin_record_den.n_duration = pin_record_in.n_duration;
- if (pin_record_in.n_sample_size != pin_record_den.n_sample_size || pin_record_in.n_rate != pin_record_den.n_rate || pin_record_in.n_channels != pin_record_den.n_channels) {
- if ((ret = _tdav_webrtc_resampler_create(&pin_record_in, &pin_record_den, &denoiser->record.p_rpl_in2den))) {
- return ret;
- }
- if ((ret = _tdav_webrtc_resampler_create(&pin_record_den, &pin_record_in, &denoiser->record.p_rpl_den2in))) {
- return ret;
- }
- }
- //
- // PLAYBACK
- //
- TSK_OBJECT_SAFE_FREE(denoiser->playback.p_rpl_den2in);
- TSK_OBJECT_SAFE_FREE(denoiser->playback.p_rpl_in2den);
- pin_playback_in.n_sample_size = sizeof(int16_t);
- pin_playback_in.n_rate = playback_sampling_rate;
- pin_playback_in.n_channels = playback_channels;
- pin_playback_in.n_duration = (((playback_frame_size_samples * 1000) / playback_sampling_rate)) / playback_channels;
- pin_playback_den.n_sample_size = sizeof(sample_t);
- pin_playback_den.n_rate = denoiser->neg.sampling_rate;
- pin_playback_den.n_channels = 1;
- pin_playback_den.n_duration = pin_playback_in.n_duration;
- if (pin_playback_in.n_sample_size != pin_playback_den.n_sample_size || pin_playback_in.n_rate != pin_playback_den.n_rate || pin_playback_in.n_channels != pin_playback_den.n_channels) {
- if ((ret = _tdav_webrtc_resampler_create(&pin_playback_in, &pin_playback_den, &denoiser->playback.p_rpl_in2den))) {
- return ret;
- }
- if ((ret = _tdav_webrtc_resampler_create(&pin_playback_den, &pin_playback_in, &denoiser->playback.p_rpl_den2in))) {
- return ret;
- }
- }
-
- //
- // AEC instance
- //
- if ((ret = TDAV_WebRtcAec_Create(&denoiser->AEC_inst))) {
- TSK_DEBUG_ERROR("WebRtcAec_Create failed with error code = %d", ret);
- return ret;
- }
- if ((ret = TDAV_WebRtcAec_Init(denoiser->AEC_inst, denoiser->neg.sampling_rate, denoiser->neg.sampling_rate))) {
- TSK_DEBUG_ERROR("WebRtcAec_Init failed with error code = %d", ret);
- return ret;
- }
+ denoiser->neg.nb_samples_per_process = /*TSK_CLAMP(80,*/ ((denoiser->neg.sampling_rate * 10) / 1000)/*, 160)*/; // Supported by the module: "80"(10ms) and "160"(20ms)
+ denoiser->neg.channels = 1;
+
+ //
+ // RECORD
+ //
+ TSK_OBJECT_SAFE_FREE(denoiser->record.p_rpl_den2in);
+ TSK_OBJECT_SAFE_FREE(denoiser->record.p_rpl_in2den);
+ pin_record_in.n_sample_size = sizeof(int16_t);
+ pin_record_in.n_rate = record_sampling_rate;
+ pin_record_in.n_channels = record_channels;
+ pin_record_in.n_duration = (((record_frame_size_samples * 1000) / record_sampling_rate)) / record_channels;
+ pin_record_den.n_sample_size = sizeof(sample_t);
+ pin_record_den.n_rate = denoiser->neg.sampling_rate;
+
+ pin_record_den.n_channels = 1;
+ pin_record_den.n_duration = pin_record_in.n_duration;
+ if (pin_record_in.n_sample_size != pin_record_den.n_sample_size || pin_record_in.n_rate != pin_record_den.n_rate || pin_record_in.n_channels != pin_record_den.n_channels) {
+ if ((ret = _tdav_webrtc_resampler_create(&pin_record_in, &pin_record_den, &denoiser->record.p_rpl_in2den))) {
+ return ret;
+ }
+ if ((ret = _tdav_webrtc_resampler_create(&pin_record_den, &pin_record_in, &denoiser->record.p_rpl_den2in))) {
+ return ret;
+ }
+ }
+ //
+ // PLAYBACK
+ //
+ TSK_OBJECT_SAFE_FREE(denoiser->playback.p_rpl_den2in);
+ TSK_OBJECT_SAFE_FREE(denoiser->playback.p_rpl_in2den);
+ pin_playback_in.n_sample_size = sizeof(int16_t);
+ pin_playback_in.n_rate = playback_sampling_rate;
+ pin_playback_in.n_channels = playback_channels;
+ pin_playback_in.n_duration = (((playback_frame_size_samples * 1000) / playback_sampling_rate)) / playback_channels;
+ pin_playback_den.n_sample_size = sizeof(sample_t);
+ pin_playback_den.n_rate = denoiser->neg.sampling_rate;
+ pin_playback_den.n_channels = 1;
+ pin_playback_den.n_duration = pin_playback_in.n_duration;
+ if (pin_playback_in.n_sample_size != pin_playback_den.n_sample_size || pin_playback_in.n_rate != pin_playback_den.n_rate || pin_playback_in.n_channels != pin_playback_den.n_channels) {
+ if ((ret = _tdav_webrtc_resampler_create(&pin_playback_in, &pin_playback_den, &denoiser->playback.p_rpl_in2den))) {
+ return ret;
+ }
+ if ((ret = _tdav_webrtc_resampler_create(&pin_playback_den, &pin_playback_in, &denoiser->playback.p_rpl_den2in))) {
+ return ret;
+ }
+ }
+
+ //
+ // AEC instance
+ //
+ if ((ret = TDAV_WebRtcAec_Create(&denoiser->AEC_inst))) {
+ TSK_DEBUG_ERROR("WebRtcAec_Create failed with error code = %d", ret);
+ return ret;
+ }
+ if ((ret = TDAV_WebRtcAec_Init(denoiser->AEC_inst, denoiser->neg.sampling_rate, denoiser->neg.sampling_rate))) {
+ TSK_DEBUG_ERROR("WebRtcAec_Init failed with error code = %d", ret);
+ return ret;
+ }
#if TDAV_UNDER_MOBILE
#else
- {
- AecConfig aecConfig;
+ {
+ AecConfig aecConfig;
#if WEBRTC_AEC_AGGRESSIVE
- aecConfig.nlpMode = kAecNlpAggressive;
+ aecConfig.nlpMode = kAecNlpAggressive;
#else
- aecConfig.nlpMode = kAecNlpModerate;
+ aecConfig.nlpMode = kAecNlpModerate;
#endif
- aecConfig.skewMode = kAecFalse;
- aecConfig.metricsMode = kAecTrue;
- aecConfig.delay_logging = kAecFalse;
- if ((ret = WebRtcAec_set_config(denoiser->AEC_inst, aecConfig))) {
- TSK_DEBUG_ERROR("WebRtcAec_set_config failed with error code = %d", ret);
- }
- }
+ aecConfig.skewMode = kAecFalse;
+ aecConfig.metricsMode = kAecTrue;
+ aecConfig.delay_logging = kAecFalse;
+ if ((ret = WebRtcAec_set_config(denoiser->AEC_inst, aecConfig))) {
+ TSK_DEBUG_ERROR("WebRtcAec_set_config failed with error code = %d", ret);
+ }
+ }
#endif
- //
- // Noise Suppression instance
- //
- if (TMEDIA_DENOISE(denoiser)->noise_supp_enabled) {
+ //
+ // Noise Suppression instance
+ //
+ if (TMEDIA_DENOISE(denoiser)->noise_supp_enabled) {
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
- if ((denoiser->SpeexDenoiser_proc = speex_preprocess_state_init((pin_record_den.n_rate / 1000) * pin_record_den.n_duration, pin_record_den.n_rate))) {
- int i = 1;
- speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_DENOISE, &i);
- i = TMEDIA_DENOISE(denoiser)->noise_supp_level;
- speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
- }
+ if ((denoiser->SpeexDenoiser_proc = speex_preprocess_state_init((pin_record_den.n_rate / 1000) * pin_record_den.n_duration, pin_record_den.n_rate))) {
+ int i = 1;
+ speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_DENOISE, &i);
+ i = TMEDIA_DENOISE(denoiser)->noise_supp_level;
+ speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i);
+ }
#else
- if ((ret = TDAV_WebRtcNs_Create(&denoiser->NS_inst))) {
- TSK_DEBUG_ERROR("WebRtcNs_Create failed with error code = %d", ret);
- return ret;
- }
- if ((ret = TDAV_WebRtcNs_Init(denoiser->NS_inst, 80))) {
- TSK_DEBUG_ERROR("WebRtcNs_Init failed with error code = %d", ret);
- return ret;
- }
+ if ((ret = TDAV_WebRtcNs_Create(&denoiser->NS_inst))) {
+ TSK_DEBUG_ERROR("WebRtcNs_Create failed with error code = %d", ret);
+ return ret;
+ }
+ if ((ret = TDAV_WebRtcNs_Init(denoiser->NS_inst, 80))) {
+ TSK_DEBUG_ERROR("WebRtcNs_Init failed with error code = %d", ret);
+ return ret;
+ }
#endif
- }
+ }
- TSK_DEBUG_INFO("WebRTC denoiser opened: record:%uHz,%uchannels // playback:%uHz,%uchannels // neg:%uHz,%uchannels",
- record_sampling_rate, record_channels,
- playback_sampling_rate, playback_channels,
- denoiser->neg.sampling_rate, denoiser->neg.channels);
+ TSK_DEBUG_INFO("WebRTC denoiser opened: record:%uHz,%uchannels // playback:%uHz,%uchannels // neg:%uHz,%uchannels",
+ record_sampling_rate, record_channels,
+ playback_sampling_rate, playback_channels,
+ denoiser->neg.sampling_rate, denoiser->neg.channels);
- return ret;
+ return ret;
}
static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
- tdav_webrtc_denoise_t *p_self = (tdav_webrtc_denoise_t *)self;
- int ret = 0;
-
- tsk_safeobj_lock(p_self);
- if (p_self->AEC_inst && echo_frame && echo_frame_size_bytes) {
- const sample_t* _echo_frame = (const sample_t*)echo_frame;
- tsk_size_t _echo_frame_size_bytes = echo_frame_size_bytes;
- tsk_size_t _echo_frame_size_samples = (_echo_frame_size_bytes / sizeof(int16_t));
- // IN -> DEN
- if (p_self->playback.p_rpl_in2den) {
- if ((ret = _tdav_webrtc_resampler_process(p_self->playback.p_rpl_in2den, _echo_frame, _echo_frame_size_bytes))) {
- goto bail;
- }
- _echo_frame = p_self->playback.p_rpl_in2den->out.p_buff_ptr;
- _echo_frame_size_bytes = p_self->playback.p_rpl_in2den->out.n_buff_size_in_bytes;
- _echo_frame_size_samples = p_self->playback.p_rpl_in2den->out.n_buff_size_in_samples;
- }
- // PROCESS
- if (_echo_frame_size_samples && _echo_frame) {
- uint32_t _samples;
- for (_samples = 0; _samples < _echo_frame_size_samples; _samples += p_self->neg.nb_samples_per_process) {
- if ((ret = TDAV_WebRtcAec_BufferFarend(p_self->AEC_inst, &_echo_frame[_samples], p_self->neg.nb_samples_per_process))){
- TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d, nb_samples_per_process=%u", ret, p_self->neg.nb_samples_per_process);
- goto bail;
- }
- }
- }
- }
+ tdav_webrtc_denoise_t *p_self = (tdav_webrtc_denoise_t *)self;
+ int ret = 0;
+
+ tsk_safeobj_lock(p_self);
+ if (p_self->AEC_inst && echo_frame && echo_frame_size_bytes) {
+ const sample_t* _echo_frame = (const sample_t*)echo_frame;
+ tsk_size_t _echo_frame_size_bytes = echo_frame_size_bytes;
+ tsk_size_t _echo_frame_size_samples = (_echo_frame_size_bytes / sizeof(int16_t));
+ // IN -> DEN
+ if (p_self->playback.p_rpl_in2den) {
+ if ((ret = _tdav_webrtc_resampler_process(p_self->playback.p_rpl_in2den, _echo_frame, _echo_frame_size_bytes))) {
+ goto bail;
+ }
+ _echo_frame = p_self->playback.p_rpl_in2den->out.p_buff_ptr;
+ _echo_frame_size_bytes = p_self->playback.p_rpl_in2den->out.n_buff_size_in_bytes;
+ _echo_frame_size_samples = p_self->playback.p_rpl_in2den->out.n_buff_size_in_samples;
+ }
+ // PROCESS
+ if (_echo_frame_size_samples && _echo_frame) {
+ uint32_t _samples;
+ for (_samples = 0; _samples < _echo_frame_size_samples; _samples += p_self->neg.nb_samples_per_process) {
+ if ((ret = TDAV_WebRtcAec_BufferFarend(p_self->AEC_inst, &_echo_frame[_samples], p_self->neg.nb_samples_per_process))) {
+ TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d, nb_samples_per_process=%u", ret, p_self->neg.nb_samples_per_process);
+ goto bail;
+ }
+ }
+ }
+ }
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
- tdav_webrtc_denoise_t *p_self = (tdav_webrtc_denoise_t *)self;
- int ret = 0;
-
- *silence_or_noise = tsk_false;
-
- tsk_safeobj_lock(p_self);
-
- if (p_self->AEC_inst && audio_frame && audio_frame_size_bytes) {
- tsk_size_t _samples;
- const sample_t* _audio_frame = (const sample_t*)audio_frame;
- tsk_size_t _audio_frame_size_bytes = audio_frame_size_bytes;
- tsk_size_t _audio_frame_size_samples = (_audio_frame_size_bytes / sizeof(int16_t));
- // IN -> DEN
- if (p_self->record.p_rpl_in2den) {
- if ((ret = _tdav_webrtc_resampler_process(p_self->record.p_rpl_in2den, _audio_frame, _audio_frame_size_bytes))) {
- goto bail;
- }
- _audio_frame = p_self->record.p_rpl_in2den->out.p_buff_ptr;
- _audio_frame_size_bytes = p_self->record.p_rpl_in2den->out.n_buff_size_in_bytes;
- _audio_frame_size_samples = p_self->record.p_rpl_in2den->out.n_buff_size_in_samples;
- }
- // NOISE SUPPRESSION
+ tdav_webrtc_denoise_t *p_self = (tdav_webrtc_denoise_t *)self;
+ int ret = 0;
+
+ *silence_or_noise = tsk_false;
+
+ tsk_safeobj_lock(p_self);
+
+ if (p_self->AEC_inst && audio_frame && audio_frame_size_bytes) {
+ tsk_size_t _samples;
+ const sample_t* _audio_frame = (const sample_t*)audio_frame;
+ tsk_size_t _audio_frame_size_bytes = audio_frame_size_bytes;
+ tsk_size_t _audio_frame_size_samples = (_audio_frame_size_bytes / sizeof(int16_t));
+ // IN -> DEN
+ if (p_self->record.p_rpl_in2den) {
+ if ((ret = _tdav_webrtc_resampler_process(p_self->record.p_rpl_in2den, _audio_frame, _audio_frame_size_bytes))) {
+ goto bail;
+ }
+ _audio_frame = p_self->record.p_rpl_in2den->out.p_buff_ptr;
+ _audio_frame_size_bytes = p_self->record.p_rpl_in2den->out.n_buff_size_in_bytes;
+ _audio_frame_size_samples = p_self->record.p_rpl_in2den->out.n_buff_size_in_samples;
+ }
+ // NOISE SUPPRESSION
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
- if (p_self->SpeexDenoiser_proc) {
- speex_preprocess_run(p_self->SpeexDenoiser_proc, (spx_int16_t*)_audio_frame);
- }
+ if (p_self->SpeexDenoiser_proc) {
+ speex_preprocess_run(p_self->SpeexDenoiser_proc, (spx_int16_t*)_audio_frame);
+ }
#else
- // WebRTC NoiseSupp only accept 10ms frames
- // Our encoder will always output 20ms frames ==> execute 2x noise_supp
- if (p_self->NS_inst) {
- for (_samples = 0; _samples < _audio_frame_size_samples; _samples+= p_self->neg.nb_samples_per_process) {
- if ((ret = TDAV_WebRtcNs_Process(p_self->NS_inst, &_audio_frame[_samples], tsk_null, _audio_frame, tsk_null))) {
- TSK_DEBUG_ERROR("WebRtcNs_Process with error code = %d", ret);
- goto bail;
- }
- }
- }
+ // WebRTC NoiseSupp only accept 10ms frames
+ // Our encoder will always output 20ms frames ==> execute 2x noise_supp
+ if (p_self->NS_inst) {
+ for (_samples = 0; _samples < _audio_frame_size_samples; _samples+= p_self->neg.nb_samples_per_process) {
+ if ((ret = TDAV_WebRtcNs_Process(p_self->NS_inst, &_audio_frame[_samples], tsk_null, _audio_frame, tsk_null))) {
+ TSK_DEBUG_ERROR("WebRtcNs_Process with error code = %d", ret);
+ goto bail;
+ }
+ }
+ }
#endif
- // PROCESS
- if (_audio_frame_size_samples && _audio_frame) {
- for (_samples = 0; _samples < _audio_frame_size_samples; _samples += p_self->neg.nb_samples_per_process) {
- if ((ret = TDAV_WebRtcAec_Process(p_self->AEC_inst, &_audio_frame[_samples], tsk_null, (sample_t*)&_audio_frame[_samples], tsk_null, p_self->neg.nb_samples_per_process, p_self->echo_tail, p_self->echo_skew))){
- TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d, nb_samples_per_process=%u", ret, p_self->neg.nb_samples_per_process);
- goto bail;
- }
- }
- }
- // DEN -> IN
- if (p_self->record.p_rpl_den2in) {
- if ((ret = _tdav_webrtc_resampler_process(p_self->record.p_rpl_den2in, _audio_frame, _audio_frame_size_bytes))) {
- goto bail;
- }
- _audio_frame = p_self->record.p_rpl_den2in->out.p_buff_ptr;
- _audio_frame_size_bytes = p_self->record.p_rpl_den2in->out.n_buff_size_in_bytes;
- _audio_frame_size_samples = p_self->record.p_rpl_den2in->out.n_buff_size_in_samples;
- }
- // Sanity check
- if (_audio_frame_size_bytes != audio_frame_size_bytes) {
- TSK_DEBUG_ERROR("Size mismatch: %u <> %u", _audio_frame_size_bytes, audio_frame_size_bytes);
- ret = -3;
- goto bail;
- }
- if (audio_frame != (const void*)_audio_frame) {
- memcpy(audio_frame, _audio_frame, _audio_frame_size_bytes);
- }
- }
+ // PROCESS
+ if (_audio_frame_size_samples && _audio_frame) {
+ for (_samples = 0; _samples < _audio_frame_size_samples; _samples += p_self->neg.nb_samples_per_process) {
+ if ((ret = TDAV_WebRtcAec_Process(p_self->AEC_inst, &_audio_frame[_samples], tsk_null, (sample_t*)&_audio_frame[_samples], tsk_null, p_self->neg.nb_samples_per_process, p_self->echo_tail, p_self->echo_skew))) {
+ TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d, nb_samples_per_process=%u", ret, p_self->neg.nb_samples_per_process);
+ goto bail;
+ }
+ }
+ }
+ // DEN -> IN
+ if (p_self->record.p_rpl_den2in) {
+ if ((ret = _tdav_webrtc_resampler_process(p_self->record.p_rpl_den2in, _audio_frame, _audio_frame_size_bytes))) {
+ goto bail;
+ }
+ _audio_frame = p_self->record.p_rpl_den2in->out.p_buff_ptr;
+ _audio_frame_size_bytes = p_self->record.p_rpl_den2in->out.n_buff_size_in_bytes;
+ _audio_frame_size_samples = p_self->record.p_rpl_den2in->out.n_buff_size_in_samples;
+ }
+ // Sanity check
+ if (_audio_frame_size_bytes != audio_frame_size_bytes) {
+ TSK_DEBUG_ERROR("Size mismatch: %u <> %u", _audio_frame_size_bytes, audio_frame_size_bytes);
+ ret = -3;
+ goto bail;
+ }
+ if (audio_frame != (const void*)_audio_frame) {
+ memcpy(audio_frame, _audio_frame, _audio_frame_size_bytes);
+ }
+ }
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int tdav_webrtc_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
- tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
+ tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
- (void)(denoiser);
+ (void)(denoiser);
- // Not mandatory to denoise audio before playback.
- // All Doubango clients support noise suppression.
- return 0;
+ // Not mandatory to denoise audio before playback.
+ // All Doubango clients support noise suppression.
+ return 0;
}
static int tdav_webrtc_denoise_close(tmedia_denoise_t* self)
{
- tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
+ tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
- tsk_safeobj_lock(denoiser);
- if (denoiser->AEC_inst) {
- TDAV_WebRtcAec_Free(denoiser->AEC_inst);
- denoiser->AEC_inst = tsk_null;
- }
+ tsk_safeobj_lock(denoiser);
+ if (denoiser->AEC_inst) {
+ TDAV_WebRtcAec_Free(denoiser->AEC_inst);
+ denoiser->AEC_inst = tsk_null;
+ }
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
- if (denoiser->SpeexDenoiser_proc) {
- speex_preprocess_state_destroy(denoiser->SpeexDenoiser_proc);
- denoiser->SpeexDenoiser_proc = tsk_null;
- }
+ if (denoiser->SpeexDenoiser_proc) {
+ speex_preprocess_state_destroy(denoiser->SpeexDenoiser_proc);
+ denoiser->SpeexDenoiser_proc = tsk_null;
+ }
#else
- if (denoiser->NS_inst) {
- TDAV_WebRtcNs_Free(denoiser->NS_inst);
- denoiser->NS_inst = tsk_null;
- }
+ if (denoiser->NS_inst) {
+ TDAV_WebRtcNs_Free(denoiser->NS_inst);
+ denoiser->NS_inst = tsk_null;
+ }
#endif
- tsk_safeobj_unlock(denoiser);
+ tsk_safeobj_unlock(denoiser);
- return 0;
+ return 0;
}
static int _tdav_webrtc_resampler_create(const tdav_webrtc_pin_xt* p_pin_in, const tdav_webrtc_pin_xt* p_pin_out, tdav_webrtc_resampler_t **pp_resampler)
{
- extern const tsk_object_def_t *tdav_webrtc_resampler_def_t;
- int ret = 0;
- if (!p_pin_in || !p_pin_out || !pp_resampler || *pp_resampler) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(*pp_resampler = tsk_object_new(tdav_webrtc_resampler_def_t))) {
- TSK_DEBUG_ERROR("Failed to create resampler object");
- ret = -3;
- goto bail;
- }
- if (!((*pp_resampler)->p_resampler = tmedia_resampler_create())) {
- ret = -3;
- goto bail;
- }
- ret = tmedia_resampler_open((*pp_resampler)->p_resampler,
- p_pin_in->n_rate, p_pin_out->n_rate,
- p_pin_in->n_duration,
- p_pin_in->n_channels, p_pin_out->n_channels,
- TMEDIA_RESAMPLER_QUALITY,
- (p_pin_out->n_sample_size << 3));
- if (ret) {
- TSK_DEBUG_ERROR("Failed to open resampler: in_rate=%u,in_duration=%u,in_channels=%u /// out_rate=%u,out_duration=%u,out_channels=%u",
- p_pin_in->n_rate, p_pin_in->n_duration, p_pin_in->n_channels,
- p_pin_out->n_rate, p_pin_out->n_duration, p_pin_out->n_channels);
- goto bail;
- }
-
- (*pp_resampler)->out.n_buff_size_in_bytes = ((((p_pin_out->n_rate * p_pin_out->n_duration) / 1000)) * p_pin_out->n_channels) * p_pin_out->n_sample_size;
- (*pp_resampler)->out.p_buff_ptr = tsk_malloc((*pp_resampler)->out.n_buff_size_in_bytes);
- if (!(*pp_resampler)->out.p_buff_ptr) {
- TSK_DEBUG_ERROR("Failed to allocate buffer with size=%u", (*pp_resampler)->out.n_buff_size_in_bytes);
- ret = -3;
- goto bail;
- }
- (*pp_resampler)->out.n_buff_size_in_samples = (*pp_resampler)->out.n_buff_size_in_bytes / p_pin_out->n_sample_size;
- (*pp_resampler)->in.n_buff_size_in_bytes = ((((p_pin_in->n_rate * p_pin_in->n_duration) / 1000)) * p_pin_in->n_channels) * p_pin_in->n_sample_size;
- (*pp_resampler)->in.n_buff_size_in_samples = (*pp_resampler)->in.n_buff_size_in_bytes / p_pin_in->n_sample_size;
-
- (*pp_resampler)->n_bufftmp_size_in_bytes = (((48000 * TSK_MAX(p_pin_in->n_duration, p_pin_out->n_duration)) / 1000) * 2/*channels*/) * sizeof(float); // Max
- (*pp_resampler)->p_bufftmp_ptr = tsk_malloc((*pp_resampler)->n_bufftmp_size_in_bytes);
- if (!(*pp_resampler)->p_bufftmp_ptr) {
- TSK_DEBUG_ERROR("Failed to allocate buffer with size:%u", (*pp_resampler)->n_bufftmp_size_in_bytes);
- ret = -3;
- goto bail;
- }
-
- memcpy(&(*pp_resampler)->in.x_pin, p_pin_in, sizeof(tdav_webrtc_pin_xt));
- memcpy(&(*pp_resampler)->out.x_pin, p_pin_out, sizeof(tdav_webrtc_pin_xt));
+ extern const tsk_object_def_t *tdav_webrtc_resampler_def_t;
+ int ret = 0;
+ if (!p_pin_in || !p_pin_out || !pp_resampler || *pp_resampler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(*pp_resampler = tsk_object_new(tdav_webrtc_resampler_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create resampler object");
+ ret = -3;
+ goto bail;
+ }
+ if (!((*pp_resampler)->p_resampler = tmedia_resampler_create())) {
+ ret = -3;
+ goto bail;
+ }
+ ret = tmedia_resampler_open((*pp_resampler)->p_resampler,
+ p_pin_in->n_rate, p_pin_out->n_rate,
+ p_pin_in->n_duration,
+ p_pin_in->n_channels, p_pin_out->n_channels,
+ TMEDIA_RESAMPLER_QUALITY,
+ (p_pin_out->n_sample_size << 3));
+ if (ret) {
+ TSK_DEBUG_ERROR("Failed to open resampler: in_rate=%u,in_duration=%u,in_channels=%u /// out_rate=%u,out_duration=%u,out_channels=%u",
+ p_pin_in->n_rate, p_pin_in->n_duration, p_pin_in->n_channels,
+ p_pin_out->n_rate, p_pin_out->n_duration, p_pin_out->n_channels);
+ goto bail;
+ }
+
+ (*pp_resampler)->out.n_buff_size_in_bytes = ((((p_pin_out->n_rate * p_pin_out->n_duration) / 1000)) * p_pin_out->n_channels) * p_pin_out->n_sample_size;
+ (*pp_resampler)->out.p_buff_ptr = tsk_malloc((*pp_resampler)->out.n_buff_size_in_bytes);
+ if (!(*pp_resampler)->out.p_buff_ptr) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size=%u", (*pp_resampler)->out.n_buff_size_in_bytes);
+ ret = -3;
+ goto bail;
+ }
+ (*pp_resampler)->out.n_buff_size_in_samples = (*pp_resampler)->out.n_buff_size_in_bytes / p_pin_out->n_sample_size;
+ (*pp_resampler)->in.n_buff_size_in_bytes = ((((p_pin_in->n_rate * p_pin_in->n_duration) / 1000)) * p_pin_in->n_channels) * p_pin_in->n_sample_size;
+ (*pp_resampler)->in.n_buff_size_in_samples = (*pp_resampler)->in.n_buff_size_in_bytes / p_pin_in->n_sample_size;
+
+ (*pp_resampler)->n_bufftmp_size_in_bytes = (((48000 * TSK_MAX(p_pin_in->n_duration, p_pin_out->n_duration)) / 1000) * 2/*channels*/) * sizeof(float); // Max
+ (*pp_resampler)->p_bufftmp_ptr = tsk_malloc((*pp_resampler)->n_bufftmp_size_in_bytes);
+ if (!(*pp_resampler)->p_bufftmp_ptr) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size:%u", (*pp_resampler)->n_bufftmp_size_in_bytes);
+ ret = -3;
+ goto bail;
+ }
+
+ memcpy(&(*pp_resampler)->in.x_pin, p_pin_in, sizeof(tdav_webrtc_pin_xt));
+ memcpy(&(*pp_resampler)->out.x_pin, p_pin_out, sizeof(tdav_webrtc_pin_xt));
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE((*pp_resampler));
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE((*pp_resampler));
+ }
+ return ret;
}
static int _tdav_webrtc_resampler_process(tdav_webrtc_resampler_t *p_self, const void* p_buff_ptr, tsk_size_t n_buff_size_in_bytes)
{
- tsk_size_t n_out_size;
- const void* _p_buff_ptr = p_buff_ptr;
- tsk_size_t _n_buff_size_in_bytes = n_buff_size_in_bytes;
- tsk_size_t _n_buff_size_in_samples;
-
- if (!p_self || !p_buff_ptr || !n_buff_size_in_bytes) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (p_self->in.n_buff_size_in_bytes != n_buff_size_in_bytes) {
- TSK_DEBUG_ERROR("Invalid input size: %u <> %u", p_self->in.n_buff_size_in_bytes, n_buff_size_in_bytes);
- return -2;
- }
- _n_buff_size_in_samples = p_self->in.n_buff_size_in_samples;
- if (p_self->in.x_pin.n_sample_size != p_self->out.x_pin.n_sample_size) {
- tsk_size_t index;
- if (p_self->in.x_pin.n_sample_size == sizeof(int16_t)) {
- // int16_t -> float
- const int16_t* p_src = (const int16_t*)p_buff_ptr;
- float* p_dst = (float*)p_self->p_bufftmp_ptr;
- for (index = 0; index < _n_buff_size_in_samples; ++index) {
- p_dst[index] = (float)p_src[index];
- }
- }
- else {
- // float -> int16_t
- const float* p_src = (const float*)p_buff_ptr;
- int16_t* p_dst = (int16_t*)p_self->p_bufftmp_ptr;
- for (index = 0; index < _n_buff_size_in_samples; ++index) {
- p_dst[index] = (int16_t)p_src[index];
- }
- }
- _p_buff_ptr = p_self->p_bufftmp_ptr;
- _n_buff_size_in_bytes = p_self->in.n_buff_size_in_bytes;
- }
- n_out_size = tmedia_resampler_process(p_self->p_resampler, _p_buff_ptr, _n_buff_size_in_samples, (int16_t*)p_self->out.p_buff_ptr, p_self->out.n_buff_size_in_samples);
- if (n_out_size != p_self->out.n_buff_size_in_samples) {
- TSK_DEBUG_ERROR("Invalid output size: %u <> %u", n_out_size, p_self->out.n_buff_size_in_bytes);
- return -4;
- }
- return 0;
+ tsk_size_t n_out_size;
+ const void* _p_buff_ptr = p_buff_ptr;
+ tsk_size_t _n_buff_size_in_bytes = n_buff_size_in_bytes;
+ tsk_size_t _n_buff_size_in_samples;
+
+ if (!p_self || !p_buff_ptr || !n_buff_size_in_bytes) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (p_self->in.n_buff_size_in_bytes != n_buff_size_in_bytes) {
+ TSK_DEBUG_ERROR("Invalid input size: %u <> %u", p_self->in.n_buff_size_in_bytes, n_buff_size_in_bytes);
+ return -2;
+ }
+ _n_buff_size_in_samples = p_self->in.n_buff_size_in_samples;
+ if (p_self->in.x_pin.n_sample_size != p_self->out.x_pin.n_sample_size) {
+ tsk_size_t index;
+ if (p_self->in.x_pin.n_sample_size == sizeof(int16_t)) {
+ // int16_t -> float
+ const int16_t* p_src = (const int16_t*)p_buff_ptr;
+ float* p_dst = (float*)p_self->p_bufftmp_ptr;
+ for (index = 0; index < _n_buff_size_in_samples; ++index) {
+ p_dst[index] = (float)p_src[index];
+ }
+ }
+ else {
+ // float -> int16_t
+ const float* p_src = (const float*)p_buff_ptr;
+ int16_t* p_dst = (int16_t*)p_self->p_bufftmp_ptr;
+ for (index = 0; index < _n_buff_size_in_samples; ++index) {
+ p_dst[index] = (int16_t)p_src[index];
+ }
+ }
+ _p_buff_ptr = p_self->p_bufftmp_ptr;
+ _n_buff_size_in_bytes = p_self->in.n_buff_size_in_bytes;
+ }
+ n_out_size = tmedia_resampler_process(p_self->p_resampler, _p_buff_ptr, _n_buff_size_in_samples, (int16_t*)p_self->out.p_buff_ptr, p_self->out.n_buff_size_in_samples);
+ if (n_out_size != p_self->out.n_buff_size_in_samples) {
+ TSK_DEBUG_ERROR("Invalid output size: %u <> %u", n_out_size, p_self->out.n_buff_size_in_bytes);
+ return -4;
+ }
+ return 0;
}
//
@@ -534,28 +531,27 @@ static int _tdav_webrtc_resampler_process(tdav_webrtc_resampler_t *p_self, const
//
static tsk_object_t* tdav_webrtc_resampler_ctor(tsk_object_t * self, va_list * app)
{
- tdav_webrtc_resampler_t *p_resampler = (tdav_webrtc_resampler_t*)self;
- if (p_resampler) {
+ tdav_webrtc_resampler_t *p_resampler = (tdav_webrtc_resampler_t*)self;
+ if (p_resampler) {
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tdav_webrtc_resampler_dtor(tsk_object_t * self)
{
- tdav_webrtc_resampler_t *p_resampler = (tdav_webrtc_resampler_t*)self;
- if (p_resampler) {
- TSK_OBJECT_SAFE_FREE(p_resampler->p_resampler);
- TSK_FREE(p_resampler->out.p_buff_ptr);
- TSK_FREE(p_resampler->p_bufftmp_ptr);
- }
- return self;
+ tdav_webrtc_resampler_t *p_resampler = (tdav_webrtc_resampler_t*)self;
+ if (p_resampler) {
+ TSK_OBJECT_SAFE_FREE(p_resampler->p_resampler);
+ TSK_FREE(p_resampler->out.p_buff_ptr);
+ TSK_FREE(p_resampler->p_bufftmp_ptr);
+ }
+ return self;
}
-static const tsk_object_def_t tdav_webrtc_resampler_def_s =
-{
- sizeof(tdav_webrtc_resampler_t),
- tdav_webrtc_resampler_ctor,
- tdav_webrtc_resampler_dtor,
- tsk_object_cmp,
+static const tsk_object_def_t tdav_webrtc_resampler_def_s = {
+ sizeof(tdav_webrtc_resampler_t),
+ tdav_webrtc_resampler_ctor,
+ tdav_webrtc_resampler_dtor,
+ tsk_object_cmp,
};
const tsk_object_def_t *tdav_webrtc_resampler_def_t = &tdav_webrtc_resampler_def_s;
@@ -567,59 +563,57 @@ const tsk_object_def_t *tdav_webrtc_resampler_def_t = &tdav_webrtc_resampler_def
/* constructor */
static tsk_object_t* tdav_webrtc_denoise_ctor(tsk_object_t * _self, va_list * app)
{
- tdav_webrtc_denoise_t *self = _self;
- if (self){
- /* init base */
- tmedia_denoise_init(TMEDIA_DENOISE(self));
- /* init self */
- tsk_safeobj_init(self);
- self->neg.channels = 1;
-
- TSK_DEBUG_INFO("Create WebRTC denoiser");
- }
- return self;
+ tdav_webrtc_denoise_t *self = _self;
+ if (self) {
+ /* init base */
+ tmedia_denoise_init(TMEDIA_DENOISE(self));
+ /* init self */
+ tsk_safeobj_init(self);
+ self->neg.channels = 1;
+
+ TSK_DEBUG_INFO("Create WebRTC denoiser");
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_webrtc_denoise_dtor(tsk_object_t * _self)
{
- tdav_webrtc_denoise_t *self = _self;
- if (self){
- /* deinit base (will close the denoise if not done yet) */
- tmedia_denoise_deinit(TMEDIA_DENOISE(self));
- /* deinit self */
- tdav_webrtc_denoise_close(TMEDIA_DENOISE(self));
- TSK_OBJECT_SAFE_FREE(self->record.p_rpl_in2den);
- TSK_OBJECT_SAFE_FREE(self->record.p_rpl_den2in);
- TSK_OBJECT_SAFE_FREE(self->playback.p_rpl_in2den);
- TSK_OBJECT_SAFE_FREE(self->playback.p_rpl_den2in);
- tsk_safeobj_deinit(self);
-
- TSK_DEBUG_INFO("*** Destroy WebRTC denoiser ***");
- }
-
- return self;
+ tdav_webrtc_denoise_t *self = _self;
+ if (self) {
+ /* deinit base (will close the denoise if not done yet) */
+ tmedia_denoise_deinit(TMEDIA_DENOISE(self));
+ /* deinit self */
+ tdav_webrtc_denoise_close(TMEDIA_DENOISE(self));
+ TSK_OBJECT_SAFE_FREE(self->record.p_rpl_in2den);
+ TSK_OBJECT_SAFE_FREE(self->record.p_rpl_den2in);
+ TSK_OBJECT_SAFE_FREE(self->playback.p_rpl_in2den);
+ TSK_OBJECT_SAFE_FREE(self->playback.p_rpl_den2in);
+ tsk_safeobj_deinit(self);
+
+ TSK_DEBUG_INFO("*** Destroy WebRTC denoiser ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_webrtc_denoise_def_s =
-{
- sizeof(tdav_webrtc_denoise_t),
- tdav_webrtc_denoise_ctor,
- tdav_webrtc_denoise_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_webrtc_denoise_def_s = {
+ sizeof(tdav_webrtc_denoise_t),
+ tdav_webrtc_denoise_ctor,
+ tdav_webrtc_denoise_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_denoise_plugin_def_t tdav_webrtc_denoise_plugin_def_s =
-{
- &tdav_webrtc_denoise_def_s,
+static const tmedia_denoise_plugin_def_t tdav_webrtc_denoise_plugin_def_s = {
+ &tdav_webrtc_denoise_def_s,
- "Audio Denoiser based on Google WebRTC",
+ "Audio Denoiser based on Google WebRTC",
- tdav_webrtc_denoise_set,
- tdav_webrtc_denoise_open,
- tdav_webrtc_denoise_echo_playback,
- tdav_webrtc_denoise_process_record,
- tdav_webrtc_denoise_process_playback,
- tdav_webrtc_denoise_close,
+ tdav_webrtc_denoise_set,
+ tdav_webrtc_denoise_open,
+ tdav_webrtc_denoise_echo_playback,
+ tdav_webrtc_denoise_process_record,
+ tdav_webrtc_denoise_process_playback,
+ tdav_webrtc_denoise_close,
};
const tmedia_denoise_plugin_def_t *tdav_webrtc_denoise_plugin_def_t = &tdav_webrtc_denoise_plugin_def_s;
diff --git a/tinyDAV/src/audio/wasapi/tdav_consumer_wasapi.cxx b/tinyDAV/src/audio/wasapi/tdav_consumer_wasapi.cxx
index c3a88e3..c4bd37f 100755
--- a/tinyDAV/src/audio/wasapi/tdav_consumer_wasapi.cxx
+++ b/tinyDAV/src/audio/wasapi/tdav_consumer_wasapi.cxx
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013-2014 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,7 +24,7 @@
#if HAVE_WASAPI
-#include "tinydav/audio/tdav_consumer_audio.h"
+#include "tinydav/audio/tdav_consumer_audio.h"
#include "tsk_thread.h"
#include "tsk_memory.h"
@@ -53,59 +53,58 @@ struct tdav_consumer_wasapi_s;
namespace Doubango
{
- namespace VoIP
- {
- ref class AudioRender sealed
- {
- public:
- virtual ~AudioRender();
- internal:
- AudioRender();
-
- int Prepare(struct tdav_consumer_wasapi_s* wasapi, const tmedia_codec_t* codec);
- int UnPrepare();
- int Start();
- int Stop();
- int Pause();
- int Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
- private:
- tsk_size_t Read(void* data, tsk_size_t size);
- void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
-
- private:
- tsk_mutex_handle_t* m_hMutex;
- const struct tdav_consumer_wasapi_s* m_pWrappedConsumer; // Must not take ref() otherwise dtor() will be never called (circular reference)
- IAudioClient2* m_pDevice;
- IAudioRenderClient* m_pClient;
- HANDLE m_hEvent;
- Windows::Foundation::IAsyncAction^ m_pAsyncThread;
- INT32 m_nBytesPerNotif;
- INT32 m_nSourceFrameSizeInBytes;
- UINT32 m_nMaxFrameCount;
- UINT32 m_nPtime;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- tsk_ssize_t leftBytes;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } m_ring;
-
- bool m_bStarted;
- bool m_bPrepared;
- bool m_bPaused;
- };
- }
+namespace VoIP
+{
+ref class AudioRender sealed
+{
+public:
+ virtual ~AudioRender();
+internal:
+ AudioRender();
+
+ int Prepare(struct tdav_consumer_wasapi_s* wasapi, const tmedia_codec_t* codec);
+ int UnPrepare();
+ int Start();
+ int Stop();
+ int Pause();
+ int Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
+private:
+ tsk_size_t Read(void* data, tsk_size_t size);
+ void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
+
+private:
+ tsk_mutex_handle_t* m_hMutex;
+ const struct tdav_consumer_wasapi_s* m_pWrappedConsumer; // Must not take ref() otherwise dtor() will be never called (circular reference)
+ IAudioClient2* m_pDevice;
+ IAudioRenderClient* m_pClient;
+ HANDLE m_hEvent;
+ Windows::Foundation::IAsyncAction^ m_pAsyncThread;
+ INT32 m_nBytesPerNotif;
+ INT32 m_nSourceFrameSizeInBytes;
+ UINT32 m_nMaxFrameCount;
+ UINT32 m_nPtime;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ tsk_ssize_t leftBytes;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } m_ring;
+
+ bool m_bStarted;
+ bool m_bPrepared;
+ bool m_bPaused;
+};
+}
}
-typedef struct tdav_consumer_wasapi_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct tdav_consumer_wasapi_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- Doubango::VoIP::AudioRender ^AudioRender;
+ Doubango::VoIP::AudioRender ^AudioRender;
}
tdav_consumer_wasapi_t;
@@ -115,83 +114,83 @@ extern "C" void tdav_win32_print_error(const char* func, HRESULT hr);
/* ============ Media consumer Interface ================= */
static int tdav_consumer_wasapi_set(tmedia_consumer_t* self, const tmedia_param_t* param)
-{
- return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+{
+ return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
static int tdav_consumer_wasapi_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
+ tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
- if (!wasapi || !codec || !wasapi->AudioRender) {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!wasapi || !codec || !wasapi->AudioRender) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TMEDIA_CONSUMER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
TMEDIA_CONSUMER(wasapi)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
TMEDIA_CONSUMER(wasapi)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
+
WASAPI_DEBUG_INFO("in.channels=%d, out.channles=%d, in.rate=%d, out.rate=%d, ptime=%d",
- TMEDIA_CONSUMER(wasapi)->audio.in.channels,
- TMEDIA_CONSUMER(wasapi)->audio.out.channels,
- TMEDIA_CONSUMER(wasapi)->audio.in.rate,
- TMEDIA_CONSUMER(wasapi)->audio.out.rate,
- TMEDIA_CONSUMER(wasapi)->audio.ptime);
+ TMEDIA_CONSUMER(wasapi)->audio.in.channels,
+ TMEDIA_CONSUMER(wasapi)->audio.out.channels,
+ TMEDIA_CONSUMER(wasapi)->audio.in.rate,
+ TMEDIA_CONSUMER(wasapi)->audio.out.rate,
+ TMEDIA_CONSUMER(wasapi)->audio.ptime);
- return wasapi->AudioRender->Prepare(wasapi, codec);
+ return wasapi->AudioRender->Prepare(wasapi, codec);
}
static int tdav_consumer_wasapi_start(tmedia_consumer_t* self)
{
- tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
+ tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
- WASAPI_DEBUG_INFO("tdav_consumer_wasapi_start()");
+ WASAPI_DEBUG_INFO("tdav_consumer_wasapi_start()");
- if (!wasapi || !wasapi->AudioRender) {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!wasapi || !wasapi->AudioRender) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->AudioRender->Start();
+ return wasapi->AudioRender->Start();
}
static int tdav_consumer_wasapi_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
-{
- tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
- if (!wasapi || !wasapi->AudioRender || !buffer || !size) {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- return wasapi->AudioRender->Consume(buffer, size, proto_hdr);
+{
+ tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
+ if (!wasapi || !wasapi->AudioRender || !buffer || !size) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ return wasapi->AudioRender->Consume(buffer, size, proto_hdr);
}
static int tdav_consumer_wasapi_pause(tmedia_consumer_t* self)
{
- tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
+ tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
- if (!wasapi || !wasapi->AudioRender){
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!wasapi || !wasapi->AudioRender) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->AudioRender->Pause();
+ return wasapi->AudioRender->Pause();
}
static int tdav_consumer_wasapi_stop(tmedia_consumer_t* self)
{
- tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
+ tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
- WASAPI_DEBUG_INFO("tdav_consumer_wasapi_stop()");
+ WASAPI_DEBUG_INFO("tdav_consumer_wasapi_stop()");
- if (!wasapi || !wasapi->AudioRender) {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!wasapi || !wasapi->AudioRender) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->AudioRender->Stop();
+ return wasapi->AudioRender->Stop();
}
@@ -201,288 +200,288 @@ static int tdav_consumer_wasapi_stop(tmedia_consumer_t* self)
Doubango::VoIP::AudioRender::AudioRender()
- : m_pDevice(nullptr)
- , m_hMutex(nullptr)
- , m_pClient(nullptr)
- , m_hEvent(nullptr)
- , m_pAsyncThread(nullptr)
- , m_pWrappedConsumer(nullptr)
- , m_nBytesPerNotif(0)
- , m_nSourceFrameSizeInBytes(0)
- , m_nMaxFrameCount(0)
- , m_nPtime(0)
- , m_bStarted(false)
- , m_bPrepared(false)
- , m_bPaused(false)
+ : m_pDevice(nullptr)
+ , m_hMutex(nullptr)
+ , m_pClient(nullptr)
+ , m_hEvent(nullptr)
+ , m_pAsyncThread(nullptr)
+ , m_pWrappedConsumer(nullptr)
+ , m_nBytesPerNotif(0)
+ , m_nSourceFrameSizeInBytes(0)
+ , m_nMaxFrameCount(0)
+ , m_nPtime(0)
+ , m_bStarted(false)
+ , m_bPrepared(false)
+ , m_bPaused(false)
{
- memset(&m_ring, 0, sizeof(m_ring));
+ memset(&m_ring, 0, sizeof(m_ring));
- if (!(m_hMutex = tsk_mutex_create())) {
- throw ref new Platform::FailureException(L"Failed to create mutex");
- }
+ if (!(m_hMutex = tsk_mutex_create())) {
+ throw ref new Platform::FailureException(L"Failed to create mutex");
+ }
}
Doubango::VoIP::AudioRender::~AudioRender()
{
- Stop();
- UnPrepare();
+ Stop();
+ UnPrepare();
- tsk_mutex_destroy(&m_hMutex);
+ tsk_mutex_destroy(&m_hMutex);
}
int Doubango::VoIP::AudioRender::Prepare(tdav_consumer_wasapi_t* wasapi, const tmedia_codec_t* codec)
{
- HRESULT hr = E_FAIL;
- int ret = 0;
- WAVEFORMATEX wfx = {0};
- AudioClientProperties properties = {0};
- LPCWSTR pwstrRenderId = nullptr;
+ HRESULT hr = E_FAIL;
+ int ret = 0;
+ WAVEFORMATEX wfx = {0};
+ AudioClientProperties properties = {0};
+ LPCWSTR pwstrRenderId = nullptr;
- #define WASAPI_SET_ERROR(code) ret = (code); goto bail;
+#define WASAPI_SET_ERROR(code) ret = (code); goto bail;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_bPrepared) {
- WASAPI_DEBUG_INFO("Already prepared");
- goto bail;
- }
+ if (m_bPrepared) {
+ WASAPI_DEBUG_INFO("Already prepared");
+ goto bail;
+ }
- if (!wasapi || !codec) {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- WASAPI_SET_ERROR(-1);
- }
+ if (!wasapi || !codec) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ WASAPI_SET_ERROR(-1);
+ }
- if (m_pDevice || m_pClient) {
- WASAPI_DEBUG_ERROR("consumer already prepared");
- WASAPI_SET_ERROR(-2);
- }
+ if (m_pDevice || m_pClient) {
+ WASAPI_DEBUG_ERROR("consumer already prepared");
+ WASAPI_SET_ERROR(-2);
+ }
pwstrRenderId = GetDefaultAudioRenderId(AudioDeviceRole::Communications);
if (NULL == pwstrRenderId) {
- tdav_win32_print_error("GetDefaultAudioRenderId", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-3);
+ tdav_win32_print_error("GetDefaultAudioRenderId", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-3);
}
hr = ActivateAudioInterface(pwstrRenderId, __uuidof(IAudioClient2), (void**)&m_pDevice);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-4);
- }
-
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-4);
+ }
+
if (SUCCEEDED(hr)) {
properties.cbSize = sizeof AudioClientProperties;
properties.eCategory = AudioCategory_Communications;
hr = m_pDevice->SetClientProperties(&properties);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-5);
- }
- }
- else {
- tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-6);
- }
-
- /* Set best format */
- {
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_CONSUMER(wasapi)->audio.in.channels;
- wfx.nSamplesPerSec = TMEDIA_CONSUMER(wasapi)->audio.in.rate;
- wfx.wBitsPerSample = TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- PWAVEFORMATEX pwfxClosestMatch = NULL;
- hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
- if (hr != S_OK && hr != S_FALSE) {
- tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-8);
- }
-
- if (hr == S_FALSE) {
- if (!pwfxClosestMatch) {
- WASAPI_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
- WASAPI_SET_ERROR(-7);
- }
-
- wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
- wfx.nChannels = pwfxClosestMatch->nChannels;
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-5);
+ }
+ }
+ else {
+ tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-6);
+ }
+
+ /* Set best format */
+ {
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_CONSUMER(wasapi)->audio.in.channels;
+ wfx.nSamplesPerSec = TMEDIA_CONSUMER(wasapi)->audio.in.rate;
+ wfx.wBitsPerSample = TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ PWAVEFORMATEX pwfxClosestMatch = NULL;
+ hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
+ if (hr != S_OK && hr != S_FALSE) {
+ tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-8);
+ }
+
+ if (hr == S_FALSE) {
+ if (!pwfxClosestMatch) {
+ WASAPI_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
+ WASAPI_SET_ERROR(-7);
+ }
+
+ wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
+ wfx.nChannels = pwfxClosestMatch->nChannels;
#if 0
- wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
+ wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
- wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
- wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
- // Request resampler
- TMEDIA_CONSUMER(wasapi)->audio.out.rate = (uint32_t)wfx.nSamplesPerSec;
- TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
- TMEDIA_CONSUMER(wasapi)->audio.out.channels = (uint8_t)wfx.nChannels;
-
- WASAPI_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
- }
- if (pwfxClosestMatch) {
- CoTaskMemFree(pwfxClosestMatch);
- }
- }
-
- m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
- m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(wasapi)->audio.ptime) / 1000);
-
- // Initialize
- hr = m_pDevice->Initialize(
- AUDCLNT_SHAREMODE_SHARED,
- AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
- WASAPI_MILLIS_TO_100NS(TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * TMEDIA_CONSUMER(wasapi)->audio.ptime),
- 0,
- &wfx,
- NULL);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("#WASAPI: Render::Initialize", hr);
- WASAPI_SET_ERROR(-9);
- }
-
- REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
- hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("GetDevicePeriod", hr);
- WASAPI_SET_ERROR(-10);
- }
- hr = m_pDevice->GetBufferSize(&m_nMaxFrameCount);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("GetBufferSize", hr);
- WASAPI_SET_ERROR(-10);
- }
-
- WASAPI_DEBUG_INFO("#WASAPI (Playback): BufferSize=%u, DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", m_nMaxFrameCount, WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
-
- if (!m_hEvent) {
- if (!(m_hEvent = CreateEventEx(NULL, NULL, 0, EVENT_MODIFY_STATE | SYNCHRONIZE))) {
- tdav_win32_print_error("CreateEventEx(EVENT_MODIFY_STATE | SYNCHRONIZE)", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-11);
- }
- }
-
- hr = m_pDevice->SetEventHandle(m_hEvent);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("SetEventHandle", hr);
- WASAPI_SET_ERROR(-12);
- }
-
+ wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
+ wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
+ // Request resampler
+ TMEDIA_CONSUMER(wasapi)->audio.out.rate = (uint32_t)wfx.nSamplesPerSec;
+ TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
+ TMEDIA_CONSUMER(wasapi)->audio.out.channels = (uint8_t)wfx.nChannels;
+
+ WASAPI_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
+ }
+ if (pwfxClosestMatch) {
+ CoTaskMemFree(pwfxClosestMatch);
+ }
+ }
+
+ m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
+ m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(wasapi)->audio.ptime) / 1000);
+
+ // Initialize
+ hr = m_pDevice->Initialize(
+ AUDCLNT_SHAREMODE_SHARED,
+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
+ WASAPI_MILLIS_TO_100NS(TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * TMEDIA_CONSUMER(wasapi)->audio.ptime),
+ 0,
+ &wfx,
+ NULL);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("#WASAPI: Render::Initialize", hr);
+ WASAPI_SET_ERROR(-9);
+ }
+
+ REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
+ hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("GetDevicePeriod", hr);
+ WASAPI_SET_ERROR(-10);
+ }
+ hr = m_pDevice->GetBufferSize(&m_nMaxFrameCount);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("GetBufferSize", hr);
+ WASAPI_SET_ERROR(-10);
+ }
+
+ WASAPI_DEBUG_INFO("#WASAPI (Playback): BufferSize=%u, DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", m_nMaxFrameCount, WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
+
+ if (!m_hEvent) {
+ if (!(m_hEvent = CreateEventEx(NULL, NULL, 0, EVENT_MODIFY_STATE | SYNCHRONIZE))) {
+ tdav_win32_print_error("CreateEventEx(EVENT_MODIFY_STATE | SYNCHRONIZE)", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-11);
+ }
+ }
+
+ hr = m_pDevice->SetEventHandle(m_hEvent);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("SetEventHandle", hr);
+ WASAPI_SET_ERROR(-12);
+ }
+
hr = m_pDevice->GetService(__uuidof(IAudioRenderClient), (void**)&m_pClient);
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("GetService", hr);
- WASAPI_SET_ERROR(-14);
- }
-
- m_ring.chunck.size = (TMEDIA_CONSUMER(wasapi)->audio.ptime * TMEDIA_CONSUMER(wasapi)->audio.out.rate * ((TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample >> 3) * TMEDIA_CONSUMER(wasapi)->audio.out.channels)) / 1000;
- m_ring.size = TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * m_ring.chunck.size;
- if (!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))) {
- m_ring.size = 0;
- WASAPI_DEBUG_ERROR("Failed to allocate new buffer");
- WASAPI_SET_ERROR(-15);
- }
- if (!m_ring.buffer) {
- m_ring.buffer = speex_buffer_init(m_ring.size);
- }
- else {
- int sret;
- if ((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0) {
- WASAPI_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
- WASAPI_SET_ERROR(-16);
- }
- }
- if (!m_ring.buffer) {
- WASAPI_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
- WASAPI_SET_ERROR(-17);
- }
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("GetService", hr);
+ WASAPI_SET_ERROR(-14);
+ }
+
+ m_ring.chunck.size = (TMEDIA_CONSUMER(wasapi)->audio.ptime * TMEDIA_CONSUMER(wasapi)->audio.out.rate * ((TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample >> 3) * TMEDIA_CONSUMER(wasapi)->audio.out.channels)) / 1000;
+ m_ring.size = TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * m_ring.chunck.size;
+ if (!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))) {
+ m_ring.size = 0;
+ WASAPI_DEBUG_ERROR("Failed to allocate new buffer");
+ WASAPI_SET_ERROR(-15);
+ }
+ if (!m_ring.buffer) {
+ m_ring.buffer = speex_buffer_init(m_ring.size);
+ }
+ else {
+ int sret;
+ if ((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0) {
+ WASAPI_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
+ WASAPI_SET_ERROR(-16);
+ }
+ }
+ if (!m_ring.buffer) {
+ WASAPI_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
+ WASAPI_SET_ERROR(-17);
+ }
bail:
- if (pwstrRenderId) {
+ if (pwstrRenderId) {
CoTaskMemFree((LPVOID)pwstrRenderId);
}
- if (ret != 0) {
- UnPrepare();
- }
+ if (ret != 0) {
+ UnPrepare();
+ }
- if ((m_bPrepared = (ret == 0))) {
- m_pWrappedConsumer = wasapi;
- m_nPtime = TMEDIA_CONSUMER(wasapi)->audio.ptime;
- }
+ if ((m_bPrepared = (ret == 0))) {
+ m_pWrappedConsumer = wasapi;
+ m_nPtime = TMEDIA_CONSUMER(wasapi)->audio.ptime;
+ }
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return ret;
+ return ret;
}
int Doubango::VoIP::AudioRender::UnPrepare()
{
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_hEvent) {
- CloseHandle(m_hEvent), m_hEvent = nullptr;
- }
- if (m_pDevice) {
- m_pDevice->Release(), m_pDevice = nullptr;
- }
- if (m_pClient) {
- m_pClient->Release(), m_pClient = nullptr;
- }
+ if (m_hEvent) {
+ CloseHandle(m_hEvent), m_hEvent = nullptr;
+ }
+ if (m_pDevice) {
+ m_pDevice->Release(), m_pDevice = nullptr;
+ }
+ if (m_pClient) {
+ m_pClient->Release(), m_pClient = nullptr;
+ }
- TSK_FREE(m_ring.chunck.buffer);
- if (m_ring.buffer) {
- speex_buffer_destroy(m_ring.buffer);
- m_ring.buffer = nullptr;
- }
+ TSK_FREE(m_ring.chunck.buffer);
+ if (m_ring.buffer) {
+ speex_buffer_destroy(m_ring.buffer);
+ m_ring.buffer = nullptr;
+ }
- m_pWrappedConsumer = nullptr;
+ m_pWrappedConsumer = nullptr;
- m_bPrepared = false;
+ m_bPrepared = false;
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int Doubango::VoIP::AudioRender::Start()
{
- tsk_mutex_lock(m_hMutex);
-
- if (m_bStarted) {
- WASAPI_DEBUG_INFO("already started");
- goto bail;
- }
- if (!m_bPrepared) {
- WASAPI_DEBUG_ERROR("not prepared");
- goto bail;
- }
-
- m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioRender::AsyncThread),
- Windows::System::Threading::WorkItemPriority::High,
- Windows::System::Threading::WorkItemOptions::TimeSliced);
-
- if ((m_bStarted = (m_pAsyncThread != nullptr))) {
- HRESULT hr = m_pDevice->Start();
- if(!SUCCEEDED(hr)) {
- tdav_win32_print_error("Device::Start", hr);
- Stop();
- }
- m_bPaused = false;
- }
-
+ tsk_mutex_lock(m_hMutex);
+
+ if (m_bStarted) {
+ WASAPI_DEBUG_INFO("already started");
+ goto bail;
+ }
+ if (!m_bPrepared) {
+ WASAPI_DEBUG_ERROR("not prepared");
+ goto bail;
+ }
+
+ m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioRender::AsyncThread),
+ Windows::System::Threading::WorkItemPriority::High,
+ Windows::System::Threading::WorkItemOptions::TimeSliced);
+
+ if ((m_bStarted = (m_pAsyncThread != nullptr))) {
+ HRESULT hr = m_pDevice->Start();
+ if(!SUCCEEDED(hr)) {
+ tdav_win32_print_error("Device::Start", hr);
+ Stop();
+ }
+ m_bPaused = false;
+ }
+
bail:
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int Doubango::VoIP::AudioRender::Stop()
{
- m_bStarted = false;
+ m_bStarted = false;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_hEvent) {
- SetEvent(m_hEvent);
+ if (m_hEvent) {
+ SetEvent(m_hEvent);
}
if (m_pAsyncThread) {
@@ -491,118 +490,118 @@ int Doubango::VoIP::AudioRender::Stop()
m_pAsyncThread = nullptr;
}
- if (m_pDevice) {
- m_pDevice->Stop();
- }
+ if (m_pDevice) {
+ m_pDevice->Stop();
+ }
- // will be prepared again before next start()
- UnPrepare();
+ // will be prepared again before next start()
+ UnPrepare();
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int Doubango::VoIP::AudioRender::Pause()
{
- m_bPaused = true;
+ m_bPaused = true;
- return 0;
+ return 0;
}
int Doubango::VoIP::AudioRender::Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- int ret;
- // tsk_mutex_lock(m_hMutex);
- ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), buffer, size, proto_hdr); // thread-safe
- // tsk_mutex_unlock(m_hMutex);
- return ret;
+ int ret;
+ // tsk_mutex_lock(m_hMutex);
+ ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), buffer, size, proto_hdr); // thread-safe
+ // tsk_mutex_unlock(m_hMutex);
+ return ret;
}
tsk_size_t Doubango::VoIP::AudioRender::Read(void* data, tsk_size_t size)
{
- tsk_ssize_t retSize = 0, availSize;
-
- m_ring.leftBytes += size;
- while (m_ring.leftBytes >= (tsk_ssize_t)m_ring.chunck.size) {
- m_ring.leftBytes -= m_ring.chunck.size;
- retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), m_ring.chunck.buffer, m_ring.chunck.size);
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer));
- speex_buffer_write(m_ring.buffer, m_ring.chunck.buffer, retSize);
- }
- // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
- // many times can corrupt the buffer. At least on OS X 1.5
+ tsk_ssize_t retSize = 0, availSize;
+
+ m_ring.leftBytes += size;
+ while (m_ring.leftBytes >= (tsk_ssize_t)m_ring.chunck.size) {
+ m_ring.leftBytes -= m_ring.chunck.size;
+ retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), m_ring.chunck.buffer, m_ring.chunck.size);
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer));
+ speex_buffer_write(m_ring.buffer, m_ring.chunck.buffer, retSize);
+ }
+ // IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
+ // many times can corrupt the buffer. At least on OS X 1.5
#if 0
- if (speex_buffer_get_available(m_ring.buffer) >= (tsk_ssize_t)size) {
- retSize = speex_buffer_read(m_ring.buffer, data, size);
- }
- else{
- memset(data, 0, size);
- }
+ if (speex_buffer_get_available(m_ring.buffer) >= (tsk_ssize_t)size) {
+ retSize = speex_buffer_read(m_ring.buffer, data, size);
+ }
+ else {
+ memset(data, 0, size);
+ }
#else
- availSize = speex_buffer_get_available(m_ring.buffer);
- if (availSize == 0) {
- memset(data, 0, size);
- }
- else {
- retSize = speex_buffer_read(m_ring.buffer, data, min(availSize, (tsk_ssize_t)size));
- if (availSize < (tsk_ssize_t)size) {
- memset(((uint8_t*)data) + availSize, 0, (size - availSize));
- }
- }
+ availSize = speex_buffer_get_available(m_ring.buffer);
+ if (availSize == 0) {
+ memset(data, 0, size);
+ }
+ else {
+ retSize = speex_buffer_read(m_ring.buffer, data, min(availSize, (tsk_ssize_t)size));
+ if (availSize < (tsk_ssize_t)size) {
+ memset(((uint8_t*)data) + availSize, 0, (size - availSize));
+ }
+ }
#endif
- return retSize;
+ return retSize;
}
void Doubango::VoIP::AudioRender::AsyncThread(Windows::Foundation::IAsyncAction^ operation)
{
- HRESULT hr = S_OK;
- INT32 nFramesToWrite;
- UINT32 nPadding, nRead;
- DWORD retval;
-
- WASAPI_DEBUG_INFO("#WASAPI: __playback_thread -- START");
-
- #define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
-
- while (m_bStarted && SUCCEEDED(hr)) {
- retval = WaitForSingleObjectEx(m_hEvent, /*m_nPtime*/INFINITE, FALSE);
-
- tsk_mutex_lock(m_hMutex);
-
- if (!m_bStarted) {
- BREAK_WHILE;
- }
-
- if (retval == WAIT_OBJECT_0) {
- hr = m_pDevice->GetCurrentPadding(&nPadding);
- if (SUCCEEDED(hr)) {
- BYTE* pRenderBuffer = NULL;
- nFramesToWrite = m_nMaxFrameCount - nPadding;
-
- if (nFramesToWrite > 0) {
- hr = m_pClient->GetBuffer(nFramesToWrite, &pRenderBuffer);
- if (SUCCEEDED(hr)) {
- nRead = Read(pRenderBuffer, (nFramesToWrite * m_nSourceFrameSizeInBytes));
-
- // Release the buffer
- hr = m_pClient->ReleaseBuffer(nFramesToWrite, (nRead == 0) ? AUDCLNT_BUFFERFLAGS_SILENT : 0);
- }
- }
- }
- }
-
- tsk_mutex_unlock(m_hMutex);
- }// end-of-while
-
- if (!SUCCEEDED(hr)) {
- tdav_win32_print_error("AsyncThread: ", hr);
- }
-
-
- WASAPI_DEBUG_INFO("__playback_thread(%s) -- STOP", (SUCCEEDED(hr) && retval == WAIT_OBJECT_0) ? "OK" : "NOK");
+ HRESULT hr = S_OK;
+ INT32 nFramesToWrite;
+ UINT32 nPadding, nRead;
+ DWORD retval;
+
+ WASAPI_DEBUG_INFO("#WASAPI: __playback_thread -- START");
+
+#define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
+
+ while (m_bStarted && SUCCEEDED(hr)) {
+ retval = WaitForSingleObjectEx(m_hEvent, /*m_nPtime*/INFINITE, FALSE);
+
+ tsk_mutex_lock(m_hMutex);
+
+ if (!m_bStarted) {
+ BREAK_WHILE;
+ }
+
+ if (retval == WAIT_OBJECT_0) {
+ hr = m_pDevice->GetCurrentPadding(&nPadding);
+ if (SUCCEEDED(hr)) {
+ BYTE* pRenderBuffer = NULL;
+ nFramesToWrite = m_nMaxFrameCount - nPadding;
+
+ if (nFramesToWrite > 0) {
+ hr = m_pClient->GetBuffer(nFramesToWrite, &pRenderBuffer);
+ if (SUCCEEDED(hr)) {
+ nRead = Read(pRenderBuffer, (nFramesToWrite * m_nSourceFrameSizeInBytes));
+
+ // Release the buffer
+ hr = m_pClient->ReleaseBuffer(nFramesToWrite, (nRead == 0) ? AUDCLNT_BUFFERFLAGS_SILENT : 0);
+ }
+ }
+ }
+ }
+
+ tsk_mutex_unlock(m_hMutex);
+ }// end-of-while
+
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("AsyncThread: ", hr);
+ }
+
+
+ WASAPI_DEBUG_INFO("__playback_thread(%s) -- STOP", (SUCCEEDED(hr) && retval == WAIT_OBJECT_0) ? "OK" : "NOK");
}
@@ -617,56 +616,54 @@ void Doubango::VoIP::AudioRender::AsyncThread(Windows::Foundation::IAsyncAction^
/* constructor */
static tsk_object_t* tdav_consumer_wasapi_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
- if (wasapi) {
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(wasapi));
- /* init self */
-
- wasapi->AudioRender = ref new Doubango::VoIP::AudioRender();
- }
- return self;
+ tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
+ if (wasapi) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(wasapi));
+ /* init self */
+
+ wasapi->AudioRender = ref new Doubango::VoIP::AudioRender();
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_wasapi_dtor(tsk_object_t * self)
-{
- tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
- if (wasapi) {
- /* stop */
- tdav_consumer_wasapi_stop((tmedia_consumer_t*)self);
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(wasapi));
- /* deinit self */
- if (wasapi->AudioRender) {
- delete wasapi->AudioRender;
- wasapi->AudioRender = nullptr;
- }
- }
-
- return self;
+{
+ tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
+ if (wasapi) {
+ /* stop */
+ tdav_consumer_wasapi_stop((tmedia_consumer_t*)self);
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(wasapi));
+ /* deinit self */
+ if (wasapi->AudioRender) {
+ delete wasapi->AudioRender;
+ wasapi->AudioRender = nullptr;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_wasapi_def_s =
-{
- sizeof(tdav_consumer_wasapi_t),
- tdav_consumer_wasapi_ctor,
- tdav_consumer_wasapi_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_wasapi_def_s = {
+ sizeof(tdav_consumer_wasapi_t),
+ tdav_consumer_wasapi_ctor,
+ tdav_consumer_wasapi_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_wasapi_plugin_def_s =
-{
- &tdav_consumer_wasapi_def_s,
-
- tmedia_audio,
- "Microsoft Windows Audio Session API (WASAPI) consumer",
-
- tdav_consumer_wasapi_set,
- tdav_consumer_wasapi_prepare,
- tdav_consumer_wasapi_start,
- tdav_consumer_wasapi_consume,
- tdav_consumer_wasapi_pause,
- tdav_consumer_wasapi_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_wasapi_plugin_def_s = {
+ &tdav_consumer_wasapi_def_s,
+
+ tmedia_audio,
+ "Microsoft Windows Audio Session API (WASAPI) consumer",
+
+ tdav_consumer_wasapi_set,
+ tdav_consumer_wasapi_prepare,
+ tdav_consumer_wasapi_start,
+ tdav_consumer_wasapi_consume,
+ tdav_consumer_wasapi_pause,
+ tdav_consumer_wasapi_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_wasapi_plugin_def_t = &tdav_consumer_wasapi_plugin_def_s;
diff --git a/tinyDAV/src/audio/wasapi/tdav_producer_wasapi.cxx b/tinyDAV/src/audio/wasapi/tdav_producer_wasapi.cxx
index 7d172a2..1a2b186 100755
--- a/tinyDAV/src/audio/wasapi/tdav_producer_wasapi.cxx
+++ b/tinyDAV/src/audio/wasapi/tdav_producer_wasapi.cxx
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou DIOP
* Copyright (C) 2013-2014 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -24,7 +24,7 @@
#if HAVE_WASAPI
-#include "tinydav/audio/tdav_producer_audio.h"
+#include "tinydav/audio/tdav_producer_audio.h"
#include "tsk_memory.h"
#include "tsk_string.h"
@@ -51,59 +51,58 @@ struct tdav_producer_wasapi_s;
namespace Doubango
{
- namespace VoIP
- {
- ref class AudioCapture sealed
- {
- public:
- virtual ~AudioCapture();
- internal:
- AudioCapture();
-
- int Prepare(struct tdav_producer_wasapi_s* wasapi, const tmedia_codec_t* codec);
- int UnPrepare();
- int Start();
- int Stop();
- int Pause();
-
- private:
- void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
-
- private:
- tsk_mutex_handle_t* m_hMutex;
- IAudioClient2* m_pDevice;
- IAudioCaptureClient* m_pClient;
- HANDLE m_hCaptureEvent;
- HANDLE m_hShutdownEvent;
- Windows::Foundation::IAsyncAction^ m_pAsyncThread;
- INT32 m_nBytesPerNotif;
- INT32 m_nSourceFrameSizeInBytes;
-
- struct{
- tmedia_producer_enc_cb_f fn;
- const void* pcData;
- } m_callback;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } m_ring;
- bool m_bStarted;
- bool m_bPrepared;
- bool m_bPaused;
- };
- }
+namespace VoIP
+{
+ref class AudioCapture sealed
+{
+public:
+ virtual ~AudioCapture();
+internal:
+ AudioCapture();
+
+ int Prepare(struct tdav_producer_wasapi_s* wasapi, const tmedia_codec_t* codec);
+ int UnPrepare();
+ int Start();
+ int Stop();
+ int Pause();
+
+private:
+ void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
+
+private:
+ tsk_mutex_handle_t* m_hMutex;
+ IAudioClient2* m_pDevice;
+ IAudioCaptureClient* m_pClient;
+ HANDLE m_hCaptureEvent;
+ HANDLE m_hShutdownEvent;
+ Windows::Foundation::IAsyncAction^ m_pAsyncThread;
+ INT32 m_nBytesPerNotif;
+ INT32 m_nSourceFrameSizeInBytes;
+
+ struct {
+ tmedia_producer_enc_cb_f fn;
+ const void* pcData;
+ } m_callback;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } m_ring;
+ bool m_bStarted;
+ bool m_bPrepared;
+ bool m_bPaused;
+};
+}
}
-typedef struct tdav_producer_wasapi_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
+typedef struct tdav_producer_wasapi_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
- Doubango::VoIP::AudioCapture ^audioCapture;
+ Doubango::VoIP::AudioCapture ^audioCapture;
}
tdav_producer_wasapi_t;
@@ -112,94 +111,94 @@ extern "C" void tdav_win32_print_error(const char* func, HRESULT hr);
/* ============ Media Producer Interface ================= */
static int tdav_producer_wasapi_set(tmedia_producer_t* self, const tmedia_param_t* param)
-{
- tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
- if (param->plugin_type == tmedia_ppt_producer) {
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "volume")) {
- return 0;
- }
- else if (tsk_striequals(param->key, "mute")) {
- //wasapi->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
+{
+ tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
+ if (param->plugin_type == tmedia_ppt_producer) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "volume")) {
+ return 0;
+ }
+ else if (tsk_striequals(param->key, "mute")) {
+ //wasapi->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
#if !FIXME_SEND_SILENCE_ON_MUTE
- //if(wasapi->started){
- // if(wasapi->mute){
- //IDirectSoundCaptureBuffer_Stop(wasapi->captureBuffer);
- // }
- // else{
- //IDirectSoundCaptureBuffer_Start(wasapi->captureBuffer, DSBPLAY_LOOPING);
- // }
- //}
+ //if(wasapi->started){
+ // if(wasapi->mute){
+ //IDirectSoundCaptureBuffer_Stop(wasapi->captureBuffer);
+ // }
+ // else{
+ //IDirectSoundCaptureBuffer_Start(wasapi->captureBuffer, DSBPLAY_LOOPING);
+ // }
+ //}
#endif
- return 0;
- }
- }
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ return 0;
+ }
+ }
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_wasapi_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
+ tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
- if(!wasapi || !codec || !wasapi->audioCapture){
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !codec || !wasapi->audioCapture) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* codec should have ptime */
+ /* codec should have ptime */
TMEDIA_PRODUCER(wasapi)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
TMEDIA_PRODUCER(wasapi)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
TMEDIA_PRODUCER(wasapi)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- WASAPI_DEBUG_INFO("channels=%d, rate=%d, ptime=%d",
- TMEDIA_PRODUCER(wasapi)->audio.channels,
- TMEDIA_PRODUCER(wasapi)->audio.rate,
- TMEDIA_PRODUCER(wasapi)->audio.ptime);
+ WASAPI_DEBUG_INFO("channels=%d, rate=%d, ptime=%d",
+ TMEDIA_PRODUCER(wasapi)->audio.channels,
+ TMEDIA_PRODUCER(wasapi)->audio.rate,
+ TMEDIA_PRODUCER(wasapi)->audio.ptime);
- return wasapi->audioCapture->Prepare(wasapi, codec);
+ return wasapi->audioCapture->Prepare(wasapi, codec);
}
static int tdav_producer_wasapi_start(tmedia_producer_t* self)
{
- tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
+ tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
- WASAPI_DEBUG_INFO("tdav_producer_wasapi_start()");
+ WASAPI_DEBUG_INFO("tdav_producer_wasapi_start()");
- if(!wasapi || !wasapi->audioCapture){
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->audioCapture) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->audioCapture->Start();
+ return wasapi->audioCapture->Start();
}
static int tdav_producer_wasapi_pause(tmedia_producer_t* self)
{
- tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
+ tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
- if(!wasapi || !wasapi->audioCapture){
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->audioCapture) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->audioCapture->Pause();
+ return wasapi->audioCapture->Pause();
}
static int tdav_producer_wasapi_stop(tmedia_producer_t* self)
{
- tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
+ tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
- WASAPI_DEBUG_INFO("tdav_producer_wasapi_stop()");
+ WASAPI_DEBUG_INFO("tdav_producer_wasapi_stop()");
- if(!wasapi || !wasapi->audioCapture){
- WASAPI_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!wasapi || !wasapi->audioCapture) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return wasapi->audioCapture->Stop();
+ return wasapi->audioCapture->Stop();
}
@@ -209,406 +208,389 @@ static int tdav_producer_wasapi_stop(tmedia_producer_t* self)
Doubango::VoIP::AudioCapture::AudioCapture()
- : m_pDevice(nullptr)
- , m_hMutex(nullptr)
- , m_pClient(nullptr)
- , m_hCaptureEvent(nullptr)
- , m_hShutdownEvent(nullptr)
- , m_pAsyncThread(nullptr)
- , m_nBytesPerNotif(0)
- , m_nSourceFrameSizeInBytes(0)
- , m_bStarted(false)
- , m_bPrepared(false)
- , m_bPaused(false)
+ : m_pDevice(nullptr)
+ , m_hMutex(nullptr)
+ , m_pClient(nullptr)
+ , m_hCaptureEvent(nullptr)
+ , m_hShutdownEvent(nullptr)
+ , m_pAsyncThread(nullptr)
+ , m_nBytesPerNotif(0)
+ , m_nSourceFrameSizeInBytes(0)
+ , m_bStarted(false)
+ , m_bPrepared(false)
+ , m_bPaused(false)
{
- m_callback.fn = nullptr, m_callback.pcData = nullptr;
- memset(&m_ring, 0, sizeof(m_ring));
+ m_callback.fn = nullptr, m_callback.pcData = nullptr;
+ memset(&m_ring, 0, sizeof(m_ring));
- if(!(m_hMutex = tsk_mutex_create())){
- throw ref new Platform::FailureException(L"Failed to create mutex");
- }
+ if(!(m_hMutex = tsk_mutex_create())) {
+ throw ref new Platform::FailureException(L"Failed to create mutex");
+ }
}
Doubango::VoIP::AudioCapture::~AudioCapture()
{
- Stop();
- UnPrepare();
+ Stop();
+ UnPrepare();
- tsk_mutex_destroy(&m_hMutex);
+ tsk_mutex_destroy(&m_hMutex);
}
int Doubango::VoIP::AudioCapture::Prepare(tdav_producer_wasapi_t* wasapi, const tmedia_codec_t* codec)
{
- HRESULT hr = E_FAIL;
- int ret = 0;
- WAVEFORMATEX wfx = {0};
- AudioClientProperties properties = {0};
- LPCWSTR pwstrCaptureId = nullptr;
+ HRESULT hr = E_FAIL;
+ int ret = 0;
+ WAVEFORMATEX wfx = {0};
+ AudioClientProperties properties = {0};
+ LPCWSTR pwstrCaptureId = nullptr;
- #define WASAPI_SET_ERROR(code) ret = (code); goto bail;
+#define WASAPI_SET_ERROR(code) ret = (code); goto bail;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if(m_bPrepared)
- {
- WASAPI_DEBUG_INFO("#WASAPI: Audio producer already prepared");
- goto bail;
- }
+ if(m_bPrepared) {
+ WASAPI_DEBUG_INFO("#WASAPI: Audio producer already prepared");
+ goto bail;
+ }
- if(!wasapi || !codec)
- {
- WASAPI_DEBUG_ERROR("Invalid parameter");
- WASAPI_SET_ERROR(-1);
- }
+ if(!wasapi || !codec) {
+ WASAPI_DEBUG_ERROR("Invalid parameter");
+ WASAPI_SET_ERROR(-1);
+ }
- if(m_pDevice || m_pClient){
- WASAPI_DEBUG_ERROR("Producer already prepared");
- WASAPI_SET_ERROR(-2);
- }
+ if(m_pDevice || m_pClient) {
+ WASAPI_DEBUG_ERROR("Producer already prepared");
+ WASAPI_SET_ERROR(-2);
+ }
pwstrCaptureId = GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
- if (NULL == pwstrCaptureId){
- tdav_win32_print_error("GetDefaultAudioCaptureId", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-3);
+ if (NULL == pwstrCaptureId) {
+ tdav_win32_print_error("GetDefaultAudioCaptureId", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-3);
}
hr = ActivateAudioInterface(pwstrCaptureId, __uuidof(IAudioClient2), (void**)&m_pDevice);
- if(!SUCCEEDED(hr)){
- tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-4);
- }
-
- if (SUCCEEDED(hr)){
+ if(!SUCCEEDED(hr)) {
+ tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-4);
+ }
+
+ if (SUCCEEDED(hr)) {
properties.cbSize = sizeof AudioClientProperties;
properties.eCategory = AudioCategory_Communications;
hr = m_pDevice->SetClientProperties(&properties);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-5);
- }
- }
- else{
- tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-6);
- }
-
- /* Set best format */
- {
- wfx.wFormatTag = WAVE_FORMAT_PCM;
- wfx.nChannels = TMEDIA_PRODUCER(wasapi)->audio.channels;
- wfx.nSamplesPerSec = TMEDIA_PRODUCER(wasapi)->audio.rate;
- wfx.wBitsPerSample = TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample;
- wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
- wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
-
- PWAVEFORMATEX pwfxClosestMatch = NULL;
- hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
- if(hr != S_OK && hr != S_FALSE)
- {
- tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-8);
- }
-
- if(hr == S_FALSE)
- {
- if(!pwfxClosestMatch)
- {
- WASAPI_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
- WASAPI_SET_ERROR(-7);
- }
- wfx.nChannels = pwfxClosestMatch->nChannels;
- wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-5);
+ }
+ }
+ else {
+ tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-6);
+ }
+
+ /* Set best format */
+ {
+ wfx.wFormatTag = WAVE_FORMAT_PCM;
+ wfx.nChannels = TMEDIA_PRODUCER(wasapi)->audio.channels;
+ wfx.nSamplesPerSec = TMEDIA_PRODUCER(wasapi)->audio.rate;
+ wfx.wBitsPerSample = TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample;
+ wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
+ wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
+
+ PWAVEFORMATEX pwfxClosestMatch = NULL;
+ hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
+ if(hr != S_OK && hr != S_FALSE) {
+ tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-8);
+ }
+
+ if(hr == S_FALSE) {
+ if(!pwfxClosestMatch) {
+ WASAPI_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
+ WASAPI_SET_ERROR(-7);
+ }
+ wfx.nChannels = pwfxClosestMatch->nChannels;
+ wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
#if 0
- wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
+ wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
- wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
- wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
- // Request resampler
- TMEDIA_PRODUCER(wasapi)->audio.rate = (uint32_t)wfx.nSamplesPerSec;
- TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
- TMEDIA_PRODUCER(wasapi)->audio.channels = (uint8_t)wfx.nChannels;
-
- WASAPI_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
- }
- if(pwfxClosestMatch)
- {
- CoTaskMemFree(pwfxClosestMatch);
- }
- }
-
- m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
- m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(wasapi)->audio.ptime)/1000);
-
- // Initialize
- hr = m_pDevice->Initialize(
- AUDCLNT_SHAREMODE_SHARED,
- AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
- (TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_PRODUCER(wasapi)->audio.ptime)),
- 0,
- &wfx,
- NULL);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("#WASAPI: Capture::SetClientProperties", hr);
- WASAPI_SET_ERROR(-9);
- }
-
- REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
- hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("GetDevicePeriod", hr);
- WASAPI_SET_ERROR(-10);
- }
- WASAPI_DEBUG_INFO("#WASAPI(Capture): DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
-
- if(!m_hCaptureEvent){
- if(!(m_hCaptureEvent = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS))){
- tdav_win32_print_error("CreateEventEx(Capture)", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-11);
- }
- }
- if(!m_hShutdownEvent){
- if(!(m_hShutdownEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS))){
- tdav_win32_print_error("CreateEventEx(Shutdown)", HRESULT_FROM_WIN32(GetLastError()));
- WASAPI_SET_ERROR(-12);
- }
- }
-
+ wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
+ wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
+ // Request resampler
+ TMEDIA_PRODUCER(wasapi)->audio.rate = (uint32_t)wfx.nSamplesPerSec;
+ TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
+ TMEDIA_PRODUCER(wasapi)->audio.channels = (uint8_t)wfx.nChannels;
+
+ WASAPI_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
+ }
+ if(pwfxClosestMatch) {
+ CoTaskMemFree(pwfxClosestMatch);
+ }
+ }
+
+ m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
+ m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(wasapi)->audio.ptime)/1000);
+
+ // Initialize
+ hr = m_pDevice->Initialize(
+ AUDCLNT_SHAREMODE_SHARED,
+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
+ (TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_PRODUCER(wasapi)->audio.ptime)),
+ 0,
+ &wfx,
+ NULL);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("#WASAPI: Capture::SetClientProperties", hr);
+ WASAPI_SET_ERROR(-9);
+ }
+
+ REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
+ hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("GetDevicePeriod", hr);
+ WASAPI_SET_ERROR(-10);
+ }
+ WASAPI_DEBUG_INFO("#WASAPI(Capture): DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
+
+ if(!m_hCaptureEvent) {
+ if(!(m_hCaptureEvent = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS))) {
+ tdav_win32_print_error("CreateEventEx(Capture)", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-11);
+ }
+ }
+ if(!m_hShutdownEvent) {
+ if(!(m_hShutdownEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS))) {
+ tdav_win32_print_error("CreateEventEx(Shutdown)", HRESULT_FROM_WIN32(GetLastError()));
+ WASAPI_SET_ERROR(-12);
+ }
+ }
+
hr = m_pDevice->SetEventHandle(m_hCaptureEvent);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("SetEventHandle", hr);
- WASAPI_SET_ERROR(-13);
- }
-
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("SetEventHandle", hr);
+ WASAPI_SET_ERROR(-13);
+ }
+
hr = m_pDevice->GetService(__uuidof(IAudioCaptureClient), (void**)&m_pClient);
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("GetService", hr);
- WASAPI_SET_ERROR(-14);
- }
-
- int packetperbuffer = (1000 / TMEDIA_PRODUCER(wasapi)->audio.ptime);
- m_ring.chunck.size = wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer;
- WASAPI_DEBUG_INFO("#WASAPI: Audio producer ring chunk size = %u", m_ring.chunck.size);
- // allocate our chunck buffer
- if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))){
- WASAPI_DEBUG_ERROR("Failed to allocate new buffer");
- WASAPI_SET_ERROR(-15);
- }
- // create ringbuffer
- m_ring.size = TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * m_ring.chunck.size;
- WASAPI_DEBUG_INFO("#WASAPI: Audio producer ring size = %u", m_ring.size);
- if(!m_ring.buffer){
- m_ring.buffer = speex_buffer_init(m_ring.size);
- }
- else {
- int sret;
- if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0){
- WASAPI_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
- WASAPI_SET_ERROR(-16);
- }
- }
- if(!m_ring.buffer){
- WASAPI_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
- WASAPI_SET_ERROR(-17);
- }
-
- m_callback.fn = TMEDIA_PRODUCER(wasapi)->enc_cb.callback;
- m_callback.pcData = TMEDIA_PRODUCER(wasapi)->enc_cb.callback_data;
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("GetService", hr);
+ WASAPI_SET_ERROR(-14);
+ }
+
+ int packetperbuffer = (1000 / TMEDIA_PRODUCER(wasapi)->audio.ptime);
+ m_ring.chunck.size = wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer;
+ WASAPI_DEBUG_INFO("#WASAPI: Audio producer ring chunk size = %u", m_ring.chunck.size);
+ // allocate our chunck buffer
+ if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))) {
+ WASAPI_DEBUG_ERROR("Failed to allocate new buffer");
+ WASAPI_SET_ERROR(-15);
+ }
+ // create ringbuffer
+ m_ring.size = TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * m_ring.chunck.size;
+ WASAPI_DEBUG_INFO("#WASAPI: Audio producer ring size = %u", m_ring.size);
+ if(!m_ring.buffer) {
+ m_ring.buffer = speex_buffer_init(m_ring.size);
+ }
+ else {
+ int sret;
+ if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0) {
+ WASAPI_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
+ WASAPI_SET_ERROR(-16);
+ }
+ }
+ if(!m_ring.buffer) {
+ WASAPI_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
+ WASAPI_SET_ERROR(-17);
+ }
+
+ m_callback.fn = TMEDIA_PRODUCER(wasapi)->enc_cb.callback;
+ m_callback.pcData = TMEDIA_PRODUCER(wasapi)->enc_cb.callback_data;
bail:
- if (pwstrCaptureId){
+ if (pwstrCaptureId) {
CoTaskMemFree((LPVOID)pwstrCaptureId);
}
- if(ret != 0){
- UnPrepare();
- }
- m_bPrepared = (ret == 0);
+ if(ret != 0) {
+ UnPrepare();
+ }
+ m_bPrepared = (ret == 0);
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return ret;
+ return ret;
}
int Doubango::VoIP::AudioCapture::UnPrepare()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_hCaptureEvent)
- {
- CloseHandle(m_hCaptureEvent), m_hCaptureEvent = nullptr;
- }
- if(m_hShutdownEvent)
- {
- CloseHandle(m_hShutdownEvent), m_hShutdownEvent = nullptr;
- }
- if(m_pDevice)
- {
- m_pDevice->Release(), m_pDevice = nullptr;
- }
- if(m_pClient)
- {
- m_pClient->Release(), m_pClient = nullptr;
- }
-
- TSK_FREE(m_ring.chunck.buffer);
- if(m_ring.buffer){
- speex_buffer_destroy(m_ring.buffer);
- m_ring.buffer = nullptr;
- }
-
- m_callback.fn = nullptr;
- m_callback.pcData = nullptr;
-
- m_bPrepared = false;
-
- tsk_mutex_unlock(m_hMutex);
-
- return 0;
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_hCaptureEvent) {
+ CloseHandle(m_hCaptureEvent), m_hCaptureEvent = nullptr;
+ }
+ if(m_hShutdownEvent) {
+ CloseHandle(m_hShutdownEvent), m_hShutdownEvent = nullptr;
+ }
+ if(m_pDevice) {
+ m_pDevice->Release(), m_pDevice = nullptr;
+ }
+ if(m_pClient) {
+ m_pClient->Release(), m_pClient = nullptr;
+ }
+
+ TSK_FREE(m_ring.chunck.buffer);
+ if(m_ring.buffer) {
+ speex_buffer_destroy(m_ring.buffer);
+ m_ring.buffer = nullptr;
+ }
+
+ m_callback.fn = nullptr;
+ m_callback.pcData = nullptr;
+
+ m_bPrepared = false;
+
+ tsk_mutex_unlock(m_hMutex);
+
+ return 0;
}
int Doubango::VoIP::AudioCapture::Start()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_bStarted)
- {
- WASAPI_DEBUG_INFO("#WASAPI: Audio producer already started");
- goto bail;
- }
- if(!m_bPrepared)
- {
- WASAPI_DEBUG_ERROR("Audio producer not prepared");
- goto bail;
- }
-
- m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioCapture::AsyncThread),
- Windows::System::Threading::WorkItemPriority::High,
- Windows::System::Threading::WorkItemOptions::TimeSliced);
-
- if((m_bStarted = (m_pAsyncThread != nullptr)))
- {
- HRESULT hr = m_pDevice->Start();
- if(!SUCCEEDED(hr))
- {
- tdav_win32_print_error("Device::Start", hr);
- Stop();
- }
- m_bPaused = false;
- }
-
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bStarted) {
+ WASAPI_DEBUG_INFO("#WASAPI: Audio producer already started");
+ goto bail;
+ }
+ if(!m_bPrepared) {
+ WASAPI_DEBUG_ERROR("Audio producer not prepared");
+ goto bail;
+ }
+
+ m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioCapture::AsyncThread),
+ Windows::System::Threading::WorkItemPriority::High,
+ Windows::System::Threading::WorkItemOptions::TimeSliced);
+
+ if((m_bStarted = (m_pAsyncThread != nullptr))) {
+ HRESULT hr = m_pDevice->Start();
+ if(!SUCCEEDED(hr)) {
+ tdav_win32_print_error("Device::Start", hr);
+ Stop();
+ }
+ m_bPaused = false;
+ }
+
bail:
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int Doubango::VoIP::AudioCapture::Stop()
{
- m_bStarted = false;
+ m_bStarted = false;
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if (m_hShutdownEvent)
- {
- SetEvent(m_hShutdownEvent);
+ if (m_hShutdownEvent) {
+ SetEvent(m_hShutdownEvent);
}
- if (m_pAsyncThread)
- {
+ if (m_pAsyncThread) {
m_pAsyncThread->Cancel();
m_pAsyncThread->Close();
m_pAsyncThread = nullptr;
}
- if(m_pDevice)
- {
- m_pDevice->Stop();
- }
+ if(m_pDevice) {
+ m_pDevice->Stop();
+ }
- // will be prepared again before next start()
- UnPrepare();
+ // will be prepared again before next start()
+ UnPrepare();
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int Doubango::VoIP::AudioCapture::Pause()
{
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- m_bPaused = true;
+ m_bPaused = true;
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
void Doubango::VoIP::AudioCapture::AsyncThread(Windows::Foundation::IAsyncAction^ operation)
{
- HRESULT hr = S_OK;
- BYTE* pbData = nullptr;
+ HRESULT hr = S_OK;
+ BYTE* pbData = nullptr;
UINT32 nFrames = 0;
DWORD dwFlags = 0;
- UINT32 incomingBufferSize;
- INT32 avail;
- UINT32 nNextPacketSize;
-
- HANDLE eventHandles[] = {
- m_hCaptureEvent, // WAIT_OBJECT0
- m_hShutdownEvent // WAIT_OBJECT1
- };
-
- WASAPI_DEBUG_INFO("#WASAPI: __record_thread -- START");
-
- #define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
-
- while(m_bStarted && SUCCEEDED(hr)){
- DWORD waitResult = WaitForMultipleObjectsEx(SIZEOF_ARRAY(eventHandles), eventHandles, FALSE, INFINITE, FALSE);
-
- tsk_mutex_lock(m_hMutex);
-
- if(!m_bStarted){
- BREAK_WHILE;
- }
-
- if(waitResult == WAIT_OBJECT_0 && m_callback.fn) {
- hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
- while(SUCCEEDED(hr) && nNextPacketSize >0){
- hr = m_pClient->GetBuffer(&pbData, &nFrames, &dwFlags, nullptr, nullptr);
- if(SUCCEEDED(hr) && pbData && nFrames){
- if((dwFlags & AUDCLNT_BUFFERFLAGS_SILENT) != AUDCLNT_BUFFERFLAGS_SILENT){
- incomingBufferSize = nFrames * m_nSourceFrameSizeInBytes;
- speex_buffer_write(m_ring.buffer, pbData, incomingBufferSize);
- avail = speex_buffer_get_available(m_ring.buffer);
- while (m_bStarted && avail >= (INT32)m_ring.chunck.size) {
- avail -= speex_buffer_read(m_ring.buffer, m_ring.chunck.buffer, m_ring.chunck.size);
- m_callback.fn(m_callback.pcData, m_ring.chunck.buffer, m_ring.chunck.size);
- }
- }
-
- if (SUCCEEDED(hr)){
- hr = m_pClient->ReleaseBuffer(nFrames);
- }
- if (SUCCEEDED(hr)){
- hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
- }
- }
- }
- }
- else if(waitResult != WAIT_OBJECT_0){
- BREAK_WHILE;
- }
-
- tsk_mutex_unlock(m_hMutex);
- }// end-of-while
-
- if (!SUCCEEDED(hr)){
- tdav_win32_print_error("AsyncThread: ", hr);
- }
-
-
- WASAPI_DEBUG_INFO("WASAPI: __record_thread(%s) -- STOP", SUCCEEDED(hr) ? "OK": "NOK");
+ UINT32 incomingBufferSize;
+ INT32 avail;
+ UINT32 nNextPacketSize;
+
+ HANDLE eventHandles[] = {
+ m_hCaptureEvent, // WAIT_OBJECT0
+ m_hShutdownEvent // WAIT_OBJECT1
+ };
+
+ WASAPI_DEBUG_INFO("#WASAPI: __record_thread -- START");
+
+#define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
+
+ while(m_bStarted && SUCCEEDED(hr)) {
+ DWORD waitResult = WaitForMultipleObjectsEx(SIZEOF_ARRAY(eventHandles), eventHandles, FALSE, INFINITE, FALSE);
+
+ tsk_mutex_lock(m_hMutex);
+
+ if(!m_bStarted) {
+ BREAK_WHILE;
+ }
+
+ if(waitResult == WAIT_OBJECT_0 && m_callback.fn) {
+ hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
+ while(SUCCEEDED(hr) && nNextPacketSize >0) {
+ hr = m_pClient->GetBuffer(&pbData, &nFrames, &dwFlags, nullptr, nullptr);
+ if(SUCCEEDED(hr) && pbData && nFrames) {
+ if((dwFlags & AUDCLNT_BUFFERFLAGS_SILENT) != AUDCLNT_BUFFERFLAGS_SILENT) {
+ incomingBufferSize = nFrames * m_nSourceFrameSizeInBytes;
+ speex_buffer_write(m_ring.buffer, pbData, incomingBufferSize);
+ avail = speex_buffer_get_available(m_ring.buffer);
+ while (m_bStarted && avail >= (INT32)m_ring.chunck.size) {
+ avail -= speex_buffer_read(m_ring.buffer, m_ring.chunck.buffer, m_ring.chunck.size);
+ m_callback.fn(m_callback.pcData, m_ring.chunck.buffer, m_ring.chunck.size);
+ }
+ }
+
+ if (SUCCEEDED(hr)) {
+ hr = m_pClient->ReleaseBuffer(nFrames);
+ }
+ if (SUCCEEDED(hr)) {
+ hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
+ }
+ }
+ }
+ }
+ else if(waitResult != WAIT_OBJECT_0) {
+ BREAK_WHILE;
+ }
+
+ tsk_mutex_unlock(m_hMutex);
+ }// end-of-while
+
+ if (!SUCCEEDED(hr)) {
+ tdav_win32_print_error("AsyncThread: ", hr);
+ }
+
+
+ WASAPI_DEBUG_INFO("WASAPI: __record_thread(%s) -- STOP", SUCCEEDED(hr) ? "OK": "NOK");
}
@@ -623,55 +605,53 @@ void Doubango::VoIP::AudioCapture::AsyncThread(Windows::Foundation::IAsyncAction
/* constructor */
static tsk_object_t* tdav_producer_wasapi_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
- if(wasapi){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(wasapi));
- /* init self */
-
- wasapi->audioCapture = ref new Doubango::VoIP::AudioCapture();
- }
- return self;
+ tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
+ if(wasapi) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(wasapi));
+ /* init self */
+
+ wasapi->audioCapture = ref new Doubango::VoIP::AudioCapture();
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_wasapi_dtor(tsk_object_t * self)
-{
- tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
- if(wasapi){
- /* stop */
- tdav_producer_wasapi_stop((tmedia_producer_t*)self);
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(wasapi));
- /* deinit self */
- if(wasapi->audioCapture){
- delete wasapi->audioCapture;
- wasapi->audioCapture = nullptr;
- }
- }
-
- return self;
+{
+ tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
+ if(wasapi) {
+ /* stop */
+ tdav_producer_wasapi_stop((tmedia_producer_t*)self);
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(wasapi));
+ /* deinit self */
+ if(wasapi->audioCapture) {
+ delete wasapi->audioCapture;
+ wasapi->audioCapture = nullptr;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_wasapi_def_s =
-{
- sizeof(tdav_producer_wasapi_t),
- tdav_producer_wasapi_ctor,
- tdav_producer_wasapi_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_wasapi_def_s = {
+ sizeof(tdav_producer_wasapi_t),
+ tdav_producer_wasapi_ctor,
+ tdav_producer_wasapi_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_wasapi_plugin_def_s =
-{
- &tdav_producer_wasapi_def_s,
-
- tmedia_audio,
- "Microsoft Windows Audio Session API (WASAPI) producer",
-
- tdav_producer_wasapi_set,
- tdav_producer_wasapi_prepare,
- tdav_producer_wasapi_start,
- tdav_producer_wasapi_pause,
- tdav_producer_wasapi_stop
+static const tmedia_producer_plugin_def_t tdav_producer_wasapi_plugin_def_s = {
+ &tdav_producer_wasapi_def_s,
+
+ tmedia_audio,
+ "Microsoft Windows Audio Session API (WASAPI) producer",
+
+ tdav_producer_wasapi_set,
+ tdav_producer_wasapi_prepare,
+ tdav_producer_wasapi_start,
+ tdav_producer_wasapi_pause,
+ tdav_producer_wasapi_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_wasapi_plugin_def_t = &tdav_producer_wasapi_plugin_def_s;
diff --git a/tinyDAV/src/audio/waveapi/tdav_consumer_waveapi.c b/tinyDAV/src/audio/waveapi/tdav_consumer_waveapi.c
index 1883fa4..bf95818 100755
--- a/tinyDAV/src/audio/waveapi/tdav_consumer_waveapi.c
+++ b/tinyDAV/src/audio/waveapi/tdav_consumer_waveapi.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,151 +36,151 @@
static void print_last_error(MMRESULT mmrError, const char* func)
{
- static char buffer_err[TDAV_WAVEAPI_CONSUMER_ERROR_BUFF_COUNT];
+ static char buffer_err[TDAV_WAVEAPI_CONSUMER_ERROR_BUFF_COUNT];
- waveOutGetErrorTextA(mmrError, buffer_err, sizeof(buffer_err));
- TSK_DEBUG_ERROR("%s() error: %s", func, buffer_err);
+ waveOutGetErrorTextA(mmrError, buffer_err, sizeof(buffer_err));
+ TSK_DEBUG_ERROR("%s() error: %s", func, buffer_err);
}
static int free_wavehdr(tdav_consumer_waveapi_t* consumer, tsk_size_t index)
{
- if(!consumer || index >= sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer || index >= sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_FREE(consumer->hWaveHeaders[index]->lpData);
- TSK_FREE(consumer->hWaveHeaders[index]);
+ TSK_FREE(consumer->hWaveHeaders[index]->lpData);
+ TSK_FREE(consumer->hWaveHeaders[index]);
- return 0;
+ return 0;
}
static int create_wavehdr(tdav_consumer_waveapi_t* consumer, tsk_size_t index)
{
- if(!consumer || index >= sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(consumer->hWaveHeaders[index]){
- free_wavehdr(consumer, index);
- }
-
- consumer->hWaveHeaders[index] = tsk_calloc(1, sizeof(WAVEHDR));
- consumer->hWaveHeaders[index]->lpData = tsk_calloc(1, consumer->bytes_per_notif);
- consumer->hWaveHeaders[index]->dwBufferLength = (DWORD)consumer->bytes_per_notif;
- consumer->hWaveHeaders[index]->dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;
- consumer->hWaveHeaders[index]->dwLoops = 0x01;
- consumer->hWaveHeaders[index]->dwUser = index;
-
- return 0;
+ if(!consumer || index >= sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(consumer->hWaveHeaders[index]) {
+ free_wavehdr(consumer, index);
+ }
+
+ consumer->hWaveHeaders[index] = tsk_calloc(1, sizeof(WAVEHDR));
+ consumer->hWaveHeaders[index]->lpData = tsk_calloc(1, consumer->bytes_per_notif);
+ consumer->hWaveHeaders[index]->dwBufferLength = (DWORD)consumer->bytes_per_notif;
+ consumer->hWaveHeaders[index]->dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;
+ consumer->hWaveHeaders[index]->dwLoops = 0x01;
+ consumer->hWaveHeaders[index]->dwUser = index;
+
+ return 0;
}
static int write_wavehdr(tdav_consumer_waveapi_t* consumer, tsk_size_t index)
{
- MMRESULT result;
-
- if(!consumer || !consumer->hWaveHeaders[index] || !consumer->hWaveOut){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- result = waveOutPrepareHeader(consumer->hWaveOut, consumer->hWaveHeaders[index], sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutPrepareHeader");
- return -2;
- }
-
- result = waveOutWrite(consumer->hWaveOut, consumer->hWaveHeaders[index], sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutWrite");
- return -3;
- }
-
- return 0;
+ MMRESULT result;
+
+ if(!consumer || !consumer->hWaveHeaders[index] || !consumer->hWaveOut) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ result = waveOutPrepareHeader(consumer->hWaveOut, consumer->hWaveHeaders[index], sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutPrepareHeader");
+ return -2;
+ }
+
+ result = waveOutWrite(consumer->hWaveOut, consumer->hWaveHeaders[index], sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutWrite");
+ return -3;
+ }
+
+ return 0;
}
static int play_wavehdr(tdav_consumer_waveapi_t* consumer, LPWAVEHDR lpHdr)
{
- MMRESULT result;
- tsk_size_t out_size;
-
- if(!consumer || !lpHdr || !consumer->hWaveOut){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- result = waveOutUnprepareHeader(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutUnprepareHeader");
- return -2;
- }
-
- //
- //
- // Fill lpHdr->Data with decoded data
- //
- //
- if((out_size = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(consumer), lpHdr->lpData, lpHdr->dwBufferLength))){
- //memcpy(lpHdr->lpData, data, lpHdr->dwBufferLength);
- //TSK_FREE(data);
- }
- else{
- /* Put silence */
- memset(lpHdr->lpData, 0, lpHdr->dwBufferLength);
- }
-
- if(!consumer->started){
- return 0;
- }
-
- result = waveOutPrepareHeader(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutPrepareHeader");
- return -3;
- }
-
- result = waveOutWrite(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutWrite");
- return -4;
- }
-
- return 0;
+ MMRESULT result;
+ tsk_size_t out_size;
+
+ if(!consumer || !lpHdr || !consumer->hWaveOut) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ result = waveOutUnprepareHeader(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutUnprepareHeader");
+ return -2;
+ }
+
+ //
+ //
+ // Fill lpHdr->Data with decoded data
+ //
+ //
+ if((out_size = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(consumer), lpHdr->lpData, lpHdr->dwBufferLength))) {
+ //memcpy(lpHdr->lpData, data, lpHdr->dwBufferLength);
+ //TSK_FREE(data);
+ }
+ else {
+ /* Put silence */
+ memset(lpHdr->lpData, 0, lpHdr->dwBufferLength);
+ }
+
+ if(!consumer->started) {
+ return 0;
+ }
+
+ result = waveOutPrepareHeader(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutPrepareHeader");
+ return -3;
+ }
+
+ result = waveOutWrite(consumer->hWaveOut, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutWrite");
+ return -4;
+ }
+
+ return 0;
}
static void* TSK_STDCALL __playback_thread(void *param)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)param;
- DWORD dwEvent;
- tsk_size_t i;
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)param;
+ DWORD dwEvent;
+ tsk_size_t i;
+
+ TSK_DEBUG_INFO("__playback_thread -- START");
- TSK_DEBUG_INFO("__playback_thread -- START");
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
+ for(;;) {
+ dwEvent = WaitForMultipleObjects(2, consumer->events, FALSE, INFINITE);
- for(;;){
- dwEvent = WaitForMultipleObjects(2, consumer->events, FALSE, INFINITE);
+ if (dwEvent == 1) {
+ break;
+ }
- if (dwEvent == 1){
- break;
- }
+ else if (dwEvent == 0) {
+ EnterCriticalSection(&consumer->cs);
+ for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR); i++) {
+ if(consumer->hWaveHeaders[i] && (consumer->hWaveHeaders[i]->dwFlags & WHDR_DONE)) {
+ play_wavehdr(consumer, consumer->hWaveHeaders[i]);
+ }
+ }
+ LeaveCriticalSection(&consumer->cs);
+ }
+ }
- else if (dwEvent == 0){
- EnterCriticalSection(&consumer->cs);
- for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR); i++){
- if(consumer->hWaveHeaders[i] && (consumer->hWaveHeaders[i]->dwFlags & WHDR_DONE)){
- play_wavehdr(consumer, consumer->hWaveHeaders[i]);
- }
- }
- LeaveCriticalSection(&consumer->cs);
- }
- }
+ TSK_DEBUG_INFO("__playback_thread -- STOP");
- TSK_DEBUG_INFO("__playback_thread -- STOP");
-
- return tsk_null;
+ return tsk_null;
}
@@ -193,137 +193,137 @@ static void* TSK_STDCALL __playback_thread(void *param)
/* ============ Media Consumer Interface ================= */
int tdav_consumer_waveapi_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
- tsk_size_t i;
-
- if(!consumer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- /* codec should have ptime */
-
-
- /* Format */
- ZeroMemory(&consumer->wfx, sizeof(WAVEFORMATEX));
- consumer->wfx.wFormatTag = WAVE_FORMAT_PCM;
- consumer->wfx.nChannels = TMEDIA_CONSUMER(consumer)->audio.in.channels;
- consumer->wfx.nSamplesPerSec = TMEDIA_CONSUMER(consumer)->audio.out.rate ? TMEDIA_CONSUMER(consumer)->audio.out.rate : TMEDIA_CONSUMER(consumer)->audio.in.rate;
- consumer->wfx.wBitsPerSample = TMEDIA_CONSUMER(consumer)->audio.bits_per_sample;
- consumer->wfx.nBlockAlign = (consumer->wfx.nChannels * consumer->wfx.wBitsPerSample/8);
- consumer->wfx.nAvgBytesPerSec = (consumer->wfx.nSamplesPerSec * consumer->wfx.nBlockAlign);
-
- /* Average bytes (count) for each notification */
- consumer->bytes_per_notif = ((consumer->wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(consumer)->audio.ptime)/1000);
-
- /* create buffers */
- for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(consumer->hWaveHeaders[0]); i++){
- create_wavehdr(consumer, i);
- }
-
- return 0;
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
+ tsk_size_t i;
+
+ if(!consumer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_CONSUMER(consumer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ TMEDIA_CONSUMER(consumer)->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ /* codec should have ptime */
+
+
+ /* Format */
+ ZeroMemory(&consumer->wfx, sizeof(WAVEFORMATEX));
+ consumer->wfx.wFormatTag = WAVE_FORMAT_PCM;
+ consumer->wfx.nChannels = TMEDIA_CONSUMER(consumer)->audio.in.channels;
+ consumer->wfx.nSamplesPerSec = TMEDIA_CONSUMER(consumer)->audio.out.rate ? TMEDIA_CONSUMER(consumer)->audio.out.rate : TMEDIA_CONSUMER(consumer)->audio.in.rate;
+ consumer->wfx.wBitsPerSample = TMEDIA_CONSUMER(consumer)->audio.bits_per_sample;
+ consumer->wfx.nBlockAlign = (consumer->wfx.nChannels * consumer->wfx.wBitsPerSample/8);
+ consumer->wfx.nAvgBytesPerSec = (consumer->wfx.nSamplesPerSec * consumer->wfx.nBlockAlign);
+
+ /* Average bytes (count) for each notification */
+ consumer->bytes_per_notif = ((consumer->wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(consumer)->audio.ptime)/1000);
+
+ /* create buffers */
+ for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(consumer->hWaveHeaders[0]); i++) {
+ create_wavehdr(consumer, i);
+ }
+
+ return 0;
}
int tdav_consumer_waveapi_start(tmedia_consumer_t* self)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
- MMRESULT result;
- tsk_size_t i;
-
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(consumer->started || consumer->hWaveOut){
- TSK_DEBUG_WARN("Consumer already started");
- return 0;
- }
-
- /* create events */
- if(!consumer->events[0]){
- consumer->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
- }
- if(!consumer->events[1]){
- consumer->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL);
- }
-
- /* open */
- result = waveOutOpen((HWAVEOUT *)&consumer->hWaveOut, WAVE_MAPPER, &consumer->wfx, (DWORD)consumer->events[0], (DWORD_PTR)consumer, CALLBACK_EVENT);
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveOutOpen");
- return -2;
- }
-
- /* write */
- for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(consumer->hWaveHeaders[0]); i++){
- write_wavehdr(consumer, i);
- }
-
- /* start thread */
- consumer->started = tsk_true;
- tsk_thread_create(&consumer->tid[0], __playback_thread, consumer);
-
- return 0;
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
+ MMRESULT result;
+ tsk_size_t i;
+
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(consumer->started || consumer->hWaveOut) {
+ TSK_DEBUG_WARN("Consumer already started");
+ return 0;
+ }
+
+ /* create events */
+ if(!consumer->events[0]) {
+ consumer->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ }
+ if(!consumer->events[1]) {
+ consumer->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ }
+
+ /* open */
+ result = waveOutOpen((HWAVEOUT *)&consumer->hWaveOut, WAVE_MAPPER, &consumer->wfx, (DWORD)consumer->events[0], (DWORD_PTR)consumer, CALLBACK_EVENT);
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveOutOpen");
+ return -2;
+ }
+
+ /* write */
+ for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(consumer->hWaveHeaders[0]); i++) {
+ write_wavehdr(consumer, i);
+ }
+
+ /* start thread */
+ consumer->started = tsk_true;
+ tsk_thread_create(&consumer->tid[0], __playback_thread, consumer);
+
+ return 0;
}
int tdav_consumer_waveapi_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
-
- if(!consumer || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* buffer is already decoded */
- return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
+
+ if(!consumer || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* buffer is already decoded */
+ return tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(consumer), buffer, size, proto_hdr);
}
int tdav_consumer_waveapi_pause(tmedia_consumer_t* self)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_waveapi_stop(tmedia_consumer_t* self)
{
- tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
- MMRESULT result;
+ tdav_consumer_waveapi_t* consumer = (tdav_consumer_waveapi_t*)self;
+ MMRESULT result;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!consumer->started){
- TSK_DEBUG_WARN("Consumer not started");
- return 0;
- }
+ if(!consumer->started) {
+ TSK_DEBUG_WARN("Consumer not started");
+ return 0;
+ }
- /* stop thread */
- if(consumer->tid[0]){
- SetEvent(consumer->events[1]);
- tsk_thread_join(&(consumer->tid[0]));
- }
+ /* stop thread */
+ if(consumer->tid[0]) {
+ SetEvent(consumer->events[1]);
+ tsk_thread_join(&(consumer->tid[0]));
+ }
- /* should be done here */
- consumer->started = tsk_false;
+ /* should be done here */
+ consumer->started = tsk_false;
- if(consumer->hWaveOut && ((result = waveOutReset(consumer->hWaveOut)) != MMSYSERR_NOERROR)){
- print_last_error(result, "waveOutReset");
- }
+ if(consumer->hWaveOut && ((result = waveOutReset(consumer->hWaveOut)) != MMSYSERR_NOERROR)) {
+ print_last_error(result, "waveOutReset");
+ }
- return 0;
+ return 0;
}
@@ -333,69 +333,67 @@ int tdav_consumer_waveapi_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_waveapi_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_waveapi_t *consumer = self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- /* init self */
- InitializeCriticalSection(&consumer->cs);
- }
- return self;
+ tdav_consumer_waveapi_t *consumer = self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ /* init self */
+ InitializeCriticalSection(&consumer->cs);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_waveapi_dtor(tsk_object_t * self)
-{
- tdav_consumer_waveapi_t *consumer = self;
- if(consumer){
- tsk_size_t i;
-
- /* stop */
- if(consumer->started){
- tdav_consumer_waveapi_stop(self);
- }
-
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
- /* deinit self */
- for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR); i++){
- free_wavehdr(consumer, i);
- }
- if(consumer->hWaveOut){
- waveOutClose(consumer->hWaveOut);
- }
- if(consumer->events[0]){
- CloseHandle(consumer->events[0]);
- }
- if(consumer->events[1]){
- CloseHandle(consumer->events[1]);
- }
- DeleteCriticalSection(&consumer->cs);
- }
-
- return self;
+{
+ tdav_consumer_waveapi_t *consumer = self;
+ if(consumer) {
+ tsk_size_t i;
+
+ /* stop */
+ if(consumer->started) {
+ tdav_consumer_waveapi_stop(self);
+ }
+
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
+ /* deinit self */
+ for(i = 0; i< sizeof(consumer->hWaveHeaders)/sizeof(LPWAVEHDR); i++) {
+ free_wavehdr(consumer, i);
+ }
+ if(consumer->hWaveOut) {
+ waveOutClose(consumer->hWaveOut);
+ }
+ if(consumer->events[0]) {
+ CloseHandle(consumer->events[0]);
+ }
+ if(consumer->events[1]) {
+ CloseHandle(consumer->events[1]);
+ }
+ DeleteCriticalSection(&consumer->cs);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_waveapi_def_s =
-{
- sizeof(tdav_consumer_waveapi_t),
- tdav_consumer_waveapi_ctor,
- tdav_consumer_waveapi_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t tdav_consumer_waveapi_def_s = {
+ sizeof(tdav_consumer_waveapi_t),
+ tdav_consumer_waveapi_ctor,
+ tdav_consumer_waveapi_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_waveapi_plugin_def_s =
-{
- &tdav_consumer_waveapi_def_s,
-
- tmedia_audio,
- "Microsoft WaveAPI consumer",
-
- tdav_consumer_waveapi_set,
- tdav_consumer_waveapi_prepare,
- tdav_consumer_waveapi_start,
- tdav_consumer_waveapi_consume,
- tdav_consumer_waveapi_pause,
- tdav_consumer_waveapi_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_waveapi_plugin_def_s = {
+ &tdav_consumer_waveapi_def_s,
+
+ tmedia_audio,
+ "Microsoft WaveAPI consumer",
+
+ tdav_consumer_waveapi_set,
+ tdav_consumer_waveapi_prepare,
+ tdav_consumer_waveapi_start,
+ tdav_consumer_waveapi_consume,
+ tdav_consumer_waveapi_pause,
+ tdav_consumer_waveapi_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_waveapi_plugin_def_t = &tdav_consumer_waveapi_plugin_def_s;
diff --git a/tinyDAV/src/audio/waveapi/tdav_producer_waveapi.c b/tinyDAV/src/audio/waveapi/tdav_producer_waveapi.c
index d077790..375668c 100755
--- a/tinyDAV/src/audio/waveapi/tdav_producer_waveapi.c
+++ b/tinyDAV/src/audio/waveapi/tdav_producer_waveapi.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,150 +35,152 @@
static void print_last_error(MMRESULT mmrError, const char* func)
{
- static char buffer_err[TDAV_WAVEAPI_PRODUCER_ERROR_BUFF_COUNT];
+ static char buffer_err[TDAV_WAVEAPI_PRODUCER_ERROR_BUFF_COUNT];
- waveInGetErrorTextA(mmrError, buffer_err, sizeof(buffer_err));
- TSK_DEBUG_ERROR("%s() error: %s", func, buffer_err);
+ waveInGetErrorTextA(mmrError, buffer_err, sizeof(buffer_err));
+ TSK_DEBUG_ERROR("%s() error: %s", func, buffer_err);
}
static int free_wavehdr(tdav_producer_waveapi_t* producer, tsk_size_t index)
{
- if(!producer || index >= sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer || index >= sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_FREE(producer->hWaveHeaders[index]->lpData);
- TSK_FREE(producer->hWaveHeaders[index]);
+ TSK_FREE(producer->hWaveHeaders[index]->lpData);
+ TSK_FREE(producer->hWaveHeaders[index]);
- return 0;
+ return 0;
}
static int create_wavehdr(tdav_producer_waveapi_t* producer, tsk_size_t index)
{
- if(!producer || index >= sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(producer->hWaveHeaders[index]){
- free_wavehdr(producer, index);
- }
-
- producer->hWaveHeaders[index] = tsk_calloc(1, sizeof(WAVEHDR));
- producer->hWaveHeaders[index]->lpData = tsk_calloc(1, producer->bytes_per_notif);
- producer->hWaveHeaders[index]->dwBufferLength = (DWORD)producer->bytes_per_notif;
- producer->hWaveHeaders[index]->dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;
- producer->hWaveHeaders[index]->dwLoops = 0x01;
- producer->hWaveHeaders[index]->dwUser = index;
-
- return 0;
+ if(!producer || index >= sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(producer->hWaveHeaders[index]) {
+ free_wavehdr(producer, index);
+ }
+
+ producer->hWaveHeaders[index] = tsk_calloc(1, sizeof(WAVEHDR));
+ producer->hWaveHeaders[index]->lpData = tsk_calloc(1, producer->bytes_per_notif);
+ producer->hWaveHeaders[index]->dwBufferLength = (DWORD)producer->bytes_per_notif;
+ producer->hWaveHeaders[index]->dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;
+ producer->hWaveHeaders[index]->dwLoops = 0x01;
+ producer->hWaveHeaders[index]->dwUser = index;
+
+ return 0;
}
static int add_wavehdr(tdav_producer_waveapi_t* producer, tsk_size_t index)
{
- MMRESULT result;
-
- if(!producer || !producer->hWaveHeaders[index] || !producer->hWaveIn){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- result = waveInPrepareHeader(producer->hWaveIn, producer->hWaveHeaders[index], sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInPrepareHeader");
- return -2;
- }
-
- result = waveInAddBuffer(producer->hWaveIn, producer->hWaveHeaders[index], sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInAddBuffer");
- return -3;
- }
-
- return 0;
+ MMRESULT result;
+
+ if(!producer || !producer->hWaveHeaders[index] || !producer->hWaveIn) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ result = waveInPrepareHeader(producer->hWaveIn, producer->hWaveHeaders[index], sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInPrepareHeader");
+ return -2;
+ }
+
+ result = waveInAddBuffer(producer->hWaveIn, producer->hWaveHeaders[index], sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInAddBuffer");
+ return -3;
+ }
+
+ return 0;
}
static int record_wavehdr(tdav_producer_waveapi_t* producer, LPWAVEHDR lpHdr)
{
- MMRESULT result;
+ MMRESULT result;
- if(!producer || !lpHdr || !producer->hWaveIn){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer || !lpHdr || !producer->hWaveIn) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- //
- // Alert the session that there is new data to send over the network
- //
- if(TMEDIA_PRODUCER(producer)->enc_cb.callback){
+ //
+ // Alert the session that there is new data to send over the network
+ //
+ if(TMEDIA_PRODUCER(producer)->enc_cb.callback) {
#if 0
- {
- static FILE* f = NULL;
- if(!f) f = fopen("./waveapi_producer.raw", "w+");
- fwrite(lpHdr->lpData, 1, lpHdr->dwBytesRecorded, f);
- }
+ {
+ static FILE* f = NULL;
+ if(!f) {
+ f = fopen("./waveapi_producer.raw", "w+");
+ }
+ fwrite(lpHdr->lpData, 1, lpHdr->dwBytesRecorded, f);
+ }
#endif
- TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, lpHdr->lpData, lpHdr->dwBytesRecorded);
- }
-
- if(!producer->started){
- return 0;
- }
-
- result = waveInUnprepareHeader(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInUnprepareHeader");
- return -2;
- }
-
- result = waveInPrepareHeader(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInPrepareHeader");
- return -3;
- }
-
- result = waveInAddBuffer(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInAddBuffer");
- return -4;
- }
-
- return 0;
+ TMEDIA_PRODUCER(producer)->enc_cb.callback(TMEDIA_PRODUCER(producer)->enc_cb.callback_data, lpHdr->lpData, lpHdr->dwBytesRecorded);
+ }
+
+ if(!producer->started) {
+ return 0;
+ }
+
+ result = waveInUnprepareHeader(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInUnprepareHeader");
+ return -2;
+ }
+
+ result = waveInPrepareHeader(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInPrepareHeader");
+ return -3;
+ }
+
+ result = waveInAddBuffer(producer->hWaveIn, lpHdr, sizeof(WAVEHDR));
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInAddBuffer");
+ return -4;
+ }
+
+ return 0;
}
static void* TSK_STDCALL __record_thread(void *param)
{
- tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)param;
- DWORD dwEvent;
- tsk_size_t i;
+ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)param;
+ DWORD dwEvent;
+ tsk_size_t i;
- TSK_DEBUG_INFO("__record_thread -- START");
+ TSK_DEBUG_INFO("__record_thread -- START");
- // SetPriorityClass(GetCurrentThread(), REALTIME_PRIORITY_CLASS);
+ // SetPriorityClass(GetCurrentThread(), REALTIME_PRIORITY_CLASS);
- for(;;){
- dwEvent = WaitForMultipleObjects(2, producer->events, FALSE, INFINITE);
+ for(;;) {
+ dwEvent = WaitForMultipleObjects(2, producer->events, FALSE, INFINITE);
- if (dwEvent == 1){
- break;
- }
+ if (dwEvent == 1) {
+ break;
+ }
- else if (dwEvent == 0){
- EnterCriticalSection(&producer->cs);
- for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(producer->hWaveHeaders[0]); i++){
- if(producer->hWaveHeaders[i] && (producer->hWaveHeaders[i]->dwFlags & WHDR_DONE)){
- record_wavehdr(producer, producer->hWaveHeaders[i]);
- }
- }
- LeaveCriticalSection(&producer->cs);
- }
- }
+ else if (dwEvent == 0) {
+ EnterCriticalSection(&producer->cs);
+ for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(producer->hWaveHeaders[0]); i++) {
+ if(producer->hWaveHeaders[i] && (producer->hWaveHeaders[i]->dwFlags & WHDR_DONE)) {
+ record_wavehdr(producer, producer->hWaveHeaders[i]);
+ }
+ }
+ LeaveCriticalSection(&producer->cs);
+ }
+ }
- TSK_DEBUG_INFO("__record_thread() -- STOP");
-
+ TSK_DEBUG_INFO("__record_thread() -- STOP");
- return tsk_null;
+
+ return tsk_null;
}
@@ -191,131 +193,131 @@ static void* TSK_STDCALL __record_thread(void *param)
/* ============ Media Producer Interface ================= */
int tdav_producer_waveapi_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
- tsk_size_t i;
-
- if(!producer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- /* codec should have ptime */
-
-
- /* Format */
- ZeroMemory(&producer->wfx, sizeof(WAVEFORMATEX));
- producer->wfx.wFormatTag = WAVE_FORMAT_PCM;
- producer->wfx.nChannels = TMEDIA_PRODUCER(producer)->audio.channels;
- producer->wfx.nSamplesPerSec = TMEDIA_PRODUCER(producer)->audio.rate;
- producer->wfx.wBitsPerSample = TMEDIA_PRODUCER(producer)->audio.bits_per_sample;
- producer->wfx.nBlockAlign = (producer->wfx.nChannels * producer->wfx.wBitsPerSample/8);
- producer->wfx.nAvgBytesPerSec = (producer->wfx.nSamplesPerSec * producer->wfx.nBlockAlign);
-
- /* Average bytes (count) for each notification */
- producer->bytes_per_notif = ((producer->wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(producer)->audio.ptime)/1000);
-
- /* create buffers */
- for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(producer->hWaveHeaders[0]); i++){
- create_wavehdr(producer, i);
- }
-
- return 0;
+ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
+ tsk_size_t i;
+
+ if(!producer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_PRODUCER(producer)->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ TMEDIA_PRODUCER(producer)->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ /* codec should have ptime */
+
+
+ /* Format */
+ ZeroMemory(&producer->wfx, sizeof(WAVEFORMATEX));
+ producer->wfx.wFormatTag = WAVE_FORMAT_PCM;
+ producer->wfx.nChannels = TMEDIA_PRODUCER(producer)->audio.channels;
+ producer->wfx.nSamplesPerSec = TMEDIA_PRODUCER(producer)->audio.rate;
+ producer->wfx.wBitsPerSample = TMEDIA_PRODUCER(producer)->audio.bits_per_sample;
+ producer->wfx.nBlockAlign = (producer->wfx.nChannels * producer->wfx.wBitsPerSample/8);
+ producer->wfx.nAvgBytesPerSec = (producer->wfx.nSamplesPerSec * producer->wfx.nBlockAlign);
+
+ /* Average bytes (count) for each notification */
+ producer->bytes_per_notif = ((producer->wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(producer)->audio.ptime)/1000);
+
+ /* create buffers */
+ for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(producer->hWaveHeaders[0]); i++) {
+ create_wavehdr(producer, i);
+ }
+
+ return 0;
}
int tdav_producer_waveapi_start(tmedia_producer_t* self)
{
- tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
- MMRESULT result;
- tsk_size_t i;
-
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(producer->started || producer->hWaveIn){
- TSK_DEBUG_WARN("Producer already started");
- return 0;
- }
-
- /* create events */
- if(!producer->events[0]){
- producer->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
- }
- if(!producer->events[1]){
- producer->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL);
- }
-
- /* open */
- result = waveInOpen((HWAVEIN *)&producer->hWaveIn, /*WAVE_MAPPER*/0, &producer->wfx, (DWORD)producer->events[0], (DWORD_PTR)producer, CALLBACK_EVENT);
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInOpen");
- return -2;
- }
-
- /* start */
- result = waveInStart(producer->hWaveIn);
- if(result != MMSYSERR_NOERROR){
- print_last_error(result, "waveInStart");
- return -2;
- }
-
- /* write */
- for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR); i++){
- add_wavehdr(producer, i);
- }
-
- /* start thread */
- producer->started = tsk_true;
- tsk_thread_create(&producer->tid[0], __record_thread, producer);
-
- return 0;
+ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
+ MMRESULT result;
+ tsk_size_t i;
+
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(producer->started || producer->hWaveIn) {
+ TSK_DEBUG_WARN("Producer already started");
+ return 0;
+ }
+
+ /* create events */
+ if(!producer->events[0]) {
+ producer->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ }
+ if(!producer->events[1]) {
+ producer->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ }
+
+ /* open */
+ result = waveInOpen((HWAVEIN *)&producer->hWaveIn, /*WAVE_MAPPER*/0, &producer->wfx, (DWORD)producer->events[0], (DWORD_PTR)producer, CALLBACK_EVENT);
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInOpen");
+ return -2;
+ }
+
+ /* start */
+ result = waveInStart(producer->hWaveIn);
+ if(result != MMSYSERR_NOERROR) {
+ print_last_error(result, "waveInStart");
+ return -2;
+ }
+
+ /* write */
+ for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR); i++) {
+ add_wavehdr(producer, i);
+ }
+
+ /* start thread */
+ producer->started = tsk_true;
+ tsk_thread_create(&producer->tid[0], __record_thread, producer);
+
+ return 0;
}
int tdav_producer_waveapi_pause(tmedia_producer_t* self)
{
- tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
+ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_producer_waveapi_stop(tmedia_producer_t* self)
{
- tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
- MMRESULT result;
+ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self;
+ MMRESULT result;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!producer->started){
- TSK_DEBUG_WARN("Producer not started");
- return 0;
- }
+ if(!producer->started) {
+ TSK_DEBUG_WARN("Producer not started");
+ return 0;
+ }
- /* stop thread */
- if(producer->tid[0]){
- SetEvent(producer->events[1]);
- tsk_thread_join(&(producer->tid[0]));
- }
+ /* stop thread */
+ if(producer->tid[0]) {
+ SetEvent(producer->events[1]);
+ tsk_thread_join(&(producer->tid[0]));
+ }
- /* should be done here */
- producer->started = tsk_false;
+ /* should be done here */
+ producer->started = tsk_false;
- if(producer->hWaveIn && (((result = waveInReset(producer->hWaveIn)) != MMSYSERR_NOERROR) || ((result = waveInClose(producer->hWaveIn)) != MMSYSERR_NOERROR))){
- print_last_error(result, "waveInReset/waveInClose");
- }
+ if(producer->hWaveIn && (((result = waveInReset(producer->hWaveIn)) != MMSYSERR_NOERROR) || ((result = waveInClose(producer->hWaveIn)) != MMSYSERR_NOERROR))) {
+ print_last_error(result, "waveInReset/waveInClose");
+ }
- return 0;
+ return 0;
}
@@ -325,68 +327,66 @@ int tdav_producer_waveapi_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_waveapi_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_waveapi_t *producer = self;
- if(producer){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
- InitializeCriticalSection(&producer->cs);
- }
- return self;
+ tdav_producer_waveapi_t *producer = self;
+ if(producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+ InitializeCriticalSection(&producer->cs);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_waveapi_dtor(tsk_object_t * self)
-{
- tdav_producer_waveapi_t *producer = self;
- if(producer){
- tsk_size_t i;
-
- /* stop */
- if(producer->started){
- tdav_producer_waveapi_stop(self);
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
- /* deinit self */
- for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR); i++){
- free_wavehdr(producer, i);
- }
- if(producer->hWaveIn){
- waveInClose(producer->hWaveIn);
- }
- if(producer->events[0]){
- CloseHandle(producer->events[0]);
- }
- if(producer->events[1]){
- CloseHandle(producer->events[1]);
- }
- DeleteCriticalSection(&producer->cs);
- }
-
- return self;
+{
+ tdav_producer_waveapi_t *producer = self;
+ if(producer) {
+ tsk_size_t i;
+
+ /* stop */
+ if(producer->started) {
+ tdav_producer_waveapi_stop(self);
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
+ /* deinit self */
+ for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR); i++) {
+ free_wavehdr(producer, i);
+ }
+ if(producer->hWaveIn) {
+ waveInClose(producer->hWaveIn);
+ }
+ if(producer->events[0]) {
+ CloseHandle(producer->events[0]);
+ }
+ if(producer->events[1]) {
+ CloseHandle(producer->events[1]);
+ }
+ DeleteCriticalSection(&producer->cs);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_waveapi_def_s =
-{
- sizeof(tdav_producer_waveapi_t),
- tdav_producer_waveapi_ctor,
- tdav_producer_waveapi_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t tdav_producer_waveapi_def_s = {
+ sizeof(tdav_producer_waveapi_t),
+ tdav_producer_waveapi_ctor,
+ tdav_producer_waveapi_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_waveapi_plugin_def_s =
-{
- &tdav_producer_waveapi_def_s,
-
- tmedia_audio,
- "Microsoft WaveAPI producer",
-
- tdav_producer_waveapi_set,
- tdav_producer_waveapi_prepare,
- tdav_producer_waveapi_start,
- tdav_producer_waveapi_pause,
- tdav_producer_waveapi_stop
+static const tmedia_producer_plugin_def_t tdav_producer_waveapi_plugin_def_s = {
+ &tdav_producer_waveapi_def_s,
+
+ tmedia_audio,
+ "Microsoft WaveAPI producer",
+
+ tdav_producer_waveapi_set,
+ tdav_producer_waveapi_prepare,
+ tdav_producer_waveapi_start,
+ tdav_producer_waveapi_pause,
+ tdav_producer_waveapi_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_waveapi_plugin_def_t = &tdav_producer_waveapi_plugin_def_s;
diff --git a/tinyDAV/src/bfcp/tdav_session_bfcp.c b/tinyDAV/src/bfcp/tdav_session_bfcp.c
index 07e770b..c69babc 100755
--- a/tinyDAV/src/bfcp/tdav_session_bfcp.c
+++ b/tinyDAV/src/bfcp/tdav_session_bfcp.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,37 +40,36 @@
* https://tools.ietf.org/html/draft-ietf-bfcpbis-rfc4582bis-1
*/
-typedef struct tdav_session_bfcp_s
-{
- TMEDIA_DECLARE_SESSION_BFCP;
-
- struct tbfcp_session_s* p_bfcp_s;
- struct tbfcp_pkt_s* p_pkt_FloorRequest;
- struct tbfcp_pkt_s* p_pkt_FloorRelease;
- struct tbfcp_pkt_s* p_pkt_Hello;
-
- tsk_bool_t b_started;
- tsk_bool_t b_use_ipv6;
- tsk_bool_t b_revoked_handled;
- tsk_bool_t b_conf_idf_changed;
- tsk_bool_t b_stop_to_reconf;
-
- char* p_local_ip;
- //uint16_t local_port;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* p_natt_ctx;
-
- char* p_remote_ip;
- uint16_t u_remote_port;
-
- // https://tools.ietf.org/html/rfc4583 attributes
- struct {
- char* confid;
- char* floorid;
- char* mstrm;
- char* userid;
- } rfc4583;
+typedef struct tdav_session_bfcp_s {
+ TMEDIA_DECLARE_SESSION_BFCP;
+
+ struct tbfcp_session_s* p_bfcp_s;
+ struct tbfcp_pkt_s* p_pkt_FloorRequest;
+ struct tbfcp_pkt_s* p_pkt_FloorRelease;
+ struct tbfcp_pkt_s* p_pkt_Hello;
+
+ tsk_bool_t b_started;
+ tsk_bool_t b_use_ipv6;
+ tsk_bool_t b_revoked_handled;
+ tsk_bool_t b_conf_idf_changed;
+ tsk_bool_t b_stop_to_reconf;
+
+ char* p_local_ip;
+ //uint16_t local_port;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* p_natt_ctx;
+
+ char* p_remote_ip;
+ uint16_t u_remote_port;
+
+ // https://tools.ietf.org/html/rfc4583 attributes
+ struct {
+ char* confid;
+ char* floorid;
+ char* mstrm;
+ char* userid;
+ } rfc4583;
}
tdav_session_bfcp_t;
@@ -81,402 +80,402 @@ static int _tdav_session_bfcp_send_Hello(tdav_session_bfcp_t* p_bfcp);
static int _tdav_session_bfcp_set(tmedia_session_t* p_self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
-
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TSK_DEBUG_INFO("tdav_session_bfcp_set");
-
- p_bfcp = (tdav_session_bfcp_t*)p_self;
-
- if (param->value_type == tmedia_pvt_pchar) {
- if (tsk_striequals(param->key, "remote-ip")) {
- // only if no ip associated to the "m=" line
- if (param->value && !p_bfcp->p_remote_ip) {
- p_bfcp->p_remote_ip = tsk_strdup(param->value);
- }
- }
- else if (tsk_striequals(param->key, "local-ip")) {
- tsk_strupdate(&p_bfcp->p_local_ip, param->value);
- }
- else if (tsk_striequals(param->key, "local-ipver")) {
- p_bfcp->b_use_ipv6 = tsk_striequals(param->value, "ipv6");
- }
- }
- else if (param->value_type == tmedia_pvt_pobject) {
- if (tsk_striequals(param->key, "natt-ctx")) {
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_natt_ctx);
- p_bfcp->p_natt_ctx = tsk_object_ref(param->value);
- }
- }
- else if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "stop-to-reconf")) {
- p_bfcp->b_stop_to_reconf = TSK_TO_INT32((uint8_t*)param->value) ? tsk_true : tsk_false;
- }
- }
-
-
- return ret;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
+
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("tdav_session_bfcp_set");
+
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
+
+ if (param->value_type == tmedia_pvt_pchar) {
+ if (tsk_striequals(param->key, "remote-ip")) {
+ // only if no ip associated to the "m=" line
+ if (param->value && !p_bfcp->p_remote_ip) {
+ p_bfcp->p_remote_ip = tsk_strdup(param->value);
+ }
+ }
+ else if (tsk_striequals(param->key, "local-ip")) {
+ tsk_strupdate(&p_bfcp->p_local_ip, param->value);
+ }
+ else if (tsk_striequals(param->key, "local-ipver")) {
+ p_bfcp->b_use_ipv6 = tsk_striequals(param->value, "ipv6");
+ }
+ }
+ else if (param->value_type == tmedia_pvt_pobject) {
+ if (tsk_striequals(param->key, "natt-ctx")) {
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_natt_ctx);
+ p_bfcp->p_natt_ctx = tsk_object_ref(param->value);
+ }
+ }
+ else if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "stop-to-reconf")) {
+ p_bfcp->b_stop_to_reconf = TSK_TO_INT32((uint8_t*)param->value) ? tsk_true : tsk_false;
+ }
+ }
+
+
+ return ret;
}
static int _tdav_session_bfcp_get(tmedia_session_t* p_self, tmedia_param_t* param)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_DEBUG_INFO("_tdav_session_bfcp_get");
+ TSK_DEBUG_INFO("_tdav_session_bfcp_get");
- p_bfcp = (tdav_session_bfcp_t*)p_self;
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
- return ret;
+ return ret;
}
static int _tdav_session_bfcp_prepare(tmedia_session_t* p_self)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
-
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TSK_DEBUG_INFO("_tdav_session_bfcp_prepare");
-
- p_bfcp = (tdav_session_bfcp_t*)p_self;
-
- if (!p_bfcp->p_bfcp_s) {
- enum tnet_socket_type_e e_socket_type = kBfcpTransportDefault;
- if ((ret = tbfcp_session_create(e_socket_type, p_bfcp->p_local_ip, &p_bfcp->p_bfcp_s))) {
- return ret;
- }
- }
- if ((ret = tbfcp_session_set_natt_ctx(p_bfcp->p_bfcp_s, p_bfcp->p_natt_ctx))) {
- return ret;
- }
- if ((ret = tbfcp_session_prepare(p_bfcp->p_bfcp_s))) {
- return ret;
- }
- if ((ret = tbfcp_session_set_callback(p_bfcp->p_bfcp_s, _tdav_session_bfcp_notif, p_bfcp))) {
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_Hello);
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest);
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRelease);
- p_bfcp->b_revoked_handled = tsk_false;
-
- return ret;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
+
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("_tdav_session_bfcp_prepare");
+
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
+
+ if (!p_bfcp->p_bfcp_s) {
+ enum tnet_socket_type_e e_socket_type = kBfcpTransportDefault;
+ if ((ret = tbfcp_session_create(e_socket_type, p_bfcp->p_local_ip, &p_bfcp->p_bfcp_s))) {
+ return ret;
+ }
+ }
+ if ((ret = tbfcp_session_set_natt_ctx(p_bfcp->p_bfcp_s, p_bfcp->p_natt_ctx))) {
+ return ret;
+ }
+ if ((ret = tbfcp_session_prepare(p_bfcp->p_bfcp_s))) {
+ return ret;
+ }
+ if ((ret = tbfcp_session_set_callback(p_bfcp->p_bfcp_s, _tdav_session_bfcp_notif, p_bfcp))) {
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_Hello);
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest);
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRelease);
+ p_bfcp->b_revoked_handled = tsk_false;
+
+ return ret;
}
static int _tdav_session_bfcp_start(tmedia_session_t* p_self)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_DEBUG_INFO("_tdav_session_bfcp_start");
+ TSK_DEBUG_INFO("_tdav_session_bfcp_start");
- p_bfcp = (tdav_session_bfcp_t*)p_self;
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
- if ((ret = tbfcp_session_set_remote_address(p_bfcp->p_bfcp_s, p_bfcp->p_remote_ip, p_bfcp->u_remote_port))) {
- return ret;
- }
- if ((ret = tbfcp_session_start(p_bfcp->p_bfcp_s))) {
- return ret;
- }
- if ((ret = _tdav_session_bfcp_send_Hello(p_bfcp))) {
- return ret;
- }
+ if ((ret = tbfcp_session_set_remote_address(p_bfcp->p_bfcp_s, p_bfcp->p_remote_ip, p_bfcp->u_remote_port))) {
+ return ret;
+ }
+ if ((ret = tbfcp_session_start(p_bfcp->p_bfcp_s))) {
+ return ret;
+ }
+ if ((ret = _tdav_session_bfcp_send_Hello(p_bfcp))) {
+ return ret;
+ }
- p_bfcp->b_started = tsk_true;
+ p_bfcp->b_started = tsk_true;
- return ret;
+ return ret;
}
static int _tdav_session_bfcp_pause(tmedia_session_t* p_self)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_DEBUG_INFO("_tdav_session_bfcp_pause");
+ TSK_DEBUG_INFO("_tdav_session_bfcp_pause");
- p_bfcp = (tdav_session_bfcp_t*)p_self;
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
- if (p_bfcp->p_bfcp_s && (ret = tbfcp_session_pause(p_bfcp->p_bfcp_s))) {
- return ret;
- }
+ if (p_bfcp->p_bfcp_s && (ret = tbfcp_session_pause(p_bfcp->p_bfcp_s))) {
+ return ret;
+ }
- return ret;
+ return ret;
}
static int _tdav_session_bfcp_stop(tmedia_session_t* p_self)
{
- int ret = 0;
- tdav_session_bfcp_t* p_bfcp;
-
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TSK_DEBUG_INFO("_tdav_session_bfcp_stop");
-
- p_bfcp = (tdav_session_bfcp_t*)p_self;
-
- if (!p_bfcp->b_stop_to_reconf) { // If stop-to-reconf then do not release the FloorRequest but reuse it
- if (p_bfcp->b_started) {
- /*if (p_bfcp->p_bfcp_s)*/ {
- /*if (!p_bfcp->p_pkt_FloorRelease) {
- ret = tbfcp_session_create_pkt_FloorRelease(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRelease);
- }
- if (ret == 0 && p_bfcp->p_pkt_FloorRelease && (ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRelease))) {
- //!\ do not exit
- }*/
- }
- }
- tsk_strupdate(&p_bfcp->rfc4583.confid, "");
- }
-
- if (p_bfcp->p_bfcp_s) {
- ret = tbfcp_session_stop(p_bfcp->p_bfcp_s);
- }
-
- p_bfcp->b_started = tsk_false;
- p_bfcp->b_stop_to_reconf = tsk_false; // reset
-
- return ret;
+ int ret = 0;
+ tdav_session_bfcp_t* p_bfcp;
+
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("_tdav_session_bfcp_stop");
+
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
+
+ if (!p_bfcp->b_stop_to_reconf) { // If stop-to-reconf then do not release the FloorRequest but reuse it
+ if (p_bfcp->b_started) {
+ /*if (p_bfcp->p_bfcp_s)*/ {
+ /*if (!p_bfcp->p_pkt_FloorRelease) {
+ ret = tbfcp_session_create_pkt_FloorRelease(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRelease);
+ }
+ if (ret == 0 && p_bfcp->p_pkt_FloorRelease && (ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRelease))) {
+ //!\ do not exit
+ }*/
+ }
+ }
+ tsk_strupdate(&p_bfcp->rfc4583.confid, "");
+ }
+
+ if (p_bfcp->p_bfcp_s) {
+ ret = tbfcp_session_stop(p_bfcp->p_bfcp_s);
+ }
+
+ p_bfcp->b_started = tsk_false;
+ p_bfcp->b_stop_to_reconf = tsk_false; // reset
+
+ return ret;
}
static const tsdp_header_M_t* _tdav_session_bfcp_get_lo(tmedia_session_t* p_self)
{
- tdav_session_bfcp_t* p_bfcp;
- tsk_bool_t b_changed = tsk_false;
- const char *pc_local_ip, *pc_local_profile, *pc_local_role, *pc_local_setup;
- tnet_port_t u_local_port;
- enum tbfcp_role_e e_local_role;
- enum tbfcp_setup_e e_local_setup;
- int ret;
-
- TSK_DEBUG_INFO("_tdav_session_bfcp_get_lo");
-
- if (!p_self || !p_self->plugin) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- p_bfcp = (tdav_session_bfcp_t*)p_self;
-
- b_changed = (p_self->ro_changed || !p_self->M.lo);
-
- if (!b_changed) {
- TSK_DEBUG_INFO("No changes to the BFCP session...skip SDP update");
- return p_self->M.lo;
- }
-
- if (b_changed && p_self->M.lo) {
- static const char* __fields[] = { "floorctrl", "setup", "connection", "curr", "des", "conf" };
- // remove media-level attributes
- tsdp_header_A_removeAll_by_fields(p_self->M.lo->Attributes, __fields, sizeof(__fields)/sizeof(__fields[0]));
- // Codec list never change and FMTs always a single star (*) value. Radvision TelePresence System reject a BFCP session whithout the single FMT (*)
- // The Codecs and formats are never rebuilt which means we must not clear them
+ tdav_session_bfcp_t* p_bfcp;
+ tsk_bool_t b_changed = tsk_false;
+ const char *pc_local_ip, *pc_local_profile, *pc_local_role, *pc_local_setup;
+ tnet_port_t u_local_port;
+ enum tbfcp_role_e e_local_role;
+ enum tbfcp_setup_e e_local_setup;
+ int ret;
+
+ TSK_DEBUG_INFO("_tdav_session_bfcp_get_lo");
+
+ if (!p_self || !p_self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
+
+ b_changed = (p_self->ro_changed || !p_self->M.lo);
+
+ if (!b_changed) {
+ TSK_DEBUG_INFO("No changes to the BFCP session...skip SDP update");
+ return p_self->M.lo;
+ }
+
+ if (b_changed && p_self->M.lo) {
+ static const char* __fields[] = { "floorctrl", "setup", "connection", "curr", "des", "conf" };
+ // remove media-level attributes
+ tsdp_header_A_removeAll_by_fields(p_self->M.lo->Attributes, __fields, sizeof(__fields)/sizeof(__fields[0]));
+ // Codec list never change and FMTs always a single star (*) value. Radvision TelePresence System reject a BFCP session whithout the single FMT (*)
+ // The Codecs and formats are never rebuilt which means we must not clear them
#if 0
- tsk_list_clear_items(p_self->M.lo->FMTs);
+ tsk_list_clear_items(p_self->M.lo->FMTs);
#endif
- }
-
- // get local address
- if ((ret = tbfcp_session_get_local_address(p_bfcp->p_bfcp_s, &pc_local_ip, &u_local_port))) {
- TSK_DEBUG_ERROR("Failed to get local address from BFCP session");
- return tsk_null;
- }
- // get local profile
- if ((ret = tbfcp_session_get_profile(p_bfcp->p_bfcp_s, &pc_local_profile))) {
- TSK_DEBUG_ERROR("Failed to get local profile from BFCP session");
- return tsk_null;
- }
- // get local role
- if ((ret = tbfcp_session_get_local_role(p_bfcp->p_bfcp_s, &e_local_role))) {
- TSK_DEBUG_ERROR("Failed to get local role from BFCP session");
- return tsk_null;
- }
- if ((ret = tbfcp_utils_get_role(e_local_role, &pc_local_role))) {
- return tsk_null;
- }
- // get local setup
- if ((ret = tbfcp_session_get_local_setup(p_bfcp->p_bfcp_s, &e_local_setup))) {
- TSK_DEBUG_ERROR("Failed to get local setup from BFCP session");
- return tsk_null;
- }
- if ((ret = tbfcp_utils_get_setup(e_local_role, &pc_local_setup))) {
- return tsk_null;
- }
-
- if (!p_self->M.lo){
- if (!(p_self->M.lo = tsdp_header_M_create(p_self->plugin->media, u_local_port, pc_local_profile))) {
- TSK_DEBUG_ERROR("Failed to create BFCP SDP media header");
- return tsk_null;
- }
- tsdp_header_M_add_headers(p_self->M.lo,
- TSDP_FMT_VA_ARGS("*"),
- TSDP_HEADER_A_VA_ARGS("connection", "new"),
- TSDP_HEADER_A_VA_ARGS("lib", "tinyBFCP"),
- tsk_null);
- // If NATT is active, do not rely on the global IP address Connection line
- if (p_bfcp->p_natt_ctx) {
- tsdp_header_M_add_headers(p_self->M.lo,
- TSDP_HEADER_C_VA_ARGS("IN", p_bfcp->b_use_ipv6 ? "IP6" : "IP4", pc_local_ip),
- tsk_null);
- }
- }
- else {
- p_self->M.lo->port = u_local_port;
- tsk_strupdate(&p_self->M.lo->proto, pc_local_profile);
- }
-
- // add "floorctrl" and "setup" attributes
- tsdp_header_M_add_headers(p_self->M.lo,
- TSDP_HEADER_A_VA_ARGS("connection", "new"),
- TSDP_HEADER_A_VA_ARGS("floorctrl", pc_local_role),
- TSDP_HEADER_A_VA_ARGS("setup", pc_local_setup),
- tsk_null);
-
- return p_self->M.lo;
+ }
+
+ // get local address
+ if ((ret = tbfcp_session_get_local_address(p_bfcp->p_bfcp_s, &pc_local_ip, &u_local_port))) {
+ TSK_DEBUG_ERROR("Failed to get local address from BFCP session");
+ return tsk_null;
+ }
+ // get local profile
+ if ((ret = tbfcp_session_get_profile(p_bfcp->p_bfcp_s, &pc_local_profile))) {
+ TSK_DEBUG_ERROR("Failed to get local profile from BFCP session");
+ return tsk_null;
+ }
+ // get local role
+ if ((ret = tbfcp_session_get_local_role(p_bfcp->p_bfcp_s, &e_local_role))) {
+ TSK_DEBUG_ERROR("Failed to get local role from BFCP session");
+ return tsk_null;
+ }
+ if ((ret = tbfcp_utils_get_role(e_local_role, &pc_local_role))) {
+ return tsk_null;
+ }
+ // get local setup
+ if ((ret = tbfcp_session_get_local_setup(p_bfcp->p_bfcp_s, &e_local_setup))) {
+ TSK_DEBUG_ERROR("Failed to get local setup from BFCP session");
+ return tsk_null;
+ }
+ if ((ret = tbfcp_utils_get_setup(e_local_role, &pc_local_setup))) {
+ return tsk_null;
+ }
+
+ if (!p_self->M.lo) {
+ if (!(p_self->M.lo = tsdp_header_M_create(p_self->plugin->media, u_local_port, pc_local_profile))) {
+ TSK_DEBUG_ERROR("Failed to create BFCP SDP media header");
+ return tsk_null;
+ }
+ tsdp_header_M_add_headers(p_self->M.lo,
+ TSDP_FMT_VA_ARGS("*"),
+ TSDP_HEADER_A_VA_ARGS("connection", "new"),
+ TSDP_HEADER_A_VA_ARGS("lib", "tinyBFCP"),
+ tsk_null);
+ // If NATT is active, do not rely on the global IP address Connection line
+ if (p_bfcp->p_natt_ctx) {
+ tsdp_header_M_add_headers(p_self->M.lo,
+ TSDP_HEADER_C_VA_ARGS("IN", p_bfcp->b_use_ipv6 ? "IP6" : "IP4", pc_local_ip),
+ tsk_null);
+ }
+ }
+ else {
+ p_self->M.lo->port = u_local_port;
+ tsk_strupdate(&p_self->M.lo->proto, pc_local_profile);
+ }
+
+ // add "floorctrl" and "setup" attributes
+ tsdp_header_M_add_headers(p_self->M.lo,
+ TSDP_HEADER_A_VA_ARGS("connection", "new"),
+ TSDP_HEADER_A_VA_ARGS("floorctrl", pc_local_role),
+ TSDP_HEADER_A_VA_ARGS("setup", pc_local_setup),
+ tsk_null);
+
+ return p_self->M.lo;
}
static int _tdav_session_bfcp_set_ro(tmedia_session_t* p_self, const tsdp_header_M_t* m)
{
- int ret = 0;
- const tsdp_header_A_t* A;
- tdav_session_bfcp_t* p_bfcp;
- enum tbfcp_role_e e_remote_role = tbfcp_role_c_s;
- uint32_t u_remote_conf_id = 0xFFFF;
- uint16_t u_remote_user_id = 0xFFFF, u_remote_floor_id = 0xFFFF;
-
- if (!p_self || !m) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TSK_DEBUG_INFO("_tdav_session_bfcp_set_ro");
-
- p_bfcp = (tdav_session_bfcp_t*)p_self;
-
- /* update remote offer */
- TSK_OBJECT_SAFE_FREE(p_self->M.ro);
- p_self->M.ro = tsk_object_ref(TSK_OBJECT(m));
-
-
- // https://tools.ietf.org/html/rfc4583
- {
- p_bfcp->b_conf_idf_changed = tsk_false;
- if ((A = tsdp_header_M_findA(m, "floorctrl"))) {
- if ((ret = tbfcp_utils_parse_role(A->value, &e_remote_role))) {
- return ret;
- }
- }
- if ((A = tsdp_header_M_findA(m, "confid"))) {
- p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.confid, A->value);
- tsk_strupdate(&p_bfcp->rfc4583.confid, A->value);
- u_remote_conf_id = (uint32_t)tsk_atoi64(p_bfcp->rfc4583.confid);
- }
- if ((A = tsdp_header_M_findA(m, "userid"))) {
- p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.userid, A->value);
- tsk_strupdate(&p_bfcp->rfc4583.userid, A->value);
- u_remote_user_id = (uint16_t)tsk_atoi64(p_bfcp->rfc4583.userid);
- }
- if ((A = tsdp_header_M_findA(m, "floorid"))) {
- char tmp_str[256];
- if (sscanf(A->value, "%255s %*s", tmp_str) != EOF) {
- char *pch, *saveptr;
- p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.floorid, tmp_str);
- tsk_strupdate(&p_bfcp->rfc4583.floorid, tmp_str);
- u_remote_floor_id = (uint16_t)tsk_atoi64(p_bfcp->rfc4583.floorid);
- pch = tsk_strtok_r(&A->value[tsk_strlen(tmp_str) + 1], " ", &saveptr);
- while (pch) {
- if (sscanf(pch, "mstrm: %255s", tmp_str) != EOF) {
- p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.mstrm, tmp_str);
- tsk_strupdate(&p_bfcp->rfc4583.mstrm, tmp_str);
- break;
- }
- pch = tsk_strtok_r(tsk_null, " ", &saveptr);
- }
- }
- }
- // set remote role
- if ((ret = tbfcp_session_set_remote_role(p_bfcp->p_bfcp_s, e_remote_role))) {
- return ret;
- }
- if ((e_remote_role & tbfcp_role_s_only)) {
- // local = client
- if ((ret = tbfcp_session_set_conf_ids(p_bfcp->p_bfcp_s, u_remote_conf_id, u_remote_user_id, u_remote_floor_id))) {
- return ret;
- }
- }
- else {
- // local = remote: Not supported yet and will never happen
- }
- }//end-of-rfc4583
-
- /* get connection associated to this media line
- * If the connnection is global, then the manager will call tdav_session_audio_set() */
- if (m->C && m->C->addr) {
- tsk_strupdate(&p_bfcp->p_remote_ip, m->C->addr);
- p_bfcp->b_use_ipv6 = tsk_striequals(m->C->addrtype, "IP6");
- }
- /* set remote port */
- p_bfcp->u_remote_port = m->port;
-
- return ret;
+ int ret = 0;
+ const tsdp_header_A_t* A;
+ tdav_session_bfcp_t* p_bfcp;
+ enum tbfcp_role_e e_remote_role = tbfcp_role_c_s;
+ uint32_t u_remote_conf_id = 0xFFFF;
+ uint16_t u_remote_user_id = 0xFFFF, u_remote_floor_id = 0xFFFF;
+
+ if (!p_self || !m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("_tdav_session_bfcp_set_ro");
+
+ p_bfcp = (tdav_session_bfcp_t*)p_self;
+
+ /* update remote offer */
+ TSK_OBJECT_SAFE_FREE(p_self->M.ro);
+ p_self->M.ro = tsk_object_ref(TSK_OBJECT(m));
+
+
+ // https://tools.ietf.org/html/rfc4583
+ {
+ p_bfcp->b_conf_idf_changed = tsk_false;
+ if ((A = tsdp_header_M_findA(m, "floorctrl"))) {
+ if ((ret = tbfcp_utils_parse_role(A->value, &e_remote_role))) {
+ return ret;
+ }
+ }
+ if ((A = tsdp_header_M_findA(m, "confid"))) {
+ p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.confid, A->value);
+ tsk_strupdate(&p_bfcp->rfc4583.confid, A->value);
+ u_remote_conf_id = (uint32_t)tsk_atoi64(p_bfcp->rfc4583.confid);
+ }
+ if ((A = tsdp_header_M_findA(m, "userid"))) {
+ p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.userid, A->value);
+ tsk_strupdate(&p_bfcp->rfc4583.userid, A->value);
+ u_remote_user_id = (uint16_t)tsk_atoi64(p_bfcp->rfc4583.userid);
+ }
+ if ((A = tsdp_header_M_findA(m, "floorid"))) {
+ char tmp_str[256];
+ if (sscanf(A->value, "%255s %*s", tmp_str) != EOF) {
+ char *pch, *saveptr;
+ p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.floorid, tmp_str);
+ tsk_strupdate(&p_bfcp->rfc4583.floorid, tmp_str);
+ u_remote_floor_id = (uint16_t)tsk_atoi64(p_bfcp->rfc4583.floorid);
+ pch = tsk_strtok_r(&A->value[tsk_strlen(tmp_str) + 1], " ", &saveptr);
+ while (pch) {
+ if (sscanf(pch, "mstrm: %255s", tmp_str) != EOF) {
+ p_bfcp->b_conf_idf_changed |= !tsk_striequals(p_bfcp->rfc4583.mstrm, tmp_str);
+ tsk_strupdate(&p_bfcp->rfc4583.mstrm, tmp_str);
+ break;
+ }
+ pch = tsk_strtok_r(tsk_null, " ", &saveptr);
+ }
+ }
+ }
+ // set remote role
+ if ((ret = tbfcp_session_set_remote_role(p_bfcp->p_bfcp_s, e_remote_role))) {
+ return ret;
+ }
+ if ((e_remote_role & tbfcp_role_s_only)) {
+ // local = client
+ if ((ret = tbfcp_session_set_conf_ids(p_bfcp->p_bfcp_s, u_remote_conf_id, u_remote_user_id, u_remote_floor_id))) {
+ return ret;
+ }
+ }
+ else {
+ // local = remote: Not supported yet and will never happen
+ }
+ }//end-of-rfc4583
+
+ /* get connection associated to this media line
+ * If the connnection is global, then the manager will call tdav_session_audio_set() */
+ if (m->C && m->C->addr) {
+ tsk_strupdate(&p_bfcp->p_remote_ip, m->C->addr);
+ p_bfcp->b_use_ipv6 = tsk_striequals(m->C->addrtype, "IP6");
+ }
+ /* set remote port */
+ p_bfcp->u_remote_port = m->port;
+
+ return ret;
}
static int _tdav_session_bfcp_send_Hello(tdav_session_bfcp_t* p_bfcp)
{
- int ret = 0;
- if (!p_bfcp) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!p_bfcp->p_pkt_Hello && (ret = tbfcp_session_create_pkt_Hello(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_Hello))) {
- return ret;
- }
- if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_Hello))) {
- return ret;
- }
- return ret;
+ int ret = 0;
+ if (!p_bfcp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!p_bfcp->p_pkt_Hello && (ret = tbfcp_session_create_pkt_Hello(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_Hello))) {
+ return ret;
+ }
+ if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_Hello))) {
+ return ret;
+ }
+ return ret;
}
static int _tdav_session_bfcp_notif(const struct tbfcp_session_event_xs *e)
{
- tdav_session_bfcp_t* p_bfcp = tsk_object_ref(TSK_OBJECT(e->pc_usr_data));
- int ret = 0;
- static const char* kErrTextGlobalError = "Global error";
- static const int kErrCodeGlobalError = -56;
- static const char* kErrTextTimeout = "Timeout";
- static const int kErrCodeTimeout = -57;
- static const char* kErrTextUnExpectedIncomingMsg = "Unexpected incoming BFCP message";
- static const int kErrCodeUnExpectedIncomingMsg = -58;
- static const char* kErrTextBadRequest = "Bad Request";
- static const int kErrCodeBadRequest = -59;
- static const char* kInfoTextFloorReqStatus = "FloorRequestStatus";
+ tdav_session_bfcp_t* p_bfcp = tsk_object_ref(TSK_OBJECT(e->pc_usr_data));
+ int ret = 0;
+ static const char* kErrTextGlobalError = "Global error";
+ static const int kErrCodeGlobalError = -56;
+ static const char* kErrTextTimeout = "Timeout";
+ static const int kErrCodeTimeout = -57;
+ static const char* kErrTextUnExpectedIncomingMsg = "Unexpected incoming BFCP message";
+ static const int kErrCodeUnExpectedIncomingMsg = -58;
+ static const char* kErrTextBadRequest = "Bad Request";
+ static const int kErrCodeBadRequest = -59;
+ static const char* kInfoTextFloorReqStatus = "FloorRequestStatus";
#define _RAISE_ERR_AND_GOTO_BAIL(_code, _reason) \
if (TMEDIA_SESSION(p_bfcp)->bfcp_cb.fun) { \
@@ -491,162 +490,160 @@ static int _tdav_session_bfcp_notif(const struct tbfcp_session_event_xs *e)
e.type = tmedia_session_bfcp_evt_type_flreq_status; e.flreq.status = _status; e.reason = _reason; \
TMEDIA_SESSION(p_bfcp)->bfcp_cb.fun(TMEDIA_SESSION(p_bfcp)->bfcp_cb.usrdata, TMEDIA_SESSION(p_bfcp), &e); \
} \
-
- switch (e->e_type) {
- case tbfcp_session_event_type_inf_inc_msg:
- {
- if (p_bfcp->p_pkt_Hello && p_bfcp->p_pkt_Hello->hdr.transac_id == e->pc_pkt->hdr.transac_id && p_bfcp->p_pkt_Hello->hdr.user_id == e->pc_pkt->hdr.user_id && p_bfcp->p_pkt_Hello->hdr.conf_id == e->pc_pkt->hdr.conf_id) {
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_Hello);
- if (e->pc_pkt->hdr.primitive == tbfcp_primitive_HelloAck) {
- if (!p_bfcp->p_pkt_FloorRequest) {
- if (p_bfcp->b_conf_idf_changed || 0) {
- // Create the "FloorRelease" for this "FloorRequest"
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRelease);
- if ((ret = tbfcp_session_create_pkt_FloorRelease(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRelease))) {
- goto raise_err;
- }
- if ((ret = tbfcp_session_create_pkt_FloorRequest(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRequest))) {
- goto raise_err;
- }
- if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRequest))) {
- goto raise_err;
- }
- }
- else {
- TSK_DEBUG_INFO("No change to BFCP session... do not send FloorRequest");
- }
- }
- }
- else {
- TSK_DEBUG_ERROR("%s", kErrTextUnExpectedIncomingMsg);
- _RAISE_ERR_AND_GOTO_BAIL(kErrCodeUnExpectedIncomingMsg, kErrTextUnExpectedIncomingMsg);
- }
- }
- else if(p_bfcp->p_pkt_FloorRequest /*&& p_bfcp->p_pkt_FloorRequest->hdr.transac_id == e->pc_pkt->hdr.transac_id*/ && p_bfcp->p_pkt_FloorRequest->hdr.user_id == e->pc_pkt->hdr.user_id && p_bfcp->p_pkt_FloorRequest->hdr.conf_id == e->pc_pkt->hdr.conf_id) {
- tsk_bool_t transac_id_matched = (p_bfcp->p_pkt_FloorRequest->hdr.transac_id == e->pc_pkt->hdr.transac_id);
- if (e->pc_pkt->hdr.primitive == tbfcp_primitive_FloorRequestStatus || e->pc_pkt->hdr.primitive == tbfcp_primitive_FloorStatus) {
- tsk_size_t u_index0, u_index1, u_index2, u_index3;
- const tbfcp_attr_grouped_t *pc_attr_FloorRequestInformation = tsk_null,
- *pc_attr_FloorRequestStatus = tsk_null,
- *pc_attr_OverallRequestStatus = tsk_null;
- const tbfcp_attr_octetstring16_t *pc_attr_RequestStatus = tsk_null;
-
- u_index0 = 0;
- // Find "FloorRequestInformation"
- while ((ret = tbfcp_pkt_attr_find_at(e->pc_pkt, tbfcp_attribute_format_Grouped, u_index0++, (const tbfcp_attr_t **)&pc_attr_FloorRequestInformation)) == 0 && pc_attr_FloorRequestInformation) {
- if (TBFCP_ATTR(pc_attr_FloorRequestInformation)->hdr.type != tbfcp_attribute_type_FLOOR_REQUEST_INFORMATION) {
- continue;
- }
- // Find "FloorRequestStatus"
- u_index1 = 0;
- while ((ret = tbfcp_attr_grouped_find_at(pc_attr_FloorRequestInformation, tbfcp_attribute_format_Grouped, u_index1++, (const tbfcp_attr_t **)&pc_attr_FloorRequestStatus)) == 0 && pc_attr_FloorRequestStatus) {
- if (TBFCP_ATTR(pc_attr_FloorRequestStatus)->hdr.type != tbfcp_attribute_type_FLOOR_REQUEST_STATUS) {
- continue;
- }
- if (pc_attr_FloorRequestStatus->extra_hdr.FloorID != atoi(p_bfcp->rfc4583.floorid)) {
- continue;
- }
- break;
- }
- if (!pc_attr_FloorRequestStatus) {
- continue;
- }
- // Find "OverallRequestStatus"
- u_index2 = 0;
- while ((ret = tbfcp_attr_grouped_find_at(pc_attr_FloorRequestInformation, tbfcp_attribute_format_Grouped, u_index2++, (const tbfcp_attr_t **)&pc_attr_OverallRequestStatus)) == 0 && pc_attr_OverallRequestStatus) {
- if (TBFCP_ATTR(pc_attr_OverallRequestStatus)->hdr.type != tbfcp_attribute_type_OVERALL_REQUEST_STATUS) {
- continue;
- }
-
- // Find "RequestStatus"
- u_index3 = 0;
- while ((ret = tbfcp_attr_grouped_find_at(pc_attr_OverallRequestStatus, tbfcp_attribute_format_OctetString16, u_index3++, (const tbfcp_attr_t **)&pc_attr_RequestStatus)) == 0 && pc_attr_RequestStatus) {
- if (TBFCP_ATTR(pc_attr_RequestStatus)->hdr.type != tbfcp_attribute_type_REQUEST_STATUS) {
- continue;
- }
- break;
- }
- }
- if (pc_attr_RequestStatus) {
- break;
- }
- }
-
- if (pc_attr_RequestStatus) {
- // https://tools.ietf.org/html/rfc4582#section-5.2.5
- uint16_t u_status = pc_attr_RequestStatus->OctetString16[0] + (pc_attr_RequestStatus->OctetString16[1] << 8);
- if (transac_id_matched) {
- if (u_status == tbfcp_reqstatus_Revoked && !p_bfcp->b_revoked_handled) { // revoked
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest); // free the FloorRequest and ask new one once HelloAck is received
- // Radvision sends a Revoke after a reINVITE to ask for new negotiation.
- if (p_bfcp->p_pkt_FloorRelease) {
- if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRelease))) {
- goto raise_err;
- }
- }
- if ((ret = _tdav_session_bfcp_send_Hello(p_bfcp))) {
- goto raise_err;
- }
- p_bfcp->b_revoked_handled = tsk_true;
- }
- else {
- _RAISE_FLREQ(u_status, kInfoTextFloorReqStatus);
- }
- }
- else { //!transac_id_matched
- // Status from old FloorRequest
- tbfcp_pkt_t* p_pkt = tsk_null;
- TSK_DEBUG_INFO("Status from old Request");
- if (u_status == tbfcp_reqstatus_Pending || u_status == tbfcp_reqstatus_Accepted || u_status == tbfcp_reqstatus_Granted) {
- if ((ret = tbfcp_pkt_create_FloorRelease_2(e->pc_pkt->hdr.conf_id, e->pc_pkt->hdr.transac_id, e->pc_pkt->hdr.user_id, pc_attr_FloorRequestStatus->extra_hdr.FloorID, &p_pkt))) {
- goto raise_err;
- }
- ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_pkt);
- TSK_OBJECT_SAFE_FREE(p_pkt);
- if (ret) {
- goto raise_err;
- }
- }
- }
- }
- else {
- /* /!\ No RequestStatus attribute in FloorRequestStatus */
- TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest);
- TSK_DEBUG_ERROR("%s", kErrTextBadRequest);
- _RAISE_ERR_AND_GOTO_BAIL(kErrCodeBadRequest, kErrTextBadRequest);
- }
- }
- else {
- switch (e->pc_pkt->hdr.primitive) {
- case tbfcp_primitive_Hello: break; // already handled in "_tbfcp_session_process_incoming_pkt()"
- default:
- {
- TSK_DEBUG_ERROR("%s", kErrTextUnExpectedIncomingMsg);
- _RAISE_ERR_AND_GOTO_BAIL(kErrCodeUnExpectedIncomingMsg, kErrTextUnExpectedIncomingMsg);
- break;
- }
- }
- }
- }
- break;
- }
- case tbfcp_session_event_type_err_send_timedout:
- {
- /* /!\ Sending BFCP message timedout */
- TSK_DEBUG_ERROR("%s", kErrTextTimeout);
- _RAISE_ERR_AND_GOTO_BAIL(kErrCodeTimeout, kErrTextTimeout);
- break;
- }
- }
+
+ switch (e->e_type) {
+ case tbfcp_session_event_type_inf_inc_msg: {
+ if (p_bfcp->p_pkt_Hello && p_bfcp->p_pkt_Hello->hdr.transac_id == e->pc_pkt->hdr.transac_id && p_bfcp->p_pkt_Hello->hdr.user_id == e->pc_pkt->hdr.user_id && p_bfcp->p_pkt_Hello->hdr.conf_id == e->pc_pkt->hdr.conf_id) {
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_Hello);
+ if (e->pc_pkt->hdr.primitive == tbfcp_primitive_HelloAck) {
+ if (!p_bfcp->p_pkt_FloorRequest) {
+ if (p_bfcp->b_conf_idf_changed || 0) {
+ // Create the "FloorRelease" for this "FloorRequest"
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRelease);
+ if ((ret = tbfcp_session_create_pkt_FloorRelease(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRelease))) {
+ goto raise_err;
+ }
+ if ((ret = tbfcp_session_create_pkt_FloorRequest(p_bfcp->p_bfcp_s, &p_bfcp->p_pkt_FloorRequest))) {
+ goto raise_err;
+ }
+ if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRequest))) {
+ goto raise_err;
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("No change to BFCP session... do not send FloorRequest");
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("%s", kErrTextUnExpectedIncomingMsg);
+ _RAISE_ERR_AND_GOTO_BAIL(kErrCodeUnExpectedIncomingMsg, kErrTextUnExpectedIncomingMsg);
+ }
+ }
+ else if(p_bfcp->p_pkt_FloorRequest /*&& p_bfcp->p_pkt_FloorRequest->hdr.transac_id == e->pc_pkt->hdr.transac_id*/ && p_bfcp->p_pkt_FloorRequest->hdr.user_id == e->pc_pkt->hdr.user_id && p_bfcp->p_pkt_FloorRequest->hdr.conf_id == e->pc_pkt->hdr.conf_id) {
+ tsk_bool_t transac_id_matched = (p_bfcp->p_pkt_FloorRequest->hdr.transac_id == e->pc_pkt->hdr.transac_id);
+ if (e->pc_pkt->hdr.primitive == tbfcp_primitive_FloorRequestStatus || e->pc_pkt->hdr.primitive == tbfcp_primitive_FloorStatus) {
+ tsk_size_t u_index0, u_index1, u_index2, u_index3;
+ const tbfcp_attr_grouped_t *pc_attr_FloorRequestInformation = tsk_null,
+ *pc_attr_FloorRequestStatus = tsk_null,
+ *pc_attr_OverallRequestStatus = tsk_null;
+ const tbfcp_attr_octetstring16_t *pc_attr_RequestStatus = tsk_null;
+
+ u_index0 = 0;
+ // Find "FloorRequestInformation"
+ while ((ret = tbfcp_pkt_attr_find_at(e->pc_pkt, tbfcp_attribute_format_Grouped, u_index0++, (const tbfcp_attr_t **)&pc_attr_FloorRequestInformation)) == 0 && pc_attr_FloorRequestInformation) {
+ if (TBFCP_ATTR(pc_attr_FloorRequestInformation)->hdr.type != tbfcp_attribute_type_FLOOR_REQUEST_INFORMATION) {
+ continue;
+ }
+ // Find "FloorRequestStatus"
+ u_index1 = 0;
+ while ((ret = tbfcp_attr_grouped_find_at(pc_attr_FloorRequestInformation, tbfcp_attribute_format_Grouped, u_index1++, (const tbfcp_attr_t **)&pc_attr_FloorRequestStatus)) == 0 && pc_attr_FloorRequestStatus) {
+ if (TBFCP_ATTR(pc_attr_FloorRequestStatus)->hdr.type != tbfcp_attribute_type_FLOOR_REQUEST_STATUS) {
+ continue;
+ }
+ if (pc_attr_FloorRequestStatus->extra_hdr.FloorID != atoi(p_bfcp->rfc4583.floorid)) {
+ continue;
+ }
+ break;
+ }
+ if (!pc_attr_FloorRequestStatus) {
+ continue;
+ }
+ // Find "OverallRequestStatus"
+ u_index2 = 0;
+ while ((ret = tbfcp_attr_grouped_find_at(pc_attr_FloorRequestInformation, tbfcp_attribute_format_Grouped, u_index2++, (const tbfcp_attr_t **)&pc_attr_OverallRequestStatus)) == 0 && pc_attr_OverallRequestStatus) {
+ if (TBFCP_ATTR(pc_attr_OverallRequestStatus)->hdr.type != tbfcp_attribute_type_OVERALL_REQUEST_STATUS) {
+ continue;
+ }
+
+ // Find "RequestStatus"
+ u_index3 = 0;
+ while ((ret = tbfcp_attr_grouped_find_at(pc_attr_OverallRequestStatus, tbfcp_attribute_format_OctetString16, u_index3++, (const tbfcp_attr_t **)&pc_attr_RequestStatus)) == 0 && pc_attr_RequestStatus) {
+ if (TBFCP_ATTR(pc_attr_RequestStatus)->hdr.type != tbfcp_attribute_type_REQUEST_STATUS) {
+ continue;
+ }
+ break;
+ }
+ }
+ if (pc_attr_RequestStatus) {
+ break;
+ }
+ }
+
+ if (pc_attr_RequestStatus) {
+ // https://tools.ietf.org/html/rfc4582#section-5.2.5
+ uint16_t u_status = pc_attr_RequestStatus->OctetString16[0] + (pc_attr_RequestStatus->OctetString16[1] << 8);
+ if (transac_id_matched) {
+ if (u_status == tbfcp_reqstatus_Revoked && !p_bfcp->b_revoked_handled) { // revoked
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest); // free the FloorRequest and ask new one once HelloAck is received
+ // Radvision sends a Revoke after a reINVITE to ask for new negotiation.
+ if (p_bfcp->p_pkt_FloorRelease) {
+ if ((ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_bfcp->p_pkt_FloorRelease))) {
+ goto raise_err;
+ }
+ }
+ if ((ret = _tdav_session_bfcp_send_Hello(p_bfcp))) {
+ goto raise_err;
+ }
+ p_bfcp->b_revoked_handled = tsk_true;
+ }
+ else {
+ _RAISE_FLREQ(u_status, kInfoTextFloorReqStatus);
+ }
+ }
+ else { //!transac_id_matched
+ // Status from old FloorRequest
+ tbfcp_pkt_t* p_pkt = tsk_null;
+ TSK_DEBUG_INFO("Status from old Request");
+ if (u_status == tbfcp_reqstatus_Pending || u_status == tbfcp_reqstatus_Accepted || u_status == tbfcp_reqstatus_Granted) {
+ if ((ret = tbfcp_pkt_create_FloorRelease_2(e->pc_pkt->hdr.conf_id, e->pc_pkt->hdr.transac_id, e->pc_pkt->hdr.user_id, pc_attr_FloorRequestStatus->extra_hdr.FloorID, &p_pkt))) {
+ goto raise_err;
+ }
+ ret = tbfcp_session_send_pkt(p_bfcp->p_bfcp_s, p_pkt);
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ if (ret) {
+ goto raise_err;
+ }
+ }
+ }
+ }
+ else {
+ /* /!\ No RequestStatus attribute in FloorRequestStatus */
+ TSK_OBJECT_SAFE_FREE(p_bfcp->p_pkt_FloorRequest);
+ TSK_DEBUG_ERROR("%s", kErrTextBadRequest);
+ _RAISE_ERR_AND_GOTO_BAIL(kErrCodeBadRequest, kErrTextBadRequest);
+ }
+ }
+ else {
+ switch (e->pc_pkt->hdr.primitive) {
+ case tbfcp_primitive_Hello:
+ break; // already handled in "_tbfcp_session_process_incoming_pkt()"
+ default: {
+ TSK_DEBUG_ERROR("%s", kErrTextUnExpectedIncomingMsg);
+ _RAISE_ERR_AND_GOTO_BAIL(kErrCodeUnExpectedIncomingMsg, kErrTextUnExpectedIncomingMsg);
+ break;
+ }
+ }
+ }
+ }
+ break;
+ }
+ case tbfcp_session_event_type_err_send_timedout: {
+ /* /!\ Sending BFCP message timedout */
+ TSK_DEBUG_ERROR("%s", kErrTextTimeout);
+ _RAISE_ERR_AND_GOTO_BAIL(kErrCodeTimeout, kErrTextTimeout);
+ break;
+ }
+ }
raise_err:
- if (ret) {
- TSK_DEBUG_ERROR("%s", kErrTextGlobalError);
- _RAISE_ERR_AND_GOTO_BAIL(kErrCodeGlobalError, kErrTextGlobalError);
- }
+ if (ret) {
+ TSK_DEBUG_ERROR("%s", kErrTextGlobalError);
+ _RAISE_ERR_AND_GOTO_BAIL(kErrCodeGlobalError, kErrTextGlobalError);
+ }
bail:
- TSK_OBJECT_SAFE_FREE(p_bfcp);
- return ret;
+ TSK_OBJECT_SAFE_FREE(p_bfcp);
+ return ret;
}
@@ -662,79 +659,77 @@ bail:
/* constructor */
static tsk_object_t* _tdav_session_bfcp_ctor(tsk_object_t * p_self, va_list * app)
{
- tdav_session_bfcp_t *p_session = (tdav_session_bfcp_t *)p_self;
- if (p_session) {
- /* init base: called by tmedia_session_create() */
- /* init self */
- // TMEDIA_SESSION_BFCP(session)->send_file = tdav_session_bfcp_send_file;
- // TMEDIA_SESSION_BFCP(session)->send_message = tdav_session_bfcp_send_message;
-
- // session->config = tbfcp_config_create();
- // session->setup = bfcp_setup_actpass;
- // session->dir = tdav_bfcp_dir_none;
- }
- return p_self;
+ tdav_session_bfcp_t *p_session = (tdav_session_bfcp_t *)p_self;
+ if (p_session) {
+ /* init base: called by tmedia_session_create() */
+ /* init self */
+ // TMEDIA_SESSION_BFCP(session)->send_file = tdav_session_bfcp_send_file;
+ // TMEDIA_SESSION_BFCP(session)->send_message = tdav_session_bfcp_send_message;
+
+ // session->config = tbfcp_config_create();
+ // session->setup = bfcp_setup_actpass;
+ // session->dir = tdav_bfcp_dir_none;
+ }
+ return p_self;
}
/* destructor */
static tsk_object_t* _tdav_session_bfcp_dtor(tsk_object_t * p_self)
-{
- tdav_session_bfcp_t *p_session = (tdav_session_bfcp_t *)p_self;
- if (p_session) {
- /* deinit self */
-
- TSK_OBJECT_SAFE_FREE(p_session->p_bfcp_s);
- TSK_OBJECT_SAFE_FREE(p_session->p_pkt_FloorRequest);
- TSK_OBJECT_SAFE_FREE(p_session->p_pkt_FloorRelease);
- TSK_OBJECT_SAFE_FREE(p_session->p_pkt_Hello);
-
- TSK_FREE(p_session->p_local_ip);
- TSK_FREE(p_session->p_remote_ip);
-
- /* rfc4583 */
- TSK_FREE(p_session->rfc4583.confid);
- TSK_FREE(p_session->rfc4583.floorid);
- TSK_FREE(p_session->rfc4583.mstrm);
- TSK_FREE(p_session->rfc4583.userid);
-
- /* NAT Traversal context */
- TSK_OBJECT_SAFE_FREE(p_session->p_natt_ctx);
-
- /* deinit base */
- tmedia_session_deinit(p_self);
-
- TSK_DEBUG_INFO("*** tdav_session_bfcp_t destroyed ***");
- }
-
- return p_self;
+{
+ tdav_session_bfcp_t *p_session = (tdav_session_bfcp_t *)p_self;
+ if (p_session) {
+ /* deinit self */
+
+ TSK_OBJECT_SAFE_FREE(p_session->p_bfcp_s);
+ TSK_OBJECT_SAFE_FREE(p_session->p_pkt_FloorRequest);
+ TSK_OBJECT_SAFE_FREE(p_session->p_pkt_FloorRelease);
+ TSK_OBJECT_SAFE_FREE(p_session->p_pkt_Hello);
+
+ TSK_FREE(p_session->p_local_ip);
+ TSK_FREE(p_session->p_remote_ip);
+
+ /* rfc4583 */
+ TSK_FREE(p_session->rfc4583.confid);
+ TSK_FREE(p_session->rfc4583.floorid);
+ TSK_FREE(p_session->rfc4583.mstrm);
+ TSK_FREE(p_session->rfc4583.userid);
+
+ /* NAT Traversal context */
+ TSK_OBJECT_SAFE_FREE(p_session->p_natt_ctx);
+
+ /* deinit base */
+ tmedia_session_deinit(p_self);
+
+ TSK_DEBUG_INFO("*** tdav_session_bfcp_t destroyed ***");
+ }
+
+ return p_self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_bfcp_def_s =
-{
- sizeof(tdav_session_bfcp_t),
- _tdav_session_bfcp_ctor,
- _tdav_session_bfcp_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tdav_session_bfcp_def_s = {
+ sizeof(tdav_session_bfcp_t),
+ _tdav_session_bfcp_ctor,
+ _tdav_session_bfcp_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tdav_session_bfcp_plugin_def_s =
-{
- &tdav_session_bfcp_def_s,
-
- tmedia_bfcp,
- "application",
-
- _tdav_session_bfcp_set,
- _tdav_session_bfcp_get,
- _tdav_session_bfcp_prepare,
- _tdav_session_bfcp_start,
- _tdav_session_bfcp_pause,
- _tdav_session_bfcp_stop,
-
- /* Audio part */
- { tsk_null },
-
- _tdav_session_bfcp_get_lo,
- _tdav_session_bfcp_set_ro
+static const tmedia_session_plugin_def_t tdav_session_bfcp_plugin_def_s = {
+ &tdav_session_bfcp_def_s,
+
+ tmedia_bfcp,
+ "application",
+
+ _tdav_session_bfcp_set,
+ _tdav_session_bfcp_get,
+ _tdav_session_bfcp_prepare,
+ _tdav_session_bfcp_start,
+ _tdav_session_bfcp_pause,
+ _tdav_session_bfcp_stop,
+
+ /* Audio part */
+ { tsk_null },
+
+ _tdav_session_bfcp_get_lo,
+ _tdav_session_bfcp_set_ro
};
const tmedia_session_plugin_def_t *tdav_session_bfcp_plugin_def_t = &tdav_session_bfcp_plugin_def_s;
diff --git a/tinyDAV/src/codecs/amr/tdav_codec_amr.c b/tinyDAV/src/codecs/amr/tdav_codec_amr.c
index 9304f85..727772c 100755
--- a/tinyDAV/src/codecs/amr/tdav_codec_amr.c
+++ b/tinyDAV/src/codecs/amr/tdav_codec_amr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -62,7 +62,7 @@ static tsk_size_t tdav_codec_amr_be_encode(tdav_codec_amr_t* amr, const void* in
static tsk_size_t tdav_codec_amr_oa_encode(tdav_codec_amr_t* amr, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size);
static uint8_t tdav_codec_amr_bitbuffer_read(const void* bits, tsk_size_t size, tsk_size_t start, tsk_size_t count);
-/* ============ AMR-NB Plugin interface =================
+/* ============ AMR-NB Plugin interface =================
The AMR codec was originally developed and standardized by the
European Telecommunications Standards Institute (ETSI) for GSM
cellular systems. It is now chosen by the Third Generation
@@ -83,107 +83,107 @@ static uint8_t tdav_codec_amr_bitbuffer_read(const void* bits, tsk_size_t size,
int tdav_codec_amrnb_open(tmedia_codec_t* self)
{
- tdav_codec_amr_t* amrnb = (tdav_codec_amr_t*)self;
-
- if(!TDAV_CODEC_AMR(amrnb)->encoder){
- if(!(TDAV_CODEC_AMR(amrnb)->encoder = Encoder_Interface_init(0))){
- TSK_DEBUG_ERROR("Failed to initialize AMR-NB encoder");
- return -2;
- }
- }
-
- if(!TDAV_CODEC_AMR(amrnb)->decoder){
- if(!(TDAV_CODEC_AMR(amrnb)->decoder = Decoder_Interface_init())){
- TSK_DEBUG_ERROR("Failed to initialize AMR-NB encoder");
- return -2;
- }
- }
-
- return 0;
+ tdav_codec_amr_t* amrnb = (tdav_codec_amr_t*)self;
+
+ if(!TDAV_CODEC_AMR(amrnb)->encoder) {
+ if(!(TDAV_CODEC_AMR(amrnb)->encoder = Encoder_Interface_init(0))) {
+ TSK_DEBUG_ERROR("Failed to initialize AMR-NB encoder");
+ return -2;
+ }
+ }
+
+ if(!TDAV_CODEC_AMR(amrnb)->decoder) {
+ if(!(TDAV_CODEC_AMR(amrnb)->decoder = Decoder_Interface_init())) {
+ TSK_DEBUG_ERROR("Failed to initialize AMR-NB encoder");
+ return -2;
+ }
+ }
+
+ return 0;
}
int tdav_codec_amrnb_close(tmedia_codec_t* self)
{
- tdav_codec_amr_t* amrnb = (tdav_codec_amr_t*)self;
+ tdav_codec_amr_t* amrnb = (tdav_codec_amr_t*)self;
- if(TDAV_CODEC_AMR(amrnb)->encoder){
- Encoder_Interface_exit(TDAV_CODEC_AMR(amrnb)->encoder);
- TDAV_CODEC_AMR(amrnb)->encoder = tsk_null;
- }
+ if(TDAV_CODEC_AMR(amrnb)->encoder) {
+ Encoder_Interface_exit(TDAV_CODEC_AMR(amrnb)->encoder);
+ TDAV_CODEC_AMR(amrnb)->encoder = tsk_null;
+ }
- if(TDAV_CODEC_AMR(amrnb)->decoder){
- Decoder_Interface_exit(TDAV_CODEC_AMR(amrnb)->decoder);
- TDAV_CODEC_AMR(amrnb)->decoder = tsk_null;
- }
+ if(TDAV_CODEC_AMR(amrnb)->decoder) {
+ Decoder_Interface_exit(TDAV_CODEC_AMR(amrnb)->decoder);
+ TDAV_CODEC_AMR(amrnb)->decoder = tsk_null;
+ }
- return 0;
+ return 0;
}
tsk_size_t tdav_codec_amrnb_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tdav_codec_amr_t* amr = (tdav_codec_amr_t*)self;
-
- switch(amr->mode){
- case tdav_codec_amr_mode_be:
- return tdav_codec_amr_be_encode(amr, in_data, in_size, out_data, out_max_size);
- default:
- return tdav_codec_amr_oa_encode(amr, in_data, in_size, out_data, out_max_size);
- }
-
- return 0;
+{
+ tdav_codec_amr_t* amr = (tdav_codec_amr_t*)self;
+
+ switch(amr->mode) {
+ case tdav_codec_amr_mode_be:
+ return tdav_codec_amr_be_encode(amr, in_data, in_size, out_data, out_max_size);
+ default:
+ return tdav_codec_amr_oa_encode(amr, in_data, in_size, out_data, out_max_size);
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_amrnb_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_amr_t* amr = (tdav_codec_amr_t*)self;
-
- switch(amr->mode){
- case tdav_codec_amr_mode_be:
- return tdav_codec_amr_be_decode(amr, in_data, in_size, out_data, out_max_size, proto_hdr);
- default:
- return tdav_codec_amr_oa_decode(amr, in_data, in_size, out_data, out_max_size, proto_hdr);
- }
+ tdav_codec_amr_t* amr = (tdav_codec_amr_t*)self;
+
+ switch(amr->mode) {
+ case tdav_codec_amr_mode_be:
+ return tdav_codec_amr_be_decode(amr, in_data, in_size, out_data, out_max_size, proto_hdr);
+ default:
+ return tdav_codec_amr_oa_decode(amr, in_data, in_size, out_data, out_max_size, proto_hdr);
+ }
}
char* tdav_codec_amrnb_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- const tdav_codec_amr_t* amr = (const tdav_codec_amr_t*)codec;
-
- /* We support all modes, all ... */
- if(amr){
- switch(amr->mode){
- case tdav_codec_amr_mode_be:
- return tsk_strdup("octet-align=0");
- default:
- return tsk_strdup("octet-align=1");
- }
- }
- return tsk_null;
+ const tdav_codec_amr_t* amr = (const tdav_codec_amr_t*)codec;
+
+ /* We support all modes, all ... */
+ if(amr) {
+ switch(amr->mode) {
+ case tdav_codec_amr_mode_be:
+ return tsk_strdup("octet-align=0");
+ default:
+ return tsk_strdup("octet-align=1");
+ }
+ }
+ return tsk_null;
}
tsk_bool_t tdav_codec_amrnb_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- tdav_codec_amr_t* amr;
- if(!(amr = (tdav_codec_amr_t*)codec) || !att_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- if(amr && tsk_striequals(att_name, "fmtp")){
- /* Match mode */
- if(tdav_codec_amr_get_mode(att_value) != amr->mode){
- TSK_DEBUG_INFO("Failed to match [%s]", att_value);
- return tsk_false;
- }
- /* check parameters validity */
- if(tdav_codec_amr_parse_fmtp(amr, att_value)){
- TSK_DEBUG_INFO("Failed to match [%s]", att_value);
- return tsk_false;
- }
-
- return tsk_true;
- }
- return tsk_false;
+{
+ tdav_codec_amr_t* amr;
+ if(!(amr = (tdav_codec_amr_t*)codec) || !att_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ if(amr && tsk_striequals(att_name, "fmtp")) {
+ /* Match mode */
+ if(tdav_codec_amr_get_mode(att_value) != amr->mode) {
+ TSK_DEBUG_INFO("Failed to match [%s]", att_value);
+ return tsk_false;
+ }
+ /* check parameters validity */
+ if(tdav_codec_amr_parse_fmtp(amr, att_value)) {
+ TSK_DEBUG_INFO("Failed to match [%s]", att_value);
+ return tsk_false;
+ }
+
+ return tsk_true;
+ }
+ return tsk_false;
}
@@ -194,63 +194,61 @@ tsk_bool_t tdav_codec_amrnb_sdp_att_match(const tmedia_codec_t* codec, const cha
/* constructor */
static tsk_object_t* tdav_codec_amrnb_oa_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_amr_t *amrnb_oa = self;
- if(amrnb_oa){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_amr_init(TDAV_CODEC_AMR(amrnb_oa), tdav_codec_amr_type_nb, tdav_codec_amr_mode_oa);
- }
- return self;
+ tdav_codec_amr_t *amrnb_oa = self;
+ if(amrnb_oa) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_amr_init(TDAV_CODEC_AMR(amrnb_oa), tdav_codec_amr_type_nb, tdav_codec_amr_mode_oa);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_amrnb_oa_dtor(tsk_object_t * self)
-{
- tdav_codec_amr_t *amrnb_oa = self;
- if(amrnb_oa){
- /* deinit base */
- tmedia_codec_audio_deinit(amrnb_oa);
- /* deinit self */
- tdav_codec_amr_deinit(TDAV_CODEC_AMR(amrnb_oa));
- }
-
- return self;
+{
+ tdav_codec_amr_t *amrnb_oa = self;
+ if(amrnb_oa) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(amrnb_oa);
+ /* deinit self */
+ tdav_codec_amr_deinit(TDAV_CODEC_AMR(amrnb_oa));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_amrnb_oa_def_s =
-{
- sizeof(tdav_codec_amr_t),
- tdav_codec_amrnb_oa_ctor,
- tdav_codec_amrnb_oa_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_amrnb_oa_def_s = {
+ sizeof(tdav_codec_amr_t),
+ tdav_codec_amrnb_oa_ctor,
+ tdav_codec_amrnb_oa_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_amrnb_oa_plugin_def_s =
-{
- &tdav_codec_amrnb_oa_def_s,
-
- tmedia_audio,
- tmedia_codec_id_amr_nb_oa,
- "AMR",
- "AMR Narrow Band - Octet Aligned (libopencore-amr)",
- TMEDIA_CODEC_FORMAT_AMR_NB_OA,
- tsk_true,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 20 // ptime
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_amrnb_open,
- tdav_codec_amrnb_close,
- tdav_codec_amrnb_encode,
- tdav_codec_amrnb_decode,
- tdav_codec_amrnb_sdp_att_match,
- tdav_codec_amrnb_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_amrnb_oa_plugin_def_s = {
+ &tdav_codec_amrnb_oa_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_amr_nb_oa,
+ "AMR",
+ "AMR Narrow Band - Octet Aligned (libopencore-amr)",
+ TMEDIA_CODEC_FORMAT_AMR_NB_OA,
+ tsk_true,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 20 // ptime
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_amrnb_open,
+ tdav_codec_amrnb_close,
+ tdav_codec_amrnb_encode,
+ tdav_codec_amrnb_decode,
+ tdav_codec_amrnb_sdp_att_match,
+ tdav_codec_amrnb_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_amrnb_oa_plugin_def_t = &tdav_codec_amrnb_oa_plugin_def_s;
@@ -261,63 +259,61 @@ const tmedia_codec_plugin_def_t *tdav_codec_amrnb_oa_plugin_def_t = &tdav_codec_
/* constructor */
static tsk_object_t* tdav_codec_amrnb_be_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_amr_t *amrnb_be = self;
- if(amrnb_be){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_amr_init(TDAV_CODEC_AMR(amrnb_be), tdav_codec_amr_type_nb, tdav_codec_amr_mode_be);
- }
- return self;
+ tdav_codec_amr_t *amrnb_be = self;
+ if(amrnb_be) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_amr_init(TDAV_CODEC_AMR(amrnb_be), tdav_codec_amr_type_nb, tdav_codec_amr_mode_be);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_amrnb_be_dtor(tsk_object_t * self)
-{
- tdav_codec_amr_t *amrnb_be = self;
- if(amrnb_be){
- /* deinit base */
- tmedia_codec_audio_deinit(amrnb_be);
- /* deinit self */
- tdav_codec_amr_deinit(TDAV_CODEC_AMR(amrnb_be));
- }
-
- return self;
+{
+ tdav_codec_amr_t *amrnb_be = self;
+ if(amrnb_be) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(amrnb_be);
+ /* deinit self */
+ tdav_codec_amr_deinit(TDAV_CODEC_AMR(amrnb_be));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_amrnb_be_def_s =
-{
- sizeof(tdav_codec_amr_t),
- tdav_codec_amrnb_be_ctor,
- tdav_codec_amrnb_be_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_amrnb_be_def_s = {
+ sizeof(tdav_codec_amr_t),
+ tdav_codec_amrnb_be_ctor,
+ tdav_codec_amrnb_be_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_amrnb_be_plugin_def_s =
-{
- &tdav_codec_amrnb_be_def_s,
-
- tmedia_audio,
- tmedia_codec_id_amr_nb_be,
- "AMR",
- "AMR Narrow Band - Bandwidth-Efficient (libopencore-amr)",
- TMEDIA_CODEC_FORMAT_AMR_NB_BE,
- tsk_true,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_amrnb_open,
- tdav_codec_amrnb_close,
- tdav_codec_amrnb_encode,
- tdav_codec_amrnb_decode,
- tdav_codec_amrnb_sdp_att_match,
- tdav_codec_amrnb_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_amrnb_be_plugin_def_s = {
+ &tdav_codec_amrnb_be_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_amr_nb_be,
+ "AMR",
+ "AMR Narrow Band - Bandwidth-Efficient (libopencore-amr)",
+ TMEDIA_CODEC_FORMAT_AMR_NB_BE,
+ tsk_true,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_amrnb_open,
+ tdav_codec_amrnb_close,
+ tdav_codec_amrnb_encode,
+ tdav_codec_amrnb_decode,
+ tdav_codec_amrnb_sdp_att_match,
+ tdav_codec_amrnb_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_amrnb_be_plugin_def_t = &tdav_codec_amrnb_be_plugin_def_s;
@@ -335,137 +331,141 @@ const tmedia_codec_plugin_def_t *tdav_codec_amrnb_be_plugin_def_t = &tdav_codec_
static int tdav_codec_amr_init(tdav_codec_amr_t* self, tdav_codec_amr_type_t type, tdav_codec_amr_mode_t mode)
{
- if(self){
- self->type = type;
- self->mode = mode;
- self->encoder_mode = DEFAULT_ENC_MODE;
-
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
+ if(self) {
+ self->type = type;
+ self->mode = mode;
+ self->encoder_mode = DEFAULT_ENC_MODE;
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
}
static int tdav_codec_amr_deinit(tdav_codec_amr_t* self)
{
- if(self){
- switch(self->type){
- case tdav_codec_amr_type_nb:
- { /* AMR-NB */
- if(self->encoder){
- Encoder_Interface_exit(self->encoder);
- self->encoder = tsk_null;
- }
- if(self->decoder){
- Decoder_Interface_exit(self->decoder);
- self->decoder = tsk_null;
- }
- break;
- }
- case tdav_codec_amr_type_wb:
- { /* AMR-WB */
- break;
- }
- }
-
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
+ if(self) {
+ switch(self->type) {
+ case tdav_codec_amr_type_nb: {
+ /* AMR-NB */
+ if(self->encoder) {
+ Encoder_Interface_exit(self->encoder);
+ self->encoder = tsk_null;
+ }
+ if(self->decoder) {
+ Decoder_Interface_exit(self->decoder);
+ self->decoder = tsk_null;
+ }
+ break;
+ }
+ case tdav_codec_amr_type_wb: {
+ /* AMR-WB */
+ break;
+ }
+ }
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
}
static tdav_codec_amr_mode_t tdav_codec_amr_get_mode(const char* fmtp)
{
- /* RFC 4867 - 8.1. AMR Media Type Registration
- octet-align: Permissible values are 0 and 1. If 1, octet-aligned
- operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed.
- */
- tdav_codec_amr_mode_t mode = tdav_codec_amr_mode_be;
- tsk_size_t size = tsk_strlen(fmtp);
- int start, end;
-
- if((start = tsk_strindexOf(fmtp, size, "octet-align")) !=-1){
- tsk_param_t* param;
- if((end = tsk_strindexOf((fmtp+start), (size-start), ";")) == -1){
- end = size;
- }
- if((param = tsk_params_parse_param((fmtp+start), (end-start)))){
- if(param->value && tsk_strequals(param->value, "1")){
- mode = tdav_codec_amr_mode_oa;
- }
- TSK_OBJECT_SAFE_FREE(param);
- }
- }
- return mode;
+ /* RFC 4867 - 8.1. AMR Media Type Registration
+ octet-align: Permissible values are 0 and 1. If 1, octet-aligned
+ operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed.
+ */
+ tdav_codec_amr_mode_t mode = tdav_codec_amr_mode_be;
+ tsk_size_t size = tsk_strlen(fmtp);
+ int start, end;
+
+ if((start = tsk_strindexOf(fmtp, size, "octet-align")) !=-1) {
+ tsk_param_t* param;
+ if((end = tsk_strindexOf((fmtp+start), (size-start), ";")) == -1) {
+ end = size;
+ }
+ if((param = tsk_params_parse_param((fmtp+start), (end-start)))) {
+ if(param->value && tsk_strequals(param->value, "1")) {
+ mode = tdav_codec_amr_mode_oa;
+ }
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ }
+ return mode;
}
int tdav_codec_amr_parse_fmtp(tdav_codec_amr_t* self, const char* fmtp)
{
- int ret = 0;
- int val_int;
- const char* val_str;
- //--tdav_codec_amr_mode_t mode = self->mode;
- tsk_params_L_t* params = tsk_null;
-
- if((params = tsk_params_fromstring(fmtp, ";", tsk_true))){
- /* Do not check "octet-align" => already done by the caller of this function */
-
- /* === mode-set ===*/
- if((val_str = tsk_params_get_param_value(params, "mode-set"))){
- char* modes = tsk_strdup(val_str);
- char *pch, *saveptr;
- int mode_int;
- pch = tsk_strtok_r(modes, ", ", &saveptr);
- while(pch){
- mode_int = atoi(pch);
- self->modes |= 0x0001 << mode_int;
- pch = tsk_strtok_r(tsk_null, ", ", &saveptr);
- }
-
- TSK_FREE(modes);
- }
- else{
- self->modes = 0xFFFF;
- }
-
- /* === interleaving ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "interleaving")) != -1){
- TSK_DEBUG_WARN("interleaving not supported");
- ret = -1; goto bail;
- }
- /* === mode-change-period ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-period")) != -1){
- if(val_int != 1 && val_int != 2){
- TSK_DEBUG_ERROR("Invalid [mode-change-period]");
- ret = -1; goto bail;
- }
- self->mcp = (unsigned)val_int;
- }
- /* === mode-change-capability ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-capability")) != -1){
- if(val_int != 1 && val_int != 2){
- TSK_DEBUG_ERROR("Invalid [mode-change-capability]");
- ret = -1; goto bail;
- }
- self->mcc = (unsigned)val_int;
- }
- /* === mode-change-neighbor ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-neighbor")) != -1){
- if(val_int != 0 && val_int != 1){
- TSK_DEBUG_ERROR("Invalid [mode-change-neighbor]");
- ret = -1; goto bail;
- }
- self->mcn = (unsigned)val_int;
- }
- }
+ int ret = 0;
+ int val_int;
+ const char* val_str;
+ //--tdav_codec_amr_mode_t mode = self->mode;
+ tsk_params_L_t* params = tsk_null;
+
+ if((params = tsk_params_fromstring(fmtp, ";", tsk_true))) {
+ /* Do not check "octet-align" => already done by the caller of this function */
+
+ /* === mode-set ===*/
+ if((val_str = tsk_params_get_param_value(params, "mode-set"))) {
+ char* modes = tsk_strdup(val_str);
+ char *pch, *saveptr;
+ int mode_int;
+ pch = tsk_strtok_r(modes, ", ", &saveptr);
+ while(pch) {
+ mode_int = atoi(pch);
+ self->modes |= 0x0001 << mode_int;
+ pch = tsk_strtok_r(tsk_null, ", ", &saveptr);
+ }
+
+ TSK_FREE(modes);
+ }
+ else {
+ self->modes = 0xFFFF;
+ }
+
+ /* === interleaving ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "interleaving")) != -1) {
+ TSK_DEBUG_WARN("interleaving not supported");
+ ret = -1;
+ goto bail;
+ }
+ /* === mode-change-period ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-period")) != -1) {
+ if(val_int != 1 && val_int != 2) {
+ TSK_DEBUG_ERROR("Invalid [mode-change-period]");
+ ret = -1;
+ goto bail;
+ }
+ self->mcp = (unsigned)val_int;
+ }
+ /* === mode-change-capability ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-capability")) != -1) {
+ if(val_int != 1 && val_int != 2) {
+ TSK_DEBUG_ERROR("Invalid [mode-change-capability]");
+ ret = -1;
+ goto bail;
+ }
+ self->mcc = (unsigned)val_int;
+ }
+ /* === mode-change-neighbor ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "mode-change-neighbor")) != -1) {
+ if(val_int != 0 && val_int != 1) {
+ TSK_DEBUG_ERROR("Invalid [mode-change-neighbor]");
+ ret = -1;
+ goto bail;
+ }
+ self->mcn = (unsigned)val_int;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(params);
- return ret;
+ TSK_OBJECT_SAFE_FREE(params);
+ return ret;
}
@@ -487,330 +487,330 @@ bail:
static tsk_size_t tdav_codec_amr_be_encode(tdav_codec_amr_t* amr, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tsk_size_t out_size = 0, i;
- int ret_size;
- uint8_t ToC;
- static uint8_t CMR = NO_DATA /* No interleaving */;
-
- uint8_t outbuf[60 + 1]; /* enought for both NB and WB at ptime=20ms */
- if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_be)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* Encode */
- if((ret_size = Encoder_Interface_Encode(amr->encoder, amr->encoder_mode, in_data, outbuf, 0)) <= 0){
- TSK_DEBUG_ERROR("Encoder_Interface_Encode() failed");
- goto bail;
- }
-
-
- /* allocate output buffer */
- if((int)*out_max_size <ret_size){
- if(!(*out_data = tsk_realloc(*out_data, ret_size))){
- *out_max_size = 0;
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- goto bail;
- }
- *out_max_size = ret_size;
- }
-
- out_size = ret_size;
-
- /* CMR (4bits) */
- ((uint8_t*)*out_data)[0] = (CMR<<4);
- /* ToC (Always ONE Frame, don't need to test for [F]) (6bits)*/
- ToC = outbuf[0]>>2/*2*[P]*/;
- ((uint8_t*)*out_data)[0] |= (ToC >> 2/*[Q],[1-FT]*/) & 0xF; /* 4bits */
- ((uint8_t*)*out_data)[1] = (ToC & 0x3/*[1-FT],[Q]*/)<<6; /* 2bits */
-
- /* === THERE ARE 2 EXTRA BITS === */
-
- for(i=1; i<out_size-1; i++){
- ((uint8_t*)*out_data)[i] |= outbuf[i]>>2;/* 6bits */
- ((uint8_t*)*out_data)[i+1] = outbuf[i]<<6;/* 2bits */
- }
+{
+ tsk_size_t out_size = 0, i;
+ int ret_size;
+ uint8_t ToC;
+ static uint8_t CMR = NO_DATA /* No interleaving */;
+
+ uint8_t outbuf[60 + 1]; /* enought for both NB and WB at ptime=20ms */
+ if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_be)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* Encode */
+ if((ret_size = Encoder_Interface_Encode(amr->encoder, amr->encoder_mode, in_data, outbuf, 0)) <= 0) {
+ TSK_DEBUG_ERROR("Encoder_Interface_Encode() failed");
+ goto bail;
+ }
+
+
+ /* allocate output buffer */
+ if((int)*out_max_size <ret_size) {
+ if(!(*out_data = tsk_realloc(*out_data, ret_size))) {
+ *out_max_size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ goto bail;
+ }
+ *out_max_size = ret_size;
+ }
+
+ out_size = ret_size;
+
+ /* CMR (4bits) */
+ ((uint8_t*)*out_data)[0] = (CMR<<4);
+ /* ToC (Always ONE Frame, don't need to test for [F]) (6bits)*/
+ ToC = outbuf[0]>>2/*2*[P]*/;
+ ((uint8_t*)*out_data)[0] |= (ToC >> 2/*[Q],[1-FT]*/) & 0xF; /* 4bits */
+ ((uint8_t*)*out_data)[1] = (ToC & 0x3/*[1-FT],[Q]*/)<<6; /* 2bits */
+
+ /* === THERE ARE 2 EXTRA BITS === */
+
+ for(i=1; i<out_size-1; i++) {
+ ((uint8_t*)*out_data)[i] |= outbuf[i]>>2;/* 6bits */
+ ((uint8_t*)*out_data)[i+1] = outbuf[i]<<6;/* 2bits */
+ }
bail:
- return out_size;
+ return out_size;
}
tsk_size_t tdav_codec_amr_be_decode(tdav_codec_amr_t* amr, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size = 0, pcm_frame_size = 0, index = 0;
- const uint8_t* pdata = (const uint8_t*)in_data;
- //--const uint8_t* pend = (pdata + in_size);
- uint8_t CMR;
- int toc_entries = 0, i, k; // ToC entries count
-
- if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_be)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* compute PCM frame size */
- switch(TDAV_CODEC_AMR(amr)->type){
- case tdav_codec_amr_type_nb:
- pcm_frame_size = 160 * sizeof(short);
- break;
- case tdav_codec_amr_type_wb:
- pcm_frame_size = 320 * sizeof(short);
- break;
- default:
- TSK_DEBUG_ERROR("Invalid AMR type");
- return 0;
- }
-
- /* CMR (4bits) */
- CMR = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), index, 4);
- index += 4;
- if(CMR != NO_DATA){
- amr->encoder_mode = (enum Mode)CMR;
- }
-
- /* F(1bit), FT(4bits), Q(1bit) */
- /* count ToC entries */
- do{ /* At least ONE ToC */
- ++toc_entries;
- ++pdata;
- index += 6;
- }
- while((index < (in_size*8)) && (tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), (index-6), 1)/* F */));
-
- for(i = 0; (i<toc_entries && (in_size < (in_size*8))) ; i++){
- int size = -1;
- uint8_t* speech_data = tsk_null;
- //--int speech_data_size = 0;
- uint8_t ToC = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), 4/*CMR*/ + (i*6), 6);
-
- switch(TDAV_CODEC_AMR(amr)->type){
- case tdav_codec_amr_type_nb:
- size = tdav_codec_amr_nb_sizes[(ToC>>1)&0x0F/* FT */];
- break;
- case tdav_codec_amr_type_wb:
- size = tdav_codec_amr_wb_sizes[(ToC>>1)&0x0F/* FT */];
- break;
- }
-
- if((speech_data = tsk_calloc((size + 2/* ToC + '\0' */), sizeof(uint8_t)))){
- /* copy ToC */
- speech_data[0] = (ToC & 0x1F)<<2/* 2*[P] */; /* ToC as OA layout */
- /* copy speech data */
- for(k=0; k<size; k++){
- speech_data[1 + k] = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), index, 8);
- index+=8;
- if((k==size-1) && (index%8)){
- speech_data[1 + k] <<= (8-(index%8)); //clean
- }
- }
-
- /* allocate/reallocate speech data */
- if(*out_max_size <(out_size + pcm_frame_size)){
- if(!(*out_data = tsk_realloc(*out_data, (out_size + pcm_frame_size)))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- TSK_FREE(speech_data);
- goto bail;
- }
- *out_max_size = out_size + pcm_frame_size;
- }
-
- /* decode speech data */
- Decoder_Interface_Decode(amr->decoder, speech_data, &((short*)*out_data)[out_size/sizeof(short)], 0);
- out_size += pcm_frame_size, pdata+= size;
-
- TSK_FREE(speech_data);
- }
- }
+ tsk_size_t out_size = 0, pcm_frame_size = 0, index = 0;
+ const uint8_t* pdata = (const uint8_t*)in_data;
+ //--const uint8_t* pend = (pdata + in_size);
+ uint8_t CMR;
+ int toc_entries = 0, i, k; // ToC entries count
+
+ if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_be)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* compute PCM frame size */
+ switch(TDAV_CODEC_AMR(amr)->type) {
+ case tdav_codec_amr_type_nb:
+ pcm_frame_size = 160 * sizeof(short);
+ break;
+ case tdav_codec_amr_type_wb:
+ pcm_frame_size = 320 * sizeof(short);
+ break;
+ default:
+ TSK_DEBUG_ERROR("Invalid AMR type");
+ return 0;
+ }
+
+ /* CMR (4bits) */
+ CMR = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), index, 4);
+ index += 4;
+ if(CMR != NO_DATA) {
+ amr->encoder_mode = (enum Mode)CMR;
+ }
+
+ /* F(1bit), FT(4bits), Q(1bit) */
+ /* count ToC entries */
+ do { /* At least ONE ToC */
+ ++toc_entries;
+ ++pdata;
+ index += 6;
+ }
+ while((index < (in_size*8)) && (tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), (index-6), 1)/* F */));
+
+ for(i = 0; (i<toc_entries && (in_size < (in_size*8))) ; i++) {
+ int size = -1;
+ uint8_t* speech_data = tsk_null;
+ //--int speech_data_size = 0;
+ uint8_t ToC = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), 4/*CMR*/ + (i*6), 6);
+
+ switch(TDAV_CODEC_AMR(amr)->type) {
+ case tdav_codec_amr_type_nb:
+ size = tdav_codec_amr_nb_sizes[(ToC>>1)&0x0F/* FT */];
+ break;
+ case tdav_codec_amr_type_wb:
+ size = tdav_codec_amr_wb_sizes[(ToC>>1)&0x0F/* FT */];
+ break;
+ }
+
+ if((speech_data = tsk_calloc((size + 2/* ToC + '\0' */), sizeof(uint8_t)))) {
+ /* copy ToC */
+ speech_data[0] = (ToC & 0x1F)<<2/* 2*[P] */; /* ToC as OA layout */
+ /* copy speech data */
+ for(k=0; k<size; k++) {
+ speech_data[1 + k] = tdav_codec_amr_bitbuffer_read(in_data, (in_size*8), index, 8);
+ index+=8;
+ if((k==size-1) && (index%8)) {
+ speech_data[1 + k] <<= (8-(index%8)); //clean
+ }
+ }
+
+ /* allocate/reallocate speech data */
+ if(*out_max_size <(out_size + pcm_frame_size)) {
+ if(!(*out_data = tsk_realloc(*out_data, (out_size + pcm_frame_size)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ TSK_FREE(speech_data);
+ goto bail;
+ }
+ *out_max_size = out_size + pcm_frame_size;
+ }
+
+ /* decode speech data */
+ Decoder_Interface_Decode(amr->decoder, speech_data, &((short*)*out_data)[out_size/sizeof(short)], 0);
+ out_size += pcm_frame_size, pdata+= size;
+
+ TSK_FREE(speech_data);
+ }
+ }
bail:
- return out_size;
+ return out_size;
}
static tsk_size_t tdav_codec_amr_oa_encode(tdav_codec_amr_t* amr, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tsk_size_t out_size = 0;
- int ret_size;
- static uint8_t CMR = NO_DATA /* No interleaving */;
-
- uint8_t outbuf[60 + 1]; /* enought for both NB and WB at ptime=20ms */
- if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_oa)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* Encode */
- if((ret_size = Encoder_Interface_Encode(amr->encoder, amr->encoder_mode, in_data, outbuf, 0)) <= 0){
- TSK_DEBUG_ERROR("Encoder_Interface_Encode() failed");
- goto bail;
- }
-
- out_size = ret_size + 1 /* CMR without interleaving */;
- /* allocate output buffer */
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = out_size = 0;
- goto bail;
- }
- *out_max_size = out_size;
- }
-
- /* CMR */
- ((uint8_t*)*out_data)[0] = (CMR << 4);
- /* Only ONE ToC --> believe me */
- memcpy(&((uint8_t*)*out_data)[1], outbuf, ret_size);
+{
+ tsk_size_t out_size = 0;
+ int ret_size;
+ static uint8_t CMR = NO_DATA /* No interleaving */;
+
+ uint8_t outbuf[60 + 1]; /* enought for both NB and WB at ptime=20ms */
+ if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_oa)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* Encode */
+ if((ret_size = Encoder_Interface_Encode(amr->encoder, amr->encoder_mode, in_data, outbuf, 0)) <= 0) {
+ TSK_DEBUG_ERROR("Encoder_Interface_Encode() failed");
+ goto bail;
+ }
+
+ out_size = ret_size + 1 /* CMR without interleaving */;
+ /* allocate output buffer */
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = out_size = 0;
+ goto bail;
+ }
+ *out_max_size = out_size;
+ }
+
+ /* CMR */
+ ((uint8_t*)*out_data)[0] = (CMR << 4);
+ /* Only ONE ToC --> believe me */
+ memcpy(&((uint8_t*)*out_data)[1], outbuf, ret_size);
bail:
- return out_size;
+ return out_size;
}
static tsk_size_t tdav_codec_amr_oa_decode(tdav_codec_amr_t* amr, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size = 0, pcm_frame_size = 0;
- const uint8_t* pdata = (const uint8_t*)in_data;
- const uint8_t* pend = (pdata + in_size);
- uint8_t CMR;
- int toc_entries = 0, i; // ToC entries count
-
- if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_oa)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* compute PCM frame size */
- switch(TDAV_CODEC_AMR(amr)->type){
- case tdav_codec_amr_type_nb:
- pcm_frame_size = 160 * sizeof(short);
- break;
- case tdav_codec_amr_type_wb:
- pcm_frame_size = 320 * sizeof(short);
- break;
- default:
- TSK_DEBUG_ERROR("Invalid AMR type");
- return 0;
- }
-
- /* RFC 4867 - 4.4. Octet-Aligned Mode
- In octet-aligned mode, the payload header consists of a 4-bit CMR, 4
- reserved bits, and optionally, an 8-bit interleaving header, as shown
- below:
-
- 0 1
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- +-+-+-+-+-+-+-+-+- - - - - - - -
- | CMR |R|R|R|R| ILL | ILP |
- +-+-+-+-+-+-+-+-+- - - - - - - -
-
- CMR (4 bits): same as defined in Section 4.3.1.
-
- "interleaving" not supported ==> could ignore ILL and ILP (wich are optional)
- */
-
- CMR = (*pdata++ >> 4);
- if(CMR != NO_DATA){
- /* The codec mode request received in the CMR field is valid until the
- next codec mode request is received, i.e., a newly received CMR value
- corresponding to a speech mode, or NO_DATA overrides the previously
- received CMR value corresponding to a speech mode or NO_DATA. */
- amr->encoder_mode = (enum Mode)CMR; // As we support all modes, do not check for validity
- }
-
- /*
- A ToC entry takes the following format in octet-aligned mode:
- 0 1 2 3 4 5 6 7
- +-+-+-+-+-+-+-+-+
- |F| FT |Q|P|P|
- +-+-+-+-+-+-+-+-+
-
- F (1 bit): see definition in Section 4.3.2.
- FT (4 bits, unsigned integer): see definition in Section 4.3.2.
- Q (1 bit): see definition in Section 4.3.2.
- P bits: padding bits, MUST be set to zero, and MUST be ignored on reception.
- */
-
- /* count ToC entries */
- do{ /* At least ONE ToC */
- ++toc_entries;
- ++pdata;
- }
- while(pdata && (pdata < pend) && (pdata[-1] >> 7/* F */));
-
- for(i = 0; (i<toc_entries && (pdata < pend)) ; i++){
- int size = -1;
- uint8_t* speech_data = tsk_null;
- //--int speech_data_size = 0;
- uint8_t ToC = ((const uint8_t*)in_data)[1/*CMR...*/ + i];
- switch(TDAV_CODEC_AMR(amr)->type){
- case tdav_codec_amr_type_nb:
- size = tdav_codec_amr_nb_sizes[(ToC>>3) & 0x0F/* FT */];
- break;
- case tdav_codec_amr_type_wb:
- size = tdav_codec_amr_wb_sizes[(ToC>>3) & 0x0F/* FT */];
- break;
- }
-
- /* check size */
- if(size <0 || ((pdata + size) > pend)){
- TSK_DEBUG_ERROR("Invalid size");
- break;
- }
-
- if((speech_data = tsk_calloc((size + 2/* ToC + '\0' */), sizeof(uint8_t)))){
- /* copy ToC */
- *speech_data = ToC & 0x7F/* with 'F'=0 */;
- /* copy speech data */
- memcpy((speech_data + 1), pdata, size);
- /* allocate/reallocate speech data */
- if(*out_max_size <(out_size + pcm_frame_size)){
- if(!(*out_data = tsk_realloc(*out_data, (out_size + pcm_frame_size)))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- TSK_FREE(speech_data);
- goto bail;
- }
- *out_max_size = (out_size + pcm_frame_size);
- }
- /* decode speech data */
- Decoder_Interface_Decode(amr->decoder, speech_data, &((short*)*out_data)[out_size/sizeof(short)], 0);
- out_size += pcm_frame_size, pdata+= size;
-
- TSK_FREE(speech_data);
- }
- }
+ tsk_size_t out_size = 0, pcm_frame_size = 0;
+ const uint8_t* pdata = (const uint8_t*)in_data;
+ const uint8_t* pend = (pdata + in_size);
+ uint8_t CMR;
+ int toc_entries = 0, i; // ToC entries count
+
+ if(!amr || !in_data || !in_size || !out_data || (amr->mode != tdav_codec_amr_mode_oa)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* compute PCM frame size */
+ switch(TDAV_CODEC_AMR(amr)->type) {
+ case tdav_codec_amr_type_nb:
+ pcm_frame_size = 160 * sizeof(short);
+ break;
+ case tdav_codec_amr_type_wb:
+ pcm_frame_size = 320 * sizeof(short);
+ break;
+ default:
+ TSK_DEBUG_ERROR("Invalid AMR type");
+ return 0;
+ }
+
+ /* RFC 4867 - 4.4. Octet-Aligned Mode
+ In octet-aligned mode, the payload header consists of a 4-bit CMR, 4
+ reserved bits, and optionally, an 8-bit interleaving header, as shown
+ below:
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +-+-+-+-+-+-+-+-+- - - - - - - -
+ | CMR |R|R|R|R| ILL | ILP |
+ +-+-+-+-+-+-+-+-+- - - - - - - -
+
+ CMR (4 bits): same as defined in Section 4.3.1.
+
+ "interleaving" not supported ==> could ignore ILL and ILP (wich are optional)
+ */
+
+ CMR = (*pdata++ >> 4);
+ if(CMR != NO_DATA) {
+ /* The codec mode request received in the CMR field is valid until the
+ next codec mode request is received, i.e., a newly received CMR value
+ corresponding to a speech mode, or NO_DATA overrides the previously
+ received CMR value corresponding to a speech mode or NO_DATA. */
+ amr->encoder_mode = (enum Mode)CMR; // As we support all modes, do not check for validity
+ }
+
+ /*
+ A ToC entry takes the following format in octet-aligned mode:
+ 0 1 2 3 4 5 6 7
+ +-+-+-+-+-+-+-+-+
+ |F| FT |Q|P|P|
+ +-+-+-+-+-+-+-+-+
+
+ F (1 bit): see definition in Section 4.3.2.
+ FT (4 bits, unsigned integer): see definition in Section 4.3.2.
+ Q (1 bit): see definition in Section 4.3.2.
+ P bits: padding bits, MUST be set to zero, and MUST be ignored on reception.
+ */
+
+ /* count ToC entries */
+ do { /* At least ONE ToC */
+ ++toc_entries;
+ ++pdata;
+ }
+ while(pdata && (pdata < pend) && (pdata[-1] >> 7/* F */));
+
+ for(i = 0; (i<toc_entries && (pdata < pend)) ; i++) {
+ int size = -1;
+ uint8_t* speech_data = tsk_null;
+ //--int speech_data_size = 0;
+ uint8_t ToC = ((const uint8_t*)in_data)[1/*CMR...*/ + i];
+ switch(TDAV_CODEC_AMR(amr)->type) {
+ case tdav_codec_amr_type_nb:
+ size = tdav_codec_amr_nb_sizes[(ToC>>3) & 0x0F/* FT */];
+ break;
+ case tdav_codec_amr_type_wb:
+ size = tdav_codec_amr_wb_sizes[(ToC>>3) & 0x0F/* FT */];
+ break;
+ }
+
+ /* check size */
+ if(size <0 || ((pdata + size) > pend)) {
+ TSK_DEBUG_ERROR("Invalid size");
+ break;
+ }
+
+ if((speech_data = tsk_calloc((size + 2/* ToC + '\0' */), sizeof(uint8_t)))) {
+ /* copy ToC */
+ *speech_data = ToC & 0x7F/* with 'F'=0 */;
+ /* copy speech data */
+ memcpy((speech_data + 1), pdata, size);
+ /* allocate/reallocate speech data */
+ if(*out_max_size <(out_size + pcm_frame_size)) {
+ if(!(*out_data = tsk_realloc(*out_data, (out_size + pcm_frame_size)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ TSK_FREE(speech_data);
+ goto bail;
+ }
+ *out_max_size = (out_size + pcm_frame_size);
+ }
+ /* decode speech data */
+ Decoder_Interface_Decode(amr->decoder, speech_data, &((short*)*out_data)[out_size/sizeof(short)], 0);
+ out_size += pcm_frame_size, pdata+= size;
+
+ TSK_FREE(speech_data);
+ }
+ }
bail:
- return out_size;
+ return out_size;
}
static uint8_t tdav_codec_amr_bitbuffer_read(const void* bits, tsk_size_t size, tsk_size_t start, tsk_size_t count)
{
- uint8_t byte, left, right, pad;
-
- if(!bits || !size || count>8){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if((start + count) > size){
- count = (size - start);
- }
-
- pad = start ? (8 - (start % 8)) : count;
- left = ((uint8_t*)bits)[start/8] << (8-pad);
- right = ((uint8_t*)bits)[((start+count)<size ? (start+count) : start)/8] >> pad;
-
- if((start && (start % 8) != ((start+count)%8)) || (!start && count>8)){
- /* overlap */
- byte = (left | right) >> (8-count);
- }
- else{
- byte = (left | right) & (0xFF >> (8-count));
- }
-
- return byte;
+ uint8_t byte, left, right, pad;
+
+ if(!bits || !size || count>8) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if((start + count) > size) {
+ count = (size - start);
+ }
+
+ pad = start ? (8 - (start % 8)) : count;
+ left = ((uint8_t*)bits)[start/8] << (8-pad);
+ right = ((uint8_t*)bits)[((start+count)<size ? (start+count) : start)/8] >> pad;
+
+ if((start && (start % 8) != ((start+count)%8)) || (!start && count>8)) {
+ /* overlap */
+ byte = (left | right) >> (8-count);
+ }
+ else {
+ byte = (left | right) & (0xFF >> (8-count));
+ }
+
+ return byte;
}
#endif /* HAVE_OPENCORE_AMR */
diff --git a/tinyDAV/src/codecs/bfcp/tdav_codec_bfcp.c b/tinyDAV/src/codecs/bfcp/tdav_codec_bfcp.c
index 3495295..5588410 100755
--- a/tinyDAV/src/codecs/bfcp/tdav_codec_bfcp.c
+++ b/tinyDAV/src/codecs/bfcp/tdav_codec_bfcp.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,8 +35,9 @@
#define tdav_codec_bfcp_decode tsk_null
static tsk_bool_t tdav_codec_bfcp_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -47,58 +48,56 @@ static tsk_bool_t tdav_codec_bfcp_sdp_att_match(const tmedia_codec_t* codec, con
/* constructor */
static tsk_object_t* tdav_codec_bfcp_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_bfcp_t *bfcp = self;
- if (bfcp) {
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_bfcp_t *bfcp = self;
+ if (bfcp) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_bfcp_dtor(tsk_object_t * self)
-{
- tdav_codec_bfcp_t *bfcp = self;
- if (bfcp) {
- /* deinit base */
- tmedia_codec_bfcp_deinit(bfcp);
- /* deinit self */
- }
+{
+ tdav_codec_bfcp_t *bfcp = self;
+ if (bfcp) {
+ /* deinit base */
+ tmedia_codec_bfcp_deinit(bfcp);
+ /* deinit self */
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_bfcp_def_s =
-{
- sizeof(tdav_codec_bfcp_t),
- tdav_codec_bfcp_ctor,
- tdav_codec_bfcp_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_bfcp_def_s = {
+ sizeof(tdav_codec_bfcp_t),
+ tdav_codec_bfcp_ctor,
+ tdav_codec_bfcp_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_bfcp_plugin_def_s =
-{
- &tdav_codec_bfcp_def_s,
+static const tmedia_codec_plugin_def_t tdav_codec_bfcp_plugin_def_s = {
+ &tdav_codec_bfcp_def_s,
+
+ tmedia_bfcp,
+ tmedia_codec_id_none, // fake codec without real id
+ "application",
+ "BFCP fake codec",
+ TMEDIA_CODEC_FORMAT_BFCP,
+ tsk_false,
+ 0, // rate
- tmedia_bfcp,
- tmedia_codec_id_none, // fake codec without real id
- "application",
- "BFCP fake codec",
- TMEDIA_CODEC_FORMAT_BFCP,
- tsk_false,
- 0, // rate
-
- /* audio */
- {0},
+ /* audio */
+ {0},
- /* video */
- {0},
+ /* video */
+ {0},
- tsk_null, // set()
- tdav_codec_bfcp_open,
- tdav_codec_bfcp_close,
- tdav_codec_bfcp_encode,
- tdav_codec_bfcp_decode,
- tdav_codec_bfcp_sdp_att_match,
- tdav_codec_bfcp_sdp_att_get
+ tsk_null, // set()
+ tdav_codec_bfcp_open,
+ tdav_codec_bfcp_close,
+ tdav_codec_bfcp_encode,
+ tdav_codec_bfcp_decode,
+ tdav_codec_bfcp_sdp_att_match,
+ tdav_codec_bfcp_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_bfcp_plugin_def_t = &tdav_codec_bfcp_plugin_def_s;
diff --git a/tinyDAV/src/codecs/bv/tdav_codec_bv16.c b/tinyDAV/src/codecs/bv/tdav_codec_bv16.c
index 21850fb..26e27e6 100755
--- a/tinyDAV/src/codecs/bv/tdav_codec_bv16.c
+++ b/tinyDAV/src/codecs/bv/tdav_codec_bv16.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,11 +49,11 @@
#else
#include "bitpack.h"
#endif
-#include "memutil.h"
+#include "memutil.h"
/* RFC 4298 - 3.1. BroadVoice16 Bit Stream Definition */
#define TDAV_BV16_FRAME_SIZE 10
-#define FRSZ_IN_U8 (FRSZ*2)
+#define FRSZ_IN_U8 (FRSZ*2)
/* ============ BV16 Plugin interface ================= */
@@ -65,118 +65,119 @@ static int sizebitstream = sizeof(struct BV16_Bit_Stream);
int tdav_codec_bv16_open(tmedia_codec_t* self)
{
- tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
-
- if(!bv16->encoder.state){
- bv16->encoder.state = allocWord16(0, sizestate/2-1);
- Reset_BV16_Encoder((struct BV16_Encoder_State*)bv16->encoder.state);
- }
- if(!bv16->encoder.bs){
- bv16->encoder.bs = allocWord16(0, sizebitstream/2-1);
- }
- if(!bv16->encoder.x){
- bv16->encoder.x = allocWord16(0, FRSZ-1);
- }
-
- if(!bv16->decoder.state){
- bv16->decoder.state = allocWord16(0, sizestate/2-1);
- Reset_BV16_Decoder((struct BV16_Decoder_State*)bv16->decoder.state);
- }
- if(!bv16->decoder.bs){
- bv16->decoder.bs = allocWord16(0, sizebitstream/2-1);
- }
- if(!bv16->decoder.x){
- bv16->decoder.x = allocWord16(0, FRSZ-1);
- }
-
- return 0;
+ tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
+
+ if(!bv16->encoder.state) {
+ bv16->encoder.state = allocWord16(0, sizestate/2-1);
+ Reset_BV16_Encoder((struct BV16_Encoder_State*)bv16->encoder.state);
+ }
+ if(!bv16->encoder.bs) {
+ bv16->encoder.bs = allocWord16(0, sizebitstream/2-1);
+ }
+ if(!bv16->encoder.x) {
+ bv16->encoder.x = allocWord16(0, FRSZ-1);
+ }
+
+ if(!bv16->decoder.state) {
+ bv16->decoder.state = allocWord16(0, sizestate/2-1);
+ Reset_BV16_Decoder((struct BV16_Decoder_State*)bv16->decoder.state);
+ }
+ if(!bv16->decoder.bs) {
+ bv16->decoder.bs = allocWord16(0, sizebitstream/2-1);
+ }
+ if(!bv16->decoder.x) {
+ bv16->decoder.x = allocWord16(0, FRSZ-1);
+ }
+
+ return 0;
}
int tdav_codec_bv16_close(tmedia_codec_t* self)
{
- tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
-
- if(bv16->encoder.state){
- deallocWord16(bv16->encoder.state, 0, sizestate/2-1);
- bv16->encoder.state = tsk_null;
- }
- if(bv16->encoder.bs){
- deallocWord16(bv16->encoder.bs, 0, sizebitstream/2-1);
- bv16->encoder.bs = tsk_null;
- }
- if(bv16->encoder.x){
- deallocWord16(bv16->encoder.x, 0, FRSZ-1);
- bv16->encoder.x = tsk_null;
- }
-
- if(bv16->decoder.state){
- deallocWord16(bv16->decoder.state, 0, sizestate/2-1);
- bv16->decoder.state = tsk_null;
- }
- if(bv16->encoder.bs){
- deallocWord16(bv16->decoder.bs, 0, sizebitstream/2-1);
- bv16->decoder.bs = tsk_null;
- }
- if(bv16->decoder.x){
- deallocWord16(bv16->decoder.x, 0, FRSZ-1);
- bv16->decoder.x = tsk_null;
- }
-
-
-
- return 0;
+ tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
+
+ if(bv16->encoder.state) {
+ deallocWord16(bv16->encoder.state, 0, sizestate/2-1);
+ bv16->encoder.state = tsk_null;
+ }
+ if(bv16->encoder.bs) {
+ deallocWord16(bv16->encoder.bs, 0, sizebitstream/2-1);
+ bv16->encoder.bs = tsk_null;
+ }
+ if(bv16->encoder.x) {
+ deallocWord16(bv16->encoder.x, 0, FRSZ-1);
+ bv16->encoder.x = tsk_null;
+ }
+
+ if(bv16->decoder.state) {
+ deallocWord16(bv16->decoder.state, 0, sizestate/2-1);
+ bv16->decoder.state = tsk_null;
+ }
+ if(bv16->encoder.bs) {
+ deallocWord16(bv16->decoder.bs, 0, sizebitstream/2-1);
+ bv16->decoder.bs = tsk_null;
+ }
+ if(bv16->decoder.x) {
+ deallocWord16(bv16->decoder.x, 0, FRSZ-1);
+ bv16->decoder.x = tsk_null;
+ }
+
+
+
+ return 0;
}
tsk_size_t tdav_codec_bv16_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- //tsk_size_t out_size = 0;
- tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
+{
+ //tsk_size_t out_size = 0;
+ tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- return 0;
+ return 0;
}
tsk_size_t tdav_codec_bv16_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size = 0;
- int i;
- tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
- uint8_t mama[600];
-
- if(!self || !in_data || !in_size || !out_data || (in_size % TDAV_BV16_FRAME_SIZE)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- for(i=0; i<(int)in_size; i+=TDAV_BV16_FRAME_SIZE){
- BV16_BitUnPack(mama, (struct BV16_Bit_Stream*)bv16->decoder.bs);
- //BV16_BitUnPack(&((UWord8 *)in_data)[i], (struct BV16_Bit_Stream*)bv16->decoder.bs);
- BV16_Decode((struct BV16_Bit_Stream*)bv16->decoder.bs, (struct BV16_Decoder_State*)bv16->decoder.state, bv16->decoder.x);
-
-
- if(*out_max_size<(out_size + FRSZ_IN_U8)){
- if(!(*out_data = tsk_realloc(*out_data, (out_size + FRSZ_IN_U8)))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = (out_size + FRSZ_IN_U8);
- }
- memcpy(&((uint8_t*)* out_data)[out_size], bv16->decoder.x, FRSZ_IN_U8);
- out_size += FRSZ_IN_U8;
- }
-
-
- return out_size;
+ tsk_size_t out_size = 0;
+ int i;
+ tdav_codec_bv16_t* bv16 = (tdav_codec_bv16_t*)self;
+ uint8_t mama[600];
+
+ if(!self || !in_data || !in_size || !out_data || (in_size % TDAV_BV16_FRAME_SIZE)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ for(i=0; i<(int)in_size; i+=TDAV_BV16_FRAME_SIZE) {
+ BV16_BitUnPack(mama, (struct BV16_Bit_Stream*)bv16->decoder.bs);
+ //BV16_BitUnPack(&((UWord8 *)in_data)[i], (struct BV16_Bit_Stream*)bv16->decoder.bs);
+ BV16_Decode((struct BV16_Bit_Stream*)bv16->decoder.bs, (struct BV16_Decoder_State*)bv16->decoder.state, bv16->decoder.x);
+
+
+ if(*out_max_size<(out_size + FRSZ_IN_U8)) {
+ if(!(*out_data = tsk_realloc(*out_data, (out_size + FRSZ_IN_U8)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = (out_size + FRSZ_IN_U8);
+ }
+ memcpy(&((uint8_t*)* out_data)[out_size], bv16->decoder.x, FRSZ_IN_U8);
+ out_size += FRSZ_IN_U8;
+ }
+
+
+ return out_size;
}
tsk_bool_t tdav_codec_bv16_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -187,62 +188,60 @@ tsk_bool_t tdav_codec_bv16_sdp_att_match(const tmedia_codec_t* codec, const char
/* constructor */
static tsk_object_t* tdav_codec_bv16_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_bv16_t *bv16 = self;
- if(bv16){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_bv16_t *bv16 = self;
+ if(bv16) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_bv16_dtor(tsk_object_t * self)
-{
- tdav_codec_bv16_t *bv16 = self;
- if(bv16){
- /* deinit base */
- tmedia_codec_audio_deinit(bv16);
- /* deinit self */
-
- }
-
- return self;
+{
+ tdav_codec_bv16_t *bv16 = self;
+ if(bv16) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(bv16);
+ /* deinit self */
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_bv16_def_s =
-{
- sizeof(tdav_codec_bv16_t),
- tdav_codec_bv16_ctor,
- tdav_codec_bv16_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_bv16_def_s = {
+ sizeof(tdav_codec_bv16_t),
+ tdav_codec_bv16_ctor,
+ tdav_codec_bv16_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_bv16_plugin_def_s =
-{
- &tdav_codec_bv16_def_s,
-
- tmedia_audio,
- tmedia_codec_id_bv16,
- "BV16",
- "BroadVoice16 Rate",
- TMEDIA_CODEC_FORMAT_BV16,
- tsk_true,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tdav_codec_bv16_open,
- tdav_codec_bv16_close,
- tdav_codec_bv16_encode,
- tdav_codec_bv16_decode,
- tdav_codec_bv16_sdp_att_match,
- tdav_codec_bv16_sdp_att_get,
- tdav_codec_bv16_fmtp_set
+static const tmedia_codec_plugin_def_t tdav_codec_bv16_plugin_def_s = {
+ &tdav_codec_bv16_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_bv16,
+ "BV16",
+ "BroadVoice16 Rate",
+ TMEDIA_CODEC_FORMAT_BV16,
+ tsk_true,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tdav_codec_bv16_open,
+ tdav_codec_bv16_close,
+ tdav_codec_bv16_encode,
+ tdav_codec_bv16_decode,
+ tdav_codec_bv16_sdp_att_match,
+ tdav_codec_bv16_sdp_att_get,
+ tdav_codec_bv16_fmtp_set
};
const tmedia_codec_plugin_def_t *tdav_codec_bv16_plugin_def_t = &tdav_codec_bv16_plugin_def_s;
diff --git a/tinyDAV/src/codecs/dtmf/tdav_codec_dtmf.c b/tinyDAV/src/codecs/dtmf/tdav_codec_dtmf.c
index 103ac8d..6fec2d4 100755
--- a/tinyDAV/src/codecs/dtmf/tdav_codec_dtmf.c
+++ b/tinyDAV/src/codecs/dtmf/tdav_codec_dtmf.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,25 +38,26 @@
tsk_size_t tdav_codec_dtmf_fmtp_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- return 0;
+ return 0;
}
tsk_size_t tdav_codec_dtmf_fmtp_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- return 0;
+ return 0;
}
char* tdav_codec_dtmf_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- if(tsk_striequals(att_name, "fmtp")){
- return tsk_strdup("0-16");
- }
- return tsk_null;
+ if(tsk_striequals(att_name, "fmtp")) {
+ return tsk_strdup("0-16");
+ }
+ return tsk_null;
}
tsk_bool_t tdav_codec_dtmf_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -67,60 +68,58 @@ tsk_bool_t tdav_codec_dtmf_sdp_att_match(const tmedia_codec_t* codec, const char
/* constructor */
static tsk_object_t* tdav_codec_dtmf_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_dtmf_t *dtmf = self;
- if(dtmf){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_dtmf_t *dtmf = self;
+ if(dtmf) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_dtmf_dtor(tsk_object_t * self)
-{
- tdav_codec_dtmf_t *dtmf = self;
- if(dtmf){
- /* deinit base */
- tmedia_codec_audio_deinit(dtmf);
- /* deinit self */
- }
-
- return self;
+{
+ tdav_codec_dtmf_t *dtmf = self;
+ if(dtmf) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(dtmf);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_dtmf_def_s =
-{
- sizeof(tdav_codec_dtmf_t),
- tdav_codec_dtmf_ctor,
- tdav_codec_dtmf_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_dtmf_def_s = {
+ sizeof(tdav_codec_dtmf_t),
+ tdav_codec_dtmf_ctor,
+ tdav_codec_dtmf_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_dtmf_plugin_def_s =
-{
- &tdav_codec_dtmf_def_s,
-
- tmedia_audio,
- tmedia_codec_id_none, // fake codec without real identifier
- "telephone-event",
- "DTMF Codec (RFC 4733)",
- TMEDIA_CODEC_FORMAT_DTMF,
- tsk_true,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 20 // ptime
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tsk_null, // open
- tsk_null, // close
- tdav_codec_dtmf_fmtp_encode,
- tdav_codec_dtmf_fmtp_decode,
- tdav_codec_dtmf_sdp_att_match,
- tdav_codec_dtmf_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_dtmf_plugin_def_s = {
+ &tdav_codec_dtmf_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_none, // fake codec without real identifier
+ "telephone-event",
+ "DTMF Codec (RFC 4733)",
+ TMEDIA_CODEC_FORMAT_DTMF,
+ tsk_true,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 20 // ptime
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tsk_null, // open
+ tsk_null, // close
+ tdav_codec_dtmf_fmtp_encode,
+ tdav_codec_dtmf_fmtp_decode,
+ tdav_codec_dtmf_sdp_att_match,
+ tdav_codec_dtmf_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_dtmf_plugin_def_t = &tdav_codec_dtmf_plugin_def_s;
diff --git a/tinyDAV/src/codecs/fec/tdav_codec_red.c b/tinyDAV/src/codecs/fec/tdav_codec_red.c
index 2fb6f27..cf92173 100755
--- a/tinyDAV/src/codecs/fec/tdav_codec_red.c
+++ b/tinyDAV/src/codecs/fec/tdav_codec_red.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,171 +31,174 @@
#include "tsk_time.h"
#include "tsk_debug.h"
-typedef struct tdav_codec_red_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tdav_codec_red_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
- tdav_codec_red_rtppacket_cb_f callback;
- const void* callback_data;
+ tdav_codec_red_rtppacket_cb_f callback;
+ const void* callback_data;
}
tdav_codec_red_t;
int tdav_codec_red_set_callback(tdav_codec_red_t *self, tdav_codec_red_rtppacket_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->callback = callback;
- self->callback_data = callback_data;
+ self->callback = callback;
+ self->callback_data = callback_data;
- return 0;
+ return 0;
}
static int tdav_codec_red_open(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static int tdav_codec_red_close(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_red_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tdav_codec_red_t *red = (tdav_codec_red_t *)self;
- tsk_size_t xsize = (in_size + 1);
- static const uint8_t __first_octet = 0x00; // F=1, PT=0. Up to the caller to update this first octet with the right PT.
-
- if(!red || !in_data || !in_size || !out_data || !out_max_size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(*out_max_size < xsize){
- if(!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to realloc data");
- *out_max_size = 0;
- }
- *out_max_size = xsize;
- }
-
- ((uint8_t*)*out_data)[0] = __first_octet;
- memcpy(&((uint8_t*)*out_data)[1], in_data, in_size);
-
- return xsize;
+ tdav_codec_red_t *red = (tdav_codec_red_t *)self;
+ tsk_size_t xsize = (in_size + 1);
+ static const uint8_t __first_octet = 0x00; // F=1, PT=0. Up to the caller to update this first octet with the right PT.
+
+ if(!red || !in_data || !in_size || !out_data || !out_max_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(*out_max_size < xsize) {
+ if(!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to realloc data");
+ *out_max_size = 0;
+ }
+ *out_max_size = xsize;
+ }
+
+ ((uint8_t*)*out_data)[0] = __first_octet;
+ memcpy(&((uint8_t*)*out_data)[1], in_data, in_size);
+
+ return xsize;
}
static tsk_size_t tdav_codec_red_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_red_t* red = (tdav_codec_red_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
- trtp_rtp_packet_t* red_rtp_pkt = tsk_null;
- const uint8_t* pdata = in_data;
- const uint8_t* red_hdr = in_data;
- tsk_size_t red_hdrs_count, i;
- tsk_bool_t last;
- uint8_t F;
- uint16_t timestamp_offset, block_length;
-
- if(!red || !in_data || (in_size < TDAV_CODEC_RED_MIN_PKT_SIZE)|| !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!red->callback){
- TSK_DEBUG_WARN("Not callback installed for RED data");
- return 0;
- }
-
- if((F = (pdata[0] & 0x80)) == 0){
- i = 1;
- red_hdrs_count = 1;
- }
- else{
- for(i = 0, red_hdrs_count = 0; i < in_size; i+= 4, ++red_hdrs_count){
- if((F = (pdata[i] & 0x80)) == 0){ ++i; ++red_hdrs_count; break; }
- }
- }
-
- if(i >= in_size){
- TSK_DEBUG_ERROR("Invalid data");
- return 0;
- }
-
- pdata += i;
- in_size -= i;
-
- for(i = 0; i < red_hdrs_count && in_size > 0; ++i){
- TSK_OBJECT_SAFE_FREE(red_rtp_pkt);
- if(!(red_rtp_pkt = trtp_rtp_packet_create_null())){
- TSK_DEBUG_ERROR("Failed to create RTP packet");
- continue;
- }
- if(!(red_rtp_pkt->header = trtp_rtp_header_create(rtp_hdr->ssrc, rtp_hdr->seq_num, rtp_hdr->timestamp, rtp_hdr->payload_type, rtp_hdr->marker))){
- TSK_DEBUG_ERROR("Failed to create RTP header");
- continue;
- }
-
- // Must create an RTP packet for each RED chunck as they will be saved in the JB
- last = (i == (red_hdrs_count - 1));
- F = (red_hdr[0] & 0x80);
- red_rtp_pkt->header->payload_type = (red_hdr[0] & 0x7F);
-
- if(last || !F){
- /*
- 0 1 2 3 4 5 6 7
+ tdav_codec_red_t* red = (tdav_codec_red_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+ trtp_rtp_packet_t* red_rtp_pkt = tsk_null;
+ const uint8_t* pdata = in_data;
+ const uint8_t* red_hdr = in_data;
+ tsk_size_t red_hdrs_count, i;
+ tsk_bool_t last;
+ uint8_t F;
+ uint16_t timestamp_offset, block_length;
+
+ if(!red || !in_data || (in_size < TDAV_CODEC_RED_MIN_PKT_SIZE)|| !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!red->callback) {
+ TSK_DEBUG_WARN("Not callback installed for RED data");
+ return 0;
+ }
+
+ if((F = (pdata[0] & 0x80)) == 0) {
+ i = 1;
+ red_hdrs_count = 1;
+ }
+ else {
+ for(i = 0, red_hdrs_count = 0; i < in_size; i+= 4, ++red_hdrs_count) {
+ if((F = (pdata[i] & 0x80)) == 0) {
+ ++i;
+ ++red_hdrs_count;
+ break;
+ }
+ }
+ }
+
+ if(i >= in_size) {
+ TSK_DEBUG_ERROR("Invalid data");
+ return 0;
+ }
+
+ pdata += i;
+ in_size -= i;
+
+ for(i = 0; i < red_hdrs_count && in_size > 0; ++i) {
+ TSK_OBJECT_SAFE_FREE(red_rtp_pkt);
+ if(!(red_rtp_pkt = trtp_rtp_packet_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create RTP packet");
+ continue;
+ }
+ if(!(red_rtp_pkt->header = trtp_rtp_header_create(rtp_hdr->ssrc, rtp_hdr->seq_num, rtp_hdr->timestamp, rtp_hdr->payload_type, rtp_hdr->marker))) {
+ TSK_DEBUG_ERROR("Failed to create RTP header");
+ continue;
+ }
+
+ // Must create an RTP packet for each RED chunck as they will be saved in the JB
+ last = (i == (red_hdrs_count - 1));
+ F = (red_hdr[0] & 0x80);
+ red_rtp_pkt->header->payload_type = (red_hdr[0] & 0x7F);
+
+ if(last || !F) {
+ /*
+ 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|0| Block PT |
+-+-+-+-+-+-+-+-+
- */
- block_length = (uint16_t)in_size;
- }
- else{
- /*
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |1| block PT=7 | timestamp offset | block length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- timestamp_offset = ((red_hdr[1] << 8) | red_hdr[2]) >> 2;
- block_length = ((red_hdr[2] & 0x03) << 8) | red_hdr[3];
- if(block_length > in_size){
- TSK_DEBUG_ERROR("Invalid 'block length'");
- break;
- }
- red_rtp_pkt->header->timestamp += timestamp_offset;
- red_hdr += 4;
- }
-
- // decode
- if(red->callback){
- // do not use "data_const" as payload will be saved in the jitter buffer and decoded later (async)
- if((red_rtp_pkt->payload.data = tsk_malloc(block_length))){
- memcpy(red_rtp_pkt->payload.data, pdata, block_length);
- red_rtp_pkt->payload.size = block_length;
- red->callback(red->callback_data, red_rtp_pkt);
- }
- }
-
- pdata += block_length;
- in_size -= block_length;
- }
-
- TSK_OBJECT_SAFE_FREE(red_rtp_pkt);
-
- return 0; // must be always zero
+ */
+ block_length = (uint16_t)in_size;
+ }
+ else {
+ /*
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |1| block PT=7 | timestamp offset | block length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ timestamp_offset = ((red_hdr[1] << 8) | red_hdr[2]) >> 2;
+ block_length = ((red_hdr[2] & 0x03) << 8) | red_hdr[3];
+ if(block_length > in_size) {
+ TSK_DEBUG_ERROR("Invalid 'block length'");
+ break;
+ }
+ red_rtp_pkt->header->timestamp += timestamp_offset;
+ red_hdr += 4;
+ }
+
+ // decode
+ if(red->callback) {
+ // do not use "data_const" as payload will be saved in the jitter buffer and decoded later (async)
+ if((red_rtp_pkt->payload.data = tsk_malloc(block_length))) {
+ memcpy(red_rtp_pkt->payload.data, pdata, block_length);
+ red_rtp_pkt->payload.size = block_length;
+ red->callback(red->callback_data, red_rtp_pkt);
+ }
+ }
+
+ pdata += block_length;
+ in_size -= block_length;
+ }
+
+ TSK_OBJECT_SAFE_FREE(red_rtp_pkt);
+
+ return 0; // must be always zero
}
static tsk_bool_t tdav_codec_red_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- return tsk_true;
+ return tsk_true;
}
static char* tdav_codec_red_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- return tsk_null;
+ return tsk_null;
}
@@ -204,60 +207,58 @@ static char* tdav_codec_red_sdp_att_get(const tmedia_codec_t* self, const char*
/* constructor */
static tsk_object_t* tdav_codec_red_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_red_t *red = self;
- if(red){
- /* init base: called by tmedia_codec_create() */
- /* init self */
-
- }
- return self;
+ tdav_codec_red_t *red = self;
+ if(red) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_red_dtor(tsk_object_t * self)
-{
- tdav_codec_red_t *red = self;
- if(red){
- /* deinit base */
- tmedia_codec_video_deinit(red);
- /* deinit self */
-
- }
-
- return self;
+{
+ tdav_codec_red_t *red = self;
+ if(red) {
+ /* deinit base */
+ tmedia_codec_video_deinit(red);
+ /* deinit self */
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_red_def_s =
-{
- sizeof(tdav_codec_red_t),
- tdav_codec_red_ctor,
- tdav_codec_red_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_red_def_s = {
+ sizeof(tdav_codec_red_t),
+ tdav_codec_red_ctor,
+ tdav_codec_red_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_red_plugin_def_s =
-{
- &tdav_codec_red_def_s,
-
- (/* tmedia_video | tmedia_audio | */tmedia_t140), // FIXME: for now is only supported with T.140
- tmedia_codec_id_red,
- "red",
- "red codec",
- TMEDIA_CODEC_FORMAT_RED,
- tsk_true,
- 1000, // rate: FIXME: for now it's only for T.140
-
- /* audio */
- { 0 },
-
- /* video (defaul width,height,fps) */
- {176, 144, 15},
-
- tsk_null, // set()
- tdav_codec_red_open,
- tdav_codec_red_close,
- tdav_codec_red_encode,
- tdav_codec_red_decode,
- tdav_codec_red_sdp_att_match,
- tdav_codec_red_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_red_plugin_def_s = {
+ &tdav_codec_red_def_s,
+
+ (/* tmedia_video | tmedia_audio | */tmedia_t140), // FIXME: for now is only supported with T.140
+ tmedia_codec_id_red,
+ "red",
+ "red codec",
+ TMEDIA_CODEC_FORMAT_RED,
+ tsk_true,
+ 1000, // rate: FIXME: for now it's only for T.140
+
+ /* audio */
+ { 0 },
+
+ /* video (defaul width,height,fps) */
+ {176, 144, 15},
+
+ tsk_null, // set()
+ tdav_codec_red_open,
+ tdav_codec_red_close,
+ tdav_codec_red_encode,
+ tdav_codec_red_decode,
+ tdav_codec_red_sdp_att_match,
+ tdav_codec_red_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_red_plugin_def_t = &tdav_codec_red_plugin_def_s;
diff --git a/tinyDAV/src/codecs/fec/tdav_codec_ulpfec.c b/tinyDAV/src/codecs/fec/tdav_codec_ulpfec.c
index f492a52..0e78b6a 100755
--- a/tinyDAV/src/codecs/fec/tdav_codec_ulpfec.c
+++ b/tinyDAV/src/codecs/fec/tdav_codec_ulpfec.c
@@ -31,57 +31,54 @@
#define TDAV_FEC_PKT_HDR_SIZE 10
-typedef struct tdav_codec_ulpfec_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tdav_codec_ulpfec_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
- struct{
- struct tdav_fec_pkt_s* pkt;
- } encoder;
+ struct {
+ struct tdav_fec_pkt_s* pkt;
+ } encoder;
}
tdav_codec_ulpfec_t;
//
// FEC LEVEL
//
-typedef struct tdav_fec_level_s
-{
- TSK_DECLARE_OBJECT;
-
- struct{ // 7.4. FEC Level Header for FEC Packets
- uint16_t length;
- uint64_t mask;
- tsk_size_t mask_size; // in bits
- } hdr;
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- }payload;
-}tdav_fec_level_t;
+typedef struct tdav_fec_level_s {
+ TSK_DECLARE_OBJECT;
+
+ struct { // 7.4. FEC Level Header for FEC Packets
+ uint16_t length;
+ uint64_t mask;
+ tsk_size_t mask_size; // in bits
+ } hdr;
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } payload;
+} tdav_fec_level_t;
typedef tsk_list_t tdav_fec_levels_L_t;
static tsk_object_t* tdav_fec_level_ctor(tsk_object_t * self, va_list * app)
{
- tdav_fec_level_t *level = self;
- if (level){
- level->hdr.mask_size = 16; // L=0
- }
- return self;
+ tdav_fec_level_t *level = self;
+ if (level) {
+ level->hdr.mask_size = 16; // L=0
+ }
+ return self;
}
static tsk_object_t* tdav_fec_level_dtor(tsk_object_t * self)
{
- tdav_fec_level_t *level = self;
- if (level){
- TSK_FREE(level->payload.ptr);
- }
+ tdav_fec_level_t *level = self;
+ if (level) {
+ TSK_FREE(level->payload.ptr);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tdav_fec_level_def_s =
-{
- sizeof(tdav_fec_level_t),
- tdav_fec_level_ctor,
- tdav_fec_level_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_fec_level_def_s = {
+ sizeof(tdav_fec_level_t),
+ tdav_fec_level_ctor,
+ tdav_fec_level_dtor,
+ tsk_null,
};
const tsk_object_def_t *tdav_fec_level_def_t = &tdav_fec_level_def_s;
@@ -89,271 +86,274 @@ const tsk_object_def_t *tdav_fec_level_def_t = &tdav_fec_level_def_s;
//
// FEC PACKET
//
-typedef struct tdav_fec_pkt_s
-{
- TSK_DECLARE_OBJECT;
-
- struct{ // RFC 5109 - 7.3. FEC Header for FEC Packets
- unsigned E : 1;
- unsigned L : 1;
- unsigned P : 1;
- unsigned X : 1;
- unsigned CC : 4;
- unsigned M : 1;
- unsigned PT : 7;
- struct{
- uint16_t value;
- unsigned set : 1;
- }SN_base;
- uint32_t TS;
- uint16_t length;
- }hdr;
-
- tdav_fec_levels_L_t* levels;
+typedef struct tdav_fec_pkt_s {
+ TSK_DECLARE_OBJECT;
+
+ struct { // RFC 5109 - 7.3. FEC Header for FEC Packets
+ unsigned E : 1;
+ unsigned L : 1;
+ unsigned P : 1;
+ unsigned X : 1;
+ unsigned CC : 4;
+ unsigned M : 1;
+ unsigned PT : 7;
+ struct {
+ uint16_t value;
+ unsigned set : 1;
+ } SN_base;
+ uint32_t TS;
+ uint16_t length;
+ } hdr;
+
+ tdav_fec_levels_L_t* levels;
}
tdav_fec_pkt_t;
static tsk_object_t* tdav_fec_pkt_ctor(tsk_object_t * self, va_list * app)
{
- tdav_fec_pkt_t *pkt = self;
- if (pkt){
- if (!(pkt->levels = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create levels");
- return tsk_null;
- }
- }
- return self;
+ tdav_fec_pkt_t *pkt = self;
+ if (pkt) {
+ if (!(pkt->levels = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create levels");
+ return tsk_null;
+ }
+ }
+ return self;
}
static tsk_object_t* tdav_fec_pkt_dtor(tsk_object_t * self)
{
- tdav_fec_pkt_t *pkt = self;
- if (pkt){
- TSK_OBJECT_SAFE_FREE(pkt->levels);
- }
+ tdav_fec_pkt_t *pkt = self;
+ if (pkt) {
+ TSK_OBJECT_SAFE_FREE(pkt->levels);
+ }
- return self;
+ return self;
}
static int tdav_fec_pkt_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
{
- const tdav_fec_pkt_t *p1 = _p1;
- const tdav_fec_pkt_t *p2 = _p2;
-
- if (p1 && p2){
- return (int)(p1->hdr.SN_base.value - p2->hdr.SN_base.value);
- }
- else if (!p1 && !p2) return 0;
- else return -1;
+ const tdav_fec_pkt_t *p1 = _p1;
+ const tdav_fec_pkt_t *p2 = _p2;
+
+ if (p1 && p2) {
+ return (int)(p1->hdr.SN_base.value - p2->hdr.SN_base.value);
+ }
+ else if (!p1 && !p2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tdav_fec_pkt_def_s =
-{
- sizeof(tdav_fec_pkt_t),
- tdav_fec_pkt_ctor,
- tdav_fec_pkt_dtor,
- tdav_fec_pkt_cmp,
+static const tsk_object_def_t tdav_fec_pkt_def_s = {
+ sizeof(tdav_fec_pkt_t),
+ tdav_fec_pkt_ctor,
+ tdav_fec_pkt_dtor,
+ tdav_fec_pkt_cmp,
};
const tsk_object_def_t *tdav_fec_pkt_def_t = &tdav_fec_pkt_def_s;
tsk_size_t tdav_codec_ulpfec_guess_serialbuff_size(const tdav_codec_ulpfec_t* self)
{
- tsk_size_t size = TDAV_FEC_PKT_HDR_SIZE;
- tsk_list_item_t *item;
- tdav_fec_level_t* level;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_list_foreach(item, self->encoder.pkt->levels){
- if (!(level = item->data)){
- continue;
- }
- size += 2 /* Protection length */ + (level->hdr.mask_size >> 3) + level->hdr.length;
- }
-
- return size;
+ tsk_size_t size = TDAV_FEC_PKT_HDR_SIZE;
+ tsk_list_item_t *item;
+ tdav_fec_level_t* level;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_list_foreach(item, self->encoder.pkt->levels) {
+ if (!(level = item->data)) {
+ continue;
+ }
+ size += 2 /* Protection length */ + (level->hdr.mask_size >> 3) + level->hdr.length;
+ }
+
+ return size;
}
int tdav_codec_ulpfec_enc_reset(tdav_codec_ulpfec_t* self)
{
- tsk_list_item_t *item;
- tdav_fec_level_t* level;
-
- if (!self || !self->encoder.pkt){
- TSK_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- // reset packet
- memset(&self->encoder.pkt->hdr, 0, sizeof(self->encoder.pkt->hdr));
-
- // reset levels
- tsk_list_foreach(item, self->encoder.pkt->levels){
- if ((level = item->data)){
- memset(&level->hdr, 0, sizeof(level->hdr));
- if (level->payload.ptr){
- memset(level->payload.ptr, 0, level->payload.size);
- }
- }
- }
- return 0;
+ tsk_list_item_t *item;
+ tdav_fec_level_t* level;
+
+ if (!self || !self->encoder.pkt) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ // reset packet
+ memset(&self->encoder.pkt->hdr, 0, sizeof(self->encoder.pkt->hdr));
+
+ // reset levels
+ tsk_list_foreach(item, self->encoder.pkt->levels) {
+ if ((level = item->data)) {
+ memset(&level->hdr, 0, sizeof(level->hdr));
+ if (level->payload.ptr) {
+ memset(level->payload.ptr, 0, level->payload.size);
+ }
+ }
+ }
+ return 0;
}
int tdav_codec_ulpfec_enc_protect(tdav_codec_ulpfec_t* self, const trtp_rtp_packet_t* rtp_packet)
{
- if (!self || !self->encoder.pkt || !rtp_packet || !rtp_packet->header){
- TSK_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- // Packet
- self->encoder.pkt->hdr.P ^= rtp_packet->header->padding;
- self->encoder.pkt->hdr.X ^= rtp_packet->header->extension;
- self->encoder.pkt->hdr.CC ^= rtp_packet->header->csrc_count;
- self->encoder.pkt->hdr.M ^= rtp_packet->header->marker;
- self->encoder.pkt->hdr.PT ^= rtp_packet->header->payload_type;
- if (!self->encoder.pkt->hdr.SN_base.set){
- self->encoder.pkt->hdr.SN_base.value = rtp_packet->header->seq_num;
- self->encoder.pkt->hdr.SN_base.set = 1;
- }
- else{
- self->encoder.pkt->hdr.SN_base.value = TSK_MIN(self->encoder.pkt->hdr.SN_base.value, rtp_packet->header->seq_num);
- }
- self->encoder.pkt->hdr.TS ^= rtp_packet->header->timestamp;
- self->encoder.pkt->hdr.length ^= (trtp_rtp_packet_guess_serialbuff_size(rtp_packet) - TRTP_RTP_HEADER_MIN_SIZE);
-
- // Level
- // For now, always single-level protection
- {
- tdav_fec_level_t* level0 = TSK_LIST_FIRST_DATA(self->encoder.pkt->levels);
- const uint8_t* rtp_payload = (const uint8_t*)(rtp_packet->payload.data_const ? rtp_packet->payload.data_const : rtp_packet->payload.data);
- tsk_size_t i;
- if (!level0){
- tdav_fec_level_t* _level0;
- if (!(_level0 = tsk_object_new(tdav_fec_level_def_t))){
- TSK_DEBUG_ERROR("Failed to create level");
- return -2;
- }
- level0 = _level0;
- tsk_list_push_back_data(self->encoder.pkt->levels, (void**)&_level0);
- }
- if (level0->payload.size < rtp_packet->payload.size){
- if (!(level0->payload.ptr = tsk_realloc(level0->payload.ptr, rtp_packet->payload.size))){
- TSK_DEBUG_ERROR("Failed to realloc size %d", rtp_packet->payload.size);
- level0->payload.size = 0;
- return -3;
- }
- level0->payload.size = rtp_packet->payload.size;
- }
- for (i = 0; i < rtp_packet->payload.size; ++i){
- level0->payload.ptr[i] ^= rtp_payload[i];
- }
- level0->hdr.mask_size = self->encoder.pkt->hdr.L ? 48 : 16;
- level0->hdr.mask |= (uint64_t)((uint64_t)1 << (level0->hdr.mask_size - (rtp_packet->header->seq_num - self->encoder.pkt->hdr.SN_base.value)));
- level0->hdr.length = (uint16_t)(TSK_MAX(level0->hdr.length, rtp_packet->payload.size));
- }
-
- return 0;
+ if (!self || !self->encoder.pkt || !rtp_packet || !rtp_packet->header) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ // Packet
+ self->encoder.pkt->hdr.P ^= rtp_packet->header->padding;
+ self->encoder.pkt->hdr.X ^= rtp_packet->header->extension;
+ self->encoder.pkt->hdr.CC ^= rtp_packet->header->csrc_count;
+ self->encoder.pkt->hdr.M ^= rtp_packet->header->marker;
+ self->encoder.pkt->hdr.PT ^= rtp_packet->header->payload_type;
+ if (!self->encoder.pkt->hdr.SN_base.set) {
+ self->encoder.pkt->hdr.SN_base.value = rtp_packet->header->seq_num;
+ self->encoder.pkt->hdr.SN_base.set = 1;
+ }
+ else {
+ self->encoder.pkt->hdr.SN_base.value = TSK_MIN(self->encoder.pkt->hdr.SN_base.value, rtp_packet->header->seq_num);
+ }
+ self->encoder.pkt->hdr.TS ^= rtp_packet->header->timestamp;
+ self->encoder.pkt->hdr.length ^= (trtp_rtp_packet_guess_serialbuff_size(rtp_packet) - TRTP_RTP_HEADER_MIN_SIZE);
+
+ // Level
+ // For now, always single-level protection
+ {
+ tdav_fec_level_t* level0 = TSK_LIST_FIRST_DATA(self->encoder.pkt->levels);
+ const uint8_t* rtp_payload = (const uint8_t*)(rtp_packet->payload.data_const ? rtp_packet->payload.data_const : rtp_packet->payload.data);
+ tsk_size_t i;
+ if (!level0) {
+ tdav_fec_level_t* _level0;
+ if (!(_level0 = tsk_object_new(tdav_fec_level_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create level");
+ return -2;
+ }
+ level0 = _level0;
+ tsk_list_push_back_data(self->encoder.pkt->levels, (void**)&_level0);
+ }
+ if (level0->payload.size < rtp_packet->payload.size) {
+ if (!(level0->payload.ptr = tsk_realloc(level0->payload.ptr, rtp_packet->payload.size))) {
+ TSK_DEBUG_ERROR("Failed to realloc size %d", rtp_packet->payload.size);
+ level0->payload.size = 0;
+ return -3;
+ }
+ level0->payload.size = rtp_packet->payload.size;
+ }
+ for (i = 0; i < rtp_packet->payload.size; ++i) {
+ level0->payload.ptr[i] ^= rtp_payload[i];
+ }
+ level0->hdr.mask_size = self->encoder.pkt->hdr.L ? 48 : 16;
+ level0->hdr.mask |= (uint64_t)((uint64_t)1 << (level0->hdr.mask_size - (rtp_packet->header->seq_num - self->encoder.pkt->hdr.SN_base.value)));
+ level0->hdr.length = (uint16_t)(TSK_MAX(level0->hdr.length, rtp_packet->payload.size));
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_ulpfec_enc_serialize(const tdav_codec_ulpfec_t* self, void** out_data, tsk_size_t* out_max_size)
{
- uint8_t* pdata;
- tsk_size_t xsize;
- int32_t i;
- tsk_list_item_t* item;
- tdav_fec_level_t* level;
-
- if (!self || !self->encoder.pkt || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- xsize = tdav_codec_ulpfec_guess_serialbuff_size(self);
-
- if (*out_max_size < xsize){
- if (!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to reallocate buffer with size =%d", xsize);
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = xsize;
- }
- pdata = (uint8_t*)*out_data;
-
- // E(1), L(1), P(1), X(1), CC(4)
- pdata[0] =
- (self->encoder.pkt->hdr.E << 7) |
- (self->encoder.pkt->hdr.L << 6) |
- (self->encoder.pkt->hdr.P << 5) |
- (self->encoder.pkt->hdr.X << 4) |
- (self->encoder.pkt->hdr.CC & 0x0F);
- // M(1), PT(7)
- pdata[1] = (self->encoder.pkt->hdr.M << 7) | (self->encoder.pkt->hdr.PT & 0x7F);
- // SN base (16)
- pdata[2] = (self->encoder.pkt->hdr.SN_base.value >> 8);
- pdata[3] = (self->encoder.pkt->hdr.SN_base.value & 0xFF);
- // TS (32)
- pdata[4] = self->encoder.pkt->hdr.TS >> 24;
- pdata[5] = (self->encoder.pkt->hdr.TS >> 16) & 0xFF;
- pdata[6] = (self->encoder.pkt->hdr.TS >> 8) & 0xFF;
- pdata[7] = (self->encoder.pkt->hdr.TS & 0xFF);
- // Length (16)
- pdata[8] = (self->encoder.pkt->hdr.length >> 8);
- pdata[9] = (self->encoder.pkt->hdr.length & 0xFF);
-
- pdata += 10;
-
- tsk_list_foreach(item, self->encoder.pkt->levels){
- if (!(level = item->data)){
- continue;
- }
- // Protection length (16)
- pdata[0] = (level->hdr.length >> 8);
- pdata[1] = (level->hdr.length & 0xFF);
- pdata += 2;
- // mask (16 or 48)
- for (i = (int32_t)(level->hdr.mask_size - 8); i >= 0; i -= 8){
- *pdata = ((level->hdr.mask >> i) & 0xFF); ++pdata;
- }
- // payload
- memcpy(pdata, level->payload.ptr, level->hdr.length);
- }
-
- return xsize;
+ uint8_t* pdata;
+ tsk_size_t xsize;
+ int32_t i;
+ tsk_list_item_t* item;
+ tdav_fec_level_t* level;
+
+ if (!self || !self->encoder.pkt || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ xsize = tdav_codec_ulpfec_guess_serialbuff_size(self);
+
+ if (*out_max_size < xsize) {
+ if (!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to reallocate buffer with size =%d", xsize);
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = xsize;
+ }
+ pdata = (uint8_t*)*out_data;
+
+ // E(1), L(1), P(1), X(1), CC(4)
+ pdata[0] =
+ (self->encoder.pkt->hdr.E << 7) |
+ (self->encoder.pkt->hdr.L << 6) |
+ (self->encoder.pkt->hdr.P << 5) |
+ (self->encoder.pkt->hdr.X << 4) |
+ (self->encoder.pkt->hdr.CC & 0x0F);
+ // M(1), PT(7)
+ pdata[1] = (self->encoder.pkt->hdr.M << 7) | (self->encoder.pkt->hdr.PT & 0x7F);
+ // SN base (16)
+ pdata[2] = (self->encoder.pkt->hdr.SN_base.value >> 8);
+ pdata[3] = (self->encoder.pkt->hdr.SN_base.value & 0xFF);
+ // TS (32)
+ pdata[4] = self->encoder.pkt->hdr.TS >> 24;
+ pdata[5] = (self->encoder.pkt->hdr.TS >> 16) & 0xFF;
+ pdata[6] = (self->encoder.pkt->hdr.TS >> 8) & 0xFF;
+ pdata[7] = (self->encoder.pkt->hdr.TS & 0xFF);
+ // Length (16)
+ pdata[8] = (self->encoder.pkt->hdr.length >> 8);
+ pdata[9] = (self->encoder.pkt->hdr.length & 0xFF);
+
+ pdata += 10;
+
+ tsk_list_foreach(item, self->encoder.pkt->levels) {
+ if (!(level = item->data)) {
+ continue;
+ }
+ // Protection length (16)
+ pdata[0] = (level->hdr.length >> 8);
+ pdata[1] = (level->hdr.length & 0xFF);
+ pdata += 2;
+ // mask (16 or 48)
+ for (i = (int32_t)(level->hdr.mask_size - 8); i >= 0; i -= 8) {
+ *pdata = ((level->hdr.mask >> i) & 0xFF);
+ ++pdata;
+ }
+ // payload
+ memcpy(pdata, level->payload.ptr, level->hdr.length);
+ }
+
+ return xsize;
}
static int tdav_codec_ulpfec_open(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static int tdav_codec_ulpfec_close(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_ulpfec_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- TSK_DEBUG_ERROR("Not expected to be called");
- return 0;
+ TSK_DEBUG_ERROR("Not expected to be called");
+ return 0;
}
static tsk_size_t tdav_codec_ulpfec_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- TSK_DEBUG_ERROR("Not expected to be called");
- return 0;
+ TSK_DEBUG_ERROR("Not expected to be called");
+ return 0;
}
static tsk_bool_t tdav_codec_ulpfec_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- return tsk_true;
+ return tsk_true;
}
static char* tdav_codec_ulpfec_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- return tsk_null;
+ return tsk_null;
}
@@ -362,63 +362,61 @@ static char* tdav_codec_ulpfec_sdp_att_get(const tmedia_codec_t* self, const cha
/* constructor */
static tsk_object_t* tdav_codec_ulpfec_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_ulpfec_t *ulpfec = self;
- if (ulpfec){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if (!(ulpfec->encoder.pkt = tsk_object_new(tdav_fec_pkt_def_t))){
- TSK_DEBUG_ERROR("Failed to create FEC packet");
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_ulpfec_t *ulpfec = self;
+ if (ulpfec) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if (!(ulpfec->encoder.pkt = tsk_object_new(tdav_fec_pkt_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create FEC packet");
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_ulpfec_dtor(tsk_object_t * self)
{
- tdav_codec_ulpfec_t *ulpfec = self;
- if (ulpfec){
- /* deinit base */
- tmedia_codec_video_deinit(ulpfec);
- /* deinit self */
- TSK_OBJECT_SAFE_FREE(ulpfec->encoder.pkt);
- }
-
- return self;
+ tdav_codec_ulpfec_t *ulpfec = self;
+ if (ulpfec) {
+ /* deinit base */
+ tmedia_codec_video_deinit(ulpfec);
+ /* deinit self */
+ TSK_OBJECT_SAFE_FREE(ulpfec->encoder.pkt);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_ulpfec_def_s =
-{
- sizeof(tdav_codec_ulpfec_t),
- tdav_codec_ulpfec_ctor,
- tdav_codec_ulpfec_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_ulpfec_def_s = {
+ sizeof(tdav_codec_ulpfec_t),
+ tdav_codec_ulpfec_ctor,
+ tdav_codec_ulpfec_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_ulpfec_plugin_def_s =
-{
- &tdav_codec_ulpfec_def_s,
-
- tmedia_video,
- tmedia_codec_id_none, // fake codec
- "ulpfec",
- "ulpfec codec",
- TMEDIA_CODEC_FORMAT_ULPFEC,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (defaul width,height,fps) */
- { 176, 144, 15 },
-
- tsk_null, // set()
- tdav_codec_ulpfec_open,
- tdav_codec_ulpfec_close,
- tdav_codec_ulpfec_encode,
- tdav_codec_ulpfec_decode,
- tdav_codec_ulpfec_sdp_att_match,
- tdav_codec_ulpfec_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_ulpfec_plugin_def_s = {
+ &tdav_codec_ulpfec_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_none, // fake codec
+ "ulpfec",
+ "ulpfec codec",
+ TMEDIA_CODEC_FORMAT_ULPFEC,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (defaul width,height,fps) */
+ { 176, 144, 15 },
+
+ tsk_null, // set()
+ tdav_codec_ulpfec_open,
+ tdav_codec_ulpfec_close,
+ tdav_codec_ulpfec_encode,
+ tdav_codec_ulpfec_decode,
+ tdav_codec_ulpfec_sdp_att_match,
+ tdav_codec_ulpfec_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_ulpfec_plugin_def_t = &tdav_codec_ulpfec_plugin_def_s; \ No newline at end of file
diff --git a/tinyDAV/src/codecs/g711/g711.c b/tinyDAV/src/codecs/g711/g711.c
index fa7c8be..cd599dc 100755
--- a/tinyDAV/src/codecs/g711/g711.c
+++ b/tinyDAV/src/codecs/g711/g711.c
@@ -40,7 +40,7 @@
* bli@cpk.auc.dk
*
*/
-
+
#include "tinydav/codecs/g711/g711.h"
#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */
@@ -50,63 +50,68 @@
#define SEG_MASK (0x70) /* Segment field mask. */
static short seg_aend[8] = {0x1F, 0x3F, 0x7F, 0xFF,
- 0x1FF, 0x3FF, 0x7FF, 0xFFF};
+ 0x1FF, 0x3FF, 0x7FF, 0xFFF
+ };
static short seg_uend[8] = {0x3F, 0x7F, 0xFF, 0x1FF,
- 0x3FF, 0x7FF, 0xFFF, 0x1FFF};
+ 0x3FF, 0x7FF, 0xFFF, 0x1FFF
+ };
/* copy from CCITT G.711 specifications */
unsigned char _u2a[128] = { /* u- to A-law conversions */
- 1, 1, 2, 2, 3, 3, 4, 4,
- 5, 5, 6, 6, 7, 7, 8, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 27, 29, 31, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44,
- 46, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62,
- 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
-/* corrected:
- 81, 82, 83, 84, 85, 86, 87, 88,
- should be: */
- 80, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, 128};
+ 1, 1, 2, 2, 3, 3, 4, 4,
+ 5, 5, 6, 6, 7, 7, 8, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 27, 29, 31, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44,
+ 46, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62,
+ 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79,
+ /* corrected:
+ 81, 82, 83, 84, 85, 86, 87, 88,
+ should be: */
+ 80, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 126, 127, 128
+};
unsigned char _a2u[128] = { /* A- to u-law conversions */
- 1, 3, 5, 7, 9, 11, 13, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 32, 33, 33, 34, 34, 35, 35,
- 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 48, 49, 49,
- 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 64,
- 65, 66, 67, 68, 69, 70, 71, 72,
-/* corrected:
- 73, 74, 75, 76, 77, 78, 79, 79,
- should be: */
- 73, 74, 75, 76, 77, 78, 79, 80,
+ 1, 3, 5, 7, 9, 11, 13, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 32, 33, 33, 34, 34, 35, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 48, 49, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72,
+ /* corrected:
+ 73, 74, 75, 76, 77, 78, 79, 79,
+ should be: */
+ 73, 74, 75, 76, 77, 78, 79, 80,
- 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127};
+ 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111,
+ 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127
+};
static short search(short val, short *table, short size)
{
- short i;
+ short i;
- for (i = 0; i < size; i++) {
- if (val <= *table++)
- return (i);
- }
- return (size);
+ for (i = 0; i < size; i++) {
+ if (val <= *table++) {
+ return (i);
+ }
+ }
+ return (size);
}
/*
@@ -130,34 +135,38 @@ static short search(short val, short *table, short size)
*/
unsigned char linear2alaw(short pcm_val) /* 2's complement (16-bit range) */
{
- short mask;
- short seg;
- unsigned char aval;
+ short mask;
+ short seg;
+ unsigned char aval;
- pcm_val = pcm_val >> 3;
+ pcm_val = pcm_val >> 3;
- if (pcm_val >= 0) {
- mask = 0xD5; /* sign (7th) bit = 1 */
- } else {
- mask = 0x55; /* sign bit = 0 */
- pcm_val = -pcm_val - 1;
- }
+ if (pcm_val >= 0) {
+ mask = 0xD5; /* sign (7th) bit = 1 */
+ }
+ else {
+ mask = 0x55; /* sign bit = 0 */
+ pcm_val = -pcm_val - 1;
+ }
- /* Convert the scaled magnitude to segment number. */
- seg = search(pcm_val, seg_aend, 8);
+ /* Convert the scaled magnitude to segment number. */
+ seg = search(pcm_val, seg_aend, 8);
- /* Combine the sign, segment, and quantization bits. */
+ /* Combine the sign, segment, and quantization bits. */
- if (seg >= 8) /* out of range, return maximum value. */
- return (unsigned char) (0x7F ^ mask);
- else {
- aval = (unsigned char) seg << SEG_SHIFT;
- if (seg < 2)
- aval |= (pcm_val >> 1) & QUANT_MASK;
- else
- aval |= (pcm_val >> seg) & QUANT_MASK;
- return (aval ^ mask);
- }
+ if (seg >= 8) { /* out of range, return maximum value. */
+ return (unsigned char) (0x7F ^ mask);
+ }
+ else {
+ aval = (unsigned char) seg << SEG_SHIFT;
+ if (seg < 2) {
+ aval |= (pcm_val >> 1) & QUANT_MASK;
+ }
+ else {
+ aval |= (pcm_val >> seg) & QUANT_MASK;
+ }
+ return (aval ^ mask);
+ }
}
/*
@@ -166,25 +175,25 @@ unsigned char linear2alaw(short pcm_val) /* 2's complement (16-bit range) */
*/
short alaw2linear(unsigned char a_val)
{
- short t;
- short seg;
+ short t;
+ short seg;
- a_val ^= 0x55;
+ a_val ^= 0x55;
- t = (a_val & QUANT_MASK) << 4;
- seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
- switch (seg) {
- case 0:
- t += 8;
- break;
- case 1:
- t += 0x108;
- break;
- default:
- t += 0x108;
- t <<= seg - 1;
- }
- return ((a_val & SIGN_BIT) ? t : -t);
+ t = (a_val & QUANT_MASK) << 4;
+ seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
+ switch (seg) {
+ case 0:
+ t += 8;
+ break;
+ case 1:
+ t += 0x108;
+ break;
+ default:
+ t += 0x108;
+ t <<= seg - 1;
+ }
+ return ((a_val & SIGN_BIT) ? t : -t);
}
#define BIAS (0x84) /* Bias for linear code. */
@@ -221,34 +230,38 @@ short alaw2linear(unsigned char a_val)
*/
unsigned char linear2ulaw(short pcm_val) /* 2's complement (16-bit range) */
{
- short mask;
- short seg;
- unsigned char uval;
+ short mask;
+ short seg;
+ unsigned char uval;
- /* Get the sign and the magnitude of the value. */
- pcm_val = pcm_val >> 2;
- if (pcm_val < 0) {
- pcm_val = -pcm_val;
- mask = 0x7F;
- } else {
- mask = 0xFF;
- }
- if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */
- pcm_val += (BIAS >> 2);
+ /* Get the sign and the magnitude of the value. */
+ pcm_val = pcm_val >> 2;
+ if (pcm_val < 0) {
+ pcm_val = -pcm_val;
+ mask = 0x7F;
+ }
+ else {
+ mask = 0xFF;
+ }
+ if ( pcm_val > CLIP ) {
+ pcm_val = CLIP; /* clip the magnitude */
+ }
+ pcm_val += (BIAS >> 2);
- /* Convert the scaled magnitude to segment number. */
- seg = search(pcm_val, seg_uend, 8);
+ /* Convert the scaled magnitude to segment number. */
+ seg = search(pcm_val, seg_uend, 8);
- /*
- * Combine the sign, segment, quantization bits;
- * and complement the code word.
- */
- if (seg >= 8) /* out of range, return maximum value. */
- return (unsigned char) (0x7F ^ mask);
- else {
- uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF);
- return (uval ^ mask);
- }
+ /*
+ * Combine the sign, segment, quantization bits;
+ * and complement the code word.
+ */
+ if (seg >= 8) { /* out of range, return maximum value. */
+ return (unsigned char) (0x7F ^ mask);
+ }
+ else {
+ uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF);
+ return (uval ^ mask);
+ }
}
@@ -263,33 +276,33 @@ unsigned char linear2ulaw(short pcm_val) /* 2's complement (16-bit range) */
*/
short ulaw2linear(unsigned char u_val)
{
- short t;
+ short t;
- /* Complement to obtain normal u-law value. */
- u_val = ~u_val;
+ /* Complement to obtain normal u-law value. */
+ u_val = ~u_val;
- /*
- * Extract and bias the quantization bits. Then
- * shift up by the segment number and subtract out the bias.
- */
- t = ((u_val & QUANT_MASK) << 3) + BIAS;
- t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
+ /*
+ * Extract and bias the quantization bits. Then
+ * shift up by the segment number and subtract out the bias.
+ */
+ t = ((u_val & QUANT_MASK) << 3) + BIAS;
+ t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
- return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS));
+ return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS));
}
/* A-law to u-law conversion */
unsigned char alaw2ulaw(unsigned char aval)
{
- aval &= 0xff;
- return (unsigned char) ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) :
- (0x7F ^ _a2u[aval ^ 0x55]));
+ aval &= 0xff;
+ return (unsigned char) ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) :
+ (0x7F ^ _a2u[aval ^ 0x55]));
}
/* u-law to A-law conversion */
unsigned char ulaw2alaw(unsigned char uval)
{
- uval &= 0xff;
- return (unsigned char) ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) :
- (unsigned char) (0x55 ^ (_u2a[0x7F ^ uval] - 1)));
+ uval &= 0xff;
+ return (unsigned char) ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) :
+ (unsigned char) (0x55 ^ (_u2a[0x7F ^ uval] - 1)));
}
diff --git a/tinyDAV/src/codecs/g711/tdav_codec_g711.c b/tinyDAV/src/codecs/g711/tdav_codec_g711.c
index fa970e1..288d70f 100755
--- a/tinyDAV/src/codecs/g711/tdav_codec_g711.c
+++ b/tinyDAV/src/codecs/g711/tdav_codec_g711.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,68 +42,69 @@
static tsk_size_t tdav_codec_g711u_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- register tsk_size_t i;
- register uint8_t* pout_data;
- register int16_t* pin_data;
- tsk_size_t out_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- out_size = (in_size >> 1);
-
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- pout_data = *out_data;
- pin_data = (int16_t*)in_data;
- for(i = 0; i<out_size; i++){
- pout_data[i] = linear2ulaw(pin_data[i]);
- }
-
- return out_size;
+ register tsk_size_t i;
+ register uint8_t* pout_data;
+ register int16_t* pin_data;
+ tsk_size_t out_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ out_size = (in_size >> 1);
+
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ pout_data = *out_data;
+ pin_data = (int16_t*)in_data;
+ for(i = 0; i<out_size; i++) {
+ pout_data[i] = linear2ulaw(pin_data[i]);
+ }
+
+ return out_size;
}
static tsk_size_t tdav_codec_g711u_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t i;
- tsk_size_t out_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- out_size = (in_size << 1);
-
- /* allocate new buffer */
- if(*out_max_size<out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- for(i = 0; i<in_size; i++){
- ((short*)*out_data)[i] = ulaw2linear(((uint8_t*)in_data)[i]);
- }
-
- return out_size;
+ tsk_size_t i;
+ tsk_size_t out_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ out_size = (in_size << 1);
+
+ /* allocate new buffer */
+ if(*out_max_size<out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ for(i = 0; i<in_size; i++) {
+ ((short*)*out_data)[i] = ulaw2linear(((uint8_t*)in_data)[i]);
+ }
+
+ return out_size;
}
static tsk_bool_t tdav_codec_g711u_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -114,61 +115,59 @@ static tsk_bool_t tdav_codec_g711u_sdp_att_match(const tmedia_codec_t* codec, co
/* constructor */
static tsk_object_t* tdav_codec_g711u_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_g711u_t *g711u = self;
- if(g711u){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_g711u_t *g711u = self;
+ if(g711u) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_g711u_dtor(tsk_object_t * self)
-{
- tdav_codec_g711u_t *g711u = self;
- if(g711u){
- /* deinit base */
- tmedia_codec_audio_deinit(g711u);
- /* deinit self */
- }
-
- return self;
+{
+ tdav_codec_g711u_t *g711u = self;
+ if(g711u) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(g711u);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_g711u_def_s =
-{
- sizeof(tdav_codec_g711u_t),
- tdav_codec_g711u_ctor,
- tdav_codec_g711u_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_g711u_def_s = {
+ sizeof(tdav_codec_g711u_t),
+ tdav_codec_g711u_ctor,
+ tdav_codec_g711u_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_g711u_plugin_def_s =
-{
- &tdav_codec_g711u_def_s,
-
- tmedia_audio,
- tmedia_codec_id_pcmu,
- "PCMU",
- "G.711u codec (native)",
- TMEDIA_CODEC_FORMAT_G711u,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_g711u_open,
- tdav_codec_g711u_close,
- tdav_codec_g711u_encode,
- tdav_codec_g711u_decode,
- tdav_codec_g711u_sdp_att_match,
- tdav_codec_g711u_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_g711u_plugin_def_s = {
+ &tdav_codec_g711u_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_pcmu,
+ "PCMU",
+ "G.711u codec (native)",
+ TMEDIA_CODEC_FORMAT_G711u,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_g711u_open,
+ tdav_codec_g711u_close,
+ tdav_codec_g711u_encode,
+ tdav_codec_g711u_decode,
+ tdav_codec_g711u_sdp_att_match,
+ tdav_codec_g711u_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_g711u_plugin_def_t = &tdav_codec_g711u_plugin_def_s;
@@ -181,34 +180,34 @@ const tmedia_codec_plugin_def_t *tdav_codec_g711u_plugin_def_t = &tdav_codec_g71
static tsk_size_t tdav_codec_g711a_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- register tsk_size_t i;
- register uint8_t* pout_data;
- register int16_t* pin_data;
- tsk_size_t out_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- out_size = (in_size >> 1);
-
- if(*out_max_size < out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- pout_data = *out_data;
- pin_data = (int16_t*)in_data;
- for(i = 0; i<out_size; i++){
- pout_data[i] = linear2alaw(pin_data[i]);
- }
-
- return out_size;
+ register tsk_size_t i;
+ register uint8_t* pout_data;
+ register int16_t* pin_data;
+ tsk_size_t out_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ out_size = (in_size >> 1);
+
+ if(*out_max_size < out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ pout_data = *out_data;
+ pin_data = (int16_t*)in_data;
+ for(i = 0; i<out_size; i++) {
+ pout_data[i] = linear2alaw(pin_data[i]);
+ }
+
+ return out_size;
}
#if 0
@@ -217,46 +216,47 @@ int count = 0;
#endif
static tsk_size_t tdav_codec_g711a_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t i, out_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- out_size = (in_size << 1);
+ tsk_size_t i, out_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ out_size = (in_size << 1);
#if 0
- if(!file && count<=1000){
- file = fopen("./g711a.pcm", "wb");
- }
+ if(!file && count<=1000) {
+ file = fopen("./g711a.pcm", "wb");
+ }
#endif
- /* allocate new buffer */
- if(*out_max_size < out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- for(i = 0; i<in_size; i++){
- ((short*)*out_data)[i] = alaw2linear(((uint8_t*)in_data)[i]);
- }
+ /* allocate new buffer */
+ if(*out_max_size < out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ for(i = 0; i<in_size; i++) {
+ ((short*)*out_data)[i] = alaw2linear(((uint8_t*)in_data)[i]);
+ }
#if 0
- if(++count<=1000){
- fwrite(*out_data, sizeof(short), in_size, file);
- }
- else if(file){
- fclose(file);
- file = tsk_null;
- }
+ if(++count<=1000) {
+ fwrite(*out_data, sizeof(short), in_size, file);
+ }
+ else if(file) {
+ fclose(file);
+ file = tsk_null;
+ }
#endif
- return out_size;
+ return out_size;
}
static tsk_bool_t tdav_codec_g711a_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -267,60 +267,58 @@ static tsk_bool_t tdav_codec_g711a_sdp_att_match(const tmedia_codec_t* codec, co
/* constructor */
static tsk_object_t* tdav_codec_g711a_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_g711a_t *g711a = self;
- if(g711a){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_g711a_t *g711a = self;
+ if(g711a) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_g711a_dtor(tsk_object_t * self)
-{
- tdav_codec_g711a_t *g711a = self;
- if(g711a){
- /* deinit base */
- tmedia_codec_audio_deinit(g711a);
- /* deinit self */
- }
-
- return self;
+{
+ tdav_codec_g711a_t *g711a = self;
+ if(g711a) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(g711a);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_g711a_def_s =
-{
- sizeof(tdav_codec_g711a_t),
- tdav_codec_g711a_ctor,
- tdav_codec_g711a_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_g711a_def_s = {
+ sizeof(tdav_codec_g711a_t),
+ tdav_codec_g711a_ctor,
+ tdav_codec_g711a_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_g711a_plugin_def_s =
-{
- &tdav_codec_g711a_def_s,
-
- tmedia_audio,
- tmedia_codec_id_pcma,
- "PCMA",
- "G.711a codec (native)",
- TMEDIA_CODEC_FORMAT_G711a,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_g711a_open,
- tdav_codec_g711a_close,
- tdav_codec_g711a_encode,
- tdav_codec_g711a_decode,
- tdav_codec_g711a_sdp_att_match,
- tdav_codec_g711a_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_g711a_plugin_def_s = {
+ &tdav_codec_g711a_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_pcma,
+ "PCMA",
+ "G.711a codec (native)",
+ TMEDIA_CODEC_FORMAT_G711a,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_g711a_open,
+ tdav_codec_g711a_close,
+ tdav_codec_g711a_encode,
+ tdav_codec_g711a_decode,
+ tdav_codec_g711a_sdp_att_match,
+ tdav_codec_g711a_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_g711a_plugin_def_t = &tdav_codec_g711a_plugin_def_s;
diff --git a/tinyDAV/src/codecs/g722/g722_decode.c b/tinyDAV/src/codecs/g722/g722_decode.c
index b6b7830..c9c26af 100755
--- a/tinyDAV/src/codecs/g722/g722_decode.c
+++ b/tinyDAV/src/codecs/g722/g722_decode.c
@@ -7,7 +7,7 @@
*
* Copyright (C) 2005 Steve Underwood
*
- * Despite my general liking of the GPL, I place my own contributions
+ * Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@@ -48,10 +48,12 @@ static __inline int16_t saturate(int32_t amp)
/* Hopefully this is optimised for the common case - not clipping */
amp16 = (int16_t) amp;
- if (amp == amp16)
+ if (amp == amp16) {
return amp16;
- if (amp > TDAV_INT16_MAX)
+ }
+ if (amp > TDAV_INT16_MAX) {
return TDAV_INT16_MAX;
+ }
return TDAV_INT16_MIN;
}
/*- End of function --------------------------------------------------------*/
@@ -73,20 +75,24 @@ static void block4(g722_decode_state_t *s, int band, int d)
s->band[band].p[0] = saturate(s->band[band].sz + d);
/* Block 4, UPPOL2 */
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++) {
s->band[band].sg[i] = s->band[band].p[i] >> 15;
+ }
wd1 = saturate(s->band[band].a[1] << 2);
wd2 = (s->band[band].sg[0] == s->band[band].sg[1]) ? -wd1 : wd1;
- if (wd2 > 32767)
+ if (wd2 > 32767) {
wd2 = 32767;
+ }
wd3 = (s->band[band].sg[0] == s->band[band].sg[2]) ? 128 : -128;
wd3 += (wd2 >> 7);
wd3 += (s->band[band].a[2]*32512) >> 15;
- if (wd3 > 12288)
+ if (wd3 > 12288) {
wd3 = 12288;
- else if (wd3 < -12288)
+ }
+ else if (wd3 < -12288) {
wd3 = -12288;
+ }
s->band[band].ap[2] = wd3;
/* Block 4, UPPOL1 */
@@ -97,16 +103,17 @@ static void block4(g722_decode_state_t *s, int band, int d)
s->band[band].ap[1] = saturate(wd1 + wd2);
wd3 = saturate(15360 - s->band[band].ap[2]);
- if (s->band[band].ap[1] > wd3)
+ if (s->band[band].ap[1] > wd3) {
s->band[band].ap[1] = wd3;
- else if (s->band[band].ap[1] < -wd3)
+ }
+ else if (s->band[band].ap[1] < -wd3) {
s->band[band].ap[1] = -wd3;
+ }
/* Block 4, UPZERO */
wd1 = (d == 0) ? 0 : 128;
s->band[band].sg[0] = d >> 15;
- for (i = 1; i < 7; i++)
- {
+ for (i = 1; i < 7; i++) {
s->band[band].sg[i] = s->band[band].d[i] >> 15;
wd2 = (s->band[band].sg[i] == s->band[band].sg[0]) ? wd1 : -wd1;
wd3 = (s->band[band].b[i]*32640) >> 15;
@@ -114,14 +121,12 @@ static void block4(g722_decode_state_t *s, int band, int d)
}
/* Block 4, DELAYA */
- for (i = 6; i > 0; i--)
- {
+ for (i = 6; i > 0; i--) {
s->band[band].d[i] = s->band[band].d[i - 1];
s->band[band].b[i] = s->band[band].bp[i];
}
-
- for (i = 2; i > 0; i--)
- {
+
+ for (i = 2; i > 0; i--) {
s->band[band].r[i] = s->band[band].r[i - 1];
s->band[band].p[i] = s->band[band].p[i - 1];
s->band[band].a[i] = s->band[band].ap[i];
@@ -136,8 +141,7 @@ static void block4(g722_decode_state_t *s, int band, int d)
/* Block 4, FILTEZ */
s->band[band].sz = 0;
- for (i = 6; i > 0; i--)
- {
+ for (i = 6; i > 0; i--) {
wd1 = saturate(s->band[band].d[i] + s->band[band].d[i]);
s->band[band].sz += (s->band[band].b[i]*wd1) >> 15;
}
@@ -150,24 +154,30 @@ static void block4(g722_decode_state_t *s, int band, int d)
g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, int rate, int options)
{
- if (s == NULL)
- {
- if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL)
+ if (s == NULL) {
+ if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL) {
return NULL;
+ }
}
memset(s, 0, sizeof(*s));
- if (rate == 48000)
+ if (rate == 48000) {
s->bits_per_sample = 6;
- else if (rate == 56000)
+ }
+ else if (rate == 56000) {
s->bits_per_sample = 7;
- else
+ }
+ else {
s->bits_per_sample = 8;
- if ((options & G722_SAMPLE_RATE_8000))
+ }
+ if ((options & G722_SAMPLE_RATE_8000)) {
s->eight_k = TRUE;
- if ((options & G722_PACKED) && s->bits_per_sample != 8)
+ }
+ if ((options & G722_PACKED) && s->bits_per_sample != 8) {
s->packed = TRUE;
- else
+ }
+ else {
s->packed = FALSE;
+ }
s->band[0].det = 32;
s->band[1].det = 8;
return s;
@@ -186,8 +196,7 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
{
static const int wl[8] = {-60, -30, 58, 172, 334, 538, 1198, 3042 };
static const int rl42[16] = {0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0 };
- static const int ilb[32] =
- {
+ static const int ilb[32] = {
2048, 2093, 2139, 2186, 2233, 2282, 2332,
2383, 2435, 2489, 2543, 2599, 2656, 2714,
2774, 2834, 2896, 2960, 3025, 3091, 3158,
@@ -197,46 +206,42 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
static const int wh[3] = {0, -214, 798};
static const int rh2[4] = {2, 1, 2, 1};
static const int qm2[4] = {-7408, -1616, 7408, 1616};
- static const int qm4[16] =
- {
- 0, -20456, -12896, -8968,
- -6288, -4240, -2584, -1200,
- 20456, 12896, 8968, 6288,
- 4240, 2584, 1200, 0
+ static const int qm4[16] = {
+ 0, -20456, -12896, -8968,
+ -6288, -4240, -2584, -1200,
+ 20456, 12896, 8968, 6288,
+ 4240, 2584, 1200, 0
};
- static const int qm5[32] =
- {
- -280, -280, -23352, -17560,
- -14120, -11664, -9752, -8184,
- -6864, -5712, -4696, -3784,
- -2960, -2208, -1520, -880,
- 23352, 17560, 14120, 11664,
- 9752, 8184, 6864, 5712,
- 4696, 3784, 2960, 2208,
- 1520, 880, 280, -280
+ static const int qm5[32] = {
+ -280, -280, -23352, -17560,
+ -14120, -11664, -9752, -8184,
+ -6864, -5712, -4696, -3784,
+ -2960, -2208, -1520, -880,
+ 23352, 17560, 14120, 11664,
+ 9752, 8184, 6864, 5712,
+ 4696, 3784, 2960, 2208,
+ 1520, 880, 280, -280
};
- static const int qm6[64] =
- {
- -136, -136, -136, -136,
- -24808, -21904, -19008, -16704,
- -14984, -13512, -12280, -11192,
- -10232, -9360, -8576, -7856,
- -7192, -6576, -6000, -5456,
- -4944, -4464, -4008, -3576,
- -3168, -2776, -2400, -2032,
- -1688, -1360, -1040, -728,
- 24808, 21904, 19008, 16704,
- 14984, 13512, 12280, 11192,
- 10232, 9360, 8576, 7856,
- 7192, 6576, 6000, 5456,
- 4944, 4464, 4008, 3576,
- 3168, 2776, 2400, 2032,
- 1688, 1360, 1040, 728,
- 432, 136, -432, -136
+ static const int qm6[64] = {
+ -136, -136, -136, -136,
+ -24808, -21904, -19008, -16704,
+ -14984, -13512, -12280, -11192,
+ -10232, -9360, -8576, -7856,
+ -7192, -6576, -6000, -5456,
+ -4944, -4464, -4008, -3576,
+ -3168, -2776, -2400, -2032,
+ -1688, -1360, -1040, -728,
+ 24808, 21904, 19008, 16704,
+ 14984, 13512, 12280, 11192,
+ 10232, 9360, 8576, 7856,
+ 7192, 6576, 6000, 5456,
+ 4944, 4464, 4008, 3576,
+ 3168, 2776, 2400, 2032,
+ 1688, 1360, 1040, 728,
+ 432, 136, -432, -136
};
- static const int qmf_coeffs[12] =
- {
- 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
+ static const int qmf_coeffs[12] = {
+ 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
};
int dlowt;
@@ -256,13 +261,10 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
outlen = 0;
rhigh = 0;
- for (j = 0; j < len; )
- {
- if (s->packed)
- {
+ for (j = 0; j < len; ) {
+ if (s->packed) {
/* Unpack the code bits */
- if (s->in_bits < s->bits_per_sample)
- {
+ if (s->in_bits < s->bits_per_sample) {
s->in_buffer |= (g722_data[j++] << s->in_bits);
s->in_bits += 8;
}
@@ -270,13 +272,11 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
s->in_buffer >>= s->bits_per_sample;
s->in_bits -= s->bits_per_sample;
}
- else
- {
+ else {
code = g722_data[j++];
}
- switch (s->bits_per_sample)
- {
+ switch (s->bits_per_sample) {
default:
case 8:
wd1 = code & 0x3F;
@@ -301,10 +301,12 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
/* Block 5L, RECONS */
rlow = s->band[0].s + wd2;
/* Block 6L, LIMIT */
- if (rlow > 16383)
+ if (rlow > 16383) {
rlow = 16383;
- else if (rlow < -16384)
+ }
+ else if (rlow < -16384) {
rlow = -16384;
+ }
/* Block 2L, INVQAL */
wd2 = qm4[wd1];
@@ -314,12 +316,14 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
wd2 = rl42[wd1];
wd1 = (s->band[0].nb*127) >> 7;
wd1 += wl[wd2];
- if (wd1 < 0)
+ if (wd1 < 0) {
wd1 = 0;
- else if (wd1 > 18432)
+ }
+ else if (wd1 > 18432) {
wd1 = 18432;
+ }
s->band[0].nb = wd1;
-
+
/* Block 3L, SCALEL */
wd1 = (s->band[0].nb >> 6) & 31;
wd2 = 8 - (s->band[0].nb >> 11);
@@ -327,30 +331,33 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
s->band[0].det = wd3 << 2;
block4(s, 0, dlowt);
-
- if (!s->eight_k)
- {
+
+ if (!s->eight_k) {
/* Block 2H, INVQAH */
wd2 = qm2[ihigh];
dhigh = (s->band[1].det*wd2) >> 15;
/* Block 5H, RECONS */
rhigh = dhigh + s->band[1].s;
/* Block 6H, LIMIT */
- if (rhigh > 16383)
+ if (rhigh > 16383) {
rhigh = 16383;
- else if (rhigh < -16384)
+ }
+ else if (rhigh < -16384) {
rhigh = -16384;
+ }
/* Block 2H, INVQAH */
wd2 = rh2[ihigh];
wd1 = (s->band[1].nb*127) >> 7;
wd1 += wh[wd2];
- if (wd1 < 0)
+ if (wd1 < 0) {
wd1 = 0;
- else if (wd1 > 22528)
+ }
+ else if (wd1 > 22528) {
wd1 = 22528;
+ }
s->band[1].nb = wd1;
-
+
/* Block 3H, SCALEH */
wd1 = (s->band[1].nb >> 6) & 31;
wd2 = 10 - (s->band[1].nb >> 11);
@@ -360,29 +367,25 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[],
block4(s, 1, dhigh);
}
- if (s->itu_test_mode)
- {
+ if (s->itu_test_mode) {
amp[outlen++] = (int16_t) (rlow << 1);
amp[outlen++] = (int16_t) (rhigh << 1);
}
- else
- {
- if (s->eight_k)
- {
+ else {
+ if (s->eight_k) {
amp[outlen++] = (int16_t) (rlow << 1);
}
- else
- {
+ else {
/* Apply the receive QMF */
- for (i = 0; i < 22; i++)
+ for (i = 0; i < 22; i++) {
s->x[i] = s->x[i + 2];
+ }
s->x[22] = rlow + rhigh;
s->x[23] = rlow - rhigh;
xout1 = 0;
xout2 = 0;
- for (i = 0; i < 12; i++)
- {
+ for (i = 0; i < 12; i++) {
xout2 += s->x[2*i]*qmf_coeffs[i];
xout1 += s->x[2*i + 1]*qmf_coeffs[11 - i];
}
diff --git a/tinyDAV/src/codecs/g722/g722_encode.c b/tinyDAV/src/codecs/g722/g722_encode.c
index 68758eb..a0bf821 100755
--- a/tinyDAV/src/codecs/g722/g722_encode.c
+++ b/tinyDAV/src/codecs/g722/g722_encode.c
@@ -9,7 +9,7 @@
*
* All rights reserved.
*
- * Despite my general liking of the GPL, I place my own contributions
+ * Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@@ -47,10 +47,12 @@ static __inline int16_t saturate(int32_t amp)
/* Hopefully this is optimised for the common case - not clipping */
amp16 = (int16_t) amp;
- if (amp == amp16)
+ if (amp == amp16) {
return amp16;
- if (amp > TDAV_INT16_MAX)
+ }
+ if (amp > TDAV_INT16_MAX) {
return TDAV_INT16_MAX;
+ }
return TDAV_INT16_MIN;
}
/*- End of function --------------------------------------------------------*/
@@ -70,19 +72,23 @@ static void block4(g722_encode_state_t *s, int band, int d)
s->band[band].p[0] = saturate(s->band[band].sz + d);
/* Block 4, UPPOL2 */
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++) {
s->band[band].sg[i] = s->band[band].p[i] >> 15;
+ }
wd1 = saturate(s->band[band].a[1] << 2);
wd2 = (s->band[band].sg[0] == s->band[band].sg[1]) ? -wd1 : wd1;
- if (wd2 > 32767)
+ if (wd2 > 32767) {
wd2 = 32767;
+ }
wd3 = (wd2 >> 7) + ((s->band[band].sg[0] == s->band[band].sg[2]) ? 128 : -128);
wd3 += (s->band[band].a[2]*32512) >> 15;
- if (wd3 > 12288)
+ if (wd3 > 12288) {
wd3 = 12288;
- else if (wd3 < -12288)
+ }
+ else if (wd3 < -12288) {
wd3 = -12288;
+ }
s->band[band].ap[2] = wd3;
/* Block 4, UPPOL1 */
@@ -93,16 +99,17 @@ static void block4(g722_encode_state_t *s, int band, int d)
s->band[band].ap[1] = saturate(wd1 + wd2);
wd3 = saturate(15360 - s->band[band].ap[2]);
- if (s->band[band].ap[1] > wd3)
+ if (s->band[band].ap[1] > wd3) {
s->band[band].ap[1] = wd3;
- else if (s->band[band].ap[1] < -wd3)
+ }
+ else if (s->band[band].ap[1] < -wd3) {
s->band[band].ap[1] = -wd3;
+ }
/* Block 4, UPZERO */
wd1 = (d == 0) ? 0 : 128;
s->band[band].sg[0] = d >> 15;
- for (i = 1; i < 7; i++)
- {
+ for (i = 1; i < 7; i++) {
s->band[band].sg[i] = s->band[band].d[i] >> 15;
wd2 = (s->band[band].sg[i] == s->band[band].sg[0]) ? wd1 : -wd1;
wd3 = (s->band[band].b[i]*32640) >> 15;
@@ -110,14 +117,12 @@ static void block4(g722_encode_state_t *s, int band, int d)
}
/* Block 4, DELAYA */
- for (i = 6; i > 0; i--)
- {
+ for (i = 6; i > 0; i--) {
s->band[band].d[i] = s->band[band].d[i - 1];
s->band[band].b[i] = s->band[band].bp[i];
}
-
- for (i = 2; i > 0; i--)
- {
+
+ for (i = 2; i > 0; i--) {
s->band[band].r[i] = s->band[band].r[i - 1];
s->band[band].p[i] = s->band[band].p[i - 1];
s->band[band].a[i] = s->band[band].ap[i];
@@ -132,8 +137,7 @@ static void block4(g722_encode_state_t *s, int band, int d)
/* Block 4, FILTEZ */
s->band[band].sz = 0;
- for (i = 6; i > 0; i--)
- {
+ for (i = 6; i > 0; i--) {
wd1 = saturate(s->band[band].d[i] + s->band[band].d[i]);
s->band[band].sz += (s->band[band].b[i]*wd1) >> 15;
}
@@ -146,24 +150,30 @@ static void block4(g722_encode_state_t *s, int band, int d)
g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, int rate, int options)
{
- if (s == NULL)
- {
- if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL)
+ if (s == NULL) {
+ if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL) {
return NULL;
+ }
}
memset(s, 0, sizeof(*s));
- if (rate == 48000)
+ if (rate == 48000) {
s->bits_per_sample = 6;
- else if (rate == 56000)
+ }
+ else if (rate == 56000) {
s->bits_per_sample = 7;
- else
+ }
+ else {
s->bits_per_sample = 8;
- if ((options & G722_SAMPLE_RATE_8000))
+ }
+ if ((options & G722_SAMPLE_RATE_8000)) {
s->eight_k = TRUE;
- if ((options & G722_PACKED) && s->bits_per_sample != 8)
+ }
+ if ((options & G722_PACKED) && s->bits_per_sample != 8) {
s->packed = TRUE;
- else
+ }
+ else {
s->packed = FALSE;
+ }
s->band[0].det = 32;
s->band[1].det = 8;
return s;
@@ -197,57 +207,48 @@ int16_t limitValues (int16_t rl)
int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
const int16_t amp[], int len)
{
- static const int q6[32] =
- {
- 0, 35, 72, 110, 150, 190, 233, 276,
- 323, 370, 422, 473, 530, 587, 650, 714,
- 786, 858, 940, 1023, 1121, 1219, 1339, 1458,
+ static const int q6[32] = {
+ 0, 35, 72, 110, 150, 190, 233, 276,
+ 323, 370, 422, 473, 530, 587, 650, 714,
+ 786, 858, 940, 1023, 1121, 1219, 1339, 1458,
1612, 1765, 1980, 2195, 2557, 2919, 0, 0
};
- static const int iln[32] =
- {
- 0, 63, 62, 31, 30, 29, 28, 27,
+ static const int iln[32] = {
+ 0, 63, 62, 31, 30, 29, 28, 27,
26, 25, 24, 23, 22, 21, 20, 19,
18, 17, 16, 15, 14, 13, 12, 11,
10, 9, 8, 7, 6, 5, 4, 0
};
- static const int ilp[32] =
- {
- 0, 61, 60, 59, 58, 57, 56, 55,
+ static const int ilp[32] = {
+ 0, 61, 60, 59, 58, 57, 56, 55,
54, 53, 52, 51, 50, 49, 48, 47,
46, 45, 44, 43, 42, 41, 40, 39,
38, 37, 36, 35, 34, 33, 32, 0
};
- static const int wl[8] =
- {
+ static const int wl[8] = {
-60, -30, 58, 172, 334, 538, 1198, 3042
};
- static const int rl42[16] =
- {
+ static const int rl42[16] = {
0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0
};
- static const int ilb[32] =
- {
+ static const int ilb[32] = {
2048, 2093, 2139, 2186, 2233, 2282, 2332,
2383, 2435, 2489, 2543, 2599, 2656, 2714,
2774, 2834, 2896, 2960, 3025, 3091, 3158,
3228, 3298, 3371, 3444, 3520, 3597, 3676,
3756, 3838, 3922, 4008
};
- static const int qm4[16] =
- {
- 0, -20456, -12896, -8968,
- -6288, -4240, -2584, -1200,
- 20456, 12896, 8968, 6288,
- 4240, 2584, 1200, 0
+ static const int qm4[16] = {
+ 0, -20456, -12896, -8968,
+ -6288, -4240, -2584, -1200,
+ 20456, 12896, 8968, 6288,
+ 4240, 2584, 1200, 0
};
- static const int qm2[4] =
- {
+ static const int qm2[4] = {
-7408, -1616, 7408, 1616
};
- static const int qmf_coeffs[12] =
- {
- 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
+ static const int qmf_coeffs[12] = {
+ 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
};
static const int ihn[3] = {0, 1, 0};
static const int ihp[3] = {0, 3, 2};
@@ -281,34 +282,29 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
g722_bytes = 0;
xhigh = 0;
- for (j = 0; j < len; )
- {
- if (s->itu_test_mode)
- {
+ for (j = 0; j < len; ) {
+ if (s->itu_test_mode) {
xlow =
- xhigh = amp[j++] >> 1;
+ xhigh = amp[j++] >> 1;
}
- else
- {
- if (s->eight_k)
- {
+ else {
+ if (s->eight_k) {
/* We shift by 1 to allow for the 15 bit input to the G.722 algorithm. */
xlow = amp[j++] >> 1;
}
- else
- {
+ else {
/* Apply the transmit QMF */
/* Shuffle the buffer down */
- for (i = 0; i < 22; i++)
+ for (i = 0; i < 22; i++) {
s->x[i] = s->x[i + 2];
+ }
s->x[22] = amp[j++];
s->x[23] = amp[j++];
-
+
/* Discard every other QMF output */
sumeven = 0;
sumodd = 0;
- for (i = 0; i < 12; i++)
- {
+ for (i = 0; i < 12; i++) {
sumodd += s->x[2*i]*qmf_coeffs[i];
sumeven += s->x[2*i + 1]*qmf_coeffs[11 - i];
}
@@ -334,11 +330,11 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
/* Block 1L, QUANTL */
wd = (el >= 0) ? el : -(el + 1);
- for (i = 1; i < 30; i++)
- {
+ for (i = 1; i < 30; i++) {
wd1 = (q6[i]*s->band[0].det) >> 12;
- if (wd < wd1)
+ if (wd < wd1) {
break;
+ }
}
ilow = (el < 0) ? iln[i] : ilp[i];
@@ -351,10 +347,12 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
il4 = rl42[ril];
wd = (s->band[0].nb*127) >> 7;
s->band[0].nb = wd + wl[il4];
- if (s->band[0].nb < 0)
+ if (s->band[0].nb < 0) {
s->band[0].nb = 0;
- else if (s->band[0].nb > 18432)
+ }
+ else if (s->band[0].nb > 18432) {
s->band[0].nb = 18432;
+ }
/* Block 3L, SCALEL */
wd1 = (s->band[0].nb >> 6) & 31;
@@ -363,14 +361,12 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
s->band[0].det = wd3 << 2;
block4(s, 0, dlow);
-
- if (s->eight_k)
- {
+
+ if (s->eight_k) {
/* Just leave the high bits as zero */
code = (0xC0 | ilow) >> (8 - s->bits_per_sample);
}
- else
- {
+ else {
/* Block 1H, SUBTRA */
eh = saturate(xhigh - s->band[1].s);
@@ -388,10 +384,12 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
ih2 = rh2[ihigh];
wd = (s->band[1].nb*127) >> 7;
s->band[1].nb = wd + wh[ih2];
- if (s->band[1].nb < 0)
+ if (s->band[1].nb < 0) {
s->band[1].nb = 0;
- else if (s->band[1].nb > 22528)
+ }
+ else if (s->band[1].nb > 22528) {
s->band[1].nb = 22528;
+ }
/* Block 3H, SCALEH */
wd1 = (s->band[1].nb >> 6) & 31;
@@ -403,20 +401,17 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[],
code = ((ihigh << 6) | ilow) >> (8 - s->bits_per_sample);
}
- if (s->packed)
- {
+ if (s->packed) {
/* Pack the code bits */
s->out_buffer |= (code << s->out_bits);
s->out_bits += s->bits_per_sample;
- if (s->out_bits >= 8)
- {
+ if (s->out_bits >= 8) {
g722_data[g722_bytes++] = (uint8_t) (s->out_buffer & 0xFF);
s->out_bits -= 8;
s->out_buffer >>= 8;
}
}
- else
- {
+ else {
g722_data[g722_bytes++] = (uint8_t) code;
}
}
diff --git a/tinyDAV/src/codecs/g722/tdav_codec_g722.c b/tinyDAV/src/codecs/g722/tdav_codec_g722.c
index 749fa04..f543bdf 100755
--- a/tinyDAV/src/codecs/g722/tdav_codec_g722.c
+++ b/tinyDAV/src/codecs/g722/tdav_codec_g722.c
@@ -26,124 +26,123 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-typedef struct tdav_codec_g722_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_g722_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- g722_encode_state_t *enc_state;
- g722_decode_state_t *dec_state;
+ g722_encode_state_t *enc_state;
+ g722_decode_state_t *dec_state;
}
tdav_codec_g722_t;
static int tdav_codec_g722_open(tmedia_codec_t* self)
{
- tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
-
- if (!g722){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // Initialize the decoder
- if (!g722->dec_state){
- if (!(g722->dec_state = tsk_calloc(1, sizeof(g722_decode_state_t)))){
- TSK_DEBUG_ERROR("Failed to create G.722 decoder state");
- return -2;
- }
- // Create and/or reset the G.722 decoder
- // Bitrate 64 kbps and wideband mode (2)
- if (!(g722->dec_state = g722_decode_init(g722->dec_state, 64000, 2))){
- TSK_DEBUG_ERROR("g722_decode_init failed");
- return -3;
- }
- }
-
- // Initialize the encoder
- if (!g722->enc_state){
- if (!(g722->enc_state = tsk_calloc(1, sizeof(g722_encode_state_t)))){
- TSK_DEBUG_ERROR("Failed to create G.722 encoder state");
- return -4;
- }
- // Create and/or reset the G.722 encoder
- // Bitrate 64 kbps and wideband mode (2)
- if (!(g722->enc_state = g722_encode_init(g722->enc_state, 64000, 2))){
- TSK_DEBUG_ERROR("g722_encode_init failed");
- return -5;
- }
- }
-
- return 0;
+ tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
+
+ if (!g722) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // Initialize the decoder
+ if (!g722->dec_state) {
+ if (!(g722->dec_state = tsk_calloc(1, sizeof(g722_decode_state_t)))) {
+ TSK_DEBUG_ERROR("Failed to create G.722 decoder state");
+ return -2;
+ }
+ // Create and/or reset the G.722 decoder
+ // Bitrate 64 kbps and wideband mode (2)
+ if (!(g722->dec_state = g722_decode_init(g722->dec_state, 64000, 2))) {
+ TSK_DEBUG_ERROR("g722_decode_init failed");
+ return -3;
+ }
+ }
+
+ // Initialize the encoder
+ if (!g722->enc_state) {
+ if (!(g722->enc_state = tsk_calloc(1, sizeof(g722_encode_state_t)))) {
+ TSK_DEBUG_ERROR("Failed to create G.722 encoder state");
+ return -4;
+ }
+ // Create and/or reset the G.722 encoder
+ // Bitrate 64 kbps and wideband mode (2)
+ if (!(g722->enc_state = g722_encode_init(g722->enc_state, 64000, 2))) {
+ TSK_DEBUG_ERROR("g722_encode_init failed");
+ return -5;
+ }
+ }
+
+ return 0;
}
static int tdav_codec_g722_close(tmedia_codec_t* self)
{
- tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
+ tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
- (void)(g722);
+ (void)(g722);
- /* resources will be freed by the dctor() */
+ /* resources will be freed by the dctor() */
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_g722_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tsk_size_t out_g722_size;
- tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
+ tsk_size_t out_g722_size;
+ tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
- if (!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if (!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- out_g722_size = in_size >> 2;
+ out_g722_size = in_size >> 2;
- if (*out_max_size < out_g722_size){
- if (!(*out_data = tsk_realloc(*out_data, out_g722_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_g722_size;
- }
+ if (*out_max_size < out_g722_size) {
+ if (!(*out_data = tsk_realloc(*out_data, out_g722_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_g722_size;
+ }
- g722_encode(g722->enc_state, (uint8_t*)*out_data, (int16_t*)in_data, (int)in_size / sizeof(int16_t));
+ g722_encode(g722->enc_state, (uint8_t*)*out_data, (int16_t*)in_data, (int)in_size / sizeof(int16_t));
- return out_g722_size;
+ return out_g722_size;
}
static tsk_size_t tdav_codec_g722_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
-
- if (!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* allocate new buffer */
- if (*out_max_size < (in_size << 2)){
- if (!(*out_data = tsk_realloc(*out_data, in_size << 2))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = in_size << 2;
- }
-
- g722_decode(g722->dec_state, (int16_t*)*out_data, (uint8_t*)in_data, (int)in_size);
-
- return (in_size << 2);
+ tdav_codec_g722_t* g722 = (tdav_codec_g722_t*)self;
+
+ if (!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* allocate new buffer */
+ if (*out_max_size < (in_size << 2)) {
+ if (!(*out_data = tsk_realloc(*out_data, in_size << 2))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = in_size << 2;
+ }
+
+ g722_decode(g722->dec_state, (int16_t*)*out_data, (uint8_t*)in_data, (int)in_size);
+
+ return (in_size << 2);
}
static tsk_bool_t tdav_codec_g722_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- return tsk_true;
+ return tsk_true;
}
static char* tdav_codec_g722_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- return tsk_null;
+ return tsk_null;
}
//
@@ -153,67 +152,65 @@ static char* tdav_codec_g722_sdp_att_get(const tmedia_codec_t* codec, const char
/* constructor */
static tsk_object_t* tdav_codec_g722_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_g722_t *g722 = self;
- if (g722){
- /* init base: called by tmedia_codec_create() */
- /* init self */
+ tdav_codec_g722_t *g722 = self;
+ if (g722) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
- }
- return self;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_g722_dtor(tsk_object_t * self)
{
- tdav_codec_g722_t *g722 = self;
- if (g722){
- /* deinit base */
- tmedia_codec_audio_deinit(g722);
- /* deinit self */
- if (g722->enc_state){
- g722_encode_release(g722->enc_state), g722->enc_state = tsk_null;
- }
- if (g722->dec_state){
- g722_decode_release(g722->dec_state), g722->dec_state = tsk_null;
- }
- }
-
- return self;
+ tdav_codec_g722_t *g722 = self;
+ if (g722) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(g722);
+ /* deinit self */
+ if (g722->enc_state) {
+ g722_encode_release(g722->enc_state), g722->enc_state = tsk_null;
+ }
+ if (g722->dec_state) {
+ g722_decode_release(g722->dec_state), g722->dec_state = tsk_null;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_g722_def_s =
-{
- sizeof(tdav_codec_g722_t),
- tdav_codec_g722_ctor,
- tdav_codec_g722_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_g722_def_s = {
+ sizeof(tdav_codec_g722_t),
+ tdav_codec_g722_ctor,
+ tdav_codec_g722_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_g722_plugin_def_s =
-{
- &tdav_codec_g722_def_s,
-
- tmedia_audio,
- tmedia_codec_id_g722,
- "G722",
- "g722 Codec (native)",
- TMEDIA_CODEC_FORMAT_G722,
- tsk_false,
- 16000,
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- { 0 },
-
- tsk_null, // set()
- tdav_codec_g722_open,
- tdav_codec_g722_close,
- tdav_codec_g722_encode,
- tdav_codec_g722_decode,
- tdav_codec_g722_sdp_att_match,
- tdav_codec_g722_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_g722_plugin_def_s = {
+ &tdav_codec_g722_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_g722,
+ "G722",
+ "g722 Codec (native)",
+ TMEDIA_CODEC_FORMAT_G722,
+ tsk_false,
+ 16000,
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ { 0 },
+
+ tsk_null, // set()
+ tdav_codec_g722_open,
+ tdav_codec_g722_close,
+ tdav_codec_g722_encode,
+ tdav_codec_g722_decode,
+ tdav_codec_g722_sdp_att_match,
+ tdav_codec_g722_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_g722_plugin_def_t = &tdav_codec_g722_plugin_def_s;
diff --git a/tinyDAV/src/codecs/g729/tdav_codec_g729.c b/tinyDAV/src/codecs/g729/tdav_codec_g729.c
index 8981687..43b3425 100755
--- a/tinyDAV/src/codecs/g729/tdav_codec_g729.c
+++ b/tinyDAV/src/codecs/g729/tdav_codec_g729.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,210 +65,210 @@ static void pack_SID(const int16_t ituBits[], uint8_t bitstream[]);
static int tdav_codec_g729ab_open(tmedia_codec_t* self)
{
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
-
- // Initialize the decoder
- bad_lsf = 0;
- g729a->decoder.synth = (g729a->decoder.synth_buf + M);
-
- Init_Decod_ld8a();
- Init_Post_Filter();
- Init_Post_Process();
- /* for G.729B */
- Init_Dec_cng();
-
- // Initialize the encoder
- Init_Pre_Process();
- Init_Coder_ld8a();
- Set_zero(g729a->encoder.prm, PRM_SIZE + 1);
- /* for G.729B */
- Init_Cod_cng();
-
-
- return 0;
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
+
+ // Initialize the decoder
+ bad_lsf = 0;
+ g729a->decoder.synth = (g729a->decoder.synth_buf + M);
+
+ Init_Decod_ld8a();
+ Init_Post_Filter();
+ Init_Post_Process();
+ /* for G.729B */
+ Init_Dec_cng();
+
+ // Initialize the encoder
+ Init_Pre_Process();
+ Init_Coder_ld8a();
+ Set_zero(g729a->encoder.prm, PRM_SIZE + 1);
+ /* for G.729B */
+ Init_Cod_cng();
+
+
+ return 0;
}
static int tdav_codec_g729ab_close(tmedia_codec_t* self)
{
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
+
+ (void)(g729a);
+
+ /* resources will be freed by the dctor() */
- (void)(g729a);
-
- /* resources will be freed by the dctor() */
-
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_g729ab_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tsk_size_t ex_size, out_size = 0;
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
- int i, frame_count = (in_size / 160);
-
-
- if(!self || !in_data || !in_size || !out_data || (in_size % 160)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- ex_size = (frame_count * 10);
-
- // allocate new buffer if needed
- if(*out_max_size <ex_size){
- if(!(*out_data = tsk_realloc(*out_data, ex_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = ex_size;
- }
-
- for(i=0; i<frame_count; i++){
- extern int16_t *new_speech;
-
- if(g729a->encoder.frame == 32767){
- g729a->encoder.frame = 256;
- }
- else{
- g729a->encoder.frame++;
- }
-
- memcpy(new_speech, &((uint8_t*)in_data)[i*L_FRAME*sizeof(int16_t)], sizeof(int16_t)*L_FRAME);
-
- Pre_Process(new_speech, L_FRAME);
- Coder_ld8a(g729a->encoder.prm, g729a->encoder.frame, g729a->encoder.vad_enable);
- prm2bits_ld8k(g729a->encoder.prm, g729a->encoder.serial);
-
- if(g729a->encoder.serial[1] == RATE_8000){
- pack_G729(&g729a->encoder.serial[2], &((uint8_t*)(*out_data))[out_size]);
- out_size += 10;
- }
- else if(g729a->encoder.serial[1] == RATE_SID_OCTET){
- pack_SID(&g729a->encoder.serial[2], &((uint8_t*)(*out_data))[out_size]);
- out_size += 2;
- }
- else{ // RATE_0
- //TSK_DEBUG_INFO("G729_RATE_0 - Not transmitted");
+{
+ tsk_size_t ex_size, out_size = 0;
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
+ int i, frame_count = (in_size / 160);
+
+
+ if(!self || !in_data || !in_size || !out_data || (in_size % 160)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ ex_size = (frame_count * 10);
+
+ // allocate new buffer if needed
+ if(*out_max_size <ex_size) {
+ if(!(*out_data = tsk_realloc(*out_data, ex_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = ex_size;
+ }
+
+ for(i=0; i<frame_count; i++) {
+ extern int16_t *new_speech;
+
+ if(g729a->encoder.frame == 32767) {
+ g729a->encoder.frame = 256;
+ }
+ else {
+ g729a->encoder.frame++;
+ }
+
+ memcpy(new_speech, &((uint8_t*)in_data)[i*L_FRAME*sizeof(int16_t)], sizeof(int16_t)*L_FRAME);
+
+ Pre_Process(new_speech, L_FRAME);
+ Coder_ld8a(g729a->encoder.prm, g729a->encoder.frame, g729a->encoder.vad_enable);
+ prm2bits_ld8k(g729a->encoder.prm, g729a->encoder.serial);
+
+ if(g729a->encoder.serial[1] == RATE_8000) {
+ pack_G729(&g729a->encoder.serial[2], &((uint8_t*)(*out_data))[out_size]);
+ out_size += 10;
+ }
+ else if(g729a->encoder.serial[1] == RATE_SID_OCTET) {
+ pack_SID(&g729a->encoder.serial[2], &((uint8_t*)(*out_data))[out_size]);
+ out_size += 2;
+ }
+ else { // RATE_0
+ //TSK_DEBUG_INFO("G729_RATE_0 - Not transmitted");
if (!g729a->encoder.vad_enable) {
// silence
memset(&((uint8_t*)(*out_data))[out_size], 0, 10);
out_size += 10;
}
- }
- }
+ }
+ }
- return out_size;
+ return out_size;
}
static tsk_size_t tdav_codec_g729ab_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size = 0;
- int i, frame_count;
- const uint8_t* data_start = (const uint8_t*)in_data;
- const uint8_t* data_end;
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
-
- if(!self || !in_data || !in_size || !out_data || ((in_size % 10) && (in_size % 10 != 2))){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- data_end = (data_start + in_size);
-
- frame_count = (in_size/10) + ((in_size % 10) ? 1 : 0);
-
- out_size = 160*frame_count;
-
- /* allocate new buffer if needed */
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- for(i=0; i<frame_count; i++){
- memset(g729a->decoder.synth_buf, 0, M);
- g729a->decoder.synth = g729a->decoder.synth_buf + M;
-
- if((data_end - data_start) == 2){
- unpack_SID(data_start, g729a->decoder.serial);
- data_start += 2;
- }
- else{
- unpack_G729(data_start, g729a->decoder.serial, 10);
- data_start += 10;
- }
-
- bits2prm_ld8k(&g729a->decoder.serial[1], g729a->decoder.parm);
-
- /* This part was modified for version V1.3 */
- /* for speech and SID frames, the hardware detects frame erasures
- by checking if all bits are set to zero */
- /* for untransmitted frames, the hardware detects frame erasures
- by testing serial[0] */
-
- g729a->decoder.parm[0] = 0; /* No frame erasure */
- if(g729a->decoder.serial[1] != 0) {
- int j;
- for (j=0; j < g729a->decoder.serial[1]; j++){
- if (g729a->decoder.serial[j+2] == 0){
- g729a->decoder.parm[0] = 1; /* frame erased */
- break;
- }
- }
- }
- else if(g729a->decoder.serial[0] != SYNC_WORD){
- g729a->decoder.parm[0] = 1;
- }
- if(g729a->decoder.parm[1] == 1) {
- /* check parity and put 1 in parm[5] if parity error */
- g729a->decoder.parm[5] = Check_Parity_Pitch(g729a->decoder.parm[4], g729a->decoder.parm[5]);
- }
-
- Decod_ld8a(g729a->decoder.parm, g729a->decoder.synth, g729a->decoder.Az_dec, g729a->decoder.T2, &g729a->decoder.Vad);
- Post_Filter(g729a->decoder.synth, g729a->decoder.Az_dec, g729a->decoder.T2, g729a->decoder.Vad); /* Post-filter */
- Post_Process(g729a->decoder.synth, L_FRAME);
-
- memcpy(&((uint8_t*)*out_data)[160*i], g729a->decoder.synth, 160);
- }
-
-
- return out_size;
+ tsk_size_t out_size = 0;
+ int i, frame_count;
+ const uint8_t* data_start = (const uint8_t*)in_data;
+ const uint8_t* data_end;
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data || ((in_size % 10) && (in_size % 10 != 2))) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ data_end = (data_start + in_size);
+
+ frame_count = (in_size/10) + ((in_size % 10) ? 1 : 0);
+
+ out_size = 160*frame_count;
+
+ /* allocate new buffer if needed */
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ for(i=0; i<frame_count; i++) {
+ memset(g729a->decoder.synth_buf, 0, M);
+ g729a->decoder.synth = g729a->decoder.synth_buf + M;
+
+ if((data_end - data_start) == 2) {
+ unpack_SID(data_start, g729a->decoder.serial);
+ data_start += 2;
+ }
+ else {
+ unpack_G729(data_start, g729a->decoder.serial, 10);
+ data_start += 10;
+ }
+
+ bits2prm_ld8k(&g729a->decoder.serial[1], g729a->decoder.parm);
+
+ /* This part was modified for version V1.3 */
+ /* for speech and SID frames, the hardware detects frame erasures
+ by checking if all bits are set to zero */
+ /* for untransmitted frames, the hardware detects frame erasures
+ by testing serial[0] */
+
+ g729a->decoder.parm[0] = 0; /* No frame erasure */
+ if(g729a->decoder.serial[1] != 0) {
+ int j;
+ for (j=0; j < g729a->decoder.serial[1]; j++) {
+ if (g729a->decoder.serial[j+2] == 0) {
+ g729a->decoder.parm[0] = 1; /* frame erased */
+ break;
+ }
+ }
+ }
+ else if(g729a->decoder.serial[0] != SYNC_WORD) {
+ g729a->decoder.parm[0] = 1;
+ }
+ if(g729a->decoder.parm[1] == 1) {
+ /* check parity and put 1 in parm[5] if parity error */
+ g729a->decoder.parm[5] = Check_Parity_Pitch(g729a->decoder.parm[4], g729a->decoder.parm[5]);
+ }
+
+ Decod_ld8a(g729a->decoder.parm, g729a->decoder.synth, g729a->decoder.Az_dec, g729a->decoder.T2, &g729a->decoder.Vad);
+ Post_Filter(g729a->decoder.synth, g729a->decoder.Az_dec, g729a->decoder.T2, g729a->decoder.Vad); /* Post-filter */
+ Post_Process(g729a->decoder.synth, L_FRAME);
+
+ memcpy(&((uint8_t*)*out_data)[160*i], g729a->decoder.synth, 160);
+ }
+
+
+ return out_size;
}
static tsk_bool_t tdav_codec_g729ab_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)codec;
-
- if(tsk_striequals(att_name, "fmtp")){
- tsk_params_L_t* params = tsk_null;
- const char* val_str;
- if((params = tsk_params_fromstring(att_value, ";", tsk_true))){
- if((val_str = tsk_params_get_param_value(params, "annexb"))){
+{
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)codec;
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ tsk_params_L_t* params = tsk_null;
+ const char* val_str;
+ if((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+ if((val_str = tsk_params_get_param_value(params, "annexb"))) {
g729a->encoder.vad_enable &= tsk_strequals(val_str, "yes") ? 1 : 0;
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
- }
- return tsk_true;
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ }
+ return tsk_true;
}
static char* tdav_codec_g729ab_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)codec;
-
- if(tsk_striequals(att_name, "fmtp")){
- if(g729a->encoder.vad_enable){
- return tsk_strdup("annexb=yes");
- }
- else{
- return tsk_strdup("annexb=no");
- }
- }
- return tsk_null;
+ tdav_codec_g729ab_t* g729a = (tdav_codec_g729ab_t*)codec;
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ if(g729a->encoder.vad_enable) {
+ return tsk_strdup("annexb=yes");
+ }
+ else {
+ return tsk_strdup("annexb=no");
+ }
+ }
+ return tsk_null;
}
@@ -287,18 +287,18 @@ static char* tdav_codec_g729ab_sdp_att_get(const tmedia_codec_t* codec, const ch
*/
static int16_t bin2int(int16_t no_of_bits, const int16_t *bitstream)
{
- int16_t value, i;
- int16_t bit;
-
- value = 0;
- for(i = 0; i < no_of_bits; i++){
- value <<= 1;
- bit = *bitstream++;
- if (bit == BIT_1){
- value += 1;
- }
- }
- return(value);
+ int16_t value, i;
+ int16_t bit;
+
+ value = 0;
+ for(i = 0; i < no_of_bits; i++) {
+ value <<= 1;
+ bit = *bitstream++;
+ if (bit == BIT_1) {
+ value += 1;
+ }
+ }
+ return(value);
}
/*----------------------------------------------------------------------------
@@ -314,21 +314,21 @@ static int16_t bin2int(int16_t no_of_bits, const int16_t *bitstream)
*/
static void int2bin(int16_t value, int16_t no_of_bits, int16_t *bitstream)
{
- int16_t *pt_bitstream;
- int16_t i, bit;
-
- pt_bitstream = bitstream + no_of_bits;
-
- for (i = 0; i < no_of_bits; i++){
- bit = value & (int16_t)0x0001; /* get lsb */
- if (bit == 0){
- *--pt_bitstream = BIT_0;
- }
- else{
- *--pt_bitstream = BIT_1;
- }
- value >>= 1;
- }
+ int16_t *pt_bitstream;
+ int16_t i, bit;
+
+ pt_bitstream = bitstream + no_of_bits;
+
+ for (i = 0; i < no_of_bits; i++) {
+ bit = value & (int16_t)0x0001; /* get lsb */
+ if (bit == 0) {
+ *--pt_bitstream = BIT_0;
+ }
+ else {
+ *--pt_bitstream = BIT_1;
+ }
+ value >>= 1;
+ }
}
/**
@@ -337,24 +337,24 @@ static void int2bin(int16_t value, int16_t no_of_bits, int16_t *bitstream)
* @param bits ITU bitstream used as destination (0 - BIT_0, 1 - BIT_1)
* @param len length of the RTP bitstream
*/
-static void unpack_G729(const uint8_t bitstream[], int16_t bits[], int len)
-{
- int16_t i;
- *bits++ = SYNC_WORD; /* bit[0], at receiver this bits indicates BFI */
- switch(len){
- case 10:
- *bits++ = SIZE_WORD;
- break;
- case 8: // RATE_6400
- case 15: //RATE_11800
- default:
- TSK_DEBUG_ERROR("%d is an invalid lenght value", len);
- return;
- }
-
- for(i=0; i<len; i++){
- int2bin(bitstream[i], 8, &bits[i*8]);
- }
+static void unpack_G729(const uint8_t bitstream[], int16_t bits[], int len)
+{
+ int16_t i;
+ *bits++ = SYNC_WORD; /* bit[0], at receiver this bits indicates BFI */
+ switch(len) {
+ case 10:
+ *bits++ = SIZE_WORD;
+ break;
+ case 8: // RATE_6400
+ case 15: //RATE_11800
+ default:
+ TSK_DEBUG_ERROR("%d is an invalid lenght value", len);
+ return;
+ }
+
+ for(i=0; i<len; i++) {
+ int2bin(bitstream[i], 8, &bits[i*8]);
+ }
}
/**
@@ -363,11 +363,11 @@ static void unpack_G729(const uint8_t bitstream[], int16_t bits[], int len)
* @param bits ITU bitstream used as destination (0 - BIT_0, 1 - BIT_1)
*/
static void unpack_SID(const uint8_t bitstream[], int16_t bits[])
-{
- *bits++ = SYNC_WORD;
- *bits++ = RATE_SID_OCTET;
- int2bin((int16_t)bitstream[0], 8, &bits[0]);
- int2bin((int16_t)bitstream[1], 8, &bits[8]);
+{
+ *bits++ = SYNC_WORD;
+ *bits++ = RATE_SID_OCTET;
+ int2bin((int16_t)bitstream[0], 8, &bits[0]);
+ int2bin((int16_t)bitstream[1], 8, &bits[8]);
}
/**
@@ -376,9 +376,9 @@ static void unpack_SID(const uint8_t bitstream[], int16_t bits[])
* @param bitstream RTP bitstream (80 bits, 5 shorts, 10 bytes)
*/
static void pack_G729(const int16_t ituBits[], uint8_t bitstream[])
-{
+{
int16_t word16, i;
- for(i=0; i<5; i++){
+ for(i=0; i<5; i++) {
word16 = bin2int(16, (int16_t*)&ituBits[i*16]);
bitstream[i*2] = word16>>8, bitstream[(i*2)+1] = (word16 & 0xFF);
}
@@ -390,10 +390,10 @@ static void pack_G729(const int16_t ituBits[], uint8_t bitstream[])
* @param bitstream RTP bitstream (15 bits, 1 short, 2 bytes)
*/
static void pack_SID(const int16_t ituBits[], uint8_t bitstream[])
-{
+{
int16_t word16 = bin2int(16, ituBits);
bitstream[0] = word16>>8, bitstream[1] = (word16 & 0xFF);
-}
+}
//
@@ -403,63 +403,61 @@ static void pack_SID(const int16_t ituBits[], uint8_t bitstream[])
/* constructor */
static tsk_object_t* tdav_codec_g729ab_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_g729ab_t *g729a = self;
- if(g729a){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- g729a->encoder.vad_enable = G729_ENABLE_VAD; // AnnexB
- }
- return self;
+ tdav_codec_g729ab_t *g729a = self;
+ if(g729a) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ g729a->encoder.vad_enable = G729_ENABLE_VAD; // AnnexB
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_g729ab_dtor(tsk_object_t * self)
-{
- tdav_codec_g729ab_t *g729a = self;
- if(g729a){
- /* deinit base */
- tmedia_codec_audio_deinit(g729a);
- /* deinit self */
-
- }
-
- return self;
+{
+ tdav_codec_g729ab_t *g729a = self;
+ if(g729a) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(g729a);
+ /* deinit self */
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_g729ab_def_s =
-{
- sizeof(tdav_codec_g729ab_t),
- tdav_codec_g729ab_ctor,
- tdav_codec_g729ab_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_g729ab_def_s = {
+ sizeof(tdav_codec_g729ab_t),
+ tdav_codec_g729ab_ctor,
+ tdav_codec_g729ab_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_g729ab_plugin_def_s =
-{
- &tdav_codec_g729ab_def_s,
-
- tmedia_audio,
- tmedia_codec_id_g729ab,
- "g729",
- "g729ab Codec (libg729)",
- TMEDIA_CODEC_FORMAT_G729,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tdav_codec_g729ab_set,
- tdav_codec_g729ab_open,
- tdav_codec_g729ab_close,
- tdav_codec_g729ab_encode,
- tdav_codec_g729ab_decode,
- tdav_codec_g729ab_sdp_att_match,
- tdav_codec_g729ab_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_g729ab_plugin_def_s = {
+ &tdav_codec_g729ab_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_g729ab,
+ "g729",
+ "g729ab Codec (libg729)",
+ TMEDIA_CODEC_FORMAT_G729,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tdav_codec_g729ab_set,
+ tdav_codec_g729ab_open,
+ tdav_codec_g729ab_close,
+ tdav_codec_g729ab_encode,
+ tdav_codec_g729ab_decode,
+ tdav_codec_g729ab_sdp_att_match,
+ tdav_codec_g729ab_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_g729ab_plugin_def_t = &tdav_codec_g729ab_plugin_def_s;
diff --git a/tinyDAV/src/codecs/gsm/tdav_codec_gsm.c b/tinyDAV/src/codecs/gsm/tdav_codec_gsm.c
index 8b5f1bc..31e5139 100755
--- a/tinyDAV/src/codecs/gsm/tdav_codec_gsm.c
+++ b/tinyDAV/src/codecs/gsm/tdav_codec_gsm.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,94 +43,95 @@
int tdav_codec_gsm_open(tmedia_codec_t* self)
{
- tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
-
- if(!gsm->encoder && !(gsm->encoder = gsm_create())){
- TSK_DEBUG_ERROR("Failed to create GSM encoder");
- return -2;
- }
- if(!gsm->decoder && !(gsm->decoder = gsm_create())){
- TSK_DEBUG_ERROR("Failed to create GSM decoder");
- return -3;
- }
-
- return 0;
+ tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
+
+ if(!gsm->encoder && !(gsm->encoder = gsm_create())) {
+ TSK_DEBUG_ERROR("Failed to create GSM encoder");
+ return -2;
+ }
+ if(!gsm->decoder && !(gsm->decoder = gsm_create())) {
+ TSK_DEBUG_ERROR("Failed to create GSM decoder");
+ return -3;
+ }
+
+ return 0;
}
int tdav_codec_gsm_close(tmedia_codec_t* self)
{
- tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
-
- if(gsm->encoder){
- gsm_destroy(gsm->encoder);
- gsm->encoder = tsk_null;
- }
- if(gsm->decoder){
- gsm_destroy(gsm->decoder);
- gsm->decoder = tsk_null;
- }
-
- return 0;
+ tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
+
+ if(gsm->encoder) {
+ gsm_destroy(gsm->encoder);
+ gsm->encoder = tsk_null;
+ }
+ if(gsm->decoder) {
+ gsm_destroy(gsm->decoder);
+ gsm->decoder = tsk_null;
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_gsm_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tsk_size_t out_size;
- tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- out_size = ((in_size / (TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(self) * sizeof(short))) * TDAV_GSM_FRAME_SIZE);
-
- /* allocate new buffer if needed */
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- gsm_encode(gsm->encoder, (gsm_signal*)in_data, (gsm_byte*)*out_data);
-
- return out_size;
+{
+ tsk_size_t out_size;
+ tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ out_size = ((in_size / (TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_ENCODING(self) * sizeof(short))) * TDAV_GSM_FRAME_SIZE);
+
+ /* allocate new buffer if needed */
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ gsm_encode(gsm->encoder, (gsm_signal*)in_data, (gsm_byte*)*out_data);
+
+ return out_size;
}
tsk_size_t tdav_codec_gsm_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size;
- int ret;
- tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
-
- if(!self || !in_data || !in_size || !out_data || (in_size % TDAV_GSM_FRAME_SIZE)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- out_size = (in_size / TDAV_GSM_FRAME_SIZE) * (TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_DECODING(self) * sizeof(short));
-
- /* allocate new buffer if needed */
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- ret = gsm_decode(gsm->decoder, (gsm_byte*)in_data, (gsm_signal*)*out_data);
-
- return out_size;
+ tsk_size_t out_size;
+ int ret;
+ tdav_codec_gsm_t* gsm = (tdav_codec_gsm_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data || (in_size % TDAV_GSM_FRAME_SIZE)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ out_size = (in_size / TDAV_GSM_FRAME_SIZE) * (TMEDIA_CODEC_PCM_FRAME_SIZE_AUDIO_DECODING(self) * sizeof(short));
+
+ /* allocate new buffer if needed */
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ ret = gsm_decode(gsm->decoder, (gsm_byte*)in_data, (gsm_signal*)*out_data);
+
+ return out_size;
}
tsk_bool_t tdav_codec_gsm_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
@@ -141,67 +142,65 @@ tsk_bool_t tdav_codec_gsm_sdp_att_match(const tmedia_codec_t* codec, const char*
/* constructor */
static tsk_object_t* tdav_codec_gsm_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_gsm_t *gsm = self;
- if(gsm){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_gsm_t *gsm = self;
+ if(gsm) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_gsm_dtor(tsk_object_t * self)
-{
- tdav_codec_gsm_t *gsm = self;
- if(gsm){
- /* deinit base */
- tmedia_codec_audio_deinit(gsm);
- /* deinit self */
- if(gsm->encoder){
- gsm_destroy(gsm->encoder);
- }
- if(gsm->decoder){
- gsm_destroy(gsm->decoder);
- }
- }
-
- return self;
+{
+ tdav_codec_gsm_t *gsm = self;
+ if(gsm) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(gsm);
+ /* deinit self */
+ if(gsm->encoder) {
+ gsm_destroy(gsm->encoder);
+ }
+ if(gsm->decoder) {
+ gsm_destroy(gsm->decoder);
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_gsm_def_s =
-{
- sizeof(tdav_codec_gsm_t),
- tdav_codec_gsm_ctor,
- tdav_codec_gsm_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_gsm_def_s = {
+ sizeof(tdav_codec_gsm_t),
+ tdav_codec_gsm_ctor,
+ tdav_codec_gsm_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_gsm_plugin_def_s =
-{
- &tdav_codec_gsm_def_s,
-
- tmedia_audio,
- tmedia_codec_id_gsm,
- "GSM",
- "GSM Full Rate (libgsm)",
- TMEDIA_CODEC_FORMAT_GSM,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_gsm_open,
- tdav_codec_gsm_close,
- tdav_codec_gsm_encode,
- tdav_codec_gsm_decode,
- tdav_codec_gsm_sdp_att_match,
- tdav_codec_gsm_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_gsm_plugin_def_s = {
+ &tdav_codec_gsm_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_gsm,
+ "GSM",
+ "GSM Full Rate (libgsm)",
+ TMEDIA_CODEC_FORMAT_GSM,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_gsm_open,
+ tdav_codec_gsm_close,
+ tdav_codec_gsm_encode,
+ tdav_codec_gsm_decode,
+ tdav_codec_gsm_sdp_att_match,
+ tdav_codec_gsm_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_gsm_plugin_def_t = &tdav_codec_gsm_plugin_def_s;
diff --git a/tinyDAV/src/codecs/h261/tdav_codec_h261.c b/tinyDAV/src/codecs/h261/tdav_codec_h261.c
index 27aaab7..687bc68 100755
--- a/tinyDAV/src/codecs/h261/tdav_codec_h261.c
+++ b/tinyDAV/src/codecs/h261/tdav_codec_h261.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -57,375 +57,373 @@ static void tdav_codec_h261_encap(const tdav_codec_h261_t* h261, const uint8_t*
//
int tdav_codec_h261_open(tmedia_codec_t* self)
{
- int ret;
- int size;
-
- tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
-
- if(!h261){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
- //
- // Encoder
- //
- if(!(h261->encoder.codec = avcodec_find_encoder(CODEC_ID_H261))){
- TSK_DEBUG_ERROR("Failed to find H.261 encoder");
- return -2;
- }
- h261->encoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(h261->encoder.context);
-
- h261->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- h261->encoder.context->time_base.num = 1;
- h261->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(h261)->out.fps;
- h261->encoder.context->width = TMEDIA_CODEC_VIDEO(h261)->out.width;
- h261->encoder.context->height = TMEDIA_CODEC_VIDEO(h261)->out.height;
-
- /*h261->encoder.context->mb_qmin =*/ h261->encoder.context->qmin = 4;
- /*h261->encoder.context->mb_qmax =*/ h261->encoder.context->qmax = 31;
- h261->encoder.context->mb_decision = FF_MB_DECISION_SIMPLE;
-
- h261->encoder.context->thread_count = 1;
- h261->encoder.context->rtp_payload_size = RTP_PAYLOAD_SIZE;
- h261->encoder.context->opaque = tsk_null;
- h261->encoder.context->bit_rate = (float) (500000) * 0.80f;
- h261->encoder.context->bit_rate_tolerance = (int) (500000 * 0.20f);
- h261->encoder.context->gop_size = TMEDIA_CODEC_VIDEO(h261)->out.fps*4; /* each 4 seconds */
-
- // Picture (YUV 420)
- if(!(h261->encoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create encoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(h261->encoder.picture);
- //if((ret = avpicture_alloc((AVPicture*)h261->encoder.picture, PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height))){
- // TSK_DEBUG_ERROR("Failed to allocate encoder picture");
- // return ret;
- //}
-
- size = avpicture_get_size(PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height);
- if(!(h261->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
- return -2;
- }
-
- // Open encoder
- if((ret = avcodec_open(h261->encoder.context, h261->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open H.261 encoder");
- return ret;
- }
-
- //
- // Decoder
- //
- if(!(h261->decoder.codec = avcodec_find_decoder(CODEC_ID_H261))){
- TSK_DEBUG_ERROR("Failed to find H.261 decoder");
- }
- h261->decoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(h261->decoder.context);
-
- h261->decoder.context->pix_fmt = PIX_FMT_YUV420P;
- h261->decoder.context->width = TMEDIA_CODEC_VIDEO(h261)->in.width;
- h261->decoder.context->height = TMEDIA_CODEC_VIDEO(h261)->in.height;
-
- // Picture (YUV 420)
- if(!(h261->decoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create decoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(h261->decoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, h261->decoder.context->width, h261->decoder.context->height);
- if(!(h261->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- // Open decoder
- if((ret = avcodec_open(h261->decoder.context, h261->decoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open H.261 decoder");
- return ret;
- }
-
- return 0;
+ int ret;
+ int size;
+
+ tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
+
+ if(!h261) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+ //
+ // Encoder
+ //
+ if(!(h261->encoder.codec = avcodec_find_encoder(CODEC_ID_H261))) {
+ TSK_DEBUG_ERROR("Failed to find H.261 encoder");
+ return -2;
+ }
+ h261->encoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(h261->encoder.context);
+
+ h261->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ h261->encoder.context->time_base.num = 1;
+ h261->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(h261)->out.fps;
+ h261->encoder.context->width = TMEDIA_CODEC_VIDEO(h261)->out.width;
+ h261->encoder.context->height = TMEDIA_CODEC_VIDEO(h261)->out.height;
+
+ /*h261->encoder.context->mb_qmin =*/ h261->encoder.context->qmin = 4;
+ /*h261->encoder.context->mb_qmax =*/ h261->encoder.context->qmax = 31;
+ h261->encoder.context->mb_decision = FF_MB_DECISION_SIMPLE;
+
+ h261->encoder.context->thread_count = 1;
+ h261->encoder.context->rtp_payload_size = RTP_PAYLOAD_SIZE;
+ h261->encoder.context->opaque = tsk_null;
+ h261->encoder.context->bit_rate = (float) (500000) * 0.80f;
+ h261->encoder.context->bit_rate_tolerance = (int) (500000 * 0.20f);
+ h261->encoder.context->gop_size = TMEDIA_CODEC_VIDEO(h261)->out.fps*4; /* each 4 seconds */
+
+ // Picture (YUV 420)
+ if(!(h261->encoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create encoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(h261->encoder.picture);
+ //if((ret = avpicture_alloc((AVPicture*)h261->encoder.picture, PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height))){
+ // TSK_DEBUG_ERROR("Failed to allocate encoder picture");
+ // return ret;
+ //}
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height);
+ if(!(h261->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
+ return -2;
+ }
+
+ // Open encoder
+ if((ret = avcodec_open(h261->encoder.context, h261->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open H.261 encoder");
+ return ret;
+ }
+
+ //
+ // Decoder
+ //
+ if(!(h261->decoder.codec = avcodec_find_decoder(CODEC_ID_H261))) {
+ TSK_DEBUG_ERROR("Failed to find H.261 decoder");
+ }
+ h261->decoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(h261->decoder.context);
+
+ h261->decoder.context->pix_fmt = PIX_FMT_YUV420P;
+ h261->decoder.context->width = TMEDIA_CODEC_VIDEO(h261)->in.width;
+ h261->decoder.context->height = TMEDIA_CODEC_VIDEO(h261)->in.height;
+
+ // Picture (YUV 420)
+ if(!(h261->decoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create decoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(h261->decoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, h261->decoder.context->width, h261->decoder.context->height);
+ if(!(h261->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ // Open decoder
+ if((ret = avcodec_open(h261->decoder.context, h261->decoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open H.261 decoder");
+ return ret;
+ }
+
+ return 0;
}
int tdav_codec_h261_close(tmedia_codec_t* self)
{
- tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
-
- if(!h261){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is opened */
-
- //
- // Encoder
- //
- if(h261->encoder.context){
- avcodec_close(h261->encoder.context);
- av_free(h261->encoder.context);
- h261->encoder.context = tsk_null;
- }
- if(h261->encoder.picture){
- av_free(h261->encoder.picture);
- }
- if(h261->encoder.buffer){
- TSK_FREE(h261->encoder.buffer);
- }
-
- //
- // Decoder
- //
- if(h261->decoder.context){
- avcodec_close(h261->decoder.context);
- av_free(h261->decoder.context);
- h261->decoder.context = tsk_null;
- }
- if(h261->decoder.picture){
- av_free(h261->decoder.picture);
- h261->decoder.picture = tsk_null;
- }
- if(h261->decoder.accumulator){
- TSK_FREE(h261->decoder.accumulator);
- h261->decoder.accumulator_pos = 0;
- }
-
- return 0;
+ tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
+
+ if(!h261) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is opened */
+
+ //
+ // Encoder
+ //
+ if(h261->encoder.context) {
+ avcodec_close(h261->encoder.context);
+ av_free(h261->encoder.context);
+ h261->encoder.context = tsk_null;
+ }
+ if(h261->encoder.picture) {
+ av_free(h261->encoder.picture);
+ }
+ if(h261->encoder.buffer) {
+ TSK_FREE(h261->encoder.buffer);
+ }
+
+ //
+ // Decoder
+ //
+ if(h261->decoder.context) {
+ avcodec_close(h261->decoder.context);
+ av_free(h261->decoder.context);
+ h261->decoder.context = tsk_null;
+ }
+ if(h261->decoder.picture) {
+ av_free(h261->decoder.picture);
+ h261->decoder.picture = tsk_null;
+ }
+ if(h261->decoder.accumulator) {
+ TSK_FREE(h261->decoder.accumulator);
+ h261->decoder.accumulator_pos = 0;
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_h261_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret;
- int size;
-
- tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // delete old buffer
- if(*out_data){
- TSK_FREE(*out_data);
- }
-
- // wrap yuv420 buffer
- size = avpicture_fill((AVPicture *)h261->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height);
- if(size != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
-
- // Encode data
- h261->encoder.picture->pts = AV_NOPTS_VALUE;
- //h261->encoder.picture->pict_type = FF_I_TYPE;
- ret = avcodec_encode_video(h261->encoder.context, h261->encoder.buffer, size, h261->encoder.picture);
- if(ret > 0){
- tdav_codec_h261_encap(h261, h261->encoder.buffer, (tsk_size_t)ret);
- }
-
- return 0;
+ int ret;
+ int size;
+
+ tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // delete old buffer
+ if(*out_data) {
+ TSK_FREE(*out_data);
+ }
+
+ // wrap yuv420 buffer
+ size = avpicture_fill((AVPicture *)h261->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h261->encoder.context->width, h261->encoder.context->height);
+ if(size != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
+
+ // Encode data
+ h261->encoder.picture->pts = AV_NOPTS_VALUE;
+ //h261->encoder.picture->pict_type = FF_I_TYPE;
+ ret = avcodec_encode_video(h261->encoder.context, h261->encoder.buffer, size, h261->encoder.picture);
+ if(ret > 0) {
+ tdav_codec_h261_encap(h261, h261->encoder.buffer, (tsk_size_t)ret);
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_h261_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- uint8_t sbit, ebit;
- const uint8_t* pdata = in_data;
- const uint8_t* pay_ptr;
- tsk_size_t pay_size;
- tsk_size_t xsize, retsize = 0;
- int got_picture_ptr;
- int ret;
-
- tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
-
- if(!self || !in_data || !in_size || !out_data || !h261->decoder.context){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* RFC 4587
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |SBIT |EBIT |I|V| GOBN | MBAP | QUANT | HMVD | VMVD |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- sbit = *pdata >> 5;
- ebit = (*pdata >> 2) & 0x07;
-
- /* Check size */
- if(in_size < H261_HEADER_SIZE){
- TSK_DEBUG_ERROR("Too short");
- return 0;
- }
-
- pay_ptr = (pdata + H261_HEADER_SIZE);
- pay_size = (in_size - H261_HEADER_SIZE);
- xsize = avpicture_get_size(h261->decoder.context->pix_fmt, h261->decoder.context->width, h261->decoder.context->height);
-
- /* Packet lost? */
- if(h261->decoder.last_seq != (rtp_hdr->seq_num - 1) && h261->decoder.last_seq){
- TSK_DEBUG_INFO("Packet lost");
- }
- h261->decoder.last_seq = rtp_hdr->seq_num;
-
- if((int)(h261->decoder.accumulator_pos + pay_size) <= xsize){
-
- if((h261->decoder.ebit + sbit) == 8){ /* Perfect one Byte to clean up */
- if(h261->decoder.accumulator_pos){
- ((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos-1] =
- (((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos-1] & (0xFF << h261->decoder.ebit)) |
- (*pay_ptr << sbit);
- }
- pay_ptr++, pay_size--;
- }
- h261->decoder.ebit = ebit;
-
- memcpy(&((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos], pay_ptr, pay_size);
- h261->decoder.accumulator_pos += pay_size;
- }
- else{
- TSK_DEBUG_WARN("Buffer overflow");
- h261->decoder.accumulator_pos = 0;
- return 0;
- }
-
- if(rtp_hdr->marker){
- AVPacket packet;
- /* allocate destination buffer */
- if(*out_max_size <xsize){
- if(!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- h261->decoder.accumulator_pos = 0;
- return 0;
- }
- *out_max_size = xsize;
- }
-
- /* decode the picture */
- av_init_packet(&packet);
- packet.size = (int)h261->decoder.accumulator_pos;
- packet.data = h261->decoder.accumulator;
- ret = avcodec_decode_video2(h261->decoder.context, h261->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret <0 || !got_picture_ptr){
- TSK_DEBUG_WARN("Failed to decode the buffer");
- }
- else{
- retsize = xsize;
- TMEDIA_CODEC_VIDEO(h261)->in.width = h261->decoder.context->width;
- TMEDIA_CODEC_VIDEO(h261)->in.height = h261->decoder.context->height;
- /* copy picture into a linear buffer */
- avpicture_layout((AVPicture *)h261->decoder.picture, h261->decoder.context->pix_fmt, (int)h261->decoder.context->width, (int)h261->decoder.context->height,
- *out_data, (int)retsize);
- }
- /* in all cases: reset accumulator */
- h261->decoder.accumulator_pos = 0;
- }
-
- return retsize;
+ uint8_t sbit, ebit;
+ const uint8_t* pdata = in_data;
+ const uint8_t* pay_ptr;
+ tsk_size_t pay_size;
+ tsk_size_t xsize, retsize = 0;
+ int got_picture_ptr;
+ int ret;
+
+ tdav_codec_h261_t* h261 = (tdav_codec_h261_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+
+ if(!self || !in_data || !in_size || !out_data || !h261->decoder.context) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* RFC 4587
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |SBIT |EBIT |I|V| GOBN | MBAP | QUANT | HMVD | VMVD |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ sbit = *pdata >> 5;
+ ebit = (*pdata >> 2) & 0x07;
+
+ /* Check size */
+ if(in_size < H261_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ return 0;
+ }
+
+ pay_ptr = (pdata + H261_HEADER_SIZE);
+ pay_size = (in_size - H261_HEADER_SIZE);
+ xsize = avpicture_get_size(h261->decoder.context->pix_fmt, h261->decoder.context->width, h261->decoder.context->height);
+
+ /* Packet lost? */
+ if(h261->decoder.last_seq != (rtp_hdr->seq_num - 1) && h261->decoder.last_seq) {
+ TSK_DEBUG_INFO("Packet lost");
+ }
+ h261->decoder.last_seq = rtp_hdr->seq_num;
+
+ if((int)(h261->decoder.accumulator_pos + pay_size) <= xsize) {
+
+ if((h261->decoder.ebit + sbit) == 8) { /* Perfect one Byte to clean up */
+ if(h261->decoder.accumulator_pos) {
+ ((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos-1] =
+ (((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos-1] & (0xFF << h261->decoder.ebit)) |
+ (*pay_ptr << sbit);
+ }
+ pay_ptr++, pay_size--;
+ }
+ h261->decoder.ebit = ebit;
+
+ memcpy(&((uint8_t*)h261->decoder.accumulator)[h261->decoder.accumulator_pos], pay_ptr, pay_size);
+ h261->decoder.accumulator_pos += pay_size;
+ }
+ else {
+ TSK_DEBUG_WARN("Buffer overflow");
+ h261->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ if(rtp_hdr->marker) {
+ AVPacket packet;
+ /* allocate destination buffer */
+ if(*out_max_size <xsize) {
+ if(!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ h261->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ *out_max_size = xsize;
+ }
+
+ /* decode the picture */
+ av_init_packet(&packet);
+ packet.size = (int)h261->decoder.accumulator_pos;
+ packet.data = h261->decoder.accumulator;
+ ret = avcodec_decode_video2(h261->decoder.context, h261->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret <0 || !got_picture_ptr) {
+ TSK_DEBUG_WARN("Failed to decode the buffer");
+ }
+ else {
+ retsize = xsize;
+ TMEDIA_CODEC_VIDEO(h261)->in.width = h261->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(h261)->in.height = h261->decoder.context->height;
+ /* copy picture into a linear buffer */
+ avpicture_layout((AVPicture *)h261->decoder.picture, h261->decoder.context->pix_fmt, (int)h261->decoder.context->width, (int)h261->decoder.context->height,
+ *out_data, (int)retsize);
+ }
+ /* in all cases: reset accumulator */
+ h261->decoder.accumulator_pos = 0;
+ }
+
+ return retsize;
}
tsk_bool_t tdav_codec_h261_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- int ret;
- unsigned maxbr, fps, width, height;
- tmedia_codec_video_t* h261 = (tmedia_codec_video_t*)codec;
-
- if(tsk_striequals(att_value, "fmtp")){
- if(!(ret = tmedia_codec_parse_fmtp(att_value, &maxbr, &fps, &width, &height))){
- h261->in.max_br = h261->out.max_br = maxbr * 1000;
- h261->in.fps = h261->out.fps = fps;
- h261->in.width = h261->out.width = width;
- h261->in.height = h261->out.height = height;
- return tsk_true;
- }
- else{
- TSK_DEBUG_WARN("Failed to match fmtp [%s]", att_value);
- }
- }
- return tsk_false;
+{
+ int ret;
+ unsigned maxbr, fps, width, height;
+ tmedia_codec_video_t* h261 = (tmedia_codec_video_t*)codec;
+
+ if(tsk_striequals(att_value, "fmtp")) {
+ if(!(ret = tmedia_codec_parse_fmtp(att_value, &maxbr, &fps, &width, &height))) {
+ h261->in.max_br = h261->out.max_br = maxbr * 1000;
+ h261->in.fps = h261->out.fps = fps;
+ h261->in.width = h261->out.width = width;
+ h261->in.height = h261->out.height = height;
+ return tsk_true;
+ }
+ else {
+ TSK_DEBUG_WARN("Failed to match fmtp [%s]", att_value);
+ }
+ }
+ return tsk_false;
}
char* tdav_codec_h261_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
#if 0
- return tsk_strdup("CIF=2/MaxBR=3840;QCIF=2/MaxBR=1920");
+ return tsk_strdup("CIF=2/MaxBR=3840;QCIF=2/MaxBR=1920");
#else
- return tsk_strdup("QCIF=2");
+ return tsk_strdup("QCIF=2");
#endif
}
/* constructor */
static tsk_object_t* tdav_codec_h261_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h261_t *h261 = self;
- if(h261){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_h261_t *h261 = self;
+ if(h261) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h261_dtor(tsk_object_t * self)
-{
- tdav_codec_h261_t *h261 = self;
- if(h261){
- /* deinit base */
- tmedia_codec_video_deinit(h261); // will call close()
- /* deinit self */
- TSK_FREE(h261->rtp.ptr);
- h261->rtp.size = 0;
- }
-
- return self;
+{
+ tdav_codec_h261_t *h261 = self;
+ if(h261) {
+ /* deinit base */
+ tmedia_codec_video_deinit(h261); // will call close()
+ /* deinit self */
+ TSK_FREE(h261->rtp.ptr);
+ h261->rtp.size = 0;
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h261_def_s =
-{
- sizeof(tdav_codec_h261_t),
- tdav_codec_h261_ctor,
- tdav_codec_h261_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h261_def_s = {
+ sizeof(tdav_codec_h261_t),
+ tdav_codec_h261_ctor,
+ tdav_codec_h261_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h261_plugin_def_s =
-{
- &tdav_codec_h261_def_s,
-
- tmedia_video,
- tmedia_codec_id_h261,
- "H261",
- "H261 codec (FFmpeg)",
- TMEDIA_CODEC_FORMAT_H261,
- tsk_false,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {176, 144, 15},
-
- tsk_null, // set()
- tdav_codec_h261_open,
- tdav_codec_h261_close,
- tdav_codec_h261_encode,
- tdav_codec_h261_decode,
- tdav_codec_h261_sdp_att_match,
- tdav_codec_h261_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h261_plugin_def_s = {
+ &tdav_codec_h261_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h261,
+ "H261",
+ "H261 codec (FFmpeg)",
+ TMEDIA_CODEC_FORMAT_H261,
+ tsk_false,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {176, 144, 15},
+
+ tsk_null, // set()
+ tdav_codec_h261_open,
+ tdav_codec_h261_close,
+ tdav_codec_h261_encode,
+ tdav_codec_h261_decode,
+ tdav_codec_h261_sdp_att_match,
+ tdav_codec_h261_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h261_plugin_def_t = &tdav_codec_h261_plugin_def_s;
@@ -451,26 +449,26 @@ const tmedia_codec_plugin_def_t *tdav_codec_h261_plugin_def_t = &tdav_codec_h261
static void tdav_codec_h261_encap(const tdav_codec_h261_t* h261, const uint8_t* pdata, tsk_size_t size)
{
- uint32_t i, last_index = 0;
-
- if(size < RTP_PAYLOAD_SIZE){
- goto last;
- }
-
- for(i = 4; i<(size - 4); i++){
- if(pdata[i] == 0x00 && pdata[i+1] == 0x00 && pdata[i+2]>=0x80){ /* PSC or (GBSC) found */
- if((i - last_index) >= RTP_PAYLOAD_SIZE){
- tdav_codec_h261_rtp_callback((tdav_codec_h261_t*)h261, pdata+last_index,
- (i - last_index), (last_index == size));
- }
- last_index = i;
- }
- }
+ uint32_t i, last_index = 0;
+
+ if(size < RTP_PAYLOAD_SIZE) {
+ goto last;
+ }
+
+ for(i = 4; i<(size - 4); i++) {
+ if(pdata[i] == 0x00 && pdata[i+1] == 0x00 && pdata[i+2]>=0x80) { /* PSC or (GBSC) found */
+ if((i - last_index) >= RTP_PAYLOAD_SIZE) {
+ tdav_codec_h261_rtp_callback((tdav_codec_h261_t*)h261, pdata+last_index,
+ (i - last_index), (last_index == size));
+ }
+ last_index = i;
+ }
+ }
last:
- if(last_index < size - 3/*PSC/GBSC size*/){
- tdav_codec_h261_rtp_callback((tdav_codec_h261_t*)h261, pdata + last_index,
- (size - last_index), tsk_true);
- }
+ if(last_index < size - 3/*PSC/GBSC size*/) {
+ tdav_codec_h261_rtp_callback((tdav_codec_h261_t*)h261, pdata + last_index,
+ (size - last_index), tsk_true);
+ }
}
//static void *run(void* self)
@@ -501,7 +499,7 @@ last:
// if(pdata[i] == 0x00 && pdata[i+1] == 0x00 && pdata[i+2]>=0x80){ /* PSC or (GBSC) found */
// if((i - last_index) >= RTP_PAYLOAD_SIZE){
// tdav_codec_h261_rtp_callback((tdav_codec_h261_t*)h261, pdata+last_index,
-// (i - last_index), (last_index == size));
+// (i - last_index), (last_index == size));
// }
// last_index = i;
// }
@@ -514,7 +512,7 @@ last:
//
// tsk_object_unref(curr);
// }
-//
+//
// TSK_RUNNABLE_RUN_END(self);
//
// TSK_DEBUG_INFO("H261 thread === STOP");
@@ -524,12 +522,12 @@ last:
static void tdav_codec_h261_rtp_callback(tdav_codec_h261_t *self, const void *data, tsk_size_t size, tsk_bool_t marker)
{
-
+
}
tsk_bool_t tdav_codec_ffmpeg_h261_is_supported()
{
- return /*(avcodec_find_encoder(CODEC_ID_H261) && avcodec_find_decoder(CODEC_ID_H261))*/tsk_false /* @deprecated */;
+ return /*(avcodec_find_encoder(CODEC_ID_H261) && avcodec_find_decoder(CODEC_ID_H261))*/tsk_false /* @deprecated */;
}
diff --git a/tinyDAV/src/codecs/h263/tdav_codec_h263.c b/tinyDAV/src/codecs/h263/tdav_codec_h263.c
index ed5d77f..bc20b36 100755
--- a/tinyDAV/src/codecs/h263/tdav_codec_h263.c
+++ b/tinyDAV/src/codecs/h263/tdav_codec_h263.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -73,48 +73,46 @@
#define TDAV_CODEC_H263(self) ((tdav_codec_h263_t*)(self))
-typedef enum tdav_codec_h263_type_e
-{
- tdav_codec_h263_1996,
- tdav_codec_h263_1998,
- tdav_codec_h263_2000,
+typedef enum tdav_codec_h263_type_e {
+ tdav_codec_h263_1996,
+ tdav_codec_h263_1998,
+ tdav_codec_h263_2000,
}
tdav_codec_h263_type_t;
/** H.263-1996 codec */
-typedef struct tdav_codec_h263_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- tdav_codec_h263_type_t type;
-
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- // Encoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
- void* buffer;
- tsk_bool_t force_idr;
- int32_t quality; // [1-31]
- int32_t max_bw_kpbs;
- } encoder;
-
- // decoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
-
- void* accumulator;
- uint8_t ebit;
- tsk_size_t accumulator_pos;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_h263_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ tdav_codec_h263_type_t type;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ // Encoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+ void* buffer;
+ tsk_bool_t force_idr;
+ int32_t quality; // [1-31]
+ int32_t max_bw_kpbs;
+ } encoder;
+
+ // decoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+
+ void* accumulator;
+ uint8_t ebit;
+ tsk_size_t accumulator_pos;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h263_t;
@@ -128,16 +126,14 @@ static int tdav_codec_h263_close_encoder(tdav_codec_h263_t* self);
static int tdav_codec_h263_close_decoder(tdav_codec_h263_t* self);
/** H.263-1998 codec */
-typedef struct tdav_codec_h263p_s
-{
- TDAV_DECLARE_CODEC_H263;
+typedef struct tdav_codec_h263p_s {
+ TDAV_DECLARE_CODEC_H263;
}
tdav_codec_h263p_t;
/** H.263-2000 codec */
-typedef struct tdav_codec_h263pp_s
-{
- TDAV_DECLARE_CODEC_H263;
+typedef struct tdav_codec_h263pp_s {
+ TDAV_DECLARE_CODEC_H263;
}
tdav_codec_h263pp_t;
@@ -152,85 +148,82 @@ static void tdav_codec_h263_encap(const tdav_codec_h263_t* h263, const uint8_t*
static int tdav_codec_h263_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return -1;
- }
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- h263->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- h263->encoder.quality = TSK_CLAMP(1, (h263->encoder.quality + 1), 31);
- h263->encoder.context->global_quality = FF_QP2LAMBDA * h263->encoder.quality;
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- h263->encoder.quality = TSK_CLAMP(1, (h263->encoder.quality - 1), 31);
- h263->encoder.context->global_quality = FF_QP2LAMBDA * h263->encoder.quality;
- break;
- }
- }
- return 0;
- }
- }
- return -1;
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return -1;
+ }
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ h263->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ h263->encoder.quality = TSK_CLAMP(1, (h263->encoder.quality + 1), 31);
+ h263->encoder.context->global_quality = FF_QP2LAMBDA * h263->encoder.quality;
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ h263->encoder.quality = TSK_CLAMP(1, (h263->encoder.quality - 1), 31);
+ h263->encoder.context->global_quality = FF_QP2LAMBDA * h263->encoder.quality;
+ break;
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
}
int tdav_codec_h263_init(tdav_codec_h263_t* self, tdav_codec_h263_type_t type, enum CodecID encoder, enum CodecID decoder)
{
- int ret = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->type = type;
- self->encoder.quality = 1;
-
- if(!(self->encoder.codec = avcodec_find_encoder(encoder))){
- TSK_DEBUG_ERROR("Failed to find [%d]encoder", encoder);
- ret = -2;
- }
-
- if(!(self->decoder.codec = avcodec_find_decoder(decoder))){
- TSK_DEBUG_ERROR("Failed to find [%d] decoder", decoder);
- ret = -3;
- }
-
- self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
-
- /* allocations MUST be done by open() */
- return ret;
+ int ret = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->type = type;
+ self->encoder.quality = 1;
+
+ if(!(self->encoder.codec = avcodec_find_encoder(encoder))) {
+ TSK_DEBUG_ERROR("Failed to find [%d]encoder", encoder);
+ ret = -2;
+ }
+
+ if(!(self->decoder.codec = avcodec_find_decoder(decoder))) {
+ TSK_DEBUG_ERROR("Failed to find [%d] decoder", decoder);
+ ret = -3;
+ }
+
+ self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
+
+ /* allocations MUST be done by open() */
+ return ret;
}
int tdav_codec_h263_deinit(tdav_codec_h263_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->encoder.codec = tsk_null;
- self->decoder.codec = tsk_null;
-
- // FFMpeg resources are destroyed by close()
-
-
-
- TSK_FREE(self->rtp.ptr);
- self->rtp.size = 0;
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->encoder.codec = tsk_null;
+ self->decoder.codec = tsk_null;
+
+ // FFMpeg resources are destroyed by close()
+
+
+
+ TSK_FREE(self->rtp.ptr);
+ self->rtp.size = 0;
+
+ return 0;
}
@@ -242,360 +235,358 @@ int tdav_codec_h263_deinit(tdav_codec_h263_t* self)
//
static int tdav_codec_h263_open(tmedia_codec_t* self)
{
- int ret;
+ int ret;
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
- if(!h263){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!h263) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) already checked that the codec is not opened */
+ /* the caller (base class) already checked that the codec is not opened */
- // Encoder
- if((ret = tdav_codec_h263_open_encoder(h263))){
- return ret;
- }
+ // Encoder
+ if((ret = tdav_codec_h263_open_encoder(h263))) {
+ return ret;
+ }
- // Decoder
- if((ret = tdav_codec_h263_open_decoder(h263))){
- return ret;
- }
+ // Decoder
+ if((ret = tdav_codec_h263_open_decoder(h263))) {
+ return ret;
+ }
- return ret;
+ return ret;
}
static int tdav_codec_h263_close(tmedia_codec_t* self)
{
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
- int ret;
-
- if(!h263){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is opened */
-
- // Encoder
- ret = tdav_codec_h263_close_encoder(h263);
- // Decoder
- ret = tdav_codec_h263_close_decoder(h263);
-
- return ret;
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+ int ret;
+
+ if(!h263) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is opened */
+
+ // Encoder
+ ret = tdav_codec_h263_close_encoder(h263);
+ // Decoder
+ ret = tdav_codec_h263_close_decoder(h263);
+
+ return ret;
}
static tsk_size_t tdav_codec_h263_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret;
- int size;
-
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // wrap yuv420 buffer
- size = avpicture_fill((AVPicture *)h263->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h263->encoder.context->width, h263->encoder.context->height);
- if(size != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
+ int ret;
+ int size;
+
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // wrap yuv420 buffer
+ size = avpicture_fill((AVPicture *)h263->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h263->encoder.context->width, h263->encoder.context->height);
+ if(size != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
#if LIBAVCODEC_VERSION_MAJOR <= 53
- h263->encoder.picture->pict_type = h263->encoder.force_idr ? FF_I_TYPE : 0;
+ h263->encoder.picture->pict_type = h263->encoder.force_idr ? FF_I_TYPE : 0;
#else
h263->encoder.picture->pict_type = h263->encoder.force_idr ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
#endif
- h263->encoder.picture->pts = AV_NOPTS_VALUE;
- h263->encoder.picture->quality = h263->encoder.context->global_quality;
- ret = avcodec_encode_video(h263->encoder.context, h263->encoder.buffer, size, h263->encoder.picture);
- if(ret > 0){
- tdav_codec_h263_encap(h263, h263->encoder.buffer, (tsk_size_t)ret);
- }
- h263->encoder.force_idr = tsk_false;
-
- return 0;
+ h263->encoder.picture->pts = AV_NOPTS_VALUE;
+ h263->encoder.picture->quality = h263->encoder.context->global_quality;
+ ret = avcodec_encode_video(h263->encoder.context, h263->encoder.buffer, size, h263->encoder.picture);
+ if(ret > 0) {
+ tdav_codec_h263_encap(h263, h263->encoder.buffer, (tsk_size_t)ret);
+ }
+ h263->encoder.force_idr = tsk_false;
+
+ return 0;
}
static tsk_size_t tdav_codec_h263_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- uint8_t F, P, sbit, ebit;
- const uint8_t* pdata = in_data;
- const uint8_t* pay_ptr;
- tsk_size_t pay_size;
- tsk_size_t hdr_size;
- tsk_size_t xsize, retsize = 0;
- int got_picture_ptr;
- int ret;
-
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
- tsk_bool_t is_idr = tsk_false;
-
- if(!self || !in_data || !in_size || !out_data || !h263->decoder.context){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* RFC 2190
- get F and P bits, used to determine the header Mode (A, B or C)
- F: 1 bit
- The flag bit indicates the mode of the payload header. F=0, mode A;
- F=1, mode B or mode C depending on P bit defined below.
- P: 1 bit
- Optional PB-frames mode as defined by the H.263 [4]. "0" implies
- normal I or P frame, "1" PB-frames. When F=1, P also indicates modes:
- mode B if P=0, mode C if P=1.
-
- I: 1 bit.
- Picture coding type, bit 9 in PTYPE defined by H.263[4], "0" is
- intra-coded, "1" is inter-coded.
- */
- F = *pdata >> 7;
- P = (*pdata >> 6) & 0x01;
-
- /* SBIT and EBIT */
- sbit = (*pdata >> 3) & 0x0F;
- ebit = (*pdata & 0x07);
-
- if(F == 0){
- /* MODE A
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |F|P|SBIT |EBIT | SRC |I|U|S|A|R |DBQ| TRB | TR |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- hdr_size = H263_HEADER_MODE_A_SIZE;
- is_idr = (in_size >= 2) && !(pdata[1] & 0x10) /* I==1 */;
- }
- else if(P == 0){ // F=1 and P=0
- /* MODE B
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |F|P|SBIT |EBIT | SRC | QUANT | GOBN | MBA |R |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |I|U|S|A| HMV1 | VMV1 | HMV2 | VMV2 |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- hdr_size = H263_HEADER_MODE_B_SIZE;
- is_idr = (in_size >= 5) && !(pdata[4] & 0x80) /* I==1 */;
- }
- else{ // F=1 and P=1
- /* MODE C
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |F|P|SBIT |EBIT | SRC | QUANT | GOBN | MBA |R |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |I|U|S|A| HMV1 | VMV1 | HMV2 | VMV2 |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | RR |DBQ| TRB | TR |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- hdr_size = H263_HEADER_MODE_C_SIZE;
- is_idr = (in_size >= 5) && !(pdata[4] & 0x80) /* I==1 */;
- }
-
- /* Check size */
- if(in_size < hdr_size){
- TSK_DEBUG_ERROR("Too short");
- return 0;
- }
-
- pay_ptr = (pdata + hdr_size);
- pay_size = (in_size - hdr_size);
- xsize = avpicture_get_size(h263->decoder.context->pix_fmt, h263->decoder.context->width, h263->decoder.context->height);
-
- /* Packet lost? */
- if(h263->decoder.last_seq != (rtp_hdr->seq_num - 1) && h263->decoder.last_seq){
- if(h263->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("[H.263] Packet loss, seq_num=%d", rtp_hdr->seq_num);
- }
- h263->decoder.last_seq = rtp_hdr->seq_num;
-
- if((int)(h263->decoder.accumulator_pos + pay_size) <= xsize){
- if((h263->decoder.ebit + sbit) == 8){ /* Perfect one Byte to clean up */
- if(h263->decoder.accumulator_pos){
- ((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos-1] = (((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos-1] & (0xFF << h263->decoder.ebit)) |
- (*pay_ptr & (0xFF >> sbit));
- }
- pay_ptr++, pay_size--;
- }
- h263->decoder.ebit = ebit;
-
- memcpy(&((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos], pay_ptr, pay_size);
- h263->decoder.accumulator_pos += pay_size;
- }
- else{
- TSK_DEBUG_WARN("Buffer overflow");
- h263->decoder.accumulator_pos = 0;
- return 0;
- }
-
- if(rtp_hdr->marker){
- AVPacket packet;
- /* allocate destination buffer */
- if(*out_max_size <xsize){
- if(!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- h263->decoder.accumulator_pos = 0;
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = xsize;
- }
-
- av_init_packet(&packet);
- packet.size = (int)h263->decoder.accumulator_pos;
- packet.data = h263->decoder.accumulator;
- ret = avcodec_decode_video2(h263->decoder.context, h263->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret < 0){
- TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
- if(TMEDIA_CODEC_VIDEO(self)->in.callback){
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- else if(got_picture_ptr){
- retsize = xsize;
- // Is it IDR frame?
- if(is_idr && TMEDIA_CODEC_VIDEO(self)->in.callback){
- TSK_DEBUG_INFO("Decoded H.263 IDR");
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- TMEDIA_CODEC_VIDEO(h263)->in.width = h263->decoder.context->width;
- TMEDIA_CODEC_VIDEO(h263)->in.height = h263->decoder.context->height;
- /* copy picture into a linear buffer */
- avpicture_layout((AVPicture *)h263->decoder.picture, h263->decoder.context->pix_fmt, (int)h263->decoder.context->width, (int)h263->decoder.context->height,
- *out_data, (int)retsize);
- }
- /* in all cases: reset accumulator */
- h263->decoder.accumulator_pos = 0;
- }
-
- return retsize;
+ uint8_t F, P, sbit, ebit;
+ const uint8_t* pdata = in_data;
+ const uint8_t* pay_ptr;
+ tsk_size_t pay_size;
+ tsk_size_t hdr_size;
+ tsk_size_t xsize, retsize = 0;
+ int got_picture_ptr;
+ int ret;
+
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+ tsk_bool_t is_idr = tsk_false;
+
+ if(!self || !in_data || !in_size || !out_data || !h263->decoder.context) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* RFC 2190
+ get F and P bits, used to determine the header Mode (A, B or C)
+ F: 1 bit
+ The flag bit indicates the mode of the payload header. F=0, mode A;
+ F=1, mode B or mode C depending on P bit defined below.
+ P: 1 bit
+ Optional PB-frames mode as defined by the H.263 [4]. "0" implies
+ normal I or P frame, "1" PB-frames. When F=1, P also indicates modes:
+ mode B if P=0, mode C if P=1.
+
+ I: 1 bit.
+ Picture coding type, bit 9 in PTYPE defined by H.263[4], "0" is
+ intra-coded, "1" is inter-coded.
+ */
+ F = *pdata >> 7;
+ P = (*pdata >> 6) & 0x01;
+
+ /* SBIT and EBIT */
+ sbit = (*pdata >> 3) & 0x0F;
+ ebit = (*pdata & 0x07);
+
+ if(F == 0) {
+ /* MODE A
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |F|P|SBIT |EBIT | SRC |I|U|S|A|R |DBQ| TRB | TR |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ hdr_size = H263_HEADER_MODE_A_SIZE;
+ is_idr = (in_size >= 2) && !(pdata[1] & 0x10) /* I==1 */;
+ }
+ else if(P == 0) { // F=1 and P=0
+ /* MODE B
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |F|P|SBIT |EBIT | SRC | QUANT | GOBN | MBA |R |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |I|U|S|A| HMV1 | VMV1 | HMV2 | VMV2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ hdr_size = H263_HEADER_MODE_B_SIZE;
+ is_idr = (in_size >= 5) && !(pdata[4] & 0x80) /* I==1 */;
+ }
+ else { // F=1 and P=1
+ /* MODE C
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |F|P|SBIT |EBIT | SRC | QUANT | GOBN | MBA |R |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |I|U|S|A| HMV1 | VMV1 | HMV2 | VMV2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | RR |DBQ| TRB | TR |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ hdr_size = H263_HEADER_MODE_C_SIZE;
+ is_idr = (in_size >= 5) && !(pdata[4] & 0x80) /* I==1 */;
+ }
+
+ /* Check size */
+ if(in_size < hdr_size) {
+ TSK_DEBUG_ERROR("Too short");
+ return 0;
+ }
+
+ pay_ptr = (pdata + hdr_size);
+ pay_size = (in_size - hdr_size);
+ xsize = avpicture_get_size(h263->decoder.context->pix_fmt, h263->decoder.context->width, h263->decoder.context->height);
+
+ /* Packet lost? */
+ if(h263->decoder.last_seq != (rtp_hdr->seq_num - 1) && h263->decoder.last_seq) {
+ if(h263->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("[H.263] Packet loss, seq_num=%d", rtp_hdr->seq_num);
+ }
+ h263->decoder.last_seq = rtp_hdr->seq_num;
+
+ if((int)(h263->decoder.accumulator_pos + pay_size) <= xsize) {
+ if((h263->decoder.ebit + sbit) == 8) { /* Perfect one Byte to clean up */
+ if(h263->decoder.accumulator_pos) {
+ ((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos-1] = (((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos-1] & (0xFF << h263->decoder.ebit)) |
+ (*pay_ptr & (0xFF >> sbit));
+ }
+ pay_ptr++, pay_size--;
+ }
+ h263->decoder.ebit = ebit;
+
+ memcpy(&((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos], pay_ptr, pay_size);
+ h263->decoder.accumulator_pos += pay_size;
+ }
+ else {
+ TSK_DEBUG_WARN("Buffer overflow");
+ h263->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ if(rtp_hdr->marker) {
+ AVPacket packet;
+ /* allocate destination buffer */
+ if(*out_max_size <xsize) {
+ if(!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ h263->decoder.accumulator_pos = 0;
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = xsize;
+ }
+
+ av_init_packet(&packet);
+ packet.size = (int)h263->decoder.accumulator_pos;
+ packet.data = h263->decoder.accumulator;
+ ret = avcodec_decode_video2(h263->decoder.context, h263->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret < 0) {
+ TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ else if(got_picture_ptr) {
+ retsize = xsize;
+ // Is it IDR frame?
+ if(is_idr && TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TSK_DEBUG_INFO("Decoded H.263 IDR");
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ TMEDIA_CODEC_VIDEO(h263)->in.width = h263->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(h263)->in.height = h263->decoder.context->height;
+ /* copy picture into a linear buffer */
+ avpicture_layout((AVPicture *)h263->decoder.picture, h263->decoder.context->pix_fmt, (int)h263->decoder.context->width, (int)h263->decoder.context->height,
+ *out_data, (int)retsize);
+ }
+ /* in all cases: reset accumulator */
+ h263->decoder.accumulator_pos = 0;
+ }
+
+ return retsize;
}
static tsk_bool_t tdav_codec_h263_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- if(tsk_striequals(att_name, "fmtp")){
- unsigned width, height, fps;
- if(tmedia_parse_video_fmtp(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &width, &height, &fps)){
- TSK_DEBUG_ERROR("Failed to match fmtp=%s", att_value);
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = width;
- TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = height;
- TMEDIA_CODEC_VIDEO(codec)->in.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps = fps;
- }
+{
+ if(tsk_striequals(att_name, "fmtp")) {
+ unsigned width, height, fps;
+ if(tmedia_parse_video_fmtp(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &width, &height, &fps)) {
+ TSK_DEBUG_ERROR("Failed to match fmtp=%s", att_value);
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = width;
+ TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = height;
+ TMEDIA_CODEC_VIDEO(codec)->in.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps = fps;
+ }
#if 0
- else if(tsk_striequals(att_name, "imageattr")){
- unsigned in_width, in_height, out_width, out_height;
- if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0){
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
- }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
+ }
#endif
-
- return tsk_true;
+
+ return tsk_true;
}
static char* tdav_codec_h263_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- if(tsk_striequals(att_name, "fmtp")){
- tmedia_pref_video_size_t cif_vs;
- if(tmedia_video_get_closest_cif_size(TMEDIA_CODEC_VIDEO(codec)->pref_size, &cif_vs)){
- TSK_DEBUG_ERROR("Failed to get closest CIF family size");
- return tsk_null;
- }
- return tmedia_get_video_fmtp(cif_vs);
- }
+ if(tsk_striequals(att_name, "fmtp")) {
+ tmedia_pref_video_size_t cif_vs;
+ if(tmedia_video_get_closest_cif_size(TMEDIA_CODEC_VIDEO(codec)->pref_size, &cif_vs)) {
+ TSK_DEBUG_ERROR("Failed to get closest CIF family size");
+ return tsk_null;
+ }
+ return tmedia_get_video_fmtp(cif_vs);
+ }
#if 0
- else if(tsk_striequals(att_name, "imageattr")){
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
- TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
- }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
+ TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
+ }
#endif
- return tsk_null;
+ return tsk_null;
}
/* constructor */
static tsk_object_t* tdav_codec_h263_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h263_t *h263 = self;
- if(h263){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_1996, CODEC_ID_H263, CODEC_ID_H263);
- }
- return self;
+ tdav_codec_h263_t *h263 = self;
+ if(h263) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_1996, CODEC_ID_H263, CODEC_ID_H263);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h263_dtor(tsk_object_t * self)
-{
- tdav_codec_h263_t *h263 = self;
- if(h263){
- /* deinit base */
- tmedia_codec_video_deinit(h263);
- /* deinit self */
- tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
-
- }
-
- return self;
+{
+ tdav_codec_h263_t *h263 = self;
+ if(h263) {
+ /* deinit base */
+ tmedia_codec_video_deinit(h263);
+ /* deinit self */
+ tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h263_def_s =
-{
- sizeof(tdav_codec_h263_t),
- tdav_codec_h263_ctor,
- tdav_codec_h263_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h263_def_s = {
+ sizeof(tdav_codec_h263_t),
+ tdav_codec_h263_ctor,
+ tdav_codec_h263_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h263_plugin_def_s =
-{
- &tdav_codec_h263_def_s,
-
- tmedia_video,
- tmedia_codec_id_h263,
- "H263",
- "H263-1996 codec (FFmpeg)",
- TMEDIA_CODEC_FORMAT_H263,
- tsk_false,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {176, 144, 15},
-
- tdav_codec_h263_set,
- tdav_codec_h263_open,
- tdav_codec_h263_close,
- tdav_codec_h263_encode,
- tdav_codec_h263_decode,
- tdav_codec_h263_sdp_att_match,
- tdav_codec_h263_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h263_plugin_def_s = {
+ &tdav_codec_h263_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h263,
+ "H263",
+ "H263-1996 codec (FFmpeg)",
+ TMEDIA_CODEC_FORMAT_H263,
+ tsk_false,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {176, 144, 15},
+
+ tdav_codec_h263_set,
+ tdav_codec_h263_open,
+ tdav_codec_h263_close,
+ tdav_codec_h263_encode,
+ tdav_codec_h263_decode,
+ tdav_codec_h263_sdp_att_match,
+ tdav_codec_h263_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h263_plugin_def_t = &tdav_codec_h263_plugin_def_s;
@@ -629,198 +620,196 @@ const tmedia_codec_plugin_def_t *tdav_codec_h263_plugin_def_t = &tdav_codec_h263
static tsk_size_t tdav_codec_h263p_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- uint8_t P, V, PLEN, PEBIT;
- uint8_t* pdata = (uint8_t*)in_data;
- const uint8_t* pay_ptr;
- tsk_size_t pay_size;
- int hdr_size = H263P_HEADER_SIZE;
- tsk_size_t xsize, retsize = 0;
- int got_picture_ptr;
- int ret;
-
- tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
-
- if(!self || !in_data || !in_size || ((int)in_size <= hdr_size) || !out_data || !h263->decoder.context){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
-/*
- rfc4629 - 5.1. General H.263+ Payload Header
-
- 0 1
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | RR |P|V| PLEN |PEBIT|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-*/
- P = (pdata[0] & 0x04)>>2;
- V = (pdata[0] & 0x02)>>1;
- PLEN = (((pdata[0] & 0x01)<<5) | pdata[1]>>3);
- PEBIT = pdata[1] & 0x07;
-
- if(V){
- /*
- Indicates the presence of an 8-bit field containing information
- for Video Redundancy Coding (VRC), which follows immediately after
- the initial 16 bits of the payload header, if present. For syntax
- and semantics of that 8-bit VRC field, see Section 5.2.
- */
- }
- if(PLEN){
- /*
- Length, in bytes, of the extra picture header. If no extra
- picture header is attached, PLEN is 0. If PLEN>0, the extra
- picture header is attached immediately following the rest of the
- payload header. Note that the length reflects the omission of the
- first two bytes of the picture start code (PSC). See Section 6.1.
- */
- hdr_size += PLEN;
- if(PEBIT){
- /*
- Indicates the number of bits that shall be ignored in the last
- byte of the picture header. If PLEN is not zero, the ignored bits
- shall be the least significant bits of the byte. If PLEN is zero,
- then PEBIT shall also be zero.
- */
- TSK_DEBUG_WARN("PEBIT ignored");
- }
- }
- if(P){ /* MUST be done after PLEN and PEBIT */
- /*
- Indicates the picture start or a picture segment (GOB/Slice) start
- or a video sequence end (EOS or EOSBS). Two bytes of zero bits
- then have to be prefixed to the payload of such a packet to
- compose a complete picture/GOB/slice/EOS/EOSBS start code. This
- bit allows the omission of the two first bytes of the start codes,
- thus improving the compression ratio.
- */
- hdr_size -= 2;
- pdata[hdr_size] = 0x00, pdata[hdr_size + 1] = 0x00;
- }
-
- pay_ptr = (pdata + hdr_size);
- pay_size = (in_size - hdr_size);
- xsize = avpicture_get_size(h263->decoder.context->pix_fmt, h263->decoder.context->width, h263->decoder.context->height);
-
- /* Packet lost? */
- if(h263->decoder.last_seq != (rtp_hdr->seq_num - 1) && h263->decoder.last_seq){
- if(h263->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("[H.263+] Packet loss, seq_num=%d", rtp_hdr->seq_num);
- }
- h263->decoder.last_seq = rtp_hdr->seq_num;
-
- if((int)(h263->decoder.accumulator_pos + pay_size) <= xsize){
- /* PEBIT is ignored */
- memcpy(&((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos], pay_ptr, pay_size);
- h263->decoder.accumulator_pos += pay_size;
- }
- else{
- TSK_DEBUG_WARN("Buffer overflow");
- h263->decoder.accumulator_pos = 0;
- return 0;
- }
-
- if(rtp_hdr->marker){
- AVPacket packet;
- /* allocate destination buffer */
- if(*out_max_size < xsize){
- if(!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- h263->decoder.accumulator_pos = 0;
- return 0;
- }
- *out_max_size = xsize;
- }
-
- /* decode the picture */
- av_init_packet(&packet);
- packet.size = (int)h263->decoder.accumulator_pos;
- packet.data = h263->decoder.accumulator;
- ret = avcodec_decode_video2(h263->decoder.context, h263->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret <0 || !got_picture_ptr){
- TSK_DEBUG_WARN("Failed to decode the buffer");
- }
- else{
- retsize = xsize;
- TMEDIA_CODEC_VIDEO(h263)->in.width = h263->decoder.context->width;
- TMEDIA_CODEC_VIDEO(h263)->in.height = h263->decoder.context->height;
- /* copy picture into a linear buffer */
- avpicture_layout((AVPicture *)h263->decoder.picture, h263->decoder.context->pix_fmt, (int)h263->decoder.context->width, (int)h263->decoder.context->height,
- *out_data, (int)retsize);
- }
- /* in all cases: reset accumulator */
- h263->decoder.accumulator_pos = 0;
- }
-
- return retsize;
+ uint8_t P, V, PLEN, PEBIT;
+ uint8_t* pdata = (uint8_t*)in_data;
+ const uint8_t* pay_ptr;
+ tsk_size_t pay_size;
+ int hdr_size = H263P_HEADER_SIZE;
+ tsk_size_t xsize, retsize = 0;
+ int got_picture_ptr;
+ int ret;
+
+ tdav_codec_h263_t* h263 = (tdav_codec_h263_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+
+ if(!self || !in_data || !in_size || ((int)in_size <= hdr_size) || !out_data || !h263->decoder.context) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /*
+ rfc4629 - 5.1. General H.263+ Payload Header
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | RR |P|V| PLEN |PEBIT|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ P = (pdata[0] & 0x04)>>2;
+ V = (pdata[0] & 0x02)>>1;
+ PLEN = (((pdata[0] & 0x01)<<5) | pdata[1]>>3);
+ PEBIT = pdata[1] & 0x07;
+
+ if(V) {
+ /*
+ Indicates the presence of an 8-bit field containing information
+ for Video Redundancy Coding (VRC), which follows immediately after
+ the initial 16 bits of the payload header, if present. For syntax
+ and semantics of that 8-bit VRC field, see Section 5.2.
+ */
+ }
+ if(PLEN) {
+ /*
+ Length, in bytes, of the extra picture header. If no extra
+ picture header is attached, PLEN is 0. If PLEN>0, the extra
+ picture header is attached immediately following the rest of the
+ payload header. Note that the length reflects the omission of the
+ first two bytes of the picture start code (PSC). See Section 6.1.
+ */
+ hdr_size += PLEN;
+ if(PEBIT) {
+ /*
+ Indicates the number of bits that shall be ignored in the last
+ byte of the picture header. If PLEN is not zero, the ignored bits
+ shall be the least significant bits of the byte. If PLEN is zero,
+ then PEBIT shall also be zero.
+ */
+ TSK_DEBUG_WARN("PEBIT ignored");
+ }
+ }
+ if(P) { /* MUST be done after PLEN and PEBIT */
+ /*
+ Indicates the picture start or a picture segment (GOB/Slice) start
+ or a video sequence end (EOS or EOSBS). Two bytes of zero bits
+ then have to be prefixed to the payload of such a packet to
+ compose a complete picture/GOB/slice/EOS/EOSBS start code. This
+ bit allows the omission of the two first bytes of the start codes,
+ thus improving the compression ratio.
+ */
+ hdr_size -= 2;
+ pdata[hdr_size] = 0x00, pdata[hdr_size + 1] = 0x00;
+ }
+
+ pay_ptr = (pdata + hdr_size);
+ pay_size = (in_size - hdr_size);
+ xsize = avpicture_get_size(h263->decoder.context->pix_fmt, h263->decoder.context->width, h263->decoder.context->height);
+
+ /* Packet lost? */
+ if(h263->decoder.last_seq != (rtp_hdr->seq_num - 1) && h263->decoder.last_seq) {
+ if(h263->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("[H.263+] Packet loss, seq_num=%d", rtp_hdr->seq_num);
+ }
+ h263->decoder.last_seq = rtp_hdr->seq_num;
+
+ if((int)(h263->decoder.accumulator_pos + pay_size) <= xsize) {
+ /* PEBIT is ignored */
+ memcpy(&((uint8_t*)h263->decoder.accumulator)[h263->decoder.accumulator_pos], pay_ptr, pay_size);
+ h263->decoder.accumulator_pos += pay_size;
+ }
+ else {
+ TSK_DEBUG_WARN("Buffer overflow");
+ h263->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ if(rtp_hdr->marker) {
+ AVPacket packet;
+ /* allocate destination buffer */
+ if(*out_max_size < xsize) {
+ if(!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ h263->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ *out_max_size = xsize;
+ }
+
+ /* decode the picture */
+ av_init_packet(&packet);
+ packet.size = (int)h263->decoder.accumulator_pos;
+ packet.data = h263->decoder.accumulator;
+ ret = avcodec_decode_video2(h263->decoder.context, h263->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret <0 || !got_picture_ptr) {
+ TSK_DEBUG_WARN("Failed to decode the buffer");
+ }
+ else {
+ retsize = xsize;
+ TMEDIA_CODEC_VIDEO(h263)->in.width = h263->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(h263)->in.height = h263->decoder.context->height;
+ /* copy picture into a linear buffer */
+ avpicture_layout((AVPicture *)h263->decoder.picture, h263->decoder.context->pix_fmt, (int)h263->decoder.context->width, (int)h263->decoder.context->height,
+ *out_data, (int)retsize);
+ }
+ /* in all cases: reset accumulator */
+ h263->decoder.accumulator_pos = 0;
+ }
+
+ return retsize;
}
/* constructor */
static tsk_object_t* tdav_codec_h263p_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h263p_t *h263p = self;
- if(h263p){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_1998, CODEC_ID_H263P, CODEC_ID_H263);
- }
- return self;
+ tdav_codec_h263p_t *h263p = self;
+ if(h263p) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_1998, CODEC_ID_H263P, CODEC_ID_H263);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h263p_dtor(tsk_object_t * self)
-{
- tdav_codec_h263p_t *h263p = self;
- if(h263p){
- /* deinit base */
- tmedia_codec_video_deinit(h263p);
- /* deinit self */
- tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
- }
-
- return self;
+{
+ tdav_codec_h263p_t *h263p = self;
+ if(h263p) {
+ /* deinit base */
+ tmedia_codec_video_deinit(h263p);
+ /* deinit self */
+ tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h263p_def_s =
-{
- sizeof(tdav_codec_h263p_t),
- tdav_codec_h263p_ctor,
- tdav_codec_h263p_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h263p_def_s = {
+ sizeof(tdav_codec_h263p_t),
+ tdav_codec_h263p_ctor,
+ tdav_codec_h263p_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h263p_plugin_def_s =
-{
- &tdav_codec_h263p_def_s,
-
- tmedia_video,
- tmedia_codec_id_h263p,
- "H263-1998",
- "H263-1998 codec (FFmpeg)",
- TMEDIA_CODEC_FORMAT_H263_1998,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0},// fps is @deprecated
-
- tdav_codec_h263p_set,
- tdav_codec_h263p_open,
- tdav_codec_h263p_close,
- tdav_codec_h263p_encode,
- tdav_codec_h263p_decode,
- tdav_codec_h263p_sdp_att_match,
- tdav_codec_h263p_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h263p_plugin_def_s = {
+ &tdav_codec_h263p_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h263p,
+ "H263-1998",
+ "H263-1998 codec (FFmpeg)",
+ TMEDIA_CODEC_FORMAT_H263_1998,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0},// fps is @deprecated
+
+ tdav_codec_h263p_set,
+ tdav_codec_h263p_open,
+ tdav_codec_h263p_close,
+ tdav_codec_h263p_encode,
+ tdav_codec_h263p_decode,
+ tdav_codec_h263p_sdp_att_match,
+ tdav_codec_h263p_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h263p_plugin_def_t = &tdav_codec_h263p_plugin_def_s;
@@ -846,61 +835,59 @@ const tmedia_codec_plugin_def_t *tdav_codec_h263p_plugin_def_t = &tdav_codec_h26
/* constructor */
static tsk_object_t* tdav_codec_h263pp_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h263pp_t *h263pp = self;
- if(h263pp){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_2000, CODEC_ID_H263P, CODEC_ID_H263);
- }
- return self;
+ tdav_codec_h263pp_t *h263pp = self;
+ if(h263pp) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h263_init(TDAV_CODEC_H263(self), tdav_codec_h263_2000, CODEC_ID_H263P, CODEC_ID_H263);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h263pp_dtor(tsk_object_t * self)
-{
- tdav_codec_h263pp_t *h263pp = self;
- if(h263pp){
- /* deinit base */
- tmedia_codec_video_deinit(h263pp);
- /* deinit self */
- tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
- }
-
- return self;
+{
+ tdav_codec_h263pp_t *h263pp = self;
+ if(h263pp) {
+ /* deinit base */
+ tmedia_codec_video_deinit(h263pp);
+ /* deinit self */
+ tdav_codec_h263_deinit(TDAV_CODEC_H263(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h263pp_def_s =
-{
- sizeof(tdav_codec_h263pp_t),
- tdav_codec_h263pp_ctor,
- tdav_codec_h263pp_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h263pp_def_s = {
+ sizeof(tdav_codec_h263pp_t),
+ tdav_codec_h263pp_ctor,
+ tdav_codec_h263pp_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h263pp_plugin_def_s =
-{
- &tdav_codec_h263pp_def_s,
-
- tmedia_video,
- tmedia_codec_id_h263pp,
- "H263-2000",
- "H263-2000 codec (FFmpeg)",
- TMEDIA_CODEC_FORMAT_H263_2000,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps)*/
- {176, 144, 0},// fps is @deprecated
-
- tdav_codec_h263pp_set,
- tdav_codec_h263pp_open,
- tdav_codec_h263pp_close,
- tdav_codec_h263pp_encode,
- tdav_codec_h263pp_decode,
- tdav_codec_h263pp_sdp_att_match,
- tdav_codec_h263pp_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h263pp_plugin_def_s = {
+ &tdav_codec_h263pp_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h263pp,
+ "H263-2000",
+ "H263-2000 codec (FFmpeg)",
+ TMEDIA_CODEC_FORMAT_H263_2000,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps)*/
+ {176, 144, 0},// fps is @deprecated
+
+ tdav_codec_h263pp_set,
+ tdav_codec_h263pp_open,
+ tdav_codec_h263pp_close,
+ tdav_codec_h263pp_encode,
+ tdav_codec_h263pp_decode,
+ tdav_codec_h263pp_sdp_att_match,
+ tdav_codec_h263pp_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h263pp_plugin_def_t = &tdav_codec_h263pp_plugin_def_s;
@@ -908,465 +895,465 @@ const tmedia_codec_plugin_def_t *tdav_codec_h263pp_plugin_def_t = &tdav_codec_h2
int tdav_codec_h263_open_encoder(tdav_codec_h263_t* self)
{
- int ret;
- int size;
- int32_t max_bw_kpbs;
- if(self->encoder.context){
- TSK_DEBUG_ERROR("Encoder already opened");
- return -1;
- }
-
- self->encoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->encoder.context);
-
- self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->encoder.context->time_base.num = 1;
- self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
- self->encoder.context->width = TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.context->height = TMEDIA_CODEC_VIDEO(self)->out.height;
-
- self->encoder.context->qmin = 10;
- self->encoder.context->qmax = 51;
+ int ret;
+ int size;
+ int32_t max_bw_kpbs;
+ if(self->encoder.context) {
+ TSK_DEBUG_ERROR("Encoder already opened");
+ return -1;
+ }
+
+ self->encoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->encoder.context);
+
+ self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->encoder.context->time_base.num = 1;
+ self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ self->encoder.context->width = TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.context->height = TMEDIA_CODEC_VIDEO(self)->out.height;
+
+ self->encoder.context->qmin = 10;
+ self->encoder.context->qmax = 51;
#if LIBAVCODEC_VERSION_MAJOR <= 53
self->encoder.context->mb_qmin = self->encoder.context->qmin;
- self->encoder.context->mb_qmax = self->encoder.context->qmax;
+ self->encoder.context->mb_qmax = self->encoder.context->qmax;
#endif
- self->encoder.context->mb_decision = FF_MB_DECISION_RD;
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
- self->encoder.max_bw_kpbs
- );
- self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
- //self->encoder.context->rc_lookahead = 0;
- self->encoder.context->rtp_payload_size = RTP_PAYLOAD_SIZE;
- self->encoder.context->opaque = tsk_null;
- self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * TDAV_H263_GOP_SIZE_IN_SECONDS);
- self->encoder.context->flags |= CODEC_FLAG_QSCALE;
- self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
- self->encoder.context->max_b_frames = 0;
-
- // Picture (YUV 420)
- if(!(self->encoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create encoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->encoder.picture);
- //if((ret = avpicture_alloc((AVPicture*)self->encoder.picture, PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height))){
- // TSK_DEBUG_ERROR("Failed to allocate encoder picture");
- // return ret;
- //}
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
- if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
- return -2;
- }
-
-
- // RTP Callback
- switch(self->type){
- case tdav_codec_h263_1996:
- { // H263 - 1996
- break;
- }
- case tdav_codec_h263_1998:
- { // H263 - 1998
+ self->encoder.context->mb_decision = FF_MB_DECISION_RD;
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
+ self->encoder.max_bw_kpbs
+ );
+ self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
+ //self->encoder.context->rc_lookahead = 0;
+ self->encoder.context->rtp_payload_size = RTP_PAYLOAD_SIZE;
+ self->encoder.context->opaque = tsk_null;
+ self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * TDAV_H263_GOP_SIZE_IN_SECONDS);
+ self->encoder.context->flags |= CODEC_FLAG_QSCALE;
+ self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
+ self->encoder.context->max_b_frames = 0;
+
+ // Picture (YUV 420)
+ if(!(self->encoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create encoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->encoder.picture);
+ //if((ret = avpicture_alloc((AVPicture*)self->encoder.picture, PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height))){
+ // TSK_DEBUG_ERROR("Failed to allocate encoder picture");
+ // return ret;
+ //}
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
+ if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
+ return -2;
+ }
+
+
+ // RTP Callback
+ switch(self->type) {
+ case tdav_codec_h263_1996: {
+ // H263 - 1996
+ break;
+ }
+ case tdav_codec_h263_1998: {
+ // H263 - 1998
#if defined(CODEC_FLAG_H263P_UMV)
- self->encoder.context->flags |= CODEC_FLAG_H263P_UMV; // Annex D+
+ self->encoder.context->flags |= CODEC_FLAG_H263P_UMV; // Annex D+
#endif
- self->encoder.context->flags |= CODEC_FLAG_AC_PRED; // Annex I and T
- self->encoder.context->flags |= CODEC_FLAG_LOOP_FILTER; // Annex J
+ self->encoder.context->flags |= CODEC_FLAG_AC_PRED; // Annex I and T
+ self->encoder.context->flags |= CODEC_FLAG_LOOP_FILTER; // Annex J
#if defined(CODEC_FLAG_H263P_SLICE_STRUCT)
- self->encoder.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT; // Annex K
+ self->encoder.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT; // Annex K
#endif
#if defined(CODEC_FLAG_H263P_AIV)
- self->encoder.context->flags |= CODEC_FLAG_H263P_AIV; // Annex S
+ self->encoder.context->flags |= CODEC_FLAG_H263P_AIV; // Annex S
#endif
- break;
- }
- case tdav_codec_h263_2000:
- { // H263 - 2000
+ break;
+ }
+ case tdav_codec_h263_2000: {
+ // H263 - 2000
#if defined(CODEC_FLAG_H263P_UMV)
- self->encoder.context->flags |= CODEC_FLAG_H263P_UMV; // Annex D+
+ self->encoder.context->flags |= CODEC_FLAG_H263P_UMV; // Annex D+
#endif
- self->encoder.context->flags |= CODEC_FLAG_AC_PRED; // Annex I and T
- self->encoder.context->flags |= CODEC_FLAG_LOOP_FILTER; // Annex J
+ self->encoder.context->flags |= CODEC_FLAG_AC_PRED; // Annex I and T
+ self->encoder.context->flags |= CODEC_FLAG_LOOP_FILTER; // Annex J
#if defined(CODEC_FLAG_H263P_SLICE_STRUCT)
- self->encoder.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT; // Annex K
+ self->encoder.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT; // Annex K
#endif
#if defined(CODEC_FLAG_H263P_AIV)
- self->encoder.context->flags |= CODEC_FLAG_H263P_AIV; // Annex S
+ self->encoder.context->flags |= CODEC_FLAG_H263P_AIV; // Annex S
#endif
- break;
- }
- }
- // Open encoder
- if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
- return ret;
- }
-
- TSK_DEBUG_INFO("[H.263] bitrate=%d bps", self->encoder.context->bit_rate);
-
- return ret;
+ break;
+ }
+ }
+ // Open encoder
+ if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
+ return ret;
+ }
+
+ TSK_DEBUG_INFO("[H.263] bitrate=%d bps", self->encoder.context->bit_rate);
+
+ return ret;
}
int tdav_codec_h263_open_decoder(tdav_codec_h263_t* self)
{
- int ret, size;
-
- if(self->decoder.context){
- TSK_DEBUG_ERROR("Decoder already opened");
- return -1;
- }
-
- self->decoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->decoder.context);
-
- self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
- self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
-
- // Picture (YUV 420)
- if(!(self->decoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create decoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->decoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
- if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- // Open decoder
- if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
- return ret;
- }
-
+ int ret, size;
+
+ if(self->decoder.context) {
+ TSK_DEBUG_ERROR("Decoder already opened");
+ return -1;
+ }
+
+ self->decoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->decoder.context);
+
+ self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
+ self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
+
+ // Picture (YUV 420)
+ if(!(self->decoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create decoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->decoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
+ if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ // Open decoder
+ if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
+ return ret;
+ }
+
self->decoder.last_seq = 0;
- return ret;
+ return ret;
}
int tdav_codec_h263_close_encoder(tdav_codec_h263_t* self)
{
- if(self->encoder.context){
- avcodec_close(self->encoder.context);
- av_free(self->encoder.context);
- self->encoder.context = tsk_null;
- }
- if(self->encoder.picture){
- av_free(self->encoder.picture);
- self->encoder.picture = tsk_null;
- }
- if(self->encoder.buffer){
- TSK_FREE(self->encoder.buffer);
- }
- return 0;
+ if(self->encoder.context) {
+ avcodec_close(self->encoder.context);
+ av_free(self->encoder.context);
+ self->encoder.context = tsk_null;
+ }
+ if(self->encoder.picture) {
+ av_free(self->encoder.picture);
+ self->encoder.picture = tsk_null;
+ }
+ if(self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
+ return 0;
}
int tdav_codec_h263_close_decoder(tdav_codec_h263_t* self)
{
- if(self->decoder.context){
- avcodec_close(self->decoder.context);
- av_free(self->decoder.context);
- self->decoder.context = tsk_null;
- }
- if(self->decoder.picture){
- av_free(self->decoder.picture);
- self->decoder.picture = tsk_null;
- }
- if(self->decoder.accumulator){
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_pos = 0;
- }
- return 0;
+ if(self->decoder.context) {
+ avcodec_close(self->decoder.context);
+ av_free(self->decoder.context);
+ self->decoder.context = tsk_null;
+ }
+ if(self->decoder.picture) {
+ av_free(self->decoder.picture);
+ self->decoder.picture = tsk_null;
+ }
+ if(self->decoder.accumulator) {
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_pos = 0;
+ }
+ return 0;
}
/* ============ Callbacks ================= */
static void tdav_codec_h263_encap(const tdav_codec_h263_t* h263, const uint8_t* pdata, tsk_size_t size)
{
- tsk_bool_t frag = tsk_false;
- register uint32_t i, last_index = 0;
-
- if(size < RTP_PAYLOAD_SIZE){
- goto last;
- }
-
- for(i = 4; i<(size - 4); i++){
- if(pdata[i] == 0x00 && pdata[i+1] == 0x00 && pdata[i+2]>=0x80){ /* PSC or (GBSC) found */
- if((i - last_index) >= RTP_PAYLOAD_SIZE || tsk_true/* FIXME */){
- switch(h263->type){
- case tdav_codec_h263_1996:
- tdav_codec_h263_rtp_callback((tdav_codec_h263_t*) h263, pdata+last_index,
- (i - last_index), (last_index == size));
- break;
- default:
- tdav_codec_h263p_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
- (i - last_index), frag, (last_index == size));
- frag = tsk_true;
- break;
- }
- last_index = i;
- }
- }
- }
+ tsk_bool_t frag = tsk_false;
+ register uint32_t i, last_index = 0;
+
+ if(size < RTP_PAYLOAD_SIZE) {
+ goto last;
+ }
+
+ for(i = 4; i<(size - 4); i++) {
+ if(pdata[i] == 0x00 && pdata[i+1] == 0x00 && pdata[i+2]>=0x80) { /* PSC or (GBSC) found */
+ if((i - last_index) >= RTP_PAYLOAD_SIZE || tsk_true/* FIXME */) {
+ switch(h263->type) {
+ case tdav_codec_h263_1996:
+ tdav_codec_h263_rtp_callback((tdav_codec_h263_t*) h263, pdata+last_index,
+ (i - last_index), (last_index == size));
+ break;
+ default:
+ tdav_codec_h263p_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
+ (i - last_index), frag, (last_index == size));
+ frag = tsk_true;
+ break;
+ }
+ last_index = i;
+ }
+ }
+ }
last:
- if(last_index < size){
- switch(h263->type){
- case tdav_codec_h263_1996:
- tdav_codec_h263_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
- (size - last_index), tsk_true);
- break;
- default:
- tdav_codec_h263p_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
- (size - last_index), frag, tsk_true);
- break;
- }
- }
+ if(last_index < size) {
+ switch(h263->type) {
+ case tdav_codec_h263_1996:
+ tdav_codec_h263_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
+ (size - last_index), tsk_true);
+ break;
+ default:
+ tdav_codec_h263p_rtp_callback((tdav_codec_h263_t*) h263, pdata + last_index,
+ (size - last_index), frag, tsk_true);
+ break;
+ }
+ }
}
static void tdav_codec_h263_rtp_callback(tdav_codec_h263_t *self, const void *data, tsk_size_t size, tsk_bool_t marker)
{
- uint8_t* pdata = (uint8_t*)data;
-
- if(self->rtp.size < (size + H263_HEADER_MODE_A_SIZE)){
- if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (size + H263_HEADER_MODE_A_SIZE)))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return;
- }
- self->rtp.size = (size + H263_HEADER_MODE_A_SIZE);
- }
- memcpy((self->rtp.ptr + H263_HEADER_MODE_A_SIZE), data, size);
-
- /* http://eu.sabotage.org/www/ITU/H/H0263e.pdf section 5.1
- * 5.1.1 Picture Start Code (PSC) (22 bits) - PSC is a word of 22 bits. Its value is 0000 0000 0000 0000 1 00000.
-
- *
- * 5.1.1 Picture Start Code (PSC) (22 bits)
- * 5.1.2 Temporal Reference (TR) (8 bits)
- * 5.1.3 Type Information (PTYPE) (Variable Length)
- * – Bit 1: Always "1", in order to avoid start code emulation.
- * – Bit 2: Always "0", for distinction with Recommendation H.261.
-
- * – Bit 3: Split screen indicator, "0" off, "1" on.
- * – Bit 4: Document camera indicator, "0" off, "1" on.
- * – Bit 5: Full Picture Freeze Release, "0" off, "1" on.
- * – Bits 6-8: Source Format, "000" forbidden, "001" sub-QCIF, "010" QCIF, "011" CIF,
- "100" 4CIF, "101" 16CIF, "110" reserved, "111" extended PTYPE.
- If bits 6-8 are not equal to "111", which indicates an extended PTYPE (PLUSPTYPE), the following
- five bits are also present in PTYPE:
- – Bit 9: Picture Coding Type, "0" INTRA (I-picture), "1" INTER (P-picture).
- – Bit 10: Optional Unrestricted Motion Vector mode (see Annex D), "0" off, "1" on.
- – Bit 11: Optional Syntax-based Arithmetic Coding mode (see Annex E), "0" off, "1" on.
- – Bit 12: Optional Advanced Prediction mode (see Annex F), "0" off, "1" on.
- – Bit 13: Optional PB-frames mode (see Annex G), "0" normal I- or P-picture, "1" PB-frame.
- */
- if(pdata[0] == 0x00 && pdata[1] == 0x00 && (pdata[2] & 0xfc)==0x80){ /* PSC */
- /* RFC 2190 -5.1 Mode A
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |F|P|SBIT |EBIT | SRC |I|U|S|A|R |DBQ| TRB | TR |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- SRC : 3 bits
- Source format, bit 6,7 and 8 in PTYPE defined by H.263 [4], specifies
- the resolution of the current picture.
-
- I: 1 bit.
- Picture coding type, bit 9 in PTYPE defined by H.263[4], "0" is
- intra-coded, "1" is inter-coded.
- */
-
- // PDATA[4] ======> Bits 3-10 of PTYPE
- uint32_t rtp_hdr = 0;
- uint8_t format, pict_type;
-
- // Source Format = 4,5,6
- format = (pdata[4] & 0x3C)>>2;
- // Picture Coding Type = 7
- pict_type = (pdata[4] & 0x02)>>1;
- // RTP mode A header
- ((uint8_t*)&rtp_hdr)[1] = (format <<5) | (pict_type << 4);
- //rtp_hdr = tnet_htonl(rtp_hdr);
- memcpy(self->rtp.ptr, &rtp_hdr, sizeof(rtp_hdr));
- }
-
- // Send data over the network
- if(TMEDIA_CODEC_VIDEO(self)->out.callback){
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (size + H263_HEADER_MODE_A_SIZE);
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(self->rtp.size < (size + H263_HEADER_MODE_A_SIZE)) {
+ if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (size + H263_HEADER_MODE_A_SIZE)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return;
+ }
+ self->rtp.size = (size + H263_HEADER_MODE_A_SIZE);
+ }
+ memcpy((self->rtp.ptr + H263_HEADER_MODE_A_SIZE), data, size);
+
+ /* http://eu.sabotage.org/www/ITU/H/H0263e.pdf section 5.1
+ * 5.1.1 Picture Start Code (PSC) (22 bits) - PSC is a word of 22 bits. Its value is 0000 0000 0000 0000 1 00000.
+
+ *
+ * 5.1.1 Picture Start Code (PSC) (22 bits)
+ * 5.1.2 Temporal Reference (TR) (8 bits)
+ * 5.1.3 Type Information (PTYPE) (Variable Length)
+ * – Bit 1: Always "1", in order to avoid start code emulation.
+ * – Bit 2: Always "0", for distinction with Recommendation H.261.
+
+ * – Bit 3: Split screen indicator, "0" off, "1" on.
+ * – Bit 4: Document camera indicator, "0" off, "1" on.
+ * – Bit 5: Full Picture Freeze Release, "0" off, "1" on.
+ * – Bits 6-8: Source Format, "000" forbidden, "001" sub-QCIF, "010" QCIF, "011" CIF,
+ "100" 4CIF, "101" 16CIF, "110" reserved, "111" extended PTYPE.
+ If bits 6-8 are not equal to "111", which indicates an extended PTYPE (PLUSPTYPE), the following
+ five bits are also present in PTYPE:
+ – Bit 9: Picture Coding Type, "0" INTRA (I-picture), "1" INTER (P-picture).
+ – Bit 10: Optional Unrestricted Motion Vector mode (see Annex D), "0" off, "1" on.
+ – Bit 11: Optional Syntax-based Arithmetic Coding mode (see Annex E), "0" off, "1" on.
+ – Bit 12: Optional Advanced Prediction mode (see Annex F), "0" off, "1" on.
+ – Bit 13: Optional PB-frames mode (see Annex G), "0" normal I- or P-picture, "1" PB-frame.
+ */
+ if(pdata[0] == 0x00 && pdata[1] == 0x00 && (pdata[2] & 0xfc)==0x80) { /* PSC */
+ /* RFC 2190 -5.1 Mode A
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |F|P|SBIT |EBIT | SRC |I|U|S|A|R |DBQ| TRB | TR |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ SRC : 3 bits
+ Source format, bit 6,7 and 8 in PTYPE defined by H.263 [4], specifies
+ the resolution of the current picture.
+
+ I: 1 bit.
+ Picture coding type, bit 9 in PTYPE defined by H.263[4], "0" is
+ intra-coded, "1" is inter-coded.
+ */
+
+ // PDATA[4] ======> Bits 3-10 of PTYPE
+ uint32_t rtp_hdr = 0;
+ uint8_t format, pict_type;
+
+ // Source Format = 4,5,6
+ format = (pdata[4] & 0x3C)>>2;
+ // Picture Coding Type = 7
+ pict_type = (pdata[4] & 0x02)>>1;
+ // RTP mode A header
+ ((uint8_t*)&rtp_hdr)[1] = (format <<5) | (pict_type << 4);
+ //rtp_hdr = tnet_htonl(rtp_hdr);
+ memcpy(self->rtp.ptr, &rtp_hdr, sizeof(rtp_hdr));
+ }
+
+ // Send data over the network
+ if(TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (size + H263_HEADER_MODE_A_SIZE);
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
}
static void tdav_codec_h263p_rtp_callback(tdav_codec_h263_t *self, const void *data, tsk_size_t size, tsk_bool_t frag, tsk_bool_t marker)
{
- uint8_t* pdata = (uint8_t*)data;
- //uint8_t rtp_hdr[2] = {0x00, 0x00};
- //tsk_bool_t eos = tsk_false;
+ uint8_t* pdata = (uint8_t*)data;
+ //uint8_t rtp_hdr[2] = {0x00, 0x00};
+ //tsk_bool_t eos = tsk_false;
- const void* _ptr = tsk_null;
- tsk_size_t _size = 0;
- //static tsk_bool_t frag = tsk_false;
- //tsk_bool_t found_gob = tsk_false;
+ const void* _ptr = tsk_null;
+ tsk_size_t _size = 0;
+ //static tsk_bool_t frag = tsk_false;
+ //tsk_bool_t found_gob = tsk_false;
- /* RFC 4629 - 5.1. General H.263+ Payload Header
- The H.263+ payload header is structured as follows:
+ /* RFC 4629 - 5.1. General H.263+ Payload Header
+ The H.263+ payload header is structured as follows:
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RR |P|V| PLEN |PEBIT|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- /* http://eu.sabotage.org/www/ITU/H/H0263e.pdf
- *
- * 5.1.1 Picture Start Code (PSC) (22 bits)
- * ->PSC is a word of 22 bits. Its value is 0000 0000 0000 0000 1 00000.
- * 5.1.27 End Of Sequence (EOS) (22 bits)
- * ->A codeword of 22 bits. Its value is 0000 0000 0000 0000 1 11111
- * 5.2.2 Group of Block Start Code (GBSC) (17 bits)
- * ->A word of 17 bits. Its value is 0000 0000 0000 0000 1
- * C.4.1 End Of Sub-Bitstream code (EOSBS) (23 bits)
- * ->The EOSBS code is a codeword of 23 bits. Its value is 0000 0000 0000 0000 1 11110 0
- *
- *
- * 5.2.3 Group Number (GN) (5 bits)
- * -> last 5 bits
- */
- //if(pdata[0] == 0x00 && pdata[1] == 0x00 && pdata[2] >= 0x80){ /* PSC or EOS or GBSC */
- // uint8_t GN = ((pdata[2]>>2) & 0x1F);
- // found_gob = tsk_true;
- // //TSK_DEBUG_INFO("GN=%u", pdata[2]);
- //
- // /* RFC 4629 - 6.1.1. Packets that begin with a Picture Start Code
- // A packet that begins at the location of a Picture, GOB, slice, EOS,
- // or EOSBS start code shall omit the first two (all zero) bytes from
- // the H.263+ bitstream and signify their presence by setting P=1 in the
- // payload header.
- // */
-
- // if(GN == 0x00){ /* PSC 00000 */
- // /* Use the two first bytes as RTP header */
- // //pdata[0] |= 0x04; // P=1
-
- // /*
- // 0 1 2 3
- // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // | RR |1|V|0|0|0|0|0|0|0|0|0| bitstream data without the :
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // : first two 0 bytes of the PSC
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // */
-
- // //TSK_DEBUG_INFO("H263 - PSC");
- // }
- // else if(GN == 0x1F){ /* EOS 11111 */
- // /* Use the two first bytes as RTP header */
- // //pdata[0] |= 0x04; // P=1
- // eos = tsk_true;
- // /* RFC 4629 - 6.1.3. Packets that begin with an EOS or EOSBS Code
- // 0 1 2
- // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // | RR |1|V|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|0|0|
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // */
- // //TSK_DEBUG_INFO("H263 - EOS");
- // }
- // else /*if((GN >> 4) == 0x01)*/{ /* GBSC 10000 */
- // /* Use the two first bytes as RTP header */
- // //pdata[0] |= 0x04; // P=1
- //
- // /* RFC 4629 - 6.1.2. Packets that begin with GBSC or SSC
- // 0 1 2 3
- // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // | RR |1|V|0 0 1 0 0 1|PEBIT|1 0 0 0 0 0| picture header :
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // : starting with TR, PTYPE ... |
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // | ... | bitstream :
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // : data starting with GBSC/SSC without its first two 0 bytes
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // */
- // //TSK_DEBUG_INFO("H263 - GBSC");
- // found_gob = tsk_false;
- // }
- // //else if(EOSBS) -> Not Supported
- //}
- //else{
- // /* 6.2. Encapsulating Follow-on Packet (P=0) */
- // int i = 0;
- // i++;
- //}
-
- //if(/*eos*/!found_gob && frag){
- // if(self->rtp.size < (size + 2/* H263+ Header size */)){
- // if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (size + 2)))){
- // TSK_DEBUG_ERROR("Failed to allocate new buffer");
- // return;
- // }
- // self->rtp.size = (size + 2);
- // }
- // /* RFC 4629 - 6. Packetization Schemes */
- // //rtp_hdr[0] |= 0x00;
- // //memcpy(self->rtp.ptr, rtp_hdr/* zeros-> is it corretc? */, 2);
- // //memcpy((self->rtp.ptr + 2), pdata, size);
- // //_ptr = self->rtp.ptr;
- // //_size = (size + 2);
-
- // pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
- // _ptr = pdata;
- // _size = size;
- //}
- //else{
- // pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
- // _ptr = pdata;
- // _size = size;
- //}
+ */
+
+ /* http://eu.sabotage.org/www/ITU/H/H0263e.pdf
+ *
+ * 5.1.1 Picture Start Code (PSC) (22 bits)
+ * ->PSC is a word of 22 bits. Its value is 0000 0000 0000 0000 1 00000.
+ * 5.1.27 End Of Sequence (EOS) (22 bits)
+ * ->A codeword of 22 bits. Its value is 0000 0000 0000 0000 1 11111
+ * 5.2.2 Group of Block Start Code (GBSC) (17 bits)
+ * ->A word of 17 bits. Its value is 0000 0000 0000 0000 1
+ * C.4.1 End Of Sub-Bitstream code (EOSBS) (23 bits)
+ * ->The EOSBS code is a codeword of 23 bits. Its value is 0000 0000 0000 0000 1 11110 0
+ *
+ *
+ * 5.2.3 Group Number (GN) (5 bits)
+ * -> last 5 bits
+ */
+ //if(pdata[0] == 0x00 && pdata[1] == 0x00 && pdata[2] >= 0x80){ /* PSC or EOS or GBSC */
+ // uint8_t GN = ((pdata[2]>>2) & 0x1F);
+ // found_gob = tsk_true;
+ // //TSK_DEBUG_INFO("GN=%u", pdata[2]);
+ //
+ // /* RFC 4629 - 6.1.1. Packets that begin with a Picture Start Code
+ // A packet that begins at the location of a Picture, GOB, slice, EOS,
+ // or EOSBS start code shall omit the first two (all zero) bytes from
+ // the H.263+ bitstream and signify their presence by setting P=1 in the
+ // payload header.
+ // */
+
+ // if(GN == 0x00){ /* PSC 00000 */
+ // /* Use the two first bytes as RTP header */
+ // //pdata[0] |= 0x04; // P=1
+
+ // /*
+ // 0 1 2 3
+ // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | RR |1|V|0|0|0|0|0|0|0|0|0| bitstream data without the :
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // : first two 0 bytes of the PSC
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // */
+
+ // //TSK_DEBUG_INFO("H263 - PSC");
+ // }
+ // else if(GN == 0x1F){ /* EOS 11111 */
+ // /* Use the two first bytes as RTP header */
+ // //pdata[0] |= 0x04; // P=1
+ // eos = tsk_true;
+ // /* RFC 4629 - 6.1.3. Packets that begin with an EOS or EOSBS Code
+ // 0 1 2
+ // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | RR |1|V|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|0|0|
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // */
+ // //TSK_DEBUG_INFO("H263 - EOS");
+ // }
+ // else /*if((GN >> 4) == 0x01)*/{ /* GBSC 10000 */
+ // /* Use the two first bytes as RTP header */
+ // //pdata[0] |= 0x04; // P=1
+ //
+ // /* RFC 4629 - 6.1.2. Packets that begin with GBSC or SSC
+ // 0 1 2 3
+ // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | RR |1|V|0 0 1 0 0 1|PEBIT|1 0 0 0 0 0| picture header :
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // : starting with TR, PTYPE ... |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | ... | bitstream :
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // : data starting with GBSC/SSC without its first two 0 bytes
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // */
+ // //TSK_DEBUG_INFO("H263 - GBSC");
+ // found_gob = tsk_false;
+ // }
+ // //else if(EOSBS) -> Not Supported
+ //}
+ //else{
+ // /* 6.2. Encapsulating Follow-on Packet (P=0) */
+ // int i = 0;
+ // i++;
+ //}
+
+ //if(/*eos*/!found_gob && frag){
+ // if(self->rtp.size < (size + 2/* H263+ Header size */)){
+ // if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (size + 2)))){
+ // TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ // return;
+ // }
+ // self->rtp.size = (size + 2);
+ // }
+ // /* RFC 4629 - 6. Packetization Schemes */
+ // //rtp_hdr[0] |= 0x00;
+ // //memcpy(self->rtp.ptr, rtp_hdr/* zeros-> is it corretc? */, 2);
+ // //memcpy((self->rtp.ptr + 2), pdata, size);
+ // //_ptr = self->rtp.ptr;
+ // //_size = (size + 2);
+
+ // pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
+ // _ptr = pdata;
+ // _size = size;
+ //}
+ //else{
+ // pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
+ // _ptr = pdata;
+ // _size = size;
+ //}
// FIXME
- pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
- _ptr = pdata;
- _size = size;
-
-
- // Send data over the network
- if(TMEDIA_CODEC_VIDEO(self)->out.callback){
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = _ptr;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = _size;
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
+ pdata[0] |= pdata[2] > 0x80 ? 0x04 : 0x04;
+ _ptr = pdata;
+ _size = size;
+
+
+ // Send data over the network
+ if(TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = _ptr;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = _size;
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
}
tsk_bool_t tdav_codec_ffmpeg_h263_is_supported()
{
- return (avcodec_find_encoder(CODEC_ID_H263) && avcodec_find_decoder(CODEC_ID_H263));
+ return (avcodec_find_encoder(CODEC_ID_H263) && avcodec_find_decoder(CODEC_ID_H263));
}
tsk_bool_t tdav_codec_ffmpeg_h263p_is_supported()
{
- return (avcodec_find_encoder(CODEC_ID_H263P) && avcodec_find_decoder(CODEC_ID_H263));
+ return (avcodec_find_encoder(CODEC_ID_H263P) && avcodec_find_decoder(CODEC_ID_H263));
}
tsk_bool_t tdav_codec_ffmpeg_h263pp_is_supported()
{
- return tdav_codec_ffmpeg_h263p_is_supported();
+ return tdav_codec_ffmpeg_h263p_is_supported();
}
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264.c b/tinyDAV/src/codecs/h264/tdav_codec_h264.c
index 0ec3760..82cd2e5 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264.c
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,39 +51,38 @@
# endif
#endif
-typedef struct tdav_codec_h264_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
+typedef struct tdav_codec_h264_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
- // Encoder
- struct{
+ // Encoder
+ struct {
#if HAVE_FFMPEG
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
#endif
- void* buffer;
- int64_t frame_count;
- tsk_bool_t force_idr;
- int32_t quality; // [1-31]
- int rotation;
- int32_t max_bw_kpbs;
- tsk_bool_t passthrough; // whether to bypass encoding
- } encoder;
-
- // decoder
- struct{
+ void* buffer;
+ int64_t frame_count;
+ tsk_bool_t force_idr;
+ int32_t quality; // [1-31]
+ int rotation;
+ int32_t max_bw_kpbs;
+ tsk_bool_t passthrough; // whether to bypass encoding
+ } encoder;
+
+ // decoder
+ struct {
#if HAVE_FFMPEG
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
#endif
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- uint16_t last_seq;
- tsk_bool_t passthrough; // whether to bypass decoding
- } decoder;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ uint16_t last_seq;
+ tsk_bool_t passthrough; // whether to bypass decoding
+ } decoder;
}
tdav_codec_h264_t;
@@ -105,401 +104,400 @@ static int tdav_codec_h264_close_decoder(tdav_codec_h264_t* self);
static int tdav_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
- if (param->value_type == tmedia_pvt_int32) {
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- h264->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
+ tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
+ if (param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ h264->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
#if HAVE_FFMPEG
- if (h264->encoder.context) {
- h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
- }
+ if (h264->encoder.context) {
+ h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
+ }
#endif
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
#if HAVE_FFMPEG
- if (h264->encoder.context) {
- h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
- }
+ if (h264->encoder.context) {
+ h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
+ }
#endif
- break;
- }
- }
- return 0;
- }
- else if(tsk_striequals(param->key, "bw_kbps")){
- int32_t max_bw_userdefine = self->bandwidth_max_upload;
- int32_t max_bw_new = *((int32_t*)param->value);
- if (max_bw_userdefine > 0) {
- // do not use more than what the user defined in it's configuration
- h264->encoder.max_bw_kpbs = TSK_MIN(max_bw_new, max_bw_userdefine);
- }
- else {
- h264->encoder.max_bw_kpbs = max_bw_new;
- }
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-encoding")){
- h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "bypass-decoding")){
- h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
- TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
- return 0;
- }
- else if(tsk_striequals(param->key, "rotation")){
- int32_t rotation = *((int32_t*)param->value);
- if(h264->encoder.rotation != rotation){
+ break;
+ }
+ }
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bw_kbps")) {
+ int32_t max_bw_userdefine = self->bandwidth_max_upload;
+ int32_t max_bw_new = *((int32_t*)param->value);
+ if (max_bw_userdefine > 0) {
+ // do not use more than what the user defined in it's configuration
+ h264->encoder.max_bw_kpbs = TSK_MIN(max_bw_new, max_bw_userdefine);
+ }
+ else {
+ h264->encoder.max_bw_kpbs = max_bw_new;
+ }
+ // dynamic bandwidth change not implemented for x264
+ // please use openh264 or msf264
+ TSK_DEBUG_INFO("Bandwidth change not supported using x264 ...ignoring new bandwidth value");
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-encoding")) {
+ h264->encoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ TSK_DEBUG_INFO("[H.264] bypass-encoding = %d", h264->encoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "bypass-decoding")) {
+ h264->decoder.passthrough = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ TSK_DEBUG_INFO("[H.264] bypass-decoding = %d", h264->decoder.passthrough);
+ return 0;
+ }
+ else if(tsk_striequals(param->key, "rotation")) {
+ int32_t rotation = *((int32_t*)param->value);
+ if(h264->encoder.rotation != rotation) {
h264->encoder.rotation = rotation;
- if (self->opened) {
- int ret;
+ if (self->opened) {
+ int ret;
if ((ret = tdav_codec_h264_close_encoder(h264, kResetRotationFalse))) {
return ret;
}
- if ((ret = tdav_codec_h264_open_encoder(h264))) {
- return ret;
- }
+ if ((ret = tdav_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
#if 0 // Not working
- if((ret = avcodec_close(h264->encoder.context))){
- TSK_DEBUG_ERROR("Failed to close [%s] codec", TMEDIA_CODEC(h264)->plugin->desc);
- return ret;
- }
- h264->encoder.context->width = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(h264)->out.height : TMEDIA_CODEC_VIDEO(h264)->out.width;
- h264->encoder.context->height = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(h264)->out.width : TMEDIA_CODEC_VIDEO(h264)->out.height;
- if((ret = avcodec_open(h264->encoder.context, h264->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(h264)->plugin->desc);
- return ret;
- }
- h264->encoder.force_idr = tsk_true;
+ if((ret = avcodec_close(h264->encoder.context))) {
+ TSK_DEBUG_ERROR("Failed to close [%s] codec", TMEDIA_CODEC(h264)->plugin->desc);
+ return ret;
+ }
+ h264->encoder.context->width = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(h264)->out.height : TMEDIA_CODEC_VIDEO(h264)->out.width;
+ h264->encoder.context->height = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(h264)->out.width : TMEDIA_CODEC_VIDEO(h264)->out.height;
+ if((ret = avcodec_open(h264->encoder.context, h264->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(h264)->plugin->desc);
+ return ret;
+ }
+ h264->encoder.force_idr = tsk_true;
#endif
- }
- }
- return 0;
- }
- }
- return -1;
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
}
static int tdav_codec_h264_open(tmedia_codec_t* self)
{
- int ret;
- tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
- // Encoder
- if((ret = tdav_codec_h264_open_encoder(h264))){
- return ret;
- }
-
- // Decoder
- if((ret = tdav_codec_h264_open_decoder(h264))){
- return ret;
- }
-
- return 0;
+ int ret;
+ tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+ // Encoder
+ if((ret = tdav_codec_h264_open_encoder(h264))) {
+ return ret;
+ }
+
+ // Decoder
+ if((ret = tdav_codec_h264_open_decoder(h264))) {
+ return ret;
+ }
+
+ return 0;
}
static int tdav_codec_h264_close(tmedia_codec_t* self)
{
- tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
+ tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) alreasy checked that the codec is opened */
+ /* the caller (base class) alreasy checked that the codec is opened */
- // Encoder
- tdav_codec_h264_close_encoder(h264, kResetRotationTrue);
+ // Encoder
+ tdav_codec_h264_close_encoder(h264, kResetRotationTrue);
- // Decoder
- tdav_codec_h264_close_decoder(h264);
+ // Decoder
+ tdav_codec_h264_close_decoder(h264);
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret = 0;
+ int ret = 0;
#if HAVE_FFMPEG
- int size;
- tsk_bool_t send_idr, send_hdr;
+ int size;
+ tsk_bool_t send_idr, send_hdr;
#endif
- tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
+ tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
- if(!self || !in_data || !in_size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!self || !in_data || !in_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return 0;
- }
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return 0;
+ }
- if(h264->encoder.passthrough) {
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), (const uint8_t*)in_data, in_size);
- }
- else { // !h264->encoder.passthrough
+ if(h264->encoder.passthrough) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), (const uint8_t*)in_data, in_size);
+ }
+ else { // !h264->encoder.passthrough
#if HAVE_FFMPEG // wrap yuv420 buffer
- size = avpicture_fill((AVPicture *)h264->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h264->encoder.context->width, h264->encoder.context->height);
- if (size != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size: %u<>%u", size, in_size);
- return 0;
- }
-
- // send IDR for:
- // - the first frame
- // - remote peer requested an IDR
- // - every second within the first 4seconds
- send_idr = (
- h264->encoder.frame_count++ == 0
- || h264 ->encoder.force_idr
- //|| ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
- );
-
- // send SPS and PPS headers for:
- // - IDR frames (not required but it's the easiest way to deal with pkt loss)
- // - every 5 seconds after the first 4seconds
- send_hdr = (
- send_idr
- //|| ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
- );
- if(send_hdr){
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.context->extradata, (tsk_size_t)h264->encoder.context->extradata_size);
- }
-
- // Encode data
- #if LIBAVCODEC_VERSION_MAJOR <= 53
- h264->encoder.picture->pict_type = send_idr ? FF_I_TYPE : 0;
- #else
- h264->encoder.picture->pict_type = send_idr ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
- #endif
- h264->encoder.picture->key_frame = send_idr ? 1 : 0;
- h264->encoder.picture->pts = AV_NOPTS_VALUE;
- h264->encoder.picture->quality = h264->encoder.context->global_quality;
- // h264->encoder.picture->pts = h264->encoder.frame_count; MUST NOT
- ret = avcodec_encode_video(h264->encoder.context, h264->encoder.buffer, size, h264->encoder.picture);
- if(ret > 0){
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.buffer, (tsk_size_t)ret);
- }
- h264 ->encoder.force_idr = tsk_false;
+ size = avpicture_fill((AVPicture *)h264->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h264->encoder.context->width, h264->encoder.context->height);
+ if (size != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size: %u<>%u", size, in_size);
+ return 0;
+ }
+
+ // send IDR for:
+ // - the first frame
+ // - remote peer requested an IDR
+ // - every second within the first 4seconds
+ send_idr = (
+ h264->encoder.frame_count++ == 0
+ || h264 ->encoder.force_idr
+ //|| ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
+ );
+
+ // send SPS and PPS headers for:
+ // - IDR frames (not required but it's the easiest way to deal with pkt loss)
+ // - every 5 seconds after the first 4seconds
+ send_hdr = (
+ send_idr
+ //|| ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
+ );
+ if(send_hdr) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.context->extradata, (tsk_size_t)h264->encoder.context->extradata_size);
+ }
+
+ // Encode data
+#if LIBAVCODEC_VERSION_MAJOR <= 53
+ h264->encoder.picture->pict_type = send_idr ? FF_I_TYPE : 0;
+#else
+ h264->encoder.picture->pict_type = send_idr ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
+#endif
+ h264->encoder.picture->key_frame = send_idr ? 1 : 0;
+ h264->encoder.picture->pts = AV_NOPTS_VALUE;
+ h264->encoder.picture->quality = h264->encoder.context->global_quality;
+ // h264->encoder.picture->pts = h264->encoder.frame_count; MUST NOT
+ ret = avcodec_encode_video(h264->encoder.context, h264->encoder.buffer, size, h264->encoder.picture);
+ if(ret > 0) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), h264->encoder.buffer, (tsk_size_t)ret);
+ }
+ h264 ->encoder.force_idr = tsk_false;
#endif
- }// else(!h264->encoder.passthrough)
+ }// else(!h264->encoder.passthrough)
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
-
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0;
- int ret;
- tsk_bool_t sps_or_pps, append_scp, end_of_unit;
- tsk_size_t retsize = 0, size_to_copy = 0;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+ tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0;
+ int ret;
+ tsk_bool_t sps_or_pps, append_scp, end_of_unit;
+ tsk_size_t retsize = 0, size_to_copy = 0;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
#if HAVE_FFMPEG
- int got_picture_ptr = 0;
+ int got_picture_ptr = 0;
#endif
- if(!h264 || !in_data || !in_size || !out_data
+ if(!h264 || !in_data || !in_size || !out_data
#if HAVE_FFMPEG
- || !h264->decoder.context
+ || !h264->decoder.context
#endif
- )
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- //TSK_DEBUG_INFO("SeqNo=%hu", rtp_hdr->seq_num);
-
- /* Packet lost? */
- if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq){
- TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
- }
- h264->decoder.last_seq = rtp_hdr->seq_num;
-
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ ) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ //TSK_DEBUG_INFO("SeqNo=%hu", rtp_hdr->seq_num);
+
+ /* Packet lost? */
+ if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
+ TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
+ }
+ h264->decoder.last_seq = rtp_hdr->seq_num;
+
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- if(*((uint8_t*)in_data) & 0x80){
- TSK_DEBUG_WARN("F=1");
- /* reset accumulator */
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
-
- /* get payload */
- if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size){
- TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
- return 0;
- }
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
- // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
- sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
-
- // start-accumulator
- if(!h264->decoder.accumulator){
- if(size_to_copy > xmax_size){
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- return 0;
- }
- if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- return 0;
- }
- h264->decoder.accumulator_size = size_to_copy;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size){
- TSK_DEBUG_ERROR("BufferOverflow");
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size){
- if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))){
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
- return 0;
- }
- h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
- }
-
- if(append_scp){
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
- h264->decoder.accumulator_pos += start_code_prefix_size;
- }
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
- h264->decoder.accumulator_pos += pay_size;
- // end-accumulator
-
- if(sps_or_pps){
- // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
- // SPS and PPS should be bundled with IDR
- TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
- }
- else if(rtp_hdr->marker){
- if(h264->decoder.passthrough){
- if(*out_max_size < h264->decoder.accumulator_pos){
- if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))){
- *out_max_size = h264->decoder.accumulator_pos;
- }
- else{
- *out_max_size = 0;
- return 0;
- }
- }
- memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
- retsize = h264->decoder.accumulator_pos;
- }
- else { // !h264->decoder.passthrough
+ */
+ if(*((uint8_t*)in_data) & 0x80) {
+ TSK_DEBUG_WARN("F=1");
+ /* reset accumulator */
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ /* get payload */
+ if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size) {
+ TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
+ return 0;
+ }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+ // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
+ sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
+
+ // start-accumulator
+ if(!h264->decoder.accumulator) {
+ if(size_to_copy > xmax_size) {
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ return 0;
+ }
+ if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ return 0;
+ }
+ h264->decoder.accumulator_size = size_to_copy;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
+ if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+ return 0;
+ }
+ h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
+ }
+
+ if(append_scp) {
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ h264->decoder.accumulator_pos += start_code_prefix_size;
+ }
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
+ h264->decoder.accumulator_pos += pay_size;
+ // end-accumulator
+
+ if(sps_or_pps) {
+ // http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
+ // SPS and PPS should be bundled with IDR
+ TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
+ }
+ else if(rtp_hdr->marker) {
+ if(h264->decoder.passthrough) {
+ if(*out_max_size < h264->decoder.accumulator_pos) {
+ if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))) {
+ *out_max_size = h264->decoder.accumulator_pos;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
+ retsize = h264->decoder.accumulator_pos;
+ }
+ else { // !h264->decoder.passthrough
#if HAVE_FFMPEG
- AVPacket packet;
-
- /* decode the picture */
- av_init_packet(&packet);
- packet.dts = packet.pts = AV_NOPTS_VALUE;
- packet.size = (int)h264->decoder.accumulator_pos;
- packet.data = h264->decoder.accumulator;
- ret = avcodec_decode_video2(h264->decoder.context, h264->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret <0){
- TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
- if(TMEDIA_CODEC_VIDEO(self)->in.callback){
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- else if(got_picture_ptr){
- tsk_size_t xsize;
-
- /* IDR ? */
- if(((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback){
- TSK_DEBUG_INFO("Decoded H.264 IDR");
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- /* fill out */
- xsize = avpicture_get_size(h264->decoder.context->pix_fmt, h264->decoder.context->width, h264->decoder.context->height);
- if(*out_max_size<xsize){
- if((*out_data = tsk_realloc(*out_data, (xsize + FF_INPUT_BUFFER_PADDING_SIZE)))){
- *out_max_size = xsize;
- }
- else{
- *out_max_size = 0;
- return 0;
- }
- }
- retsize = xsize;
- TMEDIA_CODEC_VIDEO(h264)->in.width = h264->decoder.context->width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = h264->decoder.context->height;
- avpicture_layout((AVPicture *)h264->decoder.picture, h264->decoder.context->pix_fmt, (int)h264->decoder.context->width, (int)h264->decoder.context->height,
- *out_data, (int)retsize);
- }
+ AVPacket packet;
+
+ /* decode the picture */
+ av_init_packet(&packet);
+ packet.dts = packet.pts = AV_NOPTS_VALUE;
+ packet.size = (int)h264->decoder.accumulator_pos;
+ packet.data = h264->decoder.accumulator;
+ ret = avcodec_decode_video2(h264->decoder.context, h264->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret <0) {
+ TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ else if(got_picture_ptr) {
+ tsk_size_t xsize;
+
+ /* IDR ? */
+ if(((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TSK_DEBUG_INFO("Decoded H.264 IDR");
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ /* fill out */
+ xsize = avpicture_get_size(h264->decoder.context->pix_fmt, h264->decoder.context->width, h264->decoder.context->height);
+ if(*out_max_size<xsize) {
+ if((*out_data = tsk_realloc(*out_data, (xsize + FF_INPUT_BUFFER_PADDING_SIZE)))) {
+ *out_max_size = xsize;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ retsize = xsize;
+ TMEDIA_CODEC_VIDEO(h264)->in.width = h264->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = h264->decoder.context->height;
+ avpicture_layout((AVPicture *)h264->decoder.picture, h264->decoder.context->pix_fmt, (int)h264->decoder.context->width, (int)h264->decoder.context->height,
+ *out_data, (int)retsize);
+ }
#endif /* HAVE_FFMPEG */
- } // else(h264->decoder.passthrough)
+ } // else(h264->decoder.passthrough)
- h264->decoder.accumulator_pos = 0;
- } // else if(rtp_hdr->marker)
+ h264->decoder.accumulator_pos = 0;
+ } // else if(rtp_hdr->marker)
- return retsize;
+ return retsize;
}
static tsk_bool_t tdav_codec_h264_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
+ return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
}
static char* tdav_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
- if(att && tsk_striequals(att_name, "fmtp")) {
- tsk_strcat_2(&att, "; impl=%s",
+ char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
+ if(att && tsk_striequals(att_name, "fmtp")) {
+ tsk_strcat_2(&att, "; impl=%s",
#if HAVE_FFMPEG
- "FFMPEG"
+ "FFMPEG"
#elif HAVE_H264_PASSTHROUGH
- "PASSTHROUGH"
+ "PASSTHROUGH"
#endif
- );
- }
- return att;
+ );
+ }
+ return att;
}
@@ -510,64 +508,62 @@ static char* tdav_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char*
/* constructor */
static tsk_object_t* tdav_codec_h264_base_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(tdav_codec_h264_init(h264, profile_idc_baseline) != 0){
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(tdav_codec_h264_init(h264, profile_idc_baseline) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_base_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit((tdav_codec_h264_common_t*)self);
- /* deinit self */
- tdav_codec_h264_deinit(h264);
-
- }
-
- return self;
+{
+ tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit((tdav_codec_h264_common_t*)self);
+ /* deinit self */
+ tdav_codec_h264_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_base_def_s =
-{
- sizeof(tdav_codec_h264_t),
- tdav_codec_h264_base_ctor,
- tdav_codec_h264_base_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_base_def_s = {
+ sizeof(tdav_codec_h264_t),
+ tdav_codec_h264_base_ctor,
+ tdav_codec_h264_base_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_base_plugin_def_s =
-{
- &tdav_codec_h264_base_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "H264 Base Profile (FFmpeg, x264)",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0}, // fps is @deprecated
-
- tdav_codec_h264_set,
- tdav_codec_h264_open,
- tdav_codec_h264_close,
- tdav_codec_h264_encode,
- tdav_codec_h264_decode,
- tdav_codec_h264_sdp_att_match,
- tdav_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h264_base_plugin_def_s = {
+ &tdav_codec_h264_base_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "H264 Base Profile (FFmpeg, x264)",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0}, // fps is @deprecated
+
+ tdav_codec_h264_set,
+ tdav_codec_h264_open,
+ tdav_codec_h264_close,
+ tdav_codec_h264_encode,
+ tdav_codec_h264_decode,
+ tdav_codec_h264_sdp_att_match,
+ tdav_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h264_base_plugin_def_t = &tdav_codec_h264_base_plugin_def_s;
@@ -576,64 +572,62 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_base_plugin_def_t = &tdav_codec
/* constructor */
static tsk_object_t* tdav_codec_h264_main_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if(tdav_codec_h264_init(h264, profile_idc_main) != 0){
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if(tdav_codec_h264_init(h264, profile_idc_main) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_main_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit((tdav_codec_h264_common_t*)self);
- /* deinit self */
- tdav_codec_h264_deinit(h264);
-
- }
-
- return self;
+{
+ tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit((tdav_codec_h264_common_t*)self);
+ /* deinit self */
+ tdav_codec_h264_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_main_def_s =
-{
- sizeof(tdav_codec_h264_t),
- tdav_codec_h264_main_ctor,
- tdav_codec_h264_main_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_main_def_s = {
+ sizeof(tdav_codec_h264_t),
+ tdav_codec_h264_main_ctor,
+ tdav_codec_h264_main_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_main_plugin_def_s =
-{
- &tdav_codec_h264_main_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_mp,
- "H264",
- "H264 Main Profile (FFmpeg, x264)",
- TMEDIA_CODEC_FORMAT_H264_MP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps)*/
- {176, 144, 0},// fps is @deprecated
-
- tdav_codec_h264_set,
- tdav_codec_h264_open,
- tdav_codec_h264_close,
- tdav_codec_h264_encode,
- tdav_codec_h264_decode,
- tdav_codec_h264_sdp_att_match,
- tdav_codec_h264_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h264_main_plugin_def_s = {
+ &tdav_codec_h264_main_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_mp,
+ "H264",
+ "H264 Main Profile (FFmpeg, x264)",
+ TMEDIA_CODEC_FORMAT_H264_MP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps)*/
+ {176, 144, 0},// fps is @deprecated
+
+ tdav_codec_h264_set,
+ tdav_codec_h264_open,
+ tdav_codec_h264_close,
+ tdav_codec_h264_encode,
+ tdav_codec_h264_decode,
+ tdav_codec_h264_sdp_att_match,
+ tdav_codec_h264_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h264_main_plugin_def_t = &tdav_codec_h264_main_plugin_def_s;
@@ -678,315 +672,315 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_main_plugin_def_t = &tdav_codec
int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
- int ret;
- tsk_size_t size;
-
- if(self->encoder.context){
- TSK_DEBUG_ERROR("Encoder already opened");
- return -1;
- }
-
+ int ret;
+ tsk_size_t size;
+
+ if(self->encoder.context) {
+ TSK_DEBUG_ERROR("Encoder already opened");
+ return -1;
+ }
+
#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 35, 0))
- if((self->encoder.context = avcodec_alloc_context3(self->encoder.codec))){
+ if((self->encoder.context = avcodec_alloc_context3(self->encoder.codec))) {
avcodec_get_context_defaults3(self->encoder.context, self->encoder.codec);
}
#else
- if((self->encoder.context = avcodec_alloc_context())){
+ if((self->encoder.context = avcodec_alloc_context())) {
avcodec_get_context_defaults(self->encoder.context);
}
#endif
-
- if(!self->encoder.context){
+
+ if(!self->encoder.context) {
TSK_DEBUG_ERROR("Failed to allocate context");
- return -1;
+ return -1;
}
#if TDAV_UNDER_X86 && LIBAVCODEC_VERSION_MAJOR <= 53
- self->encoder.context->dsp_mask = (FF_MM_MMX | FF_MM_MMXEXT | FF_MM_SSE);
+ self->encoder.context->dsp_mask = (FF_MM_MMX | FF_MM_MMXEXT | FF_MM_SSE);
#endif
- self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->encoder.context->time_base.num = 1;
- self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
- self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
- TMEDIA_CODEC(self)->bandwidth_max_upload
- );
- self->encoder.context->bit_rate = (self->encoder.max_bw_kpbs * 1024);// bps
-
- self->encoder.context->rc_min_rate = (self->encoder.context->bit_rate >> 3);
- self->encoder.context->rc_max_rate = self->encoder.context->bit_rate;
+ self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->encoder.context->time_base.num = 1;
+ self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
+ TMEDIA_CODEC(self)->bandwidth_max_upload
+ );
+ self->encoder.context->bit_rate = (self->encoder.max_bw_kpbs * 1024);// bps
+
+ self->encoder.context->rc_min_rate = (self->encoder.context->bit_rate >> 3);
+ self->encoder.context->rc_max_rate = self->encoder.context->bit_rate;
#if LIBAVCODEC_VERSION_MAJOR <= 53
- self->encoder.context->rc_lookahead = 0;
+ self->encoder.context->rc_lookahead = 0;
#endif
- self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
-
+ self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
+
#if LIBAVCODEC_VERSION_MAJOR <= 53
self->encoder.context->partitions = X264_PART_I4X4 | X264_PART_I8X8 | X264_PART_P8X8 | X264_PART_B8X8;
#endif
self->encoder.context->me_method = ME_UMH;
- self->encoder.context->me_range = 16;
- self->encoder.context->qmin = 10;
- self->encoder.context->qmax = 51;
+ self->encoder.context->me_range = 16;
+ self->encoder.context->qmin = 10;
+ self->encoder.context->qmax = 51;
#if LIBAVCODEC_VERSION_MAJOR <= 53
self->encoder.context->mb_qmin = self->encoder.context->qmin;
- self->encoder.context->mb_qmax = self->encoder.context->qmax;
+ self->encoder.context->mb_qmax = self->encoder.context->qmax;
#endif
- /* METROPOLIS = G2J.COM TelePresence client. Check Issue 378: No video when calling "TANDBERG/4129 (X8.1.1)" */
+ /* METROPOLIS = G2J.COM TelePresence client. Check Issue 378: No video when calling "TANDBERG/4129 (X8.1.1)" */
#if !METROPOLIS && 0
- self->encoder.context->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ self->encoder.context->flags |= CODEC_FLAG_GLOBAL_HEADER;
#endif
self->encoder.context->flags |= CODEC_FLAG_LOW_DELAY;
- if (self->encoder.context->profile == FF_PROFILE_H264_BASELINE) {
- self->encoder.context->max_b_frames = 0;
- }
-
- switch(TDAV_CODEC_H264_COMMON(self)->profile){
- case profile_idc_baseline:
- default:
- self->encoder.context->profile = FF_PROFILE_H264_BASELINE;
- self->encoder.context->level = TDAV_CODEC_H264_COMMON(self)->level;
- break;
- case profile_idc_main:
- self->encoder.context->profile = FF_PROFILE_H264_MAIN;
- self->encoder.context->level = TDAV_CODEC_H264_COMMON(self)->level;
- break;
- }
-
- /* Comment from libavcodec/libx264.c:
+ if (self->encoder.context->profile == FF_PROFILE_H264_BASELINE) {
+ self->encoder.context->max_b_frames = 0;
+ }
+
+ switch(TDAV_CODEC_H264_COMMON(self)->profile) {
+ case profile_idc_baseline:
+ default:
+ self->encoder.context->profile = FF_PROFILE_H264_BASELINE;
+ self->encoder.context->level = TDAV_CODEC_H264_COMMON(self)->level;
+ break;
+ case profile_idc_main:
+ self->encoder.context->profile = FF_PROFILE_H264_MAIN;
+ self->encoder.context->level = TDAV_CODEC_H264_COMMON(self)->level;
+ break;
+ }
+
+ /* Comment from libavcodec/libx264.c:
* Allow x264 to be instructed through AVCodecContext about the maximum
* size of the RTP payload. For example, this enables the production of
* payload suitable for the H.264 RTP packetization-mode 0 i.e. single
* NAL unit per RTP packet.
*/
- self->encoder.context->rtp_payload_size = H264_RTP_PAYLOAD_SIZE;
- self->encoder.context->opaque = tsk_null;
- self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * TDAV_H264_GOP_SIZE_IN_SECONDS);
-
+ self->encoder.context->rtp_payload_size = H264_RTP_PAYLOAD_SIZE;
+ self->encoder.context->opaque = tsk_null;
+ self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * TDAV_H264_GOP_SIZE_IN_SECONDS);
+
#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 35, 0))
- if((ret = av_opt_set_int(self->encoder.context->priv_data, "slice-max-size", H264_RTP_PAYLOAD_SIZE, 0))){
- TSK_DEBUG_ERROR("Failed to set x264 slice-max-size to %d", H264_RTP_PAYLOAD_SIZE);
- }
- if((ret = av_opt_set(self->encoder.context->priv_data, "profile", (self->encoder.context->profile == FF_PROFILE_H264_BASELINE ? "baseline" : "main"), 0))){
- TSK_DEBUG_ERROR("Failed to set x264 profile");
- }
- if((ret = av_opt_set(self->encoder.context->priv_data, "preset", "veryfast", 0))){
- TSK_DEBUG_ERROR("Failed to set x264 preset to veryfast");
- }
- if((ret = av_opt_set_int(self->encoder.context->priv_data, "rc-lookahead", 0, 0)) && (ret = av_opt_set_int(self->encoder.context->priv_data, "rc_lookahead", 0, 0))){
+ if((ret = av_opt_set_int(self->encoder.context->priv_data, "slice-max-size", H264_RTP_PAYLOAD_SIZE, 0))) {
+ TSK_DEBUG_ERROR("Failed to set x264 slice-max-size to %d", H264_RTP_PAYLOAD_SIZE);
+ }
+ if((ret = av_opt_set(self->encoder.context->priv_data, "profile", (self->encoder.context->profile == FF_PROFILE_H264_BASELINE ? "baseline" : "main"), 0))) {
+ TSK_DEBUG_ERROR("Failed to set x264 profile");
+ }
+ if((ret = av_opt_set(self->encoder.context->priv_data, "preset", "veryfast", 0))) {
+ TSK_DEBUG_ERROR("Failed to set x264 preset to veryfast");
+ }
+ if((ret = av_opt_set_int(self->encoder.context->priv_data, "rc-lookahead", 0, 0)) && (ret = av_opt_set_int(self->encoder.context->priv_data, "rc_lookahead", 0, 0))) {
TSK_DEBUG_ERROR("Failed to set x264 rc_lookahead=0");
}
- if((ret = av_opt_set(self->encoder.context->priv_data, "tune", "animation+zerolatency", 0))){
- TSK_DEBUG_ERROR("Failed to set x264 tune to zerolatency");
- }
+ if((ret = av_opt_set(self->encoder.context->priv_data, "tune", "animation+zerolatency", 0))) {
+ TSK_DEBUG_ERROR("Failed to set x264 tune to zerolatency");
+ }
#endif
- // Picture (YUV 420)
- if(!(self->encoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create encoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->encoder.picture);
-
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
- if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
- return -2;
- }
-
- // Open encoder
- if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
- return ret;
- }
-
+ // Picture (YUV 420)
+ if(!(self->encoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create encoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->encoder.picture);
+
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
+ if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
+ return -2;
+ }
+
+ // Open encoder
+ if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
+ return ret;
+ }
+
self->encoder.frame_count = 0;
- TSK_DEBUG_INFO("[H.264] bitrate=%d bps", self->encoder.context->bit_rate);
+ TSK_DEBUG_INFO("[H.264] bitrate=%d bps", self->encoder.context->bit_rate);
- return ret;
+ return ret;
#elif HAVE_H264_PASSTHROUGH
self->encoder.frame_count = 0;
- return 0;
+ return 0;
#endif
- TSK_DEBUG_ERROR("Not expected code called");
- return -1;
+ TSK_DEBUG_ERROR("Not expected code called");
+ return -1;
}
int tdav_codec_h264_close_encoder(tdav_codec_h264_t* self, tsk_bool_t reset_rotation)
{
#if HAVE_FFMPEG
- if(self->encoder.context){
- avcodec_close(self->encoder.context);
- av_free(self->encoder.context);
- self->encoder.context = tsk_null;
- }
- if(self->encoder.picture){
- av_free(self->encoder.picture);
- self->encoder.picture = tsk_null;
- }
+ if(self->encoder.context) {
+ avcodec_close(self->encoder.context);
+ av_free(self->encoder.context);
+ self->encoder.context = tsk_null;
+ }
+ if(self->encoder.picture) {
+ av_free(self->encoder.picture);
+ self->encoder.picture = tsk_null;
+ }
#endif
- if(self->encoder.buffer){
- TSK_FREE(self->encoder.buffer);
- }
- self->encoder.frame_count = 0;
+ if(self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
+ self->encoder.frame_count = 0;
if (reset_rotation) {
self->encoder.rotation = 0; // reset rotation
}
- return 0;
+ return 0;
}
int tdav_codec_h264_open_decoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
- int ret;
-
- if(self->decoder.context){
- TSK_DEBUG_ERROR("Decoder already opened");
- return -1;
- }
-
- self->decoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->decoder.context);
-
- self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->decoder.context->flags2 |= CODEC_FLAG2_FAST;
- self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
- self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
-
- // Picture (YUV 420)
- if(!(self->decoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create decoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->decoder.picture);
-
- // Open decoder
- if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
- return ret;
- }
+ int ret;
+
+ if(self->decoder.context) {
+ TSK_DEBUG_ERROR("Decoder already opened");
+ return -1;
+ }
+
+ self->decoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->decoder.context);
+
+ self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->decoder.context->flags2 |= CODEC_FLAG2_FAST;
+ self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
+ self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
+
+ // Picture (YUV 420)
+ if(!(self->decoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create decoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->decoder.picture);
+
+ // Open decoder
+ if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", TMEDIA_CODEC(self)->plugin->desc);
+ return ret;
+ }
self->decoder.last_seq = 0;
- return ret;
+ return ret;
#elif HAVE_H264_PASSTHROUGH
- return 0;
+ return 0;
#endif
- TSK_DEBUG_ERROR("Unexpected code called");
- return -1;
-
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -1;
+
}
int tdav_codec_h264_close_decoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
- if(self->decoder.context){
- avcodec_close(self->decoder.context);
- av_free(self->decoder.context);
- self->decoder.context = tsk_null;
- }
- if(self->decoder.picture){
- av_free(self->decoder.picture);
- self->decoder.picture = tsk_null;
- }
+ if(self->decoder.context) {
+ avcodec_close(self->decoder.context);
+ av_free(self->decoder.context);
+ self->decoder.context = tsk_null;
+ }
+ if(self->decoder.picture) {
+ av_free(self->decoder.picture);
+ self->decoder.picture = tsk_null;
+ }
#endif
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_pos = 0;
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_pos = 0;
- return 0;
+ return 0;
}
int tdav_codec_h264_init(tdav_codec_h264_t* self, profile_idc_t profile)
{
- int ret = 0;
- level_idc_t level;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = tdav_codec_h264_common_init(TDAV_CODEC_H264_COMMON(self)))){
- TSK_DEBUG_ERROR("tdav_codec_h264_common_init() faile with error code=%d", ret);
- return ret;
- }
-
- if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))){
- TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- return ret;
- }
-
- (self)->encoder.max_bw_kpbs = TMEDIA_CODEC(self)->bandwidth_max_upload;
- TDAV_CODEC_H264_COMMON(self)->pack_mode_local = H264_PACKETIZATION_MODE;
- TDAV_CODEC_H264_COMMON(self)->profile = profile;
- TDAV_CODEC_H264_COMMON(self)->level = level;
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
+ int ret = 0;
+ level_idc_t level;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = tdav_codec_h264_common_init(TDAV_CODEC_H264_COMMON(self)))) {
+ TSK_DEBUG_ERROR("tdav_codec_h264_common_init() faile with error code=%d", ret);
+ return ret;
+ }
+
+ if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
+ TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ return ret;
+ }
+
+ (self)->encoder.max_bw_kpbs = TMEDIA_CODEC(self)->bandwidth_max_upload;
+ TDAV_CODEC_H264_COMMON(self)->pack_mode_local = H264_PACKETIZATION_MODE;
+ TDAV_CODEC_H264_COMMON(self)->profile = profile;
+ TDAV_CODEC_H264_COMMON(self)->level = level;
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
#if HAVE_FFMPEG
- if(!(self->encoder.codec = avcodec_find_encoder(CODEC_ID_H264))){
- TSK_DEBUG_ERROR("Failed to find H.264 encoder");
- ret = -2;
- }
-
- if(!(self->decoder.codec = avcodec_find_decoder(CODEC_ID_H264))){
- TSK_DEBUG_ERROR("Failed to find H.264 decoder");
- ret = -3;
- }
+ if(!(self->encoder.codec = avcodec_find_encoder(CODEC_ID_H264))) {
+ TSK_DEBUG_ERROR("Failed to find H.264 encoder");
+ ret = -2;
+ }
+
+ if(!(self->decoder.codec = avcodec_find_decoder(CODEC_ID_H264))) {
+ TSK_DEBUG_ERROR("Failed to find H.264 decoder");
+ ret = -3;
+ }
#endif
#if HAVE_H264_PASSTHROUGH
- TMEDIA_CODEC(self)->passthrough = tsk_true;
- self->decoder.passthrough = tsk_true;
- self->encoder.passthrough = tsk_true;
+ TMEDIA_CODEC(self)->passthrough = tsk_true;
+ self->decoder.passthrough = tsk_true;
+ self->encoder.passthrough = tsk_true;
#endif
- self->encoder.quality = 1;
+ self->encoder.quality = 1;
- /* allocations MUST be done by open() */
- return ret;
+ /* allocations MUST be done by open() */
+ return ret;
}
int tdav_codec_h264_deinit(tdav_codec_h264_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if HAVE_FFMPEG
- self->encoder.codec = tsk_null;
- self->decoder.codec = tsk_null;
+ self->encoder.codec = tsk_null;
+ self->decoder.codec = tsk_null;
- // FFMpeg resources are destroyed by close()
+ // FFMpeg resources are destroyed by close()
#endif
- return 0;
+ return 0;
}
tsk_bool_t tdav_codec_ffmpeg_h264_is_supported()
{
#if HAVE_FFMPEG
- return (avcodec_find_encoder(CODEC_ID_H264) && avcodec_find_decoder(CODEC_ID_H264));
+ return (avcodec_find_encoder(CODEC_ID_H264) && avcodec_find_decoder(CODEC_ID_H264));
#else
- return tsk_false;
+ return tsk_false;
#endif
}
tsk_bool_t tdav_codec_passthrough_h264_is_supported()
{
#if HAVE_H264_PASSTHROUGH
- return tsk_true;
+ return tsk_true;
#else
- return tsk_false;
+ return tsk_false;
#endif
}
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx b/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
index a501221..4973089 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2014-2015 Mamadou DIOP.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,33 +46,32 @@ extern "C" {
#include <limits.h> /* INT_MAX */
-typedef struct tdav_codec_h264_cisco_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
-
- // Encoder
- struct{
- ISVCEncoder *pInst;
- SEncParamExt sEncParam;
- SSourcePicture sEncPic;
- void* buffer;
- int64_t frame_count;
- tsk_bool_t force_idr;
- int rotation;
- int neg_width;
- int neg_height;
- int neg_fps;
+typedef struct tdav_codec_h264_cisco_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
+
+ // Encoder
+ struct {
+ ISVCEncoder *pInst;
+ SEncParamExt sEncParam;
+ SSourcePicture sEncPic;
+ void* buffer;
+ int64_t frame_count;
+ tsk_bool_t force_idr;
+ int rotation;
+ int neg_width;
+ int neg_height;
+ int neg_fps;
tsk_mutex_handle_t* mutex;
- } encoder;
-
- // decoder
- struct{
- ISVCDecoder* pInst;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- uint16_t last_seq;
- } decoder;
+ } encoder;
+
+ // decoder
+ struct {
+ ISVCDecoder* pInst;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h264_cisco_t;
@@ -98,448 +97,452 @@ static void (*__tdav_codec_h264_cisco_debug_cb)(void* context, int level, const
static int tdav_codec_h264_cisco_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
- tsk_bool_t reconf = tsk_false;
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "action")) {
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch (action) {
- case tmedia_codec_action_encode_idr:
- {
- TSK_DEBUG_INFO("OpenH264 force_idr action");
- h264->encoder.force_idr = tsk_true;
- return 0;
- }
- case tmedia_codec_action_bw_up:
- case tmedia_codec_action_bw_down:
- {
- int32_t rc_target_bitrate;
- int32_t bandwidth_max_upload_bps = TMEDIA_CODEC(h264)->bandwidth_max_upload == INT_MAX ? TMEDIA_CODEC(h264)->bandwidth_max_upload : (TMEDIA_CODEC(h264)->bandwidth_max_upload * 1024); // kbps -> bps
- if (action == tmedia_codec_action_bw_up) {
- rc_target_bitrate = TSK_CLAMP(0, (int32_t)((h264->encoder.sEncParam.iTargetBitrate * 3) >> 1), bandwidth_max_upload_bps);
- }
- else {
- rc_target_bitrate = TSK_CLAMP(0, (int32_t)((h264->encoder.sEncParam.iTargetBitrate << 1) / 3), bandwidth_max_upload_bps);
- }
- h264->encoder.sEncParam.iTargetBitrate = rc_target_bitrate;
- h264->encoder.sEncParam.iMaxBitrate = rc_target_bitrate;
- SSpatialLayerConfig* layer = &h264->encoder.sEncParam.sSpatialLayers[0];
- layer->iMaxSpatialBitrate = h264->encoder.sEncParam.iMaxBitrate;
- layer->iSpatialBitrate = h264->encoder.sEncParam.iTargetBitrate;
- reconf = tsk_true;
- TSK_DEBUG_INFO("OpenH264 new target bitrate = %d bps", rc_target_bitrate);
- break;
- }
- }
- }
- else if (tsk_striequals(param->key, "bw_kbps")) { // both up and down (from the SDP)
- int32_t max_bw_userdefine_kbps = tmedia_defaults_get_bandwidth_video_upload_max();
- int32_t max_bw_new_kbps = *((int32_t*)param->value);
- if (max_bw_userdefine_kbps > 0) {
- // do not use more than what the user defined in it's configuration
- TMEDIA_CODEC(h264)->bandwidth_max_upload = TSK_MIN(max_bw_new_kbps, max_bw_userdefine_kbps);
- }
- else {
- TMEDIA_CODEC(h264)->bandwidth_max_upload = max_bw_new_kbps;
- }
- TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload= %d kbps", TMEDIA_CODEC(h264)->bandwidth_max_upload);
- reconf = tsk_true;
- }
- else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
- int32_t bw_max_upload_kbps = *((int32_t*)param->value);
- TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload= %d kbps", bw_max_upload_kbps);
- TMEDIA_CODEC(h264)->bandwidth_max_upload = bw_max_upload_kbps;
- reconf = tsk_true;
- }
- else if (tsk_striequals(param->key, "rotation")) {
- int rotation = *((int32_t*)param->value);
- if (h264->encoder.rotation != rotation) {
+ tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
+ tsk_bool_t reconf = tsk_false;
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch (action) {
+ case tmedia_codec_action_encode_idr: {
+ TSK_DEBUG_INFO("OpenH264 force_idr action");
+ h264->encoder.force_idr = tsk_true;
+ return 0;
+ }
+ case tmedia_codec_action_bw_up:
+ case tmedia_codec_action_bw_down: {
+ int32_t rc_target_bitrate;
+ int32_t bandwidth_max_upload_bps = TMEDIA_CODEC(h264)->bandwidth_max_upload == INT_MAX ? TMEDIA_CODEC(h264)->bandwidth_max_upload : (TMEDIA_CODEC(h264)->bandwidth_max_upload * 1024); // kbps -> bps
+ if (action == tmedia_codec_action_bw_up) {
+ rc_target_bitrate = TSK_CLAMP(0, (int32_t)((h264->encoder.sEncParam.iTargetBitrate * 3) >> 1), bandwidth_max_upload_bps);
+ }
+ else {
+ rc_target_bitrate = TSK_CLAMP(0, (int32_t)((h264->encoder.sEncParam.iTargetBitrate << 1) / 3), bandwidth_max_upload_bps);
+ }
+ h264->encoder.sEncParam.iTargetBitrate = rc_target_bitrate;
+ h264->encoder.sEncParam.iMaxBitrate = rc_target_bitrate;
+ SSpatialLayerConfig* layer = &h264->encoder.sEncParam.sSpatialLayers[0];
+ layer->iMaxSpatialBitrate = h264->encoder.sEncParam.iMaxBitrate;
+ layer->iSpatialBitrate = h264->encoder.sEncParam.iTargetBitrate;
+ reconf = tsk_true;
+ TSK_DEBUG_INFO("OpenH264 new target bitrate = %d bps", rc_target_bitrate);
+ break;
+ }
+ }
+ }
+ else if (tsk_striequals(param->key, "bw_kbps")) { // both up and down (from the SDP)
+ int32_t max_bw_userdefine_kbps = tmedia_defaults_get_bandwidth_video_upload_max();
+ int32_t max_bw_new_kbps = *((int32_t*)param->value), max_bitrate_bps;
+ if (max_bw_userdefine_kbps > 0) {
+ // do not use more than what the user defined in it's configuration
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = TSK_MIN(max_bw_new_kbps, max_bw_userdefine_kbps);
+ }
+ else {
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = max_bw_new_kbps;
+ }
+ max_bitrate_bps = TMEDIA_CODEC(h264)->bandwidth_max_upload << 10; // convert from kbps to bps
+ TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload= %dbps, %dkbps", max_bitrate_bps, TMEDIA_CODEC(h264)->bandwidth_max_upload);
+ h264->encoder.sEncParam.iTargetBitrate = max_bitrate_bps;
+ h264->encoder.sEncParam.iMaxBitrate = max_bitrate_bps;
+ SSpatialLayerConfig* layer = &h264->encoder.sEncParam.sSpatialLayers[0];
+ layer->iMaxSpatialBitrate = h264->encoder.sEncParam.iMaxBitrate;
+ layer->iSpatialBitrate = h264->encoder.sEncParam.iTargetBitrate;
+ reconf = tsk_true;
+ }
+ else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
+ int32_t bw_max_upload_kbps = *((int32_t*)param->value);
+ TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload= %d kbps", bw_max_upload_kbps);
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = bw_max_upload_kbps;
+ reconf = tsk_true;
+ }
+ else if (tsk_striequals(param->key, "rotation")) {
+ int rotation = *((int32_t*)param->value);
+ if (h264->encoder.rotation != rotation) {
h264->encoder.rotation = rotation;
- if (self->opened) {
- int ret;
- if ((ret = tdav_codec_h264_cisco_close_encoder(h264, kResetRotationFalse))) {
- return ret;
- }
- if ((ret = tdav_codec_h264_cisco_open_encoder(h264))) {
- return ret;
- }
- }
- }
- return 0;
- }
- }
-
- if (reconf) {
- if (h264->encoder.pInst) {
+ if (self->opened) {
+ int ret;
+ if ((ret = tdav_codec_h264_cisco_close_encoder(h264, kResetRotationFalse))) {
+ return ret;
+ }
+ if ((ret = tdav_codec_h264_cisco_open_encoder(h264))) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+
+ if (reconf) {
+ if (h264->encoder.pInst) {
long err;
// lock required because of https://code.google.com/p/doubango/issues/detail?id=422
tsk_mutex_lock(h264->encoder.mutex);
- err = h264->encoder.pInst->InitializeExt(&h264->encoder.sEncParam);
+ err = h264->encoder.pInst->InitializeExt(&h264->encoder.sEncParam);
tsk_mutex_unlock(h264->encoder.mutex);
- if (err != cmResultSuccess) {
- TSK_DEBUG_ERROR("InitializeExt failed: %ld", err);
- return -1;
- }
- }
- return 0;
- }
-
- return -1;
+ if (err != cmResultSuccess) {
+ TSK_DEBUG_ERROR("InitializeExt failed: %ld", err);
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ return -1;
}
static int tdav_codec_h264_cisco_open(tmedia_codec_t* self)
{
- int ret;
- tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
-
- if (!h264) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
- // Encoder
- if ((ret = tdav_codec_h264_cisco_open_encoder(h264))) {
- return ret;
- }
-
- // Decoder
- if ((ret = tdav_codec_h264_cisco_open_decoder(h264))) {
- return ret;
- }
-
- return 0;
+ int ret;
+ tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
+
+ if (!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+ // Encoder
+ if ((ret = tdav_codec_h264_cisco_open_encoder(h264))) {
+ return ret;
+ }
+
+ // Decoder
+ if ((ret = tdav_codec_h264_cisco_open_decoder(h264))) {
+ return ret;
+ }
+
+ return 0;
}
static int tdav_codec_h264_cisco_close(tmedia_codec_t* self)
{
- tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
+ tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
- if (!h264) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) already checked that the codec is opened */
+ /* the caller (base class) already checked that the codec is opened */
- // Encoder
- tdav_codec_h264_cisco_close_encoder(h264, kResetRotationTrue);
+ // Encoder
+ tdav_codec_h264_cisco_close_encoder(h264, kResetRotationTrue);
- // Decoder
- tdav_codec_h264_cisco_close_decoder(h264);
+ // Decoder
+ tdav_codec_h264_cisco_close_decoder(h264);
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_cisco_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- long err;
- tsk_bool_t send_idr, send_hdr;
- tsk_size_t in_xsize;
- SFrameBSInfo bsInfo;
-
- tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if (!self || !in_data || !in_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if (!self->opened || !h264->encoder.pInst) {
- TSK_DEBUG_ERROR("Encoder not opened or not ready");
- return 0;
- }
-
- in_xsize = (h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth * 3) >> 1;
- if (in_xsize != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size: %u<>%u", in_xsize, in_size);
- return 0;
- }
-
- // send IDR for:
- // - the first frame
- // - remote peer requested an IDR
- // - every second within the first 4seconds
- send_idr = (
- h264->encoder.frame_count++ == 0
- || h264 ->encoder.force_idr
- //|| ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
- );
-
- // send SPS and PPS headers for:
- // - IDR frames (not required but it's the easiest way to deal with pkt loss)
- // - every 5 seconds after the first 4seconds
- send_hdr = (
- send_idr
- //|| ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
- );
-
- if (send_idr) {
- TSK_DEBUG_INFO("OpenH264 call ForceIntraFrame");
- if ((err = h264->encoder.pInst->ForceIntraFrame(true)) != cmResultSuccess) {
- TSK_DEBUG_WARN("OpenH264 ForceIntraFrame(%d) failed: %ld", send_idr, err);
- }
- }
- if (send_hdr) {
+ long err;
+ tsk_bool_t send_idr, send_hdr;
+ tsk_size_t in_xsize;
+ SFrameBSInfo bsInfo;
+
+ tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if (!self || !in_data || !in_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if (!self->opened || !h264->encoder.pInst) {
+ TSK_DEBUG_ERROR("Encoder not opened or not ready");
+ return 0;
+ }
+
+ in_xsize = (h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth * 3) >> 1;
+ if (in_xsize != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size: %u<>%u", in_xsize, in_size);
+ return 0;
+ }
+
+ // send IDR for:
+ // - the first frame
+ // - remote peer requested an IDR
+ // - every second within the first 4seconds
+ send_idr = (
+ h264->encoder.frame_count++ == 0
+ || h264 ->encoder.force_idr
+ //|| ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
+ );
+
+ // send SPS and PPS headers for:
+ // - IDR frames (not required but it's the easiest way to deal with pkt loss)
+ // - every 5 seconds after the first 4seconds
+ send_hdr = (
+ send_idr
+ //|| ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
+ );
+
+ if (send_idr) {
+ TSK_DEBUG_INFO("OpenH264 call ForceIntraFrame");
+ if ((err = h264->encoder.pInst->ForceIntraFrame(true)) != cmResultSuccess) {
+ TSK_DEBUG_WARN("OpenH264 ForceIntraFrame(%d) failed: %ld", send_idr, err);
+ }
+ }
+ if (send_hdr) {
#if 0 // Not needed
- memset(&bsInfo, 0, sizeof(bsInfo));
- tsk_mutex_lock(h264->encoder.mutex);
- if ((err = h264->encoder.pInst->EncodeParameterSets(&bsInfo)) != cmResultSuccess) {
- TSK_DEBUG_WARN("OpenH264 EncodeParameterSets(%d) failed: %ld", send_idr, err);
- }
- else {
- for (int iLayerNum = 0; iLayerNum < bsInfo.iLayerNum; ++iLayerNum) {
- unsigned char* pBsBuf = bsInfo.sLayerInfo[iLayerNum].pBsBuf;
- int iNalLengthInByte = 0, _iNalLengthInByte;
- for (int iNalCount = 0; iNalCount < bsInfo.sLayerInfo[iLayerNum].iNalCount; ++iNalCount) {
- if ((_iNalLengthInByte = bsInfo.sLayerInfo[iLayerNum].pNalLengthInByte[iNalCount]) > 0) {
- iNalLengthInByte += _iNalLengthInByte;
- }
- }
- if (iNalLengthInByte > 0) {
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), pBsBuf, (tsk_size_t)iNalLengthInByte);
- }
- }
- }
- tsk_mutex_unlock(h264->encoder.mutex);
+ memset(&bsInfo, 0, sizeof(bsInfo));
+ tsk_mutex_lock(h264->encoder.mutex);
+ if ((err = h264->encoder.pInst->EncodeParameterSets(&bsInfo)) != cmResultSuccess) {
+ TSK_DEBUG_WARN("OpenH264 EncodeParameterSets(%d) failed: %ld", send_idr, err);
+ }
+ else {
+ for (int iLayerNum = 0; iLayerNum < bsInfo.iLayerNum; ++iLayerNum) {
+ unsigned char* pBsBuf = bsInfo.sLayerInfo[iLayerNum].pBsBuf;
+ int iNalLengthInByte = 0, _iNalLengthInByte;
+ for (int iNalCount = 0; iNalCount < bsInfo.sLayerInfo[iLayerNum].iNalCount; ++iNalCount) {
+ if ((_iNalLengthInByte = bsInfo.sLayerInfo[iLayerNum].pNalLengthInByte[iNalCount]) > 0) {
+ iNalLengthInByte += _iNalLengthInByte;
+ }
+ }
+ if (iNalLengthInByte > 0) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), pBsBuf, (tsk_size_t)iNalLengthInByte);
+ }
+ }
+ }
+ tsk_mutex_unlock(h264->encoder.mutex);
#endif
- }
+ }
- h264->encoder.sEncPic.pData[0] = ((unsigned char*)in_data);
- h264->encoder.sEncPic.pData[1] = h264->encoder.sEncPic.pData[0] + (h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth);
- h264->encoder.sEncPic.pData[2] = h264->encoder.sEncPic.pData[1] + ((h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth) >> 2);
- // h264->encoder.sEncPic.uiTimeStamp = rand();
+ h264->encoder.sEncPic.pData[0] = ((unsigned char*)in_data);
+ h264->encoder.sEncPic.pData[1] = h264->encoder.sEncPic.pData[0] + (h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth);
+ h264->encoder.sEncPic.pData[2] = h264->encoder.sEncPic.pData[1] + ((h264->encoder.sEncPic.iPicHeight * h264->encoder.sEncPic.iPicWidth) >> 2);
+ // h264->encoder.sEncPic.uiTimeStamp = rand();
+
+ memset(&bsInfo, 0, sizeof(bsInfo));
- memset(&bsInfo, 0, sizeof(bsInfo));
-
tsk_mutex_lock(h264->encoder.mutex);
- if ((err = h264->encoder.pInst->EncodeFrame(&h264->encoder.sEncPic, &bsInfo)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("OpenH264 setting EncodeFrame() failed: %ld", err);
+ if ((err = h264->encoder.pInst->EncodeFrame(&h264->encoder.sEncPic, &bsInfo)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("OpenH264 setting EncodeFrame() failed: %ld", err);
tsk_mutex_unlock(h264->encoder.mutex);
- return 0;
- }
-
+ return 0;
+ }
+
// Memory held by bsInfo is freed when "InitializeExt()" is called this is why the unlock is after reading the output stream
- if (bsInfo.eFrameType != videoFrameTypeInvalid) {
- for (int iLayerNum = 0; iLayerNum < bsInfo.iLayerNum; ++iLayerNum) {
- unsigned char* pBsBuf = bsInfo.sLayerInfo[iLayerNum].pBsBuf;
- int iNalLengthInByte = 0, _iNalLengthInByte;
- for (int iNalCount = 0; iNalCount < bsInfo.sLayerInfo[iLayerNum].iNalCount; ++iNalCount) {
- if ((_iNalLengthInByte = bsInfo.sLayerInfo[iLayerNum].pNalLengthInByte[iNalCount]) > 0) {
- iNalLengthInByte += _iNalLengthInByte;
- }
- }
- if (iNalLengthInByte > 0) {
- tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), pBsBuf, (tsk_size_t)iNalLengthInByte);
- }
- }
- }
+ if (bsInfo.eFrameType != videoFrameTypeInvalid) {
+ for (int iLayerNum = 0; iLayerNum < bsInfo.iLayerNum; ++iLayerNum) {
+ unsigned char* pBsBuf = bsInfo.sLayerInfo[iLayerNum].pBsBuf;
+ int iNalLengthInByte = 0, _iNalLengthInByte;
+ for (int iNalCount = 0; iNalCount < bsInfo.sLayerInfo[iLayerNum].iNalCount; ++iNalCount) {
+ if ((_iNalLengthInByte = bsInfo.sLayerInfo[iLayerNum].pNalLengthInByte[iNalCount]) > 0) {
+ iNalLengthInByte += _iNalLengthInByte;
+ }
+ }
+ if (iNalLengthInByte > 0) {
+ tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), pBsBuf, (tsk_size_t)iNalLengthInByte);
+ }
+ }
+ }
tsk_mutex_unlock(h264->encoder.mutex);
-
- h264 ->encoder.force_idr = tsk_false; // reset
-
- return 0;
+
+ h264 ->encoder.force_idr = tsk_false; // reset
+
+ return 0;
}
static tsk_size_t tdav_codec_h264_cisco_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
-
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0;
- int ret;
- long err = cmResultSuccess;
- tsk_bool_t append_scp, end_of_unit, got_picture_ptr = tsk_false;
- tsk_bool_t sps_or_pps;
- tsk_size_t retsize = 0, size_to_copy = 0;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
-
- if (!h264 || !in_data || !in_size || !out_data) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if (!self->opened || !h264->encoder.pInst) {
- TSK_DEBUG_ERROR("Decoder not opened or not ready");
- return 0;
- }
-
- /* Packet lost? */
- if ((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
- TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
- }
- h264->decoder.last_seq = rtp_hdr->seq_num;
-
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ tdav_codec_h264_cisco_t* h264 = (tdav_codec_h264_cisco_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0;
+ int ret;
+ long err = cmResultSuccess;
+ tsk_bool_t append_scp, end_of_unit, got_picture_ptr = tsk_false;
+ tsk_bool_t sps_or_pps;
+ tsk_size_t retsize = 0, size_to_copy = 0;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+
+ if (!h264 || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if (!self->opened || !h264->encoder.pInst) {
+ TSK_DEBUG_ERROR("Decoder not opened or not ready");
+ return 0;
+ }
+
+ /* Packet lost? */
+ if ((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
+ TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
+ }
+ h264->decoder.last_seq = rtp_hdr->seq_num;
+
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- if (*((uint8_t*)in_data) & 0x80) {
- TSK_DEBUG_WARN("F=1");
- /* reset accumulator */
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
-
- /* get payload */
- if ((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size) {
- TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
- return 0;
- }
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
- // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
- sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
-
- // start-accumulator
- if (!h264->decoder.accumulator) {
- if (size_to_copy > xmax_size) {
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- return 0;
- }
- if (!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- return 0;
- }
- h264->decoder.accumulator_size = size_to_copy;
- }
- if ((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
- TSK_DEBUG_ERROR("BufferOverflow");
- h264->decoder.accumulator_pos = 0;
- return 0;
- }
- if ((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
- if (!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
- return 0;
- }
- h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
- }
-
- if (append_scp) {
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
- h264->decoder.accumulator_pos += start_code_prefix_size;
- }
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
- h264->decoder.accumulator_pos += pay_size;
- // end-accumulator
-
- if (/*rtp_hdr->marker*/end_of_unit) {
- /* decode the picture */
- unsigned char* out_ptr[3] = { NULL };
- int out_stride[2] = {0}, out_width = 0, out_height = 0;
- tsk_size_t out_xsize;
-
- // Decode a Unit
- err = h264->decoder.pInst->DecodeFrame(
- (const unsigned char*)h264->decoder.accumulator, h264->decoder.accumulator_pos,
- out_ptr, out_stride, out_width, out_height);
-
- if (err != cmResultSuccess) {
- if (0 && err == dsDataErrorConcealed) {
- TSK_DEBUG_INFO("OpenH264: Data error concealed");
- err = cmResultSuccess;
- }
- else {
- TSK_DEBUG_WARN("OpenH264: DecodeFrame failed: %ld", err);
- goto bail;
- }
- }
- // Do we have a complete frame?
- if (!(got_picture_ptr = ((out_ptr[0] && out_ptr[1] && out_ptr[2]) && (out_stride[0] && out_stride[1]) && out_width && out_height))) {
- goto bail;
- }
- out_xsize = (out_width * out_height * 3) >> 1; // I420
- /* IDR ? */
- if (((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback) {
- TSK_DEBUG_INFO("Decoded H.264 IDR");
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- /* fill out */
- if (*out_max_size < out_xsize) {
- if ((*out_data = tsk_realloc(*out_data, out_xsize))){
- *out_max_size = out_xsize;
- }
- else {
- *out_max_size = 0;
- return 0;
- }
- }
- TMEDIA_CODEC_VIDEO(h264)->in.width = out_width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = out_height;
- /* layout picture */
- {
- int plane, y, stride;
- retsize = 0;
- for (plane=0; plane < 3; plane++) {
- unsigned char *buf = out_ptr[plane];
- stride = out_stride[plane ? 1 : 0];
- for (y=0; y<out_height >> (plane ? 1 : 0); y++) {
- unsigned int w_count = out_width >> (plane ? 1 : 0);
- if ((ret + w_count) > *out_max_size) {
- TSK_DEBUG_ERROR("BufferOverflow");
- ret = 0;
- goto bail;
- }
- memcpy(((uint8_t*)*out_data) + retsize, buf, w_count);
- retsize += w_count;
- buf += stride;
- }
- }
- }
- } // else if(rtp_hdr->marker)
+ */
+ if (*((uint8_t*)in_data) & 0x80) {
+ TSK_DEBUG_WARN("F=1");
+ /* reset accumulator */
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ /* get payload */
+ if ((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit)) || !pay_ptr || !pay_size) {
+ TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
+ return 0;
+ }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+ // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
+ sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
+
+ // start-accumulator
+ if (!h264->decoder.accumulator) {
+ if (size_to_copy > xmax_size) {
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ return 0;
+ }
+ if (!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ return 0;
+ }
+ h264->decoder.accumulator_size = size_to_copy;
+ }
+ if ((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ h264->decoder.accumulator_pos = 0;
+ return 0;
+ }
+ if ((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
+ if (!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+ return 0;
+ }
+ h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
+ }
+
+ if (append_scp) {
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ h264->decoder.accumulator_pos += start_code_prefix_size;
+ }
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
+ h264->decoder.accumulator_pos += pay_size;
+ // end-accumulator
+
+ if (/*rtp_hdr->marker*/end_of_unit) {
+ /* decode the picture */
+ unsigned char* out_ptr[3] = { NULL };
+ int out_stride[2] = {0}, out_width = 0, out_height = 0;
+ tsk_size_t out_xsize;
+
+ // Decode a Unit
+ err = h264->decoder.pInst->DecodeFrame(
+ (const unsigned char*)h264->decoder.accumulator, h264->decoder.accumulator_pos,
+ out_ptr, out_stride, out_width, out_height);
+
+ if (err != cmResultSuccess) {
+ if (0 && err == dsDataErrorConcealed) {
+ TSK_DEBUG_INFO("OpenH264: Data error concealed");
+ err = cmResultSuccess;
+ }
+ else {
+ TSK_DEBUG_WARN("OpenH264: DecodeFrame failed: %ld", err);
+ goto bail;
+ }
+ }
+ // Do we have a complete frame?
+ if (!(got_picture_ptr = ((out_ptr[0] && out_ptr[1] && out_ptr[2]) && (out_stride[0] && out_stride[1]) && out_width && out_height))) {
+ goto bail;
+ }
+ out_xsize = (out_width * out_height * 3) >> 1; // I420
+ /* IDR ? */
+ if (((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TSK_DEBUG_INFO("Decoded H.264 IDR");
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ /* fill out */
+ if (*out_max_size < out_xsize) {
+ if ((*out_data = tsk_realloc(*out_data, out_xsize))) {
+ *out_max_size = out_xsize;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ TMEDIA_CODEC_VIDEO(h264)->in.width = out_width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = out_height;
+ /* layout picture */
+ {
+ int plane, y, stride;
+ retsize = 0;
+ for (plane=0; plane < 3; plane++) {
+ unsigned char *buf = out_ptr[plane];
+ stride = out_stride[plane ? 1 : 0];
+ for (y=0; y<out_height >> (plane ? 1 : 0); y++) {
+ unsigned int w_count = out_width >> (plane ? 1 : 0);
+ if ((ret + w_count) > *out_max_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ ret = 0;
+ goto bail;
+ }
+ memcpy(((uint8_t*)*out_data) + retsize, buf, w_count);
+ retsize += w_count;
+ buf += stride;
+ }
+ }
+ }
+ } // else if(rtp_hdr->marker)
bail:
- /* end of frame */
- if (got_picture_ptr) {
- int32_t endOfStream = 1;
- err = h264->decoder.pInst->SetOption(DECODER_OPTION_END_OF_STREAM, (void*)&endOfStream);
- if (err != cmResultSuccess) {
- TSK_DEBUG_WARN("OpenH264 setting DECODER_OPTION_END_OF_STREAM failed: %ld", err);
- goto bail;
- }
- }
- if (/*rtp_hdr->marker*/end_of_unit) {
- /* reset accumulator */
- h264->decoder.accumulator_pos = 0;
- }
- if (err != cmResultSuccess){
- TSK_DEBUG_INFO("Failed to decode the buffer with error code =%ld, size=%u, append=%s", err, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
- if (TMEDIA_CODEC_VIDEO(self)->in.callback) {
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- return retsize;
+ /* end of frame */
+ if (got_picture_ptr) {
+ int32_t endOfStream = 1;
+ err = h264->decoder.pInst->SetOption(DECODER_OPTION_END_OF_STREAM, (void*)&endOfStream);
+ if (err != cmResultSuccess) {
+ TSK_DEBUG_WARN("OpenH264 setting DECODER_OPTION_END_OF_STREAM failed: %ld", err);
+ goto bail;
+ }
+ }
+ if (/*rtp_hdr->marker*/end_of_unit) {
+ /* reset accumulator */
+ h264->decoder.accumulator_pos = 0;
+ }
+ if (err != cmResultSuccess) {
+ TSK_DEBUG_INFO("Failed to decode the buffer with error code =%ld, size=%u, append=%s", err, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
+ if (TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ return retsize;
}
static tsk_bool_t tdav_codec_h264_cisco_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
+ return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
}
static char* tdav_codec_h264_cisco_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
- if (att && tsk_striequals(att_name, "fmtp")) {
- tsk_strcat(&att, "; impl=openh264");
- }
- return att;
+ char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
+ if (att && tsk_striequals(att_name, "fmtp")) {
+ tsk_strcat(&att, "; impl=openh264");
+ }
+ return att;
}
/* ============ H.264 Base Profile Plugin interface ================= */
@@ -547,63 +550,61 @@ static char* tdav_codec_h264_cisco_sdp_att_get(const tmedia_codec_t* self, const
/* constructor */
static tsk_object_t* tdav_codec_h264_cisco_base_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_cisco_t *h264 = (tdav_codec_h264_cisco_t*)self;
- if (h264) {
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if (tdav_codec_h264_cisco_init(h264, profile_idc_baseline) != 0) {
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_h264_cisco_t *h264 = (tdav_codec_h264_cisco_t*)self;
+ if (h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if (tdav_codec_h264_cisco_init(h264, profile_idc_baseline) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_cisco_base_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_cisco_t *h264 = (tdav_codec_h264_cisco_t*)self;
- if (h264) {
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_cisco_deinit(h264);
- }
-
- return self;
+{
+ tdav_codec_h264_cisco_t *h264 = (tdav_codec_h264_cisco_t*)self;
+ if (h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_cisco_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_cisco_base_def_s =
-{
- sizeof(tdav_codec_h264_cisco_t),
- tdav_codec_h264_cisco_base_ctor,
- tdav_codec_h264_cisco_base_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_cisco_base_def_s = {
+ sizeof(tdav_codec_h264_cisco_t),
+ tdav_codec_h264_cisco_base_ctor,
+ tdav_codec_h264_cisco_base_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_cisco_base_plugin_def_s =
-{
- &tdav_codec_h264_cisco_base_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "H264 Base Profile (OpenH264)",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0}, // fps is @deprecated
-
- tdav_codec_h264_cisco_set,
- tdav_codec_h264_cisco_open,
- tdav_codec_h264_cisco_close,
- tdav_codec_h264_cisco_encode,
- tdav_codec_h264_cisco_decode,
- tdav_codec_h264_cisco_sdp_att_match,
- tdav_codec_h264_cisco_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h264_cisco_base_plugin_def_s = {
+ &tdav_codec_h264_cisco_base_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "H264 Base Profile (OpenH264)",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0}, // fps is @deprecated
+
+ tdav_codec_h264_cisco_set,
+ tdav_codec_h264_cisco_open,
+ tdav_codec_h264_cisco_close,
+ tdav_codec_h264_cisco_encode,
+ tdav_codec_h264_cisco_decode,
+ tdav_codec_h264_cisco_sdp_att_match,
+ tdav_codec_h264_cisco_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h264_cisco_base_plugin_def_t = &tdav_codec_h264_cisco_base_plugin_def_s;
@@ -611,117 +612,117 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_cisco_base_plugin_def_t = &tdav
static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
{
- int ret = -1, max_bitrate_bps;
- long err;
- SSpatialLayerConfig* layer;
-
- int32_t max_bw_kpbs;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if (self->encoder.pInst) {
- TSK_DEBUG_ERROR("Encoder already initialized");
- goto bail;
- }
-
- // create encoder
- if ((err = WelsCreateSVCEncoder(&self->encoder.pInst)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("Failed to create ancoder: %ld", err);
- goto bail;
- }
-
- self->encoder.pInst->SetOption(ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, self);
- self->encoder.pInst->SetOption(ENCODER_OPTION_TRACE_CALLBACK, &__tdav_codec_h264_cisco_debug_cb);
-
- if ((err = self->encoder.pInst->GetDefaultParams(&self->encoder.sEncParam)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("GetDefaultParams failed: %ld", err);
- goto bail;
- }
-
- self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
- TMEDIA_CODEC(self)->bandwidth_max_upload
- );
- max_bitrate_bps = (max_bw_kpbs * 1024);
-
- TSK_DEBUG_INFO("[H.264 OpenH264 Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
- self->encoder.neg_width,
- self->encoder.neg_height,
- self->encoder.neg_fps,
- max_bitrate_bps
- );
-
- self->encoder.sEncParam.iInputCsp = videoFormatI420;
- self->encoder.sEncParam.iSpatialLayerNum = 1;
- self->encoder.sEncParam.iTemporalLayerNum = 1;
- self->encoder.sEncParam.uiIntraPeriod = (self->encoder.neg_fps * CISCO_H264_GOP_SIZE_IN_SECONDS);
- self->encoder.sEncParam.iUsageType = CAMERA_VIDEO_REAL_TIME; // TODO: use "SCREEN_CONTENT_REAL_TIME" screencast
- self->encoder.sEncParam.iPicWidth = self->encoder.neg_width;
- self->encoder.sEncParam.iPicHeight = self->encoder.neg_height;
- self->encoder.sEncParam.iTargetBitrate = max_bitrate_bps;
- self->encoder.sEncParam.iMaxBitrate = max_bitrate_bps;
- self->encoder.sEncParam.fMaxFrameRate = (float)self->encoder.neg_fps;
- self->encoder.sEncParam.uiMaxNalSize = H264_RTP_PAYLOAD_SIZE;
- self->encoder.sEncParam.bEnableSpsPpsIdAddition = true;
- self->encoder.sEncParam.bEnableFrameCroppingFlag = true;
-
- layer = &self->encoder.sEncParam.sSpatialLayers[0];
- layer->uiProfileIdc = PRO_BASELINE;
+ int ret = -1, max_bitrate_bps;
+ long err;
+ SSpatialLayerConfig* layer;
+
+ int32_t max_bw_kpbs;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if (self->encoder.pInst) {
+ TSK_DEBUG_ERROR("Encoder already initialized");
+ goto bail;
+ }
+
+ // create encoder
+ if ((err = WelsCreateSVCEncoder(&self->encoder.pInst)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("Failed to create ancoder: %ld", err);
+ goto bail;
+ }
+
+ self->encoder.pInst->SetOption(ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, self);
+ self->encoder.pInst->SetOption(ENCODER_OPTION_TRACE_CALLBACK, &__tdav_codec_h264_cisco_debug_cb);
+
+ if ((err = self->encoder.pInst->GetDefaultParams(&self->encoder.sEncParam)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("GetDefaultParams failed: %ld", err);
+ goto bail;
+ }
+
+ self->encoder.neg_width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.neg_height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
+ TMEDIA_CODEC(self)->bandwidth_max_upload
+ );
+ max_bitrate_bps = (max_bw_kpbs * 1024);
+
+ TSK_DEBUG_INFO("[H.264 OpenH264 Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
+ self->encoder.neg_width,
+ self->encoder.neg_height,
+ self->encoder.neg_fps,
+ max_bitrate_bps
+ );
+
+ self->encoder.sEncParam.iInputCsp = videoFormatI420;
+ self->encoder.sEncParam.iSpatialLayerNum = 1;
+ self->encoder.sEncParam.iTemporalLayerNum = 1;
+ self->encoder.sEncParam.uiIntraPeriod = (self->encoder.neg_fps * CISCO_H264_GOP_SIZE_IN_SECONDS);
+ self->encoder.sEncParam.iUsageType = CAMERA_VIDEO_REAL_TIME; // TODO: use "SCREEN_CONTENT_REAL_TIME" screencast
+ self->encoder.sEncParam.iPicWidth = self->encoder.neg_width;
+ self->encoder.sEncParam.iPicHeight = self->encoder.neg_height;
+ self->encoder.sEncParam.iTargetBitrate = max_bitrate_bps;
+ self->encoder.sEncParam.iMaxBitrate = max_bitrate_bps;
+ self->encoder.sEncParam.fMaxFrameRate = (float)self->encoder.neg_fps;
+ self->encoder.sEncParam.uiMaxNalSize = H264_RTP_PAYLOAD_SIZE;
+ self->encoder.sEncParam.bEnableSpsPpsIdAddition = true;
+ self->encoder.sEncParam.bEnableFrameCroppingFlag = true;
+
+ layer = &self->encoder.sEncParam.sSpatialLayers[0];
+ layer->uiProfileIdc = PRO_BASELINE;
#if BUILD_TYPE_TCH
- layer->uiLevelIdc = tdav_codec_h264_cisco_convert_level(common->level);
+ layer->uiLevelIdc = tdav_codec_h264_cisco_convert_level(common->level);
#else
- layer->uiLevelIdc = LEVEL_UNKNOWN; // auto-detect
+ layer->uiLevelIdc = LEVEL_UNKNOWN; // auto-detect
#endif
- layer->fFrameRate = self->encoder.sEncParam.fMaxFrameRate;
- layer->iMaxSpatialBitrate = self->encoder.sEncParam.iMaxBitrate;
- layer->iSpatialBitrate = self->encoder.sEncParam.iTargetBitrate;
- layer->iVideoWidth = self->encoder.sEncParam.iPicWidth;
- layer->iVideoHeight = self->encoder.sEncParam.iPicHeight;
- layer->sSliceCfg.uiSliceMode = SM_DYN_SLICE;
- layer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = H264_RTP_PAYLOAD_SIZE;
- layer->sSliceCfg.sSliceArgument.uiSliceNum = 1;
+ layer->fFrameRate = self->encoder.sEncParam.fMaxFrameRate;
+ layer->iMaxSpatialBitrate = self->encoder.sEncParam.iMaxBitrate;
+ layer->iSpatialBitrate = self->encoder.sEncParam.iTargetBitrate;
+ layer->iVideoWidth = self->encoder.sEncParam.iPicWidth;
+ layer->iVideoHeight = self->encoder.sEncParam.iPicHeight;
+ layer->sSliceCfg.uiSliceMode = SM_DYN_SLICE;
+ layer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = H264_RTP_PAYLOAD_SIZE;
+ layer->sSliceCfg.sSliceArgument.uiSliceNum = 1;
//layer->sSliceCfg.sSliceArgument.uiSliceMbNum[0] = 960;
- if ((err = self->encoder.pInst->InitializeExt(&self->encoder.sEncParam)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("InitializeExt failed: %ld", err);
- goto bail;
- }
-
- self->encoder.sEncPic.iColorFormat = videoFormatI420;
- self->encoder.sEncPic.iPicWidth = self->encoder.sEncParam.iPicWidth;
- self->encoder.sEncPic.iPicHeight = self->encoder.sEncParam.iPicHeight;
- self->encoder.sEncPic.iStride[0] = self->encoder.sEncPic.iPicWidth;
- self->encoder.sEncPic.iStride[1] = self->encoder.sEncPic.iStride[0] >> 1;
- self->encoder.sEncPic.iStride[2] = self->encoder.sEncPic.iStride[1];
-
+ if ((err = self->encoder.pInst->InitializeExt(&self->encoder.sEncParam)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("InitializeExt failed: %ld", err);
+ goto bail;
+ }
+
+ self->encoder.sEncPic.iColorFormat = videoFormatI420;
+ self->encoder.sEncPic.iPicWidth = self->encoder.sEncParam.iPicWidth;
+ self->encoder.sEncPic.iPicHeight = self->encoder.sEncParam.iPicHeight;
+ self->encoder.sEncPic.iStride[0] = self->encoder.sEncPic.iPicWidth;
+ self->encoder.sEncPic.iStride[1] = self->encoder.sEncPic.iStride[0] >> 1;
+ self->encoder.sEncPic.iStride[2] = self->encoder.sEncPic.iStride[1];
+
// Create encoder mutex
if (!self->encoder.mutex && !(self->encoder.mutex = tsk_mutex_create())) {
TSK_DEBUG_ERROR("Failed to create mutex for the encoder");
goto bail;
}
-
+
self->encoder.frame_count = 0;
- ret = 0;
+ ret = 0;
bail:
- return ret;
+ return ret;
}
static int tdav_codec_h264_cisco_close_encoder(tdav_codec_h264_cisco_t* self, tsk_bool_t reset_rotation)
{
- if (self) {
- if (self->encoder.pInst) {
- self->encoder.pInst->Uninitialize();
- WelsDestroySVCEncoder(self->encoder.pInst);
- self->encoder.pInst = NULL;
- }
- if (self->encoder.buffer) {
- TSK_FREE(self->encoder.buffer);
- }
+ if (self) {
+ if (self->encoder.pInst) {
+ self->encoder.pInst->Uninitialize();
+ WelsDestroySVCEncoder(self->encoder.pInst);
+ self->encoder.pInst = NULL;
+ }
+ if (self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
if (self->encoder.mutex) {
tsk_mutex_destroy(&self->encoder.mutex);
}
@@ -729,154 +730,172 @@ static int tdav_codec_h264_cisco_close_encoder(tdav_codec_h264_cisco_t* self, ts
if (reset_rotation) {
self->encoder.rotation = 0; // reset rotation
}
- }
- return 0;
+ }
+ return 0;
}
int tdav_codec_h264_cisco_open_decoder(tdav_codec_h264_cisco_t* self)
{
- int ret = -1;
- long err;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
- SDecodingParam sDecParam = { 0 };
-
- if (self->decoder.pInst) {
- TSK_DEBUG_ERROR("Decoder already initialized");
- goto bail;
- }
-
- // create decoder
- if ((err = WelsCreateDecoder(&self->decoder.pInst)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("Failed to create decoder: %ld", err);
- goto bail;
- }
- self->decoder.pInst->SetOption(DECODER_OPTION_TRACE_CALLBACK_CONTEXT, self);
- self->decoder.pInst->SetOption(DECODER_OPTION_TRACE_CALLBACK, &__tdav_codec_h264_cisco_debug_cb);
-
- // initialize decoder
- sDecParam.iOutputColorFormat = videoFormatI420;
- sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
- if ((err = self->decoder.pInst->Initialize(&sDecParam)) != cmResultSuccess) {
- TSK_DEBUG_ERROR("Failed to initialize decoder: %ld", err);
- goto bail;
- }
+ int ret = -1;
+ long err;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+ SDecodingParam sDecParam = { 0 };
+
+ if (self->decoder.pInst) {
+ TSK_DEBUG_ERROR("Decoder already initialized");
+ goto bail;
+ }
+
+ // create decoder
+ if ((err = WelsCreateDecoder(&self->decoder.pInst)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("Failed to create decoder: %ld", err);
+ goto bail;
+ }
+ self->decoder.pInst->SetOption(DECODER_OPTION_TRACE_CALLBACK_CONTEXT, self);
+ self->decoder.pInst->SetOption(DECODER_OPTION_TRACE_CALLBACK, &__tdav_codec_h264_cisco_debug_cb);
+
+ // initialize decoder
+ sDecParam.iOutputColorFormat = videoFormatI420;
+ sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
+ if ((err = self->decoder.pInst->Initialize(&sDecParam)) != cmResultSuccess) {
+ TSK_DEBUG_ERROR("Failed to initialize decoder: %ld", err);
+ goto bail;
+ }
self->decoder.last_seq = 0;
- TSK_DEBUG_INFO("[OpenH264 Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
- TMEDIA_CODEC_VIDEO(self)->in.width,
- TMEDIA_CODEC_VIDEO(self)->in.height,
- TMEDIA_CODEC_VIDEO(self)->in.fps
- );
- ret = 0;
+ TSK_DEBUG_INFO("[OpenH264 Decoder] neg_width=%d, neg_height=%d, neg_fps=%d",
+ TMEDIA_CODEC_VIDEO(self)->in.width,
+ TMEDIA_CODEC_VIDEO(self)->in.height,
+ TMEDIA_CODEC_VIDEO(self)->in.fps
+ );
+ ret = 0;
bail:
- return ret;
+ return ret;
}
static int tdav_codec_h264_cisco_close_decoder(tdav_codec_h264_cisco_t* self)
{
- if (self) {
- if (self->decoder.pInst) {
- self->decoder.pInst->Uninitialize();
- WelsDestroyDecoder(self->decoder.pInst);
- self->decoder.pInst = NULL;
- }
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_pos = 0;
- }
-
- return 0;
+ if (self) {
+ if (self->decoder.pInst) {
+ self->decoder.pInst->Uninitialize();
+ WelsDestroyDecoder(self->decoder.pInst);
+ self->decoder.pInst = NULL;
+ }
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_pos = 0;
+ }
+
+ return 0;
}
static ELevelIdc tdav_codec_h264_cisco_convert_level(enum level_idc_e level)
{
- switch(level) {
- case level_idc_1_0: return LEVEL_1_0;
- case level_idc_1_b: return LEVEL_1_B;
- case level_idc_1_1: return LEVEL_1_1;
- case level_idc_1_2: return LEVEL_1_2;
- case level_idc_1_3: return LEVEL_1_3;
- case level_idc_2_0: return LEVEL_2_0;
- case level_idc_2_1: return LEVEL_2_1;
- case level_idc_2_2: return LEVEL_2_2;
- case level_idc_3_0: return LEVEL_3_0;
- case level_idc_3_1: return LEVEL_3_1;
- case level_idc_3_2: return LEVEL_3_2;
- case level_idc_4_0: return LEVEL_4_0;
- case level_idc_4_1: return LEVEL_4_1;
- case level_idc_4_2: return LEVEL_4_2;
- case level_idc_5_0: return LEVEL_5_0;
- case level_idc_5_1: return LEVEL_5_1;
- case level_idc_5_2: return LEVEL_2_2;
- default: return LEVEL_UNKNOWN;
- }
+ switch(level) {
+ case level_idc_1_0:
+ return LEVEL_1_0;
+ case level_idc_1_b:
+ return LEVEL_1_B;
+ case level_idc_1_1:
+ return LEVEL_1_1;
+ case level_idc_1_2:
+ return LEVEL_1_2;
+ case level_idc_1_3:
+ return LEVEL_1_3;
+ case level_idc_2_0:
+ return LEVEL_2_0;
+ case level_idc_2_1:
+ return LEVEL_2_1;
+ case level_idc_2_2:
+ return LEVEL_2_2;
+ case level_idc_3_0:
+ return LEVEL_3_0;
+ case level_idc_3_1:
+ return LEVEL_3_1;
+ case level_idc_3_2:
+ return LEVEL_3_2;
+ case level_idc_4_0:
+ return LEVEL_4_0;
+ case level_idc_4_1:
+ return LEVEL_4_1;
+ case level_idc_4_2:
+ return LEVEL_4_2;
+ case level_idc_5_0:
+ return LEVEL_5_0;
+ case level_idc_5_1:
+ return LEVEL_5_1;
+ case level_idc_5_2:
+ return LEVEL_2_2;
+ default:
+ return LEVEL_UNKNOWN;
+ }
}
static void tdav_codec_h264_cisco_debug_cb(void* context, int level, const char* message)
{
- switch (level) {
- case WELS_LOG_ERROR:
- case WELS_LOG_QUIET:
- TSK_DEBUG_ERROR("OpenH264: level=%d, message=%s", level, message);
- break;
- case WELS_LOG_WARNING:
- TSK_DEBUG_WARN("OpenH264: level=%d, message=%s", level, message);
- break;
- default:
- TSK_DEBUG_INFO("OpenH264: level=%d, message=%s", level, message);
- break;
- }
+ switch (level) {
+ case WELS_LOG_ERROR:
+ case WELS_LOG_QUIET:
+ TSK_DEBUG_ERROR("OpenH264: level=%d, message=%s", level, message);
+ break;
+ case WELS_LOG_WARNING:
+ TSK_DEBUG_WARN("OpenH264: level=%d, message=%s", level, message);
+ break;
+ default:
+ TSK_DEBUG_INFO("OpenH264: level=%d, message=%s", level, message);
+ break;
+ }
}
static int tdav_codec_h264_cisco_init(tdav_codec_h264_cisco_t* self, profile_idc_t profile)
{
- int ret = -1;
- level_idc_t level;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
-
- if (!self || profile != profile_idc_baseline) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if ((ret = tdav_codec_h264_common_init(common))) {
- TSK_DEBUG_ERROR("tdav_codec_h264_cisco_common_init() faile with error code=%d", ret);
- goto bail;
- }
-
- if ((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
- TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- goto bail;
- }
-
- common->pack_mode_local = H264_PACKETIZATION_MODE;
- common->profile = profile;
- common->level = level;
- // A.2.1.1 Constrained Baseline profile
- // Conformance of a bitstream to the Constrained Baseline profile is indicated by profile_idc being equal to 66 with
- // constraint_set1_flag being equal to 1.
- common->profile_iop = 0xe0; // "constraint_set0_flag=1 and constraint_set1_flag=1" -> Constrained Baseline profile
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
-
- TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p;
- TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p;
-
- ret = 0;
+ int ret = -1;
+ level_idc_t level;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+
+ if (!self || profile != profile_idc_baseline) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if ((ret = tdav_codec_h264_common_init(common))) {
+ TSK_DEBUG_ERROR("tdav_codec_h264_cisco_common_init() faile with error code=%d", ret);
+ goto bail;
+ }
+
+ if ((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
+ TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ goto bail;
+ }
+
+ common->pack_mode_local = H264_PACKETIZATION_MODE;
+ common->profile = profile;
+ common->level = level;
+ // A.2.1.1 Constrained Baseline profile
+ // Conformance of a bitstream to the Constrained Baseline profile is indicated by profile_idc being equal to 66 with
+ // constraint_set1_flag being equal to 1.
+ common->profile_iop = 0xe0; // "constraint_set0_flag=1 and constraint_set1_flag=1" -> Constrained Baseline profile
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
+
+ TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p;
+ TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p;
+
+ ret = 0;
bail:
- return ret;
+ return ret;
}
static int tdav_codec_h264_cisco_deinit(tdav_codec_h264_cisco_t* self)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tdav_codec_h264_cisco_close((tmedia_codec_t*)self);
-
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tdav_codec_h264_cisco_close((tmedia_codec_t*)self);
+
+ return 0;
}
#endif /* HAVE_OPENH264 */
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264_cuda.cxx b/tinyDAV/src/codecs/h264/tdav_codec_h264_cuda.cxx
index f9fbc11..c677550 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264_cuda.cxx
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264_cuda.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,7 +26,7 @@
* http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_VideoDecoder_Library.pdf
* http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_VideoEncoder_Library.pdf
* 2.0: https://developer.nvidia.com/sites/default/files/akamai/cuda/files/CUDADownloads/NVENC_VideoEncoder_API_ProgGuide.pdf
- *
+ *
* RTP payloader/depayloader follows RFC 3984.
*
* @author Mamadou Diop <diopmamadou(at)doubango(DOT)org>
@@ -50,7 +50,7 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-#include <cutil_inline.h>
+#include <cutil_inline.h>
#include <cuda.h>
#define tdav_codec_h264_cuda_fmtp_set tsk_null
@@ -89,217 +89,295 @@ static inline tsk_size_t _tdav_codec_h264_cuda_pict_layout(tdav_codec_h264_cuda_
static int tdav_codec_h264_cuda_open(tmedia_codec_t* self)
{
- int ret = 0, i;
- int bestGPU = 0, gpuPerf = 0, adapterCount;
- static int low_latency = 1;
- HRESULT hr;
- CUresult cuResult;
- D3DPRESENT_PARAMETERS d3dpp;
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- //
- // encoder
- //
- memset(&h264->encoder.clb_params, 0, sizeof(h264->encoder.clb_params));
- memset(&h264->encoder.ctx_params, 0, sizeof(h264->encoder.ctx_params));
-
- h264->encoder.ctx_params.iInputSize[0] = TMEDIA_CODEC_VIDEO(h264)->out.width;
- h264->encoder.ctx_params.iInputSize[1] = TMEDIA_CODEC_VIDEO(h264)->out.height;
- h264->encoder.ctx_params.iOutputSize[0] = TMEDIA_CODEC_VIDEO(h264)->out.width;
- h264->encoder.ctx_params.iOutputSize[1] = TMEDIA_CODEC_VIDEO(h264)->out.height;
- h264->encoder.ctx_params.GPUOffloadLevel= NVVE_GPU_OFFLOAD_DEFAULT;
- h264->encoder.ctx_params.iSurfaceFormat = (int)IYUV;
- h264->encoder.ctx_params.iPictureType = (int)FRAME_PICTURE;
- h264->encoder.ctx_params.Fieldmode = MODE_FRAME;
- h264->encoder.ctx_params.Presets = (NVVE_PRESETS_TARGET)-1;//Should be iPod, Zune ...
- h264->encoder.ctx_params.iP_Interval = 1;
- h264->encoder.ctx_params.iAspectRatio[0] = 4;
- h264->encoder.ctx_params.iAspectRatio[1] = 3;
- h264->encoder.ctx_params.iAspectRatio[2] = 0;
- h264->encoder.ctx_params.iIDR_Period = TMEDIA_CODEC_VIDEO(h264)->out.fps * 3;
- h264->encoder.ctx_params.iUseDeviceMem = 0;
- h264->encoder.ctx_params.iDynamicGOP = 0;
- h264->encoder.ctx_params.RCType = RC_VBR;
- h264->encoder.ctx_params.iAvgBitrate = 400000;
- h264->encoder.ctx_params.iPeakBitrate = 800000;
- h264->encoder.ctx_params.iQP_Level_Intra = 25;
- h264->encoder.ctx_params.iQP_Level_InterP = 28;
- h264->encoder.ctx_params.iQP_Level_InterB = 31;
- h264->encoder.ctx_params.iFrameRate[0] = TMEDIA_CODEC_VIDEO(h264)->out.fps * 1000;
- h264->encoder.ctx_params.iFrameRate[1] = 1000;
- h264->encoder.ctx_params.iDeblockMode = 1;
- h264->encoder.ctx_params.iForceIntra = 0;
- h264->encoder.ctx_params.iForceIDR = 0;
- h264->encoder.ctx_params.iClearStat = 0;
- h264->encoder.ctx_params.DIMode = DI_MEDIAN;
- h264->encoder.ctx_params.iDisableSPSPPS = 1; // Do not include SPS/PPS frames
- h264->encoder.ctx_params.iNaluFramingType = 0; // StartCodes
- h264->encoder.ctx_params.iMultiGPU = 1;
- switch(TDAV_CODEC_H264_COMMON(h264)->profile){
- case tdav_codec_h264_bp10:
- h264->encoder.ctx_params.iDisableCabac = 1;
- h264->encoder.ctx_params.iProfileLevel = 0xff42;
- break;
- case tdav_codec_h264_bp20:
- h264->encoder.ctx_params.iDisableCabac = 1;
- h264->encoder.ctx_params.iProfileLevel = 0xff42;
- break;
- case tdav_codec_h264_bp30:
- h264->encoder.ctx_params.iDisableCabac = 1;
- h264->encoder.ctx_params.iProfileLevel = 0xff42;
- break;
- default:
- break;
- }
-
- hr = NVCreateEncoder(&h264->encoder.context);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVCreateEncoder failed with error code = %08x", hr);
- return -2;
- }
-
- hr = NVSetCodec(h264->encoder.context, NV_CODEC_TYPE_H264);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVSetCodec failed with error code = %08x", hr);
- return -2;
- }
-
- hr = NVSetDefaultParam(h264->encoder.context);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVSetDefaultParam() failed with error code = %08x", hr);
- return -2;
- }
-
- hr = NVGetParamValue(h264->encoder.context, NVVE_GET_GPU_COUNT, &h264->encoder.ctx_params.GPU_count);
- if(SUCCEEDED(hr)){
- int temp = 0, deviceCount;
- for (deviceCount=0; deviceCount < h264->encoder.ctx_params.GPU_count; deviceCount++) {
- NVVE_GPUAttributes GPUAttributes = {0};
-
- GPUAttributes.iGpuOrdinal = deviceCount;
- hr = NVGetParamValue(h264->encoder.context, NVVE_GET_GPU_ATTRIBUTES, &GPUAttributes);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_ATTRIBUTES) failed with error code = %08x", hr);
- continue;
- }
-
- temp = GPUAttributes.iClockRate * GPUAttributes.iMultiProcessorCount;
- temp = temp * _ConvertSMVer2Cores(GPUAttributes.iMajor, GPUAttributes.iMinor);
-
- if(temp > gpuPerf){
- gpuPerf = temp;
- bestGPU = deviceCount;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_COUNT) failed with error code = %08x", hr);
- return -2;
- }
-
- h264->encoder.ctx_params.iForcedGPU = bestGPU;
- hr = NVSetParamValue(h264->encoder.context, NVVE_FORCE_GPU_SELECTION, &h264->encoder.ctx_params.iForcedGPU);
- if(FAILED(hr)){
- TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_GPU_SELECTION) failed with error code = %08x", hr);
- }
-
- hr = NVSetParamValue(h264->encoder.context, NVVE_DEVICE_MEMORY_INPUT, &(h264->encoder.ctx_params.iUseDeviceMem));
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
- return -2;
- }
-
- h264->encoder.buffer_size = (h264->encoder.ctx_params.iOutputSize[1] * h264->encoder.ctx_params.iOutputSize[0] * 3) >> 4;
- if(!h264->encoder.buffer && !(h264->encoder.buffer = tsk_realloc(h264->encoder.buffer, h264->encoder.buffer_size))){
- TSK_DEBUG_ERROR("Failed to allocate buffer with size=%u", h264->encoder.buffer_size);
- h264->encoder.buffer_size = 0;
- return -2;
- }
-
- hr = NVSetParamValue(h264->encoder.context,NVVE_OUT_SIZE, &(h264->encoder.ctx_params.iOutputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_IN_SIZE, &(h264->encoder.ctx_params.iInputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_MULTI_GPU, &(h264->encoder.ctx_params.iMultiGPU)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_ASPECT_RATIO, &(h264->encoder.ctx_params.iAspectRatio));if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_FIELD_ENC_MODE, &(h264->encoder.ctx_params.Fieldmode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_P_INTERVAL, &(h264->encoder.ctx_params.iP_Interval)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_IDR_PERIOD, &(h264->encoder.ctx_params.iIDR_Period)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_DYNAMIC_GOP, &(h264->encoder.ctx_params.iDynamicGOP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_RC_TYPE, &(h264->encoder.ctx_params.RCType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_AVG_BITRATE, &(h264->encoder.ctx_params.iAvgBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_PEAK_BITRATE, &(h264->encoder.ctx_params.iPeakBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTRA, &(h264->encoder.ctx_params.iQP_Level_Intra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTER_P,&(h264->encoder.ctx_params.iQP_Level_InterP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTER_B,&(h264->encoder.ctx_params.iQP_Level_InterB)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_FRAME_RATE, &(h264->encoder.ctx_params.iFrameRate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_DEBLOCK_MODE, &(h264->encoder.ctx_params.iDeblockMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_PROFILE_LEVEL, &(h264->encoder.ctx_params.iProfileLevel)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_FORCE_INTRA, &(h264->encoder.ctx_params.iForceIntra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_FORCE_IDR, &(h264->encoder.ctx_params.iForceIDR)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_CLEAR_STAT, &(h264->encoder.ctx_params.iClearStat)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_SET_DEINTERLACE,&(h264->encoder.ctx_params.DIMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr); }
+ int ret = 0, i;
+ int bestGPU = 0, gpuPerf = 0, adapterCount;
+ static int low_latency = 1;
+ HRESULT hr;
+ CUresult cuResult;
+ D3DPRESENT_PARAMETERS d3dpp;
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ //
+ // encoder
+ //
+ memset(&h264->encoder.clb_params, 0, sizeof(h264->encoder.clb_params));
+ memset(&h264->encoder.ctx_params, 0, sizeof(h264->encoder.ctx_params));
+
+ h264->encoder.ctx_params.iInputSize[0] = TMEDIA_CODEC_VIDEO(h264)->out.width;
+ h264->encoder.ctx_params.iInputSize[1] = TMEDIA_CODEC_VIDEO(h264)->out.height;
+ h264->encoder.ctx_params.iOutputSize[0] = TMEDIA_CODEC_VIDEO(h264)->out.width;
+ h264->encoder.ctx_params.iOutputSize[1] = TMEDIA_CODEC_VIDEO(h264)->out.height;
+ h264->encoder.ctx_params.GPUOffloadLevel= NVVE_GPU_OFFLOAD_DEFAULT;
+ h264->encoder.ctx_params.iSurfaceFormat = (int)IYUV;
+ h264->encoder.ctx_params.iPictureType = (int)FRAME_PICTURE;
+ h264->encoder.ctx_params.Fieldmode = MODE_FRAME;
+ h264->encoder.ctx_params.Presets = (NVVE_PRESETS_TARGET)-1;//Should be iPod, Zune ...
+ h264->encoder.ctx_params.iP_Interval = 1;
+ h264->encoder.ctx_params.iAspectRatio[0] = 4;
+ h264->encoder.ctx_params.iAspectRatio[1] = 3;
+ h264->encoder.ctx_params.iAspectRatio[2] = 0;
+ h264->encoder.ctx_params.iIDR_Period = TMEDIA_CODEC_VIDEO(h264)->out.fps * 3;
+ h264->encoder.ctx_params.iUseDeviceMem = 0;
+ h264->encoder.ctx_params.iDynamicGOP = 0;
+ h264->encoder.ctx_params.RCType = RC_VBR;
+ h264->encoder.ctx_params.iAvgBitrate = 400000;
+ h264->encoder.ctx_params.iPeakBitrate = 800000;
+ h264->encoder.ctx_params.iQP_Level_Intra = 25;
+ h264->encoder.ctx_params.iQP_Level_InterP = 28;
+ h264->encoder.ctx_params.iQP_Level_InterB = 31;
+ h264->encoder.ctx_params.iFrameRate[0] = TMEDIA_CODEC_VIDEO(h264)->out.fps * 1000;
+ h264->encoder.ctx_params.iFrameRate[1] = 1000;
+ h264->encoder.ctx_params.iDeblockMode = 1;
+ h264->encoder.ctx_params.iForceIntra = 0;
+ h264->encoder.ctx_params.iForceIDR = 0;
+ h264->encoder.ctx_params.iClearStat = 0;
+ h264->encoder.ctx_params.DIMode = DI_MEDIAN;
+ h264->encoder.ctx_params.iDisableSPSPPS = 1; // Do not include SPS/PPS frames
+ h264->encoder.ctx_params.iNaluFramingType = 0; // StartCodes
+ h264->encoder.ctx_params.iMultiGPU = 1;
+ switch(TDAV_CODEC_H264_COMMON(h264)->profile) {
+ case tdav_codec_h264_bp10:
+ h264->encoder.ctx_params.iDisableCabac = 1;
+ h264->encoder.ctx_params.iProfileLevel = 0xff42;
+ break;
+ case tdav_codec_h264_bp20:
+ h264->encoder.ctx_params.iDisableCabac = 1;
+ h264->encoder.ctx_params.iProfileLevel = 0xff42;
+ break;
+ case tdav_codec_h264_bp30:
+ h264->encoder.ctx_params.iDisableCabac = 1;
+ h264->encoder.ctx_params.iProfileLevel = 0xff42;
+ break;
+ default:
+ break;
+ }
+
+ hr = NVCreateEncoder(&h264->encoder.context);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVCreateEncoder failed with error code = %08x", hr);
+ return -2;
+ }
+
+ hr = NVSetCodec(h264->encoder.context, NV_CODEC_TYPE_H264);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVSetCodec failed with error code = %08x", hr);
+ return -2;
+ }
+
+ hr = NVSetDefaultParam(h264->encoder.context);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVSetDefaultParam() failed with error code = %08x", hr);
+ return -2;
+ }
+
+ hr = NVGetParamValue(h264->encoder.context, NVVE_GET_GPU_COUNT, &h264->encoder.ctx_params.GPU_count);
+ if(SUCCEEDED(hr)) {
+ int temp = 0, deviceCount;
+ for (deviceCount=0; deviceCount < h264->encoder.ctx_params.GPU_count; deviceCount++) {
+ NVVE_GPUAttributes GPUAttributes = {0};
+
+ GPUAttributes.iGpuOrdinal = deviceCount;
+ hr = NVGetParamValue(h264->encoder.context, NVVE_GET_GPU_ATTRIBUTES, &GPUAttributes);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_ATTRIBUTES) failed with error code = %08x", hr);
+ continue;
+ }
+
+ temp = GPUAttributes.iClockRate * GPUAttributes.iMultiProcessorCount;
+ temp = temp * _ConvertSMVer2Cores(GPUAttributes.iMajor, GPUAttributes.iMinor);
+
+ if(temp > gpuPerf) {
+ gpuPerf = temp;
+ bestGPU = deviceCount;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_COUNT) failed with error code = %08x", hr);
+ return -2;
+ }
+
+ h264->encoder.ctx_params.iForcedGPU = bestGPU;
+ hr = NVSetParamValue(h264->encoder.context, NVVE_FORCE_GPU_SELECTION, &h264->encoder.ctx_params.iForcedGPU);
+ if(FAILED(hr)) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_GPU_SELECTION) failed with error code = %08x", hr);
+ }
+
+ hr = NVSetParamValue(h264->encoder.context, NVVE_DEVICE_MEMORY_INPUT, &(h264->encoder.ctx_params.iUseDeviceMem));
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
+ return -2;
+ }
+
+ h264->encoder.buffer_size = (h264->encoder.ctx_params.iOutputSize[1] * h264->encoder.ctx_params.iOutputSize[0] * 3) >> 4;
+ if(!h264->encoder.buffer && !(h264->encoder.buffer = tsk_realloc(h264->encoder.buffer, h264->encoder.buffer_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size=%u", h264->encoder.buffer_size);
+ h264->encoder.buffer_size = 0;
+ return -2;
+ }
+
+ hr = NVSetParamValue(h264->encoder.context,NVVE_OUT_SIZE, &(h264->encoder.ctx_params.iOutputSize));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_IN_SIZE, &(h264->encoder.ctx_params.iInputSize));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_MULTI_GPU, &(h264->encoder.ctx_params.iMultiGPU));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_ASPECT_RATIO, &(h264->encoder.ctx_params.iAspectRatio));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_FIELD_ENC_MODE, &(h264->encoder.ctx_params.Fieldmode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_P_INTERVAL, &(h264->encoder.ctx_params.iP_Interval));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_IDR_PERIOD, &(h264->encoder.ctx_params.iIDR_Period));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_DYNAMIC_GOP, &(h264->encoder.ctx_params.iDynamicGOP));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_RC_TYPE, &(h264->encoder.ctx_params.RCType));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_AVG_BITRATE, &(h264->encoder.ctx_params.iAvgBitrate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_PEAK_BITRATE, &(h264->encoder.ctx_params.iPeakBitrate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTRA, &(h264->encoder.ctx_params.iQP_Level_Intra));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTER_P,&(h264->encoder.ctx_params.iQP_Level_InterP));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_QP_LEVEL_INTER_B,&(h264->encoder.ctx_params.iQP_Level_InterB));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_FRAME_RATE, &(h264->encoder.ctx_params.iFrameRate));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_DEBLOCK_MODE, &(h264->encoder.ctx_params.iDeblockMode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_PROFILE_LEVEL, &(h264->encoder.ctx_params.iProfileLevel));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_FORCE_INTRA, &(h264->encoder.ctx_params.iForceIntra));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_FORCE_IDR, &(h264->encoder.ctx_params.iForceIDR));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_CLEAR_STAT, &(h264->encoder.ctx_params.iClearStat));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_SET_DEINTERLACE,&(h264->encoder.ctx_params.DIMode));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr);
+ }
if (h264->encoder.ctx_params.Presets != -1) {
- hr = NVSetParamValue(h264->encoder.context,NVVE_PRESETS, &(h264->encoder.ctx_params.Presets)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr); }
- }
- hr = NVSetParamValue(h264->encoder.context,NVVE_DISABLE_CABAC, &(h264->encoder.ctx_params.iDisableCabac)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(h264->encoder.ctx_params.iNaluFramingType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_DISABLE_SPS_PPS,&(h264->encoder.ctx_params.iDisableSPSPPS)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr); }
- hr = NVSetParamValue(h264->encoder.context,NVVE_LOW_LATENCY,&low_latency); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr); }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_PRESETS, &(h264->encoder.ctx_params.Presets));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr);
+ }
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_DISABLE_CABAC, &(h264->encoder.ctx_params.iDisableCabac));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(h264->encoder.ctx_params.iNaluFramingType));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_DISABLE_SPS_PPS,&(h264->encoder.ctx_params.iDisableSPSPPS));
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr);
+ }
+ hr = NVSetParamValue(h264->encoder.context,NVVE_LOW_LATENCY,&low_latency);
+ if (hr!=S_OK) {
+ TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr);
+ }
+
+ h264->encoder.clb_params.pfnacquirebitstream = _NVCallback_HandleAcquireBitStream;
+ h264->encoder.clb_params.pfnonbeginframe = _NVCallback_HandleOnBeginFrame;
+ h264->encoder.clb_params.pfnonendframe = _NVCallback_HandleOnEndFrame;
+ h264->encoder.clb_params.pfnreleasebitstream = _NVCallback_HandleReleaseBitStream;
+ NVRegisterCB(h264->encoder.context, h264->encoder.clb_params, h264);
- h264->encoder.clb_params.pfnacquirebitstream = _NVCallback_HandleAcquireBitStream;
- h264->encoder.clb_params.pfnonbeginframe = _NVCallback_HandleOnBeginFrame;
- h264->encoder.clb_params.pfnonendframe = _NVCallback_HandleOnEndFrame;
- h264->encoder.clb_params.pfnreleasebitstream = _NVCallback_HandleReleaseBitStream;
- NVRegisterCB(h264->encoder.context, h264->encoder.clb_params, h264);
-
- hr = NVCreateHWEncoder(h264->encoder.context);
- if(FAILED(hr)){
- TSK_DEBUG_ERROR("NVCreateHWEncoder failed with error code = %08x", hr);
- return -2;
- }
+ hr = NVCreateHWEncoder(h264->encoder.context);
+ if(FAILED(hr)) {
+ TSK_DEBUG_ERROR("NVCreateHWEncoder failed with error code = %08x", hr);
+ return -2;
+ }
- //
- // decoder
- //
- if((cuResult = cuInit(0)) != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuInit(0) failed with error code = %d", (int)cuResult);
- return -3;
- }
+ //
+ // decoder
+ //
+ if((cuResult = cuInit(0)) != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuInit(0) failed with error code = %d", (int)cuResult);
+ return -3;
+ }
- InitH264DecoderInfo(h264);
+ InitH264DecoderInfo(h264);
- h264->decoder.cu_device = cutilDrvGetMaxGflopsGraphicsDeviceId();
+ h264->decoder.cu_device = cutilDrvGetMaxGflopsGraphicsDeviceId();
#if _DEBUG || DEBUG
- {
- int major, minor;
- size_t totalGlobalMem;
- char deviceName[256];
- cuDeviceComputeCapability(&major, &minor, h264->decoder.cu_device);
- cuDeviceGetName(deviceName, sizeof(deviceName), h264->decoder.cu_device);
- TSK_DEBUG_INFO("Using GPU Device %d: %s has SM %d.%d compute capability", h264->decoder.cu_device, deviceName, major, minor);
-
- cutilDrvSafeCallNoSync(cuDeviceTotalMem(&totalGlobalMem, h264->decoder.cu_device) );
- TSK_DEBUG_INFO("Total amount of global memory in GPU device: %4.4f MB", (float)totalGlobalMem/(1024*1024));
- }
+ {
+ int major, minor;
+ size_t totalGlobalMem;
+ char deviceName[256];
+ cuDeviceComputeCapability(&major, &minor, h264->decoder.cu_device);
+ cuDeviceGetName(deviceName, sizeof(deviceName), h264->decoder.cu_device);
+ TSK_DEBUG_INFO("Using GPU Device %d: %s has SM %d.%d compute capability", h264->decoder.cu_device, deviceName, major, minor);
+
+ cutilDrvSafeCallNoSync(cuDeviceTotalMem(&totalGlobalMem, h264->decoder.cu_device) );
+ TSK_DEBUG_INFO("Total amount of global memory in GPU device: %4.4f MB", (float)totalGlobalMem/(1024*1024));
+ }
#endif
- // create Direct3D instance
- h264->decoder.dx_d3d = Direct3DCreate9(D3D_SDK_VERSION);
- if(!h264->decoder.dx_d3d){
- TSK_DEBUG_ERROR("Direct3DCreate9 failed");
- return -3;
- }
- adapterCount = h264->decoder.dx_d3d->GetAdapterCount();
- for(i=0; i<adapterCount; ++i){
- ZeroMemory(&d3dpp, sizeof(d3dpp));
+ // create Direct3D instance
+ h264->decoder.dx_d3d = Direct3DCreate9(D3D_SDK_VERSION);
+ if(!h264->decoder.dx_d3d) {
+ TSK_DEBUG_ERROR("Direct3DCreate9 failed");
+ return -3;
+ }
+ adapterCount = h264->decoder.dx_d3d->GetAdapterCount();
+ for(i=0; i<adapterCount; ++i) {
+ ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = h264->decoder.info.ulTargetWidth;
@@ -309,620 +387,621 @@ static int tdav_codec_h264_cuda_open(tmedia_codec_t* self)
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.Flags = D3DPRESENTFLAG_VIDEO;//D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
hr = h264->decoder.dx_d3d->CreateDevice(i,
- D3DDEVTYPE_HAL,
- GetDesktopWindow(),
- D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING,
- &d3dpp,
- &h264->decoder.dx_d3ddevice);
- if(hr == S_OK){
+ D3DDEVTYPE_HAL,
+ GetDesktopWindow(),
+ D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING,
+ &d3dpp,
+ &h264->decoder.dx_d3ddevice);
+ if(hr == S_OK) {
cuResult = cuD3D9CtxCreate(&h264->decoder.cu_context, &h264->decoder.cu_device, 0, h264->decoder.dx_d3ddevice);
- if(cuResult == CUDA_SUCCESS){
+ if(cuResult == CUDA_SUCCESS) {
break;
- }
- if(h264->decoder.dx_d3ddevice){
- h264->decoder.dx_d3ddevice->Release();
- h264->decoder.dx_d3ddevice = NULL;
- }
+ }
+ if(h264->decoder.dx_d3ddevice) {
+ h264->decoder.dx_d3ddevice->Release();
+ h264->decoder.dx_d3ddevice = NULL;
+ }
}
- }
+ }
- memset(&h264->decoder.cu_paser_params, 0, sizeof(h264->decoder.cu_paser_params));
- h264->decoder.cu_paser_params.CodecType = cudaVideoCodec_H264;
+ memset(&h264->decoder.cu_paser_params, 0, sizeof(h264->decoder.cu_paser_params));
+ h264->decoder.cu_paser_params.CodecType = cudaVideoCodec_H264;
h264->decoder.cu_paser_params.ulMaxNumDecodeSurfaces = CUDA_MAX_FRM_CNT;
h264->decoder.cu_paser_params.pUserData = h264;
h264->decoder.cu_paser_params.pfnSequenceCallback = _NVCallback_HandleVideoSequence;
h264->decoder.cu_paser_params.pfnDecodePicture = _NVCallback_HandlePictureDecode;
h264->decoder.cu_paser_params.pfnDisplayPicture = _NVCallback_HandlePictureDisplay;
cuResult = cuvidCreateVideoParser(&h264->decoder.cu_parser, &h264->decoder.cu_paser_params);
- if(cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuvidCreateVideoParser(0) failed with error code = %d", (int)cuResult);
- return -3;
- }
-
- cuResult = cuvidCreateDecoder(&h264->decoder.context, &h264->decoder.info);
- if(CUDA_SUCCESS != cuResult){
- TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
- return -3;
- }
-
- return ret;
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidCreateVideoParser(0) failed with error code = %d", (int)cuResult);
+ return -3;
+ }
+
+ cuResult = cuvidCreateDecoder(&h264->decoder.context, &h264->decoder.info);
+ if(CUDA_SUCCESS != cuResult) {
+ TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
+ return -3;
+ }
+
+ return ret;
}
static int tdav_codec_h264_cuda_close(tmedia_codec_t* self)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(h264->encoder.context){
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(h264->encoder.context) {
NVDestroyEncoder(h264->encoder.context);
h264->encoder.context = NULL;
}
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_cuda_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- NVVE_EncodeFrameParams efparams;
- int ret = 0;
- unsigned long flags = 0;
- HRESULT hr;
-
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return 0;
- }
-
- if((h264->encoder.ctx_params.iOutputSize[1] * h264->encoder.ctx_params.iOutputSize[0] * 3)>>1 != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
-
- //return 0;
-
- efparams.Width = h264->encoder.ctx_params.iOutputSize[0];
- efparams.Height = h264->encoder.ctx_params.iOutputSize[1];
- efparams.Pitch = (h264->encoder.ctx_params.nDeviceMemPitch ? h264->encoder.ctx_params.nDeviceMemPitch : h264->encoder.ctx_params.iOutputSize[0]);
- efparams.PictureStruc = (NVVE_PicStruct)h264->encoder.ctx_params.iPictureType;
+ NVVE_EncodeFrameParams efparams;
+ int ret = 0;
+ unsigned long flags = 0;
+ HRESULT hr;
+
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return 0;
+ }
+
+ if((h264->encoder.ctx_params.iOutputSize[1] * h264->encoder.ctx_params.iOutputSize[0] * 3)>>1 != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
+
+ //return 0;
+
+ efparams.Width = h264->encoder.ctx_params.iOutputSize[0];
+ efparams.Height = h264->encoder.ctx_params.iOutputSize[1];
+ efparams.Pitch = (h264->encoder.ctx_params.nDeviceMemPitch ? h264->encoder.ctx_params.nDeviceMemPitch : h264->encoder.ctx_params.iOutputSize[0]);
+ efparams.PictureStruc = (NVVE_PicStruct)h264->encoder.ctx_params.iPictureType;
efparams.SurfFmt = (NVVE_SurfaceFormat)h264->encoder.ctx_params.iSurfaceFormat;
- efparams.progressiveFrame = (h264->encoder.ctx_params.iSurfaceFormat == 3) ? 1 : 0;
+ efparams.progressiveFrame = (h264->encoder.ctx_params.iSurfaceFormat == 3) ? 1 : 0;
efparams.repeatFirstField = 0;
- efparams.topfieldfirst = (h264->encoder.ctx_params.iSurfaceFormat == 1) ? 1 : 0;
- efparams.picBuf = (unsigned char *)in_data;
- efparams.bLast = 0;
-
- // send keyframe for:
- // - the first frame
- // - every second within the first 4seconds
- // - every 7 seconds after the first 4seconds
- if(h264->encoder.frame_count++ == 0
- ||
- ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
- ||
- ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
- )
- {
- flags |= 0x04; // FORCE IDR
- if(h264->encoder.ctx_params.iDisableSPSPPS){
- unsigned char SPSPPSBuff[1024];
- int SPSPPSBuffSize = sizeof(SPSPPSBuff);
- hr = NVGetSPSPPS(h264->encoder.context, SPSPPSBuff, SPSPPSBuffSize, &SPSPPSBuffSize);
- if(SUCCEEDED(hr)){
- int size = 0;
- while(size < SPSPPSBuffSize - 2){
- int16_t next_size = ((int16_t)SPSPPSBuff[size])<<1 | ((int16_t)SPSPPSBuff[size + 1]);
- _tdav_codec_h264_cuda_encap(h264, &SPSPPSBuff[size + 2], next_size);
- size+=next_size + 2;
- }
- }
- else{
- TSK_DEBUG_ERROR("NVGetSPSPPS failed with error code = %08x", hr)
- }
- }
- }
-
- hr = NVEncodeFrame(h264->encoder.context, &efparams, flags, NULL);
-
- return 0;
+ efparams.topfieldfirst = (h264->encoder.ctx_params.iSurfaceFormat == 1) ? 1 : 0;
+ efparams.picBuf = (unsigned char *)in_data;
+ efparams.bLast = 0;
+
+ // send keyframe for:
+ // - the first frame
+ // - every second within the first 4seconds
+ // - every 7 seconds after the first 4seconds
+ if(h264->encoder.frame_count++ == 0
+ ||
+ ( (h264->encoder.frame_count < (int)TMEDIA_CODEC_VIDEO(h264)->out.fps * 4) && ((h264->encoder.frame_count % TMEDIA_CODEC_VIDEO(h264)->out.fps)==0) )
+ ||
+ ( (h264->encoder.frame_count % (TMEDIA_CODEC_VIDEO(h264)->out.fps * 5))==0 )
+ ) {
+ flags |= 0x04; // FORCE IDR
+ if(h264->encoder.ctx_params.iDisableSPSPPS) {
+ unsigned char SPSPPSBuff[1024];
+ int SPSPPSBuffSize = sizeof(SPSPPSBuff);
+ hr = NVGetSPSPPS(h264->encoder.context, SPSPPSBuff, SPSPPSBuffSize, &SPSPPSBuffSize);
+ if(SUCCEEDED(hr)) {
+ int size = 0;
+ while(size < SPSPPSBuffSize - 2) {
+ int16_t next_size = ((int16_t)SPSPPSBuff[size])<<1 | ((int16_t)SPSPPSBuff[size + 1]);
+ _tdav_codec_h264_cuda_encap(h264, &SPSPPSBuff[size + 2], next_size);
+ size+=next_size + 2;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("NVGetSPSPPS failed with error code = %08x", hr)
+ }
+ }
+ }
+
+ hr = NVEncodeFrame(h264->encoder.context, &efparams, flags, NULL);
+
+ return 0;
}
static tsk_size_t tdav_codec_h264_cuda_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
- const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0, retsize = 0, size_to_copy = 0;
- int ret = 0;
- tsk_bool_t append_scp = tsk_false;
- static tsk_size_t xmax_size = (1920 * 1080 * 3) >> 3;
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
-
- // Packet lost?
- if(h264->decoder.last_seq != (rtp_hdr->seq_num - 1) && h264->decoder.last_seq){
- if(h264->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
- }
- h264->decoder.last_seq = rtp_hdr->seq_num;
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0, retsize = 0, size_to_copy = 0;
+ int ret = 0;
+ tsk_bool_t append_scp = tsk_false;
+ static tsk_size_t xmax_size = (1920 * 1080 * 3) >> 3;
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+
+ // Packet lost?
+ if(h264->decoder.last_seq != (rtp_hdr->seq_num - 1) && h264->decoder.last_seq) {
+ if(h264->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
+ }
+ h264->decoder.last_seq = rtp_hdr->seq_num;
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- if(*((uint8_t*)in_data) >> 7){
- TSK_DEBUG_WARN("F=1");
- /* reset accumulator */
- h264->decoder.accumulator_pos = 0;
- goto bail;
- }
-
- // get payload
- if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size){
- TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
- goto bail;
- }
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
-
- // start-accumulator
- if(!h264->decoder.accumulator){
- if(size_to_copy > xmax_size){
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- goto bail;
- }
- if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- goto bail;
- }
- h264->decoder.accumulator_size = size_to_copy;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size){
- TSK_DEBUG_ERROR("BufferOverflow");
- h264->decoder.accumulator_pos = 0;
- goto bail;
- }
- if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size){
- if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))){
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
- goto bail;
- }
- h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
- }
-
- if(append_scp){
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
- h264->decoder.accumulator_pos += start_code_prefix_size;
- }
- memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
- h264->decoder.accumulator_pos += pay_size;
- // end-accumulator
-
- if(rtp_hdr->marker){
- CUVIDSOURCEDATAPACKET pkt;
- CUresult cuResult;
- pkt.flags = 0;
+ */
+ if(*((uint8_t*)in_data) >> 7) {
+ TSK_DEBUG_WARN("F=1");
+ /* reset accumulator */
+ h264->decoder.accumulator_pos = 0;
+ goto bail;
+ }
+
+ // get payload
+ if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size) {
+ TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
+ goto bail;
+ }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+
+ // start-accumulator
+ if(!h264->decoder.accumulator) {
+ if(size_to_copy > xmax_size) {
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ goto bail;
+ }
+ if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ goto bail;
+ }
+ h264->decoder.accumulator_size = size_to_copy;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ h264->decoder.accumulator_pos = 0;
+ goto bail;
+ }
+ if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
+ if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+ goto bail;
+ }
+ h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
+ }
+
+ if(append_scp) {
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ h264->decoder.accumulator_pos += start_code_prefix_size;
+ }
+ memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], pay_ptr, pay_size);
+ h264->decoder.accumulator_pos += pay_size;
+ // end-accumulator
+
+ if(rtp_hdr->marker) {
+ CUVIDSOURCEDATAPACKET pkt;
+ CUresult cuResult;
+ pkt.flags = 0;
pkt.payload_size = (unsigned long) h264->decoder.accumulator_pos;
pkt.payload = (unsigned char *)h264->decoder.accumulator;
pkt.timestamp = 0;
- // reset accumulator
- h264->decoder.accumulator_pos = 0;
+ // reset accumulator
+ h264->decoder.accumulator_pos = 0;
cuResult = cuvidParseVideoData(h264->decoder.cu_parser, &pkt);
- if(cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuvidParseVideoData() failed with error code = %d", (int)cuResult);
- goto bail;
- }
-
- if(h264->decoder.cu_buffer_avail){
- h264->decoder.cu_buffer_avail = tsk_false;
- if((retsize = _tdav_codec_h264_cuda_pict_layout(h264, out_data, out_max_size)) == 0){
- TSK_DEBUG_ERROR("_tdav_codec_h264_cuda_pict_layout failed");
- goto bail;
- }
- }
- }
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidParseVideoData() failed with error code = %d", (int)cuResult);
+ goto bail;
+ }
+
+ if(h264->decoder.cu_buffer_avail) {
+ h264->decoder.cu_buffer_avail = tsk_false;
+ if((retsize = _tdav_codec_h264_cuda_pict_layout(h264, out_data, out_max_size)) == 0) {
+ TSK_DEBUG_ERROR("_tdav_codec_h264_cuda_pict_layout failed");
+ goto bail;
+ }
+ }
+ }
bail:
- return retsize;
+ return retsize;
}
static tsk_bool_t tdav_codec_h264_cuda_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)codec;
- profile_idc_t profile;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
- if(((profile = tdav_codec_h264_common_get_profile(fmtp)) != tdav_codec_h264_bp99) && (profile != TDAV_CODEC_H264_COMMON(h264)->profile)){
- TSK_DEBUG_INFO("Profile not matching");
- return tsk_false;
- }
-
- TMEDIA_CODEC_VIDEO(h264)->in.width = 800, TMEDIA_CODEC_VIDEO(h264)->in.height = 640;
- TMEDIA_CODEC_VIDEO(h264)->out.width = 800, TMEDIA_CODEC_VIDEO(h264)->out.height = 640;
- //TMEDIA_CODEC_VIDEO(h264)->in.width = 352, TMEDIA_CODEC_VIDEO(h264)->in.height = 288;
- //TMEDIA_CODEC_VIDEO(h264)->out.width = 352, TMEDIA_CODEC_VIDEO(h264)->out.height = 288;
-
- return tsk_true;
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)codec;
+ profile_idc_t profile;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
+ if(((profile = tdav_codec_h264_common_get_profile(fmtp)) != tdav_codec_h264_bp99) && (profile != TDAV_CODEC_H264_COMMON(h264)->profile)) {
+ TSK_DEBUG_INFO("Profile not matching");
+ return tsk_false;
+ }
+
+ TMEDIA_CODEC_VIDEO(h264)->in.width = 800, TMEDIA_CODEC_VIDEO(h264)->in.height = 640;
+ TMEDIA_CODEC_VIDEO(h264)->out.width = 800, TMEDIA_CODEC_VIDEO(h264)->out.height = 640;
+ //TMEDIA_CODEC_VIDEO(h264)->in.width = 352, TMEDIA_CODEC_VIDEO(h264)->in.height = 288;
+ //TMEDIA_CODEC_VIDEO(h264)->out.width = 352, TMEDIA_CODEC_VIDEO(h264)->out.height = 288;
+
+ return tsk_true;
}
static char* tdav_codec_h264_cuda_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* fmtp = tsk_null;
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
-
- switch(TDAV_CODEC_H264_COMMON(h264)->profile){
- case tdav_codec_h264_bp10:
- fmtp = tsk_strdup("profile-level-id=42e00a");
- break;
- case tdav_codec_h264_bp20:
- fmtp = tsk_strdup("profile-level-id=42e014");
- break;
- case tdav_codec_h264_bp30:
- fmtp = tsk_strdup("profile-level-id=42e01e");
- break;
- }
-
- //1080p(1920 x 1080), 720p(1280 x 720), SVGA(800 x 600), VGA(640 x 480), 4CIF(704 x 576), CIF(352 x 288), QCIF(176 x 144), SQCIF(128 x 96)
- return fmtp;
+ char* fmtp = tsk_null;
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+
+ switch(TDAV_CODEC_H264_COMMON(h264)->profile) {
+ case tdav_codec_h264_bp10:
+ fmtp = tsk_strdup("profile-level-id=42e00a");
+ break;
+ case tdav_codec_h264_bp20:
+ fmtp = tsk_strdup("profile-level-id=42e014");
+ break;
+ case tdav_codec_h264_bp30:
+ fmtp = tsk_strdup("profile-level-id=42e01e");
+ break;
+ }
+
+ //1080p(1920 x 1080), 720p(1280 x 720), SVGA(800 x 600), VGA(640 x 480), 4CIF(704 x 576), CIF(352 x 288), QCIF(176 x 144), SQCIF(128 x 96)
+ return fmtp;
}
tsk_bool_t tdav_codec_h264_cuda_is_supported()
{
- static tsk_bool_t __already_checked = tsk_false;
- static tsk_bool_t __is_supported = tsk_false;
- if(!__already_checked){
- HRESULT hr;
- __already_checked = tsk_true;
- hr = NVGetHWEncodeCaps();
- if(SUCCEEDED(hr)){
- NVEncoder encoder;
- hr = NVCreateEncoder(&encoder);
- if(SUCCEEDED(hr)){
- hr = NVIsSupportedCodec(encoder, NV_CODEC_TYPE_H264);
- __is_supported = SUCCEEDED(hr);
- }
- else{
- TSK_DEBUG_ERROR("NVCreateEncoder() failed with error code = %08x", hr);
- }
- if(encoder){
- NVDestroyEncoder(encoder);
- encoder = NULL;
- }
- }
- }
- return __is_supported;
+ static tsk_bool_t __already_checked = tsk_false;
+ static tsk_bool_t __is_supported = tsk_false;
+ if(!__already_checked) {
+ HRESULT hr;
+ __already_checked = tsk_true;
+ hr = NVGetHWEncodeCaps();
+ if(SUCCEEDED(hr)) {
+ NVEncoder encoder;
+ hr = NVCreateEncoder(&encoder);
+ if(SUCCEEDED(hr)) {
+ hr = NVIsSupportedCodec(encoder, NV_CODEC_TYPE_H264);
+ __is_supported = SUCCEEDED(hr);
+ }
+ else {
+ TSK_DEBUG_ERROR("NVCreateEncoder() failed with error code = %08x", hr);
+ }
+ if(encoder) {
+ NVDestroyEncoder(encoder);
+ encoder = NULL;
+ }
+ }
+ }
+ return __is_supported;
}
static int tdav_codec_h264_cuda_init(tdav_codec_h264_cuda_t* self, profile_idc_t profile)
{
- int ret = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = tdav_codec_h264_common_init(TDAV_CODEC_H264_COMMON(self)))){
- TSK_DEBUG_ERROR("tdav_codec_h264_common_init() faile with error code=%d", ret);
- return ret;
- }
-
- if(!self->decoder.mutex && !(self->decoder.mutex = tsk_mutex_create_2(tsk_false))){
- TSK_DEBUG_ERROR("Failed to create mutex");
- return -2;
- }
-
- sem = tsk_semaphore_create_2(1);
-
- TDAV_CODEC_H264_COMMON(self)->pack_mode_local = H264_PACKETIZATION_MODE;
- TDAV_CODEC_H264_COMMON(self)->profile = profile;
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
-
- // At this time self->plugin is Null
- TMEDIA_CODEC_VIDEO(self)->in.width = TMEDIA_CODEC_VIDEO(self)->out.width = 176;
- TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 144;
- TMEDIA_CODEC_VIDEO(self)->in.fps = TMEDIA_CODEC_VIDEO(self)->out.fps = 15;
- TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p;// no choice
-
- return 0;
+ int ret = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = tdav_codec_h264_common_init(TDAV_CODEC_H264_COMMON(self)))) {
+ TSK_DEBUG_ERROR("tdav_codec_h264_common_init() faile with error code=%d", ret);
+ return ret;
+ }
+
+ if(!self->decoder.mutex && !(self->decoder.mutex = tsk_mutex_create_2(tsk_false))) {
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ return -2;
+ }
+
+ sem = tsk_semaphore_create_2(1);
+
+ TDAV_CODEC_H264_COMMON(self)->pack_mode_local = H264_PACKETIZATION_MODE;
+ TDAV_CODEC_H264_COMMON(self)->profile = profile;
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
+
+ // At this time self->plugin is Null
+ TMEDIA_CODEC_VIDEO(self)->in.width = TMEDIA_CODEC_VIDEO(self)->out.width = 176;
+ TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 144;
+ TMEDIA_CODEC_VIDEO(self)->in.fps = TMEDIA_CODEC_VIDEO(self)->out.fps = 15;
+ TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p;// no choice
+
+ return 0;
}
static int tdav_codec_h264_cuda_deinit(tdav_codec_h264_cuda_t* self)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(h264->encoder.context){
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)self;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(h264->encoder.context) {
NVDestroyEncoder(h264->encoder.context);
h264->encoder.context = NULL;
}
- TSK_FREE(h264->encoder.buffer);
- h264->encoder.buffer_size = 0;
+ TSK_FREE(h264->encoder.buffer);
+ h264->encoder.buffer_size = 0;
- if(h264->decoder.context){
+ if(h264->decoder.context) {
cuvidDestroyDecoder(h264->decoder.context);
h264->decoder.context = NULL;
}
- if(h264->decoder.cu_context){
- cuCtxDestroy(h264->decoder.cu_context);
- h264->decoder.cu_context = NULL;
- }
- if (h264->decoder.dx_d3ddevice){
+ if(h264->decoder.cu_context) {
+ cuCtxDestroy(h264->decoder.cu_context);
+ h264->decoder.cu_context = NULL;
+ }
+ if (h264->decoder.dx_d3ddevice) {
h264->decoder.dx_d3ddevice->Release();
h264->decoder.dx_d3ddevice = NULL;
}
- if (h264->decoder.dx_d3d){
+ if (h264->decoder.dx_d3d) {
h264->decoder.dx_d3d->Release();
h264->decoder.dx_d3d = NULL;
}
- if(h264->decoder.cu_parser){
- cuvidDestroyVideoParser(h264->decoder.cu_parser);
- h264->decoder.cu_parser = NULL;
- }
- if(h264->decoder.cu_buffer){
- cuMemFreeHost(h264->decoder.cu_buffer);
- h264->decoder.cu_buffer = NULL;
- }
- h264->decoder.cu_buffer_size = 0;
- if(self->decoder.mutex){
- tsk_mutex_destroy(&self->decoder.mutex);
- }
-
- TSK_FREE(h264->decoder.accumulator);
- h264->decoder.accumulator_pos = 0;
- h264->decoder.accumulator_size = 0;
-
- return 0;
+ if(h264->decoder.cu_parser) {
+ cuvidDestroyVideoParser(h264->decoder.cu_parser);
+ h264->decoder.cu_parser = NULL;
+ }
+ if(h264->decoder.cu_buffer) {
+ cuMemFreeHost(h264->decoder.cu_buffer);
+ h264->decoder.cu_buffer = NULL;
+ }
+ h264->decoder.cu_buffer_size = 0;
+ if(self->decoder.mutex) {
+ tsk_mutex_destroy(&self->decoder.mutex);
+ }
+
+ TSK_FREE(h264->decoder.accumulator);
+ h264->decoder.accumulator_pos = 0;
+ h264->decoder.accumulator_size = 0;
+
+ return 0;
}
static inline void _tdav_codec_h264_cuda_encap(const tdav_codec_h264_cuda_t* h264, const uint8_t* pdata, tsk_size_t size)
{
- register int32_t i;
- int32_t last_scp, prev_scp;
- static int32_t size_of_scp = sizeof(H264_START_CODE_PREFIX); /* we know it's equal to 4 ..but */
-
- if(!pdata || !size){
- return;
- }
-
- last_scp = 0, prev_scp = 0;
-
- for(i = size_of_scp; i<(int32_t)(size - size_of_scp); i++){
- if(pdata[i] == H264_START_CODE_PREFIX[0] && pdata[i+1] == H264_START_CODE_PREFIX[1] && pdata[i+2] == H264_START_CODE_PREFIX[2] && pdata[i+3] == H264_START_CODE_PREFIX[3]){ /* Found Start Code Prefix */
- prev_scp = last_scp;
- if((i - last_scp) >= H264_RTP_PAYLOAD_SIZE || 1){
- tdav_codec_h264_rtp_callback(TDAV_CODEC_H264_COMMON(h264), pdata + prev_scp,
- (i - prev_scp), (prev_scp == size));
- }
- last_scp = i;
- }
- }
- if(last_scp < (int32_t)size){
- tdav_codec_h264_rtp_callback(TDAV_CODEC_H264_COMMON(h264), pdata + last_scp,
- (size - last_scp), tsk_true);
- }
+ register int32_t i;
+ int32_t last_scp, prev_scp;
+ static int32_t size_of_scp = sizeof(H264_START_CODE_PREFIX); /* we know it's equal to 4 ..but */
+
+ if(!pdata || !size) {
+ return;
+ }
+
+ last_scp = 0, prev_scp = 0;
+
+ for(i = size_of_scp; i<(int32_t)(size - size_of_scp); i++) {
+ if(pdata[i] == H264_START_CODE_PREFIX[0] && pdata[i+1] == H264_START_CODE_PREFIX[1] && pdata[i+2] == H264_START_CODE_PREFIX[2] && pdata[i+3] == H264_START_CODE_PREFIX[3]) { /* Found Start Code Prefix */
+ prev_scp = last_scp;
+ if((i - last_scp) >= H264_RTP_PAYLOAD_SIZE || 1) {
+ tdav_codec_h264_rtp_callback(TDAV_CODEC_H264_COMMON(h264), pdata + prev_scp,
+ (i - prev_scp), (prev_scp == size));
+ }
+ last_scp = i;
+ }
+ }
+ if(last_scp < (int32_t)size) {
+ tdav_codec_h264_rtp_callback(TDAV_CODEC_H264_COMMON(h264), pdata + last_scp,
+ (size - last_scp), tsk_true);
+ }
}
static inline tsk_size_t _tdav_codec_h264_cuda_pict_layout(tdav_codec_h264_cuda_t* self, void**output, tsk_size_t *output_size)
{
- if(self && self->decoder.cu_buffer && self->decoder.cu_buffer_size){
- unsigned int w = TMEDIA_CODEC_VIDEO(self)->in.width;
- unsigned int h = TMEDIA_CODEC_VIDEO(self)->in.height;
- unsigned int pitch = self->decoder.cu_buffer_pitch;
- tsk_size_t xsize = (w * h * 3) >> 1;
- // resize if too short
- if(*output_size<xsize){
- if((*output = tsk_realloc(*output, xsize))){
- *output_size = xsize;
- }
- else{
- *output_size = 0;
- return 0;
- }
- }
-
- tsk_semaphore_decrement(sem);
-
- register unsigned int y;
- register unsigned int x, x2;
+ if(self && self->decoder.cu_buffer && self->decoder.cu_buffer_size) {
+ unsigned int w = TMEDIA_CODEC_VIDEO(self)->in.width;
+ unsigned int h = TMEDIA_CODEC_VIDEO(self)->in.height;
+ unsigned int pitch = self->decoder.cu_buffer_pitch;
+ tsk_size_t xsize = (w * h * 3) >> 1;
+ // resize if too short
+ if(*output_size<xsize) {
+ if((*output = tsk_realloc(*output, xsize))) {
+ *output_size = xsize;
+ }
+ else {
+ *output_size = 0;
+ return 0;
+ }
+ }
+
+ tsk_semaphore_decrement(sem);
+
+ register unsigned int y;
+ register unsigned int x, x2;
const unsigned char *p = (const unsigned char *)self->decoder.cu_buffer;
register unsigned char *iyuv = (unsigned char *)*output, *i = iyuv, *j;
- // copy luma
- for (y=0; y<h; y++){
+ // copy luma
+ for (y=0; y<h; y++) {
memcpy(i+y*w, p+y*pitch, w);
}
- // de-interleave chroma (NV12 stored as U,V,U,V,...)
+ // de-interleave chroma (NV12 stored as U,V,U,V,...)
p += h * pitch;
- i += h * w;
- j = i + (h/2)*(w/2);
- for (y=0; y<h/2; y++){
- for (x=0, x2=0; x<w/2; x++, x2+=2) i[x] = p[x2], j[x] = p[x2+1];
- p += pitch, i += w/2, j += w/2;
+ i += h * w;
+ j = i + (h/2)*(w/2);
+ for (y=0; y<h/2; y++) {
+ for (x=0, x2=0; x<w/2; x++, x2+=2) {
+ i[x] = p[x2], j[x] = p[x2+1];
+ }
+ p += pitch, i += w/2, j += w/2;
}
- tsk_semaphore_increment(sem);
+ tsk_semaphore_increment(sem);
- return xsize;
- }
- return 0;
+ return xsize;
+ }
+ return 0;
}
static int CUDAAPI _NVCallback_HandleVideoSequence(void *pvUserData, CUVIDEOFORMAT *pFormat)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
- if(!h264 || !pFormat){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
-
- int ret = 1;
-
- if(pFormat->coded_width != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != TMEDIA_CODEC_VIDEO(h264)->in.height){
- tsk_mutex_lock(h264->decoder.mutex);
-
- TMEDIA_CODEC_VIDEO(h264)->in.width = pFormat->coded_width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = pFormat->coded_height;
-
- InitH264DecoderInfo(h264);
- CUresult cuResult;
- if(h264->decoder.context){
- cuResult = cuvidDestroyDecoder(h264->decoder.context);
- if(CUDA_SUCCESS != cuResult){
- TSK_DEBUG_ERROR("cuvidDestroyDecoder failed with error code=%d", (int)cuResult);
- ret = 0;
- }
- h264->decoder.context = NULL;
- }
- cuResult = cuvidCreateDecoder(&h264->decoder.context, &h264->decoder.info);
- if(CUDA_SUCCESS != cuResult){
- TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
- ret = 0;
- }
-
- tsk_mutex_unlock(h264->decoder.mutex);
- }
-
-
-
- return ret;//success
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
+ if(!h264 || !pFormat) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
+
+ int ret = 1;
+
+ if(pFormat->coded_width != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != TMEDIA_CODEC_VIDEO(h264)->in.height) {
+ tsk_mutex_lock(h264->decoder.mutex);
+
+ TMEDIA_CODEC_VIDEO(h264)->in.width = pFormat->coded_width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = pFormat->coded_height;
+
+ InitH264DecoderInfo(h264);
+ CUresult cuResult;
+ if(h264->decoder.context) {
+ cuResult = cuvidDestroyDecoder(h264->decoder.context);
+ if(CUDA_SUCCESS != cuResult) {
+ TSK_DEBUG_ERROR("cuvidDestroyDecoder failed with error code=%d", (int)cuResult);
+ ret = 0;
+ }
+ h264->decoder.context = NULL;
+ }
+ cuResult = cuvidCreateDecoder(&h264->decoder.context, &h264->decoder.info);
+ if(CUDA_SUCCESS != cuResult) {
+ TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
+ ret = 0;
+ }
+
+ tsk_mutex_unlock(h264->decoder.mutex);
+ }
+
+
+
+ return ret;//success
}
static int CUDAAPI _NVCallback_HandlePictureDecode(void *pvUserData, CUVIDPICPARAMS *pPicParams)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
- if(!h264 || !pPicParams){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
+ if(!h264 || !pPicParams) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
- tsk_mutex_lock(h264->decoder.mutex);
- CUresult cuResult = cuvidDecodePicture(h264->decoder.context, pPicParams);
- tsk_mutex_unlock(h264->decoder.mutex);
+ tsk_mutex_lock(h264->decoder.mutex);
+ CUresult cuResult = cuvidDecodePicture(h264->decoder.context, pPicParams);
+ tsk_mutex_unlock(h264->decoder.mutex);
- if(cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuvidDecodePicture failed with error code= %d", cuResult);
- return 0;//error
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidDecodePicture failed with error code= %d", cuResult);
+ return 0;//error
}
- return 1;//success
+ return 1;//success
}
static int CUDAAPI _NVCallback_HandlePictureDisplay(void *pvUserData, CUVIDPARSERDISPINFO *pPicParams)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
- CUVIDPROCPARAMS vpp;
- CUdeviceptr devPtr;
- CUresult cuResult;
- tsk_size_t nv12_size;
- tsk_bool_t mapped = tsk_false;
- int ret = 1;//success
-
- if(!h264 || !pPicParams){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;//error
- }
-tsk_semaphore_decrement(sem);
- cuResult = cuCtxPushCurrent(h264->decoder.cu_context);
- if(cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code = %d", (int)cuResult);
- ret = 0;//error
- goto bail;
- }
-
- memset(&vpp, 0, sizeof(vpp));
- vpp.progressive_frame = pPicParams->progressive_frame;
- vpp.top_field_first = pPicParams->top_field_first;
- cuResult = cuvidMapVideoFrame(h264->decoder.context, pPicParams->picture_index, &devPtr, &h264->decoder.cu_buffer_pitch, &vpp);
-
- if(cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuvidMapVideoFrame failed with error code = %d", (int)cuResult);
- ret = 0;//error
- goto bail;
- }
- mapped = tsk_true;
- nv12_size = h264->decoder.cu_buffer_pitch * (h264->decoder.info.ulTargetHeight + h264->decoder.info.ulTargetHeight/2); // 12bpp
- //nv12_size = (w * h * 3) >> 1;
- if ((!h264->decoder.cu_buffer) || (nv12_size > h264->decoder.cu_buffer_size)){
- h264->decoder.cu_buffer_size = 0;
- if (h264->decoder.cu_buffer){
- cuResult = cuMemFreeHost(h264->decoder.cu_buffer);
- h264->decoder.cu_buffer = NULL;
- }
- cuResult = cuMemAllocHost((void**)&h264->decoder.cu_buffer, nv12_size);
- if (cuResult != CUDA_SUCCESS){
- TSK_DEBUG_ERROR("cuMemAllocHost failed to allocate %d bytes (error code=%d)", nv12_size, (int)cuResult);
- h264->decoder.cu_buffer = 0;
- h264->decoder.cu_buffer_size = 0;
- ret = 0;//error
- }
- else{
- h264->decoder.cu_buffer_size = nv12_size;
- }
- }
- if(h264->decoder.cu_buffer){
- cuResult = cuMemcpyDtoH(h264->decoder.cu_buffer, devPtr, nv12_size);
- }
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pvUserData;
+ CUVIDPROCPARAMS vpp;
+ CUdeviceptr devPtr;
+ CUresult cuResult;
+ tsk_size_t nv12_size;
+ tsk_bool_t mapped = tsk_false;
+ int ret = 1;//success
+
+ if(!h264 || !pPicParams) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;//error
+ }
+ tsk_semaphore_decrement(sem);
+ cuResult = cuCtxPushCurrent(h264->decoder.cu_context);
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code = %d", (int)cuResult);
+ ret = 0;//error
+ goto bail;
+ }
+
+ memset(&vpp, 0, sizeof(vpp));
+ vpp.progressive_frame = pPicParams->progressive_frame;
+ vpp.top_field_first = pPicParams->top_field_first;
+ cuResult = cuvidMapVideoFrame(h264->decoder.context, pPicParams->picture_index, &devPtr, &h264->decoder.cu_buffer_pitch, &vpp);
+
+ if(cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuvidMapVideoFrame failed with error code = %d", (int)cuResult);
+ ret = 0;//error
+ goto bail;
+ }
+ mapped = tsk_true;
+ nv12_size = h264->decoder.cu_buffer_pitch * (h264->decoder.info.ulTargetHeight + h264->decoder.info.ulTargetHeight/2); // 12bpp
+ //nv12_size = (w * h * 3) >> 1;
+ if ((!h264->decoder.cu_buffer) || (nv12_size > h264->decoder.cu_buffer_size)) {
+ h264->decoder.cu_buffer_size = 0;
+ if (h264->decoder.cu_buffer) {
+ cuResult = cuMemFreeHost(h264->decoder.cu_buffer);
+ h264->decoder.cu_buffer = NULL;
+ }
+ cuResult = cuMemAllocHost((void**)&h264->decoder.cu_buffer, nv12_size);
+ if (cuResult != CUDA_SUCCESS) {
+ TSK_DEBUG_ERROR("cuMemAllocHost failed to allocate %d bytes (error code=%d)", nv12_size, (int)cuResult);
+ h264->decoder.cu_buffer = 0;
+ h264->decoder.cu_buffer_size = 0;
+ ret = 0;//error
+ }
+ else {
+ h264->decoder.cu_buffer_size = nv12_size;
+ }
+ }
+ if(h264->decoder.cu_buffer) {
+ cuResult = cuMemcpyDtoH(h264->decoder.cu_buffer, devPtr, nv12_size);
+ }
bail:
- if(mapped){
- cuResult = cuvidUnmapVideoFrame(h264->decoder.context, devPtr);
- }
- cuResult = cuCtxPopCurrent(NULL);
-tsk_semaphore_increment(sem);
- h264->decoder.cu_buffer_avail = (ret == 1);
- return ret;
+ if(mapped) {
+ cuResult = cuvidUnmapVideoFrame(h264->decoder.context, devPtr);
+ }
+ cuResult = cuCtxPopCurrent(NULL);
+ tsk_semaphore_increment(sem);
+ h264->decoder.cu_buffer_avail = (ret == 1);
+ return ret;
}
static unsigned char* CUDAAPI _NVCallback_HandleAcquireBitStream(int *pBufferSize, void *pUserdata)
{
- tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pUserdata;
- if(!h264 || !pBufferSize){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- *pBufferSize = (int)h264->encoder.buffer_size;
- return (unsigned char*)h264->encoder.buffer;
+ tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pUserdata;
+ if(!h264 || !pBufferSize) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ *pBufferSize = (int)h264->encoder.buffer_size;
+ return (unsigned char*)h264->encoder.buffer;
}
static void CUDAAPI _NVCallback_HandleReleaseBitStream(int nBytesInBuffer, unsigned char *cb,void *pUserdata)
{
tdav_codec_h264_cuda_t* h264 = (tdav_codec_h264_cuda_t*)pUserdata;
- if(!h264 || !cb || !nBytesInBuffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
- _tdav_codec_h264_cuda_encap(h264, cb, (tsk_size_t)nBytesInBuffer);
-
+ if(!h264 || !cb || !nBytesInBuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+ _tdav_codec_h264_cuda_encap(h264, cb, (tsk_size_t)nBytesInBuffer);
+
return;
}
@@ -941,60 +1020,58 @@ static void CUDAAPI _NVCallback_HandleOnEndFrame(const NVVE_EndFrameInfo *pefi,
/* constructor */
static tsk_object_t* tdav_codec_h264_cuda_bp10_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp10);
- }
- return self;
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp10);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_cuda_bp10_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_cuda_deinit(h264);
- }
-
- return self;
+{
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_cuda_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_cuda_bp10_def_s =
-{
- sizeof(tdav_codec_h264_cuda_t),
- tdav_codec_h264_cuda_bp10_ctor,
- tdav_codec_h264_cuda_bp10_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_cuda_bp10_def_s = {
+ sizeof(tdav_codec_h264_cuda_t),
+ tdav_codec_h264_cuda_bp10_ctor,
+ tdav_codec_h264_cuda_bp10_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp10_plugin_def_s =
-{
- &tdav_codec_h264_cuda_bp10_def_s,
-
- tmedia_video,
- "H264",
- "H264 Base Profile 1.0 using CUDA",
- TMEDIA_CODEC_FORMAT_H264_BP10,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {176, 144, 15},
-
- tdav_codec_h264_cuda_open,
- tdav_codec_h264_cuda_close,
- tdav_codec_h264_cuda_encode,
- tdav_codec_h264_cuda_decode,
- tdav_codec_h264_cuda_sdp_att_match,
- tdav_codec_h264_cuda_sdp_att_get,
- tdav_codec_h264_cuda_fmtp_set
+static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp10_plugin_def_s = {
+ &tdav_codec_h264_cuda_bp10_def_s,
+
+ tmedia_video,
+ "H264",
+ "H264 Base Profile 1.0 using CUDA",
+ TMEDIA_CODEC_FORMAT_H264_BP10,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {176, 144, 15},
+
+ tdav_codec_h264_cuda_open,
+ tdav_codec_h264_cuda_close,
+ tdav_codec_h264_cuda_encode,
+ tdav_codec_h264_cuda_decode,
+ tdav_codec_h264_cuda_sdp_att_match,
+ tdav_codec_h264_cuda_sdp_att_get,
+ tdav_codec_h264_cuda_fmtp_set
};
extern const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp10_plugin_def_t = &tdav_codec_h264_cuda_bp10_plugin_def_s;
@@ -1004,61 +1081,59 @@ extern const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp10_plugin_def_t =
/* constructor */
static tsk_object_t* tdav_codec_h264_cuda_bp20_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp20);
- }
- return self;
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp20);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_cuda_bp20_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_cuda_deinit(h264);
-
- }
-
- return self;
+{
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_cuda_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_cuda_bp20_def_s =
-{
- sizeof(tdav_codec_h264_cuda_t),
- tdav_codec_h264_cuda_bp20_ctor,
- tdav_codec_h264_cuda_bp20_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_cuda_bp20_def_s = {
+ sizeof(tdav_codec_h264_cuda_t),
+ tdav_codec_h264_cuda_bp20_ctor,
+ tdav_codec_h264_cuda_bp20_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp20_plugin_def_s =
-{
- &tdav_codec_h264_cuda_bp20_def_s,
-
- tmedia_video,
- "H264",
- "H264 Base Profile 2.0 using CUDA",
- TMEDIA_CODEC_FORMAT_H264_BP20,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {352, 288, 15},
-
- tdav_codec_h264_cuda_open,
- tdav_codec_h264_cuda_close,
- tdav_codec_h264_cuda_encode,
- tdav_codec_h264_cuda_decode,
- tdav_codec_h264_cuda_sdp_att_match,
- tdav_codec_h264_cuda_sdp_att_get,
- tdav_codec_h264_cuda_fmtp_set
+static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp20_plugin_def_s = {
+ &tdav_codec_h264_cuda_bp20_def_s,
+
+ tmedia_video,
+ "H264",
+ "H264 Base Profile 2.0 using CUDA",
+ TMEDIA_CODEC_FORMAT_H264_BP20,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {352, 288, 15},
+
+ tdav_codec_h264_cuda_open,
+ tdav_codec_h264_cuda_close,
+ tdav_codec_h264_cuda_encode,
+ tdav_codec_h264_cuda_decode,
+ tdav_codec_h264_cuda_sdp_att_match,
+ tdav_codec_h264_cuda_sdp_att_get,
+ tdav_codec_h264_cuda_fmtp_set
};
extern const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp20_plugin_def_t = &tdav_codec_h264_cuda_bp20_plugin_def_s;
@@ -1068,61 +1143,59 @@ extern const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp20_plugin_def_t =
/* constructor */
static tsk_object_t* tdav_codec_h264_cuda_bp30_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp30);
- }
- return self;
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ tdav_codec_h264_cuda_init(h264, tdav_codec_h264_bp30);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_cuda_bp30_dtor(tsk_object_t * self)
-{
- tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
- if(h264){
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_cuda_deinit(h264);
-
- }
-
- return self;
+{
+ tdav_codec_h264_cuda_t *h264 = (tdav_codec_h264_cuda_t *)self;
+ if(h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_cuda_deinit(h264);
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_cuda_bp30_def_s =
-{
- sizeof(tdav_codec_h264_cuda_t),
- tdav_codec_h264_cuda_bp30_ctor,
- tdav_codec_h264_cuda_bp30_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_cuda_bp30_def_s = {
+ sizeof(tdav_codec_h264_cuda_t),
+ tdav_codec_h264_cuda_bp30_ctor,
+ tdav_codec_h264_cuda_bp30_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp30_plugin_def_s =
-{
- &tdav_codec_h264_cuda_bp30_def_s,
-
- tmedia_video,
- "H264",
- "H264 Base Profile 3.0 using CUDA",
- TMEDIA_CODEC_FORMAT_H264_BP30,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {352, 288, 15},
-
- tdav_codec_h264_cuda_open,
- tdav_codec_h264_cuda_close,
- tdav_codec_h264_cuda_encode,
- tdav_codec_h264_cuda_decode,
- tdav_codec_h264_cuda_sdp_att_match,
- tdav_codec_h264_cuda_sdp_att_get,
- tdav_codec_h264_cuda_fmtp_set
+static const tmedia_codec_plugin_def_t tdav_codec_h264_cuda_bp30_plugin_def_s = {
+ &tdav_codec_h264_cuda_bp30_def_s,
+
+ tmedia_video,
+ "H264",
+ "H264 Base Profile 3.0 using CUDA",
+ TMEDIA_CODEC_FORMAT_H264_BP30,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {352, 288, 15},
+
+ tdav_codec_h264_cuda_open,
+ tdav_codec_h264_cuda_close,
+ tdav_codec_h264_cuda_encode,
+ tdav_codec_h264_cuda_decode,
+ tdav_codec_h264_cuda_sdp_att_match,
+ tdav_codec_h264_cuda_sdp_att_get,
+ tdav_codec_h264_cuda_fmtp_set
};
extern const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp30_plugin_def_t = &tdav_codec_h264_cuda_bp30_plugin_def_s;
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264_intel.cxx b/tinyDAV/src/codecs/h264/tdav_codec_h264_intel.cxx
index 49f9e1c..7ef6b2c 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264_intel.cxx
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264_intel.cxx
@@ -76,9 +76,9 @@
static mfxIMPL __IntelDefaultImpl = MFX_IMPL_AUTO_ANY
#if INTEL_DX11_D3D
-| MFX_IMPL_VIA_D3D11
+ | MFX_IMPL_VIA_D3D11
#endif
-;
+ ;
static mfxVersion __IntelDefaultVer = { 0, 1 };
// TODO: Test against FFmpeg, CUDA, OpenH264 and Microsoft implementations
@@ -87,40 +87,39 @@ static mfxVersion __IntelDefaultVer = { 0, 1 };
class IntelCodecEncoder;
class IntelCodecDecoder;
-typedef struct tdav_codec_h264_intel_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
+typedef struct tdav_codec_h264_intel_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
- MFXVideoSession* mfxSession;
+ MFXVideoSession* mfxSession;
- // DX11_D3D
+ // DX11_D3D
#if INTEL_DX11_D3D
- mfxFrameAllocResponse D3D11SavedAllocResponses[2/*Encode=0, Decode=1*/];
- mfxFrameAllocator D3D11Allocator;
-
- CComPtr<ID3D11Device> pD3D11Device;
- CComPtr<ID3D11DeviceContext> pD3D11Ctx;
- CComPtr<IDXGIAdapter>pAdapter;
- CComPtr<IDXGIFactory1> pDXGIFactory;
- CComPtr<IDXGIAdapter> hAdapter;
+ mfxFrameAllocResponse D3D11SavedAllocResponses[2/*Encode=0, Decode=1*/];
+ mfxFrameAllocator D3D11Allocator;
+
+ CComPtr<ID3D11Device> pD3D11Device;
+ CComPtr<ID3D11DeviceContext> pD3D11Ctx;
+ CComPtr<IDXGIAdapter>pAdapter;
+ CComPtr<IDXGIFactory1> pDXGIFactory;
+ CComPtr<IDXGIAdapter> hAdapter;
#endif
- // Encoder
- struct{
- IntelCodecEncoder *pInst;
- int64_t frame_count;
- tsk_bool_t force_idr;
- int rotation;
- int neg_width;
- int neg_height;
- int neg_fps;
- int max_bitrate_bps;
- } encoder;
-
- // decoder
- struct{
- IntelCodecDecoder *pInst;
- } decoder;
+ // Encoder
+ struct {
+ IntelCodecEncoder *pInst;
+ int64_t frame_count;
+ tsk_bool_t force_idr;
+ int rotation;
+ int neg_width;
+ int neg_height;
+ int neg_fps;
+ int max_bitrate_bps;
+ } encoder;
+
+ // decoder
+ struct {
+ IntelCodecDecoder *pInst;
+ } decoder;
}
tdav_codec_h264_intel_t;
@@ -140,19 +139,19 @@ static int tdav_codec_h264_intel_close_decoder(tdav_codec_h264_intel_t* self);
#define D3D11_WILL_WRITE 0x2000
typedef struct {
- mfxMemId memId;
- mfxMemId memIdStage;
- mfxU16 rw;
+ mfxMemId memId;
+ mfxMemId memIdStage;
+ mfxU16 rw;
} CustomMemId;
const struct {
- mfxIMPL impl; // actual implementation
- mfxU32 adapterID; // device adapter number
+ mfxIMPL impl; // actual implementation
+ mfxU32 adapterID; // device adapter number
} implTypes[] = {
- { MFX_IMPL_HARDWARE, 0 },
- { MFX_IMPL_HARDWARE2, 1 },
- { MFX_IMPL_HARDWARE3, 2 },
- { MFX_IMPL_HARDWARE4, 3 }
+ { MFX_IMPL_HARDWARE, 0 },
+ { MFX_IMPL_HARDWARE2, 1 },
+ { MFX_IMPL_HARDWARE3, 2 },
+ { MFX_IMPL_HARDWARE4, 3 }
};
static mfxStatus D3D11_CreateHWDevice(mfxHDL pthis, mfxSession session, mfxHDL* deviceHandle, HWND hWnd);
@@ -174,245 +173,225 @@ static mfxStatus D3D11_SimpleFree(mfxHDL pthis, mfxFrameAllocResponse *response)
class IntelCodec
{
protected:
- IntelCodec(MFXVideoSession* pSession)
- : m_bOpened(false)
- , m_pSession(pSession)
- , n_nNumSurfaces(0)
- , m_nSurfaceWidth(0)
- , m_nSurfaceHeight(0)
- , m_nSurfaceBitsPerPixel(0)
- , m_nSurfaceSize(0)
- , m_pSurfaceBuffers(NULL)
- , m_ppSurfacePtrs(NULL)
- {
- memset(&m_sBitstream, 0, sizeof(m_sBitstream));
- memset(&m_sParamReq, 0, sizeof(m_sParamReq));
- memset(&m_sParamSel, 0, sizeof(m_sParamSel));
- memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
- }
+ IntelCodec(MFXVideoSession* pSession)
+ : m_bOpened(false)
+ , m_pSession(pSession)
+ , n_nNumSurfaces(0)
+ , m_nSurfaceWidth(0)
+ , m_nSurfaceHeight(0)
+ , m_nSurfaceBitsPerPixel(0)
+ , m_nSurfaceSize(0)
+ , m_pSurfaceBuffers(NULL)
+ , m_ppSurfacePtrs(NULL) {
+ memset(&m_sBitstream, 0, sizeof(m_sBitstream));
+ memset(&m_sParamReq, 0, sizeof(m_sParamReq));
+ memset(&m_sParamSel, 0, sizeof(m_sParamSel));
+ memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
+ }
public:
- virtual ~IntelCodec()
- {
- Close();
- }
- virtual mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec) = 0;
+ virtual ~IntelCodec() {
+ Close();
+ }
+ virtual mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec) = 0;
- virtual mfxStatus Close()
- {
- DeAllocSurfaces();
- DeAllocateBitstream();
+ virtual mfxStatus Close() {
+ DeAllocSurfaces();
+ DeAllocateBitstream();
- memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
+ memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
- m_bOpened = false;
+ m_bOpened = false;
- return MFX_ERR_NONE;
- }
+ return MFX_ERR_NONE;
+ }
protected:
- int GetFreeSurfaceIndex()
- {
- if (m_ppSurfacePtrs)
- {
- for (mfxU16 i = 0; i < n_nNumSurfaces; i++)
- {
- if (0 == m_ppSurfacePtrs[i]->Data.Locked)
- {
- return i;
- }
- }
- }
- return MFX_ERR_NOT_FOUND;
- }
-
- mfxStatus ReadPlaneData(mfxU16 w, mfxU16 h, mfxU8 *buf, mfxU8 *ptr, mfxU16 pitch, mfxU16 offset, const mfxU8* &src)
- {
- for (mfxU16 i = 0; i < h; i++)
- {
- memcpy(buf, src, w);
- src += w;
-
- for (mfxU16 j = 0; j < w; j++)
- ptr[i * pitch + j * 2 + offset] = buf[j];
- }
- return MFX_ERR_NONE;
- }
-
- mfxStatus LoadRawFrame(int nSurfaceIndex, const mfxU8* src)
- {
- mfxFrameSurface1* pSurface = (m_ppSurfacePtrs && nSurfaceIndex >= 0 && nSurfaceIndex < n_nNumSurfaces) ? m_ppSurfacePtrs[nSurfaceIndex] : NULL;
- if (!pSurface)
- {
- INTEL_DEBUG_ERROR("Failed to find surface at index=%d", nSurfaceIndex);
- return MFX_ERR_NOT_FOUND;
- }
-
- mfxStatus sts = MFX_ERR_NONE;
- mfxU16 w, h, i, pitch;
- mfxU8 *ptr;
- mfxFrameInfo* pInfo = &pSurface->Info;
- mfxFrameData* pData = &pSurface->Data;
-
- if (pInfo->CropH > 0 && pInfo->CropW > 0) {
- w = pInfo->CropW;
- h = pInfo->CropH;
- }
- else {
- w = pInfo->Width;
- h = pInfo->Height;
- }
-
- pitch = pData->Pitch;
- ptr = pData->Y + pInfo->CropX + pInfo->CropY * pData->Pitch;
-
- // read luminance plane
- for (i = 0; i < h; i++)
- {
- memcpy(ptr + i * pitch, src, w);
- src += w;
- }
-
- mfxU8 buf[2048]; // maximum supported chroma width for nv12
- w /= 2;
- h /= 2;
- ptr = pData->UV + pInfo->CropX + (pInfo->CropY / 2) * pitch;
- if (w > 2048)
- return MFX_ERR_UNSUPPORTED;
-
- // load U
- sts = ReadPlaneData(w, h, buf, ptr, pitch, 0, src);
- if (MFX_ERR_NONE != sts) return sts;
- // load V
- sts = ReadPlaneData(w, h, buf, ptr, pitch, 1, src);
- if (MFX_ERR_NONE != sts) return sts;
-
- return MFX_ERR_NONE;
- }
-
- virtual mfxStatus AllocSurfaces(mfxU16 nNumSurfaces, mfxU16 nSurfaceWidth, mfxU16 nSurfaceHeight, const mfxFrameInfo* pcFrameInfo)
- {
- mfxStatus status = MFX_ERR_UNKNOWN;
-
- INTEL_DEBUG_INFO("Alloc surfaces: num=%u, width=%u, height=%u", nNumSurfaces, nSurfaceWidth, nSurfaceHeight);
-
- DeAllocSurfaces();
-
- n_nNumSurfaces = nNumSurfaces;
- m_nSurfaceWidth = (mfxU16)INTEL_ALIGN32(nSurfaceWidth);
- m_nSurfaceHeight = (mfxU16)INTEL_ALIGN32(nSurfaceHeight);
- m_nSurfaceBitsPerPixel = 12; // NV12 format is a 12 bits per pixel format
- m_nSurfaceSize = m_nSurfaceWidth * m_nSurfaceHeight * m_nSurfaceBitsPerPixel / 8;
+ int GetFreeSurfaceIndex() {
+ if (m_ppSurfacePtrs) {
+ for (mfxU16 i = 0; i < n_nNumSurfaces; i++) {
+ if (0 == m_ppSurfacePtrs[i]->Data.Locked) {
+ return i;
+ }
+ }
+ }
+ return MFX_ERR_NOT_FOUND;
+ }
+
+ mfxStatus ReadPlaneData(mfxU16 w, mfxU16 h, mfxU8 *buf, mfxU8 *ptr, mfxU16 pitch, mfxU16 offset, const mfxU8* &src) {
+ for (mfxU16 i = 0; i < h; i++) {
+ memcpy(buf, src, w);
+ src += w;
+
+ for (mfxU16 j = 0; j < w; j++) {
+ ptr[i * pitch + j * 2 + offset] = buf[j];
+ }
+ }
+ return MFX_ERR_NONE;
+ }
+
+ mfxStatus LoadRawFrame(int nSurfaceIndex, const mfxU8* src) {
+ mfxFrameSurface1* pSurface = (m_ppSurfacePtrs && nSurfaceIndex >= 0 && nSurfaceIndex < n_nNumSurfaces) ? m_ppSurfacePtrs[nSurfaceIndex] : NULL;
+ if (!pSurface) {
+ INTEL_DEBUG_ERROR("Failed to find surface at index=%d", nSurfaceIndex);
+ return MFX_ERR_NOT_FOUND;
+ }
+
+ mfxStatus sts = MFX_ERR_NONE;
+ mfxU16 w, h, i, pitch;
+ mfxU8 *ptr;
+ mfxFrameInfo* pInfo = &pSurface->Info;
+ mfxFrameData* pData = &pSurface->Data;
+
+ if (pInfo->CropH > 0 && pInfo->CropW > 0) {
+ w = pInfo->CropW;
+ h = pInfo->CropH;
+ }
+ else {
+ w = pInfo->Width;
+ h = pInfo->Height;
+ }
+
+ pitch = pData->Pitch;
+ ptr = pData->Y + pInfo->CropX + pInfo->CropY * pData->Pitch;
+
+ // read luminance plane
+ for (i = 0; i < h; i++) {
+ memcpy(ptr + i * pitch, src, w);
+ src += w;
+ }
+
+ mfxU8 buf[2048]; // maximum supported chroma width for nv12
+ w /= 2;
+ h /= 2;
+ ptr = pData->UV + pInfo->CropX + (pInfo->CropY / 2) * pitch;
+ if (w > 2048) {
+ return MFX_ERR_UNSUPPORTED;
+ }
+
+ // load U
+ sts = ReadPlaneData(w, h, buf, ptr, pitch, 0, src);
+ if (MFX_ERR_NONE != sts) {
+ return sts;
+ }
+ // load V
+ sts = ReadPlaneData(w, h, buf, ptr, pitch, 1, src);
+ if (MFX_ERR_NONE != sts) {
+ return sts;
+ }
+
+ return MFX_ERR_NONE;
+ }
+
+ virtual mfxStatus AllocSurfaces(mfxU16 nNumSurfaces, mfxU16 nSurfaceWidth, mfxU16 nSurfaceHeight, const mfxFrameInfo* pcFrameInfo) {
+ mfxStatus status = MFX_ERR_UNKNOWN;
+
+ INTEL_DEBUG_INFO("Alloc surfaces: num=%u, width=%u, height=%u", nNumSurfaces, nSurfaceWidth, nSurfaceHeight);
+
+ DeAllocSurfaces();
+
+ n_nNumSurfaces = nNumSurfaces;
+ m_nSurfaceWidth = (mfxU16)INTEL_ALIGN32(nSurfaceWidth);
+ m_nSurfaceHeight = (mfxU16)INTEL_ALIGN32(nSurfaceHeight);
+ m_nSurfaceBitsPerPixel = 12; // NV12 format is a 12 bits per pixel format
+ m_nSurfaceSize = m_nSurfaceWidth * m_nSurfaceHeight * m_nSurfaceBitsPerPixel / 8;
#if !INTEL_DX11_D3D
- if (!(m_pSurfaceBuffers = (mfxU8 *)new mfxU8[m_nSurfaceSize * n_nNumSurfaces]))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
+ if (!(m_pSurfaceBuffers = (mfxU8 *)new mfxU8[m_nSurfaceSize * n_nNumSurfaces])) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
#endif
- if (!(m_ppSurfacePtrs = new mfxFrameSurface1*[n_nNumSurfaces]))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
- for (mfxU16 i = 0; i < n_nNumSurfaces; i++)
- {
- if (!(m_ppSurfacePtrs[i] = new mfxFrameSurface1))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
- memset(m_ppSurfacePtrs[i], 0, sizeof(mfxFrameSurface1));
- memcpy(&(m_ppSurfacePtrs[i]->Info), pcFrameInfo, sizeof(mfxFrameInfo));
+ if (!(m_ppSurfacePtrs = new mfxFrameSurface1*[n_nNumSurfaces])) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+ for (mfxU16 i = 0; i < n_nNumSurfaces; i++) {
+ if (!(m_ppSurfacePtrs[i] = new mfxFrameSurface1)) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+ memset(m_ppSurfacePtrs[i], 0, sizeof(mfxFrameSurface1));
+ memcpy(&(m_ppSurfacePtrs[i]->Info), pcFrameInfo, sizeof(mfxFrameInfo));
#if INTEL_DX11_D3D
- m_ppSurfacePtrs[i]->Data.MemId = m_sD3D11Response.mids[i]; // MID (memory id) represent one D3D NV12 surface
+ m_ppSurfacePtrs[i]->Data.MemId = m_sD3D11Response.mids[i]; // MID (memory id) represent one D3D NV12 surface
#else
- m_ppSurfacePtrs[i]->Data.Y = &m_pSurfaceBuffers[m_nSurfaceSize * i];
- m_ppSurfacePtrs[i]->Data.U = m_ppSurfacePtrs[i]->Data.Y + m_nSurfaceWidth * m_nSurfaceHeight;
- m_ppSurfacePtrs[i]->Data.V = m_ppSurfacePtrs[i]->Data.U + 1;
- m_ppSurfacePtrs[i]->Data.Pitch = m_nSurfaceWidth;
+ m_ppSurfacePtrs[i]->Data.Y = &m_pSurfaceBuffers[m_nSurfaceSize * i];
+ m_ppSurfacePtrs[i]->Data.U = m_ppSurfacePtrs[i]->Data.Y + m_nSurfaceWidth * m_nSurfaceHeight;
+ m_ppSurfacePtrs[i]->Data.V = m_ppSurfacePtrs[i]->Data.U + 1;
+ m_ppSurfacePtrs[i]->Data.Pitch = m_nSurfaceWidth;
#endif
- }
+ }
- return MFX_ERR_NONE;
+ return MFX_ERR_NONE;
- bail:
- DeAllocSurfaces();
- return status;
- }
+bail:
+ DeAllocSurfaces();
+ return status;
+ }
- mfxStatus AllocateBitstream(mfxU32 nMaxLength)
- {
- DeAllocateBitstream();
+ mfxStatus AllocateBitstream(mfxU32 nMaxLength) {
+ DeAllocateBitstream();
- m_sBitstream.MaxLength = nMaxLength;
- if (!(m_sBitstream.Data = new mfxU8[nMaxLength]))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
+ m_sBitstream.MaxLength = nMaxLength;
+ if (!(m_sBitstream.Data = new mfxU8[nMaxLength])) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
- return MFX_ERR_NONE;
+ return MFX_ERR_NONE;
- bail:
- return MFX_ERR_MEMORY_ALLOC;
- }
+bail:
+ return MFX_ERR_MEMORY_ALLOC;
+ }
private:
- mfxStatus DeAllocSurfaces()
- {
- if (m_ppSurfacePtrs)
- {
- for (mfxU16 i = 0; i < n_nNumSurfaces; i++)
- {
- if (m_ppSurfacePtrs[i])
- {
- delete m_ppSurfacePtrs[i];
- }
- }
- delete[] m_ppSurfacePtrs;
- m_ppSurfacePtrs = NULL;
- }
- n_nNumSurfaces = 0;
-
- if (m_pSurfaceBuffers)
- {
- delete[] m_pSurfaceBuffers;
- m_pSurfaceBuffers = NULL;
- }
-
- m_nSurfaceWidth = 0;
- m_nSurfaceHeight = 0;
- m_nSurfaceBitsPerPixel = 0;
- m_nSurfaceSize = 0;
-
- return MFX_ERR_NONE;
- }
-
- mfxStatus DeAllocateBitstream()
- {
- if (m_sBitstream.Data)
- {
- delete[]m_sBitstream.Data;
- }
- memset(&m_sBitstream, 0, sizeof(m_sBitstream));
-
- return MFX_ERR_NONE;
- }
+ mfxStatus DeAllocSurfaces() {
+ if (m_ppSurfacePtrs) {
+ for (mfxU16 i = 0; i < n_nNumSurfaces; i++) {
+ if (m_ppSurfacePtrs[i]) {
+ delete m_ppSurfacePtrs[i];
+ }
+ }
+ delete[] m_ppSurfacePtrs;
+ m_ppSurfacePtrs = NULL;
+ }
+ n_nNumSurfaces = 0;
+
+ if (m_pSurfaceBuffers) {
+ delete[] m_pSurfaceBuffers;
+ m_pSurfaceBuffers = NULL;
+ }
+
+ m_nSurfaceWidth = 0;
+ m_nSurfaceHeight = 0;
+ m_nSurfaceBitsPerPixel = 0;
+ m_nSurfaceSize = 0;
+
+ return MFX_ERR_NONE;
+ }
+
+ mfxStatus DeAllocateBitstream() {
+ if (m_sBitstream.Data) {
+ delete[]m_sBitstream.Data;
+ }
+ memset(&m_sBitstream, 0, sizeof(m_sBitstream));
+
+ return MFX_ERR_NONE;
+ }
protected:
- bool m_bOpened;
- MFXVideoSession* m_pSession;
- mfxU16 n_nNumSurfaces;
- mfxU16 m_nSurfaceWidth;
- mfxU16 m_nSurfaceHeight;
- mfxU8 m_nSurfaceBitsPerPixel;
- mfxU32 m_nSurfaceSize;
- mfxU8* m_pSurfaceBuffers; // mfxU8[];
- mfxFrameSurface1** m_ppSurfacePtrs; // mfxFrameSurface1[]
- mfxBitstream m_sBitstream;
- mfxVideoParam m_sParamReq; // requested params
- mfxVideoParam m_sParamSel; // selected params
- mfxFrameAllocRequest m_sAllocRequest;
+ bool m_bOpened;
+ MFXVideoSession* m_pSession;
+ mfxU16 n_nNumSurfaces;
+ mfxU16 m_nSurfaceWidth;
+ mfxU16 m_nSurfaceHeight;
+ mfxU8 m_nSurfaceBitsPerPixel;
+ mfxU32 m_nSurfaceSize;
+ mfxU8* m_pSurfaceBuffers; // mfxU8[];
+ mfxFrameSurface1** m_ppSurfacePtrs; // mfxFrameSurface1[]
+ mfxBitstream m_sBitstream;
+ mfxVideoParam m_sParamReq; // requested params
+ mfxVideoParam m_sParamSel; // selected params
+ mfxFrameAllocRequest m_sAllocRequest;
#if INTEL_DX11_D3D
- mfxFrameAllocResponse m_sD3D11Response;
+ mfxFrameAllocResponse m_sD3D11Response;
#endif
};
@@ -423,349 +402,315 @@ protected:
class IntelCodecEncoder : public IntelCodec
{
public:
- IntelCodecEncoder(MFXVideoSession* pSession)
- : IntelCodec(pSession)
- , m_Inst(*pSession)
- {
- memset(&m_sFrameCtrl, 0, sizeof(m_sFrameCtrl));
- }
- virtual ~IntelCodecEncoder()
- {
- Close();
- }
-
- virtual mfxStatus Close()
- {
- m_Inst.Close();
- memset(&m_sFrameCtrl, 0, sizeof(m_sFrameCtrl));
- return IntelCodec::Close();
- }
-
- mfxStatus Reset()
- {
- if (m_bOpened)
- {
- return m_Inst.Reset(&m_sParamSel);
- }
- return MFX_ERR_NONE;
- }
-
- mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec)
- {
- int32_t max_bw_kpbs;
- tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
- mfxStatus status = MFX_ERR_UNKNOWN;
- mfxU16 uSelWidth, uSelHeight;
-
- pWrappedCodec->encoder.neg_width = (pWrappedCodec->encoder.rotation == 90 || pWrappedCodec->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height : TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width;
- pWrappedCodec->encoder.neg_height = (pWrappedCodec->encoder.rotation == 90 || pWrappedCodec->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width : TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height;
- pWrappedCodec->encoder.neg_fps = TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.fps;
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(pWrappedCodec->encoder.neg_width, pWrappedCodec->encoder.neg_height, pWrappedCodec->encoder.neg_fps),
- TMEDIA_CODEC(pWrappedCodec)->bandwidth_max_upload
- );
- pWrappedCodec->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
-
- INTEL_DEBUG_INFO("neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
- pWrappedCodec->encoder.neg_width,
- pWrappedCodec->encoder.neg_height,
- pWrappedCodec->encoder.neg_fps,
- pWrappedCodec->encoder.max_bitrate_bps
- );
-
- // Initialize encoder parameters
- memset(&m_sParamReq, 0, sizeof(m_sParamReq));
- m_sParamReq.mfx.CodecId = MFX_CODEC_AVC;
- m_sParamReq.mfx.CodecProfile = pWrappedCodecCommon->profile == profile_idc_main ? MFX_PROFILE_AVC_MAIN : MFX_PROFILE_AVC_BASELINE;
- m_sParamReq.mfx.CodecLevel = (mfxU16)pWrappedCodecCommon->level;
- // TODO: Update "CodecProfile" based on "common->profile_iop"
- m_sParamReq.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED;
- m_sParamReq.mfx.TargetKbps = max_bw_kpbs;
- m_sParamReq.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
- m_sParamReq.mfx.IdrInterval = (pWrappedCodec->encoder.neg_fps * INTEL_H264_GOP_SIZE_IN_SECONDS);
- m_sParamReq.mfx.FrameInfo.FrameRateExtN = pWrappedCodec->encoder.neg_fps;
- m_sParamReq.mfx.FrameInfo.FrameRateExtD = 1;
- m_sParamReq.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
- m_sParamReq.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
- m_sParamReq.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
- m_sParamReq.mfx.FrameInfo.CropX = 0;
- m_sParamReq.mfx.FrameInfo.CropY = 0;
- m_sParamReq.mfx.FrameInfo.CropW = pWrappedCodec->encoder.neg_width;
- m_sParamReq.mfx.FrameInfo.CropH = pWrappedCodec->encoder.neg_height;
- m_sParamReq.mfx.FrameInfo.Width = INTEL_ALIGN16(pWrappedCodec->encoder.neg_width); // must be a multiple of 16
- m_sParamReq.mfx.FrameInfo.Height = INTEL_ALIGN16(pWrappedCodec->encoder.neg_height); // must be a multiple of 16
+ IntelCodecEncoder(MFXVideoSession* pSession)
+ : IntelCodec(pSession)
+ , m_Inst(*pSession) {
+ memset(&m_sFrameCtrl, 0, sizeof(m_sFrameCtrl));
+ }
+ virtual ~IntelCodecEncoder() {
+ Close();
+ }
+
+ virtual mfxStatus Close() {
+ m_Inst.Close();
+ memset(&m_sFrameCtrl, 0, sizeof(m_sFrameCtrl));
+ return IntelCodec::Close();
+ }
+
+ mfxStatus Reset() {
+ if (m_bOpened) {
+ return m_Inst.Reset(&m_sParamSel);
+ }
+ return MFX_ERR_NONE;
+ }
+
+ mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec) {
+ int32_t max_bw_kpbs;
+ tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
+ mfxStatus status = MFX_ERR_UNKNOWN;
+ mfxU16 uSelWidth, uSelHeight;
+
+ pWrappedCodec->encoder.neg_width = (pWrappedCodec->encoder.rotation == 90 || pWrappedCodec->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height : TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width;
+ pWrappedCodec->encoder.neg_height = (pWrappedCodec->encoder.rotation == 90 || pWrappedCodec->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width : TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height;
+ pWrappedCodec->encoder.neg_fps = TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.fps;
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(pWrappedCodec->encoder.neg_width, pWrappedCodec->encoder.neg_height, pWrappedCodec->encoder.neg_fps),
+ TMEDIA_CODEC(pWrappedCodec)->bandwidth_max_upload
+ );
+ pWrappedCodec->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
+
+ INTEL_DEBUG_INFO("neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
+ pWrappedCodec->encoder.neg_width,
+ pWrappedCodec->encoder.neg_height,
+ pWrappedCodec->encoder.neg_fps,
+ pWrappedCodec->encoder.max_bitrate_bps
+ );
+
+ // Initialize encoder parameters
+ memset(&m_sParamReq, 0, sizeof(m_sParamReq));
+ m_sParamReq.mfx.CodecId = MFX_CODEC_AVC;
+ m_sParamReq.mfx.CodecProfile = pWrappedCodecCommon->profile == profile_idc_main ? MFX_PROFILE_AVC_MAIN : MFX_PROFILE_AVC_BASELINE;
+ m_sParamReq.mfx.CodecLevel = (mfxU16)pWrappedCodecCommon->level;
+ // TODO: Update "CodecProfile" based on "common->profile_iop"
+ m_sParamReq.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED;
+ m_sParamReq.mfx.TargetKbps = max_bw_kpbs;
+ m_sParamReq.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
+ m_sParamReq.mfx.IdrInterval = (pWrappedCodec->encoder.neg_fps * INTEL_H264_GOP_SIZE_IN_SECONDS);
+ m_sParamReq.mfx.FrameInfo.FrameRateExtN = pWrappedCodec->encoder.neg_fps;
+ m_sParamReq.mfx.FrameInfo.FrameRateExtD = 1;
+ m_sParamReq.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
+ m_sParamReq.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
+ m_sParamReq.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
+ m_sParamReq.mfx.FrameInfo.CropX = 0;
+ m_sParamReq.mfx.FrameInfo.CropY = 0;
+ m_sParamReq.mfx.FrameInfo.CropW = pWrappedCodec->encoder.neg_width;
+ m_sParamReq.mfx.FrameInfo.CropH = pWrappedCodec->encoder.neg_height;
+ m_sParamReq.mfx.FrameInfo.Width = INTEL_ALIGN16(pWrappedCodec->encoder.neg_width); // must be a multiple of 16
+ m_sParamReq.mfx.FrameInfo.Height = INTEL_ALIGN16(pWrappedCodec->encoder.neg_height); // must be a multiple of 16
#if INTEL_DX11_D3D
- m_sParamReq.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY;
+ m_sParamReq.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY;
#else
- m_sParamReq.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
+ m_sParamReq.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
#endif
- memset(&m_sOpt2MaxFrameSize, 0, sizeof(m_sOpt2MaxFrameSize));
- m_sOpt2MaxFrameSize.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
- m_sOpt2MaxFrameSize.Header.BufferSz = sizeof(m_sOpt2MaxFrameSize);
- m_sOpt2MaxFrameSize.MaxSliceSize = (H264_RTP_PAYLOAD_SIZE - 100);
- m_sOpt2MaxFrameSize.RepeatPPS = MFX_CODINGOPTION_OFF;
- m_pExtendedBuffers[0] = (mfxExtBuffer*)&m_sOpt2MaxFrameSize;
+ memset(&m_sOpt2MaxFrameSize, 0, sizeof(m_sOpt2MaxFrameSize));
+ m_sOpt2MaxFrameSize.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
+ m_sOpt2MaxFrameSize.Header.BufferSz = sizeof(m_sOpt2MaxFrameSize);
+ m_sOpt2MaxFrameSize.MaxSliceSize = (H264_RTP_PAYLOAD_SIZE - 100);
+ m_sOpt2MaxFrameSize.RepeatPPS = MFX_CODINGOPTION_OFF;
+ m_pExtendedBuffers[0] = (mfxExtBuffer*)&m_sOpt2MaxFrameSize;
#if INTEL_ENABLE_REALTIME
- m_sParamReq.AsyncDepth = 1; // limits internal frame buffering
- m_sParamReq.mfx.GopRefDist = 1; // No B-Frames
- m_sParamReq.mfx.NumRefFrame = 1;
- memset(&m_sOptLowLatency, 0, sizeof(m_sOptLowLatency));
- m_sOptLowLatency.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
- m_sOptLowLatency.Header.BufferSz = sizeof(m_sOptLowLatency);
- m_sOptLowLatency.MaxDecFrameBuffering = 1;
- m_pExtendedBuffers[1] = (mfxExtBuffer*)&m_sOptLowLatency;
- m_sParamReq.NumExtParam = 2;
+ m_sParamReq.AsyncDepth = 1; // limits internal frame buffering
+ m_sParamReq.mfx.GopRefDist = 1; // No B-Frames
+ m_sParamReq.mfx.NumRefFrame = 1;
+ memset(&m_sOptLowLatency, 0, sizeof(m_sOptLowLatency));
+ m_sOptLowLatency.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
+ m_sOptLowLatency.Header.BufferSz = sizeof(m_sOptLowLatency);
+ m_sOptLowLatency.MaxDecFrameBuffering = 1;
+ m_pExtendedBuffers[1] = (mfxExtBuffer*)&m_sOptLowLatency;
+ m_sParamReq.NumExtParam = 2;
#else
- m_sParamReq.NumExtParam = 1;
+ m_sParamReq.NumExtParam = 1;
#endif
- m_sParamReq.ExtParam = m_pExtendedBuffers;
-
- // Check parameters
- status = m_Inst.Query(&m_sParamReq, &m_sParamReq);
- if (status != MFX_ERR_NONE && status != MFX_WRN_INCOMPATIBLE_VIDEO_PARAM /* Best one will be selected by the encoder */) {
- INTEL_CHECK_STATUS(status);
- }
- if (m_sOpt2MaxFrameSize.MaxSliceSize == 0)
- {
- INTEL_DEBUG_INFO("The encoder doesn't support setting 'MaxSliceSize' :(");
- }
-
- // Query number required surfaces for encoder
- memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
- INTEL_CHECK_STATUS(status = m_Inst.QueryIOSurf(&m_sParamReq, &m_sAllocRequest));
- INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sAllocRequest.NumFrameSuggested);
+ m_sParamReq.ExtParam = m_pExtendedBuffers;
+
+ // Check parameters
+ status = m_Inst.Query(&m_sParamReq, &m_sParamReq);
+ if (status != MFX_ERR_NONE && status != MFX_WRN_INCOMPATIBLE_VIDEO_PARAM /* Best one will be selected by the encoder */) {
+ INTEL_CHECK_STATUS(status);
+ }
+ if (m_sOpt2MaxFrameSize.MaxSliceSize == 0) {
+ INTEL_DEBUG_INFO("The encoder doesn't support setting 'MaxSliceSize' :(");
+ }
+
+ // Query number required surfaces for encoder
+ memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
+ INTEL_CHECK_STATUS(status = m_Inst.QueryIOSurf(&m_sParamReq, &m_sAllocRequest));
+ INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sAllocRequest.NumFrameSuggested);
#if INTEL_DX11_D3D
- m_sAllocRequest.Type |= D3D11_WILL_WRITE; // Hint to DX11 memory handler that application will write data to input surfaces
+ m_sAllocRequest.Type |= D3D11_WILL_WRITE; // Hint to DX11 memory handler that application will write data to input surfaces
#endif
- // Allocate surfaces for encoder
+ // Allocate surfaces for encoder
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodec->D3D11Allocator.Alloc(pWrappedCodec->D3D11Allocator.pthis, &m_sAllocRequest, &m_sD3D11Response));
- if (m_sD3D11Response.NumFrameActual == 0)
- {
- INTEL_CHECK_STATUS(status = MFX_ERR_UNKNOWN);
- }
- INTEL_CHECK_STATUS(status = AllocSurfaces(m_sD3D11Response.NumFrameActual, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
+ INTEL_CHECK_STATUS(status = pWrappedCodec->D3D11Allocator.Alloc(pWrappedCodec->D3D11Allocator.pthis, &m_sAllocRequest, &m_sD3D11Response));
+ if (m_sD3D11Response.NumFrameActual == 0) {
+ INTEL_CHECK_STATUS(status = MFX_ERR_UNKNOWN);
+ }
+ INTEL_CHECK_STATUS(status = AllocSurfaces(m_sD3D11Response.NumFrameActual, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
#else
- INTEL_CHECK_STATUS(status = AllocSurfaces(m_sAllocRequest.NumFrameSuggested, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
+ INTEL_CHECK_STATUS(status = AllocSurfaces(m_sAllocRequest.NumFrameSuggested, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
#endif
- // Initialize the Media SDK encoder
- status = m_Inst.Init(&m_sParamReq);
- if (status != MFX_ERR_NONE && status != MFX_WRN_PARTIAL_ACCELERATION) {
- INTEL_CHECK_STATUS(status);
- }
- INTEL_DEBUG_INFO("Encoder->Init() returned: %d", status);
-
- // Retrieve video parameters selected by encoder.
- memset(&m_sParamSel, 0, sizeof(m_sParamSel));
- INTEL_CHECK_STATUS(status = m_Inst.GetVideoParam(&m_sParamSel));
- INTEL_DEBUG_INFO("sel_width=%u.crop=%u, sel_height=%u.crop=%u, sel_fps=%u/%u",
- m_sParamSel.mfx.FrameInfo.Width, m_sParamSel.mfx.FrameInfo.CropW,
- m_sParamSel.mfx.FrameInfo.Height, m_sParamSel.mfx.FrameInfo.CropH,
- m_sParamReq.mfx.FrameInfo.FrameRateExtN,
- m_sParamReq.mfx.FrameInfo.FrameRateExtD
- );
- if (m_sParamSel.mfx.FrameInfo.CropW > 0 && m_sParamSel.mfx.FrameInfo.CropH > 0)
- {
- uSelWidth = m_sParamSel.mfx.FrameInfo.CropW;
- uSelHeight = m_sParamSel.mfx.FrameInfo.CropH;
- }
- else
- {
- uSelWidth = m_sParamSel.mfx.FrameInfo.Width;
- uSelHeight = m_sParamSel.mfx.FrameInfo.Height;
- }
- if (pWrappedCodec->encoder.neg_width != uSelWidth || pWrappedCodec->encoder.neg_height != uSelHeight) {
- INTEL_DEBUG_INFO("Encoder neg size <> sel size: %dx%d<>%dx%d", pWrappedCodec->encoder.neg_width, pWrappedCodec->encoder.neg_height, uSelWidth, uSelHeight);
- pWrappedCodec->encoder.neg_width = uSelWidth;
- pWrappedCodec->encoder.neg_height = uSelHeight;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width = pWrappedCodec->encoder.neg_width;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height = pWrappedCodec->encoder.neg_height;
- }
-
- // Allocate BitStream
- INTEL_CHECK_STATUS(status = AllocateBitstream(m_sParamSel.mfx.BufferSizeInKB * 1000));
-
- m_bOpened = true;
- return MFX_ERR_NONE;
-
- bail:
- Close();
- return status;
- }
-
- mfxStatus UpdateBandwidth(bool bUp, mfxU16 max)
- {
- if (bUp)
- {
- m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, (mfxU16)((m_sParamSel.mfx.TargetKbps * 3) >> 1), max);
- }
- else
- {
- m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, (mfxU16)((m_sParamSel.mfx.TargetKbps << 1) / 3), max);
- }
- m_sParamReq.mfx.TargetKbps = m_sParamSel.mfx.TargetKbps;
- INTEL_DEBUG_INFO("Setting new target bandwidth to %ukbps", m_sParamSel.mfx.TargetKbps);
- return m_Inst.Reset(&m_sParamSel);
- }
-
- mfxStatus SetMaxBandwidth(mfxU16 max)
- {
- m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, m_sParamSel.mfx.TargetKbps, max);
- m_sParamReq.mfx.TargetKbps = m_sParamSel.mfx.TargetKbps;
- INTEL_DEBUG_INFO("Setting new target bandwidth to %ukbps", m_sParamSel.mfx.TargetKbps);
- return m_Inst.Reset(&m_sParamSel);
- }
-
- mfxStatus Encode(struct tmedia_codec_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize)
- {
- tdav_codec_h264_intel_t* pWrappedCodecH264 = (tdav_codec_h264_intel_t*)pWrappedCodec;
- tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
- mfxU32 nInDataXSize;
- tsk_bool_t bSendIDR;
- int nEncSurfIdx = 0;
- mfxSyncPoint syncp;
- mfxStatus status = MFX_ERR_UNKNOWN;
-
- if (!pWrappedCodec || !pcInDataPtr || !nInDataSize) {
- INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
- }
-
- if (!m_bOpened) {
- INTEL_CHECK_STATUS(MFX_ERR_NOT_INITIALIZED);
- }
-
- nInDataXSize = (pWrappedCodecH264->encoder.neg_width * pWrappedCodecH264->encoder.neg_height * 3) >> 1;
- if (nInDataXSize != nInDataSize)
- {
- /* guard */
- INTEL_DEBUG_ERROR("Invalid size: %u<>%u", nInDataXSize, nInDataSize);
- goto bail;
- }
-
- bSendIDR = (pWrappedCodecH264->encoder.frame_count++ == 0 || pWrappedCodecH264->encoder.force_idr);
-
- nEncSurfIdx = GetFreeSurfaceIndex();
- if (MFX_ERR_NOT_FOUND == nEncSurfIdx)
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
-
- // Surface locking required when read/write D3D surfaces
+ // Initialize the Media SDK encoder
+ status = m_Inst.Init(&m_sParamReq);
+ if (status != MFX_ERR_NONE && status != MFX_WRN_PARTIAL_ACCELERATION) {
+ INTEL_CHECK_STATUS(status);
+ }
+ INTEL_DEBUG_INFO("Encoder->Init() returned: %d", status);
+
+ // Retrieve video parameters selected by encoder.
+ memset(&m_sParamSel, 0, sizeof(m_sParamSel));
+ INTEL_CHECK_STATUS(status = m_Inst.GetVideoParam(&m_sParamSel));
+ INTEL_DEBUG_INFO("sel_width=%u.crop=%u, sel_height=%u.crop=%u, sel_fps=%u/%u",
+ m_sParamSel.mfx.FrameInfo.Width, m_sParamSel.mfx.FrameInfo.CropW,
+ m_sParamSel.mfx.FrameInfo.Height, m_sParamSel.mfx.FrameInfo.CropH,
+ m_sParamReq.mfx.FrameInfo.FrameRateExtN,
+ m_sParamReq.mfx.FrameInfo.FrameRateExtD
+ );
+ if (m_sParamSel.mfx.FrameInfo.CropW > 0 && m_sParamSel.mfx.FrameInfo.CropH > 0) {
+ uSelWidth = m_sParamSel.mfx.FrameInfo.CropW;
+ uSelHeight = m_sParamSel.mfx.FrameInfo.CropH;
+ }
+ else {
+ uSelWidth = m_sParamSel.mfx.FrameInfo.Width;
+ uSelHeight = m_sParamSel.mfx.FrameInfo.Height;
+ }
+ if (pWrappedCodec->encoder.neg_width != uSelWidth || pWrappedCodec->encoder.neg_height != uSelHeight) {
+ INTEL_DEBUG_INFO("Encoder neg size <> sel size: %dx%d<>%dx%d", pWrappedCodec->encoder.neg_width, pWrappedCodec->encoder.neg_height, uSelWidth, uSelHeight);
+ pWrappedCodec->encoder.neg_width = uSelWidth;
+ pWrappedCodec->encoder.neg_height = uSelHeight;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.width = pWrappedCodec->encoder.neg_width;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->out.height = pWrappedCodec->encoder.neg_height;
+ }
+
+ // Allocate BitStream
+ INTEL_CHECK_STATUS(status = AllocateBitstream(m_sParamSel.mfx.BufferSizeInKB * 1000));
+
+ m_bOpened = true;
+ return MFX_ERR_NONE;
+
+bail:
+ Close();
+ return status;
+ }
+
+ mfxStatus UpdateBandwidth(bool bUp, mfxU16 max) {
+ if (bUp) {
+ m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, (mfxU16)((m_sParamSel.mfx.TargetKbps * 3) >> 1), max);
+ }
+ else {
+ m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, (mfxU16)((m_sParamSel.mfx.TargetKbps << 1) / 3), max);
+ }
+ m_sParamReq.mfx.TargetKbps = m_sParamSel.mfx.TargetKbps;
+ INTEL_DEBUG_INFO("Setting new target bandwidth to %ukbps", m_sParamSel.mfx.TargetKbps);
+ return m_Inst.Reset(&m_sParamSel);
+ }
+
+ mfxStatus SetMaxBandwidth(mfxU16 max) {
+ m_sParamSel.mfx.TargetKbps = TSK_CLAMP(0, m_sParamSel.mfx.TargetKbps, max);
+ m_sParamReq.mfx.TargetKbps = m_sParamSel.mfx.TargetKbps;
+ INTEL_DEBUG_INFO("Setting new target bandwidth to %ukbps", m_sParamSel.mfx.TargetKbps);
+ return m_Inst.Reset(&m_sParamSel);
+ }
+
+ mfxStatus Encode(struct tmedia_codec_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize) {
+ tdav_codec_h264_intel_t* pWrappedCodecH264 = (tdav_codec_h264_intel_t*)pWrappedCodec;
+ tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
+ mfxU32 nInDataXSize;
+ tsk_bool_t bSendIDR;
+ int nEncSurfIdx = 0;
+ mfxSyncPoint syncp;
+ mfxStatus status = MFX_ERR_UNKNOWN;
+
+ if (!pWrappedCodec || !pcInDataPtr || !nInDataSize) {
+ INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
+ }
+
+ if (!m_bOpened) {
+ INTEL_CHECK_STATUS(MFX_ERR_NOT_INITIALIZED);
+ }
+
+ nInDataXSize = (pWrappedCodecH264->encoder.neg_width * pWrappedCodecH264->encoder.neg_height * 3) >> 1;
+ if (nInDataXSize != nInDataSize) {
+ /* guard */
+ INTEL_DEBUG_ERROR("Invalid size: %u<>%u", nInDataXSize, nInDataSize);
+ goto bail;
+ }
+
+ bSendIDR = (pWrappedCodecH264->encoder.frame_count++ == 0 || pWrappedCodecH264->encoder.force_idr);
+
+ nEncSurfIdx = GetFreeSurfaceIndex();
+ if (MFX_ERR_NOT_FOUND == nEncSurfIdx) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+
+ // Surface locking required when read/write D3D surfaces
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Lock(pWrappedCodecH264->D3D11Allocator.pthis, m_ppSurfacePtrs[nEncSurfIdx]->Data.MemId, &(m_ppSurfacePtrs[nEncSurfIdx]->Data)));
+ INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Lock(pWrappedCodecH264->D3D11Allocator.pthis, m_ppSurfacePtrs[nEncSurfIdx]->Data.MemId, &(m_ppSurfacePtrs[nEncSurfIdx]->Data)));
#endif
- INTEL_CHECK_STATUS(status = LoadRawFrame(nEncSurfIdx, pcInDataPtr));
+ INTEL_CHECK_STATUS(status = LoadRawFrame(nEncSurfIdx, pcInDataPtr));
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, m_ppSurfacePtrs[nEncSurfIdx]->Data.MemId, &(m_ppSurfacePtrs[nEncSurfIdx]->Data)));
+ INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, m_ppSurfacePtrs[nEncSurfIdx]->Data.MemId, &(m_ppSurfacePtrs[nEncSurfIdx]->Data)));
#endif
- m_sFrameCtrl.FrameType = bSendIDR ? (MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF | MFX_FRAMETYPE_IDR) : MFX_FRAMETYPE_UNKNOWN;
-
- //
- // Stage 1: Main encoding loop
- //
- do
- {
- for (;;)
- {
- // Encode a frame asychronously (returns immediately)
- status = m_Inst.EncodeFrameAsync(&m_sFrameCtrl, m_ppSurfacePtrs[nEncSurfIdx], &m_sBitstream, &syncp);
-
- if (MFX_ERR_NONE < status && !syncp) // Repeat the call if warning and no output
- {
- if (MFX_WRN_DEVICE_BUSY == status)
- {
- tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call
- }
- }
- else if (MFX_ERR_NONE < status && syncp)
- {
- status = MFX_ERR_NONE; // Ignore warnings if output is available
- break;
- }
- else if (MFX_ERR_NOT_ENOUGH_BUFFER == status)
- {
- // Allocate more bitstream buffer memory here if needed...
- break;
- }
- else
- {
- if (status != MFX_ERR_MORE_DATA)
- {
- INTEL_CHECK_STATUS(status);
- }
- break;
- }
- }
- if (MFX_ERR_NONE == status)
- {
- INTEL_CHECK_STATUS(m_pSession->SyncOperation(syncp, 60000)); // Synchronize. Wait until encoded frame is ready
- if (m_sBitstream.DataLength > 0)
- {
- tdav_codec_h264_rtp_encap(pWrappedCodecCommon, (const uint8_t*)(m_sBitstream.Data + m_sBitstream.DataOffset), (tsk_size_t)m_sBitstream.DataLength);
- m_sBitstream.DataLength = 0;
- pWrappedCodecH264->encoder.force_idr = tsk_false; // reset
- }
- }
- } while (0);
-
- //
- // Stage 2: Retrieve the buffered encoded frames
- //
- while (MFX_ERR_NONE <= status)
- {
- for (;;)
- {
- // Encode a frame asychronously (returns immediately)
- status = m_Inst.EncodeFrameAsync(&m_sFrameCtrl, NULL, &m_sBitstream, &syncp);
-
- if (MFX_ERR_NONE < status && !syncp) // Repeat the call if warning and no output
- {
- if (MFX_WRN_DEVICE_BUSY == status)
- {
- tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call
- }
- }
- else if (MFX_ERR_NONE < status && syncp)
- {
- status = MFX_ERR_NONE; // Ignore warnings if output is available
- break;
- }
- else
- {
- break;
- }
- }
-
- if (MFX_ERR_NONE == status)
- {
- INTEL_CHECK_STATUS(m_pSession->SyncOperation(syncp, 60000)); // Synchronize. Wait until encoded frame is
- if (m_sBitstream.DataLength > 0)
- {
- tdav_codec_h264_rtp_encap(pWrappedCodecCommon, (const uint8_t*)(m_sBitstream.Data + m_sBitstream.DataOffset), (tsk_size_t)m_sBitstream.DataLength);
- m_sBitstream.DataLength = 0;
- pWrappedCodecH264->encoder.force_idr = tsk_false; // reset
- }
- }
- }
-
- bail:
- return MFX_ERR_NONE;
- }
+ m_sFrameCtrl.FrameType = bSendIDR ? (MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF | MFX_FRAMETYPE_IDR) : MFX_FRAMETYPE_UNKNOWN;
+
+ //
+ // Stage 1: Main encoding loop
+ //
+ do {
+ for (;;) {
+ // Encode a frame asychronously (returns immediately)
+ status = m_Inst.EncodeFrameAsync(&m_sFrameCtrl, m_ppSurfacePtrs[nEncSurfIdx], &m_sBitstream, &syncp);
+
+ if (MFX_ERR_NONE < status && !syncp) { // Repeat the call if warning and no output
+ if (MFX_WRN_DEVICE_BUSY == status) {
+ tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call
+ }
+ }
+ else if (MFX_ERR_NONE < status && syncp) {
+ status = MFX_ERR_NONE; // Ignore warnings if output is available
+ break;
+ }
+ else if (MFX_ERR_NOT_ENOUGH_BUFFER == status) {
+ // Allocate more bitstream buffer memory here if needed...
+ break;
+ }
+ else {
+ if (status != MFX_ERR_MORE_DATA) {
+ INTEL_CHECK_STATUS(status);
+ }
+ break;
+ }
+ }
+ if (MFX_ERR_NONE == status) {
+ INTEL_CHECK_STATUS(m_pSession->SyncOperation(syncp, 60000)); // Synchronize. Wait until encoded frame is ready
+ if (m_sBitstream.DataLength > 0) {
+ tdav_codec_h264_rtp_encap(pWrappedCodecCommon, (const uint8_t*)(m_sBitstream.Data + m_sBitstream.DataOffset), (tsk_size_t)m_sBitstream.DataLength);
+ m_sBitstream.DataLength = 0;
+ pWrappedCodecH264->encoder.force_idr = tsk_false; // reset
+ }
+ }
+ }
+ while (0);
+
+ //
+ // Stage 2: Retrieve the buffered encoded frames
+ //
+ while (MFX_ERR_NONE <= status) {
+ for (;;) {
+ // Encode a frame asychronously (returns immediately)
+ status = m_Inst.EncodeFrameAsync(&m_sFrameCtrl, NULL, &m_sBitstream, &syncp);
+
+ if (MFX_ERR_NONE < status && !syncp) { // Repeat the call if warning and no output
+ if (MFX_WRN_DEVICE_BUSY == status) {
+ tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call
+ }
+ }
+ else if (MFX_ERR_NONE < status && syncp) {
+ status = MFX_ERR_NONE; // Ignore warnings if output is available
+ break;
+ }
+ else {
+ break;
+ }
+ }
+
+ if (MFX_ERR_NONE == status) {
+ INTEL_CHECK_STATUS(m_pSession->SyncOperation(syncp, 60000)); // Synchronize. Wait until encoded frame is
+ if (m_sBitstream.DataLength > 0) {
+ tdav_codec_h264_rtp_encap(pWrappedCodecCommon, (const uint8_t*)(m_sBitstream.Data + m_sBitstream.DataOffset), (tsk_size_t)m_sBitstream.DataLength);
+ m_sBitstream.DataLength = 0;
+ pWrappedCodecH264->encoder.force_idr = tsk_false; // reset
+ }
+ }
+ }
+
+bail:
+ return MFX_ERR_NONE;
+ }
private:
- MFXVideoENCODE m_Inst;
- mfxEncodeCtrl m_sFrameCtrl;
- mfxExtCodingOption m_sOptLowLatency;
- mfxExtCodingOption2 m_sOpt2MaxFrameSize;
- mfxExtBuffer* m_pExtendedBuffers[2]; // Not allocated
+ MFXVideoENCODE m_Inst;
+ mfxEncodeCtrl m_sFrameCtrl;
+ mfxExtCodingOption m_sOptLowLatency;
+ mfxExtCodingOption2 m_sOpt2MaxFrameSize;
+ mfxExtBuffer* m_pExtendedBuffers[2]; // Not allocated
};
@@ -775,253 +720,222 @@ private:
class IntelCodecDecoder : public IntelCodec
{
public:
- IntelCodecDecoder(MFXVideoSession* pSession)
- : IntelCodec(pSession)
- , m_Inst(*pSession)
- , m_pAccumulatorPtr(NULL)
- , m_nAccumulatorSize(0)
- , m_nAccumulatorPos(0)
- , m_bInit(false)
- {
-
- }
- virtual ~IntelCodecDecoder()
- {
- Close();
- }
-
- virtual mfxStatus Close()
- {
- m_Inst.Close();
- TSK_FREE(m_pAccumulatorPtr);
- m_nAccumulatorSize = 0;
- m_nAccumulatorPos = 0;
- m_bInit = false;
- return IntelCodec::Close();
- }
-
- mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec)
- {
- tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
-
- INTEL_DEBUG_INFO("Decoder.Open width=%d, height=%d, fps=%d",
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.width,
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.height,
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.fps
- );
-
- // Allocation will be done each time we decode the SPS:PPS header
-
- m_bOpened = true;
- return MFX_ERR_NONE;
- }
-
- mfxU32 Decode(struct tmedia_codec_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize, void **ppOutDataPtr, tsk_size_t *pOutDataMaxSize, const trtp_rtp_header_t* pcRtpHdr)
- {
- mfxU32 nRetSize = 0, nOutXSize;
- mfxStatus status = MFX_ERR_NONE;
- tsk_bool_t append_scp, end_of_unit;
- tsk_bool_t sps_or_pps;
- const uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size = 0, size_to_copy = 0;
- bool bGotFrame = false;
- mfxFrameSurface1* pmfxOutSurface = NULL;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
-
- tdav_codec_h264_intel_t* pWrappedCodecH264 = (tdav_codec_h264_intel_t*)pWrappedCodec;
- tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
-
- if (!pWrappedCodec || !pcInDataPtr || !nInDataSize || !ppOutDataPtr)
- {
- INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
- }
- //INTEL_DEBUG_INFO("Size=%u", nInDataSize);
- if (!m_bOpened)
- {
- INTEL_CHECK_STATUS(MFX_ERR_NOT_INITIALIZED);
- }
-
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
- |0|1|2|3|4|5|6|7|
- +-+-+-+-+-+-+-+-+
- |F|NRI| Type |
- +---------------+
- */
- if (pcInDataPtr[0] & 0x80) // F ?== 1
- {
- /* reset accumulator */
- m_nAccumulatorPos = 0;
- INTEL_CHECK_STATUS(status = MFX_ERR_UNDEFINED_BEHAVIOR);
- }
-
- // New frame?
- if (m_nLastRtpTimestamp != pcRtpHdr->timestamp)
- {
- m_nAccumulatorPos = 0;
- m_nLastRtpTimestamp = pcRtpHdr->timestamp;
- }
-
- /* get payload */
- if ((tdav_codec_h264_get_pay(pcInDataPtr, nInDataSize, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit) != 0) || !pay_ptr || !pay_size)
- {
- INTEL_BREAK("Depayloader failed to get H.264 content");
- }
+ IntelCodecDecoder(MFXVideoSession* pSession)
+ : IntelCodec(pSession)
+ , m_Inst(*pSession)
+ , m_pAccumulatorPtr(NULL)
+ , m_nAccumulatorSize(0)
+ , m_nAccumulatorPos(0)
+ , m_bInit(false) {
+
+ }
+ virtual ~IntelCodecDecoder() {
+ Close();
+ }
+
+ virtual mfxStatus Close() {
+ m_Inst.Close();
+ TSK_FREE(m_pAccumulatorPtr);
+ m_nAccumulatorSize = 0;
+ m_nAccumulatorPos = 0;
+ m_bInit = false;
+ return IntelCodec::Close();
+ }
+
+ mfxStatus Open(struct tdav_codec_h264_intel_s* pWrappedCodec) {
+ tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
+
+ INTEL_DEBUG_INFO("Decoder.Open width=%d, height=%d, fps=%d",
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.width,
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.height,
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.fps
+ );
+
+ // Allocation will be done each time we decode the SPS:PPS header
+
+ m_bOpened = true;
+ return MFX_ERR_NONE;
+ }
+
+ mfxU32 Decode(struct tmedia_codec_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize, void **ppOutDataPtr, tsk_size_t *pOutDataMaxSize, const trtp_rtp_header_t* pcRtpHdr) {
+ mfxU32 nRetSize = 0, nOutXSize;
+ mfxStatus status = MFX_ERR_NONE;
+ tsk_bool_t append_scp, end_of_unit;
+ tsk_bool_t sps_or_pps;
+ const uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size = 0, size_to_copy = 0;
+ bool bGotFrame = false;
+ mfxFrameSurface1* pmfxOutSurface = NULL;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
+
+ tdav_codec_h264_intel_t* pWrappedCodecH264 = (tdav_codec_h264_intel_t*)pWrappedCodec;
+ tdav_codec_h264_common_t* pWrappedCodecCommon = (tdav_codec_h264_common_t*)pWrappedCodec;
+
+ if (!pWrappedCodec || !pcInDataPtr || !nInDataSize || !ppOutDataPtr) {
+ INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
+ }
+ //INTEL_DEBUG_INFO("Size=%u", nInDataSize);
+ if (!m_bOpened) {
+ INTEL_CHECK_STATUS(MFX_ERR_NOT_INITIALIZED);
+ }
+
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
+ |0|1|2|3|4|5|6|7|
+ +-+-+-+-+-+-+-+-+
+ |F|NRI| Type |
+ +---------------+
+ */
+ if (pcInDataPtr[0] & 0x80) { // F ?== 1
+ /* reset accumulator */
+ m_nAccumulatorPos = 0;
+ INTEL_CHECK_STATUS(status = MFX_ERR_UNDEFINED_BEHAVIOR);
+ }
+
+ // New frame?
+ if (m_nLastRtpTimestamp != pcRtpHdr->timestamp) {
+ m_nAccumulatorPos = 0;
+ m_nLastRtpTimestamp = pcRtpHdr->timestamp;
+ }
+
+ /* get payload */
+ if ((tdav_codec_h264_get_pay(pcInDataPtr, nInDataSize, (const void**)&pay_ptr, &pay_size, &append_scp, &end_of_unit) != 0) || !pay_ptr || !pay_size) {
+ INTEL_BREAK("Depayloader failed to get H.264 content");
+ }
#if 1 // TODO: MSDK cannot decode slices
- end_of_unit = pcRtpHdr->marker;
+ end_of_unit = pcRtpHdr->marker;
#endif
- //append_scp = tsk_true;
- size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
- // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
- sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
-
- // start-accumulator
- if (!m_pAccumulatorPtr)
- {
- if (size_to_copy > xmax_size)
- {
- INTEL_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
- m_nAccumulatorPos = 0;
- return 0;
- }
- if (!(m_pAccumulatorPtr = (mfxU8*)tsk_calloc(size_to_copy, sizeof(mfxU8))))
- {
- INTEL_DEBUG_ERROR("Failed to allocated new buffer");
- m_nAccumulatorPos = 0;
- return 0;
- }
- m_nAccumulatorSize = (mfxU32)size_to_copy;
- }
- if ((m_nAccumulatorPos + size_to_copy) >= xmax_size)
- {
- INTEL_DEBUG_ERROR("BufferOverflow");
- m_nAccumulatorPos = 0;
- return 0;
- }
- if ((m_nAccumulatorPos + size_to_copy) > m_nAccumulatorSize)
- {
- if (!(m_pAccumulatorPtr = (mfxU8*)tsk_realloc(m_pAccumulatorPtr, (m_nAccumulatorPos + size_to_copy))))
- {
- INTEL_DEBUG_ERROR("Failed to reallocated new buffer");
- m_nAccumulatorPos = 0;
- m_nAccumulatorSize = 0;
- return 0;
- }
- m_nAccumulatorSize = (mfxU32)(m_nAccumulatorPos + size_to_copy);
- }
-
- if (append_scp)
- {
- memcpy(&m_pAccumulatorPtr[m_nAccumulatorPos], H264_START_CODE_PREFIX, start_code_prefix_size);
- m_nAccumulatorPos += (mfxU32)start_code_prefix_size;
- }
- memcpy(&m_pAccumulatorPtr[m_nAccumulatorPos], pay_ptr, pay_size);
- m_nAccumulatorPos += (mfxU32)pay_size;
- // end-accumulator
-
- if (/*rtp_hdr->marker*/end_of_unit)
- {
- /* decode the picture */
- mfxU32 nOutWidth, nOutHeight;
-
- // Decode a Unit
- status = DecodeFrame(pWrappedCodecH264, m_pAccumulatorPtr, m_nAccumulatorPos, !!sps_or_pps, &pmfxOutSurface, bGotFrame);
- if (status != MFX_ERR_NONE)
- {
- INTEL_DEBUG_WARN("DecodeFrame failed: %d", status);
- goto bail;
- }
-
- // Do we have a complete frame?
- if (!bGotFrame || !pmfxOutSurface)
- {
- goto bail;
- }
+ //append_scp = tsk_true;
+ size_to_copy = pay_size + (append_scp ? start_code_prefix_size : 0);
+ // whether it's SPS or PPS (append_scp is false for subsequent FUA chuncks)
+ sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
+
+ // start-accumulator
+ if (!m_pAccumulatorPtr) {
+ if (size_to_copy > xmax_size) {
+ INTEL_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
+ m_nAccumulatorPos = 0;
+ return 0;
+ }
+ if (!(m_pAccumulatorPtr = (mfxU8*)tsk_calloc(size_to_copy, sizeof(mfxU8)))) {
+ INTEL_DEBUG_ERROR("Failed to allocated new buffer");
+ m_nAccumulatorPos = 0;
+ return 0;
+ }
+ m_nAccumulatorSize = (mfxU32)size_to_copy;
+ }
+ if ((m_nAccumulatorPos + size_to_copy) >= xmax_size) {
+ INTEL_DEBUG_ERROR("BufferOverflow");
+ m_nAccumulatorPos = 0;
+ return 0;
+ }
+ if ((m_nAccumulatorPos + size_to_copy) > m_nAccumulatorSize) {
+ if (!(m_pAccumulatorPtr = (mfxU8*)tsk_realloc(m_pAccumulatorPtr, (m_nAccumulatorPos + size_to_copy)))) {
+ INTEL_DEBUG_ERROR("Failed to reallocated new buffer");
+ m_nAccumulatorPos = 0;
+ m_nAccumulatorSize = 0;
+ return 0;
+ }
+ m_nAccumulatorSize = (mfxU32)(m_nAccumulatorPos + size_to_copy);
+ }
+
+ if (append_scp) {
+ memcpy(&m_pAccumulatorPtr[m_nAccumulatorPos], H264_START_CODE_PREFIX, start_code_prefix_size);
+ m_nAccumulatorPos += (mfxU32)start_code_prefix_size;
+ }
+ memcpy(&m_pAccumulatorPtr[m_nAccumulatorPos], pay_ptr, pay_size);
+ m_nAccumulatorPos += (mfxU32)pay_size;
+ // end-accumulator
+
+ if (/*rtp_hdr->marker*/end_of_unit) {
+ /* decode the picture */
+ mfxU32 nOutWidth, nOutHeight;
+
+ // Decode a Unit
+ status = DecodeFrame(pWrappedCodecH264, m_pAccumulatorPtr, m_nAccumulatorPos, !!sps_or_pps, &pmfxOutSurface, bGotFrame);
+ if (status != MFX_ERR_NONE) {
+ INTEL_DEBUG_WARN("DecodeFrame failed: %d", status);
+ goto bail;
+ }
+
+ // Do we have a complete frame?
+ if (!bGotFrame || !pmfxOutSurface) {
+ goto bail;
+ }
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Lock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
+ INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Lock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
#endif
- if (!pmfxOutSurface->Data.Y || !pmfxOutSurface->Data.U || !pmfxOutSurface->Data.V)
- {
+ if (!pmfxOutSurface->Data.Y || !pmfxOutSurface->Data.U || !pmfxOutSurface->Data.V) {
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
+ INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
#endif
- goto bail;
- }
-
- if (pmfxOutSurface->Info.CropW > 0 && pmfxOutSurface->Info.CropH > 0)
- {
- nOutWidth = pmfxOutSurface->Info.CropW;
- nOutHeight = pmfxOutSurface->Info.CropH;
- }
- else
- {
- nOutWidth = pmfxOutSurface->Info.Width;
- nOutHeight = pmfxOutSurface->Info.Height;
- }
-
- nOutXSize = (nOutWidth * nOutHeight * 3) >> 1; // I420
- /* IDR ? */
- if (((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback)
- {
- INTEL_DEBUG_INFO("Decoded H.264 IDR");
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.proto_hdr = pcRtpHdr;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback(&TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result);
- }
- /* fill out */
- if (*pOutDataMaxSize < nOutXSize)
- {
- if ((*ppOutDataPtr = tsk_realloc(*ppOutDataPtr, nOutXSize)))
- {
- *pOutDataMaxSize = nOutXSize;
- }
- else
- {
- *pOutDataMaxSize = 0;
- return 0;
- }
- }
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.width = nOutWidth;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.height = nOutHeight;
-
- /* layout picture */
- INTEL_CHECK_STATUS(status = IntelCodecDecoder::LayoutPicture(pmfxOutSurface, (mfxU8 *)*ppOutDataPtr));
- nRetSize = nOutXSize;
+ goto bail;
+ }
+
+ if (pmfxOutSurface->Info.CropW > 0 && pmfxOutSurface->Info.CropH > 0) {
+ nOutWidth = pmfxOutSurface->Info.CropW;
+ nOutHeight = pmfxOutSurface->Info.CropH;
+ }
+ else {
+ nOutWidth = pmfxOutSurface->Info.Width;
+ nOutHeight = pmfxOutSurface->Info.Height;
+ }
+
+ nOutXSize = (nOutWidth * nOutHeight * 3) >> 1; // I420
+ /* IDR ? */
+ if (((pay_ptr[0] & 0x1F) == 0x05) && TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback) {
+ INTEL_DEBUG_INFO("Decoded H.264 IDR");
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.proto_hdr = pcRtpHdr;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback(&TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result);
+ }
+ /* fill out */
+ if (*pOutDataMaxSize < nOutXSize) {
+ if ((*ppOutDataPtr = tsk_realloc(*ppOutDataPtr, nOutXSize))) {
+ *pOutDataMaxSize = nOutXSize;
+ }
+ else {
+ *pOutDataMaxSize = 0;
+ return 0;
+ }
+ }
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.width = nOutWidth;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.height = nOutHeight;
+
+ /* layout picture */
+ INTEL_CHECK_STATUS(status = IntelCodecDecoder::LayoutPicture(pmfxOutSurface, (mfxU8 *)*ppOutDataPtr));
+ nRetSize = nOutXSize;
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
+ INTEL_CHECK_STATUS(status = pWrappedCodecH264->D3D11Allocator.Unlock(pWrappedCodecH264->D3D11Allocator.pthis, pmfxOutSurface->Data.MemId, &(pmfxOutSurface->Data)));
#endif
- } // else if(rtp_hdr->marker)
-
- bail:
- if (end_of_unit)
- {
- /* reset accumulator */
- m_nAccumulatorPos = 0;
- }
-
- if (status != MFX_ERR_NONE)
- {
- INTEL_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", status, m_nAccumulatorPos, append_scp ? "yes" : "no");
- if (TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback)
- {
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.proto_hdr = pcRtpHdr;
- TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback(&TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result);
- }
- }
- return nRetSize;
- }
+ } // else if(rtp_hdr->marker)
+
+bail:
+ if (end_of_unit) {
+ /* reset accumulator */
+ m_nAccumulatorPos = 0;
+ }
+
+ if (status != MFX_ERR_NONE) {
+ INTEL_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", status, m_nAccumulatorPos, append_scp ? "yes" : "no");
+ if (TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback) {
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result.proto_hdr = pcRtpHdr;
+ TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.callback(&TMEDIA_CODEC_VIDEO(pWrappedCodec)->in.result);
+ }
+ }
+ return nRetSize;
+ }
private:
#if 0
- static mfxStatus WriteSection(mfxU8* plane, mfxU16 factor, mfxU16 chunksize, mfxFrameInfo *pInfo, mfxFrameData *pData, mfxU32 i, mfxU32 j, mfxU8 *pDstPtr)
- {
- memcpy(pDstPtr, plane + (pInfo->CropY * pData->Pitch / factor + pInfo->CropX) + i * pData->Pitch + j, chunksize);
- return MFX_ERR_NONE;
- }
+ static mfxStatus WriteSection(mfxU8* plane, mfxU16 factor, mfxU16 chunksize, mfxFrameInfo *pInfo, mfxFrameData *pData, mfxU32 i, mfxU32 j, mfxU8 *pDstPtr) {
+ memcpy(pDstPtr, plane + (pInfo->CropY * pData->Pitch / factor + pInfo->CropX) + i * pData->Pitch + j, chunksize);
+ return MFX_ERR_NONE;
+ }
#else
#define WriteSection(_plane, _factor, _chunksize, _pInfo, _pData, _i, _j, _pDstPtr) \
memcpy((_pDstPtr), (_plane) + ((_pInfo)->CropY * (_pData)->Pitch / (_factor) + (_pInfo)->CropX) + (_i) * (_pData)->Pitch + (_j), (_chunksize))
@@ -1029,447 +943,391 @@ private:
*(_pDstPtr) = *((_plane) + ((_pInfo)->CropY * (_pData)->Pitch / (_factor) + (_pInfo)->CropX) + (_i) * (_pData)->Pitch + (_j));
#endif
- static mfxStatus LayoutPicture(mfxFrameSurface1 *pSurface, mfxU8 *pDstPtr)
- {
+ static mfxStatus LayoutPicture(mfxFrameSurface1 *pSurface, mfxU8 *pDstPtr) {
#if 1 // ->YUV420
- mfxFrameInfo *pInfo = &pSurface->Info;
- mfxFrameData *pData = &pSurface->Data;
- mfxU32 i, j, h, w;
-
- if (pSurface->Info.CropW > 0 && pSurface->Info.CropH > 0)
- {
- w = pSurface->Info.CropW;
- h = pSurface->Info.CropH;
- }
- else
- {
- w = pSurface->Info.Width;
- h = pSurface->Info.Height;
- }
-
- for (i = 0; i < h; i++)
- {
- WriteSection(pData->Y, 1, w, pInfo, pData, i, 0, pDstPtr);
- pDstPtr += w;
- }
-
- h >>= 1;
- for (i = 0; i < h; i++)
- {
- for (j = 0; j < w; j += 2)
- {
- WriteSection1(pData->UV, 2, pInfo, pData, i, j, pDstPtr);
- pDstPtr += 1;
- }
- }
-
- for (i = 0; i < h; i++)
- {
- for (j = 1; j < w; j += 2)
- {
- WriteSection1(pData->UV, 2, pInfo, pData, i, j, pDstPtr);
- pDstPtr += 1;
- }
- }
+ mfxFrameInfo *pInfo = &pSurface->Info;
+ mfxFrameData *pData = &pSurface->Data;
+ mfxU32 i, j, h, w;
+
+ if (pSurface->Info.CropW > 0 && pSurface->Info.CropH > 0) {
+ w = pSurface->Info.CropW;
+ h = pSurface->Info.CropH;
+ }
+ else {
+ w = pSurface->Info.Width;
+ h = pSurface->Info.Height;
+ }
+
+ for (i = 0; i < h; i++) {
+ WriteSection(pData->Y, 1, w, pInfo, pData, i, 0, pDstPtr);
+ pDstPtr += w;
+ }
+
+ h >>= 1;
+ for (i = 0; i < h; i++) {
+ for (j = 0; j < w; j += 2) {
+ WriteSection1(pData->UV, 2, pInfo, pData, i, j, pDstPtr);
+ pDstPtr += 1;
+ }
+ }
+
+ for (i = 0; i < h; i++) {
+ for (j = 1; j < w; j += 2) {
+ WriteSection1(pData->UV, 2, pInfo, pData, i, j, pDstPtr);
+ pDstPtr += 1;
+ }
+ }
#elif 1 // ->NV12
- mfxFrameInfo *pInfo = &pSurface->Info;
- mfxFrameData *pData = &pSurface->Data;
- mfxU32 i, j, h, w;
-
- if (pSurface->Info.CropW > 0 && pSurface->Info.CropH > 0)
- {
- w = pSurface->Info.CropW;
- h = pSurface->Info.CropH;
- }
- else
- {
- w = pSurface->Info.Width;
- h = pSurface->Info.Height;
- }
-
- for (i = 0; i < h; i++)
- {
- WriteSection(pData->Y, 1, w, pInfo, pData, i, 0, pDstPtr);
- pDstPtr += w;
- }
-
- h >>= 1;
- for (i = 0; i < h; i++)
- {
- for (j = 0; j < w; j += 2)
- {
- WriteSection1(pData->UV, 2, pInfo, pData, i, j, &pDstPtr[0]);
- WriteSection1(pData->UV, 2, pInfo, pData, i, j + 1, &pDstPtr[1]);
- pDstPtr += 2;
- }
- }
+ mfxFrameInfo *pInfo = &pSurface->Info;
+ mfxFrameData *pData = &pSurface->Data;
+ mfxU32 i, j, h, w;
+
+ if (pSurface->Info.CropW > 0 && pSurface->Info.CropH > 0) {
+ w = pSurface->Info.CropW;
+ h = pSurface->Info.CropH;
+ }
+ else {
+ w = pSurface->Info.Width;
+ h = pSurface->Info.Height;
+ }
+
+ for (i = 0; i < h; i++) {
+ WriteSection(pData->Y, 1, w, pInfo, pData, i, 0, pDstPtr);
+ pDstPtr += w;
+ }
+
+ h >>= 1;
+ for (i = 0; i < h; i++) {
+ for (j = 0; j < w; j += 2) {
+ WriteSection1(pData->UV, 2, pInfo, pData, i, j, &pDstPtr[0]);
+ WriteSection1(pData->UV, 2, pInfo, pData, i, j + 1, &pDstPtr[1]);
+ pDstPtr += 2;
+ }
+ }
#endif
- return MFX_ERR_NONE;
- }
-
- mfxStatus DecodeFrame(struct tdav_codec_h264_intel_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize, bool bSpsOrPps, mfxFrameSurface1** ppmfxOutSurface, bool &bGotFrame)
- {
- mfxStatus status = MFX_ERR_NONE;
- int nSurfaceIndex;
- mfxSyncPoint syncp;
- bGotFrame = false;
- *ppmfxOutSurface = NULL;
- mfxFrameSurface1* pmfxOutSurface = NULL;
-
-#if 0
- if (!bSpsOrPps && !m_bInit)
- {
- INTEL_CHECK_STATUS(status = MFX_ERR_NOT_INITIALIZED);
- }
+ return MFX_ERR_NONE;
+ }
+
+ mfxStatus DecodeFrame(struct tdav_codec_h264_intel_s* pWrappedCodec, const mfxU8* pcInDataPtr, mfxU32 nInDataSize, bool bSpsOrPps, mfxFrameSurface1** ppmfxOutSurface, bool &bGotFrame) {
+ mfxStatus status = MFX_ERR_NONE;
+ int nSurfaceIndex;
+ mfxSyncPoint syncp;
+ bGotFrame = false;
+ *ppmfxOutSurface = NULL;
+ mfxFrameSurface1* pmfxOutSurface = NULL;
+
+#if 0
+ if (!bSpsOrPps && !m_bInit) {
+ INTEL_CHECK_STATUS(status = MFX_ERR_NOT_INITIALIZED);
+ }
#endif
- if (m_sBitstream.DataLength < nInDataSize)
- {
- INTEL_CHECK_STATUS(status = AllocateBitstream(nInDataSize));
- }
- memcpy(m_sBitstream.Data, pcInDataPtr, nInDataSize);
- m_sBitstream.DataOffset = 0;
- m_sBitstream.DataLength = nInDataSize;
- m_sBitstream.DataFlag = MFX_BITSTREAM_COMPLETE_FRAME;
-
- if (bSpsOrPps || !m_bInit)
- {
- memset(&m_sParamReq, 0, sizeof(m_sParamReq));
- m_sParamReq.mfx.CodecId = MFX_CODEC_AVC;
- m_sParamReq.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
- m_sParamReq.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
+ if (m_sBitstream.DataLength < nInDataSize) {
+ INTEL_CHECK_STATUS(status = AllocateBitstream(nInDataSize));
+ }
+ memcpy(m_sBitstream.Data, pcInDataPtr, nInDataSize);
+ m_sBitstream.DataOffset = 0;
+ m_sBitstream.DataLength = nInDataSize;
+ m_sBitstream.DataFlag = MFX_BITSTREAM_COMPLETE_FRAME;
+
+ if (bSpsOrPps || !m_bInit) {
+ memset(&m_sParamReq, 0, sizeof(m_sParamReq));
+ m_sParamReq.mfx.CodecId = MFX_CODEC_AVC;
+ m_sParamReq.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
+ m_sParamReq.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
#if INTEL_DX11_D3D
- m_sParamReq.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
+ m_sParamReq.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
#else
- m_sParamReq.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
+ m_sParamReq.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
#endif
- m_sParamReq.AsyncDepth = 1; // Low latency: limits internal frame buffering
-
- status = m_Inst.DecodeHeader(&m_sBitstream, &m_sParamReq);
- if (status == MFX_WRN_PARTIAL_ACCELERATION)
- {
- status = MFX_ERR_NONE;
- }
- INTEL_CHECK_STATUS(status);
-
- memcpy(&m_sParamSel, &m_sParamReq, sizeof(m_sParamSel));
-
- // Check parameters
- status = m_Inst.Query(&m_sParamReq, &m_sParamReq);
- if (status != MFX_ERR_NONE && status != MFX_WRN_INCOMPATIBLE_VIDEO_PARAM /* Best one will be selected by the encoder */)
- {
- INTEL_CHECK_STATUS(status);
- }
-
- // Query number required surfaces for encoder
- memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
- INTEL_CHECK_STATUS(status = m_Inst.QueryIOSurf(&m_sParamReq, &m_sAllocRequest));
+ m_sParamReq.AsyncDepth = 1; // Low latency: limits internal frame buffering
+
+ status = m_Inst.DecodeHeader(&m_sBitstream, &m_sParamReq);
+ if (status == MFX_WRN_PARTIAL_ACCELERATION) {
+ status = MFX_ERR_NONE;
+ }
+ INTEL_CHECK_STATUS(status);
+
+ memcpy(&m_sParamSel, &m_sParamReq, sizeof(m_sParamSel));
+
+ // Check parameters
+ status = m_Inst.Query(&m_sParamReq, &m_sParamReq);
+ if (status != MFX_ERR_NONE && status != MFX_WRN_INCOMPATIBLE_VIDEO_PARAM /* Best one will be selected by the encoder */) {
+ INTEL_CHECK_STATUS(status);
+ }
+
+ // Query number required surfaces for encoder
+ memset(&m_sAllocRequest, 0, sizeof(m_sAllocRequest));
+ INTEL_CHECK_STATUS(status = m_Inst.QueryIOSurf(&m_sParamReq, &m_sAllocRequest));
#if INTEL_DX11_D3D
- m_sAllocRequest.Type |= D3D11_WILL_READ; // Hint to DX11 memory handler that application will read data from output surfaces
+ m_sAllocRequest.Type |= D3D11_WILL_READ; // Hint to DX11 memory handler that application will read data from output surfaces
#endif
- // Allocate surfaces for decoder
+ // Allocate surfaces for decoder
#if INTEL_DX11_D3D
- INTEL_CHECK_STATUS(status = pWrappedCodec->D3D11Allocator.Alloc(pWrappedCodec->D3D11Allocator.pthis, &m_sAllocRequest, &m_sD3D11Response));
- if (m_sD3D11Response.NumFrameActual == 0)
- {
- INTEL_CHECK_STATUS(status = MFX_ERR_UNKNOWN);
- }
- INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sD3D11Response.NumFrameActual);
- INTEL_CHECK_STATUS(status = AllocSurfaces(m_sD3D11Response.NumFrameActual, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
+ INTEL_CHECK_STATUS(status = pWrappedCodec->D3D11Allocator.Alloc(pWrappedCodec->D3D11Allocator.pthis, &m_sAllocRequest, &m_sD3D11Response));
+ if (m_sD3D11Response.NumFrameActual == 0) {
+ INTEL_CHECK_STATUS(status = MFX_ERR_UNKNOWN);
+ }
+ INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sD3D11Response.NumFrameActual);
+ INTEL_CHECK_STATUS(status = AllocSurfaces(m_sD3D11Response.NumFrameActual, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
#else
- INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sAllocRequest.NumFrameSuggested);
- INTEL_CHECK_STATUS(status = AllocSurfaces(m_sAllocRequest.NumFrameSuggested, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
-#endif
- // Initialize the Media SDK decoder
- status = m_Inst.Init(&m_sParamReq);
- if (status != MFX_ERR_NONE && status != MFX_WRN_PARTIAL_ACCELERATION)
- {
- INTEL_CHECK_STATUS(status);
- }
- INTEL_DEBUG_INFO("Decoder->Init() returned: %d", status);
-
- m_bInit = true;
- }
-
- //
- // Stage 1: Main decoding loop
- //
- while (MFX_ERR_NONE <= status || MFX_ERR_MORE_DATA == status || MFX_ERR_MORE_SURFACE == status)
- {
- if (MFX_WRN_DEVICE_BUSY == status)
- {
- tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call to DecodeFrameAsync
- }
-
- if (MFX_ERR_MORE_DATA == status)
- {
- return MFX_ERR_NONE;
- }
-
- if (MFX_ERR_MORE_SURFACE == status || MFX_ERR_NONE == status)
- {
- nSurfaceIndex = GetFreeSurfaceIndex(); // Find free frame surface
- if (MFX_ERR_NOT_FOUND == nSurfaceIndex)
- {
- INTEL_CHECK_STATUS((status = MFX_ERR_MEMORY_ALLOC));
- }
- }
-
- // Decode a frame asychronously (returns immediately)
- // - If input bitstream contains multiple frames DecodeFrameAsync will start decoding multiple frames, and remove them from bitstream
- status = m_Inst.DecodeFrameAsync(&m_sBitstream, m_ppSurfacePtrs[nSurfaceIndex], &pmfxOutSurface, &syncp);
-
- // Ignore warnings if output is available,
- // if no output and no action required just repeat the DecodeFrameAsync call
- if (MFX_ERR_NONE < status && syncp)
- {
- status = MFX_ERR_NONE;
- }
-
- if (MFX_ERR_NONE == status)
- {
- status = m_pSession->SyncOperation(syncp, 60000); // Synchronize. Wait until decoded frame is ready
- }
-
- if (MFX_ERR_NONE == status)
- {
- bGotFrame = true;
- if (pmfxOutSurface)
- {
- *ppmfxOutSurface = pmfxOutSurface;
- }
- }
- }
-
- //
- // Stage 2: Retrieve the buffered decoded frames
- //
- while (MFX_ERR_NONE <= status || MFX_ERR_MORE_SURFACE == status)
- {
- if (MFX_WRN_DEVICE_BUSY == status)
- {
- tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call to DecodeFrameAsync
- }
-
- nSurfaceIndex = GetFreeSurfaceIndex(); // Find free frame surface
- if (MFX_ERR_NOT_FOUND == nSurfaceIndex)
- {
- INTEL_CHECK_STATUS((status = MFX_ERR_MEMORY_ALLOC));
- }
-
- // Decode a frame asychronously (returns immediately)
- status = m_Inst.DecodeFrameAsync(NULL, m_ppSurfacePtrs[nSurfaceIndex], ppmfxOutSurface, &syncp);
-
- // Ignore warnings if output is available,
- // if no output and no action required just repeat the DecodeFrameAsync call
- if (MFX_ERR_NONE < status && syncp)
- {
- status = MFX_ERR_NONE;
- }
-
- if (MFX_ERR_NONE == status)
- {
- status = m_pSession->SyncOperation(syncp, 60000); // Synchronize. Waits until decoded frame is ready
- }
-
- if (MFX_ERR_NONE == status)
- {
- bGotFrame = true;
- if (pmfxOutSurface)
- {
- *ppmfxOutSurface = pmfxOutSurface;
- }
- }
- }
-
- status = MFX_ERR_NONE;
-
- bail:
- return status;
- }
+ INTEL_DEBUG_INFO("nEncSurfNum = %hu", m_sAllocRequest.NumFrameSuggested);
+ INTEL_CHECK_STATUS(status = AllocSurfaces(m_sAllocRequest.NumFrameSuggested, m_sAllocRequest.Info.Width, m_sAllocRequest.Info.Height, &m_sParamReq.mfx.FrameInfo));
+#endif
+ // Initialize the Media SDK decoder
+ status = m_Inst.Init(&m_sParamReq);
+ if (status != MFX_ERR_NONE && status != MFX_WRN_PARTIAL_ACCELERATION) {
+ INTEL_CHECK_STATUS(status);
+ }
+ INTEL_DEBUG_INFO("Decoder->Init() returned: %d", status);
+
+ m_bInit = true;
+ }
+
+ //
+ // Stage 1: Main decoding loop
+ //
+ while (MFX_ERR_NONE <= status || MFX_ERR_MORE_DATA == status || MFX_ERR_MORE_SURFACE == status) {
+ if (MFX_WRN_DEVICE_BUSY == status) {
+ tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call to DecodeFrameAsync
+ }
+
+ if (MFX_ERR_MORE_DATA == status) {
+ return MFX_ERR_NONE;
+ }
+
+ if (MFX_ERR_MORE_SURFACE == status || MFX_ERR_NONE == status) {
+ nSurfaceIndex = GetFreeSurfaceIndex(); // Find free frame surface
+ if (MFX_ERR_NOT_FOUND == nSurfaceIndex) {
+ INTEL_CHECK_STATUS((status = MFX_ERR_MEMORY_ALLOC));
+ }
+ }
+
+ // Decode a frame asychronously (returns immediately)
+ // - If input bitstream contains multiple frames DecodeFrameAsync will start decoding multiple frames, and remove them from bitstream
+ status = m_Inst.DecodeFrameAsync(&m_sBitstream, m_ppSurfacePtrs[nSurfaceIndex], &pmfxOutSurface, &syncp);
+
+ // Ignore warnings if output is available,
+ // if no output and no action required just repeat the DecodeFrameAsync call
+ if (MFX_ERR_NONE < status && syncp) {
+ status = MFX_ERR_NONE;
+ }
+
+ if (MFX_ERR_NONE == status) {
+ status = m_pSession->SyncOperation(syncp, 60000); // Synchronize. Wait until decoded frame is ready
+ }
+
+ if (MFX_ERR_NONE == status) {
+ bGotFrame = true;
+ if (pmfxOutSurface) {
+ *ppmfxOutSurface = pmfxOutSurface;
+ }
+ }
+ }
+
+ //
+ // Stage 2: Retrieve the buffered decoded frames
+ //
+ while (MFX_ERR_NONE <= status || MFX_ERR_MORE_SURFACE == status) {
+ if (MFX_WRN_DEVICE_BUSY == status) {
+ tsk_thread_sleep(1); // Wait if device is busy, then repeat the same call to DecodeFrameAsync
+ }
+
+ nSurfaceIndex = GetFreeSurfaceIndex(); // Find free frame surface
+ if (MFX_ERR_NOT_FOUND == nSurfaceIndex) {
+ INTEL_CHECK_STATUS((status = MFX_ERR_MEMORY_ALLOC));
+ }
+
+ // Decode a frame asychronously (returns immediately)
+ status = m_Inst.DecodeFrameAsync(NULL, m_ppSurfacePtrs[nSurfaceIndex], ppmfxOutSurface, &syncp);
+
+ // Ignore warnings if output is available,
+ // if no output and no action required just repeat the DecodeFrameAsync call
+ if (MFX_ERR_NONE < status && syncp) {
+ status = MFX_ERR_NONE;
+ }
+
+ if (MFX_ERR_NONE == status) {
+ status = m_pSession->SyncOperation(syncp, 60000); // Synchronize. Waits until decoded frame is ready
+ }
+
+ if (MFX_ERR_NONE == status) {
+ bGotFrame = true;
+ if (pmfxOutSurface) {
+ *ppmfxOutSurface = pmfxOutSurface;
+ }
+ }
+ }
+
+ status = MFX_ERR_NONE;
+
+bail:
+ return status;
+ }
private:
- mfxU8 *m_pAccumulatorPtr;
- mfxU32 m_nAccumulatorSize;
- mfxU32 m_nAccumulatorPos;
- mfxU32 m_nLastRtpTimestamp;
- MFXVideoDECODE m_Inst;
- bool m_bInit;
+ mfxU8 *m_pAccumulatorPtr;
+ mfxU32 m_nAccumulatorSize;
+ mfxU32 m_nAccumulatorPos;
+ mfxU32 m_nLastRtpTimestamp;
+ MFXVideoDECODE m_Inst;
+ bool m_bInit;
};
/* ============ H.264 Base/Main Profile X.X Plugin interface functions ================= */
static int tdav_codec_h264_intel_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
- if (param->value_type == tmedia_pvt_int32)
- {
- if (tsk_striequals(param->key, "action"))
- {
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch (action) {
- case tmedia_codec_action_encode_idr:
- {
- h264->encoder.force_idr = tsk_true;
- return 0;
- }
- case tmedia_codec_action_bw_up:
- case tmedia_codec_action_bw_down:
- {
- if (self->opened)
- {
- INTEL_CHECK_STATUS(h264->encoder.pInst->UpdateBandwidth(action == tmedia_codec_action_bw_up, TMEDIA_CODEC(h264)->bandwidth_max_upload));
- }
- break;
- }
- }
- }
- else if (tsk_striequals(param->key, "bw_kbps")) // both up and down (from the SDP)
- {
- int32_t max_bw_userdefine = tmedia_defaults_get_bandwidth_video_upload_max();
- int32_t max_bw_new = *((int32_t*)param->value);
- if (max_bw_userdefine > 0)
- {
- // do not use more than what the user defined in it's configuration
- TMEDIA_CODEC(h264)->bandwidth_max_upload = TSK_MIN(max_bw_new, max_bw_userdefine);
- }
- else
- {
- TMEDIA_CODEC(h264)->bandwidth_max_upload = max_bw_new;
- }
- INTEL_DEBUG_INFO("bandwidth-max-upload=%d", TMEDIA_CODEC(h264)->bandwidth_max_upload);
- if (self->opened)
- {
- INTEL_CHECK_STATUS(h264->encoder.pInst->SetMaxBandwidth(TMEDIA_CODEC(h264)->bandwidth_max_upload));
- }
- return 0;
- }
- else if (tsk_striequals(param->key, "bandwidth-max-upload"))
- {
- int32_t bw_max_upload = *((int32_t*)param->value);
- TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload=%d", bw_max_upload);
- TMEDIA_CODEC(h264)->bandwidth_max_upload = bw_max_upload;
- if (self->opened)
- {
- INTEL_CHECK_STATUS(h264->encoder.pInst->SetMaxBandwidth(TMEDIA_CODEC(h264)->bandwidth_max_upload));
- }
- return 0;
- }
- else if (tsk_striequals(param->key, "rotation"))
- {
- int rotation = *((int32_t*)param->value);
- if (h264->encoder.rotation != rotation)
- {
- if (self->opened)
- {
- int ret;
- h264->encoder.rotation = rotation;
- if ((ret = tdav_codec_h264_intel_close_encoder(h264)))
- {
- return ret;
- }
- if ((ret = tdav_codec_h264_intel_open_encoder(h264)))
- {
- return ret;
- }
- }
- }
- return 0;
- }
- }
+ tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch (action) {
+ case tmedia_codec_action_encode_idr: {
+ h264->encoder.force_idr = tsk_true;
+ return 0;
+ }
+ case tmedia_codec_action_bw_up:
+ case tmedia_codec_action_bw_down: {
+ if (self->opened) {
+ INTEL_CHECK_STATUS(h264->encoder.pInst->UpdateBandwidth(action == tmedia_codec_action_bw_up, TMEDIA_CODEC(h264)->bandwidth_max_upload));
+ }
+ break;
+ }
+ }
+ }
+ else if (tsk_striequals(param->key, "bw_kbps")) { // both up and down (from the SDP)
+ int32_t max_bw_userdefine = tmedia_defaults_get_bandwidth_video_upload_max();
+ int32_t max_bw_new = *((int32_t*)param->value);
+ if (max_bw_userdefine > 0) {
+ // do not use more than what the user defined in it's configuration
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = TSK_MIN(max_bw_new, max_bw_userdefine);
+ }
+ else {
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = max_bw_new;
+ }
+ INTEL_DEBUG_INFO("bandwidth-max-upload=%d", TMEDIA_CODEC(h264)->bandwidth_max_upload);
+ if (self->opened) {
+ INTEL_CHECK_STATUS(h264->encoder.pInst->SetMaxBandwidth(TMEDIA_CODEC(h264)->bandwidth_max_upload));
+ }
+ return 0;
+ }
+ else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
+ int32_t bw_max_upload = *((int32_t*)param->value);
+ TSK_DEBUG_INFO("OpenH264 codec: bandwidth-max-upload=%d", bw_max_upload);
+ TMEDIA_CODEC(h264)->bandwidth_max_upload = bw_max_upload;
+ if (self->opened) {
+ INTEL_CHECK_STATUS(h264->encoder.pInst->SetMaxBandwidth(TMEDIA_CODEC(h264)->bandwidth_max_upload));
+ }
+ return 0;
+ }
+ else if (tsk_striequals(param->key, "rotation")) {
+ int rotation = *((int32_t*)param->value);
+ if (h264->encoder.rotation != rotation) {
+ if (self->opened) {
+ int ret;
+ h264->encoder.rotation = rotation;
+ if ((ret = tdav_codec_h264_intel_close_encoder(h264))) {
+ return ret;
+ }
+ if ((ret = tdav_codec_h264_intel_open_encoder(h264))) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }
+ }
bail:
- return -1;
+ return -1;
}
static int tdav_codec_h264_intel_open(tmedia_codec_t* self)
{
- int ret;
- tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
+ int ret;
+ tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
- if (!h264) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) already checked that the codec is not opened */
+ /* the caller (base class) already checked that the codec is not opened */
- // Encoder
- if ((ret = tdav_codec_h264_intel_open_encoder(h264))) {
- return ret;
- }
+ // Encoder
+ if ((ret = tdav_codec_h264_intel_open_encoder(h264))) {
+ return ret;
+ }
- // Decoder
- if ((ret = tdav_codec_h264_intel_open_decoder(h264))) {
- return ret;
- }
+ // Decoder
+ if ((ret = tdav_codec_h264_intel_open_decoder(h264))) {
+ return ret;
+ }
- return 0;
+ return 0;
}
static int tdav_codec_h264_intel_close(tmedia_codec_t* self)
{
- tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
+ tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
- if (!h264)
- {
- INTEL_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!h264) {
+ INTEL_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) alreasy checked that the codec is opened */
+ /* the caller (base class) alreasy checked that the codec is opened */
- // Encoder
- tdav_codec_h264_intel_close_encoder(h264);
+ // Encoder
+ tdav_codec_h264_intel_close_encoder(h264);
- // Decoder
- tdav_codec_h264_intel_close_decoder(h264);
+ // Decoder
+ tdav_codec_h264_intel_close_decoder(h264);
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_intel_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
- (void)(out_data);
- (void)(out_max_size);
-
- if (!h264 || !h264->encoder.pInst)
- {
- INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
- }
- INTEL_CHECK_STATUS(h264->encoder.pInst->Encode(self, (const mfxU8*)in_data, (mfxU32)in_size));
+ tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
+ (void)(out_data);
+ (void)(out_max_size);
+
+ if (!h264 || !h264->encoder.pInst) {
+ INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
+ }
+ INTEL_CHECK_STATUS(h264->encoder.pInst->Encode(self, (const mfxU8*)in_data, (mfxU32)in_size));
bail:
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_h264_intel_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
+ tdav_codec_h264_intel_t* h264 = (tdav_codec_h264_intel_t*)self;
- if (!h264 || !h264->decoder.pInst)
- {
- INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
- }
- return (tsk_size_t)h264->decoder.pInst->Decode(self, (const mfxU8*)in_data, (mfxU32)in_size, out_data, out_max_size, (const trtp_rtp_header_t*)proto_hdr);
+ if (!h264 || !h264->decoder.pInst) {
+ INTEL_CHECK_STATUS(MFX_ERR_NULL_PTR);
+ }
+ return (tsk_size_t)h264->decoder.pInst->Decode(self, (const mfxU8*)in_data, (mfxU32)in_size, out_data, out_max_size, (const trtp_rtp_header_t*)proto_hdr);
bail:
- return 0;
+ return 0;
}
static tsk_bool_t tdav_codec_h264_intel_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
+ return tdav_codec_h264_common_sdp_att_match((tdav_codec_h264_common_t*)self, att_name, att_value);
}
static char* tdav_codec_h264_intel_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
- if (att && tsk_striequals(att_name, "fmtp")) {
- tsk_strcat(&att, "; impl=intel");
- }
- return att;
+ char* att = tdav_codec_h264_common_sdp_att_get((const tdav_codec_h264_common_t*)self, att_name);
+ if (att && tsk_striequals(att_name, "fmtp")) {
+ tsk_strcat(&att, "; impl=intel");
+ }
+ return att;
}
/* ============ H.264 Base Profile Plugin interface ================= */
@@ -1477,63 +1335,61 @@ static char* tdav_codec_h264_intel_sdp_att_get(const tmedia_codec_t* self, const
/* constructor */
static tsk_object_t* tdav_codec_h264_intel_base_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
- if (h264) {
- /* init base: called by tmedia_codec_create() */
- /* init self */
- if (tdav_codec_h264_intel_init(h264, profile_idc_baseline) != 0) {
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
+ if (h264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ if (tdav_codec_h264_intel_init(h264, profile_idc_baseline) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_intel_base_dtor(tsk_object_t * self)
{
- tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
- if (h264) {
- /* deinit base */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_intel_deinit(h264);
- }
-
- return self;
+ tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
+ if (h264) {
+ /* deinit base */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_intel_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_intel_base_def_s =
-{
- sizeof(tdav_codec_h264_intel_t),
- tdav_codec_h264_intel_base_ctor,
- tdav_codec_h264_intel_base_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_intel_base_def_s = {
+ sizeof(tdav_codec_h264_intel_t),
+ tdav_codec_h264_intel_base_ctor,
+ tdav_codec_h264_intel_base_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_intel_base_plugin_def_s =
-{
- &tdav_codec_h264_intel_base_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "H264 Base Profile (Intel Media SDK)",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- { 176, 144, 0 }, // fps is @deprecated
-
- tdav_codec_h264_intel_set,
- tdav_codec_h264_intel_open,
- tdav_codec_h264_intel_close,
- tdav_codec_h264_intel_encode,
- tdav_codec_h264_intel_decode,
- tdav_codec_h264_intel_sdp_att_match,
- tdav_codec_h264_intel_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h264_intel_base_plugin_def_s = {
+ &tdav_codec_h264_intel_base_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "H264 Base Profile (Intel Media SDK)",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ { 176, 144, 0 }, // fps is @deprecated
+
+ tdav_codec_h264_intel_set,
+ tdav_codec_h264_intel_open,
+ tdav_codec_h264_intel_close,
+ tdav_codec_h264_intel_encode,
+ tdav_codec_h264_intel_decode,
+ tdav_codec_h264_intel_sdp_att_match,
+ tdav_codec_h264_intel_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h264_intel_base_plugin_def_t = &tdav_codec_h264_intel_base_plugin_def_s;
@@ -1543,64 +1399,61 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_intel_base_plugin_def_t = &tdav
/* constructor */
static tsk_object_t* tdav_codec_h264_intel_main_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
- if (h264) {
- /* init main: called by tmedia_codec_create() */
- /* init self */
- if (tdav_codec_h264_intel_init(h264, profile_idc_main) != 0) {
- return tsk_null;
- }
- }
- return self;
+ tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
+ if (h264) {
+ /* init main: called by tmedia_codec_create() */
+ /* init self */
+ if (tdav_codec_h264_intel_init(h264, profile_idc_main) != 0) {
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_h264_intel_main_dtor(tsk_object_t * self)
{
- tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
- if (h264)
- {
- /* deinit main */
- tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
- /* deinit self */
- tdav_codec_h264_intel_deinit(h264);
- }
-
- return self;
+ tdav_codec_h264_intel_t *h264 = (tdav_codec_h264_intel_t*)self;
+ if (h264) {
+ /* deinit main */
+ tdav_codec_h264_common_deinit(TDAV_CODEC_H264_COMMON(self));
+ /* deinit self */
+ tdav_codec_h264_intel_deinit(h264);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_h264_intel_main_def_s =
-{
- sizeof(tdav_codec_h264_intel_t),
- tdav_codec_h264_intel_main_ctor,
- tdav_codec_h264_intel_main_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_h264_intel_main_def_s = {
+ sizeof(tdav_codec_h264_intel_t),
+ tdav_codec_h264_intel_main_ctor,
+ tdav_codec_h264_intel_main_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_h264_intel_main_plugin_def_s =
-{
- &tdav_codec_h264_intel_main_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_mp,
- "H264",
- "H264 main Profile (Intel Media SDK)",
- TMEDIA_CODEC_FORMAT_H264_MP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- { 176, 144, 0 }, // fps is @deprecated
-
- tdav_codec_h264_intel_set,
- tdav_codec_h264_intel_open,
- tdav_codec_h264_intel_close,
- tdav_codec_h264_intel_encode,
- tdav_codec_h264_intel_decode,
- tdav_codec_h264_intel_sdp_att_match,
- tdav_codec_h264_intel_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_h264_intel_main_plugin_def_s = {
+ &tdav_codec_h264_intel_main_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_mp,
+ "H264",
+ "H264 main Profile (Intel Media SDK)",
+ TMEDIA_CODEC_FORMAT_H264_MP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ { 176, 144, 0 }, // fps is @deprecated
+
+ tdav_codec_h264_intel_set,
+ tdav_codec_h264_intel_open,
+ tdav_codec_h264_intel_close,
+ tdav_codec_h264_intel_encode,
+ tdav_codec_h264_intel_decode,
+ tdav_codec_h264_intel_sdp_att_match,
+ tdav_codec_h264_intel_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_h264_intel_main_plugin_def_t = &tdav_codec_h264_intel_main_plugin_def_s;
@@ -1608,171 +1461,158 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_intel_main_plugin_def_t = &tdav
static int tdav_codec_h264_intel_open_encoder(tdav_codec_h264_intel_t* self)
{
- if (self->encoder.pInst)
- {
- INTEL_BREAK("Already initialized");
- }
+ if (self->encoder.pInst) {
+ INTEL_BREAK("Already initialized");
+ }
- if (!(self->encoder.pInst = new IntelCodecEncoder(self->mfxSession)))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
- INTEL_CHECK_STATUS(self->encoder.pInst->Open(self));
+ if (!(self->encoder.pInst = new IntelCodecEncoder(self->mfxSession))) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+ INTEL_CHECK_STATUS(self->encoder.pInst->Open(self));
- return 0;
+ return 0;
bail:
- if (self->encoder.pInst)
- {
- delete self->encoder.pInst, self->encoder.pInst = NULL;
- }
- return -1;
+ if (self->encoder.pInst) {
+ delete self->encoder.pInst, self->encoder.pInst = NULL;
+ }
+ return -1;
}
static int tdav_codec_h264_intel_close_encoder(tdav_codec_h264_intel_t* self)
{
- if (self)
- {
- if (self->encoder.pInst)
- {
- delete self->encoder.pInst;
- self->encoder.pInst = NULL;
- }
- self->encoder.frame_count = 0;
- }
- return 0;
+ if (self) {
+ if (self->encoder.pInst) {
+ delete self->encoder.pInst;
+ self->encoder.pInst = NULL;
+ }
+ self->encoder.frame_count = 0;
+ }
+ return 0;
}
int tdav_codec_h264_intel_open_decoder(tdav_codec_h264_intel_t* self)
{
- if (self->decoder.pInst)
- {
- INTEL_BREAK("Already initialized");
- }
+ if (self->decoder.pInst) {
+ INTEL_BREAK("Already initialized");
+ }
- if (!(self->decoder.pInst = new IntelCodecDecoder(self->mfxSession)))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
- INTEL_CHECK_STATUS(self->decoder.pInst->Open(self));
+ if (!(self->decoder.pInst = new IntelCodecDecoder(self->mfxSession))) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+ INTEL_CHECK_STATUS(self->decoder.pInst->Open(self));
- return 0;
+ return 0;
bail:
- if (self->decoder.pInst)
- {
- delete self->decoder.pInst, self->decoder.pInst = NULL;
- }
- return -1;
+ if (self->decoder.pInst) {
+ delete self->decoder.pInst, self->decoder.pInst = NULL;
+ }
+ return -1;
}
static int tdav_codec_h264_intel_close_decoder(tdav_codec_h264_intel_t* self)
{
- if (self)
- {
- if (self->decoder.pInst)
- {
- delete self->decoder.pInst;
- self->decoder.pInst = NULL;
- }
- }
- return 0;
+ if (self) {
+ if (self->decoder.pInst) {
+ delete self->decoder.pInst;
+ self->decoder.pInst = NULL;
+ }
+ }
+ return 0;
}
static int tdav_codec_h264_intel_init(tdav_codec_h264_intel_t* self, profile_idc_t profile)
{
- int ret = -1;
- level_idc_t level;
- tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
+ int ret = -1;
+ level_idc_t level;
+ tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
#if INTEL_DX11_D3D
- mfxHDL deviceHandle = NULL;
+ mfxHDL deviceHandle = NULL;
#endif
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if ((ret = tdav_codec_h264_common_init(common))) {
- TSK_DEBUG_ERROR("tdav_codec_h264_intel_common_init() faile with error code=%d", ret);
- goto bail;
- }
-
- if ((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
- TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- goto bail;
- }
-
- if (/*MFUtils::IsLowLatencyH264SupportsMaxSliceSize()*/0) { // TODO: MSDK doesn't support PM=0. Neg. PM=1 but try to do the best to produce SingleNalUnits
- common->pack_mode_local = H264_PACKETIZATION_MODE;
- }
- else {
- common->pack_mode_local = Non_Interleaved_Mode;
- }
- common->profile = profile;
- common->level = level;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if ((ret = tdav_codec_h264_common_init(common))) {
+ TSK_DEBUG_ERROR("tdav_codec_h264_intel_common_init() faile with error code=%d", ret);
+ goto bail;
+ }
+
+ if ((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
+ TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ goto bail;
+ }
+
+ if (/*MFUtils::IsLowLatencyH264SupportsMaxSliceSize()*/0) { // TODO: MSDK doesn't support PM=0. Neg. PM=1 but try to do the best to produce SingleNalUnits
+ common->pack_mode_local = H264_PACKETIZATION_MODE;
+ }
+ else {
+ common->pack_mode_local = Non_Interleaved_Mode;
+ }
+ common->profile = profile;
+ common->level = level;
#if 0
- // A.2.1.1 Constrained Baseline profile
- // Conformance of a bitstream to the Constrained Baseline profile is indicated by profile_idc being equal to 66 with
- // constraint_set1_flag being equal to 1.
- common->profile_iop = 0xe0; // "constraint_set0_flag=1 and constraint_set1_flag=1" -> Constrained Baseline profile
+ // A.2.1.1 Constrained Baseline profile
+ // Conformance of a bitstream to the Constrained Baseline profile is indicated by profile_idc being equal to 66 with
+ // constraint_set1_flag being equal to 1.
+ common->profile_iop = 0xe0; // "constraint_set0_flag=1 and constraint_set1_flag=1" -> Constrained Baseline profile
#endif
- TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS * 1000;
- TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR * 1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS * 1000;
+ TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR * 1000;
- TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p; // decoded
- TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p; // encoded
+ TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p; // decoded
+ TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p; // encoded
- if (!self->mfxSession && !(self->mfxSession = new MFXVideoSession()))
- {
- INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
- }
- INTEL_CHECK_STATUS(self->mfxSession->Init(__IntelDefaultImpl, &__IntelDefaultVer));
+ if (!self->mfxSession && !(self->mfxSession = new MFXVideoSession())) {
+ INTEL_CHECK_STATUS(MFX_ERR_MEMORY_ALLOC);
+ }
+ INTEL_CHECK_STATUS(self->mfxSession->Init(__IntelDefaultImpl, &__IntelDefaultVer));
#if INTEL_DX11_D3D
- // Create DirectX device context
- INTEL_CHECK_STATUS(D3D11_CreateHWDevice(self, *self->mfxSession, &deviceHandle, NULL));
-
- // Provide device manager to Media SDK
- INTEL_CHECK_STATUS(self->mfxSession->SetHandle(MFX_HANDLE_D3D11_DEVICE, deviceHandle));
-
- self->D3D11Allocator.Alloc = D3D11_SimpleAlloc;
- self->D3D11Allocator.Free = D3D11_SimpleFree;
- self->D3D11Allocator.Lock = D3D11_SimpleLock;
- self->D3D11Allocator.Unlock = D3D11_SimpleUnlock;
- self->D3D11Allocator.GetHDL = D3D11_SimpleGethdl;
- self->D3D11Allocator.pthis = self;
-
- // Since we are using video memory we must provide Media SDK with an external allocator
- INTEL_CHECK_STATUS(self->mfxSession->SetFrameAllocator(&self->D3D11Allocator));
+ // Create DirectX device context
+ INTEL_CHECK_STATUS(D3D11_CreateHWDevice(self, *self->mfxSession, &deviceHandle, NULL));
+
+ // Provide device manager to Media SDK
+ INTEL_CHECK_STATUS(self->mfxSession->SetHandle(MFX_HANDLE_D3D11_DEVICE, deviceHandle));
+
+ self->D3D11Allocator.Alloc = D3D11_SimpleAlloc;
+ self->D3D11Allocator.Free = D3D11_SimpleFree;
+ self->D3D11Allocator.Lock = D3D11_SimpleLock;
+ self->D3D11Allocator.Unlock = D3D11_SimpleUnlock;
+ self->D3D11Allocator.GetHDL = D3D11_SimpleGethdl;
+ self->D3D11Allocator.pthis = self;
+
+ // Since we are using video memory we must provide Media SDK with an external allocator
+ INTEL_CHECK_STATUS(self->mfxSession->SetFrameAllocator(&self->D3D11Allocator));
#endif /* INTEL_DX11_D3D */
- ret = 0;
+ ret = 0;
bail:
- return ret;
+ return ret;
}
static int tdav_codec_h264_intel_deinit(tdav_codec_h264_intel_t* self)
{
- if (!self)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tdav_codec_h264_intel_close((tmedia_codec_t*)self);
+ tdav_codec_h264_intel_close((tmedia_codec_t*)self);
- if (self->mfxSession)
- {
- delete self->mfxSession, self->mfxSession = NULL;
- }
+ if (self->mfxSession) {
+ delete self->mfxSession, self->mfxSession = NULL;
+ }
#if INTEL_DX11_D3D
- D3D11_CleanupHWDevice(self);
+ D3D11_CleanupHWDevice(self);
#endif /* INTEL_DX11_D3D */
- return 0;
+ return 0;
}
@@ -1780,40 +1620,36 @@ static int tdav_codec_h264_intel_deinit(tdav_codec_h264_intel_t* self)
static IDXGIAdapter* D3D11_GetIntelDeviceAdapterHandle(mfxHDL _pthis, mfxSession session)
{
- mfxU32 adapterNum = 0;
- mfxIMPL impl;
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
-
- MFXQueryIMPL(session, &impl);
-
- mfxIMPL baseImpl = MFX_IMPL_BASETYPE(impl); // Extract Media SDK base implementation type
-
- // get corresponding adapter number
- for (mfxU8 i = 0; i < sizeof(implTypes) / sizeof(implTypes[0]); i++)
- {
- if (implTypes[i].impl == baseImpl)
- {
- adapterNum = implTypes[i].adapterID;
- break;
- }
- }
-
- HRESULT hres = CreateDXGIFactory(__uuidof(IDXGIFactory2), (void**)(&pthis->pDXGIFactory));
- if (FAILED(hres))
- {
- INTEL_DEBUG_ERROR("CreateDXGIFactory failed: %ld", hres);
- return NULL;
- }
-
- IDXGIAdapter* adapter = NULL;
- hres = pthis->pDXGIFactory->EnumAdapters(adapterNum, &adapter);
- if (FAILED(hres))
- {
- INTEL_DEBUG_ERROR("EnumAdapters failed: %ld", hres);
- return NULL;
- }
-
- return adapter;
+ mfxU32 adapterNum = 0;
+ mfxIMPL impl;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+
+ MFXQueryIMPL(session, &impl);
+
+ mfxIMPL baseImpl = MFX_IMPL_BASETYPE(impl); // Extract Media SDK base implementation type
+
+ // get corresponding adapter number
+ for (mfxU8 i = 0; i < sizeof(implTypes) / sizeof(implTypes[0]); i++) {
+ if (implTypes[i].impl == baseImpl) {
+ adapterNum = implTypes[i].adapterID;
+ break;
+ }
+ }
+
+ HRESULT hres = CreateDXGIFactory(__uuidof(IDXGIFactory2), (void**)(&pthis->pDXGIFactory));
+ if (FAILED(hres)) {
+ INTEL_DEBUG_ERROR("CreateDXGIFactory failed: %ld", hres);
+ return NULL;
+ }
+
+ IDXGIAdapter* adapter = NULL;
+ hres = pthis->pDXGIFactory->EnumAdapters(adapterNum, &adapter);
+ if (FAILED(hres)) {
+ INTEL_DEBUG_ERROR("EnumAdapters failed: %ld", hres);
+ return NULL;
+ }
+
+ return adapter;
}
// Create DirectX 11 device context
@@ -1826,394 +1662,361 @@ static IDXGIAdapter* D3D11_GetIntelDeviceAdapterHandle(mfxHDL _pthis, mfxSession
// - For switchable graphics solutions (mobile) make sure that Intel device is the active device
static mfxStatus D3D11_CreateHWDevice(mfxHDL _pthis, mfxSession session, mfxHDL* deviceHandle, HWND hWnd)
{
- hWnd; // Window handle not required by DX11 since we do not showcase rendering.
-
- HRESULT hres = S_OK;
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
-
- static D3D_FEATURE_LEVEL FeatureLevels[] = {
- D3D_FEATURE_LEVEL_11_1,
- D3D_FEATURE_LEVEL_11_0,
- D3D_FEATURE_LEVEL_10_1,
- D3D_FEATURE_LEVEL_10_0
- };
- D3D_FEATURE_LEVEL pFeatureLevelsOut;
-
- pthis->hAdapter = D3D11_GetIntelDeviceAdapterHandle(_pthis, session);
- if (NULL == pthis->hAdapter)
- {
- INTEL_DEBUG_ERROR("D3D11_GetIntelDeviceAdapterHandle failed");
- return MFX_ERR_DEVICE_FAILED;
- }
-
- hres = D3D11CreateDevice(pthis->hAdapter,
- D3D_DRIVER_TYPE_UNKNOWN,
- NULL,
- 0,
- FeatureLevels,
- (sizeof(FeatureLevels) / sizeof(FeatureLevels[0])),
- D3D11_SDK_VERSION,
- &pthis->pD3D11Device,
- &pFeatureLevelsOut,
- &pthis->pD3D11Ctx);
- if (FAILED(hres))
- {
- INTEL_DEBUG_ERROR("D3D11CreateDevice failed: %ld", hres);
- return MFX_ERR_DEVICE_FAILED;
- }
-
- // turn on multithreading for the DX11 cntext
- CComQIPtr<ID3D10Multithread> p_mt(pthis->pD3D11Ctx);
- if (p_mt)
- {
- p_mt->SetMultithreadProtected(true);
- }
- else
- {
- INTEL_DEBUG_ERROR("Failed to create ID3D10Multithread object");
- return MFX_ERR_DEVICE_FAILED;
- }
-
- *deviceHandle = (mfxHDL)pthis->pD3D11Device;
- return MFX_ERR_NONE;
+ hWnd; // Window handle not required by DX11 since we do not showcase rendering.
+
+ HRESULT hres = S_OK;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+
+ static D3D_FEATURE_LEVEL FeatureLevels[] = {
+ D3D_FEATURE_LEVEL_11_1,
+ D3D_FEATURE_LEVEL_11_0,
+ D3D_FEATURE_LEVEL_10_1,
+ D3D_FEATURE_LEVEL_10_0
+ };
+ D3D_FEATURE_LEVEL pFeatureLevelsOut;
+
+ pthis->hAdapter = D3D11_GetIntelDeviceAdapterHandle(_pthis, session);
+ if (NULL == pthis->hAdapter) {
+ INTEL_DEBUG_ERROR("D3D11_GetIntelDeviceAdapterHandle failed");
+ return MFX_ERR_DEVICE_FAILED;
+ }
+
+ hres = D3D11CreateDevice(pthis->hAdapter,
+ D3D_DRIVER_TYPE_UNKNOWN,
+ NULL,
+ 0,
+ FeatureLevels,
+ (sizeof(FeatureLevels) / sizeof(FeatureLevels[0])),
+ D3D11_SDK_VERSION,
+ &pthis->pD3D11Device,
+ &pFeatureLevelsOut,
+ &pthis->pD3D11Ctx);
+ if (FAILED(hres)) {
+ INTEL_DEBUG_ERROR("D3D11CreateDevice failed: %ld", hres);
+ return MFX_ERR_DEVICE_FAILED;
+ }
+
+ // turn on multithreading for the DX11 cntext
+ CComQIPtr<ID3D10Multithread> p_mt(pthis->pD3D11Ctx);
+ if (p_mt) {
+ p_mt->SetMultithreadProtected(true);
+ }
+ else {
+ INTEL_DEBUG_ERROR("Failed to create ID3D10Multithread object");
+ return MFX_ERR_DEVICE_FAILED;
+ }
+
+ *deviceHandle = (mfxHDL)pthis->pD3D11Device;
+ return MFX_ERR_NONE;
}
static void D3D11_CleanupHWDevice(mfxHDL _pthis)
{
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
- pthis->pD3D11Device = NULL;
- pthis->pDXGIFactory = NULL;
- pthis->pD3D11Ctx = NULL;
- pthis->hAdapter = NULL;
- pthis->pAdapter = NULL;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+ pthis->pD3D11Device = NULL;
+ pthis->pDXGIFactory = NULL;
+ pthis->pD3D11Ctx = NULL;
+ pthis->hAdapter = NULL;
+ pthis->pAdapter = NULL;
}
static void D3D11_SetHWDeviceContext(mfxHDL _pthis, CComPtr<ID3D11DeviceContext> devCtx)
{
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
- pthis->pD3D11Ctx = devCtx;
- devCtx->GetDevice(&pthis->pD3D11Device);
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+ pthis->pD3D11Ctx = devCtx;
+ devCtx->GetDevice(&pthis->pD3D11Device);
}
// Intel Media SDK memory allocator entrypoints....
// - A slightly different allocation procedure is used for encode, decode and VPP
static mfxStatus _D3D11_SimpleAlloc(mfxHDL _pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response)
{
- HRESULT hRes;
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
-
- // Determine surface format (current simple implementation only supports NV12 and RGB4(32))
- DXGI_FORMAT format;
- if (MFX_FOURCC_NV12 == request->Info.FourCC)
- {
- format = DXGI_FORMAT_NV12;
- }
- else if (MFX_FOURCC_RGB4 == request->Info.FourCC)
- {
- format = DXGI_FORMAT_B8G8R8A8_UNORM;
- }
- else
- {
- format = DXGI_FORMAT_P8;
- }
-
- // Allocate custom container to keep texture and stage buffers for each surface
- // Container also stores the intended read and/or write operation.
- CustomMemId** mids = new CustomMemId *[request->NumFrameSuggested];
- if (!mids) return MFX_ERR_MEMORY_ALLOC;
- for (int i = 0; i < request->NumFrameSuggested; i++)
- {
- mids[i] = new CustomMemId;
- memset(mids[i], 0, sizeof(CustomMemId));
- mids[i]->rw = request->Type & 0xF000; // Set intended read/write operation
- }
-
- request->Type = request->Type & 0x0FFF;
-
- // because P8 data (bitstream) for h264 encoder should be allocated by CreateBuffer()
- // but P8 data (MBData) for MPEG2 encoder should be allocated by CreateTexture2D()
- if (request->Info.FourCC == MFX_FOURCC_P8)
- {
- D3D11_BUFFER_DESC desc = { 0 };
-
- desc.ByteWidth = request->Info.Width * request->Info.Height;
- desc.Usage = D3D11_USAGE_STAGING;
- desc.BindFlags = 0;
- desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
- desc.MiscFlags = 0;
- desc.StructureByteStride = 0;
-
- ID3D11Buffer * buffer = 0;
- hRes = pthis->pD3D11Device->CreateBuffer(&desc, 0, &buffer);
- if (FAILED(hRes))
- {
- INTEL_DEBUG_ERROR("CreateBuffer failed:%ld", hRes);
- return MFX_ERR_MEMORY_ALLOC;
- }
-
- mids[0]->memId = reinterpret_cast<ID3D11Texture2D *>(buffer);
- }
- else
- {
- D3D11_TEXTURE2D_DESC desc = { 0 };
-
- desc.Width = request->Info.Width;
- desc.Height = request->Info.Height;
- desc.MipLevels = 1;
- desc.ArraySize = 1; // number of subresources is 1 in this case
- desc.Format = format;
- desc.SampleDesc.Count = 1;
- desc.Usage = D3D11_USAGE_DEFAULT;
- desc.BindFlags = D3D11_BIND_DECODER;
- desc.MiscFlags = 0;
-
- if ((MFX_MEMTYPE_FROM_VPPIN & request->Type) &&
- (DXGI_FORMAT_B8G8R8A8_UNORM == desc.Format))
- {
- desc.BindFlags = D3D11_BIND_RENDER_TARGET;
- if (desc.ArraySize > 2)
- return MFX_ERR_MEMORY_ALLOC;
- }
-
- if ((MFX_MEMTYPE_FROM_VPPOUT & request->Type) ||
- (MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET & request->Type))
- {
- desc.BindFlags = D3D11_BIND_RENDER_TARGET;
- if (desc.ArraySize > 2)
- {
- return MFX_ERR_MEMORY_ALLOC;
- }
- }
-
- if (DXGI_FORMAT_P8 == desc.Format)
- desc.BindFlags = 0;
-
- ID3D11Texture2D* pTexture2D;
-
- // Create surface textures
- for (size_t i = 0; i < request->NumFrameSuggested / desc.ArraySize; i++)
- {
- hRes = pthis->pD3D11Device->CreateTexture2D(&desc, NULL, &pTexture2D);
-
- if (FAILED(hRes))
- {
- INTEL_DEBUG_ERROR("CreateTexture2D failed:%ld", hRes);
- return MFX_ERR_MEMORY_ALLOC;
- }
-
- mids[i]->memId = pTexture2D;
- }
-
- desc.ArraySize = 1;
- desc.Usage = D3D11_USAGE_STAGING;
- desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ /*| D3D11_CPU_ACCESS_WRITE*/;
- desc.BindFlags = 0;
- desc.MiscFlags = 0;
-
- // Create surface staging textures
- for (size_t i = 0; i < request->NumFrameSuggested; i++)
- {
- hRes = pthis->pD3D11Device->CreateTexture2D(&desc, NULL, &pTexture2D);
-
- if (FAILED(hRes))
- {
- INTEL_DEBUG_ERROR("CreateTexture2D failed:%ld", hRes);
- return MFX_ERR_MEMORY_ALLOC;
- }
-
- mids[i]->memIdStage = pTexture2D;
- }
- }
-
- response->mids = (mfxMemId*)mids;
- response->NumFrameActual = request->NumFrameSuggested;
-
- return MFX_ERR_NONE;
+ HRESULT hRes;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+
+ // Determine surface format (current simple implementation only supports NV12 and RGB4(32))
+ DXGI_FORMAT format;
+ if (MFX_FOURCC_NV12 == request->Info.FourCC) {
+ format = DXGI_FORMAT_NV12;
+ }
+ else if (MFX_FOURCC_RGB4 == request->Info.FourCC) {
+ format = DXGI_FORMAT_B8G8R8A8_UNORM;
+ }
+ else {
+ format = DXGI_FORMAT_P8;
+ }
+
+ // Allocate custom container to keep texture and stage buffers for each surface
+ // Container also stores the intended read and/or write operation.
+ CustomMemId** mids = new CustomMemId *[request->NumFrameSuggested];
+ if (!mids) {
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+ for (int i = 0; i < request->NumFrameSuggested; i++) {
+ mids[i] = new CustomMemId;
+ memset(mids[i], 0, sizeof(CustomMemId));
+ mids[i]->rw = request->Type & 0xF000; // Set intended read/write operation
+ }
+
+ request->Type = request->Type & 0x0FFF;
+
+ // because P8 data (bitstream) for h264 encoder should be allocated by CreateBuffer()
+ // but P8 data (MBData) for MPEG2 encoder should be allocated by CreateTexture2D()
+ if (request->Info.FourCC == MFX_FOURCC_P8) {
+ D3D11_BUFFER_DESC desc = { 0 };
+
+ desc.ByteWidth = request->Info.Width * request->Info.Height;
+ desc.Usage = D3D11_USAGE_STAGING;
+ desc.BindFlags = 0;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
+ desc.MiscFlags = 0;
+ desc.StructureByteStride = 0;
+
+ ID3D11Buffer * buffer = 0;
+ hRes = pthis->pD3D11Device->CreateBuffer(&desc, 0, &buffer);
+ if (FAILED(hRes)) {
+ INTEL_DEBUG_ERROR("CreateBuffer failed:%ld", hRes);
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+
+ mids[0]->memId = reinterpret_cast<ID3D11Texture2D *>(buffer);
+ }
+ else {
+ D3D11_TEXTURE2D_DESC desc = { 0 };
+
+ desc.Width = request->Info.Width;
+ desc.Height = request->Info.Height;
+ desc.MipLevels = 1;
+ desc.ArraySize = 1; // number of subresources is 1 in this case
+ desc.Format = format;
+ desc.SampleDesc.Count = 1;
+ desc.Usage = D3D11_USAGE_DEFAULT;
+ desc.BindFlags = D3D11_BIND_DECODER;
+ desc.MiscFlags = 0;
+
+ if ((MFX_MEMTYPE_FROM_VPPIN & request->Type) &&
+ (DXGI_FORMAT_B8G8R8A8_UNORM == desc.Format)) {
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
+ if (desc.ArraySize > 2) {
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+ }
+
+ if ((MFX_MEMTYPE_FROM_VPPOUT & request->Type) ||
+ (MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET & request->Type)) {
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
+ if (desc.ArraySize > 2) {
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+ }
+
+ if (DXGI_FORMAT_P8 == desc.Format) {
+ desc.BindFlags = 0;
+ }
+
+ ID3D11Texture2D* pTexture2D;
+
+ // Create surface textures
+ for (size_t i = 0; i < request->NumFrameSuggested / desc.ArraySize; i++) {
+ hRes = pthis->pD3D11Device->CreateTexture2D(&desc, NULL, &pTexture2D);
+
+ if (FAILED(hRes)) {
+ INTEL_DEBUG_ERROR("CreateTexture2D failed:%ld", hRes);
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+
+ mids[i]->memId = pTexture2D;
+ }
+
+ desc.ArraySize = 1;
+ desc.Usage = D3D11_USAGE_STAGING;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ /*| D3D11_CPU_ACCESS_WRITE*/;
+ desc.BindFlags = 0;
+ desc.MiscFlags = 0;
+
+ // Create surface staging textures
+ for (size_t i = 0; i < request->NumFrameSuggested; i++) {
+ hRes = pthis->pD3D11Device->CreateTexture2D(&desc, NULL, &pTexture2D);
+
+ if (FAILED(hRes)) {
+ INTEL_DEBUG_ERROR("CreateTexture2D failed:%ld", hRes);
+ return MFX_ERR_MEMORY_ALLOC;
+ }
+
+ mids[i]->memIdStage = pTexture2D;
+ }
+ }
+
+ response->mids = (mfxMemId*)mids;
+ response->NumFrameActual = request->NumFrameSuggested;
+
+ return MFX_ERR_NONE;
}
static mfxStatus D3D11_SimpleAlloc(mfxHDL _pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response)
{
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
- mfxStatus sts = MFX_ERR_NONE;
- int idx = (MFX_MEMTYPE_FROM_DECODE & request->Type) ? 1 : 0;
-
- if (request->NumFrameSuggested <= pthis->D3D11SavedAllocResponses[idx].NumFrameActual &&
- MFX_MEMTYPE_EXTERNAL_FRAME & request->Type &&
- MFX_MEMTYPE_FROM_DECODE & request->Type &&
- pthis->D3D11SavedAllocResponses[idx].NumFrameActual != 0)
- {
- // Memory for this request was already allocated during manual allocation stage. Return saved response
- // When decode acceleration device (DXVA) is created it requires a list of d3d surfaces to be passed.
- // Therefore Media SDK will ask for the surface info/mids again at Init() stage, thus requiring us to return the saved response
- // (No such restriction applies to Encode or VPP)
-
- *response = pthis->D3D11SavedAllocResponses[idx];
- }
- else
- {
- sts = _D3D11_SimpleAlloc(_pthis, request, response);
- pthis->D3D11SavedAllocResponses[idx] = *response;
- }
-
- return sts;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+ mfxStatus sts = MFX_ERR_NONE;
+ int idx = (MFX_MEMTYPE_FROM_DECODE & request->Type) ? 1 : 0;
+
+ if (request->NumFrameSuggested <= pthis->D3D11SavedAllocResponses[idx].NumFrameActual &&
+ MFX_MEMTYPE_EXTERNAL_FRAME & request->Type &&
+ MFX_MEMTYPE_FROM_DECODE & request->Type &&
+ pthis->D3D11SavedAllocResponses[idx].NumFrameActual != 0) {
+ // Memory for this request was already allocated during manual allocation stage. Return saved response
+ // When decode acceleration device (DXVA) is created it requires a list of d3d surfaces to be passed.
+ // Therefore Media SDK will ask for the surface info/mids again at Init() stage, thus requiring us to return the saved response
+ // (No such restriction applies to Encode or VPP)
+
+ *response = pthis->D3D11SavedAllocResponses[idx];
+ }
+ else {
+ sts = _D3D11_SimpleAlloc(_pthis, request, response);
+ pthis->D3D11SavedAllocResponses[idx] = *response;
+ }
+
+ return sts;
}
static mfxStatus D3D11_SimpleLock(mfxHDL _pthis, mfxMemId mid, mfxFrameData *ptr)
{
- HRESULT hRes = S_OK;
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
-
- D3D11_TEXTURE2D_DESC desc = { 0 };
- D3D11_MAPPED_SUBRESOURCE lockedRect = { 0 };
-
- CustomMemId* memId = (CustomMemId*)mid;
- ID3D11Texture2D* pSurface = (ID3D11Texture2D *)memId->memId;
- ID3D11Texture2D* pStage = (ID3D11Texture2D *)memId->memIdStage;
-
- D3D11_MAP mapType = D3D11_MAP_READ;
- UINT mapFlags = D3D11_MAP_FLAG_DO_NOT_WAIT;
-
- if (NULL == pStage)
- {
- hRes = pthis->pD3D11Ctx->Map(pSurface, 0, mapType, mapFlags, &lockedRect);
- desc.Format = DXGI_FORMAT_P8;
- }
- else
- {
- pSurface->GetDesc(&desc);
-
- // copy data only in case of user wants o read from stored surface
- if (memId->rw & D3D11_WILL_READ)
- {
- pthis->pD3D11Ctx->CopySubresourceRegion(pStage, 0, 0, 0, 0, pSurface, 0, NULL);
- }
-
- do
- {
- hRes = pthis->pD3D11Ctx->Map(pStage, 0, mapType, mapFlags, &lockedRect);
- if (S_OK != hRes && DXGI_ERROR_WAS_STILL_DRAWING != hRes)
- {
- return MFX_ERR_LOCK_MEMORY;
- }
- } while (DXGI_ERROR_WAS_STILL_DRAWING == hRes);
- }
-
- if (FAILED(hRes))
- {
- return MFX_ERR_LOCK_MEMORY;
- }
-
- switch (desc.Format)
- {
- case DXGI_FORMAT_NV12:
- ptr->Pitch = (mfxU16)lockedRect.RowPitch;
- ptr->Y = (mfxU8 *)lockedRect.pData;
- ptr->U = (mfxU8 *)lockedRect.pData + desc.Height * lockedRect.RowPitch;
- ptr->V = ptr->U + 1;
- break;
- case DXGI_FORMAT_B8G8R8A8_UNORM:
- ptr->Pitch = (mfxU16)lockedRect.RowPitch;
- ptr->B = (mfxU8 *)lockedRect.pData;
- ptr->G = ptr->B + 1;
- ptr->R = ptr->B + 2;
- ptr->A = ptr->B + 3;
- break;
- case DXGI_FORMAT_P8:
- ptr->Pitch = (mfxU16)lockedRect.RowPitch;
- ptr->Y = (mfxU8 *)lockedRect.pData;
- ptr->U = 0;
- ptr->V = 0;
- break;
- default:
- return MFX_ERR_LOCK_MEMORY;
- }
-
- return MFX_ERR_NONE;
+ HRESULT hRes = S_OK;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+
+ D3D11_TEXTURE2D_DESC desc = { 0 };
+ D3D11_MAPPED_SUBRESOURCE lockedRect = { 0 };
+
+ CustomMemId* memId = (CustomMemId*)mid;
+ ID3D11Texture2D* pSurface = (ID3D11Texture2D *)memId->memId;
+ ID3D11Texture2D* pStage = (ID3D11Texture2D *)memId->memIdStage;
+
+ D3D11_MAP mapType = D3D11_MAP_READ;
+ UINT mapFlags = D3D11_MAP_FLAG_DO_NOT_WAIT;
+
+ if (NULL == pStage) {
+ hRes = pthis->pD3D11Ctx->Map(pSurface, 0, mapType, mapFlags, &lockedRect);
+ desc.Format = DXGI_FORMAT_P8;
+ }
+ else {
+ pSurface->GetDesc(&desc);
+
+ // copy data only in case of user wants o read from stored surface
+ if (memId->rw & D3D11_WILL_READ) {
+ pthis->pD3D11Ctx->CopySubresourceRegion(pStage, 0, 0, 0, 0, pSurface, 0, NULL);
+ }
+
+ do {
+ hRes = pthis->pD3D11Ctx->Map(pStage, 0, mapType, mapFlags, &lockedRect);
+ if (S_OK != hRes && DXGI_ERROR_WAS_STILL_DRAWING != hRes) {
+ return MFX_ERR_LOCK_MEMORY;
+ }
+ }
+ while (DXGI_ERROR_WAS_STILL_DRAWING == hRes);
+ }
+
+ if (FAILED(hRes)) {
+ return MFX_ERR_LOCK_MEMORY;
+ }
+
+ switch (desc.Format) {
+ case DXGI_FORMAT_NV12:
+ ptr->Pitch = (mfxU16)lockedRect.RowPitch;
+ ptr->Y = (mfxU8 *)lockedRect.pData;
+ ptr->U = (mfxU8 *)lockedRect.pData + desc.Height * lockedRect.RowPitch;
+ ptr->V = ptr->U + 1;
+ break;
+ case DXGI_FORMAT_B8G8R8A8_UNORM:
+ ptr->Pitch = (mfxU16)lockedRect.RowPitch;
+ ptr->B = (mfxU8 *)lockedRect.pData;
+ ptr->G = ptr->B + 1;
+ ptr->R = ptr->B + 2;
+ ptr->A = ptr->B + 3;
+ break;
+ case DXGI_FORMAT_P8:
+ ptr->Pitch = (mfxU16)lockedRect.RowPitch;
+ ptr->Y = (mfxU8 *)lockedRect.pData;
+ ptr->U = 0;
+ ptr->V = 0;
+ break;
+ default:
+ return MFX_ERR_LOCK_MEMORY;
+ }
+
+ return MFX_ERR_NONE;
}
static mfxStatus D3D11_SimpleUnlock(mfxHDL _pthis, mfxMemId mid, mfxFrameData *ptr)
{
- tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
-
- CustomMemId* memId = (CustomMemId*)mid;
- ID3D11Texture2D* pSurface = (ID3D11Texture2D *)memId->memId;
- ID3D11Texture2D* pStage = (ID3D11Texture2D *)memId->memIdStage;
-
- if (NULL == pStage)
- {
- pthis->pD3D11Ctx->Unmap(pSurface, 0);
- }
- else
- {
- pthis->pD3D11Ctx->Unmap(pStage, 0);
- // copy data only in case of user wants to write to stored surface
- if (memId->rw & D3D11_WILL_WRITE)
- {
- pthis->pD3D11Ctx->CopySubresourceRegion(pSurface, 0, 0, 0, 0, pStage, 0, NULL);
- }
- }
-
- if (ptr)
- {
- ptr->Pitch = 0;
- ptr->U = ptr->V = ptr->Y = 0;
- ptr->A = ptr->R = ptr->G = ptr->B = 0;
- }
-
- return MFX_ERR_NONE;
+ tdav_codec_h264_intel_t* pthis = (tdav_codec_h264_intel_t*)_pthis;
+
+ CustomMemId* memId = (CustomMemId*)mid;
+ ID3D11Texture2D* pSurface = (ID3D11Texture2D *)memId->memId;
+ ID3D11Texture2D* pStage = (ID3D11Texture2D *)memId->memIdStage;
+
+ if (NULL == pStage) {
+ pthis->pD3D11Ctx->Unmap(pSurface, 0);
+ }
+ else {
+ pthis->pD3D11Ctx->Unmap(pStage, 0);
+ // copy data only in case of user wants to write to stored surface
+ if (memId->rw & D3D11_WILL_WRITE) {
+ pthis->pD3D11Ctx->CopySubresourceRegion(pSurface, 0, 0, 0, 0, pStage, 0, NULL);
+ }
+ }
+
+ if (ptr) {
+ ptr->Pitch = 0;
+ ptr->U = ptr->V = ptr->Y = 0;
+ ptr->A = ptr->R = ptr->G = ptr->B = 0;
+ }
+
+ return MFX_ERR_NONE;
}
static mfxStatus D3D11_SimpleGethdl(mfxHDL _pthis, mfxMemId mid, mfxHDL *handle)
{
- _pthis;
- if (NULL == handle)
- {
- return MFX_ERR_INVALID_HANDLE;
- }
+ _pthis;
+ if (NULL == handle) {
+ return MFX_ERR_INVALID_HANDLE;
+ }
- mfxHDLPair* pPair = (mfxHDLPair*)handle;
- CustomMemId* memId = (CustomMemId*)mid;
+ mfxHDLPair* pPair = (mfxHDLPair*)handle;
+ CustomMemId* memId = (CustomMemId*)mid;
- pPair->first = memId->memId; // surface texture
- pPair->second = 0;
+ pPair->first = memId->memId; // surface texture
+ pPair->second = 0;
- return MFX_ERR_NONE;
+ return MFX_ERR_NONE;
}
static mfxStatus D3D11_SimpleFree(mfxHDL _pthis, mfxFrameAllocResponse *response)
{
- _pthis;
- if (NULL == response)
- {
- return MFX_ERR_NULL_PTR;
- }
-
- if (response->mids)
- {
- for (mfxU32 i = 0; i < response->NumFrameActual; i++)
- {
- if (response->mids[i])
- {
- CustomMemId* mid = (CustomMemId*)response->mids[i];
- ID3D11Texture2D* pSurface = (ID3D11Texture2D *)mid->memId;
- ID3D11Texture2D* pStage = (ID3D11Texture2D *)mid->memIdStage;
- if (pSurface)
- {
- pSurface->Release();
- }
- if (pStage)
- {
- pStage->Release();
- }
- delete mid;
- }
- }
- }
-
- delete[] response->mids;
- response->mids = 0;
-
- return MFX_ERR_NONE;
+ _pthis;
+ if (NULL == response) {
+ return MFX_ERR_NULL_PTR;
+ }
+
+ if (response->mids) {
+ for (mfxU32 i = 0; i < response->NumFrameActual; i++) {
+ if (response->mids[i]) {
+ CustomMemId* mid = (CustomMemId*)response->mids[i];
+ ID3D11Texture2D* pSurface = (ID3D11Texture2D *)mid->memId;
+ ID3D11Texture2D* pStage = (ID3D11Texture2D *)mid->memIdStage;
+ if (pSurface) {
+ pSurface->Release();
+ }
+ if (pStage) {
+ pStage->Release();
+ }
+ delete mid;
+ }
+ }
+ }
+
+ delete[] response->mids;
+ response->mids = 0;
+
+ return MFX_ERR_NONE;
}
#endif /* INTEL_DX11_D3D */
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264_rtp.c b/tinyDAV/src/codecs/h264/tdav_codec_h264_rtp.c
index 5742f43..749433e 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264_rtp.c
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264_rtp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -57,158 +57,158 @@ static int tdav_codec_h264_get_nalunit_pay(const uint8_t* in_data, tsk_size_t in
// profile_level_id MUST be a "null-terminated" string
int tdav_codec_h264_parse_profile(const char* profile_level_id, profile_idc_t *p_idc, profile_iop_t *p_iop, level_idc_t *l_idc)
{
- uint32_t value;
-
- if(tsk_strlen(profile_level_id) != 6){
- TSK_DEBUG_ERROR("I say [%s] is an invalid profile-level-id", profile_level_id);
- return -1;
- }
-
- value = strtol(profile_level_id, tsk_null, 16);
-
- /* profile-idc */
- if(p_idc){
- switch((value >> 16)){
- case profile_idc_baseline:
- *p_idc = profile_idc_baseline;
- break;
- case profile_idc_extended:
- *p_idc = profile_idc_extended;
- break;
- case profile_idc_main:
- *p_idc = profile_idc_main;
- break;
- case profile_idc_high:
- *p_idc = profile_idc_high;
- break;
- default:
- *p_idc = profile_idc_none;
- break;
- }
- }
-
- /* profile-iop */
- if(p_iop){
- p_iop->constraint_set0_flag = ((value >> 8) & 0x80)>>7;
- p_iop->constraint_set1_flag = ((value >> 8) & 0x40)>>6;
- p_iop->constraint_set2_flag = ((value >> 8) & 0x20)>>5;
- p_iop->reserved_zero_5bits = ((value >> 8) & 0x1F);
- }
-
- /* level-idc */
- if(l_idc){
- switch((value & 0xFF)){
- case level_idc_1_0:
- *l_idc = level_idc_1_0;
- break;
- case level_idc_1_b:
- *l_idc = level_idc_1_b;
- break;
- case level_idc_1_1:
- *l_idc = level_idc_1_1;
- break;
- case level_idc_1_2:
- *l_idc = level_idc_1_2;
- break;
- case level_idc_1_3:
- *l_idc = level_idc_1_3;
- break;
- case level_idc_2_0:
- *l_idc = level_idc_2_0;
- break;
- case level_idc_2_1:
- *l_idc = level_idc_2_1;
- break;
- case level_idc_2_2:
- *l_idc = level_idc_2_2;
- break;
- case level_idc_3_0:
- *l_idc = level_idc_3_0;
- break;
- case level_idc_3_1:
- *l_idc = level_idc_3_1;
- break;
- case level_idc_3_2:
- *l_idc = level_idc_3_2;
- break;
- case level_idc_4_0:
- *l_idc = level_idc_4_0;
- break;
- case level_idc_4_1:
- *l_idc = level_idc_4_1;
- break;
- case level_idc_4_2:
- *l_idc = level_idc_4_2;
- break;
- case level_idc_5_0:
- *l_idc = level_idc_5_0;
- break;
- case level_idc_5_1:
- *l_idc = level_idc_5_1;
- break;
- case level_idc_5_2:
- *l_idc = level_idc_5_2;
- break;
- default:
- *l_idc = level_idc_none;
- break;
- }
- }
-
- return 0;
+ uint32_t value;
+
+ if(tsk_strlen(profile_level_id) != 6) {
+ TSK_DEBUG_ERROR("I say [%s] is an invalid profile-level-id", profile_level_id);
+ return -1;
+ }
+
+ value = strtol(profile_level_id, tsk_null, 16);
+
+ /* profile-idc */
+ if(p_idc) {
+ switch((value >> 16)) {
+ case profile_idc_baseline:
+ *p_idc = profile_idc_baseline;
+ break;
+ case profile_idc_extended:
+ *p_idc = profile_idc_extended;
+ break;
+ case profile_idc_main:
+ *p_idc = profile_idc_main;
+ break;
+ case profile_idc_high:
+ *p_idc = profile_idc_high;
+ break;
+ default:
+ *p_idc = profile_idc_none;
+ break;
+ }
+ }
+
+ /* profile-iop */
+ if(p_iop) {
+ p_iop->constraint_set0_flag = ((value >> 8) & 0x80)>>7;
+ p_iop->constraint_set1_flag = ((value >> 8) & 0x40)>>6;
+ p_iop->constraint_set2_flag = ((value >> 8) & 0x20)>>5;
+ p_iop->reserved_zero_5bits = ((value >> 8) & 0x1F);
+ }
+
+ /* level-idc */
+ if(l_idc) {
+ switch((value & 0xFF)) {
+ case level_idc_1_0:
+ *l_idc = level_idc_1_0;
+ break;
+ case level_idc_1_b:
+ *l_idc = level_idc_1_b;
+ break;
+ case level_idc_1_1:
+ *l_idc = level_idc_1_1;
+ break;
+ case level_idc_1_2:
+ *l_idc = level_idc_1_2;
+ break;
+ case level_idc_1_3:
+ *l_idc = level_idc_1_3;
+ break;
+ case level_idc_2_0:
+ *l_idc = level_idc_2_0;
+ break;
+ case level_idc_2_1:
+ *l_idc = level_idc_2_1;
+ break;
+ case level_idc_2_2:
+ *l_idc = level_idc_2_2;
+ break;
+ case level_idc_3_0:
+ *l_idc = level_idc_3_0;
+ break;
+ case level_idc_3_1:
+ *l_idc = level_idc_3_1;
+ break;
+ case level_idc_3_2:
+ *l_idc = level_idc_3_2;
+ break;
+ case level_idc_4_0:
+ *l_idc = level_idc_4_0;
+ break;
+ case level_idc_4_1:
+ *l_idc = level_idc_4_1;
+ break;
+ case level_idc_4_2:
+ *l_idc = level_idc_4_2;
+ break;
+ case level_idc_5_0:
+ *l_idc = level_idc_5_0;
+ break;
+ case level_idc_5_1:
+ *l_idc = level_idc_5_1;
+ break;
+ case level_idc_5_2:
+ *l_idc = level_idc_5_2;
+ break;
+ default:
+ *l_idc = level_idc_none;
+ break;
+ }
+ }
+
+ return 0;
}
int tdav_codec_h264_get_pay(const void* in_data, tsk_size_t in_size, const void** out_data, tsk_size_t *out_size, tsk_bool_t* append_scp, tsk_bool_t* end_of_unit)
{
- const uint8_t* pdata = (const uint8_t*)in_data;
- uint8_t nal_type;
- if (!in_data || !in_size || !out_data || !out_size || !append_scp || !end_of_unit) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- *out_data = tsk_null;
- *out_size = 0;
-
- /* 5.3. NAL Unit Octet Usage
- +---------------+
+ const uint8_t* pdata = (const uint8_t*)in_data;
+ uint8_t nal_type;
+ if (!in_data || !in_size || !out_data || !out_size || !append_scp || !end_of_unit) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ *out_data = tsk_null;
+ *out_size = 0;
+
+ /* 5.3. NAL Unit Octet Usage
+ +---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
- */
- switch ((nal_type = (pdata[0] & 0x1F))) {
- case undefined_0:
- case undefined_30:
- case undefined_31:
- case stap_a:
- case stap_b:
- case mtap16:
- case mtap24:
- case fu_b:
- break;
- case fu_a:
- return tdav_codec_h264_get_fua_pay(pdata, in_size, out_data, out_size, append_scp, end_of_unit);
- default: /* NAL unit (1-23) */
- *append_scp = tsk_true; //(nal_type != 7 && nal_type != 8); // SPS or PPS
- *end_of_unit = tsk_true;
- return tdav_codec_h264_get_nalunit_pay(pdata, in_size, out_data, out_size);
- }
-
- TSK_DEBUG_WARN("%d not supported as valid NAL Unit type", (*pdata & 0x1F));
- return -1;
+ */
+ switch ((nal_type = (pdata[0] & 0x1F))) {
+ case undefined_0:
+ case undefined_30:
+ case undefined_31:
+ case stap_a:
+ case stap_b:
+ case mtap16:
+ case mtap24:
+ case fu_b:
+ break;
+ case fu_a:
+ return tdav_codec_h264_get_fua_pay(pdata, in_size, out_data, out_size, append_scp, end_of_unit);
+ default: /* NAL unit (1-23) */
+ *append_scp = tsk_true; //(nal_type != 7 && nal_type != 8); // SPS or PPS
+ *end_of_unit = tsk_true;
+ return tdav_codec_h264_get_nalunit_pay(pdata, in_size, out_data, out_size);
+ }
+
+ TSK_DEBUG_WARN("%d not supported as valid NAL Unit type", (*pdata & 0x1F));
+ return -1;
}
static int tdav_codec_h264_get_fua_pay(const uint8_t* in_data, tsk_size_t in_size, const void** out_data, tsk_size_t *out_size, tsk_bool_t* append_scp, tsk_bool_t* end_of_unit)
{
- if (in_size <=H264_FUA_HEADER_SIZE) {
- TSK_DEBUG_ERROR("Too short");
- return -1;
- }
- /* RFC 3984 - 5.8. Fragmentation Units (FUs)
+ if (in_size <=H264_FUA_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ return -1;
+ }
+ /* RFC 3984 - 5.8. Fragmentation Units (FUs)
- 0 1 2 3
+ 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| FU indicator | FU header | |
@@ -220,7 +220,7 @@ static int tdav_codec_h264_get_fua_pay(const uint8_t* in_data, tsk_size_t in_siz
| :...OPTIONAL RTP padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- The FU indicator octet has the following format:
+ The FU indicator octet has the following format:
+---------------+
|0|1|2|3|4|5|6|7|
@@ -228,27 +228,27 @@ static int tdav_codec_h264_get_fua_pay(const uint8_t* in_data, tsk_size_t in_siz
|F|NRI| Type |
+---------------+
- The FU header has the following format:
+ The FU header has the following format:
+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|S|E|R| Type |
+---------------+
- */
+ */
if (((in_data[1] & 0x80) /*S*/)) {
/* discard "FU indicator" */
*out_data = (in_data + H264_NAL_UNIT_TYPE_HEADER_SIZE);
*out_size = (in_size - H264_NAL_UNIT_TYPE_HEADER_SIZE);
-
+
// Do need to append Start Code Prefix ?
/* S: 1 bit
When set to one, the Start bit indicates the start of a fragmented
NAL unit. When the following FU payload is not the start of a
fragmented NAL unit payload, the Start bit is set to zero.*/
*append_scp = tsk_true;
-
+
// F, NRI and Type
*((uint8_t*)*out_data) = (in_data[0] & 0xe0) /* F,NRI from "FU indicator"*/ | (in_data[1] & 0x1f) /* type from "FU header" */;
}
@@ -257,155 +257,155 @@ static int tdav_codec_h264_get_fua_pay(const uint8_t* in_data, tsk_size_t in_siz
*out_data = (in_data + H264_FUA_HEADER_SIZE);
*out_size = (in_size - H264_FUA_HEADER_SIZE);
}
- /*
- E: 1 bit
+ /*
+ E: 1 bit
When set to one, the End bit indicates the end of a fragmented
NAL unit, i.e., the last byte of the payload is also the last
byte of the fragmented NAL unit. When the following FU
payload is not the last fragment of a fragmented NAL unit, the
End bit is set to zero.
- */
- *end_of_unit = (((in_data[1] & 0x40) /*E*/)) ? tsk_true : tsk_false;
+ */
+ *end_of_unit = (((in_data[1] & 0x40) /*E*/)) ? tsk_true : tsk_false;
- return 0;
+ return 0;
}
static int tdav_codec_h264_get_nalunit_pay(const uint8_t* in_data, tsk_size_t in_size, const void** out_data, tsk_size_t *out_size)
{
-/* 5.6. Single NAL Unit Packet
-
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |F|NRI| type | |
- +-+-+-+-+-+-+-+-+ |
- | |
- | Bytes 2..n of a Single NAL unit |
- | |
- | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | :...OPTIONAL RTP padding |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-*/
-
- *out_data = in_data;
- *out_size = in_size;
-
- return 0;
+ /* 5.6. Single NAL Unit Packet
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |F|NRI| type | |
+ +-+-+-+-+-+-+-+-+ |
+ | |
+ | Bytes 2..n of a Single NAL unit |
+ | |
+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | :...OPTIONAL RTP padding |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ *out_data = in_data;
+ *out_size = in_size;
+
+ return 0;
}
void tdav_codec_h264_rtp_encap(struct tdav_codec_h264_common_s* self, const uint8_t* pdata, tsk_size_t size)
{
- static const tsk_size_t size_of_scp = sizeof(H264_START_CODE_PREFIX); /* we know it's equal to 4 .. */
- register tsk_size_t i;
- tsk_size_t last_scp, prev_scp;
- tsk_size_t _size;
-
- if (!pdata || size < size_of_scp) {
- return;
- }
-
- if (pdata[0] == 0 && pdata[1] == 0) {
- if (pdata[2] == 1) {
- pdata += 3, size -= 3;
- }
- else if (pdata[2] == 0 && pdata[3] == 1) {
- pdata += 4, size -= 4;
- }
- }
-
- _size = (size - size_of_scp);
- last_scp = 0, prev_scp = 0;
- for (i = size_of_scp; i<_size; i++) {
- if (pdata[i] == 0 && pdata[i+1] == 0 && (pdata[i+2] == 1 || (pdata[i+2] == 0 && pdata[i+3] == 1))) { /* Find Start Code Prefix */
- prev_scp = last_scp;
- if ((i - last_scp) >= H264_RTP_PAYLOAD_SIZE || 1) {
- tdav_codec_h264_rtp_callback(self, pdata + prev_scp,
- (i - prev_scp), (prev_scp == size));
- }
- last_scp = i;
- i += (pdata[i+2] == 1) ? 3 : 4;
- }
- }
-
- if (last_scp < (int32_t)size) {
- tdav_codec_h264_rtp_callback(self, pdata + last_scp,
- (size - last_scp), tsk_true);
- }
+ static const tsk_size_t size_of_scp = sizeof(H264_START_CODE_PREFIX); /* we know it's equal to 4 .. */
+ register tsk_size_t i;
+ tsk_size_t last_scp, prev_scp;
+ tsk_size_t _size;
+
+ if (!pdata || size < size_of_scp) {
+ return;
+ }
+
+ if (pdata[0] == 0 && pdata[1] == 0) {
+ if (pdata[2] == 1) {
+ pdata += 3, size -= 3;
+ }
+ else if (pdata[2] == 0 && pdata[3] == 1) {
+ pdata += 4, size -= 4;
+ }
+ }
+
+ _size = (size - size_of_scp);
+ last_scp = 0, prev_scp = 0;
+ for (i = size_of_scp; i<_size; i++) {
+ if (pdata[i] == 0 && pdata[i+1] == 0 && (pdata[i+2] == 1 || (pdata[i+2] == 0 && pdata[i+3] == 1))) { /* Find Start Code Prefix */
+ prev_scp = last_scp;
+ if ((i - last_scp) >= H264_RTP_PAYLOAD_SIZE || 1) {
+ tdav_codec_h264_rtp_callback(self, pdata + prev_scp,
+ (i - prev_scp), (prev_scp == size));
+ }
+ last_scp = i;
+ i += (pdata[i+2] == 1) ? 3 : 4;
+ }
+ }
+
+ if (last_scp < (int32_t)size) {
+ tdav_codec_h264_rtp_callback(self, pdata + last_scp,
+ (size - last_scp), tsk_true);
+ }
}
void tdav_codec_h264_rtp_callback(struct tdav_codec_h264_common_s *self, const void *data, tsk_size_t size, tsk_bool_t marker)
{
- uint8_t* pdata = (uint8_t*)data;
-
- //TSK_DEBUG_INFO("%x %x %x %x -- %u", pdata[0], pdata[1], pdata[2], pdata[3], size);
-
- if (size>4 && pdata[0] == H264_START_CODE_PREFIX[0] && pdata[1] == H264_START_CODE_PREFIX[1]) {
- if(pdata[2] == H264_START_CODE_PREFIX[3]){
- pdata += 3, size -= 3;
- }
- else if (pdata[2] == H264_START_CODE_PREFIX[2] && pdata[3] == H264_START_CODE_PREFIX[3]) {
- pdata += 4, size -= 4;
- }
- }
-
- //TSK_DEBUG_INFO("==> SCP %2x %2x %2x %2x", pdata[0], pdata[1], pdata[2], pdata[3]);
-
- if (self->pack_mode_local == Single_NAL_Unit_Mode || size < H264_RTP_PAYLOAD_SIZE) {
- if (self->pack_mode_local == Single_NAL_Unit_Mode && size > H264_RTP_PAYLOAD_SIZE) {
- TSK_DEBUG_WARN("pack_mode=Single_NAL_Unit_Mode but size(%d) > H264_RTP_PAYLOAD_SIZE(%d). Did you forget to set \"avctx->rtp_payload_size\"?", size, H264_RTP_PAYLOAD_SIZE);
- }
- // Can be packet in a Single Nal Unit
- // Send data over the network
- if (TMEDIA_CODEC_VIDEO(self)->out.callback) {
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = pdata;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = size;
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
- }
- else if (size > H264_NAL_UNIT_TYPE_HEADER_SIZE) {
- /* Should be Fragmented as FUA */
- uint8_t fua_hdr[H264_FUA_HEADER_SIZE]; /* "FU indicator" and "FU header" - 2bytes */
- fua_hdr[0] = pdata[0] & 0x60/* NRI */, fua_hdr[0] |= fu_a;
- fua_hdr[1] = 0x80/* S=1,E=0,R=0 */, fua_hdr[1] |= pdata[0] & 0x1f; /* type */
- // discard header
- pdata += H264_NAL_UNIT_TYPE_HEADER_SIZE;
- size -= H264_NAL_UNIT_TYPE_HEADER_SIZE;
-
- while(size) {
- tsk_size_t packet_size = TSK_MIN(H264_RTP_PAYLOAD_SIZE, size);
-
- if (self->rtp.size < (packet_size + H264_FUA_HEADER_SIZE)){
- if(!(self->rtp.ptr = (uint8_t*)tsk_realloc(self->rtp.ptr, (packet_size + H264_FUA_HEADER_SIZE)))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return;
- }
- self->rtp.size = (packet_size + H264_FUA_HEADER_SIZE);
- }
- // set E bit
- if((size - packet_size) == 0){
- // Last packet
- fua_hdr[1] |= 0x40;
- }
- // copy FUA header
- memcpy(self->rtp.ptr, fua_hdr, H264_FUA_HEADER_SIZE);
- // reset "S" bit
- fua_hdr[1] &= 0x7F;
- // copy data
- memcpy((self->rtp.ptr + H264_FUA_HEADER_SIZE), pdata, packet_size);
- pdata += packet_size;
- size -= packet_size;
-
- // send data
- if(TMEDIA_CODEC_VIDEO(self)->out.callback){
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (packet_size + H264_FUA_HEADER_SIZE);
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = (size == 0);
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
- }
- }
+ uint8_t* pdata = (uint8_t*)data;
+
+ //TSK_DEBUG_INFO("%x %x %x %x -- %u", pdata[0], pdata[1], pdata[2], pdata[3], size);
+
+ if (size>4 && pdata[0] == H264_START_CODE_PREFIX[0] && pdata[1] == H264_START_CODE_PREFIX[1]) {
+ if(pdata[2] == H264_START_CODE_PREFIX[3]) {
+ pdata += 3, size -= 3;
+ }
+ else if (pdata[2] == H264_START_CODE_PREFIX[2] && pdata[3] == H264_START_CODE_PREFIX[3]) {
+ pdata += 4, size -= 4;
+ }
+ }
+
+ //TSK_DEBUG_INFO("==> SCP %2x %2x %2x %2x", pdata[0], pdata[1], pdata[2], pdata[3]);
+
+ if (self->pack_mode_local == Single_NAL_Unit_Mode || size < H264_RTP_PAYLOAD_SIZE) {
+ if (self->pack_mode_local == Single_NAL_Unit_Mode && size > H264_RTP_PAYLOAD_SIZE) {
+ TSK_DEBUG_WARN("pack_mode=Single_NAL_Unit_Mode but size(%d) > H264_RTP_PAYLOAD_SIZE(%d). Did you forget to set \"avctx->rtp_payload_size\"?", size, H264_RTP_PAYLOAD_SIZE);
+ }
+ // Can be packet in a Single Nal Unit
+ // Send data over the network
+ if (TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = pdata;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = size;
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = marker;
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
+ }
+ else if (size > H264_NAL_UNIT_TYPE_HEADER_SIZE) {
+ /* Should be Fragmented as FUA */
+ uint8_t fua_hdr[H264_FUA_HEADER_SIZE]; /* "FU indicator" and "FU header" - 2bytes */
+ fua_hdr[0] = pdata[0] & 0x60/* NRI */, fua_hdr[0] |= fu_a;
+ fua_hdr[1] = 0x80/* S=1,E=0,R=0 */, fua_hdr[1] |= pdata[0] & 0x1f; /* type */
+ // discard header
+ pdata += H264_NAL_UNIT_TYPE_HEADER_SIZE;
+ size -= H264_NAL_UNIT_TYPE_HEADER_SIZE;
+
+ while(size) {
+ tsk_size_t packet_size = TSK_MIN(H264_RTP_PAYLOAD_SIZE, size);
+
+ if (self->rtp.size < (packet_size + H264_FUA_HEADER_SIZE)) {
+ if(!(self->rtp.ptr = (uint8_t*)tsk_realloc(self->rtp.ptr, (packet_size + H264_FUA_HEADER_SIZE)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return;
+ }
+ self->rtp.size = (packet_size + H264_FUA_HEADER_SIZE);
+ }
+ // set E bit
+ if((size - packet_size) == 0) {
+ // Last packet
+ fua_hdr[1] |= 0x40;
+ }
+ // copy FUA header
+ memcpy(self->rtp.ptr, fua_hdr, H264_FUA_HEADER_SIZE);
+ // reset "S" bit
+ fua_hdr[1] &= 0x7F;
+ // copy data
+ memcpy((self->rtp.ptr + H264_FUA_HEADER_SIZE), pdata, packet_size);
+ pdata += packet_size;
+ size -= packet_size;
+
+ // send data
+ if(TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (packet_size + H264_FUA_HEADER_SIZE);
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = (size == 0);
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
+ }
+ }
}
diff --git a/tinyDAV/src/codecs/ilbc/tdav_codec_ilbc.c b/tinyDAV/src/codecs/ilbc/tdav_codec_ilbc.c
index 65df6ad..f4378c8 100755
--- a/tinyDAV/src/codecs/ilbc/tdav_codec_ilbc.c
+++ b/tinyDAV/src/codecs/ilbc/tdav_codec_ilbc.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,154 +43,154 @@
static int tdav_codec_ilbc_open(tmedia_codec_t* self)
{
- tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
-
- initEncode(&ilbc->encoder, TDAV_ILBC_MODE);
+ tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
+
+ initEncode(&ilbc->encoder, TDAV_ILBC_MODE);
initDecode(&ilbc->decoder, TDAV_ILBC_MODE, tsk_true/* Enhancer */);
- return 0;
+ return 0;
}
static int tdav_codec_ilbc_close(tmedia_codec_t* self)
{
- tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
+ tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
- //ilbc->encoder = {0};
- //ilbc->decoder = {0};
+ //ilbc->encoder = {0};
+ //ilbc->decoder = {0};
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_ilbc_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
- int k;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* convert signal to float */
- for(k=0; k<ilbc->encoder.blockl; k++){
- ilbc->encblock[k] = (float)((short*)in_data)[k];
- }
-
- /* allocate new buffer if needed */
- if((int)*out_max_size <ilbc->encoder.no_of_bytes){
- if(!(*out_data = tsk_realloc(*out_data, ilbc->encoder.no_of_bytes))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = ilbc->encoder.no_of_bytes;
- }
-
- /* do the actual encoding */
+{
+ tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
+ int k;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* convert signal to float */
+ for(k=0; k<ilbc->encoder.blockl; k++) {
+ ilbc->encblock[k] = (float)((short*)in_data)[k];
+ }
+
+ /* allocate new buffer if needed */
+ if((int)*out_max_size <ilbc->encoder.no_of_bytes) {
+ if(!(*out_data = tsk_realloc(*out_data, ilbc->encoder.no_of_bytes))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = ilbc->encoder.no_of_bytes;
+ }
+
+ /* do the actual encoding */
iLBC_encode(*out_data, ilbc->encblock, &ilbc->encoder);
-
- return ilbc->encoder.no_of_bytes;
+
+ return ilbc->encoder.no_of_bytes;
}
static tsk_size_t tdav_codec_ilbc_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- int blocks, i, k, block_size;
- float dtmp;
- tsk_size_t out_size;
- tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if((in_size % NO_OF_BYTES_20MS) == 0){
- /* Using 20ms mode */
- blocks = (in_size/NO_OF_BYTES_20MS);
- out_size = (BLOCKL_20MS * blocks) * sizeof(short);
- block_size = out_size/blocks;
- if(ilbc->decoder.mode != 20){
- initDecode(&ilbc->decoder, 20, tsk_true/* Enhancer */);
- }
- }
- else if((in_size % NO_OF_BYTES_30MS) == 0){
- /* Using 30ms mode */
- blocks = (in_size/NO_OF_BYTES_30MS);
- out_size = (BLOCKL_30MS * blocks) * sizeof(short);
- block_size = out_size/blocks;
- if(ilbc->decoder.mode != 30){
- initDecode(&ilbc->decoder, 30, tsk_true/* Enhancer */);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid iLBC mode");
- return 0;
- }
-
- /* allocate new buffer if needed */
- if(*out_max_size<out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
-
- for(i = 0; i<blocks; i++){
- iLBC_decode(ilbc->decblock, &((uint8_t*)in_data)[i*block_size], &ilbc->decoder, 1/* Normal */);
-
- /* convert to short */
- for(k=0; k<ilbc->decoder.blockl; k++){
- dtmp=ilbc->decblock[k];
-
- if(dtmp<MIN_SAMPLE){
- dtmp = MIN_SAMPLE;
- }
- else if(dtmp>MAX_SAMPLE){
- dtmp = MAX_SAMPLE;
- }
-
- ((short*)*out_data)[(i*block_size) + k] = ((short) dtmp);
- }
- }
-
- return out_size;
+ int blocks, i, k, block_size;
+ float dtmp;
+ tsk_size_t out_size;
+ tdav_codec_ilbc_t* ilbc = (tdav_codec_ilbc_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if((in_size % NO_OF_BYTES_20MS) == 0) {
+ /* Using 20ms mode */
+ blocks = (in_size/NO_OF_BYTES_20MS);
+ out_size = (BLOCKL_20MS * blocks) * sizeof(short);
+ block_size = out_size/blocks;
+ if(ilbc->decoder.mode != 20) {
+ initDecode(&ilbc->decoder, 20, tsk_true/* Enhancer */);
+ }
+ }
+ else if((in_size % NO_OF_BYTES_30MS) == 0) {
+ /* Using 30ms mode */
+ blocks = (in_size/NO_OF_BYTES_30MS);
+ out_size = (BLOCKL_30MS * blocks) * sizeof(short);
+ block_size = out_size/blocks;
+ if(ilbc->decoder.mode != 30) {
+ initDecode(&ilbc->decoder, 30, tsk_true/* Enhancer */);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid iLBC mode");
+ return 0;
+ }
+
+ /* allocate new buffer if needed */
+ if(*out_max_size<out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+
+ for(i = 0; i<blocks; i++) {
+ iLBC_decode(ilbc->decblock, &((uint8_t*)in_data)[i*block_size], &ilbc->decoder, 1/* Normal */);
+
+ /* convert to short */
+ for(k=0; k<ilbc->decoder.blockl; k++) {
+ dtmp=ilbc->decblock[k];
+
+ if(dtmp<MIN_SAMPLE) {
+ dtmp = MIN_SAMPLE;
+ }
+ else if(dtmp>MAX_SAMPLE) {
+ dtmp = MAX_SAMPLE;
+ }
+
+ ((short*)*out_data)[(i*block_size) + k] = ((short) dtmp);
+ }
+ }
+
+ return out_size;
}
static char* tdav_codec_ilbc_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- if(tsk_striequals(att_name, "fmtp")){
- char* fmtp = tsk_null;
- tsk_sprintf(&fmtp, "mode=%d", TDAV_ILBC_MODE);
- return fmtp;
- }
- return tsk_null;
+ if(tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
+ tsk_sprintf(&fmtp, "mode=%d", TDAV_ILBC_MODE);
+ return fmtp;
+ }
+ return tsk_null;
}
static tsk_bool_t tdav_codec_ilbc_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- if(tsk_striequals(att_name, "fmtp")){
- /* RFC 3952 - 5. Mapping To SDP Parameters
-
- The offer contains the preferred mode of the offerer. The answerer
- may agree to that mode by including the same mode in the answer, or
- may include a different mode. The resulting mode used by both
- parties SHALL be the lower of the bandwidth modes in the offer and
- answer.
-
- That is, an offer of "mode=20" receiving an answer of "mode=30" will
- result in "mode=30" being used by both participants. Similarly, an
- offer of "mode=30" and an answer of "mode=20" will result in
- "mode=30" being used by both participants.
-
- This is important when one end point utilizes a bandwidth constrained
- link (e.g., 28.8k modem link or slower), where only the lower frame
- size will work.
- */
- return tsk_true; // FIXME
- }
- return tsk_true;
+{
+ if(tsk_striequals(att_name, "fmtp")) {
+ /* RFC 3952 - 5. Mapping To SDP Parameters
+
+ The offer contains the preferred mode of the offerer. The answerer
+ may agree to that mode by including the same mode in the answer, or
+ may include a different mode. The resulting mode used by both
+ parties SHALL be the lower of the bandwidth modes in the offer and
+ answer.
+
+ That is, an offer of "mode=20" receiving an answer of "mode=30" will
+ result in "mode=30" being used by both participants. Similarly, an
+ offer of "mode=30" and an answer of "mode=20" will result in
+ "mode=30" being used by both participants.
+
+ This is important when one end point utilizes a bandwidth constrained
+ link (e.g., 28.8k modem link or slower), where only the lower frame
+ size will work.
+ */
+ return tsk_true; // FIXME
+ }
+ return tsk_true;
}
@@ -201,63 +201,61 @@ static tsk_bool_t tdav_codec_ilbc_sdp_att_match(const tmedia_codec_t* codec, con
/* constructor */
static tsk_object_t* tdav_codec_ilbc_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_ilbc_t *ilbc = self;
- if(ilbc){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_ilbc_t *ilbc = self;
+ if(ilbc) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_ilbc_dtor(tsk_object_t * self)
-{
- tdav_codec_ilbc_t *ilbc = self;
- if(ilbc){
- /* deinit base */
- tmedia_codec_audio_deinit(ilbc);
- /* deinit self */
- //ilbc->encoder = {0};
- //ilbc->decoder = {0};
- }
-
- return self;
+{
+ tdav_codec_ilbc_t *ilbc = self;
+ if(ilbc) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(ilbc);
+ /* deinit self */
+ //ilbc->encoder = {0};
+ //ilbc->decoder = {0};
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_ilbc_def_s =
-{
- sizeof(tdav_codec_ilbc_t),
- tdav_codec_ilbc_ctor,
- tdav_codec_ilbc_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_ilbc_def_s = {
+ sizeof(tdav_codec_ilbc_t),
+ tdav_codec_ilbc_ctor,
+ tdav_codec_ilbc_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_ilbc_plugin_def_s =
-{
- &tdav_codec_ilbc_def_s,
-
- tmedia_audio,
- tmedia_codec_id_ilbc,
- "iLBC",
- "iLBC codec (libILBc)",
- TMEDIA_CODEC_FORMAT_ILBC,
- tsk_true,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 20 // ptime
- },
-
- /* video */
- {0},
-
- tdav_codec_ilbc_set,
- tdav_codec_ilbc_open,
- tdav_codec_ilbc_close,
- tdav_codec_ilbc_encode,
- tdav_codec_ilbc_decode,
- tdav_codec_ilbc_sdp_att_match,
- tdav_codec_ilbc_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_ilbc_plugin_def_s = {
+ &tdav_codec_ilbc_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_ilbc,
+ "iLBC",
+ "iLBC codec (libILBc)",
+ TMEDIA_CODEC_FORMAT_ILBC,
+ tsk_true,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 20 // ptime
+ },
+
+ /* video */
+ {0},
+
+ tdav_codec_ilbc_set,
+ tdav_codec_ilbc_open,
+ tdav_codec_ilbc_close,
+ tdav_codec_ilbc_encode,
+ tdav_codec_ilbc_decode,
+ tdav_codec_ilbc_sdp_att_match,
+ tdav_codec_ilbc_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_ilbc_plugin_def_t = &tdav_codec_ilbc_plugin_def_s;
diff --git a/tinyDAV/src/codecs/mp4ves/tdav_codec_mp4ves.c b/tinyDAV/src/codecs/mp4ves/tdav_codec_mp4ves.c
index e48cb00..7c99acd 100755
--- a/tinyDAV/src/codecs/mp4ves/tdav_codec_mp4ves.c
+++ b/tinyDAV/src/codecs/mp4ves/tdav_codec_mp4ves.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -54,103 +54,100 @@
#define MP4V_GOP_SIZE_IN_SECONDS 25
#define MP4V_RTP_PAYLOAD_SIZE 900
-typedef struct tdav_codec_mp4ves_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- int profile;
-
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- // Encoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
- void* buffer;
- tsk_bool_t force_idr;
- int quality; // [1-31]
- int rotation;
- int32_t max_bw_kpbs;
- } encoder;
-
- // decoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
-
- void* accumulator;
- uint8_t ebit;
- tsk_size_t accumulator_pos;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_mp4ves_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ int profile;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ // Encoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+ void* buffer;
+ tsk_bool_t force_idr;
+ int quality; // [1-31]
+ int rotation;
+ int32_t max_bw_kpbs;
+ } encoder;
+
+ // decoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+
+ void* accumulator;
+ uint8_t ebit;
+ tsk_size_t accumulator_pos;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_mp4ves_t;
// From ISO-IEC-14496-2
-typedef enum mp4v_codes_e
-{
- // To initiate a visual session (6.3.2)
- visual_object_sequence_start_code = 0x000001B0,
- // To terminate a visual session (6.3.2)
- visual_object_sequence_end_code = 0x000001B1,
- // To initiate a visual object (6.3.2)
- visual_object_start_code = 0x000001B5,
- // To identify the beginning of user data. The user data continues until receipt of another start code. (6.3.2.1)
- user_data_start_code = 0x000001B2,
- // The video_object_layer_start_code is a string of 32 bits. The first 28 bits are
- // ‘0000 0000 0000 0000 0000 0001 0010‘ in binary and the last 4-bits represent one of the values in the range of
- // ‘0000’ to ‘1111’ in binary. The video_object_layer_start_code marks a new video object layer. (6.3.3)
- video_object_layer_start_code = 0x0000012,
- // To identify the beginning of a GOV header (6.3.4)
- group_of_vop_start_code = 0x000001B3,
- // To mark the start of a video object plane (6.3.5 )
- vop_start_code = 0x000001B6,
+typedef enum mp4v_codes_e {
+ // To initiate a visual session (6.3.2)
+ visual_object_sequence_start_code = 0x000001B0,
+ // To terminate a visual session (6.3.2)
+ visual_object_sequence_end_code = 0x000001B1,
+ // To initiate a visual object (6.3.2)
+ visual_object_start_code = 0x000001B5,
+ // To identify the beginning of user data. The user data continues until receipt of another start code. (6.3.2.1)
+ user_data_start_code = 0x000001B2,
+ // The video_object_layer_start_code is a string of 32 bits. The first 28 bits are
+ // ‘0000 0000 0000 0000 0000 0001 0010‘ in binary and the last 4-bits represent one of the values in the range of
+ // ‘0000’ to ‘1111’ in binary. The video_object_layer_start_code marks a new video object layer. (6.3.3)
+ video_object_layer_start_code = 0x0000012,
+ // To identify the beginning of a GOV header (6.3.4)
+ group_of_vop_start_code = 0x000001B3,
+ // To mark the start of a video object plane (6.3.5 )
+ vop_start_code = 0x000001B6,
}
mp4v_start_code_t;
// From ISO-IEC-14496-2 Annex G
-typedef enum mp4v_profiles_e
-{
- /* Reserved = 0x00000000 */
- Simple_Profile_Level_1 = 1,
- Simple_Profile_Level_2 = 2,
- Simple_Profile_Level_3 = 3,
- /* Reserved 00000100 ? 00010000 */
- Simple_Scalable_Profile_Level_1 = 17,
- Simple_Scalable_Profile_Level_2 = 18,
- /* Reserved 00010011 ? = 0x00100000 */
- Core_Profile_Level_1 = 33,
- Core_Profile_Level_2 = 34,
- /* Reserved 00100011 ? = 0x00110001 */
- Main_Profile_Level_2 = 50,
- Main_Profile_Level_3 = 51,
- Main_Profile_Level_4 = 52,
- /* Reserved 00110101 ? = 0x01000001 */
- N_bit_Profile_Level_2 = 66,
- /* Reserved 01000011 ? = 0x01010000 */
- Scalable_Texture_Profile_Level_1 = 81,
- /* Reserved 01010010 ? 01100000 */
- Simple_Face_Animation_Profile_Level_1 = 97,
- Simple_Face_Animation_Profile_Level_2 = 98,
- Simple_FBA_Profile_Level_1 = 99,
- Simple_FBA_Profile_Level_2 = 100,
- /* Reserved 01100101 ? 01110000 */
- Basic_Animated_Texture_Profile_Level_1 = 113,
- Basic_Animated_Texture_Profile_Level_2 = 114,
- /* Reserved 01110011 ? 10000000 */
- Hybrid_Profile_Level_1 = 129,
- Hybrid_Profile_Level_2 = 130,
- /* Reserved 10000011 ? 10010000 */
- Advanced_Real_Time_Simple_Profile_Level_1 = 145,
- Advanced_Real_Time_Simple_Profile_Level_2 = 146,
- Advanced_Real_Time_Simple_Profile_Level_3 = 147,
- Advanced_Real_Time_Simple_Profile_Level_4 = 148,
- /* Reserved 10010101 ? 10100000 */
+typedef enum mp4v_profiles_e {
+ /* Reserved = 0x00000000 */
+ Simple_Profile_Level_1 = 1,
+ Simple_Profile_Level_2 = 2,
+ Simple_Profile_Level_3 = 3,
+ /* Reserved 00000100 ? 00010000 */
+ Simple_Scalable_Profile_Level_1 = 17,
+ Simple_Scalable_Profile_Level_2 = 18,
+ /* Reserved 00010011 ? = 0x00100000 */
+ Core_Profile_Level_1 = 33,
+ Core_Profile_Level_2 = 34,
+ /* Reserved 00100011 ? = 0x00110001 */
+ Main_Profile_Level_2 = 50,
+ Main_Profile_Level_3 = 51,
+ Main_Profile_Level_4 = 52,
+ /* Reserved 00110101 ? = 0x01000001 */
+ N_bit_Profile_Level_2 = 66,
+ /* Reserved 01000011 ? = 0x01010000 */
+ Scalable_Texture_Profile_Level_1 = 81,
+ /* Reserved 01010010 ? 01100000 */
+ Simple_Face_Animation_Profile_Level_1 = 97,
+ Simple_Face_Animation_Profile_Level_2 = 98,
+ Simple_FBA_Profile_Level_1 = 99,
+ Simple_FBA_Profile_Level_2 = 100,
+ /* Reserved 01100101 ? 01110000 */
+ Basic_Animated_Texture_Profile_Level_1 = 113,
+ Basic_Animated_Texture_Profile_Level_2 = 114,
+ /* Reserved 01110011 ? 10000000 */
+ Hybrid_Profile_Level_1 = 129,
+ Hybrid_Profile_Level_2 = 130,
+ /* Reserved 10000011 ? 10010000 */
+ Advanced_Real_Time_Simple_Profile_Level_1 = 145,
+ Advanced_Real_Time_Simple_Profile_Level_2 = 146,
+ Advanced_Real_Time_Simple_Profile_Level_3 = 147,
+ Advanced_Real_Time_Simple_Profile_Level_4 = 148,
+ /* Reserved 10010101 ? 10100000 */
}
mp4v_profiles_t;
@@ -166,580 +163,578 @@ static void tdav_codec_mp4ves_rtp_callback(tdav_codec_mp4ves_t *mp4v, const void
static int tdav_codec_mp4ves_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_mp4ves_t* mp4ves = (tdav_codec_mp4ves_t*)self;
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return -1;
- }
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- mp4ves->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- mp4ves->encoder.quality = TSK_CLAMP(1, (mp4ves->encoder.quality + 1), 31);
- mp4ves->encoder.context->global_quality = FF_QP2LAMBDA * mp4ves->encoder.quality;
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- mp4ves->encoder.quality = TSK_CLAMP(1, (mp4ves->encoder.quality - 1), 31);
- mp4ves->encoder.context->global_quality = FF_QP2LAMBDA * mp4ves->encoder.quality;
- break;
- }
- }
- }
- else if(tsk_striequals(param->key, "rotation")){
- int rotation = *((int32_t*)param->value);
- if(mp4ves->encoder.rotation != rotation){
- if(self->opened){
- int ret;
- mp4ves->encoder.rotation = rotation;
- if((ret = tdav_codec_mp4ves_close_encoder(mp4ves))){
- return ret;
- }
- if((ret = tdav_codec_mp4ves_open_encoder(mp4ves))){
- return ret;
- }
- }
- }
- return 0;
- }
- }
- return -1;
+ tdav_codec_mp4ves_t* mp4ves = (tdav_codec_mp4ves_t*)self;
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return -1;
+ }
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ mp4ves->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ mp4ves->encoder.quality = TSK_CLAMP(1, (mp4ves->encoder.quality + 1), 31);
+ mp4ves->encoder.context->global_quality = FF_QP2LAMBDA * mp4ves->encoder.quality;
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ mp4ves->encoder.quality = TSK_CLAMP(1, (mp4ves->encoder.quality - 1), 31);
+ mp4ves->encoder.context->global_quality = FF_QP2LAMBDA * mp4ves->encoder.quality;
+ break;
+ }
+ }
+ }
+ else if(tsk_striequals(param->key, "rotation")) {
+ int rotation = *((int32_t*)param->value);
+ if(mp4ves->encoder.rotation != rotation) {
+ if(self->opened) {
+ int ret;
+ mp4ves->encoder.rotation = rotation;
+ if((ret = tdav_codec_mp4ves_close_encoder(mp4ves))) {
+ return ret;
+ }
+ if((ret = tdav_codec_mp4ves_open_encoder(mp4ves))) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
}
int tdav_codec_mp4ves_open(tmedia_codec_t* self)
{
- int ret;
-
- tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
-
- if(!mp4v){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
-
- // Encoder
- if((ret = tdav_codec_mp4ves_open_encoder(mp4v))){
- return ret;
- }
-
- // Decoder
- if((ret = tdav_codec_mp4ves_open_decoder(mp4v))){
- return ret;
- }
-
- return 0;
+ int ret;
+
+ tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
+
+ if(!mp4v) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+
+ // Encoder
+ if((ret = tdav_codec_mp4ves_open_encoder(mp4v))) {
+ return ret;
+ }
+
+ // Decoder
+ if((ret = tdav_codec_mp4ves_open_decoder(mp4v))) {
+ return ret;
+ }
+
+ return 0;
}
int tdav_codec_mp4ves_close(tmedia_codec_t* self)
{
- tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
+ tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
+
+ if(!mp4v) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!mp4v){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ /* the caller (base class) already checked that the codec is opened */
- /* the caller (base class) already checked that the codec is opened */
+ // Encoder
+ tdav_codec_mp4ves_close_encoder(mp4v);
- // Encoder
- tdav_codec_mp4ves_close_encoder(mp4v);
-
- // Decoder
- tdav_codec_mp4ves_close_decoder(mp4v);
+ // Decoder
+ tdav_codec_mp4ves_close_decoder(mp4v);
- return 0;
+ return 0;
}
tsk_size_t tdav_codec_mp4ves_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret;
- int size;
+ int ret;
+ int size;
- tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
+ tdav_codec_mp4ves_t* mp4v = (tdav_codec_mp4ves_t*)self;
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- // wrap yuv420 buffer
- size = avpicture_fill((AVPicture *)mp4v->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, mp4v->encoder.context->width, mp4v->encoder.context->height);
- if(size != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
+ // wrap yuv420 buffer
+ size = avpicture_fill((AVPicture *)mp4v->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, mp4v->encoder.context->width, mp4v->encoder.context->height);
+ if(size != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
- if(mp4v->encoder.force_idr){
+ if(mp4v->encoder.force_idr) {
#if LIBAVCODEC_VERSION_MAJOR <= 53
mp4v->encoder.picture->pict_type = FF_I_TYPE;
#else
mp4v->encoder.picture->pict_type = AV_PICTURE_TYPE_I;
#endif
- mp4v->encoder.force_idr = tsk_false;
- }
- else{
- mp4v->encoder.picture->pict_type = 0;// reset
- }
- mp4v->encoder.picture->pts = AV_NOPTS_VALUE;
- mp4v->encoder.picture->quality = mp4v->encoder.context->global_quality;
- ret = avcodec_encode_video(mp4v->encoder.context, mp4v->encoder.buffer, size, mp4v->encoder.picture);
- if(ret > 0){
- tdav_codec_mp4ves_encap(mp4v, mp4v->encoder.buffer, (tsk_size_t)ret);
- }
-
- return 0;
+ mp4v->encoder.force_idr = tsk_false;
+ }
+ else {
+ mp4v->encoder.picture->pict_type = 0;// reset
+ }
+ mp4v->encoder.picture->pts = AV_NOPTS_VALUE;
+ mp4v->encoder.picture->quality = mp4v->encoder.context->global_quality;
+ ret = avcodec_encode_video(mp4v->encoder.context, mp4v->encoder.buffer, size, mp4v->encoder.picture);
+ if(ret > 0) {
+ tdav_codec_mp4ves_encap(mp4v, mp4v->encoder.buffer, (tsk_size_t)ret);
+ }
+
+ return 0;
}
tsk_size_t tdav_codec_mp4ves_decode(tmedia_codec_t* _self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
-{
- tdav_codec_mp4ves_t* self = (tdav_codec_mp4ves_t*)_self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
-
- tsk_size_t xsize, retsize = 0;
- int got_picture_ptr;
- int ret;
-
- if(!self || !in_data || !in_size || !out_data || !self->decoder.context){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // get expected size
- xsize = avpicture_get_size(self->decoder.context->pix_fmt, self->decoder.context->width, self->decoder.context->height);
-
- /* Packet lost? */
- if(self->decoder.last_seq != (rtp_hdr->seq_num - 1) && self->decoder.last_seq){
- if(self->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
- }
- self->decoder.last_seq = rtp_hdr->seq_num;
-
- if((self->decoder.accumulator_pos + in_size) <= xsize){
- memcpy(&((uint8_t*)self->decoder.accumulator)[self->decoder.accumulator_pos], in_data, in_size);
- self->decoder.accumulator_pos += in_size;
- }
- else{
- TSK_DEBUG_WARN("Buffer overflow");
- self->decoder.accumulator_pos = 0;
- return 0;
- }
-
- if(rtp_hdr->marker){
- AVPacket packet;
- /* allocate destination buffer */
- if(*out_max_size <xsize){
- if(!(*out_data = tsk_realloc(*out_data, xsize))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- self->decoder.accumulator_pos = 0;
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = xsize;
- }
-
- av_init_packet(&packet);
- packet.size = (int)self->decoder.accumulator_pos;
- packet.data = self->decoder.accumulator;
- ret = avcodec_decode_video2(self->decoder.context, self->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret < 0){
- TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
- if(TMEDIA_CODEC_VIDEO(self)->in.callback){
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- else if(got_picture_ptr){
- retsize = xsize;
- TMEDIA_CODEC_VIDEO(self)->in.width = self->decoder.context->width;
- TMEDIA_CODEC_VIDEO(self)->in.height = self->decoder.context->height;
-
- /* copy picture into a linear buffer */
- avpicture_layout((AVPicture *)self->decoder.picture, self->decoder.context->pix_fmt, (int)self->decoder.context->width, (int)self->decoder.context->height,
- *out_data, (int)retsize);
- }
- /* in all cases: reset accumulator */
- self->decoder.accumulator_pos = 0;
- }
-
- return retsize;
+{
+ tdav_codec_mp4ves_t* self = (tdav_codec_mp4ves_t*)_self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+
+ tsk_size_t xsize, retsize = 0;
+ int got_picture_ptr;
+ int ret;
+
+ if(!self || !in_data || !in_size || !out_data || !self->decoder.context) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // get expected size
+ xsize = avpicture_get_size(self->decoder.context->pix_fmt, self->decoder.context->width, self->decoder.context->height);
+
+ /* Packet lost? */
+ if(self->decoder.last_seq != (rtp_hdr->seq_num - 1) && self->decoder.last_seq) {
+ if(self->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
+ }
+ self->decoder.last_seq = rtp_hdr->seq_num;
+
+ if((self->decoder.accumulator_pos + in_size) <= xsize) {
+ memcpy(&((uint8_t*)self->decoder.accumulator)[self->decoder.accumulator_pos], in_data, in_size);
+ self->decoder.accumulator_pos += in_size;
+ }
+ else {
+ TSK_DEBUG_WARN("Buffer overflow");
+ self->decoder.accumulator_pos = 0;
+ return 0;
+ }
+
+ if(rtp_hdr->marker) {
+ AVPacket packet;
+ /* allocate destination buffer */
+ if(*out_max_size <xsize) {
+ if(!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ self->decoder.accumulator_pos = 0;
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = xsize;
+ }
+
+ av_init_packet(&packet);
+ packet.size = (int)self->decoder.accumulator_pos;
+ packet.data = self->decoder.accumulator;
+ ret = avcodec_decode_video2(self->decoder.context, self->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret < 0) {
+ TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ else if(got_picture_ptr) {
+ retsize = xsize;
+ TMEDIA_CODEC_VIDEO(self)->in.width = self->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(self)->in.height = self->decoder.context->height;
+
+ /* copy picture into a linear buffer */
+ avpicture_layout((AVPicture *)self->decoder.picture, self->decoder.context->pix_fmt, (int)self->decoder.context->width, (int)self->decoder.context->height,
+ *out_data, (int)retsize);
+ }
+ /* in all cases: reset accumulator */
+ self->decoder.accumulator_pos = 0;
+ }
+
+ return retsize;
}
tsk_bool_t tdav_codec_mp4ves_sdp_att_match(const tmedia_codec_t* _self, const char* att_name, const char* att_value)
{
- tdav_codec_mp4ves_t *self = (tdav_codec_mp4ves_t *)_self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- if(tsk_striequals(att_name, "fmtp")){
- tsk_params_L_t* params ;
- /* e.g. profile-level-id=1; xx=yy */
- if((params = tsk_params_fromstring(att_value, ";", tsk_true))){
- int val_int;
- if((val_int = tsk_params_get_param_value_as_int(params, "profile-level-id")) != -1){
- TSK_DEBUG_INFO("Proposed profile-level-id=%d", val_int);
- self->profile = val_int; // FIXME: Take the remote profile-level-id even if the bandwidth level doesn't match
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
-
- switch (self->profile ) {
- case Simple_Profile_Level_1:
- TMEDIA_CODEC_VIDEO(self)->out.width = TMEDIA_CODEC_VIDEO(self)->in.width = 176; TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 144;
- break;
- case Simple_Profile_Level_2:
- case Simple_Profile_Level_3:
- default:
- TMEDIA_CODEC_VIDEO(self)->out.width = TMEDIA_CODEC_VIDEO(self)->in.width = 352; TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 288;
- break;
- }
- }
- else if(tsk_striequals(att_name, "imageattr")){
- unsigned in_width, in_height, out_width, out_height;
- if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(self)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0){
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(self)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(self)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(self)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(self)->out.height = out_height;
- }
-
- return tsk_true;
+ tdav_codec_mp4ves_t *self = (tdav_codec_mp4ves_t *)_self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ tsk_params_L_t* params ;
+ /* e.g. profile-level-id=1; xx=yy */
+ if((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+ int val_int;
+ if((val_int = tsk_params_get_param_value_as_int(params, "profile-level-id")) != -1) {
+ TSK_DEBUG_INFO("Proposed profile-level-id=%d", val_int);
+ self->profile = val_int; // FIXME: Take the remote profile-level-id even if the bandwidth level doesn't match
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+
+ switch (self->profile ) {
+ case Simple_Profile_Level_1:
+ TMEDIA_CODEC_VIDEO(self)->out.width = TMEDIA_CODEC_VIDEO(self)->in.width = 176;
+ TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 144;
+ break;
+ case Simple_Profile_Level_2:
+ case Simple_Profile_Level_3:
+ default:
+ TMEDIA_CODEC_VIDEO(self)->out.width = TMEDIA_CODEC_VIDEO(self)->in.width = 352;
+ TMEDIA_CODEC_VIDEO(self)->in.height = TMEDIA_CODEC_VIDEO(self)->out.height = 288;
+ break;
+ }
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(self)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(self)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(self)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(self)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(self)->out.height = out_height;
+ }
+
+ return tsk_true;
}
char* tdav_codec_mp4ves_sdp_att_get(const tmedia_codec_t* _self, const char* att_name)
{
- tdav_codec_mp4ves_t *self = (tdav_codec_mp4ves_t *)_self;
-
- if(tsk_striequals(att_name, "fmtp")){
- char* fmtp = tsk_null;
- switch(_self->bl){//FIXME: deprecated
- case tmedia_bl_low:
- default:
- self->profile = Simple_Profile_Level_1;
- break;
- case tmedia_bl_medium:
- self->profile = Simple_Profile_Level_2;
- break;
- case tmedia_bl_hight:
- case tmedia_bl_unrestricted:
- self->profile = Simple_Profile_Level_3;
- break;
- }
- tsk_sprintf(&fmtp, "profile-level-id=%d", self->profile);
- return fmtp;
- }
- else if(tsk_striequals(att_name, "imageattr")){
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(self)->pref_size,
- TMEDIA_CODEC_VIDEO(self)->in.width, TMEDIA_CODEC_VIDEO(self)->in.height, TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
- }
- return tsk_null;
+ tdav_codec_mp4ves_t *self = (tdav_codec_mp4ves_t *)_self;
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
+ switch(_self->bl) { //FIXME: deprecated
+ case tmedia_bl_low:
+ default:
+ self->profile = Simple_Profile_Level_1;
+ break;
+ case tmedia_bl_medium:
+ self->profile = Simple_Profile_Level_2;
+ break;
+ case tmedia_bl_hight:
+ case tmedia_bl_unrestricted:
+ self->profile = Simple_Profile_Level_3;
+ break;
+ }
+ tsk_sprintf(&fmtp, "profile-level-id=%d", self->profile);
+ return fmtp;
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(self)->pref_size,
+ TMEDIA_CODEC_VIDEO(self)->in.width, TMEDIA_CODEC_VIDEO(self)->in.height, TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
+ }
+ return tsk_null;
}
/* ============ Internal functions ================= */
int tdav_codec_mp4ves_open_encoder(tdav_codec_mp4ves_t* self)
{
- int ret, size;
- int32_t max_bw_kpbs;
- if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_MPEG4))){
- TSK_DEBUG_ERROR("Failed to find mp4v encoder");
- return -1;
- }
-
- if(self->encoder.context){
- TSK_DEBUG_ERROR("Encoder already opened");
- return -1;
- }
- self->encoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->encoder.context);
-
- self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->encoder.context->time_base.num = 1;
- self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->in.fps;
- self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.context->mb_decision = FF_MB_DECISION_RD;
- self->encoder.context->noise_reduction = 250;
- self->encoder.context->flags |= CODEC_FLAG_QSCALE;
- self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
-
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
- self->encoder.max_bw_kpbs
- );
- self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
- self->encoder.context->rtp_payload_size = MP4V_RTP_PAYLOAD_SIZE;
- self->encoder.context->opaque = tsk_null;
- self->encoder.context->profile = self->profile>>4;
- self->encoder.context->level = self->profile & 0x0F;
- self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->in.fps * MP4V_GOP_SIZE_IN_SECONDS);
- self->encoder.context->max_b_frames = 0;
- self->encoder.context->b_frame_strategy = 1;
+ int ret, size;
+ int32_t max_bw_kpbs;
+ if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_MPEG4))) {
+ TSK_DEBUG_ERROR("Failed to find mp4v encoder");
+ return -1;
+ }
+
+ if(self->encoder.context) {
+ TSK_DEBUG_ERROR("Encoder already opened");
+ return -1;
+ }
+ self->encoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->encoder.context);
+
+ self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->encoder.context->time_base.num = 1;
+ self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->in.fps;
+ self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.context->mb_decision = FF_MB_DECISION_RD;
+ self->encoder.context->noise_reduction = 250;
+ self->encoder.context->flags |= CODEC_FLAG_QSCALE;
+ self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
+
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
+ self->encoder.max_bw_kpbs
+ );
+ self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
+ self->encoder.context->rtp_payload_size = MP4V_RTP_PAYLOAD_SIZE;
+ self->encoder.context->opaque = tsk_null;
+ self->encoder.context->profile = self->profile>>4;
+ self->encoder.context->level = self->profile & 0x0F;
+ self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->in.fps * MP4V_GOP_SIZE_IN_SECONDS);
+ self->encoder.context->max_b_frames = 0;
+ self->encoder.context->b_frame_strategy = 1;
self->encoder.context->flags |= CODEC_FLAG_AC_PRED;
- // Picture (YUV 420)
- if(!(self->encoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create MP4V-ES encoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->encoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
- if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate MP4V-ES encoder buffer");
- return -2;
- }
-
- // Open encoder
- if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open MP4V-ES encoder");
- return ret;
- }
-
- TSK_DEBUG_INFO("[MP4V-ES] bitrate=%d bps", self->encoder.context->bit_rate);
-
- return ret;
+ // Picture (YUV 420)
+ if(!(self->encoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create MP4V-ES encoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->encoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
+ if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate MP4V-ES encoder buffer");
+ return -2;
+ }
+
+ // Open encoder
+ if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open MP4V-ES encoder");
+ return ret;
+ }
+
+ TSK_DEBUG_INFO("[MP4V-ES] bitrate=%d bps", self->encoder.context->bit_rate);
+
+ return ret;
}
int tdav_codec_mp4ves_open_decoder(tdav_codec_mp4ves_t* self)
{
- int ret, size;
-
- if(!self->decoder.codec && !(self->decoder.codec = avcodec_find_decoder(CODEC_ID_MPEG4))){
- TSK_DEBUG_ERROR("Failed to find MP4V-ES decoder");
- return -1;
- }
-
- if(self->decoder.context){
- TSK_DEBUG_ERROR("Decoder already opened");
- return -1;
- }
-
- self->decoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->decoder.context);
-
- self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->out.width;
- self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->out.height;
-
- // Picture (YUV 420)
- if(!(self->decoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create decoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->decoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
- if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- // Open decoder
- if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open MP4V-ES decoder");
- return ret;
- }
-
+ int ret, size;
+
+ if(!self->decoder.codec && !(self->decoder.codec = avcodec_find_decoder(CODEC_ID_MPEG4))) {
+ TSK_DEBUG_ERROR("Failed to find MP4V-ES decoder");
+ return -1;
+ }
+
+ if(self->decoder.context) {
+ TSK_DEBUG_ERROR("Decoder already opened");
+ return -1;
+ }
+
+ self->decoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->decoder.context);
+
+ self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->out.height;
+
+ // Picture (YUV 420)
+ if(!(self->decoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create decoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->decoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
+ if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ // Open decoder
+ if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open MP4V-ES decoder");
+ return ret;
+ }
+
self->decoder.last_seq = 0;
- return ret;
+ return ret;
}
int tdav_codec_mp4ves_close_encoder(tdav_codec_mp4ves_t* self)
{
- if(self->encoder.context){
- avcodec_close(self->encoder.context);
- av_free(self->encoder.context);
- self->encoder.context = tsk_null;
- }
- if(self->encoder.picture){
- av_free(self->encoder.picture);
- }
- if(self->encoder.buffer){
- TSK_FREE(self->encoder.buffer);
- }
- return 0;
+ if(self->encoder.context) {
+ avcodec_close(self->encoder.context);
+ av_free(self->encoder.context);
+ self->encoder.context = tsk_null;
+ }
+ if(self->encoder.picture) {
+ av_free(self->encoder.picture);
+ }
+ if(self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
+ return 0;
}
int tdav_codec_mp4ves_close_decoder(tdav_codec_mp4ves_t* self)
{
- if(self->decoder.context){
- avcodec_close(self->decoder.context);
- if(self->decoder.context->extradata){
- TSK_FREE(self->decoder.context->extradata);
- self->decoder.context->extradata_size = 0;
- }
- av_free(self->decoder.context);
- self->decoder.context = tsk_null;
- }
- if(self->decoder.picture){
- av_free(self->decoder.picture);
- self->decoder.picture = tsk_null;
- }
- if(self->decoder.accumulator){
- TSK_FREE(self->decoder.accumulator);
- }
-
- return 0;
+ if(self->decoder.context) {
+ avcodec_close(self->decoder.context);
+ if(self->decoder.context->extradata) {
+ TSK_FREE(self->decoder.context->extradata);
+ self->decoder.context->extradata_size = 0;
+ }
+ av_free(self->decoder.context);
+ self->decoder.context = tsk_null;
+ }
+ if(self->decoder.picture) {
+ av_free(self->decoder.picture);
+ self->decoder.picture = tsk_null;
+ }
+ if(self->decoder.accumulator) {
+ TSK_FREE(self->decoder.accumulator);
+ }
+
+ return 0;
}
static void tdav_codec_mp4ves_encap(tdav_codec_mp4ves_t* mp4v, const uint8_t* pdata, tsk_size_t size)
{
- uint32_t scode; // start code
-
- if(size <= 4/*32bits: start code size*/){
- TSK_DEBUG_ERROR("Too short");
- return;
- }
- // first 32bits
- scode = tnet_htonl_2(pdata);
-
-/* RFC 3016 - 3.3 Examples of packetized MPEG-4 Visual bitstream
-
- VS= Visual Object Sequence
- VO= Visual Object
- VOL= Visual Object Layer
- VOP= Visual Object Plane
- GOV= Group of Visual Object Plane
- VP= Video Plane
-
- +------+------+------+------+
-(a) | RTP | VS | VO | VOL |
- |header|header|header|header|
- +------+------+------+------+
-
- +------+------+------+------+------------+
-(b) | RTP | VS | VO | VOL |Video Packet|
- |header|header|header|header| |
- +------+------+------+------+------------+
-
- +------+-----+------------------+
-(c) | RTP | GOV |Video Object Plane|
- |header| | |
- +------+-----+------------------+
-
- +------+------+------------+ +------+------+------------+
-(d) | RTP | VOP |Video Packet| | RTP | VP |Video Packet|
- |header|header| (1) | |header|header| (2) |
- +------+------+------------+ +------+------+------------+
-
- +------+------+------------+------+------------+------+------------+
-(e) | RTP | VP |Video Packet| VP |Video Packet| VP |Video Packet|
- |header|header| (1) |header| (2) |header| (3) |
- +------+------+------------+------+------------+------+------------+
-
- +------+------+------------+ +------+------------+
-(f) | RTP | VOP |VOP fragment| | RTP |VOP fragment|
- |header|header| (1) | |header| (2) | ___
- +------+------+------------+ +------+------------+
-
- Figure 2 - Examples of RTP packetized MPEG-4 Visual bitstream
-*/
-
-/* RFC 3016 - 3.2 Fragmentation of MPEG-4 Visual bitstream
-
- A fragmented MPEG-4 Visual bitstream is mapped directly onto the RTP
- payload without any addition of extra header fields or any removal of
- Visual syntax elements. The Combined Configuration/Elementary
- streams mode is used.
-
- In the following, header means one of the following:
-
- - Configuration information (Visual Object Sequence Header, Visual
- Object Header and Video Object Layer Header)
- - visual_object_sequence_end_code
- - The header of the entry point function for an elementary stream
- (Group_of_VideoObjectPlane() or the header of VideoObjectPlane(),
- video_plane_with_short_header(), MeshObject() or FaceObject())
- - The video packet header (video_packet_header() excluding
- next_resync_marker())
- - The header of gob_layer()
- See 6.2.1 "Start codes" of ISO/IEC 14496-2 [2][9][4] for the
- definition of the configuration information and the entry point
- functions.
-*/
-
- switch(scode){
- case visual_object_sequence_start_code:
- case visual_object_start_code:
- case user_data_start_code:
- case video_object_layer_start_code:
- case group_of_vop_start_code:
- case vop_start_code:
- {
- register uint32_t i, last_index = 0;
- int startcode = 0xffffffff;
-
- if(scode == visual_object_sequence_start_code && size >=5){
- //uint8_t profile_and_level_indication = pdata[4]; /* IEC 14496-2: 6.3.2 Visual Object Sequence and Visual Object */
- // TSK_DEBUG_INFO("profile_and_level_indication=%d", profile_and_level_indication);
- }
-
- if(size < MP4V_RTP_PAYLOAD_SIZE){
- goto last;
- }
-
- for(i = 4; i<(size - 4); i++){
- startcode = (startcode <<8) | pdata[i];
- switch(startcode){
- case visual_object_sequence_start_code:
- case group_of_vop_start_code:
- case vop_start_code:
- tdav_codec_mp4ves_rtp_callback(mp4v, pdata + last_index, (i - last_index), (last_index == size));
- last_index = i;
- }
- }
+ uint32_t scode; // start code
+
+ if(size <= 4/*32bits: start code size*/) {
+ TSK_DEBUG_ERROR("Too short");
+ return;
+ }
+ // first 32bits
+ scode = tnet_htonl_2(pdata);
+
+ /* RFC 3016 - 3.3 Examples of packetized MPEG-4 Visual bitstream
+
+ VS= Visual Object Sequence
+ VO= Visual Object
+ VOL= Visual Object Layer
+ VOP= Visual Object Plane
+ GOV= Group of Visual Object Plane
+ VP= Video Plane
+
+ +------+------+------+------+
+ (a) | RTP | VS | VO | VOL |
+ |header|header|header|header|
+ +------+------+------+------+
+
+ +------+------+------+------+------------+
+ (b) | RTP | VS | VO | VOL |Video Packet|
+ |header|header|header|header| |
+ +------+------+------+------+------------+
+
+ +------+-----+------------------+
+ (c) | RTP | GOV |Video Object Plane|
+ |header| | |
+ +------+-----+------------------+
+
+ +------+------+------------+ +------+------+------------+
+ (d) | RTP | VOP |Video Packet| | RTP | VP |Video Packet|
+ |header|header| (1) | |header|header| (2) |
+ +------+------+------------+ +------+------+------------+
+
+ +------+------+------------+------+------------+------+------------+
+ (e) | RTP | VP |Video Packet| VP |Video Packet| VP |Video Packet|
+ |header|header| (1) |header| (2) |header| (3) |
+ +------+------+------------+------+------------+------+------------+
+
+ +------+------+------------+ +------+------------+
+ (f) | RTP | VOP |VOP fragment| | RTP |VOP fragment|
+ |header|header| (1) | |header| (2) | ___
+ +------+------+------------+ +------+------------+
+
+ Figure 2 - Examples of RTP packetized MPEG-4 Visual bitstream
+ */
+
+ /* RFC 3016 - 3.2 Fragmentation of MPEG-4 Visual bitstream
+
+ A fragmented MPEG-4 Visual bitstream is mapped directly onto the RTP
+ payload without any addition of extra header fields or any removal of
+ Visual syntax elements. The Combined Configuration/Elementary
+ streams mode is used.
+
+ In the following, header means one of the following:
+
+ - Configuration information (Visual Object Sequence Header, Visual
+ Object Header and Video Object Layer Header)
+ - visual_object_sequence_end_code
+ - The header of the entry point function for an elementary stream
+ (Group_of_VideoObjectPlane() or the header of VideoObjectPlane(),
+ video_plane_with_short_header(), MeshObject() or FaceObject())
+ - The video packet header (video_packet_header() excluding
+ next_resync_marker())
+ - The header of gob_layer()
+ See 6.2.1 "Start codes" of ISO/IEC 14496-2 [2][9][4] for the
+ definition of the configuration information and the entry point
+ functions.
+ */
+
+ switch(scode) {
+ case visual_object_sequence_start_code:
+ case visual_object_start_code:
+ case user_data_start_code:
+ case video_object_layer_start_code:
+ case group_of_vop_start_code:
+ case vop_start_code: {
+ register uint32_t i, last_index = 0;
+ int startcode = 0xffffffff;
+
+ if(scode == visual_object_sequence_start_code && size >=5) {
+ //uint8_t profile_and_level_indication = pdata[4]; /* IEC 14496-2: 6.3.2 Visual Object Sequence and Visual Object */
+ // TSK_DEBUG_INFO("profile_and_level_indication=%d", profile_and_level_indication);
+ }
+
+ if(size < MP4V_RTP_PAYLOAD_SIZE) {
+ goto last;
+ }
+
+ for(i = 4; i<(size - 4); i++) {
+ startcode = (startcode <<8) | pdata[i];
+ switch(startcode) {
+ case visual_object_sequence_start_code:
+ case group_of_vop_start_code:
+ case vop_start_code:
+ tdav_codec_mp4ves_rtp_callback(mp4v, pdata + last_index, (i - last_index), (last_index == size));
+ last_index = i;
+ }
+ }
last:
- if(last_index < size){
- tdav_codec_mp4ves_rtp_callback(mp4v, pdata + last_index, (size - last_index), tsk_true);
- }
- break;
- }
- default:
- TSK_DEBUG_ERROR("%x is an invalide start code", scode);
- break;
- }
+ if(last_index < size) {
+ tdav_codec_mp4ves_rtp_callback(mp4v, pdata + last_index, (size - last_index), tsk_true);
+ }
+ break;
+ }
+ default:
+ TSK_DEBUG_ERROR("%x is an invalide start code", scode);
+ break;
+ }
}
static void tdav_codec_mp4ves_rtp_callback(tdav_codec_mp4ves_t *mp4v, const void *data, tsk_size_t size, tsk_bool_t marker)
{
- // Send data over the network
- if(TMEDIA_CODEC_VIDEO(mp4v)->out.callback){
- TMEDIA_CODEC_VIDEO(mp4v)->out.result.buffer.ptr = data;
- TMEDIA_CODEC_VIDEO(mp4v)->out.result.buffer.size = size;
- TMEDIA_CODEC_VIDEO(mp4v)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(mp4v)->out.fps) * TMEDIA_CODEC(mp4v)->plugin->rate);
- TMEDIA_CODEC_VIDEO(mp4v)->out.result.last_chunck = marker;
- TMEDIA_CODEC_VIDEO(mp4v)->out.callback(&TMEDIA_CODEC_VIDEO(mp4v)->out.result);
- }
+ // Send data over the network
+ if(TMEDIA_CODEC_VIDEO(mp4v)->out.callback) {
+ TMEDIA_CODEC_VIDEO(mp4v)->out.result.buffer.ptr = data;
+ TMEDIA_CODEC_VIDEO(mp4v)->out.result.buffer.size = size;
+ TMEDIA_CODEC_VIDEO(mp4v)->out.result.duration = (uint32_t)((1./(double)TMEDIA_CODEC_VIDEO(mp4v)->out.fps) * TMEDIA_CODEC(mp4v)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(mp4v)->out.result.last_chunck = marker;
+ TMEDIA_CODEC_VIDEO(mp4v)->out.callback(&TMEDIA_CODEC_VIDEO(mp4v)->out.result);
+ }
}
@@ -748,70 +743,68 @@ static void tdav_codec_mp4ves_rtp_callback(tdav_codec_mp4ves_t *mp4v, const void
/* constructor */
static tsk_object_t* tdav_codec_mp4ves_ctor(tsk_object_t * _self, va_list * app)
{
- tdav_codec_mp4ves_t *self = _self;
- if(self){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- self->profile = DEFAULT_PROFILE_LEVEL_ID;
- self->encoder.quality = 1;
- self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
- }
- return self;
+ tdav_codec_mp4ves_t *self = _self;
+ if(self) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ self->profile = DEFAULT_PROFILE_LEVEL_ID;
+ self->encoder.quality = 1;
+ self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_mp4ves_dtor(tsk_object_t * _self)
-{
- tdav_codec_mp4ves_t *self = _self;
- if(self){
- /* deinit base */
- tmedia_codec_video_deinit(self); // will close the codec if opened
- /* deinit self */
- TSK_FREE(self->rtp.ptr);
- self->rtp.size = 0;
- }
-
- return self;
+{
+ tdav_codec_mp4ves_t *self = _self;
+ if(self) {
+ /* deinit base */
+ tmedia_codec_video_deinit(self); // will close the codec if opened
+ /* deinit self */
+ TSK_FREE(self->rtp.ptr);
+ self->rtp.size = 0;
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_mp4ves_def_s =
-{
- sizeof(tdav_codec_mp4ves_t),
- tdav_codec_mp4ves_ctor,
- tdav_codec_mp4ves_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_mp4ves_def_s = {
+ sizeof(tdav_codec_mp4ves_t),
+ tdav_codec_mp4ves_ctor,
+ tdav_codec_mp4ves_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_mp4ves_plugin_def_s =
-{
- &tdav_codec_mp4ves_def_s,
-
- tmedia_video,
- tmedia_codec_id_mp4ves_es,
- "MP4V-ES",
- "MP4V-ES Codec",
- TMEDIA_CODEC_FORMAT_MP4V_ES,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps) */
- {176, 144, 0},// fps is @deprecated
-
- tdav_codec_mp4ves_set,
- tdav_codec_mp4ves_open,
- tdav_codec_mp4ves_close,
- tdav_codec_mp4ves_encode,
- tdav_codec_mp4ves_decode,
- tdav_codec_mp4ves_sdp_att_match,
- tdav_codec_mp4ves_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_mp4ves_plugin_def_s = {
+ &tdav_codec_mp4ves_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_mp4ves_es,
+ "MP4V-ES",
+ "MP4V-ES Codec",
+ TMEDIA_CODEC_FORMAT_MP4V_ES,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps) */
+ {176, 144, 0},// fps is @deprecated
+
+ tdav_codec_mp4ves_set,
+ tdav_codec_mp4ves_open,
+ tdav_codec_mp4ves_close,
+ tdav_codec_mp4ves_encode,
+ tdav_codec_mp4ves_decode,
+ tdav_codec_mp4ves_sdp_att_match,
+ tdav_codec_mp4ves_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_mp4ves_plugin_def_t = &tdav_codec_mp4ves_plugin_def_s;
tsk_bool_t tdav_codec_ffmpeg_mp4ves_is_supported()
{
- return (avcodec_find_encoder(CODEC_ID_MPEG4) && avcodec_find_decoder(CODEC_ID_MPEG4));
+ return (avcodec_find_encoder(CODEC_ID_MPEG4) && avcodec_find_decoder(CODEC_ID_MPEG4));
}
#endif /* HAVE_FFMPEG */
diff --git a/tinyDAV/src/codecs/msrp/tdav_codec_msrp.c b/tinyDAV/src/codecs/msrp/tdav_codec_msrp.c
index 5b72ded..a39e90b 100755
--- a/tinyDAV/src/codecs/msrp/tdav_codec_msrp.c
+++ b/tinyDAV/src/codecs/msrp/tdav_codec_msrp.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,8 +38,9 @@
#define tdav_codec_msrp_decode tsk_null
static tsk_bool_t tdav_codec_msrp_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
//
@@ -49,58 +50,56 @@ static tsk_bool_t tdav_codec_msrp_sdp_att_match(const tmedia_codec_t* codec, con
/* constructor */
static tsk_object_t* tdav_codec_msrp_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_msrp_t *msrp = self;
- if(msrp){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_msrp_t *msrp = self;
+ if(msrp) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_msrp_dtor(tsk_object_t * self)
-{
- tdav_codec_msrp_t *msrp = self;
- if(msrp){
- /* deinit base */
- tmedia_codec_msrp_deinit(msrp);
- /* deinit self */
- }
+{
+ tdav_codec_msrp_t *msrp = self;
+ if(msrp) {
+ /* deinit base */
+ tmedia_codec_msrp_deinit(msrp);
+ /* deinit self */
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_msrp_def_s =
-{
- sizeof(tdav_codec_msrp_t),
- tdav_codec_msrp_ctor,
- tdav_codec_msrp_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_msrp_def_s = {
+ sizeof(tdav_codec_msrp_t),
+ tdav_codec_msrp_ctor,
+ tdav_codec_msrp_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_msrp_plugin_def_s =
-{
- &tdav_codec_msrp_def_s,
+static const tmedia_codec_plugin_def_t tdav_codec_msrp_plugin_def_s = {
+ &tdav_codec_msrp_def_s,
+
+ tmedia_msrp,
+ tmedia_codec_id_none, // fake codec without real id
+ "message",
+ "MSRP fake codec",
+ TMEDIA_CODEC_FORMAT_MSRP,
+ tsk_false,
+ 0, // rate
- tmedia_msrp,
- tmedia_codec_id_none, // fake codec without real id
- "message",
- "MSRP fake codec",
- TMEDIA_CODEC_FORMAT_MSRP,
- tsk_false,
- 0, // rate
-
- /* audio */
- {0},
+ /* audio */
+ {0},
- /* video */
- {0},
+ /* video */
+ {0},
- tsk_null, // set()
- tdav_codec_msrp_open,
- tdav_codec_msrp_close,
- tdav_codec_msrp_encode,
- tdav_codec_msrp_decode,
- tdav_codec_msrp_sdp_att_match,
- tdav_codec_msrp_sdp_att_get
+ tsk_null, // set()
+ tdav_codec_msrp_open,
+ tdav_codec_msrp_close,
+ tdav_codec_msrp_encode,
+ tdav_codec_msrp_decode,
+ tdav_codec_msrp_sdp_att_match,
+ tdav_codec_msrp_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_msrp_plugin_def_t = &tdav_codec_msrp_plugin_def_s;
diff --git a/tinyDAV/src/codecs/opus/tdav_codec_opus.c b/tinyDAV/src/codecs/opus/tdav_codec_opus.c
index 355fc73..4e9392b 100755
--- a/tinyDAV/src/codecs/opus/tdav_codec_opus.c
+++ b/tinyDAV/src/codecs/opus/tdav_codec_opus.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,232 +50,237 @@
# define TDAV_OPUS_DTX_ENABLED 0
#endif
-typedef struct tdav_codec_opus_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- struct {
- OpusEncoder *inst;
- } encoder;
-
- struct {
- OpusDecoder *inst;
- opus_int16 buff[TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES];
- tsk_bool_t fec_enabled;
- tsk_bool_t dtx_enabled;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_opus_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ struct {
+ OpusEncoder *inst;
+ } encoder;
+
+ struct {
+ OpusDecoder *inst;
+ opus_int16 buff[TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES];
+ tsk_bool_t fec_enabled;
+ tsk_bool_t dtx_enabled;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_opus_t;
static tsk_bool_t _tdav_codec_opus_rate_is_valid(const int32_t rate)
{
- switch(rate){
- case 8000: case 12000: case 16000: case 24000: case 48000: return tsk_true;
- default: return tsk_false;
- }
+ switch(rate) {
+ case 8000:
+ case 12000:
+ case 16000:
+ case 24000:
+ case 48000:
+ return tsk_true;
+ default:
+ return tsk_false;
+ }
}
static int tdav_codec_opus_open(tmedia_codec_t* self)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
- int opus_err;
-
- if(!opus){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // Initialize the decoder
- if(!opus->decoder.inst){
- TSK_DEBUG_INFO("[OPUS] Open decoder: rate=%d, channels=%d", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels);
- if(!(opus->decoder.inst = opus_decoder_create((opus_int32)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, &opus_err)) || opus_err != OPUS_OK){
- TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, opus_err);
- return -2;
- }
- }
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
+ int opus_err;
+
+ if(!opus) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // Initialize the decoder
+ if(!opus->decoder.inst) {
+ TSK_DEBUG_INFO("[OPUS] Open decoder: rate=%d, channels=%d", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels);
+ if(!(opus->decoder.inst = opus_decoder_create((opus_int32)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, &opus_err)) || opus_err != OPUS_OK) {
+ TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, opus_err);
+ return -2;
+ }
+ }
opus->decoder.last_seq = 0;
- // Initialize the encoder
- if(!opus->encoder.inst){
- TSK_DEBUG_INFO("[OPUS] Open encoder: rate=%d, channels=%d", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels);
- if(!(opus->encoder.inst = opus_encoder_create((opus_int32)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, OPUS_APPLICATION_VOIP, &opus_err)) || opus_err != OPUS_OK){
- TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, opus_err);
- return -2;
- }
- }
+ // Initialize the encoder
+ if(!opus->encoder.inst) {
+ TSK_DEBUG_INFO("[OPUS] Open encoder: rate=%d, channels=%d", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels);
+ if(!(opus->encoder.inst = opus_encoder_create((opus_int32)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, OPUS_APPLICATION_VOIP, &opus_err)) || opus_err != OPUS_OK) {
+ TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, opus_err);
+ return -2;
+ }
+ }
#if TDAV_UNDER_MOBILE /* iOS, Android and WP8 */
- opus_encoder_ctl(opus->encoder.inst, OPUS_SET_COMPLEXITY(3));
+ opus_encoder_ctl(opus->encoder.inst, OPUS_SET_COMPLEXITY(3));
#endif
opus_encoder_ctl(opus->encoder.inst, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
- return 0;
+ return 0;
}
static int tdav_codec_opus_close(tmedia_codec_t* self)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
- (void)(opus);
-
- /* resources will be freed by the dctor() */
-
- return 0;
+ (void)(opus);
+
+ /* resources will be freed by the dctor() */
+
+ return 0;
}
static tsk_size_t tdav_codec_opus_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
- opus_int32 ret;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!opus->encoder.inst){
- TSK_DEBUG_ERROR("Encoder not ready");
- return 0;
- }
-
- // we're sure that the output (encoded) size cannot be higher than the input (raw)
- if(*out_max_size < in_size){
- if(!(*out_data = tsk_realloc(*out_data, in_size))){
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", in_size);
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = in_size;
- }
-
- ret = opus_encode(opus->encoder.inst,
- (const opus_int16 *)in_data, (int)(in_size >> 1),
- (unsigned char *)*out_data, (opus_int32)*out_max_size);
-
- if(ret < 0){
- TSK_DEBUG_ERROR("opus_encode() failed with error code = %d", ret);
- return 0;
- }
-
- return (tsk_size_t)ret;
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
+ opus_int32 ret;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!opus->encoder.inst) {
+ TSK_DEBUG_ERROR("Encoder not ready");
+ return 0;
+ }
+
+ // we're sure that the output (encoded) size cannot be higher than the input (raw)
+ if(*out_max_size < in_size) {
+ if(!(*out_data = tsk_realloc(*out_data, in_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", in_size);
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = in_size;
+ }
+
+ ret = opus_encode(opus->encoder.inst,
+ (const opus_int16 *)in_data, (int)(in_size >> 1),
+ (unsigned char *)*out_data, (opus_int32)*out_max_size);
+
+ if(ret < 0) {
+ TSK_DEBUG_ERROR("opus_encode() failed with error code = %d", ret);
+ return 0;
+ }
+
+ return (tsk_size_t)ret;
}
static tsk_size_t tdav_codec_opus_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
- int frame_size;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!opus->decoder.inst){
- TSK_DEBUG_ERROR("Decoder not ready");
- return 0;
- }
-
- /* Packet loss? */
- if(opus->decoder.last_seq != (rtp_hdr->seq_num - 1) && opus->decoder.last_seq){
- if(opus->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("[Opus] Packet loss, seq_num=%d", rtp_hdr->seq_num);
- opus_decode(opus->decoder.inst, tsk_null/*packet loss*/, (opus_int32)0, opus->decoder.buff, TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES, opus->decoder.fec_enabled);
- }
- opus->decoder.last_seq = rtp_hdr->seq_num;
-
- frame_size = opus_decode(opus->decoder.inst, (const unsigned char *)in_data, (opus_int32)in_size, opus->decoder.buff, TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES, opus->decoder.fec_enabled ? 1 : 0);
- if(frame_size > 0){
- tsk_size_t frame_size_inbytes = (frame_size << 1);
- if(*out_max_size < frame_size_inbytes){
- if(!(*out_data = tsk_realloc(*out_data, frame_size_inbytes))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = frame_size_inbytes;
- }
- memcpy(*out_data, opus->decoder.buff, frame_size_inbytes);
- return frame_size_inbytes;
- }
- else{
- return 0;
- }
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
+ int frame_size;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!opus->decoder.inst) {
+ TSK_DEBUG_ERROR("Decoder not ready");
+ return 0;
+ }
+
+ /* Packet loss? */
+ if(opus->decoder.last_seq != (rtp_hdr->seq_num - 1) && opus->decoder.last_seq) {
+ if(opus->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("[Opus] Packet loss, seq_num=%d", rtp_hdr->seq_num);
+ opus_decode(opus->decoder.inst, tsk_null/*packet loss*/, (opus_int32)0, opus->decoder.buff, TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES, opus->decoder.fec_enabled);
+ }
+ opus->decoder.last_seq = rtp_hdr->seq_num;
+
+ frame_size = opus_decode(opus->decoder.inst, (const unsigned char *)in_data, (opus_int32)in_size, opus->decoder.buff, TDAV_OPUS_MAX_FRAME_SIZE_IN_SAMPLES, opus->decoder.fec_enabled ? 1 : 0);
+ if(frame_size > 0) {
+ tsk_size_t frame_size_inbytes = (frame_size << 1);
+ if(*out_max_size < frame_size_inbytes) {
+ if(!(*out_data = tsk_realloc(*out_data, frame_size_inbytes))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = frame_size_inbytes;
+ }
+ memcpy(*out_data, opus->decoder.buff, frame_size_inbytes);
+ return frame_size_inbytes;
+ }
+ else {
+ return 0;
+ }
}
static tsk_bool_t tdav_codec_opus_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)codec;
-
- if(!opus){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- TSK_DEBUG_INFO("[OPUS] Trying to match [%s:%s]", att_name, att_value);
-
- if(tsk_striequals(att_name, "fmtp")){
- int val_int;
- tsk_params_L_t* params;
- /* e.g. FIXME */
- if((params = tsk_params_fromstring(att_value, ";", tsk_true))){
- tsk_bool_t ret = tsk_false;
- /* === maxplaybackrate ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "maxplaybackrate")) != -1){
- if(!_tdav_codec_opus_rate_is_valid(val_int)){
- TSK_DEBUG_ERROR("[OPUS] %d not valid as maxplaybackrate value", val_int);
- goto done;
- }
- TMEDIA_CODEC(opus)->out.rate = TSK_MIN((int32_t)TMEDIA_CODEC(opus)->out.rate, val_int);
- TMEDIA_CODEC_AUDIO(opus)->out.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(codec->id, codec->out.rate);
- }
- /* === sprop-maxcapturerate ===*/
- if((val_int = tsk_params_get_param_value_as_int(params, "sprop-maxcapturerate")) != -1){
- if(!_tdav_codec_opus_rate_is_valid(val_int)){
- TSK_DEBUG_ERROR("[OPUS] %d not valid as sprop-maxcapturerate value", val_int);
- goto done;
- }
- TMEDIA_CODEC(opus)->in.rate = TSK_MIN((int32_t)TMEDIA_CODEC(opus)->in.rate, val_int);
- TMEDIA_CODEC_AUDIO(opus)->in.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(codec->id, codec->in.rate);
- }
- ret = tsk_true;
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)codec;
+
+ if(!opus) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ TSK_DEBUG_INFO("[OPUS] Trying to match [%s:%s]", att_name, att_value);
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ int val_int;
+ tsk_params_L_t* params;
+ /* e.g. FIXME */
+ if((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+ tsk_bool_t ret = tsk_false;
+ /* === maxplaybackrate ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "maxplaybackrate")) != -1) {
+ if(!_tdav_codec_opus_rate_is_valid(val_int)) {
+ TSK_DEBUG_ERROR("[OPUS] %d not valid as maxplaybackrate value", val_int);
+ goto done;
+ }
+ TMEDIA_CODEC(opus)->out.rate = TSK_MIN((int32_t)TMEDIA_CODEC(opus)->out.rate, val_int);
+ TMEDIA_CODEC_AUDIO(opus)->out.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(codec->id, codec->out.rate);
+ }
+ /* === sprop-maxcapturerate ===*/
+ if((val_int = tsk_params_get_param_value_as_int(params, "sprop-maxcapturerate")) != -1) {
+ if(!_tdav_codec_opus_rate_is_valid(val_int)) {
+ TSK_DEBUG_ERROR("[OPUS] %d not valid as sprop-maxcapturerate value", val_int);
+ goto done;
+ }
+ TMEDIA_CODEC(opus)->in.rate = TSK_MIN((int32_t)TMEDIA_CODEC(opus)->in.rate, val_int);
+ TMEDIA_CODEC_AUDIO(opus)->in.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(codec->id, codec->in.rate);
+ }
+ ret = tsk_true;
done:
- TSK_OBJECT_SAFE_FREE(params);
- return ret;
- }
- }
+ TSK_OBJECT_SAFE_FREE(params);
+ return ret;
+ }
+ }
- return tsk_true;
+ return tsk_true;
}
static char* tdav_codec_opus_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- tdav_codec_opus_t* opus = (tdav_codec_opus_t*)codec;
-
- if(!opus){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(tsk_striequals(att_name, "fmtp")){
- char* fmtp = tsk_null;
- tsk_sprintf(&fmtp, "maxplaybackrate=%d; sprop-maxcapturerate=%d; stereo=%d; sprop-stereo=%d; useinbandfec=%d; usedtx=%d",
- TMEDIA_CODEC(opus)->in.rate,
- TMEDIA_CODEC(opus)->out.rate,
- (TMEDIA_CODEC_AUDIO(opus)->in.channels == 2) ? 1 : 0,
- (TMEDIA_CODEC_AUDIO(opus)->out.channels == 2) ? 1 : 0,
- opus->decoder.fec_enabled ? 1 : 0,
- opus->decoder.dtx_enabled ? 1 : 0
- );
- return fmtp;
- }
-
- return tsk_null;
+ tdav_codec_opus_t* opus = (tdav_codec_opus_t*)codec;
+
+ if(!opus) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
+ tsk_sprintf(&fmtp, "maxplaybackrate=%d; sprop-maxcapturerate=%d; stereo=%d; sprop-stereo=%d; useinbandfec=%d; usedtx=%d",
+ TMEDIA_CODEC(opus)->in.rate,
+ TMEDIA_CODEC(opus)->out.rate,
+ (TMEDIA_CODEC_AUDIO(opus)->in.channels == 2) ? 1 : 0,
+ (TMEDIA_CODEC_AUDIO(opus)->out.channels == 2) ? 1 : 0,
+ opus->decoder.fec_enabled ? 1 : 0,
+ opus->decoder.dtx_enabled ? 1 : 0
+ );
+ return fmtp;
+ }
+
+ return tsk_null;
}
//
@@ -285,77 +290,75 @@ static char* tdav_codec_opus_sdp_att_get(const tmedia_codec_t* codec, const char
/* constructor */
static tsk_object_t* tdav_codec_opus_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_opus_t *opus = self;
- if(opus){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- TMEDIA_CODEC(opus)->in.rate = tmedia_defaults_get_opus_maxplaybackrate();
- TMEDIA_CODEC(opus)->out.rate = tmedia_defaults_get_opus_maxcapturerate();
- TMEDIA_CODEC_AUDIO(opus)->in.channels = 1;
- TMEDIA_CODEC_AUDIO(opus)->out.channels = 1;
+ tdav_codec_opus_t *opus = self;
+ if(opus) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ TMEDIA_CODEC(opus)->in.rate = tmedia_defaults_get_opus_maxplaybackrate();
+ TMEDIA_CODEC(opus)->out.rate = tmedia_defaults_get_opus_maxcapturerate();
+ TMEDIA_CODEC_AUDIO(opus)->in.channels = 1;
+ TMEDIA_CODEC_AUDIO(opus)->out.channels = 1;
#if TDAV_OPUS_FEC_ENABLED
- opus->decoder.fec_enabled = tsk_true;
+ opus->decoder.fec_enabled = tsk_true;
#endif
#if TDAV_OPUS_DTX_ENABLED
- opus->decoder.dtx_enabled = tsk_true;
+ opus->decoder.dtx_enabled = tsk_true;
#endif
- }
- return self;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_opus_dtor(tsk_object_t * self)
-{
- tdav_codec_opus_t *opus = self;
- if(opus){
- /* deinit base */
- tmedia_codec_audio_deinit(opus);
- /* deinit self */
- if(opus->decoder.inst){
- opus_decoder_destroy(opus->decoder.inst), opus->decoder.inst = tsk_null;
- }
- if(opus->encoder.inst){
- opus_encoder_destroy(opus->encoder.inst), opus->encoder.inst = tsk_null;
- }
- }
-
- return self;
+{
+ tdav_codec_opus_t *opus = self;
+ if(opus) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(opus);
+ /* deinit self */
+ if(opus->decoder.inst) {
+ opus_decoder_destroy(opus->decoder.inst), opus->decoder.inst = tsk_null;
+ }
+ if(opus->encoder.inst) {
+ opus_encoder_destroy(opus->encoder.inst), opus->encoder.inst = tsk_null;
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_opus_def_s =
-{
- sizeof(tdav_codec_opus_t),
- tdav_codec_opus_ctor,
- tdav_codec_opus_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_opus_def_s = {
+ sizeof(tdav_codec_opus_t),
+ tdav_codec_opus_ctor,
+ tdav_codec_opus_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_opus_plugin_def_s =
-{
- &tdav_codec_opus_def_s,
-
- tmedia_audio,
- tmedia_codec_id_opus,
- "opus",
- "opus Codec",
- TMEDIA_CODEC_FORMAT_OPUS,
- tsk_true,
- 48000, // this is the default sample rate
-
- { /* audio */
- 2, // channels
- 0 // ptime @deprecated
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tdav_codec_opus_open,
- tdav_codec_opus_close,
- tdav_codec_opus_encode,
- tdav_codec_opus_decode,
- tdav_codec_opus_sdp_att_match,
- tdav_codec_opus_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_opus_plugin_def_s = {
+ &tdav_codec_opus_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_opus,
+ "opus",
+ "opus Codec",
+ TMEDIA_CODEC_FORMAT_OPUS,
+ tsk_true,
+ 48000, // this is the default sample rate
+
+ { /* audio */
+ 2, // channels
+ 0 // ptime @deprecated
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tdav_codec_opus_open,
+ tdav_codec_opus_close,
+ tdav_codec_opus_encode,
+ tdav_codec_opus_decode,
+ tdav_codec_opus_sdp_att_match,
+ tdav_codec_opus_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_opus_plugin_def_t = &tdav_codec_opus_plugin_def_s;
diff --git a/tinyDAV/src/codecs/speex/tdav_codec_speex.c b/tinyDAV/src/codecs/speex/tdav_codec_speex.c
index 18c4440..1a237a1 100755
--- a/tinyDAV/src/codecs/speex/tdav_codec_speex.c
+++ b/tinyDAV/src/codecs/speex/tdav_codec_speex.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,132 +45,132 @@ int tdav_codec_speex_deinit(tdav_codec_speex_t* self);
int tdav_codec_speex_open(tmedia_codec_t* self)
{
- static int quality = SPEEX_DEFAULT_QUALITY;
- tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
-
- switch(speex->type){
- case tdav_codec_speex_type_nb:
- speex->encoder.state = speex_encoder_init(&speex_nb_mode);
- speex->decoder.state = speex_decoder_init(&speex_nb_mode);
- break;
- case tdav_codec_speex_type_wb:
- speex->encoder.state = speex_encoder_init(&speex_wb_mode);
- speex->decoder.state = speex_decoder_init(&speex_wb_mode);
- break;
- case tdav_codec_speex_type_uwb:
- speex->encoder.state = speex_encoder_init(&speex_uwb_mode);
- speex->decoder.state = speex_decoder_init(&speex_uwb_mode);
- break;
- default:
- TSK_DEBUG_ERROR("Not implemented");
- return -2;
- }
-
- speex_decoder_ctl(speex->decoder.state, SPEEX_GET_FRAME_SIZE, &speex->decoder.size);
- speex->decoder.size *= sizeof(spx_int16_t);
- if(!(speex->decoder.buffer = tsk_calloc(speex->decoder.size, 1))){
- speex->decoder.size = speex->decoder.size = 0;
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return -3;
- }
-
- speex_encoder_ctl(speex->encoder.state, SPEEX_SET_QUALITY, &quality);
- speex_encoder_ctl(speex->encoder.state, SPEEX_GET_FRAME_SIZE, &speex->encoder.size);
-
- speex_bits_init(&speex->encoder.bits);
- speex_bits_init(&speex->decoder.bits);
- speex_bits_reset(&speex->encoder.bits);
- speex_bits_reset(&speex->decoder.bits);
-
- return 0;
+ static int quality = SPEEX_DEFAULT_QUALITY;
+ tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
+
+ switch(speex->type) {
+ case tdav_codec_speex_type_nb:
+ speex->encoder.state = speex_encoder_init(&speex_nb_mode);
+ speex->decoder.state = speex_decoder_init(&speex_nb_mode);
+ break;
+ case tdav_codec_speex_type_wb:
+ speex->encoder.state = speex_encoder_init(&speex_wb_mode);
+ speex->decoder.state = speex_decoder_init(&speex_wb_mode);
+ break;
+ case tdav_codec_speex_type_uwb:
+ speex->encoder.state = speex_encoder_init(&speex_uwb_mode);
+ speex->decoder.state = speex_decoder_init(&speex_uwb_mode);
+ break;
+ default:
+ TSK_DEBUG_ERROR("Not implemented");
+ return -2;
+ }
+
+ speex_decoder_ctl(speex->decoder.state, SPEEX_GET_FRAME_SIZE, &speex->decoder.size);
+ speex->decoder.size *= sizeof(spx_int16_t);
+ if(!(speex->decoder.buffer = tsk_calloc(speex->decoder.size, 1))) {
+ speex->decoder.size = speex->decoder.size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return -3;
+ }
+
+ speex_encoder_ctl(speex->encoder.state, SPEEX_SET_QUALITY, &quality);
+ speex_encoder_ctl(speex->encoder.state, SPEEX_GET_FRAME_SIZE, &speex->encoder.size);
+
+ speex_bits_init(&speex->encoder.bits);
+ speex_bits_init(&speex->decoder.bits);
+ speex_bits_reset(&speex->encoder.bits);
+ speex_bits_reset(&speex->decoder.bits);
+
+ return 0;
}
int tdav_codec_speex_close(tmedia_codec_t* self)
{
- tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
+ tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
- (void)(speex);
+ (void)(speex);
- return 0;
+ return 0;
}
tsk_size_t tdav_codec_speex_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
-{
- tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
- tsk_size_t outsize = 0;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- speex_bits_reset(&speex->encoder.bits);
- speex_encode_int(speex->encoder.state, (spx_int16_t*)in_data, &speex->encoder.bits);
-
- if(*out_max_size <speex->encoder.size){
- if((*out_data = tsk_realloc(*out_data, speex->encoder.size))){
- *out_max_size = speex->encoder.size;
- }
- else{
- *out_max_size = 0;
- return 0;
- }
- }
-
- outsize = speex_bits_write(&speex->encoder.bits, *out_data, (speex->encoder.size >> 1));
-
- return outsize;
+{
+ tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
+ tsk_size_t outsize = 0;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ speex_bits_reset(&speex->encoder.bits);
+ speex_encode_int(speex->encoder.state, (spx_int16_t*)in_data, &speex->encoder.bits);
+
+ if(*out_max_size <speex->encoder.size) {
+ if((*out_data = tsk_realloc(*out_data, speex->encoder.size))) {
+ *out_max_size = speex->encoder.size;
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+
+ outsize = speex_bits_write(&speex->encoder.bits, *out_data, (speex->encoder.size >> 1));
+
+ return outsize;
}
tsk_size_t tdav_codec_speex_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- int ret;
- tsk_size_t out_size = 0;
- tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // initializes the bit-stream
- speex_bits_read_from(&speex->decoder.bits, (char*)in_data, in_size);
-
- do{
- // performs decode()
- if((ret = speex_decode_int(speex->decoder.state, &speex->decoder.bits, speex->decoder.buffer))){
- TSK_DEBUG_ERROR("Failed to decode the buffer. retcode=%d", ret);
- break;
- }
-
- if(*out_max_size <(out_size + speex->decoder.size)){
- if((*out_data = tsk_realloc(*out_data, (out_size + speex->decoder.size)))){
- *out_max_size = (out_size + speex->decoder.size);
- }
- else{
- *out_max_size = 0;
- return 0;
- }
- }
-
- // copy output buffer
- memcpy(&((uint8_t*)*out_data)[out_size], speex->decoder.buffer, speex->decoder.size);
- out_size += speex->decoder.size;
- }
- while(speex_bits_remaining(&speex->decoder.bits) >= 5);
-
-
- return out_size;
+ int ret;
+ tsk_size_t out_size = 0;
+ tdav_codec_speex_t* speex = (tdav_codec_speex_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // initializes the bit-stream
+ speex_bits_read_from(&speex->decoder.bits, (char*)in_data, in_size);
+
+ do {
+ // performs decode()
+ if((ret = speex_decode_int(speex->decoder.state, &speex->decoder.bits, speex->decoder.buffer))) {
+ TSK_DEBUG_ERROR("Failed to decode the buffer. retcode=%d", ret);
+ break;
+ }
+
+ if(*out_max_size <(out_size + speex->decoder.size)) {
+ if((*out_data = tsk_realloc(*out_data, (out_size + speex->decoder.size)))) {
+ *out_max_size = (out_size + speex->decoder.size);
+ }
+ else {
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+
+ // copy output buffer
+ memcpy(&((uint8_t*)*out_data)[out_size], speex->decoder.buffer, speex->decoder.size);
+ out_size += speex->decoder.size;
+ }
+ while(speex_bits_remaining(&speex->decoder.bits) >= 5);
+
+
+ return out_size;
}
char* tdav_codec_speex_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- return tsk_null;
+ return tsk_null;
}
tsk_bool_t tdav_codec_speex_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- return tsk_true;
+{
+ return tsk_true;
}
@@ -245,42 +245,42 @@ SPEEX_OBJECT_DEFINITION(uwb,"SPEEX","Speex-UWB Codec",TMEDIA_CODEC_FORMAT_SPEEX_
//
int tdav_codec_speex_init(tdav_codec_speex_t* self, tdav_codec_speex_type_t type)
{
- if(self){
- self->type = type;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ self->type = type;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
int tdav_codec_speex_deinit(tdav_codec_speex_t* self)
{
- if(self){
- if(self->decoder.state){
- speex_decoder_destroy(self->decoder.state);
- self->decoder.state = tsk_null;
- }
- speex_bits_destroy(&self->decoder.bits);
- if(self->decoder.buffer){
- TSK_FREE(self->decoder.buffer);
- self->decoder.size = 0;
- }
-
- if(self->encoder.state){
- speex_encoder_destroy(self->encoder.state);
- self->encoder.state = tsk_null;
- }
- speex_bits_destroy(&self->encoder.bits);
- self->encoder.size = 0;
-
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ if(self->decoder.state) {
+ speex_decoder_destroy(self->decoder.state);
+ self->decoder.state = tsk_null;
+ }
+ speex_bits_destroy(&self->decoder.bits);
+ if(self->decoder.buffer) {
+ TSK_FREE(self->decoder.buffer);
+ self->decoder.size = 0;
+ }
+
+ if(self->encoder.state) {
+ speex_encoder_destroy(self->encoder.state);
+ self->encoder.state = tsk_null;
+ }
+ speex_bits_destroy(&self->encoder.bits);
+ self->encoder.size = 0;
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
#endif /* HAVE_LIB_SPEEX */
diff --git a/tinyDAV/src/codecs/t140/tdav_codec_t140.c b/tinyDAV/src/codecs/t140/tdav_codec_t140.c
index b401321..5045fb9 100755
--- a/tinyDAV/src/codecs/t140/tdav_codec_t140.c
+++ b/tinyDAV/src/codecs/t140/tdav_codec_t140.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,83 +32,83 @@
static int tdav_codec_t140_set(tmedia_codec_t* self, const struct tmedia_param_s* param)
{
- return 0;
+ return 0;
}
static int tdav_codec_t140_open(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static int tdav_codec_t140_close(tmedia_codec_t* self)
{
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_t140_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tsk_size_t out_size = in_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(*out_max_size <out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
- memcpy(*out_data, in_data, out_size);
-
- return out_size;
+ tsk_size_t out_size = in_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(*out_max_size <out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+ memcpy(*out_data, in_data, out_size);
+
+ return out_size;
}
static tsk_size_t tdav_codec_t140_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tsk_size_t out_size = in_size;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* allocate new buffer */
- if(*out_max_size < out_size){
- if(!(*out_data = tsk_realloc(*out_data, out_size))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- *out_max_size = out_size;
- }
- memcpy(*out_data, in_data, out_size);
-
- return out_size;
+ tsk_size_t out_size = in_size;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* allocate new buffer */
+ if(*out_max_size < out_size) {
+ if(!(*out_data = tsk_realloc(*out_data, out_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ *out_max_size = out_size;
+ }
+ memcpy(*out_data, in_data, out_size);
+
+ return out_size;
}
static tsk_bool_t tdav_codec_t140_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- return tsk_true;
+ return tsk_true;
}
static char* tdav_codec_t140_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- if(!self || !att_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(tsk_striequals("fmtp", att_name)){
- char* fmtp = tsk_null;
- tsk_sprintf(&fmtp, "cps=%d", TDAV_CODEC_T140_CPS);
- return fmtp;
- }
- return tsk_null;
+ if(!self || !att_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(tsk_striequals("fmtp", att_name)) {
+ char* fmtp = tsk_null;
+ tsk_sprintf(&fmtp, "cps=%d", TDAV_CODEC_T140_CPS);
+ return fmtp;
+ }
+ return tsk_null;
}
@@ -119,57 +119,55 @@ static char* tdav_codec_t140_sdp_att_get(const tmedia_codec_t* self, const char*
/* constructor */
static tsk_object_t* tdav_codec_t140_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_t140_t *t140 = self;
- if(t140){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_t140_t *t140 = self;
+ if(t140) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_t140_dtor(tsk_object_t * self)
-{
- tdav_codec_t140_t *t140 = self;
- if(t140){
- /* deinit base */
- /* deinit self */
- }
-
- return self;
+{
+ tdav_codec_t140_t *t140 = self;
+ if(t140) {
+ /* deinit base */
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_t140_def_s =
-{
- sizeof(tdav_codec_t140_t),
- tdav_codec_t140_ctor,
- tdav_codec_t140_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_t140_def_s = {
+ sizeof(tdav_codec_t140_t),
+ tdav_codec_t140_ctor,
+ tdav_codec_t140_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_t140_plugin_def_s =
-{
- &tdav_codec_t140_def_s,
-
- tmedia_t140,
- tmedia_codec_id_t140,
- "t140",
- "T140 codec (From tinyDAV)",
- TMEDIA_CODEC_FORMAT_T140,
- tsk_true,
- 1000, // rate
-
- /* audio */
- {0},
-
- /* video */
- {0},
-
- tdav_codec_t140_set,
- tdav_codec_t140_open,
- tdav_codec_t140_close,
- tdav_codec_t140_encode,
- tdav_codec_t140_decode,
- tdav_codec_t140_sdp_att_match,
- tdav_codec_t140_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_t140_plugin_def_s = {
+ &tdav_codec_t140_def_s,
+
+ tmedia_t140,
+ tmedia_codec_id_t140,
+ "t140",
+ "T140 codec (From tinyDAV)",
+ TMEDIA_CODEC_FORMAT_T140,
+ tsk_true,
+ 1000, // rate
+
+ /* audio */
+ {0},
+
+ /* video */
+ {0},
+
+ tdav_codec_t140_set,
+ tdav_codec_t140_open,
+ tdav_codec_t140_close,
+ tdav_codec_t140_encode,
+ tdav_codec_t140_decode,
+ tdav_codec_t140_sdp_att_match,
+ tdav_codec_t140_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_t140_plugin_def_t = &tdav_codec_t140_plugin_def_s;
diff --git a/tinyDAV/src/codecs/theora/tdav_codec_theora.c b/tinyDAV/src/codecs/theora/tdav_codec_theora.c
index 01072c3..620d6ed 100755
--- a/tinyDAV/src/codecs/theora/tdav_codec_theora.c
+++ b/tinyDAV/src/codecs/theora/tdav_codec_theora.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,64 +55,63 @@
#define THEORA_IDENT_HEADER_SIZE 42 /* 6.2 Identification Header Decode */
#define THEORA_CONF_SEND_COUNT 10 /* at 250ms, 500ms, 1000ms, .... */
-typedef struct tdav_codec_theora_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- // Encoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
- void* buffer;
-
- uint64_t conf_last;
- int conf_count;
- tsk_bool_t force_idr;
- int quality;
- int rotation;
- int32_t max_bw_kpbs;
- } encoder;
-
- // decoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
-
- tsk_bool_t opened;
- uint8_t conf_ident[3];
- tsk_buffer_t* conf_pkt;
-
- void* accumulator;
- uint8_t ebit;
- tsk_size_t accumulator_pos;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_theora_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ // Encoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+ void* buffer;
+
+ uint64_t conf_last;
+ int conf_count;
+ tsk_bool_t force_idr;
+ int quality;
+ int rotation;
+ int32_t max_bw_kpbs;
+ } encoder;
+
+ // decoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+
+ tsk_bool_t opened;
+ uint8_t conf_ident[3];
+ tsk_buffer_t* conf_pkt;
+
+ void* accumulator;
+ uint8_t ebit;
+ tsk_size_t accumulator_pos;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_theora_t;
/* 2.2. Payload Header filed 'F'*/
-typedef enum theora_frag_type_e{
- Not_Fragmented = 0,
- Start_Fragment = 1,
- Continuation_Fragment = 2,
- End_Fragment = 3,
+typedef enum theora_frag_type_e {
+ Not_Fragmented = 0,
+ Start_Fragment = 1,
+ Continuation_Fragment = 2,
+ End_Fragment = 3,
}
theora_frag_type_t;
/* 2.2. Payload Header field 'TDT'*/
-typedef enum theora_datatype_e{
- Raw_Theora_payload = 0,
- Theora_Packed_Configuration_payload = 1,
- Legacy_Theora_Comment_payload = 2,
- Reserved = 3,
+typedef enum theora_datatype_e {
+ Raw_Theora_payload = 0,
+ Theora_Packed_Configuration_payload = 1,
+ Legacy_Theora_Comment_payload = 2,
+ Reserved = 3,
}
theora_datatype_t;
@@ -130,399 +129,396 @@ static void tdav_codec_theora_encap(tdav_codec_theora_t* theora, const uint8_t*
static int tdav_codec_theora_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
- if(!self->opened){
- TSK_DEBUG_ERROR("Codec not opened");
- return -1;
- }
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "action")){
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch(action){
- case tmedia_codec_action_encode_idr:
- {
- theora->encoder.force_idr = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_down:
- {
- theora->encoder.quality = TSK_CLAMP(1, (theora->encoder.quality + 1), 31);
- theora->encoder.context->global_quality = FF_QP2LAMBDA * theora->encoder.quality;
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- theora->encoder.quality = TSK_CLAMP(1, (theora->encoder.quality - 1), 31);
- theora->encoder.context->global_quality = FF_QP2LAMBDA * theora->encoder.quality;
- break;
- }
- }
- }
- // FIXME: not working as expected
- /*else if(tsk_striequals(param->key, "rotation")){
- int rotation = *((int32_t*)param->value);
- if(theora->encoder.rotation != rotation){
- if(self->opened){
- int ret;
- theora->encoder.rotation = rotation;
- if((ret = tdav_codec_theora_close_encoder(theora))){
- return ret;
- }
- if((ret = tdav_codec_theora_open_encoder(theora))){
- return ret;
- }
- }
- }
- return 0;
- }*/
- }
- return -1;
+ tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Codec not opened");
+ return -1;
+ }
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch(action) {
+ case tmedia_codec_action_encode_idr: {
+ theora->encoder.force_idr = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_down: {
+ theora->encoder.quality = TSK_CLAMP(1, (theora->encoder.quality + 1), 31);
+ theora->encoder.context->global_quality = FF_QP2LAMBDA * theora->encoder.quality;
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ theora->encoder.quality = TSK_CLAMP(1, (theora->encoder.quality - 1), 31);
+ theora->encoder.context->global_quality = FF_QP2LAMBDA * theora->encoder.quality;
+ break;
+ }
+ }
+ }
+ // FIXME: not working as expected
+ /*else if(tsk_striequals(param->key, "rotation")){
+ int rotation = *((int32_t*)param->value);
+ if(theora->encoder.rotation != rotation){
+ if(self->opened){
+ int ret;
+ theora->encoder.rotation = rotation;
+ if((ret = tdav_codec_theora_close_encoder(theora))){
+ return ret;
+ }
+ if((ret = tdav_codec_theora_open_encoder(theora))){
+ return ret;
+ }
+ }
+ }
+ return 0;
+ }*/
+ }
+ return -1;
}
int tdav_codec_theora_open(tmedia_codec_t* self)
{
- int ret;
-
- tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
-
- if(!theora){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* the caller (base class) already checked that the codec is not opened */
-
-
- // Encoder
- if((ret = tdav_codec_theora_open_encoder(theora))){
- return ret;
- }
-
- // Decoder
- if((ret = tdav_codec_theora_open_decoder(theora))){
- return ret;
- }
-
- return 0;
+ int ret;
+
+ tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
+
+ if(!theora) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* the caller (base class) already checked that the codec is not opened */
+
+
+ // Encoder
+ if((ret = tdav_codec_theora_open_encoder(theora))) {
+ return ret;
+ }
+
+ // Decoder
+ if((ret = tdav_codec_theora_open_decoder(theora))) {
+ return ret;
+ }
+
+ return 0;
}
int tdav_codec_theora_close(tmedia_codec_t* self)
{
- tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
+ tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
- if(!theora){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!theora) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) already checked that the codec is opened */
+ /* the caller (base class) already checked that the codec is opened */
-
- // Encoder
- tdav_codec_theora_close_encoder(theora);
-
- // Decoder
- tdav_codec_theora_close_decoder(theora);
- return 0;
+ // Encoder
+ tdav_codec_theora_close_encoder(theora);
+
+ // Decoder
+ tdav_codec_theora_close_decoder(theora);
+
+ return 0;
}
//#include "tsk_time.h"
tsk_size_t tdav_codec_theora_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- int ret;
- int size;
-
- tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
-
- if(!self || !in_data || !in_size || !out_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // wrap yuv420 buffer
- size = avpicture_fill((AVPicture *)theora->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, theora->encoder.context->width, theora->encoder.context->height);
- if(size != in_size){
- /* guard */
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
-
- // Encode data
+ int ret;
+ int size;
+
+ tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
+
+ if(!self || !in_data || !in_size || !out_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // wrap yuv420 buffer
+ size = avpicture_fill((AVPicture *)theora->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, theora->encoder.context->width, theora->encoder.context->height);
+ if(size != in_size) {
+ /* guard */
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
+
+ // Encode data
#if LIBAVCODEC_VERSION_MAJOR <= 53
- theora->encoder.picture->pict_type = theora->encoder.force_idr ? FF_I_TYPE : 0;
+ theora->encoder.picture->pict_type = theora->encoder.force_idr ? FF_I_TYPE : 0;
#else
theora->encoder.picture->pict_type = theora->encoder.force_idr ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
#endif
- theora->encoder.picture->pts = AV_NOPTS_VALUE;
- theora->encoder.picture->quality = theora->encoder.context->global_quality;
- ret = avcodec_encode_video(theora->encoder.context, theora->encoder.buffer, size, theora->encoder.picture);
- if(ret > 0){
- tdav_codec_theora_encap(theora, theora->encoder.buffer, (tsk_size_t)ret);
- }
- theora->encoder.force_idr = tsk_false;
-
- return 0;
+ theora->encoder.picture->pts = AV_NOPTS_VALUE;
+ theora->encoder.picture->quality = theora->encoder.context->global_quality;
+ ret = avcodec_encode_video(theora->encoder.context, theora->encoder.buffer, size, theora->encoder.picture);
+ if(ret > 0) {
+ tdav_codec_theora_encap(theora, theora->encoder.buffer, (tsk_size_t)ret);
+ }
+ theora->encoder.force_idr = tsk_false;
+
+ return 0;
}
tsk_size_t tdav_codec_theora_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- const uint8_t* pdata = in_data;
- int pkts;
- const uint8_t* pay_ptr;
- tsk_size_t pay_size;
- //tsk_size_t hdr_size;
- tsk_size_t xsize, retsize = 0;
- int got_picture_ptr;
- int ret;
-
- tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
-
- if(!self || !in_data || (in_size<(THEORA_PAYLOAD_HEADER_SIZE + THEORA_PAYLOAD_LENGTH_SIZE)) || !out_data || !theora->decoder.context){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* Packet lost? */
- if(theora->decoder.last_seq != (rtp_hdr->seq_num - 1) && theora->decoder.last_seq){
- if(theora->decoder.last_seq == rtp_hdr->seq_num){
- // Could happen on some stupid emulators
- //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
- return 0;
- }
- TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
- }
- theora->decoder.last_seq = rtp_hdr->seq_num;
-
- xsize = avpicture_get_size(theora->decoder.context->pix_fmt, theora->decoder.context->width, theora->decoder.context->height);
-
- /* 2.2. Payload Header
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Configuration Ident | F |TDT|# pkts.|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /* 2.3. Payload Data
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Payload Length | Theora Data ..
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- pkts = (pdata[3] & 0x0F);
- pay_ptr = (pdata + THEORA_PAYLOAD_HEADER_SIZE);
-
- do{ /* pkts=0 for fragmented packets */
-
- pay_size = pay_ptr[0], pay_size<<=8, pay_size |= pay_ptr[1]; /* Big Endian read */
- pay_ptr += THEORA_PAYLOAD_LENGTH_SIZE;
- /* check size validity */
- if((pay_ptr + pay_size)>(pdata + in_size)){
- TSK_DEBUG_ERROR("Too short");
- break;
- }
-
- switch((pdata[3]>>4) & 0x03){
- case Raw_Theora_payload:
- { /* ====== Theora data (2.2. Payload Header, 2.3. Payload Data) ====== */
- /* append buffer */
- if((int)(theora->decoder.accumulator_pos + pay_size) <= xsize){
- memcpy(&((uint8_t*)theora->decoder.accumulator)[theora->decoder.accumulator_pos], pay_ptr, pay_size);
- theora->decoder.accumulator_pos += pay_size;
- }
- else{
- TSK_DEBUG_WARN("Buffer overflow");
- theora->decoder.accumulator_pos = 0;
- break;
- }
- /* only take care if last packet (What about the RTP marker?) */
- if(((pdata[3]>>6) == Not_Fragmented || (pdata[3]>>6) == End_Fragment /*|| rtp_hdr->marker*/) && theora->decoder.opened){
- AVPacket packet;
- /* Perform decoding */
- av_init_packet(&packet);
- packet.size = (int)theora->decoder.accumulator_pos;
- packet.data = theora->decoder.accumulator;
- ret = avcodec_decode_video2(theora->decoder.context, theora->decoder.picture, &got_picture_ptr, &packet);
-
- if(ret < 0){
- TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
- if(TMEDIA_CODEC_VIDEO(self)->in.callback){
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
- else if(got_picture_ptr){
- retsize = xsize;
- TMEDIA_CODEC_VIDEO(theora)->in.width = theora->decoder.context->width;
- TMEDIA_CODEC_VIDEO(theora)->in.height = theora->decoder.context->height;
-
- /* allocate buffer */
- if(*out_max_size <xsize){
- if((*out_data = tsk_realloc(*out_data, xsize))){
- *out_max_size = xsize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- return 0;
- }
- }
- /* copy picture into a linear buffer */
- avpicture_layout((AVPicture *)theora->decoder.picture, theora->decoder.context->pix_fmt, (int)theora->decoder.context->width, (int)theora->decoder.context->height,
- *out_data, (int)retsize);
- }
- /* in all cases: reset accumulator */
- theora->decoder.accumulator_pos = 0;
- }
- break;
- }
- case Theora_Packed_Configuration_payload:
- {/* ====== Configuration packet (3.1.1. Packed Configuration) ====== */
- static uint8_t __theora_comment_hdr[] = {0x81, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61,
- 0x00, 0x00, 0x00, 0x08, /* 4-byte length */
- 'd', 'o', 'u', 'b', 'a', 'n', 'g', 'o', /* UTF-8 encoded string */
- };
-
- /* http://www.theora.org/doc/Theora.pdf - Chapter 6
- A Theora bitstream begins with three header packets. The header packets
- are, in order, the identifcation header, the comment header, and the setup
- header. All are required for decode compliance. An end-of-packet condition
- encountered while decoding the identification or setup header packets renders
- the stream undecodable. An end-of-packet condition encountered while decode
- the comment header is a non-fatal error condition, and MAY be ignored by a
- decoder.
-
- Decode continues according to HEADERTYPE. The identification header
- is type 0x80, the comment header is type 0x81, and the setup header is type
- 0x82.
- */
- /*TSK_DEBUG_INFO("Theora_Packed_Configuration_payload");*/
-
- if(!theora->decoder.opened /*|| (conf_ident changed)*/){
- if(!theora->decoder.conf_pkt){
- theora->decoder.conf_pkt = tsk_buffer_create(pay_ptr, pay_size);
- }
- else{
- tsk_buffer_append(theora->decoder.conf_pkt, pay_ptr, pay_size);
- }
-
- if((pdata[3]>>6) == Not_Fragmented || (pdata[3]>>6) == End_Fragment || rtp_hdr->marker){
- if(theora->decoder.conf_pkt->size > THEORA_IDENT_HEADER_SIZE){
- const uint8_t* conf_ptr = theora->decoder.conf_pkt->data;
- int setup_size = (int)theora->decoder.conf_pkt->size - THEORA_IDENT_HEADER_SIZE;
- int extradata_size = (2 + THEORA_IDENT_HEADER_SIZE) + (2 + setup_size) + (2 + sizeof(__theora_comment_hdr));
- if(conf_ptr[0] == 0x80 && conf_ptr[THEORA_IDENT_HEADER_SIZE] == 0x82){ /* Do not check for 't'h'e'o'r'a' */
- /* save configration identification */
- memcpy(theora->decoder.conf_ident, &pdata[0], sizeof(theora->decoder.conf_ident));
- if(theora->decoder.context->extradata){
- TSK_FREE(theora->decoder.context->extradata);
- }
- if((theora->decoder.context->extradata = tsk_calloc(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))){
- int index = 0;
- /* Because of endianess pb. do not use uint16_t or uint32_t */
- theora->decoder.context->extradata[index++] = 0x00;
- theora->decoder.context->extradata[index++] = THEORA_IDENT_HEADER_SIZE;
- memcpy(&theora->decoder.context->extradata[index], &conf_ptr[0], THEORA_IDENT_HEADER_SIZE);
- index += THEORA_IDENT_HEADER_SIZE;
-
- theora->decoder.context->extradata[index++] = (setup_size >>8) & 0xFF;
- theora->decoder.context->extradata[index++] = (setup_size & 0xFF);
- memcpy(&theora->decoder.context->extradata[index], &conf_ptr[THEORA_IDENT_HEADER_SIZE], setup_size);
- index+=setup_size;
-
- theora->decoder.context->extradata[index++] = 0x00;
- theora->decoder.context->extradata[index++] = sizeof(__theora_comment_hdr);/* <0xFF */
- memcpy(&theora->decoder.context->extradata[index], __theora_comment_hdr, sizeof(__theora_comment_hdr));
-
- theora->decoder.context->extradata_size = extradata_size;
-
- if((ret = avcodec_open(theora->decoder.context, theora->decoder.codec)) == 0){
- theora->decoder.opened = tsk_true;
- }
- else{
- TSK_DEBUG_ERROR("Failed to open theora decoder %d", ret);
- TSK_FREE(theora->decoder.context->extradata);
- theora->decoder.context->extradata_size = 0;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid configuration packet");
- }
- }
- else{
- TSK_DEBUG_ERROR("Too short");
- }
- tsk_buffer_cleanup(theora->decoder.conf_pkt);
- }
- }
- break;
- }
- case Legacy_Theora_Comment_payload:
- /*TSK_DEBUG_INFO("Legacy_Theora_Comment_payload");*/
- break;
- case Reserved:
- /*TSK_DEBUG_INFO("Reserved");*/
- break;
- }
- }
- while(--pkts>0);
-
-
-
- return retsize;
+ const uint8_t* pdata = in_data;
+ int pkts;
+ const uint8_t* pay_ptr;
+ tsk_size_t pay_size;
+ //tsk_size_t hdr_size;
+ tsk_size_t xsize, retsize = 0;
+ int got_picture_ptr;
+ int ret;
+
+ tdav_codec_theora_t* theora = (tdav_codec_theora_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+
+ if(!self || !in_data || (in_size<(THEORA_PAYLOAD_HEADER_SIZE + THEORA_PAYLOAD_LENGTH_SIZE)) || !out_data || !theora->decoder.context) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* Packet lost? */
+ if(theora->decoder.last_seq != (rtp_hdr->seq_num - 1) && theora->decoder.last_seq) {
+ if(theora->decoder.last_seq == rtp_hdr->seq_num) {
+ // Could happen on some stupid emulators
+ //TSK_DEBUG_INFO("Packet duplicated, seq_num=%d", rtp_hdr->seq_num);
+ return 0;
+ }
+ TSK_DEBUG_INFO("Packet lost, seq_num=%d", rtp_hdr->seq_num);
+ }
+ theora->decoder.last_seq = rtp_hdr->seq_num;
+
+ xsize = avpicture_get_size(theora->decoder.context->pix_fmt, theora->decoder.context->width, theora->decoder.context->height);
+
+ /* 2.2. Payload Header
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Configuration Ident | F |TDT|# pkts.|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ /* 2.3. Payload Data
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Payload Length | Theora Data ..
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ pkts = (pdata[3] & 0x0F);
+ pay_ptr = (pdata + THEORA_PAYLOAD_HEADER_SIZE);
+
+ do { /* pkts=0 for fragmented packets */
+
+ pay_size = pay_ptr[0], pay_size<<=8, pay_size |= pay_ptr[1]; /* Big Endian read */
+ pay_ptr += THEORA_PAYLOAD_LENGTH_SIZE;
+ /* check size validity */
+ if((pay_ptr + pay_size)>(pdata + in_size)) {
+ TSK_DEBUG_ERROR("Too short");
+ break;
+ }
+
+ switch((pdata[3]>>4) & 0x03) {
+ case Raw_Theora_payload: {
+ /* ====== Theora data (2.2. Payload Header, 2.3. Payload Data) ====== */
+ /* append buffer */
+ if((int)(theora->decoder.accumulator_pos + pay_size) <= xsize) {
+ memcpy(&((uint8_t*)theora->decoder.accumulator)[theora->decoder.accumulator_pos], pay_ptr, pay_size);
+ theora->decoder.accumulator_pos += pay_size;
+ }
+ else {
+ TSK_DEBUG_WARN("Buffer overflow");
+ theora->decoder.accumulator_pos = 0;
+ break;
+ }
+ /* only take care if last packet (What about the RTP marker?) */
+ if(((pdata[3]>>6) == Not_Fragmented || (pdata[3]>>6) == End_Fragment /*|| rtp_hdr->marker*/) && theora->decoder.opened) {
+ AVPacket packet;
+ /* Perform decoding */
+ av_init_packet(&packet);
+ packet.size = (int)theora->decoder.accumulator_pos;
+ packet.data = theora->decoder.accumulator;
+ ret = avcodec_decode_video2(theora->decoder.context, theora->decoder.picture, &got_picture_ptr, &packet);
+
+ if(ret < 0) {
+ TSK_DEBUG_WARN("Failed to decode the buffer with error code = %d", ret);
+ if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+ else if(got_picture_ptr) {
+ retsize = xsize;
+ TMEDIA_CODEC_VIDEO(theora)->in.width = theora->decoder.context->width;
+ TMEDIA_CODEC_VIDEO(theora)->in.height = theora->decoder.context->height;
+
+ /* allocate buffer */
+ if(*out_max_size <xsize) {
+ if((*out_data = tsk_realloc(*out_data, xsize))) {
+ *out_max_size = xsize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ return 0;
+ }
+ }
+ /* copy picture into a linear buffer */
+ avpicture_layout((AVPicture *)theora->decoder.picture, theora->decoder.context->pix_fmt, (int)theora->decoder.context->width, (int)theora->decoder.context->height,
+ *out_data, (int)retsize);
+ }
+ /* in all cases: reset accumulator */
+ theora->decoder.accumulator_pos = 0;
+ }
+ break;
+ }
+ case Theora_Packed_Configuration_payload: {
+ /* ====== Configuration packet (3.1.1. Packed Configuration) ====== */
+ static uint8_t __theora_comment_hdr[] = {0x81, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61,
+ 0x00, 0x00, 0x00, 0x08, /* 4-byte length */
+ 'd', 'o', 'u', 'b', 'a', 'n', 'g', 'o', /* UTF-8 encoded string */
+ };
+
+ /* http://www.theora.org/doc/Theora.pdf - Chapter 6
+ A Theora bitstream begins with three header packets. The header packets
+ are, in order, the identifcation header, the comment header, and the setup
+ header. All are required for decode compliance. An end-of-packet condition
+ encountered while decoding the identification or setup header packets renders
+ the stream undecodable. An end-of-packet condition encountered while decode
+ the comment header is a non-fatal error condition, and MAY be ignored by a
+ decoder.
+
+ Decode continues according to HEADERTYPE. The identification header
+ is type 0x80, the comment header is type 0x81, and the setup header is type
+ 0x82.
+ */
+ /*TSK_DEBUG_INFO("Theora_Packed_Configuration_payload");*/
+
+ if(!theora->decoder.opened /*|| (conf_ident changed)*/) {
+ if(!theora->decoder.conf_pkt) {
+ theora->decoder.conf_pkt = tsk_buffer_create(pay_ptr, pay_size);
+ }
+ else {
+ tsk_buffer_append(theora->decoder.conf_pkt, pay_ptr, pay_size);
+ }
+
+ if((pdata[3]>>6) == Not_Fragmented || (pdata[3]>>6) == End_Fragment || rtp_hdr->marker) {
+ if(theora->decoder.conf_pkt->size > THEORA_IDENT_HEADER_SIZE) {
+ const uint8_t* conf_ptr = theora->decoder.conf_pkt->data;
+ int setup_size = (int)theora->decoder.conf_pkt->size - THEORA_IDENT_HEADER_SIZE;
+ int extradata_size = (2 + THEORA_IDENT_HEADER_SIZE) + (2 + setup_size) + (2 + sizeof(__theora_comment_hdr));
+ if(conf_ptr[0] == 0x80 && conf_ptr[THEORA_IDENT_HEADER_SIZE] == 0x82) { /* Do not check for 't'h'e'o'r'a' */
+ /* save configration identification */
+ memcpy(theora->decoder.conf_ident, &pdata[0], sizeof(theora->decoder.conf_ident));
+ if(theora->decoder.context->extradata) {
+ TSK_FREE(theora->decoder.context->extradata);
+ }
+ if((theora->decoder.context->extradata = tsk_calloc(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))) {
+ int index = 0;
+ /* Because of endianess pb. do not use uint16_t or uint32_t */
+ theora->decoder.context->extradata[index++] = 0x00;
+ theora->decoder.context->extradata[index++] = THEORA_IDENT_HEADER_SIZE;
+ memcpy(&theora->decoder.context->extradata[index], &conf_ptr[0], THEORA_IDENT_HEADER_SIZE);
+ index += THEORA_IDENT_HEADER_SIZE;
+
+ theora->decoder.context->extradata[index++] = (setup_size >>8) & 0xFF;
+ theora->decoder.context->extradata[index++] = (setup_size & 0xFF);
+ memcpy(&theora->decoder.context->extradata[index], &conf_ptr[THEORA_IDENT_HEADER_SIZE], setup_size);
+ index+=setup_size;
+
+ theora->decoder.context->extradata[index++] = 0x00;
+ theora->decoder.context->extradata[index++] = sizeof(__theora_comment_hdr);/* <0xFF */
+ memcpy(&theora->decoder.context->extradata[index], __theora_comment_hdr, sizeof(__theora_comment_hdr));
+
+ theora->decoder.context->extradata_size = extradata_size;
+
+ if((ret = avcodec_open(theora->decoder.context, theora->decoder.codec)) == 0) {
+ theora->decoder.opened = tsk_true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to open theora decoder %d", ret);
+ TSK_FREE(theora->decoder.context->extradata);
+ theora->decoder.context->extradata_size = 0;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid configuration packet");
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Too short");
+ }
+ tsk_buffer_cleanup(theora->decoder.conf_pkt);
+ }
+ }
+ break;
+ }
+ case Legacy_Theora_Comment_payload:
+ /*TSK_DEBUG_INFO("Legacy_Theora_Comment_payload");*/
+ break;
+ case Reserved:
+ /*TSK_DEBUG_INFO("Reserved");*/
+ break;
+ }
+ }
+ while(--pkts>0);
+
+
+
+ return retsize;
}
tsk_bool_t tdav_codec_theora_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
- tsk_bool_t ret = tsk_true; // accept decoding any size
-
- if(tsk_striequals(att_name, "fmtp")){
- tsk_params_L_t* params;
- if((params = tsk_params_fromstring(att_value, ";", tsk_true))){
- int pref_width, pref_height;
- int prop_width = tsk_params_get_param_value_as_int(params, "width");
- int prop_height = tsk_params_get_param_value_as_int(params, "height");
-
- if(prop_width > 0 && prop_height > 0){
- if(tmedia_video_get_size(TMEDIA_CODEC_VIDEO(codec)->pref_size, (unsigned *)&pref_width, (unsigned *)&pref_height) != 0){
- TSK_OBJECT_SAFE_FREE(params);
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = TSK_MIN(pref_width, prop_width);
- TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = TSK_MIN(pref_height, prop_height);
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
- }
- else if(tsk_striequals(att_name, "imageattr")){
- unsigned in_width, in_height, out_width, out_height;
- if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0){
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
- }
-
- return ret;
+ tsk_bool_t ret = tsk_true; // accept decoding any size
+
+ if(tsk_striequals(att_name, "fmtp")) {
+ tsk_params_L_t* params;
+ if((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+ int pref_width, pref_height;
+ int prop_width = tsk_params_get_param_value_as_int(params, "width");
+ int prop_height = tsk_params_get_param_value_as_int(params, "height");
+
+ if(prop_width > 0 && prop_height > 0) {
+ if(tmedia_video_get_size(TMEDIA_CODEC_VIDEO(codec)->pref_size, (unsigned *)&pref_width, (unsigned *)&pref_height) != 0) {
+ TSK_OBJECT_SAFE_FREE(params);
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = TSK_MIN(pref_width, prop_width);
+ TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = TSK_MIN(pref_height, prop_height);
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
+ }
+
+ return ret;
}
char* tdav_codec_theora_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- if(tsk_striequals(att_name, "fmtp")){
- char* fmtp = tsk_null;
- tsk_sprintf(&fmtp, "sampling=YCbCr-4:2:0; width=%u; height=%u", TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
- return fmtp;
- }
- else if(tsk_striequals(att_name, "imageattr")){
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
- TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
- }
- return tsk_null;
+ if(tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
+ tsk_sprintf(&fmtp, "sampling=YCbCr-4:2:0; width=%u; height=%u", TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
+ return fmtp;
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
+ TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
+ }
+ return tsk_null;
}
@@ -530,64 +526,62 @@ char* tdav_codec_theora_sdp_att_get(const tmedia_codec_t* codec, const char* att
/* constructor */
static tsk_object_t* tdav_codec_theora_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_theora_t *theora = self;
- if(theora){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- theora->encoder.quality = 1;
- theora->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
- }
- return self;
+ tdav_codec_theora_t *theora = self;
+ if(theora) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ theora->encoder.quality = 1;
+ theora->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_theora_dtor(tsk_object_t * self)
-{
- tdav_codec_theora_t *theora = self;
- if(theora){
- /* deinit base */
- tmedia_codec_video_deinit(self);
- /* deinit self */
- TSK_OBJECT_SAFE_FREE(theora->decoder.conf_pkt);
- TSK_FREE(theora->rtp.ptr);
- theora->rtp.size = 0;
- }
-
- return self;
+{
+ tdav_codec_theora_t *theora = self;
+ if(theora) {
+ /* deinit base */
+ tmedia_codec_video_deinit(self);
+ /* deinit self */
+ TSK_OBJECT_SAFE_FREE(theora->decoder.conf_pkt);
+ TSK_FREE(theora->rtp.ptr);
+ theora->rtp.size = 0;
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_theora_def_s =
-{
- sizeof(tdav_codec_theora_t),
- tdav_codec_theora_ctor,
- tdav_codec_theora_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_theora_def_s = {
+ sizeof(tdav_codec_theora_t),
+ tdav_codec_theora_ctor,
+ tdav_codec_theora_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_theora_plugin_def_s =
-{
- &tdav_codec_theora_def_s,
-
- tmedia_video,
- tmedia_codec_id_theora,
- "theora",
- "Theora Codec",
- TMEDIA_CODEC_FORMAT_THEORA,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (width, height, fps)*/
- {176, 144, 0},// fps is @deprecated
-
- tdav_codec_theora_set,
- tdav_codec_theora_open,
- tdav_codec_theora_close,
- tdav_codec_theora_encode,
- tdav_codec_theora_decode,
- tdav_codec_theora_sdp_att_match,
- tdav_codec_theora_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_theora_plugin_def_s = {
+ &tdav_codec_theora_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_theora,
+ "theora",
+ "Theora Codec",
+ TMEDIA_CODEC_FORMAT_THEORA,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (width, height, fps)*/
+ {176, 144, 0},// fps is @deprecated
+
+ tdav_codec_theora_set,
+ tdav_codec_theora_open,
+ tdav_codec_theora_close,
+ tdav_codec_theora_encode,
+ tdav_codec_theora_decode,
+ tdav_codec_theora_sdp_att_match,
+ tdav_codec_theora_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_theora_plugin_def_t = &tdav_codec_theora_plugin_def_s;
@@ -595,268 +589,268 @@ const tmedia_codec_plugin_def_t *tdav_codec_theora_plugin_def_t = &tdav_codec_th
int tdav_codec_theora_open_encoder(tdav_codec_theora_t* self)
{
- int ret, size;
- int32_t max_bw_kpbs;
- if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_THEORA))){
- TSK_DEBUG_ERROR("Failed to find Theora encoder");
- return -1;
- }
- if(self->encoder.context){
- TSK_DEBUG_ERROR("Encoder already initialized");
- return -1;
- }
- self->encoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->encoder.context);
-
- self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->encoder.context->time_base.num = 1;
- self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
- self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.context->mb_decision = FF_MB_DECISION_RD;
-
- // Theoraenc doesn't honor 'CODEC_FLAG_QSCALE'
- max_bw_kpbs = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
- self->encoder.max_bw_kpbs
- );
- self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
+ int ret, size;
+ int32_t max_bw_kpbs;
+ if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_THEORA))) {
+ TSK_DEBUG_ERROR("Failed to find Theora encoder");
+ return -1;
+ }
+ if(self->encoder.context) {
+ TSK_DEBUG_ERROR("Encoder already initialized");
+ return -1;
+ }
+ self->encoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->encoder.context);
+
+ self->encoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->encoder.context->time_base.num = 1;
+ self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.context->mb_decision = FF_MB_DECISION_RD;
+
+ // Theoraenc doesn't honor 'CODEC_FLAG_QSCALE'
+ max_bw_kpbs = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
+ self->encoder.max_bw_kpbs
+ );
+ self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
#if LIBAVCODEC_VERSION_MAJOR <= 53
- self->encoder.context->rc_lookahead = 0;
+ self->encoder.context->rc_lookahead = 0;
#endif
- self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
-
- self->encoder.context->thread_count = 0;
- self->encoder.context->rtp_payload_size = THEORA_RTP_PAYLOAD_SIZE;
- self->encoder.context->opaque = tsk_null;
- self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * THEORA_GOP_SIZE_IN_SECONDS);
-
- // Picture (YUV 420)
- if(!(self->encoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create encoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->encoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
- if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
- return -2;
- }
-
- // Open encoder
- if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0){
- TSK_DEBUG_ERROR("Failed to open Theora encoder");
- return ret;
- }
-
- self->encoder.conf_last = 0;
- self->encoder.conf_count = 0;
-
- TSK_DEBUG_INFO("[THEORA] bitrate=%d bps", self->encoder.context->bit_rate);
-
- return ret;
+ self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
+
+ self->encoder.context->thread_count = 0;
+ self->encoder.context->rtp_payload_size = THEORA_RTP_PAYLOAD_SIZE;
+ self->encoder.context->opaque = tsk_null;
+ self->encoder.context->gop_size = (TMEDIA_CODEC_VIDEO(self)->out.fps * THEORA_GOP_SIZE_IN_SECONDS);
+
+ // Picture (YUV 420)
+ if(!(self->encoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create encoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->encoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->encoder.context->width, self->encoder.context->height);
+ if(!(self->encoder.buffer = tsk_calloc(size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate encoder buffer");
+ return -2;
+ }
+
+ // Open encoder
+ if((ret = avcodec_open(self->encoder.context, self->encoder.codec)) < 0) {
+ TSK_DEBUG_ERROR("Failed to open Theora encoder");
+ return ret;
+ }
+
+ self->encoder.conf_last = 0;
+ self->encoder.conf_count = 0;
+
+ TSK_DEBUG_INFO("[THEORA] bitrate=%d bps", self->encoder.context->bit_rate);
+
+ return ret;
}
int tdav_codec_theora_open_decoder(tdav_codec_theora_t* self)
{
- int size;
- if(!self->decoder.codec && !(self->decoder.codec = avcodec_find_decoder(CODEC_ID_THEORA))){
- TSK_DEBUG_ERROR("Failed to find Theora decoder");
- return -1;
- }
- if(self->decoder.context){
- TSK_DEBUG_ERROR("Decoder already opened");
- return -1;
- }
- self->decoder.context = avcodec_alloc_context();
- avcodec_get_context_defaults(self->decoder.context);
-
- self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
- self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
- self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
-
- // Picture (YUV 420)
- if(!(self->decoder.picture = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create decoder picture");
- return -2;
- }
- avcodec_get_frame_defaults(self->decoder.picture);
-
- size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
- if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))){
- TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
- return -2;
- }
-
- // Open decoder
- //if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0){
- // TSK_DEBUG_ERROR("Failed to open Theora decoder");
- // return ret;
- //}
-
- return 0;
+ int size;
+ if(!self->decoder.codec && !(self->decoder.codec = avcodec_find_decoder(CODEC_ID_THEORA))) {
+ TSK_DEBUG_ERROR("Failed to find Theora decoder");
+ return -1;
+ }
+ if(self->decoder.context) {
+ TSK_DEBUG_ERROR("Decoder already opened");
+ return -1;
+ }
+ self->decoder.context = avcodec_alloc_context();
+ avcodec_get_context_defaults(self->decoder.context);
+
+ self->decoder.context->pix_fmt = PIX_FMT_YUV420P;
+ self->decoder.context->width = TMEDIA_CODEC_VIDEO(self)->in.width;
+ self->decoder.context->height = TMEDIA_CODEC_VIDEO(self)->in.height;
+
+ // Picture (YUV 420)
+ if(!(self->decoder.picture = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create decoder picture");
+ return -2;
+ }
+ avcodec_get_frame_defaults(self->decoder.picture);
+
+ size = avpicture_get_size(PIX_FMT_YUV420P, self->decoder.context->width, self->decoder.context->height);
+ if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ if(!(self->decoder.accumulator = tsk_calloc((size + FF_INPUT_BUFFER_PADDING_SIZE), sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocate decoder buffer");
+ return -2;
+ }
+
+ // Open decoder
+ //if((ret = avcodec_open(self->decoder.context, self->decoder.codec)) < 0){
+ // TSK_DEBUG_ERROR("Failed to open Theora decoder");
+ // return ret;
+ //}
+
+ return 0;
}
int tdav_codec_theora_close_encoder(tdav_codec_theora_t* self)
{
- if(self->encoder.context){
- avcodec_close(self->encoder.context);
- av_free(self->encoder.context);
- self->encoder.context = tsk_null;
- }
- if(self->encoder.picture){
- av_free(self->encoder.picture);
- self->encoder.picture = tsk_null;
- }
- if(self->encoder.buffer){
- TSK_FREE(self->encoder.buffer);
- }
- return 0;
+ if(self->encoder.context) {
+ avcodec_close(self->encoder.context);
+ av_free(self->encoder.context);
+ self->encoder.context = tsk_null;
+ }
+ if(self->encoder.picture) {
+ av_free(self->encoder.picture);
+ self->encoder.picture = tsk_null;
+ }
+ if(self->encoder.buffer) {
+ TSK_FREE(self->encoder.buffer);
+ }
+ return 0;
}
int tdav_codec_theora_close_decoder(tdav_codec_theora_t* self)
{
- if(self->decoder.context){
- avcodec_close(self->decoder.context);
- if(self->decoder.context->extradata){
- TSK_FREE(self->decoder.context->extradata);
- self->decoder.context->extradata_size = 0;
- }
- av_free(self->decoder.context);
- self->decoder.context = tsk_null;
- }
- if(self->decoder.picture){
- av_free(self->decoder.picture);
- self->decoder.picture = tsk_null;
- }
- if(self->decoder.accumulator){
- TSK_FREE(self->decoder.accumulator);
- }
- return 0;
+ if(self->decoder.context) {
+ avcodec_close(self->decoder.context);
+ if(self->decoder.context->extradata) {
+ TSK_FREE(self->decoder.context->extradata);
+ self->decoder.context->extradata_size = 0;
+ }
+ av_free(self->decoder.context);
+ self->decoder.context = tsk_null;
+ }
+ if(self->decoder.picture) {
+ av_free(self->decoder.picture);
+ self->decoder.picture = tsk_null;
+ }
+ if(self->decoder.accumulator) {
+ TSK_FREE(self->decoder.accumulator);
+ }
+ return 0;
}
static void tdav_codec_theora_encap(tdav_codec_theora_t* theora, const uint8_t* pdata, tsk_size_t size)
{
- if((theora->encoder.conf_count < THEORA_CONF_SEND_COUNT) && theora->encoder.context && theora->encoder.context->extradata){
- if((theora->encoder.conf_last + (250 *theora->encoder.conf_count)) < tsk_time_now()){
- int hdr_size, i, exd_size = theora->encoder.context->extradata_size, conf_pkt_size = 0;
- uint8_t *conf_pkt_ptr = tsk_null, *exd_ptr = theora->encoder.context->extradata;
- for(i=0; i<3 && exd_size; i++){
- hdr_size = exd_ptr[0], hdr_size<<=8, hdr_size |= exd_ptr[1];
- exd_ptr += 2;
- exd_size -= 2;
- if(hdr_size > exd_size){
- TSK_DEBUG_ERROR("Invalid extradata");
- TSK_FREE(conf_pkt_ptr);
- conf_pkt_size = 0;
- }
-
- if(exd_ptr[0] == 0x80 || exd_ptr[0] == 0x82){ /* Ignore 'comment' which is equal to '0x81' */
- if((conf_pkt_ptr = tsk_realloc(conf_pkt_ptr, (conf_pkt_size + hdr_size)))){
- memcpy((conf_pkt_ptr + conf_pkt_size), exd_ptr, hdr_size);
- conf_pkt_size += hdr_size;
- }
- }
- exd_size -= hdr_size;
- exd_ptr += hdr_size;
- }
-
- /* Send the conf pack */
- if(conf_pkt_ptr && conf_pkt_size){
- /*TSK_DEBUG_INFO("Sending Configuration Packet");*/
- tdav_codec_theora_send(theora, conf_pkt_ptr, conf_pkt_size, Theora_Packed_Configuration_payload);
- TSK_FREE(conf_pkt_ptr);
- }
-
- theora->encoder.conf_last = tsk_time_now();
- theora->encoder.conf_count++;
- }
- }
-
- /* Send Theora Raw data */
- tdav_codec_theora_send(theora, pdata, size, Raw_Theora_payload);
+ if((theora->encoder.conf_count < THEORA_CONF_SEND_COUNT) && theora->encoder.context && theora->encoder.context->extradata) {
+ if((theora->encoder.conf_last + (250 *theora->encoder.conf_count)) < tsk_time_now()) {
+ int hdr_size, i, exd_size = theora->encoder.context->extradata_size, conf_pkt_size = 0;
+ uint8_t *conf_pkt_ptr = tsk_null, *exd_ptr = theora->encoder.context->extradata;
+ for(i=0; i<3 && exd_size; i++) {
+ hdr_size = exd_ptr[0], hdr_size<<=8, hdr_size |= exd_ptr[1];
+ exd_ptr += 2;
+ exd_size -= 2;
+ if(hdr_size > exd_size) {
+ TSK_DEBUG_ERROR("Invalid extradata");
+ TSK_FREE(conf_pkt_ptr);
+ conf_pkt_size = 0;
+ }
+
+ if(exd_ptr[0] == 0x80 || exd_ptr[0] == 0x82) { /* Ignore 'comment' which is equal to '0x81' */
+ if((conf_pkt_ptr = tsk_realloc(conf_pkt_ptr, (conf_pkt_size + hdr_size)))) {
+ memcpy((conf_pkt_ptr + conf_pkt_size), exd_ptr, hdr_size);
+ conf_pkt_size += hdr_size;
+ }
+ }
+ exd_size -= hdr_size;
+ exd_ptr += hdr_size;
+ }
+
+ /* Send the conf pack */
+ if(conf_pkt_ptr && conf_pkt_size) {
+ /*TSK_DEBUG_INFO("Sending Configuration Packet");*/
+ tdav_codec_theora_send(theora, conf_pkt_ptr, conf_pkt_size, Theora_Packed_Configuration_payload);
+ TSK_FREE(conf_pkt_ptr);
+ }
+
+ theora->encoder.conf_last = tsk_time_now();
+ theora->encoder.conf_count++;
+ }
+ }
+
+ /* Send Theora Raw data */
+ tdav_codec_theora_send(theora, pdata, size, Raw_Theora_payload);
}
int tdav_codec_theora_send(tdav_codec_theora_t* self, const uint8_t* data, tsk_size_t size, theora_datatype_t tdt)
-{
- /* 2.2. Payload Header
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Configuration Ident | F |TDT|# pkts.|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- uint8_t pay_hdr[THEORA_PAYLOAD_HEADER_SIZE/*4*/ + THEORA_PAYLOAD_LENGTH_SIZE/*2*/] = {0x01, 0x19, 0x83, 0x00, 0x00, 0x00};
- //uint8_t* pay_ptr = tsk_null;
- tsk_size_t pay_size;
- tsk_bool_t frag, first = tsk_true;
-
- pay_hdr[3] = (tdt & 0xFF) <<4;
-
- /* whether the packet will be fragmented or not */
- frag = (size > THEORA_RTP_PAYLOAD_SIZE);
-
- while(size){
- pay_size = TSK_MIN(THEORA_RTP_PAYLOAD_SIZE, size);
- pay_hdr[4] = (uint8_t)(pay_size >> 8), pay_hdr[5] = (uint8_t)(pay_size & 0xFF);
-
- if(frag){
- if(first){
- first = tsk_false;
- pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Start_Fragment <<6);
- }
- else{ /* could not be 'first' and 'last' */
- if(size<=THEORA_RTP_PAYLOAD_SIZE){
- /* Last frag */
- pay_hdr[3] &= 0x3F, pay_hdr[3] |= (End_Fragment <<6);
- }
- else{
- /* Continuation frag */
- pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Continuation_Fragment <<6);
- }
- }
- }
- else{
- pay_hdr[3] |= 0x01; /* 'pkts' */
- pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Not_Fragmented <<6);
- }
-
- if(self->rtp.size < (pay_size + sizeof(pay_hdr))){
- if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (pay_size + sizeof(pay_hdr))))){
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return -2;
- }
- self->rtp.size = (pay_size + sizeof(pay_hdr));
- }
-
- memcpy(self->rtp.ptr, pay_hdr, sizeof(pay_hdr));
- memcpy((self->rtp.ptr + sizeof(pay_hdr)), data, pay_size);
- data += pay_size;
- size -= pay_size;
-
- // Send data over the network
- if(TMEDIA_CODEC_VIDEO(self)->out.callback){
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (pay_size + sizeof(pay_hdr));
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate;
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = (size == 0);
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
- }
-
- return 0;
+{
+ /* 2.2. Payload Header
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Configuration Ident | F |TDT|# pkts.|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ uint8_t pay_hdr[THEORA_PAYLOAD_HEADER_SIZE/*4*/ + THEORA_PAYLOAD_LENGTH_SIZE/*2*/] = {0x01, 0x19, 0x83, 0x00, 0x00, 0x00};
+ //uint8_t* pay_ptr = tsk_null;
+ tsk_size_t pay_size;
+ tsk_bool_t frag, first = tsk_true;
+
+ pay_hdr[3] = (tdt & 0xFF) <<4;
+
+ /* whether the packet will be fragmented or not */
+ frag = (size > THEORA_RTP_PAYLOAD_SIZE);
+
+ while(size) {
+ pay_size = TSK_MIN(THEORA_RTP_PAYLOAD_SIZE, size);
+ pay_hdr[4] = (uint8_t)(pay_size >> 8), pay_hdr[5] = (uint8_t)(pay_size & 0xFF);
+
+ if(frag) {
+ if(first) {
+ first = tsk_false;
+ pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Start_Fragment <<6);
+ }
+ else { /* could not be 'first' and 'last' */
+ if(size<=THEORA_RTP_PAYLOAD_SIZE) {
+ /* Last frag */
+ pay_hdr[3] &= 0x3F, pay_hdr[3] |= (End_Fragment <<6);
+ }
+ else {
+ /* Continuation frag */
+ pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Continuation_Fragment <<6);
+ }
+ }
+ }
+ else {
+ pay_hdr[3] |= 0x01; /* 'pkts' */
+ pay_hdr[3] &= 0x3F, pay_hdr[3] |= (Not_Fragmented <<6);
+ }
+
+ if(self->rtp.size < (pay_size + sizeof(pay_hdr))) {
+ if(!(self->rtp.ptr = tsk_realloc(self->rtp.ptr, (pay_size + sizeof(pay_hdr))))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return -2;
+ }
+ self->rtp.size = (pay_size + sizeof(pay_hdr));
+ }
+
+ memcpy(self->rtp.ptr, pay_hdr, sizeof(pay_hdr));
+ memcpy((self->rtp.ptr + sizeof(pay_hdr)), data, pay_size);
+ data += pay_size;
+ size -= pay_size;
+
+ // Send data over the network
+ if(TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->rtp.ptr;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (pay_size + sizeof(pay_hdr));
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (1./(double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate;
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = (size == 0);
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
+ }
+
+ return 0;
}
tsk_bool_t tdav_codec_ffmpeg_theora_is_supported()
{
- return (avcodec_find_encoder(CODEC_ID_THEORA) && avcodec_find_decoder(CODEC_ID_THEORA));
+ return (avcodec_find_encoder(CODEC_ID_THEORA) && avcodec_find_decoder(CODEC_ID_THEORA));
}
#endif /* HAVE_FFMPEG */ \ No newline at end of file
diff --git a/tinyDAV/src/codecs/vpx/tdav_codec_vp8.c b/tinyDAV/src/codecs/vpx/tdav_codec_vp8.c
index 5ed2f80..25434c8 100755
--- a/tinyDAV/src/codecs/vpx/tdav_codec_vp8.c
+++ b/tinyDAV/src/codecs/vpx/tdav_codec_vp8.c
@@ -70,43 +70,42 @@
#endif
/* VP8 codec */
-typedef struct tdav_codec_vp8_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- // Encoder
- struct {
- vpx_codec_enc_cfg_t cfg;
- tsk_bool_t initialized;
- vpx_codec_pts_t pts;
- vpx_codec_ctx_t context;
- unsigned pic_id : 15;
- uint64_t frame_count;
- tsk_bool_t force_idr;
- int rotation;
-
- struct {
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- tsk_mutex_handle_t* mutex;
- } encoder;
-
- // decoder
- struct {
- vpx_codec_dec_cfg_t cfg;
- unsigned initialized : 1;
- vpx_codec_ctx_t context;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- tsk_size_t first_part_size;
- uint16_t last_seq;
- uint32_t last_timestamp;
- tsk_bool_t idr;
- tsk_bool_t corrupted;
- } decoder;
+typedef struct tdav_codec_vp8_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ // Encoder
+ struct {
+ vpx_codec_enc_cfg_t cfg;
+ tsk_bool_t initialized;
+ vpx_codec_pts_t pts;
+ vpx_codec_ctx_t context;
+ unsigned pic_id : 15;
+ uint64_t frame_count;
+ tsk_bool_t force_idr;
+ int rotation;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ tsk_mutex_handle_t* mutex;
+ } encoder;
+
+ // decoder
+ struct {
+ vpx_codec_dec_cfg_t cfg;
+ unsigned initialized : 1;
+ vpx_codec_ctx_t context;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ tsk_size_t first_part_size;
+ uint16_t last_seq;
+ uint32_t last_timestamp;
+ tsk_bool_t idr;
+ tsk_bool_t corrupted;
+ } decoder;
}
tdav_codec_vp8_t;
@@ -125,500 +124,508 @@ static void tdav_codec_vp8_rtp_callback(tdav_codec_vp8_t *self, const void *data
static int tdav_codec_vp8_set(tmedia_codec_t* self, const tmedia_param_t* param)
{
- tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
- vpx_codec_err_t vpx_ret = VPX_CODEC_OK;
- tsk_bool_t reconf = tsk_false;
-
- if (param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(param->key, "action")) {
- tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
- switch (action) {
- case tmedia_codec_action_encode_idr:
- {
- vp8->encoder.force_idr = tsk_true;
- return 0;
- }
- case tmedia_codec_action_bw_down:
- {
- vp8->encoder.cfg.rc_target_bitrate = TSK_CLAMP(0, (int32_t)((vp8->encoder.cfg.rc_target_bitrate << 1) / 3), TMEDIA_CODEC(vp8)->bandwidth_max_upload);
- TSK_DEBUG_INFO("New target bitrate = %d kbps", vp8->encoder.cfg.rc_target_bitrate);
- reconf = tsk_true;
- break;
- }
- case tmedia_codec_action_bw_up:
- {
- vp8->encoder.cfg.rc_target_bitrate = TSK_CLAMP(0, (int32_t)((vp8->encoder.cfg.rc_target_bitrate * 3) >> 1), TMEDIA_CODEC(vp8)->bandwidth_max_upload);
- TSK_DEBUG_INFO("New target bitrate = %d kbps", vp8->encoder.cfg.rc_target_bitrate);
- reconf = tsk_true;
- break;
- }
- }
- }
- else if (tsk_striequals(param->key, "bw_kbps")) { // both up and down (from the SDP)
- int32_t max_bw_userdefine = tmedia_defaults_get_bandwidth_video_upload_max();
- int32_t max_bw_new = *((int32_t*)param->value);
- if (max_bw_userdefine > 0) {
- // do not use more than what the user defined in it's configuration
- TMEDIA_CODEC(vp8)->bandwidth_max_upload = TSK_MIN(max_bw_new, max_bw_userdefine);
- }
- else {
- TMEDIA_CODEC(vp8)->bandwidth_max_upload = max_bw_new;
- }
+ tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
+ vpx_codec_err_t vpx_ret = VPX_CODEC_OK;
+ tsk_bool_t reconf = tsk_false;
+
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "action")) {
+ tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
+ switch (action) {
+ case tmedia_codec_action_encode_idr: {
+ vp8->encoder.force_idr = tsk_true;
+ return 0;
+ }
+ case tmedia_codec_action_bw_down: {
+ vp8->encoder.cfg.rc_target_bitrate = TSK_CLAMP(0, (int32_t)((vp8->encoder.cfg.rc_target_bitrate << 1) / 3), TMEDIA_CODEC(vp8)->bandwidth_max_upload);
+ TSK_DEBUG_INFO("New target bitrate = %d kbps", vp8->encoder.cfg.rc_target_bitrate);
+ reconf = tsk_true;
+ break;
+ }
+ case tmedia_codec_action_bw_up: {
+ vp8->encoder.cfg.rc_target_bitrate = TSK_CLAMP(0, (int32_t)((vp8->encoder.cfg.rc_target_bitrate * 3) >> 1), TMEDIA_CODEC(vp8)->bandwidth_max_upload);
+ TSK_DEBUG_INFO("New target bitrate = %d kbps", vp8->encoder.cfg.rc_target_bitrate);
+ reconf = tsk_true;
+ break;
+ }
+ }
+ }
+ else if (tsk_striequals(param->key, "bw_kbps")) { // both up and down (from the SDP)
+ int32_t max_bw_userdefine = tmedia_defaults_get_bandwidth_video_upload_max();
+ int32_t max_bw_new = *((int32_t*)param->value);
+ if (max_bw_userdefine > 0) {
+ // do not use more than what the user defined in it's configuration
+ TMEDIA_CODEC(vp8)->bandwidth_max_upload = TSK_MIN(max_bw_new, max_bw_userdefine);
+ }
+ else {
+ TMEDIA_CODEC(vp8)->bandwidth_max_upload = max_bw_new;
+ }
vp8->encoder.cfg.rc_target_bitrate = TSK_CLAMP(0, (unsigned int)vp8->encoder.cfg.rc_target_bitrate, (unsigned int)TMEDIA_CODEC(vp8)->bandwidth_max_upload);
TSK_DEBUG_INFO("New target bitrate = %d kbps", vp8->encoder.cfg.rc_target_bitrate);
- reconf = tsk_true;
- }
- else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
- int32_t bw_max_upload = *((int32_t*)param->value);
- TSK_DEBUG_INFO("VP8 codec: bandwidth-max-upload=%d", bw_max_upload);
- TMEDIA_CODEC(vp8)->bandwidth_max_upload = bw_max_upload;
- reconf = tsk_true;
- }
- else if (tsk_striequals(param->key, "rotation")) {
- // IMPORTANT: changing resolution requires at least libvpx v1.1.0 "Eider"
- int32_t rotation = *((int32_t*)param->value);
- if (vp8->encoder.rotation != rotation) {
- vp8->encoder.rotation = rotation;
- vp8->encoder.cfg.g_w = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(vp8)->out.height : TMEDIA_CODEC_VIDEO(vp8)->out.width;
- vp8->encoder.cfg.g_h = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(vp8)->out.width : TMEDIA_CODEC_VIDEO(vp8)->out.height;
- reconf = tsk_true;
- }
- }
- }
-
- if (reconf) {
- if (vp8->encoder.initialized) {
- // The encoder isn't thread safe. Without this lock (and the one in the encode() function) we may have corruptions in the video (issue report from GE).
- // Google says the encoder is thread-safe but this is not the case. But it is *multi-instance* thread-safe.
- tsk_mutex_lock(vp8->encoder.mutex);
- if ((vpx_ret = vpx_codec_enc_config_set(&vp8->encoder.context, &vp8->encoder.cfg)) != VPX_CODEC_OK) {
- TSK_DEBUG_ERROR("vpx_codec_enc_config_set failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- }
- tsk_mutex_unlock(vp8->encoder.mutex);
- }
- return (vpx_ret == VPX_CODEC_OK) ? 0 : -2;
- }
-
- return -1;
+ reconf = tsk_true;
+ }
+ else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
+ int32_t bw_max_upload = *((int32_t*)param->value);
+ TSK_DEBUG_INFO("VP8 codec: bandwidth-max-upload=%d", bw_max_upload);
+ TMEDIA_CODEC(vp8)->bandwidth_max_upload = bw_max_upload;
+ reconf = tsk_true;
+ }
+ else if (tsk_striequals(param->key, "rotation")) {
+ // IMPORTANT: changing resolution requires at least libvpx v1.1.0 "Eider"
+ int32_t rotation = *((int32_t*)param->value);
+ if (vp8->encoder.rotation != rotation) {
+ vp8->encoder.rotation = rotation;
+ vp8->encoder.cfg.g_w = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(vp8)->out.height : TMEDIA_CODEC_VIDEO(vp8)->out.width;
+ vp8->encoder.cfg.g_h = (rotation == 90 || rotation == 270) ? TMEDIA_CODEC_VIDEO(vp8)->out.width : TMEDIA_CODEC_VIDEO(vp8)->out.height;
+ reconf = tsk_true;
+ }
+ }
+ }
+
+ if (reconf) {
+ if (vp8->encoder.initialized) {
+ // The encoder isn't thread safe. Without this lock (and the one in the encode() function) we may have corruptions in the video (issue report from GE).
+ // Google says the encoder is thread-safe but this is not the case. But it is *multi-instance* thread-safe.
+ tsk_mutex_lock(vp8->encoder.mutex);
+ if ((vpx_ret = vpx_codec_enc_config_set(&vp8->encoder.context, &vp8->encoder.cfg)) != VPX_CODEC_OK) {
+ TSK_DEBUG_ERROR("vpx_codec_enc_config_set failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ }
+ tsk_mutex_unlock(vp8->encoder.mutex);
+ }
+ return (vpx_ret == VPX_CODEC_OK) ? 0 : -2;
+ }
+
+ return -1;
}
static int tdav_codec_vp8_open(tmedia_codec_t* self)
{
- tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
- int ret;
+ tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
+ int ret;
- if (!vp8) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!vp8) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* the caller (base class) already checked that the codec is not opened */
+ /* the caller (base class) already checked that the codec is not opened */
- // Encoder
- if ((ret = tdav_codec_vp8_open_encoder(vp8))) {
- return ret;
- }
+ // Encoder
+ if ((ret = tdav_codec_vp8_open_encoder(vp8))) {
+ return ret;
+ }
- // Decoder
- if ((ret = tdav_codec_vp8_open_decoder(vp8))) {
- return ret;
- }
+ // Decoder
+ if ((ret = tdav_codec_vp8_open_decoder(vp8))) {
+ return ret;
+ }
- return ret;
+ return ret;
}
static int tdav_codec_vp8_close(tmedia_codec_t* self)
{
- tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
+ tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
- if (!vp8) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!vp8) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tdav_codec_vp8_close_encoder(vp8);
- tdav_codec_vp8_close_decoder(vp8);
+ tdav_codec_vp8_close_encoder(vp8);
+ tdav_codec_vp8_close_decoder(vp8);
- return 0;
+ return 0;
}
static tsk_size_t tdav_codec_vp8_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
- vpx_enc_frame_flags_t flags = 0;
- vpx_codec_err_t vpx_ret = VPX_CODEC_OK;
- const vpx_codec_cx_pkt_t *pkt;
- vpx_codec_iter_t iter = tsk_null;
- vpx_image_t image = {0};
-
- if (!vp8 || !in_data || !in_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if (in_size != (vp8->encoder.context.config.enc->g_w * vp8->encoder.context.config.enc->g_h * 3) >> 1) {
- TSK_DEBUG_ERROR("Invalid size");
- return 0;
- }
-
- // wrap yuv420 buffer
- if (!vpx_img_wrap(&image, VPX_IMG_FMT_I420, vp8->encoder.context.config.enc->g_w, vp8->encoder.context.config.enc->g_h, 1, (unsigned char*)in_data)) {
- TSK_DEBUG_ERROR("vpx_img_wrap failed");
- return 0;
- }
-
- // encode data
- ++vp8->encoder.pts;
- if (vp8->encoder.force_idr) {
- flags |= VPX_EFLAG_FORCE_KF;
- vp8->encoder.force_idr = tsk_false;
- }
- tsk_mutex_lock(vp8->encoder.mutex); // must
- vpx_ret = vpx_codec_encode(&vp8->encoder.context, &image, vp8->encoder.pts, 1, flags, VPX_DL_REALTIME);
- tsk_mutex_unlock(vp8->encoder.mutex);
-
- if (vpx_ret != VPX_CODEC_OK) {
- TSK_DEBUG_ERROR("vpx_codec_encode failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- goto bail;
- }
-
- ++vp8->encoder.frame_count;
- ++vp8->encoder.pic_id;
-
- while ((pkt = vpx_codec_get_cx_data(&vp8->encoder.context, &iter))) {
- switch (pkt->kind) {
- case VPX_CODEC_CX_FRAME_PKT:
- {
- tdav_codec_vp8_encap(vp8, pkt);
- break;
- }
- default:
- case VPX_CODEC_STATS_PKT: /**< Two-pass statistics for this frame */
- case VPX_CODEC_PSNR_PKT: /**< PSNR statistics for this frame */
- case VPX_CODEC_CUSTOM_PKT: /**< Algorithm extensions */
- {
- TSK_DEBUG_INFO("pkt->kind=%d not supported", (int)pkt->kind);
- break;
- }
- }
- }
+ tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
+ vpx_enc_frame_flags_t flags = 0;
+ vpx_codec_err_t vpx_ret = VPX_CODEC_OK;
+ const vpx_codec_cx_pkt_t *pkt;
+ vpx_codec_iter_t iter = tsk_null;
+ vpx_image_t image = {0};
+
+ if (!vp8 || !in_data || !in_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if (in_size != (vp8->encoder.context.config.enc->g_w * vp8->encoder.context.config.enc->g_h * 3) >> 1) {
+ TSK_DEBUG_ERROR("Invalid size");
+ return 0;
+ }
+
+ // wrap yuv420 buffer
+ if (!vpx_img_wrap(&image, VPX_IMG_FMT_I420, vp8->encoder.context.config.enc->g_w, vp8->encoder.context.config.enc->g_h, 1, (unsigned char*)in_data)) {
+ TSK_DEBUG_ERROR("vpx_img_wrap failed");
+ return 0;
+ }
+
+ // encode data
+ ++vp8->encoder.pts;
+ if (vp8->encoder.force_idr) {
+ flags |= VPX_EFLAG_FORCE_KF;
+ vp8->encoder.force_idr = tsk_false;
+ }
+ tsk_mutex_lock(vp8->encoder.mutex); // must
+ vpx_ret = vpx_codec_encode(&vp8->encoder.context, &image, vp8->encoder.pts, 1, flags, VPX_DL_REALTIME);
+ tsk_mutex_unlock(vp8->encoder.mutex);
+
+ if (vpx_ret != VPX_CODEC_OK) {
+ TSK_DEBUG_ERROR("vpx_codec_encode failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ goto bail;
+ }
+
+ ++vp8->encoder.frame_count;
+ ++vp8->encoder.pic_id;
+
+ while ((pkt = vpx_codec_get_cx_data(&vp8->encoder.context, &iter))) {
+ switch (pkt->kind) {
+ case VPX_CODEC_CX_FRAME_PKT: {
+ tdav_codec_vp8_encap(vp8, pkt);
+ break;
+ }
+ default:
+ case VPX_CODEC_STATS_PKT: /**< Two-pass statistics for this frame */
+ case VPX_CODEC_PSNR_PKT: /**< PSNR statistics for this frame */
+ case VPX_CODEC_CUSTOM_PKT: { /**< Algorithm extensions */
+ TSK_DEBUG_INFO("pkt->kind=%d not supported", (int)pkt->kind);
+ break;
+ }
+ }
+ }
bail:
- vpx_img_free(&image);
- return 0;
+ vpx_img_free(&image);
+ return 0;
}
static tsk_size_t tdav_codec_vp8_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
- const trtp_rtp_header_t* rtp_hdr = proto_hdr;
- const uint8_t* pdata = in_data;
- const uint8_t* pdata_end = (pdata + in_size);
- tsk_size_t ret = 0;
- tsk_bool_t fatal_error = tsk_false;
- static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
- uint8_t S, PartID;
-
- if (!self || !in_data || in_size < 1 || !out_data || !vp8->decoder.initialized) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- { /* 4.2. VP8 Payload Descriptor */
- uint8_t X, R, N, I, L, T, K;//TODO: store
-
- X = ((*pdata & 0x80) >> 7);
- R = ((*pdata & 0x40) >> 6);
- if (R) {
- TSK_DEBUG_ERROR("R<>0");
- fatal_error = tsk_true;
- goto bail;
- }
- N = ((*pdata & 0x20) >> 5);
- S = ((*pdata & 0x10) >> 4);
- PartID = (*pdata & 0x0F);
- // skip "REQUIRED" header
- if (++pdata >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
- // check "OPTIONAL" headers
- if (X) {
- I = (*pdata & 0x80);
- L = (*pdata & 0x40);
- T = (*pdata & 0x20);
- K = (*pdata & 0x10);
- if (++pdata >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
-
- if (I) {
- if (*pdata & 0x80) { // M
- // PictureID on 16bits
- if ((pdata += 2) >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
- }
- else {
- // PictureID on 8bits
- if (++pdata >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
- }
- }
- if (L) {
- if (++pdata >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
- }
- if (T || K) {
- if (++pdata >= pdata_end) {
- TSK_DEBUG_ERROR("Too short"); goto bail;
- }
- }
- }
- }
-
- in_size = (pdata_end - pdata);
-
- // Packet lost?
- if (vp8->decoder.last_seq && (vp8->decoder.last_seq + 1) != rtp_hdr->seq_num) {
- TSK_DEBUG_INFO("[VP8] Packet loss, seq_num=%d", (vp8->decoder.last_seq + 1));
- vp8->decoder.corrupted = tsk_true;
- }
- vp8->decoder.last_seq = rtp_hdr->seq_num;
-
- // New frame ?
- if (vp8->decoder.last_timestamp != rtp_hdr->timestamp) {
- /* 4.3. VP8 Payload Header
- Note that the header is present only in packets
- which have the S bit equal to one and the PartID equal to zero in the
- payload descriptor. Subsequent packets for the same frame do not
- carry the payload header.
- 0 1 2 3 4 5 6 7
- +-+-+-+-+-+-+-+-+
- |Size0|H| VER |P|
- +-+-+-+-+-+-+-+-+
- | Size1 |
- +-+-+-+-+-+-+-+-+
- | Size2 |
- +-+-+-+-+-+-+-+-+
- | Bytes 4..N of |
- | VP8 payload |
- : :
- +-+-+-+-+-+-+-+-+
- | OPTIONAL RTP |
- | padding |
- : :
- +-+-+-+-+-+-+-+-+
- P: Inverse key frame flag. When set to 0 the current frame is a key
- frame. When set to 1 the current frame is an interframe. Defined
- in [RFC6386]
- */
-
- // Reset accumulator position
- vp8->decoder.accumulator_pos = 0;
-
- // Make sure the header is present
- if (S != 1 || PartID != 0 || in_size < 3) {
- TSK_DEBUG_WARN("VP8 payload header is missing");
+ tdav_codec_vp8_t* vp8 = (tdav_codec_vp8_t*)self;
+ const trtp_rtp_header_t* rtp_hdr = proto_hdr;
+ const uint8_t* pdata = in_data;
+ const uint8_t* pdata_end = (pdata + in_size);
+ tsk_size_t ret = 0;
+ tsk_bool_t fatal_error = tsk_false;
+ static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
+ uint8_t S, PartID;
+
+ if (!self || !in_data || in_size < 1 || !out_data || !vp8->decoder.initialized) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ { /* 4.2. VP8 Payload Descriptor */
+ uint8_t X, R, N, I, L, T, K;//TODO: store
+
+ X = ((*pdata & 0x80) >> 7);
+ R = ((*pdata & 0x40) >> 6);
+ if (R) {
+ TSK_DEBUG_ERROR("R<>0");
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ N = ((*pdata & 0x20) >> 5);
+ S = ((*pdata & 0x10) >> 4);
+ PartID = (*pdata & 0x0F);
+ // skip "REQUIRED" header
+ if (++pdata >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ // check "OPTIONAL" headers
+ if (X) {
+ I = (*pdata & 0x80);
+ L = (*pdata & 0x40);
+ T = (*pdata & 0x20);
+ K = (*pdata & 0x10);
+ if (++pdata >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+
+ if (I) {
+ if (*pdata & 0x80) { // M
+ // PictureID on 16bits
+ if ((pdata += 2) >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ }
+ else {
+ // PictureID on 8bits
+ if (++pdata >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ }
+ }
+ if (L) {
+ if (++pdata >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ }
+ if (T || K) {
+ if (++pdata >= pdata_end) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ }
+ }
+ }
+
+ in_size = (pdata_end - pdata);
+
+ // Packet lost?
+ if (vp8->decoder.last_seq && (vp8->decoder.last_seq + 1) != rtp_hdr->seq_num) {
+ TSK_DEBUG_INFO("[VP8] Packet loss, seq_num=%d", (vp8->decoder.last_seq + 1));
+ vp8->decoder.corrupted = tsk_true;
+ }
+ vp8->decoder.last_seq = rtp_hdr->seq_num;
+
+ // New frame ?
+ if (vp8->decoder.last_timestamp != rtp_hdr->timestamp) {
+ /* 4.3. VP8 Payload Header
+ Note that the header is present only in packets
+ which have the S bit equal to one and the PartID equal to zero in the
+ payload descriptor. Subsequent packets for the same frame do not
+ carry the payload header.
+ 0 1 2 3 4 5 6 7
+ +-+-+-+-+-+-+-+-+
+ |Size0|H| VER |P|
+ +-+-+-+-+-+-+-+-+
+ | Size1 |
+ +-+-+-+-+-+-+-+-+
+ | Size2 |
+ +-+-+-+-+-+-+-+-+
+ | Bytes 4..N of |
+ | VP8 payload |
+ : :
+ +-+-+-+-+-+-+-+-+
+ | OPTIONAL RTP |
+ | padding |
+ : :
+ +-+-+-+-+-+-+-+-+
+ P: Inverse key frame flag. When set to 0 the current frame is a key
+ frame. When set to 1 the current frame is an interframe. Defined
+ in [RFC6386]
+ */
+
+ // Reset accumulator position
+ vp8->decoder.accumulator_pos = 0;
+
+ // Make sure the header is present
+ if (S != 1 || PartID != 0 || in_size < 3) {
+ TSK_DEBUG_WARN("VP8 payload header is missing");
#if 0
- if (in_size < 3)
+ if (in_size < 3)
#endif
- {
- fatal_error = tsk_true;
- goto bail;
- }
- }
- {
- /* SizeN: The size of the first partition in bytes is calculated from
- the 19 bits in Size0, Size1, and Size2 as 1stPartitionSize = Size0
- + 8 * Size1 + 2048 * Size2. [RFC6386]. */
- vp8->decoder.first_part_size = ((pdata[0] >> 5) & 0xFF) + 8 * pdata[1] + 2048 * pdata[2];
- }
-
- // Starting new frame...reset "corrupted" value
- vp8->decoder.corrupted = tsk_false;
-
- // Key frame?
- vp8->decoder.idr = !(pdata[0] & 0x01);
-
- // Update timestamp
- vp8->decoder.last_timestamp = rtp_hdr->timestamp;
- }
-
- if (in_size > xmax_size) {
- vp8->decoder.accumulator_pos = 0;
- TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", (unsigned)in_size, (unsigned)xmax_size);
- fatal_error = tsk_true;
- goto bail;
- }
- // start-accumulator
- if (!vp8->decoder.accumulator) {
- if (!(vp8->decoder.accumulator = tsk_calloc(in_size, sizeof(uint8_t)))) {
- TSK_DEBUG_ERROR("Failed to allocated new buffer");
- fatal_error = tsk_true;
- goto bail;
- }
- vp8->decoder.accumulator_size = in_size;
- }
- if ((vp8->decoder.accumulator_pos + in_size) >= xmax_size) {
- TSK_DEBUG_ERROR("BufferOverflow");
- vp8->decoder.accumulator_pos = 0;
- fatal_error = tsk_true;
- goto bail;
- }
- if ((vp8->decoder.accumulator_pos + in_size) > vp8->decoder.accumulator_size) {
- if (!(vp8->decoder.accumulator = tsk_realloc(vp8->decoder.accumulator, (vp8->decoder.accumulator_pos + in_size)))) {
- TSK_DEBUG_ERROR("Failed to reallocated new buffer");
- vp8->decoder.accumulator_pos = 0;
- vp8->decoder.accumulator_size = 0;
- fatal_error = tsk_true;
- goto bail;
- }
- vp8->decoder.accumulator_size = (vp8->decoder.accumulator_pos + in_size);
- }
-
- memcpy(&((uint8_t*)vp8->decoder.accumulator)[vp8->decoder.accumulator_pos], pdata, in_size);
- vp8->decoder.accumulator_pos += in_size;
- // end-accumulator
-
- // Decode the frame if we have a marker or the first partition is complete and not corrupted
- if (rtp_hdr->marker /*|| (!vp8->decoder.corrupted && vp8->decoder.first_part_size == vp8->decoder.accumulator_pos)*/) {
- vpx_image_t *img;
- vpx_codec_iter_t iter = tsk_null;
- vpx_codec_err_t vpx_ret;
- const uint8_t* pay_ptr = (const uint8_t*)vp8->decoder.accumulator;
- const tsk_size_t pay_size = vp8->decoder.accumulator_pos;
-
- // in all cases: reset accumulator position
- vp8->decoder.accumulator_pos = 0;
+ {
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ }
+ {
+ /* SizeN: The size of the first partition in bytes is calculated from
+ the 19 bits in Size0, Size1, and Size2 as 1stPartitionSize = Size0
+ + 8 * Size1 + 2048 * Size2. [RFC6386]. */
+ vp8->decoder.first_part_size = ((pdata[0] >> 5) & 0xFF) + 8 * pdata[1] + 2048 * pdata[2];
+ }
+
+ // Starting new frame...reset "corrupted" value
+ vp8->decoder.corrupted = tsk_false;
+
+ // Key frame?
+ vp8->decoder.idr = !(pdata[0] & 0x01);
+
+ // Update timestamp
+ vp8->decoder.last_timestamp = rtp_hdr->timestamp;
+ }
+
+ if (in_size > xmax_size) {
+ vp8->decoder.accumulator_pos = 0;
+ TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", (unsigned)in_size, (unsigned)xmax_size);
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ // start-accumulator
+ if (!vp8->decoder.accumulator) {
+ if (!(vp8->decoder.accumulator = tsk_calloc(in_size, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("Failed to allocated new buffer");
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ vp8->decoder.accumulator_size = in_size;
+ }
+ if ((vp8->decoder.accumulator_pos + in_size) >= xmax_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ vp8->decoder.accumulator_pos = 0;
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ if ((vp8->decoder.accumulator_pos + in_size) > vp8->decoder.accumulator_size) {
+ if (!(vp8->decoder.accumulator = tsk_realloc(vp8->decoder.accumulator, (vp8->decoder.accumulator_pos + in_size)))) {
+ TSK_DEBUG_ERROR("Failed to reallocated new buffer");
+ vp8->decoder.accumulator_pos = 0;
+ vp8->decoder.accumulator_size = 0;
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ vp8->decoder.accumulator_size = (vp8->decoder.accumulator_pos + in_size);
+ }
+
+ memcpy(&((uint8_t*)vp8->decoder.accumulator)[vp8->decoder.accumulator_pos], pdata, in_size);
+ vp8->decoder.accumulator_pos += in_size;
+ // end-accumulator
+
+ // Decode the frame if we have a marker or the first partition is complete and not corrupted
+ if (rtp_hdr->marker /*|| (!vp8->decoder.corrupted && vp8->decoder.first_part_size == vp8->decoder.accumulator_pos)*/) {
+ vpx_image_t *img;
+ vpx_codec_iter_t iter = tsk_null;
+ vpx_codec_err_t vpx_ret;
+ const uint8_t* pay_ptr = (const uint8_t*)vp8->decoder.accumulator;
+ const tsk_size_t pay_size = vp8->decoder.accumulator_pos;
+
+ // in all cases: reset accumulator position
+ vp8->decoder.accumulator_pos = 0;
#if 0 /* http://groups.google.com/a/webmproject.org/group/apps-devel/browse_thread/thread/c84438e70fe122fa/2dfc322018aa22a8 */
- // libvpx will crash very ofen when the frame is corrupted => for now we decided not to decode such frame
- // according to the latest release there is a function to check if the frame
- // is corrupted or not => To be checked
- if(vp8->decoder.corrupted) {
- vp8->decoder.corrupted = tsk_false;
- goto bail;
- }
+ // libvpx will crash very ofen when the frame is corrupted => for now we decided not to decode such frame
+ // according to the latest release there is a function to check if the frame
+ // is corrupted or not => To be checked
+ if(vp8->decoder.corrupted) {
+ vp8->decoder.corrupted = tsk_false;
+ goto bail;
+ }
#endif
- if (pay_size < vp8->decoder.first_part_size) {
- TSK_DEBUG_WARN("[VP8] No enough bytes for the first part: %u < %u", (unsigned)pay_size, (unsigned)vp8->decoder.first_part_size);
- // Not a fatal error
- goto bail;
- }
-
- vpx_ret = vpx_codec_decode(&vp8->decoder.context, pay_ptr, (int)pay_size, tsk_null, 0);
-
- if (vpx_ret != VPX_CODEC_OK) {
- TSK_DEBUG_INFO("vpx_codec_decode failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- fatal_error = tsk_true;
- goto bail;
- }
- else if (vp8->decoder.idr) {
- TSK_DEBUG_INFO("Decoded VP8 IDR");
- if (TMEDIA_CODEC_VIDEO(self)->in.callback) {
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
- }
-
- // copy decoded data
- ret = 0;
- while ((img = vpx_codec_get_frame(&vp8->decoder.context, &iter))) {
- unsigned int plane, y;
- tsk_size_t xsize;
-
- // update sizes
- TMEDIA_CODEC_VIDEO(vp8)->in.width = img->d_w;
- TMEDIA_CODEC_VIDEO(vp8)->in.height = img->d_h;
- xsize = (TMEDIA_CODEC_VIDEO(vp8)->in.width * TMEDIA_CODEC_VIDEO(vp8)->in.height * 3) >> 1;
- // allocate destination buffer
- if (*out_max_size < xsize) {
- if (!(*out_data = tsk_realloc(*out_data, xsize))) {
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- *out_max_size = 0;
- goto bail;
- }
- *out_max_size = xsize;
- }
-
- // layout picture
- for (plane = 0; plane < 3; plane++) {
- unsigned char *buf = img->planes[plane];
- for (y = 0; y < img->d_h >> (plane ? 1 : 0); y++) {
- unsigned int w_count = img->d_w >> (plane ? 1 : 0);
- if ((ret + w_count) > *out_max_size) {
- TSK_DEBUG_ERROR("BufferOverflow");
- ret = 0;
- goto bail;
- }
- memcpy(((uint8_t*)*out_data) + ret, buf, w_count);
- ret += w_count;
- buf += img->stride[plane];
- }
- }
- }
- }
+ if (pay_size < vp8->decoder.first_part_size) {
+ TSK_DEBUG_WARN("[VP8] No enough bytes for the first part: %u < %u", (unsigned)pay_size, (unsigned)vp8->decoder.first_part_size);
+ // Not a fatal error
+ goto bail;
+ }
+
+ vpx_ret = vpx_codec_decode(&vp8->decoder.context, pay_ptr, (int)pay_size, tsk_null, 0);
+
+ if (vpx_ret != VPX_CODEC_OK) {
+ TSK_DEBUG_INFO("vpx_codec_decode failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ fatal_error = tsk_true;
+ goto bail;
+ }
+ else if (vp8->decoder.idr) {
+ TSK_DEBUG_INFO("Decoded VP8 IDR");
+ if (TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_idr;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+ }
+
+ // copy decoded data
+ ret = 0;
+ while ((img = vpx_codec_get_frame(&vp8->decoder.context, &iter))) {
+ unsigned int plane, y;
+ tsk_size_t xsize;
+
+ // update sizes
+ TMEDIA_CODEC_VIDEO(vp8)->in.width = img->d_w;
+ TMEDIA_CODEC_VIDEO(vp8)->in.height = img->d_h;
+ xsize = (TMEDIA_CODEC_VIDEO(vp8)->in.width * TMEDIA_CODEC_VIDEO(vp8)->in.height * 3) >> 1;
+ // allocate destination buffer
+ if (*out_max_size < xsize) {
+ if (!(*out_data = tsk_realloc(*out_data, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ *out_max_size = 0;
+ goto bail;
+ }
+ *out_max_size = xsize;
+ }
+
+ // layout picture
+ for (plane = 0; plane < 3; plane++) {
+ unsigned char *buf = img->planes[plane];
+ for (y = 0; y < img->d_h >> (plane ? 1 : 0); y++) {
+ unsigned int w_count = img->d_w >> (plane ? 1 : 0);
+ if ((ret + w_count) > *out_max_size) {
+ TSK_DEBUG_ERROR("BufferOverflow");
+ ret = 0;
+ goto bail;
+ }
+ memcpy(((uint8_t*)*out_data) + ret, buf, w_count);
+ ret += w_count;
+ buf += img->stride[plane];
+ }
+ }
+ }
+ }
bail:
- if (fatal_error && TMEDIA_CODEC_VIDEO(self)->in.callback) {
- TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
- TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
- TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
- }
-
- // vp8->decoder.last_PartID = PartID;
- // vp8->decoder.last_S = S;
- // vp8->decoder.last_N = N;
- return ret;
+ if (fatal_error && TMEDIA_CODEC_VIDEO(self)->in.callback) {
+ TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
+ TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
+ TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
+ }
+
+ // vp8->decoder.last_PartID = PartID;
+ // vp8->decoder.last_S = S;
+ // vp8->decoder.last_N = N;
+ return ret;
}
static tsk_bool_t tdav_codec_vp8_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
#if 0
- if(tsk_striequals(att_name, "fmtp")) {
- unsigned width, height, fps;
- if(tmedia_parse_video_fmtp(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &width, &height, &fps)) {
- TSK_DEBUG_ERROR("Failed to match fmtp=%s", att_value);
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = width;
- TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = height;
- TMEDIA_CODEC_VIDEO(codec)->in.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps = fps;
- }
- else
+ if(tsk_striequals(att_name, "fmtp")) {
+ unsigned width, height, fps;
+ if(tmedia_parse_video_fmtp(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &width, &height, &fps)) {
+ TSK_DEBUG_ERROR("Failed to match fmtp=%s", att_value);
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = TMEDIA_CODEC_VIDEO(codec)->out.width = width;
+ TMEDIA_CODEC_VIDEO(codec)->in.height = TMEDIA_CODEC_VIDEO(codec)->out.height = height;
+ TMEDIA_CODEC_VIDEO(codec)->in.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps = fps;
+ }
+ else
#endif
- if (tsk_striequals(att_name, "imageattr")) {
- unsigned in_width, in_height, out_width, out_height;
- if (tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
- return tsk_false;
- }
- TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
- }
-
- return tsk_true;
+ if (tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ if (tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(codec)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ TMEDIA_CODEC_VIDEO(codec)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(codec)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(codec)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(codec)->out.height = out_height;
+ // clamp the output size to the defined max range
+ if (tmedia_defaults_get_adapt_video_size_range_enabled()) {
+ if (tmedia_codec_video_clamp_out_size_to_range_max(TMEDIA_CODEC_VIDEO(codec)) != 0) {
+ return tsk_false;
+ }
+ }
+ }
+
+
+ return tsk_true;
}
static char* tdav_codec_vp8_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
#if 0
- if(tsk_striequals(att_name, "fmtp")) {
- return tmedia_get_video_fmtp(TMEDIA_CODEC_VIDEO(codec)->pref_size);
- }
- else
+ if(tsk_striequals(att_name, "fmtp")) {
+ return tmedia_get_video_fmtp(TMEDIA_CODEC_VIDEO(codec)->pref_size);
+ }
+ else
#endif
- if (tsk_striequals(att_name, "imageattr")) {
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
- TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
- }
- return tsk_null;
+ if (tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(codec)->pref_size,
+ TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height);
+ }
+ return tsk_null;
}
/* ============ VP8 object definition ================= */
@@ -626,62 +633,60 @@ static char* tdav_codec_vp8_sdp_att_get(const tmedia_codec_t* codec, const char*
/* constructor */
static tsk_object_t* tdav_codec_vp8_ctor(tsk_object_t * self, va_list * app)
{
- tdav_codec_vp8_t *vp8 = self;
- if (vp8) {
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tdav_codec_vp8_t *vp8 = self;
+ if (vp8) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_codec_vp8_dtor(tsk_object_t * self)
{
- tdav_codec_vp8_t *vp8 = self;
- TSK_DEBUG_INFO("*** tdav_codec_vp8_dtor destroyed ***");
- if (vp8) {
- /* deinit base */
- tmedia_codec_video_deinit(vp8);
- /* deinit self */
- tdav_codec_vp8_close_encoder(vp8);
- tdav_codec_vp8_close_decoder(vp8);
- }
-
- return self;
+ tdav_codec_vp8_t *vp8 = self;
+ TSK_DEBUG_INFO("*** tdav_codec_vp8_dtor destroyed ***");
+ if (vp8) {
+ /* deinit base */
+ tmedia_codec_video_deinit(vp8);
+ /* deinit self */
+ tdav_codec_vp8_close_encoder(vp8);
+ tdav_codec_vp8_close_decoder(vp8);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_codec_vp8_def_s =
-{
- sizeof(tdav_codec_vp8_t),
- tdav_codec_vp8_ctor,
- tdav_codec_vp8_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tdav_codec_vp8_def_s = {
+ sizeof(tdav_codec_vp8_t),
+ tdav_codec_vp8_ctor,
+ tdav_codec_vp8_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tdav_codec_vp8_plugin_def_s =
-{
- &tdav_codec_vp8_def_s,
-
- tmedia_video,
- tmedia_codec_id_vp8,
- "VP8",
- "VP8 codec (libvpx)",
- TMEDIA_CODEC_FORMAT_VP8,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video (defaul width,height,fps) */
- { 176, 144, 0 }, // fps is @deprecated
-
- tdav_codec_vp8_set,
- tdav_codec_vp8_open,
- tdav_codec_vp8_close,
- tdav_codec_vp8_encode,
- tdav_codec_vp8_decode,
- tdav_codec_vp8_sdp_att_match,
- tdav_codec_vp8_sdp_att_get
+static const tmedia_codec_plugin_def_t tdav_codec_vp8_plugin_def_s = {
+ &tdav_codec_vp8_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_vp8,
+ "VP8",
+ "VP8 codec (libvpx)",
+ TMEDIA_CODEC_FORMAT_VP8,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video (defaul width,height,fps) */
+ { 176, 144, 0 }, // fps is @deprecated
+
+ tdav_codec_vp8_set,
+ tdav_codec_vp8_open,
+ tdav_codec_vp8_close,
+ tdav_codec_vp8_encode,
+ tdav_codec_vp8_decode,
+ tdav_codec_vp8_sdp_att_match,
+ tdav_codec_vp8_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_vp8_plugin_def_t = &tdav_codec_vp8_plugin_def_s;
@@ -689,193 +694,193 @@ const tmedia_codec_plugin_def_t *tdav_codec_vp8_plugin_def_t = &tdav_codec_vp8_p
int tdav_codec_vp8_open_encoder(tdav_codec_vp8_t* self)
{
- vpx_codec_err_t vpx_ret;
- vpx_enc_frame_flags_t enc_flags = 0; // VPX_EFLAG_XXX
-
- if (self->encoder.initialized) {
- TSK_DEBUG_ERROR("VP8 encoder already inialized");
- return -1;
- }
-
- if ((vpx_ret = vpx_codec_enc_config_default(vp8_interface_enc, &self->encoder.cfg, 0)) != VPX_CODEC_OK) {
- TSK_DEBUG_ERROR("vpx_codec_enc_config_default failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- return -2;
- }
- self->encoder.cfg.g_timebase.num = 1;
- self->encoder.cfg.g_timebase.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
- self->encoder.cfg.rc_target_bitrate = TSK_CLAMP(
- 0,
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
- TMEDIA_CODEC(self)->bandwidth_max_upload
- );
- self->encoder.cfg.g_w = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
- self->encoder.cfg.g_h = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
- self->encoder.cfg.kf_mode = VPX_KF_AUTO;
- /*self->encoder.cfg.kf_min_dist =*/ self->encoder.cfg.kf_max_dist = (TDAV_VP8_GOP_SIZE_IN_SECONDS * TMEDIA_CODEC_VIDEO(self)->out.fps);
+ vpx_codec_err_t vpx_ret;
+ vpx_enc_frame_flags_t enc_flags = 0; // VPX_EFLAG_XXX
+
+ if (self->encoder.initialized) {
+ TSK_DEBUG_ERROR("VP8 encoder already inialized");
+ return -1;
+ }
+
+ if ((vpx_ret = vpx_codec_enc_config_default(vp8_interface_enc, &self->encoder.cfg, 0)) != VPX_CODEC_OK) {
+ TSK_DEBUG_ERROR("vpx_codec_enc_config_default failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ return -2;
+ }
+ self->encoder.cfg.g_timebase.num = 1;
+ self->encoder.cfg.g_timebase.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
+ self->encoder.cfg.rc_target_bitrate = TSK_CLAMP(
+ 0,
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
+ TMEDIA_CODEC(self)->bandwidth_max_upload
+ );
+ self->encoder.cfg.g_w = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->encoder.cfg.g_h = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->encoder.cfg.kf_mode = VPX_KF_AUTO;
+ /*self->encoder.cfg.kf_min_dist =*/ self->encoder.cfg.kf_max_dist = (TDAV_VP8_GOP_SIZE_IN_SECONDS * TMEDIA_CODEC_VIDEO(self)->out.fps);
#if defined(VPX_ERROR_RESILIENT_DEFAULT)
- self->encoder.cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;
+ self->encoder.cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;
#else
- self->encoder.cfg.g_error_resilient = 1;
+ self->encoder.cfg.g_error_resilient = 1;
#endif
#if defined(VPX_ERROR_RESILIENT_PARTITIONS)
- self->encoder.cfg.g_error_resilient |= VPX_ERROR_RESILIENT_PARTITIONS;
+ self->encoder.cfg.g_error_resilient |= VPX_ERROR_RESILIENT_PARTITIONS;
#endif
#if defined(VPX_CODEC_USE_OUTPUT_PARTITION)
- enc_flags |= VPX_CODEC_USE_OUTPUT_PARTITION;
+ enc_flags |= VPX_CODEC_USE_OUTPUT_PARTITION;
#endif
- self->encoder.cfg.g_lag_in_frames = 0;
+ self->encoder.cfg.g_lag_in_frames = 0;
#if TDAV_UNDER_WINDOWS
- {
- SYSTEM_INFO SystemInfo;
- GetSystemInfo(&SystemInfo);
- self->encoder.cfg.g_threads = SystemInfo.dwNumberOfProcessors;
- }
+ {
+ SYSTEM_INFO SystemInfo;
+ GetSystemInfo(&SystemInfo);
+ self->encoder.cfg.g_threads = SystemInfo.dwNumberOfProcessors;
+ }
#endif
- self->encoder.cfg.rc_end_usage = VPX_CBR;
- self->encoder.cfg.g_pass = VPX_RC_ONE_PASS;
+ self->encoder.cfg.rc_end_usage = VPX_CBR;
+ self->encoder.cfg.g_pass = VPX_RC_ONE_PASS;
#if 0
- self->encoder.cfg.rc_dropframe_thresh = 30;
- self->encoder.cfg.rc_resize_allowed = 0;
- self->encoder.cfg.rc_min_quantizer = 2;
- self->encoder.cfg.rc_max_quantizer = 56;
- self->encoder.cfg.rc_undershoot_pct = 100;
- self->encoder.cfg.rc_overshoot_pct = 15;
- self->encoder.cfg.rc_buf_initial_sz = 500;
- self->encoder.cfg.rc_buf_optimal_sz = 600;
- self->encoder.cfg.rc_buf_sz = 1000;
+ self->encoder.cfg.rc_dropframe_thresh = 30;
+ self->encoder.cfg.rc_resize_allowed = 0;
+ self->encoder.cfg.rc_min_quantizer = 2;
+ self->encoder.cfg.rc_max_quantizer = 56;
+ self->encoder.cfg.rc_undershoot_pct = 100;
+ self->encoder.cfg.rc_overshoot_pct = 15;
+ self->encoder.cfg.rc_buf_initial_sz = 500;
+ self->encoder.cfg.rc_buf_optimal_sz = 600;
+ self->encoder.cfg.rc_buf_sz = 1000;
#endif
- if ((vpx_ret = vpx_codec_enc_init(&self->encoder.context, vp8_interface_enc, &self->encoder.cfg, enc_flags)) != VPX_CODEC_OK) {
- TSK_DEBUG_ERROR("vpx_codec_enc_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- return -3;
- }
- self->encoder.pic_id = /*(rand() ^ rand()) % 0x7FFF*/0/*Use zero: why do you want to make your life harder?*/;
+ if ((vpx_ret = vpx_codec_enc_init(&self->encoder.context, vp8_interface_enc, &self->encoder.cfg, enc_flags)) != VPX_CODEC_OK) {
+ TSK_DEBUG_ERROR("vpx_codec_enc_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ return -3;
+ }
+ self->encoder.pic_id = /*(rand() ^ rand()) % 0x7FFF*/0/*Use zero: why do you want to make your life harder?*/;
- /* vpx_codec_control(&self->encoder.context, VP8E_SET_STATIC_THRESHOLD, 800); */
+ /* vpx_codec_control(&self->encoder.context, VP8E_SET_STATIC_THRESHOLD, 800); */
#if !TDAV_UNDER_MOBILE /* must not remove: crash on Android for sure and probably on iOS also (all ARM devices ?) */
- vpx_codec_control(&self->encoder.context, VP8E_SET_NOISE_SENSITIVITY, 2);
+ vpx_codec_control(&self->encoder.context, VP8E_SET_NOISE_SENSITIVITY, 2);
#elif TDAV_UNDER_WINDOWS_CE
- vpx_codec_control(&self->encoder.context, VP8E_SET_NOISE_SENSITIVITY, 16);
- vpx_codec_control(&self->encoder.context, VP8E_SET_CPUUSED, 16);
- vpx_codec_control(&self->encoder.context, VP8E_SET_STATIC_THRESHOLD, 16);
- vpx_codec_control(&self->encoder.context, VP8E_SET_SHARPNESS, 16);
+ vpx_codec_control(&self->encoder.context, VP8E_SET_NOISE_SENSITIVITY, 16);
+ vpx_codec_control(&self->encoder.context, VP8E_SET_CPUUSED, 16);
+ vpx_codec_control(&self->encoder.context, VP8E_SET_STATIC_THRESHOLD, 16);
+ vpx_codec_control(&self->encoder.context, VP8E_SET_SHARPNESS, 16);
#endif
- // Set number of partitions
+ // Set number of partitions
#if defined(VPX_CODEC_USE_OUTPUT_PARTITION)
- {
- unsigned _s = TMEDIA_CODEC_VIDEO(self)->out.height * TMEDIA_CODEC_VIDEO(self)->out.width;
- if (_s < (352 * 288)) {
- vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_ONE_TOKENPARTITION);
- }
- else if (_s < (352 * 288) * 2 * 2) {
- vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_TWO_TOKENPARTITION);
- }
- else if (_s < (352 * 288) * 4 * 4) {
- vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_FOUR_TOKENPARTITION);
- }
- else if (_s < (352 * 288) * 8 * 8) {
- vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_EIGHT_TOKENPARTITION);
- }
- }
+ {
+ unsigned _s = TMEDIA_CODEC_VIDEO(self)->out.height * TMEDIA_CODEC_VIDEO(self)->out.width;
+ if (_s < (352 * 288)) {
+ vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_ONE_TOKENPARTITION);
+ }
+ else if (_s < (352 * 288) * 2 * 2) {
+ vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_TWO_TOKENPARTITION);
+ }
+ else if (_s < (352 * 288) * 4 * 4) {
+ vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_FOUR_TOKENPARTITION);
+ }
+ else if (_s < (352 * 288) * 8 * 8) {
+ vpx_codec_control(&self->encoder.context, VP8E_SET_TOKEN_PARTITIONS, VP8_EIGHT_TOKENPARTITION);
+ }
+ }
#endif
- // Create the mutex if not already done
- if (!self->encoder.mutex && !(self->encoder.mutex = tsk_mutex_create())) {
- vpx_codec_destroy(&self->encoder.context);
- TSK_DEBUG_ERROR("Failed to create mutex");
- return -4;
- }
+ // Create the mutex if not already done
+ if (!self->encoder.mutex && !(self->encoder.mutex = tsk_mutex_create())) {
+ vpx_codec_destroy(&self->encoder.context);
+ TSK_DEBUG_ERROR("Failed to create mutex");
+ return -4;
+ }
- self->encoder.frame_count = 0;
+ self->encoder.frame_count = 0;
- self->encoder.initialized = tsk_true;
+ self->encoder.initialized = tsk_true;
- TSK_DEBUG_INFO("[VP8] target_bitrate=%d kbps", self->encoder.cfg.rc_target_bitrate);
+ TSK_DEBUG_INFO("[VP8] target_bitrate=%d kbps", self->encoder.cfg.rc_target_bitrate);
- return 0;
+ return 0;
}
int tdav_codec_vp8_open_decoder(tdav_codec_vp8_t* self)
{
- vpx_codec_err_t vpx_ret;
- vpx_codec_caps_t dec_caps;
- vpx_codec_flags_t dec_flags = 0;
+ vpx_codec_err_t vpx_ret;
+ vpx_codec_caps_t dec_caps;
+ vpx_codec_flags_t dec_flags = 0;
#if !TDAV_UNDER_MOBILE
- static vp8_postproc_cfg_t __pp = { VP8_DEBLOCK | VP8_DEMACROBLOCK, 4, 0 };
+ static vp8_postproc_cfg_t __pp = { VP8_DEBLOCK | VP8_DEMACROBLOCK, 4, 0 };
#endif
- if (self->decoder.initialized) {
- TSK_DEBUG_ERROR("VP8 decoder already initialized");
- return -1;
- }
+ if (self->decoder.initialized) {
+ TSK_DEBUG_ERROR("VP8 decoder already initialized");
+ return -1;
+ }
- self->decoder.cfg.w = TMEDIA_CODEC_VIDEO(self)->out.width;
- self->decoder.cfg.h = TMEDIA_CODEC_VIDEO(self)->out.height;
+ self->decoder.cfg.w = TMEDIA_CODEC_VIDEO(self)->out.width;
+ self->decoder.cfg.h = TMEDIA_CODEC_VIDEO(self)->out.height;
#if TDAV_UNDER_WINDOWS
- {
- SYSTEM_INFO SystemInfo;
- GetSystemInfo(&SystemInfo);
- self->decoder.cfg.threads = SystemInfo.dwNumberOfProcessors;
- }
+ {
+ SYSTEM_INFO SystemInfo;
+ GetSystemInfo(&SystemInfo);
+ self->decoder.cfg.threads = SystemInfo.dwNumberOfProcessors;
+ }
#endif
- dec_caps = vpx_codec_get_caps(&vpx_codec_vp8_dx_algo);
+ dec_caps = vpx_codec_get_caps(&vpx_codec_vp8_dx_algo);
#if !TDAV_UNDER_MOBILE
- if (dec_caps & VPX_CODEC_CAP_POSTPROC) {
- dec_flags |= VPX_CODEC_USE_POSTPROC;
- }
+ if (dec_caps & VPX_CODEC_CAP_POSTPROC) {
+ dec_flags |= VPX_CODEC_USE_POSTPROC;
+ }
#endif
#if defined(VPX_CODEC_CAP_ERROR_CONCEALMENT)
- if (dec_caps & VPX_CODEC_CAP_ERROR_CONCEALMENT) {
- dec_flags |= VPX_CODEC_USE_ERROR_CONCEALMENT;
- }
+ if (dec_caps & VPX_CODEC_CAP_ERROR_CONCEALMENT) {
+ dec_flags |= VPX_CODEC_USE_ERROR_CONCEALMENT;
+ }
#endif
- if ((vpx_ret = vpx_codec_dec_init(&self->decoder.context, vp8_interface_dec, &self->decoder.cfg, dec_flags)) != VPX_CODEC_OK) {
- TSK_DEBUG_ERROR("vpx_codec_dec_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- return -4;
- }
+ if ((vpx_ret = vpx_codec_dec_init(&self->decoder.context, vp8_interface_dec, &self->decoder.cfg, dec_flags)) != VPX_CODEC_OK) {
+ TSK_DEBUG_ERROR("vpx_codec_dec_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ return -4;
+ }
#if !TDAV_UNDER_MOBILE
- if ((vpx_ret = vpx_codec_control(&self->decoder.context, VP8_SET_POSTPROC, &__pp))) {
- TSK_DEBUG_WARN("vpx_codec_dec_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
- }
+ if ((vpx_ret = vpx_codec_control(&self->decoder.context, VP8_SET_POSTPROC, &__pp))) {
+ TSK_DEBUG_WARN("vpx_codec_dec_init failed with error =%s", vpx_codec_err_to_string(vpx_ret));
+ }
#endif
- self->decoder.initialized = tsk_true;
+ self->decoder.initialized = tsk_true;
- return 0;
+ return 0;
}
int tdav_codec_vp8_close_encoder(tdav_codec_vp8_t* self)
{
- TSK_DEBUG_INFO("tdav_codec_vp8_close_encoder(begin)");
- if (self->encoder.initialized) {
- vpx_codec_destroy(&self->encoder.context);
- self->encoder.initialized = tsk_false;
- }
- if (self->encoder.mutex) {
- tsk_mutex_destroy(&self->encoder.mutex);
- }
- TSK_FREE(self->encoder.rtp.ptr);
- self->encoder.rtp.size = 0;
- self->encoder.rotation = 0; // reset rotation
- TSK_DEBUG_INFO("tdav_codec_vp8_close_encoder(end)");
- return 0;
+ TSK_DEBUG_INFO("tdav_codec_vp8_close_encoder(begin)");
+ if (self->encoder.initialized) {
+ vpx_codec_destroy(&self->encoder.context);
+ self->encoder.initialized = tsk_false;
+ }
+ if (self->encoder.mutex) {
+ tsk_mutex_destroy(&self->encoder.mutex);
+ }
+ TSK_FREE(self->encoder.rtp.ptr);
+ self->encoder.rtp.size = 0;
+ self->encoder.rotation = 0; // reset rotation
+ TSK_DEBUG_INFO("tdav_codec_vp8_close_encoder(end)");
+ return 0;
}
int tdav_codec_vp8_close_decoder(tdav_codec_vp8_t* self)
{
- TSK_DEBUG_INFO("tdav_codec_vp8_close_decoder(begin)");
- if (self->decoder.initialized) {
- vpx_codec_destroy(&self->decoder.context);
- self->decoder.initialized = tsk_false;
- }
- TSK_FREE(self->decoder.accumulator);
- self->decoder.accumulator_size = 0;
- self->decoder.accumulator_pos = 0;
- TSK_DEBUG_INFO("tdav_codec_vp8_close_decoder(end)");
-
- return 0;
+ TSK_DEBUG_INFO("tdav_codec_vp8_close_decoder(begin)");
+ if (self->decoder.initialized) {
+ vpx_codec_destroy(&self->decoder.context);
+ self->decoder.initialized = tsk_false;
+ }
+ TSK_FREE(self->decoder.accumulator);
+ self->decoder.accumulator_size = 0;
+ self->decoder.accumulator_pos = 0;
+ TSK_DEBUG_INFO("tdav_codec_vp8_close_decoder(end)");
+
+ return 0;
}
/* ============ VP8 RTP packetizer/depacketizer ================= */
@@ -883,177 +888,177 @@ int tdav_codec_vp8_close_decoder(tdav_codec_vp8_t* self)
static void tdav_codec_vp8_encap(tdav_codec_vp8_t* self, const vpx_codec_cx_pkt_t *pkt)
{
- tsk_bool_t non_ref, is_keyframe, part_start;
- uint8_t *frame_ptr;
- uint32_t part_size, part_ID, pkt_size, index;
+ tsk_bool_t non_ref, is_keyframe, part_start;
+ uint8_t *frame_ptr;
+ uint32_t part_size, part_ID, pkt_size, index;
- if (!self || !pkt || !pkt->data.frame.buf || !pkt->data.frame.sz) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
+ if (!self || !pkt || !pkt->data.frame.buf || !pkt->data.frame.sz) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
- index = 0;
- frame_ptr = pkt->data.frame.buf;
- pkt_size = (uint32_t)pkt->data.frame.sz;
- non_ref = (pkt->data.frame.flags & VPX_FRAME_IS_DROPPABLE);
- is_keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY);
+ index = 0;
+ frame_ptr = pkt->data.frame.buf;
+ pkt_size = (uint32_t)pkt->data.frame.sz;
+ non_ref = (pkt->data.frame.flags & VPX_FRAME_IS_DROPPABLE);
+ is_keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY);
#if defined(VPX_CODEC_USE_OUTPUT_PARTITION)
- part_ID = pkt->data.frame.partition_id;
- part_start = tsk_true;
- part_size = pkt_size;
- while (index < part_size) {
- uint32_t frag_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (part_size - index));
- tdav_codec_vp8_rtp_callback(
- self,
- &frame_ptr[index],
- frag_size,
- part_ID,
- part_start,
- non_ref,
- ((pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT) == 0 && (index + frag_size) == part_size) // RTP marker?
- );
- part_start = tsk_false;
- index += frag_size;
- }
+ part_ID = pkt->data.frame.partition_id;
+ part_start = tsk_true;
+ part_size = pkt_size;
+ while (index < part_size) {
+ uint32_t frag_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (part_size - index));
+ tdav_codec_vp8_rtp_callback(
+ self,
+ &frame_ptr[index],
+ frag_size,
+ part_ID,
+ part_start,
+ non_ref,
+ ((pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT) == 0 && (index + frag_size) == part_size) // RTP marker?
+ );
+ part_start = tsk_false;
+ index += frag_size;
+ }
#else
- // first partition (contains modes and motion vectors)
- part_ID = 0; // The first VP8 partition(containing modes and motion vectors) MUST be labeled with PartID = 0
- part_start = tsk_true;
- part_size = (frame_ptr[2] << 16) | (frame_ptr[1] << 8) | frame_ptr[0];
- part_size = (part_size >> 5) & 0x7FFFF;
- if (part_size > pkt_size) {
- TSK_DEBUG_ERROR("part_size is > pkt_size(%u,%u)", part_size, pkt_size);
- return;
- }
-
- // first,first,....partitions (or fragment if part_size > TDAV_VP8_RTP_PAYLOAD_MAX_SIZE)
- while (index<part_size) {
- uint32_t frag_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (part_size - index));
- tdav_codec_vp8_rtp_callback(self, &frame_ptr[index], frag_size, part_ID, part_start, non_ref, tsk_false);
- part_start = tsk_false;
- index += frag_size;
- }
-
- // second,third,... partitions (or fragment if part_size > TDAV_VP8_RTP_PAYLOAD_MAX_SIZE)
- // FIXME: low FEC
- part_start = tsk_true;
- while (index<pkt_size) {
- if (part_start) {
- /* PartID SHOULD be incremented for each subsequent partition,
- but MAY be kept at 0 for all packets. PartID MUST NOT be larger
- than 8.
- */
- part_ID++;
- }
- part_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (pkt_size - index));
-
- tdav_codec_vp8_rtp_callback(self, &frame_ptr[index], part_size, part_ID, part_start, non_ref, (index + part_size)==pkt_size);
- index += part_size;
- /*
- If more than one packet in an encoded frame contains the
- same PartID, the S bit MUST NOT be set for any other packet than
- the first packet with that PartID.
- */
- part_start = tsk_false;
- }
+ // first partition (contains modes and motion vectors)
+ part_ID = 0; // The first VP8 partition(containing modes and motion vectors) MUST be labeled with PartID = 0
+ part_start = tsk_true;
+ part_size = (frame_ptr[2] << 16) | (frame_ptr[1] << 8) | frame_ptr[0];
+ part_size = (part_size >> 5) & 0x7FFFF;
+ if (part_size > pkt_size) {
+ TSK_DEBUG_ERROR("part_size is > pkt_size(%u,%u)", part_size, pkt_size);
+ return;
+ }
+
+ // first,first,....partitions (or fragment if part_size > TDAV_VP8_RTP_PAYLOAD_MAX_SIZE)
+ while (index<part_size) {
+ uint32_t frag_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (part_size - index));
+ tdav_codec_vp8_rtp_callback(self, &frame_ptr[index], frag_size, part_ID, part_start, non_ref, tsk_false);
+ part_start = tsk_false;
+ index += frag_size;
+ }
+
+ // second,third,... partitions (or fragment if part_size > TDAV_VP8_RTP_PAYLOAD_MAX_SIZE)
+ // FIXME: low FEC
+ part_start = tsk_true;
+ while (index<pkt_size) {
+ if (part_start) {
+ /* PartID SHOULD be incremented for each subsequent partition,
+ but MAY be kept at 0 for all packets. PartID MUST NOT be larger
+ than 8.
+ */
+ part_ID++;
+ }
+ part_size = TSK_MIN(TDAV_VP8_RTP_PAYLOAD_MAX_SIZE, (pkt_size - index));
+
+ tdav_codec_vp8_rtp_callback(self, &frame_ptr[index], part_size, part_ID, part_start, non_ref, (index + part_size)==pkt_size);
+ index += part_size;
+ /*
+ If more than one packet in an encoded frame contains the
+ same PartID, the S bit MUST NOT be set for any other packet than
+ the first packet with that PartID.
+ */
+ part_start = tsk_false;
+ }
#endif /* VPX_CODEC_USE_OUTPUT_PARTITION */
}
static void tdav_codec_vp8_rtp_callback(tdav_codec_vp8_t *self, const void *data, tsk_size_t size, uint32_t partID, tsk_bool_t part_start, tsk_bool_t non_ref, tsk_bool_t last)
{
- tsk_size_t paydesc_and_hdr_size = TDAV_VP8_PAY_DESC_SIZE;
- tsk_bool_t has_hdr;
- /* draft-ietf-payload-vp8-04 - 4.2. VP8 Payload Descriptor
- 0 1 2 3 4 5 6 7
- +-+-+-+-+-+-+-+-+
- |X|R|N|S|PartID | (REQUIRED)
- +-+-+-+-+-+-+-+-+
- X: |I|L|T|K| RSV | (OPTIONAL)
- +-+-+-+-+-+-+-+-+
- I: |M| PictureID | (OPTIONAL)
- +-+-+-+-+-+-+-+-+
- L: | TL0PICIDX | (OPTIONAL)
- +-+-+-+-+-+-+-+-+
- T/K: |TID|Y| KEYIDX | (OPTIONAL)
- +-+-+-+-+-+-+-+-+
-
- draft-ietf-payload-vp8-04 - 4.3. VP8 Payload Header
- 0 1 2 3 4 5 6 7
- +-+-+-+-+-+-+-+-+
- |Size0|H| VER |P|
- +-+-+-+-+-+-+-+-+
- | Size1 |
- +-+-+-+-+-+-+-+-+
- | Size2 |
- +-+-+-+-+-+-+-+-+
- | Bytes 4..N of |
- | VP8 payload |
- : :
- +-+-+-+-+-+-+-+-+
- | OPTIONAL RTP |
- | padding |
- : :
- +-+-+-+-+-+-+-+-+
- */
-
- /*
- Note that the header is present only in packets which have the S bit equal to one and the
- PartID equal to zero in the payload descriptor.
- */
- if ((has_hdr = (part_start && partID == 0))) {
- has_hdr = tsk_true;
- paydesc_and_hdr_size += 0; // encoded data already contains payload header?
- }
-
- if (!data || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
- if (self->encoder.rtp.size < (size + paydesc_and_hdr_size)) {
- if (!(self->encoder.rtp.ptr = tsk_realloc(self->encoder.rtp.ptr, (size + paydesc_and_hdr_size)))) {
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- return;
- }
- self->encoder.rtp.size = (size + paydesc_and_hdr_size);
- }
- memcpy((self->encoder.rtp.ptr + paydesc_and_hdr_size), data, size);
-
- /* VP8 Payload Descriptor */
- // |X|R|N|S|PartID|
- self->encoder.rtp.ptr[0] = (partID & 0x0F) // PartID
- | ((part_start << 4) & 0x10)// S
- | ((non_ref << 5) & 0x20) // N
- // R = 0
+ tsk_size_t paydesc_and_hdr_size = TDAV_VP8_PAY_DESC_SIZE;
+ tsk_bool_t has_hdr;
+ /* draft-ietf-payload-vp8-04 - 4.2. VP8 Payload Descriptor
+ 0 1 2 3 4 5 6 7
+ +-+-+-+-+-+-+-+-+
+ |X|R|N|S|PartID | (REQUIRED)
+ +-+-+-+-+-+-+-+-+
+ X: |I|L|T|K| RSV | (OPTIONAL)
+ +-+-+-+-+-+-+-+-+
+ I: |M| PictureID | (OPTIONAL)
+ +-+-+-+-+-+-+-+-+
+ L: | TL0PICIDX | (OPTIONAL)
+ +-+-+-+-+-+-+-+-+
+ T/K: |TID|Y| KEYIDX | (OPTIONAL)
+ +-+-+-+-+-+-+-+-+
+
+ draft-ietf-payload-vp8-04 - 4.3. VP8 Payload Header
+ 0 1 2 3 4 5 6 7
+ +-+-+-+-+-+-+-+-+
+ |Size0|H| VER |P|
+ +-+-+-+-+-+-+-+-+
+ | Size1 |
+ +-+-+-+-+-+-+-+-+
+ | Size2 |
+ +-+-+-+-+-+-+-+-+
+ | Bytes 4..N of |
+ | VP8 payload |
+ : :
+ +-+-+-+-+-+-+-+-+
+ | OPTIONAL RTP |
+ | padding |
+ : :
+ +-+-+-+-+-+-+-+-+
+ */
+
+ /*
+ Note that the header is present only in packets which have the S bit equal to one and the
+ PartID equal to zero in the payload descriptor.
+ */
+ if ((has_hdr = (part_start && partID == 0))) {
+ has_hdr = tsk_true;
+ paydesc_and_hdr_size += 0; // encoded data already contains payload header?
+ }
+
+ if (!data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+ if (self->encoder.rtp.size < (size + paydesc_and_hdr_size)) {
+ if (!(self->encoder.rtp.ptr = tsk_realloc(self->encoder.rtp.ptr, (size + paydesc_and_hdr_size)))) {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ return;
+ }
+ self->encoder.rtp.size = (size + paydesc_and_hdr_size);
+ }
+ memcpy((self->encoder.rtp.ptr + paydesc_and_hdr_size), data, size);
+
+ /* VP8 Payload Descriptor */
+ // |X|R|N|S|PartID|
+ self->encoder.rtp.ptr[0] = (partID & 0x0F) // PartID
+ | ((part_start << 4) & 0x10)// S
+ | ((non_ref << 5) & 0x20) // N
+ // R = 0
#if TDAV_VP8_DISABLE_EXTENSION
- | (0x00) // X=0
+ | (0x00) // X=0
#else
- | (0x80) // X=1
+ | (0x80) // X=1
#endif
- ;
+ ;
#if !TDAV_VP8_DISABLE_EXTENSION
- // X: |I|L|T|K| RSV |
- self->encoder.rtp.ptr[1] = 0x80; // I = 1, L = 0, T = 0, K = 0, RSV = 0
- // I: |M| PictureID |
- self->encoder.rtp.ptr[2] = (0x80 | ((self->encoder.pic_id >> 8) & 0x7F)); // M = 1 (PictureID on 15 bits)
- self->encoder.rtp.ptr[3] = (self->encoder.pic_id & 0xFF);
+ // X: |I|L|T|K| RSV |
+ self->encoder.rtp.ptr[1] = 0x80; // I = 1, L = 0, T = 0, K = 0, RSV = 0
+ // I: |M| PictureID |
+ self->encoder.rtp.ptr[2] = (0x80 | ((self->encoder.pic_id >> 8) & 0x7F)); // M = 1 (PictureID on 15 bits)
+ self->encoder.rtp.ptr[3] = (self->encoder.pic_id & 0xFF);
#endif
- /* 4.2. VP8 Payload Header */
- //if(has_hdr) {
- // already part of the encoded stream
- //}
-
- // Send data over the network
- if (TMEDIA_CODEC_VIDEO(self)->out.callback) {
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->encoder.rtp.ptr;
- TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (size + TDAV_VP8_PAY_DESC_SIZE);
- TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1. / (double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
- TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = last;
- TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
- }
+ /* 4.2. VP8 Payload Header */
+ //if(has_hdr) {
+ // already part of the encoded stream
+ //}
+
+ // Send data over the network
+ if (TMEDIA_CODEC_VIDEO(self)->out.callback) {
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.ptr = self->encoder.rtp.ptr;
+ TMEDIA_CODEC_VIDEO(self)->out.result.buffer.size = (size + TDAV_VP8_PAY_DESC_SIZE);
+ TMEDIA_CODEC_VIDEO(self)->out.result.duration = (uint32_t)((1. / (double)TMEDIA_CODEC_VIDEO(self)->out.fps) * TMEDIA_CODEC(self)->plugin->rate);
+ TMEDIA_CODEC_VIDEO(self)->out.result.last_chunck = last;
+ TMEDIA_CODEC_VIDEO(self)->out.callback(&TMEDIA_CODEC_VIDEO(self)->out.result);
+ }
}
#endif /* HAVE_LIBVPX */
diff --git a/tinyDAV/src/msrp/tdav_session_msrp.c b/tinyDAV/src/msrp/tdav_session_msrp.c
index 325dfe3..950fa25 100755
--- a/tinyDAV/src/msrp/tdav_session_msrp.c
+++ b/tinyDAV/src/msrp/tdav_session_msrp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,29 +47,29 @@ static void send_bodiless(tdav_session_msrp_t *msrp);
int tdav_msrp_event_proxy_cb(tmsrp_event_t* _event/*!Not the owner of the object*/)
{
- tdav_session_msrp_t* msrp;
- int ret = 0;
-
- if(!_event || !_event->callback_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- msrp = tsk_object_ref((void*)_event->callback_data);
- if(TMEDIA_SESSION_MSRP(msrp)->callback.func){
- _event->callback_data = TMEDIA_SESSION_MSRP(msrp)->callback.data; // steal callback data
- ret = TMEDIA_SESSION_MSRP(msrp)->callback.func(_event); // call callback function()
- }
- tsk_object_unref(msrp);
-
- return ret;
+ tdav_session_msrp_t* msrp;
+ int ret = 0;
+
+ if(!_event || !_event->callback_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ msrp = tsk_object_ref((void*)_event->callback_data);
+ if(TMEDIA_SESSION_MSRP(msrp)->callback.func) {
+ _event->callback_data = TMEDIA_SESSION_MSRP(msrp)->callback.data; // steal callback data
+ ret = TMEDIA_SESSION_MSRP(msrp)->callback.func(_event); // call callback function()
+ }
+ tsk_object_unref(msrp);
+
+ return ret;
}
int tdav_transport_layer_stream_cb(const tnet_transport_event_t* e)
{
- const tdav_session_msrp_t *session = e->callback_data;
- tmsrp_receiver_t* receiver;
- int ret = -1;
+ const tdav_session_msrp_t *session = e->callback_data;
+ tmsrp_receiver_t* receiver;
+ int ret = -1;
#define TMSRP_ALERT_USER(type) \
{ \
@@ -80,813 +80,817 @@ int tdav_transport_layer_stream_cb(const tnet_transport_event_t* e)
tsk_object_unref(msrp); \
}
- switch(e->type){
- case event_data: {
- break;
- }
- case event_accepted:
- if(!session->connectedFD){
- tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
- /* We are passive ==> update connection info */
- msrp->connectedFD = e->local_fd;
- tmsrp_sender_set_fd(msrp->sender, msrp->connectedFD);
- tmsrp_receiver_set_fd(msrp->receiver, msrp->connectedFD);
- msrp->fresh_conn = tsk_true;
- /* Send Bodiless request */
- if(msrp->send_bodiless){
- send_bodiless(msrp);
- msrp->send_bodiless = tsk_false;
- }
- /* Alert user */
- TMSRP_ALERT_USER(tmsrp_event_type_connected);
-
- tsk_object_unref(msrp);
- }
- break;
- case event_closed:
- if(e->local_fd == session->connectedFD){
- TSK_DEBUG_INFO("MSRP Socket closed");
- TMSRP_ALERT_USER(tmsrp_event_type_disconnected);
- }
- return 0;
-
- case event_connected:
- {
- tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
- if(e->local_fd == msrp->connectedFD){
- msrp->fresh_conn = tsk_true;
- /* Send Bodiless request */
- if(msrp->send_bodiless){
- send_bodiless(msrp);
- msrp->send_bodiless = tsk_false;
- }
- /* Alert user */
- TMSRP_ALERT_USER(tmsrp_event_type_connected);
- }
- tsk_object_unref(msrp);
- }
- break;
- default:{
- return 0;
- }
- }
-
- if(e->data && (receiver = tsk_object_ref((void*)session->receiver))){
- ret = tmsrp_receiver_recv(receiver, e->data, e->size);
- tsk_object_unref(receiver);
- }
-
- if(session->fresh_conn){
- tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
- /* send pending file - and data?*/
- if(session->offerer){
- send_pending_file(msrp);
- }
- msrp->fresh_conn = tsk_false;
- tsk_object_unref(msrp);
- }
-
- return ret;
+ switch(e->type) {
+ case event_data: {
+ break;
+ }
+ case event_accepted:
+ if(!session->connectedFD) {
+ tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
+ /* We are passive ==> update connection info */
+ msrp->connectedFD = e->local_fd;
+ tmsrp_sender_set_fd(msrp->sender, msrp->connectedFD);
+ tmsrp_receiver_set_fd(msrp->receiver, msrp->connectedFD);
+ msrp->fresh_conn = tsk_true;
+ /* Send Bodiless request */
+ if(msrp->send_bodiless) {
+ send_bodiless(msrp);
+ msrp->send_bodiless = tsk_false;
+ }
+ /* Alert user */
+ TMSRP_ALERT_USER(tmsrp_event_type_connected);
+
+ tsk_object_unref(msrp);
+ }
+ break;
+ case event_closed:
+ if(e->local_fd == session->connectedFD) {
+ TSK_DEBUG_INFO("MSRP Socket closed");
+ TMSRP_ALERT_USER(tmsrp_event_type_disconnected);
+ }
+ return 0;
+
+ case event_connected: {
+ tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
+ if(e->local_fd == msrp->connectedFD) {
+ msrp->fresh_conn = tsk_true;
+ /* Send Bodiless request */
+ if(msrp->send_bodiless) {
+ send_bodiless(msrp);
+ msrp->send_bodiless = tsk_false;
+ }
+ /* Alert user */
+ TMSRP_ALERT_USER(tmsrp_event_type_connected);
+ }
+ tsk_object_unref(msrp);
+ }
+ break;
+ default: {
+ return 0;
+ }
+ }
+
+ if(e->data && (receiver = tsk_object_ref((void*)session->receiver))) {
+ ret = tmsrp_receiver_recv(receiver, e->data, e->size);
+ tsk_object_unref(receiver);
+ }
+
+ if(session->fresh_conn) {
+ tdav_session_msrp_t *msrp = tsk_object_ref((void*)session);
+ /* send pending file - and data?*/
+ if(session->offerer) {
+ send_pending_file(msrp);
+ }
+ msrp->fresh_conn = tsk_false;
+ tsk_object_unref(msrp);
+ }
+
+ return ret;
}
-static void send_pending_file(tdav_session_msrp_t *msrp){
- if(msrp && msrp->file.path && !msrp->file.sent){
- msrp->file.sent = tsk_true;
- tsmrp_sender_send_file(msrp->sender, msrp->file.path);
- }
+static void send_pending_file(tdav_session_msrp_t *msrp)
+{
+ if(msrp && msrp->file.path && !msrp->file.sent) {
+ msrp->file.sent = tsk_true;
+ tsmrp_sender_send_file(msrp->sender, msrp->file.path);
+ }
}
-static void send_bodiless(tdav_session_msrp_t *msrp){
- tmsrp_request_t* BODILESS;
- if(msrp->config->To_Path && msrp->config->From_Path){
- if((BODILESS = tmsrp_create_bodiless(msrp->config->To_Path->uri, msrp->config->From_Path->uri))){
- char* str;
- if((str = tmsrp_message_tostring(BODILESS))){
- if(!tnet_sockfd_send(msrp->connectedFD, str, tsk_strlen(str), 0)){
- TSK_DEBUG_WARN("Failed to send bodiless request.");
- }
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(BODILESS);
- }
- }
+static void send_bodiless(tdav_session_msrp_t *msrp)
+{
+ tmsrp_request_t* BODILESS;
+ if(msrp->config->To_Path && msrp->config->From_Path) {
+ if((BODILESS = tmsrp_create_bodiless(msrp->config->To_Path->uri, msrp->config->From_Path->uri))) {
+ char* str;
+ if((str = tmsrp_message_tostring(BODILESS))) {
+ if(!tnet_sockfd_send(msrp->connectedFD, str, tsk_strlen(str), 0)) {
+ TSK_DEBUG_WARN("Failed to send bodiless request.");
+ }
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(BODILESS);
+ }
+ }
}
static tdav_msrp_setup_t setup_from_string(const char* setup)
{
- tdav_msrp_setup_t ret = msrp_setup_active;
-
- if(setup){
- if(tsk_strequals(setup, "holdconn")){
- ret = msrp_setup_holdconn;
- }
- else if(tsk_strequals(setup, "passive")){
- ret = msrp_setup_passive;
- }
- else if(tsk_strequals(setup, "actpass")){
- ret = msrp_setup_actpass;
- }
- else{
- ret = msrp_setup_active;
- }
- }
- return ret;
+ tdav_msrp_setup_t ret = msrp_setup_active;
+
+ if(setup) {
+ if(tsk_strequals(setup, "holdconn")) {
+ ret = msrp_setup_holdconn;
+ }
+ else if(tsk_strequals(setup, "passive")) {
+ ret = msrp_setup_passive;
+ }
+ else if(tsk_strequals(setup, "actpass")) {
+ ret = msrp_setup_actpass;
+ }
+ else {
+ ret = msrp_setup_active;
+ }
+ }
+ return ret;
}
static const char* setup_to_string(tdav_msrp_setup_t setup)
{
- switch(setup){
- case msrp_setup_active:
- return "active";
- case msrp_setup_passive:
- return "passive";
- case msrp_setup_actpass:
- return "actpass";
- case msrp_setup_holdconn:
- return "holdconn";
- }
- return "active";
+ switch(setup) {
+ case msrp_setup_active:
+ return "active";
+ case msrp_setup_passive:
+ return "passive";
+ case msrp_setup_actpass:
+ return "actpass";
+ case msrp_setup_holdconn:
+ return "holdconn";
+ }
+ return "active";
}
static int init_neg_types(tdav_session_msrp_t* msrp, const tsdp_header_M_t* m)
{
- const tsdp_header_A_t* A;
-
- if((A = tsdp_header_M_findA(m, "accept-types"))){
- char *saveptr;
- char* atype = tsk_strtok_r((char*)A->value, " ", &saveptr);
- const char* default_atype = atype;
- while(atype){
- if(tsk_striequals(atype, "message/CPIM")){
- tsk_strupdate(&msrp->neg_accept_type, atype);
- if((A = tsdp_header_M_findA(m, "accept-wrapped-types"))){
- char* awtype = tsk_strtok_r((char*)A->value, " ", &saveptr);
- tsk_strupdate(&msrp->neg_accept_w_type, awtype); // first
- }
- break;
- }
- atype = tsk_strtok_r(tsk_null, " ", &saveptr);
- }
-
- if(!msrp->neg_accept_type){
- tsk_strupdate(&msrp->neg_accept_type, default_atype);
- }
-
- return 0;
- }
- return -1;
+ const tsdp_header_A_t* A;
+
+ if((A = tsdp_header_M_findA(m, "accept-types"))) {
+ char *saveptr;
+ char* atype = tsk_strtok_r((char*)A->value, " ", &saveptr);
+ const char* default_atype = atype;
+ while(atype) {
+ if(tsk_striequals(atype, "message/CPIM")) {
+ tsk_strupdate(&msrp->neg_accept_type, atype);
+ if((A = tsdp_header_M_findA(m, "accept-wrapped-types"))) {
+ char* awtype = tsk_strtok_r((char*)A->value, " ", &saveptr);
+ tsk_strupdate(&msrp->neg_accept_w_type, awtype); // first
+ }
+ break;
+ }
+ atype = tsk_strtok_r(tsk_null, " ", &saveptr);
+ }
+
+ if(!msrp->neg_accept_type) {
+ tsk_strupdate(&msrp->neg_accept_type, default_atype);
+ }
+
+ return 0;
+ }
+ return -1;
}
static int populate_lo(tdav_session_msrp_t* self, tsk_bool_t initial)
{
- if(!self || !TMEDIA_SESSION(self)->M.lo){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(initial){
- const char* att_dir = tsk_null;
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("setup", setup_to_string(self->setup)),
-
- tsk_null
- );
-
- if(self->accept_types || self->neg_accept_type){
- /* a=accept-types:message/CPIM application/octet-stream */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("accept-types", self->accept_types ? self->accept_types : self->neg_accept_type),
- tsk_null);
- }
- if(self->accept_w_types || self->neg_accept_w_type){
- /* a=accept-wrapped-types:application/octet-stream */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("accept-wrapped-types", self->accept_w_types ? self->accept_w_types : self->neg_accept_w_type),
- tsk_null);
- }
-
- /* direction */
- switch(self->dir){
- case tdav_msrp_dir_sendonly: att_dir = "sendonly"; break;
- case tdav_msrp_dir_recvonly: att_dir = "recvonly"; break;
- case tdav_msrp_dir_sendrecv:
- case tdav_msrp_dir_none:
- {
- att_dir = "sendrecv";
- break;
- }
- }
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS(att_dir, tsk_null),
- tsk_null);
-
- /*=== File Transfer ===*/
- if(self->file.path){
- /* Compute default 'file-selector' */
- if(!self->file.selector && !TMEDIA_SESSION(self)->M.ro){
- int index = tsk_strLastIndexOf(self->file.path, tsk_strlen(self->file.path), "\\");
- if(index == -1){
- index = tsk_strLastIndexOf(self->file.path, tsk_strlen(self->file.path), "/");
- }
- index++;
- tsk_sprintf(&self->file.selector, "name:\"%s\" type:application/octet-stream", (self->file.path + index));
- }
- /* Compute default 'file-transfer-id' */
- if(!self->file.transfer_id && !TMEDIA_SESSION(self)->M.ro){
- tsk_istr_t rand_string;
- tsk_strrandom(&rand_string);
- self->file.transfer_id = tsk_strdup(rand_string);
- }
- }
-
- if(self->file.selector){
- /* a=file-selector:name:"test.pcap" type:application/octet-stream size:11376 hash:sha-1:8D:55:24:2B:F4:F9:9B:A2:54:A3:5B:91:00:15:9E:A3:D4:48:D7:DF */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("file-selector", self->file.selector),
- tsk_null);
- }
- if(self->file.transfer_id){
- /* a=file-transfer-id:vscxggbwkfnqduxwfnfozvsrtkjprepg */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("file-transfer-id", self->file.transfer_id),
- tsk_null);
- }
- if(self->file.disposition){
- /* a=file-disposition:attachment */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("file-disposition", self->file.disposition),
- tsk_null);
- }
- if(self->file.date){
- /* a=file-date:creation:2010-02-13T17:50:31.763Z */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("file-date", self->file.date),
- tsk_null);
- }
- if(self->file.icon){
- /* a=file-icon:cid:test@doubango.org */
- tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- TSDP_HEADER_A_VA_ARGS("file-icon", self->file.icon),
- tsk_null);
- }
- }
-
- return 0;
+ if(!self || !TMEDIA_SESSION(self)->M.lo) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(initial) {
+ const char* att_dir = tsk_null;
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("setup", setup_to_string(self->setup)),
+
+ tsk_null
+ );
+
+ if(self->accept_types || self->neg_accept_type) {
+ /* a=accept-types:message/CPIM application/octet-stream */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("accept-types", self->accept_types ? self->accept_types : self->neg_accept_type),
+ tsk_null);
+ }
+ if(self->accept_w_types || self->neg_accept_w_type) {
+ /* a=accept-wrapped-types:application/octet-stream */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("accept-wrapped-types", self->accept_w_types ? self->accept_w_types : self->neg_accept_w_type),
+ tsk_null);
+ }
+
+ /* direction */
+ switch(self->dir) {
+ case tdav_msrp_dir_sendonly:
+ att_dir = "sendonly";
+ break;
+ case tdav_msrp_dir_recvonly:
+ att_dir = "recvonly";
+ break;
+ case tdav_msrp_dir_sendrecv:
+ case tdav_msrp_dir_none: {
+ att_dir = "sendrecv";
+ break;
+ }
+ }
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS(att_dir, tsk_null),
+ tsk_null);
+
+ /*=== File Transfer ===*/
+ if(self->file.path) {
+ /* Compute default 'file-selector' */
+ if(!self->file.selector && !TMEDIA_SESSION(self)->M.ro) {
+ int index = tsk_strLastIndexOf(self->file.path, tsk_strlen(self->file.path), "\\");
+ if(index == -1) {
+ index = tsk_strLastIndexOf(self->file.path, tsk_strlen(self->file.path), "/");
+ }
+ index++;
+ tsk_sprintf(&self->file.selector, "name:\"%s\" type:application/octet-stream", (self->file.path + index));
+ }
+ /* Compute default 'file-transfer-id' */
+ if(!self->file.transfer_id && !TMEDIA_SESSION(self)->M.ro) {
+ tsk_istr_t rand_string;
+ tsk_strrandom(&rand_string);
+ self->file.transfer_id = tsk_strdup(rand_string);
+ }
+ }
+
+ if(self->file.selector) {
+ /* a=file-selector:name:"test.pcap" type:application/octet-stream size:11376 hash:sha-1:8D:55:24:2B:F4:F9:9B:A2:54:A3:5B:91:00:15:9E:A3:D4:48:D7:DF */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("file-selector", self->file.selector),
+ tsk_null);
+ }
+ if(self->file.transfer_id) {
+ /* a=file-transfer-id:vscxggbwkfnqduxwfnfozvsrtkjprepg */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("file-transfer-id", self->file.transfer_id),
+ tsk_null);
+ }
+ if(self->file.disposition) {
+ /* a=file-disposition:attachment */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("file-disposition", self->file.disposition),
+ tsk_null);
+ }
+ if(self->file.date) {
+ /* a=file-date:creation:2010-02-13T17:50:31.763Z */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("file-date", self->file.date),
+ tsk_null);
+ }
+ if(self->file.icon) {
+ /* a=file-icon:cid:test@doubango.org */
+ tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ TSDP_HEADER_A_VA_ARGS("file-icon", self->file.icon),
+ tsk_null);
+ }
+ }
+
+ return 0;
}
static tsk_bool_t match_offer(const tdav_session_msrp_t* self, const tsdp_header_M_t* M)
{
- return tsk_true;
+ return tsk_true;
}
/* ============ Plugin interface ================= */
int tdav_session_msrp_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_session_msrp_t* msrp;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TSK_DEBUG_INFO("tdav_session_msrp_set");
-
- msrp = (tdav_session_msrp_t*)self;
-
- if(param->value_type == tmedia_pvt_pchar){
- if(tsk_striequals(param->key, "remote-ip")){
- // only if no ip associated to the "m=" line
- if(param->value && !msrp->remote_ip){
- msrp->remote_ip = tsk_strdup(param->value);
- }
- }
- else if(tsk_striequals(param->key, "local-ip")){
- tsk_strupdate(&msrp->local_ip, param->value);
- }
- else if(tsk_striequals(param->key, "local-ipver")){
- msrp->useIPv6 = tsk_striequals(param->value, "ipv6");
- }
- else if(tsk_striequals(param->key, "accept-types")){
- tsk_strupdate(&msrp->accept_types, param->value);
- }
- else if(tsk_striequals(param->key, "accept-wrapped-types")){
- tsk_strupdate(&msrp->accept_w_types, param->value);
- }
-
- /* Configuration */
- else if(tsk_striequals(param->key, "Failure-Report")){
- msrp->config->Failure_Report = tsk_striequals(param->value, "yes");
- }
- else if(tsk_striequals(param->key, "Success-Report")){
- msrp->config->Success_Report = tsk_striequals(param->value, "yes");
- }
-
- /* File Transfer */
- else if(tsk_striequals(param->key, "file-path") && !tsk_strnullORempty((const char*)param->value)){
- tsk_strupdate(&msrp->file.path, param->value);
- }
- else if(tsk_striequals(param->key, "file-selector")){
- tsk_strupdate(&msrp->file.selector, param->value);
- }
- else if(tsk_striequals(param->key, "file-disposition")){
- tsk_strupdate(&msrp->file.disposition, param->value);
- }
- else if(tsk_striequals(param->key, "file-date")){
- tsk_strupdate(&msrp->file.date, param->value);
- }
- else if(tsk_striequals(param->key, "file-icon")){
- tsk_strupdate(&msrp->file.icon, param->value);
- }
- else if(tsk_striequals(param->key, "file-transfer-id")){
- tsk_strupdate(&msrp->file.transfer_id, param->value);
- }
- }
- else if(param->value_type == tmedia_pvt_pobject){
- if(tsk_striequals(param->key, "natt-ctx")){
- TSK_OBJECT_SAFE_FREE(msrp->natt_ctx);
- msrp->natt_ctx = tsk_object_ref(param->value);
- }
- }
- else if(param->value_type == tmedia_pvt_int64 || param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "chunck-duration")){
- msrp->chunck_duration = TSK_TO_UINT32((uint8_t*)param->value);
- if(msrp->sender){
- msrp->sender->chunck_duration = msrp->chunck_duration;
- }
- }
- }
-
- return ret;
+ int ret = 0;
+ tdav_session_msrp_t* msrp;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("tdav_session_msrp_set");
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ if(param->value_type == tmedia_pvt_pchar) {
+ if(tsk_striequals(param->key, "remote-ip")) {
+ // only if no ip associated to the "m=" line
+ if(param->value && !msrp->remote_ip) {
+ msrp->remote_ip = tsk_strdup(param->value);
+ }
+ }
+ else if(tsk_striequals(param->key, "local-ip")) {
+ tsk_strupdate(&msrp->local_ip, param->value);
+ }
+ else if(tsk_striequals(param->key, "local-ipver")) {
+ msrp->useIPv6 = tsk_striequals(param->value, "ipv6");
+ }
+ else if(tsk_striequals(param->key, "accept-types")) {
+ tsk_strupdate(&msrp->accept_types, param->value);
+ }
+ else if(tsk_striequals(param->key, "accept-wrapped-types")) {
+ tsk_strupdate(&msrp->accept_w_types, param->value);
+ }
+
+ /* Configuration */
+ else if(tsk_striequals(param->key, "Failure-Report")) {
+ msrp->config->Failure_Report = tsk_striequals(param->value, "yes");
+ }
+ else if(tsk_striequals(param->key, "Success-Report")) {
+ msrp->config->Success_Report = tsk_striequals(param->value, "yes");
+ }
+
+ /* File Transfer */
+ else if(tsk_striequals(param->key, "file-path") && !tsk_strnullORempty((const char*)param->value)) {
+ tsk_strupdate(&msrp->file.path, param->value);
+ }
+ else if(tsk_striequals(param->key, "file-selector")) {
+ tsk_strupdate(&msrp->file.selector, param->value);
+ }
+ else if(tsk_striequals(param->key, "file-disposition")) {
+ tsk_strupdate(&msrp->file.disposition, param->value);
+ }
+ else if(tsk_striequals(param->key, "file-date")) {
+ tsk_strupdate(&msrp->file.date, param->value);
+ }
+ else if(tsk_striequals(param->key, "file-icon")) {
+ tsk_strupdate(&msrp->file.icon, param->value);
+ }
+ else if(tsk_striequals(param->key, "file-transfer-id")) {
+ tsk_strupdate(&msrp->file.transfer_id, param->value);
+ }
+ }
+ else if(param->value_type == tmedia_pvt_pobject) {
+ if(tsk_striequals(param->key, "natt-ctx")) {
+ TSK_OBJECT_SAFE_FREE(msrp->natt_ctx);
+ msrp->natt_ctx = tsk_object_ref(param->value);
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int64 || param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "chunck-duration")) {
+ msrp->chunck_duration = TSK_TO_UINT32((uint8_t*)param->value);
+ if(msrp->sender) {
+ msrp->sender->chunck_duration = msrp->chunck_duration;
+ }
+ }
+ }
+
+ return ret;
}
int tdav_session_msrp_get(tmedia_session_t* self, tmedia_param_t* param)
{
- return -1;
+ return -1;
}
int tdav_session_msrp_prepare(tmedia_session_t* self)
{
- tdav_session_msrp_t* msrp;
- tnet_socket_type_t socket_type = tnet_socket_type_tcp_ipv4;
- int ret = 0;
+ tdav_session_msrp_t* msrp;
+ tnet_socket_type_t socket_type = tnet_socket_type_tcp_ipv4;
+ int ret = 0;
#if 1
- tnet_port_t local_port = TNET_SOCKET_PORT_ANY;
+ tnet_port_t local_port = TNET_SOCKET_PORT_ANY;
#else
- tnet_port_t local_port = 2000;
+ tnet_port_t local_port = 2000;
#endif
- TSK_DEBUG_INFO("tdav_session_msrp_prepare");
-
- msrp = (tdav_session_msrp_t*)self;
-
- /* set local port */
- if(!msrp->transport){
- if(msrp->useIPv6){
- TNET_SOCKET_TYPE_SET_IPV6Only(socket_type);
- }
-
- if(!msrp->local_ip){
- tnet_host_t local;
- tnet_gethostname(&local);
- msrp->transport = tnet_transport_create(local, local_port, socket_type, "MSRP/MSRPS transport");
- }
- else{
- msrp->transport = tnet_transport_create(msrp->local_ip, local_port, socket_type, "MSRP/MSRPS transport");
- }
- /* Set NAT context */
- if(msrp->natt_ctx){
- tnet_transport_set_natt_ctx(msrp->transport, msrp->natt_ctx);
- }
- }
-
- /* sender will be prepared in tdav_session_msrp_start() */
- /* receiver will be prepared in tdav_session_msrp_start() */
-
- return ret;
+ TSK_DEBUG_INFO("tdav_session_msrp_prepare");
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ /* set local port */
+ if(!msrp->transport) {
+ if(msrp->useIPv6) {
+ TNET_SOCKET_TYPE_SET_IPV6Only(socket_type);
+ }
+
+ if(!msrp->local_ip) {
+ tnet_host_t local;
+ tnet_gethostname(&local);
+ msrp->transport = tnet_transport_create(local, local_port, socket_type, "MSRP/MSRPS transport");
+ }
+ else {
+ msrp->transport = tnet_transport_create(msrp->local_ip, local_port, socket_type, "MSRP/MSRPS transport");
+ }
+ /* Set NAT context */
+ if(msrp->natt_ctx) {
+ tnet_transport_set_natt_ctx(msrp->transport, msrp->natt_ctx);
+ }
+ }
+
+ /* sender will be prepared in tdav_session_msrp_start() */
+ /* receiver will be prepared in tdav_session_msrp_start() */
+
+ return ret;
}
int tdav_session_msrp_start(tmedia_session_t* self)
{
- tdav_session_msrp_t* msrp;
- int ret;
-
- TSK_DEBUG_INFO("tdav_session_msrp_start");
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- msrp = (tdav_session_msrp_t*)self;
-
- /* start the transport */
- if((ret = tnet_transport_start(msrp->transport))){
- goto bail;
- }
-
- switch(msrp->setup){
- case msrp_setup_active:
- case msrp_setup_actpass:
- {
- //
- // ACTIVE
- //
- TSK_DEBUG_INFO("connectto(%s:%d)", msrp->remote_ip, msrp->remote_port);
- if((msrp->connectedFD = tnet_transport_connectto_2(msrp->transport, msrp->remote_ip, msrp->remote_port)) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect to the remote party");
- ret = -2;
- goto bail;
- }
- else{
- //TSK_DEBUG_INFO("Msrp connected FD=%d", msrp->connectedFD);
- //if((ret = tnet_sockfd_waitUntilWritable(msrp->connectedFD, TDAV_MSRP_CONNECT_TIMEOUT)) && msrp->offerer){
- // TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected to (%s:%d).", TDAV_MSRP_CONNECT_TIMEOUT, msrp->remote_ip, msrp->remote_port);
- // goto bail;
- //}
- /* draft-denis-simple-msrp-comedia-02 - 4.2.3. Setting up the connection
- Once the TCP session is established, and if the answerer was the
- active connection endpoint, it MUST send an MSRP request. In
- particular, if it has no pending data to send, it MUST send an empty
- MSRP SEND request. That is necessary for the other endpoint to
- authenticate this TCP session.
-
- ...RFC 4975 - 7.1
- */
- msrp->send_bodiless = tsk_true;
- }
- break;
- }
- default:
- {
- //
- // PASSIVE
- //
- break;
- }
- }
-
- // create and start the receiver
- if(!msrp->receiver){
- if((msrp->receiver = tmsrp_receiver_create(msrp->config, msrp->connectedFD))){
- tnet_transport_set_callback(msrp->transport, TNET_TRANSPORT_CB_F(tdav_transport_layer_stream_cb), msrp);
- if((ret = tmsrp_receiver_start(msrp->receiver, msrp, tdav_msrp_event_proxy_cb))){
- TSK_DEBUG_ERROR("Failed to start the MSRP receiver");
- goto bail;
- }
- }
- }
-
- // create and start the sender
- if(!msrp->sender){
- if((msrp->sender = tmsrp_sender_create(msrp->config, msrp->connectedFD))){
- msrp->sender->chunck_duration = msrp->chunck_duration;
- if((ret = tmsrp_sender_start(msrp->sender))){
- TSK_DEBUG_ERROR("Failed to start the MSRP sender");
- goto bail;
- }
- }
- }
+ tdav_session_msrp_t* msrp;
+ int ret;
+
+ TSK_DEBUG_INFO("tdav_session_msrp_start");
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ /* start the transport */
+ if((ret = tnet_transport_start(msrp->transport))) {
+ goto bail;
+ }
+
+ switch(msrp->setup) {
+ case msrp_setup_active:
+ case msrp_setup_actpass: {
+ //
+ // ACTIVE
+ //
+ TSK_DEBUG_INFO("connectto(%s:%d)", msrp->remote_ip, msrp->remote_port);
+ if((msrp->connectedFD = tnet_transport_connectto_2(msrp->transport, msrp->remote_ip, msrp->remote_port)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect to the remote party");
+ ret = -2;
+ goto bail;
+ }
+ else {
+ //TSK_DEBUG_INFO("Msrp connected FD=%d", msrp->connectedFD);
+ //if((ret = tnet_sockfd_waitUntilWritable(msrp->connectedFD, TDAV_MSRP_CONNECT_TIMEOUT)) && msrp->offerer){
+ // TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected to (%s:%d).", TDAV_MSRP_CONNECT_TIMEOUT, msrp->remote_ip, msrp->remote_port);
+ // goto bail;
+ //}
+ /* draft-denis-simple-msrp-comedia-02 - 4.2.3. Setting up the connection
+ Once the TCP session is established, and if the answerer was the
+ active connection endpoint, it MUST send an MSRP request. In
+ particular, if it has no pending data to send, it MUST send an empty
+ MSRP SEND request. That is necessary for the other endpoint to
+ authenticate this TCP session.
+
+ ...RFC 4975 - 7.1
+ */
+ msrp->send_bodiless = tsk_true;
+ }
+ break;
+ }
+ default: {
+ //
+ // PASSIVE
+ //
+ break;
+ }
+ }
+
+ // create and start the receiver
+ if(!msrp->receiver) {
+ if((msrp->receiver = tmsrp_receiver_create(msrp->config, msrp->connectedFD))) {
+ tnet_transport_set_callback(msrp->transport, TNET_TRANSPORT_CB_F(tdav_transport_layer_stream_cb), msrp);
+ if((ret = tmsrp_receiver_start(msrp->receiver, msrp, tdav_msrp_event_proxy_cb))) {
+ TSK_DEBUG_ERROR("Failed to start the MSRP receiver");
+ goto bail;
+ }
+ }
+ }
+
+ // create and start the sender
+ if(!msrp->sender) {
+ if((msrp->sender = tmsrp_sender_create(msrp->config, msrp->connectedFD))) {
+ msrp->sender->chunck_duration = msrp->chunck_duration;
+ if((ret = tmsrp_sender_start(msrp->sender))) {
+ TSK_DEBUG_ERROR("Failed to start the MSRP sender");
+ goto bail;
+ }
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tdav_session_msrp_pause(tmedia_session_t* self)
{
- TSK_DEBUG_ERROR("Not Implemented");
- return -1;
+ TSK_DEBUG_ERROR("Not Implemented");
+ return -1;
}
int tdav_session_msrp_stop(tmedia_session_t* self)
{
- tdav_session_msrp_t* msrp;
- int ret;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- msrp = (tdav_session_msrp_t*)self;
-
- if(msrp->sender){
- if((ret = tmsrp_sender_stop(msrp->sender))){
- TSK_DEBUG_ERROR("Failed to stop the MSRP sender");
- }
- }
- if(msrp->receiver){
- if((ret = tmsrp_receiver_stop(msrp->receiver))){
- TSK_DEBUG_ERROR("Failed to stop the MSRP receiver");
- }
- }
-
- if(msrp->transport){
- if((ret = tnet_transport_shutdown(msrp->transport))){
- TSK_DEBUG_ERROR("Failed to stop the MSRP transport");
- }
- }
-
- return 0;
+ tdav_session_msrp_t* msrp;
+ int ret;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ if(msrp->sender) {
+ if((ret = tmsrp_sender_stop(msrp->sender))) {
+ TSK_DEBUG_ERROR("Failed to stop the MSRP sender");
+ }
+ }
+ if(msrp->receiver) {
+ if((ret = tmsrp_receiver_stop(msrp->receiver))) {
+ TSK_DEBUG_ERROR("Failed to stop the MSRP receiver");
+ }
+ }
+
+ if(msrp->transport) {
+ if((ret = tnet_transport_shutdown(msrp->transport))) {
+ TSK_DEBUG_ERROR("Failed to stop the MSRP transport");
+ }
+ }
+
+ return 0;
}
const tsdp_header_M_t* tdav_session_msrp_get_lo(tmedia_session_t* self)
{
- tdav_session_msrp_t* msrp;
- tsk_bool_t changed = tsk_false;
-
- const char* proto = "TCP/MSRP";
- const char* sheme = "msrp";
-
- TSK_DEBUG_INFO("tdav_session_msrp_get_lo");
-
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- msrp = (tdav_session_msrp_t*)self;
-
- if(!msrp->transport){
- TSK_DEBUG_ERROR("Not prepared");
- return tsk_null;
- }
-
- if(/*TNET_SOCKET_TYPE_IS_TLS(type)*/ tsk_false){
- proto = "TCP/TLS/MSRP";
- sheme = "msrps";
- }
-
- if(self->ro_changed && self->M.lo){
- /* Codecs */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
- tsk_list_clear_items(self->M.lo->FMTs);
-
- /* QoS */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
- }
-
- changed = (self->ro_changed || !self->M.lo);
-
- if(!self->M.lo){
- tsk_istr_t id;
- char* path = tsk_null;
- tnet_ip_t ip = "0.0.0.0";
- tnet_port_t port = 0;
-
- tsk_strrandom(&id);
- tnet_transport_get_public_ip_n_port(msrp->transport, msrp->transport->master->fd, &ip, &port);
- tsk_sprintf(&path, "%s://%s:%u/%s;tcp", sheme, ip, port, id); //tcp is ok even if tls is used.
-
- if((self->M.lo = tsdp_header_M_create(self->plugin->media, port, proto))){
- tmsrp_uri_t* uri;
-
- tsdp_header_M_add_headers(self->M.lo,
- TSDP_FMT_VA_ARGS("*"),
- TSDP_HEADER_C_VA_ARGS("IN", msrp->useIPv6 ? "IP6" : "IP4", ip),
- TSDP_HEADER_A_VA_ARGS("path", path),
- tsk_null);
-
- if((uri = tmsrp_uri_parse(path, tsk_strlen(path)))){
- TSK_OBJECT_SAFE_FREE(msrp->config->From_Path);
- msrp->config->From_Path = tmsrp_header_From_Path_create(uri);
- TSK_OBJECT_SAFE_FREE(uri);
- }
- }
- TSK_FREE(path);
-
- if(self->M.ro){ /* We are probably about to send 2xx INVITE(sdp) */
- /* [OMA-TS-SIMPLE_IM-V1_0-20100322-C] - 5.8.1 Negotiate direction of the MSRP connection setup
- Offer Answer
- ________________
- active passive / holdconn
- passive active / holdconn
- actpass active / passive / holdconn
- holdconn holdconn
- */
- const tsdp_header_A_t* A;
- if((A = tsdp_header_M_findA(self->M.ro, "setup"))){
- tdav_msrp_setup_t setup = setup_from_string(A->value);
- switch(setup){
- case msrp_setup_passive:
- case msrp_setup_actpass: // Because of NAT issues "actpass -(always)-> active"
- msrp->setup = msrp_setup_active;
- break;
- case msrp_setup_active:
- msrp->setup = msrp_setup_passive;
- break;
- default: break;
- }
- tsdp_header_M_add_headers(self->M.lo,
- TSDP_HEADER_A_VA_ARGS("connection", "new"),
- tsk_null
- );
- }
- msrp->offerer = tsk_false;
- }
- else{ /* We are probably about to send initial INVITE */
- tsdp_header_M_add_headers(self->M.lo,
- TSDP_HEADER_A_VA_ARGS("connection", "new"),
- tsk_null
- );
- msrp->offerer = tsk_true;
- }
-
- /* direction */
- if(msrp->dir == tdav_msrp_dir_none){
- msrp->dir = msrp->file.path ? tdav_msrp_dir_sendonly : tdav_msrp_dir_sendrecv;
- }
-
- /* Other SDP fields */
- populate_lo(msrp, tsk_true);
- } // !lo
-
-
- return self->M.lo;
+ tdav_session_msrp_t* msrp;
+ tsk_bool_t changed = tsk_false;
+
+ const char* proto = "TCP/MSRP";
+ const char* sheme = "msrp";
+
+ TSK_DEBUG_INFO("tdav_session_msrp_get_lo");
+
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ if(!msrp->transport) {
+ TSK_DEBUG_ERROR("Not prepared");
+ return tsk_null;
+ }
+
+ if(/*TNET_SOCKET_TYPE_IS_TLS(type)*/ tsk_false) {
+ proto = "TCP/TLS/MSRP";
+ sheme = "msrps";
+ }
+
+ if(self->ro_changed && self->M.lo) {
+ /* Codecs */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
+ tsk_list_clear_items(self->M.lo->FMTs);
+
+ /* QoS */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
+ }
+
+ changed = (self->ro_changed || !self->M.lo);
+
+ if(!self->M.lo) {
+ tsk_istr_t id;
+ char* path = tsk_null;
+ tnet_ip_t ip = "0.0.0.0";
+ tnet_port_t port = 0;
+
+ tsk_strrandom(&id);
+ tnet_transport_get_public_ip_n_port(msrp->transport, msrp->transport->master->fd, &ip, &port);
+ tsk_sprintf(&path, "%s://%s:%u/%s;tcp", sheme, ip, port, id); //tcp is ok even if tls is used.
+
+ if((self->M.lo = tsdp_header_M_create(self->plugin->media, port, proto))) {
+ tmsrp_uri_t* uri;
+
+ tsdp_header_M_add_headers(self->M.lo,
+ TSDP_FMT_VA_ARGS("*"),
+ TSDP_HEADER_C_VA_ARGS("IN", msrp->useIPv6 ? "IP6" : "IP4", ip),
+ TSDP_HEADER_A_VA_ARGS("path", path),
+ tsk_null);
+
+ if((uri = tmsrp_uri_parse(path, tsk_strlen(path)))) {
+ TSK_OBJECT_SAFE_FREE(msrp->config->From_Path);
+ msrp->config->From_Path = tmsrp_header_From_Path_create(uri);
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+ }
+ TSK_FREE(path);
+
+ if(self->M.ro) { /* We are probably about to send 2xx INVITE(sdp) */
+ /* [OMA-TS-SIMPLE_IM-V1_0-20100322-C] - 5.8.1 Negotiate direction of the MSRP connection setup
+ Offer Answer
+ ________________
+ active passive / holdconn
+ passive active / holdconn
+ actpass active / passive / holdconn
+ holdconn holdconn
+ */
+ const tsdp_header_A_t* A;
+ if((A = tsdp_header_M_findA(self->M.ro, "setup"))) {
+ tdav_msrp_setup_t setup = setup_from_string(A->value);
+ switch(setup) {
+ case msrp_setup_passive:
+ case msrp_setup_actpass: // Because of NAT issues "actpass -(always)-> active"
+ msrp->setup = msrp_setup_active;
+ break;
+ case msrp_setup_active:
+ msrp->setup = msrp_setup_passive;
+ break;
+ default:
+ break;
+ }
+ tsdp_header_M_add_headers(self->M.lo,
+ TSDP_HEADER_A_VA_ARGS("connection", "new"),
+ tsk_null
+ );
+ }
+ msrp->offerer = tsk_false;
+ }
+ else { /* We are probably about to send initial INVITE */
+ tsdp_header_M_add_headers(self->M.lo,
+ TSDP_HEADER_A_VA_ARGS("connection", "new"),
+ tsk_null
+ );
+ msrp->offerer = tsk_true;
+ }
+
+ /* direction */
+ if(msrp->dir == tdav_msrp_dir_none) {
+ msrp->dir = msrp->file.path ? tdav_msrp_dir_sendonly : tdav_msrp_dir_sendrecv;
+ }
+
+ /* Other SDP fields */
+ populate_lo(msrp, tsk_true);
+ } // !lo
+
+
+ return self->M.lo;
}
int tdav_session_msrp_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- tdav_session_msrp_t* msrp;
- const tsdp_header_A_t* A;
- tsk_bool_t answer;
-
- TSK_DEBUG_INFO("tdav_session_msrp_set_ro");
-
- if(!self || !m){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- msrp = (tdav_session_msrp_t*)self;
-
- // answer or initial offer?
- answer = (self->M.lo != tsk_null);
-
- /* update remote offer */
- TSK_OBJECT_SAFE_FREE(self->M.ro);
- self->M.ro = tsk_object_ref((void*)m);
-
- if(self->M.lo){
- if((match_offer(msrp, m))){
-
- }
- else{
- TSK_DEBUG_ERROR("MSRP offer doesn't match");
- return -1;
- }
- /* QoS */
- if(self->qos){
- tmedia_qos_tline_t* ro_tline;
- if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))){
- tmedia_qos_tline_set_ro(self->qos, ro_tline);
- TSK_OBJECT_SAFE_FREE(ro_tline);
- }
- }
- }
-
- /* To-Path */
- if((A = tsdp_header_M_findA(m, "path"))){
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(A->value, tsk_strlen(A->value)))){
- TSK_OBJECT_SAFE_FREE(msrp->config->To_Path);
- msrp->config->To_Path = tmsrp_header_To_Path_create(uri);
- TSK_OBJECT_SAFE_FREE(uri);
- }
- }
-
- // OMA-TS-SIMPLE_IM-V1_0-20080903-C - 5.8.1 Negotiate direction of the MSRP connection setup
- if((A = tsdp_header_M_findA(m, "setup"))){
- tdav_msrp_setup_t setup = setup_from_string(A->value);
- switch(setup){
- case msrp_setup_actpass:
- case msrp_setup_passive:
- msrp->setup = msrp_setup_active;
- break;
- case msrp_setup_active:
- msrp->setup = msrp_setup_passive;
- break;
- default: break;
- }
- }
-
- /* direction attribute */
- if(msrp->dir == tdav_msrp_dir_none){
- if((A = tsdp_header_M_findA(m, "sendonly"))){
- msrp->dir = tdav_msrp_dir_recvonly;
- }
- else if((A = tsdp_header_M_findA(m, "sendrecv"))){
- msrp->dir = tdav_msrp_dir_sendrecv;
- }
- else if((A = tsdp_header_M_findA(m, "recvonly"))){
- msrp->dir = tdav_msrp_dir_sendonly;
- }
- }
-
- /* Neg parameters */
- init_neg_types(msrp, m);
-
-
- /* [OMA-TS-SIMPLE_IM-V1_0-20100322-C] - 5.8.2 Support of Application Level Gateway */
-
- /* get connection associated to this media line
- * If the connnection is global, then the manager will call tdav_session_audio_set() */
- if(m->C && m->C->addr && !msrp->remote_ip){
- tsk_strupdate(&msrp->remote_ip, m->C->addr);
- msrp->useIPv6 = tsk_striequals(m->C->addrtype, "IP6");
- }
- /* set remote port */
- msrp->remote_port = m->port;
-
- return 0;
+ tdav_session_msrp_t* msrp;
+ const tsdp_header_A_t* A;
+ tsk_bool_t answer;
+
+ TSK_DEBUG_INFO("tdav_session_msrp_set_ro");
+
+ if(!self || !m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ msrp = (tdav_session_msrp_t*)self;
+
+ // answer or initial offer?
+ answer = (self->M.lo != tsk_null);
+
+ /* update remote offer */
+ TSK_OBJECT_SAFE_FREE(self->M.ro);
+ self->M.ro = tsk_object_ref((void*)m);
+
+ if(self->M.lo) {
+ if((match_offer(msrp, m))) {
+
+ }
+ else {
+ TSK_DEBUG_ERROR("MSRP offer doesn't match");
+ return -1;
+ }
+ /* QoS */
+ if(self->qos) {
+ tmedia_qos_tline_t* ro_tline;
+ if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))) {
+ tmedia_qos_tline_set_ro(self->qos, ro_tline);
+ TSK_OBJECT_SAFE_FREE(ro_tline);
+ }
+ }
+ }
+
+ /* To-Path */
+ if((A = tsdp_header_M_findA(m, "path"))) {
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(A->value, tsk_strlen(A->value)))) {
+ TSK_OBJECT_SAFE_FREE(msrp->config->To_Path);
+ msrp->config->To_Path = tmsrp_header_To_Path_create(uri);
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+ }
+
+ // OMA-TS-SIMPLE_IM-V1_0-20080903-C - 5.8.1 Negotiate direction of the MSRP connection setup
+ if((A = tsdp_header_M_findA(m, "setup"))) {
+ tdav_msrp_setup_t setup = setup_from_string(A->value);
+ switch(setup) {
+ case msrp_setup_actpass:
+ case msrp_setup_passive:
+ msrp->setup = msrp_setup_active;
+ break;
+ case msrp_setup_active:
+ msrp->setup = msrp_setup_passive;
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* direction attribute */
+ if(msrp->dir == tdav_msrp_dir_none) {
+ if((A = tsdp_header_M_findA(m, "sendonly"))) {
+ msrp->dir = tdav_msrp_dir_recvonly;
+ }
+ else if((A = tsdp_header_M_findA(m, "sendrecv"))) {
+ msrp->dir = tdav_msrp_dir_sendrecv;
+ }
+ else if((A = tsdp_header_M_findA(m, "recvonly"))) {
+ msrp->dir = tdav_msrp_dir_sendonly;
+ }
+ }
+
+ /* Neg parameters */
+ init_neg_types(msrp, m);
+
+
+ /* [OMA-TS-SIMPLE_IM-V1_0-20100322-C] - 5.8.2 Support of Application Level Gateway */
+
+ /* get connection associated to this media line
+ * If the connnection is global, then the manager will call tdav_session_audio_set() */
+ if(m->C && m->C->addr && !msrp->remote_ip) {
+ tsk_strupdate(&msrp->remote_ip, m->C->addr);
+ msrp->useIPv6 = tsk_striequals(m->C->addrtype, "IP6");
+ }
+ /* set remote port */
+ msrp->remote_port = m->port;
+
+ return 0;
}
/* ============ Public functions ================= */
int tdav_session_msrp_send_file(tmedia_session_msrp_t* self, const char* path, va_list *app)
{
- tdav_session_msrp_t* msrp;
- int ret;
-
- if(!path || !(msrp = (tdav_session_msrp_t*)self) || !msrp->sender){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- //if(1 || !msrp->file.selector){
- // /* File transfer without selector line
- // - a=file-selector:name:"test.pcap" type:application/octet-stream size:20312
- // */
- // FILE* file = fopen(path, "rb");
- // const char* fname = path + tsk_strlen(path);
- // while(fname && (fname> path) && *fname != '\\' && *fname != '/'){
- // fname--;
- // }
-
- // if(file){
- // tsk_size_t size = 0;
- // fseek(file, 0L, SEEK_END);
- // size = ftell(file);
- // fclose(file);
-
- // tsk_sprintf(&msrp->file.selector, "name:\"%s\" type:application/octet-stream size:%u",
- // fname, size);
- // tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
- // TSDP_HEADER_A_VA_ARGS("file-selector", msrp->file.selector),
- // tsk_null);
- // }
- //}
-
- ret = tsmrp_sender_send_file(msrp->sender, path);
-
- return ret;
+ tdav_session_msrp_t* msrp;
+ int ret;
+
+ if(!path || !(msrp = (tdav_session_msrp_t*)self) || !msrp->sender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ //if(1 || !msrp->file.selector){
+ // /* File transfer without selector line
+ // - a=file-selector:name:"test.pcap" type:application/octet-stream size:20312
+ // */
+ // FILE* file = fopen(path, "rb");
+ // const char* fname = path + tsk_strlen(path);
+ // while(fname && (fname> path) && *fname != '\\' && *fname != '/'){
+ // fname--;
+ // }
+
+ // if(file){
+ // tsk_size_t size = 0;
+ // fseek(file, 0L, SEEK_END);
+ // size = ftell(file);
+ // fclose(file);
+
+ // tsk_sprintf(&msrp->file.selector, "name:\"%s\" type:application/octet-stream size:%u",
+ // fname, size);
+ // tsdp_header_M_add_headers(TMEDIA_SESSION(self)->M.lo,
+ // TSDP_HEADER_A_VA_ARGS("file-selector", msrp->file.selector),
+ // tsk_null);
+ // }
+ //}
+
+ ret = tsmrp_sender_send_file(msrp->sender, path);
+
+ return ret;
}
int tdav_session_msrp_send_message(tmedia_session_msrp_t* self, const void* data, tsk_size_t size, const tmedia_params_L_t *params)
{
- const tdav_session_msrp_t* msrp;
- const tmedia_param_t* param;
- int ret;
- const tsk_list_item_t* item;
- const char* content_type = tsk_null;
- const char* w_content_type = tsk_null;
-
- if(!data || !size || !(msrp = (tdav_session_msrp_t*)self) || !msrp->sender){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_list_foreach(item, params){
- if((param = TMEDIA_PARAM(item->data))){
- if((param->media_type & tmedia_msrp) == param->media_type
- && param->plugin_type == tmedia_ppt_session
- && param->value_type == tmedia_pvt_pchar){
-
- if(tsk_striequals(param->key, "content-type")){
- content_type = (const char*)param->value;
- }
- else if(tsk_striequals(param->key, "w-content-type")){
- w_content_type = (const char*)param->value;
- }
- }
- }
- }
-
- if(content_type || w_content_type){ // user-defined content-types
- ret = tsmrp_sender_send_data(msrp->sender, data, size, content_type, w_content_type);
- }
- else{ // neg. content-types
- ret = tsmrp_sender_send_data(msrp->sender, data, size,
- msrp->neg_accept_type, msrp->neg_accept_w_type
- );
- }
-
- return ret;
+ const tdav_session_msrp_t* msrp;
+ const tmedia_param_t* param;
+ int ret;
+ const tsk_list_item_t* item;
+ const char* content_type = tsk_null;
+ const char* w_content_type = tsk_null;
+
+ if(!data || !size || !(msrp = (tdav_session_msrp_t*)self) || !msrp->sender) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_list_foreach(item, params) {
+ if((param = TMEDIA_PARAM(item->data))) {
+ if((param->media_type & tmedia_msrp) == param->media_type
+ && param->plugin_type == tmedia_ppt_session
+ && param->value_type == tmedia_pvt_pchar) {
+
+ if(tsk_striequals(param->key, "content-type")) {
+ content_type = (const char*)param->value;
+ }
+ else if(tsk_striequals(param->key, "w-content-type")) {
+ w_content_type = (const char*)param->value;
+ }
+ }
+ }
+ }
+
+ if(content_type || w_content_type) { // user-defined content-types
+ ret = tsmrp_sender_send_data(msrp->sender, data, size, content_type, w_content_type);
+ }
+ else { // neg. content-types
+ ret = tsmrp_sender_send_data(msrp->sender, data, size,
+ msrp->neg_accept_type, msrp->neg_accept_w_type
+ );
+ }
+
+ return ret;
}
@@ -899,85 +903,83 @@ int tdav_session_msrp_send_message(tmedia_session_msrp_t* self, const void* data
/* constructor */
static tsk_object_t* tdav_session_msrp_ctor(tsk_object_t * self, va_list * app)
{
- tdav_session_msrp_t *session = self;
- if(session){
- /* init base: called by tmedia_session_create() */
- /* init self */
- TMEDIA_SESSION_MSRP(session)->send_file = tdav_session_msrp_send_file;
- TMEDIA_SESSION_MSRP(session)->send_message = tdav_session_msrp_send_message;
-
- session->config = tmsrp_config_create();
- session->setup = msrp_setup_actpass; /* draft-denis-simple-msrp-comedia-02 - 4.1.1. Sending the offer */
- session->dir = tdav_msrp_dir_none;
- }
- return self;
+ tdav_session_msrp_t *session = self;
+ if(session) {
+ /* init base: called by tmedia_session_create() */
+ /* init self */
+ TMEDIA_SESSION_MSRP(session)->send_file = tdav_session_msrp_send_file;
+ TMEDIA_SESSION_MSRP(session)->send_message = tdav_session_msrp_send_message;
+
+ session->config = tmsrp_config_create();
+ session->setup = msrp_setup_actpass; /* draft-denis-simple-msrp-comedia-02 - 4.1.1. Sending the offer */
+ session->dir = tdav_msrp_dir_none;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_session_msrp_dtor(tsk_object_t * self)
-{
- tdav_session_msrp_t *session = self;
- if(session){
-
- /* deinit self (rtp manager should be destroyed after the producer) */
- TSK_OBJECT_SAFE_FREE(session->config);
-
- TSK_OBJECT_SAFE_FREE(session->receiver);
- TSK_OBJECT_SAFE_FREE(session->sender);
- TSK_OBJECT_SAFE_FREE(session->transport);
-
- TSK_FREE(session->remote_ip);
- TSK_FREE(session->local_ip);
-
- TSK_FREE(session->neg_accept_type);
- TSK_FREE(session->neg_accept_w_type);
- TSK_FREE(session->accept_types);
- TSK_FREE(session->accept_w_types);
-
- /* File */
- TSK_FREE(session->file.path);
- TSK_FREE(session->file.selector);
- TSK_FREE(session->file.disposition);
- TSK_FREE(session->file.date);
- TSK_FREE(session->file.icon);
- TSK_FREE(session->file.transfer_id);
-
- /* NAT Traversal context */
- TSK_OBJECT_SAFE_FREE(session->natt_ctx);
-
- /* deinit base */
- tmedia_session_deinit(self);
- }
+{
+ tdav_session_msrp_t *session = self;
+ if(session) {
- return self;
+ /* deinit self (rtp manager should be destroyed after the producer) */
+ TSK_OBJECT_SAFE_FREE(session->config);
+
+ TSK_OBJECT_SAFE_FREE(session->receiver);
+ TSK_OBJECT_SAFE_FREE(session->sender);
+ TSK_OBJECT_SAFE_FREE(session->transport);
+
+ TSK_FREE(session->remote_ip);
+ TSK_FREE(session->local_ip);
+
+ TSK_FREE(session->neg_accept_type);
+ TSK_FREE(session->neg_accept_w_type);
+ TSK_FREE(session->accept_types);
+ TSK_FREE(session->accept_w_types);
+
+ /* File */
+ TSK_FREE(session->file.path);
+ TSK_FREE(session->file.selector);
+ TSK_FREE(session->file.disposition);
+ TSK_FREE(session->file.date);
+ TSK_FREE(session->file.icon);
+ TSK_FREE(session->file.transfer_id);
+
+ /* NAT Traversal context */
+ TSK_OBJECT_SAFE_FREE(session->natt_ctx);
+
+ /* deinit base */
+ tmedia_session_deinit(self);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_msrp_def_s =
-{
- sizeof(tdav_session_msrp_t),
- tdav_session_msrp_ctor,
- tdav_session_msrp_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tdav_session_msrp_def_s = {
+ sizeof(tdav_session_msrp_t),
+ tdav_session_msrp_ctor,
+ tdav_session_msrp_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tdav_session_msrp_plugin_def_s =
-{
- &tdav_session_msrp_def_s,
-
- tmedia_msrp,
- "message",
-
- tdav_session_msrp_set,
- tdav_session_msrp_get,
- tdav_session_msrp_prepare,
- tdav_session_msrp_start,
- tdav_session_msrp_pause,
- tdav_session_msrp_stop,
-
- /* Audio part */
- { tsk_null },
-
- tdav_session_msrp_get_lo,
- tdav_session_msrp_set_ro
+static const tmedia_session_plugin_def_t tdav_session_msrp_plugin_def_s = {
+ &tdav_session_msrp_def_s,
+
+ tmedia_msrp,
+ "message",
+
+ tdav_session_msrp_set,
+ tdav_session_msrp_get,
+ tdav_session_msrp_prepare,
+ tdav_session_msrp_start,
+ tdav_session_msrp_pause,
+ tdav_session_msrp_stop,
+
+ /* Audio part */
+ { tsk_null },
+
+ tdav_session_msrp_get_lo,
+ tdav_session_msrp_set_ro
};
const tmedia_session_plugin_def_t *tdav_session_msrp_plugin_def_t = &tdav_session_msrp_plugin_def_s;
diff --git a/tinyDAV/src/t140/tdav_consumer_t140.c b/tinyDAV/src/t140/tdav_consumer_t140.c
index 36779f4..26d4ace 100755
--- a/tinyDAV/src/t140/tdav_consumer_t140.c
+++ b/tinyDAV/src/t140/tdav_consumer_t140.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,56 +27,56 @@
static int tdav_consumer_t140_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
- return 0;
+ return 0;
}
static int tdav_consumer_t140_prepare(tmedia_consumer_t* self, const tmedia_codec_t* param)
{
- return 0;
+ return 0;
}
static int tdav_consumer_t140_start(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
// input data = [type:4bytes][data]
static int tdav_consumer_t140_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- if(!self || (size < 4)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(TDAV_CONSUMER_T140(self)->cb_ondata.func){
- return TDAV_CONSUMER_T140(self)->cb_ondata.func(TDAV_CONSUMER_T140(self)->cb_ondata.context,
- (enum tmedia_t140_data_type_e)*((int32_t*)buffer),
- &((uint8_t*)buffer)[4],
- (unsigned int)(size - 4));
- }
-
- return 0;
+ if(!self || (size < 4)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(TDAV_CONSUMER_T140(self)->cb_ondata.func) {
+ return TDAV_CONSUMER_T140(self)->cb_ondata.func(TDAV_CONSUMER_T140(self)->cb_ondata.context,
+ (enum tmedia_t140_data_type_e)*((int32_t*)buffer),
+ &((uint8_t*)buffer)[4],
+ (unsigned int)(size - 4));
+ }
+
+ return 0;
}
static int tdav_consumer_t140_pause(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_consumer_t140_stop(tmedia_consumer_t* self)
{
- return 0;
+ return 0;
}
int tdav_consumer_t140_set_ondata_cbfn(tdav_consumer_t140_t* self, const void* context, tmedia_session_t140_ondata_cb_f func)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->cb_ondata.context = context;
- self->cb_ondata.func = func;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->cb_ondata.context = context;
+ self->cb_ondata.func = func;
+ return 0;
}
//
@@ -85,53 +85,51 @@ int tdav_consumer_t140_set_ondata_cbfn(tdav_consumer_t140_t* self, const void* c
/* constructor */
static tsk_object_t* tdav_consumer_t140_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_t140_t *consumer = self;
- if(consumer){
- /* init base */
-
- /* init self */
-
- }
- return self;
+ tdav_consumer_t140_t *consumer = self;
+ if(consumer) {
+ /* init base */
+
+ /* init self */
+
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_t140_dtor(tsk_object_t * self)
-{
- tdav_consumer_t140_t *consumer = self;
- if(consumer){
- /* stop */
- if(consumer->started){
- tdav_consumer_t140_stop(self);
- }
-
- /* deinit base */
-
- /* deinit self */
- }
-
- return self;
+{
+ tdav_consumer_t140_t *consumer = self;
+ if(consumer) {
+ /* stop */
+ if(consumer->started) {
+ tdav_consumer_t140_stop(self);
+ }
+
+ /* deinit base */
+
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_t140_def_s =
-{
- sizeof(tdav_consumer_t140_t),
- tdav_consumer_t140_ctor,
- tdav_consumer_t140_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_consumer_t140_def_s = {
+ sizeof(tdav_consumer_t140_t),
+ tdav_consumer_t140_ctor,
+ tdav_consumer_t140_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_t140_plugin_def_s =
-{
- &tdav_consumer_t140_def_s,
-
- tmedia_t140,
- "T.140 consumer",
-
- tdav_consumer_t140_set,
- tdav_consumer_t140_prepare,
- tdav_consumer_t140_start,
- tdav_consumer_t140_consume,
- tdav_consumer_t140_pause,
- tdav_consumer_t140_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_t140_plugin_def_s = {
+ &tdav_consumer_t140_def_s,
+
+ tmedia_t140,
+ "T.140 consumer",
+
+ tdav_consumer_t140_set,
+ tdav_consumer_t140_prepare,
+ tdav_consumer_t140_start,
+ tdav_consumer_t140_consume,
+ tdav_consumer_t140_pause,
+ tdav_consumer_t140_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_t140_plugin_def_t = &tdav_consumer_t140_plugin_def_s; \ No newline at end of file
diff --git a/tinyDAV/src/t140/tdav_producer_t140.c b/tinyDAV/src/t140/tdav_producer_t140.c
index 8d147c9..0752556 100755
--- a/tinyDAV/src/t140/tdav_producer_t140.c
+++ b/tinyDAV/src/t140/tdav_producer_t140.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,58 +27,58 @@
static int tdav_producer_t140_set(tmedia_producer_t* self, const tmedia_param_t* param)
{
- return 0;
+ return 0;
}
static int tdav_producer_t140_prepare(tmedia_producer_t* self, const tmedia_codec_t* param)
{
- return 0;
+ return 0;
}
static int tdav_producer_t140_start(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_producer_t140_pause(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
static int tdav_producer_t140_stop(tmedia_producer_t* self)
{
- return 0;
+ return 0;
}
int tdav_producer_send_data(tdav_producer_t140_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(TMEDIA_PRODUCER(self)->enc_cb.callback){
- if(data_type != tmedia_t140_data_type_utf8){
- // build data
- tsk_size_t cmd_size = 0, i;
- int32_t cmd_val = (int32_t)data_type;
- if(data_ptr || data_size){
- TSK_DEBUG_WARN("Data not expected for commands");
- }
- // TODO: use ASM POPCNT
- for(i = 0; i < 32; i+= 8){
- if(((cmd_val >> i) & 0xFF)){
- ++cmd_size;
- }
- }
- if(cmd_size){
- TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, &cmd_val, cmd_size);
- }
- }
- else{
- TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, data_ptr, data_size);
- }
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(TMEDIA_PRODUCER(self)->enc_cb.callback) {
+ if(data_type != tmedia_t140_data_type_utf8) {
+ // build data
+ tsk_size_t cmd_size = 0, i;
+ int32_t cmd_val = (int32_t)data_type;
+ if(data_ptr || data_size) {
+ TSK_DEBUG_WARN("Data not expected for commands");
+ }
+ // TODO: use ASM POPCNT
+ for(i = 0; i < 32; i+= 8) {
+ if(((cmd_val >> i) & 0xFF)) {
+ ++cmd_size;
+ }
+ }
+ if(cmd_size) {
+ TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, &cmd_val, cmd_size);
+ }
+ }
+ else {
+ TMEDIA_PRODUCER(self)->enc_cb.callback(TMEDIA_PRODUCER(self)->enc_cb.callback_data, data_ptr, data_size);
+ }
+ }
+ return 0;
}
//
@@ -87,53 +87,51 @@ int tdav_producer_send_data(tdav_producer_t140_t* self, enum tmedia_t140_data_ty
/* constructor */
static tsk_object_t* tdav_producer_t140_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_t140_t *producer = self;
- if(producer){
- /* init base */
-
- /* init self */
- }
- return self;
+ tdav_producer_t140_t *producer = self;
+ if(producer) {
+ /* init base */
+
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_t140_dtor(tsk_object_t * self)
-{
- tdav_producer_t140_t *producer = self;
- if(producer){
-
- /* stop */
- if(producer->started){
- tdav_producer_t140_stop(self);
- }
-
- /* deinit base */
-
- /* deinit self */
-
- }
-
- return self;
+{
+ tdav_producer_t140_t *producer = self;
+ if(producer) {
+
+ /* stop */
+ if(producer->started) {
+ tdav_producer_t140_stop(self);
+ }
+
+ /* deinit base */
+
+ /* deinit self */
+
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_t140_def_s =
-{
- sizeof(tdav_producer_t140_t),
- tdav_producer_t140_ctor,
- tdav_producer_t140_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_t140_def_s = {
+ sizeof(tdav_producer_t140_t),
+ tdav_producer_t140_ctor,
+ tdav_producer_t140_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_t140_plugin_def_s =
-{
- &tdav_producer_t140_def_s,
-
- tmedia_t140,
- "T.140 producer",
-
- tdav_producer_t140_set,
- tdav_producer_t140_prepare,
- tdav_producer_t140_start,
- tdav_producer_t140_pause,
- tdav_producer_t140_stop
+static const tmedia_producer_plugin_def_t tdav_producer_t140_plugin_def_s = {
+ &tdav_producer_t140_def_s,
+
+ tmedia_t140,
+ "T.140 producer",
+
+ tdav_producer_t140_set,
+ tdav_producer_t140_prepare,
+ tdav_producer_t140_start,
+ tdav_producer_t140_pause,
+ tdav_producer_t140_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_t140_plugin_def_t = &tdav_producer_t140_plugin_def_s; \ No newline at end of file
diff --git a/tinyDAV/src/t140/tdav_session_t140.c b/tinyDAV/src/t140/tdav_session_t140.c
index cd4b17c..9c9d653 100755
--- a/tinyDAV/src/t140/tdav_session_t140.c
+++ b/tinyDAV/src/t140/tdav_session_t140.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
#include <limits.h>
#define T140_BLOCKS_MAX_COUNT 20 /* number of blocks to buffer for packet loss detection and reordering */
-#define T140_BLOCK_MAX_TRANSMIT_COUNT 4 /* maximum number of times to retransmit a bloc when RED is ON */
+#define T140_BLOCK_MAX_TRANSMIT_COUNT 4 /* maximum number of times to retransmit a bloc when RED is ON */
#define T140_ZERO_WIDTH_NO_BREAK_SPACE 0xEFBBBF /* send at the begining of the T.140 session */
#define T140_BACKSPACE 0x08
@@ -59,29 +59,27 @@
#define T140_WAIT_FOR_BUFFERING 300 /* Time to wait for buffering (T.140 blocks forming) */
#define T140_WAIT_FOR_IDLE 10000 /* Time to wait before entering in IDLE state */
-static const char zero_width_no_break_space[3] =
-{
- (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 16) & 0xFF,
- (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 8) & 0xFF,
- T140_ZERO_WIDTH_NO_BREAK_SPACE & 0xFF
+static const char zero_width_no_break_space[3] = {
+ (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 16) & 0xFF,
+ (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 8) & 0xFF,
+ T140_ZERO_WIDTH_NO_BREAK_SPACE & 0xFF
};
-typedef struct t140_block_s
-{
- TSK_DECLARE_OBJECT;
-
- uint8_t pt;
- uint16_t seq_num;
- uint32_t timestamp;
- uint32_t transmit_count; // number of times this block have been transmitted
- // whether the block have been forwarded to the end user for UI display or sent through the RTP channel
- tsk_bool_t delivered;
- // whether the block contains data skipped because too late
- tsk_bool_t too_late;
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- }data;
+typedef struct t140_block_s {
+ TSK_DECLARE_OBJECT;
+
+ uint8_t pt;
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint32_t transmit_count; // number of times this block have been transmitted
+ // whether the block have been forwarded to the end user for UI display or sent through the RTP channel
+ tsk_bool_t delivered;
+ // whether the block contains data skipped because too late
+ tsk_bool_t too_late;
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } data;
}
t140_block_t;
#define T140_BLOCK(self) ((t140_block_t*)(self))
@@ -117,827 +115,820 @@ static int tdav_session_t140_send_data(tmedia_session_t* self, enum tmedia_t140_
static int tdav_session_t140_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_session_t140_t* t140;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(tdav_session_av_set(TDAV_SESSION_AV(self), param) == tsk_true){
- return 0;
- }
-
- t140 = (tdav_session_t140_t*)self;
-
- if(param->plugin_type == tmedia_ppt_consumer){
- TSK_DEBUG_ERROR("Not expected consumer(%s)", param->key);
- }
- else if(param->plugin_type == tmedia_ppt_producer){
- TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
- }
- else{
- TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
- }
-
- return ret;
+ int ret = 0;
+ tdav_session_t140_t* t140;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(tdav_session_av_set(TDAV_SESSION_AV(self), param) == tsk_true) {
+ return 0;
+ }
+
+ t140 = (tdav_session_t140_t*)self;
+
+ if(param->plugin_type == tmedia_ppt_consumer) {
+ TSK_DEBUG_ERROR("Not expected consumer(%s)", param->key);
+ }
+ else if(param->plugin_type == tmedia_ppt_producer) {
+ TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
+ }
+ else {
+ TSK_DEBUG_ERROR("Not expected producer_set(%s)", param->key);
+ }
+
+ return ret;
}
static int tdav_session_t140_get(tmedia_session_t* self, tmedia_param_t* param)
{
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(tdav_session_av_get(TDAV_SESSION_AV(self), param) == tsk_true){
- return 0;
- }
-
- TSK_DEBUG_ERROR("(%s) not expected param key for plugin_type=%d", param->key, param->plugin_type);
- return -2;
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(tdav_session_av_get(TDAV_SESSION_AV(self), param) == tsk_true) {
+ return 0;
+ }
+
+ TSK_DEBUG_ERROR("(%s) not expected param key for plugin_type=%d", param->key, param->plugin_type);
+ return -2;
}
static int tdav_session_t140_prepare(tmedia_session_t* self)
{
- tdav_session_av_t* base = (tdav_session_av_t*)(self);
- int ret;
+ tdav_session_av_t* base = (tdav_session_av_t*)(self);
+ int ret;
- if((ret = tdav_session_av_prepare(base))){
- TSK_DEBUG_ERROR("tdav_session_av_prepare(t140) failed");
- return ret;
- }
+ if((ret = tdav_session_av_prepare(base))) {
+ TSK_DEBUG_ERROR("tdav_session_av_prepare(t140) failed");
+ return ret;
+ }
- if(base->rtp_manager){
- ret = trtp_manager_set_rtp_callback(base->rtp_manager, _tdav_session_t140_rtp_cb, base);
- }
+ if(base->rtp_manager) {
+ ret = trtp_manager_set_rtp_callback(base->rtp_manager, _tdav_session_t140_rtp_cb, base);
+ }
- return ret;
+ return ret;
}
static int tdav_session_t140_start(tmedia_session_t* self)
{
- int ret;
- tdav_session_t140_t* t140;
- const tmedia_codec_t* best_codec;
- tdav_session_av_t* base;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- t140 = (tdav_session_t140_t*)self;
- base = (tdav_session_av_t*)self;
-
- if(!(best_codec = tdav_session_av_get_best_neg_codec(base))){
- TSK_DEBUG_ERROR("No codec matched");
- return -2;
- }
-
- TSK_OBJECT_SAFE_FREE(t140->encoder.codec);
- t140->encoder.codec = tsk_object_ref((tsk_object_t*)best_codec);
-
- if((ret = tdav_session_av_start(base, best_codec))){
- TSK_DEBUG_ERROR("tdav_session_av_start(t140) failed");
- return ret;
- }
-
- if((ret = tsk_timer_manager_start(t140->h_timer)) != 0){
- TSK_DEBUG_ERROR("Failed to start the timer");
- return ret;
- }
-
- if(base->rtp_manager){
- int pt;
- t140->encoder.payload_type = t140->encoder.codec->neg_format ? atoi(t140->encoder.codec->neg_format) : atoi(t140->encoder.codec->format);
- pt = base->red.codec ?
- ( base->red.codec->neg_format ? atoi(base->red.codec->neg_format) : atoi(base->red.codec->format) ) :
- ( t140->encoder.payload_type );
- trtp_manager_set_payload_type(base->rtp_manager, pt);
- }
-
- t140->decoder.last_seq_num = -1;
-
- t140->started = (ret == 0);
-
- if(t140->started){
- t140->encoder.timer_idle.timeout = T140_WAIT_FOR_IDLE;
- t140->encoder.timer_buffering.timeout = T140_WAIT_FOR_BUFFERING;
- t140->encoder.timer_idle.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, t140);
- TSK_DEBUG_INFO("T.140 - Start IDLE timer");
- }
-
- return ret;
+ int ret;
+ tdav_session_t140_t* t140;
+ const tmedia_codec_t* best_codec;
+ tdav_session_av_t* base;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ t140 = (tdav_session_t140_t*)self;
+ base = (tdav_session_av_t*)self;
+
+ if(!(best_codec = tdav_session_av_get_best_neg_codec(base))) {
+ TSK_DEBUG_ERROR("No codec matched");
+ return -2;
+ }
+
+ TSK_OBJECT_SAFE_FREE(t140->encoder.codec);
+ t140->encoder.codec = tsk_object_ref((tsk_object_t*)best_codec);
+
+ if((ret = tdav_session_av_start(base, best_codec))) {
+ TSK_DEBUG_ERROR("tdav_session_av_start(t140) failed");
+ return ret;
+ }
+
+ if((ret = tsk_timer_manager_start(t140->h_timer)) != 0) {
+ TSK_DEBUG_ERROR("Failed to start the timer");
+ return ret;
+ }
+
+ if(base->rtp_manager) {
+ int pt;
+ t140->encoder.payload_type = t140->encoder.codec->neg_format ? atoi(t140->encoder.codec->neg_format) : atoi(t140->encoder.codec->format);
+ pt = base->red.codec ?
+ ( base->red.codec->neg_format ? atoi(base->red.codec->neg_format) : atoi(base->red.codec->format) ) :
+ ( t140->encoder.payload_type );
+ trtp_manager_set_payload_type(base->rtp_manager, pt);
+ }
+
+ t140->decoder.last_seq_num = -1;
+
+ t140->started = (ret == 0);
+
+ if(t140->started) {
+ t140->encoder.timer_idle.timeout = T140_WAIT_FOR_IDLE;
+ t140->encoder.timer_buffering.timeout = T140_WAIT_FOR_BUFFERING;
+ t140->encoder.timer_idle.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, t140);
+ TSK_DEBUG_INFO("T.140 - Start IDLE timer");
+ }
+
+ return ret;
}
static int tdav_session_t140_pause(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
static int tdav_session_t140_stop(tmedia_session_t* self)
{
- int ret;
- ret = tsk_timer_manager_stop(TDAV_SESSION_T140(self)->h_timer);
- ret = tdav_session_av_stop(TDAV_SESSION_AV(self));
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->decoder.codec);
- TDAV_SESSION_T140(self)->started = tsk_false;
- return ret;
+ int ret;
+ ret = tsk_timer_manager_stop(TDAV_SESSION_T140(self)->h_timer);
+ ret = tdav_session_av_stop(TDAV_SESSION_AV(self));
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->decoder.codec);
+ TDAV_SESSION_T140(self)->started = tsk_false;
+ return ret;
}
static const tsdp_header_M_t* tdav_session_t140_get_lo(tmedia_session_t* self)
{
- tsk_bool_t updated = tsk_false;
- const tsdp_header_M_t* ret;
- tdav_session_av_t* base = TDAV_SESSION_AV(self);
-
-
- if(!(ret = tdav_session_av_get_lo(base, &updated))){
- TSK_DEBUG_ERROR("tdav_session_av_get_lo(t140) failed");
- return tsk_null;
- }
-
- if(updated){
- tsk_safeobj_lock(base);
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
- tsk_safeobj_unlock(base);
- }
-
- return ret;
+ tsk_bool_t updated = tsk_false;
+ const tsdp_header_M_t* ret;
+ tdav_session_av_t* base = TDAV_SESSION_AV(self);
+
+
+ if(!(ret = tdav_session_av_get_lo(base, &updated))) {
+ TSK_DEBUG_ERROR("tdav_session_av_get_lo(t140) failed");
+ return tsk_null;
+ }
+
+ if(updated) {
+ tsk_safeobj_lock(base);
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
+ tsk_safeobj_unlock(base);
+ }
+
+ return ret;
}
static int tdav_session_t140_set_ro(tmedia_session_t* self, const tsdp_header_M_t* ro)
{
- int ret;
- tsk_bool_t updated = tsk_false;
- tdav_session_av_t* base = TDAV_SESSION_AV(self);
-
- if((ret = tdav_session_av_set_ro(base, ro, &updated))){
- TSK_DEBUG_ERROR("tdav_session_av_set_ro(t140) failed");
- return ret;
- }
-
- if(updated){
- tsk_safeobj_lock(base);
- TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
- tsk_safeobj_unlock(base);
- }
-
- return ret;
+ int ret;
+ tsk_bool_t updated = tsk_false;
+ tdav_session_av_t* base = TDAV_SESSION_AV(self);
+
+ if((ret = tdav_session_av_set_ro(base, ro, &updated))) {
+ TSK_DEBUG_ERROR("tdav_session_av_set_ro(t140) failed");
+ return ret;
+ }
+
+ if(updated) {
+ tsk_safeobj_lock(base);
+ TSK_OBJECT_SAFE_FREE(TDAV_SESSION_T140(self)->encoder.codec);
+ tsk_safeobj_unlock(base);
+ }
+
+ return ret;
}
static int tdav_session_t140_set_ondata_cbfn(tmedia_session_t* self, const void* context, tmedia_session_t140_ondata_cb_f func)
{
- tdav_session_t140_t* t140 = (tdav_session_t140_t*)self;
- tdav_session_av_t* base = (tdav_session_av_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- t140->cb_ondata.context = context;
- t140->cb_ondata.func = func;
-
- if(base->consumer){
- return tdav_consumer_t140_set_ondata_cbfn(TDAV_CONSUMER_T140(base->consumer), context, func);
- }
- return -2;
+ tdav_session_t140_t* t140 = (tdav_session_t140_t*)self;
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ t140->cb_ondata.context = context;
+ t140->cb_ondata.func = func;
+
+ if(base->consumer) {
+ return tdav_consumer_t140_set_ondata_cbfn(TDAV_CONSUMER_T140(base->consumer), context, func);
+ }
+ return -2;
}
static int tdav_session_t140_send_data(tmedia_session_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- tdav_session_av_t* base = (tdav_session_av_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(base->producer){
- return tdav_producer_send_data(TDAV_PRODUCER_T140(base->producer), data_type, data_ptr, data_size);
- }
- return -2;
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(base->producer) {
+ return tdav_producer_send_data(TDAV_PRODUCER_T140(base->producer), data_type, data_ptr, data_size);
+ }
+ return -2;
}
// RTP/RTCP callback (From the network to the consumer)
static int _tdav_session_t140_rtp_cb(const void* callback_data, const struct trtp_rtp_packet_s* packet)
{
- tdav_session_t140_t* t140 = (tdav_session_t140_t*)callback_data;
- tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
-
- if(!t140 || !packet || !packet->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!t140->started || !base->consumer){
- TSK_DEBUG_ERROR("Not ready yet");
- return -1;
- }
-
- if(packet->header->payload_type == base->red.payload_type){
- //static void* __red_buffer_ptr = tsk_null; // Never used
- //static tsk_size_t __red_buffer_size = 0; // Never used
- if(!base->red.codec){
- TSK_DEBUG_ERROR("No RED codec could be found");
- return -2;
- }
- // Decode RED data
- /* base->red.codec->plugin->decode(
- base->red.codec,
- (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
- &__red_buffer_ptr, &__red_buffer_size,
- packet->header
- );
- return 0;
- */
- _tdav_session_t140_recv_red(t140, packet);
- }
- else{
- tsk_size_t out_size;
- // Find the codec to use to decode the RTP payload
- if(!t140->decoder.codec || t140->decoder.payload_type != packet->header->payload_type){
- tsk_istr_t format;
- TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
- tsk_itoa(packet->header->payload_type, &format);
- if(!(t140->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(t140)->neg_codecs, format)) || !t140->decoder.codec->plugin || !t140->decoder.codec->plugin->decode){
- TSK_DEBUG_ERROR("%s is not a valid payload for this session", format);
- return -2;
- }
- t140->decoder.payload_type = packet->header->payload_type;
- }
-
- // Open codec if not already done
- if(!TMEDIA_CODEC(t140->decoder.codec)->opened){
- int ret;
- tsk_safeobj_lock(base);
- if((ret = tmedia_codec_open(t140->decoder.codec))){
- tsk_safeobj_unlock(base);
- TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
- TSK_DEBUG_ERROR("Failed to open [%s] codec", t140->decoder.codec->plugin->desc);
- return ret;
- }
- tsk_safeobj_unlock(base);
- }
- // Decode data
- out_size = t140->decoder.codec->plugin->decode(t140->decoder.codec, packet->payload.data, packet->payload.size, &t140->decoder.buffer, &t140->decoder.buffer_size, packet->header);
- if(out_size){
- _tdav_session_t140_recv_raw(t140, t140->decoder.buffer, out_size);
- }
- }
-
- return 0;
+ tdav_session_t140_t* t140 = (tdav_session_t140_t*)callback_data;
+ tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+
+ if(!t140 || !packet || !packet->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!t140->started || !base->consumer) {
+ TSK_DEBUG_ERROR("Not ready yet");
+ return -1;
+ }
+
+ if(packet->header->payload_type == base->red.payload_type) {
+ //static void* __red_buffer_ptr = tsk_null; // Never used
+ //static tsk_size_t __red_buffer_size = 0; // Never used
+ if(!base->red.codec) {
+ TSK_DEBUG_ERROR("No RED codec could be found");
+ return -2;
+ }
+ // Decode RED data
+ /* base->red.codec->plugin->decode(
+ base->red.codec,
+ (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
+ &__red_buffer_ptr, &__red_buffer_size,
+ packet->header
+ );
+ return 0;
+ */
+ _tdav_session_t140_recv_red(t140, packet);
+ }
+ else {
+ tsk_size_t out_size;
+ // Find the codec to use to decode the RTP payload
+ if(!t140->decoder.codec || t140->decoder.payload_type != packet->header->payload_type) {
+ tsk_istr_t format;
+ TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
+ tsk_itoa(packet->header->payload_type, &format);
+ if(!(t140->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(t140)->neg_codecs, format)) || !t140->decoder.codec->plugin || !t140->decoder.codec->plugin->decode) {
+ TSK_DEBUG_ERROR("%s is not a valid payload for this session", format);
+ return -2;
+ }
+ t140->decoder.payload_type = packet->header->payload_type;
+ }
+
+ // Open codec if not already done
+ if(!TMEDIA_CODEC(t140->decoder.codec)->opened) {
+ int ret;
+ tsk_safeobj_lock(base);
+ if((ret = tmedia_codec_open(t140->decoder.codec))) {
+ tsk_safeobj_unlock(base);
+ TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", t140->decoder.codec->plugin->desc);
+ return ret;
+ }
+ tsk_safeobj_unlock(base);
+ }
+ // Decode data
+ out_size = t140->decoder.codec->plugin->decode(t140->decoder.codec, packet->payload.data, packet->payload.size, &t140->decoder.buffer, &t140->decoder.buffer_size, packet->header);
+ if(out_size) {
+ _tdav_session_t140_recv_raw(t140, t140->decoder.buffer, out_size);
+ }
+ }
+
+ return 0;
}
// Producer callback (From the producer to the network). Will encode() data before sending
static int _tdav_session_t140_producer_enc_cb(const void* callback_data, const void* buffer, tsk_size_t size)
{
- int ret = 0;
-
- tdav_session_t140_t* t140 = (tdav_session_t140_t*)callback_data;
- tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
-
- if(!t140){
- TSK_DEBUG_ERROR("Null session");
- return 0;
- }
-
- if(t140->started && base->rtp_manager && base->rtp_manager->is_started && t140->encoder.codec){
- /* encode */
- //tsk_size_t out_size = 0;
-
- if(!base->rtp_manager->is_started){
- TSK_DEBUG_ERROR("Not started");
- return 0;
- }
-
- // Open codec if not already done
- if(!t140->encoder.codec->opened){
- tsk_safeobj_lock(base);
- if((ret = tmedia_codec_open(t140->encoder.codec))){
- tsk_safeobj_unlock(base);
- TSK_DEBUG_ERROR("Failed to open [%s] codec", t140->encoder.codec->plugin->desc);
- return -4;
- }
- tsk_safeobj_unlock(base);
- }
-
- ret = _tdav_session_t140_save_outgoing_data(t140, buffer, size);
-
- // start buffering timer if not already done
- if(!TSK_TIMER_ID_IS_VALID(t140->encoder.timer_buffering.id)){
- TSK_DEBUG_INFO("T.140 - Schedule buffering timer");
- t140->encoder.timer_buffering.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_buffering.timeout, _tdav_session_t140_timer_cb, t140);
- }
-
- //if((t140->encoder.codec = tsk_object_ref(t140->encoder.codec))){ /* Thread safeness (SIP reINVITE or UPDATE could update the encoder) */
- //out_size = t140->encoder.codec->plugin->encode(t140->encoder.codec, buffer, size, &t140->encoder.buffer, &t140->encoder.buffer_size);
- //if(out_size){
- // trtp_manager_send_rtp(base->rtp_manager, t140->encoder.buffer, out_size, TMEDIA_CODEC_PCM_FRAME_SIZE(t140->encoder.codec), tsk_false/*Marker*/, tsk_true/*lastPacket*/);
- //}
- //tsk_object_unref(t140->encoder.codec);
- //}
- }
- return ret;
+ int ret = 0;
+
+ tdav_session_t140_t* t140 = (tdav_session_t140_t*)callback_data;
+ tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+
+ if(!t140) {
+ TSK_DEBUG_ERROR("Null session");
+ return 0;
+ }
+
+ if(t140->started && base->rtp_manager && base->rtp_manager->is_started && t140->encoder.codec) {
+ /* encode */
+ //tsk_size_t out_size = 0;
+
+ if(!base->rtp_manager->is_started) {
+ TSK_DEBUG_ERROR("Not started");
+ return 0;
+ }
+
+ // Open codec if not already done
+ if(!t140->encoder.codec->opened) {
+ tsk_safeobj_lock(base);
+ if((ret = tmedia_codec_open(t140->encoder.codec))) {
+ tsk_safeobj_unlock(base);
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", t140->encoder.codec->plugin->desc);
+ return -4;
+ }
+ tsk_safeobj_unlock(base);
+ }
+
+ ret = _tdav_session_t140_save_outgoing_data(t140, buffer, size);
+
+ // start buffering timer if not already done
+ if(!TSK_TIMER_ID_IS_VALID(t140->encoder.timer_buffering.id)) {
+ TSK_DEBUG_INFO("T.140 - Schedule buffering timer");
+ t140->encoder.timer_buffering.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_buffering.timeout, _tdav_session_t140_timer_cb, t140);
+ }
+
+ //if((t140->encoder.codec = tsk_object_ref(t140->encoder.codec))){ /* Thread safeness (SIP reINVITE or UPDATE could update the encoder) */
+ //out_size = t140->encoder.codec->plugin->encode(t140->encoder.codec, buffer, size, &t140->encoder.buffer, &t140->encoder.buffer_size);
+ //if(out_size){
+ // trtp_manager_send_rtp(base->rtp_manager, t140->encoder.buffer, out_size, TMEDIA_CODEC_PCM_FRAME_SIZE(t140->encoder.codec), tsk_false/*Marker*/, tsk_true/*lastPacket*/);
+ //}
+ //tsk_object_unref(t140->encoder.codec);
+ //}
+ }
+ return ret;
}
// save data before sending (when timer fires)
static int _tdav_session_t140_save_outgoing_data(tdav_session_t140_t* self, const void* data_ptr, tsk_size_t data_size)
{
- tdav_session_av_t* base = (tdav_session_av_t*)self;
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
- if(!self || !data_ptr || !data_size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !data_ptr || !data_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(base);
+ tsk_safeobj_lock(base);
- T140_RESIZE_BUFFER(self->encoder.buffer, self->encoder.buffer_size, (self->encoder.buffer_idx + data_size));
- if(self->encoder.buffer && self->encoder.buffer_size){
- memcpy(&((uint8_t*)self->encoder.buffer)[self->encoder.buffer_idx], data_ptr, data_size);
- self->encoder.buffer_idx += data_size;
- }
+ T140_RESIZE_BUFFER(self->encoder.buffer, self->encoder.buffer_size, (self->encoder.buffer_idx + data_size));
+ if(self->encoder.buffer && self->encoder.buffer_size) {
+ memcpy(&((uint8_t*)self->encoder.buffer)[self->encoder.buffer_idx], data_ptr, data_size);
+ self->encoder.buffer_idx += data_size;
+ }
- tsk_safeobj_unlock(base);
+ tsk_safeobj_unlock(base);
- return 0;
+ return 0;
}
// encapsulated data for sending
static tsk_size_t _tdav_session_t140_encap_red(tdav_session_t140_t* self, void** out_data_ptr, tsk_size_t* out_data_size, tsk_bool_t *last_data)
{
- tdav_session_av_t* base = (tdav_session_av_t*)self;
- t140_block_t* block, *block_curr = tsk_null;
- t140_block_t* red_blocks[T140_BLOCK_MAX_TRANSMIT_COUNT] = { tsk_null };
- tsk_size_t red_blocks_idx, idx, red_blocks_size, red_blocks_hdrs_size;
- tsk_list_item_t* item;
- uint16_t rtp_seq_num;
- uint32_t* pout_data_ptr32;
- uint8_t* pout_data_ptr8;
- static const uint32_t max_transmit_count = T140_BLOCK_MAX_TRANSMIT_COUNT;
-
- if(!self || !base->rtp_manager || !out_data_ptr || !out_data_size || !last_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- *last_data = tsk_false;
-
- tsk_safeobj_lock(base);
- tsk_list_lock(self->encoder.blocks);
-
- // cancel IDLE timer
- if(TSK_TIMER_ID_IS_VALID(self->encoder.timer_idle.id)){
- tsk_timer_manager_cancel(self->h_timer, self->encoder.timer_idle.id);
- self->encoder.timer_idle.id = TSK_INVALID_TIMER_ID;
- TSK_DEBUG_INFO("T.140 - Cancel IDLE timer");
- }
-
- rtp_seq_num = base->rtp_manager->rtp.seq_num;
-
- if(self->encoder.buffer && self->encoder.buffer_idx){
- block_curr = _tdav_session_t140_block_create(self->encoder.payload_type, rtp_seq_num, 0, tsk_false, self->encoder.buffer, self->encoder.buffer_idx);
- self->encoder.buffer_idx = 0;
- }
-
- // build RED blocks
- red_blocks_idx = 0;
- tsk_list_foreach(item, self->encoder.blocks){
- if(!(block = item->data) || (block->transmit_count + 1) >= T140_BLOCK_MAX_TRANSMIT_COUNT){
- continue;
- }
-
- if(block->seq_num <= rtp_seq_num && (idx = (rtp_seq_num - block->seq_num)) < T140_BLOCK_MAX_TRANSMIT_COUNT){
- ++block->transmit_count; // increment transmission count
- red_blocks[(T140_BLOCK_MAX_TRANSMIT_COUNT - idx - 1)] = block; // backwards counting
- ++red_blocks_idx;
- }
-
- if((red_blocks_idx + 1) >= T140_BLOCK_MAX_TRANSMIT_COUNT){
- break;
- }
- }
-
- // compute RED blocks size
- red_blocks_hdrs_size = ((T140_BLOCK_MAX_TRANSMIT_COUNT - 1) << 2) + 1;
- red_blocks_size = red_blocks_hdrs_size;
- for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx){
- if(red_blocks[idx] && red_blocks[idx]->data.ptr && red_blocks[idx]->data.size){
- red_blocks_size += red_blocks[idx]->data.size;
- }
- }
- if(block_curr && block_curr->data.ptr && block_curr->data.size){
- red_blocks_size += block_curr->data.size;
- }
-
- // resize output buffer
- T140_RESIZE_BUFFER(*out_data_ptr, *out_data_size, red_blocks_size);
- if(!*out_data_ptr) {
- red_blocks_size = 0;
- goto bail;
- }
-
- // compute RED headers
- pout_data_ptr32 = (uint32_t*)*out_data_ptr;
- for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx){
- if((idx + 1) == T140_BLOCK_MAX_TRANSMIT_COUNT){ // last header ?
- *((uint8_t*)&pout_data_ptr32[idx]) = (self->encoder.payload_type & 0x7F); // F=0 | PT
- }
- else{
- pout_data_ptr32[idx] = tnet_htonl(
- ( (0x80 | (self->encoder.payload_type & 0x7F)) << 24 ) | // F=1 | PT
- ( 0x0000 << 8 ) | // imestamp offset
- ( red_blocks[idx] ? (red_blocks[idx]->data.size & 0xFF) : 0x00 ) // block length
- );
- }
- }
-
- // compute RED data
- pout_data_ptr8 = &((uint8_t*)*out_data_ptr)[red_blocks_hdrs_size];
- for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx){
- if(red_blocks[idx] && red_blocks[idx]->data.ptr && red_blocks[idx]->data.size){
- memcpy(pout_data_ptr8, red_blocks[idx]->data.ptr, red_blocks[idx]->data.size);
- pout_data_ptr8 += red_blocks[idx]->data.size;
- }
- }
- if(block_curr && block_curr->data.ptr && block_curr->data.size){
- memcpy(pout_data_ptr8, block_curr->data.ptr, block_curr->data.size);
- pout_data_ptr8 += block_curr->data.size;
- }
-
- if((*last_data = (red_blocks_hdrs_size == red_blocks_size))){
- // no data available -> clear items, send empty block, schedule idle timer, cancel buffering timer
- if(TSK_TIMER_ID_IS_VALID(self->encoder.timer_buffering.id)){
- tsk_timer_manager_cancel(self->h_timer, self->encoder.timer_buffering.id);
- self->encoder.timer_buffering.id = TSK_INVALID_TIMER_ID;
- TSK_DEBUG_INFO("T.140 - Cancel buffering timer");
- }
- self->encoder.timer_idle.id = tsk_timer_manager_schedule(self->h_timer, self->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, self);
- TSK_DEBUG_INFO("T.140 - Schedule IDLE timer");
- tsk_list_clear_items(self->encoder.blocks);
- }
- else{
- // clean up all blocks retransmitted more than max times
- while(tsk_list_remove_item_by_pred(self->encoder.blocks, _tdav_session_t140_pred_block_with_transmit_count_more_than_or_equal, &max_transmit_count)) ;
- }
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ t140_block_t* block, *block_curr = tsk_null;
+ t140_block_t* red_blocks[T140_BLOCK_MAX_TRANSMIT_COUNT] = { tsk_null };
+ tsk_size_t red_blocks_idx, idx, red_blocks_size, red_blocks_hdrs_size;
+ tsk_list_item_t* item;
+ uint16_t rtp_seq_num;
+ uint32_t* pout_data_ptr32;
+ uint8_t* pout_data_ptr8;
+ static const uint32_t max_transmit_count = T140_BLOCK_MAX_TRANSMIT_COUNT;
+
+ if(!self || !base->rtp_manager || !out_data_ptr || !out_data_size || !last_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ *last_data = tsk_false;
+
+ tsk_safeobj_lock(base);
+ tsk_list_lock(self->encoder.blocks);
+
+ // cancel IDLE timer
+ if(TSK_TIMER_ID_IS_VALID(self->encoder.timer_idle.id)) {
+ tsk_timer_manager_cancel(self->h_timer, self->encoder.timer_idle.id);
+ self->encoder.timer_idle.id = TSK_INVALID_TIMER_ID;
+ TSK_DEBUG_INFO("T.140 - Cancel IDLE timer");
+ }
+
+ rtp_seq_num = base->rtp_manager->rtp.seq_num;
+
+ if(self->encoder.buffer && self->encoder.buffer_idx) {
+ block_curr = _tdav_session_t140_block_create(self->encoder.payload_type, rtp_seq_num, 0, tsk_false, self->encoder.buffer, self->encoder.buffer_idx);
+ self->encoder.buffer_idx = 0;
+ }
+
+ // build RED blocks
+ red_blocks_idx = 0;
+ tsk_list_foreach(item, self->encoder.blocks) {
+ if(!(block = item->data) || (block->transmit_count + 1) >= T140_BLOCK_MAX_TRANSMIT_COUNT) {
+ continue;
+ }
+
+ if(block->seq_num <= rtp_seq_num && (idx = (rtp_seq_num - block->seq_num)) < T140_BLOCK_MAX_TRANSMIT_COUNT) {
+ ++block->transmit_count; // increment transmission count
+ red_blocks[(T140_BLOCK_MAX_TRANSMIT_COUNT - idx - 1)] = block; // backwards counting
+ ++red_blocks_idx;
+ }
+
+ if((red_blocks_idx + 1) >= T140_BLOCK_MAX_TRANSMIT_COUNT) {
+ break;
+ }
+ }
+
+ // compute RED blocks size
+ red_blocks_hdrs_size = ((T140_BLOCK_MAX_TRANSMIT_COUNT - 1) << 2) + 1;
+ red_blocks_size = red_blocks_hdrs_size;
+ for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx) {
+ if(red_blocks[idx] && red_blocks[idx]->data.ptr && red_blocks[idx]->data.size) {
+ red_blocks_size += red_blocks[idx]->data.size;
+ }
+ }
+ if(block_curr && block_curr->data.ptr && block_curr->data.size) {
+ red_blocks_size += block_curr->data.size;
+ }
+
+ // resize output buffer
+ T140_RESIZE_BUFFER(*out_data_ptr, *out_data_size, red_blocks_size);
+ if(!*out_data_ptr) {
+ red_blocks_size = 0;
+ goto bail;
+ }
+
+ // compute RED headers
+ pout_data_ptr32 = (uint32_t*)*out_data_ptr;
+ for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx) {
+ if((idx + 1) == T140_BLOCK_MAX_TRANSMIT_COUNT) { // last header ?
+ *((uint8_t*)&pout_data_ptr32[idx]) = (self->encoder.payload_type & 0x7F); // F=0 | PT
+ }
+ else {
+ pout_data_ptr32[idx] = tnet_htonl(
+ ( (0x80 | (self->encoder.payload_type & 0x7F)) << 24 ) | // F=1 | PT
+ ( 0x0000 << 8 ) | // imestamp offset
+ ( red_blocks[idx] ? (red_blocks[idx]->data.size & 0xFF) : 0x00 ) // block length
+ );
+ }
+ }
+
+ // compute RED data
+ pout_data_ptr8 = &((uint8_t*)*out_data_ptr)[red_blocks_hdrs_size];
+ for(idx = 0; idx < T140_BLOCK_MAX_TRANSMIT_COUNT; ++idx) {
+ if(red_blocks[idx] && red_blocks[idx]->data.ptr && red_blocks[idx]->data.size) {
+ memcpy(pout_data_ptr8, red_blocks[idx]->data.ptr, red_blocks[idx]->data.size);
+ pout_data_ptr8 += red_blocks[idx]->data.size;
+ }
+ }
+ if(block_curr && block_curr->data.ptr && block_curr->data.size) {
+ memcpy(pout_data_ptr8, block_curr->data.ptr, block_curr->data.size);
+ pout_data_ptr8 += block_curr->data.size;
+ }
+
+ if((*last_data = (red_blocks_hdrs_size == red_blocks_size))) {
+ // no data available -> clear items, send empty block, schedule idle timer, cancel buffering timer
+ if(TSK_TIMER_ID_IS_VALID(self->encoder.timer_buffering.id)) {
+ tsk_timer_manager_cancel(self->h_timer, self->encoder.timer_buffering.id);
+ self->encoder.timer_buffering.id = TSK_INVALID_TIMER_ID;
+ TSK_DEBUG_INFO("T.140 - Cancel buffering timer");
+ }
+ self->encoder.timer_idle.id = tsk_timer_manager_schedule(self->h_timer, self->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, self);
+ TSK_DEBUG_INFO("T.140 - Schedule IDLE timer");
+ tsk_list_clear_items(self->encoder.blocks);
+ }
+ else {
+ // clean up all blocks retransmitted more than max times
+ while(tsk_list_remove_item_by_pred(self->encoder.blocks, _tdav_session_t140_pred_block_with_transmit_count_more_than_or_equal, &max_transmit_count)) ;
+ }
bail:
- if(block_curr){
- _tdav_session_t140_blocks_add(self->encoder.blocks, &self->encoder.blocks_count, &block_curr, INT_MAX);
- TSK_OBJECT_SAFE_FREE(block_curr);
- }
- tsk_list_unlock(self->encoder.blocks);
- tsk_safeobj_unlock(base);
-
- return red_blocks_size;
+ if(block_curr) {
+ _tdav_session_t140_blocks_add(self->encoder.blocks, &self->encoder.blocks_count, &block_curr, INT_MAX);
+ TSK_OBJECT_SAFE_FREE(block_curr);
+ }
+ tsk_list_unlock(self->encoder.blocks);
+ tsk_safeobj_unlock(base);
+
+ return red_blocks_size;
}
// decode data from RTP channel
static int _tdav_session_t140_recv_red(tdav_session_t140_t* self, const struct trtp_rtp_packet_s* packet)
{
- const uint8_t* pdata;
- const uint8_t* red_hdr;
- tsk_size_t red_hdrs_count, i, in_size;
- tsk_bool_t last, block_add;
- uint8_t F, pt;
- int32_t pkt_loss_start = -1, pkt_loss_count, seq_num;
- uint16_t timestamp_offset, block_length;
-
- if(!self || !packet || !packet->header || !(packet->payload.data || packet->payload.data_const) || (packet->payload.size < TDAV_CODEC_RED_MIN_PKT_SIZE)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- pdata = red_hdr = packet->payload.data ? packet->payload.data : packet->payload.data_const;
- in_size = packet->payload.size;
-
- if((F = (pdata[0] & 0x80)) == 0){
- i = 1;
- red_hdrs_count = 1;
- }
- else{
- for(i = 0, red_hdrs_count = 0; i < in_size; i+= 4, ++red_hdrs_count){
- if((F = (pdata[i] & 0x80)) == 0){ ++i; ++red_hdrs_count; break; }
- }
- }
-
- if(i == in_size){
- TSK_DEBUG_INFO("T.140 - Empty block");
- return 0;
- }
-
- pdata += i;
- in_size -= i;
- if(self->decoder.last_seq_num != -1 && (self->decoder.last_seq_num + 1) != packet->header->seq_num){
- pkt_loss_start = (self->decoder.last_seq_num + 1);
- pkt_loss_count = (packet->header->seq_num - pkt_loss_start);
- TSK_DEBUG_INFO("T.140 - Packet loss[curr=%d, loss_start=%d, loss_count=%d]", packet->header->seq_num, pkt_loss_start, pkt_loss_count);
- }
-
- for(i = 0, block_add = tsk_false; i < red_hdrs_count; ++i, block_add = tsk_false){
- last = (i == (red_hdrs_count - 1));
- F = (red_hdr[0] & 0x80);
- pt = (red_hdr[0] & 0x7F);
- if(last || !F){
- /*
- 0 1 2 3 4 5 6 7
+ const uint8_t* pdata;
+ const uint8_t* red_hdr;
+ tsk_size_t red_hdrs_count, i, in_size;
+ tsk_bool_t last, block_add;
+ uint8_t F, pt;
+ int32_t pkt_loss_start = -1, pkt_loss_count, seq_num;
+ uint16_t timestamp_offset, block_length;
+
+ if(!self || !packet || !packet->header || !(packet->payload.data || packet->payload.data_const) || (packet->payload.size < TDAV_CODEC_RED_MIN_PKT_SIZE)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ pdata = red_hdr = packet->payload.data ? packet->payload.data : packet->payload.data_const;
+ in_size = packet->payload.size;
+
+ if((F = (pdata[0] & 0x80)) == 0) {
+ i = 1;
+ red_hdrs_count = 1;
+ }
+ else {
+ for(i = 0, red_hdrs_count = 0; i < in_size; i+= 4, ++red_hdrs_count) {
+ if((F = (pdata[i] & 0x80)) == 0) {
+ ++i;
+ ++red_hdrs_count;
+ break;
+ }
+ }
+ }
+
+ if(i == in_size) {
+ TSK_DEBUG_INFO("T.140 - Empty block");
+ return 0;
+ }
+
+ pdata += i;
+ in_size -= i;
+ if(self->decoder.last_seq_num != -1 && (self->decoder.last_seq_num + 1) != packet->header->seq_num) {
+ pkt_loss_start = (self->decoder.last_seq_num + 1);
+ pkt_loss_count = (packet->header->seq_num - pkt_loss_start);
+ TSK_DEBUG_INFO("T.140 - Packet loss[curr=%d, loss_start=%d, loss_count=%d]", packet->header->seq_num, pkt_loss_start, pkt_loss_count);
+ }
+
+ for(i = 0, block_add = tsk_false; i < red_hdrs_count; ++i, block_add = tsk_false) {
+ last = (i == (red_hdrs_count - 1));
+ F = (red_hdr[0] & 0x80);
+ pt = (red_hdr[0] & 0x7F);
+ if(last || !F) {
+ /*
+ 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|0| Block PT |
+-+-+-+-+-+-+-+-+
- */
- block_length = (uint16_t)in_size;
- seq_num = packet->header->seq_num;
- timestamp_offset = 0;
- block_add = tsk_true;
- }
- else{
- /*
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |1| block PT=7 | timestamp offset | block length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- seq_num = (int32_t)(packet->header->seq_num - (red_hdrs_count - 1 - i)); // inferred by counting backwards
- block_add = (pkt_loss_start != -1 && (seq_num <= pkt_loss_start && pkt_loss_start >= seq_num));
- timestamp_offset = ((red_hdr[1] << 8) | red_hdr[2]) >> 2;
- block_length = ((red_hdr[2] & 0x03) << 8) | red_hdr[3];
- /* block_add &= (block_length > 0); */ // take empty block to avoid scheduling pkt loss timer
- if(pkt_loss_start != -1){
- TSK_DEBUG_INFO("retransmit seq_num=%d, takken=%d", seq_num, block_add);
- }
- if(block_length > in_size){
- TSK_DEBUG_ERROR("Invalid 'block length'");
- break;
- }
- red_hdr += 4;
- }
-
- if(block_add && !_tdav_session_t140_blocks_has_seqnum(self->decoder.blocks, seq_num)){
- t140_block_t* block = _tdav_session_t140_block_create(
- pt,
- seq_num,
- (packet->header->timestamp + timestamp_offset),
- tsk_false,
- pdata,
- block_length);
- _tdav_session_t140_blocks_add(self->decoder.blocks, &self->decoder.blocks_count, &block, T140_BLOCKS_MAX_COUNT);
- TSK_OBJECT_SAFE_FREE(block);
- }
-
-
- pdata += block_length;
- in_size -= block_length;
- }
-
- self->decoder.last_seq_num = packet->header->seq_num;
-
- return _tdav_session_t140_decode_and_deliver_blocks(self, tsk_false);
+ */
+ block_length = (uint16_t)in_size;
+ seq_num = packet->header->seq_num;
+ timestamp_offset = 0;
+ block_add = tsk_true;
+ }
+ else {
+ /*
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |1| block PT=7 | timestamp offset | block length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ seq_num = (int32_t)(packet->header->seq_num - (red_hdrs_count - 1 - i)); // inferred by counting backwards
+ block_add = (pkt_loss_start != -1 && (seq_num <= pkt_loss_start && pkt_loss_start >= seq_num));
+ timestamp_offset = ((red_hdr[1] << 8) | red_hdr[2]) >> 2;
+ block_length = ((red_hdr[2] & 0x03) << 8) | red_hdr[3];
+ /* block_add &= (block_length > 0); */ // take empty block to avoid scheduling pkt loss timer
+ if(pkt_loss_start != -1) {
+ TSK_DEBUG_INFO("retransmit seq_num=%d, takken=%d", seq_num, block_add);
+ }
+ if(block_length > in_size) {
+ TSK_DEBUG_ERROR("Invalid 'block length'");
+ break;
+ }
+ red_hdr += 4;
+ }
+
+ if(block_add && !_tdav_session_t140_blocks_has_seqnum(self->decoder.blocks, seq_num)) {
+ t140_block_t* block = _tdav_session_t140_block_create(
+ pt,
+ seq_num,
+ (packet->header->timestamp + timestamp_offset),
+ tsk_false,
+ pdata,
+ block_length);
+ _tdav_session_t140_blocks_add(self->decoder.blocks, &self->decoder.blocks_count, &block, T140_BLOCKS_MAX_COUNT);
+ TSK_OBJECT_SAFE_FREE(block);
+ }
+
+
+ pdata += block_length;
+ in_size -= block_length;
+ }
+
+ self->decoder.last_seq_num = packet->header->seq_num;
+
+ return _tdav_session_t140_decode_and_deliver_blocks(self, tsk_false);
}
static int _tdav_session_t140_recv_raw(tdav_session_t140_t* self, const void* data_ptr, tsk_size_t data_size)
{
- tsk_size_t i, j, cmd_extra_len, utf8_start, utf8_end;
- tsk_bool_t is_cmd;
- enum tmedia_t140_data_type_e cmd_type;
- const uint8_t* _data_ptr = (const uint8_t*)data_ptr;
-
- if(!self || !data_ptr || !data_size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for(i = 0, j = 0, is_cmd = tsk_false, cmd_extra_len = 0; i < data_size; ++i, is_cmd = tsk_false, cmd_extra_len = 0){
- switch(_data_ptr[i]){
- case T140_BACKSPACE:
- {
- TSK_DEBUG_INFO("T.140 - BACKSPACE");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_backspace;
- break;
- }
- case T140_ESC:
- {
- TSK_DEBUG_INFO("T.140 - ESC");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_esc;
- break;
- }
- case T140_LF:
- {
- TSK_DEBUG_INFO("T.140 - LF");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_lf;
- break;
- }
- case T140_CR:
- {
- if((i + 1) < data_size && _data_ptr[i + 1] == T140_LF){
- // CR_LF
- TSK_DEBUG_INFO("T.140 - CRLF");
- cmd_extra_len = 1;
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_cr_lf;
- }
- else{
- // CR
- TSK_DEBUG_INFO("T.140 - CR");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_cr;
- }
- break;
- }
- case T140_BELL:
- {
- TSK_DEBUG_INFO("T.140 - BELL");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_bell;
- break;
- }
- case T140_SOS:
- {
- TSK_DEBUG_INFO("T.140 - SOS");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_sos;
- break;
- }
- case T140_STRING_TERM:
- {
- TSK_DEBUG_INFO("T.140 - ST");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_string_term;
- break;
- }
- case (T140_LOSS_CHAR_CHAR >> 8):
- {
- if((i + 1) < data_size && _data_ptr[i + 1] == (T140_LOSS_CHAR_CHAR & 0xFF)){
- TSK_DEBUG_INFO("T.140 - LOSS_CHAR_CHAR");
- cmd_extra_len = 1;
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_loss_char_char;
- }
- break;
- }
- case T140_GRAPHIC_START:
- {
- TSK_DEBUG_INFO("T.140 - GRAPHIC_START");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_graphic_start;
- break;
- }
- case T140_GRAPHIC_END:
- {
- TSK_DEBUG_INFO("T.140 - GRAPHIC_END");
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_graphic_end;
- break;
- }
- // case (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 16):
- // case (T140_LOSS_UTF8 >> 16):
- case 0xEF:
- {
- if((i + 2) < data_size && _data_ptr[i + 1] == ((T140_ZERO_WIDTH_NO_BREAK_SPACE >> 8) & 0xFF) && _data_ptr[i + 2] == (T140_ZERO_WIDTH_NO_BREAK_SPACE & 0xFF)){
- TSK_DEBUG_INFO("T.140 - ZERO_WIDTH_NO_BREAK_SPACE");
- cmd_extra_len = 2;
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_zero_width_no_break_space;
- }
- else if((i + 2) < data_size && _data_ptr[i + 1] == ((T140_LOSS_UTF8 >> 8) & 0xFF) && _data_ptr[i + 2] == (T140_LOSS_UTF8 & 0xFF)){
- TSK_DEBUG_INFO("T.140 - LOSS_UTF8");
- cmd_extra_len = 2;
- is_cmd = tsk_true;
- cmd_type = tmedia_t140_data_type_loss_utf8;
- }
- break;
- }
- }//switch
-
- if(is_cmd || ((i + 1) >= data_size)){
- utf8_start = j;
- utf8_end = utf8_start + ( (j < i || (j == i && !is_cmd)) ? (i - j + 1) : 0 );
- if(utf8_start < utf8_end){ // there is utf8 data to deliver
- _tdav_session_t140_consume_data(self, tmedia_t140_data_type_utf8, &_data_ptr[utf8_start], (utf8_end - utf8_start));
- }
- if(is_cmd){ // there is cmd data to deliver
- i += cmd_extra_len;
- _tdav_session_t140_consume_data(self, cmd_type, tsk_null, 0);
- }
- j = i;
- }
- }// for
-
- return 0;
+ tsk_size_t i, j, cmd_extra_len, utf8_start, utf8_end;
+ tsk_bool_t is_cmd;
+ enum tmedia_t140_data_type_e cmd_type;
+ const uint8_t* _data_ptr = (const uint8_t*)data_ptr;
+
+ if(!self || !data_ptr || !data_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for(i = 0, j = 0, is_cmd = tsk_false, cmd_extra_len = 0; i < data_size; ++i, is_cmd = tsk_false, cmd_extra_len = 0) {
+ switch(_data_ptr[i]) {
+ case T140_BACKSPACE: {
+ TSK_DEBUG_INFO("T.140 - BACKSPACE");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_backspace;
+ break;
+ }
+ case T140_ESC: {
+ TSK_DEBUG_INFO("T.140 - ESC");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_esc;
+ break;
+ }
+ case T140_LF: {
+ TSK_DEBUG_INFO("T.140 - LF");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_lf;
+ break;
+ }
+ case T140_CR: {
+ if((i + 1) < data_size && _data_ptr[i + 1] == T140_LF) {
+ // CR_LF
+ TSK_DEBUG_INFO("T.140 - CRLF");
+ cmd_extra_len = 1;
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_cr_lf;
+ }
+ else {
+ // CR
+ TSK_DEBUG_INFO("T.140 - CR");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_cr;
+ }
+ break;
+ }
+ case T140_BELL: {
+ TSK_DEBUG_INFO("T.140 - BELL");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_bell;
+ break;
+ }
+ case T140_SOS: {
+ TSK_DEBUG_INFO("T.140 - SOS");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_sos;
+ break;
+ }
+ case T140_STRING_TERM: {
+ TSK_DEBUG_INFO("T.140 - ST");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_string_term;
+ break;
+ }
+ case (T140_LOSS_CHAR_CHAR >> 8): {
+ if((i + 1) < data_size && _data_ptr[i + 1] == (T140_LOSS_CHAR_CHAR & 0xFF)) {
+ TSK_DEBUG_INFO("T.140 - LOSS_CHAR_CHAR");
+ cmd_extra_len = 1;
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_loss_char_char;
+ }
+ break;
+ }
+ case T140_GRAPHIC_START: {
+ TSK_DEBUG_INFO("T.140 - GRAPHIC_START");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_graphic_start;
+ break;
+ }
+ case T140_GRAPHIC_END: {
+ TSK_DEBUG_INFO("T.140 - GRAPHIC_END");
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_graphic_end;
+ break;
+ }
+ // case (T140_ZERO_WIDTH_NO_BREAK_SPACE >> 16):
+ // case (T140_LOSS_UTF8 >> 16):
+ case 0xEF: {
+ if((i + 2) < data_size && _data_ptr[i + 1] == ((T140_ZERO_WIDTH_NO_BREAK_SPACE >> 8) & 0xFF) && _data_ptr[i + 2] == (T140_ZERO_WIDTH_NO_BREAK_SPACE & 0xFF)) {
+ TSK_DEBUG_INFO("T.140 - ZERO_WIDTH_NO_BREAK_SPACE");
+ cmd_extra_len = 2;
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_zero_width_no_break_space;
+ }
+ else if((i + 2) < data_size && _data_ptr[i + 1] == ((T140_LOSS_UTF8 >> 8) & 0xFF) && _data_ptr[i + 2] == (T140_LOSS_UTF8 & 0xFF)) {
+ TSK_DEBUG_INFO("T.140 - LOSS_UTF8");
+ cmd_extra_len = 2;
+ is_cmd = tsk_true;
+ cmd_type = tmedia_t140_data_type_loss_utf8;
+ }
+ break;
+ }
+ }//switch
+
+ if(is_cmd || ((i + 1) >= data_size)) {
+ utf8_start = j;
+ utf8_end = utf8_start + ( (j < i || (j == i && !is_cmd)) ? (i - j + 1) : 0 );
+ if(utf8_start < utf8_end) { // there is utf8 data to deliver
+ _tdav_session_t140_consume_data(self, tmedia_t140_data_type_utf8, &_data_ptr[utf8_start], (utf8_end - utf8_start));
+ }
+ if(is_cmd) { // there is cmd data to deliver
+ i += cmd_extra_len;
+ _tdav_session_t140_consume_data(self, cmd_type, tsk_null, 0);
+ }
+ j = i;
+ }
+ }// for
+
+ return 0;
}
static int _tdav_session_t140_decode_and_deliver_blocks(tdav_session_t140_t* self, tsk_bool_t called_from_timer)
{
- tdav_session_av_t* base = (tdav_session_av_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(base);
- tsk_list_lock(self->decoder.blocks);
-
- if(!called_from_timer && _tdav_session_t140_blocks_has_gap(self->decoder.blocks)){
- self->decoder.timer_pkt_loss.timeout = (base->red.codec ? T140_WAIT_FOR_MISSING_PKT_RED_ON : T140_WAIT_FOR_MISSING_PKT_RED_OFF);
- self->decoder.timer_pkt_loss.id = tsk_timer_manager_schedule(self->h_timer, self->decoder.timer_pkt_loss.timeout, _tdav_session_t140_timer_cb, self);
- }
- else{
- const tsk_list_item_t* item;
- const t140_block_t* block;
-
- tsk_list_foreach(item, self->decoder.blocks){
- if(!(block = (const t140_block_t*)item->data) || block->delivered || block->too_late){
- continue;
- }
- if(block->data.ptr && block->data.size){
- _tdav_session_t140_recv_raw(self, block->data.ptr, block->data.size);
- }
- ((t140_block_t*)block)->delivered = tsk_true;
- }
- }
-
- tsk_list_unlock(self->decoder.blocks);
- tsk_safeobj_unlock(base);
-
- return 0;
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(base);
+ tsk_list_lock(self->decoder.blocks);
+
+ if(!called_from_timer && _tdav_session_t140_blocks_has_gap(self->decoder.blocks)) {
+ self->decoder.timer_pkt_loss.timeout = (base->red.codec ? T140_WAIT_FOR_MISSING_PKT_RED_ON : T140_WAIT_FOR_MISSING_PKT_RED_OFF);
+ self->decoder.timer_pkt_loss.id = tsk_timer_manager_schedule(self->h_timer, self->decoder.timer_pkt_loss.timeout, _tdav_session_t140_timer_cb, self);
+ }
+ else {
+ const tsk_list_item_t* item;
+ const t140_block_t* block;
+
+ tsk_list_foreach(item, self->decoder.blocks) {
+ if(!(block = (const t140_block_t*)item->data) || block->delivered || block->too_late) {
+ continue;
+ }
+ if(block->data.ptr && block->data.size) {
+ _tdav_session_t140_recv_raw(self, block->data.ptr, block->data.size);
+ }
+ ((t140_block_t*)block)->delivered = tsk_true;
+ }
+ }
+
+ tsk_list_unlock(self->decoder.blocks);
+ tsk_safeobj_unlock(base);
+
+ return 0;
}
static int _tdav_session_t140_consume_data(tdav_session_t140_t* self, enum tmedia_t140_data_type_e data_type, const void *data_ptr, tsk_size_t data_size)
{
- tdav_session_av_t* base = (tdav_session_av_t*)self;
- if(!self || !base->consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- T140_RESIZE_BUFFER(self->decoder.consumer_buffer, self->decoder.consumer_buffer_size, (data_size + 4));
- if(self->decoder.consumer_buffer){
- *((int32_t*)self->decoder.consumer_buffer) = data_type;
- if(data_ptr && data_size){
- memcpy(&((uint8_t*)self->decoder.consumer_buffer)[4], data_ptr, data_size);
- }
- tmedia_consumer_consume(base->consumer, self->decoder.consumer_buffer, (data_size + 4), tsk_null);
- }
- return 0;
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ if(!self || !base->consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ T140_RESIZE_BUFFER(self->decoder.consumer_buffer, self->decoder.consumer_buffer_size, (data_size + 4));
+ if(self->decoder.consumer_buffer) {
+ *((int32_t*)self->decoder.consumer_buffer) = data_type;
+ if(data_ptr && data_size) {
+ memcpy(&((uint8_t*)self->decoder.consumer_buffer)[4], data_ptr, data_size);
+ }
+ tmedia_consumer_consume(base->consumer, self->decoder.consumer_buffer, (data_size + 4), tsk_null);
+ }
+ return 0;
}
static int _tdav_session_t140_pred_block_with_transmit_count_more_than_or_equal(const tsk_list_item_t *item, const void *transmit_count)
{
- if(item && item->data){
- t140_block_t *block = item->data;
- return (block->transmit_count >= *((uint32_t*)transmit_count)) ? 0 : -1;
- }
- return -1;
+ if(item && item->data) {
+ t140_block_t *block = item->data;
+ return (block->transmit_count >= *((uint32_t*)transmit_count)) ? 0 : -1;
+ }
+ return -1;
}
static int _tdav_session_t140_timer_cb(const void* arg, tsk_timer_id_t timer_id)
{
- tdav_session_t140_t* t140 = (tdav_session_t140_t*)arg;
- tdav_session_av_t* base = (tdav_session_av_t*)arg;
- static const tsk_bool_t called_from_timer = tsk_true;
- int ret = 0;
-
- tsk_safeobj_lock(base);
-
- if(timer_id == t140->decoder.timer_pkt_loss.id){
- ret = _tdav_session_t140_decode_and_deliver_blocks(t140, called_from_timer);
- }
- else if(timer_id == t140->encoder.timer_idle.id){
- ret = tdav_session_t140_send_data_2(TMEDIA_SESSION(t140), tmedia_t140_data_type_zero_width_no_break_space);
- t140->encoder.timer_idle.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, t140);
- }
- else if(timer_id == t140->encoder.timer_buffering.id){
- void* buffer_ptr;
- tsk_size_t buffer_size;
- tsk_bool_t was_idle = TSK_TIMER_ID_IS_VALID(t140->encoder.timer_idle.id);
- tsk_bool_t last_data = tsk_false;
- if(base->red.codec){
- // encapsulated red data and schedule timers if required
- buffer_size = _tdav_session_t140_encap_red(t140, &t140->encoder.red_buffer, &t140->encoder.red_buffer_size, &last_data);
- buffer_ptr = t140->encoder.red_buffer;
- }
- else{
- // send buffered data
- buffer_ptr = t140->encoder.buffer;
- buffer_size = t140->encoder.buffer_idx;
- last_data = tsk_true;
- t140->encoder.buffer_idx = 0;
- }
- if(buffer_ptr && buffer_size){
- trtp_manager_send_rtp(base->rtp_manager, buffer_ptr, buffer_size, 300, was_idle, last_data);
- }
- t140->encoder.timer_buffering.id = last_data
- ? TSK_INVALID_TIMER_ID
- : tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_buffering.timeout, _tdav_session_t140_timer_cb, t140);
- }
-
- tsk_safeobj_unlock(base);
-
- return ret;
+ tdav_session_t140_t* t140 = (tdav_session_t140_t*)arg;
+ tdav_session_av_t* base = (tdav_session_av_t*)arg;
+ static const tsk_bool_t called_from_timer = tsk_true;
+ int ret = 0;
+
+ tsk_safeobj_lock(base);
+
+ if(timer_id == t140->decoder.timer_pkt_loss.id) {
+ ret = _tdav_session_t140_decode_and_deliver_blocks(t140, called_from_timer);
+ }
+ else if(timer_id == t140->encoder.timer_idle.id) {
+ ret = tdav_session_t140_send_data_2(TMEDIA_SESSION(t140), tmedia_t140_data_type_zero_width_no_break_space);
+ t140->encoder.timer_idle.id = tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_idle.timeout, _tdav_session_t140_timer_cb, t140);
+ }
+ else if(timer_id == t140->encoder.timer_buffering.id) {
+ void* buffer_ptr;
+ tsk_size_t buffer_size;
+ tsk_bool_t was_idle = TSK_TIMER_ID_IS_VALID(t140->encoder.timer_idle.id);
+ tsk_bool_t last_data = tsk_false;
+ if(base->red.codec) {
+ // encapsulated red data and schedule timers if required
+ buffer_size = _tdav_session_t140_encap_red(t140, &t140->encoder.red_buffer, &t140->encoder.red_buffer_size, &last_data);
+ buffer_ptr = t140->encoder.red_buffer;
+ }
+ else {
+ // send buffered data
+ buffer_ptr = t140->encoder.buffer;
+ buffer_size = t140->encoder.buffer_idx;
+ last_data = tsk_true;
+ t140->encoder.buffer_idx = 0;
+ }
+ if(buffer_ptr && buffer_size) {
+ trtp_manager_send_rtp(base->rtp_manager, buffer_ptr, buffer_size, 300, was_idle, last_data);
+ }
+ t140->encoder.timer_buffering.id = last_data
+ ? TSK_INVALID_TIMER_ID
+ : tsk_timer_manager_schedule(t140->h_timer, t140->encoder.timer_buffering.timeout, _tdav_session_t140_timer_cb, t140);
+ }
+
+ tsk_safeobj_unlock(base);
+
+ return ret;
}
@@ -947,96 +938,94 @@ static int _tdav_session_t140_timer_cb(const void* arg, tsk_timer_id_t timer_id)
/* constructor */
static tsk_object_t* tdav_session_t140_ctor(tsk_object_t * self, va_list * app)
{
- tdav_session_t140_t *t140 = self;
- if(t140){
- int ret;
- tdav_session_av_t *base = TDAV_SESSION_AV(self);
-
- /* init() base */
- if((ret = tdav_session_av_init(base, tmedia_t140)) != 0){
- TSK_DEBUG_ERROR("tdav_session_av_init(t140) failed");
- return tsk_null;
- }
-
- /* init() self */
- t140->encoder.timer_buffering.id = t140->decoder.timer_pkt_loss.id = TSK_INVALID_TIMER_ID;
- if(base->producer){
- tmedia_producer_set_enc_callback(base->producer, _tdav_session_t140_producer_enc_cb, t140);
- }
- if(base->consumer){
- }
- if(!(t140->encoder.blocks = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create encoder blocks list");
- return tsk_null;
- }
- if(!(t140->decoder.blocks = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create decoder blocks list");
- return tsk_null;
- }
- if(!(t140->h_timer = tsk_timer_manager_create())){
- TSK_DEBUG_ERROR("Failed to create timer manager");
- return tsk_null;
- }
- }
- return self;
+ tdav_session_t140_t *t140 = self;
+ if(t140) {
+ int ret;
+ tdav_session_av_t *base = TDAV_SESSION_AV(self);
+
+ /* init() base */
+ if((ret = tdav_session_av_init(base, tmedia_t140)) != 0) {
+ TSK_DEBUG_ERROR("tdav_session_av_init(t140) failed");
+ return tsk_null;
+ }
+
+ /* init() self */
+ t140->encoder.timer_buffering.id = t140->decoder.timer_pkt_loss.id = TSK_INVALID_TIMER_ID;
+ if(base->producer) {
+ tmedia_producer_set_enc_callback(base->producer, _tdav_session_t140_producer_enc_cb, t140);
+ }
+ if(base->consumer) {
+ }
+ if(!(t140->encoder.blocks = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create encoder blocks list");
+ return tsk_null;
+ }
+ if(!(t140->decoder.blocks = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create decoder blocks list");
+ return tsk_null;
+ }
+ if(!(t140->h_timer = tsk_timer_manager_create())) {
+ TSK_DEBUG_ERROR("Failed to create timer manager");
+ return tsk_null;
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_session_t140_dtor(tsk_object_t * self)
-{
- tdav_session_t140_t *t140 = self;
- if(t140){
- tdav_session_t140_stop((tmedia_session_t*)t140);
- TSK_OBJECT_SAFE_FREE(t140->h_timer);
- // Do it in this order (deinit self first)
- TSK_OBJECT_SAFE_FREE(t140->encoder.codec);
- TSK_FREE(t140->encoder.buffer);
- TSK_FREE(t140->encoder.red_buffer);
- TSK_OBJECT_SAFE_FREE(t140->encoder.blocks);
- TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
- TSK_FREE(t140->decoder.buffer);
- TSK_FREE(t140->decoder.consumer_buffer);
- TSK_OBJECT_SAFE_FREE(t140->decoder.blocks);
-
- /* deinit base */
- tdav_session_av_deinit(TDAV_SESSION_AV(self));
- }
-
- return self;
+{
+ tdav_session_t140_t *t140 = self;
+ if(t140) {
+ tdav_session_t140_stop((tmedia_session_t*)t140);
+ TSK_OBJECT_SAFE_FREE(t140->h_timer);
+ // Do it in this order (deinit self first)
+ TSK_OBJECT_SAFE_FREE(t140->encoder.codec);
+ TSK_FREE(t140->encoder.buffer);
+ TSK_FREE(t140->encoder.red_buffer);
+ TSK_OBJECT_SAFE_FREE(t140->encoder.blocks);
+ TSK_OBJECT_SAFE_FREE(t140->decoder.codec);
+ TSK_FREE(t140->decoder.buffer);
+ TSK_FREE(t140->decoder.consumer_buffer);
+ TSK_OBJECT_SAFE_FREE(t140->decoder.blocks);
+
+ /* deinit base */
+ tdav_session_av_deinit(TDAV_SESSION_AV(self));
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_t140_def_s =
-{
- sizeof(tdav_session_t140_t),
- tdav_session_t140_ctor,
- tdav_session_t140_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tdav_session_t140_def_s = {
+ sizeof(tdav_session_t140_t),
+ tdav_session_t140_ctor,
+ tdav_session_t140_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tdav_session_t140_plugin_def_s =
-{
- &tdav_session_t140_def_s,
-
- tmedia_t140,
- "text",
-
- tdav_session_t140_set,
- tdav_session_t140_get,
- tdav_session_t140_prepare,
- tdav_session_t140_start,
- tdav_session_t140_pause,
- tdav_session_t140_stop,
-
- /* Audio part */
- {0},
-
- tdav_session_t140_get_lo,
- tdav_session_t140_set_ro,
-
- /* T.140 part */
- {
- tdav_session_t140_set_ondata_cbfn,
- tdav_session_t140_send_data
- }
+static const tmedia_session_plugin_def_t tdav_session_t140_plugin_def_s = {
+ &tdav_session_t140_def_s,
+
+ tmedia_t140,
+ "text",
+
+ tdav_session_t140_set,
+ tdav_session_t140_get,
+ tdav_session_t140_prepare,
+ tdav_session_t140_start,
+ tdav_session_t140_pause,
+ tdav_session_t140_stop,
+
+ /* Audio part */
+ {0},
+
+ tdav_session_t140_get_lo,
+ tdav_session_t140_set_ro,
+
+ /* T.140 part */
+ {
+ tdav_session_t140_set_ondata_cbfn,
+ tdav_session_t140_send_data
+ }
};
const tmedia_session_plugin_def_t *tdav_session_t140_plugin_def_t = &tdav_session_t140_plugin_def_s;
@@ -1045,121 +1034,124 @@ const tmedia_session_plugin_def_t *tdav_session_t140_plugin_def_t = &tdav_sessio
//
static tsk_object_t* t140_block_ctor(tsk_object_t * self, va_list * app)
{
- t140_block_t *block = self;
- if(block){
- }
- return self;
+ t140_block_t *block = self;
+ if(block) {
+ }
+ return self;
}
static tsk_object_t* t140_block_dtor(tsk_object_t * self)
-{
- t140_block_t *block = self;
- if(block){
- TSK_FREE(block->data.ptr);
- }
+{
+ t140_block_t *block = self;
+ if(block) {
+ TSK_FREE(block->data.ptr);
+ }
- return self;
+ return self;
}
static int t140_block_cmp(const tsk_object_t *_b1, const tsk_object_t *_b2)
{
- const t140_block_t *b1 = _b1;
- const t140_block_t *b2 = _b2;
-
- if(b1 && b2){
- return (int)(b1->seq_num - b2->seq_num);
- }
- else if(!b1 && !b2) return 0;
- else return -1;
+ const t140_block_t *b1 = _b1;
+ const t140_block_t *b2 = _b2;
+
+ if(b1 && b2) {
+ return (int)(b1->seq_num - b2->seq_num);
+ }
+ else if(!b1 && !b2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t t140_block_def_s =
-{
- sizeof(t140_block_t),
- t140_block_ctor,
- t140_block_dtor,
- t140_block_cmp,
+static const tsk_object_def_t t140_block_def_s = {
+ sizeof(t140_block_t),
+ t140_block_ctor,
+ t140_block_dtor,
+ t140_block_cmp,
};
const tsk_object_def_t *t140_block_def_t = &t140_block_def_s;
static tsk_bool_t _tdav_session_t140_blocks_has_gap(tdav_session_t140_blocks_L_t* blocks)
{
- if(blocks && !TSK_LIST_IS_EMPTY(blocks)){
- const tsk_list_item_t* item;
- int32_t last_seq_num = -1;
- tsk_bool_t has_gap = tsk_false;
- tsk_list_lock(blocks);
- tsk_list_foreach(item, blocks){
- if(last_seq_num > 0 && ((last_seq_num + 1) != T140_BLOCK(item->data)->seq_num)){
- has_gap = tsk_true;
- }
- last_seq_num = T140_BLOCK(item->data)->seq_num;
- if(has_gap){
- break;
- }
- }
- tsk_list_unlock(blocks);
- return has_gap;
- }
- return tsk_false;
+ if(blocks && !TSK_LIST_IS_EMPTY(blocks)) {
+ const tsk_list_item_t* item;
+ int32_t last_seq_num = -1;
+ tsk_bool_t has_gap = tsk_false;
+ tsk_list_lock(blocks);
+ tsk_list_foreach(item, blocks) {
+ if(last_seq_num > 0 && ((last_seq_num + 1) != T140_BLOCK(item->data)->seq_num)) {
+ has_gap = tsk_true;
+ }
+ last_seq_num = T140_BLOCK(item->data)->seq_num;
+ if(has_gap) {
+ break;
+ }
+ }
+ tsk_list_unlock(blocks);
+ return has_gap;
+ }
+ return tsk_false;
}
static tsk_bool_t _tdav_session_t140_blocks_has_seqnum(tdav_session_t140_blocks_L_t* blocks, uint16_t seq_num)
{
- if(blocks){
- const tsk_list_item_t* item;
- tsk_bool_t has_seqnum = tsk_false;
- tsk_list_lock(blocks);
- tsk_list_foreach(item, blocks){
- if(seq_num == T140_BLOCK(item->data)->seq_num){
- has_seqnum = tsk_true;
- break;
- }
- }
- tsk_list_unlock(blocks);
- return has_seqnum;
- }
- return tsk_false;
+ if(blocks) {
+ const tsk_list_item_t* item;
+ tsk_bool_t has_seqnum = tsk_false;
+ tsk_list_lock(blocks);
+ tsk_list_foreach(item, blocks) {
+ if(seq_num == T140_BLOCK(item->data)->seq_num) {
+ has_seqnum = tsk_true;
+ break;
+ }
+ }
+ tsk_list_unlock(blocks);
+ return has_seqnum;
+ }
+ return tsk_false;
}
static int _tdav_session_t140_blocks_add(tdav_session_t140_blocks_L_t* blocks, int64_t* blocks_count, t140_block_t** block, int64_t blocks_count_max)
{
- if(blocks && blocks_count && block){
- tsk_list_lock(blocks);
- if(tsk_list_push_ascending_data(blocks, (void**)block) == 0){
- if((*blocks_count = (*blocks_count) + 1) > blocks_count_max){
- tsk_list_item_t* first_item = tsk_list_pop_first_item(blocks);
- TSK_OBJECT_SAFE_FREE(first_item);
- }
- }
- tsk_list_unlock(blocks);
- }
- return 0;
+ if(blocks && blocks_count && block) {
+ tsk_list_lock(blocks);
+ if(tsk_list_push_ascending_data(blocks, (void**)block) == 0) {
+ if((*blocks_count = (*blocks_count) + 1) > blocks_count_max) {
+ tsk_list_item_t* first_item = tsk_list_pop_first_item(blocks);
+ TSK_OBJECT_SAFE_FREE(first_item);
+ }
+ }
+ tsk_list_unlock(blocks);
+ }
+ return 0;
}
static t140_block_t* _tdav_session_t140_block_create(uint8_t pt, uint16_t seq_num, uint32_t timestamp, tsk_bool_t delivered, const void* data_ptr, tsk_size_t data_size)
{
- void* _data_ptr = tsk_null;
- t140_block_t* block = tsk_null;
-
- if(data_ptr && data_size){
- if(!(_data_ptr = tsk_malloc(data_size))){
- TSK_DEBUG_ERROR("Failed to alloc data with size = %u", data_size);
- goto bail;
- }
- memcpy(_data_ptr, data_ptr, data_size);
- }
- if(!(block = tsk_object_new(t140_block_def_t))){
- TSK_DEBUG_ERROR("Failed to create new block object");
- goto bail;
- }
- if(_data_ptr){
- block->data.ptr = _data_ptr, _data_ptr = tsk_null;
- block->data.size = data_size;
- }
- block->pt = pt;
- block->seq_num = seq_num;
- block->timestamp = timestamp;
+ void* _data_ptr = tsk_null;
+ t140_block_t* block = tsk_null;
+
+ if(data_ptr && data_size) {
+ if(!(_data_ptr = tsk_malloc(data_size))) {
+ TSK_DEBUG_ERROR("Failed to alloc data with size = %u", data_size);
+ goto bail;
+ }
+ memcpy(_data_ptr, data_ptr, data_size);
+ }
+ if(!(block = tsk_object_new(t140_block_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create new block object");
+ goto bail;
+ }
+ if(_data_ptr) {
+ block->data.ptr = _data_ptr, _data_ptr = tsk_null;
+ block->data.size = data_size;
+ }
+ block->pt = pt;
+ block->seq_num = seq_num;
+ block->timestamp = timestamp;
bail:
- TSK_FREE(_data_ptr);
- return block;
+ TSK_FREE(_data_ptr);
+ return block;
} \ No newline at end of file
diff --git a/tinyDAV/src/tdav.c b/tinyDAV/src/tdav.c
index fedf028..0fa72e8 100755
--- a/tinyDAV/src/tdav.c
+++ b/tinyDAV/src/tdav.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,13 +35,13 @@ static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/
#include "tsk_plugin.h"
# if TDAV_UNDER_WINDOWS
# define TDAV_HAVE_PLUGIN_EXT_WIN32 1
- static struct tsk_plugin_s* __dll_plugin_wasapi = tsk_null; /* Windows Audio Session API (WASAPI): Windows [Vista - 8] */
- static struct tsk_plugin_s* __dll_plugin_dshow = tsk_null; /* DirectShow: Windows [XP - 8] */
- static struct tsk_plugin_s* __dll_plugin_mf = tsk_null; /* Media Foundation and WASAPI : Windows [7 - 8] */
- static struct tsk_plugin_s* __dll_plugin_dd = tsk_null; /* Microsoft Desktop Duplication API : Windows [8 - ] */
- static struct tsk_plugin_s* __dll_plugin_cuda = tsk_null; /* Media Foundation and WASAPI : Windows [XP - 8] */
- static struct tsk_plugin_s* __dll_plugin_audio_dsp = tsk_null; /* Audio DSP, Resampler, AEC, NS, AGC...: Windows [Vista - 8] */
- static struct tsk_plugin_s* __dll_plugin_ipsec_wfp = tsk_null; /* IPSec implementation using WFP (Windows Filtering platform): Windows [Vista - 8] */
+static struct tsk_plugin_s* __dll_plugin_wasapi = tsk_null; /* Windows Audio Session API (WASAPI): Windows [Vista - 8] */
+static struct tsk_plugin_s* __dll_plugin_dshow = tsk_null; /* DirectShow: Windows [XP - 8] */
+static struct tsk_plugin_s* __dll_plugin_mf = tsk_null; /* Media Foundation and WASAPI : Windows [7 - 8] */
+static struct tsk_plugin_s* __dll_plugin_dd = tsk_null; /* Microsoft Desktop Duplication API : Windows [8 - ] */
+static struct tsk_plugin_s* __dll_plugin_cuda = tsk_null; /* Media Foundation and WASAPI : Windows [XP - 8] */
+static struct tsk_plugin_s* __dll_plugin_audio_dsp = tsk_null; /* Audio DSP, Resampler, AEC, NS, AGC...: Windows [Vista - 8] */
+static struct tsk_plugin_s* __dll_plugin_ipsec_wfp = tsk_null; /* IPSec implementation using WFP (Windows Filtering platform): Windows [Vista - 8] */
# endif /* TDAV_UNDER_WINDOWS */
#endif
@@ -141,7 +141,7 @@ static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/
// Audio/Video JitterBuffer
#if HAVE_SPEEX_DSP && HAVE_SPEEX_JB
# include "tinydav/audio/tdav_speex_jitterbuffer.h"
-#else
+#else
# include "tinydav/audio/tdav_speakup_jitterbuffer.h"
#endif
@@ -155,401 +155,402 @@ static inline tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const t
int tdav_init()
{
- int ret = 0;
-
- if(__b_initialized){
- TSK_DEBUG_INFO("TINYDAV already initialized");
- return 0;
- }
-
- /* === OS specific === */
+ int ret = 0;
+
+ if(__b_initialized) {
+ TSK_DEBUG_INFO("TINYDAV already initialized");
+ return 0;
+ }
+
+ /* === OS specific === */
#if TDAV_UNDER_WINDOWS
- if ((ret = tdav_win32_init())) {
- return ret;
- }
+ if ((ret = tdav_win32_init())) {
+ return ret;
+ }
#elif TDAV_UNDER_APPLE
- if ((ret = tdav_apple_init())) {
- return ret;
- }
+ if ((ret = tdav_apple_init())) {
+ return ret;
+ }
#endif
-
- /* === Initialize ffmpeg === */
+
+ /* === Initialize ffmpeg === */
#if HAVE_FFMPEG
# if LIBAVCODEC_VERSION_MAJOR <= 53
- avcodec_init();
+ avcodec_init();
# endif
#endif
- /* === stand-alone plugins === */
+ /* === stand-alone plugins === */
#if TDAV_HAVE_PLUGIN_EXT_WIN32
- {
- tsk_size_t plugins_count = 0;
- char* full_path = tsk_null; // Loading plugins from ActiveX fails when using relative path.
- /* WASAPI (Audio consumer, Audio producer) */
+ {
+ tsk_size_t plugins_count = 0;
+ char* full_path = tsk_null; // Loading plugins from ActiveX fails when using relative path.
+ /* WASAPI (Audio consumer, Audio producer) */
#if 0 // disable WASAPI by default (AEC issue because of code#consumer rate mismatch)
- if(tdav_win32_is_winvista_or_later()){
- tsk_sprintf(&full_path, "%s/pluginWASAPI.dll", tdav_get_current_directory_const());
- if(tsk_plugin_file_exist(full_path) && (__dll_plugin_wasapi = tsk_plugin_create(full_path))){
- plugins_count += tmedia_plugin_register(__dll_plugin_wasapi, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
- }
-#endif
- /* CUDA (H.264 codec) */
+ if(tdav_win32_is_winvista_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginWASAPI.dll", tdav_get_current_directory_const());
+ if(tsk_plugin_file_exist(full_path) && (__dll_plugin_wasapi = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_wasapi, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+ }
+#endif
+ /* CUDA (H.264 codec) */
#if 1 // Enable CUDA by default
- tsk_sprintf(&full_path, "%s/pluginCUDA.dll", tdav_get_current_directory_const()); // CUDA works on all Windows versions
- if(tsk_plugin_file_exist(full_path) && (__dll_plugin_cuda = tsk_plugin_create(full_path))){
- plugins_count += tmedia_plugin_register(__dll_plugin_cuda, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
-#endif
- /* Microsoft Desktop Duplication API (Screen capture) */
- if (tdav_win32_is_win8_or_later()){
- tsk_sprintf(&full_path, "%s/pluginWinDD.dll", tdav_get_current_directory_const());
- if (tsk_plugin_file_exist(full_path) && (__dll_plugin_dd = tsk_plugin_create(full_path))){
- plugins_count += tmedia_plugin_register(__dll_plugin_dd, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
- }
-
- /* Media Foundation (Video converter, Video consumer, Video producer, Microsoft H.264 codec, Intel Quick Sync H.264 codec) */
- if(tdav_win32_is_win7_or_later()){
- tsk_sprintf(&full_path, "%s/pluginWinMF.dll", tdav_get_current_directory_const());
- if(tsk_plugin_file_exist(full_path) && (__dll_plugin_mf = tsk_plugin_create(full_path))){
- plugins_count += tmedia_plugin_register(__dll_plugin_mf, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
- }
- /* DirectShow (Video consumer, Video producer) */
- if (tdav_win32_is_winxp_or_later()) {
- tsk_sprintf(&full_path, "%s/pluginDirectShow.dll", tdav_get_current_directory_const());
- if (tsk_plugin_file_exist(full_path) && (__dll_plugin_dshow = tsk_plugin_create(full_path))) {
- plugins_count += tmedia_plugin_register(__dll_plugin_dshow, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
- }
- /* Audio DSP (Resampler, AEC, NS, AGC...) */
- if (tdav_win32_is_winvista_or_later()){
- tsk_sprintf(&full_path, "%s/pluginWinAudioDSP.dll", tdav_get_current_directory_const());
- if(tsk_plugin_file_exist(full_path) && (__dll_plugin_audio_dsp = tsk_plugin_create(full_path))) {
- plugins_count += tmedia_plugin_register(__dll_plugin_audio_dsp, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
- }
- }
- /* IPSec implementation using Windows Filtering Platform (WFP) */
+ tsk_sprintf(&full_path, "%s/pluginCUDA.dll", tdav_get_current_directory_const()); // CUDA works on all Windows versions
+ if(tsk_plugin_file_exist(full_path) && (__dll_plugin_cuda = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_cuda, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+#endif
+ /* Microsoft Desktop Duplication API (Screen capture) */
+ if (tdav_win32_is_win8_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginWinDD.dll", tdav_get_current_directory_const());
+ if (tsk_plugin_file_exist(full_path) && (__dll_plugin_dd = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_dd, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+ }
+
+ /* Media Foundation (Video converter, Video consumer, Video producer, Microsoft H.264 codec, Intel Quick Sync H.264 codec) */
+ if(tdav_win32_is_win7_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginWinMF.dll", tdav_get_current_directory_const());
+ if(tsk_plugin_file_exist(full_path) && (__dll_plugin_mf = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_mf, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+ }
+ /* DirectShow (Video consumer, Video producer) */
+ if (tdav_win32_is_winxp_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginDirectShow.dll", tdav_get_current_directory_const());
+ if (tsk_plugin_file_exist(full_path) && (__dll_plugin_dshow = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_dshow, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+ }
+ /* Audio DSP (Resampler, AEC, NS, AGC...) */
+ if (tdav_win32_is_winvista_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginWinAudioDSP.dll", tdav_get_current_directory_const());
+ if(tsk_plugin_file_exist(full_path) && (__dll_plugin_audio_dsp = tsk_plugin_create(full_path))) {
+ plugins_count += tmedia_plugin_register(__dll_plugin_audio_dsp, tsk_plugin_def_type_all, tsk_plugin_def_media_type_all);
+ }
+ }
+ /* IPSec implementation using Windows Filtering Platform (WFP) */
#if !defined(HAVE_TINYIPSEC) || HAVE_TINYIPSEC
- if (tdav_win32_is_winvista_or_later()) {
- tsk_sprintf(&full_path, "%s/pluginWinIPSecVista.dll", tdav_get_current_directory_const());
- if (tsk_plugin_file_exist(full_path) && (tipsec_plugin_register_file(full_path, &__dll_plugin_ipsec_wfp) == 0)) {
- plugins_count += 1; // at least one
- __b_ipsec_supported = tsk_true;
- }
- }
-#endif
-
- TSK_FREE(full_path);
- TSK_DEBUG_INFO("Windows stand-alone plugins loaded = %u", plugins_count);
- }
-#endif
-
- /* === Register media contents === */
- tmedia_content_plugin_register("text/html", tmedia_content_dummy_plugin_def_t);
- tmedia_content_plugin_register("text/plain", tmedia_content_dummy_plugin_def_t);
- tmedia_content_plugin_register("application/octet-stream", tmedia_content_dummy_plugin_def_t);
- tmedia_content_plugin_register("message/CPIM", tmedia_content_cpim_plugin_def_t);
- /* To be implemented
- tmedia_content_plugin_register("message/sipfrag", tmedia_content_sipfrag_plugin_def_t);
- tmedia_content_plugin_register("multipart/digest", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/mixed", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/related", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/alternative", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/encrypted", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/parallel", tmedia_content_multipart_plugin_def_t);
- tmedia_content_plugin_register("multipart/signed", tmedia_content_multipart_plugin_def_t);
- */
-
- /* === Register sessions === */
- tmedia_session_plugin_register(tmedia_session_ghost_plugin_def_t);
- tmedia_session_plugin_register(tdav_session_audio_plugin_def_t);
- tmedia_session_plugin_register(tdav_session_video_plugin_def_t);
+ if (tdav_win32_is_winvista_or_later()) {
+ tsk_sprintf(&full_path, "%s/pluginWinIPSecVista.dll", tdav_get_current_directory_const());
+ if (tsk_plugin_file_exist(full_path) && (tipsec_plugin_register_file(full_path, &__dll_plugin_ipsec_wfp) == 0)) {
+ plugins_count += 1; // at least one
+ __b_ipsec_supported = tsk_true;
+ }
+ }
+#endif
+
+ TSK_FREE(full_path);
+ TSK_DEBUG_INFO("Windows stand-alone plugins loaded = %u", plugins_count);
+ }
+#endif
+
+ /* === Register media contents === */
+ tmedia_content_plugin_register("text/html", tmedia_content_dummy_plugin_def_t);
+ tmedia_content_plugin_register("text/plain", tmedia_content_dummy_plugin_def_t);
+ tmedia_content_plugin_register("application/octet-stream", tmedia_content_dummy_plugin_def_t);
+ tmedia_content_plugin_register("message/CPIM", tmedia_content_cpim_plugin_def_t);
+ /* To be implemented
+ tmedia_content_plugin_register("message/sipfrag", tmedia_content_sipfrag_plugin_def_t);
+ tmedia_content_plugin_register("multipart/digest", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/mixed", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/related", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/alternative", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/encrypted", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/parallel", tmedia_content_multipart_plugin_def_t);
+ tmedia_content_plugin_register("multipart/signed", tmedia_content_multipart_plugin_def_t);
+ */
+
+ /* === Register sessions === */
+ tmedia_session_plugin_register(tmedia_session_ghost_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_audio_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_video_plugin_def_t);
#if !defined(HAVE_TINYMSRP) || HAVE_TINYMSRP
- tmedia_session_plugin_register(tdav_session_msrp_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_msrp_plugin_def_t);
#endif
- tmedia_session_plugin_register(tdav_session_t140_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_t140_plugin_def_t);
#if !defined(HAVE_TINYBFCP) || HAVE_TINYBFCP
- tmedia_session_plugin_register(tdav_session_bfcp_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_bfcp_plugin_def_t);
#endif
- tmedia_session_plugin_register(tdav_session_bfcpaudio_plugin_def_t);
- tmedia_session_plugin_register(tdav_session_bfcpvideo_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_bfcpaudio_plugin_def_t);
+ tmedia_session_plugin_register(tdav_session_bfcpvideo_plugin_def_t);
- /* === Register codecs === */
+ /* === Register codecs === */
#if HAVE_FFMPEG
- avcodec_register_all();
+ avcodec_register_all();
#endif
#if !defined(HAVE_TINYMSRP) || HAVE_TINYMSRP
- tmedia_codec_plugin_register(tdav_codec_msrp_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_msrp_plugin_def_t);
#endif
- tmedia_codec_plugin_register(tdav_codec_t140_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_t140_plugin_def_t);
#if !defined(HAVE_TINYBFCP) || HAVE_TINYBFCP
- tmedia_codec_plugin_register(tdav_codec_bfcp_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_bfcp_plugin_def_t);
#endif
- tmedia_codec_plugin_register(tdav_codec_red_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_g711a_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_g711u_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_g722_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_red_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_g711a_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_g711u_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_g722_plugin_def_t);
#if HAVE_OPENCORE_AMR
- tmedia_codec_plugin_register(tdav_codec_amrnb_oa_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_amrnb_be_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_amrnb_oa_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_amrnb_be_plugin_def_t);
#endif
#if HAVE_BV16
- tmedia_codec_plugin_register(tdav_codec_bv16_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_bv16_plugin_def_t);
#endif
#if HAVE_LIBGSM
- tmedia_codec_plugin_register(tdav_codec_gsm_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_gsm_plugin_def_t);
#endif
#if HAVE_ILBC
- tmedia_codec_plugin_register(tdav_codec_ilbc_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_ilbc_plugin_def_t);
#endif
#if HAVE_LIB_SPEEX
- tmedia_codec_plugin_register(tdav_codec_speex_nb_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_speex_wb_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_speex_uwb_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_speex_nb_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_speex_wb_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_speex_uwb_plugin_def_t);
#endif
#if HAVE_LIBOPUS
- tmedia_codec_plugin_register(tdav_codec_opus_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_opus_plugin_def_t);
#endif
#if HAVE_G729
- tmedia_codec_plugin_register(tdav_codec_g729ab_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_g729ab_plugin_def_t);
#endif
- // last: dtmf, ULPFEC and RED
- tmedia_codec_plugin_register(tdav_codec_dtmf_plugin_def_t);
- // tmedia_codec_plugin_register(tdav_codec_ulpfec_plugin_def_t);
- // tmedia_codec_plugin_register(tdav_codec_red_plugin_def_t);
+ // last: dtmf, ULPFEC and RED
+ tmedia_codec_plugin_register(tdav_codec_dtmf_plugin_def_t);
+ // tmedia_codec_plugin_register(tdav_codec_ulpfec_plugin_def_t);
+ // tmedia_codec_plugin_register(tdav_codec_red_plugin_def_t);
#if HAVE_LIBVPX
- tmedia_codec_plugin_register(tdav_codec_vp8_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_vp8_plugin_def_t);
#endif
#if HAVE_CUDA
- #error "Support for H.264 Cuda is deprecated"
- if(tdav_codec_h264_cuda_is_supported()){
- tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp10_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp20_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp30_plugin_def_t);
- }
+#error "Support for H.264 Cuda is deprecated"
+ if(tdav_codec_h264_cuda_is_supported()) {
+ tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp10_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp20_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_cuda_bp30_plugin_def_t);
+ }
+#endif
+#if HAVE_OPENH264
+ tmedia_codec_plugin_register(tdav_codec_h264_cisco_base_plugin_def_t);
#endif
#if HAVE_FFMPEG
- if(tdav_codec_ffmpeg_mp4ves_is_supported()){
- tmedia_codec_plugin_register(tdav_codec_mp4ves_plugin_def_t);
- }
- if(tdav_codec_ffmpeg_h264_is_supported()){
- if(!tmedia_codec_plugin_is_registered_2(tmedia_codec_id_h264_bp)) { // could be already registered by stand alone plugins (e.g. pluginWinMF.DLL)
- tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
- }
- if(!tmedia_codec_plugin_is_registered_2(tmedia_codec_id_h264_mp)) { // could be already registered by stand alone plugins (e.g. pluginWinMF.DLL)
- tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
- }
- }
- tmedia_codec_plugin_register(tdav_codec_h263p_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h263pp_plugin_def_t);
- if(tdav_codec_ffmpeg_theora_is_supported()){
- tmedia_codec_plugin_register(tdav_codec_theora_plugin_def_t);
- }
- tmedia_codec_plugin_register(tdav_codec_h263_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h261_plugin_def_t);
+ if(tdav_codec_ffmpeg_mp4ves_is_supported()) {
+ tmedia_codec_plugin_register(tdav_codec_mp4ves_plugin_def_t);
+ }
+ if(tdav_codec_ffmpeg_h264_is_supported()) {
+ if(!tmedia_codec_plugin_is_registered_2(tmedia_codec_id_h264_bp)) { // could be already registered by stand alone plugins (e.g. pluginWinMF.DLL)
+ tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
+ }
+ if(!tmedia_codec_plugin_is_registered_2(tmedia_codec_id_h264_mp)) { // could be already registered by stand alone plugins (e.g. pluginWinMF.DLL)
+ tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
+ }
+ }
+ tmedia_codec_plugin_register(tdav_codec_h263p_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h263pp_plugin_def_t);
+ if(tdav_codec_ffmpeg_theora_is_supported()) {
+ tmedia_codec_plugin_register(tdav_codec_theora_plugin_def_t);
+ }
+ tmedia_codec_plugin_register(tdav_codec_h263_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h261_plugin_def_t);
#elif HAVE_H264_PASSTHROUGH
- tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
#endif
#if HAVE_INTEL_MEDIA_SDK
- tmedia_codec_plugin_register(tdav_codec_h264_intel_base_plugin_def_t);
- tmedia_codec_plugin_register(tdav_codec_h264_intel_main_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_intel_base_plugin_def_t);
+ tmedia_codec_plugin_register(tdav_codec_h264_intel_main_plugin_def_t);
#endif
-#if HAVE_OPENH264
- tmedia_codec_plugin_register(tdav_codec_h264_cisco_base_plugin_def_t);
-#endif
-
- /* === Register converters === */
- // register several convertors and try them all (e.g. LIBYUV only support to/from I420)
+
+
+ /* === Register converters === */
+ // register several convertors and try them all (e.g. LIBYUV only support to/from I420)
#if HAVE_LIBYUV
- tmedia_converter_video_plugin_register(tdav_converter_video_libyuv_plugin_def_t);
+ tmedia_converter_video_plugin_register(tdav_converter_video_libyuv_plugin_def_t);
#endif
#if HAVE_FFMPEG || HAVE_SWSSCALE
- tmedia_converter_video_plugin_register(tdav_converter_video_ffmpeg_plugin_def_t);
+ tmedia_converter_video_plugin_register(tdav_converter_video_ffmpeg_plugin_def_t);
#endif
- /* === Register consumers === */
- tmedia_consumer_plugin_register(tdav_consumer_t140_plugin_def_t); /* T140 */
+ /* === Register consumers === */
+ tmedia_consumer_plugin_register(tdav_consumer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H
- tmedia_consumer_plugin_register(tdav_consumer_dsound_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_dsound_plugin_def_t);
#elif HAVE_WAVE_API
- tmedia_consumer_plugin_register(tdav_consumer_waveapi_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_waveapi_plugin_def_t);
#elif HAVE_WASAPI
- tmedia_consumer_plugin_register(tdav_consumer_wasapi_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_wasapi_plugin_def_t);
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows GDI
- tmedia_consumer_plugin_register(tdav_consumer_video_gdi_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_video_gdi_plugin_def_t);
#endif
#if HAVE_WINM // Windows Media (WP8)
- tmedia_consumer_plugin_register(tdav_consumer_winm_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_winm_plugin_def_t);
#endif
#if HAVE_ALSA_ASOUNDLIB_H // Linux
- tmedia_consumer_plugin_register(tdav_consumer_alsa_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_alsa_plugin_def_t);
#endif
#if HAVE_LINUX_SOUNDCARD_H // Linux
- tmedia_consumer_plugin_register(tdav_consumer_oss_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_oss_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
- tmedia_consumer_plugin_register(tdav_consumer_audiounit_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_audiounit_plugin_def_t);
#elif HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
- tmedia_consumer_plugin_register(tdav_consumer_audioqueue_plugin_def_t);
+ tmedia_consumer_plugin_register(tdav_consumer_audioqueue_plugin_def_t);
#endif
#if HAVE_OSS_H
- tmedia_consumer_plugin_register(tmedia_consumer_oss_plugin_def_t);
+ tmedia_consumer_plugin_register(tmedia_consumer_oss_plugin_def_t);
#endif
- /* === Register producers === */
- tmedia_producer_plugin_register(tdav_producer_t140_plugin_def_t); /* T140 */
+ /* === Register producers === */
+ tmedia_producer_plugin_register(tdav_producer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H // DirectSound
- tmedia_producer_plugin_register(tdav_producer_dsound_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_dsound_plugin_def_t);
#elif HAVE_WAVE_API // WaveAPI
- tmedia_producer_plugin_register(tdav_producer_waveapi_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_waveapi_plugin_def_t);
#elif HAVE_WASAPI // WASAPI
- tmedia_producer_plugin_register(tdav_producer_wasapi_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_wasapi_plugin_def_t);
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows DirectDraw (DirectX)
- if (tdav_producer_screencast_ddraw_plugin_is_supported()) {
- tmedia_producer_plugin_register(tdav_producer_screencast_ddraw_plugin_def_t);
- }
+ if (tdav_producer_screencast_ddraw_plugin_is_supported()) {
+ tmedia_producer_plugin_register(tdav_producer_screencast_ddraw_plugin_def_t);
+ }
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows GDI
- tmedia_producer_plugin_register(tdav_producer_screencast_gdi_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_screencast_gdi_plugin_def_t);
#endif
#if HAVE_WINM // Windows Media (WP8)
- tmedia_producer_plugin_register(tdav_producer_winm_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_winm_plugin_def_t);
#endif
#if HAVE_ALSA_ASOUNDLIB_H // Linux
- tmedia_producer_plugin_register(tdav_producer_alsa_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_alsa_plugin_def_t);
#endif
#if HAVE_LINUX_SOUNDCARD_H // Linux
- tmedia_producer_plugin_register(tdav_producer_oss_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_oss_plugin_def_t);
#endif
#if HAVE_LINUX_VIDEODEV2_H // V4L2 (Linux)
- tmedia_producer_plugin_register(tdav_producer_video_v4l2_plugin_def_t);
- tmedia_producer_plugin_register(tdav_producer_screencast_v4l2_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_video_v4l2_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_screencast_v4l2_plugin_def_t);
#endif
-
+
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
- tmedia_producer_plugin_register(tdav_producer_audiounit_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_audiounit_plugin_def_t);
#elif HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
- tmedia_producer_plugin_register(tdav_producer_audioqueue_plugin_def_t);
+ tmedia_producer_plugin_register(tdav_producer_audioqueue_plugin_def_t);
#endif
- /* === Register Audio Denoise (AGC, VAD, Noise Suppression and AEC) === */
+ /* === Register Audio Denoise (AGC, VAD, Noise Suppression and AEC) === */
#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE)
- tmedia_denoise_plugin_register(tdav_webrtc_denoise_plugin_def_t);
+ tmedia_denoise_plugin_register(tdav_webrtc_denoise_plugin_def_t);
#endif
#if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_DENOISE) || HAVE_SPEEX_DENOISE)
- tmedia_denoise_plugin_register(tdav_speex_denoise_plugin_def_t);
+ tmedia_denoise_plugin_register(tdav_speex_denoise_plugin_def_t);
#endif
- /* === Register Audio Resampler === */
+ /* === Register Audio Resampler === */
#if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_RESAMPLER) || HAVE_SPEEX_RESAMPLER)
- tmedia_resampler_plugin_register(tdav_speex_resampler_plugin_def_t);
+ tmedia_resampler_plugin_register(tdav_speex_resampler_plugin_def_t);
#endif
- /* === Register Audio/video JitterBuffer === */
+ /* === Register Audio/video JitterBuffer === */
#if HAVE_SPEEX_DSP && HAVE_SPEEX_JB
- tmedia_jitterbuffer_plugin_register(tdav_speex_jitterbuffer_plugin_def_t);
+ tmedia_jitterbuffer_plugin_register(tdav_speex_jitterbuffer_plugin_def_t);
#else
- tmedia_jitterbuffer_plugin_register(tdav_speakup_jitterbuffer_plugin_def_t);
+ tmedia_jitterbuffer_plugin_register(tdav_speakup_jitterbuffer_plugin_def_t);
#endif
- // collect all codecs before filtering
- _tdav_codec_plugins_collect();
+ // collect all codecs before filtering
+ _tdav_codec_plugins_collect();
- __b_initialized = tsk_true;
+ __b_initialized = tsk_true;
- return ret;
+ return ret;
}
int tdav_codec_set_priority(tdav_codec_id_t codec_id, int priority)
{
- tsk_size_t i;
-
- if(priority < 0){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- for(i = 0; i < __codec_plugins_all_count && __codec_plugins_all[i]; ++i){
- if(__codec_plugins_all[i]->codec_id == codec_id){
- const struct tmedia_codec_plugin_def_s *codec_decl_1, *codec_decl_2;
- priority = TSK_MIN(priority, (int)__codec_plugins_all_count-1);
- codec_decl_1 = __codec_plugins_all[priority];
- codec_decl_2 = __codec_plugins_all[i];
-
- __codec_plugins_all[i] = codec_decl_1;
- __codec_plugins_all[priority] = codec_decl_2;
-
- // change priority if already registered and supported
- if(_tdav_codec_is_supported((tdav_codec_id_t)codec_decl_2->codec_id, codec_decl_2) && tmedia_codec_plugin_is_registered(codec_decl_2)){
- return tmedia_codec_plugin_register_2(codec_decl_2, priority);
- }
- return 0;
- }
- }
-
- TSK_DEBUG_INFO("Cannot find codec with id=%d for priority setting", codec_id);
- return 0;
+ tsk_size_t i;
+
+ if(priority < 0) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ for(i = 0; i < __codec_plugins_all_count && __codec_plugins_all[i]; ++i) {
+ if(__codec_plugins_all[i]->codec_id == codec_id) {
+ const struct tmedia_codec_plugin_def_s *codec_decl_1, *codec_decl_2;
+ priority = TSK_MIN(priority, (int)__codec_plugins_all_count-1);
+ codec_decl_1 = __codec_plugins_all[priority];
+ codec_decl_2 = __codec_plugins_all[i];
+
+ __codec_plugins_all[i] = codec_decl_1;
+ __codec_plugins_all[priority] = codec_decl_2;
+
+ // change priority if already registered and supported
+ if(_tdav_codec_is_supported((tdav_codec_id_t)codec_decl_2->codec_id, codec_decl_2) && tmedia_codec_plugin_is_registered(codec_decl_2)) {
+ return tmedia_codec_plugin_register_2(codec_decl_2, priority);
+ }
+ return 0;
+ }
+ }
+
+ TSK_DEBUG_INFO("Cannot find codec with id=%d for priority setting", codec_id);
+ return 0;
}
int tdav_set_codecs(tdav_codec_id_t codecs)
{
- tsk_size_t i, prio;
-
- // unregister all codecs
- tmedia_codec_plugin_unregister_all();
- // register "selected" and "fake" codecs. "fake" codecs have "none" as id (e.g. MSRP or DTMF)
- for(i=0,prio=0; i<__codec_plugins_all_count && __codec_plugins_all[i]; ++i){
- if((codecs & __codec_plugins_all[i]->codec_id) || __codec_plugins_all[i]->codec_id == tmedia_codec_id_none){
- if(_tdav_codec_is_supported((tdav_codec_id_t)__codec_plugins_all[i]->codec_id, __codec_plugins_all[i])){
- tmedia_codec_plugin_register_2(__codec_plugins_all[i], (int)prio++);
- }
- }
- }
- return 0;
+ tsk_size_t i, prio;
+
+ // unregister all codecs
+ tmedia_codec_plugin_unregister_all();
+ // register "selected" and "fake" codecs. "fake" codecs have "none" as id (e.g. MSRP or DTMF)
+ for(i=0,prio=0; i<__codec_plugins_all_count && __codec_plugins_all[i]; ++i) {
+ if((codecs & __codec_plugins_all[i]->codec_id) || __codec_plugins_all[i]->codec_id == tmedia_codec_id_none) {
+ if(_tdav_codec_is_supported((tdav_codec_id_t)__codec_plugins_all[i]->codec_id, __codec_plugins_all[i])) {
+ tmedia_codec_plugin_register_2(__codec_plugins_all[i], (int)prio++);
+ }
+ }
+ }
+ return 0;
}
static inline int _tdav_codec_plugins_collect()
{
#if defined(_MSC_VER) // TODO: Why next code crash on CentOS64 when built with debug enabled ("-g -O0")
- const struct tmedia_codec_plugin_def_s* (* plugins)[TMED_CODEC_MAX_PLUGINS];
- tsk_size_t i, count;
- int ret;
- static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/sizeof(__codec_plugins_all[0]);
-
- ret = _tdav_codec_plugins_disperse();
- if((ret = tmedia_codec_plugin_registered_get_all(&plugins, &count)) == 0) {
- for(i = 0; i < count && i < __codec_plugins_all_count; ++i) {
- __codec_plugins_all[i] = (*plugins)[i];
- }
- }
- return 0;
+ const struct tmedia_codec_plugin_def_s* (* plugins)[TMED_CODEC_MAX_PLUGINS];
+ tsk_size_t i, count;
+ int ret;
+ static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/sizeof(__codec_plugins_all[0]);
+
+ ret = _tdav_codec_plugins_disperse();
+ if((ret = tmedia_codec_plugin_registered_get_all(&plugins, &count)) == 0) {
+ for(i = 0; i < count && i < __codec_plugins_all_count; ++i) {
+ __codec_plugins_all[i] = (*plugins)[i];
+ }
+ }
+ return 0;
#else
- extern const tmedia_codec_plugin_def_t* __tmedia_codec_plugins[TMED_CODEC_MAX_PLUGINS];
+ extern const tmedia_codec_plugin_def_t* __tmedia_codec_plugins[TMED_CODEC_MAX_PLUGINS];
- static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/sizeof(__codec_plugins_all[0]);
+ static const tsk_size_t __codec_plugins_all_count = sizeof(__codec_plugins_all)/sizeof(__codec_plugins_all[0]);
- int ret = _tdav_codec_plugins_disperse();
- if (ret == 0) {
- tsk_size_t i, count_max = sizeof(__tmedia_codec_plugins)/sizeof(__tmedia_codec_plugins[0]);
- for(i = 0; i < count_max && i < __codec_plugins_all_count; ++i) {
- __codec_plugins_all[i] = __tmedia_codec_plugins[i];
- }
- }
- return ret;
+ int ret = _tdav_codec_plugins_disperse();
+ if (ret == 0) {
+ tsk_size_t i, count_max = sizeof(__tmedia_codec_plugins)/sizeof(__tmedia_codec_plugins[0]);
+ for(i = 0; i < count_max && i < __codec_plugins_all_count; ++i) {
+ __codec_plugins_all[i] = __tmedia_codec_plugins[i];
+ }
+ }
+ return ret;
#endif
}
static inline int _tdav_codec_plugins_disperse()
{
- memset((void*)__codec_plugins_all, 0, sizeof(__codec_plugins_all));
- return 0;
+ memset((void*)__codec_plugins_all, 0, sizeof(__codec_plugins_all));
+ return 0;
}
@@ -558,13 +559,13 @@ static inline int _tdav_codec_plugins_disperse()
*/
static inline tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const tmedia_codec_plugin_def_t* plugin)
{
- tsk_size_t i;
- for(i = 0; i < __codec_plugins_all_count && __codec_plugins_all[i]; ++i) {
- if((plugin && __codec_plugins_all[i] == plugin) || __codec_plugins_all[i]->codec_id == codec) {
- return tsk_true;
- }
- }
- return tsk_false;
+ tsk_size_t i;
+ for(i = 0; i < __codec_plugins_all_count && __codec_plugins_all[i]; ++i) {
+ if((plugin && __codec_plugins_all[i] == plugin) || __codec_plugins_all[i]->codec_id == codec) {
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
/**
@@ -574,7 +575,7 @@ static inline tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const t
*/
tsk_bool_t tdav_codec_is_supported(tdav_codec_id_t codec)
{
- return _tdav_codec_is_supported(codec, tsk_null);
+ return _tdav_codec_is_supported(codec, tsk_null);
}
/**
@@ -584,7 +585,7 @@ tsk_bool_t tdav_codec_is_supported(tdav_codec_id_t codec)
*/
tsk_bool_t tdav_codec_is_enabled(tdav_codec_id_t codec)
{
- return tmedia_codec_plugin_is_registered_2((tmedia_codec_id_t)codec);
+ return tmedia_codec_plugin_is_registered_2((tmedia_codec_id_t)codec);
}
/**
@@ -593,166 +594,166 @@ tsk_bool_t tdav_codec_is_enabled(tdav_codec_id_t codec)
*/
tsk_bool_t tdav_ipsec_is_supported()
{
- return __b_ipsec_supported;
+ return __b_ipsec_supported;
}
int tdav_deinit()
{
- int ret = 0;
-
- if(!__b_initialized){
- TSK_DEBUG_INFO("TINYDAV not initialized");
- return 0;
- }
-
- /* === OS specific === */
+ int ret = 0;
+
+ if(!__b_initialized) {
+ TSK_DEBUG_INFO("TINYDAV not initialized");
+ return 0;
+ }
+
+ /* === OS specific === */
#if TDAV_UNDER_WINDOWS
- if ((ret = tdav_win32_deinit())) {
- return ret;
- }
+ if ((ret = tdav_win32_deinit())) {
+ return ret;
+ }
#elif TDAV_UNDER_APPLE
- if ((ret = tdav_apple_deinit())) {
- return ret;
- }
-#endif
-
- /* === UnRegister media contents === */
- tmedia_content_plugin_unregister_all();
-
- /* === UnRegister sessions === */
- tmedia_session_plugin_unregister(tmedia_session_ghost_plugin_def_t);
- tmedia_session_plugin_unregister(tdav_session_audio_plugin_def_t);
- tmedia_session_plugin_unregister(tdav_session_video_plugin_def_t);
+ if ((ret = tdav_apple_deinit())) {
+ return ret;
+ }
+#endif
+
+ /* === UnRegister media contents === */
+ tmedia_content_plugin_unregister_all();
+
+ /* === UnRegister sessions === */
+ tmedia_session_plugin_unregister(tmedia_session_ghost_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_audio_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_video_plugin_def_t);
#if !defined(HAVE_TINYMSRP) || HAVE_TINYMSRP
- tmedia_session_plugin_unregister(tdav_session_msrp_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_msrp_plugin_def_t);
#endif
- tmedia_session_plugin_unregister(tdav_session_t140_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_t140_plugin_def_t);
#if !defined(HAVE_TINYBFCP) || HAVE_TINYBFCP
- tmedia_session_plugin_unregister(tdav_session_bfcp_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_bfcp_plugin_def_t);
#endif
- tmedia_session_plugin_unregister(tdav_session_bfcpaudio_plugin_def_t);
- tmedia_session_plugin_unregister(tdav_session_bfcpvideo_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_bfcpaudio_plugin_def_t);
+ tmedia_session_plugin_unregister(tdav_session_bfcpvideo_plugin_def_t);
- /* === UnRegister codecs === */
- tmedia_codec_plugin_unregister_all();
+ /* === UnRegister codecs === */
+ tmedia_codec_plugin_unregister_all();
- /* === unRegister converters === */
+ /* === unRegister converters === */
#if HAVE_LIBYUV
- tmedia_converter_video_plugin_unregister(tdav_converter_video_libyuv_plugin_def_t);
+ tmedia_converter_video_plugin_unregister(tdav_converter_video_libyuv_plugin_def_t);
#endif
#if HAVE_FFMPEG || HAVE_SWSSCALE
- tmedia_converter_video_plugin_unregister(tdav_converter_video_ffmpeg_plugin_def_t);
+ tmedia_converter_video_plugin_unregister(tdav_converter_video_ffmpeg_plugin_def_t);
#endif
- /* === unRegister consumers === */
- tmedia_consumer_plugin_unregister(tdav_consumer_t140_plugin_def_t); /* T140 */
+ /* === unRegister consumers === */
+ tmedia_consumer_plugin_unregister(tdav_consumer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H
- tmedia_consumer_plugin_unregister(tdav_consumer_dsound_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_dsound_plugin_def_t);
#endif
#if HAVE_WAVE_API
- tmedia_consumer_plugin_unregister(tdav_consumer_waveapi_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_waveapi_plugin_def_t);
#endif
#if HAVE_WASAPI
- tmedia_consumer_plugin_unregister(tdav_consumer_wasapi_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_wasapi_plugin_def_t);
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows GDI
- tmedia_consumer_plugin_unregister(tdav_consumer_video_gdi_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_video_gdi_plugin_def_t);
#endif
#if HAVE_WINM // Windows Media (WP8)
- tmedia_consumer_plugin_unregister(tdav_consumer_winm_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_winm_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
- tmedia_consumer_plugin_unregister(tdav_consumer_audiounit_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_audiounit_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
- tmedia_consumer_plugin_unregister(tdav_consumer_audioqueue_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_audioqueue_plugin_def_t);
#endif
#if HAVE_ALSA_ASOUNDLIB_H // Linux
- tmedia_consumer_plugin_unregister(tdav_consumer_alsa_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_alsa_plugin_def_t);
#endif
#if HAVE_LINUX_SOUNDCARD_H // Linux
- tmedia_consumer_plugin_unregister(tdav_consumer_oss_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tdav_consumer_oss_plugin_def_t);
#endif
- /* === UnRegister producers === */
- tmedia_producer_plugin_unregister(tdav_producer_t140_plugin_def_t); /* T140 */
+ /* === UnRegister producers === */
+ tmedia_producer_plugin_unregister(tdav_producer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H // DirectSound
- tmedia_producer_plugin_unregister(tdav_producer_dsound_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_dsound_plugin_def_t);
#endif
#if HAVE_WAVE_API // WaveAPI
- tmedia_producer_plugin_unregister(tdav_producer_waveapi_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_waveapi_plugin_def_t);
#endif
#if HAVE_WASAPI // WASAPI
- tmedia_producer_plugin_unregister(tdav_producer_wasapi_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_wasapi_plugin_def_t);
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows DirectDraw (DirectX)
- tmedia_producer_plugin_unregister(tdav_producer_screencast_ddraw_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_screencast_ddraw_plugin_def_t);
#endif
#if TDAV_UNDER_WINDOWS && !TDAV_UNDER_WINDOWS_RT // Windows GDI
- tmedia_producer_plugin_unregister(tdav_producer_screencast_gdi_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_screencast_gdi_plugin_def_t);
#endif
#if HAVE_WINM // Windows Media (WP8)
- tmedia_producer_plugin_unregister(tdav_producer_winm_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_winm_plugin_def_t);
#endif
#if HAVE_ALSA_ASOUNDLIB_H // Linux
- tmedia_producer_plugin_unregister(tdav_producer_alsa_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_alsa_plugin_def_t);
#endif
#if HAVE_LINUX_SOUNDCARD_H // Linux
- tmedia_producer_plugin_unregister(tdav_producer_oss_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_oss_plugin_def_t);
#endif
#if HAVE_LINUX_VIDEODEV2_H // V4L2 (Linux)
- tmedia_producer_plugin_unregister(tdav_producer_video_v4l2_plugin_def_t);
- tmedia_producer_plugin_unregister(tdav_producer_screencast_v4l2_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_video_v4l2_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_screencast_v4l2_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
- tmedia_producer_plugin_unregister(tdav_producer_audiounit_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_audiounit_plugin_def_t);
#elif HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
- tmedia_producer_plugin_unregister(tdav_producer_audioqueue_plugin_def_t);
+ tmedia_producer_plugin_unregister(tdav_producer_audioqueue_plugin_def_t);
#endif
#if HAVE_OSS_H
- tmedia_consumer_plugin_unregister(tmedia_consumer_oss_plugin_def_t);
+ tmedia_consumer_plugin_unregister(tmedia_consumer_oss_plugin_def_t);
#endif
- /* === UnRegister Audio Denoise (AGC, VAD, Noise Suppression and AEC) === */
+ /* === UnRegister Audio Denoise (AGC, VAD, Noise Suppression and AEC) === */
#if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_DENOISE) || HAVE_SPEEX_DENOISE)
- tmedia_denoise_plugin_unregister(tdav_speex_denoise_plugin_def_t);
+ tmedia_denoise_plugin_unregister(tdav_speex_denoise_plugin_def_t);
#endif
#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE)
- tmedia_denoise_plugin_unregister(tdav_webrtc_denoise_plugin_def_t);
+ tmedia_denoise_plugin_unregister(tdav_webrtc_denoise_plugin_def_t);
#endif
- /* === UnRegister Audio Resampler === */
+ /* === UnRegister Audio Resampler === */
#if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_RESAMPLER) || HAVE_SPEEX_RESAMPLER)
- tmedia_resampler_plugin_unregister(tdav_speex_resampler_plugin_def_t);
+ tmedia_resampler_plugin_unregister(tdav_speex_resampler_plugin_def_t);
#endif
- /* === UnRegister Audio/video JitterBuffer === */
+ /* === UnRegister Audio/video JitterBuffer === */
#if HAVE_SPEEX_DSP && HAVE_SPEEX_JB
- tmedia_jitterbuffer_plugin_unregister(tdav_speex_jitterbuffer_plugin_def_t);
+ tmedia_jitterbuffer_plugin_unregister(tdav_speex_jitterbuffer_plugin_def_t);
#else
- tmedia_jitterbuffer_plugin_unregister(tdav_speakup_jitterbuffer_plugin_def_t);
+ tmedia_jitterbuffer_plugin_unregister(tdav_speakup_jitterbuffer_plugin_def_t);
#endif
- /* === stand-alone plugins === */
+ /* === stand-alone plugins === */
#if TDAV_HAVE_PLUGIN_EXT_WIN32
- {
- TSK_OBJECT_SAFE_FREE(__dll_plugin_cuda);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_wasapi);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_mf);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_dd);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_dshow);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_audio_dsp);
- TSK_OBJECT_SAFE_FREE(__dll_plugin_ipsec_wfp);
- }
+ {
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_cuda);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_wasapi);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_mf);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_dd);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_dshow);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_audio_dsp);
+ TSK_OBJECT_SAFE_FREE(__dll_plugin_ipsec_wfp);
+ }
#endif
- // disperse all collected codecs
- _tdav_codec_plugins_disperse();
+ // disperse all collected codecs
+ _tdav_codec_plugins_disperse();
- __b_initialized = tsk_false;
+ __b_initialized = tsk_false;
- return ret;
+ return ret;
}
diff --git a/tinyDAV/src/tdav_session_av.c b/tinyDAV/src/tdav_session_av.c
index 8c15c18..3140100 100755
--- a/tinyDAV/src/tdav_session_av.c
+++ b/tinyDAV/src/tdav_session_av.c
@@ -88,34 +88,31 @@ static int _tdav_session_av_dtls_set_remote_setup(struct tdav_session_av_s* self
#define SDP_DECLARE_TAG int32_t tag // [1 - *]
#define SDP_TAG(self) ((self) ? *((int32_t*)(self)) : 0)
-typedef enum RTP_PROFILE_E
-{
+typedef enum RTP_PROFILE_E {
RTP_PROFILE_NONE = 0x00,
-
+
RTP_PROFILE_AVP = (1 << 0),
RTP_PROFILE_AVPF = (1 << 1),
-
+
RTP_PROFILE_SECURE = (1 << 2),
RTP_PROFILE_SECURE_SDES = (RTP_PROFILE_SECURE | (1 << 3)),
RTP_PROFILE_SECURE_DTLS = (RTP_PROFILE_SECURE | (1 << 4)),
-
+
RTP_PROFILE_SAVP = (RTP_PROFILE_AVP | RTP_PROFILE_SECURE_SDES),
RTP_PROFILE_SAVPF = (RTP_PROFILE_AVPF | RTP_PROFILE_SECURE_SDES),
-
+
RTP_PROFILE_UDP_TLS_RTP_SAVP = (RTP_PROFILE_AVP | RTP_PROFILE_SECURE_DTLS),
RTP_PROFILE_UDP_TLS_RTP_SAVPF = (RTP_PROFILE_AVPF | RTP_PROFILE_SECURE_DTLS)
}
RTP_PROFILE_T;
-typedef struct RTP_PROFILE_XS
-{
+typedef struct RTP_PROFILE_XS {
enum RTP_PROFILE_E type;
const char* name;
}
RTP_PROFILE_XT;
-static const RTP_PROFILE_XT RTP_PROFILES[] =
-{
+static const RTP_PROFILE_XT RTP_PROFILES[] = {
{ RTP_PROFILE_AVP, "RTP/AVP" },
{ RTP_PROFILE_AVPF, "RTP/AVPF" },
{ RTP_PROFILE_SAVP, "RTP/SAVP" },
@@ -125,8 +122,7 @@ static const RTP_PROFILE_XT RTP_PROFILES[] =
};
#define RTP_PROFILES_COUNT (sizeof(RTP_PROFILES) / sizeof(RTP_PROFILES[0]))
-typedef struct sdp_acap_xs
-{
+typedef struct sdp_acap_xs {
SDP_DECLARE_TAG;
unsigned optional:1; // "e.g. [2]"
unsigned or:1; // "e.g.|2"
@@ -135,16 +131,14 @@ typedef struct sdp_acap_xs
sdp_acap_xt;
typedef sdp_acap_xt sdp_acaps_xt[SDP_CAPS_COUNT_MAX];
-typedef struct sdp_tcap_xs
-{
+typedef struct sdp_tcap_xs {
SDP_DECLARE_TAG;
RTP_PROFILE_T profile;
}
sdp_tcap_xt;
typedef sdp_tcap_xt sdp_tcaps_xt[SDP_CAPS_COUNT_MAX];
-typedef struct sdp_pcfg_xs
-{
+typedef struct sdp_pcfg_xs {
SDP_DECLARE_TAG;
sdp_tcap_xt tcap;
sdp_acaps_xt acaps;
@@ -179,10 +173,9 @@ return i; \
return -1; \
}
-typedef struct tdav_sdp_caps_s
-{
+typedef struct tdav_sdp_caps_s {
TSK_DECLARE_OBJECT;
-
+
sdp_pcfgs_xt local;
sdp_pcfgs_xt remote;
sdp_acfg_xt acfg;
@@ -211,8 +204,8 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
{
uint64_t session_id;
tmedia_session_t* base = TMEDIA_SESSION(self);
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -222,9 +215,9 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
return ret;
}
}
-
+
/* base::init(): called by tmedia_session_create() */
-
+
self->media_type = media_type;
self->media_profile = tmedia_defaults_get_profile();
self->use_rtcp = tmedia_defaults_get_rtcp_enabled();
@@ -241,9 +234,9 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
self->srtp_mode = (self->media_profile == tmedia_profile_rtcweb) ? tmedia_srtp_mode_mandatory : tmedia_defaults_get_srtp_mode();
self->use_srtp = (self->srtp_mode == tmedia_srtp_mode_mandatory); // if optional -> negotiate
// remove DTLS-SRTP option if not supported
- if((self->srtp_type & tmedia_srtp_type_dtls) && !tnet_dtls_is_srtp_supported()){
+ if((self->srtp_type & tmedia_srtp_type_dtls) && !tnet_dtls_is_srtp_supported()) {
TSK_DEBUG_WARN("DTLS-SRTP enabled but not supported. Please rebuild the code with this option enabled (requires OpenSSL 1.0.1+)");
- if(!(self->srtp_type &= ~tmedia_srtp_type_dtls)){
+ if(!(self->srtp_type &= ~tmedia_srtp_type_dtls)) {
// only DTLS-SRTP was enabled
self->srtp_mode = tmedia_srtp_mode_none;
self->use_srtp = tsk_false;
@@ -251,77 +244,77 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
}
//!\ DTLS-SRTP requires certificates but do not check right now as it could be defined later
#endif
-
+
tsk_safeobj_init(self);
-
+
// session id
if (!(session_id = TMEDIA_SESSION(self)->id)) { // set the session id if not already done
TMEDIA_SESSION(self)->id = session_id = tmedia_session_get_unique_id();
}
// consumer
TSK_OBJECT_SAFE_FREE(self->consumer);
- if (!(self->consumer = tmedia_consumer_create((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video) ? tmedia_video : tmedia_audio, session_id))){ // get an audio (or video) consumer and ignore "bfcp" part
+ if (!(self->consumer = tmedia_consumer_create((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video) ? tmedia_video : tmedia_audio, session_id))) { // get an audio (or video) consumer and ignore "bfcp" part
TSK_DEBUG_ERROR("Failed to create consumer for media type = %d", self->media_type);
}
// producer
TSK_OBJECT_SAFE_FREE(self->producer);
- if (!(self->producer = tmedia_producer_create(self->media_type, session_id))){
+ if (!(self->producer = tmedia_producer_create(self->media_type, session_id))) {
TSK_DEBUG_ERROR("Failed to create producer for media type = %d", self->media_type);
}
-
+
// sdp caps
TSK_OBJECT_SAFE_FREE(self->sdp_caps);
if (!(self->sdp_caps = tdav_sdp_caps_create())) {
TSK_DEBUG_ERROR("Failed to create SDP caps");
return -1;
}
-
+
// pt mapping (when bypassing is enabled)
self->pt_map.local = self->pt_map.remote = self->pt_map.neg = -1;
-
+
return 0;
}
tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* param)
{
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_false;
}
-
+
// try with base class first
- if(tmedia_session_set_2(TMEDIA_SESSION(self), param)){
+ if(tmedia_session_set_2(TMEDIA_SESSION(self), param)) {
return tsk_true;
}
-
- if(param->plugin_type == tmedia_ppt_consumer && self->consumer){
+
+ if(param->plugin_type == tmedia_ppt_consumer && self->consumer) {
return (tmedia_consumer_set(self->consumer, param) == 0);
}
- else if(param->plugin_type == tmedia_ppt_producer && self->producer){
+ else if(param->plugin_type == tmedia_ppt_producer && self->producer) {
return (tmedia_producer_set(self->producer, param) == 0);
}
- else if(param->plugin_type == tmedia_ppt_session){
- if(param->value_type == tmedia_pvt_pchar){
- if(tsk_striequals(param->key, "remote-ip")){
- if(param->value){
+ else if(param->plugin_type == tmedia_ppt_session) {
+ if(param->value_type == tmedia_pvt_pchar) {
+ if(tsk_striequals(param->key, "remote-ip")) {
+ if(param->value) {
tsk_strupdate(&self->remote_ip, (const char*)param->value);
return tsk_true;
}
}
- else if(tsk_striequals(param->key, "local-ip")){
+ else if(tsk_striequals(param->key, "local-ip")) {
tsk_strupdate(&self->local_ip, (const char*)param->value);
return tsk_true;
}
- else if(tsk_striequals(param->key, "local-ipver")){
+ else if(tsk_striequals(param->key, "local-ipver")) {
self->use_ipv6 = tsk_striequals(param->value, "ipv6");
return tsk_true;
}
}
- else if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "srtp-mode")){
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "srtp-mode")) {
#if HAVE_SRTP
self->srtp_mode = (tmedia_srtp_mode_t)TSK_TO_INT32((uint8_t*)param->value);
- if(self->rtp_manager){
+ if(self->rtp_manager) {
trtp_manager_set_srtp_type_local(self->rtp_manager, self->srtp_type, self->srtp_mode);
}
#else
@@ -329,26 +322,26 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
#endif /* HAVE_SRTP */
return tsk_true;
}
- else if(tsk_striequals(param->key, "rtp-ssrc")){
+ else if(tsk_striequals(param->key, "rtp-ssrc")) {
self->rtp_ssrc = *((uint32_t*)param->value);
- if(self->rtp_manager && self->rtp_ssrc){
+ if(self->rtp_manager && self->rtp_ssrc) {
self->rtp_manager->rtp.ssrc.local = self->rtp_ssrc;
}
return tsk_true;
}
- else if(tsk_striequals(param->key, "rtcp-enabled")){
+ else if(tsk_striequals(param->key, "rtcp-enabled")) {
self->use_rtcp = (TSK_TO_INT32((uint8_t*)param->value) != 0);
return tsk_true;
}
- else if(tsk_striequals(param->key, "rtcpmux-enabled")){
+ else if(tsk_striequals(param->key, "rtcpmux-enabled")) {
self->use_rtcpmux = (TSK_TO_INT32((uint8_t*)param->value) != 0);
return tsk_true;
}
- else if(tsk_striequals(param->key, "avpf-mode")){
+ else if(tsk_striequals(param->key, "avpf-mode")) {
self->avpf_mode_set = (tmedia_mode_t)TSK_TO_INT32((uint8_t*)param->value);
return tsk_true;
}
- else if(tsk_striequals(param->key, "webrtc2sip-mode-enabled")){
+ else if(tsk_striequals(param->key, "webrtc2sip-mode-enabled")) {
self->is_webrtc2sip_mode_enabled = (TSK_TO_INT32((uint8_t*)param->value) != 0);
return tsk_true;
}
@@ -369,44 +362,44 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
return tsk_true;
}
}
- else if(param->value_type == tmedia_pvt_pobject){
- if(tsk_striequals(param->key, "natt-ctx")){
+ else if(param->value_type == tmedia_pvt_pobject) {
+ if(tsk_striequals(param->key, "natt-ctx")) {
TSK_OBJECT_SAFE_FREE(self->natt_ctx);
self->natt_ctx = tsk_object_ref(param->value);
return tsk_true;
}
- else if(tsk_striequals(param->key, "ice-ctx")){
+ else if(tsk_striequals(param->key, "ice-ctx")) {
TSK_OBJECT_SAFE_FREE(self->ice_ctx);
self->ice_ctx = tsk_object_ref(param->value);
- if(self->rtp_manager){
+ if(self->rtp_manager) {
trtp_manager_set_ice_ctx(self->rtp_manager, self->ice_ctx);
}
return tsk_true;
}
- else if(tsk_striequals(param->key, "remote-sdp-message")){
+ else if(tsk_striequals(param->key, "remote-sdp-message")) {
TSK_OBJECT_SAFE_FREE(self->remote_sdp);
self->remote_sdp = (struct tsdp_message_s*)tsk_object_ref(param->value);
return tsk_true;
}
- else if(tsk_striequals(param->key, "local-sdp-message")){
+ else if(tsk_striequals(param->key, "local-sdp-message")) {
TSK_OBJECT_SAFE_FREE(self->local_sdp);
self->local_sdp = (struct tsdp_message_s*)tsk_object_ref(param->value);
return tsk_true;
}
}
}
-
+
return tsk_false;
}
tsk_bool_t tdav_session_av_get(tdav_session_av_t* self, tmedia_param_t* param)
{
- if(!self || !param){
+ if(!self || !param) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_false;
}
-
- if (param->plugin_type == tmedia_ppt_session){
+
+ if (param->plugin_type == tmedia_ppt_session) {
if (param->value_type == tmedia_pvt_int32) {
if (tsk_striequals(param->key, "codecs-negotiated")) { // negotiated codecs
tmedia_codecs_L_t* neg_codecs = tsk_object_ref(TMEDIA_SESSION(self)->neg_codecs);
@@ -439,7 +432,7 @@ tsk_bool_t tdav_session_av_get(tdav_session_av_t* self, tmedia_param_t* param)
}
}
}
-
+
return tsk_false;
}
@@ -458,12 +451,17 @@ int tdav_session_av_init_encoder(tdav_session_av_t* self, struct tmedia_codec_s*
}
if (self->pref_size != video->pref_size) {
unsigned width, height;
- if (tmedia_video_get_size(self->pref_size, &width, &height) == 0){
+ if (tmedia_video_get_size(self->pref_size, &width, &height) == 0) {
video->pref_size = self->pref_size;
video->out.width = width;
video->out.height = height;
}
}
+ // QoS metrics default values
+ TMEDIA_SESSION(self)->qos_metrics.video_out_width = video->out.width;
+ TMEDIA_SESSION(self)->qos_metrics.video_out_height = video->out.height;
+ TMEDIA_SESSION(self)->qos_metrics.video_in_width = video->in.width;
+ TMEDIA_SESSION(self)->qos_metrics.video_in_height = video->in.height;
}
return 0;
}
@@ -471,12 +469,12 @@ int tdav_session_av_init_encoder(tdav_session_av_t* self, struct tmedia_codec_s*
int tdav_session_av_prepare(tdav_session_av_t* self)
{
int ret = 0;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* SRTPType */
#if HAVE_SRTP
// Now that SSL certs are defined update SRTPType before creating the RTP manager
@@ -484,11 +482,11 @@ int tdav_session_av_prepare(tdav_session_av_t* self)
self->srtp_type = tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk) ? tmedia_srtp_type_sdes : tmedia_srtp_type_dtls;
}
#endif
-
+
/* set local port */
- if (!self->rtp_manager){
+ if (!self->rtp_manager) {
self->rtp_manager = self->ice_ctx ? trtp_manager_create_2(self->ice_ctx, self->srtp_type, self->srtp_mode)
- : trtp_manager_create(self->use_rtcp, self->local_ip, self->use_ipv6, self->srtp_type, self->srtp_mode);
+ : trtp_manager_create(self->use_rtcp, self->local_ip, self->use_ipv6, self->srtp_type, self->srtp_mode);
}
if (self->rtp_manager) {
const char *webproxy_type = tsk_null, *webproxy_host = tsk_null, *webproxy_login = tsk_null, *webproxy_password = tsk_null;
@@ -502,17 +500,17 @@ int tdav_session_av_prepare(tdav_session_av_t* self)
return ret;
}
if ((ret = tmedia_defaults_get_webproxy_info(&webproxy_type, &webproxy_host, &webproxy_port, &webproxy_login, &webproxy_password))) {
-
+
}
if ((ret = trtp_manager_set_proxy_info(self->rtp_manager, tnet_proxy_type_from_string(webproxy_type), webproxy_host, webproxy_port, webproxy_login, webproxy_password))) {
}
-
+
#if HAVE_SRTP
if (tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk)) {
// DTLS-SRTP requires certificates
- if(self->srtp_type & tmedia_srtp_type_dtls){
+ if(self->srtp_type & tmedia_srtp_type_dtls) {
TSK_DEBUG_WARN("DTLS-SRTP requested but no SSL certificates provided, disabling this option :(");
- if(!(self->srtp_type &= ~tmedia_srtp_type_dtls)){
+ if(!(self->srtp_type &= ~tmedia_srtp_type_dtls)) {
// only DTLS-SRTP was enabled
self->srtp_mode = tmedia_srtp_mode_none;
self->use_srtp = tsk_false;
@@ -521,55 +519,55 @@ int tdav_session_av_prepare(tdav_session_av_t* self)
}
}
}
-
- if ((self->srtp_type & tmedia_srtp_type_dtls) && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)){
- if((ret = trtp_manager_set_dtls_certs(self->rtp_manager, TMEDIA_SESSION(self)->dtls.file_ca, TMEDIA_SESSION(self)->dtls.file_pbk, TMEDIA_SESSION(self)->dtls.file_pvk, TMEDIA_SESSION(self)->dtls.verify))){
+
+ if ((self->srtp_type & tmedia_srtp_type_dtls) && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)) {
+ if((ret = trtp_manager_set_dtls_certs(self->rtp_manager, TMEDIA_SESSION(self)->dtls.file_ca, TMEDIA_SESSION(self)->dtls.file_pbk, TMEDIA_SESSION(self)->dtls.file_pvk, TMEDIA_SESSION(self)->dtls.verify))) {
return ret;
}
}
#endif /* HAVE_SRTP */
- if((ret = trtp_manager_prepare(self->rtp_manager))){
+ if((ret = trtp_manager_prepare(self->rtp_manager))) {
return ret;
}
- if(self->natt_ctx){
- if((ret = trtp_manager_set_natt_ctx(self->rtp_manager, self->natt_ctx))){
+ if(self->natt_ctx) {
+ if((ret = trtp_manager_set_natt_ctx(self->rtp_manager, self->natt_ctx))) {
return ret;
}
}
- if(self->rtp_ssrc){
+ if(self->rtp_ssrc) {
self->rtp_manager->rtp.ssrc.local = self->rtp_ssrc;
}
}
-
-
+
+
/* SRTP */
#if HAVE_SRTP
{
-
+
}
#endif
-
+
/* Consumer will be prepared in tdav_session_audio_start() */
/* Producer will be prepared in tdav_session_audio_start() */
-
+
return ret;
}
int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_codec)
{
int ret;
- if(!self || !best_codec){
+ if(!self || !best_codec) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// RED codec
TSK_OBJECT_SAFE_FREE(self->red.codec);
self->red.payload_type = 0;
- if((self->red.codec = tsk_object_ref((tsk_object_t*)tdav_session_av_get_red_codec(self)))){
+ if((self->red.codec = tsk_object_ref((tsk_object_t*)tdav_session_av_get_red_codec(self)))) {
self->red.payload_type = atoi(self->red.codec->neg_format);
- if(!TMEDIA_CODEC(self->red.codec)->opened){
- if((ret = tmedia_codec_open(self->red.codec))){
+ if(!TMEDIA_CODEC(self->red.codec)->opened) {
+ if((ret = tmedia_codec_open(self->red.codec))) {
TSK_DEBUG_ERROR("Failed to open [%s] codec", self->red.codec->plugin->desc);
return ret;
}
@@ -577,59 +575,64 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
// set RED callback (unencapsulated data)
ret = tdav_codec_red_set_callback((struct tdav_codec_red_s*)self->red.codec, _tdav_session_av_red_cb, self);
}
-
+
// ULPFEC
TSK_OBJECT_SAFE_FREE(self->ulpfec.codec);
self->ulpfec.payload_type = 0;
- if((self->ulpfec.codec = tsk_object_ref((tsk_object_t*)tdav_session_av_get_ulpfec_codec(self)))){
+ if((self->ulpfec.codec = tsk_object_ref((tsk_object_t*)tdav_session_av_get_ulpfec_codec(self)))) {
self->ulpfec.payload_type = atoi(self->ulpfec.codec->neg_format);
- if(!TMEDIA_CODEC(self->ulpfec.codec)->opened){
- if((ret = tmedia_codec_open(self->ulpfec.codec))){
+ if(!TMEDIA_CODEC(self->ulpfec.codec)->opened) {
+ if((ret = tmedia_codec_open(self->ulpfec.codec))) {
TSK_DEBUG_ERROR("Failed to open [%s] codec", self->ulpfec.codec->plugin->desc);
return ret;
}
}
}
- // Check if "RTCP-NACK", "RTC-FIR", "RTCP-GOOG-REMB".... are supported by the selected encoder
- self->is_fb_fir_neg = self->is_fb_nack_neg = self->is_fb_googremb_neg = tsk_false;
- if (TMEDIA_SESSION(self)->M.ro) {
- // a=rtcp-fb:* ccm fir
- // a=rtcp-fb:* nack
- // a=rtcp-fb:* goog-remb
- char attr_fir[256], attr_nack[256], attr_goog_remb[256];
- int index = 0;
- const tsdp_header_A_t* A;
-
- sprintf(attr_fir, "%s ccm fir", best_codec->neg_format);
- sprintf(attr_nack, "%s nack", best_codec->neg_format);
- sprintf(attr_goog_remb, "%s goog-remb", best_codec->neg_format);
-
- while ((A = tsdp_header_M_findA_at(TMEDIA_SESSION(self)->M.ro, "rtcp-fb", index++))) {
- if (!self->is_fb_fir_neg) {
- self->is_fb_fir_neg = (tsk_striequals(A->value, "* ccm fir") || tsk_striequals(A->value, attr_fir));
- }
- if (!self->is_fb_nack_neg) {
- self->is_fb_nack_neg = (tsk_striequals(A->value, "* nack") || tsk_striequals(A->value, attr_nack));
- }
- if (!self->is_fb_googremb_neg) {
- self->is_fb_googremb_neg = (tsk_striequals(A->value, "* goog-remb") || tsk_striequals(A->value, attr_goog_remb));
- }
- }
- }
-
+ // Check if "RTCP-NACK", "RTC-FIR", "RTCP-GOOG-REMB", "RTCP-DOUBS-JCNG".... are supported by the selected encoder
+ self->is_fb_fir_neg = self->is_fb_nack_neg = self->is_fb_googremb_neg = self->is_fb_doubsjcng_neg = tsk_false;
+ if (TMEDIA_SESSION(self)->M.ro) {
+ // a=rtcp-fb:* ccm fir
+ // a=rtcp-fb:* nack
+ // a=rtcp-fb:* goog-remb
+ // a=rtcp-fb:* doubs-jcng
+ char attr_fir[256], attr_nack[256], attr_goog_remb[256], attr_doubs_jcng[256];
+ int index = 0;
+ const tsdp_header_A_t* A;
+
+ sprintf(attr_fir, "%s ccm fir", best_codec->neg_format);
+ sprintf(attr_nack, "%s nack", best_codec->neg_format);
+ sprintf(attr_goog_remb, "%s goog-remb", best_codec->neg_format);
+ sprintf(attr_doubs_jcng, "%s doubs-jcng", best_codec->neg_format);
+
+ while ((A = tsdp_header_M_findA_at(TMEDIA_SESSION(self)->M.ro, "rtcp-fb", index++))) {
+ if (!self->is_fb_fir_neg) {
+ self->is_fb_fir_neg = (tsk_striequals(A->value, "* ccm fir") || tsk_striequals(A->value, attr_fir));
+ }
+ if (!self->is_fb_nack_neg) {
+ self->is_fb_nack_neg = (tsk_striequals(A->value, "* nack") || tsk_striequals(A->value, attr_nack));
+ }
+ if (!self->is_fb_googremb_neg) {
+ self->is_fb_googremb_neg = (tsk_striequals(A->value, "* goog-remb") || tsk_striequals(A->value, attr_goog_remb));
+ }
+ if (!self->is_fb_doubsjcng_neg) {
+ self->is_fb_doubsjcng_neg = (tsk_striequals(A->value, "* doubs-jcng") || tsk_striequals(A->value, attr_doubs_jcng));
+ }
+ }
+ }
+
if (self->rtp_manager) {
int ret;
tmedia_param_t* media_param = tsk_null;
static const int32_t __ByPassIsYes = 1;
static const int32_t __ByPassIsNo = 0;
/* RTP/RTCP manager: use latest information. */
-
+
// set callbacks
#if HAVE_SRTP
ret = trtp_manager_set_dtls_callback(self->rtp_manager, self, _tdav_session_av_srtp_dtls_cb);
#endif /* HAVE_SRTP */
-
+
// network information will be updated when the RTP manager starts if ICE is enabled
ret = trtp_manager_set_rtp_remote(self->rtp_manager, self->remote_ip, self->remote_port);
self->rtp_manager->use_rtcpmux = self->use_rtcpmux;
@@ -637,30 +640,33 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
{
int32_t bandwidth_max_upload_kbps = self->bandwidth_max_upload_kbps;
int32_t bandwidth_max_download_kbps = self->bandwidth_max_download_kbps;
- if((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)){
- if(self->congestion_ctrl_enabled){
+ if ((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)) {
+ if (self->congestion_ctrl_enabled) {
const tmedia_codec_t* best_codec = tdav_session_av_get_best_neg_codec(self); // use for encoding for sure and probably for decoding
- if(TDAV_IS_VIDEO_CODEC(best_codec)){
+ if (TDAV_IS_VIDEO_CODEC(best_codec)) {
// the up bandwidth will be updated once the decode the first frame as the current values (width, height, fps) are not really correct and based on the SDP negotiation
bandwidth_max_download_kbps = TSK_MIN(
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->in.width, TMEDIA_CODEC_VIDEO(best_codec)->in.height, TMEDIA_CODEC_VIDEO(best_codec)->in.fps),
- bandwidth_max_download_kbps);
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->in.width, TMEDIA_CODEC_VIDEO(best_codec)->in.height, TMEDIA_CODEC_VIDEO(best_codec)->in.fps),
+ bandwidth_max_download_kbps);
bandwidth_max_upload_kbps = TSK_MIN(
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->out.width, TMEDIA_CODEC_VIDEO(best_codec)->out.height, TMEDIA_CODEC_VIDEO(best_codec)->out.fps),
- bandwidth_max_upload_kbps);
+ tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->out.width, TMEDIA_CODEC_VIDEO(best_codec)->out.height, TMEDIA_CODEC_VIDEO(best_codec)->out.fps),
+ bandwidth_max_upload_kbps);
}
- else if((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)){
+ else if ((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)) {
bandwidth_max_download_kbps = TSK_MIN(tmedia_get_video_bandwidth_kbps_3(), bandwidth_max_download_kbps);
bandwidth_max_upload_kbps = TSK_MIN(tmedia_get_video_bandwidth_kbps_3(), bandwidth_max_upload_kbps);
}
}
+ else {
+ TSK_DEBUG_WARN("Video congestion control not enabled");
+ }
}
-
+
TSK_DEBUG_INFO("max_bw_up=%d kpbs, max_bw_down=%d kpbs, congestion_ctrl_enabled=%d, media_type=%d", bandwidth_max_upload_kbps, bandwidth_max_download_kbps, self->congestion_ctrl_enabled, self->media_type);
// forward up/down bandwidth info to rctp session (used in RTCP-REMB)
- ret = trtp_manager_set_app_bandwidth_max(self->rtp_manager, bandwidth_max_upload_kbps, bandwidth_max_download_kbps);
+ ret = trtp_manager_set_app_bw_and_jcng(self->rtp_manager, bandwidth_max_upload_kbps, bandwidth_max_download_kbps, 1.f /*jcng_q*/);
}
-
+
// because of AudioUnit under iOS => prepare both consumer and producer then start() at the same time
/* prepare consumer and producer */
// Producer could output encoded frames:
@@ -697,35 +703,39 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
}
}
}
-
+
// Start RTP manager
ret = trtp_manager_start(self->rtp_manager);
-
+
#if HAVE_SRTP
self->use_srtp = trtp_manager_is_srtp_activated(self->rtp_manager);
-
+
/* start consumer and producer */
if (trtp_manager_is_dtls_activated(self->rtp_manager) && !trtp_manager_is_dtls_started(self->rtp_manager)) {
// delay starting util DTLS-SRTP negotiation terminates (handshaking succeed)
TSK_DEBUG_INFO("Delaying consumer/producer starting until DTLS-SRTP negotiation complete");
}
- else{
+ else {
#endif /* HAVE_SRTP */
tsk_safeobj_lock(self);
- if (self->consumer && !self->consumer->is_started) ret = tmedia_consumer_start(self->consumer);
- if (self->producer && !self->producer->is_started) ret = tmedia_producer_start(self->producer);
+ if (self->consumer && !self->consumer->is_started) {
+ ret = tmedia_consumer_start(self->consumer);
+ }
+ if (self->producer && !self->producer->is_started) {
+ ret = tmedia_producer_start(self->producer);
+ }
tsk_safeobj_unlock(self);
#if HAVE_SRTP
}
#endif /* HAVE_SRTP */
-
+
return ret;
}
else {
TSK_DEBUG_ERROR("Invalid RTP/RTCP manager");
return -3;
}
-
+
return 0;
}
@@ -734,61 +744,61 @@ int tdav_session_av_stop(tdav_session_av_t* self)
tmedia_codec_t* codec;
tsk_list_item_t* item;
int ret = 0;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* stop Producer */
if (self->producer) {
ret = tmedia_producer_stop(self->producer);
}
-
+
/* stop RTP/RTCP manager */
if (self->rtp_manager) {
ret = trtp_manager_stop(self->rtp_manager);
}
-
+
/* stop Consumer (after RTP manager to silently discard in coming packets) */
if (self->consumer) {
ret = tmedia_consumer_stop(self->consumer);
}
-
+
/* close codecs to force open() for next start (e.g SIP UPDATE with SDP) */
- if(TMEDIA_SESSION(self)->neg_codecs){
- tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs){
- if(!(codec = TMEDIA_CODEC(item->data))){
+ if(TMEDIA_SESSION(self)->neg_codecs) {
+ tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs) {
+ if(!(codec = TMEDIA_CODEC(item->data))) {
continue;
}
ret = tmedia_codec_close(codec);
}
}
-
+
self->bytes_in.count_last_time = self->bytes_out.count_last_time = 0;
self->bytes_in.count = self->bytes_out.count = 0;
-
+
return ret;
}
int tdav_session_av_pause(tdav_session_av_t* self)
{
int ret = 0;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* Consumer */
- if(self->consumer){
+ if(self->consumer) {
ret = tmedia_consumer_pause(self->consumer);
}
/* Producer */
- if(self->producer){
+ if(self->producer) {
ret = tmedia_producer_pause(self->producer);
}
-
+
return ret;
}
@@ -807,38 +817,37 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsk_bool_t is_srtp_local_mandatory = is_srtp_enable && (self->srtp_mode == tmedia_srtp_mode_mandatory);
tsk_bool_t is_bfcp_session = ((base->type & tmedia_bfcp) == tmedia_bfcp) ? tsk_true : tsk_false;
tsk_bool_t is_first_media;
-
- if(!base || !base->plugin || !updated){
+
+ if(!base || !base->plugin || !updated) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
*updated = tsk_false;
-
- if(!self->rtp_manager || (!self->ice_ctx && !self->rtp_manager->transport)){
- if(self->rtp_manager && (!self->ice_ctx && !self->rtp_manager->transport)){ // reINVITE or UPDATE (manager was destroyed when stoppped)
- if(trtp_manager_prepare(self->rtp_manager)){
+
+ if(!self->rtp_manager || (!self->ice_ctx && !self->rtp_manager->transport)) {
+ if(self->rtp_manager && (!self->ice_ctx && !self->rtp_manager->transport)) { // reINVITE or UPDATE (manager was destroyed when stoppped)
+ if(trtp_manager_prepare(self->rtp_manager)) {
TSK_DEBUG_ERROR("Failed to prepare transport");
return tsk_null;
}
}
- else{
+ else {
TSK_DEBUG_ERROR("RTP/RTCP manager in invalid");
return tsk_null;
}
}
-
+
// only first media will add session-level attributes (e.g. DTLS setup and fingerprint)
- if((is_first_media = !!self->local_sdp)){
+ if((is_first_media = !!self->local_sdp)) {
const tsdp_header_M_t* firstM = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self->local_sdp, tsdp_htype_M, 0);
- if(!(is_first_media = !firstM)){
+ if(!(is_first_media = !firstM)) {
is_first_media = tsk_striequals(TMEDIA_SESSION(self)->plugin->media, firstM->media);
}
}
-
- if(base->ro_changed && base->M.lo){
- static const char* __fields[] =
- {
+
+ if(base->ro_changed && base->M.lo) {
+ static const char* __fields[] = {
/* Codecs */
"fmtp", "rtpmap", "imageattr",
/* QoS */
@@ -858,18 +867,18 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsdp_header_A_removeAll_by_fields(base->M.lo->Attributes, __fields, sizeof(__fields)/sizeof(__fields[0]));
tsk_list_clear_items(base->M.lo->FMTs);
// remove session-level attributes
- if(is_first_media){
+ if(is_first_media) {
// headers: contains all kind of headers but this is a smart function :)
tsdp_header_A_removeAll_by_fields((tsdp_headers_A_L_t*)self->local_sdp->headers, __fields, sizeof(__fields)/sizeof(__fields[0]));
}
}
-
+
*updated = (base->ro_changed || !base->M.lo);
-
- if(!base->M.lo){
- if((base->M.lo = tsdp_header_M_create(base->plugin->media, self->rtp_manager->rtp.public_port, "RTP/AVP"))){
+
+ if(!base->M.lo) {
+ if((base->M.lo = tsdp_header_M_create(base->plugin->media, self->rtp_manager->rtp.public_port, "RTP/AVP"))) {
/* If NATT is active, do not rely on the global IP address Connection line */
- if(self->natt_ctx){
+ if(self->natt_ctx) {
tsdp_header_M_add_headers(base->M.lo,
TSDP_HEADER_C_VA_ARGS("IN", self->use_ipv6 ? "IP6" : "IP4", self->rtp_manager->rtp.public_ip),
tsk_null);
@@ -880,14 +889,14 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
transmit at the specified packetization rate. If a UE receives an "audio" media line which does not have "a=ptime"
specified or the UE does not support the "a=ptime" attribute, the UE should transmit at the default codec packetization
rate as defined in RFC 3551 [55A]. The UE will transmit consistent with the resources available from the network.
-
+
For "video" and "audio" media types that utilize the RTP/RTCP, the UE shall specify the proposed bandwidth for each
media stream utilizing the "b=" media descriptor and the "AS" bandwidth modifier in the SDP.
-
+
The UE shall include the MIME subtype "telephone-event" in the "m=" media descriptor in the SDP for audio media
flows that support both audio codec and DTMF payloads in RTP packets as described in RFC 4733 [23].
*/
- if(self->media_type & tmedia_audio){
+ if(self->media_type & tmedia_audio) {
tsk_istr_t ptime;
tsk_itoa(tmedia_defaults_get_audio_ptime(), &ptime);
tsdp_header_M_add_headers(base->M.lo,
@@ -899,7 +908,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsk_null);
// the "telephone-event" fmt/rtpmap is added below
}
- else if((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)){
+ else if((self->media_type & tmedia_video || (self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)) {
tsk_istr_t session_id;
// https://code.google.com/p/webrtc2sip/issues/detail?id=81
// goog-remb: https://groups.google.com/group/discuss-webrtc/browse_thread/thread/c61ad3487e2acd52
@@ -908,6 +917,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
TSDP_HEADER_A_VA_ARGS("rtcp-fb", "* ccm fir"),
TSDP_HEADER_A_VA_ARGS("rtcp-fb", "* nack"),
TSDP_HEADER_A_VA_ARGS("rtcp-fb", "* goog-remb"),
+ TSDP_HEADER_A_VA_ARGS("rtcp-fb", "* doubs-jcng"),
tsk_null);
// https://tools.ietf.org/html/rfc4574
// http://tools.ietf.org/html/rfc4796
@@ -918,7 +928,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsk_null);
// http://tools.ietf.org/html/rfc3556
// https://tools.ietf.org/html/rfc3890
- if(self->bandwidth_max_download_kbps > 0 && self->bandwidth_max_download_kbps != INT_MAX){ // INT_MAX or <=0 means undefined
+ if(self->bandwidth_max_download_kbps > 0 && self->bandwidth_max_download_kbps != INT_MAX) { // INT_MAX or <=0 means undefined
tsdp_header_M_add_headers(base->M.lo,
TSDP_HEADER_B_VA_ARGS("AS", self->bandwidth_max_download_kbps),
TSDP_HEADER_B_VA_ARGS("TIAS", (self->bandwidth_max_download_kbps << 10)),
@@ -926,48 +936,49 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
}
}
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create lo");
return tsk_null;
}
}
-
- if(*updated){
+
+ if(*updated) {
tmedia_codecs_L_t* neg_codecs = tsk_null;
-
- if(base->M.ro){
+
+ if(base->M.ro) {
TSK_OBJECT_SAFE_FREE(base->neg_codecs);
/* update negociated codecs */
- if((neg_codecs = tmedia_session_match_codec(base, base->M.ro))){
+ if((neg_codecs = tmedia_session_match_codec(base, base->M.ro))) {
base->neg_codecs = neg_codecs;
}
/* from codecs to sdp */
- if(TSK_LIST_IS_EMPTY(base->neg_codecs) || ((base->neg_codecs->tail == base->neg_codecs->head) && TDAV_IS_DTMF_CODEC(TSK_LIST_FIRST_DATA(base->neg_codecs)))){
+ if(TSK_LIST_IS_EMPTY(base->neg_codecs) || ((base->neg_codecs->tail == base->neg_codecs->head) && TDAV_IS_DTMF_CODEC(TSK_LIST_FIRST_DATA(base->neg_codecs)))) {
base->M.lo->port = 0; /* Keep the RTP transport and reuse it when we receive a reINVITE or UPDATE request */
// To reject an offered stream, the port number in the corresponding stream in the answer
// MUST be set to zero. Any media formats listed are ignored. AT LEAST ONE MUST BE PRESENT, AS SPECIFIED BY SDP.
tsk_strupdate(&base->M.lo->proto, base->M.ro->proto);
- if(base->M.ro->FMTs){
+ if(base->M.ro->FMTs) {
tsk_list_pushback_list(base->M.lo->FMTs, base->M.ro->FMTs);
}
TSK_DEBUG_INFO("No codec matching for media type = %d", (int32_t)self->media_type);
goto DONE;
}
- else{
+ else {
tmedia_codec_to_sdp(base->neg_codecs, base->M.lo);
}
}
- else{
+ else {
/* from codecs to sdp */
tmedia_codec_to_sdp(base->codecs, base->M.lo);
}
-
+
/* SRTP */
#if HAVE_SRTP
- { //start-of-HAVE_SRTP
-
+ {
+ //start-of-HAVE_SRTP
+
/* DTLS-SRTP default values */
- if(is_srtp_dtls_enabled){
+ if(is_srtp_dtls_enabled) {
/* "setup" and "connection" */
if (self->dtls.local.setup == tnet_dtls_setup_none || self->dtls.local.setup == tnet_dtls_setup_actpass) { // if setup already negotiated then, use the same
// rfc5763: the caller is server by default
@@ -978,8 +989,8 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
trtp_manager_set_dtls_local_setup(self->rtp_manager, self->dtls.local.setup, self->dtls.local.connection_new);
}
}
-
- if(!base->M.ro){
+
+ if(!base->M.ro) {
// === RO IS NULL ===
const trtp_srtp_ctx_xt *srtp_ctxs[SRTP_CRYPTO_TYPES_MAX] = { tsk_null };
tsk_size_t ctx_count = 0, ctx_idx, acap_tag = 1;
@@ -991,14 +1002,14 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsk_bool_t is_srtp_remote_mandatory = (base->M.ro && _sdp_str_contains(base->M.ro->proto, "SAVP"));
tsk_size_t profiles_index = 0;
RTP_PROFILE_T profiles[RTP_PROFILES_COUNT] = { RTP_PROFILE_NONE };
-
+
// get local SRTP context
- if(is_srtp_sdes_enabled){
+ if(is_srtp_sdes_enabled) {
ctx_count = trtp_srtp_get_local_contexts(self->rtp_manager, (const trtp_srtp_ctx_xt **)&srtp_ctxs, sizeof(srtp_ctxs)/sizeof(srtp_ctxs[0]));
}
-
+
// a=tcap:
- if((negotiate_srtp || negotiate_avpf)){
+ if((negotiate_srtp || negotiate_avpf)) {
static const int32_t __tcap_tag = 1;
char* tcap = tsk_null;
const char* fp_sha1 = tsk_null;
@@ -1007,35 +1018,35 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
#define _first_media_strcat(ppstr, format, ...) if(is_first_media) tsk_strcat_2((ppstr), (format), ##__VA_ARGS__)
#define _first_media_sprintf(ppstr, format, ...) if(is_first_media) tsk_sprintf((ppstr), (format), ##__VA_ARGS__)
#define _first_media_add_headers(sdp, ...) if(is_first_media) tsdp_message_add_headers((sdp), ##__VA_ARGS__)
-
+
_first_media_strcat(&tcap, "%d", __tcap_tag);
-
- if(is_srtp_dtls_enabled){
- if(!tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk)){
+
+ if(is_srtp_dtls_enabled) {
+ if(!tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk)) {
fp_sha1 = trtp_manager_get_dtls_local_fingerprint(self->rtp_manager, tnet_dtls_hash_type_sha1);
fp_sha256 = trtp_manager_get_dtls_local_fingerprint(self->rtp_manager, tnet_dtls_hash_type_sha256);
}
_first_media_strcat(&tcap, negotiate_avpf ? " UDP/TLS/RTP/SAVPF UDP/TLS/RTP/SAVP" : " UDP/TLS/RTP/SAVP");
- if(negotiate_avpf){
+ if(negotiate_avpf) {
profiles[profiles_index++] = RTP_PROFILE_UDP_TLS_RTP_SAVPF;
}
profiles[profiles_index++] = RTP_PROFILE_UDP_TLS_RTP_SAVP;
}
- if(is_srtp_sdes_enabled){
+ if(is_srtp_sdes_enabled) {
_first_media_strcat(&tcap, negotiate_avpf ? " RTP/SAVPF RTP/SAVP" : " RTP/SAVP");
- if(negotiate_avpf){
+ if(negotiate_avpf) {
profiles[profiles_index++] = RTP_PROFILE_SAVPF;
}
profiles[profiles_index++] = RTP_PROFILE_SAVP;
}
-
- if(!is_srtp_local_mandatory){
+
+ if(!is_srtp_local_mandatory) {
_first_media_strcat(&tcap, " RTP/AVPF");
profiles[profiles_index++] = RTP_PROFILE_AVPF;
}
-
+
// DTLS "setup" and "fringerprint"s
- if((fp_sha1 || fp_sha256) && negotiate_srtp){
+ if((fp_sha1 || fp_sha256) && negotiate_srtp) {
char* acap_fp = tsk_null;
acap_tag_setup = 1, acap_tag_connection = 2;
_first_media_sprintf(&str, "%d setup:%s", acap_tag_setup, TNET_DTLS_SETUP_NAMES[self->dtls.local.setup]);
@@ -1046,32 +1057,32 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
_first_media_add_headers(self->local_sdp, TSDP_HEADER_A_VA_ARGS("acap", str), tsk_null);
// New Firefox Nightly repspond with SHA-256 when offered SHA-1 -> It's a bug in FF
// Just use SHA-256 as first choice
- if(fp_sha256){
+ if(fp_sha256) {
_first_media_sprintf(&acap_fp, "3 fingerprint:%s %s", TNET_DTLS_HASH_NAMES[tnet_dtls_hash_type_sha256], fp_sha256);
acap_tag_fp_sha256 = 3;
_first_media_add_headers(self->local_sdp, TSDP_HEADER_A_VA_ARGS("acap", acap_fp), tsk_null);
}
- if(fp_sha1){
+ if(fp_sha1) {
_first_media_sprintf(&acap_fp, "%d fingerprint:%s %s", fp_sha256 ? 4 : 3, TNET_DTLS_HASH_NAMES[tnet_dtls_hash_type_sha1], fp_sha1);
acap_tag_fp_sha1 = (fp_sha256 ? 4 : 3);
_first_media_add_headers(self->local_sdp, TSDP_HEADER_A_VA_ARGS("acap", acap_fp), tsk_null);
}
-
+
TSK_FREE(acap_fp);
}
-
+
// "tcap"
_first_media_add_headers(self->local_sdp, TSDP_HEADER_A_VA_ARGS("tcap", tcap), tsk_null);
TSK_FREE(tcap);
-
+
acap_tag = TSK_MAX(acap_tag, acap_tag_connection);
acap_tag = TSK_MAX(acap_tag, acap_tag_fp_sha1);
acap_tag = TSK_MAX(acap_tag, acap_tag_fp_sha256);
}
- if(is_first_media && !negotiate_srtp && is_srtp_dtls_enabled){
+ if(is_first_media && !negotiate_srtp && is_srtp_dtls_enabled) {
// add DTLS-SRTP fingerprint and setup at session-level
const char* fp_str = trtp_manager_get_dtls_local_fingerprint(self->rtp_manager, TDAV_DFAULT_FP_HASH);
- if(fp_str){
+ if(fp_str) {
tsk_sprintf(&str, "%s %s", TNET_DTLS_HASH_NAMES[TDAV_DFAULT_FP_HASH], fp_str);
//!\ From RFC 5763 (DTLS-SRTP Framework) \A75: The endpoint MUST NOT use the connection attribute defined in [RFC4145].
#if TDAV_FIXME_MEDIA_LEVEL_DTLS_ATT
@@ -1085,113 +1096,113 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
#endif
}
}
-
+
// "a=acap:crypto" or "a=crypto"
- for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx){
- if(acap_tag_crypro_start == 0){
+ for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx) {
+ if(acap_tag_crypro_start == 0) {
acap_tag_crypro_start = (acap_tag == 1 ? acap_tag : ++acap_tag);
}
- if(negotiate_srtp){
+ if(negotiate_srtp) {
tsk_sprintf(&str, "%d crypto:%d %s inline:%s", acap_tag++, srtp_ctxs[ctx_idx]->rtp.tag, trtp_srtp_crypto_type_strings[srtp_ctxs[ctx_idx]->rtp.crypto_type], srtp_ctxs[ctx_idx]->rtp.key_str);
cryptoA = tsdp_header_A_create("acap", str);
}
- else{
+ else {
tsk_sprintf(&str, "%d %s inline:%s", srtp_ctxs[ctx_idx]->rtp.tag, trtp_srtp_crypto_type_strings[srtp_ctxs[ctx_idx]->rtp.crypto_type], srtp_ctxs[ctx_idx]->rtp.key_str);
cryptoA = tsdp_header_A_create("crypto", str);
}
-
+
tsdp_header_M_add(base->M.lo, (const tsdp_header_t*)cryptoA);
-
+
TSK_OBJECT_SAFE_FREE(cryptoA);
}
-
+
// a=pcfg:
- if(negotiate_srtp || negotiate_avpf){
+ if(negotiate_srtp || negotiate_avpf) {
tsk_size_t pcfg_tag, pcfg_idx;
char *acap_crypto = tsk_null, *acap_dtls = tsk_null;
-
+
// crypto
- for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx){
+ for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx) {
tsk_strcat_2(&acap_crypto, "%s%d",
acap_crypto ? "," : "",
(acap_tag_crypro_start + ctx_idx)
- );
+ );
}
-
+
// dtls setup and fingerprints
- if(acap_tag_setup > 0 && acap_tag_connection > 0 && (acap_tag_fp_sha1 > 0 || acap_tag_fp_sha256 > 0)){
+ if(acap_tag_setup > 0 && acap_tag_connection > 0 && (acap_tag_fp_sha1 > 0 || acap_tag_fp_sha256 > 0)) {
tsk_sprintf(&acap_dtls, "%d,%d", acap_tag_setup, acap_tag_connection);
- if(acap_tag_fp_sha1 > 0){
+ if(acap_tag_fp_sha1 > 0) {
tsk_strcat_2(&acap_dtls, ",%d", acap_tag_fp_sha1);
}
- if(acap_tag_fp_sha256 > 0){
+ if(acap_tag_fp_sha256 > 0) {
tsk_strcat_2(&acap_dtls, "%s%d", acap_tag_fp_sha1 > 0 ? "|" : ",", acap_tag_fp_sha256);
}
}
-
- for(pcfg_tag = 1, pcfg_idx = 0; pcfg_idx < profiles_index; ++pcfg_tag, ++pcfg_idx){
- if(((profiles[pcfg_idx] & RTP_PROFILE_SECURE_SDES) == RTP_PROFILE_SECURE_SDES) && acap_crypto){
+
+ for(pcfg_tag = 1, pcfg_idx = 0; pcfg_idx < profiles_index; ++pcfg_tag, ++pcfg_idx) {
+ if(((profiles[pcfg_idx] & RTP_PROFILE_SECURE_SDES) == RTP_PROFILE_SECURE_SDES) && acap_crypto) {
tsk_sprintf(&str, "%d t=%d a=%s", pcfg_tag, pcfg_tag, acap_crypto);
}
- else if(((profiles[pcfg_idx] & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS) && acap_dtls){
+ else if(((profiles[pcfg_idx] & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS) && acap_dtls) {
tsk_sprintf(&str, "%d t=%d a=%s", pcfg_tag, pcfg_tag, acap_dtls);
}
- else{
+ else {
tsk_sprintf(&str, "%d t=%d", pcfg_tag, pcfg_tag);
}
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("pcfg", str), tsk_null);
}
-
+
TSK_FREE(acap_crypto);
TSK_FREE(acap_dtls);
}
-
- if(is_srtp_remote_mandatory || is_srtp_local_mandatory || trtp_srtp_is_initialized(self->rtp_manager)){
+
+ if(is_srtp_remote_mandatory || is_srtp_local_mandatory || trtp_srtp_is_initialized(self->rtp_manager)) {
self->use_srtp = tsk_true;
}
-
+
/* RFC 5939 - Session Description Protocol (SDP) Capability Negotiation */
{
sdp_acaps_xt acaps;
sdp_tcaps_xt tcaps;
-
+
_sdp_acaps_reset(&acaps);
_sdp_tcaps_reset(&tcaps);
_sdp_pcfgs_reset(&self->sdp_caps->local);
// session-level attributes
- if(self->local_sdp){
+ if(self->local_sdp) {
_sdp_pcfgs_from_sdp(self->local_sdp, &acaps, &tcaps, &self->sdp_caps->local, tsk_false);
}
// media-level attributes
_sdp_pcfgs_from_sdp(base->M.lo, &acaps, &tcaps, &self->sdp_caps->local, tsk_false);
}
-
+
TSK_FREE(str);
} //end-of-if(!base->M.ro)
- else{
+ else {
// === RO IS NOT NULL ===
// the ro validity has been checked in "set_ro()"
RTP_PROFILE_T profile_remote = (self->sdp_caps->acfg.tag > 0 && self->sdp_caps->acfg.tcap.tag > 0)
- ? self->sdp_caps->acfg.tcap.profile
- : _sdp_profile_from_string(base->M.ro->proto);
+ ? self->sdp_caps->acfg.tcap.profile
+ : _sdp_profile_from_string(base->M.ro->proto);
tsk_bool_t is_srtp_sdes_activated = tsk_false, is_srtp_dtls_activated = tsk_false;
-
+
// intersect remote and local SRTP options
if (self->avpf_mode_neg == tmedia_mode_optional && ((profile_remote & RTP_PROFILE_AVPF) == RTP_PROFILE_AVPF)) {
self->avpf_mode_neg = tmedia_mode_mandatory;
}
is_srtp_sdes_enabled &= ((profile_remote & RTP_PROFILE_SECURE_SDES) == RTP_PROFILE_SECURE_SDES);
is_srtp_dtls_enabled &= ((profile_remote & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS);
-
-
+
+
// SDES-SRTP
- if(is_srtp_sdes_enabled){
+ if(is_srtp_sdes_enabled) {
const trtp_srtp_ctx_xt *srtp_ctxs[SRTP_CRYPTO_TYPES_MAX] = { tsk_null };
tsk_size_t ctx_count = 0, ctx_idx;
// get local SRTP context
- if((ctx_count = trtp_srtp_get_local_contexts(self->rtp_manager, (const trtp_srtp_ctx_xt **)&srtp_ctxs, sizeof(srtp_ctxs)/sizeof(srtp_ctxs[0]))) > 0){
+ if((ctx_count = trtp_srtp_get_local_contexts(self->rtp_manager, (const trtp_srtp_ctx_xt **)&srtp_ctxs, sizeof(srtp_ctxs)/sizeof(srtp_ctxs[0]))) > 0) {
char* str = tsk_null;
- for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx){
+ for(ctx_idx = 0; ctx_idx < ctx_count; ++ctx_idx) {
is_srtp_sdes_activated = tsk_true;
tsk_sprintf(&str, "%d %s inline:%s", srtp_ctxs[ctx_idx]->rtp.tag, trtp_srtp_crypto_type_strings[srtp_ctxs[ctx_idx]->rtp.crypto_type], srtp_ctxs[ctx_idx]->rtp.key_str);
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("crypto", str), tsk_null);
@@ -1199,14 +1210,14 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
TSK_FREE(str);
}
}
-
+
// DTLS-SRTP
- if(!is_srtp_sdes_activated && is_srtp_dtls_enabled){
+ if(!is_srtp_sdes_activated && is_srtp_dtls_enabled) {
// get "fingerprint", "setup" and "connection" attributes
- if(!tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk)){
+ if(!tsk_strnullORempty(TMEDIA_SESSION(self)->dtls.file_pbk)) {
tnet_dtls_hash_type_t fp_hash_remote;
char* str = tsk_null;
- if((fp_hash_remote = trtp_manager_get_dtls_remote_fingerprint_hash(self->rtp_manager)) == tnet_dtls_hash_type_none){
+ if((fp_hash_remote = trtp_manager_get_dtls_remote_fingerprint_hash(self->rtp_manager)) == tnet_dtls_hash_type_none) {
fp_hash_remote = TDAV_DFAULT_FP_HASH;
}
tsk_sprintf(&str, "%s %s", TNET_DTLS_HASH_NAMES[fp_hash_remote], trtp_manager_get_dtls_local_fingerprint(self->rtp_manager, fp_hash_remote));
@@ -1228,28 +1239,28 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
_first_media_add_headers(self->local_sdp, TSDP_HEADER_A_VA_ARGS("connection", self->dtls.local.connection_new ? "new" : "existing"), tsk_null);
#endif /* TDAV_FIXME_MEDIA_LEVEL_DTLS_ATT */
#endif /* TDAV_FIXME_MEDIA_LEVEL_DTLS_ATT */
-
+
is_srtp_dtls_activated = tsk_true;
}
-
+
// activate the right SRTP type and disable others
trtp_manager_set_srtp_type_remote(self->rtp_manager,
is_srtp_sdes_activated ? tmedia_srtp_type_sdes : (is_srtp_dtls_activated ? tmedia_srtp_type_dtls : tmedia_srtp_type_none));
-
+
self->use_srtp |= (is_srtp_sdes_activated || is_srtp_dtls_activated);
is_srtp_sdes_enabled &= is_srtp_sdes_activated;
is_srtp_dtls_enabled &= is_srtp_dtls_activated;
-
+
}//end-of-else
}//end-of-HAVE_SRTP
#endif /* HAVE_SRTP */
-
-
+
+
/* RFC 5939: acfg */
- if(self->sdp_caps->acfg.tag > 0){
+ if(self->sdp_caps->acfg.tag > 0) {
_sdp_acfg_to_sdp(base->M.lo, &self->sdp_caps->acfg);
}
-
+
/* Hold/Resume */
#if 0
// BFCP sessions send media but not expected to receive any data.
@@ -1258,21 +1269,21 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
#else
tsdp_header_M_set_holdresume_att(base->M.lo, base->lo_held, base->ro_held);
#endif
-
+
/* Update Proto*/
tsk_strupdate(&base->M.lo->proto,
self->use_srtp
? ((self->avpf_mode_neg == tmedia_mode_mandatory) ? (is_srtp_dtls_enabled ? "UDP/TLS/RTP/SAVPF" : "RTP/SAVPF") : (is_srtp_dtls_enabled ? "UDP/TLS/RTP/SAVP" : "RTP/SAVP"))
- : ((self->avpf_mode_neg == tmedia_mode_mandatory) ? "RTP/AVPF" : "RTP/AVP")
- );
-
+ : ((self->avpf_mode_neg == tmedia_mode_mandatory) ? "RTP/AVPF" : "RTP/AVP")
+ );
+
// RFC 5761: RTCP/RTP muxing
- if(self->use_rtcpmux){
+ if(self->use_rtcpmux) {
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("rtcp-mux", tsk_null), tsk_null);
}
-
+
// draft-lennox-mmusic-sdp-source-attributes-01
- if((self->media_type & tmedia_audio) || (self->media_type & tmedia_video) || ((self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)){
+ if((self->media_type & tmedia_audio) || (self->media_type & tmedia_video) || ((self->media_type & tmedia_bfcp_video) == tmedia_bfcp_video)) {
char* str = tsk_null;
tsk_sprintf(&str, "%u cname:%s", self->rtp_manager->rtp.ssrc.local, self->rtp_manager->rtcp.cname); // also defined in RTCP session
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("ssrc", str), tsk_null);
@@ -1282,19 +1293,19 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("ssrc", str), tsk_null);
TSK_FREE(str);
}
-
+
/* ICE */
- if(self->ice_ctx){
+ if(self->ice_ctx) {
tsk_size_t index = 0;
const tnet_ice_candidate_t* candidate;
tsk_bool_t remote_use_rtcpmux = (base->M.ro && (tsdp_header_M_findA(base->M.ro, "rtcp-mux") != tsk_null));
-
+
// FIXME: for RTCP, use "RFC 3605"in addition to "rtcp-mux"
-
+
// "a=ice-mismatch" if "C=" line is not included in the candidates
if ((candidate = tnet_ice_ctx_get_local_candidate_first(self->ice_ctx))) { // at least one candidate
base->M.lo->port = candidate->socket->port;
-
+
tsdp_header_M_remove(base->M.lo, tsdp_htype_C);
tsdp_header_M_add_headers(base->M.lo,
TSDP_HEADER_C_VA_ARGS("IN", TNET_SOCKET_TYPE_IS_IPV6(candidate->socket->type) ? "IP6" : "IP4", candidate->socket->ip),
@@ -1308,7 +1319,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
// tsdp_header_M_add_headers(base->M.lo,
// TSDP_HEADER_A_VA_ARGS("mid", self->media_type & tmedia_audio ? "audio" : "video"),
// tsk_null);
-
+
while ((candidate = tnet_ice_ctx_get_local_candidate_at(self->ice_ctx, index++))) {
if (self->use_rtcpmux && remote_use_rtcpmux && candidate->comp_id == TNET_ICE_CANDIDATE_COMPID_RTCP) {
continue; // do not add RTCP candidates if RTCP-MUX is activated (local + remote)
@@ -1324,15 +1335,15 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
}
}
}
- else{
- if(base->M.lo->C){
+ else {
+ if(base->M.lo->C) {
tsk_strupdate(&base->M.lo->C->addr, self->rtp_manager->rtp.public_ip);
tsk_strupdate(&base->M.lo->C->addrtype, (self->use_ipv6 ? "IP6" : "IP4"));
}
base->M.lo->port = self->rtp_manager->rtp.public_port;
}
-
- if(self->media_type & tmedia_audio){
+
+ if(self->media_type & tmedia_audio) {
///* 3GPP TS 24.229 - 6.1.1 General
// The UE shall include the MIME subtype "telephone-event" in the "m=" media descriptor in the SDP for audio media
// flows that support both audio codec and DTMF payloads in RTP packets as described in RFC 4733 [23].
@@ -1345,19 +1356,20 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
// TSDP_HEADER_A_VA_ARGS("rtpmap", TMEDIA_CODEC_FORMAT_DTMF" telephone-event/8000"),
// tsk_null);
}
-
+
/* QoS */
- if(base->qos){
+ if(base->qos) {
tmedia_qos_tline_t* ro_tline;
- if(base->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(base->M.ro))){
+ if(base->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(base->M.ro))) {
tmedia_qos_tline_set_ro(base->qos, ro_tline);
TSK_OBJECT_SAFE_FREE(ro_tline);
}
tmedia_qos_tline_to_sdp(base->qos, base->M.lo);
}
- DONE:;
+DONE:
+ ;
} // end-of-if(*updated)
-
+
return base->M.lo;
}
@@ -1370,44 +1382,44 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
tmedia_session_t* base = TMEDIA_SESSION(self);
RTP_PROFILE_T profile_remote;
int32_t acfg_idx = -1;
-
- if(!base || !m || !updated){
+
+ if(!base || !m || !updated) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(!self->rtp_manager){
+ if(!self->rtp_manager) {
TSK_DEBUG_ERROR("RTP manager is null. Did you forget to prepare the session?");
return -1;
}
-
+
/* update remote offer */
TSK_OBJECT_SAFE_FREE(base->M.ro);
base->M.ro = tsk_object_ref((void*)m);
-
+
*updated = tsk_false;
-
+
// check if the RTP profile from remote party is supported or not
- if((profile_remote = _sdp_profile_from_string(m->proto)) == RTP_PROFILE_NONE){
+ if((profile_remote = _sdp_profile_from_string(m->proto)) == RTP_PROFILE_NONE) {
TSK_DEBUG_ERROR("%s not supported as RTP profile", m->proto);
return -2;
}
// check that all options in the profile are supported
- if((is_srtp_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE)) && (self->srtp_mode == tmedia_srtp_mode_none)){
+ if((is_srtp_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE)) && (self->srtp_mode == tmedia_srtp_mode_none)) {
TSK_DEBUG_ERROR("Remote party requesting secure transport (%s) but this option is not enabled", m->proto);
return -2;
}
- if((is_srtp_sdes_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE_SDES) == RTP_PROFILE_SECURE_SDES) && !(self->srtp_type & tmedia_srtp_type_sdes)){
+ if((is_srtp_sdes_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE_SDES) == RTP_PROFILE_SECURE_SDES) && !(self->srtp_type & tmedia_srtp_type_sdes)) {
TSK_DEBUG_ERROR("Remote party requesting SRTP-SDES (%s) but this option is not enabled", m->proto);
return -2;
}
- if((is_srtp_dtls_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS) && !(self->srtp_type & tmedia_srtp_type_dtls)){
+ if((is_srtp_dtls_remote_mandatory = (profile_remote & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS) && !(self->srtp_type & tmedia_srtp_type_dtls)) {
TSK_DEBUG_ERROR("Remote party requesting DTLS-DTLS (%s) but this option is not enabled", m->proto);
return -2;
}
is_srtp_local_mandatory = (self->srtp_mode == tmedia_srtp_mode_mandatory) && (self->srtp_type != tmedia_srtp_type_none);
is_srtp_dtls_local_enabled = (self->srtp_mode != tmedia_srtp_mode_none) && (self->srtp_type & tmedia_srtp_type_dtls);
is_srtp_sdes_local_enabled = (self->srtp_mode != tmedia_srtp_mode_none) && (self->srtp_type & tmedia_srtp_type_sdes);
-
+
if (base->M.lo) {
if ((neg_codecs = tmedia_session_match_codec(base, m))) {
/* update negociated codecs */
@@ -1428,46 +1440,46 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
}
}
}
-
+
/* AVPF */
- if(self->avpf_mode_set == tmedia_mode_optional && self->avpf_mode_neg != tmedia_mode_mandatory){
+ if(self->avpf_mode_set == tmedia_mode_optional && self->avpf_mode_neg != tmedia_mode_mandatory) {
self->avpf_mode_neg = _sdp_str_contains(base->M.ro->proto, "AVPF") ? tmedia_mode_mandatory : tmedia_mode_none;
}
-
+
/* RFC 5939 - Session Description Protocol (SDP) Capability Negotiation */
{
sdp_acaps_xt acaps;
sdp_tcaps_xt tcaps;
-
+
_sdp_acfg_reset(&self->sdp_caps->acfg);
-
+
_sdp_acaps_reset(&acaps);
_sdp_tcaps_reset(&tcaps);
_sdp_pcfgs_reset(&self->sdp_caps->remote);
-
+
// session-level attributes
- if(self->remote_sdp){
+ if(self->remote_sdp) {
_sdp_pcfgs_from_sdp(self->remote_sdp, &acaps, &tcaps, &self->sdp_caps->remote, tsk_false);
}
// media-level attributes
_sdp_pcfgs_from_sdp(base->M.ro, &acaps, &tcaps, &self->sdp_caps->remote, tsk_false);
}
-
+
/* get connection associated to this media line
* If the connnection is global, then the manager will call tdav_session_audio_set() */
- if(m->C && m->C->addr){
+ if(m->C && m->C->addr) {
tsk_strupdate(&self->remote_ip, m->C->addr);
self->use_ipv6 = tsk_striequals(m->C->addrtype, "IP6");
}
/* set remote port */
self->remote_port = m->port;
-
+
/* RTCP-MUX */
self->use_rtcpmux &= (tsdp_header_M_findA(m, "rtcp-mux") != tsk_null);
- if(self->ice_ctx){
+ if(self->ice_ctx) {
tnet_ice_ctx_set_rtcpmux(self->ice_ctx, self->use_rtcpmux);
}
-
+
// BANDWIDTH:
// http://tools.ietf.org/html/rfc3556
// https://tools.ietf.org/html/rfc3890
@@ -1490,25 +1502,27 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
}
}
}
-
+
/* Remote SSRC */
{
// will be also updated based on received RTP packets
const tsdp_header_A_t* ssrcA = tsdp_header_M_findA(m, "ssrc");
- if(ssrcA && ssrcA->value){
- if(sscanf(ssrcA->value, "%u %*s", &self->rtp_manager->rtp.ssrc.remote) != EOF){
+ if(ssrcA && ssrcA->value) {
+ if(sscanf(ssrcA->value, "%u %*s", &self->rtp_manager->rtp.ssrc.remote) != EOF) {
TSK_DEBUG_INFO("Remote SSRC = %u", self->rtp_manager->rtp.ssrc.remote);
}
}
}
-
+
/* RTCWeb Type */
- if(self->remote_sdp){
+ if(self->remote_sdp) {
const tsdp_header_S_t* S = (const tsdp_header_S_t*)tsdp_message_get_header(self->remote_sdp, tsdp_htype_S);
- if(S && !tsk_strnullORempty(S->value)){
- struct rtcweb_type { const char* name; tmedia_rtcweb_type_t type; };
- static const struct rtcweb_type rtcweb_types[] =
- {
+ if(S && !tsk_strnullORempty(S->value)) {
+ struct rtcweb_type {
+ const char* name;
+ tmedia_rtcweb_type_t type;
+ };
+ static const struct rtcweb_type rtcweb_types[] = {
{ "firefox", tmedia_rtcweb_type_firefox },
{ "chrome", tmedia_rtcweb_type_chrome },
{ "bowser", tmedia_rtcweb_type_ericsson },
@@ -1516,69 +1530,71 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
};
static const int32_t rtcweb_types_count = sizeof(rtcweb_types)/sizeof(rtcweb_types[0]);
int32_t i;
- for(i = 0; i < rtcweb_types_count; ++i){
- if(_sdp_str_contains(S->value, rtcweb_types[i].name)){
+ for(i = 0; i < rtcweb_types_count; ++i) {
+ if(_sdp_str_contains(S->value, rtcweb_types[i].name)) {
trtp_manager_set_rtcweb_type_remote(self->rtp_manager, rtcweb_types[i].type);
break;
}
}
}
}
-
+
/* SRTP */
#if HAVE_SRTP
// this is SRTP negotiation -> do not trust the remote profile
- if(is_srtp_dtls_local_enabled || is_srtp_sdes_local_enabled){
+ if(is_srtp_dtls_local_enabled || is_srtp_sdes_local_enabled) {
int32_t i, j;
const sdp_acap_xt *acap;
int ret;
- if(is_srtp_sdes_local_enabled){
+ if(is_srtp_sdes_local_enabled) {
const tsdp_header_A_t* A;
const char* cryptos[2] = { tsk_null };
-
+
/* 1. check crypto lines from the SDP */
i = 0;
- while((A = tsdp_header_M_findA_at(m, "crypto", i))){
+ while((A = tsdp_header_M_findA_at(m, "crypto", i))) {
cryptos[i++] = A->value;
- if(i >= (sizeof(cryptos)/sizeof(cryptos[0]))){
+ if(i >= (sizeof(cryptos)/sizeof(cryptos[0]))) {
break;
}
}
-
+
/* 2. check crypto lines from the caps (RFC 5939)*/
- if(!cryptos[0]){
+ if(!cryptos[0]) {
tsk_size_t k = 0;
- for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i){
+ for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i) {
j = 0;
- while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "crypto", j++))){
- if(k < (sizeof(cryptos)/sizeof(cryptos[0]))){
+ while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "crypto", j++))) {
+ if(k < (sizeof(cryptos)/sizeof(cryptos[0]))) {
// remove "crypto: "
- if((cryptos[k] = strstr(acap->value, ":")) && ++cryptos[k]){
- while(isspace(*cryptos[k])) ++cryptos[k];
+ if((cryptos[k] = strstr(acap->value, ":")) && ++cryptos[k]) {
+ while(isspace(*cryptos[k])) {
+ ++cryptos[k];
+ }
++k;
}
}
}
- if(k != 0){ // do not mix crypto lines from different pcfgs
+ if(k != 0) { // do not mix crypto lines from different pcfgs
acfg_idx = i;
break;
}
}
}
-
+
/* 3. match cryptos */
- for(i = 0; i< sizeof(cryptos)/sizeof(cryptos[0]); ++i){
- if(!cryptos[i]){
+ for(i = 0; i< sizeof(cryptos)/sizeof(cryptos[0]); ++i) {
+ if(!cryptos[i]) {
break;
}
- if((ret = trtp_srtp_set_crypto_remote(self->rtp_manager, cryptos[i])) == 0){
+ if((ret = trtp_srtp_set_crypto_remote(self->rtp_manager, cryptos[i])) == 0) {
srtp_sdes_neg_ok = tsk_true;
break;
}
}
} // end-of-sdes
-
- if(!srtp_sdes_neg_ok && is_srtp_dtls_local_enabled){
+
+ if(!srtp_sdes_neg_ok && is_srtp_dtls_local_enabled) {
int ret;
const tsdp_header_A_t *setupA = tsk_null, *fpA = tsk_null, *connectionA = tsk_null;
const char* fingerprints[4] = { tsk_null };
@@ -1586,75 +1602,93 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
const char* connections[4] = { tsk_null };
const char* connection = tsk_null;
const char* setup = tsk_null;
-
+
/* 1. check DTLS attributes from the SDP */
-
- if(self->remote_sdp){
+
+ if(self->remote_sdp) {
setupA = tsdp_message_get_headerA(self->remote_sdp, "setup");
fpA = tsdp_message_get_headerA(self->remote_sdp, "fingerprint");
connectionA = tsdp_message_get_headerA(self->remote_sdp, "connection");
}
- if(!setupA) setupA = tsdp_header_M_findA(m, "setup");
- if(!fpA) fpA = tsdp_header_M_findA(m, "fingerprint");
- if(!connectionA) connectionA = tsdp_header_M_findA(m, "connection");
-
- if(setupA) setups[0] = setupA->value;
- if(fpA) fingerprints[0] = fpA->value;
- if(connectionA) connections[0] = connectionA->value;
-
+ if(!setupA) {
+ setupA = tsdp_header_M_findA(m, "setup");
+ }
+ if(!fpA) {
+ fpA = tsdp_header_M_findA(m, "fingerprint");
+ }
+ if(!connectionA) {
+ connectionA = tsdp_header_M_findA(m, "connection");
+ }
+
+ if(setupA) {
+ setups[0] = setupA->value;
+ }
+ if(fpA) {
+ fingerprints[0] = fpA->value;
+ }
+ if(connectionA) {
+ connections[0] = connectionA->value;
+ }
+
/* 2. check DTLS attributes from from the caps (RFC 5939) */
- if(!srtp_dtls_neg_ok && !fingerprints[0]){
+ if(!srtp_dtls_neg_ok && !fingerprints[0]) {
tsk_size_t k_fp = 0, k_st = 0, k_conn = 0;
- for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i){
+ for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i) {
// "fingerprint"
j = 0;
- while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "fingerprint", j++))){
- if(k_fp < (sizeof(fingerprints)/sizeof(fingerprints[0]))){
- if((fingerprints[k_fp] = strstr(acap->value, ":")) && ++fingerprints[k_fp]){
- while(isspace(*fingerprints[k_fp])) ++fingerprints[k_fp];
+ while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "fingerprint", j++))) {
+ if(k_fp < (sizeof(fingerprints)/sizeof(fingerprints[0]))) {
+ if((fingerprints[k_fp] = strstr(acap->value, ":")) && ++fingerprints[k_fp]) {
+ while(isspace(*fingerprints[k_fp])) {
+ ++fingerprints[k_fp];
+ }
++k_fp;
}
}
}
// "setup"
j = 0;
- while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "setup", j++))){
- if(k_st < (sizeof(setups)/sizeof(setups[0]))){
- if((setups[k_st] = strstr(acap->value, ":")) && ++setups[k_st]){
- while(isspace(*setups[k_st])) ++setups[k_st];
+ while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "setup", j++))) {
+ if(k_st < (sizeof(setups)/sizeof(setups[0]))) {
+ if((setups[k_st] = strstr(acap->value, ":")) && ++setups[k_st]) {
+ while(isspace(*setups[k_st])) {
+ ++setups[k_st];
+ }
++k_st;
}
}
}
// "connection"
j = 0;
- while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "connection", j++))){
- if(k_conn < (sizeof(connections)/sizeof(connections[0]))){
- if((connections[k_conn] = strstr(acap->value, ":")) && ++connections[k_conn]){
- while(isspace(*connections[k_conn])) ++connections[k_conn];
+ while((acap = _sdp_acaps_find_by_field(&self->sdp_caps->remote[i].acaps, "connection", j++))) {
+ if(k_conn < (sizeof(connections)/sizeof(connections[0]))) {
+ if((connections[k_conn] = strstr(acap->value, ":")) && ++connections[k_conn]) {
+ while(isspace(*connections[k_conn])) {
+ ++connections[k_conn];
+ }
++k_conn;
}
}
}
-
- if(k_fp || k_st || k_conn){ // do not mix crypto lines from different pcfgs
+
+ if(k_fp || k_st || k_conn) { // do not mix crypto lines from different pcfgs
acfg_idx = i;
break;
}
}
}
-
+
/* 3. setup DTLS connection using negotiated attributes */
-
- if(!srtp_dtls_neg_ok && fingerprints[0]){
+
+ if(!srtp_dtls_neg_ok && fingerprints[0]) {
tnet_fingerprint_t fingerprint;
char hash[16];
- for(i = 0; i < sizeof(fingerprints)/sizeof(fingerprints[0]) && !srtp_dtls_neg_ok; ++i){
- if(!fingerprints[i]){
+ for(i = 0; i < sizeof(fingerprints)/sizeof(fingerprints[0]) && !srtp_dtls_neg_ok; ++i) {
+ if(!fingerprints[i]) {
break;
}
- if(sscanf(fingerprints[i], "%15s %255s", hash, fingerprint) >= 2){
- if((ret = trtp_manager_set_dtls_remote_fingerprint(self->rtp_manager, &fingerprint, hash)) == 0){
+ if(sscanf(fingerprints[i], "%15s %255s", hash, fingerprint) >= 2) {
+ if((ret = trtp_manager_set_dtls_remote_fingerprint(self->rtp_manager, &fingerprint, hash)) == 0) {
acfg_idx = i;
srtp_dtls_neg_ok = tsk_true;
break;
@@ -1662,37 +1696,43 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
}
}
}
-
+
// only accept sdp without fingerprints if certificate verification is OFF
- if(!srtp_dtls_neg_ok && !fingerprints[0] && !TMEDIA_SESSION(self)->dtls.verify){
- for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i){
- if(self->sdp_caps->remote[i].tcap.tag > 0 && (self->sdp_caps->remote[i].tcap.profile & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS){
+ if(!srtp_dtls_neg_ok && !fingerprints[0] && !TMEDIA_SESSION(self)->dtls.verify) {
+ for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i) {
+ if(self->sdp_caps->remote[i].tcap.tag > 0 && (self->sdp_caps->remote[i].tcap.profile & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS) {
acfg_idx = i;
break;
}
}
}
-
+
// defaults
- if(!connection) connection = connections[acfg_idx != -1 ? acfg_idx : 0];
- if(!setup) setup = setups[acfg_idx != -1 ? acfg_idx : 0];
-
- if((!connection || !setup) && (is_srtp_dtls_remote_mandatory || is_srtp_local_mandatory || (acfg_idx != -1 && (self->sdp_caps->remote[acfg_idx].tcap.profile & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS))){
- if(!connection) connection = (self->dtls.local.connection_new ? "existing" : "new");
+ if(!connection) {
+ connection = connections[acfg_idx != -1 ? acfg_idx : 0];
+ }
+ if(!setup) {
+ setup = setups[acfg_idx != -1 ? acfg_idx : 0];
+ }
+
+ if((!connection || !setup) && (is_srtp_dtls_remote_mandatory || is_srtp_local_mandatory || (acfg_idx != -1 && (self->sdp_caps->remote[acfg_idx].tcap.profile & RTP_PROFILE_SECURE_DTLS) == RTP_PROFILE_SECURE_DTLS))) {
+ if(!connection) {
+ connection = (self->dtls.local.connection_new ? "existing" : "new");
+ }
if(!setup) setup = (self->dtls.local.setup == tnet_dtls_setup_active
- ? "passive"
- : (self->dtls.local.setup == tnet_dtls_setup_passive ? "active" : (base->M.lo ? "passive" : "active")));
+ ? "passive"
+ : (self->dtls.local.setup == tnet_dtls_setup_passive ? "active" : (base->M.lo ? "passive" : "active")));
}
-
+
if (connection && setup) {
// update local setup according to remote setup
// do not update if local setup already negotiated
if (tnet_dtls_get_setup_from_string(setup) != tnet_dtls_setup_actpass || (self->dtls.local.setup == tnet_dtls_setup_none || self->dtls.local.setup == tnet_dtls_setup_actpass)) {
ret = _tdav_session_av_dtls_set_remote_setup(self,
- tnet_dtls_get_setup_from_string(setup),
- !tsk_striequals(connection, "existing"),
- (!base->M.ro)
- );
+ tnet_dtls_get_setup_from_string(setup),
+ !tsk_striequals(connection, "existing"),
+ (!base->M.ro)
+ );
}
if (ret == 0) {
// pass new local values to the RTP manager
@@ -1700,43 +1740,43 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
srtp_dtls_neg_ok = (ret == 0);
}
}
-
+
}// end-of-dtls
}//end-of-if(srtp=optional|mandatory)
-
+
self->use_srtp = trtp_srtp_is_initialized(self->rtp_manager);
-
+
// activate the right SRTP type and disable others
trtp_manager_set_srtp_type_remote(self->rtp_manager,
srtp_sdes_neg_ok ? tmedia_srtp_type_sdes : (srtp_dtls_neg_ok ? tmedia_srtp_type_dtls : tmedia_srtp_type_none));
-
+
#endif
-
+
// set actual config
- if(acfg_idx == -1){
+ if(acfg_idx == -1) {
// none matched (means SRTP negotiation failed or not enabled -> try to negotiate AVP(F))
int32_t i;
- for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i){
- if(self->sdp_caps->remote[i].tcap.tag > 0){
- if((self->sdp_caps->remote[i].tcap.profile & RTP_PROFILE_AVPF) == RTP_PROFILE_AVPF){
+ for(i = 0; (i < SDP_CAPS_COUNT_MAX && self->sdp_caps->remote[i].tag > 0); ++i) {
+ if(self->sdp_caps->remote[i].tcap.tag > 0) {
+ if((self->sdp_caps->remote[i].tcap.profile & RTP_PROFILE_AVPF) == RTP_PROFILE_AVPF) {
acfg_idx = i;
break;
}
}
}
}
- if(acfg_idx != -1){
+ if(acfg_idx != -1) {
self->sdp_caps->acfg = self->sdp_caps->remote[acfg_idx];
if (self->avpf_mode_set == tmedia_mode_optional && self->avpf_mode_neg != tmedia_mode_mandatory) {
self->avpf_mode_neg = ((self->sdp_caps->acfg.tcap.profile & RTP_PROFILE_AVPF) == RTP_PROFILE_AVPF) ? tmedia_mode_mandatory : tmedia_mode_none;
}
}
-
- if(!srtp_sdes_neg_ok && !srtp_dtls_neg_ok && (is_srtp_remote_mandatory || is_srtp_local_mandatory)){
+
+ if(!srtp_sdes_neg_ok && !srtp_dtls_neg_ok && (is_srtp_remote_mandatory || is_srtp_local_mandatory)) {
TSK_DEBUG_ERROR("SRTP negotiation failed");
return -4;
}
-
+
return 0;
}
@@ -1747,11 +1787,11 @@ const tmedia_codec_t* tdav_session_av_get_best_neg_codec(const tdav_session_av_t
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs) {
// exclude DTMF, RED and ULPFEC
if (!TDAV_IS_DTMF_CODEC(item->data) && !TDAV_IS_ULPFEC_CODEC(item->data) && !TDAV_IS_RED_CODEC(item->data)
- && TMEDIA_CODEC(item->data)->plugin && TMEDIA_CODEC(item->data)->plugin->encode && TMEDIA_CODEC(item->data)->plugin->decode) {
+ && TMEDIA_CODEC(item->data)->plugin && TMEDIA_CODEC(item->data)->plugin->encode && TMEDIA_CODEC(item->data)->plugin->decode) {
return TMEDIA_CODEC(item->data);
}
}
@@ -1761,14 +1801,14 @@ const tmedia_codec_t* tdav_session_av_get_best_neg_codec(const tdav_session_av_t
const tmedia_codec_t* tdav_session_av_get_red_codec(const tdav_session_av_t* self)
{
const tsk_list_item_t* item;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs){
+
+ tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs) {
const tmedia_codec_t* codec = (const tmedia_codec_t*)item->data;
- if(TDAV_IS_RED_CODEC(codec)){
+ if(TDAV_IS_RED_CODEC(codec)) {
return TMEDIA_CODEC(item->data);
}
}
@@ -1777,10 +1817,10 @@ const tmedia_codec_t* tdav_session_av_get_red_codec(const tdav_session_av_t* sel
static void* TSK_STDCALL _tdav_session_av_error_async_thread(void* usrdata)
{
- if(usrdata){
+ if(usrdata) {
tdav_session_av_t* self = (tdav_session_av_t*)usrdata;
tsk_safeobj_lock(self);
- if(TMEDIA_SESSION(self)->onerror_cb.fun){
+ if(TMEDIA_SESSION(self)->onerror_cb.fun) {
TMEDIA_SESSION(self)->onerror_cb.fun(TMEDIA_SESSION(self)->onerror_cb.usrdata, TMEDIA_SESSION(self), self->last_error.reason, self->last_error.is_fatal);
}
tsk_safeobj_unlock(self);
@@ -1792,29 +1832,29 @@ static void* TSK_STDCALL _tdav_session_av_error_async_thread(void* usrdata)
static int _tdav_session_av_raise_error_async(struct tdav_session_av_s* self, tsk_bool_t is_fatal, const char* reason)
{
int ret;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(self);
-
+
tsk_object_ref(self); // do not unref(), see _tdav_session_av_error_async_thread()
-
+
if (self->last_error.tid[0]) {
tsk_thread_join(self->last_error.tid);
}
-
+
self->last_error.is_fatal = is_fatal;
tsk_strupdate(&self->last_error.reason, reason);
if ((ret = tsk_thread_create(self->last_error.tid, _tdav_session_av_error_async_thread, self)) != 0) {
tsk_object_unref(self);
goto bail;
}
-
+
bail:
tsk_safeobj_unlock(self);
-
+
return ret;
}
@@ -1822,35 +1862,36 @@ bail:
static int _tdav_session_av_srtp_dtls_cb(const void* usrdata, enum trtp_srtp_dtls_event_type_e type, const char* reason)
{
tdav_session_av_t* self = tsk_object_ref((tdav_session_av_t*)usrdata);
-
+
tsk_safeobj_lock(self);
- switch(type){
- case trtp_srtp_dtls_event_type_handshake_failed:
- case trtp_srtp_dtls_event_type_fatal_error:
- {
- if(TMEDIA_SESSION(self)->onerror_cb.fun){
- static const tsk_bool_t __is_fatal = tsk_true;
- _tdav_session_av_raise_error_async(self, __is_fatal, reason);
- }
- break;
- }
- case trtp_srtp_dtls_event_type_handshake_succeed:
- {
- break;
+ switch(type) {
+ case trtp_srtp_dtls_event_type_handshake_failed:
+ case trtp_srtp_dtls_event_type_fatal_error: {
+ if(TMEDIA_SESSION(self)->onerror_cb.fun) {
+ static const tsk_bool_t __is_fatal = tsk_true;
+ _tdav_session_av_raise_error_async(self, __is_fatal, reason);
}
- case trtp_srtp_dtls_event_type_started:
- {
- // start producer and consumer
- if (self->rtp_manager && self->rtp_manager->is_started) {
- if (self->consumer && !self->consumer->is_started) tmedia_consumer_start(self->consumer);
- if (self->producer && !self->producer->is_started) tmedia_producer_start(self->producer);
+ break;
+ }
+ case trtp_srtp_dtls_event_type_handshake_succeed: {
+ break;
+ }
+ case trtp_srtp_dtls_event_type_started: {
+ // start producer and consumer
+ if (self->rtp_manager && self->rtp_manager->is_started) {
+ if (self->consumer && !self->consumer->is_started) {
+ tmedia_consumer_start(self->consumer);
+ }
+ if (self->producer && !self->producer->is_started) {
+ tmedia_producer_start(self->producer);
}
- break;
}
+ break;
+ }
}
tsk_safeobj_unlock(self);
tsk_object_unref(self);
-
+
return 0;
}
#endif /* HAVE_SRTP */
@@ -1858,7 +1899,7 @@ static int _tdav_session_av_srtp_dtls_cb(const void* usrdata, enum trtp_srtp_dtl
static int _tdav_session_av_red_cb(const void* usrdata, const struct trtp_rtp_packet_s* packet)
{
tdav_session_av_t* self = (tdav_session_av_t*)usrdata;
- if(self->rtp_manager && self->rtp_manager->rtp.cb.fun){
+ if(self->rtp_manager && self->rtp_manager->rtp.cb.fun) {
return self->rtp_manager->rtp.cb.fun(self->rtp_manager->rtp.cb.usrdata, packet);
}
return 0;
@@ -1866,32 +1907,32 @@ static int _tdav_session_av_red_cb(const void* usrdata, const struct trtp_rtp_pa
int _tdav_session_av_dtls_set_remote_setup(struct tdav_session_av_s* self, tnet_dtls_setup_t setup, tsk_bool_t connection_new, tsk_bool_t is_ro_null)
{
- if(self){
+ if(self) {
TSK_DEBUG_INFO("dtls.remote.setup=%s", TNET_DTLS_SETUP_NAMES[(int)setup]);
self->dtls.remote.setup = setup;
self->dtls.remote.connection_new = connection_new;
- switch(self->dtls.remote.setup){
- case tnet_dtls_setup_none:
- default:
- self->dtls.local.setup = tnet_dtls_setup_actpass;
- self->dtls.local.connection_new = tsk_true; // RTP transport always unprepared for reINVITE/UPDATE -> new connection
- break;
- case tnet_dtls_setup_active:
- self->dtls.local.setup = is_ro_null ? tnet_dtls_setup_actpass : tnet_dtls_setup_passive;
- self->dtls.local.connection_new = tsk_true;
- break;
- case tnet_dtls_setup_passive:
- self->dtls.local.setup = is_ro_null ? tnet_dtls_setup_actpass : tnet_dtls_setup_active;
+ switch(self->dtls.remote.setup) {
+ case tnet_dtls_setup_none:
+ default:
+ self->dtls.local.setup = tnet_dtls_setup_actpass;
+ self->dtls.local.connection_new = tsk_true; // RTP transport always unprepared for reINVITE/UPDATE -> new connection
+ break;
+ case tnet_dtls_setup_active:
+ self->dtls.local.setup = is_ro_null ? tnet_dtls_setup_actpass : tnet_dtls_setup_passive;
+ self->dtls.local.connection_new = tsk_true;
+ break;
+ case tnet_dtls_setup_passive:
+ self->dtls.local.setup = is_ro_null ? tnet_dtls_setup_actpass : tnet_dtls_setup_active;
+ self->dtls.local.connection_new = tsk_true;
+ break;
+ case tnet_dtls_setup_actpass:
+ if (self->dtls.local.setup == tnet_dtls_setup_actpass || self->dtls.local.setup == tnet_dtls_setup_none) { // change local setup only if actpass or none
+ self->dtls.local.setup = (self->dtls.local.setup == tnet_dtls_setup_actpass || self->dtls.local.setup == tnet_dtls_setup_active)
+ ? tnet_dtls_setup_active
+ : tnet_dtls_setup_passive;
self->dtls.local.connection_new = tsk_true;
- break;
- case tnet_dtls_setup_actpass:
- if (self->dtls.local.setup == tnet_dtls_setup_actpass || self->dtls.local.setup == tnet_dtls_setup_none) { // change local setup only if actpass or none
- self->dtls.local.setup = (self->dtls.local.setup == tnet_dtls_setup_actpass || self->dtls.local.setup == tnet_dtls_setup_active)
- ? tnet_dtls_setup_active
- : tnet_dtls_setup_passive;
- self->dtls.local.connection_new = tsk_true;
- }
- break;
+ }
+ break;
}
}
return 0;
@@ -1900,13 +1941,13 @@ int _tdav_session_av_dtls_set_remote_setup(struct tdav_session_av_s* self, tnet_
const tmedia_codec_t* tdav_session_av_get_ulpfec_codec(const tdav_session_av_t* self)
{
const tsk_list_item_t* item;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs){
- if(TDAV_IS_ULPFEC_CODEC(item->data)){
+
+ tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs) {
+ if(TDAV_IS_ULPFEC_CODEC(item->data)) {
return TMEDIA_CODEC(item->data);
}
}
@@ -1915,11 +1956,11 @@ const tmedia_codec_t* tdav_session_av_get_ulpfec_codec(const tdav_session_av_t*
int tdav_session_av_deinit(tdav_session_av_t* self)
{
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* deinit self (rtp manager should be destroyed after the producer) */
TSK_OBJECT_SAFE_FREE(self->consumer);
TSK_OBJECT_SAFE_FREE(self->producer);
@@ -1929,26 +1970,26 @@ int tdav_session_av_deinit(tdav_session_av_t* self)
TSK_OBJECT_SAFE_FREE(self->local_sdp);
TSK_FREE(self->remote_ip);
TSK_FREE(self->local_ip);
-
+
/* RED and ULPFEC codecs */
TSK_OBJECT_SAFE_FREE(self->red.codec);
TSK_OBJECT_SAFE_FREE(self->ulpfec.codec);
-
+
/* NAT Traversal context */
TSK_OBJECT_SAFE_FREE(self->natt_ctx);
TSK_OBJECT_SAFE_FREE(self->ice_ctx);
-
+
/* Last error */
- if(self->last_error.tid[0]){
+ if(self->last_error.tid[0]) {
tsk_thread_join(self->last_error.tid);
}
TSK_FREE(self->last_error.reason);
-
+
tsk_safeobj_deinit(self);
-
+
/* deinit base */
tmedia_session_deinit(TMEDIA_SESSION(self));
-
+
return 0;
}
@@ -1962,34 +2003,34 @@ int tdav_session_av_deinit(tdav_session_av_t* self)
static const tsdp_header_A_t* _sdp_findA_at(const sdp_headerM_Or_Message* sdp, const char* field, tsk_size_t index)
{
- if(sdp){
- if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_message_def_t){
+ if(sdp) {
+ if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_message_def_t) {
return tsdp_message_get_headerA_at((const tsdp_message_t*)sdp, field, index);
}
- else if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t){
+ else if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t) {
return tsdp_header_M_findA_at((const tsdp_header_M_t*)sdp, field, index);
}
}
-
+
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
static int _sdp_add_headerA(sdp_headerM_Or_Message* sdp, const char* field, const char* value)
{
- if(sdp && field){
- if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_message_def_t){
+ if(sdp && field) {
+ if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_message_def_t) {
return tsdp_message_add_headers((tsdp_message_t*)sdp,
TSDP_HEADER_A_VA_ARGS(field, value),
tsk_null);
}
- else if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t){
+ else if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t) {
return tsdp_header_M_add_headers((tsdp_header_M_t*)sdp,
TSDP_HEADER_A_VA_ARGS(field, value),
tsk_null);
}
}
-
+
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -1997,8 +2038,8 @@ static int _sdp_add_headerA(sdp_headerM_Or_Message* sdp, const char* field, cons
static RTP_PROFILE_T _sdp_profile_from_string(const char* profile)
{
int32_t i;
- for(i = 0; i < RTP_PROFILES_COUNT; ++i){
- if(tsk_striequals(RTP_PROFILES[i].name, profile)){
+ for(i = 0; i < RTP_PROFILES_COUNT; ++i) {
+ if(tsk_striequals(RTP_PROFILES[i].name, profile)) {
return RTP_PROFILES[i].type;
}
}
@@ -2008,8 +2049,8 @@ static RTP_PROFILE_T _sdp_profile_from_string(const char* profile)
static const char* _sdp_profile_to_string(RTP_PROFILE_T profile)
{
int32_t i;
- for(i = 0; i < RTP_PROFILES_COUNT; ++i){
- if(RTP_PROFILES[i].type == profile){
+ for(i = 0; i < RTP_PROFILES_COUNT; ++i) {
+ if(RTP_PROFILES[i].type == profile) {
return RTP_PROFILES[i].name;
}
}
@@ -2021,18 +2062,18 @@ _SDP_DECLARE_INDEX_OF(acap);
static const sdp_acap_xt* _sdp_acaps_find_by_field(const sdp_acap_xt (*acaps)[SDP_CAPS_COUNT_MAX], const char* field, int32_t index)
{
int32_t i, j, k, size;
-
- if(!acaps || !field){
+
+ if(!acaps || !field) {
TSK_DEBUG_ERROR("Invalid paramter");
return tsk_null;
}
-
+
i = 0, j = 0;
size = (int32_t)tsk_strlen(field);
- while((*acaps)[j].tag && j < SDP_CAPS_COUNT_MAX){
+ while((*acaps)[j].tag && j < SDP_CAPS_COUNT_MAX) {
k = _sdp_str_index_of((*acaps)[j].value, field);
- if(k == 0 && (*acaps)[j].value[size] == ':'){
- if(i == index){
+ if(k == 0 && (*acaps)[j].value[size] == ':') {
+ if(i == index) {
return &(*acaps)[j];
}
++i;
@@ -2047,52 +2088,52 @@ static int _sdp_acaps_from_sdp(const sdp_headerM_Or_Message* sdp, sdp_acap_xt (*
tsk_size_t acaps_count, acaps_idx;
const tsdp_header_A_t* A;
int32_t tag, index, size;
-
- if(!sdp || !acaps){
+
+ if(!sdp || !acaps) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
-
- if(reset){
+
+
+ if(reset) {
_sdp_acaps_reset(acaps);
acaps_count = 0;
}
- else{
- if((acaps_count = _sdp_acaps_indexof(acaps, 0)) == -1){
+ else {
+ if((acaps_count = _sdp_acaps_indexof(acaps, 0)) == -1) {
TSK_DEBUG_ERROR("No room to append items");
return -1;
}
}
-
+
acaps_idx = 0;
- while((A = _sdp_findA_at(sdp, "acap", acaps_idx++))){
- if (!(size = (int32_t)tsk_strlen(A->value))){
+ while((A = _sdp_findA_at(sdp, "acap", acaps_idx++))) {
+ if (!(size = (int32_t)tsk_strlen(A->value))) {
goto next;
}
- if(sscanf(A->value, "%d", &tag) == EOF){
+ if(sscanf(A->value, "%d", &tag) == EOF) {
TSK_DEBUG_ERROR("sscanf(%s) failed", A->value);
break;
}
- if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX){
+ if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX) {
TSK_DEBUG_WARN("Ignoring tag with value = %d", tag);
goto next;
}
-
+
index = _sdp_integer_length(tag) + 1;/*SPACE*/
- if(index >= size){
+ if(index >= size) {
TSK_DEBUG_WARN("a=%s is empty", A->value);
goto next;
}
-
+
(*acaps)[acaps_count].tag = tag;
(*acaps)[acaps_count].value = &A->value[index];
- next:
- if(++acaps_count >= SDP_CAPS_COUNT_MAX){
+next:
+ if(++acaps_count >= SDP_CAPS_COUNT_MAX) {
break;
}
}
-
+
return 0;
}
@@ -2104,60 +2145,60 @@ static int _sdp_tcaps_from_sdp(const sdp_headerM_Or_Message* sdp, sdp_tcap_xt (*
const tsdp_header_A_t* A;
int32_t tag, index, size, tag_fake;
char tcap[256];
-
- if(!sdp || !tcaps){
+
+ if(!sdp || !tcaps) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(reset){
+
+ if(reset) {
_sdp_tcaps_reset(tcaps);
tcaps_count = 0;
}
- else{
- if((tcaps_count = _sdp_tcaps_indexof(tcaps, 0)) == -1){
+ else {
+ if((tcaps_count = _sdp_tcaps_indexof(tcaps, 0)) == -1) {
TSK_DEBUG_ERROR("No room to append items");
return -1;
}
- }
-
+ }
+
profiles_count = 0;
index = 0;
tcaps_idx = 0;
- while((A = _sdp_findA_at(sdp, "tcap", tcaps_idx++))){
- if (!(size = (int32_t)tsk_strlen(A->value))){
+ while((A = _sdp_findA_at(sdp, "tcap", tcaps_idx++))) {
+ if (!(size = (int32_t)tsk_strlen(A->value))) {
goto next;
}
- if(sscanf(&A->value[index], "%d", &tag) == EOF || (_sdp_integer_length(tag) + 1 >= size)){
+ if(sscanf(&A->value[index], "%d", &tag) == EOF || (_sdp_integer_length(tag) + 1 >= size)) {
TSK_DEBUG_ERROR("sscanf(%s) failed", A->value);
break;
}
- if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX){
+ if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX) {
TSK_DEBUG_WARN("Ignoring tag with value = %d", tag);
goto next;
}
-
+
index += _sdp_integer_length(tag) + 1/*SPACE*/;
-
+
profiles_count = 0;
tag_fake = tag;
- while(sscanf(&A->value[index], "%255s", &tcap) != EOF){
- if(tag_fake < SDP_CAPS_COUNT_MAX){
+ while(sscanf(&A->value[index], "%255s", &tcap) != EOF) {
+ if(tag_fake < SDP_CAPS_COUNT_MAX) {
(*tcaps)[tcaps_count + profiles_count].tag = tag_fake;
(*tcaps)[tcaps_count + profiles_count].profile = _sdp_profile_from_string(tcap); // split profiles
}
- if ((index += (int32_t)tsk_strlen(tcap) + 1/*SPACE*/) >= size){
+ if ((index += (int32_t)tsk_strlen(tcap) + 1/*SPACE*/) >= size) {
break;
}
++tag_fake;
++profiles_count;
}
- next:
- if(++tcaps_count >= SDP_CAPS_COUNT_MAX){
+next:
+ if(++tcaps_count >= SDP_CAPS_COUNT_MAX) {
break;
}
}
-
+
return 0;
}
@@ -2165,42 +2206,42 @@ static int _sdp_acfg_to_sdp(sdp_headerM_Or_Message* sdp, const sdp_acfg_xt *acfg
{
int32_t i_a_caps;
char *acfg_str = tsk_null;
-
- if(!sdp || !acfg || acfg->tag <= 0){
+
+ if(!sdp || !acfg || acfg->tag <= 0) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// acfg: tag
tsk_strcat_2(&acfg_str, "%d", acfg->tag);
// acfg: t=
- if(acfg_str && acfg->tcap.tag > 0){
+ if(acfg_str && acfg->tcap.tag > 0) {
tsk_strcat_2(&acfg_str, " t=%d", acfg->tcap.tag);
}
// acfg: a=
- for (i_a_caps = 0; acfg_str && i_a_caps < SDP_CAPS_COUNT_MAX; ++i_a_caps){
- if(acfg->acaps[i_a_caps].tag <= 0){
+ for (i_a_caps = 0; acfg_str && i_a_caps < SDP_CAPS_COUNT_MAX; ++i_a_caps) {
+ if(acfg->acaps[i_a_caps].tag <= 0) {
break;
}
- if(i_a_caps == 0){
+ if(i_a_caps == 0) {
tsk_strcat_2(&acfg_str, " a=%d", acfg->acaps[i_a_caps].tag);
}
- else{
+ else {
tsk_strcat_2(&acfg_str, "%s%s%d%s", // e.g. |2 or ,6 or ,[2]
acfg->acaps[i_a_caps].or ? "|" : ",",
acfg->acaps[i_a_caps].optional ? "[" : "",
acfg->acaps[i_a_caps].tag,
acfg->acaps[i_a_caps].optional ? "]" : ""
- );
+ );
}
}
-
+
// a=acfg:
- if(acfg_str){
+ if(acfg_str) {
_sdp_add_headerA(sdp, "acfg", acfg_str);
TSK_FREE(acfg_str);
}
-
+
return 0;
}
@@ -2214,79 +2255,79 @@ static int _sdp_pcfgs_from_sdp(const sdp_headerM_Or_Message* sdp, sdp_acap_xt (*
sdp_tcap_xt* tcap_curr;
int ret;
char pcfg[256], a[256];
-
- if(!sdp || !acaps || !tcaps || !pcfgs){
+
+ if(!sdp || !acaps || !tcaps || !pcfgs) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if((ret = _sdp_tcaps_from_sdp(sdp, tcaps, reset))){
+
+ if((ret = _sdp_tcaps_from_sdp(sdp, tcaps, reset))) {
return ret;
}
- if((ret = _sdp_acaps_from_sdp(sdp, acaps, reset))){
+ if((ret = _sdp_acaps_from_sdp(sdp, acaps, reset))) {
return ret;
}
-
- if(reset){
+
+ if(reset) {
_sdp_pcfgs_reset(pcfgs);
pcfgs_count = 0;
}
- else{
- if((pcfgs_count = _sdp_pcfgs_indexof(pcfgs, 0)) == -1){
+ else {
+ if((pcfgs_count = _sdp_pcfgs_indexof(pcfgs, 0)) == -1) {
TSK_DEBUG_ERROR("No room to append items");
return -1;
}
}
-
+
pcfgs_idx = 0;
tcap_curr = tsk_null;
- while((A = _sdp_findA_at(sdp, "pcfg", pcfgs_idx++))){
- if (!(size = (int32_t)tsk_strlen(A->value))){
+ while((A = _sdp_findA_at(sdp, "pcfg", pcfgs_idx++))) {
+ if (!(size = (int32_t)tsk_strlen(A->value))) {
goto next_A;
}
- if(sscanf(A->value, "%d", &tag) == EOF || (_sdp_integer_length(tag) + 1 >= size)){
+ if(sscanf(A->value, "%d", &tag) == EOF || (_sdp_integer_length(tag) + 1 >= size)) {
TSK_DEBUG_ERROR("sscanf(%s) failed", A->value);
break;
}
- if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX){
+ if(tag <= 0 || (tag + 1) > SDP_CAPS_COUNT_MAX) {
TSK_DEBUG_WARN("Ignoring tag with value = %d", tag);
goto next_A;
}
-
+
(*pcfgs)[pcfgs_count].tag = tag;
-
+
index = _sdp_integer_length(tag) + 1/*SPACE*/;
-
- while(sscanf(&A->value[index], "%255s", &pcfg) != EOF){
- if(_sdp_str_starts_with(&A->value[index], "t=") && sscanf(pcfg, "t=%d", &t) != EOF){
- if(t <= 0 || t + 1 >= SDP_CAPS_COUNT_MAX){
+
+ while(sscanf(&A->value[index], "%255s", &pcfg) != EOF) {
+ if(_sdp_str_starts_with(&A->value[index], "t=") && sscanf(pcfg, "t=%d", &t) != EOF) {
+ if(t <= 0 || t + 1 >= SDP_CAPS_COUNT_MAX) {
TSK_DEBUG_ERROR("t = %d ignored", t);
goto next_pcfg;
}
// tcap is something like a=tcap:1 RTP/SAVPF RTP/SAVP RTP/AVPF
// tcap [2] is "RTP/SAVP" -> not indexed by tag
tcap_curr = &(*pcfgs)[pcfgs_count].tcap;
- if((indexof = _sdp_tcaps_indexof(tcaps, t)) == -1){
+ if((indexof = _sdp_tcaps_indexof(tcaps, t)) == -1) {
TSK_DEBUG_ERROR("Failed to find 'tcap' with tag=%d", t);
goto next_pcfg;
}
*tcap_curr = (*tcaps)[indexof];
}
- else{
- if(_sdp_str_starts_with(&A->value[index], "a=") && sscanf(pcfg, "a=%255s", a) != EOF){
+ else {
+ if(_sdp_str_starts_with(&A->value[index], "a=") && sscanf(pcfg, "a=%255s", a) != EOF) {
char a_copy[sizeof(a)], *pch, *saveptr;
tsk_size_t pcfg_acfgs_count = 0;
sdp_acap_xt* acap;
memcpy(a_copy, a, sizeof(a));
-
+
pch = tsk_strtok_r (a, ",[]|", &saveptr);
- while(pch){
+ while(pch) {
a_tag = atoi(pch);
- if(a_tag <= 0 || a_tag + 1 >= SDP_CAPS_COUNT_MAX){
+ if(a_tag <= 0 || a_tag + 1 >= SDP_CAPS_COUNT_MAX) {
TSK_DEBUG_ERROR("a = %d ignored", a_tag);
goto next_a;
}
- if((indexof = _sdp_acaps_indexof(acaps, a_tag)) == -1){
+ if((indexof = _sdp_acaps_indexof(acaps, a_tag)) == -1) {
TSK_DEBUG_ERROR("Failed to find 'acap' with tag=%d", a_tag);
goto next_a;
}
@@ -2294,23 +2335,23 @@ static int _sdp_pcfgs_from_sdp(const sdp_headerM_Or_Message* sdp, sdp_acap_xt (*
*acap = (*acaps)[indexof];
acap->optional = (pch != a && a_copy[pch - a - 1] == '[') ? 1 : 0;
acap->or = (pch != a && a_copy[pch - a - 1] == '|') ? 1 : 0;
- next_a:
+next_a:
pch = tsk_strtok_r(tsk_null, ",[]|", &saveptr);
}
}
tcap_curr = tsk_null;
}
- next_pcfg:
- if ((index += (int32_t)tsk_strlen(pcfg) + 1/*SPACE*/) >= size){
+next_pcfg:
+ if ((index += (int32_t)tsk_strlen(pcfg) + 1/*SPACE*/) >= size) {
break;
}
}
- next_A:
- if(++pcfgs_count >= SDP_CAPS_COUNT_MAX){
+next_A:
+ if(++pcfgs_count >= SDP_CAPS_COUNT_MAX) {
break;
}
}
-
+
return ret;
}
@@ -2319,77 +2360,77 @@ static int _sdp_pcfgs_to_sdp(sdp_headerM_Or_Message* sdp, const sdp_pcfg_xt (*pc
int32_t i_pcfgs, i_a_caps, i_serialized_acaps;
char *pcfg = tsk_null, *acap = tsk_null, *tcap = tsk_null;
sdp_acaps_xt serialized_acaps; /* to avoid duplication */
-
- if(!sdp || !pcfgs){
+
+ if(!sdp || !pcfgs) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// compact(a=tcap:)
// tcap:1 RTP/AVP
// tcap:2 RTP/SAVP
// tcap:3 RTP/SAVPF
// will be compacted as
// tcap:1 RTP/AVP RTP/SAVP RTP/SAVPF
- for (i_pcfgs = 0; i_pcfgs < SDP_CAPS_COUNT_MAX; ++i_pcfgs){
- if((*pcfgs)[i_pcfgs].tag <= 0 || (*pcfgs)[i_pcfgs].tcap.tag <= 0){
+ for (i_pcfgs = 0; i_pcfgs < SDP_CAPS_COUNT_MAX; ++i_pcfgs) {
+ if((*pcfgs)[i_pcfgs].tag <= 0 || (*pcfgs)[i_pcfgs].tcap.tag <= 0) {
break;
}
- if(!tcap){
+ if(!tcap) {
tsk_sprintf(&tcap, "1 %s", _sdp_profile_to_string((*pcfgs)[i_pcfgs].tcap.profile));
}
- else{
+ else {
tsk_strcat_2(&tcap, " %s", _sdp_profile_to_string((*pcfgs)[i_pcfgs].tcap.profile));
}
}
- if(tcap){
+ if(tcap) {
_sdp_add_headerA(sdp, "tcap", tcap);
TSK_FREE(tcap);
}
-
+
_sdp_acaps_reset(&serialized_acaps);
i_serialized_acaps = 0;
-
- for (i_pcfgs = 0; i_pcfgs < SDP_CAPS_COUNT_MAX; ++i_pcfgs){
- if((*pcfgs)[i_pcfgs].tag <= 0){
+
+ for (i_pcfgs = 0; i_pcfgs < SDP_CAPS_COUNT_MAX; ++i_pcfgs) {
+ if((*pcfgs)[i_pcfgs].tag <= 0) {
break;
}
// pcfg: tag
tsk_strcat_2(&pcfg, "%d", (*pcfgs)[i_pcfgs].tag);
// pcfg: t=
- if((*pcfgs)[i_pcfgs].tcap.tag > 0){
+ if((*pcfgs)[i_pcfgs].tcap.tag > 0) {
tsk_strcat_2(&pcfg, " t=%d", (*pcfgs)[i_pcfgs].tcap.tag);
}
-
+
// pcfg: a=
- for (i_a_caps = 0; i_a_caps < SDP_CAPS_COUNT_MAX; ++i_a_caps){
- if((*pcfgs)[i_pcfgs].acaps[i_a_caps].tag <= 0){
+ for (i_a_caps = 0; i_a_caps < SDP_CAPS_COUNT_MAX; ++i_a_caps) {
+ if((*pcfgs)[i_pcfgs].acaps[i_a_caps].tag <= 0) {
break;
}
- if(i_a_caps == 0){
+ if(i_a_caps == 0) {
tsk_strcat_2(&pcfg, " a=%d", (*pcfgs)[i_pcfgs].acaps[i_a_caps].tag);
}
- else{
+ else {
tsk_strcat_2(&pcfg, "%s%s%d%s", // e.g. |2 or ,6 or ,[2]
(*pcfgs)[i_pcfgs].acaps[i_a_caps].or ? "|" : ",",
(*pcfgs)[i_pcfgs].acaps[i_a_caps].optional ? "[" : "",
(*pcfgs)[i_pcfgs].acaps[i_a_caps].tag,
(*pcfgs)[i_pcfgs].acaps[i_a_caps].optional ? "]" : ""
- );
+ );
}
// a=acap:
- if(_sdp_acaps_indexof(&serialized_acaps, (*pcfgs)[i_pcfgs].acaps[i_a_caps].tag) == -1){
+ if(_sdp_acaps_indexof(&serialized_acaps, (*pcfgs)[i_pcfgs].acaps[i_a_caps].tag) == -1) {
tsk_sprintf(&acap, "%d %s", (*pcfgs)[i_pcfgs].acaps[i_a_caps].tag, (*pcfgs)[i_pcfgs].acaps[i_a_caps].value);
- if(acap){
+ if(acap) {
_sdp_add_headerA(sdp, "acap", acap);
TSK_FREE(acap);
serialized_acaps[i_serialized_acaps++].tag = (*pcfgs)[i_pcfgs].acaps[i_a_caps].tag;
}
}
}
-
+
// a=pcfg:
- if(pcfg){
+ if(pcfg) {
_sdp_add_headerA(sdp, "pcfg", pcfg);
TSK_FREE(pcfg);
}
@@ -2401,44 +2442,46 @@ static int _sdp_pcfg_ensure(sdp_headerM_Or_Message* sdp, const sdp_pcfg_xt* pcfg
{
int32_t i, n;
char field[256];
-
- if(!sdp || !pcfg || pcfg->tag <=0){
+
+ if(!sdp || !pcfg || pcfg->tag <=0) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t && pcfg->tcap.profile != RTP_PROFILE_NONE){
+
+ if(TSK_OBJECT_HEADER(sdp)->__def__ == tsdp_header_M_def_t && pcfg->tcap.profile != RTP_PROFILE_NONE) {
tsk_strupdate(&((tsdp_header_M_t*)sdp)->proto, _sdp_profile_to_string(pcfg->tcap.profile));
}
-
- for(i = 0; i < SDP_CAPS_COUNT_MAX && pcfg->acaps[i].tag > 0; ++i){
- if (sscanf(pcfg->acaps[i].value, "%255s%*s", field) != EOF && (n = (int32_t)tsk_strlen(field)) > 2){
+
+ for(i = 0; i < SDP_CAPS_COUNT_MAX && pcfg->acaps[i].tag > 0; ++i) {
+ if (sscanf(pcfg->acaps[i].value, "%255s%*s", field) != EOF && (n = (int32_t)tsk_strlen(field)) > 2) {
field[n - 2] = '\0';
_sdp_add_headerA(sdp, field, &pcfg->acaps[i].value[n + 1/*SPACE*/]);
}
}
-
+
return 0;
}
static int _sdp_pcfgs_cat(const sdp_pcfg_xt (*pcfgs_src)[SDP_CAPS_COUNT_MAX], sdp_pcfg_xt (*pcfgs_dst)[SDP_CAPS_COUNT_MAX])
{
int32_t i, j;
- if(!pcfgs_src || !pcfgs_dst){
+ if(!pcfgs_src || !pcfgs_dst) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
for(i = 0; i < SDP_CAPS_COUNT_MAX && (*pcfgs_dst)[i].tag > 0; ++i);
-
+
j = 0;
- while (i < SDP_CAPS_COUNT_MAX && j < SDP_CAPS_COUNT_MAX){
- if((*pcfgs_src)[j].tag > 0){
+ while (i < SDP_CAPS_COUNT_MAX && j < SDP_CAPS_COUNT_MAX) {
+ if((*pcfgs_src)[j].tag > 0) {
(*pcfgs_dst)[i++] = (*pcfgs_src)[j++];
}
- else break;
+ else {
+ break;
+ }
}
-
+
return 0;
}
@@ -2449,23 +2492,22 @@ static int _sdp_pcfgs_cat(const sdp_pcfg_xt (*pcfgs_src)[SDP_CAPS_COUNT_MAX], sd
static tsk_object_t* tdav_sdp_caps_ctor(tsk_object_t * self, va_list * app)
{
tdav_sdp_caps_t *caps = self;
- if(caps){
+ if(caps) {
}
return self;
}
static tsk_object_t* tdav_sdp_caps_dtor(tsk_object_t * self)
-{
+{
tdav_sdp_caps_t *caps = self;
- if(caps){
+ if(caps) {
}
return self;
}
-static const tsk_object_def_t tdav_sdp_caps_def_s =
-{
+static const tsk_object_def_t tdav_sdp_caps_def_s = {
sizeof(tdav_sdp_caps_t),
- tdav_sdp_caps_ctor,
+ tdav_sdp_caps_ctor,
tdav_sdp_caps_dtor,
- tsk_null,
+ tsk_null,
};
static tdav_sdp_caps_t* tdav_sdp_caps_create()
diff --git a/tinyDAV/src/tdav_win32.c b/tinyDAV/src/tdav_win32.c
index 789fc77..731e04a 100755
--- a/tinyDAV/src/tdav_win32.c
+++ b/tinyDAV/src/tdav_win32.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,7 +39,7 @@ Version Number Description
6.2 Windows 8 / Windows Server 2012
6.1 Windows 7 / Windows 2008 R2
6.0 Windows Vista / Windows 2008
-5.2 Windows 2003
+5.2 Windows 2003
5.1 Windows XP
5.0 Windows 2000
*/
@@ -49,13 +49,13 @@ static DWORD dwMinorVersion = -1;
#if (TDAV_UNDER_WINDOWS_RT || TDAV_UNDER_WINDOWS_CE)
const HMODULE GetCurrentModule()
{
- return NULL;
+ return NULL;
}
#else
const HMODULE GetCurrentModule()
{
- HMODULE hm = {0};
- GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)GetCurrentModule, &hm);
+ HMODULE hm = {0};
+ GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)GetCurrentModule, &hm);
return hm;
}
#endif /* !(TDAV_UNDER_WINDOWS_RT || TDAV_UNDER_WINDOWS_CE) */
@@ -63,172 +63,172 @@ const HMODULE GetCurrentModule()
int tdav_win32_init()
{
#if !TDAV_UNDER_WINDOWS_RT
- MMRESULT result;
-
+ MMRESULT result;
+
#if !TDAV_UNDER_WINDOWS_CE
- CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
- // Timers accuracy
- result = timeBeginPeriod(1);
- if (result) {
- TSK_DEBUG_ERROR("timeBeginPeriod(1) returned result=%u", result);
- }
-
- // Get OS version
- if(dwMajorVersion == -1 || dwMinorVersion == -1){
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- dwMajorVersion = osvi.dwMajorVersion;
- dwMinorVersion = osvi.dwMinorVersion;
+ // Timers accuracy
+ result = timeBeginPeriod(1);
+ if (result) {
+ TSK_DEBUG_ERROR("timeBeginPeriod(1) returned result=%u", result);
+ }
+
+ // Get OS version
+ if(dwMajorVersion == -1 || dwMinorVersion == -1) {
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ dwMajorVersion = osvi.dwMajorVersion;
+ dwMinorVersion = osvi.dwMinorVersion;
#if TDAV_UNDER_WINDOWS_CE && (BUILD_TYPE_GE && SIN_CITY)
- TSK_DEBUG_INFO("Windows dwMajorVersion=%ld, dwMinorVersion=%ld\n", dwMajorVersion, dwMinorVersion);
+ TSK_DEBUG_INFO("Windows dwMajorVersion=%ld, dwMinorVersion=%ld\n", dwMajorVersion, dwMinorVersion);
#else
- fprintf(stdout, "Windows dwMajorVersion=%ld, dwMinorVersion=%ld\n", dwMajorVersion, dwMinorVersion);
+ fprintf(stdout, "Windows dwMajorVersion=%ld, dwMinorVersion=%ld\n", dwMajorVersion, dwMinorVersion);
#endif
- }
+ }
#endif
- return 0;
+ return 0;
}
int tdav_win32_get_osversion(unsigned long* version_major, unsigned long* version_minor)
{
- if (version_major) {
- *version_major = dwMajorVersion;
- }
- if (version_minor) {
- *version_minor = dwMinorVersion;
- }
- return 0;
+ if (version_major) {
+ *version_major = dwMajorVersion;
+ }
+ if (version_minor) {
+ *version_minor = dwMinorVersion;
+ }
+ return 0;
}
tsk_bool_t tdav_win32_is_win8_or_later()
{
- if (dwMajorVersion == -1 || dwMinorVersion == -1) {
- TSK_DEBUG_ERROR("Version numbers are invalid");
- return tsk_false;
- }
- return ((dwMajorVersion > 6) || ((dwMajorVersion == 6) && (dwMinorVersion >= 2)));
+ if (dwMajorVersion == -1 || dwMinorVersion == -1) {
+ TSK_DEBUG_ERROR("Version numbers are invalid");
+ return tsk_false;
+ }
+ return ((dwMajorVersion > 6) || ((dwMajorVersion == 6) && (dwMinorVersion >= 2)));
}
tsk_bool_t tdav_win32_is_win7_or_later()
{
- if (dwMajorVersion == -1 || dwMinorVersion == -1) {
- TSK_DEBUG_ERROR("Version numbers are invalid");
- return tsk_false;
- }
- return ( (dwMajorVersion > 6) || ( (dwMajorVersion == 6) && (dwMinorVersion >= 1) ) );
+ if (dwMajorVersion == -1 || dwMinorVersion == -1) {
+ TSK_DEBUG_ERROR("Version numbers are invalid");
+ return tsk_false;
+ }
+ return ( (dwMajorVersion > 6) || ( (dwMajorVersion == 6) && (dwMinorVersion >= 1) ) );
}
tsk_bool_t tdav_win32_is_winvista_or_later()
{
- if (dwMajorVersion == -1 || dwMinorVersion == -1) {
- TSK_DEBUG_ERROR("Version numbers are invalid");
- return tsk_false;
- }
- return (dwMajorVersion >= 6);
+ if (dwMajorVersion == -1 || dwMinorVersion == -1) {
+ TSK_DEBUG_ERROR("Version numbers are invalid");
+ return tsk_false;
+ }
+ return (dwMajorVersion >= 6);
}
tsk_bool_t tdav_win32_is_winxp_or_later()
{
- if (dwMajorVersion == -1 || dwMinorVersion == -1) {
- TSK_DEBUG_ERROR("Version numbers are invalid");
- return tsk_false;
- }
- return ( (dwMajorVersion > 5) || ( (dwMajorVersion == 5) && (dwMinorVersion >= 1) ) );
+ if (dwMajorVersion == -1 || dwMinorVersion == -1) {
+ TSK_DEBUG_ERROR("Version numbers are invalid");
+ return tsk_false;
+ }
+ return ( (dwMajorVersion > 5) || ( (dwMajorVersion == 5) && (dwMinorVersion >= 1) ) );
}
const char* tdav_get_current_directory_const()
{
#if TDAV_UNDER_WINDOWS_RT
- TSK_DEBUG_ERROR("Not supported");
- return tsk_null;
+ TSK_DEBUG_ERROR("Not supported");
+ return tsk_null;
#else
- static char CURRENT_DIR_PATH[MAX_PATH] = { 0 };
- static DWORD CURRENT_DIR_PATH_LEN = 0;
- if (CURRENT_DIR_PATH_LEN == 0) {
- // NULL HMODULE will get the path to the executable not the DLL. When runing the code in Internet Explorer this is a BIG issue as the path is where IE.exe is installed.
+ static char CURRENT_DIR_PATH[MAX_PATH] = { 0 };
+ static DWORD CURRENT_DIR_PATH_LEN = 0;
+ if (CURRENT_DIR_PATH_LEN == 0) {
+ // NULL HMODULE will get the path to the executable not the DLL. When runing the code in Internet Explorer this is a BIG issue as the path is where IE.exe is installed.
#if TDAV_UNDER_WINDOWS_CE
- static wchar_t TMP_CURRENT_DIR_PATH[MAX_PATH] = { 0 };
- if ((CURRENT_DIR_PATH_LEN = GetModuleFileName(GetCurrentModule(), TMP_CURRENT_DIR_PATH, sizeof(TMP_CURRENT_DIR_PATH)))) {
- if ((CURRENT_DIR_PATH_LEN = wcstombs(CURRENT_DIR_PATH, TMP_CURRENT_DIR_PATH, sizeof(CURRENT_DIR_PATH) - 1))) {
- int idx = tsk_strLastIndexOf(CURRENT_DIR_PATH, CURRENT_DIR_PATH_LEN, "\\");
- if (idx > -1) {
- CURRENT_DIR_PATH[idx] = '\0';
- CURRENT_DIR_PATH_LEN = idx;
- }
- }
- }
+ static wchar_t TMP_CURRENT_DIR_PATH[MAX_PATH] = { 0 };
+ if ((CURRENT_DIR_PATH_LEN = GetModuleFileName(GetCurrentModule(), TMP_CURRENT_DIR_PATH, sizeof(TMP_CURRENT_DIR_PATH)))) {
+ if ((CURRENT_DIR_PATH_LEN = wcstombs(CURRENT_DIR_PATH, TMP_CURRENT_DIR_PATH, sizeof(CURRENT_DIR_PATH) - 1))) {
+ int idx = tsk_strLastIndexOf(CURRENT_DIR_PATH, CURRENT_DIR_PATH_LEN, "\\");
+ if (idx > -1) {
+ CURRENT_DIR_PATH[idx] = '\0';
+ CURRENT_DIR_PATH_LEN = idx;
+ }
+ }
+ }
#else
- if ((CURRENT_DIR_PATH_LEN = GetModuleFileNameA(GetCurrentModule(), CURRENT_DIR_PATH, sizeof(CURRENT_DIR_PATH)))) {
- if (!PathRemoveFileSpecA(CURRENT_DIR_PATH)) {
- TSK_DEBUG_ERROR("PathRemoveFileSpec(%s) failed: %x", CURRENT_DIR_PATH, GetLastError());
- memset(CURRENT_DIR_PATH, 0, sizeof(CURRENT_DIR_PATH));
- CURRENT_DIR_PATH_LEN = 0;
- }
- }
+ if ((CURRENT_DIR_PATH_LEN = GetModuleFileNameA(GetCurrentModule(), CURRENT_DIR_PATH, sizeof(CURRENT_DIR_PATH)))) {
+ if (!PathRemoveFileSpecA(CURRENT_DIR_PATH)) {
+ TSK_DEBUG_ERROR("PathRemoveFileSpec(%s) failed: %x", CURRENT_DIR_PATH, GetLastError());
+ memset(CURRENT_DIR_PATH, 0, sizeof(CURRENT_DIR_PATH));
+ CURRENT_DIR_PATH_LEN = 0;
+ }
+ }
#endif /* TDAV_UNDER_WINDOWS_CE */
- if (!CURRENT_DIR_PATH_LEN) {
- TSK_DEBUG_ERROR("GetModuleFileNameA() failed: %x", GetLastError());
- }
- }
- return CURRENT_DIR_PATH;
+ if (!CURRENT_DIR_PATH_LEN) {
+ TSK_DEBUG_ERROR("GetModuleFileNameA() failed: %x", GetLastError());
+ }
+ }
+ return CURRENT_DIR_PATH;
#endif /* TDAV_UNDER_WINDOWS_RT */
}
TINYDAV_API void tdav_win32_print_error(const char* func, HRESULT hr)
{
- CHAR message[1024] = {0};
+ CHAR message[1024] = {0};
#if (TDAV_UNDER_WINDOWS_RT || TDAV_UNDER_WINDOWS_CE)
#if !defined(WC_ERR_INVALID_CHARS)
#define WC_ERR_INVALID_CHARS 0
#endif
- // FormatMessageA not allowed on the Store
- static WCHAR wBuff[1024] = {0};
- FormatMessageW(
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- hr,
- 0,
- wBuff,
- sizeof(wBuff)-1,
- tsk_null);
- WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), message, sizeof(message) - 1, NULL, NULL);
+ // FormatMessageA not allowed on the Store
+ static WCHAR wBuff[1024] = {0};
+ FormatMessageW(
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ hr,
+ 0,
+ wBuff,
+ sizeof(wBuff)-1,
+ tsk_null);
+ WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), message, sizeof(message) - 1, NULL, NULL);
#else
- FormatMessageA
- (
+ FormatMessageA
+ (
#if !TDAV_UNDER_WINDOWS_RT
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
#endif
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- hr,
- 0,
- message,
- sizeof(message) - 1,
- tsk_null);
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ hr,
+ 0,
+ message,
+ sizeof(message) - 1,
+ tsk_null);
#endif
- TSK_DEBUG_ERROR("%s(): %s", func, message);
+ TSK_DEBUG_ERROR("%s(): %s", func, message);
}
int tdav_win32_deinit()
{
#if !(TDAV_UNDER_WINDOWS_RT || TDAV_UNDER_WINDOWS_CE)
- MMRESULT result;
+ MMRESULT result;
- // Timers accuracy
- result = timeEndPeriod(1);
- if(result){
- TSK_DEBUG_ERROR("timeEndPeriod(1) returned result=%u", result);
- }
+ // Timers accuracy
+ result = timeEndPeriod(1);
+ if(result) {
+ TSK_DEBUG_ERROR("timeEndPeriod(1) returned result=%u", result);
+ }
#endif
- return 0;
+ return 0;
}
#endif /* TDAV_UNDER_WINDOWS */ \ No newline at end of file
diff --git a/tinyDAV/src/video/directx/tdav_producer_screencast_d3d9.cxx b/tinyDAV/src/video/directx/tdav_producer_screencast_d3d9.cxx
index 7efd1d6..b95a8e2 100755
--- a/tinyDAV/src/video/directx/tdav_producer_screencast_d3d9.cxx
+++ b/tinyDAV/src/video/directx/tdav_producer_screencast_d3d9.cxx
@@ -22,10 +22,10 @@
#include <windows.h>
#if TDAV_UNDER_WINDOWS_CE
- // Direct3D Mobile (D3DM) was removed from Windows CE in version 7.
- // Only include that header if running version 5 or 6. (When this
- // class's implementation is complete, we'll need to revisit how
- // this entire file is compiled.)
+// Direct3D Mobile (D3DM) was removed from Windows CE in version 7.
+// Only include that header if running version 5 or 6. (When this
+// class's implementation is complete, we'll need to revisit how
+// this entire file is compiled.)
# if _WIN32_WCE >= 0x0500 && _WIN32_WCE < 0x0700
# include <D3dm.h>
# endif
@@ -55,60 +55,59 @@
#define D3D9_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR("[D3D9 Producer] " FMT, ##__VA_ARGS__)
#define D3D9_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[D3D9 Producer] " FMT, ##__VA_ARGS__)
-typedef struct tdav_producer_screencast_d3d9_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_screencast_d3d9_s {
+ TMEDIA_DECLARE_PRODUCER;
- HWND hwnd_preview;
- HWND hwnd_src;
+ HWND hwnd_preview;
+ HWND hwnd_src;
- tsk_thread_handle_t* tid[1];
+ tsk_thread_handle_t* tid[1];
- void* p_buff_src; // must use VirtualAlloc()
- tsk_size_t n_buff_src;
- void* p_buff_neg; // must use VirtualAlloc()
- tsk_size_t n_buff_neg;
+ void* p_buff_src; // must use VirtualAlloc()
+ tsk_size_t n_buff_src;
+ void* p_buff_neg; // must use VirtualAlloc()
+ tsk_size_t n_buff_neg;
- tsk_bool_t b_started;
- tsk_bool_t b_paused;
- tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_paused;
+ tsk_bool_t b_muted;
- RECT rcScreen;
+ RECT rcScreen;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_producer_screencast_d3d9_t;
/* ============ Media Producer Interface ================= */
static int _tdav_producer_screencast_d3d9_set(tmedia_producer_t *p_self, const tmedia_param_t* pc_param)
{
- D3D9_DEBUG_ERROR("Not implemented");
- return -1;
+ D3D9_DEBUG_ERROR("Not implemented");
+ return -1;
}
static int _tdav_producer_screencast_d3d9_prepare(tmedia_producer_t* p_self, const tmedia_codec_t* pc_codec)
{
- D3D9_DEBUG_ERROR("Not implemented");
- return -1;
+ D3D9_DEBUG_ERROR("Not implemented");
+ return -1;
}
static int _tdav_producer_screencast_d3d9_start(tmedia_producer_t* p_self)
{
- D3D9_DEBUG_ERROR("Not implemented");
- return -1;
+ D3D9_DEBUG_ERROR("Not implemented");
+ return -1;
}
static int _tdav_producer_screencast_d3d9_pause(tmedia_producer_t* p_self)
{
- D3D9_DEBUG_ERROR("Not implemented");
- return -1;
+ D3D9_DEBUG_ERROR("Not implemented");
+ return -1;
}
static int _tdav_producer_screencast_d3d9_stop(tmedia_producer_t* p_self)
{
- D3D9_DEBUG_ERROR("Not implemented");
- return -1;
+ D3D9_DEBUG_ERROR("Not implemented");
+ return -1;
}
//
@@ -117,68 +116,66 @@ static int _tdav_producer_screencast_d3d9_stop(tmedia_producer_t* p_self)
/* constructor */
static tsk_object_t* _tdav_producer_screencast_d3d9_ctor(tsk_object_t *self, va_list * app)
{
- tdav_producer_screencast_d3d9_t *p_d3d9 = (tdav_producer_screencast_d3d9_t *)self;
- if (p_d3d9) {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(p_d3d9));
- TMEDIA_PRODUCER(p_d3d9)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
- /* init self with default values*/
- TMEDIA_PRODUCER(p_d3d9)->video.fps = 15;
- TMEDIA_PRODUCER(p_d3d9)->video.width = 352;
- TMEDIA_PRODUCER(p_d3d9)->video.height = 288;
-
- tsk_safeobj_init(p_d3d9);
- }
- return self;
+ tdav_producer_screencast_d3d9_t *p_d3d9 = (tdav_producer_screencast_d3d9_t *)self;
+ if (p_d3d9) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(p_d3d9));
+ TMEDIA_PRODUCER(p_d3d9)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+ /* init self with default values*/
+ TMEDIA_PRODUCER(p_d3d9)->video.fps = 15;
+ TMEDIA_PRODUCER(p_d3d9)->video.width = 352;
+ TMEDIA_PRODUCER(p_d3d9)->video.height = 288;
+
+ tsk_safeobj_init(p_d3d9);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* _tdav_producer_screencast_d3d9_dtor(tsk_object_t * self)
{
- tdav_producer_screencast_d3d9_t *p_d3d9 = (tdav_producer_screencast_d3d9_t *)self;
- if (p_d3d9) {
- /* stop */
- if (p_d3d9->b_started) {
- _tdav_producer_screencast_d3d9_stop((tmedia_producer_t*)p_d3d9);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(p_d3d9));
- /* deinit self */
- if (p_d3d9->p_buff_neg) {
- VirtualFree(p_d3d9->p_buff_neg, 0, MEM_RELEASE);
- p_d3d9->p_buff_neg = NULL;
- }
- if (p_d3d9->p_buff_src) {
- VirtualFree(p_d3d9->p_buff_src, 0, MEM_RELEASE);
- p_d3d9->p_buff_src = NULL;
- }
- tsk_safeobj_deinit(p_d3d9);
-
- TSK_DEBUG_INFO("*** d3d9 Screencast producer destroyed ***");
- }
-
- return self;
+ tdav_producer_screencast_d3d9_t *p_d3d9 = (tdav_producer_screencast_d3d9_t *)self;
+ if (p_d3d9) {
+ /* stop */
+ if (p_d3d9->b_started) {
+ _tdav_producer_screencast_d3d9_stop((tmedia_producer_t*)p_d3d9);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(p_d3d9));
+ /* deinit self */
+ if (p_d3d9->p_buff_neg) {
+ VirtualFree(p_d3d9->p_buff_neg, 0, MEM_RELEASE);
+ p_d3d9->p_buff_neg = NULL;
+ }
+ if (p_d3d9->p_buff_src) {
+ VirtualFree(p_d3d9->p_buff_src, 0, MEM_RELEASE);
+ p_d3d9->p_buff_src = NULL;
+ }
+ tsk_safeobj_deinit(p_d3d9);
+
+ TSK_DEBUG_INFO("*** d3d9 Screencast producer destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_screencast_d3d9_def_s =
-{
- sizeof(tdav_producer_screencast_d3d9_t),
- _tdav_producer_screencast_d3d9_ctor,
- _tdav_producer_screencast_d3d9_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_screencast_d3d9_def_s = {
+ sizeof(tdav_producer_screencast_d3d9_t),
+ _tdav_producer_screencast_d3d9_ctor,
+ _tdav_producer_screencast_d3d9_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_screencast_d3d9_plugin_def_s =
-{
- &tdav_producer_screencast_d3d9_def_s,
- tmedia_bfcp_video,
- "Microsoft Direct3D screencast producer",
-
- _tdav_producer_screencast_d3d9_set,
- _tdav_producer_screencast_d3d9_prepare,
- _tdav_producer_screencast_d3d9_start,
- _tdav_producer_screencast_d3d9_pause,
- _tdav_producer_screencast_d3d9_stop
+static const tmedia_producer_plugin_def_t tdav_producer_screencast_d3d9_plugin_def_s = {
+ &tdav_producer_screencast_d3d9_def_s,
+ tmedia_bfcp_video,
+ "Microsoft Direct3D screencast producer",
+
+ _tdav_producer_screencast_d3d9_set,
+ _tdav_producer_screencast_d3d9_prepare,
+ _tdav_producer_screencast_d3d9_start,
+ _tdav_producer_screencast_d3d9_pause,
+ _tdav_producer_screencast_d3d9_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_screencast_d3d9_plugin_def_t = &tdav_producer_screencast_d3d9_plugin_def_s;
diff --git a/tinyDAV/src/video/directx/tdav_producer_screencast_ddraw.cxx b/tinyDAV/src/video/directx/tdav_producer_screencast_ddraw.cxx
index 13507db..607b5ff 100755
--- a/tinyDAV/src/video/directx/tdav_producer_screencast_ddraw.cxx
+++ b/tinyDAV/src/video/directx/tdav_producer_screencast_ddraw.cxx
@@ -111,58 +111,57 @@
#define DDRAW_CHECK_HR(x) { HRESULT __hr__ = (x); if (FAILED(__hr__)) { DDRAW_DEBUG_ERROR("Operation Failed (%08x)", __hr__); goto bail; } }
typedef struct DDrawModule {
- LPDIRECTDRAW lpDD;
- HMODULE hDLL;
-}DDrawModule;
+ LPDIRECTDRAW lpDD;
+ HMODULE hDLL;
+} DDrawModule;
typedef struct DDrawModule FAR *LPDDrawModule;
#define DDrawModuleSafeFree(module) DDRAW_SAFE_RELEASE(&module.lpDD); if (module.hDLL) { FreeLibrary(module.hDLL), module.hDLL = NULL; }
-typedef struct tdav_producer_screencast_ddraw_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_screencast_ddraw_s {
+ TMEDIA_DECLARE_PRODUCER;
- HWND hwnd_preview;
- HWND hwnd_src;
+ HWND hwnd_preview;
+ HWND hwnd_src;
#if DDRAW_PREVIEW
- BITMAPINFO bi_preview;
+ BITMAPINFO bi_preview;
#endif /* DDRAW_PREVIEW */
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
- tsk_timer_manager_handle_t *p_timer_mgr;
- struct {
- tsk_timer_id_t id_timer;
- int fps_target;
- } cpu;
+ tsk_timer_manager_handle_t *p_timer_mgr;
+ struct {
+ tsk_timer_id_t id_timer;
+ int fps_target;
+ } cpu;
#endif /* DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING */
#if DDRAW_MT
- struct{
- tsk_thread_handle_t* tid[1];
- void* p_buff_yuv_aligned_array[DDRAW_MT_COUNT];
- BOOL b_flags_array[DDRAW_MT_COUNT];
- HANDLE h_events[DDRAW_MT_COUNT + 1]; // #DDRAW_MT_COUNT events for each buffer plus #1 for the shutdown/stop
- } mt;
+ struct {
+ tsk_thread_handle_t* tid[1];
+ void* p_buff_yuv_aligned_array[DDRAW_MT_COUNT];
+ BOOL b_flags_array[DDRAW_MT_COUNT];
+ HANDLE h_events[DDRAW_MT_COUNT + 1]; // #DDRAW_MT_COUNT events for each buffer plus #1 for the shutdown/stop
+ } mt;
#endif /* DDRAW_MT */
- DDrawModule ddrawModule;
- IDirectDrawSurface* p_surf_primary;
+ DDrawModule ddrawModule;
+ IDirectDrawSurface* p_surf_primary;
- tsk_thread_handle_t* tid[1];
+ tsk_thread_handle_t* tid[1];
- void* p_buff_rgb_aligned;
- tsk_size_t n_buff_rgb;
- tsk_size_t n_buff_rgb_bitscount;
+ void* p_buff_rgb_aligned;
+ tsk_size_t n_buff_rgb;
+ tsk_size_t n_buff_rgb_bitscount;
- void* p_buff_yuv_aligned;
- tsk_size_t n_buff_yuv;
+ void* p_buff_yuv_aligned;
+ tsk_size_t n_buff_yuv;
- BOOL b_have_rgb32_conv; // support for RGB32 -> I420 and primary screen format is RGB32
+ BOOL b_have_rgb32_conv; // support for RGB32 -> I420 and primary screen format is RGB32
- tsk_bool_t b_started;
- tsk_bool_t b_paused;
- tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_paused;
+ tsk_bool_t b_muted;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_producer_screencast_ddraw_t;
@@ -180,94 +179,94 @@ static HRESULT _tdav_producer_screencast_alloc_yuv_buff(tdav_producer_screencast
#if DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM
static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int8_t kYCoeffs[16] = {
- 13, 65, 33, 0,
- 13, 65, 33, 0,
- 13, 65, 33, 0,
- 13, 65, 33, 0,
- };
- static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int8_t kUCoeffs[16] = {
- 112, -74, -38, 0,
- 112, -74, -38, 0,
- 112, -74, -38, 0,
- 112, -74, -38, 0,
- };
- static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int8_t kVCoeffs[16] = {
- -18, -94, 112, 0,
- -18, -94, 112, 0,
- -18, -94, 112, 0,
- -18, -94, 112, 0,
- };
- static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int32_t kRGBAShuffleDuplicate[4] = { 0x03020100, 0x0b0a0908, 0x03020100, 0x0b0a0908 }; // RGBA(X) || RGBA(X + 2) || RGBA(X) || RGBA(X + 2) = 2U || 2V
- static __declspec(align(DDRAW_MEM_ALIGNMENT)) const uint16_t kY16[8] = {
- 16, 16, 16, 16,
- 16, 16, 16, 16
- };
- static __declspec(align(DDRAW_MEM_ALIGNMENT)) const uint16_t kUV128[8] = {
- 128, 128, 128, 128,
- 128, 128, 128, 128
- };
+ 13, 65, 33, 0,
+ 13, 65, 33, 0,
+ 13, 65, 33, 0,
+ 13, 65, 33, 0,
+};
+static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int8_t kUCoeffs[16] = {
+ 112, -74, -38, 0,
+ 112, -74, -38, 0,
+ 112, -74, -38, 0,
+ 112, -74, -38, 0,
+};
+static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int8_t kVCoeffs[16] = {
+ -18, -94, 112, 0,
+ -18, -94, 112, 0,
+ -18, -94, 112, 0,
+ -18, -94, 112, 0,
+};
+static __declspec(align(DDRAW_MEM_ALIGNMENT)) const int32_t kRGBAShuffleDuplicate[4] = { 0x03020100, 0x0b0a0908, 0x03020100, 0x0b0a0908 }; // RGBA(X) || RGBA(X + 2) || RGBA(X) || RGBA(X + 2) = 2U || 2V
+static __declspec(align(DDRAW_MEM_ALIGNMENT)) const uint16_t kY16[8] = {
+ 16, 16, 16, 16,
+ 16, 16, 16, 16
+};
+static __declspec(align(DDRAW_MEM_ALIGNMENT)) const uint16_t kUV128[8] = {
+ 128, 128, 128, 128,
+ 128, 128, 128, 128
+};
#endif /* DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM */
// public function used to check that we can use DDRAW plugin before loading it
tsk_bool_t tdav_producer_screencast_ddraw_plugin_is_supported()
{
- static tsk_bool_t __checked = tsk_false; // static guard to avoid checking more than once
- static tsk_bool_t __supported = tsk_false;
-
- HRESULT hr = DD_OK;
- DDSURFACEDESC ddsd;
- DDPIXELFORMAT DDPixelFormat;
- LPDIRECTDRAWSURFACE lpDDS = NULL;
- DDrawModule ddrawModule = { 0 };
-
- if (__checked) {
- goto bail;
- }
-
- __checked = tsk_true;
-
- DDRAW_CHECK_HR(hr = _tdav_producer_screencast_create_module(&ddrawModule));
- DDRAW_CHECK_HR(hr = ddrawModule.lpDD->SetCooperativeLevel(NULL, DDSCL_NORMAL));
-
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- DDRAW_CHECK_HR(hr = ddrawModule.lpDD->CreateSurface(&ddsd, &lpDDS, NULL));
-
- ZeroMemory(&DDPixelFormat, sizeof(DDPixelFormat));
- DDPixelFormat.dwSize = sizeof(DDPixelFormat);
- DDRAW_CHECK_HR(hr = lpDDS->GetPixelFormat(&DDPixelFormat));
- DDRAW_DEBUG_INFO("dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
- DDPixelFormat.dwRGBBitCount, DDPixelFormat.dwRBitMask, DDPixelFormat.dwGBitMask, DDPixelFormat.dwBBitMask, DDPixelFormat.dwRGBAlphaBitMask);
- if (_tdav_producer_screencast_get_chroma(&DDPixelFormat) == tmedia_chroma_none) {
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- }
+ static tsk_bool_t __checked = tsk_false; // static guard to avoid checking more than once
+ static tsk_bool_t __supported = tsk_false;
+
+ HRESULT hr = DD_OK;
+ DDSURFACEDESC ddsd;
+ DDPIXELFORMAT DDPixelFormat;
+ LPDIRECTDRAWSURFACE lpDDS = NULL;
+ DDrawModule ddrawModule = { 0 };
+
+ if (__checked) {
+ goto bail;
+ }
- __supported = SUCCEEDED(hr);
+ __checked = tsk_true;
+
+ DDRAW_CHECK_HR(hr = _tdav_producer_screencast_create_module(&ddrawModule));
+ DDRAW_CHECK_HR(hr = ddrawModule.lpDD->SetCooperativeLevel(NULL, DDSCL_NORMAL));
+
+ ZeroMemory(&ddsd, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ DDRAW_CHECK_HR(hr = ddrawModule.lpDD->CreateSurface(&ddsd, &lpDDS, NULL));
+
+ ZeroMemory(&DDPixelFormat, sizeof(DDPixelFormat));
+ DDPixelFormat.dwSize = sizeof(DDPixelFormat);
+ DDRAW_CHECK_HR(hr = lpDDS->GetPixelFormat(&DDPixelFormat));
+ DDRAW_DEBUG_INFO("dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
+ DDPixelFormat.dwRGBBitCount, DDPixelFormat.dwRBitMask, DDPixelFormat.dwGBitMask, DDPixelFormat.dwBBitMask, DDPixelFormat.dwRGBAlphaBitMask);
+ if (_tdav_producer_screencast_get_chroma(&DDPixelFormat) == tmedia_chroma_none) {
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ }
+
+ __supported = SUCCEEDED(hr);
bail:
- DDRAW_SAFE_RELEASE(&lpDDS);
- DDrawModuleSafeFree(ddrawModule);
- return __supported;
+ DDRAW_SAFE_RELEASE(&lpDDS);
+ DDrawModuleSafeFree(ddrawModule);
+ return __supported;
}
static BOOL _tdav_producer_screencast_have_ssse3()
{
- static BOOL __checked = FALSE; // static guard to avoid checking more than once
- static BOOL __supported = FALSE;
+ static BOOL __checked = FALSE; // static guard to avoid checking more than once
+ static BOOL __supported = FALSE;
- if (__checked) {
- return __supported;
- }
- __checked = TRUE;
+ if (__checked) {
+ return __supported;
+ }
+ __checked = TRUE;
#ifndef BIT
# define BIT(n) (1<<n)
#endif /*BIT*/
#if DDRAW_HAVE_RGB32_TO_I420_ASM
- #define cpuid(func, func2, a, b, c, d)\
+#define cpuid(func, func2, a, b, c, d)\
__asm mov eax, func\
__asm mov ecx, func2\
__asm cpuid\
@@ -285,28 +284,28 @@ static BOOL _tdav_producer_screencast_have_ssse3()
#define HAS_AVX 0x40
#define HAS_AVX2 0x80
- unsigned int reg_eax, reg_ebx, reg_ecx, reg_edx;
- cpuid(0, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
- if (reg_eax < 1) {
- DDRAW_DEBUG_ERROR("reg_eax < 1");
- return FALSE;
- }
- cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
- __supported = (reg_ecx & BIT(9)) ? TRUE : FALSE;
+ unsigned int reg_eax, reg_ebx, reg_ecx, reg_edx;
+ cpuid(0, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ if (reg_eax < 1) {
+ DDRAW_DEBUG_ERROR("reg_eax < 1");
+ return FALSE;
+ }
+ cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ __supported = (reg_ecx & BIT(9)) ? TRUE : FALSE;
#elif DDRAW_HAVE_RGB32_TO_I420_INTRIN
- int cpu_info[4] = { 0 }, num_ids;
- __cpuid(cpu_info, 0);
- num_ids = cpu_info[0];
- __cpuid(cpu_info, 0x80000000);
- if (num_ids > 0) {
- __cpuid(cpu_info, 0x00000001);
- __supported = (cpu_info[2] & BIT(9)) ? TRUE : FALSE;
- }
+ int cpu_info[4] = { 0 }, num_ids;
+ __cpuid(cpu_info, 0);
+ num_ids = cpu_info[0];
+ __cpuid(cpu_info, 0x80000000);
+ if (num_ids > 0) {
+ __cpuid(cpu_info, 0x00000001);
+ __supported = (cpu_info[2] & BIT(9)) ? TRUE : FALSE;
+ }
#endif /* DDRAW_HAVE_RGB32_TO_I420_ASM */
- DDRAW_DEBUG_INFO("SSSE3 supported = %s", __supported ? "YES" : "NO");
+ DDRAW_DEBUG_INFO("SSSE3 supported = %s", __supported ? "YES" : "NO");
- return __supported;
+ return __supported;
}
#if DDRAW_HAVE_RGB32_TO_I420_INTRIN
@@ -327,105 +326,102 @@ static BOOL _tdav_producer_screencast_have_ssse3()
static void _tdav_producer_screencast_rgb32_to_yuv420_intrin_ssse3(uint8_t *yuvPtr, const uint8_t *rgbPtr, int width, int height)
{
- // rgbPtr contains (samplesCount * 16) bytes
- // yPtr contains samplesCount bytes
- const int samplesCount = (width * height); // "width" and "height" are in samples
- const uint8_t *rgbPtr_;
- uint8_t* yPtr_ = yuvPtr, *uPtr_ = (yPtr_ + samplesCount), *vPtr_ = uPtr_ + (samplesCount >> 2);
- __m128i mmRgb0, mmRgb1, mmRgb2, mmRgb3, mmY0, mmY1, mmY;
- __m128i mmRgbU0, mmRgbU1, mmRgbV0, mmRgbV1;
-
- // Convert 16 RGBA samples to 16 Y samples
- rgbPtr_ = rgbPtr;
- /* const */__m128i yCoeffs = _mm_load_si128((__m128i*)kYCoeffs);
- /* const */__m128i y16 = _mm_load_si128((__m128i*)kY16);
- for(int i = 0; i < samplesCount; i += 16)
- {
- // load 16 RGBA samples
- _mm_store_si128(&mmRgb0, _mm_load_si128((__m128i*)rgbPtr_)); // 4 RGBA samples
- _mm_store_si128(&mmRgb1, _mm_load_si128((__m128i*)&rgbPtr_[16])); // 4 RGBA samples
- _mm_store_si128(&mmRgb2, _mm_load_si128((__m128i*)&rgbPtr_[32])); // 4 RGBA samples
- _mm_store_si128(&mmRgb3, _mm_load_si128((__m128i*)&rgbPtr_[48])); // 4 RGBA samples
-
- _mm_store_si128(&mmRgb0, _mm_maddubs_epi16(mmRgb0/*unsigned*/, yCoeffs/*signed*/)); // mmRgb0 = ((yCoeffs[j] * mmRgb0[j]) + (yCoeffs[j + 1] * mmRgb0[j + 1]))
- _mm_store_si128(&mmRgb1, _mm_maddubs_epi16(mmRgb1/*unsigned*/, yCoeffs/*signed*/));
- _mm_store_si128(&mmRgb2, _mm_maddubs_epi16(mmRgb2/*unsigned*/, yCoeffs/*signed*/));
- _mm_store_si128(&mmRgb3, _mm_maddubs_epi16(mmRgb3/*unsigned*/, yCoeffs/*signed*/));
-
- _mm_store_si128(&mmY0, _mm_hadd_epi16(mmRgb0, mmRgb1)); // horizontal add
- _mm_store_si128(&mmY1, _mm_hadd_epi16(mmRgb2, mmRgb3));
-
- _mm_store_si128(&mmY0, _mm_srai_epi16(mmY0, 7)); // >> 7
- _mm_store_si128(&mmY1, _mm_srai_epi16(mmY1, 7));
-
- _mm_store_si128(&mmY0, _mm_add_epi16(mmY0, y16)); // + 16
- _mm_store_si128(&mmY1, _mm_add_epi16(mmY1, y16));
-
- _mm_store_si128(&mmY, _mm_packus_epi16(mmY0, mmY1)); // Saturate(I16 -> U8)
-
- _mm_store_si128((__m128i*)yPtr_, mmY);
-
- rgbPtr_ += 64; // 16samples * 4bytes
- yPtr_ += 16; // 16samples * 1byte
- }
+ // rgbPtr contains (samplesCount * 16) bytes
+ // yPtr contains samplesCount bytes
+ const int samplesCount = (width * height); // "width" and "height" are in samples
+ const uint8_t *rgbPtr_;
+ uint8_t* yPtr_ = yuvPtr, *uPtr_ = (yPtr_ + samplesCount), *vPtr_ = uPtr_ + (samplesCount >> 2);
+ __m128i mmRgb0, mmRgb1, mmRgb2, mmRgb3, mmY0, mmY1, mmY;
+ __m128i mmRgbU0, mmRgbU1, mmRgbV0, mmRgbV1;
+
+ // Convert 16 RGBA samples to 16 Y samples
+ rgbPtr_ = rgbPtr;
+ /* const */__m128i yCoeffs = _mm_load_si128((__m128i*)kYCoeffs);
+ /* const */__m128i y16 = _mm_load_si128((__m128i*)kY16);
+ for(int i = 0; i < samplesCount; i += 16) {
+ // load 16 RGBA samples
+ _mm_store_si128(&mmRgb0, _mm_load_si128((__m128i*)rgbPtr_)); // 4 RGBA samples
+ _mm_store_si128(&mmRgb1, _mm_load_si128((__m128i*)&rgbPtr_[16])); // 4 RGBA samples
+ _mm_store_si128(&mmRgb2, _mm_load_si128((__m128i*)&rgbPtr_[32])); // 4 RGBA samples
+ _mm_store_si128(&mmRgb3, _mm_load_si128((__m128i*)&rgbPtr_[48])); // 4 RGBA samples
+
+ _mm_store_si128(&mmRgb0, _mm_maddubs_epi16(mmRgb0/*unsigned*/, yCoeffs/*signed*/)); // mmRgb0 = ((yCoeffs[j] * mmRgb0[j]) + (yCoeffs[j + 1] * mmRgb0[j + 1]))
+ _mm_store_si128(&mmRgb1, _mm_maddubs_epi16(mmRgb1/*unsigned*/, yCoeffs/*signed*/));
+ _mm_store_si128(&mmRgb2, _mm_maddubs_epi16(mmRgb2/*unsigned*/, yCoeffs/*signed*/));
+ _mm_store_si128(&mmRgb3, _mm_maddubs_epi16(mmRgb3/*unsigned*/, yCoeffs/*signed*/));
+
+ _mm_store_si128(&mmY0, _mm_hadd_epi16(mmRgb0, mmRgb1)); // horizontal add
+ _mm_store_si128(&mmY1, _mm_hadd_epi16(mmRgb2, mmRgb3));
+
+ _mm_store_si128(&mmY0, _mm_srai_epi16(mmY0, 7)); // >> 7
+ _mm_store_si128(&mmY1, _mm_srai_epi16(mmY1, 7));
+
+ _mm_store_si128(&mmY0, _mm_add_epi16(mmY0, y16)); // + 16
+ _mm_store_si128(&mmY1, _mm_add_epi16(mmY1, y16));
+
+ _mm_store_si128(&mmY, _mm_packus_epi16(mmY0, mmY1)); // Saturate(I16 -> U8)
+
+ _mm_store_si128((__m128i*)yPtr_, mmY);
+
+ rgbPtr_ += 64; // 16samples * 4bytes
+ yPtr_ += 16; // 16samples * 1byte
+ }
- // U+V planes
- /* const */__m128i uCoeffs = _mm_load_si128((__m128i*)kUCoeffs);
- /* const */__m128i vCoeffs = _mm_load_si128((__m128i*)kVCoeffs);
- /* const */__m128i rgbaShuffleDuplicate = _mm_load_si128((__m128i*)kRGBAShuffleDuplicate);
- /* const */__m128i uv128 = _mm_load_si128((__m128i*)kUV128);
- rgbPtr_ = rgbPtr;
- for(int i = 0; i < samplesCount; )
- {
- // load 16 RGBA samples
- _mm_store_si128(&mmRgb0, _mm_load_si128((__m128i*)rgbPtr_)); // 4 RGBA samples
- _mm_store_si128(&mmRgb1, _mm_load_si128((__m128i*)&rgbPtr_[16])); // 4 RGBA samples
- _mm_store_si128(&mmRgb2, _mm_load_si128((__m128i*)&rgbPtr_[32])); // 4 RGBA samples
- _mm_store_si128(&mmRgb3, _mm_load_si128((__m128i*)&rgbPtr_[48])); // 4 RGBA samples
-
- _mm_store_si128(&mmRgb0, _mm_shuffle_epi8(mmRgb0, rgbaShuffleDuplicate));
- _mm_store_si128(&mmRgb1, _mm_shuffle_epi8(mmRgb1, rgbaShuffleDuplicate));
- _mm_store_si128(&mmRgb2, _mm_shuffle_epi8(mmRgb2, rgbaShuffleDuplicate));
- _mm_store_si128(&mmRgb3, _mm_shuffle_epi8(mmRgb3, rgbaShuffleDuplicate));
-
- _mm_store_si128(&mmRgbU0, _mm_unpacklo_epi64(mmRgb0, mmRgb1));
- _mm_store_si128(&mmRgbV0, _mm_unpackhi_epi64(mmRgb0, mmRgb1)); // same as mmRgbU0: Use _mm_store_si128??
- _mm_store_si128(&mmRgbU1, _mm_unpacklo_epi64(mmRgb2, mmRgb3));
- _mm_store_si128(&mmRgbV1, _mm_unpackhi_epi64(mmRgb2, mmRgb3)); // same as mmRgbU0: Use _mm_store_si128??
-
- _mm_store_si128(&mmRgbU0, _mm_maddubs_epi16(mmRgbU0/*unsigned*/, uCoeffs/*signed*/));
- _mm_store_si128(&mmRgbV0, _mm_maddubs_epi16(mmRgbV0/*unsigned*/, vCoeffs/*signed*/));
- _mm_store_si128(&mmRgbU1, _mm_maddubs_epi16(mmRgbU1/*unsigned*/, uCoeffs/*signed*/));
- _mm_store_si128(&mmRgbV1, _mm_maddubs_epi16(mmRgbV1/*unsigned*/, vCoeffs/*signed*/));
-
- _mm_store_si128(&mmY0, _mm_hadd_epi16(mmRgbU0, mmRgbU1)); // horizontal add
- _mm_store_si128(&mmY1, _mm_hadd_epi16(mmRgbV0, mmRgbV1));
-
- _mm_store_si128(&mmY0, _mm_srai_epi16(mmY0, 8)); // >> 8
- _mm_store_si128(&mmY1, _mm_srai_epi16(mmY1, 8));
-
- _mm_store_si128(&mmY0, _mm_add_epi16(mmY0, uv128)); // + 128
- _mm_store_si128(&mmY1, _mm_add_epi16(mmY1, uv128));
-
- // Y contains 8 samples for U then 8 samples for V
- _mm_store_si128(&mmY, _mm_packus_epi16(mmY0, mmY1)); // Saturate(I16 -> U8)
- _mm_storel_pi((__m64*)uPtr_, _mm_load_ps((float*)&mmY));
- _mm_storeh_pi((__m64*)vPtr_, _mm_load_ps((float*)&mmY));
-
- uPtr_ += 8; // 8samples * 1byte
- vPtr_ += 8; // 8samples * 1byte
-
- // move to next 16 samples
- i += 16;
- rgbPtr_ += 64; // 16samples * 4bytes
-
- if (/*i % width == 0*/ !(i & (width - 1)))
- {
- // skip next line
- i += width;
- rgbPtr_ += (width * 4);
- }
- }
+ // U+V planes
+ /* const */__m128i uCoeffs = _mm_load_si128((__m128i*)kUCoeffs);
+ /* const */__m128i vCoeffs = _mm_load_si128((__m128i*)kVCoeffs);
+ /* const */__m128i rgbaShuffleDuplicate = _mm_load_si128((__m128i*)kRGBAShuffleDuplicate);
+ /* const */__m128i uv128 = _mm_load_si128((__m128i*)kUV128);
+ rgbPtr_ = rgbPtr;
+ for(int i = 0; i < samplesCount; ) {
+ // load 16 RGBA samples
+ _mm_store_si128(&mmRgb0, _mm_load_si128((__m128i*)rgbPtr_)); // 4 RGBA samples
+ _mm_store_si128(&mmRgb1, _mm_load_si128((__m128i*)&rgbPtr_[16])); // 4 RGBA samples
+ _mm_store_si128(&mmRgb2, _mm_load_si128((__m128i*)&rgbPtr_[32])); // 4 RGBA samples
+ _mm_store_si128(&mmRgb3, _mm_load_si128((__m128i*)&rgbPtr_[48])); // 4 RGBA samples
+
+ _mm_store_si128(&mmRgb0, _mm_shuffle_epi8(mmRgb0, rgbaShuffleDuplicate));
+ _mm_store_si128(&mmRgb1, _mm_shuffle_epi8(mmRgb1, rgbaShuffleDuplicate));
+ _mm_store_si128(&mmRgb2, _mm_shuffle_epi8(mmRgb2, rgbaShuffleDuplicate));
+ _mm_store_si128(&mmRgb3, _mm_shuffle_epi8(mmRgb3, rgbaShuffleDuplicate));
+
+ _mm_store_si128(&mmRgbU0, _mm_unpacklo_epi64(mmRgb0, mmRgb1));
+ _mm_store_si128(&mmRgbV0, _mm_unpackhi_epi64(mmRgb0, mmRgb1)); // same as mmRgbU0: Use _mm_store_si128??
+ _mm_store_si128(&mmRgbU1, _mm_unpacklo_epi64(mmRgb2, mmRgb3));
+ _mm_store_si128(&mmRgbV1, _mm_unpackhi_epi64(mmRgb2, mmRgb3)); // same as mmRgbU0: Use _mm_store_si128??
+
+ _mm_store_si128(&mmRgbU0, _mm_maddubs_epi16(mmRgbU0/*unsigned*/, uCoeffs/*signed*/));
+ _mm_store_si128(&mmRgbV0, _mm_maddubs_epi16(mmRgbV0/*unsigned*/, vCoeffs/*signed*/));
+ _mm_store_si128(&mmRgbU1, _mm_maddubs_epi16(mmRgbU1/*unsigned*/, uCoeffs/*signed*/));
+ _mm_store_si128(&mmRgbV1, _mm_maddubs_epi16(mmRgbV1/*unsigned*/, vCoeffs/*signed*/));
+
+ _mm_store_si128(&mmY0, _mm_hadd_epi16(mmRgbU0, mmRgbU1)); // horizontal add
+ _mm_store_si128(&mmY1, _mm_hadd_epi16(mmRgbV0, mmRgbV1));
+
+ _mm_store_si128(&mmY0, _mm_srai_epi16(mmY0, 8)); // >> 8
+ _mm_store_si128(&mmY1, _mm_srai_epi16(mmY1, 8));
+
+ _mm_store_si128(&mmY0, _mm_add_epi16(mmY0, uv128)); // + 128
+ _mm_store_si128(&mmY1, _mm_add_epi16(mmY1, uv128));
+
+ // Y contains 8 samples for U then 8 samples for V
+ _mm_store_si128(&mmY, _mm_packus_epi16(mmY0, mmY1)); // Saturate(I16 -> U8)
+ _mm_storel_pi((__m64*)uPtr_, _mm_load_ps((float*)&mmY));
+ _mm_storeh_pi((__m64*)vPtr_, _mm_load_ps((float*)&mmY));
+
+ uPtr_ += 8; // 8samples * 1byte
+ vPtr_ += 8; // 8samples * 1byte
+
+ // move to next 16 samples
+ i += 16;
+ rgbPtr_ += 64; // 16samples * 4bytes
+
+ if (/*i % width == 0*/ !(i & (width - 1))) {
+ // skip next line
+ i += width;
+ rgbPtr_ += (width * 4);
+ }
+ }
}
#endif /* DDRAW_HAVE_RGB32_TO_I420_INTRIN */
@@ -502,917 +498,917 @@ static void _tdav_producer_screencast_rgb32_to_yuv420_intrin_ssse3(uint8_t *yuvP
__declspec(naked) __declspec(align(DDRAW_MEM_ALIGNMENT))
static void _tdav_producer_screencast_rgb32_to_yuv420_asm_ssse3(uint8_t *yuvPtr, const uint8_t *rgbPtr, int width, int height)
{
- __asm {
- push esi
- push edi
- push ebx
- /*** Y Samples ***/
- mov edx, [esp + 12 + 4] // yuvPtr
- mov eax, [esp + 12 + 8] // rgbPtr
- mov ecx, [esp + 12 + 12] // width
- imul ecx, [esp + 12 + 16] // (width * height) = samplesCount
-
- movdqa xmm7, kYCoeffs // yCoeffs
- movdqa xmm6, kY16 // y16
- /* loopY start */
-loopY:
- // load 16 RGBA samples
- movdqa xmm0, [eax] // mmRgb0
- movdqa xmm1, [eax + 16] // mmRgb1
- movdqa xmm2, [eax + 32] // mmRgb2
- movdqa xmm3, [eax + 48] // mmRgb3
- lea eax, [eax + 64] // rgbPtr_ += 64
- // (yCoeffs[0] * mmRgbX[0]) + (yCoeffs[1] * mmRgbX[1])
- pmaddubsw xmm0, xmm7
- pmaddubsw xmm1, xmm7
- pmaddubsw xmm2, xmm7
- pmaddubsw xmm3, xmm7
- // horizontal add
- phaddw xmm0, xmm1
- phaddw xmm2, xmm3
- // >> 7
- psraw xmm0, 7
- psraw xmm2, 7
- // + 16
- paddw xmm0, xmm6
- paddw xmm2, xmm6
- // Saturate(I16 -> U8) - Packs
- packuswb xmm0, xmm2
- // Copy to yuvPtr
- movdqa [edx], xmm0
- lea edx, [edx + 16] // yPtr_ += 16
- sub ecx, 16 // samplesCount -= 16
- jnz loopY // goto loop if (samplesCount != 0)
-
- //==================================//
- //=========== UV Samples ===========//
- //==================================//
- mov esi, [esp + 12 + 4] // yuvPtr
- mov eax, [esp + 12 + 8] // rgbPtr
- mov ecx, [esp + 12 + 12] // width
- imul ecx, [esp + 12 + 16] // (width * height) = samplesCount
- mov edx, ecx
- shr edx, 2 // edx = samplesCount / 4
- add esi, ecx // [[esi = uPtr_]]
- mov edi, esi // edi = uPtr_
- add edi, edx // [[edi = uPtr_ + edx = uPtr_ + (samplesCount / 4) = vPtr_]]
- xor edx, edx // edx = 0 = i
- mov ebx, [esp + 12 + 12] // ebx = width
- sub ebx, 1 // ebx = (width - 1)
-
- movdqa xmm7, kUCoeffs // uCoeffs
- movdqa xmm6, kVCoeffs // vCoeffs
- movdqa xmm5, kRGBAShuffleDuplicate // rgbaShuffleDuplicate
- movdqa xmm4, kUV128 // uv128
-
- /* loopUV start */
-loopUV:
- // load 16 RGBA samples
- movdqa xmm0, [eax] // mmRgb0
- movdqa xmm1, [eax + 16] // mmRgb1
- movdqa xmm2, [eax + 32] // mmRgb2
- movdqa xmm3, [eax + 48] // mmRgb3
- lea eax, [eax + 64] // rgbPtr_ += 64
-
- pshufb xmm0, xmm5
- pshufb xmm1, xmm5
- pshufb xmm2, xmm5
- pshufb xmm3, xmm5
-
- punpcklqdq xmm0, xmm1 // mmRgbU0
- punpcklqdq xmm2, xmm3 // mmRgbU1
- movdqa xmm1, xmm0 // mmRgbV0
- movdqa xmm3, xmm2 // mmRgbV1
-
- pmaddubsw xmm0, xmm7 // mmRgbU0
- pmaddubsw xmm1, xmm6 // mmRgbV0
- pmaddubsw xmm2, xmm7 // mmRgbU1
- pmaddubsw xmm3, xmm6 // mmRgbV1
-
- phaddw xmm0, xmm2 // mmY0
- phaddw xmm1, xmm3 // mmY1
-
- psraw xmm0, 8
- psraw xmm1, 8
-
- paddw xmm0, xmm4
- paddw xmm1, xmm4
-
- packuswb xmm0, xmm1
- movlps [esi], xmm0
- movhps [edi], xmm0
-
- lea esi, [esi + 8]
- lea edi, [edi + 8]
-
- add edx, 16 // i += 16;
- push edx // save edx
- and edx, ebx // edx = (ebx & ebx) = (ebx & (width - 1)) = (ebx % width)
- cmp edx, 0 // (ebx % width) == 0 ?
- pop edx // restore edx
- jne loopUV_NextLine
-
- // loopUV_EndOfLine: ((ebx % width) == 0)
- add ebx, 1// change ebx value from width-1 to width
- add edx, ebx // i += width
- lea eax, [eax + 4 * ebx]// rgbPtr_ += (width * 4);
- sub ebx, 1// change back ebx value to width - 1
-loopUV_NextLine:
- cmp edx, ecx
- jl loopUV
-
- pop ebx
- pop edi
- pop esi
- ret
- }
+ __asm {
+ push esi
+ push edi
+ push ebx
+ /*** Y Samples ***/
+ mov edx, [esp + 12 + 4] // yuvPtr
+ mov eax, [esp + 12 + 8] // rgbPtr
+ mov ecx, [esp + 12 + 12] // width
+ imul ecx, [esp + 12 + 16] // (width * height) = samplesCount
+
+ movdqa xmm7, kYCoeffs // yCoeffs
+ movdqa xmm6, kY16 // y16
+ /* loopY start */
+ loopY:
+ // load 16 RGBA samples
+ movdqa xmm0, [eax] // mmRgb0
+ movdqa xmm1, [eax + 16] // mmRgb1
+ movdqa xmm2, [eax + 32] // mmRgb2
+ movdqa xmm3, [eax + 48] // mmRgb3
+ lea eax, [eax + 64] // rgbPtr_ += 64
+ // (yCoeffs[0] * mmRgbX[0]) + (yCoeffs[1] * mmRgbX[1])
+ pmaddubsw xmm0, xmm7
+ pmaddubsw xmm1, xmm7
+ pmaddubsw xmm2, xmm7
+ pmaddubsw xmm3, xmm7
+ // horizontal add
+ phaddw xmm0, xmm1
+ phaddw xmm2, xmm3
+ // >> 7
+ psraw xmm0, 7
+ psraw xmm2, 7
+ // + 16
+ paddw xmm0, xmm6
+ paddw xmm2, xmm6
+ // Saturate(I16 -> U8) - Packs
+ packuswb xmm0, xmm2
+ // Copy to yuvPtr
+ movdqa [edx], xmm0
+ lea edx, [edx + 16] // yPtr_ += 16
+ sub ecx, 16 // samplesCount -= 16
+ jnz loopY // goto loop if (samplesCount != 0)
+
+ //==================================//
+ //=========== UV Samples ===========//
+ //==================================//
+ mov esi, [esp + 12 + 4] // yuvPtr
+ mov eax, [esp + 12 + 8] // rgbPtr
+ mov ecx, [esp + 12 + 12] // width
+ imul ecx, [esp + 12 + 16] // (width * height) = samplesCount
+ mov edx, ecx
+ shr edx, 2 // edx = samplesCount / 4
+ add esi, ecx // [[esi = uPtr_]]
+ mov edi, esi // edi = uPtr_
+ add edi, edx // [[edi = uPtr_ + edx = uPtr_ + (samplesCount / 4) = vPtr_]]
+ xor edx, edx // edx = 0 = i
+ mov ebx, [esp + 12 + 12] // ebx = width
+ sub ebx, 1 // ebx = (width - 1)
+
+ movdqa xmm7, kUCoeffs // uCoeffs
+ movdqa xmm6, kVCoeffs // vCoeffs
+ movdqa xmm5, kRGBAShuffleDuplicate // rgbaShuffleDuplicate
+ movdqa xmm4, kUV128 // uv128
+
+ /* loopUV start */
+ loopUV:
+ // load 16 RGBA samples
+ movdqa xmm0, [eax] // mmRgb0
+ movdqa xmm1, [eax + 16] // mmRgb1
+ movdqa xmm2, [eax + 32] // mmRgb2
+ movdqa xmm3, [eax + 48] // mmRgb3
+ lea eax, [eax + 64] // rgbPtr_ += 64
+
+ pshufb xmm0, xmm5
+ pshufb xmm1, xmm5
+ pshufb xmm2, xmm5
+ pshufb xmm3, xmm5
+
+ punpcklqdq xmm0, xmm1 // mmRgbU0
+ punpcklqdq xmm2, xmm3 // mmRgbU1
+ movdqa xmm1, xmm0 // mmRgbV0
+ movdqa xmm3, xmm2 // mmRgbV1
+
+ pmaddubsw xmm0, xmm7 // mmRgbU0
+ pmaddubsw xmm1, xmm6 // mmRgbV0
+ pmaddubsw xmm2, xmm7 // mmRgbU1
+ pmaddubsw xmm3, xmm6 // mmRgbV1
+
+ phaddw xmm0, xmm2 // mmY0
+ phaddw xmm1, xmm3 // mmY1
+
+ psraw xmm0, 8
+ psraw xmm1, 8
+
+ paddw xmm0, xmm4
+ paddw xmm1, xmm4
+
+ packuswb xmm0, xmm1
+ movlps [esi], xmm0
+ movhps [edi], xmm0
+
+ lea esi, [esi + 8]
+ lea edi, [edi + 8]
+
+ add edx, 16 // i += 16;
+ push edx // save edx
+ and edx, ebx // edx = (ebx & ebx) = (ebx & (width - 1)) = (ebx % width)
+ cmp edx, 0 // (ebx % width) == 0 ?
+ pop edx // restore edx
+ jne loopUV_NextLine
+
+ // loopUV_EndOfLine: ((ebx % width) == 0)
+ add ebx, 1// change ebx value from width-1 to width
+ add edx, ebx // i += width
+ lea eax, [eax + 4 * ebx]// rgbPtr_ += (width * 4);
+ sub ebx, 1// change back ebx value to width - 1
+ loopUV_NextLine:
+ cmp edx, ecx
+ jl loopUV
+
+ pop ebx
+ pop edi
+ pop esi
+ ret
+ }
}
#endif /* DDRAW_HAVE_RGB32_TO_I420_ASM */
/* ============ Media Producer Interface ================= */
static int _tdav_producer_screencast_ddraw_set(tmedia_producer_t *p_self, const tmedia_param_t* pc_param)
{
- int ret = 0;
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
+ int ret = 0;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
- if (!p_ddraw || !pc_param) {
- DDRAW_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_ddraw || !pc_param) {
+ DDRAW_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (pc_param->value_type == tmedia_pvt_int64) {
- if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
- p_ddraw->hwnd_preview = (HWND)*((int64_t*)pc_param->value);
- }
- else if (tsk_striequals(pc_param->key, "src-hwnd")) {
- p_ddraw->hwnd_src = (HWND)*((int64_t*)pc_param->value);
- }
- }
- else if (pc_param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(pc_param->key, "mute")) {
- p_ddraw->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
- }
- }
+ if (pc_param->value_type == tmedia_pvt_int64) {
+ if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
+ p_ddraw->hwnd_preview = (HWND)*((int64_t*)pc_param->value);
+ }
+ else if (tsk_striequals(pc_param->key, "src-hwnd")) {
+ p_ddraw->hwnd_src = (HWND)*((int64_t*)pc_param->value);
+ }
+ }
+ else if (pc_param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(pc_param->key, "mute")) {
+ p_ddraw->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
+ }
+ }
- return ret;
+ return ret;
}
static int _tdav_producer_screencast_ddraw_prepare(tmedia_producer_t* p_self, const tmedia_codec_t* pc_codec)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
- int ret = 0;
- HRESULT hr = DD_OK;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
+ int ret = 0;
+ HRESULT hr = DD_OK;
#if 0
- DDPIXELFORMAT DDPixelFormat;
+ DDPIXELFORMAT DDPixelFormat;
#endif
- DDSURFACEDESC ddsd;
+ DDSURFACEDESC ddsd;
- if (!p_ddraw || !pc_codec) {
- DDRAW_DEBUG_ERROR("Invalid parameter");
- DDRAW_CHECK_HR(hr = E_INVALIDARG);
- }
+ if (!p_ddraw || !pc_codec) {
+ DDRAW_DEBUG_ERROR("Invalid parameter");
+ DDRAW_CHECK_HR(hr = E_INVALIDARG);
+ }
- tsk_safeobj_lock(p_ddraw);
+ tsk_safeobj_lock(p_ddraw);
- // check support for DirectDraw again
- if (!tdav_producer_screencast_ddraw_plugin_is_supported()) {
- DDRAW_CHECK_HR(hr = E_FAIL);
- }
+ // check support for DirectDraw again
+ if (!tdav_producer_screencast_ddraw_plugin_is_supported()) {
+ DDRAW_CHECK_HR(hr = E_FAIL);
+ }
- TMEDIA_PRODUCER(p_ddraw)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
- TMEDIA_PRODUCER(p_ddraw)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
- TMEDIA_PRODUCER(p_ddraw)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
-
- // Hack the codec to avoid flipping
- TMEDIA_CODEC_VIDEO(pc_codec)->out.flip = tsk_false;
+ TMEDIA_PRODUCER(p_ddraw)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
+ TMEDIA_PRODUCER(p_ddraw)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
+ TMEDIA_PRODUCER(p_ddraw)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
- DDRAW_DEBUG_INFO("Prepare with fps:%d, width:%d; height:%d", TMEDIA_PRODUCER(p_ddraw)->video.fps, TMEDIA_PRODUCER(p_ddraw)->video.width, TMEDIA_PRODUCER(p_ddraw)->video.height);
+ // Hack the codec to avoid flipping
+ TMEDIA_CODEC_VIDEO(pc_codec)->out.flip = tsk_false;
- if (!p_ddraw->ddrawModule.lpDD || !p_ddraw->ddrawModule.hDLL) {
- DDRAW_CHECK_HR(hr = _tdav_producer_screencast_create_module(&p_ddraw->ddrawModule));
- }
- DDRAW_CHECK_HR(hr = p_ddraw->ddrawModule.lpDD->SetCooperativeLevel(NULL, DDSCL_NORMAL));
-
- if (!p_ddraw->p_surf_primary) {
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- DDRAW_CHECK_HR(hr = p_ddraw->ddrawModule.lpDD->CreateSurface(&ddsd, &p_ddraw->p_surf_primary, NULL));
- }
+ DDRAW_DEBUG_INFO("Prepare with fps:%d, width:%d; height:%d", TMEDIA_PRODUCER(p_ddraw)->video.fps, TMEDIA_PRODUCER(p_ddraw)->video.width, TMEDIA_PRODUCER(p_ddraw)->video.height);
+
+ if (!p_ddraw->ddrawModule.lpDD || !p_ddraw->ddrawModule.hDLL) {
+ DDRAW_CHECK_HR(hr = _tdav_producer_screencast_create_module(&p_ddraw->ddrawModule));
+ }
+ DDRAW_CHECK_HR(hr = p_ddraw->ddrawModule.lpDD->SetCooperativeLevel(NULL, DDSCL_NORMAL));
+
+ if (!p_ddraw->p_surf_primary) {
+ ZeroMemory(&ddsd, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ DDRAW_CHECK_HR(hr = p_ddraw->ddrawModule.lpDD->CreateSurface(&ddsd, &p_ddraw->p_surf_primary, NULL));
+ }
#if 0
- ZeroMemory(&DDPixelFormat, sizeof(DDPixelFormat));
- DDPixelFormat.dwSize = sizeof(DDPixelFormat);
- DDRAW_CHECK_HR(hr = DDRAW_VTBL(p_ddraw->p_surf_primary)->GetPixelFormat(p_ddraw->p_surf_primary, &DDPixelFormat));
- DDRAW_DEBUG_INFO("dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
- DDPixelFormat.dwRGBBitCount, DDPixelFormat.dwRBitMask, DDPixelFormat.dwGBitMask, DDPixelFormat.dwBBitMask, DDPixelFormat.dwRGBAlphaBitMask);
- if ((TMEDIA_PRODUCER(p_ddraw)->video.chroma = _tdav_producer_screencast_get_chroma(&DDPixelFormat)) == tmedia_chroma_none) {
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- }
+ ZeroMemory(&DDPixelFormat, sizeof(DDPixelFormat));
+ DDPixelFormat.dwSize = sizeof(DDPixelFormat);
+ DDRAW_CHECK_HR(hr = DDRAW_VTBL(p_ddraw->p_surf_primary)->GetPixelFormat(p_ddraw->p_surf_primary, &DDPixelFormat));
+ DDRAW_DEBUG_INFO("dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
+ DDPixelFormat.dwRGBBitCount, DDPixelFormat.dwRBitMask, DDPixelFormat.dwGBitMask, DDPixelFormat.dwBBitMask, DDPixelFormat.dwRGBAlphaBitMask);
+ if ((TMEDIA_PRODUCER(p_ddraw)->video.chroma = _tdav_producer_screencast_get_chroma(&DDPixelFormat)) == tmedia_chroma_none) {
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ }
#else
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
- DDRAW_CHECK_HR(hr = p_ddraw->p_surf_primary->GetSurfaceDesc(&ddsd));
- DDRAW_DEBUG_INFO("Prepare with neg. width:%d, height:%d, pitch=%ld", ddsd.dwWidth, ddsd.dwHeight, ddsd.lPitch);
- TMEDIA_PRODUCER(p_ddraw)->video.width = ddsd.dwWidth;
- TMEDIA_PRODUCER(p_ddraw)->video.height = ddsd.dwHeight;
- p_ddraw->n_buff_rgb_bitscount = ddsd.ddpfPixelFormat.dwRGBBitCount;
- DDRAW_DEBUG_INFO("Prepare with dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
- ddsd.ddpfPixelFormat.dwRGBBitCount, ddsd.ddpfPixelFormat.dwRBitMask, ddsd.ddpfPixelFormat.dwGBitMask, ddsd.ddpfPixelFormat.dwBBitMask, ddsd.ddpfPixelFormat.dwRGBAlphaBitMask);
- if ((TMEDIA_PRODUCER(p_ddraw)->video.chroma = _tdav_producer_screencast_get_chroma(&ddsd.ddpfPixelFormat)) == tmedia_chroma_none) {
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- }
+ ZeroMemory(&ddsd, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
+ DDRAW_CHECK_HR(hr = p_ddraw->p_surf_primary->GetSurfaceDesc(&ddsd));
+ DDRAW_DEBUG_INFO("Prepare with neg. width:%d, height:%d, pitch=%ld", ddsd.dwWidth, ddsd.dwHeight, ddsd.lPitch);
+ TMEDIA_PRODUCER(p_ddraw)->video.width = ddsd.dwWidth;
+ TMEDIA_PRODUCER(p_ddraw)->video.height = ddsd.dwHeight;
+ p_ddraw->n_buff_rgb_bitscount = ddsd.ddpfPixelFormat.dwRGBBitCount;
+ DDRAW_DEBUG_INFO("Prepare with dwRGBBitCount:%d, dwRBitMask:%x, dwGBitMask:%x, dwBBitMask:%x, dwRGBAlphaBitMask:%x",
+ ddsd.ddpfPixelFormat.dwRGBBitCount, ddsd.ddpfPixelFormat.dwRBitMask, ddsd.ddpfPixelFormat.dwGBitMask, ddsd.ddpfPixelFormat.dwBBitMask, ddsd.ddpfPixelFormat.dwRGBAlphaBitMask);
+ if ((TMEDIA_PRODUCER(p_ddraw)->video.chroma = _tdav_producer_screencast_get_chroma(&ddsd.ddpfPixelFormat)) == tmedia_chroma_none) {
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ }
#endif
- // allocate RGB buffer
- DDRAW_CHECK_HR(hr = _tdav_producer_screencast_alloc_rgb_buff(p_ddraw, ddsd.dwWidth, ddsd.dwHeight, ddsd.ddpfPixelFormat.dwRGBBitCount));
+ // allocate RGB buffer
+ DDRAW_CHECK_HR(hr = _tdav_producer_screencast_alloc_rgb_buff(p_ddraw, ddsd.dwWidth, ddsd.dwHeight, ddsd.ddpfPixelFormat.dwRGBBitCount));
- // Check if we can use built-in chroma conversion
+ // Check if we can use built-in chroma conversion
#if DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM
- p_ddraw->b_have_rgb32_conv =
- _tdav_producer_screencast_have_ssse3() // SSSE3 supported
- && DDRAW_IS_ALIGNED(TMEDIA_PRODUCER(p_ddraw)->video.width, DDRAW_MEM_ALIGNMENT) // width multiple of 16
- /* && DDRAW_IS_ALIGNED(TMEDIA_PRODUCER(p_ddraw)->video.height, DDRAW_MEM_ALIGNMENT) // height multiple of 16 */
- && TMEDIA_PRODUCER(p_ddraw)->video.chroma == tmedia_chroma_rgb32; // Primary screen RGB32
- if (p_ddraw->b_have_rgb32_conv) {
- TMEDIA_PRODUCER(p_ddraw)->video.chroma = tmedia_chroma_yuv420p;
- }
+ p_ddraw->b_have_rgb32_conv =
+ _tdav_producer_screencast_have_ssse3() // SSSE3 supported
+ && DDRAW_IS_ALIGNED(TMEDIA_PRODUCER(p_ddraw)->video.width, DDRAW_MEM_ALIGNMENT) // width multiple of 16
+ /* && DDRAW_IS_ALIGNED(TMEDIA_PRODUCER(p_ddraw)->video.height, DDRAW_MEM_ALIGNMENT) // height multiple of 16 */
+ && TMEDIA_PRODUCER(p_ddraw)->video.chroma == tmedia_chroma_rgb32; // Primary screen RGB32
+ if (p_ddraw->b_have_rgb32_conv) {
+ TMEDIA_PRODUCER(p_ddraw)->video.chroma = tmedia_chroma_yuv420p;
+ }
#endif
- DDRAW_DEBUG_INFO("RGB32 -> I420 conversion supported: %s", p_ddraw->b_have_rgb32_conv ? "YES" : "NO");
+ DDRAW_DEBUG_INFO("RGB32 -> I420 conversion supported: %s", p_ddraw->b_have_rgb32_conv ? "YES" : "NO");
- // allocate YUV buffer
- if (p_ddraw->b_have_rgb32_conv) {
- DDRAW_CHECK_HR(hr = _tdav_producer_screencast_alloc_yuv_buff(p_ddraw, (DWORD)TMEDIA_PRODUCER(p_ddraw)->video.width, (DWORD)TMEDIA_PRODUCER(p_ddraw)->video.height));
- }
+ // allocate YUV buffer
+ if (p_ddraw->b_have_rgb32_conv) {
+ DDRAW_CHECK_HR(hr = _tdav_producer_screencast_alloc_yuv_buff(p_ddraw, (DWORD)TMEDIA_PRODUCER(p_ddraw)->video.width, (DWORD)TMEDIA_PRODUCER(p_ddraw)->video.height));
+ }
- // BitmapInfo for preview
+ // BitmapInfo for preview
#if DDRAW_PREVIEW
- ZeroMemory(&p_ddraw->bi_preview, sizeof(p_ddraw->bi_preview));
- p_ddraw->bi_preview.bmiHeader.biSize = (DWORD)sizeof(BITMAPINFOHEADER);
- p_ddraw->bi_preview.bmiHeader.biCompression = BI_RGB;
- p_ddraw->bi_preview.bmiHeader.biPlanes = 1;
- p_ddraw->bi_preview.bmiHeader.biWidth = ddsd.dwWidth;
- p_ddraw->bi_preview.bmiHeader.biHeight = ddsd.dwHeight;
- p_ddraw->bi_preview.bmiHeader.biBitCount = (WORD)ddsd.ddpfPixelFormat.dwRGBBitCount;
- p_ddraw->bi_preview.bmiHeader.biSizeImage = (p_ddraw->bi_preview.bmiHeader.biWidth * p_ddraw->bi_preview.bmiHeader.biHeight * (p_ddraw->bi_preview.bmiHeader.biBitCount >> 3));
+ ZeroMemory(&p_ddraw->bi_preview, sizeof(p_ddraw->bi_preview));
+ p_ddraw->bi_preview.bmiHeader.biSize = (DWORD)sizeof(BITMAPINFOHEADER);
+ p_ddraw->bi_preview.bmiHeader.biCompression = BI_RGB;
+ p_ddraw->bi_preview.bmiHeader.biPlanes = 1;
+ p_ddraw->bi_preview.bmiHeader.biWidth = ddsd.dwWidth;
+ p_ddraw->bi_preview.bmiHeader.biHeight = ddsd.dwHeight;
+ p_ddraw->bi_preview.bmiHeader.biBitCount = (WORD)ddsd.ddpfPixelFormat.dwRGBBitCount;
+ p_ddraw->bi_preview.bmiHeader.biSizeImage = (p_ddraw->bi_preview.bmiHeader.biWidth * p_ddraw->bi_preview.bmiHeader.biHeight * (p_ddraw->bi_preview.bmiHeader.biBitCount >> 3));
#endif /* DDRAW_PREVIEW */
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
- if (!p_ddraw->p_timer_mgr) {
- p_ddraw->p_timer_mgr = tsk_timer_manager_create();
- }
+ if (!p_ddraw->p_timer_mgr) {
+ p_ddraw->p_timer_mgr = tsk_timer_manager_create();
+ }
#endif /* DDRAW_CPU_MONITOR ||DDRAW_CPU_THROTTLING */
#if DDRAW_CPU_THROTTLING
- p_ddraw->cpu.fps_target = (TMEDIA_PRODUCER(p_ddraw)->video.fps + DDRAW_CPU_THROTTLING_FPS_MIN) >> 1; // start with minimum fps and increase the value based on the fps
+ p_ddraw->cpu.fps_target = (TMEDIA_PRODUCER(p_ddraw)->video.fps + DDRAW_CPU_THROTTLING_FPS_MIN) >> 1; // start with minimum fps and increase the value based on the fps
#endif /* DDRAW_CPU_THROTTLING */
-bail:
- tsk_safeobj_unlock(p_ddraw);
- return SUCCEEDED(hr) ? 0 : -1;
+ bail:
+ tsk_safeobj_unlock(p_ddraw);
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int _tdav_producer_screencast_ddraw_start(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
- int ret = 0;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
+ int ret = 0;
- if (!p_ddraw) {
- DDRAW_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_ddraw) {
+ DDRAW_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- ret = tsk_safeobj_lock(p_ddraw);
+ ret = tsk_safeobj_lock(p_ddraw);
- p_ddraw->b_paused = tsk_false;
+ p_ddraw->b_paused = tsk_false;
- if (p_ddraw->b_started) {
- DDRAW_DEBUG_INFO("Already started");
- goto bail;
- }
+ if (p_ddraw->b_started) {
+ DDRAW_DEBUG_INFO("Already started");
+ goto bail;
+ }
- p_ddraw->b_started = tsk_true;
+ p_ddraw->b_started = tsk_true;
- // Create notify events (must be done here before starting the grabber thread)
+ // Create notify events (must be done here before starting the grabber thread)
#if DDRAW_MT
- for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
- if (!p_ddraw->mt.h_events[i] && !(p_ddraw->mt.h_events[i] = CreateEvent(NULL, FALSE, FALSE, NULL))) {
- DDRAW_DEBUG_ERROR("Failed to create event at %d", i);
- ret = -1;
- goto bail;
- }
- }
+ for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
+ if (!p_ddraw->mt.h_events[i] && !(p_ddraw->mt.h_events[i] = CreateEvent(NULL, FALSE, FALSE, NULL))) {
+ DDRAW_DEBUG_ERROR("Failed to create event at %d", i);
+ ret = -1;
+ goto bail;
+ }
+ }
#endif /* DDRAW_MT */
- ret = tsk_thread_create(&p_ddraw->tid[0], _tdav_producer_screencast_grap_thread, p_ddraw);
- if (ret != 0) {
- DDRAW_DEBUG_ERROR("Failed to create thread");
- goto bail;
- }
- //BOOL okSetTA = CeSetThreadAffinity((HANDLE)p_ddraw->tid[0], 0x01);
+ ret = tsk_thread_create(&p_ddraw->tid[0], _tdav_producer_screencast_grap_thread, p_ddraw);
+ if (ret != 0) {
+ DDRAW_DEBUG_ERROR("Failed to create thread");
+ goto bail;
+ }
+ //BOOL okSetTA = CeSetThreadAffinity((HANDLE)p_ddraw->tid[0], 0x01);
#if DDRAW_MT
- ret = tsk_thread_create(&p_ddraw->mt.tid[0], _tdav_producer_screencast_mt_encode_thread, p_ddraw);
- if (ret != 0) {
- DDRAW_DEBUG_ERROR("Failed to create thread");
- goto bail;
- }
- //okSetTA = CeSetThreadAffinity((HANDLE)p_ddraw->mt.tid[0], 0x02);
+ ret = tsk_thread_create(&p_ddraw->mt.tid[0], _tdav_producer_screencast_mt_encode_thread, p_ddraw);
+ if (ret != 0) {
+ DDRAW_DEBUG_ERROR("Failed to create thread");
+ goto bail;
+ }
+ //okSetTA = CeSetThreadAffinity((HANDLE)p_ddraw->mt.tid[0], 0x02);
#endif /* DDRAW_MT */
#if DDRAW_HIGH_PRIO_MEMCPY
- if (p_ddraw->tid[0]) {
- tsk_thread_set_priority(p_ddraw->tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
- }
+ if (p_ddraw->tid[0]) {
+ tsk_thread_set_priority(p_ddraw->tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
+ }
#if DDRAW_MT
- if (p_ddraw->mt.tid[0]) {
- tsk_thread_set_priority(p_ddraw->mt.tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
- }
+ if (p_ddraw->mt.tid[0]) {
+ tsk_thread_set_priority(p_ddraw->mt.tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
+ }
#endif /* DDRAW_MT */
#endif /* DDRAW_HIGH_PRIO_MEMCPY */
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
- ret = tsk_timer_manager_start(p_ddraw->p_timer_mgr);
- if (ret == 0) {
- p_ddraw->cpu.id_timer = tsk_timer_manager_schedule(p_ddraw->p_timer_mgr, DDRAW_CPU_SCHEDULE_TIMEOUT, _tdav_producer_screencast_timer_cb, p_ddraw);
- }
- else {
- ret = 0; // not fatal error
- DDRAW_DEBUG_WARN("Failed to start CPU timer");
- }
+ ret = tsk_timer_manager_start(p_ddraw->p_timer_mgr);
+ if (ret == 0) {
+ p_ddraw->cpu.id_timer = tsk_timer_manager_schedule(p_ddraw->p_timer_mgr, DDRAW_CPU_SCHEDULE_TIMEOUT, _tdav_producer_screencast_timer_cb, p_ddraw);
+ }
+ else {
+ ret = 0; // not fatal error
+ DDRAW_DEBUG_WARN("Failed to start CPU timer");
+ }
#endif /* DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING */
-bail:
- if (ret) {
- p_ddraw->b_started = tsk_false;
- if (p_ddraw->tid[0]) {
- tsk_thread_join(&(p_ddraw->tid[0]));
- }
+ bail:
+ if (ret) {
+ p_ddraw->b_started = tsk_false;
+ if (p_ddraw->tid[0]) {
+ tsk_thread_join(&(p_ddraw->tid[0]));
+ }
#if DDRAW_MT
- if (p_ddraw->mt.tid[0]) {
- tsk_thread_join(&(p_ddraw->mt.tid[0]));
- }
+ if (p_ddraw->mt.tid[0]) {
+ tsk_thread_join(&(p_ddraw->mt.tid[0]));
+ }
#endif /* DDRAW_MT */
- }
- ret = tsk_safeobj_unlock(p_ddraw);
+ }
+ ret = tsk_safeobj_unlock(p_ddraw);
- return ret;
+ return ret;
}
static int _tdav_producer_screencast_ddraw_pause(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
- if (!p_ddraw) {
- DDRAW_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_ddraw) {
+ DDRAW_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_ddraw);
+ tsk_safeobj_lock(p_ddraw);
- p_ddraw->b_paused = tsk_true;
- goto bail;
+ p_ddraw->b_paused = tsk_true;
+ goto bail;
-bail:
- tsk_safeobj_unlock(p_ddraw);
+ bail:
+ tsk_safeobj_unlock(p_ddraw);
- return 0;
+ return 0;
}
static int _tdav_producer_screencast_ddraw_stop(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)p_self;
- if (!p_ddraw) {
- DDRAW_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_ddraw) {
+ DDRAW_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_ddraw);
+ tsk_safeobj_lock(p_ddraw);
- if (!p_ddraw->b_started) {
- DDRAW_DEBUG_INFO("Already stopped");
- goto bail;
- }
+ if (!p_ddraw->b_started) {
+ DDRAW_DEBUG_INFO("Already stopped");
+ goto bail;
+ }
- p_ddraw->b_started = tsk_false;
- p_ddraw->b_paused = tsk_false;
+ p_ddraw->b_started = tsk_false;
+ p_ddraw->b_paused = tsk_false;
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
- if (p_ddraw->p_timer_mgr) {
- tsk_timer_manager_stop(p_ddraw->p_timer_mgr);
- }
+ if (p_ddraw->p_timer_mgr) {
+ tsk_timer_manager_stop(p_ddraw->p_timer_mgr);
+ }
#endif /* DDRAW_CPU_MONITOR ||DDRAW_CPU_THROTTLING */
- // stop grabber thread
- if (p_ddraw->tid[0]) {
- tsk_thread_join(&(p_ddraw->tid[0]));
- }
+ // stop grabber thread
+ if (p_ddraw->tid[0]) {
+ tsk_thread_join(&(p_ddraw->tid[0]));
+ }
#if DDRAW_MT
- if (p_ddraw->mt.h_events[DDRAW_MT_EVENT_SHUTDOWN_INDEX]){
- SetEvent(p_ddraw->mt.h_events[DDRAW_MT_EVENT_SHUTDOWN_INDEX]);
- }
- if (p_ddraw->mt.tid[0]) {
- tsk_thread_join(&(p_ddraw->mt.tid[0]));
- }
- for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
- if (p_ddraw->mt.h_events[i]) {
- CloseHandle(p_ddraw->mt.h_events[i]);
- p_ddraw->mt.h_events[i] = NULL;
- }
- }
+ if (p_ddraw->mt.h_events[DDRAW_MT_EVENT_SHUTDOWN_INDEX]) {
+ SetEvent(p_ddraw->mt.h_events[DDRAW_MT_EVENT_SHUTDOWN_INDEX]);
+ }
+ if (p_ddraw->mt.tid[0]) {
+ tsk_thread_join(&(p_ddraw->mt.tid[0]));
+ }
+ for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
+ if (p_ddraw->mt.h_events[i]) {
+ CloseHandle(p_ddraw->mt.h_events[i]);
+ p_ddraw->mt.h_events[i] = NULL;
+ }
+ }
#endif
-bail:
- tsk_safeobj_unlock(p_ddraw);
+ bail:
+ tsk_safeobj_unlock(p_ddraw);
- return 0;
+ return 0;
}
static int _tdav_producer_screencast_grab(tdav_producer_screencast_ddraw_t* p_self)
{
- int ret = 0;
- HRESULT hr = S_OK;
- DDSURFACEDESC ddsd;
- DWORD nSizeWithoutPadding, nRowLengthInBytes, lockFlags;
- tmedia_producer_t* p_base = TMEDIA_PRODUCER(p_self);
- LPVOID lpBuffToSend, lpBuffYUV;
- BOOL bDirectMemSurfAccess = DDRAW_MEM_SURFACE_DIRECT_ACCESS;
+ int ret = 0;
+ HRESULT hr = S_OK;
+ DDSURFACEDESC ddsd;
+ DWORD nSizeWithoutPadding, nRowLengthInBytes, lockFlags;
+ tmedia_producer_t* p_base = TMEDIA_PRODUCER(p_self);
+ LPVOID lpBuffToSend, lpBuffYUV;
+ BOOL bDirectMemSurfAccess = DDRAW_MEM_SURFACE_DIRECT_ACCESS;
#if DDRAW_MT
- INT iMtFreeBuffIndex = -1;
+ INT iMtFreeBuffIndex = -1;
#endif
- //--uint64_t timeStart, timeEnd;
+ //--uint64_t timeStart, timeEnd;
- //--timeStart = tsk_time_now();
+ //--timeStart = tsk_time_now();
- if (!p_self) {
- DDRAW_CHECK_HR(hr = E_INVALIDARG);
- }
+ if (!p_self) {
+ DDRAW_CHECK_HR(hr = E_INVALIDARG);
+ }
- if (!p_self->b_started) {
+ if (!p_self->b_started) {
#if defined(E_ILLEGAL_METHOD_CALL)
- DDRAW_CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
+ DDRAW_CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
#else
- DDRAW_CHECK_HR(hr = E_FAIL);
+ DDRAW_CHECK_HR(hr = E_FAIL);
#endif
- }
+ }
#if DDRAW_MT
- {
- INT iIndex = 0;
- for (; (iIndex < DDRAW_MT_COUNT) && (p_self->mt.b_flags_array[iIndex] == TRUE); ++iIndex);
- if (iIndex == DDRAW_MT_COUNT) {
- goto bail;
- }
- }
+ {
+ INT iIndex = 0;
+ for (; (iIndex < DDRAW_MT_COUNT) && (p_self->mt.b_flags_array[iIndex] == TRUE); ++iIndex);
+ if (iIndex == DDRAW_MT_COUNT) {
+ goto bail;
+ }
+ }
#endif /* DDRAW_MT */
- if (p_self->p_surf_primary->IsLost() == DDERR_SURFACELOST) {
- DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Restore());
- }
+ if (p_self->p_surf_primary->IsLost() == DDERR_SURFACELOST) {
+ DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Restore());
+ }
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
- lockFlags = DDLOCK_READONLY |
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
+ lockFlags = DDLOCK_READONLY |
#if TDAV_UNDER_WINDOWS_CE
- // This flag has a slightly different name under Windows CE vs. Desktop, but it's the same behavior.
- DDLOCK_WAITNOTBUSY;
+ // This flag has a slightly different name under Windows CE vs. Desktop, but it's the same behavior.
+ DDLOCK_WAITNOTBUSY;
#else
- DDLOCK_WAIT;
+ DDLOCK_WAIT;
#endif
- DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Lock(NULL, &ddsd, lockFlags, NULL));
- // make sure surface size and number of bits per pixel haven't changed
- if (TMEDIA_PRODUCER(p_self)->video.width != ddsd.dwWidth || TMEDIA_PRODUCER(p_self)->video.height != ddsd.dwHeight || p_self->n_buff_rgb_bitscount != ddsd.ddpfPixelFormat.dwRGBBitCount) {
- tsk_size_t n_buff_rgb_new;
- tmedia_chroma_t chroma_new;
- DDRAW_DEBUG_WARN("surface has changed: width %d<>%d or height %d<>%d or rgb_bits_count %d<>%d",
- p_base->video.width, ddsd.dwWidth,
- p_base->video.height, ddsd.dwHeight,
- p_self->n_buff_rgb_bitscount, ddsd.ddpfPixelFormat.dwRGBBitCount);
- if ((chroma_new = _tdav_producer_screencast_get_chroma(&ddsd.ddpfPixelFormat)) == tmedia_chroma_none) {
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- }
- // allocate RGB buffer
- n_buff_rgb_new = (ddsd.dwWidth * ddsd.dwHeight * (ddsd.ddpfPixelFormat.dwRGBBitCount >> 3));
- if (p_self->n_buff_rgb < n_buff_rgb_new) {
- hr = _tdav_producer_screencast_alloc_rgb_buff(p_self, ddsd.dwWidth, ddsd.dwHeight, ddsd.ddpfPixelFormat.dwRGBBitCount);
- if (FAILED(hr)) {
- p_self->p_surf_primary->Unlock(NULL); // unlock before going to bail
- DDRAW_CHECK_HR(hr);
- }
- }
- p_base->video.width = ddsd.dwWidth;
- p_base->video.height = ddsd.dwHeight;
- p_base->video.chroma = chroma_new;
- p_self->n_buff_rgb_bitscount = ddsd.ddpfPixelFormat.dwRGBBitCount;
- // Check if we can use built-in chroma conversion
+ DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Lock(NULL, &ddsd, lockFlags, NULL));
+ // make sure surface size and number of bits per pixel haven't changed
+ if (TMEDIA_PRODUCER(p_self)->video.width != ddsd.dwWidth || TMEDIA_PRODUCER(p_self)->video.height != ddsd.dwHeight || p_self->n_buff_rgb_bitscount != ddsd.ddpfPixelFormat.dwRGBBitCount) {
+ tsk_size_t n_buff_rgb_new;
+ tmedia_chroma_t chroma_new;
+ DDRAW_DEBUG_WARN("surface has changed: width %d<>%d or height %d<>%d or rgb_bits_count %d<>%d",
+ p_base->video.width, ddsd.dwWidth,
+ p_base->video.height, ddsd.dwHeight,
+ p_self->n_buff_rgb_bitscount, ddsd.ddpfPixelFormat.dwRGBBitCount);
+ if ((chroma_new = _tdav_producer_screencast_get_chroma(&ddsd.ddpfPixelFormat)) == tmedia_chroma_none) {
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ }
+ // allocate RGB buffer
+ n_buff_rgb_new = (ddsd.dwWidth * ddsd.dwHeight * (ddsd.ddpfPixelFormat.dwRGBBitCount >> 3));
+ if (p_self->n_buff_rgb < n_buff_rgb_new) {
+ hr = _tdav_producer_screencast_alloc_rgb_buff(p_self, ddsd.dwWidth, ddsd.dwHeight, ddsd.ddpfPixelFormat.dwRGBBitCount);
+ if (FAILED(hr)) {
+ p_self->p_surf_primary->Unlock(NULL); // unlock before going to bail
+ DDRAW_CHECK_HR(hr);
+ }
+ }
+ p_base->video.width = ddsd.dwWidth;
+ p_base->video.height = ddsd.dwHeight;
+ p_base->video.chroma = chroma_new;
+ p_self->n_buff_rgb_bitscount = ddsd.ddpfPixelFormat.dwRGBBitCount;
+ // Check if we can use built-in chroma conversion
#if DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM
- p_self->b_have_rgb32_conv =
- _tdav_producer_screencast_have_ssse3() // SSSE3 supported
- && DDRAW_IS_ALIGNED(p_base->video.width, DDRAW_MEM_ALIGNMENT) // width multiple of 16
- /* && DDRAW_IS_ALIGNED(p_base->video.height, DDRAW_MEM_ALIGNMENT) // height multiple of 16 */
- && p_base->video.chroma == tmedia_chroma_rgb32; // Primary screen RGB32
- if (p_self->b_have_rgb32_conv) {
- p_base->video.chroma = tmedia_chroma_yuv420p;
- }
+ p_self->b_have_rgb32_conv =
+ _tdav_producer_screencast_have_ssse3() // SSSE3 supported
+ && DDRAW_IS_ALIGNED(p_base->video.width, DDRAW_MEM_ALIGNMENT) // width multiple of 16
+ /* && DDRAW_IS_ALIGNED(p_base->video.height, DDRAW_MEM_ALIGNMENT) // height multiple of 16 */
+ && p_base->video.chroma == tmedia_chroma_rgb32; // Primary screen RGB32
+ if (p_self->b_have_rgb32_conv) {
+ p_base->video.chroma = tmedia_chroma_yuv420p;
+ }
#endif
- DDRAW_DEBUG_INFO("RGB32 -> I420 conversion supported: %s", p_self->b_have_rgb32_conv ? "YES" : "NO");
- // allocate YUV buffer
- if (p_self->b_have_rgb32_conv) {
- hr = _tdav_producer_screencast_alloc_yuv_buff(p_self, (DWORD)p_base->video.width, (DWORD)p_base->video.height);
- if (FAILED(hr)) {
- p_self->p_surf_primary->Unlock(NULL); // unlock before going to bail
- DDRAW_CHECK_HR(hr);
- }
- }
- // preview
+ DDRAW_DEBUG_INFO("RGB32 -> I420 conversion supported: %s", p_self->b_have_rgb32_conv ? "YES" : "NO");
+ // allocate YUV buffer
+ if (p_self->b_have_rgb32_conv) {
+ hr = _tdav_producer_screencast_alloc_yuv_buff(p_self, (DWORD)p_base->video.width, (DWORD)p_base->video.height);
+ if (FAILED(hr)) {
+ p_self->p_surf_primary->Unlock(NULL); // unlock before going to bail
+ DDRAW_CHECK_HR(hr);
+ }
+ }
+ // preview
#if DDRAW_PREVIEW
- p_self->bi_preview.bmiHeader.biWidth = ddsd.dwWidth;
- p_self->bi_preview.bmiHeader.biHeight = ddsd.dwHeight;
- p_self->bi_preview.bmiHeader.biBitCount = (WORD)ddsd.ddpfPixelFormat.dwRGBBitCount;
- p_self->bi_preview.bmiHeader.biSizeImage = (p_self->bi_preview.bmiHeader.biWidth * p_self->bi_preview.bmiHeader.biHeight * (p_self->bi_preview.bmiHeader.biBitCount >> 3));
+ p_self->bi_preview.bmiHeader.biWidth = ddsd.dwWidth;
+ p_self->bi_preview.bmiHeader.biHeight = ddsd.dwHeight;
+ p_self->bi_preview.bmiHeader.biBitCount = (WORD)ddsd.ddpfPixelFormat.dwRGBBitCount;
+ p_self->bi_preview.bmiHeader.biSizeImage = (p_self->bi_preview.bmiHeader.biWidth * p_self->bi_preview.bmiHeader.biHeight * (p_self->bi_preview.bmiHeader.biBitCount >> 3));
#endif /* DDRAW_PREVIEW */
- }
- nRowLengthInBytes = ddsd.dwWidth * (ddsd.ddpfPixelFormat.dwRGBBitCount >> 3);
- nSizeWithoutPadding = ddsd.dwHeight * nRowLengthInBytes;
-
- // init lpBuffToSend
- if (DDRAW_MEM_SURFACE_DIRECT_ACCESS && ddsd.lPitch == nRowLengthInBytes && (!p_self->b_have_rgb32_conv || DDRAW_IS_ALIGNED(ddsd.lpSurface, DDRAW_MEM_ALIGNMENT))) {
- // no padding
- lpBuffToSend = ddsd.lpSurface;
- bDirectMemSurfAccess = TRUE;
- }
- else {
- // with padding or copy requested
- UINT8 *pSurfBuff = (UINT8 *)ddsd.lpSurface, *pNegBuff = (UINT8 *)p_self->p_buff_rgb_aligned;
- DWORD y;
- bDirectMemSurfAccess = FALSE;
- //--timeStart = tsk_time_now();
- if (ddsd.lPitch == nRowLengthInBytes) {
- // copy without padding padding
- const UINT8* src = pSurfBuff;
- UINT8* dst = (UINT8*)p_self->p_buff_rgb_aligned;
- if (DDRAW_IS_ALIGNED(src, 16) && (nSizeWithoutPadding & 15) == 0) {
+ }
+ nRowLengthInBytes = ddsd.dwWidth * (ddsd.ddpfPixelFormat.dwRGBBitCount >> 3);
+ nSizeWithoutPadding = ddsd.dwHeight * nRowLengthInBytes;
+
+ // init lpBuffToSend
+ if (DDRAW_MEM_SURFACE_DIRECT_ACCESS && ddsd.lPitch == nRowLengthInBytes && (!p_self->b_have_rgb32_conv || DDRAW_IS_ALIGNED(ddsd.lpSurface, DDRAW_MEM_ALIGNMENT))) {
+ // no padding
+ lpBuffToSend = ddsd.lpSurface;
+ bDirectMemSurfAccess = TRUE;
+ }
+ else {
+ // with padding or copy requested
+ UINT8 *pSurfBuff = (UINT8 *)ddsd.lpSurface, *pNegBuff = (UINT8 *)p_self->p_buff_rgb_aligned;
+ DWORD y;
+ bDirectMemSurfAccess = FALSE;
+ //--timeStart = tsk_time_now();
+ if (ddsd.lPitch == nRowLengthInBytes) {
+ // copy without padding padding
+ const UINT8* src = pSurfBuff;
+ UINT8* dst = (UINT8*)p_self->p_buff_rgb_aligned;
+ if (DDRAW_IS_ALIGNED(src, 16) && (nSizeWithoutPadding & 15) == 0) {
#if DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM
- if ((nSizeWithoutPadding & 127) == 0) {
- for (DWORD i = 0; i < nSizeWithoutPadding; i += 128, src += 128, dst += 128) {
+ if ((nSizeWithoutPadding & 127) == 0) {
+ for (DWORD i = 0; i < nSizeWithoutPadding; i += 128, src += 128, dst += 128) {
#if defined(DDRAW_COPY128_ASM)
- DDRAW_COPY128_ASM(dst, src);
+ DDRAW_COPY128_ASM(dst, src);
#else
- DDRAW_COPY128_INTRIN(dst, src);
+ DDRAW_COPY128_INTRIN(dst, src);
#endif /* DDRAW_COPY128_ASM */
- }
- }
- else if((nSizeWithoutPadding & 63) == 0) {
- for (DWORD i = 0; i < nSizeWithoutPadding; i += 64, src += 64, dst += 64) {
+ }
+ }
+ else if((nSizeWithoutPadding & 63) == 0) {
+ for (DWORD i = 0; i < nSizeWithoutPadding; i += 64, src += 64, dst += 64) {
#if defined(DDRAW_COPY64_ASM)
- DDRAW_COPY64_ASM(dst, src);
+ DDRAW_COPY64_ASM(dst, src);
#else
- DDRAW_COPY64_INTRIN(dst, src);
+ DDRAW_COPY64_INTRIN(dst, src);
#endif /* DDRAW_COPY64_ASM */
- }
- }
- else { // (nSizeWithoutPadding & 15) == 0
- for (DWORD i = 0; i < nSizeWithoutPadding; i += 16, src += 16, dst += 16) {
+ }
+ }
+ else { // (nSizeWithoutPadding & 15) == 0
+ for (DWORD i = 0; i < nSizeWithoutPadding; i += 16, src += 16, dst += 16) {
#if defined(DDRAW_COPY16_ASM)
- DDRAW_COPY16_ASM(dst, src);
+ DDRAW_COPY16_ASM(dst, src);
#else
- DDRAW_COPY16_INTRIN(dst, src);
+ DDRAW_COPY16_INTRIN(dst, src);
#endif /* DDRAW_COPY16_ASM */
- }
- }
+ }
+ }
#else // neither ASM nor INTRINSIC support
- CopyMemory(dst, src, nSizeWithoutPadding);
+ CopyMemory(dst, src, nSizeWithoutPadding);
#endif /* DDRAW_HAVE_RGB32_TO_I420_INTRIN || DDRAW_HAVE_RGB32_TO_I420_ASM */
- }
- else { // not 16bytes aligned
- CopyMemory(dst, src, nSizeWithoutPadding);
- }
- }
- else {
- // copy with padding padding
- for (y = 0; y < ddsd.dwHeight; ++y) {
- CopyMemory(pNegBuff, pSurfBuff, nRowLengthInBytes);
- pSurfBuff += ddsd.lPitch;
- pNegBuff += nRowLengthInBytes;
- }
- }
- lpBuffToSend = p_self->p_buff_rgb_aligned;
- //--timeEnd = tsk_time_now();
- //--DDRAW_DEBUG_INFO("Mem copy: start=%llu, end=%llu, duration=%llu", timeStart, timeEnd, (timeEnd - timeStart));
- }
- if (!bDirectMemSurfAccess) {
- // surface buffer no longer needed, unlock
- DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Unlock(NULL));
- }
- // display preview
+ }
+ else { // not 16bytes aligned
+ CopyMemory(dst, src, nSizeWithoutPadding);
+ }
+ }
+ else {
+ // copy with padding padding
+ for (y = 0; y < ddsd.dwHeight; ++y) {
+ CopyMemory(pNegBuff, pSurfBuff, nRowLengthInBytes);
+ pSurfBuff += ddsd.lPitch;
+ pNegBuff += nRowLengthInBytes;
+ }
+ }
+ lpBuffToSend = p_self->p_buff_rgb_aligned;
+ //--timeEnd = tsk_time_now();
+ //--DDRAW_DEBUG_INFO("Mem copy: start=%llu, end=%llu, duration=%llu", timeStart, timeEnd, (timeEnd - timeStart));
+ }
+ if (!bDirectMemSurfAccess) {
+ // surface buffer no longer needed, unlock
+ DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Unlock(NULL));
+ }
+ // display preview
#if DDRAW_PREVIEW
- if (p_self->hwnd_preview) {
- HWND hWnd; // copy for thread-safeness
- HDC hDC = GetDC((hWnd = p_self->hwnd_preview));
- if (hDC) {
- RECT rcPreview;
- if (GetWindowRect(hWnd, &rcPreview)) {
- LONG nPreviewWidth = (rcPreview.right - rcPreview.left);
- LONG nPreviewHeight = (rcPreview.bottom - rcPreview.top);
- StretchDIBits(
- hDC,
- 0, 0, nPreviewWidth, nPreviewHeight,
- 0, 0, p_self->bi_preview.bmiHeader.biWidth, p_self->bi_preview.bmiHeader.biHeight,
- lpBuffToSend,
- &p_self->bi_preview,
- DIB_RGB_COLORS,
- SRCCOPY);
- }
- ReleaseDC(hWnd, hDC);
- }
- }
+ if (p_self->hwnd_preview) {
+ HWND hWnd; // copy for thread-safeness
+ HDC hDC = GetDC((hWnd = p_self->hwnd_preview));
+ if (hDC) {
+ RECT rcPreview;
+ if (GetWindowRect(hWnd, &rcPreview)) {
+ LONG nPreviewWidth = (rcPreview.right - rcPreview.left);
+ LONG nPreviewHeight = (rcPreview.bottom - rcPreview.top);
+ StretchDIBits(
+ hDC,
+ 0, 0, nPreviewWidth, nPreviewHeight,
+ 0, 0, p_self->bi_preview.bmiHeader.biWidth, p_self->bi_preview.bmiHeader.biHeight,
+ lpBuffToSend,
+ &p_self->bi_preview,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+ }
+ ReleaseDC(hWnd, hDC);
+ }
+ }
#endif /* DDRAW_PREVIEW */
- // check we have a free buffer
+ // check we have a free buffer
#if DDRAW_MT
- {
- for (INT iIndex = 0; iIndex < DDRAW_MT_COUNT; ++iIndex) {
- if (p_self->mt.b_flags_array[iIndex] != TRUE) {
- iMtFreeBuffIndex = iIndex;
- lpBuffYUV = p_self->mt.p_buff_yuv_aligned_array[iIndex];
- break;
- }
- }
- if (iMtFreeBuffIndex < 0) {
- lpBuffToSend = NULL; // do not waste time converting or encoding
- lpBuffYUV = NULL;
- }
- }
+ {
+ for (INT iIndex = 0; iIndex < DDRAW_MT_COUNT; ++iIndex) {
+ if (p_self->mt.b_flags_array[iIndex] != TRUE) {
+ iMtFreeBuffIndex = iIndex;
+ lpBuffYUV = p_self->mt.p_buff_yuv_aligned_array[iIndex];
+ break;
+ }
+ }
+ if (iMtFreeBuffIndex < 0) {
+ lpBuffToSend = NULL; // do not waste time converting or encoding
+ lpBuffYUV = NULL;
+ }
+ }
#else
- lpBuffYUV = p_self->p_buff_yuv_aligned;
+ lpBuffYUV = p_self->p_buff_yuv_aligned;
#endif /* DDRAW_MT */
- //--timeStart = tsk_time_now();
- if (lpBuffToSend && (lpBuffYUV || !p_self->b_have_rgb32_conv)) {
- if (p_self->b_have_rgb32_conv) {
- // Convert from RGB32 to I420
+ //--timeStart = tsk_time_now();
+ if (lpBuffToSend && (lpBuffYUV || !p_self->b_have_rgb32_conv)) {
+ if (p_self->b_have_rgb32_conv) {
+ // Convert from RGB32 to I420
#if DDRAW_HAVE_RGB32_TO_I420_ASM
- _tdav_producer_screencast_rgb32_to_yuv420_asm_ssse3((uint8_t*)lpBuffYUV, (const uint8_t*)lpBuffToSend, (int)p_base->video.width, (int)p_base->video.height);
+ _tdav_producer_screencast_rgb32_to_yuv420_asm_ssse3((uint8_t*)lpBuffYUV, (const uint8_t*)lpBuffToSend, (int)p_base->video.width, (int)p_base->video.height);
#elif DDRAW_HAVE_RGB32_TO_I420_INTRIN
- _tdav_producer_screencast_rgb32_to_yuv420_intrin_ssse3((uint8_t*)lpBuffYUV, (const uint8_t*)lpBuffToSend, (int)p_base->video.width, (int)p_base->video.height);
+ _tdav_producer_screencast_rgb32_to_yuv420_intrin_ssse3((uint8_t*)lpBuffYUV, (const uint8_t*)lpBuffToSend, (int)p_base->video.width, (int)p_base->video.height);
#else
- DDRAW_CHECK_HR(hr = E_NOTIMPL); // never called
+ DDRAW_CHECK_HR(hr = E_NOTIMPL); // never called
#endif
#if DDRAW_MT
- p_self->mt.b_flags_array[iMtFreeBuffIndex] = TRUE;
- if (!SetEvent(p_self->mt.h_events[iMtFreeBuffIndex])) {
- DDRAW_CHECK_HR(hr = E_FAIL);
- }
+ p_self->mt.b_flags_array[iMtFreeBuffIndex] = TRUE;
+ if (!SetEvent(p_self->mt.h_events[iMtFreeBuffIndex])) {
+ DDRAW_CHECK_HR(hr = E_FAIL);
+ }
#else
- p_base->enc_cb.callback(p_base->enc_cb.callback_data, lpBuffYUV, p_self->n_buff_yuv);
+ p_base->enc_cb.callback(p_base->enc_cb.callback_data, lpBuffYUV, p_self->n_buff_yuv);
#endif
- }
- else {
- // Send RGB32 buffer to the encode callback and let conversion be done by libyuv
- // do not multi-thread as we cannot perform chroma conversion and encoding in parallel
- p_base->enc_cb.callback(p_base->enc_cb.callback_data, lpBuffToSend, nSizeWithoutPadding);
- }
- }
- //--timeEnd = tsk_time_now();
- //--DDRAW_DEBUG_INFO("Encode callback: start=%llu, end=%llu, duration=%llu", timeStart, timeEnd, (timeEnd - timeStart));
-
- if (bDirectMemSurfAccess) {
- // surface buffer was used in preview and encode callback, unlock now
- DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Unlock(NULL));
- }
+ }
+ else {
+ // Send RGB32 buffer to the encode callback and let conversion be done by libyuv
+ // do not multi-thread as we cannot perform chroma conversion and encoding in parallel
+ p_base->enc_cb.callback(p_base->enc_cb.callback_data, lpBuffToSend, nSizeWithoutPadding);
+ }
+ }
+ //--timeEnd = tsk_time_now();
+ //--DDRAW_DEBUG_INFO("Encode callback: start=%llu, end=%llu, duration=%llu", timeStart, timeEnd, (timeEnd - timeStart));
-bail:
- if (hr == DDERR_SURFACELOST) {
- /*hr = */p_self->p_surf_primary->Restore();
- hr = S_OK;
- }
+ if (bDirectMemSurfAccess) {
+ // surface buffer was used in preview and encode callback, unlock now
+ DDRAW_CHECK_HR(hr = p_self->p_surf_primary->Unlock(NULL));
+ }
- //--timeEnd = tsk_time_now();
- //--DDRAW_DEBUG_INFO("Grab and encode duration=%llu", (timeEnd - timeStart));
+ bail:
+ if (hr == DDERR_SURFACELOST) {
+ /*hr = */p_self->p_surf_primary->Restore();
+ hr = S_OK;
+ }
+
+ //--timeEnd = tsk_time_now();
+ //--DDRAW_DEBUG_INFO("Grab and encode duration=%llu", (timeEnd - timeStart));
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static tmedia_chroma_t _tdav_producer_screencast_get_chroma(const DDPIXELFORMAT* pixelFormat)
{
- HRESULT hr = DD_OK;
- if (pixelFormat->dwFlags != DDPF_RGB) {
- DDRAW_DEBUG_ERROR("dwFlags(%d) != DDPF_RGB", pixelFormat->dwFlags);
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- }
- switch (pixelFormat->dwRGBBitCount) {
- case 32: // RGB32
- case 24: // RGB24
- // pixels must be aligned for fast copy
- if (pixelFormat->dwRBitMask != 0xff0000 || pixelFormat->dwGBitMask != 0xff00 || pixelFormat->dwBBitMask != 0xff || pixelFormat->dwRGBAlphaBitMask != 0) {
- DDRAW_DEBUG_ERROR("Pixels not aligned");
- }
- return pixelFormat->dwRGBBitCount == 24 ? tmedia_chroma_bgr24 : tmedia_chroma_rgb32;
- case 16: // RGB565
- // pixels must be aligned for fast copy
- if (pixelFormat->dwRBitMask != 0xF800 || pixelFormat->dwGBitMask != 0x7E0 || pixelFormat->dwBBitMask != 0x1F) {
- DDRAW_DEBUG_ERROR("Pixels not aligned");
- }
- return tmedia_chroma_rgb565le;
- default:
- DDRAW_DEBUG_ERROR("dwRGBBitCount(%d) != 24 and 32", pixelFormat->dwRGBBitCount);
- DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
- break;
- }
+ HRESULT hr = DD_OK;
+ if (pixelFormat->dwFlags != DDPF_RGB) {
+ DDRAW_DEBUG_ERROR("dwFlags(%d) != DDPF_RGB", pixelFormat->dwFlags);
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ }
+ switch (pixelFormat->dwRGBBitCount) {
+ case 32: // RGB32
+ case 24: // RGB24
+ // pixels must be aligned for fast copy
+ if (pixelFormat->dwRBitMask != 0xff0000 || pixelFormat->dwGBitMask != 0xff00 || pixelFormat->dwBBitMask != 0xff || pixelFormat->dwRGBAlphaBitMask != 0) {
+ DDRAW_DEBUG_ERROR("Pixels not aligned");
+ }
+ return pixelFormat->dwRGBBitCount == 24 ? tmedia_chroma_bgr24 : tmedia_chroma_rgb32;
+ case 16: // RGB565
+ // pixels must be aligned for fast copy
+ if (pixelFormat->dwRBitMask != 0xF800 || pixelFormat->dwGBitMask != 0x7E0 || pixelFormat->dwBBitMask != 0x1F) {
+ DDRAW_DEBUG_ERROR("Pixels not aligned");
+ }
+ return tmedia_chroma_rgb565le;
+ default:
+ DDRAW_DEBUG_ERROR("dwRGBBitCount(%d) != 24 and 32", pixelFormat->dwRGBBitCount);
+ DDRAW_CHECK_HR(hr = DDERR_INVALIDCAPS);
+ break;
+ }
-bail:
- return tmedia_chroma_none;
+ bail:
+ return tmedia_chroma_none;
}
static HRESULT _tdav_producer_screencast_create_module(LPDDrawModule lpModule)
{
- typedef HRESULT (WINAPI *pDirectDrawCreateFunc)(_In_ GUID FAR *lpGUID,
- _Out_ LPDIRECTDRAW FAR *lplpDD,
- _In_ IUnknown FAR *pUnkOuter);
- HRESULT hr = S_OK;
- pDirectDrawCreateFunc DirectDrawCreate_ = NULL;
-
- if (!lpModule) {
- DDRAW_CHECK_HR(hr = E_INVALIDARG);
- }
+ typedef HRESULT (WINAPI *pDirectDrawCreateFunc)(_In_ GUID FAR *lpGUID,
+ _Out_ LPDIRECTDRAW FAR *lplpDD,
+ _In_ IUnknown FAR *pUnkOuter);
+ HRESULT hr = S_OK;
+ pDirectDrawCreateFunc DirectDrawCreate_ = NULL;
+
+ if (!lpModule) {
+ DDRAW_CHECK_HR(hr = E_INVALIDARG);
+ }
- if (!lpModule->hDLL && !(lpModule->hDLL = LoadLibrary(TEXT("ddraw.dll")))) {
- DDRAW_DEBUG_ERROR("Failed to load ddraw.dll: %d", GetLastError());
- DDRAW_CHECK_HR(hr = E_FAIL);
- }
- if (!lpModule->lpDD) {
- // Hum, "GetProcAddressA" is missing but ""GetProcAddressW" exists on CE
+ if (!lpModule->hDLL && !(lpModule->hDLL = LoadLibrary(TEXT("ddraw.dll")))) {
+ DDRAW_DEBUG_ERROR("Failed to load ddraw.dll: %d", GetLastError());
+ DDRAW_CHECK_HR(hr = E_FAIL);
+ }
+ if (!lpModule->lpDD) {
+ // Hum, "GetProcAddressA" is missing but ""GetProcAddressW" exists on CE
#if TDAV_UNDER_WINDOWS_CE
# define DirectDrawCreateName TEXT("DirectDrawCreate")
#else
# define DirectDrawCreateName "DirectDrawCreate"
#endif
- if (!(DirectDrawCreate_ = (pDirectDrawCreateFunc)GetProcAddress(lpModule->hDLL, DirectDrawCreateName))) {
- DDRAW_DEBUG_ERROR("Failed to find DirectDrawCreate in ddraw.dll: %d", GetLastError());
- DDRAW_CHECK_HR(hr = E_FAIL);
- }
- DDRAW_CHECK_HR(hr = DirectDrawCreate_(NULL, &lpModule->lpDD, NULL));
- }
+ if (!(DirectDrawCreate_ = (pDirectDrawCreateFunc)GetProcAddress(lpModule->hDLL, DirectDrawCreateName))) {
+ DDRAW_DEBUG_ERROR("Failed to find DirectDrawCreate in ddraw.dll: %d", GetLastError());
+ DDRAW_CHECK_HR(hr = E_FAIL);
+ }
+ DDRAW_CHECK_HR(hr = DirectDrawCreate_(NULL, &lpModule->lpDD, NULL));
+ }
-bail:
- return hr;
+ bail:
+ return hr;
}
static HRESULT _tdav_producer_screencast_alloc_rgb_buff(tdav_producer_screencast_ddraw_t* p_ddraw, DWORD w, DWORD h, DWORD bitsCount)
{
- HRESULT hr = S_OK;
- DWORD n_buff_rgb_new = (w * h * (bitsCount >> 3));
-
- if (p_ddraw->n_buff_rgb < n_buff_rgb_new) {
- p_ddraw->p_buff_rgb_aligned = tsk_realloc_aligned(p_ddraw->p_buff_rgb_aligned, n_buff_rgb_new, DDRAW_MEM_ALIGNMENT);
- if (!p_ddraw->p_buff_rgb_aligned) {
- p_ddraw->n_buff_rgb = 0;
- DDRAW_CHECK_HR(hr = DDERR_OUTOFMEMORY);
- }
- p_ddraw->n_buff_rgb = n_buff_rgb_new;
- }
+ HRESULT hr = S_OK;
+ DWORD n_buff_rgb_new = (w * h * (bitsCount >> 3));
+
+ if (p_ddraw->n_buff_rgb < n_buff_rgb_new) {
+ p_ddraw->p_buff_rgb_aligned = tsk_realloc_aligned(p_ddraw->p_buff_rgb_aligned, n_buff_rgb_new, DDRAW_MEM_ALIGNMENT);
+ if (!p_ddraw->p_buff_rgb_aligned) {
+ p_ddraw->n_buff_rgb = 0;
+ DDRAW_CHECK_HR(hr = DDERR_OUTOFMEMORY);
+ }
+ p_ddraw->n_buff_rgb = n_buff_rgb_new;
+ }
-bail:
- return hr;
+ bail:
+ return hr;
}
static HRESULT _tdav_producer_screencast_alloc_yuv_buff(tdav_producer_screencast_ddraw_t* p_ddraw, DWORD w, DWORD h)
{
- HRESULT hr = S_OK;
- void** pp_buff_yuv_aligned;
- int n_buff_yuv_aligned_count;
+ HRESULT hr = S_OK;
+ void** pp_buff_yuv_aligned;
+ int n_buff_yuv_aligned_count;
#if DDRAW_MT
- pp_buff_yuv_aligned = p_ddraw->mt.p_buff_yuv_aligned_array;
- n_buff_yuv_aligned_count = sizeof(p_ddraw->mt.p_buff_yuv_aligned_array)/sizeof(p_ddraw->mt.p_buff_yuv_aligned_array[0]);
+ pp_buff_yuv_aligned = p_ddraw->mt.p_buff_yuv_aligned_array;
+ n_buff_yuv_aligned_count = sizeof(p_ddraw->mt.p_buff_yuv_aligned_array)/sizeof(p_ddraw->mt.p_buff_yuv_aligned_array[0]);
#else
- pp_buff_yuv_aligned = &p_ddraw->p_buff_yuv_aligned;
- n_buff_yuv_aligned_count = 1;
+ pp_buff_yuv_aligned = &p_ddraw->p_buff_yuv_aligned;
+ n_buff_yuv_aligned_count = 1;
#endif /* DDRAW_MT */
- p_ddraw->n_buff_yuv = (w * h * 3) >> 1;
- for (int i = 0; i < n_buff_yuv_aligned_count; ++i) {
- pp_buff_yuv_aligned[i] = tsk_realloc_aligned(pp_buff_yuv_aligned[i], p_ddraw->n_buff_yuv, DDRAW_MEM_ALIGNMENT);
- if (!pp_buff_yuv_aligned[i]) {
- p_ddraw->n_buff_yuv = 0;
- DDRAW_CHECK_HR(hr = DDERR_OUTOFMEMORY);
- }
- }
+ p_ddraw->n_buff_yuv = (w * h * 3) >> 1;
+ for (int i = 0; i < n_buff_yuv_aligned_count; ++i) {
+ pp_buff_yuv_aligned[i] = tsk_realloc_aligned(pp_buff_yuv_aligned[i], p_ddraw->n_buff_yuv, DDRAW_MEM_ALIGNMENT);
+ if (!pp_buff_yuv_aligned[i]) {
+ p_ddraw->n_buff_yuv = 0;
+ DDRAW_CHECK_HR(hr = DDERR_OUTOFMEMORY);
+ }
+ }
-bail:
- return hr;
+ bail:
+ return hr;
}
static void* TSK_STDCALL _tdav_producer_screencast_grap_thread(void *arg)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)arg;
- tmedia_producer_t* p_base = TMEDIA_PRODUCER(arg);
- int ret = 0;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)arg;
+ tmedia_producer_t* p_base = TMEDIA_PRODUCER(arg);
+ int ret = 0;
- // FPS manager
- uint64_t TimeNow, TimeLastFrame = 0;
- uint64_t TimeFrameDuration = (1000 / p_base->video.fps);
+ // FPS manager
+ uint64_t TimeNow, TimeLastFrame = 0;
+ uint64_t TimeFrameDuration = (1000 / p_base->video.fps);
- DDRAW_DEBUG_INFO("Grab thread -- START");
+ DDRAW_DEBUG_INFO("Grab thread -- START");
- while (ret == 0 && p_ddraw->b_started) {
+ while (ret == 0 && p_ddraw->b_started) {
#if DDRAW_CPU_THROTTLING
- TimeFrameDuration = (1000 / p_ddraw->cpu.fps_target);
+ TimeFrameDuration = (1000 / p_ddraw->cpu.fps_target);
#endif /* DDRAW_CPU_THROTTLING */
- TimeNow = tsk_time_now();
- if ((TimeNow - TimeLastFrame) > TimeFrameDuration) {
- if (!p_ddraw->b_muted && !p_ddraw->b_paused) {
- if (ret = _tdav_producer_screencast_grab(p_ddraw)) {
- goto next;
- }
- }
- TimeLastFrame = TimeNow;
- }
- else {
- tsk_thread_sleep(1);
+ TimeNow = tsk_time_now();
+ if ((TimeNow - TimeLastFrame) > TimeFrameDuration) {
+ if (!p_ddraw->b_muted && !p_ddraw->b_paused) {
+ if (ret = _tdav_producer_screencast_grab(p_ddraw)) {
+ goto next;
+ }
+ }
+ TimeLastFrame = TimeNow;
+ }
+ else {
+ tsk_thread_sleep(1);
#if 0
- DDRAW_DEBUG_INFO("Skip frame");
+ DDRAW_DEBUG_INFO("Skip frame");
#endif
- }
- next:
- ;
- }
- DDRAW_DEBUG_INFO("Grab thread -- STOP");
- return tsk_null;
+ }
+ next:
+ ;
+ }
+ DDRAW_DEBUG_INFO("Grab thread -- STOP");
+ return tsk_null;
}
#if DDRAW_MT
static void* TSK_STDCALL _tdav_producer_screencast_mt_encode_thread(void *arg)
{
- tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)arg;
- tmedia_producer_t* p_base = TMEDIA_PRODUCER(arg);
- DWORD dwEvent, dwIndex;
- int ret = 0;
- DWORD events_count = sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]);
-
- DDRAW_DEBUG_INFO("Encode MT thread -- START");
-
- while (ret == 0 && p_ddraw->b_started) {
- dwEvent = WaitForMultipleObjects(events_count, p_ddraw->mt.h_events, FALSE, INFINITE);
- if (!p_ddraw->b_started) {
- break;
- }
- if (dwEvent < WAIT_OBJECT_0 || dwEvent >(WAIT_OBJECT_0 + events_count)) {
- DDRAW_DEBUG_ERROR("Invalid dwEvent(%d)", dwEvent);
- break;
- }
- dwIndex = (dwEvent - WAIT_OBJECT_0);
- if (p_ddraw->mt.b_flags_array[dwIndex] != TRUE) {
- // must never happen
- DDRAW_DEBUG_ERROR("Invalid b_flags_array(%d)", dwIndex);
- break;
- }
-
- p_base->enc_cb.callback(p_base->enc_cb.callback_data, p_ddraw->mt.p_buff_yuv_aligned_array[dwIndex], p_ddraw->n_buff_yuv);
- p_ddraw->mt.b_flags_array[dwIndex] = FALSE;
- }
- DDRAW_DEBUG_INFO("Encode MT -- STOP");
- return tsk_null;
+ tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)arg;
+ tmedia_producer_t* p_base = TMEDIA_PRODUCER(arg);
+ DWORD dwEvent, dwIndex;
+ int ret = 0;
+ DWORD events_count = sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]);
+
+ DDRAW_DEBUG_INFO("Encode MT thread -- START");
+
+ while (ret == 0 && p_ddraw->b_started) {
+ dwEvent = WaitForMultipleObjects(events_count, p_ddraw->mt.h_events, FALSE, INFINITE);
+ if (!p_ddraw->b_started) {
+ break;
+ }
+ if (dwEvent < WAIT_OBJECT_0 || dwEvent >(WAIT_OBJECT_0 + events_count)) {
+ DDRAW_DEBUG_ERROR("Invalid dwEvent(%d)", dwEvent);
+ break;
+ }
+ dwIndex = (dwEvent - WAIT_OBJECT_0);
+ if (p_ddraw->mt.b_flags_array[dwIndex] != TRUE) {
+ // must never happen
+ DDRAW_DEBUG_ERROR("Invalid b_flags_array(%d)", dwIndex);
+ break;
+ }
+
+ p_base->enc_cb.callback(p_base->enc_cb.callback_data, p_ddraw->mt.p_buff_yuv_aligned_array[dwIndex], p_ddraw->n_buff_yuv);
+ p_ddraw->mt.b_flags_array[dwIndex] = FALSE;
+ }
+ DDRAW_DEBUG_INFO("Encode MT -- STOP");
+ return tsk_null;
}
#endif /* DDRAW_MT */
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
static unsigned long long FileTimeToInt64(const FILETIME & ft)
{
- return (((unsigned long long)(ft.dwHighDateTime))<<32) | ((unsigned long long)ft.dwLowDateTime);
+ return (((unsigned long long)(ft.dwHighDateTime))<<32) | ((unsigned long long)ft.dwLowDateTime);
}
static BOOL GetCpuPercents(unsigned long long* PercentIdle, unsigned long long* PercentUsage)
{
- static unsigned long long _prevTicks = 0;
- static unsigned long long _prevIdleTime = 0;
- unsigned long long ticks, idleTime;
- BOOL bSaveValues = FALSE, bSet = FALSE;
+ static unsigned long long _prevTicks = 0;
+ static unsigned long long _prevIdleTime = 0;
+ unsigned long long ticks, idleTime;
+ BOOL bSaveValues = FALSE, bSet = FALSE;
#if TDAV_UNDER_WINDOWS_CE
- bSaveValues = TRUE;
- ticks = GetTickCount();
- idleTime = GetIdleTime();
+ bSaveValues = TRUE;
+ ticks = GetTickCount();
+ idleTime = GetIdleTime();
#else
- {
- FILETIME _idleTime, _kernelTime, _userTime;
- if (GetSystemTimes(&_idleTime, &_kernelTime, &_userTime)) {
- idleTime = FileTimeToInt64(_idleTime);
- ticks = FileTimeToInt64(_kernelTime) + FileTimeToInt64(_userTime);
- bSaveValues = TRUE;
- }
- }
+ {
+ FILETIME _idleTime, _kernelTime, _userTime;
+ if (GetSystemTimes(&_idleTime, &_kernelTime, &_userTime)) {
+ idleTime = FileTimeToInt64(_idleTime);
+ ticks = FileTimeToInt64(_kernelTime) + FileTimeToInt64(_userTime);
+ bSaveValues = TRUE;
+ }
+ }
#endif
- if (_prevTicks > 0) {
- *PercentIdle = ((100 * (idleTime - _prevIdleTime)) / (ticks - _prevTicks));
- *PercentUsage = 100 - *PercentIdle;
- bSet = TRUE;
- }
- if (bSaveValues) {
- _prevTicks = ticks;
- _prevIdleTime = idleTime;
- }
+ if (_prevTicks > 0) {
+ *PercentIdle = ((100 * (idleTime - _prevIdleTime)) / (ticks - _prevTicks));
+ *PercentUsage = 100 - *PercentIdle;
+ bSet = TRUE;
+ }
+ if (bSaveValues) {
+ _prevTicks = ticks;
+ _prevIdleTime = idleTime;
+ }
- return bSet;
+ return bSet;
}
static int _tdav_producer_screencast_timer_cb(const void* arg, tsk_timer_id_t timer_id)
@@ -1420,36 +1416,36 @@ static int _tdav_producer_screencast_timer_cb(const void* arg, tsk_timer_id_t ti
tdav_producer_screencast_ddraw_t* p_ddraw = (tdav_producer_screencast_ddraw_t*)arg;
int ret = 0;
- if (!p_ddraw->b_started) {
- return 0;
- }
+ if (!p_ddraw->b_started) {
+ return 0;
+ }
if (p_ddraw->cpu.id_timer == timer_id) {
- unsigned long long PercentIdle, PercentUsage;
- if (GetCpuPercents(&PercentIdle, &PercentUsage) == TRUE) {
- TSK_DEBUG_INFO("\n\n****\n\nCPU Usage = %lld\n\n***", PercentUsage);
+ unsigned long long PercentIdle, PercentUsage;
+ if (GetCpuPercents(&PercentIdle, &PercentUsage) == TRUE) {
+ TSK_DEBUG_INFO("\n\n****\n\nCPU Usage = %lld\n\n***", PercentUsage);
#if DDRAW_CPU_THROTTLING
- {
- if ((PercentUsage + DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN) > DDRAW_CPU_THROTTLING_THRESHOLD) {
- unsigned long long NewTargetPercentUsage = TSK_CLAMP(DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, DDRAW_CPU_THROTTLING_THRESHOLD - DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, INT_MAX);
- int NewTargetFps = (int)((NewTargetPercentUsage * p_ddraw->cpu.fps_target) / PercentUsage);
- NewTargetFps = TSK_CLAMP(DDRAW_CPU_THROTTLING_FPS_MIN, NewTargetFps, TMEDIA_PRODUCER(p_ddraw)->video.fps);
- TSK_DEBUG_INFO("\n\n****\n\nCPU throttling = (%lld+%d)>%d, NewTargetPercentUsage=%lld, NewTargetFps=%d\n\n***",
- PercentUsage, DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, DDRAW_CPU_THROTTLING_THRESHOLD, NewTargetPercentUsage, NewTargetFps);
- p_ddraw->cpu.fps_target = NewTargetFps;
- }
- else if (PercentUsage < DDRAW_CPU_THROTTLING_THRESHOLD) {
- if ((p_ddraw->cpu.fps_target + DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN) < TMEDIA_PRODUCER(p_ddraw)->video.fps) { // not honoring the negotiated fps yet?
- p_ddraw->cpu.fps_target += 1; // TODO: this is ok only if the timer timeout is set to 1s or less
- }
- }
- }
+ {
+ if ((PercentUsage + DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN) > DDRAW_CPU_THROTTLING_THRESHOLD) {
+ unsigned long long NewTargetPercentUsage = TSK_CLAMP(DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, DDRAW_CPU_THROTTLING_THRESHOLD - DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, INT_MAX);
+ int NewTargetFps = (int)((NewTargetPercentUsage * p_ddraw->cpu.fps_target) / PercentUsage);
+ NewTargetFps = TSK_CLAMP(DDRAW_CPU_THROTTLING_FPS_MIN, NewTargetFps, TMEDIA_PRODUCER(p_ddraw)->video.fps);
+ TSK_DEBUG_INFO("\n\n****\n\nCPU throttling = (%lld+%d)>%d, NewTargetPercentUsage=%lld, NewTargetFps=%d\n\n***",
+ PercentUsage, DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN, DDRAW_CPU_THROTTLING_THRESHOLD, NewTargetPercentUsage, NewTargetFps);
+ p_ddraw->cpu.fps_target = NewTargetFps;
+ }
+ else if (PercentUsage < DDRAW_CPU_THROTTLING_THRESHOLD) {
+ if ((p_ddraw->cpu.fps_target + DDRAW_CPU_THROTTLING_THRESHOLD_MARGIN) < TMEDIA_PRODUCER(p_ddraw)->video.fps) { // not honoring the negotiated fps yet?
+ p_ddraw->cpu.fps_target += 1; // TODO: this is ok only if the timer timeout is set to 1s or less
+ }
+ }
+ }
#endif /* DDRAW_CPU_THROTTLING */
- }
+ }
- if (p_ddraw->b_started) {
- p_ddraw->cpu.id_timer = tsk_timer_manager_schedule(p_ddraw->p_timer_mgr, DDRAW_CPU_SCHEDULE_TIMEOUT, _tdav_producer_screencast_timer_cb, p_ddraw);
- }
+ if (p_ddraw->b_started) {
+ p_ddraw->cpu.id_timer = tsk_timer_manager_schedule(p_ddraw->p_timer_mgr, DDRAW_CPU_SCHEDULE_TIMEOUT, _tdav_producer_screencast_timer_cb, p_ddraw);
+ }
}
return 0;
}
@@ -1462,80 +1458,78 @@ static int _tdav_producer_screencast_timer_cb(const void* arg, tsk_timer_id_t ti
/* constructor */
static tsk_object_t* _tdav_producer_screencast_ddraw_ctor(tsk_object_t *self, va_list * app)
{
- tdav_producer_screencast_ddraw_t *p_ddraw = (tdav_producer_screencast_ddraw_t *)self;
- if (p_ddraw) {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(p_ddraw));
- TMEDIA_PRODUCER(p_ddraw)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
- /* init self with default values*/
- TMEDIA_PRODUCER(p_ddraw)->video.fps = 15;
- TMEDIA_PRODUCER(p_ddraw)->video.width = 352;
- TMEDIA_PRODUCER(p_ddraw)->video.height = 288;
-
- tsk_safeobj_init(p_ddraw);
- }
- return self;
+ tdav_producer_screencast_ddraw_t *p_ddraw = (tdav_producer_screencast_ddraw_t *)self;
+ if (p_ddraw) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(p_ddraw));
+ TMEDIA_PRODUCER(p_ddraw)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+ /* init self with default values*/
+ TMEDIA_PRODUCER(p_ddraw)->video.fps = 15;
+ TMEDIA_PRODUCER(p_ddraw)->video.width = 352;
+ TMEDIA_PRODUCER(p_ddraw)->video.height = 288;
+
+ tsk_safeobj_init(p_ddraw);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* _tdav_producer_screencast_ddraw_dtor(tsk_object_t * self)
{
- tdav_producer_screencast_ddraw_t *p_ddraw = (tdav_producer_screencast_ddraw_t *)self;
- if (p_ddraw) {
- /* stop */
- if (p_ddraw->b_started) {
- _tdav_producer_screencast_ddraw_stop((tmedia_producer_t*)p_ddraw);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(p_ddraw));
- /* deinit self */
+ tdav_producer_screencast_ddraw_t *p_ddraw = (tdav_producer_screencast_ddraw_t *)self;
+ if (p_ddraw) {
+ /* stop */
+ if (p_ddraw->b_started) {
+ _tdav_producer_screencast_ddraw_stop((tmedia_producer_t*)p_ddraw);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(p_ddraw));
+ /* deinit self */
#if DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING
- if (p_ddraw->p_timer_mgr) {
- tsk_timer_manager_destroy(&p_ddraw->p_timer_mgr);
- }
+ if (p_ddraw->p_timer_mgr) {
+ tsk_timer_manager_destroy(&p_ddraw->p_timer_mgr);
+ }
#endif /* DDRAW_CPU_MONITOR || DDRAW_CPU_THROTTLING */
#if DDRAW_MT
- for (int i = 0; i < sizeof(p_ddraw->mt.p_buff_yuv_aligned_array) / sizeof(p_ddraw->mt.p_buff_yuv_aligned_array[0]); ++i) {
- TSK_FREE_ALIGNED(p_ddraw->mt.p_buff_yuv_aligned_array[i]);
- }
- for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
- if (p_ddraw->mt.h_events[i]) {
- CloseHandle(p_ddraw->mt.h_events[i]);
- p_ddraw->mt.h_events[i] = NULL;
- }
- }
+ for (int i = 0; i < sizeof(p_ddraw->mt.p_buff_yuv_aligned_array) / sizeof(p_ddraw->mt.p_buff_yuv_aligned_array[0]); ++i) {
+ TSK_FREE_ALIGNED(p_ddraw->mt.p_buff_yuv_aligned_array[i]);
+ }
+ for (int i = 0; i < sizeof(p_ddraw->mt.h_events) / sizeof(p_ddraw->mt.h_events[0]); ++i) {
+ if (p_ddraw->mt.h_events[i]) {
+ CloseHandle(p_ddraw->mt.h_events[i]);
+ p_ddraw->mt.h_events[i] = NULL;
+ }
+ }
#endif /* DDRAW_MT */
- TSK_FREE_ALIGNED(p_ddraw->p_buff_rgb_aligned);
- TSK_FREE_ALIGNED(p_ddraw->p_buff_yuv_aligned);
- DDRAW_SAFE_RELEASE(&p_ddraw->p_surf_primary);
- DDrawModuleSafeFree(p_ddraw->ddrawModule);
- tsk_safeobj_deinit(p_ddraw);
+ TSK_FREE_ALIGNED(p_ddraw->p_buff_rgb_aligned);
+ TSK_FREE_ALIGNED(p_ddraw->p_buff_yuv_aligned);
+ DDRAW_SAFE_RELEASE(&p_ddraw->p_surf_primary);
+ DDrawModuleSafeFree(p_ddraw->ddrawModule);
+ tsk_safeobj_deinit(p_ddraw);
- DDRAW_DEBUG_INFO("*** destroyed ***");
- }
+ DDRAW_DEBUG_INFO("*** destroyed ***");
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_screencast_ddraw_def_s =
-{
- sizeof(tdav_producer_screencast_ddraw_t),
- _tdav_producer_screencast_ddraw_ctor,
- _tdav_producer_screencast_ddraw_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_screencast_ddraw_def_s = {
+ sizeof(tdav_producer_screencast_ddraw_t),
+ _tdav_producer_screencast_ddraw_ctor,
+ _tdav_producer_screencast_ddraw_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_screencast_ddraw_plugin_def_s =
-{
- &tdav_producer_screencast_ddraw_def_s,
- tmedia_bfcp_video,
- "Microsoft DirectDraw screencast producer",
-
- _tdav_producer_screencast_ddraw_set,
- _tdav_producer_screencast_ddraw_prepare,
- _tdav_producer_screencast_ddraw_start,
- _tdav_producer_screencast_ddraw_pause,
- _tdav_producer_screencast_ddraw_stop
+static const tmedia_producer_plugin_def_t tdav_producer_screencast_ddraw_plugin_def_s = {
+ &tdav_producer_screencast_ddraw_def_s,
+ tmedia_bfcp_video,
+ "Microsoft DirectDraw screencast producer",
+
+ _tdav_producer_screencast_ddraw_set,
+ _tdav_producer_screencast_ddraw_prepare,
+ _tdav_producer_screencast_ddraw_start,
+ _tdav_producer_screencast_ddraw_pause,
+ _tdav_producer_screencast_ddraw_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_screencast_ddraw_plugin_def_t = &tdav_producer_screencast_ddraw_plugin_def_s;
diff --git a/tinyDAV/src/video/gdi/tdav_consumer_video_gdi.c b/tinyDAV/src/video/gdi/tdav_consumer_video_gdi.c
index 8a81b66..bbfa2a1 100755
--- a/tinyDAV/src/video/gdi/tdav_consumer_video_gdi.c
+++ b/tinyDAV/src/video/gdi/tdav_consumer_video_gdi.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -34,19 +34,18 @@ static HRESULT SetFullscreen(struct tdav_consumer_video_gdi_s *p_gdi, BOOL bFull
static HWND CreateFullScreenWindow(struct tdav_consumer_video_gdi_s *p_gdi);
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-typedef struct tdav_consumer_video_gdi_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_video_gdi_s {
+ TMEDIA_DECLARE_CONSUMER;
- BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked, bWindowHookedFullScreen;
- HWND hWindow;
- WNDPROC wndProc;
- HWND hWindowFullScreen;
- WNDPROC wndProcFullScreen;
- BITMAPINFO bitmapInfo;
- void* pBuffer;
+ BOOL bStarted, bPrepared, bPaused, bFullScreen, bWindowHooked, bWindowHookedFullScreen;
+ HWND hWindow;
+ WNDPROC wndProc;
+ HWND hWindowFullScreen;
+ WNDPROC wndProcFullScreen;
+ BITMAPINFO bitmapInfo;
+ void* pBuffer;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_video_gdi_t;
@@ -55,426 +54,421 @@ tdav_consumer_video_gdi_t;
/* ============ Media Consumer Interface ================= */
static int tdav_consumer_video_gdi_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
- HRESULT hr = S_OK;
-
- if (!self || !param) {
- TSK_DEBUG_ERROR("Invalid parameter");
- CHECK_HR(hr = E_POINTER);
- }
-
- if (param->value_type == tmedia_pvt_int64) {
- if (tsk_striequals(param->key, "remote-hwnd")) {
- HWND hWnd = ((HWND)*((int64_t*)param->value));
- if (hWnd != p_gdi->hWindow) {
- tsk_safeobj_lock(p_gdi); // block consumer thread
- UnhookWindow(p_gdi, FALSE);
- p_gdi->hWindow = hWnd;
- tsk_safeobj_unlock(p_gdi); // unblock consumer thread
- }
- }
- }
- else if(param->value_type == tmedia_pvt_int32) {
- if(tsk_striequals(param->key, "fullscreen")) {
- BOOL bFullScreen = !!*((int32_t*)param->value);
- TSK_DEBUG_INFO("[GDI video consumer] Full Screen = %d", bFullScreen);
- CHECK_HR(hr = SetFullscreen(p_gdi, bFullScreen));
- }
- }
-
- CHECK_HR(hr);
+ int ret = 0;
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+ HRESULT hr = S_OK;
+
+ if (!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if (param->value_type == tmedia_pvt_int64) {
+ if (tsk_striequals(param->key, "remote-hwnd")) {
+ HWND hWnd = ((HWND)*((int64_t*)param->value));
+ if (hWnd != p_gdi->hWindow) {
+ tsk_safeobj_lock(p_gdi); // block consumer thread
+ UnhookWindow(p_gdi, FALSE);
+ p_gdi->hWindow = hWnd;
+ tsk_safeobj_unlock(p_gdi); // unblock consumer thread
+ }
+ }
+ }
+ else if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "fullscreen")) {
+ BOOL bFullScreen = !!*((int32_t*)param->value);
+ TSK_DEBUG_INFO("[GDI video consumer] Full Screen = %d", bFullScreen);
+ CHECK_HR(hr = SetFullscreen(p_gdi, bFullScreen));
+ }
+ }
+
+ CHECK_HR(hr);
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int tdav_consumer_video_gdi_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
-
- if (!p_gdi || !codec && codec->plugin) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- TMEDIA_CONSUMER(p_gdi)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(p_gdi)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(p_gdi)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if (!TMEDIA_CONSUMER(p_gdi)->video.display.width) {
- TMEDIA_CONSUMER(p_gdi)->video.display.width = TMEDIA_CONSUMER(p_gdi)->video.in.width;
- }
- if (!TMEDIA_CONSUMER(p_gdi)->video.display.height) {
- TMEDIA_CONSUMER(p_gdi)->video.display.height = TMEDIA_CONSUMER(p_gdi)->video.in.height;
- }
-
- ZeroMemory(&p_gdi->bitmapInfo, sizeof(p_gdi->bitmapInfo));
- p_gdi->bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- p_gdi->bitmapInfo.bmiHeader.biPlanes = 1;
- p_gdi->bitmapInfo.bmiHeader.biBitCount = 24; // RGB24
- p_gdi->bitmapInfo.bmiHeader.biCompression = BI_RGB;
- p_gdi->bitmapInfo.bmiHeader.biWidth = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.width;
- p_gdi->bitmapInfo.bmiHeader.biHeight = (LONG)(TMEDIA_CONSUMER(p_gdi)->video.in.height * -1);
- p_gdi->bitmapInfo.bmiHeader.biSizeImage = (DWORD)(TMEDIA_CONSUMER(p_gdi)->video.in.width * abs((int)TMEDIA_CONSUMER(p_gdi)->video.in.height) *
- (p_gdi->bitmapInfo.bmiHeader.biBitCount >> 3));
-
- return 0;
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+
+ if (!p_gdi || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ TMEDIA_CONSUMER(p_gdi)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(p_gdi)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(p_gdi)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if (!TMEDIA_CONSUMER(p_gdi)->video.display.width) {
+ TMEDIA_CONSUMER(p_gdi)->video.display.width = TMEDIA_CONSUMER(p_gdi)->video.in.width;
+ }
+ if (!TMEDIA_CONSUMER(p_gdi)->video.display.height) {
+ TMEDIA_CONSUMER(p_gdi)->video.display.height = TMEDIA_CONSUMER(p_gdi)->video.in.height;
+ }
+
+ ZeroMemory(&p_gdi->bitmapInfo, sizeof(p_gdi->bitmapInfo));
+ p_gdi->bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ p_gdi->bitmapInfo.bmiHeader.biPlanes = 1;
+ p_gdi->bitmapInfo.bmiHeader.biBitCount = 24; // RGB24
+ p_gdi->bitmapInfo.bmiHeader.biCompression = BI_RGB;
+ p_gdi->bitmapInfo.bmiHeader.biWidth = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.width;
+ p_gdi->bitmapInfo.bmiHeader.biHeight = (LONG)(TMEDIA_CONSUMER(p_gdi)->video.in.height * -1);
+ p_gdi->bitmapInfo.bmiHeader.biSizeImage = (DWORD)(TMEDIA_CONSUMER(p_gdi)->video.in.width * abs((int)TMEDIA_CONSUMER(p_gdi)->video.in.height) *
+ (p_gdi->bitmapInfo.bmiHeader.biBitCount >> 3));
+
+ return 0;
}
static int tdav_consumer_video_gdi_start(tmedia_consumer_t* self)
{
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_gdi);
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- p_gdi->bPaused = FALSE;
- p_gdi->bStarted = TRUE;
+ tsk_safeobj_lock(p_gdi);
- tsk_safeobj_unlock(p_gdi);
+ p_gdi->bPaused = FALSE;
+ p_gdi->bStarted = TRUE;
- return 0;
+ tsk_safeobj_unlock(p_gdi);
+
+ return 0;
}
static int tdav_consumer_video_gdi_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
- int ret = 0;
- HWND* p_Window;
- BOOL *p_bWindowHooked, bImputSizeChanged;
-
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_gdi);
-
- if (!p_gdi->bStarted || p_gdi->bPaused) {
- TSK_DEBUG_INFO("GDI consumer stopped or paused");
- goto bail;
- }
-
- bImputSizeChanged = (size != p_gdi->bitmapInfo.bmiHeader.biSizeImage)
- || (TMEDIA_CONSUMER(p_gdi)->video.in.width != p_gdi->bitmapInfo.bmiHeader.biWidth)
- || (TMEDIA_CONSUMER(p_gdi)->video.in.height != TSK_ABS(p_gdi->bitmapInfo.bmiHeader.biHeight));
-
- if (bImputSizeChanged) {
- tsk_size_t xNewSize = TMEDIA_CONSUMER(p_gdi)->video.in.width * TMEDIA_CONSUMER(p_gdi)->video.in.height * (p_gdi->bitmapInfo.bmiHeader.biBitCount >> 3);
- TSK_DEBUG_INFO("GDI input size changed: %u->%u", p_gdi->bitmapInfo.bmiHeader.biSizeImage, size);
- if (xNewSize != size) {
- TSK_DEBUG_ERROR("GDI consumer: chroma issue?");
- ret = -1;
- goto bail;
- }
- p_gdi->bitmapInfo.bmiHeader.biWidth = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.width;
- p_gdi->bitmapInfo.bmiHeader.biHeight = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.height * -1;
- p_gdi->bitmapInfo.bmiHeader.biSizeImage = (DWORD)xNewSize;
- p_gdi->pBuffer = tsk_realloc(p_gdi->pBuffer, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
- }
-
- p_Window = p_gdi->bFullScreen ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
- p_bWindowHooked = p_gdi->bFullScreen ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
-
- if (*p_Window) {
- if (!*p_bWindowHooked) {
- // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
- CHECK_HR(HookWindow(p_gdi, *p_Window, p_gdi->bFullScreen));
- }
- if (!p_gdi->pBuffer) {
- p_gdi->pBuffer = tsk_realloc(p_gdi->pBuffer, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
- }
- if (p_gdi->pBuffer) {
- memcpy(p_gdi->pBuffer, buffer, size);
- InvalidateRect(*p_Window, NULL, TRUE);
- }
- }
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+ int ret = 0;
+ HWND* p_Window;
+ BOOL *p_bWindowHooked, bImputSizeChanged;
+
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_gdi);
+
+ if (!p_gdi->bStarted || p_gdi->bPaused) {
+ TSK_DEBUG_INFO("GDI consumer stopped or paused");
+ goto bail;
+ }
+
+ bImputSizeChanged = (size != p_gdi->bitmapInfo.bmiHeader.biSizeImage)
+ || (TMEDIA_CONSUMER(p_gdi)->video.in.width != p_gdi->bitmapInfo.bmiHeader.biWidth)
+ || (TMEDIA_CONSUMER(p_gdi)->video.in.height != TSK_ABS(p_gdi->bitmapInfo.bmiHeader.biHeight));
+
+ if (bImputSizeChanged) {
+ tsk_size_t xNewSize = TMEDIA_CONSUMER(p_gdi)->video.in.width * TMEDIA_CONSUMER(p_gdi)->video.in.height * (p_gdi->bitmapInfo.bmiHeader.biBitCount >> 3);
+ TSK_DEBUG_INFO("GDI input size changed: %u->%u", p_gdi->bitmapInfo.bmiHeader.biSizeImage, size);
+ if (xNewSize != size) {
+ TSK_DEBUG_ERROR("GDI consumer: chroma issue?");
+ ret = -1;
+ goto bail;
+ }
+ p_gdi->bitmapInfo.bmiHeader.biWidth = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.width;
+ p_gdi->bitmapInfo.bmiHeader.biHeight = (LONG)TMEDIA_CONSUMER(p_gdi)->video.in.height * -1;
+ p_gdi->bitmapInfo.bmiHeader.biSizeImage = (DWORD)xNewSize;
+ p_gdi->pBuffer = tsk_realloc(p_gdi->pBuffer, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
+ }
+
+ p_Window = p_gdi->bFullScreen ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
+ p_bWindowHooked = p_gdi->bFullScreen ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
+
+ if (*p_Window) {
+ if (!*p_bWindowHooked) {
+ // Do not hook "hWnd" as it could be the fullscreen handle which is always hooked.
+ CHECK_HR(HookWindow(p_gdi, *p_Window, p_gdi->bFullScreen));
+ }
+ if (!p_gdi->pBuffer) {
+ p_gdi->pBuffer = tsk_realloc(p_gdi->pBuffer, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
+ }
+ if (p_gdi->pBuffer) {
+ memcpy(p_gdi->pBuffer, buffer, size);
+ InvalidateRect(*p_Window, NULL, TRUE);
+ }
+ }
bail:
- tsk_safeobj_unlock(p_gdi);
- return ret;
+ tsk_safeobj_unlock(p_gdi);
+ return ret;
}
static int tdav_consumer_video_gdi_pause(tmedia_consumer_t* self)
{
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_gdi);
+ tsk_safeobj_lock(p_gdi);
- p_gdi->bPaused = TRUE;
+ p_gdi->bPaused = TRUE;
- tsk_safeobj_unlock(p_gdi);
+ tsk_safeobj_unlock(p_gdi);
- return 0;
+ return 0;
}
static int tdav_consumer_video_gdi_stop(tmedia_consumer_t* self)
{
- tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
-
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_gdi);
-
- p_gdi->bStarted = FALSE;
- p_gdi->bPaused = FALSE;
- SetFullscreen(p_gdi, FALSE);
- UnhookWindow(p_gdi, TRUE);
- UnhookWindow(p_gdi, FALSE);
-
- tsk_safeobj_unlock(p_gdi);
-
- return 0;
+ tdav_consumer_video_gdi_t* p_gdi = (tdav_consumer_video_gdi_t*)self;
+
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_gdi);
+
+ p_gdi->bStarted = FALSE;
+ p_gdi->bPaused = FALSE;
+ SetFullscreen(p_gdi, FALSE);
+ UnhookWindow(p_gdi, TRUE);
+ UnhookWindow(p_gdi, FALSE);
+
+ tsk_safeobj_unlock(p_gdi);
+
+ return 0;
}
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_CREATE:
- case WM_SIZE:
- case WM_MOVE:
- {
- struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
- if (p_gdi) {
-
- }
- break;
- }
-
- case WM_PAINT:
- {
- struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
- if (p_gdi) {
- tsk_safeobj_lock(p_gdi);
-
- if (p_gdi->bStarted && !p_gdi->bPaused && p_gdi->pBuffer) {
- PAINTSTRUCT ps;
- HDC hdc;
- RECT rc, logical_rect;
- int height, width, i, x, y;
- HDC dc_mem, all_dc[2];
- HBITMAP bmp_mem;
- HGDIOBJ bmp_old;
- POINT logical_area;
- HBRUSH brush;
-
- if (!(hdc = BeginPaint(hWnd, &ps))) {
- goto paint_done;
- }
-
- if (!GetClientRect(hWnd, &rc)) {
- EndPaint(hWnd, &ps);
- goto paint_done;
- }
-
- height = abs(p_gdi->bitmapInfo.bmiHeader.biHeight);
- width = p_gdi->bitmapInfo.bmiHeader.biWidth;
-
- dc_mem = CreateCompatibleDC(ps.hdc);
- SetStretchBltMode(dc_mem, HALFTONE);
-
- // Set the map mode so that the ratio will be maintained for us.
- all_dc[0] = ps.hdc, all_dc[1] = dc_mem;
- for (i = 0; i < sizeof(all_dc)/sizeof(all_dc[0]); ++i) {
+ switch(uMsg) {
+ case WM_CREATE:
+ case WM_SIZE:
+ case WM_MOVE: {
+ struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
+ if (p_gdi) {
+
+ }
+ break;
+ }
+
+ case WM_PAINT: {
+ struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
+ if (p_gdi) {
+ tsk_safeobj_lock(p_gdi);
+
+ if (p_gdi->bStarted && !p_gdi->bPaused && p_gdi->pBuffer) {
+ PAINTSTRUCT ps;
+ HDC hdc;
+ RECT rc, logical_rect;
+ int height, width, i, x, y;
+ HDC dc_mem, all_dc[2];
+ HBITMAP bmp_mem;
+ HGDIOBJ bmp_old;
+ POINT logical_area;
+ HBRUSH brush;
+
+ if (!(hdc = BeginPaint(hWnd, &ps))) {
+ goto paint_done;
+ }
+
+ if (!GetClientRect(hWnd, &rc)) {
+ EndPaint(hWnd, &ps);
+ goto paint_done;
+ }
+
+ height = abs(p_gdi->bitmapInfo.bmiHeader.biHeight);
+ width = p_gdi->bitmapInfo.bmiHeader.biWidth;
+
+ dc_mem = CreateCompatibleDC(ps.hdc);
+ SetStretchBltMode(dc_mem, HALFTONE);
+
+ // Set the map mode so that the ratio will be maintained for us.
+ all_dc[0] = ps.hdc, all_dc[1] = dc_mem;
+ for (i = 0; i < sizeof(all_dc)/sizeof(all_dc[0]); ++i) {
#if !TDAV_UNDER_WINDOWS_CE
- SetMapMode(all_dc[i], MM_ISOTROPIC);
- SetWindowExtEx(all_dc[i], width, height, NULL);
- SetViewportExtEx(all_dc[i], rc.right, rc.bottom, NULL);
+ SetMapMode(all_dc[i], MM_ISOTROPIC);
+ SetWindowExtEx(all_dc[i], width, height, NULL);
+ SetViewportExtEx(all_dc[i], rc.right, rc.bottom, NULL);
#endif
- }
+ }
- bmp_mem = CreateCompatibleBitmap(ps.hdc, rc.right, rc.bottom);
- bmp_old = SelectObject(dc_mem, bmp_mem);
+ bmp_mem = CreateCompatibleBitmap(ps.hdc, rc.right, rc.bottom);
+ bmp_old = SelectObject(dc_mem, bmp_mem);
- logical_area.x = rc.right, logical_area.y = rc.bottom;
+ logical_area.x = rc.right, logical_area.y = rc.bottom;
#if !TDAV_UNDER_WINDOWS_CE
- DPtoLP(ps.hdc, &logical_area, 1);
+ DPtoLP(ps.hdc, &logical_area, 1);
#endif
- brush = CreateSolidBrush(RGB(0, 0, 0));
- logical_rect.left = 0, logical_rect.top = 0, logical_rect.right = logical_area.x, logical_rect.bottom = logical_area.y;
- FillRect(dc_mem, &logical_rect, brush);
- DeleteObject(brush);
+ brush = CreateSolidBrush(RGB(0, 0, 0));
+ logical_rect.left = 0, logical_rect.top = 0, logical_rect.right = logical_area.x, logical_rect.bottom = logical_area.y;
+ FillRect(dc_mem, &logical_rect, brush);
+ DeleteObject(brush);
- x = (logical_area.x / 2) - (width / 2);
- y = (logical_area.y / 2) - (height / 2);
+ x = (logical_area.x / 2) - (width / 2);
+ y = (logical_area.y / 2) - (height / 2);
- StretchDIBits(dc_mem, x, y, width, height,
- 0, 0, width, height, p_gdi->pBuffer, &p_gdi->bitmapInfo, DIB_RGB_COLORS, SRCCOPY);
+ StretchDIBits(dc_mem, x, y, width, height,
+ 0, 0, width, height, p_gdi->pBuffer, &p_gdi->bitmapInfo, DIB_RGB_COLORS, SRCCOPY);
- BitBlt(ps.hdc, 0, 0, logical_area.x, logical_area.y,
- dc_mem, 0, 0, SRCCOPY);
+ BitBlt(ps.hdc, 0, 0, logical_area.x, logical_area.y,
+ dc_mem, 0, 0, SRCCOPY);
- // Cleanup.
- SelectObject(dc_mem, bmp_old);
- DeleteObject(bmp_mem);
- DeleteDC(dc_mem);
+ // Cleanup.
+ SelectObject(dc_mem, bmp_old);
+ DeleteObject(bmp_mem);
+ DeleteDC(dc_mem);
- EndPaint(hWnd, &ps);
- }
+ EndPaint(hWnd, &ps);
+ }
paint_done:
- tsk_safeobj_unlock(p_gdi);
- }
- break;
- }
-
- case WM_ERASEBKGND:
- {
- return TRUE; // avoid background erasing.
- }
-
- case WM_CHAR:
- case WM_KEYUP:
- {
- struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
- if (p_gdi) {
- SetFullscreen(p_gdi, FALSE);
- }
-
- break;
- }
- }
-
- return DefWindowProc(hWnd, uMsg, wParam, lParam);
+ tsk_safeobj_unlock(p_gdi);
+ }
+ break;
+ }
+
+ case WM_ERASEBKGND: {
+ return TRUE; // avoid background erasing.
+ }
+
+ case WM_CHAR:
+ case WM_KEYUP: {
+ struct tdav_consumer_video_gdi_s* p_gdi = ((struct tdav_consumer_video_gdi_s*)GetProp(hWnd, TEXT("Self")));
+ if (p_gdi) {
+ SetFullscreen(p_gdi, FALSE);
+ }
+
+ break;
+ }
+ }
+
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
static HRESULT HookWindow(struct tdav_consumer_video_gdi_s *p_gdi, HWND hWnd, BOOL bFullScreenWindow)
{
- HRESULT hr = S_OK;
- HWND* p_Window = bFullScreenWindow ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
- WNDPROC* p_wndProc = bFullScreenWindow ? &p_gdi->wndProcFullScreen : &p_gdi->wndProc;
- BOOL* p_bWindowHooked = bFullScreenWindow ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
+ HRESULT hr = S_OK;
+ HWND* p_Window = bFullScreenWindow ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
+ WNDPROC* p_wndProc = bFullScreenWindow ? &p_gdi->wndProcFullScreen : &p_gdi->wndProc;
+ BOOL* p_bWindowHooked = bFullScreenWindow ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
- tsk_safeobj_lock(p_gdi);
+ tsk_safeobj_lock(p_gdi);
- CHECK_HR(hr = UnhookWindow(p_gdi, bFullScreenWindow));
+ CHECK_HR(hr = UnhookWindow(p_gdi, bFullScreenWindow));
- if ((*p_Window = hWnd)) {
+ if ((*p_Window = hWnd)) {
#if TDAV_UNDER_WINDOWS_CE
- *p_wndProc = (WNDPROC)SetWindowLong(hWnd, GWL_WNDPROC, (LONG)WndProc);
+ *p_wndProc = (WNDPROC)SetWindowLong(hWnd, GWL_WNDPROC, (LONG)WndProc);
#else
- *p_wndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)WndProc);
+ *p_wndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)WndProc);
#endif
- if (!*p_wndProc) {
- TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
- CHECK_HR(hr = E_FAIL);
- }
- *p_bWindowHooked = TRUE;
- SetProp(*p_Window, TEXT("Self"), p_gdi);
- }
+ if (!*p_wndProc) {
+ TSK_DEBUG_ERROR("HookWindowLongPtr() failed with errcode=%d", GetLastError());
+ CHECK_HR(hr = E_FAIL);
+ }
+ *p_bWindowHooked = TRUE;
+ SetProp(*p_Window, TEXT("Self"), p_gdi);
+ }
bail:
- tsk_safeobj_unlock(p_gdi);
- return S_OK;
+ tsk_safeobj_unlock(p_gdi);
+ return S_OK;
}
static HRESULT UnhookWindow(struct tdav_consumer_video_gdi_s *p_gdi, BOOL bFullScreenWindow)
{
- HWND* p_Window = bFullScreenWindow ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
- WNDPROC* p_wndProc = bFullScreenWindow ? &p_gdi->wndProcFullScreen : &p_gdi->wndProc;
- BOOL* p_bWindowHooked = bFullScreenWindow ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
+ HWND* p_Window = bFullScreenWindow ? &p_gdi->hWindowFullScreen : &p_gdi->hWindow;
+ WNDPROC* p_wndProc = bFullScreenWindow ? &p_gdi->wndProcFullScreen : &p_gdi->wndProc;
+ BOOL* p_bWindowHooked = bFullScreenWindow ? &p_gdi->bWindowHookedFullScreen : &p_gdi->bWindowHooked;
- tsk_safeobj_lock(p_gdi);
- if (*p_Window && *p_wndProc) {
+ tsk_safeobj_lock(p_gdi);
+ if (*p_Window && *p_wndProc) {
#if TDAV_UNDER_WINDOWS_CE
- SetWindowLong(*p_Window, GWL_WNDPROC, (LONG)*p_wndProc);
+ SetWindowLong(*p_Window, GWL_WNDPROC, (LONG)*p_wndProc);
#else
- SetWindowLongPtr(*p_Window, GWLP_WNDPROC, (LONG_PTR)*p_wndProc);
+ SetWindowLongPtr(*p_Window, GWLP_WNDPROC, (LONG_PTR)*p_wndProc);
#endif
- *p_wndProc = NULL;
- }
- if (*p_Window) {
- if (p_gdi->pBuffer) {
- memset(p_gdi->pBuffer, 0, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
- }
- InvalidateRect(*p_Window, NULL, FALSE);
- }
- *p_bWindowHooked = FALSE;
- tsk_safeobj_unlock(p_gdi);
- return S_OK;
+ *p_wndProc = NULL;
+ }
+ if (*p_Window) {
+ if (p_gdi->pBuffer) {
+ memset(p_gdi->pBuffer, 0, p_gdi->bitmapInfo.bmiHeader.biSizeImage);
+ }
+ InvalidateRect(*p_Window, NULL, FALSE);
+ }
+ *p_bWindowHooked = FALSE;
+ tsk_safeobj_unlock(p_gdi);
+ return S_OK;
}
static HRESULT SetFullscreen(struct tdav_consumer_video_gdi_s *p_gdi, BOOL bFullScreen)
{
- HRESULT hr = S_OK;
- if (!p_gdi) {
- CHECK_HR(hr = E_POINTER);
- }
-
- if (p_gdi->bFullScreen != bFullScreen) {
- tsk_safeobj_lock(p_gdi);
- if (bFullScreen) {
- HWND hWnd = CreateFullScreenWindow(p_gdi);
- if (hWnd) {
+ HRESULT hr = S_OK;
+ if (!p_gdi) {
+ CHECK_HR(hr = E_POINTER);
+ }
+
+ if (p_gdi->bFullScreen != bFullScreen) {
+ tsk_safeobj_lock(p_gdi);
+ if (bFullScreen) {
+ HWND hWnd = CreateFullScreenWindow(p_gdi);
+ if (hWnd) {
#if TDAV_UNDER_WINDOWS_CE
- ShowWindow(hWnd, SW_SHOWNORMAL);
+ ShowWindow(hWnd, SW_SHOWNORMAL);
#else
- ShowWindow(hWnd, SW_SHOWDEFAULT);
+ ShowWindow(hWnd, SW_SHOWDEFAULT);
#endif
- UpdateWindow(hWnd);
- HookWindow(p_gdi, hWnd, TRUE);
- }
- }
- else if(p_gdi->hWindowFullScreen) {
- ShowWindow(p_gdi->hWindowFullScreen, SW_HIDE);
- UnhookWindow(p_gdi, TRUE);
- }
- p_gdi->bFullScreen = bFullScreen;
- tsk_safeobj_unlock(p_gdi);
-
- CHECK_HR(hr);
- }
+ UpdateWindow(hWnd);
+ HookWindow(p_gdi, hWnd, TRUE);
+ }
+ }
+ else if(p_gdi->hWindowFullScreen) {
+ ShowWindow(p_gdi->hWindowFullScreen, SW_HIDE);
+ UnhookWindow(p_gdi, TRUE);
+ }
+ p_gdi->bFullScreen = bFullScreen;
+ tsk_safeobj_unlock(p_gdi);
+
+ CHECK_HR(hr);
+ }
bail:
- return hr;
+ return hr;
}
static HWND CreateFullScreenWindow(struct tdav_consumer_video_gdi_s *p_gdi)
{
- HRESULT hr = S_OK;
-
- if(!p_gdi) {
- return NULL;
- }
-
- if (!p_gdi->hWindowFullScreen) {
- WNDCLASS wc = {0};
-
- wc.lpfnWndProc = WndProc;
- wc.hInstance = GetModuleHandle(NULL);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.lpszClassName = L"WindowClass";
- RegisterClass(&wc);
- p_gdi->hWindowFullScreen = CreateWindowEx(
- 0,
- wc.lpszClassName,
- L"Doubango's Video Consumer Fullscreen",
- WS_EX_TOPMOST | WS_POPUP,
- 0, 0,
- GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
- NULL,
- NULL,
- GetModuleHandle(NULL),
- NULL);
-
- SetProp(p_gdi->hWindowFullScreen, TEXT("Self"), p_gdi);
- }
- return p_gdi->hWindowFullScreen;
+ HRESULT hr = S_OK;
+
+ if(!p_gdi) {
+ return NULL;
+ }
+
+ if (!p_gdi->hWindowFullScreen) {
+ WNDCLASS wc = {0};
+
+ wc.lpfnWndProc = WndProc;
+ wc.hInstance = GetModuleHandle(NULL);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.lpszClassName = L"WindowClass";
+ RegisterClass(&wc);
+ p_gdi->hWindowFullScreen = CreateWindowEx(
+ 0,
+ wc.lpszClassName,
+ L"Doubango's Video Consumer Fullscreen",
+ WS_EX_TOPMOST | WS_POPUP,
+ 0, 0,
+ GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
+ NULL,
+ NULL,
+ GetModuleHandle(NULL),
+ NULL);
+
+ SetProp(p_gdi->hWindowFullScreen, TEXT("Self"), p_gdi);
+ }
+ return p_gdi->hWindowFullScreen;
}
//
@@ -483,60 +477,58 @@ static HWND CreateFullScreenWindow(struct tdav_consumer_video_gdi_s *p_gdi)
/* constructor */
static tsk_object_t* tdav_consumer_video_gdi_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_video_gdi_t *p_gdi = (tdav_consumer_video_gdi_t *)self;
- if (p_gdi) {
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(p_gdi));
- TMEDIA_CONSUMER(p_gdi)->video.display.chroma = tmedia_chroma_bgr24;
-
- /* init self */
- TMEDIA_CONSUMER(p_gdi)->video.fps = 15;
- TMEDIA_CONSUMER(p_gdi)->video.display.width = 352;
- TMEDIA_CONSUMER(p_gdi)->video.display.height = 288;
- TMEDIA_CONSUMER(p_gdi)->video.display.auto_resize = tsk_true;
- tsk_safeobj_init(p_gdi);
- }
- return self;
+ tdav_consumer_video_gdi_t *p_gdi = (tdav_consumer_video_gdi_t *)self;
+ if (p_gdi) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(p_gdi));
+ TMEDIA_CONSUMER(p_gdi)->video.display.chroma = tmedia_chroma_bgr24;
+
+ /* init self */
+ TMEDIA_CONSUMER(p_gdi)->video.fps = 15;
+ TMEDIA_CONSUMER(p_gdi)->video.display.width = 352;
+ TMEDIA_CONSUMER(p_gdi)->video.display.height = 288;
+ TMEDIA_CONSUMER(p_gdi)->video.display.auto_resize = tsk_true;
+ tsk_safeobj_init(p_gdi);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_video_gdi_dtor(tsk_object_t * self)
-{
- tdav_consumer_video_gdi_t *p_gdi = (tdav_consumer_video_gdi_t *)self;
- if (p_gdi) {
- /* stop */
- tdav_consumer_video_gdi_stop((tmedia_consumer_t*)self);
-
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(p_gdi));
- /* deinit self */
- TSK_FREE(p_gdi->pBuffer);
- tsk_safeobj_deinit(p_gdi);
- }
-
- return self;
+{
+ tdav_consumer_video_gdi_t *p_gdi = (tdav_consumer_video_gdi_t *)self;
+ if (p_gdi) {
+ /* stop */
+ tdav_consumer_video_gdi_stop((tmedia_consumer_t*)self);
+
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(p_gdi));
+ /* deinit self */
+ TSK_FREE(p_gdi->pBuffer);
+ tsk_safeobj_deinit(p_gdi);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_video_gdi_def_s =
-{
- sizeof(tdav_consumer_video_gdi_t),
- tdav_consumer_video_gdi_ctor,
- tdav_consumer_video_gdi_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_consumer_video_gdi_def_s = {
+ sizeof(tdav_consumer_video_gdi_t),
+ tdav_consumer_video_gdi_ctor,
+ tdav_consumer_video_gdi_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_video_gdi_plugin_def_s =
-{
- &tdav_consumer_video_gdi_def_s,
-
- tmedia_video,
- "Microsoft GDI consumer (using custom source)",
-
- tdav_consumer_video_gdi_set,
- tdav_consumer_video_gdi_prepare,
- tdav_consumer_video_gdi_start,
- tdav_consumer_video_gdi_consume,
- tdav_consumer_video_gdi_pause,
- tdav_consumer_video_gdi_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_video_gdi_plugin_def_s = {
+ &tdav_consumer_video_gdi_def_s,
+
+ tmedia_video,
+ "Microsoft GDI consumer (using custom source)",
+
+ tdav_consumer_video_gdi_set,
+ tdav_consumer_video_gdi_prepare,
+ tdav_consumer_video_gdi_start,
+ tdav_consumer_video_gdi_consume,
+ tdav_consumer_video_gdi_pause,
+ tdav_consumer_video_gdi_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_video_gdi_plugin_def_t = &tdav_consumer_video_gdi_plugin_def_s;
diff --git a/tinyDAV/src/video/gdi/tdav_producer_screencast_gdi.c b/tinyDAV/src/video/gdi/tdav_producer_screencast_gdi.c
index 799aafc..12ea4cd 100755
--- a/tinyDAV/src/video/gdi/tdav_producer_screencast_gdi.c
+++ b/tinyDAV/src/video/gdi/tdav_producer_screencast_gdi.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -47,30 +47,29 @@ static const BOOL bitmapBuffSrcOwnMemory = TRUE;
# define HIGH_PRIO_BITBLIT 0
#endif /* HIGH_PRIO_BITBLIT */
-typedef struct tdav_producer_screencast_gdi_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- HWND hwnd_preview;
- HWND hwnd_src;
+typedef struct tdav_producer_screencast_gdi_s {
+ TMEDIA_DECLARE_PRODUCER;
- BITMAPINFO bitmapInfoSrc;
- BITMAPINFO bitmapInfoNeg;
+ HWND hwnd_preview;
+ HWND hwnd_src;
- tsk_thread_handle_t* tid[1];
+ BITMAPINFO bitmapInfoSrc;
+ BITMAPINFO bitmapInfoNeg;
- void* p_buff_src; // must use VirtualAlloc()
- tsk_size_t n_buff_src;
- void* p_buff_neg; // must use VirtualAlloc()
- tsk_size_t n_buff_neg;
-
- tsk_bool_t b_started;
- tsk_bool_t b_paused;
- tsk_bool_t b_muted;
+ tsk_thread_handle_t* tid[1];
- RECT rcScreen;
+ void* p_buff_src; // must use VirtualAlloc()
+ tsk_size_t n_buff_src;
+ void* p_buff_neg; // must use VirtualAlloc()
+ tsk_size_t n_buff_neg;
- TSK_DECLARE_SAFEOBJ;
+ tsk_bool_t b_started;
+ tsk_bool_t b_paused;
+ tsk_bool_t b_muted;
+
+ RECT rcScreen;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_producer_screencast_gdi_t;
@@ -81,264 +80,268 @@ static int _tdav_producer_screencast_grab(tdav_producer_screencast_gdi_t* p_self
/* ============ Media Producer Interface ================= */
static int _tdav_producer_screencast_gdi_set(tmedia_producer_t *p_self, const tmedia_param_t* pc_param)
{
- int ret = 0;
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
-
- if (!p_gdi || !pc_param) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pc_param->value_type == tmedia_pvt_int64) {
- if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
- p_gdi->hwnd_preview = (HWND)*((int64_t*)pc_param->value);
- }
- else if (tsk_striequals(pc_param->key, "src-hwnd")) {
- p_gdi->hwnd_src = (HWND)*((int64_t*)pc_param->value);
- }
- }
- else if (pc_param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(pc_param->key, "mute")) {
- p_gdi->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
- }
- }
-
- return ret;
+ int ret = 0;
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
+
+ if (!p_gdi || !pc_param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pc_param->value_type == tmedia_pvt_int64) {
+ if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
+ p_gdi->hwnd_preview = (HWND)*((int64_t*)pc_param->value);
+ }
+ else if (tsk_striequals(pc_param->key, "src-hwnd")) {
+ p_gdi->hwnd_src = (HWND)*((int64_t*)pc_param->value);
+ }
+ }
+ else if (pc_param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(pc_param->key, "mute")) {
+ p_gdi->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
+ }
+ }
+
+ return ret;
}
static int _tdav_producer_screencast_gdi_prepare(tmedia_producer_t* p_self, const tmedia_codec_t* pc_codec)
{
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
- int ret = 0;
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
+ int ret = 0;
+
+ if (!p_gdi || !pc_codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_gdi || !pc_codec) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_safeobj_lock(p_gdi);
- tsk_safeobj_lock(p_gdi);
-
#if METROPOLIS /*= G2J.COM */
- TMEDIA_PRODUCER(p_gdi)->video.fps = TSK_MIN(TMEDIA_CODEC_VIDEO(pc_codec)->out.fps, kMaxFrameRate);
+ TMEDIA_PRODUCER(p_gdi)->video.fps = TSK_MIN(TMEDIA_CODEC_VIDEO(pc_codec)->out.fps, kMaxFrameRate);
#else
- TMEDIA_PRODUCER(p_gdi)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
+ TMEDIA_PRODUCER(p_gdi)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
#endif
- TMEDIA_PRODUCER(p_gdi)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
- TMEDIA_PRODUCER(p_gdi)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
-
- TSK_DEBUG_INFO("[GDI screencast] fps:%d, width:%d; height:%d", TMEDIA_PRODUCER(p_gdi)->video.fps, TMEDIA_PRODUCER(p_gdi)->video.width, TMEDIA_PRODUCER(p_gdi)->video.height);
-
- p_gdi->bitmapInfoNeg.bmiHeader.biSize = p_gdi->bitmapInfoSrc.bmiHeader.biSize = (DWORD)sizeof(BITMAPINFOHEADER);
- p_gdi->bitmapInfoNeg.bmiHeader.biWidth = p_gdi->bitmapInfoSrc.bmiHeader.biWidth = (LONG)TMEDIA_PRODUCER(p_gdi)->video.width;
- p_gdi->bitmapInfoNeg.bmiHeader.biHeight = p_gdi->bitmapInfoSrc.bmiHeader.biHeight = (LONG)TMEDIA_PRODUCER(p_gdi)->video.height;
- p_gdi->bitmapInfoNeg.bmiHeader.biPlanes = p_gdi->bitmapInfoSrc.bmiHeader.biPlanes = 1;
- p_gdi->bitmapInfoNeg.bmiHeader.biBitCount = p_gdi->bitmapInfoSrc.bmiHeader.biBitCount = 24;
- p_gdi->bitmapInfoNeg.bmiHeader.biCompression = p_gdi->bitmapInfoSrc.bmiHeader.biCompression = BI_RGB;
- p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage = (p_gdi->bitmapInfoNeg.bmiHeader.biWidth * p_gdi->bitmapInfoNeg.bmiHeader.biHeight * (p_gdi->bitmapInfoNeg.bmiHeader.biBitCount >> 3));
-
- if (p_gdi->n_buff_neg < p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage) {
- if (p_gdi->p_buff_neg) VirtualFree(p_gdi->p_buff_neg, 0, MEM_RELEASE);
- if (!(p_gdi->p_buff_neg = VirtualAlloc(NULL, p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE))) {
- p_gdi->n_buff_neg = 0;
- ret = -3;
- goto bail;
- }
- p_gdi->n_buff_neg = p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage;
- }
-
- /* Get screen size */ {
- HDC hDC;
- hDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
- if (!hDC) {
- TSK_DEBUG_ERROR("CreateDC failed");
- ret = -4;
- goto bail;
- }
-
- // Get the dimensions of the main desktop window
- p_gdi->rcScreen.left = p_gdi->rcScreen.top = 0;
- p_gdi->rcScreen.right = GetDeviceCaps(hDC, HORZRES);
- p_gdi->rcScreen.bottom = GetDeviceCaps(hDC, VERTRES);
-
- // Release the device context
- DeleteDC(hDC);
- }
-
+ TMEDIA_PRODUCER(p_gdi)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
+ TMEDIA_PRODUCER(p_gdi)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
+
+ TSK_DEBUG_INFO("[GDI screencast] fps:%d, width:%d; height:%d", TMEDIA_PRODUCER(p_gdi)->video.fps, TMEDIA_PRODUCER(p_gdi)->video.width, TMEDIA_PRODUCER(p_gdi)->video.height);
+
+ p_gdi->bitmapInfoNeg.bmiHeader.biSize = p_gdi->bitmapInfoSrc.bmiHeader.biSize = (DWORD)sizeof(BITMAPINFOHEADER);
+ p_gdi->bitmapInfoNeg.bmiHeader.biWidth = p_gdi->bitmapInfoSrc.bmiHeader.biWidth = (LONG)TMEDIA_PRODUCER(p_gdi)->video.width;
+ p_gdi->bitmapInfoNeg.bmiHeader.biHeight = p_gdi->bitmapInfoSrc.bmiHeader.biHeight = (LONG)TMEDIA_PRODUCER(p_gdi)->video.height;
+ p_gdi->bitmapInfoNeg.bmiHeader.biPlanes = p_gdi->bitmapInfoSrc.bmiHeader.biPlanes = 1;
+ p_gdi->bitmapInfoNeg.bmiHeader.biBitCount = p_gdi->bitmapInfoSrc.bmiHeader.biBitCount = 24;
+ p_gdi->bitmapInfoNeg.bmiHeader.biCompression = p_gdi->bitmapInfoSrc.bmiHeader.biCompression = BI_RGB;
+ p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage = (p_gdi->bitmapInfoNeg.bmiHeader.biWidth * p_gdi->bitmapInfoNeg.bmiHeader.biHeight * (p_gdi->bitmapInfoNeg.bmiHeader.biBitCount >> 3));
+
+ if (p_gdi->n_buff_neg < p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage) {
+ if (p_gdi->p_buff_neg) {
+ VirtualFree(p_gdi->p_buff_neg, 0, MEM_RELEASE);
+ }
+ if (!(p_gdi->p_buff_neg = VirtualAlloc(NULL, p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE))) {
+ p_gdi->n_buff_neg = 0;
+ ret = -3;
+ goto bail;
+ }
+ p_gdi->n_buff_neg = p_gdi->bitmapInfoNeg.bmiHeader.biSizeImage;
+ }
+
+ /* Get screen size */ {
+ HDC hDC;
+ hDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
+ if (!hDC) {
+ TSK_DEBUG_ERROR("CreateDC failed");
+ ret = -4;
+ goto bail;
+ }
+
+ // Get the dimensions of the main desktop window
+ p_gdi->rcScreen.left = p_gdi->rcScreen.top = 0;
+ p_gdi->rcScreen.right = GetDeviceCaps(hDC, HORZRES);
+ p_gdi->rcScreen.bottom = GetDeviceCaps(hDC, VERTRES);
+
+ // Release the device context
+ DeleteDC(hDC);
+ }
+
bail:
- tsk_safeobj_unlock(p_gdi);
- return ret;
+ tsk_safeobj_unlock(p_gdi);
+ return ret;
}
static int _tdav_producer_screencast_gdi_start(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
- int ret = 0;
-
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_gdi);
-
- p_gdi->b_paused = tsk_false;
-
- if (p_gdi->b_started) {
- TSK_DEBUG_INFO("GDI screencast producer already started");
- goto bail;
- }
-
- p_gdi->b_started = tsk_true;
-
- tsk_thread_create(&p_gdi->tid[0], _tdav_producer_screencast_record_thread, p_gdi);
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
+ int ret = 0;
+
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_gdi);
+
+ p_gdi->b_paused = tsk_false;
+
+ if (p_gdi->b_started) {
+ TSK_DEBUG_INFO("GDI screencast producer already started");
+ goto bail;
+ }
+
+ p_gdi->b_started = tsk_true;
+
+ tsk_thread_create(&p_gdi->tid[0], _tdav_producer_screencast_record_thread, p_gdi);
#if HIGH_PRIO_BITBLIT
- if (p_gdi->tid[0]) {
- tsk_thread_set_priority(p_gdi->tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
- }
+ if (p_gdi->tid[0]) {
+ tsk_thread_set_priority(p_gdi->tid[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
+ }
#endif
bail:
- if (ret) {
- p_gdi->b_started = tsk_false;
- }
- tsk_safeobj_unlock(p_gdi);
+ if (ret) {
+ p_gdi->b_started = tsk_false;
+ }
+ tsk_safeobj_unlock(p_gdi);
- return ret;
+ return ret;
}
static int _tdav_producer_screencast_gdi_pause(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_gdi);
+ tsk_safeobj_lock(p_gdi);
- p_gdi->b_paused = tsk_true;
- goto bail;
+ p_gdi->b_paused = tsk_true;
+ goto bail;
bail:
- tsk_safeobj_unlock(p_gdi);
+ tsk_safeobj_unlock(p_gdi);
- return 0;
+ return 0;
}
static int _tdav_producer_screencast_gdi_stop(tmedia_producer_t* p_self)
{
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
-
- if (!p_gdi) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_gdi);
-
- if (!p_gdi->b_started) {
- TSK_DEBUG_INFO("GDI screencast producer already stopped");
- goto bail;
- }
-
- p_gdi->b_started = tsk_false;
- p_gdi->b_paused = tsk_false;
-
- // stop thread
- if (p_gdi->tid[0]) {
- tsk_thread_join(&(p_gdi->tid[0]));
- }
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)p_self;
+
+ if (!p_gdi) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_gdi);
+
+ if (!p_gdi->b_started) {
+ TSK_DEBUG_INFO("GDI screencast producer already stopped");
+ goto bail;
+ }
+
+ p_gdi->b_started = tsk_false;
+ p_gdi->b_paused = tsk_false;
+
+ // stop thread
+ if (p_gdi->tid[0]) {
+ tsk_thread_join(&(p_gdi->tid[0]));
+ }
bail:
- tsk_safeobj_unlock(p_gdi);
+ tsk_safeobj_unlock(p_gdi);
- return 0;
+ return 0;
}
static int _tdav_producer_screencast_grab(tdav_producer_screencast_gdi_t* p_self)
{
- int ret = 0;
- HDC hSrcDC = NULL, hMemDC = NULL;
- HBITMAP hBitmap, hOldBitmap;
- int nWidth, nHeight;
- RECT rcSrc;
-
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- //--tsk_safeobj_lock(p_self);
-
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("producer not started yet");
- ret = -2;
- goto bail;
- }
-
- if (!TMEDIA_PRODUCER(p_self)->enc_cb.callback) {
- goto bail;
- }
-
- hSrcDC = GetDC(p_self->hwnd_src);
- if (!hSrcDC) {
- TSK_DEBUG_ERROR("GetDC(%x) failed", (int64_t)p_self->hwnd_src);
- ret = -5;
- goto bail;
- }
+ int ret = 0;
+ HDC hSrcDC = NULL, hMemDC = NULL;
+ HBITMAP hBitmap, hOldBitmap;
+ int nWidth, nHeight;
+ RECT rcSrc;
+
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ //--tsk_safeobj_lock(p_self);
+
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("producer not started yet");
+ ret = -2;
+ goto bail;
+ }
+
+ if (!TMEDIA_PRODUCER(p_self)->enc_cb.callback) {
+ goto bail;
+ }
+
+ hSrcDC = GetDC(p_self->hwnd_src);
+ if (!hSrcDC) {
+ TSK_DEBUG_ERROR("GetDC(%x) failed", (int64_t)p_self->hwnd_src);
+ ret = -5;
+ goto bail;
+ }
hMemDC = CreateCompatibleDC(hSrcDC);
- if (!hMemDC) {
- TSK_DEBUG_ERROR("CreateCompatibleDC(%x) failed", (int64_t)hSrcDC);
- ret = -6;
- goto bail;
- }
-
- // get points of rectangle to grab
- if (p_self->hwnd_src) {
- GetWindowRect(p_self->hwnd_src, &rcSrc);
- }
- else {
- rcSrc.left = rcSrc.top = 0;
- rcSrc.right = GetDeviceCaps(hSrcDC, HORZRES);
- rcSrc.bottom = GetDeviceCaps(hSrcDC, VERTRES);
- }
+ if (!hMemDC) {
+ TSK_DEBUG_ERROR("CreateCompatibleDC(%x) failed", (int64_t)hSrcDC);
+ ret = -6;
+ goto bail;
+ }
+
+ // get points of rectangle to grab
+ if (p_self->hwnd_src) {
+ GetWindowRect(p_self->hwnd_src, &rcSrc);
+ }
+ else {
+ rcSrc.left = rcSrc.top = 0;
+ rcSrc.right = GetDeviceCaps(hSrcDC, HORZRES);
+ rcSrc.bottom = GetDeviceCaps(hSrcDC, VERTRES);
+ }
nWidth = rcSrc.right - rcSrc.left;
- nHeight = rcSrc.bottom - rcSrc.top;
+ nHeight = rcSrc.bottom - rcSrc.top;
- p_self->bitmapInfoSrc.bmiHeader.biWidth = nWidth;
- p_self->bitmapInfoSrc.bmiHeader.biHeight = nHeight;
- p_self->bitmapInfoSrc.bmiHeader.biSizeImage = nWidth * nHeight * (p_self->bitmapInfoSrc.bmiHeader.biBitCount >> 3);
+ p_self->bitmapInfoSrc.bmiHeader.biWidth = nWidth;
+ p_self->bitmapInfoSrc.bmiHeader.biHeight = nHeight;
+ p_self->bitmapInfoSrc.bmiHeader.biSizeImage = nWidth * nHeight * (p_self->bitmapInfoSrc.bmiHeader.biBitCount >> 3);
- // create a bitmap compatible with the screen DC
+ // create a bitmap compatible with the screen DC
#if TDAV_UNDER_WINDOWS_CE
- {
- void* pvBits = NULL;
- hBitmap = CreateDIBSection(hSrcDC, &p_self->bitmapInfoSrc, DIB_RGB_COLORS, &pvBits, NULL, 0);
- if (!hBitmap || !pvBits) {
- TSK_DEBUG_ERROR("Failed to create bitmap(%dx%d)", nWidth, nHeight);
- goto bail;
- }
- p_self->p_buff_src = pvBits;
- p_self->n_buff_src = p_self->bitmapInfoSrc.bmiHeader.biSizeImage;
- }
+ {
+ void* pvBits = NULL;
+ hBitmap = CreateDIBSection(hSrcDC, &p_self->bitmapInfoSrc, DIB_RGB_COLORS, &pvBits, NULL, 0);
+ if (!hBitmap || !pvBits) {
+ TSK_DEBUG_ERROR("Failed to create bitmap(%dx%d)", nWidth, nHeight);
+ goto bail;
+ }
+ p_self->p_buff_src = pvBits;
+ p_self->n_buff_src = p_self->bitmapInfoSrc.bmiHeader.biSizeImage;
+ }
#else
hBitmap = CreateCompatibleBitmap(hSrcDC, nWidth, nHeight);
- if (!hBitmap) {
- TSK_DEBUG_ERROR("Failed to create bitmap(%dx%d)", nWidth, nHeight);
- goto bail;
- }
-
- if (p_self->n_buff_src < p_self->bitmapInfoSrc.bmiHeader.biSizeImage) {
- if (p_self->p_buff_src) VirtualFree(p_self->p_buff_src, 0, MEM_RELEASE);
- if (!(p_self->p_buff_src = VirtualAlloc(NULL, p_self->bitmapInfoSrc.bmiHeader.biSizeImage, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE))) {
- p_self->n_buff_src = 0;
- ret = -3;
- goto bail;
- }
- p_self->n_buff_src = p_self->bitmapInfoSrc.bmiHeader.biSizeImage;
- }
+ if (!hBitmap) {
+ TSK_DEBUG_ERROR("Failed to create bitmap(%dx%d)", nWidth, nHeight);
+ goto bail;
+ }
+
+ if (p_self->n_buff_src < p_self->bitmapInfoSrc.bmiHeader.biSizeImage) {
+ if (p_self->p_buff_src) {
+ VirtualFree(p_self->p_buff_src, 0, MEM_RELEASE);
+ }
+ if (!(p_self->p_buff_src = VirtualAlloc(NULL, p_self->bitmapInfoSrc.bmiHeader.biSizeImage, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE))) {
+ p_self->n_buff_src = 0;
+ ret = -3;
+ goto bail;
+ }
+ p_self->n_buff_src = p_self->bitmapInfoSrc.bmiHeader.biSizeImage;
+ }
#endif /* TDAV_UNDER_WINDOWS_CE */
// select new bitmap into memory DC
@@ -348,114 +351,114 @@ static int _tdav_producer_screencast_grab(tdav_producer_screencast_gdi_t* p_self
BitBlt(hMemDC, 0, 0, nWidth, nHeight, hSrcDC, 0, 0, SRCCOPY);
// select old bitmap back into memory DC and get handle to
- // bitmap of the screen
+ // bitmap of the screen
hBitmap = (HBITMAP) SelectObject(hMemDC, hOldBitmap);
- // Copy the bitmap data into the provided BYTE buffer
+ // Copy the bitmap data into the provided BYTE buffer
#if TDAV_UNDER_WINDOWS_CE
- // memory already retrieved using "CreateDIBSection"
+ // memory already retrieved using "CreateDIBSection"
#else
GetDIBits(hSrcDC, hBitmap, 0, nHeight, p_self->p_buff_src, &p_self->bitmapInfoSrc, DIB_RGB_COLORS);
#endif
-
- // resize
- ResizeRGB(&p_self->bitmapInfoSrc.bmiHeader,
- (const unsigned char *) p_self->p_buff_src,
- &p_self->bitmapInfoNeg.bmiHeader,
- (unsigned char *) p_self->p_buff_neg,
- p_self->bitmapInfoNeg.bmiHeader.biWidth,
- p_self->bitmapInfoNeg.bmiHeader.biHeight);
-
- // preview
- if (p_self->hwnd_preview) {
- HDC hDC = GetDC(p_self->hwnd_preview);
- if (hDC) {
- RECT rcPreview = {0};
- if (GetWindowRect(p_self->hwnd_preview, &rcPreview)) {
- LONG nPreviewWidth = (rcPreview.right - rcPreview.left);
- LONG nPreviewHeight = (rcPreview.bottom - rcPreview.top);
-
- SetStretchBltMode(hDC, COLORONCOLOR);
+
+ // resize
+ ResizeRGB(&p_self->bitmapInfoSrc.bmiHeader,
+ (const unsigned char *) p_self->p_buff_src,
+ &p_self->bitmapInfoNeg.bmiHeader,
+ (unsigned char *) p_self->p_buff_neg,
+ p_self->bitmapInfoNeg.bmiHeader.biWidth,
+ p_self->bitmapInfoNeg.bmiHeader.biHeight);
+
+ // preview
+ if (p_self->hwnd_preview) {
+ HDC hDC = GetDC(p_self->hwnd_preview);
+ if (hDC) {
+ RECT rcPreview = {0};
+ if (GetWindowRect(p_self->hwnd_preview, &rcPreview)) {
+ LONG nPreviewWidth = (rcPreview.right - rcPreview.left);
+ LONG nPreviewHeight = (rcPreview.bottom - rcPreview.top);
+
+ SetStretchBltMode(hDC, COLORONCOLOR);
#if 0 // preview(neg)
- StretchDIBits(
- hDC,
- 0, 0, nPreviewWidth, nPreviewHeight,
- 0, 0, p_self->bitmapInfoNeg.bmiHeader.biWidth, p_self->bitmapInfoNeg.bmiHeader.biHeight,
- p_self->p_buff_neg,
- &p_self->bitmapInfoNeg,
- DIB_RGB_COLORS,
- SRCCOPY);
+ StretchDIBits(
+ hDC,
+ 0, 0, nPreviewWidth, nPreviewHeight,
+ 0, 0, p_self->bitmapInfoNeg.bmiHeader.biWidth, p_self->bitmapInfoNeg.bmiHeader.biHeight,
+ p_self->p_buff_neg,
+ &p_self->bitmapInfoNeg,
+ DIB_RGB_COLORS,
+ SRCCOPY);
#else // preview(src)
- StretchDIBits(
- hDC,
- 0, 0, nPreviewWidth, nPreviewHeight,
- 0, 0, p_self->bitmapInfoSrc.bmiHeader.biWidth, p_self->bitmapInfoSrc.bmiHeader.biHeight,
- p_self->p_buff_src,
- &p_self->bitmapInfoSrc,
- DIB_RGB_COLORS,
- SRCCOPY);
-#endif
- }
- ReleaseDC(p_self->hwnd_preview, hDC);
- }
- }
-
- // encode and send data
- TMEDIA_PRODUCER(p_self)->enc_cb.callback(TMEDIA_PRODUCER(p_self)->enc_cb.callback_data, p_self->p_buff_neg, p_self->bitmapInfoNeg.bmiHeader.biSizeImage);
+ StretchDIBits(
+ hDC,
+ 0, 0, nPreviewWidth, nPreviewHeight,
+ 0, 0, p_self->bitmapInfoSrc.bmiHeader.biWidth, p_self->bitmapInfoSrc.bmiHeader.biHeight,
+ p_self->p_buff_src,
+ &p_self->bitmapInfoSrc,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+#endif
+ }
+ ReleaseDC(p_self->hwnd_preview, hDC);
+ }
+ }
+
+ // encode and send data
+ TMEDIA_PRODUCER(p_self)->enc_cb.callback(TMEDIA_PRODUCER(p_self)->enc_cb.callback_data, p_self->p_buff_neg, p_self->bitmapInfoNeg.bmiHeader.biSizeImage);
bail:
- //--tsk_safeobj_unlock(p_self);
-
- if (hSrcDC) {
- ReleaseDC(p_self->hwnd_src, hSrcDC);
- }
- if (hMemDC) {
- DeleteDC(hMemDC);
- }
-
- if (hBitmap) {
+ //--tsk_safeobj_unlock(p_self);
+
+ if (hSrcDC) {
+ ReleaseDC(p_self->hwnd_src, hSrcDC);
+ }
+ if (hMemDC) {
+ DeleteDC(hMemDC);
+ }
+
+ if (hBitmap) {
DeleteObject(hBitmap);
- if (!bitmapBuffSrcOwnMemory) {
- p_self->p_buff_src = NULL;
- p_self->n_buff_src = 0;
- }
- }
+ if (!bitmapBuffSrcOwnMemory) {
+ p_self->p_buff_src = NULL;
+ p_self->n_buff_src = 0;
+ }
+ }
- return ret;
+ return ret;
}
static void* TSK_STDCALL _tdav_producer_screencast_record_thread(void *arg)
{
- tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)arg;
- int ret = 0;
-
- // FPS manager
- uint64_t TimeNow, TimeLastFrame = 0;
- const uint64_t TimeFrameDuration = (1000 / TMEDIA_PRODUCER(p_gdi)->video.fps);
-
- TSK_DEBUG_INFO("_tdav_producer_screencast_record_thread -- START");
-
- while (ret == 0 && p_gdi->b_started) {
- TimeNow = tsk_time_now();
- if ((TimeNow - TimeLastFrame) >= TimeFrameDuration) {
- if (!p_gdi->b_muted && !p_gdi->b_paused) {
- if (ret = _tdav_producer_screencast_grab(p_gdi)) {
- goto next;
- }
- }
- TimeLastFrame = TimeNow;
- }
- else {
- tsk_thread_sleep(1);
+ tdav_producer_screencast_gdi_t* p_gdi = (tdav_producer_screencast_gdi_t*)arg;
+ int ret = 0;
+
+ // FPS manager
+ uint64_t TimeNow, TimeLastFrame = 0;
+ const uint64_t TimeFrameDuration = (1000 / TMEDIA_PRODUCER(p_gdi)->video.fps);
+
+ TSK_DEBUG_INFO("_tdav_producer_screencast_record_thread -- START");
+
+ while (ret == 0 && p_gdi->b_started) {
+ TimeNow = tsk_time_now();
+ if ((TimeNow - TimeLastFrame) >= TimeFrameDuration) {
+ if (!p_gdi->b_muted && !p_gdi->b_paused) {
+ if (ret = _tdav_producer_screencast_grab(p_gdi)) {
+ goto next;
+ }
+ }
+ TimeLastFrame = TimeNow;
+ }
+ else {
+ tsk_thread_sleep(1);
#if 0
- TSK_DEBUG_INFO("[GDI screencast] Skip frame");
+ TSK_DEBUG_INFO("[GDI screencast] Skip frame");
#endif
- }
- next:
- ;
- }
- TSK_DEBUG_INFO("_tdav_producer_screencast_record_thread -- STOP");
- return tsk_null;
+ }
+next:
+ ;
+ }
+ TSK_DEBUG_INFO("_tdav_producer_screencast_record_thread -- STOP");
+ return tsk_null;
}
//
@@ -464,70 +467,68 @@ static void* TSK_STDCALL _tdav_producer_screencast_record_thread(void *arg)
/* constructor */
static tsk_object_t* _tdav_producer_screencast_gdi_ctor(tsk_object_t *self, va_list * app)
{
- tdav_producer_screencast_gdi_t *p_gdi = (tdav_producer_screencast_gdi_t *)self;
- if (p_gdi) {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(p_gdi));
- TMEDIA_PRODUCER(p_gdi)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
- /* init self with default values*/
- TMEDIA_PRODUCER(p_gdi)->video.fps = 15;
- TMEDIA_PRODUCER(p_gdi)->video.width = 352;
- TMEDIA_PRODUCER(p_gdi)->video.height = 288;
-
- tsk_safeobj_init(p_gdi);
- }
- return self;
+ tdav_producer_screencast_gdi_t *p_gdi = (tdav_producer_screencast_gdi_t *)self;
+ if (p_gdi) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(p_gdi));
+ TMEDIA_PRODUCER(p_gdi)->video.chroma = tmedia_chroma_bgr24; // RGB24 on x86 (little endians) stored as BGR24
+ /* init self with default values*/
+ TMEDIA_PRODUCER(p_gdi)->video.fps = 15;
+ TMEDIA_PRODUCER(p_gdi)->video.width = 352;
+ TMEDIA_PRODUCER(p_gdi)->video.height = 288;
+
+ tsk_safeobj_init(p_gdi);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* _tdav_producer_screencast_gdi_dtor(tsk_object_t * self)
-{
- tdav_producer_screencast_gdi_t *p_gdi = (tdav_producer_screencast_gdi_t *)self;
- if (p_gdi) {
- /* stop */
- if (p_gdi->b_started) {
- _tdav_producer_screencast_gdi_stop((tmedia_producer_t*)p_gdi);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(p_gdi));
- /* deinit self */
- if (p_gdi->p_buff_neg) {
- VirtualFree(p_gdi->p_buff_neg, 0, MEM_RELEASE);
- p_gdi->p_buff_neg = NULL;
- }
- if (p_gdi->p_buff_src) {
- if (bitmapBuffSrcOwnMemory) {
- VirtualFree(p_gdi->p_buff_src, 0, MEM_RELEASE);
- }
- p_gdi->p_buff_src = NULL;
- }
- tsk_safeobj_deinit(p_gdi);
-
- TSK_DEBUG_INFO("*** GDI Screencast producer destroyed ***");
- }
-
- return self;
+{
+ tdav_producer_screencast_gdi_t *p_gdi = (tdav_producer_screencast_gdi_t *)self;
+ if (p_gdi) {
+ /* stop */
+ if (p_gdi->b_started) {
+ _tdav_producer_screencast_gdi_stop((tmedia_producer_t*)p_gdi);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(p_gdi));
+ /* deinit self */
+ if (p_gdi->p_buff_neg) {
+ VirtualFree(p_gdi->p_buff_neg, 0, MEM_RELEASE);
+ p_gdi->p_buff_neg = NULL;
+ }
+ if (p_gdi->p_buff_src) {
+ if (bitmapBuffSrcOwnMemory) {
+ VirtualFree(p_gdi->p_buff_src, 0, MEM_RELEASE);
+ }
+ p_gdi->p_buff_src = NULL;
+ }
+ tsk_safeobj_deinit(p_gdi);
+
+ TSK_DEBUG_INFO("*** GDI Screencast producer destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_screencast_gdi_def_s =
-{
- sizeof(tdav_producer_screencast_gdi_t),
- _tdav_producer_screencast_gdi_ctor,
- _tdav_producer_screencast_gdi_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_screencast_gdi_def_s = {
+ sizeof(tdav_producer_screencast_gdi_t),
+ _tdav_producer_screencast_gdi_ctor,
+ _tdav_producer_screencast_gdi_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_screencast_gdi_plugin_def_s =
-{
- &tdav_producer_screencast_gdi_def_s,
- tmedia_bfcp_video,
- "Microsoft GDI screencast producer",
-
- _tdav_producer_screencast_gdi_set,
- _tdav_producer_screencast_gdi_prepare,
- _tdav_producer_screencast_gdi_start,
- _tdav_producer_screencast_gdi_pause,
- _tdav_producer_screencast_gdi_stop
+static const tmedia_producer_plugin_def_t tdav_producer_screencast_gdi_plugin_def_s = {
+ &tdav_producer_screencast_gdi_def_s,
+ tmedia_bfcp_video,
+ "Microsoft GDI screencast producer",
+
+ _tdav_producer_screencast_gdi_set,
+ _tdav_producer_screencast_gdi_prepare,
+ _tdav_producer_screencast_gdi_start,
+ _tdav_producer_screencast_gdi_pause,
+ _tdav_producer_screencast_gdi_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_screencast_gdi_plugin_def_t = &tdav_producer_screencast_gdi_plugin_def_s;
diff --git a/tinyDAV/src/video/jb/tdav_video_frame.c b/tinyDAV/src/video/jb/tdav_video_frame.c
index fc7cbc3..2abab76 100755
--- a/tinyDAV/src/video/jb/tdav_video_frame.c
+++ b/tinyDAV/src/video/jb/tdav_video_frame.c
@@ -36,8 +36,8 @@
static tsk_object_t* tdav_video_frame_ctor(tsk_object_t * self, va_list * app)
{
tdav_video_frame_t *frame = self;
- if(frame){
- if(!(frame->pkts = tsk_list_create())){
+ if(frame) {
+ if(!(frame->pkts = tsk_list_create())) {
TSK_DEBUG_ERROR("Faile to list");
return tsk_null;
}
@@ -48,27 +48,30 @@ static tsk_object_t* tdav_video_frame_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tdav_video_frame_dtor(tsk_object_t * self)
{
tdav_video_frame_t *frame = self;
- if(frame){
+ if(frame) {
TSK_OBJECT_SAFE_FREE(frame->pkts);
-
+
tsk_safeobj_deinit(frame);
}
-
+
return self;
}
static int tdav_video_frame_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
{
const tdav_video_frame_t *p1 = _p1;
const tdav_video_frame_t *p2 = _p2;
-
- if(p1 && p2){
+
+ if(p1 && p2) {
return (int)(p1->timestamp - p2->timestamp);
}
- else if(!p1 && !p2) return 0;
- else return -1;
+ else if(!p1 && !p2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tdav_video_frame_def_s =
-{
+static const tsk_object_def_t tdav_video_frame_def_s = {
sizeof(tdav_video_frame_t),
tdav_video_frame_ctor,
tdav_video_frame_dtor,
@@ -80,12 +83,12 @@ const tsk_object_def_t *tdav_video_frame_def_t = &tdav_video_frame_def_s;
tdav_video_frame_t* tdav_video_frame_create(trtp_rtp_packet_t* rtp_pkt)
{
tdav_video_frame_t* frame;
- if(!rtp_pkt || !rtp_pkt->header){
+ if(!rtp_pkt || !rtp_pkt->header) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- if((frame = tsk_object_new(tdav_video_frame_def_t))){
+
+ if((frame = tsk_object_new(tdav_video_frame_def_t))) {
rtp_pkt = tsk_object_ref(rtp_pkt);
frame->payload_type = rtp_pkt->header->payload_type;
frame->timestamp = rtp_pkt->header->timestamp;
@@ -98,25 +101,25 @@ tdav_video_frame_t* tdav_video_frame_create(trtp_rtp_packet_t* rtp_pkt)
int tdav_video_frame_put(tdav_video_frame_t* self, trtp_rtp_packet_t* rtp_pkt)
{
- if(!self || !rtp_pkt || !rtp_pkt->header){
+ if(!self || !rtp_pkt || !rtp_pkt->header) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(self->timestamp != rtp_pkt->header->timestamp){
+ if(self->timestamp != rtp_pkt->header->timestamp) {
TSK_DEBUG_ERROR("Timestamp mismatch");
return -2;
}
- if(self->payload_type != rtp_pkt->header->payload_type){
+ if(self->payload_type != rtp_pkt->header->payload_type) {
TSK_DEBUG_ERROR("Payload Type mismatch");
return -2;
}
#if 0
- if(self->ssrc != rtp_pkt->header->ssrc){
+ if(self->ssrc != rtp_pkt->header->ssrc) {
TSK_DEBUG_ERROR("SSRC mismatch");
return -2;
}
#endif
-
+
rtp_pkt = tsk_object_ref(rtp_pkt);
self->highest_seq_num = TSK_MAX(self->highest_seq_num, rtp_pkt->header->seq_num);
tsk_list_lock(self->pkts);
@@ -127,7 +130,7 @@ int tdav_video_frame_put(tdav_video_frame_t* self, trtp_rtp_packet_t* rtp_pkt)
tsk_list_push_ascending_data(self->pkts, (void**)&rtp_pkt);
}
tsk_list_unlock(self->pkts);
-
+
return 0;
}
@@ -136,26 +139,26 @@ const trtp_rtp_packet_t* tdav_video_frame_find_by_seq_num(const tdav_video_frame
const tsk_list_item_t *item;
const trtp_rtp_packet_t* pkt;
const trtp_rtp_packet_t* ret;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
ret = tsk_null;
-
+
tsk_list_lock(self->pkts);
- tsk_list_foreach(item, self->pkts){
- if(!(pkt = item->data) || !pkt->header){
+ tsk_list_foreach(item, self->pkts) {
+ if(!(pkt = item->data) || !pkt->header) {
continue;
}
- if(pkt->header->seq_num == seq_num){
+ if(pkt->header->seq_num == seq_num) {
ret = pkt;
break;
}
}
tsk_list_unlock(self->pkts);
-
+
return ret;
}
@@ -168,19 +171,19 @@ tsk_size_t tdav_video_frame_write(struct tdav_video_frame_s* self, void** buffer
const trtp_rtp_packet_t* pkt;
tsk_size_t ret_size = 0;
int32_t last_seq_num = -1; // guard against duplicated packets
-
- if(!self || !buffer_ptr || !buffer_size){
+
+ if(!self || !buffer_ptr || !buffer_size) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
-
+
tsk_list_lock(self->pkts);
- tsk_list_foreach(item, self->pkts){
- if(!(pkt = item->data) || !pkt->payload.size || !pkt->header || pkt->header->seq_num == last_seq_num){
+ tsk_list_foreach(item, self->pkts) {
+ if(!(pkt = item->data) || !pkt->payload.size || !pkt->header || pkt->header->seq_num == last_seq_num) {
continue;
}
- if((ret_size + pkt->payload.size) > *buffer_size){
- if(!(*buffer_ptr = tsk_realloc(*buffer_ptr, (ret_size + pkt->payload.size)))){
+ if((ret_size + pkt->payload.size) > *buffer_size) {
+ if(!(*buffer_ptr = tsk_realloc(*buffer_ptr, (ret_size + pkt->payload.size)))) {
TSK_DEBUG_ERROR("Failed to resize the buffer");
*buffer_size = 0;
goto bail;
@@ -191,10 +194,10 @@ tsk_size_t tdav_video_frame_write(struct tdav_video_frame_s* self, void** buffer
ret_size += pkt->payload.size;
last_seq_num = pkt->header->seq_num;
}
-
+
bail:
tsk_list_unlock(self->pkts);
-
+
return ret_size;
}
@@ -213,31 +216,39 @@ tsk_bool_t tdav_video_frame_is_complete(const tdav_video_frame_t* self, int32_t
const tsk_list_item_t *item;
uint16_t i;
tsk_bool_t is_complete = tsk_false;
-
- if (!self){
+
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_false;
}
-
+
i = 0;
tsk_list_lock(self->pkts);
tsk_list_foreach (item, self->pkts) {
- if (!(pkt = item->data)){
+ if (!(pkt = item->data)) {
continue;
}
if (last_seq_num_with_mark >= 0 && pkt->header->seq_num != (last_seq_num_with_mark + ++i)) {
- if (missing_seq_num_start) *missing_seq_num_start = (last_seq_num_with_mark + i);
- if (missing_seq_num_count) *missing_seq_num_count = pkt->header->seq_num - (*missing_seq_num_start);
+ if (missing_seq_num_start) {
+ *missing_seq_num_start = (last_seq_num_with_mark + i);
+ }
+ if (missing_seq_num_count) {
+ *missing_seq_num_count = pkt->header->seq_num - (*missing_seq_num_start);
+ }
break;
}
if (item == self->pkts->tail) {
- if(!(is_complete = (pkt->header->marker))){
- if (missing_seq_num_start) *missing_seq_num_start = (pkt->header->seq_num + 1);
- if (missing_seq_num_count) *missing_seq_num_count = 1;
+ if(!(is_complete = (pkt->header->marker))) {
+ if (missing_seq_num_start) {
+ *missing_seq_num_start = (pkt->header->seq_num + 1);
+ }
+ if (missing_seq_num_count) {
+ *missing_seq_num_count = 1;
+ }
}
}
}
tsk_list_unlock(self->pkts);
-
+
return is_complete;
}
diff --git a/tinyDAV/src/video/jb/tdav_video_jb.c b/tinyDAV/src/video/jb/tdav_video_jb.c
index ec9b53b..ae24a2a 100755
--- a/tinyDAV/src/video/jb/tdav_video_jb.c
+++ b/tinyDAV/src/video/jb/tdav_video_jb.c
@@ -65,10 +65,9 @@ static int _tdav_video_jb_set_defaults(struct tdav_video_jb_s* self);
static const tdav_video_frame_t* _tdav_video_jb_get_frame(struct tdav_video_jb_s* self, uint32_t timestamp, uint8_t pt, tsk_bool_t *pt_matched);
static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg);
-typedef struct tdav_video_jb_s
-{
+typedef struct tdav_video_jb_s {
TSK_DECLARE_OBJECT;
-
+
tsk_bool_t started;
int32_t fps;
int32_t fps_prob;
@@ -79,30 +78,30 @@ typedef struct tdav_video_jb_s
int32_t tail_max;
tdav_video_frames_L_t *frames;
int64_t frames_count;
-
+
tsk_size_t latency_min;
tsk_size_t latency_max;
-
+
uint32_t decode_last_timestamp;
int32_t decode_last_seq_num_with_mark; // -1 = unset
uint64_t decode_last_time;
tsk_thread_handle_t* decode_thread[1];
tsk_condwait_handle_t* decode_thread_cond;
-
+
uint16_t seq_nums[0xFF];
tdav_video_jb_cb_f callback;
const void* callback_data;
-
+
// to avoid locking use different cb_data
tdav_video_jb_cb_data_xt cb_data_rtp;
tdav_video_jb_cb_data_xt cb_data_fdd;
tdav_video_jb_cb_data_xt cb_data_any;
-
- struct{
+
+ struct {
void* ptr;
tsk_size_t size;
} buffer;
-
+
TSK_DECLARE_SAFEOBJ;
}
tdav_video_jb_t;
@@ -111,18 +110,18 @@ tdav_video_jb_t;
static tsk_object_t* tdav_video_jb_ctor(tsk_object_t * self, va_list * app)
{
tdav_video_jb_t *jb = self;
- if(jb){
- if(!(jb->frames = tsk_list_create())){
+ if(jb) {
+ if(!(jb->frames = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create list");
return tsk_null;
}
- if(!(jb->decode_thread_cond = tsk_condwait_create())){
+ if(!(jb->decode_thread_cond = tsk_condwait_create())) {
TSK_DEBUG_ERROR("Failed to create condition var");
return tsk_null;
}
jb->cb_data_fdd.type = tdav_video_jb_cb_data_type_fdd;
jb->cb_data_rtp.type = tdav_video_jb_cb_data_type_rtp;
-
+
tsk_safeobj_init(jb);
}
return self;
@@ -130,22 +129,21 @@ static tsk_object_t* tdav_video_jb_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tdav_video_jb_dtor(tsk_object_t * self)
{
tdav_video_jb_t *jb = self;
- if(jb){
- if(jb->started){
+ if(jb) {
+ if(jb->started) {
tdav_video_jb_stop(jb);
}
TSK_OBJECT_SAFE_FREE(jb->frames);
- if(jb->decode_thread_cond){
+ if(jb->decode_thread_cond) {
tsk_condwait_destroy(&jb->decode_thread_cond);
}
TSK_SAFE_FREE(jb->buffer.ptr);
tsk_safeobj_deinit(jb);
}
-
+
return self;
}
-static const tsk_object_def_t tdav_video_jb_def_s =
-{
+static const tsk_object_def_t tdav_video_jb_def_s = {
sizeof(tdav_video_jb_t),
tdav_video_jb_ctor,
tdav_video_jb_dtor,
@@ -155,7 +153,7 @@ static const tsk_object_def_t tdav_video_jb_def_s =
tdav_video_jb_t* tdav_video_jb_create()
{
tdav_video_jb_t* jb;
-
+
if ((jb = tsk_object_new(&tdav_video_jb_def_s))) {
if (_tdav_video_jb_set_defaults(jb) != 0) {
TSK_OBJECT_SAFE_FREE(jb);
@@ -176,7 +174,7 @@ tdav_video_jb_t* tdav_video_jb_create()
int tdav_video_jb_set_callback(tdav_video_jb_t* self, tdav_video_jb_cb_f callback, const void* usr_data)
{
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -187,27 +185,49 @@ int tdav_video_jb_set_callback(tdav_video_jb_t* self, tdav_video_jb_cb_f callbac
return 0;
}
+// Congestion quality metrics based
+int tdav_video_jb_get_qcong(tdav_video_jb_t* self, float* q)
+{
+ float lm;
+ if (!self || !q) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ lm = (float)self->latency_max;
+ if (lm <= 0.f) { // must never happen...but used as a guard against div(0)
+ *q = 1.f;
+ }
+ else {
+ // when "frames_count" is > "latency_max" q is < 0 but it'll be clipped to 0.f
+ *q = 1.f - (self->frames_count / lm);
+ }
+ // 0.0001f instead of zero which could be interpreted as "no data available"
+ // 0.0001f encoded to 1-byte in RTCP-RR-JCNG will be coded as (0.0001f * 255.f) = zero
+ *q = TSK_CLAMP(0.0001f, *q, 1.f);
+ return 0;
+}
+
int tdav_video_jb_start(tdav_video_jb_t* self)
{
int ret = 0;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(self->started){
+ if(self->started) {
return 0;
}
-
+
self->started = tsk_true;
-
- if(!self->decode_thread[0]){
+
+ if(!self->decode_thread[0]) {
ret = tsk_thread_create(&self->decode_thread[0], _tdav_video_jb_decode_thread_func, self);
- if(ret != 0 || !self->decode_thread[0]){
+ if(ret != 0 || !self->decode_thread[0]) {
TSK_DEBUG_ERROR("Failed to create new thread");
}
ret = tsk_thread_set_priority(self->decode_thread[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
}
-
+
return ret;
}
@@ -220,43 +240,43 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
const tdav_video_frame_t* old_frame;
tsk_bool_t pt_matched = tsk_false, is_frame_late_or_dup = tsk_false, is_restarted = tsk_false;
uint16_t* seq_num;
-
- if(!self || !rtp_pkt || !rtp_pkt->header){
+
+ if(!self || !rtp_pkt || !rtp_pkt->header) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(!self->started){
+
+ if(!self->started) {
TSK_DEBUG_INFO("Video jitter buffer not started");
return 0;
}
-
+
seq_num = &self->seq_nums[rtp_pkt->header->payload_type];
-
+
tsk_safeobj_lock(self);
-
+
//TSK_DEBUG_INFO("receive seqnum=%u", rtp_pkt->header->seq_num);
-
- if(self->decode_last_timestamp && (self->decode_last_timestamp > rtp_pkt->header->timestamp)){
- if((self->decode_last_timestamp - rtp_pkt->header->timestamp) < TDAV_VIDEO_JB_MAX_DROPOUT){
+
+ if(self->decode_last_timestamp && (self->decode_last_timestamp > rtp_pkt->header->timestamp)) {
+ if((self->decode_last_timestamp - rtp_pkt->header->timestamp) < TDAV_VIDEO_JB_MAX_DROPOUT) {
TSK_DEBUG_INFO("--------Frame already Decoded [seqnum=%u]------------", rtp_pkt->header->seq_num);
tsk_safeobj_unlock(self);
return 0;
}
}
-
+
old_frame = _tdav_video_jb_get_frame(self, rtp_pkt->header->timestamp, rtp_pkt->header->payload_type, &pt_matched);
-
- if((*seq_num && *seq_num != 0xFFFF) && (*seq_num + 1) != rtp_pkt->header->seq_num){
+
+ if((*seq_num && *seq_num != 0xFFFF) && (*seq_num + 1) != rtp_pkt->header->seq_num) {
int32_t diff = ((int32_t)rtp_pkt->header->seq_num - (int32_t)*seq_num);
tsk_bool_t is_frame_loss = (diff > 0);
is_restarted = (TSK_ABS(diff) > TDAV_VIDEO_JB_MAX_DROPOUT);
is_frame_late_or_dup = !is_frame_loss;
tdav_video_jb_reset_fps_prob(self);
TSK_DEBUG_INFO("Packet %s (from JB) [%hu - %hu]", is_frame_loss ? "loss" : "late/duplicated/nack", *seq_num, rtp_pkt->header->seq_num);
-
- if(is_frame_loss && !is_restarted){
- if(self->callback){
+
+ if(is_frame_loss && !is_restarted) {
+ if(self->callback) {
self->cb_data_any.type = tdav_video_jb_cb_data_type_fl;
self->cb_data_any.ssrc = rtp_pkt->header->ssrc;
self->cb_data_any.fl.seq_num = (*seq_num + 1);
@@ -265,48 +285,48 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
}
}
}
-
- if(!old_frame){
+
+ if(!old_frame) {
tdav_video_frame_t* new_frame;
- if(pt_matched){
+ if(pt_matched) {
// if we have a frame with the same payload type but without this timestamp this means that we moved to a new frame
// this happens if the frame is waiting to be decoded or the marker is lost
}
- if((new_frame = tdav_video_frame_create(rtp_pkt))){
+ if((new_frame = tdav_video_frame_create(rtp_pkt))) {
// compute avg frame duration
- if(self->last_timestamp && self->last_timestamp < rtp_pkt->header->timestamp){
+ if(self->last_timestamp && self->last_timestamp < rtp_pkt->header->timestamp) {
uint32_t duration = (rtp_pkt->header->timestamp - self->last_timestamp)/self->rate;
self->avg_duration = self->avg_duration ? ((self->avg_duration + duration) >> 1) : duration;
--self->fps_prob;
}
self->last_timestamp = rtp_pkt->header->timestamp;
-
+
tsk_list_lock(self->frames);
- if(self->frames_count >= self->tail_max){
- if(++self->conseq_frame_drop >= self->tail_max){
+ if(self->frames_count >= self->tail_max) {
+ if(++self->conseq_frame_drop >= self->tail_max) {
TSK_DEBUG_ERROR("Too many frames dropped and fps=%d", self->fps);
tsk_list_clear_items(self->frames);
self->conseq_frame_drop = 0;
self->frames_count = 1;
- if(self->callback){
+ if(self->callback) {
self->cb_data_any.type = tdav_video_jb_cb_data_type_tmfr;
self->cb_data_any.ssrc = rtp_pkt->header->ssrc;
self->callback(&self->cb_data_any);
}
}
- else{
+ else {
TSK_DEBUG_INFO("Dropping video frame because frames_count(%lld)>=tail_max(%d)", self->frames_count, self->tail_max);
tsk_list_remove_first_item(self->frames);
}
tdav_video_jb_reset_fps_prob(self);
}
- else{
+ else {
++self->frames_count;
}
tsk_list_push_ascending_data(self->frames, (void**)&new_frame);
tsk_list_unlock(self->frames);
}
- if(self->fps_prob <= 0 && self->avg_duration){
+ if(self->fps_prob <= 0 && self->avg_duration) {
// compute FPS using timestamp values
int32_t fps_new = (1000 / self->avg_duration);
int32_t fps_old = self->fps;
@@ -315,7 +335,7 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
self->latency_max = self->fps; // maximum = 1 second
TSK_DEBUG_INFO("According to rtp-timestamps ...FPS = %d (clipped to %d) tail_max=%d, latency_max=%u", fps_new, self->fps, self->tail_max, (unsigned)self->latency_max);
tdav_video_jb_reset_fps_prob(self);
- if(self->callback && (fps_old != self->fps)){
+ if(self->callback && (fps_old != self->fps)) {
self->cb_data_any.type = tdav_video_jb_cb_data_type_fps_changed;
self->cb_data_any.ssrc = rtp_pkt->header->ssrc;
self->cb_data_any.fps.new = self->fps; // clipped value
@@ -324,51 +344,51 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
}
}
}
- else{
+ else {
tdav_video_frame_put((tdav_video_frame_t*)old_frame, rtp_pkt);
}
-
+
tsk_safeobj_unlock(self);
-
- if(!is_frame_late_or_dup || is_restarted){
+
+ if(!is_frame_late_or_dup || is_restarted) {
*seq_num = rtp_pkt->header->seq_num;
}
#endif
-
+
return 0;
}
int tdav_video_jb_stop(tdav_video_jb_t* self)
{
int ret;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(!self->started){
+ if(!self->started) {
return 0;
}
-
+
TSK_DEBUG_INFO("tdav_video_jb_stop()");
-
+
self->started = tsk_false;
-
+
ret = tsk_condwait_broadcast(self->decode_thread_cond);
-
+
if (self->decode_thread[0]) {
ret = tsk_thread_join(&self->decode_thread[0]);
}
-
+
// clear pending frames
tsk_list_lock(self->frames);
tsk_list_clear_items(self->frames);
self->frames_count = 0;
tsk_list_unlock(self->frames);
-
+
// reset default values to make sure next start will be called with right defaults
// do not call this function in start to avoid overriding values defined between prepare() and start()
_tdav_video_jb_set_defaults(self);
-
+
return ret;
}
@@ -378,7 +398,7 @@ static int _tdav_video_jb_set_defaults(struct tdav_video_jb_s* self)
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
self->fps = TDAV_VIDEO_JB_FPS;
self->fps_prob = TDAV_VIDEO_JB_FPS_PROB;
self->tail_max = TDAV_VIDEO_JB_TAIL_MAX;
@@ -389,10 +409,10 @@ static int _tdav_video_jb_set_defaults(struct tdav_video_jb_s* self)
self->decode_last_timestamp = 0;
self->decode_last_seq_num_with_mark = -1;
self->decode_last_time = 0;
-
+
self->latency_min = TDAV_VIDEO_JB_LATENCY_MIN;
self->latency_max = TDAV_VIDEO_JB_LATENCY_MAX;
-
+
return 0;
}
@@ -400,22 +420,24 @@ static const tdav_video_frame_t* _tdav_video_jb_get_frame(tdav_video_jb_t* self,
{
const tdav_video_frame_t* ret = tsk_null;
const tsk_list_item_t *item;
-
+
*pt_matched =tsk_false;
-
+
tsk_list_lock(self->frames);
- tsk_list_foreach(item, self->frames){
- if(TDAV_VIDEO_FRAME(item->data)->payload_type == pt){
- if(!(*pt_matched)) *pt_matched = tsk_true;
- if(TDAV_VIDEO_FRAME(item->data)->timestamp == timestamp){
+ tsk_list_foreach(item, self->frames) {
+ if(TDAV_VIDEO_FRAME(item->data)->payload_type == pt) {
+ if(!(*pt_matched)) {
+ *pt_matched = tsk_true;
+ }
+ if(TDAV_VIDEO_FRAME(item->data)->timestamp == timestamp) {
ret = item->data;
break;
}
}
-
+
}
tsk_list_unlock(self->frames);
-
+
return ret;
}
@@ -433,36 +455,36 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
#if 0
static const uint64_t __toomuch_delay_to_be_valid = 10000; // guard against systems with buggy "tsk_time_now()" -Won't say Windows ...but :)-
#endif
-
+
jb->decode_last_seq_num_with_mark = -1; // -1 -> unset
jb->decode_last_time = tsk_time_now();
-
+
(void)(now);
//(void)(delay);
-
+
TSK_DEBUG_INFO("Video jitter buffer thread - ENTER");
-
- while(jb->started){
+
+ while(jb->started) {
now = tsk_time_now();
if (next_decode_duration > 0) {
tsk_condwait_timedwait(jb->decode_thread_cond, next_decode_duration);
}
-
- if(!jb->started){
+
+ if(!jb->started) {
break;
}
-
+
// TSK_DEBUG_INFO("Frames count = %d", jb->frames_count);
-
+
// the second condition (jb->frames_count > 0 && latency >= jb->latency_max) is required to make sure we'll process the pending pkts even if the remote party stops sending frames. GE issue: device stops sending frames when it enters in "frame freeze" mode which means #"latency_min" frames won't be displayed.
if (jb->frames_count >= (int64_t)jb->latency_min || (jb->frames_count > 0 && latency >= jb->latency_max)) {
- tsk_list_item_t *item = tsk_null;
+ tsk_list_item_t *item = tsk_null;
postpone = tsk_false;
latency = 0;
-
+
tsk_safeobj_lock(jb); // against get_frame()
tsk_list_lock(jb->frames); // against put()
-
+
// is it still acceptable to wait for missing packets?
if (jb->frames_count < (int64_t)jb->latency_max) {
frame = (const tdav_video_frame_t*)jb->frames->head->data;
@@ -471,7 +493,7 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
// signal to the session that a sequence number is missing (will send a NACK)
// the missing seqnum has been already requested in jb_put() and here we request it again only ONE time
if (jb->callback && frame) {
- if(prev_missing_seq_num_start != missing_seq_num_start || prev_lasted_missing_seq_num_count != missing_seq_num_count){ // guard to request it only once
+ if(prev_missing_seq_num_start != missing_seq_num_start || prev_lasted_missing_seq_num_count != missing_seq_num_count) { // guard to request it only once
jb->cb_data_any.type = tdav_video_jb_cb_data_type_fl;
jb->cb_data_any.ssrc = frame->ssrc;
jb->cb_data_any.fl.seq_num = prev_missing_seq_num_start = missing_seq_num_start;
@@ -488,34 +510,34 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
// postpone is equal to "tsk_false" which means the pending frame will be displayed in all cases
}
if (!postpone) {
- if ((item = tsk_list_pop_first_item(jb->frames))) { // always true (jb->frames_count > 0)
- --jb->frames_count;
- // Update the latest decoded timestamp here while we have the lock on the frames
- jb->decode_last_timestamp = ((const tdav_video_frame_t*)item->data)->timestamp;
- }
+ if ((item = tsk_list_pop_first_item(jb->frames))) { // always true (jb->frames_count > 0)
+ --jb->frames_count;
+ // Update the latest decoded timestamp here while we have the lock on the frames
+ jb->decode_last_timestamp = ((const tdav_video_frame_t*)item->data)->timestamp;
+ }
}
tsk_list_unlock(jb->frames);
tsk_safeobj_unlock(jb);
-
+
if (item) {
- if(jb->callback){
+ if(jb->callback) {
trtp_rtp_packet_t* pkt;
const tsk_list_item_t* _item = item; // save memory address as "tsk_list_foreach() will change it for each loop"
int32_t last_seq_num = -1; // guard against duplicated packets
frame = _item->data;
- tsk_list_foreach(_item, frame->pkts){
- if(!(pkt = _item->data) || !pkt->payload.size || !pkt->header || pkt->header->seq_num == last_seq_num || !jb->started){
+ tsk_list_foreach(_item, frame->pkts) {
+ if(!(pkt = _item->data) || !pkt->payload.size || !pkt->header || pkt->header->seq_num == last_seq_num || !jb->started) {
TSK_DEBUG_ERROR("Skipping invalid rtp packet (do not decode!)");
continue;
}
jb->cb_data_rtp.rtp.pkt = pkt;
jb->callback(&jb->cb_data_rtp);
- if(pkt->header->marker){
+ if(pkt->header->marker) {
jb->decode_last_seq_num_with_mark = pkt->header->seq_num;
}
}
}
-
+
TSK_OBJECT_SAFE_FREE(item);
}
}
@@ -524,18 +546,18 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
latency++;
}
}
-
+
#if 1
- if (cleaning_delay || jb->frames_count > (int64_t)jb->latency_max){
+ if (cleaning_delay || jb->frames_count > (int64_t)jb->latency_max) {
//x_decode_time = now;
next_decode_duration = 0;
cleaning_delay = ((jb->frames_count << 1) > (int64_t)jb->latency_max); // cleanup up2 half
}
- else{
+ else {
next_decode_duration = (1000 / jb->fps);
_now = tsk_time_now();
if (_now > now) {
- if ((_now - now) > next_decode_duration){
+ if ((_now - now) > next_decode_duration) {
next_decode_duration = 0;
}
else {
@@ -556,19 +578,19 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
next_decode_duration = 0;
}
else*/{
- //next_decode_duration = (delay > x_decode_duration) ? 0 : (x_decode_duration - delay);
- //x_decode_duration = (1000 / jb->fps);
- //x_decode_time += x_decode_duration;
- }
-
-
+ //next_decode_duration = (delay > x_decode_duration) ? 0 : (x_decode_duration - delay);
+ //x_decode_duration = (1000 / jb->fps);
+ //x_decode_time += x_decode_duration;
+ }
+
+
//TSK_DEBUG_INFO("next_decode_timeout=%llu, delay = %llu", next_decode_duration, delay);
#else
next_decode_duration = (1000 / jb->fps);
#endif
}
-
+
TSK_DEBUG_INFO("Video jitter buffer thread - EXIT");
-
+
return tsk_null;
}
diff --git a/tinyDAV/src/video/mf/tdav_consumer_video_mf.cxx b/tinyDAV/src/video/mf/tdav_consumer_video_mf.cxx
index b5048b2..28cf332 100755
--- a/tinyDAV/src/video/mf/tdav_consumer_video_mf.cxx
+++ b/tinyDAV/src/video/mf/tdav_consumer_video_mf.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -26,96 +26,95 @@
#include "tsk_string.h"
#include "tsk_debug.h"
-typedef struct tdav_consumer_video_mf_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_video_mf_s {
+ TMEDIA_DECLARE_CONSUMER;
}
tdav_consumer_video_mf_t;
/* ============ Media Producer Interface ================= */
int tdav_consumer_video_mf_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
+ int ret = 0;
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return ret;
+ return ret;
}
int tdav_consumer_video_mf_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+ tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+
+ if(!consumer || !codec || !codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!consumer || !codec || !codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
#if 0
- TMEDIA_CONSUMER(consumer)->decoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
+ TMEDIA_CONSUMER(consumer)->decoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
#endif
- TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+ TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
- if(!TMEDIA_CONSUMER(consumer)->video.display.width){
- TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(consumer)->video.display.height){
- TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
- }
+ if(!TMEDIA_CONSUMER(consumer)->video.display.width) {
+ TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(consumer)->video.display.height) {
+ TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_video_mf_start(tmedia_consumer_t* self)
{
- tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+ tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_video_mf_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
-
- return 0;
+ tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+
+ return 0;
}
int tdav_consumer_video_mf_pause(tmedia_consumer_t* self)
{
- tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+ tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_video_mf_stop(tmedia_consumer_t* self)
{
- tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
+ tdav_consumer_video_mf_t* consumer = (tdav_consumer_video_mf_t*)self;
- TSK_DEBUG_INFO("tdav_consumer_video_mf_stop");
+ TSK_DEBUG_INFO("tdav_consumer_video_mf_stop");
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
@@ -125,60 +124,58 @@ int tdav_consumer_video_mf_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_video_mf_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_video_mf_t *consumer = (tdav_consumer_video_mf_t *)self;
- if(consumer){
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
- TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
-
- /* init self */
- TMEDIA_CONSUMER(consumer)->video.fps = 15;
- TMEDIA_CONSUMER(consumer)->video.display.width = 352;
- TMEDIA_CONSUMER(consumer)->video.display.height = 288;
- TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
- }
- return self;
+ tdav_consumer_video_mf_t *consumer = (tdav_consumer_video_mf_t *)self;
+ if(consumer) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
+ TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
+
+ /* init self */
+ TMEDIA_CONSUMER(consumer)->video.fps = 15;
+ TMEDIA_CONSUMER(consumer)->video.display.width = 352;
+ TMEDIA_CONSUMER(consumer)->video.display.height = 288;
+ TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_video_mf_dtor(tsk_object_t * self)
-{
- tdav_consumer_video_mf_t *consumer = (tdav_consumer_video_mf_t *)self;
- if(consumer){
+{
+ tdav_consumer_video_mf_t *consumer = (tdav_consumer_video_mf_t *)self;
+ if(consumer) {
- /* stop */
- //if(consumer->started){
- tdav_consumer_video_mf_stop((tmedia_consumer_t*)self);
- //}
+ /* stop */
+ //if(consumer->started){
+ tdav_consumer_video_mf_stop((tmedia_consumer_t*)self);
+ //}
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
- /* deinit self */
- }
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
+ /* deinit self */
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_video_mf_def_s =
-{
- sizeof(tdav_consumer_video_mf_t),
- tdav_consumer_video_mf_ctor,
- tdav_consumer_video_mf_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_consumer_video_mf_def_s = {
+ sizeof(tdav_consumer_video_mf_t),
+ tdav_consumer_video_mf_ctor,
+ tdav_consumer_video_mf_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_video_mf_plugin_def_s =
-{
- &tdav_consumer_video_mf_def_s,
-
- tmedia_video,
- "Microsoft Windows Media Foundation consumer (Video)",
-
- tdav_consumer_video_mf_set,
- tdav_consumer_video_mf_prepare,
- tdav_consumer_video_mf_start,
- tdav_consumer_video_mf_consume,
- tdav_consumer_video_mf_pause,
- tdav_consumer_video_mf_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_video_mf_plugin_def_s = {
+ &tdav_consumer_video_mf_def_s,
+
+ tmedia_video,
+ "Microsoft Windows Media Foundation consumer (Video)",
+
+ tdav_consumer_video_mf_set,
+ tdav_consumer_video_mf_prepare,
+ tdav_consumer_video_mf_start,
+ tdav_consumer_video_mf_consume,
+ tdav_consumer_video_mf_pause,
+ tdav_consumer_video_mf_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_video_mf_plugin_def_t = &tdav_consumer_video_mf_plugin_def_s;
diff --git a/tinyDAV/src/video/mf/tdav_producer_video_mf.cxx b/tinyDAV/src/video/mf/tdav_producer_video_mf.cxx
index be899a0..d4930c4 100755
--- a/tinyDAV/src/video/mf/tdav_producer_video_mf.cxx
+++ b/tinyDAV/src/video/mf/tdav_producer_video_mf.cxx
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
* Copyright (C) Microsoft Corporation. All rights reserved.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -53,25 +53,23 @@
(*ppT)->Release(); \
*ppT = NULL; \
} \
-}
+}
#undef CHECK_HR
#define CHECK_HR(x) if (FAILED(x)) { TSK_DEBUG_ERROR("Operation Failed"); goto bail; }
-typedef struct VideoSubTypeGuidPair
-{
- tmedia_chroma_t chroma;
- const GUID fourcc;
+typedef struct VideoSubTypeGuidPair {
+ tmedia_chroma_t chroma;
+ const GUID fourcc;
}
VideoSubTypeGuidPair;
-static const VideoSubTypeGuidPair g_VideoSubTypeGuidPairs[] =
-{
-
- { tmedia_chroma_nv12, MFVideoFormat_NV12 }, // 0
- { tmedia_chroma_rgb24, MFVideoFormat_RGB24 },
- { tmedia_chroma_rgb32, MFVideoFormat_RGB32 },
- // to be continued
+static const VideoSubTypeGuidPair g_VideoSubTypeGuidPairs[] = {
+
+ { tmedia_chroma_nv12, MFVideoFormat_NV12 }, // 0
+ { tmedia_chroma_rgb24, MFVideoFormat_RGB24 },
+ { tmedia_chroma_rgb32, MFVideoFormat_RGB32 },
+ // to be continued
};
// MFVideoFormat_NV12, MFVideoFormat_YUY2, MFVideoFormat_UYVY,
@@ -88,21 +86,21 @@ class DeviceList
IMFActivate **m_ppDevices;
public:
- DeviceList() : m_ppDevices(NULL), m_cDevices(0)
- {
+ DeviceList() : m_ppDevices(NULL), m_cDevices(0) {
}
- ~DeviceList()
- {
+ ~DeviceList() {
Clear();
}
- UINT32 Count() const { return m_cDevices; }
+ UINT32 Count() const {
+ return m_cDevices;
+ }
void Clear();
HRESULT EnumerateDevices();
HRESULT GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate);
- HRESULT GetDeviceBest(IMFActivate **ppActivate);
+ HRESULT GetDeviceBest(IMFActivate **ppActivate);
HRESULT GetDeviceName(UINT32 index, WCHAR **ppszName);
};
@@ -111,10 +109,10 @@ public:
// SampleGrabberCB [Declaration]
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh184779(v=vs.85).aspx
//
-class SampleGrabberCB : public IMFSampleGrabberSinkCallback
+class SampleGrabberCB : public IMFSampleGrabberSinkCallback
{
long m_cRef;
- const struct tdav_producer_video_mf_s* m_pWrappedProducer;
+ const struct tdav_producer_video_mf_s* m_pWrappedProducer;
SampleGrabberCB(const struct tdav_producer_video_mf_s* pcWrappedProducer) : m_cRef(1), m_pWrappedProducer(pcWrappedProducer) {}
@@ -136,8 +134,8 @@ public:
// IMFSampleGrabberSinkCallback methods
STDMETHODIMP OnSetPresentationClock(IMFPresentationClock* pClock);
STDMETHODIMP OnProcessSample(REFGUID guidMajorMediaType, DWORD dwSampleFlags,
- LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
- DWORD dwSampleSize);
+ LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
+ DWORD dwSampleSize);
STDMETHODIMP OnShutdown();
};
@@ -145,16 +143,15 @@ public:
//
// tdav_producer_video_mf_t
//
-typedef struct tdav_producer_video_mf_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_video_mf_s {
+ TMEDIA_DECLARE_PRODUCER;
- bool bStarted;
- tsk_thread_handle_t* ppTread[1];
+ bool bStarted;
+ tsk_thread_handle_t* ppTread[1];
- DeviceList* pDeviceList;
+ DeviceList* pDeviceList;
- IMFMediaSession *pSession;
+ IMFMediaSession *pSession;
IMFMediaSource *pSource;
SampleGrabberCB *pCallback;
IMFActivate *pSinkActivate;
@@ -167,9 +164,9 @@ tdav_producer_video_mf_t;
// Forward declarations for glovbal functions
//
static HRESULT CreateTopology(
- IMFMediaSource *pSource,
- IMFActivate *pSinkActivate,
- IMFTopology **ppTopo);
+ IMFMediaSource *pSource,
+ IMFActivate *pSinkActivate,
+ IMFTopology **ppTopo);
static HRESULT AddSourceNode(
IMFTopology *pTopology,
IMFMediaSource *pSource,
@@ -182,199 +179,199 @@ static HRESULT AddOutputNode(
DWORD dwId,
IMFTopologyNode **ppNode);
static HRESULT RunSession(
- IMFMediaSession *pSession,
- IMFTopology *pTopology);
+ IMFMediaSession *pSession,
+ IMFTopology *pTopology);
static HRESULT StopSession(
- IMFMediaSession *pSession,
- IMFMediaSource *pSource);
+ IMFMediaSession *pSession,
+ IMFMediaSource *pSource);
static HRESULT PauseSession(
- IMFMediaSession *pSession);
+ IMFMediaSession *pSession);
static void* TSK_STDCALL RunSessionThread(void *pArg);
/* ============ Media Producer Interface ================= */
static int tdav_producer_video_mf_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+ int ret = 0;
+ tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
- if(!pSelf || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return ret;
+ return ret;
}
static int tdav_producer_video_mf_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+ tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+
+ if(!pSelf || !codec || !codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!pSelf || !codec || !codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
#if 0
- TMEDIA_PRODUCER(producer)->encoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
+ TMEDIA_PRODUCER(producer)->encoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
#else
- TMEDIA_PRODUCER(pSelf)->video.chroma = g_VideoSubTypeGuidPairs[DEFAULT_SUBTYPE_INDEX].chroma;
+ TMEDIA_PRODUCER(pSelf)->video.chroma = g_VideoSubTypeGuidPairs[DEFAULT_SUBTYPE_INDEX].chroma;
#endif
- TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+ TMEDIA_PRODUCER(pSelf)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(pSelf)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(pSelf)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
- // MFVideoFormat_NV12, MFVideoFormat_YUY2, MFVideoFormat_UYVY,
+ // MFVideoFormat_NV12, MFVideoFormat_YUY2, MFVideoFormat_UYVY,
// MFVideoFormat_RGB32, MFVideoFormat_RGB24, MFVideoFormat_IYUV
#undef DEFAULT_SUBTYPE
- HRESULT hr = S_OK;
-
- // create device list object
- if(!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceList())){
- TSK_DEBUG_ERROR("Failed to create device list");
- hr = E_OUTOFMEMORY;
- goto bail;
- }
- // enumerate devices
- hr = pSelf->pDeviceList->EnumerateDevices();
- if(!SUCCEEDED(hr)){
- goto bail;
- }
-
- // check if we have at least one MF video source connected to the PC
- if(pSelf->pDeviceList->Count() == 0){
- TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
- // do not break the negotiation as one-way video connection is a valid use-case
- }
- else{
- IMFActivate* pActivate = NULL;
- // Get best MF video source
- hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
- if(!SUCCEEDED(hr) || !pActivate){
- TSK_DEBUG_ERROR("Failed to get best MF video source");
- if(!pActivate){
- hr = E_OUTOFMEMORY;
- }
- goto bail;
- }
-
- // Create the media source for the device.
- hr = pActivate->ActivateObject(
- __uuidof(IMFMediaSource),
- (void**)&pSelf->pSource
- );
- SafeRelease(&pActivate);
- if(!SUCCEEDED(hr)){
- TSK_DEBUG_ERROR("ActivateObject(MF video source) failed");
- goto bail;
- }
-
- // Configure the media type that the Sample Grabber will receive.
- // Setting the major and subtype is usually enough for the topology loader
- // to resolve the topology.
-
- CHECK_HR(hr = MFCreateMediaType(&pSelf->pType));
- CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
-#if 0
- CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264);
-#else
- CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, g_VideoSubTypeGuidPairs[DEFAULT_SUBTYPE_INDEX].fourcc));
-#endif
- CHECK_HR(hr = MFSetAttributeSize(pSelf->pType, MF_MT_FRAME_SIZE, TMEDIA_PRODUCER(pSelf)->video.width, TMEDIA_PRODUCER(pSelf)->video.height));
- // CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_DEFAULT_STRIDE, 1280));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, 1));
- // CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AVG_BITRATE, 147456000));
- //CHECK_HR(hr = MFSetAttributeRatio(pSelf->pType, MF_MT_FRAME_RATE, (UINT32)30000, 1001));
- CHECK_HR(hr = MFSetAttributeRatio(pSelf->pType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
- CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+ HRESULT hr = S_OK;
- // Create the sample grabber sink.
- CHECK_HR(hr = SampleGrabberCB::CreateInstance(pSelf, &pSelf->pCallback));
- CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pType, pSelf->pCallback, &pSelf->pSinkActivate));
+ // create device list object
+ if(!pSelf->pDeviceList && !(pSelf->pDeviceList = new DeviceList())) {
+ TSK_DEBUG_ERROR("Failed to create device list");
+ hr = E_OUTOFMEMORY;
+ goto bail;
+ }
+ // enumerate devices
+ hr = pSelf->pDeviceList->EnumerateDevices();
+ if(!SUCCEEDED(hr)) {
+ goto bail;
+ }
- // To run as fast as possible, set this attribute (requires Windows 7):
- CHECK_HR(hr = pSelf->pSinkActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
+ // check if we have at least one MF video source connected to the PC
+ if(pSelf->pDeviceList->Count() == 0) {
+ TSK_DEBUG_WARN("No MF video source could be found...no video will be sent");
+ // do not break the negotiation as one-way video connection is a valid use-case
+ }
+ else {
+ IMFActivate* pActivate = NULL;
+ // Get best MF video source
+ hr = pSelf->pDeviceList->GetDeviceBest(&pActivate);
+ if(!SUCCEEDED(hr) || !pActivate) {
+ TSK_DEBUG_ERROR("Failed to get best MF video source");
+ if(!pActivate) {
+ hr = E_OUTOFMEMORY;
+ }
+ goto bail;
+ }
- // Create the Media Session.
- CHECK_HR(hr = MFCreateMediaSession(NULL, &pSelf->pSession));
+ // Create the media source for the device.
+ hr = pActivate->ActivateObject(
+ __uuidof(IMFMediaSource),
+ (void**)&pSelf->pSource
+ );
+ SafeRelease(&pActivate);
+ if(!SUCCEEDED(hr)) {
+ TSK_DEBUG_ERROR("ActivateObject(MF video source) failed");
+ goto bail;
+ }
- // Create the topology.
- CHECK_HR(hr = CreateTopology(pSelf->pSource, pSelf->pSinkActivate, &pSelf->pTopology));
- }
+ // Configure the media type that the Sample Grabber will receive.
+ // Setting the major and subtype is usually enough for the topology loader
+ // to resolve the topology.
+
+ CHECK_HR(hr = MFCreateMediaType(&pSelf->pType));
+ CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
+#if 0
+ CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264);
+#else
+ CHECK_HR(hr = pSelf->pType->SetGUID(MF_MT_SUBTYPE, g_VideoSubTypeGuidPairs[DEFAULT_SUBTYPE_INDEX].fourcc));
+#endif
+ CHECK_HR(hr = MFSetAttributeSize(pSelf->pType, MF_MT_FRAME_SIZE, TMEDIA_PRODUCER(pSelf)->video.width, TMEDIA_PRODUCER(pSelf)->video.height));
+ // CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_DEFAULT_STRIDE, 1280));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, 1));
+ // CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_AVG_BITRATE, 147456000));
+ //CHECK_HR(hr = MFSetAttributeRatio(pSelf->pType, MF_MT_FRAME_RATE, (UINT32)30000, 1001));
+ CHECK_HR(hr = MFSetAttributeRatio(pSelf->pType, MF_MT_PIXEL_ASPECT_RATIO, 1, 1));
+ CHECK_HR(hr = pSelf->pType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive));
+
+ // Create the sample grabber sink.
+ CHECK_HR(hr = SampleGrabberCB::CreateInstance(pSelf, &pSelf->pCallback));
+ CHECK_HR(hr = MFCreateSampleGrabberSinkActivate(pSelf->pType, pSelf->pCallback, &pSelf->pSinkActivate));
+
+ // To run as fast as possible, set this attribute (requires Windows 7):
+ CHECK_HR(hr = pSelf->pSinkActivate->SetUINT32(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, TRUE));
+
+ // Create the Media Session.
+ CHECK_HR(hr = MFCreateMediaSession(NULL, &pSelf->pSession));
+
+ // Create the topology.
+ CHECK_HR(hr = CreateTopology(pSelf->pSource, pSelf->pSinkActivate, &pSelf->pTopology));
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int tdav_producer_video_mf_start(tmedia_producer_t* self)
{
- tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
-
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(pSelf->bStarted){
- return 0;
- }
+ tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
- HRESULT hr = S_OK;
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(pSelf->bStarted) {
+ return 0;
+ }
- // Run the media session.
- CHECK_HR(hr = RunSession(pSelf->pSession, pSelf->pTopology));
+ HRESULT hr = S_OK;
- // Start asynchronous watcher thread
- pSelf->bStarted = true;
- int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
- if(ret != 0){
- TSK_DEBUG_ERROR("Failed to create thread");
- hr = E_FAIL;
- pSelf->bStarted = false;
- StopSession(pSelf->pSession, pSelf->pSource);
- goto bail;
- }
+ // Run the media session.
+ CHECK_HR(hr = RunSession(pSelf->pSession, pSelf->pTopology));
+
+ // Start asynchronous watcher thread
+ pSelf->bStarted = true;
+ int ret = tsk_thread_create(&pSelf->ppTread[0], RunSessionThread, pSelf);
+ if(ret != 0) {
+ TSK_DEBUG_ERROR("Failed to create thread");
+ hr = E_FAIL;
+ pSelf->bStarted = false;
+ StopSession(pSelf->pSession, pSelf->pSource);
+ goto bail;
+ }
bail:
- return SUCCEEDED(hr) ? 0 : -1;
+ return SUCCEEDED(hr) ? 0 : -1;
}
static int tdav_producer_video_mf_pause(tmedia_producer_t* self)
{
- tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+ tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ HRESULT hr = PauseSession(pSelf->pSession);
- HRESULT hr = PauseSession(pSelf->pSession);
-
- return 0;
+ return 0;
}
static int tdav_producer_video_mf_stop(tmedia_producer_t* self)
{
- tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
+ tdav_producer_video_mf_t* pSelf = (tdav_producer_video_mf_t*)self;
- if(!pSelf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!pSelf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- HRESULT hr = S_OK;
+ HRESULT hr = S_OK;
- // for the thread
- pSelf->bStarted = false;
- hr = StopSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
- if(pSelf->ppTread[0]){
- tsk_thread_join(&pSelf->ppTread[0]);
- }
- hr = StopSession(NULL, pSelf->pSource); // stop source to release the camera
+ // for the thread
+ pSelf->bStarted = false;
+ hr = StopSession(pSelf->pSession, NULL); // stop session to wakeup the asynchronous thread
+ if(pSelf->ppTread[0]) {
+ tsk_thread_join(&pSelf->ppTread[0]);
+ }
+ hr = StopSession(NULL, pSelf->pSource); // stop source to release the camera
- return 0;
+ return 0;
}
//
@@ -383,79 +380,77 @@ static int tdav_producer_video_mf_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* tdav_producer_video_mf_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)self;
- if(pSelf){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
+ tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)self;
+ if(pSelf) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(pSelf));
#if 0 // H.264
- TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
+ TMEDIA_PRODUCER(pSelf)->video.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
#endif
- /* init self with default values*/
+ /* init self with default values*/
- TMEDIA_PRODUCER(pSelf)->video.fps = 15;
- TMEDIA_PRODUCER(pSelf)->video.width = 352;
- TMEDIA_PRODUCER(pSelf)->video.height = 288;
+ TMEDIA_PRODUCER(pSelf)->video.fps = 15;
+ TMEDIA_PRODUCER(pSelf)->video.width = 352;
+ TMEDIA_PRODUCER(pSelf)->video.height = 288;
#if TDAV_UNDER_WINDOWS_PHONE
- pSelf->videoCapturePhone = ref new VideoCapturePhone();
+ pSelf->videoCapturePhone = ref new VideoCapturePhone();
#endif
- }
- return self;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_video_mf_dtor(tsk_object_t * self)
-{
- tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)self;
- if(pSelf){
- /* stop */
- //if(pSelf->started){
- tdav_producer_video_mf_stop((tmedia_producer_t*)self);
- //}
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
- /* deinit self */
- if(pSelf->pDeviceList){
- delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
- }
- if(pSelf->pSource){
- pSelf->pSource->Shutdown();
- }
- if(pSelf->pSession){
- pSelf->pSession->Shutdown();
- }
-
- SafeRelease(&pSelf->pSession);
- SafeRelease(&pSelf->pSource);
- SafeRelease(&pSelf->pCallback);
- SafeRelease(&pSelf->pSinkActivate);
- SafeRelease(&pSelf->pTopology);
- SafeRelease(&pSelf->pType);
- }
-
- return self;
+{
+ tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)self;
+ if(pSelf) {
+ /* stop */
+ //if(pSelf->started){
+ tdav_producer_video_mf_stop((tmedia_producer_t*)self);
+ //}
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(pSelf));
+ /* deinit self */
+ if(pSelf->pDeviceList) {
+ delete pSelf->pDeviceList, pSelf->pDeviceList = NULL;
+ }
+ if(pSelf->pSource) {
+ pSelf->pSource->Shutdown();
+ }
+ if(pSelf->pSession) {
+ pSelf->pSession->Shutdown();
+ }
+
+ SafeRelease(&pSelf->pSession);
+ SafeRelease(&pSelf->pSource);
+ SafeRelease(&pSelf->pCallback);
+ SafeRelease(&pSelf->pSinkActivate);
+ SafeRelease(&pSelf->pTopology);
+ SafeRelease(&pSelf->pType);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_video_mf_def_s =
-{
- sizeof(tdav_producer_video_mf_t),
- tdav_producer_video_mf_ctor,
- tdav_producer_video_mf_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_video_mf_def_s = {
+ sizeof(tdav_producer_video_mf_t),
+ tdav_producer_video_mf_ctor,
+ tdav_producer_video_mf_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_video_mf_plugin_def_s =
-{
- &tdav_producer_video_mf_def_s,
+static const tmedia_producer_plugin_def_t tdav_producer_video_mf_plugin_def_s = {
+ &tdav_producer_video_mf_def_s,
- tmedia_video,
- "Microsoft Windows Media Foundation producer (Video)",
+ tmedia_video,
+ "Microsoft Windows Media Foundation producer (Video)",
- tdav_producer_video_mf_set,
- tdav_producer_video_mf_prepare,
- tdav_producer_video_mf_start,
- tdav_producer_video_mf_pause,
- tdav_producer_video_mf_stop
+ tdav_producer_video_mf_set,
+ tdav_producer_video_mf_prepare,
+ tdav_producer_video_mf_start,
+ tdav_producer_video_mf_pause,
+ tdav_producer_video_mf_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_video_mf_plugin_def_t = &tdav_producer_video_mf_plugin_def_s;
@@ -467,8 +462,7 @@ const tmedia_producer_plugin_def_t *tdav_producer_video_mf_plugin_def_t = &tdav_
//
void DeviceList::Clear()
{
- for (UINT32 i = 0; i < m_cDevices; i++)
- {
+ for (UINT32 i = 0; i < m_cDevices; i++) {
SafeRelease(&m_ppDevices[i]);
}
CoTaskMemFree(m_ppDevices);
@@ -490,17 +484,15 @@ HRESULT DeviceList::EnumerateDevices()
hr = MFCreateAttributes(&pAttributes, 1);
// Ask for source type = video capture devices
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = pAttributes->SetGUID(
- MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
- MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID
- );
+ MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
+ MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID
+ );
}
// Enumerate devices.
- if (SUCCEEDED(hr))
- {
+ if (SUCCEEDED(hr)) {
hr = MFEnumDeviceSources(pAttributes, &m_ppDevices, &m_cDevices);
}
@@ -512,8 +504,7 @@ HRESULT DeviceList::EnumerateDevices()
HRESULT DeviceList::GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate)
{
- if (index >= Count())
- {
+ if (index >= Count()) {
return E_INVALIDARG;
}
@@ -525,24 +516,23 @@ HRESULT DeviceList::GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate)
HRESULT DeviceList::GetDeviceBest(IMFActivate **ppActivate)
{
- // for now we just get the default video source device (index = 0)
- return GetDeviceAtIndex(0, ppActivate);
+ // for now we just get the default video source device (index = 0)
+ return GetDeviceAtIndex(0, ppActivate);
}
HRESULT DeviceList::GetDeviceName(UINT32 index, WCHAR **ppszName)
{
- if (index >= Count())
- {
+ if (index >= Count()) {
return E_INVALIDARG;
}
HRESULT hr = S_OK;
hr = m_ppDevices[index]->GetAllocatedString(
- MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
- ppszName,
- NULL
- );
+ MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
+ ppszName,
+ NULL
+ );
return hr;
}
@@ -558,8 +548,7 @@ HRESULT SampleGrabberCB::CreateInstance(const struct tdav_producer_video_mf_s* p
{
*ppCB = new (std::nothrow) SampleGrabberCB(pcWrappedProducer);
- if (ppCB == NULL)
- {
+ if (ppCB == NULL) {
return E_OUTOFMEMORY;
}
return S_OK;
@@ -567,8 +556,7 @@ HRESULT SampleGrabberCB::CreateInstance(const struct tdav_producer_video_mf_s* p
STDMETHODIMP SampleGrabberCB::QueryInterface(REFIID riid, void** ppv)
{
- static const QITAB qit[] =
- {
+ static const QITAB qit[] = {
QITABENT(SampleGrabberCB, IMFSampleGrabberSinkCallback),
QITABENT(SampleGrabberCB, IMFClockStateSink),
{ 0 }
@@ -584,8 +572,7 @@ STDMETHODIMP_(ULONG) SampleGrabberCB::AddRef()
STDMETHODIMP_(ULONG) SampleGrabberCB::Release()
{
ULONG cRef = InterlockedDecrement(&m_cRef);
- if (cRef == 0)
- {
+ if (cRef == 0) {
delete this;
}
return cRef;
@@ -594,7 +581,7 @@ STDMETHODIMP_(ULONG) SampleGrabberCB::Release()
// IMFClockStateSink methods.
-// In these example, the IMFClockStateSink methods do not perform any actions.
+// In these example, the IMFClockStateSink methods do not perform any actions.
// You can use these methods to track the state of the sample grabber sink.
STDMETHODIMP SampleGrabberCB::OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset)
@@ -630,13 +617,12 @@ STDMETHODIMP SampleGrabberCB::OnSetPresentationClock(IMFPresentationClock* pCloc
}
STDMETHODIMP SampleGrabberCB::OnProcessSample(REFGUID guidMajorMediaType, DWORD dwSampleFlags,
- LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
- DWORD dwSampleSize)
+ LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
+ DWORD dwSampleSize)
{
- if(m_pWrappedProducer && TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback)
- {
- TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback_data, pSampleBuffer, dwSampleSize);
- }
+ if(m_pWrappedProducer && TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback) {
+ TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedProducer)->enc_cb.callback_data, pSampleBuffer, dwSampleSize);
+ }
return S_OK;
}
@@ -667,9 +653,8 @@ static HRESULT CreateTopology(IMFMediaSource *pSource, IMFActivate *pSinkActivat
CHECK_HR(hr = MFCreateTopology(&pTopology));
CHECK_HR(hr = pSource->CreatePresentationDescriptor(&pPD));
CHECK_HR(hr = pPD->GetStreamDescriptorCount(&cStreams));
-
- for (DWORD i = 0; i < cStreams; i++)
- {
+
+ for (DWORD i = 0; i < cStreams; i++) {
// In this example, we look for audio streams and connect them to the sink.
BOOL fSelected = FALSE;
@@ -679,15 +664,13 @@ static HRESULT CreateTopology(IMFMediaSource *pSource, IMFActivate *pSinkActivat
CHECK_HR(hr = pSD->GetMediaTypeHandler(&pHandler));
CHECK_HR(hr = pHandler->GetMajorType(&majorType));
- if (majorType == MFMediaType_Video && fSelected)
- {
+ if (majorType == MFMediaType_Video && fSelected) {
CHECK_HR(hr = AddSourceNode(pTopology, pSource, pPD, pSD, &pNode1));
CHECK_HR(hr = AddOutputNode(pTopology, pSinkActivate, 0, &pNode2));
CHECK_HR(hr = pNode1->ConnectOutput(0, pNode2, 0));
break;
}
- else
- {
+ else {
CHECK_HR(hr = pPD->DeselectStream(i));
}
SafeRelease(&pSD);
@@ -766,23 +749,22 @@ static HRESULT RunSession(IMFMediaSession *pSession, IMFTopology *pTopology)
PROPVARIANT var;
PropVariantInit(&var);
- MediaEventType met;
- HRESULT hrStatus = S_OK;
+ MediaEventType met;
+ HRESULT hrStatus = S_OK;
HRESULT hr = S_OK;
CHECK_HR(hr = pSession->SetTopology(0, pTopology));
CHECK_HR(hr = pSession->Start(&GUID_NULL, &var));
- // Check first event
- hr = pSession->GetEvent(MF_EVENT_FLAG_NO_WAIT, &pEvent);
- if(hr == MF_E_NO_EVENTS_AVAILABLE){
- hr = S_OK;
- goto bail;
- }
+ // Check first event
+ hr = pSession->GetEvent(MF_EVENT_FLAG_NO_WAIT, &pEvent);
+ if(hr == MF_E_NO_EVENTS_AVAILABLE) {
+ hr = S_OK;
+ goto bail;
+ }
CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
- if (FAILED(hrStatus))
- {
- CHECK_HR(hr = pEvent->GetType(&met));
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ if (FAILED(hrStatus)) {
+ CHECK_HR(hr = pEvent->GetType(&met));
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
hr = hrStatus;
goto bail;
}
@@ -794,62 +776,60 @@ bail:
// Stop session
static HRESULT StopSession(
- IMFMediaSession *pSession,
- IMFMediaSource *pSource)
+ IMFMediaSession *pSession,
+ IMFMediaSource *pSource)
{
- // MUST be source then session
- if(pSource){
- pSource->Shutdown();
- }
- if(pSession){
- pSession->Shutdown();
- }
- return S_OK;
+ // MUST be source then session
+ if(pSource) {
+ pSource->Shutdown();
+ }
+ if(pSession) {
+ pSession->Shutdown();
+ }
+ return S_OK;
}
// Pause session
static HRESULT PauseSession(
- IMFMediaSession *pSession)
+ IMFMediaSession *pSession)
{
- if(!pSession){
- return E_INVALIDARG;
- }
- return pSession->Pause();
+ if(!pSession) {
+ return E_INVALIDARG;
+ }
+ return pSession->Pause();
}
// Run session async thread
static void* TSK_STDCALL RunSessionThread(void *pArg)
{
- tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)pArg;
- HRESULT hrStatus = S_OK;
- HRESULT hr = S_OK;
- IMFMediaEvent *pEvent = NULL;
+ tdav_producer_video_mf_t *pSelf = (tdav_producer_video_mf_t *)pArg;
+ HRESULT hrStatus = S_OK;
+ HRESULT hr = S_OK;
+ IMFMediaEvent *pEvent = NULL;
MediaEventType met;
- TSK_DEBUG_INFO("RunSessionThread - ENTER");
+ TSK_DEBUG_INFO("RunSessionThread - ENTER");
- while(pSelf->bStarted){
+ while(pSelf->bStarted) {
CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
CHECK_HR(hr = pEvent->GetType(&met));
- if (FAILED(hrStatus))
- {
- TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
+ if (FAILED(hrStatus)) {
+ TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
hr = hrStatus;
goto bail;
}
- if (met == MESessionEnded)
- {
+ if (met == MESessionEnded) {
break;
}
SafeRelease(&pEvent);
- }
+ }
bail:
- TSK_DEBUG_INFO("RunSessionThread - EXIT");
+ TSK_DEBUG_INFO("RunSessionThread - EXIT");
- return NULL;
+ return NULL;
}
#endif /*HAVE_MF */
diff --git a/tinyDAV/src/video/tdav_consumer_video.c b/tinyDAV/src/video/tdav_consumer_video.c
index b7adeca..1c3c600 100755
--- a/tinyDAV/src/video/tdav_consumer_video.c
+++ b/tinyDAV/src/video/tdav_consumer_video.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,34 +39,34 @@
/** Initialize video consumer */
int tdav_consumer_video_init(tdav_consumer_video_t* self)
{
- int ret;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- /* base */
- if((ret = tmedia_consumer_init(TMEDIA_CONSUMER(self)))){
- return ret;
- }
-
- /* self (should be update by prepare() by using the codec's info)*/
- TMEDIA_CONSUMER(self)->video.fps = TDAV_VIDEO_DEFAULT_FPS;
- TMEDIA_CONSUMER(self)->video.display.width = TDAV_VIDEO_DEFAULT_WIDTH;
- TMEDIA_CONSUMER(self)->video.display.height = TDAV_VIDEO_DEFAULT_HEIGHT;
- TMEDIA_CONSUMER(self)->video.display.auto_resize = TDAV_VIDEO_DEFAULT_AUTORESIZE;
-
- /* self:jitterbuffer */
- if(!self->jitterbuffer && !(self->jitterbuffer = tmedia_jitterbuffer_create(tmedia_video))){
- // -- TSK_DEBUG_WARN("Failed to create video jitter buffer");
- }
- if(self->jitterbuffer){
- tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
- }
-
- tsk_safeobj_init(self);
-
- return 0;
+ int ret;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ /* base */
+ if((ret = tmedia_consumer_init(TMEDIA_CONSUMER(self)))) {
+ return ret;
+ }
+
+ /* self (should be update by prepare() by using the codec's info)*/
+ TMEDIA_CONSUMER(self)->video.fps = TDAV_VIDEO_DEFAULT_FPS;
+ TMEDIA_CONSUMER(self)->video.display.width = TDAV_VIDEO_DEFAULT_WIDTH;
+ TMEDIA_CONSUMER(self)->video.display.height = TDAV_VIDEO_DEFAULT_HEIGHT;
+ TMEDIA_CONSUMER(self)->video.display.auto_resize = TDAV_VIDEO_DEFAULT_AUTORESIZE;
+
+ /* self:jitterbuffer */
+ if(!self->jitterbuffer && !(self->jitterbuffer = tmedia_jitterbuffer_create(tmedia_video))) {
+ // -- TSK_DEBUG_WARN("Failed to create video jitter buffer");
+ }
+ if(self->jitterbuffer) {
+ tmedia_jitterbuffer_init(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
+ }
+
+ tsk_safeobj_init(self);
+
+ return 0;
}
/**
@@ -79,105 +79,106 @@ int tdav_consumer_video_init(tdav_consumer_video_t* self)
* >0 : @a consumer1 greater than @a consumer2.<br>
*/
int tdav_consumer_video_cmp(const tsk_object_t* consumer1, const tsk_object_t* consumer2)
-{
- int ret;
- tsk_subsat_int32_ptr(consumer1, consumer2, &ret);
- return ret;
+{
+ int ret;
+ tsk_subsat_int32_ptr(consumer1, consumer2, &ret);
+ return ret;
}
int tdav_consumer_video_set(tdav_consumer_video_t* self, const tmedia_param_t* param)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_video_put(tdav_consumer_video_t* self, const void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- const trtp_rtp_header_t* rtp_hdr = TRTP_RTP_HEADER(proto_hdr);
- int ret;
-
- if(!self || !data || !self->jitterbuffer || !rtp_hdr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if(!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened){
- uint32_t frame_duration = (1000 / TMEDIA_CONSUMER(self)->video.fps);
- static uint32_t rate = 90000;
- static uint32_t channels = 1;
- if((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channels))){
- TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
- tsk_safeobj_unlock(self);
- return ret;
- }
- }
- ret = tmedia_jitterbuffer_put(TMEDIA_JITTER_BUFFER(self->jitterbuffer), (void*)data, data_size, proto_hdr);
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ const trtp_rtp_header_t* rtp_hdr = TRTP_RTP_HEADER(proto_hdr);
+ int ret;
+
+ if(!self || !data || !self->jitterbuffer || !rtp_hdr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened) {
+ uint32_t frame_duration = (1000 / TMEDIA_CONSUMER(self)->video.fps);
+ static uint32_t rate = 90000;
+ static uint32_t channels = 1;
+ if((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channels))) {
+ TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
+ tsk_safeobj_unlock(self);
+ return ret;
+ }
+ }
+ ret = tmedia_jitterbuffer_put(TMEDIA_JITTER_BUFFER(self->jitterbuffer), (void*)data, data_size, proto_hdr);
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
/* get data drom the jitter buffer (consumers should always have ptime of 20ms) */
tsk_size_t tdav_consumer_video_get(tdav_consumer_video_t* self, void* out_data, tsk_size_t out_size)
{
- tsk_size_t ret_size = 0;
- if(!self && self->jitterbuffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_safeobj_lock(self);
-
- if(!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened){
- int ret;
- uint32_t frame_duration = (1000 / TMEDIA_CONSUMER(self)->video.fps);
- static uint32_t rate = 90000;
- static uint32_t channles = 1;
- if((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channles))){
- TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
- tsk_safeobj_unlock(self);
- return 0;
- }
- }
- ret_size = tmedia_jitterbuffer_get(TMEDIA_JITTER_BUFFER(self->jitterbuffer), out_data, out_size);
-
- tsk_safeobj_unlock(self);
-
-
-
-
- return ret_size;
+ tsk_size_t ret_size = 0;
+ if(!self && self->jitterbuffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if(!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened) {
+ int ret;
+ uint32_t frame_duration = (1000 / TMEDIA_CONSUMER(self)->video.fps);
+ static uint32_t rate = 90000;
+ static uint32_t channles = 1;
+ if((ret = tmedia_jitterbuffer_open(TMEDIA_JITTER_BUFFER(self->jitterbuffer), frame_duration, rate, channles))) {
+ TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
+ tsk_safeobj_unlock(self);
+ return 0;
+ }
+ }
+ ret_size = tmedia_jitterbuffer_get(TMEDIA_JITTER_BUFFER(self->jitterbuffer), out_data, out_size);
+
+ tsk_safeobj_unlock(self);
+
+
+
+
+ return ret_size;
}
int tdav_consumer_video_tick(tdav_consumer_video_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return tmedia_jitterbuffer_tick(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return tmedia_jitterbuffer_tick(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
}
/** Reset jitterbuffer */
-int tdav_consumer_video_reset(tdav_consumer_video_t* self){
- int ret;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- ret = tmedia_jitterbuffer_reset(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
- tsk_safeobj_unlock(self);
-
- return ret;
+int tdav_consumer_video_reset(tdav_consumer_video_t* self)
+{
+ int ret;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ ret = tmedia_jitterbuffer_reset(TMEDIA_JITTER_BUFFER(self->jitterbuffer));
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
/* tsk_safeobj_lock(self); */
@@ -186,22 +187,22 @@ int tdav_consumer_video_reset(tdav_consumer_video_t* self){
/** DeInitialize video consumer */
int tdav_consumer_video_deinit(tdav_consumer_video_t* self)
{
- int ret;
+ int ret;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* base */
- if((ret = tmedia_consumer_deinit(TMEDIA_CONSUMER(self)))){
- /* return ret; */
- }
+ /* base */
+ if((ret = tmedia_consumer_deinit(TMEDIA_CONSUMER(self)))) {
+ /* return ret; */
+ }
- /* self */
- TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
+ /* self */
+ TSK_OBJECT_SAFE_FREE(self->jitterbuffer);
- tsk_safeobj_deinit(self);
+ tsk_safeobj_deinit(self);
- return 0;
+ return 0;
} \ No newline at end of file
diff --git a/tinyDAV/src/video/tdav_converter_video.cxx b/tinyDAV/src/video/tdav_converter_video.cxx
index 2195d79..cc60b95 100755
--- a/tinyDAV/src/video/tdav_converter_video.cxx
+++ b/tinyDAV/src/video/tdav_converter_video.cxx
@@ -36,32 +36,31 @@
using namespace libyuv;
-typedef struct tdav_converter_video_libyuv_s
-{
- TMEDIA_DECLARE_CONVERTER_VIDEO;
-
- enum FourCC srcFormat;
- enum FourCC dstFormat;
-
- tsk_bool_t toI420;
- tsk_bool_t fromI420;
-
- struct{
- uint8* ptr;
- int size;
- }chroma;
- struct{
- uint8* ptr;
- int size;
- }rotate;
- struct{
- uint8* ptr;
- int size;
- }scale;
- struct{
- uint8* ptr;
- int size;
- }mirror;
+typedef struct tdav_converter_video_libyuv_s {
+ TMEDIA_DECLARE_CONVERTER_VIDEO;
+
+ enum FourCC srcFormat;
+ enum FourCC dstFormat;
+
+ tsk_bool_t toI420;
+ tsk_bool_t fromI420;
+
+ struct {
+ uint8* ptr;
+ int size;
+ } chroma;
+ struct {
+ uint8* ptr;
+ int size;
+ } rotate;
+ struct {
+ uint8* ptr;
+ int size;
+ } scale;
+ struct {
+ uint8* ptr;
+ int size;
+ } mirror;
}
tdav_converter_video_libyuv_t;
@@ -70,89 +69,88 @@ tdav_converter_video_libyuv_t;
static inline tsk_bool_t _tdav_converter_video_libyuv_is_chroma_varsize(tmedia_chroma_t chroma)
{
- return chroma == tmedia_chroma_mjpeg;
+ return chroma == tmedia_chroma_mjpeg;
}
static inline tsk_size_t _tdav_converter_video_libyuv_get_size(tmedia_chroma_t chroma, tsk_size_t w, tsk_size_t h)
{
- switch (chroma){
- case tmedia_chroma_rgb24:
- case tmedia_chroma_bgr24:
- return (w * h * 3);
- case tmedia_chroma_rgb565le:
- return ((w * h) << 1);
- case tmedia_chroma_rgb32:
- return ((w * h) << 2);
- case tmedia_chroma_nv21:
- return ((w * h * 3) >> 1);
- case tmedia_chroma_nv12:
- return ((w * h * 3) >> 1);
- case tmedia_chroma_yuv422p:
- return ((w * h) << 1);
- case tmedia_chroma_uyvy422:
- case tmedia_chroma_yuyv422:
- return ((w * h) << 1);
- case tmedia_chroma_yuv420p:
- return ((w * h * 3) >> 1);
- case tmedia_chroma_mjpeg:
- return 0;
- default:
- TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
- return 0;
- }
+ switch (chroma) {
+ case tmedia_chroma_rgb24:
+ case tmedia_chroma_bgr24:
+ return (w * h * 3);
+ case tmedia_chroma_rgb565le:
+ return ((w * h) << 1);
+ case tmedia_chroma_rgb32:
+ return ((w * h) << 2);
+ case tmedia_chroma_nv21:
+ return ((w * h * 3) >> 1);
+ case tmedia_chroma_nv12:
+ return ((w * h * 3) >> 1);
+ case tmedia_chroma_yuv422p:
+ return ((w * h) << 1);
+ case tmedia_chroma_uyvy422:
+ case tmedia_chroma_yuyv422:
+ return ((w * h) << 1);
+ case tmedia_chroma_yuv420p:
+ return ((w * h * 3) >> 1);
+ case tmedia_chroma_mjpeg:
+ return 0;
+ default:
+ TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
+ return 0;
+ }
}
static inline enum FourCC _tdav_converter_video_libyuv_get_pixfmt(tmedia_chroma_t chroma)
{
- switch (chroma){
- case tmedia_chroma_rgb24:
- case tmedia_chroma_bgr24:
- return FOURCC_24BG;
- case tmedia_chroma_rgb565le:
- return FOURCC_RGBP;
- case tmedia_chroma_rgb32:
- return FOURCC_ARGB;
- case tmedia_chroma_nv21:
- return FOURCC_NV21;
- case tmedia_chroma_nv12:
- return FOURCC_NV12;
- case tmedia_chroma_yuv422p:
- return FOURCC_I422;
- case tmedia_chroma_uyvy422:
- return FOURCC_UYVY;
- case tmedia_chroma_yuyv422:
- return FOURCC_YUY2;
- case tmedia_chroma_yuv420p:
- return FOURCC_I420;
- case tmedia_chroma_mjpeg:
- return FOURCC_MJPG;
- default:
- TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
- return FOURCC_ANY;
- }
+ switch (chroma) {
+ case tmedia_chroma_rgb24:
+ case tmedia_chroma_bgr24:
+ return FOURCC_24BG;
+ case tmedia_chroma_rgb565le:
+ return FOURCC_RGBP;
+ case tmedia_chroma_rgb32:
+ return FOURCC_ARGB;
+ case tmedia_chroma_nv21:
+ return FOURCC_NV21;
+ case tmedia_chroma_nv12:
+ return FOURCC_NV12;
+ case tmedia_chroma_yuv422p:
+ return FOURCC_I422;
+ case tmedia_chroma_uyvy422:
+ return FOURCC_UYVY;
+ case tmedia_chroma_yuyv422:
+ return FOURCC_YUY2;
+ case tmedia_chroma_yuv420p:
+ return FOURCC_I420;
+ case tmedia_chroma_mjpeg:
+ return FOURCC_MJPG;
+ default:
+ TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
+ return FOURCC_ANY;
+ }
}
static int tdav_converter_video_libyuv_init(tmedia_converter_video_t* self, tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma)
{
- TSK_DEBUG_INFO("Initializing new LibYUV Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", (int)srcWidth, (int)srcHeight, (int)srcChroma, (int)dstWidth, (int)dstHeight, (int)dstChroma);
-
- if ((TDAV_CONVERTER_VIDEO_LIBYUV(self)->srcFormat = _tdav_converter_video_libyuv_get_pixfmt(srcChroma)) == FOURCC_ANY){
- TSK_DEBUG_ERROR("Invalid source chroma");
- return -2;
- }
- if ((TDAV_CONVERTER_VIDEO_LIBYUV(self)->dstFormat = _tdav_converter_video_libyuv_get_pixfmt(dstChroma)) == FOURCC_ANY){
- TSK_DEBUG_ERROR("Invalid destination chroma");
- return -3;
- }
-
- TDAV_CONVERTER_VIDEO_LIBYUV(self)->toI420 = (TDAV_CONVERTER_VIDEO_LIBYUV(self)->dstFormat == FOURCC_I420);
- TDAV_CONVERTER_VIDEO_LIBYUV(self)->fromI420 = (TDAV_CONVERTER_VIDEO_LIBYUV(self)->srcFormat == FOURCC_I420);
- if (!TDAV_CONVERTER_VIDEO_LIBYUV(self)->toI420 && !TDAV_CONVERTER_VIDEO_LIBYUV(self)->fromI420)
- {
- TSK_DEBUG_ERROR("LIBYUV only support from/to I420");
- return -1;
- }
- return 0;
+ TSK_DEBUG_INFO("Initializing new LibYUV Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", (int)srcWidth, (int)srcHeight, (int)srcChroma, (int)dstWidth, (int)dstHeight, (int)dstChroma);
+
+ if ((TDAV_CONVERTER_VIDEO_LIBYUV(self)->srcFormat = _tdav_converter_video_libyuv_get_pixfmt(srcChroma)) == FOURCC_ANY) {
+ TSK_DEBUG_ERROR("Invalid source chroma");
+ return -2;
+ }
+ if ((TDAV_CONVERTER_VIDEO_LIBYUV(self)->dstFormat = _tdav_converter_video_libyuv_get_pixfmt(dstChroma)) == FOURCC_ANY) {
+ TSK_DEBUG_ERROR("Invalid destination chroma");
+ return -3;
+ }
+
+ TDAV_CONVERTER_VIDEO_LIBYUV(self)->toI420 = (TDAV_CONVERTER_VIDEO_LIBYUV(self)->dstFormat == FOURCC_I420);
+ TDAV_CONVERTER_VIDEO_LIBYUV(self)->fromI420 = (TDAV_CONVERTER_VIDEO_LIBYUV(self)->srcFormat == FOURCC_I420);
+ if (!TDAV_CONVERTER_VIDEO_LIBYUV(self)->toI420 && !TDAV_CONVERTER_VIDEO_LIBYUV(self)->fromI420) {
+ TSK_DEBUG_ERROR("LIBYUV only support from/to I420");
+ return -1;
+ }
+ return 0;
}
static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t* _self, const void* buffer, tsk_size_t buffer_size, void** output, tsk_size_t* output_max_size)
@@ -166,335 +164,339 @@ static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t*
} \
(curr_size) = (new_size); \
}
- static const int crop_x = 0;
- static const int crop_y = 0;
-
- int ret;
- tdav_converter_video_libyuv_t* self = TDAV_CONVERTER_VIDEO_LIBYUV(_self);
- tsk_bool_t scale = ((_self->dstWidth != _self->srcWidth) || (_self->dstHeight != _self->srcHeight));
- int s, ls, src_y_stride, src_u_stride, src_v_stride, dst_y_stride, dst_u_stride, dst_v_stride;
- int src_w, src_h, dst_w, dst_h;
- uint8 *dst_y, *dst_u, *dst_v, *src_y, *src_u, *src_v;
-
- RotationMode rotation = kRotate0;
-
- switch (_self->rotation){
- case 90: rotation = kRotate90; break;
- case 180: rotation = kRotate180; break;
- case 270: rotation = kRotate270; break;
- }
- //rotation = kRotate0;
-
- // not square and rotaion=270/90 -> requires scaling unless disabled
- if ((rotation == kRotate90 || rotation == kRotate270) && _self->scale_rotated_frames){
- scale |= (_self->dstWidth != _self->dstHeight) && (rotation == kRotate90 || rotation == kRotate270);
- }
-
- src_w = (int)_self->srcWidth, src_h = (int)_self->srcHeight;
-
- if (self->toI420) {
- tsk_size_t x_in_size;
- // check input size
- x_in_size = _tdav_converter_video_libyuv_is_chroma_varsize(_self->srcChroma) ? buffer_size : _tdav_converter_video_libyuv_get_size(_self->srcChroma, src_w, src_h);
- if (x_in_size > buffer_size) { // Ignore any extra data. For example, "CVPixelBufferGetDataSize()" will return size padded with 8 extra bytes for RGB32.
- TSK_DEBUG_ERROR("Invalid input size: %u>%u", (unsigned)x_in_size, (unsigned)buffer_size);
- return 0;
- }
-
- dst_w = src_w, dst_h = src_h; // because no scaling when converting to I420
- ls = src_w * src_h;
- s = ((ls * 3) >> 1);
- if (scale || rotation != kRotate0){
- RESIZE_BUFFER(self->chroma.ptr, self->chroma.size, s);
- dst_y = self->chroma.ptr;
- }
- else{
- RESIZE_BUFFER((*output), (*output_max_size), s);
- dst_y = (uint8*)*output;
- }
- dst_u = (dst_y + ls);
- dst_v = dst_u + (ls >> 2);
- src_y_stride = dst_y_stride = src_w;
- src_u_stride = src_v_stride = dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
-
- // convert to I420 without scaling or rotation
- ret = ConvertToI420(
- (const uint8*)buffer, (int)x_in_size,
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- crop_x, crop_y,
- (int)_self->srcWidth, (int)(_self->flip ? (_self->srcHeight * -1) : _self->srcHeight), // vertical flip
- (int)_self->srcWidth, (int)_self->srcHeight,
- kRotate0,
- (uint32)self->srcFormat);
- // mirror: horizontal flip (front camera video)
- if (_self->mirror) {
- RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
- ret = I420Mirror(
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- self->mirror.ptr, dst_y_stride,
- (self->mirror.ptr + ls), dst_u_stride,
- (self->mirror.ptr + ls + (ls >> 2)), dst_v_stride,
- (int)_self->srcWidth, (int)_self->srcHeight);
- memcpy(dst_y, self->mirror.ptr, s);
- }
-
- if (ret){
- TSK_DEBUG_ERROR("ConvertToI420 failed with error code = %d, in_size:%u", ret, x_in_size);
- return 0;
- }
-
- // rotate
- if (rotation != kRotate0){
- dst_w = (int)((rotation == kRotate90 || rotation == kRotate270) ? _self->srcHeight : _self->srcWidth);
- dst_h = (int)((rotation == kRotate90 || rotation == kRotate270) ? _self->srcWidth : _self->srcHeight);
-
- src_y = dst_y, src_u = dst_u, src_v = dst_v;
- src_y_stride = src_y_stride, src_u_stride = src_u_stride, src_v_stride = src_v_stride;
- dst_y_stride = dst_w;
- dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
-
- if (scale){
- RESIZE_BUFFER(self->rotate.ptr, self->rotate.size, s);
- dst_y = self->rotate.ptr;
- }
- else{// last step
- RESIZE_BUFFER((*output), (*output_max_size), s);
- dst_y = (uint8*)*output;
- }
-
- dst_u = (dst_y + ls);
- dst_v = dst_u + (ls >> 2);
- ret = I420Rotate(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- (int)_self->srcWidth, (int)_self->srcHeight, rotation);
- if (ret){
- TSK_DEBUG_ERROR("I420Rotate failed with error code = %d", ret);
- return 0;
- }
-
- // scale to fit ratio, pad, crop then copy
- if ((rotation == kRotate90 || rotation == kRotate270) && _self->scale_rotated_frames){
- int iwidth = (int)_self->srcHeight;
- int iheight = (int)_self->srcWidth;
-
- src_y = dst_y, src_u = dst_u, src_v = dst_v;
- src_w = dst_w, src_h = dst_h;
- src_y_stride = dst_y_stride, src_u_stride = dst_u_stride, src_v_stride = dst_v_stride;
-
- if (_self->dstWidth != _self->dstHeight) {
- if (iwidth * _self->srcHeight > iheight * _self->srcWidth) {
- iwidth = (int)((iheight * _self->srcWidth / _self->srcHeight) & ~1);
- int iwidth_offset = (int)((_self->srcHeight - iwidth) >> 1);
- src_y += iwidth_offset;
- src_u += iwidth_offset >> 1;
- src_v += iwidth_offset >> 1;
- }
- else if (iwidth * _self->srcHeight < iheight * _self->srcWidth) {
- iheight = (int)(iwidth * _self->srcHeight / _self->srcWidth);
- int iheight_offset = (int)((_self->srcWidth - iheight) >> 2);
- iheight_offset <<= 1;
- src_y += iheight_offset * src_y_stride;
- src_u += (iheight_offset >> 1) * src_u_stride;
- src_v += (iheight_offset >> 1) * src_v_stride;
- }
-
- src_w = iwidth, src_h = iheight;
- src_y_stride = src_w;
- src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
-
- dst_w = (int)_self->dstWidth;
- dst_h = (int)_self->dstHeight;
- ls = dst_w * dst_h;
- s = ((ls * 3) >> 1);
- RESIZE_BUFFER((*output), (*output_max_size), s);
- dst_y_stride = dst_w;
- dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
- uint8* dst_y = (uint8*)*output;
- uint8* dst_u = (dst_y + ls);
- uint8* dst_v = dst_u + (ls >> 2);
-
- ret = I420Scale(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- src_w, src_h,
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- dst_w, dst_h,
- kFilterBox);
- if (ret){
- TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
- return 0;
- }
- return s;
- }
- }
- }
-
- // scale
- if (scale){
- src_w = dst_w, src_h = dst_h;
- dst_w = (int)(((rotation == kRotate90 || rotation == kRotate270) && !_self->scale_rotated_frames) ? _self->dstHeight : _self->dstWidth);
- dst_h = (int)(((rotation == kRotate90 || rotation == kRotate270) && !_self->scale_rotated_frames) ? _self->dstWidth : _self->dstHeight);
- src_y = dst_y, src_u = dst_u, src_v = dst_v;
- src_y_stride = dst_y_stride, src_u_stride = dst_u_stride, src_v_stride = dst_v_stride;
- dst_y_stride = dst_w;
- dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
-
- ls = dst_w * dst_h;
- s = ((ls * 3) >> 1);
- RESIZE_BUFFER((*output), (*output_max_size), s);
- dst_y = (uint8*)*output;
- dst_u = (dst_y + ls);
- dst_v = dst_u + (ls >> 2);
-
- ret = I420Scale(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- src_w, src_h,
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- dst_w, dst_h,
- kFilterNone);
- if (ret){
- TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
- return 0;
- }
- }
-
- return ((dst_w * dst_h * 3) >> 1);
- }
- else if (self->fromI420){
- static const int dst_sample_stride = 0;
-
- dst_w = (int)_self->dstWidth, dst_h = (int)_self->dstHeight;
- src_y = (uint8*)buffer;
- src_u = (src_y + (src_w * src_h));
- src_v = (src_u + ((src_w * src_h) >> 2));
- src_y_stride = src_w;
- src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
-
- // mirror: horizontal flip (front camera video)
- if ((_self->mirror)) {
- ls = src_w * src_h;
- s = ((ls * 3) >> 1);
- if (s < (int)buffer_size) { // security check
- RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
- ret = I420Mirror(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- self->mirror.ptr, src_y_stride,
- (self->mirror.ptr + ls), src_u_stride,
- (self->mirror.ptr + ls + (ls >> 2)), src_v_stride,
- src_w, src_h);
- memcpy(src_y, self->mirror.ptr, s);
- }
- }
-
- if (scale){
- ls = dst_w * dst_h;
- s = ((ls * 3) >> 1);
-
- RESIZE_BUFFER(self->scale.ptr, self->scale.size, s);
- dst_y = self->scale.ptr;
- dst_u = (dst_y + (dst_w * dst_h));
- dst_v = (dst_u + ((dst_w * dst_h) >> 2));
- dst_y_stride = dst_w;
- dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
-
- ret = I420Scale(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- src_w, src_h,
- dst_y, dst_y_stride,
- dst_u, dst_u_stride,
- dst_v, dst_v_stride,
- dst_w, dst_h,
- kFilterNone);
-
- if (ret){
- TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
- return 0;
- }
-
- src_y = dst_y;
- src_u = (dst_y + ls);
- src_v = (dst_u + (ls >> 2));
- src_y_stride = dst_y_stride;
- src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
- }
-
- s = (int)_tdav_converter_video_libyuv_get_size(_self->dstChroma, _self->srcWidth, _self->srcHeight);
- RESIZE_BUFFER((*output), (*output_max_size), s);
-
- ret = ConvertFromI420(
- src_y, src_y_stride,
- src_u, src_u_stride,
- src_v, src_v_stride,
- (uint8*)*output, dst_sample_stride,
- (int)_self->dstWidth, (_self->flip ? ((int)_self->dstHeight * -1) : (int)_self->dstHeight), // vertical flip
- (uint32)self->dstFormat);
- if (ret){
- TSK_DEBUG_ERROR("ConvertFromI420 failed with error code = %d", ret);
- return 0;
- }
-
- return s;
- }
-
- // Must be from/to I420
- TSK_DEBUG_ERROR("Not expected code called");
- return 0;
+ static const int crop_x = 0;
+ static const int crop_y = 0;
+
+ int ret;
+ tdav_converter_video_libyuv_t* self = TDAV_CONVERTER_VIDEO_LIBYUV(_self);
+ tsk_bool_t scale = ((_self->dstWidth != _self->srcWidth) || (_self->dstHeight != _self->srcHeight));
+ int s, ls, src_y_stride, src_u_stride, src_v_stride, dst_y_stride, dst_u_stride, dst_v_stride;
+ int src_w, src_h, dst_w, dst_h;
+ uint8 *dst_y, *dst_u, *dst_v, *src_y, *src_u, *src_v;
+
+ RotationMode rotation = kRotate0;
+
+ switch (_self->rotation) {
+ case 90:
+ rotation = kRotate90;
+ break;
+ case 180:
+ rotation = kRotate180;
+ break;
+ case 270:
+ rotation = kRotate270;
+ break;
+ }
+ //rotation = kRotate0;
+
+ // not square and rotaion=270/90 -> requires scaling unless disabled
+ if ((rotation == kRotate90 || rotation == kRotate270) && _self->scale_rotated_frames) {
+ scale |= (_self->dstWidth != _self->dstHeight) && (rotation == kRotate90 || rotation == kRotate270);
+ }
+
+ src_w = (int)_self->srcWidth, src_h = (int)_self->srcHeight;
+
+ if (self->toI420) {
+ tsk_size_t x_in_size;
+ // check input size
+ x_in_size = _tdav_converter_video_libyuv_is_chroma_varsize(_self->srcChroma) ? buffer_size : _tdav_converter_video_libyuv_get_size(_self->srcChroma, src_w, src_h);
+ if (x_in_size > buffer_size) { // Ignore any extra data. For example, "CVPixelBufferGetDataSize()" will return size padded with 8 extra bytes for RGB32.
+ TSK_DEBUG_ERROR("Invalid input size: %u>%u", (unsigned)x_in_size, (unsigned)buffer_size);
+ return 0;
+ }
+
+ dst_w = src_w, dst_h = src_h; // because no scaling when converting to I420
+ ls = src_w * src_h;
+ s = ((ls * 3) >> 1);
+ if (scale || rotation != kRotate0) {
+ RESIZE_BUFFER(self->chroma.ptr, self->chroma.size, s);
+ dst_y = self->chroma.ptr;
+ }
+ else {
+ RESIZE_BUFFER((*output), (*output_max_size), s);
+ dst_y = (uint8*)*output;
+ }
+ dst_u = (dst_y + ls);
+ dst_v = dst_u + (ls >> 2);
+ src_y_stride = dst_y_stride = src_w;
+ src_u_stride = src_v_stride = dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
+
+ // convert to I420 without scaling or rotation
+ ret = ConvertToI420(
+ (const uint8*)buffer, (int)x_in_size,
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ crop_x, crop_y,
+ (int)_self->srcWidth, (int)(_self->flip ? (_self->srcHeight * -1) : _self->srcHeight), // vertical flip
+ (int)_self->srcWidth, (int)_self->srcHeight,
+ kRotate0,
+ (uint32)self->srcFormat);
+ // mirror: horizontal flip (front camera video)
+ if (_self->mirror) {
+ RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
+ ret = I420Mirror(
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ self->mirror.ptr, dst_y_stride,
+ (self->mirror.ptr + ls), dst_u_stride,
+ (self->mirror.ptr + ls + (ls >> 2)), dst_v_stride,
+ (int)_self->srcWidth, (int)_self->srcHeight);
+ memcpy(dst_y, self->mirror.ptr, s);
+ }
+
+ if (ret) {
+ TSK_DEBUG_ERROR("ConvertToI420 failed with error code = %d, in_size:%u", ret, x_in_size);
+ return 0;
+ }
+
+ // rotate
+ if (rotation != kRotate0) {
+ dst_w = (int)((rotation == kRotate90 || rotation == kRotate270) ? _self->srcHeight : _self->srcWidth);
+ dst_h = (int)((rotation == kRotate90 || rotation == kRotate270) ? _self->srcWidth : _self->srcHeight);
+
+ src_y = dst_y, src_u = dst_u, src_v = dst_v;
+ src_y_stride = src_y_stride, src_u_stride = src_u_stride, src_v_stride = src_v_stride;
+ dst_y_stride = dst_w;
+ dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
+
+ if (scale) {
+ RESIZE_BUFFER(self->rotate.ptr, self->rotate.size, s);
+ dst_y = self->rotate.ptr;
+ }
+ else { // last step
+ RESIZE_BUFFER((*output), (*output_max_size), s);
+ dst_y = (uint8*)*output;
+ }
+
+ dst_u = (dst_y + ls);
+ dst_v = dst_u + (ls >> 2);
+ ret = I420Rotate(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ (int)_self->srcWidth, (int)_self->srcHeight, rotation);
+ if (ret) {
+ TSK_DEBUG_ERROR("I420Rotate failed with error code = %d", ret);
+ return 0;
+ }
+
+ // scale to fit ratio, pad, crop then copy
+ if ((rotation == kRotate90 || rotation == kRotate270) && _self->scale_rotated_frames) {
+ int iwidth = (int)_self->srcHeight;
+ int iheight = (int)_self->srcWidth;
+
+ src_y = dst_y, src_u = dst_u, src_v = dst_v;
+ src_w = dst_w, src_h = dst_h;
+ src_y_stride = dst_y_stride, src_u_stride = dst_u_stride, src_v_stride = dst_v_stride;
+
+ if (_self->dstWidth != _self->dstHeight) {
+ if (iwidth * _self->srcHeight > iheight * _self->srcWidth) {
+ iwidth = (int)((iheight * _self->srcWidth / _self->srcHeight) & ~1);
+ int iwidth_offset = (int)((_self->srcHeight - iwidth) >> 1);
+ src_y += iwidth_offset;
+ src_u += iwidth_offset >> 1;
+ src_v += iwidth_offset >> 1;
+ }
+ else if (iwidth * _self->srcHeight < iheight * _self->srcWidth) {
+ iheight = (int)(iwidth * _self->srcHeight / _self->srcWidth);
+ int iheight_offset = (int)((_self->srcWidth - iheight) >> 2);
+ iheight_offset <<= 1;
+ src_y += iheight_offset * src_y_stride;
+ src_u += (iheight_offset >> 1) * src_u_stride;
+ src_v += (iheight_offset >> 1) * src_v_stride;
+ }
+
+ src_w = iwidth, src_h = iheight;
+ src_y_stride = src_w;
+ src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
+
+ dst_w = (int)_self->dstWidth;
+ dst_h = (int)_self->dstHeight;
+ ls = dst_w * dst_h;
+ s = ((ls * 3) >> 1);
+ RESIZE_BUFFER((*output), (*output_max_size), s);
+ dst_y_stride = dst_w;
+ dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
+ uint8* dst_y = (uint8*)*output;
+ uint8* dst_u = (dst_y + ls);
+ uint8* dst_v = dst_u + (ls >> 2);
+
+ ret = I420Scale(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ src_w, src_h,
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ dst_w, dst_h,
+ kFilterBox);
+ if (ret) {
+ TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
+ return 0;
+ }
+ return s;
+ }
+ }
+ }
+
+ // scale
+ if (scale) {
+ src_w = dst_w, src_h = dst_h;
+ dst_w = (int)(((rotation == kRotate90 || rotation == kRotate270) && !_self->scale_rotated_frames) ? _self->dstHeight : _self->dstWidth);
+ dst_h = (int)(((rotation == kRotate90 || rotation == kRotate270) && !_self->scale_rotated_frames) ? _self->dstWidth : _self->dstHeight);
+ src_y = dst_y, src_u = dst_u, src_v = dst_v;
+ src_y_stride = dst_y_stride, src_u_stride = dst_u_stride, src_v_stride = dst_v_stride;
+ dst_y_stride = dst_w;
+ dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
+
+ ls = dst_w * dst_h;
+ s = ((ls * 3) >> 1);
+ RESIZE_BUFFER((*output), (*output_max_size), s);
+ dst_y = (uint8*)*output;
+ dst_u = (dst_y + ls);
+ dst_v = dst_u + (ls >> 2);
+
+ ret = I420Scale(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ src_w, src_h,
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ dst_w, dst_h,
+ kFilterNone);
+ if (ret) {
+ TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
+ return 0;
+ }
+ }
+
+ return ((dst_w * dst_h * 3) >> 1);
+ }
+ else if (self->fromI420) {
+ static const int dst_sample_stride = 0;
+
+ dst_w = (int)_self->dstWidth, dst_h = (int)_self->dstHeight;
+ src_y = (uint8*)buffer;
+ src_u = (src_y + (src_w * src_h));
+ src_v = (src_u + ((src_w * src_h) >> 2));
+ src_y_stride = src_w;
+ src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
+
+ // mirror: horizontal flip (front camera video)
+ if ((_self->mirror)) {
+ ls = src_w * src_h;
+ s = ((ls * 3) >> 1);
+ if (s < (int)buffer_size) { // security check
+ RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
+ ret = I420Mirror(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ self->mirror.ptr, src_y_stride,
+ (self->mirror.ptr + ls), src_u_stride,
+ (self->mirror.ptr + ls + (ls >> 2)), src_v_stride,
+ src_w, src_h);
+ memcpy(src_y, self->mirror.ptr, s);
+ }
+ }
+
+ if (scale) {
+ ls = dst_w * dst_h;
+ s = ((ls * 3) >> 1);
+
+ RESIZE_BUFFER(self->scale.ptr, self->scale.size, s);
+ dst_y = self->scale.ptr;
+ dst_u = (dst_y + (dst_w * dst_h));
+ dst_v = (dst_u + ((dst_w * dst_h) >> 2));
+ dst_y_stride = dst_w;
+ dst_u_stride = dst_v_stride = ((dst_y_stride + 1) >> 1);
+
+ ret = I420Scale(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ src_w, src_h,
+ dst_y, dst_y_stride,
+ dst_u, dst_u_stride,
+ dst_v, dst_v_stride,
+ dst_w, dst_h,
+ kFilterNone);
+
+ if (ret) {
+ TSK_DEBUG_ERROR("I420Scale failed with error code = %d", ret);
+ return 0;
+ }
+
+ src_y = dst_y;
+ src_u = (dst_y + ls);
+ src_v = (dst_u + (ls >> 2));
+ src_y_stride = dst_y_stride;
+ src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
+ }
+
+ s = (int)_tdav_converter_video_libyuv_get_size(_self->dstChroma, _self->srcWidth, _self->srcHeight);
+ RESIZE_BUFFER((*output), (*output_max_size), s);
+
+ ret = ConvertFromI420(
+ src_y, src_y_stride,
+ src_u, src_u_stride,
+ src_v, src_v_stride,
+ (uint8*)*output, dst_sample_stride,
+ (int)_self->dstWidth, (_self->flip ? ((int)_self->dstHeight * -1) : (int)_self->dstHeight), // vertical flip
+ (uint32)self->dstFormat);
+ if (ret) {
+ TSK_DEBUG_ERROR("ConvertFromI420 failed with error code = %d", ret);
+ return 0;
+ }
+
+ return s;
+ }
+
+ // Must be from/to I420
+ TSK_DEBUG_ERROR("Not expected code called");
+ return 0;
}
static tsk_object_t* tdav_converter_video_libyuv_ctor(tsk_object_t * self, va_list * app)
{
- tdav_converter_video_libyuv_t *converter = (tdav_converter_video_libyuv_t *)self;
- if (converter){
+ tdav_converter_video_libyuv_t *converter = (tdav_converter_video_libyuv_t *)self;
+ if (converter) {
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tdav_converter_video_libyuv_dtor(tsk_object_t * self)
{
- tdav_converter_video_libyuv_t *converter = (tdav_converter_video_libyuv_t *)self;
- if (converter){
- TSK_FREE(converter->chroma.ptr);
- TSK_FREE(converter->rotate.ptr);
- TSK_FREE(converter->scale.ptr);
- TSK_FREE(converter->mirror.ptr);
- }
-
- return self;
+ tdav_converter_video_libyuv_t *converter = (tdav_converter_video_libyuv_t *)self;
+ if (converter) {
+ TSK_FREE(converter->chroma.ptr);
+ TSK_FREE(converter->rotate.ptr);
+ TSK_FREE(converter->scale.ptr);
+ TSK_FREE(converter->mirror.ptr);
+ }
+
+ return self;
}
-static const tsk_object_def_t tdav_converter_video_libyuv_def_s =
-{
- sizeof(tdav_converter_video_libyuv_t),
- tdav_converter_video_libyuv_ctor,
- tdav_converter_video_libyuv_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_converter_video_libyuv_def_s = {
+ sizeof(tdav_converter_video_libyuv_t),
+ tdav_converter_video_libyuv_ctor,
+ tdav_converter_video_libyuv_dtor,
+ tsk_null,
};
const tsk_object_def_t *tdav_converter_video_libyuv_def_t = &tdav_converter_video_libyuv_def_s;
-static const tmedia_converter_video_plugin_def_t tdav_converter_video_libyuv_plugin_def_s =
-{
- &tdav_converter_video_libyuv_def_s,
+static const tmedia_converter_video_plugin_def_t tdav_converter_video_libyuv_plugin_def_s = {
+ &tdav_converter_video_libyuv_def_s,
- tdav_converter_video_libyuv_init,
- tdav_converter_video_libyuv_process
+ tdav_converter_video_libyuv_init,
+ tdav_converter_video_libyuv_process
};
const tmedia_converter_video_plugin_def_t *tdav_converter_video_libyuv_plugin_def_t = &tdav_converter_video_libyuv_plugin_def_s;
@@ -516,24 +518,23 @@ extern "C" {
}
#endif
-typedef struct tdav_converter_video_ffmpeg_s
-{
- TMEDIA_DECLARE_CONVERTER_VIDEO;
+typedef struct tdav_converter_video_ffmpeg_s {
+ TMEDIA_DECLARE_CONVERTER_VIDEO;
- struct SwsContext *context;
+ struct SwsContext *context;
- enum PixelFormat srcFormat;
- enum PixelFormat dstFormat;
+ enum PixelFormat srcFormat;
+ enum PixelFormat dstFormat;
- AVFrame* srcFrame;
- AVFrame* dstFrame;
+ AVFrame* srcFrame;
+ AVFrame* dstFrame;
- struct {
- struct SwsContext *context;
- AVFrame* frame;
- uint8_t* buffer;
- tsk_size_t buffer_size;
- } rot;
+ struct {
+ struct SwsContext *context;
+ AVFrame* frame;
+ uint8_t* buffer;
+ tsk_size_t buffer_size;
+ } rot;
}
tdav_converter_video_ffmpeg_t;
@@ -563,207 +564,207 @@ tdav_converter_video_ffmpeg_t;
static inline enum PixelFormat _tdav_converter_video_ffmpeg_get_pixfmt(tmedia_chroma_t chroma)
{
- switch(chroma){
- case tmedia_chroma_rgb24:
- return PIX_FMT_RGB24;
- case tmedia_chroma_bgr24:
- return PIX_FMT_BGR24;
- case tmedia_chroma_rgb32:
- return PIX_FMT_RGB32;
- case tmedia_chroma_rgb565le:
- return PIX_FMT_RGB565LE;
- case tmedia_chroma_rgb565be:
- return PIX_FMT_RGB565BE;
- case tmedia_chroma_nv21:
- return PIX_FMT_NV21;
- case tmedia_chroma_nv12:
- return PIX_FMT_NV12;
- case tmedia_chroma_yuv422p:
- return PIX_FMT_YUV422P;
- case tmedia_chroma_uyvy422:
- return PIX_FMT_UYVY422;
- case tmedia_chroma_yuyv422:
- return PIX_FMT_YUYV422;
- case tmedia_chroma_yuv420p:
- return PIX_FMT_YUV420P;
- default:
- TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
- return PIX_FMT_NONE;
- }
+ switch(chroma) {
+ case tmedia_chroma_rgb24:
+ return PIX_FMT_RGB24;
+ case tmedia_chroma_bgr24:
+ return PIX_FMT_BGR24;
+ case tmedia_chroma_rgb32:
+ return PIX_FMT_RGB32;
+ case tmedia_chroma_rgb565le:
+ return PIX_FMT_RGB565LE;
+ case tmedia_chroma_rgb565be:
+ return PIX_FMT_RGB565BE;
+ case tmedia_chroma_nv21:
+ return PIX_FMT_NV21;
+ case tmedia_chroma_nv12:
+ return PIX_FMT_NV12;
+ case tmedia_chroma_yuv422p:
+ return PIX_FMT_YUV422P;
+ case tmedia_chroma_uyvy422:
+ return PIX_FMT_UYVY422;
+ case tmedia_chroma_yuyv422:
+ return PIX_FMT_YUYV422;
+ case tmedia_chroma_yuv420p:
+ return PIX_FMT_YUV420P;
+ default:
+ TSK_DEBUG_ERROR("Invalid chroma %d", (int)chroma);
+ return PIX_FMT_NONE;
+ }
}
static int tdav_converter_video_ffmpeg_init(tmedia_converter_video_t* self, tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma)
{
- TSK_DEBUG_INFO("Initializing new FFmpeg Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma);
-
- if((TDAV_CONVERTER_VIDEO_FFMPEG(self)->srcFormat = _tdav_converter_video_ffmpeg_get_pixfmt(srcChroma)) == PIX_FMT_NONE){
- TSK_DEBUG_ERROR("Invalid source chroma");
- return -2;
- }
- if((TDAV_CONVERTER_VIDEO_FFMPEG(self)->dstFormat = _tdav_converter_video_ffmpeg_get_pixfmt(dstChroma)) == PIX_FMT_NONE){
- TSK_DEBUG_ERROR("Invalid destination chroma");
- return -3;
- }
-
- return 0;
+ TSK_DEBUG_INFO("Initializing new FFmpeg Video Converter src=(%dx%d@%d) dst=(%dx%d@%d)", srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma);
+
+ if((TDAV_CONVERTER_VIDEO_FFMPEG(self)->srcFormat = _tdav_converter_video_ffmpeg_get_pixfmt(srcChroma)) == PIX_FMT_NONE) {
+ TSK_DEBUG_ERROR("Invalid source chroma");
+ return -2;
+ }
+ if((TDAV_CONVERTER_VIDEO_FFMPEG(self)->dstFormat = _tdav_converter_video_ffmpeg_get_pixfmt(dstChroma)) == PIX_FMT_NONE) {
+ TSK_DEBUG_ERROR("Invalid destination chroma");
+ return -3;
+ }
+
+ return 0;
}
static tsk_size_t tdav_converter_video_ffmpeg_process(tmedia_converter_video_t* _self, const void* buffer, tsk_size_t buffer_size, void** output, tsk_size_t* output_max_size)
{
- int ret, size;
- tsk_bool_t _rotate = tsk_false;
- tdav_converter_video_ffmpeg_t* self = TDAV_CONVERTER_VIDEO_FFMPEG(_self);
-
- if (!self || !buffer || !output){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* Pictures */
- if (!self->srcFrame){
- if (!(self->srcFrame = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create picture");
- return 0;
- }
- }
- if (!self->dstFrame){
- if (!(self->dstFrame = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("Failed to create picture");
- return 0;
- }
- }
-
- size = avpicture_get_size(self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight);
- if ((int)*output_max_size < size){
- if (!(*output = tsk_realloc(*output, (size + FF_INPUT_BUFFER_PADDING_SIZE)))){
- *output_max_size = 0;
- TSK_DEBUG_ERROR("Failed to allocate buffer");
- return 0;
- }
- *output_max_size = size;
- }
-
- /* Wrap the source buffer */
- ret = avpicture_fill((AVPicture *)self->srcFrame, (uint8_t*)buffer, self->srcFormat, (int)_self->srcWidth, (int)_self->srcHeight);
- /* Wrap the destination buffer */
- ret = avpicture_fill((AVPicture *)self->dstFrame, (uint8_t*)*output, self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight);
-
- /* === performs conversion === */
- /* Context */
- if (!self->context) {
- self->context = sws_getContext(
- (int)_self->srcWidth, (int)_self->srcHeight, self->srcFormat,
- (int)_self->dstWidth, (int)_self->dstHeight, self->dstFormat,
- SWS_FAST_BILINEAR, NULL, NULL, NULL);
-
- if (!self->context) {
- TSK_DEBUG_ERROR("Failed to create context");
- return 0;
- }
- }
-
- /*FIXME: For now only 90\B0 rotation is supported this is why we always use libyuv on mobile devices */
- _rotate = (PIX_FMT_YUV420P == self->dstFormat) && _self->rotation == 90;
-
- // if no rotation then, flip while scaling othersize do it after rotation
- if (!_rotate && _self->flip) {
- _tdav_converter_video_ffmpeg_flip(self->dstFrame, _self->dstHeight);
- }
-
- // chroma conversion and scaling
- ret = sws_scale(self->context, (const uint8_t* const*)self->srcFrame->data, self->srcFrame->linesize, 0, (int)_self->srcHeight,
- self->dstFrame->data, self->dstFrame->linesize);
- if (ret < 0){
- TSK_FREE(*output);
- return 0;
- }
-
- // Rotation
- if (_rotate){
- // because we rotated 90 width = original height, height = original width
- int w = (int)_self->dstHeight;
- int h = (int)_self->dstWidth;
-
- // allocation rotation frame if not already done
- if (!(self->rot.frame) && !(self->rot.frame = avcodec_alloc_frame())){
- TSK_DEBUG_ERROR("failed to allocate rotation frame");
- TSK_FREE(*output);
- return(0);
- }
-
- // allocate rotation temporary buffer
- size = avpicture_get_size(self->dstFormat, w, h);
- if (self->rot.buffer_size != size){
- if (!(self->rot.buffer = (uint8_t *)av_realloc(self->rot.buffer, size))){
- TSK_DEBUG_ERROR("failed to allocate new buffer for the frame");
- self->rot.buffer_size = 0;
- return(0);
- }
- self->rot.buffer_size = size;
- }
-
- //wrap
- avpicture_fill((AVPicture *)self->rot.frame, self->rot.buffer, self->dstFormat, w, h);
- // rotate
- _tdav_converter_video_ffmpeg_rotate90(_self->dstWidth, _self->dstHeight, self->dstFrame->data[0], self->rot.frame->data[0]);
- _tdav_converter_video_ffmpeg_rotate90((_self->dstWidth >> 1), (_self->dstHeight >> 1), self->dstFrame->data[1], self->rot.frame->data[1]);
- _tdav_converter_video_ffmpeg_rotate90((_self->dstWidth >> 1), (_self->dstHeight >> 1), self->dstFrame->data[2], self->rot.frame->data[2]);
- // flip
- if (_self->flip){
- _tdav_converter_video_ffmpeg_flip(self->rot.frame, h);
- }
-
- {
- static const int y_shift = 1;
- static const int x_shift = 1;
- int r_size, r_w, r_h, left_band, top_band;
- int pad = ((int)_self->dstWidth - w) > ((int)_self->dstHeight - h) ? ((int)_self->dstWidth - w) : ((int)_self->dstHeight - h);
- if (pad < 0){
- pad = 0;
- }
- r_size;
- r_w = w + pad;
- r_h = h + pad;
- left_band = (int)((r_w - _self->dstWidth) / 2);
- top_band = (int)((r_h - _self->dstHeight) / 3);
-
- if (!self->rot.context){
- if (!(self->rot.context = sws_getContext(w, h, self->dstFormat, r_w, r_h, self->dstFormat, SWS_FAST_BILINEAR, NULL, NULL, NULL))){
- TSK_DEBUG_ERROR("Failed to create context");
- TSK_FREE(*output);
- return 0;
- }
- }
-
- r_size = avpicture_get_size(self->dstFormat, r_w, r_h);
- if ((int)*output_max_size < r_size){
- if (!(*output = tsk_realloc(*output, (r_size + FF_INPUT_BUFFER_PADDING_SIZE)))){
- *output_max_size = 0;
- TSK_DEBUG_ERROR("Failed to allocate buffer");
- return 0;
- }
- *output_max_size = r_size;
- }
-
- // re-wrap
- avpicture_fill((AVPicture *)self->dstFrame, (uint8_t*)*output, self->dstFormat, r_w, r_h);
-
- // pad
- sws_scale(self->rot.context, (const uint8_t* const*)self->rot.frame->data, self->rot.frame->linesize,
- 0, h, self->dstFrame->data, self->dstFrame->linesize);
-
- // crop
- self->dstFrame->data[0] = self->dstFrame->data[0] + (top_band * self->dstFrame->linesize[0]) + left_band;
- self->dstFrame->data[1] = self->dstFrame->data[1] + ((top_band >> y_shift) * self->dstFrame->linesize[1]) + (left_band >> x_shift);
- self->dstFrame->data[2] = self->dstFrame->data[2] + ((top_band >> y_shift) * self->dstFrame->linesize[2]) + (left_band >> x_shift);
-
- avpicture_layout((const AVPicture*)self->dstFrame, self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight, (unsigned char *)*output, (int)*output_max_size);
- }
-
- }//end of rotation
-
- return size;
+ int ret, size;
+ tsk_bool_t _rotate = tsk_false;
+ tdav_converter_video_ffmpeg_t* self = TDAV_CONVERTER_VIDEO_FFMPEG(_self);
+
+ if (!self || !buffer || !output) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* Pictures */
+ if (!self->srcFrame) {
+ if (!(self->srcFrame = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create picture");
+ return 0;
+ }
+ }
+ if (!self->dstFrame) {
+ if (!(self->dstFrame = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("Failed to create picture");
+ return 0;
+ }
+ }
+
+ size = avpicture_get_size(self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight);
+ if ((int)*output_max_size < size) {
+ if (!(*output = tsk_realloc(*output, (size + FF_INPUT_BUFFER_PADDING_SIZE)))) {
+ *output_max_size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate buffer");
+ return 0;
+ }
+ *output_max_size = size;
+ }
+
+ /* Wrap the source buffer */
+ ret = avpicture_fill((AVPicture *)self->srcFrame, (uint8_t*)buffer, self->srcFormat, (int)_self->srcWidth, (int)_self->srcHeight);
+ /* Wrap the destination buffer */
+ ret = avpicture_fill((AVPicture *)self->dstFrame, (uint8_t*)*output, self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight);
+
+ /* === performs conversion === */
+ /* Context */
+ if (!self->context) {
+ self->context = sws_getContext(
+ (int)_self->srcWidth, (int)_self->srcHeight, self->srcFormat,
+ (int)_self->dstWidth, (int)_self->dstHeight, self->dstFormat,
+ SWS_FAST_BILINEAR, NULL, NULL, NULL);
+
+ if (!self->context) {
+ TSK_DEBUG_ERROR("Failed to create context");
+ return 0;
+ }
+ }
+
+ /*FIXME: For now only 90\B0 rotation is supported this is why we always use libyuv on mobile devices */
+ _rotate = (PIX_FMT_YUV420P == self->dstFormat) && _self->rotation == 90;
+
+ // if no rotation then, flip while scaling othersize do it after rotation
+ if (!_rotate && _self->flip) {
+ _tdav_converter_video_ffmpeg_flip(self->dstFrame, _self->dstHeight);
+ }
+
+ // chroma conversion and scaling
+ ret = sws_scale(self->context, (const uint8_t* const*)self->srcFrame->data, self->srcFrame->linesize, 0, (int)_self->srcHeight,
+ self->dstFrame->data, self->dstFrame->linesize);
+ if (ret < 0) {
+ TSK_FREE(*output);
+ return 0;
+ }
+
+ // Rotation
+ if (_rotate) {
+ // because we rotated 90 width = original height, height = original width
+ int w = (int)_self->dstHeight;
+ int h = (int)_self->dstWidth;
+
+ // allocation rotation frame if not already done
+ if (!(self->rot.frame) && !(self->rot.frame = avcodec_alloc_frame())) {
+ TSK_DEBUG_ERROR("failed to allocate rotation frame");
+ TSK_FREE(*output);
+ return(0);
+ }
+
+ // allocate rotation temporary buffer
+ size = avpicture_get_size(self->dstFormat, w, h);
+ if (self->rot.buffer_size != size) {
+ if (!(self->rot.buffer = (uint8_t *)av_realloc(self->rot.buffer, size))) {
+ TSK_DEBUG_ERROR("failed to allocate new buffer for the frame");
+ self->rot.buffer_size = 0;
+ return(0);
+ }
+ self->rot.buffer_size = size;
+ }
+
+ //wrap
+ avpicture_fill((AVPicture *)self->rot.frame, self->rot.buffer, self->dstFormat, w, h);
+ // rotate
+ _tdav_converter_video_ffmpeg_rotate90(_self->dstWidth, _self->dstHeight, self->dstFrame->data[0], self->rot.frame->data[0]);
+ _tdav_converter_video_ffmpeg_rotate90((_self->dstWidth >> 1), (_self->dstHeight >> 1), self->dstFrame->data[1], self->rot.frame->data[1]);
+ _tdav_converter_video_ffmpeg_rotate90((_self->dstWidth >> 1), (_self->dstHeight >> 1), self->dstFrame->data[2], self->rot.frame->data[2]);
+ // flip
+ if (_self->flip) {
+ _tdav_converter_video_ffmpeg_flip(self->rot.frame, h);
+ }
+
+ {
+ static const int y_shift = 1;
+ static const int x_shift = 1;
+ int r_size, r_w, r_h, left_band, top_band;
+ int pad = ((int)_self->dstWidth - w) > ((int)_self->dstHeight - h) ? ((int)_self->dstWidth - w) : ((int)_self->dstHeight - h);
+ if (pad < 0) {
+ pad = 0;
+ }
+ r_size;
+ r_w = w + pad;
+ r_h = h + pad;
+ left_band = (int)((r_w - _self->dstWidth) / 2);
+ top_band = (int)((r_h - _self->dstHeight) / 3);
+
+ if (!self->rot.context) {
+ if (!(self->rot.context = sws_getContext(w, h, self->dstFormat, r_w, r_h, self->dstFormat, SWS_FAST_BILINEAR, NULL, NULL, NULL))) {
+ TSK_DEBUG_ERROR("Failed to create context");
+ TSK_FREE(*output);
+ return 0;
+ }
+ }
+
+ r_size = avpicture_get_size(self->dstFormat, r_w, r_h);
+ if ((int)*output_max_size < r_size) {
+ if (!(*output = tsk_realloc(*output, (r_size + FF_INPUT_BUFFER_PADDING_SIZE)))) {
+ *output_max_size = 0;
+ TSK_DEBUG_ERROR("Failed to allocate buffer");
+ return 0;
+ }
+ *output_max_size = r_size;
+ }
+
+ // re-wrap
+ avpicture_fill((AVPicture *)self->dstFrame, (uint8_t*)*output, self->dstFormat, r_w, r_h);
+
+ // pad
+ sws_scale(self->rot.context, (const uint8_t* const*)self->rot.frame->data, self->rot.frame->linesize,
+ 0, h, self->dstFrame->data, self->dstFrame->linesize);
+
+ // crop
+ self->dstFrame->data[0] = self->dstFrame->data[0] + (top_band * self->dstFrame->linesize[0]) + left_band;
+ self->dstFrame->data[1] = self->dstFrame->data[1] + ((top_band >> y_shift) * self->dstFrame->linesize[1]) + (left_band >> x_shift);
+ self->dstFrame->data[2] = self->dstFrame->data[2] + ((top_band >> y_shift) * self->dstFrame->linesize[2]) + (left_band >> x_shift);
+
+ avpicture_layout((const AVPicture*)self->dstFrame, self->dstFormat, (int)_self->dstWidth, (int)_self->dstHeight, (unsigned char *)*output, (int)*output_max_size);
+ }
+
+ }//end of rotation
+
+ return size;
}
@@ -773,58 +774,56 @@ static tsk_size_t tdav_converter_video_ffmpeg_process(tmedia_converter_video_t*
//
static tsk_object_t* tdav_converter_video_ffmpeg_ctor(tsk_object_t * self, va_list * app)
{
- tdav_converter_video_ffmpeg_t *converter = (tdav_converter_video_ffmpeg_t *)self;
- if(converter){
+ tdav_converter_video_ffmpeg_t *converter = (tdav_converter_video_ffmpeg_t *)self;
+ if(converter) {
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tdav_converter_video_ffmpeg_dtor(tsk_object_t * self)
-{
- tdav_converter_video_ffmpeg_t *converter = (tdav_converter_video_ffmpeg_t *)self;
- if(converter){
- if(converter->context){
- sws_freeContext(converter->context);
- }
- if(converter->srcFrame){
- av_free(converter->srcFrame);
- }
- if(converter->dstFrame){
- av_free(converter->dstFrame);
- }
-
- // Rotation
- if(converter->rot.context){
- sws_freeContext(converter->rot.context);
- }
- if(converter->rot.frame){
- av_free(converter->rot.frame);
- }
- if(converter->rot.buffer){
- av_free(converter->rot.buffer);
- }
- }
-
- return self;
+{
+ tdav_converter_video_ffmpeg_t *converter = (tdav_converter_video_ffmpeg_t *)self;
+ if(converter) {
+ if(converter->context) {
+ sws_freeContext(converter->context);
+ }
+ if(converter->srcFrame) {
+ av_free(converter->srcFrame);
+ }
+ if(converter->dstFrame) {
+ av_free(converter->dstFrame);
+ }
+
+ // Rotation
+ if(converter->rot.context) {
+ sws_freeContext(converter->rot.context);
+ }
+ if(converter->rot.frame) {
+ av_free(converter->rot.frame);
+ }
+ if(converter->rot.buffer) {
+ av_free(converter->rot.buffer);
+ }
+ }
+
+ return self;
}
-static const tsk_object_def_t tdav_converter_video_ffmpeg_def_s =
-{
- sizeof(tdav_converter_video_ffmpeg_t),
- tdav_converter_video_ffmpeg_ctor,
- tdav_converter_video_ffmpeg_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_converter_video_ffmpeg_def_s = {
+ sizeof(tdav_converter_video_ffmpeg_t),
+ tdav_converter_video_ffmpeg_ctor,
+ tdav_converter_video_ffmpeg_dtor,
+ tsk_null,
};
const tsk_object_def_t *tdav_converter_video_ffmpeg_def_t = &tdav_converter_video_ffmpeg_def_s;
/* plugin definition*/
-static const tmedia_converter_video_plugin_def_t tdav_converter_video_ffmpeg_plugin_def_s =
-{
- &tdav_converter_video_ffmpeg_def_s,
+static const tmedia_converter_video_plugin_def_t tdav_converter_video_ffmpeg_plugin_def_s = {
+ &tdav_converter_video_ffmpeg_def_s,
- tdav_converter_video_ffmpeg_init,
- tdav_converter_video_ffmpeg_process
+ tdav_converter_video_ffmpeg_init,
+ tdav_converter_video_ffmpeg_process
};
const tmedia_converter_video_plugin_def_t *tdav_converter_video_ffmpeg_plugin_def_t = &tdav_converter_video_ffmpeg_plugin_def_s;
diff --git a/tinyDAV/src/video/tdav_runnable_video.c b/tinyDAV/src/video/tdav_runnable_video.c
index c8102ea..cacc2f2 100755
--- a/tinyDAV/src/video/tdav_runnable_video.c
+++ b/tinyDAV/src/video/tdav_runnable_video.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,33 +33,33 @@
tdav_runnable_video_t* tdav_runnable_video_create(tsk_runnable_func_run run_f, const void* userdata)
{
- tdav_runnable_video_t* runnable;
+ tdav_runnable_video_t* runnable;
- if((runnable = tsk_object_new(tdav_runnable_video_def_t))){
- TSK_RUNNABLE(runnable)->run = run_f;
- runnable->userdata = userdata;
- }
- return runnable;
+ if((runnable = tsk_object_new(tdav_runnable_video_def_t))) {
+ TSK_RUNNABLE(runnable)->run = run_f;
+ runnable->userdata = userdata;
+ }
+ return runnable;
}
int tdav_runnable_video_start(tdav_runnable_video_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tsk_runnable_start(TSK_RUNNABLE(self), tsk_buffer_def_t);
+ return tsk_runnable_start(TSK_RUNNABLE(self), tsk_buffer_def_t);
}
int tdav_runnable_video_stop(tdav_runnable_video_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tsk_runnable_stop(TSK_RUNNABLE(self));
+ return tsk_runnable_stop(TSK_RUNNABLE(self));
}
@@ -68,28 +68,27 @@ int tdav_runnable_video_stop(tdav_runnable_video_t* self)
//
static tsk_object_t* tdav_runnable_video_ctor(tsk_object_t * self, va_list * app)
{
- tdav_runnable_video_t *runnable = self;
- if(runnable){
-
- }
- return self;
+ tdav_runnable_video_t *runnable = self;
+ if(runnable) {
+
+ }
+ return self;
}
static tsk_object_t* tdav_runnable_video_dtor(tsk_object_t * self)
-{
- tdav_runnable_video_t *runnable = self;
- if(runnable){
- tsk_runnable_stop(TSK_RUNNABLE(runnable));
- }
+{
+ tdav_runnable_video_t *runnable = self;
+ if(runnable) {
+ tsk_runnable_stop(TSK_RUNNABLE(runnable));
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tdav_runnable_video_def_s =
-{
- sizeof(tdav_runnable_video_t),
- tdav_runnable_video_ctor,
- tdav_runnable_video_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_runnable_video_def_s = {
+ sizeof(tdav_runnable_video_t),
+ tdav_runnable_video_ctor,
+ tdav_runnable_video_dtor,
+ tsk_null,
};
const tsk_object_def_t *tdav_runnable_video_def_t = &tdav_runnable_video_def_s;
diff --git a/tinyDAV/src/video/tdav_session_video.c b/tinyDAV/src/video/tdav_session_video.c
index 4ee6812..f773ede 100755
--- a/tinyDAV/src/video/tdav_session_video.c
+++ b/tinyDAV/src/video/tdav_session_video.c
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2010-2014 Mamadou DIOP.
- * Copyright (C) 2011-2014 Doubango Telecom.
+ * Copyright (C) 2010-2016 Mamadou DIOP.
+ * Copyright (C) 2011-2016 Doubango Telecom.
*
*
* This file is part of Open Source Doubango Framework.
@@ -62,25 +62,12 @@
# define TDAV_SESSION_VIDEO_AVPF_FIR_REQUEST_INTERVAL_MIN 1500 // millis
#endif
-#define TDAV_SESSION_VIDEO_PKT_LOSS_PROB_BAD 2
-#define TDAV_SESSION_VIDEO_PKT_LOSS_PROB_GOOD 6
-#define TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MIN 0
-#define TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MAX 8
-#define TDAV_SESSION_VIDEO_PKT_LOSS_LOW 9
-#define TDAV_SESSION_VIDEO_PKT_LOSS_MEDIUM 22
-#define TDAV_SESSION_VIDEO_PKT_LOSS_HIGH 63
-
-#if !defined(TDAV_SESSION_VIDEO_PKT_LOSS_NO_REPORT_BEFORE_INCREASING_BW)
-# define TDAV_SESSION_VIDEO_PKT_LOSS_NO_REPORT_BEFORE_INCREASING_BW 5000 // millis
-#endif
+// Interval to compute average quality metrics
+#define TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL 3000
// The maximum number of pakcet loss allowed
#define TDAV_SESSION_VIDEO_PKT_LOSS_MAX_COUNT_TO_REQUEST_FIR 50
-#if !defined (TDAV_GOOG_REMB_FULL_SUPPORT)
-# define TDAV_GOOG_REMB_FULL_SUPPORT 0
-#endif
-
static const tmedia_codec_action_t __action_encode_idr = tmedia_codec_action_encode_idr;
static const tmedia_codec_action_t __action_encode_bw_up = tmedia_codec_action_bw_up;
static const tmedia_codec_action_t __action_encode_bw_down = tmedia_codec_action_bw_down;
@@ -150,6 +137,9 @@ static int _tdav_session_video_jb_cb(const tdav_video_jb_cb_data_xt* data);
static int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload_type);
static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp_packet_t* packet);
static int _tdav_session_video_set_callbacks(tmedia_session_t* self);
+static int _tdav_session_video_timer_cb(const void* arg, tsk_timer_id_t timer_id);
+static int _tdav_session_video_get_bw_usage_est(tdav_session_video_t* self, uint64_t* bw_kbps, tsk_bool_t in, tsk_bool_t reset);
+static int _tdav_session_video_report_bw_usage_and_jcng(tdav_session_video_t* self);
// Codec callback (From codec to the network)
// or Producer callback to sendRaw() data "as is"
@@ -161,22 +151,22 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
trtp_rtp_packet_t* packet = tsk_null;
int ret = 0;
tsk_size_t s;
-
- if(base->rtp_manager && base->rtp_manager->is_started){
- if(rtp_header){
+
+ if(base->rtp_manager && base->rtp_manager->is_started) {
+ if(rtp_header) {
// uses negotiated SSRC (SDP)
rtp_header->ssrc = base->rtp_manager->rtp.ssrc.local;
// uses negotiated payload type
- if(base->pt_map.local != base->rtp_manager->rtp.payload_type || base->pt_map.remote != rtp_header->payload_type || base->pt_map.neg == -1){
- if(rtp_header->codec_id == tmedia_codec_id_none){
+ if(base->pt_map.local != base->rtp_manager->rtp.payload_type || base->pt_map.remote != rtp_header->payload_type || base->pt_map.neg == -1) {
+ if(rtp_header->codec_id == tmedia_codec_id_none) {
TSK_DEBUG_WARN("Internal codec id is equal to none");
}
- else{
+ else {
const tsk_list_item_t* item;
tsk_bool_t found = tsk_false;
tsk_list_lock(TMEDIA_SESSION(base)->neg_codecs);
- tsk_list_foreach(item, TMEDIA_SESSION(base)->neg_codecs){
- if((item->data) && ((const tmedia_codec_t*)item->data)->id == rtp_header->codec_id){
+ tsk_list_foreach(item, TMEDIA_SESSION(base)->neg_codecs) {
+ if((item->data) && ((const tmedia_codec_t*)item->data)->id == rtp_header->codec_id) {
base->pt_map.local = base->rtp_manager->rtp.payload_type;
base->pt_map.remote = rtp_header->payload_type;
base->pt_map.neg = atoi(((const tmedia_codec_t*)item->data)->neg_format);
@@ -185,10 +175,10 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
}
}
tsk_list_unlock(TMEDIA_SESSION(base)->neg_codecs);
- if(found){
+ if(found) {
TSK_DEBUG_INFO("Codec PT mapping: local=%d, remote=%d, neg=%d", base->pt_map.local, base->pt_map.remote, base->pt_map.neg);
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to map codec PT: local=%d, remote=%d", base->rtp_manager->rtp.payload_type, rtp_header->payload_type);
}
}
@@ -196,12 +186,12 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
rtp_header->payload_type = base->pt_map.neg;
}
packet = rtp_header
- ? trtp_rtp_packet_create_2(rtp_header)
- : trtp_rtp_packet_create(base->rtp_manager->rtp.ssrc.local, base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, base->rtp_manager->rtp.payload_type, result->last_chunck);
-
- if(packet ){
+ ? trtp_rtp_packet_create_2(rtp_header)
+ : trtp_rtp_packet_create(base->rtp_manager->rtp.ssrc.local, base->rtp_manager->rtp.seq_num, base->rtp_manager->rtp.timestamp, base->rtp_manager->rtp.payload_type, result->last_chunck);
+
+ if(packet ) {
tsk_size_t rtp_hdr_size;
- if(result->last_chunck){
+ if(result->last_chunck) {
#if 1
#if 1
/* http://www.cs.columbia.edu/~hgs/rtp/faq.html#timestamp-computed
@@ -210,14 +200,14 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
If a frame is transmitted as several RTP packets, these packets would all bear the same timestamp.
If the frame number cannot be determined or if frames are sampled aperiodically, as is typically the case for software codecs, the timestamp has to be computed from the system clock (e.g., gettimeofday())
*/
-
- if(!video->encoder.last_frame_time){
+
+ if(!video->encoder.last_frame_time) {
// For the first frame it's not possible to compute the duration as there is no previous one.
// In this case, we trust the duration from the result (computed based on the codec fps and rate).
video->encoder.last_frame_time = tsk_time_now();
base->rtp_manager->rtp.timestamp += result->duration;
}
- else{
+ else {
uint64_t now = tsk_time_now();
uint32_t duration = (uint32_t)(now - video->encoder.last_frame_time);
base->rtp_manager->rtp.timestamp += (duration * 90/* 90KHz */);
@@ -229,9 +219,9 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
#else
base->rtp_manager->rtp.timestamp += result->duration;
#endif
-
+
}
-
+
packet->payload.data_const = result->buffer.ptr;
packet->payload.size = result->buffer.size;
s = trtp_manager_send_rtp_packet(base->rtp_manager, packet, tsk_false); // encrypt and send data
@@ -240,14 +230,14 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
// without audio session iOS "audio" background mode is useless and UDP sockets will be closed: e.g. GE's video-only sessions
#if TDAV_UNDER_IPHONE
if (tnet_geterrno() == TNET_ERROR_BROKENPIPE) {
- TSK_DEBUG_INFO("iOS UDP pipe is broken (restoration is progress): failed to send packet with seqnum=%u. %u expected but only %u sent", (unsigned)packet->header->seq_num, (unsigned)packet->payload.size, (unsigned)s);
+ TSK_DEBUG_INFO("iOS UDP pipe is broken (restoration in progress): failed to send packet with seqnum=%u. %u expected but only %u sent", (unsigned)packet->header->seq_num, (unsigned)packet->payload.size, (unsigned)s);
}
#endif /* TDAV_UNDER_IPHONE */
TSK_DEBUG_ERROR("Failed to send packet with seqnum=%u. %u expected but only %u sent", (unsigned)packet->header->seq_num, (unsigned)packet->payload.size, (unsigned)s);
// save data expected to be sent in order to honor RTCP-NACK requests
s = base->rtp_manager->rtp.serial_buffer.index;
}
-
+
rtp_hdr_size = TRTP_RTP_HEADER_MIN_SIZE + (packet->header->csrc_count << 2);
// Save packet
if (base->avpf_mode_neg && (s > TRTP_RTP_HEADER_MIN_SIZE)) {
@@ -256,19 +246,19 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
// Hack the RTP packet payload to point to the the SRTP data instead of unencrypted ptr
packet_avpf->payload.size = (s - rtp_hdr_size);
packet_avpf->payload.data_const = tsk_null;
- if(!(packet_avpf->payload.data = tsk_malloc(packet_avpf->payload.size))){// FIXME: to be optimized (reuse memory address)
+ if(!(packet_avpf->payload.data = tsk_malloc(packet_avpf->payload.size))) { // FIXME: to be optimized (reuse memory address)
TSK_DEBUG_ERROR("failed to allocate buffer");
goto bail;
}
memcpy(packet_avpf->payload.data, (((const uint8_t*)base->rtp_manager->rtp.serial_buffer.ptr) + rtp_hdr_size), packet_avpf->payload.size);
tsk_list_lock(video->avpf.packets);
- if(video->avpf.count > video->avpf.max){
+ if(video->avpf.count > video->avpf.max) {
tsk_list_remove_first_item(video->avpf.packets);
}
- else{
+ else {
++video->avpf.count;
}
-
+
// The packet must not added 'ascending' but 'back' because the sequence number coult wrap
// For example:
// - send(65533, 65534, 65535, 0, 1)
@@ -278,19 +268,19 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
tsk_list_push_back_data(video->avpf.packets, (void**)&packet_avpf);
tsk_list_unlock(video->avpf.packets);
}
-
+
// Send FEC packet
// FIXME: protect only Intra and Params packets
- if(base->ulpfec.codec && (s > TRTP_RTP_HEADER_MIN_SIZE)){
+ if(base->ulpfec.codec && (s > TRTP_RTP_HEADER_MIN_SIZE)) {
packet->payload.data_const = (((const uint8_t*)base->rtp_manager->rtp.serial_buffer.ptr) + rtp_hdr_size);
packet->payload.size = (s - rtp_hdr_size);
ret = tdav_codec_ulpfec_enc_protect((struct tdav_codec_ulpfec_s*)base->ulpfec.codec, packet);
- if(result->last_chunck){
+ if(result->last_chunck) {
trtp_rtp_packet_t* packet_fec;
- if((packet_fec = trtp_rtp_packet_create(base->rtp_manager->rtp.ssrc.local, base->ulpfec.seq_num++, base->ulpfec.timestamp, base->ulpfec.payload_type, tsk_true))){
+ if((packet_fec = trtp_rtp_packet_create(base->rtp_manager->rtp.ssrc.local, base->ulpfec.seq_num++, base->ulpfec.timestamp, base->ulpfec.payload_type, tsk_true))) {
// serialize the FEC payload packet packet
s = tdav_codec_ulpfec_enc_serialize((const struct tdav_codec_ulpfec_s*)base->ulpfec.codec, &video->encoder.buffer, &video->encoder.buffer_size);
- if(s > 0){
+ if(s > 0) {
packet_fec->payload.data_const = video->encoder.buffer;
packet_fec->payload.size = s;
s = trtp_manager_send_rtp_packet(base->rtp_manager, packet_fec, tsk_true/* already encrypted */);
@@ -306,11 +296,11 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
if (ret == 0 && video->red.codec) {
// don't need to lock as the buffer is never used by other codecs
tsk_size_t red_pay_size = video->red.codec->plugin->encode(
- video->red.codec,
- buffer, size,
- &video->encoder.buffer, &video->encoder.buffer_size
- );
- if(red_pay_size > 1){
+ video->red.codec,
+ buffer, size,
+ &video->encoder.buffer, &video->encoder.buffer_size
+ );
+ if(red_pay_size > 1) {
packet->header->payload_type = video->red.payload_type;
((uint8_t*)video->encoder.buffer)[0] = packet->header->payload_type;
packet->payload.data_const = video->encoder.buffer;
@@ -324,10 +314,10 @@ static int tdav_session_video_raw_cb(const tmedia_video_encode_result_xt* result
TSK_DEBUG_ERROR("Failed to create packet");
}
}
- else{
+ else {
//--TSK_DEBUG_WARN("Session not ready yet");
}
-
+
bail:
TSK_OBJECT_SAFE_FREE(packet);
return ret;
@@ -338,26 +328,25 @@ static int tdav_session_video_decode_cb(const tmedia_video_decode_result_xt* res
{
tdav_session_av_t* base = (tdav_session_av_t*)result->usr_data;
tdav_session_video_t* video = (tdav_session_video_t*)base;
-
- switch(result->type){
- case tmedia_video_decode_result_type_idr:
- {
- if(video->decoder.last_corrupted_timestamp != ((const trtp_rtp_header_t*)result->proto_hdr)->timestamp){
- TSK_DEBUG_INFO("IDR frame decoded");
- video->decoder.stream_corrupted = tsk_false;
- }
- else{
- TSK_DEBUG_INFO("IDR frame decoded but corrupted :(");
- }
- break;
+
+ switch(result->type) {
+ case tmedia_video_decode_result_type_idr: {
+ if(video->decoder.last_corrupted_timestamp != ((const trtp_rtp_header_t*)result->proto_hdr)->timestamp) {
+ TSK_DEBUG_INFO("IDR frame decoded");
+ video->decoder.stream_corrupted = tsk_false;
}
- case tmedia_video_decode_result_type_error:
- {
- TSK_DEBUG_INFO("Decoding failed -> request Full Intra Refresh (FIR)");
- _tdav_session_video_local_request_idr(TMEDIA_SESSION(video), "DECODED_FAILED", ((const trtp_rtp_header_t*)result->proto_hdr)->ssrc);
- break;
+ else {
+ TSK_DEBUG_INFO("IDR frame decoded but corrupted :(");
}
- default: break;
+ break;
+ }
+ case tmedia_video_decode_result_type_error: {
+ TSK_DEBUG_INFO("Decoding failed -> request Full Intra Refresh (FIR)");
+ _tdav_session_video_local_request_idr(TMEDIA_SESSION(video), "DECODED_FAILED", ((const trtp_rtp_header_t*)result->proto_hdr)->ssrc);
+ break;
+ }
+ default:
+ break;
}
return 0;
}
@@ -367,26 +356,27 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
{
tdav_session_video_t* video = (tdav_session_video_t*)callback_data;
tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+ tmedia_session_t* session = (tmedia_session_t*)callback_data;
tsk_size_t yuv420p_size = 0;
int ret = 0;
-
- if(!base){
+
+ if(!base) {
TSK_DEBUG_ERROR("Null session");
return 0;
}
-
+
// do nothing if session is held
// when the session is held the end user will get feedback he also has possibilities to put the consumer and producer on pause
- if (TMEDIA_SESSION(base)->lo_held) {
+ if (session->lo_held) {
return 0;
}
-
+
// do nothing if not started yet
if (!video->started) {
TSK_DEBUG_INFO("Video session not started yet");
return 0;
}
-
+
// get best negotiated codec if not already done
// the encoder codec could be null when session is renegotiated without re-starting (e.g. hold/resume)
if (!video->encoder.codec) {
@@ -400,25 +390,28 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
video->encoder.codec = tsk_object_ref(TSK_OBJECT(codec));
tsk_safeobj_unlock(base);
}
-
+
if (base->rtp_manager) {
//static int __rotation_counter = 0;
/* encode */
tsk_size_t out_size = 0;
tmedia_codec_t* codec_encoder = tsk_null;
-
+ uint64_t encode_start_time, encode_duration; // This time chroma conversion, scaling and encoding
+
if (!base->rtp_manager->is_started) {
TSK_DEBUG_ERROR("Not started");
goto bail;
}
-
+
// take a reference to the encoder to make sure it'll not be destroyed while we're using it
codec_encoder = tsk_object_ref(video->encoder.codec);
if (!codec_encoder) {
TSK_DEBUG_ERROR("The encoder is null");
goto bail;
}
-
+
+ encode_start_time = tsk_time_now();
+
#define PRODUCER_OUTPUT_FIXSIZE (base->producer->video.chroma != tmedia_chroma_mjpeg) // whether the output data has a fixed size/length
#define PRODUCER_OUTPUT_RAW (base->producer->encoder.codec_id == tmedia_codec_id_none) // Otherwise, frames from the producer are already encoded
#define PRODUCER_SIZE_CHANGED ((video->conv.producerWidth && video->conv.producerWidth != base->producer->video.width) || (video->conv.producerHeight && video->conv.producerHeight != base->producer->video.height) \
@@ -431,15 +424,15 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
// Video codecs only accept YUV420P buffers ==> do conversion if needed or producer doesn't have the right size
if (PRODUCER_OUTPUT_RAW && (PRODUCED_FRAME_NEED_CHROMA_CONVERSION || PRODUCER_SIZE_CHANGED || ENCODED_NEED_FLIP || ENCODED_NEED_RESIZE ||PRODUCED_FRAME_NEED_ROTATION || PRODUCED_FRAME_NEED_MIRROR)) {
// Create video converter if not already done or producer size have changed
- if(!video->conv.toYUV420 || PRODUCER_SIZE_CHANGED){
+ if(!video->conv.toYUV420 || PRODUCER_SIZE_CHANGED) {
TSK_OBJECT_SAFE_FREE(video->conv.toYUV420);
video->conv.producerWidth = base->producer->video.width;
video->conv.producerHeight = base->producer->video.height;
video->conv.xProducerSize = size;
-
+
TSK_DEBUG_INFO("producer size = (%d, %d)", (int)base->producer->video.width, (int)base->producer->video.height);
if (!(video->conv.toYUV420 = tmedia_converter_video_create(base->producer->video.width, base->producer->video.height, base->producer->video.chroma, TMEDIA_CODEC_VIDEO(codec_encoder)->out.width, TMEDIA_CODEC_VIDEO(codec_encoder)->out.height,
- TMEDIA_CODEC_VIDEO(codec_encoder)->out.chroma))){
+ TMEDIA_CODEC_VIDEO(codec_encoder)->out.chroma))) {
TSK_DEBUG_ERROR("Failed to create video converter");
ret = -5;
goto bail;
@@ -448,19 +441,19 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
tmedia_converter_video_set_scale_rotated_frames(video->conv.toYUV420, video->encoder.scale_rotated_frames);
}
}
-
- if(video->conv.toYUV420){
+
+ if(video->conv.toYUV420) {
video->encoder.scale_rotated_frames = video->conv.toYUV420->scale_rotated_frames;
// check if rotation have changed and alert the codec
// we avoid scalling the frame after rotation because it's CPU intensive and keeping the image ratio is difficult
// it's up to the encoder to swap (w,h) and to track the rotation value
- if(video->encoder.rotation != base->producer->video.rotation){
+ if(video->encoder.rotation != base->producer->video.rotation) {
tmedia_param_t* param = tmedia_param_create(tmedia_pat_set,
- tmedia_video,
- tmedia_ppt_codec,
- tmedia_pvt_int32,
- "rotation",
- (void*)&base->producer->video.rotation);
+ tmedia_video,
+ tmedia_ppt_codec,
+ tmedia_pvt_int32,
+ "rotation",
+ (void*)&base->producer->video.rotation);
if (!param) {
TSK_DEBUG_ERROR("Failed to create a media parameter");
return -1;
@@ -471,10 +464,10 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
// (ret != 0) -> not supported by the codec -> to be done by the converter
video->encoder.scale_rotated_frames = (ret != 0);
}
-
+
// update one-shot parameters
tmedia_converter_video_set(video->conv.toYUV420, base->producer->video.rotation, TMEDIA_CODEC_VIDEO(codec_encoder)->out.flip, base->producer->video.mirror, video->encoder.scale_rotated_frames);
-
+
yuv420p_size = tmedia_converter_video_process(video->conv.toYUV420, buffer, size, &video->encoder.conv_buffer, &video->encoder.conv_buffer_size);
if (!yuv420p_size || !video->encoder.conv_buffer) {
TSK_DEBUG_ERROR("Failed to convert XXX buffer to YUV42P");
@@ -482,7 +475,7 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
goto bail;
}
}
-
+
// Encode data
tsk_mutex_lock(video->encoder.h_mutex);
if (video->started && codec_encoder->opened) { // stop() function locks the encoder mutex before changing "started"
@@ -496,19 +489,27 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
}
}
tsk_mutex_unlock(video->encoder.h_mutex);
-
+
if (out_size) {
/* Never called, see tdav_session_video_raw_cb() */
trtp_manager_send_rtp(base->rtp_manager, video->encoder.buffer, out_size, 6006, tsk_true, tsk_true);
}
- bail:
+
+ // This block of code is called on success, otherwise we'd jump to bail
+ encode_duration = (tsk_time_now() - encode_start_time);
+ if (base->congestion_ctrl_enabled) {
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.video_enc_avg_time = (unsigned)((session->qos_metrics.video_enc_avg_time + encode_duration) / (video->enc_avg_time_n++ ? 2 : 1));
+ tsk_mutex_unlock(video->h_mutex_qos);
+ }
+bail:
TSK_OBJECT_SAFE_FREE(codec_encoder);
}
else {
TSK_DEBUG_ERROR("Invalid parameter");
ret = -1;
}
-
+
return ret;
}
@@ -517,40 +518,40 @@ static int tdav_session_video_rtp_cb(const void* callback_data, const trtp_rtp_p
{
tdav_session_video_t* video = (tdav_session_video_t*)callback_data;
tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
-
- if(!video || !packet || !packet->header){
+
+ if(!video || !packet || !packet->header) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(packet->header->payload_type == base->red.payload_type){
+
+ if(packet->header->payload_type == base->red.payload_type) {
static void* __red_buffer_ptr = tsk_null; // Never used
static tsk_size_t __red_buffer_size = 0; // Never used
- if(!base->red.codec){
+ if(!base->red.codec) {
TSK_DEBUG_ERROR("No RED codec could be found");
return -2;
}
// Decode RED data
base->red.codec->plugin->decode(
- base->red.codec,
- (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
- &__red_buffer_ptr, &__red_buffer_size,
- packet->header
- );
+ base->red.codec,
+ (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
+ &__red_buffer_ptr, &__red_buffer_size,
+ packet->header
+ );
return 0;
}
- else if(packet->header->payload_type == base->ulpfec.payload_type){
- if(!base->ulpfec.codec){
+ else if(packet->header->payload_type == base->ulpfec.payload_type) {
+ if(!base->ulpfec.codec) {
TSK_DEBUG_ERROR("No ULPFEC codec could be found");
return -2;
}
// FIXME: do something
return 0;
}
- else{
+ else {
return video->jb
- ? tdav_video_jb_put(video->jb, (trtp_rtp_packet_t*)packet)
- : _tdav_session_video_decode(video, packet);
+ ? tdav_video_jb_put(video->jb, (trtp_rtp_packet_t*)packet)
+ : _tdav_session_video_decode(video, packet);
}
}
@@ -561,200 +562,167 @@ static int tdav_session_video_rtcp_cb(const void* callback_data, const trtp_rtcp
const trtp_rtcp_report_psfb_t* psfb;
const trtp_rtcp_report_rtpfb_t* rtpfb;
const trtp_rtcp_rblocks_L_t* blocks = tsk_null;
-
+
tdav_session_video_t* video = (tdav_session_video_t*)callback_data;
tdav_session_av_t* base = (tdav_session_av_t*)callback_data;
+ tmedia_session_t* session = (tmedia_session_t*)callback_data;
tsk_size_t i;
-
+
if((blocks = (packet->header->type == trtp_rtcp_packet_type_rr) ? ((const trtp_rtcp_report_rr_t*)packet)->blocks :
- (packet->header->type == trtp_rtcp_packet_type_sr ? ((const trtp_rtcp_report_sr_t*)packet)->blocks : tsk_null))){
+ (packet->header->type == trtp_rtcp_packet_type_sr ? ((const trtp_rtcp_report_sr_t*)packet)->blocks : tsk_null))) {
const tsk_list_item_t* item;
const trtp_rtcp_rblock_t* block;
- tsk_list_foreach(item, blocks){
- if(!(block = item->data)) continue;
- if(base->rtp_manager->rtp.ssrc.local == block->ssrc){
- tdav_session_video_pkt_loss_level_t pkt_loss_level = tdav_session_video_pkt_loss_level_low;
- TSK_DEBUG_INFO("RTCP pkt loss fraction=%d", block->fraction);
- if(block->fraction > TDAV_SESSION_VIDEO_PKT_LOSS_HIGH) pkt_loss_level = tdav_session_video_pkt_loss_level_high;
- else if(block->fraction > TDAV_SESSION_VIDEO_PKT_LOSS_MEDIUM) pkt_loss_level = tdav_session_video_pkt_loss_level_medium;
- if (pkt_loss_level == tdav_session_video_pkt_loss_level_high || (pkt_loss_level > video->encoder.pkt_loss_level)){ // high or low -> medium
- video->encoder.pkt_loss_level = pkt_loss_level;
- if(video->encoder.pkt_loss_prob_bad-- <= 0){
- int32_t new_pkt_loss_fact = TSK_CLAMP(TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MIN, (video->encoder.pkt_loss_fact + 1), TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MAX);
- if (video->encoder.pkt_loss_fact != new_pkt_loss_fact) {
- TSK_DEBUG_INFO("Downgrade bandwidth %d->%d", video->encoder.pkt_loss_fact, new_pkt_loss_fact);
- video->encoder.pkt_loss_fact = new_pkt_loss_fact;
- _tdav_session_video_bw_down(video);
- }
- _tdav_session_video_reset_loss_prob(video);
- }
- }
- else{
- if (video->encoder.pkt_loss_prob_good-- <= 0) {
- int32_t new_pkt_loss_fact = TSK_CLAMP(TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MIN, (video->encoder.pkt_loss_fact - 1), TDAV_SESSION_VIDEO_PKT_LOSS_FACT_MAX);
- if (video->encoder.pkt_loss_fact != new_pkt_loss_fact) {
- TSK_DEBUG_INFO("Upgrade bandwidth %d->%d", video->encoder.pkt_loss_fact, new_pkt_loss_fact);
- video->encoder.pkt_loss_fact = new_pkt_loss_fact;
- _tdav_session_video_bw_up(video);
- }
- _tdav_session_video_reset_loss_prob(video);
- }
+ tsk_list_foreach(item, blocks) {
+ if(!(block = item->data)) {
+ continue;
+ }
+ if(base->rtp_manager->rtp.ssrc.local == block->ssrc) {
+ TSK_DEBUG_INFO("RTCP pkt loss fraction=%d, congestion_ctrl_enabled=%d", block->fraction, (int)base->congestion_ctrl_enabled);
+ // Global packet loss estimation
+ if (base->congestion_ctrl_enabled) {
+ float q2;
+ q2 = block->fraction == 0 ? 1.f : ((float)block->fraction / 256.f);
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.q2 = (session->qos_metrics.q2 + q2) / (video->q2_n++ ? 2.f : 1.f);
+ tsk_mutex_unlock(video->h_mutex_qos);
}
break;
}
}
}
-
+
i = 0;
- while((psfb = (const trtp_rtcp_report_psfb_t*)trtp_rtcp_packet_get_at(packet, trtp_rtcp_packet_type_psfb, i++))){
- switch(psfb->fci_type){
- case trtp_rtcp_psfb_fci_type_fir:
- {
- TSK_DEBUG_INFO("Receiving RTCP-FIR (%u)", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
+ while((psfb = (const trtp_rtcp_report_psfb_t*)trtp_rtcp_packet_get_at(packet, trtp_rtcp_packet_type_psfb, i++))) {
+ switch(psfb->fci_type) {
+ case trtp_rtcp_psfb_fci_type_fir: {
+ TSK_DEBUG_INFO("Receiving RTCP-FIR (%u)", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
+ _tdav_session_video_remote_requested_idr(video, ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_pli: {
+ uint64_t now;
+ TSK_DEBUG_INFO("Receiving RTCP-PLI (%u)", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
+ now = tsk_time_now();
+ // more than one PLI in 500ms ?
+ // "if" removed because PLI really means codec prediction chain is broken
+ /*if((now - video->avpf.last_pli_time) < 500)*/{
_tdav_session_video_remote_requested_idr(video, ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
- break;
}
- case trtp_rtcp_psfb_fci_type_pli:
- {
- uint64_t now;
- TSK_DEBUG_INFO("Receiving RTCP-PLI (%u)", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
- now = tsk_time_now();
- // more than one PLI in 500ms ?
- // "if" removed because PLI really means codec prediction chain is broken
- /*if((now - video->avpf.last_pli_time) < 500)*/{
- _tdav_session_video_remote_requested_idr(video, ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media);
+ video->avpf.last_pli_time = now;
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_afb: {
+ if (psfb->afb.type == trtp_rtcp_psfb_afb_type_remb) {
+ uint64_t bw_up_reported_kpbs = ((psfb->afb.remb.mantissa << psfb->afb.remb.exp) >> 10);
+ TSK_DEBUG_INFO("Receiving RTCP-AFB-REMB (%u), exp=%u, mantissa=%u, bandwidth=%ukbps", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media, psfb->afb.remb.exp, psfb->afb.remb.mantissa, bw_up_reported_kpbs);
+ if (base->congestion_ctrl_enabled) {
+ if (session->qos_metrics.bw_up_est_kbps != 0) {
+ float q3 = bw_up_reported_kpbs / (float)session->qos_metrics.bw_up_est_kbps;
+ q3 = TSK_CLAMP(0.f, q3, 1.f);
+ TSK_DEBUG_INFO("bw_up_estimated_kbps=%llu, bw_up_reported_kpbs=%llu, q3=%f", session->qos_metrics.bw_up_est_kbps, bw_up_reported_kpbs, q3);
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.q3 = (session->qos_metrics.q3 + q3) / (video->q3_n++ ? 2.f : 1.f);
+ tsk_mutex_unlock(video->h_mutex_qos);
+ }
}
- video->avpf.last_pli_time = now;
- break;
}
- case trtp_rtcp_psfb_fci_type_afb:
- {
- if (psfb->afb.type == trtp_rtcp_psfb_afb_type_remb) {
- uint32_t bandwidth_up_reported_kpbs = ((psfb->afb.remb.mantissa << psfb->afb.remb.exp) / 1024);
- TSK_DEBUG_INFO("Receiving RTCP-AFB-REMB (%u), exp=%u, mantissa=%u, bandwidth = %ukbps, congestion_ctrl_enabled=%s", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media, psfb->afb.remb.exp, psfb->afb.remb.mantissa, bandwidth_up_reported_kpbs, base->congestion_ctrl_enabled ? "yes" : "no");
-#if TDAV_GOOG_REMB_FULL_SUPPORT
- if (base->congestion_ctrl_enabled) {
- uint32_t remb_upload_kbps = 0;
- tsk_bool_t remb_ok = tsk_false;
- uint64_t bytes_count_now;
- uint64_t bytes_count_out;
- static uint64_t* bytes_count_in_ptr_null = tsk_null;
-
- if ((ret = trtp_manager_get_bytes_count(base->rtp_manager, bytes_count_in_ptr_null, &bytes_count_out)) == 0) {
- uint64_t duration;
- bytes_count_now = tsk_time_now();
- duration = (bytes_count_now - base->bytes_out.count_last_time);
- remb_ok = (base->bytes_out.count_last_time != 0 && duration > 0);
- if (remb_ok) {
- remb_upload_kbps = (int32_t)((((bytes_count_out - base->bytes_out.count) * 8 * 1000) / 1024) / duration);
- TSK_DEBUG_INFO("remb_upload_kbps=%u, bandwidth_up_reported_kpbs=%u", remb_upload_kbps, bandwidth_up_reported_kpbs);
- }
- base->bytes_out.count_last_time = bytes_count_now;
- base->bytes_out.count = bytes_count_out;
- }
- if (remb_ok) {
- int32_t pkt_loss_percent = bandwidth_up_reported_kpbs >= remb_upload_kbps ? 0 : ((remb_upload_kbps - bandwidth_up_reported_kpbs) / remb_upload_kbps) * 100;
- TSK_DEBUG_INFO("GOO-REMB: pkt_loss_percent=%d", pkt_loss_percent);
- if (pkt_loss_percent > 5) {
- // more than 5% pkt loss
- TSK_DEBUG_WARN("pkt_loss_percent(%u) > 5%%, using lower bw(%d)", pkt_loss_percent, bandwidth_up_reported_kpbs);
- _tdav_session_video_bw_kbps(video, bandwidth_up_reported_kpbs);
- }
- else if (pkt_loss_percent == 0) {
-#if 0
- // no pkt loss --> increase bw
- int32_t target_bw_max_upload_kbps = base->bandwidth_max_upload_kbps; // user-defined (guard), INT_MAX if not defined
- if (video->encoder.codec) {
- target_bw_max_upload_kbps = TSK_MIN(
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.width, TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.height, TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.fps),
- target_bw_max_upload_kbps);
- }
- if (target_bw_max_upload_kbps > remb_upload_kbps + ((remb_upload_kbps / 100) * 20)) {
- // target (best) bw is 20% less than what we're sending --> increase by 5%
- uint32_t new_upload_kbps = remb_upload_kbps + ((remb_upload_kbps / 100) * 5);
- TSK_DEBUG_INFO("current upload bw is too low, increasing from %u to %u", remb_upload_kbps, new_upload_kbps);
- _tdav_session_video_bw_kbps(video, new_upload_kbps);
- }
-#endif /* 0 */
- }
- }
-
- }
-#else
- // for now we just don't respect the requested bandwidth
-#endif /* TDAV_GOOG_REMB_FULL_SUPPORT */
+ else if (psfb->afb.type == trtp_rtcp_psfb_afb_type_jcng) {
+ float jcng_q = ((float)psfb->afb.jcng.q / 255.f);
+ TSK_DEBUG_INFO("Receiving RTCP-AFB-JCNG (%u), q_recv=%u, q_dec=%f", ((const trtp_rtcp_report_fb_t*)psfb)->ssrc_media, psfb->afb.jcng.q, jcng_q);
+ if (base->congestion_ctrl_enabled) {
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.q5 = (session->qos_metrics.q5 + jcng_q) / (video->q5_n++ ? 2.f : 1.f);
+ tsk_mutex_unlock(video->h_mutex_qos);
}
- break;
}
- default: break;
+ break;
+ }
+ default:
+ break;
}
}
i = 0;
- while((rtpfb = (const trtp_rtcp_report_rtpfb_t*)trtp_rtcp_packet_get_at(packet, trtp_rtcp_packet_type_rtpfb, i++))){
- switch(rtpfb->fci_type){
- default: break;
- case trtp_rtcp_rtpfb_fci_type_nack:
- {
- if(rtpfb->nack.blp && rtpfb->nack.pid){
- tsk_size_t i;
- int32_t j;
- uint16_t pid, blp;
- const tsk_list_item_t* item;
- const trtp_rtp_packet_t* pkt_rtp;
- for(i = 0; i < rtpfb->nack.count; ++i){
- static const int32_t __Pow2[16] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000 };
- int32_t blp_count;
- blp = rtpfb->nack.blp[i];
- blp_count = blp ? 16 : 0;
-
- for(j = -1/*Packet ID (PID)*/; j < blp_count; ++j){
- if(j == -1 || (blp & __Pow2[j])){
- pid = (rtpfb->nack.pid[i] + (j + 1));
- tsk_list_lock(video->avpf.packets);
- tsk_list_foreach(item, video->avpf.packets){
- if(!(pkt_rtp = item->data)){
- continue;
- }
-
- // Very Important: the seq_nums are not consecutive because of wrapping.
- // For example, '65533, 65534, 65535, 0, 1' is a valid sequences which means we have to check all packets (probaly need somthing smarter)
- if(pkt_rtp->header->seq_num == pid){
- TSK_DEBUG_INFO("NACK Found, pid=%d, blp=%u", pid, blp);
- trtp_manager_send_rtp_packet(base->rtp_manager, pkt_rtp, tsk_true);
- break;
- }
- if(item == video->avpf.packets->tail){
- // should never be called unless the tail is too small
- int32_t old_max = (int32_t)video->avpf.max;
- int32_t len_drop = (pkt_rtp->header->seq_num - pid);
- video->avpf.max = TSK_CLAMP((int32_t)tmedia_defaults_get_avpf_tail_min(), (old_max + len_drop), (int32_t)tmedia_defaults_get_avpf_tail_max());
- TSK_DEBUG_INFO("**NACK requesting dropped frames. List=[%d-%d], requested=%d, List.Max=%d, List.Count=%d. RTT is probably too high.",
- ((const trtp_rtp_packet_t*)TSK_LIST_FIRST_DATA(video->avpf.packets))->header->seq_num,
- ((const trtp_rtp_packet_t*)TSK_LIST_LAST_DATA(video->avpf.packets))->header->seq_num,
- pid,
- (int)video->avpf.max,
- (int)video->avpf.count);
- // FIR not really requested but needed
- /*_tdav_session_video_remote_requested_idr(video, ((const trtp_rtcp_report_fb_t*)rtpfb)->ssrc_media);
- tsk_list_clear_items(video->avpf.packets);
- video->avpf.count = 0;*/
- } // if(last_item)
- }// foreach(pkt)
- tsk_list_unlock(video->avpf.packets);
- }// if(BLP is set)
- }// foreach(BIT in BLP)
- }// foreach(nack)
- }// if(nack-blp and nack-pid are set)
- break;
- }// case
+ while((rtpfb = (const trtp_rtcp_report_rtpfb_t*)trtp_rtcp_packet_get_at(packet, trtp_rtcp_packet_type_rtpfb, i++))) {
+ switch(rtpfb->fci_type) {
+ default:
+ break;
+ case trtp_rtcp_rtpfb_fci_type_nack: {
+ if(rtpfb->nack.blp && rtpfb->nack.pid) {
+ tsk_size_t i;
+ int32_t j;
+ uint16_t pid, blp;
+ uint32_t r = 0; // the number of recoverable packets (lost but recovered using a NACK requests)
+ uint32_t u = 0; // the number of unrecoverable packets (lost but not recovered using NACK requests)
+ const tsk_list_item_t* item;
+ const trtp_rtp_packet_t* pkt_rtp;
+ for(i = 0; i < rtpfb->nack.count; ++i) {
+ static const int32_t __Pow2[16] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000 };
+ int32_t blp_count;
+ blp = rtpfb->nack.blp[i];
+ blp_count = blp ? 16 : 0;
+
+ for(j = -1/*Packet ID (PID)*/; j < blp_count; ++j) {
+ if(j == -1 || (blp & __Pow2[j])) {
+ pid = (rtpfb->nack.pid[i] + (j + 1));
+ tsk_list_lock(video->avpf.packets);
+ tsk_list_foreach(item, video->avpf.packets) {
+ if(!(pkt_rtp = item->data)) {
+ continue;
+ }
+
+ // Very Important: the seq_nums are not consecutive because of wrapping.
+ // For example, '65533, 65534, 65535, 0, 1' is a valid sequences which means we have to check all packets (probaly need somthing smarter)
+ if(pkt_rtp->header->seq_num == pid) {
+ ++r;
+ TSK_DEBUG_INFO("NACK Found, pid=%d, blp=%u, r=%u", pid, blp, r);
+ trtp_manager_send_rtp_packet(base->rtp_manager, pkt_rtp, tsk_true);
+ break;
+ }
+ if(item == video->avpf.packets->tail) {
+ // should never be called unless the tail is too small
+ int32_t old_max = (int32_t)video->avpf.max;
+ int32_t len_drop = (pkt_rtp->header->seq_num - pid);
+ ++u;
+ video->avpf.max = TSK_CLAMP((int32_t)tmedia_defaults_get_avpf_tail_min(), (old_max + len_drop), (int32_t)tmedia_defaults_get_avpf_tail_max());
+ TSK_DEBUG_INFO("**NACK requesting dropped frames. List=[%d-%d], requested=%d, List.Max=%d, List.Count=%d, u=%u. RTT is probably too high.",
+ ((const trtp_rtp_packet_t*)TSK_LIST_FIRST_DATA(video->avpf.packets))->header->seq_num,
+ ((const trtp_rtp_packet_t*)TSK_LIST_LAST_DATA(video->avpf.packets))->header->seq_num,
+ pid,
+ (int)video->avpf.max,
+ (int)video->avpf.count,
+ (unsigned)u);
+ // FIR not really requested but needed
+ /*_tdav_session_video_remote_requested_idr(video, ((const trtp_rtcp_report_fb_t*)rtpfb)->ssrc_media);
+ tsk_list_clear_items(video->avpf.packets);
+ video->avpf.count = 0;*/
+ } // if(last_item)
+ }// foreach(pkt)
+ tsk_list_unlock(video->avpf.packets);
+ }// if(BLP is set)
+ }// foreach(BIT in BLP)
+ }// foreach(nack)
+ if (base->congestion_ctrl_enabled) {
+ // Compute q1
+ if (r || u) {
+ float q1 = 1.f - (((r * 0.2f) + (u * 0.8f)) / (r + u));
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.q1 = (session->qos_metrics.q1 + q1) / (video->q1_n++ ? 2.f : 1.f);
+ tsk_mutex_unlock(video->h_mutex_qos);
+ TSK_DEBUG_INFO("RTCP-NACK: r=%u, u=%u, q1=%f", r, u, q1);
+ }
+ }
+ }// if(nack-blp and nack-pid are set)
+ break;
+ }// case
}// switch
}// while(rtcp-pkt)
-
+
return ret;
}
static int _tdav_session_video_set_defaults(tdav_session_video_t* self)
{
+ tmedia_session_t* session = (tmedia_session_t*)self;
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -762,16 +730,29 @@ static int _tdav_session_video_set_defaults(tdav_session_video_t* self)
self->jb_enabled = tmedia_defaults_get_videojb_enabled();
self->zero_artifacts = tmedia_defaults_get_video_zeroartifacts_enabled();
self->avpf.max = tmedia_defaults_get_avpf_tail_min();
- self->encoder.pkt_loss_level = tdav_session_video_pkt_loss_level_low;
- self->encoder.pkt_loss_prob_bad = 0; // honor first report
- self->encoder.pkt_loss_prob_good = TDAV_SESSION_VIDEO_PKT_LOSS_PROB_GOOD;
self->encoder.last_frame_time = 0;
-
+ // Quality metrics
+ session->qos_metrics.q1 = 0.f, self->q1_n = 0;
+ session->qos_metrics.q2 = 0.f, self->q2_n = 0;
+ session->qos_metrics.q3 = 0.f, self->q3_n = 0;
+ session->qos_metrics.q4 = 0.f, self->q4_n = 0;
+ session->qos_metrics.qvag = 1.f;
+ session->qos_metrics.bw_up_est_kbps = 0;
+ session->qos_metrics.bw_down_est_kbps = 0;
+ session->qos_metrics.last_update_time = 0;
+ session->qos_metrics.video_out_width = 0;
+ session->qos_metrics.video_out_height = 0;
+ session->qos_metrics.video_in_width = 0;
+ session->qos_metrics.video_in_height = 0;
+ session->qos_metrics.video_in_avg_fps = tmedia_defaults_get_video_fps(), self->in_avg_fps_n = 1;
+ session->qos_metrics.video_dec_avg_time = 0, self->dec_avg_time_n = 0 ;
+ session->qos_metrics.video_enc_avg_time = 0, self->enc_avg_time_n = 0;
+
// reset rotation info (MUST for reINVITE when mobile device in portrait[90 degrees])
self->encoder.rotation = 0;
-
+
TSK_DEBUG_INFO("Video 'zero-artifacts' option = %s", self->zero_artifacts ? "yes" : "no");
-
+
return 0;
}
@@ -781,61 +762,61 @@ static int _tdav_session_video_jb_cb(const tdav_video_jb_cb_data_xt* data)
tdav_session_video_t* video = (tdav_session_video_t*)data->usr_data;
tdav_session_av_t* base = (tdav_session_av_t*)data->usr_data;
tmedia_session_t* session = (tmedia_session_t*)data->usr_data;
-
- switch(data->type){
- default: break;
- case tdav_video_jb_cb_data_type_rtp:
- {
- return _tdav_session_video_decode(video, data->rtp.pkt);
- }
- case tdav_video_jb_cb_data_type_tmfr:
- {
- base->time_last_frame_loss_report = tsk_time_now();
+
+ switch (data->type) {
+ default:
+ break;
+ case tdav_video_jb_cb_data_type_rtp: {
+ return _tdav_session_video_decode(video, data->rtp.pkt);
+ }
+ case tdav_video_jb_cb_data_type_tmfr: {
+ base->time_last_frame_loss_report = tsk_time_now();
+ _tdav_session_video_local_request_idr(session, "TMFR", data->ssrc);
+ }
+ case tdav_video_jb_cb_data_type_fl: {
+ base->time_last_frame_loss_report = tsk_time_now();
+ if(data->fl.count > TDAV_SESSION_VIDEO_PKT_LOSS_MAX_COUNT_TO_REQUEST_FIR) {
_tdav_session_video_local_request_idr(session, "TMFR", data->ssrc);
}
- case tdav_video_jb_cb_data_type_fl:
- {
- base->time_last_frame_loss_report = tsk_time_now();
- if(data->fl.count > TDAV_SESSION_VIDEO_PKT_LOSS_MAX_COUNT_TO_REQUEST_FIR){
- _tdav_session_video_local_request_idr(session, "TMFR", data->ssrc);
- }
- else {
- if (base->avpf_mode_neg || base->is_fb_nack_neg) { // AVPF?
- // Send RTCP-NACK
- tsk_size_t i, j, k;
- uint16_t seq_nums[16];
- for(i = 0; i < data->fl.count; i+=16){
- for(j = 0, k = i; j < 16 && k < data->fl.count; ++j, ++k){
- seq_nums[j] = (uint16_t)(data->fl.seq_num + i + j);
- TSK_DEBUG_INFO("Request re-send(%u)", seq_nums[j]);
- }
- trtp_manager_signal_pkt_loss(base->rtp_manager, data->ssrc, seq_nums, j);
+ else {
+ if (base->avpf_mode_neg || base->is_fb_nack_neg) { // AVPF?
+ // Send RTCP-NACK
+ tsk_size_t i, j, k;
+ uint16_t seq_nums[16];
+ for (i = 0; i < data->fl.count; i+=16) {
+ for(j = 0, k = i; j < 16 && k < data->fl.count; ++j, ++k) {
+ seq_nums[j] = (uint16_t)(data->fl.seq_num + i + j);
+ TSK_DEBUG_INFO("Request re-send(%u)", seq_nums[j]);
}
+ trtp_manager_signal_pkt_loss(base->rtp_manager, data->ssrc, seq_nums, j);
}
}
-
- break;
}
- case tdav_video_jb_cb_data_type_fps_changed:
- {
- if(base->congestion_ctrl_enabled){
- video->fps_changed = tsk_true;
- if(video->decoder.codec){
- TSK_DEBUG_INFO("Congestion control enabled and fps updated from %u to %u", data->fps.old, data->fps.new);
- TMEDIA_CODEC_VIDEO(video->decoder.codec)->in.fps = data->fps.new;
- }
+
+ break;
+ }
+ case tdav_video_jb_cb_data_type_fps_changed: {
+ if (base->congestion_ctrl_enabled) {
+ video->fps_changed = tsk_true;
+ if (video->decoder.codec) {
+ TSK_DEBUG_INFO("Congestion control enabled and fps updated from %u to %u", data->fps.old, data->fps.new);
+ TMEDIA_CODEC_VIDEO(video->decoder.codec)->in.fps = data->fps.new;
}
- break;
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.video_in_avg_fps = (session->qos_metrics.video_in_avg_fps + data->fps.new) / (video->in_avg_fps_n++ ? 2 : 1);
+ tsk_mutex_unlock(video->h_mutex_qos);
}
+ break;
}
-
+ }
+
return 0;
}
int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload_type)
{
int ret = 0;
-
+
if ((self->decoder.codec_payload_type != payload_type) || !self->decoder.codec) {
tsk_istr_t format;
TSK_OBJECT_SAFE_FREE(self->decoder.codec);
@@ -849,14 +830,14 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
self->decoder.codec_decoded_frames_count = 0; // because we switched the codecs
}
// Open codec if not already done
- if (!TMEDIA_CODEC(self->decoder.codec)->opened){
+ if (!TMEDIA_CODEC(self->decoder.codec)->opened) {
if ((ret = tmedia_codec_open(self->decoder.codec))) {
TSK_DEBUG_ERROR("Failed to open [%s] codec", self->decoder.codec->plugin->desc);
goto bail;
}
self->decoder.codec_decoded_frames_count = 0; // because first time to use
}
-
+
bail:
return ret;
}
@@ -867,45 +848,49 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
static const trtp_rtp_header_t* __rtp_header = tsk_null;
static const tmedia_codec_id_t __codecs_supporting_zero_artifacts = (tmedia_codec_id_vp8 | tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp | tmedia_codec_id_h263);
int ret = 0;
-
- if(!self || !packet || !packet->header){
+
+ if(!self || !packet || !packet->header) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(base);
-
+
if (self->started && base->consumer && base->consumer->is_started) {
tsk_size_t out_size, _size;
const void* _buffer;
tdav_session_video_t* video = (tdav_session_video_t*)base;
-
+ tmedia_session_t* session = (tmedia_session_t*)base;
+ uint64_t time_start, time_duration;
+
// Find the codec to use to decode the RTP payload
- if(!self->decoder.codec || self->decoder.codec_payload_type != packet->header->payload_type){
- if((ret = _tdav_session_video_open_decoder(self, packet->header->payload_type))){
+ if (!self->decoder.codec || self->decoder.codec_payload_type != packet->header->payload_type) {
+ if ((ret = _tdav_session_video_open_decoder(self, packet->header->payload_type))) {
goto bail;
}
}
-
+
// check whether bypassing is enabled (e.g. rtcweb breaker ON and media coder OFF)
- if(TMEDIA_SESSION(self)->bypass_decoding){
+ if(TMEDIA_SESSION(self)->bypass_decoding) {
// set codec id for internal use (useful to find codec with dynamic payload type)
TRTP_RTP_HEADER(packet->header)->codec_id = self->decoder.codec->id;
// consume the frame
ret = tmedia_consumer_consume(base->consumer, (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size, packet->header);
goto bail;
}
-
+
+ time_start = tsk_time_now();
+
// Check if stream is corrupted or not
- if(video->decoder.last_seqnum && (video->decoder.last_seqnum + 1) != packet->header->seq_num){
+ if(video->decoder.last_seqnum && (video->decoder.last_seqnum + 1) != packet->header->seq_num) {
TSK_DEBUG_INFO("/!\\Video stream corrupted because of packet loss [%u - %u]. Pause rendering if 'zero_artifacts' (supported = %s, enabled = %s).",
video->decoder.last_seqnum,
packet->header->seq_num,
(__codecs_supporting_zero_artifacts & self->decoder.codec->id) ? "yes" : "no",
self->zero_artifacts ? "yes" : "no"
- );
- if(!video->decoder.stream_corrupted){ // do not do the job twice
- if(self->zero_artifacts && (__codecs_supporting_zero_artifacts & self->decoder.codec->id)){
+ );
+ if(!video->decoder.stream_corrupted) { // do not do the job twice
+ if(self->zero_artifacts && (__codecs_supporting_zero_artifacts & self->decoder.codec->id)) {
// request IDR now and every time after 'TDAV_SESSION_VIDEO_AVPF_FIR_REQUEST_INTERVAL_MIN' ellapsed
// 'zero-artifacts' not enabled then, we'll request IDR when decoding fails
TSK_DEBUG_INFO("Sending FIR to request IDR...");
@@ -919,35 +904,43 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
video->decoder.last_corrupted_timestamp = packet->header->timestamp;
}
video->decoder.last_seqnum = packet->header->seq_num; // update last seqnum
-
+
// Decode data
out_size = self->decoder.codec->plugin->decode(
- self->decoder.codec,
- (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
- &self->decoder.buffer, &self->decoder.buffer_size,
- packet->header
- );
+ self->decoder.codec,
+ (packet->payload.data ? packet->payload.data : packet->payload.data_const), packet->payload.size,
+ &self->decoder.buffer, &self->decoder.buffer_size,
+ packet->header
+ );
+
+ // report to the remote party the bandwidth usage and jitter buffer congestion info
+ // this must be done here to make sure it won't be skipped by decoding issues or any other failure
+ ret = _tdav_session_video_report_bw_usage_and_jcng(self);
+
+ // inc() frame count
+ ++self->decoder.codec_decoded_frames_count;
+
// check
- if(!out_size || !self->decoder.buffer){
+ if (!out_size || !self->decoder.buffer) {
goto bail;
}
// check if stream is corrupted
// the above decoding process is required in order to reset stream corruption status when IDR frame is decoded
- if(self->zero_artifacts && self->decoder.stream_corrupted && (__codecs_supporting_zero_artifacts & self->decoder.codec->id)){
+ if (self->zero_artifacts && self->decoder.stream_corrupted && (__codecs_supporting_zero_artifacts & self->decoder.codec->id)) {
TSK_DEBUG_INFO("Do not render video frame because stream is corrupted and 'zero-artifacts' is enabled. Last seqnum=%u", video->decoder.last_seqnum);
- if(video->decoder.stream_corrupted && (tsk_time_now() - video->decoder.stream_corrupted_since) > TDAV_SESSION_VIDEO_AVPF_FIR_REQUEST_INTERVAL_MIN){
+ if (video->decoder.stream_corrupted && (tsk_time_now() - video->decoder.stream_corrupted_since) > TDAV_SESSION_VIDEO_AVPF_FIR_REQUEST_INTERVAL_MIN) {
TSK_DEBUG_INFO("Sending FIR to request IDR because frame corrupted since %llu...", video->decoder.stream_corrupted_since);
_tdav_session_video_local_request_idr(TMEDIA_SESSION(video), "ZERO_ART_CORRUPTED", packet->header->ssrc);
}
goto bail;
}
-
+
// important: do not override the display size (used by the end-user) unless requested
- if(base->consumer->video.display.auto_resize){
+ if(base->consumer->video.display.auto_resize) {
base->consumer->video.display.width = TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width;//decoded width
base->consumer->video.display.height = TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height;//decoded height
}
-
+
// Convert decoded data to the consumer chroma and size
#define CONSUMER_NEED_DECODER (base->consumer->decoder.codec_id == tmedia_codec_id_none) // Otherwise, the consumer requires encoded frames
#define CONSUMER_IN_N_DISPLAY_MISMATCH (!base->consumer->video.display.auto_resize && (base->consumer->video.in.width != base->consumer->video.display.width || base->consumer->video.in.height != base->consumer->video.display.height))
@@ -955,112 +948,64 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
#define CONSUMER_DISPLAY_N_CONVERTER_MISMATCH ( (self->conv.fromYUV420 && self->conv.fromYUV420->dstWidth != base->consumer->video.display.width) || (self->conv.fromYUV420 && self->conv.fromYUV420->dstHeight != base->consumer->video.display.height) )
#define CONSUMER_CHROMA_MISMATCH (base->consumer->video.display.chroma != TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.chroma)
#define DECODED_NEED_FLIP (TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.flip)
-
- if(CONSUMER_NEED_DECODER && (CONSUMER_CHROMA_MISMATCH || CONSUMER_DISPLAY_N_CODEC_MISMATCH || CONSUMER_IN_N_DISPLAY_MISMATCH || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH || DECODED_NEED_FLIP)){
-
+
+ if(CONSUMER_NEED_DECODER && (CONSUMER_CHROMA_MISMATCH || CONSUMER_DISPLAY_N_CODEC_MISMATCH || CONSUMER_IN_N_DISPLAY_MISMATCH || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH || DECODED_NEED_FLIP)) {
+
// Create video converter if not already done
- if(!self->conv.fromYUV420 || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH){
+ if(!self->conv.fromYUV420 || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH) {
TSK_OBJECT_SAFE_FREE(self->conv.fromYUV420);
-
+
// create converter
if(!(self->conv.fromYUV420 = tmedia_converter_video_create(TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.chroma, base->consumer->video.display.width, base->consumer->video.display.height,
- base->consumer->video.display.chroma))){
+ base->consumer->video.display.chroma))) {
TSK_DEBUG_ERROR("Failed to create video converter");
ret = -3;
goto bail;
}
}
}
-
+
// update consumer size using the codec decoded values
// must be done here to avoid fooling "CONSUMER_IN_N_DISPLAY_MISMATCH" unless "auto_resize" option is enabled
base->consumer->video.in.width = TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width;//decoded width
base->consumer->video.in.height = TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height;//decoded height
-
- if(self->conv.fromYUV420){
+
+ if(self->conv.fromYUV420) {
// update one-shot parameters
tmedia_converter_video_set_flip(self->conv.fromYUV420, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.flip);
// convert data to the consumer's chroma
out_size = tmedia_converter_video_process(self->conv.fromYUV420, self->decoder.buffer, self->decoder.buffer_size, &self->decoder.conv_buffer, &self->decoder.conv_buffer_size);
- if(!out_size || !self->decoder.conv_buffer){
+ if(!out_size || !self->decoder.conv_buffer) {
TSK_DEBUG_ERROR("Failed to convert YUV420 buffer to consumer's chroma");
ret = -4;
goto bail;
}
-
+
_buffer = self->decoder.conv_buffer;
_size = out_size;
}
- else{
+ else {
_buffer = self->decoder.buffer;
_size = out_size;
}
-
- // congetion control
- // send RTCP-REMB if:
- // - congestion control is enabled and
- // - fps changed or
- // - first frame or
- // - approximately every 1 seconds (1 = 1 * 1)
- if (base->congestion_ctrl_enabled && base->rtp_manager && (self->fps_changed || self->decoder.codec_decoded_frames_count == 0 || ((self->decoder.codec_decoded_frames_count % (TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.fps * 1)) == 0))){
- int32_t bandwidth_max_upload_kbps = base->bandwidth_max_upload_kbps;
- int32_t bandwidth_max_download_kbps = base->bandwidth_max_download_kbps; // user-defined (guard), INT_MAX if not defined
- // bandwidth already computed in start() but the decoded video size was not correct and based on the SDP negotiation
- bandwidth_max_download_kbps = TSK_MIN(
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.fps),
- bandwidth_max_download_kbps);
- if (self->encoder.codec) {
- bandwidth_max_upload_kbps = TSK_MIN(
- tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.width, TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.height, TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.fps),
- bandwidth_max_upload_kbps);
- }
-
-#if TDAV_GOOG_REMB_FULL_SUPPORT
- {
- tsk_bool_t remb_ok = tsk_false;
- int32_t remb_download_kbps = 0;
- uint64_t now = 0;
- uint64_t bytes_count_in;
- static uint64_t* bytes_count_out_ptr_null = tsk_null;
- if ((ret = trtp_manager_get_bytes_count(base->rtp_manager, &bytes_count_in, bytes_count_out_ptr_null)) == 0) {
- uint64_t duration;
- now = tsk_time_now();
- duration = (now - base->bytes_in.count_last_time);
- remb_ok = (base->bytes_in.count_last_time != 0 && duration > 0);
- if (remb_ok) {
- remb_download_kbps = (int32_t)((((bytes_count_in - base->bytes_in.count) * 8 * 1000) / 1024) / duration);
- TSK_DEBUG_INFO("remb_download_kbps=%d", remb_download_kbps);
- }
- base->bytes_in.count_last_time = now;
- base->bytes_in.count = bytes_count_in;
- }
- if (remb_ok) {
- // if "remb_ok" is true then "now" has a valid value
- if ((now - base->time_last_frame_loss_report) > TDAV_SESSION_VIDEO_PKT_LOSS_NO_REPORT_BEFORE_INCREASING_BW) {
- TSK_DEBUG_INFO("No pakt loss since %d millis ... adding 5%% to the estimated max bandwidth", TDAV_SESSION_VIDEO_PKT_LOSS_NO_REPORT_BEFORE_INCREASING_BW);
- remb_download_kbps += (remb_download_kbps / 100) * 5; // add 5% to the estimated bandwidth
- }
- // CLAMP is used to make sure we will not report more than what the user defined as max values even if the estimated values are higher
- bandwidth_max_download_kbps = TSK_CLAMP(0, remb_download_kbps, bandwidth_max_download_kbps);
- }
- }
-#endif /* TDAV_GOOG_REMB_FULL_SUPPORT */
-
- self->fps_changed = tsk_false; // reset
- TSK_DEBUG_INFO("video with congestion control enabled: max_bw_up(unused)=%d kpbs, max_bw_down=%d kpbs", bandwidth_max_upload_kbps, bandwidth_max_download_kbps);
- ret = trtp_manager_set_app_bandwidth_max(base->rtp_manager, bandwidth_max_upload_kbps/* unused */, bandwidth_max_download_kbps);
+
+ time_duration = tsk_time_now() - time_start;
+ if (base->congestion_ctrl_enabled) {
+ tsk_mutex_lock(video->h_mutex_qos);
+ session->qos_metrics.video_dec_avg_time = (unsigned)((session->qos_metrics.video_dec_avg_time + time_duration) / (video->dec_avg_time_n++ ? 2 : 1));
+ tsk_mutex_unlock(video->h_mutex_qos);
}
- // inc() frame count and consume decoded video
- ++self->decoder.codec_decoded_frames_count;
+
+ // consume decoded video
ret = tmedia_consumer_consume(base->consumer, _buffer, _size, __rtp_header);
}
else if (!base->consumer || !base->consumer->is_started) {
TSK_DEBUG_INFO("Consumer not started (is_null=%d)", !base->consumer);
}
-
+
bail:
tsk_safeobj_unlock(base);
-
+
return ret;
}
@@ -1071,36 +1016,36 @@ static int tdav_session_video_set(tmedia_session_t* self, const tmedia_param_t*
int ret = 0;
tdav_session_video_t* video;
tdav_session_av_t* base;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// try with the base class to see if this option is supported or not
if (tdav_session_av_set(TDAV_SESSION_AV(self), param) == tsk_true) {
return 0;
}
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
- if(param->plugin_type == tmedia_ppt_codec){
+
+ if(param->plugin_type == tmedia_ppt_codec) {
tsk_mutex_lock(video->encoder.h_mutex);
ret = tmedia_codec_set((tmedia_codec_t*)video->encoder.codec, param);
tsk_mutex_unlock(video->encoder.h_mutex);
}
- else if(param->plugin_type == tmedia_ppt_consumer){
- if(!base->consumer){
+ else if(param->plugin_type == tmedia_ppt_consumer) {
+ if(!base->consumer) {
TSK_DEBUG_ERROR("No consumer associated to this session");
return -1;
}
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "flip")){
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "flip")) {
tsk_list_item_t* item;
tsk_bool_t flip = (tsk_bool_t)TSK_TO_INT32((uint8_t*)param->value);
tmedia_codecs_L_t *codecs = tsk_object_ref(self->codecs);
- tsk_list_foreach(item, codecs){
+ tsk_list_foreach(item, codecs) {
TMEDIA_CODEC_VIDEO(item->data)->in.flip = flip;
}
tsk_object_unref(codecs);
@@ -1108,17 +1053,17 @@ static int tdav_session_video_set(tmedia_session_t* self, const tmedia_param_t*
}
ret = tmedia_consumer_set(base->consumer, param);
}
- else if(param->plugin_type == tmedia_ppt_producer){
- if(!base->producer){
+ else if(param->plugin_type == tmedia_ppt_producer) {
+ if(!base->producer) {
TSK_DEBUG_ERROR("No producer associated to this session");
return -1;
}
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "flip")){
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "flip")) {
tsk_list_item_t* item;
tsk_bool_t flip = (tsk_bool_t)TSK_TO_INT32((uint8_t*)param->value);
tmedia_codecs_L_t *codecs = tsk_object_ref(self->codecs);
- tsk_list_foreach(item, codecs){
+ tsk_list_foreach(item, codecs) {
TMEDIA_CODEC_VIDEO(item->data)->out.flip = flip;
}
tsk_object_unref(codecs);
@@ -1126,20 +1071,20 @@ static int tdav_session_video_set(tmedia_session_t* self, const tmedia_param_t*
}
ret = tmedia_producer_set(base->producer, param);
}
- else{
- if (param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "bandwidth-level")){
+ else {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "bandwidth-level")) {
tsk_list_item_t* item;
self->bl = (tmedia_bandwidth_level_t)TSK_TO_INT32((uint8_t*)param->value);
self->codecs = tsk_object_ref(self->codecs);
- tsk_list_foreach(item, self->codecs){
+ tsk_list_foreach(item, self->codecs) {
((tmedia_codec_t*)item->data)->bl = self->bl;
}
tsk_object_unref(self->codecs);
}
}
}
-
+
return ret;
}
@@ -1149,7 +1094,7 @@ static int tdav_session_video_get(tmedia_session_t* self, tmedia_param_t* param)
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// try with the base class to see if this option is supported or not
if (tdav_session_av_get(TDAV_SESSION_AV(self), param) == tsk_true) {
return 0;
@@ -1164,7 +1109,7 @@ static int tdav_session_video_get(tmedia_session_t* self, tmedia_param_t* param)
}
}
}
-
+
TSK_DEBUG_WARN("This session doesn't support get(%s)", param->key);
return -2;
}
@@ -1174,17 +1119,17 @@ static int tdav_session_video_prepare(tmedia_session_t* self)
tdav_session_av_t* base = (tdav_session_av_t*)(self);
tdav_session_video_t* video = (tdav_session_video_t*)self;
int ret;
-
- if((ret = tdav_session_av_prepare(base))){
+
+ if((ret = tdav_session_av_prepare(base))) {
TSK_DEBUG_ERROR("tdav_session_av_prepare(video) failed");
return ret;
}
-
- if(base->rtp_manager){
+
+ if(base->rtp_manager) {
ret = trtp_manager_set_rtp_callback(base->rtp_manager, tdav_session_video_rtp_cb, base);
ret = trtp_manager_set_rtcp_callback(base->rtp_manager, tdav_session_video_rtcp_cb, base);
}
-
+
return ret;
}
@@ -1194,20 +1139,20 @@ static int tdav_session_video_start(tmedia_session_t* self)
tdav_session_video_t* video;
const tmedia_codec_t* codec;
tdav_session_av_t* base;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
+
if (video->started) {
TSK_DEBUG_INFO("Video session already started");
return 0;
}
-
+
// ENCODER codec
if (!(codec = tdav_session_av_get_best_neg_codec(base))) {
TSK_DEBUG_ERROR("No codec matched");
@@ -1222,26 +1167,32 @@ static int tdav_session_video_start(tmedia_session_t* self)
return ret;
}
if (!TMEDIA_CODEC(video->encoder.codec)->opened) {
- if((ret = tmedia_codec_open(video->encoder.codec))){
+ if((ret = tmedia_codec_open(video->encoder.codec))) {
tsk_mutex_unlock(video->encoder.h_mutex);
TSK_DEBUG_ERROR("Failed to open [%s] codec", video->encoder.codec->plugin->desc);
return ret;
}
}
tsk_mutex_unlock(video->encoder.h_mutex);
-
+
if (video->jb) {
if ((ret = tdav_video_jb_start(video->jb))) {
TSK_DEBUG_ERROR("Failed to start jitter buffer");
return ret;
}
}
-
+
if ((ret = tdav_session_av_start(base, video->encoder.codec))) {
TSK_DEBUG_ERROR("tdav_session_av_start(video) failed");
return ret;
}
video->started = tsk_true;
+
+ // start timer manager (must be after setting "started" to true)
+ if (tsk_timer_mgr_global_start() == 0) {
+ video->timer.id_qos = tsk_timer_mgr_global_schedule(TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL, _tdav_session_video_timer_cb, video);
+ }
+
return ret;
}
@@ -1250,18 +1201,25 @@ static int tdav_session_video_stop(tmedia_session_t* self)
int ret;
tdav_session_video_t* video;
tdav_session_av_t* base;
-
+
TSK_DEBUG_INFO("tdav_session_video_stop");
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
+
+ // unschedule qos timer
+ if (video->timer.mgr) {
+ tsk_timer_mgr_global_cancel(video->timer.id_qos);
+ video->timer.id_qos = TSK_INVALID_TIMER_ID;
+ // must not stop global timer manager as it's used by other functions
+ }
+
// must be here to make sure no other thread will lock the encoder once we have done it
tsk_mutex_lock(video->encoder.h_mutex); // encoder thread will check "started" var right after the lock is passed
video->started = tsk_false;
tsk_mutex_unlock(video->encoder.h_mutex);
// at this step we're sure that encode() will no longer be called which means we can safely close the codec
-
+
if (video->jb) {
ret = tdav_video_jb_stop(video->jb);
}
@@ -1269,7 +1227,7 @@ static int tdav_session_video_stop(tmedia_session_t* self)
tsk_list_lock(video->avpf.packets);
tsk_list_clear_items(video->avpf.packets);
tsk_list_unlock(video->avpf.packets);
-
+
// tdav_session_av_stop() : stop producer and consumer, close encoder and all other codecs, stop rtpManager...
// no need to lock the encoder to avoid using a closed codec (see above)
// no need to lock the decoder as the rtpManager will be stop before closing the codec
@@ -1279,11 +1237,11 @@ static int tdav_session_video_stop(tmedia_session_t* self)
TSK_OBJECT_SAFE_FREE(video->encoder.codec);
tsk_mutex_unlock(video->encoder.h_mutex);
TSK_OBJECT_SAFE_FREE(video->decoder.codec);
-
+
// reset default values to make sure next start will be called with right defaults
// do not call this function in start to avoid overriding values defined between prepare() and start()
_tdav_session_video_set_defaults(video);
-
+
return ret;
}
@@ -1297,17 +1255,17 @@ static const tsdp_header_M_t* tdav_session_video_get_lo(tmedia_session_t* self)
tsk_bool_t updated = tsk_false;
const tsdp_header_M_t* ret;
tdav_session_av_t* base = TDAV_SESSION_AV(self);
-
- if(!(ret = tdav_session_av_get_lo(base, &updated))){
+
+ if(!(ret = tdav_session_av_get_lo(base, &updated))) {
TSK_DEBUG_ERROR("tdav_session_av_get_lo(video) failed");
return tsk_null;
}
-
- if(updated){
+
+ if(updated) {
// set callbacks
_tdav_session_video_set_callbacks(self);
}
-
+
return ret;
}
@@ -1316,28 +1274,30 @@ static int tdav_session_video_set_ro(tmedia_session_t* self, const tsdp_header_M
int ret;
tsk_bool_t updated = tsk_false;
tdav_session_av_t* base = TDAV_SESSION_AV(self);
-
- if((ret = tdav_session_av_set_ro(base, m, &updated))){
+
+ if((ret = tdav_session_av_set_ro(base, m, &updated))) {
TSK_DEBUG_ERROR("tdav_session_av_set_ro(video) failed");
return ret;
}
-
+
// Check if "RTCP-NACK" and "RTC-FIR" are supported
{
const tmedia_codec_t* codec;
- base->is_fb_fir_neg = base->is_fb_nack_neg = base->is_fb_googremb_neg = tsk_false;
+ base->is_fb_fir_neg = base->is_fb_nack_neg = base->is_fb_googremb_neg = base->is_fb_doubsjcng_neg = tsk_false;
if ((codec = tdav_session_av_get_best_neg_codec(base))) {
// a=rtcp-fb:* ccm fir
// a=rtcp-fb:* nack
// a=rtcp-fb:* goog-remb
- char attr_fir[256], attr_nack[256], attr_goog_remb[256];
+ // a=rtcp-fb:* doubs-jcng
+ char attr_fir[256], attr_nack[256], attr_goog_remb[256], attr_doubs_jcng[256];
int index = 0;
const tsdp_header_A_t* A;
-
+
sprintf(attr_fir, "%s ccm fir", codec->neg_format);
sprintf(attr_nack, "%s nack", codec->neg_format);
sprintf(attr_goog_remb, "%s goog-remb", codec->neg_format);
-
+ sprintf(attr_doubs_jcng, "%s doubs-jcng", codec->neg_format);
+
while ((A = tsdp_header_M_findA_at(m, "rtcp-fb", index++))) {
if (!base->is_fb_fir_neg) {
base->is_fb_fir_neg = (tsk_striequals(A->value, "* ccm fir") || tsk_striequals(A->value, attr_fir));
@@ -1348,15 +1308,18 @@ static int tdav_session_video_set_ro(tmedia_session_t* self, const tsdp_header_M
if (!base->is_fb_googremb_neg) {
base->is_fb_googremb_neg = (tsk_striequals(A->value, "* goog-remb") || tsk_striequals(A->value, attr_goog_remb));
}
- }
+ if (!base->is_fb_doubsjcng_neg) {
+ base->is_fb_doubsjcng_neg = (tsk_striequals(A->value, "* doubs-jcng") || tsk_striequals(A->value, attr_doubs_jcng));
+ }
+ }
}
}
-
+
if (updated) {
// set callbacks
ret = _tdav_session_video_set_callbacks(self);
}
-
+
return ret;
}
@@ -1365,20 +1328,20 @@ static int tdav_session_video_rtcp_set_onevent_cbfn(tmedia_session_t* self, cons
{
tdav_session_video_t* video;
tdav_session_av_t* base;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
+
tsk_safeobj_lock(base);
video->cb_rtcpevent.context = context;
video->cb_rtcpevent.func = func;
tsk_safeobj_unlock(base);
-
+
return 0;
}
@@ -1388,31 +1351,30 @@ static int tdav_session_video_rtcp_send_event(tmedia_session_t* self, tmedia_rtc
tdav_session_video_t* video;
tdav_session_av_t* base;
int ret = -1;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
+
tsk_safeobj_lock(base);
- switch(event_type){
- case tmedia_rtcp_event_type_fir:
- {
- if(base->rtp_manager && base->rtp_manager->is_started){
- if(!ssrc_media){ // when called from C++/Java/C# bindings "ssrc_media" is a default parameter with value=0
- ssrc_media = base->rtp_manager->rtp.ssrc.remote;
- }
- TSK_DEBUG_INFO("Send FIR(%u)", ssrc_media);
- _tdav_session_video_local_request_idr(self, "CALLBACK", ssrc_media);
+ switch(event_type) {
+ case tmedia_rtcp_event_type_fir: {
+ if(base->rtp_manager && base->rtp_manager->is_started) {
+ if(!ssrc_media) { // when called from C++/Java/C# bindings "ssrc_media" is a default parameter with value=0
+ ssrc_media = base->rtp_manager->rtp.ssrc.remote;
}
- break;
+ TSK_DEBUG_INFO("Send FIR(%u)", ssrc_media);
+ _tdav_session_video_local_request_idr(self, "CALLBACK", ssrc_media);
}
+ break;
+ }
}
tsk_safeobj_unlock(base);
-
+
return ret;
}
@@ -1422,39 +1384,179 @@ static int tdav_session_video_rtcp_recv_event(tmedia_session_t* self, tmedia_rtc
tdav_session_video_t* video;
tdav_session_av_t* base;
int ret = -1;
-
- if (!self){
+
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
video = (tdav_session_video_t*)self;
base = (tdav_session_av_t*)self;
-
+
tsk_safeobj_lock(base);
- switch(event_type){
- case tmedia_rtcp_event_type_fir:
- {
- _tdav_session_video_remote_requested_idr(video, ssrc_media);
- ret = 0;
- break;
- }
+ switch(event_type) {
+ case tmedia_rtcp_event_type_fir: {
+ _tdav_session_video_remote_requested_idr(video, ssrc_media);
+ ret = 0;
+ break;
+ }
}
tsk_safeobj_unlock(base);
-
+
+ return ret;
+}
+
+static int _tdav_session_video_timer_cb(const void* arg, tsk_timer_id_t timer_id)
+{
+ /*const*/ tdav_session_video_t* video = (/*const*/ tdav_session_video_t*)tsk_object_ref(TSK_OBJECT(arg));
+ tdav_session_av_t* base = (tdav_session_av_t*)video;
+ tmedia_session_t* session = (tmedia_session_t*)video;
+ if (video->timer.id_qos == timer_id) {
+ if (base->congestion_ctrl_enabled) {
+ tmedia_codec_video_t* codec = tsk_object_ref(TSK_OBJECT(video->encoder.codec));
+ if (codec && video->started) {
+ float q1, q2, q3, q4, q5, qavg, c;
+ uint64_t bw_est_kbps;
+ // Compute average QoS
+ tsk_mutex_lock(video->h_mutex_qos);
+ q1 = video->q1_n ? session->qos_metrics.q1 : 1.f;
+ q2 = video->q2_n ? session->qos_metrics.q2 : 1.f;
+ q3 = video->q3_n ? session->qos_metrics.q3 : 1.f;
+ q4 = video->q4_n ? session->qos_metrics.q4 : 1.f;
+ q5 = video->q5_n ? session->qos_metrics.q5 : 1.f;
+
+ // update bw info
+ if (_tdav_session_video_get_bw_usage_est(video, &bw_est_kbps, /*in=*/tsk_true, /*reset*/tsk_true) == 0 && bw_est_kbps != 0) {
+ session->qos_metrics.bw_down_est_kbps = (unsigned)bw_est_kbps;
+ }
+ if (_tdav_session_video_get_bw_usage_est(video, &bw_est_kbps, /*in=*/tsk_false, /*reset*/tsk_true) == 0 && bw_est_kbps != 0) {
+ session->qos_metrics.bw_up_est_kbps = (unsigned)bw_est_kbps;
+ }
+
+ // update video size
+ session->qos_metrics.video_out_width = codec->out.width;
+ session->qos_metrics.video_out_height = codec->out.height;
+ session->qos_metrics.video_in_width = codec->in.width;
+ session->qos_metrics.video_in_height = codec->in.height;
+ // reset n
+ video->q1_n = video->q2_n = video->q3_n = video->q4_n = video->q5_n = 0;
+ session->qos_metrics.q1 = session->qos_metrics.q2 = session->qos_metrics.q3 = session->qos_metrics.q4 = session->qos_metrics.q5 = 0.f;
+ // continue averaging
+ video->in_avg_fps_n = video->in_avg_fps_n ? 1 : 0;
+ video->dec_avg_time_n = video->dec_avg_time_n ? 1 : 0;
+ video->enc_avg_time_n = video->enc_avg_time_n ? 1 : 0;
+
+ // reset time
+ session->qos_metrics.last_update_time = tsk_time_now();
+ tsk_mutex_unlock(video->h_mutex_qos);
+
+#if 0
+ q1 /= 10.f;
+ q2 /= 10.f;
+ q3 /= 10.f;
+ q4 /= 10.f;
+ q5 /= 10.f;
+#endif
+
+ qavg = q1 * 0.1f + q2 * 0.4f + q3 * 0.1f + q4 * 0.1f + q5 * 0.3f;
+ c = /*fabs*/(qavg - session->qos_metrics.qvag);
+ c = c < 0.f ? -c : +c;
+ TSK_DEBUG_INFO("_tdav_session_video_timer_cb: q1=%f, q2=%f, q3=%f, q4=%f, q5=%f, qavg=%f, c=%f congestion_ctrl_enabled=true", q1, q2, q3, q4, q5, qavg, c);
+
+ if (c > 0.1f) { // quality change > or < 10%
+ // Update the upload bandwidth
+ int32_t bw_up_new_kbps, bw_up_base_kbps = base->bandwidth_max_upload_kbps; // user-defined maximum
+ bw_up_base_kbps = TSK_MIN(tmedia_get_video_bandwidth_kbps_2(codec->out.width, codec->out.height, codec->out.fps), bw_up_base_kbps);
+ bw_up_new_kbps = (int32_t)(bw_up_base_kbps * qavg);
+ TSK_DEBUG_INFO("Video quality change(%d%%) > 10%%, changing bw_up from base=%dkbps to new=%dkbps", (int)(c*100), bw_up_base_kbps, bw_up_new_kbps);
+ _tdav_session_video_bw_kbps(video, bw_up_new_kbps);
+ session->qos_metrics.qvag = qavg;
+ }
+ //!\ update qavg only if condition "c" is true
+ }
+ tsk_object_unref(TSK_OBJECT(codec));
+ }
+ else {
+ TSK_DEBUG_INFO("_tdav_session_video_timer_cb: congestion_ctrl_enabled=false");
+ }
+
+ if (video->started) {
+ video->timer.id_qos = tsk_timer_mgr_global_schedule(TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL, _tdav_session_video_timer_cb, video);
+ }
+ }
+ tsk_object_unref(TSK_OBJECT(video));
+ return 0;
+}
+
+static int _tdav_session_video_get_bw_usage_est(tdav_session_video_t* self, uint64_t* bw_kbps, tsk_bool_t in, tsk_bool_t reset)
+{
+ int ret;
+
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ uint64_t bw_bytes = 0;
+ uint64_t* bytes_in = in ? &bw_bytes : tsk_null;
+ uint64_t* bytes_out = in ? tsk_null : &bw_bytes;
+ uint64_t* count_last_time = in ? &base->bytes_in.count_last_time : &base->bytes_out.count_last_time;
+ uint64_t* count = in ? &base->bytes_in.count : &base->bytes_out.count;
+
+ if ((ret = trtp_manager_get_bytes_count(base->rtp_manager, bytes_in, bytes_out)) == 0) {
+ uint64_t duration, bytes_count_now;
+ bytes_count_now = tsk_time_now();
+ duration = (bytes_count_now - *count_last_time);
+ if (*count_last_time != 0 && duration > 0) {
+ *bw_kbps = ((((bw_bytes - *count) * 8 * 1000) / 1024) / duration);
+ }
+ else {
+ ret = -2;
+ }
+ if (reset) {
+ *count_last_time = bytes_count_now;
+ *count = bw_bytes;
+ }
+ }
+
+ return ret;
+}
+
+static int _tdav_session_video_report_bw_usage_and_jcng(tdav_session_video_t* self)
+{
+ tdav_session_av_t* base = (tdav_session_av_t*)self;
+ tmedia_session_t* session = (tmedia_session_t*)self;
+ int ret = 0;
+ // congetion control
+ // send RTCP-REMB if:
+ // - congestion control is enabled and
+ // - fps changed or
+ // - first frame
+ if (base->congestion_ctrl_enabled && base->rtp_manager && session->qos_metrics.bw_down_est_kbps != 0) {
+# define TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL_HALF (TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL >> 1)
+ tsk_bool_t update_info = (self->fps_changed || self->decoder.codec_decoded_frames_count == 0 || session->qos_metrics.last_update_time == 0 || ((tsk_time_now() - session->qos_metrics.last_update_time) > TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL_HALF));
+ if (update_info) {
+ float jcng_q = 1.f;
+ if (self->jb && self->jb_enabled) {
+ float q5 = 1.f;
+ if ((ret = tdav_video_jb_get_qcong(self->jb, &q5)) == 0) {
+ jcng_q = q5;
+ }
+ }
+ self->fps_changed = tsk_false; // reset
+ TSK_DEBUG_INFO("video with congestion control enabled: est_bw_down=%llukbps, est_jcng=%f", session->qos_metrics.bw_down_est_kbps, jcng_q);
+ ret = trtp_manager_set_app_bw_and_jcng(base->rtp_manager, INT_MAX/* unused */, (int32_t)session->qos_metrics.bw_down_est_kbps, jcng_q);
+ }
+ }
return ret;
}
static int _tdav_session_video_set_callbacks(tmedia_session_t* self)
{
- if(self){
+ if(self) {
tsk_list_item_t* item;
- tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs){
+ tsk_list_foreach(item, TMEDIA_SESSION(self)->neg_codecs) {
// set codec callbacks
tmedia_codec_video_set_enc_callback(TMEDIA_CODEC_VIDEO(item->data), tdav_session_video_raw_cb, self);
tmedia_codec_video_set_dec_callback(TMEDIA_CODEC_VIDEO(item->data), tdav_session_video_decode_cb, self);
// set RED callback: redundant data to decode and send to the consumer
- if(TMEDIA_CODEC(item->data)->plugin == tdav_codec_red_plugin_def_t){
+ if(TMEDIA_CODEC(item->data)->plugin == tdav_codec_red_plugin_def_t) {
tdav_codec_red_set_callback((struct tdav_codec_red_s *)(item->data), tdav_session_video_rtp_cb, self);
}
}
@@ -1470,13 +1572,13 @@ static int _tdav_session_video_init(tdav_session_video_t *p_self, tmedia_type_t
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* init() base */
if ((ret = tdav_session_av_init(p_base, e_media_type)) != 0) {
TSK_DEBUG_ERROR("tdav_session_av_init(video) failed");
return ret;
}
-
+
/* init() self */
_tdav_session_video_set_defaults(p_self);
if (!p_self->encoder.h_mutex && !(p_self->encoder.h_mutex = tsk_mutex_create())) {
@@ -1494,12 +1596,23 @@ static int _tdav_session_video_init(tdav_session_video_t *p_self, tmedia_type_t
}
tdav_video_jb_set_callback(p_self->jb, _tdav_session_video_jb_cb, p_self);
}
-
+
+ /* producer's callbacks */
if (p_base->producer) {
tmedia_producer_set_enc_callback(p_base->producer, tdav_session_video_producer_enc_cb, p_self);
tmedia_producer_set_raw_callback(p_base->producer, tdav_session_video_raw_cb, p_self);
}
-
+
+ if (!p_self->h_mutex_qos && !(p_self->h_mutex_qos = tsk_mutex_create())) {
+ TSK_DEBUG_ERROR("Failed to create qos mutex");
+ return -5;
+ }
+
+ /* timer manager */
+ if(!p_self->timer.mgr) {
+ p_self->timer.mgr = tsk_timer_mgr_global_ref();
+ }
+
return 0;
}
@@ -1511,7 +1624,7 @@ static int _tdav_session_video_init(tdav_session_video_t *p_self, tmedia_type_t
static tsk_object_t* tdav_session_video_ctor(tsk_object_t * self, va_list * app)
{
tdav_session_video_t *video = self;
- if(video){
+ if(video) {
if (_tdav_session_video_init(video, tmedia_video)) {
return tsk_null;
}
@@ -1520,71 +1633,78 @@ static tsk_object_t* tdav_session_video_ctor(tsk_object_t * self, va_list * app)
}
/* destructor */
static tsk_object_t* tdav_session_video_dtor(tsk_object_t * self)
-{
+{
tdav_session_video_t *video = self;
TSK_DEBUG_INFO("*** tdav_session_video_t destroyed ***");
- if(video){
+ if(video) {
tdav_session_video_stop((tmedia_session_t*)video);
// deinit self (rtp manager should be destroyed after the producer)
TSK_OBJECT_SAFE_FREE(video->conv.toYUV420);
TSK_OBJECT_SAFE_FREE(video->conv.fromYUV420);
-
+
TSK_FREE(video->encoder.buffer);
TSK_FREE(video->encoder.conv_buffer);
TSK_FREE(video->decoder.buffer);
TSK_FREE(video->decoder.conv_buffer);
-
+
TSK_OBJECT_SAFE_FREE(video->encoder.codec);
TSK_OBJECT_SAFE_FREE(video->decoder.codec);
-
+
TSK_OBJECT_SAFE_FREE(video->avpf.packets);
-
+
TSK_OBJECT_SAFE_FREE(video->jb);
-
- if(video->encoder.h_mutex){
+
+ /* timer manager */
+ if (video->timer.mgr) {
+ tsk_timer_mgr_global_unref(&video->timer.mgr);
+ }
+
+ if(video->encoder.h_mutex) {
tsk_mutex_destroy(&video->encoder.h_mutex);
}
-
+
+ if (video->h_mutex_qos) {
+ tsk_mutex_destroy(&video->h_mutex_qos);
+ }
+
/* deinit() base */
tdav_session_av_deinit(TDAV_SESSION_AV(video));
-
+
TSK_DEBUG_INFO("*** Video session destroyed ***");
}
-
+
return self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_video_def_s =
-{
+static const tsk_object_def_t tdav_session_video_def_s = {
sizeof(tdav_session_video_t),
- tdav_session_video_ctor,
+ tdav_session_video_ctor,
tdav_session_video_dtor,
- tmedia_session_cmp,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tdav_session_video_plugin_def_s =
-{
+static const tmedia_session_plugin_def_t tdav_session_video_plugin_def_s = {
&tdav_session_video_def_s,
-
+
tmedia_video,
"video",
-
+
tdav_session_video_set,
tdav_session_video_get,
tdav_session_video_prepare,
tdav_session_video_start,
tdav_session_video_pause,
tdav_session_video_stop,
-
+
/* Audio part */
{ tsk_null },
-
+
tdav_session_video_get_lo,
tdav_session_video_set_ro,
-
+
/* T.140 */
{ tsk_null },
-
+
/* Rtcp */
{
tdav_session_video_rtcp_set_onevent_cbfn,
@@ -1601,7 +1721,7 @@ const tmedia_session_plugin_def_t *tdav_session_video_plugin_def_t = &tdav_sessi
static tsk_object_t* tdav_session_bfcpvideo_ctor(tsk_object_t * self, va_list * app)
{
tdav_session_video_t *video = self;
- if(video){
+ if(video) {
if (_tdav_session_video_init(video, tmedia_bfcp_video)) {
return tsk_null;
}
@@ -1609,36 +1729,34 @@ static tsk_object_t* tdav_session_bfcpvideo_ctor(tsk_object_t * self, va_list *
return self;
}
/* object definition */
-static const tsk_object_def_t tdav_session_bfcpvideo_def_s =
-{
+static const tsk_object_def_t tdav_session_bfcpvideo_def_s = {
sizeof(tdav_session_video_t),
- tdav_session_bfcpvideo_ctor,
+ tdav_session_bfcpvideo_ctor,
tdav_session_video_dtor,
- tmedia_session_cmp,
+ tmedia_session_cmp,
};
-static const tmedia_session_plugin_def_t tdav_session_bfcpvideo_plugin_def_s =
-{
+static const tmedia_session_plugin_def_t tdav_session_bfcpvideo_plugin_def_s = {
&tdav_session_bfcpvideo_def_s,
-
+
tmedia_bfcp_video,
"video",
-
+
tdav_session_video_set,
tdav_session_video_get,
tdav_session_video_prepare,
tdav_session_video_start,
tdav_session_video_pause,
tdav_session_video_stop,
-
+
/* Audio part */
{ tsk_null },
-
+
tdav_session_video_get_lo,
tdav_session_video_set_ro,
-
+
/* T.140 */
{ tsk_null },
-
+
/* Rtcp */
{
tdav_session_video_rtcp_set_onevent_cbfn,
diff --git a/tinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c b/tinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c
index ef3152a..cb023fc 100755
--- a/tinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c
+++ b/tinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -53,60 +53,58 @@
#define V4L2_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL("[V4L2 Producer] " FMT, ##__VA_ARGS__)
typedef enum v4l2_io_method_e {
- V4L2_IO_METHOD_NONE = 0,
- V4L2_IO_METHOD_READ,
- V4L2_IO_METHOD_MMAP,
- V4L2_IO_METHOD_USERPTR,
+ V4L2_IO_METHOD_NONE = 0,
+ V4L2_IO_METHOD_READ,
+ V4L2_IO_METHOD_MMAP,
+ V4L2_IO_METHOD_USERPTR,
}
v4l2_io_method_t;
typedef struct v4l2_buffer_s {
- void *p_start;
- size_t n_length;
+ void *p_start;
+ size_t n_length;
}
v4l2_buffer_t;
// By preference order
static const v4l2_io_method_t io_method_prefs[] = {
- V4L2_IO_METHOD_MMAP,
- V4L2_IO_METHOD_USERPTR,
- V4L2_IO_METHOD_READ,
+ V4L2_IO_METHOD_MMAP,
+ V4L2_IO_METHOD_USERPTR,
+ V4L2_IO_METHOD_READ,
};
-static const unsigned int pix_format_prefs[] =
-{
- V4L2_PIX_FMT_YUV420,
- V4L2_PIX_FMT_NV12,
- V4L2_PIX_FMT_NV21,
- V4L2_PIX_FMT_YUYV,
- V4L2_PIX_FMT_UYVY, // SINCITY
- V4L2_PIX_FMT_RGB24,
- V4L2_PIX_FMT_RGB32,
- V4L2_PIX_FMT_MJPEG
+static const unsigned int pix_format_prefs[] = {
+ V4L2_PIX_FMT_YUV420,
+ V4L2_PIX_FMT_NV12,
+ V4L2_PIX_FMT_NV21,
+ V4L2_PIX_FMT_YUYV,
+ V4L2_PIX_FMT_UYVY, // SINCITY
+ V4L2_PIX_FMT_RGB24,
+ V4L2_PIX_FMT_RGB32,
+ V4L2_PIX_FMT_MJPEG
};
-typedef struct tdav_producer_video_v4l2_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- tsk_bool_t b_muted;
- tsk_bool_t b_started;
- tsk_bool_t b_prepared;
- tsk_bool_t b_paused;
-
- int fd;
- v4l2_io_method_t io;
- struct v4l2_format fmt;
- struct v4l2_capability cap;
- struct v4l2_cropcap cropcap;
- struct v4l2_crop crop;
- unsigned int n_buffers;
- v4l2_buffer_t* p_buffers;
-
- tsk_timer_manager_handle_t *p_timer_mgr;
- tsk_timer_id_t id_timer_grab;
- uint64_t u_timout_grab;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_producer_video_v4l2_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_paused;
+
+ int fd;
+ v4l2_io_method_t io;
+ struct v4l2_format fmt;
+ struct v4l2_capability cap;
+ struct v4l2_cropcap cropcap;
+ struct v4l2_crop crop;
+ unsigned int n_buffers;
+ v4l2_buffer_t* p_buffers;
+
+ tsk_timer_manager_handle_t *p_timer_mgr;
+ tsk_timer_id_t id_timer_grab;
+ uint64_t u_timout_grab;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_producer_video_v4l2_t;
@@ -128,956 +126,960 @@ static int _tdav_producer_video_v4l2_grab(tdav_producer_video_v4l2_t* p_self);
/* ============ Media Producer Interface ================= */
static int _tdav_producer_video_v4l2_set(tmedia_producer_t *p_self, const tmedia_param_t* pc_param)
{
- int ret = 0;
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
-
- if (!p_v4l2 || !pc_param) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (pc_param->value_type == tmedia_pvt_pchar) {
- if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
- V4L2_DEBUG_ERROR("Not implemented yet");
- }
- else if (tsk_striequals(pc_param->key, "src-hwnd")) {
- V4L2_DEBUG_ERROR("Not implemented yet");
- }
- }
- else if (pc_param->value_type == tmedia_pvt_int32) {
- if (tsk_striequals(pc_param->key, "mute")) {
- p_v4l2->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
- }
- }
-
- return ret;
+ int ret = 0;
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
+
+ if (!p_v4l2 || !pc_param) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (pc_param->value_type == tmedia_pvt_pchar) {
+ if (tsk_striequals(pc_param->key, "local-hwnd") || tsk_striequals(pc_param->key, "preview-hwnd")) {
+ V4L2_DEBUG_ERROR("Not implemented yet");
+ }
+ else if (tsk_striequals(pc_param->key, "src-hwnd")) {
+ V4L2_DEBUG_ERROR("Not implemented yet");
+ }
+ }
+ else if (pc_param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(pc_param->key, "mute")) {
+ p_v4l2->b_muted = (TSK_TO_INT32((uint8_t*)pc_param->value) != 0);
+ }
+ }
+
+ return ret;
}
static int _tdav_producer_video_v4l2_prepare(tmedia_producer_t* p_self, const tmedia_codec_t* pc_codec)
{
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
- int ret = 0;
-
- if (!p_v4l2 || !pc_codec) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_v4l2);
-
- if (!p_v4l2->p_timer_mgr && !(p_v4l2->p_timer_mgr = tsk_timer_manager_create())) {
- V4L2_DEBUG_ERROR("Failed to create timer manager");
- ret = -2;
- goto bail;
- }
-
- TMEDIA_PRODUCER(p_v4l2)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
- TMEDIA_PRODUCER(p_v4l2)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
- TMEDIA_PRODUCER(p_v4l2)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
-
- p_v4l2->u_timout_grab = (1000/TMEDIA_PRODUCER(p_v4l2)->video.fps);
-
- // prepare()
- if ((ret = _v4l2_prepare(p_v4l2))) {
- goto bail;
- }
-
- // update() - up to the "converter" to perform chroma conversion and scaling
- TMEDIA_PRODUCER(p_v4l2)->video.width = p_v4l2->fmt.fmt.pix.width;
- TMEDIA_PRODUCER(p_v4l2)->video.height = p_v4l2->fmt.fmt.pix.height;
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
+ int ret = 0;
+
+ if (!p_v4l2 || !pc_codec) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_v4l2);
+
+ if (!p_v4l2->p_timer_mgr && !(p_v4l2->p_timer_mgr = tsk_timer_manager_create())) {
+ V4L2_DEBUG_ERROR("Failed to create timer manager");
+ ret = -2;
+ goto bail;
+ }
+
+ TMEDIA_PRODUCER(p_v4l2)->video.fps = TMEDIA_CODEC_VIDEO(pc_codec)->out.fps;
+ TMEDIA_PRODUCER(p_v4l2)->video.width = TMEDIA_CODEC_VIDEO(pc_codec)->out.width;
+ TMEDIA_PRODUCER(p_v4l2)->video.height = TMEDIA_CODEC_VIDEO(pc_codec)->out.height;
+
+ p_v4l2->u_timout_grab = (1000/TMEDIA_PRODUCER(p_v4l2)->video.fps);
+
+ // prepare()
+ if ((ret = _v4l2_prepare(p_v4l2))) {
+ goto bail;
+ }
+
+ // update() - up to the "converter" to perform chroma conversion and scaling
+ TMEDIA_PRODUCER(p_v4l2)->video.width = p_v4l2->fmt.fmt.pix.width;
+ TMEDIA_PRODUCER(p_v4l2)->video.height = p_v4l2->fmt.fmt.pix.height;
#if V4L2_FAKE_UYVY
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_uyvy422;
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_uyvy422;
#else
- switch (p_v4l2->fmt.fmt.pix.pixelformat) {
- case V4L2_PIX_FMT_YUV420:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuv420p;
- break;
- case V4L2_PIX_FMT_NV12:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_nv12;
- break;
- case V4L2_PIX_FMT_NV21:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_nv21;
- break;
- case V4L2_PIX_FMT_YUYV:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuyv422;
- break;
- case V4L2_PIX_FMT_UYVY:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_uyvy422; // SINCITY
- break;
- case V4L2_PIX_FMT_RGB24:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_rgb24;
- break;
- case V4L2_PIX_FMT_RGB32:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_rgb32;
- break;
- case V4L2_PIX_FMT_MJPEG:
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_mjpeg;
- break;
- default:
- V4L2_DEBUG_ERROR("Failed to match negotiated format: %d", p_v4l2->fmt.fmt.pix.pixelformat);
- ret = -1;
- goto bail;
- }
+ switch (p_v4l2->fmt.fmt.pix.pixelformat) {
+ case V4L2_PIX_FMT_YUV420:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuv420p;
+ break;
+ case V4L2_PIX_FMT_NV12:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_nv12;
+ break;
+ case V4L2_PIX_FMT_NV21:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_nv21;
+ break;
+ case V4L2_PIX_FMT_YUYV:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuyv422;
+ break;
+ case V4L2_PIX_FMT_UYVY:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_uyvy422; // SINCITY
+ break;
+ case V4L2_PIX_FMT_RGB24:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_rgb24;
+ break;
+ case V4L2_PIX_FMT_RGB32:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_rgb32;
+ break;
+ case V4L2_PIX_FMT_MJPEG:
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_mjpeg;
+ break;
+ default:
+ V4L2_DEBUG_ERROR("Failed to match negotiated format: %d", p_v4l2->fmt.fmt.pix.pixelformat);
+ ret = -1;
+ goto bail;
+ }
#endif /* V4L2_FAKE_UYVY */
- V4L2_DEBUG_INFO("Negotiated caps: fps=%d, width=%d, height=%d, chroma=%d",
- TMEDIA_PRODUCER(p_v4l2)->video.fps,
- TMEDIA_PRODUCER(p_v4l2)->video.width,
- TMEDIA_PRODUCER(p_v4l2)->video.height,
- TMEDIA_PRODUCER(p_v4l2)->video.chroma);
- p_v4l2->b_prepared = (ret == 0) ? tsk_true : tsk_false;
-
+ V4L2_DEBUG_INFO("Negotiated caps: fps=%d, width=%d, height=%d, chroma=%d",
+ TMEDIA_PRODUCER(p_v4l2)->video.fps,
+ TMEDIA_PRODUCER(p_v4l2)->video.width,
+ TMEDIA_PRODUCER(p_v4l2)->video.height,
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma);
+ p_v4l2->b_prepared = (ret == 0) ? tsk_true : tsk_false;
+
bail:
- tsk_safeobj_unlock(p_v4l2);
- return ret;
+ tsk_safeobj_unlock(p_v4l2);
+ return ret;
}
static int _tdav_producer_video_v4l2_start(tmedia_producer_t* p_self)
{
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
- int ret = 0;
-
- if (!p_v4l2) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_v4l2);
-
- if (!p_v4l2->b_prepared) {
- V4L2_DEBUG_INFO("Not prepared");
- ret = -1;
- goto bail;
- }
-
- p_v4l2->b_paused = tsk_false;
-
- if (p_v4l2->b_started) {
- V4L2_DEBUG_INFO("Already started");
- goto bail;
- }
-
- if ((ret = tsk_timer_manager_start(p_v4l2->p_timer_mgr))) {
- goto bail;
- }
-
- // start()
- if ((ret = _v4l2_start(p_v4l2))) {
- goto bail;
- }
-
- p_v4l2->b_started = tsk_true;
-
- // Schedule frame grabbing
- p_v4l2->id_timer_grab = tsk_timer_manager_schedule(p_v4l2->p_timer_mgr, p_v4l2->u_timout_grab, _tdav_producer_video_v4l2_timer_cb, p_v4l2);
- if (!TSK_TIMER_ID_IS_VALID(p_v4l2->id_timer_grab)) {
- V4L2_DEBUG_ERROR("Failed to schedule timer with timeout=%llu", p_v4l2->u_timout_grab);
- ret = -2;
- goto bail;
- }
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
+ int ret = 0;
+
+ if (!p_v4l2) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_v4l2);
+
+ if (!p_v4l2->b_prepared) {
+ V4L2_DEBUG_INFO("Not prepared");
+ ret = -1;
+ goto bail;
+ }
+
+ p_v4l2->b_paused = tsk_false;
+
+ if (p_v4l2->b_started) {
+ V4L2_DEBUG_INFO("Already started");
+ goto bail;
+ }
+
+ if ((ret = tsk_timer_manager_start(p_v4l2->p_timer_mgr))) {
+ goto bail;
+ }
+
+ // start()
+ if ((ret = _v4l2_start(p_v4l2))) {
+ goto bail;
+ }
+
+ p_v4l2->b_started = tsk_true;
+
+ // Schedule frame grabbing
+ p_v4l2->id_timer_grab = tsk_timer_manager_schedule(p_v4l2->p_timer_mgr, p_v4l2->u_timout_grab, _tdav_producer_video_v4l2_timer_cb, p_v4l2);
+ if (!TSK_TIMER_ID_IS_VALID(p_v4l2->id_timer_grab)) {
+ V4L2_DEBUG_ERROR("Failed to schedule timer with timeout=%llu", p_v4l2->u_timout_grab);
+ ret = -2;
+ goto bail;
+ }
bail:
- if (ret) {
- _v4l2_stop(p_v4l2);
- p_v4l2->b_started = tsk_false;
- if (p_v4l2->p_timer_mgr) {
- tsk_timer_manager_stop(p_v4l2->p_timer_mgr);
- }
- }
- else {
- V4L2_DEBUG_INFO("Started :)");
- }
- tsk_safeobj_unlock(p_v4l2);
-
- return ret;
+ if (ret) {
+ _v4l2_stop(p_v4l2);
+ p_v4l2->b_started = tsk_false;
+ if (p_v4l2->p_timer_mgr) {
+ tsk_timer_manager_stop(p_v4l2->p_timer_mgr);
+ }
+ }
+ else {
+ V4L2_DEBUG_INFO("Started :)");
+ }
+ tsk_safeobj_unlock(p_v4l2);
+
+ return ret;
}
static int _tdav_producer_video_v4l2_pause(tmedia_producer_t* p_self)
{
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
- int ret;
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
+ int ret;
- if (!p_v4l2) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_v4l2) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_v4l2);
+ tsk_safeobj_lock(p_v4l2);
- if ((ret = _v4l2_pause(p_v4l2))) {
- goto bail;
- }
+ if ((ret = _v4l2_pause(p_v4l2))) {
+ goto bail;
+ }
- p_v4l2->b_paused = tsk_true;
- goto bail;
+ p_v4l2->b_paused = tsk_true;
+ goto bail;
bail:
- tsk_safeobj_unlock(p_v4l2);
+ tsk_safeobj_unlock(p_v4l2);
- return ret;
+ return ret;
}
static int _tdav_producer_video_v4l2_stop(tmedia_producer_t* p_self)
{
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
-
- if (!p_v4l2) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_v4l2);
-
- if (!p_v4l2->b_started) {
- V4L2_DEBUG_INFO("Already stopped");
- goto bail;
- }
-
- if (p_v4l2->p_timer_mgr) {
- tsk_timer_manager_stop(p_v4l2->p_timer_mgr);
- }
-
- // next start will be called after prepare()
- _v4l2_unprepare(p_v4l2); // stop() then unprepare()
-
- p_v4l2->b_started = tsk_false;
- p_v4l2->b_paused = tsk_false;
- p_v4l2->b_prepared = tsk_false;
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)p_self;
+
+ if (!p_v4l2) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_v4l2);
+
+ if (!p_v4l2->b_started) {
+ V4L2_DEBUG_INFO("Already stopped");
+ goto bail;
+ }
+
+ if (p_v4l2->p_timer_mgr) {
+ tsk_timer_manager_stop(p_v4l2->p_timer_mgr);
+ }
+
+ // next start will be called after prepare()
+ _v4l2_unprepare(p_v4l2); // stop() then unprepare()
+
+ p_v4l2->b_started = tsk_false;
+ p_v4l2->b_paused = tsk_false;
+ p_v4l2->b_prepared = tsk_false;
bail:
- tsk_safeobj_unlock(p_v4l2);
- V4L2_DEBUG_INFO("Stopped");
+ tsk_safeobj_unlock(p_v4l2);
+ V4L2_DEBUG_INFO("Stopped");
- return 0;
+ return 0;
}
static int _v4l2_prepare(tdav_producer_video_v4l2_t* p_self)
{
-const char* device_names[] =
- {
- tmedia_producer_get_friendly_name(TMEDIA_PRODUCER(p_self)->plugin->type),
- "/dev/video0",
- }; // FIXME: VIDIOC_C_ENUM_INPUT and choose best one
- const char* device_name;
- int i, err = -1;
- struct stat st;
- unsigned int min;
-
- V4L2_DEBUG_INFO("--- PREPARE ---");
-
- if (p_self->fd > 0) {
- V4L2_DEBUG_WARN("Producer already prepared");
- return 0;
- }
- for (i = 0; i < sizeof(device_names)/sizeof(device_names[0]); ++i) {
- if ((device_name = device_names[i])) {
- V4L2_DEBUG_INFO("Preparing '%s'...", device_name);
- if (stat(device_name, &st) == -1) {
- V4L2_DEBUG_WARN("stat('%s'): %d, %s", device_name, errno, strerror(errno));
- continue;
- }
- if (!S_ISCHR(st.st_mode)) {
- V4L2_DEBUG_WARN("'%s' not a valid device", device_name);
- continue;
- }
- if ((p_self->fd = open(device_name, O_RDWR /* required */ | O_NONBLOCK, 0)) == -1) {
- V4L2_DEBUG_WARN("Failed to open '%s': %d, %s\n", device_name, errno, strerror(errno));
- continue;
- }
- V4L2_DEBUG_INFO("'%s' successfully opened", device_name);
- }
- }
- if (p_self->fd == -1) {
- V4L2_DEBUG_ERROR("No valid device found");
- goto bail;
- }
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QUERYCAP, &p_self->cap)) {
- if (EINVAL == errno) {
- V4L2_DEBUG_ERROR("%s is no V4L2 device", device_name);
- goto bail;
- } else {
- V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_QUERYCAP) failed: %s error %d", device_name, strerror(errno), errno);
- goto bail;
- }
- }
-
- if (!(p_self->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
- V4L2_DEBUG_ERROR("%s is no video capture device", device_name);
- goto bail;
- }
-
- // Get best io method
- p_self->io = V4L2_IO_METHOD_NONE;
- for (i = 0; i < sizeof(io_method_prefs)/sizeof(io_method_prefs[0]) && p_self->io == V4L2_IO_METHOD_NONE; ++i) {
- V4L2_DEBUG_INFO("Trying with io method=%d", io_method_prefs[i]);
- switch (io_method_prefs[i]) {
- case V4L2_IO_METHOD_READ:
- if (!(p_self->cap.capabilities & V4L2_CAP_READWRITE)) {
- V4L2_DEBUG_WARN("%s does not support read i/o", device_name);
- continue;
- }
- p_self->io = io_method_prefs[i];
- break;
-
- case V4L2_IO_METHOD_MMAP:
- case V4L2_IO_METHOD_USERPTR:
- if (!(p_self->cap.capabilities & V4L2_CAP_STREAMING)) {
- V4L2_DEBUG_WARN("%s does not support streaming i/o", device_name);
- continue;
- }
- p_self->io = io_method_prefs[i];
- break;
- }
- }
- if (p_self->io == V4L2_IO_METHOD_NONE) {
- V4L2_DEBUG_ERROR("Failed to peek an i/o method for '%s' device", device_name);
- goto bail;
- }
- V4L2_DEBUG_INFO("i/o method for '%s' device is %d", device_name, p_self->io);
-
- /* Select video input, video standard and tune here. */
-
- V4L2_CLEAR(p_self->cropcap);
-
- p_self->cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
- if (0 == _v4l2_xioctl(p_self->fd, VIDIOC_CROPCAP, &p_self->cropcap)) {
- p_self->crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- p_self->crop.c = p_self->cropcap.defrect; /* reset to default */
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_S_CROP, &p_self->crop)) {
- switch (errno) {
- case EINVAL:
- default:
- V4L2_DEBUG_INFO("'%s' device doesn't support cropping", device_name);
- break;
- }
- }
- else {
- V4L2_DEBUG_INFO("'%s' device supports cropping with type = %d", device_name, p_self->crop.type);
- }
- } else {
- V4L2_DEBUG_INFO("'%s' device doesn't support cropping", device_name);
- }
-
- /* Best format */
- V4L2_CLEAR(p_self->fmt);
- // get()
- if (_v4l2_get_best_format(p_self, device_name, &p_self->fmt) != 0) {
- V4L2_DEBUG_ERROR("Failed to peek best format for '%s' device", device_name);
- goto bail;
- }
- // set()
- if (_v4l2_xioctl(p_self->fd, VIDIOC_S_FMT, &p_self->fmt) == -1) {
- goto bail;
- }
- V4L2_DEBUG_INFO("device '%s' best format: width:%d, height:%d, field:%d, pixelformat:%d",
- device_name, p_self->fmt.fmt.pix.width, p_self->fmt.fmt.pix.height, p_self->fmt.fmt.pix.field, p_self->fmt.fmt.pix.pixelformat);
-
- /* Buggy driver paranoia. */
+ const char* device_names[] = {
+ tmedia_producer_get_friendly_name(TMEDIA_PRODUCER(p_self)->plugin->type),
+ "/dev/video0",
+ }; // FIXME: VIDIOC_C_ENUM_INPUT and choose best one
+ const char* device_name;
+ int i, err = -1;
+ struct stat st;
+ unsigned int min;
+
+ V4L2_DEBUG_INFO("--- PREPARE ---");
+
+ if (p_self->fd > 0) {
+ V4L2_DEBUG_WARN("Producer already prepared");
+ return 0;
+ }
+ for (i = 0; i < sizeof(device_names)/sizeof(device_names[0]); ++i) {
+ if ((device_name = device_names[i])) {
+ V4L2_DEBUG_INFO("Preparing '%s'...", device_name);
+ if (stat(device_name, &st) == -1) {
+ V4L2_DEBUG_WARN("stat('%s'): %d, %s", device_name, errno, strerror(errno));
+ continue;
+ }
+ if (!S_ISCHR(st.st_mode)) {
+ V4L2_DEBUG_WARN("'%s' not a valid device", device_name);
+ continue;
+ }
+ if ((p_self->fd = open(device_name, O_RDWR /* required */ | O_NONBLOCK, 0)) == -1) {
+ V4L2_DEBUG_WARN("Failed to open '%s': %d, %s\n", device_name, errno, strerror(errno));
+ continue;
+ }
+ V4L2_DEBUG_INFO("'%s' successfully opened", device_name);
+ }
+ }
+ if (p_self->fd == -1) {
+ V4L2_DEBUG_ERROR("No valid device found");
+ goto bail;
+ }
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QUERYCAP, &p_self->cap)) {
+ if (EINVAL == errno) {
+ V4L2_DEBUG_ERROR("%s is no V4L2 device", device_name);
+ goto bail;
+ }
+ else {
+ V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_QUERYCAP) failed: %s error %d", device_name, strerror(errno), errno);
+ goto bail;
+ }
+ }
+
+ if (!(p_self->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
+ V4L2_DEBUG_ERROR("%s is no video capture device", device_name);
+ goto bail;
+ }
+
+ // Get best io method
+ p_self->io = V4L2_IO_METHOD_NONE;
+ for (i = 0; i < sizeof(io_method_prefs)/sizeof(io_method_prefs[0]) && p_self->io == V4L2_IO_METHOD_NONE; ++i) {
+ V4L2_DEBUG_INFO("Trying with io method=%d", io_method_prefs[i]);
+ switch (io_method_prefs[i]) {
+ case V4L2_IO_METHOD_READ:
+ if (!(p_self->cap.capabilities & V4L2_CAP_READWRITE)) {
+ V4L2_DEBUG_WARN("%s does not support read i/o", device_name);
+ continue;
+ }
+ p_self->io = io_method_prefs[i];
+ break;
+
+ case V4L2_IO_METHOD_MMAP:
+ case V4L2_IO_METHOD_USERPTR:
+ if (!(p_self->cap.capabilities & V4L2_CAP_STREAMING)) {
+ V4L2_DEBUG_WARN("%s does not support streaming i/o", device_name);
+ continue;
+ }
+ p_self->io = io_method_prefs[i];
+ break;
+ }
+ }
+ if (p_self->io == V4L2_IO_METHOD_NONE) {
+ V4L2_DEBUG_ERROR("Failed to peek an i/o method for '%s' device", device_name);
+ goto bail;
+ }
+ V4L2_DEBUG_INFO("i/o method for '%s' device is %d", device_name, p_self->io);
+
+ /* Select video input, video standard and tune here. */
+
+ V4L2_CLEAR(p_self->cropcap);
+
+ p_self->cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+ if (0 == _v4l2_xioctl(p_self->fd, VIDIOC_CROPCAP, &p_self->cropcap)) {
+ p_self->crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ p_self->crop.c = p_self->cropcap.defrect; /* reset to default */
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_S_CROP, &p_self->crop)) {
+ switch (errno) {
+ case EINVAL:
+ default:
+ V4L2_DEBUG_INFO("'%s' device doesn't support cropping", device_name);
+ break;
+ }
+ }
+ else {
+ V4L2_DEBUG_INFO("'%s' device supports cropping with type = %d", device_name, p_self->crop.type);
+ }
+ }
+ else {
+ V4L2_DEBUG_INFO("'%s' device doesn't support cropping", device_name);
+ }
+
+ /* Best format */
+ V4L2_CLEAR(p_self->fmt);
+ // get()
+ if (_v4l2_get_best_format(p_self, device_name, &p_self->fmt) != 0) {
+ V4L2_DEBUG_ERROR("Failed to peek best format for '%s' device", device_name);
+ goto bail;
+ }
+ // set()
+ if (_v4l2_xioctl(p_self->fd, VIDIOC_S_FMT, &p_self->fmt) == -1) {
+ goto bail;
+ }
+ V4L2_DEBUG_INFO("device '%s' best format: width:%d, height:%d, field:%d, pixelformat:%d",
+ device_name, p_self->fmt.fmt.pix.width, p_self->fmt.fmt.pix.height, p_self->fmt.fmt.pix.field, p_self->fmt.fmt.pix.pixelformat);
+
+ /* Buggy driver paranoia. */
#if 1
- min = p_self->fmt.fmt.pix.width * 2;
- if (p_self->fmt.fmt.pix.bytesperline < min) {
- p_self->fmt.fmt.pix.bytesperline = min;
- }
- min = p_self->fmt.fmt.pix.bytesperline * p_self->fmt.fmt.pix.height;
- if (p_self->fmt.fmt.pix.sizeimage < min) {
- p_self->fmt.fmt.pix.sizeimage = min;
- }
+ min = p_self->fmt.fmt.pix.width * 2;
+ if (p_self->fmt.fmt.pix.bytesperline < min) {
+ p_self->fmt.fmt.pix.bytesperline = min;
+ }
+ min = p_self->fmt.fmt.pix.bytesperline * p_self->fmt.fmt.pix.height;
+ if (p_self->fmt.fmt.pix.sizeimage < min) {
+ p_self->fmt.fmt.pix.sizeimage = min;
+ }
#endif
- switch (p_self->io) {
- case V4L2_IO_METHOD_READ:
- if (_v4l2_init_read(p_self, p_self->fmt.fmt.pix.sizeimage) != 0) {
- goto bail;
- }
- break;
-
- case V4L2_IO_METHOD_MMAP:
- if (_v4l2_init_mmap(p_self, device_name) != 0) {
- goto bail;
- }
- break;
-
- case V4L2_IO_METHOD_USERPTR:
- if (_v4l2_init_userp(p_self, p_self->fmt.fmt.pix.sizeimage, device_name) != 0) {
- goto bail;
- }
- break;
- }
- V4L2_DEBUG_INFO("'%s' device initialized using i/o method=%d", device_name, p_self->io);
-
- // all is OK
- err = 0;
+ switch (p_self->io) {
+ case V4L2_IO_METHOD_READ:
+ if (_v4l2_init_read(p_self, p_self->fmt.fmt.pix.sizeimage) != 0) {
+ goto bail;
+ }
+ break;
+
+ case V4L2_IO_METHOD_MMAP:
+ if (_v4l2_init_mmap(p_self, device_name) != 0) {
+ goto bail;
+ }
+ break;
+
+ case V4L2_IO_METHOD_USERPTR:
+ if (_v4l2_init_userp(p_self, p_self->fmt.fmt.pix.sizeimage, device_name) != 0) {
+ goto bail;
+ }
+ break;
+ }
+ V4L2_DEBUG_INFO("'%s' device initialized using i/o method=%d", device_name, p_self->io);
+
+ // all is OK
+ err = 0;
bail:
- if (err) {
- _v4l2_unprepare(p_self);
- }
- else {
- V4L2_DEBUG_INFO("Prepared :)");
- }
- return err;
+ if (err) {
+ _v4l2_unprepare(p_self);
+ }
+ else {
+ V4L2_DEBUG_INFO("Prepared :)");
+ }
+ return err;
}
static int _v4l2_start(tdav_producer_video_v4l2_t* p_self)
{
- unsigned int i;
- enum v4l2_buf_type type;
-
- V4L2_DEBUG_INFO("--- START ---");
-
- if (p_self->b_started) {
- V4L2_DEBUG_WARN("Already started");
- return 0;
- }
-
- switch (p_self->io) {
- case V4L2_IO_METHOD_READ:
- /* Nothing to do. */
- break;
-
- case V4L2_IO_METHOD_MMAP:
- for (i = 0; i < p_self->n_buffers; ++i) {
- struct v4l2_buffer buf;
-
- V4L2_CLEAR(buf);
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- buf.index = i;
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_QBUF) failed: %s error %d", strerror(errno), errno);
- return -1;
- }
- }
- type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMON, &type)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMON) failed: %s error %d", strerror(errno), errno);
- return -1;
- }
- break;
-
- case V4L2_IO_METHOD_USERPTR:
- for (i = 0; i < p_self->n_buffers; ++i) {
- struct v4l2_buffer buf;
-
- V4L2_CLEAR(buf);
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_USERPTR;
- buf.index = i;
- buf.m.userptr = (unsigned long)p_self->p_buffers[i].p_start;
- buf.length = p_self->p_buffers[i].n_length;
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_QBUF) failed: %s error %d", strerror(errno), errno);
- return -1;
- }
- }
- type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMON, &type)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMON) failed: %s error %d", strerror(errno), errno);
- return -1;
- }
- break;
- }
- return 0;
+ unsigned int i;
+ enum v4l2_buf_type type;
+
+ V4L2_DEBUG_INFO("--- START ---");
+
+ if (p_self->b_started) {
+ V4L2_DEBUG_WARN("Already started");
+ return 0;
+ }
+
+ switch (p_self->io) {
+ case V4L2_IO_METHOD_READ:
+ /* Nothing to do. */
+ break;
+
+ case V4L2_IO_METHOD_MMAP:
+ for (i = 0; i < p_self->n_buffers; ++i) {
+ struct v4l2_buffer buf;
+
+ V4L2_CLEAR(buf);
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ buf.memory = V4L2_MEMORY_MMAP;
+ buf.index = i;
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_QBUF) failed: %s error %d", strerror(errno), errno);
+ return -1;
+ }
+ }
+ type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMON, &type)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMON) failed: %s error %d", strerror(errno), errno);
+ return -1;
+ }
+ break;
+
+ case V4L2_IO_METHOD_USERPTR:
+ for (i = 0; i < p_self->n_buffers; ++i) {
+ struct v4l2_buffer buf;
+
+ V4L2_CLEAR(buf);
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ buf.index = i;
+ buf.m.userptr = (unsigned long)p_self->p_buffers[i].p_start;
+ buf.length = p_self->p_buffers[i].n_length;
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_QBUF) failed: %s error %d", strerror(errno), errno);
+ return -1;
+ }
+ }
+ type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMON, &type)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMON) failed: %s error %d", strerror(errno), errno);
+ return -1;
+ }
+ break;
+ }
+ return 0;
}
static int _v4l2_pause(tdav_producer_video_v4l2_t* p_self)
{
- V4L2_DEBUG_INFO("--- PAUSE ---");
+ V4L2_DEBUG_INFO("--- PAUSE ---");
- return 0;
+ return 0;
}
static int _v4l2_stop(tdav_producer_video_v4l2_t* p_self)
{
- enum v4l2_buf_type type;
-
- V4L2_DEBUG_INFO("--- STOP ---");
-
- switch (p_self->io) {
- case V4L2_IO_METHOD_READ:
- /* Nothing to do. */
- break;
-
- case V4L2_IO_METHOD_MMAP:
- case V4L2_IO_METHOD_USERPTR:
- type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if (p_self->fd != -1 && -1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMOFF, &type)) {
- if (p_self->b_started) { // display error only if the device is marked as "started"
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMOFF) failed: %s error %d", strerror(errno), errno);
- return -1;
- }
- }
- break;
- }
-
- return 0;
+ enum v4l2_buf_type type;
+
+ V4L2_DEBUG_INFO("--- STOP ---");
+
+ switch (p_self->io) {
+ case V4L2_IO_METHOD_READ:
+ /* Nothing to do. */
+ break;
+
+ case V4L2_IO_METHOD_MMAP:
+ case V4L2_IO_METHOD_USERPTR:
+ type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (p_self->fd != -1 && -1 == _v4l2_xioctl(p_self->fd, VIDIOC_STREAMOFF, &type)) {
+ if (p_self->b_started) { // display error only if the device is marked as "started"
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_STREAMOFF) failed: %s error %d", strerror(errno), errno);
+ return -1;
+ }
+ }
+ break;
+ }
+
+ return 0;
}
static int _v4l2_unprepare(tdav_producer_video_v4l2_t* p_self)
{
- unsigned int i;
- V4L2_DEBUG_INFO("--- UNPREPARE ---");
-
- _v4l2_stop(p_self);
-
- switch (p_self->io) {
- case V4L2_IO_METHOD_READ:
- if (p_self->p_buffers && p_self->p_buffers[0].p_start) {
- free(p_self->p_buffers[0].p_start);
- p_self->p_buffers[0].p_start = NULL;
- }
- break;
- case V4L2_IO_METHOD_MMAP:
- for (i = 0; i < p_self->n_buffers; ++i) {
- if (p_self->p_buffers && p_self->p_buffers[i].p_start) {
- if (-1 == munmap(p_self->p_buffers[i].p_start, p_self->p_buffers[i].n_length)) {
- V4L2_DEBUG_ERROR("munmap(%d) failed", i);
- }
- }
- }
- break;
-
- case V4L2_IO_METHOD_USERPTR:
- for (i = 0; i < p_self->n_buffers; ++i) {
- if (p_self->p_buffers && p_self->p_buffers[i].p_start) {
- free(p_self->p_buffers[i].p_start);
- p_self->p_buffers[i].p_start = NULL;
- }
- }
- break;
- }
-
- if (p_self->p_buffers) {
- free(p_self->p_buffers);
- p_self->p_buffers = NULL;
- }
- p_self->n_buffers = 0;
-
- if (p_self->fd > 0) {
- close(p_self->fd);
- }
- p_self->fd = -1;
-
- return 0;
+ unsigned int i;
+ V4L2_DEBUG_INFO("--- UNPREPARE ---");
+
+ _v4l2_stop(p_self);
+
+ switch (p_self->io) {
+ case V4L2_IO_METHOD_READ:
+ if (p_self->p_buffers && p_self->p_buffers[0].p_start) {
+ free(p_self->p_buffers[0].p_start);
+ p_self->p_buffers[0].p_start = NULL;
+ }
+ break;
+ case V4L2_IO_METHOD_MMAP:
+ for (i = 0; i < p_self->n_buffers; ++i) {
+ if (p_self->p_buffers && p_self->p_buffers[i].p_start) {
+ if (-1 == munmap(p_self->p_buffers[i].p_start, p_self->p_buffers[i].n_length)) {
+ V4L2_DEBUG_ERROR("munmap(%d) failed", i);
+ }
+ }
+ }
+ break;
+
+ case V4L2_IO_METHOD_USERPTR:
+ for (i = 0; i < p_self->n_buffers; ++i) {
+ if (p_self->p_buffers && p_self->p_buffers[i].p_start) {
+ free(p_self->p_buffers[i].p_start);
+ p_self->p_buffers[i].p_start = NULL;
+ }
+ }
+ break;
+ }
+
+ if (p_self->p_buffers) {
+ free(p_self->p_buffers);
+ p_self->p_buffers = NULL;
+ }
+ p_self->n_buffers = 0;
+
+ if (p_self->fd > 0) {
+ close(p_self->fd);
+ }
+ p_self->fd = -1;
+
+ return 0;
}
static int _v4l2_xioctl(int fh, int request, void *arg)
{
- int r;
- do {
- r = ioctl(fh, request, arg);
- } while (-1 == r && EINTR == errno);
- return r;
+ int r;
+ do {
+ r = ioctl(fh, request, arg);
+ }
+ while (-1 == r && EINTR == errno);
+ return r;
}
static int _v4l2_get_best_format(tdav_producer_video_v4l2_t* p_self, const char* device_name, struct v4l2_format* fmt_ret)
{
- struct v4l2_format fmt, fmt_default, fmt_best;
- struct v4l2_fmtdesc fmtdesc;
- int i, j, field, size;
- int ok = 0;
-
- if (!fmt_ret) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // get default format
- V4L2_CLEAR(fmt_default);
- fmt_default.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if (_v4l2_xioctl(p_self->fd, VIDIOC_G_FMT, &fmt_default) == -1) {
- V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_G_FMT) failed: %s error %d", device_name, strerror(errno), errno);
- return -1;
- }
- V4L2_DEBUG_INFO("device '%s' default format: width:%d, height:%d, field:%d, pixelformat:%d",
- device_name, fmt_default.fmt.pix.width, fmt_default.fmt.pix.height, fmt_default.fmt.pix.field, fmt_default.fmt.pix.pixelformat);
-
- /* Best format (using preference) */
- V4L2_CLEAR(fmt);
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- for (i = 0; i < sizeof(pix_format_prefs)/sizeof(pix_format_prefs[0]); ++i) {
- for (size = 0; size < 2; ++size) {
- for (field = 0; field < 2; ++field) {
- fmt.fmt.pix.width = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.width : fmt_default.fmt.pix.width;
- fmt.fmt.pix.height = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.height : fmt_default.fmt.pix.height;
- fmt.fmt.pix.pixelformat = pix_format_prefs[i];
- fmt.fmt.pix.field = (field == 0) ? V4L2_FIELD_NONE : V4L2_FIELD_INTERLACED;
- if ((ok = (_v4l2_xioctl(p_self->fd, VIDIOC_TRY_FMT, &fmt) != -1))) {
- goto bail;
- }
- }
- }
- }
-
- /* Best format (using caps) */
- for (i = 0; ; ++i) {
- V4L2_CLEAR(fmtdesc);
- fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- fmtdesc.index = i;
-
- if (_v4l2_xioctl(p_self->fd, VIDIOC_ENUM_FMT, &fmtdesc) == -1) {
- break;
- }
- V4L2_DEBUG_INFO("CAPS: device name=%s, fmtdesc index=%d, type=%d, description=%s, pixelformat=%d",
- device_name, fmtdesc.index, fmtdesc.type, fmtdesc.description, fmtdesc.pixelformat);
- for (j = 0; j < sizeof(pix_format_prefs)/sizeof(pix_format_prefs[0]); ++j) {
- if (fmtdesc.pixelformat == pix_format_prefs[j]) {
- for (size = 0; size < 2; ++size) {
- for (field = 0; field < 2; ++field) {
- fmt.fmt.pix.width = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.width : fmt_default.fmt.pix.width;
- fmt.fmt.pix.height = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.height : fmt_default.fmt.pix.height;
- fmt.fmt.pix.pixelformat = pix_format_prefs[i];
- fmt.fmt.pix.field = (field == 0) ? V4L2_FIELD_NONE : V4L2_FIELD_INTERLACED;
- if ((ok = (_v4l2_xioctl(p_self->fd, VIDIOC_TRY_FMT, &fmt) != -1))) {
- goto bail;
- }
- }
- }
- }
- }
- }
+ struct v4l2_format fmt, fmt_default, fmt_best;
+ struct v4l2_fmtdesc fmtdesc;
+ int i, j, field, size;
+ int ok = 0;
+
+ if (!fmt_ret) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // get default format
+ V4L2_CLEAR(fmt_default);
+ fmt_default.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (_v4l2_xioctl(p_self->fd, VIDIOC_G_FMT, &fmt_default) == -1) {
+ V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_G_FMT) failed: %s error %d", device_name, strerror(errno), errno);
+ return -1;
+ }
+ V4L2_DEBUG_INFO("device '%s' default format: width:%d, height:%d, field:%d, pixelformat:%d",
+ device_name, fmt_default.fmt.pix.width, fmt_default.fmt.pix.height, fmt_default.fmt.pix.field, fmt_default.fmt.pix.pixelformat);
+
+ /* Best format (using preference) */
+ V4L2_CLEAR(fmt);
+ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ for (i = 0; i < sizeof(pix_format_prefs)/sizeof(pix_format_prefs[0]); ++i) {
+ for (size = 0; size < 2; ++size) {
+ for (field = 0; field < 2; ++field) {
+ fmt.fmt.pix.width = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.width : fmt_default.fmt.pix.width;
+ fmt.fmt.pix.height = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.height : fmt_default.fmt.pix.height;
+ fmt.fmt.pix.pixelformat = pix_format_prefs[i];
+ fmt.fmt.pix.field = (field == 0) ? V4L2_FIELD_NONE : V4L2_FIELD_INTERLACED;
+ if ((ok = (_v4l2_xioctl(p_self->fd, VIDIOC_TRY_FMT, &fmt) != -1))) {
+ goto bail;
+ }
+ }
+ }
+ }
+
+ /* Best format (using caps) */
+ for (i = 0; ; ++i) {
+ V4L2_CLEAR(fmtdesc);
+ fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ fmtdesc.index = i;
+
+ if (_v4l2_xioctl(p_self->fd, VIDIOC_ENUM_FMT, &fmtdesc) == -1) {
+ break;
+ }
+ V4L2_DEBUG_INFO("CAPS: device name=%s, fmtdesc index=%d, type=%d, description=%s, pixelformat=%d",
+ device_name, fmtdesc.index, fmtdesc.type, fmtdesc.description, fmtdesc.pixelformat);
+ for (j = 0; j < sizeof(pix_format_prefs)/sizeof(pix_format_prefs[0]); ++j) {
+ if (fmtdesc.pixelformat == pix_format_prefs[j]) {
+ for (size = 0; size < 2; ++size) {
+ for (field = 0; field < 2; ++field) {
+ fmt.fmt.pix.width = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.width : fmt_default.fmt.pix.width;
+ fmt.fmt.pix.height = (size == 0) ? TMEDIA_PRODUCER(p_self)->video.height : fmt_default.fmt.pix.height;
+ fmt.fmt.pix.pixelformat = pix_format_prefs[i];
+ fmt.fmt.pix.field = (field == 0) ? V4L2_FIELD_NONE : V4L2_FIELD_INTERLACED;
+ if ((ok = (_v4l2_xioctl(p_self->fd, VIDIOC_TRY_FMT, &fmt) != -1))) {
+ goto bail;
+ }
+ }
+ }
+ }
+ }
+ }
bail:
- if (ok) {
- memcpy(fmt_ret, &fmt, sizeof(fmt));
- }
- return ok ? 0 : -1;
+ if (ok) {
+ memcpy(fmt_ret, &fmt, sizeof(fmt));
+ }
+ return ok ? 0 : -1;
}
static int _v4l2_init_read(tdav_producer_video_v4l2_t* p_self, unsigned int buffer_size)
{
- if (p_self->p_buffers) {
- V4L2_DEBUG_ERROR("Buffers already initialized");
- return -1;
- }
- if (!buffer_size) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!(p_self->p_buffers = calloc(1, sizeof(*p_self->p_buffers)))) {
- V4L2_DEBUG_ERROR("Out of memory");
- return -1;
- }
-
- p_self->p_buffers[0].n_length = buffer_size;
- p_self->p_buffers[0].p_start = tsk_malloc(buffer_size);
-
- if (!p_self->p_buffers[0].p_start) {
- V4L2_DEBUG_ERROR("Out of memory");
- return -1;
- }
-
- return 0;
+ if (p_self->p_buffers) {
+ V4L2_DEBUG_ERROR("Buffers already initialized");
+ return -1;
+ }
+ if (!buffer_size) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!(p_self->p_buffers = calloc(1, sizeof(*p_self->p_buffers)))) {
+ V4L2_DEBUG_ERROR("Out of memory");
+ return -1;
+ }
+
+ p_self->p_buffers[0].n_length = buffer_size;
+ p_self->p_buffers[0].p_start = tsk_malloc(buffer_size);
+
+ if (!p_self->p_buffers[0].p_start) {
+ V4L2_DEBUG_ERROR("Out of memory");
+ return -1;
+ }
+
+ return 0;
}
static int _v4l2_init_mmap(tdav_producer_video_v4l2_t* p_self, const char* device_name)
{
- struct v4l2_requestbuffers req;
-
- V4L2_CLEAR(req);
-
- req.count = 4;
- req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- req.memory = V4L2_MEMORY_MMAP;
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_REQBUFS, &req)) {
- if (EINVAL == errno) {
- V4L2_DEBUG_ERROR("%s does not support memory mapping", device_name);
- return -1;
- } else {
- V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
- return -1;
- }
- }
-
- if (req.count < 2) {
- V4L2_DEBUG_ERROR("Insufficient buffer memory on %s", device_name);
- return -1;
- }
-
- if (!(p_self->p_buffers = tsk_calloc(req.count, sizeof(*p_self->p_buffers)))) {
- V4L2_DEBUG_ERROR("Out of memory");
- return -1;
- }
-
- for (p_self->n_buffers = 0; p_self->n_buffers < req.count; ++p_self->n_buffers) {
- struct v4l2_buffer buf;
-
- V4L2_CLEAR(buf);
-
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- buf.index = p_self->n_buffers;
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QUERYBUF, &buf)) {
- V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
- return -1;
- }
-
- p_self->p_buffers[p_self->n_buffers].n_length = buf.length;
- p_self->p_buffers[p_self->n_buffers].p_start = mmap(NULL /* start anywhere */,
- buf.length,
- PROT_READ | PROT_WRITE /* required */,
- MAP_SHARED /* recommended */,
- p_self->fd, buf.m.offset);
-
- if (MAP_FAILED == p_self->p_buffers[p_self->n_buffers].p_start) {
- V4L2_DEBUG_ERROR("mmap(%s) failed: %s error %d", device_name, strerror(errno), errno);
- return -1;
- }
- }
-
- return 0;
+ struct v4l2_requestbuffers req;
+
+ V4L2_CLEAR(req);
+
+ req.count = 4;
+ req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ req.memory = V4L2_MEMORY_MMAP;
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_REQBUFS, &req)) {
+ if (EINVAL == errno) {
+ V4L2_DEBUG_ERROR("%s does not support memory mapping", device_name);
+ return -1;
+ }
+ else {
+ V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
+ return -1;
+ }
+ }
+
+ if (req.count < 2) {
+ V4L2_DEBUG_ERROR("Insufficient buffer memory on %s", device_name);
+ return -1;
+ }
+
+ if (!(p_self->p_buffers = tsk_calloc(req.count, sizeof(*p_self->p_buffers)))) {
+ V4L2_DEBUG_ERROR("Out of memory");
+ return -1;
+ }
+
+ for (p_self->n_buffers = 0; p_self->n_buffers < req.count; ++p_self->n_buffers) {
+ struct v4l2_buffer buf;
+
+ V4L2_CLEAR(buf);
+
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ buf.memory = V4L2_MEMORY_MMAP;
+ buf.index = p_self->n_buffers;
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QUERYBUF, &buf)) {
+ V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
+ return -1;
+ }
+
+ p_self->p_buffers[p_self->n_buffers].n_length = buf.length;
+ p_self->p_buffers[p_self->n_buffers].p_start = mmap(NULL /* start anywhere */,
+ buf.length,
+ PROT_READ | PROT_WRITE /* required */,
+ MAP_SHARED /* recommended */,
+ p_self->fd, buf.m.offset);
+
+ if (MAP_FAILED == p_self->p_buffers[p_self->n_buffers].p_start) {
+ V4L2_DEBUG_ERROR("mmap(%s) failed: %s error %d", device_name, strerror(errno), errno);
+ return -1;
+ }
+ }
+
+ return 0;
}
static int _v4l2_init_userp(tdav_producer_video_v4l2_t* p_self, unsigned int buffer_size, const char* device_name)
{
- struct v4l2_requestbuffers req;
-
- V4L2_CLEAR(req);
-
- req.count = 4;
- req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- req.memory = V4L2_MEMORY_USERPTR;
-
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_REQBUFS, &req)) {
- if (EINVAL == errno) {
- V4L2_DEBUG_ERROR("%s does not support user pointer i/o", device_name);
- return -1;
- } else {
- V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
- return -1;
- }
- }
-
- if (!(p_self->p_buffers = tsk_calloc(4, sizeof(*p_self->p_buffers)))) {
- V4L2_DEBUG_ERROR("Out of memory");
- return -1;
- }
-
- for (p_self->n_buffers = 0; p_self->n_buffers < 4; ++p_self->n_buffers) {
- p_self->p_buffers[p_self->n_buffers].n_length = buffer_size;
- p_self->p_buffers[p_self->n_buffers].p_start = tsk_malloc(buffer_size);
-
- if (!p_self->p_buffers[p_self->n_buffers].p_start) {
- V4L2_DEBUG_ERROR("Out of memory");
- return -1;
- }
- }
-
- return 0;
+ struct v4l2_requestbuffers req;
+
+ V4L2_CLEAR(req);
+
+ req.count = 4;
+ req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ req.memory = V4L2_MEMORY_USERPTR;
+
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_REQBUFS, &req)) {
+ if (EINVAL == errno) {
+ V4L2_DEBUG_ERROR("%s does not support user pointer i/o", device_name);
+ return -1;
+ }
+ else {
+ V4L2_DEBUG_ERROR("xioctl(%s, VIDIOC_REQBUFS) failed: %s error %d", device_name, strerror(errno), errno);
+ return -1;
+ }
+ }
+
+ if (!(p_self->p_buffers = tsk_calloc(4, sizeof(*p_self->p_buffers)))) {
+ V4L2_DEBUG_ERROR("Out of memory");
+ return -1;
+ }
+
+ for (p_self->n_buffers = 0; p_self->n_buffers < 4; ++p_self->n_buffers) {
+ p_self->p_buffers[p_self->n_buffers].n_length = buffer_size;
+ p_self->p_buffers[p_self->n_buffers].p_start = tsk_malloc(buffer_size);
+
+ if (!p_self->p_buffers[p_self->n_buffers].p_start) {
+ V4L2_DEBUG_ERROR("Out of memory");
+ return -1;
+ }
+ }
+
+ return 0;
}
static int _v4l2_send_frame(tdav_producer_video_v4l2_t* p_self)
{
- struct v4l2_buffer buf;
- unsigned int i;
+ struct v4l2_buffer buf;
+ unsigned int i;
#define V4L2_SEND_BUFF(_buff, _size) \
TMEDIA_PRODUCER(p_self)->enc_cb.callback(TMEDIA_PRODUCER(p_self)->enc_cb.callback_data, (_buff), (_size));
#if V4L2_FAKE_UYVY
- {
- tsk_size_t size = (TMEDIA_PRODUCER(p_self)->video.width * TMEDIA_PRODUCER(p_self)->video.height) << 1;
- uint8_t* buff = (uint8_t*)tsk_malloc(size);
- if (buff) {
- tsk_size_t i;
- for (i = 0; i < size; ++i) {
- buff[i] = rand() & 254;
- }
- V4L2_SEND_BUFF(buff, size);
- tsk_free((void**)&buff);
- }
- return 0;
- }
+ {
+ tsk_size_t size = (TMEDIA_PRODUCER(p_self)->video.width * TMEDIA_PRODUCER(p_self)->video.height) << 1;
+ uint8_t* buff = (uint8_t*)tsk_malloc(size);
+ if (buff) {
+ tsk_size_t i;
+ for (i = 0; i < size; ++i) {
+ buff[i] = rand() & 254;
+ }
+ V4L2_SEND_BUFF(buff, size);
+ tsk_free((void**)&buff);
+ }
+ return 0;
+ }
#endif
- switch (p_self->io) {
- case V4L2_IO_METHOD_READ:
- if (-1 == read(p_self->fd, p_self->p_buffers[0].p_start, p_self->p_buffers[0].n_length)) {
- switch (errno) {
- case EAGAIN:
- return 0;
+ switch (p_self->io) {
+ case V4L2_IO_METHOD_READ:
+ if (-1 == read(p_self->fd, p_self->p_buffers[0].p_start, p_self->p_buffers[0].n_length)) {
+ switch (errno) {
+ case EAGAIN:
+ return 0;
- case EIO:
- /* Could ignore EIO, see spec. */
+ case EIO:
+ /* Could ignore EIO, see spec. */
- /* fall through */
+ /* fall through */
- default:
- V4L2_DEBUG_ERROR("read() failed: %s error %d", strerror(errno), errno);
- break;
- }
- }
+ default:
+ V4L2_DEBUG_ERROR("read() failed: %s error %d", strerror(errno), errno);
+ break;
+ }
+ }
- V4L2_SEND_BUFF(p_self->p_buffers[0].p_start, p_self->p_buffers[0].n_length);
- return 0;
+ V4L2_SEND_BUFF(p_self->p_buffers[0].p_start, p_self->p_buffers[0].n_length);
+ return 0;
- case V4L2_IO_METHOD_MMAP:
- V4L2_CLEAR(buf);
+ case V4L2_IO_METHOD_MMAP:
+ V4L2_CLEAR(buf);
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ buf.memory = V4L2_MEMORY_MMAP;
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_DQBUF, &buf)) {
- switch (errno) {
- case EAGAIN:
- V4L2_DEBUG_INFO("EAGAIN");
- return 0;
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_DQBUF, &buf)) {
+ switch (errno) {
+ case EAGAIN:
+ V4L2_DEBUG_INFO("EAGAIN");
+ return 0;
- case EIO:
- /* Could ignore EIO, see spec. */
+ case EIO:
+ /* Could ignore EIO, see spec. */
- /* fall through */
+ /* fall through */
- default:
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
- break;
- }
- }
+ default:
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
+ break;
+ }
+ }
- assert(buf.index < p_self->n_buffers);
+ assert(buf.index < p_self->n_buffers);
- V4L2_SEND_BUFF(p_self->p_buffers[buf.index].p_start, buf.bytesused);
+ V4L2_SEND_BUFF(p_self->p_buffers[buf.index].p_start, buf.bytesused);
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
- break;
- }
- return 0;
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
+ break;
+ }
+ return 0;
- case V4L2_IO_METHOD_USERPTR:
- V4L2_CLEAR(buf);
+ case V4L2_IO_METHOD_USERPTR:
+ V4L2_CLEAR(buf);
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_USERPTR;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ buf.memory = V4L2_MEMORY_USERPTR;
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_DQBUF, &buf)) {
- switch (errno) {
- case EAGAIN:
- V4L2_DEBUG_INFO("EAGAIN");
- return 0;
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_DQBUF, &buf)) {
+ switch (errno) {
+ case EAGAIN:
+ V4L2_DEBUG_INFO("EAGAIN");
+ return 0;
- case EIO:
- /* Could ignore EIO, see spec. */
+ case EIO:
+ /* Could ignore EIO, see spec. */
- /* fall through */
+ /* fall through */
- default:
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
- break;
- }
- }
+ default:
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
+ break;
+ }
+ }
- for (i = 0; i < p_self->n_buffers; ++i) {
- if (buf.m.userptr == (unsigned long)p_self->p_buffers[i].p_start && buf.length == p_self->p_buffers[i].n_length) {
- break;
- }
- }
+ for (i = 0; i < p_self->n_buffers; ++i) {
+ if (buf.m.userptr == (unsigned long)p_self->p_buffers[i].p_start && buf.length == p_self->p_buffers[i].n_length) {
+ break;
+ }
+ }
- V4L2_SEND_BUFF((void *)buf.m.userptr, buf.bytesused);
+ V4L2_SEND_BUFF((void *)buf.m.userptr, buf.bytesused);
- if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
- V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
- break;
- }
- return 0;
- }
+ if (-1 == _v4l2_xioctl(p_self->fd, VIDIOC_QBUF, &buf)) {
+ V4L2_DEBUG_ERROR("xioctl(VIDIOC_DQBUF) failed: %s error %d", strerror(errno), errno);
+ break;
+ }
+ return 0;
+ }
- return -1;
+ return -1;
}
static int _tdav_producer_video_v4l2_timer_cb(const void* arg, tsk_timer_id_t timer_id)
{
- tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)arg;
- int ret = 0;
-
- tsk_safeobj_lock(p_v4l2);
-
- if (p_v4l2->id_timer_grab == timer_id) {
- if (ret = _tdav_producer_video_v4l2_grab(p_v4l2)) {
- // goto bail;
- }
- if (p_v4l2->b_started) {
- p_v4l2->id_timer_grab = tsk_timer_manager_schedule(p_v4l2->p_timer_mgr, p_v4l2->u_timout_grab, _tdav_producer_video_v4l2_timer_cb, p_v4l2);
- if (!TSK_TIMER_ID_IS_VALID(p_v4l2->id_timer_grab)) {
- V4L2_DEBUG_ERROR("Failed to schedule timer with timeout=%llu", p_v4l2->u_timout_grab);
- ret = -2;
- goto bail;
- }
- }
- }
+ tdav_producer_video_v4l2_t* p_v4l2 = (tdav_producer_video_v4l2_t*)arg;
+ int ret = 0;
+
+ tsk_safeobj_lock(p_v4l2);
+
+ if (p_v4l2->id_timer_grab == timer_id) {
+ if (ret = _tdav_producer_video_v4l2_grab(p_v4l2)) {
+ // goto bail;
+ }
+ if (p_v4l2->b_started) {
+ p_v4l2->id_timer_grab = tsk_timer_manager_schedule(p_v4l2->p_timer_mgr, p_v4l2->u_timout_grab, _tdav_producer_video_v4l2_timer_cb, p_v4l2);
+ if (!TSK_TIMER_ID_IS_VALID(p_v4l2->id_timer_grab)) {
+ V4L2_DEBUG_ERROR("Failed to schedule timer with timeout=%llu", p_v4l2->u_timout_grab);
+ ret = -2;
+ goto bail;
+ }
+ }
+ }
bail:
- tsk_safeobj_unlock(p_v4l2);
- return ret;
+ tsk_safeobj_unlock(p_v4l2);
+ return ret;
}
static int _tdav_producer_video_v4l2_grab(tdav_producer_video_v4l2_t* p_self)
{
- int ret = 0, r;
- fd_set fds;
- struct timeval tv;
-
- if (!p_self) {
- V4L2_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_self);
-
- if (!p_self->b_started) {
- V4L2_DEBUG_ERROR("producer not started yet");
- ret = -2;
- goto bail;
- }
-
- if (!TMEDIA_PRODUCER(p_self)->enc_cb.callback) {
- goto bail;
- }
-
- FD_ZERO(&fds);
- FD_SET(p_self->fd, &fds);
-
- /* Timeout. */
- tv.tv_sec = 0;
- tv.tv_usec = (p_self->id_timer_grab * 1000);
- while (tv.tv_usec >= 1000000) {
- tv.tv_usec -= 1000000;
- tv.tv_sec++;
- }
-
- r = select(p_self->fd + 1, &fds, NULL, NULL, &tv);
-
- if (-1 == r) {
- if (EINTR == errno) {
- V4L2_DEBUG_INFO("select() returned EINTR");
- }
- else {
- V4L2_DEBUG_ERROR("select() failed: %s error %d", strerror(errno), errno);
- }
- goto bail;
- }
-
- if (0 == r) {
- V4L2_DEBUG_INFO("select() timeout: %s error %d", strerror(errno), errno);
- goto bail;
- }
- // Grab a frame
- if ((ret = _v4l2_send_frame(p_self))) {
- goto bail;
- }
+ int ret = 0, r;
+ fd_set fds;
+ struct timeval tv;
+
+ if (!p_self) {
+ V4L2_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(p_self);
+
+ if (!p_self->b_started) {
+ V4L2_DEBUG_ERROR("producer not started yet");
+ ret = -2;
+ goto bail;
+ }
+
+ if (!TMEDIA_PRODUCER(p_self)->enc_cb.callback) {
+ goto bail;
+ }
+
+ FD_ZERO(&fds);
+ FD_SET(p_self->fd, &fds);
+
+ /* Timeout. */
+ tv.tv_sec = 0;
+ tv.tv_usec = (p_self->id_timer_grab * 1000);
+ while (tv.tv_usec >= 1000000) {
+ tv.tv_usec -= 1000000;
+ tv.tv_sec++;
+ }
+
+ r = select(p_self->fd + 1, &fds, NULL, NULL, &tv);
+
+ if (-1 == r) {
+ if (EINTR == errno) {
+ V4L2_DEBUG_INFO("select() returned EINTR");
+ }
+ else {
+ V4L2_DEBUG_ERROR("select() failed: %s error %d", strerror(errno), errno);
+ }
+ goto bail;
+ }
+
+ if (0 == r) {
+ V4L2_DEBUG_INFO("select() timeout: %s error %d", strerror(errno), errno);
+ goto bail;
+ }
+ // Grab a frame
+ if ((ret = _v4l2_send_frame(p_self))) {
+ goto bail;
+ }
bail:
- tsk_safeobj_unlock(p_self);
+ tsk_safeobj_unlock(p_self);
- return ret;
+ return ret;
}
//
@@ -1086,78 +1088,75 @@ bail:
/* constructor */
static tsk_object_t* _tdav_producer_video_v4l2_ctor(tsk_object_t *self, va_list * app)
{
- tdav_producer_video_v4l2_t *p_v4l2 = (tdav_producer_video_v4l2_t *)self;
- if (p_v4l2) {
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(p_v4l2));
- TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuv420p;
- /* init self with default values*/
- p_v4l2->fd = -1;
- TMEDIA_PRODUCER(p_v4l2)->video.fps = 15;
- TMEDIA_PRODUCER(p_v4l2)->video.width = 352;
- TMEDIA_PRODUCER(p_v4l2)->video.height = 288;
-
- tsk_safeobj_init(p_v4l2);
- }
- return self;
+ tdav_producer_video_v4l2_t *p_v4l2 = (tdav_producer_video_v4l2_t *)self;
+ if (p_v4l2) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(p_v4l2));
+ TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuv420p;
+ /* init self with default values*/
+ p_v4l2->fd = -1;
+ TMEDIA_PRODUCER(p_v4l2)->video.fps = 15;
+ TMEDIA_PRODUCER(p_v4l2)->video.width = 352;
+ TMEDIA_PRODUCER(p_v4l2)->video.height = 288;
+
+ tsk_safeobj_init(p_v4l2);
+ }
+ return self;
}
/* destructor */
static tsk_object_t* _tdav_producer_video_v4l2_dtor(tsk_object_t * self)
-{
- tdav_producer_video_v4l2_t *p_v4l2 = (tdav_producer_video_v4l2_t *)self;
- if (p_v4l2) {
- /* stop */
- if (p_v4l2->b_started) {
- _tdav_producer_video_v4l2_stop((tmedia_producer_t*)p_v4l2);
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(p_v4l2));
- /* deinit self */
- _v4l2_unprepare(p_v4l2);
- TSK_OBJECT_SAFE_FREE(p_v4l2->p_timer_mgr);
- tsk_safeobj_deinit(p_v4l2);
-
- V4L2_DEBUG_INFO("*** destroyed ***");
- }
-
- return self;
+{
+ tdav_producer_video_v4l2_t *p_v4l2 = (tdav_producer_video_v4l2_t *)self;
+ if (p_v4l2) {
+ /* stop */
+ if (p_v4l2->b_started) {
+ _tdav_producer_video_v4l2_stop((tmedia_producer_t*)p_v4l2);
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(p_v4l2));
+ /* deinit self */
+ _v4l2_unprepare(p_v4l2);
+ TSK_OBJECT_SAFE_FREE(p_v4l2->p_timer_mgr);
+ tsk_safeobj_deinit(p_v4l2);
+
+ V4L2_DEBUG_INFO("*** destroyed ***");
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_video_v4l2_def_s =
-{
- sizeof(tdav_producer_video_v4l2_t),
- _tdav_producer_video_v4l2_ctor,
- _tdav_producer_video_v4l2_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_video_v4l2_def_s = {
+ sizeof(tdav_producer_video_v4l2_t),
+ _tdav_producer_video_v4l2_ctor,
+ _tdav_producer_video_v4l2_dtor,
+ tsk_null,
};
/* plugin definition*/
// Video
-static const tmedia_producer_plugin_def_t tdav_producer_video_v4l2_plugin_def_s =
-{
- &tdav_producer_video_v4l2_def_s,
- tmedia_video,
- "V4L2 video producer",
-
- _tdav_producer_video_v4l2_set,
- _tdav_producer_video_v4l2_prepare,
- _tdav_producer_video_v4l2_start,
- _tdav_producer_video_v4l2_pause,
- _tdav_producer_video_v4l2_stop
+static const tmedia_producer_plugin_def_t tdav_producer_video_v4l2_plugin_def_s = {
+ &tdav_producer_video_v4l2_def_s,
+ tmedia_video,
+ "V4L2 video producer",
+
+ _tdav_producer_video_v4l2_set,
+ _tdav_producer_video_v4l2_prepare,
+ _tdav_producer_video_v4l2_start,
+ _tdav_producer_video_v4l2_pause,
+ _tdav_producer_video_v4l2_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_video_v4l2_plugin_def_t = &tdav_producer_video_v4l2_plugin_def_s;
// Screencast
-static const tmedia_producer_plugin_def_t tdav_producer_screencast_v4l2_plugin_def_s =
-{
- &tdav_producer_video_v4l2_def_s,
- tmedia_bfcp_video,
- "V4L2 screencast producer",
-
- _tdav_producer_video_v4l2_set,
- _tdav_producer_video_v4l2_prepare,
- _tdav_producer_video_v4l2_start,
- _tdav_producer_video_v4l2_pause,
- _tdav_producer_video_v4l2_stop
+static const tmedia_producer_plugin_def_t tdav_producer_screencast_v4l2_plugin_def_s = {
+ &tdav_producer_video_v4l2_def_s,
+ tmedia_bfcp_video,
+ "V4L2 screencast producer",
+
+ _tdav_producer_video_v4l2_set,
+ _tdav_producer_video_v4l2_prepare,
+ _tdav_producer_video_v4l2_start,
+ _tdav_producer_video_v4l2_pause,
+ _tdav_producer_video_v4l2_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_screencast_v4l2_plugin_def_t = &tdav_producer_screencast_v4l2_plugin_def_s;
#endif /* HAVE_LINUX_VIDEODEV2_H */
diff --git a/tinyDAV/src/video/winm/tdav_consumer_winm.cxx b/tinyDAV/src/video/winm/tdav_consumer_winm.cxx
index b608a72..6bae661 100755
--- a/tinyDAV/src/video/winm/tdav_consumer_winm.cxx
+++ b/tinyDAV/src/video/winm/tdav_consumer_winm.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,9 +33,8 @@ using namespace doubango_rt::BackEnd;
#endif
-typedef struct tdav_consumer_winm_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_winm_s {
+ TMEDIA_DECLARE_CONSUMER;
}
tdav_consumer_winm_t;
@@ -44,111 +43,109 @@ tdav_consumer_winm_t;
/* ============ Media Producer Interface ================= */
int tdav_consumer_winm_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
+ int ret = 0;
- if(!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return ret;
+ return ret;
}
int tdav_consumer_winm_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
-
- if(!consumer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) {
- TMEDIA_CONSUMER(consumer)->decoder.codec_id = codec->id;
- }
- else {
- TMEDIA_CONSUMER(consumer)->decoder.codec_id = tmedia_codec_id_none;
- }
-
- TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
-
- if(!TMEDIA_CONSUMER(consumer)->video.display.width){
- TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
- }
- if(!TMEDIA_CONSUMER(consumer)->video.display.height){
- TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
- }
-
- return 0;
+ tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
+
+ if(!consumer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) {
+ TMEDIA_CONSUMER(consumer)->decoder.codec_id = codec->id;
+ }
+ else {
+ TMEDIA_CONSUMER(consumer)->decoder.codec_id = tmedia_codec_id_none;
+ }
+
+ TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+
+ if(!TMEDIA_CONSUMER(consumer)->video.display.width) {
+ TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
+ }
+ if(!TMEDIA_CONSUMER(consumer)->video.display.height) {
+ TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
+ }
+
+ return 0;
}
int tdav_consumer_winm_start(tmedia_consumer_t* self)
{
- tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
+ tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TDAV_UNDER_WINDOWS_PHONE
- if(Globals::Instance->VideoRenderer != nullptr)
- {
- Globals::Instance->VideoRenderer->Start();
- }
+ if(Globals::Instance->VideoRenderer != nullptr) {
+ Globals::Instance->VideoRenderer->Start();
+ }
#endif
- return 0;
+ return 0;
}
int tdav_consumer_winm_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
+ tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
#if TDAV_UNDER_WINDOWS_PHONE
- static const UINT64 hnsPresenationTime = 0;
- static const UINT64 hnsSampleDuration = 0;
+ static const UINT64 hnsPresenationTime = 0;
+ static const UINT64 hnsSampleDuration = 0;
- Globals::Instance->ReceiveVideoFrame((BYTE*)buffer, size, hnsPresenationTime, hnsSampleDuration);
+ Globals::Instance->ReceiveVideoFrame((BYTE*)buffer, size, hnsPresenationTime, hnsSampleDuration);
#endif
-
- return 0;
+
+ return 0;
}
int tdav_consumer_winm_pause(tmedia_consumer_t* self)
{
- tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
+ tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
- if(!consumer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!consumer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tdav_consumer_winm_stop(tmedia_consumer_t* self)
{
- tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
+ tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
- TSK_DEBUG_INFO("tdav_consumer_winm_stop");
+ TSK_DEBUG_INFO("tdav_consumer_winm_stop");
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TDAV_UNDER_WINDOWS_PHONE
- if(Globals::Instance->VideoRenderer != nullptr)
- {
- Globals::Instance->VideoRenderer->Stop();
- }
+ if(Globals::Instance->VideoRenderer != nullptr) {
+ Globals::Instance->VideoRenderer->Stop();
+ }
#endif
- return 0;
+ return 0;
}
@@ -158,60 +155,58 @@ int tdav_consumer_winm_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* tdav_consumer_winm_ctor(tsk_object_t * self, va_list * app)
{
- tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
- if(consumer){
- /* init base */
- tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
- TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
-
- /* init self */
- TMEDIA_CONSUMER(consumer)->video.fps = 15;
- TMEDIA_CONSUMER(consumer)->video.display.width = 352;
- TMEDIA_CONSUMER(consumer)->video.display.height = 288;
- TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
- }
- return self;
+ tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
+ if(consumer) {
+ /* init base */
+ tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
+ TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
+
+ /* init self */
+ TMEDIA_CONSUMER(consumer)->video.fps = 15;
+ TMEDIA_CONSUMER(consumer)->video.display.width = 352;
+ TMEDIA_CONSUMER(consumer)->video.display.height = 288;
+ TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_winm_dtor(tsk_object_t * self)
-{
- tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
- if(consumer){
+{
+ tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
+ if(consumer) {
- /* stop */
- //if(consumer->started){
- tdav_consumer_winm_stop((tmedia_consumer_t*)self);
- //}
+ /* stop */
+ //if(consumer->started){
+ tdav_consumer_winm_stop((tmedia_consumer_t*)self);
+ //}
- /* deinit base */
- tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
- /* deinit self */
- }
+ /* deinit base */
+ tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
+ /* deinit self */
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_consumer_winm_def_s =
-{
- sizeof(tdav_consumer_winm_t),
- tdav_consumer_winm_ctor,
- tdav_consumer_winm_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_consumer_winm_def_s = {
+ sizeof(tdav_consumer_winm_t),
+ tdav_consumer_winm_ctor,
+ tdav_consumer_winm_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t tdav_consumer_winm_plugin_def_s =
-{
- &tdav_consumer_winm_def_s,
-
- tmedia_video,
- "Microsoft Windows Media consumer (Video)",
-
- tdav_consumer_winm_set,
- tdav_consumer_winm_prepare,
- tdav_consumer_winm_start,
- tdav_consumer_winm_consume,
- tdav_consumer_winm_pause,
- tdav_consumer_winm_stop
+static const tmedia_consumer_plugin_def_t tdav_consumer_winm_plugin_def_s = {
+ &tdav_consumer_winm_def_s,
+
+ tmedia_video,
+ "Microsoft Windows Media consumer (Video)",
+
+ tdav_consumer_winm_set,
+ tdav_consumer_winm_prepare,
+ tdav_consumer_winm_start,
+ tdav_consumer_winm_consume,
+ tdav_consumer_winm_pause,
+ tdav_consumer_winm_stop
};
extern const tmedia_consumer_plugin_def_t *tdav_consumer_winm_plugin_def_t = &tdav_consumer_winm_plugin_def_s;
diff --git a/tinyDAV/src/video/winm/tdav_producer_winm.cxx b/tinyDAV/src/video/winm/tdav_producer_winm.cxx
index 398340a..3854cdc 100755
--- a/tinyDAV/src/video/winm/tdav_producer_winm.cxx
+++ b/tinyDAV/src/video/winm/tdav_producer_winm.cxx
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -44,88 +44,84 @@ struct tdav_producer_winm_s;
namespace Doubango
{
- namespace VoIP
- {
- class CaptureSampleSink :
- public Microsoft::WRL::RuntimeClass<
- Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>,
- ICameraCaptureSampleSink>
- {
- DWORD m_dwSampleCount;
- const struct tdav_producer_winm_s* m_pProducer;
-
- public:
-
- STDMETHODIMP RuntimeClassInitialize(const struct tdav_producer_winm_s* pProducer)
- {
- m_dwSampleCount = 0;
- m_pProducer = pProducer;
- return S_OK;
- }
+namespace VoIP
+{
+class CaptureSampleSink :
+ public Microsoft::WRL::RuntimeClass<
+ Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>,
+ ICameraCaptureSampleSink>
+{
+ DWORD m_dwSampleCount;
+ const struct tdav_producer_winm_s* m_pProducer;
- DWORD GetSampleCount()
- {
- return m_dwSampleCount;
- }
+public:
- IFACEMETHODIMP_(void)
- OnSampleAvailable(
- ULONGLONG hnsPresentationTime,
- ULONGLONG hnsSampleDuration,
- DWORD cbSample,
- BYTE* pSample)
- {
- m_dwSampleCount++;
- if(m_pProducer && TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback)
- {
- TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback_data, pSample, cbSample);
- }
- }
- };
+ STDMETHODIMP RuntimeClassInitialize(const struct tdav_producer_winm_s* pProducer) {
+ m_dwSampleCount = 0;
+ m_pProducer = pProducer;
+ return S_OK;
+ }
- ref class VideoCapturePhone sealed
- {
- public:
- virtual ~VideoCapturePhone();
- internal:
- VideoCapturePhone();
+ DWORD GetSampleCount() {
+ return m_dwSampleCount;
+ }
- int Prepare(const struct tdav_producer_winm_s* winm);
- int Start();
- int Pause();
- int Stop();
- void SetCameraLocation(Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation);
- void ToggleCamera();
+ IFACEMETHODIMP_(void)
+ OnSampleAvailable(
+ ULONGLONG hnsPresentationTime,
+ ULONGLONG hnsSampleDuration,
+ DWORD cbSample,
+ BYTE* pSample) {
+ m_dwSampleCount++;
+ if(m_pProducer && TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback) {
+ TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback_data, pSample, cbSample);
+ }
+ }
+};
+
+ref class VideoCapturePhone sealed
+{
+public:
+ virtual ~VideoCapturePhone();
+internal:
+ VideoCapturePhone();
+
+ int Prepare(const struct tdav_producer_winm_s* winm);
+ int Start();
+ int Pause();
+ int Stop();
+ void SetCameraLocation(Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation);
+ void ToggleCamera();
- private:
- int UnPrepare();
- void ToggleCameraThread(Windows::Foundation::IAsyncAction^ operation);
+private:
+ int UnPrepare();
+ void ToggleCameraThread(Windows::Foundation::IAsyncAction^ operation);
- tsk_mutex_handle_t* m_hMutex;
+ tsk_mutex_handle_t* m_hMutex;
- const tdav_producer_winm_s* m_pWrappedPlugin;
+ const tdav_producer_winm_s* m_pWrappedPlugin;
- // Has capture started?
- bool m_bStarted, m_bPrepared;
+ // Has capture started?
+ bool m_bStarted, m_bPrepared;
- // Events to signal whether capture has stopped/started
- HANDLE m_hStopCompleted;
- HANDLE m_hStartCompleted;
+ // Events to signal whether capture has stopped/started
+ HANDLE m_hStopCompleted;
+ HANDLE m_hStartCompleted;
- IAsyncOperation<AudioVideoCaptureDevice^> ^m_pOpenOperation;
+ IAsyncOperation<AudioVideoCaptureDevice^> ^m_pOpenOperation;
- Windows::Foundation::IAsyncAction^ m_ToggleThread;
+ Windows::Foundation::IAsyncAction^ m_ToggleThread;
- // Native sink and video device
- CaptureSampleSink *m_pVideoSink;
- IAudioVideoCaptureDeviceNative *m_pVideoDevice;
+ // Native sink and video device
+ CaptureSampleSink *m_pVideoSink;
+ IAudioVideoCaptureDeviceNative *m_pVideoDevice;
- Windows::Phone::Media::Capture::CameraSensorLocation m_eCameraLocation;
+ Windows::Phone::Media::Capture::CameraSensorLocation m_eCameraLocation;
- Windows::Phone::Media::Capture::AudioVideoCaptureDevice ^m_pVideoOnlyDevice;
- Windows::Foundation::IAsyncAction ^m_pVideoCaptureAction;
- };
- }
+ Windows::Phone::Media::Capture::AudioVideoCaptureDevice ^m_pVideoOnlyDevice;
+ Windows::Foundation::IAsyncAction ^m_pVideoCaptureAction;
+};
+}
}
using namespace Doubango::VoIP;
@@ -133,11 +129,10 @@ using namespace Doubango::VoIP;
#endif
-typedef struct tdav_producer_winm_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_winm_s {
+ TMEDIA_DECLARE_PRODUCER;
#if TDAV_UNDER_WINDOWS_PHONE
- VideoCapturePhone^ videoCapturePhone;
+ VideoCapturePhone^ videoCapturePhone;
#endif
}
tdav_producer_winm_t;
@@ -146,104 +141,103 @@ tdav_producer_winm_t;
/* ============ Media Producer Interface ================= */
static int tdav_producer_winm_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
- int ret = 0;
- tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
-
- if(!producer || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(param->value_type == tmedia_pvt_int32){
- if(tsk_striequals(param->key, "camera-location")){
- Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation = (Windows::Phone::Media::Capture::CameraSensorLocation)*((int32_t*)param->value);
- if(producer->videoCapturePhone)
- {
- producer->videoCapturePhone->SetCameraLocation(cameraLocation);
- return 0;
- }
- }
- }
-
- return ret;
+ int ret = 0;
+ tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
+
+ if(!producer || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(param->value_type == tmedia_pvt_int32) {
+ if(tsk_striequals(param->key, "camera-location")) {
+ Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation = (Windows::Phone::Media::Capture::CameraSensorLocation)*((int32_t*)param->value);
+ if(producer->videoCapturePhone) {
+ producer->videoCapturePhone->SetCameraLocation(cameraLocation);
+ return 0;
+ }
+ }
+ }
+
+ return ret;
}
static int tdav_producer_winm_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
-
- if(!producer || !codec && codec->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) {
- TMEDIA_PRODUCER(producer)->encoder.codec_id = codec->id;
- }
- else {
- TMEDIA_PRODUCER(producer)->encoder.codec_id = tmedia_codec_id_none;
- }
- TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
- TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
- TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
+ tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
+
+ if(!producer || !codec && codec->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(codec->id == tmedia_codec_id_h264_bp || codec->id == tmedia_codec_id_h264_mp) {
+ TMEDIA_PRODUCER(producer)->encoder.codec_id = codec->id;
+ }
+ else {
+ TMEDIA_PRODUCER(producer)->encoder.codec_id = tmedia_codec_id_none;
+ }
+ TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
+ TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
+ TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
#if TDAV_UNDER_WINDOWS_PHONE
- return producer->videoCapturePhone->Prepare(producer);
+ return producer->videoCapturePhone->Prepare(producer);
#else
- TSK_DEBUG_ERROR("Unexpected code called");
- return -1;
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -1;
#endif
}
static int tdav_producer_winm_start(tmedia_producer_t* self)
{
- tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
+ tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TDAV_UNDER_WINDOWS_PHONE
- return producer->videoCapturePhone->Start();
+ return producer->videoCapturePhone->Start();
#else
- TSK_DEBUG_ERROR("Unexpected code called");
- return -1;
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -1;
#endif
}
static int tdav_producer_winm_pause(tmedia_producer_t* self)
{
- tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
+ tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
- if(!producer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!producer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TDAV_UNDER_WINDOWS_PHONE
- return producer->videoCapturePhone->Pause();
+ return producer->videoCapturePhone->Pause();
#else
- TSK_DEBUG_ERROR("Unexpected code called");
- return -1;
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -1;
#endif
}
static int tdav_producer_winm_stop(tmedia_producer_t* self)
{
- tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
+ tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TDAV_UNDER_WINDOWS_PHONE
- return producer->videoCapturePhone->Stop();
+ return producer->videoCapturePhone->Stop();
#else
- TSK_DEBUG_ERROR("Unexpected code called");
- return -1;
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -1;
#endif
}
@@ -252,273 +246,242 @@ static int tdav_producer_winm_stop(tmedia_producer_t* self)
VideoCapturePhone::VideoCapturePhone() :
m_bStarted(false),
- m_bPrepared(false),
+ m_bPrepared(false),
m_pVideoOnlyDevice(nullptr),
m_pVideoSink(NULL),
m_pVideoDevice(NULL),
- m_pWrappedPlugin(NULL),
- m_pOpenOperation(nullptr),
+ m_pWrappedPlugin(NULL),
+ m_pOpenOperation(nullptr),
m_eCameraLocation(CameraSensorLocation::Front)
{
- if(!(m_hMutex = tsk_mutex_create())){
- throw ref new Platform::FailureException(L"Failed to create mutex");
- }
+ if(!(m_hMutex = tsk_mutex_create())) {
+ throw ref new Platform::FailureException(L"Failed to create mutex");
+ }
m_hStopCompleted = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
- if (!m_hStopCompleted)
- {
+ if (!m_hStopCompleted) {
throw ref new Platform::Exception(HRESULT_FROM_WIN32(GetLastError()), L"Could not create shutdown event");
}
m_hStartCompleted = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
- if (!m_hStartCompleted)
- {
+ if (!m_hStartCompleted) {
throw ref new Platform::Exception(HRESULT_FROM_WIN32(GetLastError()), L"Could not create start event");
}
}
VideoCapturePhone::~VideoCapturePhone()
{
- Stop();
+ Stop();
- if(m_ToggleThread)
- {
+ if(m_ToggleThread) {
m_ToggleThread->Cancel();
m_ToggleThread->Close();
m_ToggleThread = nullptr;
}
- tsk_mutex_destroy(&m_hMutex);
+ tsk_mutex_destroy(&m_hMutex);
}
int VideoCapturePhone::Prepare(const struct tdav_producer_winm_s* winm)
{
- HRESULT hr = E_FAIL;
- int ret = 0;
- Windows::Foundation::Size dimensionsRequested, dimensionsClosest;
- Collections::IVectorView<Size> ^availableSizes;
- Collections::IIterator<Windows::Foundation::Size> ^availableSizesIterator;
- bool bClosestFound = false;
-
- #define WINM_SET_ERROR(code) ret = (code); goto bail;
-
- tsk_mutex_lock(m_hMutex);
-
- if(m_bPrepared)
- {
- TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
- goto bail;
- }
-
- if(!winm)
- {
- TSK_DEBUG_ERROR("Invalid parameter");
- WINM_SET_ERROR(-1);
- }
-
- if(m_pVideoCaptureAction || m_pVideoDevice || m_pVideoOnlyDevice || m_pVideoSink || m_pOpenOperation){
- TSK_DEBUG_ERROR("Producer already prepared");
- WINM_SET_ERROR(-2);
- }
-
- dimensionsClosest.Width = dimensionsRequested.Width = (float)TMEDIA_PRODUCER(winm)->video.width;
- dimensionsClosest.Height = dimensionsRequested.Height = (float)TMEDIA_PRODUCER(winm)->video.height;
+ HRESULT hr = E_FAIL;
+ int ret = 0;
+ Windows::Foundation::Size dimensionsRequested, dimensionsClosest;
+ Collections::IVectorView<Size> ^availableSizes;
+ Collections::IIterator<Windows::Foundation::Size> ^availableSizesIterator;
+ bool bClosestFound = false;
+
+#define WINM_SET_ERROR(code) ret = (code); goto bail;
+
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bPrepared) {
+ TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
+ goto bail;
+ }
+
+ if(!winm) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ WINM_SET_ERROR(-1);
+ }
+
+ if(m_pVideoCaptureAction || m_pVideoDevice || m_pVideoOnlyDevice || m_pVideoSink || m_pOpenOperation) {
+ TSK_DEBUG_ERROR("Producer already prepared");
+ WINM_SET_ERROR(-2);
+ }
+
+ dimensionsClosest.Width = dimensionsRequested.Width = (float)TMEDIA_PRODUCER(winm)->video.width;
+ dimensionsClosest.Height = dimensionsRequested.Height = (float)TMEDIA_PRODUCER(winm)->video.height;
availableSizes = AudioVideoCaptureDevice::GetAvailableCaptureResolutions(m_eCameraLocation);
availableSizesIterator = availableSizes->First();
-
- while(!m_pOpenOperation && availableSizesIterator->HasCurrent)
- {
- TSK_DEBUG_INFO("Camera Supported size: (%f, %f)", availableSizesIterator->Current.Width, availableSizesIterator->Current.Height);
- if(availableSizesIterator->Current.Height == dimensionsRequested.Width && availableSizesIterator->Current.Width == dimensionsRequested.Height)
- {
+
+ while(!m_pOpenOperation && availableSizesIterator->HasCurrent) {
+ TSK_DEBUG_INFO("Camera Supported size: (%f, %f)", availableSizesIterator->Current.Width, availableSizesIterator->Current.Height);
+ if(availableSizesIterator->Current.Height == dimensionsRequested.Width && availableSizesIterator->Current.Width == dimensionsRequested.Height) {
m_pOpenOperation = AudioVideoCaptureDevice::OpenForVideoOnlyAsync(m_eCameraLocation, dimensionsRequested);
- TSK_DEBUG_INFO("Camera::Open(%d, %d)", dimensionsRequested.Width, dimensionsRequested.Height);
- break;
+ TSK_DEBUG_INFO("Camera::Open(%d, %d)", dimensionsRequested.Width, dimensionsRequested.Height);
+ break;
+ }
+ else if(!bClosestFound && (availableSizesIterator->Current.Height <= dimensionsRequested.Height && availableSizesIterator->Current.Width <= dimensionsRequested.Width)) {
+ dimensionsClosest.Height = availableSizesIterator->Current.Height;
+ dimensionsClosest.Width = availableSizesIterator->Current.Width;
+ bClosestFound = true;
}
- else if(!bClosestFound && (availableSizesIterator->Current.Height <= dimensionsRequested.Height && availableSizesIterator->Current.Width <= dimensionsRequested.Width))
- {
- dimensionsClosest.Height = availableSizesIterator->Current.Height;
- dimensionsClosest.Width = availableSizesIterator->Current.Width;
- bClosestFound = true;
- }
availableSizesIterator->MoveNext();
}
- if(!m_pOpenOperation)
- {
- m_pOpenOperation = AudioVideoCaptureDevice::OpenForVideoOnlyAsync(m_eCameraLocation, dimensionsClosest);
- TSK_DEBUG_INFO("Camera::Open(%f, %f)", dimensionsClosest.Width, dimensionsClosest.Height);
- }
+ if(!m_pOpenOperation) {
+ m_pOpenOperation = AudioVideoCaptureDevice::OpenForVideoOnlyAsync(m_eCameraLocation, dimensionsClosest);
+ TSK_DEBUG_INFO("Camera::Open(%f, %f)", dimensionsClosest.Width, dimensionsClosest.Height);
+ }
bail:
- if(ret != 0){
- UnPrepare();
- }
- if((m_bPrepared = (ret == 0)))
- {
- m_pWrappedPlugin = winm;
- }
+ if(ret != 0) {
+ UnPrepare();
+ }
+ if((m_bPrepared = (ret == 0))) {
+ m_pWrappedPlugin = winm;
+ }
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return ret;
+ return ret;
}
int VideoCapturePhone::Start()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_bStarted)
- {
- TSK_DEBUG_INFO("#WINM: Video producer already started");
- goto bail;
- }
- if(!m_bPrepared)
- {
- TSK_DEBUG_ERROR("#WINM: Video producer not prepared");
- goto bail;
- }
-
- m_bStarted = true;
-
- m_pOpenOperation->Completed = ref new AsyncOperationCompletedHandler<AudioVideoCaptureDevice^>([this] (IAsyncOperation<AudioVideoCaptureDevice^> ^operation, Windows::Foundation::AsyncStatus status)
- {
- tsk_mutex_lock(m_hMutex);
- if(m_bStarted)
- {
-
- if(status == Windows::Foundation::AsyncStatus::Completed)
- {
-
- TSK_DEBUG_INFO("+[VideoCapturePhone::Prepare] => OpenAsyncOperation started");
-
- auto videoDevice = operation->GetResults();
-
- m_pVideoOnlyDevice = videoDevice;
- IAudioVideoCaptureDeviceNative *pNativeDevice = NULL;
- HRESULT hr = reinterpret_cast<IUnknown*>(videoDevice)->QueryInterface(__uuidof(IAudioVideoCaptureDeviceNative), (void**) &pNativeDevice);
-
- if (NULL == pNativeDevice || FAILED(hr))
- {
- throw ref new FailureException("Unable to QI IAudioVideoCaptureDeviceNative");
- }
-
- // Save off the native device
- m_pVideoDevice = pNativeDevice;
-
- // Set Fps
- CameraCapturePropertyRange^ cameraCapturePropertyRange = m_pVideoOnlyDevice->GetSupportedPropertyRange(m_eCameraLocation, KnownCameraAudioVideoProperties::VideoFrameRate);
- if(cameraCapturePropertyRange)
- {
- try
- {
- Windows::Foundation::IPropertyValue^ vMin = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Min);
- Windows::Foundation::IPropertyValue^ vMax = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Max);
- UINT32 nFps = TSK_CLAMP(vMin->GetUInt32(), (UINT32)TMEDIA_PRODUCER(m_pWrappedPlugin)->video.fps, vMax->GetUInt32());
- m_pVideoOnlyDevice->SetProperty(KnownCameraAudioVideoProperties::VideoFrameRate, nFps);
- }
- catch(...){ }
- }
-
- // Set Camera Rotation
- try
- {
- m_pVideoOnlyDevice->SetProperty(
- KnownCameraGeneralProperties::EncodeWithOrientation,
- m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back ? 90 : -90
- );
- }
- catch(...){ }
-
- // Create the sink
- MakeAndInitialize<CaptureSampleSink>(&(m_pVideoSink), m_pWrappedPlugin);
- pNativeDevice->SetVideoSampleSink(m_pVideoSink);
-
- // Use the same encoding format as in VideoMediaStreamSource.cs
- videoDevice->VideoEncodingFormat = CameraCaptureVideoFormat::H264;
-
- SetEvent(m_hStartCompleted);
-
- // Start recording to our sink
- m_pVideoCaptureAction = videoDevice->StartRecordingToSinkAsync();
- m_pVideoCaptureAction->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^asyncInfo, Windows::Foundation::AsyncStatus status)
- {
- if(status == Windows::Foundation::AsyncStatus::Completed)
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync completed");
- }
- else if(status == Windows::Foundation::AsyncStatus::Error || status == Windows::Foundation::AsyncStatus::Canceled)
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync did not complete");
- }
- });
-
- TSK_DEBUG_INFO("-[VideoCapturePhone::Prepare] => OpenAsyncOperation Completed");
- }
- else if(status == Windows::Foundation::AsyncStatus::Canceled)
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation Canceled");
- }
- else if(status == Windows::Foundation::AsyncStatus::Error)
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation encountered an error");
- }
- }
-
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bStarted) {
+ TSK_DEBUG_INFO("#WINM: Video producer already started");
+ goto bail;
+ }
+ if(!m_bPrepared) {
+ TSK_DEBUG_ERROR("#WINM: Video producer not prepared");
+ goto bail;
+ }
+
+ m_bStarted = true;
+
+ m_pOpenOperation->Completed = ref new AsyncOperationCompletedHandler<AudioVideoCaptureDevice^>([this] (IAsyncOperation<AudioVideoCaptureDevice^> ^operation, Windows::Foundation::AsyncStatus status) {
+ tsk_mutex_lock(m_hMutex);
+ if(m_bStarted) {
+
+ if(status == Windows::Foundation::AsyncStatus::Completed) {
+
+ TSK_DEBUG_INFO("+[VideoCapturePhone::Prepare] => OpenAsyncOperation started");
+
+ auto videoDevice = operation->GetResults();
+
+ m_pVideoOnlyDevice = videoDevice;
+ IAudioVideoCaptureDeviceNative *pNativeDevice = NULL;
+ HRESULT hr = reinterpret_cast<IUnknown*>(videoDevice)->QueryInterface(__uuidof(IAudioVideoCaptureDeviceNative), (void**) &pNativeDevice);
+
+ if (NULL == pNativeDevice || FAILED(hr)) {
+ throw ref new FailureException("Unable to QI IAudioVideoCaptureDeviceNative");
+ }
+
+ // Save off the native device
+ m_pVideoDevice = pNativeDevice;
+
+ // Set Fps
+ CameraCapturePropertyRange^ cameraCapturePropertyRange = m_pVideoOnlyDevice->GetSupportedPropertyRange(m_eCameraLocation, KnownCameraAudioVideoProperties::VideoFrameRate);
+ if(cameraCapturePropertyRange) {
+ try {
+ Windows::Foundation::IPropertyValue^ vMin = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Min);
+ Windows::Foundation::IPropertyValue^ vMax = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Max);
+ UINT32 nFps = TSK_CLAMP(vMin->GetUInt32(), (UINT32)TMEDIA_PRODUCER(m_pWrappedPlugin)->video.fps, vMax->GetUInt32());
+ m_pVideoOnlyDevice->SetProperty(KnownCameraAudioVideoProperties::VideoFrameRate, nFps);
+ }
+ catch(...) { }
+ }
+
+ // Set Camera Rotation
+ try {
+ m_pVideoOnlyDevice->SetProperty(
+ KnownCameraGeneralProperties::EncodeWithOrientation,
+ m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back ? 90 : -90
+ );
+ }
+ catch(...) { }
+
+ // Create the sink
+ MakeAndInitialize<CaptureSampleSink>(&(m_pVideoSink), m_pWrappedPlugin);
+ pNativeDevice->SetVideoSampleSink(m_pVideoSink);
+
+ // Use the same encoding format as in VideoMediaStreamSource.cs
+ videoDevice->VideoEncodingFormat = CameraCaptureVideoFormat::H264;
+
+ SetEvent(m_hStartCompleted);
+
+ // Start recording to our sink
+ m_pVideoCaptureAction = videoDevice->StartRecordingToSinkAsync();
+ m_pVideoCaptureAction->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^asyncInfo, Windows::Foundation::AsyncStatus status) {
+ if(status == Windows::Foundation::AsyncStatus::Completed) {
+ TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync completed");
+ }
+ else if(status == Windows::Foundation::AsyncStatus::Error || status == Windows::Foundation::AsyncStatus::Canceled) {
+ TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync did not complete");
+ }
+ });
+
+ TSK_DEBUG_INFO("-[VideoCapturePhone::Prepare] => OpenAsyncOperation Completed");
+ }
+ else if(status == Windows::Foundation::AsyncStatus::Canceled) {
+ TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation Canceled");
+ }
+ else if(status == Windows::Foundation::AsyncStatus::Error) {
+ TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation encountered an error");
+ }
+ }
+
+ tsk_mutex_unlock(m_hMutex);
});
-
+
bail:
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int VideoCapturePhone::Pause()
{
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- if(m_bStarted)
- {
+ if(m_bStarted) {
- }
+ }
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
int VideoCapturePhone::Stop()
{
- tsk_mutex_lock(m_hMutex);
+ tsk_mutex_lock(m_hMutex);
- TSK_DEBUG_INFO("+[VideoCapturePhone::Stop] => Trying to stop capture");
- if (m_pVideoOnlyDevice)
- {
+ TSK_DEBUG_INFO("+[VideoCapturePhone::Stop] => Trying to stop capture");
+ if (m_pVideoOnlyDevice) {
TSK_DEBUG_INFO("Destroying VideoCaptureDevice");
- try
- {
- if(m_bStarted)
- {
- m_pVideoOnlyDevice->StopRecordingAsync()->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^action, Windows::Foundation::AsyncStatus status){
- if(status == Windows::Foundation::AsyncStatus::Completed)
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Video successfully stopped");
- }
- else
- {
- TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Error occurred while stopping recording");
- }
- m_pVideoCaptureAction = nullptr;
- m_pVideoOnlyDevice = nullptr;
- m_bStarted = false;
- SetEvent(m_hStopCompleted);
- });
- }
+ try {
+ if(m_bStarted) {
+ m_pVideoOnlyDevice->StopRecordingAsync()->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^action, Windows::Foundation::AsyncStatus status) {
+ if(status == Windows::Foundation::AsyncStatus::Completed) {
+ TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Video successfully stopped");
+ }
+ else {
+ TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Error occurred while stopping recording");
+ }
+ m_pVideoCaptureAction = nullptr;
+ m_pVideoOnlyDevice = nullptr;
+ m_bStarted = false;
+ SetEvent(m_hStopCompleted);
+ });
+ }
}
- catch(...)
- {
+ catch(...) {
// A Platform::ObjectDisposedException can be raised if the app has had its access
// to video revoked (most commonly when the app is going out of the foreground)
TSK_DEBUG_ERROR("Exception caught while destroying video capture");
@@ -528,90 +491,79 @@ int VideoCapturePhone::Stop()
SetEvent(m_hStopCompleted);
}
- if (m_pVideoDevice)
- {
+ if (m_pVideoDevice) {
m_pVideoDevice->Release();
m_pVideoDevice = NULL;
}
- if (m_pVideoSink)
- {
+ if (m_pVideoSink) {
m_pVideoSink->Release();
m_pVideoSink = NULL;
}
}
- else
- {
- m_bStarted = false;
- }
+ else {
+ m_bStarted = false;
+ }
- TSK_DEBUG_INFO("-[VideoCapturePhone::Stop] => finished stopping capture\n");
+ TSK_DEBUG_INFO("-[VideoCapturePhone::Stop] => finished stopping capture\n");
- // will be prepared again before next start()
- UnPrepare();
+ // will be prepared again before next start()
+ UnPrepare();
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
void VideoCapturePhone::SetCameraLocation(Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation)
{
- if(m_eCameraLocation != cameraLocation)
- {
- if(m_bStarted)
- {
- ToggleCamera();
- }
- else
- {
- m_eCameraLocation = cameraLocation;
- }
- }
+ if(m_eCameraLocation != cameraLocation) {
+ if(m_bStarted) {
+ ToggleCamera();
+ }
+ else {
+ m_eCameraLocation = cameraLocation;
+ }
+ }
}
int VideoCapturePhone::UnPrepare()
{
- tsk_mutex_lock(m_hMutex);
-
- if(m_bStarted)
- {
- ResetEvent(m_hStopCompleted);
- Stop();
- DWORD waitResult = WaitForSingleObjectEx(m_hStopCompleted, 5000, FALSE);
- if(waitResult != WAIT_OBJECT_0)
- {
- TSK_DEBUG_ERROR("Failed to stop video producer");
- }
- }
-
- if (m_pVideoDevice)
- {
+ tsk_mutex_lock(m_hMutex);
+
+ if(m_bStarted) {
+ ResetEvent(m_hStopCompleted);
+ Stop();
+ DWORD waitResult = WaitForSingleObjectEx(m_hStopCompleted, 5000, FALSE);
+ if(waitResult != WAIT_OBJECT_0) {
+ TSK_DEBUG_ERROR("Failed to stop video producer");
+ }
+ }
+
+ if (m_pVideoDevice) {
m_pVideoDevice->Release();
m_pVideoDevice = NULL;
}
- if (m_pVideoSink)
- {
+ if (m_pVideoSink) {
m_pVideoSink->Release();
m_pVideoSink = NULL;
}
- m_pOpenOperation = nullptr;
+ m_pOpenOperation = nullptr;
- m_bPrepared = false;
+ m_bPrepared = false;
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
- return 0;
+ return 0;
}
void VideoCapturePhone::ToggleCamera()
{
tsk_mutex_lock(m_hMutex);
- if(m_ToggleThread)
- {
+ if(m_ToggleThread) {
m_ToggleThread->Cancel();
m_ToggleThread->Close();
m_ToggleThread = nullptr;
@@ -619,7 +571,7 @@ void VideoCapturePhone::ToggleCamera()
m_ToggleThread = ThreadPool::RunAsync(ref new WorkItemHandler(this, &VideoCapturePhone::ToggleCameraThread), WorkItemPriority::High, WorkItemOptions::TimeSliced);
- tsk_mutex_unlock(m_hMutex);
+ tsk_mutex_unlock(m_hMutex);
}
@@ -630,35 +582,29 @@ void VideoCapturePhone::ToggleCameraThread(Windows::Foundation::IAsyncAction^ op
ResetEvent(m_hStopCompleted);
Stop();
DWORD waitResult = WaitForSingleObjectEx(m_hStopCompleted, INFINITE, FALSE);
- if(waitResult == WAIT_OBJECT_0)
- {
+ if(waitResult == WAIT_OBJECT_0) {
ResetEvent(m_hStartCompleted);
- if(m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back)
- {
+ if(m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back) {
m_eCameraLocation = Windows::Phone::Media::Capture::CameraSensorLocation::Front;
}
- else
- {
+ else {
m_eCameraLocation = Windows::Phone::Media::Capture::CameraSensorLocation::Back;
}
- Prepare(m_pWrappedPlugin);
- Start();
+ Prepare(m_pWrappedPlugin);
+ Start();
}
- else
- {
+ else {
throw ref new Platform::Exception(HRESULT_FROM_WIN32(waitResult), L"Error waiting for capture to stop when toggling cameras");
}
waitResult = WaitForSingleObjectEx(m_hStartCompleted, INFINITE, FALSE);
- if(waitResult == WAIT_OBJECT_0)
- {
+ if(waitResult == WAIT_OBJECT_0) {
// CameraLocationChanged(newCameraLocation);
}
- else
- {
+ else {
throw ref new Platform::Exception(HRESULT_FROM_WIN32(waitResult), L"Error waiting for capture to start when toggling cameras");
}
- TSK_DEBUG_INFO("-[VideoCapturePhone::ToggleCamera] => Toggling camera");
+ TSK_DEBUG_INFO("-[VideoCapturePhone::ToggleCamera] => Toggling camera");
}
#endif /* TDAV_UNDER_WINDOWS_PHONE */
@@ -670,67 +616,64 @@ void VideoCapturePhone::ToggleCameraThread(Windows::Foundation::IAsyncAction^ op
/* constructor */
static tsk_object_t* tdav_producer_winm_ctor(tsk_object_t * self, va_list * app)
{
- tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
- if(producer){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(producer));
- TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
- /* init self with default values*/
+ tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
+ if(producer) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(producer));
+ TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
+ /* init self with default values*/
- TMEDIA_PRODUCER(producer)->video.fps = 15;
- TMEDIA_PRODUCER(producer)->video.width = 352;
- TMEDIA_PRODUCER(producer)->video.height = 288;
+ TMEDIA_PRODUCER(producer)->video.fps = 15;
+ TMEDIA_PRODUCER(producer)->video.width = 352;
+ TMEDIA_PRODUCER(producer)->video.height = 288;
#if TDAV_UNDER_WINDOWS_PHONE
- producer->videoCapturePhone = ref new VideoCapturePhone();
+ producer->videoCapturePhone = ref new VideoCapturePhone();
#endif
- }
- return self;
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tdav_producer_winm_dtor(tsk_object_t * self)
-{
- tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
- if(producer){
- /* stop */
- //if(producer->started){
- tdav_producer_winm_stop((tmedia_producer_t*)self);
- //}
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
- /* deinit self */
+{
+ tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
+ if(producer) {
+ /* stop */
+ //if(producer->started){
+ tdav_producer_winm_stop((tmedia_producer_t*)self);
+ //}
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
+ /* deinit self */
#if TDAV_UNDER_WINDOWS_PHONE
- if(producer->videoCapturePhone)
- {
- delete producer->videoCapturePhone;
- }
+ if(producer->videoCapturePhone) {
+ delete producer->videoCapturePhone;
+ }
#endif
- }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tdav_producer_winm_def_s =
-{
- sizeof(tdav_producer_winm_t),
- tdav_producer_winm_ctor,
- tdav_producer_winm_dtor,
- tsk_null,
+static const tsk_object_def_t tdav_producer_winm_def_s = {
+ sizeof(tdav_producer_winm_t),
+ tdav_producer_winm_ctor,
+ tdav_producer_winm_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t tdav_producer_winm_plugin_def_s =
-{
- &tdav_producer_winm_def_s,
+static const tmedia_producer_plugin_def_t tdav_producer_winm_plugin_def_s = {
+ &tdav_producer_winm_def_s,
- tmedia_video,
- "Microsoft Windows Media producer (Video)",
+ tmedia_video,
+ "Microsoft Windows Media producer (Video)",
- tdav_producer_winm_set,
- tdav_producer_winm_prepare,
- tdav_producer_winm_start,
- tdav_producer_winm_pause,
- tdav_producer_winm_stop
+ tdav_producer_winm_set,
+ tdav_producer_winm_prepare,
+ tdav_producer_winm_start,
+ tdav_producer_winm_pause,
+ tdav_producer_winm_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_winm_plugin_def_t = &tdav_producer_winm_plugin_def_s;
diff --git a/tinyDAV/test/test.c b/tinyDAV/test/test.c
index 4e97f50..cfbca02 100755
--- a/tinyDAV/test/test.c
+++ b/tinyDAV/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -39,23 +39,23 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- tnet_startup();
- tdav_init();
+ tnet_startup();
+ tdav_init();
- do{
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009-2010 Mamadou Diop \n\n");
+ do {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009-2010 Mamadou Diop \n\n");
#if RUN_TEST_SESSIONS || RUN_TEST_ALL
- test_sessions();
+ test_sessions();
#endif
- }
- while(LOOP);
+ }
+ while(LOOP);
- tdav_deinit();
- tnet_cleanup();
+ tdav_deinit();
+ tnet_cleanup();
- return 0;
+ return 0;
}
diff --git a/tinyDAV/test/test_sessions.h b/tinyDAV/test/test_sessions.h
index 24b6d86..9c931b2 100755
--- a/tinyDAV/test/test_sessions.h
+++ b/tinyDAV/test/test_sessions.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -85,137 +85,137 @@
"a=setup:passive\r\n" \
"a=file-transfer-id:wcysyycqpevikeffmznimkkasvwsrenz\r\n" \
"a=file-selector:name:\"test.zip\" type:application/octet-stream size:11376 hash:sha-1:8D:55:24:2B:F4:F9:9B:A2:54:A3:5B:91:00:15:9E:A3:D4:48:D7:DF\r\n" \
-
+
static int test_session_msrp_cb(const tmsrp_event_t* _event);
void test_sessions_client()
{
- tmedia_session_mgr_t* mgr;
- const tsdp_message_t* sdp_lo;
- tsdp_message_t* sdp_ro;
- char* temp;
- tmedia_type_t type = tmedia_video/*tmedia_msrp | tmedia_audio*//*| tmedia_video tmedia_msrp*/;
+ tmedia_session_mgr_t* mgr;
+ const tsdp_message_t* sdp_lo;
+ tsdp_message_t* sdp_ro;
+ char* temp;
+ tmedia_type_t type = tmedia_video/*tmedia_msrp | tmedia_audio*//*| tmedia_video tmedia_msrp*/;
- tdav_codec_set_priority(tdav_codec_id_vp8, 0);
+ tdav_codec_set_priority(tdav_codec_id_vp8, 0);
- mgr = tmedia_session_mgr_create(type,
- "192.168.0.13", tsk_false, tsk_true/* offerer */);
+ mgr = tmedia_session_mgr_create(type,
+ "192.168.0.13", tsk_false, tsk_true/* offerer */);
- /* set MSRP callback */
- //tmedia_session_mgr_set_msrp_cb(mgr, tsk_null, test_session_msrp_cb);
+ /* set MSRP callback */
+ //tmedia_session_mgr_set_msrp_cb(mgr, tsk_null, test_session_msrp_cb);
- /* MSRP File Transfer */
- /*tmedia_session_mgr_set(mgr,
- TMEDIA_SESSION_MSRP_SET_STR("file-path", "C:\\avatar.png"),
- TMEDIA_SESSION_MSRP_SET_STR("accept-types", "message/CPIM application/octet-stream"),
- TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
- TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
- TMEDIA_SESSION_MSRP_SET_STR("file-selector", "name:\"test.zip\" type:application/octet-stream size:20312 hash:sha-1:27:D0:AE:39:48:77:37:1D:FD:39:7E:2D:78:2F:BC:7B:94:48:29:81"),
- TMEDIA_SESSION_MSRP_SET_STR("file-disposition", "attachment"),
- TMEDIA_SESSION_MSRP_SET_STR("file-date", "creation:2010-02-13T17:50:31.763Z"),
- TMEDIA_SESSION_MSRP_SET_STR("file-icon", "cid:test@doubango.org"),
+ /* MSRP File Transfer */
+ /*tmedia_session_mgr_set(mgr,
+ TMEDIA_SESSION_MSRP_SET_STR("file-path", "C:\\avatar.png"),
+ TMEDIA_SESSION_MSRP_SET_STR("accept-types", "message/CPIM application/octet-stream"),
+ TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
+ TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
+ TMEDIA_SESSION_MSRP_SET_STR("file-selector", "name:\"test.zip\" type:application/octet-stream size:20312 hash:sha-1:27:D0:AE:39:48:77:37:1D:FD:39:7E:2D:78:2F:BC:7B:94:48:29:81"),
+ TMEDIA_SESSION_MSRP_SET_STR("file-disposition", "attachment"),
+ TMEDIA_SESSION_MSRP_SET_STR("file-date", "creation:2010-02-13T17:50:31.763Z"),
+ TMEDIA_SESSION_MSRP_SET_STR("file-icon", "cid:test@doubango.org"),
- TMEDIA_SESSION_SET_NULL());*/
+ TMEDIA_SESSION_SET_NULL());*/
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
- /* set ro */
- if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
- tmedia_session_mgr_set_ro(mgr, sdp_ro);
- TSK_OBJECT_SAFE_FREE(sdp_ro);
- }
+ /* set ro */
+ if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))) {
+ tmedia_session_mgr_set_ro(mgr, sdp_ro);
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
+ }
- /* start() */
- tmedia_session_mgr_start(mgr);
+ /* start() */
+ tmedia_session_mgr_start(mgr);
- /* send file */
- //tmedia_session_mgr_send_file(mgr, "C:\\avatar.png", TMEDIA_SESSION_SET_NULL());
+ /* send file */
+ //tmedia_session_mgr_send_file(mgr, "C:\\avatar.png", TMEDIA_SESSION_SET_NULL());
- //getchar();
+ //getchar();
- /* for fun, send DTMF */
- //tmedia_session_mgr_send_dtmf(mgr, 1);
- //tmedia_session_mgr_send_dtmf(mgr, 10);
- //tmedia_session_mgr_send_dtmf(mgr, 11);
+ /* for fun, send DTMF */
+ //tmedia_session_mgr_send_dtmf(mgr, 1);
+ //tmedia_session_mgr_send_dtmf(mgr, 10);
+ //tmedia_session_mgr_send_dtmf(mgr, 11);
- getchar();
+ getchar();
- /* stop() */
- //tmedia_session_mgr_stop(mgr);
+ /* stop() */
+ //tmedia_session_mgr_stop(mgr);
- //getchar();
+ //getchar();
- TSK_OBJECT_SAFE_FREE(mgr);
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions_server()
{
- tmedia_session_mgr_t* mgr;
- const tsdp_message_t* sdp_lo;
- tsdp_message_t* sdp_ro;
- char* temp;
- tmedia_type_t type;
-
- /* get ro (INVITE) */
- if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
- //type = tmedia_type_from_sdp(sdp_ro);
- type = tmedia_video;
- mgr = tmedia_session_mgr_create(type,
- "192.168.0.13", tsk_false, tsk_false/* answerer */);
- tmedia_session_mgr_set_ro(mgr, sdp_ro);
- TSK_OBJECT_SAFE_FREE(sdp_ro);
- }
- else{
- TSK_DEBUG_ERROR("Failed to deserialize remote sdp");
- return;
- }
-
- /* get lo (200 OK) */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- /* ACK */
-
- /* start() */
- tmedia_session_mgr_start(mgr);
-
- getchar();
-
- /* stop() */
- //tmedia_session_mgr_stop(mgr);
-
- //getchar();
-
- TSK_OBJECT_SAFE_FREE(mgr);
+ tmedia_session_mgr_t* mgr;
+ const tsdp_message_t* sdp_lo;
+ tsdp_message_t* sdp_ro;
+ char* temp;
+ tmedia_type_t type;
+
+ /* get ro (INVITE) */
+ if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))) {
+ //type = tmedia_type_from_sdp(sdp_ro);
+ type = tmedia_video;
+ mgr = tmedia_session_mgr_create(type,
+ "192.168.0.13", tsk_false, tsk_false/* answerer */);
+ tmedia_session_mgr_set_ro(mgr, sdp_ro);
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to deserialize remote sdp");
+ return;
+ }
+
+ /* get lo (200 OK) */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* ACK */
+
+ /* start() */
+ tmedia_session_mgr_start(mgr);
+
+ getchar();
+
+ /* stop() */
+ //tmedia_session_mgr_stop(mgr);
+
+ //getchar();
+
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions()
-{
- test_sessions_client();
- //test_sessions_server();
+{
+ test_sessions_client();
+ //test_sessions_server();
}
int test_session_msrp_cb(const tmsrp_event_t* _event)
{
- if(TMSRP_MESSAGE_IS_REQUEST(_event->message)){
- TSK_DEBUG_INFO("Received MSRP request");
- }
- else{
- TSK_DEBUG_INFO("Received MSRP response");
- }
-
- return 0;
+ if(TMSRP_MESSAGE_IS_REQUEST(_event->message)) {
+ TSK_DEBUG_INFO("Received MSRP request");
+ }
+ else {
+ TSK_DEBUG_INFO("Received MSRP response");
+ }
+
+ return 0;
}
#endif /* _TINYDEV_TEST_SESSIONS_H */
diff --git a/tinyDEMO/cmd.c b/tinyDEMO/cmd.c
index a2d6c89..7daf91a 100755
--- a/tinyDEMO/cmd.c
+++ b/tinyDEMO/cmd.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,15 +33,15 @@ static int pred_find_opt_by_type(const tsk_list_item_t *item, const void *type);
/* parse a command line */
cmd_t* cmd_parse(const char* buffer, tsk_size_t size, tsk_bool_t *comment, tsk_params_L_t* params)
-{
- return dssl_parse(buffer, size, comment, params);
+{
+ return dssl_parse(buffer, size, comment, params);
}
///* print usage */
void cmd_print_help()
{
- printf("\n\n========================= Usage =========================\n\n");
- printf("Please refer to the Programmer's Guide at\n http://www.doubango.org/\n\n");
+ printf("\n\n========================= Usage =========================\n\n");
+ printf("Please refer to the Programmer's Guide at\n http://www.doubango.org/\n\n");
//
// printf("Usage:\n");
@@ -71,89 +71,87 @@ void cmd_print_help()
cmd_t* cmd_create(cmd_type_t type)
{
- return tsk_object_new(cmd_def_t, type);
+ return tsk_object_new(cmd_def_t, type);
}
static tsk_object_t* cmd_ctor(tsk_object_t * self, va_list * app)
{
- cmd_t *cmd = self;
- if(cmd){
- cmd->type = va_arg(*app, cmd_type_t);
- cmd->opts = tsk_list_create();
- }
- return self;
+ cmd_t *cmd = self;
+ if(cmd) {
+ cmd->type = va_arg(*app, cmd_type_t);
+ cmd->opts = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* cmd_dtor(tsk_object_t * self)
-{
- cmd_t *cmd = self;
- if(cmd){
- TSK_OBJECT_SAFE_FREE(cmd->opts);
- TSK_FREE(cmd->sidparam);
- }
-
- return self;
+{
+ cmd_t *cmd = self;
+ if(cmd) {
+ TSK_OBJECT_SAFE_FREE(cmd->opts);
+ TSK_FREE(cmd->sidparam);
+ }
+
+ return self;
}
-static const tsk_object_def_t cmd_def_s =
-{
- sizeof(cmd_t),
- cmd_ctor,
- cmd_dtor,
- tsk_null,
+static const tsk_object_def_t cmd_def_s = {
+ sizeof(cmd_t),
+ cmd_ctor,
+ cmd_dtor,
+ tsk_null,
};
const tsk_object_def_t *cmd_def_t = &cmd_def_s;
opt_t* opt_create(opt_type_t type, lv_t level, const char* value)
{
- return tsk_object_new(opt_def_t, type, level, value);
+ return tsk_object_new(opt_def_t, type, level, value);
}
const opt_t* opt_get_by_type(const opts_L_t* opts, opt_type_t type)
{
- const tsk_list_item_t* item;
- if((item = tsk_list_find_item_by_pred(opts, pred_find_opt_by_type, &type))){
- return item->data;
- }
- return tsk_null;
+ const tsk_list_item_t* item;
+ if((item = tsk_list_find_item_by_pred(opts, pred_find_opt_by_type, &type))) {
+ return item->data;
+ }
+ return tsk_null;
}
static int pred_find_opt_by_type(const tsk_list_item_t *item, const void *type)
{
- if(item && item->data){
- opt_t *opt = item->data;
- return (opt->type - *((opt_type_t*)type));
- }
- return -1;
+ if(item && item->data) {
+ opt_t *opt = item->data;
+ return (opt->type - *((opt_type_t*)type));
+ }
+ return -1;
}
static tsk_object_t* opt_ctor(tsk_object_t * self, va_list * app)
{
- opt_t *opt = self;
- if(opt){
- opt->type = va_arg(*app, opt_type_t);
- opt->lv = va_arg(*app, lv_t);
- opt->value = tsk_strdup(va_arg(*app, const char*));
- }
- return self;
+ opt_t *opt = self;
+ if(opt) {
+ opt->type = va_arg(*app, opt_type_t);
+ opt->lv = va_arg(*app, lv_t);
+ opt->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ return self;
}
static tsk_object_t* opt_dtor(tsk_object_t * self)
-{
- opt_t *opt = self;
- if(opt){
- TSK_FREE(opt->value);
- }
+{
+ opt_t *opt = self;
+ if(opt) {
+ TSK_FREE(opt->value);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t opt_def_s =
-{
- sizeof(opt_t),
- opt_ctor,
- opt_dtor,
- tsk_null,
+static const tsk_object_def_t opt_def_s = {
+ sizeof(opt_t),
+ opt_ctor,
+ opt_dtor,
+ tsk_null,
};
const tsk_object_def_t *opt_def_t = &opt_def_s;
diff --git a/tinyDEMO/cmd.h b/tinyDEMO/cmd.h
index 6c544ad..1a20e62 100755
--- a/tinyDEMO/cmd.h
+++ b/tinyDEMO/cmd.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,106 +28,101 @@
_BEGIN_DECLS
-typedef enum cmd_type_e
-{
- cmd_none,
-
- cmd_audio, /* ++audio | ++a*/
- cmd_audiovideo, /* ++audiovideo | ++av*/
- cmd_config_session, /* ++config-session | ++css */
- cmd_config_stack, /* ++config-stack | ++cst*/
- cmd_dtmf, /*++dtmf*/
- cmd_dump, /*++dump | ++d*/
- cmd_ect, /*++ect*/
- cmd_exit, /*++exit | ++e | ++quit | ++q*/
- cmd_file, /* ++file | ++f*/
- cmd_hangup, /* ++hangup | ++hu */
- cmd_help, /* ++help | ++h */
- cmd_hold, /* ++hold | ++ho */
- cmd_large_message, /* ++large-message | ++lm */
- cmd_message, /* ++message | ++m*/
- cmd_options, /* ++options | ++opt*/
- cmd_publish, /* ++publish | ++pub*/
- cmd_register, /* ++register | ++reg */
- cmd_resume, /* ++resume | ++res */
- cmd_run, /* ++run | ++r*/
- cmd_scenario, /* ++scenario | ++sn*/
- cmd_sleep, /* ++sleep */
- cmd_sms, /* ++sms */
- cmd_stop, /* ++stop */
- cmd_subscribe, /* ++subscribe | ++sub */
- cmd_video, /* ++video | ++v */
+typedef enum cmd_type_e {
+ cmd_none,
+
+ cmd_audio, /* ++audio | ++a*/
+ cmd_audiovideo, /* ++audiovideo | ++av*/
+ cmd_config_session, /* ++config-session | ++css */
+ cmd_config_stack, /* ++config-stack | ++cst*/
+ cmd_dtmf, /*++dtmf*/
+ cmd_dump, /*++dump | ++d*/
+ cmd_ect, /*++ect*/
+ cmd_exit, /*++exit | ++e | ++quit | ++q*/
+ cmd_file, /* ++file | ++f*/
+ cmd_hangup, /* ++hangup | ++hu */
+ cmd_help, /* ++help | ++h */
+ cmd_hold, /* ++hold | ++ho */
+ cmd_large_message, /* ++large-message | ++lm */
+ cmd_message, /* ++message | ++m*/
+ cmd_options, /* ++options | ++opt*/
+ cmd_publish, /* ++publish | ++pub*/
+ cmd_register, /* ++register | ++reg */
+ cmd_resume, /* ++resume | ++res */
+ cmd_run, /* ++run | ++r*/
+ cmd_scenario, /* ++scenario | ++sn*/
+ cmd_sleep, /* ++sleep */
+ cmd_sms, /* ++sms */
+ cmd_stop, /* ++stop */
+ cmd_subscribe, /* ++subscribe | ++sub */
+ cmd_video, /* ++video | ++v */
}
cmd_type_t;
-typedef enum opt_type_e
-{
- opt_none,
-
- opt_amf, /* --amf 0x85FF */
- opt_caps, /* --caps +g.oma.sip-im or language=en,fr*/
- opt_dhcpv4, /* --dhcpv4 */
- opt_dhcpv6, /* --dhcpv6 */
- opt_dname, /* --dname bob */
- opt_dns_naptr, /* --dns-naptr */
- opt_from, /* --from sip:alice@open-ims.test */
- opt_event, /* --event 2 */
- opt_expires, /* --expires|--xp 30 */
- opt_header, /* --header Supported=norefersub */
- opt_impi, /* --impi bob@open-ims.test */
- opt_impu, /* --impu sip:bob@open-ims.test */
- opt_ipv6, /* --ipv6 */
- opt_local_ip, /* --local-ip 192.168.0.10 */
- opt_local_port, /* --local-port 5060 */
- opt_opid, /* --opid 0xA712F5D04B */
- opt_password, /* --password|--pwd mysecret */
- opt_path, /* --path /cygdrive/c/Projects/sample.cfg */
- opt_payload, /* --payload|--pay hello world! */
- opt_pcscf_ip, /* --pcscf-ip 192.168.0.13 */
- opt_pcscf_port, /* --pcscf-port 5060 */
- opt_pcscf_trans, /* --pcscf-trans udp */
- opt_realm, /* --realm open-ims.test */
- opt_sec, /* --sec 1800 */
- opt_sid, /* --sid 1234 */
- opt_sigcomp_id, /* --sigcomp-id urn:uuid:2e5fdc76-00be-4314-8202-1116fa82a473 */
- opt_silent, /* --silent */
- opt_smsc, /* --smsc +3315245856 */
- opt_stun_ip, /* --stun-ip numb.viagenie.ca */
- opt_stun_pwd, /* --stun-pwd mysecret */
- opt_stun_port, /* --stun-port 3478 */
- opt_stun_usr, /* --stun-usr bob@open-ims.test */
- opt_to, /* --to sip:alice@open-ims.test */
+typedef enum opt_type_e {
+ opt_none,
+
+ opt_amf, /* --amf 0x85FF */
+ opt_caps, /* --caps +g.oma.sip-im or language=en,fr*/
+ opt_dhcpv4, /* --dhcpv4 */
+ opt_dhcpv6, /* --dhcpv6 */
+ opt_dname, /* --dname bob */
+ opt_dns_naptr, /* --dns-naptr */
+ opt_from, /* --from sip:alice@open-ims.test */
+ opt_event, /* --event 2 */
+ opt_expires, /* --expires|--xp 30 */
+ opt_header, /* --header Supported=norefersub */
+ opt_impi, /* --impi bob@open-ims.test */
+ opt_impu, /* --impu sip:bob@open-ims.test */
+ opt_ipv6, /* --ipv6 */
+ opt_local_ip, /* --local-ip 192.168.0.10 */
+ opt_local_port, /* --local-port 5060 */
+ opt_opid, /* --opid 0xA712F5D04B */
+ opt_password, /* --password|--pwd mysecret */
+ opt_path, /* --path /cygdrive/c/Projects/sample.cfg */
+ opt_payload, /* --payload|--pay hello world! */
+ opt_pcscf_ip, /* --pcscf-ip 192.168.0.13 */
+ opt_pcscf_port, /* --pcscf-port 5060 */
+ opt_pcscf_trans, /* --pcscf-trans udp */
+ opt_realm, /* --realm open-ims.test */
+ opt_sec, /* --sec 1800 */
+ opt_sid, /* --sid 1234 */
+ opt_sigcomp_id, /* --sigcomp-id urn:uuid:2e5fdc76-00be-4314-8202-1116fa82a473 */
+ opt_silent, /* --silent */
+ opt_smsc, /* --smsc +3315245856 */
+ opt_stun_ip, /* --stun-ip numb.viagenie.ca */
+ opt_stun_pwd, /* --stun-pwd mysecret */
+ opt_stun_port, /* --stun-port 3478 */
+ opt_stun_usr, /* --stun-usr bob@open-ims.test */
+ opt_to, /* --to sip:alice@open-ims.test */
}
opt_type_t;
-typedef enum lv_e
-{
- lv_none,
+typedef enum lv_e {
+ lv_none,
- lv_stack, /* @@stack | @@st */
- lv_session, /* @@session | @@ss */
- lv_action /* @@action | @@request | @@a | @@r*/
+ lv_stack, /* @@stack | @@st */
+ lv_session, /* @@session | @@ss */
+ lv_action /* @@action | @@request | @@a | @@r*/
}
lv_t;
-typedef struct opt_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct opt_s {
+ TSK_DECLARE_OBJECT;
- opt_type_t type;
- lv_t lv;
- char* value;
+ opt_type_t type;
+ lv_t lv;
+ char* value;
}
opt_t;
typedef tsk_list_t opts_L_t;
-typedef struct cmd_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct cmd_s {
+ TSK_DECLARE_OBJECT;
- cmd_type_t type;
- opts_L_t *opts;
- char* sidparam;
+ cmd_type_t type;
+ opts_L_t *opts;
+ char* sidparam;
}
cmd_t;
diff --git a/tinyDEMO/common.c b/tinyDEMO/common.c
index 386fed3..92e19c7 100755
--- a/tinyDEMO/common.c
+++ b/tinyDEMO/common.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,544 +56,524 @@ int session_tostring(const session_t* session);
/* our SIP callback function */
int stack_callback(const tsip_event_t *_event)
{
- int ret = 0;
+ int ret = 0;
- if(!_event){ /* should never happen ...but who know? */
- TSK_DEBUG_WARN("Null SIP event.");
- return -1;
- }
+ if(!_event) { /* should never happen ...but who know? */
+ TSK_DEBUG_WARN("Null SIP event.");
+ return -1;
+ }
#if 0
- tsk_safeobj_lock(ctx);
+ tsk_safeobj_lock(ctx);
#endif
- switch(_event->type){
- case tsip_event_register:
- { /* REGISTER */
- ret = register_handle_event(_event);
- break;
- }
- case tsip_event_invite:
- { /* INVITE */
- ret = invite_handle_event(_event);
- break;
- }
- case tsip_event_message:
- { /* MESSAGE */
- ret = message_handle_event(_event);
- break;
- }
- case tsip_event_options:
- { /* OPTIONS */
- ret = options_handle_event(_event);
- break;
- }
- case tsip_event_publish:
- { /* PUBLISH */
- ret = publish_handle_event(_event);
- break;
- }
- case tsip_event_subscribe:
- { /* SUBSCRIBE */
- ret = subscribe_handle_event(_event);
- break;
- }
-
- case tsip_event_dialog:
- { /* Common to all dialogs */
- ret = session_handle_event(_event);
- break;
- }
-
- case tsip_event_stack:
- {
- switch(_event->code){
- case tsip_event_code_stack_started:
- TSK_DEBUG_INFO("Stack started");
- break;
- case tsip_event_code_stack_stopped:
- TSK_DEBUG_INFO("Stack stopped");
- break;
- case tsip_event_code_stack_failed_to_start:
- TSK_DEBUG_INFO("Stack failed to start");
- break;
- case tsip_event_code_stack_failed_to_stop:
- TSK_DEBUG_INFO("Stack failed to stop");
- break;
- }
- break;
- }
-
- default:
- { /* Unsupported */
- TSK_DEBUG_WARN("%d not supported as SIP event.", _event->type);
- ret = -3;
- break;
- }
- }
+ switch(_event->type) {
+ case tsip_event_register: {
+ /* REGISTER */
+ ret = register_handle_event(_event);
+ break;
+ }
+ case tsip_event_invite: {
+ /* INVITE */
+ ret = invite_handle_event(_event);
+ break;
+ }
+ case tsip_event_message: {
+ /* MESSAGE */
+ ret = message_handle_event(_event);
+ break;
+ }
+ case tsip_event_options: {
+ /* OPTIONS */
+ ret = options_handle_event(_event);
+ break;
+ }
+ case tsip_event_publish: {
+ /* PUBLISH */
+ ret = publish_handle_event(_event);
+ break;
+ }
+ case tsip_event_subscribe: {
+ /* SUBSCRIBE */
+ ret = subscribe_handle_event(_event);
+ break;
+ }
+
+ case tsip_event_dialog: {
+ /* Common to all dialogs */
+ ret = session_handle_event(_event);
+ break;
+ }
+
+ case tsip_event_stack: {
+ switch(_event->code) {
+ case tsip_event_code_stack_started:
+ TSK_DEBUG_INFO("Stack started");
+ break;
+ case tsip_event_code_stack_stopped:
+ TSK_DEBUG_INFO("Stack stopped");
+ break;
+ case tsip_event_code_stack_failed_to_start:
+ TSK_DEBUG_INFO("Stack failed to start");
+ break;
+ case tsip_event_code_stack_failed_to_stop:
+ TSK_DEBUG_INFO("Stack failed to stop");
+ break;
+ }
+ break;
+ }
+
+ default: {
+ /* Unsupported */
+ TSK_DEBUG_WARN("%d not supported as SIP event.", _event->type);
+ ret = -3;
+ break;
+ }
+ }
#if 0
- tsk_safeobj_unlock(ctx);
+ tsk_safeobj_unlock(ctx);
#endif
- return ret;
+ return ret;
}
/* ==================================================================
- ========================== Context =================================
+ ========================== Context =================================
*/
ctx_t* ctx_create()
{
- return tsk_object_new(ctx_def_t);
+ return tsk_object_new(ctx_def_t);
}
static tsk_object_t* ctx_ctor(tsk_object_t * self, va_list * app)
{
- ctx_t *ctx = self;
- if(ctx){
- /* stack */
- ctx->stack = tsip_stack_create(stack_callback, DEFAULT_REALM, DEFAULT_IMPI, DEFAULT_IMPU, /* Mandatory parameters */
- TSIP_STACK_SET_LOCAL_IP(DEFAULT_LOCAL_IP), /* local IP */
- TSIP_STACK_SET_NULL() /* Mandatory */);
-
- /* SIP Sessions */
- ctx->sessions = tsk_list_create();
-
- /* user's parameters */
- ctx->params = tsk_list_create();
-
- /* init internal mutex */
- tsk_safeobj_init(ctx);
- }
- return self;
+ ctx_t *ctx = self;
+ if(ctx) {
+ /* stack */
+ ctx->stack = tsip_stack_create(stack_callback, DEFAULT_REALM, DEFAULT_IMPI, DEFAULT_IMPU, /* Mandatory parameters */
+ TSIP_STACK_SET_LOCAL_IP(DEFAULT_LOCAL_IP), /* local IP */
+ TSIP_STACK_SET_NULL() /* Mandatory */);
+
+ /* SIP Sessions */
+ ctx->sessions = tsk_list_create();
+
+ /* user's parameters */
+ ctx->params = tsk_list_create();
+
+ /* init internal mutex */
+ tsk_safeobj_init(ctx);
+ }
+ return self;
}
static tsk_object_t* ctx_dtor(tsk_object_t * self)
-{
- ctx_t *ctx = self;
- if(ctx){
- /* Stop the stack (as sessions are alive, you will continue to receive callbacks)*/
- tsip_stack_stop(ctx->stack);
-
- /* sessions : should be freed before the stack as explained on the Programmer's Guide
- * As all dialogs have been hanged up, the list should be empty ...but who know?*/
- TSK_OBJECT_SAFE_FREE(ctx->sessions);
-
- /* Destroy the stack */
- TSK_OBJECT_SAFE_FREE(ctx->stack);
-
- /* Identity */
- TSK_FREE(ctx->identity.display_name);
- TSK_FREE(ctx->identity.impu);
- TSK_FREE(ctx->identity.preferred);
- TSK_FREE(ctx->identity.impi);
- TSK_FREE(ctx->identity.password);
-
- /* Network */
- TSK_FREE(ctx->network.local_ip);
- TSK_FREE(ctx->network.proxy_cscf);
- TSK_FREE(ctx->network.proxy_cscf_trans);
- TSK_FREE(ctx->network.realm);
-
- /* Security */
- TSK_FREE(ctx->security.operator_id);
-
- /* Params */
- TSK_OBJECT_SAFE_FREE(ctx->params);
-
- /* deinit internal mutex */
- tsk_safeobj_deinit(ctx);
- }
-
- return self;
+{
+ ctx_t *ctx = self;
+ if(ctx) {
+ /* Stop the stack (as sessions are alive, you will continue to receive callbacks)*/
+ tsip_stack_stop(ctx->stack);
+
+ /* sessions : should be freed before the stack as explained on the Programmer's Guide
+ * As all dialogs have been hanged up, the list should be empty ...but who know?*/
+ TSK_OBJECT_SAFE_FREE(ctx->sessions);
+
+ /* Destroy the stack */
+ TSK_OBJECT_SAFE_FREE(ctx->stack);
+
+ /* Identity */
+ TSK_FREE(ctx->identity.display_name);
+ TSK_FREE(ctx->identity.impu);
+ TSK_FREE(ctx->identity.preferred);
+ TSK_FREE(ctx->identity.impi);
+ TSK_FREE(ctx->identity.password);
+
+ /* Network */
+ TSK_FREE(ctx->network.local_ip);
+ TSK_FREE(ctx->network.proxy_cscf);
+ TSK_FREE(ctx->network.proxy_cscf_trans);
+ TSK_FREE(ctx->network.realm);
+
+ /* Security */
+ TSK_FREE(ctx->security.operator_id);
+
+ /* Params */
+ TSK_OBJECT_SAFE_FREE(ctx->params);
+
+ /* deinit internal mutex */
+ tsk_safeobj_deinit(ctx);
+ }
+
+ return self;
}
-static const tsk_object_def_t ctx_def_s =
-{
- sizeof(ctx_t),
- ctx_ctor,
- ctx_dtor,
- tsk_null,
+static const tsk_object_def_t ctx_def_s = {
+ sizeof(ctx_t),
+ ctx_ctor,
+ ctx_dtor,
+ tsk_null,
};
const tsk_object_def_t *ctx_def_t = &ctx_def_s;
/* ==================================================================
- ========================== Stack =================================
+ ========================== Stack =================================
*/
int stack_dump()
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- tsk_list_foreach(item, ctx->sessions){
- session_tostring(item->data);
- }
- return 0;
+ tsk_list_foreach(item, ctx->sessions) {
+ session_tostring(item->data);
+ }
+ return 0;
}
int stack_config(const opts_L_t* opts)
{
- const tsk_list_item_t* item;
- const opt_t* opt;
- int ret = 0;
- tsk_param_t* param;
- tsk_bool_t pcscf_changed = tsk_false;
- tsk_bool_t stun_done = tsk_false;
-
- if(!opts){
- return -1;
- }
-
- tsk_list_foreach(item, opts){
- opt = item->data;
-
- /* Stack-level option */
- if(opt->lv != lv_none && opt->lv != lv_stack){
- continue;
- }
-
- switch(opt->type){
- case opt_amf:
- {
- break;
- }
- case opt_dhcpv4:
- case opt_dhcpv6:
- {
- tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_DISCOVERY_DHCP(tsk_true),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_dname:
- {
- break;
- }
- case opt_dns_naptr:
- {
- tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_DISCOVERY_NAPTR(tsk_true),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_header:
- {
- if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))){
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_HEADER(param->name, param->value),
- TSIP_STACK_SET_NULL());
- TSK_OBJECT_SAFE_FREE(param);
- }
- break;
- }
- case opt_impi:
- {
- tsk_strupdate(&ctx->identity.impi, opt->value);
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_IMPI(ctx->identity.impi),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_impu:
- {
- tsk_strupdate(&ctx->identity.impu, opt->value);
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_IMPU(ctx->identity.impu),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_ipv6:
- {
- pcscf_changed = tsk_true;
- ctx->network.ipv6 = tsk_true;
- break;
- }
- case opt_local_ip:
- {
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_LOCAL_IP(opt->value),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_local_port:
- {
- unsigned port = (unsigned)atoi(opt->value);
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_LOCAL_PORT(port),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_opid:
- {
- break;
- }
- case opt_password:
- {
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_PASSWORD(opt->value),
- TSIP_STACK_SET_NULL());
- break;
- }
- case opt_pcscf_ip:
- {
- pcscf_changed = tsk_true;
- tsk_strupdate(&ctx->network.proxy_cscf, opt->value);
- break;
- }
- case opt_pcscf_port:
- {
- pcscf_changed = tsk_true;
- ctx->network.proxy_cscf_port = atoi(opt->value);
- break;
- }
- case opt_pcscf_trans:
- {
- pcscf_changed = tsk_true;
- tsk_strupdate(&ctx->network.proxy_cscf_trans, opt->value);
- break;
- }
- case opt_realm:
- {
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_REALM(opt->value),
- TSIP_STACK_SET_NULL());
- break;
- }
-
- case opt_sigcomp_id:
- { /* add compartment */
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(opt->value),
- TSIP_STACK_SET_NULL());
- break;
- }
-
- case opt_stun_ip:
- case opt_stun_pwd:
- case opt_stun_port:
- case opt_stun_usr:
- {
- if(!stun_done){
- const opt_t* _opt;
- const char* ip = tsk_null, *usr = tsk_null, *pwd = tsk_null;
- unsigned port = 0;
-
- if((_opt = opt_get_by_type(opts, opt_stun_ip))){
- ip = _opt->value;
- }
- if((_opt = opt_get_by_type(opts, opt_stun_port))){
- port = atoi(_opt->value);
- }
- if((_opt = opt_get_by_type(opts, opt_stun_usr))){
- usr = _opt->value;
- }
- if((_opt = opt_get_by_type(opts, opt_stun_pwd))){
- pwd = _opt->value;
- }
-
- if(ip && port){
- tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_STUN_SERVER(ip, port),
- TSIP_STACK_SET_NULL());
- }
- if(usr){
- tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_STUN_CRED(usr, pwd),
- TSIP_STACK_SET_NULL());
- }
-
- stun_done = tsk_true;
- }
- break;
- }
-
- }/* switch */
-
- } /* foreach */
-
- /* whether Proxy-CSCF config has changed */
- if(pcscf_changed){
- ret = tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_PROXY_CSCF(ctx->network.proxy_cscf, ctx->network.proxy_cscf_port, ctx->network.proxy_cscf_trans, ctx->network.ipv6 ? "ipv6" : "ipv4"),
- TSIP_STACK_SET_NULL());
- }
-
- return ret;
+ const tsk_list_item_t* item;
+ const opt_t* opt;
+ int ret = 0;
+ tsk_param_t* param;
+ tsk_bool_t pcscf_changed = tsk_false;
+ tsk_bool_t stun_done = tsk_false;
+
+ if(!opts) {
+ return -1;
+ }
+
+ tsk_list_foreach(item, opts) {
+ opt = item->data;
+
+ /* Stack-level option */
+ if(opt->lv != lv_none && opt->lv != lv_stack) {
+ continue;
+ }
+
+ switch(opt->type) {
+ case opt_amf: {
+ break;
+ }
+ case opt_dhcpv4:
+ case opt_dhcpv6: {
+ tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_DISCOVERY_DHCP(tsk_true),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_dname: {
+ break;
+ }
+ case opt_dns_naptr: {
+ tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_DISCOVERY_NAPTR(tsk_true),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_header: {
+ if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))) {
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_HEADER(param->name, param->value),
+ TSIP_STACK_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ break;
+ }
+ case opt_impi: {
+ tsk_strupdate(&ctx->identity.impi, opt->value);
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_IMPI(ctx->identity.impi),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_impu: {
+ tsk_strupdate(&ctx->identity.impu, opt->value);
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_IMPU(ctx->identity.impu),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_ipv6: {
+ pcscf_changed = tsk_true;
+ ctx->network.ipv6 = tsk_true;
+ break;
+ }
+ case opt_local_ip: {
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_LOCAL_IP(opt->value),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_local_port: {
+ unsigned port = (unsigned)atoi(opt->value);
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_LOCAL_PORT(port),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_opid: {
+ break;
+ }
+ case opt_password: {
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_PASSWORD(opt->value),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+ case opt_pcscf_ip: {
+ pcscf_changed = tsk_true;
+ tsk_strupdate(&ctx->network.proxy_cscf, opt->value);
+ break;
+ }
+ case opt_pcscf_port: {
+ pcscf_changed = tsk_true;
+ ctx->network.proxy_cscf_port = atoi(opt->value);
+ break;
+ }
+ case opt_pcscf_trans: {
+ pcscf_changed = tsk_true;
+ tsk_strupdate(&ctx->network.proxy_cscf_trans, opt->value);
+ break;
+ }
+ case opt_realm: {
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_REALM(opt->value),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+
+ case opt_sigcomp_id: {
+ /* add compartment */
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(opt->value),
+ TSIP_STACK_SET_NULL());
+ break;
+ }
+
+ case opt_stun_ip:
+ case opt_stun_pwd:
+ case opt_stun_port:
+ case opt_stun_usr: {
+ if(!stun_done) {
+ const opt_t* _opt;
+ const char* ip = tsk_null, *usr = tsk_null, *pwd = tsk_null;
+ unsigned port = 0;
+
+ if((_opt = opt_get_by_type(opts, opt_stun_ip))) {
+ ip = _opt->value;
+ }
+ if((_opt = opt_get_by_type(opts, opt_stun_port))) {
+ port = atoi(_opt->value);
+ }
+ if((_opt = opt_get_by_type(opts, opt_stun_usr))) {
+ usr = _opt->value;
+ }
+ if((_opt = opt_get_by_type(opts, opt_stun_pwd))) {
+ pwd = _opt->value;
+ }
+
+ if(ip && port) {
+ tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_STUN_SERVER(ip, port),
+ TSIP_STACK_SET_NULL());
+ }
+ if(usr) {
+ tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_STUN_CRED(usr, pwd),
+ TSIP_STACK_SET_NULL());
+ }
+
+ stun_done = tsk_true;
+ }
+ break;
+ }
+
+ }/* switch */
+
+ } /* foreach */
+
+ /* whether Proxy-CSCF config has changed */
+ if(pcscf_changed) {
+ ret = tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_PROXY_CSCF(ctx->network.proxy_cscf, ctx->network.proxy_cscf_port, ctx->network.proxy_cscf_trans, ctx->network.ipv6 ? "ipv6" : "ipv4"),
+ TSIP_STACK_SET_NULL());
+ }
+
+ return ret;
}
int stack_run(const opts_L_t* opts)
{
- if(!ctx->stack){
- TSK_DEBUG_ERROR("Stack is Null.");
- return -1;
- }
- else{
- return tsip_stack_start(ctx->stack);
- }
+ if(!ctx->stack) {
+ TSK_DEBUG_ERROR("Stack is Null.");
+ return -1;
+ }
+ else {
+ return tsip_stack_start(ctx->stack);
+ }
}
/* ==================================================================
- ========================== Session =================================
+ ========================== Session =================================
*/
/* Find SIP session by id */
int pred_find_session_by_id(const tsk_list_item_t *item, const void* id)
{
- const session_t* session;
- if(item && item->data){
- session = item->data;
- return (int)(tsip_ssession_get_id(session->handle)
- - *((tsip_ssession_id_t*)id));
- }
- return -1;
+ const session_t* session;
+ if(item && item->data) {
+ session = item->data;
+ return (int)(tsip_ssession_get_id(session->handle)
+ - *((tsip_ssession_id_t*)id));
+ }
+ return -1;
}
session_t* session_create(session_type_t type, tsip_ssession_handle_t* handle)
{
- session_t* session = tsk_object_new(session_def_t, type, handle);
- if(!session){
- TSK_DEBUG_ERROR("Failed to create new SIP session");
- return tsk_null;
- }
-
- switch(type){
- case st_invite:
- { /* Enable all features (QoS, Session timers, SigComp, ...) */
- tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_USERDATA(session),
- /*=== MEDIA */
- TSIP_SSESSION_SET_MEDIA(
- // 100rel
- TSIP_MSESSION_SET_100rel(tsk_false),
- // Session timers
- TSIP_MSESSION_SET_TIMERS(3600, "uac"),
- // QoS
- TSIP_MSESSION_SET_QOS(tmedia_qos_stype_segmented, tmedia_qos_strength_optional),
- // close media params
- TSIP_MSESSION_SET_NULL()
- ),
-
- TSIP_SSESSION_SET_NULL());
- break;
- }
- default:
- break;
- }
- return session;
+ session_t* session = tsk_object_new(session_def_t, type, handle);
+ if(!session) {
+ TSK_DEBUG_ERROR("Failed to create new SIP session");
+ return tsk_null;
+ }
+
+ switch(type) {
+ case st_invite: {
+ /* Enable all features (QoS, Session timers, SigComp, ...) */
+ tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_USERDATA(session),
+ /*=== MEDIA */
+ TSIP_SSESSION_SET_MEDIA(
+ // 100rel
+ TSIP_MSESSION_SET_100rel(tsk_false),
+ // Session timers
+ TSIP_MSESSION_SET_TIMERS(3600, "uac"),
+ // QoS
+ TSIP_MSESSION_SET_QOS(tmedia_qos_stype_segmented, tmedia_qos_strength_optional),
+ // close media params
+ TSIP_MSESSION_SET_NULL()
+ ),
+
+ TSIP_SSESSION_SET_NULL());
+ break;
+ }
+ default:
+ break;
+ }
+ return session;
}
const session_t* session_get_by_sid(const sessions_L_t* sessions, tsip_ssession_id_t sid)
{
- const tsk_list_item_t* item;
- if((item = tsk_list_find_item_by_pred(sessions, pred_find_session_by_id, &sid))){
- return item->data;
- }
- else{
- return tsk_null;
- }
+ const tsk_list_item_t* item;
+ if((item = tsk_list_find_item_by_pred(sessions, pred_find_session_by_id, &sid))) {
+ return item->data;
+ }
+ else {
+ return tsk_null;
+ }
}
int session_tostring(const session_t* session)
{
- //char* temp = tsk_null;
- printf("== Session: ");
- if(session){
- /* Session Id */
- printf("sid=%llu", tsip_ssession_get_id(session->handle));
- /* Type */
- printf(" type=");
- switch(session->type){
- case st_invite:
- printf("INVITE");
- break;
- case st_message:
- printf("MESSAGE");
- break;
- case st_publish:
- printf("PUBLISH");
- break;
- case st_register:
- printf("REGISTER");
- break;
- case st_subscribe:
- printf("SUBSCRIBE");
- break;
- default:
- printf("(null)");
- break;
- }
- /* From */
- printf(" from=%s", session->from ? session->from : ctx->identity.impu);
- /* From */
- printf(" to=%s", session->to ? session->to : ctx->identity.impu);
- }
- else{
- printf("(invalid)");
- }
- printf("\n");
- return -1;
+ //char* temp = tsk_null;
+ printf("== Session: ");
+ if(session) {
+ /* Session Id */
+ printf("sid=%llu", tsip_ssession_get_id(session->handle));
+ /* Type */
+ printf(" type=");
+ switch(session->type) {
+ case st_invite:
+ printf("INVITE");
+ break;
+ case st_message:
+ printf("MESSAGE");
+ break;
+ case st_publish:
+ printf("PUBLISH");
+ break;
+ case st_register:
+ printf("REGISTER");
+ break;
+ case st_subscribe:
+ printf("SUBSCRIBE");
+ break;
+ default:
+ printf("(null)");
+ break;
+ }
+ /* From */
+ printf(" from=%s", session->from ? session->from : ctx->identity.impu);
+ /* From */
+ printf(" to=%s", session->to ? session->to : ctx->identity.impu);
+ }
+ else {
+ printf("(invalid)");
+ }
+ printf("\n");
+ return -1;
}
/* handle events -common to all sessions */
int session_handle_event(const tsip_event_t *_event)
{
- const session_t* session;
-
- /* Find associated session */
- if(!(session = session_get_by_sid(ctx->sessions, tsip_ssession_get_id(_event->ss)))){
- /* Silentky ignore */
- return 0;
- }
- switch(_event->code)
- {
- /* === 7xx ==> errors === */
- case tsip_event_code_dialog_transport_error:
- case tsip_event_code_dialog_global_error:
- case tsip_event_code_dialog_message_error:
- /* do not guess that the dialog is terminated, wait for "tsip_event_code_dialog_terminated" event */
- break;
-
- /* === 8xx ==> success === */
- case tsip_event_code_dialog_request_incoming:
- case tsip_event_code_dialog_request_cancelled:
- case tsip_event_code_dialog_request_sent:
- break;
-
- /* === 9xx ==> Informational === */
- case tsip_event_code_dialog_terminated:
- { /* we no longer need the session
- * -> remove and destroy the session */
- TSK_DEBUG_INFO("Dialog Terminated --> %s", _event->phrase);
- tsk_list_remove_item_by_data(ctx->sessions, session);
- break;
- }
-
- case tsip_event_code_dialog_connected:
- ((session_t*)session)->connected = tsk_true;
- break;
- case tsip_event_code_dialog_terminating:
- break;
- }
- return 0;
+ const session_t* session;
+
+ /* Find associated session */
+ if(!(session = session_get_by_sid(ctx->sessions, tsip_ssession_get_id(_event->ss)))) {
+ /* Silentky ignore */
+ return 0;
+ }
+ switch(_event->code) {
+ /* === 7xx ==> errors === */
+ case tsip_event_code_dialog_transport_error:
+ case tsip_event_code_dialog_global_error:
+ case tsip_event_code_dialog_message_error:
+ /* do not guess that the dialog is terminated, wait for "tsip_event_code_dialog_terminated" event */
+ break;
+
+ /* === 8xx ==> success === */
+ case tsip_event_code_dialog_request_incoming:
+ case tsip_event_code_dialog_request_cancelled:
+ case tsip_event_code_dialog_request_sent:
+ break;
+
+ /* === 9xx ==> Informational === */
+ case tsip_event_code_dialog_terminated: {
+ /* we no longer need the session
+ * -> remove and destroy the session */
+ TSK_DEBUG_INFO("Dialog Terminated --> %s", _event->phrase);
+ tsk_list_remove_item_by_data(ctx->sessions, session);
+ break;
+ }
+
+ case tsip_event_code_dialog_connected:
+ ((session_t*)session)->connected = tsk_true;
+ break;
+ case tsip_event_code_dialog_terminating:
+ break;
+ }
+ return 0;
}
/* handle commands -common to all sessions */
const session_t* session_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- const opt_t* opt;
- const tsk_list_item_t* item;
- tsk_param_t* param;
- int ret = 0;
-
- /* Check if there is a session with is Id */
- if((opt = opt_get_by_type(opts, opt_sid))){
- tsip_ssession_id_t sid = atoi(opt->value);
- session = session_get_by_sid(ctx->sessions, sid);
- }
+ const session_t* session = tsk_null;
+ const opt_t* opt;
+ const tsk_list_item_t* item;
+ tsk_param_t* param;
+ int ret = 0;
+
+ /* Check if there is a session with is Id */
+ if((opt = opt_get_by_type(opts, opt_sid))) {
+ tsip_ssession_id_t sid = atoi(opt->value);
+ session = session_get_by_sid(ctx->sessions, sid);
+ }
#define TYPE_FROM_CMD(_CMD) \
((_CMD==cmd_audio || _CMD==cmd_video || _CMD==cmd_audiovideo || _CMD==cmd_file || _CMD==cmd_large_message) ? st_invite : \
@@ -602,227 +582,228 @@ const session_t* session_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
(_CMD==cmd_publish ? st_publish : \
(_CMD==cmd_register ? st_register : \
(_CMD==cmd_subscribe ? st_subscribe : st_none))))))
-
- /* === Command === */
- switch(cmd){
- case cmd_audio: case cmd_video: case cmd_audiovideo: case cmd_file: case cmd_large_message:
- case cmd_message:
- case cmd_sms:
- case cmd_options:
- case cmd_publish:
- case cmd_register:
- case cmd_subscribe:
- {
- if(!session){ /* Create "client-side-session" */
- session_t* _session;
- if((_session = session_client_create(TYPE_FROM_CMD(cmd))) && (session = _session)){
- tsk_list_push_back_data(ctx->sessions, (void**)&_session);
- }
- }
- break;
- }
- default:
- {
- if(session){
- /* hold, resume, refer, update, ...all in-dialog commands */
- break;
- }
- else{
- TSK_DEBUG_WARN("Session handling: Cannot handle this command [%d]", cmd);
- goto bail;
- }
- }
- } /* switch */
-
- if(!session){
- TSK_DEBUG_ERROR("SIP Session is Null");
- goto bail;
- }
-
- /* === User Options === */
- tsk_list_foreach(item, opts){
- opt = item->data;
-
- /* Session-level option? */
- if(opt->lv != lv_none && opt->lv != lv_session){
- continue;
- }
-
- switch(opt->type){
- case opt_caps:
- {
- if(!tsk_strnullORempty(opt->value)){
- if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))){
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_CAPS(param->name, param->value),
- TSIP_SSESSION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(param);
- }
- }
- break;
- }
- case opt_expires:
- {
- if(!tsk_strnullORempty(opt->value)){
- unsigned expires = atoi(opt->value);
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_EXPIRES(expires),
- TSIP_SSESSION_SET_NULL());
- }
- break;
- }
- case opt_from:
- { /* You should use TSIP_SSESSION_SET_OPTION(TSIP_SSESSION_OPTION_FROM, value)
- instead of TSIP_SSESSION_SET_HEADER() to set the destination URI. */
- break;
- }
- case opt_header:
- {
- if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))){
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_HEADER(param->name, param->value),
- TSIP_SSESSION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(param);
- }
- break;
- }
- case opt_payload:
- { /* Will be handled by the caller */
- break;
- }
- case opt_silent:
- { /* valueless option */
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_SILENT_HANGUP(tsk_true),
- TSIP_SSESSION_SET_NULL());
- break;
- }
- case opt_sigcomp_id:
- { /* sigcomp-id */
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(opt->value),
- TSIP_SSESSION_SET_NULL());
- break;
- }
- case opt_to:
- { /* You should use TSIP_SSESSION_SET_OPTION(TSIP_SSESSION_OPTION_TO, value)
- instead of TSIP_SSESSION_SET_HEADER() to set the destination URI. */
- if((cmd != cmd_sms) && (cmd != cmd_ect) && !tsk_strnullORempty(opt->value)){ /* SMS will use SMSC Address as Request URI */
- ret = tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_TO(opt->value),
- TSIP_SSESSION_SET_NULL());
- }
- break;
- }
- default:
- {
- /* will be handled by the caller */
- break;
- }
- }
-
- } /* foreach */
+
+ /* === Command === */
+ switch(cmd) {
+ case cmd_audio:
+ case cmd_video:
+ case cmd_audiovideo:
+ case cmd_file:
+ case cmd_large_message:
+ case cmd_message:
+ case cmd_sms:
+ case cmd_options:
+ case cmd_publish:
+ case cmd_register:
+ case cmd_subscribe: {
+ if(!session) { /* Create "client-side-session" */
+ session_t* _session;
+ if((_session = session_client_create(TYPE_FROM_CMD(cmd))) && (session = _session)) {
+ tsk_list_push_back_data(ctx->sessions, (void**)&_session);
+ }
+ }
+ break;
+ }
+ default: {
+ if(session) {
+ /* hold, resume, refer, update, ...all in-dialog commands */
+ break;
+ }
+ else {
+ TSK_DEBUG_WARN("Session handling: Cannot handle this command [%d]", cmd);
+ goto bail;
+ }
+ }
+ } /* switch */
+
+ if(!session) {
+ TSK_DEBUG_ERROR("SIP Session is Null");
+ goto bail;
+ }
+
+ /* === User Options === */
+ tsk_list_foreach(item, opts) {
+ opt = item->data;
+
+ /* Session-level option? */
+ if(opt->lv != lv_none && opt->lv != lv_session) {
+ continue;
+ }
+
+ switch(opt->type) {
+ case opt_caps: {
+ if(!tsk_strnullORempty(opt->value)) {
+ if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))) {
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_CAPS(param->name, param->value),
+ TSIP_SSESSION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ }
+ break;
+ }
+ case opt_expires: {
+ if(!tsk_strnullORempty(opt->value)) {
+ unsigned expires = atoi(opt->value);
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_EXPIRES(expires),
+ TSIP_SSESSION_SET_NULL());
+ }
+ break;
+ }
+ case opt_from: {
+ /* You should use TSIP_SSESSION_SET_OPTION(TSIP_SSESSION_OPTION_FROM, value)
+ instead of TSIP_SSESSION_SET_HEADER() to set the destination URI. */
+ break;
+ }
+ case opt_header: {
+ if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))) {
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_HEADER(param->name, param->value),
+ TSIP_SSESSION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ break;
+ }
+ case opt_payload: {
+ /* Will be handled by the caller */
+ break;
+ }
+ case opt_silent: {
+ /* valueless option */
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_SILENT_HANGUP(tsk_true),
+ TSIP_SSESSION_SET_NULL());
+ break;
+ }
+ case opt_sigcomp_id: {
+ /* sigcomp-id */
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(opt->value),
+ TSIP_SSESSION_SET_NULL());
+ break;
+ }
+ case opt_to: {
+ /* You should use TSIP_SSESSION_SET_OPTION(TSIP_SSESSION_OPTION_TO, value)
+ instead of TSIP_SSESSION_SET_HEADER() to set the destination URI. */
+ if((cmd != cmd_sms) && (cmd != cmd_ect) && !tsk_strnullORempty(opt->value)) { /* SMS will use SMSC Address as Request URI */
+ ret = tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_TO(opt->value),
+ TSIP_SSESSION_SET_NULL());
+ }
+ break;
+ }
+ default: {
+ /* will be handled by the caller */
+ break;
+ }
+ }
+
+ } /* foreach */
bail:
- return session;
+ return session;
}
int session_hangup(tsip_ssession_id_t sid)
{
- const session_t* session;
- if((session = session_get_by_sid(ctx->sessions, sid))){
- switch(session->type){
- case st_invite:
- tsip_api_invite_send_bye(session->handle,
- /* You can add your parameters */
- TSIP_ACTION_SET_NULL());
- break;
- case st_message:
- break;
- case st_publish:
- tsip_api_publish_send_unpublish(session->handle,
- /* You can add your parameters */
- TSIP_ACTION_SET_NULL());
- break;
- case st_register:
- tsip_api_register_send_unregister(session->handle,
- /* You can add your parameters */
- TSIP_ACTION_SET_NULL());
- break;
- case st_subscribe:
- tsip_api_subscribe_send_unsubscribe(session->handle,
- /* You can add your parameters */
- TSIP_ACTION_SET_NULL());
- break;
- default:
- TSK_DEBUG_WARN("Cannot hangup session with this type [%d]", session->type);
- return -2;
- }
- return 0;
- }
- else{
- TSK_DEBUG_WARN("Failed to find session with sid=%llu", sid);
- return -1;
- }
+ const session_t* session;
+ if((session = session_get_by_sid(ctx->sessions, sid))) {
+ switch(session->type) {
+ case st_invite:
+ tsip_api_invite_send_bye(session->handle,
+ /* You can add your parameters */
+ TSIP_ACTION_SET_NULL());
+ break;
+ case st_message:
+ break;
+ case st_publish:
+ tsip_api_publish_send_unpublish(session->handle,
+ /* You can add your parameters */
+ TSIP_ACTION_SET_NULL());
+ break;
+ case st_register:
+ tsip_api_register_send_unregister(session->handle,
+ /* You can add your parameters */
+ TSIP_ACTION_SET_NULL());
+ break;
+ case st_subscribe:
+ tsip_api_subscribe_send_unsubscribe(session->handle,
+ /* You can add your parameters */
+ TSIP_ACTION_SET_NULL());
+ break;
+ default:
+ TSK_DEBUG_WARN("Cannot hangup session with this type [%d]", session->type);
+ return -2;
+ }
+ return 0;
+ }
+ else {
+ TSK_DEBUG_WARN("Failed to find session with sid=%llu", sid);
+ return -1;
+ }
}
static tsk_object_t* session_ctor(tsk_object_t * self, va_list * app)
{
- session_t *session = self;
- if(session){
- session->type = va_arg(*app, session_type_t);
- if((session->handle = va_arg(*app, tsip_ssession_handle_t*))){
- int ret;
- /* "server-side-session" */
- if((ret = tsip_ssession_take_ownership(session->handle))){
- TSK_DEBUG_ERROR("Failed to take ownership [%d]", ret);
- }
- }
- else{
- /* "client-side-session" */
- session->handle = tsip_ssession_create(ctx->stack,
- TSIP_SSESSION_SET_NULL());
- }
- }
- return self;
+ session_t *session = self;
+ if(session) {
+ session->type = va_arg(*app, session_type_t);
+ if((session->handle = va_arg(*app, tsip_ssession_handle_t*))) {
+ int ret;
+ /* "server-side-session" */
+ if((ret = tsip_ssession_take_ownership(session->handle))) {
+ TSK_DEBUG_ERROR("Failed to take ownership [%d]", ret);
+ }
+ }
+ else {
+ /* "client-side-session" */
+ session->handle = tsip_ssession_create(ctx->stack,
+ TSIP_SSESSION_SET_NULL());
+ }
+ }
+ return self;
}
static tsk_object_t* session_dtor(tsk_object_t * self)
-{
- session_t *session = self;
- if(session){
- TSK_OBJECT_SAFE_FREE(session->handle);
+{
+ session_t *session = self;
+ if(session) {
+ TSK_OBJECT_SAFE_FREE(session->handle);
- TSK_FREE(session->to);
- TSK_FREE(session->from);
- }
+ TSK_FREE(session->to);
+ TSK_FREE(session->from);
+ }
- return self;
+ return self;
}
static int session_cmp(const tsk_object_t *_ss1, const tsk_object_t *_ss2)
{
- const session_t *ss1 = _ss1;
- const session_t *ss2 = _ss2;
-
- if(ss1 && ss1){
- if(ss1->handle && ss2->handle){
- return tsk_object_cmp(ss1->handle, ss2->handle);
- }
- else{
- return (ss2 - ss1);
- }
- }
- else if(!ss1 && !ss2) return 0;
- else return -1;
+ const session_t *ss1 = _ss1;
+ const session_t *ss2 = _ss2;
+
+ if(ss1 && ss1) {
+ if(ss1->handle && ss2->handle) {
+ return tsk_object_cmp(ss1->handle, ss2->handle);
+ }
+ else {
+ return (ss2 - ss1);
+ }
+ }
+ else if(!ss1 && !ss2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t session_def_s =
-{
- sizeof(session_t),
- session_ctor,
- session_dtor,
- session_cmp,
+static const tsk_object_def_t session_def_s = {
+ sizeof(session_t),
+ session_ctor,
+ session_dtor,
+ session_cmp,
};
const tsk_object_def_t *session_def_t = &session_def_s;
@@ -830,51 +811,50 @@ const tsk_object_def_t *session_def_t = &session_def_s;
tsip_action_handle_t* action_get_config(const opts_L_t* opts)
{
- const opt_t* opt;
- const tsk_list_item_t* item;
- tsip_action_handle_t* action_config = tsk_null;
- tsk_param_t* param;
-
- if(TSK_LIST_IS_EMPTY(opts)){
- return tsk_null;
- }
-
- tsk_list_foreach(item, opts){
- opt = item->data;
-
- /* action level? */
- if(opt->lv != lv_action){
- continue;
- }
-
- /* create new action */
- if(!action_config && !(action_config = tsip_action_create(tsip_atype_config,
- TSIP_ACTION_SET_NULL()))) break;
-
- switch(opt->type){
- case opt_header:
- {
- if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))){
- tsip_action_set(action_config,
- TSIP_ACTION_SET_HEADER(param->name, param->value),
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(param);
- }
- break;
- }
- case opt_payload:
- {
- tsip_action_set(action_config,
- TSIP_ACTION_SET_PAYLOAD(opt->value, tsk_strlen(opt->value)),
- TSIP_ACTION_SET_NULL());
- break;
- }
- default:
- {
- break;
- }
- }
- }
-
- return action_config;
+ const opt_t* opt;
+ const tsk_list_item_t* item;
+ tsip_action_handle_t* action_config = tsk_null;
+ tsk_param_t* param;
+
+ if(TSK_LIST_IS_EMPTY(opts)) {
+ return tsk_null;
+ }
+
+ tsk_list_foreach(item, opts) {
+ opt = item->data;
+
+ /* action level? */
+ if(opt->lv != lv_action) {
+ continue;
+ }
+
+ /* create new action */
+ if(!action_config && !(action_config = tsip_action_create(tsip_atype_config,
+ TSIP_ACTION_SET_NULL()))) {
+ break;
+ }
+
+ switch(opt->type) {
+ case opt_header: {
+ if((param = tsk_params_parse_param(opt->value, tsk_strlen(opt->value)))) {
+ tsip_action_set(action_config,
+ TSIP_ACTION_SET_HEADER(param->name, param->value),
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ break;
+ }
+ case opt_payload: {
+ tsip_action_set(action_config,
+ TSIP_ACTION_SET_PAYLOAD(opt->value, tsk_strlen(opt->value)),
+ TSIP_ACTION_SET_NULL());
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ return action_config;
}
diff --git a/tinyDEMO/common.h b/tinyDEMO/common.h
index 7c32547..b25dce6 100755
--- a/tinyDEMO/common.h
+++ b/tinyDEMO/common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,76 +30,73 @@
_BEGIN_DECLS
-typedef enum session_type_e
-{
- st_none,
+typedef enum session_type_e {
+ st_none,
- st_invite,
- st_message,
- st_options,
- st_publish,
- st_register,
- st_subscribe,
+ st_invite,
+ st_message,
+ st_options,
+ st_publish,
+ st_register,
+ st_subscribe,
}
session_type_t;
-typedef struct session_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_ssession_handle_t* handle;
-
- session_type_t type;
- char* from;
- char* to;
- tsk_bool_t connected;
+typedef struct session_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_ssession_handle_t* handle;
+
+ session_type_t type;
+ char* from;
+ char* to;
+ tsk_bool_t connected;
}
session_t;
typedef tsk_list_t sessions_L_t;
#define SESSION(self) ((session_t*)(self))
-typedef struct ctx_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_stack_handle_t *stack;
-
- /* Identity */
- struct{
- char* display_name;
- char *impu;
- char *preferred;
- char *impi;
- char *password;
- } identity;
-
- /* Network */
- struct{
- char *local_ip;
- tnet_port_t local_port;
-
- char *proxy_cscf;
- tnet_port_t proxy_cscf_port;
- char* proxy_cscf_trans;
-
- char *realm;
-
- tsk_bool_t ipv6;
- tsk_bool_t naptr;
- tsk_bool_t dhcp;
- } network;
-
- /* Security */
- struct{
- tsk_bool_t earlyIMS;
- char* operator_id;
- uint16_t amf;
- } security;
-
- sessions_L_t* sessions;
- tsk_params_L_t* params;
-
- TSK_DECLARE_SAFEOBJ; /* For thread-safeness */
+typedef struct ctx_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_stack_handle_t *stack;
+
+ /* Identity */
+ struct {
+ char* display_name;
+ char *impu;
+ char *preferred;
+ char *impi;
+ char *password;
+ } identity;
+
+ /* Network */
+ struct {
+ char *local_ip;
+ tnet_port_t local_port;
+
+ char *proxy_cscf;
+ tnet_port_t proxy_cscf_port;
+ char* proxy_cscf_trans;
+
+ char *realm;
+
+ tsk_bool_t ipv6;
+ tsk_bool_t naptr;
+ tsk_bool_t dhcp;
+ } network;
+
+ /* Security */
+ struct {
+ tsk_bool_t earlyIMS;
+ char* operator_id;
+ uint16_t amf;
+ } security;
+
+ sessions_L_t* sessions;
+ tsk_params_L_t* params;
+
+ TSK_DECLARE_SAFEOBJ; /* For thread-safeness */
}
ctx_t;
diff --git a/tinyDEMO/demo_config.h b/tinyDEMO/demo_config.h
index 6d8c84b..97fd2d2 100755
--- a/tinyDEMO/demo_config.h
+++ b/tinyDEMO/demo_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,7 +31,7 @@
# define _BEGIN_DECLS extern "C" {
# define _END_DECLS }
#else
-# define _BEGIN_DECLS
+# define _BEGIN_DECLS
# define _END_DECLS
#endif
diff --git a/tinyDEMO/dssl.c b/tinyDEMO/dssl.c
index 599394b..c1b67ac 100755
--- a/tinyDEMO/dssl.c
+++ b/tinyDEMO/dssl.c
@@ -4,19 +4,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,43 +36,42 @@
char* replace_param(char* pivot, int index_1, int index_2, tsk_params_L_t* params)
{
- char* pname = tsk_null;
- char* ret = tsk_null;
- const tsk_param_t* p;
- //tsk_size_t len = tsk_strlen(pivot);
- //tsk_bool_t parenthesis = tsk_false;
- int i1, i2;
-
- /* whether there are parenthesis around the param */
- if((i1 = tsk_strindexOf((pivot + index_1), tsk_strlen((pivot + index_1)), "(")) == 2
- && (i2 = tsk_strindexOf((pivot + index_1 + i1), tsk_strlen((pivot + index_1 + i1)), ")")) != -1)
- {
- pname = tsk_strndup((pivot + index_1 + i1 + 1), (i2 - i1 + 1));
- index_2 = index_1 + i1 + i2 + 1;
- }
- else{
- pname = tsk_strndup((pivot + index_1 + 2/*$$*/), (index_2 - index_1 - 2));
- }
+ char* pname = tsk_null;
+ char* ret = tsk_null;
+ const tsk_param_t* p;
+ //tsk_size_t len = tsk_strlen(pivot);
+ //tsk_bool_t parenthesis = tsk_false;
+ int i1, i2;
+
+ /* whether there are parenthesis around the param */
+ if((i1 = tsk_strindexOf((pivot + index_1), tsk_strlen((pivot + index_1)), "(")) == 2
+ && (i2 = tsk_strindexOf((pivot + index_1 + i1), tsk_strlen((pivot + index_1 + i1)), ")")) != -1) {
+ pname = tsk_strndup((pivot + index_1 + i1 + 1), (i2 - i1 + 1));
+ index_2 = index_1 + i1 + i2 + 1;
+ }
+ else {
+ pname = tsk_strndup((pivot + index_1 + 2/*$$*/), (index_2 - index_1 - 2));
+ }
- if((p = tsk_params_get_param_by_name(params, pname))){
- tsk_strncat(&ret, pivot, index_1);
- tsk_strncat(&ret, p->value, tsk_strlen(p->value));
- tsk_strncat(&ret, (pivot + index_2), (tsk_strlen(pivot) - index_2));
- }
- else{
- TSK_DEBUG_WARN("Failed to find param [%s]", pname);
- }
+ if((p = tsk_params_get_param_by_name(params, pname))) {
+ tsk_strncat(&ret, pivot, index_1);
+ tsk_strncat(&ret, p->value, tsk_strlen(p->value));
+ tsk_strncat(&ret, (pivot + index_2), (tsk_strlen(pivot) - index_2));
+ }
+ else {
+ TSK_DEBUG_WARN("Failed to find param [%s]", pname);
+ }
- TSK_FREE(pname);
- return ret;
+ TSK_FREE(pname);
+ return ret;
}
tsk_bool_t next_not_(const char* p, const char* pe, char c)
{
- if((p && pe) && (pe-p) >=2){
- return (*p == c && *(p + 1) == c) ? tsk_false : tsk_true;
- }
- return tsk_true;
+ if((p && pe) && (pe-p) >=2) {
+ return (*p == c && *(p + 1) == c) ? tsk_false : tsk_true;
+ }
+ return tsk_true;
}
#define next_not_hyphens(p, pe) next_not_(p, pe, '-')
#define next_not_arobases(p, pe) next_not_(p, pe, '@')
@@ -88,4984 +87,5161 @@ tsk_bool_t next_not_(const char* p, const char* pe, char c)
cmd_t* dssl_parse(const char *buffer, tsk_size_t size, tsk_bool_t *comment, tsk_params_L_t* params)
{
- int cs = 0;
- const char *p = buffer;
- const char *pe;
- const char *eof;
- opt_t* opt = tsk_null;
- tsk_param_t* param = tsk_null;
- cmd_t *cmd = cmd_create_null();
- char* temp = tsk_null;
- int index;
+ int cs = 0;
+ const char *p = buffer;
+ const char *pe;
+ const char *eof;
+ opt_t* opt = tsk_null;
+ tsk_param_t* param = tsk_null;
+ cmd_t *cmd = cmd_create_null();
+ char* temp = tsk_null;
+ int index;
+
+ const char *ts = tsk_null, *te = tsk_null;
+ int act = 0;
+
+ const char *tag_start = tsk_null;
+
+ /* global vars and initilization (Ragel) */
+
+ /* #line 109 "./dssl.c" */
+ static const char _demo_machine_parser_cmd_actions[] = {
+ 0, 1, 0, 1, 3, 1, 8, 1,
+ 12, 1, 13, 1, 14, 1, 15, 1,
+ 16, 1, 17, 1, 18, 1, 19, 1,
+ 20, 1, 21, 1, 22, 1, 23, 1,
+ 24, 1, 25, 1, 26, 1, 27, 1,
+ 28, 1, 29, 1, 30, 1, 31, 1,
+ 32, 1, 33, 1, 34, 1, 35, 1,
+ 36, 1, 37, 1, 38, 1, 39, 1,
+ 40, 1, 41, 1, 42, 1, 43, 1,
+ 44, 1, 45, 1, 46, 1, 47, 1,
+ 48, 1, 49, 1, 50, 1, 51, 1,
+ 52, 1, 53, 1, 54, 1, 55, 1,
+ 56, 1, 57, 1, 58, 1, 59, 1,
+ 60, 1, 61, 1, 62, 1, 63, 1,
+ 64, 1, 65, 1, 66, 1, 67, 1,
+ 68, 1, 69, 1, 70, 1, 71, 1,
+ 72, 1, 73, 1, 74, 1, 75, 1,
+ 76, 1, 78, 1, 84, 1, 85, 2,
+ 0, 3, 2, 0, 12, 2, 1, 0,
+ 2, 2, 80, 2, 3, 0, 2, 4,
+ 77, 2, 4, 82, 2, 5, 0, 2,
+ 9, 83, 2, 11, 79, 2, 13, 79,
+ 2, 14, 79, 2, 15, 79, 2, 16,
+ 79, 2, 17, 79, 2, 18, 79, 2,
+ 19, 79, 2, 20, 79, 2, 21, 79,
+ 2, 22, 79, 2, 23, 79, 2, 24,
+ 79, 2, 25, 79, 2, 26, 79, 2,
+ 27, 79, 2, 28, 79, 2, 29, 79,
+ 2, 30, 79, 2, 31, 79, 2, 32,
+ 79, 2, 33, 79, 2, 34, 79, 2,
+ 35, 79, 2, 36, 79, 2, 37, 79,
+ 2, 71, 12, 2, 72, 12, 2, 73,
+ 12, 2, 76, 0, 2, 76, 3, 2,
+ 76, 10, 2, 76, 12, 2, 76, 13,
+ 2, 76, 14, 2, 76, 15, 2, 76,
+ 16, 2, 76, 17, 2, 76, 18, 2,
+ 76, 19, 2, 76, 20, 2, 76, 21,
+ 2, 76, 22, 2, 76, 23, 2, 76,
+ 24, 2, 76, 25, 2, 76, 26, 2,
+ 76, 27, 2, 76, 28, 2, 76, 29,
+ 2, 76, 30, 2, 76, 31, 2, 76,
+ 32, 2, 76, 33, 2, 76, 34, 2,
+ 76, 35, 2, 76, 36, 2, 76, 37,
+ 2, 76, 38, 2, 76, 39, 2, 76,
+ 40, 2, 76, 41, 2, 76, 42, 2,
+ 76, 43, 2, 76, 44, 2, 76, 45,
+ 2, 76, 46, 2, 76, 47, 2, 76,
+ 48, 2, 76, 49, 2, 76, 50, 2,
+ 76, 51, 2, 76, 52, 2, 76, 53,
+ 2, 76, 54, 2, 76, 55, 2, 76,
+ 56, 2, 76, 57, 2, 76, 58, 2,
+ 76, 59, 2, 76, 60, 2, 76, 61,
+ 2, 76, 62, 2, 76, 63, 2, 76,
+ 64, 2, 76, 65, 2, 76, 66, 2,
+ 76, 67, 2, 76, 68, 2, 76, 69,
+ 2, 76, 70, 2, 76, 71, 2, 76,
+ 72, 2, 76, 73, 3, 0, 4, 77,
+ 3, 0, 4, 82, 3, 0, 9, 83,
+ 3, 0, 11, 79, 3, 3, 2, 80,
+ 3, 5, 0, 8, 3, 7, 6, 81,
+ 3, 10, 0, 3, 3, 12, 2, 80,
+ 3, 13, 11, 79, 3, 14, 11, 79,
+ 3, 15, 11, 79, 3, 16, 11, 79,
+ 3, 17, 11, 79, 3, 18, 11, 79,
+ 3, 19, 11, 79, 3, 20, 11, 79,
+ 3, 21, 11, 79, 3, 22, 11, 79,
+ 3, 23, 11, 79, 3, 24, 11, 79,
+ 3, 25, 11, 79, 3, 26, 11, 79,
+ 3, 27, 11, 79, 3, 28, 11, 79,
+ 3, 29, 11, 79, 3, 30, 11, 79,
+ 3, 31, 11, 79, 3, 32, 11, 79,
+ 3, 33, 11, 79, 3, 34, 11, 79,
+ 3, 35, 11, 79, 3, 36, 11, 79,
+ 3, 37, 11, 79, 3, 38, 0, 3,
+ 3, 39, 0, 3, 3, 40, 0, 3,
+ 3, 41, 0, 3, 3, 42, 0, 3,
+ 3, 43, 0, 3, 3, 44, 0, 3,
+ 3, 45, 0, 3, 3, 46, 0, 3,
+ 3, 47, 0, 3, 3, 48, 0, 3,
+ 3, 49, 0, 3, 3, 50, 0, 3,
+ 3, 51, 0, 3, 3, 52, 0, 3,
+ 3, 53, 0, 3, 3, 54, 0, 3,
+ 3, 55, 0, 3, 3, 56, 0, 3,
+ 3, 57, 0, 3, 3, 58, 0, 3,
+ 3, 59, 0, 3, 3, 60, 0, 3,
+ 3, 61, 0, 3, 3, 62, 0, 3,
+ 3, 63, 0, 3, 3, 64, 0, 3,
+ 3, 65, 0, 3, 3, 66, 0, 3,
+ 3, 67, 0, 3, 3, 68, 0, 3,
+ 3, 69, 0, 3, 3, 70, 0, 3,
+ 3, 71, 2, 80, 3, 72, 2, 80,
+ 3, 73, 2, 80, 3, 76, 0, 12,
+ 3, 76, 1, 0, 3, 76, 10, 0,
+ 3, 76, 38, 0, 3, 76, 38, 10,
+ 3, 76, 39, 0, 3, 76, 39, 10,
+ 3, 76, 40, 0, 3, 76, 40, 10,
+ 3, 76, 41, 0, 3, 76, 41, 10,
+ 3, 76, 42, 0, 3, 76, 42, 10,
+ 3, 76, 43, 0, 3, 76, 43, 10,
+ 3, 76, 44, 0, 3, 76, 44, 10,
+ 3, 76, 45, 0, 3, 76, 45, 10,
+ 3, 76, 46, 0, 3, 76, 46, 10,
+ 3, 76, 47, 0, 3, 76, 47, 10,
+ 3, 76, 48, 0, 3, 76, 48, 10,
+ 3, 76, 49, 0, 3, 76, 49, 10,
+ 3, 76, 50, 0, 3, 76, 50, 10,
+ 3, 76, 51, 0, 3, 76, 51, 10,
+ 3, 76, 52, 0, 3, 76, 52, 10,
+ 3, 76, 53, 0, 3, 76, 53, 10,
+ 3, 76, 54, 0, 3, 76, 54, 10,
+ 3, 76, 55, 0, 3, 76, 55, 10,
+ 3, 76, 56, 0, 3, 76, 56, 10,
+ 3, 76, 57, 0, 3, 76, 57, 10,
+ 3, 76, 58, 0, 3, 76, 58, 10,
+ 3, 76, 59, 0, 3, 76, 59, 10,
+ 3, 76, 60, 0, 3, 76, 60, 10,
+ 3, 76, 61, 0, 3, 76, 61, 10,
+ 3, 76, 62, 0, 3, 76, 62, 10,
+ 3, 76, 63, 0, 3, 76, 63, 10,
+ 3, 76, 64, 0, 3, 76, 64, 10,
+ 3, 76, 65, 0, 3, 76, 65, 10,
+ 3, 76, 66, 0, 3, 76, 66, 10,
+ 3, 76, 67, 0, 3, 76, 67, 10,
+ 3, 76, 68, 0, 3, 76, 68, 10,
+ 3, 76, 69, 0, 3, 76, 69, 10,
+ 3, 76, 70, 0, 3, 76, 70, 10,
+ 3, 76, 71, 12, 3, 76, 72, 12,
+ 3, 76, 73, 12, 4, 0, 3, 2,
+ 80, 4, 0, 7, 6, 81, 4, 0,
+ 12, 2, 80, 4, 1, 0, 10, 3,
+ 4, 3, 12, 2, 80, 4, 3, 71,
+ 2, 80, 4, 3, 72, 2, 80, 4,
+ 3, 73, 2, 80, 4, 38, 10, 0,
+ 3, 4, 39, 10, 0, 3, 4, 40,
+ 10, 0, 3, 4, 41, 10, 0, 3,
+ 4, 42, 10, 0, 3, 4, 43, 10,
+ 0, 3, 4, 44, 10, 0, 3, 4,
+ 45, 10, 0, 3, 4, 46, 10, 0,
+ 3, 4, 47, 10, 0, 3, 4, 48,
+ 10, 0, 3, 4, 49, 10, 0, 3,
+ 4, 50, 10, 0, 3, 4, 51, 10,
+ 0, 3, 4, 52, 10, 0, 3, 4,
+ 53, 10, 0, 3, 4, 54, 10, 0,
+ 3, 4, 55, 10, 0, 3, 4, 56,
+ 10, 0, 3, 4, 57, 10, 0, 3,
+ 4, 58, 10, 0, 3, 4, 59, 10,
+ 0, 3, 4, 60, 10, 0, 3, 4,
+ 61, 10, 0, 3, 4, 62, 10, 0,
+ 3, 4, 63, 10, 0, 3, 4, 64,
+ 10, 0, 3, 4, 65, 10, 0, 3,
+ 4, 66, 10, 0, 3, 4, 67, 10,
+ 0, 3, 4, 68, 10, 0, 3, 4,
+ 69, 10, 0, 3, 4, 70, 10, 0,
+ 3, 4, 71, 12, 2, 80, 4, 72,
+ 12, 2, 80, 4, 73, 12, 2, 80,
+ 4, 76, 1, 0, 10, 4, 76, 38,
+ 10, 0, 4, 76, 39, 10, 0, 4,
+ 76, 40, 10, 0, 4, 76, 41, 10,
+ 0, 4, 76, 42, 10, 0, 4, 76,
+ 43, 10, 0, 4, 76, 44, 10, 0,
+ 4, 76, 45, 10, 0, 4, 76, 46,
+ 10, 0, 4, 76, 47, 10, 0, 4,
+ 76, 48, 10, 0, 4, 76, 49, 10,
+ 0, 4, 76, 50, 10, 0, 4, 76,
+ 51, 10, 0, 4, 76, 52, 10, 0,
+ 4, 76, 53, 10, 0, 4, 76, 54,
+ 10, 0, 4, 76, 55, 10, 0, 4,
+ 76, 56, 10, 0, 4, 76, 57, 10,
+ 0, 4, 76, 58, 10, 0, 4, 76,
+ 59, 10, 0, 4, 76, 60, 10, 0,
+ 4, 76, 61, 10, 0, 4, 76, 62,
+ 10, 0, 4, 76, 63, 10, 0, 4,
+ 76, 64, 10, 0, 4, 76, 65, 10,
+ 0, 4, 76, 66, 10, 0, 4, 76,
+ 67, 10, 0, 4, 76, 68, 10, 0,
+ 4, 76, 69, 10, 0, 4, 76, 70,
+ 10, 0, 5, 3, 0, 12, 2, 80,
+ 5, 3, 71, 12, 2, 80, 5, 3,
+ 72, 12, 2, 80, 5, 3, 73, 12,
+ 2, 80, 5, 10, 0, 3, 2, 80,
+ 5, 38, 0, 3, 2, 80, 5, 39,
+ 0, 3, 2, 80, 5, 40, 0, 3,
+ 2, 80, 5, 41, 0, 3, 2, 80,
+ 5, 42, 0, 3, 2, 80, 5, 43,
+ 0, 3, 2, 80, 5, 44, 0, 3,
+ 2, 80, 5, 45, 0, 3, 2, 80,
+ 5, 46, 0, 3, 2, 80, 5, 47,
+ 0, 3, 2, 80, 5, 48, 0, 3,
+ 2, 80, 5, 49, 0, 3, 2, 80,
+ 5, 50, 0, 3, 2, 80, 5, 51,
+ 0, 3, 2, 80, 5, 52, 0, 3,
+ 2, 80, 5, 53, 0, 3, 2, 80,
+ 5, 54, 0, 3, 2, 80, 5, 55,
+ 0, 3, 2, 80, 5, 56, 0, 3,
+ 2, 80, 5, 57, 0, 3, 2, 80,
+ 5, 58, 0, 3, 2, 80, 5, 59,
+ 0, 3, 2, 80, 5, 60, 0, 3,
+ 2, 80, 5, 61, 0, 3, 2, 80,
+ 5, 62, 0, 3, 2, 80, 5, 63,
+ 0, 3, 2, 80, 5, 64, 0, 3,
+ 2, 80, 5, 65, 0, 3, 2, 80,
+ 5, 66, 0, 3, 2, 80, 5, 67,
+ 0, 3, 2, 80, 5, 68, 0, 3,
+ 2, 80, 5, 69, 0, 3, 2, 80,
+ 5, 70, 0, 3, 2, 80, 6, 1,
+ 0, 10, 3, 2, 80, 6, 38, 10,
+ 0, 3, 2, 80, 6, 39, 10, 0,
+ 3, 2, 80, 6, 40, 10, 0, 3,
+ 2, 80, 6, 41, 10, 0, 3, 2,
+ 80, 6, 42, 10, 0, 3, 2, 80,
+ 6, 43, 10, 0, 3, 2, 80, 6,
+ 44, 10, 0, 3, 2, 80, 6, 45,
+ 10, 0, 3, 2, 80, 6, 46, 10,
+ 0, 3, 2, 80, 6, 47, 10, 0,
+ 3, 2, 80, 6, 48, 10, 0, 3,
+ 2, 80, 6, 49, 10, 0, 3, 2,
+ 80, 6, 50, 10, 0, 3, 2, 80,
+ 6, 51, 10, 0, 3, 2, 80, 6,
+ 52, 10, 0, 3, 2, 80, 6, 53,
+ 10, 0, 3, 2, 80, 6, 54, 10,
+ 0, 3, 2, 80, 6, 55, 10, 0,
+ 3, 2, 80, 6, 56, 10, 0, 3,
+ 2, 80, 6, 57, 10, 0, 3, 2,
+ 80, 6, 58, 10, 0, 3, 2, 80,
+ 6, 59, 10, 0, 3, 2, 80, 6,
+ 60, 10, 0, 3, 2, 80, 6, 61,
+ 10, 0, 3, 2, 80, 6, 62, 10,
+ 0, 3, 2, 80, 6, 63, 10, 0,
+ 3, 2, 80, 6, 64, 10, 0, 3,
+ 2, 80, 6, 65, 10, 0, 3, 2,
+ 80, 6, 66, 10, 0, 3, 2, 80,
+ 6, 67, 10, 0, 3, 2, 80, 6,
+ 68, 10, 0, 3, 2, 80, 6, 69,
+ 10, 0, 3, 2, 80, 6, 70, 10,
+ 0, 3, 2, 80
+ };
- const char *ts = tsk_null, *te = tsk_null;
- int act = 0;
-
- const char *tag_start = tsk_null;
-
- /* global vars and initilization (Ragel) */
-
-/* #line 109 "./dssl.c" */
-static const char _demo_machine_parser_cmd_actions[] = {
- 0, 1, 0, 1, 3, 1, 8, 1,
- 12, 1, 13, 1, 14, 1, 15, 1,
- 16, 1, 17, 1, 18, 1, 19, 1,
- 20, 1, 21, 1, 22, 1, 23, 1,
- 24, 1, 25, 1, 26, 1, 27, 1,
- 28, 1, 29, 1, 30, 1, 31, 1,
- 32, 1, 33, 1, 34, 1, 35, 1,
- 36, 1, 37, 1, 38, 1, 39, 1,
- 40, 1, 41, 1, 42, 1, 43, 1,
- 44, 1, 45, 1, 46, 1, 47, 1,
- 48, 1, 49, 1, 50, 1, 51, 1,
- 52, 1, 53, 1, 54, 1, 55, 1,
- 56, 1, 57, 1, 58, 1, 59, 1,
- 60, 1, 61, 1, 62, 1, 63, 1,
- 64, 1, 65, 1, 66, 1, 67, 1,
- 68, 1, 69, 1, 70, 1, 71, 1,
- 72, 1, 73, 1, 74, 1, 75, 1,
- 76, 1, 78, 1, 84, 1, 85, 2,
- 0, 3, 2, 0, 12, 2, 1, 0,
- 2, 2, 80, 2, 3, 0, 2, 4,
- 77, 2, 4, 82, 2, 5, 0, 2,
- 9, 83, 2, 11, 79, 2, 13, 79,
- 2, 14, 79, 2, 15, 79, 2, 16,
- 79, 2, 17, 79, 2, 18, 79, 2,
- 19, 79, 2, 20, 79, 2, 21, 79,
- 2, 22, 79, 2, 23, 79, 2, 24,
- 79, 2, 25, 79, 2, 26, 79, 2,
- 27, 79, 2, 28, 79, 2, 29, 79,
- 2, 30, 79, 2, 31, 79, 2, 32,
- 79, 2, 33, 79, 2, 34, 79, 2,
- 35, 79, 2, 36, 79, 2, 37, 79,
- 2, 71, 12, 2, 72, 12, 2, 73,
- 12, 2, 76, 0, 2, 76, 3, 2,
- 76, 10, 2, 76, 12, 2, 76, 13,
- 2, 76, 14, 2, 76, 15, 2, 76,
- 16, 2, 76, 17, 2, 76, 18, 2,
- 76, 19, 2, 76, 20, 2, 76, 21,
- 2, 76, 22, 2, 76, 23, 2, 76,
- 24, 2, 76, 25, 2, 76, 26, 2,
- 76, 27, 2, 76, 28, 2, 76, 29,
- 2, 76, 30, 2, 76, 31, 2, 76,
- 32, 2, 76, 33, 2, 76, 34, 2,
- 76, 35, 2, 76, 36, 2, 76, 37,
- 2, 76, 38, 2, 76, 39, 2, 76,
- 40, 2, 76, 41, 2, 76, 42, 2,
- 76, 43, 2, 76, 44, 2, 76, 45,
- 2, 76, 46, 2, 76, 47, 2, 76,
- 48, 2, 76, 49, 2, 76, 50, 2,
- 76, 51, 2, 76, 52, 2, 76, 53,
- 2, 76, 54, 2, 76, 55, 2, 76,
- 56, 2, 76, 57, 2, 76, 58, 2,
- 76, 59, 2, 76, 60, 2, 76, 61,
- 2, 76, 62, 2, 76, 63, 2, 76,
- 64, 2, 76, 65, 2, 76, 66, 2,
- 76, 67, 2, 76, 68, 2, 76, 69,
- 2, 76, 70, 2, 76, 71, 2, 76,
- 72, 2, 76, 73, 3, 0, 4, 77,
- 3, 0, 4, 82, 3, 0, 9, 83,
- 3, 0, 11, 79, 3, 3, 2, 80,
- 3, 5, 0, 8, 3, 7, 6, 81,
- 3, 10, 0, 3, 3, 12, 2, 80,
- 3, 13, 11, 79, 3, 14, 11, 79,
- 3, 15, 11, 79, 3, 16, 11, 79,
- 3, 17, 11, 79, 3, 18, 11, 79,
- 3, 19, 11, 79, 3, 20, 11, 79,
- 3, 21, 11, 79, 3, 22, 11, 79,
- 3, 23, 11, 79, 3, 24, 11, 79,
- 3, 25, 11, 79, 3, 26, 11, 79,
- 3, 27, 11, 79, 3, 28, 11, 79,
- 3, 29, 11, 79, 3, 30, 11, 79,
- 3, 31, 11, 79, 3, 32, 11, 79,
- 3, 33, 11, 79, 3, 34, 11, 79,
- 3, 35, 11, 79, 3, 36, 11, 79,
- 3, 37, 11, 79, 3, 38, 0, 3,
- 3, 39, 0, 3, 3, 40, 0, 3,
- 3, 41, 0, 3, 3, 42, 0, 3,
- 3, 43, 0, 3, 3, 44, 0, 3,
- 3, 45, 0, 3, 3, 46, 0, 3,
- 3, 47, 0, 3, 3, 48, 0, 3,
- 3, 49, 0, 3, 3, 50, 0, 3,
- 3, 51, 0, 3, 3, 52, 0, 3,
- 3, 53, 0, 3, 3, 54, 0, 3,
- 3, 55, 0, 3, 3, 56, 0, 3,
- 3, 57, 0, 3, 3, 58, 0, 3,
- 3, 59, 0, 3, 3, 60, 0, 3,
- 3, 61, 0, 3, 3, 62, 0, 3,
- 3, 63, 0, 3, 3, 64, 0, 3,
- 3, 65, 0, 3, 3, 66, 0, 3,
- 3, 67, 0, 3, 3, 68, 0, 3,
- 3, 69, 0, 3, 3, 70, 0, 3,
- 3, 71, 2, 80, 3, 72, 2, 80,
- 3, 73, 2, 80, 3, 76, 0, 12,
- 3, 76, 1, 0, 3, 76, 10, 0,
- 3, 76, 38, 0, 3, 76, 38, 10,
- 3, 76, 39, 0, 3, 76, 39, 10,
- 3, 76, 40, 0, 3, 76, 40, 10,
- 3, 76, 41, 0, 3, 76, 41, 10,
- 3, 76, 42, 0, 3, 76, 42, 10,
- 3, 76, 43, 0, 3, 76, 43, 10,
- 3, 76, 44, 0, 3, 76, 44, 10,
- 3, 76, 45, 0, 3, 76, 45, 10,
- 3, 76, 46, 0, 3, 76, 46, 10,
- 3, 76, 47, 0, 3, 76, 47, 10,
- 3, 76, 48, 0, 3, 76, 48, 10,
- 3, 76, 49, 0, 3, 76, 49, 10,
- 3, 76, 50, 0, 3, 76, 50, 10,
- 3, 76, 51, 0, 3, 76, 51, 10,
- 3, 76, 52, 0, 3, 76, 52, 10,
- 3, 76, 53, 0, 3, 76, 53, 10,
- 3, 76, 54, 0, 3, 76, 54, 10,
- 3, 76, 55, 0, 3, 76, 55, 10,
- 3, 76, 56, 0, 3, 76, 56, 10,
- 3, 76, 57, 0, 3, 76, 57, 10,
- 3, 76, 58, 0, 3, 76, 58, 10,
- 3, 76, 59, 0, 3, 76, 59, 10,
- 3, 76, 60, 0, 3, 76, 60, 10,
- 3, 76, 61, 0, 3, 76, 61, 10,
- 3, 76, 62, 0, 3, 76, 62, 10,
- 3, 76, 63, 0, 3, 76, 63, 10,
- 3, 76, 64, 0, 3, 76, 64, 10,
- 3, 76, 65, 0, 3, 76, 65, 10,
- 3, 76, 66, 0, 3, 76, 66, 10,
- 3, 76, 67, 0, 3, 76, 67, 10,
- 3, 76, 68, 0, 3, 76, 68, 10,
- 3, 76, 69, 0, 3, 76, 69, 10,
- 3, 76, 70, 0, 3, 76, 70, 10,
- 3, 76, 71, 12, 3, 76, 72, 12,
- 3, 76, 73, 12, 4, 0, 3, 2,
- 80, 4, 0, 7, 6, 81, 4, 0,
- 12, 2, 80, 4, 1, 0, 10, 3,
- 4, 3, 12, 2, 80, 4, 3, 71,
- 2, 80, 4, 3, 72, 2, 80, 4,
- 3, 73, 2, 80, 4, 38, 10, 0,
- 3, 4, 39, 10, 0, 3, 4, 40,
- 10, 0, 3, 4, 41, 10, 0, 3,
- 4, 42, 10, 0, 3, 4, 43, 10,
- 0, 3, 4, 44, 10, 0, 3, 4,
- 45, 10, 0, 3, 4, 46, 10, 0,
- 3, 4, 47, 10, 0, 3, 4, 48,
- 10, 0, 3, 4, 49, 10, 0, 3,
- 4, 50, 10, 0, 3, 4, 51, 10,
- 0, 3, 4, 52, 10, 0, 3, 4,
- 53, 10, 0, 3, 4, 54, 10, 0,
- 3, 4, 55, 10, 0, 3, 4, 56,
- 10, 0, 3, 4, 57, 10, 0, 3,
- 4, 58, 10, 0, 3, 4, 59, 10,
- 0, 3, 4, 60, 10, 0, 3, 4,
- 61, 10, 0, 3, 4, 62, 10, 0,
- 3, 4, 63, 10, 0, 3, 4, 64,
- 10, 0, 3, 4, 65, 10, 0, 3,
- 4, 66, 10, 0, 3, 4, 67, 10,
- 0, 3, 4, 68, 10, 0, 3, 4,
- 69, 10, 0, 3, 4, 70, 10, 0,
- 3, 4, 71, 12, 2, 80, 4, 72,
- 12, 2, 80, 4, 73, 12, 2, 80,
- 4, 76, 1, 0, 10, 4, 76, 38,
- 10, 0, 4, 76, 39, 10, 0, 4,
- 76, 40, 10, 0, 4, 76, 41, 10,
- 0, 4, 76, 42, 10, 0, 4, 76,
- 43, 10, 0, 4, 76, 44, 10, 0,
- 4, 76, 45, 10, 0, 4, 76, 46,
- 10, 0, 4, 76, 47, 10, 0, 4,
- 76, 48, 10, 0, 4, 76, 49, 10,
- 0, 4, 76, 50, 10, 0, 4, 76,
- 51, 10, 0, 4, 76, 52, 10, 0,
- 4, 76, 53, 10, 0, 4, 76, 54,
- 10, 0, 4, 76, 55, 10, 0, 4,
- 76, 56, 10, 0, 4, 76, 57, 10,
- 0, 4, 76, 58, 10, 0, 4, 76,
- 59, 10, 0, 4, 76, 60, 10, 0,
- 4, 76, 61, 10, 0, 4, 76, 62,
- 10, 0, 4, 76, 63, 10, 0, 4,
- 76, 64, 10, 0, 4, 76, 65, 10,
- 0, 4, 76, 66, 10, 0, 4, 76,
- 67, 10, 0, 4, 76, 68, 10, 0,
- 4, 76, 69, 10, 0, 4, 76, 70,
- 10, 0, 5, 3, 0, 12, 2, 80,
- 5, 3, 71, 12, 2, 80, 5, 3,
- 72, 12, 2, 80, 5, 3, 73, 12,
- 2, 80, 5, 10, 0, 3, 2, 80,
- 5, 38, 0, 3, 2, 80, 5, 39,
- 0, 3, 2, 80, 5, 40, 0, 3,
- 2, 80, 5, 41, 0, 3, 2, 80,
- 5, 42, 0, 3, 2, 80, 5, 43,
- 0, 3, 2, 80, 5, 44, 0, 3,
- 2, 80, 5, 45, 0, 3, 2, 80,
- 5, 46, 0, 3, 2, 80, 5, 47,
- 0, 3, 2, 80, 5, 48, 0, 3,
- 2, 80, 5, 49, 0, 3, 2, 80,
- 5, 50, 0, 3, 2, 80, 5, 51,
- 0, 3, 2, 80, 5, 52, 0, 3,
- 2, 80, 5, 53, 0, 3, 2, 80,
- 5, 54, 0, 3, 2, 80, 5, 55,
- 0, 3, 2, 80, 5, 56, 0, 3,
- 2, 80, 5, 57, 0, 3, 2, 80,
- 5, 58, 0, 3, 2, 80, 5, 59,
- 0, 3, 2, 80, 5, 60, 0, 3,
- 2, 80, 5, 61, 0, 3, 2, 80,
- 5, 62, 0, 3, 2, 80, 5, 63,
- 0, 3, 2, 80, 5, 64, 0, 3,
- 2, 80, 5, 65, 0, 3, 2, 80,
- 5, 66, 0, 3, 2, 80, 5, 67,
- 0, 3, 2, 80, 5, 68, 0, 3,
- 2, 80, 5, 69, 0, 3, 2, 80,
- 5, 70, 0, 3, 2, 80, 6, 1,
- 0, 10, 3, 2, 80, 6, 38, 10,
- 0, 3, 2, 80, 6, 39, 10, 0,
- 3, 2, 80, 6, 40, 10, 0, 3,
- 2, 80, 6, 41, 10, 0, 3, 2,
- 80, 6, 42, 10, 0, 3, 2, 80,
- 6, 43, 10, 0, 3, 2, 80, 6,
- 44, 10, 0, 3, 2, 80, 6, 45,
- 10, 0, 3, 2, 80, 6, 46, 10,
- 0, 3, 2, 80, 6, 47, 10, 0,
- 3, 2, 80, 6, 48, 10, 0, 3,
- 2, 80, 6, 49, 10, 0, 3, 2,
- 80, 6, 50, 10, 0, 3, 2, 80,
- 6, 51, 10, 0, 3, 2, 80, 6,
- 52, 10, 0, 3, 2, 80, 6, 53,
- 10, 0, 3, 2, 80, 6, 54, 10,
- 0, 3, 2, 80, 6, 55, 10, 0,
- 3, 2, 80, 6, 56, 10, 0, 3,
- 2, 80, 6, 57, 10, 0, 3, 2,
- 80, 6, 58, 10, 0, 3, 2, 80,
- 6, 59, 10, 0, 3, 2, 80, 6,
- 60, 10, 0, 3, 2, 80, 6, 61,
- 10, 0, 3, 2, 80, 6, 62, 10,
- 0, 3, 2, 80, 6, 63, 10, 0,
- 3, 2, 80, 6, 64, 10, 0, 3,
- 2, 80, 6, 65, 10, 0, 3, 2,
- 80, 6, 66, 10, 0, 3, 2, 80,
- 6, 67, 10, 0, 3, 2, 80, 6,
- 68, 10, 0, 3, 2, 80, 6, 69,
- 10, 0, 3, 2, 80, 6, 70, 10,
- 0, 3, 2, 80
-};
+ static const short _demo_machine_parser_cmd_cond_offsets[] = {
+ 0, 0, 0, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 3, 4, 5, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 7, 8, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 10, 11,
+ 12, 13, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 128, 129, 130,
+ 131, 132, 133, 134, 135, 136, 137, 138,
+ 139, 140, 141, 142, 143, 144, 145, 146,
+ 147, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 159, 160, 161, 162,
+ 163, 164, 165, 166, 167, 168, 169, 170,
+ 171, 172, 173, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 183, 184, 185, 186,
+ 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202,
+ 203, 204, 205, 206, 207, 208, 209, 210,
+ 211, 212, 213, 214, 215, 216, 217, 218,
+ 219, 220, 221, 222, 223, 224, 225, 226,
+ 227, 228, 229, 230, 231, 232, 233, 234,
+ 235, 236, 237, 238, 239, 240, 241, 242,
+ 243, 244, 245, 246, 247, 248, 249, 250,
+ 251, 252, 253, 254, 255, 256, 257, 258,
+ 259, 260, 261, 262, 263, 264, 265, 266,
+ 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282,
+ 283, 284, 285, 286, 287, 288, 289, 290,
+ 291, 292, 293, 294, 295, 296, 297, 298,
+ 299, 300, 301, 302, 303, 304, 305, 306,
+ 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322,
+ 323, 324, 325, 326, 327, 328, 329, 330,
+ 331, 332, 333, 334, 335, 336, 337, 338,
+ 339, 340, 341, 342, 343, 344, 345, 346,
+ 347, 348, 349, 350, 351, 352, 353, 354,
+ 355
+ };
-static const short _demo_machine_parser_cmd_cond_offsets[] = {
- 0, 0, 0, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 3, 4, 5, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 7, 8, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 10, 11,
- 12, 13, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90,
- 91, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122,
- 123, 124, 125, 126, 127, 128, 129, 130,
- 131, 132, 133, 134, 135, 136, 137, 138,
- 139, 140, 141, 142, 143, 144, 145, 146,
- 147, 148, 149, 150, 151, 152, 153, 154,
- 155, 156, 157, 158, 159, 160, 161, 162,
- 163, 164, 165, 166, 167, 168, 169, 170,
- 171, 172, 173, 174, 175, 176, 177, 178,
- 179, 180, 181, 182, 183, 184, 185, 186,
- 187, 188, 189, 190, 191, 192, 193, 194,
- 195, 196, 197, 198, 199, 200, 201, 202,
- 203, 204, 205, 206, 207, 208, 209, 210,
- 211, 212, 213, 214, 215, 216, 217, 218,
- 219, 220, 221, 222, 223, 224, 225, 226,
- 227, 228, 229, 230, 231, 232, 233, 234,
- 235, 236, 237, 238, 239, 240, 241, 242,
- 243, 244, 245, 246, 247, 248, 249, 250,
- 251, 252, 253, 254, 255, 256, 257, 258,
- 259, 260, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282,
- 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298,
- 299, 300, 301, 302, 303, 304, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, 317, 318, 319, 320, 321, 322,
- 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 333, 334, 335, 336, 337, 338,
- 339, 340, 341, 342, 343, 344, 345, 346,
- 347, 348, 349, 350, 351, 352, 353, 354,
- 355
-};
+ static const char _demo_machine_parser_cmd_cond_lengths[] = {
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1
+ };
-static const char _demo_machine_parser_cmd_cond_lengths[] = {
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-};
+ static const short _demo_machine_parser_cmd_cond_keys[] = {
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ -128, 127, -128, 127, -128, 127, -128, 127,
+ 0
+ };
-static const short _demo_machine_parser_cmd_cond_keys[] = {
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- -128, 127, -128, 127, -128, 127, -128, 127,
- 0
-};
+ static const char _demo_machine_parser_cmd_cond_spaces[] = {
+ 1, 1, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0
+ };
-static const char _demo_machine_parser_cmd_cond_spaces[] = {
- 1, 1, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0
-};
+ static const short _demo_machine_parser_cmd_key_offsets[] = {
+ 0, 0, 1, 13, 23, 24, 28, 30,
+ 32, 34, 36, 37, 39, 43, 45, 47,
+ 49, 51, 53, 55, 57, 59, 61, 63,
+ 67, 69, 71, 73, 74, 76, 78, 80,
+ 82, 84, 86, 88, 90, 92, 94, 96,
+ 98, 100, 102, 104, 106, 108, 110, 112,
+ 114, 116, 118, 122, 124, 126, 128, 130,
+ 142, 144, 146, 148, 150, 152, 154, 156,
+ 158, 160, 162, 164, 166, 168, 170, 172,
+ 174, 176, 178, 180, 182, 184, 186, 188,
+ 190, 192, 194, 196, 198, 200, 202, 204,
+ 206, 208, 210, 212, 214, 216, 218, 222,
+ 224, 226, 228, 230, 232, 234, 236, 237,
+ 238, 240, 242, 244, 246, 248, 250, 252,
+ 254, 256, 262, 264, 266, 268, 270, 272,
+ 274, 276, 278, 280, 282, 284, 286, 290,
+ 292, 294, 296, 298, 302, 304, 306, 308,
+ 310, 312, 314, 316, 318, 320, 322, 324,
+ 328, 330, 334, 336, 338, 340, 342, 343,
+ 347, 349, 351, 353, 355, 361, 367, 369,
+ 371, 373, 375, 377, 379, 381, 383, 385,
+ 393, 395, 397, 399, 405, 407, 409, 411,
+ 413, 414, 416, 418, 420, 422, 424, 426,
+ 428, 430, 432, 433, 439, 441, 445, 447,
+ 449, 451, 453, 455, 457, 459, 461, 463,
+ 465, 467, 469, 470, 476, 478, 480, 482,
+ 484, 486, 488, 490, 492, 494, 496, 498,
+ 500, 501, 503, 505, 507, 509, 511, 515,
+ 517, 519, 520, 522, 524, 526, 528, 530,
+ 531, 536, 538, 540, 550, 552, 581, 581,
+ 610, 640, 644, 646, 648, 650, 652, 653,
+ 655, 659, 661, 663, 665, 667, 669, 697,
+ 729, 759, 761, 789, 819, 849, 851, 853,
+ 855, 857, 885, 889, 891, 893, 895, 896,
+ 898, 900, 902, 904, 906, 908, 910, 938,
+ 966, 968, 970, 972, 974, 976, 1004, 1006,
+ 1008, 1038, 1040, 1042, 1044, 1072, 1074, 1076,
+ 1104, 1106, 1108, 1110, 1138, 1168, 1198, 1202,
+ 1232, 1234, 1236, 1238, 1240, 1268, 1280, 1282,
+ 1284, 1286, 1288, 1290, 1292, 1320, 1350, 1352,
+ 1354, 1356, 1384, 1386, 1388, 1390, 1418, 1420,
+ 1448, 1450, 1452, 1480, 1482, 1510, 1512, 1514,
+ 1516, 1518, 1520, 1548, 1578, 1580, 1582, 1610,
+ 1612, 1640, 1642, 1644, 1672, 1674, 1676, 1704,
+ 1732, 1734, 1762, 1764, 1766, 1794, 1796, 1798,
+ 1826, 1828, 1830, 1858, 1860, 1862, 1864, 1892,
+ 1896, 1898, 1900, 1902, 1930, 1932, 1934, 1936,
+ 1938, 1966, 1996, 2024, 2056, 2086, 2114, 2144,
+ 2174, 2202, 2230, 2258, 2286, 2316, 2344, 2372,
+ 2400, 2430, 2460, 2490, 2518, 2546, 2576, 2604,
+ 2632, 2660, 2688, 2716, 2744, 2774, 2802, 2830,
+ 2858, 2886, 2914, 2942, 2970, 2998, 3026, 3054,
+ 3082, 3110, 3176, 3184, 3190, 3200, 3203, 3206,
+ 3216, 3227, 3232, 3237, 3242, 3247, 3256, 3267,
+ 3272, 3277, 3282, 3287, 3292, 3301, 3306, 3311,
+ 3316, 3321, 3326, 3335, 3344, 3349, 3354, 3363,
+ 3374, 3383, 3394, 3403, 3412, 3421, 3425, 3429,
+ 3457, 3473, 3477, 3489, 3505, 3533, 3565, 3585,
+ 3605, 3625, 3645, 3673, 3705, 3725, 3745, 3765,
+ 3785, 3805, 3833, 3853, 3873, 3893, 3913, 3933,
+ 3961, 3989, 4009, 4029, 4057, 4085, 4093, 4101,
+ 4109, 4117, 4141, 4169, 4177, 4185, 4193, 4201,
+ 4209, 4225, 4233, 4241, 4249, 4257, 4265, 4289,
+ 4313, 4321, 4329, 4353, 4417, 4427, 4437, 4473,
+ 4483, 4493, 4503, 4539, 4551, 4561, 4571, 4581,
+ 4591, 4627, 4639, 4649, 4659, 4669, 4705, 4715,
+ 4725, 4735, 4771, 4781, 4791, 4801, 4811, 4821,
+ 4857, 4869, 4879, 4891, 4927, 4937, 4947, 4957,
+ 4967, 4976, 4988, 4998, 5034, 5044, 5054, 5064,
+ 5100, 5114, 5128, 5138, 5148, 5158, 5168, 5178,
+ 5214, 5224, 5234, 5244, 5254, 5290, 5306, 5316,
+ 5352, 5362, 5398, 5408, 5444, 5458, 5494, 5504,
+ 5514, 5524, 5534, 5543, 5553, 5563, 5599, 5609,
+ 5619, 5629, 5665, 5675, 5685, 5721, 5731, 5741,
+ 5750, 5764, 5774, 5810, 5822, 5832, 5842, 5878,
+ 5888, 5924, 5934, 5944, 5980, 5990, 6026, 6064,
+ 6074, 6084, 6094, 6130, 6140, 6150, 6160, 6169,
+ 6183, 6193, 6229, 6239, 6249, 6259, 6295, 6305,
+ 6315, 6325, 6335, 6371, 6381, 6391, 6401, 6437,
+ 6473, 6483, 6492, 6528, 6538, 6548, 6558, 6568,
+ 6578, 6614, 6626, 6636, 6646, 6682, 6691, 6701,
+ 6711, 6721, 6731, 6741, 6777, 6843, 6877, 6911,
+ 6945, 6979, 7013, 7047, 7081, 7115, 7149, 7183,
+ 7217, 7251, 7285, 7319, 7353, 7387, 7421, 7455,
+ 7489, 7523, 7557, 7591, 7625, 7661, 7695, 7729,
+ 7763, 7797, 7831, 7865, 7899, 7933, 7967, 8001,
+ 8009, 8017, 8025, 8033, 8041, 8053, 8061, 8069,
+ 8077, 8085, 8097, 8105, 8113, 8119, 8127, 8135,
+ 8143, 8151, 8159, 8171, 8179, 8187, 8195, 8203,
+ 8211, 8219, 8227, 8235, 8243, 8251, 8259, 8267,
+ 8275, 8283, 8291, 8299, 8311, 8319, 8331, 8339,
+ 8345, 8353, 8361, 8369, 8377, 8383, 8395, 8403,
+ 8411, 8419, 8427, 8435, 8443, 8451, 8467, 8483,
+ 8491, 8499, 8507, 8515, 8523, 8531, 8567, 8575,
+ 8583, 8591, 8599, 8607, 8615, 8621, 8637, 8645,
+ 8653, 8661, 8669, 8677, 8685, 8693, 8701, 8709,
+ 8717, 8725, 8733, 8753, 8761, 8777, 8785, 8793,
+ 8801, 8809, 8815, 8823, 8831, 8839, 8847, 8855,
+ 8863, 8871, 8879, 8887, 8893, 8909, 8917, 8929,
+ 8937, 8945, 8953, 8961, 8969, 8977, 8985, 8993,
+ 8997
+ };
-static const short _demo_machine_parser_cmd_key_offsets[] = {
- 0, 0, 1, 13, 23, 24, 28, 30,
- 32, 34, 36, 37, 39, 43, 45, 47,
- 49, 51, 53, 55, 57, 59, 61, 63,
- 67, 69, 71, 73, 74, 76, 78, 80,
- 82, 84, 86, 88, 90, 92, 94, 96,
- 98, 100, 102, 104, 106, 108, 110, 112,
- 114, 116, 118, 122, 124, 126, 128, 130,
- 142, 144, 146, 148, 150, 152, 154, 156,
- 158, 160, 162, 164, 166, 168, 170, 172,
- 174, 176, 178, 180, 182, 184, 186, 188,
- 190, 192, 194, 196, 198, 200, 202, 204,
- 206, 208, 210, 212, 214, 216, 218, 222,
- 224, 226, 228, 230, 232, 234, 236, 237,
- 238, 240, 242, 244, 246, 248, 250, 252,
- 254, 256, 262, 264, 266, 268, 270, 272,
- 274, 276, 278, 280, 282, 284, 286, 290,
- 292, 294, 296, 298, 302, 304, 306, 308,
- 310, 312, 314, 316, 318, 320, 322, 324,
- 328, 330, 334, 336, 338, 340, 342, 343,
- 347, 349, 351, 353, 355, 361, 367, 369,
- 371, 373, 375, 377, 379, 381, 383, 385,
- 393, 395, 397, 399, 405, 407, 409, 411,
- 413, 414, 416, 418, 420, 422, 424, 426,
- 428, 430, 432, 433, 439, 441, 445, 447,
- 449, 451, 453, 455, 457, 459, 461, 463,
- 465, 467, 469, 470, 476, 478, 480, 482,
- 484, 486, 488, 490, 492, 494, 496, 498,
- 500, 501, 503, 505, 507, 509, 511, 515,
- 517, 519, 520, 522, 524, 526, 528, 530,
- 531, 536, 538, 540, 550, 552, 581, 581,
- 610, 640, 644, 646, 648, 650, 652, 653,
- 655, 659, 661, 663, 665, 667, 669, 697,
- 729, 759, 761, 789, 819, 849, 851, 853,
- 855, 857, 885, 889, 891, 893, 895, 896,
- 898, 900, 902, 904, 906, 908, 910, 938,
- 966, 968, 970, 972, 974, 976, 1004, 1006,
- 1008, 1038, 1040, 1042, 1044, 1072, 1074, 1076,
- 1104, 1106, 1108, 1110, 1138, 1168, 1198, 1202,
- 1232, 1234, 1236, 1238, 1240, 1268, 1280, 1282,
- 1284, 1286, 1288, 1290, 1292, 1320, 1350, 1352,
- 1354, 1356, 1384, 1386, 1388, 1390, 1418, 1420,
- 1448, 1450, 1452, 1480, 1482, 1510, 1512, 1514,
- 1516, 1518, 1520, 1548, 1578, 1580, 1582, 1610,
- 1612, 1640, 1642, 1644, 1672, 1674, 1676, 1704,
- 1732, 1734, 1762, 1764, 1766, 1794, 1796, 1798,
- 1826, 1828, 1830, 1858, 1860, 1862, 1864, 1892,
- 1896, 1898, 1900, 1902, 1930, 1932, 1934, 1936,
- 1938, 1966, 1996, 2024, 2056, 2086, 2114, 2144,
- 2174, 2202, 2230, 2258, 2286, 2316, 2344, 2372,
- 2400, 2430, 2460, 2490, 2518, 2546, 2576, 2604,
- 2632, 2660, 2688, 2716, 2744, 2774, 2802, 2830,
- 2858, 2886, 2914, 2942, 2970, 2998, 3026, 3054,
- 3082, 3110, 3176, 3184, 3190, 3200, 3203, 3206,
- 3216, 3227, 3232, 3237, 3242, 3247, 3256, 3267,
- 3272, 3277, 3282, 3287, 3292, 3301, 3306, 3311,
- 3316, 3321, 3326, 3335, 3344, 3349, 3354, 3363,
- 3374, 3383, 3394, 3403, 3412, 3421, 3425, 3429,
- 3457, 3473, 3477, 3489, 3505, 3533, 3565, 3585,
- 3605, 3625, 3645, 3673, 3705, 3725, 3745, 3765,
- 3785, 3805, 3833, 3853, 3873, 3893, 3913, 3933,
- 3961, 3989, 4009, 4029, 4057, 4085, 4093, 4101,
- 4109, 4117, 4141, 4169, 4177, 4185, 4193, 4201,
- 4209, 4225, 4233, 4241, 4249, 4257, 4265, 4289,
- 4313, 4321, 4329, 4353, 4417, 4427, 4437, 4473,
- 4483, 4493, 4503, 4539, 4551, 4561, 4571, 4581,
- 4591, 4627, 4639, 4649, 4659, 4669, 4705, 4715,
- 4725, 4735, 4771, 4781, 4791, 4801, 4811, 4821,
- 4857, 4869, 4879, 4891, 4927, 4937, 4947, 4957,
- 4967, 4976, 4988, 4998, 5034, 5044, 5054, 5064,
- 5100, 5114, 5128, 5138, 5148, 5158, 5168, 5178,
- 5214, 5224, 5234, 5244, 5254, 5290, 5306, 5316,
- 5352, 5362, 5398, 5408, 5444, 5458, 5494, 5504,
- 5514, 5524, 5534, 5543, 5553, 5563, 5599, 5609,
- 5619, 5629, 5665, 5675, 5685, 5721, 5731, 5741,
- 5750, 5764, 5774, 5810, 5822, 5832, 5842, 5878,
- 5888, 5924, 5934, 5944, 5980, 5990, 6026, 6064,
- 6074, 6084, 6094, 6130, 6140, 6150, 6160, 6169,
- 6183, 6193, 6229, 6239, 6249, 6259, 6295, 6305,
- 6315, 6325, 6335, 6371, 6381, 6391, 6401, 6437,
- 6473, 6483, 6492, 6528, 6538, 6548, 6558, 6568,
- 6578, 6614, 6626, 6636, 6646, 6682, 6691, 6701,
- 6711, 6721, 6731, 6741, 6777, 6843, 6877, 6911,
- 6945, 6979, 7013, 7047, 7081, 7115, 7149, 7183,
- 7217, 7251, 7285, 7319, 7353, 7387, 7421, 7455,
- 7489, 7523, 7557, 7591, 7625, 7661, 7695, 7729,
- 7763, 7797, 7831, 7865, 7899, 7933, 7967, 8001,
- 8009, 8017, 8025, 8033, 8041, 8053, 8061, 8069,
- 8077, 8085, 8097, 8105, 8113, 8119, 8127, 8135,
- 8143, 8151, 8159, 8171, 8179, 8187, 8195, 8203,
- 8211, 8219, 8227, 8235, 8243, 8251, 8259, 8267,
- 8275, 8283, 8291, 8299, 8311, 8319, 8331, 8339,
- 8345, 8353, 8361, 8369, 8377, 8383, 8395, 8403,
- 8411, 8419, 8427, 8435, 8443, 8451, 8467, 8483,
- 8491, 8499, 8507, 8515, 8523, 8531, 8567, 8575,
- 8583, 8591, 8599, 8607, 8615, 8621, 8637, 8645,
- 8653, 8661, 8669, 8677, 8685, 8693, 8701, 8709,
- 8717, 8725, 8733, 8753, 8761, 8777, 8785, 8793,
- 8801, 8809, 8815, 8823, 8831, 8839, 8847, 8855,
- 8863, 8871, 8879, 8887, 8893, 8909, 8917, 8929,
- 8937, 8945, 8953, 8961, 8969, 8977, 8985, 8993,
- 8997
-};
+ static const short _demo_machine_parser_cmd_trans_keys[] = {
+ 37, 800, 805, 1056, 1061, 777, 781, 896,
+ 1032, 1033, 1037, 1038, 1151, 800, 1056, 777,
+ 781, 896, 1032, 1033, 1037, 1038, 1151, 43,
+ 79, 83, 111, 115, 78, 110, 70, 102,
+ 73, 105, 71, 103, 45, 83, 115, 69,
+ 84, 101, 116, 83, 115, 83, 115, 73,
+ 105, 79, 111, 78, 110, 84, 116, 78,
+ 110, 71, 103, 85, 117, 80, 112, 65,
+ 77, 97, 109, 82, 114, 71, 103, 69,
+ 101, 45, 77, 109, 69, 101, 83, 115,
+ 83, 115, 65, 97, 71, 103, 69, 101,
+ 83, 115, 83, 115, 65, 97, 71, 103,
+ 69, 101, 80, 112, 84, 116, 79, 111,
+ 78, 110, 83, 115, 85, 117, 66, 98,
+ 73, 105, 83, 115, 72, 104, 71, 83,
+ 103, 115, 83, 115, 84, 116, 69, 101,
+ 82, 114, 67, 76, 77, 78, 84, 85,
+ 99, 108, 109, 110, 116, 117, 69, 101,
+ 78, 110, 65, 97, 82, 114, 73, 105,
+ 79, 111, 68, 100, 69, 101, 79, 111,
+ 69, 101, 69, 101, 80, 112, 83, 115,
+ 79, 111, 80, 112, 66, 98, 67, 99,
+ 82, 114, 73, 105, 66, 98, 69, 101,
+ 77, 109, 69, 101, 78, 110, 73, 105,
+ 84, 116, 76, 108, 80, 112, 68, 100,
+ 76, 108, 69, 101, 77, 109, 70, 102,
+ 77, 109, 80, 112, 65, 97, 67, 99,
+ 75, 107, 83, 84, 115, 116, 68, 100,
+ 73, 105, 79, 111, 73, 105, 68, 100,
+ 69, 101, 79, 111, 45, 64, 84, 116,
+ 73, 105, 79, 111, 78, 110, 81, 113,
+ 85, 117, 69, 101, 83, 115, 84, 116,
+ 69, 83, 84, 101, 115, 116, 83, 115,
+ 83, 115, 73, 105, 79, 111, 78, 110,
+ 67, 99, 75, 107, 77, 109, 70, 102,
+ 65, 97, 80, 112, 83, 115, 72, 78,
+ 104, 110, 67, 99, 80, 112, 86, 118,
+ 52, 54, 86, 88, 118, 120, 69, 101,
+ 78, 110, 84, 116, 82, 114, 79, 111,
+ 77, 109, 69, 101, 65, 97, 68, 100,
+ 69, 101, 82, 114, 77, 80, 109, 112,
+ 80, 112, 73, 85, 105, 117, 79, 111,
+ 67, 99, 65, 97, 76, 108, 45, 73,
+ 80, 105, 112, 80, 112, 80, 112, 73,
+ 105, 68, 100, 65, 67, 87, 97, 99,
+ 119, 83, 84, 89, 115, 116, 121, 83,
+ 115, 87, 119, 79, 111, 82, 114, 68,
+ 100, 69, 101, 65, 97, 76, 108, 77,
+ 109, 69, 73, 77, 84, 101, 105, 109,
+ 116, 67, 99, 79, 111, 80, 112, 68,
+ 71, 76, 100, 103, 108, 67, 99, 79,
+ 111, 77, 109, 80, 112, 45, 73, 105,
+ 68, 100, 69, 101, 78, 110, 84, 116,
+ 83, 115, 67, 99, 85, 117, 78, 110,
+ 45, 73, 80, 85, 105, 112, 117, 80,
+ 112, 79, 87, 111, 119, 82, 114, 84,
+ 116, 68, 100, 83, 115, 82, 114, 72,
+ 104, 79, 111, 65, 97, 68, 100, 83,
+ 115, 67, 99, 70, 102, 45, 73, 80,
+ 84, 105, 112, 116, 80, 112, 79, 111,
+ 82, 114, 84, 116, 82, 114, 65, 97,
+ 78, 110, 83, 115, 79, 111, 82, 114,
+ 84, 116, 86, 118, 54, 80, 112, 73,
+ 105, 82, 114, 69, 101, 83, 115, 65,
+ 83, 97, 115, 77, 109, 69, 101, 45,
+ 78, 110, 65, 97, 80, 112, 84, 116,
+ 82, 114, 62, 35, 37, 43, 45, 62,
+ 896, 1151, 896, 1151, 288, 544, 265, 269,
+ 384, 520, 521, 525, 526, 639, 384, 639,
+ 43, 65, 67, 68, 69, 70, 72, 76,
+ 77, 79, 80, 81, 82, 83, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 118, 43, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 85,
+ 86, 97, 99, 100, 101, 102, 104, 108,
+ 109, 111, 112, 113, 114, 115, 117, 118,
+ 79, 83, 111, 115, 78, 110, 70, 102,
+ 73, 105, 71, 103, 45, 83, 115, 69,
+ 84, 101, 116, 83, 115, 83, 115, 73,
+ 105, 79, 111, 78, 110, 65, 67, 68,
+ 69, 70, 72, 76, 77, 79, 80, 81,
+ 82, 83, 86, 97, 99, 100, 101, 102,
+ 104, 108, 109, 111, 112, 113, 114, 115,
+ 118, 65, 67, 68, 69, 70, 72, 76,
+ 77, 79, 80, 81, 82, 83, 84, 85,
+ 86, 97, 99, 100, 101, 102, 104, 108,
+ 109, 111, 112, 113, 114, 115, 116, 117,
+ 118, 65, 67, 68, 69, 70, 72, 76,
+ 77, 79, 80, 81, 82, 83, 86, 88,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 120, 84,
+ 116, 65, 67, 68, 69, 70, 72, 76,
+ 77, 79, 80, 81, 82, 83, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 118, 65, 67, 68,
+ 69, 70, 72, 73, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 105, 108, 109, 111, 112, 113,
+ 114, 115, 118, 65, 67, 68, 69, 70,
+ 72, 76, 77, 79, 80, 81, 82, 83,
+ 85, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 117,
+ 118, 78, 110, 71, 103, 85, 117, 80,
+ 112, 65, 67, 68, 69, 70, 72, 76,
+ 77, 79, 80, 81, 82, 83, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 118, 65, 77, 97,
+ 109, 82, 114, 71, 103, 69, 101, 45,
+ 77, 109, 69, 101, 83, 115, 83, 115,
+ 65, 97, 71, 103, 69, 101, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 83, 115,
+ 83, 115, 65, 97, 71, 103, 69, 101,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 80, 112, 84, 116,
+ 65, 67, 68, 69, 70, 72, 73, 76,
+ 77, 79, 80, 81, 82, 83, 86, 97,
+ 99, 100, 101, 102, 104, 105, 108, 109,
+ 111, 112, 113, 114, 115, 118, 79, 111,
+ 78, 110, 83, 115, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 85, 117, 66, 98, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 73, 105, 83, 115, 72, 104, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 85,
+ 86, 97, 99, 100, 101, 102, 104, 108,
+ 109, 111, 112, 113, 114, 115, 117, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 85, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 117, 118, 71, 83,
+ 103, 115, 65, 67, 68, 69, 70, 72,
+ 73, 76, 77, 79, 80, 81, 82, 83,
+ 86, 97, 99, 100, 101, 102, 104, 105,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 83, 115, 84, 116, 69, 101, 82, 114,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 67, 76, 77, 78,
+ 84, 85, 99, 108, 109, 110, 116, 117,
+ 69, 101, 78, 110, 65, 97, 82, 114,
+ 73, 105, 79, 111, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 73, 76,
+ 77, 79, 80, 81, 82, 83, 86, 97,
+ 99, 100, 101, 102, 104, 105, 108, 109,
+ 111, 112, 113, 114, 115, 118, 68, 100,
+ 69, 101, 79, 111, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 69, 101, 69, 101, 80, 112, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 83, 115, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 79, 111, 80, 112, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 66, 98, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 67, 99,
+ 82, 114, 73, 105, 66, 98, 69, 101,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 85, 86, 97, 99, 100, 101, 102,
+ 104, 108, 109, 111, 112, 113, 114, 115,
+ 117, 118, 77, 109, 69, 101, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 78, 110, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 73, 105, 84, 116, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 76, 108, 80, 112, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 68, 100, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 76, 108, 69, 101, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 77, 109, 70, 102, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 77, 109, 80, 112, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 97, 67, 99, 75, 107,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 83, 84, 115, 116,
+ 68, 100, 73, 105, 79, 111, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 73, 105, 68, 100, 69, 101,
+ 79, 111, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 85, 86, 97, 99, 100,
+ 101, 102, 104, 108, 109, 111, 112, 113,
+ 114, 115, 117, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 84, 85, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 116, 117, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 88, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 118, 120, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 73, 76, 77, 79, 80, 81, 82, 83,
+ 86, 97, 99, 100, 101, 102, 104, 105,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 85, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 117, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 73, 76, 77, 79,
+ 80, 81, 82, 83, 86, 97, 99, 100,
+ 101, 102, 104, 105, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 85, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 117, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 85, 86, 97, 99, 100,
+ 101, 102, 104, 108, 109, 111, 112, 113,
+ 114, 115, 117, 118, 65, 67, 68, 69,
+ 70, 72, 73, 76, 77, 79, 80, 81,
+ 82, 83, 86, 97, 99, 100, 101, 102,
+ 104, 105, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 73, 76, 77, 79, 80, 81, 82, 83,
+ 86, 97, 99, 100, 101, 102, 104, 105,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 86, 97, 99,
+ 100, 101, 102, 104, 108, 109, 111, 112,
+ 113, 114, 115, 118, 65, 67, 68, 69,
+ 70, 72, 76, 77, 79, 80, 81, 82,
+ 83, 86, 97, 99, 100, 101, 102, 104,
+ 108, 109, 111, 112, 113, 114, 115, 118,
+ 65, 67, 68, 69, 70, 72, 76, 77,
+ 79, 80, 81, 82, 83, 85, 86, 97,
+ 99, 100, 101, 102, 104, 108, 109, 111,
+ 112, 113, 114, 115, 117, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 65, 67,
+ 68, 69, 70, 72, 76, 77, 79, 80,
+ 81, 82, 83, 86, 97, 99, 100, 101,
+ 102, 104, 108, 109, 111, 112, 113, 114,
+ 115, 118, 65, 67, 68, 69, 70, 72,
+ 76, 77, 79, 80, 81, 82, 83, 86,
+ 97, 99, 100, 101, 102, 104, 108, 109,
+ 111, 112, 113, 114, 115, 118, 288, 301,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 557, 576,
+ 577, 579, 580, 581, 582, 584, 585, 588,
+ 591, 592, 594, 595, 596, 600, 609, 611,
+ 612, 613, 614, 616, 617, 620, 623, 624,
+ 626, 627, 628, 632, 128, 383, 384, 639,
+ 288, 320, 544, 576, 128, 383, 384, 639,
+ 288, 320, 544, 576, 384, 639, 32, 64,
+ 65, 82, 83, 97, 114, 115, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 64,
+ 65, 82, 83, 97, 114, 115, 9, 13,
+ 32, 65, 67, 82, 83, 97, 99, 114,
+ 115, 9, 13, 32, 84, 116, 9, 13,
+ 32, 73, 105, 9, 13, 32, 79, 111,
+ 9, 13, 32, 78, 110, 9, 13, 32,
+ 65, 82, 83, 97, 114, 115, 9, 13,
+ 32, 65, 69, 82, 83, 97, 101, 114,
+ 115, 9, 13, 32, 81, 113, 9, 13,
+ 32, 85, 117, 9, 13, 32, 69, 101,
+ 9, 13, 32, 83, 115, 9, 13, 32,
+ 84, 116, 9, 13, 32, 69, 83, 84,
+ 101, 115, 116, 9, 13, 32, 83, 115,
+ 9, 13, 32, 83, 115, 9, 13, 32,
+ 73, 105, 9, 13, 32, 79, 111, 9,
+ 13, 32, 78, 110, 9, 13, 32, 65,
+ 82, 83, 97, 114, 115, 9, 13, 32,
+ 65, 82, 83, 97, 114, 115, 9, 13,
+ 32, 67, 99, 9, 13, 32, 75, 107,
+ 9, 13, 32, 65, 82, 83, 97, 114,
+ 115, 9, 13, 32, 65, 67, 82, 83,
+ 97, 99, 114, 115, 9, 13, 32, 65,
+ 82, 83, 97, 114, 115, 9, 13, 32,
+ 65, 69, 82, 83, 97, 101, 114, 115,
+ 9, 13, 32, 65, 82, 83, 97, 114,
+ 115, 9, 13, 32, 65, 82, 83, 97,
+ 114, 115, 9, 13, 32, 65, 82, 83,
+ 97, 114, 115, 9, 13, 320, 576, 384,
+ 639, 320, 576, 384, 639, 288, 320, 321,
+ 338, 339, 353, 370, 371, 544, 576, 577,
+ 594, 595, 609, 626, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 544, 576, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 32, 64, 9, 13, 288, 320, 544,
+ 576, 265, 269, 384, 520, 521, 525, 526,
+ 639, 288, 320, 544, 576, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 321, 338, 339, 353, 370,
+ 371, 544, 576, 577, 594, 595, 609, 626,
+ 627, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 321,
+ 323, 338, 339, 353, 355, 370, 371, 544,
+ 576, 577, 579, 594, 595, 609, 611, 626,
+ 627, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 340,
+ 372, 544, 576, 596, 628, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 329, 361, 544, 576, 585,
+ 617, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 335,
+ 367, 544, 576, 591, 623, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 334, 366, 544, 576, 590,
+ 622, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 321,
+ 338, 339, 353, 370, 371, 544, 576, 577,
+ 594, 595, 609, 626, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 321, 325, 338, 339, 353,
+ 357, 370, 371, 544, 576, 577, 581, 594,
+ 595, 609, 613, 626, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 337, 369, 544, 576, 593,
+ 625, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 341,
+ 373, 544, 576, 597, 629, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 325, 357, 544, 576, 581,
+ 613, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 339,
+ 371, 544, 576, 595, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 340, 372, 544, 576, 596,
+ 628, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 325,
+ 339, 340, 357, 371, 372, 544, 576, 581,
+ 595, 596, 613, 627, 628, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 339, 371, 544, 576, 595,
+ 627, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 339,
+ 371, 544, 576, 595, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 329, 361, 544, 576, 585,
+ 617, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 335,
+ 367, 544, 576, 591, 623, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 334, 366, 544, 576, 590,
+ 622, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 321,
+ 338, 339, 353, 370, 371, 544, 576, 577,
+ 594, 595, 609, 626, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 321, 338, 339, 353, 370,
+ 371, 544, 576, 577, 594, 595, 609, 626,
+ 627, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 323,
+ 355, 544, 576, 579, 611, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 331, 363, 544, 576, 587,
+ 619, 128, 264, 265, 269, 270, 383, 384,
+ 520, 521, 525, 526, 639, 288, 320, 321,
+ 338, 339, 353, 370, 371, 544, 576, 577,
+ 594, 595, 609, 626, 627, 128, 264, 265,
+ 269, 270, 383, 384, 520, 521, 525, 526,
+ 639, 288, 320, 321, 323, 338, 339, 353,
+ 355, 370, 371, 544, 576, 577, 579, 594,
+ 595, 609, 611, 626, 627, 265, 269, 384,
+ 520, 521, 525, 526, 639, 320, 340, 372,
+ 576, 596, 628, 384, 639, 320, 329, 361,
+ 576, 585, 617, 384, 639, 320, 335, 367,
+ 576, 591, 623, 384, 639, 320, 334, 366,
+ 576, 590, 622, 384, 639, 288, 320, 321,
+ 338, 339, 353, 370, 371, 544, 576, 577,
+ 594, 595, 609, 626, 627, 265, 269, 384,
+ 520, 521, 525, 526, 639, 288, 320, 321,
+ 325, 338, 339, 353, 357, 370, 371, 544,
+ 576, 577, 581, 594, 595, 609, 613, 626,
+ 627, 265, 269, 384, 520, 521, 525, 526,
+ 639, 320, 337, 369, 576, 593, 625, 384,
+ 639, 320, 341, 373, 576, 597, 629, 384,
+ 639, 320, 325, 357, 576, 581, 613, 384,
+ 639, 320, 339, 371, 576, 595, 627, 384,
+ 639, 320, 340, 372, 576, 596, 628, 384,
+ 639, 320, 325, 339, 340, 357, 371, 372,
+ 576, 581, 595, 596, 613, 627, 628, 384,
+ 639, 320, 339, 371, 576, 595, 627, 384,
+ 639, 320, 339, 371, 576, 595, 627, 384,
+ 639, 320, 329, 361, 576, 585, 617, 384,
+ 639, 320, 335, 367, 576, 591, 623, 384,
+ 639, 320, 334, 366, 576, 590, 622, 384,
+ 639, 288, 320, 321, 338, 339, 353, 370,
+ 371, 544, 576, 577, 594, 595, 609, 626,
+ 627, 265, 269, 384, 520, 521, 525, 526,
+ 639, 288, 320, 321, 338, 339, 353, 370,
+ 371, 544, 576, 577, 594, 595, 609, 626,
+ 627, 265, 269, 384, 520, 521, 525, 526,
+ 639, 320, 323, 355, 576, 579, 611, 384,
+ 639, 320, 331, 363, 576, 587, 619, 384,
+ 639, 288, 320, 321, 338, 339, 353, 370,
+ 371, 544, 576, 577, 594, 595, 609, 626,
+ 627, 265, 269, 384, 520, 521, 525, 526,
+ 639, 288, 301, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 557, 576, 577, 583, 588, 593, 600,
+ 609, 615, 620, 625, 632, 128, 383, 384,
+ 578, 579, 585, 586, 590, 591, 596, 597,
+ 610, 611, 617, 618, 622, 623, 628, 629,
+ 639, 288, 320, 333, 365, 544, 576, 128,
+ 383, 384, 639, 288, 320, 326, 358, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 321, 353, 544, 576, 128,
+ 383, 384, 639, 288, 320, 336, 368, 544,
+ 576, 128, 383, 384, 639, 288, 320, 339,
+ 371, 544, 576, 128, 383, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 128,
+ 383, 384, 639, 288, 320, 328, 334, 360,
+ 366, 544, 576, 128, 383, 384, 639, 288,
+ 320, 323, 355, 544, 576, 128, 383, 384,
+ 639, 288, 320, 336, 368, 544, 576, 128,
+ 383, 384, 639, 288, 320, 342, 374, 544,
+ 576, 128, 383, 384, 639, 288, 308, 310,
+ 320, 544, 576, 128, 383, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 128,
+ 383, 384, 639, 288, 320, 342, 344, 374,
+ 376, 544, 576, 128, 383, 384, 639, 288,
+ 320, 325, 357, 544, 576, 128, 383, 384,
+ 639, 288, 320, 334, 366, 544, 576, 128,
+ 383, 384, 639, 288, 320, 340, 372, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 338, 370, 544, 576, 128,
+ 383, 384, 639, 288, 320, 335, 367, 544,
+ 576, 128, 383, 384, 639, 288, 320, 333,
+ 365, 544, 576, 128, 383, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 128,
+ 383, 384, 639, 288, 320, 325, 357, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 353, 544, 576, 128, 383, 384, 639, 288,
+ 320, 324, 356, 544, 576, 128, 383, 384,
+ 639, 288, 320, 325, 357, 544, 576, 128,
+ 383, 384, 639, 288, 320, 338, 370, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 333, 336, 365, 368, 544,
+ 576, 128, 383, 384, 639, 288, 320, 336,
+ 368, 544, 576, 128, 383, 384, 639, 288,
+ 320, 329, 341, 361, 373, 544, 576, 128,
+ 383, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 128, 383, 384, 639, 288,
+ 320, 335, 367, 544, 576, 128, 383, 384,
+ 639, 288, 320, 323, 355, 544, 576, 128,
+ 383, 384, 639, 288, 320, 321, 353, 544,
+ 576, 128, 383, 384, 639, 288, 320, 332,
+ 364, 544, 576, 128, 383, 384, 639, 288,
+ 301, 320, 544, 576, 128, 383, 384, 639,
+ 288, 320, 329, 336, 361, 368, 544, 576,
+ 128, 383, 384, 639, 288, 320, 336, 368,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 320, 336, 368, 544, 576,
+ 128, 383, 384, 639, 288, 320, 329, 361,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 324, 356, 544, 576, 128, 383, 384, 639,
+ 288, 320, 321, 323, 324, 325, 326, 328,
+ 329, 332, 335, 336, 338, 339, 340, 344,
+ 353, 355, 356, 357, 358, 360, 361, 364,
+ 367, 368, 370, 371, 372, 376, 544, 576,
+ 128, 383, 384, 639, 288, 320, 321, 323,
+ 343, 353, 355, 375, 544, 576, 128, 383,
+ 384, 639, 288, 320, 339, 340, 345, 371,
+ 372, 377, 544, 576, 128, 383, 384, 639,
+ 288, 320, 339, 371, 544, 576, 128, 383,
+ 384, 639, 288, 320, 343, 375, 544, 576,
+ 128, 383, 384, 639, 288, 320, 335, 367,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 338, 370, 544, 576, 128, 383, 384, 639,
+ 288, 320, 324, 356, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 325, 357, 544, 576, 128, 383, 384, 639,
+ 288, 320, 321, 353, 544, 576, 128, 383,
+ 384, 639, 288, 320, 332, 364, 544, 576,
+ 128, 383, 384, 639, 288, 320, 333, 365,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 320, 325, 329, 333, 340,
+ 357, 361, 365, 372, 544, 576, 128, 383,
+ 384, 639, 288, 320, 323, 355, 544, 576,
+ 128, 383, 384, 639, 288, 320, 321, 323,
+ 324, 325, 326, 328, 329, 332, 335, 336,
+ 338, 339, 340, 344, 353, 355, 356, 357,
+ 358, 360, 361, 364, 367, 368, 370, 371,
+ 372, 376, 544, 576, 128, 383, 384, 639,
+ 288, 320, 335, 367, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 336, 368, 544, 576, 128, 383, 384, 639,
+ 288, 320, 321, 323, 324, 325, 326, 328,
+ 329, 332, 335, 336, 338, 339, 340, 344,
+ 353, 355, 356, 357, 358, 360, 361, 364,
+ 367, 368, 370, 371, 372, 376, 544, 576,
+ 128, 383, 384, 639, 288, 320, 324, 327,
+ 332, 356, 359, 364, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 323, 355, 544, 576, 128, 383, 384, 639,
+ 288, 320, 335, 367, 544, 576, 128, 383,
+ 384, 639, 288, 320, 333, 365, 544, 576,
+ 128, 383, 384, 639, 288, 320, 336, 368,
+ 544, 576, 128, 383, 384, 639, 288, 301,
+ 320, 544, 576, 128, 383, 384, 639, 288,
+ 320, 329, 361, 544, 576, 128, 383, 384,
+ 639, 288, 320, 324, 356, 544, 576, 128,
+ 383, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 128, 383, 384, 639, 288,
+ 320, 325, 357, 544, 576, 128, 383, 384,
+ 639, 288, 320, 334, 366, 544, 576, 128,
+ 383, 384, 639, 288, 320, 340, 372, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 339, 371, 544, 576, 128,
+ 383, 384, 639, 288, 320, 323, 355, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 341, 373, 544, 576, 128,
+ 383, 384, 639, 288, 320, 334, 366, 544,
+ 576, 128, 383, 384, 639, 288, 301, 320,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 329, 336, 341, 361, 368, 373, 544, 576,
+ 128, 383, 384, 639, 288, 320, 336, 368,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 320, 335, 343, 367, 375,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 338, 370, 544, 576, 128, 383, 384, 639,
+ 288, 320, 340, 372, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 324, 356, 544, 576, 128, 383, 384, 639,
+ 288, 320, 321, 323, 324, 325, 326, 328,
+ 329, 332, 335, 336, 338, 339, 340, 344,
+ 353, 355, 356, 357, 358, 360, 361, 364,
+ 367, 368, 370, 371, 372, 376, 544, 576,
+ 128, 383, 384, 639, 288, 320, 339, 371,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 338, 370, 544, 576, 128, 383, 384, 639,
+ 288, 320, 321, 323, 324, 325, 326, 328,
+ 329, 332, 335, 336, 338, 339, 340, 344,
+ 353, 355, 356, 357, 358, 360, 361, 364,
+ 367, 368, 370, 371, 372, 376, 544, 576,
+ 128, 383, 384, 639, 288, 320, 328, 360,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 588, 620, 128, 383, 384, 639,
+ 288, 320, 335, 367, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 353, 544, 576,
+ 128, 383, 384, 639, 288, 320, 324, 356,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 320, 339, 371, 544, 576,
+ 128, 383, 384, 639, 288, 320, 323, 355,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 326, 358, 544, 576, 128, 383, 384, 639,
+ 288, 301, 320, 544, 576, 128, 383, 384,
+ 639, 288, 320, 329, 336, 340, 361, 368,
+ 372, 544, 576, 128, 383, 384, 639, 288,
+ 320, 336, 368, 544, 576, 128, 383, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 128, 383, 384, 639, 288, 320, 335,
+ 367, 544, 576, 128, 383, 384, 639, 288,
+ 320, 338, 370, 544, 576, 128, 383, 384,
+ 639, 288, 320, 340, 372, 544, 576, 128,
+ 383, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 128, 383, 384, 639, 288,
+ 320, 338, 370, 544, 576, 128, 383, 384,
+ 639, 288, 320, 321, 353, 544, 576, 128,
+ 383, 384, 639, 288, 320, 334, 366, 544,
+ 576, 128, 383, 384, 639, 288, 320, 339,
+ 371, 544, 576, 128, 383, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 128,
+ 383, 384, 639, 288, 320, 335, 367, 544,
+ 576, 128, 383, 384, 639, 288, 320, 338,
+ 370, 544, 576, 128, 383, 384, 639, 288,
+ 320, 340, 372, 544, 576, 128, 383, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 320, 342, 374, 544, 576, 128,
+ 383, 384, 639, 288, 310, 320, 544, 576,
+ 128, 383, 384, 639, 288, 320, 321, 323,
+ 324, 325, 326, 328, 329, 332, 335, 336,
+ 338, 339, 340, 344, 353, 355, 356, 357,
+ 358, 360, 361, 364, 367, 368, 370, 371,
+ 372, 376, 544, 576, 128, 383, 384, 639,
+ 288, 320, 336, 368, 544, 576, 128, 383,
+ 384, 639, 288, 320, 329, 361, 544, 576,
+ 128, 383, 384, 639, 288, 320, 338, 370,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 325, 357, 544, 576, 128, 383, 384, 639,
+ 288, 320, 339, 371, 544, 576, 128, 383,
+ 384, 639, 288, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 339, 353, 371, 544, 576, 128, 383,
+ 384, 639, 288, 320, 333, 365, 544, 576,
+ 128, 383, 384, 639, 288, 320, 325, 357,
+ 544, 576, 128, 383, 384, 639, 288, 320,
+ 321, 323, 324, 325, 326, 328, 329, 332,
+ 335, 336, 338, 339, 340, 344, 353, 355,
+ 356, 357, 358, 360, 361, 364, 367, 368,
+ 370, 371, 372, 376, 544, 576, 128, 383,
+ 384, 639, 288, 301, 320, 544, 576, 128,
+ 383, 384, 639, 288, 320, 334, 366, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 353, 544, 576, 128, 383, 384, 639, 288,
+ 320, 336, 368, 544, 576, 128, 383, 384,
+ 639, 288, 320, 340, 372, 544, 576, 128,
+ 383, 384, 639, 288, 320, 338, 370, 544,
+ 576, 128, 383, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 128, 383, 384,
+ 639, 288, 301, 320, 321, 323, 324, 325,
+ 326, 328, 329, 332, 335, 336, 338, 339,
+ 340, 344, 353, 355, 356, 357, 358, 360,
+ 361, 364, 367, 368, 370, 371, 372, 376,
+ 544, 557, 576, 577, 579, 580, 581, 582,
+ 584, 585, 588, 591, 592, 594, 595, 596,
+ 600, 609, 611, 612, 613, 614, 616, 617,
+ 620, 623, 624, 626, 627, 628, 632, 128,
+ 383, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 588, 620, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 288, 320, 321, 323, 324, 325, 326,
+ 328, 329, 332, 335, 336, 338, 339, 340,
+ 344, 353, 355, 356, 357, 358, 360, 361,
+ 364, 367, 368, 370, 371, 372, 376, 544,
+ 576, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 384, 639, 288, 320, 321,
+ 323, 324, 325, 326, 328, 329, 332, 335,
+ 336, 338, 339, 340, 344, 353, 355, 356,
+ 357, 358, 360, 361, 364, 367, 368, 370,
+ 371, 372, 376, 544, 576, 384, 639, 288,
+ 320, 321, 323, 324, 325, 326, 328, 329,
+ 332, 335, 336, 338, 339, 340, 344, 353,
+ 355, 356, 357, 358, 360, 361, 364, 367,
+ 368, 370, 371, 372, 376, 544, 576, 384,
+ 639, 320, 333, 365, 576, 589, 621, 384,
+ 639, 320, 326, 358, 576, 582, 614, 384,
+ 639, 320, 321, 353, 576, 577, 609, 384,
+ 639, 320, 336, 368, 576, 592, 624, 384,
+ 639, 320, 339, 371, 576, 595, 627, 384,
+ 639, 320, 328, 334, 360, 366, 576, 584,
+ 590, 616, 622, 384, 639, 320, 323, 355,
+ 576, 579, 611, 384, 639, 320, 336, 368,
+ 576, 592, 624, 384, 639, 320, 342, 374,
+ 576, 598, 630, 384, 639, 308, 310, 320,
+ 564, 566, 576, 384, 639, 320, 321, 339,
+ 353, 371, 576, 577, 595, 609, 627, 384,
+ 639, 320, 333, 365, 576, 589, 621, 384,
+ 639, 320, 325, 357, 576, 581, 613, 384,
+ 639, 301, 320, 557, 576, 384, 639, 320,
+ 334, 366, 576, 590, 622, 384, 639, 320,
+ 321, 353, 576, 577, 609, 384, 639, 320,
+ 336, 368, 576, 592, 624, 384, 639, 320,
+ 340, 372, 576, 596, 628, 384, 639, 320,
+ 338, 370, 576, 594, 626, 384, 639, 320,
+ 342, 344, 374, 376, 576, 598, 600, 630,
+ 632, 384, 639, 320, 325, 357, 576, 581,
+ 613, 384, 639, 320, 334, 366, 576, 590,
+ 622, 384, 639, 320, 340, 372, 576, 596,
+ 628, 384, 639, 320, 336, 368, 576, 592,
+ 624, 384, 639, 320, 329, 361, 576, 585,
+ 617, 384, 639, 320, 338, 370, 576, 594,
+ 626, 384, 639, 320, 325, 357, 576, 581,
+ 613, 384, 639, 320, 339, 371, 576, 595,
+ 627, 384, 639, 320, 338, 370, 576, 594,
+ 626, 384, 639, 320, 335, 367, 576, 591,
+ 623, 384, 639, 320, 333, 365, 576, 589,
+ 621, 384, 639, 320, 325, 357, 576, 581,
+ 613, 384, 639, 320, 321, 353, 576, 577,
+ 609, 384, 639, 320, 324, 356, 576, 580,
+ 612, 384, 639, 320, 325, 357, 576, 581,
+ 613, 384, 639, 320, 338, 370, 576, 594,
+ 626, 384, 639, 320, 333, 336, 365, 368,
+ 576, 589, 592, 621, 624, 384, 639, 320,
+ 336, 368, 576, 592, 624, 384, 639, 320,
+ 329, 341, 361, 373, 576, 585, 597, 617,
+ 629, 384, 639, 320, 342, 374, 576, 598,
+ 630, 384, 639, 310, 320, 566, 576, 384,
+ 639, 320, 335, 367, 576, 591, 623, 384,
+ 639, 320, 323, 355, 576, 579, 611, 384,
+ 639, 320, 321, 353, 576, 577, 609, 384,
+ 639, 320, 332, 364, 576, 588, 620, 384,
+ 639, 301, 320, 557, 576, 384, 639, 320,
+ 329, 336, 361, 368, 576, 585, 592, 617,
+ 624, 384, 639, 320, 336, 368, 576, 592,
+ 624, 384, 639, 320, 335, 367, 576, 591,
+ 623, 384, 639, 320, 338, 370, 576, 594,
+ 626, 384, 639, 320, 340, 372, 576, 596,
+ 628, 384, 639, 320, 336, 368, 576, 592,
+ 624, 384, 639, 320, 329, 361, 576, 585,
+ 617, 384, 639, 320, 324, 356, 576, 580,
+ 612, 384, 639, 320, 321, 323, 343, 353,
+ 355, 375, 576, 577, 579, 599, 609, 611,
+ 631, 384, 639, 320, 339, 340, 345, 371,
+ 372, 377, 576, 595, 596, 601, 627, 628,
+ 633, 384, 639, 320, 339, 371, 576, 595,
+ 627, 384, 639, 320, 343, 375, 576, 599,
+ 631, 384, 639, 320, 335, 367, 576, 591,
+ 623, 384, 639, 320, 338, 370, 576, 594,
+ 626, 384, 639, 320, 324, 356, 576, 580,
+ 612, 384, 639, 320, 328, 360, 576, 584,
+ 616, 384, 639, 288, 320, 321, 323, 324,
+ 325, 326, 328, 329, 332, 335, 336, 338,
+ 339, 340, 344, 353, 355, 356, 357, 358,
+ 360, 361, 364, 367, 368, 370, 371, 372,
+ 376, 544, 576, 588, 620, 384, 639, 320,
+ 335, 367, 576, 591, 623, 384, 639, 320,
+ 321, 353, 576, 577, 609, 384, 639, 320,
+ 324, 356, 576, 580, 612, 384, 639, 320,
+ 339, 371, 576, 595, 627, 384, 639, 320,
+ 323, 355, 576, 579, 611, 384, 639, 320,
+ 326, 358, 576, 582, 614, 384, 639, 301,
+ 320, 557, 576, 384, 639, 320, 329, 336,
+ 340, 361, 368, 372, 576, 585, 592, 596,
+ 617, 624, 628, 384, 639, 320, 336, 368,
+ 576, 592, 624, 384, 639, 320, 335, 367,
+ 576, 591, 623, 384, 639, 320, 338, 370,
+ 576, 594, 626, 384, 639, 320, 340, 372,
+ 576, 596, 628, 384, 639, 320, 338, 370,
+ 576, 594, 626, 384, 639, 320, 321, 353,
+ 576, 577, 609, 384, 639, 320, 334, 366,
+ 576, 590, 622, 384, 639, 320, 339, 371,
+ 576, 595, 627, 384, 639, 320, 325, 357,
+ 576, 581, 613, 384, 639, 320, 321, 353,
+ 576, 577, 609, 384, 639, 320, 332, 364,
+ 576, 588, 620, 384, 639, 320, 333, 365,
+ 576, 589, 621, 384, 639, 320, 325, 329,
+ 333, 340, 357, 361, 365, 372, 576, 581,
+ 585, 589, 596, 613, 617, 621, 628, 384,
+ 639, 320, 323, 355, 576, 579, 611, 384,
+ 639, 320, 324, 327, 332, 356, 359, 364,
+ 576, 580, 583, 588, 612, 615, 620, 384,
+ 639, 320, 323, 355, 576, 579, 611, 384,
+ 639, 320, 335, 367, 576, 591, 623, 384,
+ 639, 320, 333, 365, 576, 589, 621, 384,
+ 639, 320, 336, 368, 576, 592, 624, 384,
+ 639, 301, 320, 557, 576, 384, 639, 320,
+ 329, 361, 576, 585, 617, 384, 639, 320,
+ 324, 356, 576, 580, 612, 384, 639, 320,
+ 325, 357, 576, 581, 613, 384, 639, 320,
+ 334, 366, 576, 590, 622, 384, 639, 320,
+ 340, 372, 576, 596, 628, 384, 639, 320,
+ 339, 371, 576, 595, 627, 384, 639, 320,
+ 323, 355, 576, 579, 611, 384, 639, 320,
+ 341, 373, 576, 597, 629, 384, 639, 320,
+ 334, 366, 576, 590, 622, 384, 639, 301,
+ 320, 557, 576, 384, 639, 320, 329, 336,
+ 341, 361, 368, 373, 576, 585, 592, 597,
+ 617, 624, 629, 384, 639, 320, 336, 368,
+ 576, 592, 624, 384, 639, 320, 335, 343,
+ 367, 375, 576, 591, 599, 623, 631, 384,
+ 639, 320, 338, 370, 576, 594, 626, 384,
+ 639, 320, 340, 372, 576, 596, 628, 384,
+ 639, 320, 324, 356, 576, 580, 612, 384,
+ 639, 320, 339, 371, 576, 595, 627, 384,
+ 639, 320, 338, 370, 576, 594, 626, 384,
+ 639, 320, 335, 367, 576, 591, 623, 384,
+ 639, 320, 336, 368, 576, 592, 624, 384,
+ 639, 296, 297, 318, 552, 553, 574, 384,
+ 639, 297, 553, 384, 639, 297, 553, 384,
+ 639, 0
+ };
-static const short _demo_machine_parser_cmd_trans_keys[] = {
- 37, 800, 805, 1056, 1061, 777, 781, 896,
- 1032, 1033, 1037, 1038, 1151, 800, 1056, 777,
- 781, 896, 1032, 1033, 1037, 1038, 1151, 43,
- 79, 83, 111, 115, 78, 110, 70, 102,
- 73, 105, 71, 103, 45, 83, 115, 69,
- 84, 101, 116, 83, 115, 83, 115, 73,
- 105, 79, 111, 78, 110, 84, 116, 78,
- 110, 71, 103, 85, 117, 80, 112, 65,
- 77, 97, 109, 82, 114, 71, 103, 69,
- 101, 45, 77, 109, 69, 101, 83, 115,
- 83, 115, 65, 97, 71, 103, 69, 101,
- 83, 115, 83, 115, 65, 97, 71, 103,
- 69, 101, 80, 112, 84, 116, 79, 111,
- 78, 110, 83, 115, 85, 117, 66, 98,
- 73, 105, 83, 115, 72, 104, 71, 83,
- 103, 115, 83, 115, 84, 116, 69, 101,
- 82, 114, 67, 76, 77, 78, 84, 85,
- 99, 108, 109, 110, 116, 117, 69, 101,
- 78, 110, 65, 97, 82, 114, 73, 105,
- 79, 111, 68, 100, 69, 101, 79, 111,
- 69, 101, 69, 101, 80, 112, 83, 115,
- 79, 111, 80, 112, 66, 98, 67, 99,
- 82, 114, 73, 105, 66, 98, 69, 101,
- 77, 109, 69, 101, 78, 110, 73, 105,
- 84, 116, 76, 108, 80, 112, 68, 100,
- 76, 108, 69, 101, 77, 109, 70, 102,
- 77, 109, 80, 112, 65, 97, 67, 99,
- 75, 107, 83, 84, 115, 116, 68, 100,
- 73, 105, 79, 111, 73, 105, 68, 100,
- 69, 101, 79, 111, 45, 64, 84, 116,
- 73, 105, 79, 111, 78, 110, 81, 113,
- 85, 117, 69, 101, 83, 115, 84, 116,
- 69, 83, 84, 101, 115, 116, 83, 115,
- 83, 115, 73, 105, 79, 111, 78, 110,
- 67, 99, 75, 107, 77, 109, 70, 102,
- 65, 97, 80, 112, 83, 115, 72, 78,
- 104, 110, 67, 99, 80, 112, 86, 118,
- 52, 54, 86, 88, 118, 120, 69, 101,
- 78, 110, 84, 116, 82, 114, 79, 111,
- 77, 109, 69, 101, 65, 97, 68, 100,
- 69, 101, 82, 114, 77, 80, 109, 112,
- 80, 112, 73, 85, 105, 117, 79, 111,
- 67, 99, 65, 97, 76, 108, 45, 73,
- 80, 105, 112, 80, 112, 80, 112, 73,
- 105, 68, 100, 65, 67, 87, 97, 99,
- 119, 83, 84, 89, 115, 116, 121, 83,
- 115, 87, 119, 79, 111, 82, 114, 68,
- 100, 69, 101, 65, 97, 76, 108, 77,
- 109, 69, 73, 77, 84, 101, 105, 109,
- 116, 67, 99, 79, 111, 80, 112, 68,
- 71, 76, 100, 103, 108, 67, 99, 79,
- 111, 77, 109, 80, 112, 45, 73, 105,
- 68, 100, 69, 101, 78, 110, 84, 116,
- 83, 115, 67, 99, 85, 117, 78, 110,
- 45, 73, 80, 85, 105, 112, 117, 80,
- 112, 79, 87, 111, 119, 82, 114, 84,
- 116, 68, 100, 83, 115, 82, 114, 72,
- 104, 79, 111, 65, 97, 68, 100, 83,
- 115, 67, 99, 70, 102, 45, 73, 80,
- 84, 105, 112, 116, 80, 112, 79, 111,
- 82, 114, 84, 116, 82, 114, 65, 97,
- 78, 110, 83, 115, 79, 111, 82, 114,
- 84, 116, 86, 118, 54, 80, 112, 73,
- 105, 82, 114, 69, 101, 83, 115, 65,
- 83, 97, 115, 77, 109, 69, 101, 45,
- 78, 110, 65, 97, 80, 112, 84, 116,
- 82, 114, 62, 35, 37, 43, 45, 62,
- 896, 1151, 896, 1151, 288, 544, 265, 269,
- 384, 520, 521, 525, 526, 639, 384, 639,
- 43, 65, 67, 68, 69, 70, 72, 76,
- 77, 79, 80, 81, 82, 83, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 118, 43, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 85,
- 86, 97, 99, 100, 101, 102, 104, 108,
- 109, 111, 112, 113, 114, 115, 117, 118,
- 79, 83, 111, 115, 78, 110, 70, 102,
- 73, 105, 71, 103, 45, 83, 115, 69,
- 84, 101, 116, 83, 115, 83, 115, 73,
- 105, 79, 111, 78, 110, 65, 67, 68,
- 69, 70, 72, 76, 77, 79, 80, 81,
- 82, 83, 86, 97, 99, 100, 101, 102,
- 104, 108, 109, 111, 112, 113, 114, 115,
- 118, 65, 67, 68, 69, 70, 72, 76,
- 77, 79, 80, 81, 82, 83, 84, 85,
- 86, 97, 99, 100, 101, 102, 104, 108,
- 109, 111, 112, 113, 114, 115, 116, 117,
- 118, 65, 67, 68, 69, 70, 72, 76,
- 77, 79, 80, 81, 82, 83, 86, 88,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 120, 84,
- 116, 65, 67, 68, 69, 70, 72, 76,
- 77, 79, 80, 81, 82, 83, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 118, 65, 67, 68,
- 69, 70, 72, 73, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 105, 108, 109, 111, 112, 113,
- 114, 115, 118, 65, 67, 68, 69, 70,
- 72, 76, 77, 79, 80, 81, 82, 83,
- 85, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 117,
- 118, 78, 110, 71, 103, 85, 117, 80,
- 112, 65, 67, 68, 69, 70, 72, 76,
- 77, 79, 80, 81, 82, 83, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 118, 65, 77, 97,
- 109, 82, 114, 71, 103, 69, 101, 45,
- 77, 109, 69, 101, 83, 115, 83, 115,
- 65, 97, 71, 103, 69, 101, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 83, 115,
- 83, 115, 65, 97, 71, 103, 69, 101,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 80, 112, 84, 116,
- 65, 67, 68, 69, 70, 72, 73, 76,
- 77, 79, 80, 81, 82, 83, 86, 97,
- 99, 100, 101, 102, 104, 105, 108, 109,
- 111, 112, 113, 114, 115, 118, 79, 111,
- 78, 110, 83, 115, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 85, 117, 66, 98, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 73, 105, 83, 115, 72, 104, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 85,
- 86, 97, 99, 100, 101, 102, 104, 108,
- 109, 111, 112, 113, 114, 115, 117, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 85, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 117, 118, 71, 83,
- 103, 115, 65, 67, 68, 69, 70, 72,
- 73, 76, 77, 79, 80, 81, 82, 83,
- 86, 97, 99, 100, 101, 102, 104, 105,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 83, 115, 84, 116, 69, 101, 82, 114,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 67, 76, 77, 78,
- 84, 85, 99, 108, 109, 110, 116, 117,
- 69, 101, 78, 110, 65, 97, 82, 114,
- 73, 105, 79, 111, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 73, 76,
- 77, 79, 80, 81, 82, 83, 86, 97,
- 99, 100, 101, 102, 104, 105, 108, 109,
- 111, 112, 113, 114, 115, 118, 68, 100,
- 69, 101, 79, 111, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 69, 101, 69, 101, 80, 112, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 83, 115, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 79, 111, 80, 112, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 66, 98, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 67, 99,
- 82, 114, 73, 105, 66, 98, 69, 101,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 85, 86, 97, 99, 100, 101, 102,
- 104, 108, 109, 111, 112, 113, 114, 115,
- 117, 118, 77, 109, 69, 101, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 78, 110, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 73, 105, 84, 116, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 76, 108, 80, 112, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 68, 100, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 76, 108, 69, 101, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 77, 109, 70, 102, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 77, 109, 80, 112, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 97, 67, 99, 75, 107,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 83, 84, 115, 116,
- 68, 100, 73, 105, 79, 111, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 73, 105, 68, 100, 69, 101,
- 79, 111, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 85, 86, 97, 99, 100,
- 101, 102, 104, 108, 109, 111, 112, 113,
- 114, 115, 117, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 84, 85, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 116, 117, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 88, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 118, 120, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 73, 76, 77, 79, 80, 81, 82, 83,
- 86, 97, 99, 100, 101, 102, 104, 105,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 85, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 117, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 73, 76, 77, 79,
- 80, 81, 82, 83, 86, 97, 99, 100,
- 101, 102, 104, 105, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 85, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 117, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 85, 86, 97, 99, 100,
- 101, 102, 104, 108, 109, 111, 112, 113,
- 114, 115, 117, 118, 65, 67, 68, 69,
- 70, 72, 73, 76, 77, 79, 80, 81,
- 82, 83, 86, 97, 99, 100, 101, 102,
- 104, 105, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 73, 76, 77, 79, 80, 81, 82, 83,
- 86, 97, 99, 100, 101, 102, 104, 105,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 86, 97, 99,
- 100, 101, 102, 104, 108, 109, 111, 112,
- 113, 114, 115, 118, 65, 67, 68, 69,
- 70, 72, 76, 77, 79, 80, 81, 82,
- 83, 86, 97, 99, 100, 101, 102, 104,
- 108, 109, 111, 112, 113, 114, 115, 118,
- 65, 67, 68, 69, 70, 72, 76, 77,
- 79, 80, 81, 82, 83, 85, 86, 97,
- 99, 100, 101, 102, 104, 108, 109, 111,
- 112, 113, 114, 115, 117, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 65, 67,
- 68, 69, 70, 72, 76, 77, 79, 80,
- 81, 82, 83, 86, 97, 99, 100, 101,
- 102, 104, 108, 109, 111, 112, 113, 114,
- 115, 118, 65, 67, 68, 69, 70, 72,
- 76, 77, 79, 80, 81, 82, 83, 86,
- 97, 99, 100, 101, 102, 104, 108, 109,
- 111, 112, 113, 114, 115, 118, 288, 301,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 557, 576,
- 577, 579, 580, 581, 582, 584, 585, 588,
- 591, 592, 594, 595, 596, 600, 609, 611,
- 612, 613, 614, 616, 617, 620, 623, 624,
- 626, 627, 628, 632, 128, 383, 384, 639,
- 288, 320, 544, 576, 128, 383, 384, 639,
- 288, 320, 544, 576, 384, 639, 32, 64,
- 65, 82, 83, 97, 114, 115, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 64,
- 65, 82, 83, 97, 114, 115, 9, 13,
- 32, 65, 67, 82, 83, 97, 99, 114,
- 115, 9, 13, 32, 84, 116, 9, 13,
- 32, 73, 105, 9, 13, 32, 79, 111,
- 9, 13, 32, 78, 110, 9, 13, 32,
- 65, 82, 83, 97, 114, 115, 9, 13,
- 32, 65, 69, 82, 83, 97, 101, 114,
- 115, 9, 13, 32, 81, 113, 9, 13,
- 32, 85, 117, 9, 13, 32, 69, 101,
- 9, 13, 32, 83, 115, 9, 13, 32,
- 84, 116, 9, 13, 32, 69, 83, 84,
- 101, 115, 116, 9, 13, 32, 83, 115,
- 9, 13, 32, 83, 115, 9, 13, 32,
- 73, 105, 9, 13, 32, 79, 111, 9,
- 13, 32, 78, 110, 9, 13, 32, 65,
- 82, 83, 97, 114, 115, 9, 13, 32,
- 65, 82, 83, 97, 114, 115, 9, 13,
- 32, 67, 99, 9, 13, 32, 75, 107,
- 9, 13, 32, 65, 82, 83, 97, 114,
- 115, 9, 13, 32, 65, 67, 82, 83,
- 97, 99, 114, 115, 9, 13, 32, 65,
- 82, 83, 97, 114, 115, 9, 13, 32,
- 65, 69, 82, 83, 97, 101, 114, 115,
- 9, 13, 32, 65, 82, 83, 97, 114,
- 115, 9, 13, 32, 65, 82, 83, 97,
- 114, 115, 9, 13, 32, 65, 82, 83,
- 97, 114, 115, 9, 13, 320, 576, 384,
- 639, 320, 576, 384, 639, 288, 320, 321,
- 338, 339, 353, 370, 371, 544, 576, 577,
- 594, 595, 609, 626, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 544, 576, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 32, 64, 9, 13, 288, 320, 544,
- 576, 265, 269, 384, 520, 521, 525, 526,
- 639, 288, 320, 544, 576, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 321, 338, 339, 353, 370,
- 371, 544, 576, 577, 594, 595, 609, 626,
- 627, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 321,
- 323, 338, 339, 353, 355, 370, 371, 544,
- 576, 577, 579, 594, 595, 609, 611, 626,
- 627, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 340,
- 372, 544, 576, 596, 628, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 329, 361, 544, 576, 585,
- 617, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 335,
- 367, 544, 576, 591, 623, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 334, 366, 544, 576, 590,
- 622, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 321,
- 338, 339, 353, 370, 371, 544, 576, 577,
- 594, 595, 609, 626, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 321, 325, 338, 339, 353,
- 357, 370, 371, 544, 576, 577, 581, 594,
- 595, 609, 613, 626, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 337, 369, 544, 576, 593,
- 625, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 341,
- 373, 544, 576, 597, 629, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 325, 357, 544, 576, 581,
- 613, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 339,
- 371, 544, 576, 595, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 340, 372, 544, 576, 596,
- 628, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 325,
- 339, 340, 357, 371, 372, 544, 576, 581,
- 595, 596, 613, 627, 628, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 339, 371, 544, 576, 595,
- 627, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 339,
- 371, 544, 576, 595, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 329, 361, 544, 576, 585,
- 617, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 335,
- 367, 544, 576, 591, 623, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 334, 366, 544, 576, 590,
- 622, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 321,
- 338, 339, 353, 370, 371, 544, 576, 577,
- 594, 595, 609, 626, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 321, 338, 339, 353, 370,
- 371, 544, 576, 577, 594, 595, 609, 626,
- 627, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 323,
- 355, 544, 576, 579, 611, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 331, 363, 544, 576, 587,
- 619, 128, 264, 265, 269, 270, 383, 384,
- 520, 521, 525, 526, 639, 288, 320, 321,
- 338, 339, 353, 370, 371, 544, 576, 577,
- 594, 595, 609, 626, 627, 128, 264, 265,
- 269, 270, 383, 384, 520, 521, 525, 526,
- 639, 288, 320, 321, 323, 338, 339, 353,
- 355, 370, 371, 544, 576, 577, 579, 594,
- 595, 609, 611, 626, 627, 265, 269, 384,
- 520, 521, 525, 526, 639, 320, 340, 372,
- 576, 596, 628, 384, 639, 320, 329, 361,
- 576, 585, 617, 384, 639, 320, 335, 367,
- 576, 591, 623, 384, 639, 320, 334, 366,
- 576, 590, 622, 384, 639, 288, 320, 321,
- 338, 339, 353, 370, 371, 544, 576, 577,
- 594, 595, 609, 626, 627, 265, 269, 384,
- 520, 521, 525, 526, 639, 288, 320, 321,
- 325, 338, 339, 353, 357, 370, 371, 544,
- 576, 577, 581, 594, 595, 609, 613, 626,
- 627, 265, 269, 384, 520, 521, 525, 526,
- 639, 320, 337, 369, 576, 593, 625, 384,
- 639, 320, 341, 373, 576, 597, 629, 384,
- 639, 320, 325, 357, 576, 581, 613, 384,
- 639, 320, 339, 371, 576, 595, 627, 384,
- 639, 320, 340, 372, 576, 596, 628, 384,
- 639, 320, 325, 339, 340, 357, 371, 372,
- 576, 581, 595, 596, 613, 627, 628, 384,
- 639, 320, 339, 371, 576, 595, 627, 384,
- 639, 320, 339, 371, 576, 595, 627, 384,
- 639, 320, 329, 361, 576, 585, 617, 384,
- 639, 320, 335, 367, 576, 591, 623, 384,
- 639, 320, 334, 366, 576, 590, 622, 384,
- 639, 288, 320, 321, 338, 339, 353, 370,
- 371, 544, 576, 577, 594, 595, 609, 626,
- 627, 265, 269, 384, 520, 521, 525, 526,
- 639, 288, 320, 321, 338, 339, 353, 370,
- 371, 544, 576, 577, 594, 595, 609, 626,
- 627, 265, 269, 384, 520, 521, 525, 526,
- 639, 320, 323, 355, 576, 579, 611, 384,
- 639, 320, 331, 363, 576, 587, 619, 384,
- 639, 288, 320, 321, 338, 339, 353, 370,
- 371, 544, 576, 577, 594, 595, 609, 626,
- 627, 265, 269, 384, 520, 521, 525, 526,
- 639, 288, 301, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 557, 576, 577, 583, 588, 593, 600,
- 609, 615, 620, 625, 632, 128, 383, 384,
- 578, 579, 585, 586, 590, 591, 596, 597,
- 610, 611, 617, 618, 622, 623, 628, 629,
- 639, 288, 320, 333, 365, 544, 576, 128,
- 383, 384, 639, 288, 320, 326, 358, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 321, 353, 544, 576, 128,
- 383, 384, 639, 288, 320, 336, 368, 544,
- 576, 128, 383, 384, 639, 288, 320, 339,
- 371, 544, 576, 128, 383, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 128,
- 383, 384, 639, 288, 320, 328, 334, 360,
- 366, 544, 576, 128, 383, 384, 639, 288,
- 320, 323, 355, 544, 576, 128, 383, 384,
- 639, 288, 320, 336, 368, 544, 576, 128,
- 383, 384, 639, 288, 320, 342, 374, 544,
- 576, 128, 383, 384, 639, 288, 308, 310,
- 320, 544, 576, 128, 383, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 128,
- 383, 384, 639, 288, 320, 342, 344, 374,
- 376, 544, 576, 128, 383, 384, 639, 288,
- 320, 325, 357, 544, 576, 128, 383, 384,
- 639, 288, 320, 334, 366, 544, 576, 128,
- 383, 384, 639, 288, 320, 340, 372, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 338, 370, 544, 576, 128,
- 383, 384, 639, 288, 320, 335, 367, 544,
- 576, 128, 383, 384, 639, 288, 320, 333,
- 365, 544, 576, 128, 383, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 128,
- 383, 384, 639, 288, 320, 325, 357, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 353, 544, 576, 128, 383, 384, 639, 288,
- 320, 324, 356, 544, 576, 128, 383, 384,
- 639, 288, 320, 325, 357, 544, 576, 128,
- 383, 384, 639, 288, 320, 338, 370, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 333, 336, 365, 368, 544,
- 576, 128, 383, 384, 639, 288, 320, 336,
- 368, 544, 576, 128, 383, 384, 639, 288,
- 320, 329, 341, 361, 373, 544, 576, 128,
- 383, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 128, 383, 384, 639, 288,
- 320, 335, 367, 544, 576, 128, 383, 384,
- 639, 288, 320, 323, 355, 544, 576, 128,
- 383, 384, 639, 288, 320, 321, 353, 544,
- 576, 128, 383, 384, 639, 288, 320, 332,
- 364, 544, 576, 128, 383, 384, 639, 288,
- 301, 320, 544, 576, 128, 383, 384, 639,
- 288, 320, 329, 336, 361, 368, 544, 576,
- 128, 383, 384, 639, 288, 320, 336, 368,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 320, 336, 368, 544, 576,
- 128, 383, 384, 639, 288, 320, 329, 361,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 324, 356, 544, 576, 128, 383, 384, 639,
- 288, 320, 321, 323, 324, 325, 326, 328,
- 329, 332, 335, 336, 338, 339, 340, 344,
- 353, 355, 356, 357, 358, 360, 361, 364,
- 367, 368, 370, 371, 372, 376, 544, 576,
- 128, 383, 384, 639, 288, 320, 321, 323,
- 343, 353, 355, 375, 544, 576, 128, 383,
- 384, 639, 288, 320, 339, 340, 345, 371,
- 372, 377, 544, 576, 128, 383, 384, 639,
- 288, 320, 339, 371, 544, 576, 128, 383,
- 384, 639, 288, 320, 343, 375, 544, 576,
- 128, 383, 384, 639, 288, 320, 335, 367,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 338, 370, 544, 576, 128, 383, 384, 639,
- 288, 320, 324, 356, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 325, 357, 544, 576, 128, 383, 384, 639,
- 288, 320, 321, 353, 544, 576, 128, 383,
- 384, 639, 288, 320, 332, 364, 544, 576,
- 128, 383, 384, 639, 288, 320, 333, 365,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 320, 325, 329, 333, 340,
- 357, 361, 365, 372, 544, 576, 128, 383,
- 384, 639, 288, 320, 323, 355, 544, 576,
- 128, 383, 384, 639, 288, 320, 321, 323,
- 324, 325, 326, 328, 329, 332, 335, 336,
- 338, 339, 340, 344, 353, 355, 356, 357,
- 358, 360, 361, 364, 367, 368, 370, 371,
- 372, 376, 544, 576, 128, 383, 384, 639,
- 288, 320, 335, 367, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 336, 368, 544, 576, 128, 383, 384, 639,
- 288, 320, 321, 323, 324, 325, 326, 328,
- 329, 332, 335, 336, 338, 339, 340, 344,
- 353, 355, 356, 357, 358, 360, 361, 364,
- 367, 368, 370, 371, 372, 376, 544, 576,
- 128, 383, 384, 639, 288, 320, 324, 327,
- 332, 356, 359, 364, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 323, 355, 544, 576, 128, 383, 384, 639,
- 288, 320, 335, 367, 544, 576, 128, 383,
- 384, 639, 288, 320, 333, 365, 544, 576,
- 128, 383, 384, 639, 288, 320, 336, 368,
- 544, 576, 128, 383, 384, 639, 288, 301,
- 320, 544, 576, 128, 383, 384, 639, 288,
- 320, 329, 361, 544, 576, 128, 383, 384,
- 639, 288, 320, 324, 356, 544, 576, 128,
- 383, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 128, 383, 384, 639, 288,
- 320, 325, 357, 544, 576, 128, 383, 384,
- 639, 288, 320, 334, 366, 544, 576, 128,
- 383, 384, 639, 288, 320, 340, 372, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 339, 371, 544, 576, 128,
- 383, 384, 639, 288, 320, 323, 355, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 341, 373, 544, 576, 128,
- 383, 384, 639, 288, 320, 334, 366, 544,
- 576, 128, 383, 384, 639, 288, 301, 320,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 329, 336, 341, 361, 368, 373, 544, 576,
- 128, 383, 384, 639, 288, 320, 336, 368,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 320, 335, 343, 367, 375,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 338, 370, 544, 576, 128, 383, 384, 639,
- 288, 320, 340, 372, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 324, 356, 544, 576, 128, 383, 384, 639,
- 288, 320, 321, 323, 324, 325, 326, 328,
- 329, 332, 335, 336, 338, 339, 340, 344,
- 353, 355, 356, 357, 358, 360, 361, 364,
- 367, 368, 370, 371, 372, 376, 544, 576,
- 128, 383, 384, 639, 288, 320, 339, 371,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 338, 370, 544, 576, 128, 383, 384, 639,
- 288, 320, 321, 323, 324, 325, 326, 328,
- 329, 332, 335, 336, 338, 339, 340, 344,
- 353, 355, 356, 357, 358, 360, 361, 364,
- 367, 368, 370, 371, 372, 376, 544, 576,
- 128, 383, 384, 639, 288, 320, 328, 360,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 588, 620, 128, 383, 384, 639,
- 288, 320, 335, 367, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 353, 544, 576,
- 128, 383, 384, 639, 288, 320, 324, 356,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 320, 339, 371, 544, 576,
- 128, 383, 384, 639, 288, 320, 323, 355,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 326, 358, 544, 576, 128, 383, 384, 639,
- 288, 301, 320, 544, 576, 128, 383, 384,
- 639, 288, 320, 329, 336, 340, 361, 368,
- 372, 544, 576, 128, 383, 384, 639, 288,
- 320, 336, 368, 544, 576, 128, 383, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 128, 383, 384, 639, 288, 320, 335,
- 367, 544, 576, 128, 383, 384, 639, 288,
- 320, 338, 370, 544, 576, 128, 383, 384,
- 639, 288, 320, 340, 372, 544, 576, 128,
- 383, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 128, 383, 384, 639, 288,
- 320, 338, 370, 544, 576, 128, 383, 384,
- 639, 288, 320, 321, 353, 544, 576, 128,
- 383, 384, 639, 288, 320, 334, 366, 544,
- 576, 128, 383, 384, 639, 288, 320, 339,
- 371, 544, 576, 128, 383, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 128,
- 383, 384, 639, 288, 320, 335, 367, 544,
- 576, 128, 383, 384, 639, 288, 320, 338,
- 370, 544, 576, 128, 383, 384, 639, 288,
- 320, 340, 372, 544, 576, 128, 383, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 320, 342, 374, 544, 576, 128,
- 383, 384, 639, 288, 310, 320, 544, 576,
- 128, 383, 384, 639, 288, 320, 321, 323,
- 324, 325, 326, 328, 329, 332, 335, 336,
- 338, 339, 340, 344, 353, 355, 356, 357,
- 358, 360, 361, 364, 367, 368, 370, 371,
- 372, 376, 544, 576, 128, 383, 384, 639,
- 288, 320, 336, 368, 544, 576, 128, 383,
- 384, 639, 288, 320, 329, 361, 544, 576,
- 128, 383, 384, 639, 288, 320, 338, 370,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 325, 357, 544, 576, 128, 383, 384, 639,
- 288, 320, 339, 371, 544, 576, 128, 383,
- 384, 639, 288, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 339, 353, 371, 544, 576, 128, 383,
- 384, 639, 288, 320, 333, 365, 544, 576,
- 128, 383, 384, 639, 288, 320, 325, 357,
- 544, 576, 128, 383, 384, 639, 288, 320,
- 321, 323, 324, 325, 326, 328, 329, 332,
- 335, 336, 338, 339, 340, 344, 353, 355,
- 356, 357, 358, 360, 361, 364, 367, 368,
- 370, 371, 372, 376, 544, 576, 128, 383,
- 384, 639, 288, 301, 320, 544, 576, 128,
- 383, 384, 639, 288, 320, 334, 366, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 353, 544, 576, 128, 383, 384, 639, 288,
- 320, 336, 368, 544, 576, 128, 383, 384,
- 639, 288, 320, 340, 372, 544, 576, 128,
- 383, 384, 639, 288, 320, 338, 370, 544,
- 576, 128, 383, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 128, 383, 384,
- 639, 288, 301, 320, 321, 323, 324, 325,
- 326, 328, 329, 332, 335, 336, 338, 339,
- 340, 344, 353, 355, 356, 357, 358, 360,
- 361, 364, 367, 368, 370, 371, 372, 376,
- 544, 557, 576, 577, 579, 580, 581, 582,
- 584, 585, 588, 591, 592, 594, 595, 596,
- 600, 609, 611, 612, 613, 614, 616, 617,
- 620, 623, 624, 626, 627, 628, 632, 128,
- 383, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 588, 620, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 288, 320, 321, 323, 324, 325, 326,
- 328, 329, 332, 335, 336, 338, 339, 340,
- 344, 353, 355, 356, 357, 358, 360, 361,
- 364, 367, 368, 370, 371, 372, 376, 544,
- 576, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 384, 639, 288, 320, 321,
- 323, 324, 325, 326, 328, 329, 332, 335,
- 336, 338, 339, 340, 344, 353, 355, 356,
- 357, 358, 360, 361, 364, 367, 368, 370,
- 371, 372, 376, 544, 576, 384, 639, 288,
- 320, 321, 323, 324, 325, 326, 328, 329,
- 332, 335, 336, 338, 339, 340, 344, 353,
- 355, 356, 357, 358, 360, 361, 364, 367,
- 368, 370, 371, 372, 376, 544, 576, 384,
- 639, 320, 333, 365, 576, 589, 621, 384,
- 639, 320, 326, 358, 576, 582, 614, 384,
- 639, 320, 321, 353, 576, 577, 609, 384,
- 639, 320, 336, 368, 576, 592, 624, 384,
- 639, 320, 339, 371, 576, 595, 627, 384,
- 639, 320, 328, 334, 360, 366, 576, 584,
- 590, 616, 622, 384, 639, 320, 323, 355,
- 576, 579, 611, 384, 639, 320, 336, 368,
- 576, 592, 624, 384, 639, 320, 342, 374,
- 576, 598, 630, 384, 639, 308, 310, 320,
- 564, 566, 576, 384, 639, 320, 321, 339,
- 353, 371, 576, 577, 595, 609, 627, 384,
- 639, 320, 333, 365, 576, 589, 621, 384,
- 639, 320, 325, 357, 576, 581, 613, 384,
- 639, 301, 320, 557, 576, 384, 639, 320,
- 334, 366, 576, 590, 622, 384, 639, 320,
- 321, 353, 576, 577, 609, 384, 639, 320,
- 336, 368, 576, 592, 624, 384, 639, 320,
- 340, 372, 576, 596, 628, 384, 639, 320,
- 338, 370, 576, 594, 626, 384, 639, 320,
- 342, 344, 374, 376, 576, 598, 600, 630,
- 632, 384, 639, 320, 325, 357, 576, 581,
- 613, 384, 639, 320, 334, 366, 576, 590,
- 622, 384, 639, 320, 340, 372, 576, 596,
- 628, 384, 639, 320, 336, 368, 576, 592,
- 624, 384, 639, 320, 329, 361, 576, 585,
- 617, 384, 639, 320, 338, 370, 576, 594,
- 626, 384, 639, 320, 325, 357, 576, 581,
- 613, 384, 639, 320, 339, 371, 576, 595,
- 627, 384, 639, 320, 338, 370, 576, 594,
- 626, 384, 639, 320, 335, 367, 576, 591,
- 623, 384, 639, 320, 333, 365, 576, 589,
- 621, 384, 639, 320, 325, 357, 576, 581,
- 613, 384, 639, 320, 321, 353, 576, 577,
- 609, 384, 639, 320, 324, 356, 576, 580,
- 612, 384, 639, 320, 325, 357, 576, 581,
- 613, 384, 639, 320, 338, 370, 576, 594,
- 626, 384, 639, 320, 333, 336, 365, 368,
- 576, 589, 592, 621, 624, 384, 639, 320,
- 336, 368, 576, 592, 624, 384, 639, 320,
- 329, 341, 361, 373, 576, 585, 597, 617,
- 629, 384, 639, 320, 342, 374, 576, 598,
- 630, 384, 639, 310, 320, 566, 576, 384,
- 639, 320, 335, 367, 576, 591, 623, 384,
- 639, 320, 323, 355, 576, 579, 611, 384,
- 639, 320, 321, 353, 576, 577, 609, 384,
- 639, 320, 332, 364, 576, 588, 620, 384,
- 639, 301, 320, 557, 576, 384, 639, 320,
- 329, 336, 361, 368, 576, 585, 592, 617,
- 624, 384, 639, 320, 336, 368, 576, 592,
- 624, 384, 639, 320, 335, 367, 576, 591,
- 623, 384, 639, 320, 338, 370, 576, 594,
- 626, 384, 639, 320, 340, 372, 576, 596,
- 628, 384, 639, 320, 336, 368, 576, 592,
- 624, 384, 639, 320, 329, 361, 576, 585,
- 617, 384, 639, 320, 324, 356, 576, 580,
- 612, 384, 639, 320, 321, 323, 343, 353,
- 355, 375, 576, 577, 579, 599, 609, 611,
- 631, 384, 639, 320, 339, 340, 345, 371,
- 372, 377, 576, 595, 596, 601, 627, 628,
- 633, 384, 639, 320, 339, 371, 576, 595,
- 627, 384, 639, 320, 343, 375, 576, 599,
- 631, 384, 639, 320, 335, 367, 576, 591,
- 623, 384, 639, 320, 338, 370, 576, 594,
- 626, 384, 639, 320, 324, 356, 576, 580,
- 612, 384, 639, 320, 328, 360, 576, 584,
- 616, 384, 639, 288, 320, 321, 323, 324,
- 325, 326, 328, 329, 332, 335, 336, 338,
- 339, 340, 344, 353, 355, 356, 357, 358,
- 360, 361, 364, 367, 368, 370, 371, 372,
- 376, 544, 576, 588, 620, 384, 639, 320,
- 335, 367, 576, 591, 623, 384, 639, 320,
- 321, 353, 576, 577, 609, 384, 639, 320,
- 324, 356, 576, 580, 612, 384, 639, 320,
- 339, 371, 576, 595, 627, 384, 639, 320,
- 323, 355, 576, 579, 611, 384, 639, 320,
- 326, 358, 576, 582, 614, 384, 639, 301,
- 320, 557, 576, 384, 639, 320, 329, 336,
- 340, 361, 368, 372, 576, 585, 592, 596,
- 617, 624, 628, 384, 639, 320, 336, 368,
- 576, 592, 624, 384, 639, 320, 335, 367,
- 576, 591, 623, 384, 639, 320, 338, 370,
- 576, 594, 626, 384, 639, 320, 340, 372,
- 576, 596, 628, 384, 639, 320, 338, 370,
- 576, 594, 626, 384, 639, 320, 321, 353,
- 576, 577, 609, 384, 639, 320, 334, 366,
- 576, 590, 622, 384, 639, 320, 339, 371,
- 576, 595, 627, 384, 639, 320, 325, 357,
- 576, 581, 613, 384, 639, 320, 321, 353,
- 576, 577, 609, 384, 639, 320, 332, 364,
- 576, 588, 620, 384, 639, 320, 333, 365,
- 576, 589, 621, 384, 639, 320, 325, 329,
- 333, 340, 357, 361, 365, 372, 576, 581,
- 585, 589, 596, 613, 617, 621, 628, 384,
- 639, 320, 323, 355, 576, 579, 611, 384,
- 639, 320, 324, 327, 332, 356, 359, 364,
- 576, 580, 583, 588, 612, 615, 620, 384,
- 639, 320, 323, 355, 576, 579, 611, 384,
- 639, 320, 335, 367, 576, 591, 623, 384,
- 639, 320, 333, 365, 576, 589, 621, 384,
- 639, 320, 336, 368, 576, 592, 624, 384,
- 639, 301, 320, 557, 576, 384, 639, 320,
- 329, 361, 576, 585, 617, 384, 639, 320,
- 324, 356, 576, 580, 612, 384, 639, 320,
- 325, 357, 576, 581, 613, 384, 639, 320,
- 334, 366, 576, 590, 622, 384, 639, 320,
- 340, 372, 576, 596, 628, 384, 639, 320,
- 339, 371, 576, 595, 627, 384, 639, 320,
- 323, 355, 576, 579, 611, 384, 639, 320,
- 341, 373, 576, 597, 629, 384, 639, 320,
- 334, 366, 576, 590, 622, 384, 639, 301,
- 320, 557, 576, 384, 639, 320, 329, 336,
- 341, 361, 368, 373, 576, 585, 592, 597,
- 617, 624, 629, 384, 639, 320, 336, 368,
- 576, 592, 624, 384, 639, 320, 335, 343,
- 367, 375, 576, 591, 599, 623, 631, 384,
- 639, 320, 338, 370, 576, 594, 626, 384,
- 639, 320, 340, 372, 576, 596, 628, 384,
- 639, 320, 324, 356, 576, 580, 612, 384,
- 639, 320, 339, 371, 576, 595, 627, 384,
- 639, 320, 338, 370, 576, 594, 626, 384,
- 639, 320, 335, 367, 576, 591, 623, 384,
- 639, 320, 336, 368, 576, 592, 624, 384,
- 639, 296, 297, 318, 552, 553, 574, 384,
- 639, 297, 553, 384, 639, 297, 553, 384,
- 639, 0
-};
+ static const char _demo_machine_parser_cmd_single_lengths[] = {
+ 0, 1, 4, 2, 1, 4, 2, 2,
+ 2, 2, 1, 2, 4, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 4,
+ 2, 2, 2, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 4, 2, 2, 2, 2, 12,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 4, 2,
+ 2, 2, 2, 2, 2, 2, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 6, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 4, 2,
+ 2, 2, 2, 4, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 4,
+ 2, 4, 2, 2, 2, 2, 1, 4,
+ 2, 2, 2, 2, 6, 6, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 8,
+ 2, 2, 2, 6, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 1, 6, 2, 4, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 1, 6, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 4, 2,
+ 2, 1, 2, 2, 2, 2, 2, 1,
+ 5, 0, 0, 2, 0, 29, 0, 29,
+ 30, 4, 2, 2, 2, 2, 1, 2,
+ 4, 2, 2, 2, 2, 2, 28, 32,
+ 30, 2, 28, 30, 30, 2, 2, 2,
+ 2, 28, 4, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 28, 28,
+ 2, 2, 2, 2, 2, 28, 2, 2,
+ 30, 2, 2, 2, 28, 2, 2, 28,
+ 2, 2, 2, 28, 30, 30, 4, 30,
+ 2, 2, 2, 2, 28, 12, 2, 2,
+ 2, 2, 2, 2, 28, 30, 2, 2,
+ 2, 28, 2, 2, 2, 28, 2, 28,
+ 2, 2, 28, 2, 28, 2, 2, 2,
+ 2, 2, 28, 30, 2, 2, 28, 2,
+ 28, 2, 2, 28, 2, 2, 28, 28,
+ 2, 28, 2, 2, 28, 2, 2, 28,
+ 2, 2, 28, 2, 2, 2, 28, 4,
+ 2, 2, 2, 28, 2, 2, 2, 2,
+ 28, 30, 28, 32, 30, 28, 30, 30,
+ 28, 28, 28, 28, 30, 28, 28, 28,
+ 30, 30, 30, 28, 28, 30, 28, 28,
+ 28, 28, 28, 28, 30, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 62, 4, 4, 8, 1, 1, 8,
+ 9, 3, 3, 3, 3, 7, 9, 3,
+ 3, 3, 3, 3, 7, 3, 3, 3,
+ 3, 3, 7, 7, 3, 3, 7, 9,
+ 7, 9, 7, 7, 7, 2, 2, 16,
+ 4, 2, 4, 4, 16, 20, 8, 8,
+ 8, 8, 16, 20, 8, 8, 8, 8,
+ 8, 16, 8, 8, 8, 8, 8, 16,
+ 16, 8, 8, 16, 20, 6, 6, 6,
+ 6, 16, 20, 6, 6, 6, 6, 6,
+ 14, 6, 6, 6, 6, 6, 16, 16,
+ 6, 6, 16, 44, 6, 6, 32, 6,
+ 6, 6, 32, 8, 6, 6, 6, 6,
+ 32, 8, 6, 6, 6, 32, 6, 6,
+ 6, 32, 6, 6, 6, 6, 6, 32,
+ 8, 6, 8, 32, 6, 6, 6, 6,
+ 5, 8, 6, 32, 6, 6, 6, 32,
+ 10, 10, 6, 6, 6, 6, 6, 32,
+ 6, 6, 6, 6, 32, 12, 6, 32,
+ 6, 32, 6, 32, 10, 32, 6, 6,
+ 6, 6, 5, 6, 6, 32, 6, 6,
+ 6, 32, 6, 6, 32, 6, 6, 5,
+ 10, 6, 32, 8, 6, 6, 32, 6,
+ 32, 6, 6, 32, 6, 32, 34, 6,
+ 6, 6, 32, 6, 6, 6, 5, 10,
+ 6, 32, 6, 6, 6, 32, 6, 6,
+ 6, 6, 32, 6, 6, 6, 32, 32,
+ 6, 5, 32, 6, 6, 6, 6, 6,
+ 32, 8, 6, 6, 32, 5, 6, 6,
+ 6, 6, 6, 32, 62, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 34, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 6,
+ 6, 6, 6, 6, 10, 6, 6, 6,
+ 6, 10, 6, 6, 4, 6, 6, 6,
+ 6, 6, 10, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 10, 6, 10, 6, 4,
+ 6, 6, 6, 6, 4, 10, 6, 6,
+ 6, 6, 6, 6, 6, 14, 14, 6,
+ 6, 6, 6, 6, 6, 34, 6, 6,
+ 6, 6, 6, 6, 4, 14, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 18, 6, 14, 6, 6, 6,
+ 6, 4, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 4, 14, 6, 10, 6,
+ 6, 6, 6, 6, 6, 6, 6, 2,
+ 2
+ };
-static const char _demo_machine_parser_cmd_single_lengths[] = {
- 0, 1, 4, 2, 1, 4, 2, 2,
- 2, 2, 1, 2, 4, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 4,
- 2, 2, 2, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 4, 2, 2, 2, 2, 12,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 4, 2,
- 2, 2, 2, 2, 2, 2, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 6, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 4, 2,
- 2, 2, 2, 4, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 4,
- 2, 4, 2, 2, 2, 2, 1, 4,
- 2, 2, 2, 2, 6, 6, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 8,
- 2, 2, 2, 6, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 1, 6, 2, 4, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 1, 6, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 4, 2,
- 2, 1, 2, 2, 2, 2, 2, 1,
- 5, 0, 0, 2, 0, 29, 0, 29,
- 30, 4, 2, 2, 2, 2, 1, 2,
- 4, 2, 2, 2, 2, 2, 28, 32,
- 30, 2, 28, 30, 30, 2, 2, 2,
- 2, 28, 4, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 28, 28,
- 2, 2, 2, 2, 2, 28, 2, 2,
- 30, 2, 2, 2, 28, 2, 2, 28,
- 2, 2, 2, 28, 30, 30, 4, 30,
- 2, 2, 2, 2, 28, 12, 2, 2,
- 2, 2, 2, 2, 28, 30, 2, 2,
- 2, 28, 2, 2, 2, 28, 2, 28,
- 2, 2, 28, 2, 28, 2, 2, 2,
- 2, 2, 28, 30, 2, 2, 28, 2,
- 28, 2, 2, 28, 2, 2, 28, 28,
- 2, 28, 2, 2, 28, 2, 2, 28,
- 2, 2, 28, 2, 2, 2, 28, 4,
- 2, 2, 2, 28, 2, 2, 2, 2,
- 28, 30, 28, 32, 30, 28, 30, 30,
- 28, 28, 28, 28, 30, 28, 28, 28,
- 30, 30, 30, 28, 28, 30, 28, 28,
- 28, 28, 28, 28, 30, 28, 28, 28,
- 28, 28, 28, 28, 28, 28, 28, 28,
- 28, 62, 4, 4, 8, 1, 1, 8,
- 9, 3, 3, 3, 3, 7, 9, 3,
- 3, 3, 3, 3, 7, 3, 3, 3,
- 3, 3, 7, 7, 3, 3, 7, 9,
- 7, 9, 7, 7, 7, 2, 2, 16,
- 4, 2, 4, 4, 16, 20, 8, 8,
- 8, 8, 16, 20, 8, 8, 8, 8,
- 8, 16, 8, 8, 8, 8, 8, 16,
- 16, 8, 8, 16, 20, 6, 6, 6,
- 6, 16, 20, 6, 6, 6, 6, 6,
- 14, 6, 6, 6, 6, 6, 16, 16,
- 6, 6, 16, 44, 6, 6, 32, 6,
- 6, 6, 32, 8, 6, 6, 6, 6,
- 32, 8, 6, 6, 6, 32, 6, 6,
- 6, 32, 6, 6, 6, 6, 6, 32,
- 8, 6, 8, 32, 6, 6, 6, 6,
- 5, 8, 6, 32, 6, 6, 6, 32,
- 10, 10, 6, 6, 6, 6, 6, 32,
- 6, 6, 6, 6, 32, 12, 6, 32,
- 6, 32, 6, 32, 10, 32, 6, 6,
- 6, 6, 5, 6, 6, 32, 6, 6,
- 6, 32, 6, 6, 32, 6, 6, 5,
- 10, 6, 32, 8, 6, 6, 32, 6,
- 32, 6, 6, 32, 6, 32, 34, 6,
- 6, 6, 32, 6, 6, 6, 5, 10,
- 6, 32, 6, 6, 6, 32, 6, 6,
- 6, 6, 32, 6, 6, 6, 32, 32,
- 6, 5, 32, 6, 6, 6, 6, 6,
- 32, 8, 6, 6, 32, 5, 6, 6,
- 6, 6, 6, 32, 62, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 34, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 6,
- 6, 6, 6, 6, 10, 6, 6, 6,
- 6, 10, 6, 6, 4, 6, 6, 6,
- 6, 6, 10, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 10, 6, 10, 6, 4,
- 6, 6, 6, 6, 4, 10, 6, 6,
- 6, 6, 6, 6, 6, 14, 14, 6,
- 6, 6, 6, 6, 6, 34, 6, 6,
- 6, 6, 6, 6, 4, 14, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 18, 6, 14, 6, 6, 6,
- 6, 4, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 4, 14, 6, 10, 6,
- 6, 6, 6, 6, 6, 6, 6, 2,
- 2
-};
+ static const char _demo_machine_parser_cmd_range_lengths[] = {
+ 0, 0, 4, 4, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 4, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 6,
+ 6, 1, 4, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 4, 1, 1, 1,
+ 1, 4, 4, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 4, 4,
+ 1, 1, 4, 10, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1
+ };
-static const char _demo_machine_parser_cmd_range_lengths[] = {
- 0, 0, 4, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 4, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 6,
- 6, 1, 4, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 4, 1, 1, 1,
- 1, 4, 4, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 4, 4,
- 1, 1, 4, 10, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-};
+ static const short _demo_machine_parser_cmd_index_offsets[] = {
+ 0, 0, 2, 11, 18, 20, 25, 28,
+ 31, 34, 37, 39, 42, 47, 50, 53,
+ 56, 59, 62, 65, 68, 71, 74, 77,
+ 82, 85, 88, 91, 93, 96, 99, 102,
+ 105, 108, 111, 114, 117, 120, 123, 126,
+ 129, 132, 135, 138, 141, 144, 147, 150,
+ 153, 156, 159, 164, 167, 170, 173, 176,
+ 189, 192, 195, 198, 201, 204, 207, 210,
+ 213, 216, 219, 222, 225, 228, 231, 234,
+ 237, 240, 243, 246, 249, 252, 255, 258,
+ 261, 264, 267, 270, 273, 276, 279, 282,
+ 285, 288, 291, 294, 297, 300, 303, 308,
+ 311, 314, 317, 320, 323, 326, 329, 331,
+ 333, 336, 339, 342, 345, 348, 351, 354,
+ 357, 360, 367, 370, 373, 376, 379, 382,
+ 385, 388, 391, 394, 397, 400, 403, 408,
+ 411, 414, 417, 420, 425, 428, 431, 434,
+ 437, 440, 443, 446, 449, 452, 455, 458,
+ 463, 466, 471, 474, 477, 480, 483, 485,
+ 490, 493, 496, 499, 502, 509, 516, 519,
+ 522, 525, 528, 531, 534, 537, 540, 543,
+ 552, 555, 558, 561, 568, 571, 574, 577,
+ 580, 582, 585, 588, 591, 594, 597, 600,
+ 603, 606, 609, 611, 618, 621, 626, 629,
+ 632, 635, 638, 641, 644, 647, 650, 653,
+ 656, 659, 662, 664, 671, 674, 677, 680,
+ 683, 686, 689, 692, 695, 698, 701, 704,
+ 707, 709, 712, 715, 718, 721, 724, 729,
+ 732, 735, 737, 740, 743, 746, 749, 752,
+ 754, 760, 762, 764, 771, 773, 803, 804,
+ 834, 865, 870, 873, 876, 879, 882, 884,
+ 887, 892, 895, 898, 901, 904, 907, 936,
+ 969, 1000, 1003, 1032, 1063, 1094, 1097, 1100,
+ 1103, 1106, 1135, 1140, 1143, 1146, 1149, 1151,
+ 1154, 1157, 1160, 1163, 1166, 1169, 1172, 1201,
+ 1230, 1233, 1236, 1239, 1242, 1245, 1274, 1277,
+ 1280, 1311, 1314, 1317, 1320, 1349, 1352, 1355,
+ 1384, 1387, 1390, 1393, 1422, 1453, 1484, 1489,
+ 1520, 1523, 1526, 1529, 1532, 1561, 1574, 1577,
+ 1580, 1583, 1586, 1589, 1592, 1621, 1652, 1655,
+ 1658, 1661, 1690, 1693, 1696, 1699, 1728, 1731,
+ 1760, 1763, 1766, 1795, 1798, 1827, 1830, 1833,
+ 1836, 1839, 1842, 1871, 1902, 1905, 1908, 1937,
+ 1940, 1969, 1972, 1975, 2004, 2007, 2010, 2039,
+ 2068, 2071, 2100, 2103, 2106, 2135, 2138, 2141,
+ 2170, 2173, 2176, 2205, 2208, 2211, 2214, 2243,
+ 2248, 2251, 2254, 2257, 2286, 2289, 2292, 2295,
+ 2298, 2327, 2358, 2387, 2420, 2451, 2480, 2511,
+ 2542, 2571, 2600, 2629, 2658, 2689, 2718, 2747,
+ 2776, 2807, 2838, 2869, 2898, 2927, 2958, 2987,
+ 3016, 3045, 3074, 3103, 3132, 3163, 3192, 3221,
+ 3250, 3279, 3308, 3337, 3366, 3395, 3424, 3453,
+ 3482, 3511, 3576, 3583, 3589, 3599, 3602, 3605,
+ 3615, 3626, 3631, 3636, 3641, 3646, 3655, 3666,
+ 3671, 3676, 3681, 3686, 3691, 3700, 3705, 3710,
+ 3715, 3720, 3725, 3734, 3743, 3748, 3753, 3762,
+ 3773, 3782, 3793, 3802, 3811, 3820, 3824, 3828,
+ 3851, 3862, 3866, 3875, 3886, 3909, 3936, 3951,
+ 3966, 3981, 3996, 4019, 4046, 4061, 4076, 4091,
+ 4106, 4121, 4144, 4159, 4174, 4189, 4204, 4219,
+ 4242, 4265, 4280, 4295, 4318, 4343, 4351, 4359,
+ 4367, 4375, 4396, 4421, 4429, 4437, 4445, 4453,
+ 4461, 4477, 4485, 4493, 4501, 4509, 4517, 4538,
+ 4559, 4567, 4575, 4596, 4651, 4660, 4669, 4704,
+ 4713, 4722, 4731, 4766, 4777, 4786, 4795, 4804,
+ 4813, 4848, 4859, 4868, 4877, 4886, 4921, 4930,
+ 4939, 4948, 4983, 4992, 5001, 5010, 5019, 5028,
+ 5063, 5074, 5083, 5094, 5129, 5138, 5147, 5156,
+ 5165, 5173, 5184, 5193, 5228, 5237, 5246, 5255,
+ 5290, 5303, 5316, 5325, 5334, 5343, 5352, 5361,
+ 5396, 5405, 5414, 5423, 5432, 5467, 5482, 5491,
+ 5526, 5535, 5570, 5579, 5614, 5627, 5662, 5671,
+ 5680, 5689, 5698, 5706, 5715, 5724, 5759, 5768,
+ 5777, 5786, 5821, 5830, 5839, 5874, 5883, 5892,
+ 5900, 5913, 5922, 5957, 5968, 5977, 5986, 6021,
+ 6030, 6065, 6074, 6083, 6118, 6127, 6162, 6199,
+ 6208, 6217, 6226, 6261, 6270, 6279, 6288, 6296,
+ 6309, 6318, 6353, 6362, 6371, 6380, 6415, 6424,
+ 6433, 6442, 6451, 6486, 6495, 6504, 6513, 6548,
+ 6583, 6592, 6600, 6635, 6644, 6653, 6662, 6671,
+ 6680, 6715, 6726, 6735, 6744, 6779, 6787, 6796,
+ 6805, 6814, 6823, 6832, 6867, 6932, 6966, 7000,
+ 7034, 7068, 7102, 7136, 7170, 7204, 7238, 7272,
+ 7306, 7340, 7374, 7408, 7442, 7476, 7510, 7544,
+ 7578, 7612, 7646, 7680, 7714, 7750, 7784, 7818,
+ 7852, 7886, 7920, 7954, 7988, 8022, 8056, 8090,
+ 8098, 8106, 8114, 8122, 8130, 8142, 8150, 8158,
+ 8166, 8174, 8186, 8194, 8202, 8208, 8216, 8224,
+ 8232, 8240, 8248, 8260, 8268, 8276, 8284, 8292,
+ 8300, 8308, 8316, 8324, 8332, 8340, 8348, 8356,
+ 8364, 8372, 8380, 8388, 8400, 8408, 8420, 8428,
+ 8434, 8442, 8450, 8458, 8466, 8472, 8484, 8492,
+ 8500, 8508, 8516, 8524, 8532, 8540, 8556, 8572,
+ 8580, 8588, 8596, 8604, 8612, 8620, 8656, 8664,
+ 8672, 8680, 8688, 8696, 8704, 8710, 8726, 8734,
+ 8742, 8750, 8758, 8766, 8774, 8782, 8790, 8798,
+ 8806, 8814, 8822, 8842, 8850, 8866, 8874, 8882,
+ 8890, 8898, 8904, 8912, 8920, 8928, 8936, 8944,
+ 8952, 8960, 8968, 8976, 8982, 8998, 9006, 9018,
+ 9026, 9034, 9042, 9050, 9058, 9066, 9074, 9082,
+ 9086
+ };
-static const short _demo_machine_parser_cmd_index_offsets[] = {
- 0, 0, 2, 11, 18, 20, 25, 28,
- 31, 34, 37, 39, 42, 47, 50, 53,
- 56, 59, 62, 65, 68, 71, 74, 77,
- 82, 85, 88, 91, 93, 96, 99, 102,
- 105, 108, 111, 114, 117, 120, 123, 126,
- 129, 132, 135, 138, 141, 144, 147, 150,
- 153, 156, 159, 164, 167, 170, 173, 176,
- 189, 192, 195, 198, 201, 204, 207, 210,
- 213, 216, 219, 222, 225, 228, 231, 234,
- 237, 240, 243, 246, 249, 252, 255, 258,
- 261, 264, 267, 270, 273, 276, 279, 282,
- 285, 288, 291, 294, 297, 300, 303, 308,
- 311, 314, 317, 320, 323, 326, 329, 331,
- 333, 336, 339, 342, 345, 348, 351, 354,
- 357, 360, 367, 370, 373, 376, 379, 382,
- 385, 388, 391, 394, 397, 400, 403, 408,
- 411, 414, 417, 420, 425, 428, 431, 434,
- 437, 440, 443, 446, 449, 452, 455, 458,
- 463, 466, 471, 474, 477, 480, 483, 485,
- 490, 493, 496, 499, 502, 509, 516, 519,
- 522, 525, 528, 531, 534, 537, 540, 543,
- 552, 555, 558, 561, 568, 571, 574, 577,
- 580, 582, 585, 588, 591, 594, 597, 600,
- 603, 606, 609, 611, 618, 621, 626, 629,
- 632, 635, 638, 641, 644, 647, 650, 653,
- 656, 659, 662, 664, 671, 674, 677, 680,
- 683, 686, 689, 692, 695, 698, 701, 704,
- 707, 709, 712, 715, 718, 721, 724, 729,
- 732, 735, 737, 740, 743, 746, 749, 752,
- 754, 760, 762, 764, 771, 773, 803, 804,
- 834, 865, 870, 873, 876, 879, 882, 884,
- 887, 892, 895, 898, 901, 904, 907, 936,
- 969, 1000, 1003, 1032, 1063, 1094, 1097, 1100,
- 1103, 1106, 1135, 1140, 1143, 1146, 1149, 1151,
- 1154, 1157, 1160, 1163, 1166, 1169, 1172, 1201,
- 1230, 1233, 1236, 1239, 1242, 1245, 1274, 1277,
- 1280, 1311, 1314, 1317, 1320, 1349, 1352, 1355,
- 1384, 1387, 1390, 1393, 1422, 1453, 1484, 1489,
- 1520, 1523, 1526, 1529, 1532, 1561, 1574, 1577,
- 1580, 1583, 1586, 1589, 1592, 1621, 1652, 1655,
- 1658, 1661, 1690, 1693, 1696, 1699, 1728, 1731,
- 1760, 1763, 1766, 1795, 1798, 1827, 1830, 1833,
- 1836, 1839, 1842, 1871, 1902, 1905, 1908, 1937,
- 1940, 1969, 1972, 1975, 2004, 2007, 2010, 2039,
- 2068, 2071, 2100, 2103, 2106, 2135, 2138, 2141,
- 2170, 2173, 2176, 2205, 2208, 2211, 2214, 2243,
- 2248, 2251, 2254, 2257, 2286, 2289, 2292, 2295,
- 2298, 2327, 2358, 2387, 2420, 2451, 2480, 2511,
- 2542, 2571, 2600, 2629, 2658, 2689, 2718, 2747,
- 2776, 2807, 2838, 2869, 2898, 2927, 2958, 2987,
- 3016, 3045, 3074, 3103, 3132, 3163, 3192, 3221,
- 3250, 3279, 3308, 3337, 3366, 3395, 3424, 3453,
- 3482, 3511, 3576, 3583, 3589, 3599, 3602, 3605,
- 3615, 3626, 3631, 3636, 3641, 3646, 3655, 3666,
- 3671, 3676, 3681, 3686, 3691, 3700, 3705, 3710,
- 3715, 3720, 3725, 3734, 3743, 3748, 3753, 3762,
- 3773, 3782, 3793, 3802, 3811, 3820, 3824, 3828,
- 3851, 3862, 3866, 3875, 3886, 3909, 3936, 3951,
- 3966, 3981, 3996, 4019, 4046, 4061, 4076, 4091,
- 4106, 4121, 4144, 4159, 4174, 4189, 4204, 4219,
- 4242, 4265, 4280, 4295, 4318, 4343, 4351, 4359,
- 4367, 4375, 4396, 4421, 4429, 4437, 4445, 4453,
- 4461, 4477, 4485, 4493, 4501, 4509, 4517, 4538,
- 4559, 4567, 4575, 4596, 4651, 4660, 4669, 4704,
- 4713, 4722, 4731, 4766, 4777, 4786, 4795, 4804,
- 4813, 4848, 4859, 4868, 4877, 4886, 4921, 4930,
- 4939, 4948, 4983, 4992, 5001, 5010, 5019, 5028,
- 5063, 5074, 5083, 5094, 5129, 5138, 5147, 5156,
- 5165, 5173, 5184, 5193, 5228, 5237, 5246, 5255,
- 5290, 5303, 5316, 5325, 5334, 5343, 5352, 5361,
- 5396, 5405, 5414, 5423, 5432, 5467, 5482, 5491,
- 5526, 5535, 5570, 5579, 5614, 5627, 5662, 5671,
- 5680, 5689, 5698, 5706, 5715, 5724, 5759, 5768,
- 5777, 5786, 5821, 5830, 5839, 5874, 5883, 5892,
- 5900, 5913, 5922, 5957, 5968, 5977, 5986, 6021,
- 6030, 6065, 6074, 6083, 6118, 6127, 6162, 6199,
- 6208, 6217, 6226, 6261, 6270, 6279, 6288, 6296,
- 6309, 6318, 6353, 6362, 6371, 6380, 6415, 6424,
- 6433, 6442, 6451, 6486, 6495, 6504, 6513, 6548,
- 6583, 6592, 6600, 6635, 6644, 6653, 6662, 6671,
- 6680, 6715, 6726, 6735, 6744, 6779, 6787, 6796,
- 6805, 6814, 6823, 6832, 6867, 6932, 6966, 7000,
- 7034, 7068, 7102, 7136, 7170, 7204, 7238, 7272,
- 7306, 7340, 7374, 7408, 7442, 7476, 7510, 7544,
- 7578, 7612, 7646, 7680, 7714, 7750, 7784, 7818,
- 7852, 7886, 7920, 7954, 7988, 8022, 8056, 8090,
- 8098, 8106, 8114, 8122, 8130, 8142, 8150, 8158,
- 8166, 8174, 8186, 8194, 8202, 8208, 8216, 8224,
- 8232, 8240, 8248, 8260, 8268, 8276, 8284, 8292,
- 8300, 8308, 8316, 8324, 8332, 8340, 8348, 8356,
- 8364, 8372, 8380, 8388, 8400, 8408, 8420, 8428,
- 8434, 8442, 8450, 8458, 8466, 8472, 8484, 8492,
- 8500, 8508, 8516, 8524, 8532, 8540, 8556, 8572,
- 8580, 8588, 8596, 8604, 8612, 8620, 8656, 8664,
- 8672, 8680, 8688, 8696, 8704, 8710, 8726, 8734,
- 8742, 8750, 8758, 8766, 8774, 8782, 8790, 8798,
- 8806, 8814, 8822, 8842, 8850, 8866, 8874, 8882,
- 8890, 8898, 8904, 8912, 8920, 8928, 8936, 8944,
- 8952, 8960, 8968, 8976, 8982, 8998, 9006, 9018,
- 9026, 9034, 9042, 9050, 9058, 9066, 9074, 9082,
- 9086
-};
+ static const short _demo_machine_parser_cmd_indicies[] = {
+ 0, 1, 2, 0, 2, 4, 2, 3,
+ 2, 3, 1, 5, 5, 5, 6, 5,
+ 6, 1, 7, 1, 9, 10, 9, 10,
+ 8, 11, 11, 8, 12, 12, 8, 13,
+ 13, 8, 14, 14, 8, 15, 8, 16,
+ 16, 8, 17, 18, 17, 18, 8, 19,
+ 19, 8, 20, 20, 8, 21, 21, 8,
+ 22, 22, 8, 23, 23, 8, 24, 24,
+ 8, 25, 25, 8, 26, 26, 8, 27,
+ 27, 8, 28, 28, 8, 29, 30, 29,
+ 30, 8, 31, 31, 8, 32, 32, 8,
+ 33, 33, 8, 34, 8, 35, 35, 8,
+ 36, 36, 8, 37, 37, 8, 38, 38,
+ 8, 39, 39, 8, 40, 40, 8, 30,
+ 30, 8, 41, 41, 8, 42, 42, 8,
+ 43, 43, 8, 44, 44, 8, 45, 45,
+ 8, 46, 46, 8, 47, 47, 8, 48,
+ 48, 8, 49, 49, 8, 50, 50, 8,
+ 51, 51, 8, 52, 52, 8, 53, 53,
+ 8, 54, 54, 8, 55, 55, 8, 56,
+ 57, 56, 57, 8, 58, 58, 8, 59,
+ 59, 8, 60, 60, 8, 61, 61, 8,
+ 62, 63, 64, 65, 66, 67, 62, 63,
+ 64, 65, 66, 67, 8, 68, 68, 8,
+ 69, 69, 8, 70, 70, 8, 71, 71,
+ 8, 72, 72, 8, 65, 65, 8, 73,
+ 73, 8, 74, 74, 8, 75, 75, 8,
+ 76, 76, 8, 77, 77, 8, 78, 78,
+ 8, 79, 79, 8, 80, 80, 8, 81,
+ 81, 8, 82, 82, 8, 83, 83, 8,
+ 84, 84, 8, 85, 85, 8, 86, 86,
+ 8, 87, 87, 8, 88, 88, 8, 89,
+ 89, 8, 90, 90, 8, 91, 91, 8,
+ 92, 92, 8, 93, 93, 8, 94, 94,
+ 8, 95, 95, 8, 96, 96, 8, 97,
+ 97, 8, 98, 98, 8, 99, 99, 8,
+ 100, 100, 8, 101, 101, 8, 102, 102,
+ 8, 103, 103, 8, 104, 104, 8, 23,
+ 104, 23, 104, 8, 105, 105, 8, 106,
+ 106, 8, 107, 107, 8, 108, 108, 8,
+ 109, 109, 8, 110, 110, 8, 111, 111,
+ 8, 112, 1, 114, 113, 115, 115, 113,
+ 116, 116, 113, 117, 117, 113, 118, 118,
+ 113, 119, 119, 113, 120, 120, 113, 121,
+ 121, 113, 122, 122, 113, 118, 118, 113,
+ 123, 124, 125, 123, 124, 125, 113, 126,
+ 126, 113, 127, 127, 113, 128, 128, 113,
+ 129, 129, 113, 124, 124, 113, 130, 130,
+ 113, 131, 131, 113, 132, 132, 113, 133,
+ 133, 113, 134, 134, 113, 135, 135, 113,
+ 136, 136, 113, 137, 138, 137, 138, 113,
+ 139, 139, 113, 140, 140, 113, 141, 141,
+ 113, 142, 143, 113, 144, 145, 144, 145,
+ 113, 146, 146, 113, 147, 147, 113, 148,
+ 148, 113, 149, 149, 113, 150, 150, 113,
+ 151, 151, 113, 152, 152, 113, 153, 153,
+ 113, 154, 154, 113, 155, 155, 113, 156,
+ 156, 113, 157, 158, 157, 158, 113, 159,
+ 159, 113, 160, 161, 160, 161, 113, 162,
+ 162, 113, 163, 163, 113, 164, 164, 113,
+ 165, 165, 113, 166, 113, 167, 168, 167,
+ 168, 113, 169, 169, 113, 170, 170, 113,
+ 171, 171, 113, 172, 172, 113, 173, 174,
+ 175, 173, 174, 175, 113, 176, 177, 178,
+ 176, 177, 178, 113, 179, 179, 113, 180,
+ 180, 113, 181, 181, 113, 175, 175, 113,
+ 182, 182, 113, 183, 183, 113, 184, 184,
+ 113, 185, 185, 113, 186, 186, 113, 187,
+ 188, 189, 190, 187, 188, 189, 190, 113,
+ 191, 191, 113, 192, 192, 113, 193, 193,
+ 113, 194, 195, 196, 194, 195, 196, 113,
+ 197, 197, 113, 198, 198, 113, 199, 199,
+ 113, 200, 200, 113, 201, 113, 202, 202,
+ 113, 203, 203, 113, 204, 204, 113, 205,
+ 205, 113, 206, 206, 113, 207, 207, 113,
+ 208, 208, 113, 209, 209, 113, 210, 210,
+ 113, 211, 113, 212, 213, 214, 212, 213,
+ 214, 113, 215, 215, 113, 216, 217, 216,
+ 217, 113, 218, 218, 113, 219, 219, 113,
+ 220, 220, 113, 221, 221, 113, 222, 222,
+ 113, 223, 223, 113, 224, 224, 113, 225,
+ 225, 113, 226, 226, 113, 227, 227, 113,
+ 228, 228, 113, 229, 229, 113, 230, 113,
+ 231, 232, 233, 231, 232, 233, 113, 234,
+ 234, 113, 235, 235, 113, 236, 236, 113,
+ 237, 237, 113, 238, 238, 113, 239, 239,
+ 113, 240, 240, 113, 241, 241, 113, 242,
+ 242, 113, 243, 243, 113, 244, 244, 113,
+ 245, 245, 113, 246, 113, 247, 247, 113,
+ 248, 248, 113, 249, 249, 113, 250, 250,
+ 113, 193, 193, 113, 251, 252, 251, 252,
+ 113, 253, 253, 113, 254, 254, 113, 255,
+ 113, 256, 256, 113, 257, 257, 113, 258,
+ 258, 113, 259, 259, 113, 260, 260, 113,
+ 261, 1, 263, 264, 265, 266, 267, 262,
+ 269, 268, 271, 270, 273, 273, 273, 274,
+ 273, 274, 272, 276, 275, 279, 280, 281,
+ 282, 283, 284, 285, 286, 287, 288, 289,
+ 290, 291, 292, 293, 280, 281, 282, 283,
+ 284, 285, 286, 287, 288, 289, 290, 291,
+ 292, 293, 278, 295, 279, 296, 297, 298,
+ 299, 300, 301, 302, 303, 304, 305, 306,
+ 307, 308, 309, 296, 297, 298, 299, 300,
+ 301, 302, 303, 304, 305, 306, 307, 308,
+ 309, 278, 311, 312, 313, 314, 315, 316,
+ 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 311, 312, 313, 314, 315, 316, 317,
+ 318, 319, 320, 321, 322, 323, 324, 325,
+ 295, 326, 327, 326, 327, 295, 328, 328,
+ 295, 329, 329, 295, 330, 330, 295, 331,
+ 331, 295, 332, 295, 333, 333, 295, 334,
+ 335, 334, 335, 295, 336, 336, 295, 337,
+ 337, 295, 338, 338, 295, 339, 339, 295,
+ 340, 340, 295, 342, 343, 344, 345, 346,
+ 347, 348, 349, 350, 351, 352, 353, 354,
+ 355, 342, 343, 344, 345, 346, 347, 348,
+ 349, 350, 351, 352, 353, 354, 355, 295,
+ 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372,
+ 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372,
+ 295, 374, 375, 376, 377, 378, 379, 380,
+ 381, 382, 383, 384, 385, 386, 387, 388,
+ 374, 375, 376, 377, 378, 379, 380, 381,
+ 382, 383, 384, 385, 386, 387, 388, 295,
+ 389, 389, 295, 391, 392, 393, 394, 395,
+ 396, 397, 398, 399, 400, 401, 402, 403,
+ 404, 391, 392, 393, 394, 395, 396, 397,
+ 398, 399, 400, 401, 402, 403, 404, 295,
+ 406, 407, 408, 409, 410, 411, 412, 413,
+ 414, 415, 416, 417, 418, 419, 420, 406,
+ 407, 408, 409, 410, 411, 412, 413, 414,
+ 415, 416, 417, 418, 419, 420, 295, 422,
+ 423, 424, 425, 426, 427, 428, 429, 430,
+ 431, 432, 433, 434, 435, 436, 422, 423,
+ 424, 425, 426, 427, 428, 429, 430, 431,
+ 432, 433, 434, 435, 436, 295, 437, 437,
+ 295, 438, 438, 295, 439, 439, 295, 435,
+ 435, 295, 441, 442, 443, 444, 445, 446,
+ 447, 448, 449, 450, 451, 452, 453, 454,
+ 441, 442, 443, 444, 445, 446, 447, 448,
+ 449, 450, 451, 452, 453, 454, 295, 455,
+ 456, 455, 456, 295, 457, 457, 295, 458,
+ 458, 295, 459, 459, 295, 460, 295, 461,
+ 461, 295, 462, 462, 295, 463, 463, 295,
+ 464, 464, 295, 465, 465, 295, 466, 466,
+ 295, 456, 456, 295, 468, 469, 470, 471,
+ 472, 473, 474, 475, 476, 477, 478, 479,
+ 480, 481, 468, 469, 470, 471, 472, 473,
+ 474, 475, 476, 477, 478, 479, 480, 481,
+ 295, 483, 484, 485, 486, 487, 488, 489,
+ 490, 491, 492, 493, 494, 495, 496, 483,
+ 484, 485, 486, 487, 488, 489, 490, 491,
+ 492, 493, 494, 495, 496, 295, 497, 497,
+ 295, 498, 498, 295, 499, 499, 295, 500,
+ 500, 295, 501, 501, 295, 483, 484, 485,
+ 502, 487, 488, 489, 490, 491, 492, 493,
+ 494, 495, 496, 483, 484, 485, 502, 487,
+ 488, 489, 490, 491, 492, 493, 494, 495,
+ 496, 295, 503, 503, 295, 504, 504, 295,
+ 506, 507, 508, 509, 510, 511, 512, 513,
+ 514, 515, 516, 517, 518, 519, 520, 506,
+ 507, 508, 509, 510, 511, 512, 513, 514,
+ 515, 516, 517, 518, 519, 520, 295, 521,
+ 521, 295, 522, 522, 295, 523, 523, 295,
+ 506, 507, 508, 509, 510, 511, 513, 514,
+ 515, 516, 517, 518, 519, 520, 506, 507,
+ 508, 509, 510, 511, 513, 514, 515, 516,
+ 517, 518, 519, 520, 295, 524, 524, 295,
+ 525, 525, 295, 527, 528, 529, 530, 531,
+ 532, 533, 534, 535, 536, 537, 538, 539,
+ 540, 527, 528, 529, 530, 531, 532, 533,
+ 534, 535, 536, 537, 538, 539, 540, 295,
+ 541, 541, 295, 542, 542, 295, 543, 543,
+ 295, 527, 528, 529, 530, 531, 532, 544,
+ 534, 535, 536, 537, 538, 539, 540, 527,
+ 528, 529, 530, 531, 532, 544, 534, 535,
+ 536, 537, 538, 539, 540, 295, 374, 545,
+ 376, 377, 378, 379, 380, 381, 382, 383,
+ 384, 385, 386, 388, 387, 374, 545, 376,
+ 377, 378, 379, 380, 381, 382, 383, 384,
+ 385, 386, 388, 387, 295, 547, 548, 549,
+ 550, 551, 552, 553, 554, 555, 556, 557,
+ 558, 559, 560, 561, 547, 548, 549, 550,
+ 551, 552, 553, 554, 555, 556, 557, 558,
+ 559, 560, 561, 295, 562, 563, 562, 563,
+ 295, 565, 566, 567, 568, 569, 570, 571,
+ 572, 573, 574, 575, 576, 577, 578, 579,
+ 565, 566, 567, 568, 569, 570, 571, 572,
+ 573, 574, 575, 576, 577, 578, 579, 295,
+ 580, 580, 295, 581, 581, 295, 582, 582,
+ 295, 583, 583, 295, 565, 566, 567, 568,
+ 569, 570, 572, 573, 574, 575, 576, 577,
+ 578, 579, 565, 566, 567, 568, 569, 570,
+ 572, 573, 574, 575, 576, 577, 578, 579,
+ 295, 584, 585, 586, 587, 588, 589, 584,
+ 585, 586, 587, 588, 589, 295, 590, 590,
+ 295, 591, 591, 295, 592, 592, 295, 593,
+ 593, 295, 594, 594, 295, 587, 587, 295,
+ 596, 597, 598, 599, 600, 601, 602, 603,
+ 604, 605, 606, 607, 608, 609, 596, 597,
+ 598, 599, 600, 601, 602, 603, 604, 605,
+ 606, 607, 608, 609, 295, 611, 612, 613,
+ 614, 615, 616, 617, 618, 619, 620, 621,
+ 622, 623, 624, 625, 611, 612, 613, 614,
+ 615, 616, 617, 618, 619, 620, 621, 622,
+ 623, 624, 625, 295, 626, 626, 295, 627,
+ 627, 295, 628, 628, 295, 611, 612, 613,
+ 614, 615, 616, 618, 619, 620, 621, 622,
+ 623, 624, 625, 611, 612, 613, 614, 615,
+ 616, 618, 619, 620, 621, 622, 623, 624,
+ 625, 295, 629, 629, 295, 630, 630, 295,
+ 631, 631, 295, 633, 634, 635, 636, 637,
+ 638, 639, 640, 641, 642, 643, 644, 645,
+ 646, 633, 634, 635, 636, 637, 638, 639,
+ 640, 641, 642, 643, 644, 645, 646, 295,
+ 647, 647, 295, 649, 650, 651, 652, 653,
+ 654, 655, 656, 657, 658, 659, 660, 661,
+ 662, 649, 650, 651, 652, 653, 654, 655,
+ 656, 657, 658, 659, 660, 661, 662, 295,
+ 663, 663, 295, 664, 664, 295, 666, 667,
+ 668, 669, 670, 671, 672, 673, 674, 675,
+ 676, 677, 678, 679, 666, 667, 668, 669,
+ 670, 671, 672, 673, 674, 675, 676, 677,
+ 678, 679, 295, 680, 680, 295, 682, 683,
+ 684, 685, 686, 687, 688, 689, 690, 691,
+ 692, 693, 694, 695, 682, 683, 684, 685,
+ 686, 687, 688, 689, 690, 691, 692, 693,
+ 694, 695, 295, 696, 696, 295, 697, 697,
+ 295, 698, 698, 295, 699, 699, 295, 700,
+ 700, 295, 682, 683, 684, 685, 686, 687,
+ 688, 689, 690, 691, 692, 693, 701, 695,
+ 682, 683, 684, 685, 686, 687, 688, 689,
+ 690, 691, 692, 693, 701, 695, 295, 703,
+ 704, 705, 706, 707, 708, 709, 710, 711,
+ 712, 713, 714, 715, 716, 717, 703, 704,
+ 705, 706, 707, 708, 709, 710, 711, 712,
+ 713, 714, 715, 716, 717, 295, 718, 718,
+ 295, 719, 719, 295, 703, 704, 705, 706,
+ 707, 708, 709, 710, 711, 712, 713, 714,
+ 715, 717, 703, 704, 705, 706, 707, 708,
+ 709, 710, 711, 712, 713, 714, 715, 717,
+ 295, 720, 720, 295, 547, 548, 549, 721,
+ 551, 552, 553, 554, 555, 556, 557, 558,
+ 559, 561, 547, 548, 549, 721, 551, 552,
+ 553, 554, 555, 556, 557, 558, 559, 561,
+ 295, 722, 722, 295, 723, 723, 295, 374,
+ 545, 376, 377, 378, 379, 380, 381, 382,
+ 383, 384, 385, 386, 387, 374, 545, 376,
+ 377, 378, 379, 380, 381, 382, 383, 384,
+ 385, 386, 387, 295, 724, 724, 295, 725,
+ 725, 295, 726, 423, 424, 727, 426, 427,
+ 428, 429, 728, 431, 432, 433, 434, 436,
+ 726, 423, 424, 727, 426, 427, 428, 429,
+ 728, 431, 432, 433, 434, 436, 295, 730,
+ 731, 732, 733, 734, 735, 736, 737, 738,
+ 739, 740, 741, 742, 743, 730, 731, 732,
+ 733, 734, 735, 736, 737, 738, 739, 740,
+ 741, 742, 743, 295, 744, 744, 295, 730,
+ 731, 732, 733, 734, 735, 745, 737, 738,
+ 739, 740, 741, 742, 743, 730, 731, 732,
+ 733, 734, 735, 745, 737, 738, 739, 740,
+ 741, 742, 743, 295, 746, 746, 295, 747,
+ 747, 295, 406, 407, 408, 409, 410, 411,
+ 413, 414, 415, 416, 417, 418, 419, 420,
+ 406, 407, 408, 409, 410, 411, 413, 414,
+ 415, 416, 417, 418, 419, 420, 295, 748,
+ 748, 295, 749, 749, 295, 751, 752, 753,
+ 754, 755, 756, 757, 758, 759, 760, 761,
+ 762, 763, 764, 751, 752, 753, 754, 755,
+ 756, 757, 758, 759, 760, 761, 762, 763,
+ 764, 295, 765, 765, 295, 766, 766, 295,
+ 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 372, 357, 358,
+ 359, 360, 361, 362, 363, 364, 365, 366,
+ 367, 368, 369, 372, 295, 767, 767, 295,
+ 768, 768, 295, 769, 769, 295, 771, 772,
+ 773, 774, 775, 776, 777, 778, 779, 780,
+ 781, 782, 783, 784, 771, 772, 773, 774,
+ 775, 776, 777, 778, 779, 780, 781, 782,
+ 783, 784, 295, 340, 769, 340, 769, 295,
+ 785, 785, 295, 786, 786, 295, 787, 787,
+ 295, 311, 312, 313, 314, 315, 316, 317,
+ 318, 319, 320, 321, 322, 323, 788, 311,
+ 312, 313, 314, 315, 316, 317, 318, 319,
+ 320, 321, 322, 323, 788, 295, 789, 789,
+ 295, 790, 790, 295, 791, 791, 295, 325,
+ 325, 295, 793, 794, 795, 796, 797, 798,
+ 799, 800, 801, 802, 803, 804, 805, 806,
+ 793, 794, 795, 796, 797, 798, 799, 800,
+ 801, 802, 803, 804, 805, 806, 295, 808,
+ 809, 810, 811, 812, 813, 814, 815, 816,
+ 817, 818, 819, 820, 821, 111, 808, 809,
+ 810, 811, 812, 813, 814, 815, 816, 817,
+ 818, 819, 820, 821, 111, 807, 823, 824,
+ 825, 826, 827, 828, 829, 830, 831, 832,
+ 833, 834, 835, 836, 823, 824, 825, 826,
+ 827, 828, 829, 830, 831, 832, 833, 834,
+ 835, 836, 822, 838, 839, 840, 841, 842,
+ 843, 844, 845, 846, 847, 848, 849, 850,
+ 851, 852, 853, 838, 839, 840, 841, 842,
+ 843, 844, 845, 846, 847, 848, 849, 850,
+ 851, 852, 853, 837, 855, 856, 857, 858,
+ 859, 860, 861, 862, 863, 864, 865, 866,
+ 867, 868, 869, 855, 856, 857, 858, 859,
+ 860, 861, 862, 863, 864, 865, 866, 867,
+ 868, 869, 854, 871, 872, 873, 874, 875,
+ 876, 877, 878, 879, 880, 881, 882, 883,
+ 884, 871, 872, 873, 874, 875, 876, 877,
+ 878, 879, 880, 881, 882, 883, 884, 870,
+ 886, 887, 888, 889, 890, 891, 892, 893,
+ 894, 895, 896, 897, 898, 899, 900, 886,
+ 887, 888, 889, 890, 891, 892, 893, 894,
+ 895, 896, 897, 898, 899, 900, 885, 902,
+ 903, 904, 905, 906, 907, 908, 909, 910,
+ 911, 912, 913, 914, 28, 915, 902, 903,
+ 904, 905, 906, 907, 908, 909, 910, 911,
+ 912, 913, 914, 28, 915, 901, 917, 918,
+ 919, 920, 921, 922, 923, 924, 925, 926,
+ 927, 928, 929, 930, 917, 918, 919, 920,
+ 921, 922, 923, 924, 925, 926, 927, 928,
+ 929, 930, 916, 932, 933, 934, 935, 936,
+ 937, 938, 939, 940, 941, 942, 943, 944,
+ 945, 932, 933, 934, 935, 936, 937, 938,
+ 939, 940, 941, 942, 943, 944, 945, 931,
+ 947, 948, 949, 950, 951, 952, 953, 954,
+ 955, 956, 957, 958, 959, 960, 947, 948,
+ 949, 950, 951, 952, 953, 954, 955, 956,
+ 957, 958, 959, 960, 946, 947, 948, 949,
+ 961, 951, 952, 953, 954, 955, 956, 957,
+ 958, 959, 960, 947, 948, 949, 961, 951,
+ 952, 953, 954, 955, 956, 957, 958, 959,
+ 960, 946, 963, 964, 965, 966, 967, 968,
+ 969, 970, 971, 972, 973, 974, 975, 976,
+ 977, 963, 964, 965, 966, 967, 968, 969,
+ 970, 971, 972, 973, 974, 975, 976, 977,
+ 962, 963, 964, 965, 966, 967, 968, 970,
+ 971, 972, 973, 974, 975, 976, 977, 963,
+ 964, 965, 966, 967, 968, 970, 971, 972,
+ 973, 974, 975, 976, 977, 962, 979, 980,
+ 981, 982, 983, 984, 985, 986, 987, 988,
+ 989, 990, 991, 992, 979, 980, 981, 982,
+ 983, 984, 985, 986, 987, 988, 989, 990,
+ 991, 992, 978, 979, 980, 981, 982, 983,
+ 984, 993, 986, 987, 988, 989, 990, 991,
+ 992, 979, 980, 981, 982, 983, 984, 993,
+ 986, 987, 988, 989, 990, 991, 992, 978,
+ 855, 994, 857, 858, 859, 860, 861, 862,
+ 863, 864, 865, 866, 867, 869, 868, 855,
+ 994, 857, 858, 859, 860, 861, 862, 863,
+ 864, 865, 866, 867, 869, 868, 854, 996,
+ 997, 998, 999, 1000, 1001, 1002, 1003, 1004,
+ 1005, 1006, 1007, 1008, 1009, 1010, 996, 997,
+ 998, 999, 1000, 1001, 1002, 1003, 1004, 1005,
+ 1006, 1007, 1008, 1009, 1010, 995, 1012, 1013,
+ 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021,
+ 1022, 1023, 1024, 1025, 1026, 1012, 1013, 1014,
+ 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022,
+ 1023, 1024, 1025, 1026, 1011, 1012, 1013, 1014,
+ 1015, 1016, 1017, 1019, 1020, 1021, 1022, 1023,
+ 1024, 1025, 1026, 1012, 1013, 1014, 1015, 1016,
+ 1017, 1019, 1020, 1021, 1022, 1023, 1024, 1025,
+ 1026, 1011, 1028, 1029, 1030, 1031, 1032, 1033,
+ 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041,
+ 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035,
+ 1036, 1037, 1038, 1039, 1040, 1041, 1027, 1043,
+ 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051,
+ 1052, 1053, 1054, 1055, 1056, 1057, 1043, 1044,
+ 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052,
+ 1053, 1054, 1055, 1056, 1057, 1042, 1043, 1044,
+ 1045, 1046, 1047, 1048, 1050, 1051, 1052, 1053,
+ 1054, 1055, 1056, 1057, 1043, 1044, 1045, 1046,
+ 1047, 1048, 1050, 1051, 1052, 1053, 1054, 1055,
+ 1056, 1057, 1042, 1059, 1060, 1061, 1062, 1063,
+ 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071,
+ 1072, 1059, 1060, 1061, 1062, 1063, 1064, 1065,
+ 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1058,
+ 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081,
+ 1082, 1083, 1084, 1085, 1086, 1087, 1074, 1075,
+ 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083,
+ 1084, 1085, 1086, 1087, 1073, 1089, 1090, 1091,
+ 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099,
+ 1100, 1101, 1102, 1089, 1090, 1091, 1092, 1093,
+ 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101,
+ 1102, 1088, 1104, 1105, 1106, 1107, 1108, 1109,
+ 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117,
+ 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111,
+ 1112, 1113, 1114, 1115, 1116, 1117, 1103, 1104,
+ 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112,
+ 1113, 1114, 1115, 1118, 1117, 1104, 1105, 1106,
+ 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114,
+ 1115, 1118, 1117, 1103, 1120, 1121, 1122, 1123,
+ 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
+ 1132, 1133, 1134, 1120, 1121, 1122, 1123, 1124,
+ 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132,
+ 1133, 1134, 1119, 1120, 1121, 1122, 1123, 1124,
+ 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132,
+ 1134, 1120, 1121, 1122, 1123, 1124, 1125, 1126,
+ 1127, 1128, 1129, 1130, 1131, 1132, 1134, 1119,
+ 996, 997, 998, 1135, 1000, 1001, 1002, 1003,
+ 1004, 1005, 1006, 1007, 1008, 1010, 996, 997,
+ 998, 1135, 1000, 1001, 1002, 1003, 1004, 1005,
+ 1006, 1007, 1008, 1010, 995, 855, 994, 857,
+ 858, 859, 860, 861, 862, 863, 864, 865,
+ 866, 867, 868, 855, 994, 857, 858, 859,
+ 860, 861, 862, 863, 864, 865, 866, 867,
+ 868, 854, 1136, 903, 904, 1137, 906, 907,
+ 908, 909, 1138, 911, 912, 913, 914, 915,
+ 1136, 903, 904, 1137, 906, 907, 908, 909,
+ 1138, 911, 912, 913, 914, 915, 901, 1140,
+ 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148,
+ 1149, 1150, 1151, 1152, 1153, 1140, 1141, 1142,
+ 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150,
+ 1151, 1152, 1153, 1139, 1140, 1141, 1142, 1143,
+ 1144, 1145, 1154, 1147, 1148, 1149, 1150, 1151,
+ 1152, 1153, 1140, 1141, 1142, 1143, 1144, 1145,
+ 1154, 1147, 1148, 1149, 1150, 1151, 1152, 1153,
+ 1139, 886, 887, 888, 889, 890, 891, 893,
+ 894, 895, 896, 897, 898, 899, 900, 886,
+ 887, 888, 889, 890, 891, 893, 894, 895,
+ 896, 897, 898, 899, 900, 885, 1156, 1157,
+ 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165,
+ 1166, 1167, 1168, 1169, 1156, 1157, 1158, 1159,
+ 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167,
+ 1168, 1169, 1155, 838, 839, 840, 841, 842,
+ 843, 844, 845, 846, 847, 848, 849, 850,
+ 853, 838, 839, 840, 841, 842, 843, 844,
+ 845, 846, 847, 848, 849, 850, 853, 837,
+ 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178,
+ 1179, 1180, 1181, 1182, 1183, 1184, 1171, 1172,
+ 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180,
+ 1181, 1182, 1183, 1184, 1170, 808, 809, 810,
+ 811, 812, 813, 814, 815, 816, 817, 818,
+ 819, 820, 1185, 808, 809, 810, 811, 812,
+ 813, 814, 815, 816, 817, 818, 819, 820,
+ 1185, 807, 1187, 1188, 1189, 1190, 1191, 1192,
+ 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200,
+ 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194,
+ 1195, 1196, 1197, 1198, 1199, 1200, 1186, 1203,
+ 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211,
+ 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219,
+ 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213,
+ 1214, 1215, 1216, 1217, 1218, 1219, 1203, 1221,
+ 1222, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
+ 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1206,
+ 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214,
+ 1215, 1216, 1217, 1218, 1219, 1202, 1220, 1201,
+ 1225, 1226, 1225, 1228, 1224, 1227, 1223, 1230,
+ 1231, 1230, 1233, 1232, 1229, 1236, 1237, 1238,
+ 1239, 1240, 1238, 1239, 1240, 1236, 1235, 1243,
+ 1243, 1242, 1245, 1245, 1244, 1236, 1237, 1246,
+ 1247, 1248, 1246, 1247, 1248, 1236, 1235, 1250,
+ 1251, 1252, 1253, 1254, 1251, 1252, 1253, 1254,
+ 1250, 1242, 1243, 1255, 1255, 1243, 1242, 1243,
+ 1256, 1256, 1243, 1242, 1243, 1257, 1257, 1243,
+ 1242, 1243, 1258, 1258, 1243, 1242, 1250, 1251,
+ 1253, 1254, 1251, 1253, 1254, 1250, 1242, 1250,
+ 1251, 1259, 1253, 1254, 1251, 1259, 1253, 1254,
+ 1250, 1242, 1243, 1260, 1260, 1243, 1242, 1243,
+ 1261, 1261, 1243, 1242, 1243, 1262, 1262, 1243,
+ 1242, 1243, 1263, 1263, 1243, 1242, 1243, 1258,
+ 1258, 1243, 1242, 1243, 1264, 1265, 1266, 1264,
+ 1265, 1266, 1243, 1242, 1243, 1267, 1267, 1243,
+ 1242, 1243, 1268, 1268, 1243, 1242, 1243, 1269,
+ 1269, 1243, 1242, 1243, 1270, 1270, 1243, 1242,
+ 1243, 1265, 1265, 1243, 1242, 1272, 1273, 1274,
+ 1275, 1273, 1274, 1275, 1272, 1242, 1277, 1278,
+ 1279, 1280, 1278, 1279, 1280, 1277, 1242, 1243,
+ 1281, 1281, 1243, 1242, 1243, 1282, 1282, 1243,
+ 1242, 1277, 1283, 1279, 1280, 1283, 1279, 1280,
+ 1277, 1242, 1285, 1286, 1287, 1288, 1289, 1286,
+ 1287, 1288, 1289, 1285, 1284, 1285, 1286, 1288,
+ 1289, 1286, 1288, 1289, 1285, 1284, 1285, 1286,
+ 1290, 1288, 1289, 1286, 1290, 1288, 1289, 1285,
+ 1284, 1292, 1293, 1294, 1295, 1293, 1294, 1295,
+ 1292, 1291, 1297, 1298, 1299, 1300, 1298, 1299,
+ 1300, 1297, 1296, 1297, 1301, 1299, 1300, 1301,
+ 1299, 1300, 1297, 1296, 1303, 1305, 1304, 1302,
+ 1306, 1307, 1304, 1302, 1236, 1309, 1238, 1239,
+ 1240, 1238, 1239, 1240, 1311, 1312, 1313, 1314,
+ 1315, 1313, 1314, 1315, 1235, 1236, 1235, 1310,
+ 1311, 1310, 1308, 1243, 1317, 1319, 1320, 1242,
+ 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1321,
+ 1243, 1242, 1245, 1303, 1322, 1305, 1245, 1304,
+ 1322, 1304, 1302, 1243, 1323, 1319, 1324, 1242,
+ 1243, 1242, 1318, 1319, 1318, 1316, 1236, 1309,
+ 1246, 1247, 1248, 1246, 1247, 1248, 1311, 1312,
+ 1325, 1326, 1327, 1325, 1326, 1327, 1235, 1236,
+ 1235, 1310, 1311, 1310, 1308, 1250, 1317, 1251,
+ 1252, 1253, 1254, 1251, 1252, 1253, 1254, 1329,
+ 1320, 1330, 1331, 1332, 1333, 1330, 1331, 1332,
+ 1333, 1242, 1250, 1242, 1318, 1329, 1318, 1328,
+ 1243, 1317, 1255, 1255, 1319, 1320, 1334, 1334,
+ 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1243,
+ 1317, 1256, 1256, 1319, 1320, 1335, 1335, 1242,
+ 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1317,
+ 1257, 1257, 1319, 1320, 1336, 1336, 1242, 1243,
+ 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1258,
+ 1258, 1319, 1320, 1337, 1337, 1242, 1243, 1242,
+ 1318, 1319, 1318, 1316, 1250, 1317, 1251, 1253,
+ 1254, 1251, 1253, 1254, 1329, 1320, 1330, 1332,
+ 1333, 1330, 1332, 1333, 1242, 1250, 1242, 1318,
+ 1329, 1318, 1328, 1250, 1317, 1251, 1259, 1253,
+ 1254, 1251, 1259, 1253, 1254, 1329, 1320, 1330,
+ 1338, 1332, 1333, 1330, 1338, 1332, 1333, 1242,
+ 1250, 1242, 1318, 1329, 1318, 1328, 1243, 1317,
+ 1260, 1260, 1319, 1320, 1339, 1339, 1242, 1243,
+ 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1261,
+ 1261, 1319, 1320, 1340, 1340, 1242, 1243, 1242,
+ 1318, 1319, 1318, 1316, 1243, 1317, 1262, 1262,
+ 1319, 1320, 1341, 1341, 1242, 1243, 1242, 1318,
+ 1319, 1318, 1316, 1243, 1317, 1263, 1263, 1319,
+ 1320, 1342, 1342, 1242, 1243, 1242, 1318, 1319,
+ 1318, 1316, 1243, 1317, 1258, 1258, 1319, 1320,
+ 1337, 1337, 1242, 1243, 1242, 1318, 1319, 1318,
+ 1316, 1243, 1317, 1264, 1265, 1266, 1264, 1265,
+ 1266, 1319, 1320, 1343, 1344, 1345, 1343, 1344,
+ 1345, 1242, 1243, 1242, 1318, 1319, 1318, 1316,
+ 1243, 1317, 1267, 1267, 1319, 1320, 1346, 1346,
+ 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1243,
+ 1317, 1268, 1268, 1319, 1320, 1347, 1347, 1242,
+ 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1317,
+ 1269, 1269, 1319, 1320, 1348, 1348, 1242, 1243,
+ 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1270,
+ 1270, 1319, 1320, 1349, 1349, 1242, 1243, 1242,
+ 1318, 1319, 1318, 1316, 1243, 1317, 1265, 1265,
+ 1319, 1320, 1344, 1344, 1242, 1243, 1242, 1318,
+ 1319, 1318, 1316, 1272, 1317, 1273, 1274, 1275,
+ 1273, 1274, 1275, 1351, 1320, 1352, 1353, 1354,
+ 1352, 1353, 1354, 1242, 1272, 1242, 1318, 1351,
+ 1318, 1350, 1277, 1317, 1278, 1279, 1280, 1278,
+ 1279, 1280, 1356, 1320, 1357, 1358, 1359, 1357,
+ 1358, 1359, 1242, 1277, 1242, 1318, 1356, 1318,
+ 1355, 1243, 1317, 1281, 1281, 1319, 1320, 1360,
+ 1360, 1242, 1243, 1242, 1318, 1319, 1318, 1316,
+ 1243, 1317, 1282, 1282, 1319, 1320, 1361, 1361,
+ 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1277,
+ 1317, 1283, 1279, 1280, 1283, 1279, 1280, 1356,
+ 1320, 1362, 1358, 1359, 1362, 1358, 1359, 1242,
+ 1277, 1242, 1318, 1356, 1318, 1355, 1285, 1303,
+ 1286, 1287, 1288, 1289, 1286, 1287, 1288, 1289,
+ 1364, 1305, 1365, 1366, 1367, 1368, 1365, 1366,
+ 1367, 1368, 1285, 1304, 1364, 1304, 1363, 1303,
+ 115, 115, 1305, 1369, 1369, 1304, 1302, 1303,
+ 116, 116, 1305, 1370, 1370, 1304, 1302, 1303,
+ 117, 117, 1305, 1371, 1371, 1304, 1302, 1303,
+ 118, 118, 1305, 1372, 1372, 1304, 1302, 1285,
+ 1303, 1286, 1288, 1289, 1286, 1288, 1289, 1364,
+ 1305, 1365, 1367, 1368, 1365, 1367, 1368, 1285,
+ 1304, 1364, 1304, 1363, 1285, 1303, 1286, 1290,
+ 1288, 1289, 1286, 1290, 1288, 1289, 1364, 1305,
+ 1365, 1373, 1367, 1368, 1365, 1373, 1367, 1368,
+ 1285, 1304, 1364, 1304, 1363, 1303, 119, 119,
+ 1305, 1374, 1374, 1304, 1302, 1303, 120, 120,
+ 1305, 1375, 1375, 1304, 1302, 1303, 121, 121,
+ 1305, 1376, 1376, 1304, 1302, 1303, 122, 122,
+ 1305, 1377, 1377, 1304, 1302, 1303, 118, 118,
+ 1305, 1372, 1372, 1304, 1302, 1303, 123, 124,
+ 125, 123, 124, 125, 1305, 1378, 1379, 1380,
+ 1378, 1379, 1380, 1304, 1302, 1303, 126, 126,
+ 1305, 1381, 1381, 1304, 1302, 1303, 127, 127,
+ 1305, 1382, 1382, 1304, 1302, 1303, 128, 128,
+ 1305, 1383, 1383, 1304, 1302, 1303, 129, 129,
+ 1305, 1384, 1384, 1304, 1302, 1303, 124, 124,
+ 1305, 1379, 1379, 1304, 1302, 1292, 1303, 1293,
+ 1294, 1295, 1293, 1294, 1295, 1386, 1305, 1387,
+ 1388, 1389, 1387, 1388, 1389, 1292, 1304, 1386,
+ 1304, 1385, 1297, 1303, 1298, 1299, 1300, 1298,
+ 1299, 1300, 1391, 1305, 1392, 1393, 1394, 1392,
+ 1393, 1394, 1297, 1304, 1391, 1304, 1390, 1303,
+ 130, 130, 1305, 1395, 1395, 1304, 1302, 1303,
+ 131, 131, 1305, 1396, 1396, 1304, 1302, 1297,
+ 1303, 1301, 1299, 1300, 1301, 1299, 1300, 1391,
+ 1305, 1397, 1393, 1394, 1397, 1393, 1394, 1297,
+ 1304, 1391, 1304, 1390, 1203, 1204, 1205, 1398,
+ 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406,
+ 1407, 1408, 1409, 1410, 1411, 1398, 1399, 1400,
+ 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408,
+ 1409, 1410, 1411, 1203, 1221, 1222, 1227, 1220,
+ 1227, 1220, 1227, 1227, 1220, 1227, 1220, 1227,
+ 1202, 1220, 1227, 1220, 1227, 1220, 1227, 1220,
+ 1227, 1220, 1201, 1225, 1226, 1412, 1412, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 1413, 1413,
+ 1225, 1228, 1224, 1227, 1223, 1415, 1416, 1417,
+ 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425,
+ 1426, 1427, 1428, 1429, 1430, 1417, 1418, 1419,
+ 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427,
+ 1428, 1429, 1430, 1415, 1432, 1224, 1431, 1414,
+ 1225, 1226, 1433, 1433, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1434, 1434, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1435, 1435, 1225, 1228,
+ 1224, 1227, 1223, 1437, 1438, 1439, 1440, 1441,
+ 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449,
+ 1450, 1451, 1452, 1439, 1440, 1441, 1442, 1443,
+ 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451,
+ 1452, 1437, 1454, 1224, 1453, 1436, 1225, 1226,
+ 1455, 1456, 1455, 1456, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1457, 1457, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1458, 1458, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1459, 1459, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1460, 1461, 1226,
+ 1225, 1228, 1224, 1227, 1223, 1463, 1464, 1465,
+ 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473,
+ 1474, 1475, 1476, 1477, 1478, 1465, 1466, 1467,
+ 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475,
+ 1476, 1477, 1478, 1463, 1480, 1224, 1479, 1462,
+ 1225, 1226, 1481, 1482, 1481, 1482, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1483, 1483, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 1484, 1484,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1485,
+ 1485, 1225, 1228, 1224, 1227, 1223, 1487, 1488,
+ 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496,
+ 1497, 1498, 1499, 1500, 1501, 1502, 1489, 1490,
+ 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498,
+ 1499, 1500, 1501, 1502, 1487, 1504, 1224, 1503,
+ 1486, 1225, 1226, 1505, 1505, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1506, 1506, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1507, 1507, 1225,
+ 1228, 1224, 1227, 1223, 1509, 1510, 1511, 1512,
+ 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520,
+ 1521, 1522, 1523, 1524, 1511, 1512, 1513, 1514,
+ 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522,
+ 1523, 1524, 1509, 1526, 1224, 1525, 1508, 1225,
+ 1226, 1527, 1527, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1528, 1528, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1529, 1529, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1530, 1530, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1531, 1531, 1225,
+ 1228, 1224, 1227, 1223, 1533, 1534, 1535, 1536,
+ 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544,
+ 1545, 1546, 1547, 1548, 1535, 1536, 1537, 1538,
+ 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546,
+ 1547, 1548, 1533, 1550, 1224, 1549, 1532, 1225,
+ 1226, 1551, 1552, 1551, 1552, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1553, 1553, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1554, 1555, 1554,
+ 1555, 1225, 1228, 1224, 1227, 1223, 1557, 1558,
+ 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566,
+ 1567, 1568, 1569, 1570, 1571, 1572, 1559, 1560,
+ 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568,
+ 1569, 1570, 1571, 1572, 1557, 1574, 1224, 1573,
+ 1556, 1225, 1226, 1575, 1575, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1576, 1576, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1577, 1577, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 1578, 1578,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1579, 1226,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1580,
+ 1581, 1580, 1581, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1582, 1582, 1225, 1228, 1224, 1227,
+ 1223, 1584, 1585, 1586, 1587, 1588, 1589, 1590,
+ 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598,
+ 1599, 1586, 1587, 1588, 1589, 1590, 1591, 1592,
+ 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1584,
+ 1601, 1224, 1600, 1583, 1225, 1226, 1602, 1602,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1603,
+ 1603, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 1604, 1604, 1225, 1228, 1224, 1227, 1223, 1606,
+ 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614,
+ 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1608,
+ 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616,
+ 1617, 1618, 1619, 1620, 1621, 1606, 1623, 1224,
+ 1622, 1605, 1225, 1226, 1624, 1625, 1626, 1624,
+ 1625, 1626, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1627, 1628, 1629, 1627, 1628, 1629, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 1630, 1630,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1631,
+ 1631, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 1632, 1632, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1626, 1626, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1633, 1633, 1225, 1228, 1224, 1227,
+ 1223, 1635, 1636, 1637, 1638, 1639, 1640, 1641,
+ 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649,
+ 1650, 1637, 1638, 1639, 1640, 1641, 1642, 1643,
+ 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1635,
+ 1652, 1224, 1651, 1634, 1225, 1226, 1653, 1653,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1654,
+ 1654, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 1655, 1655, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1656, 1656, 1225, 1228, 1224, 1227, 1223,
+ 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665,
+ 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673,
+ 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667,
+ 1668, 1669, 1670, 1671, 1672, 1673, 1658, 1675,
+ 1224, 1674, 1657, 1225, 1226, 1676, 1677, 1678,
+ 1679, 1676, 1677, 1678, 1679, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1680, 1680, 1225, 1228,
+ 1224, 1227, 1223, 1682, 1683, 1684, 1685, 1686,
+ 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694,
+ 1695, 1696, 1697, 1684, 1685, 1686, 1687, 1688,
+ 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696,
+ 1697, 1682, 1699, 1224, 1698, 1681, 1225, 1226,
+ 1700, 1700, 1225, 1228, 1224, 1227, 1223, 1702,
+ 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710,
+ 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1704,
+ 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712,
+ 1713, 1714, 1715, 1716, 1717, 1702, 1719, 1224,
+ 1718, 1701, 1225, 1226, 1720, 1720, 1225, 1228,
+ 1224, 1227, 1223, 1722, 1723, 1724, 1725, 1726,
+ 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734,
+ 1735, 1736, 1737, 1724, 1725, 1726, 1727, 1728,
+ 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736,
+ 1737, 1722, 1739, 1224, 1738, 1721, 1225, 1226,
+ 1740, 1741, 1742, 1740, 1741, 1742, 1225, 1228,
+ 1224, 1227, 1223, 1744, 1745, 1746, 1747, 1748,
+ 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756,
+ 1757, 1758, 1759, 1746, 1747, 1748, 1749, 1750,
+ 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758,
+ 1759, 1744, 1761, 1224, 1760, 1743, 1225, 1226,
+ 1762, 1762, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1763, 1763, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1764, 1764, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1765, 1765, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1766, 1226, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1767, 1767, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1768, 1768, 1225,
+ 1228, 1224, 1227, 1223, 1770, 1771, 1772, 1773,
+ 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781,
+ 1782, 1783, 1784, 1785, 1772, 1773, 1774, 1775,
+ 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783,
+ 1784, 1785, 1770, 1787, 1224, 1786, 1769, 1225,
+ 1226, 1788, 1788, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1789, 1789, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1790, 1790, 1225, 1228, 1224,
+ 1227, 1223, 1792, 1793, 1794, 1795, 1796, 1797,
+ 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805,
+ 1806, 1807, 1794, 1795, 1796, 1797, 1798, 1799,
+ 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807,
+ 1792, 1809, 1224, 1808, 1791, 1225, 1226, 1810,
+ 1810, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 1811, 1811, 1225, 1228, 1224, 1227, 1223, 1813,
+ 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821,
+ 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1815,
+ 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823,
+ 1824, 1825, 1826, 1827, 1828, 1813, 1830, 1224,
+ 1829, 1812, 1225, 1226, 1831, 1831, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1832, 1832, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1833, 1226, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 1834, 1835,
+ 1836, 1834, 1835, 1836, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1837, 1837, 1225, 1228, 1224,
+ 1227, 1223, 1839, 1840, 1841, 1842, 1843, 1844,
+ 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852,
+ 1853, 1854, 1841, 1842, 1843, 1844, 1845, 1846,
+ 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854,
+ 1839, 1856, 1224, 1855, 1838, 1225, 1226, 1857,
+ 1858, 1857, 1858, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1859, 1859, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1860, 1860, 1225, 1228, 1224,
+ 1227, 1223, 1862, 1863, 1864, 1865, 1866, 1867,
+ 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875,
+ 1876, 1877, 1864, 1865, 1866, 1867, 1868, 1869,
+ 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877,
+ 1862, 1879, 1224, 1878, 1861, 1225, 1226, 1880,
+ 1880, 1225, 1228, 1224, 1227, 1223, 1882, 1883,
+ 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891,
+ 1892, 1893, 1894, 1895, 1896, 1897, 1884, 1885,
+ 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893,
+ 1894, 1895, 1896, 1897, 1882, 1899, 1224, 1898,
+ 1881, 1225, 1226, 1900, 1900, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1901, 1901, 1225, 1228,
+ 1224, 1227, 1223, 1903, 1904, 1905, 1906, 1907,
+ 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915,
+ 1916, 1917, 1918, 1905, 1906, 1907, 1908, 1909,
+ 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917,
+ 1918, 1903, 1920, 1224, 1919, 1902, 1225, 1226,
+ 1921, 1921, 1225, 1228, 1224, 1227, 1223, 1923,
+ 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931,
+ 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1925,
+ 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933,
+ 1934, 1935, 1936, 1937, 1938, 1923, 1940, 1224,
+ 1939, 1922, 1942, 1943, 1944, 1945, 1946, 1947,
+ 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955,
+ 1956, 1957, 1944, 1945, 1946, 1947, 1948, 1949,
+ 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957,
+ 1942, 1959, 1227, 1227, 1224, 1958, 1941, 1225,
+ 1226, 1960, 1960, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1961, 1961, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 1962, 1962, 1225, 1228, 1224,
+ 1227, 1223, 1942, 1943, 1944, 1945, 1946, 1947,
+ 1948, 1949, 1950, 1963, 1952, 1953, 1954, 1955,
+ 1956, 1957, 1944, 1945, 1946, 1947, 1948, 1949,
+ 1950, 1963, 1952, 1953, 1954, 1955, 1956, 1957,
+ 1942, 1959, 1224, 1958, 1941, 1225, 1226, 1964,
+ 1964, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 1965, 1965, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1966, 1966, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1967, 1226, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 1968, 1969, 1970, 1968, 1969, 1970,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1971,
+ 1971, 1225, 1228, 1224, 1227, 1223, 1973, 1974,
+ 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982,
+ 1983, 1984, 1985, 1986, 1987, 1988, 1975, 1976,
+ 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984,
+ 1985, 1986, 1987, 1988, 1973, 1990, 1224, 1989,
+ 1972, 1225, 1226, 1991, 1991, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 1992, 1992, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 1993, 1993, 1225,
+ 1228, 1224, 1227, 1223, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010, 1995, 2012, 1224, 2011, 1994, 1225,
+ 1226, 2013, 2013, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 2014, 2014, 1225, 1228, 1224, 1227,
+ 1223, 1225, 1226, 2015, 2015, 1225, 1228, 1224,
+ 1227, 1223, 1225, 1226, 2016, 2016, 1225, 1228,
+ 1224, 1227, 1223, 2018, 2019, 2020, 2021, 2022,
+ 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030,
+ 2031, 2032, 2033, 2020, 2021, 2022, 2023, 2024,
+ 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032,
+ 2033, 2018, 2035, 1224, 2034, 2017, 1225, 1226,
+ 2036, 2036, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 2037, 2037, 1225, 1228, 1224, 1227, 1223,
+ 1225, 1226, 2038, 2038, 1225, 1228, 1224, 1227,
+ 1223, 2040, 2041, 2042, 2043, 2044, 2045, 2046,
+ 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054,
+ 2055, 2042, 2043, 2044, 2045, 2046, 2047, 2048,
+ 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2040,
+ 2057, 1224, 2056, 2039, 2059, 2060, 2061, 2062,
+ 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070,
+ 2071, 2072, 2073, 2074, 2061, 2062, 2063, 2064,
+ 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072,
+ 2073, 2074, 2059, 2076, 1224, 2075, 2058, 1225,
+ 1226, 2077, 2077, 1225, 1228, 1224, 1227, 1223,
+ 1225, 2078, 1226, 1225, 1228, 1224, 1227, 1223,
+ 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087,
+ 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095,
+ 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089,
+ 2090, 2091, 2092, 2093, 2094, 2095, 2080, 2097,
+ 1224, 2096, 2079, 1225, 1226, 2098, 2098, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 2099, 2099,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 2100,
+ 2100, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 2101, 2101, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 1720, 1720, 1225, 1228, 1224, 1227, 1223,
+ 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110,
+ 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118,
+ 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112,
+ 2113, 2114, 2115, 2116, 2117, 2118, 2103, 2120,
+ 1224, 2119, 2102, 1225, 1226, 2121, 2122, 2121,
+ 2122, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 2123, 2123, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 2124, 2124, 1225, 1228, 1224, 1227, 1223,
+ 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133,
+ 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141,
+ 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135,
+ 2136, 2137, 2138, 2139, 2140, 2141, 2126, 2143,
+ 1224, 2142, 2125, 1225, 2144, 1226, 1225, 1228,
+ 1224, 1227, 1223, 1225, 1226, 2145, 2145, 1225,
+ 1228, 1224, 1227, 1223, 1225, 1226, 2146, 2146,
+ 1225, 1228, 1224, 1227, 1223, 1225, 1226, 2147,
+ 2147, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
+ 2148, 2148, 1225, 1228, 1224, 1227, 1223, 1225,
+ 1226, 2149, 2149, 1225, 1228, 1224, 1227, 1223,
+ 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158,
+ 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166,
+ 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160,
+ 2161, 2162, 2163, 2164, 2165, 2166, 2151, 2168,
+ 1224, 2167, 2150, 1203, 1204, 1205, 1206, 1207,
+ 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215,
+ 1216, 1217, 1218, 1219, 1206, 1207, 1208, 1209,
+ 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217,
+ 1218, 1219, 1203, 1221, 1222, 2169, 2170, 2171,
+ 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179,
+ 2180, 2181, 2182, 2169, 2170, 2171, 2172, 2173,
+ 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181,
+ 2182, 1202, 1220, 1201, 2184, 2185, 2186, 2187,
+ 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195,
+ 2196, 2197, 2198, 2199, 2186, 2187, 2188, 2189,
+ 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197,
+ 2198, 2199, 2184, 2201, 2200, 2183, 2203, 2204,
+ 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212,
+ 2213, 2214, 2215, 2216, 2217, 2218, 2205, 2206,
+ 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214,
+ 2215, 2216, 2217, 2218, 2203, 2220, 2219, 2202,
+ 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229,
+ 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237,
+ 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231,
+ 2232, 2233, 2234, 2235, 2236, 2237, 2222, 2239,
+ 2238, 2221, 2241, 2242, 2243, 2244, 2245, 2246,
+ 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254,
+ 2255, 2256, 2243, 2244, 2245, 2246, 2247, 2248,
+ 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256,
+ 2241, 2258, 2257, 2240, 2260, 2261, 2262, 2263,
+ 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271,
+ 2272, 2273, 2274, 2275, 2262, 2263, 2264, 2265,
+ 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273,
+ 2274, 2275, 2260, 2277, 2276, 2259, 2279, 2280,
+ 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288,
+ 2289, 2290, 2291, 2292, 2293, 2294, 2281, 2282,
+ 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290,
+ 2291, 2292, 2293, 2294, 2279, 2296, 2295, 2278,
+ 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305,
+ 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313,
+ 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307,
+ 2308, 2309, 2310, 2311, 2312, 2313, 2298, 2315,
+ 2314, 2297, 2317, 2318, 2319, 2320, 2321, 2322,
+ 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330,
+ 2331, 2332, 2319, 2320, 2321, 2322, 2323, 2324,
+ 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332,
+ 2317, 2334, 2333, 2316, 2336, 2337, 2338, 2339,
+ 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347,
+ 2348, 2349, 2350, 2351, 2338, 2339, 2340, 2341,
+ 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349,
+ 2350, 2351, 2336, 2353, 2352, 2335, 2355, 2356,
+ 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364,
+ 2365, 2366, 2367, 2368, 2369, 2370, 2357, 2358,
+ 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366,
+ 2367, 2368, 2369, 2370, 2355, 2372, 2371, 2354,
+ 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381,
+ 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389,
+ 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383,
+ 2384, 2385, 2386, 2387, 2388, 2389, 2374, 2391,
+ 2390, 2373, 2393, 2394, 2395, 2396, 2397, 2398,
+ 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406,
+ 2407, 2408, 2395, 2396, 2397, 2398, 2399, 2400,
+ 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408,
+ 2393, 2410, 2409, 2392, 2412, 2413, 2414, 2415,
+ 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423,
+ 2424, 2425, 2426, 2427, 2414, 2415, 2416, 2417,
+ 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425,
+ 2426, 2427, 2412, 2429, 2428, 2411, 2431, 2432,
+ 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440,
+ 2441, 2442, 2443, 2444, 2445, 2446, 2433, 2434,
+ 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442,
+ 2443, 2444, 2445, 2446, 2431, 2448, 2447, 2430,
+ 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457,
+ 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465,
+ 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459,
+ 2460, 2461, 2462, 2463, 2464, 2465, 2450, 2467,
+ 2466, 2449, 2469, 2470, 2471, 2472, 2473, 2474,
+ 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482,
+ 2483, 2484, 2471, 2472, 2473, 2474, 2475, 2476,
+ 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484,
+ 2469, 2486, 2485, 2468, 2488, 2489, 2490, 2491,
+ 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499,
+ 2500, 2501, 2502, 2503, 2490, 2491, 2492, 2493,
+ 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501,
+ 2502, 2503, 2488, 2505, 2504, 2487, 2507, 2508,
+ 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516,
+ 2517, 2518, 2519, 2520, 2521, 2522, 2509, 2510,
+ 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518,
+ 2519, 2520, 2521, 2522, 2507, 2524, 2523, 2506,
+ 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533,
+ 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541,
+ 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535,
+ 2536, 2537, 2538, 2539, 2540, 2541, 2526, 2543,
+ 2542, 2525, 2545, 2546, 2547, 2548, 2549, 2550,
+ 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558,
+ 2559, 2560, 2547, 2548, 2549, 2550, 2551, 2552,
+ 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560,
+ 2545, 2562, 2561, 2544, 2564, 2565, 2566, 2567,
+ 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575,
+ 2576, 2577, 2578, 2579, 2566, 2567, 2568, 2569,
+ 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577,
+ 2578, 2579, 2564, 2581, 2580, 2563, 2583, 2584,
+ 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592,
+ 2593, 2594, 2595, 2596, 2597, 2598, 2585, 2586,
+ 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594,
+ 2595, 2596, 2597, 2598, 2583, 2600, 2599, 2582,
+ 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609,
+ 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617,
+ 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611,
+ 2612, 2613, 2614, 2615, 2616, 2617, 2602, 2619,
+ 2618, 2601, 2621, 2622, 2623, 2624, 2625, 2626,
+ 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634,
+ 2635, 2636, 2623, 2624, 2625, 2626, 2627, 2628,
+ 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636,
+ 2621, 2638, 2630, 2630, 2637, 2620, 2621, 2622,
+ 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2639,
+ 2631, 2632, 2633, 2634, 2635, 2636, 2623, 2624,
+ 2625, 2626, 2627, 2628, 2629, 2639, 2631, 2632,
+ 2633, 2634, 2635, 2636, 2621, 2638, 2637, 2620,
+ 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648,
+ 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656,
+ 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650,
+ 2651, 2652, 2653, 2654, 2655, 2656, 2641, 2658,
+ 2657, 2640, 2660, 2661, 2662, 2663, 2664, 2665,
+ 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673,
+ 2674, 2675, 2662, 2663, 2664, 2665, 2666, 2667,
+ 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675,
+ 2660, 2677, 2676, 2659, 2679, 2680, 2681, 2682,
+ 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690,
+ 2691, 2692, 2693, 2694, 2681, 2682, 2683, 2684,
+ 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692,
+ 2693, 2694, 2679, 2696, 2695, 2678, 2698, 2699,
+ 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707,
+ 2708, 2709, 2710, 2711, 2712, 2713, 2700, 2701,
+ 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709,
+ 2710, 2711, 2712, 2713, 2698, 2715, 2714, 2697,
+ 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724,
+ 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732,
+ 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726,
+ 2727, 2728, 2729, 2730, 2731, 2732, 2717, 2734,
+ 2733, 2716, 2736, 2737, 2738, 2739, 2740, 2741,
+ 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749,
+ 2750, 2751, 2738, 2739, 2740, 2741, 2742, 2743,
+ 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751,
+ 2736, 2753, 2752, 2735, 2755, 2756, 2757, 2758,
+ 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766,
+ 2767, 2768, 2769, 2770, 2757, 2758, 2759, 2760,
+ 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768,
+ 2769, 2770, 2755, 2772, 2771, 2754, 2774, 2775,
+ 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783,
+ 2784, 2785, 2786, 2787, 2788, 2789, 2776, 2777,
+ 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785,
+ 2786, 2787, 2788, 2789, 2774, 2791, 2790, 2773,
+ 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800,
+ 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808,
+ 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802,
+ 2803, 2804, 2805, 2806, 2807, 2808, 2793, 2810,
+ 2809, 2792, 1303, 132, 132, 1305, 2811, 2811,
+ 1304, 1302, 1303, 133, 133, 1305, 133, 133,
+ 1304, 1302, 1303, 134, 134, 1305, 2812, 2812,
+ 1304, 1302, 1303, 135, 135, 1305, 2813, 2813,
+ 1304, 1302, 1303, 136, 136, 1305, 136, 136,
+ 1304, 1302, 1303, 137, 138, 137, 138, 1305,
+ 2814, 2815, 2814, 2815, 1304, 1302, 1303, 139,
+ 139, 1305, 2816, 2816, 1304, 1302, 1303, 140,
+ 140, 1305, 2817, 2817, 1304, 1302, 1303, 141,
+ 141, 1305, 2818, 2818, 1304, 1302, 142, 143,
+ 1303, 142, 143, 1305, 1304, 1302, 1303, 251,
+ 252, 251, 252, 1305, 2819, 2820, 2819, 2820,
+ 1304, 1302, 1303, 253, 253, 1305, 2821, 2821,
+ 1304, 1302, 1303, 254, 254, 1305, 254, 254,
+ 1304, 1302, 255, 1303, 2822, 1305, 1304, 1302,
+ 1303, 256, 256, 1305, 2823, 2823, 1304, 1302,
+ 1303, 257, 257, 1305, 2824, 2824, 1304, 1302,
+ 1303, 258, 258, 1305, 2825, 2825, 1304, 1302,
+ 1303, 259, 259, 1305, 2826, 2826, 1304, 1302,
+ 1303, 260, 260, 1305, 260, 260, 1304, 1302,
+ 1303, 144, 145, 144, 145, 1305, 2827, 2828,
+ 2827, 2828, 1304, 1302, 1303, 146, 146, 1305,
+ 2829, 2829, 1304, 1302, 1303, 147, 147, 1305,
+ 2830, 2830, 1304, 1302, 1303, 148, 148, 1305,
+ 148, 148, 1304, 1302, 1303, 247, 247, 1305,
+ 2831, 2831, 1304, 1302, 1303, 248, 248, 1305,
+ 2832, 2832, 1304, 1302, 1303, 249, 249, 1305,
+ 2833, 2833, 1304, 1302, 1303, 250, 250, 1305,
+ 2834, 2834, 1304, 1302, 1303, 193, 193, 1305,
+ 193, 193, 1304, 1302, 1303, 149, 149, 1305,
+ 2835, 2835, 1304, 1302, 1303, 150, 150, 1305,
+ 2836, 2836, 1304, 1302, 1303, 151, 151, 1305,
+ 151, 151, 1304, 1302, 1303, 152, 152, 1305,
+ 2837, 2837, 1304, 1302, 1303, 153, 153, 1305,
+ 2838, 2838, 1304, 1302, 1303, 154, 154, 1305,
+ 2839, 2839, 1304, 1302, 1303, 155, 155, 1305,
+ 2840, 2840, 1304, 1302, 1303, 156, 156, 1305,
+ 156, 156, 1304, 1302, 1303, 157, 158, 157,
+ 158, 1305, 2841, 2842, 2841, 2842, 1304, 1302,
+ 1303, 159, 159, 1305, 2843, 2843, 1304, 1302,
+ 1303, 160, 161, 160, 161, 1305, 160, 161,
+ 160, 161, 1304, 1302, 1303, 245, 245, 1305,
+ 2844, 2844, 1304, 1302, 246, 1303, 246, 1305,
+ 1304, 1302, 1303, 162, 162, 1305, 2845, 2845,
+ 1304, 1302, 1303, 163, 163, 1305, 2846, 2846,
+ 1304, 1302, 1303, 164, 164, 1305, 2847, 2847,
+ 1304, 1302, 1303, 165, 165, 1305, 2848, 2848,
+ 1304, 1302, 166, 1303, 2849, 1305, 1304, 1302,
+ 1303, 167, 168, 167, 168, 1305, 2850, 2851,
+ 2850, 2851, 1304, 1302, 1303, 169, 169, 1305,
+ 169, 169, 1304, 1302, 1303, 242, 242, 1305,
+ 2852, 2852, 1304, 1302, 1303, 243, 243, 1305,
+ 2853, 2853, 1304, 1302, 1303, 244, 244, 1305,
+ 244, 244, 1304, 1302, 1303, 170, 170, 1305,
+ 2854, 2854, 1304, 1302, 1303, 171, 171, 1305,
+ 2855, 2855, 1304, 1302, 1303, 172, 172, 1305,
+ 172, 172, 1304, 1302, 1303, 173, 174, 175,
+ 173, 174, 175, 1305, 2856, 2857, 2858, 2856,
+ 2857, 2858, 1304, 1302, 1303, 176, 177, 178,
+ 176, 177, 178, 1305, 2859, 2860, 2861, 2859,
+ 2860, 2861, 1304, 1302, 1303, 179, 179, 1305,
+ 2862, 2862, 1304, 1302, 1303, 180, 180, 1305,
+ 2863, 2863, 1304, 1302, 1303, 181, 181, 1305,
+ 2864, 2864, 1304, 1302, 1303, 175, 175, 1305,
+ 2858, 2858, 1304, 1302, 1303, 182, 182, 1305,
+ 182, 182, 1304, 1302, 1303, 223, 223, 1305,
+ 223, 223, 1304, 1302, 2621, 2622, 2623, 2624,
+ 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632,
+ 2633, 2634, 2635, 2636, 2623, 2624, 2625, 2626,
+ 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634,
+ 2635, 2636, 2621, 2638, 2865, 2865, 2637, 2620,
+ 1303, 224, 224, 1305, 2866, 2866, 1304, 1302,
+ 1303, 225, 225, 1305, 2867, 2867, 1304, 1302,
+ 1303, 226, 226, 1305, 226, 226, 1304, 1302,
+ 1303, 227, 227, 1305, 2868, 2868, 1304, 1302,
+ 1303, 228, 228, 1305, 2869, 2869, 1304, 1302,
+ 1303, 229, 229, 1305, 2870, 2870, 1304, 1302,
+ 230, 1303, 2871, 1305, 1304, 1302, 1303, 231,
+ 232, 233, 231, 232, 233, 1305, 2872, 2873,
+ 2874, 2872, 2873, 2874, 1304, 1302, 1303, 234,
+ 234, 1305, 234, 234, 1304, 1302, 1303, 235,
+ 235, 1305, 2875, 2875, 1304, 1302, 1303, 236,
+ 236, 1305, 2876, 2876, 1304, 1302, 1303, 237,
+ 237, 1305, 237, 237, 1304, 1302, 1303, 238,
+ 238, 1305, 2877, 2877, 1304, 1302, 1303, 239,
+ 239, 1305, 2878, 2878, 1304, 1302, 1303, 240,
+ 240, 1305, 2879, 2879, 1304, 1302, 1303, 241,
+ 241, 1305, 241, 241, 1304, 1302, 1303, 183,
+ 183, 1305, 2880, 2880, 1304, 1302, 1303, 184,
+ 184, 1305, 2881, 2881, 1304, 1302, 1303, 185,
+ 185, 1305, 2882, 2882, 1304, 1302, 1303, 186,
+ 186, 1305, 186, 186, 1304, 1302, 1303, 187,
+ 188, 189, 190, 187, 188, 189, 190, 1305,
+ 2883, 2884, 2885, 2886, 2883, 2884, 2885, 2886,
+ 1304, 1302, 1303, 191, 191, 1305, 191, 191,
+ 1304, 1302, 1303, 194, 195, 196, 194, 195,
+ 196, 1305, 194, 2887, 2888, 194, 2887, 2888,
+ 1304, 1302, 1303, 197, 197, 1305, 2889, 2889,
+ 1304, 1302, 1303, 198, 198, 1305, 2890, 2890,
+ 1304, 1302, 1303, 199, 199, 1305, 2891, 2891,
+ 1304, 1302, 1303, 200, 200, 1305, 2892, 2892,
+ 1304, 1302, 201, 1303, 2893, 1305, 1304, 1302,
+ 1303, 202, 202, 1305, 2894, 2894, 1304, 1302,
+ 1303, 203, 203, 1305, 203, 203, 1304, 1302,
+ 1303, 204, 204, 1305, 2895, 2895, 1304, 1302,
+ 1303, 205, 205, 1305, 2896, 2896, 1304, 1302,
+ 1303, 206, 206, 1305, 206, 206, 1304, 1302,
+ 1303, 207, 207, 1305, 2897, 2897, 1304, 1302,
+ 1303, 208, 208, 1305, 208, 208, 1304, 1302,
+ 1303, 209, 209, 1305, 2898, 2898, 1304, 1302,
+ 1303, 210, 210, 1305, 2899, 2899, 1304, 1302,
+ 211, 1303, 2900, 1305, 1304, 1302, 1303, 212,
+ 213, 214, 212, 213, 214, 1305, 2901, 2902,
+ 2903, 2901, 2902, 2903, 1304, 1302, 1303, 215,
+ 215, 1305, 215, 215, 1304, 1302, 1303, 216,
+ 217, 216, 217, 1305, 2904, 2905, 2904, 2905,
+ 1304, 1302, 1303, 218, 218, 1305, 2906, 2906,
+ 1304, 1302, 1303, 219, 219, 1305, 219, 219,
+ 1304, 1302, 1303, 220, 220, 1305, 220, 220,
+ 1304, 1302, 1303, 221, 221, 1305, 2907, 2907,
+ 1304, 1302, 1303, 222, 222, 1305, 222, 222,
+ 1304, 1302, 1303, 192, 192, 1305, 192, 192,
+ 1304, 1302, 1303, 193, 193, 1305, 193, 193,
+ 1304, 1302, 2909, 2910, 261, 2909, 2910, 261,
+ 2911, 2908, 2910, 2910, 2911, 2908, 2913, 2913,
+ 2914, 2912, 0
+ };
-static const short _demo_machine_parser_cmd_indicies[] = {
- 0, 1, 2, 0, 2, 4, 2, 3,
- 2, 3, 1, 5, 5, 5, 6, 5,
- 6, 1, 7, 1, 9, 10, 9, 10,
- 8, 11, 11, 8, 12, 12, 8, 13,
- 13, 8, 14, 14, 8, 15, 8, 16,
- 16, 8, 17, 18, 17, 18, 8, 19,
- 19, 8, 20, 20, 8, 21, 21, 8,
- 22, 22, 8, 23, 23, 8, 24, 24,
- 8, 25, 25, 8, 26, 26, 8, 27,
- 27, 8, 28, 28, 8, 29, 30, 29,
- 30, 8, 31, 31, 8, 32, 32, 8,
- 33, 33, 8, 34, 8, 35, 35, 8,
- 36, 36, 8, 37, 37, 8, 38, 38,
- 8, 39, 39, 8, 40, 40, 8, 30,
- 30, 8, 41, 41, 8, 42, 42, 8,
- 43, 43, 8, 44, 44, 8, 45, 45,
- 8, 46, 46, 8, 47, 47, 8, 48,
- 48, 8, 49, 49, 8, 50, 50, 8,
- 51, 51, 8, 52, 52, 8, 53, 53,
- 8, 54, 54, 8, 55, 55, 8, 56,
- 57, 56, 57, 8, 58, 58, 8, 59,
- 59, 8, 60, 60, 8, 61, 61, 8,
- 62, 63, 64, 65, 66, 67, 62, 63,
- 64, 65, 66, 67, 8, 68, 68, 8,
- 69, 69, 8, 70, 70, 8, 71, 71,
- 8, 72, 72, 8, 65, 65, 8, 73,
- 73, 8, 74, 74, 8, 75, 75, 8,
- 76, 76, 8, 77, 77, 8, 78, 78,
- 8, 79, 79, 8, 80, 80, 8, 81,
- 81, 8, 82, 82, 8, 83, 83, 8,
- 84, 84, 8, 85, 85, 8, 86, 86,
- 8, 87, 87, 8, 88, 88, 8, 89,
- 89, 8, 90, 90, 8, 91, 91, 8,
- 92, 92, 8, 93, 93, 8, 94, 94,
- 8, 95, 95, 8, 96, 96, 8, 97,
- 97, 8, 98, 98, 8, 99, 99, 8,
- 100, 100, 8, 101, 101, 8, 102, 102,
- 8, 103, 103, 8, 104, 104, 8, 23,
- 104, 23, 104, 8, 105, 105, 8, 106,
- 106, 8, 107, 107, 8, 108, 108, 8,
- 109, 109, 8, 110, 110, 8, 111, 111,
- 8, 112, 1, 114, 113, 115, 115, 113,
- 116, 116, 113, 117, 117, 113, 118, 118,
- 113, 119, 119, 113, 120, 120, 113, 121,
- 121, 113, 122, 122, 113, 118, 118, 113,
- 123, 124, 125, 123, 124, 125, 113, 126,
- 126, 113, 127, 127, 113, 128, 128, 113,
- 129, 129, 113, 124, 124, 113, 130, 130,
- 113, 131, 131, 113, 132, 132, 113, 133,
- 133, 113, 134, 134, 113, 135, 135, 113,
- 136, 136, 113, 137, 138, 137, 138, 113,
- 139, 139, 113, 140, 140, 113, 141, 141,
- 113, 142, 143, 113, 144, 145, 144, 145,
- 113, 146, 146, 113, 147, 147, 113, 148,
- 148, 113, 149, 149, 113, 150, 150, 113,
- 151, 151, 113, 152, 152, 113, 153, 153,
- 113, 154, 154, 113, 155, 155, 113, 156,
- 156, 113, 157, 158, 157, 158, 113, 159,
- 159, 113, 160, 161, 160, 161, 113, 162,
- 162, 113, 163, 163, 113, 164, 164, 113,
- 165, 165, 113, 166, 113, 167, 168, 167,
- 168, 113, 169, 169, 113, 170, 170, 113,
- 171, 171, 113, 172, 172, 113, 173, 174,
- 175, 173, 174, 175, 113, 176, 177, 178,
- 176, 177, 178, 113, 179, 179, 113, 180,
- 180, 113, 181, 181, 113, 175, 175, 113,
- 182, 182, 113, 183, 183, 113, 184, 184,
- 113, 185, 185, 113, 186, 186, 113, 187,
- 188, 189, 190, 187, 188, 189, 190, 113,
- 191, 191, 113, 192, 192, 113, 193, 193,
- 113, 194, 195, 196, 194, 195, 196, 113,
- 197, 197, 113, 198, 198, 113, 199, 199,
- 113, 200, 200, 113, 201, 113, 202, 202,
- 113, 203, 203, 113, 204, 204, 113, 205,
- 205, 113, 206, 206, 113, 207, 207, 113,
- 208, 208, 113, 209, 209, 113, 210, 210,
- 113, 211, 113, 212, 213, 214, 212, 213,
- 214, 113, 215, 215, 113, 216, 217, 216,
- 217, 113, 218, 218, 113, 219, 219, 113,
- 220, 220, 113, 221, 221, 113, 222, 222,
- 113, 223, 223, 113, 224, 224, 113, 225,
- 225, 113, 226, 226, 113, 227, 227, 113,
- 228, 228, 113, 229, 229, 113, 230, 113,
- 231, 232, 233, 231, 232, 233, 113, 234,
- 234, 113, 235, 235, 113, 236, 236, 113,
- 237, 237, 113, 238, 238, 113, 239, 239,
- 113, 240, 240, 113, 241, 241, 113, 242,
- 242, 113, 243, 243, 113, 244, 244, 113,
- 245, 245, 113, 246, 113, 247, 247, 113,
- 248, 248, 113, 249, 249, 113, 250, 250,
- 113, 193, 193, 113, 251, 252, 251, 252,
- 113, 253, 253, 113, 254, 254, 113, 255,
- 113, 256, 256, 113, 257, 257, 113, 258,
- 258, 113, 259, 259, 113, 260, 260, 113,
- 261, 1, 263, 264, 265, 266, 267, 262,
- 269, 268, 271, 270, 273, 273, 273, 274,
- 273, 274, 272, 276, 275, 279, 280, 281,
- 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 280, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 278, 295, 279, 296, 297, 298,
- 299, 300, 301, 302, 303, 304, 305, 306,
- 307, 308, 309, 296, 297, 298, 299, 300,
- 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 278, 311, 312, 313, 314, 315, 316,
- 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 311, 312, 313, 314, 315, 316, 317,
- 318, 319, 320, 321, 322, 323, 324, 325,
- 295, 326, 327, 326, 327, 295, 328, 328,
- 295, 329, 329, 295, 330, 330, 295, 331,
- 331, 295, 332, 295, 333, 333, 295, 334,
- 335, 334, 335, 295, 336, 336, 295, 337,
- 337, 295, 338, 338, 295, 339, 339, 295,
- 340, 340, 295, 342, 343, 344, 345, 346,
- 347, 348, 349, 350, 351, 352, 353, 354,
- 355, 342, 343, 344, 345, 346, 347, 348,
- 349, 350, 351, 352, 353, 354, 355, 295,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372,
- 295, 374, 375, 376, 377, 378, 379, 380,
- 381, 382, 383, 384, 385, 386, 387, 388,
- 374, 375, 376, 377, 378, 379, 380, 381,
- 382, 383, 384, 385, 386, 387, 388, 295,
- 389, 389, 295, 391, 392, 393, 394, 395,
- 396, 397, 398, 399, 400, 401, 402, 403,
- 404, 391, 392, 393, 394, 395, 396, 397,
- 398, 399, 400, 401, 402, 403, 404, 295,
- 406, 407, 408, 409, 410, 411, 412, 413,
- 414, 415, 416, 417, 418, 419, 420, 406,
- 407, 408, 409, 410, 411, 412, 413, 414,
- 415, 416, 417, 418, 419, 420, 295, 422,
- 423, 424, 425, 426, 427, 428, 429, 430,
- 431, 432, 433, 434, 435, 436, 422, 423,
- 424, 425, 426, 427, 428, 429, 430, 431,
- 432, 433, 434, 435, 436, 295, 437, 437,
- 295, 438, 438, 295, 439, 439, 295, 435,
- 435, 295, 441, 442, 443, 444, 445, 446,
- 447, 448, 449, 450, 451, 452, 453, 454,
- 441, 442, 443, 444, 445, 446, 447, 448,
- 449, 450, 451, 452, 453, 454, 295, 455,
- 456, 455, 456, 295, 457, 457, 295, 458,
- 458, 295, 459, 459, 295, 460, 295, 461,
- 461, 295, 462, 462, 295, 463, 463, 295,
- 464, 464, 295, 465, 465, 295, 466, 466,
- 295, 456, 456, 295, 468, 469, 470, 471,
- 472, 473, 474, 475, 476, 477, 478, 479,
- 480, 481, 468, 469, 470, 471, 472, 473,
- 474, 475, 476, 477, 478, 479, 480, 481,
- 295, 483, 484, 485, 486, 487, 488, 489,
- 490, 491, 492, 493, 494, 495, 496, 483,
- 484, 485, 486, 487, 488, 489, 490, 491,
- 492, 493, 494, 495, 496, 295, 497, 497,
- 295, 498, 498, 295, 499, 499, 295, 500,
- 500, 295, 501, 501, 295, 483, 484, 485,
- 502, 487, 488, 489, 490, 491, 492, 493,
- 494, 495, 496, 483, 484, 485, 502, 487,
- 488, 489, 490, 491, 492, 493, 494, 495,
- 496, 295, 503, 503, 295, 504, 504, 295,
- 506, 507, 508, 509, 510, 511, 512, 513,
- 514, 515, 516, 517, 518, 519, 520, 506,
- 507, 508, 509, 510, 511, 512, 513, 514,
- 515, 516, 517, 518, 519, 520, 295, 521,
- 521, 295, 522, 522, 295, 523, 523, 295,
- 506, 507, 508, 509, 510, 511, 513, 514,
- 515, 516, 517, 518, 519, 520, 506, 507,
- 508, 509, 510, 511, 513, 514, 515, 516,
- 517, 518, 519, 520, 295, 524, 524, 295,
- 525, 525, 295, 527, 528, 529, 530, 531,
- 532, 533, 534, 535, 536, 537, 538, 539,
- 540, 527, 528, 529, 530, 531, 532, 533,
- 534, 535, 536, 537, 538, 539, 540, 295,
- 541, 541, 295, 542, 542, 295, 543, 543,
- 295, 527, 528, 529, 530, 531, 532, 544,
- 534, 535, 536, 537, 538, 539, 540, 527,
- 528, 529, 530, 531, 532, 544, 534, 535,
- 536, 537, 538, 539, 540, 295, 374, 545,
- 376, 377, 378, 379, 380, 381, 382, 383,
- 384, 385, 386, 388, 387, 374, 545, 376,
- 377, 378, 379, 380, 381, 382, 383, 384,
- 385, 386, 388, 387, 295, 547, 548, 549,
- 550, 551, 552, 553, 554, 555, 556, 557,
- 558, 559, 560, 561, 547, 548, 549, 550,
- 551, 552, 553, 554, 555, 556, 557, 558,
- 559, 560, 561, 295, 562, 563, 562, 563,
- 295, 565, 566, 567, 568, 569, 570, 571,
- 572, 573, 574, 575, 576, 577, 578, 579,
- 565, 566, 567, 568, 569, 570, 571, 572,
- 573, 574, 575, 576, 577, 578, 579, 295,
- 580, 580, 295, 581, 581, 295, 582, 582,
- 295, 583, 583, 295, 565, 566, 567, 568,
- 569, 570, 572, 573, 574, 575, 576, 577,
- 578, 579, 565, 566, 567, 568, 569, 570,
- 572, 573, 574, 575, 576, 577, 578, 579,
- 295, 584, 585, 586, 587, 588, 589, 584,
- 585, 586, 587, 588, 589, 295, 590, 590,
- 295, 591, 591, 295, 592, 592, 295, 593,
- 593, 295, 594, 594, 295, 587, 587, 295,
- 596, 597, 598, 599, 600, 601, 602, 603,
- 604, 605, 606, 607, 608, 609, 596, 597,
- 598, 599, 600, 601, 602, 603, 604, 605,
- 606, 607, 608, 609, 295, 611, 612, 613,
- 614, 615, 616, 617, 618, 619, 620, 621,
- 622, 623, 624, 625, 611, 612, 613, 614,
- 615, 616, 617, 618, 619, 620, 621, 622,
- 623, 624, 625, 295, 626, 626, 295, 627,
- 627, 295, 628, 628, 295, 611, 612, 613,
- 614, 615, 616, 618, 619, 620, 621, 622,
- 623, 624, 625, 611, 612, 613, 614, 615,
- 616, 618, 619, 620, 621, 622, 623, 624,
- 625, 295, 629, 629, 295, 630, 630, 295,
- 631, 631, 295, 633, 634, 635, 636, 637,
- 638, 639, 640, 641, 642, 643, 644, 645,
- 646, 633, 634, 635, 636, 637, 638, 639,
- 640, 641, 642, 643, 644, 645, 646, 295,
- 647, 647, 295, 649, 650, 651, 652, 653,
- 654, 655, 656, 657, 658, 659, 660, 661,
- 662, 649, 650, 651, 652, 653, 654, 655,
- 656, 657, 658, 659, 660, 661, 662, 295,
- 663, 663, 295, 664, 664, 295, 666, 667,
- 668, 669, 670, 671, 672, 673, 674, 675,
- 676, 677, 678, 679, 666, 667, 668, 669,
- 670, 671, 672, 673, 674, 675, 676, 677,
- 678, 679, 295, 680, 680, 295, 682, 683,
- 684, 685, 686, 687, 688, 689, 690, 691,
- 692, 693, 694, 695, 682, 683, 684, 685,
- 686, 687, 688, 689, 690, 691, 692, 693,
- 694, 695, 295, 696, 696, 295, 697, 697,
- 295, 698, 698, 295, 699, 699, 295, 700,
- 700, 295, 682, 683, 684, 685, 686, 687,
- 688, 689, 690, 691, 692, 693, 701, 695,
- 682, 683, 684, 685, 686, 687, 688, 689,
- 690, 691, 692, 693, 701, 695, 295, 703,
- 704, 705, 706, 707, 708, 709, 710, 711,
- 712, 713, 714, 715, 716, 717, 703, 704,
- 705, 706, 707, 708, 709, 710, 711, 712,
- 713, 714, 715, 716, 717, 295, 718, 718,
- 295, 719, 719, 295, 703, 704, 705, 706,
- 707, 708, 709, 710, 711, 712, 713, 714,
- 715, 717, 703, 704, 705, 706, 707, 708,
- 709, 710, 711, 712, 713, 714, 715, 717,
- 295, 720, 720, 295, 547, 548, 549, 721,
- 551, 552, 553, 554, 555, 556, 557, 558,
- 559, 561, 547, 548, 549, 721, 551, 552,
- 553, 554, 555, 556, 557, 558, 559, 561,
- 295, 722, 722, 295, 723, 723, 295, 374,
- 545, 376, 377, 378, 379, 380, 381, 382,
- 383, 384, 385, 386, 387, 374, 545, 376,
- 377, 378, 379, 380, 381, 382, 383, 384,
- 385, 386, 387, 295, 724, 724, 295, 725,
- 725, 295, 726, 423, 424, 727, 426, 427,
- 428, 429, 728, 431, 432, 433, 434, 436,
- 726, 423, 424, 727, 426, 427, 428, 429,
- 728, 431, 432, 433, 434, 436, 295, 730,
- 731, 732, 733, 734, 735, 736, 737, 738,
- 739, 740, 741, 742, 743, 730, 731, 732,
- 733, 734, 735, 736, 737, 738, 739, 740,
- 741, 742, 743, 295, 744, 744, 295, 730,
- 731, 732, 733, 734, 735, 745, 737, 738,
- 739, 740, 741, 742, 743, 730, 731, 732,
- 733, 734, 735, 745, 737, 738, 739, 740,
- 741, 742, 743, 295, 746, 746, 295, 747,
- 747, 295, 406, 407, 408, 409, 410, 411,
- 413, 414, 415, 416, 417, 418, 419, 420,
- 406, 407, 408, 409, 410, 411, 413, 414,
- 415, 416, 417, 418, 419, 420, 295, 748,
- 748, 295, 749, 749, 295, 751, 752, 753,
- 754, 755, 756, 757, 758, 759, 760, 761,
- 762, 763, 764, 751, 752, 753, 754, 755,
- 756, 757, 758, 759, 760, 761, 762, 763,
- 764, 295, 765, 765, 295, 766, 766, 295,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 372, 357, 358,
- 359, 360, 361, 362, 363, 364, 365, 366,
- 367, 368, 369, 372, 295, 767, 767, 295,
- 768, 768, 295, 769, 769, 295, 771, 772,
- 773, 774, 775, 776, 777, 778, 779, 780,
- 781, 782, 783, 784, 771, 772, 773, 774,
- 775, 776, 777, 778, 779, 780, 781, 782,
- 783, 784, 295, 340, 769, 340, 769, 295,
- 785, 785, 295, 786, 786, 295, 787, 787,
- 295, 311, 312, 313, 314, 315, 316, 317,
- 318, 319, 320, 321, 322, 323, 788, 311,
- 312, 313, 314, 315, 316, 317, 318, 319,
- 320, 321, 322, 323, 788, 295, 789, 789,
- 295, 790, 790, 295, 791, 791, 295, 325,
- 325, 295, 793, 794, 795, 796, 797, 798,
- 799, 800, 801, 802, 803, 804, 805, 806,
- 793, 794, 795, 796, 797, 798, 799, 800,
- 801, 802, 803, 804, 805, 806, 295, 808,
- 809, 810, 811, 812, 813, 814, 815, 816,
- 817, 818, 819, 820, 821, 111, 808, 809,
- 810, 811, 812, 813, 814, 815, 816, 817,
- 818, 819, 820, 821, 111, 807, 823, 824,
- 825, 826, 827, 828, 829, 830, 831, 832,
- 833, 834, 835, 836, 823, 824, 825, 826,
- 827, 828, 829, 830, 831, 832, 833, 834,
- 835, 836, 822, 838, 839, 840, 841, 842,
- 843, 844, 845, 846, 847, 848, 849, 850,
- 851, 852, 853, 838, 839, 840, 841, 842,
- 843, 844, 845, 846, 847, 848, 849, 850,
- 851, 852, 853, 837, 855, 856, 857, 858,
- 859, 860, 861, 862, 863, 864, 865, 866,
- 867, 868, 869, 855, 856, 857, 858, 859,
- 860, 861, 862, 863, 864, 865, 866, 867,
- 868, 869, 854, 871, 872, 873, 874, 875,
- 876, 877, 878, 879, 880, 881, 882, 883,
- 884, 871, 872, 873, 874, 875, 876, 877,
- 878, 879, 880, 881, 882, 883, 884, 870,
- 886, 887, 888, 889, 890, 891, 892, 893,
- 894, 895, 896, 897, 898, 899, 900, 886,
- 887, 888, 889, 890, 891, 892, 893, 894,
- 895, 896, 897, 898, 899, 900, 885, 902,
- 903, 904, 905, 906, 907, 908, 909, 910,
- 911, 912, 913, 914, 28, 915, 902, 903,
- 904, 905, 906, 907, 908, 909, 910, 911,
- 912, 913, 914, 28, 915, 901, 917, 918,
- 919, 920, 921, 922, 923, 924, 925, 926,
- 927, 928, 929, 930, 917, 918, 919, 920,
- 921, 922, 923, 924, 925, 926, 927, 928,
- 929, 930, 916, 932, 933, 934, 935, 936,
- 937, 938, 939, 940, 941, 942, 943, 944,
- 945, 932, 933, 934, 935, 936, 937, 938,
- 939, 940, 941, 942, 943, 944, 945, 931,
- 947, 948, 949, 950, 951, 952, 953, 954,
- 955, 956, 957, 958, 959, 960, 947, 948,
- 949, 950, 951, 952, 953, 954, 955, 956,
- 957, 958, 959, 960, 946, 947, 948, 949,
- 961, 951, 952, 953, 954, 955, 956, 957,
- 958, 959, 960, 947, 948, 949, 961, 951,
- 952, 953, 954, 955, 956, 957, 958, 959,
- 960, 946, 963, 964, 965, 966, 967, 968,
- 969, 970, 971, 972, 973, 974, 975, 976,
- 977, 963, 964, 965, 966, 967, 968, 969,
- 970, 971, 972, 973, 974, 975, 976, 977,
- 962, 963, 964, 965, 966, 967, 968, 970,
- 971, 972, 973, 974, 975, 976, 977, 963,
- 964, 965, 966, 967, 968, 970, 971, 972,
- 973, 974, 975, 976, 977, 962, 979, 980,
- 981, 982, 983, 984, 985, 986, 987, 988,
- 989, 990, 991, 992, 979, 980, 981, 982,
- 983, 984, 985, 986, 987, 988, 989, 990,
- 991, 992, 978, 979, 980, 981, 982, 983,
- 984, 993, 986, 987, 988, 989, 990, 991,
- 992, 979, 980, 981, 982, 983, 984, 993,
- 986, 987, 988, 989, 990, 991, 992, 978,
- 855, 994, 857, 858, 859, 860, 861, 862,
- 863, 864, 865, 866, 867, 869, 868, 855,
- 994, 857, 858, 859, 860, 861, 862, 863,
- 864, 865, 866, 867, 869, 868, 854, 996,
- 997, 998, 999, 1000, 1001, 1002, 1003, 1004,
- 1005, 1006, 1007, 1008, 1009, 1010, 996, 997,
- 998, 999, 1000, 1001, 1002, 1003, 1004, 1005,
- 1006, 1007, 1008, 1009, 1010, 995, 1012, 1013,
- 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021,
- 1022, 1023, 1024, 1025, 1026, 1012, 1013, 1014,
- 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022,
- 1023, 1024, 1025, 1026, 1011, 1012, 1013, 1014,
- 1015, 1016, 1017, 1019, 1020, 1021, 1022, 1023,
- 1024, 1025, 1026, 1012, 1013, 1014, 1015, 1016,
- 1017, 1019, 1020, 1021, 1022, 1023, 1024, 1025,
- 1026, 1011, 1028, 1029, 1030, 1031, 1032, 1033,
- 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041,
- 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035,
- 1036, 1037, 1038, 1039, 1040, 1041, 1027, 1043,
- 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051,
- 1052, 1053, 1054, 1055, 1056, 1057, 1043, 1044,
- 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052,
- 1053, 1054, 1055, 1056, 1057, 1042, 1043, 1044,
- 1045, 1046, 1047, 1048, 1050, 1051, 1052, 1053,
- 1054, 1055, 1056, 1057, 1043, 1044, 1045, 1046,
- 1047, 1048, 1050, 1051, 1052, 1053, 1054, 1055,
- 1056, 1057, 1042, 1059, 1060, 1061, 1062, 1063,
- 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071,
- 1072, 1059, 1060, 1061, 1062, 1063, 1064, 1065,
- 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1058,
- 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081,
- 1082, 1083, 1084, 1085, 1086, 1087, 1074, 1075,
- 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083,
- 1084, 1085, 1086, 1087, 1073, 1089, 1090, 1091,
- 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099,
- 1100, 1101, 1102, 1089, 1090, 1091, 1092, 1093,
- 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101,
- 1102, 1088, 1104, 1105, 1106, 1107, 1108, 1109,
- 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117,
- 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111,
- 1112, 1113, 1114, 1115, 1116, 1117, 1103, 1104,
- 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112,
- 1113, 1114, 1115, 1118, 1117, 1104, 1105, 1106,
- 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114,
- 1115, 1118, 1117, 1103, 1120, 1121, 1122, 1123,
- 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
- 1132, 1133, 1134, 1120, 1121, 1122, 1123, 1124,
- 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132,
- 1133, 1134, 1119, 1120, 1121, 1122, 1123, 1124,
- 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132,
- 1134, 1120, 1121, 1122, 1123, 1124, 1125, 1126,
- 1127, 1128, 1129, 1130, 1131, 1132, 1134, 1119,
- 996, 997, 998, 1135, 1000, 1001, 1002, 1003,
- 1004, 1005, 1006, 1007, 1008, 1010, 996, 997,
- 998, 1135, 1000, 1001, 1002, 1003, 1004, 1005,
- 1006, 1007, 1008, 1010, 995, 855, 994, 857,
- 858, 859, 860, 861, 862, 863, 864, 865,
- 866, 867, 868, 855, 994, 857, 858, 859,
- 860, 861, 862, 863, 864, 865, 866, 867,
- 868, 854, 1136, 903, 904, 1137, 906, 907,
- 908, 909, 1138, 911, 912, 913, 914, 915,
- 1136, 903, 904, 1137, 906, 907, 908, 909,
- 1138, 911, 912, 913, 914, 915, 901, 1140,
- 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148,
- 1149, 1150, 1151, 1152, 1153, 1140, 1141, 1142,
- 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150,
- 1151, 1152, 1153, 1139, 1140, 1141, 1142, 1143,
- 1144, 1145, 1154, 1147, 1148, 1149, 1150, 1151,
- 1152, 1153, 1140, 1141, 1142, 1143, 1144, 1145,
- 1154, 1147, 1148, 1149, 1150, 1151, 1152, 1153,
- 1139, 886, 887, 888, 889, 890, 891, 893,
- 894, 895, 896, 897, 898, 899, 900, 886,
- 887, 888, 889, 890, 891, 893, 894, 895,
- 896, 897, 898, 899, 900, 885, 1156, 1157,
- 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165,
- 1166, 1167, 1168, 1169, 1156, 1157, 1158, 1159,
- 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167,
- 1168, 1169, 1155, 838, 839, 840, 841, 842,
- 843, 844, 845, 846, 847, 848, 849, 850,
- 853, 838, 839, 840, 841, 842, 843, 844,
- 845, 846, 847, 848, 849, 850, 853, 837,
- 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178,
- 1179, 1180, 1181, 1182, 1183, 1184, 1171, 1172,
- 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180,
- 1181, 1182, 1183, 1184, 1170, 808, 809, 810,
- 811, 812, 813, 814, 815, 816, 817, 818,
- 819, 820, 1185, 808, 809, 810, 811, 812,
- 813, 814, 815, 816, 817, 818, 819, 820,
- 1185, 807, 1187, 1188, 1189, 1190, 1191, 1192,
- 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200,
- 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194,
- 1195, 1196, 1197, 1198, 1199, 1200, 1186, 1203,
- 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211,
- 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219,
- 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213,
- 1214, 1215, 1216, 1217, 1218, 1219, 1203, 1221,
- 1222, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
- 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1206,
- 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214,
- 1215, 1216, 1217, 1218, 1219, 1202, 1220, 1201,
- 1225, 1226, 1225, 1228, 1224, 1227, 1223, 1230,
- 1231, 1230, 1233, 1232, 1229, 1236, 1237, 1238,
- 1239, 1240, 1238, 1239, 1240, 1236, 1235, 1243,
- 1243, 1242, 1245, 1245, 1244, 1236, 1237, 1246,
- 1247, 1248, 1246, 1247, 1248, 1236, 1235, 1250,
- 1251, 1252, 1253, 1254, 1251, 1252, 1253, 1254,
- 1250, 1242, 1243, 1255, 1255, 1243, 1242, 1243,
- 1256, 1256, 1243, 1242, 1243, 1257, 1257, 1243,
- 1242, 1243, 1258, 1258, 1243, 1242, 1250, 1251,
- 1253, 1254, 1251, 1253, 1254, 1250, 1242, 1250,
- 1251, 1259, 1253, 1254, 1251, 1259, 1253, 1254,
- 1250, 1242, 1243, 1260, 1260, 1243, 1242, 1243,
- 1261, 1261, 1243, 1242, 1243, 1262, 1262, 1243,
- 1242, 1243, 1263, 1263, 1243, 1242, 1243, 1258,
- 1258, 1243, 1242, 1243, 1264, 1265, 1266, 1264,
- 1265, 1266, 1243, 1242, 1243, 1267, 1267, 1243,
- 1242, 1243, 1268, 1268, 1243, 1242, 1243, 1269,
- 1269, 1243, 1242, 1243, 1270, 1270, 1243, 1242,
- 1243, 1265, 1265, 1243, 1242, 1272, 1273, 1274,
- 1275, 1273, 1274, 1275, 1272, 1242, 1277, 1278,
- 1279, 1280, 1278, 1279, 1280, 1277, 1242, 1243,
- 1281, 1281, 1243, 1242, 1243, 1282, 1282, 1243,
- 1242, 1277, 1283, 1279, 1280, 1283, 1279, 1280,
- 1277, 1242, 1285, 1286, 1287, 1288, 1289, 1286,
- 1287, 1288, 1289, 1285, 1284, 1285, 1286, 1288,
- 1289, 1286, 1288, 1289, 1285, 1284, 1285, 1286,
- 1290, 1288, 1289, 1286, 1290, 1288, 1289, 1285,
- 1284, 1292, 1293, 1294, 1295, 1293, 1294, 1295,
- 1292, 1291, 1297, 1298, 1299, 1300, 1298, 1299,
- 1300, 1297, 1296, 1297, 1301, 1299, 1300, 1301,
- 1299, 1300, 1297, 1296, 1303, 1305, 1304, 1302,
- 1306, 1307, 1304, 1302, 1236, 1309, 1238, 1239,
- 1240, 1238, 1239, 1240, 1311, 1312, 1313, 1314,
- 1315, 1313, 1314, 1315, 1235, 1236, 1235, 1310,
- 1311, 1310, 1308, 1243, 1317, 1319, 1320, 1242,
- 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1321,
- 1243, 1242, 1245, 1303, 1322, 1305, 1245, 1304,
- 1322, 1304, 1302, 1243, 1323, 1319, 1324, 1242,
- 1243, 1242, 1318, 1319, 1318, 1316, 1236, 1309,
- 1246, 1247, 1248, 1246, 1247, 1248, 1311, 1312,
- 1325, 1326, 1327, 1325, 1326, 1327, 1235, 1236,
- 1235, 1310, 1311, 1310, 1308, 1250, 1317, 1251,
- 1252, 1253, 1254, 1251, 1252, 1253, 1254, 1329,
- 1320, 1330, 1331, 1332, 1333, 1330, 1331, 1332,
- 1333, 1242, 1250, 1242, 1318, 1329, 1318, 1328,
- 1243, 1317, 1255, 1255, 1319, 1320, 1334, 1334,
- 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1243,
- 1317, 1256, 1256, 1319, 1320, 1335, 1335, 1242,
- 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1317,
- 1257, 1257, 1319, 1320, 1336, 1336, 1242, 1243,
- 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1258,
- 1258, 1319, 1320, 1337, 1337, 1242, 1243, 1242,
- 1318, 1319, 1318, 1316, 1250, 1317, 1251, 1253,
- 1254, 1251, 1253, 1254, 1329, 1320, 1330, 1332,
- 1333, 1330, 1332, 1333, 1242, 1250, 1242, 1318,
- 1329, 1318, 1328, 1250, 1317, 1251, 1259, 1253,
- 1254, 1251, 1259, 1253, 1254, 1329, 1320, 1330,
- 1338, 1332, 1333, 1330, 1338, 1332, 1333, 1242,
- 1250, 1242, 1318, 1329, 1318, 1328, 1243, 1317,
- 1260, 1260, 1319, 1320, 1339, 1339, 1242, 1243,
- 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1261,
- 1261, 1319, 1320, 1340, 1340, 1242, 1243, 1242,
- 1318, 1319, 1318, 1316, 1243, 1317, 1262, 1262,
- 1319, 1320, 1341, 1341, 1242, 1243, 1242, 1318,
- 1319, 1318, 1316, 1243, 1317, 1263, 1263, 1319,
- 1320, 1342, 1342, 1242, 1243, 1242, 1318, 1319,
- 1318, 1316, 1243, 1317, 1258, 1258, 1319, 1320,
- 1337, 1337, 1242, 1243, 1242, 1318, 1319, 1318,
- 1316, 1243, 1317, 1264, 1265, 1266, 1264, 1265,
- 1266, 1319, 1320, 1343, 1344, 1345, 1343, 1344,
- 1345, 1242, 1243, 1242, 1318, 1319, 1318, 1316,
- 1243, 1317, 1267, 1267, 1319, 1320, 1346, 1346,
- 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1243,
- 1317, 1268, 1268, 1319, 1320, 1347, 1347, 1242,
- 1243, 1242, 1318, 1319, 1318, 1316, 1243, 1317,
- 1269, 1269, 1319, 1320, 1348, 1348, 1242, 1243,
- 1242, 1318, 1319, 1318, 1316, 1243, 1317, 1270,
- 1270, 1319, 1320, 1349, 1349, 1242, 1243, 1242,
- 1318, 1319, 1318, 1316, 1243, 1317, 1265, 1265,
- 1319, 1320, 1344, 1344, 1242, 1243, 1242, 1318,
- 1319, 1318, 1316, 1272, 1317, 1273, 1274, 1275,
- 1273, 1274, 1275, 1351, 1320, 1352, 1353, 1354,
- 1352, 1353, 1354, 1242, 1272, 1242, 1318, 1351,
- 1318, 1350, 1277, 1317, 1278, 1279, 1280, 1278,
- 1279, 1280, 1356, 1320, 1357, 1358, 1359, 1357,
- 1358, 1359, 1242, 1277, 1242, 1318, 1356, 1318,
- 1355, 1243, 1317, 1281, 1281, 1319, 1320, 1360,
- 1360, 1242, 1243, 1242, 1318, 1319, 1318, 1316,
- 1243, 1317, 1282, 1282, 1319, 1320, 1361, 1361,
- 1242, 1243, 1242, 1318, 1319, 1318, 1316, 1277,
- 1317, 1283, 1279, 1280, 1283, 1279, 1280, 1356,
- 1320, 1362, 1358, 1359, 1362, 1358, 1359, 1242,
- 1277, 1242, 1318, 1356, 1318, 1355, 1285, 1303,
- 1286, 1287, 1288, 1289, 1286, 1287, 1288, 1289,
- 1364, 1305, 1365, 1366, 1367, 1368, 1365, 1366,
- 1367, 1368, 1285, 1304, 1364, 1304, 1363, 1303,
- 115, 115, 1305, 1369, 1369, 1304, 1302, 1303,
- 116, 116, 1305, 1370, 1370, 1304, 1302, 1303,
- 117, 117, 1305, 1371, 1371, 1304, 1302, 1303,
- 118, 118, 1305, 1372, 1372, 1304, 1302, 1285,
- 1303, 1286, 1288, 1289, 1286, 1288, 1289, 1364,
- 1305, 1365, 1367, 1368, 1365, 1367, 1368, 1285,
- 1304, 1364, 1304, 1363, 1285, 1303, 1286, 1290,
- 1288, 1289, 1286, 1290, 1288, 1289, 1364, 1305,
- 1365, 1373, 1367, 1368, 1365, 1373, 1367, 1368,
- 1285, 1304, 1364, 1304, 1363, 1303, 119, 119,
- 1305, 1374, 1374, 1304, 1302, 1303, 120, 120,
- 1305, 1375, 1375, 1304, 1302, 1303, 121, 121,
- 1305, 1376, 1376, 1304, 1302, 1303, 122, 122,
- 1305, 1377, 1377, 1304, 1302, 1303, 118, 118,
- 1305, 1372, 1372, 1304, 1302, 1303, 123, 124,
- 125, 123, 124, 125, 1305, 1378, 1379, 1380,
- 1378, 1379, 1380, 1304, 1302, 1303, 126, 126,
- 1305, 1381, 1381, 1304, 1302, 1303, 127, 127,
- 1305, 1382, 1382, 1304, 1302, 1303, 128, 128,
- 1305, 1383, 1383, 1304, 1302, 1303, 129, 129,
- 1305, 1384, 1384, 1304, 1302, 1303, 124, 124,
- 1305, 1379, 1379, 1304, 1302, 1292, 1303, 1293,
- 1294, 1295, 1293, 1294, 1295, 1386, 1305, 1387,
- 1388, 1389, 1387, 1388, 1389, 1292, 1304, 1386,
- 1304, 1385, 1297, 1303, 1298, 1299, 1300, 1298,
- 1299, 1300, 1391, 1305, 1392, 1393, 1394, 1392,
- 1393, 1394, 1297, 1304, 1391, 1304, 1390, 1303,
- 130, 130, 1305, 1395, 1395, 1304, 1302, 1303,
- 131, 131, 1305, 1396, 1396, 1304, 1302, 1297,
- 1303, 1301, 1299, 1300, 1301, 1299, 1300, 1391,
- 1305, 1397, 1393, 1394, 1397, 1393, 1394, 1297,
- 1304, 1391, 1304, 1390, 1203, 1204, 1205, 1398,
- 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406,
- 1407, 1408, 1409, 1410, 1411, 1398, 1399, 1400,
- 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408,
- 1409, 1410, 1411, 1203, 1221, 1222, 1227, 1220,
- 1227, 1220, 1227, 1227, 1220, 1227, 1220, 1227,
- 1202, 1220, 1227, 1220, 1227, 1220, 1227, 1220,
- 1227, 1220, 1201, 1225, 1226, 1412, 1412, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 1413, 1413,
- 1225, 1228, 1224, 1227, 1223, 1415, 1416, 1417,
- 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425,
- 1426, 1427, 1428, 1429, 1430, 1417, 1418, 1419,
- 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427,
- 1428, 1429, 1430, 1415, 1432, 1224, 1431, 1414,
- 1225, 1226, 1433, 1433, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1434, 1434, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1435, 1435, 1225, 1228,
- 1224, 1227, 1223, 1437, 1438, 1439, 1440, 1441,
- 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449,
- 1450, 1451, 1452, 1439, 1440, 1441, 1442, 1443,
- 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451,
- 1452, 1437, 1454, 1224, 1453, 1436, 1225, 1226,
- 1455, 1456, 1455, 1456, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1457, 1457, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1458, 1458, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1459, 1459, 1225,
- 1228, 1224, 1227, 1223, 1225, 1460, 1461, 1226,
- 1225, 1228, 1224, 1227, 1223, 1463, 1464, 1465,
- 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473,
- 1474, 1475, 1476, 1477, 1478, 1465, 1466, 1467,
- 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475,
- 1476, 1477, 1478, 1463, 1480, 1224, 1479, 1462,
- 1225, 1226, 1481, 1482, 1481, 1482, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1483, 1483, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 1484, 1484,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1485,
- 1485, 1225, 1228, 1224, 1227, 1223, 1487, 1488,
- 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496,
- 1497, 1498, 1499, 1500, 1501, 1502, 1489, 1490,
- 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498,
- 1499, 1500, 1501, 1502, 1487, 1504, 1224, 1503,
- 1486, 1225, 1226, 1505, 1505, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1506, 1506, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1507, 1507, 1225,
- 1228, 1224, 1227, 1223, 1509, 1510, 1511, 1512,
- 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520,
- 1521, 1522, 1523, 1524, 1511, 1512, 1513, 1514,
- 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522,
- 1523, 1524, 1509, 1526, 1224, 1525, 1508, 1225,
- 1226, 1527, 1527, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1528, 1528, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1529, 1529, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1530, 1530, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1531, 1531, 1225,
- 1228, 1224, 1227, 1223, 1533, 1534, 1535, 1536,
- 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544,
- 1545, 1546, 1547, 1548, 1535, 1536, 1537, 1538,
- 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546,
- 1547, 1548, 1533, 1550, 1224, 1549, 1532, 1225,
- 1226, 1551, 1552, 1551, 1552, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1553, 1553, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1554, 1555, 1554,
- 1555, 1225, 1228, 1224, 1227, 1223, 1557, 1558,
- 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566,
- 1567, 1568, 1569, 1570, 1571, 1572, 1559, 1560,
- 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568,
- 1569, 1570, 1571, 1572, 1557, 1574, 1224, 1573,
- 1556, 1225, 1226, 1575, 1575, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1576, 1576, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1577, 1577, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 1578, 1578,
- 1225, 1228, 1224, 1227, 1223, 1225, 1579, 1226,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1580,
- 1581, 1580, 1581, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1582, 1582, 1225, 1228, 1224, 1227,
- 1223, 1584, 1585, 1586, 1587, 1588, 1589, 1590,
- 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598,
- 1599, 1586, 1587, 1588, 1589, 1590, 1591, 1592,
- 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1584,
- 1601, 1224, 1600, 1583, 1225, 1226, 1602, 1602,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1603,
- 1603, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 1604, 1604, 1225, 1228, 1224, 1227, 1223, 1606,
- 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614,
- 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1608,
- 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616,
- 1617, 1618, 1619, 1620, 1621, 1606, 1623, 1224,
- 1622, 1605, 1225, 1226, 1624, 1625, 1626, 1624,
- 1625, 1626, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1627, 1628, 1629, 1627, 1628, 1629, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 1630, 1630,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1631,
- 1631, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 1632, 1632, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1626, 1626, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1633, 1633, 1225, 1228, 1224, 1227,
- 1223, 1635, 1636, 1637, 1638, 1639, 1640, 1641,
- 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649,
- 1650, 1637, 1638, 1639, 1640, 1641, 1642, 1643,
- 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1635,
- 1652, 1224, 1651, 1634, 1225, 1226, 1653, 1653,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1654,
- 1654, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 1655, 1655, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1656, 1656, 1225, 1228, 1224, 1227, 1223,
- 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665,
- 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673,
- 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667,
- 1668, 1669, 1670, 1671, 1672, 1673, 1658, 1675,
- 1224, 1674, 1657, 1225, 1226, 1676, 1677, 1678,
- 1679, 1676, 1677, 1678, 1679, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1680, 1680, 1225, 1228,
- 1224, 1227, 1223, 1682, 1683, 1684, 1685, 1686,
- 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694,
- 1695, 1696, 1697, 1684, 1685, 1686, 1687, 1688,
- 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696,
- 1697, 1682, 1699, 1224, 1698, 1681, 1225, 1226,
- 1700, 1700, 1225, 1228, 1224, 1227, 1223, 1702,
- 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710,
- 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1704,
- 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712,
- 1713, 1714, 1715, 1716, 1717, 1702, 1719, 1224,
- 1718, 1701, 1225, 1226, 1720, 1720, 1225, 1228,
- 1224, 1227, 1223, 1722, 1723, 1724, 1725, 1726,
- 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734,
- 1735, 1736, 1737, 1724, 1725, 1726, 1727, 1728,
- 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736,
- 1737, 1722, 1739, 1224, 1738, 1721, 1225, 1226,
- 1740, 1741, 1742, 1740, 1741, 1742, 1225, 1228,
- 1224, 1227, 1223, 1744, 1745, 1746, 1747, 1748,
- 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756,
- 1757, 1758, 1759, 1746, 1747, 1748, 1749, 1750,
- 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758,
- 1759, 1744, 1761, 1224, 1760, 1743, 1225, 1226,
- 1762, 1762, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1763, 1763, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1764, 1764, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1765, 1765, 1225, 1228, 1224,
- 1227, 1223, 1225, 1766, 1226, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1767, 1767, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1768, 1768, 1225,
- 1228, 1224, 1227, 1223, 1770, 1771, 1772, 1773,
- 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781,
- 1782, 1783, 1784, 1785, 1772, 1773, 1774, 1775,
- 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783,
- 1784, 1785, 1770, 1787, 1224, 1786, 1769, 1225,
- 1226, 1788, 1788, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1789, 1789, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1790, 1790, 1225, 1228, 1224,
- 1227, 1223, 1792, 1793, 1794, 1795, 1796, 1797,
- 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805,
- 1806, 1807, 1794, 1795, 1796, 1797, 1798, 1799,
- 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807,
- 1792, 1809, 1224, 1808, 1791, 1225, 1226, 1810,
- 1810, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 1811, 1811, 1225, 1228, 1224, 1227, 1223, 1813,
- 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821,
- 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1815,
- 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823,
- 1824, 1825, 1826, 1827, 1828, 1813, 1830, 1224,
- 1829, 1812, 1225, 1226, 1831, 1831, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1832, 1832, 1225,
- 1228, 1224, 1227, 1223, 1225, 1833, 1226, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 1834, 1835,
- 1836, 1834, 1835, 1836, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1837, 1837, 1225, 1228, 1224,
- 1227, 1223, 1839, 1840, 1841, 1842, 1843, 1844,
- 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852,
- 1853, 1854, 1841, 1842, 1843, 1844, 1845, 1846,
- 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854,
- 1839, 1856, 1224, 1855, 1838, 1225, 1226, 1857,
- 1858, 1857, 1858, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1859, 1859, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1860, 1860, 1225, 1228, 1224,
- 1227, 1223, 1862, 1863, 1864, 1865, 1866, 1867,
- 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875,
- 1876, 1877, 1864, 1865, 1866, 1867, 1868, 1869,
- 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877,
- 1862, 1879, 1224, 1878, 1861, 1225, 1226, 1880,
- 1880, 1225, 1228, 1224, 1227, 1223, 1882, 1883,
- 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891,
- 1892, 1893, 1894, 1895, 1896, 1897, 1884, 1885,
- 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893,
- 1894, 1895, 1896, 1897, 1882, 1899, 1224, 1898,
- 1881, 1225, 1226, 1900, 1900, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1901, 1901, 1225, 1228,
- 1224, 1227, 1223, 1903, 1904, 1905, 1906, 1907,
- 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915,
- 1916, 1917, 1918, 1905, 1906, 1907, 1908, 1909,
- 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917,
- 1918, 1903, 1920, 1224, 1919, 1902, 1225, 1226,
- 1921, 1921, 1225, 1228, 1224, 1227, 1223, 1923,
- 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931,
- 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1925,
- 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933,
- 1934, 1935, 1936, 1937, 1938, 1923, 1940, 1224,
- 1939, 1922, 1942, 1943, 1944, 1945, 1946, 1947,
- 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955,
- 1956, 1957, 1944, 1945, 1946, 1947, 1948, 1949,
- 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957,
- 1942, 1959, 1227, 1227, 1224, 1958, 1941, 1225,
- 1226, 1960, 1960, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1961, 1961, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 1962, 1962, 1225, 1228, 1224,
- 1227, 1223, 1942, 1943, 1944, 1945, 1946, 1947,
- 1948, 1949, 1950, 1963, 1952, 1953, 1954, 1955,
- 1956, 1957, 1944, 1945, 1946, 1947, 1948, 1949,
- 1950, 1963, 1952, 1953, 1954, 1955, 1956, 1957,
- 1942, 1959, 1224, 1958, 1941, 1225, 1226, 1964,
- 1964, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 1965, 1965, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1966, 1966, 1225, 1228, 1224, 1227, 1223,
- 1225, 1967, 1226, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 1968, 1969, 1970, 1968, 1969, 1970,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 1971,
- 1971, 1225, 1228, 1224, 1227, 1223, 1973, 1974,
- 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982,
- 1983, 1984, 1985, 1986, 1987, 1988, 1975, 1976,
- 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984,
- 1985, 1986, 1987, 1988, 1973, 1990, 1224, 1989,
- 1972, 1225, 1226, 1991, 1991, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 1992, 1992, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 1993, 1993, 1225,
- 1228, 1224, 1227, 1223, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 1995, 2012, 1224, 2011, 1994, 1225,
- 1226, 2013, 2013, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 2014, 2014, 1225, 1228, 1224, 1227,
- 1223, 1225, 1226, 2015, 2015, 1225, 1228, 1224,
- 1227, 1223, 1225, 1226, 2016, 2016, 1225, 1228,
- 1224, 1227, 1223, 2018, 2019, 2020, 2021, 2022,
- 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030,
- 2031, 2032, 2033, 2020, 2021, 2022, 2023, 2024,
- 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032,
- 2033, 2018, 2035, 1224, 2034, 2017, 1225, 1226,
- 2036, 2036, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 2037, 2037, 1225, 1228, 1224, 1227, 1223,
- 1225, 1226, 2038, 2038, 1225, 1228, 1224, 1227,
- 1223, 2040, 2041, 2042, 2043, 2044, 2045, 2046,
- 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054,
- 2055, 2042, 2043, 2044, 2045, 2046, 2047, 2048,
- 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2040,
- 2057, 1224, 2056, 2039, 2059, 2060, 2061, 2062,
- 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070,
- 2071, 2072, 2073, 2074, 2061, 2062, 2063, 2064,
- 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072,
- 2073, 2074, 2059, 2076, 1224, 2075, 2058, 1225,
- 1226, 2077, 2077, 1225, 1228, 1224, 1227, 1223,
- 1225, 2078, 1226, 1225, 1228, 1224, 1227, 1223,
- 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087,
- 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095,
- 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089,
- 2090, 2091, 2092, 2093, 2094, 2095, 2080, 2097,
- 1224, 2096, 2079, 1225, 1226, 2098, 2098, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 2099, 2099,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 2100,
- 2100, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 2101, 2101, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 1720, 1720, 1225, 1228, 1224, 1227, 1223,
- 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110,
- 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118,
- 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112,
- 2113, 2114, 2115, 2116, 2117, 2118, 2103, 2120,
- 1224, 2119, 2102, 1225, 1226, 2121, 2122, 2121,
- 2122, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 2123, 2123, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 2124, 2124, 1225, 1228, 1224, 1227, 1223,
- 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133,
- 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141,
- 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135,
- 2136, 2137, 2138, 2139, 2140, 2141, 2126, 2143,
- 1224, 2142, 2125, 1225, 2144, 1226, 1225, 1228,
- 1224, 1227, 1223, 1225, 1226, 2145, 2145, 1225,
- 1228, 1224, 1227, 1223, 1225, 1226, 2146, 2146,
- 1225, 1228, 1224, 1227, 1223, 1225, 1226, 2147,
- 2147, 1225, 1228, 1224, 1227, 1223, 1225, 1226,
- 2148, 2148, 1225, 1228, 1224, 1227, 1223, 1225,
- 1226, 2149, 2149, 1225, 1228, 1224, 1227, 1223,
- 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158,
- 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166,
- 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160,
- 2161, 2162, 2163, 2164, 2165, 2166, 2151, 2168,
- 1224, 2167, 2150, 1203, 1204, 1205, 1206, 1207,
- 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215,
- 1216, 1217, 1218, 1219, 1206, 1207, 1208, 1209,
- 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217,
- 1218, 1219, 1203, 1221, 1222, 2169, 2170, 2171,
- 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179,
- 2180, 2181, 2182, 2169, 2170, 2171, 2172, 2173,
- 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181,
- 2182, 1202, 1220, 1201, 2184, 2185, 2186, 2187,
- 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195,
- 2196, 2197, 2198, 2199, 2186, 2187, 2188, 2189,
- 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197,
- 2198, 2199, 2184, 2201, 2200, 2183, 2203, 2204,
- 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212,
- 2213, 2214, 2215, 2216, 2217, 2218, 2205, 2206,
- 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214,
- 2215, 2216, 2217, 2218, 2203, 2220, 2219, 2202,
- 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229,
- 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237,
- 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231,
- 2232, 2233, 2234, 2235, 2236, 2237, 2222, 2239,
- 2238, 2221, 2241, 2242, 2243, 2244, 2245, 2246,
- 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254,
- 2255, 2256, 2243, 2244, 2245, 2246, 2247, 2248,
- 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256,
- 2241, 2258, 2257, 2240, 2260, 2261, 2262, 2263,
- 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271,
- 2272, 2273, 2274, 2275, 2262, 2263, 2264, 2265,
- 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273,
- 2274, 2275, 2260, 2277, 2276, 2259, 2279, 2280,
- 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288,
- 2289, 2290, 2291, 2292, 2293, 2294, 2281, 2282,
- 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290,
- 2291, 2292, 2293, 2294, 2279, 2296, 2295, 2278,
- 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305,
- 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313,
- 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307,
- 2308, 2309, 2310, 2311, 2312, 2313, 2298, 2315,
- 2314, 2297, 2317, 2318, 2319, 2320, 2321, 2322,
- 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330,
- 2331, 2332, 2319, 2320, 2321, 2322, 2323, 2324,
- 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332,
- 2317, 2334, 2333, 2316, 2336, 2337, 2338, 2339,
- 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347,
- 2348, 2349, 2350, 2351, 2338, 2339, 2340, 2341,
- 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349,
- 2350, 2351, 2336, 2353, 2352, 2335, 2355, 2356,
- 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364,
- 2365, 2366, 2367, 2368, 2369, 2370, 2357, 2358,
- 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366,
- 2367, 2368, 2369, 2370, 2355, 2372, 2371, 2354,
- 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381,
- 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389,
- 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383,
- 2384, 2385, 2386, 2387, 2388, 2389, 2374, 2391,
- 2390, 2373, 2393, 2394, 2395, 2396, 2397, 2398,
- 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406,
- 2407, 2408, 2395, 2396, 2397, 2398, 2399, 2400,
- 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408,
- 2393, 2410, 2409, 2392, 2412, 2413, 2414, 2415,
- 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423,
- 2424, 2425, 2426, 2427, 2414, 2415, 2416, 2417,
- 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425,
- 2426, 2427, 2412, 2429, 2428, 2411, 2431, 2432,
- 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440,
- 2441, 2442, 2443, 2444, 2445, 2446, 2433, 2434,
- 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442,
- 2443, 2444, 2445, 2446, 2431, 2448, 2447, 2430,
- 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457,
- 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465,
- 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459,
- 2460, 2461, 2462, 2463, 2464, 2465, 2450, 2467,
- 2466, 2449, 2469, 2470, 2471, 2472, 2473, 2474,
- 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482,
- 2483, 2484, 2471, 2472, 2473, 2474, 2475, 2476,
- 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484,
- 2469, 2486, 2485, 2468, 2488, 2489, 2490, 2491,
- 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499,
- 2500, 2501, 2502, 2503, 2490, 2491, 2492, 2493,
- 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501,
- 2502, 2503, 2488, 2505, 2504, 2487, 2507, 2508,
- 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516,
- 2517, 2518, 2519, 2520, 2521, 2522, 2509, 2510,
- 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518,
- 2519, 2520, 2521, 2522, 2507, 2524, 2523, 2506,
- 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533,
- 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541,
- 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535,
- 2536, 2537, 2538, 2539, 2540, 2541, 2526, 2543,
- 2542, 2525, 2545, 2546, 2547, 2548, 2549, 2550,
- 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558,
- 2559, 2560, 2547, 2548, 2549, 2550, 2551, 2552,
- 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560,
- 2545, 2562, 2561, 2544, 2564, 2565, 2566, 2567,
- 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575,
- 2576, 2577, 2578, 2579, 2566, 2567, 2568, 2569,
- 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577,
- 2578, 2579, 2564, 2581, 2580, 2563, 2583, 2584,
- 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592,
- 2593, 2594, 2595, 2596, 2597, 2598, 2585, 2586,
- 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594,
- 2595, 2596, 2597, 2598, 2583, 2600, 2599, 2582,
- 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609,
- 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617,
- 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611,
- 2612, 2613, 2614, 2615, 2616, 2617, 2602, 2619,
- 2618, 2601, 2621, 2622, 2623, 2624, 2625, 2626,
- 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634,
- 2635, 2636, 2623, 2624, 2625, 2626, 2627, 2628,
- 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636,
- 2621, 2638, 2630, 2630, 2637, 2620, 2621, 2622,
- 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2639,
- 2631, 2632, 2633, 2634, 2635, 2636, 2623, 2624,
- 2625, 2626, 2627, 2628, 2629, 2639, 2631, 2632,
- 2633, 2634, 2635, 2636, 2621, 2638, 2637, 2620,
- 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648,
- 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656,
- 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650,
- 2651, 2652, 2653, 2654, 2655, 2656, 2641, 2658,
- 2657, 2640, 2660, 2661, 2662, 2663, 2664, 2665,
- 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673,
- 2674, 2675, 2662, 2663, 2664, 2665, 2666, 2667,
- 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675,
- 2660, 2677, 2676, 2659, 2679, 2680, 2681, 2682,
- 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690,
- 2691, 2692, 2693, 2694, 2681, 2682, 2683, 2684,
- 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692,
- 2693, 2694, 2679, 2696, 2695, 2678, 2698, 2699,
- 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707,
- 2708, 2709, 2710, 2711, 2712, 2713, 2700, 2701,
- 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709,
- 2710, 2711, 2712, 2713, 2698, 2715, 2714, 2697,
- 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724,
- 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732,
- 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726,
- 2727, 2728, 2729, 2730, 2731, 2732, 2717, 2734,
- 2733, 2716, 2736, 2737, 2738, 2739, 2740, 2741,
- 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749,
- 2750, 2751, 2738, 2739, 2740, 2741, 2742, 2743,
- 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751,
- 2736, 2753, 2752, 2735, 2755, 2756, 2757, 2758,
- 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766,
- 2767, 2768, 2769, 2770, 2757, 2758, 2759, 2760,
- 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768,
- 2769, 2770, 2755, 2772, 2771, 2754, 2774, 2775,
- 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783,
- 2784, 2785, 2786, 2787, 2788, 2789, 2776, 2777,
- 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785,
- 2786, 2787, 2788, 2789, 2774, 2791, 2790, 2773,
- 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800,
- 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808,
- 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802,
- 2803, 2804, 2805, 2806, 2807, 2808, 2793, 2810,
- 2809, 2792, 1303, 132, 132, 1305, 2811, 2811,
- 1304, 1302, 1303, 133, 133, 1305, 133, 133,
- 1304, 1302, 1303, 134, 134, 1305, 2812, 2812,
- 1304, 1302, 1303, 135, 135, 1305, 2813, 2813,
- 1304, 1302, 1303, 136, 136, 1305, 136, 136,
- 1304, 1302, 1303, 137, 138, 137, 138, 1305,
- 2814, 2815, 2814, 2815, 1304, 1302, 1303, 139,
- 139, 1305, 2816, 2816, 1304, 1302, 1303, 140,
- 140, 1305, 2817, 2817, 1304, 1302, 1303, 141,
- 141, 1305, 2818, 2818, 1304, 1302, 142, 143,
- 1303, 142, 143, 1305, 1304, 1302, 1303, 251,
- 252, 251, 252, 1305, 2819, 2820, 2819, 2820,
- 1304, 1302, 1303, 253, 253, 1305, 2821, 2821,
- 1304, 1302, 1303, 254, 254, 1305, 254, 254,
- 1304, 1302, 255, 1303, 2822, 1305, 1304, 1302,
- 1303, 256, 256, 1305, 2823, 2823, 1304, 1302,
- 1303, 257, 257, 1305, 2824, 2824, 1304, 1302,
- 1303, 258, 258, 1305, 2825, 2825, 1304, 1302,
- 1303, 259, 259, 1305, 2826, 2826, 1304, 1302,
- 1303, 260, 260, 1305, 260, 260, 1304, 1302,
- 1303, 144, 145, 144, 145, 1305, 2827, 2828,
- 2827, 2828, 1304, 1302, 1303, 146, 146, 1305,
- 2829, 2829, 1304, 1302, 1303, 147, 147, 1305,
- 2830, 2830, 1304, 1302, 1303, 148, 148, 1305,
- 148, 148, 1304, 1302, 1303, 247, 247, 1305,
- 2831, 2831, 1304, 1302, 1303, 248, 248, 1305,
- 2832, 2832, 1304, 1302, 1303, 249, 249, 1305,
- 2833, 2833, 1304, 1302, 1303, 250, 250, 1305,
- 2834, 2834, 1304, 1302, 1303, 193, 193, 1305,
- 193, 193, 1304, 1302, 1303, 149, 149, 1305,
- 2835, 2835, 1304, 1302, 1303, 150, 150, 1305,
- 2836, 2836, 1304, 1302, 1303, 151, 151, 1305,
- 151, 151, 1304, 1302, 1303, 152, 152, 1305,
- 2837, 2837, 1304, 1302, 1303, 153, 153, 1305,
- 2838, 2838, 1304, 1302, 1303, 154, 154, 1305,
- 2839, 2839, 1304, 1302, 1303, 155, 155, 1305,
- 2840, 2840, 1304, 1302, 1303, 156, 156, 1305,
- 156, 156, 1304, 1302, 1303, 157, 158, 157,
- 158, 1305, 2841, 2842, 2841, 2842, 1304, 1302,
- 1303, 159, 159, 1305, 2843, 2843, 1304, 1302,
- 1303, 160, 161, 160, 161, 1305, 160, 161,
- 160, 161, 1304, 1302, 1303, 245, 245, 1305,
- 2844, 2844, 1304, 1302, 246, 1303, 246, 1305,
- 1304, 1302, 1303, 162, 162, 1305, 2845, 2845,
- 1304, 1302, 1303, 163, 163, 1305, 2846, 2846,
- 1304, 1302, 1303, 164, 164, 1305, 2847, 2847,
- 1304, 1302, 1303, 165, 165, 1305, 2848, 2848,
- 1304, 1302, 166, 1303, 2849, 1305, 1304, 1302,
- 1303, 167, 168, 167, 168, 1305, 2850, 2851,
- 2850, 2851, 1304, 1302, 1303, 169, 169, 1305,
- 169, 169, 1304, 1302, 1303, 242, 242, 1305,
- 2852, 2852, 1304, 1302, 1303, 243, 243, 1305,
- 2853, 2853, 1304, 1302, 1303, 244, 244, 1305,
- 244, 244, 1304, 1302, 1303, 170, 170, 1305,
- 2854, 2854, 1304, 1302, 1303, 171, 171, 1305,
- 2855, 2855, 1304, 1302, 1303, 172, 172, 1305,
- 172, 172, 1304, 1302, 1303, 173, 174, 175,
- 173, 174, 175, 1305, 2856, 2857, 2858, 2856,
- 2857, 2858, 1304, 1302, 1303, 176, 177, 178,
- 176, 177, 178, 1305, 2859, 2860, 2861, 2859,
- 2860, 2861, 1304, 1302, 1303, 179, 179, 1305,
- 2862, 2862, 1304, 1302, 1303, 180, 180, 1305,
- 2863, 2863, 1304, 1302, 1303, 181, 181, 1305,
- 2864, 2864, 1304, 1302, 1303, 175, 175, 1305,
- 2858, 2858, 1304, 1302, 1303, 182, 182, 1305,
- 182, 182, 1304, 1302, 1303, 223, 223, 1305,
- 223, 223, 1304, 1302, 2621, 2622, 2623, 2624,
- 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632,
- 2633, 2634, 2635, 2636, 2623, 2624, 2625, 2626,
- 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634,
- 2635, 2636, 2621, 2638, 2865, 2865, 2637, 2620,
- 1303, 224, 224, 1305, 2866, 2866, 1304, 1302,
- 1303, 225, 225, 1305, 2867, 2867, 1304, 1302,
- 1303, 226, 226, 1305, 226, 226, 1304, 1302,
- 1303, 227, 227, 1305, 2868, 2868, 1304, 1302,
- 1303, 228, 228, 1305, 2869, 2869, 1304, 1302,
- 1303, 229, 229, 1305, 2870, 2870, 1304, 1302,
- 230, 1303, 2871, 1305, 1304, 1302, 1303, 231,
- 232, 233, 231, 232, 233, 1305, 2872, 2873,
- 2874, 2872, 2873, 2874, 1304, 1302, 1303, 234,
- 234, 1305, 234, 234, 1304, 1302, 1303, 235,
- 235, 1305, 2875, 2875, 1304, 1302, 1303, 236,
- 236, 1305, 2876, 2876, 1304, 1302, 1303, 237,
- 237, 1305, 237, 237, 1304, 1302, 1303, 238,
- 238, 1305, 2877, 2877, 1304, 1302, 1303, 239,
- 239, 1305, 2878, 2878, 1304, 1302, 1303, 240,
- 240, 1305, 2879, 2879, 1304, 1302, 1303, 241,
- 241, 1305, 241, 241, 1304, 1302, 1303, 183,
- 183, 1305, 2880, 2880, 1304, 1302, 1303, 184,
- 184, 1305, 2881, 2881, 1304, 1302, 1303, 185,
- 185, 1305, 2882, 2882, 1304, 1302, 1303, 186,
- 186, 1305, 186, 186, 1304, 1302, 1303, 187,
- 188, 189, 190, 187, 188, 189, 190, 1305,
- 2883, 2884, 2885, 2886, 2883, 2884, 2885, 2886,
- 1304, 1302, 1303, 191, 191, 1305, 191, 191,
- 1304, 1302, 1303, 194, 195, 196, 194, 195,
- 196, 1305, 194, 2887, 2888, 194, 2887, 2888,
- 1304, 1302, 1303, 197, 197, 1305, 2889, 2889,
- 1304, 1302, 1303, 198, 198, 1305, 2890, 2890,
- 1304, 1302, 1303, 199, 199, 1305, 2891, 2891,
- 1304, 1302, 1303, 200, 200, 1305, 2892, 2892,
- 1304, 1302, 201, 1303, 2893, 1305, 1304, 1302,
- 1303, 202, 202, 1305, 2894, 2894, 1304, 1302,
- 1303, 203, 203, 1305, 203, 203, 1304, 1302,
- 1303, 204, 204, 1305, 2895, 2895, 1304, 1302,
- 1303, 205, 205, 1305, 2896, 2896, 1304, 1302,
- 1303, 206, 206, 1305, 206, 206, 1304, 1302,
- 1303, 207, 207, 1305, 2897, 2897, 1304, 1302,
- 1303, 208, 208, 1305, 208, 208, 1304, 1302,
- 1303, 209, 209, 1305, 2898, 2898, 1304, 1302,
- 1303, 210, 210, 1305, 2899, 2899, 1304, 1302,
- 211, 1303, 2900, 1305, 1304, 1302, 1303, 212,
- 213, 214, 212, 213, 214, 1305, 2901, 2902,
- 2903, 2901, 2902, 2903, 1304, 1302, 1303, 215,
- 215, 1305, 215, 215, 1304, 1302, 1303, 216,
- 217, 216, 217, 1305, 2904, 2905, 2904, 2905,
- 1304, 1302, 1303, 218, 218, 1305, 2906, 2906,
- 1304, 1302, 1303, 219, 219, 1305, 219, 219,
- 1304, 1302, 1303, 220, 220, 1305, 220, 220,
- 1304, 1302, 1303, 221, 221, 1305, 2907, 2907,
- 1304, 1302, 1303, 222, 222, 1305, 222, 222,
- 1304, 1302, 1303, 192, 192, 1305, 192, 192,
- 1304, 1302, 1303, 193, 193, 1305, 193, 193,
- 1304, 1302, 2909, 2910, 261, 2909, 2910, 261,
- 2911, 2908, 2910, 2910, 2911, 2908, 2913, 2913,
- 2914, 2912, 0
-};
+ static const short _demo_machine_parser_cmd_trans_targs[] = {
+ 2, 0, 235, 3, 2, 235, 3, 237,
+ 232, 6, 94, 7, 8, 9, 10, 11,
+ 12, 13, 91, 14, 15, 16, 17, 378,
+ 381, 20, 21, 22, 384, 24, 385, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 36, 37, 38, 39, 387, 41, 388,
+ 43, 44, 389, 46, 390, 48, 49, 391,
+ 394, 404, 52, 53, 54, 395, 56, 65,
+ 68, 396, 69, 71, 57, 58, 59, 60,
+ 61, 63, 64, 398, 66, 67, 399, 400,
+ 70, 401, 402, 73, 74, 75, 76, 403,
+ 78, 405, 406, 81, 407, 83, 408, 410,
+ 86, 411, 88, 412, 90, 413, 92, 93,
+ 414, 96, 97, 415, 99, 100, 101, 416,
+ 417, 232, 420, 105, 106, 107, 448, 109,
+ 110, 111, 112, 114, 450, 451, 115, 116,
+ 117, 118, 120, 452, 122, 653, 124, 125,
+ 654, 127, 222, 128, 129, 130, 655, 684,
+ 132, 217, 133, 134, 656, 136, 137, 657,
+ 139, 140, 141, 142, 658, 144, 215, 145,
+ 659, 682, 147, 148, 149, 150, 151, 152,
+ 212, 660, 154, 155, 661, 157, 199, 162,
+ 158, 195, 676, 159, 160, 161, 662, 164,
+ 165, 166, 663, 168, 171, 182, 184, 664,
+ 665, 666, 667, 172, 179, 173, 174, 175,
+ 176, 177, 178, 668, 180, 181, 669, 183,
+ 670, 185, 186, 187, 188, 189, 193, 671,
+ 190, 192, 191, 672, 673, 194, 674, 675,
+ 197, 198, 677, 200, 201, 202, 203, 204,
+ 205, 208, 678, 206, 207, 679, 209, 210,
+ 211, 680, 213, 214, 681, 216, 683, 218,
+ 219, 220, 221, 223, 225, 224, 685, 226,
+ 227, 228, 229, 230, 686, 798, 232, 233,
+ 1, 4, 102, 231, 232, 234, 232, 234,
+ 232, 235, 236, 232, 236, 232, 238, 239,
+ 377, 5, 379, 380, 382, 383, 23, 386,
+ 40, 45, 392, 393, 55, 397, 232, 238,
+ 240, 241, 255, 256, 259, 260, 266, 279,
+ 286, 293, 300, 301, 309, 317, 232, 240,
+ 241, 255, 256, 259, 260, 266, 279, 286,
+ 293, 300, 301, 309, 368, 376, 242, 367,
+ 243, 244, 245, 246, 247, 248, 249, 363,
+ 250, 251, 252, 253, 254, 232, 240, 241,
+ 255, 256, 259, 260, 266, 279, 286, 293,
+ 300, 301, 309, 317, 232, 240, 241, 255,
+ 256, 259, 260, 266, 279, 286, 293, 300,
+ 301, 309, 357, 360, 317, 232, 240, 257,
+ 255, 256, 259, 260, 266, 279, 286, 293,
+ 300, 301, 309, 317, 345, 258, 232, 240,
+ 241, 255, 256, 259, 260, 266, 279, 286,
+ 293, 300, 301, 309, 317, 232, 240, 241,
+ 255, 256, 259, 260, 354, 266, 279, 286,
+ 293, 300, 301, 309, 317, 232, 261, 241,
+ 255, 348, 259, 260, 266, 279, 351, 293,
+ 300, 301, 309, 265, 317, 262, 263, 264,
+ 232, 240, 241, 255, 256, 259, 260, 266,
+ 279, 286, 293, 300, 301, 309, 317, 267,
+ 278, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 232, 240, 241, 255, 256,
+ 259, 260, 266, 279, 286, 293, 300, 301,
+ 309, 317, 232, 240, 241, 255, 280, 259,
+ 260, 266, 279, 286, 293, 300, 301, 309,
+ 317, 281, 282, 283, 284, 285, 256, 287,
+ 288, 232, 240, 241, 255, 256, 259, 260,
+ 289, 266, 279, 286, 293, 300, 301, 309,
+ 317, 290, 291, 292, 294, 295, 232, 240,
+ 241, 255, 256, 259, 260, 296, 279, 286,
+ 293, 300, 301, 309, 317, 297, 298, 299,
+ 266, 241, 232, 240, 241, 255, 302, 259,
+ 260, 266, 279, 286, 293, 300, 301, 309,
+ 343, 317, 303, 339, 232, 240, 241, 255,
+ 256, 259, 260, 304, 266, 279, 286, 293,
+ 300, 301, 309, 317, 305, 306, 307, 308,
+ 310, 322, 326, 316, 328, 331, 311, 312,
+ 313, 314, 315, 232, 240, 241, 255, 256,
+ 259, 260, 266, 279, 286, 293, 300, 301,
+ 309, 317, 232, 240, 241, 255, 256, 259,
+ 260, 318, 266, 279, 286, 293, 300, 301,
+ 309, 317, 319, 320, 321, 323, 324, 325,
+ 232, 240, 241, 255, 256, 259, 260, 266,
+ 279, 286, 293, 300, 301, 309, 317, 327,
+ 232, 240, 241, 255, 256, 259, 260, 266,
+ 279, 286, 293, 300, 301, 309, 317, 329,
+ 330, 232, 240, 241, 255, 256, 259, 260,
+ 266, 279, 286, 293, 300, 301, 309, 317,
+ 332, 232, 240, 241, 255, 256, 259, 260,
+ 266, 279, 286, 293, 300, 301, 333, 317,
+ 334, 335, 336, 337, 338, 309, 232, 240,
+ 241, 255, 256, 259, 260, 266, 279, 286,
+ 293, 300, 301, 309, 340, 317, 341, 342,
+ 344, 256, 346, 347, 349, 350, 240, 256,
+ 286, 232, 240, 241, 255, 256, 259, 260,
+ 352, 279, 286, 293, 300, 301, 309, 317,
+ 353, 266, 355, 356, 358, 359, 232, 240,
+ 241, 255, 256, 259, 260, 266, 279, 286,
+ 293, 300, 301, 309, 317, 361, 362, 364,
+ 365, 366, 232, 240, 241, 255, 256, 259,
+ 260, 266, 279, 286, 293, 300, 301, 309,
+ 317, 369, 370, 371, 372, 373, 374, 375,
+ 232, 240, 241, 255, 256, 259, 260, 266,
+ 279, 286, 293, 300, 301, 309, 317, 232,
+ 377, 5, 379, 380, 382, 383, 23, 386,
+ 40, 45, 392, 393, 55, 95, 232, 377,
+ 5, 379, 380, 382, 383, 23, 386, 40,
+ 45, 392, 393, 55, 397, 232, 377, 5,
+ 379, 380, 382, 383, 23, 386, 40, 45,
+ 392, 393, 55, 87, 89, 397, 232, 377,
+ 18, 379, 380, 382, 383, 23, 386, 40,
+ 45, 392, 393, 55, 397, 80, 232, 377,
+ 5, 379, 380, 382, 383, 23, 386, 40,
+ 45, 392, 393, 55, 397, 232, 377, 5,
+ 379, 380, 382, 383, 85, 23, 386, 40,
+ 45, 392, 393, 55, 397, 232, 19, 5,
+ 379, 82, 382, 383, 23, 386, 409, 45,
+ 392, 393, 55, 397, 232, 377, 5, 379,
+ 380, 382, 383, 23, 386, 40, 45, 392,
+ 393, 55, 397, 232, 377, 5, 379, 380,
+ 382, 383, 23, 386, 40, 45, 392, 393,
+ 55, 397, 232, 377, 5, 379, 35, 382,
+ 383, 23, 386, 40, 45, 392, 393, 55,
+ 397, 380, 232, 377, 5, 379, 380, 382,
+ 383, 42, 23, 386, 40, 45, 392, 393,
+ 55, 397, 232, 377, 5, 379, 380, 382,
+ 383, 47, 386, 40, 45, 392, 393, 55,
+ 397, 23, 5, 232, 377, 5, 379, 50,
+ 382, 383, 23, 386, 40, 45, 392, 393,
+ 55, 79, 397, 232, 377, 5, 379, 380,
+ 382, 383, 51, 23, 386, 40, 45, 392,
+ 393, 55, 397, 232, 377, 5, 379, 380,
+ 382, 383, 23, 386, 40, 45, 392, 393,
+ 55, 397, 232, 377, 5, 379, 380, 382,
+ 383, 62, 23, 386, 40, 45, 392, 393,
+ 55, 397, 232, 377, 5, 379, 380, 382,
+ 383, 23, 386, 40, 45, 392, 393, 55,
+ 397, 232, 377, 5, 379, 380, 382, 383,
+ 23, 386, 40, 45, 392, 393, 55, 397,
+ 232, 377, 5, 379, 380, 382, 383, 23,
+ 386, 40, 45, 392, 393, 55, 397, 232,
+ 377, 5, 379, 380, 382, 383, 23, 386,
+ 40, 45, 392, 393, 72, 397, 55, 232,
+ 377, 5, 379, 380, 382, 383, 23, 386,
+ 40, 45, 392, 393, 55, 77, 397, 380,
+ 377, 380, 40, 232, 377, 5, 379, 380,
+ 382, 383, 84, 386, 40, 45, 392, 393,
+ 55, 397, 23, 232, 377, 5, 379, 380,
+ 382, 383, 23, 386, 40, 45, 392, 393,
+ 55, 397, 232, 377, 5, 379, 380, 382,
+ 383, 23, 386, 40, 45, 392, 393, 55,
+ 397, 98, 232, 377, 5, 379, 380, 382,
+ 383, 23, 386, 40, 45, 392, 393, 55,
+ 397, 232, 418, 419, 507, 103, 121, 123,
+ 126, 131, 135, 138, 143, 146, 153, 156,
+ 163, 167, 169, 170, 453, 652, 454, 232,
+ 418, 419, 103, 453, 454, 232, 419, 103,
+ 453, 454, 232, 421, 422, 423, 447, 449,
+ 113, 232, 421, 422, 232, 422, 424, 430,
+ 436, 232, 422, 424, 425, 430, 436, 426,
+ 427, 428, 429, 431, 432, 433, 434, 435,
+ 437, 442, 443, 438, 439, 440, 441, 232,
+ 422, 424, 430, 436, 232, 422, 444, 430,
+ 436, 445, 446, 424, 232, 422, 447, 104,
+ 449, 113, 108, 232, 422, 447, 449, 113,
+ 232, 422, 119, 449, 113, 447, 232, 103,
+ 453, 454, 420, 455, 232, 423, 456, 458,
+ 460, 484, 490, 496, 232, 457, 456, 458,
+ 459, 423, 458, 423, 460, 461, 467, 473,
+ 232, 458, 461, 462, 467, 473, 463, 464,
+ 465, 466, 468, 469, 470, 471, 472, 474,
+ 479, 480, 475, 476, 477, 478, 232, 458,
+ 461, 467, 473, 232, 458, 481, 467, 473,
+ 482, 483, 461, 232, 458, 484, 485, 490,
+ 496, 486, 487, 488, 489, 491, 492, 493,
+ 494, 495, 497, 502, 503, 498, 499, 500,
+ 501, 232, 458, 484, 490, 496, 232, 458,
+ 504, 490, 496, 505, 506, 484, 508, 511,
+ 515, 521, 526, 530, 536, 540, 548, 552,
+ 560, 565, 568, 570, 509, 510, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 512, 513, 514, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 516,
+ 641, 517, 518, 519, 520, 640, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 522, 635, 523, 524, 525, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 527, 528, 529, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 531,
+ 532, 533, 534, 535, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 537,
+ 632, 538, 539, 631, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 541,
+ 542, 543, 544, 545, 546, 627, 547, 232,
+ 419, 103, 508, 511, 515, 521, 526, 530,
+ 536, 540, 548, 552, 560, 565, 568, 570,
+ 453, 454, 549, 550, 551, 232, 419, 103,
+ 508, 511, 515, 521, 526, 530, 536, 540,
+ 548, 552, 560, 565, 568, 570, 453, 454,
+ 553, 611, 558, 554, 604, 606, 555, 556,
+ 557, 559, 232, 419, 103, 508, 511, 515,
+ 521, 526, 530, 536, 540, 548, 552, 560,
+ 565, 568, 570, 453, 454, 561, 562, 563,
+ 564, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 566, 572, 586, 589,
+ 567, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 569, 232, 419, 103,
+ 508, 511, 515, 521, 526, 530, 536, 540,
+ 548, 552, 560, 565, 568, 570, 453, 454,
+ 571, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 573, 574, 582, 232,
+ 419, 103, 508, 511, 515, 521, 526, 530,
+ 536, 540, 548, 552, 560, 565, 568, 570,
+ 453, 454, 575, 576, 577, 578, 579, 580,
+ 581, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 583, 584, 585, 232,
+ 419, 103, 508, 511, 515, 521, 526, 530,
+ 536, 540, 548, 552, 560, 565, 568, 570,
+ 453, 454, 587, 588, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 590,
+ 591, 592, 593, 595, 601, 594, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 596, 599, 597, 598, 232, 419, 103,
+ 508, 511, 515, 521, 526, 530, 536, 540,
+ 548, 552, 560, 565, 568, 570, 453, 454,
+ 600, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 602, 603, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 605, 232, 419, 103, 508, 511, 515,
+ 521, 526, 530, 536, 540, 548, 552, 560,
+ 565, 568, 570, 453, 454, 232, 419, 103,
+ 508, 511, 515, 521, 526, 530, 536, 607,
+ 548, 552, 560, 565, 568, 570, 453, 454,
+ 608, 609, 610, 540, 612, 613, 614, 615,
+ 616, 618, 622, 617, 232, 419, 103, 508,
+ 511, 515, 521, 526, 530, 536, 540, 548,
+ 552, 560, 565, 568, 570, 453, 454, 619,
+ 620, 621, 232, 419, 103, 508, 511, 515,
+ 521, 526, 530, 536, 540, 548, 552, 560,
+ 565, 568, 570, 453, 454, 623, 624, 625,
+ 626, 232, 419, 103, 508, 511, 515, 521,
+ 526, 530, 536, 540, 548, 552, 560, 565,
+ 568, 570, 453, 454, 628, 629, 630, 232,
+ 419, 103, 508, 511, 515, 521, 526, 530,
+ 536, 540, 548, 552, 560, 565, 568, 570,
+ 453, 454, 232, 419, 103, 508, 511, 515,
+ 521, 526, 530, 536, 540, 548, 552, 560,
+ 565, 568, 570, 453, 454, 633, 634, 232,
+ 419, 103, 508, 511, 515, 521, 526, 530,
+ 536, 540, 548, 552, 560, 565, 568, 570,
+ 453, 454, 636, 637, 638, 639, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 642, 645, 643, 644, 232, 419, 103,
+ 508, 511, 515, 521, 526, 530, 536, 540,
+ 548, 552, 560, 565, 568, 570, 453, 454,
+ 646, 647, 648, 649, 650, 651, 232, 419,
+ 103, 508, 511, 515, 521, 526, 530, 536,
+ 540, 548, 552, 560, 565, 568, 570, 453,
+ 454, 687, 689, 692, 706, 715, 718, 723,
+ 728, 738, 741, 766, 770, 796, 797, 232,
+ 419, 103, 121, 123, 126, 131, 135, 138,
+ 143, 146, 153, 156, 163, 167, 169, 170,
+ 453, 454, 232, 419, 103, 121, 123, 126,
+ 131, 135, 138, 143, 146, 153, 156, 163,
+ 167, 169, 170, 453, 454, 232, 419, 103,
+ 121, 123, 126, 131, 135, 138, 143, 146,
+ 153, 156, 163, 167, 169, 170, 453, 454,
+ 232, 419, 103, 121, 123, 126, 131, 135,
+ 138, 143, 146, 153, 156, 163, 167, 169,
+ 170, 453, 454, 232, 419, 103, 121, 123,
+ 126, 131, 135, 138, 143, 146, 153, 156,
+ 163, 167, 169, 170, 453, 454, 232, 419,
+ 103, 121, 123, 126, 131, 135, 138, 143,
+ 146, 153, 156, 163, 167, 169, 170, 453,
+ 454, 232, 419, 103, 121, 123, 126, 131,
+ 135, 138, 143, 146, 153, 156, 163, 167,
+ 169, 170, 453, 454, 232, 419, 103, 121,
+ 123, 126, 131, 135, 138, 143, 146, 153,
+ 156, 163, 167, 169, 170, 453, 454, 232,
+ 419, 103, 121, 123, 126, 131, 135, 138,
+ 143, 146, 153, 156, 163, 167, 169, 170,
+ 453, 454, 232, 419, 103, 121, 123, 126,
+ 131, 135, 138, 143, 146, 153, 156, 163,
+ 167, 169, 170, 453, 454, 232, 419, 103,
+ 121, 123, 126, 131, 135, 138, 143, 146,
+ 153, 156, 163, 167, 169, 170, 453, 454,
+ 232, 419, 103, 121, 123, 126, 131, 135,
+ 138, 143, 146, 153, 156, 163, 167, 169,
+ 170, 453, 454, 232, 419, 103, 121, 123,
+ 126, 131, 135, 138, 143, 146, 153, 156,
+ 163, 167, 169, 170, 453, 454, 232, 419,
+ 103, 121, 123, 126, 131, 135, 138, 143,
+ 146, 153, 156, 163, 167, 169, 170, 453,
+ 454, 232, 419, 103, 121, 123, 126, 131,
+ 135, 138, 143, 146, 153, 156, 163, 167,
+ 169, 170, 453, 454, 232, 419, 103, 121,
+ 123, 126, 131, 135, 138, 143, 146, 153,
+ 156, 163, 167, 169, 170, 453, 454, 232,
+ 419, 103, 121, 123, 126, 131, 135, 138,
+ 143, 146, 153, 156, 163, 167, 169, 170,
+ 453, 454, 232, 419, 103, 121, 123, 126,
+ 131, 135, 138, 143, 146, 153, 156, 163,
+ 167, 169, 170, 453, 454, 232, 419, 103,
+ 121, 123, 126, 131, 135, 138, 143, 146,
+ 153, 156, 163, 167, 169, 170, 453, 454,
+ 232, 419, 103, 121, 123, 126, 131, 135,
+ 138, 143, 146, 153, 156, 163, 167, 169,
+ 170, 453, 454, 232, 419, 103, 121, 123,
+ 126, 131, 135, 138, 143, 146, 153, 156,
+ 163, 167, 169, 170, 453, 454, 232, 419,
+ 103, 121, 123, 126, 131, 135, 138, 143,
+ 146, 153, 156, 163, 167, 169, 170, 453,
+ 454, 232, 419, 103, 121, 123, 126, 131,
+ 135, 138, 143, 146, 153, 156, 163, 167,
+ 169, 170, 453, 454, 232, 419, 103, 121,
+ 123, 126, 131, 135, 138, 143, 196, 153,
+ 156, 163, 167, 169, 170, 453, 454, 146,
+ 232, 419, 103, 121, 123, 126, 131, 135,
+ 138, 143, 146, 153, 156, 163, 167, 169,
+ 170, 453, 454, 232, 419, 103, 121, 123,
+ 126, 131, 135, 138, 143, 146, 153, 156,
+ 163, 167, 169, 170, 453, 454, 232, 419,
+ 103, 121, 123, 126, 131, 135, 138, 143,
+ 146, 153, 156, 163, 167, 169, 170, 453,
+ 454, 232, 419, 103, 121, 123, 126, 131,
+ 135, 138, 143, 146, 153, 156, 163, 167,
+ 169, 170, 453, 454, 232, 419, 103, 121,
+ 123, 126, 131, 135, 138, 143, 146, 153,
+ 156, 163, 167, 169, 170, 453, 454, 232,
+ 419, 103, 121, 123, 126, 131, 135, 138,
+ 143, 146, 153, 156, 163, 167, 169, 170,
+ 453, 454, 232, 419, 103, 121, 123, 126,
+ 131, 135, 138, 143, 146, 153, 156, 163,
+ 167, 169, 170, 453, 454, 232, 419, 103,
+ 121, 123, 126, 131, 135, 138, 143, 146,
+ 153, 156, 163, 167, 169, 170, 453, 454,
+ 232, 419, 103, 121, 123, 126, 131, 135,
+ 138, 143, 146, 153, 156, 163, 167, 169,
+ 170, 453, 454, 688, 690, 691, 693, 697,
+ 694, 695, 696, 698, 700, 699, 701, 702,
+ 703, 704, 705, 707, 710, 708, 709, 711,
+ 712, 713, 714, 716, 717, 719, 720, 721,
+ 722, 724, 726, 725, 727, 729, 730, 731,
+ 732, 733, 734, 735, 736, 737, 739, 740,
+ 742, 753, 747, 743, 748, 749, 744, 745,
+ 746, 750, 751, 752, 754, 755, 756, 757,
+ 758, 759, 762, 760, 761, 763, 764, 765,
+ 767, 768, 769, 771, 772, 783, 785, 773,
+ 780, 774, 775, 776, 777, 778, 779, 781,
+ 782, 784, 786, 787, 788, 789, 790, 794,
+ 791, 793, 792, 795, 232, 799, 232, 800,
+ 232, 232, 800
+ };
-static const short _demo_machine_parser_cmd_trans_targs[] = {
- 2, 0, 235, 3, 2, 235, 3, 237,
- 232, 6, 94, 7, 8, 9, 10, 11,
- 12, 13, 91, 14, 15, 16, 17, 378,
- 381, 20, 21, 22, 384, 24, 385, 25,
- 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 36, 37, 38, 39, 387, 41, 388,
- 43, 44, 389, 46, 390, 48, 49, 391,
- 394, 404, 52, 53, 54, 395, 56, 65,
- 68, 396, 69, 71, 57, 58, 59, 60,
- 61, 63, 64, 398, 66, 67, 399, 400,
- 70, 401, 402, 73, 74, 75, 76, 403,
- 78, 405, 406, 81, 407, 83, 408, 410,
- 86, 411, 88, 412, 90, 413, 92, 93,
- 414, 96, 97, 415, 99, 100, 101, 416,
- 417, 232, 420, 105, 106, 107, 448, 109,
- 110, 111, 112, 114, 450, 451, 115, 116,
- 117, 118, 120, 452, 122, 653, 124, 125,
- 654, 127, 222, 128, 129, 130, 655, 684,
- 132, 217, 133, 134, 656, 136, 137, 657,
- 139, 140, 141, 142, 658, 144, 215, 145,
- 659, 682, 147, 148, 149, 150, 151, 152,
- 212, 660, 154, 155, 661, 157, 199, 162,
- 158, 195, 676, 159, 160, 161, 662, 164,
- 165, 166, 663, 168, 171, 182, 184, 664,
- 665, 666, 667, 172, 179, 173, 174, 175,
- 176, 177, 178, 668, 180, 181, 669, 183,
- 670, 185, 186, 187, 188, 189, 193, 671,
- 190, 192, 191, 672, 673, 194, 674, 675,
- 197, 198, 677, 200, 201, 202, 203, 204,
- 205, 208, 678, 206, 207, 679, 209, 210,
- 211, 680, 213, 214, 681, 216, 683, 218,
- 219, 220, 221, 223, 225, 224, 685, 226,
- 227, 228, 229, 230, 686, 798, 232, 233,
- 1, 4, 102, 231, 232, 234, 232, 234,
- 232, 235, 236, 232, 236, 232, 238, 239,
- 377, 5, 379, 380, 382, 383, 23, 386,
- 40, 45, 392, 393, 55, 397, 232, 238,
- 240, 241, 255, 256, 259, 260, 266, 279,
- 286, 293, 300, 301, 309, 317, 232, 240,
- 241, 255, 256, 259, 260, 266, 279, 286,
- 293, 300, 301, 309, 368, 376, 242, 367,
- 243, 244, 245, 246, 247, 248, 249, 363,
- 250, 251, 252, 253, 254, 232, 240, 241,
- 255, 256, 259, 260, 266, 279, 286, 293,
- 300, 301, 309, 317, 232, 240, 241, 255,
- 256, 259, 260, 266, 279, 286, 293, 300,
- 301, 309, 357, 360, 317, 232, 240, 257,
- 255, 256, 259, 260, 266, 279, 286, 293,
- 300, 301, 309, 317, 345, 258, 232, 240,
- 241, 255, 256, 259, 260, 266, 279, 286,
- 293, 300, 301, 309, 317, 232, 240, 241,
- 255, 256, 259, 260, 354, 266, 279, 286,
- 293, 300, 301, 309, 317, 232, 261, 241,
- 255, 348, 259, 260, 266, 279, 351, 293,
- 300, 301, 309, 265, 317, 262, 263, 264,
- 232, 240, 241, 255, 256, 259, 260, 266,
- 279, 286, 293, 300, 301, 309, 317, 267,
- 278, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 232, 240, 241, 255, 256,
- 259, 260, 266, 279, 286, 293, 300, 301,
- 309, 317, 232, 240, 241, 255, 280, 259,
- 260, 266, 279, 286, 293, 300, 301, 309,
- 317, 281, 282, 283, 284, 285, 256, 287,
- 288, 232, 240, 241, 255, 256, 259, 260,
- 289, 266, 279, 286, 293, 300, 301, 309,
- 317, 290, 291, 292, 294, 295, 232, 240,
- 241, 255, 256, 259, 260, 296, 279, 286,
- 293, 300, 301, 309, 317, 297, 298, 299,
- 266, 241, 232, 240, 241, 255, 302, 259,
- 260, 266, 279, 286, 293, 300, 301, 309,
- 343, 317, 303, 339, 232, 240, 241, 255,
- 256, 259, 260, 304, 266, 279, 286, 293,
- 300, 301, 309, 317, 305, 306, 307, 308,
- 310, 322, 326, 316, 328, 331, 311, 312,
- 313, 314, 315, 232, 240, 241, 255, 256,
- 259, 260, 266, 279, 286, 293, 300, 301,
- 309, 317, 232, 240, 241, 255, 256, 259,
- 260, 318, 266, 279, 286, 293, 300, 301,
- 309, 317, 319, 320, 321, 323, 324, 325,
- 232, 240, 241, 255, 256, 259, 260, 266,
- 279, 286, 293, 300, 301, 309, 317, 327,
- 232, 240, 241, 255, 256, 259, 260, 266,
- 279, 286, 293, 300, 301, 309, 317, 329,
- 330, 232, 240, 241, 255, 256, 259, 260,
- 266, 279, 286, 293, 300, 301, 309, 317,
- 332, 232, 240, 241, 255, 256, 259, 260,
- 266, 279, 286, 293, 300, 301, 333, 317,
- 334, 335, 336, 337, 338, 309, 232, 240,
- 241, 255, 256, 259, 260, 266, 279, 286,
- 293, 300, 301, 309, 340, 317, 341, 342,
- 344, 256, 346, 347, 349, 350, 240, 256,
- 286, 232, 240, 241, 255, 256, 259, 260,
- 352, 279, 286, 293, 300, 301, 309, 317,
- 353, 266, 355, 356, 358, 359, 232, 240,
- 241, 255, 256, 259, 260, 266, 279, 286,
- 293, 300, 301, 309, 317, 361, 362, 364,
- 365, 366, 232, 240, 241, 255, 256, 259,
- 260, 266, 279, 286, 293, 300, 301, 309,
- 317, 369, 370, 371, 372, 373, 374, 375,
- 232, 240, 241, 255, 256, 259, 260, 266,
- 279, 286, 293, 300, 301, 309, 317, 232,
- 377, 5, 379, 380, 382, 383, 23, 386,
- 40, 45, 392, 393, 55, 95, 232, 377,
- 5, 379, 380, 382, 383, 23, 386, 40,
- 45, 392, 393, 55, 397, 232, 377, 5,
- 379, 380, 382, 383, 23, 386, 40, 45,
- 392, 393, 55, 87, 89, 397, 232, 377,
- 18, 379, 380, 382, 383, 23, 386, 40,
- 45, 392, 393, 55, 397, 80, 232, 377,
- 5, 379, 380, 382, 383, 23, 386, 40,
- 45, 392, 393, 55, 397, 232, 377, 5,
- 379, 380, 382, 383, 85, 23, 386, 40,
- 45, 392, 393, 55, 397, 232, 19, 5,
- 379, 82, 382, 383, 23, 386, 409, 45,
- 392, 393, 55, 397, 232, 377, 5, 379,
- 380, 382, 383, 23, 386, 40, 45, 392,
- 393, 55, 397, 232, 377, 5, 379, 380,
- 382, 383, 23, 386, 40, 45, 392, 393,
- 55, 397, 232, 377, 5, 379, 35, 382,
- 383, 23, 386, 40, 45, 392, 393, 55,
- 397, 380, 232, 377, 5, 379, 380, 382,
- 383, 42, 23, 386, 40, 45, 392, 393,
- 55, 397, 232, 377, 5, 379, 380, 382,
- 383, 47, 386, 40, 45, 392, 393, 55,
- 397, 23, 5, 232, 377, 5, 379, 50,
- 382, 383, 23, 386, 40, 45, 392, 393,
- 55, 79, 397, 232, 377, 5, 379, 380,
- 382, 383, 51, 23, 386, 40, 45, 392,
- 393, 55, 397, 232, 377, 5, 379, 380,
- 382, 383, 23, 386, 40, 45, 392, 393,
- 55, 397, 232, 377, 5, 379, 380, 382,
- 383, 62, 23, 386, 40, 45, 392, 393,
- 55, 397, 232, 377, 5, 379, 380, 382,
- 383, 23, 386, 40, 45, 392, 393, 55,
- 397, 232, 377, 5, 379, 380, 382, 383,
- 23, 386, 40, 45, 392, 393, 55, 397,
- 232, 377, 5, 379, 380, 382, 383, 23,
- 386, 40, 45, 392, 393, 55, 397, 232,
- 377, 5, 379, 380, 382, 383, 23, 386,
- 40, 45, 392, 393, 72, 397, 55, 232,
- 377, 5, 379, 380, 382, 383, 23, 386,
- 40, 45, 392, 393, 55, 77, 397, 380,
- 377, 380, 40, 232, 377, 5, 379, 380,
- 382, 383, 84, 386, 40, 45, 392, 393,
- 55, 397, 23, 232, 377, 5, 379, 380,
- 382, 383, 23, 386, 40, 45, 392, 393,
- 55, 397, 232, 377, 5, 379, 380, 382,
- 383, 23, 386, 40, 45, 392, 393, 55,
- 397, 98, 232, 377, 5, 379, 380, 382,
- 383, 23, 386, 40, 45, 392, 393, 55,
- 397, 232, 418, 419, 507, 103, 121, 123,
- 126, 131, 135, 138, 143, 146, 153, 156,
- 163, 167, 169, 170, 453, 652, 454, 232,
- 418, 419, 103, 453, 454, 232, 419, 103,
- 453, 454, 232, 421, 422, 423, 447, 449,
- 113, 232, 421, 422, 232, 422, 424, 430,
- 436, 232, 422, 424, 425, 430, 436, 426,
- 427, 428, 429, 431, 432, 433, 434, 435,
- 437, 442, 443, 438, 439, 440, 441, 232,
- 422, 424, 430, 436, 232, 422, 444, 430,
- 436, 445, 446, 424, 232, 422, 447, 104,
- 449, 113, 108, 232, 422, 447, 449, 113,
- 232, 422, 119, 449, 113, 447, 232, 103,
- 453, 454, 420, 455, 232, 423, 456, 458,
- 460, 484, 490, 496, 232, 457, 456, 458,
- 459, 423, 458, 423, 460, 461, 467, 473,
- 232, 458, 461, 462, 467, 473, 463, 464,
- 465, 466, 468, 469, 470, 471, 472, 474,
- 479, 480, 475, 476, 477, 478, 232, 458,
- 461, 467, 473, 232, 458, 481, 467, 473,
- 482, 483, 461, 232, 458, 484, 485, 490,
- 496, 486, 487, 488, 489, 491, 492, 493,
- 494, 495, 497, 502, 503, 498, 499, 500,
- 501, 232, 458, 484, 490, 496, 232, 458,
- 504, 490, 496, 505, 506, 484, 508, 511,
- 515, 521, 526, 530, 536, 540, 548, 552,
- 560, 565, 568, 570, 509, 510, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 512, 513, 514, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 516,
- 641, 517, 518, 519, 520, 640, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 522, 635, 523, 524, 525, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 527, 528, 529, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 531,
- 532, 533, 534, 535, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 537,
- 632, 538, 539, 631, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 541,
- 542, 543, 544, 545, 546, 627, 547, 232,
- 419, 103, 508, 511, 515, 521, 526, 530,
- 536, 540, 548, 552, 560, 565, 568, 570,
- 453, 454, 549, 550, 551, 232, 419, 103,
- 508, 511, 515, 521, 526, 530, 536, 540,
- 548, 552, 560, 565, 568, 570, 453, 454,
- 553, 611, 558, 554, 604, 606, 555, 556,
- 557, 559, 232, 419, 103, 508, 511, 515,
- 521, 526, 530, 536, 540, 548, 552, 560,
- 565, 568, 570, 453, 454, 561, 562, 563,
- 564, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 566, 572, 586, 589,
- 567, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 569, 232, 419, 103,
- 508, 511, 515, 521, 526, 530, 536, 540,
- 548, 552, 560, 565, 568, 570, 453, 454,
- 571, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 573, 574, 582, 232,
- 419, 103, 508, 511, 515, 521, 526, 530,
- 536, 540, 548, 552, 560, 565, 568, 570,
- 453, 454, 575, 576, 577, 578, 579, 580,
- 581, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 583, 584, 585, 232,
- 419, 103, 508, 511, 515, 521, 526, 530,
- 536, 540, 548, 552, 560, 565, 568, 570,
- 453, 454, 587, 588, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 590,
- 591, 592, 593, 595, 601, 594, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 596, 599, 597, 598, 232, 419, 103,
- 508, 511, 515, 521, 526, 530, 536, 540,
- 548, 552, 560, 565, 568, 570, 453, 454,
- 600, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 602, 603, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 605, 232, 419, 103, 508, 511, 515,
- 521, 526, 530, 536, 540, 548, 552, 560,
- 565, 568, 570, 453, 454, 232, 419, 103,
- 508, 511, 515, 521, 526, 530, 536, 607,
- 548, 552, 560, 565, 568, 570, 453, 454,
- 608, 609, 610, 540, 612, 613, 614, 615,
- 616, 618, 622, 617, 232, 419, 103, 508,
- 511, 515, 521, 526, 530, 536, 540, 548,
- 552, 560, 565, 568, 570, 453, 454, 619,
- 620, 621, 232, 419, 103, 508, 511, 515,
- 521, 526, 530, 536, 540, 548, 552, 560,
- 565, 568, 570, 453, 454, 623, 624, 625,
- 626, 232, 419, 103, 508, 511, 515, 521,
- 526, 530, 536, 540, 548, 552, 560, 565,
- 568, 570, 453, 454, 628, 629, 630, 232,
- 419, 103, 508, 511, 515, 521, 526, 530,
- 536, 540, 548, 552, 560, 565, 568, 570,
- 453, 454, 232, 419, 103, 508, 511, 515,
- 521, 526, 530, 536, 540, 548, 552, 560,
- 565, 568, 570, 453, 454, 633, 634, 232,
- 419, 103, 508, 511, 515, 521, 526, 530,
- 536, 540, 548, 552, 560, 565, 568, 570,
- 453, 454, 636, 637, 638, 639, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 642, 645, 643, 644, 232, 419, 103,
- 508, 511, 515, 521, 526, 530, 536, 540,
- 548, 552, 560, 565, 568, 570, 453, 454,
- 646, 647, 648, 649, 650, 651, 232, 419,
- 103, 508, 511, 515, 521, 526, 530, 536,
- 540, 548, 552, 560, 565, 568, 570, 453,
- 454, 687, 689, 692, 706, 715, 718, 723,
- 728, 738, 741, 766, 770, 796, 797, 232,
- 419, 103, 121, 123, 126, 131, 135, 138,
- 143, 146, 153, 156, 163, 167, 169, 170,
- 453, 454, 232, 419, 103, 121, 123, 126,
- 131, 135, 138, 143, 146, 153, 156, 163,
- 167, 169, 170, 453, 454, 232, 419, 103,
- 121, 123, 126, 131, 135, 138, 143, 146,
- 153, 156, 163, 167, 169, 170, 453, 454,
- 232, 419, 103, 121, 123, 126, 131, 135,
- 138, 143, 146, 153, 156, 163, 167, 169,
- 170, 453, 454, 232, 419, 103, 121, 123,
- 126, 131, 135, 138, 143, 146, 153, 156,
- 163, 167, 169, 170, 453, 454, 232, 419,
- 103, 121, 123, 126, 131, 135, 138, 143,
- 146, 153, 156, 163, 167, 169, 170, 453,
- 454, 232, 419, 103, 121, 123, 126, 131,
- 135, 138, 143, 146, 153, 156, 163, 167,
- 169, 170, 453, 454, 232, 419, 103, 121,
- 123, 126, 131, 135, 138, 143, 146, 153,
- 156, 163, 167, 169, 170, 453, 454, 232,
- 419, 103, 121, 123, 126, 131, 135, 138,
- 143, 146, 153, 156, 163, 167, 169, 170,
- 453, 454, 232, 419, 103, 121, 123, 126,
- 131, 135, 138, 143, 146, 153, 156, 163,
- 167, 169, 170, 453, 454, 232, 419, 103,
- 121, 123, 126, 131, 135, 138, 143, 146,
- 153, 156, 163, 167, 169, 170, 453, 454,
- 232, 419, 103, 121, 123, 126, 131, 135,
- 138, 143, 146, 153, 156, 163, 167, 169,
- 170, 453, 454, 232, 419, 103, 121, 123,
- 126, 131, 135, 138, 143, 146, 153, 156,
- 163, 167, 169, 170, 453, 454, 232, 419,
- 103, 121, 123, 126, 131, 135, 138, 143,
- 146, 153, 156, 163, 167, 169, 170, 453,
- 454, 232, 419, 103, 121, 123, 126, 131,
- 135, 138, 143, 146, 153, 156, 163, 167,
- 169, 170, 453, 454, 232, 419, 103, 121,
- 123, 126, 131, 135, 138, 143, 146, 153,
- 156, 163, 167, 169, 170, 453, 454, 232,
- 419, 103, 121, 123, 126, 131, 135, 138,
- 143, 146, 153, 156, 163, 167, 169, 170,
- 453, 454, 232, 419, 103, 121, 123, 126,
- 131, 135, 138, 143, 146, 153, 156, 163,
- 167, 169, 170, 453, 454, 232, 419, 103,
- 121, 123, 126, 131, 135, 138, 143, 146,
- 153, 156, 163, 167, 169, 170, 453, 454,
- 232, 419, 103, 121, 123, 126, 131, 135,
- 138, 143, 146, 153, 156, 163, 167, 169,
- 170, 453, 454, 232, 419, 103, 121, 123,
- 126, 131, 135, 138, 143, 146, 153, 156,
- 163, 167, 169, 170, 453, 454, 232, 419,
- 103, 121, 123, 126, 131, 135, 138, 143,
- 146, 153, 156, 163, 167, 169, 170, 453,
- 454, 232, 419, 103, 121, 123, 126, 131,
- 135, 138, 143, 146, 153, 156, 163, 167,
- 169, 170, 453, 454, 232, 419, 103, 121,
- 123, 126, 131, 135, 138, 143, 196, 153,
- 156, 163, 167, 169, 170, 453, 454, 146,
- 232, 419, 103, 121, 123, 126, 131, 135,
- 138, 143, 146, 153, 156, 163, 167, 169,
- 170, 453, 454, 232, 419, 103, 121, 123,
- 126, 131, 135, 138, 143, 146, 153, 156,
- 163, 167, 169, 170, 453, 454, 232, 419,
- 103, 121, 123, 126, 131, 135, 138, 143,
- 146, 153, 156, 163, 167, 169, 170, 453,
- 454, 232, 419, 103, 121, 123, 126, 131,
- 135, 138, 143, 146, 153, 156, 163, 167,
- 169, 170, 453, 454, 232, 419, 103, 121,
- 123, 126, 131, 135, 138, 143, 146, 153,
- 156, 163, 167, 169, 170, 453, 454, 232,
- 419, 103, 121, 123, 126, 131, 135, 138,
- 143, 146, 153, 156, 163, 167, 169, 170,
- 453, 454, 232, 419, 103, 121, 123, 126,
- 131, 135, 138, 143, 146, 153, 156, 163,
- 167, 169, 170, 453, 454, 232, 419, 103,
- 121, 123, 126, 131, 135, 138, 143, 146,
- 153, 156, 163, 167, 169, 170, 453, 454,
- 232, 419, 103, 121, 123, 126, 131, 135,
- 138, 143, 146, 153, 156, 163, 167, 169,
- 170, 453, 454, 688, 690, 691, 693, 697,
- 694, 695, 696, 698, 700, 699, 701, 702,
- 703, 704, 705, 707, 710, 708, 709, 711,
- 712, 713, 714, 716, 717, 719, 720, 721,
- 722, 724, 726, 725, 727, 729, 730, 731,
- 732, 733, 734, 735, 736, 737, 739, 740,
- 742, 753, 747, 743, 748, 749, 744, 745,
- 746, 750, 751, 752, 754, 755, 756, 757,
- 758, 759, 762, 760, 761, 763, 764, 765,
- 767, 768, 769, 771, 772, 783, 785, 773,
- 780, 774, 775, 776, 777, 778, 779, 781,
- 782, 784, 786, 787, 788, 789, 790, 794,
- 791, 793, 792, 795, 232, 799, 232, 800,
- 232, 232, 800
-};
+ static const short _demo_machine_parser_cmd_trans_actions[] = {
+ 0, 0, 472, 164, 164, 5, 0, 135,
+ 139, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 135,
+ 135, 0, 0, 0, 135, 0, 135, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 135, 0, 135,
+ 0, 0, 135, 0, 135, 0, 0, 135,
+ 135, 135, 0, 0, 0, 135, 0, 0,
+ 0, 135, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 135, 0, 0, 135, 135,
+ 0, 135, 135, 0, 0, 0, 0, 135,
+ 0, 135, 135, 0, 135, 0, 135, 135,
+ 0, 135, 0, 135, 0, 135, 0, 0,
+ 135, 0, 0, 135, 0, 0, 0, 135,
+ 135, 141, 135, 0, 0, 0, 135, 0,
+ 0, 0, 0, 0, 135, 135, 0, 0,
+ 0, 0, 0, 135, 0, 135, 0, 0,
+ 135, 0, 0, 0, 0, 0, 135, 135,
+ 0, 0, 0, 0, 135, 0, 0, 135,
+ 0, 0, 0, 0, 135, 0, 0, 0,
+ 135, 135, 0, 0, 0, 0, 0, 0,
+ 0, 135, 0, 0, 135, 0, 0, 0,
+ 0, 0, 135, 0, 0, 0, 135, 0,
+ 0, 0, 135, 0, 0, 0, 0, 135,
+ 135, 135, 135, 0, 0, 0, 0, 0,
+ 0, 0, 0, 135, 0, 0, 135, 0,
+ 135, 0, 0, 0, 0, 0, 0, 135,
+ 0, 0, 0, 135, 135, 0, 135, 135,
+ 0, 0, 135, 0, 0, 0, 0, 0,
+ 0, 0, 135, 0, 0, 135, 0, 0,
+ 0, 135, 0, 0, 135, 0, 135, 0,
+ 0, 0, 0, 0, 0, 0, 135, 0,
+ 0, 0, 0, 0, 135, 0, 137, 0,
+ 0, 0, 0, 0, 460, 1, 167, 0,
+ 1025, 0, 1, 476, 0, 464, 1, 1,
+ 135, 0, 135, 135, 135, 135, 0, 135,
+ 0, 0, 135, 135, 0, 135, 170, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 488, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 496, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 508, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 0, 0, 19, 516, 23, 0,
+ 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 0, 0, 512, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 520, 25, 25,
+ 25, 25, 25, 25, 0, 25, 25, 25,
+ 25, 25, 25, 25, 25, 528, 0, 29,
+ 29, 0, 29, 29, 29, 29, 0, 29,
+ 29, 29, 29, 0, 29, 0, 0, 0,
+ 524, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 536, 33, 33, 33, 33,
+ 33, 33, 33, 33, 33, 33, 33, 33,
+ 33, 33, 540, 35, 35, 35, 0, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 0, 0, 0, 0, 0, 35, 0,
+ 0, 544, 37, 37, 37, 37, 37, 37,
+ 0, 37, 37, 37, 37, 37, 37, 37,
+ 37, 0, 0, 0, 0, 0, 548, 39,
+ 39, 39, 39, 39, 39, 0, 39, 39,
+ 39, 39, 39, 39, 39, 0, 0, 0,
+ 39, 23, 560, 45, 45, 45, 0, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 0, 45, 0, 0, 552, 41, 41, 41,
+ 41, 41, 41, 0, 41, 41, 41, 41,
+ 41, 41, 41, 41, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 564, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 584, 57, 57, 57, 57, 57,
+ 57, 0, 57, 57, 57, 57, 57, 57,
+ 57, 57, 0, 0, 0, 0, 0, 0,
+ 568, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 0,
+ 572, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 0,
+ 0, 576, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 0, 580, 55, 55, 55, 55, 55, 55,
+ 55, 55, 55, 55, 55, 55, 0, 55,
+ 0, 0, 0, 0, 0, 55, 556, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 0, 43, 0, 0,
+ 0, 45, 0, 0, 0, 0, 29, 29,
+ 29, 532, 31, 31, 31, 31, 31, 31,
+ 0, 31, 31, 31, 31, 31, 31, 31,
+ 0, 31, 0, 0, 0, 0, 504, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 0, 0, 0,
+ 0, 0, 500, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 0, 0, 0, 0, 0, 0, 0,
+ 492, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 173,
+ 269, 9, 269, 269, 269, 269, 9, 269,
+ 9, 9, 269, 269, 9, 0, 179, 275,
+ 13, 275, 275, 275, 275, 13, 275, 13,
+ 13, 275, 275, 13, 275, 188, 284, 19,
+ 284, 284, 284, 284, 19, 284, 19, 19,
+ 284, 284, 19, 0, 0, 284, 194, 290,
+ 0, 290, 290, 290, 290, 23, 290, 23,
+ 23, 290, 290, 23, 290, 0, 191, 287,
+ 21, 287, 287, 287, 287, 21, 287, 21,
+ 21, 287, 287, 21, 287, 197, 293, 25,
+ 293, 293, 293, 293, 0, 25, 293, 25,
+ 25, 293, 293, 25, 293, 203, 0, 29,
+ 299, 0, 299, 299, 29, 299, 135, 29,
+ 299, 299, 29, 299, 200, 296, 27, 296,
+ 296, 296, 296, 27, 296, 27, 27, 296,
+ 296, 27, 296, 209, 305, 33, 305, 305,
+ 305, 305, 33, 305, 33, 33, 305, 305,
+ 33, 305, 212, 308, 35, 308, 0, 308,
+ 308, 35, 308, 35, 35, 308, 308, 35,
+ 308, 308, 215, 311, 37, 311, 311, 311,
+ 311, 0, 37, 311, 37, 37, 311, 311,
+ 37, 311, 218, 314, 39, 314, 314, 314,
+ 314, 0, 314, 39, 39, 314, 314, 39,
+ 314, 39, 23, 227, 323, 45, 323, 0,
+ 323, 323, 45, 323, 45, 45, 323, 323,
+ 45, 0, 323, 221, 317, 41, 317, 317,
+ 317, 317, 0, 41, 317, 41, 41, 317,
+ 317, 41, 317, 230, 326, 47, 326, 326,
+ 326, 326, 47, 326, 47, 47, 326, 326,
+ 47, 326, 245, 341, 57, 341, 341, 341,
+ 341, 0, 57, 341, 57, 57, 341, 341,
+ 57, 341, 233, 329, 49, 329, 329, 329,
+ 329, 49, 329, 49, 49, 329, 329, 49,
+ 329, 236, 332, 51, 332, 332, 332, 332,
+ 51, 332, 51, 51, 332, 332, 51, 332,
+ 239, 335, 53, 335, 335, 335, 335, 53,
+ 335, 53, 53, 335, 335, 53, 335, 242,
+ 338, 55, 338, 338, 338, 338, 55, 338,
+ 55, 55, 338, 338, 0, 338, 55, 224,
+ 320, 43, 320, 320, 320, 320, 43, 320,
+ 43, 43, 320, 320, 43, 0, 320, 323,
+ 299, 299, 29, 206, 302, 31, 302, 302,
+ 302, 302, 0, 302, 31, 31, 302, 302,
+ 31, 302, 31, 185, 281, 17, 281, 281,
+ 281, 281, 17, 281, 17, 17, 281, 281,
+ 17, 281, 182, 278, 15, 278, 278, 278,
+ 278, 15, 278, 15, 15, 278, 278, 15,
+ 278, 0, 176, 272, 11, 272, 272, 272,
+ 272, 11, 272, 11, 11, 272, 272, 11,
+ 272, 1638, 736, 1240, 736, 1035, 149, 149,
+ 149, 149, 149, 149, 149, 149, 149, 149,
+ 149, 149, 149, 149, 1240, 1240, 1035, 1434,
+ 135, 263, 480, 740, 480, 1020, 135, 143,
+ 257, 143, 1030, 1, 146, 1, 135, 135,
+ 0, 484, 0, 7, 152, 0, 0, 0,
+ 0, 1235, 254, 129, 0, 129, 129, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1230,
+ 251, 127, 127, 127, 1225, 248, 0, 125,
+ 125, 0, 0, 125, 728, 129, 449, 0,
+ 449, 129, 0, 724, 127, 446, 446, 127,
+ 720, 125, 0, 443, 125, 443, 468, 3,
+ 135, 3, 260, 260, 1410, 155, 1, 732,
+ 155, 135, 135, 135, 1040, 3, 0, 266,
+ 3, 0, 135, 3, 3, 0, 0, 0,
+ 1428, 1016, 129, 0, 129, 129, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1422, 1012,
+ 127, 127, 127, 1416, 1008, 0, 125, 125,
+ 0, 0, 125, 1055, 449, 449, 135, 449,
+ 449, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 1050, 446, 446, 446, 446, 1045, 443,
+ 135, 443, 443, 135, 135, 443, 736, 736,
+ 736, 736, 736, 736, 736, 736, 736, 736,
+ 736, 736, 736, 736, 135, 135, 1645, 748,
+ 1060, 344, 344, 344, 344, 344, 344, 344,
+ 344, 344, 344, 344, 344, 344, 344, 1245,
+ 1060, 135, 135, 135, 1652, 756, 1065, 347,
+ 347, 347, 347, 347, 347, 347, 347, 347,
+ 347, 347, 347, 347, 347, 1250, 1065, 135,
+ 135, 135, 135, 135, 135, 135, 1659, 764,
+ 1070, 350, 350, 350, 350, 350, 350, 350,
+ 350, 350, 350, 350, 350, 350, 350, 1255,
+ 1070, 135, 135, 135, 135, 135, 1687, 796,
+ 1090, 362, 362, 362, 362, 362, 362, 362,
+ 362, 362, 362, 362, 362, 362, 362, 1275,
+ 1090, 135, 135, 135, 1701, 812, 1100, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 1285, 1100, 135,
+ 135, 135, 135, 135, 1708, 820, 1105, 371,
+ 371, 371, 371, 371, 371, 371, 371, 371,
+ 371, 371, 371, 371, 371, 1290, 1105, 135,
+ 135, 135, 135, 135, 1715, 828, 1110, 374,
+ 374, 374, 374, 374, 374, 374, 374, 374,
+ 374, 374, 374, 374, 374, 1295, 1110, 135,
+ 135, 135, 135, 135, 135, 135, 135, 1736,
+ 852, 1125, 383, 383, 383, 383, 383, 383,
+ 383, 383, 383, 383, 383, 383, 383, 383,
+ 1310, 1125, 135, 135, 135, 1750, 868, 1135,
+ 389, 389, 389, 389, 389, 389, 389, 389,
+ 389, 389, 389, 389, 389, 389, 1320, 1135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 1757, 876, 1140, 392, 392, 392,
+ 392, 392, 392, 392, 392, 392, 392, 392,
+ 392, 392, 392, 1325, 1140, 135, 135, 135,
+ 135, 1799, 924, 1170, 410, 410, 410, 410,
+ 410, 410, 410, 410, 410, 410, 410, 410,
+ 410, 410, 1355, 1170, 135, 135, 135, 135,
+ 135, 1806, 932, 1175, 413, 413, 413, 413,
+ 413, 413, 413, 413, 413, 413, 413, 413,
+ 413, 413, 1360, 1175, 135, 1869, 1004, 1220,
+ 440, 440, 440, 440, 440, 440, 440, 440,
+ 440, 440, 440, 440, 440, 440, 1405, 1220,
+ 135, 1694, 804, 1095, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 1280, 1095, 135, 135, 135, 1813,
+ 940, 1180, 416, 416, 416, 416, 416, 416,
+ 416, 416, 416, 416, 416, 416, 416, 416,
+ 1365, 1180, 135, 135, 135, 135, 135, 135,
+ 135, 1820, 948, 1185, 419, 419, 419, 419,
+ 419, 419, 419, 419, 419, 419, 419, 419,
+ 419, 419, 1370, 1185, 135, 135, 135, 1827,
+ 956, 1190, 422, 422, 422, 422, 422, 422,
+ 422, 422, 422, 422, 422, 422, 422, 422,
+ 1375, 1190, 135, 135, 1834, 964, 1195, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 1380, 1195, 135,
+ 135, 135, 135, 135, 135, 135, 1841, 972,
+ 1200, 428, 428, 428, 428, 428, 428, 428,
+ 428, 428, 428, 428, 428, 428, 428, 1385,
+ 1200, 135, 135, 135, 135, 1855, 988, 1210,
+ 434, 434, 434, 434, 434, 434, 434, 434,
+ 434, 434, 434, 434, 434, 434, 1395, 1210,
+ 135, 1848, 980, 1205, 431, 431, 431, 431,
+ 431, 431, 431, 431, 431, 431, 431, 431,
+ 431, 431, 1390, 1205, 135, 135, 1862, 996,
+ 1215, 437, 437, 437, 437, 437, 437, 437,
+ 437, 437, 437, 437, 437, 437, 437, 1400,
+ 1215, 135, 1764, 884, 1145, 395, 395, 395,
+ 395, 395, 395, 395, 395, 395, 395, 395,
+ 395, 395, 395, 1330, 1145, 1771, 892, 1150,
+ 398, 398, 398, 398, 398, 398, 398, 135,
+ 398, 398, 398, 398, 398, 398, 1335, 1150,
+ 135, 135, 135, 398, 135, 135, 135, 135,
+ 135, 135, 135, 135, 1778, 900, 1155, 401,
+ 401, 401, 401, 401, 401, 401, 401, 401,
+ 401, 401, 401, 401, 401, 1340, 1155, 135,
+ 135, 135, 1785, 908, 1160, 404, 404, 404,
+ 404, 404, 404, 404, 404, 404, 404, 404,
+ 404, 404, 404, 1345, 1160, 135, 135, 135,
+ 135, 1792, 916, 1165, 407, 407, 407, 407,
+ 407, 407, 407, 407, 407, 407, 407, 407,
+ 407, 407, 1350, 1165, 135, 135, 135, 1743,
+ 860, 1130, 386, 386, 386, 386, 386, 386,
+ 386, 386, 386, 386, 386, 386, 386, 386,
+ 1315, 1130, 1722, 836, 1115, 377, 377, 377,
+ 377, 377, 377, 377, 377, 377, 377, 377,
+ 377, 377, 377, 1300, 1115, 135, 135, 1729,
+ 844, 1120, 380, 380, 380, 380, 380, 380,
+ 380, 380, 380, 380, 380, 380, 380, 380,
+ 1305, 1120, 135, 135, 135, 135, 1666, 772,
+ 1075, 353, 353, 353, 353, 353, 353, 353,
+ 353, 353, 353, 353, 353, 353, 353, 1260,
+ 1075, 135, 135, 135, 135, 1673, 780, 1080,
+ 356, 356, 356, 356, 356, 356, 356, 356,
+ 356, 356, 356, 356, 356, 356, 1265, 1080,
+ 135, 135, 135, 135, 135, 135, 1680, 788,
+ 1085, 359, 359, 359, 359, 359, 359, 359,
+ 359, 359, 359, 359, 359, 359, 359, 1270,
+ 1085, 736, 736, 736, 736, 736, 736, 736,
+ 736, 736, 736, 736, 736, 736, 736, 1440,
+ 344, 588, 59, 59, 59, 59, 59, 59,
+ 59, 59, 59, 59, 59, 59, 59, 59,
+ 744, 588, 1446, 347, 592, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 752, 592, 1452, 350, 596,
+ 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 760, 596,
+ 1476, 362, 612, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 792, 612, 1488, 368, 620, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 808, 620, 1494, 371,
+ 624, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 816,
+ 624, 1500, 374, 628, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 824, 628, 1518, 383, 640, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 848, 640, 1530,
+ 389, 648, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89,
+ 864, 648, 1536, 392, 652, 91, 91, 91,
+ 91, 91, 91, 91, 91, 91, 91, 91,
+ 91, 91, 91, 872, 652, 1572, 410, 676,
+ 103, 103, 103, 103, 103, 103, 103, 103,
+ 103, 103, 103, 103, 103, 103, 920, 676,
+ 1578, 413, 680, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 928, 680, 1632, 440, 716, 123, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123, 123, 1000, 716, 1482, 365,
+ 616, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 800,
+ 616, 1584, 416, 684, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 936, 684, 1590, 419, 688, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 944, 688, 1596,
+ 422, 692, 111, 111, 111, 111, 111, 111,
+ 111, 111, 111, 111, 111, 111, 111, 111,
+ 952, 692, 1602, 425, 696, 113, 113, 113,
+ 113, 113, 113, 113, 113, 113, 113, 113,
+ 113, 113, 113, 960, 696, 1608, 428, 700,
+ 115, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 968, 700,
+ 1620, 434, 708, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 984, 708, 1614, 431, 704, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 976, 704, 1626, 437,
+ 712, 121, 121, 121, 121, 121, 121, 121,
+ 121, 121, 121, 121, 121, 121, 121, 992,
+ 712, 1542, 395, 656, 93, 93, 93, 93,
+ 93, 93, 93, 93, 93, 93, 93, 93,
+ 93, 93, 880, 656, 1548, 398, 660, 95,
+ 95, 95, 95, 95, 95, 95, 0, 95,
+ 95, 95, 95, 95, 95, 888, 660, 95,
+ 1554, 401, 664, 97, 97, 97, 97, 97,
+ 97, 97, 97, 97, 97, 97, 97, 97,
+ 97, 896, 664, 1560, 404, 668, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 904, 668, 1566, 407,
+ 672, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 912,
+ 672, 1524, 386, 644, 87, 87, 87, 87,
+ 87, 87, 87, 87, 87, 87, 87, 87,
+ 87, 87, 856, 644, 1506, 377, 632, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 832, 632, 1512,
+ 380, 636, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 840, 636, 1458, 353, 600, 65, 65, 65,
+ 65, 65, 65, 65, 65, 65, 65, 65,
+ 65, 65, 65, 768, 600, 1464, 356, 604,
+ 67, 67, 67, 67, 67, 67, 67, 67,
+ 67, 67, 67, 67, 67, 67, 776, 604,
+ 1470, 359, 608, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 784, 608, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 456, 0, 452, 1,
+ 161, 158, 0
+ };
-static const short _demo_machine_parser_cmd_trans_actions[] = {
- 0, 0, 472, 164, 164, 5, 0, 135,
- 139, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 135,
- 135, 0, 0, 0, 135, 0, 135, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 135, 0, 135,
- 0, 0, 135, 0, 135, 0, 0, 135,
- 135, 135, 0, 0, 0, 135, 0, 0,
- 0, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 135, 0, 0, 135, 135,
- 0, 135, 135, 0, 0, 0, 0, 135,
- 0, 135, 135, 0, 135, 0, 135, 135,
- 0, 135, 0, 135, 0, 135, 0, 0,
- 135, 0, 0, 135, 0, 0, 0, 135,
- 135, 141, 135, 0, 0, 0, 135, 0,
- 0, 0, 0, 0, 135, 135, 0, 0,
- 0, 0, 0, 135, 0, 135, 0, 0,
- 135, 0, 0, 0, 0, 0, 135, 135,
- 0, 0, 0, 0, 135, 0, 0, 135,
- 0, 0, 0, 0, 135, 0, 0, 0,
- 135, 135, 0, 0, 0, 0, 0, 0,
- 0, 135, 0, 0, 135, 0, 0, 0,
- 0, 0, 135, 0, 0, 0, 135, 0,
- 0, 0, 135, 0, 0, 0, 0, 135,
- 135, 135, 135, 0, 0, 0, 0, 0,
- 0, 0, 0, 135, 0, 0, 135, 0,
- 135, 0, 0, 0, 0, 0, 0, 135,
- 0, 0, 0, 135, 135, 0, 135, 135,
- 0, 0, 135, 0, 0, 0, 0, 0,
- 0, 0, 135, 0, 0, 135, 0, 0,
- 0, 135, 0, 0, 135, 0, 135, 0,
- 0, 0, 0, 0, 0, 0, 135, 0,
- 0, 0, 0, 0, 135, 0, 137, 0,
- 0, 0, 0, 0, 460, 1, 167, 0,
- 1025, 0, 1, 476, 0, 464, 1, 1,
- 135, 0, 135, 135, 135, 135, 0, 135,
- 0, 0, 135, 135, 0, 135, 170, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 488, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 496, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 508, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 19, 516, 23, 0,
- 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 0, 0, 512, 21,
- 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 520, 25, 25,
- 25, 25, 25, 25, 0, 25, 25, 25,
- 25, 25, 25, 25, 25, 528, 0, 29,
- 29, 0, 29, 29, 29, 29, 0, 29,
- 29, 29, 29, 0, 29, 0, 0, 0,
- 524, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 536, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 540, 35, 35, 35, 0, 35,
- 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 0, 0, 0, 0, 0, 35, 0,
- 0, 544, 37, 37, 37, 37, 37, 37,
- 0, 37, 37, 37, 37, 37, 37, 37,
- 37, 0, 0, 0, 0, 0, 548, 39,
- 39, 39, 39, 39, 39, 0, 39, 39,
- 39, 39, 39, 39, 39, 0, 0, 0,
- 39, 23, 560, 45, 45, 45, 0, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 0, 45, 0, 0, 552, 41, 41, 41,
- 41, 41, 41, 0, 41, 41, 41, 41,
- 41, 41, 41, 41, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 564, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 584, 57, 57, 57, 57, 57,
- 57, 0, 57, 57, 57, 57, 57, 57,
- 57, 57, 0, 0, 0, 0, 0, 0,
- 568, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 0,
- 572, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 0,
- 0, 576, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53,
- 0, 580, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 0, 55,
- 0, 0, 0, 0, 0, 55, 556, 43,
- 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 0, 43, 0, 0,
- 0, 45, 0, 0, 0, 0, 29, 29,
- 29, 532, 31, 31, 31, 31, 31, 31,
- 0, 31, 31, 31, 31, 31, 31, 31,
- 0, 31, 0, 0, 0, 0, 504, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 0, 0, 0,
- 0, 0, 500, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 0, 0, 0, 0, 0, 0, 0,
- 492, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 173,
- 269, 9, 269, 269, 269, 269, 9, 269,
- 9, 9, 269, 269, 9, 0, 179, 275,
- 13, 275, 275, 275, 275, 13, 275, 13,
- 13, 275, 275, 13, 275, 188, 284, 19,
- 284, 284, 284, 284, 19, 284, 19, 19,
- 284, 284, 19, 0, 0, 284, 194, 290,
- 0, 290, 290, 290, 290, 23, 290, 23,
- 23, 290, 290, 23, 290, 0, 191, 287,
- 21, 287, 287, 287, 287, 21, 287, 21,
- 21, 287, 287, 21, 287, 197, 293, 25,
- 293, 293, 293, 293, 0, 25, 293, 25,
- 25, 293, 293, 25, 293, 203, 0, 29,
- 299, 0, 299, 299, 29, 299, 135, 29,
- 299, 299, 29, 299, 200, 296, 27, 296,
- 296, 296, 296, 27, 296, 27, 27, 296,
- 296, 27, 296, 209, 305, 33, 305, 305,
- 305, 305, 33, 305, 33, 33, 305, 305,
- 33, 305, 212, 308, 35, 308, 0, 308,
- 308, 35, 308, 35, 35, 308, 308, 35,
- 308, 308, 215, 311, 37, 311, 311, 311,
- 311, 0, 37, 311, 37, 37, 311, 311,
- 37, 311, 218, 314, 39, 314, 314, 314,
- 314, 0, 314, 39, 39, 314, 314, 39,
- 314, 39, 23, 227, 323, 45, 323, 0,
- 323, 323, 45, 323, 45, 45, 323, 323,
- 45, 0, 323, 221, 317, 41, 317, 317,
- 317, 317, 0, 41, 317, 41, 41, 317,
- 317, 41, 317, 230, 326, 47, 326, 326,
- 326, 326, 47, 326, 47, 47, 326, 326,
- 47, 326, 245, 341, 57, 341, 341, 341,
- 341, 0, 57, 341, 57, 57, 341, 341,
- 57, 341, 233, 329, 49, 329, 329, 329,
- 329, 49, 329, 49, 49, 329, 329, 49,
- 329, 236, 332, 51, 332, 332, 332, 332,
- 51, 332, 51, 51, 332, 332, 51, 332,
- 239, 335, 53, 335, 335, 335, 335, 53,
- 335, 53, 53, 335, 335, 53, 335, 242,
- 338, 55, 338, 338, 338, 338, 55, 338,
- 55, 55, 338, 338, 0, 338, 55, 224,
- 320, 43, 320, 320, 320, 320, 43, 320,
- 43, 43, 320, 320, 43, 0, 320, 323,
- 299, 299, 29, 206, 302, 31, 302, 302,
- 302, 302, 0, 302, 31, 31, 302, 302,
- 31, 302, 31, 185, 281, 17, 281, 281,
- 281, 281, 17, 281, 17, 17, 281, 281,
- 17, 281, 182, 278, 15, 278, 278, 278,
- 278, 15, 278, 15, 15, 278, 278, 15,
- 278, 0, 176, 272, 11, 272, 272, 272,
- 272, 11, 272, 11, 11, 272, 272, 11,
- 272, 1638, 736, 1240, 736, 1035, 149, 149,
- 149, 149, 149, 149, 149, 149, 149, 149,
- 149, 149, 149, 149, 1240, 1240, 1035, 1434,
- 135, 263, 480, 740, 480, 1020, 135, 143,
- 257, 143, 1030, 1, 146, 1, 135, 135,
- 0, 484, 0, 7, 152, 0, 0, 0,
- 0, 1235, 254, 129, 0, 129, 129, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1230,
- 251, 127, 127, 127, 1225, 248, 0, 125,
- 125, 0, 0, 125, 728, 129, 449, 0,
- 449, 129, 0, 724, 127, 446, 446, 127,
- 720, 125, 0, 443, 125, 443, 468, 3,
- 135, 3, 260, 260, 1410, 155, 1, 732,
- 155, 135, 135, 135, 1040, 3, 0, 266,
- 3, 0, 135, 3, 3, 0, 0, 0,
- 1428, 1016, 129, 0, 129, 129, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1422, 1012,
- 127, 127, 127, 1416, 1008, 0, 125, 125,
- 0, 0, 125, 1055, 449, 449, 135, 449,
- 449, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 1050, 446, 446, 446, 446, 1045, 443,
- 135, 443, 443, 135, 135, 443, 736, 736,
- 736, 736, 736, 736, 736, 736, 736, 736,
- 736, 736, 736, 736, 135, 135, 1645, 748,
- 1060, 344, 344, 344, 344, 344, 344, 344,
- 344, 344, 344, 344, 344, 344, 344, 1245,
- 1060, 135, 135, 135, 1652, 756, 1065, 347,
- 347, 347, 347, 347, 347, 347, 347, 347,
- 347, 347, 347, 347, 347, 1250, 1065, 135,
- 135, 135, 135, 135, 135, 135, 1659, 764,
- 1070, 350, 350, 350, 350, 350, 350, 350,
- 350, 350, 350, 350, 350, 350, 350, 1255,
- 1070, 135, 135, 135, 135, 135, 1687, 796,
- 1090, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 1275,
- 1090, 135, 135, 135, 1701, 812, 1100, 368,
- 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 1285, 1100, 135,
- 135, 135, 135, 135, 1708, 820, 1105, 371,
- 371, 371, 371, 371, 371, 371, 371, 371,
- 371, 371, 371, 371, 371, 1290, 1105, 135,
- 135, 135, 135, 135, 1715, 828, 1110, 374,
- 374, 374, 374, 374, 374, 374, 374, 374,
- 374, 374, 374, 374, 374, 1295, 1110, 135,
- 135, 135, 135, 135, 135, 135, 135, 1736,
- 852, 1125, 383, 383, 383, 383, 383, 383,
- 383, 383, 383, 383, 383, 383, 383, 383,
- 1310, 1125, 135, 135, 135, 1750, 868, 1135,
- 389, 389, 389, 389, 389, 389, 389, 389,
- 389, 389, 389, 389, 389, 389, 1320, 1135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 1757, 876, 1140, 392, 392, 392,
- 392, 392, 392, 392, 392, 392, 392, 392,
- 392, 392, 392, 1325, 1140, 135, 135, 135,
- 135, 1799, 924, 1170, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 1355, 1170, 135, 135, 135, 135,
- 135, 1806, 932, 1175, 413, 413, 413, 413,
- 413, 413, 413, 413, 413, 413, 413, 413,
- 413, 413, 1360, 1175, 135, 1869, 1004, 1220,
- 440, 440, 440, 440, 440, 440, 440, 440,
- 440, 440, 440, 440, 440, 440, 1405, 1220,
- 135, 1694, 804, 1095, 365, 365, 365, 365,
- 365, 365, 365, 365, 365, 365, 365, 365,
- 365, 365, 1280, 1095, 135, 135, 135, 1813,
- 940, 1180, 416, 416, 416, 416, 416, 416,
- 416, 416, 416, 416, 416, 416, 416, 416,
- 1365, 1180, 135, 135, 135, 135, 135, 135,
- 135, 1820, 948, 1185, 419, 419, 419, 419,
- 419, 419, 419, 419, 419, 419, 419, 419,
- 419, 419, 1370, 1185, 135, 135, 135, 1827,
- 956, 1190, 422, 422, 422, 422, 422, 422,
- 422, 422, 422, 422, 422, 422, 422, 422,
- 1375, 1190, 135, 135, 1834, 964, 1195, 425,
- 425, 425, 425, 425, 425, 425, 425, 425,
- 425, 425, 425, 425, 425, 1380, 1195, 135,
- 135, 135, 135, 135, 135, 135, 1841, 972,
- 1200, 428, 428, 428, 428, 428, 428, 428,
- 428, 428, 428, 428, 428, 428, 428, 1385,
- 1200, 135, 135, 135, 135, 1855, 988, 1210,
- 434, 434, 434, 434, 434, 434, 434, 434,
- 434, 434, 434, 434, 434, 434, 1395, 1210,
- 135, 1848, 980, 1205, 431, 431, 431, 431,
- 431, 431, 431, 431, 431, 431, 431, 431,
- 431, 431, 1390, 1205, 135, 135, 1862, 996,
- 1215, 437, 437, 437, 437, 437, 437, 437,
- 437, 437, 437, 437, 437, 437, 437, 1400,
- 1215, 135, 1764, 884, 1145, 395, 395, 395,
- 395, 395, 395, 395, 395, 395, 395, 395,
- 395, 395, 395, 1330, 1145, 1771, 892, 1150,
- 398, 398, 398, 398, 398, 398, 398, 135,
- 398, 398, 398, 398, 398, 398, 1335, 1150,
- 135, 135, 135, 398, 135, 135, 135, 135,
- 135, 135, 135, 135, 1778, 900, 1155, 401,
- 401, 401, 401, 401, 401, 401, 401, 401,
- 401, 401, 401, 401, 401, 1340, 1155, 135,
- 135, 135, 1785, 908, 1160, 404, 404, 404,
- 404, 404, 404, 404, 404, 404, 404, 404,
- 404, 404, 404, 1345, 1160, 135, 135, 135,
- 135, 1792, 916, 1165, 407, 407, 407, 407,
- 407, 407, 407, 407, 407, 407, 407, 407,
- 407, 407, 1350, 1165, 135, 135, 135, 1743,
- 860, 1130, 386, 386, 386, 386, 386, 386,
- 386, 386, 386, 386, 386, 386, 386, 386,
- 1315, 1130, 1722, 836, 1115, 377, 377, 377,
- 377, 377, 377, 377, 377, 377, 377, 377,
- 377, 377, 377, 1300, 1115, 135, 135, 1729,
- 844, 1120, 380, 380, 380, 380, 380, 380,
- 380, 380, 380, 380, 380, 380, 380, 380,
- 1305, 1120, 135, 135, 135, 135, 1666, 772,
- 1075, 353, 353, 353, 353, 353, 353, 353,
- 353, 353, 353, 353, 353, 353, 353, 1260,
- 1075, 135, 135, 135, 135, 1673, 780, 1080,
- 356, 356, 356, 356, 356, 356, 356, 356,
- 356, 356, 356, 356, 356, 356, 1265, 1080,
- 135, 135, 135, 135, 135, 135, 1680, 788,
- 1085, 359, 359, 359, 359, 359, 359, 359,
- 359, 359, 359, 359, 359, 359, 359, 1270,
- 1085, 736, 736, 736, 736, 736, 736, 736,
- 736, 736, 736, 736, 736, 736, 736, 1440,
- 344, 588, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59,
- 744, 588, 1446, 347, 592, 61, 61, 61,
- 61, 61, 61, 61, 61, 61, 61, 61,
- 61, 61, 61, 752, 592, 1452, 350, 596,
- 63, 63, 63, 63, 63, 63, 63, 63,
- 63, 63, 63, 63, 63, 63, 760, 596,
- 1476, 362, 612, 71, 71, 71, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 71,
- 71, 792, 612, 1488, 368, 620, 75, 75,
- 75, 75, 75, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 808, 620, 1494, 371,
- 624, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 77, 77, 816,
- 624, 1500, 374, 628, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 824, 628, 1518, 383, 640, 85,
- 85, 85, 85, 85, 85, 85, 85, 85,
- 85, 85, 85, 85, 85, 848, 640, 1530,
- 389, 648, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89,
- 864, 648, 1536, 392, 652, 91, 91, 91,
- 91, 91, 91, 91, 91, 91, 91, 91,
- 91, 91, 91, 872, 652, 1572, 410, 676,
- 103, 103, 103, 103, 103, 103, 103, 103,
- 103, 103, 103, 103, 103, 103, 920, 676,
- 1578, 413, 680, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 928, 680, 1632, 440, 716, 123, 123,
- 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 1000, 716, 1482, 365,
- 616, 73, 73, 73, 73, 73, 73, 73,
- 73, 73, 73, 73, 73, 73, 73, 800,
- 616, 1584, 416, 684, 107, 107, 107, 107,
- 107, 107, 107, 107, 107, 107, 107, 107,
- 107, 107, 936, 684, 1590, 419, 688, 109,
- 109, 109, 109, 109, 109, 109, 109, 109,
- 109, 109, 109, 109, 109, 944, 688, 1596,
- 422, 692, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111,
- 952, 692, 1602, 425, 696, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 960, 696, 1608, 428, 700,
- 115, 115, 115, 115, 115, 115, 115, 115,
- 115, 115, 115, 115, 115, 115, 968, 700,
- 1620, 434, 708, 119, 119, 119, 119, 119,
- 119, 119, 119, 119, 119, 119, 119, 119,
- 119, 984, 708, 1614, 431, 704, 117, 117,
- 117, 117, 117, 117, 117, 117, 117, 117,
- 117, 117, 117, 117, 976, 704, 1626, 437,
- 712, 121, 121, 121, 121, 121, 121, 121,
- 121, 121, 121, 121, 121, 121, 121, 992,
- 712, 1542, 395, 656, 93, 93, 93, 93,
- 93, 93, 93, 93, 93, 93, 93, 93,
- 93, 93, 880, 656, 1548, 398, 660, 95,
- 95, 95, 95, 95, 95, 95, 0, 95,
- 95, 95, 95, 95, 95, 888, 660, 95,
- 1554, 401, 664, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 896, 664, 1560, 404, 668, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 904, 668, 1566, 407,
- 672, 101, 101, 101, 101, 101, 101, 101,
- 101, 101, 101, 101, 101, 101, 101, 912,
- 672, 1524, 386, 644, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 856, 644, 1506, 377, 632, 81,
- 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 832, 632, 1512,
- 380, 636, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83,
- 840, 636, 1458, 353, 600, 65, 65, 65,
- 65, 65, 65, 65, 65, 65, 65, 65,
- 65, 65, 65, 768, 600, 1464, 356, 604,
- 67, 67, 67, 67, 67, 67, 67, 67,
- 67, 67, 67, 67, 67, 67, 776, 604,
- 1470, 359, 608, 69, 69, 69, 69, 69,
- 69, 69, 69, 69, 69, 69, 69, 69,
- 69, 784, 608, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 456, 0, 452, 1,
- 161, 158, 0
-};
+ static const short _demo_machine_parser_cmd_to_state_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 131, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
-static const short _demo_machine_parser_cmd_to_state_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 131, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
+ static const short _demo_machine_parser_cmd_from_state_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 133, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
-static const short _demo_machine_parser_cmd_from_state_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 133, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
+ static const short _demo_machine_parser_cmd_eof_trans[] = {
+ 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 0,
+ 0, 269, 271, 273, 276, 278, 295, 278,
+ 311, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 342, 357,
+ 374, 295, 391, 406, 422, 295, 295, 295,
+ 295, 441, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 468, 483,
+ 295, 295, 295, 295, 295, 483, 295, 295,
+ 506, 295, 295, 295, 506, 295, 295, 527,
+ 295, 295, 295, 527, 374, 547, 295, 565,
+ 295, 295, 295, 295, 565, 295, 295, 295,
+ 295, 295, 295, 295, 596, 611, 295, 295,
+ 295, 611, 295, 295, 295, 633, 295, 649,
+ 295, 295, 666, 295, 682, 295, 295, 295,
+ 295, 295, 682, 703, 295, 295, 703, 295,
+ 547, 295, 295, 374, 295, 295, 422, 730,
+ 295, 730, 295, 295, 406, 295, 295, 751,
+ 295, 295, 357, 295, 295, 295, 771, 295,
+ 295, 295, 295, 311, 295, 295, 295, 295,
+ 793, 808, 823, 838, 855, 871, 886, 902,
+ 917, 932, 947, 947, 963, 963, 979, 979,
+ 855, 996, 1012, 1012, 1028, 1043, 1043, 1059,
+ 1074, 1089, 1104, 1104, 1120, 1120, 996, 855,
+ 902, 1140, 1140, 886, 1156, 838, 1171, 808,
+ 1187, 1202, 1224, 1230, 1235, 1242, 1245, 1235,
+ 1250, 1242, 1242, 1242, 1242, 1250, 1250, 1242,
+ 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
+ 1242, 1242, 1272, 1277, 1242, 1242, 1277, 1285,
+ 1285, 1285, 1292, 1297, 1297, 1303, 1303, 1309,
+ 1317, 1242, 1303, 1317, 1309, 1329, 1317, 1317,
+ 1317, 1317, 1329, 1329, 1317, 1317, 1317, 1317,
+ 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1351,
+ 1356, 1317, 1317, 1356, 1364, 1303, 1303, 1303,
+ 1303, 1364, 1364, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1386, 1391,
+ 1303, 1303, 1391, 1202, 1224, 1224, 1415, 1224,
+ 1224, 1224, 1437, 1224, 1224, 1224, 1224, 1224,
+ 1463, 1224, 1224, 1224, 1224, 1487, 1224, 1224,
+ 1224, 1509, 1224, 1224, 1224, 1224, 1224, 1533,
+ 1224, 1224, 1224, 1557, 1224, 1224, 1224, 1224,
+ 1224, 1224, 1224, 1584, 1224, 1224, 1224, 1606,
+ 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1635,
+ 1224, 1224, 1224, 1224, 1658, 1224, 1224, 1682,
+ 1224, 1702, 1224, 1722, 1224, 1744, 1224, 1224,
+ 1224, 1224, 1224, 1224, 1224, 1770, 1224, 1224,
+ 1224, 1792, 1224, 1224, 1813, 1224, 1224, 1224,
+ 1224, 1224, 1839, 1224, 1224, 1224, 1862, 1224,
+ 1882, 1224, 1224, 1903, 1224, 1923, 1942, 1224,
+ 1224, 1224, 1942, 1224, 1224, 1224, 1224, 1224,
+ 1224, 1973, 1224, 1224, 1224, 1995, 1224, 1224,
+ 1224, 1224, 2018, 1224, 1224, 1224, 2040, 2059,
+ 1224, 1224, 2080, 1224, 1224, 1224, 1224, 1224,
+ 2103, 1224, 1224, 1224, 2126, 1224, 1224, 1224,
+ 1224, 1224, 1224, 2151, 1202, 2184, 2203, 2222,
+ 2241, 2260, 2279, 2298, 2317, 2336, 2355, 2374,
+ 2393, 2412, 2431, 2450, 2469, 2488, 2507, 2526,
+ 2545, 2564, 2583, 2602, 2621, 2621, 2641, 2660,
+ 2679, 2698, 2717, 2736, 2755, 2774, 2793, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 2621, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+ 1303, 1303, 1303, 1303, 1303, 1303, 2909, 2909,
+ 2913
+ };
-static const short _demo_machine_parser_cmd_eof_trans[] = {
- 0, 0, 0, 0, 0, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 0, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 0,
- 0, 269, 271, 273, 276, 278, 295, 278,
- 311, 295, 295, 295, 295, 295, 295, 295,
- 295, 295, 295, 295, 295, 295, 342, 357,
- 374, 295, 391, 406, 422, 295, 295, 295,
- 295, 441, 295, 295, 295, 295, 295, 295,
- 295, 295, 295, 295, 295, 295, 468, 483,
- 295, 295, 295, 295, 295, 483, 295, 295,
- 506, 295, 295, 295, 506, 295, 295, 527,
- 295, 295, 295, 527, 374, 547, 295, 565,
- 295, 295, 295, 295, 565, 295, 295, 295,
- 295, 295, 295, 295, 596, 611, 295, 295,
- 295, 611, 295, 295, 295, 633, 295, 649,
- 295, 295, 666, 295, 682, 295, 295, 295,
- 295, 295, 682, 703, 295, 295, 703, 295,
- 547, 295, 295, 374, 295, 295, 422, 730,
- 295, 730, 295, 295, 406, 295, 295, 751,
- 295, 295, 357, 295, 295, 295, 771, 295,
- 295, 295, 295, 311, 295, 295, 295, 295,
- 793, 808, 823, 838, 855, 871, 886, 902,
- 917, 932, 947, 947, 963, 963, 979, 979,
- 855, 996, 1012, 1012, 1028, 1043, 1043, 1059,
- 1074, 1089, 1104, 1104, 1120, 1120, 996, 855,
- 902, 1140, 1140, 886, 1156, 838, 1171, 808,
- 1187, 1202, 1224, 1230, 1235, 1242, 1245, 1235,
- 1250, 1242, 1242, 1242, 1242, 1250, 1250, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1272, 1277, 1242, 1242, 1277, 1285,
- 1285, 1285, 1292, 1297, 1297, 1303, 1303, 1309,
- 1317, 1242, 1303, 1317, 1309, 1329, 1317, 1317,
- 1317, 1317, 1329, 1329, 1317, 1317, 1317, 1317,
- 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1351,
- 1356, 1317, 1317, 1356, 1364, 1303, 1303, 1303,
- 1303, 1364, 1364, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1386, 1391,
- 1303, 1303, 1391, 1202, 1224, 1224, 1415, 1224,
- 1224, 1224, 1437, 1224, 1224, 1224, 1224, 1224,
- 1463, 1224, 1224, 1224, 1224, 1487, 1224, 1224,
- 1224, 1509, 1224, 1224, 1224, 1224, 1224, 1533,
- 1224, 1224, 1224, 1557, 1224, 1224, 1224, 1224,
- 1224, 1224, 1224, 1584, 1224, 1224, 1224, 1606,
- 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1635,
- 1224, 1224, 1224, 1224, 1658, 1224, 1224, 1682,
- 1224, 1702, 1224, 1722, 1224, 1744, 1224, 1224,
- 1224, 1224, 1224, 1224, 1224, 1770, 1224, 1224,
- 1224, 1792, 1224, 1224, 1813, 1224, 1224, 1224,
- 1224, 1224, 1839, 1224, 1224, 1224, 1862, 1224,
- 1882, 1224, 1224, 1903, 1224, 1923, 1942, 1224,
- 1224, 1224, 1942, 1224, 1224, 1224, 1224, 1224,
- 1224, 1973, 1224, 1224, 1224, 1995, 1224, 1224,
- 1224, 1224, 2018, 1224, 1224, 1224, 2040, 2059,
- 1224, 1224, 2080, 1224, 1224, 1224, 1224, 1224,
- 2103, 1224, 1224, 1224, 2126, 1224, 1224, 1224,
- 1224, 1224, 1224, 2151, 1202, 2184, 2203, 2222,
- 2241, 2260, 2279, 2298, 2317, 2336, 2355, 2374,
- 2393, 2412, 2431, 2450, 2469, 2488, 2507, 2526,
- 2545, 2564, 2583, 2602, 2621, 2621, 2641, 2660,
- 2679, 2698, 2717, 2736, 2755, 2774, 2793, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 2621, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
- 1303, 1303, 1303, 1303, 1303, 1303, 2909, 2909,
- 2913
-};
+ static const int demo_machine_parser_cmd_start = 232;
+ static const int demo_machine_parser_cmd_first_final = 232;
+ static const int demo_machine_parser_cmd_error = 0;
-static const int demo_machine_parser_cmd_start = 232;
-static const int demo_machine_parser_cmd_first_final = 232;
-static const int demo_machine_parser_cmd_error = 0;
+ static const int demo_machine_parser_cmd_en_main = 232;
-static const int demo_machine_parser_cmd_en_main = 232;
+ /* #line 332 "./dssl.rl" */
-/* #line 332 "./dssl.rl" */
-
-/* #line 4439 "./dssl.c" */
- {
- cs = demo_machine_parser_cmd_start;
- ts = 0;
- te = 0;
- act = 0;
- }
+ /* #line 4439 "./dssl.c" */
+ {
+ cs = demo_machine_parser_cmd_start;
+ ts = 0;
+ te = 0;
+ act = 0;
+ }
-/* #line 333 "./dssl.rl" */
-
- /* default values */
- *comment = tsk_false;
+ /* #line 333 "./dssl.rl" */
- /* only parse one line */
- if((index = tsk_strindexOf(p, size, "\n")) != -1){
- pe = eof = (p + index + 1/*\n*/);
- }
- else{
- pe = eof = p + size;
- }
-
- /* exec */
-
-/* #line 4462 "./dssl.c" */
- {
- int _klen;
- unsigned int _trans;
- short _widec;
- const char *_acts;
- unsigned int _nacts;
- const short *_keys;
+ /* default values */
+ *comment = tsk_false;
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* only parse one line */
+ if((index = tsk_strindexOf(p, size, "\n")) != -1) {
+ pe = eof = (p + index + 1/*\n*/);
+ }
+ else {
+ pe = eof = p + size;
+ }
+
+ /* exec */
+
+ /* #line 4462 "./dssl.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ short _widec;
+ const char *_acts;
+ unsigned int _nacts;
+ const short *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_from_state_actions[cs];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 ) {
- switch ( *_acts++ ) {
- case 75:
-/* #line 1 "./dssl.rl" */
- {ts = p;}
- break;
-/* #line 4484 "./dssl.c" */
- }
- }
+ _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_from_state_actions[cs];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 75:
+ /* #line 1 "./dssl.rl" */
+ {
+ ts = p;
+ }
+ break;
+ /* #line 4484 "./dssl.c" */
+ }
+ }
- _widec = (*p);
- _klen = _demo_machine_parser_cmd_cond_lengths[cs];
- _keys = _demo_machine_parser_cmd_cond_keys + (_demo_machine_parser_cmd_cond_offsets[cs]*2);
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _widec = (*p);
+ _klen = _demo_machine_parser_cmd_cond_lengths[cs];
+ _keys = _demo_machine_parser_cmd_cond_keys + (_demo_machine_parser_cmd_cond_offsets[cs]*2);
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- switch ( _demo_machine_parser_cmd_cond_spaces[_demo_machine_parser_cmd_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
- case 0: {
- _widec = (short)(128 + ((*p) - -128));
- if (
-/* #line 187 "./dssl.rl" */
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ switch ( _demo_machine_parser_cmd_cond_spaces[_demo_machine_parser_cmd_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
+ case 0: {
+ _widec = (short)(128 + ((*p) - -128));
+ if (
+ /* #line 187 "./dssl.rl" */
- next_not_hyphens(p, pe)
- && next_not_arobases(p, pe)
- && next_not_percents(p, pe)
- && next_not_redirs(p, pe)
- && (p && *p != '\n')
- && (p && *p != '#')
- ) _widec += 256;
- break;
- }
- case 1: {
- _widec = (short)(640 + ((*p) - -128));
- if (
-/* #line 196 "./dssl.rl" */
+ next_not_hyphens(p, pe)
+ && next_not_arobases(p, pe)
+ && next_not_percents(p, pe)
+ && next_not_redirs(p, pe)
+ && (p && *p != '\n')
+ && (p && *p != '#')
+ ) {
+ _widec += 256;
+ }
+ break;
+ }
+ case 1: {
+ _widec = (short)(640 + ((*p) - -128));
+ if (
+ /* #line 196 "./dssl.rl" */
- (p && *p != '\n')
- ) _widec += 256;
- break;
- }
- }
- break;
- }
- }
- }
+ (p && *p != '\n')
+ ) {
+ _widec += 256;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
- _keys = _demo_machine_parser_cmd_trans_keys + _demo_machine_parser_cmd_key_offsets[cs];
- _trans = _demo_machine_parser_cmd_index_offsets[cs];
+ _keys = _demo_machine_parser_cmd_trans_keys + _demo_machine_parser_cmd_key_offsets[cs];
+ _trans = _demo_machine_parser_cmd_index_offsets[cs];
- _klen = _demo_machine_parser_cmd_single_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _demo_machine_parser_cmd_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( _widec < *_mid )
- _upper = _mid - 1;
- else if ( _widec > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( _widec < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( _widec > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _demo_machine_parser_cmd_range_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _demo_machine_parser_cmd_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _demo_machine_parser_cmd_indicies[_trans];
+ _trans = _demo_machine_parser_cmd_indicies[_trans];
_eof_trans:
- cs = _demo_machine_parser_cmd_trans_targs[_trans];
+ cs = _demo_machine_parser_cmd_trans_targs[_trans];
- if ( _demo_machine_parser_cmd_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _demo_machine_parser_cmd_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 86 "./dssl.rl" */
- {
- tag_start = p;
+ _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 86 "./dssl.rl" */
+ {
+ tag_start = p;
#if DEBUG_PARSER
- // - TSK_DEBUG_INFO("tag=%s", tag_start);
+ // - TSK_DEBUG_INFO("tag=%s", tag_start);
#endif
- }
- break;
- case 1:
-/* #line 93 "./dssl.rl" */
- {
+ }
+ break;
+ case 1:
+ /* #line 93 "./dssl.rl" */
+ {
#if DEBUG_PARSER
- TSK_DEBUG_INFO("create_option");
+ TSK_DEBUG_INFO("create_option");
#endif
- TSK_OBJECT_SAFE_FREE(opt);
- opt = opt_create_null();
- }
- break;
- case 2:
-/* #line 101 "./dssl.rl" */
- {
+ TSK_OBJECT_SAFE_FREE(opt);
+ opt = opt_create_null();
+ }
+ break;
+ case 2:
+ /* #line 101 "./dssl.rl" */
+ {
#if DEBUG_PARSER
- TSK_DEBUG_INFO("add_option");
+ TSK_DEBUG_INFO("add_option");
#endif
- tsk_list_push_back_data(cmd->opts, (void**)&opt);
- }
- break;
- case 3:
-/* #line 108 "./dssl.rl" */
- {
- if(opt){
- int index_1, index_2;
- char* newval = tsk_null;
- TSK_PARSER_SET_STRING(opt->value);
- /* trim both: left and right */
- tsk_strtrim_both(&opt->value);
- /* replace params */
+ tsk_list_push_back_data(cmd->opts, (void**)&opt);
+ }
+ break;
+ case 3:
+ /* #line 108 "./dssl.rl" */
+ {
+ if(opt) {
+ int index_1, index_2;
+ char* newval = tsk_null;
+ TSK_PARSER_SET_STRING(opt->value);
+ /* trim both: left and right */
+ tsk_strtrim_both(&opt->value);
+ /* replace params */
replace:
- if((index_1 = tsk_strindexOf(opt->value, tsk_strlen(opt->value), "$$")) != -1){
- if((index_2 = tsk_strindexOf((opt->value + index_1), tsk_strlen((opt->value + index_1)), " ")) != -1){
- newval = replace_param(opt->value, index_1, (index_1 + index_2), params);
- }
- else{
- newval = replace_param(opt->value, index_1, tsk_strlen(opt->value), params);
- }
- if(newval){
- TSK_FREE(opt->value);
- opt->value = newval;
+ if((index_1 = tsk_strindexOf(opt->value, tsk_strlen(opt->value), "$$")) != -1) {
+ if((index_2 = tsk_strindexOf((opt->value + index_1), tsk_strlen((opt->value + index_1)), " ")) != -1) {
+ newval = replace_param(opt->value, index_1, (index_1 + index_2), params);
+ }
+ else {
+ newval = replace_param(opt->value, index_1, tsk_strlen(opt->value), params);
+ }
+ if(newval) {
+ TSK_FREE(opt->value);
+ opt->value = newval;
- /* again */
- goto replace;
- }
- }
+ /* again */
+ goto replace;
+ }
+ }
#if DEBUG_PARSER
- TSK_DEBUG_INFO("set_opt_value [%d] '%s'", opt->type, opt->value);
+ TSK_DEBUG_INFO("set_opt_value [%d] '%s'", opt->type, opt->value);
#endif
- }
- }
- break;
- case 4:
-/* #line 138 "./dssl.rl" */
- {
- TSK_PARSER_SET_STRING(cmd->sidparam);
+ }
+ }
+ break;
+ case 4:
+ /* #line 138 "./dssl.rl" */
+ {
+ TSK_PARSER_SET_STRING(cmd->sidparam);
#if DEBUG_PARSER
- TSK_DEBUG_INFO("set_sidparam_value '%s'", cmd->sidparam);
+ TSK_DEBUG_INFO("set_sidparam_value '%s'", cmd->sidparam);
#endif
- }
- break;
- case 5:
-/* #line 145 "./dssl.rl" */
- {
+ }
+ break;
+ case 5:
+ /* #line 145 "./dssl.rl" */
+ {
#if DEBUG_PARSER
- TSK_DEBUG_INFO("create_param");
+ TSK_DEBUG_INFO("create_param");
#endif
- TSK_OBJECT_SAFE_FREE(param);
- param = tsk_param_create_null();
- }
- break;
- case 6:
-/* #line 153 "./dssl.rl" */
- {
+ TSK_OBJECT_SAFE_FREE(param);
+ param = tsk_param_create_null();
+ }
+ break;
+ case 6:
+ /* #line 153 "./dssl.rl" */
+ {
#if DEBUG_PARSER
- TSK_DEBUG_INFO("add_param");
+ TSK_DEBUG_INFO("add_param");
#endif
- tsk_params_add_param_2(&params, param);
- TSK_OBJECT_SAFE_FREE(param);
- }
- break;
- case 7:
-/* #line 161 "./dssl.rl" */
- {
- if(param){
- TSK_PARSER_SET_STRING(param->value);
- /* trim both: left and right */
- tsk_strtrim_both(&param->value);
+ tsk_params_add_param_2(&params, param);
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ break;
+ case 7:
+ /* #line 161 "./dssl.rl" */
+ {
+ if(param) {
+ TSK_PARSER_SET_STRING(param->value);
+ /* trim both: left and right */
+ tsk_strtrim_both(&param->value);
#if DEBUG_PARSER
- TSK_DEBUG_INFO("set_param_value [%s] '%s'", param->name, param->value);
+ TSK_DEBUG_INFO("set_param_value [%s] '%s'", param->name, param->value);
#endif
- }
- }
- break;
- case 8:
-/* #line 172 "./dssl.rl" */
- {
- if(param){
- TSK_PARSER_SET_STRING(param->name);
- }
- }
- break;
- case 9:
-/* #line 178 "./dssl.rl" */
- {
+ }
+ }
+ break;
+ case 8:
+ /* #line 172 "./dssl.rl" */
+ {
+ if(param) {
+ TSK_PARSER_SET_STRING(param->name);
+ }
+ }
+ break;
+ case 9:
+ /* #line 178 "./dssl.rl" */
+ {
#if DEBUG_PARSER
- TSK_PARSER_SET_STRING(temp);
- TSK_DEBUG_INFO("is_comment '%s'", temp);
+ TSK_PARSER_SET_STRING(temp);
+ TSK_DEBUG_INFO("is_comment '%s'", temp);
#endif
- // *comment = tsk_true;
- // TSK_OBJECT_SAFE_FREE(opts);
- }
- break;
- case 10:
-/* #line 200 "./dssl.rl" */
- {
- TSK_PARSER_SET_STRING(temp);
- TSK_DEBUG_ERROR("'%s' is not a valid option.", temp);
- }
- break;
- case 11:
-/* #line 205 "./dssl.rl" */
- {
- TSK_PARSER_SET_STRING(temp);
- TSK_DEBUG_ERROR("'%s' is not a valid command.", temp);
- }
- break;
- case 12:
-/* #line 210 "./dssl.rl" */
- {
- TSK_PARSER_SET_STRING(temp);
- TSK_DEBUG_ERROR("'%s' is not a valid level.", temp);
- }
- break;
- case 13:
-/* #line 227 "./dssl.rl" */
- { cmd->type = cmd_audio; }
- break;
- case 14:
-/* #line 228 "./dssl.rl" */
- { cmd->type = cmd_audiovideo; }
- break;
- case 15:
-/* #line 229 "./dssl.rl" */
- { cmd->type = cmd_config_session; }
- break;
- case 16:
-/* #line 230 "./dssl.rl" */
- { cmd->type = cmd_config_stack; }
- break;
- case 17:
-/* #line 231 "./dssl.rl" */
- { cmd->type = cmd_dtmf; }
- break;
- case 18:
-/* #line 232 "./dssl.rl" */
- { cmd->type = cmd_dump; }
- break;
- case 19:
-/* #line 233 "./dssl.rl" */
- { cmd->type = cmd_ect; }
- break;
- case 20:
-/* #line 234 "./dssl.rl" */
- { cmd->type = cmd_exit; }
- break;
- case 21:
-/* #line 235 "./dssl.rl" */
- { cmd->type = cmd_file; }
- break;
- case 22:
-/* #line 236 "./dssl.rl" */
- { cmd->type = cmd_hangup; }
- break;
- case 23:
-/* #line 237 "./dssl.rl" */
- { cmd->type = cmd_help; }
- break;
- case 24:
-/* #line 238 "./dssl.rl" */
- { cmd->type = cmd_hold; }
- break;
- case 25:
-/* #line 239 "./dssl.rl" */
- { cmd->type = cmd_large_message; }
- break;
- case 26:
-/* #line 240 "./dssl.rl" */
- { cmd->type = cmd_message; }
- break;
- case 27:
-/* #line 241 "./dssl.rl" */
- { cmd->type = cmd_options; }
- break;
- case 28:
-/* #line 242 "./dssl.rl" */
- { cmd->type = cmd_publish; }
- break;
- case 29:
-/* #line 243 "./dssl.rl" */
- { cmd->type = cmd_register; }
- break;
- case 30:
-/* #line 244 "./dssl.rl" */
- { cmd->type = cmd_resume; }
- break;
- case 31:
-/* #line 245 "./dssl.rl" */
- { cmd->type = cmd_run; }
- break;
- case 32:
-/* #line 246 "./dssl.rl" */
- { cmd->type = cmd_scenario; }
- break;
- case 33:
-/* #line 247 "./dssl.rl" */
- { cmd->type = cmd_sleep; }
- break;
- case 34:
-/* #line 248 "./dssl.rl" */
- { cmd->type = cmd_sms; }
- break;
- case 35:
-/* #line 249 "./dssl.rl" */
- { cmd->type = cmd_stop; }
- break;
- case 36:
-/* #line 250 "./dssl.rl" */
- { cmd->type = cmd_subscribe; }
- break;
- case 37:
-/* #line 251 "./dssl.rl" */
- { cmd->type = cmd_video; }
- break;
- case 38:
-/* #line 255 "./dssl.rl" */
- { opt->type = opt_amf; }
- break;
- case 39:
-/* #line 256 "./dssl.rl" */
- { opt->type = opt_caps; }
- break;
- case 40:
-/* #line 257 "./dssl.rl" */
- { opt->type = opt_dhcpv4; }
- break;
- case 41:
-/* #line 258 "./dssl.rl" */
- { opt->type = opt_dhcpv6; }
- break;
- case 42:
-/* #line 259 "./dssl.rl" */
- { opt->type = opt_amf; }
- break;
- case 43:
-/* #line 260 "./dssl.rl" */
- { opt->type = opt_dname; }
- break;
- case 44:
-/* #line 261 "./dssl.rl" */
- { opt->type = opt_event; }
- break;
- case 45:
-/* #line 262 "./dssl.rl" */
- { opt->type = opt_expires; }
- break;
- case 46:
-/* #line 263 "./dssl.rl" */
- { opt->type = opt_from; }
- break;
- case 47:
-/* #line 264 "./dssl.rl" */
- { opt->type = opt_header; }
- break;
- case 48:
-/* #line 265 "./dssl.rl" */
- { opt->type = opt_impi; }
- break;
- case 49:
-/* #line 266 "./dssl.rl" */
- { opt->type = opt_impu; }
- break;
- case 50:
-/* #line 267 "./dssl.rl" */
- { opt->type = opt_ipv6; }
- break;
- case 51:
-/* #line 268 "./dssl.rl" */
- { opt->type = opt_local_ip; }
- break;
- case 52:
-/* #line 269 "./dssl.rl" */
- { opt->type = opt_local_port; }
- break;
- case 53:
-/* #line 270 "./dssl.rl" */
- { opt->type = opt_opid; }
- break;
- case 54:
-/* #line 271 "./dssl.rl" */
- { opt->type = opt_password; }
- break;
- case 55:
-/* #line 272 "./dssl.rl" */
- { opt->type = opt_path; }
- break;
- case 56:
-/* #line 273 "./dssl.rl" */
- { opt->type = opt_payload; }
- break;
- case 57:
-/* #line 274 "./dssl.rl" */
- { opt->type = opt_pcscf_ip; }
- break;
- case 58:
-/* #line 275 "./dssl.rl" */
- { opt->type = opt_pcscf_port; }
- break;
- case 59:
-/* #line 276 "./dssl.rl" */
- { opt->type = opt_pcscf_trans; }
- break;
- case 60:
-/* #line 277 "./dssl.rl" */
- { opt->type = opt_realm; }
- break;
- case 61:
-/* #line 278 "./dssl.rl" */
- { opt->type = opt_sec; }
- break;
- case 62:
-/* #line 279 "./dssl.rl" */
- { opt->type = opt_sid; }
- break;
- case 63:
-/* #line 280 "./dssl.rl" */
- { opt->type = opt_sigcomp_id; }
- break;
- case 64:
-/* #line 281 "./dssl.rl" */
- { opt->type = opt_silent; }
- break;
- case 65:
-/* #line 282 "./dssl.rl" */
- { opt->type = opt_smsc; }
- break;
- case 66:
-/* #line 283 "./dssl.rl" */
- { opt->type = opt_stun_ip; }
- break;
- case 67:
-/* #line 284 "./dssl.rl" */
- { opt->type = opt_stun_pwd; }
- break;
- case 68:
-/* #line 285 "./dssl.rl" */
- { opt->type = opt_stun_port; }
- break;
- case 69:
-/* #line 286 "./dssl.rl" */
- { opt->type = opt_stun_usr; }
- break;
- case 70:
-/* #line 287 "./dssl.rl" */
- { opt->type = opt_to; }
- break;
- case 71:
-/* #line 294 "./dssl.rl" */
- { set_level(lv_stack); }
- break;
- case 72:
-/* #line 294 "./dssl.rl" */
- { set_level(lv_session); }
- break;
- case 73:
-/* #line 294 "./dssl.rl" */
- { set_level(lv_action); }
- break;
- case 76:
-/* #line 1 "./dssl.rl" */
- {te = p+1;}
- break;
- case 77:
-/* #line 307 "./dssl.rl" */
- {te = p+1;{ }}
- break;
- case 78:
-/* #line 309 "./dssl.rl" */
- {te = p+1;{ }}
- break;
- case 79:
-/* #line 304 "./dssl.rl" */
- {te = p;p--;{ }}
- break;
- case 80:
-/* #line 305 "./dssl.rl" */
- {te = p;p--;{ }}
- break;
- case 81:
-/* #line 306 "./dssl.rl" */
- {te = p;p--;{ }}
- break;
- case 82:
-/* #line 307 "./dssl.rl" */
- {te = p;p--;{ }}
- break;
- case 83:
-/* #line 308 "./dssl.rl" */
- {te = p;p--;{ }}
- break;
- case 84:
-/* #line 304 "./dssl.rl" */
- {{p = ((te))-1;}{ }}
- break;
- case 85:
-/* #line 305 "./dssl.rl" */
- {{p = ((te))-1;}{ }}
- break;
-/* #line 5023 "./dssl.c" */
- }
- }
+ // *comment = tsk_true;
+ // TSK_OBJECT_SAFE_FREE(opts);
+ }
+ break;
+ case 10:
+ /* #line 200 "./dssl.rl" */
+ {
+ TSK_PARSER_SET_STRING(temp);
+ TSK_DEBUG_ERROR("'%s' is not a valid option.", temp);
+ }
+ break;
+ case 11:
+ /* #line 205 "./dssl.rl" */
+ {
+ TSK_PARSER_SET_STRING(temp);
+ TSK_DEBUG_ERROR("'%s' is not a valid command.", temp);
+ }
+ break;
+ case 12:
+ /* #line 210 "./dssl.rl" */
+ {
+ TSK_PARSER_SET_STRING(temp);
+ TSK_DEBUG_ERROR("'%s' is not a valid level.", temp);
+ }
+ break;
+ case 13:
+ /* #line 227 "./dssl.rl" */
+ {
+ cmd->type = cmd_audio;
+ }
+ break;
+ case 14:
+ /* #line 228 "./dssl.rl" */
+ {
+ cmd->type = cmd_audiovideo;
+ }
+ break;
+ case 15:
+ /* #line 229 "./dssl.rl" */
+ {
+ cmd->type = cmd_config_session;
+ }
+ break;
+ case 16:
+ /* #line 230 "./dssl.rl" */
+ {
+ cmd->type = cmd_config_stack;
+ }
+ break;
+ case 17:
+ /* #line 231 "./dssl.rl" */
+ {
+ cmd->type = cmd_dtmf;
+ }
+ break;
+ case 18:
+ /* #line 232 "./dssl.rl" */
+ {
+ cmd->type = cmd_dump;
+ }
+ break;
+ case 19:
+ /* #line 233 "./dssl.rl" */
+ {
+ cmd->type = cmd_ect;
+ }
+ break;
+ case 20:
+ /* #line 234 "./dssl.rl" */
+ {
+ cmd->type = cmd_exit;
+ }
+ break;
+ case 21:
+ /* #line 235 "./dssl.rl" */
+ {
+ cmd->type = cmd_file;
+ }
+ break;
+ case 22:
+ /* #line 236 "./dssl.rl" */
+ {
+ cmd->type = cmd_hangup;
+ }
+ break;
+ case 23:
+ /* #line 237 "./dssl.rl" */
+ {
+ cmd->type = cmd_help;
+ }
+ break;
+ case 24:
+ /* #line 238 "./dssl.rl" */
+ {
+ cmd->type = cmd_hold;
+ }
+ break;
+ case 25:
+ /* #line 239 "./dssl.rl" */
+ {
+ cmd->type = cmd_large_message;
+ }
+ break;
+ case 26:
+ /* #line 240 "./dssl.rl" */
+ {
+ cmd->type = cmd_message;
+ }
+ break;
+ case 27:
+ /* #line 241 "./dssl.rl" */
+ {
+ cmd->type = cmd_options;
+ }
+ break;
+ case 28:
+ /* #line 242 "./dssl.rl" */
+ {
+ cmd->type = cmd_publish;
+ }
+ break;
+ case 29:
+ /* #line 243 "./dssl.rl" */
+ {
+ cmd->type = cmd_register;
+ }
+ break;
+ case 30:
+ /* #line 244 "./dssl.rl" */
+ {
+ cmd->type = cmd_resume;
+ }
+ break;
+ case 31:
+ /* #line 245 "./dssl.rl" */
+ {
+ cmd->type = cmd_run;
+ }
+ break;
+ case 32:
+ /* #line 246 "./dssl.rl" */
+ {
+ cmd->type = cmd_scenario;
+ }
+ break;
+ case 33:
+ /* #line 247 "./dssl.rl" */
+ {
+ cmd->type = cmd_sleep;
+ }
+ break;
+ case 34:
+ /* #line 248 "./dssl.rl" */
+ {
+ cmd->type = cmd_sms;
+ }
+ break;
+ case 35:
+ /* #line 249 "./dssl.rl" */
+ {
+ cmd->type = cmd_stop;
+ }
+ break;
+ case 36:
+ /* #line 250 "./dssl.rl" */
+ {
+ cmd->type = cmd_subscribe;
+ }
+ break;
+ case 37:
+ /* #line 251 "./dssl.rl" */
+ {
+ cmd->type = cmd_video;
+ }
+ break;
+ case 38:
+ /* #line 255 "./dssl.rl" */
+ {
+ opt->type = opt_amf;
+ }
+ break;
+ case 39:
+ /* #line 256 "./dssl.rl" */
+ {
+ opt->type = opt_caps;
+ }
+ break;
+ case 40:
+ /* #line 257 "./dssl.rl" */
+ {
+ opt->type = opt_dhcpv4;
+ }
+ break;
+ case 41:
+ /* #line 258 "./dssl.rl" */
+ {
+ opt->type = opt_dhcpv6;
+ }
+ break;
+ case 42:
+ /* #line 259 "./dssl.rl" */
+ {
+ opt->type = opt_amf;
+ }
+ break;
+ case 43:
+ /* #line 260 "./dssl.rl" */
+ {
+ opt->type = opt_dname;
+ }
+ break;
+ case 44:
+ /* #line 261 "./dssl.rl" */
+ {
+ opt->type = opt_event;
+ }
+ break;
+ case 45:
+ /* #line 262 "./dssl.rl" */
+ {
+ opt->type = opt_expires;
+ }
+ break;
+ case 46:
+ /* #line 263 "./dssl.rl" */
+ {
+ opt->type = opt_from;
+ }
+ break;
+ case 47:
+ /* #line 264 "./dssl.rl" */
+ {
+ opt->type = opt_header;
+ }
+ break;
+ case 48:
+ /* #line 265 "./dssl.rl" */
+ {
+ opt->type = opt_impi;
+ }
+ break;
+ case 49:
+ /* #line 266 "./dssl.rl" */
+ {
+ opt->type = opt_impu;
+ }
+ break;
+ case 50:
+ /* #line 267 "./dssl.rl" */
+ {
+ opt->type = opt_ipv6;
+ }
+ break;
+ case 51:
+ /* #line 268 "./dssl.rl" */
+ {
+ opt->type = opt_local_ip;
+ }
+ break;
+ case 52:
+ /* #line 269 "./dssl.rl" */
+ {
+ opt->type = opt_local_port;
+ }
+ break;
+ case 53:
+ /* #line 270 "./dssl.rl" */
+ {
+ opt->type = opt_opid;
+ }
+ break;
+ case 54:
+ /* #line 271 "./dssl.rl" */
+ {
+ opt->type = opt_password;
+ }
+ break;
+ case 55:
+ /* #line 272 "./dssl.rl" */
+ {
+ opt->type = opt_path;
+ }
+ break;
+ case 56:
+ /* #line 273 "./dssl.rl" */
+ {
+ opt->type = opt_payload;
+ }
+ break;
+ case 57:
+ /* #line 274 "./dssl.rl" */
+ {
+ opt->type = opt_pcscf_ip;
+ }
+ break;
+ case 58:
+ /* #line 275 "./dssl.rl" */
+ {
+ opt->type = opt_pcscf_port;
+ }
+ break;
+ case 59:
+ /* #line 276 "./dssl.rl" */
+ {
+ opt->type = opt_pcscf_trans;
+ }
+ break;
+ case 60:
+ /* #line 277 "./dssl.rl" */
+ {
+ opt->type = opt_realm;
+ }
+ break;
+ case 61:
+ /* #line 278 "./dssl.rl" */
+ {
+ opt->type = opt_sec;
+ }
+ break;
+ case 62:
+ /* #line 279 "./dssl.rl" */
+ {
+ opt->type = opt_sid;
+ }
+ break;
+ case 63:
+ /* #line 280 "./dssl.rl" */
+ {
+ opt->type = opt_sigcomp_id;
+ }
+ break;
+ case 64:
+ /* #line 281 "./dssl.rl" */
+ {
+ opt->type = opt_silent;
+ }
+ break;
+ case 65:
+ /* #line 282 "./dssl.rl" */
+ {
+ opt->type = opt_smsc;
+ }
+ break;
+ case 66:
+ /* #line 283 "./dssl.rl" */
+ {
+ opt->type = opt_stun_ip;
+ }
+ break;
+ case 67:
+ /* #line 284 "./dssl.rl" */
+ {
+ opt->type = opt_stun_pwd;
+ }
+ break;
+ case 68:
+ /* #line 285 "./dssl.rl" */
+ {
+ opt->type = opt_stun_port;
+ }
+ break;
+ case 69:
+ /* #line 286 "./dssl.rl" */
+ {
+ opt->type = opt_stun_usr;
+ }
+ break;
+ case 70:
+ /* #line 287 "./dssl.rl" */
+ {
+ opt->type = opt_to;
+ }
+ break;
+ case 71:
+ /* #line 294 "./dssl.rl" */
+ {
+ set_level(lv_stack);
+ }
+ break;
+ case 72:
+ /* #line 294 "./dssl.rl" */
+ {
+ set_level(lv_session);
+ }
+ break;
+ case 73:
+ /* #line 294 "./dssl.rl" */
+ {
+ set_level(lv_action);
+ }
+ break;
+ case 76:
+ /* #line 1 "./dssl.rl" */
+ {
+ te = p+1;
+ }
+ break;
+ case 77:
+ /* #line 307 "./dssl.rl" */
+ {
+ te = p+1;
+ { }
+ }
+ break;
+ case 78:
+ /* #line 309 "./dssl.rl" */
+ {
+ te = p+1;
+ { }
+ }
+ break;
+ case 79:
+ /* #line 304 "./dssl.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 80:
+ /* #line 305 "./dssl.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 81:
+ /* #line 306 "./dssl.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 82:
+ /* #line 307 "./dssl.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 83:
+ /* #line 308 "./dssl.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 84:
+ /* #line 304 "./dssl.rl" */
+ {{
+ p = ((te))-1;
+ }{ }
+ }
+ break;
+ case 85:
+ /* #line 305 "./dssl.rl" */
+ {{
+ p = ((te))-1;
+ }{ }
+ }
+ break;
+ /* #line 5023 "./dssl.c" */
+ }
+ }
_again:
- _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_to_state_actions[cs];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 ) {
- switch ( *_acts++ ) {
- case 74:
-/* #line 1 "./dssl.rl" */
- {ts = 0;}
- break;
-/* #line 5036 "./dssl.c" */
- }
- }
+ _acts = _demo_machine_parser_cmd_actions + _demo_machine_parser_cmd_to_state_actions[cs];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 74:
+ /* #line 1 "./dssl.rl" */
+ {
+ ts = 0;
+ }
+ break;
+ /* #line 5036 "./dssl.c" */
+ }
+ }
+
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ if ( _demo_machine_parser_cmd_eof_trans[cs] > 0 ) {
+ _trans = _demo_machine_parser_cmd_eof_trans[cs] - 1;
+ goto _eof_trans;
+ }
+ }
+
+_out: {
+ }
+ }
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- if ( _demo_machine_parser_cmd_eof_trans[cs] > 0 ) {
- _trans = _demo_machine_parser_cmd_eof_trans[cs] - 1;
- goto _eof_trans;
- }
- }
+ /* #line 347 "./dssl.rl" */
- _out: {}
- }
+ if( cs <
+ /* #line 5059 "./dssl.c" */
+ 232
+ /* #line 348 "./dssl.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse [%s] command-Line.", p);
+ TSK_OBJECT_SAFE_FREE(cmd);
+ }
+ TSK_OBJECT_SAFE_FREE(opt);
+ TSK_OBJECT_SAFE_FREE(param);
+ TSK_FREE(temp);
-/* #line 347 "./dssl.rl" */
-
- if( cs <
-/* #line 5059 "./dssl.c" */
-232
-/* #line 348 "./dssl.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse [%s] command-Line.", p);
- TSK_OBJECT_SAFE_FREE(cmd);
- }
- TSK_OBJECT_SAFE_FREE(opt);
- TSK_OBJECT_SAFE_FREE(param);
- TSK_FREE(temp);
-
- return cmd;
+ return cmd;
}
diff --git a/tinyDEMO/dssl.h b/tinyDEMO/dssl.h
index 172664c..409e1af 100755
--- a/tinyDEMO/dssl.h
+++ b/tinyDEMO/dssl.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/invite.c b/tinyDEMO/invite.c
index 58b3925..681ec08 100755
--- a/tinyDEMO/invite.c
+++ b/tinyDEMO/invite.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,253 +31,252 @@ static int invite_msrp_cb(const tmsrp_event_t* _event);
int invite_handle_event(const tsip_event_t *_event)
{
- const tsip_invite_event_t* inv_event = TSIP_INVITE_EVENT(_event);
- const session_t* session;
- tsip_ssession_id_t sid;
- int ret = 0;
-
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- if(inv_event->type == tsip_i_newcall){
- /* It's a new incoming call */
- if(!tsip_ssession_have_ownership(_event->ss)){
- session_t* _session;
- if((_session = session_server_create(st_invite, _event->ss)) && (session = _session)){
- tsk_list_push_back_data(ctx->sessions, (void**)&_session);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create \"sever-side-session\".");
- ret = -3;
- goto bail;
- }
- }
- }
- else{
- /* it's or own session and we fail to match it ==> should never happen */
- TSK_DEBUG_ERROR("Failed to match session event.");
- ret = -2;
- goto bail;
- }
- }
-
- if(!session || !session->handle){
- /* guard ==> should never happen */
- TSK_DEBUG_ERROR("Null session.");
- goto bail;
- }
-
- switch(inv_event->type){
- // ============================
- // Sip Events
- //
- case tsip_i_newcall:
- { /* New call */
- tmedia_type_t media_type = tsip_ssession_get_mediatype(session);
- tsip_api_common_accept(session->handle,
- TSIP_ACTION_SET_NULL());
- /*tsip_api_common_reject(session->handle,
- TSIP_ACTION_SET_NULL());*/
- break;
- }
- case tsip_i_request:
- TSK_DEBUG_INFO("invite_handle_event(tsip_i_request)");
- break;
- case tsip_ao_request:
- TSK_DEBUG_INFO("invite_handle_event(tsip_ao_request)");
- break;
-
- /* Explicit Call Transfer (ECT) */
- case tsip_o_ect_trying:
- case tsip_o_ect_accepted:
- case tsip_o_ect_completed:
- case tsip_o_ect_failed:
- case tsip_o_ect_notify:
- case tsip_i_ect_requested:
- case tsip_i_ect_newcall:
- case tsip_i_ect_completed:
- case tsip_i_ect_failed:
- case tsip_i_ect_notify:
- TSK_DEBUG_INFO("ECT event");
- break;
-
- // ============================
- // Media Events
- //
-
- /* Early Media started */
- case tsip_m_early_media:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_early_media)");
- break;
-
- /* 3GPP TS 24.610: Communication Hold */
- case tsip_m_local_hold_ok:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_hold_ok)");
- break;
- case tsip_m_local_hold_nok:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_hold_nok)");
- break;
- case tsip_m_local_resume_ok:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_resume_ok)");
- break;
- case tsip_m_local_resume_nok:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_resume_nok)");
- break;
- case tsip_m_remote_hold:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_remote_hold)");
- break;
- case tsip_m_remote_resume:
- TSK_DEBUG_INFO("invite_handle_event(tsip_m_remote_resume)");
- break;
-
- default:
- break;
- }
+ const tsip_invite_event_t* inv_event = TSIP_INVITE_EVENT(_event);
+ const session_t* session;
+ tsip_ssession_id_t sid;
+ int ret = 0;
+
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ if(inv_event->type == tsip_i_newcall) {
+ /* It's a new incoming call */
+ if(!tsip_ssession_have_ownership(_event->ss)) {
+ session_t* _session;
+ if((_session = session_server_create(st_invite, _event->ss)) && (session = _session)) {
+ tsk_list_push_back_data(ctx->sessions, (void**)&_session);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create \"sever-side-session\".");
+ ret = -3;
+ goto bail;
+ }
+ }
+ }
+ else {
+ /* it's or own session and we fail to match it ==> should never happen */
+ TSK_DEBUG_ERROR("Failed to match session event.");
+ ret = -2;
+ goto bail;
+ }
+ }
+
+ if(!session || !session->handle) {
+ /* guard ==> should never happen */
+ TSK_DEBUG_ERROR("Null session.");
+ goto bail;
+ }
+
+ switch(inv_event->type) {
+ // ============================
+ // Sip Events
+ //
+ case tsip_i_newcall: {
+ /* New call */
+ tmedia_type_t media_type = tsip_ssession_get_mediatype(session);
+ tsip_api_common_accept(session->handle,
+ TSIP_ACTION_SET_NULL());
+ /*tsip_api_common_reject(session->handle,
+ TSIP_ACTION_SET_NULL());*/
+ break;
+ }
+ case tsip_i_request:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_i_request)");
+ break;
+ case tsip_ao_request:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_ao_request)");
+ break;
+
+ /* Explicit Call Transfer (ECT) */
+ case tsip_o_ect_trying:
+ case tsip_o_ect_accepted:
+ case tsip_o_ect_completed:
+ case tsip_o_ect_failed:
+ case tsip_o_ect_notify:
+ case tsip_i_ect_requested:
+ case tsip_i_ect_newcall:
+ case tsip_i_ect_completed:
+ case tsip_i_ect_failed:
+ case tsip_i_ect_notify:
+ TSK_DEBUG_INFO("ECT event");
+ break;
+
+ // ============================
+ // Media Events
+ //
+
+ /* Early Media started */
+ case tsip_m_early_media:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_early_media)");
+ break;
+
+ /* 3GPP TS 24.610: Communication Hold */
+ case tsip_m_local_hold_ok:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_hold_ok)");
+ break;
+ case tsip_m_local_hold_nok:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_hold_nok)");
+ break;
+ case tsip_m_local_resume_ok:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_resume_ok)");
+ break;
+ case tsip_m_local_resume_nok:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_local_resume_nok)");
+ break;
+ case tsip_m_remote_hold:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_remote_hold)");
+ break;
+ case tsip_m_remote_resume:
+ TSK_DEBUG_INFO("invite_handle_event(tsip_m_remote_resume)");
+ break;
+
+ default:
+ break;
+ }
bail:
- return ret;
+ return ret;
}
tsip_ssession_id_t invite_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
-
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
-
- switch(cmd){
- case cmd_audio:
- case cmd_audiovideo:
- { /* Make Audio/Video call */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_invite_send_invite(session->handle, (cmd == cmd_audio) ? tmedia_audio : (tmedia_audio|tmedia_video),
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
-
- case cmd_file:
- { /* Send file using MSRP protocol */
- tsip_action_handle_t* action_config = action_get_config(opts);
- const opt_t* opt = opt_get_by_type(opts, opt_path); // existance already checked
- /* Set Callback function */
- tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_MSRP_CB(invite_msrp_cb),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL());
-
- /* Send INVITE */
- tsip_api_invite_send_invite(session->handle, tmedia_msrp,
- TSIP_ACTION_SET_CONFIG(action_config),
-
- TSIP_ACTION_SET_MEDIA(
- TMEDIA_SESSION_MSRP_SET_STR("file-path", opt->value),
- TMEDIA_SESSION_MSRP_SET_STR("accept-types", "application/octet-stream"),
- //TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
- //TMEDIA_SESSION_MSRP_SET_STR("file-selector", "name:\"test.sn\" type:application/octet-stream size:3740 hash:sha-1:27:D0:AE:39:48:77:37:1D:FD:39:7E:2D:78:2F:BC:7B:94:48:29:81"),
- //TMEDIA_SESSION_MSRP_SET_STR("file-disposition", "attachment"),
- //TMEDIA_SESSION_MSRP_SET_STR("file-date", "creation:2010-02-13T17:50:31.763Z"),
- //TMEDIA_SESSION_MSRP_SET_STR("file-icon", "cid:test@doubango.org"),
-
- TMEDIA_SESSION_SET_NULL()
- ),
-
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
-
- case cmd_dtmf:
- {
- const opt_t* opt = opt_get_by_type(opts, opt_event); // existance already checked
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_invite_send_dtmf(session->handle, atoi(opt->value),
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
-
- case cmd_ect:
- { /* Explict Call Transfer */
- const opt_t* opt = opt_get_by_type(opts, opt_to); // existance already checked
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_invite_send_ect(session->handle, opt? opt->value : "sip:anonymous@example.com",
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
-
- case cmd_hold:
- { /* Put the session on hold state */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_invite_send_hold(session->handle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- case cmd_resume:
- { /* Put the session on hold state */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_invite_send_resume(session->handle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
+
+ switch(cmd) {
+ case cmd_audio:
+ case cmd_audiovideo: {
+ /* Make Audio/Video call */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_invite_send_invite(session->handle, (cmd == cmd_audio) ? tmedia_audio : (tmedia_audio|tmedia_video),
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+
+ case cmd_file: {
+ /* Send file using MSRP protocol */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ const opt_t* opt = opt_get_by_type(opts, opt_path); // existance already checked
+ /* Set Callback function */
+ tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_MSRP_CB(invite_msrp_cb),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL());
+
+ /* Send INVITE */
+ tsip_api_invite_send_invite(session->handle, tmedia_msrp,
+ TSIP_ACTION_SET_CONFIG(action_config),
+
+ TSIP_ACTION_SET_MEDIA(
+ TMEDIA_SESSION_MSRP_SET_STR("file-path", opt->value),
+ TMEDIA_SESSION_MSRP_SET_STR("accept-types", "application/octet-stream"),
+ //TMEDIA_SESSION_MSRP_SET_STR("accept-wrapped-types", "application/octet-stream"),
+ //TMEDIA_SESSION_MSRP_SET_STR("file-selector", "name:\"test.sn\" type:application/octet-stream size:3740 hash:sha-1:27:D0:AE:39:48:77:37:1D:FD:39:7E:2D:78:2F:BC:7B:94:48:29:81"),
+ //TMEDIA_SESSION_MSRP_SET_STR("file-disposition", "attachment"),
+ //TMEDIA_SESSION_MSRP_SET_STR("file-date", "creation:2010-02-13T17:50:31.763Z"),
+ //TMEDIA_SESSION_MSRP_SET_STR("file-icon", "cid:test@doubango.org"),
+
+ TMEDIA_SESSION_SET_NULL()
+ ),
+
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+
+ case cmd_dtmf: {
+ const opt_t* opt = opt_get_by_type(opts, opt_event); // existance already checked
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_invite_send_dtmf(session->handle, atoi(opt->value),
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+
+ case cmd_ect: {
+ /* Explict Call Transfer */
+ const opt_t* opt = opt_get_by_type(opts, opt_to); // existance already checked
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_invite_send_ect(session->handle, opt? opt->value : "sip:anonymous@example.com",
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+
+ case cmd_hold: {
+ /* Put the session on hold state */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_invite_send_hold(session->handle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ case cmd_resume: {
+ /* Put the session on hold state */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_invite_send_resume(session->handle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
bail:
- return id;
+ return id;
}
int invite_msrp_cb(const tmsrp_event_t* _event)
{
- const session_t* session = _event->callback_data;
-
- if(_event->message){
- if(_event->message->end_line.cflag == '$'){
- TSK_DEBUG_INFO("Last Chunck");
- }
- switch(_event->message->type){
- case tmsrp_request:
- { /* MSRP Request */
-
-
- break;
- }
- case tmsrp_response:
- { /* MSRP Response */
- if(_event->message->ByteRange){
- TSK_DEBUG_INFO("MSRP Response code=%hi %lld-%lld/%lld", TMSRP_RESPONSE_CODE(_event->message),
- _event->message->ByteRange->start, _event->message->ByteRange->end, _event->message->ByteRange->total);
- }
- break;
- }
- default:
- TSK_DEBUG_ERROR("Invalid MSRP message");
- break;
- }
- }
-
- return 0;
+ const session_t* session = _event->callback_data;
+
+ if(_event->message) {
+ if(_event->message->end_line.cflag == '$') {
+ TSK_DEBUG_INFO("Last Chunck");
+ }
+ switch(_event->message->type) {
+ case tmsrp_request: {
+ /* MSRP Request */
+
+
+ break;
+ }
+ case tmsrp_response: {
+ /* MSRP Response */
+ if(_event->message->ByteRange) {
+ TSK_DEBUG_INFO("MSRP Response code=%hi %lld-%lld/%lld", TMSRP_RESPONSE_CODE(_event->message),
+ _event->message->ByteRange->start, _event->message->ByteRange->end, _event->message->ByteRange->total);
+ }
+ break;
+ }
+ default:
+ TSK_DEBUG_ERROR("Invalid MSRP message");
+ break;
+ }
+ }
+
+ return 0;
} \ No newline at end of file
diff --git a/tinyDEMO/invite.h b/tinyDEMO/invite.h
index 96c6a1f..659edfb 100755
--- a/tinyDEMO/invite.h
+++ b/tinyDEMO/invite.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/main.c b/tinyDEMO/main.c
index 3eb39c8..2340b9b 100755
--- a/tinyDEMO/main.c
+++ b/tinyDEMO/main.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,479 +48,455 @@ int execute(const cmd_t* );
/* === entry point === */
int main(int argc, char** argv)
{
- char cmdbuf[4096];
- tsk_buffer_t* buffer = tsk_null;
- cmd_t* cmd = tsk_null;
- tsk_bool_t comment = tsk_false;
- int ret;
- int i, index;
- const char* start = tsk_null, *end = tsk_null;
-
- int a = 32 | 1 | 2;
-
- /* Copyright */
- printf("Doubango Project (tinyDEMO)\nCopyright (C) 2009 - 2013 Mamadou Diop \n\n");
-
- /* Initialize Network Layer ==> Mandatory */
- tnet_startup();
- /* Initialize Doubango Audio/Video Framework ==> will register all plugins(codecs and sessions)
- * Not mandatory if you have your own plugins*/
- tdav_init();
-
- /* Print Usage */
- //cmd_print_help();
-
- /* create user's ctx */
- if(!(ctx = ctx_create()) || !ctx->stack){
- TSK_DEBUG_ERROR("Failed to create user's ctx.");
- goto bail;
- }
-
- /* create new buffer */
- if(!(buffer = tsk_buffer_create_null())){
- TSK_DEBUG_ERROR("Failed to create new buffer.");
- goto bail;
- }
-
- /* initial args */
- for(i=1 /* index zero contains the exe path */, index=0; i<argc && argv[i]; i++){
- if(index){
- tsk_buffer_append(buffer, " ", 1);
- }
- tsk_buffer_append(buffer, argv[i], tsk_strlen(argv[i]));
- }
-
- /* If initial args ==> parse it now */
- if(buffer->size){
- TSK_DEBUG_INFO("Initial command-line: %s", buffer->data);
- goto init_buffer;
- }
-
- /* always use fgets() instead of gets. gets() is considered to be unsafe.(Android and Mac OS X will warn) */
- while(fgets(cmdbuf, sizeof(cmdbuf), stdin)){
- TSK_DEBUG_INFO("Command-Line: %s", cmdbuf);
- tsk_buffer_cleanup(buffer); /* cannot read from console while executing scenario */
- tsk_buffer_append(buffer, cmdbuf, tsk_strlen(cmdbuf));
+ char cmdbuf[4096];
+ tsk_buffer_t* buffer = tsk_null;
+ cmd_t* cmd = tsk_null;
+ tsk_bool_t comment = tsk_false;
+ int ret;
+ int i, index;
+ const char* start = tsk_null, *end = tsk_null;
+
+ int a = 32 | 1 | 2;
+
+ /* Copyright */
+ printf("Doubango Project (tinyDEMO)\nCopyright (C) 2009 - 2013 Mamadou Diop \n\n");
+
+ /* Initialize Network Layer ==> Mandatory */
+ tnet_startup();
+ /* Initialize Doubango Audio/Video Framework ==> will register all plugins(codecs and sessions)
+ * Not mandatory if you have your own plugins*/
+ tdav_init();
+
+ /* Print Usage */
+ //cmd_print_help();
+
+ /* create user's ctx */
+ if(!(ctx = ctx_create()) || !ctx->stack) {
+ TSK_DEBUG_ERROR("Failed to create user's ctx.");
+ goto bail;
+ }
+
+ /* create new buffer */
+ if(!(buffer = tsk_buffer_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create new buffer.");
+ goto bail;
+ }
+
+ /* initial args */
+ for(i=1 /* index zero contains the exe path */, index=0; i<argc && argv[i]; i++) {
+ if(index) {
+ tsk_buffer_append(buffer, " ", 1);
+ }
+ tsk_buffer_append(buffer, argv[i], tsk_strlen(argv[i]));
+ }
+
+ /* If initial args ==> parse it now */
+ if(buffer->size) {
+ TSK_DEBUG_INFO("Initial command-line: %s", buffer->data);
+ goto init_buffer;
+ }
+
+ /* always use fgets() instead of gets. gets() is considered to be unsafe.(Android and Mac OS X will warn) */
+ while(fgets(cmdbuf, sizeof(cmdbuf), stdin)) {
+ TSK_DEBUG_INFO("Command-Line: %s", cmdbuf);
+ tsk_buffer_cleanup(buffer); /* cannot read from console while executing scenario */
+ tsk_buffer_append(buffer, cmdbuf, tsk_strlen(cmdbuf));
init_buffer:
- start = buffer->data;
- //start = trim(start);
- end = start + buffer->size;
- if(start >= end){
- TSK_DEBUG_INFO("Empty buffer");
- continue;
- }
+ start = buffer->data;
+ //start = trim(start);
+ end = start + buffer->size;
+ if(start >= end) {
+ TSK_DEBUG_INFO("Empty buffer");
+ continue;
+ }
parse_buffer:
- TSK_OBJECT_SAFE_FREE(cmd); /* Free old value */
- cmd = cmd_parse(start, (end-start), &comment, ctx->params);
- if(cmd){
- if(comment || cmd->type == cmd_none){
- goto nex_line;
- }
- }
- else{
- continue;
- }
-
- /* Load from scenario file? */
- if(cmd->type == cmd_scenario){
- FILE* file;
- const opt_t* opt;
- tsk_size_t read = 0;
- tsk_bool_t rm_lf = tsk_false;
- if((opt = opt_get_by_type(cmd->opts, opt_path)) && !tsk_strnullORempty(opt->value)){ /* --path option */
- if((file = fopen(opt->value, "r"))){
- memset(cmdbuf, '\0', sizeof(cmdbuf)), cmdbuf[0] = '\n';
- read = fread(cmdbuf+1, sizeof(uint8_t), sizeof(cmdbuf)-1, file);
- fclose(file), file = tsk_null;
-
- if(read == 0){
- TSK_DEBUG_ERROR("[%s] is empty.", opt->value);
- goto nex_line;
- }
- else if(read == sizeof(cmdbuf)-1){
- TSK_DEBUG_ERROR("Buffer too short.");
-
- goto nex_line;
- }
- read++; /* \n */
- /* repplace all '\' with spaces (easier than handling that in the ragel file) */
- for(i=0; ((tsk_size_t)i)<read; i++){
- if(cmdbuf[i] == '\\'){
- cmdbuf[i] = ' ';
- rm_lf = tsk_true;
- }
- else if(rm_lf && cmdbuf[i] == '\n'){
- cmdbuf[i] = ' ';
- rm_lf = tsk_false;
- }
- }
- cmdbuf[read] = '\n';
-
- /* insert embedded scenario */
- if((index = tsk_strindexOf(start, (end-start), "\n")) == -1){ /* ++sn line */
- index = buffer->size;
- }
- else{
- index += (start - ((const char*)buffer->data));
- }
-
- if(tsk_buffer_insert(buffer, index, cmdbuf, read)){
- continue;
- }
- else{
- start = ((const char*)buffer->data) + index; // because insert use realloc()
- end = (((const char*)buffer->data) + buffer->size);
- goto nex_line;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to open scenario-file [%s].", opt->value);
- goto nex_line;
- }
- continue;
- }
- else{
- TSK_DEBUG_ERROR("++scenario command must have --path option.");
- continue;
- }
- }
-
- /* execute current command */
- switch(cmd->type){
- case cmd_exit:
- TSK_DEBUG_INFO("Exit/Quit");
- goto bail;
- default:
- ret = execute(cmd);
- break;
- }
-
- /* next line */
+ TSK_OBJECT_SAFE_FREE(cmd); /* Free old value */
+ cmd = cmd_parse(start, (end-start), &comment, ctx->params);
+ if(cmd) {
+ if(comment || cmd->type == cmd_none) {
+ goto nex_line;
+ }
+ }
+ else {
+ continue;
+ }
+
+ /* Load from scenario file? */
+ if(cmd->type == cmd_scenario) {
+ FILE* file;
+ const opt_t* opt;
+ tsk_size_t read = 0;
+ tsk_bool_t rm_lf = tsk_false;
+ if((opt = opt_get_by_type(cmd->opts, opt_path)) && !tsk_strnullORempty(opt->value)) { /* --path option */
+ if((file = fopen(opt->value, "r"))) {
+ memset(cmdbuf, '\0', sizeof(cmdbuf)), cmdbuf[0] = '\n';
+ read = fread(cmdbuf+1, sizeof(uint8_t), sizeof(cmdbuf)-1, file);
+ fclose(file), file = tsk_null;
+
+ if(read == 0) {
+ TSK_DEBUG_ERROR("[%s] is empty.", opt->value);
+ goto nex_line;
+ }
+ else if(read == sizeof(cmdbuf)-1) {
+ TSK_DEBUG_ERROR("Buffer too short.");
+
+ goto nex_line;
+ }
+ read++; /* \n */
+ /* repplace all '\' with spaces (easier than handling that in the ragel file) */
+ for(i=0; ((tsk_size_t)i)<read; i++) {
+ if(cmdbuf[i] == '\\') {
+ cmdbuf[i] = ' ';
+ rm_lf = tsk_true;
+ }
+ else if(rm_lf && cmdbuf[i] == '\n') {
+ cmdbuf[i] = ' ';
+ rm_lf = tsk_false;
+ }
+ }
+ cmdbuf[read] = '\n';
+
+ /* insert embedded scenario */
+ if((index = tsk_strindexOf(start, (end-start), "\n")) == -1) { /* ++sn line */
+ index = buffer->size;
+ }
+ else {
+ index += (start - ((const char*)buffer->data));
+ }
+
+ if(tsk_buffer_insert(buffer, index, cmdbuf, read)) {
+ continue;
+ }
+ else {
+ start = ((const char*)buffer->data) + index; // because insert use realloc()
+ end = (((const char*)buffer->data) + buffer->size);
+ goto nex_line;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to open scenario-file [%s].", opt->value);
+ goto nex_line;
+ }
+ continue;
+ }
+ else {
+ TSK_DEBUG_ERROR("++scenario command must have --path option.");
+ continue;
+ }
+ }
+
+ /* execute current command */
+ switch(cmd->type) {
+ case cmd_exit:
+ TSK_DEBUG_INFO("Exit/Quit");
+ goto bail;
+ default:
+ ret = execute(cmd);
+ break;
+ }
+
+ /* next line */
nex_line:
- if((index = tsk_strindexOf(start, (end - start), "\n")) !=-1){
- start += index;
- while((start < end) && isspace(*start)){
- start ++;
- }
- if((start + 2/*++*/) < end){
- goto parse_buffer; /* next line */
- }
- else{
- continue; /* wait for new commands */
- }
- }
- } /* while(buffer) */
+ if((index = tsk_strindexOf(start, (end - start), "\n")) !=-1) {
+ start += index;
+ while((start < end) && isspace(*start)) {
+ start ++;
+ }
+ if((start + 2/*++*/) < end) {
+ goto parse_buffer; /* next line */
+ }
+ else {
+ continue; /* wait for new commands */
+ }
+ }
+ } /* while(buffer) */
bail:
-
- /* Free current command */
- TSK_OBJECT_SAFE_FREE(cmd);
- /* Free buffer */
- TSK_OBJECT_SAFE_FREE(buffer);
- /* Destroy the user's ctx */
- TSK_OBJECT_SAFE_FREE(ctx);
- /* Deinitialize Doubango Audio/Video Framework ==> will unregister all plugins(codecs and sessions)
- * Not mandatory */
- tdav_init();
- /* Uninitilize Network Layer */
- tnet_cleanup();
+
+ /* Free current command */
+ TSK_OBJECT_SAFE_FREE(cmd);
+ /* Free buffer */
+ TSK_OBJECT_SAFE_FREE(buffer);
+ /* Destroy the user's ctx */
+ TSK_OBJECT_SAFE_FREE(ctx);
+ /* Deinitialize Doubango Audio/Video Framework ==> will unregister all plugins(codecs and sessions)
+ * Not mandatory */
+ tdav_init();
+ /* Uninitilize Network Layer */
+ tnet_cleanup();
#if ANDROID
- exit(0);
+ exit(0);
#endif
- return 0;
+ return 0;
}
const char* trim(const char* str)
{
- while(isspace(*str)){
- str++;
- }
- return str;
+ while(isspace(*str)) {
+ str++;
+ }
+ return str;
}
int update_param(const char* pname, const char* pvalue)
{
- if(ctx->params && pname){
- const tsk_param_t* param;
- if((param = tsk_params_get_param_by_name(ctx->params, pname))){
- tsk_strupdate(&TSK_PARAM(param)->value, pvalue);
- return 0;
- }
- else{
- TSK_DEBUG_INFO("[%s] parameter does not exist", pname);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return -1;
+ if(ctx->params && pname) {
+ const tsk_param_t* param;
+ if((param = tsk_params_get_param_by_name(ctx->params, pname))) {
+ tsk_strupdate(&TSK_PARAM(param)->value, pvalue);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_INFO("[%s] parameter does not exist", pname);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return -1;
}
int execute(const cmd_t* cmd)
{
- int ret = 0;
- tsip_ssession_id_t sid;
- tsk_istr_t istr;
-
- if(!cmd){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(ctx);
-
- switch(cmd->type){
- case cmd_audio:
- case cmd_audiovideo:
- {
- TSK_DEBUG_INFO("command=audio/video");
- if((sid = invite_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_config_session:
- {
- TSK_DEBUG_INFO("command=config-session");
- break;
- }
- case cmd_config_stack:
- {
- TSK_DEBUG_INFO("command=config-satck");
- ret = stack_config(cmd->opts);
- break;
- }
- case cmd_dtmf:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=dtmf");
- if(!(opt = opt_get_by_type(cmd->opts, opt_sid)) || tsk_strnullORempty(opt->value)){ /* --sid option */
- TSK_DEBUG_ERROR("++dtmf command need --sid option");
- break;
- }
- if(!(opt = opt_get_by_type(cmd->opts, opt_event)) || tsk_strnullORempty(opt->value)){ /* --event option */
- TSK_DEBUG_ERROR("++dtmf command need --event option");
- break;
- }
- invite_handle_cmd(cmd->type, cmd->opts);
- break;
- }
- case cmd_dump:
- {
- TSK_DEBUG_INFO("command=dump");
- ret = stack_dump();
- break;
- }
- case cmd_ect:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=ect");
- if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)){
- TSK_DEBUG_ERROR("++ect command need --sid option");
- ret = -1;
- break;
- }
- if((opt = opt_get_by_type(cmd->opts, opt_to)) && !tsk_strnullORempty(opt->value)){
- TSK_DEBUG_ERROR("++ect command need --to option");
- ret = -1;
- break;
- }
- invite_handle_cmd(cmd->type, cmd->opts);
- break;
- }
- case cmd_exit:
- {
- TSK_DEBUG_INFO("command=exit");
- goto bail;
- break;
- }
- case cmd_file:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=file");
- if(!(opt = opt_get_by_type(cmd->opts, opt_path)) || tsk_strnullORempty(opt->value)){
- TSK_DEBUG_ERROR("++file command need --path option");
- break;
- }
- if((sid = invite_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_hangup:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=hangup");
- if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)){ /* --sid option */
- ret = session_hangup(tsk_atoll(opt->value));
- }
- else{
- TSK_DEBUG_ERROR("++hangup command need --sid option");
- ret = -1;
- }
- break;
- }
- case cmd_help:
- {
- TSK_DEBUG_INFO("command=help");
- cmd_print_help();
- break;
- }
- case cmd_hold:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=hold");
- if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)){ /* --sid option */
- invite_handle_cmd(cmd->type, cmd->opts);
- }
- else{
- TSK_DEBUG_ERROR("++hold command need --sid option");
- ret = -1;
- }
- break;
- }
- case cmd_message:
- {
- TSK_DEBUG_INFO("command=message");
- if((sid = message_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
-
- case cmd_options:
- {
- TSK_DEBUG_INFO("command=options");
- if((sid = options_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_publish:
- {
- TSK_DEBUG_INFO("command=publish");
- if((sid = publish_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_register:
- {
- TSK_DEBUG_INFO("command=register");
- if((sid = register_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_resume:
- {
- const opt_t* opt;
- TSK_DEBUG_INFO("command=resume");
- if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)){ /* --sid option */
- invite_handle_cmd(cmd->type, cmd->opts);
- }
- else{
- TSK_DEBUG_ERROR("++resume command need --sid option");
- ret = -1;
- }
- break;
- }
- case cmd_run:
- {
- TSK_DEBUG_INFO("command=run");
- ret = stack_run(cmd->opts);
- break;
- }
- case cmd_scenario:
- {
- TSK_DEBUG_INFO("command=scenario");
- break;
- }
- case cmd_sleep:
- {
- const opt_t* opt;
- double seconds;
-
- tsk_safeobj_unlock(ctx); /* beacuse of callback function */
-
- if((opt = opt_get_by_type(cmd->opts, opt_sec)) && !tsk_strnullORempty(opt->value)){ /* --sec option */
- seconds = strtod(opt->value, tsk_null); /* strtod() is better than atof() */
- if(seconds<=0){
- printf("\n==== Press ENTER to continue...\n");
- getchar();
- }
- else{
- TSK_DEBUG_INFO("Sleeping %f seconds", seconds);
- tsk_thread_sleep((uint64_t)(seconds * 1000));
- }
- }
- else{
- TSK_DEBUG_WARN("++sleep need --sec option.");
- }
- return 0; /* bail: will unlock again */
- }
- case cmd_sms:
- {
- TSK_DEBUG_INFO("command=sms");
- if((sid = message_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_stop:
- {
- TSK_DEBUG_INFO("command=stop");
- tsip_stack_stop(ctx->stack);
- break;
- }
- case cmd_subscribe:
- {
- TSK_DEBUG_INFO("command=subscribe");
- if((sid = subscribe_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID){
- if(cmd->sidparam){
- tsk_itoa(sid, &istr);
- update_param(cmd->sidparam, istr);
- }
- }
- break;
- }
- case cmd_video:
- {
- TSK_DEBUG_INFO("command=video");
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("%d not a valid command.", cmd);
- break;
- }
- }
+ int ret = 0;
+ tsip_ssession_id_t sid;
+ tsk_istr_t istr;
+
+ if(!cmd) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(ctx);
+
+ switch(cmd->type) {
+ case cmd_audio:
+ case cmd_audiovideo: {
+ TSK_DEBUG_INFO("command=audio/video");
+ if((sid = invite_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_config_session: {
+ TSK_DEBUG_INFO("command=config-session");
+ break;
+ }
+ case cmd_config_stack: {
+ TSK_DEBUG_INFO("command=config-satck");
+ ret = stack_config(cmd->opts);
+ break;
+ }
+ case cmd_dtmf: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=dtmf");
+ if(!(opt = opt_get_by_type(cmd->opts, opt_sid)) || tsk_strnullORempty(opt->value)) { /* --sid option */
+ TSK_DEBUG_ERROR("++dtmf command need --sid option");
+ break;
+ }
+ if(!(opt = opt_get_by_type(cmd->opts, opt_event)) || tsk_strnullORempty(opt->value)) { /* --event option */
+ TSK_DEBUG_ERROR("++dtmf command need --event option");
+ break;
+ }
+ invite_handle_cmd(cmd->type, cmd->opts);
+ break;
+ }
+ case cmd_dump: {
+ TSK_DEBUG_INFO("command=dump");
+ ret = stack_dump();
+ break;
+ }
+ case cmd_ect: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=ect");
+ if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)) {
+ TSK_DEBUG_ERROR("++ect command need --sid option");
+ ret = -1;
+ break;
+ }
+ if((opt = opt_get_by_type(cmd->opts, opt_to)) && !tsk_strnullORempty(opt->value)) {
+ TSK_DEBUG_ERROR("++ect command need --to option");
+ ret = -1;
+ break;
+ }
+ invite_handle_cmd(cmd->type, cmd->opts);
+ break;
+ }
+ case cmd_exit: {
+ TSK_DEBUG_INFO("command=exit");
+ goto bail;
+ break;
+ }
+ case cmd_file: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=file");
+ if(!(opt = opt_get_by_type(cmd->opts, opt_path)) || tsk_strnullORempty(opt->value)) {
+ TSK_DEBUG_ERROR("++file command need --path option");
+ break;
+ }
+ if((sid = invite_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_hangup: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=hangup");
+ if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)) { /* --sid option */
+ ret = session_hangup(tsk_atoll(opt->value));
+ }
+ else {
+ TSK_DEBUG_ERROR("++hangup command need --sid option");
+ ret = -1;
+ }
+ break;
+ }
+ case cmd_help: {
+ TSK_DEBUG_INFO("command=help");
+ cmd_print_help();
+ break;
+ }
+ case cmd_hold: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=hold");
+ if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)) { /* --sid option */
+ invite_handle_cmd(cmd->type, cmd->opts);
+ }
+ else {
+ TSK_DEBUG_ERROR("++hold command need --sid option");
+ ret = -1;
+ }
+ break;
+ }
+ case cmd_message: {
+ TSK_DEBUG_INFO("command=message");
+ if((sid = message_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+
+ case cmd_options: {
+ TSK_DEBUG_INFO("command=options");
+ if((sid = options_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_publish: {
+ TSK_DEBUG_INFO("command=publish");
+ if((sid = publish_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_register: {
+ TSK_DEBUG_INFO("command=register");
+ if((sid = register_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_resume: {
+ const opt_t* opt;
+ TSK_DEBUG_INFO("command=resume");
+ if((opt = opt_get_by_type(cmd->opts, opt_sid)) && !tsk_strnullORempty(opt->value)) { /* --sid option */
+ invite_handle_cmd(cmd->type, cmd->opts);
+ }
+ else {
+ TSK_DEBUG_ERROR("++resume command need --sid option");
+ ret = -1;
+ }
+ break;
+ }
+ case cmd_run: {
+ TSK_DEBUG_INFO("command=run");
+ ret = stack_run(cmd->opts);
+ break;
+ }
+ case cmd_scenario: {
+ TSK_DEBUG_INFO("command=scenario");
+ break;
+ }
+ case cmd_sleep: {
+ const opt_t* opt;
+ double seconds;
+
+ tsk_safeobj_unlock(ctx); /* beacuse of callback function */
+
+ if((opt = opt_get_by_type(cmd->opts, opt_sec)) && !tsk_strnullORempty(opt->value)) { /* --sec option */
+ seconds = strtod(opt->value, tsk_null); /* strtod() is better than atof() */
+ if(seconds<=0) {
+ printf("\n==== Press ENTER to continue...\n");
+ getchar();
+ }
+ else {
+ TSK_DEBUG_INFO("Sleeping %f seconds", seconds);
+ tsk_thread_sleep((uint64_t)(seconds * 1000));
+ }
+ }
+ else {
+ TSK_DEBUG_WARN("++sleep need --sec option.");
+ }
+ return 0; /* bail: will unlock again */
+ }
+ case cmd_sms: {
+ TSK_DEBUG_INFO("command=sms");
+ if((sid = message_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_stop: {
+ TSK_DEBUG_INFO("command=stop");
+ tsip_stack_stop(ctx->stack);
+ break;
+ }
+ case cmd_subscribe: {
+ TSK_DEBUG_INFO("command=subscribe");
+ if((sid = subscribe_handle_cmd(cmd->type, cmd->opts)) != TSIP_SSESSION_INVALID_ID) {
+ if(cmd->sidparam) {
+ tsk_itoa(sid, &istr);
+ update_param(cmd->sidparam, istr);
+ }
+ }
+ break;
+ }
+ case cmd_video: {
+ TSK_DEBUG_INFO("command=video");
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("%d not a valid command.", cmd);
+ break;
+ }
+ }
bail:
- tsk_safeobj_unlock(ctx);
+ tsk_safeobj_unlock(ctx);
- return ret;
+ return ret;
}
diff --git a/tinyDEMO/main.h b/tinyDEMO/main.h
index 351f334..a71f942 100755
--- a/tinyDEMO/main.h
+++ b/tinyDEMO/main.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/message.c b/tinyDEMO/message.c
index b0a97aa..fe826db 100755
--- a/tinyDEMO/message.c
+++ b/tinyDEMO/message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,238 +33,236 @@ tsk_buffer_t* sms_submit(const tsip_uri_t* smsc, const tsip_uri_t* dest, const c
int message_handle_event(const tsip_event_t *_event)
{
- const tsip_message_event_t* msg_event = TSIP_MESSAGE_EVENT(_event);
- const session_t* session = tsk_null;
- tsip_ssession_id_t sid;
- int ret = 0;
+ const tsip_message_event_t* msg_event = TSIP_MESSAGE_EVENT(_event);
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t sid;
+ int ret = 0;
+
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ if(tsip_ssession_have_ownership(_event->ss)) {
+ /* it's or own session and we fail to match it ==> should never happen */
+ TSK_DEBUG_ERROR("Failed to match session event.");
+ ret = -2;
+ goto bail;
+ }
+ else {
+ /* it's a "server-side-session" (incoming MESSAGE) */
+ session_t* _session;
+ if((_session = session_server_create(st_message, _event->ss)) && (session = _session)) {
+ tsk_list_push_back_data(ctx->sessions, (void**)&_session);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create \"sever-side-session\".");
+ ret = -3;
+ goto bail;
+ }
+ }
+ }
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- if(tsip_ssession_have_ownership(_event->ss)){
- /* it's or own session and we fail to match it ==> should never happen */
- TSK_DEBUG_ERROR("Failed to match session event.");
- ret = -2;
- goto bail;
- }
- else{
- /* it's a "server-side-session" (incoming MESSAGE) */
- session_t* _session;
- if((_session = session_server_create(st_message, _event->ss)) && (session = _session)){
- tsk_list_push_back_data(ctx->sessions, (void**)&_session);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create \"sever-side-session\".");
- ret = -3;
- goto bail;
- }
- }
- }
-
- switch(msg_event->type){
- case tsip_ao_message: /* Answer to outgoing MESSAGE */
- {
- TSK_DEBUG_INFO("Event: Answer to outgoing MESSAGE. Code=%d", TSIP_RESPONSE_CODE(_event->sipmessage));
- if(TSIP_RESPONSE_IS_2XX(_event->sipmessage)){
- TSK_DEBUG_INFO("Message successfully sent.");
- }
- break;
- }
+ switch(msg_event->type) {
+ case tsip_ao_message: { /* Answer to outgoing MESSAGE */
+ TSK_DEBUG_INFO("Event: Answer to outgoing MESSAGE. Code=%d", TSIP_RESPONSE_CODE(_event->sipmessage));
+ if(TSIP_RESPONSE_IS_2XX(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Message successfully sent.");
+ }
+ break;
+ }
- case tsip_i_message: /* Incoming MESSAGE */
- {
- const char* content_type = TSIP_MESSAGE_CONTENT_TYPE(_event->sipmessage);
+ case tsip_i_message: { /* Incoming MESSAGE */
+ const char* content_type = TSIP_MESSAGE_CONTENT_TYPE(_event->sipmessage);
- TSK_DEBUG_INFO("Event: Incoming MESSAGE.");
- if(TSIP_MESSAGE_HAS_CONTENT(_event->sipmessage)){
- const tsk_buffer_t* content = TSIP_MESSAGE_CONTENT(_event->sipmessage);
- TSK_DEBUG_INFO("MESSAGE Content-Type: %s", content_type);
- TSK_DEBUG_INFO("MESSAGE Content: %s", content->data);
- }
- /* accept() the MESSAGE to terminate the dialog */
- if(tsk_striequals("plain/text", content_type) || tsk_striequals("text/html", content_type)){
- tsip_api_common_accept(session->handle,
- TSIP_ACTION_SET_HEADER("Info", "I've accept()ed your message"),// just for test
- TSIP_ACTION_SET_NULL());
- }
- /* reject() the MESSAGE to terminate the dialog */
- else{
- tsip_api_common_reject(session->handle,
- TSIP_ACTION_SET_HEADER("Info", "I've reject()ed your message"),// just for test
- TSIP_ACTION_SET_HEADER("In-Reply-To", "apb03a0s09dkjdfglkj49112"),// just for test
- TSIP_ACTION_SET_NULL());
- }
- break;
- }
+ TSK_DEBUG_INFO("Event: Incoming MESSAGE.");
+ if(TSIP_MESSAGE_HAS_CONTENT(_event->sipmessage)) {
+ const tsk_buffer_t* content = TSIP_MESSAGE_CONTENT(_event->sipmessage);
+ TSK_DEBUG_INFO("MESSAGE Content-Type: %s", content_type);
+ TSK_DEBUG_INFO("MESSAGE Content: %s", content->data);
+ }
+ /* accept() the MESSAGE to terminate the dialog */
+ if(tsk_striequals("plain/text", content_type) || tsk_striequals("text/html", content_type)) {
+ tsip_api_common_accept(session->handle,
+ TSIP_ACTION_SET_HEADER("Info", "I've accept()ed your message"),// just for test
+ TSIP_ACTION_SET_NULL());
+ }
+ /* reject() the MESSAGE to terminate the dialog */
+ else {
+ tsip_api_common_reject(session->handle,
+ TSIP_ACTION_SET_HEADER("Info", "I've reject()ed your message"),// just for test
+ TSIP_ACTION_SET_HEADER("In-Reply-To", "apb03a0s09dkjdfglkj49112"),// just for test
+ TSIP_ACTION_SET_NULL());
+ }
+ break;
+ }
- default:
- { /* Any other event */
- TSK_DEBUG_WARN("%d not a valid SIP Messaging event.", msg_event->type);
- break;
- }
- }
+ default: {
+ /* Any other event */
+ TSK_DEBUG_WARN("%d not a valid SIP Messaging event.", msg_event->type);
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
tsip_ssession_id_t message_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- const opt_t* opt;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+ const session_t* session = tsk_null;
+ const opt_t* opt;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
-
- switch(cmd){
- case cmd_message:
- { /* Send SIP MESSAGE */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_message_send_message(session->handle,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- case cmd_sms:
- { /* Binary SMS (RP-DATA) */
- const char* ascii_pay = tsk_null;
- tsk_buffer_t* binary_pay = tsk_null;
- if((opt = opt_get_by_type(opts, opt_smsc)) && !tsk_strnullORempty(opt->value)){
- tsip_uri_t* smsc = tsip_uri_parse(opt->value, tsk_strlen(opt->value));
- tsip_uri_t* dest = tsk_null;
- if(smsc){
- /* Valid phone number for the SMSC address? */
- if(!is_valid_telnum(smsc)){
- TSK_DEBUG_ERROR("[%s] contains invalid telephone number", opt->value);
- goto done;
- }
- tsip_ssession_set(session->handle,
- TSIP_SSESSION_SET_TO(opt->value),
- TSIP_SSESSION_SET_NULL());
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
- /* Destination URI */
- if((opt = opt_get_by_type(opts, opt_to)) && !tsk_strnullORempty(opt->value)){
- if((dest = tsip_uri_parse(opt->value, tsk_strlen(opt->value)))){
- if(!is_valid_telnum(dest)){
- TSK_DEBUG_ERROR("[%s] contains invalid telephone number", opt->value);
- goto done;
- }
- }
- else{
- TSK_DEBUG_ERROR("[%s] is an invalid SIP/tel uri", opt->value);
- goto done;
- }
- }
- else{
- TSK_DEBUG_ERROR("++sms command need --to");
- goto done;
- }
+ switch(cmd) {
+ case cmd_message: {
+ /* Send SIP MESSAGE */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_message_send_message(session->handle,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ case cmd_sms: {
+ /* Binary SMS (RP-DATA) */
+ const char* ascii_pay = tsk_null;
+ tsk_buffer_t* binary_pay = tsk_null;
+ if((opt = opt_get_by_type(opts, opt_smsc)) && !tsk_strnullORempty(opt->value)) {
+ tsip_uri_t* smsc = tsip_uri_parse(opt->value, tsk_strlen(opt->value));
+ tsip_uri_t* dest = tsk_null;
+ if(smsc) {
+ /* Valid phone number for the SMSC address? */
+ if(!is_valid_telnum(smsc)) {
+ TSK_DEBUG_ERROR("[%s] contains invalid telephone number", opt->value);
+ goto done;
+ }
+ tsip_ssession_set(session->handle,
+ TSIP_SSESSION_SET_TO(opt->value),
+ TSIP_SSESSION_SET_NULL());
- /* Payload? */
- if((opt = opt_get_by_type(opts, opt_payload)) && !tsk_strnullORempty(opt->value)){
- ascii_pay = opt->value;
- }
- else{
- TSK_DEBUG_ERROR("++sms command need --to");
- goto done;
- }
+ /* Destination URI */
+ if((opt = opt_get_by_type(opts, opt_to)) && !tsk_strnullORempty(opt->value)) {
+ if((dest = tsip_uri_parse(opt->value, tsk_strlen(opt->value)))) {
+ if(!is_valid_telnum(dest)) {
+ TSK_DEBUG_ERROR("[%s] contains invalid telephone number", opt->value);
+ goto done;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("[%s] is an invalid SIP/tel uri", opt->value);
+ goto done;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("++sms command need --to");
+ goto done;
+ }
- /* Create the binary content */
- if(!(binary_pay = sms_submit(smsc, dest, ascii_pay))){
- TSK_DEBUG_ERROR("Failed to encode RP-DATA(SMS-SUBMIT) message.");
- goto done;
- }
+ /* Payload? */
+ if((opt = opt_get_by_type(opts, opt_payload)) && !tsk_strnullORempty(opt->value)) {
+ ascii_pay = opt->value;
+ }
+ else {
+ TSK_DEBUG_ERROR("++sms command need --to");
+ goto done;
+ }
+
+ /* Create the binary content */
+ if(!(binary_pay = sms_submit(smsc, dest, ascii_pay))) {
+ TSK_DEBUG_ERROR("Failed to encode RP-DATA(SMS-SUBMIT) message.");
+ goto done;
+ }
+
+ /* Send the message */
+ tsip_api_message_send_message(session->handle,
+ /* TSIP_ACTION_SET_HEADER("Content-Type", "application/vnd.3gpp.sms"), */
+ /* TSIP_ACTION_SET_HEADER("Transfer-Encoding", "binary"),*/
+ TSIP_ACTION_SET_PAYLOAD(binary_pay->data, binary_pay->size),
+ TSIP_ACTION_SET_NULL());
- /* Send the message */
- tsip_api_message_send_message(session->handle,
- /* TSIP_ACTION_SET_HEADER("Content-Type", "application/vnd.3gpp.sms"), */
- /* TSIP_ACTION_SET_HEADER("Transfer-Encoding", "binary"),*/
- TSIP_ACTION_SET_PAYLOAD(binary_pay->data, binary_pay->size),
- TSIP_ACTION_SET_NULL());
-
done:
- TSK_OBJECT_SAFE_FREE(binary_pay);
- TSK_OBJECT_SAFE_FREE(dest);
- TSK_OBJECT_SAFE_FREE(smsc);
- }
- else{
- TSK_DEBUG_ERROR("[%s] is an invalid SIP/tel uri", opt->value);
- break;
- }
- }
- else{
- TSK_DEBUG_ERROR("++sms command need --smsc");
- break;
- }
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
-
+ TSK_OBJECT_SAFE_FREE(binary_pay);
+ TSK_OBJECT_SAFE_FREE(dest);
+ TSK_OBJECT_SAFE_FREE(smsc);
+ }
+ else {
+ TSK_DEBUG_ERROR("[%s] is an invalid SIP/tel uri", opt->value);
+ break;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("++sms command need --smsc");
+ break;
+ }
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
+
bail:
- return id;
+ return id;
}
tsk_bool_t is_valid_telnum(const tsip_uri_t* uri)
{
- tsk_size_t i;
- tsk_size_t len;
+ tsk_size_t i;
+ tsk_size_t len;
- if(!uri || tsk_strnullORempty(uri->user_name)){
- return tsk_false;
- }
+ if(!uri || tsk_strnullORempty(uri->user_name)) {
+ return tsk_false;
+ }
- for(i = 0, len = tsk_strlen(uri->user_name); i<len; i++){
- if(uri->user_name[i] != '+' && !isdigit(uri->user_name[i])){
- return tsk_false;
- }
- }
- return tsk_true;
+ for(i = 0, len = tsk_strlen(uri->user_name); i<len; i++) {
+ if(uri->user_name[i] != '+' && !isdigit(uri->user_name[i])) {
+ return tsk_false;
+ }
+ }
+ return tsk_true;
}
tsk_buffer_t* sms_submit(const tsip_uri_t* smsc, const tsip_uri_t* dest, const char* ascii_pay)
{
- static uint8_t mr = 0x00;
+ static uint8_t mr = 0x00;
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_submit_t* sms_submit = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_submit_t* sms_submit = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
- // create SMS-SUBMIT message
- sms_submit = tsms_tpdu_submit_create(++mr, (const uint8_t*)smsc->user_name, (const uint8_t*)dest->user_name);
- // Set content for SMS-SUBMIT
- if((buffer = tsms_pack_to_7bit(ascii_pay))){
- if((ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit))){
- goto bail;
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- // create Mobile Originated (MO) RP-DATA message
- if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc->user_name, TSMS_TPDU_MESSAGE(sms_submit)))){
- // serialize into a buffer
- if((buffer = tsk_buffer_create_null())){
- ret = tsms_rpdu_data_serialize(rp_data, buffer);
- }
- }
+ // create SMS-SUBMIT message
+ sms_submit = tsms_tpdu_submit_create(++mr, (const uint8_t*)smsc->user_name, (const uint8_t*)dest->user_name);
+ // Set content for SMS-SUBMIT
+ if((buffer = tsms_pack_to_7bit(ascii_pay))) {
+ if((ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit))) {
+ goto bail;
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ // create Mobile Originated (MO) RP-DATA message
+ if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc->user_name, TSMS_TPDU_MESSAGE(sms_submit)))) {
+ // serialize into a buffer
+ if((buffer = tsk_buffer_create_null())) {
+ ret = tsms_rpdu_data_serialize(rp_data, buffer);
+ }
+ }
bail:
- if(ret){ /* Failed? */
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- TSK_OBJECT_SAFE_FREE(sms_submit);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ if(ret) { /* Failed? */
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ TSK_OBJECT_SAFE_FREE(sms_submit);
+ TSK_OBJECT_SAFE_FREE(rp_data);
- return buffer;
+ return buffer;
}
diff --git a/tinyDEMO/message.h b/tinyDEMO/message.h
index 6adb9c5..4b433ac 100755
--- a/tinyDEMO/message.h
+++ b/tinyDEMO/message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/options.c b/tinyDEMO/options.c
index e46defb..00a719e 100755
--- a/tinyDEMO/options.c
+++ b/tinyDEMO/options.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,88 +28,88 @@ int options_hack_aor(const tsip_response_t* resp);
int options_handle_event(const tsip_event_t *_event)
{
- const tsip_options_event_t* opt_event = TSIP_OPTIONS_EVENT(_event);
- const session_t* session;
- tsip_ssession_id_t sid;
+ const tsip_options_event_t* opt_event = TSIP_OPTIONS_EVENT(_event);
+ const session_t* session;
+ tsip_ssession_id_t sid;
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- TSK_DEBUG_WARN("Failed to match session event.");
- return -1;
- }
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ TSK_DEBUG_WARN("Failed to match session event.");
+ return -1;
+ }
- switch(opt_event->type){
- case tsip_i_options: /* incoming OPTIONS */
- break;
- case tsip_ao_options: /* answer to outgoing OPTIONS */
+ switch(opt_event->type) {
+ case tsip_i_options: /* incoming OPTIONS */
+ break;
+ case tsip_ao_options: /* answer to outgoing OPTIONS */
#if HACK_AOR
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- options_hack_aor(_event->sipmessage);
- }
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ options_hack_aor(_event->sipmessage);
+ }
#endif
- break;
- }
+ break;
+ }
- return 0;
+ return 0;
}
tsip_ssession_id_t options_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
-
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
- /* Execute command */
- switch(cmd){
- case cmd_options:
- { /* Send SIP OPTIONS */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_options_send_options(session->handle,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
+ /* Execute command */
+ switch(cmd) {
+ case cmd_options: {
+ /* Send SIP OPTIONS */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_options_send_options(session->handle,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
bail:
- return id;
+ return id;
}
/* used to hack the AOR. useful for devices behind NATs or emulators (e.g. ANDROID) */
int options_hack_aor(const tsip_response_t* resp)
{
- int32_t rport;
- if(resp && resp->firstVia){
- if(resp->firstVia->rport <=0){
- char* received_port_ext;
- /* Ericsson SDS
- ==> Via: SIP/2.0/TCP 192.168.0.12:49744;rport;branch=z9hG4bK1273100904048;received_port_ext=49744;received=192.168.0.12 */
- if((received_port_ext = tsip_header_get_param_value((const tsip_header_t*)resp->firstVia, "received_port_ext"))){
- rport = (int32_t)atoi(received_port_ext);
- TSK_FREE(received_port_ext);
- }
- }
- else{
- rport = resp->firstVia->rport;
- }
+ int32_t rport;
+ if(resp && resp->firstVia) {
+ if(resp->firstVia->rport <=0) {
+ char* received_port_ext;
+ /* Ericsson SDS
+ ==> Via: SIP/2.0/TCP 192.168.0.12:49744;rport;branch=z9hG4bK1273100904048;received_port_ext=49744;received=192.168.0.12 */
+ if((received_port_ext = tsip_header_get_param_value((const tsip_header_t*)resp->firstVia, "received_port_ext"))) {
+ rport = (int32_t)atoi(received_port_ext);
+ TSK_FREE(received_port_ext);
+ }
+ }
+ else {
+ rport = resp->firstVia->rport;
+ }
- tsip_stack_set(ctx->stack,
- TSIP_STACK_SET_AOR(resp->firstVia->received, rport),
- TSIP_STACK_SET_NULL());
- return 0;
- }
+ tsip_stack_set(ctx->stack,
+ TSIP_STACK_SET_AOR(resp->firstVia->received, rport),
+ TSIP_STACK_SET_NULL());
+ return 0;
+ }
- return -1;
+ return -1;
}
diff --git a/tinyDEMO/options.h b/tinyDEMO/options.h
index 5f1d95f..f9f5839 100755
--- a/tinyDEMO/options.h
+++ b/tinyDEMO/options.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/publish.c b/tinyDEMO/publish.c
index 0d34f1e..2c89773 100755
--- a/tinyDEMO/publish.c
+++ b/tinyDEMO/publish.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,92 +26,89 @@ extern const session_t* session_handle_cmd(cmd_type_t , const opts_L_t*);
int publish_handle_event(const tsip_event_t *_event)
{
- const tsip_publish_event_t* pub_event = TSIP_PUBLISH_EVENT(_event);
- const session_t* session;
- tsip_ssession_id_t sid;
+ const tsip_publish_event_t* pub_event = TSIP_PUBLISH_EVENT(_event);
+ const session_t* session;
+ tsip_ssession_id_t sid;
+
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ TSK_DEBUG_WARN("Failed to match session event.");
+ return -1;
+ }
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- TSK_DEBUG_WARN("Failed to match session event.");
- return -1;
- }
+ switch(pub_event->type) {
+ case tsip_ao_publish: { /* Answer to outgoing PUBLISH */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing PUBLISH. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
- switch(pub_event->type){
- case tsip_ao_publish: /* Answer to outgoing PUBLISH */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing PUBLISH. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
-
- case tsip_ao_unpublish: /* Answer to outgoing unPUBLISH */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing UNPUBLISH. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
+ case tsip_ao_unpublish: { /* Answer to outgoing unPUBLISH */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing UNPUBLISH. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
- /* Server events (For whose dev. Server Side IMS Services) */
- case tsip_i_publish: /* Incoming PUBLISH */
- case tsip_i_unpublish: /* Incoming unPUBLISH */
- {
- TSK_DEBUG_WARN("Event not support by Client Framework.");
- break;
- }
+ /* Server events (For whose dev. Server Side IMS Services) */
+ case tsip_i_publish: /* Incoming PUBLISH */
+ case tsip_i_unpublish: { /* Incoming unPUBLISH */
+ TSK_DEBUG_WARN("Event not support by Client Framework.");
+ break;
+ }
- default:
- { /* Any other event */
- TSK_DEBUG_WARN("%d not a valid SIP Subscription event.", pub_event->type);
- break;
- }
- }
+ default: {
+ /* Any other event */
+ TSK_DEBUG_WARN("%d not a valid SIP Subscription event.", pub_event->type);
+ break;
+ }
+ }
- return 0;
+ return 0;
}
tsip_ssession_id_t publish_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
- switch(cmd){
- case cmd_publish:
- { /* Send SIP PUBLISH */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_publish_send_publish(session->handle,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
+ switch(cmd) {
+ case cmd_publish: {
+ /* Send SIP PUBLISH */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_publish_send_publish(session->handle,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
bail:
- return id;
+ return id;
}
diff --git a/tinyDEMO/publish.h b/tinyDEMO/publish.h
index 36470ed..292b734 100755
--- a/tinyDEMO/publish.h
+++ b/tinyDEMO/publish.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/register.c b/tinyDEMO/register.c
index 45ca7fb..bfc4620 100755
--- a/tinyDEMO/register.c
+++ b/tinyDEMO/register.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,95 +27,92 @@ extern const session_t* session_handle_cmd(cmd_type_t , const opts_L_t*);
int register_handle_event(const tsip_event_t *_event)
{
- const tsip_register_event_t* reg_event = TSIP_REGISTER_EVENT(_event);
- const session_t* session;
- tsip_ssession_id_t sid;
+ const tsip_register_event_t* reg_event = TSIP_REGISTER_EVENT(_event);
+ const session_t* session;
+ tsip_ssession_id_t sid;
+
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ TSK_DEBUG_WARN("Failed to match session event.");
+ return -1;
+ }
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- TSK_DEBUG_WARN("Failed to match session event.");
- return -1;
- }
+ switch(reg_event->type) {
+ case tsip_ao_register: { /* Answer to outgoing REGISTER */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing REGISTER. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
+ case tsip_ao_unregister: { /* Answer to outgoing unREGISTER */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing unREGISTER. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
- switch(reg_event->type){
- case tsip_ao_register: /* Answer to outgoing REGISTER */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing REGISTER. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
- case tsip_ao_unregister: /* Answer to outgoing unREGISTER */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing unREGISTER. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
-
- /* Server events (For whose dev. Server Side IMS Services) */
- case tsip_i_register: /* Incoming REGISTER */
- case tsip_i_unregister: /* Incoming unREGISTER */
- {
- TSK_DEBUG_WARN("Event not support by Client Framework.");
- break;
- }
-
- default:
- { /* Any other event */
- TSK_DEBUG_WARN("%d not a valid SIP Registration event.", reg_event->type);
- break;
- }
- }
+ /* Server events (For whose dev. Server Side IMS Services) */
+ case tsip_i_register: /* Incoming REGISTER */
+ case tsip_i_unregister: { /* Incoming unREGISTER */
+ TSK_DEBUG_WARN("Event not support by Client Framework.");
+ break;
+ }
- return 0;
+ default: {
+ /* Any other event */
+ TSK_DEBUG_WARN("%d not a valid SIP Registration event.", reg_event->type);
+ break;
+ }
+ }
+
+ return 0;
}
tsip_ssession_id_t register_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
-
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
-
- /* action config */
-
- /* Execute command */
- switch(cmd){
- case cmd_register:
- { /* Send SIP REGISTER */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_register_send_register(session->handle,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
+
+ /* action config */
+
+ /* Execute command */
+ switch(cmd) {
+ case cmd_register: {
+ /* Send SIP REGISTER */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_register_send_register(session->handle,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
bail:
- return id;
+ return id;
}
diff --git a/tinyDEMO/register.h b/tinyDEMO/register.h
index f0c2ec0..9cecd62 100755
--- a/tinyDEMO/register.h
+++ b/tinyDEMO/register.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDEMO/subscribe.c b/tinyDEMO/subscribe.c
index 54a0375..60626a5 100755
--- a/tinyDEMO/subscribe.c
+++ b/tinyDEMO/subscribe.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,104 +26,100 @@ extern const session_t* session_handle_cmd(cmd_type_t , const opts_L_t*);
int subscribe_handle_event(const tsip_event_t *_event)
{
- const tsip_subscribe_event_t* sub_event = TSIP_SUBSCRIBE_EVENT(_event);
- const session_t* session;
- tsip_ssession_id_t sid;
+ const tsip_subscribe_event_t* sub_event = TSIP_SUBSCRIBE_EVENT(_event);
+ const session_t* session;
+ tsip_ssession_id_t sid;
+
+ /* Find associated session */
+ sid = tsip_ssession_get_id(_event->ss);
+ if(!(session = session_get_by_sid(ctx->sessions, sid))) {
+ TSK_DEBUG_WARN("Failed to match session event.");
+ return -1;
+ }
+
- /* Find associated session */
- sid = tsip_ssession_get_id(_event->ss);
- if(!(session = session_get_by_sid(ctx->sessions, sid))){
- TSK_DEBUG_WARN("Failed to match session event.");
- return -1;
- }
-
+ switch(sub_event->type) {
+ case tsip_ao_subscribe: { /* Answer to outgoing SUBSCRIBE */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing SUBSCRIBE. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
- switch(sub_event->type){
- case tsip_ao_subscribe: /* Answer to outgoing SUBSCRIBE */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing SUBSCRIBE. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
-
- case tsip_ao_unsubscribe: /* Answer to outgoing unSUBSCRIBE */
- {
- if(_event->sipmessage){
- if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
- TSK_DEBUG_INFO("Event: Answer to outgoing unSUBSCRIBE. Code=%d and phrase=%s",
- _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
- }
- else{
- // request
- }
- }
- break;
- }
+ case tsip_ao_unsubscribe: { /* Answer to outgoing unSUBSCRIBE */
+ if(_event->sipmessage) {
+ if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)) {
+ TSK_DEBUG_INFO("Event: Answer to outgoing unSUBSCRIBE. Code=%d and phrase=%s",
+ _event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
+ }
+ else {
+ // request
+ }
+ }
+ break;
+ }
- case tsip_i_notify: /* Incoming NOTIFY */
- {
- TSK_DEBUG_INFO("Event: Incoming NOTIFY.");
- if(TSIP_MESSAGE_HAS_CONTENT(_event->sipmessage)){
- const tsk_buffer_t* content = TSIP_MESSAGE_CONTENT(_event->sipmessage);
- TSK_DEBUG_INFO("NOTIFY Content-Type: %s", TSIP_MESSAGE_CONTENT_TYPE(_event->sipmessage));
- TSK_DEBUG_INFO("NOTIFY Content: %s", content->data);
- }
- break;
- }
+ case tsip_i_notify: { /* Incoming NOTIFY */
+ TSK_DEBUG_INFO("Event: Incoming NOTIFY.");
+ if(TSIP_MESSAGE_HAS_CONTENT(_event->sipmessage)) {
+ const tsk_buffer_t* content = TSIP_MESSAGE_CONTENT(_event->sipmessage);
+ TSK_DEBUG_INFO("NOTIFY Content-Type: %s", TSIP_MESSAGE_CONTENT_TYPE(_event->sipmessage));
+ TSK_DEBUG_INFO("NOTIFY Content: %s", content->data);
+ }
+ break;
+ }
- /* Server events (For whose dev. Server Side IMS Services) */
- case tsip_i_subscribe: /* Incoming SUBSCRIBE */
- case tsip_i_unsubscribe: /* Incoming unSUBSCRIBE */
- {
- TSK_DEBUG_WARN("Event not support by Client Framework.");
- break;
- }
+ /* Server events (For whose dev. Server Side IMS Services) */
+ case tsip_i_subscribe: /* Incoming SUBSCRIBE */
+ case tsip_i_unsubscribe: { /* Incoming unSUBSCRIBE */
+ TSK_DEBUG_WARN("Event not support by Client Framework.");
+ break;
+ }
- default:
- { /* Any other event */
- TSK_DEBUG_WARN("%d not a valid SIP Subscription event.", sub_event->type);
- break;
- }
- }
+ default: {
+ /* Any other event */
+ TSK_DEBUG_WARN("%d not a valid SIP Subscription event.", sub_event->type);
+ break;
+ }
+ }
- return 0;
+ return 0;
}
tsip_ssession_id_t subscribe_handle_cmd(cmd_type_t cmd, const opts_L_t* opts)
{
- const session_t* session = tsk_null;
- tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
+ const session_t* session = tsk_null;
+ tsip_ssession_id_t id = TSIP_SSESSION_INVALID_ID;
- if(!(session = session_handle_cmd(cmd, opts))){
- goto bail;
- }
- else{
- id = tsip_ssession_get_id(session->handle);
- }
+ if(!(session = session_handle_cmd(cmd, opts))) {
+ goto bail;
+ }
+ else {
+ id = tsip_ssession_get_id(session->handle);
+ }
- switch(cmd){
- case cmd_subscribe:
- { /* Send SIP SUBSCRIBE */
- tsip_action_handle_t* action_config = action_get_config(opts);
- tsip_api_subscribe_send_subscribe(session->handle,
- TSIP_ACTION_SET_CONFIG(action_config),
- /* Any other TSIP_ACTION_SET_*() macros */
- TSIP_ACTION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(action_config);
- break;
- }
- default:
- /* already handled by session_handle_cmd() */
- break;
- }
+ switch(cmd) {
+ case cmd_subscribe: {
+ /* Send SIP SUBSCRIBE */
+ tsip_action_handle_t* action_config = action_get_config(opts);
+ tsip_api_subscribe_send_subscribe(session->handle,
+ TSIP_ACTION_SET_CONFIG(action_config),
+ /* Any other TSIP_ACTION_SET_*() macros */
+ TSIP_ACTION_SET_NULL());
+ TSK_OBJECT_SAFE_FREE(action_config);
+ break;
+ }
+ default:
+ /* already handled by session_handle_cmd() */
+ break;
+ }
bail:
- return id;
+ return id;
}
diff --git a/tinyDEMO/subscribe.h b/tinyDEMO/subscribe.h
index 3a10538..e3a98e8 100755
--- a/tinyDEMO/subscribe.h
+++ b/tinyDEMO/subscribe.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyHTTP/include/thttp.h b/tinyHTTP/include/thttp.h
index e2ec237..71da8e8 100755
--- a/tinyHTTP/include/thttp.h
+++ b/tinyHTTP/include/thttp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,12 +42,12 @@
/**@def THTTP_STACK_SET_LOCAL_IP(STR)
* Sets local IP address to bind to. By default, the stack will bind to "0.0.0.0" or "::" depending on
-* whether IPv4 is used or not (IPv6).
+* whether IPv4 is used or not (IPv6).
* This is a helper macro for @ref thttp_stack_create and @ref thttp_stack_set.
* @param IP_STR The IP address (const char*).
*
* @code
-* thttp_stack_create(callback,
+* thttp_stack_create(callback,
* THTTP_STACK_SET_LOCAL_IP("192.168.0.15"),
* THTTP_STACK_SET_NULL());
* @endcode
@@ -60,7 +60,7 @@
* @param PORT_INT The Port (int32_t).
*
* @code
-* thttp_stack_create(callback,
+* thttp_stack_create(callback,
* THTTP_STACK_SET_LOCAL_PORT(1234),
* THTTP_STACK_SET_NULL());
* @endcode
@@ -75,7 +75,7 @@
* @param PRIV_FILE_STR Path to the Private key file.
*
* @code
-* thttp_stack_create(callback,
+* thttp_stack_create(callback,
* THTTP_STACK_SET_TLS_CERTS("C:\\tls\\ca.pki-crt.pem", "C:\\tls\\pub-crt.pem", "C:\\tls\\priv-key.pem"),
* THTTP_STACK_SET_NULL());
* @endcode
@@ -83,80 +83,77 @@
THTTP_BEGIN_DECLS
-typedef enum thttp_stack_param_type_e
-{
- thttp_pname_null = 0,
+typedef enum thttp_stack_param_type_e {
+ thttp_pname_null = 0,
#define THTTP_STACK_SET_NULL() thttp_pname_null
- /* Network */
- thttp_pname_local_ip,
- thttp_pname_local_port,
- thttp_pname_proxy,
+ /* Network */
+ thttp_pname_local_ip,
+ thttp_pname_local_port,
+ thttp_pname_proxy,
#define THTTP_STACK_SET_LOCAL_IP(IP_STR) thttp_pname_local_ip, (const char*)IP_STR
#define THTTP_STACK_SET_LOCAL_PORT(PORT_INT) thttp_pname_local_port, (int)PORT_INT
#define THTTP_STACK_SET_PROXY(IP_STR, PORT_INT) thttp_pname_proxy, (const char*)IP_STR, (int)PORT_INT
- /* Modes */
- thttp_pname_mode_client,
- thttp_pname_mode_server,
+ /* Modes */
+ thttp_pname_mode_client,
+ thttp_pname_mode_server,
#define THTTP_STACK_SET_MODE_CLIENT() thttp_pname_mode_client
#define THTTP_STACK_SET_MODE_SERVER() thttp_pname_mode_server
- /* TLS */
- thttp_pname_tls_enabled,
+ /* TLS */
+ thttp_pname_tls_enabled,
#define THTTP_STACK_SET_TLS_ENABLED(ENABLED_BOOL) thttp_pname_tls_enabled, (tsk_bool_t)ENABLED_BOOL
- thttp_pname_tls_certs_verify,
+ thttp_pname_tls_certs_verify,
#define THTTP_STACK_SET_TLS_CERTS_VERIFY(CERTS_VERIFY_BOOL) thttp_pname_tls_certs_verify, (tsk_bool_t)CERTS_VERIFY_BOOL
- thttp_pname_tls_certs,
+ thttp_pname_tls_certs,
#define THTTP_STACK_SET_TLS_CERTS(CA_FILE_STR, PUB_FILE_STR, PRIV_FILE_STR) thttp_pname_tls_certs, (const char*)CA_FILE_STR, (const char*)PUB_FILE_STR, (const char*)PRIV_FILE_STR
- /* User Data */
- thttp_pname_userdata,
+ /* User Data */
+ thttp_pname_userdata,
#define THTTP_STACK_SET_USERDATA(USERDATA_PTR) thttp_pname_userdata, (const void*)USERDATA_PTR
}
thttp_stack_param_type_t;
-typedef enum thttp_stack_mode_e
-{
- thttp_stack_mode_none,
- thttp_stack_mode_client = (0x01 << 0),
- thttp_stack_mode_server = (0x01 << 1),
- thttp_stack_mode_hybrid = (thttp_stack_mode_client | thttp_stack_mode_server)
+typedef enum thttp_stack_mode_e {
+ thttp_stack_mode_none,
+ thttp_stack_mode_client = (0x01 << 0),
+ thttp_stack_mode_server = (0x01 << 1),
+ thttp_stack_mode_hybrid = (thttp_stack_mode_client | thttp_stack_mode_server)
}
thttp_stack_mode_t;
/** HTTP/HTTPS Stack.
*/
-typedef struct thttp_stack_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t started;
- enum thttp_stack_mode_e mode;
- thttp_stack_callback_f callback;
-
- /* Network */
- char* local_ip;
- int local_port;
- char* proxy_ip;
- int proxy_port;
- tnet_transport_t *transport;
-
- /* TLS */
- struct {
- tsk_bool_t enabled;
- tsk_bool_t verify;
- char* ca;
- char* pbk;
- char* pvk;
- }tls;
-
- thttp_sessions_L_t* sessions;
-
- const void* userdata;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct thttp_stack_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t started;
+ enum thttp_stack_mode_e mode;
+ thttp_stack_callback_f callback;
+
+ /* Network */
+ char* local_ip;
+ int local_port;
+ char* proxy_ip;
+ int proxy_port;
+ tnet_transport_t *transport;
+
+ /* TLS */
+ struct {
+ tsk_bool_t enabled;
+ tsk_bool_t verify;
+ char* ca;
+ char* pbk;
+ char* pvk;
+ } tls;
+
+ thttp_sessions_L_t* sessions;
+
+ const void* userdata;
+
+ TSK_DECLARE_SAFEOBJ;
}
thttp_stack_t;
diff --git a/tinyHTTP/include/tinyhttp.h b/tinyHTTP/include/tinyhttp.h
index a374cad..cbef7da 100755
--- a/tinyHTTP/include/tinyhttp.h
+++ b/tinyHTTP/include/tinyhttp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyHTTP/include/tinyhttp/auth/thttp_auth.h b/tinyHTTP/include/tinyhttp/auth/thttp_auth.h
index 9b88ccc..8e791ac 100755
--- a/tinyHTTP/include/tinyhttp/auth/thttp_auth.h
+++ b/tinyHTTP/include/tinyhttp/auth/thttp_auth.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,8 +55,8 @@ TINYHTTP_API int thttp_auth_digest_HA1sess(const char* username, const char* rea
TINYHTTP_API int thttp_auth_digest_HA2(const char* method, const char* url, const tsk_buffer_t* entity_body, const char* qop, tsk_md5string_t* ha2);
-TINYHTTP_API int thttp_auth_digest_response(const tsk_md5string_t *ha1, const char* nonce, const nonce_count_t noncecount, const char* cnonce,
- const char* qop, const tsk_md5string_t* ha2, tsk_md5string_t* response);
+TINYHTTP_API int thttp_auth_digest_response(const tsk_md5string_t *ha1, const char* nonce, const nonce_count_t noncecount, const char* cnonce,
+ const char* qop, const tsk_md5string_t* ha2, tsk_md5string_t* response);
TINYHTTP_API tsk_size_t thttp_auth_ws_response(const char* key, thttp_auth_ws_keystring_t* response);
diff --git a/tinyHTTP/include/tinyhttp/auth/thttp_challenge.h b/tinyHTTP/include/tinyhttp/auth/thttp_challenge.h
index 23596df..37847c6 100755
--- a/tinyHTTP/include/tinyhttp/auth/thttp_challenge.h
+++ b/tinyHTTP/include/tinyhttp/auth/thttp_challenge.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,21 +39,20 @@
THTTP_BEGIN_DECLS
-typedef struct thttp_challenge_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct thttp_challenge_s {
+ TSK_DECLARE_OBJECT;
- tsk_bool_t isproxy;
+ tsk_bool_t isproxy;
- char* scheme;
- char* realm;
- char* nonce;
- char* opaque;
- char* algorithm;
- const char* qop;
+ char* scheme;
+ char* realm;
+ char* nonce;
+ char* opaque;
+ char* algorithm;
+ const char* qop;
- tsk_md5string_t cnonce;
- unsigned nc;
+ tsk_md5string_t cnonce;
+ unsigned nc;
}
thttp_challenge_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header.h b/tinyHTTP/include/tinyhttp/headers/thttp_header.h
index 0545ebf..055fdb1 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -58,32 +58,30 @@ typedef int (*thttp_header_value_tostring_f)(const struct thttp_header_s* header
*
* @brief List of all supported headers.
**/
-typedef enum thttp_header_type_e
-{
- thttp_htype_Authorization,
- thttp_htype_Content_Length,
- thttp_htype_Content_Type,
- thttp_htype_Dummy,
- thttp_htype_ETag,
- thttp_htype_Proxy_Authenticate,
- thttp_htype_Proxy_Authorization,
- thttp_htype_Sec_WebSocket_Accept,
- thttp_htype_Sec_WebSocket_Protocol,
- thttp_htype_Sec_WebSocket_Key,
- thttp_htype_Sec_WebSocket_Version,
- thttp_htype_Transfer_Encoding,
- thttp_htype_WWW_Authenticate,
+typedef enum thttp_header_type_e {
+ thttp_htype_Authorization,
+ thttp_htype_Content_Length,
+ thttp_htype_Content_Type,
+ thttp_htype_Dummy,
+ thttp_htype_ETag,
+ thttp_htype_Proxy_Authenticate,
+ thttp_htype_Proxy_Authorization,
+ thttp_htype_Sec_WebSocket_Accept,
+ thttp_htype_Sec_WebSocket_Protocol,
+ thttp_htype_Sec_WebSocket_Key,
+ thttp_htype_Sec_WebSocket_Version,
+ thttp_htype_Transfer_Encoding,
+ thttp_htype_WWW_Authenticate,
}
thttp_header_type_t;
/*================================
*/
-typedef struct thttp_header_s
-{
- TSK_DECLARE_OBJECT;
- thttp_header_type_t type;
- thttp_header_value_tostring_f tostring;
- tsk_params_L_t *params;
+typedef struct thttp_header_s {
+ TSK_DECLARE_OBJECT;
+ thttp_header_type_t type;
+ thttp_header_value_tostring_f tostring;
+ tsk_params_L_t *params;
}
thttp_header_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Authorization.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Authorization.h
index 0543b5b..e591990 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Authorization.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Authorization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,23 +43,22 @@ THTTP_BEGIN_DECLS
/// credentials = "Digest" digest-response
/// digest-response = digest-response-value *(COMMA digest-response-value)
/// digest-response-value = ( username / realm / nonce / digest-url / auth-response / [ algorithm ] / [cnonce] / [opaque] / [message-qop] / [nonce-count] / [auth-param] )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_Authorization_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_Authorization_s {
+ THTTP_DECLARE_HEADER;
- char* scheme;
- char* username;
- char* realm;
- char* nonce;
- char* uri;
- char* response;
- char* algorithm;
- char* cnonce;
- char* opaque;
- char* qop;
- char* nc;
+ char* scheme;
+ char* username;
+ char* realm;
+ char* nonce;
+ char* uri;
+ char* response;
+ char* algorithm;
+ char* cnonce;
+ char* opaque;
+ char* qop;
+ char* nc;
}
thttp_header_Authorization_t;
typedef thttp_header_Authorization_t thttp_header_Proxy_Authorization_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Length.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Length.h
index 9d7b4a9..3e87d69 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Length.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Length.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,13 +42,12 @@ THTTP_BEGIN_DECLS
///
/// @par ABNF: Content-Length / l
/// Content-Length = "Content-Length" HCOLON 1*DIGIT
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_Content_Length_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_Content_Length_s {
+ THTTP_DECLARE_HEADER;
- uint32_t length;
+ uint32_t length;
}
thttp_header_Content_Length_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Type.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Type.h
index 17e0d53..51a8a9f 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Type.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Content_Type.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -54,13 +54,12 @@ THTTP_BEGIN_DECLS
/// m-parameter = m-attribute EQUAL m-value
/// m-attribute = token
/// m-value = token / quoted-string
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_Content_Type_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_Content_Type_s {
+ THTTP_DECLARE_HEADER;
- char* type;
+ char* type;
}
thttp_header_Content_Type_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Dummy.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Dummy.h
index 9e5293d..e56e157 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Dummy.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,14 +41,13 @@ THTTP_BEGIN_DECLS
/// HTTP Dummy header.
///
/// @par ABNF : token SP* HCOLON SP*<: any*
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_Dummy_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_Dummy_s {
+ THTTP_DECLARE_HEADER;
- char *name;
- char *value;
+ char *name;
+ char *value;
}
thttp_header_Dummy_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_ETag.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_ETag.h
index 651520b..1c45cc1 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_ETag.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_ETag.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,12 +45,11 @@ THTTP_BEGIN_DECLS
/// weak = "W/"
/// opaque-tag = quoted-string
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_ETag_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_ETag_s {
+ THTTP_DECLARE_HEADER;
- char *value;
- tsk_bool_t isWeak;
+ char *value;
+ tsk_bool_t isWeak;
}
thttp_header_ETag_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Accept.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Accept.h
index b13ab4e..3813a0d 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Accept.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Accept.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,11 +36,10 @@ THTTP_BEGIN_DECLS
#define THTTP_HEADER_SEC_WEBSOCKET_ACCEPT_VA_ARGS(key) thttp_header_Sec_WebSocket_Accept_def_t, (const char*)key
-typedef struct thttp_header_Sec_WebSocket_Accept_s
-{
- THTTP_DECLARE_HEADER;
-
- char *value;
+typedef struct thttp_header_Sec_WebSocket_Accept_s {
+ THTTP_DECLARE_HEADER;
+
+ char *value;
}
thttp_header_Sec_WebSocket_Accept_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Key.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Key.h
index 679551a..42da71e 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Key.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Key.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,11 +36,10 @@ THTTP_BEGIN_DECLS
#define THTTP_HEADER_SEC_WEBSOCKET_KEY_VA_ARGS(key) thttp_header_Sec_WebSocket_Key_def_t, (const char*)key
-typedef struct thttp_header_Sec_WebSocket_Key_s
-{
- THTTP_DECLARE_HEADER;
-
- char *value;
+typedef struct thttp_header_Sec_WebSocket_Key_s {
+ THTTP_DECLARE_HEADER;
+
+ char *value;
}
thttp_header_Sec_WebSocket_Key_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Protocol.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Protocol.h
index c132c66..4fb6732 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Protocol.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Protocol.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,11 +38,10 @@ THTTP_BEGIN_DECLS
#define THTTP_HEADER_SEC_WEBSOCKET_PROTOCOL_VA_ARGS(protocol) thttp_header_Sec_WebSocket_Protocol_def_t, (const char*)protocol
-typedef struct thttp_header_Sec_WebSocket_Protocol_s
-{
- THTTP_DECLARE_HEADER;
-
- tsk_strings_L_t *values;
+typedef struct thttp_header_Sec_WebSocket_Protocol_s {
+ THTTP_DECLARE_HEADER;
+
+ tsk_strings_L_t *values;
}
thttp_header_Sec_WebSocket_Protocol_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Version.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Version.h
index 777d787..32d44bc 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Version.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Sec_WebSocket_Version.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,11 +38,10 @@ THTTP_BEGIN_DECLS
#define THTTP_HEADER_SEC_WEBSOCKET_VERSION_VA_ARGS(version) thttp_header_Sec_WebSocket_Version_def_t, (const char*)version
-typedef struct thttp_header_Sec_WebSocket_Version_s
-{
- THTTP_DECLARE_HEADER;
-
- tsk_strings_L_t *values;
+typedef struct thttp_header_Sec_WebSocket_Version_s {
+ THTTP_DECLARE_HEADER;
+
+ tsk_strings_L_t *values;
}
thttp_header_Sec_WebSocket_Version_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_Transfer_Encoding.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_Transfer_Encoding.h
index 762834e..697b20e 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_Transfer_Encoding.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_Transfer_Encoding.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,13 +47,12 @@ THTTP_BEGIN_DECLS
/// parameter = attribute "=" value
/// attribute = token
/// value = token / quoted-string
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_Transfer_Encoding_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_Transfer_Encoding_s {
+ THTTP_DECLARE_HEADER;
- char* encoding;
+ char* encoding;
}
thttp_header_Transfer_Encoding_t;
diff --git a/tinyHTTP/include/tinyhttp/headers/thttp_header_WWW_Authenticate.h b/tinyHTTP/include/tinyhttp/headers/thttp_header_WWW_Authenticate.h
index f01dc23..604c557 100755
--- a/tinyHTTP/include/tinyhttp/headers/thttp_header_WWW_Authenticate.h
+++ b/tinyHTTP/include/tinyhttp/headers/thttp_header_WWW_Authenticate.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,20 +52,19 @@ THTTP_BEGIN_DECLS
/// stale = "stale" EQUAL ( "true" / "false" )
/// qop-options = "qop" EQUAL LDQUOT qop-value *("," qop-value) RDQUOT
/// qop-value = "auth" / "auth-int" / token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_header_WWW_Authenticate_s
-{
- THTTP_DECLARE_HEADER;
+typedef struct thttp_header_WWW_Authenticate_s {
+ THTTP_DECLARE_HEADER;
- char* scheme;
- char* realm;
- char* domain;
- char* nonce;
- char* opaque;
- tsk_bool_t stale;
- char* algorithm;
- char* qop;
+ char* scheme;
+ char* realm;
+ char* domain;
+ char* nonce;
+ char* opaque;
+ tsk_bool_t stale;
+ char* algorithm;
+ char* qop;
}
thttp_header_WWW_Authenticate_t;
diff --git a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_header.h b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_header.h
index 8162fb9..408e26f 100755
--- a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_header.h
+++ b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_message.h b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_message.h
index 09aad4b..d7b9881 100755
--- a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_message.h
+++ b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_url.h b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_url.h
index 4bfdb99..1064194 100755
--- a/tinyHTTP/include/tinyhttp/parsers/thttp_parser_url.h
+++ b/tinyHTTP/include/tinyhttp/parsers/thttp_parser_url.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyHTTP/include/tinyhttp/thttp_action.h b/tinyHTTP/include/tinyhttp/thttp_action.h
index afc98d6..4773728 100755
--- a/tinyHTTP/include/tinyhttp/thttp_action.h
+++ b/tinyHTTP/include/tinyhttp/thttp_action.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,52 +41,49 @@
THTTP_BEGIN_DECLS
-typedef uint64_t thttp_action_id_t;
+typedef uint64_t thttp_action_id_t;
#define THTTP_ACTION_INVALID_ID 0
#define THTTP_ACTION_INVALID_HANDLE tsk_null
/** List of all supported options.
* To pass an option to the sesion, use @ref THTTP_ACTION_SET_OPTION() macro.
*/
-typedef enum thttp_action_option_e
-{
- THTTP_ACTION_OPTION_TIMEOUT,
+typedef enum thttp_action_option_e {
+ THTTP_ACTION_OPTION_TIMEOUT,
}
thttp_action_option_t;
/** List of actions.
*/
-typedef enum thttp_action_type_e
-{
- /* Outgoing GET, PUT, HEAD, DELETE, .... */
- thttp_atype_o_request,
- /* Incoming message */
- thttp_atype_i_message,
+typedef enum thttp_action_type_e {
+ /* Outgoing GET, PUT, HEAD, DELETE, .... */
+ thttp_atype_o_request,
+ /* Incoming message */
+ thttp_atype_i_message,
- /* common */
- thttp_thttp_atype_closed,
- thttp_atype_error,
- thttp_atype_close,
- thttp_atype_cancel,
- thttp_atype_timedout,
+ /* common */
+ thttp_thttp_atype_closed,
+ thttp_atype_error,
+ thttp_atype_close,
+ thttp_atype_cancel,
+ thttp_atype_timedout,
}
thttp_action_type_t;
-typedef enum thttp_action_param_type_e
-{
- thttp_aptype_null = 0,
+typedef enum thttp_action_param_type_e {
+ thttp_aptype_null = 0,
- thttp_aptype_option,
- thttp_aptype_header,
- thttp_aptype_payload,
+ thttp_aptype_option,
+ thttp_aptype_header,
+ thttp_aptype_payload,
}
thttp_action_param_type_t;
/**@ingroup thttp_action_group
* @def THTTP_ACTION_SET_OPTION
-* Adds or updates an option.
+* Adds or updates an option.
* This is a helper macro for @a thttp_action_*() functions.
* @param ID_ENUM The id of the option to add/update (@ref thttp_action_option_t).
* @param VALUE_STR The new value of the parameter (<i>const char*</i>).
@@ -113,7 +110,7 @@ thttp_action_GET(session, "http://www.doubango.org"
*/
/**@ingroup thttp_action_group
* @def THTTP_ACTION_SET_PAYLOAD
-* Adds a content (or payload) to the request. You should also add a content-type header by using
+* Adds a content (or payload) to the request. You should also add a content-type header by using
* @ref THTTP_ACTION_SET_HEADER() macro. You should not add the content-length header.
* This is a helper macro for @a thttp_action_*() functions.
* @param PAY_PTR A pointer to the payload (<i>const void*</i>).
@@ -124,7 +121,7 @@ thttp_action_PUT(session, "http://www.doubango.org"
THTTP_ACTION_SET_HEADER("Pragma", "No-Cache"),
THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
THTTP_ACTION_SET_HEADER("Content-length", "application/mytype"),
-
+
THTTP_ACTION_SET_PAYLOAD("Salut", 5),
THTTP_ACTION_SET_NULL());
@@ -139,17 +136,16 @@ thttp_action_PUT(session, "http://www.doubango.org"
#define THTTP_ACTION_SET_PAYLOAD(PAY_PTR, PAY_SIZE) thttp_aptype_payload, (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE
#define THTTP_ACTION_SET_NULL() thttp_aptype_null
-typedef struct thttp_action_s
-{
- TSK_DECLARE_OBJECT;
-
- thttp_action_type_t type;
- const char* url;
- const char* method;
-
- tsk_options_L_t *options;
- tsk_params_L_t *headers;
- tsk_buffer_t* payload;
+typedef struct thttp_action_s {
+ TSK_DECLARE_OBJECT;
+
+ thttp_action_type_t type;
+ const char* url;
+ const char* method;
+
+ tsk_options_L_t *options;
+ tsk_params_L_t *headers;
+ tsk_buffer_t* payload;
}
thttp_action_t;
diff --git a/tinyHTTP/include/tinyhttp/thttp_dialog.h b/tinyHTTP/include/tinyhttp/thttp_dialog.h
index f9885ab..bd15f3a 100755
--- a/tinyHTTP/include/tinyhttp/thttp_dialog.h
+++ b/tinyHTTP/include/tinyhttp/thttp_dialog.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,20 +42,19 @@ struct thttp_message_s;
typedef uint64_t thttp_dialog_id_t;
-typedef struct thttp_dialog_s
-{
- TSK_DECLARE_OBJECT;
-
- thttp_dialog_id_t id;
- uint64_t timestamp;
-
- tsk_fsm_t* fsm;
-
- tsk_buffer_t* buf;
-
- struct thttp_session_s* session;
- struct thttp_action_s* action;
- tsk_bool_t answered;
+typedef struct thttp_dialog_s {
+ TSK_DECLARE_OBJECT;
+
+ thttp_dialog_id_t id;
+ uint64_t timestamp;
+
+ tsk_fsm_t* fsm;
+
+ tsk_buffer_t* buf;
+
+ struct thttp_session_s* session;
+ struct thttp_action_s* action;
+ tsk_bool_t answered;
}
thttp_dialog_t;
diff --git a/tinyHTTP/include/tinyhttp/thttp_event.h b/tinyHTTP/include/tinyhttp/thttp_event.h
index 9c57b97..4f885cb 100755
--- a/tinyHTTP/include/tinyhttp/thttp_event.h
+++ b/tinyHTTP/include/tinyhttp/thttp_event.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,27 +40,25 @@ THTTP_BEGIN_DECLS
#define THTTP_EVENT(self) ((thttp_event_t*)(self))
-typedef enum thttp_event_type_e
-{
- thttp_event_dialog_started,
- thttp_event_message,
- thttp_event_auth_failed,
- thttp_event_closed,
- thttp_event_transport_error,
- thttp_event_dialog_terminated
+typedef enum thttp_event_type_e {
+ thttp_event_dialog_started,
+ thttp_event_message,
+ thttp_event_auth_failed,
+ thttp_event_closed,
+ thttp_event_transport_error,
+ thttp_event_dialog_terminated
}
thttp_event_type_t;
-typedef struct thttp_event_s
-{
- TSK_DECLARE_OBJECT;
-
- thttp_event_type_t type;
- const thttp_session_handle_t* session;
-
- char* description;
-
- struct thttp_message_s *message;
+typedef struct thttp_event_s {
+ TSK_DECLARE_OBJECT;
+
+ thttp_event_type_t type;
+ const thttp_session_handle_t* session;
+
+ char* description;
+
+ struct thttp_message_s *message;
}
thttp_event_t;
diff --git a/tinyHTTP/include/tinyhttp/thttp_message.h b/tinyHTTP/include/tinyhttp/thttp_message.h
index 4f9d1e5..8bfc5c0 100755
--- a/tinyHTTP/include/tinyhttp/thttp_message.h
+++ b/tinyHTTP/include/tinyhttp/thttp_message.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -166,45 +166,43 @@ THTTP_BEGIN_DECLS
#define THTTP_RESPONSE_IS_6XX(self) THTTP_RESPONSE_IS_NXX(self, 6)
#define THTTP_RESPONSE_IS_23456(self) (200<= THTTP_RESPONSE_CODE((self)) && THTTP_RESPONSE_CODE((self)) <= 699)
-/**Defines the message type (Request or Response).
+/**Defines the message type (Request or Response).
**/
-typedef enum thttp_message_type_e
-{
- thttp_unknown,
- thttp_request,
- thttp_response
+typedef enum thttp_message_type_e {
+ thttp_unknown,
+ thttp_request,
+ thttp_response
}
thttp_message_type_t;
/**Represents a HTTP message. A HTTP message is either a request from a client to a server,
* or a response from a server to a client.
**/
-typedef struct thttp_message_s
-{
- TSK_DECLARE_OBJECT;
-
- char *http_version; /**< The HTTP version. Only 'HTTP/1.1' is supported. */
- thttp_message_type_t type; /**< The type of this HTTP message. */
-
- /* Request-Line */
- union{
- struct{
- char *method;
- thttp_url_t *url;
- } request;
- struct{
- short status_code;
- char *reason_phrase;
- } response;
- } line;
-
- /*== MOST COMMON HEADERS. */
- thttp_header_Content_Type_t *Content_Type;
- thttp_header_Content_Length_t *Content_Length;
- tsk_buffer_t *Content;
-
- /*== OTHER HEADERS*/
- thttp_headers_L_t *headers;
+typedef struct thttp_message_s {
+ TSK_DECLARE_OBJECT;
+
+ char *http_version; /**< The HTTP version. Only 'HTTP/1.1' is supported. */
+ thttp_message_type_t type; /**< The type of this HTTP message. */
+
+ /* Request-Line */
+ union {
+ struct {
+ char *method;
+ thttp_url_t *url;
+ } request;
+ struct {
+ short status_code;
+ char *reason_phrase;
+ } response;
+ } line;
+
+ /*== MOST COMMON HEADERS. */
+ thttp_header_Content_Type_t *Content_Type;
+ thttp_header_Content_Length_t *Content_Length;
+ tsk_buffer_t *Content;
+
+ /*== OTHER HEADERS*/
+ thttp_headers_L_t *headers;
}
thttp_message_t;
@@ -220,19 +218,19 @@ TINYHTTP_API int thttp_message_append_content(thttp_message_t *self, const void*
#if defined(__SYMBIAN32__) && 0
static void THTTP_MESSAGE_ADD_HEADER(thttp_message_t *self, ...)
- {
- va_list ap;
- thttp_header_t *header;
- const tsk_object_def_t *objdef;
-
- va_start(ap, self);
- objdef = va_arg(ap, const tsk_object_def_t*);
- header = tsk_object_new_2(objdef, &ap);
- va_end(ap);
-
- thttp_message_add_header(self, header);
- tsk_object_unref(header);
- }
+{
+ va_list ap;
+ thttp_header_t *header;
+ const tsk_object_def_t *objdef;
+
+ va_start(ap, self);
+ objdef = va_arg(ap, const tsk_object_def_t*);
+ header = tsk_object_new_2(objdef, &ap);
+ va_end(ap);
+
+ thttp_message_add_header(self, header);
+ tsk_object_unref(header);
+}
#else
#define THTTP_MESSAGE_ADD_HEADER(self, objdef, ...) \
{ \
diff --git a/tinyHTTP/include/tinyhttp/thttp_session.h b/tinyHTTP/include/tinyhttp/thttp_session.h
index 3d740e5..b61fe5f 100755
--- a/tinyHTTP/include/tinyhttp/thttp_session.h
+++ b/tinyHTTP/include/tinyhttp/thttp_session.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,35 +44,33 @@ THTTP_BEGIN_DECLS
//FD
struct thttp_message_s;
-typedef uint64_t thttp_session_id_t;
+typedef uint64_t thttp_session_id_t;
#define THTTP_SESSION_INVALID_ID 0
#define THTTP_SESSION_INVALID_HANDLE tsk_null
/** List of all supported options.
* To pass an option to the sesion, use @ref THTTP_SESSION_SET_OPTION() macro.
*/
-typedef enum thttp_session_option_e
-{
- THTTP_SESSION_OPTION_TIMEOUT,
- THTTP_SESSION_OPTION_TTL,
- // To be continued...
+typedef enum thttp_session_option_e {
+ THTTP_SESSION_OPTION_TIMEOUT,
+ THTTP_SESSION_OPTION_TTL,
+ // To be continued...
}
thttp_session_option_t;
-typedef enum thttp_session_param_type_e
-{
- httpp_null = 0,
+typedef enum thttp_session_param_type_e {
+ httpp_null = 0,
- httpp_option,
- httpp_cred,
- httpp_header,
- httpp_userdata,
+ httpp_option,
+ httpp_cred,
+ httpp_header,
+ httpp_userdata,
}
thttp_session_param_type_t;
/**@ingroup thttp_session_group
* @def THTTP_SESSION_SET_OPTION
-* Adds or updates an option.
+* Adds or updates an option.
* This is a helper macro for @ref thttp_session_create and @ref thttp_session_set.
* @param ID_ENUM The id of the option to add/update (@ref thttp_session_option_t).
* @param VALUE_STR The new value of the option (<i>const char*</i>).
@@ -153,27 +151,26 @@ thttp_session_set(session,
#define THTTP_SESSION_SET_USERDATA(USERDATA_PTR) httpp_userdata, (const void*)USERDATA_PTR
#define THTTP_SESSION_SET_NULL() httpp_null
-typedef struct thttp_session_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct thttp_session_s {
+ TSK_DECLARE_OBJECT;
- thttp_session_id_t id;
- const struct thttp_stack_s* stack;
- const void* userdata; // user's context
- tsk_options_L_t *options;
- tsk_params_L_t *headers;
+ thttp_session_id_t id;
+ const struct thttp_stack_s* stack;
+ const void* userdata; // user's context
+ tsk_options_L_t *options;
+ tsk_params_L_t *headers;
- tnet_fd_t fd;
+ tnet_fd_t fd;
- thttp_challenges_L_t *challenges;
- thttp_dialogs_L_t* dialogs;
+ thttp_challenges_L_t *challenges;
+ thttp_dialogs_L_t* dialogs;
- struct{
- char* usename;
- char* password;
- }cred;
+ struct {
+ char* usename;
+ char* password;
+ } cred;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
thttp_session_t;
diff --git a/tinyHTTP/include/tinyhttp/thttp_url.h b/tinyHTTP/include/tinyhttp/thttp_url.h
index 802f84d..8f93fc2 100755
--- a/tinyHTTP/include/tinyhttp/thttp_url.h
+++ b/tinyHTTP/include/tinyhttp/thttp_url.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,20 +37,18 @@ THTTP_BEGIN_DECLS
/** Url type.
*/
-typedef enum thttp_url_type_e
-{
- thttp_url_unknown,
- thttp_url_http,
- thttp_url_https,
+typedef enum thttp_url_type_e {
+ thttp_url_unknown,
+ thttp_url_http,
+ thttp_url_https,
}
thttp_url_type_t;
-typedef enum thttp_host_type_e
-{
- thttp_host_unknown,
- thttp_host_hostname,
- thttp_host_ipv4,
- thttp_host_ipv6
+typedef enum thttp_host_type_e {
+ thttp_host_unknown,
+ thttp_host_hostname,
+ thttp_host_ipv4,
+ thttp_host_ipv6
}
thttp_host_type_t;
@@ -64,17 +62,16 @@ thttp_host_type_t;
/// hsegment = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
/// search = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct thttp_url_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct thttp_url_s {
+ TSK_DECLARE_OBJECT;
- thttp_url_type_t type;
- char *scheme;
- char *host; /**< Host name. Hostname or IPv4address or IPv6address. */
- char *hpath;
- char *search;
- thttp_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
- uint16_t port;
+ thttp_url_type_t type;
+ char *scheme;
+ char *host; /**< Host name. Hostname or IPv4address or IPv6address. */
+ char *hpath;
+ char *search;
+ thttp_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
+ uint16_t port;
}
thttp_url_t;
diff --git a/tinyHTTP/include/tinyhttp_config.h b/tinyHTTP/include/tinyhttp_config.h
index bd2a743..5b9d874 100755
--- a/tinyHTTP/include/tinyhttp_config.h
+++ b/tinyHTTP/include/tinyhttp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -62,13 +62,13 @@
# define TINYHTTP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define THTTP_BEGIN_DECLS extern "C" {
# define THTTP_END_DECLS }
#else
-# define THTTP_BEGIN_DECLS
+# define THTTP_BEGIN_DECLS
# define THTTP_END_DECLS
#endif
@@ -92,7 +92,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYHTTP_CONFIG_H
diff --git a/tinyHTTP/src/auth/thttp_auth.c b/tinyHTTP/src/auth/thttp_auth.c
index 9ca96ee..ea32b52 100755
--- a/tinyHTTP/src/auth/thttp_auth.c
+++ b/tinyHTTP/src/auth/thttp_auth.c
@@ -46,21 +46,21 @@
**/
tsk_size_t thttp_auth_basic_response(const char* userid, const char* password, char** response)
{
- tsk_size_t ret;
+ tsk_size_t ret;
- /* RFC 2617 - 2 Basic Authentication Scheme
+ /* RFC 2617 - 2 Basic Authentication Scheme
- To receive authorization, the client sends the userid and password,
- separated by a single colon (":") character, within a base64 [7]
- encoded string in the credentials.
- */
+ To receive authorization, the client sends the userid and password,
+ separated by a single colon (":") character, within a base64 [7]
+ encoded string in the credentials.
+ */
- char *res = 0;
- tsk_sprintf(&res, "%s:%s", userid, password);
- ret = tsk_base64_encode((const uint8_t*)res, tsk_strlen(res), response);
- TSK_FREE(res);
+ char *res = 0;
+ tsk_sprintf(&res, "%s:%s", userid, password);
+ ret = tsk_base64_encode((const uint8_t*)res, tsk_strlen(res), response);
+ TSK_FREE(res);
- return ret;
+ return ret;
}
@@ -77,17 +77,17 @@ tsk_size_t thttp_auth_basic_response(const char* userid, const char* password, c
**/
int thttp_auth_digest_HA1(const char* username, const char* realm, const char* password, tsk_md5string_t* ha1)
{
- int ret;
+ int ret;
- /* RFC 2617 - 3.2.2.2 A1
- A1 = unq(username-value) ":" unq(realm-value) ":" passwd
- */
- char *a1 = tsk_null;
- tsk_sprintf(&a1, "%s:%s:%s", username, realm, password);
- ret = tsk_md5compute(a1, tsk_strlen(a1), ha1);
- TSK_FREE(a1);
+ /* RFC 2617 - 3.2.2.2 A1
+ A1 = unq(username-value) ":" unq(realm-value) ":" passwd
+ */
+ char *a1 = tsk_null;
+ tsk_sprintf(&a1, "%s:%s:%s", username, realm, password);
+ ret = tsk_md5compute(a1, tsk_strlen(a1), ha1);
+ TSK_FREE(a1);
- return ret;
+ return ret;
}
/**@ingroup thttp_auth_group
@@ -106,20 +106,20 @@ int thttp_auth_digest_HA1(const char* username, const char* realm, const char* p
**/
int thttp_auth_digest_HA1sess(const char* username, const char* realm, const char* password, const char* nonce, const char* cnonce, tsk_md5string_t* ha1sess)
{
- int ret;
+ int ret;
- /* RFC 2617 - 3.2.2.2 A1
- A1 = H( unq(username-value) ":" unq(realm-value)
- ":" passwd )
- ":" unq(nonce-value) ":" unq(cnonce-value)
- */
+ /* RFC 2617 - 3.2.2.2 A1
+ A1 = H( unq(username-value) ":" unq(realm-value)
+ ":" passwd )
+ ":" unq(nonce-value) ":" unq(cnonce-value)
+ */
- char *a1sess = tsk_null;
- tsk_sprintf(&a1sess, "%s:%s:%s:%s:%s", username, realm, password, nonce, cnonce);
- ret = tsk_md5compute(a1sess, tsk_strlen(a1sess), ha1sess);
- TSK_FREE(a1sess);
+ char *a1sess = tsk_null;
+ tsk_sprintf(&a1sess, "%s:%s:%s:%s:%s", username, realm, password, nonce, cnonce);
+ ret = tsk_md5compute(a1sess, tsk_strlen(a1sess), ha1sess);
+ TSK_FREE(a1sess);
- return ret;
+ return ret;
}
/**@ingroup thttp_auth_group
@@ -136,42 +136,41 @@ int thttp_auth_digest_HA1sess(const char* username, const char* realm, const cha
**/
int thttp_auth_digest_HA2(const char* method, const char* url, const tsk_buffer_t* entity_body, const char* qop, tsk_md5string_t* ha2)
{
- int ret;
- /* RFC 2617 - 3.2.2.3 A2
-
- If the "qop" directive's value is "auth" or is unspecified, then A2
- is:
- A2 = Method ":" digest-url-value
-
- If the "qop" value is "auth-int", then A2 is:
- A2 = Method ":" digest-url-value ":" H(entity-body)
- */
-
- char *a2 = tsk_null;
-
- if (!qop || tsk_strempty(qop) || tsk_striequals(qop, "auth")){
- tsk_sprintf(&a2, "%s:%s", method, url);
- }
- else if (tsk_striequals(qop, "auth-int"))
- {
- if (entity_body && entity_body->data && entity_body->size){
- tsk_md5string_t hEntity;
- if ((ret = tsk_md5compute(entity_body->data, entity_body->size, &hEntity))){
- goto bail;
- }
- tsk_sprintf(&a2, "%s:%s:%s", method, url, hEntity);
- }
- else{
- tsk_sprintf(&a2, "%s:%s:%s", method, url, TSK_MD5_EMPTY);
- }
- }
-
- ret = tsk_md5compute(a2, tsk_strlen(a2), ha2);
+ int ret;
+ /* RFC 2617 - 3.2.2.3 A2
+
+ If the "qop" directive's value is "auth" or is unspecified, then A2
+ is:
+ A2 = Method ":" digest-url-value
+
+ If the "qop" value is "auth-int", then A2 is:
+ A2 = Method ":" digest-url-value ":" H(entity-body)
+ */
+
+ char *a2 = tsk_null;
+
+ if (!qop || tsk_strempty(qop) || tsk_striequals(qop, "auth")) {
+ tsk_sprintf(&a2, "%s:%s", method, url);
+ }
+ else if (tsk_striequals(qop, "auth-int")) {
+ if (entity_body && entity_body->data && entity_body->size) {
+ tsk_md5string_t hEntity;
+ if ((ret = tsk_md5compute(entity_body->data, entity_body->size, &hEntity))) {
+ goto bail;
+ }
+ tsk_sprintf(&a2, "%s:%s:%s", method, url, hEntity);
+ }
+ else {
+ tsk_sprintf(&a2, "%s:%s:%s", method, url, TSK_MD5_EMPTY);
+ }
+ }
+
+ ret = tsk_md5compute(a2, tsk_strlen(a2), ha2);
bail:
- TSK_FREE(a2);
+ TSK_FREE(a2);
- return ret;
+ return ret;
}
@@ -190,43 +189,43 @@ bail:
* @return Zero if succeed and non-zero error code otherwise.
**/
int thttp_auth_digest_response(const tsk_md5string_t *ha1, const char* nonce, const nonce_count_t noncecount, const char* cnonce,
- const char* qop, const tsk_md5string_t* ha2, tsk_md5string_t* response)
+ const char* qop, const tsk_md5string_t* ha2, tsk_md5string_t* response)
{
- int ret;
-
- /* RFC 2617 3.2.2.1 Request-Digest
-
- ============ CASE 1 ============
- If the "qop" value is "auth" or "auth-int":
- request-digest = <"> < KD ( H(A1), unq(nonce-value)
- ":" nc-value
- ":" unq(cnonce-value)
- ":" unq(qop-value)
- ":" H(A2)
- ) <">
- ============ CASE 2 ============
- If the "qop" directive is not present (this construction is for
- compatibility with RFC 2069):
- request-digest =
- <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) >
- <">
- */
-
- char *res = tsk_null;
-
- if (tsk_striequals(qop, "auth") || tsk_striequals(qop, "auth-int")){
- /* CASE 1 */
- tsk_sprintf(&res, "%s:%s:%s:%s:%s:%s", *ha1, nonce, noncecount, cnonce, qop, *ha2);
- }
- else{
- /* CASE 2 */
- tsk_sprintf(&res, "%s:%s:%s", *ha1, nonce, *ha2);
- }
-
- ret = tsk_md5compute(res, tsk_strlen(res), response);
- TSK_FREE(res);
-
- return ret;
+ int ret;
+
+ /* RFC 2617 3.2.2.1 Request-Digest
+
+ ============ CASE 1 ============
+ If the "qop" value is "auth" or "auth-int":
+ request-digest = <"> < KD ( H(A1), unq(nonce-value)
+ ":" nc-value
+ ":" unq(cnonce-value)
+ ":" unq(qop-value)
+ ":" H(A2)
+ ) <">
+ ============ CASE 2 ============
+ If the "qop" directive is not present (this construction is for
+ compatibility with RFC 2069):
+ request-digest =
+ <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) >
+ <">
+ */
+
+ char *res = tsk_null;
+
+ if (tsk_striequals(qop, "auth") || tsk_striequals(qop, "auth-int")) {
+ /* CASE 1 */
+ tsk_sprintf(&res, "%s:%s:%s:%s:%s:%s", *ha1, nonce, noncecount, cnonce, qop, *ha2);
+ }
+ else {
+ /* CASE 2 */
+ tsk_sprintf(&res, "%s:%s:%s", *ha1, nonce, *ha2);
+ }
+
+ ret = tsk_md5compute(res, tsk_strlen(res), response);
+ TSK_FREE(res);
+
+ return ret;
}
/**@ingroup thttp_auth_group
@@ -239,28 +238,28 @@ int thttp_auth_digest_response(const tsk_md5string_t *ha1, const char* nonce, co
*/
tsk_size_t thttp_auth_ws_response(const char* key, thttp_auth_ws_keystring_t* response)
{
- if (!key || !response){
- TSK_DEBUG_ERROR("invalid parameter");
- return 0;
- }
- else{
- tsk_sha1string_t sha1result;
- char* tmp = tsk_null;
- long ret;
- tsk_size_t size, i;
- uint8_t result[21] = { 0 };
-
- tsk_strcat_2(&tmp, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", key);
-
- tsk_sha1compute(tmp, tsk_strlen(tmp), &sha1result);
- size = tsk_strlen((char*)sha1result);
- for (i = 0; i < size; i += 2){
- if (sscanf((const char*)&sha1result[i], "%2x", (unsigned int*)&ret) != EOF){
- ;
- result[i >> 1] = (char)ret;
- }
- }
- TSK_FREE(tmp);
- return tsk_base64_encode(result, (size >> 1), (char**)&response);
- }
+ if (!key || !response) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return 0;
+ }
+ else {
+ tsk_sha1string_t sha1result;
+ char* tmp = tsk_null;
+ long ret;
+ tsk_size_t size, i;
+ uint8_t result[21] = { 0 };
+
+ tsk_strcat_2(&tmp, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", key);
+
+ tsk_sha1compute(tmp, tsk_strlen(tmp), &sha1result);
+ size = tsk_strlen((char*)sha1result);
+ for (i = 0; i < size; i += 2) {
+ if (sscanf((const char*)&sha1result[i], "%2x", (unsigned int*)&ret) != EOF) {
+ ;
+ result[i >> 1] = (char)ret;
+ }
+ }
+ TSK_FREE(tmp);
+ return tsk_base64_encode(result, (size >> 1), (char**)&response);
+ }
}
diff --git a/tinyHTTP/src/auth/thttp_challenge.c b/tinyHTTP/src/auth/thttp_challenge.c
index 649a393..0963b23 100755
--- a/tinyHTTP/src/auth/thttp_challenge.c
+++ b/tinyHTTP/src/auth/thttp_challenge.c
@@ -46,19 +46,19 @@ thttp_challenge_t* thttp_challenge_create(tsk_bool_t isproxy, const char* scheme
{
thttp_challenge_t* challenge = tsk_object_new(thttp_challenge_def_t);
if (challenge) {
-
+
challenge->isproxy = isproxy;
challenge->scheme = tsk_strdup(scheme);
challenge->realm = tsk_strdup(realm);
challenge->nonce = tsk_strdup(nonce);
challenge->opaque = tsk_strdup(opaque);
challenge->algorithm = tsk_strdup(algorithm);
-
+
if (!tsk_strnullORempty(qop)) {
challenge->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
- (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
+ (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
}
-
+
if (challenge->qop) {
_thttp_challenge_reset_cnonce(challenge);
}
@@ -77,15 +77,13 @@ thttp_challenge_t* thttp_challenge_dup(const thttp_challenge_t* self)
static int _thttp_challenge_reset_cnonce(thttp_challenge_t *self)
{
- if (self)
- {
- if (self->qop) /* client nonce is only used if qop=auth, auth-int or both */
- {
+ if (self) {
+ if (self->qop) { /* client nonce is only used if qop=auth, auth-int or both */
#if 0
memcpy(self->cnonce, "f221681c1e42fb5f8f9957bf7e72eb2b", 32);
#else
tsk_istr_t istr;
-
+
tsk_strrandom(&istr);
tsk_md5compute(istr, tsk_strlen(istr), &self->cnonce);
#endif
@@ -97,15 +95,15 @@ static int _thttp_challenge_reset_cnonce(thttp_challenge_t *self)
int thttp_challenge_get_digest_response(thttp_challenge_t *self, const char* username, const char* password, const char* method, const char* uristring, const tsk_buffer_t* entity_body, char** response)
{
- if (THTTP_CHALLENGE_IS_DIGEST(self)){
+ if (THTTP_CHALLENGE_IS_DIGEST(self)) {
tsk_md5string_t ha1, ha2, md5_response;
nonce_count_t nc;
-
+
/* ===
Calculate HA1 = MD5(A1) = M5(username:realm:secret)
*/
thttp_auth_digest_HA1(username, self->realm, password, &ha1);
-
+
/* ===
HA2
*/
@@ -114,9 +112,9 @@ int thttp_challenge_get_digest_response(thttp_challenge_t *self, const char* use
entity_body,
self->qop,
&ha2);
-
+
/* RESPONSE */
- if (self->nc){
+ if (self->nc) {
THTTP_NCOUNT_2_STRING(self->nc, nc);
}
thttp_auth_digest_response((const tsk_md5string_t *)&ha1,
@@ -126,14 +124,14 @@ int thttp_challenge_get_digest_response(thttp_challenge_t *self, const char* use
self->qop,
(const tsk_md5string_t *)&ha2,
&md5_response);
-
- if (self->qop){
+
+ if (self->qop) {
self->nc++;
}
- if (response && !*response){
+ if (response && !*response) {
*response = tsk_strdup(md5_response);
}
-
+
return 0;
}
return -1;
@@ -143,7 +141,7 @@ int thttp_challenge_update(thttp_challenge_t *self, const char* scheme, const ch
{
if (self) {
int noncechanged = !tsk_striequals(self->nonce, nonce);
-
+
tsk_strupdate(&self->scheme, scheme);
tsk_strupdate(&self->realm, realm);
tsk_strupdate(&self->nonce, nonce);
@@ -151,9 +149,9 @@ int thttp_challenge_update(thttp_challenge_t *self, const char* scheme, const ch
tsk_strupdate(&self->algorithm, algorithm);
if (qop) {
self->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
- (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
+ (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
}
-
+
if (noncechanged && self->qop) {
_thttp_challenge_reset_cnonce(self);
}
@@ -166,12 +164,12 @@ thttp_header_t *thttp_challenge_create_header_authorization(thttp_challenge_t *s
{
char *uristring = tsk_null;
thttp_header_t *header = tsk_null;
-
+
if (!self || !request || !request->line.request.url) {
TSK_DEBUG_ERROR("Invalid parameter");
goto bail;
}
-
+
/* Sets URI: hpath do not start with / ==> append a '/'*/
tsk_sprintf(&uristring, "/%s", request->line.request.url->hpath ? request->line.request.url->hpath : "");
header = thttp_challenge_create_header_authorization_2(self, username, password, request->line.request.method, uristring, request->Content);
@@ -186,20 +184,20 @@ thttp_header_t *thttp_challenge_create_header_authorization_2(thttp_challenge_t
tsk_size_t response_size = 0;
nonce_count_t nc;
thttp_header_t *header = tsk_null;
-
+
if (!self || tsk_strnullORempty(uristring)) {
TSK_DEBUG_ERROR("Invalid parameter");
goto bail;
}
-
+
/* We compute the nc here because @ref thttp_challenge_get_response function will increment it's value. */
if (self->nc) {
THTTP_NCOUNT_2_STRING(self->nc, nc);
}
-
+
/* Computes the response (Basic and Digest)*/
if (THTTP_CHALLENGE_IS_DIGEST(self)) {
- if (thttp_challenge_get_digest_response(self, username, password, method, uristring, entity_body, &response)){
+ if (thttp_challenge_get_digest_response(self, username, password, method, uristring, entity_body, &response)) {
goto bail;
}
response_size = (TSK_MD5_DIGEST_SIZE * 2);
@@ -211,8 +209,8 @@ thttp_header_t *thttp_challenge_create_header_authorization_2(thttp_challenge_t
TSK_DEBUG_ERROR("%s not supported as scheme.", self->scheme);
goto bail;
}
-
-
+
+
#define THTTP_AUTH_COPY_VALUES(hdr) \
hdr->username = tsk_strdup(username); \
hdr->scheme = tsk_strdup(self->scheme); \
@@ -225,25 +223,25 @@ hdr->cnonce = self->nc? tsk_strdup(self->cnonce) : 0; \
hdr->uri = tsk_strdup(uristring); \
hdr->nc = self->nc? tsk_strdup(nc) : 0; \
hdr->response = tsk_strndup(response, response_size); \
-
+
if (self->isproxy) {
thttp_header_Proxy_Authorization_t *proxy_auth = thttp_header_authorization_create(); // Very bad way to create Proxy_auth header.
THTTP_HEADER(proxy_auth)->type = thttp_htype_Proxy_Authorization;
-
+
THTTP_AUTH_COPY_VALUES(proxy_auth);
header = THTTP_HEADER(proxy_auth);
}
- else{
+ else {
thttp_header_Authorization_t *auth = thttp_header_authorization_create();
THTTP_AUTH_COPY_VALUES(auth);
header = THTTP_HEADER(auth);
}
-
+
bail:
TSK_FREE(response);
-
+
return header;
-
+
#undef THTTP_AUTH_COPY_VALUES
}
@@ -279,9 +277,9 @@ static tsk_object_t* thttp_challenge_ctor(tsk_object_t *self, va_list * app)
{
thttp_challenge_t *challenge = self;
if (challenge) {
-
+
}
-
+
return self;
}
@@ -290,24 +288,23 @@ static tsk_object_t* thttp_challenge_ctor(tsk_object_t *self, va_list * app)
static tsk_object_t* thttp_challenge_dtor(tsk_object_t *self)
{
thttp_challenge_t *challenge = self;
- if (challenge){
+ if (challenge) {
TSK_FREE(challenge->scheme);
TSK_FREE(challenge->realm);
TSK_FREE(challenge->nonce);
TSK_FREE(challenge->opaque);
TSK_FREE(challenge->algorithm);
-
+
//TSK_FREE(challenge->qop);
}
- else{
+ else {
TSK_DEBUG_ERROR("Null HTTP challenge object.");
}
-
+
return self;
}
-static const tsk_object_def_t thttp_challenge_def_s =
-{
+static const tsk_object_def_t thttp_challenge_def_s = {
sizeof(thttp_challenge_t),
thttp_challenge_ctor,
thttp_challenge_dtor,
diff --git a/tinyHTTP/src/headers/thttp_header.c b/tinyHTTP/src/headers/thttp_header.c
index a3ab442..9fa9cab 100755
--- a/tinyHTTP/src/headers/thttp_header.c
+++ b/tinyHTTP/src/headers/thttp_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,121 +36,130 @@
const char *thttp_header_get_name(thttp_header_type_t type)
{
- switch(type)
- {
- case thttp_htype_Authorization: return "Authorization";
- case thttp_htype_Content_Length: return "Content-Length";
- case thttp_htype_Content_Type: return "Content-Type";
- case thttp_htype_ETag: return "ETag";
- case thttp_htype_Proxy_Authenticate: return "Proxy-Authenticate";
- case thttp_htype_Proxy_Authorization: return "Proxy-Authorization";
- case thttp_htype_Transfer_Encoding: return "Transfer-Encoding";
- case thttp_htype_WWW_Authenticate: return "WWW-Authenticate";
- case thttp_htype_Sec_WebSocket_Accept: return "Sec-WebSocket-Accept";
- case thttp_htype_Sec_WebSocket_Protocol: return "Sec-WebSocket-Protocol";
- case thttp_htype_Sec_WebSocket_Key: return "Sec-WebSocket-Key";
- case thttp_htype_Sec_WebSocket_Version: return "Sec-WebSocket-Version";
-
- default: return "unknown-header";
- }
+ switch(type) {
+ case thttp_htype_Authorization:
+ return "Authorization";
+ case thttp_htype_Content_Length:
+ return "Content-Length";
+ case thttp_htype_Content_Type:
+ return "Content-Type";
+ case thttp_htype_ETag:
+ return "ETag";
+ case thttp_htype_Proxy_Authenticate:
+ return "Proxy-Authenticate";
+ case thttp_htype_Proxy_Authorization:
+ return "Proxy-Authorization";
+ case thttp_htype_Transfer_Encoding:
+ return "Transfer-Encoding";
+ case thttp_htype_WWW_Authenticate:
+ return "WWW-Authenticate";
+ case thttp_htype_Sec_WebSocket_Accept:
+ return "Sec-WebSocket-Accept";
+ case thttp_htype_Sec_WebSocket_Protocol:
+ return "Sec-WebSocket-Protocol";
+ case thttp_htype_Sec_WebSocket_Key:
+ return "Sec-WebSocket-Key";
+ case thttp_htype_Sec_WebSocket_Version:
+ return "Sec-WebSocket-Version";
+
+ default:
+ return "unknown-header";
+ }
}
const char *thttp_header_get_nameex(const thttp_header_t *self)
{
- if(self){
- if(self->type == thttp_htype_Dummy){
- return ((thttp_header_Dummy_t*)self)->name;
- }
- else{
- return thttp_header_get_name(self->type);
- }
- }
- return "unknown-header";
+ if(self) {
+ if(self->type == thttp_htype_Dummy) {
+ return ((thttp_header_Dummy_t*)self)->name;
+ }
+ else {
+ return thttp_header_get_name(self->type);
+ }
+ }
+ return "unknown-header";
}
char thttp_header_get_param_separator(const thttp_header_t *self)
{
- if(self)
- {
- switch(self->type)
- {
- case thttp_htype_Authorization:
- case thttp_htype_Proxy_Authorization:
- case thttp_htype_Proxy_Authenticate:
- case thttp_htype_WWW_Authenticate:
- return ',';
- default:
- return ';';
- }
- }
- return 0;
+ if(self) {
+ switch(self->type) {
+ case thttp_htype_Authorization:
+ case thttp_htype_Proxy_Authorization:
+ case thttp_htype_Proxy_Authenticate:
+ case thttp_htype_WWW_Authenticate:
+ return ',';
+ default:
+ return ';';
+ }
+ }
+ return 0;
}
/**@ingroup thttp_header_group
*/
int thttp_header_serialize(const thttp_header_t *self, tsk_buffer_t *output)
{
- int ret = -1;
- static const char* hname;
- static char separator;
-
- if(self && THTTP_HEADER(self)->tostring)
- {
- tsk_list_item_t *item;
-
- hname = thttp_header_get_nameex(self);
- ret = 0; // for empty lists
-
- /* Header name */
- tsk_buffer_append_2(output, "%s: ", hname);
-
- /* Header value.*/
- if((ret = THTTP_HEADER(self)->tostring(self, output))){
- // CHECK all headers return value!
- //return ret;
- }
-
- /* Parameters */
- tsk_list_foreach(item, self->params){
- tsk_param_t* param = item->data;
- separator = thttp_header_get_param_separator(self);
- if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))){
- return ret;
- }
- }
-
- /* CRLF */
- tsk_buffer_append(output, "\r\n", 2);
- }
- return ret;
+ int ret = -1;
+ static const char* hname;
+ static char separator;
+
+ if(self && THTTP_HEADER(self)->tostring) {
+ tsk_list_item_t *item;
+
+ hname = thttp_header_get_nameex(self);
+ ret = 0; // for empty lists
+
+ /* Header name */
+ tsk_buffer_append_2(output, "%s: ", hname);
+
+ /* Header value.*/
+ if((ret = THTTP_HEADER(self)->tostring(self, output))) {
+ // CHECK all headers return value!
+ //return ret;
+ }
+
+ /* Parameters */
+ tsk_list_foreach(item, self->params) {
+ tsk_param_t* param = item->data;
+ separator = thttp_header_get_param_separator(self);
+ if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))) {
+ return ret;
+ }
+ }
+
+ /* CRLF */
+ tsk_buffer_append(output, "\r\n", 2);
+ }
+ return ret;
}
/**@ingroup thttp_header_group
*/
char* thttp_header_tostring(const thttp_header_t *self)
{
- tsk_buffer_t *output = tsk_buffer_create_null();
- char* ret = tsk_null;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ char* ret = tsk_null;
- if(!thttp_header_serialize(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
+ if(!thttp_header_serialize(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
/**@ingroup thttp_header_group
*/
char* thttp_header_value_tostring(const thttp_header_t *self)
{
- tsk_buffer_t *output = tsk_buffer_create_null();
- char* ret = tsk_null;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ char* ret = tsk_null;
- if(!self->tostring(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
+ if(!self->tostring(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
diff --git a/tinyHTTP/src/headers/thttp_header_Authorization.c b/tinyHTTP/src/headers/thttp_header_Authorization.c
index 78c4834..b34805d 100755
--- a/tinyHTTP/src/headers/thttp_header_Authorization.c
+++ b/tinyHTTP/src/headers/thttp_header_Authorization.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Authorization.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,6888 +42,6897 @@
thttp_header_Authorization_t* thttp_header_authorization_create()
{
- return tsk_object_new(thttp_header_Authorization_def_t);
+ return tsk_object_new(thttp_header_Authorization_def_t);
}
int thttp_header_Authorization_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const thttp_header_Authorization_t *Authorization = (const thttp_header_Authorization_t*)header;
- if(Authorization && Authorization->scheme)
- {
- if(tsk_striequals(Authorization->scheme, "Basic")){
- return tsk_buffer_append_2(output, "%s %s",
- Authorization->scheme, Authorization->response);
- }
- else{
- return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- Authorization->scheme,
+ if(header) {
+ const thttp_header_Authorization_t *Authorization = (const thttp_header_Authorization_t*)header;
+ if(Authorization && Authorization->scheme) {
+ if(tsk_striequals(Authorization->scheme, "Basic")) {
+ return tsk_buffer_append_2(output, "%s %s",
+ Authorization->scheme, Authorization->response);
+ }
+ else {
+ return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ Authorization->scheme,
- Authorization->username ? "username=\"" : "",
- Authorization->username ? Authorization->username : "",
- Authorization->username ? "\"" : "",
+ Authorization->username ? "username=\"" : "",
+ Authorization->username ? Authorization->username : "",
+ Authorization->username ? "\"" : "",
- Authorization->realm ? ",realm=\"" : "",
- Authorization->realm ? Authorization->realm : "",
- Authorization->realm ? "\"" : "",
+ Authorization->realm ? ",realm=\"" : "",
+ Authorization->realm ? Authorization->realm : "",
+ Authorization->realm ? "\"" : "",
- Authorization->nonce ? ",nonce=\"" : "",
- Authorization->nonce ? Authorization->nonce : "",
- Authorization->nonce ? "\"" : "",
+ Authorization->nonce ? ",nonce=\"" : "",
+ Authorization->nonce ? Authorization->nonce : "",
+ Authorization->nonce ? "\"" : "",
- Authorization->uri ? ",uri=\"" : "",
- Authorization->uri ? Authorization->uri : "",
- Authorization->uri ? "\"" : "",
-
- Authorization->response ? ",response=\"" : "",
- Authorization->response ? Authorization->response : "",
- Authorization->response ? "\"" : "",
-
- Authorization->algorithm ? ",algorithm=" : "",
- Authorization->algorithm ? Authorization->algorithm : "",
+ Authorization->uri ? ",uri=\"" : "",
+ Authorization->uri ? Authorization->uri : "",
+ Authorization->uri ? "\"" : "",
- Authorization->cnonce ? ",cnonce=\"" : "",
- Authorization->cnonce ? Authorization->cnonce : "",
- Authorization->cnonce ? "\"" : "",
+ Authorization->response ? ",response=\"" : "",
+ Authorization->response ? Authorization->response : "",
+ Authorization->response ? "\"" : "",
- Authorization->opaque ? ",opaque=\"" : "",
- Authorization->opaque ? Authorization->opaque : "",
- Authorization->opaque ? "\"" : "",
+ Authorization->algorithm ? ",algorithm=" : "",
+ Authorization->algorithm ? Authorization->algorithm : "",
- Authorization->qop ? ",qop=" : "",
- Authorization->qop ? Authorization->qop : "",
+ Authorization->cnonce ? ",cnonce=\"" : "",
+ Authorization->cnonce ? Authorization->cnonce : "",
+ Authorization->cnonce ? "\"" : "",
- Authorization->nc ? ",nc=" : "",
- Authorization->nc ? Authorization->nc : ""
- );
- }
- }
- }
- return -1;
+ Authorization->opaque ? ",opaque=\"" : "",
+ Authorization->opaque ? Authorization->opaque : "",
+ Authorization->opaque ? "\"" : "",
+
+ Authorization->qop ? ",qop=" : "",
+ Authorization->qop ? Authorization->qop : "",
+
+ Authorization->nc ? ",nc=" : "",
+ Authorization->nc ? Authorization->nc : ""
+ );
+ }
+ }
+ }
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_Authorization_t *thttp_header_Authorization_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Authorization_t *hdr_Authorization = thttp_header_authorization_create();
-
- const char *tag_start = tsk_null;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Authorization_t *hdr_Authorization = thttp_header_authorization_create();
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 121 "./src/headers/thttp_header_Authorization.c" */
-static const char _thttp_machine_parser_header_Authorization_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16, 2, 0, 8, 2, 0,
- 9, 2, 0, 11, 2, 0, 12, 2,
- 0, 15, 2, 5, 0, 2, 6, 0,
- 2, 7, 0, 2, 8, 0, 2, 15,
- 0
-};
+ const char *tag_start = tsk_null;
-static const short _thttp_machine_parser_header_Authorization_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 14,
- 16, 18, 20, 22, 24, 26, 28, 31,
- 38, 39, 40, 47, 50, 53, 56, 59,
- 62, 93, 110, 115, 146, 165, 184, 200,
- 204, 212, 216, 221, 229, 238, 247, 256,
- 259, 267, 277, 280, 284, 287, 291, 294,
- 298, 302, 304, 308, 310, 314, 316, 326,
- 336, 345, 354, 363, 372, 375, 382, 392,
- 402, 412, 415, 419, 423, 425, 427, 446,
- 465, 484, 503, 522, 541, 560, 577, 582,
- 601, 617, 636, 655, 674, 693, 712, 729,
- 734, 753, 761, 765, 770, 791, 808, 813,
- 836, 856, 876, 896, 916, 936, 956, 976,
- 980, 999, 1018, 1037, 1054, 1059, 1078, 1086,
- 1090, 1095, 1114, 1133, 1152, 1171, 1190, 1207,
- 1212, 1231, 1239, 1243, 1248, 1267, 1286, 1303,
- 1308, 1327, 1343, 1362, 1383, 1402, 1421, 1438,
- 1443, 1462, 1470, 1474, 1479, 1498, 1517, 1536,
- 1555, 1574, 1591, 1596, 1615, 1623, 1627, 1632,
- 1653, 1672, 1689, 1694, 1713, 1721, 1729, 1731,
- 1737, 1746, 1782, 1804, 1814, 1837, 1858, 1867,
- 1882, 1898, 1914, 1930, 1940, 1955, 1972, 1982,
- 1993, 2003, 2014, 2024, 2035, 2046, 2055, 2066,
- 2075, 2086, 2095, 2112, 2129, 2145, 2161, 2177,
- 2193, 2203, 2217, 2234, 2251, 2268, 2278, 2289,
- 2300, 2309, 2318, 2342, 2366, 2390, 2414, 2438,
- 2462, 2486, 2510, 2532, 2542, 2565, 2586, 2610,
- 2634, 2658, 2682, 2706, 2728, 2738, 2761, 2770,
- 2779, 2815, 2837, 2847, 2870, 2891, 2900, 2915,
- 2931, 2947, 2963, 2973, 2988, 3005, 3015, 3026,
- 3036, 3047, 3057, 3068, 3079, 3088, 3099, 3108,
- 3119, 3128, 3145, 3162, 3178, 3194, 3210, 3226,
- 3236, 3250, 3267, 3284, 3301, 3311, 3322, 3333,
- 3342, 3351, 3375, 3399, 3423, 3447, 3471, 3495,
- 3519, 3543, 3565, 3575, 3598, 3619, 3643, 3667,
- 3691, 3715, 3739, 3761, 3771, 3794, 3803, 3829,
- 3851, 3861, 3888, 3913, 3938, 3963, 3988, 4013,
- 4038, 4063, 4072, 4096, 4120, 4144, 4166, 4176,
- 4199, 4208, 4217, 4253, 4275, 4285, 4308, 4329,
- 4338, 4353, 4369, 4385, 4401, 4411, 4426, 4443,
- 4453, 4464, 4474, 4485, 4495, 4506, 4517, 4526,
- 4535, 4546, 4555, 4566, 4575, 4592, 4609, 4625,
- 4641, 4657, 4673, 4683, 4697, 4714, 4731, 4748,
- 4758, 4769, 4780, 4789, 4798, 4822, 4846, 4870,
- 4894, 4918, 4942, 4966, 4990, 5012, 5022, 5045,
- 5066, 5090, 5114, 5138, 5162, 5186, 5208, 5218,
- 5241, 5250, 5276, 5298, 5308, 5335, 5360, 5385,
- 5410, 5435, 5460, 5485, 5510, 5519, 5543, 5567,
- 5591, 5613, 5623, 5646, 5655, 5679, 5703, 5727,
- 5751, 5775, 5797, 5807, 5830, 5839, 5848, 5884,
- 5906, 5916, 5939, 5960, 5969, 5984, 6000, 6016,
- 6032, 6042, 6057, 6074, 6084, 6095, 6105, 6116,
- 6126, 6137, 6148, 6157, 6166, 6177, 6186, 6197,
- 6206, 6223, 6240, 6256, 6272, 6288, 6304, 6314,
- 6328, 6345, 6362, 6379, 6389, 6400, 6411, 6420,
- 6429, 6453, 6477, 6501, 6525, 6549, 6573, 6597,
- 6621, 6643, 6653, 6676, 6697, 6721, 6745, 6769,
- 6793, 6817, 6839, 6849, 6872, 6881, 6907, 6929,
- 6939, 6966, 6991, 7016, 7041, 7066, 7091, 7116,
- 7141, 7150, 7174, 7198, 7222, 7244, 7254, 7277,
- 7286, 7310, 7334, 7358, 7382, 7406, 7428, 7438,
- 7461, 7470, 7494, 7518, 7540, 7550, 7573, 7594,
- 7618, 7644, 7668, 7692, 7714, 7724, 7747, 7756,
- 7765, 7801, 7823, 7833, 7856, 7877, 7886, 7901,
- 7917, 7933, 7949, 7959, 7974, 7991, 8001, 8012,
- 8022, 8033, 8043, 8054, 8065, 8074, 8083, 8094,
- 8103, 8114, 8123, 8140, 8157, 8173, 8189, 8205,
- 8221, 8231, 8245, 8262, 8279, 8296, 8306, 8317,
- 8328, 8337, 8346, 8370, 8394, 8418, 8442, 8466,
- 8490, 8514, 8538, 8560, 8570, 8593, 8614, 8638,
- 8662, 8686, 8710, 8734, 8756, 8766, 8789, 8798,
- 8824, 8846, 8856, 8883, 8908, 8933, 8958, 8983,
- 9008, 9033, 9058, 9067, 9091, 9115, 9139, 9161,
- 9171, 9194, 9203, 9227, 9251, 9275, 9299, 9323,
- 9345, 9355, 9378, 9387, 9411, 9435, 9457, 9467,
- 9490, 9511, 9535, 9561, 9585, 9609, 9631, 9641,
- 9664, 9673, 9697, 9721, 9745, 9769, 9793, 9815,
- 9825, 9848, 9857, 9866, 9902, 9924, 9934, 9957,
- 9978, 9987, 10002, 10018, 10034, 10050, 10060, 10075,
- 10092, 10102, 10113, 10123, 10134, 10144, 10155, 10166,
- 10175, 10184, 10195, 10204, 10215, 10224, 10241, 10258,
- 10274, 10290, 10306, 10322, 10332, 10346, 10363, 10380,
- 10397, 10407, 10418, 10429, 10438, 10447, 10471, 10495,
- 10519, 10543, 10567, 10591, 10615, 10639, 10661, 10671,
- 10694, 10715, 10739, 10763, 10787, 10811, 10835, 10857,
- 10867, 10890, 10899, 10925, 10947, 10957, 10984, 11009,
- 11034, 11059, 11084, 11109, 11134, 11159, 11168, 11192,
- 11216, 11240, 11262, 11272, 11295, 11304, 11328, 11352,
- 11376, 11400, 11424, 11446, 11456, 11479, 11488, 11512,
- 11536, 11558, 11568, 11591, 11612, 11636, 11662, 11686,
- 11710, 11732, 11742, 11765, 11774, 11798, 11822, 11846,
- 11870, 11894, 11916, 11926, 11949, 11958, 11984, 12008,
- 12030, 12040, 12063, 12072, 12081, 12117, 12139, 12149,
- 12172, 12193, 12208, 12224, 12240, 12256, 12266, 12281,
- 12298, 12308, 12319, 12329, 12340, 12350, 12361, 12372,
- 12381, 12390, 12401, 12410, 12421, 12430, 12447, 12464,
- 12480, 12496, 12512, 12528, 12538, 12552, 12569, 12586,
- 12603, 12613, 12624, 12635, 12644, 12653, 12677, 12701,
- 12725, 12749, 12773, 12797, 12821, 12845, 12867, 12877,
- 12900, 12921, 12945, 12969, 12993, 13017, 13041, 13063,
- 13073, 13096, 13122, 13144, 13154, 13181, 13206, 13231,
- 13256, 13281, 13306, 13331, 13356, 13365, 13389, 13413,
- 13437, 13459, 13469, 13492, 13516, 13540, 13564, 13588,
- 13612, 13634, 13644, 13667, 13691, 13715, 13737, 13747,
- 13770, 13791, 13815, 13841, 13865, 13889, 13911, 13921,
- 13944, 13968, 13992, 14016, 14040, 14064, 14086, 14096,
- 14119, 14145, 14169, 14191, 14201, 14224, 14248, 14272,
- 14296, 14320, 14344, 14368, 14390, 14400, 14423, 14432,
- 14440, 14444, 14449, 14485, 14507, 14517, 14540, 14561,
- 14570, 14585, 14601, 14617, 14633, 14643, 14658, 14675,
- 14685, 14696, 14706, 14717, 14727, 14738, 14749, 14758,
- 14767, 14778, 14787, 14798, 14807, 14824, 14841, 14857,
- 14873, 14889, 14905, 14915, 14929, 14946, 14963, 14980,
- 14990, 15001, 15012, 15021, 15030, 15054, 15078, 15102,
- 15126, 15150, 15174, 15198, 15222, 15244, 15254, 15277,
- 15298, 15322, 15346, 15370, 15394, 15418, 15440, 15450,
- 15473, 15482, 15508, 15530, 15540, 15567, 15592, 15617,
- 15642, 15667, 15692, 15717, 15742, 15751, 15775, 15799,
- 15823, 15845, 15855, 15878, 15887, 15911, 15935, 15959,
- 15983, 16007, 16029, 16039, 16062, 16071, 16095, 16119,
- 16141, 16151, 16174, 16195, 16219, 16245, 16269, 16293,
- 16315, 16325, 16348, 16357, 16381, 16405, 16429, 16453,
- 16477, 16499, 16509, 16532, 16541, 16567, 16591, 16613,
- 16623, 16646, 16655, 16679, 16703, 16727, 16751, 16775,
- 16799, 16821, 16831, 16854, 16863, 16887, 16911, 16935,
- 16959, 16983, 17007, 17029, 17039, 17062, 17071, 17097,
- 17121, 17143, 17153, 17176, 17185, 17209, 17233, 17257,
- 17281, 17305, 17329, 17351, 17361, 17384, 17393, 17417,
- 17441, 17465, 17489, 17513, 17535, 17545, 17568, 17577,
- 17603, 17627, 17649, 17659, 17682, 17691, 17715, 17739,
- 17763, 17787, 17811, 17835, 17857, 17867, 17890, 17899,
- 17923, 17947, 17969, 17979, 18002, 18023, 18047, 18073,
- 18097, 18121, 18143, 18153, 18176, 18185, 18209, 18233,
- 18257, 18281, 18305, 18327, 18337, 18360, 18369, 18395,
- 18419, 18441, 18451, 18474, 18483, 18507, 18531, 18555,
- 18579, 18603, 18627, 18649, 18659, 18682, 18691, 18715,
- 18739, 18763, 18787, 18811, 18833, 18843, 18866, 18875,
- 18899, 18923, 18945, 18955, 18978, 18999, 19023, 19049,
- 19073, 19097, 19119, 19129, 19152, 19161, 19185, 19209,
- 19233, 19257, 19281, 19303, 19313, 19336, 19345, 19371,
- 19395, 19417, 19427, 19450, 19459, 19483, 19507, 19531,
- 19555, 19579, 19603, 19625, 19635, 19658, 19667, 19693,
- 19715, 19725, 19752, 19777, 19802, 19827, 19852, 19877,
- 19902, 19927, 19936, 19960, 19984, 20008, 20030, 20040,
- 20063, 20087, 20111, 20135, 20159, 20183, 20205, 20215,
- 20238, 20262, 20286, 20308, 20318, 20341, 20362, 20386,
- 20412, 20436, 20460, 20482, 20492, 20515, 20539, 20563,
- 20587, 20611, 20635, 20657, 20667, 20690, 20716, 20740,
- 20762, 20772, 20795, 20804, 20828, 20852, 20876, 20900,
- 20924, 20948, 20970, 20980, 21003, 21022, 21041, 21060,
- 21079, 21098, 21117, 21134, 21139, 21158, 21179, 21198,
- 21215, 21220, 21239, 21247, 21255, 21261, 21270, 21306,
- 21328, 21338, 21361, 21382, 21397, 21413, 21429, 21445,
- 21455, 21470, 21487, 21497, 21508, 21518, 21529, 21539,
- 21550, 21561, 21570, 21579, 21590, 21599, 21610, 21619,
- 21636, 21653, 21669, 21685, 21701, 21717, 21727, 21741,
- 21758, 21775, 21792, 21802, 21813, 21824, 21833, 21842,
- 21866, 21890, 21914, 21938, 21962, 21986, 22010, 22034,
- 22056, 22066, 22089, 22110, 22134, 22158, 22182, 22206,
- 22230, 22252, 22262, 22285, 22311, 22333, 22343, 22370,
- 22395, 22420, 22445, 22470, 22495, 22520, 22545, 22554,
- 22578, 22602, 22626, 22648, 22658, 22681, 22705, 22729,
- 22753, 22777, 22801, 22823, 22833, 22856, 22880, 22904,
- 22926, 22936, 22959, 22980, 23004, 23030, 23054, 23078,
- 23100, 23110, 23133, 23157, 23181, 23205, 23229, 23253,
- 23275, 23285, 23308, 23334, 23358, 23380, 23390, 23413,
- 23422, 23446, 23470, 23494, 23518, 23542, 23566, 23588,
- 23598, 23621, 23624, 23627, 23630, 23633, 23636, 23639,
- 23641, 23644, 23646, 23648, 23650, 23652, 23653, 23655
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _thttp_machine_parser_header_Authorization_trans_keys[] = {
- 65, 80, 97, 112, 85, 117, 84, 116,
- 72, 104, 79, 111, 82, 114, 73, 105,
- 90, 122, 65, 97, 84, 116, 73, 105,
- 79, 111, 78, 110, 9, 32, 58, 9,
- 13, 32, 66, 68, 98, 100, 13, 10,
- 9, 13, 32, 66, 68, 98, 100, 13,
- 65, 97, 13, 83, 115, 13, 73, 105,
- 13, 67, 99, 9, 13, 32, 9, 13,
- 32, 33, 37, 39, 65, 67, 78, 79,
- 81, 82, 85, 97, 99, 110, 111, 113,
- 114, 117, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 61, 9, 13, 32, 33, 37,
- 39, 65, 67, 78, 79, 81, 82, 85,
- 97, 99, 110, 111, 113, 114, 117, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 13, 34, 92, 127,
- 0, 8, 10, 31, 9, 13, 32, 44,
- 13, 0, 9, 11, 127, 13, 58, 48,
- 57, 65, 70, 97, 102, 13, 58, 93,
- 48, 57, 65, 70, 97, 102, 13, 58,
- 93, 48, 57, 65, 70, 97, 102, 13,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 58, 93, 13, 58, 48, 57, 65,
- 70, 97, 102, 13, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 48, 57,
- 13, 46, 48, 57, 13, 48, 57, 13,
- 46, 48, 57, 13, 48, 57, 13, 93,
- 48, 57, 13, 93, 48, 57, 13, 93,
- 13, 46, 48, 57, 13, 46, 13, 46,
- 48, 57, 13, 46, 13, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 13, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 58, 93, 48, 57, 65, 70, 97,
- 102, 13, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 58, 93, 48, 57,
- 65, 70, 97, 102, 13, 58, 93, 13,
- 48, 57, 65, 70, 97, 102, 13, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 13, 48, 57, 13,
- 46, 48, 57, 13, 46, 48, 57, 13,
- 46, 13, 58, 9, 13, 32, 33, 37,
- 39, 44, 61, 71, 103, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 79, 111,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 82, 114, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 73, 105, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 84,
- 116, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 72, 104, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 77, 109, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 78, 110, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 79, 111, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 78,
- 110, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 67, 99, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 69, 101, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 13, 34, 92, 127, 0, 8, 10,
- 31, 9, 13, 32, 44, 13, 0, 9,
- 11, 127, 9, 13, 32, 33, 37, 39,
- 44, 61, 67, 79, 99, 111, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 37, 39, 44, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 37, 39, 44, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 37, 39, 44, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 37, 39, 44, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 44, 9, 13, 32, 33,
- 37, 39, 44, 61, 78, 110, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 67,
- 99, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 69, 101, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 34,
- 92, 127, 0, 8, 10, 31, 9, 13,
- 32, 44, 13, 0, 9, 11, 127, 9,
- 13, 32, 33, 37, 39, 44, 61, 80,
- 112, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 65, 97, 126, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 81, 113, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 85, 117, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 69, 101, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 34, 92, 127, 0, 8, 10, 31, 9,
- 13, 32, 44, 13, 0, 9, 11, 127,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 79, 111, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 80, 112, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 65, 83, 97, 115, 126, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 76,
- 108, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 77, 109, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 34,
- 92, 127, 0, 8, 10, 31, 9, 13,
- 32, 44, 13, 0, 9, 11, 127, 9,
- 13, 32, 33, 37, 39, 44, 61, 80,
- 112, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 79, 111, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 78, 110, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 83, 115, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 69, 101, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 34, 92, 127, 0, 8, 10, 31, 9,
- 13, 32, 44, 13, 0, 9, 11, 127,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 82, 83, 114, 115, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 73, 105, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 13, 34, 92, 127, 0, 8, 10,
- 31, 13, 34, 92, 127, 0, 8, 10,
- 31, 13, 34, 13, 34, 0, 9, 11,
- 127, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 65, 67, 78, 79, 81, 82, 85,
- 92, 97, 99, 110, 111, 113, 114, 117,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 71,
- 92, 103, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 92, 114, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 73,
- 92, 105, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 84,
- 92, 116, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 72,
- 92, 104, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 92, 99, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 65, 67, 78, 79, 81, 82,
- 85, 92, 97, 99, 110, 111, 113, 114,
- 117, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 93, 127, 0, 8, 10, 31,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 71, 92, 103, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 72, 92, 104, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 92, 99, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 79, 92, 99,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 67, 92, 99, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 65, 67, 78, 79, 81, 82, 85, 92,
- 97, 99, 110, 111, 113, 114, 117, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 93, 127, 0, 8, 10, 31, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 71,
- 92, 103, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 92, 114, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 73,
- 92, 105, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 84,
- 92, 116, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 72,
- 92, 104, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 92, 99, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 79, 92, 99, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 78, 92, 110, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 67, 92, 99, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 92, 112, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 81, 92, 113, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 85, 92, 117, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 65,
- 67, 78, 79, 81, 82, 85, 92, 97,
- 99, 110, 111, 113, 114, 117, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 71, 92,
- 103, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 82, 92,
- 114, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 73, 92,
- 105, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 84, 92,
- 116, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 72, 92,
- 104, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 67, 92, 99, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 67, 79, 92, 99, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 67,
- 92, 99, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 81,
- 92, 113, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 85,
- 92, 117, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 83, 92, 97, 115,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 76, 92, 108,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 65, 67, 78, 79,
- 81, 82, 85, 92, 97, 99, 110, 111,
- 113, 114, 117, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 13,
- 34, 58, 92, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 71, 92, 103, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 82, 92, 114, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 92, 105, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 84, 92, 116, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 72, 92, 104, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 67,
- 92, 99, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 67,
- 79, 92, 99, 111, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 92, 99, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 81, 92, 113, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 85, 92, 117, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 83, 92, 97, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 80, 92, 112, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 65, 67, 78, 79, 81, 82, 85,
- 92, 97, 99, 110, 111, 113, 114, 117,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 71, 92, 103, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 72, 92, 104, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 92, 99, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 79, 92, 99,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 67, 92, 99, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 92, 112, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 81, 92, 113, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 85, 92, 117, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 79, 92, 111, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 92, 112, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 83, 92,
- 97, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 83,
- 92, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 83, 92, 114, 115, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 73, 92, 105, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 65, 67, 78, 79, 81, 82, 85, 92,
- 97, 99, 110, 111, 113, 114, 117, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 71, 92,
- 103, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 82, 92,
- 114, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 73, 92,
- 105, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 84, 92,
- 116, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 72, 92,
- 104, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 67, 92, 99, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 67, 79, 92, 99, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 92,
- 110, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 67, 92,
- 99, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 81, 92, 113,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 83, 92, 97, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 92, 112, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 79, 92, 111, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 83, 92, 115, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 83, 92, 114, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 73, 92, 105, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 82, 92, 114, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 77, 92, 109, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 9, 13, 32, 44, 13, 0, 9, 11,
- 127, 9, 13, 32, 33, 34, 37, 39,
- 65, 67, 78, 79, 81, 82, 85, 92,
- 97, 99, 110, 111, 113, 114, 117, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 93, 127, 0, 8, 10, 31, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 71,
- 92, 103, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 92, 114, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 73,
- 92, 105, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 84,
- 92, 116, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 72,
- 92, 104, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 92, 99, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 79, 92, 99, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 78, 92, 110, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 67, 92, 99, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 92, 112, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 81, 92, 113, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 85, 92, 117, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 92, 112, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 83, 92, 97,
- 115, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 80, 92,
- 112, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 92,
- 110, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 83, 92,
- 115, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 82, 83,
- 92, 114, 115, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 78, 92, 110, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 78, 92, 110, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 83, 92, 114, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 73, 92, 105, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 92, 114, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 65, 92, 97, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 80, 92, 112, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 83, 92, 114, 115, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 73, 92, 105, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 82, 92, 114, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 77, 92, 109, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 83, 92, 97, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 80, 92, 112, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 83, 92, 114, 115, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 73, 92, 105, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 82, 92, 114, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 77, 92, 109, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 81, 92, 113, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 85, 92, 117, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 83, 92, 97, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 80, 92, 112, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 92, 110, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 83, 92, 114, 115, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 73, 92, 105, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 82, 92, 114, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 77, 92, 109, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 79, 92, 99,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 67, 92, 99, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 92, 112, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 81, 92, 113, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 85, 92, 117, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 83, 92, 97, 115,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 76, 92, 108,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 83, 92, 115, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 82, 83, 92, 114, 115,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 73, 92, 105,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 82, 92, 114,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 78, 92, 110,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 69, 101, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 82, 114,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 78, 110, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 65, 97, 126, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 77,
- 109, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 69, 101, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 82, 83,
- 114, 115, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 73, 105, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 34, 92, 127, 0, 8, 10, 31, 13,
- 34, 92, 127, 0, 8, 10, 31, 13,
- 34, 0, 9, 11, 127, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 65, 67, 78,
- 79, 81, 82, 85, 92, 97, 99, 110,
- 111, 113, 114, 117, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 13,
- 34, 58, 92, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 92, 93, 127, 0, 8, 10, 31, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 71, 92, 103, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 82, 92, 114, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 92, 105, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 84, 92, 116, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 72, 92, 104, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 67,
- 92, 99, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 67, 79,
- 92, 99, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 102,
- 103, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 102, 103, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 102, 103, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 102, 103, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 102, 103, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 102, 103, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 102, 103,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 92, 99, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 80, 92, 112, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 65, 92, 97, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 81, 92, 113, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 85, 92, 117, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 79, 92, 111, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 92, 112, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 83, 92,
- 97, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 80, 92,
- 112, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 92,
- 110, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 83, 92,
- 115, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 82, 83, 92,
- 114, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 73,
- 92, 105, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 92, 114, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 13, 73, 105,
- 13, 71, 103, 13, 69, 101, 13, 83,
- 115, 13, 84, 116, 9, 13, 32, 10,
- 13, 9, 13, 32, 82, 114, 79, 111,
- 88, 120, 89, 121, 45, 65, 97, 0
-};
+ /* #line 121 "./src/headers/thttp_header_Authorization.c" */
+ static const char _thttp_machine_parser_header_Authorization_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16, 2, 0, 8, 2, 0,
+ 9, 2, 0, 11, 2, 0, 12, 2,
+ 0, 15, 2, 5, 0, 2, 6, 0,
+ 2, 7, 0, 2, 8, 0, 2, 15,
+ 0
+ };
-static const char _thttp_machine_parser_header_Authorization_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 3, 7,
- 1, 1, 7, 3, 3, 3, 3, 3,
- 21, 9, 5, 21, 11, 9, 8, 4,
- 4, 4, 1, 2, 3, 3, 3, 3,
- 2, 4, 1, 2, 1, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 4, 4,
- 3, 3, 3, 3, 3, 1, 4, 4,
- 4, 1, 2, 2, 2, 2, 11, 11,
- 11, 11, 11, 11, 11, 9, 5, 9,
- 8, 11, 11, 11, 11, 11, 9, 5,
- 9, 4, 4, 1, 13, 9, 5, 9,
- 8, 8, 8, 8, 8, 8, 8, 4,
- 11, 11, 11, 9, 5, 9, 4, 4,
- 1, 11, 11, 11, 11, 11, 9, 5,
- 9, 4, 4, 1, 11, 11, 9, 5,
- 9, 8, 11, 13, 11, 11, 9, 5,
- 9, 4, 4, 1, 11, 11, 11, 11,
- 11, 9, 5, 9, 4, 4, 1, 13,
- 11, 9, 5, 9, 4, 4, 2, 2,
- 7, 24, 12, 8, 11, 11, 7, 5,
- 6, 6, 6, 6, 5, 7, 4, 5,
- 4, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 7, 7, 6, 6, 6, 6,
- 6, 4, 7, 7, 7, 4, 5, 5,
- 5, 5, 14, 14, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 11, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 7,
- 24, 12, 8, 11, 11, 7, 5, 6,
- 6, 6, 6, 5, 7, 4, 5, 4,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 7, 7, 6, 6, 6, 6, 6,
- 4, 7, 7, 7, 4, 5, 5, 5,
- 5, 14, 14, 14, 14, 14, 14, 14,
- 14, 12, 8, 11, 11, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 16, 12,
- 8, 11, 11, 11, 11, 11, 11, 11,
- 11, 7, 14, 14, 14, 12, 8, 11,
- 7, 7, 24, 12, 8, 11, 11, 7,
- 5, 6, 6, 6, 6, 5, 7, 4,
- 5, 4, 5, 4, 5, 5, 5, 7,
- 5, 5, 5, 5, 7, 7, 6, 6,
- 6, 6, 6, 4, 7, 7, 7, 4,
- 5, 5, 5, 5, 14, 14, 14, 14,
- 14, 14, 14, 14, 12, 8, 11, 11,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 7, 16, 12, 8, 11, 11, 11, 11,
- 11, 11, 11, 11, 7, 14, 14, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 12, 8, 11, 7, 7, 24, 12,
- 8, 11, 11, 7, 5, 6, 6, 6,
- 6, 5, 7, 4, 5, 4, 5, 4,
- 5, 5, 5, 7, 5, 5, 5, 5,
- 7, 7, 6, 6, 6, 6, 6, 4,
- 7, 7, 7, 4, 5, 5, 5, 5,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 12, 8, 11, 11, 14, 14, 14, 14,
- 14, 12, 8, 11, 7, 16, 12, 8,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 7, 14, 14, 14, 12, 8, 11, 7,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 7, 14, 14, 12, 8, 11, 11, 14,
- 16, 14, 14, 12, 8, 11, 7, 7,
- 24, 12, 8, 11, 11, 7, 5, 6,
- 6, 6, 6, 5, 7, 4, 5, 4,
- 5, 4, 5, 5, 5, 7, 5, 5,
- 5, 5, 7, 7, 6, 6, 6, 6,
- 6, 4, 7, 7, 7, 4, 5, 5,
- 5, 5, 14, 14, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 11, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 16,
- 12, 8, 11, 11, 11, 11, 11, 11,
- 11, 11, 7, 14, 14, 14, 12, 8,
- 11, 7, 14, 14, 14, 14, 14, 12,
- 8, 11, 7, 14, 14, 12, 8, 11,
- 11, 14, 16, 14, 14, 12, 8, 11,
- 7, 14, 14, 14, 14, 14, 12, 8,
- 11, 7, 7, 24, 12, 8, 11, 11,
- 7, 5, 6, 6, 6, 6, 5, 7,
- 4, 5, 4, 5, 4, 5, 5, 5,
- 7, 5, 5, 5, 5, 7, 7, 6,
- 6, 6, 6, 6, 4, 7, 7, 7,
- 4, 5, 5, 5, 5, 14, 14, 14,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 11, 14, 14, 14, 14, 14, 12, 8,
- 11, 7, 16, 12, 8, 11, 11, 11,
- 11, 11, 11, 11, 11, 7, 14, 14,
- 14, 12, 8, 11, 7, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 14, 14,
- 12, 8, 11, 11, 14, 16, 14, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 12, 8, 11, 7, 16, 14, 12,
- 8, 11, 7, 7, 24, 12, 8, 11,
- 11, 5, 6, 6, 6, 6, 5, 7,
- 4, 5, 4, 5, 4, 5, 5, 5,
- 7, 5, 5, 5, 5, 7, 7, 6,
- 6, 6, 6, 6, 4, 7, 7, 7,
- 4, 5, 5, 5, 5, 14, 14, 14,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 11, 14, 14, 14, 14, 14, 12, 8,
- 11, 16, 12, 8, 11, 11, 11, 11,
- 11, 11, 11, 11, 7, 14, 14, 14,
- 12, 8, 11, 14, 14, 14, 14, 14,
- 12, 8, 11, 14, 14, 12, 8, 11,
- 11, 14, 16, 14, 14, 12, 8, 11,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 16, 14, 12, 8, 11, 14, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 4,
- 4, 1, 24, 12, 8, 11, 11, 7,
- 5, 6, 6, 6, 6, 5, 7, 4,
- 5, 4, 5, 4, 5, 5, 5, 7,
- 5, 5, 5, 5, 7, 7, 6, 6,
- 6, 6, 6, 4, 7, 7, 7, 4,
- 5, 5, 5, 5, 14, 14, 14, 14,
- 14, 14, 14, 14, 12, 8, 11, 11,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 7, 16, 12, 8, 11, 11, 11, 11,
- 11, 11, 11, 11, 7, 14, 14, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 12, 8, 11, 7, 14, 14, 12,
- 8, 11, 11, 14, 16, 14, 14, 12,
- 8, 11, 7, 14, 14, 14, 14, 14,
- 12, 8, 11, 7, 16, 14, 12, 8,
- 11, 7, 14, 14, 14, 14, 14, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 16, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 16,
- 14, 12, 8, 11, 7, 14, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 14,
- 14, 12, 8, 11, 11, 14, 16, 14,
- 14, 12, 8, 11, 7, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 16, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 14, 14,
- 14, 14, 14, 12, 8, 11, 7, 14,
- 14, 12, 8, 11, 11, 14, 16, 14,
- 14, 12, 8, 11, 7, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 16, 14,
- 12, 8, 11, 7, 14, 14, 14, 14,
- 14, 14, 12, 8, 11, 7, 16, 12,
- 8, 11, 11, 11, 11, 11, 11, 11,
- 11, 7, 14, 14, 14, 12, 8, 11,
- 14, 14, 14, 14, 14, 12, 8, 11,
- 14, 14, 12, 8, 11, 11, 14, 16,
- 14, 14, 12, 8, 11, 14, 14, 14,
- 14, 14, 12, 8, 11, 16, 14, 12,
- 8, 11, 7, 14, 14, 14, 14, 14,
- 14, 12, 8, 11, 11, 11, 11, 11,
- 11, 11, 9, 5, 9, 13, 11, 9,
- 5, 9, 4, 4, 2, 7, 24, 12,
- 8, 11, 11, 5, 6, 6, 6, 6,
- 5, 7, 4, 5, 4, 5, 4, 5,
- 5, 5, 7, 5, 5, 5, 5, 7,
- 7, 6, 6, 6, 6, 6, 4, 7,
- 7, 7, 4, 5, 5, 5, 5, 14,
- 14, 14, 14, 14, 14, 14, 14, 12,
- 8, 11, 11, 14, 14, 14, 14, 14,
- 12, 8, 11, 16, 12, 8, 11, 11,
- 11, 11, 11, 11, 11, 11, 7, 14,
- 14, 14, 12, 8, 11, 14, 14, 14,
- 14, 14, 12, 8, 11, 14, 14, 12,
- 8, 11, 11, 14, 16, 14, 14, 12,
- 8, 11, 14, 14, 14, 14, 14, 12,
- 8, 11, 16, 14, 12, 8, 11, 7,
- 14, 14, 14, 14, 14, 14, 12, 8,
- 11, 3, 3, 3, 3, 3, 3, 2,
- 3, 2, 2, 2, 2, 1, 2, 0
-};
+ static const short _thttp_machine_parser_header_Authorization_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 31,
+ 38, 39, 40, 47, 50, 53, 56, 59,
+ 62, 93, 110, 115, 146, 165, 184, 200,
+ 204, 212, 216, 221, 229, 238, 247, 256,
+ 259, 267, 277, 280, 284, 287, 291, 294,
+ 298, 302, 304, 308, 310, 314, 316, 326,
+ 336, 345, 354, 363, 372, 375, 382, 392,
+ 402, 412, 415, 419, 423, 425, 427, 446,
+ 465, 484, 503, 522, 541, 560, 577, 582,
+ 601, 617, 636, 655, 674, 693, 712, 729,
+ 734, 753, 761, 765, 770, 791, 808, 813,
+ 836, 856, 876, 896, 916, 936, 956, 976,
+ 980, 999, 1018, 1037, 1054, 1059, 1078, 1086,
+ 1090, 1095, 1114, 1133, 1152, 1171, 1190, 1207,
+ 1212, 1231, 1239, 1243, 1248, 1267, 1286, 1303,
+ 1308, 1327, 1343, 1362, 1383, 1402, 1421, 1438,
+ 1443, 1462, 1470, 1474, 1479, 1498, 1517, 1536,
+ 1555, 1574, 1591, 1596, 1615, 1623, 1627, 1632,
+ 1653, 1672, 1689, 1694, 1713, 1721, 1729, 1731,
+ 1737, 1746, 1782, 1804, 1814, 1837, 1858, 1867,
+ 1882, 1898, 1914, 1930, 1940, 1955, 1972, 1982,
+ 1993, 2003, 2014, 2024, 2035, 2046, 2055, 2066,
+ 2075, 2086, 2095, 2112, 2129, 2145, 2161, 2177,
+ 2193, 2203, 2217, 2234, 2251, 2268, 2278, 2289,
+ 2300, 2309, 2318, 2342, 2366, 2390, 2414, 2438,
+ 2462, 2486, 2510, 2532, 2542, 2565, 2586, 2610,
+ 2634, 2658, 2682, 2706, 2728, 2738, 2761, 2770,
+ 2779, 2815, 2837, 2847, 2870, 2891, 2900, 2915,
+ 2931, 2947, 2963, 2973, 2988, 3005, 3015, 3026,
+ 3036, 3047, 3057, 3068, 3079, 3088, 3099, 3108,
+ 3119, 3128, 3145, 3162, 3178, 3194, 3210, 3226,
+ 3236, 3250, 3267, 3284, 3301, 3311, 3322, 3333,
+ 3342, 3351, 3375, 3399, 3423, 3447, 3471, 3495,
+ 3519, 3543, 3565, 3575, 3598, 3619, 3643, 3667,
+ 3691, 3715, 3739, 3761, 3771, 3794, 3803, 3829,
+ 3851, 3861, 3888, 3913, 3938, 3963, 3988, 4013,
+ 4038, 4063, 4072, 4096, 4120, 4144, 4166, 4176,
+ 4199, 4208, 4217, 4253, 4275, 4285, 4308, 4329,
+ 4338, 4353, 4369, 4385, 4401, 4411, 4426, 4443,
+ 4453, 4464, 4474, 4485, 4495, 4506, 4517, 4526,
+ 4535, 4546, 4555, 4566, 4575, 4592, 4609, 4625,
+ 4641, 4657, 4673, 4683, 4697, 4714, 4731, 4748,
+ 4758, 4769, 4780, 4789, 4798, 4822, 4846, 4870,
+ 4894, 4918, 4942, 4966, 4990, 5012, 5022, 5045,
+ 5066, 5090, 5114, 5138, 5162, 5186, 5208, 5218,
+ 5241, 5250, 5276, 5298, 5308, 5335, 5360, 5385,
+ 5410, 5435, 5460, 5485, 5510, 5519, 5543, 5567,
+ 5591, 5613, 5623, 5646, 5655, 5679, 5703, 5727,
+ 5751, 5775, 5797, 5807, 5830, 5839, 5848, 5884,
+ 5906, 5916, 5939, 5960, 5969, 5984, 6000, 6016,
+ 6032, 6042, 6057, 6074, 6084, 6095, 6105, 6116,
+ 6126, 6137, 6148, 6157, 6166, 6177, 6186, 6197,
+ 6206, 6223, 6240, 6256, 6272, 6288, 6304, 6314,
+ 6328, 6345, 6362, 6379, 6389, 6400, 6411, 6420,
+ 6429, 6453, 6477, 6501, 6525, 6549, 6573, 6597,
+ 6621, 6643, 6653, 6676, 6697, 6721, 6745, 6769,
+ 6793, 6817, 6839, 6849, 6872, 6881, 6907, 6929,
+ 6939, 6966, 6991, 7016, 7041, 7066, 7091, 7116,
+ 7141, 7150, 7174, 7198, 7222, 7244, 7254, 7277,
+ 7286, 7310, 7334, 7358, 7382, 7406, 7428, 7438,
+ 7461, 7470, 7494, 7518, 7540, 7550, 7573, 7594,
+ 7618, 7644, 7668, 7692, 7714, 7724, 7747, 7756,
+ 7765, 7801, 7823, 7833, 7856, 7877, 7886, 7901,
+ 7917, 7933, 7949, 7959, 7974, 7991, 8001, 8012,
+ 8022, 8033, 8043, 8054, 8065, 8074, 8083, 8094,
+ 8103, 8114, 8123, 8140, 8157, 8173, 8189, 8205,
+ 8221, 8231, 8245, 8262, 8279, 8296, 8306, 8317,
+ 8328, 8337, 8346, 8370, 8394, 8418, 8442, 8466,
+ 8490, 8514, 8538, 8560, 8570, 8593, 8614, 8638,
+ 8662, 8686, 8710, 8734, 8756, 8766, 8789, 8798,
+ 8824, 8846, 8856, 8883, 8908, 8933, 8958, 8983,
+ 9008, 9033, 9058, 9067, 9091, 9115, 9139, 9161,
+ 9171, 9194, 9203, 9227, 9251, 9275, 9299, 9323,
+ 9345, 9355, 9378, 9387, 9411, 9435, 9457, 9467,
+ 9490, 9511, 9535, 9561, 9585, 9609, 9631, 9641,
+ 9664, 9673, 9697, 9721, 9745, 9769, 9793, 9815,
+ 9825, 9848, 9857, 9866, 9902, 9924, 9934, 9957,
+ 9978, 9987, 10002, 10018, 10034, 10050, 10060, 10075,
+ 10092, 10102, 10113, 10123, 10134, 10144, 10155, 10166,
+ 10175, 10184, 10195, 10204, 10215, 10224, 10241, 10258,
+ 10274, 10290, 10306, 10322, 10332, 10346, 10363, 10380,
+ 10397, 10407, 10418, 10429, 10438, 10447, 10471, 10495,
+ 10519, 10543, 10567, 10591, 10615, 10639, 10661, 10671,
+ 10694, 10715, 10739, 10763, 10787, 10811, 10835, 10857,
+ 10867, 10890, 10899, 10925, 10947, 10957, 10984, 11009,
+ 11034, 11059, 11084, 11109, 11134, 11159, 11168, 11192,
+ 11216, 11240, 11262, 11272, 11295, 11304, 11328, 11352,
+ 11376, 11400, 11424, 11446, 11456, 11479, 11488, 11512,
+ 11536, 11558, 11568, 11591, 11612, 11636, 11662, 11686,
+ 11710, 11732, 11742, 11765, 11774, 11798, 11822, 11846,
+ 11870, 11894, 11916, 11926, 11949, 11958, 11984, 12008,
+ 12030, 12040, 12063, 12072, 12081, 12117, 12139, 12149,
+ 12172, 12193, 12208, 12224, 12240, 12256, 12266, 12281,
+ 12298, 12308, 12319, 12329, 12340, 12350, 12361, 12372,
+ 12381, 12390, 12401, 12410, 12421, 12430, 12447, 12464,
+ 12480, 12496, 12512, 12528, 12538, 12552, 12569, 12586,
+ 12603, 12613, 12624, 12635, 12644, 12653, 12677, 12701,
+ 12725, 12749, 12773, 12797, 12821, 12845, 12867, 12877,
+ 12900, 12921, 12945, 12969, 12993, 13017, 13041, 13063,
+ 13073, 13096, 13122, 13144, 13154, 13181, 13206, 13231,
+ 13256, 13281, 13306, 13331, 13356, 13365, 13389, 13413,
+ 13437, 13459, 13469, 13492, 13516, 13540, 13564, 13588,
+ 13612, 13634, 13644, 13667, 13691, 13715, 13737, 13747,
+ 13770, 13791, 13815, 13841, 13865, 13889, 13911, 13921,
+ 13944, 13968, 13992, 14016, 14040, 14064, 14086, 14096,
+ 14119, 14145, 14169, 14191, 14201, 14224, 14248, 14272,
+ 14296, 14320, 14344, 14368, 14390, 14400, 14423, 14432,
+ 14440, 14444, 14449, 14485, 14507, 14517, 14540, 14561,
+ 14570, 14585, 14601, 14617, 14633, 14643, 14658, 14675,
+ 14685, 14696, 14706, 14717, 14727, 14738, 14749, 14758,
+ 14767, 14778, 14787, 14798, 14807, 14824, 14841, 14857,
+ 14873, 14889, 14905, 14915, 14929, 14946, 14963, 14980,
+ 14990, 15001, 15012, 15021, 15030, 15054, 15078, 15102,
+ 15126, 15150, 15174, 15198, 15222, 15244, 15254, 15277,
+ 15298, 15322, 15346, 15370, 15394, 15418, 15440, 15450,
+ 15473, 15482, 15508, 15530, 15540, 15567, 15592, 15617,
+ 15642, 15667, 15692, 15717, 15742, 15751, 15775, 15799,
+ 15823, 15845, 15855, 15878, 15887, 15911, 15935, 15959,
+ 15983, 16007, 16029, 16039, 16062, 16071, 16095, 16119,
+ 16141, 16151, 16174, 16195, 16219, 16245, 16269, 16293,
+ 16315, 16325, 16348, 16357, 16381, 16405, 16429, 16453,
+ 16477, 16499, 16509, 16532, 16541, 16567, 16591, 16613,
+ 16623, 16646, 16655, 16679, 16703, 16727, 16751, 16775,
+ 16799, 16821, 16831, 16854, 16863, 16887, 16911, 16935,
+ 16959, 16983, 17007, 17029, 17039, 17062, 17071, 17097,
+ 17121, 17143, 17153, 17176, 17185, 17209, 17233, 17257,
+ 17281, 17305, 17329, 17351, 17361, 17384, 17393, 17417,
+ 17441, 17465, 17489, 17513, 17535, 17545, 17568, 17577,
+ 17603, 17627, 17649, 17659, 17682, 17691, 17715, 17739,
+ 17763, 17787, 17811, 17835, 17857, 17867, 17890, 17899,
+ 17923, 17947, 17969, 17979, 18002, 18023, 18047, 18073,
+ 18097, 18121, 18143, 18153, 18176, 18185, 18209, 18233,
+ 18257, 18281, 18305, 18327, 18337, 18360, 18369, 18395,
+ 18419, 18441, 18451, 18474, 18483, 18507, 18531, 18555,
+ 18579, 18603, 18627, 18649, 18659, 18682, 18691, 18715,
+ 18739, 18763, 18787, 18811, 18833, 18843, 18866, 18875,
+ 18899, 18923, 18945, 18955, 18978, 18999, 19023, 19049,
+ 19073, 19097, 19119, 19129, 19152, 19161, 19185, 19209,
+ 19233, 19257, 19281, 19303, 19313, 19336, 19345, 19371,
+ 19395, 19417, 19427, 19450, 19459, 19483, 19507, 19531,
+ 19555, 19579, 19603, 19625, 19635, 19658, 19667, 19693,
+ 19715, 19725, 19752, 19777, 19802, 19827, 19852, 19877,
+ 19902, 19927, 19936, 19960, 19984, 20008, 20030, 20040,
+ 20063, 20087, 20111, 20135, 20159, 20183, 20205, 20215,
+ 20238, 20262, 20286, 20308, 20318, 20341, 20362, 20386,
+ 20412, 20436, 20460, 20482, 20492, 20515, 20539, 20563,
+ 20587, 20611, 20635, 20657, 20667, 20690, 20716, 20740,
+ 20762, 20772, 20795, 20804, 20828, 20852, 20876, 20900,
+ 20924, 20948, 20970, 20980, 21003, 21022, 21041, 21060,
+ 21079, 21098, 21117, 21134, 21139, 21158, 21179, 21198,
+ 21215, 21220, 21239, 21247, 21255, 21261, 21270, 21306,
+ 21328, 21338, 21361, 21382, 21397, 21413, 21429, 21445,
+ 21455, 21470, 21487, 21497, 21508, 21518, 21529, 21539,
+ 21550, 21561, 21570, 21579, 21590, 21599, 21610, 21619,
+ 21636, 21653, 21669, 21685, 21701, 21717, 21727, 21741,
+ 21758, 21775, 21792, 21802, 21813, 21824, 21833, 21842,
+ 21866, 21890, 21914, 21938, 21962, 21986, 22010, 22034,
+ 22056, 22066, 22089, 22110, 22134, 22158, 22182, 22206,
+ 22230, 22252, 22262, 22285, 22311, 22333, 22343, 22370,
+ 22395, 22420, 22445, 22470, 22495, 22520, 22545, 22554,
+ 22578, 22602, 22626, 22648, 22658, 22681, 22705, 22729,
+ 22753, 22777, 22801, 22823, 22833, 22856, 22880, 22904,
+ 22926, 22936, 22959, 22980, 23004, 23030, 23054, 23078,
+ 23100, 23110, 23133, 23157, 23181, 23205, 23229, 23253,
+ 23275, 23285, 23308, 23334, 23358, 23380, 23390, 23413,
+ 23422, 23446, 23470, 23494, 23518, 23542, 23566, 23588,
+ 23598, 23621, 23624, 23627, 23630, 23633, 23636, 23639,
+ 23641, 23644, 23646, 23648, 23650, 23652, 23653, 23655
+ };
-static const char _thttp_machine_parser_header_Authorization_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 4, 0, 5, 4, 5, 4, 0,
- 2, 0, 2, 3, 3, 3, 3, 0,
- 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 0, 1, 0, 3, 3,
- 3, 3, 3, 3, 0, 3, 3, 3,
- 3, 1, 1, 1, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 0, 5,
- 4, 4, 4, 4, 4, 4, 4, 0,
- 5, 2, 0, 2, 4, 4, 0, 7,
- 6, 6, 6, 6, 6, 6, 6, 0,
- 4, 4, 4, 4, 0, 5, 2, 0,
- 2, 4, 4, 4, 4, 4, 4, 0,
- 5, 2, 0, 2, 4, 4, 4, 0,
- 5, 4, 4, 4, 4, 4, 4, 0,
- 5, 2, 0, 2, 4, 4, 4, 4,
- 4, 4, 0, 5, 2, 0, 2, 4,
- 4, 4, 0, 5, 2, 2, 0, 2,
- 1, 6, 5, 1, 6, 5, 1, 5,
- 5, 5, 5, 2, 5, 5, 3, 3,
- 3, 3, 3, 3, 3, 2, 3, 2,
- 3, 2, 5, 5, 5, 5, 5, 5,
- 2, 5, 5, 5, 5, 3, 3, 3,
- 2, 2, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 1,
- 6, 5, 1, 6, 5, 1, 5, 5,
- 5, 5, 2, 5, 5, 3, 3, 3,
- 3, 3, 3, 3, 2, 3, 2, 3,
- 2, 5, 5, 5, 5, 5, 5, 2,
- 5, 5, 5, 5, 3, 3, 3, 2,
- 2, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 1, 6, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 1, 8, 7, 7, 7, 7, 7, 7,
- 7, 1, 5, 5, 5, 5, 1, 6,
- 1, 1, 6, 5, 1, 6, 5, 1,
- 5, 5, 5, 5, 2, 5, 5, 3,
- 3, 3, 3, 3, 3, 3, 2, 1,
- 3, 2, 3, 2, 5, 5, 5, 5,
- 5, 5, 2, 5, 5, 5, 5, 3,
- 3, 3, 2, 2, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 6, 5,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 1, 5, 5, 1, 8, 7, 7, 7,
- 7, 7, 7, 7, 1, 5, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 1, 6, 5,
- 1, 6, 5, 1, 5, 5, 5, 5,
- 2, 5, 5, 3, 3, 3, 3, 3,
- 3, 3, 2, 1, 3, 2, 3, 2,
- 5, 5, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 3, 3, 3, 2, 2,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 1, 6, 5, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 1,
- 8, 7, 7, 7, 7, 7, 7, 7,
- 1, 5, 5, 5, 5, 1, 6, 1,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 1, 5, 5, 5, 1, 6, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 1,
- 6, 5, 1, 6, 5, 1, 5, 5,
- 5, 5, 2, 5, 5, 3, 3, 3,
- 3, 3, 3, 3, 2, 1, 3, 2,
- 3, 2, 5, 5, 5, 5, 5, 5,
- 2, 5, 5, 5, 5, 3, 3, 3,
- 2, 2, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 5,
- 5, 1, 8, 7, 7, 7, 7, 7,
- 7, 7, 1, 5, 5, 5, 5, 1,
- 6, 1, 5, 5, 5, 5, 5, 5,
- 1, 6, 1, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 1, 5, 5, 5, 5, 5, 5, 1,
- 6, 1, 1, 6, 5, 1, 6, 5,
- 1, 5, 5, 5, 5, 2, 5, 5,
- 3, 3, 3, 3, 3, 3, 3, 2,
- 1, 3, 2, 3, 2, 5, 5, 5,
- 5, 5, 5, 2, 5, 5, 5, 5,
- 3, 3, 3, 2, 2, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 5, 1,
- 6, 1, 5, 5, 1, 8, 7, 7,
- 7, 7, 7, 7, 7, 1, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 1, 6, 5, 5, 5, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 1, 6, 1, 1, 6, 5, 1, 6,
- 5, 5, 5, 5, 5, 2, 5, 5,
- 3, 3, 3, 3, 3, 3, 3, 2,
- 1, 3, 2, 3, 2, 5, 5, 5,
- 5, 5, 5, 2, 5, 5, 5, 5,
- 3, 3, 3, 2, 2, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 5, 1,
- 6, 5, 5, 1, 8, 7, 7, 7,
- 7, 7, 7, 7, 1, 5, 5, 5,
- 5, 1, 6, 5, 5, 5, 5, 5,
- 5, 1, 6, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 2,
- 0, 2, 6, 5, 1, 6, 5, 1,
- 5, 5, 5, 5, 2, 5, 5, 3,
- 3, 3, 3, 3, 3, 3, 2, 1,
- 3, 2, 3, 2, 5, 5, 5, 5,
- 5, 5, 2, 5, 5, 5, 5, 3,
- 3, 3, 2, 2, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 6, 5,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 1, 5, 5, 1, 8, 7, 7, 7,
- 7, 7, 7, 7, 1, 5, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 1, 6, 5, 5, 5, 5, 5, 5,
- 1, 6, 1, 5, 5, 5, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 1,
- 6, 1, 5, 5, 5, 5, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 5,
- 5, 5, 1, 6, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 5, 5, 5, 1, 6, 1, 5,
- 5, 5, 1, 6, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 5, 1, 6, 1, 5, 5, 5, 5,
- 5, 5, 5, 1, 6, 1, 5, 5,
- 1, 8, 7, 7, 7, 7, 7, 7,
- 7, 1, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 5, 5, 5, 1, 6,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 1, 6, 1, 5, 5, 5, 5, 5,
- 5, 5, 1, 6, 4, 4, 4, 4,
- 4, 4, 4, 0, 5, 4, 4, 4,
- 0, 5, 2, 2, 2, 1, 6, 5,
- 1, 6, 5, 5, 5, 5, 5, 2,
- 5, 5, 3, 3, 3, 3, 3, 3,
- 3, 2, 1, 3, 2, 3, 2, 5,
- 5, 5, 5, 5, 5, 2, 5, 5,
- 5, 5, 3, 3, 3, 2, 2, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 1, 6, 5, 5, 5, 5, 5, 5,
- 5, 1, 6, 5, 5, 1, 8, 7,
- 7, 7, 7, 7, 7, 7, 1, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 5, 5, 5, 1, 6, 5, 5, 5,
- 1, 6, 5, 5, 5, 5, 5, 5,
- 1, 6, 5, 5, 5, 5, 5, 5,
- 1, 6, 5, 5, 5, 1, 6, 1,
- 5, 5, 5, 5, 5, 5, 5, 1,
- 6, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
+ static const char _thttp_machine_parser_header_Authorization_trans_keys[] = {
+ 65, 80, 97, 112, 85, 117, 84, 116,
+ 72, 104, 79, 111, 82, 114, 73, 105,
+ 90, 122, 65, 97, 84, 116, 73, 105,
+ 79, 111, 78, 110, 9, 32, 58, 9,
+ 13, 32, 66, 68, 98, 100, 13, 10,
+ 9, 13, 32, 66, 68, 98, 100, 13,
+ 65, 97, 13, 83, 115, 13, 73, 105,
+ 13, 67, 99, 9, 13, 32, 9, 13,
+ 32, 33, 37, 39, 65, 67, 78, 79,
+ 81, 82, 85, 97, 99, 110, 111, 113,
+ 114, 117, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 61, 9, 13, 32, 33, 37,
+ 39, 65, 67, 78, 79, 81, 82, 85,
+ 97, 99, 110, 111, 113, 114, 117, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 13, 34, 92, 127,
+ 0, 8, 10, 31, 9, 13, 32, 44,
+ 13, 0, 9, 11, 127, 13, 58, 48,
+ 57, 65, 70, 97, 102, 13, 58, 93,
+ 48, 57, 65, 70, 97, 102, 13, 58,
+ 93, 48, 57, 65, 70, 97, 102, 13,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 58, 93, 13, 58, 48, 57, 65,
+ 70, 97, 102, 13, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 48, 57,
+ 13, 46, 48, 57, 13, 48, 57, 13,
+ 46, 48, 57, 13, 48, 57, 13, 93,
+ 48, 57, 13, 93, 48, 57, 13, 93,
+ 13, 46, 48, 57, 13, 46, 13, 46,
+ 48, 57, 13, 46, 13, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 13, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 58, 93, 48, 57, 65, 70, 97,
+ 102, 13, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 58, 93, 48, 57,
+ 65, 70, 97, 102, 13, 58, 93, 13,
+ 48, 57, 65, 70, 97, 102, 13, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 13, 48, 57, 13,
+ 46, 48, 57, 13, 46, 48, 57, 13,
+ 46, 13, 58, 9, 13, 32, 33, 37,
+ 39, 44, 61, 71, 103, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 79, 111,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 82, 114, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 73, 105, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 84,
+ 116, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 72, 104, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 77, 109, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 78, 110, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 79, 111, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 78,
+ 110, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 67, 99, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 69, 101, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 13, 34, 92, 127, 0, 8, 10,
+ 31, 9, 13, 32, 44, 13, 0, 9,
+ 11, 127, 9, 13, 32, 33, 37, 39,
+ 44, 61, 67, 79, 99, 111, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 37, 39, 44, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 37, 39, 44, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 37, 39, 44, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 37, 39, 44, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 44, 9, 13, 32, 33,
+ 37, 39, 44, 61, 78, 110, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 67,
+ 99, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 69, 101, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 34,
+ 92, 127, 0, 8, 10, 31, 9, 13,
+ 32, 44, 13, 0, 9, 11, 127, 9,
+ 13, 32, 33, 37, 39, 44, 61, 80,
+ 112, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 65, 97, 126, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 81, 113, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 85, 117, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 69, 101, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 34, 92, 127, 0, 8, 10, 31, 9,
+ 13, 32, 44, 13, 0, 9, 11, 127,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 79, 111, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 80, 112, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 65, 83, 97, 115, 126, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 76,
+ 108, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 77, 109, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 34,
+ 92, 127, 0, 8, 10, 31, 9, 13,
+ 32, 44, 13, 0, 9, 11, 127, 9,
+ 13, 32, 33, 37, 39, 44, 61, 80,
+ 112, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 79, 111, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 78, 110, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 83, 115, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 69, 101, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 34, 92, 127, 0, 8, 10, 31, 9,
+ 13, 32, 44, 13, 0, 9, 11, 127,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 82, 83, 114, 115, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 73, 105, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 13, 34, 92, 127, 0, 8, 10,
+ 31, 13, 34, 92, 127, 0, 8, 10,
+ 31, 13, 34, 13, 34, 0, 9, 11,
+ 127, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 65, 67, 78, 79, 81, 82, 85,
+ 92, 97, 99, 110, 111, 113, 114, 117,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 71,
+ 92, 103, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 92, 114, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 73,
+ 92, 105, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 84,
+ 92, 116, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 72,
+ 92, 104, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 92, 99, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 65, 67, 78, 79, 81, 82,
+ 85, 92, 97, 99, 110, 111, 113, 114,
+ 117, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 93, 127, 0, 8, 10, 31,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 71, 92, 103, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 72, 92, 104, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 92, 99, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 79, 92, 99,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 67, 92, 99, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 65, 67, 78, 79, 81, 82, 85, 92,
+ 97, 99, 110, 111, 113, 114, 117, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 93, 127, 0, 8, 10, 31, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 71,
+ 92, 103, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 92, 114, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 73,
+ 92, 105, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 84,
+ 92, 116, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 72,
+ 92, 104, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 92, 99, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 79, 92, 99, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 78, 92, 110, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 67, 92, 99, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 92, 112, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 81, 92, 113, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 85, 92, 117, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 65,
+ 67, 78, 79, 81, 82, 85, 92, 97,
+ 99, 110, 111, 113, 114, 117, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 71, 92,
+ 103, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 82, 92,
+ 114, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 73, 92,
+ 105, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 84, 92,
+ 116, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 72, 92,
+ 104, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 67, 92, 99, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 67, 79, 92, 99, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 67,
+ 92, 99, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 81,
+ 92, 113, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 85,
+ 92, 117, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 83, 92, 97, 115,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 76, 92, 108,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 65, 67, 78, 79,
+ 81, 82, 85, 92, 97, 99, 110, 111,
+ 113, 114, 117, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 13,
+ 34, 58, 92, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 71, 92, 103, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 82, 92, 114, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 92, 105, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 84, 92, 116, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 72, 92, 104, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 67,
+ 92, 99, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 67,
+ 79, 92, 99, 111, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 92, 99, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 81, 92, 113, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 85, 92, 117, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 83, 92, 97, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 80, 92, 112, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 65, 67, 78, 79, 81, 82, 85,
+ 92, 97, 99, 110, 111, 113, 114, 117,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 71, 92, 103, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 72, 92, 104, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 92, 99, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 79, 92, 99,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 67, 92, 99, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 92, 112, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 81, 92, 113, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 85, 92, 117, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 79, 92, 111, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 92, 112, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 83, 92,
+ 97, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 83,
+ 92, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 83, 92, 114, 115, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 73, 92, 105, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 65, 67, 78, 79, 81, 82, 85, 92,
+ 97, 99, 110, 111, 113, 114, 117, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 71, 92,
+ 103, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 82, 92,
+ 114, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 73, 92,
+ 105, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 84, 92,
+ 116, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 72, 92,
+ 104, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 67, 92, 99, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 67, 79, 92, 99, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 92,
+ 110, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 67, 92,
+ 99, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 81, 92, 113,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 83, 92, 97, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 92, 112, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 79, 92, 111, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 83, 92, 115, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 83, 92, 114, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 73, 92, 105, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 82, 92, 114, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 77, 92, 109, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 9, 13, 32, 44, 13, 0, 9, 11,
+ 127, 9, 13, 32, 33, 34, 37, 39,
+ 65, 67, 78, 79, 81, 82, 85, 92,
+ 97, 99, 110, 111, 113, 114, 117, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 93, 127, 0, 8, 10, 31, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 71,
+ 92, 103, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 92, 114, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 73,
+ 92, 105, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 84,
+ 92, 116, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 72,
+ 92, 104, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 92, 99, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 79, 92, 99, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 78, 92, 110, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 67, 92, 99, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 92, 112, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 81, 92, 113, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 85, 92, 117, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 92, 112, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 83, 92, 97,
+ 115, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 80, 92,
+ 112, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 92,
+ 110, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 83, 92,
+ 115, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 82, 83,
+ 92, 114, 115, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 78, 92, 110, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 78, 92, 110, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 83, 92, 114, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 73, 92, 105, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 92, 114, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 65, 92, 97, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 80, 92, 112, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 83, 92, 114, 115, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 73, 92, 105, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 82, 92, 114, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 77, 92, 109, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 83, 92, 97, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 80, 92, 112, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 83, 92, 114, 115, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 73, 92, 105, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 82, 92, 114, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 77, 92, 109, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 81, 92, 113, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 85, 92, 117, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 83, 92, 97, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 80, 92, 112, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 92, 110, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 83, 92, 114, 115, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 73, 92, 105, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 82, 92, 114, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 77, 92, 109, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 79, 92, 99,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 67, 92, 99, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 92, 112, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 81, 92, 113, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 85, 92, 117, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 83, 92, 97, 115,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 76, 92, 108,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 83, 92, 115, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 82, 83, 92, 114, 115,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 73, 92, 105,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 82, 92, 114,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 78, 92, 110,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 69, 101, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 82, 114,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 78, 110, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 65, 97, 126, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 77,
+ 109, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 69, 101, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 82, 83,
+ 114, 115, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 73, 105, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 34, 92, 127, 0, 8, 10, 31, 13,
+ 34, 92, 127, 0, 8, 10, 31, 13,
+ 34, 0, 9, 11, 127, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 65, 67, 78,
+ 79, 81, 82, 85, 92, 97, 99, 110,
+ 111, 113, 114, 117, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 13,
+ 34, 58, 92, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 92, 93, 127, 0, 8, 10, 31, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 71, 92, 103, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 82, 92, 114, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 92, 105, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 84, 92, 116, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 72, 92, 104, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 67,
+ 92, 99, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 67, 79,
+ 92, 99, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 102,
+ 103, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 102, 103, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 102, 103, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 102, 103, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 102, 103, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 102, 103, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 102, 103,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 92, 99, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 80, 92, 112, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 65, 92, 97, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 81, 92, 113, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 85, 92, 117, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 79, 92, 111, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 92, 112, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 83, 92,
+ 97, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 80, 92,
+ 112, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 92,
+ 110, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 83, 92,
+ 115, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 82, 83, 92,
+ 114, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 73,
+ 92, 105, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 92, 114, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 13, 73, 105,
+ 13, 71, 103, 13, 69, 101, 13, 83,
+ 115, 13, 84, 116, 9, 13, 32, 10,
+ 13, 9, 13, 32, 82, 114, 79, 111,
+ 88, 120, 89, 121, 45, 65, 97, 0
+ };
-static const short _thttp_machine_parser_header_Authorization_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 20,
- 23, 26, 29, 32, 35, 38, 41, 45,
- 53, 55, 57, 65, 69, 73, 77, 81,
- 85, 112, 126, 132, 159, 175, 190, 203,
- 208, 215, 220, 224, 230, 237, 244, 251,
- 255, 261, 269, 272, 276, 279, 283, 286,
- 290, 294, 297, 301, 304, 308, 311, 319,
- 327, 334, 341, 348, 355, 359, 364, 372,
- 380, 388, 391, 395, 399, 402, 405, 421,
- 437, 453, 469, 485, 501, 517, 531, 537,
- 552, 565, 581, 597, 613, 629, 645, 659,
- 665, 680, 687, 692, 696, 714, 728, 734,
- 751, 766, 781, 796, 811, 826, 841, 856,
- 861, 877, 893, 909, 923, 929, 944, 951,
- 956, 960, 976, 992, 1008, 1024, 1040, 1054,
- 1060, 1075, 1082, 1087, 1091, 1107, 1123, 1137,
- 1143, 1158, 1171, 1187, 1205, 1221, 1237, 1251,
- 1257, 1272, 1279, 1284, 1288, 1304, 1320, 1336,
- 1352, 1368, 1382, 1388, 1403, 1410, 1415, 1419,
- 1437, 1453, 1467, 1473, 1488, 1495, 1502, 1505,
- 1510, 1519, 1550, 1568, 1578, 1596, 1613, 1622,
- 1633, 1645, 1657, 1669, 1678, 1689, 1702, 1710,
- 1719, 1727, 1736, 1744, 1753, 1762, 1770, 1779,
- 1787, 1796, 1804, 1817, 1830, 1842, 1854, 1866,
- 1878, 1887, 1897, 1910, 1923, 1936, 1944, 1953,
- 1962, 1970, 1978, 1998, 2018, 2038, 2058, 2078,
- 2098, 2118, 2138, 2156, 2166, 2184, 2201, 2221,
- 2241, 2261, 2281, 2301, 2319, 2329, 2347, 2356,
- 2365, 2396, 2414, 2424, 2442, 2459, 2468, 2479,
- 2491, 2503, 2515, 2524, 2535, 2548, 2556, 2565,
- 2573, 2582, 2590, 2599, 2608, 2616, 2625, 2633,
- 2642, 2650, 2663, 2676, 2688, 2700, 2712, 2724,
- 2733, 2743, 2756, 2769, 2782, 2790, 2799, 2808,
- 2816, 2824, 2844, 2864, 2884, 2904, 2924, 2944,
- 2964, 2984, 3002, 3012, 3030, 3047, 3067, 3087,
- 3107, 3127, 3147, 3165, 3175, 3193, 3202, 3224,
- 3242, 3252, 3272, 3291, 3310, 3329, 3348, 3367,
- 3386, 3405, 3414, 3434, 3454, 3474, 3492, 3502,
- 3520, 3529, 3538, 3569, 3587, 3597, 3615, 3632,
- 3641, 3652, 3664, 3676, 3688, 3697, 3708, 3721,
- 3729, 3738, 3746, 3755, 3763, 3772, 3781, 3789,
- 3798, 3807, 3815, 3824, 3832, 3845, 3858, 3870,
- 3882, 3894, 3906, 3915, 3925, 3938, 3951, 3964,
- 3972, 3981, 3990, 3998, 4006, 4026, 4046, 4066,
- 4086, 4106, 4126, 4146, 4166, 4184, 4194, 4212,
- 4229, 4249, 4269, 4289, 4309, 4329, 4347, 4357,
- 4375, 4384, 4406, 4424, 4434, 4454, 4473, 4492,
- 4511, 4530, 4549, 4568, 4587, 4596, 4616, 4636,
- 4656, 4674, 4684, 4702, 4711, 4731, 4751, 4771,
- 4791, 4811, 4829, 4839, 4857, 4866, 4875, 4906,
- 4924, 4934, 4952, 4969, 4978, 4989, 5001, 5013,
- 5025, 5034, 5045, 5058, 5066, 5075, 5083, 5092,
- 5100, 5109, 5118, 5126, 5135, 5144, 5152, 5161,
- 5169, 5182, 5195, 5207, 5219, 5231, 5243, 5252,
- 5262, 5275, 5288, 5301, 5309, 5318, 5327, 5335,
- 5343, 5363, 5383, 5403, 5423, 5443, 5463, 5483,
- 5503, 5521, 5531, 5549, 5566, 5586, 5606, 5626,
- 5646, 5666, 5684, 5694, 5712, 5721, 5743, 5761,
- 5771, 5791, 5810, 5829, 5848, 5867, 5886, 5905,
- 5924, 5933, 5953, 5973, 5993, 6011, 6021, 6039,
- 6048, 6068, 6088, 6108, 6128, 6148, 6166, 6176,
- 6194, 6203, 6223, 6243, 6261, 6271, 6289, 6306,
- 6326, 6348, 6368, 6388, 6406, 6416, 6434, 6443,
- 6452, 6483, 6501, 6511, 6529, 6546, 6555, 6566,
- 6578, 6590, 6602, 6611, 6622, 6635, 6643, 6652,
- 6660, 6669, 6677, 6686, 6695, 6703, 6712, 6721,
- 6729, 6738, 6746, 6759, 6772, 6784, 6796, 6808,
- 6820, 6829, 6839, 6852, 6865, 6878, 6886, 6895,
- 6904, 6912, 6920, 6940, 6960, 6980, 7000, 7020,
- 7040, 7060, 7080, 7098, 7108, 7126, 7143, 7163,
- 7183, 7203, 7223, 7243, 7261, 7271, 7289, 7298,
- 7320, 7338, 7348, 7368, 7387, 7406, 7425, 7444,
- 7463, 7482, 7501, 7510, 7530, 7550, 7570, 7588,
- 7598, 7616, 7625, 7645, 7665, 7685, 7705, 7725,
- 7743, 7753, 7771, 7780, 7800, 7820, 7838, 7848,
- 7866, 7883, 7903, 7925, 7945, 7965, 7983, 7993,
- 8011, 8020, 8040, 8060, 8080, 8100, 8120, 8138,
- 8148, 8166, 8175, 8184, 8215, 8233, 8243, 8261,
- 8278, 8287, 8298, 8310, 8322, 8334, 8343, 8354,
- 8367, 8375, 8384, 8392, 8401, 8409, 8418, 8427,
- 8435, 8444, 8453, 8461, 8470, 8478, 8491, 8504,
- 8516, 8528, 8540, 8552, 8561, 8571, 8584, 8597,
- 8610, 8618, 8627, 8636, 8644, 8652, 8672, 8692,
- 8712, 8732, 8752, 8772, 8792, 8812, 8830, 8840,
- 8858, 8875, 8895, 8915, 8935, 8955, 8975, 8993,
- 9003, 9021, 9030, 9052, 9070, 9080, 9100, 9119,
- 9138, 9157, 9176, 9195, 9214, 9233, 9242, 9262,
- 9282, 9302, 9320, 9330, 9348, 9357, 9377, 9397,
- 9417, 9437, 9457, 9475, 9485, 9503, 9512, 9532,
- 9552, 9570, 9580, 9598, 9615, 9635, 9657, 9677,
- 9697, 9715, 9725, 9743, 9752, 9772, 9792, 9812,
- 9832, 9852, 9870, 9880, 9898, 9907, 9929, 9949,
- 9967, 9977, 9995, 10004, 10013, 10044, 10062, 10072,
- 10090, 10107, 10118, 10130, 10142, 10154, 10163, 10174,
- 10187, 10195, 10204, 10212, 10221, 10229, 10238, 10247,
- 10255, 10264, 10273, 10281, 10290, 10298, 10311, 10324,
- 10336, 10348, 10360, 10372, 10381, 10391, 10404, 10417,
- 10430, 10438, 10447, 10456, 10464, 10472, 10492, 10512,
- 10532, 10552, 10572, 10592, 10612, 10632, 10650, 10660,
- 10678, 10695, 10715, 10735, 10755, 10775, 10795, 10813,
- 10823, 10841, 10863, 10881, 10891, 10911, 10930, 10949,
- 10968, 10987, 11006, 11025, 11044, 11053, 11073, 11093,
- 11113, 11131, 11141, 11159, 11179, 11199, 11219, 11239,
- 11259, 11277, 11287, 11305, 11325, 11345, 11363, 11373,
- 11391, 11408, 11428, 11450, 11470, 11490, 11508, 11518,
- 11536, 11556, 11576, 11596, 11616, 11636, 11654, 11664,
- 11682, 11704, 11724, 11742, 11752, 11770, 11790, 11810,
- 11830, 11850, 11870, 11890, 11908, 11918, 11936, 11945,
- 11952, 11957, 11961, 11992, 12010, 12020, 12038, 12055,
- 12064, 12075, 12087, 12099, 12111, 12120, 12131, 12144,
- 12152, 12161, 12169, 12178, 12186, 12195, 12204, 12212,
- 12221, 12230, 12238, 12247, 12255, 12268, 12281, 12293,
- 12305, 12317, 12329, 12338, 12348, 12361, 12374, 12387,
- 12395, 12404, 12413, 12421, 12429, 12449, 12469, 12489,
- 12509, 12529, 12549, 12569, 12589, 12607, 12617, 12635,
- 12652, 12672, 12692, 12712, 12732, 12752, 12770, 12780,
- 12798, 12807, 12829, 12847, 12857, 12877, 12896, 12915,
- 12934, 12953, 12972, 12991, 13010, 13019, 13039, 13059,
- 13079, 13097, 13107, 13125, 13134, 13154, 13174, 13194,
- 13214, 13234, 13252, 13262, 13280, 13289, 13309, 13329,
- 13347, 13357, 13375, 13392, 13412, 13434, 13454, 13474,
- 13492, 13502, 13520, 13529, 13549, 13569, 13589, 13609,
- 13629, 13647, 13657, 13675, 13684, 13706, 13726, 13744,
- 13754, 13772, 13781, 13801, 13821, 13841, 13861, 13881,
- 13901, 13919, 13929, 13947, 13956, 13976, 13996, 14016,
- 14036, 14056, 14076, 14094, 14104, 14122, 14131, 14153,
- 14173, 14191, 14201, 14219, 14228, 14248, 14268, 14288,
- 14308, 14328, 14348, 14366, 14376, 14394, 14403, 14423,
- 14443, 14463, 14483, 14503, 14521, 14531, 14549, 14558,
- 14580, 14600, 14618, 14628, 14646, 14655, 14675, 14695,
- 14715, 14735, 14755, 14775, 14793, 14803, 14821, 14830,
- 14850, 14870, 14888, 14898, 14916, 14933, 14953, 14975,
- 14995, 15015, 15033, 15043, 15061, 15070, 15090, 15110,
- 15130, 15150, 15170, 15188, 15198, 15216, 15225, 15247,
- 15267, 15285, 15295, 15313, 15322, 15342, 15362, 15382,
- 15402, 15422, 15442, 15460, 15470, 15488, 15497, 15517,
- 15537, 15557, 15577, 15597, 15615, 15625, 15643, 15652,
- 15672, 15692, 15710, 15720, 15738, 15755, 15775, 15797,
- 15817, 15837, 15855, 15865, 15883, 15892, 15912, 15932,
- 15952, 15972, 15992, 16010, 16020, 16038, 16047, 16069,
- 16089, 16107, 16117, 16135, 16144, 16164, 16184, 16204,
- 16224, 16244, 16264, 16282, 16292, 16310, 16319, 16341,
- 16359, 16369, 16389, 16408, 16427, 16446, 16465, 16484,
- 16503, 16522, 16531, 16551, 16571, 16591, 16609, 16619,
- 16637, 16657, 16677, 16697, 16717, 16737, 16755, 16765,
- 16783, 16803, 16823, 16841, 16851, 16869, 16886, 16906,
- 16928, 16948, 16968, 16986, 16996, 17014, 17034, 17054,
- 17074, 17094, 17114, 17132, 17142, 17160, 17182, 17202,
- 17220, 17230, 17248, 17257, 17277, 17297, 17317, 17337,
- 17357, 17377, 17395, 17405, 17423, 17439, 17455, 17471,
- 17487, 17503, 17519, 17533, 17539, 17554, 17572, 17588,
- 17602, 17608, 17623, 17630, 17637, 17642, 17651, 17682,
- 17700, 17710, 17728, 17745, 17756, 17768, 17780, 17792,
- 17801, 17812, 17825, 17833, 17842, 17850, 17859, 17867,
- 17876, 17885, 17893, 17902, 17911, 17919, 17928, 17936,
- 17949, 17962, 17974, 17986, 17998, 18010, 18019, 18029,
- 18042, 18055, 18068, 18076, 18085, 18094, 18102, 18110,
- 18130, 18150, 18170, 18190, 18210, 18230, 18250, 18270,
- 18288, 18298, 18316, 18333, 18353, 18373, 18393, 18413,
- 18433, 18451, 18461, 18479, 18501, 18519, 18529, 18549,
- 18568, 18587, 18606, 18625, 18644, 18663, 18682, 18691,
- 18711, 18731, 18751, 18769, 18779, 18797, 18817, 18837,
- 18857, 18877, 18897, 18915, 18925, 18943, 18963, 18983,
- 19001, 19011, 19029, 19046, 19066, 19088, 19108, 19128,
- 19146, 19156, 19174, 19194, 19214, 19234, 19254, 19274,
- 19292, 19302, 19320, 19342, 19362, 19380, 19390, 19408,
- 19417, 19437, 19457, 19477, 19497, 19517, 19537, 19555,
- 19565, 19583, 19587, 19591, 19595, 19599, 19603, 19607,
- 19610, 19614, 19617, 19620, 19623, 19626, 19628, 19631
-};
+ static const char _thttp_machine_parser_header_Authorization_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 3, 7,
+ 1, 1, 7, 3, 3, 3, 3, 3,
+ 21, 9, 5, 21, 11, 9, 8, 4,
+ 4, 4, 1, 2, 3, 3, 3, 3,
+ 2, 4, 1, 2, 1, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 4, 4,
+ 3, 3, 3, 3, 3, 1, 4, 4,
+ 4, 1, 2, 2, 2, 2, 11, 11,
+ 11, 11, 11, 11, 11, 9, 5, 9,
+ 8, 11, 11, 11, 11, 11, 9, 5,
+ 9, 4, 4, 1, 13, 9, 5, 9,
+ 8, 8, 8, 8, 8, 8, 8, 4,
+ 11, 11, 11, 9, 5, 9, 4, 4,
+ 1, 11, 11, 11, 11, 11, 9, 5,
+ 9, 4, 4, 1, 11, 11, 9, 5,
+ 9, 8, 11, 13, 11, 11, 9, 5,
+ 9, 4, 4, 1, 11, 11, 11, 11,
+ 11, 9, 5, 9, 4, 4, 1, 13,
+ 11, 9, 5, 9, 4, 4, 2, 2,
+ 7, 24, 12, 8, 11, 11, 7, 5,
+ 6, 6, 6, 6, 5, 7, 4, 5,
+ 4, 5, 4, 5, 5, 5, 5, 5,
+ 5, 5, 7, 7, 6, 6, 6, 6,
+ 6, 4, 7, 7, 7, 4, 5, 5,
+ 5, 5, 14, 14, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 11, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 7,
+ 24, 12, 8, 11, 11, 7, 5, 6,
+ 6, 6, 6, 5, 7, 4, 5, 4,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 7, 7, 6, 6, 6, 6, 6,
+ 4, 7, 7, 7, 4, 5, 5, 5,
+ 5, 14, 14, 14, 14, 14, 14, 14,
+ 14, 12, 8, 11, 11, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 16, 12,
+ 8, 11, 11, 11, 11, 11, 11, 11,
+ 11, 7, 14, 14, 14, 12, 8, 11,
+ 7, 7, 24, 12, 8, 11, 11, 7,
+ 5, 6, 6, 6, 6, 5, 7, 4,
+ 5, 4, 5, 4, 5, 5, 5, 7,
+ 5, 5, 5, 5, 7, 7, 6, 6,
+ 6, 6, 6, 4, 7, 7, 7, 4,
+ 5, 5, 5, 5, 14, 14, 14, 14,
+ 14, 14, 14, 14, 12, 8, 11, 11,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 7, 16, 12, 8, 11, 11, 11, 11,
+ 11, 11, 11, 11, 7, 14, 14, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 12, 8, 11, 7, 7, 24, 12,
+ 8, 11, 11, 7, 5, 6, 6, 6,
+ 6, 5, 7, 4, 5, 4, 5, 4,
+ 5, 5, 5, 7, 5, 5, 5, 5,
+ 7, 7, 6, 6, 6, 6, 6, 4,
+ 7, 7, 7, 4, 5, 5, 5, 5,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 12, 8, 11, 11, 14, 14, 14, 14,
+ 14, 12, 8, 11, 7, 16, 12, 8,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 7, 14, 14, 14, 12, 8, 11, 7,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 7, 14, 14, 12, 8, 11, 11, 14,
+ 16, 14, 14, 12, 8, 11, 7, 7,
+ 24, 12, 8, 11, 11, 7, 5, 6,
+ 6, 6, 6, 5, 7, 4, 5, 4,
+ 5, 4, 5, 5, 5, 7, 5, 5,
+ 5, 5, 7, 7, 6, 6, 6, 6,
+ 6, 4, 7, 7, 7, 4, 5, 5,
+ 5, 5, 14, 14, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 11, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 16,
+ 12, 8, 11, 11, 11, 11, 11, 11,
+ 11, 11, 7, 14, 14, 14, 12, 8,
+ 11, 7, 14, 14, 14, 14, 14, 12,
+ 8, 11, 7, 14, 14, 12, 8, 11,
+ 11, 14, 16, 14, 14, 12, 8, 11,
+ 7, 14, 14, 14, 14, 14, 12, 8,
+ 11, 7, 7, 24, 12, 8, 11, 11,
+ 7, 5, 6, 6, 6, 6, 5, 7,
+ 4, 5, 4, 5, 4, 5, 5, 5,
+ 7, 5, 5, 5, 5, 7, 7, 6,
+ 6, 6, 6, 6, 4, 7, 7, 7,
+ 4, 5, 5, 5, 5, 14, 14, 14,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 11, 14, 14, 14, 14, 14, 12, 8,
+ 11, 7, 16, 12, 8, 11, 11, 11,
+ 11, 11, 11, 11, 11, 7, 14, 14,
+ 14, 12, 8, 11, 7, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 14, 14,
+ 12, 8, 11, 11, 14, 16, 14, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 12, 8, 11, 7, 16, 14, 12,
+ 8, 11, 7, 7, 24, 12, 8, 11,
+ 11, 5, 6, 6, 6, 6, 5, 7,
+ 4, 5, 4, 5, 4, 5, 5, 5,
+ 7, 5, 5, 5, 5, 7, 7, 6,
+ 6, 6, 6, 6, 4, 7, 7, 7,
+ 4, 5, 5, 5, 5, 14, 14, 14,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 11, 14, 14, 14, 14, 14, 12, 8,
+ 11, 16, 12, 8, 11, 11, 11, 11,
+ 11, 11, 11, 11, 7, 14, 14, 14,
+ 12, 8, 11, 14, 14, 14, 14, 14,
+ 12, 8, 11, 14, 14, 12, 8, 11,
+ 11, 14, 16, 14, 14, 12, 8, 11,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 16, 14, 12, 8, 11, 14, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 4,
+ 4, 1, 24, 12, 8, 11, 11, 7,
+ 5, 6, 6, 6, 6, 5, 7, 4,
+ 5, 4, 5, 4, 5, 5, 5, 7,
+ 5, 5, 5, 5, 7, 7, 6, 6,
+ 6, 6, 6, 4, 7, 7, 7, 4,
+ 5, 5, 5, 5, 14, 14, 14, 14,
+ 14, 14, 14, 14, 12, 8, 11, 11,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 7, 16, 12, 8, 11, 11, 11, 11,
+ 11, 11, 11, 11, 7, 14, 14, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 12, 8, 11, 7, 14, 14, 12,
+ 8, 11, 11, 14, 16, 14, 14, 12,
+ 8, 11, 7, 14, 14, 14, 14, 14,
+ 12, 8, 11, 7, 16, 14, 12, 8,
+ 11, 7, 14, 14, 14, 14, 14, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 16, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 16,
+ 14, 12, 8, 11, 7, 14, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 14,
+ 14, 12, 8, 11, 11, 14, 16, 14,
+ 14, 12, 8, 11, 7, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 16, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 14, 14,
+ 14, 14, 14, 12, 8, 11, 7, 14,
+ 14, 12, 8, 11, 11, 14, 16, 14,
+ 14, 12, 8, 11, 7, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 16, 14,
+ 12, 8, 11, 7, 14, 14, 14, 14,
+ 14, 14, 12, 8, 11, 7, 16, 12,
+ 8, 11, 11, 11, 11, 11, 11, 11,
+ 11, 7, 14, 14, 14, 12, 8, 11,
+ 14, 14, 14, 14, 14, 12, 8, 11,
+ 14, 14, 12, 8, 11, 11, 14, 16,
+ 14, 14, 12, 8, 11, 14, 14, 14,
+ 14, 14, 12, 8, 11, 16, 14, 12,
+ 8, 11, 7, 14, 14, 14, 14, 14,
+ 14, 12, 8, 11, 11, 11, 11, 11,
+ 11, 11, 9, 5, 9, 13, 11, 9,
+ 5, 9, 4, 4, 2, 7, 24, 12,
+ 8, 11, 11, 5, 6, 6, 6, 6,
+ 5, 7, 4, 5, 4, 5, 4, 5,
+ 5, 5, 7, 5, 5, 5, 5, 7,
+ 7, 6, 6, 6, 6, 6, 4, 7,
+ 7, 7, 4, 5, 5, 5, 5, 14,
+ 14, 14, 14, 14, 14, 14, 14, 12,
+ 8, 11, 11, 14, 14, 14, 14, 14,
+ 12, 8, 11, 16, 12, 8, 11, 11,
+ 11, 11, 11, 11, 11, 11, 7, 14,
+ 14, 14, 12, 8, 11, 14, 14, 14,
+ 14, 14, 12, 8, 11, 14, 14, 12,
+ 8, 11, 11, 14, 16, 14, 14, 12,
+ 8, 11, 14, 14, 14, 14, 14, 12,
+ 8, 11, 16, 14, 12, 8, 11, 7,
+ 14, 14, 14, 14, 14, 14, 12, 8,
+ 11, 3, 3, 3, 3, 3, 3, 2,
+ 3, 2, 2, 2, 2, 1, 2, 0
+ };
-static const short _thttp_machine_parser_header_Authorization_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 14, 14, 15, 1, 17, 18, 17,
- 19, 20, 19, 20, 16, 21, 16, 22,
- 1, 17, 21, 17, 19, 20, 19, 20,
- 16, 21, 23, 23, 16, 21, 24, 24,
- 16, 21, 25, 25, 16, 21, 26, 26,
- 16, 27, 21, 27, 16, 28, 21, 28,
- 29, 29, 29, 30, 31, 32, 33, 34,
- 35, 36, 30, 31, 32, 33, 34, 35,
- 36, 29, 29, 29, 29, 29, 29, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 39, 39, 39, 39, 39, 16, 42, 21,
- 42, 43, 41, 16, 43, 21, 43, 29,
- 29, 29, 30, 31, 32, 33, 34, 35,
- 44, 30, 31, 32, 33, 34, 35, 44,
- 29, 29, 29, 29, 29, 29, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 45,
- 45, 39, 39, 39, 39, 39, 16, 41,
- 21, 41, 46, 47, 46, 46, 48, 46,
- 46, 46, 46, 46, 46, 16, 49, 38,
- 49, 46, 46, 46, 40, 46, 46, 46,
- 46, 46, 16, 50, 21, 50, 43, 16,
- 21, 51, 52, 16, 16, 16, 47, 49,
- 38, 49, 40, 16, 21, 47, 47, 16,
- 21, 54, 53, 53, 53, 16, 21, 56,
- 51, 55, 55, 55, 16, 21, 56, 51,
- 57, 57, 57, 16, 21, 56, 51, 58,
- 58, 58, 16, 21, 56, 51, 16, 21,
- 60, 59, 53, 53, 16, 21, 61, 56,
- 51, 62, 55, 55, 16, 21, 63, 16,
- 21, 64, 65, 16, 21, 66, 16, 21,
- 67, 68, 16, 21, 69, 16, 21, 51,
- 70, 16, 21, 51, 71, 16, 21, 51,
- 16, 21, 67, 72, 16, 21, 67, 16,
- 21, 64, 73, 16, 21, 64, 16, 21,
- 61, 56, 51, 74, 57, 57, 16, 21,
- 61, 56, 51, 58, 58, 58, 16, 21,
- 76, 51, 75, 75, 75, 16, 21, 78,
- 51, 77, 77, 77, 16, 21, 78, 51,
- 79, 79, 79, 16, 21, 78, 51, 80,
- 80, 80, 16, 21, 78, 51, 16, 21,
- 81, 75, 75, 16, 21, 61, 78, 51,
- 82, 77, 77, 16, 21, 61, 78, 51,
- 83, 79, 79, 16, 21, 61, 78, 51,
- 80, 80, 80, 16, 21, 84, 16, 21,
- 61, 85, 16, 21, 61, 86, 16, 21,
- 61, 16, 21, 60, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 87, 87, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 88, 88, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 89, 89, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 90, 90, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 91, 91, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 92, 92, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 93, 93, 39,
- 39, 39, 39, 39, 16, 94, 38, 94,
- 39, 39, 39, 40, 95, 39, 39, 39,
- 39, 39, 16, 96, 21, 96, 43, 95,
- 16, 95, 21, 95, 97, 47, 97, 97,
- 48, 97, 97, 97, 97, 97, 97, 16,
- 98, 99, 98, 100, 100, 100, 101, 100,
- 100, 100, 100, 100, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 102, 102, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 103, 103, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 104, 104, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 105, 105, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 106, 106, 39,
- 39, 39, 39, 39, 16, 107, 38, 107,
- 39, 39, 39, 40, 108, 39, 39, 39,
- 39, 39, 16, 109, 21, 109, 43, 108,
- 16, 110, 21, 110, 46, 111, 46, 46,
- 48, 46, 46, 46, 46, 46, 46, 16,
- 21, 113, 114, 16, 16, 16, 112, 115,
- 116, 115, 117, 16, 21, 112, 112, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 118, 119, 118, 119, 39, 39, 39, 39,
- 39, 16, 120, 38, 120, 39, 39, 39,
- 40, 121, 39, 39, 39, 39, 39, 16,
- 122, 21, 122, 43, 121, 16, 121, 21,
- 121, 46, 47, 46, 46, 48, 46, 46,
- 46, 123, 46, 46, 123, 46, 16, 49,
- 38, 49, 46, 46, 46, 40, 46, 46,
- 124, 46, 46, 124, 46, 16, 49, 38,
- 49, 46, 46, 46, 40, 46, 46, 125,
- 46, 46, 125, 46, 16, 49, 38, 49,
- 46, 46, 46, 40, 46, 46, 126, 46,
- 46, 126, 46, 16, 49, 38, 49, 46,
- 46, 46, 40, 46, 46, 127, 46, 46,
- 127, 46, 16, 49, 38, 49, 46, 46,
- 46, 40, 46, 46, 128, 46, 46, 128,
- 46, 16, 49, 38, 49, 46, 46, 46,
- 40, 46, 46, 129, 46, 46, 129, 46,
- 16, 49, 38, 49, 46, 46, 46, 40,
- 46, 46, 130, 46, 46, 130, 46, 16,
- 131, 132, 131, 133, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 134, 134, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 135, 135, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 136, 136, 39,
- 39, 39, 39, 39, 16, 137, 38, 137,
- 39, 39, 39, 40, 138, 39, 39, 39,
- 39, 39, 16, 139, 21, 139, 43, 138,
- 16, 140, 21, 140, 46, 141, 46, 46,
- 48, 46, 46, 46, 46, 46, 46, 16,
- 21, 143, 144, 16, 16, 16, 142, 145,
- 146, 145, 147, 16, 21, 142, 142, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 148, 148, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 149, 149, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 150, 150, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 151, 151, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 152, 152, 39, 39, 39, 39, 39, 16,
- 153, 38, 153, 39, 39, 39, 40, 154,
- 39, 39, 39, 39, 39, 16, 155, 21,
- 155, 43, 154, 16, 156, 21, 156, 46,
- 157, 46, 46, 48, 46, 46, 46, 46,
- 46, 46, 16, 21, 159, 160, 16, 16,
- 16, 158, 161, 162, 161, 163, 16, 21,
- 158, 158, 16, 37, 38, 37, 39, 39,
- 39, 40, 41, 164, 164, 39, 39, 39,
- 39, 39, 16, 37, 38, 37, 39, 39,
- 39, 40, 41, 165, 165, 39, 39, 39,
- 39, 39, 16, 166, 38, 166, 39, 39,
- 39, 40, 167, 39, 39, 39, 39, 39,
- 16, 168, 21, 168, 43, 167, 16, 167,
- 21, 167, 169, 47, 169, 169, 48, 169,
- 169, 169, 169, 169, 169, 16, 170, 171,
- 170, 172, 172, 172, 173, 172, 172, 172,
- 172, 172, 16, 37, 38, 37, 39, 39,
- 39, 40, 41, 174, 174, 39, 39, 39,
- 39, 39, 16, 37, 38, 37, 39, 39,
- 39, 40, 41, 175, 176, 175, 176, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 177, 177, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 178, 178, 39,
- 39, 39, 39, 39, 16, 179, 38, 179,
- 39, 39, 39, 40, 180, 39, 39, 39,
- 39, 39, 16, 181, 21, 181, 43, 180,
- 16, 182, 21, 182, 46, 183, 46, 46,
- 48, 46, 46, 46, 46, 46, 46, 16,
- 21, 185, 186, 16, 16, 16, 184, 187,
- 188, 187, 189, 16, 21, 184, 184, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 190, 190, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 191, 191, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 192, 192, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 193, 193, 39, 39, 39, 39, 39, 16,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 194, 194, 39, 39, 39, 39, 39, 16,
- 195, 38, 195, 39, 39, 39, 40, 196,
- 39, 39, 39, 39, 39, 16, 197, 21,
- 197, 43, 196, 16, 198, 21, 198, 46,
- 199, 46, 46, 48, 46, 46, 46, 46,
- 46, 46, 16, 21, 201, 202, 16, 16,
- 16, 200, 203, 204, 203, 205, 16, 21,
- 200, 200, 16, 37, 38, 37, 39, 39,
- 39, 40, 41, 206, 207, 206, 207, 39,
- 39, 39, 39, 39, 16, 37, 38, 37,
- 39, 39, 39, 40, 41, 208, 208, 39,
- 39, 39, 39, 39, 16, 209, 38, 209,
- 39, 39, 39, 40, 210, 39, 39, 39,
- 39, 39, 16, 211, 21, 211, 43, 210,
- 16, 210, 21, 210, 46, 212, 46, 46,
- 48, 46, 46, 46, 46, 46, 46, 16,
- 21, 215, 216, 214, 214, 214, 213, 21,
- 219, 220, 218, 218, 218, 217, 21, 219,
- 218, 21, 221, 217, 217, 218, 222, 21,
- 222, 51, 223, 52, 16, 16, 47, 223,
- 21, 223, 224, 51, 224, 224, 225, 226,
- 227, 228, 229, 230, 231, 52, 225, 226,
- 227, 228, 229, 230, 231, 224, 16, 16,
- 224, 224, 224, 224, 224, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 52,
- 233, 16, 16, 233, 233, 233, 233, 47,
- 236, 21, 236, 51, 223, 235, 52, 16,
- 16, 47, 235, 21, 235, 237, 238, 237,
- 237, 239, 52, 237, 16, 16, 237, 237,
- 237, 237, 237, 47, 240, 38, 240, 237,
- 51, 237, 237, 234, 52, 237, 16, 16,
- 237, 237, 237, 237, 47, 240, 38, 240,
- 51, 234, 52, 16, 16, 47, 21, 51,
- 242, 52, 16, 16, 16, 241, 241, 241,
- 47, 21, 51, 244, 52, 238, 16, 16,
- 16, 243, 243, 243, 47, 21, 51, 244,
- 52, 238, 16, 16, 16, 245, 245, 245,
- 47, 21, 51, 244, 52, 238, 16, 16,
- 16, 246, 246, 246, 47, 21, 51, 244,
- 52, 238, 16, 16, 16, 47, 21, 51,
- 248, 52, 16, 16, 16, 247, 241, 241,
- 47, 21, 51, 249, 244, 52, 238, 16,
- 16, 16, 250, 243, 243, 47, 21, 51,
- 52, 16, 16, 16, 251, 47, 21, 51,
- 252, 52, 16, 16, 16, 253, 47, 21,
- 51, 52, 16, 16, 16, 254, 47, 21,
- 51, 255, 52, 16, 16, 16, 256, 47,
- 21, 51, 52, 16, 16, 16, 257, 47,
- 21, 51, 52, 238, 16, 16, 16, 258,
- 47, 21, 51, 52, 238, 16, 16, 16,
- 259, 47, 21, 51, 52, 238, 16, 16,
- 16, 47, 21, 51, 255, 52, 16, 16,
- 16, 260, 47, 21, 51, 255, 52, 16,
- 16, 16, 47, 21, 51, 252, 52, 16,
- 16, 16, 261, 47, 21, 51, 252, 52,
- 16, 16, 16, 47, 21, 51, 249, 244,
- 52, 238, 16, 16, 16, 262, 245, 245,
- 47, 21, 51, 249, 244, 52, 238, 16,
- 16, 16, 246, 246, 246, 47, 21, 51,
- 264, 52, 238, 16, 16, 16, 263, 263,
- 263, 47, 21, 51, 266, 52, 238, 16,
- 16, 16, 265, 265, 265, 47, 21, 51,
- 266, 52, 238, 16, 16, 16, 267, 267,
- 267, 47, 21, 51, 266, 52, 238, 16,
- 16, 16, 268, 268, 268, 47, 21, 51,
- 266, 52, 238, 16, 16, 16, 47, 21,
- 51, 52, 16, 16, 16, 269, 263, 263,
- 47, 21, 51, 249, 266, 52, 238, 16,
- 16, 16, 270, 265, 265, 47, 21, 51,
- 249, 266, 52, 238, 16, 16, 16, 271,
- 267, 267, 47, 21, 51, 249, 266, 52,
- 238, 16, 16, 16, 268, 268, 268, 47,
- 21, 51, 52, 16, 16, 16, 272, 47,
- 21, 51, 249, 52, 16, 16, 16, 273,
- 47, 21, 51, 249, 52, 16, 16, 16,
- 274, 47, 21, 51, 249, 52, 16, 16,
- 16, 47, 21, 51, 248, 52, 16, 16,
- 16, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 275, 52, 275, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 276,
- 52, 276, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 277, 52, 277, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 278,
- 52, 278, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 279, 52, 279, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 280,
- 52, 280, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 281, 52, 281, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 282,
- 52, 282, 233, 16, 16, 233, 233, 233,
- 233, 47, 283, 38, 283, 233, 51, 233,
- 233, 234, 284, 52, 233, 16, 16, 233,
- 233, 233, 233, 47, 285, 21, 285, 51,
- 223, 284, 52, 16, 16, 47, 284, 21,
- 284, 286, 238, 286, 286, 239, 52, 286,
- 16, 16, 286, 286, 286, 286, 286, 47,
- 287, 99, 287, 288, 51, 288, 288, 289,
- 52, 288, 16, 16, 288, 288, 288, 288,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 290, 52, 290, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 291, 52,
- 291, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 292, 52, 292, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 293, 52,
- 293, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 294, 52, 294, 233, 16, 16,
- 233, 233, 233, 233, 47, 295, 38, 295,
- 233, 51, 233, 233, 234, 296, 52, 233,
- 16, 16, 233, 233, 233, 233, 47, 297,
- 21, 297, 51, 223, 296, 52, 16, 16,
- 47, 298, 21, 298, 237, 299, 237, 237,
- 239, 52, 237, 16, 16, 237, 237, 237,
- 237, 237, 47, 300, 38, 300, 113, 301,
- 114, 16, 16, 112, 302, 21, 302, 113,
- 303, 114, 16, 16, 112, 303, 21, 303,
- 304, 113, 304, 304, 305, 306, 307, 308,
- 309, 310, 311, 114, 305, 306, 307, 308,
- 309, 310, 311, 304, 16, 16, 304, 304,
- 304, 304, 304, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 114, 313, 16,
- 16, 313, 313, 313, 313, 112, 315, 21,
- 315, 113, 303, 314, 114, 16, 16, 112,
- 314, 21, 314, 316, 317, 316, 316, 318,
- 114, 316, 16, 16, 316, 316, 316, 316,
- 316, 112, 300, 38, 300, 316, 113, 316,
- 316, 301, 114, 316, 16, 16, 316, 316,
- 316, 316, 112, 319, 116, 319, 51, 320,
- 52, 16, 16, 47, 21, 113, 322, 114,
- 16, 16, 16, 321, 321, 321, 112, 21,
- 113, 324, 114, 325, 16, 16, 16, 323,
- 323, 323, 112, 21, 113, 324, 114, 325,
- 16, 16, 16, 326, 326, 326, 112, 21,
- 113, 324, 114, 325, 16, 16, 16, 327,
- 327, 327, 112, 21, 113, 324, 114, 325,
- 16, 16, 16, 112, 21, 113, 329, 114,
- 16, 16, 16, 328, 321, 321, 112, 21,
- 113, 330, 324, 114, 325, 16, 16, 16,
- 331, 323, 323, 112, 21, 113, 114, 16,
- 16, 16, 332, 112, 21, 113, 333, 114,
- 16, 16, 16, 334, 112, 21, 113, 114,
- 16, 16, 16, 335, 112, 21, 113, 336,
- 114, 16, 16, 16, 337, 112, 21, 113,
- 114, 16, 16, 16, 338, 112, 21, 113,
- 114, 325, 16, 16, 16, 339, 112, 21,
- 113, 114, 325, 16, 16, 16, 340, 112,
- 21, 113, 114, 325, 16, 16, 16, 112,
- 21, 113, 336, 114, 16, 16, 16, 341,
- 112, 21, 113, 336, 114, 16, 16, 16,
- 112, 21, 113, 333, 114, 16, 16, 16,
- 342, 112, 21, 113, 333, 114, 16, 16,
- 16, 112, 21, 113, 330, 324, 114, 325,
- 16, 16, 16, 343, 326, 326, 112, 21,
- 113, 330, 324, 114, 325, 16, 16, 16,
- 327, 327, 327, 112, 21, 113, 345, 114,
- 325, 16, 16, 16, 344, 344, 344, 112,
- 21, 113, 347, 114, 325, 16, 16, 16,
- 346, 346, 346, 112, 21, 113, 347, 114,
- 325, 16, 16, 16, 348, 348, 348, 112,
- 21, 113, 347, 114, 325, 16, 16, 16,
- 349, 349, 349, 112, 21, 113, 347, 114,
- 325, 16, 16, 16, 112, 21, 113, 114,
- 16, 16, 16, 350, 344, 344, 112, 21,
- 113, 330, 347, 114, 325, 16, 16, 16,
- 351, 346, 346, 112, 21, 113, 330, 347,
- 114, 325, 16, 16, 16, 352, 348, 348,
- 112, 21, 113, 330, 347, 114, 325, 16,
- 16, 16, 349, 349, 349, 112, 21, 113,
- 114, 16, 16, 16, 353, 112, 21, 113,
- 330, 114, 16, 16, 16, 354, 112, 21,
- 113, 330, 114, 16, 16, 16, 355, 112,
- 21, 113, 330, 114, 16, 16, 16, 112,
- 21, 113, 329, 114, 16, 16, 16, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 356, 114, 356, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 357, 114, 357,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 358, 114, 358, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 359, 114, 359,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 360, 114, 360, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 361, 114, 361,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 362, 114, 362, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 363, 114, 363,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 364, 38, 364, 313, 113, 313, 313, 301,
- 365, 114, 313, 16, 16, 313, 313, 313,
- 313, 112, 366, 21, 366, 113, 303, 365,
- 114, 16, 16, 112, 365, 21, 365, 367,
- 317, 367, 367, 318, 114, 367, 16, 16,
- 367, 367, 367, 367, 367, 112, 368, 99,
- 368, 369, 113, 369, 369, 370, 114, 369,
- 16, 16, 369, 369, 369, 369, 112, 312,
- 38, 312, 313, 113, 313, 313, 301, 314,
- 371, 114, 371, 313, 16, 16, 313, 313,
- 313, 313, 112, 312, 38, 312, 313, 113,
- 313, 313, 301, 314, 372, 114, 372, 313,
- 16, 16, 313, 313, 313, 313, 112, 312,
- 38, 312, 313, 113, 313, 313, 301, 314,
- 373, 114, 373, 313, 16, 16, 313, 313,
- 313, 313, 112, 312, 38, 312, 313, 113,
- 313, 313, 301, 314, 374, 114, 374, 313,
- 16, 16, 313, 313, 313, 313, 112, 312,
- 38, 312, 313, 113, 313, 313, 301, 314,
- 375, 114, 375, 313, 16, 16, 313, 313,
- 313, 313, 112, 376, 38, 376, 313, 113,
- 313, 313, 301, 377, 114, 313, 16, 16,
- 313, 313, 313, 313, 112, 378, 21, 378,
- 113, 303, 377, 114, 16, 16, 112, 379,
- 21, 379, 316, 380, 316, 316, 318, 114,
- 316, 16, 16, 316, 316, 316, 316, 316,
- 112, 381, 116, 381, 113, 382, 114, 16,
- 16, 112, 312, 38, 312, 313, 113, 313,
- 313, 301, 314, 383, 384, 114, 383, 384,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 385, 38, 385, 313, 113, 313, 313, 301,
- 386, 114, 313, 16, 16, 313, 313, 313,
- 313, 112, 387, 21, 387, 113, 303, 386,
- 114, 16, 16, 112, 386, 21, 386, 316,
- 317, 316, 316, 318, 114, 316, 16, 16,
- 316, 316, 388, 316, 316, 388, 316, 112,
- 300, 38, 300, 316, 113, 316, 316, 301,
- 114, 316, 16, 16, 316, 389, 316, 316,
- 389, 316, 112, 300, 38, 300, 316, 113,
- 316, 316, 301, 114, 316, 16, 16, 316,
- 390, 316, 316, 390, 316, 112, 300, 38,
- 300, 316, 113, 316, 316, 301, 114, 316,
- 16, 16, 316, 391, 316, 316, 391, 316,
- 112, 300, 38, 300, 316, 113, 316, 316,
- 301, 114, 316, 16, 16, 316, 392, 316,
- 316, 392, 316, 112, 300, 38, 300, 316,
- 113, 316, 316, 301, 114, 316, 16, 16,
- 316, 393, 316, 316, 393, 316, 112, 300,
- 38, 300, 316, 113, 316, 316, 301, 114,
- 316, 16, 16, 316, 394, 316, 316, 394,
- 316, 112, 300, 38, 300, 316, 113, 316,
- 316, 301, 114, 316, 16, 16, 316, 395,
- 316, 316, 395, 316, 112, 396, 132, 396,
- 113, 397, 114, 16, 16, 112, 312, 38,
- 312, 313, 113, 313, 313, 301, 314, 398,
- 114, 398, 313, 16, 16, 313, 313, 313,
- 313, 112, 312, 38, 312, 313, 113, 313,
- 313, 301, 314, 399, 114, 399, 313, 16,
- 16, 313, 313, 313, 313, 112, 312, 38,
- 312, 313, 113, 313, 313, 301, 314, 400,
- 114, 400, 313, 16, 16, 313, 313, 313,
- 313, 112, 401, 38, 401, 313, 113, 313,
- 313, 301, 402, 114, 313, 16, 16, 313,
- 313, 313, 313, 112, 403, 21, 403, 113,
- 303, 402, 114, 16, 16, 112, 404, 21,
- 404, 316, 405, 316, 316, 318, 114, 316,
- 16, 16, 316, 316, 316, 316, 316, 112,
- 406, 116, 406, 143, 407, 144, 16, 16,
- 142, 408, 21, 408, 143, 409, 144, 16,
- 16, 142, 409, 21, 409, 410, 143, 410,
- 410, 411, 412, 413, 414, 415, 416, 417,
- 144, 411, 412, 413, 414, 415, 416, 417,
- 410, 16, 16, 410, 410, 410, 410, 410,
- 142, 418, 38, 418, 419, 143, 419, 419,
- 420, 421, 144, 419, 16, 16, 419, 419,
- 419, 419, 142, 422, 21, 422, 143, 409,
- 421, 144, 16, 16, 142, 421, 21, 421,
- 423, 424, 423, 423, 425, 144, 423, 16,
- 16, 423, 423, 423, 423, 423, 142, 426,
- 38, 426, 423, 143, 423, 423, 420, 144,
- 423, 16, 16, 423, 423, 423, 423, 142,
- 427, 146, 427, 51, 428, 52, 16, 16,
- 47, 21, 143, 430, 144, 16, 16, 16,
- 429, 429, 429, 142, 21, 143, 432, 144,
- 433, 16, 16, 16, 431, 431, 431, 142,
- 21, 143, 432, 144, 433, 16, 16, 16,
- 434, 434, 434, 142, 21, 143, 432, 144,
- 433, 16, 16, 16, 435, 435, 435, 142,
- 21, 143, 432, 144, 433, 16, 16, 16,
- 142, 21, 143, 437, 144, 16, 16, 16,
- 436, 429, 429, 142, 21, 143, 438, 432,
- 144, 433, 16, 16, 16, 439, 431, 431,
- 142, 21, 143, 144, 16, 16, 16, 440,
- 142, 21, 143, 441, 144, 16, 16, 16,
- 442, 142, 21, 143, 144, 16, 16, 16,
- 443, 142, 21, 143, 444, 144, 16, 16,
- 16, 445, 142, 21, 143, 144, 16, 16,
- 16, 446, 142, 21, 143, 144, 433, 16,
- 16, 16, 447, 142, 21, 143, 144, 433,
- 16, 16, 16, 448, 142, 21, 143, 144,
- 433, 16, 16, 16, 142, 426, 38, 426,
- 143, 420, 144, 16, 16, 142, 21, 143,
- 444, 144, 16, 16, 16, 449, 142, 21,
- 143, 444, 144, 16, 16, 16, 142, 21,
- 143, 441, 144, 16, 16, 16, 450, 142,
- 21, 143, 441, 144, 16, 16, 16, 142,
- 21, 143, 438, 432, 144, 433, 16, 16,
- 16, 451, 434, 434, 142, 21, 143, 438,
- 432, 144, 433, 16, 16, 16, 435, 435,
- 435, 142, 21, 143, 453, 144, 433, 16,
- 16, 16, 452, 452, 452, 142, 21, 143,
- 455, 144, 433, 16, 16, 16, 454, 454,
- 454, 142, 21, 143, 455, 144, 433, 16,
- 16, 16, 456, 456, 456, 142, 21, 143,
- 455, 144, 433, 16, 16, 16, 457, 457,
- 457, 142, 21, 143, 455, 144, 433, 16,
- 16, 16, 142, 21, 143, 144, 16, 16,
- 16, 458, 452, 452, 142, 21, 143, 438,
- 455, 144, 433, 16, 16, 16, 459, 454,
- 454, 142, 21, 143, 438, 455, 144, 433,
- 16, 16, 16, 460, 456, 456, 142, 21,
- 143, 438, 455, 144, 433, 16, 16, 16,
- 457, 457, 457, 142, 21, 143, 144, 16,
- 16, 16, 461, 142, 21, 143, 438, 144,
- 16, 16, 16, 462, 142, 21, 143, 438,
- 144, 16, 16, 16, 463, 142, 21, 143,
- 438, 144, 16, 16, 16, 142, 21, 143,
- 437, 144, 16, 16, 16, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 464,
- 144, 464, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 465, 144, 465, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 466,
- 144, 466, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 467, 144, 467, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 468,
- 144, 468, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 469, 144, 469, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 470,
- 144, 470, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 471, 144, 471, 419, 16,
- 16, 419, 419, 419, 419, 142, 472, 38,
- 472, 419, 143, 419, 419, 420, 473, 144,
- 419, 16, 16, 419, 419, 419, 419, 142,
- 474, 21, 474, 143, 409, 473, 144, 16,
- 16, 142, 473, 21, 473, 475, 424, 475,
- 475, 425, 144, 475, 16, 16, 475, 475,
- 475, 475, 475, 142, 476, 99, 476, 477,
- 143, 477, 477, 478, 144, 477, 16, 16,
- 477, 477, 477, 477, 142, 418, 38, 418,
- 419, 143, 419, 419, 420, 421, 479, 144,
- 479, 419, 16, 16, 419, 419, 419, 419,
- 142, 418, 38, 418, 419, 143, 419, 419,
- 420, 421, 480, 144, 480, 419, 16, 16,
- 419, 419, 419, 419, 142, 418, 38, 418,
- 419, 143, 419, 419, 420, 421, 481, 144,
- 481, 419, 16, 16, 419, 419, 419, 419,
- 142, 418, 38, 418, 419, 143, 419, 419,
- 420, 421, 482, 144, 482, 419, 16, 16,
- 419, 419, 419, 419, 142, 418, 38, 418,
- 419, 143, 419, 419, 420, 421, 483, 144,
- 483, 419, 16, 16, 419, 419, 419, 419,
- 142, 484, 38, 484, 419, 143, 419, 419,
- 420, 485, 144, 419, 16, 16, 419, 419,
- 419, 419, 142, 486, 21, 486, 143, 409,
- 485, 144, 16, 16, 142, 487, 21, 487,
- 423, 488, 423, 423, 425, 144, 423, 16,
- 16, 423, 423, 423, 423, 423, 142, 489,
- 146, 489, 113, 490, 114, 16, 16, 112,
- 418, 38, 418, 419, 143, 419, 419, 420,
- 421, 491, 492, 144, 491, 492, 419, 16,
- 16, 419, 419, 419, 419, 142, 493, 38,
- 493, 419, 143, 419, 419, 420, 494, 144,
- 419, 16, 16, 419, 419, 419, 419, 142,
- 495, 21, 495, 143, 409, 494, 144, 16,
- 16, 142, 494, 21, 494, 423, 424, 423,
- 423, 425, 144, 423, 16, 16, 423, 423,
- 496, 423, 423, 496, 423, 142, 426, 38,
- 426, 423, 143, 423, 423, 420, 144, 423,
- 16, 16, 423, 497, 423, 423, 497, 423,
- 142, 426, 38, 426, 423, 143, 423, 423,
- 420, 144, 423, 16, 16, 423, 498, 423,
- 423, 498, 423, 142, 426, 38, 426, 423,
- 143, 423, 423, 420, 144, 423, 16, 16,
- 423, 499, 423, 423, 499, 423, 142, 426,
- 38, 426, 423, 143, 423, 423, 420, 144,
- 423, 16, 16, 423, 500, 423, 423, 500,
- 423, 142, 426, 38, 426, 423, 143, 423,
- 423, 420, 144, 423, 16, 16, 423, 501,
- 423, 423, 501, 423, 142, 426, 38, 426,
- 423, 143, 423, 423, 420, 144, 423, 16,
- 16, 423, 502, 423, 423, 502, 423, 142,
- 426, 38, 426, 423, 143, 423, 423, 420,
- 144, 423, 16, 16, 423, 503, 423, 423,
- 503, 423, 142, 504, 132, 504, 143, 505,
- 144, 16, 16, 142, 418, 38, 418, 419,
- 143, 419, 419, 420, 421, 506, 144, 506,
- 419, 16, 16, 419, 419, 419, 419, 142,
- 418, 38, 418, 419, 143, 419, 419, 420,
- 421, 507, 144, 507, 419, 16, 16, 419,
- 419, 419, 419, 142, 418, 38, 418, 419,
- 143, 419, 419, 420, 421, 508, 144, 508,
- 419, 16, 16, 419, 419, 419, 419, 142,
- 509, 38, 509, 419, 143, 419, 419, 420,
- 510, 144, 419, 16, 16, 419, 419, 419,
- 419, 142, 511, 21, 511, 143, 409, 510,
- 144, 16, 16, 142, 512, 21, 512, 423,
- 513, 423, 423, 425, 144, 423, 16, 16,
- 423, 423, 423, 423, 423, 142, 514, 146,
- 514, 143, 515, 144, 16, 16, 142, 418,
- 38, 418, 419, 143, 419, 419, 420, 421,
- 516, 144, 516, 419, 16, 16, 419, 419,
- 419, 419, 142, 418, 38, 418, 419, 143,
- 419, 419, 420, 421, 517, 144, 517, 419,
- 16, 16, 419, 419, 419, 419, 142, 418,
- 38, 418, 419, 143, 419, 419, 420, 421,
- 518, 144, 518, 419, 16, 16, 419, 419,
- 419, 419, 142, 418, 38, 418, 419, 143,
- 419, 419, 420, 421, 519, 144, 519, 419,
- 16, 16, 419, 419, 419, 419, 142, 418,
- 38, 418, 419, 143, 419, 419, 420, 421,
- 520, 144, 520, 419, 16, 16, 419, 419,
- 419, 419, 142, 521, 38, 521, 419, 143,
- 419, 419, 420, 522, 144, 419, 16, 16,
- 419, 419, 419, 419, 142, 523, 21, 523,
- 143, 409, 522, 144, 16, 16, 142, 524,
- 21, 524, 423, 525, 423, 423, 425, 144,
- 423, 16, 16, 423, 423, 423, 423, 423,
- 142, 526, 146, 526, 159, 527, 160, 16,
- 16, 158, 528, 21, 528, 159, 529, 160,
- 16, 16, 158, 529, 21, 529, 530, 159,
- 530, 530, 531, 532, 533, 534, 535, 536,
- 537, 160, 531, 532, 533, 534, 535, 536,
- 537, 530, 16, 16, 530, 530, 530, 530,
- 530, 158, 538, 38, 538, 539, 159, 539,
- 539, 540, 541, 160, 539, 16, 16, 539,
- 539, 539, 539, 158, 542, 21, 542, 159,
- 529, 541, 160, 16, 16, 158, 541, 21,
- 541, 543, 544, 543, 543, 545, 160, 543,
- 16, 16, 543, 543, 543, 543, 543, 158,
- 546, 38, 546, 543, 159, 543, 543, 540,
- 160, 543, 16, 16, 543, 543, 543, 543,
- 158, 547, 162, 547, 51, 548, 52, 16,
- 16, 47, 21, 159, 550, 160, 16, 16,
- 16, 549, 549, 549, 158, 21, 159, 552,
- 160, 553, 16, 16, 16, 551, 551, 551,
- 158, 21, 159, 552, 160, 553, 16, 16,
- 16, 554, 554, 554, 158, 21, 159, 552,
- 160, 553, 16, 16, 16, 555, 555, 555,
- 158, 21, 159, 552, 160, 553, 16, 16,
- 16, 158, 21, 159, 557, 160, 16, 16,
- 16, 556, 549, 549, 158, 21, 159, 558,
- 552, 160, 553, 16, 16, 16, 559, 551,
- 551, 158, 21, 159, 160, 16, 16, 16,
- 560, 158, 21, 159, 561, 160, 16, 16,
- 16, 562, 158, 21, 159, 160, 16, 16,
- 16, 563, 158, 21, 159, 564, 160, 16,
- 16, 16, 565, 158, 21, 159, 160, 16,
- 16, 16, 566, 158, 21, 159, 160, 553,
- 16, 16, 16, 567, 158, 21, 159, 160,
- 553, 16, 16, 16, 568, 158, 21, 159,
- 160, 553, 16, 16, 16, 158, 546, 38,
- 546, 159, 540, 160, 16, 16, 158, 21,
- 159, 564, 160, 16, 16, 16, 569, 158,
- 21, 159, 564, 160, 16, 16, 16, 158,
- 21, 159, 561, 160, 16, 16, 16, 570,
- 158, 21, 159, 561, 160, 16, 16, 16,
- 158, 21, 159, 558, 552, 160, 553, 16,
- 16, 16, 571, 554, 554, 158, 21, 159,
- 558, 552, 160, 553, 16, 16, 16, 555,
- 555, 555, 158, 21, 159, 573, 160, 553,
- 16, 16, 16, 572, 572, 572, 158, 21,
- 159, 575, 160, 553, 16, 16, 16, 574,
- 574, 574, 158, 21, 159, 575, 160, 553,
- 16, 16, 16, 576, 576, 576, 158, 21,
- 159, 575, 160, 553, 16, 16, 16, 577,
- 577, 577, 158, 21, 159, 575, 160, 553,
- 16, 16, 16, 158, 21, 159, 160, 16,
- 16, 16, 578, 572, 572, 158, 21, 159,
- 558, 575, 160, 553, 16, 16, 16, 579,
- 574, 574, 158, 21, 159, 558, 575, 160,
- 553, 16, 16, 16, 580, 576, 576, 158,
- 21, 159, 558, 575, 160, 553, 16, 16,
- 16, 577, 577, 577, 158, 21, 159, 160,
- 16, 16, 16, 581, 158, 21, 159, 558,
- 160, 16, 16, 16, 582, 158, 21, 159,
- 558, 160, 16, 16, 16, 583, 158, 21,
- 159, 558, 160, 16, 16, 16, 158, 21,
- 159, 557, 160, 16, 16, 16, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 584, 160, 584, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 585, 160, 585, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 586, 160, 586, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 587, 160, 587, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 588, 160, 588, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 589, 160, 589, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 590, 160, 590, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 591, 160, 591, 539,
- 16, 16, 539, 539, 539, 539, 158, 592,
- 38, 592, 539, 159, 539, 539, 540, 593,
- 160, 539, 16, 16, 539, 539, 539, 539,
- 158, 594, 21, 594, 159, 529, 593, 160,
- 16, 16, 158, 593, 21, 593, 595, 544,
- 595, 595, 545, 160, 595, 16, 16, 595,
- 595, 595, 595, 595, 158, 596, 99, 596,
- 597, 159, 597, 597, 598, 160, 597, 16,
- 16, 597, 597, 597, 597, 158, 538, 38,
- 538, 539, 159, 539, 539, 540, 541, 599,
- 160, 599, 539, 16, 16, 539, 539, 539,
- 539, 158, 538, 38, 538, 539, 159, 539,
- 539, 540, 541, 600, 160, 600, 539, 16,
- 16, 539, 539, 539, 539, 158, 538, 38,
- 538, 539, 159, 539, 539, 540, 541, 601,
- 160, 601, 539, 16, 16, 539, 539, 539,
- 539, 158, 538, 38, 538, 539, 159, 539,
- 539, 540, 541, 602, 160, 602, 539, 16,
- 16, 539, 539, 539, 539, 158, 538, 38,
- 538, 539, 159, 539, 539, 540, 541, 603,
- 160, 603, 539, 16, 16, 539, 539, 539,
- 539, 158, 604, 38, 604, 539, 159, 539,
- 539, 540, 605, 160, 539, 16, 16, 539,
- 539, 539, 539, 158, 606, 21, 606, 159,
- 529, 605, 160, 16, 16, 158, 607, 21,
- 607, 543, 608, 543, 543, 545, 160, 543,
- 16, 16, 543, 543, 543, 543, 543, 158,
- 609, 162, 609, 113, 610, 114, 16, 16,
- 112, 538, 38, 538, 539, 159, 539, 539,
- 540, 541, 611, 612, 160, 611, 612, 539,
- 16, 16, 539, 539, 539, 539, 158, 613,
- 38, 613, 539, 159, 539, 539, 540, 614,
- 160, 539, 16, 16, 539, 539, 539, 539,
- 158, 615, 21, 615, 159, 529, 614, 160,
- 16, 16, 158, 614, 21, 614, 543, 544,
- 543, 543, 545, 160, 543, 16, 16, 543,
- 543, 616, 543, 543, 616, 543, 158, 546,
- 38, 546, 543, 159, 543, 543, 540, 160,
- 543, 16, 16, 543, 617, 543, 543, 617,
- 543, 158, 546, 38, 546, 543, 159, 543,
- 543, 540, 160, 543, 16, 16, 543, 618,
- 543, 543, 618, 543, 158, 546, 38, 546,
- 543, 159, 543, 543, 540, 160, 543, 16,
- 16, 543, 619, 543, 543, 619, 543, 158,
- 546, 38, 546, 543, 159, 543, 543, 540,
- 160, 543, 16, 16, 543, 620, 543, 543,
- 620, 543, 158, 546, 38, 546, 543, 159,
- 543, 543, 540, 160, 543, 16, 16, 543,
- 621, 543, 543, 621, 543, 158, 546, 38,
- 546, 543, 159, 543, 543, 540, 160, 543,
- 16, 16, 543, 622, 543, 543, 622, 543,
- 158, 546, 38, 546, 543, 159, 543, 543,
- 540, 160, 543, 16, 16, 543, 623, 543,
- 543, 623, 543, 158, 624, 132, 624, 159,
- 625, 160, 16, 16, 158, 538, 38, 538,
- 539, 159, 539, 539, 540, 541, 626, 160,
- 626, 539, 16, 16, 539, 539, 539, 539,
- 158, 538, 38, 538, 539, 159, 539, 539,
- 540, 541, 627, 160, 627, 539, 16, 16,
- 539, 539, 539, 539, 158, 538, 38, 538,
- 539, 159, 539, 539, 540, 541, 628, 160,
- 628, 539, 16, 16, 539, 539, 539, 539,
- 158, 629, 38, 629, 539, 159, 539, 539,
- 540, 630, 160, 539, 16, 16, 539, 539,
- 539, 539, 158, 631, 21, 631, 159, 529,
- 630, 160, 16, 16, 158, 632, 21, 632,
- 543, 633, 543, 543, 545, 160, 543, 16,
- 16, 543, 543, 543, 543, 543, 158, 634,
- 162, 634, 143, 635, 144, 16, 16, 142,
- 538, 38, 538, 539, 159, 539, 539, 540,
- 541, 636, 160, 636, 539, 16, 16, 539,
- 539, 539, 539, 158, 538, 38, 538, 539,
- 159, 539, 539, 540, 541, 637, 160, 637,
- 539, 16, 16, 539, 539, 539, 539, 158,
- 538, 38, 538, 539, 159, 539, 539, 540,
- 541, 638, 160, 638, 539, 16, 16, 539,
- 539, 539, 539, 158, 538, 38, 538, 539,
- 159, 539, 539, 540, 541, 639, 160, 639,
- 539, 16, 16, 539, 539, 539, 539, 158,
- 538, 38, 538, 539, 159, 539, 539, 540,
- 541, 640, 160, 640, 539, 16, 16, 539,
- 539, 539, 539, 158, 641, 38, 641, 539,
- 159, 539, 539, 540, 642, 160, 539, 16,
- 16, 539, 539, 539, 539, 158, 643, 21,
- 643, 159, 529, 642, 160, 16, 16, 158,
- 644, 21, 644, 543, 645, 543, 543, 545,
- 160, 543, 16, 16, 543, 543, 543, 543,
- 543, 158, 646, 162, 646, 159, 647, 160,
- 16, 16, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 648, 160, 648, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 649, 160, 649, 539, 16, 16, 539, 539,
- 539, 539, 158, 650, 38, 650, 539, 159,
- 539, 539, 540, 651, 160, 539, 16, 16,
- 539, 539, 539, 539, 158, 652, 21, 652,
- 159, 529, 651, 160, 16, 16, 158, 651,
- 21, 651, 653, 544, 653, 653, 545, 160,
- 653, 16, 16, 653, 653, 653, 653, 653,
- 158, 654, 171, 654, 655, 159, 655, 655,
- 656, 160, 655, 16, 16, 655, 655, 655,
- 655, 158, 538, 38, 538, 539, 159, 539,
- 539, 540, 541, 657, 160, 657, 539, 16,
- 16, 539, 539, 539, 539, 158, 538, 38,
- 538, 539, 159, 539, 539, 540, 541, 658,
- 659, 160, 658, 659, 539, 16, 16, 539,
- 539, 539, 539, 158, 538, 38, 538, 539,
- 159, 539, 539, 540, 541, 660, 160, 660,
- 539, 16, 16, 539, 539, 539, 539, 158,
- 538, 38, 538, 539, 159, 539, 539, 540,
- 541, 661, 160, 661, 539, 16, 16, 539,
- 539, 539, 539, 158, 662, 38, 662, 539,
- 159, 539, 539, 540, 663, 160, 539, 16,
- 16, 539, 539, 539, 539, 158, 664, 21,
- 664, 159, 529, 663, 160, 16, 16, 158,
- 665, 21, 665, 543, 666, 543, 543, 545,
- 160, 543, 16, 16, 543, 543, 543, 543,
- 543, 158, 667, 162, 667, 185, 668, 186,
- 16, 16, 184, 669, 21, 669, 185, 670,
- 186, 16, 16, 184, 670, 21, 670, 671,
- 185, 671, 671, 672, 673, 674, 675, 676,
- 677, 678, 186, 672, 673, 674, 675, 676,
- 677, 678, 671, 16, 16, 671, 671, 671,
- 671, 671, 184, 679, 38, 679, 680, 185,
- 680, 680, 681, 682, 186, 680, 16, 16,
- 680, 680, 680, 680, 184, 683, 21, 683,
- 185, 670, 682, 186, 16, 16, 184, 682,
- 21, 682, 684, 685, 684, 684, 686, 186,
- 684, 16, 16, 684, 684, 684, 684, 684,
- 184, 687, 38, 687, 684, 185, 684, 684,
- 681, 186, 684, 16, 16, 684, 684, 684,
- 684, 184, 688, 188, 688, 51, 689, 52,
- 16, 16, 47, 21, 185, 691, 186, 16,
- 16, 16, 690, 690, 690, 184, 21, 185,
- 693, 186, 694, 16, 16, 16, 692, 692,
- 692, 184, 21, 185, 693, 186, 694, 16,
- 16, 16, 695, 695, 695, 184, 21, 185,
- 693, 186, 694, 16, 16, 16, 696, 696,
- 696, 184, 21, 185, 693, 186, 694, 16,
- 16, 16, 184, 21, 185, 698, 186, 16,
- 16, 16, 697, 690, 690, 184, 21, 185,
- 699, 693, 186, 694, 16, 16, 16, 700,
- 692, 692, 184, 21, 185, 186, 16, 16,
- 16, 701, 184, 21, 185, 702, 186, 16,
- 16, 16, 703, 184, 21, 185, 186, 16,
- 16, 16, 704, 184, 21, 185, 705, 186,
- 16, 16, 16, 706, 184, 21, 185, 186,
- 16, 16, 16, 707, 184, 21, 185, 186,
- 694, 16, 16, 16, 708, 184, 21, 185,
- 186, 694, 16, 16, 16, 709, 184, 21,
- 185, 186, 694, 16, 16, 16, 184, 687,
- 38, 687, 185, 681, 186, 16, 16, 184,
- 21, 185, 705, 186, 16, 16, 16, 710,
- 184, 21, 185, 705, 186, 16, 16, 16,
- 184, 21, 185, 702, 186, 16, 16, 16,
- 711, 184, 21, 185, 702, 186, 16, 16,
- 16, 184, 21, 185, 699, 693, 186, 694,
- 16, 16, 16, 712, 695, 695, 184, 21,
- 185, 699, 693, 186, 694, 16, 16, 16,
- 696, 696, 696, 184, 21, 185, 714, 186,
- 694, 16, 16, 16, 713, 713, 713, 184,
- 21, 185, 716, 186, 694, 16, 16, 16,
- 715, 715, 715, 184, 21, 185, 716, 186,
- 694, 16, 16, 16, 717, 717, 717, 184,
- 21, 185, 716, 186, 694, 16, 16, 16,
- 718, 718, 718, 184, 21, 185, 716, 186,
- 694, 16, 16, 16, 184, 21, 185, 186,
- 16, 16, 16, 719, 713, 713, 184, 21,
- 185, 699, 716, 186, 694, 16, 16, 16,
- 720, 715, 715, 184, 21, 185, 699, 716,
- 186, 694, 16, 16, 16, 721, 717, 717,
- 184, 21, 185, 699, 716, 186, 694, 16,
- 16, 16, 718, 718, 718, 184, 21, 185,
- 186, 16, 16, 16, 722, 184, 21, 185,
- 699, 186, 16, 16, 16, 723, 184, 21,
- 185, 699, 186, 16, 16, 16, 724, 184,
- 21, 185, 699, 186, 16, 16, 16, 184,
- 21, 185, 698, 186, 16, 16, 16, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 725, 186, 725, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 726, 186, 726,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 727, 186, 727, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 728, 186, 728,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 729, 186, 729, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 730, 186, 730,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 731, 186, 731, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 732, 186, 732,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 733, 38, 733, 680, 185, 680, 680, 681,
- 734, 186, 680, 16, 16, 680, 680, 680,
- 680, 184, 735, 21, 735, 185, 670, 734,
- 186, 16, 16, 184, 734, 21, 734, 736,
- 685, 736, 736, 686, 186, 736, 16, 16,
- 736, 736, 736, 736, 736, 184, 737, 99,
- 737, 738, 185, 738, 738, 739, 186, 738,
- 16, 16, 738, 738, 738, 738, 184, 679,
- 38, 679, 680, 185, 680, 680, 681, 682,
- 740, 186, 740, 680, 16, 16, 680, 680,
- 680, 680, 184, 679, 38, 679, 680, 185,
- 680, 680, 681, 682, 741, 186, 741, 680,
- 16, 16, 680, 680, 680, 680, 184, 679,
- 38, 679, 680, 185, 680, 680, 681, 682,
- 742, 186, 742, 680, 16, 16, 680, 680,
- 680, 680, 184, 679, 38, 679, 680, 185,
- 680, 680, 681, 682, 743, 186, 743, 680,
- 16, 16, 680, 680, 680, 680, 184, 679,
- 38, 679, 680, 185, 680, 680, 681, 682,
- 744, 186, 744, 680, 16, 16, 680, 680,
- 680, 680, 184, 745, 38, 745, 680, 185,
- 680, 680, 681, 746, 186, 680, 16, 16,
- 680, 680, 680, 680, 184, 747, 21, 747,
- 185, 670, 746, 186, 16, 16, 184, 748,
- 21, 748, 684, 749, 684, 684, 686, 186,
- 684, 16, 16, 684, 684, 684, 684, 684,
- 184, 750, 188, 750, 113, 751, 114, 16,
- 16, 112, 679, 38, 679, 680, 185, 680,
- 680, 681, 682, 752, 753, 186, 752, 753,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 754, 38, 754, 680, 185, 680, 680, 681,
- 755, 186, 680, 16, 16, 680, 680, 680,
- 680, 184, 756, 21, 756, 185, 670, 755,
- 186, 16, 16, 184, 755, 21, 755, 684,
- 685, 684, 684, 686, 186, 684, 16, 16,
- 684, 684, 757, 684, 684, 757, 684, 184,
- 687, 38, 687, 684, 185, 684, 684, 681,
- 186, 684, 16, 16, 684, 758, 684, 684,
- 758, 684, 184, 687, 38, 687, 684, 185,
- 684, 684, 681, 186, 684, 16, 16, 684,
- 759, 684, 684, 759, 684, 184, 687, 38,
- 687, 684, 185, 684, 684, 681, 186, 684,
- 16, 16, 684, 760, 684, 684, 760, 684,
- 184, 687, 38, 687, 684, 185, 684, 684,
- 681, 186, 684, 16, 16, 684, 761, 684,
- 684, 761, 684, 184, 687, 38, 687, 684,
- 185, 684, 684, 681, 186, 684, 16, 16,
- 684, 762, 684, 684, 762, 684, 184, 687,
- 38, 687, 684, 185, 684, 684, 681, 186,
- 684, 16, 16, 684, 763, 684, 684, 763,
- 684, 184, 687, 38, 687, 684, 185, 684,
- 684, 681, 186, 684, 16, 16, 684, 764,
- 684, 684, 764, 684, 184, 765, 132, 765,
- 185, 766, 186, 16, 16, 184, 679, 38,
- 679, 680, 185, 680, 680, 681, 682, 767,
- 186, 767, 680, 16, 16, 680, 680, 680,
- 680, 184, 679, 38, 679, 680, 185, 680,
- 680, 681, 682, 768, 186, 768, 680, 16,
- 16, 680, 680, 680, 680, 184, 679, 38,
- 679, 680, 185, 680, 680, 681, 682, 769,
- 186, 769, 680, 16, 16, 680, 680, 680,
- 680, 184, 770, 38, 770, 680, 185, 680,
- 680, 681, 771, 186, 680, 16, 16, 680,
- 680, 680, 680, 184, 772, 21, 772, 185,
- 670, 771, 186, 16, 16, 184, 773, 21,
- 773, 684, 774, 684, 684, 686, 186, 684,
- 16, 16, 684, 684, 684, 684, 684, 184,
- 775, 188, 775, 143, 776, 144, 16, 16,
- 142, 679, 38, 679, 680, 185, 680, 680,
- 681, 682, 777, 186, 777, 680, 16, 16,
- 680, 680, 680, 680, 184, 679, 38, 679,
- 680, 185, 680, 680, 681, 682, 778, 186,
- 778, 680, 16, 16, 680, 680, 680, 680,
- 184, 679, 38, 679, 680, 185, 680, 680,
- 681, 682, 779, 186, 779, 680, 16, 16,
- 680, 680, 680, 680, 184, 679, 38, 679,
- 680, 185, 680, 680, 681, 682, 780, 186,
- 780, 680, 16, 16, 680, 680, 680, 680,
- 184, 679, 38, 679, 680, 185, 680, 680,
- 681, 682, 781, 186, 781, 680, 16, 16,
- 680, 680, 680, 680, 184, 782, 38, 782,
- 680, 185, 680, 680, 681, 783, 186, 680,
- 16, 16, 680, 680, 680, 680, 184, 784,
- 21, 784, 185, 670, 783, 186, 16, 16,
- 184, 785, 21, 785, 684, 786, 684, 684,
- 686, 186, 684, 16, 16, 684, 684, 684,
- 684, 684, 184, 787, 188, 787, 159, 788,
- 160, 16, 16, 158, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 789, 186, 789,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 790, 186, 790, 680, 16, 16, 680,
- 680, 680, 680, 184, 791, 38, 791, 680,
- 185, 680, 680, 681, 792, 186, 680, 16,
- 16, 680, 680, 680, 680, 184, 793, 21,
- 793, 185, 670, 792, 186, 16, 16, 184,
- 792, 21, 792, 794, 685, 794, 794, 686,
- 186, 794, 16, 16, 794, 794, 794, 794,
- 794, 184, 795, 171, 795, 796, 185, 796,
- 796, 797, 186, 796, 16, 16, 796, 796,
- 796, 796, 184, 679, 38, 679, 680, 185,
- 680, 680, 681, 682, 798, 186, 798, 680,
- 16, 16, 680, 680, 680, 680, 184, 679,
- 38, 679, 680, 185, 680, 680, 681, 682,
- 799, 800, 186, 799, 800, 680, 16, 16,
- 680, 680, 680, 680, 184, 679, 38, 679,
- 680, 185, 680, 680, 681, 682, 801, 186,
- 801, 680, 16, 16, 680, 680, 680, 680,
- 184, 679, 38, 679, 680, 185, 680, 680,
- 681, 682, 802, 186, 802, 680, 16, 16,
- 680, 680, 680, 680, 184, 803, 38, 803,
- 680, 185, 680, 680, 681, 804, 186, 680,
- 16, 16, 680, 680, 680, 680, 184, 805,
- 21, 805, 185, 670, 804, 186, 16, 16,
- 184, 806, 21, 806, 684, 807, 684, 684,
- 686, 186, 684, 16, 16, 684, 684, 684,
- 684, 684, 184, 808, 188, 808, 185, 809,
- 186, 16, 16, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 810, 186, 810,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 811, 186, 811, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 812, 186, 812,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 813, 186, 813, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 814, 186, 814,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 815, 38, 815, 680, 185, 680, 680, 681,
- 816, 186, 680, 16, 16, 680, 680, 680,
- 680, 184, 817, 21, 817, 185, 670, 816,
- 186, 16, 16, 184, 818, 21, 818, 684,
- 819, 684, 684, 686, 186, 684, 16, 16,
- 684, 684, 684, 684, 684, 184, 820, 188,
- 820, 201, 821, 202, 16, 16, 200, 822,
- 21, 822, 201, 823, 202, 16, 16, 200,
- 823, 21, 823, 824, 201, 824, 824, 825,
- 826, 827, 828, 829, 830, 831, 202, 825,
- 826, 827, 828, 829, 830, 831, 824, 16,
- 16, 824, 824, 824, 824, 824, 200, 832,
- 38, 832, 833, 201, 833, 833, 834, 835,
- 202, 833, 16, 16, 833, 833, 833, 833,
- 200, 836, 21, 836, 201, 823, 835, 202,
- 16, 16, 200, 835, 21, 835, 837, 838,
- 837, 837, 839, 202, 837, 16, 16, 837,
- 837, 837, 837, 837, 200, 840, 38, 840,
- 837, 201, 837, 837, 834, 202, 837, 16,
- 16, 837, 837, 837, 837, 200, 841, 204,
- 841, 51, 842, 52, 16, 16, 47, 21,
- 201, 844, 202, 16, 16, 16, 843, 843,
- 843, 200, 21, 201, 846, 202, 847, 16,
- 16, 16, 845, 845, 845, 200, 21, 201,
- 846, 202, 847, 16, 16, 16, 848, 848,
- 848, 200, 21, 201, 846, 202, 847, 16,
- 16, 16, 849, 849, 849, 200, 21, 201,
- 846, 202, 847, 16, 16, 16, 200, 21,
- 201, 851, 202, 16, 16, 16, 850, 843,
- 843, 200, 21, 201, 852, 846, 202, 847,
- 16, 16, 16, 853, 845, 845, 200, 21,
- 201, 202, 16, 16, 16, 854, 200, 21,
- 201, 855, 202, 16, 16, 16, 856, 200,
- 21, 201, 202, 16, 16, 16, 857, 200,
- 21, 201, 858, 202, 16, 16, 16, 859,
- 200, 21, 201, 202, 16, 16, 16, 860,
- 200, 21, 201, 202, 847, 16, 16, 16,
- 861, 200, 21, 201, 202, 847, 16, 16,
- 16, 862, 200, 21, 201, 202, 847, 16,
- 16, 16, 200, 840, 38, 840, 201, 834,
- 202, 16, 16, 200, 21, 201, 858, 202,
- 16, 16, 16, 863, 200, 21, 201, 858,
- 202, 16, 16, 16, 200, 21, 201, 855,
- 202, 16, 16, 16, 864, 200, 21, 201,
- 855, 202, 16, 16, 16, 200, 21, 201,
- 852, 846, 202, 847, 16, 16, 16, 865,
- 848, 848, 200, 21, 201, 852, 846, 202,
- 847, 16, 16, 16, 849, 849, 849, 200,
- 21, 201, 867, 202, 847, 16, 16, 16,
- 866, 866, 866, 200, 21, 201, 869, 202,
- 847, 16, 16, 16, 868, 868, 868, 200,
- 21, 201, 869, 202, 847, 16, 16, 16,
- 870, 870, 870, 200, 21, 201, 869, 202,
- 847, 16, 16, 16, 871, 871, 871, 200,
- 21, 201, 869, 202, 847, 16, 16, 16,
- 200, 21, 201, 202, 16, 16, 16, 872,
- 866, 866, 200, 21, 201, 852, 869, 202,
- 847, 16, 16, 16, 873, 868, 868, 200,
- 21, 201, 852, 869, 202, 847, 16, 16,
- 16, 874, 870, 870, 200, 21, 201, 852,
- 869, 202, 847, 16, 16, 16, 871, 871,
- 871, 200, 21, 201, 202, 16, 16, 16,
- 875, 200, 21, 201, 852, 202, 16, 16,
- 16, 876, 200, 21, 201, 852, 202, 16,
- 16, 16, 877, 200, 21, 201, 852, 202,
- 16, 16, 16, 200, 21, 201, 851, 202,
- 16, 16, 16, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 878, 202, 878,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 879, 202, 879, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 880, 202, 880,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 881, 202, 881, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 882, 202, 882,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 883, 202, 883, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 884, 202, 884,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 885, 202, 885, 833, 16, 16, 833,
- 833, 833, 833, 200, 886, 38, 886, 833,
- 201, 833, 833, 834, 887, 202, 833, 16,
- 16, 833, 833, 833, 833, 200, 888, 21,
- 888, 201, 823, 887, 202, 16, 16, 200,
- 887, 21, 887, 889, 838, 889, 889, 839,
- 202, 889, 16, 16, 889, 889, 889, 889,
- 889, 200, 890, 99, 890, 891, 201, 891,
- 891, 892, 202, 891, 16, 16, 891, 891,
- 891, 891, 200, 832, 38, 832, 833, 201,
- 833, 833, 834, 835, 893, 202, 893, 833,
- 16, 16, 833, 833, 833, 833, 200, 832,
- 38, 832, 833, 201, 833, 833, 834, 835,
- 894, 202, 894, 833, 16, 16, 833, 833,
- 833, 833, 200, 832, 38, 832, 833, 201,
- 833, 833, 834, 835, 895, 202, 895, 833,
- 16, 16, 833, 833, 833, 833, 200, 832,
- 38, 832, 833, 201, 833, 833, 834, 835,
- 896, 202, 896, 833, 16, 16, 833, 833,
- 833, 833, 200, 832, 38, 832, 833, 201,
- 833, 833, 834, 835, 897, 202, 897, 833,
- 16, 16, 833, 833, 833, 833, 200, 898,
- 38, 898, 833, 201, 833, 833, 834, 899,
- 202, 833, 16, 16, 833, 833, 833, 833,
- 200, 900, 21, 900, 201, 823, 899, 202,
- 16, 16, 200, 901, 21, 901, 837, 902,
- 837, 837, 839, 202, 837, 16, 16, 837,
- 837, 837, 837, 837, 200, 903, 204, 903,
- 113, 904, 114, 16, 16, 112, 832, 38,
- 832, 833, 201, 833, 833, 834, 835, 905,
- 906, 202, 905, 906, 833, 16, 16, 833,
- 833, 833, 833, 200, 907, 38, 907, 833,
- 201, 833, 833, 834, 908, 202, 833, 16,
- 16, 833, 833, 833, 833, 200, 909, 21,
- 909, 201, 823, 908, 202, 16, 16, 200,
- 908, 21, 908, 837, 838, 837, 837, 839,
- 202, 837, 16, 16, 837, 837, 910, 837,
- 837, 910, 837, 200, 840, 38, 840, 837,
- 201, 837, 837, 834, 202, 837, 16, 16,
- 837, 911, 837, 837, 911, 837, 200, 840,
- 38, 840, 837, 201, 837, 837, 834, 202,
- 837, 16, 16, 837, 912, 837, 837, 912,
- 837, 200, 840, 38, 840, 837, 201, 837,
- 837, 834, 202, 837, 16, 16, 837, 913,
- 837, 837, 913, 837, 200, 840, 38, 840,
- 837, 201, 837, 837, 834, 202, 837, 16,
- 16, 837, 914, 837, 837, 914, 837, 200,
- 840, 38, 840, 837, 201, 837, 837, 834,
- 202, 837, 16, 16, 837, 915, 837, 837,
- 915, 837, 200, 840, 38, 840, 837, 201,
- 837, 837, 834, 202, 837, 16, 16, 837,
- 916, 837, 837, 916, 837, 200, 840, 38,
- 840, 837, 201, 837, 837, 834, 202, 837,
- 16, 16, 837, 917, 837, 837, 917, 837,
- 200, 918, 132, 918, 201, 919, 202, 16,
- 16, 200, 832, 38, 832, 833, 201, 833,
- 833, 834, 835, 920, 202, 920, 833, 16,
- 16, 833, 833, 833, 833, 200, 832, 38,
- 832, 833, 201, 833, 833, 834, 835, 921,
- 202, 921, 833, 16, 16, 833, 833, 833,
- 833, 200, 832, 38, 832, 833, 201, 833,
- 833, 834, 835, 922, 202, 922, 833, 16,
- 16, 833, 833, 833, 833, 200, 923, 38,
- 923, 833, 201, 833, 833, 834, 924, 202,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 925, 21, 925, 201, 823, 924, 202, 16,
- 16, 200, 926, 21, 926, 837, 927, 837,
- 837, 839, 202, 837, 16, 16, 837, 837,
- 837, 837, 837, 200, 928, 204, 928, 143,
- 929, 144, 16, 16, 142, 832, 38, 832,
- 833, 201, 833, 833, 834, 835, 930, 202,
- 930, 833, 16, 16, 833, 833, 833, 833,
- 200, 832, 38, 832, 833, 201, 833, 833,
- 834, 835, 931, 202, 931, 833, 16, 16,
- 833, 833, 833, 833, 200, 832, 38, 832,
- 833, 201, 833, 833, 834, 835, 932, 202,
- 932, 833, 16, 16, 833, 833, 833, 833,
- 200, 832, 38, 832, 833, 201, 833, 833,
- 834, 835, 933, 202, 933, 833, 16, 16,
- 833, 833, 833, 833, 200, 832, 38, 832,
- 833, 201, 833, 833, 834, 835, 934, 202,
- 934, 833, 16, 16, 833, 833, 833, 833,
- 200, 935, 38, 935, 833, 201, 833, 833,
- 834, 936, 202, 833, 16, 16, 833, 833,
- 833, 833, 200, 937, 21, 937, 201, 823,
- 936, 202, 16, 16, 200, 938, 21, 938,
- 837, 939, 837, 837, 839, 202, 837, 16,
- 16, 837, 837, 837, 837, 837, 200, 940,
- 204, 940, 159, 941, 160, 16, 16, 158,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 942, 202, 942, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 943, 202, 943,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 944, 38, 944, 833, 201, 833, 833, 834,
- 945, 202, 833, 16, 16, 833, 833, 833,
- 833, 200, 946, 21, 946, 201, 823, 945,
- 202, 16, 16, 200, 945, 21, 945, 947,
- 838, 947, 947, 839, 202, 947, 16, 16,
- 947, 947, 947, 947, 947, 200, 948, 171,
- 948, 949, 201, 949, 949, 950, 202, 949,
- 16, 16, 949, 949, 949, 949, 200, 832,
- 38, 832, 833, 201, 833, 833, 834, 835,
- 951, 202, 951, 833, 16, 16, 833, 833,
- 833, 833, 200, 832, 38, 832, 833, 201,
- 833, 833, 834, 835, 952, 953, 202, 952,
- 953, 833, 16, 16, 833, 833, 833, 833,
- 200, 832, 38, 832, 833, 201, 833, 833,
- 834, 835, 954, 202, 954, 833, 16, 16,
- 833, 833, 833, 833, 200, 832, 38, 832,
- 833, 201, 833, 833, 834, 835, 955, 202,
- 955, 833, 16, 16, 833, 833, 833, 833,
- 200, 956, 38, 956, 833, 201, 833, 833,
- 834, 957, 202, 833, 16, 16, 833, 833,
- 833, 833, 200, 958, 21, 958, 201, 823,
- 957, 202, 16, 16, 200, 959, 21, 959,
- 837, 960, 837, 837, 839, 202, 837, 16,
- 16, 837, 837, 837, 837, 837, 200, 961,
- 204, 961, 185, 962, 186, 16, 16, 184,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 963, 202, 963, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 964, 202, 964,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 965, 202, 965, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 966, 202, 966,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 967, 202, 967, 833, 16, 16, 833,
- 833, 833, 833, 200, 968, 38, 968, 833,
- 201, 833, 833, 834, 969, 202, 833, 16,
- 16, 833, 833, 833, 833, 200, 970, 21,
- 970, 201, 823, 969, 202, 16, 16, 200,
- 971, 21, 971, 837, 972, 837, 837, 839,
- 202, 837, 16, 16, 837, 837, 837, 837,
- 837, 200, 973, 204, 973, 201, 974, 202,
- 16, 16, 200, 832, 38, 832, 833, 201,
- 833, 833, 834, 835, 975, 976, 202, 975,
- 976, 833, 16, 16, 833, 833, 833, 833,
- 200, 832, 38, 832, 833, 201, 833, 833,
- 834, 835, 977, 202, 977, 833, 16, 16,
- 833, 833, 833, 833, 200, 978, 38, 978,
- 833, 201, 833, 833, 834, 979, 202, 833,
- 16, 16, 833, 833, 833, 833, 200, 980,
- 21, 980, 201, 823, 979, 202, 16, 16,
- 200, 979, 21, 979, 837, 981, 837, 837,
- 839, 202, 837, 16, 16, 837, 837, 837,
- 837, 837, 200, 982, 204, 982, 215, 983,
- 216, 214, 214, 213, 984, 21, 984, 219,
- 985, 220, 218, 218, 217, 985, 21, 985,
- 986, 219, 986, 986, 987, 988, 989, 990,
- 991, 992, 993, 220, 987, 988, 989, 990,
- 991, 992, 993, 986, 218, 218, 986, 986,
- 986, 986, 986, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 220, 995, 218,
- 218, 995, 995, 995, 995, 217, 998, 21,
- 998, 219, 985, 997, 220, 218, 218, 217,
- 997, 21, 997, 999, 221, 999, 999, 1000,
- 220, 999, 218, 218, 999, 999, 999, 999,
- 999, 217, 1001, 38, 1001, 999, 219, 999,
- 999, 996, 220, 999, 218, 218, 999, 999,
- 999, 999, 217, 21, 219, 1003, 220, 218,
- 218, 218, 1002, 1002, 1002, 217, 21, 219,
- 1005, 220, 1006, 218, 218, 218, 1004, 1004,
- 1004, 217, 21, 219, 1005, 220, 1006, 218,
- 218, 218, 1007, 1007, 1007, 217, 21, 219,
- 1005, 220, 1006, 218, 218, 218, 1008, 1008,
- 1008, 217, 21, 219, 1005, 220, 1006, 218,
- 218, 218, 217, 21, 219, 1010, 220, 218,
- 218, 218, 1009, 1002, 1002, 217, 21, 219,
- 1011, 1005, 220, 1006, 218, 218, 218, 1012,
- 1004, 1004, 217, 21, 219, 220, 218, 218,
- 218, 1013, 217, 21, 219, 1014, 220, 218,
- 218, 218, 1015, 217, 21, 219, 220, 218,
- 218, 218, 1016, 217, 21, 219, 1017, 220,
- 218, 218, 218, 1018, 217, 21, 219, 220,
- 218, 218, 218, 1019, 217, 21, 219, 220,
- 1006, 218, 218, 218, 1020, 217, 21, 219,
- 220, 1006, 218, 218, 218, 1021, 217, 21,
- 219, 220, 1006, 218, 218, 218, 217, 1001,
- 38, 1001, 219, 996, 220, 218, 218, 217,
- 21, 219, 1017, 220, 218, 218, 218, 1022,
- 217, 21, 219, 1017, 220, 218, 218, 218,
- 217, 21, 219, 1014, 220, 218, 218, 218,
- 1023, 217, 21, 219, 1014, 220, 218, 218,
- 218, 217, 21, 219, 1011, 1005, 220, 1006,
- 218, 218, 218, 1024, 1007, 1007, 217, 21,
- 219, 1011, 1005, 220, 1006, 218, 218, 218,
- 1008, 1008, 1008, 217, 21, 219, 1026, 220,
- 1006, 218, 218, 218, 1025, 1025, 1025, 217,
- 21, 219, 1028, 220, 1006, 218, 218, 218,
- 1027, 1027, 1027, 217, 21, 219, 1028, 220,
- 1006, 218, 218, 218, 1029, 1029, 1029, 217,
- 21, 219, 1028, 220, 1006, 218, 218, 218,
- 1030, 1030, 1030, 217, 21, 219, 1028, 220,
- 1006, 218, 218, 218, 217, 21, 219, 220,
- 218, 218, 218, 1031, 1025, 1025, 217, 21,
- 219, 1011, 1028, 220, 1006, 218, 218, 218,
- 1032, 1027, 1027, 217, 21, 219, 1011, 1028,
- 220, 1006, 218, 218, 218, 1033, 1029, 1029,
- 217, 21, 219, 1011, 1028, 220, 1006, 218,
- 218, 218, 1030, 1030, 1030, 217, 21, 219,
- 220, 218, 218, 218, 1034, 217, 21, 219,
- 1011, 220, 218, 218, 218, 1035, 217, 21,
- 219, 1011, 220, 218, 218, 218, 1036, 217,
- 21, 219, 1011, 220, 218, 218, 218, 217,
- 21, 219, 1010, 220, 218, 218, 218, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1037, 220, 1037, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1038, 220, 1038,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1039, 220, 1039, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1040, 220, 1040,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1041, 220, 1041, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1042, 220, 1042,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1043, 220, 1043, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1044, 220, 1044,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 1045, 38, 1045, 995, 219, 995, 995, 996,
- 1046, 220, 995, 218, 218, 995, 995, 995,
- 995, 217, 1047, 21, 1047, 219, 985, 1046,
- 220, 218, 218, 217, 1046, 21, 1046, 1048,
- 221, 1048, 1048, 1000, 220, 1048, 218, 218,
- 1048, 1048, 1048, 1048, 1048, 217, 1049, 99,
- 1049, 1050, 219, 1050, 1050, 1051, 220, 1050,
- 218, 218, 1050, 1050, 1050, 1050, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1052, 220, 1052, 995, 218, 218, 995, 995,
- 995, 995, 217, 994, 38, 994, 995, 219,
- 995, 995, 996, 997, 1053, 220, 1053, 995,
- 218, 218, 995, 995, 995, 995, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1054, 220, 1054, 995, 218, 218, 995, 995,
- 995, 995, 217, 994, 38, 994, 995, 219,
- 995, 995, 996, 997, 1055, 220, 1055, 995,
- 218, 218, 995, 995, 995, 995, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1056, 220, 1056, 995, 218, 218, 995, 995,
- 995, 995, 217, 1057, 38, 1057, 995, 219,
- 995, 995, 996, 1058, 220, 995, 218, 218,
- 995, 995, 995, 995, 217, 1059, 21, 1059,
- 219, 985, 1058, 220, 218, 218, 217, 1060,
- 21, 1060, 999, 1061, 999, 999, 1000, 220,
- 999, 218, 218, 999, 999, 999, 999, 999,
- 217, 994, 38, 994, 995, 219, 995, 995,
- 996, 997, 1062, 1063, 220, 1062, 1063, 995,
- 218, 218, 995, 995, 995, 995, 217, 1064,
- 38, 1064, 995, 219, 995, 995, 996, 1065,
- 220, 995, 218, 218, 995, 995, 995, 995,
- 217, 1066, 21, 1066, 219, 985, 1065, 220,
- 218, 218, 217, 1065, 21, 1065, 999, 221,
- 999, 999, 1000, 220, 999, 218, 218, 999,
- 999, 1067, 999, 999, 1067, 999, 217, 1001,
- 38, 1001, 999, 219, 999, 999, 996, 220,
- 999, 218, 218, 999, 1068, 999, 999, 1068,
- 999, 217, 1001, 38, 1001, 999, 219, 999,
- 999, 996, 220, 999, 218, 218, 999, 1069,
- 999, 999, 1069, 999, 217, 1001, 38, 1001,
- 999, 219, 999, 999, 996, 220, 999, 218,
- 218, 999, 1070, 999, 999, 1070, 999, 217,
- 1001, 38, 1001, 999, 219, 999, 999, 996,
- 220, 999, 218, 218, 999, 1071, 999, 999,
- 1071, 999, 217, 1001, 38, 1001, 999, 219,
- 999, 999, 996, 220, 999, 218, 218, 999,
- 1072, 999, 999, 1072, 999, 217, 1001, 38,
- 1001, 999, 219, 999, 999, 996, 220, 999,
- 218, 218, 999, 1073, 999, 999, 1073, 999,
- 217, 1001, 38, 1001, 999, 219, 999, 999,
- 996, 220, 999, 218, 218, 999, 1074, 999,
- 999, 1074, 999, 217, 1075, 132, 1075, 219,
- 1076, 220, 218, 218, 217, 994, 38, 994,
- 995, 219, 995, 995, 996, 997, 1077, 220,
- 1077, 995, 218, 218, 995, 995, 995, 995,
- 217, 994, 38, 994, 995, 219, 995, 995,
- 996, 997, 1078, 220, 1078, 995, 218, 218,
- 995, 995, 995, 995, 217, 994, 38, 994,
- 995, 219, 995, 995, 996, 997, 1079, 220,
- 1079, 995, 218, 218, 995, 995, 995, 995,
- 217, 1080, 38, 1080, 995, 219, 995, 995,
- 996, 1081, 220, 995, 218, 218, 995, 995,
- 995, 995, 217, 1082, 21, 1082, 219, 985,
- 1081, 220, 218, 218, 217, 1083, 21, 1083,
- 999, 1084, 999, 999, 1000, 220, 999, 218,
- 218, 999, 999, 999, 999, 999, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1085, 220, 1085, 995, 218, 218, 995, 995,
- 995, 995, 217, 994, 38, 994, 995, 219,
- 995, 995, 996, 997, 1086, 220, 1086, 995,
- 218, 218, 995, 995, 995, 995, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1087, 220, 1087, 995, 218, 218, 995, 995,
- 995, 995, 217, 994, 38, 994, 995, 219,
- 995, 995, 996, 997, 1088, 220, 1088, 995,
- 218, 218, 995, 995, 995, 995, 217, 994,
- 38, 994, 995, 219, 995, 995, 996, 997,
- 1089, 220, 1089, 995, 218, 218, 995, 995,
- 995, 995, 217, 1090, 38, 1090, 995, 219,
- 995, 995, 996, 1091, 220, 995, 218, 218,
- 995, 995, 995, 995, 217, 1092, 21, 1092,
- 219, 985, 1091, 220, 218, 218, 217, 1093,
- 21, 1093, 999, 1094, 999, 999, 1000, 220,
- 999, 218, 218, 999, 999, 999, 999, 999,
- 217, 994, 38, 994, 995, 219, 995, 995,
- 996, 997, 1095, 220, 1095, 995, 218, 218,
- 995, 995, 995, 995, 217, 994, 38, 994,
- 995, 219, 995, 995, 996, 997, 1096, 220,
- 1096, 995, 218, 218, 995, 995, 995, 995,
- 217, 1097, 38, 1097, 995, 219, 995, 995,
- 996, 1098, 220, 995, 218, 218, 995, 995,
- 995, 995, 217, 1099, 21, 1099, 219, 985,
- 1098, 220, 218, 218, 217, 1098, 21, 1098,
- 1100, 221, 1100, 1100, 1000, 220, 1100, 218,
- 218, 1100, 1100, 1100, 1100, 1100, 217, 1101,
- 171, 1101, 1102, 219, 1102, 1102, 1103, 220,
- 1102, 218, 218, 1102, 1102, 1102, 1102, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1104, 220, 1104, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1105, 1106, 220,
- 1105, 1106, 995, 218, 218, 995, 995, 995,
- 995, 217, 994, 38, 994, 995, 219, 995,
- 995, 996, 997, 1107, 220, 1107, 995, 218,
- 218, 995, 995, 995, 995, 217, 994, 38,
- 994, 995, 219, 995, 995, 996, 997, 1108,
- 220, 1108, 995, 218, 218, 995, 995, 995,
- 995, 217, 1109, 38, 1109, 995, 219, 995,
- 995, 996, 1110, 220, 995, 218, 218, 995,
- 995, 995, 995, 217, 1111, 21, 1111, 219,
- 985, 1110, 220, 218, 218, 217, 1112, 21,
- 1112, 999, 1113, 999, 999, 1000, 220, 999,
- 218, 218, 999, 999, 999, 999, 999, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1114, 220, 1114, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1115, 220, 1115,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1116, 220, 1116, 995, 218, 218, 995,
- 995, 995, 995, 217, 994, 38, 994, 995,
- 219, 995, 995, 996, 997, 1117, 220, 1117,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1118, 220, 1118, 995, 218, 218, 995,
- 995, 995, 995, 217, 1119, 38, 1119, 995,
- 219, 995, 995, 996, 1120, 220, 995, 218,
- 218, 995, 995, 995, 995, 217, 1121, 21,
- 1121, 219, 985, 1120, 220, 218, 218, 217,
- 1122, 21, 1122, 999, 1123, 999, 999, 1000,
- 220, 999, 218, 218, 999, 999, 999, 999,
- 999, 217, 994, 38, 994, 995, 219, 995,
- 995, 996, 997, 1124, 1125, 220, 1124, 1125,
- 995, 218, 218, 995, 995, 995, 995, 217,
- 994, 38, 994, 995, 219, 995, 995, 996,
- 997, 1126, 220, 1126, 995, 218, 218, 995,
- 995, 995, 995, 217, 1127, 38, 1127, 995,
- 219, 995, 995, 996, 1128, 220, 995, 218,
- 218, 995, 995, 995, 995, 217, 1129, 21,
- 1129, 219, 985, 1128, 220, 218, 218, 217,
- 1128, 21, 1128, 999, 219, 999, 999, 1000,
- 220, 999, 218, 218, 999, 999, 999, 999,
- 999, 217, 994, 38, 994, 995, 219, 995,
- 995, 996, 997, 1130, 220, 1130, 995, 218,
- 218, 995, 995, 995, 995, 217, 994, 38,
- 994, 995, 219, 995, 995, 996, 997, 1131,
- 220, 1131, 995, 218, 218, 995, 995, 995,
- 995, 217, 994, 38, 994, 995, 219, 995,
- 995, 996, 997, 1132, 220, 1132, 995, 218,
- 218, 995, 995, 995, 995, 217, 994, 38,
- 994, 995, 219, 995, 995, 996, 997, 1133,
- 220, 1133, 995, 218, 218, 995, 995, 995,
- 995, 217, 994, 38, 994, 995, 219, 995,
- 995, 996, 997, 1134, 220, 1134, 995, 218,
- 218, 995, 995, 995, 995, 217, 994, 38,
- 994, 995, 219, 995, 995, 996, 997, 1135,
- 220, 1135, 995, 218, 218, 995, 995, 995,
- 995, 217, 1136, 38, 1136, 995, 219, 995,
- 995, 996, 1137, 220, 995, 218, 218, 995,
- 995, 995, 995, 217, 1138, 21, 1138, 219,
- 985, 1137, 220, 218, 218, 217, 1139, 21,
- 1139, 999, 1140, 999, 999, 1000, 220, 999,
- 218, 218, 999, 999, 999, 999, 999, 217,
- 1142, 21, 1142, 1143, 1144, 1145, 16, 16,
- 1141, 21, 1143, 1145, 16, 16, 16, 1141,
- 1146, 1147, 1146, 1148, 16, 21, 1141, 1141,
- 16, 1144, 21, 1144, 1149, 1143, 1149, 1149,
- 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1145,
- 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1149,
- 16, 16, 1149, 1149, 1149, 1149, 1149, 1141,
- 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
- 1160, 1145, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1161, 21, 1161, 1143, 1144, 1160,
- 1145, 16, 16, 1141, 1160, 21, 1160, 1162,
- 1163, 1162, 1162, 1164, 1145, 1162, 16, 16,
- 1162, 1162, 1162, 1162, 1162, 1141, 1165, 38,
- 1165, 1162, 1143, 1162, 1162, 1159, 1145, 1162,
- 16, 16, 1162, 1162, 1162, 1162, 1141, 1166,
- 1147, 1166, 51, 1167, 52, 16, 16, 47,
- 21, 1143, 1169, 1145, 16, 16, 16, 1168,
- 1168, 1168, 1141, 21, 1143, 1171, 1145, 1172,
- 16, 16, 16, 1170, 1170, 1170, 1141, 21,
- 1143, 1171, 1145, 1172, 16, 16, 16, 1173,
- 1173, 1173, 1141, 21, 1143, 1171, 1145, 1172,
- 16, 16, 16, 1174, 1174, 1174, 1141, 21,
- 1143, 1171, 1145, 1172, 16, 16, 16, 1141,
- 21, 1143, 1176, 1145, 16, 16, 16, 1175,
- 1168, 1168, 1141, 21, 1143, 1177, 1171, 1145,
- 1172, 16, 16, 16, 1178, 1170, 1170, 1141,
- 21, 1143, 1145, 16, 16, 16, 1179, 1141,
- 21, 1143, 1180, 1145, 16, 16, 16, 1181,
- 1141, 21, 1143, 1145, 16, 16, 16, 1182,
- 1141, 21, 1143, 1183, 1145, 16, 16, 16,
- 1184, 1141, 21, 1143, 1145, 16, 16, 16,
- 1185, 1141, 21, 1143, 1145, 1172, 16, 16,
- 16, 1186, 1141, 21, 1143, 1145, 1172, 16,
- 16, 16, 1187, 1141, 21, 1143, 1145, 1172,
- 16, 16, 16, 1141, 1165, 38, 1165, 1143,
- 1159, 1145, 16, 16, 1141, 21, 1143, 1183,
- 1145, 16, 16, 16, 1188, 1141, 21, 1143,
- 1183, 1145, 16, 16, 16, 1141, 21, 1143,
- 1180, 1145, 16, 16, 16, 1189, 1141, 21,
- 1143, 1180, 1145, 16, 16, 16, 1141, 21,
- 1143, 1177, 1171, 1145, 1172, 16, 16, 16,
- 1190, 1173, 1173, 1141, 21, 1143, 1177, 1171,
- 1145, 1172, 16, 16, 16, 1174, 1174, 1174,
- 1141, 21, 1143, 1192, 1145, 1172, 16, 16,
- 16, 1191, 1191, 1191, 1141, 21, 1143, 1194,
- 1145, 1172, 16, 16, 16, 1193, 1193, 1193,
- 1141, 21, 1143, 1194, 1145, 1172, 16, 16,
- 16, 1195, 1195, 1195, 1141, 21, 1143, 1194,
- 1145, 1172, 16, 16, 16, 1196, 1196, 1196,
- 1141, 21, 1143, 1194, 1145, 1172, 16, 16,
- 16, 1141, 21, 1143, 1145, 16, 16, 16,
- 1197, 1191, 1191, 1141, 21, 1143, 1177, 1194,
- 1145, 1172, 16, 16, 16, 1198, 1193, 1193,
- 1141, 21, 1143, 1177, 1194, 1145, 1172, 16,
- 16, 16, 1199, 1195, 1195, 1141, 21, 1143,
- 1177, 1194, 1145, 1172, 16, 16, 16, 1196,
- 1196, 1196, 1141, 21, 1143, 1145, 16, 16,
- 16, 1200, 1141, 21, 1143, 1177, 1145, 16,
- 16, 16, 1201, 1141, 21, 1143, 1177, 1145,
- 16, 16, 16, 1202, 1141, 21, 1143, 1177,
- 1145, 16, 16, 16, 1141, 21, 1143, 1176,
- 1145, 16, 16, 16, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1203, 1145,
- 1203, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1204, 1145, 1204, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1205, 1145,
- 1205, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1206, 1145, 1206, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1207, 1145,
- 1207, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1208, 1145, 1208, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1209, 1145,
- 1209, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1210, 1145, 1210, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1211, 38, 1211,
- 1158, 1143, 1158, 1158, 1159, 1212, 1145, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1213,
- 21, 1213, 1143, 1144, 1212, 1145, 16, 16,
- 1141, 1212, 21, 1212, 1214, 1163, 1214, 1214,
- 1164, 1145, 1214, 16, 16, 1214, 1214, 1214,
- 1214, 1214, 1141, 1215, 99, 1215, 1216, 1143,
- 1216, 1216, 1217, 1145, 1216, 16, 16, 1216,
- 1216, 1216, 1216, 1141, 1157, 38, 1157, 1158,
- 1143, 1158, 1158, 1159, 1160, 1218, 1145, 1218,
- 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
- 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
- 1160, 1219, 1145, 1219, 1158, 16, 16, 1158,
- 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
- 1143, 1158, 1158, 1159, 1160, 1220, 1145, 1220,
- 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
- 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
- 1160, 1221, 1145, 1221, 1158, 16, 16, 1158,
- 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
- 1143, 1158, 1158, 1159, 1160, 1222, 1145, 1222,
- 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
- 1223, 38, 1223, 1158, 1143, 1158, 1158, 1159,
- 1224, 1145, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1225, 21, 1225, 1143, 1144, 1224,
- 1145, 16, 16, 1141, 1226, 21, 1226, 1162,
- 1227, 1162, 1162, 1164, 1145, 1162, 16, 16,
- 1162, 1162, 1162, 1162, 1162, 1141, 1228, 1147,
- 1228, 113, 1229, 114, 16, 16, 112, 1157,
- 38, 1157, 1158, 1143, 1158, 1158, 1159, 1160,
- 1230, 1231, 1145, 1230, 1231, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1232, 38, 1232,
- 1158, 1143, 1158, 1158, 1159, 1233, 1145, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1234,
- 21, 1234, 1143, 1144, 1233, 1145, 16, 16,
- 1141, 1233, 21, 1233, 1162, 1163, 1162, 1162,
- 1164, 1145, 1162, 16, 16, 1162, 1162, 1235,
- 1162, 1162, 1235, 1162, 1141, 1165, 38, 1165,
- 1162, 1143, 1162, 1162, 1159, 1145, 1162, 16,
- 16, 1162, 1236, 1162, 1162, 1236, 1162, 1141,
- 1165, 38, 1165, 1162, 1143, 1162, 1162, 1159,
- 1145, 1162, 16, 16, 1162, 1237, 1162, 1162,
- 1237, 1162, 1141, 1165, 38, 1165, 1162, 1143,
- 1162, 1162, 1159, 1145, 1162, 16, 16, 1162,
- 1238, 1162, 1162, 1238, 1162, 1141, 1165, 38,
- 1165, 1162, 1143, 1162, 1162, 1159, 1145, 1162,
- 16, 16, 1162, 1239, 1162, 1162, 1239, 1162,
- 1141, 1165, 38, 1165, 1162, 1143, 1162, 1162,
- 1159, 1145, 1162, 16, 16, 1162, 1240, 1162,
- 1162, 1240, 1162, 1141, 1165, 38, 1165, 1162,
- 1143, 1162, 1162, 1159, 1145, 1162, 16, 16,
- 1162, 1241, 1162, 1162, 1241, 1162, 1141, 1165,
- 38, 1165, 1162, 1143, 1162, 1162, 1159, 1145,
- 1162, 16, 16, 1162, 1242, 1162, 1162, 1242,
- 1162, 1141, 1243, 132, 1243, 1143, 1244, 1145,
- 16, 16, 1141, 1157, 38, 1157, 1158, 1143,
- 1158, 1158, 1159, 1160, 1245, 1145, 1245, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1157,
- 38, 1157, 1158, 1143, 1158, 1158, 1159, 1160,
- 1246, 1145, 1246, 1158, 16, 16, 1158, 1158,
- 1158, 1158, 1141, 1157, 38, 1157, 1158, 1143,
- 1158, 1158, 1159, 1160, 1247, 1145, 1247, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1248,
- 38, 1248, 1158, 1143, 1158, 1158, 1159, 1249,
- 1145, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1250, 21, 1250, 1143, 1144, 1249, 1145,
- 16, 16, 1141, 1251, 21, 1251, 1162, 1252,
- 1162, 1162, 1164, 1145, 1162, 16, 16, 1162,
- 1162, 1162, 1162, 1162, 1141, 1253, 1147, 1253,
- 143, 1254, 144, 16, 16, 142, 1157, 38,
- 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1255,
- 1145, 1255, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
- 1158, 1159, 1160, 1256, 1145, 1256, 1158, 16,
- 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
- 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1257,
- 1145, 1257, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
- 1158, 1159, 1160, 1258, 1145, 1258, 1158, 16,
- 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
- 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1259,
- 1145, 1259, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1260, 38, 1260, 1158, 1143, 1158,
- 1158, 1159, 1261, 1145, 1158, 16, 16, 1158,
- 1158, 1158, 1158, 1141, 1262, 21, 1262, 1143,
- 1144, 1261, 1145, 16, 16, 1141, 1263, 21,
- 1263, 1162, 1264, 1162, 1162, 1164, 1145, 1162,
- 16, 16, 1162, 1162, 1162, 1162, 1162, 1141,
- 1265, 1147, 1265, 159, 1266, 160, 16, 16,
- 158, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1267, 1145, 1267, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1268, 1145,
- 1268, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1269, 38, 1269, 1158, 1143, 1158, 1158,
- 1159, 1270, 1145, 1158, 16, 16, 1158, 1158,
- 1158, 1158, 1141, 1271, 21, 1271, 1143, 1144,
- 1270, 1145, 16, 16, 1141, 1270, 21, 1270,
- 1272, 1163, 1272, 1272, 1164, 1145, 1272, 16,
- 16, 1272, 1272, 1272, 1272, 1272, 1141, 1273,
- 171, 1273, 1274, 1143, 1274, 1274, 1275, 1145,
- 1274, 16, 16, 1274, 1274, 1274, 1274, 1141,
- 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
- 1160, 1276, 1145, 1276, 1158, 16, 16, 1158,
- 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
- 1143, 1158, 1158, 1159, 1160, 1277, 1278, 1145,
- 1277, 1278, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
- 1158, 1159, 1160, 1279, 1145, 1279, 1158, 16,
- 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
- 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1280,
- 1145, 1280, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1281, 38, 1281, 1158, 1143, 1158,
- 1158, 1159, 1282, 1145, 1158, 16, 16, 1158,
- 1158, 1158, 1158, 1141, 1283, 21, 1283, 1143,
- 1144, 1282, 1145, 16, 16, 1141, 1284, 21,
- 1284, 1162, 1285, 1162, 1162, 1164, 1145, 1162,
- 16, 16, 1162, 1162, 1162, 1162, 1162, 1141,
- 1286, 1147, 1286, 185, 1287, 186, 16, 16,
- 184, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1288, 1145, 1288, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1289, 1145,
- 1289, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1290, 1145, 1290, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1291, 1145,
- 1291, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1292, 1145, 1292, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1293, 38, 1293,
- 1158, 1143, 1158, 1158, 1159, 1294, 1145, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1295,
- 21, 1295, 1143, 1144, 1294, 1145, 16, 16,
- 1141, 1296, 21, 1296, 1162, 1297, 1162, 1162,
- 1164, 1145, 1162, 16, 16, 1162, 1162, 1162,
- 1162, 1162, 1141, 1298, 1147, 1298, 201, 1299,
- 202, 16, 16, 200, 1157, 38, 1157, 1158,
- 1143, 1158, 1158, 1159, 1160, 1300, 1301, 1145,
- 1300, 1301, 1158, 16, 16, 1158, 1158, 1158,
- 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
- 1158, 1159, 1160, 1302, 1145, 1302, 1158, 16,
- 16, 1158, 1158, 1158, 1158, 1141, 1303, 38,
- 1303, 1158, 1143, 1158, 1158, 1159, 1304, 1145,
- 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
- 1305, 21, 1305, 1143, 1144, 1304, 1145, 16,
- 16, 1141, 1304, 21, 1304, 1162, 1306, 1162,
- 1162, 1164, 1145, 1162, 16, 16, 1162, 1162,
- 1162, 1162, 1162, 1141, 1307, 1147, 1307, 215,
- 1308, 216, 214, 214, 213, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1309, 1145,
- 1309, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1310, 1145, 1310, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1311, 1145,
- 1311, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1312, 1145, 1312, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
- 1158, 1143, 1158, 1158, 1159, 1160, 1313, 1145,
- 1313, 1158, 16, 16, 1158, 1158, 1158, 1158,
- 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
- 1159, 1160, 1314, 1145, 1314, 1158, 16, 16,
- 1158, 1158, 1158, 1158, 1141, 1315, 38, 1315,
- 1158, 1143, 1158, 1158, 1159, 1316, 1145, 1158,
- 16, 16, 1158, 1158, 1158, 1158, 1141, 1317,
- 21, 1317, 1143, 1144, 1316, 1145, 16, 16,
- 1141, 1318, 21, 1318, 1162, 1319, 1162, 1162,
- 1164, 1145, 1162, 16, 16, 1162, 1162, 1162,
- 1162, 1162, 1141, 1320, 1147, 1320, 1143, 1321,
- 1145, 16, 16, 1141, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 1322, 202, 1322,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 1323, 202, 1323, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 1324, 202, 1324,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 1325, 202, 1325, 833, 16, 16, 833,
- 833, 833, 833, 200, 832, 38, 832, 833,
- 201, 833, 833, 834, 835, 1326, 202, 1326,
- 833, 16, 16, 833, 833, 833, 833, 200,
- 832, 38, 832, 833, 201, 833, 833, 834,
- 835, 1327, 202, 1327, 833, 16, 16, 833,
- 833, 833, 833, 200, 1328, 38, 1328, 833,
- 201, 833, 833, 834, 1329, 202, 833, 16,
- 16, 833, 833, 833, 833, 200, 1330, 21,
- 1330, 201, 823, 1329, 202, 16, 16, 200,
- 1331, 21, 1331, 837, 1332, 837, 837, 839,
- 202, 837, 16, 16, 837, 837, 837, 837,
- 837, 200, 1333, 204, 1333, 1143, 1334, 1145,
- 16, 16, 1141, 679, 38, 679, 680, 185,
- 680, 680, 681, 682, 1335, 1336, 186, 1335,
- 1336, 680, 16, 16, 680, 680, 680, 680,
- 184, 679, 38, 679, 680, 185, 680, 680,
- 681, 682, 1337, 186, 1337, 680, 16, 16,
- 680, 680, 680, 680, 184, 1338, 38, 1338,
- 680, 185, 680, 680, 681, 1339, 186, 680,
- 16, 16, 680, 680, 680, 680, 184, 1340,
- 21, 1340, 185, 670, 1339, 186, 16, 16,
- 184, 1339, 21, 1339, 684, 1341, 684, 684,
- 686, 186, 684, 16, 16, 684, 684, 684,
- 684, 684, 184, 1342, 188, 1342, 215, 1343,
- 216, 214, 214, 213, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 1344, 186, 1344,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 1345, 186, 1345, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 1346, 186, 1346,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 1347, 186, 1347, 680, 16, 16, 680,
- 680, 680, 680, 184, 679, 38, 679, 680,
- 185, 680, 680, 681, 682, 1348, 186, 1348,
- 680, 16, 16, 680, 680, 680, 680, 184,
- 679, 38, 679, 680, 185, 680, 680, 681,
- 682, 1349, 186, 1349, 680, 16, 16, 680,
- 680, 680, 680, 184, 1350, 38, 1350, 680,
- 185, 680, 680, 681, 1351, 186, 680, 16,
- 16, 680, 680, 680, 680, 184, 1352, 21,
- 1352, 185, 670, 1351, 186, 16, 16, 184,
- 1353, 21, 1353, 684, 1354, 684, 684, 686,
- 186, 684, 16, 16, 684, 684, 684, 684,
- 684, 184, 1355, 188, 1355, 1143, 1356, 1145,
- 16, 16, 1141, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1357, 160, 1357, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 1358, 160, 1358, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1359, 160, 1359, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 1360, 160, 1360, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1361, 160, 1361, 539,
- 16, 16, 539, 539, 539, 539, 158, 1362,
- 38, 1362, 539, 159, 539, 539, 540, 1363,
- 160, 539, 16, 16, 539, 539, 539, 539,
- 158, 1364, 21, 1364, 159, 529, 1363, 160,
- 16, 16, 158, 1365, 21, 1365, 543, 1366,
- 543, 543, 545, 160, 543, 16, 16, 543,
- 543, 543, 543, 543, 158, 1367, 162, 1367,
- 201, 1368, 202, 16, 16, 200, 538, 38,
- 538, 539, 159, 539, 539, 540, 541, 1369,
- 1370, 160, 1369, 1370, 539, 16, 16, 539,
- 539, 539, 539, 158, 538, 38, 538, 539,
- 159, 539, 539, 540, 541, 1371, 160, 1371,
- 539, 16, 16, 539, 539, 539, 539, 158,
- 1372, 38, 1372, 539, 159, 539, 539, 540,
- 1373, 160, 539, 16, 16, 539, 539, 539,
- 539, 158, 1374, 21, 1374, 159, 529, 1373,
- 160, 16, 16, 158, 1373, 21, 1373, 543,
- 1375, 543, 543, 545, 160, 543, 16, 16,
- 543, 543, 543, 543, 543, 158, 1376, 162,
- 1376, 215, 1377, 216, 214, 214, 213, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 1378, 160, 1378, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1379, 160, 1379, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 1380, 160, 1380, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1381, 160, 1381, 539,
- 16, 16, 539, 539, 539, 539, 158, 538,
- 38, 538, 539, 159, 539, 539, 540, 541,
- 1382, 160, 1382, 539, 16, 16, 539, 539,
- 539, 539, 158, 538, 38, 538, 539, 159,
- 539, 539, 540, 541, 1383, 160, 1383, 539,
- 16, 16, 539, 539, 539, 539, 158, 1384,
- 38, 1384, 539, 159, 539, 539, 540, 1385,
- 160, 539, 16, 16, 539, 539, 539, 539,
- 158, 1386, 21, 1386, 159, 529, 1385, 160,
- 16, 16, 158, 1387, 21, 1387, 543, 1388,
- 543, 543, 545, 160, 543, 16, 16, 543,
- 543, 543, 543, 543, 158, 1389, 162, 1389,
- 1143, 1390, 1145, 16, 16, 1141, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1391,
- 144, 1391, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1392, 144, 1392, 419, 16,
- 16, 419, 419, 419, 419, 142, 1393, 38,
- 1393, 419, 143, 419, 419, 420, 1394, 144,
- 419, 16, 16, 419, 419, 419, 419, 142,
- 1395, 21, 1395, 143, 409, 1394, 144, 16,
- 16, 142, 1394, 21, 1394, 1396, 424, 1396,
- 1396, 425, 144, 1396, 16, 16, 1396, 1396,
- 1396, 1396, 1396, 142, 1397, 171, 1397, 1398,
- 143, 1398, 1398, 1399, 144, 1398, 16, 16,
- 1398, 1398, 1398, 1398, 142, 418, 38, 418,
- 419, 143, 419, 419, 420, 421, 1400, 144,
- 1400, 419, 16, 16, 419, 419, 419, 419,
- 142, 418, 38, 418, 419, 143, 419, 419,
- 420, 421, 1401, 1402, 144, 1401, 1402, 419,
- 16, 16, 419, 419, 419, 419, 142, 418,
- 38, 418, 419, 143, 419, 419, 420, 421,
- 1403, 144, 1403, 419, 16, 16, 419, 419,
- 419, 419, 142, 418, 38, 418, 419, 143,
- 419, 419, 420, 421, 1404, 144, 1404, 419,
- 16, 16, 419, 419, 419, 419, 142, 1405,
- 38, 1405, 419, 143, 419, 419, 420, 1406,
- 144, 419, 16, 16, 419, 419, 419, 419,
- 142, 1407, 21, 1407, 143, 409, 1406, 144,
- 16, 16, 142, 1408, 21, 1408, 423, 1409,
- 423, 423, 425, 144, 423, 16, 16, 423,
- 423, 423, 423, 423, 142, 1410, 146, 1410,
- 185, 1411, 186, 16, 16, 184, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1412,
- 144, 1412, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1413, 144, 1413, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1414,
- 144, 1414, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1415, 144, 1415, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1416,
- 144, 1416, 419, 16, 16, 419, 419, 419,
- 419, 142, 1417, 38, 1417, 419, 143, 419,
- 419, 420, 1418, 144, 419, 16, 16, 419,
- 419, 419, 419, 142, 1419, 21, 1419, 143,
- 409, 1418, 144, 16, 16, 142, 1420, 21,
- 1420, 423, 1421, 423, 423, 425, 144, 423,
- 16, 16, 423, 423, 423, 423, 423, 142,
- 1422, 146, 1422, 201, 1423, 202, 16, 16,
- 200, 418, 38, 418, 419, 143, 419, 419,
- 420, 421, 1424, 1425, 144, 1424, 1425, 419,
- 16, 16, 419, 419, 419, 419, 142, 418,
- 38, 418, 419, 143, 419, 419, 420, 421,
- 1426, 144, 1426, 419, 16, 16, 419, 419,
- 419, 419, 142, 1427, 38, 1427, 419, 143,
- 419, 419, 420, 1428, 144, 419, 16, 16,
- 419, 419, 419, 419, 142, 1429, 21, 1429,
- 143, 409, 1428, 144, 16, 16, 142, 1428,
- 21, 1428, 423, 1430, 423, 423, 425, 144,
- 423, 16, 16, 423, 423, 423, 423, 423,
- 142, 1431, 146, 1431, 215, 1432, 216, 214,
- 214, 213, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1433, 144, 1433, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1434,
- 144, 1434, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1435, 144, 1435, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1436,
- 144, 1436, 419, 16, 16, 419, 419, 419,
- 419, 142, 418, 38, 418, 419, 143, 419,
- 419, 420, 421, 1437, 144, 1437, 419, 16,
- 16, 419, 419, 419, 419, 142, 418, 38,
- 418, 419, 143, 419, 419, 420, 421, 1438,
- 144, 1438, 419, 16, 16, 419, 419, 419,
- 419, 142, 1439, 38, 1439, 419, 143, 419,
- 419, 420, 1440, 144, 419, 16, 16, 419,
- 419, 419, 419, 142, 1441, 21, 1441, 143,
- 409, 1440, 144, 16, 16, 142, 1442, 21,
- 1442, 423, 1443, 423, 423, 425, 144, 423,
- 16, 16, 423, 423, 423, 423, 423, 142,
- 1444, 146, 1444, 1143, 1445, 1145, 16, 16,
- 1141, 312, 38, 312, 313, 113, 313, 313,
- 301, 314, 1446, 114, 1446, 313, 16, 16,
- 313, 313, 313, 313, 112, 312, 38, 312,
- 313, 113, 313, 313, 301, 314, 1447, 114,
- 1447, 313, 16, 16, 313, 313, 313, 313,
- 112, 312, 38, 312, 313, 113, 313, 313,
- 301, 314, 1448, 114, 1448, 313, 16, 16,
- 313, 313, 313, 313, 112, 312, 38, 312,
- 313, 113, 313, 313, 301, 314, 1449, 114,
- 1449, 313, 16, 16, 313, 313, 313, 313,
- 112, 312, 38, 312, 313, 113, 313, 313,
- 301, 314, 1450, 114, 1450, 313, 16, 16,
- 313, 313, 313, 313, 112, 1451, 38, 1451,
- 313, 113, 313, 313, 301, 1452, 114, 313,
- 16, 16, 313, 313, 313, 313, 112, 1453,
- 21, 1453, 113, 303, 1452, 114, 16, 16,
- 112, 1454, 21, 1454, 316, 1455, 316, 316,
- 318, 114, 316, 16, 16, 316, 316, 316,
- 316, 316, 112, 1456, 116, 1456, 159, 1457,
- 160, 16, 16, 158, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1458, 114, 1458,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1459, 114, 1459, 313, 16, 16, 313,
- 313, 313, 313, 112, 1460, 38, 1460, 313,
- 113, 313, 313, 301, 1461, 114, 313, 16,
- 16, 313, 313, 313, 313, 112, 1462, 21,
- 1462, 113, 303, 1461, 114, 16, 16, 112,
- 1461, 21, 1461, 1463, 317, 1463, 1463, 318,
- 114, 1463, 16, 16, 1463, 1463, 1463, 1463,
- 1463, 112, 1464, 171, 1464, 1465, 113, 1465,
- 1465, 1466, 114, 1465, 16, 16, 1465, 1465,
- 1465, 1465, 112, 312, 38, 312, 313, 113,
- 313, 313, 301, 314, 1467, 114, 1467, 313,
- 16, 16, 313, 313, 313, 313, 112, 312,
- 38, 312, 313, 113, 313, 313, 301, 314,
- 1468, 1469, 114, 1468, 1469, 313, 16, 16,
- 313, 313, 313, 313, 112, 312, 38, 312,
- 313, 113, 313, 313, 301, 314, 1470, 114,
- 1470, 313, 16, 16, 313, 313, 313, 313,
- 112, 312, 38, 312, 313, 113, 313, 313,
- 301, 314, 1471, 114, 1471, 313, 16, 16,
- 313, 313, 313, 313, 112, 1472, 38, 1472,
- 313, 113, 313, 313, 301, 1473, 114, 313,
- 16, 16, 313, 313, 313, 313, 112, 1474,
- 21, 1474, 113, 303, 1473, 114, 16, 16,
- 112, 1475, 21, 1475, 316, 1476, 316, 316,
- 318, 114, 316, 16, 16, 316, 316, 316,
- 316, 316, 112, 1477, 116, 1477, 185, 1478,
- 186, 16, 16, 184, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1479, 114, 1479,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1480, 114, 1480, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1481, 114, 1481,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1482, 114, 1482, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1483, 114, 1483,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 1484, 38, 1484, 313, 113, 313, 313, 301,
- 1485, 114, 313, 16, 16, 313, 313, 313,
- 313, 112, 1486, 21, 1486, 113, 303, 1485,
- 114, 16, 16, 112, 1487, 21, 1487, 316,
- 1488, 316, 316, 318, 114, 316, 16, 16,
- 316, 316, 316, 316, 316, 112, 1489, 116,
- 1489, 201, 1490, 202, 16, 16, 200, 312,
- 38, 312, 313, 113, 313, 313, 301, 314,
- 1491, 1492, 114, 1491, 1492, 313, 16, 16,
- 313, 313, 313, 313, 112, 312, 38, 312,
- 313, 113, 313, 313, 301, 314, 1493, 114,
- 1493, 313, 16, 16, 313, 313, 313, 313,
- 112, 1494, 38, 1494, 313, 113, 313, 313,
- 301, 1495, 114, 313, 16, 16, 313, 313,
- 313, 313, 112, 1496, 21, 1496, 113, 303,
- 1495, 114, 16, 16, 112, 1495, 21, 1495,
- 316, 1497, 316, 316, 318, 114, 316, 16,
- 16, 316, 316, 316, 316, 316, 112, 1498,
- 116, 1498, 215, 1499, 216, 214, 214, 213,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1500, 114, 1500, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1501, 114, 1501,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1502, 114, 1502, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1503, 114, 1503,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 312, 38, 312, 313, 113, 313, 313, 301,
- 314, 1504, 114, 1504, 313, 16, 16, 313,
- 313, 313, 313, 112, 312, 38, 312, 313,
- 113, 313, 313, 301, 314, 1505, 114, 1505,
- 313, 16, 16, 313, 313, 313, 313, 112,
- 1506, 38, 1506, 313, 113, 313, 313, 301,
- 1507, 114, 313, 16, 16, 313, 313, 313,
- 313, 112, 1508, 21, 1508, 113, 303, 1507,
- 114, 16, 16, 112, 1509, 21, 1509, 316,
- 1510, 316, 316, 318, 114, 316, 16, 16,
- 316, 316, 316, 316, 316, 112, 1511, 116,
- 1511, 1143, 1512, 1145, 16, 16, 1141, 232,
- 38, 232, 233, 51, 233, 233, 234, 235,
- 1513, 1514, 52, 1513, 1514, 233, 16, 16,
- 233, 233, 233, 233, 47, 1515, 38, 1515,
- 233, 51, 233, 233, 234, 1516, 52, 233,
- 16, 16, 233, 233, 233, 233, 47, 1517,
- 21, 1517, 51, 223, 1516, 52, 16, 16,
- 47, 1516, 21, 1516, 237, 238, 237, 237,
- 239, 52, 237, 16, 16, 237, 237, 1518,
- 237, 237, 1518, 237, 47, 240, 38, 240,
- 237, 51, 237, 237, 234, 52, 237, 16,
- 16, 237, 1519, 237, 237, 1519, 237, 47,
- 240, 38, 240, 237, 51, 237, 237, 234,
- 52, 237, 16, 16, 237, 1520, 237, 237,
- 1520, 237, 47, 240, 38, 240, 237, 51,
- 237, 237, 234, 52, 237, 16, 16, 237,
- 1521, 237, 237, 1521, 237, 47, 240, 38,
- 240, 237, 51, 237, 237, 234, 52, 237,
- 16, 16, 237, 1522, 237, 237, 1522, 237,
- 47, 240, 38, 240, 237, 51, 237, 237,
- 234, 52, 237, 16, 16, 237, 1523, 237,
- 237, 1523, 237, 47, 240, 38, 240, 237,
- 51, 237, 237, 234, 52, 237, 16, 16,
- 237, 1524, 237, 237, 1524, 237, 47, 240,
- 38, 240, 237, 51, 237, 237, 234, 52,
- 237, 16, 16, 237, 1525, 237, 237, 1525,
- 237, 47, 1526, 132, 1526, 51, 1527, 52,
- 16, 16, 47, 232, 38, 232, 233, 51,
- 233, 233, 234, 235, 1528, 52, 1528, 233,
- 16, 16, 233, 233, 233, 233, 47, 232,
- 38, 232, 233, 51, 233, 233, 234, 235,
- 1529, 52, 1529, 233, 16, 16, 233, 233,
- 233, 233, 47, 232, 38, 232, 233, 51,
- 233, 233, 234, 235, 1530, 52, 1530, 233,
- 16, 16, 233, 233, 233, 233, 47, 1531,
- 38, 1531, 233, 51, 233, 233, 234, 1532,
- 52, 233, 16, 16, 233, 233, 233, 233,
- 47, 1533, 21, 1533, 51, 223, 1532, 52,
- 16, 16, 47, 1534, 21, 1534, 237, 1535,
- 237, 237, 239, 52, 237, 16, 16, 237,
- 237, 237, 237, 237, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1536, 52,
- 1536, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 1537, 52, 1537, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1538, 52,
- 1538, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 1539, 52, 1539, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1540, 52,
- 1540, 233, 16, 16, 233, 233, 233, 233,
- 47, 1541, 38, 1541, 233, 51, 233, 233,
- 234, 1542, 52, 233, 16, 16, 233, 233,
- 233, 233, 47, 1543, 21, 1543, 51, 223,
- 1542, 52, 16, 16, 47, 1544, 21, 1544,
- 237, 1545, 237, 237, 239, 52, 237, 16,
- 16, 237, 237, 237, 237, 237, 47, 232,
- 38, 232, 233, 51, 233, 233, 234, 235,
- 1546, 52, 1546, 233, 16, 16, 233, 233,
- 233, 233, 47, 232, 38, 232, 233, 51,
- 233, 233, 234, 235, 1547, 52, 1547, 233,
- 16, 16, 233, 233, 233, 233, 47, 1548,
- 38, 1548, 233, 51, 233, 233, 234, 1549,
- 52, 233, 16, 16, 233, 233, 233, 233,
- 47, 1550, 21, 1550, 51, 223, 1549, 52,
- 16, 16, 47, 1549, 21, 1549, 1551, 238,
- 1551, 1551, 239, 52, 1551, 16, 16, 1551,
- 1551, 1551, 1551, 1551, 47, 1552, 171, 1552,
- 1553, 51, 1553, 1553, 1554, 52, 1553, 16,
- 16, 1553, 1553, 1553, 1553, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 1555,
- 52, 1555, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 1556, 1557, 52, 1556, 1557,
- 233, 16, 16, 233, 233, 233, 233, 47,
- 232, 38, 232, 233, 51, 233, 233, 234,
- 235, 1558, 52, 1558, 233, 16, 16, 233,
- 233, 233, 233, 47, 232, 38, 232, 233,
- 51, 233, 233, 234, 235, 1559, 52, 1559,
- 233, 16, 16, 233, 233, 233, 233, 47,
- 1560, 38, 1560, 233, 51, 233, 233, 234,
- 1561, 52, 233, 16, 16, 233, 233, 233,
- 233, 47, 1562, 21, 1562, 51, 223, 1561,
- 52, 16, 16, 47, 1563, 21, 1563, 237,
- 1564, 237, 237, 239, 52, 237, 16, 16,
- 237, 237, 237, 237, 237, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 1565,
- 52, 1565, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 1566, 52, 1566, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 1567,
- 52, 1567, 233, 16, 16, 233, 233, 233,
- 233, 47, 232, 38, 232, 233, 51, 233,
- 233, 234, 235, 1568, 52, 1568, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 1569,
- 52, 1569, 233, 16, 16, 233, 233, 233,
- 233, 47, 1570, 38, 1570, 233, 51, 233,
- 233, 234, 1571, 52, 233, 16, 16, 233,
- 233, 233, 233, 47, 1572, 21, 1572, 51,
- 223, 1571, 52, 16, 16, 47, 1573, 21,
- 1573, 237, 1574, 237, 237, 239, 52, 237,
- 16, 16, 237, 237, 237, 237, 237, 47,
- 232, 38, 232, 233, 51, 233, 233, 234,
- 235, 1575, 1576, 52, 1575, 1576, 233, 16,
- 16, 233, 233, 233, 233, 47, 232, 38,
- 232, 233, 51, 233, 233, 234, 235, 1577,
- 52, 1577, 233, 16, 16, 233, 233, 233,
- 233, 47, 1578, 38, 1578, 233, 51, 233,
- 233, 234, 1579, 52, 233, 16, 16, 233,
- 233, 233, 233, 47, 1580, 21, 1580, 51,
- 223, 1579, 52, 16, 16, 47, 1579, 21,
- 1579, 237, 1581, 237, 237, 239, 52, 237,
- 16, 16, 237, 237, 237, 237, 237, 47,
- 1582, 38, 1582, 215, 1583, 216, 214, 214,
- 213, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 1584, 52, 1584, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1585, 52,
- 1585, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 1586, 52, 1586, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1587, 52,
- 1587, 233, 16, 16, 233, 233, 233, 233,
- 47, 232, 38, 232, 233, 51, 233, 233,
- 234, 235, 1588, 52, 1588, 233, 16, 16,
- 233, 233, 233, 233, 47, 232, 38, 232,
- 233, 51, 233, 233, 234, 235, 1589, 52,
- 1589, 233, 16, 16, 233, 233, 233, 233,
- 47, 1590, 38, 1590, 233, 51, 233, 233,
- 234, 1591, 52, 233, 16, 16, 233, 233,
- 233, 233, 47, 1592, 21, 1592, 51, 223,
- 1591, 52, 16, 16, 47, 1593, 21, 1593,
- 237, 1594, 237, 237, 239, 52, 237, 16,
- 16, 237, 237, 237, 237, 237, 47, 37,
- 38, 37, 39, 39, 39, 40, 41, 1595,
- 1595, 39, 39, 39, 39, 39, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 1596,
- 1596, 39, 39, 39, 39, 39, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 1597,
- 1597, 39, 39, 39, 39, 39, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 1598,
- 1598, 39, 39, 39, 39, 39, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 1599,
- 1599, 39, 39, 39, 39, 39, 16, 37,
- 38, 37, 39, 39, 39, 40, 41, 1600,
- 1600, 39, 39, 39, 39, 39, 16, 1601,
- 38, 1601, 39, 39, 39, 40, 1602, 39,
- 39, 39, 39, 39, 16, 1603, 21, 1603,
- 43, 1602, 16, 1604, 21, 1604, 46, 1605,
- 46, 46, 48, 46, 46, 46, 46, 46,
- 46, 16, 37, 38, 37, 39, 39, 39,
- 40, 41, 1606, 207, 1606, 207, 39, 39,
- 39, 39, 39, 16, 37, 38, 37, 39,
- 39, 39, 40, 41, 1607, 1607, 39, 39,
- 39, 39, 39, 16, 1608, 38, 1608, 39,
- 39, 39, 40, 1609, 39, 39, 39, 39,
- 39, 16, 1610, 21, 1610, 43, 1609, 16,
- 1609, 21, 1609, 46, 1611, 46, 46, 48,
- 46, 46, 46, 46, 46, 46, 16, 21,
- 215, 1613, 214, 214, 214, 1612, 21, 219,
- 1615, 218, 218, 218, 1614, 21, 1616, 1614,
- 1614, 218, 1617, 21, 1617, 51, 1618, 52,
- 16, 16, 47, 1618, 21, 1618, 1619, 51,
- 1619, 1619, 1620, 1621, 1622, 1623, 1624, 1625,
- 1626, 52, 1620, 1621, 1622, 1623, 1624, 1625,
- 1626, 1619, 16, 16, 1619, 1619, 1619, 1619,
- 1619, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 52, 1628, 16, 16, 1628,
- 1628, 1628, 1628, 47, 1631, 21, 1631, 51,
- 1618, 1630, 52, 16, 16, 47, 1630, 21,
- 1630, 1632, 238, 1632, 1632, 1633, 52, 1632,
- 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
- 1634, 38, 1634, 1632, 51, 1632, 1632, 1629,
- 52, 1632, 16, 16, 1632, 1632, 1632, 1632,
- 47, 21, 51, 1636, 52, 16, 16, 16,
- 1635, 1635, 1635, 47, 21, 51, 1638, 52,
- 1639, 16, 16, 16, 1637, 1637, 1637, 47,
- 21, 51, 1638, 52, 1639, 16, 16, 16,
- 1640, 1640, 1640, 47, 21, 51, 1638, 52,
- 1639, 16, 16, 16, 1641, 1641, 1641, 47,
- 21, 51, 1638, 52, 1639, 16, 16, 16,
- 47, 21, 51, 1643, 52, 16, 16, 16,
- 1642, 1635, 1635, 47, 21, 51, 1644, 1638,
- 52, 1639, 16, 16, 16, 1645, 1637, 1637,
- 47, 21, 51, 52, 16, 16, 16, 1646,
- 47, 21, 51, 1647, 52, 16, 16, 16,
- 1648, 47, 21, 51, 52, 16, 16, 16,
- 1649, 47, 21, 51, 1650, 52, 16, 16,
- 16, 1651, 47, 21, 51, 52, 16, 16,
- 16, 1652, 47, 21, 51, 52, 1639, 16,
- 16, 16, 1653, 47, 21, 51, 52, 1639,
- 16, 16, 16, 1654, 47, 21, 51, 52,
- 1639, 16, 16, 16, 47, 1634, 38, 1634,
- 51, 1629, 52, 16, 16, 47, 21, 51,
- 1650, 52, 16, 16, 16, 1655, 47, 21,
- 51, 1650, 52, 16, 16, 16, 47, 21,
- 51, 1647, 52, 16, 16, 16, 1656, 47,
- 21, 51, 1647, 52, 16, 16, 16, 47,
- 21, 51, 1644, 1638, 52, 1639, 16, 16,
- 16, 1657, 1640, 1640, 47, 21, 51, 1644,
- 1638, 52, 1639, 16, 16, 16, 1641, 1641,
- 1641, 47, 21, 51, 1659, 52, 1639, 16,
- 16, 16, 1658, 1658, 1658, 47, 21, 51,
- 1661, 52, 1639, 16, 16, 16, 1660, 1660,
- 1660, 47, 21, 51, 1661, 52, 1639, 16,
- 16, 16, 1662, 1662, 1662, 47, 21, 51,
- 1661, 52, 1639, 16, 16, 16, 1663, 1663,
- 1663, 47, 21, 51, 1661, 52, 1639, 16,
- 16, 16, 47, 21, 51, 52, 16, 16,
- 16, 1664, 1658, 1658, 47, 21, 51, 1644,
- 1661, 52, 1639, 16, 16, 16, 1665, 1660,
- 1660, 47, 21, 51, 1644, 1661, 52, 1639,
- 16, 16, 16, 1666, 1662, 1662, 47, 21,
- 51, 1644, 1661, 52, 1639, 16, 16, 16,
- 1663, 1663, 1663, 47, 21, 51, 52, 16,
- 16, 16, 1667, 47, 21, 51, 1644, 52,
- 16, 16, 16, 1668, 47, 21, 51, 1644,
- 52, 16, 16, 16, 1669, 47, 21, 51,
- 1644, 52, 16, 16, 16, 47, 21, 51,
- 1643, 52, 16, 16, 16, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1670,
- 52, 1670, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1671, 52, 1671, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1672,
- 52, 1672, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1673, 52, 1673, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1674,
- 52, 1674, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1675, 52, 1675, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1676,
- 52, 1676, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1677, 52, 1677, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1678, 38,
- 1678, 1628, 51, 1628, 1628, 1629, 1679, 52,
- 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
- 1680, 21, 1680, 51, 1618, 1679, 52, 16,
- 16, 47, 1679, 21, 1679, 1681, 238, 1681,
- 1681, 1633, 52, 1681, 16, 16, 1681, 1681,
- 1681, 1681, 1681, 47, 1682, 99, 1682, 1683,
- 51, 1683, 1683, 1684, 52, 1683, 16, 16,
- 1683, 1683, 1683, 1683, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1685, 52,
- 1685, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1686, 52, 1686, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1687, 52,
- 1687, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1688, 52, 1688, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1689, 52,
- 1689, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1690, 38, 1690, 1628, 51, 1628, 1628,
- 1629, 1691, 52, 1628, 16, 16, 1628, 1628,
- 1628, 1628, 47, 1692, 21, 1692, 51, 1618,
- 1691, 52, 16, 16, 47, 1693, 21, 1693,
- 1632, 299, 1632, 1632, 1633, 52, 1632, 16,
- 16, 1632, 1632, 1632, 1632, 1632, 47, 1627,
- 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
- 1694, 1695, 52, 1694, 1695, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1696, 38, 1696,
- 1628, 51, 1628, 1628, 1629, 1697, 52, 1628,
- 16, 16, 1628, 1628, 1628, 1628, 47, 1698,
- 21, 1698, 51, 1618, 1697, 52, 16, 16,
- 47, 1697, 21, 1697, 1632, 238, 1632, 1632,
- 1633, 52, 1632, 16, 16, 1632, 1632, 1699,
- 1632, 1632, 1699, 1632, 47, 1634, 38, 1634,
- 1632, 51, 1632, 1632, 1629, 52, 1632, 16,
- 16, 1632, 1700, 1632, 1632, 1700, 1632, 47,
- 1634, 38, 1634, 1632, 51, 1632, 1632, 1629,
- 52, 1632, 16, 16, 1632, 1701, 1632, 1632,
- 1701, 1632, 47, 1634, 38, 1634, 1632, 51,
- 1632, 1632, 1629, 52, 1632, 16, 16, 1632,
- 1702, 1632, 1632, 1702, 1632, 47, 1634, 38,
- 1634, 1632, 51, 1632, 1632, 1629, 52, 1632,
- 16, 16, 1632, 1703, 1632, 1632, 1703, 1632,
- 47, 1634, 38, 1634, 1632, 51, 1632, 1632,
- 1629, 52, 1632, 16, 16, 1632, 1704, 1632,
- 1632, 1704, 1632, 47, 1634, 38, 1634, 1632,
- 51, 1632, 1632, 1629, 52, 1632, 16, 16,
- 1632, 1705, 1632, 1632, 1705, 1632, 47, 1634,
- 38, 1634, 1632, 51, 1632, 1632, 1629, 52,
- 1632, 16, 16, 1632, 1706, 1632, 1632, 1706,
- 1632, 47, 1707, 132, 1707, 51, 1708, 52,
- 16, 16, 47, 1627, 38, 1627, 1628, 51,
- 1628, 1628, 1629, 1630, 1709, 52, 1709, 1628,
- 16, 16, 1628, 1628, 1628, 1628, 47, 1627,
- 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
- 1710, 52, 1710, 1628, 16, 16, 1628, 1628,
- 1628, 1628, 47, 1627, 38, 1627, 1628, 51,
- 1628, 1628, 1629, 1630, 1711, 52, 1711, 1628,
- 16, 16, 1628, 1628, 1628, 1628, 47, 1712,
- 38, 1712, 1628, 51, 1628, 1628, 1629, 1713,
- 52, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1714, 21, 1714, 51, 1618, 1713, 52,
- 16, 16, 47, 1715, 21, 1715, 1632, 1535,
- 1632, 1632, 1633, 52, 1632, 16, 16, 1632,
- 1632, 1632, 1632, 1632, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1716, 52,
- 1716, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1717, 52, 1717, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1718, 52,
- 1718, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1719, 52, 1719, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1720, 52,
- 1720, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1721, 38, 1721, 1628, 51, 1628, 1628,
- 1629, 1722, 52, 1628, 16, 16, 1628, 1628,
- 1628, 1628, 47, 1723, 21, 1723, 51, 1618,
- 1722, 52, 16, 16, 47, 1724, 21, 1724,
- 1632, 1545, 1632, 1632, 1633, 52, 1632, 16,
- 16, 1632, 1632, 1632, 1632, 1632, 47, 1627,
- 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
- 1725, 52, 1725, 1628, 16, 16, 1628, 1628,
- 1628, 1628, 47, 1627, 38, 1627, 1628, 51,
- 1628, 1628, 1629, 1630, 1726, 52, 1726, 1628,
- 16, 16, 1628, 1628, 1628, 1628, 47, 1727,
- 38, 1727, 1628, 51, 1628, 1628, 1629, 1728,
- 52, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1729, 21, 1729, 51, 1618, 1728, 52,
- 16, 16, 47, 1728, 21, 1728, 1730, 238,
- 1730, 1730, 1633, 52, 1730, 16, 16, 1730,
- 1730, 1730, 1730, 1730, 47, 1731, 171, 1731,
- 1732, 51, 1732, 1732, 1733, 52, 1732, 16,
- 16, 1732, 1732, 1732, 1732, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1734,
- 52, 1734, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1735, 1736, 52, 1735, 1736,
- 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
- 1627, 38, 1627, 1628, 51, 1628, 1628, 1629,
- 1630, 1737, 52, 1737, 1628, 16, 16, 1628,
- 1628, 1628, 1628, 47, 1627, 38, 1627, 1628,
- 51, 1628, 1628, 1629, 1630, 1738, 52, 1738,
- 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
- 1739, 38, 1739, 1628, 51, 1628, 1628, 1629,
- 1740, 52, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1741, 21, 1741, 51, 1618, 1740,
- 52, 16, 16, 47, 1742, 21, 1742, 1632,
- 1564, 1632, 1632, 1633, 52, 1632, 16, 16,
- 1632, 1632, 1632, 1632, 1632, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1743,
- 52, 1743, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1744, 52, 1744, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1745,
- 52, 1745, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
- 1628, 1629, 1630, 1746, 52, 1746, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1747,
- 52, 1747, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1748, 38, 1748, 1628, 51, 1628,
- 1628, 1629, 1749, 52, 1628, 16, 16, 1628,
- 1628, 1628, 1628, 47, 1750, 21, 1750, 51,
- 1618, 1749, 52, 16, 16, 47, 1751, 21,
- 1751, 1632, 1574, 1632, 1632, 1633, 52, 1632,
- 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
- 1627, 38, 1627, 1628, 51, 1628, 1628, 1629,
- 1630, 1752, 1753, 52, 1752, 1753, 1628, 16,
- 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
- 1627, 1628, 51, 1628, 1628, 1629, 1630, 1754,
- 52, 1754, 1628, 16, 16, 1628, 1628, 1628,
- 1628, 47, 1755, 38, 1755, 1628, 51, 1628,
- 1628, 1629, 1756, 52, 1628, 16, 16, 1628,
- 1628, 1628, 1628, 47, 1757, 21, 1757, 51,
- 1618, 1756, 52, 16, 16, 47, 1756, 21,
- 1756, 1632, 1758, 1632, 1632, 1633, 52, 1632,
- 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
- 1759, 38, 1759, 215, 1760, 216, 214, 214,
- 213, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1761, 52, 1761, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1762, 52,
- 1762, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1763, 52, 1763, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1764, 52,
- 1764, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
- 1629, 1630, 1765, 52, 1765, 1628, 16, 16,
- 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
- 1628, 51, 1628, 1628, 1629, 1630, 1766, 52,
- 1766, 1628, 16, 16, 1628, 1628, 1628, 1628,
- 47, 1767, 38, 1767, 1628, 51, 1628, 1628,
- 1629, 1768, 52, 1628, 16, 16, 1628, 1628,
- 1628, 1628, 47, 1769, 21, 1769, 51, 1618,
- 1768, 52, 16, 16, 47, 1770, 21, 1770,
- 1632, 1594, 1632, 1632, 1633, 52, 1632, 16,
- 16, 1632, 1632, 1632, 1632, 1632, 47, 21,
- 1771, 1771, 16, 21, 1772, 1772, 16, 21,
- 1773, 1773, 16, 21, 1774, 1774, 16, 21,
- 1775, 1775, 16, 1776, 21, 1776, 16, 1777,
- 21, 16, 17, 21, 17, 16, 1778, 1778,
- 1, 1779, 1779, 1, 1780, 1780, 1, 1781,
- 1781, 1, 1782, 1, 1783, 1783, 1, 1,
- 0
-};
+ static const char _thttp_machine_parser_header_Authorization_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 4, 0, 5, 4, 5, 4, 0,
+ 2, 0, 2, 3, 3, 3, 3, 0,
+ 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 0, 1, 0, 3, 3,
+ 3, 3, 3, 3, 0, 3, 3, 3,
+ 3, 1, 1, 1, 0, 0, 4, 4,
+ 4, 4, 4, 4, 4, 4, 0, 5,
+ 4, 4, 4, 4, 4, 4, 4, 0,
+ 5, 2, 0, 2, 4, 4, 0, 7,
+ 6, 6, 6, 6, 6, 6, 6, 0,
+ 4, 4, 4, 4, 0, 5, 2, 0,
+ 2, 4, 4, 4, 4, 4, 4, 0,
+ 5, 2, 0, 2, 4, 4, 4, 0,
+ 5, 4, 4, 4, 4, 4, 4, 0,
+ 5, 2, 0, 2, 4, 4, 4, 4,
+ 4, 4, 0, 5, 2, 0, 2, 4,
+ 4, 4, 0, 5, 2, 2, 0, 2,
+ 1, 6, 5, 1, 6, 5, 1, 5,
+ 5, 5, 5, 2, 5, 5, 3, 3,
+ 3, 3, 3, 3, 3, 2, 3, 2,
+ 3, 2, 5, 5, 5, 5, 5, 5,
+ 2, 5, 5, 5, 5, 3, 3, 3,
+ 2, 2, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 1,
+ 6, 5, 1, 6, 5, 1, 5, 5,
+ 5, 5, 2, 5, 5, 3, 3, 3,
+ 3, 3, 3, 3, 2, 3, 2, 3,
+ 2, 5, 5, 5, 5, 5, 5, 2,
+ 5, 5, 5, 5, 3, 3, 3, 2,
+ 2, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 1, 6, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 1, 8, 7, 7, 7, 7, 7, 7,
+ 7, 1, 5, 5, 5, 5, 1, 6,
+ 1, 1, 6, 5, 1, 6, 5, 1,
+ 5, 5, 5, 5, 2, 5, 5, 3,
+ 3, 3, 3, 3, 3, 3, 2, 1,
+ 3, 2, 3, 2, 5, 5, 5, 5,
+ 5, 5, 2, 5, 5, 5, 5, 3,
+ 3, 3, 2, 2, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 6, 5,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 1, 5, 5, 1, 8, 7, 7, 7,
+ 7, 7, 7, 7, 1, 5, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 1, 6, 5,
+ 1, 6, 5, 1, 5, 5, 5, 5,
+ 2, 5, 5, 3, 3, 3, 3, 3,
+ 3, 3, 2, 1, 3, 2, 3, 2,
+ 5, 5, 5, 5, 5, 5, 2, 5,
+ 5, 5, 5, 3, 3, 3, 2, 2,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 1, 6, 5, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 1,
+ 8, 7, 7, 7, 7, 7, 7, 7,
+ 1, 5, 5, 5, 5, 1, 6, 1,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 1, 5, 5, 5, 1, 6, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 1,
+ 6, 5, 1, 6, 5, 1, 5, 5,
+ 5, 5, 2, 5, 5, 3, 3, 3,
+ 3, 3, 3, 3, 2, 1, 3, 2,
+ 3, 2, 5, 5, 5, 5, 5, 5,
+ 2, 5, 5, 5, 5, 3, 3, 3,
+ 2, 2, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 5,
+ 5, 1, 8, 7, 7, 7, 7, 7,
+ 7, 7, 1, 5, 5, 5, 5, 1,
+ 6, 1, 5, 5, 5, 5, 5, 5,
+ 1, 6, 1, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 1, 5, 5, 5, 5, 5, 5, 1,
+ 6, 1, 1, 6, 5, 1, 6, 5,
+ 1, 5, 5, 5, 5, 2, 5, 5,
+ 3, 3, 3, 3, 3, 3, 3, 2,
+ 1, 3, 2, 3, 2, 5, 5, 5,
+ 5, 5, 5, 2, 5, 5, 5, 5,
+ 3, 3, 3, 2, 2, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 5, 1,
+ 6, 1, 5, 5, 1, 8, 7, 7,
+ 7, 7, 7, 7, 7, 1, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 1, 6, 5, 5, 5, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 1, 6, 1, 1, 6, 5, 1, 6,
+ 5, 5, 5, 5, 5, 2, 5, 5,
+ 3, 3, 3, 3, 3, 3, 3, 2,
+ 1, 3, 2, 3, 2, 5, 5, 5,
+ 5, 5, 5, 2, 5, 5, 5, 5,
+ 3, 3, 3, 2, 2, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 5, 1,
+ 6, 5, 5, 1, 8, 7, 7, 7,
+ 7, 7, 7, 7, 1, 5, 5, 5,
+ 5, 1, 6, 5, 5, 5, 5, 5,
+ 5, 1, 6, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 2,
+ 0, 2, 6, 5, 1, 6, 5, 1,
+ 5, 5, 5, 5, 2, 5, 5, 3,
+ 3, 3, 3, 3, 3, 3, 2, 1,
+ 3, 2, 3, 2, 5, 5, 5, 5,
+ 5, 5, 2, 5, 5, 5, 5, 3,
+ 3, 3, 2, 2, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 6, 5,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 1, 5, 5, 1, 8, 7, 7, 7,
+ 7, 7, 7, 7, 1, 5, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 1, 6, 5, 5, 5, 5, 5, 5,
+ 1, 6, 1, 5, 5, 5, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 1,
+ 6, 1, 5, 5, 5, 5, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 5,
+ 5, 5, 1, 6, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 5, 5, 5, 1, 6, 1, 5,
+ 5, 5, 1, 6, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 5, 1, 6, 1, 5, 5, 5, 5,
+ 5, 5, 5, 1, 6, 1, 5, 5,
+ 1, 8, 7, 7, 7, 7, 7, 7,
+ 7, 1, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 5, 5, 5, 1, 6,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 1, 6, 1, 5, 5, 5, 5, 5,
+ 5, 5, 1, 6, 4, 4, 4, 4,
+ 4, 4, 4, 0, 5, 4, 4, 4,
+ 0, 5, 2, 2, 2, 1, 6, 5,
+ 1, 6, 5, 5, 5, 5, 5, 2,
+ 5, 5, 3, 3, 3, 3, 3, 3,
+ 3, 2, 1, 3, 2, 3, 2, 5,
+ 5, 5, 5, 5, 5, 2, 5, 5,
+ 5, 5, 3, 3, 3, 2, 2, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 1, 6, 5, 5, 5, 5, 5, 5,
+ 5, 1, 6, 5, 5, 1, 8, 7,
+ 7, 7, 7, 7, 7, 7, 1, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 5, 5, 5, 1, 6, 5, 5, 5,
+ 1, 6, 5, 5, 5, 5, 5, 5,
+ 1, 6, 5, 5, 5, 5, 5, 5,
+ 1, 6, 5, 5, 5, 1, 6, 1,
+ 5, 5, 5, 5, 5, 5, 5, 1,
+ 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
-static const short _thttp_machine_parser_header_Authorization_trans_targs[] = {
- 2, 0, 1345, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 18, 1343, 19, 1337, 17, 1351, 20,
- 21, 22, 23, 24, 24, 25, 28, 81,
- 92, 113, 124, 130, 1205, 26, 17, 25,
- 27, 29, 26, 27, 151, 70, 30, 32,
- 35, 31, 31, 33, 34, 36, 69, 37,
- 40, 38, 39, 41, 56, 42, 54, 43,
- 44, 52, 45, 46, 50, 47, 48, 49,
- 51, 53, 55, 57, 65, 58, 61, 59,
- 60, 62, 63, 64, 66, 67, 68, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 78, 80, 31, 17, 80, 27, 82, 83,
- 84, 85, 86, 87, 88, 87, 88, 89,
- 89, 90, 91, 31, 17, 27, 93, 104,
- 94, 95, 94, 96, 97, 98, 99, 100,
- 101, 102, 103, 31, 17, 27, 105, 106,
- 107, 108, 109, 108, 109, 110, 110, 111,
- 112, 31, 17, 27, 114, 115, 116, 117,
- 118, 119, 120, 119, 120, 121, 121, 122,
- 123, 31, 17, 27, 125, 126, 127, 128,
- 127, 129, 31, 17, 129, 27, 131, 132,
- 140, 133, 134, 135, 136, 135, 136, 137,
- 137, 138, 139, 31, 17, 27, 141, 142,
- 143, 144, 145, 146, 147, 146, 147, 148,
- 148, 149, 150, 31, 17, 27, 152, 1196,
- 153, 154, 155, 154, 156, 157, 158, 31,
- 159, 157, 158, 31, 159, 160, 160, 161,
- 162, 202, 214, 1134, 1152, 1160, 1166, 1181,
- 163, 162, 161, 164, 163, 165, 166, 167,
- 160, 168, 201, 169, 172, 170, 171, 173,
- 188, 174, 186, 175, 176, 184, 177, 178,
- 182, 179, 180, 181, 183, 185, 187, 189,
- 197, 190, 193, 191, 192, 194, 195, 196,
- 198, 199, 200, 203, 204, 205, 206, 207,
- 208, 209, 210, 211, 212, 211, 213, 160,
- 213, 161, 215, 216, 217, 218, 219, 220,
- 221, 220, 221, 222, 223, 224, 223, 224,
- 225, 265, 277, 286, 1086, 1095, 1101, 1118,
- 226, 225, 227, 226, 228, 229, 230, 160,
- 161, 231, 264, 232, 235, 222, 233, 234,
- 236, 251, 237, 249, 238, 239, 247, 240,
- 241, 245, 242, 243, 244, 246, 248, 250,
- 252, 260, 253, 256, 254, 255, 257, 258,
- 259, 261, 262, 263, 266, 267, 268, 269,
- 270, 271, 272, 273, 274, 275, 274, 276,
- 223, 276, 224, 278, 279, 280, 281, 282,
- 283, 284, 283, 284, 285, 223, 224, 287,
- 298, 288, 289, 288, 290, 291, 292, 293,
- 294, 295, 296, 297, 223, 224, 299, 300,
- 301, 302, 303, 302, 303, 304, 305, 306,
- 305, 306, 307, 348, 360, 369, 388, 1047,
- 1053, 1070, 308, 307, 306, 309, 308, 310,
- 311, 312, 305, 160, 161, 313, 347, 314,
- 317, 327, 315, 316, 318, 334, 319, 332,
- 320, 321, 330, 322, 323, 328, 324, 325,
- 326, 329, 331, 333, 335, 343, 336, 339,
- 337, 338, 340, 341, 342, 344, 345, 346,
- 349, 350, 351, 352, 353, 354, 355, 356,
- 357, 358, 357, 359, 305, 359, 306, 361,
- 362, 363, 364, 365, 366, 367, 366, 367,
- 368, 223, 224, 370, 381, 371, 372, 371,
- 373, 374, 375, 376, 377, 378, 379, 380,
- 305, 306, 382, 383, 384, 385, 386, 385,
- 386, 387, 305, 306, 389, 390, 391, 392,
- 393, 394, 395, 394, 395, 396, 397, 398,
- 397, 398, 399, 440, 452, 461, 480, 489,
- 495, 1031, 400, 399, 398, 401, 400, 402,
- 403, 404, 397, 160, 161, 405, 439, 406,
- 409, 419, 407, 408, 410, 426, 411, 424,
- 412, 413, 422, 414, 415, 420, 416, 417,
- 418, 421, 423, 425, 427, 435, 428, 431,
- 429, 430, 432, 433, 434, 436, 437, 438,
- 441, 442, 443, 444, 445, 446, 447, 448,
- 449, 450, 449, 451, 397, 451, 398, 453,
- 454, 455, 456, 457, 458, 459, 458, 459,
- 460, 223, 224, 462, 473, 463, 464, 463,
- 465, 466, 467, 468, 469, 470, 471, 472,
- 397, 398, 474, 475, 476, 477, 478, 477,
- 478, 479, 305, 306, 481, 482, 483, 484,
- 485, 486, 487, 486, 487, 488, 397, 398,
- 490, 491, 492, 493, 492, 494, 397, 494,
- 398, 496, 497, 1022, 498, 499, 500, 501,
- 500, 501, 502, 503, 504, 503, 504, 505,
- 546, 558, 567, 586, 595, 601, 1006, 506,
- 505, 504, 507, 506, 508, 509, 510, 503,
- 160, 161, 511, 545, 512, 515, 525, 513,
- 514, 516, 532, 517, 530, 518, 519, 528,
- 520, 521, 526, 522, 523, 524, 527, 529,
- 531, 533, 541, 534, 537, 535, 536, 538,
- 539, 540, 542, 543, 544, 547, 548, 549,
- 550, 551, 552, 553, 554, 555, 556, 555,
- 557, 503, 557, 504, 559, 560, 561, 562,
- 563, 564, 565, 564, 565, 566, 223, 224,
- 568, 579, 569, 570, 569, 571, 572, 573,
- 574, 575, 576, 577, 578, 503, 504, 580,
- 581, 582, 583, 584, 583, 584, 585, 305,
- 306, 587, 588, 589, 590, 591, 592, 593,
- 592, 593, 594, 397, 398, 596, 597, 598,
- 599, 598, 600, 503, 600, 504, 602, 603,
- 609, 604, 605, 606, 607, 606, 607, 608,
- 503, 504, 610, 611, 612, 613, 614, 615,
- 616, 615, 616, 617, 618, 619, 618, 619,
- 620, 661, 673, 682, 701, 710, 716, 733,
- 621, 620, 619, 622, 621, 623, 624, 625,
- 618, 160, 161, 626, 660, 627, 630, 640,
- 628, 629, 631, 647, 632, 645, 633, 634,
- 643, 635, 636, 641, 637, 638, 639, 642,
- 644, 646, 648, 656, 649, 652, 650, 651,
- 653, 654, 655, 657, 658, 659, 662, 663,
- 664, 665, 666, 667, 668, 669, 670, 671,
- 670, 672, 618, 672, 619, 674, 675, 676,
- 677, 678, 679, 680, 679, 680, 681, 223,
- 224, 683, 694, 684, 685, 684, 686, 687,
- 688, 689, 690, 691, 692, 693, 618, 619,
- 695, 696, 697, 698, 699, 698, 699, 700,
- 305, 306, 702, 703, 704, 705, 706, 707,
- 708, 707, 708, 709, 397, 398, 711, 712,
- 713, 714, 713, 715, 618, 715, 619, 717,
- 718, 724, 719, 720, 721, 722, 721, 722,
- 723, 503, 504, 725, 726, 727, 728, 729,
- 730, 731, 730, 731, 732, 618, 619, 734,
- 996, 735, 736, 737, 736, 738, 739, 740,
- 739, 740, 741, 781, 793, 801, 819, 827,
- 833, 848, 742, 741, 740, 743, 742, 744,
- 745, 739, 746, 780, 747, 750, 760, 748,
- 749, 751, 767, 752, 765, 753, 754, 763,
- 755, 756, 761, 757, 758, 759, 762, 764,
- 766, 768, 776, 769, 772, 770, 771, 773,
- 774, 775, 777, 778, 779, 782, 783, 784,
- 785, 786, 787, 788, 789, 790, 791, 790,
- 792, 739, 792, 740, 794, 795, 796, 797,
- 798, 799, 800, 799, 800, 223, 802, 813,
- 803, 804, 803, 805, 806, 807, 808, 809,
- 810, 811, 812, 739, 740, 814, 815, 816,
- 817, 818, 817, 818, 305, 820, 821, 822,
- 823, 824, 825, 826, 825, 826, 397, 828,
- 829, 830, 831, 830, 832, 739, 832, 740,
- 834, 835, 840, 836, 837, 838, 839, 838,
- 839, 503, 841, 842, 843, 844, 845, 846,
- 847, 846, 847, 618, 849, 853, 850, 851,
- 852, 851, 854, 855, 856, 857, 858, 859,
- 860, 861, 860, 861, 862, 863, 862, 864,
- 866, 865, 31, 17, 27, 867, 908, 920,
- 929, 948, 957, 963, 980, 868, 867, 866,
- 869, 868, 870, 871, 872, 862, 160, 161,
- 873, 907, 874, 877, 887, 875, 876, 878,
- 894, 879, 892, 880, 881, 890, 882, 883,
- 888, 884, 885, 886, 889, 891, 893, 895,
- 903, 896, 899, 897, 898, 900, 901, 902,
- 904, 905, 906, 909, 910, 911, 912, 913,
- 914, 915, 916, 917, 918, 917, 919, 862,
- 919, 866, 921, 922, 923, 924, 925, 926,
- 927, 926, 927, 928, 223, 224, 930, 941,
- 931, 932, 931, 933, 934, 935, 936, 937,
- 938, 939, 940, 862, 866, 942, 943, 944,
- 945, 946, 945, 946, 947, 305, 306, 949,
- 950, 951, 952, 953, 954, 955, 954, 955,
- 956, 397, 398, 958, 959, 960, 961, 960,
- 962, 862, 962, 866, 964, 965, 971, 966,
- 967, 968, 969, 968, 969, 970, 503, 504,
- 972, 973, 974, 975, 976, 977, 978, 977,
- 978, 979, 618, 619, 981, 986, 982, 983,
- 984, 983, 985, 739, 740, 987, 988, 989,
- 990, 991, 992, 993, 994, 993, 994, 995,
- 862, 866, 997, 998, 999, 1000, 1001, 1002,
- 1003, 1004, 1003, 1004, 1005, 862, 866, 1007,
- 1012, 1008, 1009, 1010, 1009, 1011, 739, 740,
- 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020,
- 1019, 1020, 1021, 862, 866, 1023, 1024, 1025,
- 1026, 1027, 1028, 1029, 1028, 1029, 1030, 618,
- 619, 1032, 1037, 1033, 1034, 1035, 1034, 1036,
- 739, 740, 1038, 1039, 1040, 1041, 1042, 1043,
- 1044, 1045, 1044, 1045, 1046, 862, 866, 1048,
- 1049, 1050, 1051, 1050, 1052, 305, 1052, 306,
- 1054, 1055, 1061, 1056, 1057, 1058, 1059, 1058,
- 1059, 1060, 503, 504, 1062, 1063, 1064, 1065,
- 1066, 1067, 1068, 1067, 1068, 1069, 618, 619,
- 1071, 1076, 1072, 1073, 1074, 1073, 1075, 739,
- 740, 1077, 1078, 1079, 1080, 1081, 1082, 1083,
- 1084, 1083, 1084, 1085, 862, 866, 1087, 1088,
- 1089, 1090, 1091, 1092, 1093, 1092, 1093, 1094,
- 397, 398, 1096, 1097, 1098, 1099, 1098, 1100,
- 223, 1100, 224, 1102, 1103, 1109, 1104, 1105,
- 1106, 1107, 1106, 1107, 1108, 503, 504, 1110,
- 1111, 1112, 1113, 1114, 1115, 1116, 1115, 1116,
- 1117, 618, 619, 1119, 1124, 1120, 1121, 1122,
- 1121, 1123, 739, 740, 1125, 1126, 1127, 1128,
- 1129, 1130, 1131, 1132, 1131, 1132, 1133, 862,
- 866, 1135, 1146, 1136, 1137, 1136, 1138, 1139,
- 1140, 1141, 1142, 1143, 1144, 1145, 160, 161,
- 1147, 1148, 1149, 1150, 1151, 1150, 1151, 327,
- 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1158,
- 1159, 419, 1161, 1162, 1163, 1164, 1163, 1165,
- 160, 1165, 161, 1167, 1168, 1173, 1169, 1170,
- 1171, 1172, 1171, 1172, 525, 1174, 1175, 1176,
- 1177, 1178, 1179, 1180, 1179, 1180, 640, 1182,
- 1187, 1183, 1184, 1185, 1184, 1186, 739, 740,
- 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195,
- 1194, 1195, 887, 1197, 1198, 1199, 1200, 1201,
- 1202, 1203, 1204, 1203, 1204, 863, 1206, 1207,
- 1208, 1209, 1208, 1210, 1211, 1212, 1211, 1212,
- 1213, 1213, 1214, 1215, 1255, 1267, 1275, 1293,
- 1301, 1307, 1322, 1216, 1215, 1214, 1217, 1216,
- 1218, 1219, 1213, 1220, 1254, 1221, 1224, 1234,
- 1222, 1223, 1225, 1241, 1226, 1239, 1227, 1228,
- 1237, 1229, 1230, 1235, 1231, 1232, 1233, 1236,
- 1238, 1240, 1242, 1250, 1243, 1246, 1244, 1245,
- 1247, 1248, 1249, 1251, 1252, 1253, 1256, 1257,
- 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265,
- 1264, 1266, 1213, 1266, 1214, 1268, 1269, 1270,
- 1271, 1272, 1273, 1274, 1273, 1274, 1276, 1287,
- 1277, 1278, 1277, 1279, 1280, 1281, 1282, 1283,
- 1284, 1285, 1286, 1213, 1214, 1288, 1289, 1290,
- 1291, 1292, 1291, 1292, 1294, 1295, 1296, 1297,
- 1298, 1299, 1300, 1299, 1300, 1302, 1303, 1304,
- 1305, 1304, 1306, 1213, 1306, 1214, 1308, 1309,
- 1314, 1310, 1311, 1312, 1313, 1312, 1313, 1315,
- 1316, 1317, 1318, 1319, 1320, 1321, 1320, 1321,
- 1323, 1328, 1324, 1325, 1326, 1325, 1327, 739,
- 740, 1329, 1330, 1331, 1332, 1333, 1334, 1335,
- 1336, 1335, 1336, 1338, 1339, 1340, 1341, 1342,
- 24, 1344, 1346, 1347, 1348, 1349, 1350, 2
-};
+ static const short _thttp_machine_parser_header_Authorization_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 20,
+ 23, 26, 29, 32, 35, 38, 41, 45,
+ 53, 55, 57, 65, 69, 73, 77, 81,
+ 85, 112, 126, 132, 159, 175, 190, 203,
+ 208, 215, 220, 224, 230, 237, 244, 251,
+ 255, 261, 269, 272, 276, 279, 283, 286,
+ 290, 294, 297, 301, 304, 308, 311, 319,
+ 327, 334, 341, 348, 355, 359, 364, 372,
+ 380, 388, 391, 395, 399, 402, 405, 421,
+ 437, 453, 469, 485, 501, 517, 531, 537,
+ 552, 565, 581, 597, 613, 629, 645, 659,
+ 665, 680, 687, 692, 696, 714, 728, 734,
+ 751, 766, 781, 796, 811, 826, 841, 856,
+ 861, 877, 893, 909, 923, 929, 944, 951,
+ 956, 960, 976, 992, 1008, 1024, 1040, 1054,
+ 1060, 1075, 1082, 1087, 1091, 1107, 1123, 1137,
+ 1143, 1158, 1171, 1187, 1205, 1221, 1237, 1251,
+ 1257, 1272, 1279, 1284, 1288, 1304, 1320, 1336,
+ 1352, 1368, 1382, 1388, 1403, 1410, 1415, 1419,
+ 1437, 1453, 1467, 1473, 1488, 1495, 1502, 1505,
+ 1510, 1519, 1550, 1568, 1578, 1596, 1613, 1622,
+ 1633, 1645, 1657, 1669, 1678, 1689, 1702, 1710,
+ 1719, 1727, 1736, 1744, 1753, 1762, 1770, 1779,
+ 1787, 1796, 1804, 1817, 1830, 1842, 1854, 1866,
+ 1878, 1887, 1897, 1910, 1923, 1936, 1944, 1953,
+ 1962, 1970, 1978, 1998, 2018, 2038, 2058, 2078,
+ 2098, 2118, 2138, 2156, 2166, 2184, 2201, 2221,
+ 2241, 2261, 2281, 2301, 2319, 2329, 2347, 2356,
+ 2365, 2396, 2414, 2424, 2442, 2459, 2468, 2479,
+ 2491, 2503, 2515, 2524, 2535, 2548, 2556, 2565,
+ 2573, 2582, 2590, 2599, 2608, 2616, 2625, 2633,
+ 2642, 2650, 2663, 2676, 2688, 2700, 2712, 2724,
+ 2733, 2743, 2756, 2769, 2782, 2790, 2799, 2808,
+ 2816, 2824, 2844, 2864, 2884, 2904, 2924, 2944,
+ 2964, 2984, 3002, 3012, 3030, 3047, 3067, 3087,
+ 3107, 3127, 3147, 3165, 3175, 3193, 3202, 3224,
+ 3242, 3252, 3272, 3291, 3310, 3329, 3348, 3367,
+ 3386, 3405, 3414, 3434, 3454, 3474, 3492, 3502,
+ 3520, 3529, 3538, 3569, 3587, 3597, 3615, 3632,
+ 3641, 3652, 3664, 3676, 3688, 3697, 3708, 3721,
+ 3729, 3738, 3746, 3755, 3763, 3772, 3781, 3789,
+ 3798, 3807, 3815, 3824, 3832, 3845, 3858, 3870,
+ 3882, 3894, 3906, 3915, 3925, 3938, 3951, 3964,
+ 3972, 3981, 3990, 3998, 4006, 4026, 4046, 4066,
+ 4086, 4106, 4126, 4146, 4166, 4184, 4194, 4212,
+ 4229, 4249, 4269, 4289, 4309, 4329, 4347, 4357,
+ 4375, 4384, 4406, 4424, 4434, 4454, 4473, 4492,
+ 4511, 4530, 4549, 4568, 4587, 4596, 4616, 4636,
+ 4656, 4674, 4684, 4702, 4711, 4731, 4751, 4771,
+ 4791, 4811, 4829, 4839, 4857, 4866, 4875, 4906,
+ 4924, 4934, 4952, 4969, 4978, 4989, 5001, 5013,
+ 5025, 5034, 5045, 5058, 5066, 5075, 5083, 5092,
+ 5100, 5109, 5118, 5126, 5135, 5144, 5152, 5161,
+ 5169, 5182, 5195, 5207, 5219, 5231, 5243, 5252,
+ 5262, 5275, 5288, 5301, 5309, 5318, 5327, 5335,
+ 5343, 5363, 5383, 5403, 5423, 5443, 5463, 5483,
+ 5503, 5521, 5531, 5549, 5566, 5586, 5606, 5626,
+ 5646, 5666, 5684, 5694, 5712, 5721, 5743, 5761,
+ 5771, 5791, 5810, 5829, 5848, 5867, 5886, 5905,
+ 5924, 5933, 5953, 5973, 5993, 6011, 6021, 6039,
+ 6048, 6068, 6088, 6108, 6128, 6148, 6166, 6176,
+ 6194, 6203, 6223, 6243, 6261, 6271, 6289, 6306,
+ 6326, 6348, 6368, 6388, 6406, 6416, 6434, 6443,
+ 6452, 6483, 6501, 6511, 6529, 6546, 6555, 6566,
+ 6578, 6590, 6602, 6611, 6622, 6635, 6643, 6652,
+ 6660, 6669, 6677, 6686, 6695, 6703, 6712, 6721,
+ 6729, 6738, 6746, 6759, 6772, 6784, 6796, 6808,
+ 6820, 6829, 6839, 6852, 6865, 6878, 6886, 6895,
+ 6904, 6912, 6920, 6940, 6960, 6980, 7000, 7020,
+ 7040, 7060, 7080, 7098, 7108, 7126, 7143, 7163,
+ 7183, 7203, 7223, 7243, 7261, 7271, 7289, 7298,
+ 7320, 7338, 7348, 7368, 7387, 7406, 7425, 7444,
+ 7463, 7482, 7501, 7510, 7530, 7550, 7570, 7588,
+ 7598, 7616, 7625, 7645, 7665, 7685, 7705, 7725,
+ 7743, 7753, 7771, 7780, 7800, 7820, 7838, 7848,
+ 7866, 7883, 7903, 7925, 7945, 7965, 7983, 7993,
+ 8011, 8020, 8040, 8060, 8080, 8100, 8120, 8138,
+ 8148, 8166, 8175, 8184, 8215, 8233, 8243, 8261,
+ 8278, 8287, 8298, 8310, 8322, 8334, 8343, 8354,
+ 8367, 8375, 8384, 8392, 8401, 8409, 8418, 8427,
+ 8435, 8444, 8453, 8461, 8470, 8478, 8491, 8504,
+ 8516, 8528, 8540, 8552, 8561, 8571, 8584, 8597,
+ 8610, 8618, 8627, 8636, 8644, 8652, 8672, 8692,
+ 8712, 8732, 8752, 8772, 8792, 8812, 8830, 8840,
+ 8858, 8875, 8895, 8915, 8935, 8955, 8975, 8993,
+ 9003, 9021, 9030, 9052, 9070, 9080, 9100, 9119,
+ 9138, 9157, 9176, 9195, 9214, 9233, 9242, 9262,
+ 9282, 9302, 9320, 9330, 9348, 9357, 9377, 9397,
+ 9417, 9437, 9457, 9475, 9485, 9503, 9512, 9532,
+ 9552, 9570, 9580, 9598, 9615, 9635, 9657, 9677,
+ 9697, 9715, 9725, 9743, 9752, 9772, 9792, 9812,
+ 9832, 9852, 9870, 9880, 9898, 9907, 9929, 9949,
+ 9967, 9977, 9995, 10004, 10013, 10044, 10062, 10072,
+ 10090, 10107, 10118, 10130, 10142, 10154, 10163, 10174,
+ 10187, 10195, 10204, 10212, 10221, 10229, 10238, 10247,
+ 10255, 10264, 10273, 10281, 10290, 10298, 10311, 10324,
+ 10336, 10348, 10360, 10372, 10381, 10391, 10404, 10417,
+ 10430, 10438, 10447, 10456, 10464, 10472, 10492, 10512,
+ 10532, 10552, 10572, 10592, 10612, 10632, 10650, 10660,
+ 10678, 10695, 10715, 10735, 10755, 10775, 10795, 10813,
+ 10823, 10841, 10863, 10881, 10891, 10911, 10930, 10949,
+ 10968, 10987, 11006, 11025, 11044, 11053, 11073, 11093,
+ 11113, 11131, 11141, 11159, 11179, 11199, 11219, 11239,
+ 11259, 11277, 11287, 11305, 11325, 11345, 11363, 11373,
+ 11391, 11408, 11428, 11450, 11470, 11490, 11508, 11518,
+ 11536, 11556, 11576, 11596, 11616, 11636, 11654, 11664,
+ 11682, 11704, 11724, 11742, 11752, 11770, 11790, 11810,
+ 11830, 11850, 11870, 11890, 11908, 11918, 11936, 11945,
+ 11952, 11957, 11961, 11992, 12010, 12020, 12038, 12055,
+ 12064, 12075, 12087, 12099, 12111, 12120, 12131, 12144,
+ 12152, 12161, 12169, 12178, 12186, 12195, 12204, 12212,
+ 12221, 12230, 12238, 12247, 12255, 12268, 12281, 12293,
+ 12305, 12317, 12329, 12338, 12348, 12361, 12374, 12387,
+ 12395, 12404, 12413, 12421, 12429, 12449, 12469, 12489,
+ 12509, 12529, 12549, 12569, 12589, 12607, 12617, 12635,
+ 12652, 12672, 12692, 12712, 12732, 12752, 12770, 12780,
+ 12798, 12807, 12829, 12847, 12857, 12877, 12896, 12915,
+ 12934, 12953, 12972, 12991, 13010, 13019, 13039, 13059,
+ 13079, 13097, 13107, 13125, 13134, 13154, 13174, 13194,
+ 13214, 13234, 13252, 13262, 13280, 13289, 13309, 13329,
+ 13347, 13357, 13375, 13392, 13412, 13434, 13454, 13474,
+ 13492, 13502, 13520, 13529, 13549, 13569, 13589, 13609,
+ 13629, 13647, 13657, 13675, 13684, 13706, 13726, 13744,
+ 13754, 13772, 13781, 13801, 13821, 13841, 13861, 13881,
+ 13901, 13919, 13929, 13947, 13956, 13976, 13996, 14016,
+ 14036, 14056, 14076, 14094, 14104, 14122, 14131, 14153,
+ 14173, 14191, 14201, 14219, 14228, 14248, 14268, 14288,
+ 14308, 14328, 14348, 14366, 14376, 14394, 14403, 14423,
+ 14443, 14463, 14483, 14503, 14521, 14531, 14549, 14558,
+ 14580, 14600, 14618, 14628, 14646, 14655, 14675, 14695,
+ 14715, 14735, 14755, 14775, 14793, 14803, 14821, 14830,
+ 14850, 14870, 14888, 14898, 14916, 14933, 14953, 14975,
+ 14995, 15015, 15033, 15043, 15061, 15070, 15090, 15110,
+ 15130, 15150, 15170, 15188, 15198, 15216, 15225, 15247,
+ 15267, 15285, 15295, 15313, 15322, 15342, 15362, 15382,
+ 15402, 15422, 15442, 15460, 15470, 15488, 15497, 15517,
+ 15537, 15557, 15577, 15597, 15615, 15625, 15643, 15652,
+ 15672, 15692, 15710, 15720, 15738, 15755, 15775, 15797,
+ 15817, 15837, 15855, 15865, 15883, 15892, 15912, 15932,
+ 15952, 15972, 15992, 16010, 16020, 16038, 16047, 16069,
+ 16089, 16107, 16117, 16135, 16144, 16164, 16184, 16204,
+ 16224, 16244, 16264, 16282, 16292, 16310, 16319, 16341,
+ 16359, 16369, 16389, 16408, 16427, 16446, 16465, 16484,
+ 16503, 16522, 16531, 16551, 16571, 16591, 16609, 16619,
+ 16637, 16657, 16677, 16697, 16717, 16737, 16755, 16765,
+ 16783, 16803, 16823, 16841, 16851, 16869, 16886, 16906,
+ 16928, 16948, 16968, 16986, 16996, 17014, 17034, 17054,
+ 17074, 17094, 17114, 17132, 17142, 17160, 17182, 17202,
+ 17220, 17230, 17248, 17257, 17277, 17297, 17317, 17337,
+ 17357, 17377, 17395, 17405, 17423, 17439, 17455, 17471,
+ 17487, 17503, 17519, 17533, 17539, 17554, 17572, 17588,
+ 17602, 17608, 17623, 17630, 17637, 17642, 17651, 17682,
+ 17700, 17710, 17728, 17745, 17756, 17768, 17780, 17792,
+ 17801, 17812, 17825, 17833, 17842, 17850, 17859, 17867,
+ 17876, 17885, 17893, 17902, 17911, 17919, 17928, 17936,
+ 17949, 17962, 17974, 17986, 17998, 18010, 18019, 18029,
+ 18042, 18055, 18068, 18076, 18085, 18094, 18102, 18110,
+ 18130, 18150, 18170, 18190, 18210, 18230, 18250, 18270,
+ 18288, 18298, 18316, 18333, 18353, 18373, 18393, 18413,
+ 18433, 18451, 18461, 18479, 18501, 18519, 18529, 18549,
+ 18568, 18587, 18606, 18625, 18644, 18663, 18682, 18691,
+ 18711, 18731, 18751, 18769, 18779, 18797, 18817, 18837,
+ 18857, 18877, 18897, 18915, 18925, 18943, 18963, 18983,
+ 19001, 19011, 19029, 19046, 19066, 19088, 19108, 19128,
+ 19146, 19156, 19174, 19194, 19214, 19234, 19254, 19274,
+ 19292, 19302, 19320, 19342, 19362, 19380, 19390, 19408,
+ 19417, 19437, 19457, 19477, 19497, 19517, 19537, 19555,
+ 19565, 19583, 19587, 19591, 19595, 19599, 19603, 19607,
+ 19610, 19614, 19617, 19620, 19623, 19626, 19628, 19631
+ };
-static const char _thttp_machine_parser_header_Authorization_trans_actions[] = {
- 7, 0, 9, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 5, 0, 1, 1, 1,
- 1, 1, 1, 1, 1, 31, 31, 0,
- 31, 0, 0, 0, 1, 0, 0, 0,
- 0, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 21, 21, 0, 21, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 0, 0, 0, 23, 23, 23, 0, 0,
- 31, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 29, 29, 29, 0, 0,
- 0, 31, 0, 0, 1, 1, 0, 0,
- 0, 15, 15, 15, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 0, 0,
- 0, 25, 25, 25, 0, 0, 31, 0,
- 0, 1, 27, 27, 0, 27, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 0, 0, 0, 13, 13, 13, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 0, 0, 0, 19, 19, 19, 0, 0,
- 0, 31, 0, 0, 0, 1, 1, 35,
- 1, 0, 0, 17, 0, 17, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 31, 0, 31, 0, 0, 0, 0, 0,
- 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 21,
- 0, 21, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 1, 31, 31, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 31, 0, 0, 0, 0, 0, 0, 23,
- 23, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 21, 0, 21, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 23, 23, 0,
- 0, 31, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 29, 29, 0, 0,
- 0, 31, 0, 0, 1, 1, 23, 23,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 31, 0, 31, 0, 0, 0,
- 0, 0, 31, 15, 15, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 21, 0, 21, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 1, 15, 15, 0, 0, 31, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 29, 29, 0, 0, 0, 31, 0, 0,
- 1, 1, 15, 15, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 15, 15,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 31, 0, 31, 0, 0, 0,
- 0, 0, 31, 25, 25, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 21, 0, 21, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 1, 25, 25, 0, 0, 31, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 29, 29, 0, 0, 0, 31, 0, 0,
- 1, 1, 25, 25, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 25, 25,
- 0, 0, 31, 0, 0, 1, 27, 0,
- 27, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 1, 25, 25, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 31,
- 0, 31, 0, 0, 0, 0, 0, 31,
- 13, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 21, 0, 21, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 13, 13,
- 0, 0, 31, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 29, 29, 0,
- 0, 0, 31, 0, 0, 1, 1, 13,
- 13, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 1, 13, 13, 0, 0, 31,
- 0, 0, 1, 27, 0, 27, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 13, 13, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 1, 13, 13, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 31, 0, 31, 0, 0, 0, 0, 0,
- 31, 19, 19, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 21, 0, 21, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 1, 19,
- 19, 0, 0, 31, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 29, 29,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 19, 19, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 1, 19, 19, 0, 0,
- 31, 0, 0, 1, 27, 0, 27, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 1, 19, 19, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 19, 19, 0,
- 0, 0, 31, 0, 0, 0, 38, 38,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 31, 0, 31, 0, 0, 0,
- 0, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 21, 0, 21, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 59, 0, 0,
- 31, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 29, 29, 0, 0, 0,
- 31, 0, 0, 1, 35, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 59, 0,
- 0, 31, 0, 0, 1, 27, 0, 27,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 35, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 59, 0, 0, 0, 31,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 35, 0, 0, 0,
- 0, 0, 11, 11, 11, 1, 1, 1,
- 1, 1, 1, 1, 1, 31, 0, 31,
- 0, 0, 0, 0, 0, 31, 11, 11,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 21,
- 0, 21, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 1, 11, 11, 0, 0,
- 31, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 29, 29, 0, 0, 0,
- 31, 0, 0, 1, 1, 11, 11, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 1, 11, 11, 0, 0, 31, 0, 0,
- 1, 27, 0, 27, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 11, 11,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 1, 11, 11, 0, 0, 0, 31,
- 0, 0, 0, 50, 50, 0, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 11, 11, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 19, 19, 0,
- 0, 0, 31, 0, 0, 0, 53, 53,
- 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 1, 13, 13, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 1, 25,
- 25, 0, 0, 0, 31, 0, 0, 0,
- 44, 44, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 25, 25, 0,
- 0, 31, 0, 0, 1, 27, 0, 27,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 1, 15, 15, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 15, 15,
- 0, 0, 0, 31, 0, 0, 0, 56,
- 56, 0, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 1, 15, 15, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 23, 23, 0, 0, 31, 0, 0, 1,
- 27, 0, 27, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 23, 23, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 1, 23, 23, 0, 0, 0, 31, 0,
- 0, 0, 41, 41, 0, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 1, 23,
- 23, 0, 0, 31, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 29, 29,
- 0, 0, 0, 31, 0, 0, 1, 1,
- 0, 0, 0, 0, 0, 31, 0, 0,
- 1, 1, 0, 0, 31, 0, 0, 1,
- 27, 0, 27, 0, 0, 0, 0, 0,
- 31, 0, 0, 1, 1, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 1, 0,
- 0, 0, 31, 0, 0, 0, 47, 47,
- 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 1, 0, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 1, 0, 0,
- 31, 0, 0, 0, 1, 1, 0, 0,
- 17, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 31, 0, 31, 0, 0,
- 0, 0, 31, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 1, 21, 0, 21, 0, 0, 0,
- 0, 0, 31, 0, 0, 1, 0, 0,
- 31, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 29, 29, 0, 0, 0,
- 31, 0, 0, 1, 0, 0, 0, 0,
- 0, 31, 0, 0, 1, 0, 0, 31,
- 0, 0, 1, 27, 0, 27, 0, 0,
- 0, 0, 0, 31, 0, 0, 1, 0,
- 0, 0, 0, 0, 31, 0, 0, 1,
- 0, 0, 0, 31, 0, 0, 0, 62,
- 62, 0, 0, 0, 0, 0, 0, 31,
- 0, 0, 1, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0
-};
+ static const short _thttp_machine_parser_header_Authorization_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 14, 14, 15, 1, 17, 18, 17,
+ 19, 20, 19, 20, 16, 21, 16, 22,
+ 1, 17, 21, 17, 19, 20, 19, 20,
+ 16, 21, 23, 23, 16, 21, 24, 24,
+ 16, 21, 25, 25, 16, 21, 26, 26,
+ 16, 27, 21, 27, 16, 28, 21, 28,
+ 29, 29, 29, 30, 31, 32, 33, 34,
+ 35, 36, 30, 31, 32, 33, 34, 35,
+ 36, 29, 29, 29, 29, 29, 29, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 39, 39, 39, 39, 39, 16, 42, 21,
+ 42, 43, 41, 16, 43, 21, 43, 29,
+ 29, 29, 30, 31, 32, 33, 34, 35,
+ 44, 30, 31, 32, 33, 34, 35, 44,
+ 29, 29, 29, 29, 29, 29, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 45,
+ 45, 39, 39, 39, 39, 39, 16, 41,
+ 21, 41, 46, 47, 46, 46, 48, 46,
+ 46, 46, 46, 46, 46, 16, 49, 38,
+ 49, 46, 46, 46, 40, 46, 46, 46,
+ 46, 46, 16, 50, 21, 50, 43, 16,
+ 21, 51, 52, 16, 16, 16, 47, 49,
+ 38, 49, 40, 16, 21, 47, 47, 16,
+ 21, 54, 53, 53, 53, 16, 21, 56,
+ 51, 55, 55, 55, 16, 21, 56, 51,
+ 57, 57, 57, 16, 21, 56, 51, 58,
+ 58, 58, 16, 21, 56, 51, 16, 21,
+ 60, 59, 53, 53, 16, 21, 61, 56,
+ 51, 62, 55, 55, 16, 21, 63, 16,
+ 21, 64, 65, 16, 21, 66, 16, 21,
+ 67, 68, 16, 21, 69, 16, 21, 51,
+ 70, 16, 21, 51, 71, 16, 21, 51,
+ 16, 21, 67, 72, 16, 21, 67, 16,
+ 21, 64, 73, 16, 21, 64, 16, 21,
+ 61, 56, 51, 74, 57, 57, 16, 21,
+ 61, 56, 51, 58, 58, 58, 16, 21,
+ 76, 51, 75, 75, 75, 16, 21, 78,
+ 51, 77, 77, 77, 16, 21, 78, 51,
+ 79, 79, 79, 16, 21, 78, 51, 80,
+ 80, 80, 16, 21, 78, 51, 16, 21,
+ 81, 75, 75, 16, 21, 61, 78, 51,
+ 82, 77, 77, 16, 21, 61, 78, 51,
+ 83, 79, 79, 16, 21, 61, 78, 51,
+ 80, 80, 80, 16, 21, 84, 16, 21,
+ 61, 85, 16, 21, 61, 86, 16, 21,
+ 61, 16, 21, 60, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 87, 87, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 88, 88, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 89, 89, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 90, 90, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 91, 91, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 92, 92, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 93, 93, 39,
+ 39, 39, 39, 39, 16, 94, 38, 94,
+ 39, 39, 39, 40, 95, 39, 39, 39,
+ 39, 39, 16, 96, 21, 96, 43, 95,
+ 16, 95, 21, 95, 97, 47, 97, 97,
+ 48, 97, 97, 97, 97, 97, 97, 16,
+ 98, 99, 98, 100, 100, 100, 101, 100,
+ 100, 100, 100, 100, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 102, 102, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 103, 103, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 104, 104, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 105, 105, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 106, 106, 39,
+ 39, 39, 39, 39, 16, 107, 38, 107,
+ 39, 39, 39, 40, 108, 39, 39, 39,
+ 39, 39, 16, 109, 21, 109, 43, 108,
+ 16, 110, 21, 110, 46, 111, 46, 46,
+ 48, 46, 46, 46, 46, 46, 46, 16,
+ 21, 113, 114, 16, 16, 16, 112, 115,
+ 116, 115, 117, 16, 21, 112, 112, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 118, 119, 118, 119, 39, 39, 39, 39,
+ 39, 16, 120, 38, 120, 39, 39, 39,
+ 40, 121, 39, 39, 39, 39, 39, 16,
+ 122, 21, 122, 43, 121, 16, 121, 21,
+ 121, 46, 47, 46, 46, 48, 46, 46,
+ 46, 123, 46, 46, 123, 46, 16, 49,
+ 38, 49, 46, 46, 46, 40, 46, 46,
+ 124, 46, 46, 124, 46, 16, 49, 38,
+ 49, 46, 46, 46, 40, 46, 46, 125,
+ 46, 46, 125, 46, 16, 49, 38, 49,
+ 46, 46, 46, 40, 46, 46, 126, 46,
+ 46, 126, 46, 16, 49, 38, 49, 46,
+ 46, 46, 40, 46, 46, 127, 46, 46,
+ 127, 46, 16, 49, 38, 49, 46, 46,
+ 46, 40, 46, 46, 128, 46, 46, 128,
+ 46, 16, 49, 38, 49, 46, 46, 46,
+ 40, 46, 46, 129, 46, 46, 129, 46,
+ 16, 49, 38, 49, 46, 46, 46, 40,
+ 46, 46, 130, 46, 46, 130, 46, 16,
+ 131, 132, 131, 133, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 134, 134, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 135, 135, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 136, 136, 39,
+ 39, 39, 39, 39, 16, 137, 38, 137,
+ 39, 39, 39, 40, 138, 39, 39, 39,
+ 39, 39, 16, 139, 21, 139, 43, 138,
+ 16, 140, 21, 140, 46, 141, 46, 46,
+ 48, 46, 46, 46, 46, 46, 46, 16,
+ 21, 143, 144, 16, 16, 16, 142, 145,
+ 146, 145, 147, 16, 21, 142, 142, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 148, 148, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 149, 149, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 150, 150, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 151, 151, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 152, 152, 39, 39, 39, 39, 39, 16,
+ 153, 38, 153, 39, 39, 39, 40, 154,
+ 39, 39, 39, 39, 39, 16, 155, 21,
+ 155, 43, 154, 16, 156, 21, 156, 46,
+ 157, 46, 46, 48, 46, 46, 46, 46,
+ 46, 46, 16, 21, 159, 160, 16, 16,
+ 16, 158, 161, 162, 161, 163, 16, 21,
+ 158, 158, 16, 37, 38, 37, 39, 39,
+ 39, 40, 41, 164, 164, 39, 39, 39,
+ 39, 39, 16, 37, 38, 37, 39, 39,
+ 39, 40, 41, 165, 165, 39, 39, 39,
+ 39, 39, 16, 166, 38, 166, 39, 39,
+ 39, 40, 167, 39, 39, 39, 39, 39,
+ 16, 168, 21, 168, 43, 167, 16, 167,
+ 21, 167, 169, 47, 169, 169, 48, 169,
+ 169, 169, 169, 169, 169, 16, 170, 171,
+ 170, 172, 172, 172, 173, 172, 172, 172,
+ 172, 172, 16, 37, 38, 37, 39, 39,
+ 39, 40, 41, 174, 174, 39, 39, 39,
+ 39, 39, 16, 37, 38, 37, 39, 39,
+ 39, 40, 41, 175, 176, 175, 176, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 177, 177, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 178, 178, 39,
+ 39, 39, 39, 39, 16, 179, 38, 179,
+ 39, 39, 39, 40, 180, 39, 39, 39,
+ 39, 39, 16, 181, 21, 181, 43, 180,
+ 16, 182, 21, 182, 46, 183, 46, 46,
+ 48, 46, 46, 46, 46, 46, 46, 16,
+ 21, 185, 186, 16, 16, 16, 184, 187,
+ 188, 187, 189, 16, 21, 184, 184, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 190, 190, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 191, 191, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 192, 192, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 193, 193, 39, 39, 39, 39, 39, 16,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 194, 194, 39, 39, 39, 39, 39, 16,
+ 195, 38, 195, 39, 39, 39, 40, 196,
+ 39, 39, 39, 39, 39, 16, 197, 21,
+ 197, 43, 196, 16, 198, 21, 198, 46,
+ 199, 46, 46, 48, 46, 46, 46, 46,
+ 46, 46, 16, 21, 201, 202, 16, 16,
+ 16, 200, 203, 204, 203, 205, 16, 21,
+ 200, 200, 16, 37, 38, 37, 39, 39,
+ 39, 40, 41, 206, 207, 206, 207, 39,
+ 39, 39, 39, 39, 16, 37, 38, 37,
+ 39, 39, 39, 40, 41, 208, 208, 39,
+ 39, 39, 39, 39, 16, 209, 38, 209,
+ 39, 39, 39, 40, 210, 39, 39, 39,
+ 39, 39, 16, 211, 21, 211, 43, 210,
+ 16, 210, 21, 210, 46, 212, 46, 46,
+ 48, 46, 46, 46, 46, 46, 46, 16,
+ 21, 215, 216, 214, 214, 214, 213, 21,
+ 219, 220, 218, 218, 218, 217, 21, 219,
+ 218, 21, 221, 217, 217, 218, 222, 21,
+ 222, 51, 223, 52, 16, 16, 47, 223,
+ 21, 223, 224, 51, 224, 224, 225, 226,
+ 227, 228, 229, 230, 231, 52, 225, 226,
+ 227, 228, 229, 230, 231, 224, 16, 16,
+ 224, 224, 224, 224, 224, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 52,
+ 233, 16, 16, 233, 233, 233, 233, 47,
+ 236, 21, 236, 51, 223, 235, 52, 16,
+ 16, 47, 235, 21, 235, 237, 238, 237,
+ 237, 239, 52, 237, 16, 16, 237, 237,
+ 237, 237, 237, 47, 240, 38, 240, 237,
+ 51, 237, 237, 234, 52, 237, 16, 16,
+ 237, 237, 237, 237, 47, 240, 38, 240,
+ 51, 234, 52, 16, 16, 47, 21, 51,
+ 242, 52, 16, 16, 16, 241, 241, 241,
+ 47, 21, 51, 244, 52, 238, 16, 16,
+ 16, 243, 243, 243, 47, 21, 51, 244,
+ 52, 238, 16, 16, 16, 245, 245, 245,
+ 47, 21, 51, 244, 52, 238, 16, 16,
+ 16, 246, 246, 246, 47, 21, 51, 244,
+ 52, 238, 16, 16, 16, 47, 21, 51,
+ 248, 52, 16, 16, 16, 247, 241, 241,
+ 47, 21, 51, 249, 244, 52, 238, 16,
+ 16, 16, 250, 243, 243, 47, 21, 51,
+ 52, 16, 16, 16, 251, 47, 21, 51,
+ 252, 52, 16, 16, 16, 253, 47, 21,
+ 51, 52, 16, 16, 16, 254, 47, 21,
+ 51, 255, 52, 16, 16, 16, 256, 47,
+ 21, 51, 52, 16, 16, 16, 257, 47,
+ 21, 51, 52, 238, 16, 16, 16, 258,
+ 47, 21, 51, 52, 238, 16, 16, 16,
+ 259, 47, 21, 51, 52, 238, 16, 16,
+ 16, 47, 21, 51, 255, 52, 16, 16,
+ 16, 260, 47, 21, 51, 255, 52, 16,
+ 16, 16, 47, 21, 51, 252, 52, 16,
+ 16, 16, 261, 47, 21, 51, 252, 52,
+ 16, 16, 16, 47, 21, 51, 249, 244,
+ 52, 238, 16, 16, 16, 262, 245, 245,
+ 47, 21, 51, 249, 244, 52, 238, 16,
+ 16, 16, 246, 246, 246, 47, 21, 51,
+ 264, 52, 238, 16, 16, 16, 263, 263,
+ 263, 47, 21, 51, 266, 52, 238, 16,
+ 16, 16, 265, 265, 265, 47, 21, 51,
+ 266, 52, 238, 16, 16, 16, 267, 267,
+ 267, 47, 21, 51, 266, 52, 238, 16,
+ 16, 16, 268, 268, 268, 47, 21, 51,
+ 266, 52, 238, 16, 16, 16, 47, 21,
+ 51, 52, 16, 16, 16, 269, 263, 263,
+ 47, 21, 51, 249, 266, 52, 238, 16,
+ 16, 16, 270, 265, 265, 47, 21, 51,
+ 249, 266, 52, 238, 16, 16, 16, 271,
+ 267, 267, 47, 21, 51, 249, 266, 52,
+ 238, 16, 16, 16, 268, 268, 268, 47,
+ 21, 51, 52, 16, 16, 16, 272, 47,
+ 21, 51, 249, 52, 16, 16, 16, 273,
+ 47, 21, 51, 249, 52, 16, 16, 16,
+ 274, 47, 21, 51, 249, 52, 16, 16,
+ 16, 47, 21, 51, 248, 52, 16, 16,
+ 16, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 275, 52, 275, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 276,
+ 52, 276, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 277, 52, 277, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 278,
+ 52, 278, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 279, 52, 279, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 280,
+ 52, 280, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 281, 52, 281, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 282,
+ 52, 282, 233, 16, 16, 233, 233, 233,
+ 233, 47, 283, 38, 283, 233, 51, 233,
+ 233, 234, 284, 52, 233, 16, 16, 233,
+ 233, 233, 233, 47, 285, 21, 285, 51,
+ 223, 284, 52, 16, 16, 47, 284, 21,
+ 284, 286, 238, 286, 286, 239, 52, 286,
+ 16, 16, 286, 286, 286, 286, 286, 47,
+ 287, 99, 287, 288, 51, 288, 288, 289,
+ 52, 288, 16, 16, 288, 288, 288, 288,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 290, 52, 290, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 291, 52,
+ 291, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 292, 52, 292, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 293, 52,
+ 293, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 294, 52, 294, 233, 16, 16,
+ 233, 233, 233, 233, 47, 295, 38, 295,
+ 233, 51, 233, 233, 234, 296, 52, 233,
+ 16, 16, 233, 233, 233, 233, 47, 297,
+ 21, 297, 51, 223, 296, 52, 16, 16,
+ 47, 298, 21, 298, 237, 299, 237, 237,
+ 239, 52, 237, 16, 16, 237, 237, 237,
+ 237, 237, 47, 300, 38, 300, 113, 301,
+ 114, 16, 16, 112, 302, 21, 302, 113,
+ 303, 114, 16, 16, 112, 303, 21, 303,
+ 304, 113, 304, 304, 305, 306, 307, 308,
+ 309, 310, 311, 114, 305, 306, 307, 308,
+ 309, 310, 311, 304, 16, 16, 304, 304,
+ 304, 304, 304, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 114, 313, 16,
+ 16, 313, 313, 313, 313, 112, 315, 21,
+ 315, 113, 303, 314, 114, 16, 16, 112,
+ 314, 21, 314, 316, 317, 316, 316, 318,
+ 114, 316, 16, 16, 316, 316, 316, 316,
+ 316, 112, 300, 38, 300, 316, 113, 316,
+ 316, 301, 114, 316, 16, 16, 316, 316,
+ 316, 316, 112, 319, 116, 319, 51, 320,
+ 52, 16, 16, 47, 21, 113, 322, 114,
+ 16, 16, 16, 321, 321, 321, 112, 21,
+ 113, 324, 114, 325, 16, 16, 16, 323,
+ 323, 323, 112, 21, 113, 324, 114, 325,
+ 16, 16, 16, 326, 326, 326, 112, 21,
+ 113, 324, 114, 325, 16, 16, 16, 327,
+ 327, 327, 112, 21, 113, 324, 114, 325,
+ 16, 16, 16, 112, 21, 113, 329, 114,
+ 16, 16, 16, 328, 321, 321, 112, 21,
+ 113, 330, 324, 114, 325, 16, 16, 16,
+ 331, 323, 323, 112, 21, 113, 114, 16,
+ 16, 16, 332, 112, 21, 113, 333, 114,
+ 16, 16, 16, 334, 112, 21, 113, 114,
+ 16, 16, 16, 335, 112, 21, 113, 336,
+ 114, 16, 16, 16, 337, 112, 21, 113,
+ 114, 16, 16, 16, 338, 112, 21, 113,
+ 114, 325, 16, 16, 16, 339, 112, 21,
+ 113, 114, 325, 16, 16, 16, 340, 112,
+ 21, 113, 114, 325, 16, 16, 16, 112,
+ 21, 113, 336, 114, 16, 16, 16, 341,
+ 112, 21, 113, 336, 114, 16, 16, 16,
+ 112, 21, 113, 333, 114, 16, 16, 16,
+ 342, 112, 21, 113, 333, 114, 16, 16,
+ 16, 112, 21, 113, 330, 324, 114, 325,
+ 16, 16, 16, 343, 326, 326, 112, 21,
+ 113, 330, 324, 114, 325, 16, 16, 16,
+ 327, 327, 327, 112, 21, 113, 345, 114,
+ 325, 16, 16, 16, 344, 344, 344, 112,
+ 21, 113, 347, 114, 325, 16, 16, 16,
+ 346, 346, 346, 112, 21, 113, 347, 114,
+ 325, 16, 16, 16, 348, 348, 348, 112,
+ 21, 113, 347, 114, 325, 16, 16, 16,
+ 349, 349, 349, 112, 21, 113, 347, 114,
+ 325, 16, 16, 16, 112, 21, 113, 114,
+ 16, 16, 16, 350, 344, 344, 112, 21,
+ 113, 330, 347, 114, 325, 16, 16, 16,
+ 351, 346, 346, 112, 21, 113, 330, 347,
+ 114, 325, 16, 16, 16, 352, 348, 348,
+ 112, 21, 113, 330, 347, 114, 325, 16,
+ 16, 16, 349, 349, 349, 112, 21, 113,
+ 114, 16, 16, 16, 353, 112, 21, 113,
+ 330, 114, 16, 16, 16, 354, 112, 21,
+ 113, 330, 114, 16, 16, 16, 355, 112,
+ 21, 113, 330, 114, 16, 16, 16, 112,
+ 21, 113, 329, 114, 16, 16, 16, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 356, 114, 356, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 357, 114, 357,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 358, 114, 358, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 359, 114, 359,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 360, 114, 360, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 361, 114, 361,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 362, 114, 362, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 363, 114, 363,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 364, 38, 364, 313, 113, 313, 313, 301,
+ 365, 114, 313, 16, 16, 313, 313, 313,
+ 313, 112, 366, 21, 366, 113, 303, 365,
+ 114, 16, 16, 112, 365, 21, 365, 367,
+ 317, 367, 367, 318, 114, 367, 16, 16,
+ 367, 367, 367, 367, 367, 112, 368, 99,
+ 368, 369, 113, 369, 369, 370, 114, 369,
+ 16, 16, 369, 369, 369, 369, 112, 312,
+ 38, 312, 313, 113, 313, 313, 301, 314,
+ 371, 114, 371, 313, 16, 16, 313, 313,
+ 313, 313, 112, 312, 38, 312, 313, 113,
+ 313, 313, 301, 314, 372, 114, 372, 313,
+ 16, 16, 313, 313, 313, 313, 112, 312,
+ 38, 312, 313, 113, 313, 313, 301, 314,
+ 373, 114, 373, 313, 16, 16, 313, 313,
+ 313, 313, 112, 312, 38, 312, 313, 113,
+ 313, 313, 301, 314, 374, 114, 374, 313,
+ 16, 16, 313, 313, 313, 313, 112, 312,
+ 38, 312, 313, 113, 313, 313, 301, 314,
+ 375, 114, 375, 313, 16, 16, 313, 313,
+ 313, 313, 112, 376, 38, 376, 313, 113,
+ 313, 313, 301, 377, 114, 313, 16, 16,
+ 313, 313, 313, 313, 112, 378, 21, 378,
+ 113, 303, 377, 114, 16, 16, 112, 379,
+ 21, 379, 316, 380, 316, 316, 318, 114,
+ 316, 16, 16, 316, 316, 316, 316, 316,
+ 112, 381, 116, 381, 113, 382, 114, 16,
+ 16, 112, 312, 38, 312, 313, 113, 313,
+ 313, 301, 314, 383, 384, 114, 383, 384,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 385, 38, 385, 313, 113, 313, 313, 301,
+ 386, 114, 313, 16, 16, 313, 313, 313,
+ 313, 112, 387, 21, 387, 113, 303, 386,
+ 114, 16, 16, 112, 386, 21, 386, 316,
+ 317, 316, 316, 318, 114, 316, 16, 16,
+ 316, 316, 388, 316, 316, 388, 316, 112,
+ 300, 38, 300, 316, 113, 316, 316, 301,
+ 114, 316, 16, 16, 316, 389, 316, 316,
+ 389, 316, 112, 300, 38, 300, 316, 113,
+ 316, 316, 301, 114, 316, 16, 16, 316,
+ 390, 316, 316, 390, 316, 112, 300, 38,
+ 300, 316, 113, 316, 316, 301, 114, 316,
+ 16, 16, 316, 391, 316, 316, 391, 316,
+ 112, 300, 38, 300, 316, 113, 316, 316,
+ 301, 114, 316, 16, 16, 316, 392, 316,
+ 316, 392, 316, 112, 300, 38, 300, 316,
+ 113, 316, 316, 301, 114, 316, 16, 16,
+ 316, 393, 316, 316, 393, 316, 112, 300,
+ 38, 300, 316, 113, 316, 316, 301, 114,
+ 316, 16, 16, 316, 394, 316, 316, 394,
+ 316, 112, 300, 38, 300, 316, 113, 316,
+ 316, 301, 114, 316, 16, 16, 316, 395,
+ 316, 316, 395, 316, 112, 396, 132, 396,
+ 113, 397, 114, 16, 16, 112, 312, 38,
+ 312, 313, 113, 313, 313, 301, 314, 398,
+ 114, 398, 313, 16, 16, 313, 313, 313,
+ 313, 112, 312, 38, 312, 313, 113, 313,
+ 313, 301, 314, 399, 114, 399, 313, 16,
+ 16, 313, 313, 313, 313, 112, 312, 38,
+ 312, 313, 113, 313, 313, 301, 314, 400,
+ 114, 400, 313, 16, 16, 313, 313, 313,
+ 313, 112, 401, 38, 401, 313, 113, 313,
+ 313, 301, 402, 114, 313, 16, 16, 313,
+ 313, 313, 313, 112, 403, 21, 403, 113,
+ 303, 402, 114, 16, 16, 112, 404, 21,
+ 404, 316, 405, 316, 316, 318, 114, 316,
+ 16, 16, 316, 316, 316, 316, 316, 112,
+ 406, 116, 406, 143, 407, 144, 16, 16,
+ 142, 408, 21, 408, 143, 409, 144, 16,
+ 16, 142, 409, 21, 409, 410, 143, 410,
+ 410, 411, 412, 413, 414, 415, 416, 417,
+ 144, 411, 412, 413, 414, 415, 416, 417,
+ 410, 16, 16, 410, 410, 410, 410, 410,
+ 142, 418, 38, 418, 419, 143, 419, 419,
+ 420, 421, 144, 419, 16, 16, 419, 419,
+ 419, 419, 142, 422, 21, 422, 143, 409,
+ 421, 144, 16, 16, 142, 421, 21, 421,
+ 423, 424, 423, 423, 425, 144, 423, 16,
+ 16, 423, 423, 423, 423, 423, 142, 426,
+ 38, 426, 423, 143, 423, 423, 420, 144,
+ 423, 16, 16, 423, 423, 423, 423, 142,
+ 427, 146, 427, 51, 428, 52, 16, 16,
+ 47, 21, 143, 430, 144, 16, 16, 16,
+ 429, 429, 429, 142, 21, 143, 432, 144,
+ 433, 16, 16, 16, 431, 431, 431, 142,
+ 21, 143, 432, 144, 433, 16, 16, 16,
+ 434, 434, 434, 142, 21, 143, 432, 144,
+ 433, 16, 16, 16, 435, 435, 435, 142,
+ 21, 143, 432, 144, 433, 16, 16, 16,
+ 142, 21, 143, 437, 144, 16, 16, 16,
+ 436, 429, 429, 142, 21, 143, 438, 432,
+ 144, 433, 16, 16, 16, 439, 431, 431,
+ 142, 21, 143, 144, 16, 16, 16, 440,
+ 142, 21, 143, 441, 144, 16, 16, 16,
+ 442, 142, 21, 143, 144, 16, 16, 16,
+ 443, 142, 21, 143, 444, 144, 16, 16,
+ 16, 445, 142, 21, 143, 144, 16, 16,
+ 16, 446, 142, 21, 143, 144, 433, 16,
+ 16, 16, 447, 142, 21, 143, 144, 433,
+ 16, 16, 16, 448, 142, 21, 143, 144,
+ 433, 16, 16, 16, 142, 426, 38, 426,
+ 143, 420, 144, 16, 16, 142, 21, 143,
+ 444, 144, 16, 16, 16, 449, 142, 21,
+ 143, 444, 144, 16, 16, 16, 142, 21,
+ 143, 441, 144, 16, 16, 16, 450, 142,
+ 21, 143, 441, 144, 16, 16, 16, 142,
+ 21, 143, 438, 432, 144, 433, 16, 16,
+ 16, 451, 434, 434, 142, 21, 143, 438,
+ 432, 144, 433, 16, 16, 16, 435, 435,
+ 435, 142, 21, 143, 453, 144, 433, 16,
+ 16, 16, 452, 452, 452, 142, 21, 143,
+ 455, 144, 433, 16, 16, 16, 454, 454,
+ 454, 142, 21, 143, 455, 144, 433, 16,
+ 16, 16, 456, 456, 456, 142, 21, 143,
+ 455, 144, 433, 16, 16, 16, 457, 457,
+ 457, 142, 21, 143, 455, 144, 433, 16,
+ 16, 16, 142, 21, 143, 144, 16, 16,
+ 16, 458, 452, 452, 142, 21, 143, 438,
+ 455, 144, 433, 16, 16, 16, 459, 454,
+ 454, 142, 21, 143, 438, 455, 144, 433,
+ 16, 16, 16, 460, 456, 456, 142, 21,
+ 143, 438, 455, 144, 433, 16, 16, 16,
+ 457, 457, 457, 142, 21, 143, 144, 16,
+ 16, 16, 461, 142, 21, 143, 438, 144,
+ 16, 16, 16, 462, 142, 21, 143, 438,
+ 144, 16, 16, 16, 463, 142, 21, 143,
+ 438, 144, 16, 16, 16, 142, 21, 143,
+ 437, 144, 16, 16, 16, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 464,
+ 144, 464, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 465, 144, 465, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 466,
+ 144, 466, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 467, 144, 467, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 468,
+ 144, 468, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 469, 144, 469, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 470,
+ 144, 470, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 471, 144, 471, 419, 16,
+ 16, 419, 419, 419, 419, 142, 472, 38,
+ 472, 419, 143, 419, 419, 420, 473, 144,
+ 419, 16, 16, 419, 419, 419, 419, 142,
+ 474, 21, 474, 143, 409, 473, 144, 16,
+ 16, 142, 473, 21, 473, 475, 424, 475,
+ 475, 425, 144, 475, 16, 16, 475, 475,
+ 475, 475, 475, 142, 476, 99, 476, 477,
+ 143, 477, 477, 478, 144, 477, 16, 16,
+ 477, 477, 477, 477, 142, 418, 38, 418,
+ 419, 143, 419, 419, 420, 421, 479, 144,
+ 479, 419, 16, 16, 419, 419, 419, 419,
+ 142, 418, 38, 418, 419, 143, 419, 419,
+ 420, 421, 480, 144, 480, 419, 16, 16,
+ 419, 419, 419, 419, 142, 418, 38, 418,
+ 419, 143, 419, 419, 420, 421, 481, 144,
+ 481, 419, 16, 16, 419, 419, 419, 419,
+ 142, 418, 38, 418, 419, 143, 419, 419,
+ 420, 421, 482, 144, 482, 419, 16, 16,
+ 419, 419, 419, 419, 142, 418, 38, 418,
+ 419, 143, 419, 419, 420, 421, 483, 144,
+ 483, 419, 16, 16, 419, 419, 419, 419,
+ 142, 484, 38, 484, 419, 143, 419, 419,
+ 420, 485, 144, 419, 16, 16, 419, 419,
+ 419, 419, 142, 486, 21, 486, 143, 409,
+ 485, 144, 16, 16, 142, 487, 21, 487,
+ 423, 488, 423, 423, 425, 144, 423, 16,
+ 16, 423, 423, 423, 423, 423, 142, 489,
+ 146, 489, 113, 490, 114, 16, 16, 112,
+ 418, 38, 418, 419, 143, 419, 419, 420,
+ 421, 491, 492, 144, 491, 492, 419, 16,
+ 16, 419, 419, 419, 419, 142, 493, 38,
+ 493, 419, 143, 419, 419, 420, 494, 144,
+ 419, 16, 16, 419, 419, 419, 419, 142,
+ 495, 21, 495, 143, 409, 494, 144, 16,
+ 16, 142, 494, 21, 494, 423, 424, 423,
+ 423, 425, 144, 423, 16, 16, 423, 423,
+ 496, 423, 423, 496, 423, 142, 426, 38,
+ 426, 423, 143, 423, 423, 420, 144, 423,
+ 16, 16, 423, 497, 423, 423, 497, 423,
+ 142, 426, 38, 426, 423, 143, 423, 423,
+ 420, 144, 423, 16, 16, 423, 498, 423,
+ 423, 498, 423, 142, 426, 38, 426, 423,
+ 143, 423, 423, 420, 144, 423, 16, 16,
+ 423, 499, 423, 423, 499, 423, 142, 426,
+ 38, 426, 423, 143, 423, 423, 420, 144,
+ 423, 16, 16, 423, 500, 423, 423, 500,
+ 423, 142, 426, 38, 426, 423, 143, 423,
+ 423, 420, 144, 423, 16, 16, 423, 501,
+ 423, 423, 501, 423, 142, 426, 38, 426,
+ 423, 143, 423, 423, 420, 144, 423, 16,
+ 16, 423, 502, 423, 423, 502, 423, 142,
+ 426, 38, 426, 423, 143, 423, 423, 420,
+ 144, 423, 16, 16, 423, 503, 423, 423,
+ 503, 423, 142, 504, 132, 504, 143, 505,
+ 144, 16, 16, 142, 418, 38, 418, 419,
+ 143, 419, 419, 420, 421, 506, 144, 506,
+ 419, 16, 16, 419, 419, 419, 419, 142,
+ 418, 38, 418, 419, 143, 419, 419, 420,
+ 421, 507, 144, 507, 419, 16, 16, 419,
+ 419, 419, 419, 142, 418, 38, 418, 419,
+ 143, 419, 419, 420, 421, 508, 144, 508,
+ 419, 16, 16, 419, 419, 419, 419, 142,
+ 509, 38, 509, 419, 143, 419, 419, 420,
+ 510, 144, 419, 16, 16, 419, 419, 419,
+ 419, 142, 511, 21, 511, 143, 409, 510,
+ 144, 16, 16, 142, 512, 21, 512, 423,
+ 513, 423, 423, 425, 144, 423, 16, 16,
+ 423, 423, 423, 423, 423, 142, 514, 146,
+ 514, 143, 515, 144, 16, 16, 142, 418,
+ 38, 418, 419, 143, 419, 419, 420, 421,
+ 516, 144, 516, 419, 16, 16, 419, 419,
+ 419, 419, 142, 418, 38, 418, 419, 143,
+ 419, 419, 420, 421, 517, 144, 517, 419,
+ 16, 16, 419, 419, 419, 419, 142, 418,
+ 38, 418, 419, 143, 419, 419, 420, 421,
+ 518, 144, 518, 419, 16, 16, 419, 419,
+ 419, 419, 142, 418, 38, 418, 419, 143,
+ 419, 419, 420, 421, 519, 144, 519, 419,
+ 16, 16, 419, 419, 419, 419, 142, 418,
+ 38, 418, 419, 143, 419, 419, 420, 421,
+ 520, 144, 520, 419, 16, 16, 419, 419,
+ 419, 419, 142, 521, 38, 521, 419, 143,
+ 419, 419, 420, 522, 144, 419, 16, 16,
+ 419, 419, 419, 419, 142, 523, 21, 523,
+ 143, 409, 522, 144, 16, 16, 142, 524,
+ 21, 524, 423, 525, 423, 423, 425, 144,
+ 423, 16, 16, 423, 423, 423, 423, 423,
+ 142, 526, 146, 526, 159, 527, 160, 16,
+ 16, 158, 528, 21, 528, 159, 529, 160,
+ 16, 16, 158, 529, 21, 529, 530, 159,
+ 530, 530, 531, 532, 533, 534, 535, 536,
+ 537, 160, 531, 532, 533, 534, 535, 536,
+ 537, 530, 16, 16, 530, 530, 530, 530,
+ 530, 158, 538, 38, 538, 539, 159, 539,
+ 539, 540, 541, 160, 539, 16, 16, 539,
+ 539, 539, 539, 158, 542, 21, 542, 159,
+ 529, 541, 160, 16, 16, 158, 541, 21,
+ 541, 543, 544, 543, 543, 545, 160, 543,
+ 16, 16, 543, 543, 543, 543, 543, 158,
+ 546, 38, 546, 543, 159, 543, 543, 540,
+ 160, 543, 16, 16, 543, 543, 543, 543,
+ 158, 547, 162, 547, 51, 548, 52, 16,
+ 16, 47, 21, 159, 550, 160, 16, 16,
+ 16, 549, 549, 549, 158, 21, 159, 552,
+ 160, 553, 16, 16, 16, 551, 551, 551,
+ 158, 21, 159, 552, 160, 553, 16, 16,
+ 16, 554, 554, 554, 158, 21, 159, 552,
+ 160, 553, 16, 16, 16, 555, 555, 555,
+ 158, 21, 159, 552, 160, 553, 16, 16,
+ 16, 158, 21, 159, 557, 160, 16, 16,
+ 16, 556, 549, 549, 158, 21, 159, 558,
+ 552, 160, 553, 16, 16, 16, 559, 551,
+ 551, 158, 21, 159, 160, 16, 16, 16,
+ 560, 158, 21, 159, 561, 160, 16, 16,
+ 16, 562, 158, 21, 159, 160, 16, 16,
+ 16, 563, 158, 21, 159, 564, 160, 16,
+ 16, 16, 565, 158, 21, 159, 160, 16,
+ 16, 16, 566, 158, 21, 159, 160, 553,
+ 16, 16, 16, 567, 158, 21, 159, 160,
+ 553, 16, 16, 16, 568, 158, 21, 159,
+ 160, 553, 16, 16, 16, 158, 546, 38,
+ 546, 159, 540, 160, 16, 16, 158, 21,
+ 159, 564, 160, 16, 16, 16, 569, 158,
+ 21, 159, 564, 160, 16, 16, 16, 158,
+ 21, 159, 561, 160, 16, 16, 16, 570,
+ 158, 21, 159, 561, 160, 16, 16, 16,
+ 158, 21, 159, 558, 552, 160, 553, 16,
+ 16, 16, 571, 554, 554, 158, 21, 159,
+ 558, 552, 160, 553, 16, 16, 16, 555,
+ 555, 555, 158, 21, 159, 573, 160, 553,
+ 16, 16, 16, 572, 572, 572, 158, 21,
+ 159, 575, 160, 553, 16, 16, 16, 574,
+ 574, 574, 158, 21, 159, 575, 160, 553,
+ 16, 16, 16, 576, 576, 576, 158, 21,
+ 159, 575, 160, 553, 16, 16, 16, 577,
+ 577, 577, 158, 21, 159, 575, 160, 553,
+ 16, 16, 16, 158, 21, 159, 160, 16,
+ 16, 16, 578, 572, 572, 158, 21, 159,
+ 558, 575, 160, 553, 16, 16, 16, 579,
+ 574, 574, 158, 21, 159, 558, 575, 160,
+ 553, 16, 16, 16, 580, 576, 576, 158,
+ 21, 159, 558, 575, 160, 553, 16, 16,
+ 16, 577, 577, 577, 158, 21, 159, 160,
+ 16, 16, 16, 581, 158, 21, 159, 558,
+ 160, 16, 16, 16, 582, 158, 21, 159,
+ 558, 160, 16, 16, 16, 583, 158, 21,
+ 159, 558, 160, 16, 16, 16, 158, 21,
+ 159, 557, 160, 16, 16, 16, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 584, 160, 584, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 585, 160, 585, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 586, 160, 586, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 587, 160, 587, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 588, 160, 588, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 589, 160, 589, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 590, 160, 590, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 591, 160, 591, 539,
+ 16, 16, 539, 539, 539, 539, 158, 592,
+ 38, 592, 539, 159, 539, 539, 540, 593,
+ 160, 539, 16, 16, 539, 539, 539, 539,
+ 158, 594, 21, 594, 159, 529, 593, 160,
+ 16, 16, 158, 593, 21, 593, 595, 544,
+ 595, 595, 545, 160, 595, 16, 16, 595,
+ 595, 595, 595, 595, 158, 596, 99, 596,
+ 597, 159, 597, 597, 598, 160, 597, 16,
+ 16, 597, 597, 597, 597, 158, 538, 38,
+ 538, 539, 159, 539, 539, 540, 541, 599,
+ 160, 599, 539, 16, 16, 539, 539, 539,
+ 539, 158, 538, 38, 538, 539, 159, 539,
+ 539, 540, 541, 600, 160, 600, 539, 16,
+ 16, 539, 539, 539, 539, 158, 538, 38,
+ 538, 539, 159, 539, 539, 540, 541, 601,
+ 160, 601, 539, 16, 16, 539, 539, 539,
+ 539, 158, 538, 38, 538, 539, 159, 539,
+ 539, 540, 541, 602, 160, 602, 539, 16,
+ 16, 539, 539, 539, 539, 158, 538, 38,
+ 538, 539, 159, 539, 539, 540, 541, 603,
+ 160, 603, 539, 16, 16, 539, 539, 539,
+ 539, 158, 604, 38, 604, 539, 159, 539,
+ 539, 540, 605, 160, 539, 16, 16, 539,
+ 539, 539, 539, 158, 606, 21, 606, 159,
+ 529, 605, 160, 16, 16, 158, 607, 21,
+ 607, 543, 608, 543, 543, 545, 160, 543,
+ 16, 16, 543, 543, 543, 543, 543, 158,
+ 609, 162, 609, 113, 610, 114, 16, 16,
+ 112, 538, 38, 538, 539, 159, 539, 539,
+ 540, 541, 611, 612, 160, 611, 612, 539,
+ 16, 16, 539, 539, 539, 539, 158, 613,
+ 38, 613, 539, 159, 539, 539, 540, 614,
+ 160, 539, 16, 16, 539, 539, 539, 539,
+ 158, 615, 21, 615, 159, 529, 614, 160,
+ 16, 16, 158, 614, 21, 614, 543, 544,
+ 543, 543, 545, 160, 543, 16, 16, 543,
+ 543, 616, 543, 543, 616, 543, 158, 546,
+ 38, 546, 543, 159, 543, 543, 540, 160,
+ 543, 16, 16, 543, 617, 543, 543, 617,
+ 543, 158, 546, 38, 546, 543, 159, 543,
+ 543, 540, 160, 543, 16, 16, 543, 618,
+ 543, 543, 618, 543, 158, 546, 38, 546,
+ 543, 159, 543, 543, 540, 160, 543, 16,
+ 16, 543, 619, 543, 543, 619, 543, 158,
+ 546, 38, 546, 543, 159, 543, 543, 540,
+ 160, 543, 16, 16, 543, 620, 543, 543,
+ 620, 543, 158, 546, 38, 546, 543, 159,
+ 543, 543, 540, 160, 543, 16, 16, 543,
+ 621, 543, 543, 621, 543, 158, 546, 38,
+ 546, 543, 159, 543, 543, 540, 160, 543,
+ 16, 16, 543, 622, 543, 543, 622, 543,
+ 158, 546, 38, 546, 543, 159, 543, 543,
+ 540, 160, 543, 16, 16, 543, 623, 543,
+ 543, 623, 543, 158, 624, 132, 624, 159,
+ 625, 160, 16, 16, 158, 538, 38, 538,
+ 539, 159, 539, 539, 540, 541, 626, 160,
+ 626, 539, 16, 16, 539, 539, 539, 539,
+ 158, 538, 38, 538, 539, 159, 539, 539,
+ 540, 541, 627, 160, 627, 539, 16, 16,
+ 539, 539, 539, 539, 158, 538, 38, 538,
+ 539, 159, 539, 539, 540, 541, 628, 160,
+ 628, 539, 16, 16, 539, 539, 539, 539,
+ 158, 629, 38, 629, 539, 159, 539, 539,
+ 540, 630, 160, 539, 16, 16, 539, 539,
+ 539, 539, 158, 631, 21, 631, 159, 529,
+ 630, 160, 16, 16, 158, 632, 21, 632,
+ 543, 633, 543, 543, 545, 160, 543, 16,
+ 16, 543, 543, 543, 543, 543, 158, 634,
+ 162, 634, 143, 635, 144, 16, 16, 142,
+ 538, 38, 538, 539, 159, 539, 539, 540,
+ 541, 636, 160, 636, 539, 16, 16, 539,
+ 539, 539, 539, 158, 538, 38, 538, 539,
+ 159, 539, 539, 540, 541, 637, 160, 637,
+ 539, 16, 16, 539, 539, 539, 539, 158,
+ 538, 38, 538, 539, 159, 539, 539, 540,
+ 541, 638, 160, 638, 539, 16, 16, 539,
+ 539, 539, 539, 158, 538, 38, 538, 539,
+ 159, 539, 539, 540, 541, 639, 160, 639,
+ 539, 16, 16, 539, 539, 539, 539, 158,
+ 538, 38, 538, 539, 159, 539, 539, 540,
+ 541, 640, 160, 640, 539, 16, 16, 539,
+ 539, 539, 539, 158, 641, 38, 641, 539,
+ 159, 539, 539, 540, 642, 160, 539, 16,
+ 16, 539, 539, 539, 539, 158, 643, 21,
+ 643, 159, 529, 642, 160, 16, 16, 158,
+ 644, 21, 644, 543, 645, 543, 543, 545,
+ 160, 543, 16, 16, 543, 543, 543, 543,
+ 543, 158, 646, 162, 646, 159, 647, 160,
+ 16, 16, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 648, 160, 648, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 649, 160, 649, 539, 16, 16, 539, 539,
+ 539, 539, 158, 650, 38, 650, 539, 159,
+ 539, 539, 540, 651, 160, 539, 16, 16,
+ 539, 539, 539, 539, 158, 652, 21, 652,
+ 159, 529, 651, 160, 16, 16, 158, 651,
+ 21, 651, 653, 544, 653, 653, 545, 160,
+ 653, 16, 16, 653, 653, 653, 653, 653,
+ 158, 654, 171, 654, 655, 159, 655, 655,
+ 656, 160, 655, 16, 16, 655, 655, 655,
+ 655, 158, 538, 38, 538, 539, 159, 539,
+ 539, 540, 541, 657, 160, 657, 539, 16,
+ 16, 539, 539, 539, 539, 158, 538, 38,
+ 538, 539, 159, 539, 539, 540, 541, 658,
+ 659, 160, 658, 659, 539, 16, 16, 539,
+ 539, 539, 539, 158, 538, 38, 538, 539,
+ 159, 539, 539, 540, 541, 660, 160, 660,
+ 539, 16, 16, 539, 539, 539, 539, 158,
+ 538, 38, 538, 539, 159, 539, 539, 540,
+ 541, 661, 160, 661, 539, 16, 16, 539,
+ 539, 539, 539, 158, 662, 38, 662, 539,
+ 159, 539, 539, 540, 663, 160, 539, 16,
+ 16, 539, 539, 539, 539, 158, 664, 21,
+ 664, 159, 529, 663, 160, 16, 16, 158,
+ 665, 21, 665, 543, 666, 543, 543, 545,
+ 160, 543, 16, 16, 543, 543, 543, 543,
+ 543, 158, 667, 162, 667, 185, 668, 186,
+ 16, 16, 184, 669, 21, 669, 185, 670,
+ 186, 16, 16, 184, 670, 21, 670, 671,
+ 185, 671, 671, 672, 673, 674, 675, 676,
+ 677, 678, 186, 672, 673, 674, 675, 676,
+ 677, 678, 671, 16, 16, 671, 671, 671,
+ 671, 671, 184, 679, 38, 679, 680, 185,
+ 680, 680, 681, 682, 186, 680, 16, 16,
+ 680, 680, 680, 680, 184, 683, 21, 683,
+ 185, 670, 682, 186, 16, 16, 184, 682,
+ 21, 682, 684, 685, 684, 684, 686, 186,
+ 684, 16, 16, 684, 684, 684, 684, 684,
+ 184, 687, 38, 687, 684, 185, 684, 684,
+ 681, 186, 684, 16, 16, 684, 684, 684,
+ 684, 184, 688, 188, 688, 51, 689, 52,
+ 16, 16, 47, 21, 185, 691, 186, 16,
+ 16, 16, 690, 690, 690, 184, 21, 185,
+ 693, 186, 694, 16, 16, 16, 692, 692,
+ 692, 184, 21, 185, 693, 186, 694, 16,
+ 16, 16, 695, 695, 695, 184, 21, 185,
+ 693, 186, 694, 16, 16, 16, 696, 696,
+ 696, 184, 21, 185, 693, 186, 694, 16,
+ 16, 16, 184, 21, 185, 698, 186, 16,
+ 16, 16, 697, 690, 690, 184, 21, 185,
+ 699, 693, 186, 694, 16, 16, 16, 700,
+ 692, 692, 184, 21, 185, 186, 16, 16,
+ 16, 701, 184, 21, 185, 702, 186, 16,
+ 16, 16, 703, 184, 21, 185, 186, 16,
+ 16, 16, 704, 184, 21, 185, 705, 186,
+ 16, 16, 16, 706, 184, 21, 185, 186,
+ 16, 16, 16, 707, 184, 21, 185, 186,
+ 694, 16, 16, 16, 708, 184, 21, 185,
+ 186, 694, 16, 16, 16, 709, 184, 21,
+ 185, 186, 694, 16, 16, 16, 184, 687,
+ 38, 687, 185, 681, 186, 16, 16, 184,
+ 21, 185, 705, 186, 16, 16, 16, 710,
+ 184, 21, 185, 705, 186, 16, 16, 16,
+ 184, 21, 185, 702, 186, 16, 16, 16,
+ 711, 184, 21, 185, 702, 186, 16, 16,
+ 16, 184, 21, 185, 699, 693, 186, 694,
+ 16, 16, 16, 712, 695, 695, 184, 21,
+ 185, 699, 693, 186, 694, 16, 16, 16,
+ 696, 696, 696, 184, 21, 185, 714, 186,
+ 694, 16, 16, 16, 713, 713, 713, 184,
+ 21, 185, 716, 186, 694, 16, 16, 16,
+ 715, 715, 715, 184, 21, 185, 716, 186,
+ 694, 16, 16, 16, 717, 717, 717, 184,
+ 21, 185, 716, 186, 694, 16, 16, 16,
+ 718, 718, 718, 184, 21, 185, 716, 186,
+ 694, 16, 16, 16, 184, 21, 185, 186,
+ 16, 16, 16, 719, 713, 713, 184, 21,
+ 185, 699, 716, 186, 694, 16, 16, 16,
+ 720, 715, 715, 184, 21, 185, 699, 716,
+ 186, 694, 16, 16, 16, 721, 717, 717,
+ 184, 21, 185, 699, 716, 186, 694, 16,
+ 16, 16, 718, 718, 718, 184, 21, 185,
+ 186, 16, 16, 16, 722, 184, 21, 185,
+ 699, 186, 16, 16, 16, 723, 184, 21,
+ 185, 699, 186, 16, 16, 16, 724, 184,
+ 21, 185, 699, 186, 16, 16, 16, 184,
+ 21, 185, 698, 186, 16, 16, 16, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 725, 186, 725, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 726, 186, 726,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 727, 186, 727, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 728, 186, 728,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 729, 186, 729, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 730, 186, 730,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 731, 186, 731, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 732, 186, 732,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 733, 38, 733, 680, 185, 680, 680, 681,
+ 734, 186, 680, 16, 16, 680, 680, 680,
+ 680, 184, 735, 21, 735, 185, 670, 734,
+ 186, 16, 16, 184, 734, 21, 734, 736,
+ 685, 736, 736, 686, 186, 736, 16, 16,
+ 736, 736, 736, 736, 736, 184, 737, 99,
+ 737, 738, 185, 738, 738, 739, 186, 738,
+ 16, 16, 738, 738, 738, 738, 184, 679,
+ 38, 679, 680, 185, 680, 680, 681, 682,
+ 740, 186, 740, 680, 16, 16, 680, 680,
+ 680, 680, 184, 679, 38, 679, 680, 185,
+ 680, 680, 681, 682, 741, 186, 741, 680,
+ 16, 16, 680, 680, 680, 680, 184, 679,
+ 38, 679, 680, 185, 680, 680, 681, 682,
+ 742, 186, 742, 680, 16, 16, 680, 680,
+ 680, 680, 184, 679, 38, 679, 680, 185,
+ 680, 680, 681, 682, 743, 186, 743, 680,
+ 16, 16, 680, 680, 680, 680, 184, 679,
+ 38, 679, 680, 185, 680, 680, 681, 682,
+ 744, 186, 744, 680, 16, 16, 680, 680,
+ 680, 680, 184, 745, 38, 745, 680, 185,
+ 680, 680, 681, 746, 186, 680, 16, 16,
+ 680, 680, 680, 680, 184, 747, 21, 747,
+ 185, 670, 746, 186, 16, 16, 184, 748,
+ 21, 748, 684, 749, 684, 684, 686, 186,
+ 684, 16, 16, 684, 684, 684, 684, 684,
+ 184, 750, 188, 750, 113, 751, 114, 16,
+ 16, 112, 679, 38, 679, 680, 185, 680,
+ 680, 681, 682, 752, 753, 186, 752, 753,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 754, 38, 754, 680, 185, 680, 680, 681,
+ 755, 186, 680, 16, 16, 680, 680, 680,
+ 680, 184, 756, 21, 756, 185, 670, 755,
+ 186, 16, 16, 184, 755, 21, 755, 684,
+ 685, 684, 684, 686, 186, 684, 16, 16,
+ 684, 684, 757, 684, 684, 757, 684, 184,
+ 687, 38, 687, 684, 185, 684, 684, 681,
+ 186, 684, 16, 16, 684, 758, 684, 684,
+ 758, 684, 184, 687, 38, 687, 684, 185,
+ 684, 684, 681, 186, 684, 16, 16, 684,
+ 759, 684, 684, 759, 684, 184, 687, 38,
+ 687, 684, 185, 684, 684, 681, 186, 684,
+ 16, 16, 684, 760, 684, 684, 760, 684,
+ 184, 687, 38, 687, 684, 185, 684, 684,
+ 681, 186, 684, 16, 16, 684, 761, 684,
+ 684, 761, 684, 184, 687, 38, 687, 684,
+ 185, 684, 684, 681, 186, 684, 16, 16,
+ 684, 762, 684, 684, 762, 684, 184, 687,
+ 38, 687, 684, 185, 684, 684, 681, 186,
+ 684, 16, 16, 684, 763, 684, 684, 763,
+ 684, 184, 687, 38, 687, 684, 185, 684,
+ 684, 681, 186, 684, 16, 16, 684, 764,
+ 684, 684, 764, 684, 184, 765, 132, 765,
+ 185, 766, 186, 16, 16, 184, 679, 38,
+ 679, 680, 185, 680, 680, 681, 682, 767,
+ 186, 767, 680, 16, 16, 680, 680, 680,
+ 680, 184, 679, 38, 679, 680, 185, 680,
+ 680, 681, 682, 768, 186, 768, 680, 16,
+ 16, 680, 680, 680, 680, 184, 679, 38,
+ 679, 680, 185, 680, 680, 681, 682, 769,
+ 186, 769, 680, 16, 16, 680, 680, 680,
+ 680, 184, 770, 38, 770, 680, 185, 680,
+ 680, 681, 771, 186, 680, 16, 16, 680,
+ 680, 680, 680, 184, 772, 21, 772, 185,
+ 670, 771, 186, 16, 16, 184, 773, 21,
+ 773, 684, 774, 684, 684, 686, 186, 684,
+ 16, 16, 684, 684, 684, 684, 684, 184,
+ 775, 188, 775, 143, 776, 144, 16, 16,
+ 142, 679, 38, 679, 680, 185, 680, 680,
+ 681, 682, 777, 186, 777, 680, 16, 16,
+ 680, 680, 680, 680, 184, 679, 38, 679,
+ 680, 185, 680, 680, 681, 682, 778, 186,
+ 778, 680, 16, 16, 680, 680, 680, 680,
+ 184, 679, 38, 679, 680, 185, 680, 680,
+ 681, 682, 779, 186, 779, 680, 16, 16,
+ 680, 680, 680, 680, 184, 679, 38, 679,
+ 680, 185, 680, 680, 681, 682, 780, 186,
+ 780, 680, 16, 16, 680, 680, 680, 680,
+ 184, 679, 38, 679, 680, 185, 680, 680,
+ 681, 682, 781, 186, 781, 680, 16, 16,
+ 680, 680, 680, 680, 184, 782, 38, 782,
+ 680, 185, 680, 680, 681, 783, 186, 680,
+ 16, 16, 680, 680, 680, 680, 184, 784,
+ 21, 784, 185, 670, 783, 186, 16, 16,
+ 184, 785, 21, 785, 684, 786, 684, 684,
+ 686, 186, 684, 16, 16, 684, 684, 684,
+ 684, 684, 184, 787, 188, 787, 159, 788,
+ 160, 16, 16, 158, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 789, 186, 789,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 790, 186, 790, 680, 16, 16, 680,
+ 680, 680, 680, 184, 791, 38, 791, 680,
+ 185, 680, 680, 681, 792, 186, 680, 16,
+ 16, 680, 680, 680, 680, 184, 793, 21,
+ 793, 185, 670, 792, 186, 16, 16, 184,
+ 792, 21, 792, 794, 685, 794, 794, 686,
+ 186, 794, 16, 16, 794, 794, 794, 794,
+ 794, 184, 795, 171, 795, 796, 185, 796,
+ 796, 797, 186, 796, 16, 16, 796, 796,
+ 796, 796, 184, 679, 38, 679, 680, 185,
+ 680, 680, 681, 682, 798, 186, 798, 680,
+ 16, 16, 680, 680, 680, 680, 184, 679,
+ 38, 679, 680, 185, 680, 680, 681, 682,
+ 799, 800, 186, 799, 800, 680, 16, 16,
+ 680, 680, 680, 680, 184, 679, 38, 679,
+ 680, 185, 680, 680, 681, 682, 801, 186,
+ 801, 680, 16, 16, 680, 680, 680, 680,
+ 184, 679, 38, 679, 680, 185, 680, 680,
+ 681, 682, 802, 186, 802, 680, 16, 16,
+ 680, 680, 680, 680, 184, 803, 38, 803,
+ 680, 185, 680, 680, 681, 804, 186, 680,
+ 16, 16, 680, 680, 680, 680, 184, 805,
+ 21, 805, 185, 670, 804, 186, 16, 16,
+ 184, 806, 21, 806, 684, 807, 684, 684,
+ 686, 186, 684, 16, 16, 684, 684, 684,
+ 684, 684, 184, 808, 188, 808, 185, 809,
+ 186, 16, 16, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 810, 186, 810,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 811, 186, 811, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 812, 186, 812,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 813, 186, 813, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 814, 186, 814,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 815, 38, 815, 680, 185, 680, 680, 681,
+ 816, 186, 680, 16, 16, 680, 680, 680,
+ 680, 184, 817, 21, 817, 185, 670, 816,
+ 186, 16, 16, 184, 818, 21, 818, 684,
+ 819, 684, 684, 686, 186, 684, 16, 16,
+ 684, 684, 684, 684, 684, 184, 820, 188,
+ 820, 201, 821, 202, 16, 16, 200, 822,
+ 21, 822, 201, 823, 202, 16, 16, 200,
+ 823, 21, 823, 824, 201, 824, 824, 825,
+ 826, 827, 828, 829, 830, 831, 202, 825,
+ 826, 827, 828, 829, 830, 831, 824, 16,
+ 16, 824, 824, 824, 824, 824, 200, 832,
+ 38, 832, 833, 201, 833, 833, 834, 835,
+ 202, 833, 16, 16, 833, 833, 833, 833,
+ 200, 836, 21, 836, 201, 823, 835, 202,
+ 16, 16, 200, 835, 21, 835, 837, 838,
+ 837, 837, 839, 202, 837, 16, 16, 837,
+ 837, 837, 837, 837, 200, 840, 38, 840,
+ 837, 201, 837, 837, 834, 202, 837, 16,
+ 16, 837, 837, 837, 837, 200, 841, 204,
+ 841, 51, 842, 52, 16, 16, 47, 21,
+ 201, 844, 202, 16, 16, 16, 843, 843,
+ 843, 200, 21, 201, 846, 202, 847, 16,
+ 16, 16, 845, 845, 845, 200, 21, 201,
+ 846, 202, 847, 16, 16, 16, 848, 848,
+ 848, 200, 21, 201, 846, 202, 847, 16,
+ 16, 16, 849, 849, 849, 200, 21, 201,
+ 846, 202, 847, 16, 16, 16, 200, 21,
+ 201, 851, 202, 16, 16, 16, 850, 843,
+ 843, 200, 21, 201, 852, 846, 202, 847,
+ 16, 16, 16, 853, 845, 845, 200, 21,
+ 201, 202, 16, 16, 16, 854, 200, 21,
+ 201, 855, 202, 16, 16, 16, 856, 200,
+ 21, 201, 202, 16, 16, 16, 857, 200,
+ 21, 201, 858, 202, 16, 16, 16, 859,
+ 200, 21, 201, 202, 16, 16, 16, 860,
+ 200, 21, 201, 202, 847, 16, 16, 16,
+ 861, 200, 21, 201, 202, 847, 16, 16,
+ 16, 862, 200, 21, 201, 202, 847, 16,
+ 16, 16, 200, 840, 38, 840, 201, 834,
+ 202, 16, 16, 200, 21, 201, 858, 202,
+ 16, 16, 16, 863, 200, 21, 201, 858,
+ 202, 16, 16, 16, 200, 21, 201, 855,
+ 202, 16, 16, 16, 864, 200, 21, 201,
+ 855, 202, 16, 16, 16, 200, 21, 201,
+ 852, 846, 202, 847, 16, 16, 16, 865,
+ 848, 848, 200, 21, 201, 852, 846, 202,
+ 847, 16, 16, 16, 849, 849, 849, 200,
+ 21, 201, 867, 202, 847, 16, 16, 16,
+ 866, 866, 866, 200, 21, 201, 869, 202,
+ 847, 16, 16, 16, 868, 868, 868, 200,
+ 21, 201, 869, 202, 847, 16, 16, 16,
+ 870, 870, 870, 200, 21, 201, 869, 202,
+ 847, 16, 16, 16, 871, 871, 871, 200,
+ 21, 201, 869, 202, 847, 16, 16, 16,
+ 200, 21, 201, 202, 16, 16, 16, 872,
+ 866, 866, 200, 21, 201, 852, 869, 202,
+ 847, 16, 16, 16, 873, 868, 868, 200,
+ 21, 201, 852, 869, 202, 847, 16, 16,
+ 16, 874, 870, 870, 200, 21, 201, 852,
+ 869, 202, 847, 16, 16, 16, 871, 871,
+ 871, 200, 21, 201, 202, 16, 16, 16,
+ 875, 200, 21, 201, 852, 202, 16, 16,
+ 16, 876, 200, 21, 201, 852, 202, 16,
+ 16, 16, 877, 200, 21, 201, 852, 202,
+ 16, 16, 16, 200, 21, 201, 851, 202,
+ 16, 16, 16, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 878, 202, 878,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 879, 202, 879, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 880, 202, 880,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 881, 202, 881, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 882, 202, 882,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 883, 202, 883, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 884, 202, 884,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 885, 202, 885, 833, 16, 16, 833,
+ 833, 833, 833, 200, 886, 38, 886, 833,
+ 201, 833, 833, 834, 887, 202, 833, 16,
+ 16, 833, 833, 833, 833, 200, 888, 21,
+ 888, 201, 823, 887, 202, 16, 16, 200,
+ 887, 21, 887, 889, 838, 889, 889, 839,
+ 202, 889, 16, 16, 889, 889, 889, 889,
+ 889, 200, 890, 99, 890, 891, 201, 891,
+ 891, 892, 202, 891, 16, 16, 891, 891,
+ 891, 891, 200, 832, 38, 832, 833, 201,
+ 833, 833, 834, 835, 893, 202, 893, 833,
+ 16, 16, 833, 833, 833, 833, 200, 832,
+ 38, 832, 833, 201, 833, 833, 834, 835,
+ 894, 202, 894, 833, 16, 16, 833, 833,
+ 833, 833, 200, 832, 38, 832, 833, 201,
+ 833, 833, 834, 835, 895, 202, 895, 833,
+ 16, 16, 833, 833, 833, 833, 200, 832,
+ 38, 832, 833, 201, 833, 833, 834, 835,
+ 896, 202, 896, 833, 16, 16, 833, 833,
+ 833, 833, 200, 832, 38, 832, 833, 201,
+ 833, 833, 834, 835, 897, 202, 897, 833,
+ 16, 16, 833, 833, 833, 833, 200, 898,
+ 38, 898, 833, 201, 833, 833, 834, 899,
+ 202, 833, 16, 16, 833, 833, 833, 833,
+ 200, 900, 21, 900, 201, 823, 899, 202,
+ 16, 16, 200, 901, 21, 901, 837, 902,
+ 837, 837, 839, 202, 837, 16, 16, 837,
+ 837, 837, 837, 837, 200, 903, 204, 903,
+ 113, 904, 114, 16, 16, 112, 832, 38,
+ 832, 833, 201, 833, 833, 834, 835, 905,
+ 906, 202, 905, 906, 833, 16, 16, 833,
+ 833, 833, 833, 200, 907, 38, 907, 833,
+ 201, 833, 833, 834, 908, 202, 833, 16,
+ 16, 833, 833, 833, 833, 200, 909, 21,
+ 909, 201, 823, 908, 202, 16, 16, 200,
+ 908, 21, 908, 837, 838, 837, 837, 839,
+ 202, 837, 16, 16, 837, 837, 910, 837,
+ 837, 910, 837, 200, 840, 38, 840, 837,
+ 201, 837, 837, 834, 202, 837, 16, 16,
+ 837, 911, 837, 837, 911, 837, 200, 840,
+ 38, 840, 837, 201, 837, 837, 834, 202,
+ 837, 16, 16, 837, 912, 837, 837, 912,
+ 837, 200, 840, 38, 840, 837, 201, 837,
+ 837, 834, 202, 837, 16, 16, 837, 913,
+ 837, 837, 913, 837, 200, 840, 38, 840,
+ 837, 201, 837, 837, 834, 202, 837, 16,
+ 16, 837, 914, 837, 837, 914, 837, 200,
+ 840, 38, 840, 837, 201, 837, 837, 834,
+ 202, 837, 16, 16, 837, 915, 837, 837,
+ 915, 837, 200, 840, 38, 840, 837, 201,
+ 837, 837, 834, 202, 837, 16, 16, 837,
+ 916, 837, 837, 916, 837, 200, 840, 38,
+ 840, 837, 201, 837, 837, 834, 202, 837,
+ 16, 16, 837, 917, 837, 837, 917, 837,
+ 200, 918, 132, 918, 201, 919, 202, 16,
+ 16, 200, 832, 38, 832, 833, 201, 833,
+ 833, 834, 835, 920, 202, 920, 833, 16,
+ 16, 833, 833, 833, 833, 200, 832, 38,
+ 832, 833, 201, 833, 833, 834, 835, 921,
+ 202, 921, 833, 16, 16, 833, 833, 833,
+ 833, 200, 832, 38, 832, 833, 201, 833,
+ 833, 834, 835, 922, 202, 922, 833, 16,
+ 16, 833, 833, 833, 833, 200, 923, 38,
+ 923, 833, 201, 833, 833, 834, 924, 202,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 925, 21, 925, 201, 823, 924, 202, 16,
+ 16, 200, 926, 21, 926, 837, 927, 837,
+ 837, 839, 202, 837, 16, 16, 837, 837,
+ 837, 837, 837, 200, 928, 204, 928, 143,
+ 929, 144, 16, 16, 142, 832, 38, 832,
+ 833, 201, 833, 833, 834, 835, 930, 202,
+ 930, 833, 16, 16, 833, 833, 833, 833,
+ 200, 832, 38, 832, 833, 201, 833, 833,
+ 834, 835, 931, 202, 931, 833, 16, 16,
+ 833, 833, 833, 833, 200, 832, 38, 832,
+ 833, 201, 833, 833, 834, 835, 932, 202,
+ 932, 833, 16, 16, 833, 833, 833, 833,
+ 200, 832, 38, 832, 833, 201, 833, 833,
+ 834, 835, 933, 202, 933, 833, 16, 16,
+ 833, 833, 833, 833, 200, 832, 38, 832,
+ 833, 201, 833, 833, 834, 835, 934, 202,
+ 934, 833, 16, 16, 833, 833, 833, 833,
+ 200, 935, 38, 935, 833, 201, 833, 833,
+ 834, 936, 202, 833, 16, 16, 833, 833,
+ 833, 833, 200, 937, 21, 937, 201, 823,
+ 936, 202, 16, 16, 200, 938, 21, 938,
+ 837, 939, 837, 837, 839, 202, 837, 16,
+ 16, 837, 837, 837, 837, 837, 200, 940,
+ 204, 940, 159, 941, 160, 16, 16, 158,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 942, 202, 942, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 943, 202, 943,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 944, 38, 944, 833, 201, 833, 833, 834,
+ 945, 202, 833, 16, 16, 833, 833, 833,
+ 833, 200, 946, 21, 946, 201, 823, 945,
+ 202, 16, 16, 200, 945, 21, 945, 947,
+ 838, 947, 947, 839, 202, 947, 16, 16,
+ 947, 947, 947, 947, 947, 200, 948, 171,
+ 948, 949, 201, 949, 949, 950, 202, 949,
+ 16, 16, 949, 949, 949, 949, 200, 832,
+ 38, 832, 833, 201, 833, 833, 834, 835,
+ 951, 202, 951, 833, 16, 16, 833, 833,
+ 833, 833, 200, 832, 38, 832, 833, 201,
+ 833, 833, 834, 835, 952, 953, 202, 952,
+ 953, 833, 16, 16, 833, 833, 833, 833,
+ 200, 832, 38, 832, 833, 201, 833, 833,
+ 834, 835, 954, 202, 954, 833, 16, 16,
+ 833, 833, 833, 833, 200, 832, 38, 832,
+ 833, 201, 833, 833, 834, 835, 955, 202,
+ 955, 833, 16, 16, 833, 833, 833, 833,
+ 200, 956, 38, 956, 833, 201, 833, 833,
+ 834, 957, 202, 833, 16, 16, 833, 833,
+ 833, 833, 200, 958, 21, 958, 201, 823,
+ 957, 202, 16, 16, 200, 959, 21, 959,
+ 837, 960, 837, 837, 839, 202, 837, 16,
+ 16, 837, 837, 837, 837, 837, 200, 961,
+ 204, 961, 185, 962, 186, 16, 16, 184,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 963, 202, 963, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 964, 202, 964,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 965, 202, 965, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 966, 202, 966,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 967, 202, 967, 833, 16, 16, 833,
+ 833, 833, 833, 200, 968, 38, 968, 833,
+ 201, 833, 833, 834, 969, 202, 833, 16,
+ 16, 833, 833, 833, 833, 200, 970, 21,
+ 970, 201, 823, 969, 202, 16, 16, 200,
+ 971, 21, 971, 837, 972, 837, 837, 839,
+ 202, 837, 16, 16, 837, 837, 837, 837,
+ 837, 200, 973, 204, 973, 201, 974, 202,
+ 16, 16, 200, 832, 38, 832, 833, 201,
+ 833, 833, 834, 835, 975, 976, 202, 975,
+ 976, 833, 16, 16, 833, 833, 833, 833,
+ 200, 832, 38, 832, 833, 201, 833, 833,
+ 834, 835, 977, 202, 977, 833, 16, 16,
+ 833, 833, 833, 833, 200, 978, 38, 978,
+ 833, 201, 833, 833, 834, 979, 202, 833,
+ 16, 16, 833, 833, 833, 833, 200, 980,
+ 21, 980, 201, 823, 979, 202, 16, 16,
+ 200, 979, 21, 979, 837, 981, 837, 837,
+ 839, 202, 837, 16, 16, 837, 837, 837,
+ 837, 837, 200, 982, 204, 982, 215, 983,
+ 216, 214, 214, 213, 984, 21, 984, 219,
+ 985, 220, 218, 218, 217, 985, 21, 985,
+ 986, 219, 986, 986, 987, 988, 989, 990,
+ 991, 992, 993, 220, 987, 988, 989, 990,
+ 991, 992, 993, 986, 218, 218, 986, 986,
+ 986, 986, 986, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 220, 995, 218,
+ 218, 995, 995, 995, 995, 217, 998, 21,
+ 998, 219, 985, 997, 220, 218, 218, 217,
+ 997, 21, 997, 999, 221, 999, 999, 1000,
+ 220, 999, 218, 218, 999, 999, 999, 999,
+ 999, 217, 1001, 38, 1001, 999, 219, 999,
+ 999, 996, 220, 999, 218, 218, 999, 999,
+ 999, 999, 217, 21, 219, 1003, 220, 218,
+ 218, 218, 1002, 1002, 1002, 217, 21, 219,
+ 1005, 220, 1006, 218, 218, 218, 1004, 1004,
+ 1004, 217, 21, 219, 1005, 220, 1006, 218,
+ 218, 218, 1007, 1007, 1007, 217, 21, 219,
+ 1005, 220, 1006, 218, 218, 218, 1008, 1008,
+ 1008, 217, 21, 219, 1005, 220, 1006, 218,
+ 218, 218, 217, 21, 219, 1010, 220, 218,
+ 218, 218, 1009, 1002, 1002, 217, 21, 219,
+ 1011, 1005, 220, 1006, 218, 218, 218, 1012,
+ 1004, 1004, 217, 21, 219, 220, 218, 218,
+ 218, 1013, 217, 21, 219, 1014, 220, 218,
+ 218, 218, 1015, 217, 21, 219, 220, 218,
+ 218, 218, 1016, 217, 21, 219, 1017, 220,
+ 218, 218, 218, 1018, 217, 21, 219, 220,
+ 218, 218, 218, 1019, 217, 21, 219, 220,
+ 1006, 218, 218, 218, 1020, 217, 21, 219,
+ 220, 1006, 218, 218, 218, 1021, 217, 21,
+ 219, 220, 1006, 218, 218, 218, 217, 1001,
+ 38, 1001, 219, 996, 220, 218, 218, 217,
+ 21, 219, 1017, 220, 218, 218, 218, 1022,
+ 217, 21, 219, 1017, 220, 218, 218, 218,
+ 217, 21, 219, 1014, 220, 218, 218, 218,
+ 1023, 217, 21, 219, 1014, 220, 218, 218,
+ 218, 217, 21, 219, 1011, 1005, 220, 1006,
+ 218, 218, 218, 1024, 1007, 1007, 217, 21,
+ 219, 1011, 1005, 220, 1006, 218, 218, 218,
+ 1008, 1008, 1008, 217, 21, 219, 1026, 220,
+ 1006, 218, 218, 218, 1025, 1025, 1025, 217,
+ 21, 219, 1028, 220, 1006, 218, 218, 218,
+ 1027, 1027, 1027, 217, 21, 219, 1028, 220,
+ 1006, 218, 218, 218, 1029, 1029, 1029, 217,
+ 21, 219, 1028, 220, 1006, 218, 218, 218,
+ 1030, 1030, 1030, 217, 21, 219, 1028, 220,
+ 1006, 218, 218, 218, 217, 21, 219, 220,
+ 218, 218, 218, 1031, 1025, 1025, 217, 21,
+ 219, 1011, 1028, 220, 1006, 218, 218, 218,
+ 1032, 1027, 1027, 217, 21, 219, 1011, 1028,
+ 220, 1006, 218, 218, 218, 1033, 1029, 1029,
+ 217, 21, 219, 1011, 1028, 220, 1006, 218,
+ 218, 218, 1030, 1030, 1030, 217, 21, 219,
+ 220, 218, 218, 218, 1034, 217, 21, 219,
+ 1011, 220, 218, 218, 218, 1035, 217, 21,
+ 219, 1011, 220, 218, 218, 218, 1036, 217,
+ 21, 219, 1011, 220, 218, 218, 218, 217,
+ 21, 219, 1010, 220, 218, 218, 218, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1037, 220, 1037, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1038, 220, 1038,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1039, 220, 1039, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1040, 220, 1040,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1041, 220, 1041, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1042, 220, 1042,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1043, 220, 1043, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1044, 220, 1044,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 1045, 38, 1045, 995, 219, 995, 995, 996,
+ 1046, 220, 995, 218, 218, 995, 995, 995,
+ 995, 217, 1047, 21, 1047, 219, 985, 1046,
+ 220, 218, 218, 217, 1046, 21, 1046, 1048,
+ 221, 1048, 1048, 1000, 220, 1048, 218, 218,
+ 1048, 1048, 1048, 1048, 1048, 217, 1049, 99,
+ 1049, 1050, 219, 1050, 1050, 1051, 220, 1050,
+ 218, 218, 1050, 1050, 1050, 1050, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1052, 220, 1052, 995, 218, 218, 995, 995,
+ 995, 995, 217, 994, 38, 994, 995, 219,
+ 995, 995, 996, 997, 1053, 220, 1053, 995,
+ 218, 218, 995, 995, 995, 995, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1054, 220, 1054, 995, 218, 218, 995, 995,
+ 995, 995, 217, 994, 38, 994, 995, 219,
+ 995, 995, 996, 997, 1055, 220, 1055, 995,
+ 218, 218, 995, 995, 995, 995, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1056, 220, 1056, 995, 218, 218, 995, 995,
+ 995, 995, 217, 1057, 38, 1057, 995, 219,
+ 995, 995, 996, 1058, 220, 995, 218, 218,
+ 995, 995, 995, 995, 217, 1059, 21, 1059,
+ 219, 985, 1058, 220, 218, 218, 217, 1060,
+ 21, 1060, 999, 1061, 999, 999, 1000, 220,
+ 999, 218, 218, 999, 999, 999, 999, 999,
+ 217, 994, 38, 994, 995, 219, 995, 995,
+ 996, 997, 1062, 1063, 220, 1062, 1063, 995,
+ 218, 218, 995, 995, 995, 995, 217, 1064,
+ 38, 1064, 995, 219, 995, 995, 996, 1065,
+ 220, 995, 218, 218, 995, 995, 995, 995,
+ 217, 1066, 21, 1066, 219, 985, 1065, 220,
+ 218, 218, 217, 1065, 21, 1065, 999, 221,
+ 999, 999, 1000, 220, 999, 218, 218, 999,
+ 999, 1067, 999, 999, 1067, 999, 217, 1001,
+ 38, 1001, 999, 219, 999, 999, 996, 220,
+ 999, 218, 218, 999, 1068, 999, 999, 1068,
+ 999, 217, 1001, 38, 1001, 999, 219, 999,
+ 999, 996, 220, 999, 218, 218, 999, 1069,
+ 999, 999, 1069, 999, 217, 1001, 38, 1001,
+ 999, 219, 999, 999, 996, 220, 999, 218,
+ 218, 999, 1070, 999, 999, 1070, 999, 217,
+ 1001, 38, 1001, 999, 219, 999, 999, 996,
+ 220, 999, 218, 218, 999, 1071, 999, 999,
+ 1071, 999, 217, 1001, 38, 1001, 999, 219,
+ 999, 999, 996, 220, 999, 218, 218, 999,
+ 1072, 999, 999, 1072, 999, 217, 1001, 38,
+ 1001, 999, 219, 999, 999, 996, 220, 999,
+ 218, 218, 999, 1073, 999, 999, 1073, 999,
+ 217, 1001, 38, 1001, 999, 219, 999, 999,
+ 996, 220, 999, 218, 218, 999, 1074, 999,
+ 999, 1074, 999, 217, 1075, 132, 1075, 219,
+ 1076, 220, 218, 218, 217, 994, 38, 994,
+ 995, 219, 995, 995, 996, 997, 1077, 220,
+ 1077, 995, 218, 218, 995, 995, 995, 995,
+ 217, 994, 38, 994, 995, 219, 995, 995,
+ 996, 997, 1078, 220, 1078, 995, 218, 218,
+ 995, 995, 995, 995, 217, 994, 38, 994,
+ 995, 219, 995, 995, 996, 997, 1079, 220,
+ 1079, 995, 218, 218, 995, 995, 995, 995,
+ 217, 1080, 38, 1080, 995, 219, 995, 995,
+ 996, 1081, 220, 995, 218, 218, 995, 995,
+ 995, 995, 217, 1082, 21, 1082, 219, 985,
+ 1081, 220, 218, 218, 217, 1083, 21, 1083,
+ 999, 1084, 999, 999, 1000, 220, 999, 218,
+ 218, 999, 999, 999, 999, 999, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1085, 220, 1085, 995, 218, 218, 995, 995,
+ 995, 995, 217, 994, 38, 994, 995, 219,
+ 995, 995, 996, 997, 1086, 220, 1086, 995,
+ 218, 218, 995, 995, 995, 995, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1087, 220, 1087, 995, 218, 218, 995, 995,
+ 995, 995, 217, 994, 38, 994, 995, 219,
+ 995, 995, 996, 997, 1088, 220, 1088, 995,
+ 218, 218, 995, 995, 995, 995, 217, 994,
+ 38, 994, 995, 219, 995, 995, 996, 997,
+ 1089, 220, 1089, 995, 218, 218, 995, 995,
+ 995, 995, 217, 1090, 38, 1090, 995, 219,
+ 995, 995, 996, 1091, 220, 995, 218, 218,
+ 995, 995, 995, 995, 217, 1092, 21, 1092,
+ 219, 985, 1091, 220, 218, 218, 217, 1093,
+ 21, 1093, 999, 1094, 999, 999, 1000, 220,
+ 999, 218, 218, 999, 999, 999, 999, 999,
+ 217, 994, 38, 994, 995, 219, 995, 995,
+ 996, 997, 1095, 220, 1095, 995, 218, 218,
+ 995, 995, 995, 995, 217, 994, 38, 994,
+ 995, 219, 995, 995, 996, 997, 1096, 220,
+ 1096, 995, 218, 218, 995, 995, 995, 995,
+ 217, 1097, 38, 1097, 995, 219, 995, 995,
+ 996, 1098, 220, 995, 218, 218, 995, 995,
+ 995, 995, 217, 1099, 21, 1099, 219, 985,
+ 1098, 220, 218, 218, 217, 1098, 21, 1098,
+ 1100, 221, 1100, 1100, 1000, 220, 1100, 218,
+ 218, 1100, 1100, 1100, 1100, 1100, 217, 1101,
+ 171, 1101, 1102, 219, 1102, 1102, 1103, 220,
+ 1102, 218, 218, 1102, 1102, 1102, 1102, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1104, 220, 1104, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1105, 1106, 220,
+ 1105, 1106, 995, 218, 218, 995, 995, 995,
+ 995, 217, 994, 38, 994, 995, 219, 995,
+ 995, 996, 997, 1107, 220, 1107, 995, 218,
+ 218, 995, 995, 995, 995, 217, 994, 38,
+ 994, 995, 219, 995, 995, 996, 997, 1108,
+ 220, 1108, 995, 218, 218, 995, 995, 995,
+ 995, 217, 1109, 38, 1109, 995, 219, 995,
+ 995, 996, 1110, 220, 995, 218, 218, 995,
+ 995, 995, 995, 217, 1111, 21, 1111, 219,
+ 985, 1110, 220, 218, 218, 217, 1112, 21,
+ 1112, 999, 1113, 999, 999, 1000, 220, 999,
+ 218, 218, 999, 999, 999, 999, 999, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1114, 220, 1114, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1115, 220, 1115,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1116, 220, 1116, 995, 218, 218, 995,
+ 995, 995, 995, 217, 994, 38, 994, 995,
+ 219, 995, 995, 996, 997, 1117, 220, 1117,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1118, 220, 1118, 995, 218, 218, 995,
+ 995, 995, 995, 217, 1119, 38, 1119, 995,
+ 219, 995, 995, 996, 1120, 220, 995, 218,
+ 218, 995, 995, 995, 995, 217, 1121, 21,
+ 1121, 219, 985, 1120, 220, 218, 218, 217,
+ 1122, 21, 1122, 999, 1123, 999, 999, 1000,
+ 220, 999, 218, 218, 999, 999, 999, 999,
+ 999, 217, 994, 38, 994, 995, 219, 995,
+ 995, 996, 997, 1124, 1125, 220, 1124, 1125,
+ 995, 218, 218, 995, 995, 995, 995, 217,
+ 994, 38, 994, 995, 219, 995, 995, 996,
+ 997, 1126, 220, 1126, 995, 218, 218, 995,
+ 995, 995, 995, 217, 1127, 38, 1127, 995,
+ 219, 995, 995, 996, 1128, 220, 995, 218,
+ 218, 995, 995, 995, 995, 217, 1129, 21,
+ 1129, 219, 985, 1128, 220, 218, 218, 217,
+ 1128, 21, 1128, 999, 219, 999, 999, 1000,
+ 220, 999, 218, 218, 999, 999, 999, 999,
+ 999, 217, 994, 38, 994, 995, 219, 995,
+ 995, 996, 997, 1130, 220, 1130, 995, 218,
+ 218, 995, 995, 995, 995, 217, 994, 38,
+ 994, 995, 219, 995, 995, 996, 997, 1131,
+ 220, 1131, 995, 218, 218, 995, 995, 995,
+ 995, 217, 994, 38, 994, 995, 219, 995,
+ 995, 996, 997, 1132, 220, 1132, 995, 218,
+ 218, 995, 995, 995, 995, 217, 994, 38,
+ 994, 995, 219, 995, 995, 996, 997, 1133,
+ 220, 1133, 995, 218, 218, 995, 995, 995,
+ 995, 217, 994, 38, 994, 995, 219, 995,
+ 995, 996, 997, 1134, 220, 1134, 995, 218,
+ 218, 995, 995, 995, 995, 217, 994, 38,
+ 994, 995, 219, 995, 995, 996, 997, 1135,
+ 220, 1135, 995, 218, 218, 995, 995, 995,
+ 995, 217, 1136, 38, 1136, 995, 219, 995,
+ 995, 996, 1137, 220, 995, 218, 218, 995,
+ 995, 995, 995, 217, 1138, 21, 1138, 219,
+ 985, 1137, 220, 218, 218, 217, 1139, 21,
+ 1139, 999, 1140, 999, 999, 1000, 220, 999,
+ 218, 218, 999, 999, 999, 999, 999, 217,
+ 1142, 21, 1142, 1143, 1144, 1145, 16, 16,
+ 1141, 21, 1143, 1145, 16, 16, 16, 1141,
+ 1146, 1147, 1146, 1148, 16, 21, 1141, 1141,
+ 16, 1144, 21, 1144, 1149, 1143, 1149, 1149,
+ 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1145,
+ 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1149,
+ 16, 16, 1149, 1149, 1149, 1149, 1149, 1141,
+ 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
+ 1160, 1145, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1161, 21, 1161, 1143, 1144, 1160,
+ 1145, 16, 16, 1141, 1160, 21, 1160, 1162,
+ 1163, 1162, 1162, 1164, 1145, 1162, 16, 16,
+ 1162, 1162, 1162, 1162, 1162, 1141, 1165, 38,
+ 1165, 1162, 1143, 1162, 1162, 1159, 1145, 1162,
+ 16, 16, 1162, 1162, 1162, 1162, 1141, 1166,
+ 1147, 1166, 51, 1167, 52, 16, 16, 47,
+ 21, 1143, 1169, 1145, 16, 16, 16, 1168,
+ 1168, 1168, 1141, 21, 1143, 1171, 1145, 1172,
+ 16, 16, 16, 1170, 1170, 1170, 1141, 21,
+ 1143, 1171, 1145, 1172, 16, 16, 16, 1173,
+ 1173, 1173, 1141, 21, 1143, 1171, 1145, 1172,
+ 16, 16, 16, 1174, 1174, 1174, 1141, 21,
+ 1143, 1171, 1145, 1172, 16, 16, 16, 1141,
+ 21, 1143, 1176, 1145, 16, 16, 16, 1175,
+ 1168, 1168, 1141, 21, 1143, 1177, 1171, 1145,
+ 1172, 16, 16, 16, 1178, 1170, 1170, 1141,
+ 21, 1143, 1145, 16, 16, 16, 1179, 1141,
+ 21, 1143, 1180, 1145, 16, 16, 16, 1181,
+ 1141, 21, 1143, 1145, 16, 16, 16, 1182,
+ 1141, 21, 1143, 1183, 1145, 16, 16, 16,
+ 1184, 1141, 21, 1143, 1145, 16, 16, 16,
+ 1185, 1141, 21, 1143, 1145, 1172, 16, 16,
+ 16, 1186, 1141, 21, 1143, 1145, 1172, 16,
+ 16, 16, 1187, 1141, 21, 1143, 1145, 1172,
+ 16, 16, 16, 1141, 1165, 38, 1165, 1143,
+ 1159, 1145, 16, 16, 1141, 21, 1143, 1183,
+ 1145, 16, 16, 16, 1188, 1141, 21, 1143,
+ 1183, 1145, 16, 16, 16, 1141, 21, 1143,
+ 1180, 1145, 16, 16, 16, 1189, 1141, 21,
+ 1143, 1180, 1145, 16, 16, 16, 1141, 21,
+ 1143, 1177, 1171, 1145, 1172, 16, 16, 16,
+ 1190, 1173, 1173, 1141, 21, 1143, 1177, 1171,
+ 1145, 1172, 16, 16, 16, 1174, 1174, 1174,
+ 1141, 21, 1143, 1192, 1145, 1172, 16, 16,
+ 16, 1191, 1191, 1191, 1141, 21, 1143, 1194,
+ 1145, 1172, 16, 16, 16, 1193, 1193, 1193,
+ 1141, 21, 1143, 1194, 1145, 1172, 16, 16,
+ 16, 1195, 1195, 1195, 1141, 21, 1143, 1194,
+ 1145, 1172, 16, 16, 16, 1196, 1196, 1196,
+ 1141, 21, 1143, 1194, 1145, 1172, 16, 16,
+ 16, 1141, 21, 1143, 1145, 16, 16, 16,
+ 1197, 1191, 1191, 1141, 21, 1143, 1177, 1194,
+ 1145, 1172, 16, 16, 16, 1198, 1193, 1193,
+ 1141, 21, 1143, 1177, 1194, 1145, 1172, 16,
+ 16, 16, 1199, 1195, 1195, 1141, 21, 1143,
+ 1177, 1194, 1145, 1172, 16, 16, 16, 1196,
+ 1196, 1196, 1141, 21, 1143, 1145, 16, 16,
+ 16, 1200, 1141, 21, 1143, 1177, 1145, 16,
+ 16, 16, 1201, 1141, 21, 1143, 1177, 1145,
+ 16, 16, 16, 1202, 1141, 21, 1143, 1177,
+ 1145, 16, 16, 16, 1141, 21, 1143, 1176,
+ 1145, 16, 16, 16, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1203, 1145,
+ 1203, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1204, 1145, 1204, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1205, 1145,
+ 1205, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1206, 1145, 1206, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1207, 1145,
+ 1207, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1208, 1145, 1208, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1209, 1145,
+ 1209, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1210, 1145, 1210, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1211, 38, 1211,
+ 1158, 1143, 1158, 1158, 1159, 1212, 1145, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1213,
+ 21, 1213, 1143, 1144, 1212, 1145, 16, 16,
+ 1141, 1212, 21, 1212, 1214, 1163, 1214, 1214,
+ 1164, 1145, 1214, 16, 16, 1214, 1214, 1214,
+ 1214, 1214, 1141, 1215, 99, 1215, 1216, 1143,
+ 1216, 1216, 1217, 1145, 1216, 16, 16, 1216,
+ 1216, 1216, 1216, 1141, 1157, 38, 1157, 1158,
+ 1143, 1158, 1158, 1159, 1160, 1218, 1145, 1218,
+ 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
+ 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
+ 1160, 1219, 1145, 1219, 1158, 16, 16, 1158,
+ 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
+ 1143, 1158, 1158, 1159, 1160, 1220, 1145, 1220,
+ 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
+ 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
+ 1160, 1221, 1145, 1221, 1158, 16, 16, 1158,
+ 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
+ 1143, 1158, 1158, 1159, 1160, 1222, 1145, 1222,
+ 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
+ 1223, 38, 1223, 1158, 1143, 1158, 1158, 1159,
+ 1224, 1145, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1225, 21, 1225, 1143, 1144, 1224,
+ 1145, 16, 16, 1141, 1226, 21, 1226, 1162,
+ 1227, 1162, 1162, 1164, 1145, 1162, 16, 16,
+ 1162, 1162, 1162, 1162, 1162, 1141, 1228, 1147,
+ 1228, 113, 1229, 114, 16, 16, 112, 1157,
+ 38, 1157, 1158, 1143, 1158, 1158, 1159, 1160,
+ 1230, 1231, 1145, 1230, 1231, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1232, 38, 1232,
+ 1158, 1143, 1158, 1158, 1159, 1233, 1145, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1234,
+ 21, 1234, 1143, 1144, 1233, 1145, 16, 16,
+ 1141, 1233, 21, 1233, 1162, 1163, 1162, 1162,
+ 1164, 1145, 1162, 16, 16, 1162, 1162, 1235,
+ 1162, 1162, 1235, 1162, 1141, 1165, 38, 1165,
+ 1162, 1143, 1162, 1162, 1159, 1145, 1162, 16,
+ 16, 1162, 1236, 1162, 1162, 1236, 1162, 1141,
+ 1165, 38, 1165, 1162, 1143, 1162, 1162, 1159,
+ 1145, 1162, 16, 16, 1162, 1237, 1162, 1162,
+ 1237, 1162, 1141, 1165, 38, 1165, 1162, 1143,
+ 1162, 1162, 1159, 1145, 1162, 16, 16, 1162,
+ 1238, 1162, 1162, 1238, 1162, 1141, 1165, 38,
+ 1165, 1162, 1143, 1162, 1162, 1159, 1145, 1162,
+ 16, 16, 1162, 1239, 1162, 1162, 1239, 1162,
+ 1141, 1165, 38, 1165, 1162, 1143, 1162, 1162,
+ 1159, 1145, 1162, 16, 16, 1162, 1240, 1162,
+ 1162, 1240, 1162, 1141, 1165, 38, 1165, 1162,
+ 1143, 1162, 1162, 1159, 1145, 1162, 16, 16,
+ 1162, 1241, 1162, 1162, 1241, 1162, 1141, 1165,
+ 38, 1165, 1162, 1143, 1162, 1162, 1159, 1145,
+ 1162, 16, 16, 1162, 1242, 1162, 1162, 1242,
+ 1162, 1141, 1243, 132, 1243, 1143, 1244, 1145,
+ 16, 16, 1141, 1157, 38, 1157, 1158, 1143,
+ 1158, 1158, 1159, 1160, 1245, 1145, 1245, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1157,
+ 38, 1157, 1158, 1143, 1158, 1158, 1159, 1160,
+ 1246, 1145, 1246, 1158, 16, 16, 1158, 1158,
+ 1158, 1158, 1141, 1157, 38, 1157, 1158, 1143,
+ 1158, 1158, 1159, 1160, 1247, 1145, 1247, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1248,
+ 38, 1248, 1158, 1143, 1158, 1158, 1159, 1249,
+ 1145, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1250, 21, 1250, 1143, 1144, 1249, 1145,
+ 16, 16, 1141, 1251, 21, 1251, 1162, 1252,
+ 1162, 1162, 1164, 1145, 1162, 16, 16, 1162,
+ 1162, 1162, 1162, 1162, 1141, 1253, 1147, 1253,
+ 143, 1254, 144, 16, 16, 142, 1157, 38,
+ 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1255,
+ 1145, 1255, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
+ 1158, 1159, 1160, 1256, 1145, 1256, 1158, 16,
+ 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
+ 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1257,
+ 1145, 1257, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
+ 1158, 1159, 1160, 1258, 1145, 1258, 1158, 16,
+ 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
+ 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1259,
+ 1145, 1259, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1260, 38, 1260, 1158, 1143, 1158,
+ 1158, 1159, 1261, 1145, 1158, 16, 16, 1158,
+ 1158, 1158, 1158, 1141, 1262, 21, 1262, 1143,
+ 1144, 1261, 1145, 16, 16, 1141, 1263, 21,
+ 1263, 1162, 1264, 1162, 1162, 1164, 1145, 1162,
+ 16, 16, 1162, 1162, 1162, 1162, 1162, 1141,
+ 1265, 1147, 1265, 159, 1266, 160, 16, 16,
+ 158, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1267, 1145, 1267, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1268, 1145,
+ 1268, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1269, 38, 1269, 1158, 1143, 1158, 1158,
+ 1159, 1270, 1145, 1158, 16, 16, 1158, 1158,
+ 1158, 1158, 1141, 1271, 21, 1271, 1143, 1144,
+ 1270, 1145, 16, 16, 1141, 1270, 21, 1270,
+ 1272, 1163, 1272, 1272, 1164, 1145, 1272, 16,
+ 16, 1272, 1272, 1272, 1272, 1272, 1141, 1273,
+ 171, 1273, 1274, 1143, 1274, 1274, 1275, 1145,
+ 1274, 16, 16, 1274, 1274, 1274, 1274, 1141,
+ 1157, 38, 1157, 1158, 1143, 1158, 1158, 1159,
+ 1160, 1276, 1145, 1276, 1158, 16, 16, 1158,
+ 1158, 1158, 1158, 1141, 1157, 38, 1157, 1158,
+ 1143, 1158, 1158, 1159, 1160, 1277, 1278, 1145,
+ 1277, 1278, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
+ 1158, 1159, 1160, 1279, 1145, 1279, 1158, 16,
+ 16, 1158, 1158, 1158, 1158, 1141, 1157, 38,
+ 1157, 1158, 1143, 1158, 1158, 1159, 1160, 1280,
+ 1145, 1280, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1281, 38, 1281, 1158, 1143, 1158,
+ 1158, 1159, 1282, 1145, 1158, 16, 16, 1158,
+ 1158, 1158, 1158, 1141, 1283, 21, 1283, 1143,
+ 1144, 1282, 1145, 16, 16, 1141, 1284, 21,
+ 1284, 1162, 1285, 1162, 1162, 1164, 1145, 1162,
+ 16, 16, 1162, 1162, 1162, 1162, 1162, 1141,
+ 1286, 1147, 1286, 185, 1287, 186, 16, 16,
+ 184, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1288, 1145, 1288, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1289, 1145,
+ 1289, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1290, 1145, 1290, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1291, 1145,
+ 1291, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1292, 1145, 1292, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1293, 38, 1293,
+ 1158, 1143, 1158, 1158, 1159, 1294, 1145, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1295,
+ 21, 1295, 1143, 1144, 1294, 1145, 16, 16,
+ 1141, 1296, 21, 1296, 1162, 1297, 1162, 1162,
+ 1164, 1145, 1162, 16, 16, 1162, 1162, 1162,
+ 1162, 1162, 1141, 1298, 1147, 1298, 201, 1299,
+ 202, 16, 16, 200, 1157, 38, 1157, 1158,
+ 1143, 1158, 1158, 1159, 1160, 1300, 1301, 1145,
+ 1300, 1301, 1158, 16, 16, 1158, 1158, 1158,
+ 1158, 1141, 1157, 38, 1157, 1158, 1143, 1158,
+ 1158, 1159, 1160, 1302, 1145, 1302, 1158, 16,
+ 16, 1158, 1158, 1158, 1158, 1141, 1303, 38,
+ 1303, 1158, 1143, 1158, 1158, 1159, 1304, 1145,
+ 1158, 16, 16, 1158, 1158, 1158, 1158, 1141,
+ 1305, 21, 1305, 1143, 1144, 1304, 1145, 16,
+ 16, 1141, 1304, 21, 1304, 1162, 1306, 1162,
+ 1162, 1164, 1145, 1162, 16, 16, 1162, 1162,
+ 1162, 1162, 1162, 1141, 1307, 1147, 1307, 215,
+ 1308, 216, 214, 214, 213, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1309, 1145,
+ 1309, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1310, 1145, 1310, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1311, 1145,
+ 1311, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1312, 1145, 1312, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1157, 38, 1157,
+ 1158, 1143, 1158, 1158, 1159, 1160, 1313, 1145,
+ 1313, 1158, 16, 16, 1158, 1158, 1158, 1158,
+ 1141, 1157, 38, 1157, 1158, 1143, 1158, 1158,
+ 1159, 1160, 1314, 1145, 1314, 1158, 16, 16,
+ 1158, 1158, 1158, 1158, 1141, 1315, 38, 1315,
+ 1158, 1143, 1158, 1158, 1159, 1316, 1145, 1158,
+ 16, 16, 1158, 1158, 1158, 1158, 1141, 1317,
+ 21, 1317, 1143, 1144, 1316, 1145, 16, 16,
+ 1141, 1318, 21, 1318, 1162, 1319, 1162, 1162,
+ 1164, 1145, 1162, 16, 16, 1162, 1162, 1162,
+ 1162, 1162, 1141, 1320, 1147, 1320, 1143, 1321,
+ 1145, 16, 16, 1141, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 1322, 202, 1322,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 1323, 202, 1323, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 1324, 202, 1324,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 1325, 202, 1325, 833, 16, 16, 833,
+ 833, 833, 833, 200, 832, 38, 832, 833,
+ 201, 833, 833, 834, 835, 1326, 202, 1326,
+ 833, 16, 16, 833, 833, 833, 833, 200,
+ 832, 38, 832, 833, 201, 833, 833, 834,
+ 835, 1327, 202, 1327, 833, 16, 16, 833,
+ 833, 833, 833, 200, 1328, 38, 1328, 833,
+ 201, 833, 833, 834, 1329, 202, 833, 16,
+ 16, 833, 833, 833, 833, 200, 1330, 21,
+ 1330, 201, 823, 1329, 202, 16, 16, 200,
+ 1331, 21, 1331, 837, 1332, 837, 837, 839,
+ 202, 837, 16, 16, 837, 837, 837, 837,
+ 837, 200, 1333, 204, 1333, 1143, 1334, 1145,
+ 16, 16, 1141, 679, 38, 679, 680, 185,
+ 680, 680, 681, 682, 1335, 1336, 186, 1335,
+ 1336, 680, 16, 16, 680, 680, 680, 680,
+ 184, 679, 38, 679, 680, 185, 680, 680,
+ 681, 682, 1337, 186, 1337, 680, 16, 16,
+ 680, 680, 680, 680, 184, 1338, 38, 1338,
+ 680, 185, 680, 680, 681, 1339, 186, 680,
+ 16, 16, 680, 680, 680, 680, 184, 1340,
+ 21, 1340, 185, 670, 1339, 186, 16, 16,
+ 184, 1339, 21, 1339, 684, 1341, 684, 684,
+ 686, 186, 684, 16, 16, 684, 684, 684,
+ 684, 684, 184, 1342, 188, 1342, 215, 1343,
+ 216, 214, 214, 213, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 1344, 186, 1344,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 1345, 186, 1345, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 1346, 186, 1346,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 1347, 186, 1347, 680, 16, 16, 680,
+ 680, 680, 680, 184, 679, 38, 679, 680,
+ 185, 680, 680, 681, 682, 1348, 186, 1348,
+ 680, 16, 16, 680, 680, 680, 680, 184,
+ 679, 38, 679, 680, 185, 680, 680, 681,
+ 682, 1349, 186, 1349, 680, 16, 16, 680,
+ 680, 680, 680, 184, 1350, 38, 1350, 680,
+ 185, 680, 680, 681, 1351, 186, 680, 16,
+ 16, 680, 680, 680, 680, 184, 1352, 21,
+ 1352, 185, 670, 1351, 186, 16, 16, 184,
+ 1353, 21, 1353, 684, 1354, 684, 684, 686,
+ 186, 684, 16, 16, 684, 684, 684, 684,
+ 684, 184, 1355, 188, 1355, 1143, 1356, 1145,
+ 16, 16, 1141, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1357, 160, 1357, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 1358, 160, 1358, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1359, 160, 1359, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 1360, 160, 1360, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1361, 160, 1361, 539,
+ 16, 16, 539, 539, 539, 539, 158, 1362,
+ 38, 1362, 539, 159, 539, 539, 540, 1363,
+ 160, 539, 16, 16, 539, 539, 539, 539,
+ 158, 1364, 21, 1364, 159, 529, 1363, 160,
+ 16, 16, 158, 1365, 21, 1365, 543, 1366,
+ 543, 543, 545, 160, 543, 16, 16, 543,
+ 543, 543, 543, 543, 158, 1367, 162, 1367,
+ 201, 1368, 202, 16, 16, 200, 538, 38,
+ 538, 539, 159, 539, 539, 540, 541, 1369,
+ 1370, 160, 1369, 1370, 539, 16, 16, 539,
+ 539, 539, 539, 158, 538, 38, 538, 539,
+ 159, 539, 539, 540, 541, 1371, 160, 1371,
+ 539, 16, 16, 539, 539, 539, 539, 158,
+ 1372, 38, 1372, 539, 159, 539, 539, 540,
+ 1373, 160, 539, 16, 16, 539, 539, 539,
+ 539, 158, 1374, 21, 1374, 159, 529, 1373,
+ 160, 16, 16, 158, 1373, 21, 1373, 543,
+ 1375, 543, 543, 545, 160, 543, 16, 16,
+ 543, 543, 543, 543, 543, 158, 1376, 162,
+ 1376, 215, 1377, 216, 214, 214, 213, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 1378, 160, 1378, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1379, 160, 1379, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 1380, 160, 1380, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1381, 160, 1381, 539,
+ 16, 16, 539, 539, 539, 539, 158, 538,
+ 38, 538, 539, 159, 539, 539, 540, 541,
+ 1382, 160, 1382, 539, 16, 16, 539, 539,
+ 539, 539, 158, 538, 38, 538, 539, 159,
+ 539, 539, 540, 541, 1383, 160, 1383, 539,
+ 16, 16, 539, 539, 539, 539, 158, 1384,
+ 38, 1384, 539, 159, 539, 539, 540, 1385,
+ 160, 539, 16, 16, 539, 539, 539, 539,
+ 158, 1386, 21, 1386, 159, 529, 1385, 160,
+ 16, 16, 158, 1387, 21, 1387, 543, 1388,
+ 543, 543, 545, 160, 543, 16, 16, 543,
+ 543, 543, 543, 543, 158, 1389, 162, 1389,
+ 1143, 1390, 1145, 16, 16, 1141, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1391,
+ 144, 1391, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1392, 144, 1392, 419, 16,
+ 16, 419, 419, 419, 419, 142, 1393, 38,
+ 1393, 419, 143, 419, 419, 420, 1394, 144,
+ 419, 16, 16, 419, 419, 419, 419, 142,
+ 1395, 21, 1395, 143, 409, 1394, 144, 16,
+ 16, 142, 1394, 21, 1394, 1396, 424, 1396,
+ 1396, 425, 144, 1396, 16, 16, 1396, 1396,
+ 1396, 1396, 1396, 142, 1397, 171, 1397, 1398,
+ 143, 1398, 1398, 1399, 144, 1398, 16, 16,
+ 1398, 1398, 1398, 1398, 142, 418, 38, 418,
+ 419, 143, 419, 419, 420, 421, 1400, 144,
+ 1400, 419, 16, 16, 419, 419, 419, 419,
+ 142, 418, 38, 418, 419, 143, 419, 419,
+ 420, 421, 1401, 1402, 144, 1401, 1402, 419,
+ 16, 16, 419, 419, 419, 419, 142, 418,
+ 38, 418, 419, 143, 419, 419, 420, 421,
+ 1403, 144, 1403, 419, 16, 16, 419, 419,
+ 419, 419, 142, 418, 38, 418, 419, 143,
+ 419, 419, 420, 421, 1404, 144, 1404, 419,
+ 16, 16, 419, 419, 419, 419, 142, 1405,
+ 38, 1405, 419, 143, 419, 419, 420, 1406,
+ 144, 419, 16, 16, 419, 419, 419, 419,
+ 142, 1407, 21, 1407, 143, 409, 1406, 144,
+ 16, 16, 142, 1408, 21, 1408, 423, 1409,
+ 423, 423, 425, 144, 423, 16, 16, 423,
+ 423, 423, 423, 423, 142, 1410, 146, 1410,
+ 185, 1411, 186, 16, 16, 184, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1412,
+ 144, 1412, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1413, 144, 1413, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1414,
+ 144, 1414, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1415, 144, 1415, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1416,
+ 144, 1416, 419, 16, 16, 419, 419, 419,
+ 419, 142, 1417, 38, 1417, 419, 143, 419,
+ 419, 420, 1418, 144, 419, 16, 16, 419,
+ 419, 419, 419, 142, 1419, 21, 1419, 143,
+ 409, 1418, 144, 16, 16, 142, 1420, 21,
+ 1420, 423, 1421, 423, 423, 425, 144, 423,
+ 16, 16, 423, 423, 423, 423, 423, 142,
+ 1422, 146, 1422, 201, 1423, 202, 16, 16,
+ 200, 418, 38, 418, 419, 143, 419, 419,
+ 420, 421, 1424, 1425, 144, 1424, 1425, 419,
+ 16, 16, 419, 419, 419, 419, 142, 418,
+ 38, 418, 419, 143, 419, 419, 420, 421,
+ 1426, 144, 1426, 419, 16, 16, 419, 419,
+ 419, 419, 142, 1427, 38, 1427, 419, 143,
+ 419, 419, 420, 1428, 144, 419, 16, 16,
+ 419, 419, 419, 419, 142, 1429, 21, 1429,
+ 143, 409, 1428, 144, 16, 16, 142, 1428,
+ 21, 1428, 423, 1430, 423, 423, 425, 144,
+ 423, 16, 16, 423, 423, 423, 423, 423,
+ 142, 1431, 146, 1431, 215, 1432, 216, 214,
+ 214, 213, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1433, 144, 1433, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1434,
+ 144, 1434, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1435, 144, 1435, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1436,
+ 144, 1436, 419, 16, 16, 419, 419, 419,
+ 419, 142, 418, 38, 418, 419, 143, 419,
+ 419, 420, 421, 1437, 144, 1437, 419, 16,
+ 16, 419, 419, 419, 419, 142, 418, 38,
+ 418, 419, 143, 419, 419, 420, 421, 1438,
+ 144, 1438, 419, 16, 16, 419, 419, 419,
+ 419, 142, 1439, 38, 1439, 419, 143, 419,
+ 419, 420, 1440, 144, 419, 16, 16, 419,
+ 419, 419, 419, 142, 1441, 21, 1441, 143,
+ 409, 1440, 144, 16, 16, 142, 1442, 21,
+ 1442, 423, 1443, 423, 423, 425, 144, 423,
+ 16, 16, 423, 423, 423, 423, 423, 142,
+ 1444, 146, 1444, 1143, 1445, 1145, 16, 16,
+ 1141, 312, 38, 312, 313, 113, 313, 313,
+ 301, 314, 1446, 114, 1446, 313, 16, 16,
+ 313, 313, 313, 313, 112, 312, 38, 312,
+ 313, 113, 313, 313, 301, 314, 1447, 114,
+ 1447, 313, 16, 16, 313, 313, 313, 313,
+ 112, 312, 38, 312, 313, 113, 313, 313,
+ 301, 314, 1448, 114, 1448, 313, 16, 16,
+ 313, 313, 313, 313, 112, 312, 38, 312,
+ 313, 113, 313, 313, 301, 314, 1449, 114,
+ 1449, 313, 16, 16, 313, 313, 313, 313,
+ 112, 312, 38, 312, 313, 113, 313, 313,
+ 301, 314, 1450, 114, 1450, 313, 16, 16,
+ 313, 313, 313, 313, 112, 1451, 38, 1451,
+ 313, 113, 313, 313, 301, 1452, 114, 313,
+ 16, 16, 313, 313, 313, 313, 112, 1453,
+ 21, 1453, 113, 303, 1452, 114, 16, 16,
+ 112, 1454, 21, 1454, 316, 1455, 316, 316,
+ 318, 114, 316, 16, 16, 316, 316, 316,
+ 316, 316, 112, 1456, 116, 1456, 159, 1457,
+ 160, 16, 16, 158, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1458, 114, 1458,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1459, 114, 1459, 313, 16, 16, 313,
+ 313, 313, 313, 112, 1460, 38, 1460, 313,
+ 113, 313, 313, 301, 1461, 114, 313, 16,
+ 16, 313, 313, 313, 313, 112, 1462, 21,
+ 1462, 113, 303, 1461, 114, 16, 16, 112,
+ 1461, 21, 1461, 1463, 317, 1463, 1463, 318,
+ 114, 1463, 16, 16, 1463, 1463, 1463, 1463,
+ 1463, 112, 1464, 171, 1464, 1465, 113, 1465,
+ 1465, 1466, 114, 1465, 16, 16, 1465, 1465,
+ 1465, 1465, 112, 312, 38, 312, 313, 113,
+ 313, 313, 301, 314, 1467, 114, 1467, 313,
+ 16, 16, 313, 313, 313, 313, 112, 312,
+ 38, 312, 313, 113, 313, 313, 301, 314,
+ 1468, 1469, 114, 1468, 1469, 313, 16, 16,
+ 313, 313, 313, 313, 112, 312, 38, 312,
+ 313, 113, 313, 313, 301, 314, 1470, 114,
+ 1470, 313, 16, 16, 313, 313, 313, 313,
+ 112, 312, 38, 312, 313, 113, 313, 313,
+ 301, 314, 1471, 114, 1471, 313, 16, 16,
+ 313, 313, 313, 313, 112, 1472, 38, 1472,
+ 313, 113, 313, 313, 301, 1473, 114, 313,
+ 16, 16, 313, 313, 313, 313, 112, 1474,
+ 21, 1474, 113, 303, 1473, 114, 16, 16,
+ 112, 1475, 21, 1475, 316, 1476, 316, 316,
+ 318, 114, 316, 16, 16, 316, 316, 316,
+ 316, 316, 112, 1477, 116, 1477, 185, 1478,
+ 186, 16, 16, 184, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1479, 114, 1479,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1480, 114, 1480, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1481, 114, 1481,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1482, 114, 1482, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1483, 114, 1483,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 1484, 38, 1484, 313, 113, 313, 313, 301,
+ 1485, 114, 313, 16, 16, 313, 313, 313,
+ 313, 112, 1486, 21, 1486, 113, 303, 1485,
+ 114, 16, 16, 112, 1487, 21, 1487, 316,
+ 1488, 316, 316, 318, 114, 316, 16, 16,
+ 316, 316, 316, 316, 316, 112, 1489, 116,
+ 1489, 201, 1490, 202, 16, 16, 200, 312,
+ 38, 312, 313, 113, 313, 313, 301, 314,
+ 1491, 1492, 114, 1491, 1492, 313, 16, 16,
+ 313, 313, 313, 313, 112, 312, 38, 312,
+ 313, 113, 313, 313, 301, 314, 1493, 114,
+ 1493, 313, 16, 16, 313, 313, 313, 313,
+ 112, 1494, 38, 1494, 313, 113, 313, 313,
+ 301, 1495, 114, 313, 16, 16, 313, 313,
+ 313, 313, 112, 1496, 21, 1496, 113, 303,
+ 1495, 114, 16, 16, 112, 1495, 21, 1495,
+ 316, 1497, 316, 316, 318, 114, 316, 16,
+ 16, 316, 316, 316, 316, 316, 112, 1498,
+ 116, 1498, 215, 1499, 216, 214, 214, 213,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1500, 114, 1500, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1501, 114, 1501,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1502, 114, 1502, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1503, 114, 1503,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 312, 38, 312, 313, 113, 313, 313, 301,
+ 314, 1504, 114, 1504, 313, 16, 16, 313,
+ 313, 313, 313, 112, 312, 38, 312, 313,
+ 113, 313, 313, 301, 314, 1505, 114, 1505,
+ 313, 16, 16, 313, 313, 313, 313, 112,
+ 1506, 38, 1506, 313, 113, 313, 313, 301,
+ 1507, 114, 313, 16, 16, 313, 313, 313,
+ 313, 112, 1508, 21, 1508, 113, 303, 1507,
+ 114, 16, 16, 112, 1509, 21, 1509, 316,
+ 1510, 316, 316, 318, 114, 316, 16, 16,
+ 316, 316, 316, 316, 316, 112, 1511, 116,
+ 1511, 1143, 1512, 1145, 16, 16, 1141, 232,
+ 38, 232, 233, 51, 233, 233, 234, 235,
+ 1513, 1514, 52, 1513, 1514, 233, 16, 16,
+ 233, 233, 233, 233, 47, 1515, 38, 1515,
+ 233, 51, 233, 233, 234, 1516, 52, 233,
+ 16, 16, 233, 233, 233, 233, 47, 1517,
+ 21, 1517, 51, 223, 1516, 52, 16, 16,
+ 47, 1516, 21, 1516, 237, 238, 237, 237,
+ 239, 52, 237, 16, 16, 237, 237, 1518,
+ 237, 237, 1518, 237, 47, 240, 38, 240,
+ 237, 51, 237, 237, 234, 52, 237, 16,
+ 16, 237, 1519, 237, 237, 1519, 237, 47,
+ 240, 38, 240, 237, 51, 237, 237, 234,
+ 52, 237, 16, 16, 237, 1520, 237, 237,
+ 1520, 237, 47, 240, 38, 240, 237, 51,
+ 237, 237, 234, 52, 237, 16, 16, 237,
+ 1521, 237, 237, 1521, 237, 47, 240, 38,
+ 240, 237, 51, 237, 237, 234, 52, 237,
+ 16, 16, 237, 1522, 237, 237, 1522, 237,
+ 47, 240, 38, 240, 237, 51, 237, 237,
+ 234, 52, 237, 16, 16, 237, 1523, 237,
+ 237, 1523, 237, 47, 240, 38, 240, 237,
+ 51, 237, 237, 234, 52, 237, 16, 16,
+ 237, 1524, 237, 237, 1524, 237, 47, 240,
+ 38, 240, 237, 51, 237, 237, 234, 52,
+ 237, 16, 16, 237, 1525, 237, 237, 1525,
+ 237, 47, 1526, 132, 1526, 51, 1527, 52,
+ 16, 16, 47, 232, 38, 232, 233, 51,
+ 233, 233, 234, 235, 1528, 52, 1528, 233,
+ 16, 16, 233, 233, 233, 233, 47, 232,
+ 38, 232, 233, 51, 233, 233, 234, 235,
+ 1529, 52, 1529, 233, 16, 16, 233, 233,
+ 233, 233, 47, 232, 38, 232, 233, 51,
+ 233, 233, 234, 235, 1530, 52, 1530, 233,
+ 16, 16, 233, 233, 233, 233, 47, 1531,
+ 38, 1531, 233, 51, 233, 233, 234, 1532,
+ 52, 233, 16, 16, 233, 233, 233, 233,
+ 47, 1533, 21, 1533, 51, 223, 1532, 52,
+ 16, 16, 47, 1534, 21, 1534, 237, 1535,
+ 237, 237, 239, 52, 237, 16, 16, 237,
+ 237, 237, 237, 237, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1536, 52,
+ 1536, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 1537, 52, 1537, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1538, 52,
+ 1538, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 1539, 52, 1539, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1540, 52,
+ 1540, 233, 16, 16, 233, 233, 233, 233,
+ 47, 1541, 38, 1541, 233, 51, 233, 233,
+ 234, 1542, 52, 233, 16, 16, 233, 233,
+ 233, 233, 47, 1543, 21, 1543, 51, 223,
+ 1542, 52, 16, 16, 47, 1544, 21, 1544,
+ 237, 1545, 237, 237, 239, 52, 237, 16,
+ 16, 237, 237, 237, 237, 237, 47, 232,
+ 38, 232, 233, 51, 233, 233, 234, 235,
+ 1546, 52, 1546, 233, 16, 16, 233, 233,
+ 233, 233, 47, 232, 38, 232, 233, 51,
+ 233, 233, 234, 235, 1547, 52, 1547, 233,
+ 16, 16, 233, 233, 233, 233, 47, 1548,
+ 38, 1548, 233, 51, 233, 233, 234, 1549,
+ 52, 233, 16, 16, 233, 233, 233, 233,
+ 47, 1550, 21, 1550, 51, 223, 1549, 52,
+ 16, 16, 47, 1549, 21, 1549, 1551, 238,
+ 1551, 1551, 239, 52, 1551, 16, 16, 1551,
+ 1551, 1551, 1551, 1551, 47, 1552, 171, 1552,
+ 1553, 51, 1553, 1553, 1554, 52, 1553, 16,
+ 16, 1553, 1553, 1553, 1553, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 1555,
+ 52, 1555, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 1556, 1557, 52, 1556, 1557,
+ 233, 16, 16, 233, 233, 233, 233, 47,
+ 232, 38, 232, 233, 51, 233, 233, 234,
+ 235, 1558, 52, 1558, 233, 16, 16, 233,
+ 233, 233, 233, 47, 232, 38, 232, 233,
+ 51, 233, 233, 234, 235, 1559, 52, 1559,
+ 233, 16, 16, 233, 233, 233, 233, 47,
+ 1560, 38, 1560, 233, 51, 233, 233, 234,
+ 1561, 52, 233, 16, 16, 233, 233, 233,
+ 233, 47, 1562, 21, 1562, 51, 223, 1561,
+ 52, 16, 16, 47, 1563, 21, 1563, 237,
+ 1564, 237, 237, 239, 52, 237, 16, 16,
+ 237, 237, 237, 237, 237, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 1565,
+ 52, 1565, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 1566, 52, 1566, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 1567,
+ 52, 1567, 233, 16, 16, 233, 233, 233,
+ 233, 47, 232, 38, 232, 233, 51, 233,
+ 233, 234, 235, 1568, 52, 1568, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 1569,
+ 52, 1569, 233, 16, 16, 233, 233, 233,
+ 233, 47, 1570, 38, 1570, 233, 51, 233,
+ 233, 234, 1571, 52, 233, 16, 16, 233,
+ 233, 233, 233, 47, 1572, 21, 1572, 51,
+ 223, 1571, 52, 16, 16, 47, 1573, 21,
+ 1573, 237, 1574, 237, 237, 239, 52, 237,
+ 16, 16, 237, 237, 237, 237, 237, 47,
+ 232, 38, 232, 233, 51, 233, 233, 234,
+ 235, 1575, 1576, 52, 1575, 1576, 233, 16,
+ 16, 233, 233, 233, 233, 47, 232, 38,
+ 232, 233, 51, 233, 233, 234, 235, 1577,
+ 52, 1577, 233, 16, 16, 233, 233, 233,
+ 233, 47, 1578, 38, 1578, 233, 51, 233,
+ 233, 234, 1579, 52, 233, 16, 16, 233,
+ 233, 233, 233, 47, 1580, 21, 1580, 51,
+ 223, 1579, 52, 16, 16, 47, 1579, 21,
+ 1579, 237, 1581, 237, 237, 239, 52, 237,
+ 16, 16, 237, 237, 237, 237, 237, 47,
+ 1582, 38, 1582, 215, 1583, 216, 214, 214,
+ 213, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 1584, 52, 1584, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1585, 52,
+ 1585, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 1586, 52, 1586, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1587, 52,
+ 1587, 233, 16, 16, 233, 233, 233, 233,
+ 47, 232, 38, 232, 233, 51, 233, 233,
+ 234, 235, 1588, 52, 1588, 233, 16, 16,
+ 233, 233, 233, 233, 47, 232, 38, 232,
+ 233, 51, 233, 233, 234, 235, 1589, 52,
+ 1589, 233, 16, 16, 233, 233, 233, 233,
+ 47, 1590, 38, 1590, 233, 51, 233, 233,
+ 234, 1591, 52, 233, 16, 16, 233, 233,
+ 233, 233, 47, 1592, 21, 1592, 51, 223,
+ 1591, 52, 16, 16, 47, 1593, 21, 1593,
+ 237, 1594, 237, 237, 239, 52, 237, 16,
+ 16, 237, 237, 237, 237, 237, 47, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1595,
+ 1595, 39, 39, 39, 39, 39, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1596,
+ 1596, 39, 39, 39, 39, 39, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1597,
+ 1597, 39, 39, 39, 39, 39, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1598,
+ 1598, 39, 39, 39, 39, 39, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1599,
+ 1599, 39, 39, 39, 39, 39, 16, 37,
+ 38, 37, 39, 39, 39, 40, 41, 1600,
+ 1600, 39, 39, 39, 39, 39, 16, 1601,
+ 38, 1601, 39, 39, 39, 40, 1602, 39,
+ 39, 39, 39, 39, 16, 1603, 21, 1603,
+ 43, 1602, 16, 1604, 21, 1604, 46, 1605,
+ 46, 46, 48, 46, 46, 46, 46, 46,
+ 46, 16, 37, 38, 37, 39, 39, 39,
+ 40, 41, 1606, 207, 1606, 207, 39, 39,
+ 39, 39, 39, 16, 37, 38, 37, 39,
+ 39, 39, 40, 41, 1607, 1607, 39, 39,
+ 39, 39, 39, 16, 1608, 38, 1608, 39,
+ 39, 39, 40, 1609, 39, 39, 39, 39,
+ 39, 16, 1610, 21, 1610, 43, 1609, 16,
+ 1609, 21, 1609, 46, 1611, 46, 46, 48,
+ 46, 46, 46, 46, 46, 46, 16, 21,
+ 215, 1613, 214, 214, 214, 1612, 21, 219,
+ 1615, 218, 218, 218, 1614, 21, 1616, 1614,
+ 1614, 218, 1617, 21, 1617, 51, 1618, 52,
+ 16, 16, 47, 1618, 21, 1618, 1619, 51,
+ 1619, 1619, 1620, 1621, 1622, 1623, 1624, 1625,
+ 1626, 52, 1620, 1621, 1622, 1623, 1624, 1625,
+ 1626, 1619, 16, 16, 1619, 1619, 1619, 1619,
+ 1619, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 52, 1628, 16, 16, 1628,
+ 1628, 1628, 1628, 47, 1631, 21, 1631, 51,
+ 1618, 1630, 52, 16, 16, 47, 1630, 21,
+ 1630, 1632, 238, 1632, 1632, 1633, 52, 1632,
+ 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
+ 1634, 38, 1634, 1632, 51, 1632, 1632, 1629,
+ 52, 1632, 16, 16, 1632, 1632, 1632, 1632,
+ 47, 21, 51, 1636, 52, 16, 16, 16,
+ 1635, 1635, 1635, 47, 21, 51, 1638, 52,
+ 1639, 16, 16, 16, 1637, 1637, 1637, 47,
+ 21, 51, 1638, 52, 1639, 16, 16, 16,
+ 1640, 1640, 1640, 47, 21, 51, 1638, 52,
+ 1639, 16, 16, 16, 1641, 1641, 1641, 47,
+ 21, 51, 1638, 52, 1639, 16, 16, 16,
+ 47, 21, 51, 1643, 52, 16, 16, 16,
+ 1642, 1635, 1635, 47, 21, 51, 1644, 1638,
+ 52, 1639, 16, 16, 16, 1645, 1637, 1637,
+ 47, 21, 51, 52, 16, 16, 16, 1646,
+ 47, 21, 51, 1647, 52, 16, 16, 16,
+ 1648, 47, 21, 51, 52, 16, 16, 16,
+ 1649, 47, 21, 51, 1650, 52, 16, 16,
+ 16, 1651, 47, 21, 51, 52, 16, 16,
+ 16, 1652, 47, 21, 51, 52, 1639, 16,
+ 16, 16, 1653, 47, 21, 51, 52, 1639,
+ 16, 16, 16, 1654, 47, 21, 51, 52,
+ 1639, 16, 16, 16, 47, 1634, 38, 1634,
+ 51, 1629, 52, 16, 16, 47, 21, 51,
+ 1650, 52, 16, 16, 16, 1655, 47, 21,
+ 51, 1650, 52, 16, 16, 16, 47, 21,
+ 51, 1647, 52, 16, 16, 16, 1656, 47,
+ 21, 51, 1647, 52, 16, 16, 16, 47,
+ 21, 51, 1644, 1638, 52, 1639, 16, 16,
+ 16, 1657, 1640, 1640, 47, 21, 51, 1644,
+ 1638, 52, 1639, 16, 16, 16, 1641, 1641,
+ 1641, 47, 21, 51, 1659, 52, 1639, 16,
+ 16, 16, 1658, 1658, 1658, 47, 21, 51,
+ 1661, 52, 1639, 16, 16, 16, 1660, 1660,
+ 1660, 47, 21, 51, 1661, 52, 1639, 16,
+ 16, 16, 1662, 1662, 1662, 47, 21, 51,
+ 1661, 52, 1639, 16, 16, 16, 1663, 1663,
+ 1663, 47, 21, 51, 1661, 52, 1639, 16,
+ 16, 16, 47, 21, 51, 52, 16, 16,
+ 16, 1664, 1658, 1658, 47, 21, 51, 1644,
+ 1661, 52, 1639, 16, 16, 16, 1665, 1660,
+ 1660, 47, 21, 51, 1644, 1661, 52, 1639,
+ 16, 16, 16, 1666, 1662, 1662, 47, 21,
+ 51, 1644, 1661, 52, 1639, 16, 16, 16,
+ 1663, 1663, 1663, 47, 21, 51, 52, 16,
+ 16, 16, 1667, 47, 21, 51, 1644, 52,
+ 16, 16, 16, 1668, 47, 21, 51, 1644,
+ 52, 16, 16, 16, 1669, 47, 21, 51,
+ 1644, 52, 16, 16, 16, 47, 21, 51,
+ 1643, 52, 16, 16, 16, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1670,
+ 52, 1670, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1671, 52, 1671, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1672,
+ 52, 1672, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1673, 52, 1673, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1674,
+ 52, 1674, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1675, 52, 1675, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1676,
+ 52, 1676, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1677, 52, 1677, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1678, 38,
+ 1678, 1628, 51, 1628, 1628, 1629, 1679, 52,
+ 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
+ 1680, 21, 1680, 51, 1618, 1679, 52, 16,
+ 16, 47, 1679, 21, 1679, 1681, 238, 1681,
+ 1681, 1633, 52, 1681, 16, 16, 1681, 1681,
+ 1681, 1681, 1681, 47, 1682, 99, 1682, 1683,
+ 51, 1683, 1683, 1684, 52, 1683, 16, 16,
+ 1683, 1683, 1683, 1683, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1685, 52,
+ 1685, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1686, 52, 1686, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1687, 52,
+ 1687, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1688, 52, 1688, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1689, 52,
+ 1689, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1690, 38, 1690, 1628, 51, 1628, 1628,
+ 1629, 1691, 52, 1628, 16, 16, 1628, 1628,
+ 1628, 1628, 47, 1692, 21, 1692, 51, 1618,
+ 1691, 52, 16, 16, 47, 1693, 21, 1693,
+ 1632, 299, 1632, 1632, 1633, 52, 1632, 16,
+ 16, 1632, 1632, 1632, 1632, 1632, 47, 1627,
+ 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
+ 1694, 1695, 52, 1694, 1695, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1696, 38, 1696,
+ 1628, 51, 1628, 1628, 1629, 1697, 52, 1628,
+ 16, 16, 1628, 1628, 1628, 1628, 47, 1698,
+ 21, 1698, 51, 1618, 1697, 52, 16, 16,
+ 47, 1697, 21, 1697, 1632, 238, 1632, 1632,
+ 1633, 52, 1632, 16, 16, 1632, 1632, 1699,
+ 1632, 1632, 1699, 1632, 47, 1634, 38, 1634,
+ 1632, 51, 1632, 1632, 1629, 52, 1632, 16,
+ 16, 1632, 1700, 1632, 1632, 1700, 1632, 47,
+ 1634, 38, 1634, 1632, 51, 1632, 1632, 1629,
+ 52, 1632, 16, 16, 1632, 1701, 1632, 1632,
+ 1701, 1632, 47, 1634, 38, 1634, 1632, 51,
+ 1632, 1632, 1629, 52, 1632, 16, 16, 1632,
+ 1702, 1632, 1632, 1702, 1632, 47, 1634, 38,
+ 1634, 1632, 51, 1632, 1632, 1629, 52, 1632,
+ 16, 16, 1632, 1703, 1632, 1632, 1703, 1632,
+ 47, 1634, 38, 1634, 1632, 51, 1632, 1632,
+ 1629, 52, 1632, 16, 16, 1632, 1704, 1632,
+ 1632, 1704, 1632, 47, 1634, 38, 1634, 1632,
+ 51, 1632, 1632, 1629, 52, 1632, 16, 16,
+ 1632, 1705, 1632, 1632, 1705, 1632, 47, 1634,
+ 38, 1634, 1632, 51, 1632, 1632, 1629, 52,
+ 1632, 16, 16, 1632, 1706, 1632, 1632, 1706,
+ 1632, 47, 1707, 132, 1707, 51, 1708, 52,
+ 16, 16, 47, 1627, 38, 1627, 1628, 51,
+ 1628, 1628, 1629, 1630, 1709, 52, 1709, 1628,
+ 16, 16, 1628, 1628, 1628, 1628, 47, 1627,
+ 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
+ 1710, 52, 1710, 1628, 16, 16, 1628, 1628,
+ 1628, 1628, 47, 1627, 38, 1627, 1628, 51,
+ 1628, 1628, 1629, 1630, 1711, 52, 1711, 1628,
+ 16, 16, 1628, 1628, 1628, 1628, 47, 1712,
+ 38, 1712, 1628, 51, 1628, 1628, 1629, 1713,
+ 52, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1714, 21, 1714, 51, 1618, 1713, 52,
+ 16, 16, 47, 1715, 21, 1715, 1632, 1535,
+ 1632, 1632, 1633, 52, 1632, 16, 16, 1632,
+ 1632, 1632, 1632, 1632, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1716, 52,
+ 1716, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1717, 52, 1717, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1718, 52,
+ 1718, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1719, 52, 1719, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1720, 52,
+ 1720, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1721, 38, 1721, 1628, 51, 1628, 1628,
+ 1629, 1722, 52, 1628, 16, 16, 1628, 1628,
+ 1628, 1628, 47, 1723, 21, 1723, 51, 1618,
+ 1722, 52, 16, 16, 47, 1724, 21, 1724,
+ 1632, 1545, 1632, 1632, 1633, 52, 1632, 16,
+ 16, 1632, 1632, 1632, 1632, 1632, 47, 1627,
+ 38, 1627, 1628, 51, 1628, 1628, 1629, 1630,
+ 1725, 52, 1725, 1628, 16, 16, 1628, 1628,
+ 1628, 1628, 47, 1627, 38, 1627, 1628, 51,
+ 1628, 1628, 1629, 1630, 1726, 52, 1726, 1628,
+ 16, 16, 1628, 1628, 1628, 1628, 47, 1727,
+ 38, 1727, 1628, 51, 1628, 1628, 1629, 1728,
+ 52, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1729, 21, 1729, 51, 1618, 1728, 52,
+ 16, 16, 47, 1728, 21, 1728, 1730, 238,
+ 1730, 1730, 1633, 52, 1730, 16, 16, 1730,
+ 1730, 1730, 1730, 1730, 47, 1731, 171, 1731,
+ 1732, 51, 1732, 1732, 1733, 52, 1732, 16,
+ 16, 1732, 1732, 1732, 1732, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1734,
+ 52, 1734, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1735, 1736, 52, 1735, 1736,
+ 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
+ 1627, 38, 1627, 1628, 51, 1628, 1628, 1629,
+ 1630, 1737, 52, 1737, 1628, 16, 16, 1628,
+ 1628, 1628, 1628, 47, 1627, 38, 1627, 1628,
+ 51, 1628, 1628, 1629, 1630, 1738, 52, 1738,
+ 1628, 16, 16, 1628, 1628, 1628, 1628, 47,
+ 1739, 38, 1739, 1628, 51, 1628, 1628, 1629,
+ 1740, 52, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1741, 21, 1741, 51, 1618, 1740,
+ 52, 16, 16, 47, 1742, 21, 1742, 1632,
+ 1564, 1632, 1632, 1633, 52, 1632, 16, 16,
+ 1632, 1632, 1632, 1632, 1632, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1743,
+ 52, 1743, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1744, 52, 1744, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1745,
+ 52, 1745, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1627, 38, 1627, 1628, 51, 1628,
+ 1628, 1629, 1630, 1746, 52, 1746, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1747,
+ 52, 1747, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1748, 38, 1748, 1628, 51, 1628,
+ 1628, 1629, 1749, 52, 1628, 16, 16, 1628,
+ 1628, 1628, 1628, 47, 1750, 21, 1750, 51,
+ 1618, 1749, 52, 16, 16, 47, 1751, 21,
+ 1751, 1632, 1574, 1632, 1632, 1633, 52, 1632,
+ 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
+ 1627, 38, 1627, 1628, 51, 1628, 1628, 1629,
+ 1630, 1752, 1753, 52, 1752, 1753, 1628, 16,
+ 16, 1628, 1628, 1628, 1628, 47, 1627, 38,
+ 1627, 1628, 51, 1628, 1628, 1629, 1630, 1754,
+ 52, 1754, 1628, 16, 16, 1628, 1628, 1628,
+ 1628, 47, 1755, 38, 1755, 1628, 51, 1628,
+ 1628, 1629, 1756, 52, 1628, 16, 16, 1628,
+ 1628, 1628, 1628, 47, 1757, 21, 1757, 51,
+ 1618, 1756, 52, 16, 16, 47, 1756, 21,
+ 1756, 1632, 1758, 1632, 1632, 1633, 52, 1632,
+ 16, 16, 1632, 1632, 1632, 1632, 1632, 47,
+ 1759, 38, 1759, 215, 1760, 216, 214, 214,
+ 213, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1761, 52, 1761, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1762, 52,
+ 1762, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1763, 52, 1763, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1764, 52,
+ 1764, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1627, 38, 1627, 1628, 51, 1628, 1628,
+ 1629, 1630, 1765, 52, 1765, 1628, 16, 16,
+ 1628, 1628, 1628, 1628, 47, 1627, 38, 1627,
+ 1628, 51, 1628, 1628, 1629, 1630, 1766, 52,
+ 1766, 1628, 16, 16, 1628, 1628, 1628, 1628,
+ 47, 1767, 38, 1767, 1628, 51, 1628, 1628,
+ 1629, 1768, 52, 1628, 16, 16, 1628, 1628,
+ 1628, 1628, 47, 1769, 21, 1769, 51, 1618,
+ 1768, 52, 16, 16, 47, 1770, 21, 1770,
+ 1632, 1594, 1632, 1632, 1633, 52, 1632, 16,
+ 16, 1632, 1632, 1632, 1632, 1632, 47, 21,
+ 1771, 1771, 16, 21, 1772, 1772, 16, 21,
+ 1773, 1773, 16, 21, 1774, 1774, 16, 21,
+ 1775, 1775, 16, 1776, 21, 1776, 16, 1777,
+ 21, 16, 17, 21, 17, 16, 1778, 1778,
+ 1, 1779, 1779, 1, 1780, 1780, 1, 1781,
+ 1781, 1, 1782, 1, 1783, 1783, 1, 1,
+ 0
+ };
+
+ static const short _thttp_machine_parser_header_Authorization_trans_targs[] = {
+ 2, 0, 1345, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 18, 1343, 19, 1337, 17, 1351, 20,
+ 21, 22, 23, 24, 24, 25, 28, 81,
+ 92, 113, 124, 130, 1205, 26, 17, 25,
+ 27, 29, 26, 27, 151, 70, 30, 32,
+ 35, 31, 31, 33, 34, 36, 69, 37,
+ 40, 38, 39, 41, 56, 42, 54, 43,
+ 44, 52, 45, 46, 50, 47, 48, 49,
+ 51, 53, 55, 57, 65, 58, 61, 59,
+ 60, 62, 63, 64, 66, 67, 68, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79,
+ 78, 80, 31, 17, 80, 27, 82, 83,
+ 84, 85, 86, 87, 88, 87, 88, 89,
+ 89, 90, 91, 31, 17, 27, 93, 104,
+ 94, 95, 94, 96, 97, 98, 99, 100,
+ 101, 102, 103, 31, 17, 27, 105, 106,
+ 107, 108, 109, 108, 109, 110, 110, 111,
+ 112, 31, 17, 27, 114, 115, 116, 117,
+ 118, 119, 120, 119, 120, 121, 121, 122,
+ 123, 31, 17, 27, 125, 126, 127, 128,
+ 127, 129, 31, 17, 129, 27, 131, 132,
+ 140, 133, 134, 135, 136, 135, 136, 137,
+ 137, 138, 139, 31, 17, 27, 141, 142,
+ 143, 144, 145, 146, 147, 146, 147, 148,
+ 148, 149, 150, 31, 17, 27, 152, 1196,
+ 153, 154, 155, 154, 156, 157, 158, 31,
+ 159, 157, 158, 31, 159, 160, 160, 161,
+ 162, 202, 214, 1134, 1152, 1160, 1166, 1181,
+ 163, 162, 161, 164, 163, 165, 166, 167,
+ 160, 168, 201, 169, 172, 170, 171, 173,
+ 188, 174, 186, 175, 176, 184, 177, 178,
+ 182, 179, 180, 181, 183, 185, 187, 189,
+ 197, 190, 193, 191, 192, 194, 195, 196,
+ 198, 199, 200, 203, 204, 205, 206, 207,
+ 208, 209, 210, 211, 212, 211, 213, 160,
+ 213, 161, 215, 216, 217, 218, 219, 220,
+ 221, 220, 221, 222, 223, 224, 223, 224,
+ 225, 265, 277, 286, 1086, 1095, 1101, 1118,
+ 226, 225, 227, 226, 228, 229, 230, 160,
+ 161, 231, 264, 232, 235, 222, 233, 234,
+ 236, 251, 237, 249, 238, 239, 247, 240,
+ 241, 245, 242, 243, 244, 246, 248, 250,
+ 252, 260, 253, 256, 254, 255, 257, 258,
+ 259, 261, 262, 263, 266, 267, 268, 269,
+ 270, 271, 272, 273, 274, 275, 274, 276,
+ 223, 276, 224, 278, 279, 280, 281, 282,
+ 283, 284, 283, 284, 285, 223, 224, 287,
+ 298, 288, 289, 288, 290, 291, 292, 293,
+ 294, 295, 296, 297, 223, 224, 299, 300,
+ 301, 302, 303, 302, 303, 304, 305, 306,
+ 305, 306, 307, 348, 360, 369, 388, 1047,
+ 1053, 1070, 308, 307, 306, 309, 308, 310,
+ 311, 312, 305, 160, 161, 313, 347, 314,
+ 317, 327, 315, 316, 318, 334, 319, 332,
+ 320, 321, 330, 322, 323, 328, 324, 325,
+ 326, 329, 331, 333, 335, 343, 336, 339,
+ 337, 338, 340, 341, 342, 344, 345, 346,
+ 349, 350, 351, 352, 353, 354, 355, 356,
+ 357, 358, 357, 359, 305, 359, 306, 361,
+ 362, 363, 364, 365, 366, 367, 366, 367,
+ 368, 223, 224, 370, 381, 371, 372, 371,
+ 373, 374, 375, 376, 377, 378, 379, 380,
+ 305, 306, 382, 383, 384, 385, 386, 385,
+ 386, 387, 305, 306, 389, 390, 391, 392,
+ 393, 394, 395, 394, 395, 396, 397, 398,
+ 397, 398, 399, 440, 452, 461, 480, 489,
+ 495, 1031, 400, 399, 398, 401, 400, 402,
+ 403, 404, 397, 160, 161, 405, 439, 406,
+ 409, 419, 407, 408, 410, 426, 411, 424,
+ 412, 413, 422, 414, 415, 420, 416, 417,
+ 418, 421, 423, 425, 427, 435, 428, 431,
+ 429, 430, 432, 433, 434, 436, 437, 438,
+ 441, 442, 443, 444, 445, 446, 447, 448,
+ 449, 450, 449, 451, 397, 451, 398, 453,
+ 454, 455, 456, 457, 458, 459, 458, 459,
+ 460, 223, 224, 462, 473, 463, 464, 463,
+ 465, 466, 467, 468, 469, 470, 471, 472,
+ 397, 398, 474, 475, 476, 477, 478, 477,
+ 478, 479, 305, 306, 481, 482, 483, 484,
+ 485, 486, 487, 486, 487, 488, 397, 398,
+ 490, 491, 492, 493, 492, 494, 397, 494,
+ 398, 496, 497, 1022, 498, 499, 500, 501,
+ 500, 501, 502, 503, 504, 503, 504, 505,
+ 546, 558, 567, 586, 595, 601, 1006, 506,
+ 505, 504, 507, 506, 508, 509, 510, 503,
+ 160, 161, 511, 545, 512, 515, 525, 513,
+ 514, 516, 532, 517, 530, 518, 519, 528,
+ 520, 521, 526, 522, 523, 524, 527, 529,
+ 531, 533, 541, 534, 537, 535, 536, 538,
+ 539, 540, 542, 543, 544, 547, 548, 549,
+ 550, 551, 552, 553, 554, 555, 556, 555,
+ 557, 503, 557, 504, 559, 560, 561, 562,
+ 563, 564, 565, 564, 565, 566, 223, 224,
+ 568, 579, 569, 570, 569, 571, 572, 573,
+ 574, 575, 576, 577, 578, 503, 504, 580,
+ 581, 582, 583, 584, 583, 584, 585, 305,
+ 306, 587, 588, 589, 590, 591, 592, 593,
+ 592, 593, 594, 397, 398, 596, 597, 598,
+ 599, 598, 600, 503, 600, 504, 602, 603,
+ 609, 604, 605, 606, 607, 606, 607, 608,
+ 503, 504, 610, 611, 612, 613, 614, 615,
+ 616, 615, 616, 617, 618, 619, 618, 619,
+ 620, 661, 673, 682, 701, 710, 716, 733,
+ 621, 620, 619, 622, 621, 623, 624, 625,
+ 618, 160, 161, 626, 660, 627, 630, 640,
+ 628, 629, 631, 647, 632, 645, 633, 634,
+ 643, 635, 636, 641, 637, 638, 639, 642,
+ 644, 646, 648, 656, 649, 652, 650, 651,
+ 653, 654, 655, 657, 658, 659, 662, 663,
+ 664, 665, 666, 667, 668, 669, 670, 671,
+ 670, 672, 618, 672, 619, 674, 675, 676,
+ 677, 678, 679, 680, 679, 680, 681, 223,
+ 224, 683, 694, 684, 685, 684, 686, 687,
+ 688, 689, 690, 691, 692, 693, 618, 619,
+ 695, 696, 697, 698, 699, 698, 699, 700,
+ 305, 306, 702, 703, 704, 705, 706, 707,
+ 708, 707, 708, 709, 397, 398, 711, 712,
+ 713, 714, 713, 715, 618, 715, 619, 717,
+ 718, 724, 719, 720, 721, 722, 721, 722,
+ 723, 503, 504, 725, 726, 727, 728, 729,
+ 730, 731, 730, 731, 732, 618, 619, 734,
+ 996, 735, 736, 737, 736, 738, 739, 740,
+ 739, 740, 741, 781, 793, 801, 819, 827,
+ 833, 848, 742, 741, 740, 743, 742, 744,
+ 745, 739, 746, 780, 747, 750, 760, 748,
+ 749, 751, 767, 752, 765, 753, 754, 763,
+ 755, 756, 761, 757, 758, 759, 762, 764,
+ 766, 768, 776, 769, 772, 770, 771, 773,
+ 774, 775, 777, 778, 779, 782, 783, 784,
+ 785, 786, 787, 788, 789, 790, 791, 790,
+ 792, 739, 792, 740, 794, 795, 796, 797,
+ 798, 799, 800, 799, 800, 223, 802, 813,
+ 803, 804, 803, 805, 806, 807, 808, 809,
+ 810, 811, 812, 739, 740, 814, 815, 816,
+ 817, 818, 817, 818, 305, 820, 821, 822,
+ 823, 824, 825, 826, 825, 826, 397, 828,
+ 829, 830, 831, 830, 832, 739, 832, 740,
+ 834, 835, 840, 836, 837, 838, 839, 838,
+ 839, 503, 841, 842, 843, 844, 845, 846,
+ 847, 846, 847, 618, 849, 853, 850, 851,
+ 852, 851, 854, 855, 856, 857, 858, 859,
+ 860, 861, 860, 861, 862, 863, 862, 864,
+ 866, 865, 31, 17, 27, 867, 908, 920,
+ 929, 948, 957, 963, 980, 868, 867, 866,
+ 869, 868, 870, 871, 872, 862, 160, 161,
+ 873, 907, 874, 877, 887, 875, 876, 878,
+ 894, 879, 892, 880, 881, 890, 882, 883,
+ 888, 884, 885, 886, 889, 891, 893, 895,
+ 903, 896, 899, 897, 898, 900, 901, 902,
+ 904, 905, 906, 909, 910, 911, 912, 913,
+ 914, 915, 916, 917, 918, 917, 919, 862,
+ 919, 866, 921, 922, 923, 924, 925, 926,
+ 927, 926, 927, 928, 223, 224, 930, 941,
+ 931, 932, 931, 933, 934, 935, 936, 937,
+ 938, 939, 940, 862, 866, 942, 943, 944,
+ 945, 946, 945, 946, 947, 305, 306, 949,
+ 950, 951, 952, 953, 954, 955, 954, 955,
+ 956, 397, 398, 958, 959, 960, 961, 960,
+ 962, 862, 962, 866, 964, 965, 971, 966,
+ 967, 968, 969, 968, 969, 970, 503, 504,
+ 972, 973, 974, 975, 976, 977, 978, 977,
+ 978, 979, 618, 619, 981, 986, 982, 983,
+ 984, 983, 985, 739, 740, 987, 988, 989,
+ 990, 991, 992, 993, 994, 993, 994, 995,
+ 862, 866, 997, 998, 999, 1000, 1001, 1002,
+ 1003, 1004, 1003, 1004, 1005, 862, 866, 1007,
+ 1012, 1008, 1009, 1010, 1009, 1011, 739, 740,
+ 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020,
+ 1019, 1020, 1021, 862, 866, 1023, 1024, 1025,
+ 1026, 1027, 1028, 1029, 1028, 1029, 1030, 618,
+ 619, 1032, 1037, 1033, 1034, 1035, 1034, 1036,
+ 739, 740, 1038, 1039, 1040, 1041, 1042, 1043,
+ 1044, 1045, 1044, 1045, 1046, 862, 866, 1048,
+ 1049, 1050, 1051, 1050, 1052, 305, 1052, 306,
+ 1054, 1055, 1061, 1056, 1057, 1058, 1059, 1058,
+ 1059, 1060, 503, 504, 1062, 1063, 1064, 1065,
+ 1066, 1067, 1068, 1067, 1068, 1069, 618, 619,
+ 1071, 1076, 1072, 1073, 1074, 1073, 1075, 739,
+ 740, 1077, 1078, 1079, 1080, 1081, 1082, 1083,
+ 1084, 1083, 1084, 1085, 862, 866, 1087, 1088,
+ 1089, 1090, 1091, 1092, 1093, 1092, 1093, 1094,
+ 397, 398, 1096, 1097, 1098, 1099, 1098, 1100,
+ 223, 1100, 224, 1102, 1103, 1109, 1104, 1105,
+ 1106, 1107, 1106, 1107, 1108, 503, 504, 1110,
+ 1111, 1112, 1113, 1114, 1115, 1116, 1115, 1116,
+ 1117, 618, 619, 1119, 1124, 1120, 1121, 1122,
+ 1121, 1123, 739, 740, 1125, 1126, 1127, 1128,
+ 1129, 1130, 1131, 1132, 1131, 1132, 1133, 862,
+ 866, 1135, 1146, 1136, 1137, 1136, 1138, 1139,
+ 1140, 1141, 1142, 1143, 1144, 1145, 160, 161,
+ 1147, 1148, 1149, 1150, 1151, 1150, 1151, 327,
+ 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1158,
+ 1159, 419, 1161, 1162, 1163, 1164, 1163, 1165,
+ 160, 1165, 161, 1167, 1168, 1173, 1169, 1170,
+ 1171, 1172, 1171, 1172, 525, 1174, 1175, 1176,
+ 1177, 1178, 1179, 1180, 1179, 1180, 640, 1182,
+ 1187, 1183, 1184, 1185, 1184, 1186, 739, 740,
+ 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195,
+ 1194, 1195, 887, 1197, 1198, 1199, 1200, 1201,
+ 1202, 1203, 1204, 1203, 1204, 863, 1206, 1207,
+ 1208, 1209, 1208, 1210, 1211, 1212, 1211, 1212,
+ 1213, 1213, 1214, 1215, 1255, 1267, 1275, 1293,
+ 1301, 1307, 1322, 1216, 1215, 1214, 1217, 1216,
+ 1218, 1219, 1213, 1220, 1254, 1221, 1224, 1234,
+ 1222, 1223, 1225, 1241, 1226, 1239, 1227, 1228,
+ 1237, 1229, 1230, 1235, 1231, 1232, 1233, 1236,
+ 1238, 1240, 1242, 1250, 1243, 1246, 1244, 1245,
+ 1247, 1248, 1249, 1251, 1252, 1253, 1256, 1257,
+ 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265,
+ 1264, 1266, 1213, 1266, 1214, 1268, 1269, 1270,
+ 1271, 1272, 1273, 1274, 1273, 1274, 1276, 1287,
+ 1277, 1278, 1277, 1279, 1280, 1281, 1282, 1283,
+ 1284, 1285, 1286, 1213, 1214, 1288, 1289, 1290,
+ 1291, 1292, 1291, 1292, 1294, 1295, 1296, 1297,
+ 1298, 1299, 1300, 1299, 1300, 1302, 1303, 1304,
+ 1305, 1304, 1306, 1213, 1306, 1214, 1308, 1309,
+ 1314, 1310, 1311, 1312, 1313, 1312, 1313, 1315,
+ 1316, 1317, 1318, 1319, 1320, 1321, 1320, 1321,
+ 1323, 1328, 1324, 1325, 1326, 1325, 1327, 739,
+ 740, 1329, 1330, 1331, 1332, 1333, 1334, 1335,
+ 1336, 1335, 1336, 1338, 1339, 1340, 1341, 1342,
+ 24, 1344, 1346, 1347, 1348, 1349, 1350, 2
+ };
+
+ static const char _thttp_machine_parser_header_Authorization_trans_actions[] = {
+ 7, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0,
+ 0, 0, 0, 5, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 31, 31, 0,
+ 31, 0, 0, 0, 1, 0, 0, 0,
+ 0, 31, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 21, 21, 0, 21, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 0, 0, 0, 23, 23, 23, 0, 0,
+ 31, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 29, 29, 29, 0, 0,
+ 0, 31, 0, 0, 1, 1, 0, 0,
+ 0, 15, 15, 15, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 0, 0,
+ 0, 25, 25, 25, 0, 0, 31, 0,
+ 0, 1, 27, 27, 0, 27, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 0, 0, 0, 13, 13, 13, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 0, 0, 0, 19, 19, 19, 0, 0,
+ 0, 31, 0, 0, 0, 1, 1, 35,
+ 1, 0, 0, 17, 0, 17, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 31, 0, 31, 0, 0, 0, 0, 0,
+ 31, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 21,
+ 0, 21, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 1, 31, 31, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 31, 0, 0, 0, 0, 0, 0, 23,
+ 23, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 21, 0, 21, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 23, 23, 0,
+ 0, 31, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 29, 29, 0, 0,
+ 0, 31, 0, 0, 1, 1, 23, 23,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 31, 0, 31, 0, 0, 0,
+ 0, 0, 31, 15, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 21, 0, 21, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 1, 15, 15, 0, 0, 31, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 29, 29, 0, 0, 0, 31, 0, 0,
+ 1, 1, 15, 15, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 15, 15,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 31, 0, 31, 0, 0, 0,
+ 0, 0, 31, 25, 25, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 21, 0, 21, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 1, 25, 25, 0, 0, 31, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 29, 29, 0, 0, 0, 31, 0, 0,
+ 1, 1, 25, 25, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 25, 25,
+ 0, 0, 31, 0, 0, 1, 27, 0,
+ 27, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 1, 25, 25, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 31,
+ 0, 31, 0, 0, 0, 0, 0, 31,
+ 13, 13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 21, 0, 21, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 13, 13,
+ 0, 0, 31, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 29, 29, 0,
+ 0, 0, 31, 0, 0, 1, 1, 13,
+ 13, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 1, 13, 13, 0, 0, 31,
+ 0, 0, 1, 27, 0, 27, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 13, 13, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 1, 13, 13, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 31, 0, 31, 0, 0, 0, 0, 0,
+ 31, 19, 19, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 21, 0, 21, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 1, 19,
+ 19, 0, 0, 31, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 29, 29,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 19, 19, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 1, 19, 19, 0, 0,
+ 31, 0, 0, 1, 27, 0, 27, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 1, 19, 19, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 19, 19, 0,
+ 0, 0, 31, 0, 0, 0, 38, 38,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 31, 0, 31, 0, 0, 0,
+ 0, 31, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 21, 0, 21, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 59, 0, 0,
+ 31, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 29, 29, 0, 0, 0,
+ 31, 0, 0, 1, 35, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 59, 0,
+ 0, 31, 0, 0, 1, 27, 0, 27,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 35, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 59, 0, 0, 0, 31,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 35, 0, 0, 0,
+ 0, 0, 11, 11, 11, 1, 1, 1,
+ 1, 1, 1, 1, 1, 31, 0, 31,
+ 0, 0, 0, 0, 0, 31, 11, 11,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 21,
+ 0, 21, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 1, 11, 11, 0, 0,
+ 31, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 29, 29, 0, 0, 0,
+ 31, 0, 0, 1, 1, 11, 11, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 1, 11, 11, 0, 0, 31, 0, 0,
+ 1, 27, 0, 27, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 11, 11,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 1, 11, 11, 0, 0, 0, 31,
+ 0, 0, 0, 50, 50, 0, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 11, 11, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 19, 19, 0,
+ 0, 0, 31, 0, 0, 0, 53, 53,
+ 0, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 1, 13, 13, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 1, 25,
+ 25, 0, 0, 0, 31, 0, 0, 0,
+ 44, 44, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 25, 25, 0,
+ 0, 31, 0, 0, 1, 27, 0, 27,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 1, 15, 15, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 15, 15,
+ 0, 0, 0, 31, 0, 0, 0, 56,
+ 56, 0, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 1, 15, 15, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 23, 23, 0, 0, 31, 0, 0, 1,
+ 27, 0, 27, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 23, 23, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 1, 23, 23, 0, 0, 0, 31, 0,
+ 0, 0, 41, 41, 0, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 1, 23,
+ 23, 0, 0, 31, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 29, 29,
+ 0, 0, 0, 31, 0, 0, 1, 1,
+ 0, 0, 0, 0, 0, 31, 0, 0,
+ 1, 1, 0, 0, 31, 0, 0, 1,
+ 27, 0, 27, 0, 0, 0, 0, 0,
+ 31, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 1, 0,
+ 0, 0, 31, 0, 0, 0, 47, 47,
+ 0, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 1, 0, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 1, 0, 0,
+ 31, 0, 0, 0, 1, 1, 0, 0,
+ 17, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 31, 0, 31, 0, 0,
+ 0, 0, 31, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 31, 0,
+ 0, 1, 21, 0, 21, 0, 0, 0,
+ 0, 0, 31, 0, 0, 1, 0, 0,
+ 31, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 29, 29, 0, 0, 0,
+ 31, 0, 0, 1, 0, 0, 0, 0,
+ 0, 31, 0, 0, 1, 0, 0, 31,
+ 0, 0, 1, 27, 0, 27, 0, 0,
+ 0, 0, 0, 31, 0, 0, 1, 0,
+ 0, 0, 0, 0, 31, 0, 0, 1,
+ 0, 0, 0, 31, 0, 0, 0, 62,
+ 62, 0, 0, 0, 0, 0, 0, 31,
+ 0, 0, 1, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const int thttp_machine_parser_header_Authorization_start = 1;
+ static const int thttp_machine_parser_header_Authorization_first_final = 1351;
+ static const int thttp_machine_parser_header_Authorization_error = 0;
-static const int thttp_machine_parser_header_Authorization_start = 1;
-static const int thttp_machine_parser_header_Authorization_first_final = 1351;
-static const int thttp_machine_parser_header_Authorization_error = 0;
+ static const int thttp_machine_parser_header_Authorization_en_main = 1;
-static const int thttp_machine_parser_header_Authorization_en_main = 1;
+ /* #line 221 "./ragel/thttp_parser_header_Authorization.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Authorization_first_final);
+ (void)(thttp_machine_parser_header_Authorization_error);
+ (void)(thttp_machine_parser_header_Authorization_en_main);
-/* #line 221 "./ragel/thttp_parser_header_Authorization.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Authorization_first_final);
- (void)(thttp_machine_parser_header_Authorization_error);
- (void)(thttp_machine_parser_header_Authorization_en_main);
-
-/* #line 6706 "./src/headers/thttp_header_Authorization.c" */
- {
- cs = thttp_machine_parser_header_Authorization_start;
- }
+ /* #line 6706 "./src/headers/thttp_header_Authorization.c" */
+ {
+ cs = thttp_machine_parser_header_Authorization_start;
+ }
-/* #line 227 "./ragel/thttp_parser_header_Authorization.rl" */
-
-/* #line 6713 "./src/headers/thttp_header_Authorization.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
+ /* #line 227 "./ragel/thttp_parser_header_Authorization.rl" */
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 6713 "./src/headers/thttp_header_Authorization.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Authorization_trans_keys + _thttp_machine_parser_header_Authorization_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Authorization_index_offsets[cs];
+ _keys = _thttp_machine_parser_header_Authorization_trans_keys + _thttp_machine_parser_header_Authorization_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Authorization_index_offsets[cs];
- _klen = _thttp_machine_parser_header_Authorization_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _thttp_machine_parser_header_Authorization_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _thttp_machine_parser_header_Authorization_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _thttp_machine_parser_header_Authorization_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Authorization_indicies[_trans];
- cs = _thttp_machine_parser_header_Authorization_trans_targs[_trans];
+ _trans = _thttp_machine_parser_header_Authorization_indicies[_trans];
+ cs = _thttp_machine_parser_header_Authorization_trans_targs[_trans];
- if ( _thttp_machine_parser_header_Authorization_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _thttp_machine_parser_header_Authorization_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _thttp_machine_parser_header_Authorization_actions + _thttp_machine_parser_header_Authorization_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- hdr_Authorization->scheme = tsk_strdup("Digest");
- }
- break;
- case 2:
-/* #line 51 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- hdr_Authorization->scheme = tsk_strdup("Basic");
- }
- break;
- case 3:
-/* #line 55 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- THTTP_HEADER(hdr_Authorization)->type = thttp_htype_Authorization;
- }
- break;
- case 4:
-/* #line 59 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- THTTP_HEADER(hdr_Authorization)->type = thttp_htype_Proxy_Authorization;
- }
- break;
- case 5:
-/* #line 63 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->username);
- tsk_strunquote(&hdr_Authorization->username);
- }
- break;
- case 6:
-/* #line 68 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->realm);
- tsk_strunquote(&hdr_Authorization->realm);
- }
- break;
- case 7:
-/* #line 73 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->nonce);
- tsk_strunquote(&hdr_Authorization->nonce);
- }
- break;
- case 8:
-/* #line 78 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->uri);
- }
- break;
- case 9:
-/* #line 82 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->response);
- tsk_strunquote(&hdr_Authorization->response);
- }
- break;
- case 10:
-/* #line 87 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->algorithm);
- }
- break;
- case 11:
-/* #line 91 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->cnonce);
- tsk_strunquote(&hdr_Authorization->cnonce);
- }
- break;
- case 12:
-/* #line 96 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->opaque);
- tsk_strunquote(&hdr_Authorization->opaque);
- }
- break;
- case 13:
-/* #line 101 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->qop);
- //tsk_strunquote(&hdr_Authorization->qop);
- }
- break;
- case 14:
-/* #line 106 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Authorization->nc);
- }
- break;
- case 15:
-/* #line 110 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_Authorization));
- }
- break;
- case 16:
-/* #line 114 "./ragel/thttp_parser_header_Authorization.rl" */
- {
- }
- break;
-/* #line 6895 "./src/headers/thttp_header_Authorization.c" */
- }
- }
+ _acts = _thttp_machine_parser_header_Authorization_actions + _thttp_machine_parser_header_Authorization_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ hdr_Authorization->scheme = tsk_strdup("Digest");
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ hdr_Authorization->scheme = tsk_strdup("Basic");
+ }
+ break;
+ case 3:
+ /* #line 55 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ THTTP_HEADER(hdr_Authorization)->type = thttp_htype_Authorization;
+ }
+ break;
+ case 4:
+ /* #line 59 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ THTTP_HEADER(hdr_Authorization)->type = thttp_htype_Proxy_Authorization;
+ }
+ break;
+ case 5:
+ /* #line 63 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->username);
+ tsk_strunquote(&hdr_Authorization->username);
+ }
+ break;
+ case 6:
+ /* #line 68 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->realm);
+ tsk_strunquote(&hdr_Authorization->realm);
+ }
+ break;
+ case 7:
+ /* #line 73 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->nonce);
+ tsk_strunquote(&hdr_Authorization->nonce);
+ }
+ break;
+ case 8:
+ /* #line 78 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->uri);
+ }
+ break;
+ case 9:
+ /* #line 82 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->response);
+ tsk_strunquote(&hdr_Authorization->response);
+ }
+ break;
+ case 10:
+ /* #line 87 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->algorithm);
+ }
+ break;
+ case 11:
+ /* #line 91 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->cnonce);
+ tsk_strunquote(&hdr_Authorization->cnonce);
+ }
+ break;
+ case 12:
+ /* #line 96 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->opaque);
+ tsk_strunquote(&hdr_Authorization->opaque);
+ }
+ break;
+ case 13:
+ /* #line 101 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->qop);
+ //tsk_strunquote(&hdr_Authorization->qop);
+ }
+ break;
+ case 14:
+ /* #line 106 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Authorization->nc);
+ }
+ break;
+ case 15:
+ /* #line 110 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_Authorization));
+ }
+ break;
+ case 16:
+ /* #line 114 "./ragel/thttp_parser_header_Authorization.rl" */
+ {
+ }
+ break;
+ /* #line 6895 "./src/headers/thttp_header_Authorization.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 228 "./ragel/thttp_parser_header_Authorization.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 6912 "./src/headers/thttp_header_Authorization.c" */
+ 1351
+ /* #line 230 "./ragel/thttp_parser_header_Authorization.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Authorization header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Authorization);
+ }
-/* #line 228 "./ragel/thttp_parser_header_Authorization.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 6912 "./src/headers/thttp_header_Authorization.c" */
-1351
-/* #line 230 "./ragel/thttp_parser_header_Authorization.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Authorization header.");
- TSK_OBJECT_SAFE_FREE(hdr_Authorization);
- }
-
- return hdr_Authorization;
+ return hdr_Authorization;
}
/**@ingroup thttp_header_group
*/
thttp_header_Proxy_Authorization_t *thttp_header_Proxy_Authorization_parse(const char *data, tsk_size_t size)
{
- return thttp_header_Authorization_parse(data, size);
+ return thttp_header_Authorization_parse(data, size);
}
@@ -6934,47 +6943,46 @@ thttp_header_Proxy_Authorization_t *thttp_header_Proxy_Authorization_parse(const
static tsk_object_t* thttp_header_Authorization_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Authorization_t *Authorization = self;
- if(Authorization){
- THTTP_HEADER(Authorization)->type = thttp_htype_Authorization;
- THTTP_HEADER(Authorization)->tostring = thttp_header_Authorization_tostring;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Authorization header.");
- }
- return self;
+ thttp_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ THTTP_HEADER(Authorization)->type = thttp_htype_Authorization;
+ THTTP_HEADER(Authorization)->tostring = thttp_header_Authorization_tostring;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Authorization header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Authorization_dtor(tsk_object_t *self)
{
- thttp_header_Authorization_t *Authorization = self;
- if(Authorization){
- TSK_FREE(Authorization->scheme);
- TSK_FREE(Authorization->username);
- TSK_FREE(Authorization->realm);
- TSK_FREE(Authorization->nonce);
- TSK_FREE(Authorization->uri);
- TSK_FREE(Authorization->response);
- TSK_FREE(Authorization->algorithm);
- TSK_FREE(Authorization->cnonce);
- TSK_FREE(Authorization->opaque);
- TSK_FREE(Authorization->qop);
- TSK_FREE(Authorization->nc);
-
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Authorization));
- }
- else{
- TSK_DEBUG_ERROR("Null Authorization header.");
- }
+ thttp_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ TSK_FREE(Authorization->scheme);
+ TSK_FREE(Authorization->username);
+ TSK_FREE(Authorization->realm);
+ TSK_FREE(Authorization->nonce);
+ TSK_FREE(Authorization->uri);
+ TSK_FREE(Authorization->response);
+ TSK_FREE(Authorization->algorithm);
+ TSK_FREE(Authorization->cnonce);
+ TSK_FREE(Authorization->opaque);
+ TSK_FREE(Authorization->qop);
+ TSK_FREE(Authorization->nc);
- return self;
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Authorization));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Authorization header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Authorization_def_s =
-{
- sizeof(thttp_header_Authorization_t),
- thttp_header_Authorization_ctor,
- thttp_header_Authorization_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Authorization_def_s = {
+ sizeof(thttp_header_Authorization_t),
+ thttp_header_Authorization_ctor,
+ thttp_header_Authorization_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Authorization_def_t = &thttp_header_Authorization_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Content_Length.c b/tinyHTTP/src/headers/thttp_header_Content_Length.c
index 1ddfb2f..61d9e8a 100755
--- a/tinyHTTP/src/headers/thttp_header_Content_Length.c
+++ b/tinyHTTP/src/headers/thttp_header_Content_Length.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Content_Length.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,231 +37,242 @@
thttp_header_Content_Length_t* thttp_header_content_length_create(uint32_t length)
{
- return tsk_object_new(THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(length));
+ return tsk_object_new(THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(length));
}
int thttp_header_Content_Length_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Content_Length_t *Content_Length = (const thttp_header_Content_Length_t*)header;
- return tsk_buffer_append_2(output, "%d", Content_Length->length);
- }
+ if(header) {
+ const thttp_header_Content_Length_t *Content_Length = (const thttp_header_Content_Length_t*)header;
+ return tsk_buffer_append_2(output, "%d", Content_Length->length);
+ }
- return -1;
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_Content_Length_t *thttp_header_Content_Length_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Content_Length_t *hdr_clength = thttp_header_content_length_create(0);
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 68 "./src/headers/thttp_header_Content_Length.c" */
-static const char _thttp_machine_parser_header_Content_Length_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _thttp_machine_parser_header_Content_Length_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 21, 23, 25, 27,
- 30, 35, 36, 38, 42, 45, 46
-};
-
-static const char _thttp_machine_parser_header_Content_Length_trans_keys[] = {
- 67, 99, 79, 111, 78, 110, 84, 116,
- 69, 101, 78, 110, 84, 116, 45, 76,
- 108, 69, 101, 78, 110, 71, 103, 84,
- 116, 72, 104, 9, 32, 58, 9, 13,
- 32, 48, 57, 10, 9, 32, 9, 32,
- 48, 57, 13, 48, 57, 10, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Length_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 3,
- 3, 1, 2, 2, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Length_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 1, 0, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Length_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 32, 35, 38, 41,
- 45, 50, 52, 55, 59, 62, 64
-};
-
-static const char _thttp_machine_parser_header_Content_Length_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 14, 14, 15, 1, 15, 16, 15,
- 17, 1, 18, 1, 19, 19, 1, 19,
- 19, 17, 1, 20, 21, 1, 22, 1,
- 1, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Length_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 20, 18, 19, 21, 20, 22
-};
-
-static const char _thttp_machine_parser_header_Content_Length_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 3, 0, 5
-};
-
-static const int thttp_machine_parser_header_Content_Length_start = 1;
-static const int thttp_machine_parser_header_Content_Length_first_final = 22;
-static const int thttp_machine_parser_header_Content_Length_error = 0;
-
-static const int thttp_machine_parser_header_Content_Length_en_main = 1;
-
-
-/* #line 85 "./ragel/thttp_parser_header_Content_Length.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Content_Length_first_final);
- (void)(thttp_machine_parser_header_Content_Length_error);
- (void)(thttp_machine_parser_header_Content_Length_en_main);
-
-/* #line 143 "./src/headers/thttp_header_Content_Length.c" */
- {
- cs = thttp_machine_parser_header_Content_Length_start;
- }
-
-/* #line 90 "./ragel/thttp_parser_header_Content_Length.rl" */
-
-/* #line 150 "./src/headers/thttp_header_Content_Length.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Content_Length_t *hdr_clength = thttp_header_content_length_create(0);
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 68 "./src/headers/thttp_header_Content_Length.c" */
+ static const char _thttp_machine_parser_header_Content_Length_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 21, 23, 25, 27,
+ 30, 35, 36, 38, 42, 45, 46
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_trans_keys[] = {
+ 67, 99, 79, 111, 78, 110, 84, 116,
+ 69, 101, 78, 110, 84, 116, 45, 76,
+ 108, 69, 101, 78, 110, 71, 103, 84,
+ 116, 72, 104, 9, 32, 58, 9, 13,
+ 32, 48, 57, 10, 9, 32, 9, 32,
+ 48, 57, 13, 48, 57, 10, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 3,
+ 3, 1, 2, 2, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 1, 1, 0, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 32, 35, 38, 41,
+ 45, 50, 52, 55, 59, 62, 64
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 14, 14, 15, 1, 15, 16, 15,
+ 17, 1, 18, 1, 19, 19, 1, 19,
+ 19, 17, 1, 20, 21, 1, 22, 1,
+ 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 20, 18, 19, 21, 20, 22
+ };
+
+ static const char _thttp_machine_parser_header_Content_Length_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 3, 0, 5
+ };
+
+ static const int thttp_machine_parser_header_Content_Length_start = 1;
+ static const int thttp_machine_parser_header_Content_Length_first_final = 22;
+ static const int thttp_machine_parser_header_Content_Length_error = 0;
+
+ static const int thttp_machine_parser_header_Content_Length_en_main = 1;
+
+
+ /* #line 85 "./ragel/thttp_parser_header_Content_Length.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Content_Length_first_final);
+ (void)(thttp_machine_parser_header_Content_Length_error);
+ (void)(thttp_machine_parser_header_Content_Length_en_main);
+
+ /* #line 143 "./src/headers/thttp_header_Content_Length.c" */
+ {
+ cs = thttp_machine_parser_header_Content_Length_start;
+ }
+
+ /* #line 90 "./ragel/thttp_parser_header_Content_Length.rl" */
+
+ /* #line 150 "./src/headers/thttp_header_Content_Length.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Content_Length_trans_keys + _thttp_machine_parser_header_Content_Length_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Content_Length_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Content_Length_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Content_Length_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Content_Length_trans_keys + _thttp_machine_parser_header_Content_Length_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Content_Length_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Content_Length_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Content_Length_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Content_Length_indicies[_trans];
- cs = _thttp_machine_parser_header_Content_Length_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Content_Length_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Content_Length_actions + _thttp_machine_parser_header_Content_Length_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 38 "./ragel/thttp_parser_header_Content_Length.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 42 "./ragel/thttp_parser_header_Content_Length.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_clength->length);
- }
- break;
- case 2:
-/* #line 46 "./ragel/thttp_parser_header_Content_Length.rl" */
- {
- }
- break;
-/* #line 241 "./src/headers/thttp_header_Content_Length.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Content_Length_indicies[_trans];
+ cs = _thttp_machine_parser_header_Content_Length_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Content_Length_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Content_Length_actions + _thttp_machine_parser_header_Content_Length_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 38 "./ragel/thttp_parser_header_Content_Length.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 42 "./ragel/thttp_parser_header_Content_Length.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_clength->length);
+ }
+ break;
+ case 2:
+ /* #line 46 "./ragel/thttp_parser_header_Content_Length.rl" */
+ {
+ }
+ break;
+ /* #line 241 "./src/headers/thttp_header_Content_Length.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 91 "./ragel/thttp_parser_header_Content_Length.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 258 "./src/headers/thttp_header_Content_Length.c" */
-22
-/* #line 93 "./ragel/thttp_parser_header_Content_Length.rl" */
- ){
- TSK_OBJECT_SAFE_FREE(hdr_clength);
- }
-
- return hdr_clength;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 91 "./ragel/thttp_parser_header_Content_Length.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 258 "./src/headers/thttp_header_Content_Length.c" */
+ 22
+ /* #line 93 "./ragel/thttp_parser_header_Content_Length.rl" */
+ ) {
+ TSK_OBJECT_SAFE_FREE(hdr_clength);
+ }
+
+ return hdr_clength;
}
@@ -276,37 +287,36 @@ _again:
static tsk_object_t* thttp_header_Content_Length_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Content_Length_t *Content_Length = self;
- if(Content_Length){
- Content_Length->length = va_arg(*app, uint32_t);
-
- THTTP_HEADER(Content_Length)->type = thttp_htype_Content_Length;
- THTTP_HEADER(Content_Length)->tostring = thttp_header_Content_Length_tostring;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Content_Length header.");
- }
- return self;
+ thttp_header_Content_Length_t *Content_Length = self;
+ if(Content_Length) {
+ Content_Length->length = va_arg(*app, uint32_t);
+
+ THTTP_HEADER(Content_Length)->type = thttp_htype_Content_Length;
+ THTTP_HEADER(Content_Length)->tostring = thttp_header_Content_Length_tostring;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Content_Length header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Content_Length_dtor(tsk_object_t *self)
{
- thttp_header_Content_Length_t *Content_Length = self;
- if(Content_Length){
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Content_Length));
- }
- else{
- TSK_DEBUG_ERROR("Null Content_Length header.");
- }
-
- return self;
+ thttp_header_Content_Length_t *Content_Length = self;
+ if(Content_Length) {
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Content_Length));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Content_Length header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Content_Length_def_s =
-{
- sizeof(thttp_header_Content_Length_t),
- thttp_header_Content_Length_ctor,
- thttp_header_Content_Length_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Content_Length_def_s = {
+ sizeof(thttp_header_Content_Length_t),
+ thttp_header_Content_Length_ctor,
+ thttp_header_Content_Length_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Content_Length_def_t = &thttp_header_Content_Length_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Content_Type.c b/tinyHTTP/src/headers/thttp_header_Content_Type.c
index dada2c7..7295cf0 100755
--- a/tinyHTTP/src/headers/thttp_header_Content_Type.c
+++ b/tinyHTTP/src/headers/thttp_header_Content_Type.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Content_Type.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,330 +39,341 @@
thttp_header_Content_Type_t* thttp_header_content_type_create(const char* type)
{
- return tsk_object_new(THTTP_HEADER_CONTENT_TYPE_VA_ARGS(type));
+ return tsk_object_new(THTTP_HEADER_CONTENT_TYPE_VA_ARGS(type));
}
thttp_header_Content_Type_t* thttp_header_content_type_create_null()
{
- return thttp_header_content_type_create(tsk_null);
+ return thttp_header_content_type_create(tsk_null);
}
int thttp_header_Content_Type_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Content_Type_t *Content_Type = (const thttp_header_Content_Type_t*)header;
- return tsk_buffer_append(output, Content_Type->type, tsk_strlen(Content_Type->type));
- }
+ if(header) {
+ const thttp_header_Content_Type_t *Content_Type = (const thttp_header_Content_Type_t*)header;
+ return tsk_buffer_append(output, Content_Type->type, tsk_strlen(Content_Type->type));
+ }
- return -1;
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_Content_Type_t *thttp_header_Content_Type_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Content_Type_t *hdr_ctype = thttp_header_content_type_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 75 "./src/headers/thttp_header_Content_Type.c" */
-static const char _thttp_machine_parser_header_Content_Type_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const short _thttp_machine_parser_header_Content_Type_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 21, 23, 26, 43,
- 44, 46, 62, 78, 82, 83, 85, 88,
- 105, 106, 108, 124, 142, 146, 147, 149,
- 152, 169, 170, 172, 188, 206, 210, 211,
- 213, 216, 234, 235, 237, 255, 256, 258,
- 261, 269, 270, 272, 276, 277, 283, 301
-};
-
-static const char _thttp_machine_parser_header_Content_Type_trans_keys[] = {
- 67, 99, 79, 111, 78, 110, 84, 116,
- 69, 101, 78, 110, 84, 116, 45, 84,
- 116, 89, 121, 80, 112, 69, 101, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 47, 126, 42, 43,
- 45, 57, 65, 90, 95, 122, 9, 13,
- 32, 47, 10, 9, 32, 9, 32, 47,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 10, 9, 32, 9, 32, 59,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 61, 10, 9, 32, 9, 32, 61,
- 9, 13, 32, 33, 34, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 34, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 59, 10, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Type_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 3, 7, 1,
- 2, 6, 8, 4, 1, 2, 3, 7,
- 1, 2, 6, 8, 4, 1, 2, 3,
- 7, 1, 2, 6, 8, 4, 1, 2,
- 3, 8, 1, 2, 8, 1, 2, 3,
- 4, 1, 2, 4, 1, 0, 8, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Type_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 5, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 5, 0, 0, 0, 0,
- 5, 0, 0, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 2, 0, 0, 0, 0, 3, 5, 0
-};
-
-static const short _thttp_machine_parser_header_Content_Type_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 32, 35, 39, 52,
- 54, 57, 69, 82, 87, 89, 92, 96,
- 109, 111, 114, 126, 140, 145, 147, 150,
- 154, 167, 169, 172, 184, 198, 203, 205,
- 208, 212, 226, 228, 231, 245, 247, 250,
- 254, 261, 263, 266, 271, 273, 277, 291
-};
-
-static const char _thttp_machine_parser_header_Content_Type_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 12, 12, 13, 1, 13,
- 14, 13, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 1, 16, 1, 17, 17,
- 1, 17, 17, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 1, 18, 19, 18,
- 20, 20, 20, 21, 20, 20, 20, 20,
- 20, 1, 18, 19, 18, 21, 1, 22,
- 1, 23, 23, 1, 23, 23, 21, 1,
- 21, 24, 21, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 1, 26, 1, 27,
- 27, 1, 27, 27, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 1, 28, 29,
- 28, 25, 25, 25, 30, 25, 25, 25,
- 25, 25, 25, 1, 31, 32, 31, 33,
- 1, 34, 1, 35, 35, 1, 35, 35,
- 33, 1, 33, 36, 33, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 1, 38,
- 1, 39, 39, 1, 39, 39, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 1,
- 40, 41, 40, 42, 42, 42, 43, 42,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 43, 1, 44, 1, 45, 45, 1,
- 45, 45, 43, 1, 43, 46, 43, 47,
- 48, 47, 47, 47, 47, 47, 47, 47,
- 47, 1, 49, 1, 50, 50, 1, 50,
- 51, 50, 47, 48, 47, 47, 47, 47,
- 47, 47, 47, 47, 1, 52, 1, 53,
- 53, 1, 53, 53, 48, 1, 54, 55,
- 56, 1, 1, 1, 48, 57, 1, 48,
- 48, 1, 58, 59, 58, 60, 1, 61,
- 1, 48, 48, 48, 1, 58, 59, 58,
- 47, 47, 47, 60, 47, 47, 47, 47,
- 47, 47, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Content_Type_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 18,
- 16, 17, 19, 20, 18, 23, 21, 22,
- 24, 27, 25, 26, 28, 52, 32, 28,
- 29, 32, 30, 31, 33, 36, 34, 35,
- 37, 38, 36, 41, 39, 40, 42, 54,
- 48, 43, 44, 45, 46, 47, 49, 51,
- 53, 50, 28, 52, 32, 55
-};
-
-static const char _thttp_machine_parser_header_Content_Type_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 3, 3, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 7
-};
-
-static const int thttp_machine_parser_header_Content_Type_start = 1;
-static const int thttp_machine_parser_header_Content_Type_first_final = 55;
-static const int thttp_machine_parser_header_Content_Type_error = 0;
-
-static const int thttp_machine_parser_header_Content_Type_en_main = 1;
-
-
-/* #line 109 "./ragel/thttp_parser_header_Content_Type.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Content_Type_first_final);
- (void)(thttp_machine_parser_header_Content_Type_error);
- (void)(thttp_machine_parser_header_Content_Type_en_main);
-
-/* #line 237 "./src/headers/thttp_header_Content_Type.c" */
- {
- cs = thttp_machine_parser_header_Content_Type_start;
- }
-
-/* #line 114 "./ragel/thttp_parser_header_Content_Type.rl" */
-
-/* #line 244 "./src/headers/thttp_header_Content_Type.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Content_Type_t *hdr_ctype = thttp_header_content_type_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 75 "./src/headers/thttp_header_Content_Type.c" */
+ static const char _thttp_machine_parser_header_Content_Type_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const short _thttp_machine_parser_header_Content_Type_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 21, 23, 26, 43,
+ 44, 46, 62, 78, 82, 83, 85, 88,
+ 105, 106, 108, 124, 142, 146, 147, 149,
+ 152, 169, 170, 172, 188, 206, 210, 211,
+ 213, 216, 234, 235, 237, 255, 256, 258,
+ 261, 269, 270, 272, 276, 277, 283, 301
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_trans_keys[] = {
+ 67, 99, 79, 111, 78, 110, 84, 116,
+ 69, 101, 78, 110, 84, 116, 45, 84,
+ 116, 89, 121, 80, 112, 69, 101, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 47, 126, 42, 43,
+ 45, 57, 65, 90, 95, 122, 9, 13,
+ 32, 47, 10, 9, 32, 9, 32, 47,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 10, 9, 32, 9, 32, 59,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 61, 10, 9, 32, 9, 32, 61,
+ 9, 13, 32, 33, 34, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 34, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 59, 10, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 3, 7, 1,
+ 2, 6, 8, 4, 1, 2, 3, 7,
+ 1, 2, 6, 8, 4, 1, 2, 3,
+ 7, 1, 2, 6, 8, 4, 1, 2,
+ 3, 8, 1, 2, 8, 1, 2, 3,
+ 4, 1, 2, 4, 1, 0, 8, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 5, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 5, 0, 0, 0, 0,
+ 5, 0, 0, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 2, 0, 0, 0, 0, 3, 5, 0
+ };
+
+ static const short _thttp_machine_parser_header_Content_Type_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 32, 35, 39, 52,
+ 54, 57, 69, 82, 87, 89, 92, 96,
+ 109, 111, 114, 126, 140, 145, 147, 150,
+ 154, 167, 169, 172, 184, 198, 203, 205,
+ 208, 212, 226, 228, 231, 245, 247, 250,
+ 254, 261, 263, 266, 271, 273, 277, 291
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 12, 12, 13, 1, 13,
+ 14, 13, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 1, 16, 1, 17, 17,
+ 1, 17, 17, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 1, 18, 19, 18,
+ 20, 20, 20, 21, 20, 20, 20, 20,
+ 20, 1, 18, 19, 18, 21, 1, 22,
+ 1, 23, 23, 1, 23, 23, 21, 1,
+ 21, 24, 21, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 1, 26, 1, 27,
+ 27, 1, 27, 27, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 1, 28, 29,
+ 28, 25, 25, 25, 30, 25, 25, 25,
+ 25, 25, 25, 1, 31, 32, 31, 33,
+ 1, 34, 1, 35, 35, 1, 35, 35,
+ 33, 1, 33, 36, 33, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 1, 38,
+ 1, 39, 39, 1, 39, 39, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 1,
+ 40, 41, 40, 42, 42, 42, 43, 42,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 43, 1, 44, 1, 45, 45, 1,
+ 45, 45, 43, 1, 43, 46, 43, 47,
+ 48, 47, 47, 47, 47, 47, 47, 47,
+ 47, 1, 49, 1, 50, 50, 1, 50,
+ 51, 50, 47, 48, 47, 47, 47, 47,
+ 47, 47, 47, 47, 1, 52, 1, 53,
+ 53, 1, 53, 53, 48, 1, 54, 55,
+ 56, 1, 1, 1, 48, 57, 1, 48,
+ 48, 1, 58, 59, 58, 60, 1, 61,
+ 1, 48, 48, 48, 1, 58, 59, 58,
+ 47, 47, 47, 60, 47, 47, 47, 47,
+ 47, 47, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 18,
+ 16, 17, 19, 20, 18, 23, 21, 22,
+ 24, 27, 25, 26, 28, 52, 32, 28,
+ 29, 32, 30, 31, 33, 36, 34, 35,
+ 37, 38, 36, 41, 39, 40, 42, 54,
+ 48, 43, 44, 45, 46, 47, 49, 51,
+ 53, 50, 28, 52, 32, 55
+ };
+
+ static const char _thttp_machine_parser_header_Content_Type_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 3, 3, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 7
+ };
+
+ static const int thttp_machine_parser_header_Content_Type_start = 1;
+ static const int thttp_machine_parser_header_Content_Type_first_final = 55;
+ static const int thttp_machine_parser_header_Content_Type_error = 0;
+
+ static const int thttp_machine_parser_header_Content_Type_en_main = 1;
+
+
+ /* #line 109 "./ragel/thttp_parser_header_Content_Type.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Content_Type_first_final);
+ (void)(thttp_machine_parser_header_Content_Type_error);
+ (void)(thttp_machine_parser_header_Content_Type_en_main);
+
+ /* #line 237 "./src/headers/thttp_header_Content_Type.c" */
+ {
+ cs = thttp_machine_parser_header_Content_Type_start;
+ }
+
+ /* #line 114 "./ragel/thttp_parser_header_Content_Type.rl" */
+
+ /* #line 244 "./src/headers/thttp_header_Content_Type.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Content_Type_trans_keys + _thttp_machine_parser_header_Content_Type_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Content_Type_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Content_Type_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Content_Type_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Content_Type_trans_keys + _thttp_machine_parser_header_Content_Type_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Content_Type_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Content_Type_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Content_Type_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Content_Type_indicies[_trans];
- cs = _thttp_machine_parser_header_Content_Type_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Content_Type_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Content_Type_actions + _thttp_machine_parser_header_Content_Type_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 40 "./ragel/thttp_parser_header_Content_Type.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 44 "./ragel/thttp_parser_header_Content_Type.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ctype->type);
- }
- break;
- case 2:
-/* #line 48 "./ragel/thttp_parser_header_Content_Type.rl" */
- {
- TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_ctype));
- }
- break;
- case 3:
-/* #line 52 "./ragel/thttp_parser_header_Content_Type.rl" */
- {
- }
- break;
-/* #line 341 "./src/headers/thttp_header_Content_Type.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Content_Type_indicies[_trans];
+ cs = _thttp_machine_parser_header_Content_Type_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Content_Type_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Content_Type_actions + _thttp_machine_parser_header_Content_Type_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 40 "./ragel/thttp_parser_header_Content_Type.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 44 "./ragel/thttp_parser_header_Content_Type.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ctype->type);
+ }
+ break;
+ case 2:
+ /* #line 48 "./ragel/thttp_parser_header_Content_Type.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_ctype));
+ }
+ break;
+ case 3:
+ /* #line 52 "./ragel/thttp_parser_header_Content_Type.rl" */
+ {
+ }
+ break;
+ /* #line 341 "./src/headers/thttp_header_Content_Type.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 115 "./ragel/thttp_parser_header_Content_Type.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 358 "./src/headers/thttp_header_Content_Type.c" */
-55
-/* #line 117 "./ragel/thttp_parser_header_Content_Type.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Content-Type header.");
- TSK_OBJECT_SAFE_FREE(hdr_ctype);
- }
-
- return hdr_ctype;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 115 "./ragel/thttp_parser_header_Content_Type.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 358 "./src/headers/thttp_header_Content_Type.c" */
+ 55
+ /* #line 117 "./ragel/thttp_parser_header_Content_Type.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Content-Type header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ctype);
+ }
+
+ return hdr_ctype;
}
@@ -379,40 +390,39 @@ _again:
*/
static tsk_object_t* thttp_header_Content_Type_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- THTTP_HEADER(Content_Type)->type = thttp_htype_Content_Type;
- THTTP_HEADER(Content_Type)->tostring = thttp_header_Content_Type_tostring;
-
- Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
- }
- return self;
+ thttp_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ THTTP_HEADER(Content_Type)->type = thttp_htype_Content_Type;
+ THTTP_HEADER(Content_Type)->tostring = thttp_header_Content_Type_tostring;
+
+ Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
+ }
+ return self;
}
/**@ingroup thttp_header_Content_Type_group
*/
static tsk_object_t* thttp_header_Content_Type_dtor(tsk_object_t *self)
{
- thttp_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- TSK_FREE(Content_Type->type);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Content_Type));
- }
- else{
- TSK_DEBUG_ERROR("Null Content_Type header.");
- }
-
- return self;
+ thttp_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ TSK_FREE(Content_Type->type);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Content_Type));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Content_Type header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Content_Type_def_s =
-{
- sizeof(thttp_header_Content_Type_t),
- thttp_header_Content_Type_ctor,
- thttp_header_Content_Type_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Content_Type_def_s = {
+ sizeof(thttp_header_Content_Type_t),
+ thttp_header_Content_Type_ctor,
+ thttp_header_Content_Type_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Content_Type_def_t = &thttp_header_Content_Type_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Dummy.c b/tinyHTTP/src/headers/thttp_header_Dummy.c
index 044a4ab..1e3e038 100755
--- a/tinyHTTP/src/headers/thttp_header_Dummy.c
+++ b/tinyHTTP/src/headers/thttp_header_Dummy.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Dummy.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,238 +42,249 @@
thttp_header_Dummy_t* thttp_header_dummy_create(const char* name, const char* value)
{
- return tsk_object_new(THTTP_HEADER_DUMMY_VA_ARGS(name, value));
+ return tsk_object_new(THTTP_HEADER_DUMMY_VA_ARGS(name, value));
}
thttp_header_Dummy_t* thttp_header_dummy_create_null()
{
- return thttp_header_dummy_create(tsk_null, tsk_null);
+ return thttp_header_dummy_create(tsk_null, tsk_null);
}
int thttp_header_Dummy_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Dummy_t *Dummy = (const thttp_header_Dummy_t*)header;
- if(Dummy->value){
- return tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Dummy_t *Dummy = (const thttp_header_Dummy_t*)header;
+ if(Dummy->value) {
+ return tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_Dummy_t *thttp_header_Dummy_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Dummy_t *hdr_Dummy = thttp_header_dummy_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 82 "./src/headers/thttp_header_Dummy.c" */
-static const char _thttp_machine_parser_header_Dummy_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 2, 0, 2
-};
-
-static const char _thttp_machine_parser_header_Dummy_key_offsets[] = {
- 0, 0, 14, 31, 34, 37, 38, 39,
- 40, 42, 45
-};
-
-static const char _thttp_machine_parser_header_Dummy_trans_keys[] = {
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 13, 32, 0
-};
-
-static const char _thttp_machine_parser_header_Dummy_single_lengths[] = {
- 0, 4, 7, 3, 3, 1, 1, 1,
- 2, 3, 0
-};
-
-static const char _thttp_machine_parser_header_Dummy_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const char _thttp_machine_parser_header_Dummy_index_offsets[] = {
- 0, 0, 10, 23, 27, 31, 33, 35,
- 37, 40, 44
-};
-
-static const char _thttp_machine_parser_header_Dummy_indicies[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 2, 3, 3, 3, 4,
- 3, 3, 3, 3, 3, 3, 1, 5,
- 5, 6, 1, 6, 8, 6, 7, 10,
- 9, 11, 1, 12, 1, 13, 13, 1,
- 13, 14, 13, 7, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Dummy_trans_targs[] = {
- 2, 0, 3, 2, 4, 3, 4, 5,
- 7, 5, 6, 10, 8, 9, 6
-};
-
-static const char _thttp_machine_parser_header_Dummy_trans_actions[] = {
- 1, 0, 3, 0, 3, 0, 0, 1,
- 0, 0, 5, 7, 0, 0, 9
-};
-
-static const int thttp_machine_parser_header_Dummy_start = 1;
-static const int thttp_machine_parser_header_Dummy_first_final = 10;
-static const int thttp_machine_parser_header_Dummy_error = 0;
-
-static const int thttp_machine_parser_header_Dummy_en_main = 1;
-
-
-/* #line 103 "./ragel/thttp_parser_header_Dummy.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Dummy_first_final);
- (void)(thttp_machine_parser_header_Dummy_error);
- (void)(thttp_machine_parser_header_Dummy_en_main);
-
-/* #line 149 "./src/headers/thttp_header_Dummy.c" */
- {
- cs = thttp_machine_parser_header_Dummy_start;
- }
-
-/* #line 108 "./ragel/thttp_parser_header_Dummy.rl" */
-
-/* #line 156 "./src/headers/thttp_header_Dummy.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Dummy_t *hdr_Dummy = thttp_header_dummy_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 82 "./src/headers/thttp_header_Dummy.c" */
+ static const char _thttp_machine_parser_header_Dummy_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 2, 0, 2
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_key_offsets[] = {
+ 0, 0, 14, 31, 34, 37, 38, 39,
+ 40, 42, 45
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_trans_keys[] = {
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 13, 32, 0
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_single_lengths[] = {
+ 0, 4, 7, 3, 3, 1, 1, 1,
+ 2, 3, 0
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_range_lengths[] = {
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_index_offsets[] = {
+ 0, 0, 10, 23, 27, 31, 33, 35,
+ 37, 40, 44
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_indicies[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 2, 2, 3, 3, 3, 4,
+ 3, 3, 3, 3, 3, 3, 1, 5,
+ 5, 6, 1, 6, 8, 6, 7, 10,
+ 9, 11, 1, 12, 1, 13, 13, 1,
+ 13, 14, 13, 7, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_trans_targs[] = {
+ 2, 0, 3, 2, 4, 3, 4, 5,
+ 7, 5, 6, 10, 8, 9, 6
+ };
+
+ static const char _thttp_machine_parser_header_Dummy_trans_actions[] = {
+ 1, 0, 3, 0, 3, 0, 0, 1,
+ 0, 0, 5, 7, 0, 0, 9
+ };
+
+ static const int thttp_machine_parser_header_Dummy_start = 1;
+ static const int thttp_machine_parser_header_Dummy_first_final = 10;
+ static const int thttp_machine_parser_header_Dummy_error = 0;
+
+ static const int thttp_machine_parser_header_Dummy_en_main = 1;
+
+
+ /* #line 103 "./ragel/thttp_parser_header_Dummy.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Dummy_first_final);
+ (void)(thttp_machine_parser_header_Dummy_error);
+ (void)(thttp_machine_parser_header_Dummy_en_main);
+
+ /* #line 149 "./src/headers/thttp_header_Dummy.c" */
+ {
+ cs = thttp_machine_parser_header_Dummy_start;
+ }
+
+ /* #line 108 "./ragel/thttp_parser_header_Dummy.rl" */
+
+ /* #line 156 "./src/headers/thttp_header_Dummy.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Dummy_trans_keys + _thttp_machine_parser_header_Dummy_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Dummy_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Dummy_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Dummy_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Dummy_trans_keys + _thttp_machine_parser_header_Dummy_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Dummy_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Dummy_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Dummy_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Dummy_indicies[_trans];
- cs = _thttp_machine_parser_header_Dummy_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Dummy_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Dummy_actions + _thttp_machine_parser_header_Dummy_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/thttp_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/thttp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->name);
- }
- break;
- case 2:
-/* #line 51 "./ragel/thttp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
- case 3:
-/* #line 55 "./ragel/thttp_parser_header_Dummy.rl" */
- {
- }
- break;
-/* #line 253 "./src/headers/thttp_header_Dummy.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Dummy_indicies[_trans];
+ cs = _thttp_machine_parser_header_Dummy_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Dummy_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Dummy_actions + _thttp_machine_parser_header_Dummy_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/thttp_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/thttp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->name);
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/thttp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ case 3:
+ /* #line 55 "./ragel/thttp_parser_header_Dummy.rl" */
+ {
+ }
+ break;
+ /* #line 253 "./src/headers/thttp_header_Dummy.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 109 "./ragel/thttp_parser_header_Dummy.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 270 "./src/headers/thttp_header_Dummy.c" */
-10
-/* #line 111 "./ragel/thttp_parser_header_Dummy.rl" */
- ){
- TSK_OBJECT_SAFE_FREE(hdr_Dummy);
- }
-
- return hdr_Dummy;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 109 "./ragel/thttp_parser_header_Dummy.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 270 "./src/headers/thttp_header_Dummy.c" */
+ 10
+ /* #line 111 "./ragel/thttp_parser_header_Dummy.rl" */
+ ) {
+ TSK_OBJECT_SAFE_FREE(hdr_Dummy);
+ }
+
+ return hdr_Dummy;
}
@@ -288,41 +299,40 @@ _again:
static tsk_object_t* thttp_header_Dummy_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Dummy_t *Dummy = self;
- if(Dummy){
- THTTP_HEADER(Dummy)->type = thttp_htype_Dummy;
- THTTP_HEADER(Dummy)->tostring = thttp_header_Dummy_tostring;
-
- Dummy->name = tsk_strdup(va_arg(*app, const char*));
- Dummy->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Dummy header.");
- }
- return self;
+ thttp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ THTTP_HEADER(Dummy)->type = thttp_htype_Dummy;
+ THTTP_HEADER(Dummy)->tostring = thttp_header_Dummy_tostring;
+
+ Dummy->name = tsk_strdup(va_arg(*app, const char*));
+ Dummy->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Dummy header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Dummy_dtor(tsk_object_t *self)
{
- thttp_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSK_FREE(Dummy->name);
- TSK_FREE(Dummy->value);
-
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Dummy));
- }
- else{
- TSK_DEBUG_ERROR("Null Dummy header.");
- }
-
- return self;
+ thttp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSK_FREE(Dummy->name);
+ TSK_FREE(Dummy->value);
+
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Dummy));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Dummy header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Dummy_def_s =
-{
- sizeof(thttp_header_Dummy_t),
- thttp_header_Dummy_ctor,
- thttp_header_Dummy_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Dummy_def_s = {
+ sizeof(thttp_header_Dummy_t),
+ thttp_header_Dummy_ctor,
+ thttp_header_Dummy_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Dummy_def_t = &thttp_header_Dummy_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_ETag.c b/tinyHTTP/src/headers/thttp_header_ETag.c
index 021487e..115c541 100755
--- a/tinyHTTP/src/headers/thttp_header_ETag.c
+++ b/tinyHTTP/src/headers/thttp_header_ETag.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_ETag.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,256 +41,267 @@
thttp_header_ETag_t* thttp_header_etag_create(const char* value)
{
- return tsk_object_new(THTTP_HEADER_ETAG_VA_ARGS(value));
+ return tsk_object_new(THTTP_HEADER_ETAG_VA_ARGS(value));
}
thttp_header_ETag_t* thttp_header_etag_create_null()
-{
- return thttp_header_etag_create(tsk_null);
+{
+ return thttp_header_etag_create(tsk_null);
}
int thttp_header_ETag_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_ETag_t *ETag = (const thttp_header_ETag_t*)header;
- if(ETag->value){
- return tsk_buffer_append_2(output, "%s\"%s\"",
- ETag->isWeak ? "W/" : "",
- ETag->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_ETag_t *ETag = (const thttp_header_ETag_t*)header;
+ if(ETag->value) {
+ return tsk_buffer_append_2(output, "%s\"%s\"",
+ ETag->isWeak ? "W/" : "",
+ ETag->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_ETag_t *thttp_header_ETag_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_ETag_t *hdr_ETag = thttp_header_etag_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 83 "./src/headers/thttp_header_ETag.c" */
-static const char _thttp_machine_parser_header_ETag_actions[] = {
- 0, 1, 0, 1, 2, 1, 3, 2,
- 1, 0
-};
-
-static const char _thttp_machine_parser_header_ETag_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 17,
- 18, 20, 26, 27, 29, 32, 40, 41,
- 43, 44, 45, 51, 52, 56, 60
-};
-
-static const unsigned char _thttp_machine_parser_header_ETag_trans_keys[] = {
- 69u, 101u, 84u, 116u, 65u, 97u, 71u, 103u,
- 9u, 32u, 58u, 9u, 13u, 32u, 34u, 87u,
- 119u, 10u, 9u, 32u, 9u, 13u, 32u, 34u,
- 87u, 119u, 10u, 9u, 32u, 9u, 32u, 34u,
- 13u, 34u, 92u, 127u, 0u, 8u, 10u, 31u,
- 10u, 9u, 32u, 13u, 10u, 0u, 9u, 11u,
- 12u, 14u, 127u, 47u, 9u, 13u, 32u, 34u,
- 9u, 13u, 32u, 34u, 0
-};
-
-static const char _thttp_machine_parser_header_ETag_single_lengths[] = {
- 0, 2, 2, 2, 2, 3, 6, 1,
- 2, 6, 1, 2, 3, 4, 1, 2,
- 1, 1, 0, 1, 4, 4, 0
-};
-
-static const char _thttp_machine_parser_header_ETag_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 3, 0, 0, 0, 0
-};
-
-static const char _thttp_machine_parser_header_ETag_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 16, 23,
- 25, 28, 35, 37, 40, 44, 51, 53,
- 56, 58, 60, 64, 66, 71, 76
-};
-
-static const char _thttp_machine_parser_header_ETag_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 4, 4, 5, 1,
- 6, 7, 6, 8, 9, 9, 1, 10,
- 1, 11, 11, 1, 12, 13, 12, 8,
- 9, 9, 1, 14, 1, 15, 15, 1,
- 15, 15, 16, 1, 17, 18, 19, 1,
- 1, 1, 16, 20, 1, 16, 16, 1,
- 21, 1, 22, 1, 16, 16, 16, 1,
- 23, 1, 24, 25, 24, 26, 1, 27,
- 28, 27, 16, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_ETag_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 6, 7,
- 13, 19, 8, 9, 9, 10, 11, 12,
- 13, 14, 16, 18, 15, 17, 22, 20,
- 21, 10, 13, 21, 10
-};
-
-static const char _thttp_machine_parser_header_ETag_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 1,
- 1, 0, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 3, 5, 0,
- 7, 7, 7, 0, 0
-};
-
-static const int thttp_machine_parser_header_ETag_start = 1;
-static const int thttp_machine_parser_header_ETag_first_final = 22;
-static const int thttp_machine_parser_header_ETag_error = 0;
-
-static const int thttp_machine_parser_header_ETag_en_main = 1;
-
-
-/* #line 109 "./ragel/thttp_parser_header_ETag.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_ETag_first_final);
- (void)(thttp_machine_parser_header_ETag_error);
- (void)(thttp_machine_parser_header_ETag_en_main);
-
-/* #line 164 "./src/headers/thttp_header_ETag.c" */
- {
- cs = thttp_machine_parser_header_ETag_start;
- }
-
-/* #line 114 "./ragel/thttp_parser_header_ETag.rl" */
-
-/* #line 171 "./src/headers/thttp_header_ETag.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const unsigned char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_ETag_t *hdr_ETag = thttp_header_etag_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 83 "./src/headers/thttp_header_ETag.c" */
+ static const char _thttp_machine_parser_header_ETag_actions[] = {
+ 0, 1, 0, 1, 2, 1, 3, 2,
+ 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_ETag_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 17,
+ 18, 20, 26, 27, 29, 32, 40, 41,
+ 43, 44, 45, 51, 52, 56, 60
+ };
+
+ static const unsigned char _thttp_machine_parser_header_ETag_trans_keys[] = {
+ 69u, 101u, 84u, 116u, 65u, 97u, 71u, 103u,
+ 9u, 32u, 58u, 9u, 13u, 32u, 34u, 87u,
+ 119u, 10u, 9u, 32u, 9u, 13u, 32u, 34u,
+ 87u, 119u, 10u, 9u, 32u, 9u, 32u, 34u,
+ 13u, 34u, 92u, 127u, 0u, 8u, 10u, 31u,
+ 10u, 9u, 32u, 13u, 10u, 0u, 9u, 11u,
+ 12u, 14u, 127u, 47u, 9u, 13u, 32u, 34u,
+ 9u, 13u, 32u, 34u, 0
+ };
+
+ static const char _thttp_machine_parser_header_ETag_single_lengths[] = {
+ 0, 2, 2, 2, 2, 3, 6, 1,
+ 2, 6, 1, 2, 3, 4, 1, 2,
+ 1, 1, 0, 1, 4, 4, 0
+ };
+
+ static const char _thttp_machine_parser_header_ETag_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0
+ };
+
+ static const char _thttp_machine_parser_header_ETag_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 16, 23,
+ 25, 28, 35, 37, 40, 44, 51, 53,
+ 56, 58, 60, 64, 66, 71, 76
+ };
+
+ static const char _thttp_machine_parser_header_ETag_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 4, 4, 5, 1,
+ 6, 7, 6, 8, 9, 9, 1, 10,
+ 1, 11, 11, 1, 12, 13, 12, 8,
+ 9, 9, 1, 14, 1, 15, 15, 1,
+ 15, 15, 16, 1, 17, 18, 19, 1,
+ 1, 1, 16, 20, 1, 16, 16, 1,
+ 21, 1, 22, 1, 16, 16, 16, 1,
+ 23, 1, 24, 25, 24, 26, 1, 27,
+ 28, 27, 16, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_ETag_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 6, 7,
+ 13, 19, 8, 9, 9, 10, 11, 12,
+ 13, 14, 16, 18, 15, 17, 22, 20,
+ 21, 10, 13, 21, 10
+ };
+
+ static const char _thttp_machine_parser_header_ETag_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 0, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 0, 0, 3, 5, 0,
+ 7, 7, 7, 0, 0
+ };
+
+ static const int thttp_machine_parser_header_ETag_start = 1;
+ static const int thttp_machine_parser_header_ETag_first_final = 22;
+ static const int thttp_machine_parser_header_ETag_error = 0;
+
+ static const int thttp_machine_parser_header_ETag_en_main = 1;
+
+
+ /* #line 109 "./ragel/thttp_parser_header_ETag.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_ETag_first_final);
+ (void)(thttp_machine_parser_header_ETag_error);
+ (void)(thttp_machine_parser_header_ETag_en_main);
+
+ /* #line 164 "./src/headers/thttp_header_ETag.c" */
+ {
+ cs = thttp_machine_parser_header_ETag_start;
+ }
+
+ /* #line 114 "./ragel/thttp_parser_header_ETag.rl" */
+
+ /* #line 171 "./src/headers/thttp_header_ETag.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const unsigned char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_ETag_trans_keys + _thttp_machine_parser_header_ETag_key_offsets[cs];
- _trans = _thttp_machine_parser_header_ETag_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_ETag_single_lengths[cs];
- if ( _klen > 0 ) {
- const unsigned char *_lower = _keys;
- const unsigned char *_mid;
- const unsigned char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_ETag_range_lengths[cs];
- if ( _klen > 0 ) {
- const unsigned char *_lower = _keys;
- const unsigned char *_mid;
- const unsigned char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_ETag_trans_keys + _thttp_machine_parser_header_ETag_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_ETag_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_ETag_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_ETag_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_ETag_indicies[_trans];
- cs = _thttp_machine_parser_header_ETag_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_ETag_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_ETag_actions + _thttp_machine_parser_header_ETag_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/thttp_parser_header_ETag.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/thttp_parser_header_ETag.rl" */
- {
- hdr_ETag->isWeak = tsk_true;
- }
- break;
- case 2:
-/* #line 51 "./ragel/thttp_parser_header_ETag.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ETag->value);
- tsk_strunquote(&hdr_ETag->value);
- }
- break;
- case 3:
-/* #line 56 "./ragel/thttp_parser_header_ETag.rl" */
- {
- }
- break;
-/* #line 269 "./src/headers/thttp_header_ETag.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_ETag_indicies[_trans];
+ cs = _thttp_machine_parser_header_ETag_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_ETag_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_ETag_actions + _thttp_machine_parser_header_ETag_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/thttp_parser_header_ETag.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/thttp_parser_header_ETag.rl" */
+ {
+ hdr_ETag->isWeak = tsk_true;
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/thttp_parser_header_ETag.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ETag->value);
+ tsk_strunquote(&hdr_ETag->value);
+ }
+ break;
+ case 3:
+ /* #line 56 "./ragel/thttp_parser_header_ETag.rl" */
+ {
+ }
+ break;
+ /* #line 269 "./src/headers/thttp_header_ETag.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 115 "./ragel/thttp_parser_header_ETag.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 286 "./src/headers/thttp_header_ETag.c" */
-22
-/* #line 117 "./ragel/thttp_parser_header_ETag.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse ETag header.");
- TSK_OBJECT_SAFE_FREE(hdr_ETag);
- }
-
- return hdr_ETag;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 115 "./ragel/thttp_parser_header_ETag.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 286 "./src/headers/thttp_header_ETag.c" */
+ 22
+ /* #line 117 "./ragel/thttp_parser_header_ETag.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse ETag header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ETag);
+ }
+
+ return hdr_ETag;
}
@@ -305,40 +316,38 @@ _again:
static tsk_object_t* thttp_header_ETag_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_ETag_t *ETag = self;
- if(ETag){
- THTTP_HEADER(ETag)->type = thttp_htype_ETag;
- THTTP_HEADER(ETag)->tostring = thttp_header_ETag_tostring;
-
- ETag->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new ETag header.");
- }
- return self;
+ thttp_header_ETag_t *ETag = self;
+ if(ETag) {
+ THTTP_HEADER(ETag)->type = thttp_htype_ETag;
+ THTTP_HEADER(ETag)->tostring = thttp_header_ETag_tostring;
+
+ ETag->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new ETag header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_ETag_dtor(tsk_object_t *self)
{
- thttp_header_ETag_t *ETag = self;
- if(ETag)
- {
- TSK_FREE(ETag->value);
-
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(ETag));
- }
- else{
- TSK_DEBUG_ERROR("Null ETag header.");
- }
-
- return self;
+ thttp_header_ETag_t *ETag = self;
+ if(ETag) {
+ TSK_FREE(ETag->value);
+
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(ETag));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null ETag header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_ETag_def_s =
-{
- sizeof(thttp_header_ETag_t),
- thttp_header_ETag_ctor,
- thttp_header_ETag_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_ETag_def_s = {
+ sizeof(thttp_header_ETag_t),
+ thttp_header_ETag_ctor,
+ thttp_header_ETag_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_ETag_def_t = &thttp_header_ETag_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Accept.c b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Accept.c
index 2ce0c75..09ee69c 100755
--- a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Accept.c
+++ b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Accept.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,261 +35,274 @@
thttp_header_Sec_WebSocket_Accept_t* thttp_header_Sec_WebSocket_Accept_create(const char* value)
{
- return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_ACCEPT_VA_ARGS(value));
+ return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_ACCEPT_VA_ARGS(value));
}
thttp_header_Sec_WebSocket_Accept_t* thttp_header_Sec_WebSocket_Accept_create_null()
-{
- return thttp_header_Sec_WebSocket_Accept_create(tsk_null);
+{
+ return thttp_header_Sec_WebSocket_Accept_create(tsk_null);
}
int thttp_header_Sec_WebSocket_Accept_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = (const thttp_header_Sec_WebSocket_Accept_t*)header;
- if(Sec_WebSocket_Accept->value){
- return tsk_buffer_append(output, Sec_WebSocket_Accept->value, tsk_strlen(Sec_WebSocket_Accept->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = (const thttp_header_Sec_WebSocket_Accept_t*)header;
+ if(Sec_WebSocket_Accept->value) {
+ return tsk_buffer_append(output, Sec_WebSocket_Accept->value, tsk_strlen(Sec_WebSocket_Accept->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
thttp_header_Sec_WebSocket_Accept_t *thttp_header_Sec_WebSocket_Accept_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Sec_WebSocket_Accept_t *hdr_Sec_WebSocket_Accept = thttp_header_Sec_WebSocket_Accept_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 73 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 25, 26,
- 28, 30, 32, 34, 36, 38, 41, 51,
- 52, 54, 63, 70, 78, 86, 94, 95,
- 96, 97
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 45, 87,
- 119, 69, 101, 66, 98, 83, 115, 79,
- 111, 67, 99, 75, 107, 69, 101, 84,
- 116, 45, 65, 97, 67, 99, 67, 99,
- 69, 101, 80, 112, 84, 116, 9, 32,
- 58, 9, 13, 32, 43, 47, 57, 65,
- 90, 97, 122, 10, 9, 32, 9, 32,
- 43, 47, 57, 65, 90, 97, 122, 43,
- 47, 57, 65, 90, 97, 122, 43, 61,
- 47, 57, 65, 90, 97, 122, 43, 61,
- 47, 57, 65, 90, 97, 122, 13, 43,
- 47, 57, 65, 90, 97, 122, 10, 13,
- 61, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 3, 4, 1,
- 2, 3, 1, 2, 2, 2, 1, 1,
- 1, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3, 0,
- 0, 3, 3, 3, 3, 3, 0, 0,
- 0, 0
-};
-
-static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Accept_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 38, 40,
- 43, 46, 49, 52, 55, 58, 62, 70,
- 72, 75, 82, 87, 93, 99, 105, 107,
- 109, 111
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 20,
- 20, 1, 20, 20, 21, 1, 21, 22,
- 21, 23, 23, 23, 23, 1, 24, 1,
- 25, 25, 1, 25, 25, 23, 23, 23,
- 23, 1, 26, 26, 26, 26, 1, 27,
- 28, 27, 27, 27, 1, 29, 30, 29,
- 29, 29, 1, 31, 32, 32, 32, 32,
- 1, 33, 1, 31, 1, 30, 1, 1,
- 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 26,
- 24, 25, 27, 28, 32, 29, 31, 30,
- 26, 33
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 3
-};
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Accept_start = 1;
-static const int thttp_machine_parser_header_Sec_WebSocket_Accept_first_final = 33;
-static const int thttp_machine_parser_header_Sec_WebSocket_Accept_error = 0;
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Accept_en_main = 1;
-
-
-/* #line 84 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_first_final);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_error);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_en_main);
-
-/* #line 173 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
- {
- cs = thttp_machine_parser_header_Sec_WebSocket_Accept_start;
- }
-
-/* #line 89 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
-
-/* #line 180 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Sec_WebSocket_Accept_t *hdr_Sec_WebSocket_Accept = thttp_header_Sec_WebSocket_Accept_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 73 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 25, 26,
+ 28, 30, 32, 34, 36, 38, 41, 51,
+ 52, 54, 63, 70, 78, 86, 94, 95,
+ 96, 97
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 45, 87,
+ 119, 69, 101, 66, 98, 83, 115, 79,
+ 111, 67, 99, 75, 107, 69, 101, 84,
+ 116, 45, 65, 97, 67, 99, 67, 99,
+ 69, 101, 80, 112, 84, 116, 9, 32,
+ 58, 9, 13, 32, 43, 47, 57, 65,
+ 90, 97, 122, 10, 9, 32, 9, 32,
+ 43, 47, 57, 65, 90, 97, 122, 43,
+ 47, 57, 65, 90, 97, 122, 43, 61,
+ 47, 57, 65, 90, 97, 122, 43, 61,
+ 47, 57, 65, 90, 97, 122, 13, 43,
+ 47, 57, 65, 90, 97, 122, 10, 13,
+ 61, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 3, 4, 1,
+ 2, 3, 1, 2, 2, 2, 1, 1,
+ 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 3, 3, 3, 3, 3, 0, 0,
+ 0, 0
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Accept_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 38, 40,
+ 43, 46, 49, 52, 55, 58, 62, 70,
+ 72, 75, 82, 87, 93, 99, 105, 107,
+ 109, 111
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 20,
+ 20, 1, 20, 20, 21, 1, 21, 22,
+ 21, 23, 23, 23, 23, 1, 24, 1,
+ 25, 25, 1, 25, 25, 23, 23, 23,
+ 23, 1, 26, 26, 26, 26, 1, 27,
+ 28, 27, 27, 27, 1, 29, 30, 29,
+ 29, 29, 1, 31, 32, 32, 32, 32,
+ 1, 33, 1, 31, 1, 30, 1, 1,
+ 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 26,
+ 24, 25, 27, 28, 32, 29, 31, 30,
+ 26, 33
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 3
+ };
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Accept_start = 1;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Accept_first_final = 33;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Accept_error = 0;
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Accept_en_main = 1;
+
+
+ /* #line 84 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_first_final);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_error);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Accept_en_main);
+
+ /* #line 173 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
+ {
+ cs = thttp_machine_parser_header_Sec_WebSocket_Accept_start;
+ }
+
+ /* #line 89 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+
+ /* #line 180 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Accept_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Accept_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Accept_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Accept_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Accept_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Accept_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Accept_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Accept_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Accept_indicies[_trans];
- cs = _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Sec_WebSocket_Accept_actions + _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- { tag_start = p; }
- break;
- case 1:
-/* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- { }
- break;
- case 2:
-/* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Sec_WebSocket_Accept->value);
- }
- break;
-/* #line 268 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Accept_indicies[_trans];
+ cs = _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Sec_WebSocket_Accept_actions + _thttp_machine_parser_header_Sec_WebSocket_Accept_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ { }
+ break;
+ case 2:
+ /* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Sec_WebSocket_Accept->value);
+ }
+ break;
+ /* #line 268 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 90 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 285 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
-33
-/* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Accept header.");
- TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Accept);
- }
-
- return hdr_Sec_WebSocket_Accept;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 90 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 285 "./src/headers/thttp_header_Sec_WebSocket_Accept.c" */
+ 33
+ /* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Accept.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Accept header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Accept);
+ }
+
+ return hdr_Sec_WebSocket_Accept;
}
@@ -304,38 +317,37 @@ _again:
static tsk_object_t* thttp_header_Sec_WebSocket_Accept_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = self;
- if(Sec_WebSocket_Accept){
- THTTP_HEADER(Sec_WebSocket_Accept)->type = thttp_htype_Sec_WebSocket_Accept;
- THTTP_HEADER(Sec_WebSocket_Accept)->tostring = thttp_header_Sec_WebSocket_Accept_tostring;
-
- Sec_WebSocket_Accept->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Accept header.");
- }
- return self;
+ thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = self;
+ if(Sec_WebSocket_Accept) {
+ THTTP_HEADER(Sec_WebSocket_Accept)->type = thttp_htype_Sec_WebSocket_Accept;
+ THTTP_HEADER(Sec_WebSocket_Accept)->tostring = thttp_header_Sec_WebSocket_Accept_tostring;
+
+ Sec_WebSocket_Accept->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Accept header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Sec_WebSocket_Accept_dtor(tsk_object_t *self)
{
- thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = self;
- if(Sec_WebSocket_Accept){
- TSK_FREE(Sec_WebSocket_Accept->value);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Accept));
- }
- else{
- TSK_DEBUG_ERROR("Null Sec_WebSocket_Accept header.");
- }
-
- return self;
+ thttp_header_Sec_WebSocket_Accept_t *Sec_WebSocket_Accept = self;
+ if(Sec_WebSocket_Accept) {
+ TSK_FREE(Sec_WebSocket_Accept->value);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Accept));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Sec_WebSocket_Accept header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Sec_WebSocket_Accept_def_s =
-{
- sizeof(thttp_header_Sec_WebSocket_Accept_t),
- thttp_header_Sec_WebSocket_Accept_ctor,
- thttp_header_Sec_WebSocket_Accept_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Sec_WebSocket_Accept_def_s = {
+ sizeof(thttp_header_Sec_WebSocket_Accept_t),
+ thttp_header_Sec_WebSocket_Accept_ctor,
+ thttp_header_Sec_WebSocket_Accept_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Sec_WebSocket_Accept_def_t = &thttp_header_Sec_WebSocket_Accept_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Key.c b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Key.c
index 2041a92..202d837 100755
--- a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Key.c
+++ b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Key.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,252 +35,265 @@
thttp_header_Sec_WebSocket_Key_t* thttp_header_Sec_WebSocket_Key_create(const char* value)
{
- return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_KEY_VA_ARGS(value));
+ return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_KEY_VA_ARGS(value));
}
thttp_header_Sec_WebSocket_Key_t* thttp_header_Sec_WebSocket_Key_create_null()
-{
- return thttp_header_Sec_WebSocket_Key_create(tsk_null);
+{
+ return thttp_header_Sec_WebSocket_Key_create(tsk_null);
}
int thttp_header_Sec_WebSocket_Key_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = (const thttp_header_Sec_WebSocket_Key_t*)header;
- if(Sec_WebSocket_Key->value){
- return tsk_buffer_append(output, Sec_WebSocket_Key->value, tsk_strlen(Sec_WebSocket_Key->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = (const thttp_header_Sec_WebSocket_Key_t*)header;
+ if(Sec_WebSocket_Key->value) {
+ return tsk_buffer_append(output, Sec_WebSocket_Key->value, tsk_strlen(Sec_WebSocket_Key->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
thttp_header_Sec_WebSocket_Key_t *thttp_header_Sec_WebSocket_Key_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Sec_WebSocket_Key_t *hdr_Sec_WebSocket_Key = thttp_header_Sec_WebSocket_Key_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 73 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 25, 26,
- 28, 30, 32, 35, 45, 46, 48, 57,
- 64, 72, 80, 88, 89, 90, 91
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 45, 87,
- 119, 69, 101, 66, 98, 83, 115, 79,
- 111, 67, 99, 75, 107, 69, 101, 84,
- 116, 45, 75, 107, 69, 101, 89, 121,
- 9, 32, 58, 9, 13, 32, 43, 47,
- 57, 65, 90, 97, 122, 10, 9, 32,
- 9, 32, 43, 47, 57, 65, 90, 97,
- 122, 43, 47, 57, 65, 90, 97, 122,
- 43, 61, 47, 57, 65, 90, 97, 122,
- 43, 61, 47, 57, 65, 90, 97, 122,
- 13, 43, 47, 57, 65, 90, 97, 122,
- 10, 13, 61, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 3, 4, 1, 2, 3, 1,
- 2, 2, 2, 1, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 3, 3,
- 3, 3, 3, 0, 0, 0, 0
-};
-
-static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Key_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 38, 40,
- 43, 46, 49, 53, 61, 63, 66, 73,
- 78, 84, 90, 96, 98, 100, 102
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 17, 17, 18, 1, 18, 19, 18,
- 20, 20, 20, 20, 1, 21, 1, 22,
- 22, 1, 22, 22, 20, 20, 20, 20,
- 1, 23, 23, 23, 23, 1, 24, 25,
- 24, 24, 24, 1, 26, 27, 26, 26,
- 26, 1, 28, 29, 29, 29, 29, 1,
- 30, 1, 28, 1, 27, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 23, 21, 22, 24,
- 25, 29, 26, 28, 27, 23, 30
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 5, 0, 3
-};
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Key_start = 1;
-static const int thttp_machine_parser_header_Sec_WebSocket_Key_first_final = 30;
-static const int thttp_machine_parser_header_Sec_WebSocket_Key_error = 0;
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Key_en_main = 1;
-
-
-/* #line 84 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Key_first_final);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Key_error);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Key_en_main);
-
-/* #line 164 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
- {
- cs = thttp_machine_parser_header_Sec_WebSocket_Key_start;
- }
-
-/* #line 89 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
-
-/* #line 171 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Sec_WebSocket_Key_t *hdr_Sec_WebSocket_Key = thttp_header_Sec_WebSocket_Key_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 73 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 25, 26,
+ 28, 30, 32, 35, 45, 46, 48, 57,
+ 64, 72, 80, 88, 89, 90, 91
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 45, 87,
+ 119, 69, 101, 66, 98, 83, 115, 79,
+ 111, 67, 99, 75, 107, 69, 101, 84,
+ 116, 45, 75, 107, 69, 101, 89, 121,
+ 9, 32, 58, 9, 13, 32, 43, 47,
+ 57, 65, 90, 97, 122, 10, 9, 32,
+ 9, 32, 43, 47, 57, 65, 90, 97,
+ 122, 43, 47, 57, 65, 90, 97, 122,
+ 43, 61, 47, 57, 65, 90, 97, 122,
+ 43, 61, 47, 57, 65, 90, 97, 122,
+ 13, 43, 47, 57, 65, 90, 97, 122,
+ 10, 13, 61, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 3, 4, 1, 2, 3, 1,
+ 2, 2, 2, 1, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3, 0, 0, 3, 3,
+ 3, 3, 3, 0, 0, 0, 0
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Key_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 38, 40,
+ 43, 46, 49, 53, 61, 63, 66, 73,
+ 78, 84, 90, 96, 98, 100, 102
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 17, 17, 18, 1, 18, 19, 18,
+ 20, 20, 20, 20, 1, 21, 1, 22,
+ 22, 1, 22, 22, 20, 20, 20, 20,
+ 1, 23, 23, 23, 23, 1, 24, 25,
+ 24, 24, 24, 1, 26, 27, 26, 26,
+ 26, 1, 28, 29, 29, 29, 29, 1,
+ 30, 1, 28, 1, 27, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 23, 21, 22, 24,
+ 25, 29, 26, 28, 27, 23, 30
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 3
+ };
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Key_start = 1;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Key_first_final = 30;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Key_error = 0;
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Key_en_main = 1;
+
+
+ /* #line 84 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Key_first_final);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Key_error);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Key_en_main);
+
+ /* #line 164 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
+ {
+ cs = thttp_machine_parser_header_Sec_WebSocket_Key_start;
+ }
+
+ /* #line 89 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+
+ /* #line 171 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Sec_WebSocket_Key_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Key_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Key_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Key_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Key_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Sec_WebSocket_Key_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Key_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Key_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Key_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Key_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Key_indicies[_trans];
- cs = _thttp_machine_parser_header_Sec_WebSocket_Key_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Sec_WebSocket_Key_actions + _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- { tag_start = p; }
- break;
- case 1:
-/* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- { }
- break;
- case 2:
-/* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Sec_WebSocket_Key->value);
- }
- break;
-/* #line 259 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Key_indicies[_trans];
+ cs = _thttp_machine_parser_header_Sec_WebSocket_Key_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Sec_WebSocket_Key_actions + _thttp_machine_parser_header_Sec_WebSocket_Key_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ { }
+ break;
+ case 2:
+ /* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Sec_WebSocket_Key->value);
+ }
+ break;
+ /* #line 259 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 90 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 276 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
-30
-/* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Key header.");
- TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Key);
- }
-
- return hdr_Sec_WebSocket_Key;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 90 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 276 "./src/headers/thttp_header_Sec_WebSocket_Key.c" */
+ 30
+ /* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Key.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Key header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Key);
+ }
+
+ return hdr_Sec_WebSocket_Key;
}
@@ -295,38 +308,37 @@ _again:
static tsk_object_t* thttp_header_Sec_WebSocket_Key_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = self;
- if(Sec_WebSocket_Key){
- THTTP_HEADER(Sec_WebSocket_Key)->type = thttp_htype_Sec_WebSocket_Key;
- THTTP_HEADER(Sec_WebSocket_Key)->tostring = thttp_header_Sec_WebSocket_Key_tostring;
-
- Sec_WebSocket_Key->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Key header.");
- }
- return self;
+ thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = self;
+ if(Sec_WebSocket_Key) {
+ THTTP_HEADER(Sec_WebSocket_Key)->type = thttp_htype_Sec_WebSocket_Key;
+ THTTP_HEADER(Sec_WebSocket_Key)->tostring = thttp_header_Sec_WebSocket_Key_tostring;
+
+ Sec_WebSocket_Key->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Key header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Sec_WebSocket_Key_dtor(tsk_object_t *self)
{
- thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = self;
- if(Sec_WebSocket_Key){
- TSK_FREE(Sec_WebSocket_Key->value);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Key));
- }
- else{
- TSK_DEBUG_ERROR("Null Sec_WebSocket_Key header.");
- }
-
- return self;
+ thttp_header_Sec_WebSocket_Key_t *Sec_WebSocket_Key = self;
+ if(Sec_WebSocket_Key) {
+ TSK_FREE(Sec_WebSocket_Key->value);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Key));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Sec_WebSocket_Key header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Sec_WebSocket_Key_def_s =
-{
- sizeof(thttp_header_Sec_WebSocket_Key_t),
- thttp_header_Sec_WebSocket_Key_ctor,
- thttp_header_Sec_WebSocket_Key_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Sec_WebSocket_Key_def_s = {
+ sizeof(thttp_header_Sec_WebSocket_Key_t),
+ thttp_header_Sec_WebSocket_Key_ctor,
+ thttp_header_Sec_WebSocket_Key_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Sec_WebSocket_Key_def_t = &thttp_header_Sec_WebSocket_Key_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Protocol.c b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Protocol.c
index d6a7f53..5fdcad0 100755
--- a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Protocol.c
+++ b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Protocol.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,270 +36,283 @@
thttp_header_Sec_WebSocket_Protocol_t* thttp_header_Sec_WebSocket_Protocol_create(const char* protocol)
{
- return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_PROTOCOL_VA_ARGS(protocol));
+ return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_PROTOCOL_VA_ARGS(protocol));
}
thttp_header_Sec_WebSocket_Protocol_t* thttp_header_Sec_WebSocket_Protocol_create_null()
-{
- return thttp_header_Sec_WebSocket_Protocol_create(tsk_null);
+{
+ return thttp_header_Sec_WebSocket_Protocol_create(tsk_null);
}
int thttp_header_Sec_WebSocket_Protocol_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = (const thttp_header_Sec_WebSocket_Protocol_t*)header;
- if(Sec_WebSocket_Protocol->values){
- const tsk_list_item_t* item;
- const char* str;
- tsk_list_foreach(item, Sec_WebSocket_Protocol->values){
- if((str = TSK_STRING_STR(item->data))){
- tsk_buffer_append(output, str, tsk_strlen(str));
- }
- }
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = (const thttp_header_Sec_WebSocket_Protocol_t*)header;
+ if(Sec_WebSocket_Protocol->values) {
+ const tsk_list_item_t* item;
+ const char* str;
+ tsk_list_foreach(item, Sec_WebSocket_Protocol->values) {
+ if((str = TSK_STRING_STR(item->data))) {
+ tsk_buffer_append(output, str, tsk_strlen(str));
+ }
+ }
+ }
+ return 0;
+ }
+
+ return -1;
}
thttp_header_Sec_WebSocket_Protocol_t *thttp_header_Sec_WebSocket_Protocol_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Sec_WebSocket_Protocol_t *hdr_Sec_WebSocket_Protocol = thttp_header_Sec_WebSocket_Protocol_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 80 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 25, 26,
- 28, 30, 32, 34, 36, 38, 40, 42,
- 45, 62, 63, 65, 81, 97, 101, 102,
- 104, 107, 108
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 45, 87,
- 119, 69, 101, 66, 98, 83, 115, 79,
- 111, 67, 99, 75, 107, 69, 101, 84,
- 116, 45, 80, 112, 82, 114, 79, 111,
- 84, 116, 79, 111, 67, 99, 79, 111,
- 76, 108, 9, 32, 58, 9, 13, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 10, 9, 32,
- 9, 32, 44, 10, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 2, 3,
- 7, 1, 2, 6, 8, 4, 1, 2,
- 3, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 0, 5, 4, 0, 0, 0,
- 0, 0, 0
-};
-
-static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Protocol_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 38, 40,
- 43, 46, 49, 52, 55, 58, 61, 64,
- 68, 81, 83, 86, 98, 111, 116, 118,
- 121, 125, 127
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 20,
- 20, 1, 21, 21, 1, 22, 22, 1,
- 22, 22, 23, 1, 23, 24, 23, 25,
- 25, 25, 25, 25, 25, 25, 25, 25,
- 1, 26, 1, 27, 27, 1, 27, 27,
- 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 1, 28, 29, 28, 30, 30, 30,
- 31, 30, 30, 30, 30, 30, 1, 32,
- 33, 32, 23, 1, 34, 1, 35, 35,
- 1, 35, 35, 23, 1, 36, 1, 1,
- 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 28, 26, 27, 29, 33, 28, 24,
- 29, 30, 31, 32, 34
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 5, 5, 0, 5,
- 0, 0, 0, 0, 3
-};
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_start = 1;
-static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_first_final = 34;
-static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_error = 0;
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_en_main = 1;
-
-
-/* #line 93 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_first_final);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_error);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_en_main);
-
-/* #line 183 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
- {
- cs = thttp_machine_parser_header_Sec_WebSocket_Protocol_start;
- }
-
-/* #line 98 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
-
-/* #line 190 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Sec_WebSocket_Protocol_t *hdr_Sec_WebSocket_Protocol = thttp_header_Sec_WebSocket_Protocol_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 80 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 25, 26,
+ 28, 30, 32, 34, 36, 38, 40, 42,
+ 45, 62, 63, 65, 81, 97, 101, 102,
+ 104, 107, 108
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 45, 87,
+ 119, 69, 101, 66, 98, 83, 115, 79,
+ 111, 67, 99, 75, 107, 69, 101, 84,
+ 116, 45, 80, 112, 82, 114, 79, 111,
+ 84, 116, 79, 111, 67, 99, 79, 111,
+ 76, 108, 9, 32, 58, 9, 13, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 10, 9, 32,
+ 9, 32, 44, 10, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 2, 3,
+ 7, 1, 2, 6, 8, 4, 1, 2,
+ 3, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 0, 0, 5, 4, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Protocol_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 38, 40,
+ 43, 46, 49, 52, 55, 58, 61, 64,
+ 68, 81, 83, 86, 98, 111, 116, 118,
+ 121, 125, 127
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 20,
+ 20, 1, 21, 21, 1, 22, 22, 1,
+ 22, 22, 23, 1, 23, 24, 23, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25,
+ 1, 26, 1, 27, 27, 1, 27, 27,
+ 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 1, 28, 29, 28, 30, 30, 30,
+ 31, 30, 30, 30, 30, 30, 1, 32,
+ 33, 32, 23, 1, 34, 1, 35, 35,
+ 1, 35, 35, 23, 1, 36, 1, 1,
+ 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 28, 26, 27, 29, 33, 28, 24,
+ 29, 30, 31, 32, 34
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 5, 5, 0, 5,
+ 0, 0, 0, 0, 3
+ };
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_start = 1;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_first_final = 34;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_error = 0;
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Protocol_en_main = 1;
+
+
+ /* #line 93 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_first_final);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_error);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Protocol_en_main);
+
+ /* #line 183 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
+ {
+ cs = thttp_machine_parser_header_Sec_WebSocket_Protocol_start;
+ }
+
+ /* #line 98 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+
+ /* #line 190 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Protocol_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Protocol_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Protocol_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Protocol_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Protocol_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Protocol_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Protocol_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Protocol_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Protocol_indicies[_trans];
- cs = _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Sec_WebSocket_Protocol_actions + _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- { tag_start = p; }
- break;
- case 1:
-/* #line 39 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- { }
- break;
- case 2:
-/* #line 41 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_Sec_WebSocket_Protocol->values);
- }
- break;
-/* #line 278 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Protocol_indicies[_trans];
+ cs = _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Sec_WebSocket_Protocol_actions + _thttp_machine_parser_header_Sec_WebSocket_Protocol_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 39 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ { }
+ break;
+ case 2:
+ /* #line 41 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_Sec_WebSocket_Protocol->values);
+ }
+ break;
+ /* #line 278 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 99 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 295 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
-34
-/* #line 101 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Protocol header.");
- TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Protocol);
- }
-
- return hdr_Sec_WebSocket_Protocol;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 99 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 295 "./src/headers/thttp_header_Sec_WebSocket_Protocol.c" */
+ 34
+ /* #line 101 "./ragel/thttp_parser_header_Sec_WebSocket_Protocol.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Protocol header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Protocol);
+ }
+
+ return hdr_Sec_WebSocket_Protocol;
}
@@ -314,45 +327,44 @@ _again:
static tsk_object_t* thttp_header_Sec_WebSocket_Protocol_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = self;
- if(Sec_WebSocket_Protocol){
- const char* protocol;
- Sec_WebSocket_Protocol->values = tsk_list_create();
- THTTP_HEADER(Sec_WebSocket_Protocol)->type = thttp_htype_Sec_WebSocket_Protocol;
- THTTP_HEADER(Sec_WebSocket_Protocol)->tostring = thttp_header_Sec_WebSocket_Protocol_tostring;
-
- if((protocol = va_arg(*app, const char*))){
- tsk_string_t* str_ver = tsk_string_create(protocol);
- if(str_ver){
- tsk_list_push_back_data(Sec_WebSocket_Protocol->values, ((void**) &str_ver));
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Protocol header.");
- }
- return self;
+ thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = self;
+ if(Sec_WebSocket_Protocol) {
+ const char* protocol;
+ Sec_WebSocket_Protocol->values = tsk_list_create();
+ THTTP_HEADER(Sec_WebSocket_Protocol)->type = thttp_htype_Sec_WebSocket_Protocol;
+ THTTP_HEADER(Sec_WebSocket_Protocol)->tostring = thttp_header_Sec_WebSocket_Protocol_tostring;
+
+ if((protocol = va_arg(*app, const char*))) {
+ tsk_string_t* str_ver = tsk_string_create(protocol);
+ if(str_ver) {
+ tsk_list_push_back_data(Sec_WebSocket_Protocol->values, ((void**) &str_ver));
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Protocol header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Sec_WebSocket_Protocol_dtor(tsk_object_t *self)
{
- thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = self;
- if(Sec_WebSocket_Protocol){
- TSK_OBJECT_SAFE_FREE(Sec_WebSocket_Protocol->values);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Protocol));
- }
- else{
- TSK_DEBUG_ERROR("Null Sec_WebSocket_Protocol header.");
- }
-
- return self;
+ thttp_header_Sec_WebSocket_Protocol_t *Sec_WebSocket_Protocol = self;
+ if(Sec_WebSocket_Protocol) {
+ TSK_OBJECT_SAFE_FREE(Sec_WebSocket_Protocol->values);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Protocol));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Sec_WebSocket_Protocol header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Sec_WebSocket_Protocol_def_s =
-{
- sizeof(thttp_header_Sec_WebSocket_Protocol_t),
- thttp_header_Sec_WebSocket_Protocol_ctor,
- thttp_header_Sec_WebSocket_Protocol_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Sec_WebSocket_Protocol_def_s = {
+ sizeof(thttp_header_Sec_WebSocket_Protocol_t),
+ thttp_header_Sec_WebSocket_Protocol_ctor,
+ thttp_header_Sec_WebSocket_Protocol_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Sec_WebSocket_Protocol_def_t = &thttp_header_Sec_WebSocket_Protocol_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Version.c b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Version.c
index 98486fd..f2bf3b8 100755
--- a/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Version.c
+++ b/tinyHTTP/src/headers/thttp_header_Sec_WebSocket_Version.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,266 +35,279 @@
thttp_header_Sec_WebSocket_Version_t* thttp_header_Sec_WebSocket_Version_create(const char* version)
{
- return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_VERSION_VA_ARGS(version));
+ return tsk_object_new(THTTP_HEADER_SEC_WEBSOCKET_VERSION_VA_ARGS(version));
}
thttp_header_Sec_WebSocket_Version_t* thttp_header_Sec_WebSocket_Version_create_null()
-{
- return thttp_header_Sec_WebSocket_Version_create(tsk_null);
+{
+ return thttp_header_Sec_WebSocket_Version_create(tsk_null);
}
int thttp_header_Sec_WebSocket_Version_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = (const thttp_header_Sec_WebSocket_Version_t*)header;
- if(Sec_WebSocket_Version->values){
- const tsk_list_item_t* item;
- const char* str;
- tsk_list_foreach(item, Sec_WebSocket_Version->values){
- if((str = TSK_STRING_STR(item->data))){
- tsk_buffer_append(output, str, tsk_strlen(str));
- }
- }
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = (const thttp_header_Sec_WebSocket_Version_t*)header;
+ if(Sec_WebSocket_Version->values) {
+ const tsk_list_item_t* item;
+ const char* str;
+ tsk_list_foreach(item, Sec_WebSocket_Version->values) {
+ if((str = TSK_STRING_STR(item->data))) {
+ tsk_buffer_append(output, str, tsk_strlen(str));
+ }
+ }
+ }
+ return 0;
+ }
+
+ return -1;
}
thttp_header_Sec_WebSocket_Version_t *thttp_header_Sec_WebSocket_Version_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Sec_WebSocket_Version_t *hdr_Sec_WebSocket_Version = thttp_header_Sec_WebSocket_Version_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 79 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 25, 26,
- 28, 30, 32, 34, 36, 38, 40, 43,
- 51, 52, 54, 61, 65, 69, 70, 72,
- 75, 76, 82, 88
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 45, 87,
- 119, 69, 101, 66, 98, 83, 115, 79,
- 111, 67, 99, 75, 107, 69, 101, 84,
- 116, 45, 86, 118, 69, 101, 82, 114,
- 83, 115, 73, 105, 79, 111, 78, 110,
- 9, 32, 58, 9, 13, 32, 48, 49,
- 50, 51, 57, 10, 9, 32, 9, 32,
- 48, 49, 50, 51, 57, 9, 13, 32,
- 44, 9, 13, 32, 44, 10, 9, 32,
- 9, 32, 44, 10, 9, 13, 32, 44,
- 48, 57, 9, 13, 32, 44, 48, 57,
- 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 3, 4,
- 1, 2, 3, 4, 4, 1, 2, 3,
- 1, 4, 4, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2,
- 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 1, 1, 0
-};
-
-static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Version_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 38, 40,
- 43, 46, 49, 52, 55, 58, 61, 65,
- 72, 74, 77, 83, 88, 93, 95, 98,
- 102, 104, 110, 116
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 20,
- 20, 1, 21, 21, 1, 21, 21, 22,
- 1, 22, 23, 22, 24, 25, 26, 1,
- 27, 1, 28, 28, 1, 28, 28, 24,
- 25, 26, 1, 29, 30, 29, 31, 1,
- 32, 33, 32, 22, 1, 34, 1, 35,
- 35, 1, 35, 35, 22, 1, 36, 1,
- 29, 30, 29, 31, 37, 1, 29, 30,
- 29, 31, 38, 1, 1, 0
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 27, 33, 34, 25, 26, 28, 32, 23,
- 28, 29, 30, 31, 35, 34, 27
-};
-
-static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 0, 0, 5, 5, 5,
- 0, 0, 0, 0, 3, 0, 0
-};
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Version_start = 1;
-static const int thttp_machine_parser_header_Sec_WebSocket_Version_first_final = 35;
-static const int thttp_machine_parser_header_Sec_WebSocket_Version_error = 0;
-
-static const int thttp_machine_parser_header_Sec_WebSocket_Version_en_main = 1;
-
-
-/* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Version_first_final);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Version_error);
- (void)(thttp_machine_parser_header_Sec_WebSocket_Version_en_main);
-
-/* #line 178 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
- {
- cs = thttp_machine_parser_header_Sec_WebSocket_Version_start;
- }
-
-/* #line 97 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
-
-/* #line 185 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Sec_WebSocket_Version_t *hdr_Sec_WebSocket_Version = thttp_header_Sec_WebSocket_Version_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 79 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 25, 26,
+ 28, 30, 32, 34, 36, 38, 40, 43,
+ 51, 52, 54, 61, 65, 69, 70, 72,
+ 75, 76, 82, 88
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 45, 87,
+ 119, 69, 101, 66, 98, 83, 115, 79,
+ 111, 67, 99, 75, 107, 69, 101, 84,
+ 116, 45, 86, 118, 69, 101, 82, 114,
+ 83, 115, 73, 105, 79, 111, 78, 110,
+ 9, 32, 58, 9, 13, 32, 48, 49,
+ 50, 51, 57, 10, 9, 32, 9, 32,
+ 48, 49, 50, 51, 57, 9, 13, 32,
+ 44, 9, 13, 32, 44, 10, 9, 32,
+ 9, 32, 44, 10, 9, 13, 32, 44,
+ 48, 57, 9, 13, 32, 44, 48, 57,
+ 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 3, 4,
+ 1, 2, 3, 4, 4, 1, 2, 3,
+ 1, 4, 4, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 2,
+ 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Sec_WebSocket_Version_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 38, 40,
+ 43, 46, 49, 52, 55, 58, 61, 65,
+ 72, 74, 77, 83, 88, 93, 95, 98,
+ 102, 104, 110, 116
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 20,
+ 20, 1, 21, 21, 1, 21, 21, 22,
+ 1, 22, 23, 22, 24, 25, 26, 1,
+ 27, 1, 28, 28, 1, 28, 28, 24,
+ 25, 26, 1, 29, 30, 29, 31, 1,
+ 32, 33, 32, 22, 1, 34, 1, 35,
+ 35, 1, 35, 35, 22, 1, 36, 1,
+ 29, 30, 29, 31, 37, 1, 29, 30,
+ 29, 31, 38, 1, 1, 0
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 27, 33, 34, 25, 26, 28, 32, 23,
+ 28, 29, 30, 31, 35, 34, 27
+ };
+
+ static const char _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 0, 0, 5, 5, 5,
+ 0, 0, 0, 0, 3, 0, 0
+ };
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Version_start = 1;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Version_first_final = 35;
+ static const int thttp_machine_parser_header_Sec_WebSocket_Version_error = 0;
+
+ static const int thttp_machine_parser_header_Sec_WebSocket_Version_en_main = 1;
+
+
+ /* #line 92 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Version_first_final);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Version_error);
+ (void)(thttp_machine_parser_header_Sec_WebSocket_Version_en_main);
+
+ /* #line 178 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
+ {
+ cs = thttp_machine_parser_header_Sec_WebSocket_Version_start;
+ }
+
+ /* #line 97 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+
+ /* #line 185 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Sec_WebSocket_Version_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Version_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Version_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Version_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Sec_WebSocket_Version_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Sec_WebSocket_Version_trans_keys + _thttp_machine_parser_header_Sec_WebSocket_Version_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Version_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Version_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Sec_WebSocket_Version_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Sec_WebSocket_Version_indicies[_trans];
- cs = _thttp_machine_parser_header_Sec_WebSocket_Version_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Sec_WebSocket_Version_actions + _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- { tag_start = p; }
- break;
- case 1:
-/* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- { }
- break;
- case 2:
-/* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_Sec_WebSocket_Version->values);
- }
- break;
-/* #line 273 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Sec_WebSocket_Version_indicies[_trans];
+ cs = _thttp_machine_parser_header_Sec_WebSocket_Version_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Sec_WebSocket_Version_actions + _thttp_machine_parser_header_Sec_WebSocket_Version_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 37 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 38 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ { }
+ break;
+ case 2:
+ /* #line 40 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_Sec_WebSocket_Version->values);
+ }
+ break;
+ /* #line 273 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 98 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 290 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
-35
-/* #line 100 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Version header.");
- TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Version);
- }
-
- return hdr_Sec_WebSocket_Version;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 98 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 290 "./src/headers/thttp_header_Sec_WebSocket_Version.c" */
+ 35
+ /* #line 100 "./ragel/thttp_parser_header_Sec_WebSocket_Version.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Sec-WebSocket-Version header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Sec_WebSocket_Version);
+ }
+
+ return hdr_Sec_WebSocket_Version;
}
@@ -309,45 +322,44 @@ _again:
static tsk_object_t* thttp_header_Sec_WebSocket_Version_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = self;
- if(Sec_WebSocket_Version){
- const char* version;
- Sec_WebSocket_Version->values = tsk_list_create();
- THTTP_HEADER(Sec_WebSocket_Version)->type = thttp_htype_Sec_WebSocket_Version;
- THTTP_HEADER(Sec_WebSocket_Version)->tostring = thttp_header_Sec_WebSocket_Version_tostring;
-
- if((version = va_arg(*app, const char*))){
- tsk_string_t* str_ver = tsk_string_create(version);
- if(str_ver){
- tsk_list_push_back_data(Sec_WebSocket_Version->values, ((void**) &str_ver));
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Version header.");
- }
- return self;
+ thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = self;
+ if(Sec_WebSocket_Version) {
+ const char* version;
+ Sec_WebSocket_Version->values = tsk_list_create();
+ THTTP_HEADER(Sec_WebSocket_Version)->type = thttp_htype_Sec_WebSocket_Version;
+ THTTP_HEADER(Sec_WebSocket_Version)->tostring = thttp_header_Sec_WebSocket_Version_tostring;
+
+ if((version = va_arg(*app, const char*))) {
+ tsk_string_t* str_ver = tsk_string_create(version);
+ if(str_ver) {
+ tsk_list_push_back_data(Sec_WebSocket_Version->values, ((void**) &str_ver));
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Sec-WebSocket-Version header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Sec_WebSocket_Version_dtor(tsk_object_t *self)
{
- thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = self;
- if(Sec_WebSocket_Version){
- TSK_OBJECT_SAFE_FREE(Sec_WebSocket_Version->values);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Version));
- }
- else{
- TSK_DEBUG_ERROR("Null Sec_WebSocket_Version header.");
- }
-
- return self;
+ thttp_header_Sec_WebSocket_Version_t *Sec_WebSocket_Version = self;
+ if(Sec_WebSocket_Version) {
+ TSK_OBJECT_SAFE_FREE(Sec_WebSocket_Version->values);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Sec_WebSocket_Version));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Sec_WebSocket_Version header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Sec_WebSocket_Version_def_s =
-{
- sizeof(thttp_header_Sec_WebSocket_Version_t),
- thttp_header_Sec_WebSocket_Version_ctor,
- thttp_header_Sec_WebSocket_Version_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Sec_WebSocket_Version_def_s = {
+ sizeof(thttp_header_Sec_WebSocket_Version_t),
+ thttp_header_Sec_WebSocket_Version_ctor,
+ thttp_header_Sec_WebSocket_Version_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Sec_WebSocket_Version_def_t = &thttp_header_Sec_WebSocket_Version_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_Transfer_Encoding.c b/tinyHTTP/src/headers/thttp_header_Transfer_Encoding.c
index a6e2afd..265a1ee 100755
--- a/tinyHTTP/src/headers/thttp_header_Transfer_Encoding.c
+++ b/tinyHTTP/src/headers/thttp_header_Transfer_Encoding.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,288 +39,299 @@
thttp_header_Transfer_Encoding_t* thttp_header_transfer_encoding_create(const char* encoding)
{
- return tsk_object_new(THTTP_HEADER_TRANSFER_ENCODING_VA_ARGS(encoding));
+ return tsk_object_new(THTTP_HEADER_TRANSFER_ENCODING_VA_ARGS(encoding));
}
thttp_header_Transfer_Encoding_t* thttp_header_transfer_encoding_create_null()
{
- return thttp_header_transfer_encoding_create(tsk_null);
+ return thttp_header_transfer_encoding_create(tsk_null);
}
int thttp_header_Transfer_Encoding_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_Transfer_Encoding_t *Transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)header;
- if(Transfer_Encoding->encoding){
- return tsk_buffer_append(output, Transfer_Encoding->encoding, tsk_strlen(Transfer_Encoding->encoding));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const thttp_header_Transfer_Encoding_t *Transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)header;
+ if(Transfer_Encoding->encoding) {
+ return tsk_buffer_append(output, Transfer_Encoding->encoding, tsk_strlen(Transfer_Encoding->encoding));
+ }
+ return 0;
+ }
+
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_Transfer_Encoding_t *thttp_header_Transfer_Encoding_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_Transfer_Encoding_t *hdr_tencoding = thttp_header_transfer_encoding_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 79 "./src/headers/thttp_header_Transfer_Encoding.c" */
-static const char _thttp_machine_parser_header_Transfer_Encoding_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const unsigned char _thttp_machine_parser_header_Transfer_Encoding_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 17, 19, 21, 23, 25, 27,
- 29, 31, 33, 36, 53, 54, 56, 72,
- 88, 89, 102, 118, 124, 130, 143, 158,
- 164, 170
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_trans_keys[] = {
- 84, 116, 82, 114, 65, 97, 78, 110,
- 83, 115, 70, 102, 69, 101, 82, 114,
- 45, 69, 101, 78, 110, 67, 99, 79,
- 111, 68, 100, 73, 105, 78, 110, 71,
- 103, 9, 32, 58, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 32, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 33, 37, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 13, 33,
- 37, 59, 61, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 48, 57,
- 65, 70, 97, 102, 48, 57, 65, 70,
- 97, 102, 33, 37, 93, 95, 126, 36,
- 43, 45, 58, 65, 91, 97, 122, 13,
- 33, 37, 59, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 48, 57,
- 65, 70, 97, 102, 48, 57, 65, 70,
- 97, 102, 0
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 3, 7, 1, 2, 6, 6,
- 1, 5, 8, 0, 0, 5, 7, 0,
- 0, 0
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 0, 0, 5, 5,
- 0, 4, 4, 3, 3, 4, 4, 3,
- 3, 0
-};
-
-static const unsigned char _thttp_machine_parser_header_Transfer_Encoding_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 24, 26, 29, 32, 35, 38, 41,
- 44, 47, 50, 54, 67, 69, 72, 84,
- 96, 98, 108, 121, 125, 129, 139, 151,
- 155, 159
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 8, 1,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 15, 1, 16, 16, 1, 17,
- 17, 1, 17, 17, 18, 1, 18, 19,
- 18, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 1, 21, 1, 22, 22, 1,
- 22, 22, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 1, 23, 24, 24, 24,
- 25, 24, 24, 24, 24, 24, 24, 1,
- 26, 1, 27, 28, 27, 27, 27, 27,
- 27, 27, 27, 1, 29, 30, 31, 32,
- 33, 30, 30, 30, 30, 30, 30, 30,
- 1, 34, 34, 34, 1, 30, 30, 30,
- 1, 35, 36, 35, 35, 35, 35, 35,
- 35, 35, 1, 29, 35, 36, 32, 35,
- 35, 35, 35, 35, 35, 35, 1, 37,
- 37, 37, 1, 35, 35, 35, 1, 1,
- 0
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 23, 21, 22, 24,
- 23, 25, 33, 26, 27, 24, 26, 27,
- 25, 29, 28, 30, 31, 32
-};
-
-static const char _thttp_machine_parser_header_Transfer_Encoding_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 3,
- 0, 3, 7, 1, 1, 5, 0, 0,
- 5, 0, 0, 0, 0, 0
-};
-
-static const int thttp_machine_parser_header_Transfer_Encoding_start = 1;
-static const int thttp_machine_parser_header_Transfer_Encoding_first_final = 33;
-static const int thttp_machine_parser_header_Transfer_Encoding_error = 0;
-
-static const int thttp_machine_parser_header_Transfer_Encoding_en_main = 1;
-
-
-/* #line 100 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_Transfer_Encoding_first_final);
- (void)(thttp_machine_parser_header_Transfer_Encoding_error);
- (void)(thttp_machine_parser_header_Transfer_Encoding_en_main);
-
-/* #line 195 "./src/headers/thttp_header_Transfer_Encoding.c" */
- {
- cs = thttp_machine_parser_header_Transfer_Encoding_start;
- }
-
-/* #line 105 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
-
-/* #line 202 "./src/headers/thttp_header_Transfer_Encoding.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_Transfer_Encoding_t *hdr_tencoding = thttp_header_transfer_encoding_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 79 "./src/headers/thttp_header_Transfer_Encoding.c" */
+ static const char _thttp_machine_parser_header_Transfer_Encoding_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Transfer_Encoding_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 17, 19, 21, 23, 25, 27,
+ 29, 31, 33, 36, 53, 54, 56, 72,
+ 88, 89, 102, 118, 124, 130, 143, 158,
+ 164, 170
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_trans_keys[] = {
+ 84, 116, 82, 114, 65, 97, 78, 110,
+ 83, 115, 70, 102, 69, 101, 82, 114,
+ 45, 69, 101, 78, 110, 67, 99, 79,
+ 111, 68, 100, 73, 105, 78, 110, 71,
+ 103, 9, 32, 58, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 32, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 33, 37, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 13, 33,
+ 37, 59, 61, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 48, 57,
+ 65, 70, 97, 102, 48, 57, 65, 70,
+ 97, 102, 33, 37, 93, 95, 126, 36,
+ 43, 45, 58, 65, 91, 97, 122, 13,
+ 33, 37, 59, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 48, 57,
+ 65, 70, 97, 102, 48, 57, 65, 70,
+ 97, 102, 0
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 2, 2,
+ 2, 2, 3, 7, 1, 2, 6, 6,
+ 1, 5, 8, 0, 0, 5, 7, 0,
+ 0, 0
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 0, 0, 5, 5,
+ 0, 4, 4, 3, 3, 4, 4, 3,
+ 3, 0
+ };
+
+ static const unsigned char _thttp_machine_parser_header_Transfer_Encoding_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 24, 26, 29, 32, 35, 38, 41,
+ 44, 47, 50, 54, 67, 69, 72, 84,
+ 96, 98, 108, 121, 125, 129, 139, 151,
+ 155, 159
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 8, 1,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 15, 1, 16, 16, 1, 17,
+ 17, 1, 17, 17, 18, 1, 18, 19,
+ 18, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 1, 21, 1, 22, 22, 1,
+ 22, 22, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 1, 23, 24, 24, 24,
+ 25, 24, 24, 24, 24, 24, 24, 1,
+ 26, 1, 27, 28, 27, 27, 27, 27,
+ 27, 27, 27, 1, 29, 30, 31, 32,
+ 33, 30, 30, 30, 30, 30, 30, 30,
+ 1, 34, 34, 34, 1, 30, 30, 30,
+ 1, 35, 36, 35, 35, 35, 35, 35,
+ 35, 35, 1, 29, 35, 36, 32, 35,
+ 35, 35, 35, 35, 35, 35, 1, 37,
+ 37, 37, 1, 35, 35, 35, 1, 1,
+ 0
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 23, 21, 22, 24,
+ 23, 25, 33, 26, 27, 24, 26, 27,
+ 25, 29, 28, 30, 31, 32
+ };
+
+ static const char _thttp_machine_parser_header_Transfer_Encoding_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 3,
+ 0, 3, 7, 1, 1, 5, 0, 0,
+ 5, 0, 0, 0, 0, 0
+ };
+
+ static const int thttp_machine_parser_header_Transfer_Encoding_start = 1;
+ static const int thttp_machine_parser_header_Transfer_Encoding_first_final = 33;
+ static const int thttp_machine_parser_header_Transfer_Encoding_error = 0;
+
+ static const int thttp_machine_parser_header_Transfer_Encoding_en_main = 1;
+
+
+ /* #line 100 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_Transfer_Encoding_first_final);
+ (void)(thttp_machine_parser_header_Transfer_Encoding_error);
+ (void)(thttp_machine_parser_header_Transfer_Encoding_en_main);
+
+ /* #line 195 "./src/headers/thttp_header_Transfer_Encoding.c" */
+ {
+ cs = thttp_machine_parser_header_Transfer_Encoding_start;
+ }
+
+ /* #line 105 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+
+ /* #line 202 "./src/headers/thttp_header_Transfer_Encoding.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_Transfer_Encoding_trans_keys + _thttp_machine_parser_header_Transfer_Encoding_key_offsets[cs];
- _trans = _thttp_machine_parser_header_Transfer_Encoding_index_offsets[cs];
-
- _klen = _thttp_machine_parser_header_Transfer_Encoding_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_header_Transfer_Encoding_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_header_Transfer_Encoding_trans_keys + _thttp_machine_parser_header_Transfer_Encoding_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_Transfer_Encoding_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_header_Transfer_Encoding_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_header_Transfer_Encoding_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_Transfer_Encoding_indicies[_trans];
- cs = _thttp_machine_parser_header_Transfer_Encoding_trans_targs[_trans];
-
- if ( _thttp_machine_parser_header_Transfer_Encoding_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_header_Transfer_Encoding_actions + _thttp_machine_parser_header_Transfer_Encoding_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 40 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 44 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_tencoding->encoding);
- }
- break;
- case 2:
-/* #line 48 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- {
- TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_tencoding));
- }
- break;
- case 3:
-/* #line 52 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- {
- }
- break;
-/* #line 299 "./src/headers/thttp_header_Transfer_Encoding.c" */
- }
- }
+ _trans = _thttp_machine_parser_header_Transfer_Encoding_indicies[_trans];
+ cs = _thttp_machine_parser_header_Transfer_Encoding_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_header_Transfer_Encoding_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_header_Transfer_Encoding_actions + _thttp_machine_parser_header_Transfer_Encoding_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 40 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 44 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_tencoding->encoding);
+ }
+ break;
+ case 2:
+ /* #line 48 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_tencoding));
+ }
+ break;
+ case 3:
+ /* #line 52 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ {
+ }
+ break;
+ /* #line 299 "./src/headers/thttp_header_Transfer_Encoding.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 106 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 316 "./src/headers/thttp_header_Transfer_Encoding.c" */
-33
-/* #line 108 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Tansfer-Encoding header.");
- TSK_OBJECT_SAFE_FREE(hdr_tencoding);
- }
-
- return hdr_tencoding;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 106 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 316 "./src/headers/thttp_header_Transfer_Encoding.c" */
+ 33
+ /* #line 108 "./ragel/thttp_parser_header_Transfer_Encoding.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Tansfer-Encoding header.");
+ TSK_OBJECT_SAFE_FREE(hdr_tencoding);
+ }
+
+ return hdr_tencoding;
}
@@ -335,38 +346,37 @@ _again:
static tsk_object_t* thttp_header_Transfer_Encoding_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_Transfer_Encoding_t *Transfer_Encoding = self;
- if(Transfer_Encoding){
- THTTP_HEADER(Transfer_Encoding)->type = thttp_htype_Transfer_Encoding;
- THTTP_HEADER(Transfer_Encoding)->tostring = thttp_header_Transfer_Encoding_tostring;
-
- Transfer_Encoding->encoding = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Transfer_Encoding header.");
- }
- return self;
+ thttp_header_Transfer_Encoding_t *Transfer_Encoding = self;
+ if(Transfer_Encoding) {
+ THTTP_HEADER(Transfer_Encoding)->type = thttp_htype_Transfer_Encoding;
+ THTTP_HEADER(Transfer_Encoding)->tostring = thttp_header_Transfer_Encoding_tostring;
+
+ Transfer_Encoding->encoding = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Transfer_Encoding header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_Transfer_Encoding_dtor(tsk_object_t* self)
{
- thttp_header_Transfer_Encoding_t *Transfer_Encoding = self;
- if(Transfer_Encoding){
- TSK_FREE(Transfer_Encoding->encoding);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Transfer_Encoding));
- }
- else{
- TSK_DEBUG_ERROR("Null Transfer_Encoding header.");
- }
-
- return self;
+ thttp_header_Transfer_Encoding_t *Transfer_Encoding = self;
+ if(Transfer_Encoding) {
+ TSK_FREE(Transfer_Encoding->encoding);
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(Transfer_Encoding));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Transfer_Encoding header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_header_Transfer_Encoding_def_s =
-{
- sizeof(thttp_header_Transfer_Encoding_t),
- thttp_header_Transfer_Encoding_ctor,
- thttp_header_Transfer_Encoding_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_Transfer_Encoding_def_s = {
+ sizeof(thttp_header_Transfer_Encoding_t),
+ thttp_header_Transfer_Encoding_ctor,
+ thttp_header_Transfer_Encoding_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_Transfer_Encoding_def_t = &thttp_header_Transfer_Encoding_def_s;
diff --git a/tinyHTTP/src/headers/thttp_header_WWW_Authenticate.c b/tinyHTTP/src/headers/thttp_header_WWW_Authenticate.c
index e8125e4..c99e8a5 100755
--- a/tinyHTTP/src/headers/thttp_header_WWW_Authenticate.c
+++ b/tinyHTTP/src/headers/thttp_header_WWW_Authenticate.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,8223 +47,8234 @@
thttp_header_WWW_Authenticate_t* thttp_header_www_authenticate_create()
{
- return tsk_object_new(thttp_header_WWW_Authenticate_def_t);
+ return tsk_object_new(thttp_header_WWW_Authenticate_def_t);
}
int thttp_header_WWW_Authenticate_tostring(const thttp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const thttp_header_WWW_Authenticate_t *WWW_Authenticate = (const thttp_header_WWW_Authenticate_t*)header;
- if(WWW_Authenticate && WWW_Authenticate->scheme){
- return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
- WWW_Authenticate->scheme,
- WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
-
- WWW_Authenticate->domain ? ",domain=\"" : "",
- WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
- WWW_Authenticate->domain ? "\"" : "",
-
-
- WWW_Authenticate->qop ? ",qop=\"" : "",
- WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
- WWW_Authenticate->qop ? "\"" : "",
+ if(header) {
+ const thttp_header_WWW_Authenticate_t *WWW_Authenticate = (const thttp_header_WWW_Authenticate_t*)header;
+ if(WWW_Authenticate && WWW_Authenticate->scheme) {
+ return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
+ WWW_Authenticate->scheme,
+ WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
+
+ WWW_Authenticate->domain ? ",domain=\"" : "",
+ WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
+ WWW_Authenticate->domain ? "\"" : "",
+
+
+ WWW_Authenticate->qop ? ",qop=\"" : "",
+ WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
+ WWW_Authenticate->qop ? "\"" : "",
- WWW_Authenticate->nonce ? ",nonce=\"" : "",
- WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
- WWW_Authenticate->nonce ? "\"" : "",
+ WWW_Authenticate->nonce ? ",nonce=\"" : "",
+ WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
+ WWW_Authenticate->nonce ? "\"" : "",
- WWW_Authenticate->opaque ? ",opaque=\"" : "",
- WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
- WWW_Authenticate->opaque ? "\"" : "",
+ WWW_Authenticate->opaque ? ",opaque=\"" : "",
+ WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
+ WWW_Authenticate->opaque ? "\"" : "",
- WWW_Authenticate->stale ? "TRUE" : "FALSE",
+ WWW_Authenticate->stale ? "TRUE" : "FALSE",
- WWW_Authenticate->algorithm ? ",algorithm=" : "",
- WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
- );
- }
- }
- return -1;
+ WWW_Authenticate->algorithm ? ",algorithm=" : "",
+ WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
+ );
+ }
+ }
+ return -1;
}
/**@ingroup thttp_header_group
*/
thttp_header_WWW_Authenticate_t *thttp_header_WWW_Authenticate_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- thttp_header_WWW_Authenticate_t *hdr_WWW_Authenticate = thttp_header_www_authenticate_create();
-
- const char *tag_start = tsk_null;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ thttp_header_WWW_Authenticate_t *hdr_WWW_Authenticate = thttp_header_www_authenticate_create();
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 105 "./src/headers/thttp_header_WWW_Authenticate.c" */
-static const char _thttp_machine_parser_header_WWW_Authenticate_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 2, 0, 6,
- 2, 0, 7, 2, 0, 8, 2, 0,
- 11, 2, 0, 12, 2, 5, 0, 2,
- 6, 0, 2, 7, 0, 2, 8, 0,
- 2, 12, 0
-};
+ const char *tag_start = tsk_null;
-static const short _thttp_machine_parser_header_WWW_Authenticate_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 13,
- 15, 17, 19, 21, 23, 25, 27, 29,
- 31, 33, 35, 37, 40, 47, 48, 50,
- 57, 59, 66, 69, 72, 75, 78, 81,
- 112, 114, 145, 162, 167, 169, 174, 205,
- 207, 238, 257, 259, 278, 297, 299, 318,
- 320, 324, 332, 334, 338, 342, 344, 348,
- 350, 369, 388, 407, 426, 443, 448, 450,
- 455, 474, 476, 495, 497, 501, 509, 511,
- 515, 520, 536, 544, 553, 562, 571, 574,
- 582, 592, 595, 599, 602, 606, 609, 613,
- 617, 619, 623, 625, 629, 631, 641, 651,
- 660, 669, 678, 687, 690, 697, 707, 717,
- 727, 730, 734, 738, 740, 742, 744, 763,
- 782, 801, 820, 839, 856, 861, 863, 868,
- 887, 889, 908, 910, 914, 922, 924, 928,
- 933, 935, 954, 973, 990, 995, 997, 1002,
- 1021, 1023, 1042, 1044, 1048, 1056, 1064, 1066,
- 1069, 1073, 1075, 1079, 1098, 1117, 1136, 1155,
- 1172, 1177, 1179, 1184, 1203, 1205, 1224, 1226,
- 1230, 1238, 1240, 1244, 1249, 1251, 1270, 1289,
- 1308, 1327, 1344, 1349, 1351, 1356, 1379, 1381,
- 1404, 1422, 1440, 1458, 1476, 1480, 1498, 1516,
- 1518, 1521, 1527, 1536, 1538, 1547, 1549, 1558,
- 1594, 1596, 1632, 1654, 1664, 1666, 1676, 1699,
- 1701, 1724, 1726, 1734, 1743, 1752, 1754, 1759,
- 1780, 1795, 1811, 1827, 1843, 1853, 1868, 1885,
- 1895, 1906, 1916, 1927, 1937, 1948, 1959, 1968,
- 1979, 1988, 1999, 2008, 2025, 2042, 2058, 2074,
- 2090, 2106, 2116, 2130, 2147, 2164, 2181, 2191,
- 2202, 2213, 2222, 2231, 2233, 2257, 2281, 2305,
- 2329, 2353, 2377, 2401, 2425, 2447, 2457, 2459,
- 2469, 2492, 2494, 2517, 2538, 2540, 2564, 2588,
- 2612, 2636, 2660, 2682, 2692, 2694, 2704, 2727,
- 2729, 2752, 2754, 2762, 2771, 2779, 2781, 2784,
- 2787, 2793, 2802, 2805, 2814, 2850, 2853, 2889,
- 2911, 2921, 2924, 2934, 2957, 2960, 2983, 2986,
- 2994, 3015, 3018, 3036, 3042, 3045, 3051, 3083,
- 3086, 3118, 3138, 3141, 3161, 3180, 3183, 3202,
- 3205, 3209, 3226, 3231, 3234, 3239, 3242, 3262,
- 3282, 3302, 3322, 3340, 3346, 3349, 3355, 3374,
- 3377, 3396, 3399, 3403, 3412, 3414, 3423, 3425,
- 3434, 3470, 3472, 3508, 3530, 3540, 3542, 3552,
- 3575, 3577, 3600, 3602, 3610, 3619, 3640, 3649,
- 3651, 3666, 3682, 3698, 3714, 3724, 3739, 3756,
- 3766, 3777, 3787, 3798, 3808, 3819, 3830, 3839,
- 3848, 3859, 3868, 3879, 3888, 3905, 3922, 3938,
- 3954, 3970, 3986, 3996, 4010, 4027, 4044, 4061,
- 4071, 4082, 4093, 4102, 4111, 4113, 4137, 4161,
- 4185, 4209, 4233, 4257, 4281, 4305, 4327, 4337,
- 4339, 4349, 4372, 4374, 4397, 4418, 4420, 4444,
- 4468, 4492, 4516, 4540, 4562, 4572, 4574, 4584,
- 4607, 4609, 4632, 4634, 4642, 4651, 4653, 4677,
- 4701, 4725, 4749, 4771, 4781, 4783, 4793, 4816,
- 4818, 4841, 4843, 4851, 4860, 4862, 4886, 4910,
- 4934, 4958, 4982, 5004, 5014, 5016, 5026, 5049,
- 5051, 5074, 5076, 5084, 5093, 5102, 5104, 5113,
- 5149, 5151, 5187, 5209, 5219, 5221, 5231, 5254,
- 5256, 5279, 5281, 5289, 5298, 5319, 5321, 5336,
- 5352, 5368, 5384, 5394, 5409, 5426, 5436, 5447,
- 5457, 5468, 5478, 5489, 5500, 5509, 5518, 5529,
- 5538, 5549, 5558, 5575, 5592, 5608, 5624, 5640,
- 5656, 5666, 5680, 5697, 5714, 5731, 5741, 5752,
- 5763, 5772, 5781, 5783, 5807, 5831, 5855, 5879,
- 5903, 5927, 5951, 5975, 5997, 6007, 6009, 6019,
- 6042, 6044, 6067, 6088, 6090, 6114, 6138, 6162,
- 6186, 6210, 6232, 6242, 6244, 6254, 6277, 6279,
- 6302, 6304, 6312, 6321, 6323, 6347, 6371, 6395,
- 6419, 6441, 6451, 6453, 6463, 6486, 6488, 6511,
- 6513, 6521, 6530, 6532, 6556, 6580, 6604, 6628,
- 6652, 6674, 6684, 6686, 6696, 6719, 6721, 6744,
- 6746, 6754, 6763, 6765, 6789, 6813, 6835, 6845,
- 6847, 6857, 6880, 6882, 6905, 6907, 6915, 6924,
- 6933, 6936, 6945, 6981, 6984, 7020, 7042, 7052,
- 7055, 7065, 7088, 7091, 7114, 7117, 7125, 7146,
- 7149, 7167, 7173, 7176, 7182, 7214, 7217, 7249,
- 7269, 7272, 7292, 7311, 7314, 7333, 7336, 7340,
- 7357, 7362, 7365, 7370, 7373, 7393, 7413, 7433,
- 7453, 7471, 7477, 7480, 7486, 7505, 7508, 7527,
- 7530, 7534, 7543, 7553, 7563, 7573, 7577, 7586,
- 7597, 7601, 7606, 7610, 7615, 7619, 7624, 7629,
- 7632, 7637, 7642, 7645, 7650, 7653, 7664, 7675,
- 7685, 7695, 7705, 7715, 7719, 7727, 7738, 7749,
- 7760, 7764, 7769, 7774, 7777, 7780, 7783, 7803,
- 7823, 7843, 7863, 7883, 7901, 7907, 7910, 7916,
- 7935, 7938, 7957, 7960, 7964, 7973, 7975, 7984,
- 7987, 8007, 8027, 8045, 8051, 8054, 8060, 8079,
- 8082, 8101, 8104, 8124, 8144, 8164, 8184, 8202,
- 8208, 8211, 8217, 8236, 8239, 8258, 8261, 8265,
- 8274, 8276, 8285, 8287, 8296, 8332, 8334, 8370,
- 8392, 8402, 8404, 8414, 8437, 8439, 8462, 8464,
- 8472, 8481, 8502, 8511, 8513, 8528, 8544, 8560,
- 8576, 8586, 8601, 8618, 8628, 8639, 8649, 8660,
- 8670, 8681, 8692, 8701, 8710, 8721, 8730, 8741,
- 8750, 8767, 8784, 8800, 8816, 8832, 8848, 8858,
- 8872, 8889, 8906, 8923, 8933, 8944, 8955, 8964,
- 8973, 8975, 8999, 9023, 9047, 9071, 9095, 9119,
- 9143, 9167, 9189, 9199, 9201, 9211, 9234, 9236,
- 9259, 9280, 9282, 9306, 9330, 9354, 9378, 9402,
- 9424, 9434, 9436, 9446, 9469, 9471, 9494, 9496,
- 9504, 9513, 9515, 9539, 9563, 9587, 9611, 9633,
- 9643, 9645, 9655, 9678, 9680, 9703, 9705, 9713,
- 9722, 9724, 9748, 9772, 9796, 9820, 9844, 9866,
- 9876, 9878, 9888, 9911, 9913, 9936, 9938, 9946,
- 9955, 9957, 9981, 10005, 10027, 10037, 10039, 10049,
- 10072, 10074, 10097, 10099, 10107, 10116, 10118, 10142,
- 10166, 10190, 10214, 10236, 10246, 10248, 10258, 10281,
- 10283, 10306, 10308, 10316, 10325, 10327, 10351, 10375,
- 10399, 10423, 10445, 10455, 10457, 10467, 10494, 10496,
- 10523, 10546, 10569, 10592, 10615, 10624, 10647, 10670,
- 10672, 10675, 10695, 10715, 10735, 10755, 10773, 10779,
- 10782, 10788, 10811, 10814, 10837, 10856, 10875, 10894,
- 10913, 10918, 10937, 10956, 10959, 10979, 10999, 11019,
- 11039, 11057, 11063, 11066, 11072, 11091, 11094, 11113,
- 11116, 11120, 11129, 11138, 11141, 11150, 11170, 11190,
- 11210, 11230, 11250, 11268, 11274, 11277, 11283, 11302,
- 11305, 11324, 11327, 11331, 11340, 11350, 11360, 11370,
- 11374, 11383, 11394, 11398, 11403, 11407, 11412, 11416,
- 11421, 11426, 11429, 11434, 11439, 11442, 11447, 11450,
- 11461, 11472, 11482, 11492, 11502, 11512, 11516, 11524,
- 11535, 11546, 11557, 11561, 11566, 11571, 11574, 11577,
- 11580, 11600, 11620, 11638, 11644, 11647, 11653, 11672,
- 11675, 11694, 11697, 11701, 11710, 11719, 11722, 11731,
- 11734, 11754, 11774, 11794, 11814, 11832, 11838, 11841,
- 11847, 11866, 11869, 11888, 11891, 11895, 11898, 11918,
- 11938, 11958, 11978, 11996, 12002, 12005, 12011, 12034,
- 12037, 12060, 12079, 12098, 12117, 12136, 12141, 12160,
- 12179, 12182, 12185, 12205, 12225, 12245, 12265, 12285,
- 12305, 12325, 12343, 12349, 12352, 12358, 12377, 12380,
- 12399, 12416, 12419, 12434, 12450, 12466, 12482, 12492,
- 12507, 12524, 12534, 12545, 12555, 12566, 12576, 12587,
- 12598, 12607, 12616, 12627, 12636, 12647, 12656, 12673,
- 12690, 12706, 12722, 12738, 12754, 12764, 12778, 12795,
- 12812, 12829, 12839, 12850, 12861, 12870, 12879, 12882,
- 12906, 12930, 12954, 12978, 13002, 13026, 13050, 13074,
- 13096, 13106, 13109, 13119, 13142, 13145, 13168, 13189,
- 13192, 13216, 13240, 13264, 13288, 13312, 13334, 13344,
- 13347, 13357, 13380, 13383, 13406, 13409, 13417, 13420,
- 13444, 13468, 13492, 13516, 13538, 13548, 13551, 13561,
- 13584, 13587, 13610, 13613, 13621, 13624, 13648, 13672,
- 13696, 13720, 13744, 13766, 13776, 13779, 13789, 13812,
- 13815, 13838, 13841, 13849, 13852, 13876, 13900, 13922,
- 13932, 13935, 13945, 13968, 13971, 13994, 13997, 14021,
- 14045, 14069, 14093, 14115, 14125, 14128, 14138, 14161,
- 14164, 14187, 14190, 14198, 14201, 14225, 14249, 14273,
- 14297, 14319, 14329, 14332, 14342, 14369, 14372, 14399,
- 14422, 14445, 14468, 14491, 14500, 14523, 14546, 14549,
- 14551, 14575, 14599, 14623, 14647, 14669, 14679, 14681,
- 14691, 14714, 14716, 14739, 14741, 14749, 14758, 14760,
- 14784, 14808, 14832, 14856, 14878, 14888, 14890, 14900,
- 14927, 14929, 14956, 14979, 15002, 15025, 15048, 15057,
- 15080, 15103, 15105, 15107, 15131, 15155, 15177, 15187,
- 15189, 15199, 15222, 15224, 15247, 15249, 15257, 15266,
- 15268, 15292, 15316, 15340, 15364, 15386, 15396, 15398,
- 15408, 15431, 15433, 15456, 15458, 15466, 15475, 15477,
- 15501, 15525, 15549, 15573, 15595, 15605, 15607, 15617,
- 15644, 15646, 15673, 15696, 15719, 15742, 15765, 15774,
- 15797, 15820, 15822, 15825, 15845, 15865, 15885, 15905,
- 15923, 15929, 15932, 15938, 15957, 15960, 15979, 15982,
- 16002, 16022, 16042, 16062, 16082, 16102, 16122, 16140,
- 16146, 16149, 16155, 16174, 16177, 16196, 16213, 16216,
- 16231, 16247, 16263, 16279, 16289, 16304, 16321, 16331,
- 16342, 16352, 16363, 16373, 16384, 16395, 16404, 16413,
- 16424, 16433, 16444, 16453, 16470, 16487, 16503, 16519,
- 16535, 16551, 16561, 16575, 16592, 16609, 16626, 16636,
- 16647, 16658, 16667, 16676, 16679, 16703, 16727, 16751,
- 16775, 16799, 16823, 16847, 16871, 16893, 16903, 16906,
- 16916, 16939, 16942, 16965, 16986, 16989, 17013, 17037,
- 17061, 17085, 17109, 17131, 17141, 17144, 17154, 17177,
- 17180, 17203, 17206, 17230, 17254, 17278, 17302, 17324,
- 17334, 17337, 17347, 17370, 17373, 17396, 17399, 17407,
- 17410, 17434, 17458, 17482, 17506, 17530, 17552, 17562,
- 17565, 17575, 17598, 17601, 17624, 17627, 17635, 17638,
- 17662, 17686, 17708, 17718, 17721, 17731, 17754, 17757,
- 17780, 17783, 17791, 17794, 17818, 17842, 17866, 17890,
- 17912, 17922, 17925, 17935, 17958, 17961, 17984, 17987,
- 17995, 17998, 18022, 18046, 18070, 18094, 18116, 18126,
- 18129, 18139, 18166, 18169, 18196, 18219, 18242, 18265,
- 18288, 18297, 18320, 18343, 18346, 18348, 18372, 18396,
- 18420, 18444, 18466, 18476, 18478, 18488, 18511, 18513,
- 18536, 18538, 18546, 18548, 18572, 18596, 18620, 18644,
- 18668, 18690, 18700, 18702, 18712, 18735, 18737, 18760,
- 18762, 18770, 18772, 18796, 18820, 18842, 18852, 18854,
- 18864, 18887, 18889, 18912, 18914, 18922, 18931, 18933,
- 18957, 18981, 19005, 19029, 19051, 19061, 19063, 19073,
- 19096, 19098, 19121, 19123, 19131, 19133, 19157, 19181,
- 19205, 19229, 19251, 19261, 19263, 19273, 19300, 19302,
- 19329, 19352, 19375, 19398, 19421, 19430, 19453, 19476,
- 19478, 19480, 19499, 19518, 19537, 19556, 19573, 19578,
- 19580, 19585, 19604, 19606, 19625, 19627, 19631, 19639,
- 19641, 19660, 19679, 19698, 19717, 19736, 19755, 19774,
- 19791, 19796, 19798, 19803, 19822, 19824, 19843, 19859,
- 19861, 19880, 19899, 19918, 19937, 19956, 19973, 19978,
- 19980, 19985, 20004, 20006, 20025, 20027, 20031, 20039,
- 20047, 20050, 20056, 20065, 20067, 20076, 20078, 20087,
- 20123, 20125, 20161, 20183, 20193, 20195, 20205, 20228,
- 20230, 20253, 20274, 20283, 20285, 20300, 20316, 20332,
- 20348, 20358, 20373, 20390, 20400, 20411, 20421, 20432,
- 20442, 20453, 20464, 20473, 20482, 20493, 20502, 20513,
- 20522, 20539, 20556, 20572, 20588, 20604, 20620, 20630,
- 20644, 20661, 20678, 20695, 20705, 20716, 20727, 20736,
- 20745, 20747, 20771, 20795, 20819, 20843, 20867, 20891,
- 20915, 20939, 20961, 20971, 20973, 20983, 21006, 21008,
- 21031, 21052, 21054, 21078, 21102, 21126, 21150, 21174,
- 21196, 21206, 21208, 21218, 21241, 21243, 21266, 21268,
- 21276, 21285, 21287, 21311, 21335, 21359, 21383, 21405,
- 21415, 21417, 21427, 21450, 21452, 21475, 21477, 21501,
- 21525, 21549, 21573, 21597, 21619, 21629, 21631, 21641,
- 21664, 21666, 21689, 21691, 21715, 21739, 21761, 21771,
- 21773, 21783, 21806, 21808, 21831, 21833, 21841, 21850,
- 21852, 21876, 21900, 21924, 21948, 21970, 21980, 21982,
- 21992, 22015, 22017, 22040, 22042, 22066, 22090, 22114,
- 22138, 22160, 22170, 22172, 22182, 22209, 22211, 22238,
- 22261, 22284, 22307, 22330, 22339, 22362, 22385, 22387,
- 22389, 22408, 22427, 22444, 22449, 22451, 22456, 22475,
- 22477, 22496, 22498, 22502, 22510, 22518, 22521, 22527,
- 22529, 22532, 22535, 22538, 22541, 22544, 22547, 22549,
- 22552, 22554, 22556, 22557, 22560, 22563, 22566, 22569,
- 22600, 22603, 22606, 22609, 22612, 22643, 22646, 22649,
- 22652, 22655, 22686, 22689, 22692, 22695, 22698, 22729,
- 22732, 22735, 22738, 22740, 22771, 22774, 22777, 22780,
- 22783, 22814, 22817, 22820, 22851, 22855, 22886, 22917,
- 22920, 22923, 22926, 22929, 22932, 22963, 22966, 22969,
- 23000, 23003, 23006, 23009, 23011, 23015, 23019, 23023,
- 23027, 23031, 23035, 23067, 23071, 23075, 23107, 23111,
- 23115, 23119, 23151, 23155, 23159, 23163, 23194, 23225,
- 23228, 23231, 23234, 23237, 23240, 23271, 23274, 23277,
- 23308, 23311, 23314, 23317, 23348, 23351, 23354, 23357,
- 23388, 23391, 23394, 23397, 23400, 23403, 23406, 23409,
- 23412, 23443, 23474, 23477, 23480, 23511, 23514, 23517,
- 23520, 23551, 23554, 23557, 23560, 23591, 23594, 23597,
- 23600, 23631, 23634, 23637, 23640, 23644, 23648, 23652,
- 23656, 23660, 23692, 23696, 23700, 23732, 23736, 23740,
- 23744, 23776, 23780, 23784, 23788, 23820, 23824, 23828,
- 23832, 23863, 23895, 23899, 23903, 23935, 23939, 23943,
- 23947, 23978, 24009, 24012, 24015, 24018, 24021, 24024,
- 24055, 24058, 24061, 24092, 24095, 24098, 24101, 24132,
- 24135, 24138, 24141, 24172, 24175, 24178, 24181, 24212,
- 24215, 24218, 24221, 24252, 24255, 24258, 24261, 24292,
- 24295, 24298, 24329, 24361, 24365, 24369, 24401, 24405,
- 24409, 24413, 24445, 24449, 24453, 24457, 24489, 24493,
- 24497, 24501, 24533, 24565, 24569, 24573, 24577, 24609,
- 24613, 24617, 24649, 24681, 24685, 24689, 24721, 24753,
- 24757, 24761, 24793, 24797, 24801, 24805, 24837, 24841,
- 24845, 24849, 24881, 24885, 24889, 24893, 24925, 24929,
- 24933, 24965, 24969, 24973, 24977, 25009, 25013, 25017,
- 25049, 25080, 25083, 25086, 25089, 25120, 25123, 25126,
- 25157, 25188, 25191, 25194, 25197, 25228, 25231, 25234,
- 25237, 25268, 25271, 25274, 25305, 25337, 25341, 25345,
- 25377, 25381, 25385, 25417, 25449, 25453, 25457, 25489,
- 25493, 25497, 25529, 25533, 25537, 25541, 25573, 25577,
- 25581, 25585, 25617, 25621, 25625, 25629, 25661, 25665,
- 25669, 25673, 25705, 25709, 25713, 25745, 25776, 25779,
- 25782, 25785, 25816, 25819, 25822, 25825, 25856, 25859,
- 25862, 25865, 25896, 25899, 25902, 25905, 25936, 25939,
- 25942, 25973, 26004, 26007, 26010, 26013, 26044, 26047,
- 26050, 26081, 26084, 26087, 26090, 26094, 26125, 26156,
- 26159, 26162, 26165, 26168, 26199, 26202, 26205, 26236,
- 26239, 26242, 26245, 26276, 26279, 26282, 26313, 26316,
- 26319, 26350, 26353, 26356, 26359, 26390, 26393, 26396,
- 26427, 26430, 26433, 26464, 26495, 26498, 26501, 26504,
- 26508
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _thttp_machine_parser_header_WWW_Authenticate_trans_keys[] = {
- 80, 87, 112, 119, 82, 114, 79, 111,
- 88, 120, 89, 121, 45, 65, 97, 85,
- 117, 84, 116, 72, 104, 69, 101, 78,
- 110, 84, 116, 73, 105, 67, 99, 65,
- 97, 84, 116, 69, 101, 9, 32, 58,
- 9, 13, 32, 66, 68, 98, 100, 13,
- 10, 13, 9, 13, 32, 66, 68, 98,
- 100, 10, 13, 9, 13, 32, 66, 68,
- 98, 100, 13, 65, 97, 13, 83, 115,
- 13, 73, 105, 13, 67, 99, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 44, 61, 10,
- 13, 9, 13, 32, 44, 61, 9, 13,
- 32, 33, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 76, 108,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 37,
- 39, 44, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 13, 9, 13,
- 32, 44, 9, 13, 32, 44, 10, 13,
- 9, 13, 32, 44, 10, 13, 9, 13,
- 32, 33, 37, 39, 44, 61, 79, 111,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 78, 110, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 67, 99, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 61,
- 10, 13, 9, 13, 32, 44, 61, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 13, 9,
- 13, 32, 44, 13, 0, 9, 11, 127,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 13, 58, 48, 57, 65, 70, 97, 102,
- 13, 58, 93, 48, 57, 65, 70, 97,
- 102, 13, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 58, 93, 13, 58,
- 48, 57, 65, 70, 97, 102, 13, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 48, 57, 13, 46, 48, 57, 13,
- 48, 57, 13, 46, 48, 57, 13, 48,
- 57, 13, 93, 48, 57, 13, 93, 48,
- 57, 13, 93, 13, 46, 48, 57, 13,
- 46, 13, 46, 48, 57, 13, 46, 13,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 13, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 58, 93, 48, 57,
- 65, 70, 97, 102, 13, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 58, 93,
- 48, 57, 65, 70, 97, 102, 13, 58,
- 93, 48, 57, 65, 70, 97, 102, 13,
- 58, 93, 13, 48, 57, 65, 70, 97,
- 102, 13, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 13,
- 48, 57, 13, 46, 48, 57, 13, 46,
- 48, 57, 13, 46, 13, 58, 10, 13,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 80, 112, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 81, 113,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 85, 117, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 69, 101, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 61, 10, 13, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 34, 13, 34, 92, 127, 0, 8,
- 10, 31, 10, 13, 9, 13, 32, 44,
- 13, 0, 9, 11, 127, 10, 13, 9,
- 13, 32, 33, 37, 39, 44, 61, 79,
- 111, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 80, 112, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 61, 10, 13, 9, 13, 32,
- 44, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 13, 34, 10, 13, 34, 9, 13, 32,
- 44, 10, 13, 9, 13, 32, 44, 9,
- 13, 32, 33, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 65, 97, 126, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 76, 108, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 77, 109, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 61, 10, 13, 9, 13, 32, 44, 61,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 13,
- 9, 13, 32, 44, 13, 0, 9, 11,
- 127, 10, 13, 9, 13, 32, 33, 37,
- 39, 44, 61, 84, 116, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 65, 97,
- 126, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 76, 108, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 69, 101, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 61, 10, 13, 9,
- 13, 32, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 70, 84, 91, 102, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 70, 84, 91, 102,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 76, 108, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 83,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 69, 101, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 9, 13, 32, 33, 37, 39, 44, 82,
- 114, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 85, 117, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 10, 13,
- 34, 13, 34, 0, 9, 11, 127, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 10, 13, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 92, 97, 100, 110,
- 111, 113, 114, 115, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 92, 97, 100, 110, 111, 113,
- 114, 115, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 10, 13, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 34, 92, 127, 0, 31, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 10, 13, 13, 0, 9, 11, 127, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 92, 93,
- 127, 0, 8, 10, 31, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 93, 127, 0, 8, 10, 31,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 71, 92, 103, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 92, 114, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 73, 92, 105, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 84, 92, 116, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 72, 92, 104, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 73, 92, 105,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 78, 92, 110,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 13, 34, 92, 127, 0,
- 8, 10, 31, 13, 34, 10, 13, 34,
- 10, 13, 34, 13, 34, 0, 9, 11,
- 127, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 34, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 92, 97, 100, 110,
- 111, 113, 114, 115, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 92, 97, 100, 110, 111,
- 113, 114, 115, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 10, 13, 34, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 108, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 111,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 44, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 10,
- 13, 34, 9, 13, 32, 34, 44, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 110, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 67, 99, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 34, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 65, 68, 78, 79, 81, 82, 83,
- 92, 97, 100, 110, 111, 113, 114, 115,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 92, 97,
- 100, 110, 111, 113, 114, 115, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 10, 13, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 71, 92, 103, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 79, 92, 111, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 92, 114, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 73, 92, 105, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 84, 92, 116, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 72, 92, 104, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 92, 109, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 73, 92, 105,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 78, 92, 110,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 92,
- 110, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 67, 92,
- 99, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 92,
- 127, 0, 31, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 81,
- 92, 113, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 85,
- 92, 117, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 34,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 10, 13,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 92,
- 97, 100, 110, 111, 113, 114, 115, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 92, 97, 100,
- 110, 111, 113, 114, 115, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 44, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 71, 92, 103, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 72, 92, 104, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 92, 105, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 34, 92, 127, 0, 31,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 92, 99, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 81, 92, 113,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 80, 92,
- 112, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 92,
- 127, 0, 31, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 10, 13, 34,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 92,
- 97, 100, 110, 111, 113, 114, 115, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 92, 97,
- 100, 110, 111, 113, 114, 115, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 34, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 34, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 10, 13, 34,
- 9, 13, 32, 34, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 79, 111, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 34, 9, 13, 32, 33,
- 34, 37, 39, 44, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 10, 13, 34, 9, 13, 32,
- 34, 44, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 111,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 78, 110, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 67, 99,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 101, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 10, 13, 34,
- 9, 13, 32, 34, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 34, 13, 34,
- 58, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 93, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 93, 13, 34, 58, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 48,
- 57, 13, 34, 46, 48, 57, 13, 34,
- 48, 57, 13, 34, 46, 48, 57, 13,
- 34, 48, 57, 13, 34, 93, 48, 57,
- 13, 34, 93, 48, 57, 13, 34, 93,
- 9, 13, 32, 34, 44, 13, 34, 46,
- 48, 57, 13, 34, 46, 13, 34, 46,
- 48, 57, 13, 34, 46, 13, 34, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 58,
- 93, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 93, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 93, 48, 57, 65,
- 70, 97, 102, 13, 34, 58, 93, 13,
- 34, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 34, 48, 57, 13, 34, 46, 48,
- 57, 13, 34, 46, 48, 57, 13, 34,
- 46, 13, 34, 58, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 112, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 97, 126, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 81, 113, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 85, 117, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 101, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 10, 13, 34, 9, 13,
- 32, 34, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 111, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 80, 112, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 10, 13, 34, 9, 13,
- 32, 34, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 101, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 97, 126,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 76, 108, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 109, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 10, 13, 34, 9, 13, 32, 34, 44,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 92, 97,
- 100, 110, 111, 113, 114, 115, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 92, 97, 100, 110,
- 111, 113, 114, 115, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 34, 92, 127, 0, 31,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 10,
- 13, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 92, 93,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 71, 92, 103, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 72, 92, 104, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 92, 105, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 78, 92, 110, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 34, 92, 127, 0, 31,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 92, 110, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 67, 92, 99, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 81, 92, 113,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 80, 92,
- 112, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 92,
- 127, 0, 31, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 34,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 70, 84, 91, 92, 102, 116,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 70,
- 84, 91, 92, 102, 116, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 83, 92, 115, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 85,
- 92, 117, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 84, 116, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 97, 126, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 76, 108, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 101, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 10, 13, 34, 9, 13,
- 32, 34, 44, 61, 9, 13, 32, 33,
- 34, 37, 39, 70, 84, 91, 102, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 70, 84, 91,
- 102, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 65, 97, 126,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 76, 108, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 83, 115, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 69, 101,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 9, 13,
- 32, 33, 34, 37, 39, 44, 82, 114,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 85, 117, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 109, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 65, 97, 126, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 105, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 78, 110, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 10,
- 13, 34, 9, 13, 32, 34, 44, 61,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 34,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 34, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 112, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 81,
- 113, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 85, 117, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 34, 13, 34, 58, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 93,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 93, 13, 34,
- 58, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 34, 48, 57, 13, 34,
- 46, 48, 57, 13, 34, 48, 57, 13,
- 34, 46, 48, 57, 13, 34, 48, 57,
- 13, 34, 93, 48, 57, 13, 34, 93,
- 48, 57, 13, 34, 93, 9, 13, 32,
- 34, 44, 13, 34, 46, 48, 57, 13,
- 34, 46, 13, 34, 46, 48, 57, 13,
- 34, 46, 13, 34, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 93, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 93,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 93, 13, 34, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 13, 34, 48,
- 57, 13, 34, 46, 48, 57, 13, 34,
- 46, 48, 57, 13, 34, 46, 13, 34,
- 58, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 111, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 112, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 10, 13, 34, 9,
- 13, 32, 34, 44, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 10,
- 13, 34, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 108, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 109, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 10, 13,
- 34, 9, 13, 32, 34, 44, 61, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 34, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 84, 116, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 97, 126, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 108, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 101, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 70, 84, 91, 102, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 70, 84, 91, 102,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 65, 97, 126, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 76,
- 108, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 83, 115, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 69, 101, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 9, 13, 32,
- 33, 34, 37, 39, 44, 82, 114, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 85, 117, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 71, 103, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 111,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 82, 114, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 84, 116, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 72, 104,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 109, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 10, 13, 34,
- 9, 13, 32, 34, 44, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 93, 127, 0, 8, 10, 31, 9,
- 13, 32, 34, 44, 92, 127, 0, 31,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 58, 92, 93, 127,
- 0, 8, 10, 31, 13, 34, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 71, 92, 103, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 92, 111, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 82, 92, 114, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 92, 105, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 84, 92, 116, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 72, 92, 104, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 79, 92, 111, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 77, 92, 109, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 73, 92, 105, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 78, 92, 110, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 10, 13, 34, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 34, 92, 127, 0,
- 31, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 78, 92, 110,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 67, 92, 99,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 34, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 34, 92, 127, 0, 31, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 80, 92, 112, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 81, 92, 113, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 85, 92, 117, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 10, 13, 34, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 34, 92, 127, 0,
- 31, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 34, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 34,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 34, 92, 127, 0, 31, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 84, 92, 116, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 65, 92, 97, 126, 127, 0,
- 31, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 76, 92, 108, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 69, 92, 101, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 10, 13, 34, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 70, 84, 91,
- 92, 102, 116, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 70, 84, 91, 92, 102,
- 116, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 83, 92, 115,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 69, 92, 101, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 44, 82, 92, 114, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 85, 92, 117, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 65, 92, 97, 126, 127, 0, 31, 42,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 34, 92, 127, 0, 31, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 84, 92, 116, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 76, 92, 108, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 61, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 10, 13, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 70, 84, 91, 92, 102,
- 116, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 70, 84, 91, 92, 102, 116, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 82, 92, 114, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 85, 92, 117, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 76, 92, 108,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 84, 92,
- 116, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 70, 84, 91, 92, 102, 116, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 70, 84, 91,
- 92, 102, 116, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 83,
- 92, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 82, 92,
- 114, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 77, 109, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 97,
- 126, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 73, 105, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 110,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 10, 13, 34, 9, 13, 32, 34,
- 44, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 71,
- 103, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 82,
- 114, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 73, 105, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 84,
- 116, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 72, 104, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 109, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 10, 13, 34,
- 13, 34, 58, 92, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 13, 34, 58, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 48, 57, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 93, 127,
- 0, 8, 10, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 13, 34, 46,
- 58, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 58, 92, 93, 127, 0, 8, 10,
- 31, 13, 34, 92, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 10, 13, 34, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 71, 92, 103, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 82, 92, 114, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 84, 92, 116, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 72, 92, 104, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 77, 92, 109, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 34, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 79, 92,
- 111, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 73, 92,
- 105, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 78, 92,
- 110, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 34,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 34, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 67,
- 92, 99, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 34, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 34, 92, 127, 0, 31, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 80, 92, 112, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 81, 92, 113, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 85, 92, 117, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 34, 92,
- 127, 0, 31, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 80,
- 92, 112, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 34, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 34, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 34, 9,
- 13, 32, 34, 92, 127, 0, 31, 10,
- 13, 34, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 77, 92, 109, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 34, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 34, 9, 13, 32, 34, 92,
- 127, 0, 31, 10, 13, 34, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 84,
- 92, 116, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 76,
- 92, 108, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 69,
- 92, 101, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 34, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 70, 84, 91, 92, 102, 116,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 70, 84, 91, 92, 102, 116, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 65, 92, 97, 126,
- 127, 0, 31, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 83, 92, 115, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 69, 92, 101, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 82, 92, 114, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 85, 92, 117, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 34, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 78, 92, 110,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 67, 92, 99,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 81, 92, 113,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 79, 92, 111,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 80, 92, 112,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 77, 92,
- 109, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 84, 92,
- 116, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 76, 92,
- 108, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 70, 84, 91, 92, 102, 116, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 70, 84, 91,
- 92, 102, 116, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 65, 92, 97, 126, 127, 0, 31,
- 42, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 76, 92, 108, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 83,
- 92, 115, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 82, 92,
- 114, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 85, 92, 117,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 10, 13,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 77, 109, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 78, 110, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 61, 10, 13, 9, 13, 32, 44,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 13,
- 34, 92, 127, 0, 8, 10, 31, 10,
- 13, 9, 13, 32, 33, 37, 39, 44,
- 61, 71, 103, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 79, 111, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 61, 82,
- 114, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 61, 73, 105, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 61, 84, 116, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 72, 104, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 77, 109, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 61, 10, 13, 9, 13,
- 32, 44, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 37, 39, 44, 61, 79, 111, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 77, 109, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 65, 97, 126, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 61, 78, 110, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 61, 10, 13, 9, 13, 32, 44,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 34, 13,
- 34, 92, 127, 0, 8, 10, 31, 13,
- 34, 92, 127, 0, 8, 10, 31, 10,
- 13, 34, 13, 34, 0, 9, 11, 127,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 92, 97, 100,
- 110, 111, 113, 114, 115, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 92, 97, 100, 110, 111,
- 113, 114, 115, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 61, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 10, 13, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 10, 13, 13, 34, 58,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 13, 34,
- 58, 92, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 93, 127, 0, 8, 10,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 46, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 58, 92,
- 93, 127, 0, 8, 10, 31, 13, 34,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 65, 70, 97, 102, 13, 34, 46, 58,
- 92, 93, 127, 0, 8, 10, 31, 48,
- 57, 65, 70, 97, 102, 13, 34, 46,
- 58, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 65, 70, 97, 102, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 48, 57, 13, 34, 46, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 46, 92, 127, 0, 8, 10, 31,
- 13, 34, 58, 92, 127, 0, 8, 10,
- 31, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 76, 92, 108, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 71, 92, 103, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 82, 92, 114, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 73, 92, 105, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 84, 92, 116, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 72, 92, 104, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 77, 92, 109, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 10, 13, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 79,
- 92, 111, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 77,
- 92, 109, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 65,
- 92, 97, 126, 127, 0, 31, 42, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 73,
- 92, 105, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 78,
- 92, 110, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 61, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 10, 13,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 34,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 79, 92, 111, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 78, 92, 110, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 67, 92, 99, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 69, 92, 101, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 61,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 10,
- 13, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 91, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 91, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 80, 92,
- 112, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 81, 92,
- 113, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 85, 92,
- 117, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 69, 92,
- 101, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 61, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 61, 92, 127, 0, 31, 10, 13, 9,
- 13, 32, 34, 44, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 79, 92, 111, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 80, 92, 112, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 61, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 61, 92,
- 127, 0, 31, 10, 13, 9, 13, 32,
- 34, 44, 61, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 91, 92,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 13,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 34, 92, 127, 0,
- 31, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 69, 92, 101,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 65, 92, 97,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 76, 92, 108,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 77, 92, 109,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 61, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 61,
- 92, 127, 0, 31, 10, 13, 9, 13,
- 32, 34, 44, 61, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 13, 9, 13, 32, 33, 34, 37, 39,
- 91, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 84, 92, 116, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 65, 92, 97, 126, 127,
- 0, 31, 42, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 76, 92, 108, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 61, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 61, 92, 127,
- 0, 31, 10, 13, 9, 13, 32, 34,
- 44, 61, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 70, 84, 91,
- 92, 102, 116, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 9, 13, 32, 33, 34,
- 37, 39, 70, 84, 91, 92, 102, 116,
- 126, 127, 0, 31, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 65, 92,
- 97, 126, 127, 0, 31, 42, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 76, 92, 108,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 83, 92, 115, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 69, 92, 101, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 44, 82, 92, 114, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 85, 92, 117, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 10, 13, 10, 13, 9, 13, 32,
- 33, 37, 39, 44, 61, 79, 111, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 61,
- 80, 112, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 61, 10, 13, 9, 13, 32, 44, 61,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 13, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 13, 9, 13, 32, 34, 13, 34,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 13,
- 34, 13, 34, 0, 9, 11, 127, 10,
- 13, 13, 73, 105, 13, 71, 103, 13,
- 69, 101, 13, 83, 115, 13, 84, 116,
- 9, 13, 32, 10, 13, 9, 13, 32,
- 87, 119, 87, 119, 13, 9, 13, 32,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 13, 34, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 34, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 13, 34, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 33, 34,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 33, 34,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 33, 34, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 33, 37,
- 39, 65, 68, 78, 79, 81, 82, 83,
- 97, 100, 110, 111, 113, 114, 115, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 65, 68, 78, 79, 81, 82, 83,
- 97, 100, 110, 111, 113, 114, 115, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 33,
- 34, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 33,
- 34, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 9, 13, 32, 33, 34, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 33,
- 34, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 34,
- 9, 13, 32, 34, 9, 13, 32, 34,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 33, 34, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 34, 9, 13, 32, 34, 9,
- 13, 32, 34, 9, 13, 32, 33, 37,
- 39, 65, 68, 78, 79, 81, 82, 83,
- 97, 100, 110, 111, 113, 114, 115, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 33, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 33, 34, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 34, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 34, 9, 13, 32,
- 34, 9, 13, 32, 33, 34, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 33, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 34, 9, 13,
- 32, 33, 37, 39, 65, 68, 78, 79,
- 81, 82, 83, 97, 100, 110, 111, 113,
- 114, 115, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 33, 37, 39, 65, 68, 78, 79, 81,
- 82, 83, 97, 100, 110, 111, 113, 114,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 9,
- 13, 32, 9, 13, 32, 33, 37, 39,
- 65, 68, 78, 79, 81, 82, 83, 97,
- 100, 110, 111, 113, 114, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 9,
- 13, 32, 33, 37, 39, 65, 68, 78,
- 79, 81, 82, 83, 97, 100, 110, 111,
- 113, 114, 115, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 9, 13, 32, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 33, 37, 39, 65,
- 68, 78, 79, 81, 82, 83, 97, 100,
- 110, 111, 113, 114, 115, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 65, 68,
- 78, 79, 81, 82, 83, 97, 100, 110,
- 111, 113, 114, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 34, 9, 13, 32, 33,
- 37, 39, 65, 68, 78, 79, 81, 82,
- 83, 97, 100, 110, 111, 113, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 0
-};
+ /* #line 105 "./src/headers/thttp_header_WWW_Authenticate.c" */
+ static const char _thttp_machine_parser_header_WWW_Authenticate_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 2, 0, 6,
+ 2, 0, 7, 2, 0, 8, 2, 0,
+ 11, 2, 0, 12, 2, 5, 0, 2,
+ 6, 0, 2, 7, 0, 2, 8, 0,
+ 2, 12, 0
+ };
-static const char _thttp_machine_parser_header_WWW_Authenticate_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 3, 7, 1, 2, 7,
- 2, 7, 3, 3, 3, 3, 3, 21,
- 2, 21, 9, 5, 2, 5, 21, 2,
- 21, 11, 2, 11, 9, 2, 9, 2,
- 4, 4, 2, 4, 4, 2, 4, 2,
- 11, 11, 11, 11, 9, 5, 2, 5,
- 9, 2, 9, 2, 4, 4, 2, 4,
- 1, 8, 2, 3, 3, 3, 3, 2,
- 4, 1, 2, 1, 2, 1, 2, 2,
- 2, 2, 2, 2, 2, 4, 4, 3,
- 3, 3, 3, 3, 1, 4, 4, 4,
- 1, 2, 2, 2, 2, 2, 11, 11,
- 11, 11, 11, 9, 5, 2, 5, 9,
- 2, 9, 2, 4, 4, 2, 4, 1,
- 2, 11, 11, 9, 5, 2, 5, 9,
- 2, 9, 2, 4, 4, 4, 2, 3,
- 4, 2, 4, 11, 11, 11, 11, 9,
- 5, 2, 5, 9, 2, 9, 2, 4,
- 4, 2, 4, 1, 2, 11, 11, 11,
- 11, 9, 5, 2, 5, 13, 2, 13,
- 10, 10, 10, 10, 4, 10, 10, 2,
- 3, 2, 7, 2, 7, 2, 7, 24,
- 2, 24, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 7, 2, 1, 11,
- 5, 6, 6, 6, 6, 5, 7, 4,
- 5, 4, 5, 4, 5, 5, 5, 5,
- 5, 5, 5, 7, 7, 6, 6, 6,
- 6, 6, 4, 7, 7, 7, 4, 5,
- 5, 5, 5, 2, 14, 14, 14, 14,
- 14, 14, 14, 14, 12, 8, 2, 8,
- 11, 2, 11, 11, 2, 14, 14, 14,
- 14, 14, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 4, 2, 3, 3,
- 2, 7, 3, 7, 24, 3, 24, 12,
- 8, 3, 8, 11, 3, 11, 3, 6,
- 11, 3, 10, 6, 3, 6, 22, 3,
- 22, 12, 3, 12, 9, 3, 9, 3,
- 4, 9, 5, 3, 5, 3, 12, 12,
- 12, 12, 10, 6, 3, 6, 9, 3,
- 9, 3, 4, 7, 2, 7, 2, 7,
- 24, 2, 24, 12, 8, 2, 8, 11,
- 2, 11, 2, 6, 7, 11, 7, 2,
- 5, 6, 6, 6, 6, 5, 7, 4,
- 5, 4, 5, 4, 5, 5, 5, 7,
- 5, 5, 5, 5, 7, 7, 6, 6,
- 6, 6, 6, 4, 7, 7, 7, 4,
- 5, 5, 5, 5, 2, 14, 14, 14,
- 14, 14, 14, 14, 14, 12, 8, 2,
- 8, 11, 2, 11, 11, 2, 14, 14,
- 14, 14, 14, 12, 8, 2, 8, 11,
- 2, 11, 2, 6, 7, 2, 14, 14,
- 14, 14, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 2, 14, 14, 14,
- 14, 14, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 7, 2, 7, 24,
- 2, 24, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 11, 2, 5, 6,
- 6, 6, 6, 5, 7, 4, 5, 4,
- 5, 4, 5, 5, 5, 7, 5, 5,
- 5, 5, 7, 7, 6, 6, 6, 6,
- 6, 4, 7, 7, 7, 4, 5, 5,
- 5, 5, 2, 14, 14, 14, 14, 14,
- 14, 14, 14, 12, 8, 2, 8, 11,
- 2, 11, 11, 2, 14, 14, 14, 14,
- 14, 12, 8, 2, 8, 11, 2, 11,
- 2, 6, 7, 2, 14, 14, 14, 14,
- 12, 8, 2, 8, 11, 2, 11, 2,
- 6, 7, 2, 14, 14, 14, 14, 14,
- 12, 8, 2, 8, 11, 2, 11, 2,
- 6, 7, 2, 14, 14, 12, 8, 2,
- 8, 11, 2, 11, 2, 6, 7, 7,
- 3, 7, 24, 3, 24, 12, 8, 3,
- 8, 11, 3, 11, 3, 6, 11, 3,
- 10, 6, 3, 6, 22, 3, 22, 12,
- 3, 12, 9, 3, 9, 3, 4, 9,
- 5, 3, 5, 3, 12, 12, 12, 12,
- 10, 6, 3, 6, 9, 3, 9, 3,
- 4, 3, 4, 4, 4, 4, 3, 5,
- 2, 3, 2, 3, 2, 3, 3, 3,
- 5, 3, 3, 3, 3, 5, 5, 4,
- 4, 4, 4, 4, 2, 5, 5, 5,
- 2, 3, 3, 3, 3, 3, 12, 12,
- 12, 12, 12, 10, 6, 3, 6, 9,
- 3, 9, 3, 4, 7, 2, 7, 3,
- 12, 12, 10, 6, 3, 6, 9, 3,
- 9, 3, 12, 12, 12, 12, 10, 6,
- 3, 6, 9, 3, 9, 3, 4, 7,
- 2, 7, 2, 7, 24, 2, 24, 12,
- 8, 2, 8, 11, 2, 11, 2, 6,
- 7, 11, 7, 2, 5, 6, 6, 6,
- 6, 5, 7, 4, 5, 4, 5, 4,
- 5, 5, 5, 7, 5, 5, 5, 5,
- 7, 7, 6, 6, 6, 6, 6, 4,
- 7, 7, 7, 4, 5, 5, 5, 5,
- 2, 14, 14, 14, 14, 14, 14, 14,
- 14, 12, 8, 2, 8, 11, 2, 11,
- 11, 2, 14, 14, 14, 14, 14, 12,
- 8, 2, 8, 11, 2, 11, 2, 6,
- 7, 2, 14, 14, 14, 14, 12, 8,
- 2, 8, 11, 2, 11, 2, 6, 7,
- 2, 14, 14, 14, 14, 14, 12, 8,
- 2, 8, 11, 2, 11, 2, 6, 7,
- 2, 14, 14, 12, 8, 2, 8, 11,
- 2, 11, 2, 6, 7, 2, 14, 14,
- 14, 14, 12, 8, 2, 8, 11, 2,
- 11, 2, 6, 7, 2, 14, 14, 14,
- 14, 12, 8, 2, 8, 15, 2, 15,
- 13, 13, 13, 13, 7, 13, 13, 2,
- 3, 12, 12, 12, 12, 10, 6, 3,
- 6, 13, 3, 13, 11, 11, 11, 11,
- 5, 11, 11, 3, 12, 12, 12, 12,
- 10, 6, 3, 6, 9, 3, 9, 3,
- 4, 7, 7, 3, 7, 12, 12, 12,
- 12, 12, 10, 6, 3, 6, 9, 3,
- 9, 3, 4, 3, 4, 4, 4, 4,
- 3, 5, 2, 3, 2, 3, 2, 3,
- 3, 3, 5, 3, 3, 3, 3, 5,
- 5, 4, 4, 4, 4, 4, 2, 5,
- 5, 5, 2, 3, 3, 3, 3, 3,
- 12, 12, 10, 6, 3, 6, 9, 3,
- 9, 3, 4, 7, 7, 3, 7, 3,
- 12, 12, 12, 12, 10, 6, 3, 6,
- 9, 3, 9, 3, 4, 3, 12, 12,
- 12, 12, 10, 6, 3, 6, 13, 3,
- 13, 11, 11, 11, 11, 5, 11, 11,
- 3, 3, 12, 12, 12, 12, 12, 12,
- 12, 10, 6, 3, 6, 9, 3, 9,
- 9, 3, 5, 6, 6, 6, 6, 5,
- 7, 4, 5, 4, 5, 4, 5, 5,
- 5, 7, 5, 5, 5, 5, 7, 7,
- 6, 6, 6, 6, 6, 4, 7, 7,
- 7, 4, 5, 5, 5, 5, 3, 14,
- 14, 14, 14, 14, 14, 14, 14, 12,
- 8, 3, 8, 11, 3, 11, 11, 3,
- 14, 14, 14, 14, 14, 12, 8, 3,
- 8, 11, 3, 11, 3, 6, 3, 14,
- 14, 14, 14, 12, 8, 3, 8, 11,
- 3, 11, 3, 6, 3, 14, 14, 14,
- 14, 14, 12, 8, 3, 8, 11, 3,
- 11, 3, 6, 3, 14, 14, 12, 8,
- 3, 8, 11, 3, 11, 3, 14, 14,
- 14, 14, 12, 8, 3, 8, 11, 3,
- 11, 3, 6, 3, 14, 14, 14, 14,
- 12, 8, 3, 8, 15, 3, 15, 13,
- 13, 13, 13, 7, 13, 13, 3, 2,
- 14, 14, 14, 14, 12, 8, 2, 8,
- 11, 2, 11, 2, 6, 7, 2, 14,
- 14, 14, 14, 12, 8, 2, 8, 15,
- 2, 15, 13, 13, 13, 13, 7, 13,
- 13, 2, 2, 14, 14, 12, 8, 2,
- 8, 11, 2, 11, 2, 6, 7, 2,
- 14, 14, 14, 14, 12, 8, 2, 8,
- 11, 2, 11, 2, 6, 7, 2, 14,
- 14, 14, 14, 12, 8, 2, 8, 15,
- 2, 15, 13, 13, 13, 13, 7, 13,
- 13, 2, 3, 12, 12, 12, 12, 10,
- 6, 3, 6, 9, 3, 9, 3, 12,
- 12, 12, 12, 12, 12, 12, 10, 6,
- 3, 6, 9, 3, 9, 9, 3, 5,
- 6, 6, 6, 6, 5, 7, 4, 5,
- 4, 5, 4, 5, 5, 5, 7, 5,
- 5, 5, 5, 7, 7, 6, 6, 6,
- 6, 6, 4, 7, 7, 7, 4, 5,
- 5, 5, 5, 3, 14, 14, 14, 14,
- 14, 14, 14, 14, 12, 8, 3, 8,
- 11, 3, 11, 11, 3, 14, 14, 14,
- 14, 14, 12, 8, 3, 8, 11, 3,
- 11, 3, 14, 14, 14, 14, 12, 8,
- 3, 8, 11, 3, 11, 3, 6, 3,
- 14, 14, 14, 14, 14, 12, 8, 3,
- 8, 11, 3, 11, 3, 6, 3, 14,
- 14, 12, 8, 3, 8, 11, 3, 11,
- 3, 6, 3, 14, 14, 14, 14, 12,
- 8, 3, 8, 11, 3, 11, 3, 6,
- 3, 14, 14, 14, 14, 12, 8, 3,
- 8, 15, 3, 15, 13, 13, 13, 13,
- 7, 13, 13, 3, 2, 14, 14, 14,
- 14, 12, 8, 2, 8, 11, 2, 11,
- 2, 6, 2, 14, 14, 14, 14, 14,
- 12, 8, 2, 8, 11, 2, 11, 2,
- 6, 2, 14, 14, 12, 8, 2, 8,
- 11, 2, 11, 2, 6, 7, 2, 14,
- 14, 14, 14, 12, 8, 2, 8, 11,
- 2, 11, 2, 6, 2, 14, 14, 14,
- 14, 12, 8, 2, 8, 15, 2, 15,
- 13, 13, 13, 13, 7, 13, 13, 2,
- 2, 11, 11, 11, 11, 9, 5, 2,
- 5, 9, 2, 9, 2, 4, 4, 2,
- 11, 11, 11, 11, 11, 11, 11, 9,
- 5, 2, 5, 9, 2, 9, 8, 2,
- 11, 11, 11, 11, 11, 9, 5, 2,
- 5, 9, 2, 9, 2, 4, 4, 4,
- 3, 2, 7, 2, 7, 2, 7, 24,
- 2, 24, 12, 8, 2, 8, 11, 2,
- 11, 11, 7, 2, 5, 6, 6, 6,
- 6, 5, 7, 4, 5, 4, 5, 4,
- 5, 5, 5, 7, 5, 5, 5, 5,
- 7, 7, 6, 6, 6, 6, 6, 4,
- 7, 7, 7, 4, 5, 5, 5, 5,
- 2, 14, 14, 14, 14, 14, 14, 14,
- 14, 12, 8, 2, 8, 11, 2, 11,
- 11, 2, 14, 14, 14, 14, 14, 12,
- 8, 2, 8, 11, 2, 11, 2, 6,
- 7, 2, 14, 14, 14, 14, 12, 8,
- 2, 8, 11, 2, 11, 2, 14, 14,
- 14, 14, 14, 12, 8, 2, 8, 11,
- 2, 11, 2, 14, 14, 12, 8, 2,
- 8, 11, 2, 11, 2, 6, 7, 2,
- 14, 14, 14, 14, 12, 8, 2, 8,
- 11, 2, 11, 2, 14, 14, 14, 14,
- 12, 8, 2, 8, 15, 2, 15, 13,
- 13, 13, 13, 7, 13, 13, 2, 2,
- 11, 11, 9, 5, 2, 5, 9, 2,
- 9, 2, 4, 4, 4, 3, 2, 2,
- 3, 3, 3, 3, 3, 3, 2, 3,
- 2, 2, 1, 3, 3, 3, 3, 21,
- 3, 3, 3, 3, 21, 3, 3, 3,
- 3, 21, 3, 3, 3, 3, 21, 3,
- 3, 3, 2, 21, 3, 3, 3, 3,
- 21, 3, 3, 21, 4, 21, 21, 3,
- 3, 3, 3, 3, 21, 3, 3, 21,
- 3, 3, 3, 2, 4, 4, 4, 4,
- 4, 4, 22, 4, 4, 22, 4, 4,
- 4, 22, 4, 4, 4, 21, 21, 3,
- 3, 3, 3, 3, 21, 3, 3, 21,
- 3, 3, 3, 21, 3, 3, 3, 21,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 21, 21, 3, 3, 21, 3, 3, 3,
- 21, 3, 3, 3, 21, 3, 3, 3,
- 21, 3, 3, 3, 4, 4, 4, 4,
- 4, 22, 4, 4, 22, 4, 4, 4,
- 22, 4, 4, 4, 22, 4, 4, 4,
- 21, 22, 4, 4, 22, 4, 4, 4,
- 21, 21, 3, 3, 3, 3, 3, 21,
- 3, 3, 21, 3, 3, 3, 21, 3,
- 3, 3, 21, 3, 3, 3, 21, 3,
- 3, 3, 21, 3, 3, 3, 21, 3,
- 3, 21, 22, 4, 4, 22, 4, 4,
- 4, 22, 4, 4, 4, 22, 4, 4,
- 4, 22, 22, 4, 4, 4, 22, 4,
- 4, 22, 22, 4, 4, 22, 22, 4,
- 4, 22, 4, 4, 4, 22, 4, 4,
- 4, 22, 4, 4, 4, 22, 4, 4,
- 22, 4, 4, 4, 22, 4, 4, 22,
- 21, 3, 3, 3, 21, 3, 3, 21,
- 21, 3, 3, 3, 21, 3, 3, 3,
- 21, 3, 3, 21, 22, 4, 4, 22,
- 4, 4, 22, 22, 4, 4, 22, 4,
- 4, 22, 4, 4, 4, 22, 4, 4,
- 4, 22, 4, 4, 4, 22, 4, 4,
- 4, 22, 4, 4, 22, 21, 3, 3,
- 3, 21, 3, 3, 3, 21, 3, 3,
- 3, 21, 3, 3, 3, 21, 3, 3,
- 21, 21, 3, 3, 3, 21, 3, 3,
- 21, 3, 3, 3, 4, 21, 21, 3,
- 3, 3, 3, 21, 3, 3, 21, 3,
- 3, 3, 21, 3, 3, 21, 3, 3,
- 21, 3, 3, 3, 21, 3, 3, 21,
- 3, 3, 21, 21, 3, 3, 3, 4,
- 21
-};
+ static const short _thttp_machine_parser_header_WWW_Authenticate_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 13,
+ 15, 17, 19, 21, 23, 25, 27, 29,
+ 31, 33, 35, 37, 40, 47, 48, 50,
+ 57, 59, 66, 69, 72, 75, 78, 81,
+ 112, 114, 145, 162, 167, 169, 174, 205,
+ 207, 238, 257, 259, 278, 297, 299, 318,
+ 320, 324, 332, 334, 338, 342, 344, 348,
+ 350, 369, 388, 407, 426, 443, 448, 450,
+ 455, 474, 476, 495, 497, 501, 509, 511,
+ 515, 520, 536, 544, 553, 562, 571, 574,
+ 582, 592, 595, 599, 602, 606, 609, 613,
+ 617, 619, 623, 625, 629, 631, 641, 651,
+ 660, 669, 678, 687, 690, 697, 707, 717,
+ 727, 730, 734, 738, 740, 742, 744, 763,
+ 782, 801, 820, 839, 856, 861, 863, 868,
+ 887, 889, 908, 910, 914, 922, 924, 928,
+ 933, 935, 954, 973, 990, 995, 997, 1002,
+ 1021, 1023, 1042, 1044, 1048, 1056, 1064, 1066,
+ 1069, 1073, 1075, 1079, 1098, 1117, 1136, 1155,
+ 1172, 1177, 1179, 1184, 1203, 1205, 1224, 1226,
+ 1230, 1238, 1240, 1244, 1249, 1251, 1270, 1289,
+ 1308, 1327, 1344, 1349, 1351, 1356, 1379, 1381,
+ 1404, 1422, 1440, 1458, 1476, 1480, 1498, 1516,
+ 1518, 1521, 1527, 1536, 1538, 1547, 1549, 1558,
+ 1594, 1596, 1632, 1654, 1664, 1666, 1676, 1699,
+ 1701, 1724, 1726, 1734, 1743, 1752, 1754, 1759,
+ 1780, 1795, 1811, 1827, 1843, 1853, 1868, 1885,
+ 1895, 1906, 1916, 1927, 1937, 1948, 1959, 1968,
+ 1979, 1988, 1999, 2008, 2025, 2042, 2058, 2074,
+ 2090, 2106, 2116, 2130, 2147, 2164, 2181, 2191,
+ 2202, 2213, 2222, 2231, 2233, 2257, 2281, 2305,
+ 2329, 2353, 2377, 2401, 2425, 2447, 2457, 2459,
+ 2469, 2492, 2494, 2517, 2538, 2540, 2564, 2588,
+ 2612, 2636, 2660, 2682, 2692, 2694, 2704, 2727,
+ 2729, 2752, 2754, 2762, 2771, 2779, 2781, 2784,
+ 2787, 2793, 2802, 2805, 2814, 2850, 2853, 2889,
+ 2911, 2921, 2924, 2934, 2957, 2960, 2983, 2986,
+ 2994, 3015, 3018, 3036, 3042, 3045, 3051, 3083,
+ 3086, 3118, 3138, 3141, 3161, 3180, 3183, 3202,
+ 3205, 3209, 3226, 3231, 3234, 3239, 3242, 3262,
+ 3282, 3302, 3322, 3340, 3346, 3349, 3355, 3374,
+ 3377, 3396, 3399, 3403, 3412, 3414, 3423, 3425,
+ 3434, 3470, 3472, 3508, 3530, 3540, 3542, 3552,
+ 3575, 3577, 3600, 3602, 3610, 3619, 3640, 3649,
+ 3651, 3666, 3682, 3698, 3714, 3724, 3739, 3756,
+ 3766, 3777, 3787, 3798, 3808, 3819, 3830, 3839,
+ 3848, 3859, 3868, 3879, 3888, 3905, 3922, 3938,
+ 3954, 3970, 3986, 3996, 4010, 4027, 4044, 4061,
+ 4071, 4082, 4093, 4102, 4111, 4113, 4137, 4161,
+ 4185, 4209, 4233, 4257, 4281, 4305, 4327, 4337,
+ 4339, 4349, 4372, 4374, 4397, 4418, 4420, 4444,
+ 4468, 4492, 4516, 4540, 4562, 4572, 4574, 4584,
+ 4607, 4609, 4632, 4634, 4642, 4651, 4653, 4677,
+ 4701, 4725, 4749, 4771, 4781, 4783, 4793, 4816,
+ 4818, 4841, 4843, 4851, 4860, 4862, 4886, 4910,
+ 4934, 4958, 4982, 5004, 5014, 5016, 5026, 5049,
+ 5051, 5074, 5076, 5084, 5093, 5102, 5104, 5113,
+ 5149, 5151, 5187, 5209, 5219, 5221, 5231, 5254,
+ 5256, 5279, 5281, 5289, 5298, 5319, 5321, 5336,
+ 5352, 5368, 5384, 5394, 5409, 5426, 5436, 5447,
+ 5457, 5468, 5478, 5489, 5500, 5509, 5518, 5529,
+ 5538, 5549, 5558, 5575, 5592, 5608, 5624, 5640,
+ 5656, 5666, 5680, 5697, 5714, 5731, 5741, 5752,
+ 5763, 5772, 5781, 5783, 5807, 5831, 5855, 5879,
+ 5903, 5927, 5951, 5975, 5997, 6007, 6009, 6019,
+ 6042, 6044, 6067, 6088, 6090, 6114, 6138, 6162,
+ 6186, 6210, 6232, 6242, 6244, 6254, 6277, 6279,
+ 6302, 6304, 6312, 6321, 6323, 6347, 6371, 6395,
+ 6419, 6441, 6451, 6453, 6463, 6486, 6488, 6511,
+ 6513, 6521, 6530, 6532, 6556, 6580, 6604, 6628,
+ 6652, 6674, 6684, 6686, 6696, 6719, 6721, 6744,
+ 6746, 6754, 6763, 6765, 6789, 6813, 6835, 6845,
+ 6847, 6857, 6880, 6882, 6905, 6907, 6915, 6924,
+ 6933, 6936, 6945, 6981, 6984, 7020, 7042, 7052,
+ 7055, 7065, 7088, 7091, 7114, 7117, 7125, 7146,
+ 7149, 7167, 7173, 7176, 7182, 7214, 7217, 7249,
+ 7269, 7272, 7292, 7311, 7314, 7333, 7336, 7340,
+ 7357, 7362, 7365, 7370, 7373, 7393, 7413, 7433,
+ 7453, 7471, 7477, 7480, 7486, 7505, 7508, 7527,
+ 7530, 7534, 7543, 7553, 7563, 7573, 7577, 7586,
+ 7597, 7601, 7606, 7610, 7615, 7619, 7624, 7629,
+ 7632, 7637, 7642, 7645, 7650, 7653, 7664, 7675,
+ 7685, 7695, 7705, 7715, 7719, 7727, 7738, 7749,
+ 7760, 7764, 7769, 7774, 7777, 7780, 7783, 7803,
+ 7823, 7843, 7863, 7883, 7901, 7907, 7910, 7916,
+ 7935, 7938, 7957, 7960, 7964, 7973, 7975, 7984,
+ 7987, 8007, 8027, 8045, 8051, 8054, 8060, 8079,
+ 8082, 8101, 8104, 8124, 8144, 8164, 8184, 8202,
+ 8208, 8211, 8217, 8236, 8239, 8258, 8261, 8265,
+ 8274, 8276, 8285, 8287, 8296, 8332, 8334, 8370,
+ 8392, 8402, 8404, 8414, 8437, 8439, 8462, 8464,
+ 8472, 8481, 8502, 8511, 8513, 8528, 8544, 8560,
+ 8576, 8586, 8601, 8618, 8628, 8639, 8649, 8660,
+ 8670, 8681, 8692, 8701, 8710, 8721, 8730, 8741,
+ 8750, 8767, 8784, 8800, 8816, 8832, 8848, 8858,
+ 8872, 8889, 8906, 8923, 8933, 8944, 8955, 8964,
+ 8973, 8975, 8999, 9023, 9047, 9071, 9095, 9119,
+ 9143, 9167, 9189, 9199, 9201, 9211, 9234, 9236,
+ 9259, 9280, 9282, 9306, 9330, 9354, 9378, 9402,
+ 9424, 9434, 9436, 9446, 9469, 9471, 9494, 9496,
+ 9504, 9513, 9515, 9539, 9563, 9587, 9611, 9633,
+ 9643, 9645, 9655, 9678, 9680, 9703, 9705, 9713,
+ 9722, 9724, 9748, 9772, 9796, 9820, 9844, 9866,
+ 9876, 9878, 9888, 9911, 9913, 9936, 9938, 9946,
+ 9955, 9957, 9981, 10005, 10027, 10037, 10039, 10049,
+ 10072, 10074, 10097, 10099, 10107, 10116, 10118, 10142,
+ 10166, 10190, 10214, 10236, 10246, 10248, 10258, 10281,
+ 10283, 10306, 10308, 10316, 10325, 10327, 10351, 10375,
+ 10399, 10423, 10445, 10455, 10457, 10467, 10494, 10496,
+ 10523, 10546, 10569, 10592, 10615, 10624, 10647, 10670,
+ 10672, 10675, 10695, 10715, 10735, 10755, 10773, 10779,
+ 10782, 10788, 10811, 10814, 10837, 10856, 10875, 10894,
+ 10913, 10918, 10937, 10956, 10959, 10979, 10999, 11019,
+ 11039, 11057, 11063, 11066, 11072, 11091, 11094, 11113,
+ 11116, 11120, 11129, 11138, 11141, 11150, 11170, 11190,
+ 11210, 11230, 11250, 11268, 11274, 11277, 11283, 11302,
+ 11305, 11324, 11327, 11331, 11340, 11350, 11360, 11370,
+ 11374, 11383, 11394, 11398, 11403, 11407, 11412, 11416,
+ 11421, 11426, 11429, 11434, 11439, 11442, 11447, 11450,
+ 11461, 11472, 11482, 11492, 11502, 11512, 11516, 11524,
+ 11535, 11546, 11557, 11561, 11566, 11571, 11574, 11577,
+ 11580, 11600, 11620, 11638, 11644, 11647, 11653, 11672,
+ 11675, 11694, 11697, 11701, 11710, 11719, 11722, 11731,
+ 11734, 11754, 11774, 11794, 11814, 11832, 11838, 11841,
+ 11847, 11866, 11869, 11888, 11891, 11895, 11898, 11918,
+ 11938, 11958, 11978, 11996, 12002, 12005, 12011, 12034,
+ 12037, 12060, 12079, 12098, 12117, 12136, 12141, 12160,
+ 12179, 12182, 12185, 12205, 12225, 12245, 12265, 12285,
+ 12305, 12325, 12343, 12349, 12352, 12358, 12377, 12380,
+ 12399, 12416, 12419, 12434, 12450, 12466, 12482, 12492,
+ 12507, 12524, 12534, 12545, 12555, 12566, 12576, 12587,
+ 12598, 12607, 12616, 12627, 12636, 12647, 12656, 12673,
+ 12690, 12706, 12722, 12738, 12754, 12764, 12778, 12795,
+ 12812, 12829, 12839, 12850, 12861, 12870, 12879, 12882,
+ 12906, 12930, 12954, 12978, 13002, 13026, 13050, 13074,
+ 13096, 13106, 13109, 13119, 13142, 13145, 13168, 13189,
+ 13192, 13216, 13240, 13264, 13288, 13312, 13334, 13344,
+ 13347, 13357, 13380, 13383, 13406, 13409, 13417, 13420,
+ 13444, 13468, 13492, 13516, 13538, 13548, 13551, 13561,
+ 13584, 13587, 13610, 13613, 13621, 13624, 13648, 13672,
+ 13696, 13720, 13744, 13766, 13776, 13779, 13789, 13812,
+ 13815, 13838, 13841, 13849, 13852, 13876, 13900, 13922,
+ 13932, 13935, 13945, 13968, 13971, 13994, 13997, 14021,
+ 14045, 14069, 14093, 14115, 14125, 14128, 14138, 14161,
+ 14164, 14187, 14190, 14198, 14201, 14225, 14249, 14273,
+ 14297, 14319, 14329, 14332, 14342, 14369, 14372, 14399,
+ 14422, 14445, 14468, 14491, 14500, 14523, 14546, 14549,
+ 14551, 14575, 14599, 14623, 14647, 14669, 14679, 14681,
+ 14691, 14714, 14716, 14739, 14741, 14749, 14758, 14760,
+ 14784, 14808, 14832, 14856, 14878, 14888, 14890, 14900,
+ 14927, 14929, 14956, 14979, 15002, 15025, 15048, 15057,
+ 15080, 15103, 15105, 15107, 15131, 15155, 15177, 15187,
+ 15189, 15199, 15222, 15224, 15247, 15249, 15257, 15266,
+ 15268, 15292, 15316, 15340, 15364, 15386, 15396, 15398,
+ 15408, 15431, 15433, 15456, 15458, 15466, 15475, 15477,
+ 15501, 15525, 15549, 15573, 15595, 15605, 15607, 15617,
+ 15644, 15646, 15673, 15696, 15719, 15742, 15765, 15774,
+ 15797, 15820, 15822, 15825, 15845, 15865, 15885, 15905,
+ 15923, 15929, 15932, 15938, 15957, 15960, 15979, 15982,
+ 16002, 16022, 16042, 16062, 16082, 16102, 16122, 16140,
+ 16146, 16149, 16155, 16174, 16177, 16196, 16213, 16216,
+ 16231, 16247, 16263, 16279, 16289, 16304, 16321, 16331,
+ 16342, 16352, 16363, 16373, 16384, 16395, 16404, 16413,
+ 16424, 16433, 16444, 16453, 16470, 16487, 16503, 16519,
+ 16535, 16551, 16561, 16575, 16592, 16609, 16626, 16636,
+ 16647, 16658, 16667, 16676, 16679, 16703, 16727, 16751,
+ 16775, 16799, 16823, 16847, 16871, 16893, 16903, 16906,
+ 16916, 16939, 16942, 16965, 16986, 16989, 17013, 17037,
+ 17061, 17085, 17109, 17131, 17141, 17144, 17154, 17177,
+ 17180, 17203, 17206, 17230, 17254, 17278, 17302, 17324,
+ 17334, 17337, 17347, 17370, 17373, 17396, 17399, 17407,
+ 17410, 17434, 17458, 17482, 17506, 17530, 17552, 17562,
+ 17565, 17575, 17598, 17601, 17624, 17627, 17635, 17638,
+ 17662, 17686, 17708, 17718, 17721, 17731, 17754, 17757,
+ 17780, 17783, 17791, 17794, 17818, 17842, 17866, 17890,
+ 17912, 17922, 17925, 17935, 17958, 17961, 17984, 17987,
+ 17995, 17998, 18022, 18046, 18070, 18094, 18116, 18126,
+ 18129, 18139, 18166, 18169, 18196, 18219, 18242, 18265,
+ 18288, 18297, 18320, 18343, 18346, 18348, 18372, 18396,
+ 18420, 18444, 18466, 18476, 18478, 18488, 18511, 18513,
+ 18536, 18538, 18546, 18548, 18572, 18596, 18620, 18644,
+ 18668, 18690, 18700, 18702, 18712, 18735, 18737, 18760,
+ 18762, 18770, 18772, 18796, 18820, 18842, 18852, 18854,
+ 18864, 18887, 18889, 18912, 18914, 18922, 18931, 18933,
+ 18957, 18981, 19005, 19029, 19051, 19061, 19063, 19073,
+ 19096, 19098, 19121, 19123, 19131, 19133, 19157, 19181,
+ 19205, 19229, 19251, 19261, 19263, 19273, 19300, 19302,
+ 19329, 19352, 19375, 19398, 19421, 19430, 19453, 19476,
+ 19478, 19480, 19499, 19518, 19537, 19556, 19573, 19578,
+ 19580, 19585, 19604, 19606, 19625, 19627, 19631, 19639,
+ 19641, 19660, 19679, 19698, 19717, 19736, 19755, 19774,
+ 19791, 19796, 19798, 19803, 19822, 19824, 19843, 19859,
+ 19861, 19880, 19899, 19918, 19937, 19956, 19973, 19978,
+ 19980, 19985, 20004, 20006, 20025, 20027, 20031, 20039,
+ 20047, 20050, 20056, 20065, 20067, 20076, 20078, 20087,
+ 20123, 20125, 20161, 20183, 20193, 20195, 20205, 20228,
+ 20230, 20253, 20274, 20283, 20285, 20300, 20316, 20332,
+ 20348, 20358, 20373, 20390, 20400, 20411, 20421, 20432,
+ 20442, 20453, 20464, 20473, 20482, 20493, 20502, 20513,
+ 20522, 20539, 20556, 20572, 20588, 20604, 20620, 20630,
+ 20644, 20661, 20678, 20695, 20705, 20716, 20727, 20736,
+ 20745, 20747, 20771, 20795, 20819, 20843, 20867, 20891,
+ 20915, 20939, 20961, 20971, 20973, 20983, 21006, 21008,
+ 21031, 21052, 21054, 21078, 21102, 21126, 21150, 21174,
+ 21196, 21206, 21208, 21218, 21241, 21243, 21266, 21268,
+ 21276, 21285, 21287, 21311, 21335, 21359, 21383, 21405,
+ 21415, 21417, 21427, 21450, 21452, 21475, 21477, 21501,
+ 21525, 21549, 21573, 21597, 21619, 21629, 21631, 21641,
+ 21664, 21666, 21689, 21691, 21715, 21739, 21761, 21771,
+ 21773, 21783, 21806, 21808, 21831, 21833, 21841, 21850,
+ 21852, 21876, 21900, 21924, 21948, 21970, 21980, 21982,
+ 21992, 22015, 22017, 22040, 22042, 22066, 22090, 22114,
+ 22138, 22160, 22170, 22172, 22182, 22209, 22211, 22238,
+ 22261, 22284, 22307, 22330, 22339, 22362, 22385, 22387,
+ 22389, 22408, 22427, 22444, 22449, 22451, 22456, 22475,
+ 22477, 22496, 22498, 22502, 22510, 22518, 22521, 22527,
+ 22529, 22532, 22535, 22538, 22541, 22544, 22547, 22549,
+ 22552, 22554, 22556, 22557, 22560, 22563, 22566, 22569,
+ 22600, 22603, 22606, 22609, 22612, 22643, 22646, 22649,
+ 22652, 22655, 22686, 22689, 22692, 22695, 22698, 22729,
+ 22732, 22735, 22738, 22740, 22771, 22774, 22777, 22780,
+ 22783, 22814, 22817, 22820, 22851, 22855, 22886, 22917,
+ 22920, 22923, 22926, 22929, 22932, 22963, 22966, 22969,
+ 23000, 23003, 23006, 23009, 23011, 23015, 23019, 23023,
+ 23027, 23031, 23035, 23067, 23071, 23075, 23107, 23111,
+ 23115, 23119, 23151, 23155, 23159, 23163, 23194, 23225,
+ 23228, 23231, 23234, 23237, 23240, 23271, 23274, 23277,
+ 23308, 23311, 23314, 23317, 23348, 23351, 23354, 23357,
+ 23388, 23391, 23394, 23397, 23400, 23403, 23406, 23409,
+ 23412, 23443, 23474, 23477, 23480, 23511, 23514, 23517,
+ 23520, 23551, 23554, 23557, 23560, 23591, 23594, 23597,
+ 23600, 23631, 23634, 23637, 23640, 23644, 23648, 23652,
+ 23656, 23660, 23692, 23696, 23700, 23732, 23736, 23740,
+ 23744, 23776, 23780, 23784, 23788, 23820, 23824, 23828,
+ 23832, 23863, 23895, 23899, 23903, 23935, 23939, 23943,
+ 23947, 23978, 24009, 24012, 24015, 24018, 24021, 24024,
+ 24055, 24058, 24061, 24092, 24095, 24098, 24101, 24132,
+ 24135, 24138, 24141, 24172, 24175, 24178, 24181, 24212,
+ 24215, 24218, 24221, 24252, 24255, 24258, 24261, 24292,
+ 24295, 24298, 24329, 24361, 24365, 24369, 24401, 24405,
+ 24409, 24413, 24445, 24449, 24453, 24457, 24489, 24493,
+ 24497, 24501, 24533, 24565, 24569, 24573, 24577, 24609,
+ 24613, 24617, 24649, 24681, 24685, 24689, 24721, 24753,
+ 24757, 24761, 24793, 24797, 24801, 24805, 24837, 24841,
+ 24845, 24849, 24881, 24885, 24889, 24893, 24925, 24929,
+ 24933, 24965, 24969, 24973, 24977, 25009, 25013, 25017,
+ 25049, 25080, 25083, 25086, 25089, 25120, 25123, 25126,
+ 25157, 25188, 25191, 25194, 25197, 25228, 25231, 25234,
+ 25237, 25268, 25271, 25274, 25305, 25337, 25341, 25345,
+ 25377, 25381, 25385, 25417, 25449, 25453, 25457, 25489,
+ 25493, 25497, 25529, 25533, 25537, 25541, 25573, 25577,
+ 25581, 25585, 25617, 25621, 25625, 25629, 25661, 25665,
+ 25669, 25673, 25705, 25709, 25713, 25745, 25776, 25779,
+ 25782, 25785, 25816, 25819, 25822, 25825, 25856, 25859,
+ 25862, 25865, 25896, 25899, 25902, 25905, 25936, 25939,
+ 25942, 25973, 26004, 26007, 26010, 26013, 26044, 26047,
+ 26050, 26081, 26084, 26087, 26090, 26094, 26125, 26156,
+ 26159, 26162, 26165, 26168, 26199, 26202, 26205, 26236,
+ 26239, 26242, 26245, 26276, 26279, 26282, 26313, 26316,
+ 26319, 26350, 26353, 26356, 26359, 26390, 26393, 26396,
+ 26427, 26430, 26433, 26464, 26495, 26498, 26501, 26504,
+ 26508
+ };
-static const char _thttp_machine_parser_header_WWW_Authenticate_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 5, 4, 0, 0, 0, 5, 0,
- 5, 4, 0, 4, 5, 0, 5, 0,
- 0, 2, 0, 0, 0, 0, 0, 0,
- 4, 4, 4, 4, 4, 0, 0, 0,
- 5, 0, 5, 0, 0, 2, 0, 0,
- 2, 4, 3, 3, 3, 3, 0, 3,
- 3, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 0, 1, 0, 3, 3, 3,
- 3, 3, 3, 0, 3, 3, 3, 3,
- 1, 1, 1, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 0, 0, 0, 5,
- 0, 5, 0, 0, 2, 0, 0, 2,
- 0, 4, 4, 4, 0, 0, 0, 5,
- 0, 5, 0, 0, 2, 2, 0, 0,
- 0, 0, 0, 4, 4, 4, 4, 4,
- 0, 0, 0, 5, 0, 5, 0, 0,
- 2, 0, 0, 2, 0, 4, 4, 4,
- 4, 4, 0, 0, 0, 5, 0, 5,
- 4, 4, 4, 4, 0, 4, 4, 0,
- 0, 2, 1, 0, 1, 0, 1, 6,
- 0, 6, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 1, 0, 2, 5,
- 5, 5, 5, 5, 2, 5, 5, 3,
- 3, 3, 3, 3, 3, 3, 2, 3,
- 2, 3, 2, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 5, 5, 3, 3,
- 3, 2, 2, 0, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 5, 0, 5, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 2, 0, 0, 0,
- 2, 1, 0, 1, 6, 0, 6, 5,
- 1, 0, 1, 6, 0, 6, 0, 1,
- 5, 0, 4, 0, 0, 0, 5, 0,
- 5, 4, 0, 4, 5, 0, 5, 0,
- 0, 4, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 0, 0, 1, 0, 1, 0, 1,
- 6, 0, 6, 5, 1, 0, 1, 6,
- 0, 6, 0, 1, 1, 5, 1, 0,
- 5, 5, 5, 5, 2, 5, 5, 3,
- 3, 3, 3, 3, 3, 3, 2, 1,
- 3, 2, 3, 2, 5, 5, 5, 5,
- 5, 5, 2, 5, 5, 5, 5, 3,
- 3, 3, 2, 2, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 5, 0, 5, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 0, 1, 1, 0, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 0, 5, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 1, 0, 1, 6,
- 0, 6, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 5, 0, 5, 5,
- 5, 5, 2, 5, 5, 3, 3, 3,
- 3, 3, 3, 3, 2, 1, 3, 2,
- 3, 2, 5, 5, 5, 5, 5, 5,
- 2, 5, 5, 5, 5, 3, 3, 3,
- 2, 2, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 5, 0, 5, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 0, 1, 1, 0, 5, 5, 5, 5,
- 5, 1, 0, 1, 6, 0, 6, 0,
- 1, 1, 0, 5, 5, 5, 5, 5,
- 5, 1, 0, 1, 6, 0, 6, 0,
- 1, 1, 0, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 1, 1,
- 0, 1, 6, 0, 6, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 5, 0,
- 4, 0, 0, 0, 5, 0, 5, 4,
- 0, 4, 5, 0, 5, 0, 0, 4,
- 0, 0, 0, 0, 4, 4, 4, 4,
- 4, 0, 0, 0, 5, 0, 5, 0,
- 0, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 0, 1, 0, 1, 0, 3, 3, 3,
- 3, 3, 3, 0, 3, 3, 3, 3,
- 1, 1, 1, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 0, 0, 0, 5,
- 0, 5, 0, 0, 1, 0, 1, 0,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 0, 4, 4, 4, 4, 4, 0,
- 0, 0, 5, 0, 5, 0, 0, 1,
- 0, 1, 0, 1, 6, 0, 6, 5,
- 1, 0, 1, 6, 0, 6, 0, 1,
- 1, 5, 1, 0, 5, 5, 5, 5,
- 2, 5, 5, 3, 3, 3, 3, 3,
- 3, 3, 2, 1, 3, 2, 3, 2,
- 5, 5, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 3, 3, 3, 2, 2,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 5, 0, 5, 5, 5, 5, 5, 5,
- 1, 0, 1, 6, 0, 6, 0, 1,
- 1, 0, 5, 5, 5, 5, 5, 1,
- 0, 1, 6, 0, 6, 0, 1, 1,
- 0, 5, 5, 5, 5, 5, 5, 1,
- 0, 1, 6, 0, 6, 0, 1, 1,
- 0, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 0, 1, 1, 0, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 1, 0, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 5, 5, 5, 5, 1, 5, 5, 0,
- 0, 4, 4, 4, 4, 4, 0, 0,
- 0, 5, 0, 5, 4, 4, 4, 4,
- 0, 4, 4, 0, 4, 4, 4, 4,
- 4, 0, 0, 0, 5, 0, 5, 0,
- 0, 1, 1, 0, 1, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 0, 0, 3, 3, 3, 3, 0,
- 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 0, 0, 1, 1, 0, 1, 0,
- 4, 4, 4, 4, 4, 0, 0, 0,
- 5, 0, 5, 0, 0, 0, 4, 4,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 4, 4, 4, 4, 0, 4, 4,
- 0, 0, 4, 4, 4, 4, 4, 4,
- 4, 4, 0, 0, 0, 5, 0, 5,
- 4, 0, 5, 5, 5, 5, 2, 5,
- 5, 3, 3, 3, 3, 3, 3, 3,
- 2, 1, 3, 2, 3, 2, 5, 5,
- 5, 5, 5, 5, 2, 5, 5, 5,
- 5, 3, 3, 3, 2, 2, 0, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 1, 0, 1, 6, 0, 6, 5, 0,
- 5, 5, 5, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 0, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 0, 1, 0, 5, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 0, 5, 5, 5, 1,
- 0, 1, 6, 0, 6, 0, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 1, 0, 5, 5, 5, 5,
- 5, 1, 0, 1, 6, 0, 6, 5,
- 5, 5, 5, 1, 5, 5, 0, 0,
- 5, 5, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 0, 1, 1, 0, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 5, 5, 5, 5, 1, 5,
- 5, 0, 0, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 1, 0,
- 5, 5, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 0, 1, 1, 0, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 5, 5, 5, 5, 1, 5,
- 5, 0, 0, 4, 4, 4, 4, 4,
- 0, 0, 0, 5, 0, 5, 0, 4,
- 4, 4, 4, 4, 4, 4, 4, 0,
- 0, 0, 5, 0, 5, 4, 0, 5,
- 5, 5, 5, 2, 5, 5, 3, 3,
- 3, 3, 3, 3, 3, 2, 1, 3,
- 2, 3, 2, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 5, 5, 3, 3,
- 3, 2, 2, 0, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 5, 0, 5, 5, 5,
- 5, 5, 5, 1, 0, 1, 6, 0,
- 6, 0, 5, 5, 5, 5, 5, 1,
- 0, 1, 6, 0, 6, 0, 1, 0,
- 5, 5, 5, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 0, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 0, 1, 0, 5, 5, 5, 5, 5,
- 1, 0, 1, 6, 0, 6, 0, 1,
- 0, 5, 5, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 5, 5, 5, 5,
- 1, 5, 5, 0, 0, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 0, 1, 0, 5, 5, 5, 5, 5,
- 5, 1, 0, 1, 6, 0, 6, 0,
- 1, 0, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 0, 1, 1, 0, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 0, 1, 0, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 5, 5, 5, 5, 1, 5, 5, 0,
- 0, 4, 4, 4, 4, 4, 0, 0,
- 0, 5, 0, 5, 0, 0, 2, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 5, 0, 5, 4, 0,
- 4, 4, 4, 4, 4, 4, 0, 0,
- 0, 5, 0, 5, 0, 0, 2, 2,
- 0, 2, 1, 0, 1, 0, 1, 6,
- 0, 6, 5, 1, 0, 1, 6, 0,
- 6, 5, 1, 0, 5, 5, 5, 5,
- 2, 5, 5, 3, 3, 3, 3, 3,
- 3, 3, 2, 1, 3, 2, 3, 2,
- 5, 5, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 3, 3, 3, 2, 2,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 1, 0, 1, 6, 0, 6,
- 5, 0, 5, 5, 5, 5, 5, 5,
- 1, 0, 1, 6, 0, 6, 0, 1,
- 1, 0, 5, 5, 5, 5, 5, 1,
- 0, 1, 6, 0, 6, 0, 5, 5,
- 5, 5, 5, 5, 1, 0, 1, 6,
- 0, 6, 0, 5, 5, 5, 1, 0,
- 1, 6, 0, 6, 0, 1, 1, 0,
- 5, 5, 5, 5, 5, 1, 0, 1,
- 6, 0, 6, 0, 5, 5, 5, 5,
- 5, 1, 0, 1, 6, 0, 6, 5,
- 5, 5, 5, 1, 5, 5, 0, 0,
- 4, 4, 4, 0, 0, 0, 5, 0,
- 5, 0, 0, 2, 2, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 0, 0, 0, 5, 0, 0, 0,
- 0, 5, 0, 0, 0, 0, 5, 0,
- 0, 0, 0, 5, 0, 0, 0, 0,
- 5, 0, 0, 5, 0, 5, 5, 0,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 5, 0,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 0, 0, 0, 5, 0, 0, 0, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 5, 0, 0, 5, 0, 0, 0,
- 5, 0, 0, 0, 5, 0, 0, 0,
- 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 5, 0, 0, 0, 5, 0, 0, 0,
- 5, 5, 0, 0, 5, 0, 0, 0,
- 5, 5, 0, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 0, 0, 5, 0,
- 0, 0, 5, 0, 0, 0, 5, 0,
- 0, 0, 5, 0, 0, 0, 5, 0,
- 0, 5, 5, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 5, 0, 0, 0, 5, 0,
- 0, 5, 5, 0, 0, 5, 5, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 5, 0, 0, 5,
- 5, 0, 0, 0, 5, 0, 0, 5,
- 5, 0, 0, 0, 5, 0, 0, 0,
- 5, 0, 0, 5, 5, 0, 0, 5,
- 0, 0, 5, 5, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 5, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0,
- 5, 5, 0, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 0, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 5, 0, 0, 5,
- 0, 0, 5, 5, 0, 0, 0, 0,
- 5
-};
+ static const char _thttp_machine_parser_header_WWW_Authenticate_trans_keys[] = {
+ 80, 87, 112, 119, 82, 114, 79, 111,
+ 88, 120, 89, 121, 45, 65, 97, 85,
+ 117, 84, 116, 72, 104, 69, 101, 78,
+ 110, 84, 116, 73, 105, 67, 99, 65,
+ 97, 84, 116, 69, 101, 9, 32, 58,
+ 9, 13, 32, 66, 68, 98, 100, 13,
+ 10, 13, 9, 13, 32, 66, 68, 98,
+ 100, 10, 13, 9, 13, 32, 66, 68,
+ 98, 100, 13, 65, 97, 13, 83, 115,
+ 13, 73, 105, 13, 67, 99, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 44, 61, 10,
+ 13, 9, 13, 32, 44, 61, 9, 13,
+ 32, 33, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 76, 108,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 37,
+ 39, 44, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 13, 9, 13,
+ 32, 44, 9, 13, 32, 44, 10, 13,
+ 9, 13, 32, 44, 10, 13, 9, 13,
+ 32, 33, 37, 39, 44, 61, 79, 111,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 78, 110, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 67, 99, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 61,
+ 10, 13, 9, 13, 32, 44, 61, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 13, 9,
+ 13, 32, 44, 13, 0, 9, 11, 127,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 13, 58, 48, 57, 65, 70, 97, 102,
+ 13, 58, 93, 48, 57, 65, 70, 97,
+ 102, 13, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 58, 93, 13, 58,
+ 48, 57, 65, 70, 97, 102, 13, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 48, 57, 13, 46, 48, 57, 13,
+ 48, 57, 13, 46, 48, 57, 13, 48,
+ 57, 13, 93, 48, 57, 13, 93, 48,
+ 57, 13, 93, 13, 46, 48, 57, 13,
+ 46, 13, 46, 48, 57, 13, 46, 13,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 13, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 58, 93, 48, 57,
+ 65, 70, 97, 102, 13, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 58, 93,
+ 48, 57, 65, 70, 97, 102, 13, 58,
+ 93, 48, 57, 65, 70, 97, 102, 13,
+ 58, 93, 13, 48, 57, 65, 70, 97,
+ 102, 13, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 13,
+ 48, 57, 13, 46, 48, 57, 13, 46,
+ 48, 57, 13, 46, 13, 58, 10, 13,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 80, 112, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 81, 113,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 85, 117, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 69, 101, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 61, 10, 13, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 34, 13, 34, 92, 127, 0, 8,
+ 10, 31, 10, 13, 9, 13, 32, 44,
+ 13, 0, 9, 11, 127, 10, 13, 9,
+ 13, 32, 33, 37, 39, 44, 61, 79,
+ 111, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 80, 112, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 61, 10, 13, 9, 13, 32,
+ 44, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 13, 34, 10, 13, 34, 9, 13, 32,
+ 44, 10, 13, 9, 13, 32, 44, 9,
+ 13, 32, 33, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 65, 97, 126, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 76, 108, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 77, 109, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 61, 10, 13, 9, 13, 32, 44, 61,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 13,
+ 9, 13, 32, 44, 13, 0, 9, 11,
+ 127, 10, 13, 9, 13, 32, 33, 37,
+ 39, 44, 61, 84, 116, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 65, 97,
+ 126, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 76, 108, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 69, 101, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 61, 10, 13, 9,
+ 13, 32, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 70, 84, 91, 102, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 70, 84, 91, 102,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 76, 108, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 83,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 69, 101, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 9, 13, 32, 33, 37, 39, 44, 82,
+ 114, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 85, 117, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 10, 13,
+ 34, 13, 34, 0, 9, 11, 127, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 10, 13, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 92, 97, 100, 110,
+ 111, 113, 114, 115, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 92, 97, 100, 110, 111, 113,
+ 114, 115, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 10, 13, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 34, 92, 127, 0, 31, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 10, 13, 13, 0, 9, 11, 127, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 92, 93,
+ 127, 0, 8, 10, 31, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 93, 127, 0, 8, 10, 31,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 71, 92, 103, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 92, 114, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 73, 92, 105, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 84, 92, 116, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 72, 92, 104, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 73, 92, 105,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 78, 92, 110,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 13, 34, 92, 127, 0,
+ 8, 10, 31, 13, 34, 10, 13, 34,
+ 10, 13, 34, 13, 34, 0, 9, 11,
+ 127, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 34, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 92, 97, 100, 110,
+ 111, 113, 114, 115, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 92, 97, 100, 110, 111,
+ 113, 114, 115, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 10, 13, 34, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 108, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 111,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 44, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 10,
+ 13, 34, 9, 13, 32, 34, 44, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 110, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 67, 99, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 34, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 65, 68, 78, 79, 81, 82, 83,
+ 92, 97, 100, 110, 111, 113, 114, 115,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 92, 97,
+ 100, 110, 111, 113, 114, 115, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 10, 13, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 71, 92, 103, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 79, 92, 111, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 92, 114, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 73, 92, 105, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 84, 92, 116, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 72, 92, 104, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 92, 109, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 73, 92, 105,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 78, 92, 110,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 92,
+ 110, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 67, 92,
+ 99, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 92,
+ 127, 0, 31, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 81,
+ 92, 113, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 85,
+ 92, 117, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 34,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 10, 13,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 92,
+ 97, 100, 110, 111, 113, 114, 115, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 92, 97, 100,
+ 110, 111, 113, 114, 115, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 44, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 71, 92, 103, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 72, 92, 104, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 92, 105, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 34, 92, 127, 0, 31,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 92, 99, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 81, 92, 113,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 80, 92,
+ 112, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 92,
+ 127, 0, 31, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 10, 13, 34,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 92,
+ 97, 100, 110, 111, 113, 114, 115, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 92, 97,
+ 100, 110, 111, 113, 114, 115, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 34, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 34, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 10, 13, 34,
+ 9, 13, 32, 34, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 79, 111, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 34, 9, 13, 32, 33,
+ 34, 37, 39, 44, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 10, 13, 34, 9, 13, 32,
+ 34, 44, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 111,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 78, 110, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 67, 99,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 101, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 10, 13, 34,
+ 9, 13, 32, 34, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 34, 13, 34,
+ 58, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 93, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 93, 13, 34, 58, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 48,
+ 57, 13, 34, 46, 48, 57, 13, 34,
+ 48, 57, 13, 34, 46, 48, 57, 13,
+ 34, 48, 57, 13, 34, 93, 48, 57,
+ 13, 34, 93, 48, 57, 13, 34, 93,
+ 9, 13, 32, 34, 44, 13, 34, 46,
+ 48, 57, 13, 34, 46, 13, 34, 46,
+ 48, 57, 13, 34, 46, 13, 34, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 58,
+ 93, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 93, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 93, 48, 57, 65,
+ 70, 97, 102, 13, 34, 58, 93, 13,
+ 34, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 34, 48, 57, 13, 34, 46, 48,
+ 57, 13, 34, 46, 48, 57, 13, 34,
+ 46, 13, 34, 58, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 112, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 97, 126, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 81, 113, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 85, 117, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 101, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 10, 13, 34, 9, 13,
+ 32, 34, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 111, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 80, 112, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 10, 13, 34, 9, 13,
+ 32, 34, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 101, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 97, 126,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 76, 108, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 109, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 10, 13, 34, 9, 13, 32, 34, 44,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 92, 97,
+ 100, 110, 111, 113, 114, 115, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 92, 97, 100, 110,
+ 111, 113, 114, 115, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 34, 92, 127, 0, 31,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 10,
+ 13, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 92, 93,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 71, 92, 103, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 72, 92, 104, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 92, 105, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 78, 92, 110, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 34, 92, 127, 0, 31,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 92, 110, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 67, 92, 99, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 81, 92, 113,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 80, 92,
+ 112, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 92,
+ 127, 0, 31, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 34,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 70, 84, 91, 92, 102, 116,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 70,
+ 84, 91, 92, 102, 116, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 83, 92, 115, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 85,
+ 92, 117, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 84, 116, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 97, 126, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 76, 108, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 101, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 10, 13, 34, 9, 13,
+ 32, 34, 44, 61, 9, 13, 32, 33,
+ 34, 37, 39, 70, 84, 91, 102, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 70, 84, 91,
+ 102, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 65, 97, 126,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 76, 108, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 83, 115, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 69, 101,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 9, 13,
+ 32, 33, 34, 37, 39, 44, 82, 114,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 85, 117, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 109, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 65, 97, 126, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 105, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 78, 110, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 10,
+ 13, 34, 9, 13, 32, 34, 44, 61,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 34,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 34, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 112, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 81,
+ 113, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 85, 117, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 34, 13, 34, 58, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 93,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 93, 13, 34,
+ 58, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 34, 48, 57, 13, 34,
+ 46, 48, 57, 13, 34, 48, 57, 13,
+ 34, 46, 48, 57, 13, 34, 48, 57,
+ 13, 34, 93, 48, 57, 13, 34, 93,
+ 48, 57, 13, 34, 93, 9, 13, 32,
+ 34, 44, 13, 34, 46, 48, 57, 13,
+ 34, 46, 13, 34, 46, 48, 57, 13,
+ 34, 46, 13, 34, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 93, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 93,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 93, 13, 34, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 13, 34, 48,
+ 57, 13, 34, 46, 48, 57, 13, 34,
+ 46, 48, 57, 13, 34, 46, 13, 34,
+ 58, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 111, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 112, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 10, 13, 34, 9,
+ 13, 32, 34, 44, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 10,
+ 13, 34, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 108, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 109, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 10, 13,
+ 34, 9, 13, 32, 34, 44, 61, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 34, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 84, 116, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 97, 126, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 108, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 101, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 70, 84, 91, 102, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 70, 84, 91, 102,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 65, 97, 126, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 76,
+ 108, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 83, 115, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 69, 101, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 9, 13, 32,
+ 33, 34, 37, 39, 44, 82, 114, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 85, 117, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 71, 103, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 111,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 82, 114, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 84, 116, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 72, 104,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 109, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 10, 13, 34,
+ 9, 13, 32, 34, 44, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 93, 127, 0, 8, 10, 31, 9,
+ 13, 32, 34, 44, 92, 127, 0, 31,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 58, 92, 93, 127,
+ 0, 8, 10, 31, 13, 34, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 71, 92, 103, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 92, 111, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 82, 92, 114, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 92, 105, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 84, 92, 116, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 72, 92, 104, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 79, 92, 111, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 77, 92, 109, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 73, 92, 105, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 78, 92, 110, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 10, 13, 34, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 34, 92, 127, 0,
+ 31, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 78, 92, 110,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 67, 92, 99,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 34, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 34, 92, 127, 0, 31, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 80, 92, 112, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 81, 92, 113, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 85, 92, 117, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 10, 13, 34, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 34, 92, 127, 0,
+ 31, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 34, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 34,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 34, 92, 127, 0, 31, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 84, 92, 116, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 65, 92, 97, 126, 127, 0,
+ 31, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 76, 92, 108, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 69, 92, 101, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 10, 13, 34, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 70, 84, 91,
+ 92, 102, 116, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 70, 84, 91, 92, 102,
+ 116, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 83, 92, 115,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 69, 92, 101, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 44, 82, 92, 114, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 85, 92, 117, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 65, 92, 97, 126, 127, 0, 31, 42,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 34, 92, 127, 0, 31, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 84, 92, 116, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 76, 92, 108, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 61, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 10, 13, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 70, 84, 91, 92, 102,
+ 116, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 70, 84, 91, 92, 102, 116, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 82, 92, 114, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 85, 92, 117, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 76, 92, 108,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 84, 92,
+ 116, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 70, 84, 91, 92, 102, 116, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 70, 84, 91,
+ 92, 102, 116, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 83,
+ 92, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 82, 92,
+ 114, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 77, 109, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 97,
+ 126, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 73, 105, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 110,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 10, 13, 34, 9, 13, 32, 34,
+ 44, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 71,
+ 103, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 82,
+ 114, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 73, 105, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 84,
+ 116, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 72, 104, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 109, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 10, 13, 34,
+ 13, 34, 58, 92, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 13, 34, 58, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 48, 57, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 93, 127,
+ 0, 8, 10, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 13, 34, 46,
+ 58, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 58, 92, 93, 127, 0, 8, 10,
+ 31, 13, 34, 92, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 10, 13, 34, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 71, 92, 103, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 82, 92, 114, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 84, 92, 116, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 72, 92, 104, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 77, 92, 109, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 34, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 79, 92,
+ 111, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 73, 92,
+ 105, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 78, 92,
+ 110, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 34,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 34, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 67,
+ 92, 99, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 34, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 34, 92, 127, 0, 31, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 80, 92, 112, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 81, 92, 113, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 85, 92, 117, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 34, 92,
+ 127, 0, 31, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 80,
+ 92, 112, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 34, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 34, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 34, 9,
+ 13, 32, 34, 92, 127, 0, 31, 10,
+ 13, 34, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 77, 92, 109, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 34, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 34, 9, 13, 32, 34, 92,
+ 127, 0, 31, 10, 13, 34, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 84,
+ 92, 116, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 76,
+ 92, 108, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 69,
+ 92, 101, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 34, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 70, 84, 91, 92, 102, 116,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 70, 84, 91, 92, 102, 116, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 65, 92, 97, 126,
+ 127, 0, 31, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 83, 92, 115, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 69, 92, 101, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 82, 92, 114, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 85, 92, 117, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 34, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 78, 92, 110,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 67, 92, 99,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 81, 92, 113,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 79, 92, 111,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 80, 92, 112,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 77, 92,
+ 109, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 84, 92,
+ 116, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 76, 92,
+ 108, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 70, 84, 91, 92, 102, 116, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 70, 84, 91,
+ 92, 102, 116, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 65, 92, 97, 126, 127, 0, 31,
+ 42, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 76, 92, 108, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 83,
+ 92, 115, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 82, 92,
+ 114, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 85, 92, 117,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 10, 13,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 77, 109, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 78, 110, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 61, 10, 13, 9, 13, 32, 44,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 13,
+ 34, 92, 127, 0, 8, 10, 31, 10,
+ 13, 9, 13, 32, 33, 37, 39, 44,
+ 61, 71, 103, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 79, 111, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 61, 82,
+ 114, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 61, 73, 105, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 61, 84, 116, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 72, 104, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 77, 109, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 61, 10, 13, 9, 13,
+ 32, 44, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 37, 39, 44, 61, 79, 111, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 77, 109, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 65, 97, 126, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 61, 78, 110, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 61, 10, 13, 9, 13, 32, 44,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 34, 13,
+ 34, 92, 127, 0, 8, 10, 31, 13,
+ 34, 92, 127, 0, 8, 10, 31, 10,
+ 13, 34, 13, 34, 0, 9, 11, 127,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 92, 97, 100,
+ 110, 111, 113, 114, 115, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 92, 97, 100, 110, 111,
+ 113, 114, 115, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 61, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 10, 13, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 10, 13, 13, 34, 58,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 13, 34,
+ 58, 92, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 93, 127, 0, 8, 10,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 46, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 58, 92,
+ 93, 127, 0, 8, 10, 31, 13, 34,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 65, 70, 97, 102, 13, 34, 46, 58,
+ 92, 93, 127, 0, 8, 10, 31, 48,
+ 57, 65, 70, 97, 102, 13, 34, 46,
+ 58, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 65, 70, 97, 102, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 48, 57, 13, 34, 46, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 46, 92, 127, 0, 8, 10, 31,
+ 13, 34, 58, 92, 127, 0, 8, 10,
+ 31, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 76, 92, 108, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 71, 92, 103, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 82, 92, 114, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 73, 92, 105, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 84, 92, 116, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 72, 92, 104, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 77, 92, 109, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 10, 13, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 79,
+ 92, 111, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 77,
+ 92, 109, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 65,
+ 92, 97, 126, 127, 0, 31, 42, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 73,
+ 92, 105, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 78,
+ 92, 110, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 61, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 10, 13,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 34,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 79, 92, 111, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 78, 92, 110, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 67, 92, 99, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 69, 92, 101, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 61,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 10,
+ 13, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 91, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 91, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 80, 92,
+ 112, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 81, 92,
+ 113, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 85, 92,
+ 117, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 69, 92,
+ 101, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 61, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 61, 92, 127, 0, 31, 10, 13, 9,
+ 13, 32, 34, 44, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 79, 92, 111, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 80, 92, 112, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 61, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 61, 92,
+ 127, 0, 31, 10, 13, 9, 13, 32,
+ 34, 44, 61, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 91, 92,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 13,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 34, 92, 127, 0,
+ 31, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 69, 92, 101,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 65, 92, 97,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 76, 92, 108,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 77, 92, 109,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 61, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 61,
+ 92, 127, 0, 31, 10, 13, 9, 13,
+ 32, 34, 44, 61, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 13, 9, 13, 32, 33, 34, 37, 39,
+ 91, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 84, 92, 116, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 65, 92, 97, 126, 127,
+ 0, 31, 42, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 76, 92, 108, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 61, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 61, 92, 127,
+ 0, 31, 10, 13, 9, 13, 32, 34,
+ 44, 61, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 70, 84, 91,
+ 92, 102, 116, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 9, 13, 32, 33, 34,
+ 37, 39, 70, 84, 91, 92, 102, 116,
+ 126, 127, 0, 31, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 65, 92,
+ 97, 126, 127, 0, 31, 42, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 76, 92, 108,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 83, 92, 115, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 69, 92, 101, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 44, 82, 92, 114, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 85, 92, 117, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 10, 13, 10, 13, 9, 13, 32,
+ 33, 37, 39, 44, 61, 79, 111, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 61,
+ 80, 112, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 61, 10, 13, 9, 13, 32, 44, 61,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 13, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 13, 9, 13, 32, 34, 13, 34,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 13,
+ 34, 13, 34, 0, 9, 11, 127, 10,
+ 13, 13, 73, 105, 13, 71, 103, 13,
+ 69, 101, 13, 83, 115, 13, 84, 116,
+ 9, 13, 32, 10, 13, 9, 13, 32,
+ 87, 119, 87, 119, 13, 9, 13, 32,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 13, 34, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 34, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 13, 34, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 33, 34,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 33, 34,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 33, 34, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 33, 37,
+ 39, 65, 68, 78, 79, 81, 82, 83,
+ 97, 100, 110, 111, 113, 114, 115, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 65, 68, 78, 79, 81, 82, 83,
+ 97, 100, 110, 111, 113, 114, 115, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 33,
+ 34, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 33,
+ 34, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 9, 13, 32, 33, 34, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 33,
+ 34, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 34,
+ 9, 13, 32, 34, 9, 13, 32, 34,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 33, 34, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 34, 9, 13, 32, 34, 9,
+ 13, 32, 34, 9, 13, 32, 33, 37,
+ 39, 65, 68, 78, 79, 81, 82, 83,
+ 97, 100, 110, 111, 113, 114, 115, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 33, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 33, 34, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 34, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 34, 9, 13, 32,
+ 34, 9, 13, 32, 33, 34, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 9, 13, 32, 9, 13,
+ 32, 33, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 34, 9, 13,
+ 32, 33, 37, 39, 65, 68, 78, 79,
+ 81, 82, 83, 97, 100, 110, 111, 113,
+ 114, 115, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 33, 37, 39, 65, 68, 78, 79, 81,
+ 82, 83, 97, 100, 110, 111, 113, 114,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 9,
+ 13, 32, 9, 13, 32, 33, 37, 39,
+ 65, 68, 78, 79, 81, 82, 83, 97,
+ 100, 110, 111, 113, 114, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 9,
+ 13, 32, 33, 37, 39, 65, 68, 78,
+ 79, 81, 82, 83, 97, 100, 110, 111,
+ 113, 114, 115, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 9, 13, 32, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 9, 13,
+ 32, 9, 13, 32, 33, 37, 39, 65,
+ 68, 78, 79, 81, 82, 83, 97, 100,
+ 110, 111, 113, 114, 115, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 65, 68,
+ 78, 79, 81, 82, 83, 97, 100, 110,
+ 111, 113, 114, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 9, 13, 32, 9, 13, 32,
+ 9, 13, 32, 34, 9, 13, 32, 33,
+ 37, 39, 65, 68, 78, 79, 81, 82,
+ 83, 97, 100, 110, 111, 113, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 0
+ };
-static const short _thttp_machine_parser_header_WWW_Authenticate_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 19,
- 22, 25, 28, 31, 34, 37, 40, 43,
- 46, 49, 52, 55, 59, 67, 69, 72,
- 80, 83, 91, 95, 99, 103, 107, 111,
- 138, 141, 168, 182, 188, 191, 197, 224,
- 227, 254, 270, 273, 289, 304, 307, 322,
- 325, 330, 337, 340, 345, 350, 353, 358,
- 361, 377, 393, 409, 425, 439, 445, 448,
- 454, 469, 472, 487, 490, 495, 502, 505,
- 510, 514, 527, 533, 540, 547, 554, 558,
- 564, 572, 575, 579, 582, 586, 589, 593,
- 597, 600, 604, 607, 611, 614, 622, 630,
- 637, 644, 651, 658, 662, 667, 675, 683,
- 691, 694, 698, 702, 705, 708, 711, 727,
- 743, 759, 775, 791, 805, 811, 814, 820,
- 835, 838, 853, 856, 861, 868, 871, 876,
- 880, 883, 899, 915, 929, 935, 938, 944,
- 959, 962, 977, 980, 985, 992, 999, 1002,
- 1006, 1011, 1014, 1019, 1035, 1051, 1067, 1083,
- 1097, 1103, 1106, 1112, 1127, 1130, 1145, 1148,
- 1153, 1160, 1163, 1168, 1172, 1175, 1191, 1207,
- 1223, 1239, 1253, 1259, 1262, 1268, 1287, 1290,
- 1309, 1324, 1339, 1354, 1369, 1374, 1389, 1404,
- 1407, 1411, 1416, 1425, 1428, 1437, 1440, 1449,
- 1480, 1483, 1514, 1532, 1542, 1545, 1555, 1573,
- 1576, 1594, 1597, 1605, 1614, 1623, 1626, 1630,
- 1647, 1658, 1670, 1682, 1694, 1703, 1714, 1727,
- 1735, 1744, 1752, 1761, 1769, 1778, 1787, 1795,
- 1804, 1812, 1821, 1829, 1842, 1855, 1867, 1879,
- 1891, 1903, 1912, 1922, 1935, 1948, 1961, 1969,
- 1978, 1987, 1995, 2003, 2006, 2026, 2046, 2066,
- 2086, 2106, 2126, 2146, 2166, 2184, 2194, 2197,
- 2207, 2225, 2228, 2246, 2263, 2266, 2286, 2306,
- 2326, 2346, 2366, 2384, 2394, 2397, 2407, 2425,
- 2428, 2446, 2449, 2457, 2466, 2473, 2476, 2480,
- 2484, 2489, 2498, 2502, 2511, 2542, 2546, 2577,
- 2595, 2605, 2609, 2619, 2637, 2641, 2659, 2663,
- 2671, 2688, 2692, 2707, 2714, 2718, 2725, 2753,
- 2757, 2785, 2802, 2806, 2823, 2838, 2842, 2857,
- 2861, 2866, 2880, 2886, 2890, 2896, 2900, 2917,
- 2934, 2951, 2968, 2983, 2990, 2994, 3001, 3016,
- 3020, 3035, 3039, 3044, 3053, 3056, 3065, 3068,
- 3077, 3108, 3111, 3142, 3160, 3170, 3173, 3183,
- 3201, 3204, 3222, 3225, 3233, 3242, 3259, 3268,
- 3271, 3282, 3294, 3306, 3318, 3327, 3338, 3351,
- 3359, 3368, 3376, 3385, 3393, 3402, 3411, 3419,
- 3428, 3437, 3445, 3454, 3462, 3475, 3488, 3500,
- 3512, 3524, 3536, 3545, 3555, 3568, 3581, 3594,
- 3602, 3611, 3620, 3628, 3636, 3639, 3659, 3679,
- 3699, 3719, 3739, 3759, 3779, 3799, 3817, 3827,
- 3830, 3840, 3858, 3861, 3879, 3896, 3899, 3919,
- 3939, 3959, 3979, 3999, 4017, 4027, 4030, 4040,
- 4058, 4061, 4079, 4082, 4090, 4099, 4102, 4122,
- 4142, 4162, 4182, 4200, 4210, 4213, 4223, 4241,
- 4244, 4262, 4265, 4273, 4282, 4285, 4305, 4325,
- 4345, 4365, 4385, 4403, 4413, 4416, 4426, 4444,
- 4447, 4465, 4468, 4476, 4485, 4494, 4497, 4506,
- 4537, 4540, 4571, 4589, 4599, 4602, 4612, 4630,
- 4633, 4651, 4654, 4662, 4671, 4688, 4691, 4702,
- 4714, 4726, 4738, 4747, 4758, 4771, 4779, 4788,
- 4796, 4805, 4813, 4822, 4831, 4839, 4848, 4857,
- 4865, 4874, 4882, 4895, 4908, 4920, 4932, 4944,
- 4956, 4965, 4975, 4988, 5001, 5014, 5022, 5031,
- 5040, 5048, 5056, 5059, 5079, 5099, 5119, 5139,
- 5159, 5179, 5199, 5219, 5237, 5247, 5250, 5260,
- 5278, 5281, 5299, 5316, 5319, 5339, 5359, 5379,
- 5399, 5419, 5437, 5447, 5450, 5460, 5478, 5481,
- 5499, 5502, 5510, 5519, 5522, 5542, 5562, 5582,
- 5602, 5620, 5630, 5633, 5643, 5661, 5664, 5682,
- 5685, 5693, 5702, 5705, 5725, 5745, 5765, 5785,
- 5805, 5823, 5833, 5836, 5846, 5864, 5867, 5885,
- 5888, 5896, 5905, 5908, 5928, 5948, 5966, 5976,
- 5979, 5989, 6007, 6010, 6028, 6031, 6039, 6048,
- 6057, 6061, 6070, 6101, 6105, 6136, 6154, 6164,
- 6168, 6178, 6196, 6200, 6218, 6222, 6230, 6247,
- 6251, 6266, 6273, 6277, 6284, 6312, 6316, 6344,
- 6361, 6365, 6382, 6397, 6401, 6416, 6420, 6425,
- 6439, 6445, 6449, 6455, 6459, 6476, 6493, 6510,
- 6527, 6542, 6549, 6553, 6560, 6575, 6579, 6594,
- 6598, 6603, 6610, 6618, 6626, 6634, 6639, 6646,
- 6655, 6659, 6664, 6668, 6673, 6677, 6682, 6687,
- 6691, 6697, 6702, 6706, 6711, 6715, 6724, 6733,
- 6741, 6749, 6757, 6765, 6770, 6776, 6785, 6794,
- 6803, 6807, 6812, 6817, 6821, 6825, 6829, 6846,
- 6863, 6880, 6897, 6914, 6929, 6936, 6940, 6947,
- 6962, 6966, 6981, 6985, 6990, 6999, 7002, 7011,
- 7015, 7032, 7049, 7064, 7071, 7075, 7082, 7097,
- 7101, 7116, 7120, 7137, 7154, 7171, 7188, 7203,
- 7210, 7214, 7221, 7236, 7240, 7255, 7259, 7264,
- 7273, 7276, 7285, 7288, 7297, 7328, 7331, 7362,
- 7380, 7390, 7393, 7403, 7421, 7424, 7442, 7445,
- 7453, 7462, 7479, 7488, 7491, 7502, 7514, 7526,
- 7538, 7547, 7558, 7571, 7579, 7588, 7596, 7605,
- 7613, 7622, 7631, 7639, 7648, 7657, 7665, 7674,
- 7682, 7695, 7708, 7720, 7732, 7744, 7756, 7765,
- 7775, 7788, 7801, 7814, 7822, 7831, 7840, 7848,
- 7856, 7859, 7879, 7899, 7919, 7939, 7959, 7979,
- 7999, 8019, 8037, 8047, 8050, 8060, 8078, 8081,
- 8099, 8116, 8119, 8139, 8159, 8179, 8199, 8219,
- 8237, 8247, 8250, 8260, 8278, 8281, 8299, 8302,
- 8310, 8319, 8322, 8342, 8362, 8382, 8402, 8420,
- 8430, 8433, 8443, 8461, 8464, 8482, 8485, 8493,
- 8502, 8505, 8525, 8545, 8565, 8585, 8605, 8623,
- 8633, 8636, 8646, 8664, 8667, 8685, 8688, 8696,
- 8705, 8708, 8728, 8748, 8766, 8776, 8779, 8789,
- 8807, 8810, 8828, 8831, 8839, 8848, 8851, 8871,
- 8891, 8911, 8931, 8949, 8959, 8962, 8972, 8990,
- 8993, 9011, 9014, 9022, 9031, 9034, 9054, 9074,
- 9094, 9114, 9132, 9142, 9145, 9155, 9177, 9180,
- 9202, 9221, 9240, 9259, 9278, 9287, 9306, 9325,
- 9328, 9332, 9349, 9366, 9383, 9400, 9415, 9422,
- 9426, 9433, 9452, 9456, 9475, 9491, 9507, 9523,
- 9539, 9545, 9561, 9577, 9581, 9598, 9615, 9632,
- 9649, 9664, 9671, 9675, 9682, 9697, 9701, 9716,
- 9720, 9725, 9734, 9743, 9747, 9756, 9773, 9790,
- 9807, 9824, 9841, 9856, 9863, 9867, 9874, 9889,
- 9893, 9908, 9912, 9917, 9924, 9932, 9940, 9948,
- 9953, 9960, 9969, 9973, 9978, 9982, 9987, 9991,
- 9996, 10001, 10005, 10011, 10016, 10020, 10025, 10029,
- 10038, 10047, 10055, 10063, 10071, 10079, 10084, 10090,
- 10099, 10108, 10117, 10121, 10126, 10131, 10135, 10139,
- 10143, 10160, 10177, 10192, 10199, 10203, 10210, 10225,
- 10229, 10244, 10248, 10253, 10262, 10271, 10275, 10284,
- 10288, 10305, 10322, 10339, 10356, 10371, 10378, 10382,
- 10389, 10404, 10408, 10423, 10427, 10432, 10436, 10453,
- 10470, 10487, 10504, 10519, 10526, 10530, 10537, 10556,
- 10560, 10579, 10595, 10611, 10627, 10643, 10649, 10665,
- 10681, 10685, 10689, 10706, 10723, 10740, 10757, 10774,
- 10791, 10808, 10823, 10830, 10834, 10841, 10856, 10860,
- 10875, 10889, 10893, 10904, 10916, 10928, 10940, 10949,
- 10960, 10973, 10981, 10990, 10998, 11007, 11015, 11024,
- 11033, 11041, 11050, 11059, 11067, 11076, 11084, 11097,
- 11110, 11122, 11134, 11146, 11158, 11167, 11177, 11190,
- 11203, 11216, 11224, 11233, 11242, 11250, 11258, 11262,
- 11282, 11302, 11322, 11342, 11362, 11382, 11402, 11422,
- 11440, 11450, 11454, 11464, 11482, 11486, 11504, 11521,
- 11525, 11545, 11565, 11585, 11605, 11625, 11643, 11653,
- 11657, 11667, 11685, 11689, 11707, 11711, 11719, 11723,
- 11743, 11763, 11783, 11803, 11821, 11831, 11835, 11845,
- 11863, 11867, 11885, 11889, 11897, 11901, 11921, 11941,
- 11961, 11981, 12001, 12019, 12029, 12033, 12043, 12061,
- 12065, 12083, 12087, 12095, 12099, 12119, 12139, 12157,
- 12167, 12171, 12181, 12199, 12203, 12221, 12225, 12245,
- 12265, 12285, 12305, 12323, 12333, 12337, 12347, 12365,
- 12369, 12387, 12391, 12399, 12403, 12423, 12443, 12463,
- 12483, 12501, 12511, 12515, 12525, 12547, 12551, 12573,
- 12592, 12611, 12630, 12649, 12658, 12677, 12696, 12700,
- 12703, 12723, 12743, 12763, 12783, 12801, 12811, 12814,
- 12824, 12842, 12845, 12863, 12866, 12874, 12883, 12886,
- 12906, 12926, 12946, 12966, 12984, 12994, 12997, 13007,
- 13029, 13032, 13054, 13073, 13092, 13111, 13130, 13139,
- 13158, 13177, 13180, 13183, 13203, 13223, 13241, 13251,
- 13254, 13264, 13282, 13285, 13303, 13306, 13314, 13323,
- 13326, 13346, 13366, 13386, 13406, 13424, 13434, 13437,
- 13447, 13465, 13468, 13486, 13489, 13497, 13506, 13509,
- 13529, 13549, 13569, 13589, 13607, 13617, 13620, 13630,
- 13652, 13655, 13677, 13696, 13715, 13734, 13753, 13762,
- 13781, 13800, 13803, 13807, 13824, 13841, 13858, 13875,
- 13890, 13897, 13901, 13908, 13923, 13927, 13942, 13946,
- 13963, 13980, 13997, 14014, 14031, 14048, 14065, 14080,
- 14087, 14091, 14098, 14113, 14117, 14132, 14146, 14150,
- 14161, 14173, 14185, 14197, 14206, 14217, 14230, 14238,
- 14247, 14255, 14264, 14272, 14281, 14290, 14298, 14307,
- 14316, 14324, 14333, 14341, 14354, 14367, 14379, 14391,
- 14403, 14415, 14424, 14434, 14447, 14460, 14473, 14481,
- 14490, 14499, 14507, 14515, 14519, 14539, 14559, 14579,
- 14599, 14619, 14639, 14659, 14679, 14697, 14707, 14711,
- 14721, 14739, 14743, 14761, 14778, 14782, 14802, 14822,
- 14842, 14862, 14882, 14900, 14910, 14914, 14924, 14942,
- 14946, 14964, 14968, 14988, 15008, 15028, 15048, 15066,
- 15076, 15080, 15090, 15108, 15112, 15130, 15134, 15142,
- 15146, 15166, 15186, 15206, 15226, 15246, 15264, 15274,
- 15278, 15288, 15306, 15310, 15328, 15332, 15340, 15344,
- 15364, 15384, 15402, 15412, 15416, 15426, 15444, 15448,
- 15466, 15470, 15478, 15482, 15502, 15522, 15542, 15562,
- 15580, 15590, 15594, 15604, 15622, 15626, 15644, 15648,
- 15656, 15660, 15680, 15700, 15720, 15740, 15758, 15768,
- 15772, 15782, 15804, 15808, 15830, 15849, 15868, 15887,
- 15906, 15915, 15934, 15953, 15957, 15960, 15980, 16000,
- 16020, 16040, 16058, 16068, 16071, 16081, 16099, 16102,
- 16120, 16123, 16131, 16134, 16154, 16174, 16194, 16214,
- 16234, 16252, 16262, 16265, 16275, 16293, 16296, 16314,
- 16317, 16325, 16328, 16348, 16368, 16386, 16396, 16399,
- 16409, 16427, 16430, 16448, 16451, 16459, 16468, 16471,
- 16491, 16511, 16531, 16551, 16569, 16579, 16582, 16592,
- 16610, 16613, 16631, 16634, 16642, 16645, 16665, 16685,
- 16705, 16725, 16743, 16753, 16756, 16766, 16788, 16791,
- 16813, 16832, 16851, 16870, 16889, 16898, 16917, 16936,
- 16939, 16942, 16958, 16974, 16990, 17006, 17020, 17026,
- 17029, 17035, 17050, 17053, 17068, 17071, 17076, 17083,
- 17086, 17102, 17118, 17134, 17150, 17166, 17182, 17198,
- 17212, 17218, 17221, 17227, 17242, 17245, 17260, 17273,
- 17276, 17292, 17308, 17324, 17340, 17356, 17370, 17376,
- 17379, 17385, 17400, 17403, 17418, 17421, 17426, 17433,
- 17440, 17444, 17449, 17458, 17461, 17470, 17473, 17482,
- 17513, 17516, 17547, 17565, 17575, 17578, 17588, 17606,
- 17609, 17627, 17644, 17653, 17656, 17667, 17679, 17691,
- 17703, 17712, 17723, 17736, 17744, 17753, 17761, 17770,
- 17778, 17787, 17796, 17804, 17813, 17822, 17830, 17839,
- 17847, 17860, 17873, 17885, 17897, 17909, 17921, 17930,
- 17940, 17953, 17966, 17979, 17987, 17996, 18005, 18013,
- 18021, 18024, 18044, 18064, 18084, 18104, 18124, 18144,
- 18164, 18184, 18202, 18212, 18215, 18225, 18243, 18246,
- 18264, 18281, 18284, 18304, 18324, 18344, 18364, 18384,
- 18402, 18412, 18415, 18425, 18443, 18446, 18464, 18467,
- 18475, 18484, 18487, 18507, 18527, 18547, 18567, 18585,
- 18595, 18598, 18608, 18626, 18629, 18647, 18650, 18670,
- 18690, 18710, 18730, 18750, 18768, 18778, 18781, 18791,
- 18809, 18812, 18830, 18833, 18853, 18873, 18891, 18901,
- 18904, 18914, 18932, 18935, 18953, 18956, 18964, 18973,
- 18976, 18996, 19016, 19036, 19056, 19074, 19084, 19087,
- 19097, 19115, 19118, 19136, 19139, 19159, 19179, 19199,
- 19219, 19237, 19247, 19250, 19260, 19282, 19285, 19307,
- 19326, 19345, 19364, 19383, 19392, 19411, 19430, 19433,
- 19436, 19452, 19468, 19482, 19488, 19491, 19497, 19512,
- 19515, 19530, 19533, 19538, 19545, 19552, 19556, 19561,
- 19564, 19568, 19572, 19576, 19580, 19584, 19588, 19591,
- 19595, 19598, 19601, 19603, 19607, 19611, 19615, 19619,
- 19646, 19650, 19654, 19658, 19662, 19689, 19693, 19697,
- 19701, 19705, 19732, 19736, 19740, 19744, 19748, 19775,
- 19779, 19783, 19787, 19790, 19817, 19821, 19825, 19829,
- 19833, 19860, 19864, 19868, 19895, 19900, 19927, 19954,
- 19958, 19962, 19966, 19970, 19974, 20001, 20005, 20009,
- 20036, 20040, 20044, 20048, 20051, 20056, 20061, 20066,
- 20071, 20076, 20081, 20109, 20114, 20119, 20147, 20152,
- 20157, 20162, 20190, 20195, 20200, 20205, 20232, 20259,
- 20263, 20267, 20271, 20275, 20279, 20306, 20310, 20314,
- 20341, 20345, 20349, 20353, 20380, 20384, 20388, 20392,
- 20419, 20423, 20427, 20431, 20435, 20439, 20443, 20447,
- 20451, 20478, 20505, 20509, 20513, 20540, 20544, 20548,
- 20552, 20579, 20583, 20587, 20591, 20618, 20622, 20626,
- 20630, 20657, 20661, 20665, 20669, 20674, 20679, 20684,
- 20689, 20694, 20722, 20727, 20732, 20760, 20765, 20770,
- 20775, 20803, 20808, 20813, 20818, 20846, 20851, 20856,
- 20861, 20888, 20916, 20921, 20926, 20954, 20959, 20964,
- 20969, 20996, 21023, 21027, 21031, 21035, 21039, 21043,
- 21070, 21074, 21078, 21105, 21109, 21113, 21117, 21144,
- 21148, 21152, 21156, 21183, 21187, 21191, 21195, 21222,
- 21226, 21230, 21234, 21261, 21265, 21269, 21273, 21300,
- 21304, 21308, 21335, 21363, 21368, 21373, 21401, 21406,
- 21411, 21416, 21444, 21449, 21454, 21459, 21487, 21492,
- 21497, 21502, 21530, 21558, 21563, 21568, 21573, 21601,
- 21606, 21611, 21639, 21667, 21672, 21677, 21705, 21733,
- 21738, 21743, 21771, 21776, 21781, 21786, 21814, 21819,
- 21824, 21829, 21857, 21862, 21867, 21872, 21900, 21905,
- 21910, 21938, 21943, 21948, 21953, 21981, 21986, 21991,
- 22019, 22046, 22050, 22054, 22058, 22085, 22089, 22093,
- 22120, 22147, 22151, 22155, 22159, 22186, 22190, 22194,
- 22198, 22225, 22229, 22233, 22260, 22288, 22293, 22298,
- 22326, 22331, 22336, 22364, 22392, 22397, 22402, 22430,
- 22435, 22440, 22468, 22473, 22478, 22483, 22511, 22516,
- 22521, 22526, 22554, 22559, 22564, 22569, 22597, 22602,
- 22607, 22612, 22640, 22645, 22650, 22678, 22705, 22709,
- 22713, 22717, 22744, 22748, 22752, 22756, 22783, 22787,
- 22791, 22795, 22822, 22826, 22830, 22834, 22861, 22865,
- 22869, 22896, 22923, 22927, 22931, 22935, 22962, 22966,
- 22970, 22997, 23001, 23005, 23009, 23014, 23041, 23068,
- 23072, 23076, 23080, 23084, 23111, 23115, 23119, 23146,
- 23150, 23154, 23158, 23185, 23189, 23193, 23220, 23224,
- 23228, 23255, 23259, 23263, 23267, 23294, 23298, 23302,
- 23329, 23333, 23337, 23364, 23391, 23395, 23399, 23403,
- 23408
-};
+ static const char _thttp_machine_parser_header_WWW_Authenticate_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 3, 7, 1, 2, 7,
+ 2, 7, 3, 3, 3, 3, 3, 21,
+ 2, 21, 9, 5, 2, 5, 21, 2,
+ 21, 11, 2, 11, 9, 2, 9, 2,
+ 4, 4, 2, 4, 4, 2, 4, 2,
+ 11, 11, 11, 11, 9, 5, 2, 5,
+ 9, 2, 9, 2, 4, 4, 2, 4,
+ 1, 8, 2, 3, 3, 3, 3, 2,
+ 4, 1, 2, 1, 2, 1, 2, 2,
+ 2, 2, 2, 2, 2, 4, 4, 3,
+ 3, 3, 3, 3, 1, 4, 4, 4,
+ 1, 2, 2, 2, 2, 2, 11, 11,
+ 11, 11, 11, 9, 5, 2, 5, 9,
+ 2, 9, 2, 4, 4, 2, 4, 1,
+ 2, 11, 11, 9, 5, 2, 5, 9,
+ 2, 9, 2, 4, 4, 4, 2, 3,
+ 4, 2, 4, 11, 11, 11, 11, 9,
+ 5, 2, 5, 9, 2, 9, 2, 4,
+ 4, 2, 4, 1, 2, 11, 11, 11,
+ 11, 9, 5, 2, 5, 13, 2, 13,
+ 10, 10, 10, 10, 4, 10, 10, 2,
+ 3, 2, 7, 2, 7, 2, 7, 24,
+ 2, 24, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 7, 2, 1, 11,
+ 5, 6, 6, 6, 6, 5, 7, 4,
+ 5, 4, 5, 4, 5, 5, 5, 5,
+ 5, 5, 5, 7, 7, 6, 6, 6,
+ 6, 6, 4, 7, 7, 7, 4, 5,
+ 5, 5, 5, 2, 14, 14, 14, 14,
+ 14, 14, 14, 14, 12, 8, 2, 8,
+ 11, 2, 11, 11, 2, 14, 14, 14,
+ 14, 14, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 4, 2, 3, 3,
+ 2, 7, 3, 7, 24, 3, 24, 12,
+ 8, 3, 8, 11, 3, 11, 3, 6,
+ 11, 3, 10, 6, 3, 6, 22, 3,
+ 22, 12, 3, 12, 9, 3, 9, 3,
+ 4, 9, 5, 3, 5, 3, 12, 12,
+ 12, 12, 10, 6, 3, 6, 9, 3,
+ 9, 3, 4, 7, 2, 7, 2, 7,
+ 24, 2, 24, 12, 8, 2, 8, 11,
+ 2, 11, 2, 6, 7, 11, 7, 2,
+ 5, 6, 6, 6, 6, 5, 7, 4,
+ 5, 4, 5, 4, 5, 5, 5, 7,
+ 5, 5, 5, 5, 7, 7, 6, 6,
+ 6, 6, 6, 4, 7, 7, 7, 4,
+ 5, 5, 5, 5, 2, 14, 14, 14,
+ 14, 14, 14, 14, 14, 12, 8, 2,
+ 8, 11, 2, 11, 11, 2, 14, 14,
+ 14, 14, 14, 12, 8, 2, 8, 11,
+ 2, 11, 2, 6, 7, 2, 14, 14,
+ 14, 14, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 2, 14, 14, 14,
+ 14, 14, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 7, 2, 7, 24,
+ 2, 24, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 11, 2, 5, 6,
+ 6, 6, 6, 5, 7, 4, 5, 4,
+ 5, 4, 5, 5, 5, 7, 5, 5,
+ 5, 5, 7, 7, 6, 6, 6, 6,
+ 6, 4, 7, 7, 7, 4, 5, 5,
+ 5, 5, 2, 14, 14, 14, 14, 14,
+ 14, 14, 14, 12, 8, 2, 8, 11,
+ 2, 11, 11, 2, 14, 14, 14, 14,
+ 14, 12, 8, 2, 8, 11, 2, 11,
+ 2, 6, 7, 2, 14, 14, 14, 14,
+ 12, 8, 2, 8, 11, 2, 11, 2,
+ 6, 7, 2, 14, 14, 14, 14, 14,
+ 12, 8, 2, 8, 11, 2, 11, 2,
+ 6, 7, 2, 14, 14, 12, 8, 2,
+ 8, 11, 2, 11, 2, 6, 7, 7,
+ 3, 7, 24, 3, 24, 12, 8, 3,
+ 8, 11, 3, 11, 3, 6, 11, 3,
+ 10, 6, 3, 6, 22, 3, 22, 12,
+ 3, 12, 9, 3, 9, 3, 4, 9,
+ 5, 3, 5, 3, 12, 12, 12, 12,
+ 10, 6, 3, 6, 9, 3, 9, 3,
+ 4, 3, 4, 4, 4, 4, 3, 5,
+ 2, 3, 2, 3, 2, 3, 3, 3,
+ 5, 3, 3, 3, 3, 5, 5, 4,
+ 4, 4, 4, 4, 2, 5, 5, 5,
+ 2, 3, 3, 3, 3, 3, 12, 12,
+ 12, 12, 12, 10, 6, 3, 6, 9,
+ 3, 9, 3, 4, 7, 2, 7, 3,
+ 12, 12, 10, 6, 3, 6, 9, 3,
+ 9, 3, 12, 12, 12, 12, 10, 6,
+ 3, 6, 9, 3, 9, 3, 4, 7,
+ 2, 7, 2, 7, 24, 2, 24, 12,
+ 8, 2, 8, 11, 2, 11, 2, 6,
+ 7, 11, 7, 2, 5, 6, 6, 6,
+ 6, 5, 7, 4, 5, 4, 5, 4,
+ 5, 5, 5, 7, 5, 5, 5, 5,
+ 7, 7, 6, 6, 6, 6, 6, 4,
+ 7, 7, 7, 4, 5, 5, 5, 5,
+ 2, 14, 14, 14, 14, 14, 14, 14,
+ 14, 12, 8, 2, 8, 11, 2, 11,
+ 11, 2, 14, 14, 14, 14, 14, 12,
+ 8, 2, 8, 11, 2, 11, 2, 6,
+ 7, 2, 14, 14, 14, 14, 12, 8,
+ 2, 8, 11, 2, 11, 2, 6, 7,
+ 2, 14, 14, 14, 14, 14, 12, 8,
+ 2, 8, 11, 2, 11, 2, 6, 7,
+ 2, 14, 14, 12, 8, 2, 8, 11,
+ 2, 11, 2, 6, 7, 2, 14, 14,
+ 14, 14, 12, 8, 2, 8, 11, 2,
+ 11, 2, 6, 7, 2, 14, 14, 14,
+ 14, 12, 8, 2, 8, 15, 2, 15,
+ 13, 13, 13, 13, 7, 13, 13, 2,
+ 3, 12, 12, 12, 12, 10, 6, 3,
+ 6, 13, 3, 13, 11, 11, 11, 11,
+ 5, 11, 11, 3, 12, 12, 12, 12,
+ 10, 6, 3, 6, 9, 3, 9, 3,
+ 4, 7, 7, 3, 7, 12, 12, 12,
+ 12, 12, 10, 6, 3, 6, 9, 3,
+ 9, 3, 4, 3, 4, 4, 4, 4,
+ 3, 5, 2, 3, 2, 3, 2, 3,
+ 3, 3, 5, 3, 3, 3, 3, 5,
+ 5, 4, 4, 4, 4, 4, 2, 5,
+ 5, 5, 2, 3, 3, 3, 3, 3,
+ 12, 12, 10, 6, 3, 6, 9, 3,
+ 9, 3, 4, 7, 7, 3, 7, 3,
+ 12, 12, 12, 12, 10, 6, 3, 6,
+ 9, 3, 9, 3, 4, 3, 12, 12,
+ 12, 12, 10, 6, 3, 6, 13, 3,
+ 13, 11, 11, 11, 11, 5, 11, 11,
+ 3, 3, 12, 12, 12, 12, 12, 12,
+ 12, 10, 6, 3, 6, 9, 3, 9,
+ 9, 3, 5, 6, 6, 6, 6, 5,
+ 7, 4, 5, 4, 5, 4, 5, 5,
+ 5, 7, 5, 5, 5, 5, 7, 7,
+ 6, 6, 6, 6, 6, 4, 7, 7,
+ 7, 4, 5, 5, 5, 5, 3, 14,
+ 14, 14, 14, 14, 14, 14, 14, 12,
+ 8, 3, 8, 11, 3, 11, 11, 3,
+ 14, 14, 14, 14, 14, 12, 8, 3,
+ 8, 11, 3, 11, 3, 6, 3, 14,
+ 14, 14, 14, 12, 8, 3, 8, 11,
+ 3, 11, 3, 6, 3, 14, 14, 14,
+ 14, 14, 12, 8, 3, 8, 11, 3,
+ 11, 3, 6, 3, 14, 14, 12, 8,
+ 3, 8, 11, 3, 11, 3, 14, 14,
+ 14, 14, 12, 8, 3, 8, 11, 3,
+ 11, 3, 6, 3, 14, 14, 14, 14,
+ 12, 8, 3, 8, 15, 3, 15, 13,
+ 13, 13, 13, 7, 13, 13, 3, 2,
+ 14, 14, 14, 14, 12, 8, 2, 8,
+ 11, 2, 11, 2, 6, 7, 2, 14,
+ 14, 14, 14, 12, 8, 2, 8, 15,
+ 2, 15, 13, 13, 13, 13, 7, 13,
+ 13, 2, 2, 14, 14, 12, 8, 2,
+ 8, 11, 2, 11, 2, 6, 7, 2,
+ 14, 14, 14, 14, 12, 8, 2, 8,
+ 11, 2, 11, 2, 6, 7, 2, 14,
+ 14, 14, 14, 12, 8, 2, 8, 15,
+ 2, 15, 13, 13, 13, 13, 7, 13,
+ 13, 2, 3, 12, 12, 12, 12, 10,
+ 6, 3, 6, 9, 3, 9, 3, 12,
+ 12, 12, 12, 12, 12, 12, 10, 6,
+ 3, 6, 9, 3, 9, 9, 3, 5,
+ 6, 6, 6, 6, 5, 7, 4, 5,
+ 4, 5, 4, 5, 5, 5, 7, 5,
+ 5, 5, 5, 7, 7, 6, 6, 6,
+ 6, 6, 4, 7, 7, 7, 4, 5,
+ 5, 5, 5, 3, 14, 14, 14, 14,
+ 14, 14, 14, 14, 12, 8, 3, 8,
+ 11, 3, 11, 11, 3, 14, 14, 14,
+ 14, 14, 12, 8, 3, 8, 11, 3,
+ 11, 3, 14, 14, 14, 14, 12, 8,
+ 3, 8, 11, 3, 11, 3, 6, 3,
+ 14, 14, 14, 14, 14, 12, 8, 3,
+ 8, 11, 3, 11, 3, 6, 3, 14,
+ 14, 12, 8, 3, 8, 11, 3, 11,
+ 3, 6, 3, 14, 14, 14, 14, 12,
+ 8, 3, 8, 11, 3, 11, 3, 6,
+ 3, 14, 14, 14, 14, 12, 8, 3,
+ 8, 15, 3, 15, 13, 13, 13, 13,
+ 7, 13, 13, 3, 2, 14, 14, 14,
+ 14, 12, 8, 2, 8, 11, 2, 11,
+ 2, 6, 2, 14, 14, 14, 14, 14,
+ 12, 8, 2, 8, 11, 2, 11, 2,
+ 6, 2, 14, 14, 12, 8, 2, 8,
+ 11, 2, 11, 2, 6, 7, 2, 14,
+ 14, 14, 14, 12, 8, 2, 8, 11,
+ 2, 11, 2, 6, 2, 14, 14, 14,
+ 14, 12, 8, 2, 8, 15, 2, 15,
+ 13, 13, 13, 13, 7, 13, 13, 2,
+ 2, 11, 11, 11, 11, 9, 5, 2,
+ 5, 9, 2, 9, 2, 4, 4, 2,
+ 11, 11, 11, 11, 11, 11, 11, 9,
+ 5, 2, 5, 9, 2, 9, 8, 2,
+ 11, 11, 11, 11, 11, 9, 5, 2,
+ 5, 9, 2, 9, 2, 4, 4, 4,
+ 3, 2, 7, 2, 7, 2, 7, 24,
+ 2, 24, 12, 8, 2, 8, 11, 2,
+ 11, 11, 7, 2, 5, 6, 6, 6,
+ 6, 5, 7, 4, 5, 4, 5, 4,
+ 5, 5, 5, 7, 5, 5, 5, 5,
+ 7, 7, 6, 6, 6, 6, 6, 4,
+ 7, 7, 7, 4, 5, 5, 5, 5,
+ 2, 14, 14, 14, 14, 14, 14, 14,
+ 14, 12, 8, 2, 8, 11, 2, 11,
+ 11, 2, 14, 14, 14, 14, 14, 12,
+ 8, 2, 8, 11, 2, 11, 2, 6,
+ 7, 2, 14, 14, 14, 14, 12, 8,
+ 2, 8, 11, 2, 11, 2, 14, 14,
+ 14, 14, 14, 12, 8, 2, 8, 11,
+ 2, 11, 2, 14, 14, 12, 8, 2,
+ 8, 11, 2, 11, 2, 6, 7, 2,
+ 14, 14, 14, 14, 12, 8, 2, 8,
+ 11, 2, 11, 2, 14, 14, 14, 14,
+ 12, 8, 2, 8, 15, 2, 15, 13,
+ 13, 13, 13, 7, 13, 13, 2, 2,
+ 11, 11, 9, 5, 2, 5, 9, 2,
+ 9, 2, 4, 4, 4, 3, 2, 2,
+ 3, 3, 3, 3, 3, 3, 2, 3,
+ 2, 2, 1, 3, 3, 3, 3, 21,
+ 3, 3, 3, 3, 21, 3, 3, 3,
+ 3, 21, 3, 3, 3, 3, 21, 3,
+ 3, 3, 2, 21, 3, 3, 3, 3,
+ 21, 3, 3, 21, 4, 21, 21, 3,
+ 3, 3, 3, 3, 21, 3, 3, 21,
+ 3, 3, 3, 2, 4, 4, 4, 4,
+ 4, 4, 22, 4, 4, 22, 4, 4,
+ 4, 22, 4, 4, 4, 21, 21, 3,
+ 3, 3, 3, 3, 21, 3, 3, 21,
+ 3, 3, 3, 21, 3, 3, 3, 21,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 21, 21, 3, 3, 21, 3, 3, 3,
+ 21, 3, 3, 3, 21, 3, 3, 3,
+ 21, 3, 3, 3, 4, 4, 4, 4,
+ 4, 22, 4, 4, 22, 4, 4, 4,
+ 22, 4, 4, 4, 22, 4, 4, 4,
+ 21, 22, 4, 4, 22, 4, 4, 4,
+ 21, 21, 3, 3, 3, 3, 3, 21,
+ 3, 3, 21, 3, 3, 3, 21, 3,
+ 3, 3, 21, 3, 3, 3, 21, 3,
+ 3, 3, 21, 3, 3, 3, 21, 3,
+ 3, 21, 22, 4, 4, 22, 4, 4,
+ 4, 22, 4, 4, 4, 22, 4, 4,
+ 4, 22, 22, 4, 4, 4, 22, 4,
+ 4, 22, 22, 4, 4, 22, 22, 4,
+ 4, 22, 4, 4, 4, 22, 4, 4,
+ 4, 22, 4, 4, 4, 22, 4, 4,
+ 22, 4, 4, 4, 22, 4, 4, 22,
+ 21, 3, 3, 3, 21, 3, 3, 21,
+ 21, 3, 3, 3, 21, 3, 3, 3,
+ 21, 3, 3, 21, 22, 4, 4, 22,
+ 4, 4, 22, 22, 4, 4, 22, 4,
+ 4, 22, 4, 4, 4, 22, 4, 4,
+ 4, 22, 4, 4, 4, 22, 4, 4,
+ 4, 22, 4, 4, 22, 21, 3, 3,
+ 3, 21, 3, 3, 3, 21, 3, 3,
+ 3, 21, 3, 3, 3, 21, 3, 3,
+ 21, 21, 3, 3, 3, 21, 3, 3,
+ 21, 3, 3, 3, 4, 21, 21, 3,
+ 3, 3, 3, 21, 3, 3, 21, 3,
+ 3, 3, 21, 3, 3, 21, 3, 3,
+ 21, 3, 3, 3, 21, 3, 3, 21,
+ 3, 3, 21, 21, 3, 3, 3, 4,
+ 21
+ };
-static const short _thttp_machine_parser_header_WWW_Authenticate_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 1, 8, 8, 1, 9, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 19,
- 19, 20, 1, 22, 23, 22, 24, 25,
- 24, 25, 21, 26, 21, 27, 26, 21,
- 22, 28, 22, 24, 25, 24, 25, 21,
- 29, 26, 21, 30, 26, 30, 24, 25,
- 24, 25, 21, 26, 31, 31, 21, 26,
- 32, 32, 21, 26, 33, 33, 21, 26,
- 34, 34, 21, 35, 36, 35, 21, 37,
- 38, 37, 39, 39, 39, 40, 41, 42,
- 43, 44, 45, 46, 40, 41, 42, 43,
- 44, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 47, 26, 21, 48, 26, 48,
- 39, 39, 39, 40, 41, 42, 43, 44,
- 45, 46, 40, 41, 42, 43, 44, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 49, 50, 49, 51, 51, 51, 52, 53,
- 51, 51, 51, 51, 51, 21, 54, 55,
- 54, 56, 53, 21, 57, 26, 21, 58,
- 26, 58, 56, 53, 21, 56, 59, 56,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 62, 26, 21, 63, 26, 63, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 64, 64,
- 51, 51, 51, 51, 51, 21, 65, 26,
- 21, 49, 50, 49, 51, 51, 51, 52,
- 53, 66, 66, 51, 51, 51, 51, 51,
- 21, 53, 67, 53, 68, 69, 68, 68,
- 70, 68, 68, 68, 68, 68, 68, 21,
- 71, 26, 21, 72, 73, 72, 68, 69,
- 68, 68, 70, 68, 68, 68, 68, 68,
- 68, 21, 74, 26, 21, 75, 26, 75,
- 69, 21, 76, 77, 78, 21, 21, 21,
- 69, 79, 26, 21, 80, 81, 80, 52,
- 21, 82, 83, 82, 56, 21, 84, 26,
- 21, 85, 26, 85, 56, 21, 86, 26,
- 21, 49, 50, 49, 51, 51, 51, 52,
- 53, 87, 87, 51, 51, 51, 51, 51,
- 21, 49, 50, 49, 51, 51, 51, 52,
- 53, 88, 88, 51, 51, 51, 51, 51,
- 21, 49, 50, 49, 51, 51, 51, 52,
- 53, 89, 89, 51, 51, 51, 51, 51,
- 21, 49, 50, 49, 51, 51, 51, 52,
- 53, 90, 90, 51, 51, 51, 51, 51,
- 21, 91, 92, 91, 51, 51, 51, 52,
- 93, 51, 51, 51, 51, 51, 21, 94,
- 95, 94, 56, 93, 21, 96, 26, 21,
- 97, 26, 97, 56, 93, 21, 98, 99,
- 98, 68, 100, 68, 68, 70, 68, 68,
- 68, 68, 68, 68, 21, 101, 26, 21,
- 102, 103, 102, 68, 100, 68, 68, 70,
- 68, 68, 68, 68, 68, 68, 21, 104,
- 26, 21, 105, 26, 105, 106, 21, 107,
- 108, 109, 21, 21, 21, 106, 110, 26,
- 21, 111, 112, 111, 113, 21, 26, 106,
- 106, 21, 80, 81, 80, 68, 68, 68,
- 52, 68, 68, 68, 68, 68, 21, 26,
- 115, 114, 114, 114, 21, 26, 117, 77,
- 116, 116, 116, 21, 26, 117, 77, 118,
- 118, 118, 21, 26, 117, 77, 119, 119,
- 119, 21, 26, 117, 77, 21, 26, 121,
- 120, 114, 114, 21, 26, 122, 117, 77,
- 123, 116, 116, 21, 26, 124, 21, 26,
- 125, 126, 21, 26, 127, 21, 26, 128,
- 129, 21, 26, 130, 21, 26, 77, 131,
- 21, 26, 77, 132, 21, 26, 77, 21,
- 26, 128, 133, 21, 26, 128, 21, 26,
- 125, 134, 21, 26, 125, 21, 26, 122,
- 117, 77, 135, 118, 118, 21, 26, 122,
- 117, 77, 119, 119, 119, 21, 26, 137,
- 77, 136, 136, 136, 21, 26, 139, 77,
- 138, 138, 138, 21, 26, 139, 77, 140,
- 140, 140, 21, 26, 139, 77, 141, 141,
- 141, 21, 26, 139, 77, 21, 26, 142,
- 136, 136, 21, 26, 122, 139, 77, 143,
- 138, 138, 21, 26, 122, 139, 77, 144,
- 140, 140, 21, 26, 122, 139, 77, 141,
- 141, 141, 21, 26, 145, 21, 26, 122,
- 146, 21, 26, 122, 147, 21, 26, 122,
- 21, 26, 121, 21, 148, 26, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 149,
- 149, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 150,
- 150, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 151,
- 151, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 152,
- 152, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 153,
- 153, 51, 51, 51, 51, 51, 21, 154,
- 155, 154, 51, 51, 51, 52, 156, 51,
- 51, 51, 51, 51, 21, 157, 158, 157,
- 56, 156, 21, 159, 26, 21, 160, 26,
- 160, 56, 156, 21, 161, 162, 161, 68,
- 163, 68, 68, 70, 68, 68, 68, 68,
- 68, 68, 21, 164, 26, 21, 165, 166,
- 165, 68, 163, 68, 68, 70, 68, 68,
- 68, 68, 68, 68, 21, 167, 26, 21,
- 168, 26, 168, 169, 21, 170, 171, 172,
- 21, 21, 21, 169, 173, 26, 21, 174,
- 175, 174, 176, 21, 26, 169, 169, 21,
- 177, 26, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 178, 178, 51, 51, 51,
- 51, 51, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 179, 179, 51, 51, 51,
- 51, 51, 21, 180, 181, 180, 51, 51,
- 51, 52, 182, 51, 51, 51, 51, 51,
- 21, 183, 184, 183, 56, 182, 21, 185,
- 26, 21, 186, 26, 186, 56, 182, 21,
- 182, 187, 182, 68, 188, 68, 68, 70,
- 68, 68, 68, 68, 68, 68, 21, 189,
- 26, 21, 190, 191, 190, 68, 188, 68,
- 68, 70, 68, 68, 68, 68, 68, 68,
- 21, 192, 26, 21, 193, 26, 193, 188,
- 21, 196, 197, 198, 195, 195, 195, 194,
- 201, 202, 203, 200, 200, 200, 199, 204,
- 202, 200, 205, 204, 202, 200, 206, 207,
- 206, 56, 21, 208, 26, 21, 209, 210,
- 209, 56, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 211, 211, 51, 51, 51,
- 51, 51, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 212, 212, 51, 51, 51,
- 51, 51, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 213, 213, 51, 51, 51,
- 51, 51, 21, 49, 50, 49, 51, 51,
- 51, 52, 53, 214, 214, 51, 51, 51,
- 51, 51, 21, 215, 216, 215, 51, 51,
- 51, 52, 217, 51, 51, 51, 51, 51,
- 21, 218, 219, 218, 56, 217, 21, 220,
- 26, 21, 221, 26, 221, 56, 217, 21,
- 222, 223, 222, 68, 224, 68, 68, 70,
- 68, 68, 68, 68, 68, 68, 21, 225,
- 26, 21, 226, 227, 226, 68, 224, 68,
- 68, 70, 68, 68, 68, 68, 68, 68,
- 21, 228, 26, 21, 229, 26, 229, 230,
- 21, 231, 232, 233, 21, 21, 21, 230,
- 234, 26, 21, 235, 236, 235, 237, 21,
- 26, 230, 230, 21, 238, 26, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 239,
- 239, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 240,
- 240, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 241,
- 241, 51, 51, 51, 51, 51, 21, 49,
- 50, 49, 51, 51, 51, 52, 53, 242,
- 242, 51, 51, 51, 51, 51, 21, 243,
- 244, 243, 51, 51, 51, 52, 245, 51,
- 51, 51, 51, 51, 21, 246, 247, 246,
- 56, 245, 21, 248, 26, 21, 249, 26,
- 249, 56, 245, 21, 245, 250, 245, 68,
- 69, 68, 68, 251, 252, 70, 251, 252,
- 68, 68, 68, 68, 68, 68, 21, 253,
- 26, 21, 254, 73, 254, 68, 69, 68,
- 68, 251, 252, 70, 251, 252, 68, 68,
- 68, 68, 68, 68, 21, 80, 81, 80,
- 68, 68, 68, 52, 255, 255, 68, 68,
- 68, 68, 68, 21, 80, 81, 80, 68,
- 68, 68, 52, 256, 256, 68, 68, 68,
- 68, 68, 21, 80, 81, 80, 68, 68,
- 68, 52, 257, 257, 68, 68, 68, 68,
- 68, 21, 80, 81, 80, 68, 68, 68,
- 52, 258, 258, 68, 68, 68, 68, 68,
- 21, 259, 260, 259, 261, 21, 80, 81,
- 80, 68, 68, 68, 52, 262, 262, 68,
- 68, 68, 68, 68, 21, 80, 81, 80,
- 68, 68, 68, 52, 257, 257, 68, 68,
- 68, 68, 68, 21, 263, 26, 21, 264,
- 204, 202, 200, 204, 265, 199, 199, 200,
- 266, 267, 266, 77, 268, 78, 21, 21,
- 69, 269, 26, 21, 270, 271, 270, 77,
- 268, 78, 21, 21, 69, 272, 26, 21,
- 273, 76, 273, 77, 268, 78, 21, 21,
- 69, 268, 274, 268, 275, 77, 275, 275,
- 276, 277, 278, 279, 280, 281, 282, 78,
- 276, 277, 278, 279, 280, 281, 282, 275,
- 21, 21, 275, 275, 275, 275, 275, 69,
- 283, 26, 21, 284, 76, 284, 275, 77,
- 275, 275, 276, 277, 278, 279, 280, 281,
- 282, 78, 276, 277, 278, 279, 280, 281,
- 282, 275, 21, 21, 275, 275, 275, 275,
- 275, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 78, 287, 21, 21, 287,
- 287, 287, 287, 69, 290, 291, 290, 77,
- 268, 289, 78, 21, 21, 69, 292, 26,
- 21, 293, 76, 293, 77, 268, 289, 78,
- 21, 21, 69, 289, 294, 289, 295, 296,
- 295, 295, 297, 78, 295, 21, 21, 295,
- 295, 295, 295, 295, 69, 298, 26, 21,
- 299, 300, 299, 295, 296, 295, 295, 297,
- 78, 295, 21, 21, 295, 295, 295, 295,
- 295, 69, 301, 26, 21, 302, 76, 302,
- 296, 78, 21, 21, 69, 303, 304, 303,
- 77, 288, 78, 21, 21, 69, 305, 306,
- 305, 77, 268, 78, 21, 21, 69, 307,
- 26, 21, 26, 69, 69, 21, 303, 304,
- 303, 295, 77, 295, 295, 288, 78, 295,
- 21, 21, 295, 295, 295, 295, 69, 76,
- 77, 309, 78, 21, 21, 21, 308, 308,
- 308, 69, 76, 77, 311, 78, 296, 21,
- 21, 21, 310, 310, 310, 69, 76, 77,
- 311, 78, 296, 21, 21, 21, 312, 312,
- 312, 69, 76, 77, 311, 78, 296, 21,
- 21, 21, 313, 313, 313, 69, 76, 77,
- 311, 78, 296, 21, 21, 21, 69, 76,
- 77, 315, 78, 21, 21, 21, 314, 308,
- 308, 69, 76, 77, 316, 311, 78, 296,
- 21, 21, 21, 317, 310, 310, 69, 76,
- 77, 78, 21, 21, 21, 318, 69, 76,
- 77, 319, 78, 21, 21, 21, 320, 69,
- 76, 77, 78, 21, 21, 21, 321, 69,
- 76, 77, 322, 78, 21, 21, 21, 323,
- 69, 76, 77, 78, 21, 21, 21, 324,
- 69, 76, 77, 78, 296, 21, 21, 21,
- 325, 69, 76, 77, 78, 296, 21, 21,
- 21, 326, 69, 76, 77, 78, 296, 21,
- 21, 21, 69, 76, 77, 322, 78, 21,
- 21, 21, 327, 69, 76, 77, 322, 78,
- 21, 21, 21, 69, 76, 77, 319, 78,
- 21, 21, 21, 328, 69, 76, 77, 319,
- 78, 21, 21, 21, 69, 76, 77, 316,
- 311, 78, 296, 21, 21, 21, 329, 312,
- 312, 69, 76, 77, 316, 311, 78, 296,
- 21, 21, 21, 313, 313, 313, 69, 76,
- 77, 331, 78, 296, 21, 21, 21, 330,
- 330, 330, 69, 76, 77, 333, 78, 296,
- 21, 21, 21, 332, 332, 332, 69, 76,
- 77, 333, 78, 296, 21, 21, 21, 334,
- 334, 334, 69, 76, 77, 333, 78, 296,
- 21, 21, 21, 335, 335, 335, 69, 76,
- 77, 333, 78, 296, 21, 21, 21, 69,
- 76, 77, 78, 21, 21, 21, 336, 330,
- 330, 69, 76, 77, 316, 333, 78, 296,
- 21, 21, 21, 337, 332, 332, 69, 76,
- 77, 316, 333, 78, 296, 21, 21, 21,
- 338, 334, 334, 69, 76, 77, 316, 333,
- 78, 296, 21, 21, 21, 335, 335, 335,
- 69, 76, 77, 78, 21, 21, 21, 339,
- 69, 76, 77, 316, 78, 21, 21, 21,
- 340, 69, 76, 77, 316, 78, 21, 21,
- 21, 341, 69, 76, 77, 316, 78, 21,
- 21, 21, 69, 76, 77, 315, 78, 21,
- 21, 21, 69, 342, 26, 21, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 343,
- 78, 343, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 344, 78, 344, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 345,
- 78, 345, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 346, 78, 346, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 347,
- 78, 347, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 348, 78, 348, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 349,
- 78, 349, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 350, 78, 350, 287, 21,
- 21, 287, 287, 287, 287, 69, 351, 352,
- 351, 287, 77, 287, 287, 288, 353, 78,
- 287, 21, 21, 287, 287, 287, 287, 69,
- 354, 355, 354, 77, 268, 353, 78, 21,
- 21, 69, 356, 26, 21, 357, 76, 357,
- 77, 268, 353, 78, 21, 21, 69, 353,
- 358, 353, 359, 296, 359, 359, 297, 78,
- 359, 21, 21, 359, 359, 359, 359, 359,
- 69, 360, 26, 21, 361, 300, 361, 359,
- 296, 359, 359, 297, 78, 359, 21, 21,
- 359, 359, 359, 359, 359, 69, 362, 363,
- 362, 364, 77, 364, 364, 365, 78, 364,
- 21, 21, 364, 364, 364, 364, 69, 366,
- 26, 21, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 367, 78, 367, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 368,
- 78, 368, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 369, 78, 369, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 370,
- 78, 370, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 371, 78, 371, 287, 21,
- 21, 287, 287, 287, 287, 69, 372, 373,
- 372, 287, 77, 287, 287, 288, 374, 78,
- 287, 21, 21, 287, 287, 287, 287, 69,
- 375, 376, 375, 77, 268, 374, 78, 21,
- 21, 69, 377, 26, 21, 378, 76, 378,
- 77, 268, 374, 78, 21, 21, 69, 374,
- 379, 374, 295, 380, 295, 295, 297, 78,
- 295, 21, 21, 295, 295, 295, 295, 295,
- 69, 381, 26, 21, 382, 383, 382, 295,
- 380, 295, 295, 297, 78, 295, 21, 21,
- 295, 295, 295, 295, 295, 69, 384, 26,
- 21, 385, 76, 385, 380, 78, 21, 21,
- 69, 388, 389, 388, 390, 391, 392, 387,
- 387, 386, 395, 396, 397, 394, 394, 394,
- 393, 398, 396, 394, 399, 398, 396, 394,
- 400, 398, 396, 394, 398, 401, 393, 393,
- 394, 402, 403, 402, 396, 404, 397, 394,
- 394, 393, 405, 398, 396, 394, 406, 395,
- 406, 396, 404, 397, 394, 394, 393, 404,
- 407, 404, 408, 396, 408, 408, 409, 410,
- 411, 412, 413, 414, 415, 397, 409, 410,
- 411, 412, 413, 414, 415, 408, 394, 394,
- 408, 408, 408, 408, 408, 393, 416, 398,
- 396, 394, 417, 395, 417, 408, 396, 408,
- 408, 409, 410, 411, 412, 413, 414, 415,
- 397, 409, 410, 411, 412, 413, 414, 415,
- 408, 394, 394, 408, 408, 408, 408, 408,
- 393, 418, 419, 418, 420, 396, 420, 420,
- 421, 422, 397, 420, 394, 394, 420, 420,
- 420, 420, 393, 423, 424, 423, 396, 404,
- 422, 397, 394, 394, 393, 425, 398, 396,
- 394, 426, 395, 426, 396, 404, 422, 397,
- 394, 394, 393, 422, 427, 422, 428, 401,
- 428, 428, 429, 397, 428, 394, 394, 428,
- 428, 428, 428, 428, 393, 430, 398, 396,
- 394, 431, 432, 431, 428, 401, 428, 428,
- 429, 397, 428, 394, 394, 428, 428, 428,
- 428, 428, 393, 433, 398, 396, 394, 434,
- 395, 434, 401, 397, 394, 394, 393, 435,
- 436, 435, 428, 396, 428, 428, 421, 397,
- 428, 394, 394, 428, 428, 428, 428, 393,
- 437, 398, 396, 394, 438, 439, 438, 440,
- 396, 440, 440, 441, 442, 440, 440, 440,
- 440, 440, 394, 443, 444, 443, 396, 445,
- 442, 394, 446, 398, 396, 394, 447, 398,
- 447, 396, 445, 442, 394, 445, 448, 445,
- 449, 396, 449, 449, 450, 451, 452, 453,
- 454, 455, 456, 450, 451, 452, 453, 454,
- 455, 456, 449, 449, 449, 449, 449, 449,
- 394, 457, 398, 396, 394, 458, 398, 458,
- 449, 396, 449, 449, 450, 451, 452, 453,
- 454, 455, 456, 450, 451, 452, 453, 454,
- 455, 456, 449, 449, 449, 449, 449, 449,
- 394, 438, 439, 438, 440, 396, 440, 440,
- 441, 442, 459, 459, 440, 440, 440, 440,
- 440, 394, 460, 398, 396, 394, 438, 439,
- 438, 440, 396, 440, 440, 441, 442, 461,
- 461, 440, 440, 440, 440, 440, 394, 442,
- 462, 442, 463, 401, 463, 463, 464, 463,
- 463, 463, 463, 463, 463, 394, 465, 398,
- 396, 394, 466, 467, 466, 463, 401, 463,
- 463, 464, 463, 463, 463, 463, 463, 463,
- 394, 468, 398, 396, 394, 469, 398, 469,
- 401, 394, 470, 471, 470, 463, 396, 463,
- 463, 441, 463, 463, 463, 463, 463, 394,
- 472, 473, 472, 396, 445, 394, 474, 398,
- 396, 394, 475, 398, 475, 396, 445, 394,
- 476, 398, 396, 394, 438, 439, 438, 440,
- 396, 440, 440, 441, 442, 477, 477, 440,
- 440, 440, 440, 440, 394, 438, 439, 438,
- 440, 396, 440, 440, 441, 442, 478, 478,
- 440, 440, 440, 440, 440, 394, 438, 439,
- 438, 440, 396, 440, 440, 441, 442, 479,
- 479, 440, 440, 440, 440, 440, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 480, 480, 440, 440, 440, 440, 440, 394,
- 481, 482, 481, 440, 396, 440, 440, 441,
- 483, 440, 440, 440, 440, 440, 394, 484,
- 485, 484, 396, 445, 483, 394, 486, 398,
- 396, 394, 487, 398, 487, 396, 445, 483,
- 394, 488, 489, 488, 463, 490, 463, 463,
- 464, 463, 463, 463, 463, 463, 463, 394,
- 491, 398, 396, 394, 492, 493, 492, 463,
- 490, 463, 463, 464, 463, 463, 463, 463,
- 463, 463, 394, 494, 398, 396, 394, 495,
- 398, 495, 496, 394, 497, 498, 497, 108,
- 499, 109, 21, 21, 106, 500, 26, 21,
- 501, 502, 501, 108, 499, 109, 21, 21,
- 106, 503, 26, 21, 504, 107, 504, 108,
- 499, 109, 21, 21, 106, 499, 505, 499,
- 506, 108, 506, 506, 507, 508, 509, 510,
- 511, 512, 513, 109, 507, 508, 509, 510,
- 511, 512, 513, 506, 21, 21, 506, 506,
- 506, 506, 506, 106, 514, 26, 21, 515,
- 107, 515, 506, 108, 506, 506, 507, 508,
- 509, 510, 511, 512, 513, 109, 507, 508,
- 509, 510, 511, 512, 513, 506, 21, 21,
- 506, 506, 506, 506, 506, 106, 516, 517,
- 516, 518, 108, 518, 518, 519, 520, 109,
- 518, 21, 21, 518, 518, 518, 518, 106,
- 521, 522, 521, 108, 499, 520, 109, 21,
- 21, 106, 523, 26, 21, 524, 107, 524,
- 108, 499, 520, 109, 21, 21, 106, 520,
- 525, 520, 526, 527, 526, 526, 528, 109,
- 526, 21, 21, 526, 526, 526, 526, 526,
- 106, 529, 26, 21, 530, 531, 530, 526,
- 527, 526, 526, 528, 109, 526, 21, 21,
- 526, 526, 526, 526, 526, 106, 532, 26,
- 21, 533, 107, 533, 527, 109, 21, 21,
- 106, 534, 535, 534, 77, 536, 78, 21,
- 21, 69, 537, 538, 537, 526, 108, 526,
- 526, 519, 109, 526, 21, 21, 526, 526,
- 526, 526, 106, 539, 540, 539, 108, 499,
- 109, 21, 21, 106, 541, 26, 21, 107,
- 108, 543, 109, 21, 21, 21, 542, 542,
- 542, 106, 107, 108, 545, 109, 546, 21,
- 21, 21, 544, 544, 544, 106, 107, 108,
- 545, 109, 546, 21, 21, 21, 547, 547,
- 547, 106, 107, 108, 545, 109, 546, 21,
- 21, 21, 548, 548, 548, 106, 107, 108,
- 545, 109, 546, 21, 21, 21, 106, 107,
- 108, 550, 109, 21, 21, 21, 549, 542,
- 542, 106, 107, 108, 551, 545, 109, 546,
- 21, 21, 21, 552, 544, 544, 106, 107,
- 108, 109, 21, 21, 21, 553, 106, 107,
- 108, 554, 109, 21, 21, 21, 555, 106,
- 107, 108, 109, 21, 21, 21, 556, 106,
- 107, 108, 557, 109, 21, 21, 21, 558,
- 106, 107, 108, 109, 21, 21, 21, 559,
- 106, 107, 108, 109, 546, 21, 21, 21,
- 560, 106, 107, 108, 109, 546, 21, 21,
- 21, 561, 106, 107, 108, 109, 546, 21,
- 21, 21, 106, 537, 538, 537, 108, 519,
- 109, 21, 21, 106, 107, 108, 557, 109,
- 21, 21, 21, 562, 106, 107, 108, 557,
- 109, 21, 21, 21, 106, 107, 108, 554,
- 109, 21, 21, 21, 563, 106, 107, 108,
- 554, 109, 21, 21, 21, 106, 107, 108,
- 551, 545, 109, 546, 21, 21, 21, 564,
- 547, 547, 106, 107, 108, 551, 545, 109,
- 546, 21, 21, 21, 548, 548, 548, 106,
- 107, 108, 566, 109, 546, 21, 21, 21,
- 565, 565, 565, 106, 107, 108, 568, 109,
- 546, 21, 21, 21, 567, 567, 567, 106,
- 107, 108, 568, 109, 546, 21, 21, 21,
- 569, 569, 569, 106, 107, 108, 568, 109,
- 546, 21, 21, 21, 570, 570, 570, 106,
- 107, 108, 568, 109, 546, 21, 21, 21,
- 106, 107, 108, 109, 21, 21, 21, 571,
- 565, 565, 106, 107, 108, 551, 568, 109,
- 546, 21, 21, 21, 572, 567, 567, 106,
- 107, 108, 551, 568, 109, 546, 21, 21,
- 21, 573, 569, 569, 106, 107, 108, 551,
- 568, 109, 546, 21, 21, 21, 570, 570,
- 570, 106, 107, 108, 109, 21, 21, 21,
- 574, 106, 107, 108, 551, 109, 21, 21,
- 21, 575, 106, 107, 108, 551, 109, 21,
- 21, 21, 576, 106, 107, 108, 551, 109,
- 21, 21, 21, 106, 107, 108, 550, 109,
- 21, 21, 21, 106, 577, 26, 21, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 578, 109, 578, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 579, 109, 579, 518,
- 21, 21, 518, 518, 518, 518, 106, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 580, 109, 580, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 581, 109, 581, 518,
- 21, 21, 518, 518, 518, 518, 106, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 582, 109, 582, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 583, 109, 583, 518,
- 21, 21, 518, 518, 518, 518, 106, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 584, 109, 584, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 585, 109, 585, 518,
- 21, 21, 518, 518, 518, 518, 106, 586,
- 587, 586, 518, 108, 518, 518, 519, 588,
- 109, 518, 21, 21, 518, 518, 518, 518,
- 106, 589, 590, 589, 108, 499, 588, 109,
- 21, 21, 106, 591, 26, 21, 592, 107,
- 592, 108, 499, 588, 109, 21, 21, 106,
- 588, 593, 588, 594, 527, 594, 594, 528,
- 109, 594, 21, 21, 594, 594, 594, 594,
- 594, 106, 595, 26, 21, 596, 531, 596,
- 594, 527, 594, 594, 528, 109, 594, 21,
- 21, 594, 594, 594, 594, 594, 106, 597,
- 598, 597, 599, 108, 599, 599, 600, 109,
- 599, 21, 21, 599, 599, 599, 599, 106,
- 601, 26, 21, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 602, 109, 602, 518,
- 21, 21, 518, 518, 518, 518, 106, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 603, 109, 603, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 604, 109, 604, 518,
- 21, 21, 518, 518, 518, 518, 106, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 605, 109, 605, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 606, 109, 606, 518,
- 21, 21, 518, 518, 518, 518, 106, 607,
- 608, 607, 518, 108, 518, 518, 519, 609,
- 109, 518, 21, 21, 518, 518, 518, 518,
- 106, 610, 611, 610, 108, 499, 609, 109,
- 21, 21, 106, 612, 26, 21, 613, 107,
- 613, 108, 499, 609, 109, 21, 21, 106,
- 609, 614, 609, 526, 615, 526, 526, 528,
- 109, 526, 21, 21, 526, 526, 526, 526,
- 526, 106, 616, 26, 21, 617, 618, 617,
- 526, 615, 526, 526, 528, 109, 526, 21,
- 21, 526, 526, 526, 526, 526, 106, 619,
- 26, 21, 620, 107, 620, 615, 109, 21,
- 21, 106, 621, 622, 621, 390, 623, 392,
- 387, 387, 386, 624, 26, 21, 516, 517,
- 516, 518, 108, 518, 518, 519, 520, 625,
- 109, 625, 518, 21, 21, 518, 518, 518,
- 518, 106, 516, 517, 516, 518, 108, 518,
- 518, 519, 520, 626, 109, 626, 518, 21,
- 21, 518, 518, 518, 518, 106, 516, 517,
- 516, 518, 108, 518, 518, 519, 520, 627,
- 109, 627, 518, 21, 21, 518, 518, 518,
- 518, 106, 516, 517, 516, 518, 108, 518,
- 518, 519, 520, 628, 109, 628, 518, 21,
- 21, 518, 518, 518, 518, 106, 629, 630,
- 629, 518, 108, 518, 518, 519, 631, 109,
- 518, 21, 21, 518, 518, 518, 518, 106,
- 632, 633, 632, 108, 499, 631, 109, 21,
- 21, 106, 634, 26, 21, 635, 107, 635,
- 108, 499, 631, 109, 21, 21, 106, 636,
- 637, 636, 526, 638, 526, 526, 528, 109,
- 526, 21, 21, 526, 526, 526, 526, 526,
- 106, 639, 26, 21, 640, 641, 640, 526,
- 638, 526, 526, 528, 109, 526, 21, 21,
- 526, 526, 526, 526, 526, 106, 642, 26,
- 21, 643, 107, 643, 644, 109, 21, 21,
- 106, 645, 646, 645, 108, 647, 109, 21,
- 21, 106, 648, 26, 21, 516, 517, 516,
- 518, 108, 518, 518, 519, 520, 649, 109,
- 649, 518, 21, 21, 518, 518, 518, 518,
- 106, 516, 517, 516, 518, 108, 518, 518,
- 519, 520, 650, 109, 650, 518, 21, 21,
- 518, 518, 518, 518, 106, 516, 517, 516,
- 518, 108, 518, 518, 519, 520, 651, 109,
- 651, 518, 21, 21, 518, 518, 518, 518,
- 106, 516, 517, 516, 518, 108, 518, 518,
- 519, 520, 652, 109, 652, 518, 21, 21,
- 518, 518, 518, 518, 106, 516, 517, 516,
- 518, 108, 518, 518, 519, 520, 653, 109,
- 653, 518, 21, 21, 518, 518, 518, 518,
- 106, 654, 655, 654, 518, 108, 518, 518,
- 519, 656, 109, 518, 21, 21, 518, 518,
- 518, 518, 106, 657, 658, 657, 108, 499,
- 656, 109, 21, 21, 106, 659, 26, 21,
- 660, 107, 660, 108, 499, 656, 109, 21,
- 21, 106, 661, 662, 661, 526, 663, 526,
- 526, 528, 109, 526, 21, 21, 526, 526,
- 526, 526, 526, 106, 664, 26, 21, 665,
- 666, 665, 526, 663, 526, 526, 528, 109,
- 526, 21, 21, 526, 526, 526, 526, 526,
- 106, 667, 26, 21, 668, 107, 668, 669,
- 109, 21, 21, 106, 670, 671, 670, 171,
- 672, 172, 21, 21, 169, 673, 674, 673,
- 171, 675, 172, 21, 21, 169, 676, 26,
- 21, 677, 170, 677, 171, 675, 172, 21,
- 21, 169, 675, 678, 675, 679, 171, 679,
- 679, 680, 681, 682, 683, 684, 685, 686,
- 172, 680, 681, 682, 683, 684, 685, 686,
- 679, 21, 21, 679, 679, 679, 679, 679,
- 169, 687, 26, 21, 688, 170, 688, 679,
- 171, 679, 679, 680, 681, 682, 683, 684,
- 685, 686, 172, 680, 681, 682, 683, 684,
- 685, 686, 679, 21, 21, 679, 679, 679,
- 679, 679, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 172, 691, 21, 21,
- 691, 691, 691, 691, 169, 694, 695, 694,
- 171, 675, 693, 172, 21, 21, 169, 696,
- 26, 21, 697, 170, 697, 171, 675, 693,
- 172, 21, 21, 169, 693, 698, 693, 699,
- 700, 699, 699, 701, 172, 699, 21, 21,
- 699, 699, 699, 699, 699, 169, 702, 26,
- 21, 703, 704, 703, 699, 700, 699, 699,
- 701, 172, 699, 21, 21, 699, 699, 699,
- 699, 699, 169, 705, 26, 21, 706, 170,
- 706, 700, 172, 21, 21, 169, 707, 708,
- 707, 77, 709, 78, 21, 21, 69, 710,
- 711, 710, 699, 171, 699, 699, 692, 172,
- 699, 21, 21, 699, 699, 699, 699, 169,
- 712, 26, 21, 170, 171, 714, 172, 21,
- 21, 21, 713, 713, 713, 169, 170, 171,
- 716, 172, 717, 21, 21, 21, 715, 715,
- 715, 169, 170, 171, 716, 172, 717, 21,
- 21, 21, 718, 718, 718, 169, 170, 171,
- 716, 172, 717, 21, 21, 21, 719, 719,
- 719, 169, 170, 171, 716, 172, 717, 21,
- 21, 21, 169, 170, 171, 721, 172, 21,
- 21, 21, 720, 713, 713, 169, 170, 171,
- 722, 716, 172, 717, 21, 21, 21, 723,
- 715, 715, 169, 170, 171, 172, 21, 21,
- 21, 724, 169, 170, 171, 725, 172, 21,
- 21, 21, 726, 169, 170, 171, 172, 21,
- 21, 21, 727, 169, 170, 171, 728, 172,
- 21, 21, 21, 729, 169, 170, 171, 172,
- 21, 21, 21, 730, 169, 170, 171, 172,
- 717, 21, 21, 21, 731, 169, 170, 171,
- 172, 717, 21, 21, 21, 732, 169, 170,
- 171, 172, 717, 21, 21, 21, 169, 710,
- 711, 710, 171, 692, 172, 21, 21, 169,
- 170, 171, 728, 172, 21, 21, 21, 733,
- 169, 170, 171, 728, 172, 21, 21, 21,
- 169, 170, 171, 725, 172, 21, 21, 21,
- 734, 169, 170, 171, 725, 172, 21, 21,
- 21, 169, 170, 171, 722, 716, 172, 717,
- 21, 21, 21, 735, 718, 718, 169, 170,
- 171, 722, 716, 172, 717, 21, 21, 21,
- 719, 719, 719, 169, 170, 171, 737, 172,
- 717, 21, 21, 21, 736, 736, 736, 169,
- 170, 171, 739, 172, 717, 21, 21, 21,
- 738, 738, 738, 169, 170, 171, 739, 172,
- 717, 21, 21, 21, 740, 740, 740, 169,
- 170, 171, 739, 172, 717, 21, 21, 21,
- 741, 741, 741, 169, 170, 171, 739, 172,
- 717, 21, 21, 21, 169, 170, 171, 172,
- 21, 21, 21, 742, 736, 736, 169, 170,
- 171, 722, 739, 172, 717, 21, 21, 21,
- 743, 738, 738, 169, 170, 171, 722, 739,
- 172, 717, 21, 21, 21, 744, 740, 740,
- 169, 170, 171, 722, 739, 172, 717, 21,
- 21, 21, 741, 741, 741, 169, 170, 171,
- 172, 21, 21, 21, 745, 169, 170, 171,
- 722, 172, 21, 21, 21, 746, 169, 170,
- 171, 722, 172, 21, 21, 21, 747, 169,
- 170, 171, 722, 172, 21, 21, 21, 169,
- 170, 171, 721, 172, 21, 21, 21, 169,
- 748, 26, 21, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 749, 172, 749, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 750, 172, 750, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 751, 172, 751, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 752, 172, 752, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 753, 172, 753, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 754, 172, 754, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 755, 172, 755, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 756, 172, 756, 691, 21, 21, 691, 691,
- 691, 691, 169, 757, 758, 757, 691, 171,
- 691, 691, 692, 759, 172, 691, 21, 21,
- 691, 691, 691, 691, 169, 760, 761, 760,
- 171, 675, 759, 172, 21, 21, 169, 762,
- 26, 21, 763, 170, 763, 171, 675, 759,
- 172, 21, 21, 169, 759, 764, 759, 765,
- 700, 765, 765, 701, 172, 765, 21, 21,
- 765, 765, 765, 765, 765, 169, 766, 26,
- 21, 767, 704, 767, 765, 700, 765, 765,
- 701, 172, 765, 21, 21, 765, 765, 765,
- 765, 765, 169, 768, 769, 768, 770, 171,
- 770, 770, 771, 172, 770, 21, 21, 770,
- 770, 770, 770, 169, 772, 26, 21, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 773, 172, 773, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 774, 172, 774, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 775, 172, 775, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 776, 172, 776, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 777, 172, 777, 691, 21, 21, 691, 691,
- 691, 691, 169, 778, 779, 778, 691, 171,
- 691, 691, 692, 780, 172, 691, 21, 21,
- 691, 691, 691, 691, 169, 781, 782, 781,
- 171, 675, 780, 172, 21, 21, 169, 783,
- 26, 21, 784, 170, 784, 171, 675, 780,
- 172, 21, 21, 169, 780, 785, 780, 699,
- 786, 699, 699, 701, 172, 699, 21, 21,
- 699, 699, 699, 699, 699, 169, 787, 26,
- 21, 788, 789, 788, 699, 786, 699, 699,
- 701, 172, 699, 21, 21, 699, 699, 699,
- 699, 699, 169, 790, 26, 21, 791, 170,
- 791, 786, 172, 21, 21, 169, 792, 793,
- 792, 390, 794, 392, 387, 387, 386, 795,
- 26, 21, 689, 690, 689, 691, 171, 691,
- 691, 692, 693, 796, 172, 796, 691, 21,
- 21, 691, 691, 691, 691, 169, 689, 690,
- 689, 691, 171, 691, 691, 692, 693, 797,
- 172, 797, 691, 21, 21, 691, 691, 691,
- 691, 169, 689, 690, 689, 691, 171, 691,
- 691, 692, 693, 798, 172, 798, 691, 21,
- 21, 691, 691, 691, 691, 169, 689, 690,
- 689, 691, 171, 691, 691, 692, 693, 799,
- 172, 799, 691, 21, 21, 691, 691, 691,
- 691, 169, 800, 801, 800, 691, 171, 691,
- 691, 692, 802, 172, 691, 21, 21, 691,
- 691, 691, 691, 169, 803, 804, 803, 171,
- 675, 802, 172, 21, 21, 169, 805, 26,
- 21, 806, 170, 806, 171, 675, 802, 172,
- 21, 21, 169, 807, 808, 807, 699, 809,
- 699, 699, 701, 172, 699, 21, 21, 699,
- 699, 699, 699, 699, 169, 810, 26, 21,
- 811, 812, 811, 699, 809, 699, 699, 701,
- 172, 699, 21, 21, 699, 699, 699, 699,
- 699, 169, 813, 26, 21, 814, 170, 814,
- 815, 172, 21, 21, 169, 816, 817, 816,
- 108, 818, 109, 21, 21, 106, 819, 26,
- 21, 689, 690, 689, 691, 171, 691, 691,
- 692, 693, 820, 172, 820, 691, 21, 21,
- 691, 691, 691, 691, 169, 689, 690, 689,
- 691, 171, 691, 691, 692, 693, 821, 172,
- 821, 691, 21, 21, 691, 691, 691, 691,
- 169, 689, 690, 689, 691, 171, 691, 691,
- 692, 693, 822, 172, 822, 691, 21, 21,
- 691, 691, 691, 691, 169, 689, 690, 689,
- 691, 171, 691, 691, 692, 693, 823, 172,
- 823, 691, 21, 21, 691, 691, 691, 691,
- 169, 689, 690, 689, 691, 171, 691, 691,
- 692, 693, 824, 172, 824, 691, 21, 21,
- 691, 691, 691, 691, 169, 825, 826, 825,
- 691, 171, 691, 691, 692, 827, 172, 691,
- 21, 21, 691, 691, 691, 691, 169, 828,
- 829, 828, 171, 675, 827, 172, 21, 21,
- 169, 830, 26, 21, 831, 170, 831, 171,
- 675, 827, 172, 21, 21, 169, 832, 833,
- 832, 699, 834, 699, 699, 701, 172, 699,
- 21, 21, 699, 699, 699, 699, 699, 169,
- 835, 26, 21, 836, 837, 836, 699, 834,
- 699, 699, 701, 172, 699, 21, 21, 699,
- 699, 699, 699, 699, 169, 838, 26, 21,
- 839, 170, 839, 840, 172, 21, 21, 169,
- 841, 842, 841, 171, 843, 172, 21, 21,
- 169, 844, 26, 21, 689, 690, 689, 691,
- 171, 691, 691, 692, 693, 845, 172, 845,
- 691, 21, 21, 691, 691, 691, 691, 169,
- 689, 690, 689, 691, 171, 691, 691, 692,
- 693, 846, 172, 846, 691, 21, 21, 691,
- 691, 691, 691, 169, 847, 848, 847, 691,
- 171, 691, 691, 692, 849, 172, 691, 21,
- 21, 691, 691, 691, 691, 169, 850, 851,
- 850, 171, 675, 849, 172, 21, 21, 169,
- 852, 26, 21, 853, 170, 853, 171, 675,
- 849, 172, 21, 21, 169, 849, 854, 849,
- 699, 855, 699, 699, 701, 172, 699, 21,
- 21, 699, 699, 699, 699, 699, 169, 856,
- 26, 21, 857, 858, 857, 699, 855, 699,
- 699, 701, 172, 699, 21, 21, 699, 699,
- 699, 699, 699, 169, 859, 26, 21, 860,
- 170, 860, 855, 172, 21, 21, 169, 861,
- 862, 861, 197, 863, 198, 195, 195, 194,
- 864, 865, 864, 202, 866, 203, 200, 200,
- 199, 867, 204, 202, 200, 868, 201, 868,
- 202, 866, 203, 200, 200, 199, 866, 869,
- 866, 870, 202, 870, 870, 871, 872, 873,
- 874, 875, 876, 877, 203, 871, 872, 873,
- 874, 875, 876, 877, 870, 200, 200, 870,
- 870, 870, 870, 870, 199, 878, 204, 202,
- 200, 879, 201, 879, 870, 202, 870, 870,
- 871, 872, 873, 874, 875, 876, 877, 203,
- 871, 872, 873, 874, 875, 876, 877, 870,
- 200, 200, 870, 870, 870, 870, 870, 199,
- 880, 881, 880, 882, 202, 882, 882, 883,
- 884, 203, 882, 200, 200, 882, 882, 882,
- 882, 199, 885, 886, 885, 202, 866, 884,
- 203, 200, 200, 199, 887, 204, 202, 200,
- 888, 201, 888, 202, 866, 884, 203, 200,
- 200, 199, 884, 889, 884, 890, 265, 890,
- 890, 891, 203, 890, 200, 200, 890, 890,
- 890, 890, 890, 199, 892, 204, 202, 200,
- 893, 894, 893, 890, 265, 890, 890, 891,
- 203, 890, 200, 200, 890, 890, 890, 890,
- 890, 199, 895, 204, 202, 200, 896, 201,
- 896, 265, 203, 200, 200, 199, 897, 898,
- 897, 890, 202, 890, 890, 883, 203, 890,
- 200, 200, 890, 890, 890, 890, 199, 899,
- 204, 202, 200, 900, 901, 900, 902, 202,
- 902, 902, 903, 904, 902, 902, 902, 902,
- 902, 200, 905, 906, 905, 202, 907, 904,
- 200, 908, 204, 202, 200, 909, 204, 909,
- 202, 907, 904, 200, 907, 910, 907, 911,
- 202, 911, 911, 912, 913, 914, 915, 916,
- 917, 918, 912, 913, 914, 915, 916, 917,
- 918, 911, 911, 911, 911, 911, 911, 200,
- 919, 204, 202, 200, 920, 204, 920, 911,
- 202, 911, 911, 912, 913, 914, 915, 916,
- 917, 918, 912, 913, 914, 915, 916, 917,
- 918, 911, 911, 911, 911, 911, 911, 200,
- 900, 901, 900, 902, 202, 902, 902, 903,
- 904, 921, 921, 902, 902, 902, 902, 902,
- 200, 922, 204, 202, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 923, 923,
- 902, 902, 902, 902, 902, 200, 904, 924,
- 904, 925, 265, 925, 925, 926, 925, 925,
- 925, 925, 925, 925, 200, 927, 204, 202,
- 200, 928, 929, 928, 925, 265, 925, 925,
- 926, 925, 925, 925, 925, 925, 925, 200,
- 930, 204, 202, 200, 931, 204, 931, 265,
- 200, 932, 933, 932, 925, 202, 925, 925,
- 903, 925, 925, 925, 925, 925, 200, 934,
- 935, 934, 202, 907, 200, 936, 204, 202,
- 200, 937, 204, 937, 202, 907, 200, 938,
- 204, 202, 200, 900, 901, 900, 902, 202,
- 902, 902, 903, 904, 939, 939, 902, 902,
- 902, 902, 902, 200, 900, 901, 900, 902,
- 202, 902, 902, 903, 904, 940, 940, 902,
- 902, 902, 902, 902, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 941, 941,
- 902, 902, 902, 902, 902, 200, 900, 901,
- 900, 902, 202, 902, 902, 903, 904, 942,
- 942, 902, 902, 902, 902, 902, 200, 943,
- 944, 943, 902, 202, 902, 902, 903, 945,
- 902, 902, 902, 902, 902, 200, 946, 947,
- 946, 202, 907, 945, 200, 948, 204, 202,
- 200, 949, 204, 949, 202, 907, 945, 200,
- 950, 951, 950, 925, 952, 925, 925, 926,
- 925, 925, 925, 925, 925, 925, 200, 953,
- 204, 202, 200, 954, 955, 954, 925, 952,
- 925, 925, 926, 925, 925, 925, 925, 925,
- 925, 200, 956, 204, 202, 200, 957, 204,
- 957, 958, 200, 204, 202, 960, 959, 959,
- 959, 200, 204, 202, 962, 963, 961, 961,
- 961, 200, 204, 202, 962, 963, 964, 964,
- 964, 200, 204, 202, 962, 963, 965, 965,
- 965, 200, 204, 202, 962, 963, 200, 204,
- 202, 967, 966, 959, 959, 200, 204, 202,
- 968, 962, 963, 969, 961, 961, 200, 204,
- 202, 970, 200, 204, 202, 971, 972, 200,
- 204, 202, 973, 200, 204, 202, 974, 975,
- 200, 204, 202, 976, 200, 204, 202, 963,
- 977, 200, 204, 202, 963, 978, 200, 204,
- 202, 963, 200, 932, 933, 932, 202, 903,
- 200, 204, 202, 974, 979, 200, 204, 202,
- 974, 200, 204, 202, 971, 980, 200, 204,
- 202, 971, 200, 204, 202, 968, 962, 963,
- 981, 964, 964, 200, 204, 202, 968, 962,
- 963, 965, 965, 965, 200, 204, 202, 983,
- 963, 982, 982, 982, 200, 204, 202, 985,
- 963, 984, 984, 984, 200, 204, 202, 985,
- 963, 986, 986, 986, 200, 204, 202, 985,
- 963, 987, 987, 987, 200, 204, 202, 985,
- 963, 200, 204, 202, 988, 982, 982, 200,
- 204, 202, 968, 985, 963, 989, 984, 984,
- 200, 204, 202, 968, 985, 963, 990, 986,
- 986, 200, 204, 202, 968, 985, 963, 987,
- 987, 987, 200, 204, 202, 991, 200, 204,
- 202, 968, 992, 200, 204, 202, 968, 993,
- 200, 204, 202, 968, 200, 204, 202, 967,
- 200, 994, 204, 202, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 995, 995,
- 902, 902, 902, 902, 902, 200, 900, 901,
- 900, 902, 202, 902, 902, 903, 904, 996,
- 996, 902, 902, 902, 902, 902, 200, 900,
- 901, 900, 902, 202, 902, 902, 903, 904,
- 997, 997, 902, 902, 902, 902, 902, 200,
- 900, 901, 900, 902, 202, 902, 902, 903,
- 904, 998, 998, 902, 902, 902, 902, 902,
- 200, 900, 901, 900, 902, 202, 902, 902,
- 903, 904, 999, 999, 902, 902, 902, 902,
- 902, 200, 1000, 1001, 1000, 902, 202, 902,
- 902, 903, 1002, 902, 902, 902, 902, 902,
- 200, 1003, 1004, 1003, 202, 907, 1002, 200,
- 1005, 204, 202, 200, 1006, 204, 1006, 202,
- 907, 1002, 200, 1007, 1008, 1007, 925, 1009,
- 925, 925, 926, 925, 925, 925, 925, 925,
- 925, 200, 1010, 204, 202, 200, 1011, 1012,
- 1011, 925, 1009, 925, 925, 926, 925, 925,
- 925, 925, 925, 925, 200, 1013, 204, 202,
- 200, 1014, 204, 1014, 1015, 200, 1016, 1017,
- 1016, 171, 675, 172, 21, 21, 169, 1018,
- 26, 21, 1019, 1020, 1019, 171, 675, 172,
- 21, 21, 169, 1021, 204, 202, 200, 900,
- 901, 900, 902, 202, 902, 902, 903, 904,
- 1022, 1022, 902, 902, 902, 902, 902, 200,
- 900, 901, 900, 902, 202, 902, 902, 903,
- 904, 1023, 1023, 902, 902, 902, 902, 902,
- 200, 1024, 1025, 1024, 902, 202, 902, 902,
- 903, 1026, 902, 902, 902, 902, 902, 200,
- 1027, 1028, 1027, 202, 907, 1026, 200, 1029,
- 204, 202, 200, 1030, 204, 1030, 202, 907,
- 1026, 200, 1026, 1031, 1026, 925, 202, 925,
- 925, 926, 925, 925, 925, 925, 925, 925,
- 200, 1032, 204, 202, 200, 1033, 204, 1033,
- 925, 202, 925, 925, 926, 925, 925, 925,
- 925, 925, 925, 200, 1034, 204, 202, 200,
- 900, 901, 900, 902, 202, 902, 902, 903,
- 904, 1035, 1035, 902, 902, 902, 902, 902,
- 200, 900, 901, 900, 902, 202, 902, 902,
- 903, 904, 1036, 1036, 902, 902, 902, 902,
- 902, 200, 900, 901, 900, 902, 202, 902,
- 902, 903, 904, 1037, 1037, 902, 902, 902,
- 902, 902, 200, 900, 901, 900, 902, 202,
- 902, 902, 903, 904, 1038, 1038, 902, 902,
- 902, 902, 902, 200, 1039, 1040, 1039, 902,
- 202, 902, 902, 903, 1041, 902, 902, 902,
- 902, 902, 200, 1042, 1043, 1042, 202, 907,
- 1041, 200, 1044, 204, 202, 200, 1045, 204,
- 1045, 202, 907, 1041, 200, 1046, 1047, 1046,
- 925, 1048, 925, 925, 926, 925, 925, 925,
- 925, 925, 925, 200, 1049, 204, 202, 200,
- 1050, 1051, 1050, 925, 1048, 925, 925, 926,
- 925, 925, 925, 925, 925, 925, 200, 1052,
- 204, 202, 200, 1053, 204, 1053, 1054, 200,
- 1055, 1056, 1055, 232, 1057, 233, 21, 21,
- 230, 1058, 26, 21, 1059, 1060, 1059, 232,
- 1057, 233, 21, 21, 230, 1061, 26, 21,
- 1062, 231, 1062, 232, 1057, 233, 21, 21,
- 230, 1057, 1063, 1057, 1064, 232, 1064, 1064,
- 1065, 1066, 1067, 1068, 1069, 1070, 1071, 233,
- 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1064,
- 21, 21, 1064, 1064, 1064, 1064, 1064, 230,
- 1072, 26, 21, 1073, 231, 1073, 1064, 232,
- 1064, 1064, 1065, 1066, 1067, 1068, 1069, 1070,
- 1071, 233, 1065, 1066, 1067, 1068, 1069, 1070,
- 1071, 1064, 21, 21, 1064, 1064, 1064, 1064,
- 1064, 230, 1074, 1075, 1074, 1076, 232, 1076,
- 1076, 1077, 1078, 233, 1076, 21, 21, 1076,
- 1076, 1076, 1076, 230, 1079, 1080, 1079, 232,
- 1057, 1078, 233, 21, 21, 230, 1081, 26,
- 21, 1082, 231, 1082, 232, 1057, 1078, 233,
- 21, 21, 230, 1078, 1083, 1078, 1084, 1085,
- 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
- 1084, 1084, 1084, 1084, 230, 1087, 26, 21,
- 1088, 1089, 1088, 1084, 1085, 1084, 1084, 1086,
- 233, 1084, 21, 21, 1084, 1084, 1084, 1084,
- 1084, 230, 1090, 26, 21, 1091, 231, 1091,
- 1085, 233, 21, 21, 230, 1092, 1093, 1092,
- 77, 1094, 78, 21, 21, 69, 1095, 1096,
- 1095, 1084, 232, 1084, 1084, 1077, 233, 1084,
- 21, 21, 1084, 1084, 1084, 1084, 230, 1097,
- 1098, 1097, 232, 1057, 233, 21, 21, 230,
- 1099, 26, 21, 231, 232, 1101, 233, 21,
- 21, 21, 1100, 1100, 1100, 230, 231, 232,
- 1103, 233, 1104, 21, 21, 21, 1102, 1102,
- 1102, 230, 231, 232, 1103, 233, 1104, 21,
- 21, 21, 1105, 1105, 1105, 230, 231, 232,
- 1103, 233, 1104, 21, 21, 21, 1106, 1106,
- 1106, 230, 231, 232, 1103, 233, 1104, 21,
- 21, 21, 230, 231, 232, 1108, 233, 21,
- 21, 21, 1107, 1100, 1100, 230, 231, 232,
- 1109, 1103, 233, 1104, 21, 21, 21, 1110,
- 1102, 1102, 230, 231, 232, 233, 21, 21,
- 21, 1111, 230, 231, 232, 1112, 233, 21,
- 21, 21, 1113, 230, 231, 232, 233, 21,
- 21, 21, 1114, 230, 231, 232, 1115, 233,
- 21, 21, 21, 1116, 230, 231, 232, 233,
- 21, 21, 21, 1117, 230, 231, 232, 233,
- 1104, 21, 21, 21, 1118, 230, 231, 232,
- 233, 1104, 21, 21, 21, 1119, 230, 231,
- 232, 233, 1104, 21, 21, 21, 230, 1095,
- 1096, 1095, 232, 1077, 233, 21, 21, 230,
- 231, 232, 1115, 233, 21, 21, 21, 1120,
- 230, 231, 232, 1115, 233, 21, 21, 21,
- 230, 231, 232, 1112, 233, 21, 21, 21,
- 1121, 230, 231, 232, 1112, 233, 21, 21,
- 21, 230, 231, 232, 1109, 1103, 233, 1104,
- 21, 21, 21, 1122, 1105, 1105, 230, 231,
- 232, 1109, 1103, 233, 1104, 21, 21, 21,
- 1106, 1106, 1106, 230, 231, 232, 1124, 233,
- 1104, 21, 21, 21, 1123, 1123, 1123, 230,
- 231, 232, 1126, 233, 1104, 21, 21, 21,
- 1125, 1125, 1125, 230, 231, 232, 1126, 233,
- 1104, 21, 21, 21, 1127, 1127, 1127, 230,
- 231, 232, 1126, 233, 1104, 21, 21, 21,
- 1128, 1128, 1128, 230, 231, 232, 1126, 233,
- 1104, 21, 21, 21, 230, 231, 232, 233,
- 21, 21, 21, 1129, 1123, 1123, 230, 231,
- 232, 1109, 1126, 233, 1104, 21, 21, 21,
- 1130, 1125, 1125, 230, 231, 232, 1109, 1126,
- 233, 1104, 21, 21, 21, 1131, 1127, 1127,
- 230, 231, 232, 1109, 1126, 233, 1104, 21,
- 21, 21, 1128, 1128, 1128, 230, 231, 232,
- 233, 21, 21, 21, 1132, 230, 231, 232,
- 1109, 233, 21, 21, 21, 1133, 230, 231,
- 232, 1109, 233, 21, 21, 21, 1134, 230,
- 231, 232, 1109, 233, 21, 21, 21, 230,
- 231, 232, 1108, 233, 21, 21, 21, 230,
- 1135, 26, 21, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1136, 233, 1136, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1137, 233, 1137, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1138, 233, 1138, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1139, 233, 1139, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1140, 233, 1140, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1141, 233, 1141, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1142, 233, 1142, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1143, 233, 1143, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1144, 1145, 1144, 1076, 232,
- 1076, 1076, 1077, 1146, 233, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1147, 1148, 1147,
- 232, 1057, 1146, 233, 21, 21, 230, 1149,
- 26, 21, 1150, 231, 1150, 232, 1057, 1146,
- 233, 21, 21, 230, 1146, 1151, 1146, 1152,
- 1085, 1152, 1152, 1086, 233, 1152, 21, 21,
- 1152, 1152, 1152, 1152, 1152, 230, 1153, 26,
- 21, 1154, 1089, 1154, 1152, 1085, 1152, 1152,
- 1086, 233, 1152, 21, 21, 1152, 1152, 1152,
- 1152, 1152, 230, 1155, 1156, 1155, 1157, 232,
- 1157, 1157, 1158, 233, 1157, 21, 21, 1157,
- 1157, 1157, 1157, 230, 1159, 26, 21, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1160, 233, 1160, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1161, 233, 1161, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1162, 233, 1162, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1163, 233, 1163, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1164, 233, 1164, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1165, 1166, 1165, 1076, 232,
- 1076, 1076, 1077, 1167, 233, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1168, 1169, 1168,
- 232, 1057, 1167, 233, 21, 21, 230, 1170,
- 26, 21, 1171, 231, 1171, 232, 1057, 1167,
- 233, 21, 21, 230, 1167, 1172, 1167, 1084,
- 1173, 1084, 1084, 1086, 233, 1084, 21, 21,
- 1084, 1084, 1084, 1084, 1084, 230, 1174, 26,
- 21, 1175, 1176, 1175, 1084, 1173, 1084, 1084,
- 1086, 233, 1084, 21, 21, 1084, 1084, 1084,
- 1084, 1084, 230, 1177, 26, 21, 1178, 231,
- 1178, 1173, 233, 21, 21, 230, 1179, 1180,
- 1179, 390, 1181, 392, 387, 387, 386, 1182,
- 26, 21, 1074, 1075, 1074, 1076, 232, 1076,
- 1076, 1077, 1078, 1183, 233, 1183, 1076, 21,
- 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
- 1074, 1076, 232, 1076, 1076, 1077, 1078, 1184,
- 233, 1184, 1076, 21, 21, 1076, 1076, 1076,
- 1076, 230, 1074, 1075, 1074, 1076, 232, 1076,
- 1076, 1077, 1078, 1185, 233, 1185, 1076, 21,
- 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
- 1074, 1076, 232, 1076, 1076, 1077, 1078, 1186,
- 233, 1186, 1076, 21, 21, 1076, 1076, 1076,
- 1076, 230, 1187, 1188, 1187, 1076, 232, 1076,
- 1076, 1077, 1189, 233, 1076, 21, 21, 1076,
- 1076, 1076, 1076, 230, 1190, 1191, 1190, 232,
- 1057, 1189, 233, 21, 21, 230, 1192, 26,
- 21, 1193, 231, 1193, 232, 1057, 1189, 233,
- 21, 21, 230, 1194, 1195, 1194, 1084, 1196,
- 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
- 1084, 1084, 1084, 1084, 230, 1197, 26, 21,
- 1198, 1199, 1198, 1084, 1196, 1084, 1084, 1086,
- 233, 1084, 21, 21, 1084, 1084, 1084, 1084,
- 1084, 230, 1200, 26, 21, 1201, 231, 1201,
- 1202, 233, 21, 21, 230, 1203, 1204, 1203,
- 108, 1205, 109, 21, 21, 106, 1206, 26,
- 21, 1074, 1075, 1074, 1076, 232, 1076, 1076,
- 1077, 1078, 1207, 233, 1207, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1074, 1075, 1074,
- 1076, 232, 1076, 1076, 1077, 1078, 1208, 233,
- 1208, 1076, 21, 21, 1076, 1076, 1076, 1076,
- 230, 1074, 1075, 1074, 1076, 232, 1076, 1076,
- 1077, 1078, 1209, 233, 1209, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1074, 1075, 1074,
- 1076, 232, 1076, 1076, 1077, 1078, 1210, 233,
- 1210, 1076, 21, 21, 1076, 1076, 1076, 1076,
- 230, 1074, 1075, 1074, 1076, 232, 1076, 1076,
- 1077, 1078, 1211, 233, 1211, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1212, 1213, 1212,
- 1076, 232, 1076, 1076, 1077, 1214, 233, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1215,
- 1216, 1215, 232, 1057, 1214, 233, 21, 21,
- 230, 1217, 26, 21, 1218, 231, 1218, 232,
- 1057, 1214, 233, 21, 21, 230, 1219, 1220,
- 1219, 1084, 1221, 1084, 1084, 1086, 233, 1084,
- 21, 21, 1084, 1084, 1084, 1084, 1084, 230,
- 1222, 26, 21, 1223, 1224, 1223, 1084, 1221,
- 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
- 1084, 1084, 1084, 1084, 230, 1225, 26, 21,
- 1226, 231, 1226, 1227, 233, 21, 21, 230,
- 1228, 1229, 1228, 171, 1230, 172, 21, 21,
- 169, 1231, 26, 21, 1074, 1075, 1074, 1076,
- 232, 1076, 1076, 1077, 1078, 1232, 233, 1232,
- 1076, 21, 21, 1076, 1076, 1076, 1076, 230,
- 1074, 1075, 1074, 1076, 232, 1076, 1076, 1077,
- 1078, 1233, 233, 1233, 1076, 21, 21, 1076,
- 1076, 1076, 1076, 230, 1234, 1235, 1234, 1076,
- 232, 1076, 1076, 1077, 1236, 233, 1076, 21,
- 21, 1076, 1076, 1076, 1076, 230, 1237, 1238,
- 1237, 232, 1057, 1236, 233, 21, 21, 230,
- 1239, 26, 21, 1240, 231, 1240, 232, 1057,
- 1236, 233, 21, 21, 230, 1236, 1241, 1236,
- 1084, 1242, 1084, 1084, 1086, 233, 1084, 21,
- 21, 1084, 1084, 1084, 1084, 1084, 230, 1243,
- 26, 21, 1244, 1245, 1244, 1084, 1242, 1084,
- 1084, 1086, 233, 1084, 21, 21, 1084, 1084,
- 1084, 1084, 1084, 230, 1246, 26, 21, 1247,
- 231, 1247, 1242, 233, 21, 21, 230, 1248,
- 1249, 1248, 197, 1250, 198, 195, 195, 194,
- 1251, 26, 21, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1252, 233, 1252, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1253, 233, 1253, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
- 1076, 1076, 1077, 1078, 1254, 233, 1254, 1076,
- 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
- 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
- 1255, 233, 1255, 1076, 21, 21, 1076, 1076,
- 1076, 1076, 230, 1256, 1257, 1256, 1076, 232,
- 1076, 1076, 1077, 1258, 233, 1076, 21, 21,
- 1076, 1076, 1076, 1076, 230, 1259, 1260, 1259,
- 232, 1057, 1258, 233, 21, 21, 230, 1261,
- 26, 21, 1262, 231, 1262, 232, 1057, 1258,
- 233, 21, 21, 230, 1263, 1264, 1263, 1084,
- 1265, 1084, 1084, 1086, 233, 1084, 21, 21,
- 1084, 1084, 1084, 1084, 1084, 230, 1266, 26,
- 21, 1267, 1268, 1267, 1084, 1265, 1084, 1084,
- 1086, 233, 1084, 21, 21, 1084, 1084, 1084,
- 1084, 1084, 230, 1269, 26, 21, 1270, 231,
- 1270, 1271, 233, 21, 21, 230, 1272, 1273,
- 1272, 232, 1274, 233, 21, 21, 230, 1275,
- 26, 21, 1074, 1075, 1074, 1076, 232, 1076,
- 1076, 1077, 1078, 1276, 233, 1276, 1076, 21,
- 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
- 1074, 1076, 232, 1076, 1076, 1077, 1078, 1277,
- 233, 1277, 1076, 21, 21, 1076, 1076, 1076,
- 1076, 230, 1074, 1075, 1074, 1076, 232, 1076,
- 1076, 1077, 1078, 1278, 233, 1278, 1076, 21,
- 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
- 1074, 1076, 232, 1076, 1076, 1077, 1078, 1279,
- 233, 1279, 1076, 21, 21, 1076, 1076, 1076,
- 1076, 230, 1280, 1281, 1280, 1076, 232, 1076,
- 1076, 1077, 1282, 233, 1076, 21, 21, 1076,
- 1076, 1076, 1076, 230, 1283, 1284, 1283, 232,
- 1057, 1282, 233, 21, 21, 230, 1285, 26,
- 21, 1286, 231, 1286, 232, 1057, 1282, 233,
- 21, 21, 230, 1282, 1287, 1282, 1084, 1085,
- 1084, 1084, 1288, 1289, 1086, 233, 1288, 1289,
- 1084, 21, 21, 1084, 1084, 1084, 1084, 1084,
- 230, 1290, 26, 21, 1291, 1089, 1291, 1084,
- 1085, 1084, 1084, 1288, 1289, 1086, 233, 1288,
- 1289, 1084, 21, 21, 1084, 1084, 1084, 1084,
- 1084, 230, 1095, 1096, 1095, 1084, 232, 1084,
- 1084, 1077, 1292, 233, 1292, 1084, 21, 21,
- 1084, 1084, 1084, 1084, 230, 1095, 1096, 1095,
- 1084, 232, 1084, 1084, 1077, 1293, 233, 1293,
- 1084, 21, 21, 1084, 1084, 1084, 1084, 230,
- 1095, 1096, 1095, 1084, 232, 1084, 1084, 1077,
- 1294, 233, 1294, 1084, 21, 21, 1084, 1084,
- 1084, 1084, 230, 1095, 1096, 1095, 1084, 232,
- 1084, 1084, 1077, 1295, 233, 1295, 1084, 21,
- 21, 1084, 1084, 1084, 1084, 230, 1296, 1297,
- 1296, 232, 1298, 233, 21, 21, 230, 1095,
- 1096, 1095, 1084, 232, 1084, 1084, 1077, 1299,
- 233, 1299, 1084, 21, 21, 1084, 1084, 1084,
- 1084, 230, 1095, 1096, 1095, 1084, 232, 1084,
- 1084, 1077, 1294, 233, 1294, 1084, 21, 21,
- 1084, 1084, 1084, 1084, 230, 1300, 26, 21,
- 1301, 204, 202, 200, 900, 901, 900, 902,
- 202, 902, 902, 903, 904, 1302, 1302, 902,
- 902, 902, 902, 902, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 1303, 1303,
- 902, 902, 902, 902, 902, 200, 900, 901,
- 900, 902, 202, 902, 902, 903, 904, 1304,
- 1304, 902, 902, 902, 902, 902, 200, 900,
- 901, 900, 902, 202, 902, 902, 903, 904,
- 1305, 1305, 902, 902, 902, 902, 902, 200,
- 1306, 1307, 1306, 902, 202, 902, 902, 903,
- 1308, 902, 902, 902, 902, 902, 200, 1309,
- 1310, 1309, 202, 907, 1308, 200, 1311, 204,
- 202, 200, 1312, 204, 1312, 202, 907, 1308,
- 200, 1308, 1313, 1308, 925, 265, 925, 925,
- 1314, 1315, 926, 1314, 1315, 925, 925, 925,
- 925, 925, 925, 200, 1316, 204, 202, 200,
- 1317, 929, 1317, 925, 265, 925, 925, 1314,
- 1315, 926, 1314, 1315, 925, 925, 925, 925,
- 925, 925, 200, 932, 933, 932, 925, 202,
- 925, 925, 903, 1318, 1318, 925, 925, 925,
- 925, 925, 200, 932, 933, 932, 925, 202,
- 925, 925, 903, 1319, 1319, 925, 925, 925,
- 925, 925, 200, 932, 933, 932, 925, 202,
- 925, 925, 903, 1320, 1320, 925, 925, 925,
- 925, 925, 200, 932, 933, 932, 925, 202,
- 925, 925, 903, 1321, 1321, 925, 925, 925,
- 925, 925, 200, 1322, 1323, 1322, 202, 1324,
- 200, 932, 933, 932, 925, 202, 925, 925,
- 903, 1325, 1325, 925, 925, 925, 925, 925,
- 200, 932, 933, 932, 925, 202, 925, 925,
- 903, 1320, 1320, 925, 925, 925, 925, 925,
- 200, 1326, 204, 202, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 1327, 1327,
- 902, 902, 902, 902, 902, 200, 900, 901,
- 900, 902, 202, 902, 902, 903, 904, 1328,
- 1328, 902, 902, 902, 902, 902, 200, 900,
- 901, 900, 902, 202, 902, 902, 903, 904,
- 1329, 1329, 902, 902, 902, 902, 902, 200,
- 900, 901, 900, 902, 202, 902, 902, 903,
- 904, 1330, 1330, 902, 902, 902, 902, 902,
- 200, 1331, 1332, 1331, 902, 202, 902, 902,
- 903, 1333, 902, 902, 902, 902, 902, 200,
- 1334, 1335, 1334, 202, 907, 1333, 200, 1336,
- 204, 202, 200, 1337, 204, 1337, 202, 907,
- 1333, 200, 1333, 1338, 1333, 925, 1339, 925,
- 925, 926, 925, 925, 925, 925, 925, 925,
- 200, 1340, 204, 202, 200, 1341, 1342, 1341,
- 925, 1339, 925, 925, 926, 925, 925, 925,
- 925, 925, 925, 200, 1343, 204, 202, 200,
- 1344, 204, 1344, 1339, 200, 1345, 1346, 1345,
- 390, 1347, 392, 387, 387, 386, 1348, 1349,
- 1348, 396, 404, 397, 394, 394, 393, 1350,
- 398, 396, 394, 1351, 1352, 1351, 396, 404,
- 397, 394, 394, 393, 438, 439, 438, 440,
- 396, 440, 440, 441, 442, 1353, 1353, 440,
- 440, 440, 440, 440, 394, 438, 439, 438,
- 440, 396, 440, 440, 441, 442, 1354, 1354,
- 440, 440, 440, 440, 440, 394, 438, 439,
- 438, 440, 396, 440, 440, 441, 442, 1355,
- 1355, 440, 440, 440, 440, 440, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 1356, 1356, 440, 440, 440, 440, 440, 394,
- 438, 439, 438, 440, 396, 440, 440, 441,
- 442, 1357, 1357, 440, 440, 440, 440, 440,
- 394, 1358, 1359, 1358, 440, 396, 440, 440,
- 441, 1360, 440, 440, 440, 440, 440, 394,
- 1361, 1362, 1361, 396, 445, 1360, 394, 1363,
- 398, 396, 394, 1364, 398, 1364, 396, 445,
- 1360, 394, 1365, 1366, 1365, 463, 1367, 463,
- 463, 464, 463, 463, 463, 463, 463, 463,
- 394, 1368, 398, 396, 394, 1369, 1370, 1369,
- 463, 1367, 463, 463, 464, 463, 463, 463,
- 463, 463, 463, 394, 1371, 398, 396, 394,
- 1372, 398, 1372, 1373, 394, 398, 396, 1375,
- 1374, 1374, 1374, 394, 398, 396, 1377, 1378,
- 1376, 1376, 1376, 394, 398, 396, 1377, 1378,
- 1379, 1379, 1379, 394, 398, 396, 1377, 1378,
- 1380, 1380, 1380, 394, 398, 396, 1377, 1378,
- 394, 398, 396, 1382, 1381, 1374, 1374, 394,
- 398, 396, 1383, 1377, 1378, 1384, 1376, 1376,
- 394, 398, 396, 1385, 394, 398, 396, 1386,
- 1387, 394, 398, 396, 1388, 394, 398, 396,
- 1389, 1390, 394, 398, 396, 1391, 394, 398,
- 396, 1378, 1392, 394, 398, 396, 1378, 1393,
- 394, 398, 396, 1378, 394, 470, 471, 470,
- 396, 441, 394, 398, 396, 1389, 1394, 394,
- 398, 396, 1389, 394, 398, 396, 1386, 1395,
- 394, 398, 396, 1386, 394, 398, 396, 1383,
- 1377, 1378, 1396, 1379, 1379, 394, 398, 396,
- 1383, 1377, 1378, 1380, 1380, 1380, 394, 398,
- 396, 1398, 1378, 1397, 1397, 1397, 394, 398,
- 396, 1400, 1378, 1399, 1399, 1399, 394, 398,
- 396, 1400, 1378, 1401, 1401, 1401, 394, 398,
- 396, 1400, 1378, 1402, 1402, 1402, 394, 398,
- 396, 1400, 1378, 394, 398, 396, 1403, 1397,
- 1397, 394, 398, 396, 1383, 1400, 1378, 1404,
- 1399, 1399, 394, 398, 396, 1383, 1400, 1378,
- 1405, 1401, 1401, 394, 398, 396, 1383, 1400,
- 1378, 1402, 1402, 1402, 394, 398, 396, 1406,
- 394, 398, 396, 1383, 1407, 394, 398, 396,
- 1383, 1408, 394, 398, 396, 1383, 394, 398,
- 396, 1382, 394, 1409, 398, 396, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 1410, 1410, 440, 440, 440, 440, 440, 394,
- 438, 439, 438, 440, 396, 440, 440, 441,
- 442, 1411, 1411, 440, 440, 440, 440, 440,
- 394, 1412, 1413, 1412, 440, 396, 440, 440,
- 441, 1414, 440, 440, 440, 440, 440, 394,
- 1415, 1416, 1415, 396, 445, 1414, 394, 1417,
- 398, 396, 394, 1418, 398, 1418, 396, 445,
- 1414, 394, 1414, 1419, 1414, 463, 1420, 463,
- 463, 464, 463, 463, 463, 463, 463, 463,
- 394, 1421, 398, 396, 394, 1422, 1423, 1422,
- 463, 1420, 463, 463, 464, 463, 463, 463,
- 463, 463, 463, 394, 1424, 398, 396, 394,
- 1425, 398, 1425, 1420, 394, 1426, 1427, 1426,
- 197, 1428, 198, 195, 195, 194, 1429, 1430,
- 1429, 202, 866, 203, 200, 200, 199, 1431,
- 204, 202, 200, 1432, 1433, 1432, 202, 866,
- 203, 200, 200, 199, 1434, 398, 396, 394,
- 438, 439, 438, 440, 396, 440, 440, 441,
- 442, 1435, 1435, 440, 440, 440, 440, 440,
- 394, 438, 439, 438, 440, 396, 440, 440,
- 441, 442, 1436, 1436, 440, 440, 440, 440,
- 440, 394, 438, 439, 438, 440, 396, 440,
- 440, 441, 442, 1437, 1437, 440, 440, 440,
- 440, 440, 394, 438, 439, 438, 440, 396,
- 440, 440, 441, 442, 1438, 1438, 440, 440,
- 440, 440, 440, 394, 1439, 1440, 1439, 440,
- 396, 440, 440, 441, 1441, 440, 440, 440,
- 440, 440, 394, 1442, 1443, 1442, 396, 445,
- 1441, 394, 1444, 398, 396, 394, 1445, 398,
- 1445, 396, 445, 1441, 394, 1446, 1447, 1446,
- 463, 1448, 463, 463, 464, 463, 463, 463,
- 463, 463, 463, 394, 1449, 398, 396, 394,
- 1450, 1451, 1450, 463, 1448, 463, 463, 464,
- 463, 463, 463, 463, 463, 463, 394, 1452,
- 398, 396, 394, 1453, 398, 1453, 1454, 394,
- 1455, 398, 396, 394, 438, 439, 438, 440,
- 396, 440, 440, 441, 442, 1456, 1456, 440,
- 440, 440, 440, 440, 394, 438, 439, 438,
- 440, 396, 440, 440, 441, 442, 1457, 1457,
- 440, 440, 440, 440, 440, 394, 438, 439,
- 438, 440, 396, 440, 440, 441, 442, 1458,
- 1458, 440, 440, 440, 440, 440, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 1459, 1459, 440, 440, 440, 440, 440, 394,
- 1460, 1461, 1460, 440, 396, 440, 440, 441,
- 1462, 440, 440, 440, 440, 440, 394, 1463,
- 1464, 1463, 396, 445, 1462, 394, 1465, 398,
- 396, 394, 1466, 398, 1466, 396, 445, 1462,
- 394, 1462, 1467, 1462, 463, 401, 463, 463,
- 1468, 1469, 464, 1468, 1469, 463, 463, 463,
- 463, 463, 463, 394, 1470, 398, 396, 394,
- 1471, 467, 1471, 463, 401, 463, 463, 1468,
- 1469, 464, 1468, 1469, 463, 463, 463, 463,
- 463, 463, 394, 470, 471, 470, 463, 396,
- 463, 463, 441, 1472, 1472, 463, 463, 463,
- 463, 463, 394, 470, 471, 470, 463, 396,
- 463, 463, 441, 1473, 1473, 463, 463, 463,
- 463, 463, 394, 470, 471, 470, 463, 396,
- 463, 463, 441, 1474, 1474, 463, 463, 463,
- 463, 463, 394, 470, 471, 470, 463, 396,
- 463, 463, 441, 1475, 1475, 463, 463, 463,
- 463, 463, 394, 1476, 1477, 1476, 396, 1478,
- 394, 470, 471, 470, 463, 396, 463, 463,
- 441, 1479, 1479, 463, 463, 463, 463, 463,
- 394, 470, 471, 470, 463, 396, 463, 463,
- 441, 1474, 1474, 463, 463, 463, 463, 463,
- 394, 1480, 398, 396, 394, 1481, 204, 202,
- 200, 900, 901, 900, 902, 202, 902, 902,
- 903, 904, 1482, 1482, 902, 902, 902, 902,
- 902, 200, 900, 901, 900, 902, 202, 902,
- 902, 903, 904, 1483, 1483, 902, 902, 902,
- 902, 902, 200, 900, 901, 900, 902, 202,
- 902, 902, 903, 904, 1484, 1484, 902, 902,
- 902, 902, 902, 200, 900, 901, 900, 902,
- 202, 902, 902, 903, 904, 1485, 1485, 902,
- 902, 902, 902, 902, 200, 900, 901, 900,
- 902, 202, 902, 902, 903, 904, 1486, 1486,
- 902, 902, 902, 902, 902, 200, 900, 901,
- 900, 902, 202, 902, 902, 903, 904, 1487,
- 1487, 902, 902, 902, 902, 902, 200, 900,
- 901, 900, 902, 202, 902, 902, 903, 904,
- 1488, 1488, 902, 902, 902, 902, 902, 200,
- 1489, 1490, 1489, 902, 202, 902, 902, 903,
- 1491, 902, 902, 902, 902, 902, 200, 1492,
- 1493, 1492, 202, 907, 1491, 200, 1494, 204,
- 202, 200, 1495, 204, 1495, 202, 907, 1491,
- 200, 1491, 1496, 1491, 1497, 265, 1497, 1497,
- 926, 1497, 1497, 1497, 1497, 1497, 1497, 200,
- 1498, 204, 202, 200, 1499, 929, 1499, 1497,
- 265, 1497, 1497, 926, 1497, 1497, 1497, 1497,
- 1497, 1497, 200, 1500, 1501, 1500, 1502, 202,
- 1502, 1502, 1503, 1502, 1502, 1502, 1502, 1502,
- 200, 1504, 204, 202, 200, 201, 202, 1506,
- 203, 200, 200, 200, 1505, 1505, 1505, 199,
- 201, 202, 1508, 203, 1509, 200, 200, 200,
- 1507, 1507, 1507, 199, 201, 202, 1508, 203,
- 1509, 200, 200, 200, 1510, 1510, 1510, 199,
- 201, 202, 1508, 203, 1509, 200, 200, 200,
- 1511, 1511, 1511, 199, 201, 202, 1508, 203,
- 1509, 200, 200, 200, 199, 201, 202, 1513,
- 203, 200, 200, 200, 1512, 1505, 1505, 199,
- 201, 202, 1514, 1508, 203, 1509, 200, 200,
- 200, 1515, 1507, 1507, 199, 201, 202, 203,
- 200, 200, 200, 1516, 199, 201, 202, 1517,
- 203, 200, 200, 200, 1518, 199, 201, 202,
- 203, 200, 200, 200, 1519, 199, 201, 202,
- 1520, 203, 200, 200, 200, 1521, 199, 201,
- 202, 203, 200, 200, 200, 1522, 199, 201,
- 202, 203, 1509, 200, 200, 200, 1523, 199,
- 201, 202, 203, 1509, 200, 200, 200, 1524,
- 199, 201, 202, 203, 1509, 200, 200, 200,
- 199, 897, 898, 897, 202, 883, 203, 200,
- 200, 199, 201, 202, 1520, 203, 200, 200,
- 200, 1525, 199, 201, 202, 1520, 203, 200,
- 200, 200, 199, 201, 202, 1517, 203, 200,
- 200, 200, 1526, 199, 201, 202, 1517, 203,
- 200, 200, 200, 199, 201, 202, 1514, 1508,
- 203, 1509, 200, 200, 200, 1527, 1510, 1510,
- 199, 201, 202, 1514, 1508, 203, 1509, 200,
- 200, 200, 1511, 1511, 1511, 199, 201, 202,
- 1529, 203, 1509, 200, 200, 200, 1528, 1528,
- 1528, 199, 201, 202, 1531, 203, 1509, 200,
- 200, 200, 1530, 1530, 1530, 199, 201, 202,
- 1531, 203, 1509, 200, 200, 200, 1532, 1532,
- 1532, 199, 201, 202, 1531, 203, 1509, 200,
- 200, 200, 1533, 1533, 1533, 199, 201, 202,
- 1531, 203, 1509, 200, 200, 200, 199, 201,
- 202, 203, 200, 200, 200, 1534, 1528, 1528,
- 199, 201, 202, 1514, 1531, 203, 1509, 200,
- 200, 200, 1535, 1530, 1530, 199, 201, 202,
- 1514, 1531, 203, 1509, 200, 200, 200, 1536,
- 1532, 1532, 199, 201, 202, 1514, 1531, 203,
- 1509, 200, 200, 200, 1533, 1533, 1533, 199,
- 201, 202, 203, 200, 200, 200, 1537, 199,
- 201, 202, 1514, 203, 200, 200, 200, 1538,
- 199, 201, 202, 1514, 203, 200, 200, 200,
- 1539, 199, 201, 202, 1514, 203, 200, 200,
- 200, 199, 201, 202, 1513, 203, 200, 200,
- 200, 199, 1540, 204, 202, 200, 880, 881,
- 880, 882, 202, 882, 882, 883, 884, 1541,
- 203, 1541, 882, 200, 200, 882, 882, 882,
- 882, 199, 880, 881, 880, 882, 202, 882,
- 882, 883, 884, 1542, 203, 1542, 882, 200,
- 200, 882, 882, 882, 882, 199, 880, 881,
- 880, 882, 202, 882, 882, 883, 884, 1543,
- 203, 1543, 882, 200, 200, 882, 882, 882,
- 882, 199, 880, 881, 880, 882, 202, 882,
- 882, 883, 884, 1544, 203, 1544, 882, 200,
- 200, 882, 882, 882, 882, 199, 880, 881,
- 880, 882, 202, 882, 882, 883, 884, 1545,
- 203, 1545, 882, 200, 200, 882, 882, 882,
- 882, 199, 880, 881, 880, 882, 202, 882,
- 882, 883, 884, 1546, 203, 1546, 882, 200,
- 200, 882, 882, 882, 882, 199, 880, 881,
- 880, 882, 202, 882, 882, 883, 884, 1547,
- 203, 1547, 882, 200, 200, 882, 882, 882,
- 882, 199, 880, 881, 880, 882, 202, 882,
- 882, 883, 884, 1548, 203, 1548, 882, 200,
- 200, 882, 882, 882, 882, 199, 1549, 1550,
- 1549, 882, 202, 882, 882, 883, 1551, 203,
- 882, 200, 200, 882, 882, 882, 882, 199,
- 1552, 1553, 1552, 202, 866, 1551, 203, 200,
- 200, 199, 1554, 204, 202, 200, 1555, 201,
- 1555, 202, 866, 1551, 203, 200, 200, 199,
- 1551, 1556, 1551, 1557, 265, 1557, 1557, 891,
- 203, 1557, 200, 200, 1557, 1557, 1557, 1557,
- 1557, 199, 1558, 204, 202, 200, 1559, 894,
- 1559, 1557, 265, 1557, 1557, 891, 203, 1557,
- 200, 200, 1557, 1557, 1557, 1557, 1557, 199,
- 1560, 1561, 1560, 1562, 202, 1562, 1562, 1563,
- 203, 1562, 200, 200, 1562, 1562, 1562, 1562,
- 199, 1564, 204, 202, 200, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1565, 203,
- 1565, 882, 200, 200, 882, 882, 882, 882,
- 199, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1566, 203, 1566, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1567, 203,
- 1567, 882, 200, 200, 882, 882, 882, 882,
- 199, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1568, 203, 1568, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1569, 203,
- 1569, 882, 200, 200, 882, 882, 882, 882,
- 199, 1570, 1571, 1570, 882, 202, 882, 882,
- 883, 1572, 203, 882, 200, 200, 882, 882,
- 882, 882, 199, 1573, 1574, 1573, 202, 866,
- 1572, 203, 200, 200, 199, 1575, 204, 202,
- 200, 1576, 201, 1576, 202, 866, 1572, 203,
- 200, 200, 199, 1572, 1577, 1572, 890, 1339,
- 890, 890, 891, 203, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 1578, 204, 202,
- 200, 1579, 1580, 1579, 890, 1339, 890, 890,
- 891, 203, 890, 200, 200, 890, 890, 890,
- 890, 890, 199, 1581, 204, 202, 200, 1582,
- 201, 1582, 1339, 203, 200, 200, 199, 1583,
- 204, 202, 200, 880, 881, 880, 882, 202,
- 882, 882, 883, 884, 1584, 203, 1584, 882,
- 200, 200, 882, 882, 882, 882, 199, 880,
- 881, 880, 882, 202, 882, 882, 883, 884,
- 1585, 203, 1585, 882, 200, 200, 882, 882,
- 882, 882, 199, 880, 881, 880, 882, 202,
- 882, 882, 883, 884, 1586, 203, 1586, 882,
- 200, 200, 882, 882, 882, 882, 199, 880,
- 881, 880, 882, 202, 882, 882, 883, 884,
- 1587, 203, 1587, 882, 200, 200, 882, 882,
- 882, 882, 199, 1588, 1589, 1588, 882, 202,
- 882, 882, 883, 1590, 203, 882, 200, 200,
- 882, 882, 882, 882, 199, 1591, 1592, 1591,
- 202, 866, 1590, 203, 200, 200, 199, 1593,
- 204, 202, 200, 1594, 201, 1594, 202, 866,
- 1590, 203, 200, 200, 199, 1595, 1596, 1595,
- 890, 952, 890, 890, 891, 203, 890, 200,
- 200, 890, 890, 890, 890, 890, 199, 1597,
- 204, 202, 200, 1598, 1599, 1598, 890, 952,
- 890, 890, 891, 203, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 1600, 204, 202,
- 200, 1601, 201, 1601, 958, 203, 200, 200,
- 199, 1602, 204, 202, 200, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1603, 203,
- 1603, 882, 200, 200, 882, 882, 882, 882,
- 199, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1604, 203, 1604, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1605, 203,
- 1605, 882, 200, 200, 882, 882, 882, 882,
- 199, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1606, 203, 1606, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1607, 203,
- 1607, 882, 200, 200, 882, 882, 882, 882,
- 199, 1608, 1609, 1608, 882, 202, 882, 882,
- 883, 1610, 203, 882, 200, 200, 882, 882,
- 882, 882, 199, 1611, 1612, 1611, 202, 866,
- 1610, 203, 200, 200, 199, 1613, 204, 202,
- 200, 1614, 201, 1614, 202, 866, 1610, 203,
- 200, 200, 199, 1615, 1616, 1615, 890, 1009,
- 890, 890, 891, 203, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 1617, 204, 202,
- 200, 1618, 1619, 1618, 890, 1009, 890, 890,
- 891, 203, 890, 200, 200, 890, 890, 890,
- 890, 890, 199, 1620, 204, 202, 200, 1621,
- 201, 1621, 1015, 203, 200, 200, 199, 1622,
- 204, 202, 200, 880, 881, 880, 882, 202,
- 882, 882, 883, 884, 1623, 203, 1623, 882,
- 200, 200, 882, 882, 882, 882, 199, 880,
- 881, 880, 882, 202, 882, 882, 883, 884,
- 1624, 203, 1624, 882, 200, 200, 882, 882,
- 882, 882, 199, 1625, 1626, 1625, 882, 202,
- 882, 882, 883, 1627, 203, 882, 200, 200,
- 882, 882, 882, 882, 199, 1628, 1629, 1628,
- 202, 866, 1627, 203, 200, 200, 199, 1630,
- 204, 202, 200, 1631, 201, 1631, 202, 866,
- 1627, 203, 200, 200, 199, 1627, 1632, 1627,
- 890, 202, 890, 890, 891, 203, 890, 200,
- 200, 890, 890, 890, 890, 890, 199, 1633,
- 204, 202, 200, 1634, 201, 1634, 890, 202,
- 890, 890, 891, 203, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 1635, 204, 202,
- 200, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1636, 203, 1636, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1637, 203,
- 1637, 882, 200, 200, 882, 882, 882, 882,
- 199, 880, 881, 880, 882, 202, 882, 882,
- 883, 884, 1638, 203, 1638, 882, 200, 200,
- 882, 882, 882, 882, 199, 880, 881, 880,
- 882, 202, 882, 882, 883, 884, 1639, 203,
- 1639, 882, 200, 200, 882, 882, 882, 882,
- 199, 1640, 1641, 1640, 882, 202, 882, 882,
- 883, 1642, 203, 882, 200, 200, 882, 882,
- 882, 882, 199, 1643, 1644, 1643, 202, 866,
- 1642, 203, 200, 200, 199, 1645, 204, 202,
- 200, 1646, 201, 1646, 202, 866, 1642, 203,
- 200, 200, 199, 1647, 1648, 1647, 890, 1048,
- 890, 890, 891, 203, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 1649, 204, 202,
- 200, 1650, 1651, 1650, 890, 1048, 890, 890,
- 891, 203, 890, 200, 200, 890, 890, 890,
- 890, 890, 199, 1652, 204, 202, 200, 1653,
- 201, 1653, 1054, 203, 200, 200, 199, 1654,
- 204, 202, 200, 880, 881, 880, 882, 202,
- 882, 882, 883, 884, 1655, 203, 1655, 882,
- 200, 200, 882, 882, 882, 882, 199, 880,
- 881, 880, 882, 202, 882, 882, 883, 884,
- 1656, 203, 1656, 882, 200, 200, 882, 882,
- 882, 882, 199, 880, 881, 880, 882, 202,
- 882, 882, 883, 884, 1657, 203, 1657, 882,
- 200, 200, 882, 882, 882, 882, 199, 880,
- 881, 880, 882, 202, 882, 882, 883, 884,
- 1658, 203, 1658, 882, 200, 200, 882, 882,
- 882, 882, 199, 1659, 1660, 1659, 882, 202,
- 882, 882, 883, 1661, 203, 882, 200, 200,
- 882, 882, 882, 882, 199, 1662, 1663, 1662,
- 202, 866, 1661, 203, 200, 200, 199, 1664,
- 204, 202, 200, 1665, 201, 1665, 202, 866,
- 1661, 203, 200, 200, 199, 1661, 1666, 1661,
- 890, 265, 890, 890, 1667, 1668, 891, 203,
- 1667, 1668, 890, 200, 200, 890, 890, 890,
- 890, 890, 199, 1669, 204, 202, 200, 1670,
- 894, 1670, 890, 265, 890, 890, 1667, 1668,
- 891, 203, 1667, 1668, 890, 200, 200, 890,
- 890, 890, 890, 890, 199, 897, 898, 897,
- 890, 202, 890, 890, 883, 1671, 203, 1671,
- 890, 200, 200, 890, 890, 890, 890, 199,
- 897, 898, 897, 890, 202, 890, 890, 883,
- 1672, 203, 1672, 890, 200, 200, 890, 890,
- 890, 890, 199, 897, 898, 897, 890, 202,
- 890, 890, 883, 1673, 203, 1673, 890, 200,
- 200, 890, 890, 890, 890, 199, 897, 898,
- 897, 890, 202, 890, 890, 883, 1674, 203,
- 1674, 890, 200, 200, 890, 890, 890, 890,
- 199, 1675, 1676, 1675, 202, 1677, 203, 200,
- 200, 199, 897, 898, 897, 890, 202, 890,
- 890, 883, 1678, 203, 1678, 890, 200, 200,
- 890, 890, 890, 890, 199, 897, 898, 897,
- 890, 202, 890, 890, 883, 1673, 203, 1673,
- 890, 200, 200, 890, 890, 890, 890, 199,
- 1679, 204, 202, 200, 1680, 26, 21, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 1681, 172, 1681, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 1682, 172, 1682, 691,
- 21, 21, 691, 691, 691, 691, 169, 689,
- 690, 689, 691, 171, 691, 691, 692, 693,
- 1683, 172, 1683, 691, 21, 21, 691, 691,
- 691, 691, 169, 689, 690, 689, 691, 171,
- 691, 691, 692, 693, 1684, 172, 1684, 691,
- 21, 21, 691, 691, 691, 691, 169, 1685,
- 1686, 1685, 691, 171, 691, 691, 692, 1687,
- 172, 691, 21, 21, 691, 691, 691, 691,
- 169, 1688, 1689, 1688, 171, 675, 1687, 172,
- 21, 21, 169, 1690, 26, 21, 1691, 170,
- 1691, 171, 675, 1687, 172, 21, 21, 169,
- 1692, 1693, 1692, 699, 1694, 699, 699, 701,
- 172, 699, 21, 21, 699, 699, 699, 699,
- 699, 169, 1695, 26, 21, 1696, 1697, 1696,
- 699, 1694, 699, 699, 701, 172, 699, 21,
- 21, 699, 699, 699, 699, 699, 169, 1698,
- 26, 21, 1699, 170, 1699, 1700, 172, 21,
- 21, 169, 1701, 1702, 1701, 232, 1703, 233,
- 21, 21, 230, 1704, 26, 21, 689, 690,
- 689, 691, 171, 691, 691, 692, 693, 1705,
- 172, 1705, 691, 21, 21, 691, 691, 691,
- 691, 169, 689, 690, 689, 691, 171, 691,
- 691, 692, 693, 1706, 172, 1706, 691, 21,
- 21, 691, 691, 691, 691, 169, 689, 690,
- 689, 691, 171, 691, 691, 692, 693, 1707,
- 172, 1707, 691, 21, 21, 691, 691, 691,
- 691, 169, 689, 690, 689, 691, 171, 691,
- 691, 692, 693, 1708, 172, 1708, 691, 21,
- 21, 691, 691, 691, 691, 169, 1709, 1710,
- 1709, 691, 171, 691, 691, 692, 1711, 172,
- 691, 21, 21, 691, 691, 691, 691, 169,
- 1712, 1713, 1712, 171, 675, 1711, 172, 21,
- 21, 169, 1714, 26, 21, 1715, 170, 1715,
- 171, 675, 1711, 172, 21, 21, 169, 1711,
- 1716, 1711, 699, 700, 699, 699, 1717, 1718,
- 701, 172, 1717, 1718, 699, 21, 21, 699,
- 699, 699, 699, 699, 169, 1719, 26, 21,
- 1720, 704, 1720, 699, 700, 699, 699, 1717,
- 1718, 701, 172, 1717, 1718, 699, 21, 21,
- 699, 699, 699, 699, 699, 169, 710, 711,
- 710, 699, 171, 699, 699, 692, 1721, 172,
- 1721, 699, 21, 21, 699, 699, 699, 699,
- 169, 710, 711, 710, 699, 171, 699, 699,
- 692, 1722, 172, 1722, 699, 21, 21, 699,
- 699, 699, 699, 169, 710, 711, 710, 699,
- 171, 699, 699, 692, 1723, 172, 1723, 699,
- 21, 21, 699, 699, 699, 699, 169, 710,
- 711, 710, 699, 171, 699, 699, 692, 1724,
- 172, 1724, 699, 21, 21, 699, 699, 699,
- 699, 169, 1725, 1726, 1725, 171, 1727, 172,
- 21, 21, 169, 710, 711, 710, 699, 171,
- 699, 699, 692, 1728, 172, 1728, 699, 21,
- 21, 699, 699, 699, 699, 169, 710, 711,
- 710, 699, 171, 699, 699, 692, 1723, 172,
- 1723, 699, 21, 21, 699, 699, 699, 699,
- 169, 1729, 26, 21, 1730, 26, 21, 516,
- 517, 516, 518, 108, 518, 518, 519, 520,
- 1731, 109, 1731, 518, 21, 21, 518, 518,
- 518, 518, 106, 516, 517, 516, 518, 108,
- 518, 518, 519, 520, 1732, 109, 1732, 518,
- 21, 21, 518, 518, 518, 518, 106, 1733,
- 1734, 1733, 518, 108, 518, 518, 519, 1735,
- 109, 518, 21, 21, 518, 518, 518, 518,
- 106, 1736, 1737, 1736, 108, 499, 1735, 109,
- 21, 21, 106, 1738, 26, 21, 1739, 107,
- 1739, 108, 499, 1735, 109, 21, 21, 106,
- 1735, 1740, 1735, 526, 1741, 526, 526, 528,
- 109, 526, 21, 21, 526, 526, 526, 526,
- 526, 106, 1742, 26, 21, 1743, 1744, 1743,
- 526, 1741, 526, 526, 528, 109, 526, 21,
- 21, 526, 526, 526, 526, 526, 106, 1745,
- 26, 21, 1746, 107, 1746, 1741, 109, 21,
- 21, 106, 1747, 1748, 1747, 197, 1749, 198,
- 195, 195, 194, 1750, 26, 21, 516, 517,
- 516, 518, 108, 518, 518, 519, 520, 1751,
- 109, 1751, 518, 21, 21, 518, 518, 518,
- 518, 106, 516, 517, 516, 518, 108, 518,
- 518, 519, 520, 1752, 109, 1752, 518, 21,
- 21, 518, 518, 518, 518, 106, 516, 517,
- 516, 518, 108, 518, 518, 519, 520, 1753,
- 109, 1753, 518, 21, 21, 518, 518, 518,
- 518, 106, 516, 517, 516, 518, 108, 518,
- 518, 519, 520, 1754, 109, 1754, 518, 21,
- 21, 518, 518, 518, 518, 106, 1755, 1756,
- 1755, 518, 108, 518, 518, 519, 1757, 109,
- 518, 21, 21, 518, 518, 518, 518, 106,
- 1758, 1759, 1758, 108, 499, 1757, 109, 21,
- 21, 106, 1760, 26, 21, 1761, 107, 1761,
- 108, 499, 1757, 109, 21, 21, 106, 1762,
- 1763, 1762, 526, 1764, 526, 526, 528, 109,
- 526, 21, 21, 526, 526, 526, 526, 526,
- 106, 1765, 26, 21, 1766, 1767, 1766, 526,
- 1764, 526, 526, 528, 109, 526, 21, 21,
- 526, 526, 526, 526, 526, 106, 1768, 26,
- 21, 1769, 107, 1769, 1770, 109, 21, 21,
- 106, 1771, 1772, 1771, 232, 1773, 233, 21,
- 21, 230, 1774, 26, 21, 516, 517, 516,
- 518, 108, 518, 518, 519, 520, 1775, 109,
- 1775, 518, 21, 21, 518, 518, 518, 518,
- 106, 516, 517, 516, 518, 108, 518, 518,
- 519, 520, 1776, 109, 1776, 518, 21, 21,
- 518, 518, 518, 518, 106, 516, 517, 516,
- 518, 108, 518, 518, 519, 520, 1777, 109,
- 1777, 518, 21, 21, 518, 518, 518, 518,
- 106, 516, 517, 516, 518, 108, 518, 518,
- 519, 520, 1778, 109, 1778, 518, 21, 21,
- 518, 518, 518, 518, 106, 1779, 1780, 1779,
- 518, 108, 518, 518, 519, 1781, 109, 518,
- 21, 21, 518, 518, 518, 518, 106, 1782,
- 1783, 1782, 108, 499, 1781, 109, 21, 21,
- 106, 1784, 26, 21, 1785, 107, 1785, 108,
- 499, 1781, 109, 21, 21, 106, 1781, 1786,
- 1781, 526, 527, 526, 526, 1787, 1788, 528,
- 109, 1787, 1788, 526, 21, 21, 526, 526,
- 526, 526, 526, 106, 1789, 26, 21, 1790,
- 531, 1790, 526, 527, 526, 526, 1787, 1788,
- 528, 109, 1787, 1788, 526, 21, 21, 526,
- 526, 526, 526, 526, 106, 537, 538, 537,
- 526, 108, 526, 526, 519, 1791, 109, 1791,
- 526, 21, 21, 526, 526, 526, 526, 106,
- 537, 538, 537, 526, 108, 526, 526, 519,
- 1792, 109, 1792, 526, 21, 21, 526, 526,
- 526, 526, 106, 537, 538, 537, 526, 108,
- 526, 526, 519, 1793, 109, 1793, 526, 21,
- 21, 526, 526, 526, 526, 106, 537, 538,
- 537, 526, 108, 526, 526, 519, 1794, 109,
- 1794, 526, 21, 21, 526, 526, 526, 526,
- 106, 1795, 1796, 1795, 108, 1797, 109, 21,
- 21, 106, 537, 538, 537, 526, 108, 526,
- 526, 519, 1798, 109, 1798, 526, 21, 21,
- 526, 526, 526, 526, 106, 537, 538, 537,
- 526, 108, 526, 526, 519, 1793, 109, 1793,
- 526, 21, 21, 526, 526, 526, 526, 106,
- 1799, 26, 21, 1800, 398, 396, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 1801, 1801, 440, 440, 440, 440, 440, 394,
- 438, 439, 438, 440, 396, 440, 440, 441,
- 442, 1802, 1802, 440, 440, 440, 440, 440,
- 394, 438, 439, 438, 440, 396, 440, 440,
- 441, 442, 1803, 1803, 440, 440, 440, 440,
- 440, 394, 438, 439, 438, 440, 396, 440,
- 440, 441, 442, 1804, 1804, 440, 440, 440,
- 440, 440, 394, 1805, 1806, 1805, 440, 396,
- 440, 440, 441, 1807, 440, 440, 440, 440,
- 440, 394, 1808, 1809, 1808, 396, 445, 1807,
- 394, 1810, 398, 396, 394, 1811, 398, 1811,
- 396, 445, 1807, 394, 1807, 1812, 1807, 463,
- 396, 463, 463, 464, 463, 463, 463, 463,
- 463, 463, 394, 1813, 398, 396, 394, 1814,
- 398, 1814, 463, 396, 463, 463, 464, 463,
- 463, 463, 463, 463, 463, 394, 1815, 398,
- 396, 394, 438, 439, 438, 440, 396, 440,
- 440, 441, 442, 1816, 1816, 440, 440, 440,
- 440, 440, 394, 438, 439, 438, 440, 396,
- 440, 440, 441, 442, 1817, 1817, 440, 440,
- 440, 440, 440, 394, 438, 439, 438, 440,
- 396, 440, 440, 441, 442, 1818, 1818, 440,
- 440, 440, 440, 440, 394, 438, 439, 438,
- 440, 396, 440, 440, 441, 442, 1819, 1819,
- 440, 440, 440, 440, 440, 394, 438, 439,
- 438, 440, 396, 440, 440, 441, 442, 1820,
- 1820, 440, 440, 440, 440, 440, 394, 438,
- 439, 438, 440, 396, 440, 440, 441, 442,
- 1821, 1821, 440, 440, 440, 440, 440, 394,
- 438, 439, 438, 440, 396, 440, 440, 441,
- 442, 1822, 1822, 440, 440, 440, 440, 440,
- 394, 1823, 1824, 1823, 440, 396, 440, 440,
- 441, 1825, 440, 440, 440, 440, 440, 394,
- 1826, 1827, 1826, 396, 445, 1825, 394, 1828,
- 398, 396, 394, 1829, 398, 1829, 396, 445,
- 1825, 394, 1825, 1830, 1825, 1831, 401, 1831,
- 1831, 464, 1831, 1831, 1831, 1831, 1831, 1831,
- 394, 1832, 398, 396, 394, 1833, 467, 1833,
- 1831, 401, 1831, 1831, 464, 1831, 1831, 1831,
- 1831, 1831, 1831, 394, 1834, 1835, 1834, 1836,
- 396, 1836, 1836, 1837, 1836, 1836, 1836, 1836,
- 1836, 394, 1838, 398, 396, 394, 395, 396,
- 1840, 397, 394, 394, 394, 1839, 1839, 1839,
- 393, 395, 396, 1842, 397, 1843, 394, 394,
- 394, 1841, 1841, 1841, 393, 395, 396, 1842,
- 397, 1843, 394, 394, 394, 1844, 1844, 1844,
- 393, 395, 396, 1842, 397, 1843, 394, 394,
- 394, 1845, 1845, 1845, 393, 395, 396, 1842,
- 397, 1843, 394, 394, 394, 393, 395, 396,
- 1847, 397, 394, 394, 394, 1846, 1839, 1839,
- 393, 395, 396, 1848, 1842, 397, 1843, 394,
- 394, 394, 1849, 1841, 1841, 393, 395, 396,
- 397, 394, 394, 394, 1850, 393, 395, 396,
- 1851, 397, 394, 394, 394, 1852, 393, 395,
- 396, 397, 394, 394, 394, 1853, 393, 395,
- 396, 1854, 397, 394, 394, 394, 1855, 393,
- 395, 396, 397, 394, 394, 394, 1856, 393,
- 395, 396, 397, 1843, 394, 394, 394, 1857,
- 393, 395, 396, 397, 1843, 394, 394, 394,
- 1858, 393, 395, 396, 397, 1843, 394, 394,
- 394, 393, 435, 436, 435, 396, 421, 397,
- 394, 394, 393, 395, 396, 1854, 397, 394,
- 394, 394, 1859, 393, 395, 396, 1854, 397,
- 394, 394, 394, 393, 395, 396, 1851, 397,
- 394, 394, 394, 1860, 393, 395, 396, 1851,
- 397, 394, 394, 394, 393, 395, 396, 1848,
- 1842, 397, 1843, 394, 394, 394, 1861, 1844,
- 1844, 393, 395, 396, 1848, 1842, 397, 1843,
- 394, 394, 394, 1845, 1845, 1845, 393, 395,
- 396, 1863, 397, 1843, 394, 394, 394, 1862,
- 1862, 1862, 393, 395, 396, 1865, 397, 1843,
- 394, 394, 394, 1864, 1864, 1864, 393, 395,
- 396, 1865, 397, 1843, 394, 394, 394, 1866,
- 1866, 1866, 393, 395, 396, 1865, 397, 1843,
- 394, 394, 394, 1867, 1867, 1867, 393, 395,
- 396, 1865, 397, 1843, 394, 394, 394, 393,
- 395, 396, 397, 394, 394, 394, 1868, 1862,
- 1862, 393, 395, 396, 1848, 1865, 397, 1843,
- 394, 394, 394, 1869, 1864, 1864, 393, 395,
- 396, 1848, 1865, 397, 1843, 394, 394, 394,
- 1870, 1866, 1866, 393, 395, 396, 1848, 1865,
- 397, 1843, 394, 394, 394, 1867, 1867, 1867,
- 393, 395, 396, 397, 394, 394, 394, 1871,
- 393, 395, 396, 1848, 397, 394, 394, 394,
- 1872, 393, 395, 396, 1848, 397, 394, 394,
- 394, 1873, 393, 395, 396, 1848, 397, 394,
- 394, 394, 393, 395, 396, 1847, 397, 394,
- 394, 394, 393, 1874, 398, 396, 394, 418,
- 419, 418, 420, 396, 420, 420, 421, 422,
- 1875, 397, 1875, 420, 394, 394, 420, 420,
- 420, 420, 393, 418, 419, 418, 420, 396,
- 420, 420, 421, 422, 1876, 397, 1876, 420,
- 394, 394, 420, 420, 420, 420, 393, 418,
- 419, 418, 420, 396, 420, 420, 421, 422,
- 1877, 397, 1877, 420, 394, 394, 420, 420,
- 420, 420, 393, 418, 419, 418, 420, 396,
- 420, 420, 421, 422, 1878, 397, 1878, 420,
- 394, 394, 420, 420, 420, 420, 393, 418,
- 419, 418, 420, 396, 420, 420, 421, 422,
- 1879, 397, 1879, 420, 394, 394, 420, 420,
- 420, 420, 393, 418, 419, 418, 420, 396,
- 420, 420, 421, 422, 1880, 397, 1880, 420,
- 394, 394, 420, 420, 420, 420, 393, 418,
- 419, 418, 420, 396, 420, 420, 421, 422,
- 1881, 397, 1881, 420, 394, 394, 420, 420,
- 420, 420, 393, 418, 419, 418, 420, 396,
- 420, 420, 421, 422, 1882, 397, 1882, 420,
- 394, 394, 420, 420, 420, 420, 393, 1883,
- 1884, 1883, 420, 396, 420, 420, 421, 1885,
- 397, 420, 394, 394, 420, 420, 420, 420,
- 393, 1886, 1887, 1886, 396, 404, 1885, 397,
- 394, 394, 393, 1888, 398, 396, 394, 1889,
- 395, 1889, 396, 404, 1885, 397, 394, 394,
- 393, 1885, 1890, 1885, 1891, 401, 1891, 1891,
- 429, 397, 1891, 394, 394, 1891, 1891, 1891,
- 1891, 1891, 393, 1892, 398, 396, 394, 1893,
- 432, 1893, 1891, 401, 1891, 1891, 429, 397,
- 1891, 394, 394, 1891, 1891, 1891, 1891, 1891,
- 393, 1894, 1895, 1894, 1896, 396, 1896, 1896,
- 1897, 397, 1896, 394, 394, 1896, 1896, 1896,
- 1896, 393, 1898, 398, 396, 394, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1899,
- 397, 1899, 420, 394, 394, 420, 420, 420,
- 420, 393, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1900, 397, 1900, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1901,
- 397, 1901, 420, 394, 394, 420, 420, 420,
- 420, 393, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1902, 397, 1902, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1903,
- 397, 1903, 420, 394, 394, 420, 420, 420,
- 420, 393, 1904, 1905, 1904, 420, 396, 420,
- 420, 421, 1906, 397, 420, 394, 394, 420,
- 420, 420, 420, 393, 1907, 1908, 1907, 396,
- 404, 1906, 397, 394, 394, 393, 1909, 398,
- 396, 394, 1910, 395, 1910, 396, 404, 1906,
- 397, 394, 394, 393, 1906, 1911, 1906, 428,
- 396, 428, 428, 429, 397, 428, 394, 394,
- 428, 428, 428, 428, 428, 393, 1912, 398,
- 396, 394, 1913, 395, 1913, 428, 396, 428,
- 428, 429, 397, 428, 394, 394, 428, 428,
- 428, 428, 428, 393, 1914, 398, 396, 394,
- 418, 419, 418, 420, 396, 420, 420, 421,
- 422, 1915, 397, 1915, 420, 394, 394, 420,
- 420, 420, 420, 393, 418, 419, 418, 420,
- 396, 420, 420, 421, 422, 1916, 397, 1916,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 418, 419, 418, 420, 396, 420, 420, 421,
- 422, 1917, 397, 1917, 420, 394, 394, 420,
- 420, 420, 420, 393, 418, 419, 418, 420,
- 396, 420, 420, 421, 422, 1918, 397, 1918,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 1919, 1920, 1919, 420, 396, 420, 420, 421,
- 1921, 397, 420, 394, 394, 420, 420, 420,
- 420, 393, 1922, 1923, 1922, 396, 404, 1921,
- 397, 394, 394, 393, 1924, 398, 396, 394,
- 1925, 395, 1925, 396, 404, 1921, 397, 394,
- 394, 393, 1926, 1927, 1926, 428, 490, 428,
- 428, 429, 397, 428, 394, 394, 428, 428,
- 428, 428, 428, 393, 1928, 398, 396, 394,
- 1929, 1930, 1929, 428, 490, 428, 428, 429,
- 397, 428, 394, 394, 428, 428, 428, 428,
- 428, 393, 1931, 398, 396, 394, 1932, 395,
- 1932, 496, 397, 394, 394, 393, 1933, 398,
- 396, 394, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1934, 397, 1934, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1935,
- 397, 1935, 420, 394, 394, 420, 420, 420,
- 420, 393, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1936, 397, 1936, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1937,
- 397, 1937, 420, 394, 394, 420, 420, 420,
- 420, 393, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1938, 397, 1938, 420, 394,
- 394, 420, 420, 420, 420, 393, 1939, 1940,
- 1939, 420, 396, 420, 420, 421, 1941, 397,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 1942, 1943, 1942, 396, 404, 1941, 397, 394,
- 394, 393, 1944, 398, 396, 394, 1945, 395,
- 1945, 396, 404, 1941, 397, 394, 394, 393,
- 1946, 1947, 1946, 428, 1367, 428, 428, 429,
- 397, 428, 394, 394, 428, 428, 428, 428,
- 428, 393, 1948, 398, 396, 394, 1949, 1950,
- 1949, 428, 1367, 428, 428, 429, 397, 428,
- 394, 394, 428, 428, 428, 428, 428, 393,
- 1951, 398, 396, 394, 1952, 395, 1952, 1373,
- 397, 394, 394, 393, 1953, 398, 396, 394,
- 418, 419, 418, 420, 396, 420, 420, 421,
- 422, 1954, 397, 1954, 420, 394, 394, 420,
- 420, 420, 420, 393, 418, 419, 418, 420,
- 396, 420, 420, 421, 422, 1955, 397, 1955,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 1956, 1957, 1956, 420, 396, 420, 420, 421,
- 1958, 397, 420, 394, 394, 420, 420, 420,
- 420, 393, 1959, 1960, 1959, 396, 404, 1958,
- 397, 394, 394, 393, 1961, 398, 396, 394,
- 1962, 395, 1962, 396, 404, 1958, 397, 394,
- 394, 393, 1958, 1963, 1958, 428, 1420, 428,
- 428, 429, 397, 428, 394, 394, 428, 428,
- 428, 428, 428, 393, 1964, 398, 396, 394,
- 1965, 1966, 1965, 428, 1420, 428, 428, 429,
- 397, 428, 394, 394, 428, 428, 428, 428,
- 428, 393, 1967, 398, 396, 394, 1968, 395,
- 1968, 1420, 397, 394, 394, 393, 1969, 398,
- 396, 394, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1970, 397, 1970, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1971,
- 397, 1971, 420, 394, 394, 420, 420, 420,
- 420, 393, 418, 419, 418, 420, 396, 420,
- 420, 421, 422, 1972, 397, 1972, 420, 394,
- 394, 420, 420, 420, 420, 393, 418, 419,
- 418, 420, 396, 420, 420, 421, 422, 1973,
- 397, 1973, 420, 394, 394, 420, 420, 420,
- 420, 393, 1974, 1975, 1974, 420, 396, 420,
- 420, 421, 1976, 397, 420, 394, 394, 420,
- 420, 420, 420, 393, 1977, 1978, 1977, 396,
- 404, 1976, 397, 394, 394, 393, 1979, 398,
- 396, 394, 1980, 395, 1980, 396, 404, 1976,
- 397, 394, 394, 393, 1981, 1982, 1981, 428,
- 1448, 428, 428, 429, 397, 428, 394, 394,
- 428, 428, 428, 428, 428, 393, 1983, 398,
- 396, 394, 1984, 1985, 1984, 428, 1448, 428,
- 428, 429, 397, 428, 394, 394, 428, 428,
- 428, 428, 428, 393, 1986, 398, 396, 394,
- 1987, 395, 1987, 1454, 397, 394, 394, 393,
- 1988, 398, 396, 394, 418, 419, 418, 420,
- 396, 420, 420, 421, 422, 1989, 397, 1989,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 418, 419, 418, 420, 396, 420, 420, 421,
- 422, 1990, 397, 1990, 420, 394, 394, 420,
- 420, 420, 420, 393, 418, 419, 418, 420,
- 396, 420, 420, 421, 422, 1991, 397, 1991,
- 420, 394, 394, 420, 420, 420, 420, 393,
- 418, 419, 418, 420, 396, 420, 420, 421,
- 422, 1992, 397, 1992, 420, 394, 394, 420,
- 420, 420, 420, 393, 1993, 1994, 1993, 420,
- 396, 420, 420, 421, 1995, 397, 420, 394,
- 394, 420, 420, 420, 420, 393, 1996, 1997,
- 1996, 396, 404, 1995, 397, 394, 394, 393,
- 1998, 398, 396, 394, 1999, 395, 1999, 396,
- 404, 1995, 397, 394, 394, 393, 1995, 2000,
- 1995, 428, 401, 428, 428, 2001, 2002, 429,
- 397, 2001, 2002, 428, 394, 394, 428, 428,
- 428, 428, 428, 393, 2003, 398, 396, 394,
- 2004, 432, 2004, 428, 401, 428, 428, 2001,
- 2002, 429, 397, 2001, 2002, 428, 394, 394,
- 428, 428, 428, 428, 428, 393, 435, 436,
- 435, 428, 396, 428, 428, 421, 2005, 397,
- 2005, 428, 394, 394, 428, 428, 428, 428,
- 393, 435, 436, 435, 428, 396, 428, 428,
- 421, 2006, 397, 2006, 428, 394, 394, 428,
- 428, 428, 428, 393, 435, 436, 435, 428,
- 396, 428, 428, 421, 2007, 397, 2007, 428,
- 394, 394, 428, 428, 428, 428, 393, 435,
- 436, 435, 428, 396, 428, 428, 421, 2008,
- 397, 2008, 428, 394, 394, 428, 428, 428,
- 428, 393, 2009, 2010, 2009, 396, 2011, 397,
- 394, 394, 393, 435, 436, 435, 428, 396,
- 428, 428, 421, 2012, 397, 2012, 428, 394,
- 394, 428, 428, 428, 428, 393, 435, 436,
- 435, 428, 396, 428, 428, 421, 2007, 397,
- 2007, 428, 394, 394, 428, 428, 428, 428,
- 393, 2013, 398, 396, 394, 2014, 26, 21,
- 285, 286, 285, 287, 77, 287, 287, 288,
- 289, 2015, 78, 2015, 287, 21, 21, 287,
- 287, 287, 287, 69, 285, 286, 285, 287,
- 77, 287, 287, 288, 289, 2016, 78, 2016,
- 287, 21, 21, 287, 287, 287, 287, 69,
- 285, 286, 285, 287, 77, 287, 287, 288,
- 289, 2017, 78, 2017, 287, 21, 21, 287,
- 287, 287, 287, 69, 285, 286, 285, 287,
- 77, 287, 287, 288, 289, 2018, 78, 2018,
- 287, 21, 21, 287, 287, 287, 287, 69,
- 2019, 2020, 2019, 287, 77, 287, 287, 288,
- 2021, 78, 287, 21, 21, 287, 287, 287,
- 287, 69, 2022, 2023, 2022, 77, 268, 2021,
- 78, 21, 21, 69, 2024, 26, 21, 2025,
- 76, 2025, 77, 268, 2021, 78, 21, 21,
- 69, 2026, 2027, 2026, 295, 2028, 295, 295,
- 297, 78, 295, 21, 21, 295, 295, 295,
- 295, 295, 69, 2029, 26, 21, 2030, 2031,
- 2030, 295, 2028, 295, 295, 297, 78, 295,
- 21, 21, 295, 295, 295, 295, 295, 69,
- 2032, 26, 21, 2033, 76, 2033, 546, 78,
- 21, 21, 69, 2034, 26, 21, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 2035,
- 78, 2035, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 2036, 78, 2036, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 2037,
- 78, 2037, 287, 21, 21, 287, 287, 287,
- 287, 69, 285, 286, 285, 287, 77, 287,
- 287, 288, 289, 2038, 78, 2038, 287, 21,
- 21, 287, 287, 287, 287, 69, 285, 286,
- 285, 287, 77, 287, 287, 288, 289, 2039,
- 78, 2039, 287, 21, 21, 287, 287, 287,
- 287, 69, 2040, 2041, 2040, 287, 77, 287,
- 287, 288, 2042, 78, 287, 21, 21, 287,
- 287, 287, 287, 69, 2043, 2044, 2043, 77,
- 268, 2042, 78, 21, 21, 69, 2045, 26,
- 21, 2046, 76, 2046, 77, 268, 2042, 78,
- 21, 21, 69, 2047, 2048, 2047, 295, 2049,
- 295, 295, 297, 78, 295, 21, 21, 295,
- 295, 295, 295, 295, 69, 2050, 26, 21,
- 2051, 2052, 2051, 295, 2049, 295, 295, 297,
- 78, 295, 21, 21, 295, 295, 295, 295,
- 295, 69, 2053, 26, 21, 2054, 76, 2054,
- 717, 78, 21, 21, 69, 2055, 26, 21,
- 285, 286, 285, 287, 77, 287, 287, 288,
- 289, 2056, 78, 2056, 287, 21, 21, 287,
- 287, 287, 287, 69, 285, 286, 285, 287,
- 77, 287, 287, 288, 289, 2057, 78, 2057,
- 287, 21, 21, 287, 287, 287, 287, 69,
- 2058, 2059, 2058, 287, 77, 287, 287, 288,
- 2060, 78, 287, 21, 21, 287, 287, 287,
- 287, 69, 2061, 2062, 2061, 77, 268, 2060,
- 78, 21, 21, 69, 2063, 26, 21, 2064,
- 76, 2064, 77, 268, 2060, 78, 21, 21,
- 69, 2060, 2065, 2060, 295, 2066, 295, 295,
- 297, 78, 295, 21, 21, 295, 295, 295,
- 295, 295, 69, 2067, 26, 21, 2068, 2069,
- 2068, 295, 2066, 295, 295, 297, 78, 295,
- 21, 21, 295, 295, 295, 295, 295, 69,
- 2070, 26, 21, 2071, 76, 2071, 2066, 78,
- 21, 21, 69, 2072, 2073, 2072, 197, 2074,
- 198, 195, 195, 194, 2075, 26, 21, 285,
- 286, 285, 287, 77, 287, 287, 288, 289,
- 2076, 78, 2076, 287, 21, 21, 287, 287,
- 287, 287, 69, 285, 286, 285, 287, 77,
- 287, 287, 288, 289, 2077, 78, 2077, 287,
- 21, 21, 287, 287, 287, 287, 69, 285,
- 286, 285, 287, 77, 287, 287, 288, 289,
- 2078, 78, 2078, 287, 21, 21, 287, 287,
- 287, 287, 69, 285, 286, 285, 287, 77,
- 287, 287, 288, 289, 2079, 78, 2079, 287,
- 21, 21, 287, 287, 287, 287, 69, 2080,
- 2081, 2080, 287, 77, 287, 287, 288, 2082,
- 78, 287, 21, 21, 287, 287, 287, 287,
- 69, 2083, 2084, 2083, 77, 268, 2082, 78,
- 21, 21, 69, 2085, 26, 21, 2086, 76,
- 2086, 77, 268, 2082, 78, 21, 21, 69,
- 2087, 2088, 2087, 295, 2089, 295, 295, 297,
- 78, 295, 21, 21, 295, 295, 295, 295,
- 295, 69, 2090, 26, 21, 2091, 2092, 2091,
- 295, 2089, 295, 295, 297, 78, 295, 21,
- 21, 295, 295, 295, 295, 295, 69, 2093,
- 26, 21, 2094, 76, 2094, 1104, 78, 21,
- 21, 69, 2095, 26, 21, 285, 286, 285,
- 287, 77, 287, 287, 288, 289, 2096, 78,
- 2096, 287, 21, 21, 287, 287, 287, 287,
- 69, 285, 286, 285, 287, 77, 287, 287,
- 288, 289, 2097, 78, 2097, 287, 21, 21,
- 287, 287, 287, 287, 69, 285, 286, 285,
- 287, 77, 287, 287, 288, 289, 2098, 78,
- 2098, 287, 21, 21, 287, 287, 287, 287,
- 69, 285, 286, 285, 287, 77, 287, 287,
- 288, 289, 2099, 78, 2099, 287, 21, 21,
- 287, 287, 287, 287, 69, 2100, 2101, 2100,
- 287, 77, 287, 287, 288, 2102, 78, 287,
- 21, 21, 287, 287, 287, 287, 69, 2103,
- 2104, 2103, 77, 268, 2102, 78, 21, 21,
- 69, 2105, 26, 21, 2106, 76, 2106, 77,
- 268, 2102, 78, 21, 21, 69, 2102, 2107,
- 2102, 295, 296, 295, 295, 2108, 2109, 297,
- 78, 2108, 2109, 295, 21, 21, 295, 295,
- 295, 295, 295, 69, 2110, 26, 21, 2111,
- 300, 2111, 295, 296, 295, 295, 2108, 2109,
- 297, 78, 2108, 2109, 295, 21, 21, 295,
- 295, 295, 295, 295, 69, 303, 304, 303,
- 295, 77, 295, 295, 288, 2112, 78, 2112,
- 295, 21, 21, 295, 295, 295, 295, 69,
- 303, 304, 303, 295, 77, 295, 295, 288,
- 2113, 78, 2113, 295, 21, 21, 295, 295,
- 295, 295, 69, 303, 304, 303, 295, 77,
- 295, 295, 288, 2114, 78, 2114, 295, 21,
- 21, 295, 295, 295, 295, 69, 303, 304,
- 303, 295, 77, 295, 295, 288, 2115, 78,
- 2115, 295, 21, 21, 295, 295, 295, 295,
- 69, 2116, 2117, 2116, 77, 2118, 78, 21,
- 21, 69, 303, 304, 303, 295, 77, 295,
- 295, 288, 2119, 78, 2119, 295, 21, 21,
- 295, 295, 295, 295, 69, 303, 304, 303,
- 295, 77, 295, 295, 288, 2114, 78, 2114,
- 295, 21, 21, 295, 295, 295, 295, 69,
- 2120, 26, 21, 2121, 26, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2122, 2122,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2123, 2123,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2124, 2124,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2125, 2125,
- 51, 51, 51, 51, 51, 21, 2126, 2127,
- 2126, 51, 51, 51, 52, 2128, 51, 51,
- 51, 51, 51, 21, 2129, 2130, 2129, 56,
- 2128, 21, 2131, 26, 21, 2132, 26, 2132,
- 56, 2128, 21, 2128, 2133, 2128, 68, 2134,
- 68, 68, 70, 68, 68, 68, 68, 68,
- 68, 21, 2135, 26, 21, 2136, 2137, 2136,
- 68, 2134, 68, 68, 70, 68, 68, 68,
- 68, 68, 68, 21, 2138, 26, 21, 2139,
- 26, 2139, 2134, 21, 2140, 390, 392, 387,
- 387, 387, 386, 2141, 26, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2142, 2142,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2143, 2143,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2144, 2144,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2145, 2145,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2146, 2146,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2147, 2147,
- 51, 51, 51, 51, 51, 21, 49, 50,
- 49, 51, 51, 51, 52, 53, 2148, 2148,
- 51, 51, 51, 51, 51, 21, 2149, 2150,
- 2149, 51, 51, 51, 52, 2151, 51, 51,
- 51, 51, 51, 21, 2152, 2153, 2152, 56,
- 2151, 21, 2154, 26, 21, 2155, 26, 2155,
- 56, 2151, 21, 2151, 2156, 2151, 2157, 69,
- 2157, 2157, 70, 2157, 2157, 2157, 2157, 2157,
- 2157, 21, 2158, 26, 21, 2159, 73, 2159,
- 2157, 69, 2157, 2157, 70, 2157, 2157, 2157,
- 2157, 2157, 2157, 21, 2160, 2161, 2160, 2162,
- 2162, 2162, 2163, 2162, 2162, 2162, 2162, 2162,
- 21, 2164, 26, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2165, 2165, 51, 51,
- 51, 51, 51, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2166, 2166, 51, 51,
- 51, 51, 51, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2167, 2167, 51, 51,
- 51, 51, 51, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2168, 2168, 51, 51,
- 51, 51, 51, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2169, 2169, 51, 51,
- 51, 51, 51, 21, 2170, 2171, 2170, 51,
- 51, 51, 52, 2172, 51, 51, 51, 51,
- 51, 21, 2173, 2174, 2173, 56, 2172, 21,
- 2175, 26, 21, 2176, 26, 2176, 56, 2172,
- 21, 2172, 2177, 2172, 68, 2178, 68, 68,
- 70, 68, 68, 68, 68, 68, 68, 21,
- 2179, 26, 21, 2180, 2181, 2180, 68, 2178,
- 68, 68, 70, 68, 68, 68, 68, 68,
- 68, 21, 2182, 26, 21, 2183, 26, 2183,
- 2178, 21, 2185, 390, 2186, 387, 387, 387,
- 2184, 2188, 396, 2189, 394, 394, 394, 2187,
- 2190, 398, 396, 394, 398, 2191, 2187, 2187,
- 394, 2192, 2193, 2192, 77, 2194, 78, 21,
- 21, 69, 2195, 26, 21, 2196, 2197, 2196,
- 77, 2194, 78, 21, 21, 69, 2198, 26,
- 21, 2199, 76, 2199, 77, 2194, 78, 21,
- 21, 69, 2194, 2200, 2194, 2201, 77, 2201,
- 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208,
- 78, 2202, 2203, 2204, 2205, 2206, 2207, 2208,
- 2201, 21, 21, 2201, 2201, 2201, 2201, 2201,
- 69, 2209, 26, 21, 2210, 76, 2210, 2201,
- 77, 2201, 2201, 2202, 2203, 2204, 2205, 2206,
- 2207, 2208, 78, 2202, 2203, 2204, 2205, 2206,
- 2207, 2208, 2201, 21, 21, 2201, 2201, 2201,
- 2201, 2201, 69, 2211, 2212, 2211, 2213, 77,
- 2213, 2213, 2214, 2215, 78, 2213, 21, 21,
- 2213, 2213, 2213, 2213, 69, 2216, 2217, 2216,
- 77, 2194, 2215, 78, 21, 21, 69, 2218,
- 26, 21, 2219, 76, 2219, 77, 2194, 2215,
- 78, 21, 21, 69, 2215, 2220, 2215, 2221,
- 296, 2221, 2221, 2222, 78, 2221, 21, 21,
- 2221, 2221, 2221, 2221, 2221, 69, 2223, 26,
- 21, 2224, 300, 2224, 2221, 296, 2221, 2221,
- 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
- 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
- 2221, 2221, 2214, 78, 2221, 21, 21, 2221,
- 2221, 2221, 2221, 69, 2227, 2228, 2227, 77,
- 2194, 78, 21, 21, 69, 2229, 26, 21,
- 76, 77, 2231, 78, 21, 21, 21, 2230,
- 2230, 2230, 69, 76, 77, 2233, 78, 2234,
- 21, 21, 21, 2232, 2232, 2232, 69, 76,
- 77, 2233, 78, 2234, 21, 21, 21, 2235,
- 2235, 2235, 69, 76, 77, 2233, 78, 2234,
- 21, 21, 21, 2236, 2236, 2236, 69, 76,
- 77, 2233, 78, 2234, 21, 21, 21, 69,
- 76, 77, 2238, 78, 21, 21, 21, 2237,
- 2230, 2230, 69, 76, 77, 2239, 2233, 78,
- 2234, 21, 21, 21, 2240, 2232, 2232, 69,
- 76, 77, 78, 21, 21, 21, 2241, 69,
- 76, 77, 2242, 78, 21, 21, 21, 2243,
- 69, 76, 77, 78, 21, 21, 21, 2244,
- 69, 76, 77, 2245, 78, 21, 21, 21,
- 2246, 69, 76, 77, 78, 21, 21, 21,
- 2247, 69, 76, 77, 78, 2234, 21, 21,
- 21, 2248, 69, 76, 77, 78, 2234, 21,
- 21, 21, 2249, 69, 76, 77, 78, 2234,
- 21, 21, 21, 69, 2225, 2226, 2225, 77,
- 2214, 78, 21, 21, 69, 76, 77, 2245,
- 78, 21, 21, 21, 2250, 69, 76, 77,
- 2245, 78, 21, 21, 21, 69, 76, 77,
- 2242, 78, 21, 21, 21, 2251, 69, 76,
- 77, 2242, 78, 21, 21, 21, 69, 76,
- 77, 2239, 2233, 78, 2234, 21, 21, 21,
- 2252, 2235, 2235, 69, 76, 77, 2239, 2233,
- 78, 2234, 21, 21, 21, 2236, 2236, 2236,
- 69, 76, 77, 2254, 78, 2234, 21, 21,
- 21, 2253, 2253, 2253, 69, 76, 77, 2256,
- 78, 2234, 21, 21, 21, 2255, 2255, 2255,
- 69, 76, 77, 2256, 78, 2234, 21, 21,
- 21, 2257, 2257, 2257, 69, 76, 77, 2256,
- 78, 2234, 21, 21, 21, 2258, 2258, 2258,
- 69, 76, 77, 2256, 78, 2234, 21, 21,
- 21, 69, 76, 77, 78, 21, 21, 21,
- 2259, 2253, 2253, 69, 76, 77, 2239, 2256,
- 78, 2234, 21, 21, 21, 2260, 2255, 2255,
- 69, 76, 77, 2239, 2256, 78, 2234, 21,
- 21, 21, 2261, 2257, 2257, 69, 76, 77,
- 2239, 2256, 78, 2234, 21, 21, 21, 2258,
- 2258, 2258, 69, 76, 77, 78, 21, 21,
- 21, 2262, 69, 76, 77, 2239, 78, 21,
- 21, 21, 2263, 69, 76, 77, 2239, 78,
- 21, 21, 21, 2264, 69, 76, 77, 2239,
- 78, 21, 21, 21, 69, 76, 77, 2238,
- 78, 21, 21, 21, 69, 2265, 26, 21,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2266, 78, 2266, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2267, 78, 2267,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2268, 78, 2268, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2269, 78, 2269,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2270, 78, 2270, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2271, 78, 2271,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2272, 78, 2272, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2273, 78, 2273,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2274, 2275, 2274, 2213, 77, 2213, 2213, 2214,
- 2276, 78, 2213, 21, 21, 2213, 2213, 2213,
- 2213, 69, 2277, 2278, 2277, 77, 2194, 2276,
- 78, 21, 21, 69, 2279, 26, 21, 2280,
- 76, 2280, 77, 2194, 2276, 78, 21, 21,
- 69, 2276, 2281, 2276, 2282, 296, 2282, 2282,
- 2222, 78, 2282, 21, 21, 2282, 2282, 2282,
- 2282, 2282, 69, 2283, 26, 21, 2284, 300,
- 2284, 2282, 296, 2282, 2282, 2222, 78, 2282,
- 21, 21, 2282, 2282, 2282, 2282, 2282, 69,
- 2285, 2286, 2285, 2287, 77, 2287, 2287, 2288,
- 78, 2287, 21, 21, 2287, 2287, 2287, 2287,
- 69, 2289, 26, 21, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2290, 78, 2290,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2291, 78, 2291, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2292, 78, 2292,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2293, 78, 2293, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2294, 78, 2294,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2295, 2296, 2295, 2213, 77, 2213, 2213, 2214,
- 2297, 78, 2213, 21, 21, 2213, 2213, 2213,
- 2213, 69, 2298, 2299, 2298, 77, 2194, 2297,
- 78, 21, 21, 69, 2300, 26, 21, 2301,
- 76, 2301, 77, 2194, 2297, 78, 21, 21,
- 69, 2297, 2302, 2297, 2221, 2303, 2221, 2221,
- 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
- 2221, 2221, 69, 2304, 26, 21, 2305, 2306,
- 2305, 2221, 2303, 2221, 2221, 2222, 78, 2221,
- 21, 21, 2221, 2221, 2221, 2221, 2221, 69,
- 2307, 26, 21, 2308, 76, 2308, 2303, 78,
- 21, 21, 69, 2309, 2310, 2309, 390, 2311,
- 392, 387, 387, 386, 2312, 26, 21, 2211,
- 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
- 2313, 78, 2313, 2213, 21, 21, 2213, 2213,
- 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
- 2213, 2213, 2214, 2215, 2314, 78, 2314, 2213,
- 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
- 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
- 2315, 78, 2315, 2213, 21, 21, 2213, 2213,
- 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
- 2213, 2213, 2214, 2215, 2316, 78, 2316, 2213,
- 21, 21, 2213, 2213, 2213, 2213, 69, 2317,
- 2318, 2317, 2213, 77, 2213, 2213, 2214, 2319,
- 78, 2213, 21, 21, 2213, 2213, 2213, 2213,
- 69, 2320, 2321, 2320, 77, 2194, 2319, 78,
- 21, 21, 69, 2322, 26, 21, 2323, 76,
- 2323, 77, 2194, 2319, 78, 21, 21, 69,
- 2324, 2325, 2324, 2221, 2028, 2221, 2221, 2222,
- 78, 2221, 21, 21, 2221, 2221, 2221, 2221,
- 2221, 69, 2326, 26, 21, 2327, 2031, 2327,
- 2221, 2028, 2221, 2221, 2222, 78, 2221, 21,
- 21, 2221, 2221, 2221, 2221, 2221, 69, 2328,
- 26, 21, 2211, 2212, 2211, 2213, 77, 2213,
- 2213, 2214, 2215, 2329, 78, 2329, 2213, 21,
- 21, 2213, 2213, 2213, 2213, 69, 2211, 2212,
- 2211, 2213, 77, 2213, 2213, 2214, 2215, 2330,
- 78, 2330, 2213, 21, 21, 2213, 2213, 2213,
- 2213, 69, 2211, 2212, 2211, 2213, 77, 2213,
- 2213, 2214, 2215, 2331, 78, 2331, 2213, 21,
- 21, 2213, 2213, 2213, 2213, 69, 2211, 2212,
- 2211, 2213, 77, 2213, 2213, 2214, 2215, 2332,
- 78, 2332, 2213, 21, 21, 2213, 2213, 2213,
- 2213, 69, 2211, 2212, 2211, 2213, 77, 2213,
- 2213, 2214, 2215, 2333, 78, 2333, 2213, 21,
- 21, 2213, 2213, 2213, 2213, 69, 2334, 2335,
- 2334, 2213, 77, 2213, 2213, 2214, 2336, 78,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2337, 2338, 2337, 77, 2194, 2336, 78, 21,
- 21, 69, 2339, 26, 21, 2340, 76, 2340,
- 77, 2194, 2336, 78, 21, 21, 69, 2341,
- 2342, 2341, 2221, 2049, 2221, 2221, 2222, 78,
- 2221, 21, 21, 2221, 2221, 2221, 2221, 2221,
- 69, 2343, 26, 21, 2344, 2052, 2344, 2221,
- 2049, 2221, 2221, 2222, 78, 2221, 21, 21,
- 2221, 2221, 2221, 2221, 2221, 69, 2345, 26,
- 21, 2211, 2212, 2211, 2213, 77, 2213, 2213,
- 2214, 2215, 2346, 78, 2346, 2213, 21, 21,
- 2213, 2213, 2213, 2213, 69, 2211, 2212, 2211,
- 2213, 77, 2213, 2213, 2214, 2215, 2347, 78,
- 2347, 2213, 21, 21, 2213, 2213, 2213, 2213,
- 69, 2348, 2349, 2348, 2213, 77, 2213, 2213,
- 2214, 2350, 78, 2213, 21, 21, 2213, 2213,
- 2213, 2213, 69, 2351, 2352, 2351, 77, 2194,
- 2350, 78, 21, 21, 69, 2353, 26, 21,
- 2354, 76, 2354, 77, 2194, 2350, 78, 21,
- 21, 69, 2350, 2355, 2350, 2221, 2356, 2221,
- 2221, 2222, 78, 2221, 21, 21, 2221, 2221,
- 2221, 2221, 2221, 69, 2357, 26, 21, 2358,
- 2359, 2358, 2221, 2356, 2221, 2221, 2222, 78,
- 2221, 21, 21, 2221, 2221, 2221, 2221, 2221,
- 69, 2360, 26, 21, 2361, 76, 2361, 2356,
- 78, 21, 21, 69, 2362, 2363, 2362, 197,
- 2364, 198, 195, 195, 194, 2365, 26, 21,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2366, 78, 2366, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2367, 78, 2367,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
- 2215, 2368, 78, 2368, 2213, 21, 21, 2213,
- 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
- 77, 2213, 2213, 2214, 2215, 2369, 78, 2369,
- 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
- 2370, 2371, 2370, 2213, 77, 2213, 2213, 2214,
- 2372, 78, 2213, 21, 21, 2213, 2213, 2213,
- 2213, 69, 2373, 2374, 2373, 77, 2194, 2372,
- 78, 21, 21, 69, 2375, 26, 21, 2376,
- 76, 2376, 77, 2194, 2372, 78, 21, 21,
- 69, 2377, 2378, 2377, 2221, 2089, 2221, 2221,
- 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
- 2221, 2221, 69, 2379, 26, 21, 2380, 2092,
- 2380, 2221, 2089, 2221, 2221, 2222, 78, 2221,
- 21, 21, 2221, 2221, 2221, 2221, 2221, 69,
- 2381, 26, 21, 2211, 2212, 2211, 2213, 77,
- 2213, 2213, 2214, 2215, 2382, 78, 2382, 2213,
- 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
- 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
- 2383, 78, 2383, 2213, 21, 21, 2213, 2213,
- 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
- 2213, 2213, 2214, 2215, 2384, 78, 2384, 2213,
- 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
- 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
- 2385, 78, 2385, 2213, 21, 21, 2213, 2213,
- 2213, 2213, 69, 2386, 2387, 2386, 2213, 77,
- 2213, 2213, 2214, 2388, 78, 2213, 21, 21,
- 2213, 2213, 2213, 2213, 69, 2389, 2390, 2389,
- 77, 2194, 2388, 78, 21, 21, 69, 2391,
- 26, 21, 2392, 76, 2392, 77, 2194, 2388,
- 78, 21, 21, 69, 2388, 2393, 2388, 2221,
- 296, 2221, 2221, 2394, 2395, 2222, 78, 2394,
- 2395, 2221, 21, 21, 2221, 2221, 2221, 2221,
- 2221, 69, 2396, 26, 21, 2397, 300, 2397,
- 2221, 296, 2221, 2221, 2394, 2395, 2222, 78,
- 2394, 2395, 2221, 21, 21, 2221, 2221, 2221,
- 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
- 2221, 2221, 2214, 2398, 78, 2398, 2221, 21,
- 21, 2221, 2221, 2221, 2221, 69, 2225, 2226,
- 2225, 2221, 77, 2221, 2221, 2214, 2399, 78,
- 2399, 2221, 21, 21, 2221, 2221, 2221, 2221,
- 69, 2225, 2226, 2225, 2221, 77, 2221, 2221,
- 2214, 2400, 78, 2400, 2221, 21, 21, 2221,
- 2221, 2221, 2221, 69, 2225, 2226, 2225, 2221,
- 77, 2221, 2221, 2214, 2401, 78, 2401, 2221,
- 21, 21, 2221, 2221, 2221, 2221, 69, 2402,
- 2403, 2402, 77, 2404, 78, 21, 21, 69,
- 2225, 2226, 2225, 2221, 77, 2221, 2221, 2214,
- 2405, 78, 2405, 2221, 21, 21, 2221, 2221,
- 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
- 2221, 2221, 2214, 2400, 78, 2400, 2221, 21,
- 21, 2221, 2221, 2221, 2221, 69, 2406, 26,
- 21, 2407, 26, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2408, 2408, 51, 51,
- 51, 51, 51, 21, 49, 50, 49, 51,
- 51, 51, 52, 53, 2409, 2409, 51, 51,
- 51, 51, 51, 21, 2410, 2411, 2410, 51,
- 51, 51, 52, 2412, 51, 51, 51, 51,
- 51, 21, 2413, 2414, 2413, 56, 2412, 21,
- 2415, 26, 21, 2416, 26, 2416, 56, 2412,
- 21, 2412, 2417, 2412, 68, 2418, 68, 68,
- 70, 68, 68, 68, 68, 68, 68, 21,
- 2419, 26, 21, 2420, 2421, 2420, 68, 2418,
- 68, 68, 70, 68, 68, 68, 68, 68,
- 68, 21, 2422, 26, 21, 2423, 26, 2423,
- 2418, 21, 2425, 197, 2426, 195, 195, 195,
- 2424, 2428, 202, 2429, 200, 200, 200, 2427,
- 2430, 204, 202, 200, 204, 2431, 2427, 2427,
- 200, 2432, 26, 21, 26, 2433, 2433, 21,
- 26, 2434, 2434, 21, 26, 2435, 2435, 21,
- 26, 2436, 2436, 21, 26, 2437, 2437, 21,
- 2438, 2439, 2438, 21, 2440, 26, 21, 30,
- 26, 30, 21, 2441, 2441, 1, 6, 6,
- 1, 26, 21, 30, 26, 30, 21, 48,
- 26, 48, 21, 58, 26, 58, 21, 63,
- 26, 63, 21, 58, 26, 58, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 72, 26,
- 72, 21, 75, 26, 75, 21, 69, 26,
- 69, 21, 85, 26, 85, 21, 85, 26,
- 85, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 97, 26, 97, 21, 2442, 26, 2442,
- 21, 105, 26, 105, 21, 106, 26, 106,
- 21, 97, 26, 97, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 160, 26, 160, 21,
- 2443, 26, 2443, 21, 168, 26, 168, 21,
- 169, 26, 169, 21, 160, 26, 160, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 186,
- 26, 186, 21, 190, 26, 190, 21, 193,
- 26, 193, 21, 204, 202, 200, 209, 26,
- 209, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 221, 26, 221, 21, 2444, 26, 2444,
- 21, 229, 26, 229, 21, 230, 26, 230,
- 21, 221, 26, 221, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 249, 26, 249, 21,
- 254, 26, 254, 21, 249, 26, 249, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 199,
- 204, 199, 202, 200, 270, 26, 270, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 273,
- 26, 273, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 284, 26, 284, 21, 293, 26,
- 293, 21, 299, 26, 299, 21, 302, 26,
- 302, 21, 273, 26, 273, 21, 293, 26,
- 293, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 357, 26, 357, 21, 361, 26, 361,
- 21, 357, 26, 357, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 378, 26, 378, 21,
- 382, 26, 382, 21, 385, 26, 385, 21,
- 398, 396, 394, 393, 398, 393, 396, 394,
- 406, 398, 406, 396, 394, 417, 398, 417,
- 396, 394, 426, 398, 426, 396, 394, 431,
- 398, 431, 396, 394, 434, 398, 434, 396,
- 394, 406, 398, 406, 449, 396, 449, 449,
- 450, 451, 452, 453, 454, 455, 456, 450,
- 451, 452, 453, 454, 455, 456, 449, 449,
- 449, 449, 449, 449, 394, 447, 398, 447,
- 396, 394, 458, 398, 458, 396, 394, 447,
- 398, 447, 449, 396, 449, 449, 450, 451,
- 452, 453, 454, 455, 456, 450, 451, 452,
- 453, 454, 455, 456, 449, 449, 449, 449,
- 449, 449, 394, 466, 398, 466, 396, 394,
- 469, 398, 469, 396, 394, 475, 398, 475,
- 396, 394, 475, 398, 475, 449, 396, 449,
- 449, 450, 451, 452, 453, 454, 455, 456,
- 450, 451, 452, 453, 454, 455, 456, 449,
- 449, 449, 449, 449, 449, 394, 487, 398,
- 487, 396, 394, 2445, 398, 2445, 396, 394,
- 495, 398, 495, 396, 394, 501, 26, 501,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 504, 26, 504, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 515, 26, 515, 21, 524,
- 26, 524, 21, 530, 26, 530, 21, 533,
- 26, 533, 21, 504, 26, 504, 21, 524,
- 26, 524, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 592, 26, 592, 21, 596, 26,
- 596, 21, 592, 26, 592, 39, 39, 39,
- 40, 60, 42, 43, 61, 45, 46, 40,
- 60, 42, 43, 61, 45, 46, 39, 39,
- 39, 39, 39, 39, 21, 613, 26, 613,
- 21, 617, 26, 617, 21, 620, 26, 620,
- 21, 613, 26, 613, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 635, 26, 635, 21,
- 2446, 26, 2446, 21, 643, 26, 643, 21,
- 635, 26, 635, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 660, 26, 660, 21, 2447,
- 26, 2447, 21, 668, 26, 668, 21, 677,
- 26, 677, 21, 688, 26, 688, 21, 697,
- 26, 697, 21, 703, 26, 703, 21, 706,
- 26, 706, 21, 677, 26, 677, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 697, 26,
- 697, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 763, 26, 763, 21, 767, 26, 767,
- 21, 763, 26, 763, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 784, 26, 784, 21,
- 788, 26, 788, 21, 791, 26, 791, 21,
- 784, 26, 784, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 806, 26, 806, 21, 2448,
- 26, 2448, 21, 814, 26, 814, 21, 806,
- 26, 806, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 831, 26, 831, 21, 2449, 26,
- 2449, 21, 839, 26, 839, 21, 831, 26,
- 831, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 853, 26, 853, 21, 857, 26, 857,
- 21, 860, 26, 860, 21, 868, 204, 868,
- 202, 200, 879, 204, 879, 202, 200, 888,
- 204, 888, 202, 200, 893, 204, 893, 202,
- 200, 896, 204, 896, 202, 200, 868, 204,
- 868, 911, 202, 911, 911, 912, 913, 914,
- 915, 916, 917, 918, 912, 913, 914, 915,
- 916, 917, 918, 911, 911, 911, 911, 911,
- 911, 200, 909, 204, 909, 202, 200, 920,
- 204, 920, 202, 200, 909, 204, 909, 911,
- 202, 911, 911, 912, 913, 914, 915, 916,
- 917, 918, 912, 913, 914, 915, 916, 917,
- 918, 911, 911, 911, 911, 911, 911, 200,
- 928, 204, 928, 202, 200, 931, 204, 931,
- 202, 200, 937, 204, 937, 202, 200, 937,
- 204, 937, 911, 202, 911, 911, 912, 913,
- 914, 915, 916, 917, 918, 912, 913, 914,
- 915, 916, 917, 918, 911, 911, 911, 911,
- 911, 911, 200, 949, 204, 949, 202, 200,
- 2450, 204, 2450, 202, 200, 957, 204, 957,
- 202, 200, 949, 204, 949, 911, 202, 911,
- 911, 912, 913, 914, 915, 916, 917, 918,
- 912, 913, 914, 915, 916, 917, 918, 911,
- 911, 911, 911, 911, 911, 200, 1006, 204,
- 1006, 202, 200, 2451, 204, 2451, 202, 200,
- 1014, 204, 1014, 202, 200, 1019, 26, 1019,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 1006, 204, 1006, 911, 202, 911, 911, 912,
- 913, 914, 915, 916, 917, 918, 912, 913,
- 914, 915, 916, 917, 918, 911, 911, 911,
- 911, 911, 911, 200, 1030, 204, 1030, 202,
- 200, 1033, 204, 1033, 202, 200, 1030, 204,
- 1030, 911, 202, 911, 911, 912, 913, 914,
- 915, 916, 917, 918, 912, 913, 914, 915,
- 916, 917, 918, 911, 911, 911, 911, 911,
- 911, 200, 1045, 204, 1045, 202, 200, 2452,
- 204, 2452, 202, 200, 1053, 204, 1053, 202,
- 200, 1059, 26, 1059, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 1062, 26, 1062, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 1073,
- 26, 1073, 21, 1082, 26, 1082, 21, 1088,
- 26, 1088, 21, 1091, 26, 1091, 21, 1062,
- 26, 1062, 21, 1082, 26, 1082, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 1150, 26,
- 1150, 21, 1154, 26, 1154, 21, 1150, 26,
- 1150, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 1171, 26, 1171, 21, 1175, 26, 1175,
- 21, 1178, 26, 1178, 21, 1171, 26, 1171,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 1193, 26, 1193, 21, 2453, 26, 2453, 21,
- 1201, 26, 1201, 21, 1193, 26, 1193, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 1218,
- 26, 1218, 21, 2454, 26, 2454, 21, 1226,
- 26, 1226, 21, 1218, 26, 1218, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 1240, 26,
- 1240, 21, 1244, 26, 1244, 21, 1247, 26,
- 1247, 21, 1240, 26, 1240, 39, 39, 39,
- 40, 60, 42, 43, 61, 45, 46, 40,
- 60, 42, 43, 61, 45, 46, 39, 39,
- 39, 39, 39, 39, 21, 1262, 26, 1262,
- 21, 2455, 26, 2455, 21, 1270, 26, 1270,
- 21, 1262, 26, 1262, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 1286, 26, 1286, 21,
- 1291, 26, 1291, 21, 1286, 26, 1286, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 1045,
- 204, 1045, 911, 202, 911, 911, 912, 913,
- 914, 915, 916, 917, 918, 912, 913, 914,
- 915, 916, 917, 918, 911, 911, 911, 911,
- 911, 911, 200, 1312, 204, 1312, 202, 200,
- 1317, 204, 1317, 202, 200, 1312, 204, 1312,
- 911, 202, 911, 911, 912, 913, 914, 915,
- 916, 917, 918, 912, 913, 914, 915, 916,
- 917, 918, 911, 911, 911, 911, 911, 911,
- 200, 1337, 204, 1337, 202, 200, 1341, 204,
- 1341, 202, 200, 1344, 204, 1344, 202, 200,
- 1351, 398, 1351, 449, 396, 449, 449, 450,
- 451, 452, 453, 454, 455, 456, 450, 451,
- 452, 453, 454, 455, 456, 449, 449, 449,
- 449, 449, 449, 394, 1364, 398, 1364, 396,
- 394, 2456, 398, 2456, 396, 394, 1372, 398,
- 1372, 396, 394, 1364, 398, 1364, 449, 396,
- 449, 449, 450, 451, 452, 453, 454, 455,
- 456, 450, 451, 452, 453, 454, 455, 456,
- 449, 449, 449, 449, 449, 449, 394, 1418,
- 398, 1418, 396, 394, 1422, 398, 1422, 396,
- 394, 1425, 398, 1425, 396, 394, 1432, 204,
- 1432, 911, 202, 911, 911, 912, 913, 914,
- 915, 916, 917, 918, 912, 913, 914, 915,
- 916, 917, 918, 911, 911, 911, 911, 911,
- 911, 200, 1418, 398, 1418, 449, 396, 449,
- 449, 450, 451, 452, 453, 454, 455, 456,
- 450, 451, 452, 453, 454, 455, 456, 449,
- 449, 449, 449, 449, 449, 394, 1445, 398,
- 1445, 396, 394, 2457, 398, 2457, 396, 394,
- 1453, 398, 1453, 396, 394, 1445, 398, 1445,
- 449, 396, 449, 449, 450, 451, 452, 453,
- 454, 455, 456, 450, 451, 452, 453, 454,
- 455, 456, 449, 449, 449, 449, 449, 449,
- 394, 1466, 398, 1466, 396, 394, 1471, 398,
- 1471, 396, 394, 1466, 398, 1466, 449, 396,
- 449, 449, 450, 451, 452, 453, 454, 455,
- 456, 450, 451, 452, 453, 454, 455, 456,
- 449, 449, 449, 449, 449, 449, 394, 1337,
- 204, 1337, 911, 202, 911, 911, 912, 913,
- 914, 915, 916, 917, 918, 912, 913, 914,
- 915, 916, 917, 918, 911, 911, 911, 911,
- 911, 911, 200, 1495, 204, 1495, 202, 200,
- 1499, 204, 1499, 202, 200, 1495, 204, 1495,
- 911, 202, 911, 911, 912, 913, 914, 915,
- 916, 917, 918, 912, 913, 914, 915, 916,
- 917, 918, 911, 911, 911, 911, 911, 911,
- 200, 888, 204, 888, 911, 202, 911, 911,
- 912, 913, 914, 915, 916, 917, 918, 912,
- 913, 914, 915, 916, 917, 918, 911, 911,
- 911, 911, 911, 911, 200, 1555, 204, 1555,
- 202, 200, 1559, 204, 1559, 202, 200, 1555,
- 204, 1555, 911, 202, 911, 911, 912, 913,
- 914, 915, 916, 917, 918, 912, 913, 914,
- 915, 916, 917, 918, 911, 911, 911, 911,
- 911, 911, 200, 1576, 204, 1576, 202, 200,
- 1579, 204, 1579, 202, 200, 1582, 204, 1582,
- 202, 200, 1576, 204, 1576, 911, 202, 911,
- 911, 912, 913, 914, 915, 916, 917, 918,
- 912, 913, 914, 915, 916, 917, 918, 911,
- 911, 911, 911, 911, 911, 200, 1594, 204,
- 1594, 202, 200, 2458, 204, 2458, 202, 200,
- 1601, 204, 1601, 202, 200, 1594, 204, 1594,
- 911, 202, 911, 911, 912, 913, 914, 915,
- 916, 917, 918, 912, 913, 914, 915, 916,
- 917, 918, 911, 911, 911, 911, 911, 911,
- 200, 1614, 204, 1614, 202, 200, 2459, 204,
- 2459, 202, 200, 1621, 204, 1621, 202, 200,
- 1614, 204, 1614, 911, 202, 911, 911, 912,
- 913, 914, 915, 916, 917, 918, 912, 913,
- 914, 915, 916, 917, 918, 911, 911, 911,
- 911, 911, 911, 200, 1631, 204, 1631, 202,
- 200, 1634, 204, 1634, 202, 200, 1631, 204,
- 1631, 911, 202, 911, 911, 912, 913, 914,
- 915, 916, 917, 918, 912, 913, 914, 915,
- 916, 917, 918, 911, 911, 911, 911, 911,
- 911, 200, 1646, 204, 1646, 202, 200, 2460,
- 204, 2460, 202, 200, 1653, 204, 1653, 202,
- 200, 1646, 204, 1646, 911, 202, 911, 911,
- 912, 913, 914, 915, 916, 917, 918, 912,
- 913, 914, 915, 916, 917, 918, 911, 911,
- 911, 911, 911, 911, 200, 1665, 204, 1665,
- 202, 200, 1670, 204, 1670, 202, 200, 1665,
- 204, 1665, 911, 202, 911, 911, 912, 913,
- 914, 915, 916, 917, 918, 912, 913, 914,
- 915, 916, 917, 918, 911, 911, 911, 911,
- 911, 911, 200, 853, 26, 853, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 1691, 26,
- 1691, 21, 2461, 26, 2461, 21, 1699, 26,
- 1699, 21, 1691, 26, 1691, 39, 39, 39,
- 40, 60, 42, 43, 61, 45, 46, 40,
- 60, 42, 43, 61, 45, 46, 39, 39,
- 39, 39, 39, 39, 21, 1715, 26, 1715,
- 21, 1720, 26, 1720, 21, 1715, 26, 1715,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 660, 26, 660, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 1739, 26, 1739, 21, 1743,
- 26, 1743, 21, 1746, 26, 1746, 21, 1739,
- 26, 1739, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 1761, 26, 1761, 21, 2462, 26,
- 2462, 21, 1769, 26, 1769, 21, 1761, 26,
- 1761, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 1785, 26, 1785, 21, 1790, 26, 1790,
- 21, 1785, 26, 1785, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 487, 398, 487, 449,
- 396, 449, 449, 450, 451, 452, 453, 454,
- 455, 456, 450, 451, 452, 453, 454, 455,
- 456, 449, 449, 449, 449, 449, 449, 394,
- 1811, 398, 1811, 396, 394, 1814, 398, 1814,
- 396, 394, 1811, 398, 1811, 449, 396, 449,
- 449, 450, 451, 452, 453, 454, 455, 456,
- 450, 451, 452, 453, 454, 455, 456, 449,
- 449, 449, 449, 449, 449, 394, 1829, 398,
- 1829, 396, 394, 1833, 398, 1833, 396, 394,
- 1829, 398, 1829, 449, 396, 449, 449, 450,
- 451, 452, 453, 454, 455, 456, 450, 451,
- 452, 453, 454, 455, 456, 449, 449, 449,
- 449, 449, 449, 394, 426, 398, 426, 449,
- 396, 449, 449, 450, 451, 452, 453, 454,
- 455, 456, 450, 451, 452, 453, 454, 455,
- 456, 449, 449, 449, 449, 449, 449, 394,
- 1889, 398, 1889, 396, 394, 1893, 398, 1893,
- 396, 394, 1889, 398, 1889, 449, 396, 449,
- 449, 450, 451, 452, 453, 454, 455, 456,
- 450, 451, 452, 453, 454, 455, 456, 449,
- 449, 449, 449, 449, 449, 394, 1910, 398,
- 1910, 396, 394, 1913, 398, 1913, 396, 394,
- 1910, 398, 1910, 449, 396, 449, 449, 450,
- 451, 452, 453, 454, 455, 456, 450, 451,
- 452, 453, 454, 455, 456, 449, 449, 449,
- 449, 449, 449, 394, 1925, 398, 1925, 396,
- 394, 2463, 398, 2463, 396, 394, 1932, 398,
- 1932, 396, 394, 1925, 398, 1925, 449, 396,
- 449, 449, 450, 451, 452, 453, 454, 455,
- 456, 450, 451, 452, 453, 454, 455, 456,
- 449, 449, 449, 449, 449, 449, 394, 1945,
- 398, 1945, 396, 394, 2464, 398, 2464, 396,
- 394, 1952, 398, 1952, 396, 394, 1945, 398,
- 1945, 449, 396, 449, 449, 450, 451, 452,
- 453, 454, 455, 456, 450, 451, 452, 453,
- 454, 455, 456, 449, 449, 449, 449, 449,
- 449, 394, 1962, 398, 1962, 396, 394, 1965,
- 398, 1965, 396, 394, 1968, 398, 1968, 396,
- 394, 1962, 398, 1962, 449, 396, 449, 449,
- 450, 451, 452, 453, 454, 455, 456, 450,
- 451, 452, 453, 454, 455, 456, 449, 449,
- 449, 449, 449, 449, 394, 1980, 398, 1980,
- 396, 394, 2465, 398, 2465, 396, 394, 1987,
- 398, 1987, 396, 394, 1980, 398, 1980, 449,
- 396, 449, 449, 450, 451, 452, 453, 454,
- 455, 456, 450, 451, 452, 453, 454, 455,
- 456, 449, 449, 449, 449, 449, 449, 394,
- 1999, 398, 1999, 396, 394, 2004, 398, 2004,
- 396, 394, 1999, 398, 1999, 449, 396, 449,
- 449, 450, 451, 452, 453, 454, 455, 456,
- 450, 451, 452, 453, 454, 455, 456, 449,
- 449, 449, 449, 449, 449, 394, 378, 26,
- 378, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 2025, 26, 2025, 21, 2466, 26, 2466,
- 21, 2033, 26, 2033, 21, 2025, 26, 2025,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 2046, 26, 2046, 21, 2467, 26, 2467, 21,
- 2054, 26, 2054, 21, 2046, 26, 2046, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 2064,
- 26, 2064, 21, 2068, 26, 2068, 21, 2071,
- 26, 2071, 21, 2064, 26, 2064, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 2086, 26,
- 2086, 21, 2468, 26, 2468, 21, 2094, 26,
- 2094, 21, 2086, 26, 2086, 39, 39, 39,
- 40, 60, 42, 43, 61, 45, 46, 40,
- 60, 42, 43, 61, 45, 46, 39, 39,
- 39, 39, 39, 39, 21, 2106, 26, 2106,
- 21, 2111, 26, 2111, 21, 2106, 26, 2106,
- 39, 39, 39, 40, 60, 42, 43, 61,
- 45, 46, 40, 60, 42, 43, 61, 45,
- 46, 39, 39, 39, 39, 39, 39, 21,
- 186, 26, 186, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 2132, 26, 2132, 21, 2136,
- 26, 2136, 21, 2139, 26, 2139, 21, 2132,
- 26, 2132, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 2155, 26, 2155, 21, 2159, 26,
- 2159, 21, 2155, 26, 2155, 39, 39, 39,
- 40, 60, 42, 43, 61, 45, 46, 40,
- 60, 42, 43, 61, 45, 46, 39, 39,
- 39, 39, 39, 39, 21, 2176, 26, 2176,
- 21, 2180, 26, 2180, 21, 2183, 26, 2183,
- 21, 2187, 398, 2187, 396, 394, 2196, 26,
- 2196, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 2199, 26, 2199, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 2210, 26, 2210, 21,
- 2219, 26, 2219, 21, 2224, 26, 2224, 21,
- 2199, 26, 2199, 21, 2219, 26, 2219, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 2280,
- 26, 2280, 21, 2284, 26, 2284, 21, 2280,
- 26, 2280, 39, 39, 39, 40, 60, 42,
- 43, 61, 45, 46, 40, 60, 42, 43,
- 61, 45, 46, 39, 39, 39, 39, 39,
- 39, 21, 2301, 26, 2301, 21, 2305, 26,
- 2305, 21, 2308, 26, 2308, 21, 2301, 26,
- 2301, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 2323, 26, 2323, 21, 2469, 26, 2469,
- 21, 2323, 26, 2323, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 2340, 26, 2340, 21,
- 2470, 26, 2470, 21, 2340, 26, 2340, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 2354,
- 26, 2354, 21, 2358, 26, 2358, 21, 2361,
- 26, 2361, 21, 2354, 26, 2354, 39, 39,
- 39, 40, 60, 42, 43, 61, 45, 46,
- 40, 60, 42, 43, 61, 45, 46, 39,
- 39, 39, 39, 39, 39, 21, 2376, 26,
- 2376, 21, 2471, 26, 2471, 21, 2376, 26,
- 2376, 39, 39, 39, 40, 60, 42, 43,
- 61, 45, 46, 40, 60, 42, 43, 61,
- 45, 46, 39, 39, 39, 39, 39, 39,
- 21, 2392, 26, 2392, 21, 2397, 26, 2397,
- 21, 2392, 26, 2392, 39, 39, 39, 40,
- 60, 42, 43, 61, 45, 46, 40, 60,
- 42, 43, 61, 45, 46, 39, 39, 39,
- 39, 39, 39, 21, 2176, 26, 2176, 39,
- 39, 39, 40, 60, 42, 43, 61, 45,
- 46, 40, 60, 42, 43, 61, 45, 46,
- 39, 39, 39, 39, 39, 39, 21, 2416,
- 26, 2416, 21, 2420, 26, 2420, 21, 2423,
- 26, 2423, 21, 2427, 204, 2427, 202, 200,
- 2416, 26, 2416, 39, 39, 39, 40, 60,
- 42, 43, 61, 45, 46, 40, 60, 42,
- 43, 61, 45, 46, 39, 39, 39, 39,
- 39, 39, 21, 0
-};
+ static const char _thttp_machine_parser_header_WWW_Authenticate_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 5, 4, 0, 0, 0, 5, 0,
+ 5, 4, 0, 4, 5, 0, 5, 0,
+ 0, 2, 0, 0, 0, 0, 0, 0,
+ 4, 4, 4, 4, 4, 0, 0, 0,
+ 5, 0, 5, 0, 0, 2, 0, 0,
+ 2, 4, 3, 3, 3, 3, 0, 3,
+ 3, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 0, 1, 0, 3, 3, 3,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 1, 1, 1, 0, 0, 0, 4, 4,
+ 4, 4, 4, 4, 0, 0, 0, 5,
+ 0, 5, 0, 0, 2, 0, 0, 2,
+ 0, 4, 4, 4, 0, 0, 0, 5,
+ 0, 5, 0, 0, 2, 2, 0, 0,
+ 0, 0, 0, 4, 4, 4, 4, 4,
+ 0, 0, 0, 5, 0, 5, 0, 0,
+ 2, 0, 0, 2, 0, 4, 4, 4,
+ 4, 4, 0, 0, 0, 5, 0, 5,
+ 4, 4, 4, 4, 0, 4, 4, 0,
+ 0, 2, 1, 0, 1, 0, 1, 6,
+ 0, 6, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 1, 0, 2, 5,
+ 5, 5, 5, 5, 2, 5, 5, 3,
+ 3, 3, 3, 3, 3, 3, 2, 3,
+ 2, 3, 2, 5, 5, 5, 5, 5,
+ 5, 2, 5, 5, 5, 5, 3, 3,
+ 3, 2, 2, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 5, 0, 5, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 2, 0, 0, 0,
+ 2, 1, 0, 1, 6, 0, 6, 5,
+ 1, 0, 1, 6, 0, 6, 0, 1,
+ 5, 0, 4, 0, 0, 0, 5, 0,
+ 5, 4, 0, 4, 5, 0, 5, 0,
+ 0, 4, 0, 0, 0, 0, 4, 4,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 0, 0, 1, 0, 1, 0, 1,
+ 6, 0, 6, 5, 1, 0, 1, 6,
+ 0, 6, 0, 1, 1, 5, 1, 0,
+ 5, 5, 5, 5, 2, 5, 5, 3,
+ 3, 3, 3, 3, 3, 3, 2, 1,
+ 3, 2, 3, 2, 5, 5, 5, 5,
+ 5, 5, 2, 5, 5, 5, 5, 3,
+ 3, 3, 2, 2, 0, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 5, 0, 5, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 0, 1, 1, 0, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 0, 5, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 1, 0, 1, 6,
+ 0, 6, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 5, 0, 5, 5,
+ 5, 5, 2, 5, 5, 3, 3, 3,
+ 3, 3, 3, 3, 2, 1, 3, 2,
+ 3, 2, 5, 5, 5, 5, 5, 5,
+ 2, 5, 5, 5, 5, 3, 3, 3,
+ 2, 2, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 5, 0, 5, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 0, 1, 1, 0, 5, 5, 5, 5,
+ 5, 1, 0, 1, 6, 0, 6, 0,
+ 1, 1, 0, 5, 5, 5, 5, 5,
+ 5, 1, 0, 1, 6, 0, 6, 0,
+ 1, 1, 0, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 1, 1,
+ 0, 1, 6, 0, 6, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 5, 0,
+ 4, 0, 0, 0, 5, 0, 5, 4,
+ 0, 4, 5, 0, 5, 0, 0, 4,
+ 0, 0, 0, 0, 4, 4, 4, 4,
+ 4, 0, 0, 0, 5, 0, 5, 0,
+ 0, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 0, 1, 0, 1, 0, 3, 3, 3,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 1, 1, 1, 0, 0, 0, 4, 4,
+ 4, 4, 4, 4, 0, 0, 0, 5,
+ 0, 5, 0, 0, 1, 0, 1, 0,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 0, 4, 4, 4, 4, 4, 0,
+ 0, 0, 5, 0, 5, 0, 0, 1,
+ 0, 1, 0, 1, 6, 0, 6, 5,
+ 1, 0, 1, 6, 0, 6, 0, 1,
+ 1, 5, 1, 0, 5, 5, 5, 5,
+ 2, 5, 5, 3, 3, 3, 3, 3,
+ 3, 3, 2, 1, 3, 2, 3, 2,
+ 5, 5, 5, 5, 5, 5, 2, 5,
+ 5, 5, 5, 3, 3, 3, 2, 2,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 5, 0, 5, 5, 5, 5, 5, 5,
+ 1, 0, 1, 6, 0, 6, 0, 1,
+ 1, 0, 5, 5, 5, 5, 5, 1,
+ 0, 1, 6, 0, 6, 0, 1, 1,
+ 0, 5, 5, 5, 5, 5, 5, 1,
+ 0, 1, 6, 0, 6, 0, 1, 1,
+ 0, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 0, 1, 1, 0, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 1, 0, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 5, 5, 5, 5, 1, 5, 5, 0,
+ 0, 4, 4, 4, 4, 4, 0, 0,
+ 0, 5, 0, 5, 4, 4, 4, 4,
+ 0, 4, 4, 0, 4, 4, 4, 4,
+ 4, 0, 0, 0, 5, 0, 5, 0,
+ 0, 1, 1, 0, 1, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 0, 0, 3, 3, 3, 3, 0,
+ 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 0,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 0, 0, 1, 1, 0, 1, 0,
+ 4, 4, 4, 4, 4, 0, 0, 0,
+ 5, 0, 5, 0, 0, 0, 4, 4,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 4, 4, 4, 4, 0, 4, 4,
+ 0, 0, 4, 4, 4, 4, 4, 4,
+ 4, 4, 0, 0, 0, 5, 0, 5,
+ 4, 0, 5, 5, 5, 5, 2, 5,
+ 5, 3, 3, 3, 3, 3, 3, 3,
+ 2, 1, 3, 2, 3, 2, 5, 5,
+ 5, 5, 5, 5, 2, 5, 5, 5,
+ 5, 3, 3, 3, 2, 2, 0, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 1, 0, 1, 6, 0, 6, 5, 0,
+ 5, 5, 5, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 0, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 0, 1, 0, 5, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 0, 5, 5, 5, 1,
+ 0, 1, 6, 0, 6, 0, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 1, 0, 5, 5, 5, 5,
+ 5, 1, 0, 1, 6, 0, 6, 5,
+ 5, 5, 5, 1, 5, 5, 0, 0,
+ 5, 5, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 0, 1, 1, 0, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 5, 5, 5, 5, 1, 5,
+ 5, 0, 0, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 1, 0,
+ 5, 5, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 0, 1, 1, 0, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 5, 5, 5, 5, 1, 5,
+ 5, 0, 0, 4, 4, 4, 4, 4,
+ 0, 0, 0, 5, 0, 5, 0, 4,
+ 4, 4, 4, 4, 4, 4, 4, 0,
+ 0, 0, 5, 0, 5, 4, 0, 5,
+ 5, 5, 5, 2, 5, 5, 3, 3,
+ 3, 3, 3, 3, 3, 2, 1, 3,
+ 2, 3, 2, 5, 5, 5, 5, 5,
+ 5, 2, 5, 5, 5, 5, 3, 3,
+ 3, 2, 2, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 5, 0, 5, 5, 5,
+ 5, 5, 5, 1, 0, 1, 6, 0,
+ 6, 0, 5, 5, 5, 5, 5, 1,
+ 0, 1, 6, 0, 6, 0, 1, 0,
+ 5, 5, 5, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 0, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 0, 1, 0, 5, 5, 5, 5, 5,
+ 1, 0, 1, 6, 0, 6, 0, 1,
+ 0, 5, 5, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 5, 5, 5, 5,
+ 1, 5, 5, 0, 0, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 0, 1, 0, 5, 5, 5, 5, 5,
+ 5, 1, 0, 1, 6, 0, 6, 0,
+ 1, 0, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 0, 1, 1, 0, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 0, 1, 0, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 5, 5, 5, 5, 1, 5, 5, 0,
+ 0, 4, 4, 4, 4, 4, 0, 0,
+ 0, 5, 0, 5, 0, 0, 2, 0,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 0, 0, 0, 5, 0, 5, 4, 0,
+ 4, 4, 4, 4, 4, 4, 0, 0,
+ 0, 5, 0, 5, 0, 0, 2, 2,
+ 0, 2, 1, 0, 1, 0, 1, 6,
+ 0, 6, 5, 1, 0, 1, 6, 0,
+ 6, 5, 1, 0, 5, 5, 5, 5,
+ 2, 5, 5, 3, 3, 3, 3, 3,
+ 3, 3, 2, 1, 3, 2, 3, 2,
+ 5, 5, 5, 5, 5, 5, 2, 5,
+ 5, 5, 5, 3, 3, 3, 2, 2,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 1, 0, 1, 6, 0, 6,
+ 5, 0, 5, 5, 5, 5, 5, 5,
+ 1, 0, 1, 6, 0, 6, 0, 1,
+ 1, 0, 5, 5, 5, 5, 5, 1,
+ 0, 1, 6, 0, 6, 0, 5, 5,
+ 5, 5, 5, 5, 1, 0, 1, 6,
+ 0, 6, 0, 5, 5, 5, 1, 0,
+ 1, 6, 0, 6, 0, 1, 1, 0,
+ 5, 5, 5, 5, 5, 1, 0, 1,
+ 6, 0, 6, 0, 5, 5, 5, 5,
+ 5, 1, 0, 1, 6, 0, 6, 5,
+ 5, 5, 5, 1, 5, 5, 0, 0,
+ 4, 4, 4, 0, 0, 0, 5, 0,
+ 5, 0, 0, 2, 2, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 0, 0, 0, 5, 0, 0, 0,
+ 0, 5, 0, 0, 0, 0, 5, 0,
+ 0, 0, 0, 5, 0, 0, 0, 0,
+ 5, 0, 0, 5, 0, 5, 5, 0,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 5, 0,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 0, 0, 0, 5, 0, 0, 0, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 5, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 5, 0, 0, 5, 0, 0, 0,
+ 5, 5, 0, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 5, 5, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 0, 5, 5, 0, 0, 0, 5, 0,
+ 0, 5, 5, 0, 0, 5, 5, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 5,
+ 5, 0, 0, 0, 5, 0, 0, 5,
+ 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 5, 5, 0, 0, 5,
+ 0, 0, 5, 5, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 5, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 0, 5, 0, 0, 0, 5, 0, 0,
+ 5, 5, 0, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 0, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 5,
+ 0, 0, 5, 5, 0, 0, 0, 0,
+ 5
+ };
-static const short _thttp_machine_parser_header_WWW_Authenticate_trans_targs[] = {
- 2, 0, 1736, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 23, 1734,
- 26, 1728, 22, 1738, 24, 1739, 25, 27,
- 28, 29, 30, 31, 32, 31, 32, 34,
- 41, 1536, 56, 110, 1712, 147, 165, 1740,
- 33, 35, 42, 34, 38, 44, 35, 36,
- 38, 1741, 37, 39, 43, 129, 1742, 40,
- 1520, 1743, 1505, 45, 73, 49, 74, 1744,
- 46, 47, 1745, 48, 50, 51, 206, 1746,
- 52, 55, 52, 53, 1747, 54, 1748, 57,
- 58, 59, 60, 61, 109, 64, 61, 62,
- 1749, 63, 64, 65, 69, 1750, 66, 67,
- 1751, 68, 69, 70, 71, 72, 1752, 52,
- 55, 38, 75, 108, 76, 79, 77, 78,
- 80, 95, 81, 93, 82, 83, 91, 84,
- 85, 89, 86, 87, 88, 90, 92, 94,
- 96, 104, 97, 100, 98, 99, 101, 102,
- 103, 105, 106, 107, 1753, 111, 112, 113,
- 114, 115, 116, 128, 119, 116, 117, 1754,
- 118, 119, 120, 124, 1755, 121, 122, 1756,
- 123, 124, 125, 126, 127, 1757, 52, 55,
- 38, 1758, 130, 131, 132, 1504, 135, 132,
- 133, 1759, 134, 136, 140, 1760, 137, 138,
- 1761, 139, 141, 142, 184, 144, 185, 141,
- 142, 184, 144, 185, 143, 1762, 144, 145,
- 1763, 146, 55, 148, 149, 150, 151, 152,
- 164, 155, 152, 153, 1764, 154, 155, 156,
- 160, 1765, 157, 158, 1766, 159, 160, 161,
- 162, 163, 1767, 52, 55, 38, 1768, 166,
- 167, 168, 169, 170, 183, 173, 170, 171,
- 1769, 172, 174, 176, 181, 1770, 175, 177,
- 178, 179, 180, 52, 55, 38, 182, 1771,
- 1772, 186, 186, 187, 191, 1773, 188, 189,
- 1774, 190, 192, 194, 244, 261, 1429, 1443,
- 1458, 1471, 1485, 1775, 193, 195, 243, 194,
- 191, 198, 195, 196, 1776, 197, 199, 207,
- 203, 208, 1777, 200, 201, 1778, 202, 204,
- 189, 204, 205, 1779, 209, 242, 210, 213,
- 211, 212, 214, 229, 215, 227, 216, 217,
- 225, 218, 219, 223, 220, 221, 222, 224,
- 226, 228, 230, 238, 231, 234, 232, 233,
- 235, 236, 237, 239, 240, 241, 1780, 245,
- 246, 247, 248, 249, 250, 251, 252, 253,
- 260, 256, 253, 254, 1781, 255, 257, 259,
- 1782, 258, 204, 189, 259, 191, 1783, 262,
- 263, 264, 265, 266, 267, 1428, 270, 267,
- 268, 1784, 269, 271, 275, 1785, 272, 273,
- 1786, 274, 276, 277, 281, 297, 144, 284,
- 280, 276, 277, 279, 144, 280, 278, 1787,
- 1788, 186, 281, 282, 284, 1789, 283, 285,
- 287, 1324, 1341, 1354, 1368, 1383, 1395, 1409,
- 1790, 286, 288, 1323, 287, 284, 291, 288,
- 289, 1791, 290, 292, 296, 1287, 1792, 293,
- 294, 1793, 295, 281, 297, 1794, 299, 306,
- 298, 302, 308, 299, 300, 302, 1795, 301,
- 303, 298, 305, 307, 318, 917, 968, 984,
- 998, 1796, 304, 1271, 1797, 1259, 309, 313,
- 931, 1798, 310, 311, 1799, 312, 314, 317,
- 314, 315, 1800, 316, 1801, 319, 320, 321,
- 322, 323, 1258, 326, 323, 324, 1802, 325,
- 326, 327, 331, 1803, 328, 329, 1804, 330,
- 331, 331, 332, 336, 1805, 333, 334, 1806,
- 335, 337, 339, 389, 406, 422, 437, 1211,
- 1224, 1239, 1807, 338, 340, 388, 339, 336,
- 343, 340, 341, 1808, 342, 344, 349, 348,
- 352, 1809, 345, 346, 1810, 347, 204, 189,
- 191, 350, 334, 350, 351, 1811, 353, 387,
- 354, 357, 367, 355, 356, 358, 374, 359,
- 372, 360, 361, 370, 362, 363, 368, 364,
- 365, 366, 369, 371, 373, 375, 383, 376,
- 379, 377, 378, 380, 381, 382, 384, 385,
- 386, 1812, 390, 391, 392, 393, 394, 395,
- 396, 397, 398, 405, 401, 398, 399, 1813,
- 400, 402, 404, 1814, 403, 350, 334, 404,
- 336, 1815, 407, 408, 409, 410, 411, 412,
- 421, 415, 412, 413, 1816, 414, 416, 420,
- 1817, 417, 418, 1818, 419, 281, 297, 284,
- 1819, 423, 424, 425, 426, 427, 436, 430,
- 427, 428, 1820, 429, 430, 431, 435, 1821,
- 432, 433, 1822, 434, 435, 350, 334, 336,
- 1823, 438, 439, 440, 441, 442, 443, 1210,
- 446, 443, 444, 1824, 445, 446, 447, 451,
- 1825, 448, 449, 1826, 450, 451, 452, 469,
- 455, 452, 453, 455, 1827, 454, 456, 458,
- 507, 524, 540, 555, 571, 1176, 1191, 1828,
- 457, 459, 506, 458, 455, 462, 459, 460,
- 1829, 461, 463, 468, 467, 470, 1830, 464,
- 465, 1831, 466, 204, 189, 191, 452, 469,
- 1832, 471, 505, 472, 475, 485, 473, 474,
- 476, 492, 477, 490, 478, 479, 488, 480,
- 481, 486, 482, 483, 484, 487, 489, 491,
- 493, 501, 494, 497, 495, 496, 498, 499,
- 500, 502, 503, 504, 1833, 508, 509, 510,
- 511, 512, 513, 514, 515, 516, 523, 519,
- 516, 517, 1834, 518, 520, 522, 1835, 521,
- 452, 469, 522, 455, 1836, 525, 526, 527,
- 528, 529, 530, 539, 533, 530, 531, 1837,
- 532, 534, 538, 1838, 535, 536, 1839, 537,
- 281, 297, 284, 1840, 541, 542, 543, 544,
- 545, 554, 548, 545, 546, 1841, 547, 548,
- 549, 553, 1842, 550, 551, 1843, 552, 553,
- 350, 334, 336, 1844, 556, 557, 558, 559,
- 560, 561, 570, 564, 561, 562, 1845, 563,
- 564, 565, 569, 1846, 566, 567, 1847, 568,
- 569, 452, 469, 455, 1848, 572, 573, 574,
- 1175, 577, 574, 575, 1849, 576, 578, 582,
- 1850, 579, 580, 1851, 581, 583, 599, 586,
- 583, 584, 586, 1852, 585, 587, 589, 1071,
- 1088, 1103, 1117, 1132, 1142, 1156, 1853, 588,
- 590, 1070, 589, 586, 593, 590, 591, 1854,
- 592, 594, 598, 1034, 1855, 595, 596, 1856,
- 597, 583, 599, 1857, 601, 608, 600, 604,
- 610, 601, 602, 604, 1858, 603, 605, 600,
- 607, 609, 620, 670, 688, 698, 881, 1859,
- 606, 1018, 1860, 900, 611, 615, 633, 1861,
- 612, 613, 1862, 614, 616, 619, 616, 617,
- 1863, 618, 1864, 621, 622, 623, 624, 625,
- 669, 628, 625, 626, 1865, 627, 628, 629,
- 331, 1866, 630, 631, 1867, 632, 331, 634,
- 668, 635, 638, 648, 636, 637, 639, 655,
- 640, 653, 641, 642, 651, 643, 644, 649,
- 645, 646, 647, 650, 652, 654, 656, 664,
- 657, 660, 658, 659, 661, 662, 663, 665,
- 666, 667, 1868, 671, 672, 673, 674, 675,
- 676, 687, 679, 676, 677, 1869, 678, 679,
- 680, 684, 1870, 681, 682, 1871, 683, 684,
- 684, 685, 1872, 686, 469, 1873, 689, 690,
- 691, 697, 694, 691, 692, 1874, 693, 695,
- 1875, 696, 1876, 699, 700, 701, 702, 703,
- 880, 706, 703, 704, 1877, 705, 706, 707,
- 711, 1878, 708, 709, 1879, 710, 711, 711,
- 712, 716, 1880, 713, 714, 1881, 715, 717,
- 719, 769, 786, 802, 817, 833, 846, 861,
- 1882, 718, 720, 768, 719, 716, 723, 720,
- 721, 1883, 722, 724, 729, 728, 732, 1884,
- 725, 726, 1885, 727, 204, 189, 191, 730,
- 714, 730, 731, 1886, 733, 767, 734, 737,
- 747, 735, 736, 738, 754, 739, 752, 740,
- 741, 750, 742, 743, 748, 744, 745, 746,
- 749, 751, 753, 755, 763, 756, 759, 757,
- 758, 760, 761, 762, 764, 765, 766, 1887,
- 770, 771, 772, 773, 774, 775, 776, 777,
- 778, 785, 781, 778, 779, 1888, 780, 782,
- 784, 1889, 783, 730, 714, 784, 716, 1890,
- 787, 788, 789, 790, 791, 792, 801, 795,
- 792, 793, 1891, 794, 796, 800, 1892, 797,
- 798, 1893, 799, 281, 297, 284, 1894, 803,
- 804, 805, 806, 807, 816, 810, 807, 808,
- 1895, 809, 810, 811, 815, 1896, 812, 813,
- 1897, 814, 815, 350, 334, 336, 1898, 818,
- 819, 820, 821, 822, 823, 832, 826, 823,
- 824, 1899, 825, 826, 827, 831, 1900, 828,
- 829, 1901, 830, 831, 452, 469, 455, 1902,
- 834, 835, 836, 845, 839, 836, 837, 1903,
- 838, 840, 844, 1904, 841, 842, 1905, 843,
- 583, 599, 586, 1906, 847, 848, 849, 850,
- 851, 860, 854, 851, 852, 1907, 853, 854,
- 855, 859, 1908, 856, 857, 1909, 858, 859,
- 730, 714, 716, 1910, 862, 863, 864, 865,
- 866, 879, 869, 866, 867, 1911, 868, 870,
- 872, 877, 1912, 871, 873, 874, 875, 876,
- 730, 714, 716, 878, 1913, 1914, 882, 883,
- 884, 885, 886, 899, 889, 886, 887, 1915,
- 888, 890, 892, 897, 1916, 891, 893, 894,
- 895, 896, 616, 619, 604, 898, 1917, 901,
- 902, 903, 904, 905, 1017, 908, 905, 906,
- 1918, 907, 909, 913, 1919, 910, 911, 1920,
- 912, 914, 915, 284, 914, 915, 1921, 916,
- 297, 918, 919, 920, 921, 922, 923, 967,
- 926, 923, 924, 1922, 925, 926, 927, 684,
- 1923, 928, 929, 1924, 930, 684, 932, 966,
- 933, 936, 946, 934, 935, 937, 953, 938,
- 951, 939, 940, 949, 941, 942, 947, 943,
- 944, 945, 948, 950, 952, 954, 962, 955,
- 958, 956, 957, 959, 960, 961, 963, 964,
- 965, 1925, 969, 970, 971, 983, 974, 971,
- 972, 1926, 973, 975, 979, 1927, 976, 977,
- 1928, 978, 980, 981, 586, 980, 981, 1929,
- 982, 599, 1930, 985, 986, 987, 988, 989,
- 997, 992, 989, 990, 1931, 991, 992, 993,
- 711, 1932, 994, 995, 1933, 996, 711, 1934,
- 999, 1000, 1001, 1002, 1003, 1016, 1006, 1003,
- 1004, 1935, 1005, 1007, 1009, 1014, 1936, 1008,
- 1010, 1011, 1012, 1013, 314, 317, 302, 1015,
- 1937, 1938, 1019, 1020, 1021, 1022, 1023, 1024,
- 1025, 1026, 1033, 1029, 1026, 1027, 1939, 1028,
- 1030, 1032, 1940, 1031, 616, 619, 1032, 604,
- 1941, 1035, 1069, 1036, 1039, 1049, 1037, 1038,
- 1040, 1056, 1041, 1054, 1042, 1043, 1052, 1044,
- 1045, 1050, 1046, 1047, 1048, 1051, 1053, 1055,
- 1057, 1065, 1058, 1061, 1059, 1060, 1062, 1063,
- 1064, 1066, 1067, 1068, 1942, 1072, 1073, 1074,
- 1075, 1076, 1077, 1078, 1079, 1080, 1087, 1083,
- 1080, 1081, 1943, 1082, 1084, 1086, 1944, 1085,
- 583, 599, 1086, 586, 1945, 1089, 1090, 1091,
- 1092, 1093, 1094, 1102, 1097, 1094, 1095, 1946,
- 1096, 1098, 1947, 1099, 1100, 1948, 1101, 1949,
- 1104, 1105, 1106, 1107, 1108, 1116, 1111, 1108,
- 1109, 1950, 1110, 1111, 1112, 1951, 1113, 1114,
- 1952, 1115, 1953, 1118, 1119, 1120, 1121, 1122,
- 1123, 1131, 1126, 1123, 1124, 1954, 1125, 1126,
- 1127, 1955, 1128, 1129, 1956, 1130, 1957, 1133,
- 1134, 1135, 1141, 1138, 1135, 1136, 1958, 1137,
- 1139, 1959, 1140, 1960, 1143, 1144, 1145, 1146,
- 1147, 1155, 1150, 1147, 1148, 1961, 1149, 1150,
- 1151, 1962, 1152, 1153, 1963, 1154, 1964, 1157,
- 1158, 1159, 1160, 1161, 1174, 1164, 1161, 1162,
- 1965, 1163, 1165, 1167, 1172, 1966, 1166, 1168,
- 1169, 1170, 1171, 583, 599, 586, 1173, 1967,
- 1968, 1177, 1178, 1179, 1180, 1181, 1190, 1184,
- 1181, 1182, 1969, 1183, 1184, 1185, 1189, 1970,
- 1186, 1187, 1971, 1188, 1189, 730, 714, 716,
- 1972, 1192, 1193, 1194, 1195, 1196, 1209, 1199,
- 1196, 1197, 1973, 1198, 1200, 1202, 1207, 1974,
- 1201, 1203, 1204, 1205, 1206, 452, 469, 455,
- 1208, 1975, 1976, 1212, 1213, 1214, 1223, 1217,
- 1214, 1215, 1977, 1216, 1218, 1222, 1978, 1219,
- 1220, 1979, 1221, 583, 599, 586, 1980, 1225,
- 1226, 1227, 1228, 1229, 1238, 1232, 1229, 1230,
- 1981, 1231, 1232, 1233, 1237, 1982, 1234, 1235,
- 1983, 1236, 1237, 730, 714, 716, 1984, 1240,
- 1241, 1242, 1243, 1244, 1257, 1247, 1244, 1245,
- 1985, 1246, 1248, 1250, 1255, 1986, 1249, 1251,
- 1252, 1253, 1254, 350, 334, 336, 1256, 1987,
- 1988, 1260, 1261, 1262, 1263, 1264, 1270, 1267,
- 1264, 1265, 1989, 1266, 1268, 1990, 1269, 1991,
- 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279,
- 1286, 1282, 1279, 1280, 1992, 1281, 1283, 1285,
- 1993, 1284, 314, 317, 1285, 302, 1994, 1288,
- 1322, 1289, 1292, 1302, 1290, 1291, 1293, 1309,
- 1294, 1307, 1295, 1296, 1305, 1297, 1298, 1303,
- 1299, 1300, 1301, 1304, 1306, 1308, 1310, 1318,
- 1311, 1314, 1312, 1313, 1315, 1316, 1317, 1319,
- 1320, 1321, 1995, 1325, 1326, 1327, 1328, 1329,
- 1330, 1331, 1332, 1333, 1340, 1336, 1333, 1334,
- 1996, 1335, 1337, 1339, 1997, 1338, 281, 297,
- 1339, 284, 1998, 1342, 1343, 1344, 1345, 1346,
- 1347, 1353, 1350, 1347, 1348, 1999, 1349, 1351,
- 2000, 1352, 2001, 1355, 1356, 1357, 1358, 1359,
- 1367, 1362, 1359, 1360, 2002, 1361, 1362, 1363,
- 2003, 1364, 1365, 2004, 1366, 2005, 1369, 1370,
- 1371, 1372, 1373, 1374, 1382, 1377, 1374, 1375,
- 2006, 1376, 1377, 1378, 2007, 1379, 1380, 2008,
- 1381, 2009, 1384, 1385, 1386, 1394, 1389, 1386,
- 1387, 2010, 1388, 1390, 2011, 1391, 1392, 2012,
- 1393, 2013, 1396, 1397, 1398, 1399, 1400, 1408,
- 1403, 1400, 1401, 2014, 1402, 1403, 1404, 2015,
- 1405, 1406, 2016, 1407, 2017, 1410, 1411, 1412,
- 1413, 1414, 1427, 1417, 1414, 1415, 2018, 1416,
- 1418, 1420, 1425, 2019, 1419, 1421, 1422, 1423,
- 1424, 281, 297, 284, 1426, 2020, 2021, 1430,
- 1431, 1432, 1433, 1434, 1442, 1437, 1434, 1435,
- 2022, 1436, 1437, 1438, 367, 2023, 1439, 1440,
- 2024, 1441, 2025, 1444, 1445, 1446, 1447, 1448,
- 1449, 1457, 1452, 1449, 1450, 2026, 1451, 1452,
- 1453, 485, 2027, 1454, 1455, 2028, 1456, 2029,
- 1459, 1460, 1461, 1470, 1464, 1461, 1462, 2030,
- 1463, 1465, 1469, 2031, 1466, 1467, 2032, 1468,
- 583, 599, 586, 2033, 1472, 1473, 1474, 1475,
- 1476, 1484, 1479, 1476, 1477, 2034, 1478, 1479,
- 1480, 747, 2035, 1481, 1482, 2036, 1483, 2037,
- 1486, 1487, 1488, 1489, 1490, 1503, 1493, 1490,
- 1491, 2038, 1492, 1494, 1496, 1501, 2039, 1495,
- 1497, 1498, 1499, 1500, 204, 189, 191, 1502,
- 2040, 2041, 1506, 1507, 1508, 1509, 1510, 1519,
- 1513, 1510, 1511, 2042, 1512, 1514, 1518, 2043,
- 1515, 1516, 2044, 1517, 279, 2045, 1521, 1522,
- 1523, 1524, 1525, 1526, 1527, 1528, 1535, 1531,
- 1528, 1529, 2046, 1530, 1532, 1534, 2047, 1533,
- 52, 55, 1534, 38, 2048, 1537, 1538, 1539,
- 1540, 1541, 1542, 1711, 1545, 1542, 1543, 2049,
- 1544, 1546, 1550, 2050, 1547, 1548, 2051, 1549,
- 1551, 1552, 1553, 1551, 1552, 1553, 2052, 1554,
- 1554, 1555, 1559, 2053, 1556, 1557, 2054, 1558,
- 1560, 1562, 1609, 1626, 1642, 1654, 1667, 1680,
- 1692, 2055, 1561, 1563, 1608, 1562, 1559, 1566,
- 1563, 1564, 2056, 1565, 1567, 1569, 1572, 2057,
- 1568, 1570, 1557, 1570, 1571, 2058, 1573, 1607,
- 1574, 1577, 1587, 1575, 1576, 1578, 1594, 1579,
- 1592, 1580, 1581, 1590, 1582, 1583, 1588, 1584,
- 1585, 1586, 1589, 1591, 1593, 1595, 1603, 1596,
- 1599, 1597, 1598, 1600, 1601, 1602, 1604, 1605,
- 1606, 2059, 1610, 1611, 1612, 1613, 1614, 1615,
- 1616, 1617, 1618, 1625, 1621, 1618, 1619, 2060,
- 1620, 1622, 1624, 2061, 1623, 1570, 1557, 1624,
- 1559, 2062, 1627, 1628, 1629, 1630, 1631, 1632,
- 1641, 1635, 1632, 1633, 2063, 1634, 1636, 1640,
- 2064, 1637, 1638, 2065, 1639, 281, 297, 284,
- 2066, 1643, 1644, 1645, 1646, 1647, 1653, 1650,
- 1647, 1648, 2067, 1649, 1650, 1651, 2068, 1652,
- 2069, 1655, 1656, 1657, 1658, 1659, 1660, 1666,
- 1663, 1660, 1661, 2070, 1662, 1663, 1664, 2071,
- 1665, 2072, 1668, 1669, 1670, 1679, 1673, 1670,
- 1671, 2073, 1672, 1674, 1678, 2074, 1675, 1676,
- 2075, 1677, 583, 599, 586, 2076, 1681, 1682,
- 1683, 1684, 1685, 1691, 1688, 1685, 1686, 2077,
- 1687, 1688, 1689, 2078, 1690, 2079, 1693, 1694,
- 1695, 1696, 1697, 1710, 1700, 1697, 1698, 2080,
- 1699, 1701, 1703, 1708, 2081, 1702, 1704, 1705,
- 1706, 1707, 1570, 1557, 1559, 1709, 2082, 2083,
- 1713, 1714, 1715, 1727, 1718, 1715, 1716, 2084,
- 1717, 1719, 1723, 2085, 1720, 1721, 2086, 1722,
- 1724, 1725, 1726, 1724, 1725, 1726, 2087, 1554,
- 2088, 1729, 1730, 1731, 1732, 1733, 31, 32,
- 1735, 1737, 66, 121, 157, 328, 432, 448,
- 550, 566, 630, 681, 708, 812, 828, 856,
- 928, 994, 1113, 1128, 1152, 1186, 1234, 1364,
- 1379, 1405, 1439, 1454, 1481, 1652, 1665, 1690
-};
+ static const short _thttp_machine_parser_header_WWW_Authenticate_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 19,
+ 22, 25, 28, 31, 34, 37, 40, 43,
+ 46, 49, 52, 55, 59, 67, 69, 72,
+ 80, 83, 91, 95, 99, 103, 107, 111,
+ 138, 141, 168, 182, 188, 191, 197, 224,
+ 227, 254, 270, 273, 289, 304, 307, 322,
+ 325, 330, 337, 340, 345, 350, 353, 358,
+ 361, 377, 393, 409, 425, 439, 445, 448,
+ 454, 469, 472, 487, 490, 495, 502, 505,
+ 510, 514, 527, 533, 540, 547, 554, 558,
+ 564, 572, 575, 579, 582, 586, 589, 593,
+ 597, 600, 604, 607, 611, 614, 622, 630,
+ 637, 644, 651, 658, 662, 667, 675, 683,
+ 691, 694, 698, 702, 705, 708, 711, 727,
+ 743, 759, 775, 791, 805, 811, 814, 820,
+ 835, 838, 853, 856, 861, 868, 871, 876,
+ 880, 883, 899, 915, 929, 935, 938, 944,
+ 959, 962, 977, 980, 985, 992, 999, 1002,
+ 1006, 1011, 1014, 1019, 1035, 1051, 1067, 1083,
+ 1097, 1103, 1106, 1112, 1127, 1130, 1145, 1148,
+ 1153, 1160, 1163, 1168, 1172, 1175, 1191, 1207,
+ 1223, 1239, 1253, 1259, 1262, 1268, 1287, 1290,
+ 1309, 1324, 1339, 1354, 1369, 1374, 1389, 1404,
+ 1407, 1411, 1416, 1425, 1428, 1437, 1440, 1449,
+ 1480, 1483, 1514, 1532, 1542, 1545, 1555, 1573,
+ 1576, 1594, 1597, 1605, 1614, 1623, 1626, 1630,
+ 1647, 1658, 1670, 1682, 1694, 1703, 1714, 1727,
+ 1735, 1744, 1752, 1761, 1769, 1778, 1787, 1795,
+ 1804, 1812, 1821, 1829, 1842, 1855, 1867, 1879,
+ 1891, 1903, 1912, 1922, 1935, 1948, 1961, 1969,
+ 1978, 1987, 1995, 2003, 2006, 2026, 2046, 2066,
+ 2086, 2106, 2126, 2146, 2166, 2184, 2194, 2197,
+ 2207, 2225, 2228, 2246, 2263, 2266, 2286, 2306,
+ 2326, 2346, 2366, 2384, 2394, 2397, 2407, 2425,
+ 2428, 2446, 2449, 2457, 2466, 2473, 2476, 2480,
+ 2484, 2489, 2498, 2502, 2511, 2542, 2546, 2577,
+ 2595, 2605, 2609, 2619, 2637, 2641, 2659, 2663,
+ 2671, 2688, 2692, 2707, 2714, 2718, 2725, 2753,
+ 2757, 2785, 2802, 2806, 2823, 2838, 2842, 2857,
+ 2861, 2866, 2880, 2886, 2890, 2896, 2900, 2917,
+ 2934, 2951, 2968, 2983, 2990, 2994, 3001, 3016,
+ 3020, 3035, 3039, 3044, 3053, 3056, 3065, 3068,
+ 3077, 3108, 3111, 3142, 3160, 3170, 3173, 3183,
+ 3201, 3204, 3222, 3225, 3233, 3242, 3259, 3268,
+ 3271, 3282, 3294, 3306, 3318, 3327, 3338, 3351,
+ 3359, 3368, 3376, 3385, 3393, 3402, 3411, 3419,
+ 3428, 3437, 3445, 3454, 3462, 3475, 3488, 3500,
+ 3512, 3524, 3536, 3545, 3555, 3568, 3581, 3594,
+ 3602, 3611, 3620, 3628, 3636, 3639, 3659, 3679,
+ 3699, 3719, 3739, 3759, 3779, 3799, 3817, 3827,
+ 3830, 3840, 3858, 3861, 3879, 3896, 3899, 3919,
+ 3939, 3959, 3979, 3999, 4017, 4027, 4030, 4040,
+ 4058, 4061, 4079, 4082, 4090, 4099, 4102, 4122,
+ 4142, 4162, 4182, 4200, 4210, 4213, 4223, 4241,
+ 4244, 4262, 4265, 4273, 4282, 4285, 4305, 4325,
+ 4345, 4365, 4385, 4403, 4413, 4416, 4426, 4444,
+ 4447, 4465, 4468, 4476, 4485, 4494, 4497, 4506,
+ 4537, 4540, 4571, 4589, 4599, 4602, 4612, 4630,
+ 4633, 4651, 4654, 4662, 4671, 4688, 4691, 4702,
+ 4714, 4726, 4738, 4747, 4758, 4771, 4779, 4788,
+ 4796, 4805, 4813, 4822, 4831, 4839, 4848, 4857,
+ 4865, 4874, 4882, 4895, 4908, 4920, 4932, 4944,
+ 4956, 4965, 4975, 4988, 5001, 5014, 5022, 5031,
+ 5040, 5048, 5056, 5059, 5079, 5099, 5119, 5139,
+ 5159, 5179, 5199, 5219, 5237, 5247, 5250, 5260,
+ 5278, 5281, 5299, 5316, 5319, 5339, 5359, 5379,
+ 5399, 5419, 5437, 5447, 5450, 5460, 5478, 5481,
+ 5499, 5502, 5510, 5519, 5522, 5542, 5562, 5582,
+ 5602, 5620, 5630, 5633, 5643, 5661, 5664, 5682,
+ 5685, 5693, 5702, 5705, 5725, 5745, 5765, 5785,
+ 5805, 5823, 5833, 5836, 5846, 5864, 5867, 5885,
+ 5888, 5896, 5905, 5908, 5928, 5948, 5966, 5976,
+ 5979, 5989, 6007, 6010, 6028, 6031, 6039, 6048,
+ 6057, 6061, 6070, 6101, 6105, 6136, 6154, 6164,
+ 6168, 6178, 6196, 6200, 6218, 6222, 6230, 6247,
+ 6251, 6266, 6273, 6277, 6284, 6312, 6316, 6344,
+ 6361, 6365, 6382, 6397, 6401, 6416, 6420, 6425,
+ 6439, 6445, 6449, 6455, 6459, 6476, 6493, 6510,
+ 6527, 6542, 6549, 6553, 6560, 6575, 6579, 6594,
+ 6598, 6603, 6610, 6618, 6626, 6634, 6639, 6646,
+ 6655, 6659, 6664, 6668, 6673, 6677, 6682, 6687,
+ 6691, 6697, 6702, 6706, 6711, 6715, 6724, 6733,
+ 6741, 6749, 6757, 6765, 6770, 6776, 6785, 6794,
+ 6803, 6807, 6812, 6817, 6821, 6825, 6829, 6846,
+ 6863, 6880, 6897, 6914, 6929, 6936, 6940, 6947,
+ 6962, 6966, 6981, 6985, 6990, 6999, 7002, 7011,
+ 7015, 7032, 7049, 7064, 7071, 7075, 7082, 7097,
+ 7101, 7116, 7120, 7137, 7154, 7171, 7188, 7203,
+ 7210, 7214, 7221, 7236, 7240, 7255, 7259, 7264,
+ 7273, 7276, 7285, 7288, 7297, 7328, 7331, 7362,
+ 7380, 7390, 7393, 7403, 7421, 7424, 7442, 7445,
+ 7453, 7462, 7479, 7488, 7491, 7502, 7514, 7526,
+ 7538, 7547, 7558, 7571, 7579, 7588, 7596, 7605,
+ 7613, 7622, 7631, 7639, 7648, 7657, 7665, 7674,
+ 7682, 7695, 7708, 7720, 7732, 7744, 7756, 7765,
+ 7775, 7788, 7801, 7814, 7822, 7831, 7840, 7848,
+ 7856, 7859, 7879, 7899, 7919, 7939, 7959, 7979,
+ 7999, 8019, 8037, 8047, 8050, 8060, 8078, 8081,
+ 8099, 8116, 8119, 8139, 8159, 8179, 8199, 8219,
+ 8237, 8247, 8250, 8260, 8278, 8281, 8299, 8302,
+ 8310, 8319, 8322, 8342, 8362, 8382, 8402, 8420,
+ 8430, 8433, 8443, 8461, 8464, 8482, 8485, 8493,
+ 8502, 8505, 8525, 8545, 8565, 8585, 8605, 8623,
+ 8633, 8636, 8646, 8664, 8667, 8685, 8688, 8696,
+ 8705, 8708, 8728, 8748, 8766, 8776, 8779, 8789,
+ 8807, 8810, 8828, 8831, 8839, 8848, 8851, 8871,
+ 8891, 8911, 8931, 8949, 8959, 8962, 8972, 8990,
+ 8993, 9011, 9014, 9022, 9031, 9034, 9054, 9074,
+ 9094, 9114, 9132, 9142, 9145, 9155, 9177, 9180,
+ 9202, 9221, 9240, 9259, 9278, 9287, 9306, 9325,
+ 9328, 9332, 9349, 9366, 9383, 9400, 9415, 9422,
+ 9426, 9433, 9452, 9456, 9475, 9491, 9507, 9523,
+ 9539, 9545, 9561, 9577, 9581, 9598, 9615, 9632,
+ 9649, 9664, 9671, 9675, 9682, 9697, 9701, 9716,
+ 9720, 9725, 9734, 9743, 9747, 9756, 9773, 9790,
+ 9807, 9824, 9841, 9856, 9863, 9867, 9874, 9889,
+ 9893, 9908, 9912, 9917, 9924, 9932, 9940, 9948,
+ 9953, 9960, 9969, 9973, 9978, 9982, 9987, 9991,
+ 9996, 10001, 10005, 10011, 10016, 10020, 10025, 10029,
+ 10038, 10047, 10055, 10063, 10071, 10079, 10084, 10090,
+ 10099, 10108, 10117, 10121, 10126, 10131, 10135, 10139,
+ 10143, 10160, 10177, 10192, 10199, 10203, 10210, 10225,
+ 10229, 10244, 10248, 10253, 10262, 10271, 10275, 10284,
+ 10288, 10305, 10322, 10339, 10356, 10371, 10378, 10382,
+ 10389, 10404, 10408, 10423, 10427, 10432, 10436, 10453,
+ 10470, 10487, 10504, 10519, 10526, 10530, 10537, 10556,
+ 10560, 10579, 10595, 10611, 10627, 10643, 10649, 10665,
+ 10681, 10685, 10689, 10706, 10723, 10740, 10757, 10774,
+ 10791, 10808, 10823, 10830, 10834, 10841, 10856, 10860,
+ 10875, 10889, 10893, 10904, 10916, 10928, 10940, 10949,
+ 10960, 10973, 10981, 10990, 10998, 11007, 11015, 11024,
+ 11033, 11041, 11050, 11059, 11067, 11076, 11084, 11097,
+ 11110, 11122, 11134, 11146, 11158, 11167, 11177, 11190,
+ 11203, 11216, 11224, 11233, 11242, 11250, 11258, 11262,
+ 11282, 11302, 11322, 11342, 11362, 11382, 11402, 11422,
+ 11440, 11450, 11454, 11464, 11482, 11486, 11504, 11521,
+ 11525, 11545, 11565, 11585, 11605, 11625, 11643, 11653,
+ 11657, 11667, 11685, 11689, 11707, 11711, 11719, 11723,
+ 11743, 11763, 11783, 11803, 11821, 11831, 11835, 11845,
+ 11863, 11867, 11885, 11889, 11897, 11901, 11921, 11941,
+ 11961, 11981, 12001, 12019, 12029, 12033, 12043, 12061,
+ 12065, 12083, 12087, 12095, 12099, 12119, 12139, 12157,
+ 12167, 12171, 12181, 12199, 12203, 12221, 12225, 12245,
+ 12265, 12285, 12305, 12323, 12333, 12337, 12347, 12365,
+ 12369, 12387, 12391, 12399, 12403, 12423, 12443, 12463,
+ 12483, 12501, 12511, 12515, 12525, 12547, 12551, 12573,
+ 12592, 12611, 12630, 12649, 12658, 12677, 12696, 12700,
+ 12703, 12723, 12743, 12763, 12783, 12801, 12811, 12814,
+ 12824, 12842, 12845, 12863, 12866, 12874, 12883, 12886,
+ 12906, 12926, 12946, 12966, 12984, 12994, 12997, 13007,
+ 13029, 13032, 13054, 13073, 13092, 13111, 13130, 13139,
+ 13158, 13177, 13180, 13183, 13203, 13223, 13241, 13251,
+ 13254, 13264, 13282, 13285, 13303, 13306, 13314, 13323,
+ 13326, 13346, 13366, 13386, 13406, 13424, 13434, 13437,
+ 13447, 13465, 13468, 13486, 13489, 13497, 13506, 13509,
+ 13529, 13549, 13569, 13589, 13607, 13617, 13620, 13630,
+ 13652, 13655, 13677, 13696, 13715, 13734, 13753, 13762,
+ 13781, 13800, 13803, 13807, 13824, 13841, 13858, 13875,
+ 13890, 13897, 13901, 13908, 13923, 13927, 13942, 13946,
+ 13963, 13980, 13997, 14014, 14031, 14048, 14065, 14080,
+ 14087, 14091, 14098, 14113, 14117, 14132, 14146, 14150,
+ 14161, 14173, 14185, 14197, 14206, 14217, 14230, 14238,
+ 14247, 14255, 14264, 14272, 14281, 14290, 14298, 14307,
+ 14316, 14324, 14333, 14341, 14354, 14367, 14379, 14391,
+ 14403, 14415, 14424, 14434, 14447, 14460, 14473, 14481,
+ 14490, 14499, 14507, 14515, 14519, 14539, 14559, 14579,
+ 14599, 14619, 14639, 14659, 14679, 14697, 14707, 14711,
+ 14721, 14739, 14743, 14761, 14778, 14782, 14802, 14822,
+ 14842, 14862, 14882, 14900, 14910, 14914, 14924, 14942,
+ 14946, 14964, 14968, 14988, 15008, 15028, 15048, 15066,
+ 15076, 15080, 15090, 15108, 15112, 15130, 15134, 15142,
+ 15146, 15166, 15186, 15206, 15226, 15246, 15264, 15274,
+ 15278, 15288, 15306, 15310, 15328, 15332, 15340, 15344,
+ 15364, 15384, 15402, 15412, 15416, 15426, 15444, 15448,
+ 15466, 15470, 15478, 15482, 15502, 15522, 15542, 15562,
+ 15580, 15590, 15594, 15604, 15622, 15626, 15644, 15648,
+ 15656, 15660, 15680, 15700, 15720, 15740, 15758, 15768,
+ 15772, 15782, 15804, 15808, 15830, 15849, 15868, 15887,
+ 15906, 15915, 15934, 15953, 15957, 15960, 15980, 16000,
+ 16020, 16040, 16058, 16068, 16071, 16081, 16099, 16102,
+ 16120, 16123, 16131, 16134, 16154, 16174, 16194, 16214,
+ 16234, 16252, 16262, 16265, 16275, 16293, 16296, 16314,
+ 16317, 16325, 16328, 16348, 16368, 16386, 16396, 16399,
+ 16409, 16427, 16430, 16448, 16451, 16459, 16468, 16471,
+ 16491, 16511, 16531, 16551, 16569, 16579, 16582, 16592,
+ 16610, 16613, 16631, 16634, 16642, 16645, 16665, 16685,
+ 16705, 16725, 16743, 16753, 16756, 16766, 16788, 16791,
+ 16813, 16832, 16851, 16870, 16889, 16898, 16917, 16936,
+ 16939, 16942, 16958, 16974, 16990, 17006, 17020, 17026,
+ 17029, 17035, 17050, 17053, 17068, 17071, 17076, 17083,
+ 17086, 17102, 17118, 17134, 17150, 17166, 17182, 17198,
+ 17212, 17218, 17221, 17227, 17242, 17245, 17260, 17273,
+ 17276, 17292, 17308, 17324, 17340, 17356, 17370, 17376,
+ 17379, 17385, 17400, 17403, 17418, 17421, 17426, 17433,
+ 17440, 17444, 17449, 17458, 17461, 17470, 17473, 17482,
+ 17513, 17516, 17547, 17565, 17575, 17578, 17588, 17606,
+ 17609, 17627, 17644, 17653, 17656, 17667, 17679, 17691,
+ 17703, 17712, 17723, 17736, 17744, 17753, 17761, 17770,
+ 17778, 17787, 17796, 17804, 17813, 17822, 17830, 17839,
+ 17847, 17860, 17873, 17885, 17897, 17909, 17921, 17930,
+ 17940, 17953, 17966, 17979, 17987, 17996, 18005, 18013,
+ 18021, 18024, 18044, 18064, 18084, 18104, 18124, 18144,
+ 18164, 18184, 18202, 18212, 18215, 18225, 18243, 18246,
+ 18264, 18281, 18284, 18304, 18324, 18344, 18364, 18384,
+ 18402, 18412, 18415, 18425, 18443, 18446, 18464, 18467,
+ 18475, 18484, 18487, 18507, 18527, 18547, 18567, 18585,
+ 18595, 18598, 18608, 18626, 18629, 18647, 18650, 18670,
+ 18690, 18710, 18730, 18750, 18768, 18778, 18781, 18791,
+ 18809, 18812, 18830, 18833, 18853, 18873, 18891, 18901,
+ 18904, 18914, 18932, 18935, 18953, 18956, 18964, 18973,
+ 18976, 18996, 19016, 19036, 19056, 19074, 19084, 19087,
+ 19097, 19115, 19118, 19136, 19139, 19159, 19179, 19199,
+ 19219, 19237, 19247, 19250, 19260, 19282, 19285, 19307,
+ 19326, 19345, 19364, 19383, 19392, 19411, 19430, 19433,
+ 19436, 19452, 19468, 19482, 19488, 19491, 19497, 19512,
+ 19515, 19530, 19533, 19538, 19545, 19552, 19556, 19561,
+ 19564, 19568, 19572, 19576, 19580, 19584, 19588, 19591,
+ 19595, 19598, 19601, 19603, 19607, 19611, 19615, 19619,
+ 19646, 19650, 19654, 19658, 19662, 19689, 19693, 19697,
+ 19701, 19705, 19732, 19736, 19740, 19744, 19748, 19775,
+ 19779, 19783, 19787, 19790, 19817, 19821, 19825, 19829,
+ 19833, 19860, 19864, 19868, 19895, 19900, 19927, 19954,
+ 19958, 19962, 19966, 19970, 19974, 20001, 20005, 20009,
+ 20036, 20040, 20044, 20048, 20051, 20056, 20061, 20066,
+ 20071, 20076, 20081, 20109, 20114, 20119, 20147, 20152,
+ 20157, 20162, 20190, 20195, 20200, 20205, 20232, 20259,
+ 20263, 20267, 20271, 20275, 20279, 20306, 20310, 20314,
+ 20341, 20345, 20349, 20353, 20380, 20384, 20388, 20392,
+ 20419, 20423, 20427, 20431, 20435, 20439, 20443, 20447,
+ 20451, 20478, 20505, 20509, 20513, 20540, 20544, 20548,
+ 20552, 20579, 20583, 20587, 20591, 20618, 20622, 20626,
+ 20630, 20657, 20661, 20665, 20669, 20674, 20679, 20684,
+ 20689, 20694, 20722, 20727, 20732, 20760, 20765, 20770,
+ 20775, 20803, 20808, 20813, 20818, 20846, 20851, 20856,
+ 20861, 20888, 20916, 20921, 20926, 20954, 20959, 20964,
+ 20969, 20996, 21023, 21027, 21031, 21035, 21039, 21043,
+ 21070, 21074, 21078, 21105, 21109, 21113, 21117, 21144,
+ 21148, 21152, 21156, 21183, 21187, 21191, 21195, 21222,
+ 21226, 21230, 21234, 21261, 21265, 21269, 21273, 21300,
+ 21304, 21308, 21335, 21363, 21368, 21373, 21401, 21406,
+ 21411, 21416, 21444, 21449, 21454, 21459, 21487, 21492,
+ 21497, 21502, 21530, 21558, 21563, 21568, 21573, 21601,
+ 21606, 21611, 21639, 21667, 21672, 21677, 21705, 21733,
+ 21738, 21743, 21771, 21776, 21781, 21786, 21814, 21819,
+ 21824, 21829, 21857, 21862, 21867, 21872, 21900, 21905,
+ 21910, 21938, 21943, 21948, 21953, 21981, 21986, 21991,
+ 22019, 22046, 22050, 22054, 22058, 22085, 22089, 22093,
+ 22120, 22147, 22151, 22155, 22159, 22186, 22190, 22194,
+ 22198, 22225, 22229, 22233, 22260, 22288, 22293, 22298,
+ 22326, 22331, 22336, 22364, 22392, 22397, 22402, 22430,
+ 22435, 22440, 22468, 22473, 22478, 22483, 22511, 22516,
+ 22521, 22526, 22554, 22559, 22564, 22569, 22597, 22602,
+ 22607, 22612, 22640, 22645, 22650, 22678, 22705, 22709,
+ 22713, 22717, 22744, 22748, 22752, 22756, 22783, 22787,
+ 22791, 22795, 22822, 22826, 22830, 22834, 22861, 22865,
+ 22869, 22896, 22923, 22927, 22931, 22935, 22962, 22966,
+ 22970, 22997, 23001, 23005, 23009, 23014, 23041, 23068,
+ 23072, 23076, 23080, 23084, 23111, 23115, 23119, 23146,
+ 23150, 23154, 23158, 23185, 23189, 23193, 23220, 23224,
+ 23228, 23255, 23259, 23263, 23267, 23294, 23298, 23302,
+ 23329, 23333, 23337, 23364, 23391, 23395, 23399, 23403,
+ 23408
+ };
-static const char _thttp_machine_parser_header_WWW_Authenticate_trans_actions[] = {
- 9, 0, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 27, 0, 27, 0, 0,
- 0, 0, 0, 5, 5, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 27,
- 0, 25, 25, 0, 25, 0, 0, 0,
- 0, 27, 0, 0, 1, 1, 27, 0,
- 0, 27, 0, 0, 0, 0, 0, 27,
- 0, 0, 27, 0, 0, 0, 0, 27,
- 25, 25, 0, 0, 27, 0, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 1, 1, 1, 27, 1, 1,
- 27, 0, 0, 0, 0, 0, 27, 15,
- 15, 15, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 27, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 1, 1, 1, 27, 1, 1, 27,
- 0, 0, 0, 0, 0, 27, 17, 17,
- 17, 27, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 0, 27, 0, 0,
- 27, 0, 1, 1, 1, 38, 1, 0,
- 0, 0, 23, 0, 0, 27, 0, 0,
- 27, 0, 0, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 1, 1,
- 1, 27, 1, 1, 27, 0, 0, 0,
- 0, 0, 27, 11, 11, 11, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 0, 1, 1, 27, 0, 0,
- 0, 0, 0, 19, 19, 19, 0, 27,
- 27, 23, 0, 0, 0, 27, 0, 0,
- 27, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 27, 0, 25, 25, 0,
- 25, 0, 0, 0, 27, 0, 0, 0,
- 0, 0, 27, 0, 0, 27, 0, 25,
- 25, 0, 0, 27, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 27, 0,
- 0, 0, 0, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 0, 1,
- 27, 0, 21, 21, 0, 21, 27, 0,
- 0, 0, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 0, 27, 0, 0,
- 27, 0, 1, 1, 41, 41, 29, 41,
- 1, 0, 0, 0, 13, 0, 0, 27,
- 27, 13, 0, 0, 0, 27, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 27, 0, 25, 25, 0, 25, 0, 0,
- 0, 27, 0, 0, 0, 0, 27, 0,
- 0, 27, 0, 25, 25, 27, 25, 25,
- 0, 25, 0, 0, 0, 0, 27, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 27, 0, 0, 27, 0, 0, 0,
- 0, 27, 0, 0, 27, 0, 25, 25,
- 0, 0, 27, 0, 27, 0, 0, 0,
- 0, 25, 25, 0, 0, 0, 27, 0,
- 1, 1, 47, 27, 1, 1, 27, 0,
- 13, 0, 0, 0, 27, 0, 0, 27,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 27, 0, 25, 25, 0, 25,
- 0, 0, 0, 27, 0, 0, 0, 0,
- 0, 27, 0, 0, 27, 0, 15, 15,
- 15, 25, 25, 0, 0, 27, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 27, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 1, 27, 0, 21, 21, 0,
- 21, 27, 0, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 0, 0,
- 27, 0, 0, 27, 0, 32, 32, 32,
- 27, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 1, 1, 1, 27,
- 1, 1, 27, 0, 0, 15, 15, 15,
- 27, 0, 0, 0, 0, 0, 25, 25,
- 0, 0, 0, 27, 0, 1, 1, 1,
- 27, 1, 1, 27, 0, 0, 15, 15,
- 15, 0, 0, 0, 27, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 27,
- 0, 25, 25, 0, 25, 0, 0, 0,
- 27, 0, 0, 0, 0, 0, 27, 0,
- 0, 27, 0, 17, 17, 17, 25, 25,
- 27, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 27, 0, 0, 0,
- 0, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 1, 27, 0,
- 21, 21, 0, 21, 27, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 35, 35, 35, 27, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 1, 27, 1, 1, 27, 0, 0,
- 17, 17, 17, 27, 0, 0, 0, 0,
- 0, 25, 25, 0, 0, 0, 27, 0,
- 1, 1, 1, 27, 1, 1, 27, 0,
- 0, 17, 17, 17, 27, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 0, 0,
- 27, 0, 0, 27, 0, 53, 53, 53,
- 0, 0, 0, 27, 0, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 27, 0,
- 25, 25, 0, 25, 0, 0, 0, 27,
- 0, 0, 0, 0, 27, 0, 0, 27,
- 0, 25, 25, 27, 25, 25, 0, 25,
- 0, 0, 0, 0, 27, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 27,
- 0, 0, 27, 0, 0, 0, 0, 27,
- 0, 0, 27, 0, 25, 25, 0, 0,
- 27, 0, 27, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 1, 1,
- 38, 27, 1, 1, 27, 0, 23, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 27, 0, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 38, 27, 1, 1, 27, 0, 23,
- 0, 0, 27, 0, 0, 27, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 0,
- 27, 0, 27, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 1, 1,
- 38, 27, 1, 1, 27, 0, 23, 0,
- 0, 0, 27, 0, 0, 27, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 27, 0, 25, 25, 0, 25, 0, 0,
- 0, 27, 0, 0, 0, 0, 0, 27,
- 0, 0, 27, 0, 11, 11, 11, 25,
- 25, 0, 0, 27, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 27,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 0,
- 1, 27, 0, 21, 21, 0, 21, 27,
- 0, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 0, 27, 0,
- 0, 27, 0, 44, 44, 44, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 1, 1, 1, 27, 1, 1,
- 27, 0, 0, 11, 11, 11, 27, 0,
- 0, 0, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 1, 1, 1, 27, 1,
- 1, 27, 0, 0, 11, 11, 11, 27,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 44, 44, 44, 27, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 1, 27, 1, 1, 27, 0, 0,
- 11, 11, 11, 27, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 0,
- 1, 1, 27, 0, 0, 0, 0, 0,
- 19, 19, 19, 0, 27, 27, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 1, 1, 27, 0, 0, 0,
- 0, 0, 19, 19, 19, 0, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 0, 23, 27, 0, 0, 27,
- 0, 1, 1, 1, 0, 0, 27, 0,
- 0, 0, 0, 0, 0, 0, 25, 25,
- 0, 0, 0, 27, 0, 1, 1, 47,
- 27, 1, 1, 27, 0, 13, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 27, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 13, 27, 0, 0,
- 27, 0, 1, 1, 1, 0, 0, 27,
- 0, 0, 27, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 1, 1,
- 29, 27, 1, 1, 27, 0, 13, 27,
- 0, 0, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 1, 1, 27, 0,
- 0, 0, 0, 0, 19, 19, 19, 0,
- 27, 27, 0, 0, 0, 0, 0, 0,
- 0, 25, 25, 0, 0, 0, 27, 0,
- 0, 1, 27, 0, 21, 21, 0, 21,
- 27, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 27, 0, 0, 0,
- 0, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 1, 27, 0,
- 21, 21, 0, 21, 27, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 27, 0, 0, 27, 0, 27,
- 0, 0, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 1, 1, 27, 1, 1,
- 27, 0, 27, 0, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 27, 1, 1, 27, 0, 27, 0,
- 0, 25, 25, 0, 0, 0, 27, 0,
- 0, 27, 0, 27, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 27, 1, 1, 27, 0, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 0, 1, 1, 27, 0, 0,
- 0, 0, 0, 19, 19, 19, 0, 27,
- 27, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 1, 1, 1, 27,
- 1, 1, 27, 0, 0, 17, 17, 17,
- 27, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 1, 1, 27,
- 0, 0, 0, 0, 0, 19, 19, 19,
- 0, 27, 27, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 0, 27, 0,
- 0, 27, 0, 50, 50, 50, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 1, 1, 1, 27, 1, 1,
- 27, 0, 0, 15, 15, 15, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 0, 1, 1, 27, 0, 0,
- 0, 0, 0, 19, 19, 19, 0, 27,
- 27, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 27, 0, 27,
- 0, 0, 0, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 0, 1,
- 27, 0, 21, 21, 0, 21, 27, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 27, 0, 0, 0, 0, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 0, 1, 27, 0, 21, 21,
- 0, 21, 27, 0, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 0,
- 27, 0, 27, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 1, 1,
- 27, 1, 1, 27, 0, 27, 0, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 1, 1, 27, 1, 1, 27,
- 0, 27, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 27, 0, 0, 27,
- 0, 27, 0, 0, 0, 0, 25, 25,
- 0, 0, 0, 27, 0, 1, 1, 27,
- 1, 1, 27, 0, 27, 0, 0, 0,
- 0, 25, 25, 0, 0, 0, 27, 0,
- 0, 1, 1, 27, 0, 0, 0, 0,
- 0, 19, 19, 19, 0, 27, 27, 0,
- 0, 0, 0, 25, 25, 0, 0, 0,
- 27, 0, 1, 1, 1, 27, 1, 1,
- 27, 0, 27, 0, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 1, 27, 1, 1, 27, 0, 27,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 41, 41, 41, 27, 0, 0, 0, 0,
- 25, 25, 0, 0, 0, 27, 0, 1,
- 1, 1, 27, 1, 1, 27, 0, 27,
- 0, 0, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 1, 1, 27, 0,
- 0, 0, 0, 0, 19, 19, 19, 0,
- 27, 27, 0, 0, 0, 0, 25, 25,
- 0, 0, 0, 27, 0, 0, 0, 27,
- 0, 0, 27, 0, 1, 27, 0, 0,
- 0, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 0, 1, 27, 0,
- 21, 21, 0, 21, 27, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 1, 1, 1, 0, 0, 0, 27, 13,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 27, 0, 25, 25, 0, 25, 0,
- 0, 0, 27, 0, 0, 0, 0, 27,
- 0, 25, 25, 0, 0, 27, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 27, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 1, 27, 0, 21, 21, 0,
- 21, 27, 0, 0, 0, 0, 0, 25,
- 25, 0, 0, 0, 27, 0, 0, 0,
- 27, 0, 0, 27, 0, 56, 56, 56,
- 27, 0, 0, 0, 0, 25, 25, 0,
- 0, 0, 27, 0, 1, 1, 27, 1,
- 27, 0, 0, 0, 0, 0, 25, 25,
- 0, 0, 0, 27, 0, 1, 1, 27,
- 1, 27, 0, 0, 25, 25, 0, 0,
- 0, 27, 0, 0, 0, 27, 0, 0,
- 27, 0, 56, 56, 56, 27, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 1, 1, 27, 1, 27, 0, 0,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 1, 1, 27, 0, 0, 0,
- 0, 0, 19, 19, 19, 0, 27, 27,
- 0, 0, 25, 25, 0, 0, 0, 27,
- 0, 0, 0, 27, 0, 0, 27, 0,
- 1, 1, 1, 0, 0, 0, 27, 23,
- 27, 0, 0, 0, 0, 0, 3, 3,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
+ static const short _thttp_machine_parser_header_WWW_Authenticate_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 1, 8, 8, 1, 9, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 19,
+ 19, 20, 1, 22, 23, 22, 24, 25,
+ 24, 25, 21, 26, 21, 27, 26, 21,
+ 22, 28, 22, 24, 25, 24, 25, 21,
+ 29, 26, 21, 30, 26, 30, 24, 25,
+ 24, 25, 21, 26, 31, 31, 21, 26,
+ 32, 32, 21, 26, 33, 33, 21, 26,
+ 34, 34, 21, 35, 36, 35, 21, 37,
+ 38, 37, 39, 39, 39, 40, 41, 42,
+ 43, 44, 45, 46, 40, 41, 42, 43,
+ 44, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 47, 26, 21, 48, 26, 48,
+ 39, 39, 39, 40, 41, 42, 43, 44,
+ 45, 46, 40, 41, 42, 43, 44, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 49, 50, 49, 51, 51, 51, 52, 53,
+ 51, 51, 51, 51, 51, 21, 54, 55,
+ 54, 56, 53, 21, 57, 26, 21, 58,
+ 26, 58, 56, 53, 21, 56, 59, 56,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 62, 26, 21, 63, 26, 63, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 64, 64,
+ 51, 51, 51, 51, 51, 21, 65, 26,
+ 21, 49, 50, 49, 51, 51, 51, 52,
+ 53, 66, 66, 51, 51, 51, 51, 51,
+ 21, 53, 67, 53, 68, 69, 68, 68,
+ 70, 68, 68, 68, 68, 68, 68, 21,
+ 71, 26, 21, 72, 73, 72, 68, 69,
+ 68, 68, 70, 68, 68, 68, 68, 68,
+ 68, 21, 74, 26, 21, 75, 26, 75,
+ 69, 21, 76, 77, 78, 21, 21, 21,
+ 69, 79, 26, 21, 80, 81, 80, 52,
+ 21, 82, 83, 82, 56, 21, 84, 26,
+ 21, 85, 26, 85, 56, 21, 86, 26,
+ 21, 49, 50, 49, 51, 51, 51, 52,
+ 53, 87, 87, 51, 51, 51, 51, 51,
+ 21, 49, 50, 49, 51, 51, 51, 52,
+ 53, 88, 88, 51, 51, 51, 51, 51,
+ 21, 49, 50, 49, 51, 51, 51, 52,
+ 53, 89, 89, 51, 51, 51, 51, 51,
+ 21, 49, 50, 49, 51, 51, 51, 52,
+ 53, 90, 90, 51, 51, 51, 51, 51,
+ 21, 91, 92, 91, 51, 51, 51, 52,
+ 93, 51, 51, 51, 51, 51, 21, 94,
+ 95, 94, 56, 93, 21, 96, 26, 21,
+ 97, 26, 97, 56, 93, 21, 98, 99,
+ 98, 68, 100, 68, 68, 70, 68, 68,
+ 68, 68, 68, 68, 21, 101, 26, 21,
+ 102, 103, 102, 68, 100, 68, 68, 70,
+ 68, 68, 68, 68, 68, 68, 21, 104,
+ 26, 21, 105, 26, 105, 106, 21, 107,
+ 108, 109, 21, 21, 21, 106, 110, 26,
+ 21, 111, 112, 111, 113, 21, 26, 106,
+ 106, 21, 80, 81, 80, 68, 68, 68,
+ 52, 68, 68, 68, 68, 68, 21, 26,
+ 115, 114, 114, 114, 21, 26, 117, 77,
+ 116, 116, 116, 21, 26, 117, 77, 118,
+ 118, 118, 21, 26, 117, 77, 119, 119,
+ 119, 21, 26, 117, 77, 21, 26, 121,
+ 120, 114, 114, 21, 26, 122, 117, 77,
+ 123, 116, 116, 21, 26, 124, 21, 26,
+ 125, 126, 21, 26, 127, 21, 26, 128,
+ 129, 21, 26, 130, 21, 26, 77, 131,
+ 21, 26, 77, 132, 21, 26, 77, 21,
+ 26, 128, 133, 21, 26, 128, 21, 26,
+ 125, 134, 21, 26, 125, 21, 26, 122,
+ 117, 77, 135, 118, 118, 21, 26, 122,
+ 117, 77, 119, 119, 119, 21, 26, 137,
+ 77, 136, 136, 136, 21, 26, 139, 77,
+ 138, 138, 138, 21, 26, 139, 77, 140,
+ 140, 140, 21, 26, 139, 77, 141, 141,
+ 141, 21, 26, 139, 77, 21, 26, 142,
+ 136, 136, 21, 26, 122, 139, 77, 143,
+ 138, 138, 21, 26, 122, 139, 77, 144,
+ 140, 140, 21, 26, 122, 139, 77, 141,
+ 141, 141, 21, 26, 145, 21, 26, 122,
+ 146, 21, 26, 122, 147, 21, 26, 122,
+ 21, 26, 121, 21, 148, 26, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 149,
+ 149, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 150,
+ 150, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 151,
+ 151, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 152,
+ 152, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 153,
+ 153, 51, 51, 51, 51, 51, 21, 154,
+ 155, 154, 51, 51, 51, 52, 156, 51,
+ 51, 51, 51, 51, 21, 157, 158, 157,
+ 56, 156, 21, 159, 26, 21, 160, 26,
+ 160, 56, 156, 21, 161, 162, 161, 68,
+ 163, 68, 68, 70, 68, 68, 68, 68,
+ 68, 68, 21, 164, 26, 21, 165, 166,
+ 165, 68, 163, 68, 68, 70, 68, 68,
+ 68, 68, 68, 68, 21, 167, 26, 21,
+ 168, 26, 168, 169, 21, 170, 171, 172,
+ 21, 21, 21, 169, 173, 26, 21, 174,
+ 175, 174, 176, 21, 26, 169, 169, 21,
+ 177, 26, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 178, 178, 51, 51, 51,
+ 51, 51, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 179, 179, 51, 51, 51,
+ 51, 51, 21, 180, 181, 180, 51, 51,
+ 51, 52, 182, 51, 51, 51, 51, 51,
+ 21, 183, 184, 183, 56, 182, 21, 185,
+ 26, 21, 186, 26, 186, 56, 182, 21,
+ 182, 187, 182, 68, 188, 68, 68, 70,
+ 68, 68, 68, 68, 68, 68, 21, 189,
+ 26, 21, 190, 191, 190, 68, 188, 68,
+ 68, 70, 68, 68, 68, 68, 68, 68,
+ 21, 192, 26, 21, 193, 26, 193, 188,
+ 21, 196, 197, 198, 195, 195, 195, 194,
+ 201, 202, 203, 200, 200, 200, 199, 204,
+ 202, 200, 205, 204, 202, 200, 206, 207,
+ 206, 56, 21, 208, 26, 21, 209, 210,
+ 209, 56, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 211, 211, 51, 51, 51,
+ 51, 51, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 212, 212, 51, 51, 51,
+ 51, 51, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 213, 213, 51, 51, 51,
+ 51, 51, 21, 49, 50, 49, 51, 51,
+ 51, 52, 53, 214, 214, 51, 51, 51,
+ 51, 51, 21, 215, 216, 215, 51, 51,
+ 51, 52, 217, 51, 51, 51, 51, 51,
+ 21, 218, 219, 218, 56, 217, 21, 220,
+ 26, 21, 221, 26, 221, 56, 217, 21,
+ 222, 223, 222, 68, 224, 68, 68, 70,
+ 68, 68, 68, 68, 68, 68, 21, 225,
+ 26, 21, 226, 227, 226, 68, 224, 68,
+ 68, 70, 68, 68, 68, 68, 68, 68,
+ 21, 228, 26, 21, 229, 26, 229, 230,
+ 21, 231, 232, 233, 21, 21, 21, 230,
+ 234, 26, 21, 235, 236, 235, 237, 21,
+ 26, 230, 230, 21, 238, 26, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 239,
+ 239, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 240,
+ 240, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 241,
+ 241, 51, 51, 51, 51, 51, 21, 49,
+ 50, 49, 51, 51, 51, 52, 53, 242,
+ 242, 51, 51, 51, 51, 51, 21, 243,
+ 244, 243, 51, 51, 51, 52, 245, 51,
+ 51, 51, 51, 51, 21, 246, 247, 246,
+ 56, 245, 21, 248, 26, 21, 249, 26,
+ 249, 56, 245, 21, 245, 250, 245, 68,
+ 69, 68, 68, 251, 252, 70, 251, 252,
+ 68, 68, 68, 68, 68, 68, 21, 253,
+ 26, 21, 254, 73, 254, 68, 69, 68,
+ 68, 251, 252, 70, 251, 252, 68, 68,
+ 68, 68, 68, 68, 21, 80, 81, 80,
+ 68, 68, 68, 52, 255, 255, 68, 68,
+ 68, 68, 68, 21, 80, 81, 80, 68,
+ 68, 68, 52, 256, 256, 68, 68, 68,
+ 68, 68, 21, 80, 81, 80, 68, 68,
+ 68, 52, 257, 257, 68, 68, 68, 68,
+ 68, 21, 80, 81, 80, 68, 68, 68,
+ 52, 258, 258, 68, 68, 68, 68, 68,
+ 21, 259, 260, 259, 261, 21, 80, 81,
+ 80, 68, 68, 68, 52, 262, 262, 68,
+ 68, 68, 68, 68, 21, 80, 81, 80,
+ 68, 68, 68, 52, 257, 257, 68, 68,
+ 68, 68, 68, 21, 263, 26, 21, 264,
+ 204, 202, 200, 204, 265, 199, 199, 200,
+ 266, 267, 266, 77, 268, 78, 21, 21,
+ 69, 269, 26, 21, 270, 271, 270, 77,
+ 268, 78, 21, 21, 69, 272, 26, 21,
+ 273, 76, 273, 77, 268, 78, 21, 21,
+ 69, 268, 274, 268, 275, 77, 275, 275,
+ 276, 277, 278, 279, 280, 281, 282, 78,
+ 276, 277, 278, 279, 280, 281, 282, 275,
+ 21, 21, 275, 275, 275, 275, 275, 69,
+ 283, 26, 21, 284, 76, 284, 275, 77,
+ 275, 275, 276, 277, 278, 279, 280, 281,
+ 282, 78, 276, 277, 278, 279, 280, 281,
+ 282, 275, 21, 21, 275, 275, 275, 275,
+ 275, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 78, 287, 21, 21, 287,
+ 287, 287, 287, 69, 290, 291, 290, 77,
+ 268, 289, 78, 21, 21, 69, 292, 26,
+ 21, 293, 76, 293, 77, 268, 289, 78,
+ 21, 21, 69, 289, 294, 289, 295, 296,
+ 295, 295, 297, 78, 295, 21, 21, 295,
+ 295, 295, 295, 295, 69, 298, 26, 21,
+ 299, 300, 299, 295, 296, 295, 295, 297,
+ 78, 295, 21, 21, 295, 295, 295, 295,
+ 295, 69, 301, 26, 21, 302, 76, 302,
+ 296, 78, 21, 21, 69, 303, 304, 303,
+ 77, 288, 78, 21, 21, 69, 305, 306,
+ 305, 77, 268, 78, 21, 21, 69, 307,
+ 26, 21, 26, 69, 69, 21, 303, 304,
+ 303, 295, 77, 295, 295, 288, 78, 295,
+ 21, 21, 295, 295, 295, 295, 69, 76,
+ 77, 309, 78, 21, 21, 21, 308, 308,
+ 308, 69, 76, 77, 311, 78, 296, 21,
+ 21, 21, 310, 310, 310, 69, 76, 77,
+ 311, 78, 296, 21, 21, 21, 312, 312,
+ 312, 69, 76, 77, 311, 78, 296, 21,
+ 21, 21, 313, 313, 313, 69, 76, 77,
+ 311, 78, 296, 21, 21, 21, 69, 76,
+ 77, 315, 78, 21, 21, 21, 314, 308,
+ 308, 69, 76, 77, 316, 311, 78, 296,
+ 21, 21, 21, 317, 310, 310, 69, 76,
+ 77, 78, 21, 21, 21, 318, 69, 76,
+ 77, 319, 78, 21, 21, 21, 320, 69,
+ 76, 77, 78, 21, 21, 21, 321, 69,
+ 76, 77, 322, 78, 21, 21, 21, 323,
+ 69, 76, 77, 78, 21, 21, 21, 324,
+ 69, 76, 77, 78, 296, 21, 21, 21,
+ 325, 69, 76, 77, 78, 296, 21, 21,
+ 21, 326, 69, 76, 77, 78, 296, 21,
+ 21, 21, 69, 76, 77, 322, 78, 21,
+ 21, 21, 327, 69, 76, 77, 322, 78,
+ 21, 21, 21, 69, 76, 77, 319, 78,
+ 21, 21, 21, 328, 69, 76, 77, 319,
+ 78, 21, 21, 21, 69, 76, 77, 316,
+ 311, 78, 296, 21, 21, 21, 329, 312,
+ 312, 69, 76, 77, 316, 311, 78, 296,
+ 21, 21, 21, 313, 313, 313, 69, 76,
+ 77, 331, 78, 296, 21, 21, 21, 330,
+ 330, 330, 69, 76, 77, 333, 78, 296,
+ 21, 21, 21, 332, 332, 332, 69, 76,
+ 77, 333, 78, 296, 21, 21, 21, 334,
+ 334, 334, 69, 76, 77, 333, 78, 296,
+ 21, 21, 21, 335, 335, 335, 69, 76,
+ 77, 333, 78, 296, 21, 21, 21, 69,
+ 76, 77, 78, 21, 21, 21, 336, 330,
+ 330, 69, 76, 77, 316, 333, 78, 296,
+ 21, 21, 21, 337, 332, 332, 69, 76,
+ 77, 316, 333, 78, 296, 21, 21, 21,
+ 338, 334, 334, 69, 76, 77, 316, 333,
+ 78, 296, 21, 21, 21, 335, 335, 335,
+ 69, 76, 77, 78, 21, 21, 21, 339,
+ 69, 76, 77, 316, 78, 21, 21, 21,
+ 340, 69, 76, 77, 316, 78, 21, 21,
+ 21, 341, 69, 76, 77, 316, 78, 21,
+ 21, 21, 69, 76, 77, 315, 78, 21,
+ 21, 21, 69, 342, 26, 21, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 343,
+ 78, 343, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 344, 78, 344, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 345,
+ 78, 345, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 346, 78, 346, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 347,
+ 78, 347, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 348, 78, 348, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 349,
+ 78, 349, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 350, 78, 350, 287, 21,
+ 21, 287, 287, 287, 287, 69, 351, 352,
+ 351, 287, 77, 287, 287, 288, 353, 78,
+ 287, 21, 21, 287, 287, 287, 287, 69,
+ 354, 355, 354, 77, 268, 353, 78, 21,
+ 21, 69, 356, 26, 21, 357, 76, 357,
+ 77, 268, 353, 78, 21, 21, 69, 353,
+ 358, 353, 359, 296, 359, 359, 297, 78,
+ 359, 21, 21, 359, 359, 359, 359, 359,
+ 69, 360, 26, 21, 361, 300, 361, 359,
+ 296, 359, 359, 297, 78, 359, 21, 21,
+ 359, 359, 359, 359, 359, 69, 362, 363,
+ 362, 364, 77, 364, 364, 365, 78, 364,
+ 21, 21, 364, 364, 364, 364, 69, 366,
+ 26, 21, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 367, 78, 367, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 368,
+ 78, 368, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 369, 78, 369, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 370,
+ 78, 370, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 371, 78, 371, 287, 21,
+ 21, 287, 287, 287, 287, 69, 372, 373,
+ 372, 287, 77, 287, 287, 288, 374, 78,
+ 287, 21, 21, 287, 287, 287, 287, 69,
+ 375, 376, 375, 77, 268, 374, 78, 21,
+ 21, 69, 377, 26, 21, 378, 76, 378,
+ 77, 268, 374, 78, 21, 21, 69, 374,
+ 379, 374, 295, 380, 295, 295, 297, 78,
+ 295, 21, 21, 295, 295, 295, 295, 295,
+ 69, 381, 26, 21, 382, 383, 382, 295,
+ 380, 295, 295, 297, 78, 295, 21, 21,
+ 295, 295, 295, 295, 295, 69, 384, 26,
+ 21, 385, 76, 385, 380, 78, 21, 21,
+ 69, 388, 389, 388, 390, 391, 392, 387,
+ 387, 386, 395, 396, 397, 394, 394, 394,
+ 393, 398, 396, 394, 399, 398, 396, 394,
+ 400, 398, 396, 394, 398, 401, 393, 393,
+ 394, 402, 403, 402, 396, 404, 397, 394,
+ 394, 393, 405, 398, 396, 394, 406, 395,
+ 406, 396, 404, 397, 394, 394, 393, 404,
+ 407, 404, 408, 396, 408, 408, 409, 410,
+ 411, 412, 413, 414, 415, 397, 409, 410,
+ 411, 412, 413, 414, 415, 408, 394, 394,
+ 408, 408, 408, 408, 408, 393, 416, 398,
+ 396, 394, 417, 395, 417, 408, 396, 408,
+ 408, 409, 410, 411, 412, 413, 414, 415,
+ 397, 409, 410, 411, 412, 413, 414, 415,
+ 408, 394, 394, 408, 408, 408, 408, 408,
+ 393, 418, 419, 418, 420, 396, 420, 420,
+ 421, 422, 397, 420, 394, 394, 420, 420,
+ 420, 420, 393, 423, 424, 423, 396, 404,
+ 422, 397, 394, 394, 393, 425, 398, 396,
+ 394, 426, 395, 426, 396, 404, 422, 397,
+ 394, 394, 393, 422, 427, 422, 428, 401,
+ 428, 428, 429, 397, 428, 394, 394, 428,
+ 428, 428, 428, 428, 393, 430, 398, 396,
+ 394, 431, 432, 431, 428, 401, 428, 428,
+ 429, 397, 428, 394, 394, 428, 428, 428,
+ 428, 428, 393, 433, 398, 396, 394, 434,
+ 395, 434, 401, 397, 394, 394, 393, 435,
+ 436, 435, 428, 396, 428, 428, 421, 397,
+ 428, 394, 394, 428, 428, 428, 428, 393,
+ 437, 398, 396, 394, 438, 439, 438, 440,
+ 396, 440, 440, 441, 442, 440, 440, 440,
+ 440, 440, 394, 443, 444, 443, 396, 445,
+ 442, 394, 446, 398, 396, 394, 447, 398,
+ 447, 396, 445, 442, 394, 445, 448, 445,
+ 449, 396, 449, 449, 450, 451, 452, 453,
+ 454, 455, 456, 450, 451, 452, 453, 454,
+ 455, 456, 449, 449, 449, 449, 449, 449,
+ 394, 457, 398, 396, 394, 458, 398, 458,
+ 449, 396, 449, 449, 450, 451, 452, 453,
+ 454, 455, 456, 450, 451, 452, 453, 454,
+ 455, 456, 449, 449, 449, 449, 449, 449,
+ 394, 438, 439, 438, 440, 396, 440, 440,
+ 441, 442, 459, 459, 440, 440, 440, 440,
+ 440, 394, 460, 398, 396, 394, 438, 439,
+ 438, 440, 396, 440, 440, 441, 442, 461,
+ 461, 440, 440, 440, 440, 440, 394, 442,
+ 462, 442, 463, 401, 463, 463, 464, 463,
+ 463, 463, 463, 463, 463, 394, 465, 398,
+ 396, 394, 466, 467, 466, 463, 401, 463,
+ 463, 464, 463, 463, 463, 463, 463, 463,
+ 394, 468, 398, 396, 394, 469, 398, 469,
+ 401, 394, 470, 471, 470, 463, 396, 463,
+ 463, 441, 463, 463, 463, 463, 463, 394,
+ 472, 473, 472, 396, 445, 394, 474, 398,
+ 396, 394, 475, 398, 475, 396, 445, 394,
+ 476, 398, 396, 394, 438, 439, 438, 440,
+ 396, 440, 440, 441, 442, 477, 477, 440,
+ 440, 440, 440, 440, 394, 438, 439, 438,
+ 440, 396, 440, 440, 441, 442, 478, 478,
+ 440, 440, 440, 440, 440, 394, 438, 439,
+ 438, 440, 396, 440, 440, 441, 442, 479,
+ 479, 440, 440, 440, 440, 440, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 480, 480, 440, 440, 440, 440, 440, 394,
+ 481, 482, 481, 440, 396, 440, 440, 441,
+ 483, 440, 440, 440, 440, 440, 394, 484,
+ 485, 484, 396, 445, 483, 394, 486, 398,
+ 396, 394, 487, 398, 487, 396, 445, 483,
+ 394, 488, 489, 488, 463, 490, 463, 463,
+ 464, 463, 463, 463, 463, 463, 463, 394,
+ 491, 398, 396, 394, 492, 493, 492, 463,
+ 490, 463, 463, 464, 463, 463, 463, 463,
+ 463, 463, 394, 494, 398, 396, 394, 495,
+ 398, 495, 496, 394, 497, 498, 497, 108,
+ 499, 109, 21, 21, 106, 500, 26, 21,
+ 501, 502, 501, 108, 499, 109, 21, 21,
+ 106, 503, 26, 21, 504, 107, 504, 108,
+ 499, 109, 21, 21, 106, 499, 505, 499,
+ 506, 108, 506, 506, 507, 508, 509, 510,
+ 511, 512, 513, 109, 507, 508, 509, 510,
+ 511, 512, 513, 506, 21, 21, 506, 506,
+ 506, 506, 506, 106, 514, 26, 21, 515,
+ 107, 515, 506, 108, 506, 506, 507, 508,
+ 509, 510, 511, 512, 513, 109, 507, 508,
+ 509, 510, 511, 512, 513, 506, 21, 21,
+ 506, 506, 506, 506, 506, 106, 516, 517,
+ 516, 518, 108, 518, 518, 519, 520, 109,
+ 518, 21, 21, 518, 518, 518, 518, 106,
+ 521, 522, 521, 108, 499, 520, 109, 21,
+ 21, 106, 523, 26, 21, 524, 107, 524,
+ 108, 499, 520, 109, 21, 21, 106, 520,
+ 525, 520, 526, 527, 526, 526, 528, 109,
+ 526, 21, 21, 526, 526, 526, 526, 526,
+ 106, 529, 26, 21, 530, 531, 530, 526,
+ 527, 526, 526, 528, 109, 526, 21, 21,
+ 526, 526, 526, 526, 526, 106, 532, 26,
+ 21, 533, 107, 533, 527, 109, 21, 21,
+ 106, 534, 535, 534, 77, 536, 78, 21,
+ 21, 69, 537, 538, 537, 526, 108, 526,
+ 526, 519, 109, 526, 21, 21, 526, 526,
+ 526, 526, 106, 539, 540, 539, 108, 499,
+ 109, 21, 21, 106, 541, 26, 21, 107,
+ 108, 543, 109, 21, 21, 21, 542, 542,
+ 542, 106, 107, 108, 545, 109, 546, 21,
+ 21, 21, 544, 544, 544, 106, 107, 108,
+ 545, 109, 546, 21, 21, 21, 547, 547,
+ 547, 106, 107, 108, 545, 109, 546, 21,
+ 21, 21, 548, 548, 548, 106, 107, 108,
+ 545, 109, 546, 21, 21, 21, 106, 107,
+ 108, 550, 109, 21, 21, 21, 549, 542,
+ 542, 106, 107, 108, 551, 545, 109, 546,
+ 21, 21, 21, 552, 544, 544, 106, 107,
+ 108, 109, 21, 21, 21, 553, 106, 107,
+ 108, 554, 109, 21, 21, 21, 555, 106,
+ 107, 108, 109, 21, 21, 21, 556, 106,
+ 107, 108, 557, 109, 21, 21, 21, 558,
+ 106, 107, 108, 109, 21, 21, 21, 559,
+ 106, 107, 108, 109, 546, 21, 21, 21,
+ 560, 106, 107, 108, 109, 546, 21, 21,
+ 21, 561, 106, 107, 108, 109, 546, 21,
+ 21, 21, 106, 537, 538, 537, 108, 519,
+ 109, 21, 21, 106, 107, 108, 557, 109,
+ 21, 21, 21, 562, 106, 107, 108, 557,
+ 109, 21, 21, 21, 106, 107, 108, 554,
+ 109, 21, 21, 21, 563, 106, 107, 108,
+ 554, 109, 21, 21, 21, 106, 107, 108,
+ 551, 545, 109, 546, 21, 21, 21, 564,
+ 547, 547, 106, 107, 108, 551, 545, 109,
+ 546, 21, 21, 21, 548, 548, 548, 106,
+ 107, 108, 566, 109, 546, 21, 21, 21,
+ 565, 565, 565, 106, 107, 108, 568, 109,
+ 546, 21, 21, 21, 567, 567, 567, 106,
+ 107, 108, 568, 109, 546, 21, 21, 21,
+ 569, 569, 569, 106, 107, 108, 568, 109,
+ 546, 21, 21, 21, 570, 570, 570, 106,
+ 107, 108, 568, 109, 546, 21, 21, 21,
+ 106, 107, 108, 109, 21, 21, 21, 571,
+ 565, 565, 106, 107, 108, 551, 568, 109,
+ 546, 21, 21, 21, 572, 567, 567, 106,
+ 107, 108, 551, 568, 109, 546, 21, 21,
+ 21, 573, 569, 569, 106, 107, 108, 551,
+ 568, 109, 546, 21, 21, 21, 570, 570,
+ 570, 106, 107, 108, 109, 21, 21, 21,
+ 574, 106, 107, 108, 551, 109, 21, 21,
+ 21, 575, 106, 107, 108, 551, 109, 21,
+ 21, 21, 576, 106, 107, 108, 551, 109,
+ 21, 21, 21, 106, 107, 108, 550, 109,
+ 21, 21, 21, 106, 577, 26, 21, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 578, 109, 578, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 579, 109, 579, 518,
+ 21, 21, 518, 518, 518, 518, 106, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 580, 109, 580, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 581, 109, 581, 518,
+ 21, 21, 518, 518, 518, 518, 106, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 582, 109, 582, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 583, 109, 583, 518,
+ 21, 21, 518, 518, 518, 518, 106, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 584, 109, 584, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 585, 109, 585, 518,
+ 21, 21, 518, 518, 518, 518, 106, 586,
+ 587, 586, 518, 108, 518, 518, 519, 588,
+ 109, 518, 21, 21, 518, 518, 518, 518,
+ 106, 589, 590, 589, 108, 499, 588, 109,
+ 21, 21, 106, 591, 26, 21, 592, 107,
+ 592, 108, 499, 588, 109, 21, 21, 106,
+ 588, 593, 588, 594, 527, 594, 594, 528,
+ 109, 594, 21, 21, 594, 594, 594, 594,
+ 594, 106, 595, 26, 21, 596, 531, 596,
+ 594, 527, 594, 594, 528, 109, 594, 21,
+ 21, 594, 594, 594, 594, 594, 106, 597,
+ 598, 597, 599, 108, 599, 599, 600, 109,
+ 599, 21, 21, 599, 599, 599, 599, 106,
+ 601, 26, 21, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 602, 109, 602, 518,
+ 21, 21, 518, 518, 518, 518, 106, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 603, 109, 603, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 604, 109, 604, 518,
+ 21, 21, 518, 518, 518, 518, 106, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 605, 109, 605, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 606, 109, 606, 518,
+ 21, 21, 518, 518, 518, 518, 106, 607,
+ 608, 607, 518, 108, 518, 518, 519, 609,
+ 109, 518, 21, 21, 518, 518, 518, 518,
+ 106, 610, 611, 610, 108, 499, 609, 109,
+ 21, 21, 106, 612, 26, 21, 613, 107,
+ 613, 108, 499, 609, 109, 21, 21, 106,
+ 609, 614, 609, 526, 615, 526, 526, 528,
+ 109, 526, 21, 21, 526, 526, 526, 526,
+ 526, 106, 616, 26, 21, 617, 618, 617,
+ 526, 615, 526, 526, 528, 109, 526, 21,
+ 21, 526, 526, 526, 526, 526, 106, 619,
+ 26, 21, 620, 107, 620, 615, 109, 21,
+ 21, 106, 621, 622, 621, 390, 623, 392,
+ 387, 387, 386, 624, 26, 21, 516, 517,
+ 516, 518, 108, 518, 518, 519, 520, 625,
+ 109, 625, 518, 21, 21, 518, 518, 518,
+ 518, 106, 516, 517, 516, 518, 108, 518,
+ 518, 519, 520, 626, 109, 626, 518, 21,
+ 21, 518, 518, 518, 518, 106, 516, 517,
+ 516, 518, 108, 518, 518, 519, 520, 627,
+ 109, 627, 518, 21, 21, 518, 518, 518,
+ 518, 106, 516, 517, 516, 518, 108, 518,
+ 518, 519, 520, 628, 109, 628, 518, 21,
+ 21, 518, 518, 518, 518, 106, 629, 630,
+ 629, 518, 108, 518, 518, 519, 631, 109,
+ 518, 21, 21, 518, 518, 518, 518, 106,
+ 632, 633, 632, 108, 499, 631, 109, 21,
+ 21, 106, 634, 26, 21, 635, 107, 635,
+ 108, 499, 631, 109, 21, 21, 106, 636,
+ 637, 636, 526, 638, 526, 526, 528, 109,
+ 526, 21, 21, 526, 526, 526, 526, 526,
+ 106, 639, 26, 21, 640, 641, 640, 526,
+ 638, 526, 526, 528, 109, 526, 21, 21,
+ 526, 526, 526, 526, 526, 106, 642, 26,
+ 21, 643, 107, 643, 644, 109, 21, 21,
+ 106, 645, 646, 645, 108, 647, 109, 21,
+ 21, 106, 648, 26, 21, 516, 517, 516,
+ 518, 108, 518, 518, 519, 520, 649, 109,
+ 649, 518, 21, 21, 518, 518, 518, 518,
+ 106, 516, 517, 516, 518, 108, 518, 518,
+ 519, 520, 650, 109, 650, 518, 21, 21,
+ 518, 518, 518, 518, 106, 516, 517, 516,
+ 518, 108, 518, 518, 519, 520, 651, 109,
+ 651, 518, 21, 21, 518, 518, 518, 518,
+ 106, 516, 517, 516, 518, 108, 518, 518,
+ 519, 520, 652, 109, 652, 518, 21, 21,
+ 518, 518, 518, 518, 106, 516, 517, 516,
+ 518, 108, 518, 518, 519, 520, 653, 109,
+ 653, 518, 21, 21, 518, 518, 518, 518,
+ 106, 654, 655, 654, 518, 108, 518, 518,
+ 519, 656, 109, 518, 21, 21, 518, 518,
+ 518, 518, 106, 657, 658, 657, 108, 499,
+ 656, 109, 21, 21, 106, 659, 26, 21,
+ 660, 107, 660, 108, 499, 656, 109, 21,
+ 21, 106, 661, 662, 661, 526, 663, 526,
+ 526, 528, 109, 526, 21, 21, 526, 526,
+ 526, 526, 526, 106, 664, 26, 21, 665,
+ 666, 665, 526, 663, 526, 526, 528, 109,
+ 526, 21, 21, 526, 526, 526, 526, 526,
+ 106, 667, 26, 21, 668, 107, 668, 669,
+ 109, 21, 21, 106, 670, 671, 670, 171,
+ 672, 172, 21, 21, 169, 673, 674, 673,
+ 171, 675, 172, 21, 21, 169, 676, 26,
+ 21, 677, 170, 677, 171, 675, 172, 21,
+ 21, 169, 675, 678, 675, 679, 171, 679,
+ 679, 680, 681, 682, 683, 684, 685, 686,
+ 172, 680, 681, 682, 683, 684, 685, 686,
+ 679, 21, 21, 679, 679, 679, 679, 679,
+ 169, 687, 26, 21, 688, 170, 688, 679,
+ 171, 679, 679, 680, 681, 682, 683, 684,
+ 685, 686, 172, 680, 681, 682, 683, 684,
+ 685, 686, 679, 21, 21, 679, 679, 679,
+ 679, 679, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 172, 691, 21, 21,
+ 691, 691, 691, 691, 169, 694, 695, 694,
+ 171, 675, 693, 172, 21, 21, 169, 696,
+ 26, 21, 697, 170, 697, 171, 675, 693,
+ 172, 21, 21, 169, 693, 698, 693, 699,
+ 700, 699, 699, 701, 172, 699, 21, 21,
+ 699, 699, 699, 699, 699, 169, 702, 26,
+ 21, 703, 704, 703, 699, 700, 699, 699,
+ 701, 172, 699, 21, 21, 699, 699, 699,
+ 699, 699, 169, 705, 26, 21, 706, 170,
+ 706, 700, 172, 21, 21, 169, 707, 708,
+ 707, 77, 709, 78, 21, 21, 69, 710,
+ 711, 710, 699, 171, 699, 699, 692, 172,
+ 699, 21, 21, 699, 699, 699, 699, 169,
+ 712, 26, 21, 170, 171, 714, 172, 21,
+ 21, 21, 713, 713, 713, 169, 170, 171,
+ 716, 172, 717, 21, 21, 21, 715, 715,
+ 715, 169, 170, 171, 716, 172, 717, 21,
+ 21, 21, 718, 718, 718, 169, 170, 171,
+ 716, 172, 717, 21, 21, 21, 719, 719,
+ 719, 169, 170, 171, 716, 172, 717, 21,
+ 21, 21, 169, 170, 171, 721, 172, 21,
+ 21, 21, 720, 713, 713, 169, 170, 171,
+ 722, 716, 172, 717, 21, 21, 21, 723,
+ 715, 715, 169, 170, 171, 172, 21, 21,
+ 21, 724, 169, 170, 171, 725, 172, 21,
+ 21, 21, 726, 169, 170, 171, 172, 21,
+ 21, 21, 727, 169, 170, 171, 728, 172,
+ 21, 21, 21, 729, 169, 170, 171, 172,
+ 21, 21, 21, 730, 169, 170, 171, 172,
+ 717, 21, 21, 21, 731, 169, 170, 171,
+ 172, 717, 21, 21, 21, 732, 169, 170,
+ 171, 172, 717, 21, 21, 21, 169, 710,
+ 711, 710, 171, 692, 172, 21, 21, 169,
+ 170, 171, 728, 172, 21, 21, 21, 733,
+ 169, 170, 171, 728, 172, 21, 21, 21,
+ 169, 170, 171, 725, 172, 21, 21, 21,
+ 734, 169, 170, 171, 725, 172, 21, 21,
+ 21, 169, 170, 171, 722, 716, 172, 717,
+ 21, 21, 21, 735, 718, 718, 169, 170,
+ 171, 722, 716, 172, 717, 21, 21, 21,
+ 719, 719, 719, 169, 170, 171, 737, 172,
+ 717, 21, 21, 21, 736, 736, 736, 169,
+ 170, 171, 739, 172, 717, 21, 21, 21,
+ 738, 738, 738, 169, 170, 171, 739, 172,
+ 717, 21, 21, 21, 740, 740, 740, 169,
+ 170, 171, 739, 172, 717, 21, 21, 21,
+ 741, 741, 741, 169, 170, 171, 739, 172,
+ 717, 21, 21, 21, 169, 170, 171, 172,
+ 21, 21, 21, 742, 736, 736, 169, 170,
+ 171, 722, 739, 172, 717, 21, 21, 21,
+ 743, 738, 738, 169, 170, 171, 722, 739,
+ 172, 717, 21, 21, 21, 744, 740, 740,
+ 169, 170, 171, 722, 739, 172, 717, 21,
+ 21, 21, 741, 741, 741, 169, 170, 171,
+ 172, 21, 21, 21, 745, 169, 170, 171,
+ 722, 172, 21, 21, 21, 746, 169, 170,
+ 171, 722, 172, 21, 21, 21, 747, 169,
+ 170, 171, 722, 172, 21, 21, 21, 169,
+ 170, 171, 721, 172, 21, 21, 21, 169,
+ 748, 26, 21, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 749, 172, 749, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 750, 172, 750, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 751, 172, 751, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 752, 172, 752, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 753, 172, 753, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 754, 172, 754, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 755, 172, 755, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 756, 172, 756, 691, 21, 21, 691, 691,
+ 691, 691, 169, 757, 758, 757, 691, 171,
+ 691, 691, 692, 759, 172, 691, 21, 21,
+ 691, 691, 691, 691, 169, 760, 761, 760,
+ 171, 675, 759, 172, 21, 21, 169, 762,
+ 26, 21, 763, 170, 763, 171, 675, 759,
+ 172, 21, 21, 169, 759, 764, 759, 765,
+ 700, 765, 765, 701, 172, 765, 21, 21,
+ 765, 765, 765, 765, 765, 169, 766, 26,
+ 21, 767, 704, 767, 765, 700, 765, 765,
+ 701, 172, 765, 21, 21, 765, 765, 765,
+ 765, 765, 169, 768, 769, 768, 770, 171,
+ 770, 770, 771, 172, 770, 21, 21, 770,
+ 770, 770, 770, 169, 772, 26, 21, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 773, 172, 773, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 774, 172, 774, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 775, 172, 775, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 776, 172, 776, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 777, 172, 777, 691, 21, 21, 691, 691,
+ 691, 691, 169, 778, 779, 778, 691, 171,
+ 691, 691, 692, 780, 172, 691, 21, 21,
+ 691, 691, 691, 691, 169, 781, 782, 781,
+ 171, 675, 780, 172, 21, 21, 169, 783,
+ 26, 21, 784, 170, 784, 171, 675, 780,
+ 172, 21, 21, 169, 780, 785, 780, 699,
+ 786, 699, 699, 701, 172, 699, 21, 21,
+ 699, 699, 699, 699, 699, 169, 787, 26,
+ 21, 788, 789, 788, 699, 786, 699, 699,
+ 701, 172, 699, 21, 21, 699, 699, 699,
+ 699, 699, 169, 790, 26, 21, 791, 170,
+ 791, 786, 172, 21, 21, 169, 792, 793,
+ 792, 390, 794, 392, 387, 387, 386, 795,
+ 26, 21, 689, 690, 689, 691, 171, 691,
+ 691, 692, 693, 796, 172, 796, 691, 21,
+ 21, 691, 691, 691, 691, 169, 689, 690,
+ 689, 691, 171, 691, 691, 692, 693, 797,
+ 172, 797, 691, 21, 21, 691, 691, 691,
+ 691, 169, 689, 690, 689, 691, 171, 691,
+ 691, 692, 693, 798, 172, 798, 691, 21,
+ 21, 691, 691, 691, 691, 169, 689, 690,
+ 689, 691, 171, 691, 691, 692, 693, 799,
+ 172, 799, 691, 21, 21, 691, 691, 691,
+ 691, 169, 800, 801, 800, 691, 171, 691,
+ 691, 692, 802, 172, 691, 21, 21, 691,
+ 691, 691, 691, 169, 803, 804, 803, 171,
+ 675, 802, 172, 21, 21, 169, 805, 26,
+ 21, 806, 170, 806, 171, 675, 802, 172,
+ 21, 21, 169, 807, 808, 807, 699, 809,
+ 699, 699, 701, 172, 699, 21, 21, 699,
+ 699, 699, 699, 699, 169, 810, 26, 21,
+ 811, 812, 811, 699, 809, 699, 699, 701,
+ 172, 699, 21, 21, 699, 699, 699, 699,
+ 699, 169, 813, 26, 21, 814, 170, 814,
+ 815, 172, 21, 21, 169, 816, 817, 816,
+ 108, 818, 109, 21, 21, 106, 819, 26,
+ 21, 689, 690, 689, 691, 171, 691, 691,
+ 692, 693, 820, 172, 820, 691, 21, 21,
+ 691, 691, 691, 691, 169, 689, 690, 689,
+ 691, 171, 691, 691, 692, 693, 821, 172,
+ 821, 691, 21, 21, 691, 691, 691, 691,
+ 169, 689, 690, 689, 691, 171, 691, 691,
+ 692, 693, 822, 172, 822, 691, 21, 21,
+ 691, 691, 691, 691, 169, 689, 690, 689,
+ 691, 171, 691, 691, 692, 693, 823, 172,
+ 823, 691, 21, 21, 691, 691, 691, 691,
+ 169, 689, 690, 689, 691, 171, 691, 691,
+ 692, 693, 824, 172, 824, 691, 21, 21,
+ 691, 691, 691, 691, 169, 825, 826, 825,
+ 691, 171, 691, 691, 692, 827, 172, 691,
+ 21, 21, 691, 691, 691, 691, 169, 828,
+ 829, 828, 171, 675, 827, 172, 21, 21,
+ 169, 830, 26, 21, 831, 170, 831, 171,
+ 675, 827, 172, 21, 21, 169, 832, 833,
+ 832, 699, 834, 699, 699, 701, 172, 699,
+ 21, 21, 699, 699, 699, 699, 699, 169,
+ 835, 26, 21, 836, 837, 836, 699, 834,
+ 699, 699, 701, 172, 699, 21, 21, 699,
+ 699, 699, 699, 699, 169, 838, 26, 21,
+ 839, 170, 839, 840, 172, 21, 21, 169,
+ 841, 842, 841, 171, 843, 172, 21, 21,
+ 169, 844, 26, 21, 689, 690, 689, 691,
+ 171, 691, 691, 692, 693, 845, 172, 845,
+ 691, 21, 21, 691, 691, 691, 691, 169,
+ 689, 690, 689, 691, 171, 691, 691, 692,
+ 693, 846, 172, 846, 691, 21, 21, 691,
+ 691, 691, 691, 169, 847, 848, 847, 691,
+ 171, 691, 691, 692, 849, 172, 691, 21,
+ 21, 691, 691, 691, 691, 169, 850, 851,
+ 850, 171, 675, 849, 172, 21, 21, 169,
+ 852, 26, 21, 853, 170, 853, 171, 675,
+ 849, 172, 21, 21, 169, 849, 854, 849,
+ 699, 855, 699, 699, 701, 172, 699, 21,
+ 21, 699, 699, 699, 699, 699, 169, 856,
+ 26, 21, 857, 858, 857, 699, 855, 699,
+ 699, 701, 172, 699, 21, 21, 699, 699,
+ 699, 699, 699, 169, 859, 26, 21, 860,
+ 170, 860, 855, 172, 21, 21, 169, 861,
+ 862, 861, 197, 863, 198, 195, 195, 194,
+ 864, 865, 864, 202, 866, 203, 200, 200,
+ 199, 867, 204, 202, 200, 868, 201, 868,
+ 202, 866, 203, 200, 200, 199, 866, 869,
+ 866, 870, 202, 870, 870, 871, 872, 873,
+ 874, 875, 876, 877, 203, 871, 872, 873,
+ 874, 875, 876, 877, 870, 200, 200, 870,
+ 870, 870, 870, 870, 199, 878, 204, 202,
+ 200, 879, 201, 879, 870, 202, 870, 870,
+ 871, 872, 873, 874, 875, 876, 877, 203,
+ 871, 872, 873, 874, 875, 876, 877, 870,
+ 200, 200, 870, 870, 870, 870, 870, 199,
+ 880, 881, 880, 882, 202, 882, 882, 883,
+ 884, 203, 882, 200, 200, 882, 882, 882,
+ 882, 199, 885, 886, 885, 202, 866, 884,
+ 203, 200, 200, 199, 887, 204, 202, 200,
+ 888, 201, 888, 202, 866, 884, 203, 200,
+ 200, 199, 884, 889, 884, 890, 265, 890,
+ 890, 891, 203, 890, 200, 200, 890, 890,
+ 890, 890, 890, 199, 892, 204, 202, 200,
+ 893, 894, 893, 890, 265, 890, 890, 891,
+ 203, 890, 200, 200, 890, 890, 890, 890,
+ 890, 199, 895, 204, 202, 200, 896, 201,
+ 896, 265, 203, 200, 200, 199, 897, 898,
+ 897, 890, 202, 890, 890, 883, 203, 890,
+ 200, 200, 890, 890, 890, 890, 199, 899,
+ 204, 202, 200, 900, 901, 900, 902, 202,
+ 902, 902, 903, 904, 902, 902, 902, 902,
+ 902, 200, 905, 906, 905, 202, 907, 904,
+ 200, 908, 204, 202, 200, 909, 204, 909,
+ 202, 907, 904, 200, 907, 910, 907, 911,
+ 202, 911, 911, 912, 913, 914, 915, 916,
+ 917, 918, 912, 913, 914, 915, 916, 917,
+ 918, 911, 911, 911, 911, 911, 911, 200,
+ 919, 204, 202, 200, 920, 204, 920, 911,
+ 202, 911, 911, 912, 913, 914, 915, 916,
+ 917, 918, 912, 913, 914, 915, 916, 917,
+ 918, 911, 911, 911, 911, 911, 911, 200,
+ 900, 901, 900, 902, 202, 902, 902, 903,
+ 904, 921, 921, 902, 902, 902, 902, 902,
+ 200, 922, 204, 202, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 923, 923,
+ 902, 902, 902, 902, 902, 200, 904, 924,
+ 904, 925, 265, 925, 925, 926, 925, 925,
+ 925, 925, 925, 925, 200, 927, 204, 202,
+ 200, 928, 929, 928, 925, 265, 925, 925,
+ 926, 925, 925, 925, 925, 925, 925, 200,
+ 930, 204, 202, 200, 931, 204, 931, 265,
+ 200, 932, 933, 932, 925, 202, 925, 925,
+ 903, 925, 925, 925, 925, 925, 200, 934,
+ 935, 934, 202, 907, 200, 936, 204, 202,
+ 200, 937, 204, 937, 202, 907, 200, 938,
+ 204, 202, 200, 900, 901, 900, 902, 202,
+ 902, 902, 903, 904, 939, 939, 902, 902,
+ 902, 902, 902, 200, 900, 901, 900, 902,
+ 202, 902, 902, 903, 904, 940, 940, 902,
+ 902, 902, 902, 902, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 941, 941,
+ 902, 902, 902, 902, 902, 200, 900, 901,
+ 900, 902, 202, 902, 902, 903, 904, 942,
+ 942, 902, 902, 902, 902, 902, 200, 943,
+ 944, 943, 902, 202, 902, 902, 903, 945,
+ 902, 902, 902, 902, 902, 200, 946, 947,
+ 946, 202, 907, 945, 200, 948, 204, 202,
+ 200, 949, 204, 949, 202, 907, 945, 200,
+ 950, 951, 950, 925, 952, 925, 925, 926,
+ 925, 925, 925, 925, 925, 925, 200, 953,
+ 204, 202, 200, 954, 955, 954, 925, 952,
+ 925, 925, 926, 925, 925, 925, 925, 925,
+ 925, 200, 956, 204, 202, 200, 957, 204,
+ 957, 958, 200, 204, 202, 960, 959, 959,
+ 959, 200, 204, 202, 962, 963, 961, 961,
+ 961, 200, 204, 202, 962, 963, 964, 964,
+ 964, 200, 204, 202, 962, 963, 965, 965,
+ 965, 200, 204, 202, 962, 963, 200, 204,
+ 202, 967, 966, 959, 959, 200, 204, 202,
+ 968, 962, 963, 969, 961, 961, 200, 204,
+ 202, 970, 200, 204, 202, 971, 972, 200,
+ 204, 202, 973, 200, 204, 202, 974, 975,
+ 200, 204, 202, 976, 200, 204, 202, 963,
+ 977, 200, 204, 202, 963, 978, 200, 204,
+ 202, 963, 200, 932, 933, 932, 202, 903,
+ 200, 204, 202, 974, 979, 200, 204, 202,
+ 974, 200, 204, 202, 971, 980, 200, 204,
+ 202, 971, 200, 204, 202, 968, 962, 963,
+ 981, 964, 964, 200, 204, 202, 968, 962,
+ 963, 965, 965, 965, 200, 204, 202, 983,
+ 963, 982, 982, 982, 200, 204, 202, 985,
+ 963, 984, 984, 984, 200, 204, 202, 985,
+ 963, 986, 986, 986, 200, 204, 202, 985,
+ 963, 987, 987, 987, 200, 204, 202, 985,
+ 963, 200, 204, 202, 988, 982, 982, 200,
+ 204, 202, 968, 985, 963, 989, 984, 984,
+ 200, 204, 202, 968, 985, 963, 990, 986,
+ 986, 200, 204, 202, 968, 985, 963, 987,
+ 987, 987, 200, 204, 202, 991, 200, 204,
+ 202, 968, 992, 200, 204, 202, 968, 993,
+ 200, 204, 202, 968, 200, 204, 202, 967,
+ 200, 994, 204, 202, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 995, 995,
+ 902, 902, 902, 902, 902, 200, 900, 901,
+ 900, 902, 202, 902, 902, 903, 904, 996,
+ 996, 902, 902, 902, 902, 902, 200, 900,
+ 901, 900, 902, 202, 902, 902, 903, 904,
+ 997, 997, 902, 902, 902, 902, 902, 200,
+ 900, 901, 900, 902, 202, 902, 902, 903,
+ 904, 998, 998, 902, 902, 902, 902, 902,
+ 200, 900, 901, 900, 902, 202, 902, 902,
+ 903, 904, 999, 999, 902, 902, 902, 902,
+ 902, 200, 1000, 1001, 1000, 902, 202, 902,
+ 902, 903, 1002, 902, 902, 902, 902, 902,
+ 200, 1003, 1004, 1003, 202, 907, 1002, 200,
+ 1005, 204, 202, 200, 1006, 204, 1006, 202,
+ 907, 1002, 200, 1007, 1008, 1007, 925, 1009,
+ 925, 925, 926, 925, 925, 925, 925, 925,
+ 925, 200, 1010, 204, 202, 200, 1011, 1012,
+ 1011, 925, 1009, 925, 925, 926, 925, 925,
+ 925, 925, 925, 925, 200, 1013, 204, 202,
+ 200, 1014, 204, 1014, 1015, 200, 1016, 1017,
+ 1016, 171, 675, 172, 21, 21, 169, 1018,
+ 26, 21, 1019, 1020, 1019, 171, 675, 172,
+ 21, 21, 169, 1021, 204, 202, 200, 900,
+ 901, 900, 902, 202, 902, 902, 903, 904,
+ 1022, 1022, 902, 902, 902, 902, 902, 200,
+ 900, 901, 900, 902, 202, 902, 902, 903,
+ 904, 1023, 1023, 902, 902, 902, 902, 902,
+ 200, 1024, 1025, 1024, 902, 202, 902, 902,
+ 903, 1026, 902, 902, 902, 902, 902, 200,
+ 1027, 1028, 1027, 202, 907, 1026, 200, 1029,
+ 204, 202, 200, 1030, 204, 1030, 202, 907,
+ 1026, 200, 1026, 1031, 1026, 925, 202, 925,
+ 925, 926, 925, 925, 925, 925, 925, 925,
+ 200, 1032, 204, 202, 200, 1033, 204, 1033,
+ 925, 202, 925, 925, 926, 925, 925, 925,
+ 925, 925, 925, 200, 1034, 204, 202, 200,
+ 900, 901, 900, 902, 202, 902, 902, 903,
+ 904, 1035, 1035, 902, 902, 902, 902, 902,
+ 200, 900, 901, 900, 902, 202, 902, 902,
+ 903, 904, 1036, 1036, 902, 902, 902, 902,
+ 902, 200, 900, 901, 900, 902, 202, 902,
+ 902, 903, 904, 1037, 1037, 902, 902, 902,
+ 902, 902, 200, 900, 901, 900, 902, 202,
+ 902, 902, 903, 904, 1038, 1038, 902, 902,
+ 902, 902, 902, 200, 1039, 1040, 1039, 902,
+ 202, 902, 902, 903, 1041, 902, 902, 902,
+ 902, 902, 200, 1042, 1043, 1042, 202, 907,
+ 1041, 200, 1044, 204, 202, 200, 1045, 204,
+ 1045, 202, 907, 1041, 200, 1046, 1047, 1046,
+ 925, 1048, 925, 925, 926, 925, 925, 925,
+ 925, 925, 925, 200, 1049, 204, 202, 200,
+ 1050, 1051, 1050, 925, 1048, 925, 925, 926,
+ 925, 925, 925, 925, 925, 925, 200, 1052,
+ 204, 202, 200, 1053, 204, 1053, 1054, 200,
+ 1055, 1056, 1055, 232, 1057, 233, 21, 21,
+ 230, 1058, 26, 21, 1059, 1060, 1059, 232,
+ 1057, 233, 21, 21, 230, 1061, 26, 21,
+ 1062, 231, 1062, 232, 1057, 233, 21, 21,
+ 230, 1057, 1063, 1057, 1064, 232, 1064, 1064,
+ 1065, 1066, 1067, 1068, 1069, 1070, 1071, 233,
+ 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1064,
+ 21, 21, 1064, 1064, 1064, 1064, 1064, 230,
+ 1072, 26, 21, 1073, 231, 1073, 1064, 232,
+ 1064, 1064, 1065, 1066, 1067, 1068, 1069, 1070,
+ 1071, 233, 1065, 1066, 1067, 1068, 1069, 1070,
+ 1071, 1064, 21, 21, 1064, 1064, 1064, 1064,
+ 1064, 230, 1074, 1075, 1074, 1076, 232, 1076,
+ 1076, 1077, 1078, 233, 1076, 21, 21, 1076,
+ 1076, 1076, 1076, 230, 1079, 1080, 1079, 232,
+ 1057, 1078, 233, 21, 21, 230, 1081, 26,
+ 21, 1082, 231, 1082, 232, 1057, 1078, 233,
+ 21, 21, 230, 1078, 1083, 1078, 1084, 1085,
+ 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
+ 1084, 1084, 1084, 1084, 230, 1087, 26, 21,
+ 1088, 1089, 1088, 1084, 1085, 1084, 1084, 1086,
+ 233, 1084, 21, 21, 1084, 1084, 1084, 1084,
+ 1084, 230, 1090, 26, 21, 1091, 231, 1091,
+ 1085, 233, 21, 21, 230, 1092, 1093, 1092,
+ 77, 1094, 78, 21, 21, 69, 1095, 1096,
+ 1095, 1084, 232, 1084, 1084, 1077, 233, 1084,
+ 21, 21, 1084, 1084, 1084, 1084, 230, 1097,
+ 1098, 1097, 232, 1057, 233, 21, 21, 230,
+ 1099, 26, 21, 231, 232, 1101, 233, 21,
+ 21, 21, 1100, 1100, 1100, 230, 231, 232,
+ 1103, 233, 1104, 21, 21, 21, 1102, 1102,
+ 1102, 230, 231, 232, 1103, 233, 1104, 21,
+ 21, 21, 1105, 1105, 1105, 230, 231, 232,
+ 1103, 233, 1104, 21, 21, 21, 1106, 1106,
+ 1106, 230, 231, 232, 1103, 233, 1104, 21,
+ 21, 21, 230, 231, 232, 1108, 233, 21,
+ 21, 21, 1107, 1100, 1100, 230, 231, 232,
+ 1109, 1103, 233, 1104, 21, 21, 21, 1110,
+ 1102, 1102, 230, 231, 232, 233, 21, 21,
+ 21, 1111, 230, 231, 232, 1112, 233, 21,
+ 21, 21, 1113, 230, 231, 232, 233, 21,
+ 21, 21, 1114, 230, 231, 232, 1115, 233,
+ 21, 21, 21, 1116, 230, 231, 232, 233,
+ 21, 21, 21, 1117, 230, 231, 232, 233,
+ 1104, 21, 21, 21, 1118, 230, 231, 232,
+ 233, 1104, 21, 21, 21, 1119, 230, 231,
+ 232, 233, 1104, 21, 21, 21, 230, 1095,
+ 1096, 1095, 232, 1077, 233, 21, 21, 230,
+ 231, 232, 1115, 233, 21, 21, 21, 1120,
+ 230, 231, 232, 1115, 233, 21, 21, 21,
+ 230, 231, 232, 1112, 233, 21, 21, 21,
+ 1121, 230, 231, 232, 1112, 233, 21, 21,
+ 21, 230, 231, 232, 1109, 1103, 233, 1104,
+ 21, 21, 21, 1122, 1105, 1105, 230, 231,
+ 232, 1109, 1103, 233, 1104, 21, 21, 21,
+ 1106, 1106, 1106, 230, 231, 232, 1124, 233,
+ 1104, 21, 21, 21, 1123, 1123, 1123, 230,
+ 231, 232, 1126, 233, 1104, 21, 21, 21,
+ 1125, 1125, 1125, 230, 231, 232, 1126, 233,
+ 1104, 21, 21, 21, 1127, 1127, 1127, 230,
+ 231, 232, 1126, 233, 1104, 21, 21, 21,
+ 1128, 1128, 1128, 230, 231, 232, 1126, 233,
+ 1104, 21, 21, 21, 230, 231, 232, 233,
+ 21, 21, 21, 1129, 1123, 1123, 230, 231,
+ 232, 1109, 1126, 233, 1104, 21, 21, 21,
+ 1130, 1125, 1125, 230, 231, 232, 1109, 1126,
+ 233, 1104, 21, 21, 21, 1131, 1127, 1127,
+ 230, 231, 232, 1109, 1126, 233, 1104, 21,
+ 21, 21, 1128, 1128, 1128, 230, 231, 232,
+ 233, 21, 21, 21, 1132, 230, 231, 232,
+ 1109, 233, 21, 21, 21, 1133, 230, 231,
+ 232, 1109, 233, 21, 21, 21, 1134, 230,
+ 231, 232, 1109, 233, 21, 21, 21, 230,
+ 231, 232, 1108, 233, 21, 21, 21, 230,
+ 1135, 26, 21, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1136, 233, 1136, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1137, 233, 1137, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1138, 233, 1138, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1139, 233, 1139, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1140, 233, 1140, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1141, 233, 1141, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1142, 233, 1142, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1143, 233, 1143, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1144, 1145, 1144, 1076, 232,
+ 1076, 1076, 1077, 1146, 233, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1147, 1148, 1147,
+ 232, 1057, 1146, 233, 21, 21, 230, 1149,
+ 26, 21, 1150, 231, 1150, 232, 1057, 1146,
+ 233, 21, 21, 230, 1146, 1151, 1146, 1152,
+ 1085, 1152, 1152, 1086, 233, 1152, 21, 21,
+ 1152, 1152, 1152, 1152, 1152, 230, 1153, 26,
+ 21, 1154, 1089, 1154, 1152, 1085, 1152, 1152,
+ 1086, 233, 1152, 21, 21, 1152, 1152, 1152,
+ 1152, 1152, 230, 1155, 1156, 1155, 1157, 232,
+ 1157, 1157, 1158, 233, 1157, 21, 21, 1157,
+ 1157, 1157, 1157, 230, 1159, 26, 21, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1160, 233, 1160, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1161, 233, 1161, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1162, 233, 1162, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1163, 233, 1163, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1164, 233, 1164, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1165, 1166, 1165, 1076, 232,
+ 1076, 1076, 1077, 1167, 233, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1168, 1169, 1168,
+ 232, 1057, 1167, 233, 21, 21, 230, 1170,
+ 26, 21, 1171, 231, 1171, 232, 1057, 1167,
+ 233, 21, 21, 230, 1167, 1172, 1167, 1084,
+ 1173, 1084, 1084, 1086, 233, 1084, 21, 21,
+ 1084, 1084, 1084, 1084, 1084, 230, 1174, 26,
+ 21, 1175, 1176, 1175, 1084, 1173, 1084, 1084,
+ 1086, 233, 1084, 21, 21, 1084, 1084, 1084,
+ 1084, 1084, 230, 1177, 26, 21, 1178, 231,
+ 1178, 1173, 233, 21, 21, 230, 1179, 1180,
+ 1179, 390, 1181, 392, 387, 387, 386, 1182,
+ 26, 21, 1074, 1075, 1074, 1076, 232, 1076,
+ 1076, 1077, 1078, 1183, 233, 1183, 1076, 21,
+ 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
+ 1074, 1076, 232, 1076, 1076, 1077, 1078, 1184,
+ 233, 1184, 1076, 21, 21, 1076, 1076, 1076,
+ 1076, 230, 1074, 1075, 1074, 1076, 232, 1076,
+ 1076, 1077, 1078, 1185, 233, 1185, 1076, 21,
+ 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
+ 1074, 1076, 232, 1076, 1076, 1077, 1078, 1186,
+ 233, 1186, 1076, 21, 21, 1076, 1076, 1076,
+ 1076, 230, 1187, 1188, 1187, 1076, 232, 1076,
+ 1076, 1077, 1189, 233, 1076, 21, 21, 1076,
+ 1076, 1076, 1076, 230, 1190, 1191, 1190, 232,
+ 1057, 1189, 233, 21, 21, 230, 1192, 26,
+ 21, 1193, 231, 1193, 232, 1057, 1189, 233,
+ 21, 21, 230, 1194, 1195, 1194, 1084, 1196,
+ 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
+ 1084, 1084, 1084, 1084, 230, 1197, 26, 21,
+ 1198, 1199, 1198, 1084, 1196, 1084, 1084, 1086,
+ 233, 1084, 21, 21, 1084, 1084, 1084, 1084,
+ 1084, 230, 1200, 26, 21, 1201, 231, 1201,
+ 1202, 233, 21, 21, 230, 1203, 1204, 1203,
+ 108, 1205, 109, 21, 21, 106, 1206, 26,
+ 21, 1074, 1075, 1074, 1076, 232, 1076, 1076,
+ 1077, 1078, 1207, 233, 1207, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1074, 1075, 1074,
+ 1076, 232, 1076, 1076, 1077, 1078, 1208, 233,
+ 1208, 1076, 21, 21, 1076, 1076, 1076, 1076,
+ 230, 1074, 1075, 1074, 1076, 232, 1076, 1076,
+ 1077, 1078, 1209, 233, 1209, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1074, 1075, 1074,
+ 1076, 232, 1076, 1076, 1077, 1078, 1210, 233,
+ 1210, 1076, 21, 21, 1076, 1076, 1076, 1076,
+ 230, 1074, 1075, 1074, 1076, 232, 1076, 1076,
+ 1077, 1078, 1211, 233, 1211, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1212, 1213, 1212,
+ 1076, 232, 1076, 1076, 1077, 1214, 233, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1215,
+ 1216, 1215, 232, 1057, 1214, 233, 21, 21,
+ 230, 1217, 26, 21, 1218, 231, 1218, 232,
+ 1057, 1214, 233, 21, 21, 230, 1219, 1220,
+ 1219, 1084, 1221, 1084, 1084, 1086, 233, 1084,
+ 21, 21, 1084, 1084, 1084, 1084, 1084, 230,
+ 1222, 26, 21, 1223, 1224, 1223, 1084, 1221,
+ 1084, 1084, 1086, 233, 1084, 21, 21, 1084,
+ 1084, 1084, 1084, 1084, 230, 1225, 26, 21,
+ 1226, 231, 1226, 1227, 233, 21, 21, 230,
+ 1228, 1229, 1228, 171, 1230, 172, 21, 21,
+ 169, 1231, 26, 21, 1074, 1075, 1074, 1076,
+ 232, 1076, 1076, 1077, 1078, 1232, 233, 1232,
+ 1076, 21, 21, 1076, 1076, 1076, 1076, 230,
+ 1074, 1075, 1074, 1076, 232, 1076, 1076, 1077,
+ 1078, 1233, 233, 1233, 1076, 21, 21, 1076,
+ 1076, 1076, 1076, 230, 1234, 1235, 1234, 1076,
+ 232, 1076, 1076, 1077, 1236, 233, 1076, 21,
+ 21, 1076, 1076, 1076, 1076, 230, 1237, 1238,
+ 1237, 232, 1057, 1236, 233, 21, 21, 230,
+ 1239, 26, 21, 1240, 231, 1240, 232, 1057,
+ 1236, 233, 21, 21, 230, 1236, 1241, 1236,
+ 1084, 1242, 1084, 1084, 1086, 233, 1084, 21,
+ 21, 1084, 1084, 1084, 1084, 1084, 230, 1243,
+ 26, 21, 1244, 1245, 1244, 1084, 1242, 1084,
+ 1084, 1086, 233, 1084, 21, 21, 1084, 1084,
+ 1084, 1084, 1084, 230, 1246, 26, 21, 1247,
+ 231, 1247, 1242, 233, 21, 21, 230, 1248,
+ 1249, 1248, 197, 1250, 198, 195, 195, 194,
+ 1251, 26, 21, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1252, 233, 1252, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1253, 233, 1253, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1074, 1075, 1074, 1076, 232,
+ 1076, 1076, 1077, 1078, 1254, 233, 1254, 1076,
+ 21, 21, 1076, 1076, 1076, 1076, 230, 1074,
+ 1075, 1074, 1076, 232, 1076, 1076, 1077, 1078,
+ 1255, 233, 1255, 1076, 21, 21, 1076, 1076,
+ 1076, 1076, 230, 1256, 1257, 1256, 1076, 232,
+ 1076, 1076, 1077, 1258, 233, 1076, 21, 21,
+ 1076, 1076, 1076, 1076, 230, 1259, 1260, 1259,
+ 232, 1057, 1258, 233, 21, 21, 230, 1261,
+ 26, 21, 1262, 231, 1262, 232, 1057, 1258,
+ 233, 21, 21, 230, 1263, 1264, 1263, 1084,
+ 1265, 1084, 1084, 1086, 233, 1084, 21, 21,
+ 1084, 1084, 1084, 1084, 1084, 230, 1266, 26,
+ 21, 1267, 1268, 1267, 1084, 1265, 1084, 1084,
+ 1086, 233, 1084, 21, 21, 1084, 1084, 1084,
+ 1084, 1084, 230, 1269, 26, 21, 1270, 231,
+ 1270, 1271, 233, 21, 21, 230, 1272, 1273,
+ 1272, 232, 1274, 233, 21, 21, 230, 1275,
+ 26, 21, 1074, 1075, 1074, 1076, 232, 1076,
+ 1076, 1077, 1078, 1276, 233, 1276, 1076, 21,
+ 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
+ 1074, 1076, 232, 1076, 1076, 1077, 1078, 1277,
+ 233, 1277, 1076, 21, 21, 1076, 1076, 1076,
+ 1076, 230, 1074, 1075, 1074, 1076, 232, 1076,
+ 1076, 1077, 1078, 1278, 233, 1278, 1076, 21,
+ 21, 1076, 1076, 1076, 1076, 230, 1074, 1075,
+ 1074, 1076, 232, 1076, 1076, 1077, 1078, 1279,
+ 233, 1279, 1076, 21, 21, 1076, 1076, 1076,
+ 1076, 230, 1280, 1281, 1280, 1076, 232, 1076,
+ 1076, 1077, 1282, 233, 1076, 21, 21, 1076,
+ 1076, 1076, 1076, 230, 1283, 1284, 1283, 232,
+ 1057, 1282, 233, 21, 21, 230, 1285, 26,
+ 21, 1286, 231, 1286, 232, 1057, 1282, 233,
+ 21, 21, 230, 1282, 1287, 1282, 1084, 1085,
+ 1084, 1084, 1288, 1289, 1086, 233, 1288, 1289,
+ 1084, 21, 21, 1084, 1084, 1084, 1084, 1084,
+ 230, 1290, 26, 21, 1291, 1089, 1291, 1084,
+ 1085, 1084, 1084, 1288, 1289, 1086, 233, 1288,
+ 1289, 1084, 21, 21, 1084, 1084, 1084, 1084,
+ 1084, 230, 1095, 1096, 1095, 1084, 232, 1084,
+ 1084, 1077, 1292, 233, 1292, 1084, 21, 21,
+ 1084, 1084, 1084, 1084, 230, 1095, 1096, 1095,
+ 1084, 232, 1084, 1084, 1077, 1293, 233, 1293,
+ 1084, 21, 21, 1084, 1084, 1084, 1084, 230,
+ 1095, 1096, 1095, 1084, 232, 1084, 1084, 1077,
+ 1294, 233, 1294, 1084, 21, 21, 1084, 1084,
+ 1084, 1084, 230, 1095, 1096, 1095, 1084, 232,
+ 1084, 1084, 1077, 1295, 233, 1295, 1084, 21,
+ 21, 1084, 1084, 1084, 1084, 230, 1296, 1297,
+ 1296, 232, 1298, 233, 21, 21, 230, 1095,
+ 1096, 1095, 1084, 232, 1084, 1084, 1077, 1299,
+ 233, 1299, 1084, 21, 21, 1084, 1084, 1084,
+ 1084, 230, 1095, 1096, 1095, 1084, 232, 1084,
+ 1084, 1077, 1294, 233, 1294, 1084, 21, 21,
+ 1084, 1084, 1084, 1084, 230, 1300, 26, 21,
+ 1301, 204, 202, 200, 900, 901, 900, 902,
+ 202, 902, 902, 903, 904, 1302, 1302, 902,
+ 902, 902, 902, 902, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 1303, 1303,
+ 902, 902, 902, 902, 902, 200, 900, 901,
+ 900, 902, 202, 902, 902, 903, 904, 1304,
+ 1304, 902, 902, 902, 902, 902, 200, 900,
+ 901, 900, 902, 202, 902, 902, 903, 904,
+ 1305, 1305, 902, 902, 902, 902, 902, 200,
+ 1306, 1307, 1306, 902, 202, 902, 902, 903,
+ 1308, 902, 902, 902, 902, 902, 200, 1309,
+ 1310, 1309, 202, 907, 1308, 200, 1311, 204,
+ 202, 200, 1312, 204, 1312, 202, 907, 1308,
+ 200, 1308, 1313, 1308, 925, 265, 925, 925,
+ 1314, 1315, 926, 1314, 1315, 925, 925, 925,
+ 925, 925, 925, 200, 1316, 204, 202, 200,
+ 1317, 929, 1317, 925, 265, 925, 925, 1314,
+ 1315, 926, 1314, 1315, 925, 925, 925, 925,
+ 925, 925, 200, 932, 933, 932, 925, 202,
+ 925, 925, 903, 1318, 1318, 925, 925, 925,
+ 925, 925, 200, 932, 933, 932, 925, 202,
+ 925, 925, 903, 1319, 1319, 925, 925, 925,
+ 925, 925, 200, 932, 933, 932, 925, 202,
+ 925, 925, 903, 1320, 1320, 925, 925, 925,
+ 925, 925, 200, 932, 933, 932, 925, 202,
+ 925, 925, 903, 1321, 1321, 925, 925, 925,
+ 925, 925, 200, 1322, 1323, 1322, 202, 1324,
+ 200, 932, 933, 932, 925, 202, 925, 925,
+ 903, 1325, 1325, 925, 925, 925, 925, 925,
+ 200, 932, 933, 932, 925, 202, 925, 925,
+ 903, 1320, 1320, 925, 925, 925, 925, 925,
+ 200, 1326, 204, 202, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 1327, 1327,
+ 902, 902, 902, 902, 902, 200, 900, 901,
+ 900, 902, 202, 902, 902, 903, 904, 1328,
+ 1328, 902, 902, 902, 902, 902, 200, 900,
+ 901, 900, 902, 202, 902, 902, 903, 904,
+ 1329, 1329, 902, 902, 902, 902, 902, 200,
+ 900, 901, 900, 902, 202, 902, 902, 903,
+ 904, 1330, 1330, 902, 902, 902, 902, 902,
+ 200, 1331, 1332, 1331, 902, 202, 902, 902,
+ 903, 1333, 902, 902, 902, 902, 902, 200,
+ 1334, 1335, 1334, 202, 907, 1333, 200, 1336,
+ 204, 202, 200, 1337, 204, 1337, 202, 907,
+ 1333, 200, 1333, 1338, 1333, 925, 1339, 925,
+ 925, 926, 925, 925, 925, 925, 925, 925,
+ 200, 1340, 204, 202, 200, 1341, 1342, 1341,
+ 925, 1339, 925, 925, 926, 925, 925, 925,
+ 925, 925, 925, 200, 1343, 204, 202, 200,
+ 1344, 204, 1344, 1339, 200, 1345, 1346, 1345,
+ 390, 1347, 392, 387, 387, 386, 1348, 1349,
+ 1348, 396, 404, 397, 394, 394, 393, 1350,
+ 398, 396, 394, 1351, 1352, 1351, 396, 404,
+ 397, 394, 394, 393, 438, 439, 438, 440,
+ 396, 440, 440, 441, 442, 1353, 1353, 440,
+ 440, 440, 440, 440, 394, 438, 439, 438,
+ 440, 396, 440, 440, 441, 442, 1354, 1354,
+ 440, 440, 440, 440, 440, 394, 438, 439,
+ 438, 440, 396, 440, 440, 441, 442, 1355,
+ 1355, 440, 440, 440, 440, 440, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 1356, 1356, 440, 440, 440, 440, 440, 394,
+ 438, 439, 438, 440, 396, 440, 440, 441,
+ 442, 1357, 1357, 440, 440, 440, 440, 440,
+ 394, 1358, 1359, 1358, 440, 396, 440, 440,
+ 441, 1360, 440, 440, 440, 440, 440, 394,
+ 1361, 1362, 1361, 396, 445, 1360, 394, 1363,
+ 398, 396, 394, 1364, 398, 1364, 396, 445,
+ 1360, 394, 1365, 1366, 1365, 463, 1367, 463,
+ 463, 464, 463, 463, 463, 463, 463, 463,
+ 394, 1368, 398, 396, 394, 1369, 1370, 1369,
+ 463, 1367, 463, 463, 464, 463, 463, 463,
+ 463, 463, 463, 394, 1371, 398, 396, 394,
+ 1372, 398, 1372, 1373, 394, 398, 396, 1375,
+ 1374, 1374, 1374, 394, 398, 396, 1377, 1378,
+ 1376, 1376, 1376, 394, 398, 396, 1377, 1378,
+ 1379, 1379, 1379, 394, 398, 396, 1377, 1378,
+ 1380, 1380, 1380, 394, 398, 396, 1377, 1378,
+ 394, 398, 396, 1382, 1381, 1374, 1374, 394,
+ 398, 396, 1383, 1377, 1378, 1384, 1376, 1376,
+ 394, 398, 396, 1385, 394, 398, 396, 1386,
+ 1387, 394, 398, 396, 1388, 394, 398, 396,
+ 1389, 1390, 394, 398, 396, 1391, 394, 398,
+ 396, 1378, 1392, 394, 398, 396, 1378, 1393,
+ 394, 398, 396, 1378, 394, 470, 471, 470,
+ 396, 441, 394, 398, 396, 1389, 1394, 394,
+ 398, 396, 1389, 394, 398, 396, 1386, 1395,
+ 394, 398, 396, 1386, 394, 398, 396, 1383,
+ 1377, 1378, 1396, 1379, 1379, 394, 398, 396,
+ 1383, 1377, 1378, 1380, 1380, 1380, 394, 398,
+ 396, 1398, 1378, 1397, 1397, 1397, 394, 398,
+ 396, 1400, 1378, 1399, 1399, 1399, 394, 398,
+ 396, 1400, 1378, 1401, 1401, 1401, 394, 398,
+ 396, 1400, 1378, 1402, 1402, 1402, 394, 398,
+ 396, 1400, 1378, 394, 398, 396, 1403, 1397,
+ 1397, 394, 398, 396, 1383, 1400, 1378, 1404,
+ 1399, 1399, 394, 398, 396, 1383, 1400, 1378,
+ 1405, 1401, 1401, 394, 398, 396, 1383, 1400,
+ 1378, 1402, 1402, 1402, 394, 398, 396, 1406,
+ 394, 398, 396, 1383, 1407, 394, 398, 396,
+ 1383, 1408, 394, 398, 396, 1383, 394, 398,
+ 396, 1382, 394, 1409, 398, 396, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 1410, 1410, 440, 440, 440, 440, 440, 394,
+ 438, 439, 438, 440, 396, 440, 440, 441,
+ 442, 1411, 1411, 440, 440, 440, 440, 440,
+ 394, 1412, 1413, 1412, 440, 396, 440, 440,
+ 441, 1414, 440, 440, 440, 440, 440, 394,
+ 1415, 1416, 1415, 396, 445, 1414, 394, 1417,
+ 398, 396, 394, 1418, 398, 1418, 396, 445,
+ 1414, 394, 1414, 1419, 1414, 463, 1420, 463,
+ 463, 464, 463, 463, 463, 463, 463, 463,
+ 394, 1421, 398, 396, 394, 1422, 1423, 1422,
+ 463, 1420, 463, 463, 464, 463, 463, 463,
+ 463, 463, 463, 394, 1424, 398, 396, 394,
+ 1425, 398, 1425, 1420, 394, 1426, 1427, 1426,
+ 197, 1428, 198, 195, 195, 194, 1429, 1430,
+ 1429, 202, 866, 203, 200, 200, 199, 1431,
+ 204, 202, 200, 1432, 1433, 1432, 202, 866,
+ 203, 200, 200, 199, 1434, 398, 396, 394,
+ 438, 439, 438, 440, 396, 440, 440, 441,
+ 442, 1435, 1435, 440, 440, 440, 440, 440,
+ 394, 438, 439, 438, 440, 396, 440, 440,
+ 441, 442, 1436, 1436, 440, 440, 440, 440,
+ 440, 394, 438, 439, 438, 440, 396, 440,
+ 440, 441, 442, 1437, 1437, 440, 440, 440,
+ 440, 440, 394, 438, 439, 438, 440, 396,
+ 440, 440, 441, 442, 1438, 1438, 440, 440,
+ 440, 440, 440, 394, 1439, 1440, 1439, 440,
+ 396, 440, 440, 441, 1441, 440, 440, 440,
+ 440, 440, 394, 1442, 1443, 1442, 396, 445,
+ 1441, 394, 1444, 398, 396, 394, 1445, 398,
+ 1445, 396, 445, 1441, 394, 1446, 1447, 1446,
+ 463, 1448, 463, 463, 464, 463, 463, 463,
+ 463, 463, 463, 394, 1449, 398, 396, 394,
+ 1450, 1451, 1450, 463, 1448, 463, 463, 464,
+ 463, 463, 463, 463, 463, 463, 394, 1452,
+ 398, 396, 394, 1453, 398, 1453, 1454, 394,
+ 1455, 398, 396, 394, 438, 439, 438, 440,
+ 396, 440, 440, 441, 442, 1456, 1456, 440,
+ 440, 440, 440, 440, 394, 438, 439, 438,
+ 440, 396, 440, 440, 441, 442, 1457, 1457,
+ 440, 440, 440, 440, 440, 394, 438, 439,
+ 438, 440, 396, 440, 440, 441, 442, 1458,
+ 1458, 440, 440, 440, 440, 440, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 1459, 1459, 440, 440, 440, 440, 440, 394,
+ 1460, 1461, 1460, 440, 396, 440, 440, 441,
+ 1462, 440, 440, 440, 440, 440, 394, 1463,
+ 1464, 1463, 396, 445, 1462, 394, 1465, 398,
+ 396, 394, 1466, 398, 1466, 396, 445, 1462,
+ 394, 1462, 1467, 1462, 463, 401, 463, 463,
+ 1468, 1469, 464, 1468, 1469, 463, 463, 463,
+ 463, 463, 463, 394, 1470, 398, 396, 394,
+ 1471, 467, 1471, 463, 401, 463, 463, 1468,
+ 1469, 464, 1468, 1469, 463, 463, 463, 463,
+ 463, 463, 394, 470, 471, 470, 463, 396,
+ 463, 463, 441, 1472, 1472, 463, 463, 463,
+ 463, 463, 394, 470, 471, 470, 463, 396,
+ 463, 463, 441, 1473, 1473, 463, 463, 463,
+ 463, 463, 394, 470, 471, 470, 463, 396,
+ 463, 463, 441, 1474, 1474, 463, 463, 463,
+ 463, 463, 394, 470, 471, 470, 463, 396,
+ 463, 463, 441, 1475, 1475, 463, 463, 463,
+ 463, 463, 394, 1476, 1477, 1476, 396, 1478,
+ 394, 470, 471, 470, 463, 396, 463, 463,
+ 441, 1479, 1479, 463, 463, 463, 463, 463,
+ 394, 470, 471, 470, 463, 396, 463, 463,
+ 441, 1474, 1474, 463, 463, 463, 463, 463,
+ 394, 1480, 398, 396, 394, 1481, 204, 202,
+ 200, 900, 901, 900, 902, 202, 902, 902,
+ 903, 904, 1482, 1482, 902, 902, 902, 902,
+ 902, 200, 900, 901, 900, 902, 202, 902,
+ 902, 903, 904, 1483, 1483, 902, 902, 902,
+ 902, 902, 200, 900, 901, 900, 902, 202,
+ 902, 902, 903, 904, 1484, 1484, 902, 902,
+ 902, 902, 902, 200, 900, 901, 900, 902,
+ 202, 902, 902, 903, 904, 1485, 1485, 902,
+ 902, 902, 902, 902, 200, 900, 901, 900,
+ 902, 202, 902, 902, 903, 904, 1486, 1486,
+ 902, 902, 902, 902, 902, 200, 900, 901,
+ 900, 902, 202, 902, 902, 903, 904, 1487,
+ 1487, 902, 902, 902, 902, 902, 200, 900,
+ 901, 900, 902, 202, 902, 902, 903, 904,
+ 1488, 1488, 902, 902, 902, 902, 902, 200,
+ 1489, 1490, 1489, 902, 202, 902, 902, 903,
+ 1491, 902, 902, 902, 902, 902, 200, 1492,
+ 1493, 1492, 202, 907, 1491, 200, 1494, 204,
+ 202, 200, 1495, 204, 1495, 202, 907, 1491,
+ 200, 1491, 1496, 1491, 1497, 265, 1497, 1497,
+ 926, 1497, 1497, 1497, 1497, 1497, 1497, 200,
+ 1498, 204, 202, 200, 1499, 929, 1499, 1497,
+ 265, 1497, 1497, 926, 1497, 1497, 1497, 1497,
+ 1497, 1497, 200, 1500, 1501, 1500, 1502, 202,
+ 1502, 1502, 1503, 1502, 1502, 1502, 1502, 1502,
+ 200, 1504, 204, 202, 200, 201, 202, 1506,
+ 203, 200, 200, 200, 1505, 1505, 1505, 199,
+ 201, 202, 1508, 203, 1509, 200, 200, 200,
+ 1507, 1507, 1507, 199, 201, 202, 1508, 203,
+ 1509, 200, 200, 200, 1510, 1510, 1510, 199,
+ 201, 202, 1508, 203, 1509, 200, 200, 200,
+ 1511, 1511, 1511, 199, 201, 202, 1508, 203,
+ 1509, 200, 200, 200, 199, 201, 202, 1513,
+ 203, 200, 200, 200, 1512, 1505, 1505, 199,
+ 201, 202, 1514, 1508, 203, 1509, 200, 200,
+ 200, 1515, 1507, 1507, 199, 201, 202, 203,
+ 200, 200, 200, 1516, 199, 201, 202, 1517,
+ 203, 200, 200, 200, 1518, 199, 201, 202,
+ 203, 200, 200, 200, 1519, 199, 201, 202,
+ 1520, 203, 200, 200, 200, 1521, 199, 201,
+ 202, 203, 200, 200, 200, 1522, 199, 201,
+ 202, 203, 1509, 200, 200, 200, 1523, 199,
+ 201, 202, 203, 1509, 200, 200, 200, 1524,
+ 199, 201, 202, 203, 1509, 200, 200, 200,
+ 199, 897, 898, 897, 202, 883, 203, 200,
+ 200, 199, 201, 202, 1520, 203, 200, 200,
+ 200, 1525, 199, 201, 202, 1520, 203, 200,
+ 200, 200, 199, 201, 202, 1517, 203, 200,
+ 200, 200, 1526, 199, 201, 202, 1517, 203,
+ 200, 200, 200, 199, 201, 202, 1514, 1508,
+ 203, 1509, 200, 200, 200, 1527, 1510, 1510,
+ 199, 201, 202, 1514, 1508, 203, 1509, 200,
+ 200, 200, 1511, 1511, 1511, 199, 201, 202,
+ 1529, 203, 1509, 200, 200, 200, 1528, 1528,
+ 1528, 199, 201, 202, 1531, 203, 1509, 200,
+ 200, 200, 1530, 1530, 1530, 199, 201, 202,
+ 1531, 203, 1509, 200, 200, 200, 1532, 1532,
+ 1532, 199, 201, 202, 1531, 203, 1509, 200,
+ 200, 200, 1533, 1533, 1533, 199, 201, 202,
+ 1531, 203, 1509, 200, 200, 200, 199, 201,
+ 202, 203, 200, 200, 200, 1534, 1528, 1528,
+ 199, 201, 202, 1514, 1531, 203, 1509, 200,
+ 200, 200, 1535, 1530, 1530, 199, 201, 202,
+ 1514, 1531, 203, 1509, 200, 200, 200, 1536,
+ 1532, 1532, 199, 201, 202, 1514, 1531, 203,
+ 1509, 200, 200, 200, 1533, 1533, 1533, 199,
+ 201, 202, 203, 200, 200, 200, 1537, 199,
+ 201, 202, 1514, 203, 200, 200, 200, 1538,
+ 199, 201, 202, 1514, 203, 200, 200, 200,
+ 1539, 199, 201, 202, 1514, 203, 200, 200,
+ 200, 199, 201, 202, 1513, 203, 200, 200,
+ 200, 199, 1540, 204, 202, 200, 880, 881,
+ 880, 882, 202, 882, 882, 883, 884, 1541,
+ 203, 1541, 882, 200, 200, 882, 882, 882,
+ 882, 199, 880, 881, 880, 882, 202, 882,
+ 882, 883, 884, 1542, 203, 1542, 882, 200,
+ 200, 882, 882, 882, 882, 199, 880, 881,
+ 880, 882, 202, 882, 882, 883, 884, 1543,
+ 203, 1543, 882, 200, 200, 882, 882, 882,
+ 882, 199, 880, 881, 880, 882, 202, 882,
+ 882, 883, 884, 1544, 203, 1544, 882, 200,
+ 200, 882, 882, 882, 882, 199, 880, 881,
+ 880, 882, 202, 882, 882, 883, 884, 1545,
+ 203, 1545, 882, 200, 200, 882, 882, 882,
+ 882, 199, 880, 881, 880, 882, 202, 882,
+ 882, 883, 884, 1546, 203, 1546, 882, 200,
+ 200, 882, 882, 882, 882, 199, 880, 881,
+ 880, 882, 202, 882, 882, 883, 884, 1547,
+ 203, 1547, 882, 200, 200, 882, 882, 882,
+ 882, 199, 880, 881, 880, 882, 202, 882,
+ 882, 883, 884, 1548, 203, 1548, 882, 200,
+ 200, 882, 882, 882, 882, 199, 1549, 1550,
+ 1549, 882, 202, 882, 882, 883, 1551, 203,
+ 882, 200, 200, 882, 882, 882, 882, 199,
+ 1552, 1553, 1552, 202, 866, 1551, 203, 200,
+ 200, 199, 1554, 204, 202, 200, 1555, 201,
+ 1555, 202, 866, 1551, 203, 200, 200, 199,
+ 1551, 1556, 1551, 1557, 265, 1557, 1557, 891,
+ 203, 1557, 200, 200, 1557, 1557, 1557, 1557,
+ 1557, 199, 1558, 204, 202, 200, 1559, 894,
+ 1559, 1557, 265, 1557, 1557, 891, 203, 1557,
+ 200, 200, 1557, 1557, 1557, 1557, 1557, 199,
+ 1560, 1561, 1560, 1562, 202, 1562, 1562, 1563,
+ 203, 1562, 200, 200, 1562, 1562, 1562, 1562,
+ 199, 1564, 204, 202, 200, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1565, 203,
+ 1565, 882, 200, 200, 882, 882, 882, 882,
+ 199, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1566, 203, 1566, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1567, 203,
+ 1567, 882, 200, 200, 882, 882, 882, 882,
+ 199, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1568, 203, 1568, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1569, 203,
+ 1569, 882, 200, 200, 882, 882, 882, 882,
+ 199, 1570, 1571, 1570, 882, 202, 882, 882,
+ 883, 1572, 203, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1573, 1574, 1573, 202, 866,
+ 1572, 203, 200, 200, 199, 1575, 204, 202,
+ 200, 1576, 201, 1576, 202, 866, 1572, 203,
+ 200, 200, 199, 1572, 1577, 1572, 890, 1339,
+ 890, 890, 891, 203, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 1578, 204, 202,
+ 200, 1579, 1580, 1579, 890, 1339, 890, 890,
+ 891, 203, 890, 200, 200, 890, 890, 890,
+ 890, 890, 199, 1581, 204, 202, 200, 1582,
+ 201, 1582, 1339, 203, 200, 200, 199, 1583,
+ 204, 202, 200, 880, 881, 880, 882, 202,
+ 882, 882, 883, 884, 1584, 203, 1584, 882,
+ 200, 200, 882, 882, 882, 882, 199, 880,
+ 881, 880, 882, 202, 882, 882, 883, 884,
+ 1585, 203, 1585, 882, 200, 200, 882, 882,
+ 882, 882, 199, 880, 881, 880, 882, 202,
+ 882, 882, 883, 884, 1586, 203, 1586, 882,
+ 200, 200, 882, 882, 882, 882, 199, 880,
+ 881, 880, 882, 202, 882, 882, 883, 884,
+ 1587, 203, 1587, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1588, 1589, 1588, 882, 202,
+ 882, 882, 883, 1590, 203, 882, 200, 200,
+ 882, 882, 882, 882, 199, 1591, 1592, 1591,
+ 202, 866, 1590, 203, 200, 200, 199, 1593,
+ 204, 202, 200, 1594, 201, 1594, 202, 866,
+ 1590, 203, 200, 200, 199, 1595, 1596, 1595,
+ 890, 952, 890, 890, 891, 203, 890, 200,
+ 200, 890, 890, 890, 890, 890, 199, 1597,
+ 204, 202, 200, 1598, 1599, 1598, 890, 952,
+ 890, 890, 891, 203, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 1600, 204, 202,
+ 200, 1601, 201, 1601, 958, 203, 200, 200,
+ 199, 1602, 204, 202, 200, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1603, 203,
+ 1603, 882, 200, 200, 882, 882, 882, 882,
+ 199, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1604, 203, 1604, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1605, 203,
+ 1605, 882, 200, 200, 882, 882, 882, 882,
+ 199, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1606, 203, 1606, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1607, 203,
+ 1607, 882, 200, 200, 882, 882, 882, 882,
+ 199, 1608, 1609, 1608, 882, 202, 882, 882,
+ 883, 1610, 203, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1611, 1612, 1611, 202, 866,
+ 1610, 203, 200, 200, 199, 1613, 204, 202,
+ 200, 1614, 201, 1614, 202, 866, 1610, 203,
+ 200, 200, 199, 1615, 1616, 1615, 890, 1009,
+ 890, 890, 891, 203, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 1617, 204, 202,
+ 200, 1618, 1619, 1618, 890, 1009, 890, 890,
+ 891, 203, 890, 200, 200, 890, 890, 890,
+ 890, 890, 199, 1620, 204, 202, 200, 1621,
+ 201, 1621, 1015, 203, 200, 200, 199, 1622,
+ 204, 202, 200, 880, 881, 880, 882, 202,
+ 882, 882, 883, 884, 1623, 203, 1623, 882,
+ 200, 200, 882, 882, 882, 882, 199, 880,
+ 881, 880, 882, 202, 882, 882, 883, 884,
+ 1624, 203, 1624, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1625, 1626, 1625, 882, 202,
+ 882, 882, 883, 1627, 203, 882, 200, 200,
+ 882, 882, 882, 882, 199, 1628, 1629, 1628,
+ 202, 866, 1627, 203, 200, 200, 199, 1630,
+ 204, 202, 200, 1631, 201, 1631, 202, 866,
+ 1627, 203, 200, 200, 199, 1627, 1632, 1627,
+ 890, 202, 890, 890, 891, 203, 890, 200,
+ 200, 890, 890, 890, 890, 890, 199, 1633,
+ 204, 202, 200, 1634, 201, 1634, 890, 202,
+ 890, 890, 891, 203, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 1635, 204, 202,
+ 200, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1636, 203, 1636, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1637, 203,
+ 1637, 882, 200, 200, 882, 882, 882, 882,
+ 199, 880, 881, 880, 882, 202, 882, 882,
+ 883, 884, 1638, 203, 1638, 882, 200, 200,
+ 882, 882, 882, 882, 199, 880, 881, 880,
+ 882, 202, 882, 882, 883, 884, 1639, 203,
+ 1639, 882, 200, 200, 882, 882, 882, 882,
+ 199, 1640, 1641, 1640, 882, 202, 882, 882,
+ 883, 1642, 203, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1643, 1644, 1643, 202, 866,
+ 1642, 203, 200, 200, 199, 1645, 204, 202,
+ 200, 1646, 201, 1646, 202, 866, 1642, 203,
+ 200, 200, 199, 1647, 1648, 1647, 890, 1048,
+ 890, 890, 891, 203, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 1649, 204, 202,
+ 200, 1650, 1651, 1650, 890, 1048, 890, 890,
+ 891, 203, 890, 200, 200, 890, 890, 890,
+ 890, 890, 199, 1652, 204, 202, 200, 1653,
+ 201, 1653, 1054, 203, 200, 200, 199, 1654,
+ 204, 202, 200, 880, 881, 880, 882, 202,
+ 882, 882, 883, 884, 1655, 203, 1655, 882,
+ 200, 200, 882, 882, 882, 882, 199, 880,
+ 881, 880, 882, 202, 882, 882, 883, 884,
+ 1656, 203, 1656, 882, 200, 200, 882, 882,
+ 882, 882, 199, 880, 881, 880, 882, 202,
+ 882, 882, 883, 884, 1657, 203, 1657, 882,
+ 200, 200, 882, 882, 882, 882, 199, 880,
+ 881, 880, 882, 202, 882, 882, 883, 884,
+ 1658, 203, 1658, 882, 200, 200, 882, 882,
+ 882, 882, 199, 1659, 1660, 1659, 882, 202,
+ 882, 882, 883, 1661, 203, 882, 200, 200,
+ 882, 882, 882, 882, 199, 1662, 1663, 1662,
+ 202, 866, 1661, 203, 200, 200, 199, 1664,
+ 204, 202, 200, 1665, 201, 1665, 202, 866,
+ 1661, 203, 200, 200, 199, 1661, 1666, 1661,
+ 890, 265, 890, 890, 1667, 1668, 891, 203,
+ 1667, 1668, 890, 200, 200, 890, 890, 890,
+ 890, 890, 199, 1669, 204, 202, 200, 1670,
+ 894, 1670, 890, 265, 890, 890, 1667, 1668,
+ 891, 203, 1667, 1668, 890, 200, 200, 890,
+ 890, 890, 890, 890, 199, 897, 898, 897,
+ 890, 202, 890, 890, 883, 1671, 203, 1671,
+ 890, 200, 200, 890, 890, 890, 890, 199,
+ 897, 898, 897, 890, 202, 890, 890, 883,
+ 1672, 203, 1672, 890, 200, 200, 890, 890,
+ 890, 890, 199, 897, 898, 897, 890, 202,
+ 890, 890, 883, 1673, 203, 1673, 890, 200,
+ 200, 890, 890, 890, 890, 199, 897, 898,
+ 897, 890, 202, 890, 890, 883, 1674, 203,
+ 1674, 890, 200, 200, 890, 890, 890, 890,
+ 199, 1675, 1676, 1675, 202, 1677, 203, 200,
+ 200, 199, 897, 898, 897, 890, 202, 890,
+ 890, 883, 1678, 203, 1678, 890, 200, 200,
+ 890, 890, 890, 890, 199, 897, 898, 897,
+ 890, 202, 890, 890, 883, 1673, 203, 1673,
+ 890, 200, 200, 890, 890, 890, 890, 199,
+ 1679, 204, 202, 200, 1680, 26, 21, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 1681, 172, 1681, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 1682, 172, 1682, 691,
+ 21, 21, 691, 691, 691, 691, 169, 689,
+ 690, 689, 691, 171, 691, 691, 692, 693,
+ 1683, 172, 1683, 691, 21, 21, 691, 691,
+ 691, 691, 169, 689, 690, 689, 691, 171,
+ 691, 691, 692, 693, 1684, 172, 1684, 691,
+ 21, 21, 691, 691, 691, 691, 169, 1685,
+ 1686, 1685, 691, 171, 691, 691, 692, 1687,
+ 172, 691, 21, 21, 691, 691, 691, 691,
+ 169, 1688, 1689, 1688, 171, 675, 1687, 172,
+ 21, 21, 169, 1690, 26, 21, 1691, 170,
+ 1691, 171, 675, 1687, 172, 21, 21, 169,
+ 1692, 1693, 1692, 699, 1694, 699, 699, 701,
+ 172, 699, 21, 21, 699, 699, 699, 699,
+ 699, 169, 1695, 26, 21, 1696, 1697, 1696,
+ 699, 1694, 699, 699, 701, 172, 699, 21,
+ 21, 699, 699, 699, 699, 699, 169, 1698,
+ 26, 21, 1699, 170, 1699, 1700, 172, 21,
+ 21, 169, 1701, 1702, 1701, 232, 1703, 233,
+ 21, 21, 230, 1704, 26, 21, 689, 690,
+ 689, 691, 171, 691, 691, 692, 693, 1705,
+ 172, 1705, 691, 21, 21, 691, 691, 691,
+ 691, 169, 689, 690, 689, 691, 171, 691,
+ 691, 692, 693, 1706, 172, 1706, 691, 21,
+ 21, 691, 691, 691, 691, 169, 689, 690,
+ 689, 691, 171, 691, 691, 692, 693, 1707,
+ 172, 1707, 691, 21, 21, 691, 691, 691,
+ 691, 169, 689, 690, 689, 691, 171, 691,
+ 691, 692, 693, 1708, 172, 1708, 691, 21,
+ 21, 691, 691, 691, 691, 169, 1709, 1710,
+ 1709, 691, 171, 691, 691, 692, 1711, 172,
+ 691, 21, 21, 691, 691, 691, 691, 169,
+ 1712, 1713, 1712, 171, 675, 1711, 172, 21,
+ 21, 169, 1714, 26, 21, 1715, 170, 1715,
+ 171, 675, 1711, 172, 21, 21, 169, 1711,
+ 1716, 1711, 699, 700, 699, 699, 1717, 1718,
+ 701, 172, 1717, 1718, 699, 21, 21, 699,
+ 699, 699, 699, 699, 169, 1719, 26, 21,
+ 1720, 704, 1720, 699, 700, 699, 699, 1717,
+ 1718, 701, 172, 1717, 1718, 699, 21, 21,
+ 699, 699, 699, 699, 699, 169, 710, 711,
+ 710, 699, 171, 699, 699, 692, 1721, 172,
+ 1721, 699, 21, 21, 699, 699, 699, 699,
+ 169, 710, 711, 710, 699, 171, 699, 699,
+ 692, 1722, 172, 1722, 699, 21, 21, 699,
+ 699, 699, 699, 169, 710, 711, 710, 699,
+ 171, 699, 699, 692, 1723, 172, 1723, 699,
+ 21, 21, 699, 699, 699, 699, 169, 710,
+ 711, 710, 699, 171, 699, 699, 692, 1724,
+ 172, 1724, 699, 21, 21, 699, 699, 699,
+ 699, 169, 1725, 1726, 1725, 171, 1727, 172,
+ 21, 21, 169, 710, 711, 710, 699, 171,
+ 699, 699, 692, 1728, 172, 1728, 699, 21,
+ 21, 699, 699, 699, 699, 169, 710, 711,
+ 710, 699, 171, 699, 699, 692, 1723, 172,
+ 1723, 699, 21, 21, 699, 699, 699, 699,
+ 169, 1729, 26, 21, 1730, 26, 21, 516,
+ 517, 516, 518, 108, 518, 518, 519, 520,
+ 1731, 109, 1731, 518, 21, 21, 518, 518,
+ 518, 518, 106, 516, 517, 516, 518, 108,
+ 518, 518, 519, 520, 1732, 109, 1732, 518,
+ 21, 21, 518, 518, 518, 518, 106, 1733,
+ 1734, 1733, 518, 108, 518, 518, 519, 1735,
+ 109, 518, 21, 21, 518, 518, 518, 518,
+ 106, 1736, 1737, 1736, 108, 499, 1735, 109,
+ 21, 21, 106, 1738, 26, 21, 1739, 107,
+ 1739, 108, 499, 1735, 109, 21, 21, 106,
+ 1735, 1740, 1735, 526, 1741, 526, 526, 528,
+ 109, 526, 21, 21, 526, 526, 526, 526,
+ 526, 106, 1742, 26, 21, 1743, 1744, 1743,
+ 526, 1741, 526, 526, 528, 109, 526, 21,
+ 21, 526, 526, 526, 526, 526, 106, 1745,
+ 26, 21, 1746, 107, 1746, 1741, 109, 21,
+ 21, 106, 1747, 1748, 1747, 197, 1749, 198,
+ 195, 195, 194, 1750, 26, 21, 516, 517,
+ 516, 518, 108, 518, 518, 519, 520, 1751,
+ 109, 1751, 518, 21, 21, 518, 518, 518,
+ 518, 106, 516, 517, 516, 518, 108, 518,
+ 518, 519, 520, 1752, 109, 1752, 518, 21,
+ 21, 518, 518, 518, 518, 106, 516, 517,
+ 516, 518, 108, 518, 518, 519, 520, 1753,
+ 109, 1753, 518, 21, 21, 518, 518, 518,
+ 518, 106, 516, 517, 516, 518, 108, 518,
+ 518, 519, 520, 1754, 109, 1754, 518, 21,
+ 21, 518, 518, 518, 518, 106, 1755, 1756,
+ 1755, 518, 108, 518, 518, 519, 1757, 109,
+ 518, 21, 21, 518, 518, 518, 518, 106,
+ 1758, 1759, 1758, 108, 499, 1757, 109, 21,
+ 21, 106, 1760, 26, 21, 1761, 107, 1761,
+ 108, 499, 1757, 109, 21, 21, 106, 1762,
+ 1763, 1762, 526, 1764, 526, 526, 528, 109,
+ 526, 21, 21, 526, 526, 526, 526, 526,
+ 106, 1765, 26, 21, 1766, 1767, 1766, 526,
+ 1764, 526, 526, 528, 109, 526, 21, 21,
+ 526, 526, 526, 526, 526, 106, 1768, 26,
+ 21, 1769, 107, 1769, 1770, 109, 21, 21,
+ 106, 1771, 1772, 1771, 232, 1773, 233, 21,
+ 21, 230, 1774, 26, 21, 516, 517, 516,
+ 518, 108, 518, 518, 519, 520, 1775, 109,
+ 1775, 518, 21, 21, 518, 518, 518, 518,
+ 106, 516, 517, 516, 518, 108, 518, 518,
+ 519, 520, 1776, 109, 1776, 518, 21, 21,
+ 518, 518, 518, 518, 106, 516, 517, 516,
+ 518, 108, 518, 518, 519, 520, 1777, 109,
+ 1777, 518, 21, 21, 518, 518, 518, 518,
+ 106, 516, 517, 516, 518, 108, 518, 518,
+ 519, 520, 1778, 109, 1778, 518, 21, 21,
+ 518, 518, 518, 518, 106, 1779, 1780, 1779,
+ 518, 108, 518, 518, 519, 1781, 109, 518,
+ 21, 21, 518, 518, 518, 518, 106, 1782,
+ 1783, 1782, 108, 499, 1781, 109, 21, 21,
+ 106, 1784, 26, 21, 1785, 107, 1785, 108,
+ 499, 1781, 109, 21, 21, 106, 1781, 1786,
+ 1781, 526, 527, 526, 526, 1787, 1788, 528,
+ 109, 1787, 1788, 526, 21, 21, 526, 526,
+ 526, 526, 526, 106, 1789, 26, 21, 1790,
+ 531, 1790, 526, 527, 526, 526, 1787, 1788,
+ 528, 109, 1787, 1788, 526, 21, 21, 526,
+ 526, 526, 526, 526, 106, 537, 538, 537,
+ 526, 108, 526, 526, 519, 1791, 109, 1791,
+ 526, 21, 21, 526, 526, 526, 526, 106,
+ 537, 538, 537, 526, 108, 526, 526, 519,
+ 1792, 109, 1792, 526, 21, 21, 526, 526,
+ 526, 526, 106, 537, 538, 537, 526, 108,
+ 526, 526, 519, 1793, 109, 1793, 526, 21,
+ 21, 526, 526, 526, 526, 106, 537, 538,
+ 537, 526, 108, 526, 526, 519, 1794, 109,
+ 1794, 526, 21, 21, 526, 526, 526, 526,
+ 106, 1795, 1796, 1795, 108, 1797, 109, 21,
+ 21, 106, 537, 538, 537, 526, 108, 526,
+ 526, 519, 1798, 109, 1798, 526, 21, 21,
+ 526, 526, 526, 526, 106, 537, 538, 537,
+ 526, 108, 526, 526, 519, 1793, 109, 1793,
+ 526, 21, 21, 526, 526, 526, 526, 106,
+ 1799, 26, 21, 1800, 398, 396, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 1801, 1801, 440, 440, 440, 440, 440, 394,
+ 438, 439, 438, 440, 396, 440, 440, 441,
+ 442, 1802, 1802, 440, 440, 440, 440, 440,
+ 394, 438, 439, 438, 440, 396, 440, 440,
+ 441, 442, 1803, 1803, 440, 440, 440, 440,
+ 440, 394, 438, 439, 438, 440, 396, 440,
+ 440, 441, 442, 1804, 1804, 440, 440, 440,
+ 440, 440, 394, 1805, 1806, 1805, 440, 396,
+ 440, 440, 441, 1807, 440, 440, 440, 440,
+ 440, 394, 1808, 1809, 1808, 396, 445, 1807,
+ 394, 1810, 398, 396, 394, 1811, 398, 1811,
+ 396, 445, 1807, 394, 1807, 1812, 1807, 463,
+ 396, 463, 463, 464, 463, 463, 463, 463,
+ 463, 463, 394, 1813, 398, 396, 394, 1814,
+ 398, 1814, 463, 396, 463, 463, 464, 463,
+ 463, 463, 463, 463, 463, 394, 1815, 398,
+ 396, 394, 438, 439, 438, 440, 396, 440,
+ 440, 441, 442, 1816, 1816, 440, 440, 440,
+ 440, 440, 394, 438, 439, 438, 440, 396,
+ 440, 440, 441, 442, 1817, 1817, 440, 440,
+ 440, 440, 440, 394, 438, 439, 438, 440,
+ 396, 440, 440, 441, 442, 1818, 1818, 440,
+ 440, 440, 440, 440, 394, 438, 439, 438,
+ 440, 396, 440, 440, 441, 442, 1819, 1819,
+ 440, 440, 440, 440, 440, 394, 438, 439,
+ 438, 440, 396, 440, 440, 441, 442, 1820,
+ 1820, 440, 440, 440, 440, 440, 394, 438,
+ 439, 438, 440, 396, 440, 440, 441, 442,
+ 1821, 1821, 440, 440, 440, 440, 440, 394,
+ 438, 439, 438, 440, 396, 440, 440, 441,
+ 442, 1822, 1822, 440, 440, 440, 440, 440,
+ 394, 1823, 1824, 1823, 440, 396, 440, 440,
+ 441, 1825, 440, 440, 440, 440, 440, 394,
+ 1826, 1827, 1826, 396, 445, 1825, 394, 1828,
+ 398, 396, 394, 1829, 398, 1829, 396, 445,
+ 1825, 394, 1825, 1830, 1825, 1831, 401, 1831,
+ 1831, 464, 1831, 1831, 1831, 1831, 1831, 1831,
+ 394, 1832, 398, 396, 394, 1833, 467, 1833,
+ 1831, 401, 1831, 1831, 464, 1831, 1831, 1831,
+ 1831, 1831, 1831, 394, 1834, 1835, 1834, 1836,
+ 396, 1836, 1836, 1837, 1836, 1836, 1836, 1836,
+ 1836, 394, 1838, 398, 396, 394, 395, 396,
+ 1840, 397, 394, 394, 394, 1839, 1839, 1839,
+ 393, 395, 396, 1842, 397, 1843, 394, 394,
+ 394, 1841, 1841, 1841, 393, 395, 396, 1842,
+ 397, 1843, 394, 394, 394, 1844, 1844, 1844,
+ 393, 395, 396, 1842, 397, 1843, 394, 394,
+ 394, 1845, 1845, 1845, 393, 395, 396, 1842,
+ 397, 1843, 394, 394, 394, 393, 395, 396,
+ 1847, 397, 394, 394, 394, 1846, 1839, 1839,
+ 393, 395, 396, 1848, 1842, 397, 1843, 394,
+ 394, 394, 1849, 1841, 1841, 393, 395, 396,
+ 397, 394, 394, 394, 1850, 393, 395, 396,
+ 1851, 397, 394, 394, 394, 1852, 393, 395,
+ 396, 397, 394, 394, 394, 1853, 393, 395,
+ 396, 1854, 397, 394, 394, 394, 1855, 393,
+ 395, 396, 397, 394, 394, 394, 1856, 393,
+ 395, 396, 397, 1843, 394, 394, 394, 1857,
+ 393, 395, 396, 397, 1843, 394, 394, 394,
+ 1858, 393, 395, 396, 397, 1843, 394, 394,
+ 394, 393, 435, 436, 435, 396, 421, 397,
+ 394, 394, 393, 395, 396, 1854, 397, 394,
+ 394, 394, 1859, 393, 395, 396, 1854, 397,
+ 394, 394, 394, 393, 395, 396, 1851, 397,
+ 394, 394, 394, 1860, 393, 395, 396, 1851,
+ 397, 394, 394, 394, 393, 395, 396, 1848,
+ 1842, 397, 1843, 394, 394, 394, 1861, 1844,
+ 1844, 393, 395, 396, 1848, 1842, 397, 1843,
+ 394, 394, 394, 1845, 1845, 1845, 393, 395,
+ 396, 1863, 397, 1843, 394, 394, 394, 1862,
+ 1862, 1862, 393, 395, 396, 1865, 397, 1843,
+ 394, 394, 394, 1864, 1864, 1864, 393, 395,
+ 396, 1865, 397, 1843, 394, 394, 394, 1866,
+ 1866, 1866, 393, 395, 396, 1865, 397, 1843,
+ 394, 394, 394, 1867, 1867, 1867, 393, 395,
+ 396, 1865, 397, 1843, 394, 394, 394, 393,
+ 395, 396, 397, 394, 394, 394, 1868, 1862,
+ 1862, 393, 395, 396, 1848, 1865, 397, 1843,
+ 394, 394, 394, 1869, 1864, 1864, 393, 395,
+ 396, 1848, 1865, 397, 1843, 394, 394, 394,
+ 1870, 1866, 1866, 393, 395, 396, 1848, 1865,
+ 397, 1843, 394, 394, 394, 1867, 1867, 1867,
+ 393, 395, 396, 397, 394, 394, 394, 1871,
+ 393, 395, 396, 1848, 397, 394, 394, 394,
+ 1872, 393, 395, 396, 1848, 397, 394, 394,
+ 394, 1873, 393, 395, 396, 1848, 397, 394,
+ 394, 394, 393, 395, 396, 1847, 397, 394,
+ 394, 394, 393, 1874, 398, 396, 394, 418,
+ 419, 418, 420, 396, 420, 420, 421, 422,
+ 1875, 397, 1875, 420, 394, 394, 420, 420,
+ 420, 420, 393, 418, 419, 418, 420, 396,
+ 420, 420, 421, 422, 1876, 397, 1876, 420,
+ 394, 394, 420, 420, 420, 420, 393, 418,
+ 419, 418, 420, 396, 420, 420, 421, 422,
+ 1877, 397, 1877, 420, 394, 394, 420, 420,
+ 420, 420, 393, 418, 419, 418, 420, 396,
+ 420, 420, 421, 422, 1878, 397, 1878, 420,
+ 394, 394, 420, 420, 420, 420, 393, 418,
+ 419, 418, 420, 396, 420, 420, 421, 422,
+ 1879, 397, 1879, 420, 394, 394, 420, 420,
+ 420, 420, 393, 418, 419, 418, 420, 396,
+ 420, 420, 421, 422, 1880, 397, 1880, 420,
+ 394, 394, 420, 420, 420, 420, 393, 418,
+ 419, 418, 420, 396, 420, 420, 421, 422,
+ 1881, 397, 1881, 420, 394, 394, 420, 420,
+ 420, 420, 393, 418, 419, 418, 420, 396,
+ 420, 420, 421, 422, 1882, 397, 1882, 420,
+ 394, 394, 420, 420, 420, 420, 393, 1883,
+ 1884, 1883, 420, 396, 420, 420, 421, 1885,
+ 397, 420, 394, 394, 420, 420, 420, 420,
+ 393, 1886, 1887, 1886, 396, 404, 1885, 397,
+ 394, 394, 393, 1888, 398, 396, 394, 1889,
+ 395, 1889, 396, 404, 1885, 397, 394, 394,
+ 393, 1885, 1890, 1885, 1891, 401, 1891, 1891,
+ 429, 397, 1891, 394, 394, 1891, 1891, 1891,
+ 1891, 1891, 393, 1892, 398, 396, 394, 1893,
+ 432, 1893, 1891, 401, 1891, 1891, 429, 397,
+ 1891, 394, 394, 1891, 1891, 1891, 1891, 1891,
+ 393, 1894, 1895, 1894, 1896, 396, 1896, 1896,
+ 1897, 397, 1896, 394, 394, 1896, 1896, 1896,
+ 1896, 393, 1898, 398, 396, 394, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1899,
+ 397, 1899, 420, 394, 394, 420, 420, 420,
+ 420, 393, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1900, 397, 1900, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1901,
+ 397, 1901, 420, 394, 394, 420, 420, 420,
+ 420, 393, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1902, 397, 1902, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1903,
+ 397, 1903, 420, 394, 394, 420, 420, 420,
+ 420, 393, 1904, 1905, 1904, 420, 396, 420,
+ 420, 421, 1906, 397, 420, 394, 394, 420,
+ 420, 420, 420, 393, 1907, 1908, 1907, 396,
+ 404, 1906, 397, 394, 394, 393, 1909, 398,
+ 396, 394, 1910, 395, 1910, 396, 404, 1906,
+ 397, 394, 394, 393, 1906, 1911, 1906, 428,
+ 396, 428, 428, 429, 397, 428, 394, 394,
+ 428, 428, 428, 428, 428, 393, 1912, 398,
+ 396, 394, 1913, 395, 1913, 428, 396, 428,
+ 428, 429, 397, 428, 394, 394, 428, 428,
+ 428, 428, 428, 393, 1914, 398, 396, 394,
+ 418, 419, 418, 420, 396, 420, 420, 421,
+ 422, 1915, 397, 1915, 420, 394, 394, 420,
+ 420, 420, 420, 393, 418, 419, 418, 420,
+ 396, 420, 420, 421, 422, 1916, 397, 1916,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 418, 419, 418, 420, 396, 420, 420, 421,
+ 422, 1917, 397, 1917, 420, 394, 394, 420,
+ 420, 420, 420, 393, 418, 419, 418, 420,
+ 396, 420, 420, 421, 422, 1918, 397, 1918,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 1919, 1920, 1919, 420, 396, 420, 420, 421,
+ 1921, 397, 420, 394, 394, 420, 420, 420,
+ 420, 393, 1922, 1923, 1922, 396, 404, 1921,
+ 397, 394, 394, 393, 1924, 398, 396, 394,
+ 1925, 395, 1925, 396, 404, 1921, 397, 394,
+ 394, 393, 1926, 1927, 1926, 428, 490, 428,
+ 428, 429, 397, 428, 394, 394, 428, 428,
+ 428, 428, 428, 393, 1928, 398, 396, 394,
+ 1929, 1930, 1929, 428, 490, 428, 428, 429,
+ 397, 428, 394, 394, 428, 428, 428, 428,
+ 428, 393, 1931, 398, 396, 394, 1932, 395,
+ 1932, 496, 397, 394, 394, 393, 1933, 398,
+ 396, 394, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1934, 397, 1934, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1935,
+ 397, 1935, 420, 394, 394, 420, 420, 420,
+ 420, 393, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1936, 397, 1936, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1937,
+ 397, 1937, 420, 394, 394, 420, 420, 420,
+ 420, 393, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1938, 397, 1938, 420, 394,
+ 394, 420, 420, 420, 420, 393, 1939, 1940,
+ 1939, 420, 396, 420, 420, 421, 1941, 397,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 1942, 1943, 1942, 396, 404, 1941, 397, 394,
+ 394, 393, 1944, 398, 396, 394, 1945, 395,
+ 1945, 396, 404, 1941, 397, 394, 394, 393,
+ 1946, 1947, 1946, 428, 1367, 428, 428, 429,
+ 397, 428, 394, 394, 428, 428, 428, 428,
+ 428, 393, 1948, 398, 396, 394, 1949, 1950,
+ 1949, 428, 1367, 428, 428, 429, 397, 428,
+ 394, 394, 428, 428, 428, 428, 428, 393,
+ 1951, 398, 396, 394, 1952, 395, 1952, 1373,
+ 397, 394, 394, 393, 1953, 398, 396, 394,
+ 418, 419, 418, 420, 396, 420, 420, 421,
+ 422, 1954, 397, 1954, 420, 394, 394, 420,
+ 420, 420, 420, 393, 418, 419, 418, 420,
+ 396, 420, 420, 421, 422, 1955, 397, 1955,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 1956, 1957, 1956, 420, 396, 420, 420, 421,
+ 1958, 397, 420, 394, 394, 420, 420, 420,
+ 420, 393, 1959, 1960, 1959, 396, 404, 1958,
+ 397, 394, 394, 393, 1961, 398, 396, 394,
+ 1962, 395, 1962, 396, 404, 1958, 397, 394,
+ 394, 393, 1958, 1963, 1958, 428, 1420, 428,
+ 428, 429, 397, 428, 394, 394, 428, 428,
+ 428, 428, 428, 393, 1964, 398, 396, 394,
+ 1965, 1966, 1965, 428, 1420, 428, 428, 429,
+ 397, 428, 394, 394, 428, 428, 428, 428,
+ 428, 393, 1967, 398, 396, 394, 1968, 395,
+ 1968, 1420, 397, 394, 394, 393, 1969, 398,
+ 396, 394, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1970, 397, 1970, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1971,
+ 397, 1971, 420, 394, 394, 420, 420, 420,
+ 420, 393, 418, 419, 418, 420, 396, 420,
+ 420, 421, 422, 1972, 397, 1972, 420, 394,
+ 394, 420, 420, 420, 420, 393, 418, 419,
+ 418, 420, 396, 420, 420, 421, 422, 1973,
+ 397, 1973, 420, 394, 394, 420, 420, 420,
+ 420, 393, 1974, 1975, 1974, 420, 396, 420,
+ 420, 421, 1976, 397, 420, 394, 394, 420,
+ 420, 420, 420, 393, 1977, 1978, 1977, 396,
+ 404, 1976, 397, 394, 394, 393, 1979, 398,
+ 396, 394, 1980, 395, 1980, 396, 404, 1976,
+ 397, 394, 394, 393, 1981, 1982, 1981, 428,
+ 1448, 428, 428, 429, 397, 428, 394, 394,
+ 428, 428, 428, 428, 428, 393, 1983, 398,
+ 396, 394, 1984, 1985, 1984, 428, 1448, 428,
+ 428, 429, 397, 428, 394, 394, 428, 428,
+ 428, 428, 428, 393, 1986, 398, 396, 394,
+ 1987, 395, 1987, 1454, 397, 394, 394, 393,
+ 1988, 398, 396, 394, 418, 419, 418, 420,
+ 396, 420, 420, 421, 422, 1989, 397, 1989,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 418, 419, 418, 420, 396, 420, 420, 421,
+ 422, 1990, 397, 1990, 420, 394, 394, 420,
+ 420, 420, 420, 393, 418, 419, 418, 420,
+ 396, 420, 420, 421, 422, 1991, 397, 1991,
+ 420, 394, 394, 420, 420, 420, 420, 393,
+ 418, 419, 418, 420, 396, 420, 420, 421,
+ 422, 1992, 397, 1992, 420, 394, 394, 420,
+ 420, 420, 420, 393, 1993, 1994, 1993, 420,
+ 396, 420, 420, 421, 1995, 397, 420, 394,
+ 394, 420, 420, 420, 420, 393, 1996, 1997,
+ 1996, 396, 404, 1995, 397, 394, 394, 393,
+ 1998, 398, 396, 394, 1999, 395, 1999, 396,
+ 404, 1995, 397, 394, 394, 393, 1995, 2000,
+ 1995, 428, 401, 428, 428, 2001, 2002, 429,
+ 397, 2001, 2002, 428, 394, 394, 428, 428,
+ 428, 428, 428, 393, 2003, 398, 396, 394,
+ 2004, 432, 2004, 428, 401, 428, 428, 2001,
+ 2002, 429, 397, 2001, 2002, 428, 394, 394,
+ 428, 428, 428, 428, 428, 393, 435, 436,
+ 435, 428, 396, 428, 428, 421, 2005, 397,
+ 2005, 428, 394, 394, 428, 428, 428, 428,
+ 393, 435, 436, 435, 428, 396, 428, 428,
+ 421, 2006, 397, 2006, 428, 394, 394, 428,
+ 428, 428, 428, 393, 435, 436, 435, 428,
+ 396, 428, 428, 421, 2007, 397, 2007, 428,
+ 394, 394, 428, 428, 428, 428, 393, 435,
+ 436, 435, 428, 396, 428, 428, 421, 2008,
+ 397, 2008, 428, 394, 394, 428, 428, 428,
+ 428, 393, 2009, 2010, 2009, 396, 2011, 397,
+ 394, 394, 393, 435, 436, 435, 428, 396,
+ 428, 428, 421, 2012, 397, 2012, 428, 394,
+ 394, 428, 428, 428, 428, 393, 435, 436,
+ 435, 428, 396, 428, 428, 421, 2007, 397,
+ 2007, 428, 394, 394, 428, 428, 428, 428,
+ 393, 2013, 398, 396, 394, 2014, 26, 21,
+ 285, 286, 285, 287, 77, 287, 287, 288,
+ 289, 2015, 78, 2015, 287, 21, 21, 287,
+ 287, 287, 287, 69, 285, 286, 285, 287,
+ 77, 287, 287, 288, 289, 2016, 78, 2016,
+ 287, 21, 21, 287, 287, 287, 287, 69,
+ 285, 286, 285, 287, 77, 287, 287, 288,
+ 289, 2017, 78, 2017, 287, 21, 21, 287,
+ 287, 287, 287, 69, 285, 286, 285, 287,
+ 77, 287, 287, 288, 289, 2018, 78, 2018,
+ 287, 21, 21, 287, 287, 287, 287, 69,
+ 2019, 2020, 2019, 287, 77, 287, 287, 288,
+ 2021, 78, 287, 21, 21, 287, 287, 287,
+ 287, 69, 2022, 2023, 2022, 77, 268, 2021,
+ 78, 21, 21, 69, 2024, 26, 21, 2025,
+ 76, 2025, 77, 268, 2021, 78, 21, 21,
+ 69, 2026, 2027, 2026, 295, 2028, 295, 295,
+ 297, 78, 295, 21, 21, 295, 295, 295,
+ 295, 295, 69, 2029, 26, 21, 2030, 2031,
+ 2030, 295, 2028, 295, 295, 297, 78, 295,
+ 21, 21, 295, 295, 295, 295, 295, 69,
+ 2032, 26, 21, 2033, 76, 2033, 546, 78,
+ 21, 21, 69, 2034, 26, 21, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 2035,
+ 78, 2035, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 2036, 78, 2036, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 2037,
+ 78, 2037, 287, 21, 21, 287, 287, 287,
+ 287, 69, 285, 286, 285, 287, 77, 287,
+ 287, 288, 289, 2038, 78, 2038, 287, 21,
+ 21, 287, 287, 287, 287, 69, 285, 286,
+ 285, 287, 77, 287, 287, 288, 289, 2039,
+ 78, 2039, 287, 21, 21, 287, 287, 287,
+ 287, 69, 2040, 2041, 2040, 287, 77, 287,
+ 287, 288, 2042, 78, 287, 21, 21, 287,
+ 287, 287, 287, 69, 2043, 2044, 2043, 77,
+ 268, 2042, 78, 21, 21, 69, 2045, 26,
+ 21, 2046, 76, 2046, 77, 268, 2042, 78,
+ 21, 21, 69, 2047, 2048, 2047, 295, 2049,
+ 295, 295, 297, 78, 295, 21, 21, 295,
+ 295, 295, 295, 295, 69, 2050, 26, 21,
+ 2051, 2052, 2051, 295, 2049, 295, 295, 297,
+ 78, 295, 21, 21, 295, 295, 295, 295,
+ 295, 69, 2053, 26, 21, 2054, 76, 2054,
+ 717, 78, 21, 21, 69, 2055, 26, 21,
+ 285, 286, 285, 287, 77, 287, 287, 288,
+ 289, 2056, 78, 2056, 287, 21, 21, 287,
+ 287, 287, 287, 69, 285, 286, 285, 287,
+ 77, 287, 287, 288, 289, 2057, 78, 2057,
+ 287, 21, 21, 287, 287, 287, 287, 69,
+ 2058, 2059, 2058, 287, 77, 287, 287, 288,
+ 2060, 78, 287, 21, 21, 287, 287, 287,
+ 287, 69, 2061, 2062, 2061, 77, 268, 2060,
+ 78, 21, 21, 69, 2063, 26, 21, 2064,
+ 76, 2064, 77, 268, 2060, 78, 21, 21,
+ 69, 2060, 2065, 2060, 295, 2066, 295, 295,
+ 297, 78, 295, 21, 21, 295, 295, 295,
+ 295, 295, 69, 2067, 26, 21, 2068, 2069,
+ 2068, 295, 2066, 295, 295, 297, 78, 295,
+ 21, 21, 295, 295, 295, 295, 295, 69,
+ 2070, 26, 21, 2071, 76, 2071, 2066, 78,
+ 21, 21, 69, 2072, 2073, 2072, 197, 2074,
+ 198, 195, 195, 194, 2075, 26, 21, 285,
+ 286, 285, 287, 77, 287, 287, 288, 289,
+ 2076, 78, 2076, 287, 21, 21, 287, 287,
+ 287, 287, 69, 285, 286, 285, 287, 77,
+ 287, 287, 288, 289, 2077, 78, 2077, 287,
+ 21, 21, 287, 287, 287, 287, 69, 285,
+ 286, 285, 287, 77, 287, 287, 288, 289,
+ 2078, 78, 2078, 287, 21, 21, 287, 287,
+ 287, 287, 69, 285, 286, 285, 287, 77,
+ 287, 287, 288, 289, 2079, 78, 2079, 287,
+ 21, 21, 287, 287, 287, 287, 69, 2080,
+ 2081, 2080, 287, 77, 287, 287, 288, 2082,
+ 78, 287, 21, 21, 287, 287, 287, 287,
+ 69, 2083, 2084, 2083, 77, 268, 2082, 78,
+ 21, 21, 69, 2085, 26, 21, 2086, 76,
+ 2086, 77, 268, 2082, 78, 21, 21, 69,
+ 2087, 2088, 2087, 295, 2089, 295, 295, 297,
+ 78, 295, 21, 21, 295, 295, 295, 295,
+ 295, 69, 2090, 26, 21, 2091, 2092, 2091,
+ 295, 2089, 295, 295, 297, 78, 295, 21,
+ 21, 295, 295, 295, 295, 295, 69, 2093,
+ 26, 21, 2094, 76, 2094, 1104, 78, 21,
+ 21, 69, 2095, 26, 21, 285, 286, 285,
+ 287, 77, 287, 287, 288, 289, 2096, 78,
+ 2096, 287, 21, 21, 287, 287, 287, 287,
+ 69, 285, 286, 285, 287, 77, 287, 287,
+ 288, 289, 2097, 78, 2097, 287, 21, 21,
+ 287, 287, 287, 287, 69, 285, 286, 285,
+ 287, 77, 287, 287, 288, 289, 2098, 78,
+ 2098, 287, 21, 21, 287, 287, 287, 287,
+ 69, 285, 286, 285, 287, 77, 287, 287,
+ 288, 289, 2099, 78, 2099, 287, 21, 21,
+ 287, 287, 287, 287, 69, 2100, 2101, 2100,
+ 287, 77, 287, 287, 288, 2102, 78, 287,
+ 21, 21, 287, 287, 287, 287, 69, 2103,
+ 2104, 2103, 77, 268, 2102, 78, 21, 21,
+ 69, 2105, 26, 21, 2106, 76, 2106, 77,
+ 268, 2102, 78, 21, 21, 69, 2102, 2107,
+ 2102, 295, 296, 295, 295, 2108, 2109, 297,
+ 78, 2108, 2109, 295, 21, 21, 295, 295,
+ 295, 295, 295, 69, 2110, 26, 21, 2111,
+ 300, 2111, 295, 296, 295, 295, 2108, 2109,
+ 297, 78, 2108, 2109, 295, 21, 21, 295,
+ 295, 295, 295, 295, 69, 303, 304, 303,
+ 295, 77, 295, 295, 288, 2112, 78, 2112,
+ 295, 21, 21, 295, 295, 295, 295, 69,
+ 303, 304, 303, 295, 77, 295, 295, 288,
+ 2113, 78, 2113, 295, 21, 21, 295, 295,
+ 295, 295, 69, 303, 304, 303, 295, 77,
+ 295, 295, 288, 2114, 78, 2114, 295, 21,
+ 21, 295, 295, 295, 295, 69, 303, 304,
+ 303, 295, 77, 295, 295, 288, 2115, 78,
+ 2115, 295, 21, 21, 295, 295, 295, 295,
+ 69, 2116, 2117, 2116, 77, 2118, 78, 21,
+ 21, 69, 303, 304, 303, 295, 77, 295,
+ 295, 288, 2119, 78, 2119, 295, 21, 21,
+ 295, 295, 295, 295, 69, 303, 304, 303,
+ 295, 77, 295, 295, 288, 2114, 78, 2114,
+ 295, 21, 21, 295, 295, 295, 295, 69,
+ 2120, 26, 21, 2121, 26, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2122, 2122,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2123, 2123,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2124, 2124,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2125, 2125,
+ 51, 51, 51, 51, 51, 21, 2126, 2127,
+ 2126, 51, 51, 51, 52, 2128, 51, 51,
+ 51, 51, 51, 21, 2129, 2130, 2129, 56,
+ 2128, 21, 2131, 26, 21, 2132, 26, 2132,
+ 56, 2128, 21, 2128, 2133, 2128, 68, 2134,
+ 68, 68, 70, 68, 68, 68, 68, 68,
+ 68, 21, 2135, 26, 21, 2136, 2137, 2136,
+ 68, 2134, 68, 68, 70, 68, 68, 68,
+ 68, 68, 68, 21, 2138, 26, 21, 2139,
+ 26, 2139, 2134, 21, 2140, 390, 392, 387,
+ 387, 387, 386, 2141, 26, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2142, 2142,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2143, 2143,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2144, 2144,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2145, 2145,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2146, 2146,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2147, 2147,
+ 51, 51, 51, 51, 51, 21, 49, 50,
+ 49, 51, 51, 51, 52, 53, 2148, 2148,
+ 51, 51, 51, 51, 51, 21, 2149, 2150,
+ 2149, 51, 51, 51, 52, 2151, 51, 51,
+ 51, 51, 51, 21, 2152, 2153, 2152, 56,
+ 2151, 21, 2154, 26, 21, 2155, 26, 2155,
+ 56, 2151, 21, 2151, 2156, 2151, 2157, 69,
+ 2157, 2157, 70, 2157, 2157, 2157, 2157, 2157,
+ 2157, 21, 2158, 26, 21, 2159, 73, 2159,
+ 2157, 69, 2157, 2157, 70, 2157, 2157, 2157,
+ 2157, 2157, 2157, 21, 2160, 2161, 2160, 2162,
+ 2162, 2162, 2163, 2162, 2162, 2162, 2162, 2162,
+ 21, 2164, 26, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2165, 2165, 51, 51,
+ 51, 51, 51, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2166, 2166, 51, 51,
+ 51, 51, 51, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2167, 2167, 51, 51,
+ 51, 51, 51, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2168, 2168, 51, 51,
+ 51, 51, 51, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2169, 2169, 51, 51,
+ 51, 51, 51, 21, 2170, 2171, 2170, 51,
+ 51, 51, 52, 2172, 51, 51, 51, 51,
+ 51, 21, 2173, 2174, 2173, 56, 2172, 21,
+ 2175, 26, 21, 2176, 26, 2176, 56, 2172,
+ 21, 2172, 2177, 2172, 68, 2178, 68, 68,
+ 70, 68, 68, 68, 68, 68, 68, 21,
+ 2179, 26, 21, 2180, 2181, 2180, 68, 2178,
+ 68, 68, 70, 68, 68, 68, 68, 68,
+ 68, 21, 2182, 26, 21, 2183, 26, 2183,
+ 2178, 21, 2185, 390, 2186, 387, 387, 387,
+ 2184, 2188, 396, 2189, 394, 394, 394, 2187,
+ 2190, 398, 396, 394, 398, 2191, 2187, 2187,
+ 394, 2192, 2193, 2192, 77, 2194, 78, 21,
+ 21, 69, 2195, 26, 21, 2196, 2197, 2196,
+ 77, 2194, 78, 21, 21, 69, 2198, 26,
+ 21, 2199, 76, 2199, 77, 2194, 78, 21,
+ 21, 69, 2194, 2200, 2194, 2201, 77, 2201,
+ 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208,
+ 78, 2202, 2203, 2204, 2205, 2206, 2207, 2208,
+ 2201, 21, 21, 2201, 2201, 2201, 2201, 2201,
+ 69, 2209, 26, 21, 2210, 76, 2210, 2201,
+ 77, 2201, 2201, 2202, 2203, 2204, 2205, 2206,
+ 2207, 2208, 78, 2202, 2203, 2204, 2205, 2206,
+ 2207, 2208, 2201, 21, 21, 2201, 2201, 2201,
+ 2201, 2201, 69, 2211, 2212, 2211, 2213, 77,
+ 2213, 2213, 2214, 2215, 78, 2213, 21, 21,
+ 2213, 2213, 2213, 2213, 69, 2216, 2217, 2216,
+ 77, 2194, 2215, 78, 21, 21, 69, 2218,
+ 26, 21, 2219, 76, 2219, 77, 2194, 2215,
+ 78, 21, 21, 69, 2215, 2220, 2215, 2221,
+ 296, 2221, 2221, 2222, 78, 2221, 21, 21,
+ 2221, 2221, 2221, 2221, 2221, 69, 2223, 26,
+ 21, 2224, 300, 2224, 2221, 296, 2221, 2221,
+ 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
+ 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
+ 2221, 2221, 2214, 78, 2221, 21, 21, 2221,
+ 2221, 2221, 2221, 69, 2227, 2228, 2227, 77,
+ 2194, 78, 21, 21, 69, 2229, 26, 21,
+ 76, 77, 2231, 78, 21, 21, 21, 2230,
+ 2230, 2230, 69, 76, 77, 2233, 78, 2234,
+ 21, 21, 21, 2232, 2232, 2232, 69, 76,
+ 77, 2233, 78, 2234, 21, 21, 21, 2235,
+ 2235, 2235, 69, 76, 77, 2233, 78, 2234,
+ 21, 21, 21, 2236, 2236, 2236, 69, 76,
+ 77, 2233, 78, 2234, 21, 21, 21, 69,
+ 76, 77, 2238, 78, 21, 21, 21, 2237,
+ 2230, 2230, 69, 76, 77, 2239, 2233, 78,
+ 2234, 21, 21, 21, 2240, 2232, 2232, 69,
+ 76, 77, 78, 21, 21, 21, 2241, 69,
+ 76, 77, 2242, 78, 21, 21, 21, 2243,
+ 69, 76, 77, 78, 21, 21, 21, 2244,
+ 69, 76, 77, 2245, 78, 21, 21, 21,
+ 2246, 69, 76, 77, 78, 21, 21, 21,
+ 2247, 69, 76, 77, 78, 2234, 21, 21,
+ 21, 2248, 69, 76, 77, 78, 2234, 21,
+ 21, 21, 2249, 69, 76, 77, 78, 2234,
+ 21, 21, 21, 69, 2225, 2226, 2225, 77,
+ 2214, 78, 21, 21, 69, 76, 77, 2245,
+ 78, 21, 21, 21, 2250, 69, 76, 77,
+ 2245, 78, 21, 21, 21, 69, 76, 77,
+ 2242, 78, 21, 21, 21, 2251, 69, 76,
+ 77, 2242, 78, 21, 21, 21, 69, 76,
+ 77, 2239, 2233, 78, 2234, 21, 21, 21,
+ 2252, 2235, 2235, 69, 76, 77, 2239, 2233,
+ 78, 2234, 21, 21, 21, 2236, 2236, 2236,
+ 69, 76, 77, 2254, 78, 2234, 21, 21,
+ 21, 2253, 2253, 2253, 69, 76, 77, 2256,
+ 78, 2234, 21, 21, 21, 2255, 2255, 2255,
+ 69, 76, 77, 2256, 78, 2234, 21, 21,
+ 21, 2257, 2257, 2257, 69, 76, 77, 2256,
+ 78, 2234, 21, 21, 21, 2258, 2258, 2258,
+ 69, 76, 77, 2256, 78, 2234, 21, 21,
+ 21, 69, 76, 77, 78, 21, 21, 21,
+ 2259, 2253, 2253, 69, 76, 77, 2239, 2256,
+ 78, 2234, 21, 21, 21, 2260, 2255, 2255,
+ 69, 76, 77, 2239, 2256, 78, 2234, 21,
+ 21, 21, 2261, 2257, 2257, 69, 76, 77,
+ 2239, 2256, 78, 2234, 21, 21, 21, 2258,
+ 2258, 2258, 69, 76, 77, 78, 21, 21,
+ 21, 2262, 69, 76, 77, 2239, 78, 21,
+ 21, 21, 2263, 69, 76, 77, 2239, 78,
+ 21, 21, 21, 2264, 69, 76, 77, 2239,
+ 78, 21, 21, 21, 69, 76, 77, 2238,
+ 78, 21, 21, 21, 69, 2265, 26, 21,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2266, 78, 2266, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2267, 78, 2267,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2268, 78, 2268, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2269, 78, 2269,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2270, 78, 2270, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2271, 78, 2271,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2272, 78, 2272, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2273, 78, 2273,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2274, 2275, 2274, 2213, 77, 2213, 2213, 2214,
+ 2276, 78, 2213, 21, 21, 2213, 2213, 2213,
+ 2213, 69, 2277, 2278, 2277, 77, 2194, 2276,
+ 78, 21, 21, 69, 2279, 26, 21, 2280,
+ 76, 2280, 77, 2194, 2276, 78, 21, 21,
+ 69, 2276, 2281, 2276, 2282, 296, 2282, 2282,
+ 2222, 78, 2282, 21, 21, 2282, 2282, 2282,
+ 2282, 2282, 69, 2283, 26, 21, 2284, 300,
+ 2284, 2282, 296, 2282, 2282, 2222, 78, 2282,
+ 21, 21, 2282, 2282, 2282, 2282, 2282, 69,
+ 2285, 2286, 2285, 2287, 77, 2287, 2287, 2288,
+ 78, 2287, 21, 21, 2287, 2287, 2287, 2287,
+ 69, 2289, 26, 21, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2290, 78, 2290,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2291, 78, 2291, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2292, 78, 2292,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2293, 78, 2293, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2294, 78, 2294,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2295, 2296, 2295, 2213, 77, 2213, 2213, 2214,
+ 2297, 78, 2213, 21, 21, 2213, 2213, 2213,
+ 2213, 69, 2298, 2299, 2298, 77, 2194, 2297,
+ 78, 21, 21, 69, 2300, 26, 21, 2301,
+ 76, 2301, 77, 2194, 2297, 78, 21, 21,
+ 69, 2297, 2302, 2297, 2221, 2303, 2221, 2221,
+ 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
+ 2221, 2221, 69, 2304, 26, 21, 2305, 2306,
+ 2305, 2221, 2303, 2221, 2221, 2222, 78, 2221,
+ 21, 21, 2221, 2221, 2221, 2221, 2221, 69,
+ 2307, 26, 21, 2308, 76, 2308, 2303, 78,
+ 21, 21, 69, 2309, 2310, 2309, 390, 2311,
+ 392, 387, 387, 386, 2312, 26, 21, 2211,
+ 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
+ 2313, 78, 2313, 2213, 21, 21, 2213, 2213,
+ 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
+ 2213, 2213, 2214, 2215, 2314, 78, 2314, 2213,
+ 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
+ 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
+ 2315, 78, 2315, 2213, 21, 21, 2213, 2213,
+ 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
+ 2213, 2213, 2214, 2215, 2316, 78, 2316, 2213,
+ 21, 21, 2213, 2213, 2213, 2213, 69, 2317,
+ 2318, 2317, 2213, 77, 2213, 2213, 2214, 2319,
+ 78, 2213, 21, 21, 2213, 2213, 2213, 2213,
+ 69, 2320, 2321, 2320, 77, 2194, 2319, 78,
+ 21, 21, 69, 2322, 26, 21, 2323, 76,
+ 2323, 77, 2194, 2319, 78, 21, 21, 69,
+ 2324, 2325, 2324, 2221, 2028, 2221, 2221, 2222,
+ 78, 2221, 21, 21, 2221, 2221, 2221, 2221,
+ 2221, 69, 2326, 26, 21, 2327, 2031, 2327,
+ 2221, 2028, 2221, 2221, 2222, 78, 2221, 21,
+ 21, 2221, 2221, 2221, 2221, 2221, 69, 2328,
+ 26, 21, 2211, 2212, 2211, 2213, 77, 2213,
+ 2213, 2214, 2215, 2329, 78, 2329, 2213, 21,
+ 21, 2213, 2213, 2213, 2213, 69, 2211, 2212,
+ 2211, 2213, 77, 2213, 2213, 2214, 2215, 2330,
+ 78, 2330, 2213, 21, 21, 2213, 2213, 2213,
+ 2213, 69, 2211, 2212, 2211, 2213, 77, 2213,
+ 2213, 2214, 2215, 2331, 78, 2331, 2213, 21,
+ 21, 2213, 2213, 2213, 2213, 69, 2211, 2212,
+ 2211, 2213, 77, 2213, 2213, 2214, 2215, 2332,
+ 78, 2332, 2213, 21, 21, 2213, 2213, 2213,
+ 2213, 69, 2211, 2212, 2211, 2213, 77, 2213,
+ 2213, 2214, 2215, 2333, 78, 2333, 2213, 21,
+ 21, 2213, 2213, 2213, 2213, 69, 2334, 2335,
+ 2334, 2213, 77, 2213, 2213, 2214, 2336, 78,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2337, 2338, 2337, 77, 2194, 2336, 78, 21,
+ 21, 69, 2339, 26, 21, 2340, 76, 2340,
+ 77, 2194, 2336, 78, 21, 21, 69, 2341,
+ 2342, 2341, 2221, 2049, 2221, 2221, 2222, 78,
+ 2221, 21, 21, 2221, 2221, 2221, 2221, 2221,
+ 69, 2343, 26, 21, 2344, 2052, 2344, 2221,
+ 2049, 2221, 2221, 2222, 78, 2221, 21, 21,
+ 2221, 2221, 2221, 2221, 2221, 69, 2345, 26,
+ 21, 2211, 2212, 2211, 2213, 77, 2213, 2213,
+ 2214, 2215, 2346, 78, 2346, 2213, 21, 21,
+ 2213, 2213, 2213, 2213, 69, 2211, 2212, 2211,
+ 2213, 77, 2213, 2213, 2214, 2215, 2347, 78,
+ 2347, 2213, 21, 21, 2213, 2213, 2213, 2213,
+ 69, 2348, 2349, 2348, 2213, 77, 2213, 2213,
+ 2214, 2350, 78, 2213, 21, 21, 2213, 2213,
+ 2213, 2213, 69, 2351, 2352, 2351, 77, 2194,
+ 2350, 78, 21, 21, 69, 2353, 26, 21,
+ 2354, 76, 2354, 77, 2194, 2350, 78, 21,
+ 21, 69, 2350, 2355, 2350, 2221, 2356, 2221,
+ 2221, 2222, 78, 2221, 21, 21, 2221, 2221,
+ 2221, 2221, 2221, 69, 2357, 26, 21, 2358,
+ 2359, 2358, 2221, 2356, 2221, 2221, 2222, 78,
+ 2221, 21, 21, 2221, 2221, 2221, 2221, 2221,
+ 69, 2360, 26, 21, 2361, 76, 2361, 2356,
+ 78, 21, 21, 69, 2362, 2363, 2362, 197,
+ 2364, 198, 195, 195, 194, 2365, 26, 21,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2366, 78, 2366, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2367, 78, 2367,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2211, 2212, 2211, 2213, 77, 2213, 2213, 2214,
+ 2215, 2368, 78, 2368, 2213, 21, 21, 2213,
+ 2213, 2213, 2213, 69, 2211, 2212, 2211, 2213,
+ 77, 2213, 2213, 2214, 2215, 2369, 78, 2369,
+ 2213, 21, 21, 2213, 2213, 2213, 2213, 69,
+ 2370, 2371, 2370, 2213, 77, 2213, 2213, 2214,
+ 2372, 78, 2213, 21, 21, 2213, 2213, 2213,
+ 2213, 69, 2373, 2374, 2373, 77, 2194, 2372,
+ 78, 21, 21, 69, 2375, 26, 21, 2376,
+ 76, 2376, 77, 2194, 2372, 78, 21, 21,
+ 69, 2377, 2378, 2377, 2221, 2089, 2221, 2221,
+ 2222, 78, 2221, 21, 21, 2221, 2221, 2221,
+ 2221, 2221, 69, 2379, 26, 21, 2380, 2092,
+ 2380, 2221, 2089, 2221, 2221, 2222, 78, 2221,
+ 21, 21, 2221, 2221, 2221, 2221, 2221, 69,
+ 2381, 26, 21, 2211, 2212, 2211, 2213, 77,
+ 2213, 2213, 2214, 2215, 2382, 78, 2382, 2213,
+ 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
+ 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
+ 2383, 78, 2383, 2213, 21, 21, 2213, 2213,
+ 2213, 2213, 69, 2211, 2212, 2211, 2213, 77,
+ 2213, 2213, 2214, 2215, 2384, 78, 2384, 2213,
+ 21, 21, 2213, 2213, 2213, 2213, 69, 2211,
+ 2212, 2211, 2213, 77, 2213, 2213, 2214, 2215,
+ 2385, 78, 2385, 2213, 21, 21, 2213, 2213,
+ 2213, 2213, 69, 2386, 2387, 2386, 2213, 77,
+ 2213, 2213, 2214, 2388, 78, 2213, 21, 21,
+ 2213, 2213, 2213, 2213, 69, 2389, 2390, 2389,
+ 77, 2194, 2388, 78, 21, 21, 69, 2391,
+ 26, 21, 2392, 76, 2392, 77, 2194, 2388,
+ 78, 21, 21, 69, 2388, 2393, 2388, 2221,
+ 296, 2221, 2221, 2394, 2395, 2222, 78, 2394,
+ 2395, 2221, 21, 21, 2221, 2221, 2221, 2221,
+ 2221, 69, 2396, 26, 21, 2397, 300, 2397,
+ 2221, 296, 2221, 2221, 2394, 2395, 2222, 78,
+ 2394, 2395, 2221, 21, 21, 2221, 2221, 2221,
+ 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
+ 2221, 2221, 2214, 2398, 78, 2398, 2221, 21,
+ 21, 2221, 2221, 2221, 2221, 69, 2225, 2226,
+ 2225, 2221, 77, 2221, 2221, 2214, 2399, 78,
+ 2399, 2221, 21, 21, 2221, 2221, 2221, 2221,
+ 69, 2225, 2226, 2225, 2221, 77, 2221, 2221,
+ 2214, 2400, 78, 2400, 2221, 21, 21, 2221,
+ 2221, 2221, 2221, 69, 2225, 2226, 2225, 2221,
+ 77, 2221, 2221, 2214, 2401, 78, 2401, 2221,
+ 21, 21, 2221, 2221, 2221, 2221, 69, 2402,
+ 2403, 2402, 77, 2404, 78, 21, 21, 69,
+ 2225, 2226, 2225, 2221, 77, 2221, 2221, 2214,
+ 2405, 78, 2405, 2221, 21, 21, 2221, 2221,
+ 2221, 2221, 69, 2225, 2226, 2225, 2221, 77,
+ 2221, 2221, 2214, 2400, 78, 2400, 2221, 21,
+ 21, 2221, 2221, 2221, 2221, 69, 2406, 26,
+ 21, 2407, 26, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2408, 2408, 51, 51,
+ 51, 51, 51, 21, 49, 50, 49, 51,
+ 51, 51, 52, 53, 2409, 2409, 51, 51,
+ 51, 51, 51, 21, 2410, 2411, 2410, 51,
+ 51, 51, 52, 2412, 51, 51, 51, 51,
+ 51, 21, 2413, 2414, 2413, 56, 2412, 21,
+ 2415, 26, 21, 2416, 26, 2416, 56, 2412,
+ 21, 2412, 2417, 2412, 68, 2418, 68, 68,
+ 70, 68, 68, 68, 68, 68, 68, 21,
+ 2419, 26, 21, 2420, 2421, 2420, 68, 2418,
+ 68, 68, 70, 68, 68, 68, 68, 68,
+ 68, 21, 2422, 26, 21, 2423, 26, 2423,
+ 2418, 21, 2425, 197, 2426, 195, 195, 195,
+ 2424, 2428, 202, 2429, 200, 200, 200, 2427,
+ 2430, 204, 202, 200, 204, 2431, 2427, 2427,
+ 200, 2432, 26, 21, 26, 2433, 2433, 21,
+ 26, 2434, 2434, 21, 26, 2435, 2435, 21,
+ 26, 2436, 2436, 21, 26, 2437, 2437, 21,
+ 2438, 2439, 2438, 21, 2440, 26, 21, 30,
+ 26, 30, 21, 2441, 2441, 1, 6, 6,
+ 1, 26, 21, 30, 26, 30, 21, 48,
+ 26, 48, 21, 58, 26, 58, 21, 63,
+ 26, 63, 21, 58, 26, 58, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 72, 26,
+ 72, 21, 75, 26, 75, 21, 69, 26,
+ 69, 21, 85, 26, 85, 21, 85, 26,
+ 85, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 97, 26, 97, 21, 2442, 26, 2442,
+ 21, 105, 26, 105, 21, 106, 26, 106,
+ 21, 97, 26, 97, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 160, 26, 160, 21,
+ 2443, 26, 2443, 21, 168, 26, 168, 21,
+ 169, 26, 169, 21, 160, 26, 160, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 186,
+ 26, 186, 21, 190, 26, 190, 21, 193,
+ 26, 193, 21, 204, 202, 200, 209, 26,
+ 209, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 221, 26, 221, 21, 2444, 26, 2444,
+ 21, 229, 26, 229, 21, 230, 26, 230,
+ 21, 221, 26, 221, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 249, 26, 249, 21,
+ 254, 26, 254, 21, 249, 26, 249, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 199,
+ 204, 199, 202, 200, 270, 26, 270, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 273,
+ 26, 273, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 284, 26, 284, 21, 293, 26,
+ 293, 21, 299, 26, 299, 21, 302, 26,
+ 302, 21, 273, 26, 273, 21, 293, 26,
+ 293, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 357, 26, 357, 21, 361, 26, 361,
+ 21, 357, 26, 357, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 378, 26, 378, 21,
+ 382, 26, 382, 21, 385, 26, 385, 21,
+ 398, 396, 394, 393, 398, 393, 396, 394,
+ 406, 398, 406, 396, 394, 417, 398, 417,
+ 396, 394, 426, 398, 426, 396, 394, 431,
+ 398, 431, 396, 394, 434, 398, 434, 396,
+ 394, 406, 398, 406, 449, 396, 449, 449,
+ 450, 451, 452, 453, 454, 455, 456, 450,
+ 451, 452, 453, 454, 455, 456, 449, 449,
+ 449, 449, 449, 449, 394, 447, 398, 447,
+ 396, 394, 458, 398, 458, 396, 394, 447,
+ 398, 447, 449, 396, 449, 449, 450, 451,
+ 452, 453, 454, 455, 456, 450, 451, 452,
+ 453, 454, 455, 456, 449, 449, 449, 449,
+ 449, 449, 394, 466, 398, 466, 396, 394,
+ 469, 398, 469, 396, 394, 475, 398, 475,
+ 396, 394, 475, 398, 475, 449, 396, 449,
+ 449, 450, 451, 452, 453, 454, 455, 456,
+ 450, 451, 452, 453, 454, 455, 456, 449,
+ 449, 449, 449, 449, 449, 394, 487, 398,
+ 487, 396, 394, 2445, 398, 2445, 396, 394,
+ 495, 398, 495, 396, 394, 501, 26, 501,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 504, 26, 504, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 515, 26, 515, 21, 524,
+ 26, 524, 21, 530, 26, 530, 21, 533,
+ 26, 533, 21, 504, 26, 504, 21, 524,
+ 26, 524, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 592, 26, 592, 21, 596, 26,
+ 596, 21, 592, 26, 592, 39, 39, 39,
+ 40, 60, 42, 43, 61, 45, 46, 40,
+ 60, 42, 43, 61, 45, 46, 39, 39,
+ 39, 39, 39, 39, 21, 613, 26, 613,
+ 21, 617, 26, 617, 21, 620, 26, 620,
+ 21, 613, 26, 613, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 635, 26, 635, 21,
+ 2446, 26, 2446, 21, 643, 26, 643, 21,
+ 635, 26, 635, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 660, 26, 660, 21, 2447,
+ 26, 2447, 21, 668, 26, 668, 21, 677,
+ 26, 677, 21, 688, 26, 688, 21, 697,
+ 26, 697, 21, 703, 26, 703, 21, 706,
+ 26, 706, 21, 677, 26, 677, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 697, 26,
+ 697, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 763, 26, 763, 21, 767, 26, 767,
+ 21, 763, 26, 763, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 784, 26, 784, 21,
+ 788, 26, 788, 21, 791, 26, 791, 21,
+ 784, 26, 784, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 806, 26, 806, 21, 2448,
+ 26, 2448, 21, 814, 26, 814, 21, 806,
+ 26, 806, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 831, 26, 831, 21, 2449, 26,
+ 2449, 21, 839, 26, 839, 21, 831, 26,
+ 831, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 853, 26, 853, 21, 857, 26, 857,
+ 21, 860, 26, 860, 21, 868, 204, 868,
+ 202, 200, 879, 204, 879, 202, 200, 888,
+ 204, 888, 202, 200, 893, 204, 893, 202,
+ 200, 896, 204, 896, 202, 200, 868, 204,
+ 868, 911, 202, 911, 911, 912, 913, 914,
+ 915, 916, 917, 918, 912, 913, 914, 915,
+ 916, 917, 918, 911, 911, 911, 911, 911,
+ 911, 200, 909, 204, 909, 202, 200, 920,
+ 204, 920, 202, 200, 909, 204, 909, 911,
+ 202, 911, 911, 912, 913, 914, 915, 916,
+ 917, 918, 912, 913, 914, 915, 916, 917,
+ 918, 911, 911, 911, 911, 911, 911, 200,
+ 928, 204, 928, 202, 200, 931, 204, 931,
+ 202, 200, 937, 204, 937, 202, 200, 937,
+ 204, 937, 911, 202, 911, 911, 912, 913,
+ 914, 915, 916, 917, 918, 912, 913, 914,
+ 915, 916, 917, 918, 911, 911, 911, 911,
+ 911, 911, 200, 949, 204, 949, 202, 200,
+ 2450, 204, 2450, 202, 200, 957, 204, 957,
+ 202, 200, 949, 204, 949, 911, 202, 911,
+ 911, 912, 913, 914, 915, 916, 917, 918,
+ 912, 913, 914, 915, 916, 917, 918, 911,
+ 911, 911, 911, 911, 911, 200, 1006, 204,
+ 1006, 202, 200, 2451, 204, 2451, 202, 200,
+ 1014, 204, 1014, 202, 200, 1019, 26, 1019,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 1006, 204, 1006, 911, 202, 911, 911, 912,
+ 913, 914, 915, 916, 917, 918, 912, 913,
+ 914, 915, 916, 917, 918, 911, 911, 911,
+ 911, 911, 911, 200, 1030, 204, 1030, 202,
+ 200, 1033, 204, 1033, 202, 200, 1030, 204,
+ 1030, 911, 202, 911, 911, 912, 913, 914,
+ 915, 916, 917, 918, 912, 913, 914, 915,
+ 916, 917, 918, 911, 911, 911, 911, 911,
+ 911, 200, 1045, 204, 1045, 202, 200, 2452,
+ 204, 2452, 202, 200, 1053, 204, 1053, 202,
+ 200, 1059, 26, 1059, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 1062, 26, 1062, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 1073,
+ 26, 1073, 21, 1082, 26, 1082, 21, 1088,
+ 26, 1088, 21, 1091, 26, 1091, 21, 1062,
+ 26, 1062, 21, 1082, 26, 1082, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 1150, 26,
+ 1150, 21, 1154, 26, 1154, 21, 1150, 26,
+ 1150, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 1171, 26, 1171, 21, 1175, 26, 1175,
+ 21, 1178, 26, 1178, 21, 1171, 26, 1171,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 1193, 26, 1193, 21, 2453, 26, 2453, 21,
+ 1201, 26, 1201, 21, 1193, 26, 1193, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 1218,
+ 26, 1218, 21, 2454, 26, 2454, 21, 1226,
+ 26, 1226, 21, 1218, 26, 1218, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 1240, 26,
+ 1240, 21, 1244, 26, 1244, 21, 1247, 26,
+ 1247, 21, 1240, 26, 1240, 39, 39, 39,
+ 40, 60, 42, 43, 61, 45, 46, 40,
+ 60, 42, 43, 61, 45, 46, 39, 39,
+ 39, 39, 39, 39, 21, 1262, 26, 1262,
+ 21, 2455, 26, 2455, 21, 1270, 26, 1270,
+ 21, 1262, 26, 1262, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 1286, 26, 1286, 21,
+ 1291, 26, 1291, 21, 1286, 26, 1286, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 1045,
+ 204, 1045, 911, 202, 911, 911, 912, 913,
+ 914, 915, 916, 917, 918, 912, 913, 914,
+ 915, 916, 917, 918, 911, 911, 911, 911,
+ 911, 911, 200, 1312, 204, 1312, 202, 200,
+ 1317, 204, 1317, 202, 200, 1312, 204, 1312,
+ 911, 202, 911, 911, 912, 913, 914, 915,
+ 916, 917, 918, 912, 913, 914, 915, 916,
+ 917, 918, 911, 911, 911, 911, 911, 911,
+ 200, 1337, 204, 1337, 202, 200, 1341, 204,
+ 1341, 202, 200, 1344, 204, 1344, 202, 200,
+ 1351, 398, 1351, 449, 396, 449, 449, 450,
+ 451, 452, 453, 454, 455, 456, 450, 451,
+ 452, 453, 454, 455, 456, 449, 449, 449,
+ 449, 449, 449, 394, 1364, 398, 1364, 396,
+ 394, 2456, 398, 2456, 396, 394, 1372, 398,
+ 1372, 396, 394, 1364, 398, 1364, 449, 396,
+ 449, 449, 450, 451, 452, 453, 454, 455,
+ 456, 450, 451, 452, 453, 454, 455, 456,
+ 449, 449, 449, 449, 449, 449, 394, 1418,
+ 398, 1418, 396, 394, 1422, 398, 1422, 396,
+ 394, 1425, 398, 1425, 396, 394, 1432, 204,
+ 1432, 911, 202, 911, 911, 912, 913, 914,
+ 915, 916, 917, 918, 912, 913, 914, 915,
+ 916, 917, 918, 911, 911, 911, 911, 911,
+ 911, 200, 1418, 398, 1418, 449, 396, 449,
+ 449, 450, 451, 452, 453, 454, 455, 456,
+ 450, 451, 452, 453, 454, 455, 456, 449,
+ 449, 449, 449, 449, 449, 394, 1445, 398,
+ 1445, 396, 394, 2457, 398, 2457, 396, 394,
+ 1453, 398, 1453, 396, 394, 1445, 398, 1445,
+ 449, 396, 449, 449, 450, 451, 452, 453,
+ 454, 455, 456, 450, 451, 452, 453, 454,
+ 455, 456, 449, 449, 449, 449, 449, 449,
+ 394, 1466, 398, 1466, 396, 394, 1471, 398,
+ 1471, 396, 394, 1466, 398, 1466, 449, 396,
+ 449, 449, 450, 451, 452, 453, 454, 455,
+ 456, 450, 451, 452, 453, 454, 455, 456,
+ 449, 449, 449, 449, 449, 449, 394, 1337,
+ 204, 1337, 911, 202, 911, 911, 912, 913,
+ 914, 915, 916, 917, 918, 912, 913, 914,
+ 915, 916, 917, 918, 911, 911, 911, 911,
+ 911, 911, 200, 1495, 204, 1495, 202, 200,
+ 1499, 204, 1499, 202, 200, 1495, 204, 1495,
+ 911, 202, 911, 911, 912, 913, 914, 915,
+ 916, 917, 918, 912, 913, 914, 915, 916,
+ 917, 918, 911, 911, 911, 911, 911, 911,
+ 200, 888, 204, 888, 911, 202, 911, 911,
+ 912, 913, 914, 915, 916, 917, 918, 912,
+ 913, 914, 915, 916, 917, 918, 911, 911,
+ 911, 911, 911, 911, 200, 1555, 204, 1555,
+ 202, 200, 1559, 204, 1559, 202, 200, 1555,
+ 204, 1555, 911, 202, 911, 911, 912, 913,
+ 914, 915, 916, 917, 918, 912, 913, 914,
+ 915, 916, 917, 918, 911, 911, 911, 911,
+ 911, 911, 200, 1576, 204, 1576, 202, 200,
+ 1579, 204, 1579, 202, 200, 1582, 204, 1582,
+ 202, 200, 1576, 204, 1576, 911, 202, 911,
+ 911, 912, 913, 914, 915, 916, 917, 918,
+ 912, 913, 914, 915, 916, 917, 918, 911,
+ 911, 911, 911, 911, 911, 200, 1594, 204,
+ 1594, 202, 200, 2458, 204, 2458, 202, 200,
+ 1601, 204, 1601, 202, 200, 1594, 204, 1594,
+ 911, 202, 911, 911, 912, 913, 914, 915,
+ 916, 917, 918, 912, 913, 914, 915, 916,
+ 917, 918, 911, 911, 911, 911, 911, 911,
+ 200, 1614, 204, 1614, 202, 200, 2459, 204,
+ 2459, 202, 200, 1621, 204, 1621, 202, 200,
+ 1614, 204, 1614, 911, 202, 911, 911, 912,
+ 913, 914, 915, 916, 917, 918, 912, 913,
+ 914, 915, 916, 917, 918, 911, 911, 911,
+ 911, 911, 911, 200, 1631, 204, 1631, 202,
+ 200, 1634, 204, 1634, 202, 200, 1631, 204,
+ 1631, 911, 202, 911, 911, 912, 913, 914,
+ 915, 916, 917, 918, 912, 913, 914, 915,
+ 916, 917, 918, 911, 911, 911, 911, 911,
+ 911, 200, 1646, 204, 1646, 202, 200, 2460,
+ 204, 2460, 202, 200, 1653, 204, 1653, 202,
+ 200, 1646, 204, 1646, 911, 202, 911, 911,
+ 912, 913, 914, 915, 916, 917, 918, 912,
+ 913, 914, 915, 916, 917, 918, 911, 911,
+ 911, 911, 911, 911, 200, 1665, 204, 1665,
+ 202, 200, 1670, 204, 1670, 202, 200, 1665,
+ 204, 1665, 911, 202, 911, 911, 912, 913,
+ 914, 915, 916, 917, 918, 912, 913, 914,
+ 915, 916, 917, 918, 911, 911, 911, 911,
+ 911, 911, 200, 853, 26, 853, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 1691, 26,
+ 1691, 21, 2461, 26, 2461, 21, 1699, 26,
+ 1699, 21, 1691, 26, 1691, 39, 39, 39,
+ 40, 60, 42, 43, 61, 45, 46, 40,
+ 60, 42, 43, 61, 45, 46, 39, 39,
+ 39, 39, 39, 39, 21, 1715, 26, 1715,
+ 21, 1720, 26, 1720, 21, 1715, 26, 1715,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 660, 26, 660, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 1739, 26, 1739, 21, 1743,
+ 26, 1743, 21, 1746, 26, 1746, 21, 1739,
+ 26, 1739, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 1761, 26, 1761, 21, 2462, 26,
+ 2462, 21, 1769, 26, 1769, 21, 1761, 26,
+ 1761, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 1785, 26, 1785, 21, 1790, 26, 1790,
+ 21, 1785, 26, 1785, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 487, 398, 487, 449,
+ 396, 449, 449, 450, 451, 452, 453, 454,
+ 455, 456, 450, 451, 452, 453, 454, 455,
+ 456, 449, 449, 449, 449, 449, 449, 394,
+ 1811, 398, 1811, 396, 394, 1814, 398, 1814,
+ 396, 394, 1811, 398, 1811, 449, 396, 449,
+ 449, 450, 451, 452, 453, 454, 455, 456,
+ 450, 451, 452, 453, 454, 455, 456, 449,
+ 449, 449, 449, 449, 449, 394, 1829, 398,
+ 1829, 396, 394, 1833, 398, 1833, 396, 394,
+ 1829, 398, 1829, 449, 396, 449, 449, 450,
+ 451, 452, 453, 454, 455, 456, 450, 451,
+ 452, 453, 454, 455, 456, 449, 449, 449,
+ 449, 449, 449, 394, 426, 398, 426, 449,
+ 396, 449, 449, 450, 451, 452, 453, 454,
+ 455, 456, 450, 451, 452, 453, 454, 455,
+ 456, 449, 449, 449, 449, 449, 449, 394,
+ 1889, 398, 1889, 396, 394, 1893, 398, 1893,
+ 396, 394, 1889, 398, 1889, 449, 396, 449,
+ 449, 450, 451, 452, 453, 454, 455, 456,
+ 450, 451, 452, 453, 454, 455, 456, 449,
+ 449, 449, 449, 449, 449, 394, 1910, 398,
+ 1910, 396, 394, 1913, 398, 1913, 396, 394,
+ 1910, 398, 1910, 449, 396, 449, 449, 450,
+ 451, 452, 453, 454, 455, 456, 450, 451,
+ 452, 453, 454, 455, 456, 449, 449, 449,
+ 449, 449, 449, 394, 1925, 398, 1925, 396,
+ 394, 2463, 398, 2463, 396, 394, 1932, 398,
+ 1932, 396, 394, 1925, 398, 1925, 449, 396,
+ 449, 449, 450, 451, 452, 453, 454, 455,
+ 456, 450, 451, 452, 453, 454, 455, 456,
+ 449, 449, 449, 449, 449, 449, 394, 1945,
+ 398, 1945, 396, 394, 2464, 398, 2464, 396,
+ 394, 1952, 398, 1952, 396, 394, 1945, 398,
+ 1945, 449, 396, 449, 449, 450, 451, 452,
+ 453, 454, 455, 456, 450, 451, 452, 453,
+ 454, 455, 456, 449, 449, 449, 449, 449,
+ 449, 394, 1962, 398, 1962, 396, 394, 1965,
+ 398, 1965, 396, 394, 1968, 398, 1968, 396,
+ 394, 1962, 398, 1962, 449, 396, 449, 449,
+ 450, 451, 452, 453, 454, 455, 456, 450,
+ 451, 452, 453, 454, 455, 456, 449, 449,
+ 449, 449, 449, 449, 394, 1980, 398, 1980,
+ 396, 394, 2465, 398, 2465, 396, 394, 1987,
+ 398, 1987, 396, 394, 1980, 398, 1980, 449,
+ 396, 449, 449, 450, 451, 452, 453, 454,
+ 455, 456, 450, 451, 452, 453, 454, 455,
+ 456, 449, 449, 449, 449, 449, 449, 394,
+ 1999, 398, 1999, 396, 394, 2004, 398, 2004,
+ 396, 394, 1999, 398, 1999, 449, 396, 449,
+ 449, 450, 451, 452, 453, 454, 455, 456,
+ 450, 451, 452, 453, 454, 455, 456, 449,
+ 449, 449, 449, 449, 449, 394, 378, 26,
+ 378, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 2025, 26, 2025, 21, 2466, 26, 2466,
+ 21, 2033, 26, 2033, 21, 2025, 26, 2025,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 2046, 26, 2046, 21, 2467, 26, 2467, 21,
+ 2054, 26, 2054, 21, 2046, 26, 2046, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 2064,
+ 26, 2064, 21, 2068, 26, 2068, 21, 2071,
+ 26, 2071, 21, 2064, 26, 2064, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 2086, 26,
+ 2086, 21, 2468, 26, 2468, 21, 2094, 26,
+ 2094, 21, 2086, 26, 2086, 39, 39, 39,
+ 40, 60, 42, 43, 61, 45, 46, 40,
+ 60, 42, 43, 61, 45, 46, 39, 39,
+ 39, 39, 39, 39, 21, 2106, 26, 2106,
+ 21, 2111, 26, 2111, 21, 2106, 26, 2106,
+ 39, 39, 39, 40, 60, 42, 43, 61,
+ 45, 46, 40, 60, 42, 43, 61, 45,
+ 46, 39, 39, 39, 39, 39, 39, 21,
+ 186, 26, 186, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 2132, 26, 2132, 21, 2136,
+ 26, 2136, 21, 2139, 26, 2139, 21, 2132,
+ 26, 2132, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 2155, 26, 2155, 21, 2159, 26,
+ 2159, 21, 2155, 26, 2155, 39, 39, 39,
+ 40, 60, 42, 43, 61, 45, 46, 40,
+ 60, 42, 43, 61, 45, 46, 39, 39,
+ 39, 39, 39, 39, 21, 2176, 26, 2176,
+ 21, 2180, 26, 2180, 21, 2183, 26, 2183,
+ 21, 2187, 398, 2187, 396, 394, 2196, 26,
+ 2196, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 2199, 26, 2199, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 2210, 26, 2210, 21,
+ 2219, 26, 2219, 21, 2224, 26, 2224, 21,
+ 2199, 26, 2199, 21, 2219, 26, 2219, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 2280,
+ 26, 2280, 21, 2284, 26, 2284, 21, 2280,
+ 26, 2280, 39, 39, 39, 40, 60, 42,
+ 43, 61, 45, 46, 40, 60, 42, 43,
+ 61, 45, 46, 39, 39, 39, 39, 39,
+ 39, 21, 2301, 26, 2301, 21, 2305, 26,
+ 2305, 21, 2308, 26, 2308, 21, 2301, 26,
+ 2301, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 2323, 26, 2323, 21, 2469, 26, 2469,
+ 21, 2323, 26, 2323, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 2340, 26, 2340, 21,
+ 2470, 26, 2470, 21, 2340, 26, 2340, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 2354,
+ 26, 2354, 21, 2358, 26, 2358, 21, 2361,
+ 26, 2361, 21, 2354, 26, 2354, 39, 39,
+ 39, 40, 60, 42, 43, 61, 45, 46,
+ 40, 60, 42, 43, 61, 45, 46, 39,
+ 39, 39, 39, 39, 39, 21, 2376, 26,
+ 2376, 21, 2471, 26, 2471, 21, 2376, 26,
+ 2376, 39, 39, 39, 40, 60, 42, 43,
+ 61, 45, 46, 40, 60, 42, 43, 61,
+ 45, 46, 39, 39, 39, 39, 39, 39,
+ 21, 2392, 26, 2392, 21, 2397, 26, 2397,
+ 21, 2392, 26, 2392, 39, 39, 39, 40,
+ 60, 42, 43, 61, 45, 46, 40, 60,
+ 42, 43, 61, 45, 46, 39, 39, 39,
+ 39, 39, 39, 21, 2176, 26, 2176, 39,
+ 39, 39, 40, 60, 42, 43, 61, 45,
+ 46, 40, 60, 42, 43, 61, 45, 46,
+ 39, 39, 39, 39, 39, 39, 21, 2416,
+ 26, 2416, 21, 2420, 26, 2420, 21, 2423,
+ 26, 2423, 21, 2427, 204, 2427, 202, 200,
+ 2416, 26, 2416, 39, 39, 39, 40, 60,
+ 42, 43, 61, 45, 46, 40, 60, 42,
+ 43, 61, 45, 46, 39, 39, 39, 39,
+ 39, 39, 21, 0
+ };
+
+ static const short _thttp_machine_parser_header_WWW_Authenticate_trans_targs[] = {
+ 2, 0, 1736, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 23, 1734,
+ 26, 1728, 22, 1738, 24, 1739, 25, 27,
+ 28, 29, 30, 31, 32, 31, 32, 34,
+ 41, 1536, 56, 110, 1712, 147, 165, 1740,
+ 33, 35, 42, 34, 38, 44, 35, 36,
+ 38, 1741, 37, 39, 43, 129, 1742, 40,
+ 1520, 1743, 1505, 45, 73, 49, 74, 1744,
+ 46, 47, 1745, 48, 50, 51, 206, 1746,
+ 52, 55, 52, 53, 1747, 54, 1748, 57,
+ 58, 59, 60, 61, 109, 64, 61, 62,
+ 1749, 63, 64, 65, 69, 1750, 66, 67,
+ 1751, 68, 69, 70, 71, 72, 1752, 52,
+ 55, 38, 75, 108, 76, 79, 77, 78,
+ 80, 95, 81, 93, 82, 83, 91, 84,
+ 85, 89, 86, 87, 88, 90, 92, 94,
+ 96, 104, 97, 100, 98, 99, 101, 102,
+ 103, 105, 106, 107, 1753, 111, 112, 113,
+ 114, 115, 116, 128, 119, 116, 117, 1754,
+ 118, 119, 120, 124, 1755, 121, 122, 1756,
+ 123, 124, 125, 126, 127, 1757, 52, 55,
+ 38, 1758, 130, 131, 132, 1504, 135, 132,
+ 133, 1759, 134, 136, 140, 1760, 137, 138,
+ 1761, 139, 141, 142, 184, 144, 185, 141,
+ 142, 184, 144, 185, 143, 1762, 144, 145,
+ 1763, 146, 55, 148, 149, 150, 151, 152,
+ 164, 155, 152, 153, 1764, 154, 155, 156,
+ 160, 1765, 157, 158, 1766, 159, 160, 161,
+ 162, 163, 1767, 52, 55, 38, 1768, 166,
+ 167, 168, 169, 170, 183, 173, 170, 171,
+ 1769, 172, 174, 176, 181, 1770, 175, 177,
+ 178, 179, 180, 52, 55, 38, 182, 1771,
+ 1772, 186, 186, 187, 191, 1773, 188, 189,
+ 1774, 190, 192, 194, 244, 261, 1429, 1443,
+ 1458, 1471, 1485, 1775, 193, 195, 243, 194,
+ 191, 198, 195, 196, 1776, 197, 199, 207,
+ 203, 208, 1777, 200, 201, 1778, 202, 204,
+ 189, 204, 205, 1779, 209, 242, 210, 213,
+ 211, 212, 214, 229, 215, 227, 216, 217,
+ 225, 218, 219, 223, 220, 221, 222, 224,
+ 226, 228, 230, 238, 231, 234, 232, 233,
+ 235, 236, 237, 239, 240, 241, 1780, 245,
+ 246, 247, 248, 249, 250, 251, 252, 253,
+ 260, 256, 253, 254, 1781, 255, 257, 259,
+ 1782, 258, 204, 189, 259, 191, 1783, 262,
+ 263, 264, 265, 266, 267, 1428, 270, 267,
+ 268, 1784, 269, 271, 275, 1785, 272, 273,
+ 1786, 274, 276, 277, 281, 297, 144, 284,
+ 280, 276, 277, 279, 144, 280, 278, 1787,
+ 1788, 186, 281, 282, 284, 1789, 283, 285,
+ 287, 1324, 1341, 1354, 1368, 1383, 1395, 1409,
+ 1790, 286, 288, 1323, 287, 284, 291, 288,
+ 289, 1791, 290, 292, 296, 1287, 1792, 293,
+ 294, 1793, 295, 281, 297, 1794, 299, 306,
+ 298, 302, 308, 299, 300, 302, 1795, 301,
+ 303, 298, 305, 307, 318, 917, 968, 984,
+ 998, 1796, 304, 1271, 1797, 1259, 309, 313,
+ 931, 1798, 310, 311, 1799, 312, 314, 317,
+ 314, 315, 1800, 316, 1801, 319, 320, 321,
+ 322, 323, 1258, 326, 323, 324, 1802, 325,
+ 326, 327, 331, 1803, 328, 329, 1804, 330,
+ 331, 331, 332, 336, 1805, 333, 334, 1806,
+ 335, 337, 339, 389, 406, 422, 437, 1211,
+ 1224, 1239, 1807, 338, 340, 388, 339, 336,
+ 343, 340, 341, 1808, 342, 344, 349, 348,
+ 352, 1809, 345, 346, 1810, 347, 204, 189,
+ 191, 350, 334, 350, 351, 1811, 353, 387,
+ 354, 357, 367, 355, 356, 358, 374, 359,
+ 372, 360, 361, 370, 362, 363, 368, 364,
+ 365, 366, 369, 371, 373, 375, 383, 376,
+ 379, 377, 378, 380, 381, 382, 384, 385,
+ 386, 1812, 390, 391, 392, 393, 394, 395,
+ 396, 397, 398, 405, 401, 398, 399, 1813,
+ 400, 402, 404, 1814, 403, 350, 334, 404,
+ 336, 1815, 407, 408, 409, 410, 411, 412,
+ 421, 415, 412, 413, 1816, 414, 416, 420,
+ 1817, 417, 418, 1818, 419, 281, 297, 284,
+ 1819, 423, 424, 425, 426, 427, 436, 430,
+ 427, 428, 1820, 429, 430, 431, 435, 1821,
+ 432, 433, 1822, 434, 435, 350, 334, 336,
+ 1823, 438, 439, 440, 441, 442, 443, 1210,
+ 446, 443, 444, 1824, 445, 446, 447, 451,
+ 1825, 448, 449, 1826, 450, 451, 452, 469,
+ 455, 452, 453, 455, 1827, 454, 456, 458,
+ 507, 524, 540, 555, 571, 1176, 1191, 1828,
+ 457, 459, 506, 458, 455, 462, 459, 460,
+ 1829, 461, 463, 468, 467, 470, 1830, 464,
+ 465, 1831, 466, 204, 189, 191, 452, 469,
+ 1832, 471, 505, 472, 475, 485, 473, 474,
+ 476, 492, 477, 490, 478, 479, 488, 480,
+ 481, 486, 482, 483, 484, 487, 489, 491,
+ 493, 501, 494, 497, 495, 496, 498, 499,
+ 500, 502, 503, 504, 1833, 508, 509, 510,
+ 511, 512, 513, 514, 515, 516, 523, 519,
+ 516, 517, 1834, 518, 520, 522, 1835, 521,
+ 452, 469, 522, 455, 1836, 525, 526, 527,
+ 528, 529, 530, 539, 533, 530, 531, 1837,
+ 532, 534, 538, 1838, 535, 536, 1839, 537,
+ 281, 297, 284, 1840, 541, 542, 543, 544,
+ 545, 554, 548, 545, 546, 1841, 547, 548,
+ 549, 553, 1842, 550, 551, 1843, 552, 553,
+ 350, 334, 336, 1844, 556, 557, 558, 559,
+ 560, 561, 570, 564, 561, 562, 1845, 563,
+ 564, 565, 569, 1846, 566, 567, 1847, 568,
+ 569, 452, 469, 455, 1848, 572, 573, 574,
+ 1175, 577, 574, 575, 1849, 576, 578, 582,
+ 1850, 579, 580, 1851, 581, 583, 599, 586,
+ 583, 584, 586, 1852, 585, 587, 589, 1071,
+ 1088, 1103, 1117, 1132, 1142, 1156, 1853, 588,
+ 590, 1070, 589, 586, 593, 590, 591, 1854,
+ 592, 594, 598, 1034, 1855, 595, 596, 1856,
+ 597, 583, 599, 1857, 601, 608, 600, 604,
+ 610, 601, 602, 604, 1858, 603, 605, 600,
+ 607, 609, 620, 670, 688, 698, 881, 1859,
+ 606, 1018, 1860, 900, 611, 615, 633, 1861,
+ 612, 613, 1862, 614, 616, 619, 616, 617,
+ 1863, 618, 1864, 621, 622, 623, 624, 625,
+ 669, 628, 625, 626, 1865, 627, 628, 629,
+ 331, 1866, 630, 631, 1867, 632, 331, 634,
+ 668, 635, 638, 648, 636, 637, 639, 655,
+ 640, 653, 641, 642, 651, 643, 644, 649,
+ 645, 646, 647, 650, 652, 654, 656, 664,
+ 657, 660, 658, 659, 661, 662, 663, 665,
+ 666, 667, 1868, 671, 672, 673, 674, 675,
+ 676, 687, 679, 676, 677, 1869, 678, 679,
+ 680, 684, 1870, 681, 682, 1871, 683, 684,
+ 684, 685, 1872, 686, 469, 1873, 689, 690,
+ 691, 697, 694, 691, 692, 1874, 693, 695,
+ 1875, 696, 1876, 699, 700, 701, 702, 703,
+ 880, 706, 703, 704, 1877, 705, 706, 707,
+ 711, 1878, 708, 709, 1879, 710, 711, 711,
+ 712, 716, 1880, 713, 714, 1881, 715, 717,
+ 719, 769, 786, 802, 817, 833, 846, 861,
+ 1882, 718, 720, 768, 719, 716, 723, 720,
+ 721, 1883, 722, 724, 729, 728, 732, 1884,
+ 725, 726, 1885, 727, 204, 189, 191, 730,
+ 714, 730, 731, 1886, 733, 767, 734, 737,
+ 747, 735, 736, 738, 754, 739, 752, 740,
+ 741, 750, 742, 743, 748, 744, 745, 746,
+ 749, 751, 753, 755, 763, 756, 759, 757,
+ 758, 760, 761, 762, 764, 765, 766, 1887,
+ 770, 771, 772, 773, 774, 775, 776, 777,
+ 778, 785, 781, 778, 779, 1888, 780, 782,
+ 784, 1889, 783, 730, 714, 784, 716, 1890,
+ 787, 788, 789, 790, 791, 792, 801, 795,
+ 792, 793, 1891, 794, 796, 800, 1892, 797,
+ 798, 1893, 799, 281, 297, 284, 1894, 803,
+ 804, 805, 806, 807, 816, 810, 807, 808,
+ 1895, 809, 810, 811, 815, 1896, 812, 813,
+ 1897, 814, 815, 350, 334, 336, 1898, 818,
+ 819, 820, 821, 822, 823, 832, 826, 823,
+ 824, 1899, 825, 826, 827, 831, 1900, 828,
+ 829, 1901, 830, 831, 452, 469, 455, 1902,
+ 834, 835, 836, 845, 839, 836, 837, 1903,
+ 838, 840, 844, 1904, 841, 842, 1905, 843,
+ 583, 599, 586, 1906, 847, 848, 849, 850,
+ 851, 860, 854, 851, 852, 1907, 853, 854,
+ 855, 859, 1908, 856, 857, 1909, 858, 859,
+ 730, 714, 716, 1910, 862, 863, 864, 865,
+ 866, 879, 869, 866, 867, 1911, 868, 870,
+ 872, 877, 1912, 871, 873, 874, 875, 876,
+ 730, 714, 716, 878, 1913, 1914, 882, 883,
+ 884, 885, 886, 899, 889, 886, 887, 1915,
+ 888, 890, 892, 897, 1916, 891, 893, 894,
+ 895, 896, 616, 619, 604, 898, 1917, 901,
+ 902, 903, 904, 905, 1017, 908, 905, 906,
+ 1918, 907, 909, 913, 1919, 910, 911, 1920,
+ 912, 914, 915, 284, 914, 915, 1921, 916,
+ 297, 918, 919, 920, 921, 922, 923, 967,
+ 926, 923, 924, 1922, 925, 926, 927, 684,
+ 1923, 928, 929, 1924, 930, 684, 932, 966,
+ 933, 936, 946, 934, 935, 937, 953, 938,
+ 951, 939, 940, 949, 941, 942, 947, 943,
+ 944, 945, 948, 950, 952, 954, 962, 955,
+ 958, 956, 957, 959, 960, 961, 963, 964,
+ 965, 1925, 969, 970, 971, 983, 974, 971,
+ 972, 1926, 973, 975, 979, 1927, 976, 977,
+ 1928, 978, 980, 981, 586, 980, 981, 1929,
+ 982, 599, 1930, 985, 986, 987, 988, 989,
+ 997, 992, 989, 990, 1931, 991, 992, 993,
+ 711, 1932, 994, 995, 1933, 996, 711, 1934,
+ 999, 1000, 1001, 1002, 1003, 1016, 1006, 1003,
+ 1004, 1935, 1005, 1007, 1009, 1014, 1936, 1008,
+ 1010, 1011, 1012, 1013, 314, 317, 302, 1015,
+ 1937, 1938, 1019, 1020, 1021, 1022, 1023, 1024,
+ 1025, 1026, 1033, 1029, 1026, 1027, 1939, 1028,
+ 1030, 1032, 1940, 1031, 616, 619, 1032, 604,
+ 1941, 1035, 1069, 1036, 1039, 1049, 1037, 1038,
+ 1040, 1056, 1041, 1054, 1042, 1043, 1052, 1044,
+ 1045, 1050, 1046, 1047, 1048, 1051, 1053, 1055,
+ 1057, 1065, 1058, 1061, 1059, 1060, 1062, 1063,
+ 1064, 1066, 1067, 1068, 1942, 1072, 1073, 1074,
+ 1075, 1076, 1077, 1078, 1079, 1080, 1087, 1083,
+ 1080, 1081, 1943, 1082, 1084, 1086, 1944, 1085,
+ 583, 599, 1086, 586, 1945, 1089, 1090, 1091,
+ 1092, 1093, 1094, 1102, 1097, 1094, 1095, 1946,
+ 1096, 1098, 1947, 1099, 1100, 1948, 1101, 1949,
+ 1104, 1105, 1106, 1107, 1108, 1116, 1111, 1108,
+ 1109, 1950, 1110, 1111, 1112, 1951, 1113, 1114,
+ 1952, 1115, 1953, 1118, 1119, 1120, 1121, 1122,
+ 1123, 1131, 1126, 1123, 1124, 1954, 1125, 1126,
+ 1127, 1955, 1128, 1129, 1956, 1130, 1957, 1133,
+ 1134, 1135, 1141, 1138, 1135, 1136, 1958, 1137,
+ 1139, 1959, 1140, 1960, 1143, 1144, 1145, 1146,
+ 1147, 1155, 1150, 1147, 1148, 1961, 1149, 1150,
+ 1151, 1962, 1152, 1153, 1963, 1154, 1964, 1157,
+ 1158, 1159, 1160, 1161, 1174, 1164, 1161, 1162,
+ 1965, 1163, 1165, 1167, 1172, 1966, 1166, 1168,
+ 1169, 1170, 1171, 583, 599, 586, 1173, 1967,
+ 1968, 1177, 1178, 1179, 1180, 1181, 1190, 1184,
+ 1181, 1182, 1969, 1183, 1184, 1185, 1189, 1970,
+ 1186, 1187, 1971, 1188, 1189, 730, 714, 716,
+ 1972, 1192, 1193, 1194, 1195, 1196, 1209, 1199,
+ 1196, 1197, 1973, 1198, 1200, 1202, 1207, 1974,
+ 1201, 1203, 1204, 1205, 1206, 452, 469, 455,
+ 1208, 1975, 1976, 1212, 1213, 1214, 1223, 1217,
+ 1214, 1215, 1977, 1216, 1218, 1222, 1978, 1219,
+ 1220, 1979, 1221, 583, 599, 586, 1980, 1225,
+ 1226, 1227, 1228, 1229, 1238, 1232, 1229, 1230,
+ 1981, 1231, 1232, 1233, 1237, 1982, 1234, 1235,
+ 1983, 1236, 1237, 730, 714, 716, 1984, 1240,
+ 1241, 1242, 1243, 1244, 1257, 1247, 1244, 1245,
+ 1985, 1246, 1248, 1250, 1255, 1986, 1249, 1251,
+ 1252, 1253, 1254, 350, 334, 336, 1256, 1987,
+ 1988, 1260, 1261, 1262, 1263, 1264, 1270, 1267,
+ 1264, 1265, 1989, 1266, 1268, 1990, 1269, 1991,
+ 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279,
+ 1286, 1282, 1279, 1280, 1992, 1281, 1283, 1285,
+ 1993, 1284, 314, 317, 1285, 302, 1994, 1288,
+ 1322, 1289, 1292, 1302, 1290, 1291, 1293, 1309,
+ 1294, 1307, 1295, 1296, 1305, 1297, 1298, 1303,
+ 1299, 1300, 1301, 1304, 1306, 1308, 1310, 1318,
+ 1311, 1314, 1312, 1313, 1315, 1316, 1317, 1319,
+ 1320, 1321, 1995, 1325, 1326, 1327, 1328, 1329,
+ 1330, 1331, 1332, 1333, 1340, 1336, 1333, 1334,
+ 1996, 1335, 1337, 1339, 1997, 1338, 281, 297,
+ 1339, 284, 1998, 1342, 1343, 1344, 1345, 1346,
+ 1347, 1353, 1350, 1347, 1348, 1999, 1349, 1351,
+ 2000, 1352, 2001, 1355, 1356, 1357, 1358, 1359,
+ 1367, 1362, 1359, 1360, 2002, 1361, 1362, 1363,
+ 2003, 1364, 1365, 2004, 1366, 2005, 1369, 1370,
+ 1371, 1372, 1373, 1374, 1382, 1377, 1374, 1375,
+ 2006, 1376, 1377, 1378, 2007, 1379, 1380, 2008,
+ 1381, 2009, 1384, 1385, 1386, 1394, 1389, 1386,
+ 1387, 2010, 1388, 1390, 2011, 1391, 1392, 2012,
+ 1393, 2013, 1396, 1397, 1398, 1399, 1400, 1408,
+ 1403, 1400, 1401, 2014, 1402, 1403, 1404, 2015,
+ 1405, 1406, 2016, 1407, 2017, 1410, 1411, 1412,
+ 1413, 1414, 1427, 1417, 1414, 1415, 2018, 1416,
+ 1418, 1420, 1425, 2019, 1419, 1421, 1422, 1423,
+ 1424, 281, 297, 284, 1426, 2020, 2021, 1430,
+ 1431, 1432, 1433, 1434, 1442, 1437, 1434, 1435,
+ 2022, 1436, 1437, 1438, 367, 2023, 1439, 1440,
+ 2024, 1441, 2025, 1444, 1445, 1446, 1447, 1448,
+ 1449, 1457, 1452, 1449, 1450, 2026, 1451, 1452,
+ 1453, 485, 2027, 1454, 1455, 2028, 1456, 2029,
+ 1459, 1460, 1461, 1470, 1464, 1461, 1462, 2030,
+ 1463, 1465, 1469, 2031, 1466, 1467, 2032, 1468,
+ 583, 599, 586, 2033, 1472, 1473, 1474, 1475,
+ 1476, 1484, 1479, 1476, 1477, 2034, 1478, 1479,
+ 1480, 747, 2035, 1481, 1482, 2036, 1483, 2037,
+ 1486, 1487, 1488, 1489, 1490, 1503, 1493, 1490,
+ 1491, 2038, 1492, 1494, 1496, 1501, 2039, 1495,
+ 1497, 1498, 1499, 1500, 204, 189, 191, 1502,
+ 2040, 2041, 1506, 1507, 1508, 1509, 1510, 1519,
+ 1513, 1510, 1511, 2042, 1512, 1514, 1518, 2043,
+ 1515, 1516, 2044, 1517, 279, 2045, 1521, 1522,
+ 1523, 1524, 1525, 1526, 1527, 1528, 1535, 1531,
+ 1528, 1529, 2046, 1530, 1532, 1534, 2047, 1533,
+ 52, 55, 1534, 38, 2048, 1537, 1538, 1539,
+ 1540, 1541, 1542, 1711, 1545, 1542, 1543, 2049,
+ 1544, 1546, 1550, 2050, 1547, 1548, 2051, 1549,
+ 1551, 1552, 1553, 1551, 1552, 1553, 2052, 1554,
+ 1554, 1555, 1559, 2053, 1556, 1557, 2054, 1558,
+ 1560, 1562, 1609, 1626, 1642, 1654, 1667, 1680,
+ 1692, 2055, 1561, 1563, 1608, 1562, 1559, 1566,
+ 1563, 1564, 2056, 1565, 1567, 1569, 1572, 2057,
+ 1568, 1570, 1557, 1570, 1571, 2058, 1573, 1607,
+ 1574, 1577, 1587, 1575, 1576, 1578, 1594, 1579,
+ 1592, 1580, 1581, 1590, 1582, 1583, 1588, 1584,
+ 1585, 1586, 1589, 1591, 1593, 1595, 1603, 1596,
+ 1599, 1597, 1598, 1600, 1601, 1602, 1604, 1605,
+ 1606, 2059, 1610, 1611, 1612, 1613, 1614, 1615,
+ 1616, 1617, 1618, 1625, 1621, 1618, 1619, 2060,
+ 1620, 1622, 1624, 2061, 1623, 1570, 1557, 1624,
+ 1559, 2062, 1627, 1628, 1629, 1630, 1631, 1632,
+ 1641, 1635, 1632, 1633, 2063, 1634, 1636, 1640,
+ 2064, 1637, 1638, 2065, 1639, 281, 297, 284,
+ 2066, 1643, 1644, 1645, 1646, 1647, 1653, 1650,
+ 1647, 1648, 2067, 1649, 1650, 1651, 2068, 1652,
+ 2069, 1655, 1656, 1657, 1658, 1659, 1660, 1666,
+ 1663, 1660, 1661, 2070, 1662, 1663, 1664, 2071,
+ 1665, 2072, 1668, 1669, 1670, 1679, 1673, 1670,
+ 1671, 2073, 1672, 1674, 1678, 2074, 1675, 1676,
+ 2075, 1677, 583, 599, 586, 2076, 1681, 1682,
+ 1683, 1684, 1685, 1691, 1688, 1685, 1686, 2077,
+ 1687, 1688, 1689, 2078, 1690, 2079, 1693, 1694,
+ 1695, 1696, 1697, 1710, 1700, 1697, 1698, 2080,
+ 1699, 1701, 1703, 1708, 2081, 1702, 1704, 1705,
+ 1706, 1707, 1570, 1557, 1559, 1709, 2082, 2083,
+ 1713, 1714, 1715, 1727, 1718, 1715, 1716, 2084,
+ 1717, 1719, 1723, 2085, 1720, 1721, 2086, 1722,
+ 1724, 1725, 1726, 1724, 1725, 1726, 2087, 1554,
+ 2088, 1729, 1730, 1731, 1732, 1733, 31, 32,
+ 1735, 1737, 66, 121, 157, 328, 432, 448,
+ 550, 566, 630, 681, 708, 812, 828, 856,
+ 928, 994, 1113, 1128, 1152, 1186, 1234, 1364,
+ 1379, 1405, 1439, 1454, 1481, 1652, 1665, 1690
+ };
+
+ static const char _thttp_machine_parser_header_WWW_Authenticate_trans_actions[] = {
+ 9, 0, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 27, 0, 27, 0, 0,
+ 0, 0, 0, 5, 5, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 27,
+ 0, 25, 25, 0, 25, 0, 0, 0,
+ 0, 27, 0, 0, 1, 1, 27, 0,
+ 0, 27, 0, 0, 0, 0, 0, 27,
+ 0, 0, 27, 0, 0, 0, 0, 27,
+ 25, 25, 0, 0, 27, 0, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 1, 1, 1, 27, 1, 1,
+ 27, 0, 0, 0, 0, 0, 27, 15,
+ 15, 15, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 27, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 1, 1, 1, 27, 1, 1, 27,
+ 0, 0, 0, 0, 0, 27, 17, 17,
+ 17, 27, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 0, 27, 0, 0,
+ 27, 0, 1, 1, 1, 38, 1, 0,
+ 0, 0, 23, 0, 0, 27, 0, 0,
+ 27, 0, 0, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 1, 1,
+ 1, 27, 1, 1, 27, 0, 0, 0,
+ 0, 0, 27, 11, 11, 11, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 0, 1, 1, 27, 0, 0,
+ 0, 0, 0, 19, 19, 19, 0, 27,
+ 27, 23, 0, 0, 0, 27, 0, 0,
+ 27, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 27, 0, 25, 25, 0,
+ 25, 0, 0, 0, 27, 0, 0, 0,
+ 0, 0, 27, 0, 0, 27, 0, 25,
+ 25, 0, 0, 27, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 0, 1,
+ 27, 0, 21, 21, 0, 21, 27, 0,
+ 0, 0, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 0, 27, 0, 0,
+ 27, 0, 1, 1, 41, 41, 29, 41,
+ 1, 0, 0, 0, 13, 0, 0, 27,
+ 27, 13, 0, 0, 0, 27, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 27, 0, 25, 25, 0, 25, 0, 0,
+ 0, 27, 0, 0, 0, 0, 27, 0,
+ 0, 27, 0, 25, 25, 27, 25, 25,
+ 0, 25, 0, 0, 0, 0, 27, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 27, 0, 0, 27, 0, 0, 0,
+ 0, 27, 0, 0, 27, 0, 25, 25,
+ 0, 0, 27, 0, 27, 0, 0, 0,
+ 0, 25, 25, 0, 0, 0, 27, 0,
+ 1, 1, 47, 27, 1, 1, 27, 0,
+ 13, 0, 0, 0, 27, 0, 0, 27,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 27, 0, 25, 25, 0, 25,
+ 0, 0, 0, 27, 0, 0, 0, 0,
+ 0, 27, 0, 0, 27, 0, 15, 15,
+ 15, 25, 25, 0, 0, 27, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 27, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 1, 27, 0, 21, 21, 0,
+ 21, 27, 0, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 0, 0,
+ 27, 0, 0, 27, 0, 32, 32, 32,
+ 27, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 1, 1, 1, 27,
+ 1, 1, 27, 0, 0, 15, 15, 15,
+ 27, 0, 0, 0, 0, 0, 25, 25,
+ 0, 0, 0, 27, 0, 1, 1, 1,
+ 27, 1, 1, 27, 0, 0, 15, 15,
+ 15, 0, 0, 0, 27, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 27,
+ 0, 25, 25, 0, 25, 0, 0, 0,
+ 27, 0, 0, 0, 0, 0, 27, 0,
+ 0, 27, 0, 17, 17, 17, 25, 25,
+ 27, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 27, 0, 0, 0,
+ 0, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 1, 27, 0,
+ 21, 21, 0, 21, 27, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 35, 35, 35, 27, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 1, 27, 1, 1, 27, 0, 0,
+ 17, 17, 17, 27, 0, 0, 0, 0,
+ 0, 25, 25, 0, 0, 0, 27, 0,
+ 1, 1, 1, 27, 1, 1, 27, 0,
+ 0, 17, 17, 17, 27, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 0, 0,
+ 27, 0, 0, 27, 0, 53, 53, 53,
+ 0, 0, 0, 27, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 27, 0,
+ 25, 25, 0, 25, 0, 0, 0, 27,
+ 0, 0, 0, 0, 27, 0, 0, 27,
+ 0, 25, 25, 27, 25, 25, 0, 25,
+ 0, 0, 0, 0, 27, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 27,
+ 0, 0, 27, 0, 0, 0, 0, 27,
+ 0, 0, 27, 0, 25, 25, 0, 0,
+ 27, 0, 27, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 1, 1,
+ 38, 27, 1, 1, 27, 0, 23, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 27, 0, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 38, 27, 1, 1, 27, 0, 23,
+ 0, 0, 27, 0, 0, 27, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 0,
+ 27, 0, 27, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 1, 1,
+ 38, 27, 1, 1, 27, 0, 23, 0,
+ 0, 0, 27, 0, 0, 27, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 27, 0, 25, 25, 0, 25, 0, 0,
+ 0, 27, 0, 0, 0, 0, 0, 27,
+ 0, 0, 27, 0, 11, 11, 11, 25,
+ 25, 0, 0, 27, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 27,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 0,
+ 1, 27, 0, 21, 21, 0, 21, 27,
+ 0, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 0, 27, 0,
+ 0, 27, 0, 44, 44, 44, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 1, 1, 1, 27, 1, 1,
+ 27, 0, 0, 11, 11, 11, 27, 0,
+ 0, 0, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 1, 1, 1, 27, 1,
+ 1, 27, 0, 0, 11, 11, 11, 27,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 44, 44, 44, 27, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 1, 27, 1, 1, 27, 0, 0,
+ 11, 11, 11, 27, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 0,
+ 1, 1, 27, 0, 0, 0, 0, 0,
+ 19, 19, 19, 0, 27, 27, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 1, 1, 27, 0, 0, 0,
+ 0, 0, 19, 19, 19, 0, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 0, 23, 27, 0, 0, 27,
+ 0, 1, 1, 1, 0, 0, 27, 0,
+ 0, 0, 0, 0, 0, 0, 25, 25,
+ 0, 0, 0, 27, 0, 1, 1, 47,
+ 27, 1, 1, 27, 0, 13, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 27, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 13, 27, 0, 0,
+ 27, 0, 1, 1, 1, 0, 0, 27,
+ 0, 0, 27, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 1, 1,
+ 29, 27, 1, 1, 27, 0, 13, 27,
+ 0, 0, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 1, 1, 27, 0,
+ 0, 0, 0, 0, 19, 19, 19, 0,
+ 27, 27, 0, 0, 0, 0, 0, 0,
+ 0, 25, 25, 0, 0, 0, 27, 0,
+ 0, 1, 27, 0, 21, 21, 0, 21,
+ 27, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 27, 0, 0, 0,
+ 0, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 1, 27, 0,
+ 21, 21, 0, 21, 27, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 27, 0, 0, 27, 0, 27,
+ 0, 0, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 1, 1, 27, 1, 1,
+ 27, 0, 27, 0, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 27, 1, 1, 27, 0, 27, 0,
+ 0, 25, 25, 0, 0, 0, 27, 0,
+ 0, 27, 0, 27, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 27, 1, 1, 27, 0, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 0, 1, 1, 27, 0, 0,
+ 0, 0, 0, 19, 19, 19, 0, 27,
+ 27, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 1, 1, 1, 27,
+ 1, 1, 27, 0, 0, 17, 17, 17,
+ 27, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 1, 1, 27,
+ 0, 0, 0, 0, 0, 19, 19, 19,
+ 0, 27, 27, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 0, 27, 0,
+ 0, 27, 0, 50, 50, 50, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 1, 1, 1, 27, 1, 1,
+ 27, 0, 0, 15, 15, 15, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 0, 1, 1, 27, 0, 0,
+ 0, 0, 0, 19, 19, 19, 0, 27,
+ 27, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 27, 0, 27,
+ 0, 0, 0, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 0, 1,
+ 27, 0, 21, 21, 0, 21, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 27, 0, 0, 0, 0, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 0, 1, 27, 0, 21, 21,
+ 0, 21, 27, 0, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 0,
+ 27, 0, 27, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 1, 1,
+ 27, 1, 1, 27, 0, 27, 0, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 1, 1, 27, 1, 1, 27,
+ 0, 27, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 27, 0, 0, 27,
+ 0, 27, 0, 0, 0, 0, 25, 25,
+ 0, 0, 0, 27, 0, 1, 1, 27,
+ 1, 1, 27, 0, 27, 0, 0, 0,
+ 0, 25, 25, 0, 0, 0, 27, 0,
+ 0, 1, 1, 27, 0, 0, 0, 0,
+ 0, 19, 19, 19, 0, 27, 27, 0,
+ 0, 0, 0, 25, 25, 0, 0, 0,
+ 27, 0, 1, 1, 1, 27, 1, 1,
+ 27, 0, 27, 0, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 1, 27, 1, 1, 27, 0, 27,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 41, 41, 41, 27, 0, 0, 0, 0,
+ 25, 25, 0, 0, 0, 27, 0, 1,
+ 1, 1, 27, 1, 1, 27, 0, 27,
+ 0, 0, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 1, 1, 27, 0,
+ 0, 0, 0, 0, 19, 19, 19, 0,
+ 27, 27, 0, 0, 0, 0, 25, 25,
+ 0, 0, 0, 27, 0, 0, 0, 27,
+ 0, 0, 27, 0, 1, 27, 0, 0,
+ 0, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 0, 1, 27, 0,
+ 21, 21, 0, 21, 27, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 1, 1, 1, 0, 0, 0, 27, 13,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 27, 0, 25, 25, 0, 25, 0,
+ 0, 0, 27, 0, 0, 0, 0, 27,
+ 0, 25, 25, 0, 0, 27, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 27, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 1, 27, 0, 21, 21, 0,
+ 21, 27, 0, 0, 0, 0, 0, 25,
+ 25, 0, 0, 0, 27, 0, 0, 0,
+ 27, 0, 0, 27, 0, 56, 56, 56,
+ 27, 0, 0, 0, 0, 25, 25, 0,
+ 0, 0, 27, 0, 1, 1, 27, 1,
+ 27, 0, 0, 0, 0, 0, 25, 25,
+ 0, 0, 0, 27, 0, 1, 1, 27,
+ 1, 27, 0, 0, 25, 25, 0, 0,
+ 0, 27, 0, 0, 0, 27, 0, 0,
+ 27, 0, 56, 56, 56, 27, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 1, 1, 27, 1, 27, 0, 0,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 1, 1, 27, 0, 0, 0,
+ 0, 0, 19, 19, 19, 0, 27, 27,
+ 0, 0, 25, 25, 0, 0, 0, 27,
+ 0, 0, 0, 27, 0, 0, 27, 0,
+ 1, 1, 1, 0, 0, 0, 27, 23,
+ 27, 0, 0, 0, 0, 0, 3, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
-static const int thttp_machine_parser_header_WWW_Authenticate_start = 1;
-static const int thttp_machine_parser_header_WWW_Authenticate_first_final = 1738;
-static const int thttp_machine_parser_header_WWW_Authenticate_error = 0;
+ static const int thttp_machine_parser_header_WWW_Authenticate_start = 1;
+ static const int thttp_machine_parser_header_WWW_Authenticate_first_final = 1738;
+ static const int thttp_machine_parser_header_WWW_Authenticate_error = 0;
-static const int thttp_machine_parser_header_WWW_Authenticate_en_main = 1;
+ static const int thttp_machine_parser_header_WWW_Authenticate_en_main = 1;
-/* #line 189 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_header_WWW_Authenticate_first_final);
- (void)(thttp_machine_parser_header_WWW_Authenticate_error);
- (void)(thttp_machine_parser_header_WWW_Authenticate_en_main);
-
-/* #line 8068 "./src/headers/thttp_header_WWW_Authenticate.c" */
- {
- cs = thttp_machine_parser_header_WWW_Authenticate_start;
- }
+ /* #line 189 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_header_WWW_Authenticate_first_final);
+ (void)(thttp_machine_parser_header_WWW_Authenticate_error);
+ (void)(thttp_machine_parser_header_WWW_Authenticate_en_main);
-/* #line 194 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
-
-/* #line 8075 "./src/headers/thttp_header_WWW_Authenticate.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
+ /* #line 8068 "./src/headers/thttp_header_WWW_Authenticate.c" */
+ {
+ cs = thttp_machine_parser_header_WWW_Authenticate_start;
+ }
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 194 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+
+ /* #line 8075 "./src/headers/thttp_header_WWW_Authenticate.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_header_WWW_Authenticate_trans_keys + _thttp_machine_parser_header_WWW_Authenticate_key_offsets[cs];
- _trans = _thttp_machine_parser_header_WWW_Authenticate_index_offsets[cs];
+ _keys = _thttp_machine_parser_header_WWW_Authenticate_trans_keys + _thttp_machine_parser_header_WWW_Authenticate_key_offsets[cs];
+ _trans = _thttp_machine_parser_header_WWW_Authenticate_index_offsets[cs];
- _klen = _thttp_machine_parser_header_WWW_Authenticate_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _thttp_machine_parser_header_WWW_Authenticate_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _thttp_machine_parser_header_WWW_Authenticate_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _thttp_machine_parser_header_WWW_Authenticate_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_header_WWW_Authenticate_indicies[_trans];
- cs = _thttp_machine_parser_header_WWW_Authenticate_trans_targs[_trans];
+ _trans = _thttp_machine_parser_header_WWW_Authenticate_indicies[_trans];
+ cs = _thttp_machine_parser_header_WWW_Authenticate_trans_targs[_trans];
- if ( _thttp_machine_parser_header_WWW_Authenticate_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _thttp_machine_parser_header_WWW_Authenticate_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _thttp_machine_parser_header_WWW_Authenticate_actions + _thttp_machine_parser_header_WWW_Authenticate_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- hdr_WWW_Authenticate->scheme = tsk_strdup("Digest");
- }
- break;
- case 2:
-/* #line 56 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- hdr_WWW_Authenticate->scheme = tsk_strdup("Basic");
- }
- break;
- case 3:
-/* #line 60 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- THTTP_HEADER(hdr_WWW_Authenticate)->type = thttp_htype_WWW_Authenticate;
- }
- break;
- case 4:
-/* #line 64 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- THTTP_HEADER(hdr_WWW_Authenticate)->type = thttp_htype_Proxy_Authenticate;
- }
- break;
- case 5:
-/* #line 68 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->realm);
- tsk_strunquote(&hdr_WWW_Authenticate->realm);
- }
- break;
- case 6:
-/* #line 73 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->domain);
- //tsk_strunquote(&hdr_WWW_Authenticate->domain);
- }
- break;
- case 7:
-/* #line 78 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->nonce);
- tsk_strunquote(&hdr_WWW_Authenticate->nonce);
- }
- break;
- case 8:
-/* #line 83 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->opaque);
- tsk_strunquote(&hdr_WWW_Authenticate->opaque);
- }
- break;
- case 9:
-/* #line 88 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- hdr_WWW_Authenticate->stale = tsk_strniequals(tag_start, "true", 4);
- }
- break;
- case 10:
-/* #line 92 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->algorithm);
- }
- break;
- case 11:
-/* #line 96 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->qop);
- //tsk_strunquote(&hdr_WWW_Authenticate->qop);
- }
- break;
- case 12:
-/* #line 101 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_WWW_Authenticate));
- }
- break;
- case 13:
-/* #line 109 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- {
- }
- break;
-/* #line 8237 "./src/headers/thttp_header_WWW_Authenticate.c" */
- }
- }
+ _acts = _thttp_machine_parser_header_WWW_Authenticate_actions + _thttp_machine_parser_header_WWW_Authenticate_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ hdr_WWW_Authenticate->scheme = tsk_strdup("Digest");
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ hdr_WWW_Authenticate->scheme = tsk_strdup("Basic");
+ }
+ break;
+ case 3:
+ /* #line 60 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ THTTP_HEADER(hdr_WWW_Authenticate)->type = thttp_htype_WWW_Authenticate;
+ }
+ break;
+ case 4:
+ /* #line 64 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ THTTP_HEADER(hdr_WWW_Authenticate)->type = thttp_htype_Proxy_Authenticate;
+ }
+ break;
+ case 5:
+ /* #line 68 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->realm);
+ tsk_strunquote(&hdr_WWW_Authenticate->realm);
+ }
+ break;
+ case 6:
+ /* #line 73 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->domain);
+ //tsk_strunquote(&hdr_WWW_Authenticate->domain);
+ }
+ break;
+ case 7:
+ /* #line 78 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->nonce);
+ tsk_strunquote(&hdr_WWW_Authenticate->nonce);
+ }
+ break;
+ case 8:
+ /* #line 83 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->opaque);
+ tsk_strunquote(&hdr_WWW_Authenticate->opaque);
+ }
+ break;
+ case 9:
+ /* #line 88 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ hdr_WWW_Authenticate->stale = tsk_strniequals(tag_start, "true", 4);
+ }
+ break;
+ case 10:
+ /* #line 92 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->algorithm);
+ }
+ break;
+ case 11:
+ /* #line 96 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_WWW_Authenticate->qop);
+ //tsk_strunquote(&hdr_WWW_Authenticate->qop);
+ }
+ break;
+ case 12:
+ /* #line 101 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(THTTP_HEADER_PARAMS(hdr_WWW_Authenticate));
+ }
+ break;
+ case 13:
+ /* #line 109 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ {
+ }
+ break;
+ /* #line 8237 "./src/headers/thttp_header_WWW_Authenticate.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 195 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
-/* #line 195 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 8254 "./src/headers/thttp_header_WWW_Authenticate.c" */
-1738
-/* #line 197 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse WWW-Authenticate header.");
- TSK_OBJECT_SAFE_FREE(hdr_WWW_Authenticate);
- }
-
- return hdr_WWW_Authenticate;
+ if( cs <
+ /* #line 8254 "./src/headers/thttp_header_WWW_Authenticate.c" */
+ 1738
+ /* #line 197 "./ragel/thttp_parser_header_WWW_Authenticate.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse WWW-Authenticate header.");
+ TSK_OBJECT_SAFE_FREE(hdr_WWW_Authenticate);
+ }
+
+ return hdr_WWW_Authenticate;
}
thttp_header_Proxy_Authenticate_t *thttp_header_Proxy_Authenticate_parse(const char *data, tsk_size_t size)
{
- return thttp_header_WWW_Authenticate_parse(data, size);
+ return thttp_header_WWW_Authenticate_parse(data, size);
}
@@ -8276,43 +8287,42 @@ thttp_header_Proxy_Authenticate_t *thttp_header_Proxy_Authenticate_parse(const c
static tsk_object_t* thttp_header_WWW_Authenticate_ctor(tsk_object_t *self, va_list * app)
{
- thttp_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- THTTP_HEADER(WWW_Authenticate)->type = thttp_htype_WWW_Authenticate;
- THTTP_HEADER(WWW_Authenticate)->tostring = thttp_header_WWW_Authenticate_tostring;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
- }
- return self;
+ thttp_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ THTTP_HEADER(WWW_Authenticate)->type = thttp_htype_WWW_Authenticate;
+ THTTP_HEADER(WWW_Authenticate)->tostring = thttp_header_WWW_Authenticate_tostring;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
+ }
+ return self;
}
static tsk_object_t* thttp_header_WWW_Authenticate_dtor(tsk_object_t *self)
{
- thttp_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- TSK_FREE(WWW_Authenticate->scheme);
- TSK_FREE(WWW_Authenticate->realm);
- TSK_FREE(WWW_Authenticate->domain);
- TSK_FREE(WWW_Authenticate->nonce);
- TSK_FREE(WWW_Authenticate->opaque);
- TSK_FREE(WWW_Authenticate->algorithm);
- TSK_FREE(WWW_Authenticate->qop);
+ thttp_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ TSK_FREE(WWW_Authenticate->scheme);
+ TSK_FREE(WWW_Authenticate->realm);
+ TSK_FREE(WWW_Authenticate->domain);
+ TSK_FREE(WWW_Authenticate->nonce);
+ TSK_FREE(WWW_Authenticate->opaque);
+ TSK_FREE(WWW_Authenticate->algorithm);
+ TSK_FREE(WWW_Authenticate->qop);
- TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(WWW_Authenticate));
- }
- else{
- TSK_DEBUG_ERROR("Null WWW_Authenticate header.");
- }
+ TSK_OBJECT_SAFE_FREE(THTTP_HEADER_PARAMS(WWW_Authenticate));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null WWW_Authenticate header.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t thttp_header_WWW_Authenticate_def_s =
-{
- sizeof(thttp_header_WWW_Authenticate_t),
- thttp_header_WWW_Authenticate_ctor,
- thttp_header_WWW_Authenticate_dtor,
- tsk_null
+static const tsk_object_def_t thttp_header_WWW_Authenticate_def_s = {
+ sizeof(thttp_header_WWW_Authenticate_t),
+ thttp_header_WWW_Authenticate_ctor,
+ thttp_header_WWW_Authenticate_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_header_WWW_Authenticate_def_t = &thttp_header_WWW_Authenticate_def_s;
diff --git a/tinyHTTP/src/parsers/thttp_parser_header.c b/tinyHTTP/src/parsers/thttp_parser_header.c
index bae4812..5eae5eb 100755
--- a/tinyHTTP/src/parsers/thttp_parser_header.c
+++ b/tinyHTTP/src/parsers/thttp_parser_header.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_header.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
//#include "tinyhttp/headers/thttp_header_Max_Forwards.h"
//#include "tinyhttp/headers/thttp_header_Min_Expires.h"
//#include "tinyhttp/headers/thttp_header_Path.h"
-//#include "tinyhttp/headers/thttp_header_P_Access_Network_Info.h"
+//#include "tinyhttp/headers/thttp_header_P_Access_Network_Info.h"
//#include "tinyhttp/headers/thttp_header_P_Preferred_Identity.h"
//#include "tinyhttp/headers/thttp_header_Privacy.h"
//#include "tinyhttp/headers/thttp_header_Proxy_Authenticate.h"
@@ -89,2758 +89,2769 @@
int thttp_header_parse(tsk_ragel_state_t *state, thttp_message_t *message)
{
- int cs = 0;
- const char *p = state->tag_start;
- const char *pe = state->tag_end;
- const char *eof = pe;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 100 "./src/parsers/thttp_parser_header.c" */
-static const char _thttp_machine_parser_headers_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16, 1, 17, 1, 18, 1,
- 19, 1, 20, 1, 21, 1, 22, 1,
- 23, 1, 24, 1, 25, 1, 26, 1,
- 27, 1, 28, 1, 29, 1, 30, 1,
- 31, 1, 32, 1, 33, 1, 34, 1,
- 35, 1, 36, 1, 37, 1, 38, 1,
- 39, 1, 40, 1, 41, 1, 42, 1,
- 43, 1, 44, 1, 45
-};
-
-static const short _thttp_machine_parser_headers_key_offsets[] = {
- 0, 0, 46, 63, 66, 69, 70, 71,
- 72, 74, 97, 116, 135, 154, 173, 190,
- 193, 196, 197, 198, 199, 201, 224, 243,
- 262, 281, 300, 319, 338, 355, 358, 361,
- 362, 363, 364, 366, 385, 404, 423, 442,
- 461, 480, 499, 516, 519, 522, 523, 524,
- 525, 527, 546, 565, 584, 603, 622, 641,
- 660, 677, 680, 683, 684, 685, 686, 688,
- 707, 726, 745, 762, 765, 768, 769, 770,
- 771, 773, 792, 811, 830, 849, 868, 887,
- 906, 925, 944, 963, 982, 999, 1002, 1005,
- 1006, 1007, 1008, 1010, 1031, 1050, 1069, 1088,
- 1105, 1124, 1143, 1162, 1181, 1200, 1219, 1238,
- 1255, 1258, 1261, 1262, 1263, 1264, 1266, 1285,
- 1306, 1325, 1344, 1363, 1382, 1401, 1420, 1437,
- 1440, 1443, 1444, 1445, 1446, 1448, 1467, 1486,
- 1505, 1522, 1549, 1568, 1587, 1606, 1625, 1644,
- 1663, 1682, 1699, 1702, 1705, 1706, 1707, 1708,
- 1710, 1733, 1752, 1771, 1790, 1809, 1828, 1847,
- 1864, 1867, 1870, 1871, 1872, 1873, 1875, 1894,
- 1913, 1932, 1951, 1968, 1971, 1974, 1975, 1976,
- 1977, 1979, 1998, 2017, 2036, 2055, 2074, 2093,
- 2110, 2113, 2116, 2117, 2118, 2119, 2121, 2140,
- 2158, 2175, 2178, 2181, 2182, 2183, 2184, 2186,
- 2205, 2224, 2243, 2262, 2279, 2282, 2285, 2286,
- 2287, 2288, 2290, 2309, 2328, 2347, 2364, 2367,
- 2370, 2371, 2372, 2373, 2375, 2394, 2413, 2432,
- 2449, 2452, 2455, 2456, 2457, 2458, 2460, 2481,
- 2500, 2519, 2536, 2539, 2542, 2543, 2544, 2545,
- 2547, 2566, 2587, 2606, 2625, 2642, 2645, 2648,
- 2649, 2650, 2651, 2653, 2672, 2691, 2710, 2727,
- 2730, 2733, 2734, 2735, 2736, 2738, 2757, 2776,
- 2795, 2812, 2815, 2818, 2819, 2820, 2821, 2823,
- 2842, 2861, 2880, 2897, 2900, 2903, 2904, 2905,
- 2906, 2908, 2927, 2944, 2969, 2990, 3009, 3028,
- 3047, 3064, 3067, 3070, 3071, 3072, 3073, 3075,
- 3094, 3113, 3132, 3151, 3170, 3189, 3206, 3225,
- 3244, 3263, 3282, 3301, 3318, 3321, 3324, 3325,
- 3326, 3327, 3329, 3348, 3367, 3386, 3403, 3422,
- 3441, 3460, 3479, 3498, 3515, 3518, 3521, 3522,
- 3523, 3524, 3526, 3545, 3564, 3583, 3602, 3619,
- 3622, 3625, 3626, 3627, 3628, 3630, 3649, 3668,
- 3687, 3706, 3725, 3744, 3763, 3782, 3801, 3818,
- 3837, 3856, 3875, 3894, 3913, 3930, 3933, 3936,
- 3937, 3938, 3939, 3941, 3960, 3979, 3998, 4015,
- 4034, 4053, 4072, 4091, 4110, 4129, 4148, 4167,
- 4184, 4187, 4190, 4191, 4192, 4193, 4195, 4214,
- 4233, 4250, 4269, 4288, 4307, 4326, 4345, 4364,
- 4383, 4402, 4419, 4422, 4425, 4426, 4427, 4428,
- 4430, 4449, 4470, 4489, 4508, 4527, 4544, 4547,
- 4550, 4551, 4552, 4553, 4555, 4574, 4593, 4610,
- 4629, 4648, 4667, 4686, 4707, 4726, 4745, 4764,
- 4783, 4802, 4821, 4840, 4857, 4860, 4863, 4864,
- 4865, 4866, 4868, 4887, 4906, 4925, 4944, 4963,
- 4982, 5001, 5020, 5037, 5040, 5043, 5044, 5045,
- 5046, 5048, 5069, 5088, 5107, 5126, 5143, 5146,
- 5149, 5150, 5151, 5152, 5154, 5173, 5192, 5211,
- 5230, 5249, 5266, 5269, 5272, 5273, 5274, 5275,
- 5277, 5296, 5315, 5332, 5351, 5370, 5389, 5408,
- 5427, 5446, 5465, 5484, 5503, 5520, 5545, 5564,
- 5583, 5602, 5621, 5640, 5657, 5660, 5663, 5664,
- 5665, 5666, 5668, 5687, 5706, 5723, 5726, 5729,
- 5730, 5731, 5732, 5734, 5753, 5772, 5791, 5810,
- 5829, 5848, 5867, 5884, 5887, 5890, 5891, 5892,
- 5893, 5895, 5914, 5933, 5952, 5971, 5990, 6009,
- 6026, 6029, 6032, 6033, 6034, 6035, 6037, 6058,
- 6075, 6078, 6081, 6082, 6083, 6084, 6086, 6105,
- 6126, 6145, 6164, 6183, 6200, 6203, 6206, 6207,
- 6208, 6209, 6211, 6230, 6249, 6268, 6287, 6304,
- 6323, 6342, 6361, 6380, 6399, 6418, 6437, 6456,
- 6473, 6476, 6479, 6480, 6481, 6482, 6484, 6505,
- 6524, 6543, 6562, 6581, 6600, 6617, 6620, 6623,
- 6624, 6625, 6626, 6628, 6647, 6666, 6683, 6702,
- 6721, 6740, 6759, 6778, 6795, 6798, 6801, 6802,
- 6803, 6804, 6806, 6825, 6844, 6861, 6864, 6867,
- 6868, 6869, 6870, 6872, 6893, 6912, 6931, 6950,
- 6969, 6988, 7005, 7008, 7011, 7012, 7013, 7014,
- 7016, 7035, 7052, 7071, 7090, 7109, 7128, 7147,
- 7166, 7185, 7204, 7223, 7242, 7261, 7280, 7297,
- 7300, 7303, 7304, 7305, 7306, 7308, 7329, 7350
-};
-
-static const char _thttp_machine_parser_headers_trans_keys[] = {
- 33, 37, 39, 65, 67, 68, 69, 70,
- 72, 73, 76, 77, 80, 82, 83, 84,
- 85, 86, 87, 97, 99, 100, 101, 102,
- 104, 105, 108, 109, 112, 114, 115, 116,
- 117, 118, 119, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 67, 76, 85, 99, 108, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 67,
- 69, 76, 99, 101, 108, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 72, 104,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 68, 100, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 71, 103, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 85, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 76, 108,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 87, 119, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 72, 104,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 90, 122, 126, 42, 43, 45,
- 46, 48, 57, 65, 89, 95, 121, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 65, 79, 97, 111, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 72, 104, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 76, 108, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 84, 110, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 76, 77, 82, 84, 101, 108, 109,
- 114, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 65, 69, 79, 97,
- 101, 111, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 71,
- 103, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 72, 104, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 53, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 89, 121, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 84, 88, 116, 120, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 71, 103, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 80, 112, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 73, 101, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 77, 109,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 70, 102, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 77, 78,
- 82, 85, 109, 110, 114, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 79, 97, 111, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 72, 104, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 68, 100, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 70,
- 102, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 83, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 77, 109, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 72, 104, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 71, 103, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 77,
- 109, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 68, 100, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 77, 109, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 68, 100, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 70, 102, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 88, 120, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 70, 102, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 87, 119, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 79, 97, 111, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 77,
- 109, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 88, 120, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 89, 121, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 85, 117, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 79, 101, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 90, 122, 126, 42, 43, 45, 46, 48,
- 57, 65, 89, 95, 121, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 65, 69,
- 97, 101, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 70, 102, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 87, 119, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 66, 98, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 75, 107, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 75,
- 80, 86, 97, 107, 112, 118, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 89, 121, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 67, 99, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 76, 108,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 69, 82, 101, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 78, 105, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 76, 108, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 70, 102, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 67, 99, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 71, 103, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 80, 83, 112, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 71,
- 103, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 65, 87,
- 97, 119, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 71,
- 103, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 87, 119,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 72, 104, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 65, 79, 97, 111, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 88, 116, 120, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 0
-};
-
-static const char _thttp_machine_parser_headers_single_lengths[] = {
- 0, 36, 7, 3, 3, 1, 1, 1,
- 2, 13, 9, 9, 9, 9, 9, 3,
- 3, 1, 1, 1, 2, 13, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 11, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 11,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 17, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 13, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 8,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 11, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 11, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 15, 11, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 11, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 9, 9, 11, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 11, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 15, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 11, 7,
- 3, 3, 1, 1, 1, 2, 9, 11,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 11, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 11, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 11, 11, 0
-};
-
-static const char _thttp_machine_parser_headers_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 4, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 4,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 4, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 0
-};
-
-static const short _thttp_machine_parser_headers_index_offsets[] = {
- 0, 0, 42, 55, 59, 63, 65, 67,
- 69, 72, 91, 106, 121, 136, 151, 165,
- 169, 173, 175, 177, 179, 182, 201, 216,
- 231, 246, 261, 276, 291, 304, 308, 312,
- 314, 316, 318, 321, 336, 351, 366, 381,
- 396, 411, 426, 439, 443, 447, 449, 451,
- 453, 456, 471, 486, 501, 516, 531, 546,
- 561, 574, 578, 582, 584, 586, 588, 591,
- 606, 621, 636, 649, 653, 657, 659, 661,
- 663, 666, 681, 696, 711, 726, 741, 756,
- 771, 786, 801, 816, 831, 844, 848, 852,
- 854, 856, 858, 861, 878, 893, 908, 923,
- 937, 952, 967, 982, 997, 1012, 1027, 1042,
- 1055, 1059, 1063, 1065, 1067, 1069, 1072, 1087,
- 1104, 1119, 1134, 1149, 1164, 1179, 1194, 1207,
- 1211, 1215, 1217, 1219, 1221, 1224, 1239, 1254,
- 1269, 1283, 1306, 1321, 1336, 1351, 1366, 1381,
- 1396, 1411, 1424, 1428, 1432, 1434, 1436, 1438,
- 1441, 1460, 1475, 1490, 1505, 1520, 1535, 1550,
- 1563, 1567, 1571, 1573, 1575, 1577, 1580, 1595,
- 1610, 1625, 1640, 1653, 1657, 1661, 1663, 1665,
- 1667, 1670, 1685, 1700, 1715, 1730, 1745, 1760,
- 1773, 1777, 1781, 1783, 1785, 1787, 1790, 1805,
- 1819, 1832, 1836, 1840, 1842, 1844, 1846, 1849,
- 1864, 1879, 1894, 1909, 1922, 1926, 1930, 1932,
- 1934, 1936, 1939, 1954, 1969, 1984, 1997, 2001,
- 2005, 2007, 2009, 2011, 2014, 2029, 2044, 2059,
- 2072, 2076, 2080, 2082, 2084, 2086, 2089, 2106,
- 2121, 2136, 2149, 2153, 2157, 2159, 2161, 2163,
- 2166, 2181, 2198, 2213, 2228, 2241, 2245, 2249,
- 2251, 2253, 2255, 2258, 2273, 2288, 2303, 2316,
- 2320, 2324, 2326, 2328, 2330, 2333, 2348, 2363,
- 2378, 2391, 2395, 2399, 2401, 2403, 2405, 2408,
- 2423, 2438, 2453, 2466, 2470, 2474, 2476, 2478,
- 2480, 2483, 2498, 2512, 2533, 2550, 2565, 2580,
- 2595, 2608, 2612, 2616, 2618, 2620, 2622, 2625,
- 2640, 2655, 2670, 2685, 2700, 2715, 2729, 2744,
- 2759, 2774, 2789, 2804, 2817, 2821, 2825, 2827,
- 2829, 2831, 2834, 2849, 2864, 2879, 2893, 2908,
- 2923, 2938, 2953, 2968, 2981, 2985, 2989, 2991,
- 2993, 2995, 2998, 3013, 3028, 3043, 3058, 3071,
- 3075, 3079, 3081, 3083, 3085, 3088, 3103, 3118,
- 3133, 3148, 3163, 3178, 3193, 3208, 3223, 3237,
- 3252, 3267, 3282, 3297, 3312, 3325, 3329, 3333,
- 3335, 3337, 3339, 3342, 3357, 3372, 3387, 3401,
- 3416, 3431, 3446, 3461, 3476, 3491, 3506, 3521,
- 3534, 3538, 3542, 3544, 3546, 3548, 3551, 3566,
- 3581, 3595, 3610, 3625, 3640, 3655, 3670, 3685,
- 3700, 3715, 3728, 3732, 3736, 3738, 3740, 3742,
- 3745, 3760, 3777, 3792, 3807, 3822, 3835, 3839,
- 3843, 3845, 3847, 3849, 3852, 3867, 3882, 3896,
- 3911, 3926, 3941, 3956, 3973, 3988, 4003, 4018,
- 4033, 4048, 4063, 4078, 4091, 4095, 4099, 4101,
- 4103, 4105, 4108, 4123, 4138, 4153, 4168, 4183,
- 4198, 4213, 4228, 4241, 4245, 4249, 4251, 4253,
- 4255, 4258, 4275, 4290, 4305, 4320, 4333, 4337,
- 4341, 4343, 4345, 4347, 4350, 4365, 4380, 4395,
- 4410, 4425, 4438, 4442, 4446, 4448, 4450, 4452,
- 4455, 4470, 4485, 4499, 4514, 4529, 4544, 4559,
- 4574, 4589, 4604, 4619, 4634, 4648, 4669, 4684,
- 4699, 4714, 4729, 4744, 4757, 4761, 4765, 4767,
- 4769, 4771, 4774, 4789, 4804, 4817, 4821, 4825,
- 4827, 4829, 4831, 4834, 4849, 4864, 4879, 4894,
- 4909, 4924, 4939, 4952, 4956, 4960, 4962, 4964,
- 4966, 4969, 4984, 4999, 5014, 5029, 5044, 5059,
- 5072, 5076, 5080, 5082, 5084, 5086, 5089, 5106,
- 5119, 5123, 5127, 5129, 5131, 5133, 5136, 5151,
- 5168, 5183, 5198, 5213, 5226, 5230, 5234, 5236,
- 5238, 5240, 5243, 5258, 5273, 5288, 5303, 5317,
- 5332, 5347, 5362, 5377, 5392, 5407, 5422, 5437,
- 5450, 5454, 5458, 5460, 5462, 5464, 5467, 5484,
- 5499, 5514, 5529, 5544, 5559, 5572, 5576, 5580,
- 5582, 5584, 5586, 5589, 5604, 5619, 5633, 5648,
- 5663, 5678, 5693, 5708, 5721, 5725, 5729, 5731,
- 5733, 5735, 5738, 5753, 5768, 5781, 5785, 5789,
- 5791, 5793, 5795, 5798, 5815, 5830, 5845, 5860,
- 5875, 5890, 5903, 5907, 5911, 5913, 5915, 5917,
- 5920, 5935, 5949, 5964, 5979, 5994, 6009, 6024,
- 6039, 6054, 6069, 6084, 6099, 6114, 6129, 6142,
- 6146, 6150, 6152, 6154, 6156, 6159, 6176, 6193
-};
-
-static const short _thttp_machine_parser_headers_indicies[] = {
- 0, 0, 0, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 2, 18, 4, 19, 6,
- 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 21, 1, 21, 23, 21, 22, 24,
- 22, 25, 1, 26, 1, 22, 22, 1,
- 20, 20, 0, 0, 0, 21, 27, 28,
- 29, 27, 28, 29, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 30, 30, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 31, 31, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 32,
- 32, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 33, 33,
- 0, 0, 0, 0, 0, 0, 1, 34,
- 34, 0, 0, 0, 35, 0, 36, 0,
- 0, 0, 0, 0, 1, 34, 34, 36,
- 1, 36, 38, 36, 37, 39, 37, 40,
- 1, 41, 1, 37, 37, 1, 20, 20,
- 0, 0, 0, 21, 42, 43, 44, 42,
- 43, 44, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 45,
- 45, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 46, 46,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 47, 47, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 48, 48, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 49, 49, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 50, 50, 0, 0, 0, 0,
- 0, 0, 1, 51, 51, 0, 0, 0,
- 52, 0, 0, 0, 0, 0, 0, 1,
- 51, 51, 52, 1, 52, 54, 52, 53,
- 55, 53, 56, 1, 57, 1, 53, 53,
- 1, 20, 20, 0, 0, 0, 21, 58,
- 58, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 59, 59,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 60, 60, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 61, 61, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 62, 62, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 63, 63, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 64, 64, 0, 0, 0, 0, 0,
- 0, 1, 65, 65, 0, 0, 0, 66,
- 0, 0, 0, 0, 0, 0, 1, 65,
- 65, 66, 1, 66, 68, 66, 67, 69,
- 67, 70, 1, 71, 1, 67, 67, 1,
- 20, 20, 0, 0, 0, 21, 72, 72,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 73, 73, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 74, 74, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 75, 75, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 76, 76, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 77, 77, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 78, 78, 0, 0, 0, 0, 0, 0,
- 1, 79, 79, 0, 0, 0, 80, 0,
- 0, 0, 0, 0, 0, 1, 79, 79,
- 80, 1, 80, 82, 80, 81, 83, 81,
- 84, 1, 85, 1, 81, 81, 1, 20,
- 20, 0, 0, 0, 21, 86, 86, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 87, 87, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 88, 88, 0, 0, 0,
- 0, 0, 0, 1, 89, 89, 0, 0,
- 0, 90, 0, 0, 0, 0, 0, 0,
- 1, 89, 89, 90, 1, 90, 92, 90,
- 91, 93, 91, 94, 1, 95, 1, 91,
- 91, 1, 20, 20, 0, 0, 0, 21,
- 96, 96, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 97,
- 97, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 98, 98,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 99, 99, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 100, 100, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 101, 101, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 102, 102, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 103, 103, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 104, 104, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 105,
- 105, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 106, 106,
- 0, 0, 0, 0, 0, 0, 1, 107,
- 107, 0, 0, 0, 108, 0, 0, 0,
- 0, 0, 0, 1, 107, 107, 108, 1,
- 108, 110, 108, 109, 111, 109, 112, 1,
- 113, 1, 109, 109, 1, 20, 20, 0,
- 0, 0, 21, 114, 115, 114, 115, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 116, 116, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 117, 117, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 118, 118, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 119, 0, 21, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 120,
- 120, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 121, 121,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 122, 122, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 123, 123, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 124, 124, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 125, 125, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 126, 126, 0, 0, 0, 0, 0,
- 0, 1, 127, 127, 0, 0, 0, 128,
- 0, 0, 0, 0, 0, 0, 1, 127,
- 127, 128, 1, 128, 130, 128, 129, 131,
- 129, 132, 1, 133, 1, 129, 129, 1,
- 20, 20, 0, 0, 0, 21, 134, 134,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 135, 136, 135,
- 136, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 137, 137,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 138, 138, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 139, 139, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 140, 140, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 141, 141, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 142, 142, 0, 0, 0, 0, 0,
- 0, 1, 143, 143, 0, 0, 0, 144,
- 0, 0, 0, 0, 0, 0, 1, 143,
- 143, 144, 1, 144, 146, 144, 145, 147,
- 145, 148, 1, 149, 1, 145, 145, 1,
- 20, 20, 0, 0, 0, 21, 150, 150,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 151, 151, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 152, 152, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 153, 0, 21, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 154, 155, 156, 157, 158, 154, 155,
- 156, 157, 158, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 159, 159, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 160,
- 160, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 161, 161,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 162, 162, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 163, 163, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 164, 164, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 165, 165, 0, 0, 0, 0,
- 0, 0, 1, 166, 166, 0, 0, 0,
- 167, 0, 0, 0, 0, 0, 0, 1,
- 166, 166, 167, 1, 167, 169, 167, 168,
- 170, 168, 171, 1, 172, 1, 168, 168,
- 1, 20, 20, 0, 0, 0, 21, 173,
- 174, 175, 173, 174, 175, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 176, 176, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 177, 177, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 178, 178, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 179,
- 179, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 180, 180,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 181, 181, 0,
- 0, 0, 0, 0, 0, 1, 182, 182,
- 0, 0, 0, 183, 0, 0, 0, 0,
- 0, 0, 1, 182, 182, 183, 1, 183,
- 185, 183, 184, 186, 184, 187, 1, 188,
- 1, 184, 184, 1, 20, 20, 0, 0,
- 0, 21, 189, 189, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 190, 190, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 191, 191, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 192,
- 192, 0, 0, 0, 0, 0, 0, 1,
- 193, 193, 0, 0, 0, 194, 0, 0,
- 0, 0, 0, 0, 1, 193, 193, 194,
- 1, 194, 196, 194, 195, 197, 195, 198,
- 1, 199, 1, 195, 195, 1, 20, 20,
- 0, 0, 0, 21, 200, 200, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 201, 201, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 202, 202, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 203, 203, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 204, 204, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 205,
- 205, 0, 0, 0, 0, 0, 0, 1,
- 206, 206, 0, 0, 0, 207, 0, 0,
- 0, 0, 0, 0, 1, 206, 206, 207,
- 1, 207, 209, 207, 208, 210, 208, 211,
- 1, 212, 1, 208, 208, 1, 20, 20,
- 0, 0, 0, 21, 213, 213, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 214, 21, 0, 0, 0, 0,
- 0, 0, 1, 215, 215, 0, 0, 0,
- 216, 0, 0, 0, 0, 0, 0, 1,
- 215, 215, 216, 1, 216, 218, 216, 217,
- 219, 217, 220, 1, 221, 1, 217, 217,
- 1, 20, 20, 0, 0, 0, 21, 222,
- 222, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 223, 223,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 224, 224, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 225, 225, 0, 0,
- 0, 0, 0, 0, 1, 226, 226, 0,
- 0, 0, 227, 0, 0, 0, 0, 0,
- 0, 1, 226, 226, 227, 1, 227, 229,
- 227, 228, 230, 228, 231, 1, 232, 1,
- 228, 228, 1, 20, 20, 0, 0, 0,
- 21, 233, 233, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 234, 234, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 235,
- 235, 0, 0, 0, 0, 0, 0, 1,
- 236, 236, 0, 0, 0, 237, 0, 0,
- 0, 0, 0, 0, 1, 236, 236, 237,
- 1, 237, 239, 237, 238, 240, 238, 241,
- 1, 242, 1, 238, 238, 1, 20, 20,
- 0, 0, 0, 21, 243, 243, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 244, 244, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 245, 245, 0, 0, 0, 0,
- 0, 0, 1, 246, 246, 0, 0, 0,
- 247, 0, 0, 0, 0, 0, 0, 1,
- 246, 246, 247, 1, 247, 249, 247, 248,
- 250, 248, 251, 1, 252, 1, 248, 248,
- 1, 20, 20, 0, 0, 0, 21, 253,
- 254, 253, 254, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 255, 255, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 256,
- 256, 0, 0, 0, 0, 0, 0, 1,
- 257, 257, 0, 0, 0, 258, 0, 0,
- 0, 0, 0, 0, 1, 257, 257, 258,
- 1, 258, 260, 258, 259, 261, 259, 262,
- 1, 263, 1, 259, 259, 1, 20, 20,
- 0, 0, 0, 21, 264, 264, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 265, 266, 265, 266, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 267, 267, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 268, 268, 0, 0, 0,
- 0, 0, 0, 1, 269, 269, 0, 0,
- 0, 270, 0, 0, 0, 0, 0, 0,
- 1, 269, 269, 270, 1, 270, 272, 270,
- 271, 273, 271, 274, 1, 275, 1, 271,
- 271, 1, 20, 20, 0, 0, 0, 21,
- 276, 276, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 277,
- 277, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 278, 278,
- 0, 0, 0, 0, 0, 0, 1, 279,
- 279, 0, 0, 0, 280, 0, 0, 0,
- 0, 0, 0, 1, 279, 279, 280, 1,
- 280, 282, 280, 281, 283, 281, 284, 1,
- 285, 1, 281, 281, 1, 20, 20, 0,
- 0, 0, 21, 286, 286, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 287, 287, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 288, 288, 0, 0, 0, 0, 0,
- 0, 1, 289, 289, 0, 0, 0, 290,
- 0, 0, 0, 0, 0, 0, 1, 289,
- 289, 290, 1, 290, 292, 290, 291, 293,
- 291, 294, 1, 295, 1, 291, 291, 1,
- 20, 20, 0, 0, 0, 21, 296, 296,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 297, 297, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 298, 298, 0, 0,
- 0, 0, 0, 0, 1, 299, 299, 0,
- 0, 0, 300, 0, 0, 0, 0, 0,
- 0, 1, 299, 299, 300, 1, 300, 302,
- 300, 301, 303, 301, 304, 1, 305, 1,
- 301, 301, 1, 20, 20, 0, 0, 0,
- 21, 306, 306, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 307,
- 0, 21, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 308, 309,
- 310, 311, 308, 309, 310, 311, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 312, 313, 312, 313, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 314, 314, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 315, 315, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 316, 316, 0, 0, 0, 0,
- 0, 0, 1, 317, 317, 0, 0, 0,
- 318, 0, 0, 0, 0, 0, 0, 1,
- 317, 317, 318, 1, 318, 320, 318, 319,
- 321, 319, 322, 1, 323, 1, 319, 319,
- 1, 20, 20, 0, 0, 0, 21, 324,
- 324, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 325, 325,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 326, 326, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 327, 327, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 328, 328, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 329, 329, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 330, 0, 21, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 331,
- 331, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 332, 332,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 333, 333, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 334, 334, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 335, 335, 0, 0, 0,
- 0, 0, 0, 1, 336, 336, 0, 0,
- 0, 337, 0, 0, 0, 0, 0, 0,
- 1, 336, 336, 337, 1, 337, 339, 337,
- 338, 340, 338, 341, 1, 342, 1, 338,
- 338, 1, 20, 20, 0, 0, 0, 21,
- 343, 343, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 344,
- 344, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 345, 345,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 346, 0, 21, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 347, 347, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 348, 348, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 349, 349, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 350, 350, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 351,
- 351, 0, 0, 0, 0, 0, 0, 1,
- 352, 352, 0, 0, 0, 353, 0, 0,
- 0, 0, 0, 0, 1, 352, 352, 353,
- 1, 353, 355, 353, 354, 356, 354, 357,
- 1, 358, 1, 354, 354, 1, 20, 20,
- 0, 0, 0, 21, 359, 359, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 360, 360, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 361, 361, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 362, 362, 0, 0, 0, 0, 0,
- 0, 1, 363, 363, 0, 0, 0, 364,
- 0, 0, 0, 0, 0, 0, 1, 363,
- 363, 364, 1, 364, 366, 364, 365, 367,
- 365, 368, 1, 369, 1, 365, 365, 1,
- 20, 20, 0, 0, 0, 21, 370, 370,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 371, 371, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 372, 372, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 373, 373, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 374, 374, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 375, 375, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 376, 376, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 377,
- 377, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 378, 378,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 379, 0, 21, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 380, 380, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 381, 381, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 382, 382, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 383, 383, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 384,
- 384, 0, 0, 0, 0, 0, 0, 1,
- 385, 385, 0, 0, 0, 386, 0, 0,
- 0, 0, 0, 0, 1, 385, 385, 386,
- 1, 386, 388, 386, 387, 389, 387, 390,
- 1, 391, 1, 387, 387, 1, 20, 20,
- 0, 0, 0, 21, 392, 392, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 393, 393, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 394, 394, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 395, 0, 21, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 396,
- 396, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 397, 397,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 398, 398, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 399, 399, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 400, 400, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 401, 401, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 402, 402, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 403, 403, 0, 0, 0, 0, 0, 0,
- 1, 404, 404, 0, 0, 0, 405, 0,
- 0, 0, 0, 0, 0, 1, 404, 404,
- 405, 1, 405, 407, 405, 406, 408, 406,
- 409, 1, 410, 1, 406, 406, 1, 20,
- 20, 0, 0, 0, 21, 411, 411, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 412, 412, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 413, 0, 21, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 414, 414, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 415, 415, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 416,
- 416, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 417, 417,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 418, 418, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 419, 419, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 420, 420, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 421, 421, 0, 0, 0, 0,
- 0, 0, 1, 422, 422, 0, 0, 0,
- 423, 0, 0, 0, 0, 0, 0, 1,
- 422, 422, 423, 1, 423, 425, 423, 424,
- 426, 424, 427, 1, 428, 1, 424, 424,
- 1, 20, 20, 0, 0, 0, 21, 429,
- 429, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 430, 431,
- 430, 431, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 432,
- 432, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 433, 433,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 434, 434, 0,
- 0, 0, 0, 0, 0, 1, 435, 435,
- 0, 0, 0, 436, 0, 0, 0, 0,
- 0, 0, 1, 435, 435, 436, 1, 436,
- 438, 436, 437, 439, 437, 440, 1, 441,
- 1, 437, 437, 1, 20, 20, 0, 0,
- 0, 21, 442, 442, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 443, 443, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 444,
- 0, 21, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 445, 445,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 446, 446, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 447, 447, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 448, 448, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 449, 450, 449, 450, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 451, 451, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 452, 452, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 453, 453, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 454, 454, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 455,
- 455, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 456, 456,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 457, 457, 0,
- 0, 0, 0, 0, 0, 1, 458, 458,
- 0, 0, 0, 459, 0, 0, 0, 0,
- 0, 0, 1, 458, 458, 459, 1, 459,
- 461, 459, 460, 462, 460, 463, 1, 464,
- 1, 460, 460, 1, 20, 20, 0, 0,
- 0, 21, 465, 465, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 466, 466, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 467, 467, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 468,
- 468, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 469, 469,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 470, 470, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 471, 471, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 472, 472, 0, 0, 0,
- 0, 0, 0, 1, 473, 473, 0, 0,
- 0, 474, 0, 0, 0, 0, 0, 0,
- 1, 473, 473, 474, 1, 474, 476, 474,
- 475, 477, 475, 478, 1, 479, 1, 475,
- 475, 1, 20, 20, 0, 0, 0, 21,
- 480, 481, 480, 481, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 482, 482, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 483, 483, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 484,
- 484, 0, 0, 0, 0, 0, 0, 1,
- 485, 485, 0, 0, 0, 486, 0, 0,
- 0, 0, 0, 0, 1, 485, 485, 486,
- 1, 486, 488, 486, 487, 489, 487, 490,
- 1, 491, 1, 487, 487, 1, 20, 20,
- 0, 0, 0, 21, 492, 492, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 493, 493, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 494, 494, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 495, 495, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 496, 496, 0, 0, 0, 0, 0, 0,
- 1, 497, 497, 0, 0, 0, 498, 0,
- 0, 0, 0, 0, 0, 1, 497, 497,
- 498, 1, 498, 500, 498, 499, 501, 499,
- 502, 1, 503, 1, 499, 499, 1, 20,
- 20, 0, 0, 0, 21, 504, 504, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 505, 505, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 506, 0, 21, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 507, 507, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 508, 508, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 509,
- 509, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 510, 510,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 511, 511, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 512, 512, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 513, 513, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 514, 514, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 515, 515, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 516,
- 0, 21, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 517, 518,
- 519, 520, 517, 518, 519, 520, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 521, 521, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 522, 522, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 523, 523, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 524, 524, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 525,
- 525, 0, 0, 0, 0, 0, 0, 1,
- 526, 526, 0, 0, 0, 527, 0, 0,
- 0, 0, 0, 0, 1, 526, 526, 527,
- 1, 527, 529, 527, 528, 530, 528, 531,
- 1, 532, 1, 528, 528, 1, 20, 20,
- 0, 0, 0, 21, 533, 533, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 534, 534, 0, 0, 0,
- 0, 0, 0, 1, 535, 535, 0, 0,
- 0, 536, 0, 0, 0, 0, 0, 0,
- 1, 535, 535, 536, 1, 536, 538, 536,
- 537, 539, 537, 540, 1, 541, 1, 537,
- 537, 1, 20, 20, 0, 0, 0, 21,
- 542, 542, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 543,
- 543, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 544, 544,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 545, 545, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 546, 546, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 547, 547, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 548, 548, 0, 0, 0, 0,
- 0, 0, 1, 549, 549, 0, 0, 0,
- 550, 0, 0, 0, 0, 0, 0, 1,
- 549, 549, 550, 1, 550, 552, 550, 551,
- 553, 551, 554, 1, 555, 1, 551, 551,
- 1, 20, 20, 0, 0, 0, 21, 556,
- 556, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 557, 557,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 558, 558, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 559, 559, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 560, 560, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 561, 561, 0, 0, 0, 0,
- 0, 0, 1, 562, 562, 0, 0, 0,
- 563, 0, 0, 0, 0, 0, 0, 1,
- 562, 562, 563, 1, 563, 565, 563, 564,
- 566, 564, 567, 1, 568, 1, 564, 564,
- 1, 20, 20, 0, 0, 0, 21, 569,
- 570, 569, 570, 0, 0, 0, 0, 0,
- 0, 1, 571, 571, 0, 0, 0, 572,
- 0, 0, 0, 0, 0, 0, 1, 571,
- 571, 572, 1, 572, 574, 572, 573, 575,
- 573, 576, 1, 577, 1, 573, 573, 1,
- 20, 20, 0, 0, 0, 21, 578, 578,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 579, 580, 579,
- 580, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 581, 581,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 582, 582, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 583, 583, 0, 0,
- 0, 0, 0, 0, 1, 584, 584, 0,
- 0, 0, 585, 0, 0, 0, 0, 0,
- 0, 1, 584, 584, 585, 1, 585, 587,
- 585, 586, 588, 586, 589, 1, 590, 1,
- 586, 586, 1, 20, 20, 0, 0, 0,
- 21, 591, 591, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 592, 592, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 593,
- 593, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 594, 594,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 595, 0, 21, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 596, 596, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 597, 597, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 598, 598, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 599, 599, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 600,
- 600, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 601, 601,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 602, 602, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 603, 603, 0, 0,
- 0, 0, 0, 0, 1, 604, 604, 0,
- 0, 0, 605, 0, 0, 0, 0, 0,
- 0, 1, 604, 604, 605, 1, 605, 607,
- 605, 606, 608, 606, 609, 1, 610, 1,
- 606, 606, 1, 20, 20, 0, 0, 0,
- 21, 611, 612, 611, 612, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 613, 613, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 614, 614, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 615, 615, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 616,
- 616, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 617, 617,
- 0, 0, 0, 0, 0, 0, 1, 618,
- 618, 0, 0, 0, 619, 0, 0, 0,
- 0, 0, 0, 1, 618, 618, 619, 1,
- 619, 621, 619, 620, 622, 620, 623, 1,
- 624, 1, 620, 620, 1, 20, 20, 0,
- 0, 0, 21, 625, 625, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 626, 626, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 627, 0, 21, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 628,
- 628, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 629, 629,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 630, 630, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 631, 631, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 632, 632, 0, 0, 0,
- 0, 0, 0, 1, 633, 633, 0, 0,
- 0, 634, 0, 0, 0, 0, 0, 0,
- 1, 633, 633, 634, 1, 634, 636, 634,
- 635, 637, 635, 638, 1, 639, 1, 635,
- 635, 1, 20, 20, 0, 0, 0, 21,
- 640, 640, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 641,
- 641, 0, 0, 0, 0, 0, 0, 1,
- 642, 642, 0, 0, 0, 643, 0, 0,
- 0, 0, 0, 0, 1, 642, 642, 643,
- 1, 643, 645, 643, 644, 646, 644, 647,
- 1, 648, 1, 644, 644, 1, 20, 20,
- 0, 0, 0, 21, 649, 650, 649, 650,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 651, 651, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 652, 652, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 653, 653, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 654, 654, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 655, 655, 0, 0, 0, 0, 0,
- 0, 1, 656, 656, 0, 0, 0, 657,
- 0, 0, 0, 0, 0, 0, 1, 656,
- 656, 657, 1, 657, 659, 657, 658, 660,
- 658, 661, 1, 662, 1, 658, 658, 1,
- 20, 20, 0, 0, 0, 21, 663, 663,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 664, 0, 21, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 665, 665, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 666, 666, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 667, 667, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 668, 668, 0, 0, 0, 0, 0, 0,
- 1, 20, 20, 0, 0, 0, 21, 669,
- 669, 0, 0, 0, 0, 0, 0, 1,
- 20, 20, 0, 0, 0, 21, 670, 670,
- 0, 0, 0, 0, 0, 0, 1, 20,
- 20, 0, 0, 0, 21, 671, 671, 0,
- 0, 0, 0, 0, 0, 1, 20, 20,
- 0, 0, 0, 21, 672, 672, 0, 0,
- 0, 0, 0, 0, 1, 20, 20, 0,
- 0, 0, 21, 673, 673, 0, 0, 0,
- 0, 0, 0, 1, 20, 20, 0, 0,
- 0, 21, 674, 674, 0, 0, 0, 0,
- 0, 0, 1, 20, 20, 0, 0, 0,
- 21, 675, 675, 0, 0, 0, 0, 0,
- 0, 1, 20, 20, 0, 0, 0, 21,
- 676, 676, 0, 0, 0, 0, 0, 0,
- 1, 677, 677, 0, 0, 0, 678, 0,
- 0, 0, 0, 0, 0, 1, 677, 677,
- 678, 1, 678, 680, 678, 679, 681, 679,
- 682, 1, 683, 1, 679, 679, 1, 236,
- 236, 0, 0, 0, 237, 114, 115, 114,
- 115, 0, 0, 0, 0, 0, 0, 1,
- 166, 166, 0, 0, 0, 167, 253, 254,
- 253, 254, 0, 0, 0, 0, 0, 0,
- 1, 1, 0
-};
-
-static const short _thttp_machine_parser_headers_trans_targs[] = {
- 2, 0, 9, 91, 212, 222, 253, 263,
- 273, 355, 374, 392, 441, 464, 526, 566,
- 594, 603, 637, 638, 3, 4, 5, 7,
- 6, 639, 8, 10, 63, 73, 11, 12,
- 13, 14, 15, 21, 16, 17, 19, 18,
- 639, 20, 22, 35, 49, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 33, 32,
- 639, 34, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 47, 46, 639, 48,
- 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 61, 60, 639, 62, 64, 65,
- 66, 67, 68, 69, 71, 70, 639, 72,
- 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 89, 88,
- 639, 90, 92, 110, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 108, 107, 639, 109, 111, 112,
- 125, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 123, 122, 639, 124, 126, 127,
- 128, 129, 130, 144, 182, 191, 202, 131,
- 132, 133, 134, 135, 136, 137, 138, 139,
- 140, 142, 141, 639, 143, 145, 158, 169,
- 146, 147, 148, 149, 150, 151, 152, 153,
- 154, 156, 155, 639, 157, 159, 160, 161,
- 162, 163, 164, 165, 167, 166, 639, 168,
- 170, 171, 172, 173, 174, 175, 176, 177,
- 178, 180, 179, 639, 181, 183, 184, 185,
- 186, 187, 189, 188, 639, 190, 192, 193,
- 194, 195, 196, 197, 198, 200, 199, 639,
- 201, 203, 204, 205, 206, 207, 208, 210,
- 209, 639, 211, 213, 214, 215, 216, 217,
- 218, 220, 219, 639, 221, 223, 232, 224,
- 225, 226, 227, 228, 230, 229, 639, 231,
- 233, 234, 243, 235, 236, 237, 238, 239,
- 241, 240, 639, 242, 244, 245, 246, 247,
- 248, 249, 251, 250, 639, 252, 254, 255,
- 256, 257, 258, 259, 261, 260, 639, 262,
- 264, 265, 266, 267, 268, 269, 271, 270,
- 639, 272, 274, 275, 276, 306, 322, 333,
- 277, 287, 278, 279, 280, 281, 282, 283,
- 285, 284, 639, 286, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299,
- 300, 301, 302, 304, 303, 639, 305, 307,
- 308, 309, 310, 311, 312, 313, 314, 315,
- 316, 317, 318, 320, 319, 639, 321, 323,
- 324, 325, 326, 327, 328, 329, 331, 330,
- 639, 332, 334, 335, 336, 337, 338, 339,
- 340, 341, 342, 343, 344, 345, 346, 347,
- 348, 349, 350, 351, 353, 352, 639, 354,
- 356, 357, 358, 359, 360, 361, 362, 363,
- 364, 365, 366, 367, 368, 369, 370, 372,
- 371, 639, 373, 375, 376, 377, 378, 379,
- 380, 381, 382, 383, 384, 385, 386, 387,
- 388, 390, 389, 639, 391, 393, 394, 404,
- 395, 396, 397, 398, 399, 400, 402, 401,
- 639, 403, 405, 406, 407, 408, 409, 410,
- 411, 412, 426, 413, 414, 415, 416, 417,
- 418, 419, 420, 421, 422, 424, 423, 639,
- 425, 427, 428, 429, 430, 431, 432, 433,
- 434, 435, 436, 437, 439, 438, 639, 440,
- 442, 452, 443, 444, 445, 446, 447, 448,
- 450, 449, 639, 451, 453, 454, 455, 456,
- 457, 458, 459, 460, 462, 461, 639, 463,
- 465, 466, 467, 468, 469, 470, 471, 472,
- 473, 474, 475, 476, 477, 478, 490, 499,
- 513, 479, 480, 481, 482, 483, 484, 485,
- 486, 488, 487, 639, 489, 491, 492, 493,
- 494, 495, 497, 496, 639, 498, 500, 501,
- 502, 503, 504, 505, 506, 507, 508, 509,
- 511, 510, 639, 512, 514, 515, 516, 517,
- 518, 519, 520, 521, 522, 524, 523, 639,
- 525, 527, 534, 528, 529, 530, 532, 531,
- 639, 533, 535, 536, 546, 537, 538, 539,
- 540, 541, 542, 544, 543, 639, 545, 547,
- 548, 549, 550, 551, 552, 553, 554, 555,
- 556, 557, 558, 559, 560, 561, 562, 564,
- 563, 639, 565, 567, 579, 568, 569, 570,
- 571, 572, 573, 574, 575, 577, 576, 639,
- 578, 580, 581, 582, 583, 584, 585, 586,
- 587, 588, 589, 590, 592, 591, 639, 593,
- 595, 596, 597, 598, 599, 601, 600, 639,
- 602, 604, 616, 605, 606, 607, 608, 609,
- 610, 611, 612, 614, 613, 639, 615, 617,
- 618, 619, 620, 621, 622, 623, 624, 625,
- 626, 627, 628, 629, 630, 631, 632, 633,
- 635, 634, 639, 636
-};
-
-static const char _thttp_machine_parser_headers_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 91, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 9, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 11, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 15, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 21, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 23, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 27,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 29, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 31, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 35, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 37, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 39, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 41, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 43, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 45, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 47, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 51, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 53, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 55, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 57, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 59,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 61, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 63, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 65, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 69, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 71, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 73,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 77, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 79, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 81,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 83, 0,
- 0, 0, 0, 0, 0, 0, 0, 85,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 87, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 89, 0
-};
-
-static const int thttp_machine_parser_headers_start = 1;
-static const int thttp_machine_parser_headers_first_final = 639;
-static const int thttp_machine_parser_headers_error = 0;
-
-static const int thttp_machine_parser_headers_en_main = 1;
-
-
-/* #line 513 "./ragel/thttp_parser_header.rl" */
- (void)(eof);
- (void)(thttp_machine_parser_headers_first_final);
- (void)(thttp_machine_parser_headers_error);
- (void)(thttp_machine_parser_headers_en_main);
-
-/* #line 2339 "./src/parsers/thttp_parser_header.c" */
- {
- cs = thttp_machine_parser_headers_start;
- }
-
-/* #line 518 "./ragel/thttp_parser_header.rl" */
-
-/* #line 2346 "./src/parsers/thttp_parser_header.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = state->tag_start;
+ const char *pe = state->tag_end;
+ const char *eof = pe;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 100 "./src/parsers/thttp_parser_header.c" */
+ static const char _thttp_machine_parser_headers_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16, 1, 17, 1, 18, 1,
+ 19, 1, 20, 1, 21, 1, 22, 1,
+ 23, 1, 24, 1, 25, 1, 26, 1,
+ 27, 1, 28, 1, 29, 1, 30, 1,
+ 31, 1, 32, 1, 33, 1, 34, 1,
+ 35, 1, 36, 1, 37, 1, 38, 1,
+ 39, 1, 40, 1, 41, 1, 42, 1,
+ 43, 1, 44, 1, 45
+ };
+
+ static const short _thttp_machine_parser_headers_key_offsets[] = {
+ 0, 0, 46, 63, 66, 69, 70, 71,
+ 72, 74, 97, 116, 135, 154, 173, 190,
+ 193, 196, 197, 198, 199, 201, 224, 243,
+ 262, 281, 300, 319, 338, 355, 358, 361,
+ 362, 363, 364, 366, 385, 404, 423, 442,
+ 461, 480, 499, 516, 519, 522, 523, 524,
+ 525, 527, 546, 565, 584, 603, 622, 641,
+ 660, 677, 680, 683, 684, 685, 686, 688,
+ 707, 726, 745, 762, 765, 768, 769, 770,
+ 771, 773, 792, 811, 830, 849, 868, 887,
+ 906, 925, 944, 963, 982, 999, 1002, 1005,
+ 1006, 1007, 1008, 1010, 1031, 1050, 1069, 1088,
+ 1105, 1124, 1143, 1162, 1181, 1200, 1219, 1238,
+ 1255, 1258, 1261, 1262, 1263, 1264, 1266, 1285,
+ 1306, 1325, 1344, 1363, 1382, 1401, 1420, 1437,
+ 1440, 1443, 1444, 1445, 1446, 1448, 1467, 1486,
+ 1505, 1522, 1549, 1568, 1587, 1606, 1625, 1644,
+ 1663, 1682, 1699, 1702, 1705, 1706, 1707, 1708,
+ 1710, 1733, 1752, 1771, 1790, 1809, 1828, 1847,
+ 1864, 1867, 1870, 1871, 1872, 1873, 1875, 1894,
+ 1913, 1932, 1951, 1968, 1971, 1974, 1975, 1976,
+ 1977, 1979, 1998, 2017, 2036, 2055, 2074, 2093,
+ 2110, 2113, 2116, 2117, 2118, 2119, 2121, 2140,
+ 2158, 2175, 2178, 2181, 2182, 2183, 2184, 2186,
+ 2205, 2224, 2243, 2262, 2279, 2282, 2285, 2286,
+ 2287, 2288, 2290, 2309, 2328, 2347, 2364, 2367,
+ 2370, 2371, 2372, 2373, 2375, 2394, 2413, 2432,
+ 2449, 2452, 2455, 2456, 2457, 2458, 2460, 2481,
+ 2500, 2519, 2536, 2539, 2542, 2543, 2544, 2545,
+ 2547, 2566, 2587, 2606, 2625, 2642, 2645, 2648,
+ 2649, 2650, 2651, 2653, 2672, 2691, 2710, 2727,
+ 2730, 2733, 2734, 2735, 2736, 2738, 2757, 2776,
+ 2795, 2812, 2815, 2818, 2819, 2820, 2821, 2823,
+ 2842, 2861, 2880, 2897, 2900, 2903, 2904, 2905,
+ 2906, 2908, 2927, 2944, 2969, 2990, 3009, 3028,
+ 3047, 3064, 3067, 3070, 3071, 3072, 3073, 3075,
+ 3094, 3113, 3132, 3151, 3170, 3189, 3206, 3225,
+ 3244, 3263, 3282, 3301, 3318, 3321, 3324, 3325,
+ 3326, 3327, 3329, 3348, 3367, 3386, 3403, 3422,
+ 3441, 3460, 3479, 3498, 3515, 3518, 3521, 3522,
+ 3523, 3524, 3526, 3545, 3564, 3583, 3602, 3619,
+ 3622, 3625, 3626, 3627, 3628, 3630, 3649, 3668,
+ 3687, 3706, 3725, 3744, 3763, 3782, 3801, 3818,
+ 3837, 3856, 3875, 3894, 3913, 3930, 3933, 3936,
+ 3937, 3938, 3939, 3941, 3960, 3979, 3998, 4015,
+ 4034, 4053, 4072, 4091, 4110, 4129, 4148, 4167,
+ 4184, 4187, 4190, 4191, 4192, 4193, 4195, 4214,
+ 4233, 4250, 4269, 4288, 4307, 4326, 4345, 4364,
+ 4383, 4402, 4419, 4422, 4425, 4426, 4427, 4428,
+ 4430, 4449, 4470, 4489, 4508, 4527, 4544, 4547,
+ 4550, 4551, 4552, 4553, 4555, 4574, 4593, 4610,
+ 4629, 4648, 4667, 4686, 4707, 4726, 4745, 4764,
+ 4783, 4802, 4821, 4840, 4857, 4860, 4863, 4864,
+ 4865, 4866, 4868, 4887, 4906, 4925, 4944, 4963,
+ 4982, 5001, 5020, 5037, 5040, 5043, 5044, 5045,
+ 5046, 5048, 5069, 5088, 5107, 5126, 5143, 5146,
+ 5149, 5150, 5151, 5152, 5154, 5173, 5192, 5211,
+ 5230, 5249, 5266, 5269, 5272, 5273, 5274, 5275,
+ 5277, 5296, 5315, 5332, 5351, 5370, 5389, 5408,
+ 5427, 5446, 5465, 5484, 5503, 5520, 5545, 5564,
+ 5583, 5602, 5621, 5640, 5657, 5660, 5663, 5664,
+ 5665, 5666, 5668, 5687, 5706, 5723, 5726, 5729,
+ 5730, 5731, 5732, 5734, 5753, 5772, 5791, 5810,
+ 5829, 5848, 5867, 5884, 5887, 5890, 5891, 5892,
+ 5893, 5895, 5914, 5933, 5952, 5971, 5990, 6009,
+ 6026, 6029, 6032, 6033, 6034, 6035, 6037, 6058,
+ 6075, 6078, 6081, 6082, 6083, 6084, 6086, 6105,
+ 6126, 6145, 6164, 6183, 6200, 6203, 6206, 6207,
+ 6208, 6209, 6211, 6230, 6249, 6268, 6287, 6304,
+ 6323, 6342, 6361, 6380, 6399, 6418, 6437, 6456,
+ 6473, 6476, 6479, 6480, 6481, 6482, 6484, 6505,
+ 6524, 6543, 6562, 6581, 6600, 6617, 6620, 6623,
+ 6624, 6625, 6626, 6628, 6647, 6666, 6683, 6702,
+ 6721, 6740, 6759, 6778, 6795, 6798, 6801, 6802,
+ 6803, 6804, 6806, 6825, 6844, 6861, 6864, 6867,
+ 6868, 6869, 6870, 6872, 6893, 6912, 6931, 6950,
+ 6969, 6988, 7005, 7008, 7011, 7012, 7013, 7014,
+ 7016, 7035, 7052, 7071, 7090, 7109, 7128, 7147,
+ 7166, 7185, 7204, 7223, 7242, 7261, 7280, 7297,
+ 7300, 7303, 7304, 7305, 7306, 7308, 7329, 7350
+ };
+
+ static const char _thttp_machine_parser_headers_trans_keys[] = {
+ 33, 37, 39, 65, 67, 68, 69, 70,
+ 72, 73, 76, 77, 80, 82, 83, 84,
+ 85, 86, 87, 97, 99, 100, 101, 102,
+ 104, 105, 108, 109, 112, 114, 115, 116,
+ 117, 118, 119, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 67, 76, 85, 99, 108, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 67,
+ 69, 76, 99, 101, 108, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 72, 104,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 68, 100, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 71, 103, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 85, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 76, 108,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 87, 119, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 72, 104,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 90, 122, 126, 42, 43, 45,
+ 46, 48, 57, 65, 89, 95, 121, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 65, 79, 97, 111, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 72, 104, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 76, 108, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 84, 110, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 76, 77, 82, 84, 101, 108, 109,
+ 114, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 65, 69, 79, 97,
+ 101, 111, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 71,
+ 103, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 72, 104, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 53, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 89, 121, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 84, 88, 116, 120, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 71, 103, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 80, 112, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 73, 101, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 77, 109,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 70, 102, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 77, 78,
+ 82, 85, 109, 110, 114, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 79, 97, 111, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 72, 104, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 68, 100, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 70,
+ 102, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 83, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 77, 109, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 72, 104, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 71, 103, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 77,
+ 109, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 68, 100, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 77, 109, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 68, 100, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 70, 102, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 88, 120, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 70, 102, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 87, 119, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 79, 97, 111, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 77,
+ 109, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 88, 120, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 89, 121, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 85, 117, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 79, 101, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 90, 122, 126, 42, 43, 45, 46, 48,
+ 57, 65, 89, 95, 121, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 65, 69,
+ 97, 101, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 70, 102, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 87, 119, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 66, 98, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 75, 107, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 75,
+ 80, 86, 97, 107, 112, 118, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 89, 121, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 67, 99, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 76, 108,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 69, 82, 101, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 78, 105, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 76, 108, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 70, 102, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 67, 99, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 71, 103, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 80, 83, 112, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 71,
+ 103, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 65, 87,
+ 97, 119, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 71,
+ 103, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 87, 119,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 72, 104, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 65, 79, 97, 111, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 88, 116, 120, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _thttp_machine_parser_headers_single_lengths[] = {
+ 0, 36, 7, 3, 3, 1, 1, 1,
+ 2, 13, 9, 9, 9, 9, 9, 3,
+ 3, 1, 1, 1, 2, 13, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 11, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 11,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 17, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 13, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 8,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 11, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 11, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 15, 11, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 11, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 9, 9, 11, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 11, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 15, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 11, 7,
+ 3, 3, 1, 1, 1, 2, 9, 11,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 11, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 11, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 11, 11, 0
+ };
+
+ static const char _thttp_machine_parser_headers_range_lengths[] = {
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 4, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 4, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 0
+ };
+
+ static const short _thttp_machine_parser_headers_index_offsets[] = {
+ 0, 0, 42, 55, 59, 63, 65, 67,
+ 69, 72, 91, 106, 121, 136, 151, 165,
+ 169, 173, 175, 177, 179, 182, 201, 216,
+ 231, 246, 261, 276, 291, 304, 308, 312,
+ 314, 316, 318, 321, 336, 351, 366, 381,
+ 396, 411, 426, 439, 443, 447, 449, 451,
+ 453, 456, 471, 486, 501, 516, 531, 546,
+ 561, 574, 578, 582, 584, 586, 588, 591,
+ 606, 621, 636, 649, 653, 657, 659, 661,
+ 663, 666, 681, 696, 711, 726, 741, 756,
+ 771, 786, 801, 816, 831, 844, 848, 852,
+ 854, 856, 858, 861, 878, 893, 908, 923,
+ 937, 952, 967, 982, 997, 1012, 1027, 1042,
+ 1055, 1059, 1063, 1065, 1067, 1069, 1072, 1087,
+ 1104, 1119, 1134, 1149, 1164, 1179, 1194, 1207,
+ 1211, 1215, 1217, 1219, 1221, 1224, 1239, 1254,
+ 1269, 1283, 1306, 1321, 1336, 1351, 1366, 1381,
+ 1396, 1411, 1424, 1428, 1432, 1434, 1436, 1438,
+ 1441, 1460, 1475, 1490, 1505, 1520, 1535, 1550,
+ 1563, 1567, 1571, 1573, 1575, 1577, 1580, 1595,
+ 1610, 1625, 1640, 1653, 1657, 1661, 1663, 1665,
+ 1667, 1670, 1685, 1700, 1715, 1730, 1745, 1760,
+ 1773, 1777, 1781, 1783, 1785, 1787, 1790, 1805,
+ 1819, 1832, 1836, 1840, 1842, 1844, 1846, 1849,
+ 1864, 1879, 1894, 1909, 1922, 1926, 1930, 1932,
+ 1934, 1936, 1939, 1954, 1969, 1984, 1997, 2001,
+ 2005, 2007, 2009, 2011, 2014, 2029, 2044, 2059,
+ 2072, 2076, 2080, 2082, 2084, 2086, 2089, 2106,
+ 2121, 2136, 2149, 2153, 2157, 2159, 2161, 2163,
+ 2166, 2181, 2198, 2213, 2228, 2241, 2245, 2249,
+ 2251, 2253, 2255, 2258, 2273, 2288, 2303, 2316,
+ 2320, 2324, 2326, 2328, 2330, 2333, 2348, 2363,
+ 2378, 2391, 2395, 2399, 2401, 2403, 2405, 2408,
+ 2423, 2438, 2453, 2466, 2470, 2474, 2476, 2478,
+ 2480, 2483, 2498, 2512, 2533, 2550, 2565, 2580,
+ 2595, 2608, 2612, 2616, 2618, 2620, 2622, 2625,
+ 2640, 2655, 2670, 2685, 2700, 2715, 2729, 2744,
+ 2759, 2774, 2789, 2804, 2817, 2821, 2825, 2827,
+ 2829, 2831, 2834, 2849, 2864, 2879, 2893, 2908,
+ 2923, 2938, 2953, 2968, 2981, 2985, 2989, 2991,
+ 2993, 2995, 2998, 3013, 3028, 3043, 3058, 3071,
+ 3075, 3079, 3081, 3083, 3085, 3088, 3103, 3118,
+ 3133, 3148, 3163, 3178, 3193, 3208, 3223, 3237,
+ 3252, 3267, 3282, 3297, 3312, 3325, 3329, 3333,
+ 3335, 3337, 3339, 3342, 3357, 3372, 3387, 3401,
+ 3416, 3431, 3446, 3461, 3476, 3491, 3506, 3521,
+ 3534, 3538, 3542, 3544, 3546, 3548, 3551, 3566,
+ 3581, 3595, 3610, 3625, 3640, 3655, 3670, 3685,
+ 3700, 3715, 3728, 3732, 3736, 3738, 3740, 3742,
+ 3745, 3760, 3777, 3792, 3807, 3822, 3835, 3839,
+ 3843, 3845, 3847, 3849, 3852, 3867, 3882, 3896,
+ 3911, 3926, 3941, 3956, 3973, 3988, 4003, 4018,
+ 4033, 4048, 4063, 4078, 4091, 4095, 4099, 4101,
+ 4103, 4105, 4108, 4123, 4138, 4153, 4168, 4183,
+ 4198, 4213, 4228, 4241, 4245, 4249, 4251, 4253,
+ 4255, 4258, 4275, 4290, 4305, 4320, 4333, 4337,
+ 4341, 4343, 4345, 4347, 4350, 4365, 4380, 4395,
+ 4410, 4425, 4438, 4442, 4446, 4448, 4450, 4452,
+ 4455, 4470, 4485, 4499, 4514, 4529, 4544, 4559,
+ 4574, 4589, 4604, 4619, 4634, 4648, 4669, 4684,
+ 4699, 4714, 4729, 4744, 4757, 4761, 4765, 4767,
+ 4769, 4771, 4774, 4789, 4804, 4817, 4821, 4825,
+ 4827, 4829, 4831, 4834, 4849, 4864, 4879, 4894,
+ 4909, 4924, 4939, 4952, 4956, 4960, 4962, 4964,
+ 4966, 4969, 4984, 4999, 5014, 5029, 5044, 5059,
+ 5072, 5076, 5080, 5082, 5084, 5086, 5089, 5106,
+ 5119, 5123, 5127, 5129, 5131, 5133, 5136, 5151,
+ 5168, 5183, 5198, 5213, 5226, 5230, 5234, 5236,
+ 5238, 5240, 5243, 5258, 5273, 5288, 5303, 5317,
+ 5332, 5347, 5362, 5377, 5392, 5407, 5422, 5437,
+ 5450, 5454, 5458, 5460, 5462, 5464, 5467, 5484,
+ 5499, 5514, 5529, 5544, 5559, 5572, 5576, 5580,
+ 5582, 5584, 5586, 5589, 5604, 5619, 5633, 5648,
+ 5663, 5678, 5693, 5708, 5721, 5725, 5729, 5731,
+ 5733, 5735, 5738, 5753, 5768, 5781, 5785, 5789,
+ 5791, 5793, 5795, 5798, 5815, 5830, 5845, 5860,
+ 5875, 5890, 5903, 5907, 5911, 5913, 5915, 5917,
+ 5920, 5935, 5949, 5964, 5979, 5994, 6009, 6024,
+ 6039, 6054, 6069, 6084, 6099, 6114, 6129, 6142,
+ 6146, 6150, 6152, 6154, 6156, 6159, 6176, 6193
+ };
+
+ static const short _thttp_machine_parser_headers_indicies[] = {
+ 0, 0, 0, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 2, 18, 4, 19, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 21, 1, 21, 23, 21, 22, 24,
+ 22, 25, 1, 26, 1, 22, 22, 1,
+ 20, 20, 0, 0, 0, 21, 27, 28,
+ 29, 27, 28, 29, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 30, 30, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 31, 31, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 32,
+ 32, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 33, 33,
+ 0, 0, 0, 0, 0, 0, 1, 34,
+ 34, 0, 0, 0, 35, 0, 36, 0,
+ 0, 0, 0, 0, 1, 34, 34, 36,
+ 1, 36, 38, 36, 37, 39, 37, 40,
+ 1, 41, 1, 37, 37, 1, 20, 20,
+ 0, 0, 0, 21, 42, 43, 44, 42,
+ 43, 44, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 45,
+ 45, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 46, 46,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 47, 47, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 48, 48, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 49, 49, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 50, 50, 0, 0, 0, 0,
+ 0, 0, 1, 51, 51, 0, 0, 0,
+ 52, 0, 0, 0, 0, 0, 0, 1,
+ 51, 51, 52, 1, 52, 54, 52, 53,
+ 55, 53, 56, 1, 57, 1, 53, 53,
+ 1, 20, 20, 0, 0, 0, 21, 58,
+ 58, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 59, 59,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 60, 60, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 61, 61, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 62, 62, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 63, 63, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 64, 64, 0, 0, 0, 0, 0,
+ 0, 1, 65, 65, 0, 0, 0, 66,
+ 0, 0, 0, 0, 0, 0, 1, 65,
+ 65, 66, 1, 66, 68, 66, 67, 69,
+ 67, 70, 1, 71, 1, 67, 67, 1,
+ 20, 20, 0, 0, 0, 21, 72, 72,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 73, 73, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 74, 74, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 75, 75, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 76, 76, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 77, 77, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 78, 78, 0, 0, 0, 0, 0, 0,
+ 1, 79, 79, 0, 0, 0, 80, 0,
+ 0, 0, 0, 0, 0, 1, 79, 79,
+ 80, 1, 80, 82, 80, 81, 83, 81,
+ 84, 1, 85, 1, 81, 81, 1, 20,
+ 20, 0, 0, 0, 21, 86, 86, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 87, 87, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 88, 88, 0, 0, 0,
+ 0, 0, 0, 1, 89, 89, 0, 0,
+ 0, 90, 0, 0, 0, 0, 0, 0,
+ 1, 89, 89, 90, 1, 90, 92, 90,
+ 91, 93, 91, 94, 1, 95, 1, 91,
+ 91, 1, 20, 20, 0, 0, 0, 21,
+ 96, 96, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 97,
+ 97, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 98, 98,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 99, 99, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 100, 100, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 101, 101, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 102, 102, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 103, 103, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 104, 104, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 105,
+ 105, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 106, 106,
+ 0, 0, 0, 0, 0, 0, 1, 107,
+ 107, 0, 0, 0, 108, 0, 0, 0,
+ 0, 0, 0, 1, 107, 107, 108, 1,
+ 108, 110, 108, 109, 111, 109, 112, 1,
+ 113, 1, 109, 109, 1, 20, 20, 0,
+ 0, 0, 21, 114, 115, 114, 115, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 116, 116, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 117, 117, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 118, 118, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 119, 0, 21, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 120,
+ 120, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 121, 121,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 122, 122, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 123, 123, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 124, 124, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 125, 125, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 126, 126, 0, 0, 0, 0, 0,
+ 0, 1, 127, 127, 0, 0, 0, 128,
+ 0, 0, 0, 0, 0, 0, 1, 127,
+ 127, 128, 1, 128, 130, 128, 129, 131,
+ 129, 132, 1, 133, 1, 129, 129, 1,
+ 20, 20, 0, 0, 0, 21, 134, 134,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 135, 136, 135,
+ 136, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 137, 137,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 138, 138, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 139, 139, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 140, 140, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 141, 141, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 142, 142, 0, 0, 0, 0, 0,
+ 0, 1, 143, 143, 0, 0, 0, 144,
+ 0, 0, 0, 0, 0, 0, 1, 143,
+ 143, 144, 1, 144, 146, 144, 145, 147,
+ 145, 148, 1, 149, 1, 145, 145, 1,
+ 20, 20, 0, 0, 0, 21, 150, 150,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 151, 151, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 152, 152, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 153, 0, 21, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 154, 155, 156, 157, 158, 154, 155,
+ 156, 157, 158, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 159, 159, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 160,
+ 160, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 161, 161,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 162, 162, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 163, 163, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 164, 164, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 165, 165, 0, 0, 0, 0,
+ 0, 0, 1, 166, 166, 0, 0, 0,
+ 167, 0, 0, 0, 0, 0, 0, 1,
+ 166, 166, 167, 1, 167, 169, 167, 168,
+ 170, 168, 171, 1, 172, 1, 168, 168,
+ 1, 20, 20, 0, 0, 0, 21, 173,
+ 174, 175, 173, 174, 175, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 176, 176, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 177, 177, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 178, 178, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 179,
+ 179, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 180, 180,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 181, 181, 0,
+ 0, 0, 0, 0, 0, 1, 182, 182,
+ 0, 0, 0, 183, 0, 0, 0, 0,
+ 0, 0, 1, 182, 182, 183, 1, 183,
+ 185, 183, 184, 186, 184, 187, 1, 188,
+ 1, 184, 184, 1, 20, 20, 0, 0,
+ 0, 21, 189, 189, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 190, 190, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 191, 191, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 192,
+ 192, 0, 0, 0, 0, 0, 0, 1,
+ 193, 193, 0, 0, 0, 194, 0, 0,
+ 0, 0, 0, 0, 1, 193, 193, 194,
+ 1, 194, 196, 194, 195, 197, 195, 198,
+ 1, 199, 1, 195, 195, 1, 20, 20,
+ 0, 0, 0, 21, 200, 200, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 201, 201, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 202, 202, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 203, 203, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 204, 204, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 205,
+ 205, 0, 0, 0, 0, 0, 0, 1,
+ 206, 206, 0, 0, 0, 207, 0, 0,
+ 0, 0, 0, 0, 1, 206, 206, 207,
+ 1, 207, 209, 207, 208, 210, 208, 211,
+ 1, 212, 1, 208, 208, 1, 20, 20,
+ 0, 0, 0, 21, 213, 213, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 214, 21, 0, 0, 0, 0,
+ 0, 0, 1, 215, 215, 0, 0, 0,
+ 216, 0, 0, 0, 0, 0, 0, 1,
+ 215, 215, 216, 1, 216, 218, 216, 217,
+ 219, 217, 220, 1, 221, 1, 217, 217,
+ 1, 20, 20, 0, 0, 0, 21, 222,
+ 222, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 223, 223,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 224, 224, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 225, 225, 0, 0,
+ 0, 0, 0, 0, 1, 226, 226, 0,
+ 0, 0, 227, 0, 0, 0, 0, 0,
+ 0, 1, 226, 226, 227, 1, 227, 229,
+ 227, 228, 230, 228, 231, 1, 232, 1,
+ 228, 228, 1, 20, 20, 0, 0, 0,
+ 21, 233, 233, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 234, 234, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 235,
+ 235, 0, 0, 0, 0, 0, 0, 1,
+ 236, 236, 0, 0, 0, 237, 0, 0,
+ 0, 0, 0, 0, 1, 236, 236, 237,
+ 1, 237, 239, 237, 238, 240, 238, 241,
+ 1, 242, 1, 238, 238, 1, 20, 20,
+ 0, 0, 0, 21, 243, 243, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 244, 244, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 245, 245, 0, 0, 0, 0,
+ 0, 0, 1, 246, 246, 0, 0, 0,
+ 247, 0, 0, 0, 0, 0, 0, 1,
+ 246, 246, 247, 1, 247, 249, 247, 248,
+ 250, 248, 251, 1, 252, 1, 248, 248,
+ 1, 20, 20, 0, 0, 0, 21, 253,
+ 254, 253, 254, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 255, 255, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 256,
+ 256, 0, 0, 0, 0, 0, 0, 1,
+ 257, 257, 0, 0, 0, 258, 0, 0,
+ 0, 0, 0, 0, 1, 257, 257, 258,
+ 1, 258, 260, 258, 259, 261, 259, 262,
+ 1, 263, 1, 259, 259, 1, 20, 20,
+ 0, 0, 0, 21, 264, 264, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 265, 266, 265, 266, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 267, 267, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 268, 268, 0, 0, 0,
+ 0, 0, 0, 1, 269, 269, 0, 0,
+ 0, 270, 0, 0, 0, 0, 0, 0,
+ 1, 269, 269, 270, 1, 270, 272, 270,
+ 271, 273, 271, 274, 1, 275, 1, 271,
+ 271, 1, 20, 20, 0, 0, 0, 21,
+ 276, 276, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 277,
+ 277, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 278, 278,
+ 0, 0, 0, 0, 0, 0, 1, 279,
+ 279, 0, 0, 0, 280, 0, 0, 0,
+ 0, 0, 0, 1, 279, 279, 280, 1,
+ 280, 282, 280, 281, 283, 281, 284, 1,
+ 285, 1, 281, 281, 1, 20, 20, 0,
+ 0, 0, 21, 286, 286, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 287, 287, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 288, 288, 0, 0, 0, 0, 0,
+ 0, 1, 289, 289, 0, 0, 0, 290,
+ 0, 0, 0, 0, 0, 0, 1, 289,
+ 289, 290, 1, 290, 292, 290, 291, 293,
+ 291, 294, 1, 295, 1, 291, 291, 1,
+ 20, 20, 0, 0, 0, 21, 296, 296,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 297, 297, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 298, 298, 0, 0,
+ 0, 0, 0, 0, 1, 299, 299, 0,
+ 0, 0, 300, 0, 0, 0, 0, 0,
+ 0, 1, 299, 299, 300, 1, 300, 302,
+ 300, 301, 303, 301, 304, 1, 305, 1,
+ 301, 301, 1, 20, 20, 0, 0, 0,
+ 21, 306, 306, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 307,
+ 0, 21, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 308, 309,
+ 310, 311, 308, 309, 310, 311, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 312, 313, 312, 313, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 314, 314, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 315, 315, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 316, 316, 0, 0, 0, 0,
+ 0, 0, 1, 317, 317, 0, 0, 0,
+ 318, 0, 0, 0, 0, 0, 0, 1,
+ 317, 317, 318, 1, 318, 320, 318, 319,
+ 321, 319, 322, 1, 323, 1, 319, 319,
+ 1, 20, 20, 0, 0, 0, 21, 324,
+ 324, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 325, 325,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 326, 326, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 327, 327, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 328, 328, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 329, 329, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 330, 0, 21, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 331,
+ 331, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 332, 332,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 333, 333, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 334, 334, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 335, 335, 0, 0, 0,
+ 0, 0, 0, 1, 336, 336, 0, 0,
+ 0, 337, 0, 0, 0, 0, 0, 0,
+ 1, 336, 336, 337, 1, 337, 339, 337,
+ 338, 340, 338, 341, 1, 342, 1, 338,
+ 338, 1, 20, 20, 0, 0, 0, 21,
+ 343, 343, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 344,
+ 344, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 345, 345,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 346, 0, 21, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 347, 347, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 348, 348, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 349, 349, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 350, 350, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 351,
+ 351, 0, 0, 0, 0, 0, 0, 1,
+ 352, 352, 0, 0, 0, 353, 0, 0,
+ 0, 0, 0, 0, 1, 352, 352, 353,
+ 1, 353, 355, 353, 354, 356, 354, 357,
+ 1, 358, 1, 354, 354, 1, 20, 20,
+ 0, 0, 0, 21, 359, 359, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 360, 360, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 361, 361, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 362, 362, 0, 0, 0, 0, 0,
+ 0, 1, 363, 363, 0, 0, 0, 364,
+ 0, 0, 0, 0, 0, 0, 1, 363,
+ 363, 364, 1, 364, 366, 364, 365, 367,
+ 365, 368, 1, 369, 1, 365, 365, 1,
+ 20, 20, 0, 0, 0, 21, 370, 370,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 371, 371, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 372, 372, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 373, 373, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 374, 374, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 375, 375, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 376, 376, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 377,
+ 377, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 378, 378,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 379, 0, 21, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 380, 380, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 381, 381, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 382, 382, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 383, 383, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 384,
+ 384, 0, 0, 0, 0, 0, 0, 1,
+ 385, 385, 0, 0, 0, 386, 0, 0,
+ 0, 0, 0, 0, 1, 385, 385, 386,
+ 1, 386, 388, 386, 387, 389, 387, 390,
+ 1, 391, 1, 387, 387, 1, 20, 20,
+ 0, 0, 0, 21, 392, 392, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 393, 393, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 394, 394, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 395, 0, 21, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 396,
+ 396, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 397, 397,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 398, 398, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 399, 399, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 400, 400, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 401, 401, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 402, 402, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 403, 403, 0, 0, 0, 0, 0, 0,
+ 1, 404, 404, 0, 0, 0, 405, 0,
+ 0, 0, 0, 0, 0, 1, 404, 404,
+ 405, 1, 405, 407, 405, 406, 408, 406,
+ 409, 1, 410, 1, 406, 406, 1, 20,
+ 20, 0, 0, 0, 21, 411, 411, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 412, 412, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 413, 0, 21, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 414, 414, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 415, 415, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 416,
+ 416, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 417, 417,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 418, 418, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 419, 419, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 420, 420, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 421, 421, 0, 0, 0, 0,
+ 0, 0, 1, 422, 422, 0, 0, 0,
+ 423, 0, 0, 0, 0, 0, 0, 1,
+ 422, 422, 423, 1, 423, 425, 423, 424,
+ 426, 424, 427, 1, 428, 1, 424, 424,
+ 1, 20, 20, 0, 0, 0, 21, 429,
+ 429, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 430, 431,
+ 430, 431, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 432,
+ 432, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 433, 433,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 434, 434, 0,
+ 0, 0, 0, 0, 0, 1, 435, 435,
+ 0, 0, 0, 436, 0, 0, 0, 0,
+ 0, 0, 1, 435, 435, 436, 1, 436,
+ 438, 436, 437, 439, 437, 440, 1, 441,
+ 1, 437, 437, 1, 20, 20, 0, 0,
+ 0, 21, 442, 442, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 443, 443, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 444,
+ 0, 21, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 445, 445,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 446, 446, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 447, 447, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 448, 448, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 449, 450, 449, 450, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 451, 451, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 452, 452, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 453, 453, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 454, 454, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 455,
+ 455, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 456, 456,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 457, 457, 0,
+ 0, 0, 0, 0, 0, 1, 458, 458,
+ 0, 0, 0, 459, 0, 0, 0, 0,
+ 0, 0, 1, 458, 458, 459, 1, 459,
+ 461, 459, 460, 462, 460, 463, 1, 464,
+ 1, 460, 460, 1, 20, 20, 0, 0,
+ 0, 21, 465, 465, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 466, 466, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 467, 467, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 468,
+ 468, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 469, 469,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 470, 470, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 471, 471, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 472, 472, 0, 0, 0,
+ 0, 0, 0, 1, 473, 473, 0, 0,
+ 0, 474, 0, 0, 0, 0, 0, 0,
+ 1, 473, 473, 474, 1, 474, 476, 474,
+ 475, 477, 475, 478, 1, 479, 1, 475,
+ 475, 1, 20, 20, 0, 0, 0, 21,
+ 480, 481, 480, 481, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 482, 482, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 483, 483, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 484,
+ 484, 0, 0, 0, 0, 0, 0, 1,
+ 485, 485, 0, 0, 0, 486, 0, 0,
+ 0, 0, 0, 0, 1, 485, 485, 486,
+ 1, 486, 488, 486, 487, 489, 487, 490,
+ 1, 491, 1, 487, 487, 1, 20, 20,
+ 0, 0, 0, 21, 492, 492, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 493, 493, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 494, 494, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 495, 495, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 496, 496, 0, 0, 0, 0, 0, 0,
+ 1, 497, 497, 0, 0, 0, 498, 0,
+ 0, 0, 0, 0, 0, 1, 497, 497,
+ 498, 1, 498, 500, 498, 499, 501, 499,
+ 502, 1, 503, 1, 499, 499, 1, 20,
+ 20, 0, 0, 0, 21, 504, 504, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 505, 505, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 506, 0, 21, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 507, 507, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 508, 508, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 509,
+ 509, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 510, 510,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 511, 511, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 512, 512, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 513, 513, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 514, 514, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 515, 515, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 516,
+ 0, 21, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 517, 518,
+ 519, 520, 517, 518, 519, 520, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 521, 521, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 522, 522, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 523, 523, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 524, 524, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 525,
+ 525, 0, 0, 0, 0, 0, 0, 1,
+ 526, 526, 0, 0, 0, 527, 0, 0,
+ 0, 0, 0, 0, 1, 526, 526, 527,
+ 1, 527, 529, 527, 528, 530, 528, 531,
+ 1, 532, 1, 528, 528, 1, 20, 20,
+ 0, 0, 0, 21, 533, 533, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 534, 534, 0, 0, 0,
+ 0, 0, 0, 1, 535, 535, 0, 0,
+ 0, 536, 0, 0, 0, 0, 0, 0,
+ 1, 535, 535, 536, 1, 536, 538, 536,
+ 537, 539, 537, 540, 1, 541, 1, 537,
+ 537, 1, 20, 20, 0, 0, 0, 21,
+ 542, 542, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 543,
+ 543, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 544, 544,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 545, 545, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 546, 546, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 547, 547, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 548, 548, 0, 0, 0, 0,
+ 0, 0, 1, 549, 549, 0, 0, 0,
+ 550, 0, 0, 0, 0, 0, 0, 1,
+ 549, 549, 550, 1, 550, 552, 550, 551,
+ 553, 551, 554, 1, 555, 1, 551, 551,
+ 1, 20, 20, 0, 0, 0, 21, 556,
+ 556, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 557, 557,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 558, 558, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 559, 559, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 560, 560, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 561, 561, 0, 0, 0, 0,
+ 0, 0, 1, 562, 562, 0, 0, 0,
+ 563, 0, 0, 0, 0, 0, 0, 1,
+ 562, 562, 563, 1, 563, 565, 563, 564,
+ 566, 564, 567, 1, 568, 1, 564, 564,
+ 1, 20, 20, 0, 0, 0, 21, 569,
+ 570, 569, 570, 0, 0, 0, 0, 0,
+ 0, 1, 571, 571, 0, 0, 0, 572,
+ 0, 0, 0, 0, 0, 0, 1, 571,
+ 571, 572, 1, 572, 574, 572, 573, 575,
+ 573, 576, 1, 577, 1, 573, 573, 1,
+ 20, 20, 0, 0, 0, 21, 578, 578,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 579, 580, 579,
+ 580, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 581, 581,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 582, 582, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 583, 583, 0, 0,
+ 0, 0, 0, 0, 1, 584, 584, 0,
+ 0, 0, 585, 0, 0, 0, 0, 0,
+ 0, 1, 584, 584, 585, 1, 585, 587,
+ 585, 586, 588, 586, 589, 1, 590, 1,
+ 586, 586, 1, 20, 20, 0, 0, 0,
+ 21, 591, 591, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 592, 592, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 593,
+ 593, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 594, 594,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 595, 0, 21, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 596, 596, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 597, 597, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 598, 598, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 599, 599, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 600,
+ 600, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 601, 601,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 602, 602, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 603, 603, 0, 0,
+ 0, 0, 0, 0, 1, 604, 604, 0,
+ 0, 0, 605, 0, 0, 0, 0, 0,
+ 0, 1, 604, 604, 605, 1, 605, 607,
+ 605, 606, 608, 606, 609, 1, 610, 1,
+ 606, 606, 1, 20, 20, 0, 0, 0,
+ 21, 611, 612, 611, 612, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 613, 613, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 614, 614, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 615, 615, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 616,
+ 616, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 617, 617,
+ 0, 0, 0, 0, 0, 0, 1, 618,
+ 618, 0, 0, 0, 619, 0, 0, 0,
+ 0, 0, 0, 1, 618, 618, 619, 1,
+ 619, 621, 619, 620, 622, 620, 623, 1,
+ 624, 1, 620, 620, 1, 20, 20, 0,
+ 0, 0, 21, 625, 625, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 626, 626, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 627, 0, 21, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 628,
+ 628, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 629, 629,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 630, 630, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 631, 631, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 632, 632, 0, 0, 0,
+ 0, 0, 0, 1, 633, 633, 0, 0,
+ 0, 634, 0, 0, 0, 0, 0, 0,
+ 1, 633, 633, 634, 1, 634, 636, 634,
+ 635, 637, 635, 638, 1, 639, 1, 635,
+ 635, 1, 20, 20, 0, 0, 0, 21,
+ 640, 640, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 641,
+ 641, 0, 0, 0, 0, 0, 0, 1,
+ 642, 642, 0, 0, 0, 643, 0, 0,
+ 0, 0, 0, 0, 1, 642, 642, 643,
+ 1, 643, 645, 643, 644, 646, 644, 647,
+ 1, 648, 1, 644, 644, 1, 20, 20,
+ 0, 0, 0, 21, 649, 650, 649, 650,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 651, 651, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 652, 652, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 653, 653, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 654, 654, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 655, 655, 0, 0, 0, 0, 0,
+ 0, 1, 656, 656, 0, 0, 0, 657,
+ 0, 0, 0, 0, 0, 0, 1, 656,
+ 656, 657, 1, 657, 659, 657, 658, 660,
+ 658, 661, 1, 662, 1, 658, 658, 1,
+ 20, 20, 0, 0, 0, 21, 663, 663,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 664, 0, 21, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 665, 665, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 666, 666, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 667, 667, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 668, 668, 0, 0, 0, 0, 0, 0,
+ 1, 20, 20, 0, 0, 0, 21, 669,
+ 669, 0, 0, 0, 0, 0, 0, 1,
+ 20, 20, 0, 0, 0, 21, 670, 670,
+ 0, 0, 0, 0, 0, 0, 1, 20,
+ 20, 0, 0, 0, 21, 671, 671, 0,
+ 0, 0, 0, 0, 0, 1, 20, 20,
+ 0, 0, 0, 21, 672, 672, 0, 0,
+ 0, 0, 0, 0, 1, 20, 20, 0,
+ 0, 0, 21, 673, 673, 0, 0, 0,
+ 0, 0, 0, 1, 20, 20, 0, 0,
+ 0, 21, 674, 674, 0, 0, 0, 0,
+ 0, 0, 1, 20, 20, 0, 0, 0,
+ 21, 675, 675, 0, 0, 0, 0, 0,
+ 0, 1, 20, 20, 0, 0, 0, 21,
+ 676, 676, 0, 0, 0, 0, 0, 0,
+ 1, 677, 677, 0, 0, 0, 678, 0,
+ 0, 0, 0, 0, 0, 1, 677, 677,
+ 678, 1, 678, 680, 678, 679, 681, 679,
+ 682, 1, 683, 1, 679, 679, 1, 236,
+ 236, 0, 0, 0, 237, 114, 115, 114,
+ 115, 0, 0, 0, 0, 0, 0, 1,
+ 166, 166, 0, 0, 0, 167, 253, 254,
+ 253, 254, 0, 0, 0, 0, 0, 0,
+ 1, 1, 0
+ };
+
+ static const short _thttp_machine_parser_headers_trans_targs[] = {
+ 2, 0, 9, 91, 212, 222, 253, 263,
+ 273, 355, 374, 392, 441, 464, 526, 566,
+ 594, 603, 637, 638, 3, 4, 5, 7,
+ 6, 639, 8, 10, 63, 73, 11, 12,
+ 13, 14, 15, 21, 16, 17, 19, 18,
+ 639, 20, 22, 35, 49, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 33, 32,
+ 639, 34, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 47, 46, 639, 48,
+ 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 61, 60, 639, 62, 64, 65,
+ 66, 67, 68, 69, 71, 70, 639, 72,
+ 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 84, 85, 86, 87, 89, 88,
+ 639, 90, 92, 110, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 108, 107, 639, 109, 111, 112,
+ 125, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 123, 122, 639, 124, 126, 127,
+ 128, 129, 130, 144, 182, 191, 202, 131,
+ 132, 133, 134, 135, 136, 137, 138, 139,
+ 140, 142, 141, 639, 143, 145, 158, 169,
+ 146, 147, 148, 149, 150, 151, 152, 153,
+ 154, 156, 155, 639, 157, 159, 160, 161,
+ 162, 163, 164, 165, 167, 166, 639, 168,
+ 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 180, 179, 639, 181, 183, 184, 185,
+ 186, 187, 189, 188, 639, 190, 192, 193,
+ 194, 195, 196, 197, 198, 200, 199, 639,
+ 201, 203, 204, 205, 206, 207, 208, 210,
+ 209, 639, 211, 213, 214, 215, 216, 217,
+ 218, 220, 219, 639, 221, 223, 232, 224,
+ 225, 226, 227, 228, 230, 229, 639, 231,
+ 233, 234, 243, 235, 236, 237, 238, 239,
+ 241, 240, 639, 242, 244, 245, 246, 247,
+ 248, 249, 251, 250, 639, 252, 254, 255,
+ 256, 257, 258, 259, 261, 260, 639, 262,
+ 264, 265, 266, 267, 268, 269, 271, 270,
+ 639, 272, 274, 275, 276, 306, 322, 333,
+ 277, 287, 278, 279, 280, 281, 282, 283,
+ 285, 284, 639, 286, 288, 289, 290, 291,
+ 292, 293, 294, 295, 296, 297, 298, 299,
+ 300, 301, 302, 304, 303, 639, 305, 307,
+ 308, 309, 310, 311, 312, 313, 314, 315,
+ 316, 317, 318, 320, 319, 639, 321, 323,
+ 324, 325, 326, 327, 328, 329, 331, 330,
+ 639, 332, 334, 335, 336, 337, 338, 339,
+ 340, 341, 342, 343, 344, 345, 346, 347,
+ 348, 349, 350, 351, 353, 352, 639, 354,
+ 356, 357, 358, 359, 360, 361, 362, 363,
+ 364, 365, 366, 367, 368, 369, 370, 372,
+ 371, 639, 373, 375, 376, 377, 378, 379,
+ 380, 381, 382, 383, 384, 385, 386, 387,
+ 388, 390, 389, 639, 391, 393, 394, 404,
+ 395, 396, 397, 398, 399, 400, 402, 401,
+ 639, 403, 405, 406, 407, 408, 409, 410,
+ 411, 412, 426, 413, 414, 415, 416, 417,
+ 418, 419, 420, 421, 422, 424, 423, 639,
+ 425, 427, 428, 429, 430, 431, 432, 433,
+ 434, 435, 436, 437, 439, 438, 639, 440,
+ 442, 452, 443, 444, 445, 446, 447, 448,
+ 450, 449, 639, 451, 453, 454, 455, 456,
+ 457, 458, 459, 460, 462, 461, 639, 463,
+ 465, 466, 467, 468, 469, 470, 471, 472,
+ 473, 474, 475, 476, 477, 478, 490, 499,
+ 513, 479, 480, 481, 482, 483, 484, 485,
+ 486, 488, 487, 639, 489, 491, 492, 493,
+ 494, 495, 497, 496, 639, 498, 500, 501,
+ 502, 503, 504, 505, 506, 507, 508, 509,
+ 511, 510, 639, 512, 514, 515, 516, 517,
+ 518, 519, 520, 521, 522, 524, 523, 639,
+ 525, 527, 534, 528, 529, 530, 532, 531,
+ 639, 533, 535, 536, 546, 537, 538, 539,
+ 540, 541, 542, 544, 543, 639, 545, 547,
+ 548, 549, 550, 551, 552, 553, 554, 555,
+ 556, 557, 558, 559, 560, 561, 562, 564,
+ 563, 639, 565, 567, 579, 568, 569, 570,
+ 571, 572, 573, 574, 575, 577, 576, 639,
+ 578, 580, 581, 582, 583, 584, 585, 586,
+ 587, 588, 589, 590, 592, 591, 639, 593,
+ 595, 596, 597, 598, 599, 601, 600, 639,
+ 602, 604, 616, 605, 606, 607, 608, 609,
+ 610, 611, 612, 614, 613, 639, 615, 617,
+ 618, 619, 620, 621, 622, 623, 624, 625,
+ 626, 627, 628, 629, 630, 631, 632, 633,
+ 635, 634, 639, 636
+ };
+
+ static const char _thttp_machine_parser_headers_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 91, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 13, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 17, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 19, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 21, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 23, 0, 0, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 27,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 29, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 35, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 37, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 39, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 41, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 43, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 47, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 49, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 53, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 55, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 57, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 59,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 61, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 63, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 65, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 67, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 71, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 73,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 75, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 77, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 79, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 81,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 83, 0,
+ 0, 0, 0, 0, 0, 0, 0, 85,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 87, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 89, 0
+ };
+
+ static const int thttp_machine_parser_headers_start = 1;
+ static const int thttp_machine_parser_headers_first_final = 639;
+ static const int thttp_machine_parser_headers_error = 0;
+
+ static const int thttp_machine_parser_headers_en_main = 1;
+
+
+ /* #line 513 "./ragel/thttp_parser_header.rl" */
+ (void)(eof);
+ (void)(thttp_machine_parser_headers_first_final);
+ (void)(thttp_machine_parser_headers_error);
+ (void)(thttp_machine_parser_headers_en_main);
+
+ /* #line 2339 "./src/parsers/thttp_parser_header.c" */
+ {
+ cs = thttp_machine_parser_headers_start;
+ }
+
+ /* #line 518 "./ragel/thttp_parser_header.rl" */
+
+ /* #line 2346 "./src/parsers/thttp_parser_header.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_headers_trans_keys + _thttp_machine_parser_headers_key_offsets[cs];
- _trans = _thttp_machine_parser_headers_index_offsets[cs];
-
- _klen = _thttp_machine_parser_headers_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_headers_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_headers_trans_keys + _thttp_machine_parser_headers_key_offsets[cs];
+ _trans = _thttp_machine_parser_headers_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_headers_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_headers_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_headers_indicies[_trans];
- cs = _thttp_machine_parser_headers_trans_targs[_trans];
-
- if ( _thttp_machine_parser_headers_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_headers_actions + _thttp_machine_parser_headers_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 90 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Accept NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 1:
-/* #line 99 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Accept_Charset NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 2:
-/* #line 108 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Accept_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 3:
-/* #line 117 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Accept_Language NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 4:
-/* #line 126 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Allow NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 5:
-/* #line 135 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Authorization_t *header = thttp_header_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 6:
-/* #line 142 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Cache_Control NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 7:
-/* #line 151 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Connection NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 8:
-/* #line 160 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Content_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 9:
-/* #line 169 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Content_Language NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 10:
-/* #line 178 "./ragel/thttp_parser_header.rl" */
- {
- if(!message->Content_Length){
- message->Content_Length = thttp_header_Content_Length_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("The message already have 'Content-Length' header.");
- }
- }
- break;
- case 11:
-/* #line 191 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Content_Location NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 12:
-/* #line 200 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Content_MD5 NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 13:
-/* #line 209 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Content_Range NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 14:
-/* #line 218 "./ragel/thttp_parser_header.rl" */
- {
- if(!message->Content_Type){
- message->Content_Type = thttp_header_Content_Type_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("The message already have 'Content-Type' header.");
- }
- }
- break;
- case 15:
-/* #line 231 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Date NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 16:
-/* #line 240 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_ETag_t *header = thttp_header_ETag_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Expires NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 17:
-/* #line 249 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Expect NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 18:
-/* #line 258 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Expires NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 19:
-/* #line 267 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_From NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 20:
-/* #line 276 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Host NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 21:
-/* #line 285 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_If_Match NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 22:
-/* #line 294 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_If_Modified_Since NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 23:
-/* #line 303 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_If_None_Match NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 24:
-/* #line 312 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_If_Range NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 25:
-/* #line 321 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_If_Unmodified_Since NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 26:
-/* #line 330 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Last_Modified NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 27:
-/* #line 339 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Max_Forwards NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 28:
-/* #line 348 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Pragma NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 29:
-/* #line 357 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Proxy_Authenticate_t *header = thttp_header_Proxy_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 30:
-/* #line 364 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Proxy_Authorization_t *header = thttp_header_Proxy_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 31:
-/* #line 371 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Range NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 32:
-/* #line 380 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Referer NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 33:
-/* #line 389 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Sec_WebSocket_Accept_t* header = thttp_header_Sec_WebSocket_Accept_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 34:
-/* #line 396 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Sec_WebSocket_Key_t* header = thttp_header_Sec_WebSocket_Key_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 35:
-/* #line 403 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Sec_WebSocket_Protocol_t* header = thttp_header_Sec_WebSocket_Protocol_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 36:
-/* #line 411 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Sec_WebSocket_Version_t* header = thttp_header_Sec_WebSocket_Version_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 37:
-/* #line 418 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_TE NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 38:
-/* #line 427 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Trailer NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 39:
-/* #line 436 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Transfer_Encoding_t *header = thttp_header_Transfer_Encoding_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Trailer NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 40:
-/* #line 445 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Upgrade NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 41:
-/* #line 454 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_User_Agent NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 42:
-/* #line 463 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Via NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 43:
-/* #line 472 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_Warning NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 44:
-/* #line 481 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_WWW_Authenticate_t *header = thttp_header_WWW_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 45:
-/* #line 488 "./ragel/thttp_parser_header.rl" */
- {
- thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
-
- //TSK_DEBUG_WARN("parse_header_extension_header NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
-/* #line 2826 "./src/parsers/thttp_parser_header.c" */
- }
- }
+ _trans = _thttp_machine_parser_headers_indicies[_trans];
+ cs = _thttp_machine_parser_headers_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_headers_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_headers_actions + _thttp_machine_parser_headers_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 90 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Accept NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 1:
+ /* #line 99 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Accept_Charset NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 2:
+ /* #line 108 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Accept_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 3:
+ /* #line 117 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Accept_Language NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 4:
+ /* #line 126 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Allow NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 5:
+ /* #line 135 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Authorization_t *header = thttp_header_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 6:
+ /* #line 142 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Cache_Control NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 7:
+ /* #line 151 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Connection NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 8:
+ /* #line 160 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Content_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 9:
+ /* #line 169 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Content_Language NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 10:
+ /* #line 178 "./ragel/thttp_parser_header.rl" */
+ {
+ if(!message->Content_Length) {
+ message->Content_Length = thttp_header_Content_Length_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("The message already have 'Content-Length' header.");
+ }
+ }
+ break;
+ case 11:
+ /* #line 191 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Content_Location NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 12:
+ /* #line 200 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Content_MD5 NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 13:
+ /* #line 209 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Content_Range NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 14:
+ /* #line 218 "./ragel/thttp_parser_header.rl" */
+ {
+ if(!message->Content_Type) {
+ message->Content_Type = thttp_header_Content_Type_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("The message already have 'Content-Type' header.");
+ }
+ }
+ break;
+ case 15:
+ /* #line 231 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Date NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 16:
+ /* #line 240 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_ETag_t *header = thttp_header_ETag_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Expires NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 17:
+ /* #line 249 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Expect NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 18:
+ /* #line 258 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Expires NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 19:
+ /* #line 267 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_From NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 20:
+ /* #line 276 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Host NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 21:
+ /* #line 285 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_If_Match NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 22:
+ /* #line 294 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_If_Modified_Since NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 23:
+ /* #line 303 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_If_None_Match NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 24:
+ /* #line 312 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_If_Range NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 25:
+ /* #line 321 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_If_Unmodified_Since NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 26:
+ /* #line 330 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Last_Modified NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 27:
+ /* #line 339 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Max_Forwards NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 28:
+ /* #line 348 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Pragma NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 29:
+ /* #line 357 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Proxy_Authenticate_t *header = thttp_header_Proxy_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 30:
+ /* #line 364 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Proxy_Authorization_t *header = thttp_header_Proxy_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 31:
+ /* #line 371 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Range NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 32:
+ /* #line 380 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Referer NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 33:
+ /* #line 389 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Sec_WebSocket_Accept_t* header = thttp_header_Sec_WebSocket_Accept_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 34:
+ /* #line 396 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Sec_WebSocket_Key_t* header = thttp_header_Sec_WebSocket_Key_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 35:
+ /* #line 403 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Sec_WebSocket_Protocol_t* header = thttp_header_Sec_WebSocket_Protocol_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 36:
+ /* #line 411 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Sec_WebSocket_Version_t* header = thttp_header_Sec_WebSocket_Version_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 37:
+ /* #line 418 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_TE NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 38:
+ /* #line 427 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Trailer NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 39:
+ /* #line 436 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Transfer_Encoding_t *header = thttp_header_Transfer_Encoding_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Trailer NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 40:
+ /* #line 445 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Upgrade NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 41:
+ /* #line 454 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_User_Agent NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 42:
+ /* #line 463 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Via NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 43:
+ /* #line 472 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_Warning NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 44:
+ /* #line 481 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_WWW_Authenticate_t *header = thttp_header_WWW_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 45:
+ /* #line 488 "./ragel/thttp_parser_header.rl" */
+ {
+ thttp_header_Dummy_t *header = thttp_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+
+ //TSK_DEBUG_WARN("parse_header_extension_header NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ /* #line 2826 "./src/parsers/thttp_parser_header.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 519 "./ragel/thttp_parser_header.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- return ( cs >=
-/* #line 2843 "./src/parsers/thttp_parser_header.c" */
-639
-/* #line 521 "./ragel/thttp_parser_header.rl" */
- ) ? 0 : -1;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 519 "./ragel/thttp_parser_header.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ return ( cs >=
+ /* #line 2843 "./src/parsers/thttp_parser_header.c" */
+ 639
+ /* #line 521 "./ragel/thttp_parser_header.rl" */
+ ) ? 0 : -1;
}
diff --git a/tinyHTTP/src/parsers/thttp_parser_message.c b/tinyHTTP/src/parsers/thttp_parser_message.c
index 2b6568d..b2c4fdc 100755
--- a/tinyHTTP/src/parsers/thttp_parser_message.c
+++ b/tinyHTTP/src/parsers/thttp_parser_message.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_message.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,109 +48,109 @@ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
/* #line 50 "./src/parsers/thttp_parser_message.c" */
static const char _thttp_machine_parser_message_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 2, 0, 5, 2, 6, 0
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 2, 0, 5, 2, 6, 0
};
static const unsigned char _thttp_machine_parser_message_key_offsets[] = {
- 0, 0, 16, 31, 31, 32, 34, 36,
- 38, 40, 41, 43, 46, 48, 51, 52,
- 53, 54, 55, 56, 57, 74, 91, 108,
- 122, 124, 127, 129, 132, 134, 136, 138,
- 139, 155, 171, 177, 183
+ 0, 0, 16, 31, 31, 32, 34, 36,
+ 38, 40, 41, 43, 46, 48, 51, 52,
+ 53, 54, 55, 56, 57, 74, 91, 108,
+ 122, 124, 127, 129, 132, 134, 136, 138,
+ 139, 155, 171, 177, 183
};
static const char _thttp_machine_parser_message_trans_keys[] = {
- 33, 37, 39, 72, 104, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 32,
- 72, 104, 84, 116, 84, 116, 80, 112,
- 47, 48, 57, 46, 48, 57, 48, 57,
- 13, 48, 57, 10, 13, 13, 10, 13,
- 10, 32, 33, 37, 39, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 33, 37, 39, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 32, 33, 37, 39, 80,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 33, 37, 39,
- 47, 126, 42, 43, 45, 57, 65, 90,
- 95, 122, 48, 57, 46, 48, 57, 48,
- 57, 32, 48, 57, 48, 57, 48, 57,
- 48, 57, 32, 13, 37, 60, 62, 96,
- 127, 0, 8, 10, 31, 34, 35, 91,
- 94, 123, 125, 13, 37, 60, 62, 96,
- 127, 0, 8, 10, 31, 34, 35, 91,
- 94, 123, 125, 48, 57, 65, 70, 97,
- 102, 48, 57, 65, 70, 97, 102, 0
+ 33, 37, 39, 72, 104, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 32,
+ 72, 104, 84, 116, 84, 116, 80, 112,
+ 47, 48, 57, 46, 48, 57, 48, 57,
+ 13, 48, 57, 10, 13, 13, 10, 13,
+ 10, 32, 33, 37, 39, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 33, 37, 39, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 32, 33, 37, 39, 80,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 33, 37, 39,
+ 47, 126, 42, 43, 45, 57, 65, 90,
+ 95, 122, 48, 57, 46, 48, 57, 48,
+ 57, 32, 48, 57, 48, 57, 48, 57,
+ 48, 57, 32, 13, 37, 60, 62, 96,
+ 127, 0, 8, 10, 31, 34, 35, 91,
+ 94, 123, 125, 13, 37, 60, 62, 96,
+ 127, 0, 8, 10, 31, 34, 35, 91,
+ 94, 123, 125, 48, 57, 65, 70, 97,
+ 102, 48, 57, 65, 70, 97, 102, 0
};
static const char _thttp_machine_parser_message_single_lengths[] = {
- 0, 6, 5, 0, 1, 2, 2, 2,
- 2, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 7, 7, 7, 6,
- 0, 1, 0, 1, 0, 0, 0, 1,
- 6, 6, 0, 0, 0
+ 0, 6, 5, 0, 1, 2, 2, 2,
+ 2, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 7, 7, 7, 6,
+ 0, 1, 0, 1, 0, 0, 0, 1,
+ 6, 6, 0, 0, 0
};
static const char _thttp_machine_parser_message_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 4,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 5, 5, 3, 3, 0
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 4,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 5, 5, 3, 3, 0
};
static const unsigned char _thttp_machine_parser_message_index_offsets[] = {
- 0, 0, 12, 23, 24, 26, 29, 32,
- 35, 38, 40, 42, 45, 47, 50, 52,
- 54, 56, 58, 60, 62, 75, 88, 101,
- 112, 114, 117, 119, 122, 124, 126, 128,
- 130, 142, 154, 158, 162
+ 0, 0, 12, 23, 24, 26, 29, 32,
+ 35, 38, 40, 42, 45, 47, 50, 52,
+ 54, 56, 58, 60, 62, 75, 88, 101,
+ 112, 114, 117, 119, 122, 124, 126, 128,
+ 130, 142, 154, 158, 162
};
static const char _thttp_machine_parser_message_indicies[] = {
- 0, 0, 0, 2, 2, 0, 0, 0,
- 0, 0, 0, 1, 3, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 1, 5,
- 7, 6, 8, 8, 1, 9, 9, 1,
- 10, 10, 1, 11, 11, 1, 12, 1,
- 13, 1, 14, 13, 1, 15, 1, 16,
- 15, 1, 17, 1, 19, 18, 21, 20,
- 22, 1, 24, 23, 25, 1, 3, 4,
- 4, 4, 26, 26, 4, 4, 4, 4,
- 4, 4, 1, 3, 4, 4, 4, 27,
- 27, 4, 4, 4, 4, 4, 4, 1,
- 3, 4, 4, 4, 28, 28, 4, 4,
- 4, 4, 4, 4, 1, 3, 4, 4,
- 4, 29, 4, 4, 4, 4, 4, 1,
- 30, 1, 31, 30, 1, 32, 1, 33,
- 32, 1, 34, 1, 35, 1, 36, 1,
- 37, 1, 39, 40, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 38, 42, 43,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 41, 44, 44, 44, 1, 41, 41,
- 41, 1, 45, 0
+ 0, 0, 0, 2, 2, 0, 0, 0,
+ 0, 0, 0, 1, 3, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 1, 5,
+ 7, 6, 8, 8, 1, 9, 9, 1,
+ 10, 10, 1, 11, 11, 1, 12, 1,
+ 13, 1, 14, 13, 1, 15, 1, 16,
+ 15, 1, 17, 1, 19, 18, 21, 20,
+ 22, 1, 24, 23, 25, 1, 3, 4,
+ 4, 4, 26, 26, 4, 4, 4, 4,
+ 4, 4, 1, 3, 4, 4, 4, 27,
+ 27, 4, 4, 4, 4, 4, 4, 1,
+ 3, 4, 4, 4, 28, 28, 4, 4,
+ 4, 4, 4, 4, 1, 3, 4, 4,
+ 4, 29, 4, 4, 4, 4, 4, 1,
+ 30, 1, 31, 30, 1, 32, 1, 33,
+ 32, 1, 34, 1, 35, 1, 36, 1,
+ 37, 1, 39, 40, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 38, 42, 43,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 41, 44, 44, 44, 1, 41, 41,
+ 41, 1, 45, 0
};
static const char _thttp_machine_parser_message_trans_targs[] = {
- 2, 0, 20, 3, 2, 4, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 19, 16, 17, 18, 16,
- 19, 36, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 14,
- 34, 33, 14, 34, 35, 36
+ 2, 0, 20, 3, 2, 4, 4, 5,
+ 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 19, 16, 17, 18, 16,
+ 19, 36, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 14,
+ 34, 33, 14, 34, 35, 36
};
static const char _thttp_machine_parser_message_trans_actions[] = {
- 1, 0, 1, 3, 0, 1, 0, 5,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 7, 0, 1, 0, 0, 0, 0, 20,
- 13, 15, 0, 0, 0, 0, 0, 0,
- 0, 7, 1, 0, 0, 9, 1, 17,
- 1, 0, 11, 0, 0, 0
+ 1, 0, 1, 3, 0, 1, 0, 5,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 7, 0, 1, 0, 0, 0, 0, 20,
+ 13, 15, 0, 0, 0, 0, 0, 0,
+ 0, 7, 1, 0, 0, 9, 1, 17,
+ 1, 0, 11, 0, 0, 0
};
static const int thttp_machine_parser_message_start = 1;
@@ -170,295 +170,306 @@ TSK_RAGEL_DISABLE_WARNINGS_END()
* @param extract_content Indicates wheteher to parse the message content or not. If set to true, then
* only headers will be parsed.
*
- * @retval Zero if succeed and non-zero error code otherwise.
+ * @retval Zero if succeed and non-zero error code otherwise.
**/
int thttp_message_parse(tsk_ragel_state_t *state, thttp_message_t **result, tsk_bool_t extract_content)
{
- if(!state || state->pe <= state->p){
- return -1;
- }
-
- if(!*result){
- *result = thttp_message_create();
- }
-
- /* Ragel init */
- thttp_message_parser_init(state);
-
- /*
- * State mechine execution.
- */
- thttp_message_parser_execute(state, *result, extract_content);
-
- /* Check result */
-
- if( state->cs <
-/* #line 197 "./src/parsers/thttp_parser_message.c" */
-36
-/* #line 196 "./ragel/thttp_parser_message.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse HTTP message.");
- TSK_OBJECT_SAFE_FREE(*result);
- return -2;
- }
- return 0;
+ if(!state || state->pe <= state->p) {
+ return -1;
+ }
+
+ if(!*result) {
+ *result = thttp_message_create();
+ }
+
+ /* Ragel init */
+ thttp_message_parser_init(state);
+
+ /*
+ * State mechine execution.
+ */
+ thttp_message_parser_execute(state, *result, extract_content);
+
+ /* Check result */
+
+ if( state->cs <
+ /* #line 197 "./src/parsers/thttp_parser_message.c" */
+ 36
+ /* #line 196 "./ragel/thttp_parser_message.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse HTTP message.");
+ TSK_OBJECT_SAFE_FREE(*result);
+ return -2;
+ }
+ return 0;
}
static void thttp_message_parser_init(tsk_ragel_state_t *state)
{
- int cs = 0;
-
- /* Regel machine initialization. */
-
-/* #line 215 "./src/parsers/thttp_parser_message.c" */
- {
- cs = thttp_machine_parser_message_start;
- }
-
-/* #line 211 "./ragel/thttp_parser_message.rl" */
-
- state->cs = cs;
+ int cs = 0;
+
+ /* Regel machine initialization. */
+
+ /* #line 215 "./src/parsers/thttp_parser_message.c" */
+ {
+ cs = thttp_machine_parser_message_start;
+ }
+
+ /* #line 211 "./ragel/thttp_parser_message.rl" */
+
+ state->cs = cs;
}
static void thttp_message_parser_execute(tsk_ragel_state_t *state, thttp_message_t *message, tsk_bool_t extract_content)
{
- int cs = state->cs;
- const char *p = state->p;
- const char *pe = state->pe;
- const char *eof = state->eof;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 234 "./src/parsers/thttp_parser_message.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = state->cs;
+ const char *p = state->p;
+ const char *pe = state->pe;
+ const char *eof = state->eof;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 234 "./src/parsers/thttp_parser_message.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_message_trans_keys + _thttp_machine_parser_message_key_offsets[cs];
- _trans = _thttp_machine_parser_message_index_offsets[cs];
-
- _klen = _thttp_machine_parser_message_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_message_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_message_trans_keys + _thttp_machine_parser_message_key_offsets[cs];
+ _trans = _thttp_machine_parser_message_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_message_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_message_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_message_indicies[_trans];
- cs = _thttp_machine_parser_message_trans_targs[_trans];
-
- if ( _thttp_machine_parser_message_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_message_actions + _thttp_machine_parser_message_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/thttp_parser_message.rl" */
- {
- state->tag_start = p;
- }
- break;
- case 1:
-/* #line 48 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(message->type == thttp_unknown){
- message->type = thttp_request;
- if(!message->line.request.method){
- message->line.request.method = tsk_calloc(1, len+1);
- memcpy(message->line.request.method, state->tag_start, len);
- }
- }
- else{
- state->cs = thttp_machine_parser_message_error;
- }
- }
- break;
- case 2:
-/* #line 66 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->line.request.url){
- message->line.request.url = thttp_url_parse(state->tag_start, (tsk_size_t)len);
- }
- }
- break;
- case 3:
-/* #line 77 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->http_version){
- message->http_version = tsk_calloc(1, len+1);
- memcpy(message->http_version, state->tag_start, len);
- }
- }
- break;
- case 4:
-/* #line 89 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(message->type == thttp_unknown){
- message->type = thttp_response;
- message->line.response.status_code = atoi(state->tag_start);
- }
- else{
- state->cs = thttp_machine_parser_message_error;
- }
- }
- break;
- case 5:
-/* #line 104 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->line.response.reason_phrase){
- message->line.response.reason_phrase = tsk_calloc(1, len+1);
- memcpy(message->line.response.reason_phrase, state->tag_start, len);
- }
- }
- break;
- case 6:
-/* #line 116 "./ragel/thttp_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(thttp_header_parse(state, message)){
- TSK_DEBUG_ERROR("Failed to parse header - %s", state->tag_start);
- }
- else{
- //TSK_DEBUG_INFO("THTTP_MESSAGE_PARSER::PARSE_HEADER len=%d state=%d", len, state->cs);
- }
- }
- break;
- case 7:
-/* #line 139 "./ragel/thttp_parser_message.rl" */
- {
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
-
- thttp_message_parser_eoh(state, message, extract_content);
-
- cs = state->cs;
- p = state->p;
- pe = state->pe;
- eof = state->eof;
- }
- break;
-/* #line 418 "./src/parsers/thttp_parser_message.c" */
- }
- }
+ _trans = _thttp_machine_parser_message_indicies[_trans];
+ cs = _thttp_machine_parser_message_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_message_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_message_actions + _thttp_machine_parser_message_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/thttp_parser_message.rl" */
+ {
+ state->tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 48 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(message->type == thttp_unknown) {
+ message->type = thttp_request;
+ if(!message->line.request.method) {
+ message->line.request.method = tsk_calloc(1, len+1);
+ memcpy(message->line.request.method, state->tag_start, len);
+ }
+ }
+ else {
+ state->cs = thttp_machine_parser_message_error;
+ }
+ }
+ break;
+ case 2:
+ /* #line 66 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->line.request.url) {
+ message->line.request.url = thttp_url_parse(state->tag_start, (tsk_size_t)len);
+ }
+ }
+ break;
+ case 3:
+ /* #line 77 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->http_version) {
+ message->http_version = tsk_calloc(1, len+1);
+ memcpy(message->http_version, state->tag_start, len);
+ }
+ }
+ break;
+ case 4:
+ /* #line 89 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(message->type == thttp_unknown) {
+ message->type = thttp_response;
+ message->line.response.status_code = atoi(state->tag_start);
+ }
+ else {
+ state->cs = thttp_machine_parser_message_error;
+ }
+ }
+ break;
+ case 5:
+ /* #line 104 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->line.response.reason_phrase) {
+ message->line.response.reason_phrase = tsk_calloc(1, len+1);
+ memcpy(message->line.response.reason_phrase, state->tag_start, len);
+ }
+ }
+ break;
+ case 6:
+ /* #line 116 "./ragel/thttp_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(thttp_header_parse(state, message)) {
+ TSK_DEBUG_ERROR("Failed to parse header - %s", state->tag_start);
+ }
+ else {
+ //TSK_DEBUG_INFO("THTTP_MESSAGE_PARSER::PARSE_HEADER len=%d state=%d", len, state->cs);
+ }
+ }
+ break;
+ case 7:
+ /* #line 139 "./ragel/thttp_parser_message.rl" */
+ {
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
+
+ thttp_message_parser_eoh(state, message, extract_content);
+
+ cs = state->cs;
+ p = state->p;
+ pe = state->pe;
+ eof = state->eof;
+ }
+ break;
+ /* #line 418 "./src/parsers/thttp_parser_message.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 224 "./ragel/thttp_parser_message.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 224 "./ragel/thttp_parser_message.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
}
static void thttp_message_parser_eoh(tsk_ragel_state_t *state, thttp_message_t *message, tsk_bool_t extract_content)
{
- int cs = state->cs;
- const char *p = state->p;
- const char *pe = state->pe;
- const char *eof = state->eof;
-
- if(extract_content && message){
- uint32_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message);
- if(clen){
- if((p + clen)<pe && !message->Content){
- message->Content = tsk_buffer_create((p+1), clen);
- p = (p + clen);
- }
- else{
- p = (pe - 1);
- }
- }
- }
- //%%write eof;
-
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
+ int cs = state->cs;
+ const char *p = state->p;
+ const char *pe = state->pe;
+ const char *eof = state->eof;
+
+ if(extract_content && message) {
+ uint32_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message);
+ if(clen) {
+ if((p + clen)<pe && !message->Content) {
+ message->Content = tsk_buffer_create((p+1), clen);
+ p = (p + clen);
+ }
+ else {
+ p = (pe - 1);
+ }
+ }
+ }
+ //%%write eof;
+
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
}
diff --git a/tinyHTTP/src/parsers/thttp_parser_url.c b/tinyHTTP/src/parsers/thttp_parser_url.c
index c45d0d2..9079a7b 100755
--- a/tinyHTTP/src/parsers/thttp_parser_url.c
+++ b/tinyHTTP/src/parsers/thttp_parser_url.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/thttp_parser_url.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,451 +50,471 @@
**/
thttp_url_t *thttp_url_parse(const char *urlstring, tsk_size_t length)
{
- tsk_bool_t have_port = tsk_false;
- int cs = 0;
- const char *p = urlstring;
- const char *pe = p + length;
- const char *eof = pe;
-
- const char *ts = 0, *te = 0;
- int act =0;
-
- thttp_url_t *url = thttp_url_create(thttp_url_unknown);
-
- const char *tag_start = 0;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 69 "./src/parsers/thttp_parser_url.c" */
-static const char _thttp_machine_parser_url_actions[] = {
- 0, 1, 1, 1, 2, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 2,
- 0, 4, 2, 0, 8, 2, 0, 9,
- 2, 0, 10, 2, 6, 10, 2, 7,
- 10, 2, 8, 10, 3, 0, 3, 5,
- 3, 0, 5, 10, 3, 0, 8, 10
-
-};
-
-static const short _thttp_machine_parser_url_key_offsets[] = {
- 0, 0, 8, 15, 23, 29, 36, 38,
- 44, 52, 58, 66, 72, 80, 88, 96,
- 104, 112, 120, 123, 124, 131, 139, 147,
- 155, 157, 164, 173, 175, 178, 180, 183,
- 185, 188, 191, 192, 195, 196, 199, 200,
- 209, 218, 226, 234, 242, 250, 252, 258,
- 267, 276, 285, 287, 290, 293, 294, 295,
- 298, 308, 309, 310, 310, 310, 320, 328,
- 331, 341, 351, 361, 373, 385, 397, 409,
- 417, 419
-};
-
-static const char _thttp_machine_parser_url_trans_keys[] = {
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 48, 57, 65, 90, 97, 122, 45,
- 46, 48, 57, 65, 90, 97, 122, 48,
- 57, 65, 90, 97, 122, 45, 48, 57,
- 65, 90, 97, 122, 48, 57, 48, 57,
- 65, 90, 97, 122, 45, 46, 48, 57,
- 65, 90, 97, 122, 48, 57, 65, 90,
- 97, 122, 45, 46, 48, 57, 65, 90,
- 97, 122, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 47, 48, 57, 47, 58, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 58, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 46, 48, 57, 46, 46, 48, 57, 46,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 46, 48, 57, 46, 58, 47,
- 48, 57, 47, 72, 91, 104, 48, 57,
- 65, 90, 97, 122, 63, 63, 45, 46,
- 47, 58, 48, 57, 65, 90, 97, 122,
- 47, 58, 48, 57, 65, 90, 97, 122,
- 47, 48, 57, 45, 46, 47, 58, 48,
- 57, 65, 90, 97, 122, 45, 46, 47,
- 58, 48, 57, 65, 90, 97, 122, 45,
- 46, 47, 58, 48, 57, 65, 90, 97,
- 122, 45, 46, 47, 58, 84, 116, 48,
- 57, 65, 90, 97, 122, 45, 46, 47,
- 58, 84, 116, 48, 57, 65, 90, 97,
- 122, 45, 46, 47, 58, 80, 112, 48,
- 57, 65, 90, 97, 122, 45, 46, 47,
- 58, 83, 115, 48, 57, 65, 90, 97,
- 122, 47, 91, 48, 57, 65, 90, 97,
- 122, 47, 58, 45, 46, 47, 58, 48,
- 57, 65, 90, 97, 122, 0
-};
-
-static const char _thttp_machine_parser_url_single_lengths[] = {
- 0, 2, 1, 2, 0, 1, 0, 0,
- 2, 0, 2, 0, 2, 2, 2, 2,
- 2, 2, 1, 1, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 3,
- 3, 2, 2, 2, 2, 2, 0, 3,
- 3, 3, 0, 1, 1, 1, 1, 1,
- 4, 1, 1, 0, 0, 4, 2, 1,
- 4, 4, 4, 6, 6, 6, 6, 2,
- 2, 4
-};
-
-static const char _thttp_machine_parser_url_range_lengths[] = {
- 0, 3, 3, 3, 3, 3, 1, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 1, 0, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 1,
- 3, 0, 0, 0, 0, 3, 3, 1,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 0, 3
-};
-
-static const short _thttp_machine_parser_url_index_offsets[] = {
- 0, 0, 6, 11, 17, 21, 26, 28,
- 32, 38, 42, 48, 52, 58, 64, 70,
- 76, 82, 88, 91, 93, 98, 104, 110,
- 116, 119, 124, 131, 133, 136, 138, 141,
- 143, 146, 149, 151, 154, 156, 159, 161,
- 168, 175, 181, 187, 193, 199, 202, 206,
- 213, 220, 227, 229, 232, 235, 237, 239,
- 242, 250, 252, 254, 255, 256, 264, 270,
- 273, 281, 289, 297, 307, 317, 327, 337,
- 343, 346
-};
-
-static const char _thttp_machine_parser_url_indicies[] = {
- 0, 2, 3, 4, 4, 1, 0, 4,
- 4, 4, 1, 0, 5, 4, 4, 4,
- 1, 4, 6, 6, 1, 7, 6, 6,
- 6, 1, 8, 1, 9, 6, 6, 1,
- 0, 10, 11, 4, 4, 1, 12, 6,
- 6, 1, 0, 13, 14, 4, 4, 1,
- 15, 6, 6, 1, 0, 13, 16, 4,
- 4, 1, 0, 13, 4, 4, 4, 1,
- 0, 10, 17, 4, 4, 1, 0, 10,
- 4, 4, 4, 1, 0, 2, 18, 4,
- 4, 1, 0, 2, 4, 4, 4, 1,
- 19, 8, 1, 20, 1, 22, 21, 21,
- 21, 1, 24, 25, 23, 23, 23, 1,
- 24, 25, 26, 26, 26, 1, 24, 25,
- 27, 27, 27, 1, 24, 25, 1, 29,
- 28, 21, 21, 1, 30, 24, 25, 31,
- 23, 23, 1, 32, 1, 33, 34, 1,
- 35, 1, 36, 37, 1, 38, 1, 25,
- 39, 1, 25, 40, 1, 25, 1, 36,
- 41, 1, 36, 1, 33, 42, 1, 33,
- 1, 30, 24, 25, 43, 26, 26, 1,
- 30, 24, 25, 27, 27, 27, 1, 45,
- 25, 44, 44, 44, 1, 47, 25, 46,
- 46, 46, 1, 47, 25, 48, 48, 48,
- 1, 47, 25, 49, 49, 49, 1, 47,
- 25, 1, 50, 44, 44, 1, 30, 47,
- 25, 51, 46, 46, 1, 30, 47, 25,
- 52, 48, 48, 1, 30, 47, 25, 49,
- 49, 49, 1, 53, 1, 30, 54, 1,
- 30, 55, 1, 30, 1, 29, 1, 56,
- 8, 1, 57, 60, 61, 60, 58, 59,
- 59, 1, 63, 62, 65, 64, 66, 67,
- 7, 68, 69, 70, 6, 6, 6, 1,
- 69, 70, 4, 6, 6, 1, 71, 72,
- 1, 0, 5, 69, 70, 73, 4, 4,
- 1, 0, 5, 69, 70, 74, 4, 4,
- 1, 0, 5, 69, 70, 4, 4, 4,
- 1, 7, 68, 69, 70, 75, 75, 6,
- 6, 6, 1, 7, 68, 69, 70, 76,
- 76, 6, 6, 6, 1, 7, 68, 69,
- 70, 77, 77, 6, 6, 6, 1, 7,
- 68, 69, 78, 79, 79, 6, 6, 6,
- 1, 57, 61, 58, 59, 59, 1, 69,
- 70, 1, 7, 68, 69, 80, 6, 6,
- 6, 1, 0
-};
-
-static const char _thttp_machine_parser_url_trans_targs[] = {
- 2, 0, 7, 16, 3, 4, 61, 5,
- 63, 8, 9, 14, 10, 11, 12, 64,
- 13, 15, 17, 19, 71, 21, 54, 22,
- 25, 72, 23, 24, 26, 41, 27, 39,
- 28, 29, 37, 30, 31, 35, 32, 33,
- 34, 36, 38, 40, 42, 50, 43, 46,
- 44, 45, 47, 48, 49, 51, 52, 53,
- 19, 57, 1, 61, 67, 20, 58, 59,
- 58, 59, 60, 60, 62, 57, 6, 57,
- 63, 65, 66, 68, 69, 70, 18, 73,
- 55
-};
-
-static const char _thttp_machine_parser_url_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 13, 0,
- 24, 0, 0, 0, 0, 0, 0, 13,
- 0, 0, 0, 1, 13, 0, 0, 0,
- 0, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 13, 36, 40, 40, 15, 24, 44,
- 13, 33, 24, 13, 13, 27, 5, 30,
- 13, 13, 13, 13, 13, 13, 5, 13,
- 5
-};
-
-static const char _thttp_machine_parser_url_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 18, 9, 21, 11, 5, 5, 7,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 5, 5
-};
-
-static const int thttp_machine_parser_url_start = 56;
-static const int thttp_machine_parser_url_first_final = 56;
-static const int thttp_machine_parser_url_error = 0;
-
-static const int thttp_machine_parser_url_en_main = 56;
-
-
-/* #line 114 "./ragel/thttp_parser_url.rl" */
- (void)(ts);
- (void)(te);
- (void)(act);
- (void)(eof);
- (void)(thttp_machine_parser_url_first_final);
- (void)(thttp_machine_parser_url_error);
- (void)(thttp_machine_parser_url_en_main);
-
-/* #line 294 "./src/parsers/thttp_parser_url.c" */
- {
- cs = thttp_machine_parser_url_start;
- }
-
-/* #line 122 "./ragel/thttp_parser_url.rl" */
-
-/* #line 301 "./src/parsers/thttp_parser_url.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ tsk_bool_t have_port = tsk_false;
+ int cs = 0;
+ const char *p = urlstring;
+ const char *pe = p + length;
+ const char *eof = pe;
+
+ const char *ts = 0, *te = 0;
+ int act =0;
+
+ thttp_url_t *url = thttp_url_create(thttp_url_unknown);
+
+ const char *tag_start = 0;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 69 "./src/parsers/thttp_parser_url.c" */
+ static const char _thttp_machine_parser_url_actions[] = {
+ 0, 1, 1, 1, 2, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 2,
+ 0, 4, 2, 0, 8, 2, 0, 9,
+ 2, 0, 10, 2, 6, 10, 2, 7,
+ 10, 2, 8, 10, 3, 0, 3, 5,
+ 3, 0, 5, 10, 3, 0, 8, 10
+
+ };
+
+ static const short _thttp_machine_parser_url_key_offsets[] = {
+ 0, 0, 8, 15, 23, 29, 36, 38,
+ 44, 52, 58, 66, 72, 80, 88, 96,
+ 104, 112, 120, 123, 124, 131, 139, 147,
+ 155, 157, 164, 173, 175, 178, 180, 183,
+ 185, 188, 191, 192, 195, 196, 199, 200,
+ 209, 218, 226, 234, 242, 250, 252, 258,
+ 267, 276, 285, 287, 290, 293, 294, 295,
+ 298, 308, 309, 310, 310, 310, 320, 328,
+ 331, 341, 351, 361, 373, 385, 397, 409,
+ 417, 419
+ };
+
+ static const char _thttp_machine_parser_url_trans_keys[] = {
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 48, 57, 65, 90, 97, 122, 45,
+ 46, 48, 57, 65, 90, 97, 122, 48,
+ 57, 65, 90, 97, 122, 45, 48, 57,
+ 65, 90, 97, 122, 48, 57, 48, 57,
+ 65, 90, 97, 122, 45, 46, 48, 57,
+ 65, 90, 97, 122, 48, 57, 65, 90,
+ 97, 122, 45, 46, 48, 57, 65, 90,
+ 97, 122, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 47, 48, 57, 47, 58, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 58, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 46, 48, 57, 46, 46, 48, 57, 46,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 46, 48, 57, 46, 58, 47,
+ 48, 57, 47, 72, 91, 104, 48, 57,
+ 65, 90, 97, 122, 63, 63, 45, 46,
+ 47, 58, 48, 57, 65, 90, 97, 122,
+ 47, 58, 48, 57, 65, 90, 97, 122,
+ 47, 48, 57, 45, 46, 47, 58, 48,
+ 57, 65, 90, 97, 122, 45, 46, 47,
+ 58, 48, 57, 65, 90, 97, 122, 45,
+ 46, 47, 58, 48, 57, 65, 90, 97,
+ 122, 45, 46, 47, 58, 84, 116, 48,
+ 57, 65, 90, 97, 122, 45, 46, 47,
+ 58, 84, 116, 48, 57, 65, 90, 97,
+ 122, 45, 46, 47, 58, 80, 112, 48,
+ 57, 65, 90, 97, 122, 45, 46, 47,
+ 58, 83, 115, 48, 57, 65, 90, 97,
+ 122, 47, 91, 48, 57, 65, 90, 97,
+ 122, 47, 58, 45, 46, 47, 58, 48,
+ 57, 65, 90, 97, 122, 0
+ };
+
+ static const char _thttp_machine_parser_url_single_lengths[] = {
+ 0, 2, 1, 2, 0, 1, 0, 0,
+ 2, 0, 2, 0, 2, 2, 2, 2,
+ 2, 2, 1, 1, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 3,
+ 3, 2, 2, 2, 2, 2, 0, 3,
+ 3, 3, 0, 1, 1, 1, 1, 1,
+ 4, 1, 1, 0, 0, 4, 2, 1,
+ 4, 4, 4, 6, 6, 6, 6, 2,
+ 2, 4
+ };
+
+ static const char _thttp_machine_parser_url_range_lengths[] = {
+ 0, 3, 3, 3, 3, 3, 1, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 1, 0, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 1,
+ 3, 0, 0, 0, 0, 3, 3, 1,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 0, 3
+ };
+
+ static const short _thttp_machine_parser_url_index_offsets[] = {
+ 0, 0, 6, 11, 17, 21, 26, 28,
+ 32, 38, 42, 48, 52, 58, 64, 70,
+ 76, 82, 88, 91, 93, 98, 104, 110,
+ 116, 119, 124, 131, 133, 136, 138, 141,
+ 143, 146, 149, 151, 154, 156, 159, 161,
+ 168, 175, 181, 187, 193, 199, 202, 206,
+ 213, 220, 227, 229, 232, 235, 237, 239,
+ 242, 250, 252, 254, 255, 256, 264, 270,
+ 273, 281, 289, 297, 307, 317, 327, 337,
+ 343, 346
+ };
+
+ static const char _thttp_machine_parser_url_indicies[] = {
+ 0, 2, 3, 4, 4, 1, 0, 4,
+ 4, 4, 1, 0, 5, 4, 4, 4,
+ 1, 4, 6, 6, 1, 7, 6, 6,
+ 6, 1, 8, 1, 9, 6, 6, 1,
+ 0, 10, 11, 4, 4, 1, 12, 6,
+ 6, 1, 0, 13, 14, 4, 4, 1,
+ 15, 6, 6, 1, 0, 13, 16, 4,
+ 4, 1, 0, 13, 4, 4, 4, 1,
+ 0, 10, 17, 4, 4, 1, 0, 10,
+ 4, 4, 4, 1, 0, 2, 18, 4,
+ 4, 1, 0, 2, 4, 4, 4, 1,
+ 19, 8, 1, 20, 1, 22, 21, 21,
+ 21, 1, 24, 25, 23, 23, 23, 1,
+ 24, 25, 26, 26, 26, 1, 24, 25,
+ 27, 27, 27, 1, 24, 25, 1, 29,
+ 28, 21, 21, 1, 30, 24, 25, 31,
+ 23, 23, 1, 32, 1, 33, 34, 1,
+ 35, 1, 36, 37, 1, 38, 1, 25,
+ 39, 1, 25, 40, 1, 25, 1, 36,
+ 41, 1, 36, 1, 33, 42, 1, 33,
+ 1, 30, 24, 25, 43, 26, 26, 1,
+ 30, 24, 25, 27, 27, 27, 1, 45,
+ 25, 44, 44, 44, 1, 47, 25, 46,
+ 46, 46, 1, 47, 25, 48, 48, 48,
+ 1, 47, 25, 49, 49, 49, 1, 47,
+ 25, 1, 50, 44, 44, 1, 30, 47,
+ 25, 51, 46, 46, 1, 30, 47, 25,
+ 52, 48, 48, 1, 30, 47, 25, 49,
+ 49, 49, 1, 53, 1, 30, 54, 1,
+ 30, 55, 1, 30, 1, 29, 1, 56,
+ 8, 1, 57, 60, 61, 60, 58, 59,
+ 59, 1, 63, 62, 65, 64, 66, 67,
+ 7, 68, 69, 70, 6, 6, 6, 1,
+ 69, 70, 4, 6, 6, 1, 71, 72,
+ 1, 0, 5, 69, 70, 73, 4, 4,
+ 1, 0, 5, 69, 70, 74, 4, 4,
+ 1, 0, 5, 69, 70, 4, 4, 4,
+ 1, 7, 68, 69, 70, 75, 75, 6,
+ 6, 6, 1, 7, 68, 69, 70, 76,
+ 76, 6, 6, 6, 1, 7, 68, 69,
+ 70, 77, 77, 6, 6, 6, 1, 7,
+ 68, 69, 78, 79, 79, 6, 6, 6,
+ 1, 57, 61, 58, 59, 59, 1, 69,
+ 70, 1, 7, 68, 69, 80, 6, 6,
+ 6, 1, 0
+ };
+
+ static const char _thttp_machine_parser_url_trans_targs[] = {
+ 2, 0, 7, 16, 3, 4, 61, 5,
+ 63, 8, 9, 14, 10, 11, 12, 64,
+ 13, 15, 17, 19, 71, 21, 54, 22,
+ 25, 72, 23, 24, 26, 41, 27, 39,
+ 28, 29, 37, 30, 31, 35, 32, 33,
+ 34, 36, 38, 40, 42, 50, 43, 46,
+ 44, 45, 47, 48, 49, 51, 52, 53,
+ 19, 57, 1, 61, 67, 20, 58, 59,
+ 58, 59, 60, 60, 62, 57, 6, 57,
+ 63, 65, 66, 68, 69, 70, 18, 73,
+ 55
+ };
+
+ static const char _thttp_machine_parser_url_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 13, 0,
+ 24, 0, 0, 0, 0, 0, 0, 13,
+ 0, 0, 0, 1, 13, 0, 0, 0,
+ 0, 13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 13, 36, 40, 40, 15, 24, 44,
+ 13, 33, 24, 13, 13, 27, 5, 30,
+ 13, 13, 13, 13, 13, 13, 5, 13,
+ 5
+ };
+
+ static const char _thttp_machine_parser_url_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 18, 9, 21, 11, 5, 5, 7,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 5, 5
+ };
+
+ static const int thttp_machine_parser_url_start = 56;
+ static const int thttp_machine_parser_url_first_final = 56;
+ static const int thttp_machine_parser_url_error = 0;
+
+ static const int thttp_machine_parser_url_en_main = 56;
+
+
+ /* #line 114 "./ragel/thttp_parser_url.rl" */
+ (void)(ts);
+ (void)(te);
+ (void)(act);
+ (void)(eof);
+ (void)(thttp_machine_parser_url_first_final);
+ (void)(thttp_machine_parser_url_error);
+ (void)(thttp_machine_parser_url_en_main);
+
+ /* #line 294 "./src/parsers/thttp_parser_url.c" */
+ {
+ cs = thttp_machine_parser_url_start;
+ }
+
+ /* #line 122 "./ragel/thttp_parser_url.rl" */
+
+ /* #line 301 "./src/parsers/thttp_parser_url.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _thttp_machine_parser_url_trans_keys + _thttp_machine_parser_url_key_offsets[cs];
- _trans = _thttp_machine_parser_url_index_offsets[cs];
-
- _klen = _thttp_machine_parser_url_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _thttp_machine_parser_url_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _thttp_machine_parser_url_trans_keys + _thttp_machine_parser_url_key_offsets[cs];
+ _trans = _thttp_machine_parser_url_index_offsets[cs];
+
+ _klen = _thttp_machine_parser_url_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _thttp_machine_parser_url_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _thttp_machine_parser_url_indicies[_trans];
- cs = _thttp_machine_parser_url_trans_targs[_trans];
-
- if ( _thttp_machine_parser_url_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _thttp_machine_parser_url_actions + _thttp_machine_parser_url_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 38 "./ragel/thttp_parser_url.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 43 "./ragel/thttp_parser_url.rl" */
- { url->scheme = tsk_strdup("http"), url->type = thttp_url_http; }
- break;
- case 2:
-/* #line 44 "./ragel/thttp_parser_url.rl" */
- { url->scheme = tsk_strdup("https"), url->type = thttp_url_https; }
- break;
- case 3:
-/* #line 47 "./ragel/thttp_parser_url.rl" */
- { url->host_type = url->host_type = thttp_host_ipv4; }
- break;
- case 4:
-/* #line 48 "./ragel/thttp_parser_url.rl" */
- { url->host_type = url->host_type = thttp_host_ipv6; }
- break;
- case 5:
-/* #line 49 "./ragel/thttp_parser_url.rl" */
- { url->host_type = url->host_type = thttp_host_hostname; }
- break;
- case 6:
-/* #line 51 "./ragel/thttp_parser_url.rl" */
- {
- TSK_PARSER_SET_STRING(url->host);
- }
- break;
- case 7:
-/* #line 55 "./ragel/thttp_parser_url.rl" */
- {
- have_port = 1;
- TSK_PARSER_SET_INT(url->port);
- }
- break;
- case 8:
-/* #line 60 "./ragel/thttp_parser_url.rl" */
- {
- TSK_PARSER_SET_STRING(url->hpath);
- }
- break;
- case 10:
-/* #line 68 "./ragel/thttp_parser_url.rl" */
- {
- }
- break;
-/* #line 425 "./src/parsers/thttp_parser_url.c" */
- }
- }
+ _trans = _thttp_machine_parser_url_indicies[_trans];
+ cs = _thttp_machine_parser_url_trans_targs[_trans];
+
+ if ( _thttp_machine_parser_url_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _thttp_machine_parser_url_actions + _thttp_machine_parser_url_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 38 "./ragel/thttp_parser_url.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 43 "./ragel/thttp_parser_url.rl" */
+ {
+ url->scheme = tsk_strdup("http"), url->type = thttp_url_http;
+ }
+ break;
+ case 2:
+ /* #line 44 "./ragel/thttp_parser_url.rl" */
+ {
+ url->scheme = tsk_strdup("https"), url->type = thttp_url_https;
+ }
+ break;
+ case 3:
+ /* #line 47 "./ragel/thttp_parser_url.rl" */
+ {
+ url->host_type = url->host_type = thttp_host_ipv4;
+ }
+ break;
+ case 4:
+ /* #line 48 "./ragel/thttp_parser_url.rl" */
+ {
+ url->host_type = url->host_type = thttp_host_ipv6;
+ }
+ break;
+ case 5:
+ /* #line 49 "./ragel/thttp_parser_url.rl" */
+ {
+ url->host_type = url->host_type = thttp_host_hostname;
+ }
+ break;
+ case 6:
+ /* #line 51 "./ragel/thttp_parser_url.rl" */
+ {
+ TSK_PARSER_SET_STRING(url->host);
+ }
+ break;
+ case 7:
+ /* #line 55 "./ragel/thttp_parser_url.rl" */
+ {
+ have_port = 1;
+ TSK_PARSER_SET_INT(url->port);
+ }
+ break;
+ case 8:
+ /* #line 60 "./ragel/thttp_parser_url.rl" */
+ {
+ TSK_PARSER_SET_STRING(url->hpath);
+ }
+ break;
+ case 10:
+ /* #line 68 "./ragel/thttp_parser_url.rl" */
+ {
+ }
+ break;
+ /* #line 425 "./src/parsers/thttp_parser_url.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _thttp_machine_parser_url_actions + _thttp_machine_parser_url_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 38 "./ragel/thttp_parser_url.rl" */
- {
- tag_start = p;
- }
- break;
- case 6:
-/* #line 51 "./ragel/thttp_parser_url.rl" */
- {
- TSK_PARSER_SET_STRING(url->host);
- }
- break;
- case 7:
-/* #line 55 "./ragel/thttp_parser_url.rl" */
- {
- have_port = 1;
- TSK_PARSER_SET_INT(url->port);
- }
- break;
- case 8:
-/* #line 60 "./ragel/thttp_parser_url.rl" */
- {
- TSK_PARSER_SET_STRING(url->hpath);
- }
- break;
- case 9:
-/* #line 64 "./ragel/thttp_parser_url.rl" */
- {
- TSK_PARSER_SET_STRING(url->search);
- }
- break;
-/* #line 472 "./src/parsers/thttp_parser_url.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 123 "./ragel/thttp_parser_url.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 484 "./src/parsers/thttp_parser_url.c" */
-56
-/* #line 125 "./ragel/thttp_parser_url.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse HTTP/HTTPS URL: '%.*s'", length, urlstring);
- TSK_OBJECT_SAFE_FREE(url);
- }
- else if(!have_port){
- if(url->type == thttp_url_https){
- url->port = 443;
- }
- else{
- url->port = 80;
- }
- }
-
- return url;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _thttp_machine_parser_url_actions + _thttp_machine_parser_url_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 38 "./ragel/thttp_parser_url.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 6:
+ /* #line 51 "./ragel/thttp_parser_url.rl" */
+ {
+ TSK_PARSER_SET_STRING(url->host);
+ }
+ break;
+ case 7:
+ /* #line 55 "./ragel/thttp_parser_url.rl" */
+ {
+ have_port = 1;
+ TSK_PARSER_SET_INT(url->port);
+ }
+ break;
+ case 8:
+ /* #line 60 "./ragel/thttp_parser_url.rl" */
+ {
+ TSK_PARSER_SET_STRING(url->hpath);
+ }
+ break;
+ case 9:
+ /* #line 64 "./ragel/thttp_parser_url.rl" */
+ {
+ TSK_PARSER_SET_STRING(url->search);
+ }
+ break;
+ /* #line 472 "./src/parsers/thttp_parser_url.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 123 "./ragel/thttp_parser_url.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 484 "./src/parsers/thttp_parser_url.c" */
+ 56
+ /* #line 125 "./ragel/thttp_parser_url.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse HTTP/HTTPS URL: '%.*s'", length, urlstring);
+ TSK_OBJECT_SAFE_FREE(url);
+ }
+ else if(!have_port) {
+ if(url->type == thttp_url_https) {
+ url->port = 443;
+ }
+ else {
+ url->port = 80;
+ }
+ }
+
+ return url;
}
diff --git a/tinyHTTP/src/thttp.c b/tinyHTTP/src/thttp.c
index 4cdbf1a..3769e82 100755
--- a/tinyHTTP/src/thttp.c
+++ b/tinyHTTP/src/thttp.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,7 +47,7 @@
/** @mainpage TinyHTTP API Overview
* <h1>15 HTTP/HTTPS</h1>
* <p>
-* The HTTP/HTTPS stack is a basic thread-safe client API and is used in conjunction with the XCAP protocol.
+* The HTTP/HTTPS stack is a basic thread-safe client API and is used in conjunction with the XCAP protocol.
* Almost all HTTP methods such as OPTIONS, HEAD, GET, DELETE, POST, CONNET, TRACE or PUT … are supported for outgoing requests. Only response messages will be correctly handled by the stack. Requests will be passed to the application layer “as is” and no new connection will be opened.
* </p>
* <p>
@@ -59,10 +59,10 @@
*
*
*
-*
+*
* <h2>15.1 Initialization</h2>
* <p>
-* As the HTTP/HTTPS stack depends on the network library (tinyNET), you MUST call @ref tnet_startup() before using any HTTP/Network function (thttp_*).
+* As the HTTP/HTTPS stack depends on the network library (tinyNET), you MUST call @ref tnet_startup() before using any HTTP/Network function (thttp_*).
* @ref tnet_cleanup() is used to terminate use of network functions.
* </p>
*
@@ -87,7 +87,7 @@ int test_stack_callback(const thttp_event_t *httpevent)
if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)){
const thttp_header_ETag_t* etag;
TSK_DEBUG_INFO("=== %d ==> %s", THTTP_RESPONSE_CODE(httpevent->message), THTTP_MESSAGE_CONTENT(httpevent->message));
- // You can use
+ // You can use
if((etag = (const thttp_header_ETag_t*)thttp_message_get_header(httpevent->message, thttp_htype_ETag))){
TSK_DEBUG_INFO("Etag=%s", etag->value);
}
@@ -113,7 +113,7 @@ int test_stack_callback(const thttp_event_t *httpevent)
break;
}
}
-
+
return 0;
}
@@ -168,9 +168,9 @@ THTTP_SESSION_SET_CRED("ali baba", "open sesame"),
THTTP_SESSION_SET_HEADER("Pragma", "No-Cache"),
THTTP_SESSION_SET_HEADER("Connection", "Keep-Alive"),
THTTP_SESSION_SET_HEADER("User-Agent", "doubango 1.0"),
-
+
THTTP_SESSION_SET_NULL());// MUST always be present
-
+
* @endcode
*
* A session is a well-defined object and must be destroyed by using @a TSK_OBJECT_SAFE_FREE() macro.
@@ -182,18 +182,18 @@ THTTP_SESSION_SET_CRED("ali baba", "open sesame"),
* Both HTTP digest and Basic authentication (RFC 2617) are supported in this version (1.0). The credentials (username and password) should be set when the session is created (@ref thttp_session_create()) or later, by using @ref thttp_session_set(). As credentials are configured at session level, you can use one stack to authenticate against multiple HTTP servers with different domains.
* </p>
* <p>
-* The stack will automatically add authorizations (as per RFC 2617) when it is challenged (401/407 responses), this is why you should set credentials before sending any requests which is susceptible to be challenged.
+* The stack will automatically add authorizations (as per RFC 2617) when it is challenged (401/407 responses), this is why you should set credentials before sending any requests which is susceptible to be challenged.
* </p>
-*
-*
-*
+*
+*
+*
* <h3>15.2.2 Options</h3>
* <p>
* All options shall be set by using @ref THTTP_SESSION_SET_OPTION(id, value) macro. Session-level options will be applied to all underlying requests, unless the request redefines this option.
* </p>
*
-*
-*
+*
+*
* <h3>15.2.3 Headers</h3>
* <p>
* All headers shall be set by using @ref THTTP_SESSION_SET_HEADER(name, value) macro. Session-level headers will be added to all underlying requests even if a request redefines this header. This means that if both the request and the session have the same header, then it will be duplicated.<br>
@@ -202,7 +202,7 @@ THTTP_SESSION_SET_CRED("ali baba", "open sesame"),
* <p>
* @ref THTTP_SESSION_UNSET_HEADER() and @ref THTTP_SESSION_SET_HEADER() macros are used to remove or update a previously added session-level header, respectively.
* </p>
-*
+*
* <h2>15.3 Requests</h2>
* <p>
* A HTTP request is referred to as an “action” and is always associated to a session. There are nine well-know actions you can perform: <b>CONNET</b>, <b>DELETE</b>, <b>GET</b>, <b>HEAD</b>, <b>OPTIONS</b>, <b>PATCH</b>, <b>POST</b>, <b>PUT</b> and <b>TRACE</b>. You can use @ref thttp_action_perform(session, url, method, …) function to send a custom request. All <i>thttp_action_*()</i> functions are non-blocking.<br>
@@ -217,14 +217,14 @@ THTTP_SESSION_SET_CRED("ali baba", "open sesame"),
int ret = thttp_action_PUT(session, "http://www.doubango.org",
// action-level options
THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
-
+
// payload
THTTP_ACTION_SET_PAYLOAD("Comment allez-vous?", tsk_strlen("Comment allez-vous?")),
// action-level headers
THTTP_ACTION_SET_HEADER("Content-Type", "text/plain"),
THTTP_ACTION_SET_HEADER("Expect", "100-continue"),
-
+
THTTP_ACTION_SET_NULL());
* @endcode
@@ -235,7 +235,7 @@ int ret = thttp_action_PUT(session, "http://www.doubango.org",
int ret = thttp_action_GET(session, "http://ipv6.google.com",
// action-level options
THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "4500"),
-
+
THTTP_ACTION_SET_NULL());
* @endcode
@@ -246,8 +246,8 @@ int ret = thttp_action_GET(session, "http://ipv6.google.com",
*
* <h3>15.3.1 Options</h3>
* <p>
-* All options shall be set by using @ref THTTP_ACTION_SET_OPTION(id, value) macro.
-* Action-level options and headers are only applied to the current request.
+* All options shall be set by using @ref THTTP_ACTION_SET_OPTION(id, value) macro.
+* Action-level options and headers are only applied to the current request.
* In the code, the timeout previously defined by the session has been redefined (from 6000ms to 2500ms).
* </p>
*
@@ -257,7 +257,7 @@ int ret = thttp_action_GET(session, "http://ipv6.google.com",
*
* <h3>15.3.2 Headers</h3>
* <p>
-* All headers shall be set by using @ref THTTP_ACTION_SET_HEADER(name, value) macro.
+* All headers shall be set by using @ref THTTP_ACTION_SET_HEADER(name, value) macro.
* Action-level headers will only be added to the current request. <i>Host</i> and <i>Content-Length</i> headers are automatically added by the stack.
* </p>
@@ -301,252 +301,249 @@ int thttp_cleanup()
/** Callback function used by the transport layer to alert the stack when new messages come. */
static int thttp_transport_layer_stream_cb(const tnet_transport_event_t* e)
{
- int ret = -1;
- tsk_ragel_state_t state;
- thttp_message_t *message = tsk_null;
- int endOfheaders = -1;
- const thttp_stack_t *stack = e->callback_data;
- thttp_dialog_t* dialog = tsk_null;
- thttp_session_t* session = tsk_null;
- tsk_bool_t have_all_content = tsk_false;
-
- tsk_safeobj_lock(stack);
-
- switch(e->type){
- case event_data: {
- break;
- }
- case event_closed:
- // alert all dialogs
- if((session = thttp_session_get_by_fd(stack->sessions, e->local_fd))){
- ret = thttp_session_signal_closed(session);
- }
- goto bail;
+ int ret = -1;
+ tsk_ragel_state_t state;
+ thttp_message_t *message = tsk_null;
+ int endOfheaders = -1;
+ const thttp_stack_t *stack = e->callback_data;
+ thttp_dialog_t* dialog = tsk_null;
+ thttp_session_t* session = tsk_null;
+ tsk_bool_t have_all_content = tsk_false;
+
+ tsk_safeobj_lock(stack);
+
+ switch(e->type) {
+ case event_data: {
+ break;
+ }
+ case event_closed:
+ // alert all dialogs
+ if((session = thttp_session_get_by_fd(stack->sessions, e->local_fd))) {
+ ret = thttp_session_signal_closed(session);
+ }
+ goto bail;
- case event_error:
- // alert all dialogs
- if((session = thttp_session_get_by_fd(stack->sessions, e->local_fd))){
- ret = thttp_session_signal_error(session);
- }
- goto bail;
- case event_connected:
- default:{
- tsk_safeobj_unlock(stack);
- return 0;
- }
- }
-
- /* Gets the associated dialog */
- if(!(session = thttp_session_get_by_fd(stack->sessions, e->local_fd))){
- if ((stack->mode & thttp_stack_mode_server)) {
- // server mode -> add new session
- session = thttp_session_create(stack,
- THTTP_SESSION_SET_HEADER("User-Agent", "doubango 2.0"),
- THTTP_SESSION_SET_NULL());
- if (!session) {
- TSK_DEBUG_ERROR("Failed to create new session.");
- ret = -5;
- goto bail;
- }
- }
- else {
- // client mode -> session *must* exist
- TSK_DEBUG_ERROR("Failed to found associated session.");
- ret = -4;
- goto bail;
- }
- }
-
- // Get dialog associated to this session
- if(!(dialog = thttp_dialog_get_oldest(session->dialogs))){
- TSK_DEBUG_ERROR("Failed to found associated dialog.");
- ret = -5;
- goto bail;
- }
+ case event_error:
+ // alert all dialogs
+ if((session = thttp_session_get_by_fd(stack->sessions, e->local_fd))) {
+ ret = thttp_session_signal_error(session);
+ }
+ goto bail;
+ case event_connected:
+ default: {
+ tsk_safeobj_unlock(stack);
+ return 0;
+ }
+ }
- /* Check if buffer is too big to be valid (have we missed some chuncks?) */
- //if(TSK_BUFFER_SIZE(buf) >= THTTP_MAX_CONTENT_SIZE){
- // tsk_buffer_cleanup(dialog->buf);
- //}
+ /* Gets the associated dialog */
+ if(!(session = thttp_session_get_by_fd(stack->sessions, e->local_fd))) {
+ if ((stack->mode & thttp_stack_mode_server)) {
+ // server mode -> add new session
+ session = thttp_session_create(stack,
+ THTTP_SESSION_SET_HEADER("User-Agent", "doubango 2.0"),
+ THTTP_SESSION_SET_NULL());
+ if (!session) {
+ TSK_DEBUG_ERROR("Failed to create new session.");
+ ret = -5;
+ goto bail;
+ }
+ }
+ else {
+ // client mode -> session *must* exist
+ TSK_DEBUG_ERROR("Failed to found associated session.");
+ ret = -4;
+ goto bail;
+ }
+ }
- /* Append new content. */
- tsk_buffer_append(dialog->buf, e->data, e->size);
-
- /* Check if we have all HTTP headers. */
+ // Get dialog associated to this session
+ if(!(dialog = thttp_dialog_get_oldest(session->dialogs))) {
+ TSK_DEBUG_ERROR("Failed to found associated dialog.");
+ ret = -5;
+ goto bail;
+ }
+
+ /* Check if buffer is too big to be valid (have we missed some chuncks?) */
+ //if(TSK_BUFFER_SIZE(buf) >= THTTP_MAX_CONTENT_SIZE){
+ // tsk_buffer_cleanup(dialog->buf);
+ //}
+
+ /* Append new content. */
+ tsk_buffer_append(dialog->buf, e->data, e->size);
+
+ /* Check if we have all HTTP headers. */
parse_buffer:
- if((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(dialog->buf), TSK_BUFFER_SIZE(dialog->buf), "\r\n\r\n"/*2CRLF*/)) < 0){
- TSK_DEBUG_INFO("No all HTTP headers in the TCP buffer.");
- goto bail;
- }
-
- /* If we are here this mean that we have all HTTP headers.
- * ==> Parse the HTTP message without the content.
- */
- tsk_ragel_state_init(&state, TSK_BUFFER_DATA(dialog->buf), endOfheaders + 4/*2CRLF*/);
- if(!(ret = thttp_message_parse(&state, &message, tsk_false/* do not extract the content */))){
- const thttp_header_Transfer_Encoding_t* transfer_Encoding;
-
- /* chunked? */
- if((transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)thttp_message_get_header(message, thttp_htype_Transfer_Encoding)) && tsk_striequals(transfer_Encoding->encoding, "chunked")){
- const char* start = (const char*)(TSK_BUFFER_TO_U8(dialog->buf) + (endOfheaders + 4/*2CRLF*/));
- const char* end = (const char*)(TSK_BUFFER_TO_U8(dialog->buf) + TSK_BUFFER_SIZE(dialog->buf));
- int index;
-
- TSK_DEBUG_INFO("CHUNKED transfer.");
- while(start < end){
- /* RFC 2616 - 19.4.6 Introduction of Transfer-Encoding */
- // read chunk-size, chunk-extension (if any) and CRLF
- tsk_size_t chunk_size = (tsk_size_t)tsk_atox(start);
- if((index = tsk_strindexOf(start, (tsk_size_t)(end-start), "\r\n")) >=0){
- start += index + 2/*CRLF*/;
- }
- else{
- TSK_DEBUG_INFO("Parsing chunked data has failed.");
- break;
- }
+ if((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(dialog->buf), TSK_BUFFER_SIZE(dialog->buf), "\r\n\r\n"/*2CRLF*/)) < 0) {
+ TSK_DEBUG_INFO("No all HTTP headers in the TCP buffer.");
+ goto bail;
+ }
- if(chunk_size == 0 && ((start + 2) <= end) && *start == '\r' && *(start+ 1) == '\n'){
- int parsed_len = (int)(start - (const char*)(TSK_BUFFER_TO_U8(dialog->buf))) + 2/*CRLF*/;
- tsk_buffer_remove(dialog->buf, 0, parsed_len);
- have_all_content = tsk_true;
- break;
- }
-
- thttp_message_append_content(message, start, chunk_size);
- start += chunk_size + 2/*CRLF*/;
- }
- }
- else{
- tsk_size_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header. */
- if(clen == 0){ /* No content */
- tsk_buffer_remove(dialog->buf, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF ==> must never happen */
- have_all_content = tsk_true;
- }
- else{ /* There is a content */
- if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(dialog->buf)){ /* There is content but not all the content. */
- TSK_DEBUG_INFO("No all HTTP content in the TCP buffer.");
- goto bail;
- }
- else{
- /* Add the content to the message. */
- thttp_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(dialog->buf) + endOfheaders + 4/*2CRLF*/, clen);
- /* Remove HTTP headers, CRLF and the content. */
- tsk_buffer_remove(dialog->buf, 0, (endOfheaders + 4/*2CRLF*/ + clen));
- have_all_content = tsk_true;
- }
- }
- }
- }
-
- /* Alert the dialog (FSM) */
- if(message){
- if(have_all_content){ /* only if we have all data */
- ret = thttp_dialog_fsm_act(dialog, thttp_atype_i_message, message, tsk_null);
- /* Parse next chunck */
- if(TSK_BUFFER_SIZE(dialog->buf) >= THTTP_MIN_STREAM_CHUNCK_SIZE){
- TSK_OBJECT_SAFE_FREE(message);
- goto parse_buffer;
- }
- }
- }
+ /* If we are here this mean that we have all HTTP headers.
+ * ==> Parse the HTTP message without the content.
+ */
+ tsk_ragel_state_init(&state, TSK_BUFFER_DATA(dialog->buf), endOfheaders + 4/*2CRLF*/);
+ if(!(ret = thttp_message_parse(&state, &message, tsk_false/* do not extract the content */))) {
+ const thttp_header_Transfer_Encoding_t* transfer_Encoding;
+
+ /* chunked? */
+ if((transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)thttp_message_get_header(message, thttp_htype_Transfer_Encoding)) && tsk_striequals(transfer_Encoding->encoding, "chunked")) {
+ const char* start = (const char*)(TSK_BUFFER_TO_U8(dialog->buf) + (endOfheaders + 4/*2CRLF*/));
+ const char* end = (const char*)(TSK_BUFFER_TO_U8(dialog->buf) + TSK_BUFFER_SIZE(dialog->buf));
+ int index;
+
+ TSK_DEBUG_INFO("CHUNKED transfer.");
+ while(start < end) {
+ /* RFC 2616 - 19.4.6 Introduction of Transfer-Encoding */
+ // read chunk-size, chunk-extension (if any) and CRLF
+ tsk_size_t chunk_size = (tsk_size_t)tsk_atox(start);
+ if((index = tsk_strindexOf(start, (tsk_size_t)(end-start), "\r\n")) >=0) {
+ start += index + 2/*CRLF*/;
+ }
+ else {
+ TSK_DEBUG_INFO("Parsing chunked data has failed.");
+ break;
+ }
+
+ if(chunk_size == 0 && ((start + 2) <= end) && *start == '\r' && *(start+ 1) == '\n') {
+ int parsed_len = (int)(start - (const char*)(TSK_BUFFER_TO_U8(dialog->buf))) + 2/*CRLF*/;
+ tsk_buffer_remove(dialog->buf, 0, parsed_len);
+ have_all_content = tsk_true;
+ break;
+ }
+
+ thttp_message_append_content(message, start, chunk_size);
+ start += chunk_size + 2/*CRLF*/;
+ }
+ }
+ else {
+ tsk_size_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header. */
+ if(clen == 0) { /* No content */
+ tsk_buffer_remove(dialog->buf, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF ==> must never happen */
+ have_all_content = tsk_true;
+ }
+ else { /* There is a content */
+ if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(dialog->buf)) { /* There is content but not all the content. */
+ TSK_DEBUG_INFO("No all HTTP content in the TCP buffer.");
+ goto bail;
+ }
+ else {
+ /* Add the content to the message. */
+ thttp_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(dialog->buf) + endOfheaders + 4/*2CRLF*/, clen);
+ /* Remove HTTP headers, CRLF and the content. */
+ tsk_buffer_remove(dialog->buf, 0, (endOfheaders + 4/*2CRLF*/ + clen));
+ have_all_content = tsk_true;
+ }
+ }
+ }
+ }
+
+ /* Alert the dialog (FSM) */
+ if(message) {
+ if(have_all_content) { /* only if we have all data */
+ ret = thttp_dialog_fsm_act(dialog, thttp_atype_i_message, message, tsk_null);
+ /* Parse next chunck */
+ if(TSK_BUFFER_SIZE(dialog->buf) >= THTTP_MIN_STREAM_CHUNCK_SIZE) {
+ TSK_OBJECT_SAFE_FREE(message);
+ goto parse_buffer;
+ }
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(dialog);
- TSK_OBJECT_SAFE_FREE(session);
- TSK_OBJECT_SAFE_FREE(message);
+ TSK_OBJECT_SAFE_FREE(dialog);
+ TSK_OBJECT_SAFE_FREE(session);
+ TSK_OBJECT_SAFE_FREE(message);
- tsk_safeobj_unlock(stack);
+ tsk_safeobj_unlock(stack);
- return ret;
+ return ret;
}
/** Internal function used to set values.
*/
int __thttp_stack_set(thttp_stack_t *self, va_list* app)
{
- thttp_stack_param_type_t curr;
-
- while((curr = va_arg(*app, thttp_stack_param_type_t)) != thttp_pname_null)
- {
- switch(curr)
- {
- //
- // Network
- //
- case thttp_pname_local_ip:
- { /* STR */
- tsk_strupdate(&self->local_ip, va_arg(*app, const char*));
- break;
- }
- case thttp_pname_local_port:
- { /* INT */
- self->local_port = va_arg(*app, int);
- break;
- }
- case thttp_pname_proxy:
- { /* (const char*)IP_STR, (int)PORT_INT */
- tsk_strupdate(&self->proxy_ip, va_arg(*app, const char*));
- self->proxy_port = va_arg(*app, int);
- break;
- }
+ thttp_stack_param_type_t curr;
+
+ while((curr = va_arg(*app, thttp_stack_param_type_t)) != thttp_pname_null) {
+ switch(curr) {
+ //
+ // Network
+ //
+ case thttp_pname_local_ip: {
+ /* STR */
+ tsk_strupdate(&self->local_ip, va_arg(*app, const char*));
+ break;
+ }
+ case thttp_pname_local_port: {
+ /* INT */
+ self->local_port = va_arg(*app, int);
+ break;
+ }
+ case thttp_pname_proxy: {
+ /* (const char*)IP_STR, (int)PORT_INT */
+ tsk_strupdate(&self->proxy_ip, va_arg(*app, const char*));
+ self->proxy_port = va_arg(*app, int);
+ break;
+ }
- //
- // Modes
- //
- case thttp_pname_mode_client:
- { /* VOID */
- self->mode = thttp_stack_mode_client;
- break;
- }
- case thttp_pname_mode_server:
- { /* VOID */
- self->mode = thttp_stack_mode_server;
- break;
- }
-
- //
- // TLS
- //
- case thttp_pname_tls_enabled:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->tls.enabled = va_arg(*app, tsk_bool_t);
- break;
- }
- case thttp_pname_tls_certs_verify:
- { /* (tsk_bool_t)CERTS_VERIFY_BOOL */
- self->tls.verify = va_arg(*app, tsk_bool_t);
- break;
- }
- case thttp_pname_tls_certs:
- { /* A_FILE_STR, PUB_FILE_STR, PRIV_FILE_STR */
- tsk_strupdate(&self->tls.ca, va_arg(*app, const char*));
- tsk_strupdate(&self->tls.pbk, va_arg(*app, const char*));
- tsk_strupdate(&self->tls.pvk, va_arg(*app, const char*));
- break;
- }
+ //
+ // Modes
+ //
+ case thttp_pname_mode_client: {
+ /* VOID */
+ self->mode = thttp_stack_mode_client;
+ break;
+ }
+ case thttp_pname_mode_server: {
+ /* VOID */
+ self->mode = thttp_stack_mode_server;
+ break;
+ }
- //
- // Userdata
- //
- case thttp_pname_userdata:
- { /* (const void*)USERDATA_PTR */
- self->userdata = va_arg(*app, const void*);
- break;
- }
+ //
+ // TLS
+ //
+ case thttp_pname_tls_enabled: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->tls.enabled = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case thttp_pname_tls_certs_verify: {
+ /* (tsk_bool_t)CERTS_VERIFY_BOOL */
+ self->tls.verify = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case thttp_pname_tls_certs: {
+ /* A_FILE_STR, PUB_FILE_STR, PRIV_FILE_STR */
+ tsk_strupdate(&self->tls.ca, va_arg(*app, const char*));
+ tsk_strupdate(&self->tls.pbk, va_arg(*app, const char*));
+ tsk_strupdate(&self->tls.pvk, va_arg(*app, const char*));
+ break;
+ }
- default:
- {
- TSK_DEBUG_WARN("Found unknown pname.");
- goto bail;
- }
+ //
+ // Userdata
+ //
+ case thttp_pname_userdata: {
+ /* (const void*)USERDATA_PTR */
+ self->userdata = va_arg(*app, const void*);
+ break;
+ }
- }/* switch */
- }/* while */
- return 0;
+ default: {
+ TSK_DEBUG_WARN("Found unknown pname.");
+ goto bail;
+ }
+
+ }/* switch */
+ }/* while */
+ return 0;
bail:
- return -2;
+ return -2;
}
/**@ingroup thttp_stack_group
@@ -568,26 +565,26 @@ bail:
*/
thttp_stack_handle_t *thttp_stack_create(thttp_stack_callback_f callback, ...)
{
- thttp_stack_t* stack = tsk_null;
- va_list ap;
+ thttp_stack_t* stack = tsk_null;
+ va_list ap;
- if(!(stack = tsk_object_new(thttp_stack_def_t))){ /* should never happen */
- TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS stack.");
- return tsk_null;
- }
- stack->local_ip = TNET_SOCKET_HOST_ANY;
- stack->local_port = TNET_SOCKET_PORT_ANY;
- stack->mode = thttp_stack_mode_client; // default mode
-
- stack->callback = callback;
- va_start(ap, callback);
- if(__thttp_stack_set(stack, &ap)){
- TSK_DEBUG_ERROR("Failed to set user's parameters.");
- TSK_OBJECT_SAFE_FREE(stack);
- }
- va_end(ap);
+ if(!(stack = tsk_object_new(thttp_stack_def_t))) { /* should never happen */
+ TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS stack.");
+ return tsk_null;
+ }
+ stack->local_ip = TNET_SOCKET_HOST_ANY;
+ stack->local_port = TNET_SOCKET_PORT_ANY;
+ stack->mode = thttp_stack_mode_client; // default mode
+
+ stack->callback = callback;
+ va_start(ap, callback);
+ if(__thttp_stack_set(stack, &ap)) {
+ TSK_DEBUG_ERROR("Failed to set user's parameters.");
+ TSK_OBJECT_SAFE_FREE(stack);
+ }
+ va_end(ap);
- return stack;
+ return stack;
}
/**@ingroup thttp_stack_group
@@ -598,43 +595,43 @@ thttp_stack_handle_t *thttp_stack_create(thttp_stack_callback_f callback, ...)
*/
int thttp_stack_start(thttp_stack_handle_t *self)
{
- int ret = -1;
- thttp_stack_t *stack = self;
+ int ret = -1;
+ thttp_stack_t *stack = self;
- if(!stack){
- TSK_DEBUG_ERROR("Invalid parameter");
- return ret;
- }
+ if(!stack) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return ret;
+ }
- if(stack->started){
- TSK_DEBUG_WARN("Stack already started");
- return ret;
- }
+ if(stack->started) {
+ TSK_DEBUG_WARN("Stack already started");
+ return ret;
+ }
- if(!stack->transport){
- const char* transport_desc = stack->tls.enabled ? "HTTPS transport" : "HTTP transport";
- tnet_socket_type_t transport_type = stack->tls.enabled ? tnet_socket_type_tls_ipv46 : tnet_socket_type_tcp_ipv46;
- stack->transport = tnet_transport_create(stack->local_ip, stack->local_port, transport_type, transport_desc);
- tnet_transport_set_callback(stack->transport, TNET_TRANSPORT_CB_F(thttp_transport_layer_stream_cb), self);
- }
+ if(!stack->transport) {
+ const char* transport_desc = stack->tls.enabled ? "HTTPS transport" : "HTTP transport";
+ tnet_socket_type_t transport_type = stack->tls.enabled ? tnet_socket_type_tls_ipv46 : tnet_socket_type_tcp_ipv46;
+ stack->transport = tnet_transport_create(stack->local_ip, stack->local_port, transport_type, transport_desc);
+ tnet_transport_set_callback(stack->transport, TNET_TRANSPORT_CB_F(thttp_transport_layer_stream_cb), self);
+ }
- // Sets TLS certificates
- if((ret = tnet_transport_tls_set_certs(stack->transport, stack->tls.ca, stack->tls.pbk, stack->tls.pvk, stack->tls.verify))){
- goto bail;
- }
+ // Sets TLS certificates
+ if((ret = tnet_transport_tls_set_certs(stack->transport, stack->tls.ca, stack->tls.pbk, stack->tls.pvk, stack->tls.verify))) {
+ goto bail;
+ }
- if((ret = tnet_transport_start(stack->transport))){
- goto bail;
- }
+ if((ret = tnet_transport_start(stack->transport))) {
+ goto bail;
+ }
+
+ stack->started = tsk_true;
- stack->started = tsk_true;
-
bail:
- if(ret){
- TSK_OBJECT_SAFE_FREE(stack->transport);
- }
+ if(ret) {
+ TSK_OBJECT_SAFE_FREE(stack->transport);
+ }
- return ret;
+ return ret;
}
/**@ingroup thttp_stack_group
@@ -645,41 +642,41 @@ bail:
* @retval A Pointer to the newly created stack if succeed and @a Null otherwise.
*
* @code
-* thttp_stack_set(stack,
+* thttp_stack_set(stack,
* THTTP_STACK_SET_*(),
* THTTP_STACK_SET_NULL());
* @endcode
*/
int thttp_stack_set(thttp_stack_handle_t *self, ...)
{
- if(self){
- int ret;
- thttp_stack_t *stack = self;
-
- va_list ap;
- va_start(ap, self);
- ret = __thttp_stack_set(stack, &ap);
- va_end(ap);
- return ret;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ int ret;
+ thttp_stack_t *stack = self;
+
+ va_list ap;
+ va_start(ap, self);
+ ret = __thttp_stack_set(stack, &ap);
+ va_end(ap);
+ return ret;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup thttp_stack_group
*/
const void* thttp_stack_get_userdata(thttp_stack_handle_t *self)
{
- thttp_stack_t *stack = self;
- if(stack){
- return stack->userdata;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ thttp_stack_t *stack = self;
+ if(stack) {
+ return stack->userdata;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
}
/**@ingroup thttp_stack_group
@@ -690,54 +687,54 @@ const void* thttp_stack_get_userdata(thttp_stack_handle_t *self)
*/
int thttp_stack_stop(thttp_stack_handle_t *self)
{
- int ret;
- thttp_stack_t *stack = self;
+ int ret;
+ thttp_stack_t *stack = self;
- if(!stack){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!stack) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!stack->started){
- TSK_DEBUG_WARN("Stack already stopped");
- return -2;
- }
+ if(!stack->started) {
+ TSK_DEBUG_WARN("Stack already stopped");
+ return -2;
+ }
- // FIXME: stop = destroy transport
- if(1){
- tsk_list_item_t* item;
- tsk_list_foreach(item, stack->sessions){
- thttp_session_closefd((thttp_session_handle_t*)item->data);
- }
-
- TSK_OBJECT_SAFE_FREE(stack->transport);
- stack->started = tsk_false;
- }
- else{
- if(!(ret = tnet_transport_shutdown(stack->transport))){
- stack->started = tsk_false;
- }
- else{
- TSK_DEBUG_ERROR("Failed to stop the stack");
- }
- }
- return 0;
+ // FIXME: stop = destroy transport
+ if(1) {
+ tsk_list_item_t* item;
+ tsk_list_foreach(item, stack->sessions) {
+ thttp_session_closefd((thttp_session_handle_t*)item->data);
+ }
+
+ TSK_OBJECT_SAFE_FREE(stack->transport);
+ stack->started = tsk_false;
+ }
+ else {
+ if(!(ret = tnet_transport_shutdown(stack->transport))) {
+ stack->started = tsk_false;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to stop the stack");
+ }
+ }
+ return 0;
}
/** Alerts the user.
*/
int thttp_stack_alert(const thttp_stack_t *self, const thttp_event_t* e)
{
- if(!self || !e){
- return -1;
- }
+ if(!self || !e) {
+ return -1;
+ }
- if(self->callback){
- return self->callback(e);
- }
- else{
- return 0;
- }
+ if(self->callback) {
+ return self->callback(e);
+ }
+ else {
+ return 0;
+ }
}
@@ -769,44 +766,43 @@ int thttp_stack_alert(const thttp_stack_t *self, const thttp_event_t* e)
//
static tsk_object_t* thttp_stack_ctor(tsk_object_t * self, va_list * app)
{
- thttp_stack_t *stack = self;
- if(stack){
- tsk_safeobj_init(stack);
+ thttp_stack_t *stack = self;
+ if(stack) {
+ tsk_safeobj_init(stack);
- stack->sessions = tsk_list_create();
- }
- return self;
+ stack->sessions = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* thttp_stack_dtor(tsk_object_t * self)
-{
- thttp_stack_t *stack = self;
- if(stack){
- /* TLS */
- TSK_FREE(stack->tls.ca);
- TSK_FREE(stack->tls.pbk);
- TSK_FREE(stack->tls.pvk);
-
- /* Sessions */
- tsk_safeobj_lock(stack);
- TSK_OBJECT_SAFE_FREE(stack->sessions);
- tsk_safeobj_unlock(stack);
-
- /* Network */
- TSK_FREE(stack->local_ip);
- TSK_FREE(stack->proxy_ip);
- TSK_OBJECT_SAFE_FREE(stack->transport);
-
- tsk_safeobj_deinit(stack);
- }
- return self;
+{
+ thttp_stack_t *stack = self;
+ if(stack) {
+ /* TLS */
+ TSK_FREE(stack->tls.ca);
+ TSK_FREE(stack->tls.pbk);
+ TSK_FREE(stack->tls.pvk);
+
+ /* Sessions */
+ tsk_safeobj_lock(stack);
+ TSK_OBJECT_SAFE_FREE(stack->sessions);
+ tsk_safeobj_unlock(stack);
+
+ /* Network */
+ TSK_FREE(stack->local_ip);
+ TSK_FREE(stack->proxy_ip);
+ TSK_OBJECT_SAFE_FREE(stack->transport);
+
+ tsk_safeobj_deinit(stack);
+ }
+ return self;
}
-static const tsk_object_def_t thttp_stack_def_s =
-{
- sizeof(thttp_stack_t),
- thttp_stack_ctor,
- thttp_stack_dtor,
- tsk_null,
+static const tsk_object_def_t thttp_stack_def_s = {
+ sizeof(thttp_stack_t),
+ thttp_stack_ctor,
+ thttp_stack_dtor,
+ tsk_null,
};
const tsk_object_def_t *thttp_stack_def_t = &thttp_stack_def_s;
diff --git a/tinyHTTP/src/thttp_action.c b/tinyHTTP/src/thttp_action.c
index 014a6b9..5769e4d 100755
--- a/tinyHTTP/src/thttp_action.c
+++ b/tinyHTTP/src/thttp_action.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
thttp_action_t* thttp_action_create(thttp_action_type_t type, const char* urlstring, const char* method, va_list* app)
{
- return tsk_object_new(thttp_action_def_t, type, urlstring, method, app);
+ return tsk_object_new(thttp_action_def_t, type, urlstring, method, app);
}
@@ -57,7 +57,7 @@ thttp_action_perform(session, "http://www.google.com", "GET"
// request-level headers
THTTP_ACTION_SET_HEADER("Pragma", "No-Cache"),
THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
-
+
// close parameters
THTTP_ACTION_SET_NULL());
* @endcode
@@ -66,33 +66,33 @@ thttp_action_perform(session, "http://www.google.com", "GET"
*/
int thttp_action_perform(thttp_session_handle_t *session, const char* urlstring, const char* method, ...)
{
- thttp_session_t* sess = session;
- va_list ap;
- thttp_action_t* action;
- thttp_dialog_t* dialog;
- int ret = -1;
-
- if(!sess || !sess->stack || !urlstring || !method){
- TSK_DEBUG_ERROR("Invalid parameter");
- return ret;
- }
-
- va_start(ap, method);
- if((action = thttp_action_create(thttp_atype_o_request, urlstring, method, &ap))){
- if((dialog = thttp_dialog_new(sess))){
- ret = thttp_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS dialog.");
- ret = -2;
- }
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ thttp_session_t* sess = session;
+ va_list ap;
+ thttp_action_t* action;
+ thttp_dialog_t* dialog;
+ int ret = -1;
+
+ if(!sess || !sess->stack || !urlstring || !method) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return ret;
+ }
+
+ va_start(ap, method);
+ if((action = thttp_action_create(thttp_atype_o_request, urlstring, method, &ap))) {
+ if((dialog = thttp_dialog_new(sess))) {
+ ret = thttp_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS dialog.");
+ ret = -2;
+ }
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
@@ -103,85 +103,84 @@ int thttp_action_perform(thttp_session_handle_t *session, const char* urlstring,
//
static tsk_object_t* thttp_action_ctor(tsk_object_t * self, va_list * app)
{
- thttp_action_t *action = self;
- if(action){
- va_list* app_2;
- thttp_action_param_type_t curr;
-
- action->type = va_arg(*app, thttp_action_type_t);
- action->url = tsk_strdup(va_arg(*app, const char*));
- action->method = tsk_strdup(va_arg(*app, const char*));
- app_2 = va_arg(*app, va_list*);
-
- action->options = tsk_list_create();
- action->headers = tsk_list_create();
-
- if(!app_2){ /* XCAP stack will pass null va_list */
- goto bail;
- }
-
- while((curr = va_arg(*app_2, thttp_action_param_type_t)) != thttp_aptype_null){
- switch(curr){
- case thttp_aptype_option:
- { /* (thttp_action_option_t)ID_ENUM, (const char*)VALUE_STR */
- thttp_action_option_t id = va_arg(*app_2, thttp_action_option_t);
- const char* value = va_arg(*app_2, const char *);
- tsk_options_add_option(&action->options, id, value);
- break;
- }
-
- case thttp_aptype_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* name = va_arg(*app_2, const char *);
- const char* value = va_arg(*app_2, const char *);
- tsk_params_add_param(&action->headers, name, value);
- break;
- }
-
- case thttp_aptype_payload:
- { /* (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE */
- const void* payload = va_arg(*app_2, const void *);
- tsk_size_t size = va_arg(*app_2, tsk_size_t);
- if(payload && size){
- TSK_OBJECT_SAFE_FREE(action->payload);
- action->payload = tsk_buffer_create(payload, size);
- }
- break;
- }
-
- default:
- { /* va_list will be unsafe ==> exit */
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- goto bail;
- }
- } /* switch */
- } /* while */
- }
+ thttp_action_t *action = self;
+ if(action) {
+ va_list* app_2;
+ thttp_action_param_type_t curr;
+
+ action->type = va_arg(*app, thttp_action_type_t);
+ action->url = tsk_strdup(va_arg(*app, const char*));
+ action->method = tsk_strdup(va_arg(*app, const char*));
+ app_2 = va_arg(*app, va_list*);
+
+ action->options = tsk_list_create();
+ action->headers = tsk_list_create();
+
+ if(!app_2) { /* XCAP stack will pass null va_list */
+ goto bail;
+ }
+
+ while((curr = va_arg(*app_2, thttp_action_param_type_t)) != thttp_aptype_null) {
+ switch(curr) {
+ case thttp_aptype_option: {
+ /* (thttp_action_option_t)ID_ENUM, (const char*)VALUE_STR */
+ thttp_action_option_t id = va_arg(*app_2, thttp_action_option_t);
+ const char* value = va_arg(*app_2, const char *);
+ tsk_options_add_option(&action->options, id, value);
+ break;
+ }
+
+ case thttp_aptype_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* name = va_arg(*app_2, const char *);
+ const char* value = va_arg(*app_2, const char *);
+ tsk_params_add_param(&action->headers, name, value);
+ break;
+ }
+
+ case thttp_aptype_payload: {
+ /* (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE */
+ const void* payload = va_arg(*app_2, const void *);
+ tsk_size_t size = va_arg(*app_2, tsk_size_t);
+ if(payload && size) {
+ TSK_OBJECT_SAFE_FREE(action->payload);
+ action->payload = tsk_buffer_create(payload, size);
+ }
+ break;
+ }
+
+ default: {
+ /* va_list will be unsafe ==> exit */
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ goto bail;
+ }
+ } /* switch */
+ } /* while */
+ }
bail:
- return self;
+ return self;
}
static tsk_object_t* thttp_action_dtor(tsk_object_t * self)
-{
- thttp_action_t *action = self;
- if(action){
- TSK_FREE(action->url);
- TSK_FREE(action->method);
-
- TSK_OBJECT_SAFE_FREE(action->options);
- TSK_OBJECT_SAFE_FREE(action->headers);
- TSK_OBJECT_SAFE_FREE(action->payload);
- }
-
- return self;
+{
+ thttp_action_t *action = self;
+ if(action) {
+ TSK_FREE(action->url);
+ TSK_FREE(action->method);
+
+ TSK_OBJECT_SAFE_FREE(action->options);
+ TSK_OBJECT_SAFE_FREE(action->headers);
+ TSK_OBJECT_SAFE_FREE(action->payload);
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_action_def_s =
-{
- sizeof(thttp_action_t),
- thttp_action_ctor,
- thttp_action_dtor,
- tsk_null,
+static const tsk_object_def_t thttp_action_def_s = {
+ sizeof(thttp_action_t),
+ thttp_action_ctor,
+ thttp_action_dtor,
+ tsk_null,
};
const tsk_object_def_t *thttp_action_def_t = &thttp_action_def_s;
diff --git a/tinyHTTP/src/thttp_dialog.c b/tinyHTTP/src/thttp_dialog.c
index 1387293..cfd71a0 100755
--- a/tinyHTTP/src/thttp_dialog.c
+++ b/tinyHTTP/src/thttp_dialog.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -68,32 +68,30 @@ int thttp_dialog_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
tsk_bool_t _fsm_cond_i_401_407(thttp_dialog_t* self, thttp_message_t* message)
{
- return (THTTP_RESPONSE_CODE(message) == 401 || THTTP_RESPONSE_CODE(message) == 407);
+ return (THTTP_RESPONSE_CODE(message) == 401 || THTTP_RESPONSE_CODE(message) == 407);
}
tsk_bool_t _fsm_cond_i_1xx(thttp_dialog_t* self, thttp_message_t* message)
{
- return THTTP_RESPONSE_IS_1XX(message);
+ return THTTP_RESPONSE_IS_1XX(message);
}
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_request = thttp_atype_o_request,
- _fsm_action_close = thttp_atype_close,
- _fsm_action_message = thttp_atype_i_message,
- _fsm_action_closed = thttp_thttp_atype_closed,
- _fsm_action_error = thttp_atype_error, // Transport error and not HTTP message error (e.g. 409)
- _fsm_action_timedout = thttp_atype_timedout,
-
- /* _fsm_action_any_other = 0xFF */
+typedef enum _fsm_action_e {
+ _fsm_action_request = thttp_atype_o_request,
+ _fsm_action_close = thttp_atype_close,
+ _fsm_action_message = thttp_atype_i_message,
+ _fsm_action_closed = thttp_thttp_atype_closed,
+ _fsm_action_error = thttp_atype_error, // Transport error and not HTTP message error (e.g. 409)
+ _fsm_action_timedout = thttp_atype_timedout,
+
+ /* _fsm_action_any_other = 0xFF */
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Transfering,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Transfering,
+ _fsm_state_Terminated
}
_fsm_state_t;
@@ -102,7 +100,7 @@ _fsm_state_t;
thttp_dialog_t* thttp_dialog_create(struct thttp_session_s* session)
{
- return tsk_object_new(thttp_dialog_def_t, session);
+ return tsk_object_new(thttp_dialog_def_t, session);
}
@@ -115,122 +113,122 @@ thttp_dialog_t* thttp_dialog_create(struct thttp_session_s* session)
/* Started -> (request) -> Transfering */
int thttp_dialog_Started_2_Transfering_X_request(va_list *app)
{
- thttp_dialog_t *self;
- const thttp_action_t* action;
- thttp_event_t* e;
-
- self = va_arg(*app, thttp_dialog_t *);
- va_arg(*app, const thttp_message_t *);
- action = va_arg(*app, const thttp_action_t *);
-
- if(!self->action){
- self->action = tsk_object_ref((void*)action);
- }
-
- // alert the user
- if((e = thttp_event_create(thttp_event_dialog_started, self->session, "Dialog Started", tsk_null))){
- /*ret =*/ thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
-
- return thttp_dialog_send_request(self);
+ thttp_dialog_t *self;
+ const thttp_action_t* action;
+ thttp_event_t* e;
+
+ self = va_arg(*app, thttp_dialog_t *);
+ va_arg(*app, const thttp_message_t *);
+ action = va_arg(*app, const thttp_action_t *);
+
+ if(!self->action) {
+ self->action = tsk_object_ref((void*)action);
+ }
+
+ // alert the user
+ if((e = thttp_event_create(thttp_event_dialog_started, self->session, "Dialog Started", tsk_null))) {
+ /*ret =*/ thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
+
+ return thttp_dialog_send_request(self);
}
/* Transfering -> (401/407) -> Transfering */
int thttp_dialog_Transfering_2_Transfering_X_401_407(va_list *app)
{
- int ret;
- thttp_dialog_t *self;
- const thttp_response_t* response;
-
- self = va_arg(*app, thttp_dialog_t*);
- response = va_arg(*app, const thttp_response_t *);
- // will use the current action parameters
-
- if((ret = thttp_session_update_challenges(self->session, response, self->answered))){
- thttp_event_t* e = tsk_null;
- TSK_DEBUG_ERROR("HTTP authentication failed.");
-
- if((e = thttp_event_create(thttp_event_auth_failed, self->session, THTTP_MESSAGE_DESCRIPTION(response), response))){
- thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
-
- return ret;
- }
-
- self->answered = tsk_true;
-
- /* Retry with creadentials. */
- ret = thttp_dialog_send_request(self);
-
- /* very important: do not break the state machine for transport error events
- * => let the transport layer do it for us (throught tnet_transport_error event).
- * => transport_error event will be queued and sent after this event (i_message)
- */
- if(ret == THTTP_DIALOG_TRANSPORT_ERROR_CODE){
- return 0;
- }
- else{
- return ret;
- }
+ int ret;
+ thttp_dialog_t *self;
+ const thttp_response_t* response;
+
+ self = va_arg(*app, thttp_dialog_t*);
+ response = va_arg(*app, const thttp_response_t *);
+ // will use the current action parameters
+
+ if((ret = thttp_session_update_challenges(self->session, response, self->answered))) {
+ thttp_event_t* e = tsk_null;
+ TSK_DEBUG_ERROR("HTTP authentication failed.");
+
+ if((e = thttp_event_create(thttp_event_auth_failed, self->session, THTTP_MESSAGE_DESCRIPTION(response), response))) {
+ thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
+
+ return ret;
+ }
+
+ self->answered = tsk_true;
+
+ /* Retry with creadentials. */
+ ret = thttp_dialog_send_request(self);
+
+ /* very important: do not break the state machine for transport error events
+ * => let the transport layer do it for us (throught tnet_transport_error event).
+ * => transport_error event will be queued and sent after this event (i_message)
+ */
+ if(ret == THTTP_DIALOG_TRANSPORT_ERROR_CODE) {
+ return 0;
+ }
+ else {
+ return ret;
+ }
}
/* Transfering -> (1xx) -> Transfering */
int thttp_dialog_Transfering_2_Transfering_X_1xx(va_list *app)
{
- // reset timer?
- return 0;
+ // reset timer?
+ return 0;
}
/* Transfering -> (message) -> Terminated */
int thttp_dialog_Transfering_2_Terminated_X_message(va_list *app)
{
- thttp_dialog_t *self = va_arg(*app, thttp_dialog_t*);
- const thttp_message_t *message = va_arg(*app, const thttp_message_t *);
- thttp_event_t* e = tsk_null;
- int ret = -2;
-
- // alert the user
- if((e = thttp_event_create(thttp_event_message, self->session, THTTP_MESSAGE_DESCRIPTION(message), message))){
- ret = thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
-
- return ret;
+ thttp_dialog_t *self = va_arg(*app, thttp_dialog_t*);
+ const thttp_message_t *message = va_arg(*app, const thttp_message_t *);
+ thttp_event_t* e = tsk_null;
+ int ret = -2;
+
+ // alert the user
+ if((e = thttp_event_create(thttp_event_message, self->session, THTTP_MESSAGE_DESCRIPTION(message), message))) {
+ ret = thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
+
+ return ret;
}
/* Any -> (closed) -> Terminated */
int thttp_dialog_Any_2_Terminated_X_closed(va_list *app)
{
- int ret = -2;
- thttp_dialog_t *self = va_arg(*app, thttp_dialog_t *);
- thttp_event_t* e;
- //self->fd = TNET_INVALID_FD; // to avoid close(fd) in the destructor
-
- // alert the user
- if((e = thttp_event_create(thttp_event_closed, self->session, "Connection closed", tsk_null))){
- ret = thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
-
- return 0;
+ int ret = -2;
+ thttp_dialog_t *self = va_arg(*app, thttp_dialog_t *);
+ thttp_event_t* e;
+ //self->fd = TNET_INVALID_FD; // to avoid close(fd) in the destructor
+
+ // alert the user
+ if((e = thttp_event_create(thttp_event_closed, self->session, "Connection closed", tsk_null))) {
+ ret = thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
+
+ return 0;
}
/* Any -> (error) -> Terminated */
int thttp_dialog_Any_2_Terminated_X_Error(va_list *app)
{
- int ret = -2;
- thttp_dialog_t *self = va_arg(*app, thttp_dialog_t *);
- thttp_event_t* e;
+ int ret = -2;
+ thttp_dialog_t *self = va_arg(*app, thttp_dialog_t *);
+ thttp_event_t* e;
- // alert the user
- if((e = thttp_event_create(thttp_event_transport_error, self->session, "Transport error", tsk_null))){
- ret = thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
+ // alert the user
+ if((e = thttp_event_create(thttp_event_transport_error, self->session, "Transport error", tsk_null))) {
+ ret = thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
- return 0;
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -241,203 +239,202 @@ int thttp_dialog_Any_2_Terminated_X_Error(va_list *app)
*/
int thttp_dialog_fsm_act(thttp_dialog_t* self, tsk_fsm_action_id action_id, const thttp_message_t* message, const thttp_action_t* action)
{
- if(!self || !self->fsm){
- return -1;
- }
- return tsk_fsm_act(self->fsm, action_id, self, message, self, message, action);
+ if(!self || !self->fsm) {
+ return -1;
+ }
+ return tsk_fsm_act(self->fsm, action_id, self, message, self, message, action);
}
// create new dialog and add it to the stack's list of dialogs
// you must free the returned object
thttp_dialog_t* thttp_dialog_new(thttp_session_t* session)
{
- thttp_dialog_t* ret = tsk_null;
- thttp_dialog_t* dialog;
- if(session && session->stack){
- if((dialog = thttp_dialog_create(session))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(session->dialogs, (void**)&dialog);
- }
- }
- return ret;
+ thttp_dialog_t* ret = tsk_null;
+ thttp_dialog_t* dialog;
+ if(session && session->stack) {
+ if((dialog = thttp_dialog_create(session))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(session->dialogs, (void**)&dialog);
+ }
+ }
+ return ret;
}
// Returns the oldest dialog.
// you must free the returned object
thttp_dialog_t* thttp_dialog_get_oldest(thttp_dialogs_L_t* dialogs)
{
- thttp_dialog_t* ret = tsk_null;
- thttp_dialog_t* dialog = tsk_null;
- const tsk_list_item_t *item;
- if(dialogs){
- tsk_list_foreach(item, dialogs){
- if(!dialog || (dialog->timestamp >=((thttp_dialog_t*)item->data)->timestamp)){
- dialog = (thttp_dialog_t*)item->data;
- }
- }
- ret = tsk_object_ref(dialog);
- }
- return ret;
+ thttp_dialog_t* ret = tsk_null;
+ thttp_dialog_t* dialog = tsk_null;
+ const tsk_list_item_t *item;
+ if(dialogs) {
+ tsk_list_foreach(item, dialogs) {
+ if(!dialog || (dialog->timestamp >=((thttp_dialog_t*)item->data)->timestamp)) {
+ dialog = (thttp_dialog_t*)item->data;
+ }
+ }
+ ret = tsk_object_ref(dialog);
+ }
+ return ret;
}
// sends a request.
int thttp_dialog_send_request(thttp_dialog_t *self)
{
- int ret = -1;
- const tsk_list_item_t* item;
- thttp_request_t* request = tsk_null;
- tsk_buffer_t* output = tsk_null;
- thttp_url_t* url;
- tnet_socket_type_t type;
- int timeout = TNET_CONNECT_TIMEOUT, _timeout = -1;
-
- if(!self || !self->session || !self->action){
- return -1;
- }
-
- if(!self->action->method || !self->action->url){
- TSK_DEBUG_ERROR("Invlaid parameter");
- return -2;
- }
-
- if((url = thttp_url_parse(self->action->url, tsk_strlen(self->action->url)))){
- request = thttp_request_create(self->action->method, url);
- TSK_OBJECT_SAFE_FREE(url);
- }
- else{
- TSK_DEBUG_ERROR("%s is an invalid HTTP/HTTPS URL.", self->action->url);
- ret = -3;
- goto bail;
- }
-
- /* ==Add headers, options, ... associated to the SESSION== */
- tsk_list_foreach(item, self->session->headers){
- THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- if(self->session->options){
- if((_timeout = tsk_options_get_option_value_as_int(self->session->options, THTTP_ACTION_OPTION_TIMEOUT)) > 0){
- timeout = _timeout; //could be updated by the action
- }
- }
-
- /* ==Add headers, options, and content associated to the ACTION== */
- if(self->action){
- if(self->action->payload){
- thttp_message_add_content(request, tsk_null, self->action->payload->data, self->action->payload->size);
- }
- if(self->action->options){
- if((_timeout = tsk_options_get_option_value_as_int(self->action->options, THTTP_ACTION_OPTION_TIMEOUT)) > 0){
- timeout = _timeout;
- }
- }
- tsk_list_foreach(item, self->action->headers){
- THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- }
-
- /* ==Add creadentials== */
- if(!TSK_LIST_IS_EMPTY(self->session->challenges))
- {
- thttp_challenge_t *challenge;
- thttp_header_t* auth_hdr;
- tsk_list_foreach(item, self->session->challenges){
- challenge = item->data;
- if((auth_hdr = thttp_challenge_create_header_authorization(challenge, self->session->cred.usename, self->session->cred.password, request))){
- thttp_message_add_header(request, auth_hdr);
- tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
- }
- }
- }
-
- /* ==Sends the request== */
- output = tsk_buffer_create_null();
- type = tnet_transport_get_type(self->session->stack->transport);
-
- /* Serialize the message and send it */
- if((ret = thttp_message_serialize(request, output))){
- TSK_DEBUG_ERROR("Failed to serialize the HTTP request.");
- goto bail;
- }
- else{
- if(request->line.request.url->type == thttp_url_https){
- TNET_SOCKET_TYPE_SET_TLS(type);
- }
- else{
- TNET_SOCKET_TYPE_SET_TCP(type);
- }
- }
-
- /* connect to the server not already done */
- if(self->session->fd == TNET_INVALID_FD){
- const char* host = request->line.request.url->host;
- uint16_t port = request->line.request.url->port;
- if (!tsk_strnullORempty(self->session->stack->proxy_ip) && self->session->stack->proxy_port) {
- host = self->session->stack->proxy_ip;
- port = self->session->stack->proxy_port;
- }
- if ((self->session->fd = tnet_transport_connectto(self->session->stack->transport, host, port, type)) == TNET_INVALID_FD) {
- TSK_DEBUG_ERROR("Failed to connect to %s:%d.", host, port);
- ret = -3;
- goto bail;
- }
-
- if ((ret = tnet_sockfd_waitUntilWritable(self->session->fd, timeout))) {
- TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", timeout);
- if(tnet_transport_remove_socket(self->session->stack->transport, &self->session->fd)){
- tnet_sockfd_close(&self->session->fd);
- }
- goto bail;
- }
- }
- if (tnet_transport_send(self->session->stack->transport, self->session->fd, output->data, output->size)) {
- TSK_DEBUG_INFO("HTTP/HTTPS message successfully sent.");
- thttp_dialog_update_timestamp(self);
- ret = 0;
- }
- else {
- TSK_DEBUG_INFO("Failed to sent HTTP/HTTPS message.");
- ret = THTTP_DIALOG_TRANSPORT_ERROR_CODE;
- }
+ int ret = -1;
+ const tsk_list_item_t* item;
+ thttp_request_t* request = tsk_null;
+ tsk_buffer_t* output = tsk_null;
+ thttp_url_t* url;
+ tnet_socket_type_t type;
+ int timeout = TNET_CONNECT_TIMEOUT, _timeout = -1;
+
+ if(!self || !self->session || !self->action) {
+ return -1;
+ }
+
+ if(!self->action->method || !self->action->url) {
+ TSK_DEBUG_ERROR("Invlaid parameter");
+ return -2;
+ }
+
+ if((url = thttp_url_parse(self->action->url, tsk_strlen(self->action->url)))) {
+ request = thttp_request_create(self->action->method, url);
+ TSK_OBJECT_SAFE_FREE(url);
+ }
+ else {
+ TSK_DEBUG_ERROR("%s is an invalid HTTP/HTTPS URL.", self->action->url);
+ ret = -3;
+ goto bail;
+ }
+
+ /* ==Add headers, options, ... associated to the SESSION== */
+ tsk_list_foreach(item, self->session->headers) {
+ THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ if(self->session->options) {
+ if((_timeout = tsk_options_get_option_value_as_int(self->session->options, THTTP_ACTION_OPTION_TIMEOUT)) > 0) {
+ timeout = _timeout; //could be updated by the action
+ }
+ }
+
+ /* ==Add headers, options, and content associated to the ACTION== */
+ if(self->action) {
+ if(self->action->payload) {
+ thttp_message_add_content(request, tsk_null, self->action->payload->data, self->action->payload->size);
+ }
+ if(self->action->options) {
+ if((_timeout = tsk_options_get_option_value_as_int(self->action->options, THTTP_ACTION_OPTION_TIMEOUT)) > 0) {
+ timeout = _timeout;
+ }
+ }
+ tsk_list_foreach(item, self->action->headers) {
+ THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ }
+
+ /* ==Add creadentials== */
+ if(!TSK_LIST_IS_EMPTY(self->session->challenges)) {
+ thttp_challenge_t *challenge;
+ thttp_header_t* auth_hdr;
+ tsk_list_foreach(item, self->session->challenges) {
+ challenge = item->data;
+ if((auth_hdr = thttp_challenge_create_header_authorization(challenge, self->session->cred.usename, self->session->cred.password, request))) {
+ thttp_message_add_header(request, auth_hdr);
+ tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
+ }
+ }
+ }
+
+ /* ==Sends the request== */
+ output = tsk_buffer_create_null();
+ type = tnet_transport_get_type(self->session->stack->transport);
+
+ /* Serialize the message and send it */
+ if((ret = thttp_message_serialize(request, output))) {
+ TSK_DEBUG_ERROR("Failed to serialize the HTTP request.");
+ goto bail;
+ }
+ else {
+ if(request->line.request.url->type == thttp_url_https) {
+ TNET_SOCKET_TYPE_SET_TLS(type);
+ }
+ else {
+ TNET_SOCKET_TYPE_SET_TCP(type);
+ }
+ }
+
+ /* connect to the server not already done */
+ if(self->session->fd == TNET_INVALID_FD) {
+ const char* host = request->line.request.url->host;
+ uint16_t port = request->line.request.url->port;
+ if (!tsk_strnullORempty(self->session->stack->proxy_ip) && self->session->stack->proxy_port) {
+ host = self->session->stack->proxy_ip;
+ port = self->session->stack->proxy_port;
+ }
+ if ((self->session->fd = tnet_transport_connectto(self->session->stack->transport, host, port, type)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect to %s:%d.", host, port);
+ ret = -3;
+ goto bail;
+ }
+
+ if ((ret = tnet_sockfd_waitUntilWritable(self->session->fd, timeout))) {
+ TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", timeout);
+ if(tnet_transport_remove_socket(self->session->stack->transport, &self->session->fd)) {
+ tnet_sockfd_close(&self->session->fd);
+ }
+ goto bail;
+ }
+ }
+ if (tnet_transport_send(self->session->stack->transport, self->session->fd, output->data, output->size)) {
+ TSK_DEBUG_INFO("HTTP/HTTPS message successfully sent.");
+ thttp_dialog_update_timestamp(self);
+ ret = 0;
+ }
+ else {
+ TSK_DEBUG_INFO("Failed to sent HTTP/HTTPS message.");
+ ret = THTTP_DIALOG_TRANSPORT_ERROR_CODE;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(request);
- TSK_OBJECT_SAFE_FREE(output);
+ TSK_OBJECT_SAFE_FREE(request);
+ TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ return ret;
}
/** Update timestamp (used to match requests with responses)
*/
int thttp_dialog_update_timestamp(thttp_dialog_t *self)
{
- static uint64_t timestamp = 0;
- if(self){
- self->timestamp = timestamp++;
- return 0;
- }
- return -1;
+ static uint64_t timestamp = 0;
+ if(self) {
+ self->timestamp = timestamp++;
+ return 0;
+ }
+ return -1;
}
/** Called by the FSM manager when the dialog enters in the terminal state.
*/
int thttp_dialog_OnTerminated(thttp_dialog_t *self)
{
- TSK_DEBUG_INFO("=== HTTP/HTTPS Dialog terminated ===");
-
- /* removes the dialog from the session */
- if(self->session){
- thttp_event_t* e;
- // alert the user
- if((e = thttp_event_create(thttp_event_dialog_terminated, self->session, "Dialog Terminated", tsk_null))){
- /*ret =*/ thttp_stack_alert(self->session->stack, e);
- TSK_OBJECT_SAFE_FREE(e);
- }
-
- tsk_list_remove_item_by_data(self->session->dialogs, self);
- return 0;
- }
-
- return -1;
+ TSK_DEBUG_INFO("=== HTTP/HTTPS Dialog terminated ===");
+
+ /* removes the dialog from the session */
+ if(self->session) {
+ thttp_event_t* e;
+ // alert the user
+ if((e = thttp_event_create(thttp_event_dialog_terminated, self->session, "Dialog Terminated", tsk_null))) {
+ /*ret =*/ thttp_stack_alert(self->session->stack, e);
+ TSK_OBJECT_SAFE_FREE(e);
+ }
+
+ tsk_list_remove_item_by_data(self->session->dialogs, self);
+ return 0;
+ }
+
+ return -1;
}
@@ -452,89 +449,88 @@ int thttp_dialog_OnTerminated(thttp_dialog_t *self)
//
static tsk_object_t* thttp_dialog_ctor(tsk_object_t * self, va_list * app)
{
- thttp_dialog_t *dialog = self;
- static thttp_dialog_id_t unique_id = 0;
- if(dialog){
- dialog->id = ++unique_id;
- if (!(dialog->buf = tsk_buffer_create_null())) {
- return tsk_null;
- }
- dialog->session = tsk_object_ref(va_arg(*app, thttp_session_t*));
-
- /* create and init FSM */
- dialog->fsm = tsk_fsm_create(_fsm_state_Started, _fsm_state_Terminated);
- dialog->fsm->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(dialog->fsm, TSK_FSM_ONTERMINATED_F(thttp_dialog_OnTerminated), dialog);
- tsk_fsm_set(dialog->fsm,
-
- /*=======================
- * === Started ===
- */
- // Started -> (request) -> Transfering
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_request, _fsm_state_Transfering, thttp_dialog_Started_2_Transfering_X_request, "thttp_dialog_Started_2_Transfering_X_request"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "thttp_dialog_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Transfering ===
- */
- // Transfering -> (401/407) -> Transfering
- TSK_FSM_ADD(_fsm_state_Transfering, _fsm_action_message, _fsm_cond_i_401_407, _fsm_state_Transfering, thttp_dialog_Transfering_2_Transfering_X_401_407, "thttp_dialog_Transfering_2_Transfering_X_401_407"),
- // Transfering -> (1xx) -> Transfering
- TSK_FSM_ADD(_fsm_state_Transfering, _fsm_action_message, _fsm_cond_i_1xx, _fsm_state_Transfering, thttp_dialog_Transfering_2_Transfering_X_1xx, "thttp_dialog_Transfering_2_Transfering_X_1xx"),
- // Transfering -> (any other response) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Transfering, _fsm_action_message, _fsm_state_Terminated, thttp_dialog_Transfering_2_Terminated_X_message, "thttp_dialog_Transfering_2_Terminated_X_message"),
- /*=======================
- * === Any ===
- */
-
- // Any -> (closed) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_closed, _fsm_state_Terminated, thttp_dialog_Any_2_Terminated_X_closed, "thttp_dialog_Any_2_Terminated_X_closed"),
- // Any -> (error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, thttp_dialog_Any_2_Terminated_X_Error, "thttp_dialog_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- thttp_dialog_update_timestamp(self);
- }
- return self;
+ thttp_dialog_t *dialog = self;
+ static thttp_dialog_id_t unique_id = 0;
+ if(dialog) {
+ dialog->id = ++unique_id;
+ if (!(dialog->buf = tsk_buffer_create_null())) {
+ return tsk_null;
+ }
+ dialog->session = tsk_object_ref(va_arg(*app, thttp_session_t*));
+
+ /* create and init FSM */
+ dialog->fsm = tsk_fsm_create(_fsm_state_Started, _fsm_state_Terminated);
+ dialog->fsm->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(dialog->fsm, TSK_FSM_ONTERMINATED_F(thttp_dialog_OnTerminated), dialog);
+ tsk_fsm_set(dialog->fsm,
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (request) -> Transfering
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_request, _fsm_state_Transfering, thttp_dialog_Started_2_Transfering_X_request, "thttp_dialog_Started_2_Transfering_X_request"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "thttp_dialog_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Transfering ===
+ */
+ // Transfering -> (401/407) -> Transfering
+ TSK_FSM_ADD(_fsm_state_Transfering, _fsm_action_message, _fsm_cond_i_401_407, _fsm_state_Transfering, thttp_dialog_Transfering_2_Transfering_X_401_407, "thttp_dialog_Transfering_2_Transfering_X_401_407"),
+ // Transfering -> (1xx) -> Transfering
+ TSK_FSM_ADD(_fsm_state_Transfering, _fsm_action_message, _fsm_cond_i_1xx, _fsm_state_Transfering, thttp_dialog_Transfering_2_Transfering_X_1xx, "thttp_dialog_Transfering_2_Transfering_X_1xx"),
+ // Transfering -> (any other response) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Transfering, _fsm_action_message, _fsm_state_Terminated, thttp_dialog_Transfering_2_Terminated_X_message, "thttp_dialog_Transfering_2_Terminated_X_message"),
+ /*=======================
+ * === Any ===
+ */
+
+ // Any -> (closed) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_closed, _fsm_state_Terminated, thttp_dialog_Any_2_Terminated_X_closed, "thttp_dialog_Any_2_Terminated_X_closed"),
+ // Any -> (error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, thttp_dialog_Any_2_Terminated_X_Error, "thttp_dialog_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ thttp_dialog_update_timestamp(self);
+ }
+ return self;
}
static tsk_object_t* thttp_dialog_dtor(tsk_object_t * self)
-{
- thttp_dialog_t *dialog = self;
- if(dialog){
- TSK_DEBUG_INFO("*** HTTP/HTTPS Dialog destroyed ***");
+{
+ thttp_dialog_t *dialog = self;
+ if(dialog) {
+ TSK_DEBUG_INFO("*** HTTP/HTTPS Dialog destroyed ***");
+
+ TSK_OBJECT_SAFE_FREE(dialog->fsm);
- TSK_OBJECT_SAFE_FREE(dialog->fsm);
-
- TSK_OBJECT_SAFE_FREE(dialog->session);
- TSK_OBJECT_SAFE_FREE(dialog->action);
+ TSK_OBJECT_SAFE_FREE(dialog->session);
+ TSK_OBJECT_SAFE_FREE(dialog->action);
- TSK_OBJECT_SAFE_FREE(dialog->buf);
- }
+ TSK_OBJECT_SAFE_FREE(dialog->buf);
+ }
- return self;
+ return self;
}
static int thttp_dialog_cmp(const tsk_object_t *_d1, const tsk_object_t *_d2)
{
- const thttp_dialog_t *d1 = _d1;
- const thttp_dialog_t *d2 = _d2;
+ const thttp_dialog_t *d1 = _d1;
+ const thttp_dialog_t *d2 = _d2;
- if(d1 && d2){
- return (int)(d1->id-d2->id);
- }
- return -1;
+ if(d1 && d2) {
+ return (int)(d1->id-d2->id);
+ }
+ return -1;
}
-static const tsk_object_def_t thttp_dialog_def_s =
-{
- sizeof(thttp_dialog_t),
- thttp_dialog_ctor,
- thttp_dialog_dtor,
- thttp_dialog_cmp,
+static const tsk_object_def_t thttp_dialog_def_s = {
+ sizeof(thttp_dialog_t),
+ thttp_dialog_ctor,
+ thttp_dialog_dtor,
+ thttp_dialog_cmp,
};
const tsk_object_def_t *thttp_dialog_def_t = &thttp_dialog_def_s;
diff --git a/tinyHTTP/src/thttp_event.c b/tinyHTTP/src/thttp_event.c
index dadc9f0..58ea3dd 100755
--- a/tinyHTTP/src/thttp_event.c
+++ b/tinyHTTP/src/thttp_event.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,7 +37,7 @@
thttp_event_t* thttp_event_create(thttp_event_type_t type, const thttp_session_handle_t* session, const char* description, const thttp_message_t* message)
{
- return tsk_object_new(thttp_event_def_t, type, session, description, message);
+ return tsk_object_new(thttp_event_def_t, type, session, description, message);
}
@@ -51,31 +51,30 @@ thttp_event_t* thttp_event_create(thttp_event_type_t type, const thttp_session_h
//
static void* thttp_event_ctor(void * self, va_list * app)
{
- thttp_event_t *httpevent = self;
- if(httpevent){
- httpevent->type = va_arg(*app, thttp_event_type_t);
- httpevent->session = va_arg(*app, const thttp_session_handle_t*);
- httpevent->description = tsk_strdup( va_arg(*app, const char *) );
- httpevent->message = tsk_object_ref((void*)va_arg(*app, thttp_message_t *));
- }
- return self;
+ thttp_event_t *httpevent = self;
+ if(httpevent) {
+ httpevent->type = va_arg(*app, thttp_event_type_t);
+ httpevent->session = va_arg(*app, const thttp_session_handle_t*);
+ httpevent->description = tsk_strdup( va_arg(*app, const char *) );
+ httpevent->message = tsk_object_ref((void*)va_arg(*app, thttp_message_t *));
+ }
+ return self;
}
static void* thttp_event_dtor(void * self)
-{
- thttp_event_t *httpevent = self;
- if(httpevent){
- TSK_FREE(httpevent->description);
- TSK_OBJECT_SAFE_FREE(httpevent->message);
- }
- return self;
+{
+ thttp_event_t *httpevent = self;
+ if(httpevent) {
+ TSK_FREE(httpevent->description);
+ TSK_OBJECT_SAFE_FREE(httpevent->message);
+ }
+ return self;
}
-static const tsk_object_def_t thttp_event_def_s =
-{
- sizeof(thttp_event_t),
- thttp_event_ctor,
- thttp_event_dtor,
- tsk_null,
+static const tsk_object_def_t thttp_event_def_s = {
+ sizeof(thttp_event_t),
+ thttp_event_ctor,
+ thttp_event_dtor,
+ tsk_null,
};
const void *thttp_event_def_t = &thttp_event_def_s;
diff --git a/tinyHTTP/src/thttp_message.c b/tinyHTTP/src/thttp_message.c
index 619576e..4c26c93 100755
--- a/tinyHTTP/src/thttp_message.c
+++ b/tinyHTTP/src/thttp_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,35 +37,32 @@
static int pred_find_string_by_value(const tsk_list_item_t *item, const void *stringVal)
{
- if(item && item->data)
- {
- tsk_string_t *string = item->data;
- return tsk_stricmp(string->value, stringVal);
- }
- return -1;
+ if(item && item->data) {
+ tsk_string_t *string = item->data;
+ return tsk_stricmp(string->value, stringVal);
+ }
+ return -1;
}
/*== Predicate function to find thttp_header_t object by type. */
static int pred_find_header_by_type(const tsk_list_item_t *item, const void *thttp_htype)
{
- if(item && item->data)
- {
- thttp_header_t *header = item->data;
- thttp_header_type_t htype = *((thttp_header_type_t*)thttp_htype);
- return (header->type - htype);
- }
- return -1;
+ if(item && item->data) {
+ thttp_header_t *header = item->data;
+ thttp_header_type_t htype = *((thttp_header_type_t*)thttp_htype);
+ return (header->type - htype);
+ }
+ return -1;
}
/*== Predicate function to find thttp_header_t object by name. */
static int pred_find_header_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data)
- {
- thttp_header_t *header = item->data;
- return tsk_stricmp(thttp_header_get_nameex(header), name);
- }
- return -1;
+ if(item && item->data) {
+ thttp_header_t *header = item->data;
+ return tsk_stricmp(thttp_header_get_nameex(header), name);
+ }
+ return -1;
}
@@ -76,7 +73,7 @@ static int pred_find_header_by_name(const tsk_list_item_t *item, const void *nam
*/
thttp_message_t* thttp_message_create()
{
- return tsk_object_new(thttp_message_def_t, thttp_unknown);
+ return tsk_object_new(thttp_message_def_t, thttp_unknown);
}
/**@ingroup thttp_message_group
@@ -91,7 +88,7 @@ thttp_url_t* url;
thttp_request_t* request;
if((url = thttp_url_parse("http://www.google.com", tsk_strlen("http://www.google.com")))){
request = thttp_request_create("GET", url);
- // ...
+ // ...
TSK_OBJECT_SAFE_FREE(url);
TSK_OBJECT_SAFE_FREE(request);
}
@@ -99,7 +96,7 @@ if((url = thttp_url_parse("http://www.google.com", tsk_strlen("http://www.google
*/
thttp_request_t* thttp_request_create(const char* method, const thttp_url_t* url)
{
- return tsk_object_new(thttp_message_def_t, thttp_request, method, url);
+ return tsk_object_new(thttp_message_def_t, thttp_request, method, url);
}
@@ -122,7 +119,7 @@ if((response = thttp_response_create(request, 200, "OK"))){
*/
thttp_response_t* thttp_response_create(const thttp_request_t* request, short status_code, const char* reason_phrase)
{
- return tsk_object_new(thttp_message_def_t, thttp_response, request, status_code, reason_phrase);
+ return tsk_object_new(thttp_message_def_t, thttp_response, request, status_code, reason_phrase);
}
@@ -130,7 +127,7 @@ thttp_response_t* thttp_response_create(const thttp_request_t* request, short st
*/
int thttp_message_add_header(thttp_message_t *self, const thttp_header_t *hdr)
{
- #define ADD_HEADER(type, field) \
+#define ADD_HEADER(type, field) \
case thttp_htype_##type: \
{ \
if(!self->field) \
@@ -140,299 +137,295 @@ int thttp_message_add_header(thttp_message_t *self, const thttp_header_t *hdr)
} \
break; \
}
-
- if(self && hdr)
- {
- thttp_header_t *header = tsk_object_ref((void*)hdr);
- switch(header->type)
- {
- ADD_HEADER(Content_Type, Content_Type);
- ADD_HEADER(Content_Length, Content_Length);
+ if(self && hdr) {
+ thttp_header_t *header = tsk_object_ref((void*)hdr);
+
+ switch(header->type) {
+ ADD_HEADER(Content_Type, Content_Type);
+ ADD_HEADER(Content_Length, Content_Length);
- default: break;
- }
+ default:
+ break;
+ }
- tsk_list_push_back_data(self->headers, (void**)&header);
+ tsk_list_push_back_data(self->headers, (void**)&header);
- return 0;
- }
- return -1;
+ return 0;
+ }
+ return -1;
}
/**@ingroup thttp_message_group
*/
int thttp_message_add_headers(thttp_message_t *self, const thttp_headers_L_t *headers)
{
- tsk_list_item_t *item = 0;
- if(self)
- {
- tsk_list_foreach(item, headers){
- thttp_message_add_header(self, item->data);
- }
- return 0;
- }
- return -1;
+ tsk_list_item_t *item = 0;
+ if(self) {
+ tsk_list_foreach(item, headers) {
+ thttp_message_add_header(self, item->data);
+ }
+ return 0;
+ }
+ return -1;
}
int thttp_message_add_headers_2(thttp_message_t *self, ...)
{
- const tsk_object_def_t* objdef;
- thttp_header_t *header;
- va_list ap;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if((header = tsk_object_new_2(objdef, &ap))){
- thttp_message_add_header(self, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- va_end(ap);
-
- return 0;
+ const tsk_object_def_t* objdef;
+ thttp_header_t *header;
+ va_list ap;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ thttp_message_add_header(self, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
/**@ingroup thttp_message_group
*/
int thttp_message_add_content(thttp_message_t *self, const char* content_type, const void* content, tsk_size_t size)
{
- if(self && content && size)
- {
- if(content_type){
- TSK_OBJECT_SAFE_FREE(self->Content_Type);
- }
- TSK_OBJECT_SAFE_FREE(self->Content_Length);
- TSK_OBJECT_SAFE_FREE(self->Content);
-
- if(content_type){
- THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
- }
- THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
- self->Content = tsk_buffer_create(content, size);
-
- return 0;
- }
- return -1;
+ if(self && content && size) {
+ if(content_type) {
+ TSK_OBJECT_SAFE_FREE(self->Content_Type);
+ }
+ TSK_OBJECT_SAFE_FREE(self->Content_Length);
+ TSK_OBJECT_SAFE_FREE(self->Content);
+
+ if(content_type) {
+ THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
+ }
+ THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
+ self->Content = tsk_buffer_create(content, size);
+
+ return 0;
+ }
+ return -1;
}
/**@ingroup thttp_message_group
*/
int thttp_message_append_content(thttp_message_t *self, const void* content, tsk_size_t size)
{
- if(self && content && size){
- if(!self->Content){
- self->Content = tsk_buffer_create(content, size);
- }
- else{
- tsk_buffer_append(self->Content, content, size);
- }
-
- if(!self->Content_Length){
- THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
- }
- else{
- self->Content_Length->length += (uint32_t)size;
- }
- return 0;
- }
-
- return -1;
+ if(self && content && size) {
+ if(!self->Content) {
+ self->Content = tsk_buffer_create(content, size);
+ }
+ else {
+ tsk_buffer_append(self->Content, content, size);
+ }
+
+ if(!self->Content_Length) {
+ THTTP_MESSAGE_ADD_HEADER(self, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
+ }
+ else {
+ self->Content_Length->length += (uint32_t)size;
+ }
+ return 0;
+ }
+
+ return -1;
}
/**@ingroup thttp_message_group
*/
const thttp_header_t *thttp_message_get_headerAt(const thttp_message_t *self, thttp_header_type_t type, tsk_size_t index)
{
- tsk_size_t pos = 0;
- tsk_list_item_t *item;
- const thttp_header_t* hdr = tsk_null;
-
- if(self)
- {
- switch(type)
- {
- case thttp_htype_Content_Type:
- if(index == 0){
- hdr = (const thttp_header_t*)self->Content_Type;
- goto bail;
- }else pos++; break;
- case thttp_htype_Content_Length:
- if(index == 0){
- hdr = (const thttp_header_t*)self->Content_Length;
- goto bail;
- }else pos++; break;
- default:
- break;
- }
-
- tsk_list_foreach(item, self->headers)
- {
- if(!pred_find_header_by_type(item, &type))
- {
- if(pos++ >= index)
- {
- hdr = item->data;
- break;
- }
- }
- }
- }
+ tsk_size_t pos = 0;
+ tsk_list_item_t *item;
+ const thttp_header_t* hdr = tsk_null;
+
+ if(self) {
+ switch(type) {
+ case thttp_htype_Content_Type:
+ if(index == 0) {
+ hdr = (const thttp_header_t*)self->Content_Type;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case thttp_htype_Content_Length:
+ if(index == 0) {
+ hdr = (const thttp_header_t*)self->Content_Length;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ default:
+ break;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ if(!pred_find_header_by_type(item, &type)) {
+ if(pos++ >= index) {
+ hdr = item->data;
+ break;
+ }
+ }
+ }
+ }
bail:
- return hdr;
+ return hdr;
}
/**@ingroup thttp_message_group
*/
const thttp_header_t *thttp_message_get_header(const thttp_message_t *self, thttp_header_type_t type)
{
- return thttp_message_get_headerAt(self, type, 0);
+ return thttp_message_get_headerAt(self, type, 0);
}
/**@ingroup thttp_message_group
*/
const thttp_header_t *thttp_message_get_headerByName(const thttp_message_t *self, const char* name)
{
- //tsk_size_t pos = 0;
- tsk_list_item_t *item;
- const thttp_header_t* hdr = tsk_null;
-
- if(self)
- {
- if(tsk_striequals(name, "Content-Type")){
- hdr = (const thttp_header_t*)self->Content_Type;
- goto bail;
- }
-
- if(tsk_striequals(name, "Content-Length")){
- hdr = (const thttp_header_t*)self->Content_Length;
- goto bail;
- }
-
- tsk_list_foreach(item, self->headers)
- {
- if(!pred_find_header_by_name(item, name))
- {
- hdr = item->data;
- break;
- }
- }
- }
+ //tsk_size_t pos = 0;
+ tsk_list_item_t *item;
+ const thttp_header_t* hdr = tsk_null;
+
+ if(self) {
+ if(tsk_striequals(name, "Content-Type")) {
+ hdr = (const thttp_header_t*)self->Content_Type;
+ goto bail;
+ }
+
+ if(tsk_striequals(name, "Content-Length")) {
+ hdr = (const thttp_header_t*)self->Content_Length;
+ goto bail;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ if(!pred_find_header_by_name(item, name)) {
+ hdr = item->data;
+ break;
+ }
+ }
+ }
bail:
- return hdr;
+ return hdr;
}
/**@ingroup thttp_message_group
*/
int thttp_message_serialize(const thttp_message_t *self, tsk_buffer_t *output)
{
- if(!self || !output){
- return -1;
- }
-
- if(THTTP_MESSAGE_IS_REQUEST(self)){
- /*Method SP Request-URI SP HTTP-Version CRLF*/
- /* Method */
- tsk_buffer_append_2(output, "%s ", self->line.request.method);
- /* Request URI: hpath?search */
- if(self->line.request.url){
- tsk_buffer_append_2(output, "/%s%s%s ",
- self->line.request.url->hpath ? self->line.request.url->hpath : "",
- self->line.request.url->search ? "?" : "",
- self->line.request.url->search ? self->line.request.url->search : ""
- );
- }
- /* HTTP VERSION */
- tsk_buffer_append_2(output, "%s\r\n", THTTP_MESSAGE_VERSION_DEFAULT);
- /* HOST */
- if(self->line.request.url && self->line.request.url->host && self->line.request.url->port){
- tsk_buffer_append_2(output, "Host: %s:%u\r\n", self->line.request.url->host, self->line.request.url->port);
- }
- }
- else{
- /*HTTP-Version SP Status-Code SP Reason-Phrase CRLF*/
- tsk_buffer_append_2(output, "%s %hi %s\r\n", THTTP_MESSAGE_VERSION_DEFAULT, THTTP_RESPONSE_CODE(self), THTTP_RESPONSE_PHRASE(self));
- }
-
- /* Content-Type */
- if(self->Content_Type){
- thttp_header_serialize(THTTP_HEADER(self->Content_Type), output);
- }
- /* Content-Length*/
- if(self->Content_Length){
- thttp_header_serialize(THTTP_HEADER(self->Content_Length), output);
- }
-
- /* All other headers */
- {
- tsk_list_item_t *item;
- tsk_list_foreach(item, self->headers)
- {
- thttp_header_t *hdr = item->data;
- thttp_header_serialize(hdr, output);
- }
- }
-
- /* EMPTY LINE */
- tsk_buffer_append(output, "\r\n", 2);
-
- /* CONTENT */
- if(THTTP_MESSAGE_HAS_CONTENT(self)){
- tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
- }
-
- return 0;
+ if(!self || !output) {
+ return -1;
+ }
+
+ if(THTTP_MESSAGE_IS_REQUEST(self)) {
+ /*Method SP Request-URI SP HTTP-Version CRLF*/
+ /* Method */
+ tsk_buffer_append_2(output, "%s ", self->line.request.method);
+ /* Request URI: hpath?search */
+ if(self->line.request.url) {
+ tsk_buffer_append_2(output, "/%s%s%s ",
+ self->line.request.url->hpath ? self->line.request.url->hpath : "",
+ self->line.request.url->search ? "?" : "",
+ self->line.request.url->search ? self->line.request.url->search : ""
+ );
+ }
+ /* HTTP VERSION */
+ tsk_buffer_append_2(output, "%s\r\n", THTTP_MESSAGE_VERSION_DEFAULT);
+ /* HOST */
+ if(self->line.request.url && self->line.request.url->host && self->line.request.url->port) {
+ tsk_buffer_append_2(output, "Host: %s:%u\r\n", self->line.request.url->host, self->line.request.url->port);
+ }
+ }
+ else {
+ /*HTTP-Version SP Status-Code SP Reason-Phrase CRLF*/
+ tsk_buffer_append_2(output, "%s %hi %s\r\n", THTTP_MESSAGE_VERSION_DEFAULT, THTTP_RESPONSE_CODE(self), THTTP_RESPONSE_PHRASE(self));
+ }
+
+ /* Content-Type */
+ if(self->Content_Type) {
+ thttp_header_serialize(THTTP_HEADER(self->Content_Type), output);
+ }
+ /* Content-Length*/
+ if(self->Content_Length) {
+ thttp_header_serialize(THTTP_HEADER(self->Content_Length), output);
+ }
+
+ /* All other headers */
+ {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, self->headers) {
+ thttp_header_t *hdr = item->data;
+ thttp_header_serialize(hdr, output);
+ }
+ }
+
+ /* EMPTY LINE */
+ tsk_buffer_append(output, "\r\n", 2);
+
+ /* CONTENT */
+ if(THTTP_MESSAGE_HAS_CONTENT(self)) {
+ tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
+ }
+
+ return 0;
}
/**@ingroup thttp_message_group
*/
char* thttp_message_tostring(const thttp_message_t *self)
{
- char* ret = tsk_null;
- tsk_buffer_t* output = tsk_buffer_create_null();
+ char* ret = tsk_null;
+ tsk_buffer_t* output = tsk_buffer_create_null();
- if(!thttp_message_serialize(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
+ if(!thttp_message_serialize(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
/**@ingroup thttp_message_group
*/
thttp_request_t *thttp_request_new(const char* method, const thttp_url_t *request_url)
{
- thttp_request_t* request = 0;
-
- if((request = thttp_request_create(method, request_url))){
- THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(0));
- }
- return request;
+ thttp_request_t* request = 0;
+
+ if((request = thttp_request_create(method, request_url))) {
+ THTTP_MESSAGE_ADD_HEADER(request, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(0));
+ }
+ return request;
}
/**@ingroup thttp_message_group
*/
thttp_response_t *thttp_response_new(short status_code, const char* reason_phrase, const thttp_request_t *request)
{
- thttp_response_t *response = 0;
+ thttp_response_t *response = 0;
- if(request){
- response = thttp_response_create(request, status_code, reason_phrase);
- THTTP_MESSAGE_ADD_HEADER(response, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(0));
- /*
- Copy other headers
- */
- }
+ if(request) {
+ response = thttp_response_create(request, status_code, reason_phrase);
+ THTTP_MESSAGE_ADD_HEADER(response, THTTP_HEADER_CONTENT_LENGTH_VA_ARGS(0));
+ /*
+ Copy other headers
+ */
+ }
- return response;
+ return response;
}
@@ -451,80 +444,74 @@ thttp_response_t *thttp_response_new(short status_code, const char* reason_phras
*/
static tsk_object_t* thttp_message_ctor(tsk_object_t *self, va_list * app)
{
- thttp_message_t *message = self;
- if(message)
- {
- message->type = va_arg(*app, thttp_message_type_t);
- message->headers = tsk_list_create();
-
- switch(message->type)
- {
- case thttp_unknown:
- {
- break;
- }
-
- case thttp_request:
- {
- message->line.request.method = tsk_strdup(va_arg(*app, const char*));
- message->line.request.url = tsk_object_ref((void*)va_arg(*app, const thttp_url_t*));
- break;
- }
-
- case thttp_response:
- {
- /*const thttp_request_t* request =*/ va_arg(*app, const thttp_request_t*);
+ thttp_message_t *message = self;
+ if(message) {
+ message->type = va_arg(*app, thttp_message_type_t);
+ message->headers = tsk_list_create();
+
+ switch(message->type) {
+ case thttp_unknown: {
+ break;
+ }
+
+ case thttp_request: {
+ message->line.request.method = tsk_strdup(va_arg(*app, const char*));
+ message->line.request.url = tsk_object_ref((void*)va_arg(*app, const thttp_url_t*));
+ break;
+ }
+
+ case thttp_response: {
+ /*const thttp_request_t* request =*/ va_arg(*app, const thttp_request_t*);
#if defined(__GNUC__)
- message->line.response.status_code = (short)va_arg(*app, int);
+ message->line.response.status_code = (short)va_arg(*app, int);
#else
- message->line.response.status_code = va_arg(*app, short);
+ message->line.response.status_code = va_arg(*app, short);
#endif
- message->line.response.reason_phrase = tsk_strdup(va_arg(*app, const char*));
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new http message.");
- }
- return self;
+ message->line.response.reason_phrase = tsk_strdup(va_arg(*app, const char*));
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new http message.");
+ }
+ return self;
}
/**@ingroup thttp_message_group
*/
static tsk_object_t* thttp_message_dtor(tsk_object_t *self)
{
- thttp_message_t *message = self;
- if(message){
- if(THTTP_MESSAGE_IS_REQUEST(message)){
- TSK_FREE(message->line.request.method);
- TSK_OBJECT_SAFE_FREE(message->line.request.url);
- }
- else if(THTTP_MESSAGE_IS_RESPONSE(message)){
- TSK_FREE(message->line.response.reason_phrase);
- }
-
- TSK_FREE(message->http_version);
-
- TSK_OBJECT_SAFE_FREE(message->Content_Length);
- TSK_OBJECT_SAFE_FREE(message->Content_Type);
-
- TSK_OBJECT_SAFE_FREE(message->Content);
-
- TSK_OBJECT_SAFE_FREE(message->headers);
- }
- else{
- TSK_DEBUG_ERROR("Null HTTP message.");
- }
-
- return self;
+ thttp_message_t *message = self;
+ if(message) {
+ if(THTTP_MESSAGE_IS_REQUEST(message)) {
+ TSK_FREE(message->line.request.method);
+ TSK_OBJECT_SAFE_FREE(message->line.request.url);
+ }
+ else if(THTTP_MESSAGE_IS_RESPONSE(message)) {
+ TSK_FREE(message->line.response.reason_phrase);
+ }
+
+ TSK_FREE(message->http_version);
+
+ TSK_OBJECT_SAFE_FREE(message->Content_Length);
+ TSK_OBJECT_SAFE_FREE(message->Content_Type);
+
+ TSK_OBJECT_SAFE_FREE(message->Content);
+
+ TSK_OBJECT_SAFE_FREE(message->headers);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null HTTP message.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_message_def_s =
-{
- sizeof(thttp_message_t),
- thttp_message_ctor,
- thttp_message_dtor,
- tsk_null
+static const tsk_object_def_t thttp_message_def_s = {
+ sizeof(thttp_message_t),
+ thttp_message_ctor,
+ thttp_message_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_message_def_t = &thttp_message_def_s;
diff --git a/tinyHTTP/src/thttp_proxy_node_plugin.c b/tinyHTTP/src/thttp_proxy_node_plugin.c
index 431016b..a5b5fa7 100755
--- a/tinyHTTP/src/thttp_proxy_node_plugin.c
+++ b/tinyHTTP/src/thttp_proxy_node_plugin.c
@@ -59,10 +59,9 @@
"Proxy-Connection: keep-Alive\r\n" \
"Pragma: no-cache\r\n"
-typedef struct thttp_proxy_node_plugin_s
-{
+typedef struct thttp_proxy_node_plugin_s {
TNET_DECLARE_PROXY_NONE;
-
+
struct {
tsk_bool_t completed;
tsk_bool_t started;
@@ -76,7 +75,7 @@ typedef struct thttp_proxy_node_plugin_s
struct thttp_proxy_auth_cache_s* proxy_auth_cache;
#endif
} handshacking;
-
+
TSK_DECLARE_SAFEOBJ;
}
thttp_proxy_node_plugin_t;
@@ -103,7 +102,7 @@ static int _thttp_proxy_node_plugin_configure(tnet_proxy_node_t* self, ...)
int ret = 0;
thttp_proxy_node_plugin_t* node = (thttp_proxy_node_plugin_t*)self;
// input parameters already checked by the caller
-
+
va_start(ap, self);
tsk_safeobj_lock(node);
ret = tnet_proxy_node_configure_2(self, &ap);
@@ -118,7 +117,7 @@ static int _thttp_proxy_node_plugin_start_handshaking(tnet_proxy_node_t* self)
int ret = 0;
#define kConnectContentData tsk_null
// input parameters already checked by the caller
-
+
if (tsk_strnullORempty(self->dst_host) || !self->dst_port) {
TSK_DEBUG_ERROR("Invalid destination address for HTTP proxy node: %s:%d", self->dst_host, self->dst_port);
return -1;
@@ -129,11 +128,11 @@ static int _thttp_proxy_node_plugin_start_handshaking(tnet_proxy_node_t* self)
TSK_DEBUG_ERROR("handshaking already started");
goto bail;
}
-
+
TSK_OBJECT_SAFE_FREE(node->handshacking.req_connect);
TSK_FREE(node->handshacking.pending_data_ptr);
node->handshacking.pending_data_len = 0;
-
+
/* Build the HTTP(S) CONNECT Request */
#if BUILD_USING_PARSE
{
@@ -155,7 +154,7 @@ static int _thttp_proxy_node_plugin_start_handshaking(tnet_proxy_node_t* self)
TSK_OBJECT_SAFE_FREE(auth_hdr);
}
tsk_strcat((char**)&node->handshacking.pending_data_ptr, ONE_CRLF);
-
+
node->handshacking.pending_data_len = (int)tsk_strlen(node->handshacking.pending_data_ptr);
tsk_ragel_state_init(&state, node->handshacking.pending_data_ptr, node->handshacking.pending_data_len);
if ((ret = thttp_message_parse(&state, &node->handshacking.req_connect, tsk_false/* do not extract the content */)) != 0) {
@@ -193,7 +192,7 @@ static int _thttp_proxy_node_plugin_start_handshaking(tnet_proxy_node_t* self)
THTTP_HEADER_DUMMY_VA_ARGS("Connection", "keep-Alive"),
THTTP_HEADER_DUMMY_VA_ARGS("Pragma", "no-cache"),
END_OF_ADD_HEADERS()
- );
+ );
# if THTTP_PROXY_AUTH_CACHE
tsk_sprintf(&uristring, "%s:%d", self->dst_host, self->dst_port);
auth_hdr = _thttp_proxy_auth_cache_create_header_authorization(node->handshacking.proxy_auth_cache, self->proxy_host, self->proxy_port, self->login, self->password, uristring);
@@ -210,19 +209,19 @@ static int _thttp_proxy_node_plugin_start_handshaking(tnet_proxy_node_t* self)
}
}
#endif
-
+
/* Parse the connect method */
if (!node->handshacking.pending_data_ptr) { // see "BUILD_USING_PARSE"
node->handshacking.pending_data_ptr = thttp_message_tostring(node->handshacking.req_connect);
node->handshacking.pending_data_len = (int)tsk_strlen((const char*)node->handshacking.pending_data_ptr);
}
-
+
if (!(node->handshacking.started = (node->handshacking.pending_data_len > 0))) {
TSK_DEBUG_ERROR("Failed to parse HTTP connect data");
ret = -3;
goto bail;
}
-
+
bail:
tsk_safeobj_unlock(node);
return ret;
@@ -235,19 +234,19 @@ static int _thttp_proxy_node_plugin_set_handshaking_data(tnet_proxy_node_t* self
thttp_message_t *message = tsk_null;
tsk_bool_t have_all_content = tsk_false;
thttp_proxy_node_plugin_t* node = (thttp_proxy_node_plugin_t*)self;
-
+
// input parameters already checked by the caller
-
+
TSK_DEBUG_INFO("HTTP(s) incoming proxy handshaking data:%.*s", (int)data_size, data_ptr);
-
+
tsk_safeobj_lock(node);
-
+
if (!node->handshacking.started) {
TSK_DEBUG_ERROR("handshaking not started");
ret = -3;
goto bail;
}
-
+
if (!node->handshacking.buff) {
if (!(node->handshacking.buff = tsk_buffer_create(data_ptr, data_size))) {
ret = -2;
@@ -259,27 +258,27 @@ static int _thttp_proxy_node_plugin_set_handshaking_data(tnet_proxy_node_t* self
goto bail;
}
}
-
+
/* Check if we have all HTTP headers. */
parse_buffer:
if ((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(node->handshacking.buff), TSK_BUFFER_SIZE(node->handshacking.buff), TWO_CRLF)) < 0) {
TSK_DEBUG_INFO("No all HTTP headers in the TCP buffer.");
goto bail;
}
-
+
/* If we are here this mean that we have all HTTP headers.
* ==> Parse the HTTP message without the content.
*/
tsk_ragel_state_init(&state, TSK_BUFFER_DATA(node->handshacking.buff), endOfheaders + TWO_CRLF_LEN);
if ((ret = thttp_message_parse(&state, &message, tsk_false/* do not extract the content */)) == 0) {
const thttp_header_Transfer_Encoding_t* transfer_Encoding;
-
+
/* chunked? */
if ((transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)thttp_message_get_header(message, thttp_htype_Transfer_Encoding)) && tsk_striequals(transfer_Encoding->encoding, "chunked")) {
const char* start = (const char*)(TSK_BUFFER_TO_U8(node->handshacking.buff) + (endOfheaders + TWO_CRLF_LEN));
const char* end = (const char*)(TSK_BUFFER_TO_U8(node->handshacking.buff) + TSK_BUFFER_SIZE(node->handshacking.buff));
int index;
-
+
TSK_DEBUG_INFO("CHUNKED transfer.");
while (start < end) {
/* RFC 2616 - 19.4.6 Introduction of Transfer-Encoding */
@@ -292,14 +291,14 @@ parse_buffer:
TSK_DEBUG_ERROR("Parsing chunked data has failed.");
break;
}
-
+
if (chunk_size == 0 && ((start + 2) <= end) && *start == '\r' && *(start+ 1) == '\n') {
int parsed_len = (int)(start - (const char*)(TSK_BUFFER_TO_U8(node->handshacking.buff))) + TWO_CRLF_LEN;
tsk_buffer_remove(node->handshacking.buff, 0, parsed_len);
have_all_content = tsk_true;
break;
}
-
+
thttp_message_append_content(message, start, chunk_size);
start += chunk_size + ONE_CRLF_LEN;
}
@@ -325,7 +324,7 @@ parse_buffer:
}
}
}
-
+
/* Alert the dialog (FSM) */
if (message) {
if (have_all_content) { /* only if we have all data */
@@ -373,11 +372,11 @@ parse_buffer:
tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
}
TSK_FREE(uristring);
-
+
#if BUILD_USING_PARSE
tsk_strcat((char**)&node->handshacking.pending_data_ptr, ONE_CRLF);
#endif /* BUILD_USING_PARSE */
-
+
// update pending handshaking data
if (!node->handshacking.pending_data_ptr && !(node->handshacking.pending_data_ptr = thttp_message_tostring(node->handshacking.req_connect))) {
TSK_DEBUG_ERROR("Breaking HTTP(s) handshaking process (failed to parse request)");
@@ -400,7 +399,7 @@ parse_buffer:
ret = -4;
goto bail;
}
-
+
/* Parse next chunck */
if (TSK_BUFFER_SIZE(node->handshacking.buff) > 0) {
TSK_OBJECT_SAFE_FREE(message);
@@ -408,7 +407,7 @@ parse_buffer:
}
}
}
-
+
bail:
tsk_safeobj_unlock(node);
TSK_OBJECT_SAFE_FREE(message);
@@ -419,10 +418,10 @@ static int _thttp_proxy_node_plugin_get_handshaking_pending_data(tnet_proxy_node
{
thttp_proxy_node_plugin_t* node = (thttp_proxy_node_plugin_t*)self;
int ret = -1;
-
+
// input parameters already checked by the caller
tsk_safeobj_lock(node);
-
+
if (node->handshacking.pending_data_ptr && node->handshacking.pending_data_len > 0) {
if ((*data_pptr = tsk_realloc(*data_pptr, node->handshacking.pending_data_len))) {
memcpy(*data_pptr, node->handshacking.pending_data_ptr, (tsk_size_t) node->handshacking.pending_data_len);
@@ -433,7 +432,7 @@ static int _thttp_proxy_node_plugin_get_handshaking_pending_data(tnet_proxy_node
TSK_FREE(node->handshacking.pending_data_ptr);
node->handshacking.pending_data_len = 0;
}
-
+
tsk_safeobj_unlock(node);
return ret;
}
@@ -441,11 +440,11 @@ static int _thttp_proxy_node_plugin_get_handshaking_pending_data(tnet_proxy_node
static int _thttp_proxy_node_plugin_get_handshaking_completed(tnet_proxy_node_t* self, tsk_bool_t* completed)
{
thttp_proxy_node_plugin_t* node = (thttp_proxy_node_plugin_t*)self;
-
+
tsk_safeobj_lock(node);
*completed = node->handshacking.completed;
tsk_safeobj_unlock(node);
-
+
return 0;
}
@@ -457,25 +456,25 @@ static int _thttp_proxy_node_plugin_update_challenge(thttp_proxy_node_plugin_t *
#endif
int ret = 0;
const thttp_header_Proxy_Authenticate_t *Proxy_Authenticate;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#define kIsProxyYes tsk_true
-
+
tsk_safeobj_lock(self);
#if THTTP_PROXY_AUTH_CACHE
_thttp_proxy_auth_cache_lock(self->handshacking.proxy_auth_cache);
#endif
-
+
/* RFC 2617 - Digest Operation
-
+
* (A) The client response to a WWW-Authenticate challenge for a protection
space starts an authentication session with that protection space.
The authentication session lasts until the client receives another
WWW-Authenticate challenge from any server in the protection space.
-
+
(B) The server may return a 401 response with a new nonce value, causing the client
to retry the request; by specifying stale=TRUE with this response,
the server tells the client to retry with the new nonce, but without
@@ -491,14 +490,14 @@ static int _thttp_proxy_node_plugin_update_challenge(thttp_proxy_node_plugin_t *
#if THTTP_PROXY_AUTH_CACHE
TSK_OBJECT_SAFE_FREE(self->handshacking.challenge);
self->handshacking.challenge = _thttp_proxy_auth_cache_challenge_get(self->handshacking.proxy_auth_cache,
- base->proxy_host,
- base->proxy_port,
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm,
- Proxy_Authenticate->nonce,
- Proxy_Authenticate->opaque,
- Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop);
+ base->proxy_host,
+ base->proxy_port,
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm,
+ Proxy_Authenticate->nonce,
+ Proxy_Authenticate->opaque,
+ Proxy_Authenticate->algorithm,
+ Proxy_Authenticate->qop);
#else
ret = thttp_challenge_update(self->handshacking.challenge,
Proxy_Authenticate->scheme,
@@ -521,22 +520,22 @@ static int _thttp_proxy_node_plugin_update_challenge(thttp_proxy_node_plugin_t *
else {
#if THTTP_PROXY_AUTH_CACHE
self->handshacking.challenge = _thttp_proxy_auth_cache_challenge_get(self->handshacking.proxy_auth_cache,
- base->proxy_host,
- base->proxy_port,
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm,
- Proxy_Authenticate->nonce,
- Proxy_Authenticate->opaque,
- Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop);
+ base->proxy_host,
+ base->proxy_port,
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm,
+ Proxy_Authenticate->nonce,
+ Proxy_Authenticate->opaque,
+ Proxy_Authenticate->algorithm,
+ Proxy_Authenticate->qop);
#else
self->handshacking.challenge = thttp_challenge_create(kIsProxyYes,
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm,
- Proxy_Authenticate->nonce,
- Proxy_Authenticate->opaque,
- Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop);
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm,
+ Proxy_Authenticate->nonce,
+ Proxy_Authenticate->opaque,
+ Proxy_Authenticate->algorithm,
+ Proxy_Authenticate->qop);
#endif /* THTTP_PROXY_AUTH_CACHE */
if (!self->handshacking.challenge) {
ret = -1;
@@ -549,14 +548,14 @@ static int _thttp_proxy_node_plugin_update_challenge(thttp_proxy_node_plugin_t *
ret = -1;
goto bail;
}
-
+
bail:
#if THTTP_PROXY_AUTH_CACHE
_thttp_proxy_auth_cache_unlock(self->handshacking.proxy_auth_cache);
#endif
tsk_safeobj_unlock(self);
return ret;
-
+
}
@@ -591,31 +590,29 @@ static tsk_object_t* thttp_proxy_node_plugin_dtor(tsk_object_t * self)
#if THTTP_PROXY_AUTH_CACHE
TSK_OBJECT_SAFE_FREE(node->handshacking.proxy_auth_cache);
#endif
-
+
tsk_safeobj_deinit(node);
-
+
TSK_DEBUG_INFO("*** HTTP proxy node destroyed ***");
}
return self;
}
/* object definition */
-static const tsk_object_def_t thttp_proxy_node_def_s =
-{
+static const tsk_object_def_t thttp_proxy_node_def_s = {
sizeof(thttp_proxy_node_plugin_t),
thttp_proxy_node_plugin_ctor,
thttp_proxy_node_plugin_dtor,
tsk_null,
};
/* plugin definition*/
-static const struct tnet_proxy_node_plugin_def_s thttp_proxy_node_plugin_def_s =
-{
+static const struct tnet_proxy_node_plugin_def_s thttp_proxy_node_plugin_def_s = {
&thttp_proxy_node_def_s,
-
+
tnet_proxy_type_http | tnet_proxy_type_https,
-
+
"HTTP(s) proxy node plugin",
-
+
_thttp_proxy_node_plugin_configure,
_thttp_proxy_node_plugin_start_handshaking,
_thttp_proxy_node_plugin_set_handshaking_data,
@@ -633,7 +630,7 @@ extern const tsk_object_def_t* thttp_proxy_auth_def_t;
typedef struct thttp_proxy_auth_s {
TSK_DECLARE_OBJECT;
-
+
char* hostname;
tnet_port_t port;
struct {
@@ -653,7 +650,7 @@ typedef tsk_list_t thttp_proxy_auths_L_t;
typedef struct thttp_proxy_auth_cache_s {
TSK_DECLARE_OBJECT;
-
+
thttp_proxy_auths_L_t* auths_list;
TSK_DECLARE_SAFEOBJ;
}
@@ -710,7 +707,7 @@ static thttp_challenge_t* _thttp_proxy_auth_cache_challenge_get(thttp_proxy_auth
((thttp_proxy_auth_t*)proxy_auth)->challenge.nc = 1;
tsk_strrandom(&istr);
tsk_md5compute(istr, tsk_strlen(istr), &((thttp_proxy_auth_t*)proxy_auth)->challenge.cnonce);
-
+
((thttp_proxy_auth_t*)proxy_auth)->challenge.is_active = tsk_true;
}
}
@@ -736,7 +733,7 @@ static thttp_header_t * _thttp_proxy_auth_cache_create_header_authorization(stru
{
thttp_challenge_t* challenge = tsk_null;
thttp_header_t * header = tsk_null;
-
+
if (!self || !uristring) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
@@ -825,11 +822,10 @@ static tsk_object_t* _thttp_proxy_auth_cache_dtor(tsk_object_t * self)
TSK_OBJECT_SAFE_FREE(cache->auths_list);
tsk_safeobj_deinit(cache);
}
-
+
return self;
}
-static const tsk_object_def_t thttp_proxy_auth_cache_def_s =
-{
+static const tsk_object_def_t thttp_proxy_auth_cache_def_s = {
sizeof(thttp_proxy_auth_cache_t),
_thttp_proxy_auth_cache_ctor,
_thttp_proxy_auth_cache_dtor,
@@ -845,7 +841,7 @@ static tsk_object_t* _thttp_proxy_auth_ctor(tsk_object_t * self, va_list * app)
{
thttp_proxy_auth_t *auth = (thttp_proxy_auth_t *)self;
if (auth) {
-
+
}
return self;
}
@@ -861,11 +857,10 @@ static tsk_object_t* _thttp_proxy_auth_dtor(tsk_object_t * self)
TSK_FREE(auth->challenge.qop);
TSK_FREE(auth->hostname);
}
-
+
return self;
}
-static const tsk_object_def_t thttp_proxy_auth_def_s =
-{
+static const tsk_object_def_t thttp_proxy_auth_def_s = {
sizeof(thttp_proxy_auth_t),
_thttp_proxy_auth_ctor,
_thttp_proxy_auth_dtor,
diff --git a/tinyHTTP/src/thttp_session.c b/tinyHTTP/src/thttp_session.c
index 206865f..ff2d4e7 100755
--- a/tinyHTTP/src/thttp_session.c
+++ b/tinyHTTP/src/thttp_session.c
@@ -43,56 +43,56 @@ int thttp_session_signal(thttp_session_t *self, thttp_action_type_t atype);
int __thttp_session_set(thttp_session_t *self, va_list* app)
{
thttp_session_param_type_t curr;
-
- if(!self){
+
+ if(!self) {
return -1;
}
-
- while((curr=va_arg(*app, thttp_session_param_type_t)) != httpp_null){
- switch(curr){
- case httpp_option:
- { /* (thttp_session_option_t)ID_ENUM, (const char*)VALUE_STR */
- thttp_session_option_t id = va_arg(*app, thttp_session_option_t);
- const char* value = va_arg(*app, const char *);
- tsk_options_add_option(&self->options, id, value);
- break;
- }
-
- case httpp_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* name = va_arg(*app, const char *);
- const char* value = va_arg(*app, const char *);
- if(value == ((const char*)-1)){ /* UNSET */
- tsk_params_remove_param(self->headers, name);
- }
- else{ /* SET */
- tsk_params_add_param(&self->headers, name, value);
- }
- break;
- }
-
- case httpp_cred:
- { /* (const char*)USERNAME_STR, (const char*)PASSWORD_STR */
- tsk_strupdate(&self->cred.usename, va_arg(*app, const char *));
- tsk_strupdate(&self->cred.password, va_arg(*app, const char *));
- break;
+
+ while((curr=va_arg(*app, thttp_session_param_type_t)) != httpp_null) {
+ switch(curr) {
+ case httpp_option: {
+ /* (thttp_session_option_t)ID_ENUM, (const char*)VALUE_STR */
+ thttp_session_option_t id = va_arg(*app, thttp_session_option_t);
+ const char* value = va_arg(*app, const char *);
+ tsk_options_add_option(&self->options, id, value);
+ break;
+ }
+
+ case httpp_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* name = va_arg(*app, const char *);
+ const char* value = va_arg(*app, const char *);
+ if(value == ((const char*)-1)) { /* UNSET */
+ tsk_params_remove_param(self->headers, name);
}
-
- case httpp_userdata:
- { /* (const void*)USERDATA_PTR */
- self->userdata = va_arg(*app, const void *);
- break;
- }
-
- default:
- { /* va_list will be unsafe => exit */
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- goto bail;
+ else { /* SET */
+ tsk_params_add_param(&self->headers, name, value);
}
+ break;
+ }
+
+ case httpp_cred: {
+ /* (const char*)USERNAME_STR, (const char*)PASSWORD_STR */
+ tsk_strupdate(&self->cred.usename, va_arg(*app, const char *));
+ tsk_strupdate(&self->cred.password, va_arg(*app, const char *));
+ break;
+ }
+
+ case httpp_userdata: {
+ /* (const void*)USERDATA_PTR */
+ self->userdata = va_arg(*app, const void *);
+ break;
+ }
+
+ default: {
+ /* va_list will be unsafe => exit */
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ goto bail;
+ }
} /* sxitch */
} /* while */
return 0;
-
+
bail:
return -2;
}
@@ -108,12 +108,12 @@ bail:
thttp_session_handle_t * session = thttp_session_create(stack,
// session-level parameters
THTTP_SESSION_SET_PARAM("timeout", "6000"),
-
+
// session-level headers
THTTP_SESSION_SET_HEADER("Pragma", "No-Cache"),
THTTP_SESSION_SET_HEADER("Connection", "Keep-Alive"),
THTTP_SESSION_SET_HEADER("User-Agent", "doubango 1.0"),
-
+
THTTP_SESSION_SET_NULL());
* @endcode
*
@@ -122,16 +122,16 @@ bail:
thttp_session_handle_t* thttp_session_create(const thttp_stack_handle_t* stack, ...)
{
thttp_session_handle_t* ret = tsk_null;
-
- if((ret = tsk_object_new(thttp_session_def_t, stack))){
+
+ if((ret = tsk_object_new(thttp_session_def_t, stack))) {
va_list ap;
va_start(ap, stack);
- if(__thttp_session_set(ret, &ap)){
+ if(__thttp_session_set(ret, &ap)) {
TSK_OBJECT_SAFE_FREE(ret);
}
va_end(ap);
}
- else{
+ else {
TSK_DEBUG_ERROR("failed to create new HTTP/HTTPS session.");
}
return ret;
@@ -147,12 +147,12 @@ thttp_session_handle_t* thttp_session_create(const thttp_stack_handle_t* stack,
int ret = thttp_session_set(session,
// session-level parameters
THTTP_SESSION_SET_OPTION(THTTP_SESSION_OPTION_TIMEOUT, "6000"),
-
+
// session-level headers
THTTP_SESSION_SET_HEADER("Pragma", "No-Cache"),
THTTP_SESSION_SET_HEADER("Connection", "Keep-Alive"),
THTTP_SESSION_SET_HEADER("User-Agent", "doubango 1.0"),
-
+
THTTP_SESSION_SET_NULL());
* @endcode
*
@@ -160,23 +160,23 @@ thttp_session_handle_t* thttp_session_create(const thttp_stack_handle_t* stack,
*/
int thttp_session_set(thttp_session_handle_t *self, ...)
{
- if(self){
+ if(self) {
int ret;
va_list ap;
-
+
thttp_session_t *session = self;
-
- if(session->id == THTTP_SESSION_INVALID_ID){
+
+ if(session->id == THTTP_SESSION_INVALID_ID) {
TSK_DEBUG_ERROR("Using invalid session.");
return -2;
}
-
+
va_start(ap, self);
ret = __thttp_session_set(session, &ap);
va_end(ap);
return ret;
}
-
+
return -1;
}
@@ -188,7 +188,7 @@ int thttp_session_set(thttp_session_handle_t *self, ...)
thttp_session_id_t thttp_session_get_id(const thttp_session_handle_t *self)
{
const thttp_session_t *session = self;
- if(session){
+ if(session) {
return session->id;
}
return THTTP_SESSION_INVALID_ID;
@@ -202,7 +202,7 @@ thttp_session_id_t thttp_session_get_id(const thttp_session_handle_t *self)
*/
const void* thttp_session_get_userdata(const thttp_session_handle_t *self)
{
- if(self){
+ if(self) {
return ((const thttp_session_t*)self)->userdata;
}
return tsk_null;
@@ -212,13 +212,13 @@ int thttp_session_closefd(thttp_session_handle_t *_self)
{
int ret = 0;
thttp_session_t* self = _self;
-
- if(self->fd != TNET_INVALID_FD){
- if((ret = tnet_transport_remove_socket(self->stack->transport, &self->fd))){
+
+ if(self->fd != TNET_INVALID_FD) {
+ if((ret = tnet_transport_remove_socket(self->stack->transport, &self->fd))) {
ret = tnet_sockfd_close(&self->fd);
}
}
-
+
return ret;
}
@@ -228,23 +228,23 @@ int thttp_session_update_challenges(thttp_session_t *self, const thttp_response_
{
int ret = 0;
tsk_size_t i;
-
+
tsk_list_item_t *item;
-
+
thttp_challenge_t *challenge;
-
+
const thttp_header_WWW_Authenticate_t *WWW_Authenticate;
const thttp_header_Proxy_Authenticate_t *Proxy_Authenticate;
-
+
tsk_safeobj_lock(self);
-
+
/* RFC 2617 - Digest Operation
-
+
* (A) The client response to a WWW-Authenticate challenge for a protection
space starts an authentication session with that protection space.
The authentication session lasts until the client receives another
WWW-Authenticate challenge from any server in the protection space.
-
+
(B) The server may return a 401 response with a new nonce value, causing the client
to retry the request; by specifying stale=TRUE with this response,
the server tells the client to retry with the new nonce, but without
@@ -253,22 +253,20 @@ int thttp_session_update_challenges(thttp_session_t *self, const thttp_response_
/* RFC 2617 - 1.2 Access Authentication Framework
The realm directive (case-insensitive) is required for all authentication schemes that issue a challenge.
*/
-
+
/* FIXME: As we perform the same task ==> Use only one loop.
*/
-
- for(i =0; (WWW_Authenticate = (const thttp_header_WWW_Authenticate_t*)thttp_message_get_headerAt(response, thttp_htype_WWW_Authenticate, i)); i++)
- {
+
+ for(i =0; (WWW_Authenticate = (const thttp_header_WWW_Authenticate_t*)thttp_message_get_headerAt(response, thttp_htype_WWW_Authenticate, i)); i++) {
tsk_bool_t isnew = tsk_true;
-
- tsk_list_foreach(item, self->challenges)
- {
+
+ tsk_list_foreach(item, self->challenges) {
challenge = item->data;
- if(challenge->isproxy){
+ if(challenge->isproxy) {
continue;
}
-
- if(tsk_striequals(challenge->realm, WWW_Authenticate->realm) && (WWW_Authenticate->stale || !answered)){
+
+ if(tsk_striequals(challenge->realm, WWW_Authenticate->realm) && (WWW_Authenticate->stale || !answered)) {
/*== (B) ==*/
if ((ret = thttp_challenge_update(challenge,
WWW_Authenticate->scheme,
@@ -279,45 +277,44 @@ int thttp_session_update_challenges(thttp_session_t *self, const thttp_response_
WWW_Authenticate->qop)) != 0) {
goto bail;
}
- else{
+ else {
isnew = tsk_false;
continue;
}
}
- else{
+ else {
ret = -1;
goto bail;
}
}
-
- if(isnew){
+
+ if(isnew) {
if((challenge = thttp_challenge_create(tsk_false, /* Not proxy */
WWW_Authenticate->scheme,
WWW_Authenticate->realm,
WWW_Authenticate->nonce,
WWW_Authenticate->opaque,
WWW_Authenticate->algorithm,
- WWW_Authenticate->qop))){
+ WWW_Authenticate->qop))) {
tsk_list_push_back_data(self->challenges, (void**)&challenge);
}
- else{
+ else {
ret = -1;
goto bail;
}
}
}
-
- for(i=0; (Proxy_Authenticate = (const thttp_header_Proxy_Authenticate_t*)thttp_message_get_headerAt(response, thttp_htype_Proxy_Authenticate, i)); i++)
- {
+
+ for(i=0; (Proxy_Authenticate = (const thttp_header_Proxy_Authenticate_t*)thttp_message_get_headerAt(response, thttp_htype_Proxy_Authenticate, i)); i++) {
tsk_bool_t isnew = tsk_true;
-
- tsk_list_foreach(item, self->challenges){
+
+ tsk_list_foreach(item, self->challenges) {
challenge = item->data;
- if(!challenge->isproxy){
+ if(!challenge->isproxy) {
continue;
}
-
- if(tsk_striequals(challenge->realm, Proxy_Authenticate->realm) && (Proxy_Authenticate->stale || !answered)){
+
+ if(tsk_striequals(challenge->realm, Proxy_Authenticate->realm) && (Proxy_Authenticate->stale || !answered)) {
/*== (B) ==*/
if ((ret = thttp_challenge_update(challenge,
Proxy_Authenticate->scheme,
@@ -325,77 +322,75 @@ int thttp_session_update_challenges(thttp_session_t *self, const thttp_response_
Proxy_Authenticate->nonce,
Proxy_Authenticate->opaque,
Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop)) != 0)
- {
+ Proxy_Authenticate->qop)) != 0) {
goto bail;
}
- else{
+ else {
isnew = tsk_false;
continue;
}
}
- else{
+ else {
ret = -1;
goto bail;
}
}
-
- if(isnew){
+
+ if(isnew) {
if((challenge = thttp_challenge_create(tsk_true, /* Proxy */
Proxy_Authenticate->scheme,
Proxy_Authenticate->realm,
Proxy_Authenticate->nonce,
Proxy_Authenticate->opaque,
Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop)))
- {
+ Proxy_Authenticate->qop))) {
tsk_list_push_back_data(self->challenges, (void**)&challenge);
}
- else{
+ else {
ret = -1;
goto bail;
}
}
}
-
+
bail:
tsk_safeobj_unlock(self);
return ret;
-
+
}
/* internal function */
int thttp_session_signal(thttp_session_t *self, thttp_action_type_t atype)
{
tsk_list_item_t *item;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(self);
again:
- tsk_list_foreach(item, self->dialogs){
+ tsk_list_foreach(item, self->dialogs) {
item = tsk_object_ref(item);
thttp_dialog_fsm_act((thttp_dialog_t*)item->data, atype, tsk_null, tsk_null);
/* As the above action could terminate the dialog (which means change the content of self->dialogs)
* => list becomes unsafe */
- if(!(item = tsk_object_unref(item))){
+ if(!(item = tsk_object_unref(item))) {
goto again;
}
}
-
- switch(atype){
- case thttp_thttp_atype_closed:
+
+ switch(atype) {
+ case thttp_thttp_atype_closed:
self->fd = TNET_INVALID_FD;
break;
- default:
+ default:
break;
}
-
+
tsk_safeobj_unlock(self);
-
+
return 0;
}
@@ -417,18 +412,18 @@ thttp_session_t* thttp_session_get_by_fd(thttp_sessions_L_t* sessions, tnet_fd_t
{
thttp_session_t* ret = tsk_null;
const tsk_list_item_t *item;
-
- if(!sessions){
+
+ if(!sessions) {
goto bail;
}
-
- tsk_list_foreach(item, sessions){
- if(((thttp_session_t*)item->data)->fd == fd){
+
+ tsk_list_foreach(item, sessions) {
+ if(((thttp_session_t*)item->data)->fd == fd) {
ret = tsk_object_ref(item->data);
goto bail;
}
}
-
+
bail:
return ret;
}
@@ -443,55 +438,55 @@ static tsk_object_t* _thttp_session_create(tsk_object_t * self, va_list * app)
{
thttp_session_t *session = self;
static thttp_session_id_t unique_id = THTTP_SESSION_INVALID_ID;
- if(session){
+ if(session) {
tsk_safeobj_init(session);
-
+
session->stack = va_arg(*app, const thttp_stack_handle_t*);
session->options = tsk_list_create();
session->headers = tsk_list_create();
session->challenges = tsk_list_create();
session->dialogs = tsk_list_create();
session->fd = TNET_INVALID_FD;
-
+
session->id = THTTP_SESSION_INVALID_ID;
-
+
/* add the session to the stack */
- if(session->stack){
+ if(session->stack) {
session->id = ++unique_id;
tsk_list_push_back_data(session->stack->sessions, (void**)&session);
}
}
-
+
return self;
}
static tsk_object_t* thttp_session_destroy(tsk_object_t * self)
-{
+{
thttp_session_t *session = self;
- if(session){
+ if(session) {
TSK_DEBUG_INFO("*** HTTP/HTTPS Session destroyed ***");
-
+
/* remove from the stack */
- if(session->stack){
+ if(session->stack) {
tsk_list_remove_item_by_data(session->stack->sessions, session);
}
-
+
TSK_OBJECT_SAFE_FREE(session->options);
TSK_OBJECT_SAFE_FREE(session->headers);
TSK_OBJECT_SAFE_FREE(session->challenges);
TSK_OBJECT_SAFE_FREE(session->dialogs);
-
+
// cred
TSK_FREE(session->cred.usename);
TSK_FREE(session->cred.password);
-
+
// fd
- if(session->fd != TNET_INVALID_FD){
- if(tnet_transport_remove_socket(session->stack->transport, &session->fd)){
+ if(session->fd != TNET_INVALID_FD) {
+ if(tnet_transport_remove_socket(session->stack->transport, &session->fd)) {
tnet_sockfd_close(&session->fd);
}
}
-
+
tsk_safeobj_deinit(session);
}
return self;
@@ -501,18 +496,17 @@ static int thttp_session_cmp(const tsk_object_t *_session1, const tsk_object_t *
{
const thttp_session_t *session1 = _session1;
const thttp_session_t *session2 = _session2;
-
- if(session1 && session2){
+
+ if(session1 && session2) {
return (int)(session1->id-session2->id);
}
return -1;
}
-static const tsk_object_def_t thttp_session_def_s =
-{
+static const tsk_object_def_t thttp_session_def_s = {
sizeof(thttp_session_t),
- _thttp_session_create,
+ _thttp_session_create,
thttp_session_destroy,
- thttp_session_cmp,
+ thttp_session_cmp,
};
const tsk_object_def_t *thttp_session_def_t = &thttp_session_def_s;
diff --git a/tinyHTTP/src/thttp_url.c b/tinyHTTP/src/thttp_url.c
index 84647ff..4474d1a 100755
--- a/tinyHTTP/src/thttp_url.c
+++ b/tinyHTTP/src/thttp_url.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,75 +46,75 @@
*/
thttp_url_t* thttp_url_create(thttp_url_type_t type)
{
- return tsk_object_new(thttp_url_def_t, type);
+ return tsk_object_new(thttp_url_def_t, type);
}
/**@ingroup thttp_url_group
*/
int thttp_url_serialize(const thttp_url_t *url, tsk_buffer_t *output)
{
- /* RFC 1738: "http://" hostport [ "/" hpath [ "?" search ]] */
- return tsk_buffer_append_2(output, "%s://%s:%u%s%s%s%s",
+ /* RFC 1738: "http://" hostport [ "/" hpath [ "?" search ]] */
+ return tsk_buffer_append_2(output, "%s://%s:%u%s%s%s%s",
- url->scheme,
- url->host,
- url->port,
+ url->scheme,
+ url->host,
+ url->port,
- url->hpath ? "/" : "",
- url->hpath ? url->hpath : "",
+ url->hpath ? "/" : "",
+ url->hpath ? url->hpath : "",
- url->search ? "?" : "",
- url->search ? url->search : ""
- );
+ url->search ? "?" : "",
+ url->search ? url->search : ""
+ );
}
/**@ingroup thttp_url_group
*/
char* thttp_url_tostring(const thttp_url_t *url)
{
- tsk_buffer_t *output = tsk_buffer_create_null();
- char* ret = 0;
-
- if(!thttp_url_serialize(url, output)){
- ret = tsk_strndup((const char*)output->data, output->size);
- }
- else{
- TSK_DEBUG_ERROR("Failed to serialize HTTP URL.");
- }
-
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ char* ret = 0;
+
+ if(!thttp_url_serialize(url, output)) {
+ ret = tsk_strndup((const char*)output->data, output->size);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to serialize HTTP URL.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
/**@ingroup thttp_url_group
*/
thttp_url_t *thttp_url_clone(const thttp_url_t *url)
{
- thttp_url_t *newurl = 0;
- tsk_buffer_t *output = tsk_buffer_create_null();
- thttp_url_serialize(url, output);
- newurl = thttp_url_parse(output->data, output->size);
- TSK_OBJECT_SAFE_FREE(output);
+ thttp_url_t *newurl = 0;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ thttp_url_serialize(url, output);
+ newurl = thttp_url_parse(output->data, output->size);
+ TSK_OBJECT_SAFE_FREE(output);
- return newurl;
+ return newurl;
}
/**@ingroup thttp_url_group
*/
tsk_bool_t thttp_url_isvalid(const char* urlstring)
{
- thttp_url_t *url;
- if(!urlstring){
- return tsk_false;
- }
-
- if((url = thttp_url_parse(urlstring, tsk_strlen(urlstring)))){
- TSK_OBJECT_SAFE_FREE(url);
- return tsk_true;
- }
- else{
- return tsk_false;
- }
+ thttp_url_t *url;
+ if(!urlstring) {
+ return tsk_false;
+ }
+
+ if((url = thttp_url_parse(urlstring, tsk_strlen(urlstring)))) {
+ TSK_OBJECT_SAFE_FREE(url);
+ return tsk_true;
+ }
+ else {
+ return tsk_false;
+ }
}
@@ -130,45 +130,44 @@ tsk_bool_t thttp_url_isvalid(const char* urlstring)
*/
static tsk_object_t* thttp_url_ctor(tsk_object_t *self, va_list * app)
{
- thttp_url_t *url = self;
- if(url){
- url->type = va_arg(*app, thttp_url_type_t);
- if(url->type == thttp_url_https){
- url->port = 443;
- }
- else{
- url->port = 80;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new SIP/SIPS/TEL.");
- }
- return self;
+ thttp_url_t *url = self;
+ if(url) {
+ url->type = va_arg(*app, thttp_url_type_t);
+ if(url->type == thttp_url_https) {
+ url->port = 443;
+ }
+ else {
+ url->port = 80;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SIP/SIPS/TEL.");
+ }
+ return self;
}
/**@ingroup thttp_url_group
*/
static tsk_object_t* thttp_url_dtor(tsk_object_t *self)
{
- thttp_url_t *url = self;
- if(url){
- TSK_FREE(url->scheme);
- TSK_FREE(url->host);
- TSK_FREE(url->hpath);
- TSK_FREE(url->search);
- }
- else{
- TSK_DEBUG_ERROR("Null HTTP/HTTPS URL.");
- }
-
- return self;
+ thttp_url_t *url = self;
+ if(url) {
+ TSK_FREE(url->scheme);
+ TSK_FREE(url->host);
+ TSK_FREE(url->hpath);
+ TSK_FREE(url->search);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null HTTP/HTTPS URL.");
+ }
+
+ return self;
}
-static const tsk_object_def_t thttp_url_def_s =
-{
- sizeof(thttp_url_t),
- thttp_url_ctor,
- thttp_url_dtor,
- tsk_null
+static const tsk_object_def_t thttp_url_def_s = {
+ sizeof(thttp_url_t),
+ thttp_url_ctor,
+ thttp_url_dtor,
+ tsk_null
};
const tsk_object_def_t *thttp_url_def_t = &thttp_url_def_s;
diff --git a/tinyHTTP/test/stdafx.c b/tinyHTTP/test/stdafx.c
index e0ce978..3469d19 100755
--- a/tinyHTTP/test/stdafx.c
+++ b/tinyHTTP/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyHTTP/test/stdafx.h b/tinyHTTP/test/stdafx.h
index 6685bdc..6f57c56 100755
--- a/tinyHTTP/test/stdafx.h
+++ b/tinyHTTP/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyHTTP/test/targetver.h b/tinyHTTP/test/targetver.h
index 4d7bde0..8361962 100755
--- a/tinyHTTP/test/targetver.h
+++ b/tinyHTTP/test/targetver.h
@@ -3,8 +3,8 @@
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinyHTTP/test/test.c b/tinyHTTP/test/test.c
index 79ff388..838c8cd 100755
--- a/tinyHTTP/test/test.c
+++ b/tinyHTTP/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -55,39 +55,39 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- tnet_startup();
+ tnet_startup();
- do{
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009-2013 Mamadou Diop \n\n");
+ do {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009-2013 Mamadou Diop \n\n");
#if RUN_TEST_AUTH || RUN_TEST_ALL
- test_ws_auth();
- test_basic_auth();
- test_digest_auth();
+ test_ws_auth();
+ test_basic_auth();
+ test_digest_auth();
#endif
#if RUN_TEST_STACK || RUN_TEST_ALL
- test_stack();
+ test_stack();
#endif
#if RUN_TEST_URL || RUN_TEST_ALL
- test_url();
+ test_url();
#endif
#if RUN_TEST_MSGS || RUN_TEST_ALL
- test_messages();
+ test_messages();
#endif
#if RUN_TEST_TRANSPORT || RUN_TEST_ALL
- test_transport();
+ test_transport();
#endif
- }
- while(LOOP);
+ }
+ while(LOOP);
- tnet_cleanup();
+ tnet_cleanup();
- return 0;
+ return 0;
}
diff --git a/tinyHTTP/test/test_auth.h b/tinyHTTP/test/test_auth.h
index 4a707f1..c5b9efb 100755
--- a/tinyHTTP/test/test_auth.h
+++ b/tinyHTTP/test/test_auth.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -22,68 +22,62 @@
#ifndef _TEST_AUTH_H_
#define _TEST_AUTH_H_
-struct auth_basic_msg
-{
- const char* userid;
- const char* password;
+struct auth_basic_msg {
+ const char* userid;
+ const char* password;
- const char* xres;
+ const char* xres;
};
-struct auth_basic_msg auth_basic_msgs[] =
-{
- { "Aladdin"/*Ali baba*/, "open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" },
+struct auth_basic_msg auth_basic_msgs[] = {
+ { "Aladdin"/*Ali baba*/, "open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" },
};
void test_basic_auth()
{
- char *response = tsk_null;
- size_t i, size;
-
- for(i=0; i<sizeof(auth_basic_msgs)/sizeof(struct auth_basic_msg); i++)
- {
- size = thttp_auth_basic_response(auth_basic_msgs[i].userid, auth_basic_msgs[i].password, &response);
- if(tsk_striequals(auth_basic_msgs[i].xres, response)){
- TSK_DEBUG_INFO("[HTTP_BASIC-%d] ==> OK", i);
- }
- else{
- TSK_DEBUG_INFO("[HTTP_BASIC-%d] ==> NOK", i);
- }
-
- TSK_FREE(response);
- }
+ char *response = tsk_null;
+ size_t i, size;
+
+ for(i=0; i<sizeof(auth_basic_msgs)/sizeof(struct auth_basic_msg); i++) {
+ size = thttp_auth_basic_response(auth_basic_msgs[i].userid, auth_basic_msgs[i].password, &response);
+ if(tsk_striequals(auth_basic_msgs[i].xres, response)) {
+ TSK_DEBUG_INFO("[HTTP_BASIC-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[HTTP_BASIC-%d] ==> NOK", i);
+ }
+
+ TSK_FREE(response);
+ }
}
//========================================================================
-struct auth_ws
-{
- const char* key;
- const char* xres;
+struct auth_ws {
+ const char* key;
+ const char* xres;
};
-struct auth_ws auth_ws_msgs[] =
-{
- { "dGhlIHNhbXBsZSBub25jZQ==", "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" },
- { "x3JJHMbDL1EzLkh9GBhXDw==", "HSmrc0sMlYUkAGmm5OPpG2HaGWk=" },
+struct auth_ws auth_ws_msgs[] = {
+ { "dGhlIHNhbXBsZSBub25jZQ==", "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" },
+ { "x3JJHMbDL1EzLkh9GBhXDw==", "HSmrc0sMlYUkAGmm5OPpG2HaGWk=" },
};
void test_ws_auth()
{
- thttp_auth_ws_keystring_t response = {0};
- size_t i, size;
-
- for(i=0; i<sizeof(auth_ws_msgs)/sizeof(struct auth_ws); i++)
- {
- size = thttp_auth_ws_response(auth_ws_msgs[i].key, &response);
- if(tsk_striequals(auth_ws_msgs[i].xres, response)){
- TSK_DEBUG_INFO("[WS_AUTH-%d] ==> OK", i);
- }
- else{
- TSK_DEBUG_INFO("[WS_AUTH-%d] ==> NOK", i);
- }
- }
+ thttp_auth_ws_keystring_t response = {0};
+ size_t i, size;
+
+ for(i=0; i<sizeof(auth_ws_msgs)/sizeof(struct auth_ws); i++) {
+ size = thttp_auth_ws_response(auth_ws_msgs[i].key, &response);
+ if(tsk_striequals(auth_ws_msgs[i].xres, response)) {
+ TSK_DEBUG_INFO("[WS_AUTH-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[WS_AUTH-%d] ==> NOK", i);
+ }
+ }
}
@@ -91,84 +85,81 @@ void test_ws_auth()
//========================================================================
-struct auth_digest_msg
-{
- const char* username;
- const char* password;
- const char* realm;
- const char* nonce;
- const char* method;
- const char* uri;
- const char* qop;
- const char* nc;
- const char* cnonce;
- const char* opaque;
- const char* entitybody;
-
- const char* response;
+struct auth_digest_msg {
+ const char* username;
+ const char* password;
+ const char* realm;
+ const char* nonce;
+ const char* method;
+ const char* uri;
+ const char* qop;
+ const char* nc;
+ const char* cnonce;
+ const char* opaque;
+ const char* entitybody;
+
+ const char* response;
};
-struct auth_digest_msg auth_digest_msgs[] =
-{
- {
- "Mufasa",
- "Circle Of Life",
- "testrealm@host.com",
- "dcd98b7102dd2f0e8b11d0f600bfb0c093",
- "GET",
- "/dir/index.html",
- "auth",
- "00000001",
- "0a4f113b",
- "5ccc069c403ebaf9f0171e9517f40e41",
- 0,
-
- "6629fae49393a05397450978507c4ef1"
- }
- ,
+struct auth_digest_msg auth_digest_msgs[] = {
+ {
+ "Mufasa",
+ "Circle Of Life",
+ "testrealm@host.com",
+ "dcd98b7102dd2f0e8b11d0f600bfb0c093",
+ "GET",
+ "/dir/index.html",
+ "auth",
+ "00000001",
+ "0a4f113b",
+ "5ccc069c403ebaf9f0171e9517f40e41",
+ 0,
+
+ "6629fae49393a05397450978507c4ef1"
+ }
+ ,
};
void test_digest_auth()
{
- tsk_md5string_t response, ha1, ha2;
- size_t i;
-
- for(i=0; i<sizeof(auth_digest_msgs)/sizeof(struct auth_digest_msg); i++)
- {
- tsk_buffer_t* entitybody;
- /* HA1 */
- thttp_auth_digest_HA1(auth_digest_msgs[i].username,
- auth_digest_msgs[i].realm,
- auth_digest_msgs[i].password,
- &ha1);
-
- /* HA2 */
- entitybody = tsk_buffer_create(auth_digest_msgs[i].entitybody, strlen(auth_digest_msgs[i].entitybody));
- thttp_auth_digest_HA2(auth_digest_msgs[i].method,
- auth_digest_msgs[i].uri,
- entitybody,
- auth_digest_msgs[i].qop,
- &ha2);
- TSK_OBJECT_SAFE_FREE(entitybody);
-
- /* RESPONSE */
- thttp_auth_digest_response(&ha1,
- auth_digest_msgs[i].nonce,
- auth_digest_msgs[i].nc,
- auth_digest_msgs[i].cnonce,
- auth_digest_msgs[i].qop,
- &ha2,
- &response);
-
- if(tsk_striequals(auth_digest_msgs[i].response, response)){
- TSK_DEBUG_INFO("[HTTP_DIGEST-%d] ==> OK", i);
- }
- else{
- TSK_DEBUG_INFO("[HTTP_DIGEST-%d] ==> NOK", i);
- }
- }
+ tsk_md5string_t response, ha1, ha2;
+ size_t i;
+
+ for(i=0; i<sizeof(auth_digest_msgs)/sizeof(struct auth_digest_msg); i++) {
+ tsk_buffer_t* entitybody;
+ /* HA1 */
+ thttp_auth_digest_HA1(auth_digest_msgs[i].username,
+ auth_digest_msgs[i].realm,
+ auth_digest_msgs[i].password,
+ &ha1);
+
+ /* HA2 */
+ entitybody = tsk_buffer_create(auth_digest_msgs[i].entitybody, strlen(auth_digest_msgs[i].entitybody));
+ thttp_auth_digest_HA2(auth_digest_msgs[i].method,
+ auth_digest_msgs[i].uri,
+ entitybody,
+ auth_digest_msgs[i].qop,
+ &ha2);
+ TSK_OBJECT_SAFE_FREE(entitybody);
+
+ /* RESPONSE */
+ thttp_auth_digest_response(&ha1,
+ auth_digest_msgs[i].nonce,
+ auth_digest_msgs[i].nc,
+ auth_digest_msgs[i].cnonce,
+ auth_digest_msgs[i].qop,
+ &ha2,
+ &response);
+
+ if(tsk_striequals(auth_digest_msgs[i].response, response)) {
+ TSK_DEBUG_INFO("[HTTP_DIGEST-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[HTTP_DIGEST-%d] ==> NOK", i);
+ }
+ }
}
diff --git a/tinyHTTP/test/test_messages.h b/tinyHTTP/test/test_messages.h
index 2d2678c..9173e07 100755
--- a/tinyHTTP/test/test_messages.h
+++ b/tinyHTTP/test/test_messages.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -76,63 +76,63 @@
static void test_messages()
{
- thttp_message_t *message = tsk_null;
- tsk_ragel_state_t state;
- int ret/*, idx*/;
-
- const char* msg_start = TEST_MSG_WS;
- const char* msg_end = msg_start + tsk_strlen(msg_start);
- //const thttp_header_Sec_WebSocket_Key_t* ws_hdr_key;
- //const thttp_header_Sec_WebSocket_Version_t* ws_hdr_version;
- //const thttp_header_Sec_WebSocket_Accept_t* ws_hdr_accept;
- message = thttp_message_create();
-
- /*while(msg_start < msg_end){
- if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) <= 2){
- break;
- }
- idx+= 2;
- tsk_ragel_state_init(&state, msg_start, idx);
- if((ret = thttp_header_parse(&state, message))){
- break;
- }
- msg_start += idx;
- }
-
- if((ws_hdr_key = (const thttp_header_Sec_WebSocket_Key_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Key))){
- TSK_DEBUG_INFO("Sec-WebSocket-Key: %s", ws_hdr_key->value);
- }
-
- if((ws_hdr_accept = (const thttp_header_Sec_WebSocket_Accept_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Accept))){
- TSK_DEBUG_INFO("Sec-WebSocket-Accept: %s", ws_hdr_accept->value);
- }
-
- if((ws_hdr_version = (const thttp_header_Sec_WebSocket_Version_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Version))){
- const tsk_list_item_t* item;
- tsk_list_foreach(item, ws_hdr_version->values){
- TSK_DEBUG_INFO("Sec-WebSocket-Version: %s", TSK_STRING_STR(item->data));
- }
- }*/
-
-
- /* deserialize the message */
- tsk_ragel_state_init(&state, TEST_MSG, strlen(TEST_MSG));
- if(!(ret = thttp_message_parse(&state, &message, tsk_true))){
- tsk_buffer_t *buffer = tsk_buffer_create_null();
-
- /* serialize the message */
- thttp_message_serialize(message, buffer);
- TSK_DEBUG_INFO("HTTP Message=\n%s", TSK_BUFFER_TO_STRING(buffer));
-
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse HTTP message.");
- }
-
- TSK_OBJECT_SAFE_FREE(message);
-
- getchar();
+ thttp_message_t *message = tsk_null;
+ tsk_ragel_state_t state;
+ int ret/*, idx*/;
+
+ const char* msg_start = TEST_MSG_WS;
+ const char* msg_end = msg_start + tsk_strlen(msg_start);
+ //const thttp_header_Sec_WebSocket_Key_t* ws_hdr_key;
+ //const thttp_header_Sec_WebSocket_Version_t* ws_hdr_version;
+ //const thttp_header_Sec_WebSocket_Accept_t* ws_hdr_accept;
+ message = thttp_message_create();
+
+ /*while(msg_start < msg_end){
+ if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) <= 2){
+ break;
+ }
+ idx+= 2;
+ tsk_ragel_state_init(&state, msg_start, idx);
+ if((ret = thttp_header_parse(&state, message))){
+ break;
+ }
+ msg_start += idx;
+ }
+
+ if((ws_hdr_key = (const thttp_header_Sec_WebSocket_Key_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Key))){
+ TSK_DEBUG_INFO("Sec-WebSocket-Key: %s", ws_hdr_key->value);
+ }
+
+ if((ws_hdr_accept = (const thttp_header_Sec_WebSocket_Accept_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Accept))){
+ TSK_DEBUG_INFO("Sec-WebSocket-Accept: %s", ws_hdr_accept->value);
+ }
+
+ if((ws_hdr_version = (const thttp_header_Sec_WebSocket_Version_t*)thttp_message_get_header(message, thttp_htype_Sec_WebSocket_Version))){
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, ws_hdr_version->values){
+ TSK_DEBUG_INFO("Sec-WebSocket-Version: %s", TSK_STRING_STR(item->data));
+ }
+ }*/
+
+
+ /* deserialize the message */
+ tsk_ragel_state_init(&state, TEST_MSG, strlen(TEST_MSG));
+ if(!(ret = thttp_message_parse(&state, &message, tsk_true))) {
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
+
+ /* serialize the message */
+ thttp_message_serialize(message, buffer);
+ TSK_DEBUG_INFO("HTTP Message=\n%s", TSK_BUFFER_TO_STRING(buffer));
+
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse HTTP message.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+
+ getchar();
}
#endif /* _TEST_MESSAGES_H_ */
diff --git a/tinyHTTP/test/test_stack.h b/tinyHTTP/test/test_stack.h
index 7ae015b..82a5b49 100755
--- a/tinyHTTP/test/test_stack.h
+++ b/tinyHTTP/test/test_stack.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -24,47 +24,43 @@
int test_stack_callback(const thttp_event_t *httpevent)
{
- thttp_session_id_t id = thttp_session_get_id(httpevent->session);
- switch(httpevent->type){
- case thttp_event_message: /* New HTTP message */
- {
- TSK_DEBUG_INFO("sid=%llu", id);
- if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)){
- const thttp_header_ETag_t* etag;
- TSK_DEBUG_INFO("=== %d ==> %s", THTTP_RESPONSE_CODE(httpevent->message), THTTP_MESSAGE_CONTENT(httpevent->message));
- // You can use
- if((etag = (const thttp_header_ETag_t*)thttp_message_get_header(httpevent->message, thttp_htype_ETag))){
- TSK_DEBUG_INFO("Etag=%s", etag->value);
- }
- }
- else{
- if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)){
- TSK_DEBUG_INFO("=== code ==> %u", THTTP_RESPONSE_CODE(httpevent->message));
- }
- }
- break;
- }
-
- case thttp_event_auth_failed:
- {
- TSK_DEBUG_INFO("auth failed sid=%llu", id);
- break;
- }
-
- case thttp_event_closed: /* HTTP connection closed (informational) */
- {
- TSK_DEBUG_INFO("closed sid=%llu", id);
- break;
- }
-
- case thttp_event_transport_error: /* HTTP connection closed (informational) */
- {
- TSK_DEBUG_INFO("Transport sid=%llu", id);
- break;
- }
- }
-
- return 0;
+ thttp_session_id_t id = thttp_session_get_id(httpevent->session);
+ switch(httpevent->type) {
+ case thttp_event_message: { /* New HTTP message */
+ TSK_DEBUG_INFO("sid=%llu", id);
+ if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)) {
+ const thttp_header_ETag_t* etag;
+ TSK_DEBUG_INFO("=== %d ==> %s", THTTP_RESPONSE_CODE(httpevent->message), THTTP_MESSAGE_CONTENT(httpevent->message));
+ // You can use
+ if((etag = (const thttp_header_ETag_t*)thttp_message_get_header(httpevent->message, thttp_htype_ETag))) {
+ TSK_DEBUG_INFO("Etag=%s", etag->value);
+ }
+ }
+ else {
+ if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)) {
+ TSK_DEBUG_INFO("=== code ==> %u", THTTP_RESPONSE_CODE(httpevent->message));
+ }
+ }
+ break;
+ }
+
+ case thttp_event_auth_failed: {
+ TSK_DEBUG_INFO("auth failed sid=%llu", id);
+ break;
+ }
+
+ case thttp_event_closed: { /* HTTP connection closed (informational) */
+ TSK_DEBUG_INFO("closed sid=%llu", id);
+ break;
+ }
+
+ case thttp_event_transport_error: { /* HTTP connection closed (informational) */
+ TSK_DEBUG_INFO("Transport sid=%llu", id);
+ break;
+ }
+ }
+
+ return 0;
}
#define PAYLOAD "<entry uri=\"sip:samba@micromethod.com\" xmlns=\"urn:ietf:params:xml:ns:resource-lists\">" \
@@ -73,159 +69,159 @@ int test_stack_callback(const thttp_event_t *httpevent)
void test_stack()
{
- thttp_session_handle_t *session = tsk_null;
- int ret;
-
- thttp_stack_handle_t* stack = thttp_stack_create(test_stack_callback,
- THTTP_STACK_SET_TLS_ENABLED(tsk_true),
- //THTTP_STACK_SET_TLS_CERTS_VERIFY(tsk_false),
- //THTTP_STACK_SET_LOCAL_IP("0.0.0.0"),
- //THTTP_STACK_SET_LOCAL_PORT(8080),
- //THTTP_STACK_SET_PROXY("msp.f-secure.com", 443),
-
- THTTP_STACK_SET_NULL());
-
- if((ret = thttp_stack_start(stack))){
- TSK_DEBUG_ERROR("Failed to start the HTTP/HTTPS stack.");
- goto bail;
- }
-
-
- // http://ipv6.google.com/
- //op = THTTP_OPERATION_CREATE(stack,
- // THTTP_OPERATION_SET_PARAM("method", "GET"),
- // THTTP_OPERATION_SET_PARAM("URL", "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index"),
- //
- // THTTP_OPERATION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
- // THTTP_OPERATION_SET_HEADER("Pragma", "No-Cache"),
- // THTTP_OPERATION_SET_HEADER("Connection", "Keep-Alive"),
- // THTTP_OPERATION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
- // THTTP_OPERATION_SET_HEADER("X-3GPP-Intended-Identity", "sip:mercuro1@doubango.org"),
- //
- // THTTP_OPERATION_SET_NULL());
- //thttp_operation_perform(op);
-
- /* creates session */
- session = thttp_session_create(stack,
- // session-level options
- THTTP_SESSION_SET_OPTION(THTTP_SESSION_OPTION_TIMEOUT, "6000"),
-
- // session-level headers
- THTTP_SESSION_SET_HEADER("Pragma", "No-Cache"),
- THTTP_SESSION_SET_HEADER("Connection", "Keep-Alive"),
- // THTTP_SESSION_SET_HEADER("Connection", "close"),
- THTTP_SESSION_SET_HEADER("User-Agent", "doubango 1.0"),
-
- THTTP_SESSION_SET_NULL()); /* MUST always be present */
-
- //ret = thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
- // THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
- //
- // tsk_null);
-
- //getchar();
-
- //thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
- // THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
- //
- // tsk_null);
-
- //getchar();
-
- // HTTPS
- thttp_action_GET(session, "https://msp.f-secure.com/web-test/common/test.html",
- // action-level options
- THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
-
- // action-level headers
- THTTP_ACTION_SET_HEADER("User-Agent", "Doubango"),
- THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
-
- THTTP_ACTION_SET_NULL());
- getchar();
-
-
- // IPv6
- /*thttp_action_GET(session, "http://ipv6.google.com",
- // action-level options
- THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
-
- // action-level headers
- THTTP_ACTION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
- THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
-
- THTTP_ACTION_SET_NULL());
- getchar();*/
-
- /*ret = thttp_action_GET(session, "http://doubango.org",
- // action-level options
- THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
-
- THTTP_ACTION_SET_NULL());
-
- getchar();*/
-
- //thttp_action_GET(session, "http://www.google.com",
- //THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
-
- // THTTP_ACTION_SET_NULL());
-
- //thttp_action_GET(session, "http://www.doubango.org",
-
- // THTTP_ACTION_SET_NULL());
-
- /* Gets resource-lists document */
- /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
- THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
-
- tsk_null);
-
- getchar();*/
-
- //TSK_OBJECT_SAFE_FREE(session);
-
- //getchar();
-
- /* Gets xcap-caps document */
- /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/xcap-caps/global/index",
- THTTP_ACTION_SET_HEADER("Content-Type", "application/xcap-caps+xml"),
-
- tsk_null);
-
- getchar();*/
-
- /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/properties-resource-list.xml",
- THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
-
- tsk_null);
-
- getchar();*/
-
- //thttp_operation_perform(op);
+ thttp_session_handle_t *session = tsk_null;
+ int ret;
-/*
- op = THTTP_OPERATION_CREATE(stack,
- THTTP_OPERATION_SET_PARAM("method", "GET"),
- //THTTP_OPERATION_SET_PARAM("URL", "https://msp.f-secure.com/web-test/common/test.html"),
- THTTP_OPERATION_SET_PARAM("URL", "http://www.doubango.org"),
-
- THTTP_OPERATION_SET_HEADER("Pragma", "No-Cache"),
- THTTP_OPERATION_SET_HEADER("Connection", "Keep-Alive"),
- THTTP_OPERATION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
-
- THTTP_OPERATION_SET_NULL());
- thttp_operation_perform(op);
-*/
- /*thttp_operation_set(op,
- THTTP_OPERATION_SET_PARAM("method", "HEAD"),
-
- THTTP_OPERATION_SET_NULL());
- thttp_operation_perform(op);*/
+ thttp_stack_handle_t* stack = thttp_stack_create(test_stack_callback,
+ THTTP_STACK_SET_TLS_ENABLED(tsk_true),
+ //THTTP_STACK_SET_TLS_CERTS_VERIFY(tsk_false),
+ //THTTP_STACK_SET_LOCAL_IP("0.0.0.0"),
+ //THTTP_STACK_SET_LOCAL_PORT(8080),
+ //THTTP_STACK_SET_PROXY("msp.f-secure.com", 443),
+
+ THTTP_STACK_SET_NULL());
+
+ if((ret = thttp_stack_start(stack))) {
+ TSK_DEBUG_ERROR("Failed to start the HTTP/HTTPS stack.");
+ goto bail;
+ }
+
+
+ // http://ipv6.google.com/
+ //op = THTTP_OPERATION_CREATE(stack,
+ // THTTP_OPERATION_SET_PARAM("method", "GET"),
+ // THTTP_OPERATION_SET_PARAM("URL", "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index"),
+ //
+ // THTTP_OPERATION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+ // THTTP_OPERATION_SET_HEADER("Pragma", "No-Cache"),
+ // THTTP_OPERATION_SET_HEADER("Connection", "Keep-Alive"),
+ // THTTP_OPERATION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
+ // THTTP_OPERATION_SET_HEADER("X-3GPP-Intended-Identity", "sip:mercuro1@doubango.org"),
+ //
+ // THTTP_OPERATION_SET_NULL());
+ //thttp_operation_perform(op);
+
+ /* creates session */
+ session = thttp_session_create(stack,
+ // session-level options
+ THTTP_SESSION_SET_OPTION(THTTP_SESSION_OPTION_TIMEOUT, "6000"),
+
+ // session-level headers
+ THTTP_SESSION_SET_HEADER("Pragma", "No-Cache"),
+ THTTP_SESSION_SET_HEADER("Connection", "Keep-Alive"),
+ // THTTP_SESSION_SET_HEADER("Connection", "close"),
+ THTTP_SESSION_SET_HEADER("User-Agent", "doubango 1.0"),
+
+ THTTP_SESSION_SET_NULL()); /* MUST always be present */
+
+ //ret = thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
+ // THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+ //
+ // tsk_null);
+
+ //getchar();
+
+ //thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
+ // THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+ //
+ // tsk_null);
+
+ //getchar();
+
+ // HTTPS
+ thttp_action_GET(session, "https://msp.f-secure.com/web-test/common/test.html",
+ // action-level options
+ THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
+
+ // action-level headers
+ THTTP_ACTION_SET_HEADER("User-Agent", "Doubango"),
+ THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
+
+ THTTP_ACTION_SET_NULL());
+ getchar();
+
+
+ // IPv6
+ /*thttp_action_GET(session, "http://ipv6.google.com",
+ // action-level options
+ THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
+
+ // action-level headers
+ THTTP_ACTION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
+ THTTP_ACTION_SET_HEADER("Connection", "Keep-Alive"),
+
+ THTTP_ACTION_SET_NULL());
+ getchar();*/
+
+ /*ret = thttp_action_GET(session, "http://doubango.org",
+ // action-level options
+ THTTP_ACTION_SET_OPTION(THTTP_ACTION_OPTION_TIMEOUT, "2500"),
+
+ THTTP_ACTION_SET_NULL());
+
+ getchar();*/
+
+ //thttp_action_GET(session, "http://www.google.com",
+ //THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+
+ // THTTP_ACTION_SET_NULL());
+
+ //thttp_action_GET(session, "http://www.doubango.org",
+
+ // THTTP_ACTION_SET_NULL());
+
+ /* Gets resource-lists document */
+ /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/index",
+ THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+
+ tsk_null);
+
+ getchar();*/
+
+ //TSK_OBJECT_SAFE_FREE(session);
+
+ //getchar();
+
+ /* Gets xcap-caps document */
+ /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/xcap-caps/global/index",
+ THTTP_ACTION_SET_HEADER("Content-Type", "application/xcap-caps+xml"),
+
+ tsk_null);
+
+ getchar();*/
+
+ /*thttp_action_GET(session, "http://siptest.doubango.org:8080/services/resource-lists/users/sip:mercuro1@doubango.org/properties-resource-list.xml",
+ THTTP_ACTION_SET_HEADER("Content-Type", "application/resource-lists+xml"),
+
+ tsk_null);
+
+ getchar();*/
+
+ //thttp_operation_perform(op);
+
+ /*
+ op = THTTP_OPERATION_CREATE(stack,
+ THTTP_OPERATION_SET_PARAM("method", "GET"),
+ //THTTP_OPERATION_SET_PARAM("URL", "https://msp.f-secure.com/web-test/common/test.html"),
+ THTTP_OPERATION_SET_PARAM("URL", "http://www.doubango.org"),
+
+ THTTP_OPERATION_SET_HEADER("Pragma", "No-Cache"),
+ THTTP_OPERATION_SET_HEADER("Connection", "Keep-Alive"),
+ THTTP_OPERATION_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
+
+ THTTP_OPERATION_SET_NULL());
+ thttp_operation_perform(op);
+ */
+ /*thttp_operation_set(op,
+ THTTP_OPERATION_SET_PARAM("method", "HEAD"),
+
+ THTTP_OPERATION_SET_NULL());
+ thttp_operation_perform(op);*/
- getchar();
+ getchar();
bail:
- TSK_OBJECT_SAFE_FREE(session);
- TSK_OBJECT_SAFE_FREE(stack);
+ TSK_OBJECT_SAFE_FREE(session);
+ TSK_OBJECT_SAFE_FREE(stack);
}
#endif /* _TEST_STACK_H_ */
diff --git a/tinyHTTP/test/test_transport.h b/tinyHTTP/test/test_transport.h
index dec9920..b507b42 100755
--- a/tinyHTTP/test/test_transport.h
+++ b/tinyHTTP/test/test_transport.h
@@ -21,308 +21,303 @@
"Accept-Encoding: gzip,deflate,sdch\r\n" \
"Accept-Language: en-US,en;q=0.8\r\n" \
"\r\n" \
-
+
static int test_http_transport_callback(const tnet_transport_event_t* e);
/************************************************
* test_http_peer_t
************************************************/
-typedef struct test_http_peer_s
-{
- TSK_DECLARE_OBJECT;
- tnet_fd_t fd;
- tsk_buffer_t* buff;
+typedef struct test_http_peer_s {
+ TSK_DECLARE_OBJECT;
+ tnet_fd_t fd;
+ tsk_buffer_t* buff;
}
test_http_peer_t;
typedef tsk_list_t test_http_peers_L_t;
-static tsk_object_t* test_http_peer_ctor(tsk_object_t * self, va_list * app) { return self; }
+static tsk_object_t* test_http_peer_ctor(tsk_object_t * self, va_list * app)
+{
+ return self;
+}
static tsk_object_t* test_http_peer_dtor(tsk_object_t * self)
-{
- test_http_peer_t *peer = self;
- if (peer) {
- TSK_OBJECT_SAFE_FREE(peer->buff);
- }
+{
+ test_http_peer_t *peer = self;
+ if (peer) {
+ TSK_OBJECT_SAFE_FREE(peer->buff);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t test_http_peer_def_s =
-{
- sizeof(test_http_peer_t),
- test_http_peer_ctor,
- test_http_peer_dtor,
- tsk_null,
+static const tsk_object_def_t test_http_peer_def_s = {
+ sizeof(test_http_peer_t),
+ test_http_peer_ctor,
+ test_http_peer_dtor,
+ tsk_null,
};
static test_http_peer_t* test_http_peer_create(tnet_fd_t fd)
{
- test_http_peer_t* peer = tsk_object_new(&test_http_peer_def_s);
- peer->fd = fd;
- peer->buff = tsk_buffer_create_null();
- return peer;
+ test_http_peer_t* peer = tsk_object_new(&test_http_peer_def_s);
+ peer->fd = fd;
+ peer->buff = tsk_buffer_create_null();
+ return peer;
}
static int test_http_peer_pred_fd_cmp(const tsk_list_item_t* item, const void* data)
{
- return ((test_http_peer_t*)item->data)->fd - *((const tnet_fd_t*)data);
+ return ((test_http_peer_t*)item->data)->fd - *((const tnet_fd_t*)data);
}
/************************************************
* test_http_transport_t
************************************************/
-typedef struct test_http_transport_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct test_http_transport_s {
+ TSK_DECLARE_OBJECT;
- test_http_peers_L_t* peers;
- tnet_transport_handle_t* handle;
+ test_http_peers_L_t* peers;
+ tnet_transport_handle_t* handle;
}
test_http_transport_t;
static tsk_object_t* test_http_transport_ctor(tsk_object_t * self, va_list * app)
-{
- test_http_transport_t *transport = self;
- if (transport) {
- }
- return self;
+{
+ test_http_transport_t *transport = self;
+ if (transport) {
+ }
+ return self;
}
static tsk_object_t* test_http_transport_dtor(tsk_object_t * self)
-{
- test_http_transport_t *transport = self;
- if(transport){
- TSK_OBJECT_SAFE_FREE(transport->handle);
- TSK_OBJECT_SAFE_FREE(transport->peers);
- }
-
- return self;
-}
-static const tsk_object_def_t test_http_transport_def_s =
{
- sizeof(test_http_transport_t),
- test_http_transport_ctor,
- test_http_transport_dtor,
- tsk_null,
+ test_http_transport_t *transport = self;
+ if(transport) {
+ TSK_OBJECT_SAFE_FREE(transport->handle);
+ TSK_OBJECT_SAFE_FREE(transport->peers);
+ }
+
+ return self;
+}
+static const tsk_object_def_t test_http_transport_def_s = {
+ sizeof(test_http_transport_t),
+ test_http_transport_ctor,
+ test_http_transport_dtor,
+ tsk_null,
};
static test_http_transport_t* test_http_transport_create(const char* local_ip, tnet_port_t local_port, enum tnet_socket_type_e socket_type)
{
- test_http_transport_t *transport = tsk_object_new(&test_http_transport_def_s);
- if (transport) {
- transport->peers = tsk_list_create();
- transport->handle = tnet_transport_create(local_ip, local_port, socket_type, "HTTP Transport");
- if (!transport->handle) {
- TSK_OBJECT_SAFE_FREE(transport);
- return tsk_null;
- }
- tnet_transport_set_callback(transport->handle, test_http_transport_callback, transport);
- }
- return transport;
+ test_http_transport_t *transport = tsk_object_new(&test_http_transport_def_s);
+ if (transport) {
+ transport->peers = tsk_list_create();
+ transport->handle = tnet_transport_create(local_ip, local_port, socket_type, "HTTP Transport");
+ if (!transport->handle) {
+ TSK_OBJECT_SAFE_FREE(transport);
+ return tsk_null;
+ }
+ tnet_transport_set_callback(transport->handle, test_http_transport_callback, transport);
+ }
+ return transport;
}
static int test_http_transport_start(test_http_transport_t* self)
{
- if (self) {
- return tnet_transport_start(self->handle);
- }
- return -1;
+ if (self) {
+ return tnet_transport_start(self->handle);
+ }
+ return -1;
}
// Up to the caller to free the returned object using TSK_OBJECT_SAFREE(peer)
static test_http_peer_t* test_http_transport_connect_to(test_http_transport_t* self, const char* dst_host, tnet_port_t dst_port)
{
- tnet_fd_t fd = tnet_transport_connectto_2(self->handle, dst_host, dst_port);
- if (fd > 0) {
- return test_http_peer_create(fd);
- }
- return tsk_null;
+ tnet_fd_t fd = tnet_transport_connectto_2(self->handle, dst_host, dst_port);
+ if (fd > 0) {
+ return test_http_peer_create(fd);
+ }
+ return tsk_null;
}
static tsk_size_t test_http_transport_send_data(test_http_transport_t* self, tnet_fd_t fd, const void* data_ptr, tsk_size_t data_size)
{
- if (self && self->handle && data_ptr && data_size) {
- return tnet_transport_send(self->handle, fd, data_ptr, data_size);
- }
- return 0;
+ if (self && self->handle && data_ptr && data_size) {
+ return tnet_transport_send(self->handle, fd, data_ptr, data_size);
+ }
+ return 0;
}
static void test_http_transport_add_peer(test_http_transport_t* self, test_http_peer_t* peer)
{
- tsk_list_lock(self->peers);
- tsk_list_push_back_data(self->peers, &peer);
- tsk_list_unlock(self->peers);
+ tsk_list_lock(self->peers);
+ tsk_list_push_back_data(self->peers, &peer);
+ tsk_list_unlock(self->peers);
}
static void test_http_transport_remove_peer_by_fd(test_http_transport_t* self, tnet_fd_t fd)
{
- tsk_list_lock(self->peers);
- tsk_list_remove_item_by_pred(self->peers, test_http_peer_pred_fd_cmp, &fd);
- tsk_list_unlock(self->peers);
+ tsk_list_lock(self->peers);
+ tsk_list_remove_item_by_pred(self->peers, test_http_peer_pred_fd_cmp, &fd);
+ tsk_list_unlock(self->peers);
}
static const test_http_peer_t* test_http_transport_find_peer_by_fd(test_http_transport_t* self, tnet_fd_t fd)
{
- const tsk_list_item_t* item;
- tsk_list_lock(self->peers);
- item = tsk_list_find_item_by_pred(self->peers, test_http_peer_pred_fd_cmp, &fd);
- tsk_list_unlock(self->peers);
- if (item) {
- return (const test_http_peer_t*)item->data;
- }
- return tsk_null;
+ const tsk_list_item_t* item;
+ tsk_list_lock(self->peers);
+ item = tsk_list_find_item_by_pred(self->peers, test_http_peer_pred_fd_cmp, &fd);
+ tsk_list_unlock(self->peers);
+ if (item) {
+ return (const test_http_peer_t*)item->data;
+ }
+ return tsk_null;
}
static void test_http_transport_process_incoming_msg(test_http_transport_t* self, const thttp_message_t* msg, tnet_fd_t fd)
{
- if (THTTP_MESSAGE_IS_REQUEST(msg)) {
- if (tsk_striequals(msg->line.request.method, "GET")) {
- char* result = tsk_null;
- const char* content = "<html><body>Hello world!</body></html>";
- int len = tsk_sprintf(
- (char**)&result,
- "HTTP/1.1 %u %s\r\n"
- "Server: My test server \r\n"
- "Access-Control-Allow-Origin: *\r\n"
- "Content-Length: %u\r\n"
- "Content-Type: text/html\r\n"
- "Connection: Close\r\n"
- "\r\n"
- "%s", 200, "OK", tsk_strlen(content), content);
- tnet_transport_send(self, fd, result, len);
- TSK_FREE(result);
- }
- }
+ if (THTTP_MESSAGE_IS_REQUEST(msg)) {
+ if (tsk_striequals(msg->line.request.method, "GET")) {
+ char* result = tsk_null;
+ const char* content = "<html><body>Hello world!</body></html>";
+ int len = tsk_sprintf(
+ (char**)&result,
+ "HTTP/1.1 %u %s\r\n"
+ "Server: My test server \r\n"
+ "Access-Control-Allow-Origin: *\r\n"
+ "Content-Length: %u\r\n"
+ "Content-Type: text/html\r\n"
+ "Connection: Close\r\n"
+ "\r\n"
+ "%s", 200, "OK", tsk_strlen(content), content);
+ tnet_transport_send(self, fd, result, len);
+ TSK_FREE(result);
+ }
+ }
}
static int test_http_transport_callback(const tnet_transport_event_t* e)
{
- test_http_transport_t* transport = (test_http_transport_t*)e->callback_data;
- const test_http_peer_t* _peer;
- thttp_message_t *message = tsk_null;
- int endOfheaders = -1;
- tsk_ragel_state_t state;
- tsk_bool_t have_all_content = tsk_false;
- int ret;
- switch (e->type)
- {
- case event_closed:
- {
- test_http_transport_remove_peer_by_fd(transport, e->local_fd);
- return 0;
- }
-
- case event_connected:
- case event_accepted:
- {
- _peer = test_http_transport_find_peer_by_fd(transport, e->local_fd);
- if (!_peer) {
- _peer = test_http_peer_create(e->local_fd);
- test_http_transport_add_peer(transport, (test_http_peer_t*)_peer);
- }
- return 0;
- }
-
- case event_data:
- {
- TSK_DEBUG_INFO("\n\nRECV: %.*s\n\n", e->size, (const char*)e->data);
- break;
- }
- default:
- return 0;
- }
-
-
- _peer = test_http_transport_find_peer_by_fd(transport, e->local_fd);
- if(!_peer) {
- TSK_DEBUG_ERROR("Data event but no peer found!");
- return -1;
- }
-
- /* Append new content. */
- tsk_buffer_append(_peer->buff, e->data, e->size);
-
- /* Check if we have all HTTP headers. */
+ test_http_transport_t* transport = (test_http_transport_t*)e->callback_data;
+ const test_http_peer_t* _peer;
+ thttp_message_t *message = tsk_null;
+ int endOfheaders = -1;
+ tsk_ragel_state_t state;
+ tsk_bool_t have_all_content = tsk_false;
+ int ret;
+ switch (e->type) {
+ case event_closed: {
+ test_http_transport_remove_peer_by_fd(transport, e->local_fd);
+ return 0;
+ }
+
+ case event_connected:
+ case event_accepted: {
+ _peer = test_http_transport_find_peer_by_fd(transport, e->local_fd);
+ if (!_peer) {
+ _peer = test_http_peer_create(e->local_fd);
+ test_http_transport_add_peer(transport, (test_http_peer_t*)_peer);
+ }
+ return 0;
+ }
+
+ case event_data: {
+ TSK_DEBUG_INFO("\n\nRECV: %.*s\n\n", e->size, (const char*)e->data);
+ break;
+ }
+ default:
+ return 0;
+ }
+
+
+ _peer = test_http_transport_find_peer_by_fd(transport, e->local_fd);
+ if(!_peer) {
+ TSK_DEBUG_ERROR("Data event but no peer found!");
+ return -1;
+ }
+
+ /* Append new content. */
+ tsk_buffer_append(_peer->buff, e->data, e->size);
+
+ /* Check if we have all HTTP headers. */
parse_buffer:
- if ((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(_peer->buff), TSK_BUFFER_SIZE(_peer->buff), "\r\n\r\n"/*2CRLF*/)) < 0) {
- TSK_DEBUG_INFO("No all HTTP headers in the TCP buffer.");
- goto bail;
- }
-
- /* If we are here this mean that we have all HTTP headers.
- * ==> Parse the HTTP message without the content.
- */
- tsk_ragel_state_init(&state, TSK_BUFFER_DATA(_peer->buff), endOfheaders + 4/*2CRLF*/);
- if (!(ret = thttp_message_parse(&state, &message, tsk_false/* do not extract the content */))) {
- const thttp_header_Transfer_Encoding_t* transfer_Encoding;
-
- /* chunked? */
- if((transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)thttp_message_get_header(message, thttp_htype_Transfer_Encoding)) && tsk_striequals(transfer_Encoding->encoding, "chunked")){
- const char* start = (const char*)(TSK_BUFFER_TO_U8(_peer->buff) + (endOfheaders + 4/*2CRLF*/));
- const char* end = (const char*)(TSK_BUFFER_TO_U8(_peer->buff) + TSK_BUFFER_SIZE(_peer->buff));
- int index;
-
- TSK_DEBUG_INFO("CHUNKED transfer.");
- while(start < end){
- /* RFC 2616 - 19.4.6 Introduction of Transfer-Encoding */
- // read chunk-size, chunk-extension (if any) and CRLF
- tsk_size_t chunk_size = (tsk_size_t)tsk_atox(start);
- if((index = tsk_strindexOf(start, (end-start), "\r\n")) >=0){
- start += index + 2/*CRLF*/;
- }
- else{
- TSK_DEBUG_INFO("Parsing chunked data has failed.");
- break;
- }
-
- if(chunk_size == 0 && ((start + 2) <= end) && *start == '\r' && *(start+ 1) == '\n'){
- int parsed_len = (start - (const char*)(TSK_BUFFER_TO_U8(_peer->buff))) + 2/*CRLF*/;
- tsk_buffer_remove(_peer->buff, 0, parsed_len);
- have_all_content = tsk_true;
- break;
- }
-
- thttp_message_append_content(message, start, chunk_size);
- start += chunk_size + 2/*CRLF*/;
- }
- }
- else{
- tsk_size_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header. */
- if(clen == 0){ /* No content */
- tsk_buffer_remove(_peer->buff, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF ==> must never happen */
- have_all_content = tsk_true;
- }
- else{ /* There is a content */
- if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(_peer->buff)){ /* There is content but not all the content. */
- TSK_DEBUG_INFO("No all HTTP content in the TCP buffer.");
- goto bail;
- }
- else{
- /* Add the content to the message. */
- thttp_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(_peer->buff) + endOfheaders + 4/*2CRLF*/, clen);
- /* Remove HTTP headers, CRLF and the content. */
- tsk_buffer_remove(_peer->buff, 0, (endOfheaders + 4/*2CRLF*/ + clen));
- have_all_content = tsk_true;
- }
- }
- }
- }
-
- /* Alert the dialog (FSM) */
- if(message){
- if (have_all_content) { /* only if we have all data */
- test_http_transport_process_incoming_msg(transport, message, e->local_fd);
- /* Parse next chunck */
- if (TSK_BUFFER_SIZE(_peer->buff) >= TEST_HTTP_MIN_STREAM_CHUNCK_SIZE) {
- TSK_OBJECT_SAFE_FREE(message);
- goto parse_buffer;
- }
- }
- }
+ if ((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(_peer->buff), TSK_BUFFER_SIZE(_peer->buff), "\r\n\r\n"/*2CRLF*/)) < 0) {
+ TSK_DEBUG_INFO("No all HTTP headers in the TCP buffer.");
+ goto bail;
+ }
+
+ /* If we are here this mean that we have all HTTP headers.
+ * ==> Parse the HTTP message without the content.
+ */
+ tsk_ragel_state_init(&state, TSK_BUFFER_DATA(_peer->buff), endOfheaders + 4/*2CRLF*/);
+ if (!(ret = thttp_message_parse(&state, &message, tsk_false/* do not extract the content */))) {
+ const thttp_header_Transfer_Encoding_t* transfer_Encoding;
+
+ /* chunked? */
+ if((transfer_Encoding = (const thttp_header_Transfer_Encoding_t*)thttp_message_get_header(message, thttp_htype_Transfer_Encoding)) && tsk_striequals(transfer_Encoding->encoding, "chunked")) {
+ const char* start = (const char*)(TSK_BUFFER_TO_U8(_peer->buff) + (endOfheaders + 4/*2CRLF*/));
+ const char* end = (const char*)(TSK_BUFFER_TO_U8(_peer->buff) + TSK_BUFFER_SIZE(_peer->buff));
+ int index;
+
+ TSK_DEBUG_INFO("CHUNKED transfer.");
+ while(start < end) {
+ /* RFC 2616 - 19.4.6 Introduction of Transfer-Encoding */
+ // read chunk-size, chunk-extension (if any) and CRLF
+ tsk_size_t chunk_size = (tsk_size_t)tsk_atox(start);
+ if((index = tsk_strindexOf(start, (end-start), "\r\n")) >=0) {
+ start += index + 2/*CRLF*/;
+ }
+ else {
+ TSK_DEBUG_INFO("Parsing chunked data has failed.");
+ break;
+ }
+
+ if(chunk_size == 0 && ((start + 2) <= end) && *start == '\r' && *(start+ 1) == '\n') {
+ int parsed_len = (start - (const char*)(TSK_BUFFER_TO_U8(_peer->buff))) + 2/*CRLF*/;
+ tsk_buffer_remove(_peer->buff, 0, parsed_len);
+ have_all_content = tsk_true;
+ break;
+ }
+
+ thttp_message_append_content(message, start, chunk_size);
+ start += chunk_size + 2/*CRLF*/;
+ }
+ }
+ else {
+ tsk_size_t clen = THTTP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header. */
+ if(clen == 0) { /* No content */
+ tsk_buffer_remove(_peer->buff, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF ==> must never happen */
+ have_all_content = tsk_true;
+ }
+ else { /* There is a content */
+ if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(_peer->buff)) { /* There is content but not all the content. */
+ TSK_DEBUG_INFO("No all HTTP content in the TCP buffer.");
+ goto bail;
+ }
+ else {
+ /* Add the content to the message. */
+ thttp_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(_peer->buff) + endOfheaders + 4/*2CRLF*/, clen);
+ /* Remove HTTP headers, CRLF and the content. */
+ tsk_buffer_remove(_peer->buff, 0, (endOfheaders + 4/*2CRLF*/ + clen));
+ have_all_content = tsk_true;
+ }
+ }
+ }
+ }
+
+ /* Alert the dialog (FSM) */
+ if(message) {
+ if (have_all_content) { /* only if we have all data */
+ test_http_transport_process_incoming_msg(transport, message, e->local_fd);
+ /* Parse next chunck */
+ if (TSK_BUFFER_SIZE(_peer->buff) >= TEST_HTTP_MIN_STREAM_CHUNCK_SIZE) {
+ TSK_OBJECT_SAFE_FREE(message);
+ goto parse_buffer;
+ }
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(message);
+ TSK_OBJECT_SAFE_FREE(message);
- return 0;
+ return 0;
}
@@ -331,41 +326,41 @@ bail:
************************************************/
static void test_transport()
{
- test_http_transport_t* p_transport = tsk_null;
- test_http_peer_t* peer = tsk_null;
- int ret;
- static const char* __get_msg = TEST_HTTP_GET;
-
- p_transport = test_http_transport_create(TEST_HTTP_LOCAL_IP, TEST_HTTP_LOCAL_PORT, tnet_socket_type_tcp_ipv4);
- if (!p_transport) {
- TSK_DEBUG_ERROR("Failed to HTTP transport");
- goto bail;
- }
-
- ret = test_http_transport_start(p_transport);
- if (ret) {
- TSK_DEBUG_ERROR("Failed to start HTTP transport with error code = %d", ret);
- goto bail;
- }
-
- getchar();
-
- // Send data to google.com
- peer = test_http_transport_connect_to(p_transport, TEST_HTTP_REMOTE_IP, TEST_HTTP_REMOTE_PORT);
- ret = tnet_sockfd_waitUntilWritable(peer->fd, 1000); // you should use the callback function instead of blocking the process
- if (ret) {
- TSK_DEBUG_ERROR("Failed to connect to(%s,%d) with error code = %d", TEST_HTTP_REMOTE_IP, TEST_HTTP_REMOTE_PORT, ret);
- goto bail;
- }
- ret = test_http_transport_send_data(p_transport, peer->fd, __get_msg, tsk_strlen(__get_msg));
- TSK_DEBUG_INFO("Sent %d bytes", ret);
-
- getchar();
+ test_http_transport_t* p_transport = tsk_null;
+ test_http_peer_t* peer = tsk_null;
+ int ret;
+ static const char* __get_msg = TEST_HTTP_GET;
+
+ p_transport = test_http_transport_create(TEST_HTTP_LOCAL_IP, TEST_HTTP_LOCAL_PORT, tnet_socket_type_tcp_ipv4);
+ if (!p_transport) {
+ TSK_DEBUG_ERROR("Failed to HTTP transport");
+ goto bail;
+ }
+
+ ret = test_http_transport_start(p_transport);
+ if (ret) {
+ TSK_DEBUG_ERROR("Failed to start HTTP transport with error code = %d", ret);
+ goto bail;
+ }
+
+ getchar();
+
+ // Send data to google.com
+ peer = test_http_transport_connect_to(p_transport, TEST_HTTP_REMOTE_IP, TEST_HTTP_REMOTE_PORT);
+ ret = tnet_sockfd_waitUntilWritable(peer->fd, 1000); // you should use the callback function instead of blocking the process
+ if (ret) {
+ TSK_DEBUG_ERROR("Failed to connect to(%s,%d) with error code = %d", TEST_HTTP_REMOTE_IP, TEST_HTTP_REMOTE_PORT, ret);
+ goto bail;
+ }
+ ret = test_http_transport_send_data(p_transport, peer->fd, __get_msg, tsk_strlen(__get_msg));
+ TSK_DEBUG_INFO("Sent %d bytes", ret);
+
+ getchar();
bail:
- TSK_OBJECT_SAFE_FREE(p_transport); // stop server and free memory
- TSK_OBJECT_SAFE_FREE(peer);
+ TSK_OBJECT_SAFE_FREE(p_transport); // stop server and free memory
+ TSK_OBJECT_SAFE_FREE(peer);
}
#endif /* _TEST_HTTP_TRANSPORT_H_ */
diff --git a/tinyHTTP/test/test_url.h b/tinyHTTP/test/test_url.h
index c533c78..784b0b0 100755
--- a/tinyHTTP/test/test_url.h
+++ b/tinyHTTP/test/test_url.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,70 +24,66 @@
#include "tinyhttp/parsers/thttp_parser_url.h"
-const char* urls[] =
-{
-
- //== HTTP:
- "http://www.doubango.org",
- "http://www.doubango.org/?p=1",
- "http://doubango.org:452/test",
- "http://doubango.org:45/test?p=452",
-
- //== HTTPS:
- "https://www.doubango.org",
- "https://www.doubango.org/?p=1",
- "https://doubango.org:452/test",
- "https://doubango.org:45/test?p=452",
+const char* urls[] = {
+
+ //== HTTP:
+ "http://www.doubango.org",
+ "http://www.doubango.org/?p=1",
+ "http://doubango.org:452/test",
+ "http://doubango.org:45/test?p=452",
+
+ //== HTTPS:
+ "https://www.doubango.org",
+ "https://www.doubango.org/?p=1",
+ "https://doubango.org:452/test",
+ "https://doubango.org:45/test?p=452",
};
#include "tsk_string.h"
void test_url_tostring(const thttp_url_t *url)
{
- char* ret = thttp_url_tostring(url);
- TSK_DEBUG_INFO("url_to_string=%s", ret);
- TSK_FREE(ret);
+ char* ret = thttp_url_tostring(url);
+ TSK_DEBUG_INFO("url_to_string=%s", ret);
+ TSK_FREE(ret);
}
void test_url_parser()
{
- int i;
-
- for(i=0; i<sizeof(urls)/sizeof(const char*); i++)
- {
- thttp_url_t *url = thttp_url_parse(urls[i], strlen(urls[i]));
-
- printf("\n== Parsing {{ %s }} ==\n\n", urls[i]);
-
- if(url)
- {
- printf("scheme: %s\n", url->scheme);
- printf("host: %s\n", url->host);
- printf("port: %u\n", url->port);
- printf("hpath: %s\n", url->hpath);
- printf("search: %s\n", url->search);
- printf("host-type: %s\n", url->host_type == thttp_host_ipv4 ? "IPv4" : (url->host_type == thttp_host_ipv6 ? "IPv6" : (url->host_type == thttp_host_hostname ? "HOSTNAME" : "UNKNOWN")) );
-
- printf("---PARAMS---\n");
-
- printf("Is-secure: %s\n", THTTP_URL_IS_SECURE(url) ? "YES" : "NO");
-
- test_url_tostring(url);
- }
- else
- {
- printf("INVALID HTTP URL.\n");
- }
-
- printf("\n\n");
- getchar();
-
- TSK_OBJECT_SAFE_FREE(url);
- }
+ int i;
+
+ for(i=0; i<sizeof(urls)/sizeof(const char*); i++) {
+ thttp_url_t *url = thttp_url_parse(urls[i], strlen(urls[i]));
+
+ printf("\n== Parsing {{ %s }} ==\n\n", urls[i]);
+
+ if(url) {
+ printf("scheme: %s\n", url->scheme);
+ printf("host: %s\n", url->host);
+ printf("port: %u\n", url->port);
+ printf("hpath: %s\n", url->hpath);
+ printf("search: %s\n", url->search);
+ printf("host-type: %s\n", url->host_type == thttp_host_ipv4 ? "IPv4" : (url->host_type == thttp_host_ipv6 ? "IPv6" : (url->host_type == thttp_host_hostname ? "HOSTNAME" : "UNKNOWN")) );
+
+ printf("---PARAMS---\n");
+
+ printf("Is-secure: %s\n", THTTP_URL_IS_SECURE(url) ? "YES" : "NO");
+
+ test_url_tostring(url);
+ }
+ else {
+ printf("INVALID HTTP URL.\n");
+ }
+
+ printf("\n\n");
+ getchar();
+
+ TSK_OBJECT_SAFE_FREE(url);
+ }
}
void test_url()
{
- test_url_parser();
+ test_url_parser();
}
#endif /* _TEST_HTTPURL_H */
diff --git a/tinyIPSec/src/tipsec.c b/tinyIPSec/src/tipsec.c
index 2fe9976..2abcb41 100755
--- a/tinyIPSec/src/tipsec.c
+++ b/tinyIPSec/src/tipsec.c
@@ -36,7 +36,7 @@
static const tipsec_plugin_def_t* __tipsec_plugins[TIPSEC_MAX_PLUGINS] = { tsk_null };
/**
-* Create an IPSec context to manage the SAs.
+* Create an IPSec context to manage the SAs.
* Before calling this function at least one special implementation must be registered using @ref tipsec_plugin_register_static().
* @param ipproto IPSec internet protocol.
* @param use_ipv6 Whether to use IPv6 or not (IPv4).
@@ -80,16 +80,16 @@ tipsec_error_t tipsec_ctx_create(
p_ctx->ealg = ealg;
p_ctx->alg = alg;
p_ctx->protocol = protocol;
- p_ctx->ipproto = ipproto;
+ p_ctx->ipproto = ipproto;
break;
}
}
}
- if (!pc_plugin || !p_ctx) {
- TSK_DEBUG_ERROR("Failed to find/create a plugin instance");
+ if (!pc_plugin || !p_ctx) {
+ TSK_DEBUG_ERROR("Failed to find/create a plugin instance");
return tipsec_error_notfound;
- }
+ }
// Initialize the newly created context
err = pc_plugin->init(p_ctx);
@@ -116,10 +116,10 @@ tipsec_error_t tipsec_ctx_start(tipsec_ctx_t* p_ctx)
TSK_DEBUG_ERROR("Invalid parameter");
return tipsec_error_invalid_param;
}
- if (!p_ctx->initialized || p_ctx->state != tipsec_state_full) {
- TSK_DEBUG_ERROR("Invalid state (not initialized or not in full state)");
- return tipsec_error_invalid_state;
- }
+ if (!p_ctx->initialized || p_ctx->state != tipsec_state_full) {
+ TSK_DEBUG_ERROR("Invalid state (not initialized or not in full state)");
+ return tipsec_error_invalid_state;
+ }
return p_ctx->pc_plugin->start(p_ctx);
}
@@ -138,10 +138,10 @@ tipsec_error_t tipsec_ctx_set_local(tipsec_ctx_t* p_ctx, const char* addr_local,
TSK_DEBUG_ERROR("Invalid parameter");
return tipsec_error_invalid_param;
}
- if (!p_ctx->initialized || p_ctx->state != tipsec_state_initial) {
- TSK_DEBUG_ERROR("Invalid state (not initialized or not in initial state)");
- return tipsec_error_invalid_state;
- }
+ if (!p_ctx->initialized || p_ctx->state != tipsec_state_initial) {
+ TSK_DEBUG_ERROR("Invalid state (not initialized or not in initial state)");
+ return tipsec_error_invalid_state;
+ }
return p_ctx->pc_plugin->set_local(p_ctx, addr_local, addr_remote, port_uc, port_us);
}
@@ -178,10 +178,10 @@ tipsec_error_t tipsec_ctx_set_remote(tipsec_ctx_t* p_ctx, tipsec_spi_t spi_pc, t
TSK_DEBUG_ERROR("Invalid parameter");
return tipsec_error_invalid_param;
}
- if (!p_ctx->initialized || p_ctx->state != tipsec_state_inbound) {
- TSK_DEBUG_ERROR("Invalid state (not initialized or not in initial state)");
- return tipsec_error_invalid_state;
- }
+ if (!p_ctx->initialized || p_ctx->state != tipsec_state_inbound) {
+ TSK_DEBUG_ERROR("Invalid state (not initialized or not in initial state)");
+ return tipsec_error_invalid_state;
+ }
return p_ctx->pc_plugin->set_remote(p_ctx, spi_pc, spi_ps, port_pc, port_ps, lifetime);
}
@@ -276,33 +276,33 @@ tipsec_error_t tipsec_plugin_unregister_static(const tipsec_plugin_def_t* pc_plu
*/
tipsec_error_t tipsec_plugin_register_file(const char* pc_filepath, struct tsk_plugin_s** pp_plugin)
{
- struct tsk_plugin_s* p_plugin = tsk_null;
- tsk_plugin_def_ptr_const_t p_def;
- tipsec_error_t err = tipsec_error_success;
- int i = 0, count = 0;
+ struct tsk_plugin_s* p_plugin = tsk_null;
+ tsk_plugin_def_ptr_const_t p_def;
+ tipsec_error_t err = tipsec_error_success;
+ int i = 0, count = 0;
- p_plugin = tsk_plugin_create(pc_filepath);
- if (!p_plugin) {
- return tipsec_error_notfound;
- }
-
- while ((p_def = tsk_plugin_get_def_2(p_plugin, tsk_plugin_def_type_ipsec, tsk_plugin_def_media_type_all, i++))) {
- if (p_def) {
- err = tipsec_plugin_register_static(p_def);
- if (!err) {
- ++count;
- }
- }
- }
+ p_plugin = tsk_plugin_create(pc_filepath);
+ if (!p_plugin) {
+ return tipsec_error_notfound;
+ }
- if (count <= 0) {
- TSK_DEBUG_ERROR("No plugin in %s", pc_filepath);
- TSK_OBJECT_SAFE_FREE(p_plugin);
- return tipsec_error_notfound;
- }
-
- *pp_plugin = p_plugin;
- return err;
+ while ((p_def = tsk_plugin_get_def_2(p_plugin, tsk_plugin_def_type_ipsec, tsk_plugin_def_media_type_all, i++))) {
+ if (p_def) {
+ err = tipsec_plugin_register_static(p_def);
+ if (!err) {
+ ++count;
+ }
+ }
+ }
+
+ if (count <= 0) {
+ TSK_DEBUG_ERROR("No plugin in %s", pc_filepath);
+ TSK_OBJECT_SAFE_FREE(p_plugin);
+ return tipsec_error_notfound;
+ }
+
+ *pp_plugin = p_plugin;
+ return err;
}
/**
@@ -313,16 +313,16 @@ tipsec_error_t tipsec_plugin_register_file(const char* pc_filepath, struct tsk_p
*/
tipsec_error_t tipsec_plugin_unregister_file(struct tsk_plugin_s* p_plugin)
{
- int i = 0;
- tsk_plugin_def_ptr_const_t p_def;
- if (!p_plugin) {
- TSK_DEBUG_ERROR("Invalid parameter");
+ int i = 0;
+ tsk_plugin_def_ptr_const_t p_def;
+ if (!p_plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
return tipsec_error_invalid_param;
- }
- while ((p_def = tsk_plugin_get_def_2(p_plugin, tsk_plugin_def_type_ipsec, tsk_plugin_def_media_type_all, i++))) {
- if (p_def) {
- tipsec_plugin_unregister_static(p_def);
- }
- }
- return tipsec_error_success;
+ }
+ while ((p_def = tsk_plugin_get_def_2(p_plugin, tsk_plugin_def_type_ipsec, tsk_plugin_def_media_type_all, i++))) {
+ if (p_def) {
+ tipsec_plugin_unregister_static(p_def);
+ }
+ }
+ return tipsec_error_success;
}
diff --git a/tinyIPSec/src/tipsec.h b/tinyIPSec/src/tipsec.h
index 5c4c5e5..d104e73 100755
--- a/tinyIPSec/src/tipsec.h
+++ b/tinyIPSec/src/tipsec.h
@@ -165,8 +165,8 @@ typedef enum tipsec_ipproto_e {
tipsec_ipproto_tcp,
//! ICMP.
tipsec_ipproto_icmp,
- //! ALL IP protocols
- tipsec_ipproto_all
+ //! ALL IP protocols
+ tipsec_ipproto_all
}
tipsec_ipproto_t;
@@ -211,14 +211,14 @@ tipsec_state_t;
typedef enum tipsec_error_e {
tipsec_error_success = 0, /**< Success */
tipsec_error_invalid_param, /**< Invalid parameter */
- tipsec_error_invalid_state, /**< Invalid state */
+ tipsec_error_invalid_state, /**< Invalid state */
tipsec_error_access_violation, /**< Access violation */
tipsec_error_permission_denied, /**< Permission denied */
tipsec_error_outofmemory, /**< Out of memory */
tipsec_error_outofbound, /**< Out of bound */
tipsec_error_notfound, /**< Not found */
tipsec_error_notimplemented, /**< Not implemented */
- tipsec_error_sys, /**< System error */
+ tipsec_error_sys, /**< System error */
}
tipsec_error_t;
diff --git a/tinyIPSec/test/test.c b/tinyIPSec/test/test.c
index d5b710a..1d6f4d0 100755
--- a/tinyIPSec/test/test.c
+++ b/tinyIPSec/test/test.c
@@ -46,32 +46,32 @@ static const char* __key_ck = "1234567890121234";
static tsk_bool_t test_ipsec_is_winvista_or_later()
{
- /*
- Version Number Description
- 6.1 Windows 7 / Windows 2008 R2
- 6.0 Windows Vista / Windows 2008
- 5.2 Windows 2003
- 5.1 Windows XP
- 5.0 Windows 2000
- */
- static DWORD dwMajorVersion = -1;
- static DWORD dwMinorVersion = -1;
-
- if(dwMajorVersion == -1 || dwMinorVersion == -1){
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- dwMajorVersion = osvi.dwMajorVersion;
- dwMinorVersion = osvi.dwMinorVersion;
- }
-
- return (dwMajorVersion >= 6);
+ /*
+ Version Number Description
+ 6.1 Windows 7 / Windows 2008 R2
+ 6.0 Windows Vista / Windows 2008
+ 5.2 Windows 2003
+ 5.1 Windows XP
+ 5.0 Windows 2000
+ */
+ static DWORD dwMajorVersion = -1;
+ static DWORD dwMinorVersion = -1;
+
+ if(dwMajorVersion == -1 || dwMinorVersion == -1) {
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ dwMajorVersion = osvi.dwMajorVersion;
+ dwMinorVersion = osvi.dwMinorVersion;
+ }
+
+ return (dwMajorVersion >= 6);
}
#else
-static tsk_bool_t test_ipsec_is_winvista_or_later()
+static tsk_bool_t test_ipsec_is_winvista_or_later()
{
- return 0;
+ return 0;
}
#endif
@@ -81,115 +81,116 @@ int _tmain()
int main(int argc, const char* argv[])
#endif
{
- int err = 0;
- tsk_size_t i;
- struct tsk_plugin_s* p_plugin = tsk_null;
- tipsec_ctx_t* p_ctx = tsk_null;
- static const char* __plugins_path[] = /* Visual Studio requires "Debugging" -> "Working Directory" = "$(OutDir)" */
- {
- "pluginWinIPSecVista.DLL",
- "pluginWinIPSecXP.DLL",
- "pluginLinIPsecTools.so"
- };
- static const tsk_size_t __plugins_count = sizeof(__plugins_path)/sizeof(__plugins_path[0]);
-
- #define BUF_SIZE 1024
- char buffer[BUF_SIZE];
-
- /* Set debug level to INFO */
- tsk_debug_set_level(DEBUG_LEVEL_INFO);
-
- // Command line "local_ip" "local_port_in" "local_port_out" "remote_ip" "remote_port_in" "remote_port_out"
- if (argc == (6 + 1)) {
- __addr_local = argv[1];
- __port_local_in = atoi(argv[2]);
- __port_local_out = atoi(argv[3]);
- __addr_remote = argv[4];
- __port_remote_in = atoi(argv[5]);
- __port_remote_out = atoi(argv[6]);
- }
-
- TSK_DEBUG_INFO("Local node=%s:%d/%d, remote node=%s:%d/%d",
- __addr_local, __port_local_in, __port_local_out,
- __addr_remote, __port_remote_in, __port_remote_out);
-
- /* Create the plugin */
- for (i = 0; i < __plugins_count; ++i) {
- if (tsk_plugin_file_exist(__plugins_path[i])) {
- tipsec_plugin_register_file(__plugins_path[i], &p_plugin);
- if (p_plugin) {
- break;
- }
- }
- }
- if (!p_plugin) {
- TSK_DEBUG_ERROR("Failed to create IPSec plugin");
- err = -1; goto bail;
- }
-
- /* Create the context */
- err = tipsec_ctx_create(__ipproto, __use_ipv6, __mode, __ealg, __alg, __proto, &p_ctx);
- if (err) {
- goto bail;
- }
-
- /* Set local */
- err = tipsec_ctx_set_local(p_ctx, __addr_local, __addr_remote, __port_local_out, __port_local_in);
- if (err) {
- goto bail;
- }
- // Dump SPIs created by the OS after calling set_local()
- TSK_DEBUG_INFO("SPI-UC=%u, SPI-US=%u", p_ctx->spi_uc, p_ctx->spi_us);
-
- // Enter Remote SPI in
- TSK_DEBUG_INFO("Enter remote SPI in:");
- if (fgets(buffer, BUF_SIZE, stdin)) {
- if (buffer[0] != 10 && buffer[1] != 0) {
- __spi_remote_in = strtoul (buffer, NULL, 0);
- }
- }
-
- // Enter Remote SPI out
- TSK_DEBUG_INFO("Enter remote SPI out:");
- if (fgets(buffer, BUF_SIZE, stdin)) {
- if (buffer[0] != 10 && buffer[1] != 0) {
- __spi_remote_out = strtoul (buffer, NULL, 0);
- }
- }
-
- TSK_DEBUG_INFO("SPI remote %u/%u", __spi_remote_in, __spi_remote_out);
-
- /* Set remote */
- err = tipsec_ctx_set_remote(p_ctx, __spi_remote_out, __spi_remote_in, __port_remote_out, __port_remote_in, __lifetime);
- if (err) {
- goto bail;
- }
-
- /* Set Integrity (IK) and Confidentiality (CK) keys */
- err = tipsec_ctx_set_keys(p_ctx, __key_ik, __key_ck);
- if (err) {
- goto bail;
- }
-
- /* Start (Setup) the SAs */
- err = tipsec_ctx_start(p_ctx);
- if (err) {
- goto bail;
- }
-
- TSK_DEBUG_INFO("!!! IPSec SAs started (Press any key to stop) !!!");
-
- /* Wait */
- getchar();
+ int err = 0;
+ tsk_size_t i;
+ struct tsk_plugin_s* p_plugin = tsk_null;
+ tipsec_ctx_t* p_ctx = tsk_null;
+ static const char* __plugins_path[] = /* Visual Studio requires "Debugging" -> "Working Directory" = "$(OutDir)" */
+ {
+ "pluginWinIPSecVista.DLL",
+ "pluginWinIPSecXP.DLL",
+ "pluginLinIPsecTools.so"
+ };
+ static const tsk_size_t __plugins_count = sizeof(__plugins_path)/sizeof(__plugins_path[0]);
+
+#define BUF_SIZE 1024
+ char buffer[BUF_SIZE];
+
+ /* Set debug level to INFO */
+ tsk_debug_set_level(DEBUG_LEVEL_INFO);
+
+ // Command line "local_ip" "local_port_in" "local_port_out" "remote_ip" "remote_port_in" "remote_port_out"
+ if (argc == (6 + 1)) {
+ __addr_local = argv[1];
+ __port_local_in = atoi(argv[2]);
+ __port_local_out = atoi(argv[3]);
+ __addr_remote = argv[4];
+ __port_remote_in = atoi(argv[5]);
+ __port_remote_out = atoi(argv[6]);
+ }
+
+ TSK_DEBUG_INFO("Local node=%s:%d/%d, remote node=%s:%d/%d",
+ __addr_local, __port_local_in, __port_local_out,
+ __addr_remote, __port_remote_in, __port_remote_out);
+
+ /* Create the plugin */
+ for (i = 0; i < __plugins_count; ++i) {
+ if (tsk_plugin_file_exist(__plugins_path[i])) {
+ tipsec_plugin_register_file(__plugins_path[i], &p_plugin);
+ if (p_plugin) {
+ break;
+ }
+ }
+ }
+ if (!p_plugin) {
+ TSK_DEBUG_ERROR("Failed to create IPSec plugin");
+ err = -1;
+ goto bail;
+ }
+
+ /* Create the context */
+ err = tipsec_ctx_create(__ipproto, __use_ipv6, __mode, __ealg, __alg, __proto, &p_ctx);
+ if (err) {
+ goto bail;
+ }
+
+ /* Set local */
+ err = tipsec_ctx_set_local(p_ctx, __addr_local, __addr_remote, __port_local_out, __port_local_in);
+ if (err) {
+ goto bail;
+ }
+ // Dump SPIs created by the OS after calling set_local()
+ TSK_DEBUG_INFO("SPI-UC=%u, SPI-US=%u", p_ctx->spi_uc, p_ctx->spi_us);
+
+ // Enter Remote SPI in
+ TSK_DEBUG_INFO("Enter remote SPI in:");
+ if (fgets(buffer, BUF_SIZE, stdin)) {
+ if (buffer[0] != 10 && buffer[1] != 0) {
+ __spi_remote_in = strtoul (buffer, NULL, 0);
+ }
+ }
+
+ // Enter Remote SPI out
+ TSK_DEBUG_INFO("Enter remote SPI out:");
+ if (fgets(buffer, BUF_SIZE, stdin)) {
+ if (buffer[0] != 10 && buffer[1] != 0) {
+ __spi_remote_out = strtoul (buffer, NULL, 0);
+ }
+ }
+
+ TSK_DEBUG_INFO("SPI remote %u/%u", __spi_remote_in, __spi_remote_out);
+
+ /* Set remote */
+ err = tipsec_ctx_set_remote(p_ctx, __spi_remote_out, __spi_remote_in, __port_remote_out, __port_remote_in, __lifetime);
+ if (err) {
+ goto bail;
+ }
+
+ /* Set Integrity (IK) and Confidentiality (CK) keys */
+ err = tipsec_ctx_set_keys(p_ctx, __key_ik, __key_ck);
+ if (err) {
+ goto bail;
+ }
+
+ /* Start (Setup) the SAs */
+ err = tipsec_ctx_start(p_ctx);
+ if (err) {
+ goto bail;
+ }
+
+ TSK_DEBUG_INFO("!!! IPSec SAs started (Press any key to stop) !!!");
+
+ /* Wait */
+ getchar();
bail:
- // Stop the SAs, cleanup and destroy the context
- TSK_OBJECT_SAFE_FREE(p_ctx); // must destroy the contect before unloading the plugin (*.DLL or *.SO)
-
- // Unregister the plugin and close the file handle
- if (p_plugin) {
- tipsec_plugin_unregister_file(p_plugin);
- TSK_OBJECT_SAFE_FREE(p_plugin);
- }
- return err;
+ // Stop the SAs, cleanup and destroy the context
+ TSK_OBJECT_SAFE_FREE(p_ctx); // must destroy the contect before unloading the plugin (*.DLL or *.SO)
+
+ // Unregister the plugin and close the file handle
+ if (p_plugin) {
+ tipsec_plugin_unregister_file(p_plugin);
+ TSK_OBJECT_SAFE_FREE(p_plugin);
+ }
+ return err;
}
diff --git a/tinyMEDIA/include/tinymedia.h b/tinyMEDIA/include/tinymedia.h
index bdee2d8..f781014 100755
--- a/tinyMEDIA/include/tinymedia.h
+++ b/tinyMEDIA/include/tinymedia.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMEDIA/include/tinymedia/content/tmedia_content.h b/tinyMEDIA/include/tinymedia/content/tmedia_content.h
index 41b1ecb..d0d6f5c 100755
--- a/tinyMEDIA/include/tinymedia/content/tmedia_content.h
+++ b/tinyMEDIA/include/tinymedia/content/tmedia_content.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,27 +44,25 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_CONTENT(self) ((tmedia_content_t*)(self))
/** Base object for all contents */
-typedef struct tmedia_content_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmedia_content_s {
+ TSK_DECLARE_OBJECT;
- const char* type;
- //! plugin used to create the codec
- const struct tmedia_content_plugin_def_s* plugin;
+ const char* type;
+ //! plugin used to create the codec
+ const struct tmedia_content_plugin_def_s* plugin;
}
tmedia_content_t;
/** Virtual table used to define a content plugin */
-typedef struct tmedia_content_plugin_def_s
-{
- //! object definition used to create an instance of the codec
- const tsk_object_def_t* objdef;
+typedef struct tmedia_content_plugin_def_s {
+ //! object definition used to create an instance of the codec
+ const tsk_object_def_t* objdef;
- //! e.g. 'message/CPIM'
- const char* type;
+ //! e.g. 'message/CPIM'
+ const char* type;
- int (*parse) (tmedia_content_t*, const void* in_data, tsk_size_t in_size);
- tsk_buffer_t* (*get_data) (tmedia_content_t*);
+ int (*parse) (tmedia_content_t*, const void* in_data, tsk_size_t in_size);
+ tsk_buffer_t* (*get_data) (tmedia_content_t*);
}
tmedia_content_plugin_def_t;
@@ -86,11 +84,10 @@ TINYMEDIA_API int tmedia_content_deinit(tmedia_content_t* self);
TINYMEDIA_API tsk_buffer_t* tmedia_content_get_data(tmedia_content_t* self);
/** dummy content */
-typedef struct tmedia_content_dummy_s
-{
- TMEDIA_DECLARE_CONTENT;
-
- tsk_buffer_t* data;
+typedef struct tmedia_content_dummy_s {
+ TMEDIA_DECLARE_CONTENT;
+
+ tsk_buffer_t* data;
}
tmedia_content_dummy_t;
@@ -101,13 +98,12 @@ TINYMEDIA_GEXTERN const tmedia_content_plugin_def_t *tmedia_content_dummy_plugin
/** content header */
-typedef struct tmedia_content_header_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmedia_content_header_s {
+ TSK_DECLARE_OBJECT;
- char* name;
- char* value;
- tsk_params_L_t* params;
+ char* name;
+ char* value;
+ tsk_params_L_t* params;
}
tmedia_content_header_t;
diff --git a/tinyMEDIA/include/tinymedia/content/tmedia_content_cpim.h b/tinyMEDIA/include/tinymedia/content/tmedia_content_cpim.h
index db1aa02..625ffc3 100755
--- a/tinyMEDIA/include/tinymedia/content/tmedia_content_cpim.h
+++ b/tinyMEDIA/include/tinymedia/content/tmedia_content_cpim.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,14 +38,13 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_CONTENT_CPIM_TYPE "message/CPIM"
/** message/CPIM content */
-typedef struct tmedia_content_cpim_s
-{
- TMEDIA_DECLARE_CONTENT;
-
- tmedia_content_headers_L_t* m_headers; /**< MIME headers for the overall message */
- tmedia_content_headers_L_t* h_headers; /**< message headers */
- tsk_buffer_t* e; /**< encapsulated MIME object containing the message content */
- tsk_buffer_t* x; /**< MIME security multipart message wrapper */
+typedef struct tmedia_content_cpim_s {
+ TMEDIA_DECLARE_CONTENT;
+
+ tmedia_content_headers_L_t* m_headers; /**< MIME headers for the overall message */
+ tmedia_content_headers_L_t* h_headers; /**< message headers */
+ tsk_buffer_t* e; /**< encapsulated MIME object containing the message content */
+ tsk_buffer_t* x; /**< MIME security multipart message wrapper */
}
tmedia_content_cpim_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia.h b/tinyMEDIA/include/tinymedia/tmedia.h
index d10ee69..66afc80 100755
--- a/tinyMEDIA/include/tinymedia/tmedia.h
+++ b/tinyMEDIA/include/tinymedia/tmedia.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,51 +47,48 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA(self) ((tmedia_t*)(self))
-typedef enum tmedia_action_e
-{
- // Dummy
- tma_dummy_say_hello,
+typedef enum tmedia_action_e {
+ // Dummy
+ tma_dummy_say_hello,
- // MSRP
- tma_msrp_send_data,
- tma_msrp_send_file,
+ // MSRP
+ tma_msrp_send_data,
+ tma_msrp_send_file,
- // Audio / Video
+ // Audio / Video
- // T.38
+ // T.38
}
tmedia_action_t;
-typedef struct tmedia_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmedia_s {
+ TSK_DECLARE_OBJECT;
+
+ const struct tmedia_plugin_def_s* plugin;
- const struct tmedia_plugin_def_s* plugin;
-
- char* name;
- uint32_t port;
- char* protocol;
+ char* name;
+ uint32_t port;
+ char* protocol;
}
tmedia_t;
typedef tsk_list_t tmedias_L_t;
#define TMED_DECLARE_MEDIA tmedia_t media
-typedef struct tmedia_plugin_def_s
-{
- const tsk_object_def_t* objdef;
- const char* name;
- const char* media;
-
- int (* start) (tmedia_t* );
- int (* pause) (tmedia_t* );
- int (* stop) (tmedia_t* );
-
- const tsdp_header_M_t* (* get_local_offer) (tmedia_t* , va_list* );
- const tsdp_header_M_t* (* get_negotiated_offer) (tmedia_t* );
- int (* set_remote_offer) (tmedia_t* , const tsdp_message_t* );
-
- int (* perform) (tmedia_t* , tmedia_action_t action, const tsk_params_L_t* );
+typedef struct tmedia_plugin_def_s {
+ const tsk_object_def_t* objdef;
+ const char* name;
+ const char* media;
+
+ int (* start) (tmedia_t* );
+ int (* pause) (tmedia_t* );
+ int (* stop) (tmedia_t* );
+
+ const tsdp_header_M_t* (* get_local_offer) (tmedia_t* , va_list* );
+ const tsdp_header_M_t* (* get_negotiated_offer) (tmedia_t* );
+ int (* set_remote_offer) (tmedia_t* , const tsdp_message_t* );
+
+ int (* perform) (tmedia_t* , tmedia_action_t action, const tsk_params_L_t* );
}
tmedia_plugin_def_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_codec.h b/tinyMEDIA/include/tinymedia/tmedia_codec.h
index f29abf6..6dcd2be 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_codec.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_codec.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,7 +35,7 @@
TMEDIA_BEGIN_DECLS
/* =====
-* http://www.iana.org/assignments/rtp-parameters
+* http://www.iana.org/assignments/rtp-parameters
* http://www.networksorcery.com/enp/protocol/rtp.htm
=====*/
/******* Fixed Payload Type *************/
@@ -68,7 +68,7 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_CODEC_FORMAT_MP2T "33"
#define TMEDIA_CODEC_FORMAT_H263 "34"
-/******* Dynamic Payload Type
+/******* Dynamic Payload Type
Must starts at 96 to be conform to RFC 5761 (rtcp-mux)
**********/
@@ -115,51 +115,50 @@ Must starts at 96 to be conform to RFC 5761 (rtcp-mux)
// @tinyWRAP
-typedef enum tmedia_codec_id_e
-{
- tmedia_codec_id_none = 0x00000000,
-
- tmedia_codec_id_amr_nb_oa = 0x00000001<<0,
- tmedia_codec_id_amr_nb_be = 0x00000001<<1,
- tmedia_codec_id_amr_wb_oa = 0x00000001<<2,
- tmedia_codec_id_amr_wb_be = 0x00000001<<3,
- tmedia_codec_id_gsm = 0x00000001<<4,
- tmedia_codec_id_pcma = 0x00000001<<5,
- tmedia_codec_id_pcmu = 0x00000001<<6,
- tmedia_codec_id_ilbc = 0x00000001<<7,
- tmedia_codec_id_speex_nb = 0x00000001<<8,
- tmedia_codec_id_speex_wb = 0x00000001<<9,
- tmedia_codec_id_speex_uwb = 0x00000001<<10,
- tmedia_codec_id_bv16 = 0x00000001<<11,
- tmedia_codec_id_bv32 = 0x00000001<<12,
- tmedia_codec_id_opus = 0x00000001<<13,
- tmedia_codec_id_g729ab = 0x00000001<<14,
- tmedia_codec_id_g722 = 0x00000001<<15,
-
- /* room for new Audio codecs */
-
- tmedia_codec_id_h261 = 0x00010000<<0,
- tmedia_codec_id_h263 = 0x00010000<<1,
- tmedia_codec_id_h263p = 0x00010000<<2,
- tmedia_codec_id_h263pp = 0x00010000<<3,
- tmedia_codec_id_h264_bp = 0x00010000<<4,
- tmedia_codec_id_h264_mp = 0x00010000<<5,
- tmedia_codec_id_h264_hp = 0x00010000<<6,
- tmedia_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
- tmedia_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
- tmedia_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
- tmedia_codec_id_h264_svc = 0x00010000<<7,
- tmedia_codec_id_theora = 0x00010000<<8,
- tmedia_codec_id_mp4ves_es = 0x00010000<<9,
- tmedia_codec_id_vp8 = 0x00010000<<10,
-
- /* room for new Video codecs */
-
- tmedia_codec_id_t140 = 0x00010000<<14,
- tmedia_codec_id_red = 0x00010000<<15,
-
-
- tmedia_codec_id_all = 0xffffffff,
+typedef enum tmedia_codec_id_e {
+ tmedia_codec_id_none = 0x00000000,
+
+ tmedia_codec_id_amr_nb_oa = 0x00000001<<0,
+ tmedia_codec_id_amr_nb_be = 0x00000001<<1,
+ tmedia_codec_id_amr_wb_oa = 0x00000001<<2,
+ tmedia_codec_id_amr_wb_be = 0x00000001<<3,
+ tmedia_codec_id_gsm = 0x00000001<<4,
+ tmedia_codec_id_pcma = 0x00000001<<5,
+ tmedia_codec_id_pcmu = 0x00000001<<6,
+ tmedia_codec_id_ilbc = 0x00000001<<7,
+ tmedia_codec_id_speex_nb = 0x00000001<<8,
+ tmedia_codec_id_speex_wb = 0x00000001<<9,
+ tmedia_codec_id_speex_uwb = 0x00000001<<10,
+ tmedia_codec_id_bv16 = 0x00000001<<11,
+ tmedia_codec_id_bv32 = 0x00000001<<12,
+ tmedia_codec_id_opus = 0x00000001<<13,
+ tmedia_codec_id_g729ab = 0x00000001<<14,
+ tmedia_codec_id_g722 = 0x00000001<<15,
+
+ /* room for new Audio codecs */
+
+ tmedia_codec_id_h261 = 0x00010000<<0,
+ tmedia_codec_id_h263 = 0x00010000<<1,
+ tmedia_codec_id_h263p = 0x00010000<<2,
+ tmedia_codec_id_h263pp = 0x00010000<<3,
+ tmedia_codec_id_h264_bp = 0x00010000<<4,
+ tmedia_codec_id_h264_mp = 0x00010000<<5,
+ tmedia_codec_id_h264_hp = 0x00010000<<6,
+ tmedia_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
+ tmedia_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
+ tmedia_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
+ tmedia_codec_id_h264_svc = 0x00010000<<7,
+ tmedia_codec_id_theora = 0x00010000<<8,
+ tmedia_codec_id_mp4ves_es = 0x00010000<<9,
+ tmedia_codec_id_vp8 = 0x00010000<<10,
+
+ /* room for new Video codecs */
+
+ tmedia_codec_id_t140 = 0x00010000<<14,
+ tmedia_codec_id_red = 0x00010000<<15,
+
+
+ tmedia_codec_id_all = 0xffffffff,
}
tmedia_codec_id_t;
@@ -196,108 +195,105 @@ typedef int (*tmedia_codec_video_dec_cb_f)(const tmedia_video_decode_result_xt*
struct tmedia_param_s;
struct tsdp_header_M_s;
-typedef enum tmedia_codec_action_e
-{
- tmedia_codec_action_encode_idr,
- tmedia_codec_action_bw_down,
- tmedia_codec_action_bw_up,
+typedef enum tmedia_codec_action_e {
+ tmedia_codec_action_encode_idr,
+ tmedia_codec_action_bw_down,
+ tmedia_codec_action_bw_up,
}
tmedia_codec_action_t;
/** Base object for all Codecs */
-typedef struct tmedia_codec_s
-{
- TSK_DECLARE_OBJECT;
-
- //! the type of the codec
- tmedia_type_t type;
- //! the codec identifier
- tmedia_codec_id_t id;
- //! whether the codec is opened
- tsk_bool_t opened;
- //! whether the pay. type is dyn. or not
- tsk_bool_t dyn;
- //! the name of the codec. e.g. "G.711U" or "G.711A" etc used in the sdp
- char* name;
- //! full description
- char* desc;
- //! the format. e.g. "0" for PCMU or "8" for PCMA or "*" for MSRP.
- char* format;
- //! bandwidth level
- tmedia_bandwidth_level_t bl; // @deprecated
- //! maximum bandwidth to use for outgoing RTP (INT_MAX or <=0 means undefined)
- int32_t bandwidth_max_upload;
- //! maximum bandwidth to use for incoming RTP (INT_MAX or <=0 means undefined)
- int32_t bandwidth_max_download;
- //! the negociated format (only useful for codecs with dyn. payload type)
- char* neg_format;
- //! whether this is a passthrough codec
- tsk_bool_t passthrough;
-
- struct{
- // !negotiated decoding rate (for codecs with dynamic rate, e.g. opus)
- uint32_t rate;
- } in; //decoding direction
- struct{
- // !negotiated encoding rate (for codecs with dynamic rate, e.g. opus)
- uint32_t rate;
- } out; //encoding direction
-
- //! plugin used to create the codec
- const struct tmedia_codec_plugin_def_s* plugin;
+typedef struct tmedia_codec_s {
+ TSK_DECLARE_OBJECT;
+
+ //! the type of the codec
+ tmedia_type_t type;
+ //! the codec identifier
+ tmedia_codec_id_t id;
+ //! whether the codec is opened
+ tsk_bool_t opened;
+ //! whether the pay. type is dyn. or not
+ tsk_bool_t dyn;
+ //! the name of the codec. e.g. "G.711U" or "G.711A" etc used in the sdp
+ char* name;
+ //! full description
+ char* desc;
+ //! the format. e.g. "0" for PCMU or "8" for PCMA or "*" for MSRP.
+ char* format;
+ //! bandwidth level
+ tmedia_bandwidth_level_t bl; // @deprecated
+ //! maximum bandwidth to use for outgoing RTP (INT_MAX or <=0 means undefined)
+ int32_t bandwidth_max_upload;
+ //! maximum bandwidth to use for incoming RTP (INT_MAX or <=0 means undefined)
+ int32_t bandwidth_max_download;
+ //! the negociated format (only useful for codecs with dyn. payload type)
+ char* neg_format;
+ //! whether this is a passthrough codec
+ tsk_bool_t passthrough;
+
+ struct {
+ // !negotiated decoding rate (for codecs with dynamic rate, e.g. opus)
+ uint32_t rate;
+ } in; //decoding direction
+ struct {
+ // !negotiated encoding rate (for codecs with dynamic rate, e.g. opus)
+ uint32_t rate;
+ } out; //encoding direction
+
+ //! plugin used to create the codec
+ const struct tmedia_codec_plugin_def_s* plugin;
}
tmedia_codec_t;
#define TMEDIA_CODEC(self) ((tmedia_codec_t*)(self))
/** Virtual table used to define a codec plugin */
-typedef struct tmedia_codec_plugin_def_s
-{
- //! object definition used to create an instance of the codec
- const tsk_object_def_t* objdef;
-
- //! the type of the codec
- tmedia_type_t type;
- //! the codec identifier
- tmedia_codec_id_t codec_id;
- //! the name of the codec. e.g. "G.711U" or "G.711A" etc using in the sdp.
- const char* name;
- //! full description
- const char* desc;
- //! the format. e.g. "0" for PCMU or "8" for PCMA or "*" for MSRP.
- const char* format;
- //! whether the pay. type is dyn. or not
- tsk_bool_t dyn;
- uint32_t rate;
-
- /* default values could be updated at any time */
- struct{
- int8_t channels;
- uint8_t ptime;
- /* ...to be continued */
- } audio;
-
- /* default values could be updated at any time */
- struct{
- unsigned width;
- unsigned height;
- unsigned fps;
- /* ...to be continued */
- } video;
-
- //! set parameters
- int (*set) (tmedia_codec_t* , const struct tmedia_param_s*);
- //! open the codec
- int (*open) (tmedia_codec_t*);
- //! close the codec
- int (*close) (tmedia_codec_t*);
- //! encode data
- tsk_size_t (*encode) (tmedia_codec_t*, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size);
- //! decode data
- tsk_size_t (*decode) (tmedia_codec_t*, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr);
- //! whether the codec can handle this sdp attribute
- tsk_bool_t (* sdp_att_match) (const tmedia_codec_t*, const char* att_name, const char* att_value);
- //! gets sdp attribute value. e.g. "mode-set=0,2,5,7; mode-change-period=2; mode-change-neighbor=1"
- char* (* sdp_att_get) (const tmedia_codec_t*, const char* att_name);
+typedef struct tmedia_codec_plugin_def_s {
+ //! object definition used to create an instance of the codec
+ const tsk_object_def_t* objdef;
+
+ //! the type of the codec
+ tmedia_type_t type;
+ //! the codec identifier
+ tmedia_codec_id_t codec_id;
+ //! the name of the codec. e.g. "G.711U" or "G.711A" etc using in the sdp.
+ const char* name;
+ //! full description
+ const char* desc;
+ //! the format. e.g. "0" for PCMU or "8" for PCMA or "*" for MSRP.
+ const char* format;
+ //! whether the pay. type is dyn. or not
+ tsk_bool_t dyn;
+ uint32_t rate;
+
+ /* default values could be updated at any time */
+ struct {
+ int8_t channels;
+ uint8_t ptime;
+ /* ...to be continued */
+ } audio;
+
+ /* default values could be updated at any time */
+ struct {
+ unsigned width;
+ unsigned height;
+ unsigned fps;
+ /* ...to be continued */
+ } video;
+
+ //! set parameters
+ int (*set) (tmedia_codec_t* , const struct tmedia_param_s*);
+ //! open the codec
+ int (*open) (tmedia_codec_t*);
+ //! close the codec
+ int (*close) (tmedia_codec_t*);
+ //! encode data
+ tsk_size_t (*encode) (tmedia_codec_t*, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size);
+ //! decode data
+ tsk_size_t (*decode) (tmedia_codec_t*, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr);
+ //! whether the codec can handle this sdp attribute
+ tsk_bool_t (* sdp_att_match) (const tmedia_codec_t*, const char* att_name, const char* att_value);
+ //! gets sdp attribute value. e.g. "mode-set=0,2,5,7; mode-change-period=2; mode-change-neighbor=1"
+ char* (* sdp_att_get) (const tmedia_codec_t*, const char* att_name);
}
tmedia_codec_plugin_def_t;
@@ -331,26 +327,25 @@ TINYMEDIA_API int tmedia_codec_parse_fmtp(const char* fmtp, unsigned* maxbr, uns
TINYMEDIA_API int tmedia_codec_deinit(tmedia_codec_t* self);
/** Audio codec */
-typedef struct tmedia_codec_audio_s
-{
- TMEDIA_DECLARE_CODEC;
-
- struct{
- // !negotiated decoding ptime
- uint8_t ptime;
- // !negotiated decoding channels
- int8_t channels;
- // ! timestamp multiplier
- float timestamp_multiplier;
- } in; //decoding direction
- struct{
- // !negotiated decoding ptime
- uint8_t ptime;
- // !negotiated encoding channels
- int8_t channels;
- // ! timestamp multiplier
- float timestamp_multiplier;
- } out; //encoding direction
+typedef struct tmedia_codec_audio_s {
+ TMEDIA_DECLARE_CODEC;
+
+ struct {
+ // !negotiated decoding ptime
+ uint8_t ptime;
+ // !negotiated decoding channels
+ int8_t channels;
+ // ! timestamp multiplier
+ float timestamp_multiplier;
+ } in; //decoding direction
+ struct {
+ // !negotiated decoding ptime
+ uint8_t ptime;
+ // !negotiated encoding channels
+ int8_t channels;
+ // ! timestamp multiplier
+ float timestamp_multiplier;
+ } out; //encoding direction
}
tmedia_codec_audio_t;
@@ -373,37 +368,36 @@ tmedia_codec_audio_t;
TINYMEDIA_API float tmedia_codec_audio_get_timestamp_multiplier(tmedia_codec_id_t id, uint32_t sample_rate);
/** Video codec */
-typedef struct tmedia_codec_video_s
-{
- TMEDIA_DECLARE_CODEC;
-
- struct{
- unsigned width;
- unsigned height;
- unsigned fps;
- unsigned max_br;
- unsigned max_mbps;
- tmedia_chroma_t chroma;
- tsk_bool_t flip;
-
- tmedia_codec_video_dec_cb_f callback;
- tmedia_video_decode_result_xt result;
- }in;// decoded
- struct{
- unsigned width;
- unsigned height;
- unsigned fps;
- unsigned max_br;
- unsigned max_mbps;
- tmedia_chroma_t chroma;
- tsk_bool_t flip;
-
- tmedia_codec_video_enc_cb_f callback;
- tmedia_video_encode_result_xt result;
- }out;// encoded
-
- //! preferred video size
- tmedia_pref_video_size_t pref_size;
+typedef struct tmedia_codec_video_s {
+ TMEDIA_DECLARE_CODEC;
+
+ struct {
+ unsigned width;
+ unsigned height;
+ unsigned fps;
+ unsigned max_br;
+ unsigned max_mbps;
+ tmedia_chroma_t chroma;
+ tsk_bool_t flip;
+
+ tmedia_codec_video_dec_cb_f callback;
+ tmedia_video_decode_result_xt result;
+ } in; // decoded
+ struct {
+ unsigned width;
+ unsigned height;
+ unsigned fps;
+ unsigned max_br;
+ unsigned max_mbps;
+ tmedia_chroma_t chroma;
+ tsk_bool_t flip;
+
+ tmedia_codec_video_enc_cb_f callback;
+ tmedia_video_encode_result_xt result;
+ } out; // encoded
+
+ //! preferred video size
+ tmedia_pref_video_size_t pref_size;
}
tmedia_codec_video_t;
@@ -424,13 +418,13 @@ tmedia_codec_video_t;
#define tmedia_codec_video_init(self, name, desc, format) tmedia_codec_init(TMEDIA_CODEC(self), tmedia_video, name, desc, format)
TINYMEDIA_API int tmedia_codec_video_set_enc_callback(tmedia_codec_video_t *self, tmedia_codec_video_enc_cb_f callback, const void* callback_data);
TINYMEDIA_API int tmedia_codec_video_set_dec_callback(tmedia_codec_video_t *self, tmedia_codec_video_dec_cb_f callback, const void* callback_data);
+TINYMEDIA_API int tmedia_codec_video_clamp_out_size_to_range_max(tmedia_codec_video_t *self);
#define tmedia_codec_video_deinit(self) tmedia_codec_deinit(TMEDIA_CODEC(self))
/** MSRP codec */
-typedef struct tmedia_codec_msrp_s
-{
- TMEDIA_DECLARE_CODEC;
+typedef struct tmedia_codec_msrp_s {
+ TMEDIA_DECLARE_CODEC;
}
tmedia_codec_msrp_t;
@@ -453,9 +447,8 @@ tmedia_codec_msrp_t;
/** BFCP codec */
-typedef struct tmedia_codec_bfcp_s
-{
- TMEDIA_DECLARE_CODEC;
+typedef struct tmedia_codec_bfcp_s {
+ TMEDIA_DECLARE_CODEC;
}
tmedia_codec_bfcp_t;
#define TMEDIA_DECLARE_CODEC_BFCP tmedia_codec_bfcp_t __bfcp__
diff --git a/tinyMEDIA/include/tinymedia/tmedia_codec_dummy.h b/tinyMEDIA/include/tinymedia/tmedia_codec_dummy.h
index 9957eba..f3d592e 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_codec_dummy.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_codec_dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,30 +39,26 @@
TMEDIA_BEGIN_DECLS
/** Dummy PCMU codec */
-typedef struct tmedia_codec_dpcmu_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tmedia_codec_dpcmu_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tmedia_codec_dpcmu_t;
/** Dummy PCMA codec */
-typedef struct tmedia_codec_dpcma_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tmedia_codec_dpcma_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tmedia_codec_dpcma_t;
/** Dummy H.263 codec */
-typedef struct tmedia_codec_dh263_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tmedia_codec_dh263_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
}
tmedia_codec_dh263_t;
/** Dummy H.264 codec */
-typedef struct tmedia_codec_dh264_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tmedia_codec_dh264_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
}
tmedia_codec_dh264_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_common.h b/tinyMEDIA/include/tinymedia/tmedia_common.h
index 411007b..e786146 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_common.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,150 +42,140 @@ struct tsdp_header_M_s;
/** List of all supported media types */
// @tinyWRAP
-typedef enum tmedia_type_e
-{
- tmedia_none = 0x00,
- tmedia_ghost = (0x01 << 0),
-
- tmedia_audio = (0x01 << 1),
- tmedia_video = (0x01 << 2),
- tmedia_chat = (0x01 << 3),
- tmedia_file = (0x01 << 4),
- tmedia_t38 = (0x01 << 5),
- tmedia_t140 = (0x01 << 6),
- tmedia_bfcp = (0x01 << 7),
- tmedia_bfcp_audio = (0x01 << 8)/*must*/ | tmedia_bfcp, /* do not add "| audio". Otherwise it will be impossible to start an "video+bfcp-audio" session. */
- tmedia_bfcp_video = (0x01 << 9)/*must*/ | tmedia_bfcp, /* do not add "| video". Otherwise it will be impossible to start an "audio+bfcp-video" session. */
+typedef enum tmedia_type_e {
+ tmedia_none = 0x00,
+ tmedia_ghost = (0x01 << 0),
- tmedia_msrp = (tmedia_chat | tmedia_file),
- tmedia_audiovideo = (tmedia_audio | tmedia_video),
+ tmedia_audio = (0x01 << 1),
+ tmedia_video = (0x01 << 2),
+ tmedia_chat = (0x01 << 3),
+ tmedia_file = (0x01 << 4),
+ tmedia_t38 = (0x01 << 5),
+ tmedia_t140 = (0x01 << 6),
+ tmedia_bfcp = (0x01 << 7),
+ tmedia_bfcp_audio = (0x01 << 8)/*must*/ | tmedia_bfcp, /* do not add "| audio". Otherwise it will be impossible to start an "video+bfcp-audio" session. */
+ tmedia_bfcp_video = (0x01 << 9)/*must*/ | tmedia_bfcp, /* do not add "| video". Otherwise it will be impossible to start an "audio+bfcp-video" session. */
- tmedia_all = 0xff
+ tmedia_msrp = (tmedia_chat | tmedia_file),
+ tmedia_audiovideo = (tmedia_audio | tmedia_video),
+
+ tmedia_all = 0xff
}
tmedia_type_t;
// @tinyWRAP
-typedef enum tmedia_mode_e
-{
- tmedia_mode_none,
- tmedia_mode_optional,
- tmedia_mode_mandatory
+typedef enum tmedia_mode_e {
+ tmedia_mode_none,
+ tmedia_mode_optional,
+ tmedia_mode_mandatory
}
tmedia_mode_t;
// @tinyWRAP
-typedef enum tmedia_srtp_mode_e
-{
- tmedia_srtp_mode_none,
- tmedia_srtp_mode_optional,
- tmedia_srtp_mode_mandatory
+typedef enum tmedia_srtp_mode_e {
+ tmedia_srtp_mode_none,
+ tmedia_srtp_mode_optional,
+ tmedia_srtp_mode_mandatory
}
tmedia_srtp_mode_t;
// @tinyWRAP
-typedef enum tmedia_srtp_type_e
-{
- tmedia_srtp_type_none = 0x00,
- tmedia_srtp_type_sdes = 0x01,
- tmedia_srtp_type_dtls = 0x02,
- tmedia_srtp_type_sdes_dtls = (tmedia_srtp_type_sdes | tmedia_srtp_type_dtls)
+typedef enum tmedia_srtp_type_e {
+ tmedia_srtp_type_none = 0x00,
+ tmedia_srtp_type_sdes = 0x01,
+ tmedia_srtp_type_dtls = 0x02,
+ tmedia_srtp_type_sdes_dtls = (tmedia_srtp_type_sdes | tmedia_srtp_type_dtls)
}
tmedia_srtp_type_t;
// @tinyWRAP
-typedef enum tmedia_t140_data_type_e
-{
- tmedia_t140_data_type_utf8,
- tmedia_t140_data_type_zero_width_no_break_space = 0xefbbbf,
- tmedia_t140_data_type_backspace = 0x08,
- tmedia_t140_data_type_esc = 0x1b,
- tmedia_t140_data_type_cr = 0x0d,
- tmedia_t140_data_type_lf = 0x0a,
- tmedia_t140_data_type_cr_lf = 0x0d0a,
- tmedia_t140_data_type_bell = 0x07,
- tmedia_t140_data_type_sos = 0x98,
- tmedia_t140_data_type_string_term = 0x9c,
- tmedia_t140_data_type_graphic_start = 0x9b,
- tmedia_t140_data_type_graphic_end = 0x6d,
- tmedia_t140_data_type_loss_char_char = 0xfffd,
- tmedia_t140_data_type_loss_utf8 = 0xefbfbd,
+typedef enum tmedia_t140_data_type_e {
+ tmedia_t140_data_type_utf8,
+ tmedia_t140_data_type_zero_width_no_break_space = 0xefbbbf,
+ tmedia_t140_data_type_backspace = 0x08,
+ tmedia_t140_data_type_esc = 0x1b,
+ tmedia_t140_data_type_cr = 0x0d,
+ tmedia_t140_data_type_lf = 0x0a,
+ tmedia_t140_data_type_cr_lf = 0x0d0a,
+ tmedia_t140_data_type_bell = 0x07,
+ tmedia_t140_data_type_sos = 0x98,
+ tmedia_t140_data_type_string_term = 0x9c,
+ tmedia_t140_data_type_graphic_start = 0x9b,
+ tmedia_t140_data_type_graphic_end = 0x6d,
+ tmedia_t140_data_type_loss_char_char = 0xfffd,
+ tmedia_t140_data_type_loss_utf8 = 0xefbfbd,
}
tmedia_t140_data_type_t;
// @tinyWRAP
-typedef enum tmedia_rtcp_event_type_e
-{
- tmedia_rtcp_event_type_fir, // Full Intra Refresh
+typedef enum tmedia_rtcp_event_type_e {
+ tmedia_rtcp_event_type_fir, // Full Intra Refresh
}
tmedia_rtcp_event_type_t;
// @tinyWRAP
-typedef enum tmedia_profile_e
-{
- tmedia_profile_default,
- // Enable all RTCWeb specifications:
- // ICE, DTLS-SRTP, RTP/AVPF, FEC, RED, SDPCapNeg, RTCP-MUX, imageattr...
- tmedia_profile_rtcweb
+typedef enum tmedia_profile_e {
+ tmedia_profile_default,
+ // Enable all RTCWeb specifications:
+ // ICE, DTLS-SRTP, RTP/AVPF, FEC, RED, SDPCapNeg, RTCP-MUX, imageattr...
+ tmedia_profile_rtcweb
}
tmedia_profile_t;
// @tinyWRAP
-typedef enum tmedia_pref_video_size_s
-{ /* must be sorted like this */
- tmedia_pref_video_size_sqcif, // 128 x 98
- tmedia_pref_video_size_qcif, // 176 x 144
- tmedia_pref_video_size_qvga, // 320 x 240
- tmedia_pref_video_size_cif, // 352 x 288
- tmedia_pref_video_size_hvga, // 480 x 320
- tmedia_pref_video_size_vga, // 640 x 480
- tmedia_pref_video_size_4cif, // 704 x 576
- tmedia_pref_video_size_wvga, // 800 x 480
- tmedia_pref_video_size_svga, // 800 x 600
- tmedia_pref_video_size_480p, // 852 x 480
- tmedia_pref_video_size_xga, // 1024 x 768
- tmedia_pref_video_size_720p, // 1280 x 720
- tmedia_pref_video_size_16cif, // 1408 x 1152
- tmedia_pref_video_size_1080p, // 1920 x 1080
- tmedia_pref_video_size_2160p, // 3840 x 2160
+typedef enum tmedia_pref_video_size_s {
+ /* must be sorted like this */
+ tmedia_pref_video_size_sqcif, // 128 x 98
+ tmedia_pref_video_size_qcif, // 176 x 144
+ tmedia_pref_video_size_qvga, // 320 x 240
+ tmedia_pref_video_size_cif, // 352 x 288
+ tmedia_pref_video_size_hvga, // 480 x 320
+ tmedia_pref_video_size_vga, // 640 x 480
+ tmedia_pref_video_size_4cif, // 704 x 576
+ tmedia_pref_video_size_wvga, // 800 x 480
+ tmedia_pref_video_size_svga, // 800 x 600
+ tmedia_pref_video_size_480p, // 852 x 480
+ tmedia_pref_video_size_xga, // 1024 x 768
+ tmedia_pref_video_size_720p, // 1280 x 720
+ tmedia_pref_video_size_16cif, // 1408 x 1152
+ tmedia_pref_video_size_1080p, // 1920 x 1080
+ tmedia_pref_video_size_2160p, // 3840 x 2160
}
tmedia_pref_video_size_t;
-typedef enum tmedia_rtcweb_type_e
-{
- tmedia_rtcweb_type_none,
- tmedia_rtcweb_type_firefox,
- tmedia_rtcweb_type_chrome,
- tmedia_rtcweb_type_ie,
- tmedia_rtcweb_type_safari,
- tmedia_rtcweb_type_opera,
- tmedia_rtcweb_type_ericsson,
- tmedia_rtcweb_type_doubango
+typedef enum tmedia_rtcweb_type_e {
+ tmedia_rtcweb_type_none,
+ tmedia_rtcweb_type_firefox,
+ tmedia_rtcweb_type_chrome,
+ tmedia_rtcweb_type_ie,
+ tmedia_rtcweb_type_safari,
+ tmedia_rtcweb_type_opera,
+ tmedia_rtcweb_type_ericsson,
+ tmedia_rtcweb_type_doubango
}
tmedia_rtcweb_type_t;
-typedef enum tmedia_video_encode_result_type_e
-{
- tmedia_video_encode_result_type_none = 0x00,
- tmedia_video_encode_result_type_params = (0x01 << 0), // e.g. SPS or PPS, DCT coeff., Quant params....
- tmedia_video_encode_result_type_intra = (0x01 << 1),
- tmedia_video_encode_result_type_key = tmedia_video_encode_result_type_intra,
- tmedia_video_encode_result_type_gold = tmedia_video_encode_result_type_intra,
- tmedia_video_encode_result_type_predicted = (0x01 << 2),
- tmedia_video_encode_result_type_bipredicted = (0x01 << 3)
+typedef enum tmedia_video_encode_result_type_e {
+ tmedia_video_encode_result_type_none = 0x00,
+ tmedia_video_encode_result_type_params = (0x01 << 0), // e.g. SPS or PPS, DCT coeff., Quant params....
+ tmedia_video_encode_result_type_intra = (0x01 << 1),
+ tmedia_video_encode_result_type_key = tmedia_video_encode_result_type_intra,
+ tmedia_video_encode_result_type_gold = tmedia_video_encode_result_type_intra,
+ tmedia_video_encode_result_type_predicted = (0x01 << 2),
+ tmedia_video_encode_result_type_bipredicted = (0x01 << 3)
}
tmedia_video_encode_result_type_t;
-typedef struct tmedia_video_encode_result_xs
-{
- tmedia_video_encode_result_type_t type;
- const void* usr_data;
- struct{
- const void* ptr;
- tsk_size_t size;
- } buffer;
- uint32_t duration;
- tsk_bool_t last_chunck;
- const tsk_object_t* proto_hdr;
+typedef struct tmedia_video_encode_result_xs {
+ tmedia_video_encode_result_type_t type;
+ const void* usr_data;
+ struct {
+ const void* ptr;
+ tsk_size_t size;
+ } buffer;
+ uint32_t duration;
+ tsk_bool_t last_chunck;
+ const tsk_object_t* proto_hdr;
}
tmedia_video_encode_result_xt;
@@ -198,21 +188,19 @@ tmedia_video_encode_result_xt;
(result)->duration = 0; \
(result)->last_chunck = tsk_false; \
(result)->proto_hdr = tsk_null; \
+
+typedef enum tmedia_video_decode_result_type_e {
+ tmedia_video_decode_result_type_none,
-typedef enum tmedia_video_decode_result_type_e
-{
- tmedia_video_decode_result_type_none,
-
- tmedia_video_decode_result_type_error,
- tmedia_video_decode_result_type_idr,
+ tmedia_video_decode_result_type_error,
+ tmedia_video_decode_result_type_idr,
}
tmedia_video_decode_result_type_t;
-typedef struct tmedia_video_decode_result_xs
-{
- tmedia_video_decode_result_type_t type;
- const void* usr_data;
- const tsk_object_t* proto_hdr; // RTP, RTSP....
+typedef struct tmedia_video_decode_result_xs {
+ tmedia_video_decode_result_type_t type;
+ const void* usr_data;
+ const tsk_object_t* proto_hdr; // RTP, RTSP....
}
tmedia_video_decode_result_xt;
@@ -220,45 +208,42 @@ tmedia_video_decode_result_xt;
(result)->type = tmedia_video_decode_result_type_none; \
(result)->usr_data = tsk_null; \
(result)->proto_hdr = tsk_null; \
-
+
// @tinyWRAP
-typedef enum tmedia_chroma_e
-{
- tmedia_chroma_none=0,
- tmedia_chroma_rgb24, // will be stored as bgr24 on x86 (little endians) machines; e.g. WindowsPhone7
- tmedia_chroma_bgr24, // used by windows consumer (DirectShow) -
- tmedia_chroma_rgb32, // used by iOS4 consumer (iPhone and iPod touch)
- tmedia_chroma_rgb565le, // (used by both android and wince consumers)
- tmedia_chroma_rgb565be,
- tmedia_chroma_nv12, // used by iOS4 producer (iPhone and iPod Touch 3GS and 4)
- tmedia_chroma_nv21, // Yuv420 SP (used by android producer)
- tmedia_chroma_yuv422p,
- tmedia_chroma_uyvy422, // used by iOS4 producer (iPhone and iPod Touch 3G) - Microsoft: MFVideoFormat_YUY2
- tmedia_chroma_yuv420p, // Default
- tmedia_chroma_mjpeg, // VirtualBox default camera mode (Windows as host and Linux as guest)
- tmedia_chroma_yuyv422, // YUYV422 (V4L2 preferred format)
+typedef enum tmedia_chroma_e {
+ tmedia_chroma_none=0,
+ tmedia_chroma_rgb24, // will be stored as bgr24 on x86 (little endians) machines; e.g. WindowsPhone7
+ tmedia_chroma_bgr24, // used by windows consumer (DirectShow) -
+ tmedia_chroma_rgb32, // used by iOS4 consumer (iPhone and iPod touch)
+ tmedia_chroma_rgb565le, // (used by both android and wince consumers)
+ tmedia_chroma_rgb565be,
+ tmedia_chroma_nv12, // used by iOS4 producer (iPhone and iPod Touch 3GS and 4)
+ tmedia_chroma_nv21, // Yuv420 SP (used by android producer)
+ tmedia_chroma_yuv422p,
+ tmedia_chroma_uyvy422, // used by iOS4 producer (iPhone and iPod Touch 3G) - Microsoft: MFVideoFormat_YUY2
+ tmedia_chroma_yuv420p, // Default
+ tmedia_chroma_mjpeg, // VirtualBox default camera mode (Windows as host and Linux as guest)
+ tmedia_chroma_yuyv422, // YUYV422 (V4L2 preferred format)
}
tmedia_chroma_t;
// @tinyWRAP
// @deprecated
// keep order (low->unrestricted)
-typedef enum tmedia_bandwidth_level_e
-{
- tmedia_bl_low,
- tmedia_bl_medium,
- tmedia_bl_hight,
- tmedia_bl_unrestricted
+typedef enum tmedia_bandwidth_level_e {
+ tmedia_bl_low,
+ tmedia_bl_medium,
+ tmedia_bl_hight,
+ tmedia_bl_unrestricted
}
tmedia_bandwidth_level_t;
-typedef enum tmedia_ro_type_e
-{
- tmedia_ro_type_none = 0x00,
- tmedia_ro_type_offer = (0x01 << 0),
- tmedia_ro_type_answer = (0x01 << 1),
- tmedia_ro_type_provisional = tmedia_ro_type_answer | (0x01 << 2),
+typedef enum tmedia_ro_type_e {
+ tmedia_ro_type_none = 0x00,
+ tmedia_ro_type_offer = (0x01 << 0),
+ tmedia_ro_type_answer = (0x01 << 1),
+ tmedia_ro_type_provisional = tmedia_ro_type_answer | (0x01 << 2),
}
tmedia_ro_type_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_consumer.h b/tinyMEDIA/include/tinymedia/tmedia_consumer.h
index 0e88f45..9d347f1 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_consumer.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_consumer.h
@@ -4,17 +4,17 @@
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
-*
+*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,73 +56,71 @@ TMEDIA_BEGIN_DECLS
#endif
/** Base object for all Consumers */
-typedef struct tmedia_consumer_s
-{
- TSK_DECLARE_OBJECT;
-
- tmedia_type_t type;
- const char* desc;
-
- struct{
- int fps;
- struct {
- tmedia_chroma_t chroma;
- tsk_size_t width;
- tsk_size_t height;
- } in;
- struct {
- tmedia_chroma_t chroma;
- tsk_size_t width;
- tsk_size_t height;
- tsk_bool_t auto_resize; // auto_resize to "in.width, in.height"
- } display;
- } video;
-
- struct{
- uint8_t bits_per_sample;
- uint8_t ptime;
- uint8_t gain;
- struct{
- uint8_t channels;
- uint32_t rate;
- } in;
- struct{
- uint8_t channels;
- uint32_t rate;
- } out;
- int32_t volume;
- } audio;
-
- tsk_bool_t is_started;
- tsk_bool_t is_prepared;
- uint64_t session_id;
-
- struct{
- enum tmedia_codec_id_e codec_id;
- // other options to be added
- } decoder;
-
- const struct tmedia_consumer_plugin_def_s* plugin;
+typedef struct tmedia_consumer_s {
+ TSK_DECLARE_OBJECT;
+
+ tmedia_type_t type;
+ const char* desc;
+
+ struct {
+ int fps;
+ struct {
+ tmedia_chroma_t chroma;
+ tsk_size_t width;
+ tsk_size_t height;
+ } in;
+ struct {
+ tmedia_chroma_t chroma;
+ tsk_size_t width;
+ tsk_size_t height;
+ tsk_bool_t auto_resize; // auto_resize to "in.width, in.height"
+ } display;
+ } video;
+
+ struct {
+ uint8_t bits_per_sample;
+ uint8_t ptime;
+ uint8_t gain;
+ struct {
+ uint8_t channels;
+ uint32_t rate;
+ } in;
+ struct {
+ uint8_t channels;
+ uint32_t rate;
+ } out;
+ int32_t volume;
+ } audio;
+
+ tsk_bool_t is_started;
+ tsk_bool_t is_prepared;
+ uint64_t session_id;
+
+ struct {
+ enum tmedia_codec_id_e codec_id;
+ // other options to be added
+ } decoder;
+
+ const struct tmedia_consumer_plugin_def_s* plugin;
}
tmedia_consumer_t;
/** Virtual table used to define a consumer plugin */
-typedef struct tmedia_consumer_plugin_def_s
-{
- //! object definition used to create an instance of the consumer
- const tsk_object_def_t* objdef;
-
- //! the type of the consumer
- tmedia_type_t type;
- //! full description (usefull for debugging)
- const char* desc;
-
- int (*set) (tmedia_consumer_t* , const tmedia_param_t*);
- int (* prepare) (tmedia_consumer_t*, const tmedia_codec_t* );
- int (* start) (tmedia_consumer_t* );
- int (* consume) (tmedia_consumer_t*, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
- int (* pause) (tmedia_consumer_t* );
- int (* stop) (tmedia_consumer_t* );
+typedef struct tmedia_consumer_plugin_def_s {
+ //! object definition used to create an instance of the consumer
+ const tsk_object_def_t* objdef;
+
+ //! the type of the consumer
+ tmedia_type_t type;
+ //! full description (usefull for debugging)
+ const char* desc;
+
+ int (*set) (tmedia_consumer_t* , const tmedia_param_t*);
+ int (* prepare) (tmedia_consumer_t*, const tmedia_codec_t* );
+ int (* start) (tmedia_consumer_t* );
+ int (* consume) (tmedia_consumer_t*, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
+ int (* pause) (tmedia_consumer_t* );
+ int (* stop) (tmedia_consumer_t* );
}
tmedia_consumer_plugin_def_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_converter_video.h b/tinyMEDIA/include/tinymedia/tmedia_converter_video.h
index 133dfab..6af98d6 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_converter_video.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_converter_video.h
@@ -2,17 +2,17 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
-*
+*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,26 +40,25 @@ TMEDIA_BEGIN_DECLS
# define TMED_CONVERTER_VIDEO_MAX_PLUGINS 0x0F
#endif
-typedef struct tmedia_converter_video_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_size_t srcWidth;
- tsk_size_t srcHeight;
+typedef struct tmedia_converter_video_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_size_t srcWidth;
+ tsk_size_t srcHeight;
- tsk_size_t dstWidth;
- tsk_size_t dstHeight;
+ tsk_size_t dstWidth;
+ tsk_size_t dstHeight;
- tmedia_chroma_t srcChroma;
- tmedia_chroma_t dstChroma;
+ tmedia_chroma_t srcChroma;
+ tmedia_chroma_t dstChroma;
- // one shot parameters
- int rotation;
- tsk_bool_t flip;
- tsk_bool_t mirror;
- tsk_bool_t scale_rotated_frames;
+ // one shot parameters
+ int rotation;
+ tsk_bool_t flip;
+ tsk_bool_t mirror;
+ tsk_bool_t scale_rotated_frames;
- const struct tmedia_converter_video_plugin_def_s* plugin;
+ const struct tmedia_converter_video_plugin_def_s* plugin;
}
tmedia_converter_video_t;
@@ -93,13 +92,12 @@ tmedia_converter_video_t;
(_self)->plugin->process((_self), (_buffer), (_size), (_output), (_output_max_size))
/** Virtual table used to define a consumer plugin */
-typedef struct tmedia_converter_video_plugin_def_s
-{
- //! object definition used to create an instance of the converter
- const tsk_object_def_t* objdef;
+typedef struct tmedia_converter_video_plugin_def_s {
+ //! object definition used to create an instance of the converter
+ const tsk_object_def_t* objdef;
- int (* init) ( struct tmedia_converter_video_s* self, tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma );
- tsk_size_t (* process) ( struct tmedia_converter_video_s* self, const void* buffer, tsk_size_t buffer_size, void** output, tsk_size_t* output_max_size );
+ int (* init) ( struct tmedia_converter_video_s* self, tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma );
+ tsk_size_t (* process) ( struct tmedia_converter_video_s* self, const void* buffer, tsk_size_t buffer_size, void** output, tsk_size_t* output_max_size );
}
tmedia_converter_video_plugin_def_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_defaults.h b/tinyMEDIA/include/tinymedia/tmedia_defaults.h
index 324c241..91a1ae8 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_defaults.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_defaults.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -45,6 +45,10 @@ TINYMEDIA_API int tmedia_defaults_set_bandwidth_video_download_max(int32_t bw_vi
TINYMEDIA_API int32_t tmedia_defaults_get_bandwidth_video_download_max();
TINYMEDIA_API int tmedia_defaults_set_pref_video_size(tmedia_pref_video_size_t pref_video_size);
TINYMEDIA_API tmedia_pref_video_size_t tmedia_defaults_get_pref_video_size();
+TINYMEDIA_API int tmedia_defaults_set_pref_video_size_range(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max);
+TINYMEDIA_API int tmedia_defaults_get_pref_video_size_range(tmedia_pref_video_size_t *min, tmedia_pref_video_size_t* max);
+TINYMEDIA_API int tmedia_defaults_set_adapt_video_size_range_enabled(tsk_bool_t enabled);
+TINYMEDIA_API tsk_bool_t tmedia_defaults_get_adapt_video_size_range_enabled();
TINYMEDIA_API int tmedia_defaults_set_jb_margin(int32_t jb_margin_ms);
TINYMEDIA_API int32_t tmedia_defaults_get_jb_margin();
TINYMEDIA_API int tmedia_defaults_set_jb_max_late_rate(int32_t jb_max_late_rate_percent);
diff --git a/tinyMEDIA/include/tinymedia/tmedia_denoise.h b/tinyMEDIA/include/tinymedia/tmedia_denoise.h
index d8818f4..522ef48 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_denoise.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_denoise.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,45 +36,43 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_DENOISE(self) ((tmedia_denoise_t*)(self))
/** Base object for all Denoisers */
-typedef struct tmedia_denoise_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t opened;
-
- uint32_t echo_tail;
- uint32_t echo_skew;
- tsk_bool_t echo_supp_enabled;
- tsk_bool_t agc_enabled ;
- float agc_level;
- tsk_bool_t vad_enabled;
- tsk_bool_t noise_supp_enabled;
- int32_t noise_supp_level;
+typedef struct tmedia_denoise_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t opened;
+
+ uint32_t echo_tail;
+ uint32_t echo_skew;
+ tsk_bool_t echo_supp_enabled;
+ tsk_bool_t agc_enabled ;
+ float agc_level;
+ tsk_bool_t vad_enabled;
+ tsk_bool_t noise_supp_enabled;
+ int32_t noise_supp_level;
tsk_buffer_t *record_frame;
- tsk_buffer_t *playback_frame;
- const struct tmedia_denoise_plugin_def_s* plugin;
+ tsk_buffer_t *playback_frame;
+ const struct tmedia_denoise_plugin_def_s* plugin;
}
tmedia_denoise_t;
#define TMEDIA_DECLARE_DENOISE tmedia_denoise_t __denoise__
/** Virtual table used to define a consumer plugin */
-typedef struct tmedia_denoise_plugin_def_s
-{
- //! object definition used to create an instance of the denoiser
- const tsk_object_def_t* objdef;
-
- //! full description (usefull for debugging)
- const char* desc;
-
- int (*set) (tmedia_denoise_t* , const tmedia_param_t*);
- int (* open) (tmedia_denoise_t*, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t record_channels, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate, uint32_t playback_channels);
- int (*echo_playback) (tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes);
- //! aec, vad, noise suppression, echo cancellation before sending packet over network
- int (* process_record) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise);
- //! noise suppression before playing sound
- int (* process_playback) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes);
- int (* close) (tmedia_denoise_t* );
+typedef struct tmedia_denoise_plugin_def_s {
+ //! object definition used to create an instance of the denoiser
+ const tsk_object_def_t* objdef;
+
+ //! full description (usefull for debugging)
+ const char* desc;
+
+ int (*set) (tmedia_denoise_t* , const tmedia_param_t*);
+ int (* open) (tmedia_denoise_t*, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t record_channels, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate, uint32_t playback_channels);
+ int (*echo_playback) (tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes);
+ //! aec, vad, noise suppression, echo cancellation before sending packet over network
+ int (* process_record) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise);
+ //! noise suppression before playing sound
+ int (* process_playback) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes);
+ int (* close) (tmedia_denoise_t* );
}
tmedia_denoise_plugin_def_t;
@@ -94,4 +92,4 @@ TINYMEDIA_API tmedia_denoise_t* tmedia_denoise_create();
TMEDIA_END_DECLS
-#endif /* TINYMEDIA_DENOISE_H */
+#endif /* TINYMEDIA_DENOISE_H */
diff --git a/tinyMEDIA/include/tinymedia/tmedia_imageattr.h b/tinyMEDIA/include/tinymedia/tmedia_imageattr.h
index c709a17..c187da3 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_imageattr.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_imageattr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,63 +41,59 @@ typedef int32_t xyvalue_t;
typedef double qvalue_t;
typedef double spvalue_t;
-typedef struct tmedia_imageattr_srange_xs
-{
- unsigned is_range:1;
- union{
- struct{
- spvalue_t start;
- spvalue_t end;
- }range;
- struct{
- spvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
- tsk_size_t count;
- }array;
- };
+typedef struct tmedia_imageattr_srange_xs {
+ unsigned is_range:1;
+ union {
+ struct {
+ spvalue_t start;
+ spvalue_t end;
+ } range;
+ struct {
+ spvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
+ tsk_size_t count;
+ } array;
+ };
}
tmedia_imageattr_srange_xt;
-typedef struct tmedia_imageattr_xyrange_xs
-{
- unsigned is_range:1;
- union{
- struct{
- xyvalue_t start;
- xyvalue_t step;
- xyvalue_t end;
- }range;
- struct{
- xyvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
- tsk_size_t count;
- }array;
- };
+typedef struct tmedia_imageattr_xyrange_xs {
+ unsigned is_range:1;
+ union {
+ struct {
+ xyvalue_t start;
+ xyvalue_t step;
+ xyvalue_t end;
+ } range;
+ struct {
+ xyvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
+ tsk_size_t count;
+ } array;
+ };
}
tmedia_imageattr_xyrange_xt;
-typedef struct tmedia_imageattr_set_xs
-{
- tmedia_imageattr_xyrange_xt xrange;
- tmedia_imageattr_xyrange_xt yrange;
- tmedia_imageattr_srange_xt srange;
- struct{
- unsigned is_present:1;
- spvalue_t start;
- spvalue_t end;
- }prange;
- qvalue_t qvalue;
+typedef struct tmedia_imageattr_set_xs {
+ tmedia_imageattr_xyrange_xt xrange;
+ tmedia_imageattr_xyrange_xt yrange;
+ tmedia_imageattr_srange_xt srange;
+ struct {
+ unsigned is_present:1;
+ spvalue_t start;
+ spvalue_t end;
+ } prange;
+ qvalue_t qvalue;
}
tmedia_imageattr_set_xt;
-typedef struct tmedia_imageattr_xs
-{
- struct{
- tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
- tsk_size_t count;
- }send;
- struct{
- tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
- tsk_size_t count;
- }recv;
+typedef struct tmedia_imageattr_xs {
+ struct {
+ tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
+ tsk_size_t count;
+ } send;
+ struct {
+ tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
+ tsk_size_t count;
+ } recv;
}
tmedia_imageattr_xt;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_jitterbuffer.h b/tinyMEDIA/include/tinymedia/tmedia_jitterbuffer.h
index fb0f8ef..3a62ae2 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_jitterbuffer.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_jitterbuffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,37 +47,35 @@ TMEDIA_BEGIN_DECLS
#endif
/** Base object for all JitterBuffers */
-typedef struct tmedia_jitterbuffer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmedia_jitterbuffer_s {
+ TSK_DECLARE_OBJECT;
- tsk_bool_t opened;
+ tsk_bool_t opened;
- const struct tmedia_jitterbuffer_plugin_def_s* plugin;
+ const struct tmedia_jitterbuffer_plugin_def_s* plugin;
}
tmedia_jitterbuffer_t;
#define TMEDIA_DECLARE_JITTER_BUFFER tmedia_jitterbuffer_t __jitterbuffer__
/** Virtual table used to define a consumer plugin */
-typedef struct tmedia_jitterbuffer_plugin_def_s
-{
- //! object definition used to create an instance of the jitterbufferr
- const tsk_object_def_t* objdef;
-
- //! the type of the jitter buffer
- tmedia_type_t type;
-
- //! full description (usefull for debugging)
- const char* desc;
-
- int (*set) (tmedia_jitterbuffer_t* , const tmedia_param_t*);
- int (* open) (tmedia_jitterbuffer_t*, uint32_t frame_duration, uint32_t rate, uint32_t channels);
- int (* tick) (tmedia_jitterbuffer_t*);
- int (* put) (tmedia_jitterbuffer_t*, void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr);
- tsk_size_t (* get) (tmedia_jitterbuffer_t*, void* out_data, tsk_size_t out_size);
- int (* reset) (tmedia_jitterbuffer_t* );
- int (* close) (tmedia_jitterbuffer_t* );
+typedef struct tmedia_jitterbuffer_plugin_def_s {
+ //! object definition used to create an instance of the jitterbufferr
+ const tsk_object_def_t* objdef;
+
+ //! the type of the jitter buffer
+ tmedia_type_t type;
+
+ //! full description (usefull for debugging)
+ const char* desc;
+
+ int (*set) (tmedia_jitterbuffer_t* , const tmedia_param_t*);
+ int (* open) (tmedia_jitterbuffer_t*, uint32_t frame_duration, uint32_t rate, uint32_t channels);
+ int (* tick) (tmedia_jitterbuffer_t*);
+ int (* put) (tmedia_jitterbuffer_t*, void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr);
+ tsk_size_t (* get) (tmedia_jitterbuffer_t*, void* out_data, tsk_size_t out_size);
+ int (* reset) (tmedia_jitterbuffer_t* );
+ int (* close) (tmedia_jitterbuffer_t* );
}
tmedia_jitterbuffer_plugin_def_t;
@@ -99,4 +97,4 @@ TINYMEDIA_API tmedia_jitterbuffer_t* tmedia_jitterbuffer_create(tmedia_type_t ty
TMEDIA_END_DECLS
-#endif /* TINYMEDIA_JITTER_BUFFER_H */
+#endif /* TINYMEDIA_JITTER_BUFFER_H */
diff --git a/tinyMEDIA/include/tinymedia/tmedia_params.h b/tinyMEDIA/include/tinymedia/tmedia_params.h
index 549552c..baec140 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_params.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_params.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,50 +40,46 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_PARAM(self) ((tmedia_param_t*)(self))
-typedef enum tmedia_param_access_type_e
-{
- tmedia_pat_get,
- tmedia_pat_set
+typedef enum tmedia_param_access_type_e {
+ tmedia_pat_get,
+ tmedia_pat_set
}
tmedia_param_access_type_t;
-typedef enum tmedia_param_plugin_type_e
-{
- tmedia_ppt_consumer,
- tmedia_ppt_producer,
- tmedia_ppt_codec,
- tmedia_ppt_session,
- tmedia_ppt_manager
+typedef enum tmedia_param_plugin_type_e {
+ tmedia_ppt_consumer,
+ tmedia_ppt_producer,
+ tmedia_ppt_codec,
+ tmedia_ppt_session,
+ tmedia_ppt_manager
}
tmedia_param_plugin_type_t;
-typedef enum tmedia_param_value_type_e
-{
- tmedia_pvt_int32,
- tmedia_pvt_bool = tmedia_pvt_int32,
- tmedia_pvt_pobject,
- tmedia_pvt_pchar,
- tmedia_pvt_int64,
+typedef enum tmedia_param_value_type_e {
+ tmedia_pvt_int32,
+ tmedia_pvt_bool = tmedia_pvt_int32,
+ tmedia_pvt_pobject,
+ tmedia_pvt_pchar,
+ tmedia_pvt_int64,
}
tmedia_param_value_type_t;
#define TMEDIA_PARAM_VALUE_TYPE_IS_PTR(self) ((self) == tmedia_pvt_pobject || (self) == tmedia_pvt_pchar)
-typedef struct tmedia_param_s
-{
- TSK_DECLARE_OBJECT;
-
- tmedia_param_access_type_t access_type;
- tmedia_type_t media_type;
- tmedia_param_plugin_type_t plugin_type;
- tmedia_param_value_type_t value_type;
-
- char* key;
- /* Because setting parameters could be deferred
- * ==> MUST copy the value for later use.
- * e.g. TMEDIA_SESSION_MANAGER_SET_INT32("width", 1234); 1234 will be lost when we exit the block code
- */
- void* value;
+typedef struct tmedia_param_s {
+ TSK_DECLARE_OBJECT;
+
+ tmedia_param_access_type_t access_type;
+ tmedia_type_t media_type;
+ tmedia_param_plugin_type_t plugin_type;
+ tmedia_param_value_type_t value_type;
+
+ char* key;
+ /* Because setting parameters could be deferred
+ * ==> MUST copy the value for later use.
+ * e.g. TMEDIA_SESSION_MANAGER_SET_INT32("width", 1234); 1234 will be lost when we exit the block code
+ */
+ void* value;
}
tmedia_param_t;
@@ -91,12 +87,12 @@ typedef tsk_list_t tmedia_params_L_t; /**< List of @ref tsk_param_t elements. */
#define tmedia_params_create() tsk_list_create()
-TINYMEDIA_API tmedia_param_t* tmedia_param_create(tmedia_param_access_type_t access_type,
- tmedia_type_t media_type,
- tmedia_param_plugin_type_t plugin_type,
- tmedia_param_value_type_t value_type,
- const char* key,
- void* value);
+TINYMEDIA_API tmedia_param_t* tmedia_param_create(tmedia_param_access_type_t access_type,
+ tmedia_type_t media_type,
+ tmedia_param_plugin_type_t plugin_type,
+ tmedia_param_value_type_t value_type,
+ const char* key,
+ void* value);
#define tmedia_param_create_get(media_type, plugin_type, value_type, key, value) tmedia_param_create(tmedia_pat_get, (media_type), (plugin_type), (value_type), (key), (value))
#define tmedia_param_create_get_session(media_type, value_type, key, value) tmedia_param_create_get((media_type), tmedia_ppt_session, (value_type), (key), (value))
#define tmedia_param_create_get_codec(media_type, value_type, key, value) tmedia_param_create_get((media_type), tmedia_ppt_codec, (value_type), (key), (value))
@@ -104,13 +100,13 @@ TINYMEDIA_API tmedia_param_t* tmedia_param_create(tmedia_param_access_type_t acc
TINYMEDIA_API tmedia_params_L_t* tmedia_params_create_2(va_list *app);
-TINYMEDIA_API int tmedia_params_add_param(tmedia_params_L_t **self,
- tmedia_param_access_type_t access_type,
- tmedia_type_t media_type,
- tmedia_param_plugin_type_t plugin_type,
- tmedia_param_value_type_t value_type,
- const char* key,
- void* value);
+TINYMEDIA_API int tmedia_params_add_param(tmedia_params_L_t **self,
+ tmedia_param_access_type_t access_type,
+ tmedia_type_t media_type,
+ tmedia_param_plugin_type_t plugin_type,
+ tmedia_param_value_type_t value_type,
+ const char* key,
+ void* value);
TINYMEDIA_GEXTERN const tsk_object_def_t *tmedia_param_def_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_producer.h b/tinyMEDIA/include/tinymedia/tmedia_producer.h
index 0817821..3cfc4c6 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_producer.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_producer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,70 +55,68 @@ typedef int (*tmedia_producer_raw_cb_f)(const tmedia_video_encode_result_xt* chu
#define TMEDIA_PRODUCER_CHROMA_DEFAULT tmedia_chroma_yuv420p
/** Base object for all Producers */
-typedef struct tmedia_producer_s
-{
- TSK_DECLARE_OBJECT;
-
- tmedia_type_t type;
- const char* desc;
-
- struct{
- tmedia_chroma_t chroma;
- int fps;
- int rotation;
- tsk_bool_t mirror;
- tsk_size_t width;
- tsk_size_t height;
- } video;
-
- struct{
- uint8_t bits_per_sample;
- uint8_t channels;
- uint32_t rate;
- uint8_t ptime;
- uint8_t gain;
- int32_t volume;
- } audio;
-
- const struct tmedia_producer_plugin_def_s* plugin;
-
- tsk_bool_t is_prepared;
- tsk_bool_t is_started;
- uint64_t session_id;
-
- struct{
- enum tmedia_codec_id_e codec_id;
- // other options to be added
- } encoder;
-
- struct{
- tmedia_producer_enc_cb_f callback;
- const void* callback_data;
- } enc_cb;
-
- struct{
- tmedia_producer_raw_cb_f callback;
- tmedia_video_encode_result_xt chunck_curr;
- } raw_cb;
+typedef struct tmedia_producer_s {
+ TSK_DECLARE_OBJECT;
+
+ tmedia_type_t type;
+ const char* desc;
+
+ struct {
+ tmedia_chroma_t chroma;
+ int fps;
+ int rotation;
+ tsk_bool_t mirror;
+ tsk_size_t width;
+ tsk_size_t height;
+ } video;
+
+ struct {
+ uint8_t bits_per_sample;
+ uint8_t channels;
+ uint32_t rate;
+ uint8_t ptime;
+ uint8_t gain;
+ int32_t volume;
+ } audio;
+
+ const struct tmedia_producer_plugin_def_s* plugin;
+
+ tsk_bool_t is_prepared;
+ tsk_bool_t is_started;
+ uint64_t session_id;
+
+ struct {
+ enum tmedia_codec_id_e codec_id;
+ // other options to be added
+ } encoder;
+
+ struct {
+ tmedia_producer_enc_cb_f callback;
+ const void* callback_data;
+ } enc_cb;
+
+ struct {
+ tmedia_producer_raw_cb_f callback;
+ tmedia_video_encode_result_xt chunck_curr;
+ } raw_cb;
}
tmedia_producer_t;
/** Virtual table used to define a producer plugin */
-typedef struct tmedia_producer_plugin_def_s
-{
- //! object definition used to create an instance of the producer
- const tsk_object_def_t* objdef;
-
- //! the type of the producer
- tmedia_type_t type;
- //! full description (usefull for debugging)
- const char* desc;
-
- int (*set) (tmedia_producer_t* , const tmedia_param_t*);
- int (* prepare) (tmedia_producer_t* , const tmedia_codec_t*);
- int (* start) (tmedia_producer_t* );
- int (* pause) (tmedia_producer_t* );
- int (* stop) (tmedia_producer_t* );
+typedef struct tmedia_producer_plugin_def_s {
+ //! object definition used to create an instance of the producer
+ const tsk_object_def_t* objdef;
+
+ //! the type of the producer
+ tmedia_type_t type;
+ //! full description (usefull for debugging)
+ const char* desc;
+
+ int (*set) (tmedia_producer_t* , const tmedia_param_t*);
+ int (* prepare) (tmedia_producer_t* , const tmedia_codec_t*);
+ int (* start) (tmedia_producer_t* );
+ int (* pause) (tmedia_producer_t* );
+ int (* stop) (tmedia_producer_t* );
}
tmedia_producer_plugin_def_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_qos.h b/tinyMEDIA/include/tinymedia/tmedia_qos.h
index 7ff8e97..a9f2b7c 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_qos.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_qos.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,61 +41,55 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_QOS_TLINE(self) ((tmedia_qos_tline_t*)(self))
/** List of all supported statues*/
-typedef enum tmedia_qos_status_e
-{
- //! current-status
- tmedia_qos_status_curr,
- //! desired-status
- tmedia_qos_status_des,
- //! confirm-status
- tmedia_qos_status_conf
+typedef enum tmedia_qos_status_e {
+ //! current-status
+ tmedia_qos_status_curr,
+ //! desired-status
+ tmedia_qos_status_des,
+ //! confirm-status
+ tmedia_qos_status_conf
}
tmedia_qos_status_t;
/** List of all supported precondition types */
-typedef enum tmedia_qos_ptype_e
-{
- tmedia_qos_ptype_qos
+typedef enum tmedia_qos_ptype_e {
+ tmedia_qos_ptype_qos
}
tmedia_qos_ptype_t;
/** List of all supported status types */
-typedef enum tmedia_qos_stype_e
-{
- tmedia_qos_stype_none,/* not part of the RFC */
+typedef enum tmedia_qos_stype_e {
+ tmedia_qos_stype_none,/* not part of the RFC */
- tmedia_qos_stype_segmented,
- tmedia_qos_stype_e2e,
+ tmedia_qos_stype_segmented,
+ tmedia_qos_stype_e2e,
}
tmedia_qos_stype_t;
/** strengths */
-typedef enum tmedia_qos_strength_e
-{
- /* do no change the order (none -> optional -> manadatory) */
- tmedia_qos_strength_none,
- tmedia_qos_strength_failure,
- tmedia_qos_strength_unknown,
- tmedia_qos_strength_optional,
- tmedia_qos_strength_mandatory
+typedef enum tmedia_qos_strength_e {
+ /* do no change the order (none -> optional -> manadatory) */
+ tmedia_qos_strength_none,
+ tmedia_qos_strength_failure,
+ tmedia_qos_strength_unknown,
+ tmedia_qos_strength_optional,
+ tmedia_qos_strength_mandatory
}
tmedia_qos_strength_t;
/** directions */
-typedef enum tmedia_qos_direction_e
-{
- tmedia_qos_direction_none = 0x01,
- tmedia_qos_direction_send = (0x01 << 1),
- tmedia_qos_direction_recv = (0x01 << 2),
- tmedia_qos_direction_sendrecv = (tmedia_qos_direction_send | tmedia_qos_direction_recv)
+typedef enum tmedia_qos_direction_e {
+ tmedia_qos_direction_none = 0x01,
+ tmedia_qos_direction_send = (0x01 << 1),
+ tmedia_qos_direction_recv = (0x01 << 2),
+ tmedia_qos_direction_sendrecv = (tmedia_qos_direction_send | tmedia_qos_direction_recv)
}
tmedia_qos_direction_t;
/* QoS table-line */
-typedef struct tmedia_qos_tline_s
-{
- TSK_DECLARE_OBJECT;
- tmedia_qos_stype_t type;
+typedef struct tmedia_qos_tline_s {
+ TSK_DECLARE_OBJECT;
+ tmedia_qos_stype_t type;
}
tmedia_qos_tline_t;
#define TMEDIA_DECLARE_QOS_TLINE tmedia_qos_tline_t __tline__
@@ -108,28 +102,27 @@ TINYMEDIA_API int tmedia_qos_tline_set_ro(tmedia_qos_tline_t* self, const tmedia
TINYMEDIA_API tsk_bool_t tmedia_qos_tline_canresume(const tmedia_qos_tline_t* self);
/* QoS table-line for E2E type*/
-typedef struct tmedia_qos_tline_e2e_s
-{
- TMEDIA_DECLARE_QOS_TLINE;
-
- /* RFC 3312 - 5.1 Generating an offer
-
- Direction Current Desired Strength
- ____________________________________
- send no mandatory
- recv no mandatory
- */
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } send;
-
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } recv;
+typedef struct tmedia_qos_tline_e2e_s {
+ TMEDIA_DECLARE_QOS_TLINE;
+
+ /* RFC 3312 - 5.1 Generating an offer
+
+ Direction Current Desired Strength
+ ____________________________________
+ send no mandatory
+ recv no mandatory
+ */
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } send;
+
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } recv;
}
tmedia_qos_tline_e2e_t;
@@ -140,42 +133,41 @@ TINYMEDIA_API int tmedia_qos_tline_e2e_set_ro(tmedia_qos_tline_e2e_t* self, cons
TINYMEDIA_API tsk_bool_t tmedia_qos_tline_e2e_canresume(const tmedia_qos_tline_e2e_t* self);
/* QoS table-line for Segented type*/
-typedef struct tmedia_qos_tline_segmented_s
-{
- TMEDIA_DECLARE_QOS_TLINE;
-
- /* RFC 3312 - 5.1 Generating an offer
- Direction Current Desired Strength
- ______________________________________
- local send no none
- local recv no none
- remote send no optional
- remote recv no none
- */
- /* can be done in two lines but I prefer doing it like this (easier) */
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } local_send;
-
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } local_recv;
-
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } remote_send;
-
- struct{
- unsigned current:1;
- unsigned confirm:1;
- tmedia_qos_strength_t strength;
- } remote_recv;
+typedef struct tmedia_qos_tline_segmented_s {
+ TMEDIA_DECLARE_QOS_TLINE;
+
+ /* RFC 3312 - 5.1 Generating an offer
+ Direction Current Desired Strength
+ ______________________________________
+ local send no none
+ local recv no none
+ remote send no optional
+ remote recv no none
+ */
+ /* can be done in two lines but I prefer doing it like this (easier) */
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } local_send;
+
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } local_recv;
+
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } remote_send;
+
+ struct {
+ unsigned current:1;
+ unsigned confirm:1;
+ tmedia_qos_strength_t strength;
+ } remote_recv;
}
tmedia_qos_tline_segmented_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_resampler.h b/tinyMEDIA/include/tinymedia/tmedia_resampler.h
index 5093bc6..fd89b87 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_resampler.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_resampler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,31 +42,29 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_RESAMPLER(self) ((tmedia_resampler_t*)(self))
/** Base object for all resamplers */
-typedef struct tmedia_resampler_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmedia_resampler_s {
+ TSK_DECLARE_OBJECT;
- tsk_bool_t opened;
+ tsk_bool_t opened;
- const struct tmedia_resampler_plugin_def_s* plugin;
+ const struct tmedia_resampler_plugin_def_s* plugin;
}
tmedia_resampler_t;
#define TMEDIA_DECLARE_RESAMPLER tmedia_resampler_t __resampler__
/** Virtual table used to define a consumer plugin */
-typedef struct tmedia_resampler_plugin_def_s
-{
- //! object definition used to create an instance of the resamplerr
- const tsk_object_def_t* objdef;
-
- //! full description (usefull for debugging)
- const char* desc;
-
- // ! quality is from 0-10
- int (* open) (tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, uint32_t bits_per_sample);
- tsk_size_t (* process) (tmedia_resampler_t*, const void* in_data, tsk_size_t in_size_in_sample, void* out_data, tsk_size_t out_size_in_sample);
- int (* close) (tmedia_resampler_t* );
+typedef struct tmedia_resampler_plugin_def_s {
+ //! object definition used to create an instance of the resamplerr
+ const tsk_object_def_t* objdef;
+
+ //! full description (usefull for debugging)
+ const char* desc;
+
+ // ! quality is from 0-10
+ int (* open) (tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, uint32_t bits_per_sample);
+ tsk_size_t (* process) (tmedia_resampler_t*, const void* in_data, tsk_size_t in_size_in_sample, void* out_data, tsk_size_t out_size_in_sample);
+ int (* close) (tmedia_resampler_t* );
}
tmedia_resampler_plugin_def_t;
@@ -83,4 +81,4 @@ TINYMEDIA_API tmedia_resampler_t* tmedia_resampler_create();
TMEDIA_END_DECLS
-#endif /* TINYMEDIA_RESAMPLER_H */
+#endif /* TINYMEDIA_RESAMPLER_H */
diff --git a/tinyMEDIA/include/tinymedia/tmedia_session.h b/tinyMEDIA/include/tinymedia/tmedia_session.h
index 743a7a5..698f61f 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_session.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,30 +50,28 @@ TMEDIA_BEGIN_DECLS
struct tmedia_session_s;
// rfc5168 (XML Schema for Media Control) commands
-typedef enum tmedia_session_rfc5168_cmd_e
-{
- tmedia_session_rfc5168_cmd_picture_fast_update,
+typedef enum tmedia_session_rfc5168_cmd_e {
+ tmedia_session_rfc5168_cmd_picture_fast_update,
}
tmedia_session_rfc5168_cmd_t;
// BFCP (rfc4582) events
-typedef enum tmedia_session_bfcp_evt_type_e
-{
- tmedia_session_bfcp_evt_type_err, // Global error
- tmedia_session_bfcp_evt_type_flreq_status, // FloorRequestStatus
+typedef enum tmedia_session_bfcp_evt_type_e {
+ tmedia_session_bfcp_evt_type_err, // Global error
+ tmedia_session_bfcp_evt_type_flreq_status, // FloorRequestStatus
}
tmedia_session_bfcp_evt_type_t;
typedef struct tmedia_session_bfcp_evt_xs {
- tmedia_session_bfcp_evt_type_t type;
- const char* reason;
- union {
- struct {
- int code;
- } err;
- struct {
- uint16_t status;
- } flreq;
- };
+ tmedia_session_bfcp_evt_type_t type;
+ const char* reason;
+ union {
+ struct {
+ int code;
+ } err;
+ struct {
+ uint16_t status;
+ } flreq;
+ };
} tmedia_session_bfcp_evt_xt;
#define TMEDIA_SESSION(self) ((tmedia_session_t*)(self))
@@ -91,106 +89,123 @@ typedef int (*tmedia_session_bfcp_cb_f)(const void* usrdata, const struct tmedia
#define TMED_SESSION_MAX_PLUGINS 0x0F
/** Base objct used for all media sessions */
-typedef struct tmedia_session_s
-{
- TSK_DECLARE_OBJECT;
-
- //! unique id. If you want to modifiy this field then you must use @ref tmedia_session_get_unique_id()
- uint64_t id;
- //! session type
- tmedia_type_t type;
- //! list of codec ids used as filter on the enabled codecs
- tmedia_codec_id_t codecs_allowed;
- //! list of codecs managed by this session (enabled)
- tmedia_codecs_L_t* codecs;
- //! negociated codec
- tmedia_codecs_L_t* neg_codecs;
- //! whether the ro have been prepared (up to the manager to update the value)
- tsk_bool_t ro_changed;
- //! whether the session have been initialized (up to the manager to update the value)
- tsk_bool_t initialized;
- //! whether the session have been prepared (up to the manager to update the value)
- tsk_bool_t prepared;
- //! whether the session is localy held
- tsk_bool_t lo_held;
- //! whether the session is remotely held
- tsk_bool_t ro_held;
- //! QoS
- tmedia_qos_tline_t* qos;
- //! bandwidth level
- tmedia_bandwidth_level_t bl;
- //! error callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API
- struct{
- tmedia_session_onerror_cb_f fun;
- const void* usrdata;
- } onerror_cb;
- //! rfc5168 (XML Schema for Media Control) callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API.
- struct {
- tmedia_session_rfc5168_cb_f fun;
- const void* usrdata;
- } rfc5168_cb;
- //! BFCP (rfc4582)
- struct {
- tmedia_session_bfcp_cb_f fun;
- const void* usrdata;
- } bfcp_cb;
-
- tsk_bool_t bypass_encoding;
- tsk_bool_t bypass_decoding;
-
- struct{
- char* file_ca;
- char* file_pbk;
- char* file_pvk;
- tsk_bool_t verify;
- } dtls;
-
- struct{
- tsdp_header_M_t* lo;
- tsdp_header_M_t* ro;
- } M;
-
- //! plugin used to create the session
- const struct tmedia_session_plugin_def_s* plugin;
+typedef struct tmedia_session_s {
+ TSK_DECLARE_OBJECT;
+
+ //! unique id. If you want to modifiy this field then you must use @ref tmedia_session_get_unique_id()
+ uint64_t id;
+ //! session type
+ tmedia_type_t type;
+ //! list of codec ids used as filter on the enabled codecs
+ tmedia_codec_id_t codecs_allowed;
+ //! list of codecs managed by this session (enabled)
+ tmedia_codecs_L_t* codecs;
+ //! negociated codec
+ tmedia_codecs_L_t* neg_codecs;
+ //! whether the ro have been prepared (up to the manager to update the value)
+ tsk_bool_t ro_changed;
+ //! whether the session have been initialized (up to the manager to update the value)
+ tsk_bool_t initialized;
+ //! whether the session have been prepared (up to the manager to update the value)
+ tsk_bool_t prepared;
+ //! whether the session is localy held
+ tsk_bool_t lo_held;
+ //! whether the session is remotely held
+ tsk_bool_t ro_held;
+ //! QoS
+ tmedia_qos_tline_t* qos;
+ //! bandwidth level
+ tmedia_bandwidth_level_t bl;
+ //! error callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API
+ struct {
+ tmedia_session_onerror_cb_f fun;
+ const void* usrdata;
+ } onerror_cb;
+ //! rfc5168 (XML Schema for Media Control) callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API.
+ struct {
+ tmedia_session_rfc5168_cb_f fun;
+ const void* usrdata;
+ } rfc5168_cb;
+ //! BFCP (rfc4582)
+ struct {
+ tmedia_session_bfcp_cb_f fun;
+ const void* usrdata;
+ } bfcp_cb;
+
+ tsk_bool_t bypass_encoding;
+ tsk_bool_t bypass_decoding;
+
+ struct {
+ char* file_ca;
+ char* file_pbk;
+ char* file_pvk;
+ tsk_bool_t verify;
+ } dtls;
+
+ struct {
+ float q1; /**< 2.1.Packet loss recovery */
+ float q2; /**< 2.2.Global packet loss estimation */
+ float q3; /**< 2.3.Receiver Estimated Maximum Bitrate */
+ float q4; /**< 2.4.Latency estimation */
+ float q5; /**< 2.5. Jitter buffer congestion estimation */
+ float qvag;
+ unsigned bw_up_est_kbps;
+ unsigned bw_down_est_kbps;
+ unsigned video_out_width;
+ unsigned video_out_height;
+ unsigned video_in_width;
+ unsigned video_in_height;
+ unsigned video_in_avg_fps;
+ unsigned video_dec_avg_time;
+ unsigned video_enc_avg_time;
+ uint64_t last_update_time;
+ } qos_metrics;
+
+ struct {
+ tsdp_header_M_t* lo;
+ tsdp_header_M_t* ro;
+ } M;
+
+ //! plugin used to create the session
+ const struct tmedia_session_plugin_def_s* plugin;
}
tmedia_session_t;
/** Virtual table used to define a session plugin */
-typedef struct tmedia_session_plugin_def_s
-{
- //! object definition used to create an instance of the session
- const tsk_object_def_t* objdef;
-
- //! the type of the session
- tmedia_type_t type;
- //! the media name. e.g. "audio", "video", "message", "image" etc.
- const char* media;
-
- int (*set) (tmedia_session_t* , const tmedia_param_t*);
- int (*get) (tmedia_session_t* , tmedia_param_t*);
- int (* prepare) (tmedia_session_t* );
- int (* start) (tmedia_session_t* );
- int (* pause) (tmedia_session_t* );
- int (* stop) (tmedia_session_t* );
-
- struct{ /* Special case */
- int (* send_dtmf) (tmedia_session_t*, uint8_t );
- } audio;
-
- const tsdp_header_M_t* (* get_local_offer) (tmedia_session_t* );
- /* return zero if can handle the ro and non-zero otherwise */
- int (* set_remote_offer) (tmedia_session_t* , const tsdp_header_M_t* );
-
- struct{ /* Special case */
- int (* set_ondata_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_t140_ondata_cb_f func);
- int (* send_data) (tmedia_session_t*, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
- } t140;
-
- struct{ /* Handles both SIP INFO and RTCP-FB: should be called by end-user only when transcoding is disabled */
- int (* set_onevent_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_rtcp_onevent_cb_f func);
- int (* send_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
- int (* recv_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
- } rtcp;
+typedef struct tmedia_session_plugin_def_s {
+ //! object definition used to create an instance of the session
+ const tsk_object_def_t* objdef;
+
+ //! the type of the session
+ tmedia_type_t type;
+ //! the media name. e.g. "audio", "video", "message", "image" etc.
+ const char* media;
+
+ int (*set) (tmedia_session_t* , const tmedia_param_t*);
+ int (*get) (tmedia_session_t* , tmedia_param_t*);
+ int (* prepare) (tmedia_session_t* );
+ int (* start) (tmedia_session_t* );
+ int (* pause) (tmedia_session_t* );
+ int (* stop) (tmedia_session_t* );
+
+ struct { /* Special case */
+ int (* send_dtmf) (tmedia_session_t*, uint8_t );
+ } audio;
+
+ const tsdp_header_M_t* (* get_local_offer) (tmedia_session_t* );
+ /* return zero if can handle the ro and non-zero otherwise */
+ int (* set_remote_offer) (tmedia_session_t* , const tsdp_header_M_t* );
+
+ struct { /* Special case */
+ int (* set_ondata_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_t140_ondata_cb_f func);
+ int (* send_data) (tmedia_session_t*, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
+ } t140;
+
+ struct { /* Handles both SIP INFO and RTCP-FB: should be called by end-user only when transcoding is disabled */
+ int (* set_onevent_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_rtcp_onevent_cb_f func);
+ int (* send_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
+ int (* recv_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
+ } rtcp;
}
tmedia_session_plugin_def_t;
@@ -216,9 +231,8 @@ typedef tsk_list_t tmedia_sessions_L_t; /**< List of @ref tmedia_session_t objec
#define TMEDIA_DECLARE_SESSION tmedia_session_t __session__
/** Audio Session */
-typedef struct tmedia_session_audio_s
-{
- TMEDIA_DECLARE_SESSION;
+typedef struct tmedia_session_audio_s {
+ TMEDIA_DECLARE_SESSION;
}
tmedia_session_audio_t;
#define tmedia_session_audio_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_audio)
@@ -228,9 +242,8 @@ TINYMEDIA_API int tmedia_session_audio_send_dtmf(tmedia_session_audio_t* self, u
#define TMEDIA_DECLARE_SESSION_AUDIO tmedia_session_audio_t __session_audio__
/** Video Session */
-typedef struct tmedia_session_video_s
-{
- TMEDIA_DECLARE_SESSION;
+typedef struct tmedia_session_video_s {
+ TMEDIA_DECLARE_SESSION;
}
tmedia_session_video_t;
#define tmedia_session_video_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_video)
@@ -243,17 +256,16 @@ struct tmedia_session_msrp_s;
struct tmsrp_event_s;
// use "struct tmsrp_event_s" instead of "tmsrp_event_t" to avoid linking aginst tinyMSRP
typedef int (*tmedia_session_msrp_cb_f)(const struct tmsrp_event_s* event);
-typedef struct tmedia_session_msrp_s
-{
- TMEDIA_DECLARE_SESSION;
-
- struct {
- tmedia_session_msrp_cb_f func;
- const void* data;
- } callback;
-
- int (* send_file) (struct tmedia_session_msrp_s*, const char* path, va_list *app);
- int (* send_message) (struct tmedia_session_msrp_s*, const void* data, tsk_size_t size, const tmedia_params_L_t *params);
+typedef struct tmedia_session_msrp_s {
+ TMEDIA_DECLARE_SESSION;
+
+ struct {
+ tmedia_session_msrp_cb_f func;
+ const void* data;
+ } callback;
+
+ int (* send_file) (struct tmedia_session_msrp_s*, const char* path, va_list *app);
+ int (* send_message) (struct tmedia_session_msrp_s*, const void* data, tsk_size_t size, const tmedia_params_L_t *params);
}
tmedia_session_msrp_t;
#define tmedia_session_msrp_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_msrp)
@@ -264,18 +276,17 @@ tmedia_session_msrp_t;
/** BFCP Session */
struct tmedia_session_bfcp_s;
struct tbfcp_event_s;
-typedef struct tmedia_session_bfcp_s
-{
- TMEDIA_DECLARE_SESSION;
-
- struct {
- // use "struct tbfcp_event_s" instead of "tbfcp_event_t" to avoid linking aginst tinyBFCP
- int (*fun)(const struct tbfcp_event_s* event);
- const void* data;
- } callback;
-
- // int (* share_file) (struct tmedia_session_bfcp_s*, const char* path, va_list *app);
- // int (* share_screen) (struct tmedia_session_bfcp_s*, const tmedia_params_L_t *params);
+typedef struct tmedia_session_bfcp_s {
+ TMEDIA_DECLARE_SESSION;
+
+ struct {
+ // use "struct tbfcp_event_s" instead of "tbfcp_event_t" to avoid linking aginst tinyBFCP
+ int (*fun)(const struct tbfcp_event_s* event);
+ const void* data;
+ } callback;
+
+ // int (* share_file) (struct tmedia_session_bfcp_s*, const char* path, va_list *app);
+ // int (* share_screen) (struct tmedia_session_bfcp_s*, const tmedia_params_L_t *params);
}
tmedia_session_bfcp_t;
#define tmedia_session_bfcp_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_bfcp)
@@ -288,80 +299,78 @@ int tmedia_session_t140_set_ondata_cbfn(tmedia_session_t* self, const void* cont
int tmedia_session_t140_send_data(tmedia_session_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
/** Session manager */
-typedef struct tmedia_session_mgr_s
-{
- TSK_DECLARE_OBJECT;
-
- //! whether we are the offerer or not
- tsk_bool_t offerer;
- //! local IP address or FQDN
- char* addr;
- //! public IP address or FQDN
- char* public_addr;
- //! whether the @a addr is IPv6 or not (useful when @addr is a FQDN)
- tsk_bool_t ipv6;
-
- struct{
- uint32_t lo_ver;
- tsdp_message_t* lo;
-
- int32_t ro_ver;
- tsdp_message_t* ro;
- } sdp;
-
- tsk_bool_t started;
- tsk_bool_t ro_changed;
- tsk_bool_t ro_provisional;
- tsk_bool_t state_changed;
- tsk_bool_t mediaType_changed;
-
- //! session type
- tmedia_type_t type;
- //! QoS type
- struct {
- tmedia_qos_stype_t type;
- tmedia_qos_strength_t strength;
- } qos;
-
- //! bandwidth level
- tmedia_bandwidth_level_t bl;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* natt_ctx;
- struct {
- struct tnet_ice_ctx_s *ctx_audio;
- struct tnet_ice_ctx_s *ctx_video;
- struct tnet_ice_ctx_s *ctx_bfcpvid;
- } ice;
-
- /* session error callback */
- struct{
- tmedia_session_onerror_cb_f fun;
- const void* usrdata;
- } onerror_cb;
-
- /* rfc5168 callback */
- struct {
- tmedia_session_rfc5168_cb_f fun;
- const void* usrdata;
- } rfc5168_cb;
-
- //! List of all sessions
- tmedia_sessions_L_t* sessions;
-
- //! User's parameters used to confugure plugins
- tmedia_params_L_t* params;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tmedia_session_mgr_s {
+ TSK_DECLARE_OBJECT;
+
+ //! whether we are the offerer or not
+ tsk_bool_t offerer;
+ //! local IP address or FQDN
+ char* addr;
+ //! public IP address or FQDN
+ char* public_addr;
+ //! whether the @a addr is IPv6 or not (useful when @addr is a FQDN)
+ tsk_bool_t ipv6;
+
+ struct {
+ uint32_t lo_ver;
+ tsdp_message_t* lo;
+
+ int32_t ro_ver;
+ tsdp_message_t* ro;
+ } sdp;
+
+ tsk_bool_t started;
+ tsk_bool_t ro_changed;
+ tsk_bool_t ro_provisional;
+ tsk_bool_t state_changed;
+ tsk_bool_t mediaType_changed;
+
+ //! session type
+ tmedia_type_t type;
+ //! QoS type
+ struct {
+ tmedia_qos_stype_t type;
+ tmedia_qos_strength_t strength;
+ } qos;
+
+ //! bandwidth level
+ tmedia_bandwidth_level_t bl;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* natt_ctx;
+ struct {
+ struct tnet_ice_ctx_s *ctx_audio;
+ struct tnet_ice_ctx_s *ctx_video;
+ struct tnet_ice_ctx_s *ctx_bfcpvid;
+ } ice;
+
+ /* session error callback */
+ struct {
+ tmedia_session_onerror_cb_f fun;
+ const void* usrdata;
+ } onerror_cb;
+
+ /* rfc5168 callback */
+ struct {
+ tmedia_session_rfc5168_cb_f fun;
+ const void* usrdata;
+ } rfc5168_cb;
+
+ //! List of all sessions
+ tmedia_sessions_L_t* sessions;
+
+ //! User's parameters used to confugure plugins
+ tmedia_params_L_t* params;
+
+ TSK_DECLARE_SAFEOBJ;
}
tmedia_session_mgr_t;
-typedef enum tmedia_session_param_type_e
-{
- tmedia_sptype_null = 0,
-
- tmedia_sptype_set,
- tmedia_sptype_get
+typedef enum tmedia_session_param_type_e {
+ tmedia_sptype_null = 0,
+
+ tmedia_sptype_set,
+ tmedia_sptype_get
}
tmedia_session_param_type_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_session_dummy.h b/tinyMEDIA/include/tinymedia/tmedia_session_dummy.h
index a795677..6c3b696 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_session_dummy.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_session_dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,29 +39,26 @@
TMEDIA_BEGIN_DECLS
/** Dummy Audio session */
-typedef struct tmedia_session_daudio_s
-{
- TMEDIA_DECLARE_SESSION_AUDIO;
- uint16_t local_port;
- uint16_t remote_port;
+typedef struct tmedia_session_daudio_s {
+ TMEDIA_DECLARE_SESSION_AUDIO;
+ uint16_t local_port;
+ uint16_t remote_port;
}
tmedia_session_daudio_t;
/** Dummy Video session */
-typedef struct tmedia_session_dvideo_s
-{
- TMEDIA_DECLARE_SESSION_VIDEO;
- uint16_t local_port;
- uint16_t remote_port;
+typedef struct tmedia_session_dvideo_s {
+ TMEDIA_DECLARE_SESSION_VIDEO;
+ uint16_t local_port;
+ uint16_t remote_port;
}
tmedia_session_dvideo_t;
/** Dummy Msrp session */
-typedef struct tmedia_session_dmsrp_s
-{
- TMEDIA_DECLARE_SESSION_MSRP;
- uint16_t local_port;
- uint16_t remote_port;
+typedef struct tmedia_session_dmsrp_s {
+ TMEDIA_DECLARE_SESSION_MSRP;
+ uint16_t local_port;
+ uint16_t remote_port;
}
tmedia_session_dmsrp_t;
diff --git a/tinyMEDIA/include/tinymedia/tmedia_session_ghost.h b/tinyMEDIA/include/tinymedia/tmedia_session_ghost.h
index e4b0ac8..46507da 100755
--- a/tinyMEDIA/include/tinymedia/tmedia_session_ghost.h
+++ b/tinyMEDIA/include/tinymedia/tmedia_session_ghost.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,12 +39,11 @@
TMEDIA_BEGIN_DECLS
/** Ghost session */
-typedef struct tmedia_session_ghost_s
-{
- TMEDIA_DECLARE_SESSION;
- char* media;
- char* proto;
- char* first_format;
+typedef struct tmedia_session_ghost_s {
+ TMEDIA_DECLARE_SESSION;
+ char* media;
+ char* proto;
+ char* first_format;
}
tmedia_session_ghost_t;
diff --git a/tinyMEDIA/include/tinymedia_config.h b/tinyMEDIA/include/tinymedia_config.h
index 7416017..758d97b 100755
--- a/tinyMEDIA/include/tinymedia_config.h
+++ b/tinyMEDIA/include/tinymedia_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -62,13 +62,13 @@
# define TINYMEDIA_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TMEDIA_BEGIN_DECLS extern "C" {
# define TMEDIA_END_DECLS }
#else
-# define TMEDIA_BEGIN_DECLS
+# define TMEDIA_BEGIN_DECLS
# define TMEDIA_END_DECLS
#endif
@@ -92,7 +92,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYMEDIA_CONFIG_H
diff --git a/tinyMEDIA/src/content/tmedia_content.c b/tinyMEDIA/src/content/tmedia_content.c
index bcdf275..0e06d21 100755
--- a/tinyMEDIA/src/content/tmedia_content.c
+++ b/tinyMEDIA/src/content/tmedia_content.c
@@ -32,10 +32,9 @@
/**@defgroup tmedia_content_group Contents
*/
-typedef struct tmedia_content_plugin_entry_s
-{
- const char* type;
- const tmedia_content_plugin_def_t* plugin;
+typedef struct tmedia_content_plugin_entry_s {
+ const char* type;
+ const tmedia_content_plugin_def_t* plugin;
}
tmedia_content_plugin_entry_t;
@@ -45,156 +44,156 @@ tmedia_content_plugin_entry_t __tmedia_content_plugin_entries[TMEDIA_CONTENT_MAX
int tmedia_content_plugin_register(const char* type, const tmedia_content_plugin_def_t* plugin)
{
- tsk_size_t i;
- //-- int a = sizeof(__tmedia_content_plugin_entries);
- if (!plugin || !plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* add or replace the plugin */
- for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS; i++){
- if (!__tmedia_content_plugin_entries[i]->plugin || (__tmedia_content_plugin_entries[i]->plugin == plugin && tsk_striequals(type, __tmedia_content_plugin_entries[i]->type))){
- __tmedia_content_plugin_entries[i]->type = type;
- __tmedia_content_plugin_entries[i]->plugin = plugin;
- return 0;
- }
- }
-
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMEDIA_CONTENT_MAX_PLUGINS);
- return -2;
+ tsk_size_t i;
+ //-- int a = sizeof(__tmedia_content_plugin_entries);
+ if (!plugin || !plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* add or replace the plugin */
+ for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS; i++) {
+ if (!__tmedia_content_plugin_entries[i]->plugin || (__tmedia_content_plugin_entries[i]->plugin == plugin && tsk_striequals(type, __tmedia_content_plugin_entries[i]->type))) {
+ __tmedia_content_plugin_entries[i]->type = type;
+ __tmedia_content_plugin_entries[i]->plugin = plugin;
+ return 0;
+ }
+ }
+
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMEDIA_CONTENT_MAX_PLUGINS);
+ return -2;
}
int tmedia_content_plugin_unregister(const char* type, const tmedia_content_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if (!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- /* find the plugin to unregister */
- for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS && __tmedia_content_plugin_entries[i]->plugin; i++){
- if (__tmedia_content_plugin_entries[i]->plugin == plugin && tsk_striequals(type, __tmedia_content_plugin_entries[i]->type)){
- __tmedia_content_plugin_entries[i]->type = tsk_null,
- __tmedia_content_plugin_entries[i]->plugin = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if (found){
- for (; i < (TMEDIA_CONTENT_MAX_PLUGINS - 1); i++){
- if (__tmedia_content_plugin_entries[i + 1]->plugin){
- __tmedia_content_plugin_entries[i]->type = __tmedia_content_plugin_entries[i + 1]->type,
- __tmedia_content_plugin_entries[i]->plugin = __tmedia_content_plugin_entries[i + 1]->plugin;
- }
- else{
- break;
- }
- }
- __tmedia_content_plugin_entries[i]->type = tsk_null,
- __tmedia_content_plugin_entries[i]->plugin = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if (!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ /* find the plugin to unregister */
+ for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS && __tmedia_content_plugin_entries[i]->plugin; i++) {
+ if (__tmedia_content_plugin_entries[i]->plugin == plugin && tsk_striequals(type, __tmedia_content_plugin_entries[i]->type)) {
+ __tmedia_content_plugin_entries[i]->type = tsk_null,
+ __tmedia_content_plugin_entries[i]->plugin = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if (found) {
+ for (; i < (TMEDIA_CONTENT_MAX_PLUGINS - 1); i++) {
+ if (__tmedia_content_plugin_entries[i + 1]->plugin) {
+ __tmedia_content_plugin_entries[i]->type = __tmedia_content_plugin_entries[i + 1]->type,
+ __tmedia_content_plugin_entries[i]->plugin = __tmedia_content_plugin_entries[i + 1]->plugin;
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_content_plugin_entries[i]->type = tsk_null,
+ __tmedia_content_plugin_entries[i]->plugin = tsk_null;
+ }
+ return (found ? 0 : -2);
}
int tmedia_content_plugin_unregister_all()
{
- tsk_size_t i;
- for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS && __tmedia_content_plugin_entries[i]->plugin; i++){
- __tmedia_content_plugin_entries[i]->type = tsk_null,
- __tmedia_content_plugin_entries[i]->plugin = tsk_null;
- }
- return 0;
+ tsk_size_t i;
+ for (i = 0; i < TMEDIA_CONTENT_MAX_PLUGINS && __tmedia_content_plugin_entries[i]->plugin; i++) {
+ __tmedia_content_plugin_entries[i]->type = tsk_null,
+ __tmedia_content_plugin_entries[i]->plugin = tsk_null;
+ }
+ return 0;
}
tmedia_content_t* tmedia_content_create(const char* type)
{
- tmedia_content_t* content = tsk_null;
- const tmedia_content_plugin_entry_t* entry;
- tsk_size_t i = 0;
-
- while (i < TMEDIA_CONTENT_MAX_PLUGINS){
- entry = __tmedia_content_plugin_entries[i];
- if (!entry->plugin || !entry->type){
- break;
- }
- if (entry->plugin->objdef && tsk_striequals(entry->type, type)){
- if ((content = tsk_object_new(entry->plugin->objdef))){
- content->plugin = entry->plugin;
- content->type = entry->type;
- return content;
- }
- }
- ++i;
- }
-
- TSK_DEBUG_WARN("Failed to find content type (%s) will be added as dummy", type);
- if (tmedia_content_dummy_plugin_def_t){
- content = tsk_object_new(tmedia_content_dummy_plugin_def_t->objdef);
- content->plugin = tmedia_content_dummy_plugin_def_t;
- content->type = type;
- }
-
- return content;
+ tmedia_content_t* content = tsk_null;
+ const tmedia_content_plugin_entry_t* entry;
+ tsk_size_t i = 0;
+
+ while (i < TMEDIA_CONTENT_MAX_PLUGINS) {
+ entry = __tmedia_content_plugin_entries[i];
+ if (!entry->plugin || !entry->type) {
+ break;
+ }
+ if (entry->plugin->objdef && tsk_striequals(entry->type, type)) {
+ if ((content = tsk_object_new(entry->plugin->objdef))) {
+ content->plugin = entry->plugin;
+ content->type = entry->type;
+ return content;
+ }
+ }
+ ++i;
+ }
+
+ TSK_DEBUG_WARN("Failed to find content type (%s) will be added as dummy", type);
+ if (tmedia_content_dummy_plugin_def_t) {
+ content = tsk_object_new(tmedia_content_dummy_plugin_def_t->objdef);
+ content->plugin = tmedia_content_dummy_plugin_def_t;
+ content->type = type;
+ }
+
+ return content;
}
tmedia_content_t* tmedia_content_parse(const void* data, tsk_size_t size, const char* type)
{
- tmedia_content_t* content = tmedia_content_create(type);
- if (content){
- if (content->plugin->parse){
- int ret;
- if ((ret = content->plugin->parse(content, data, size))){
- TSK_DEBUG_ERROR("Failed to parse the content(%d)", ret);
- TSK_OBJECT_SAFE_FREE(content);
- return tsk_null;
- }
- return content;
- }
- else{
- TSK_DEBUG_ERROR("No parser function for this content (%s)", type);
- TSK_OBJECT_SAFE_FREE(content);
- return tsk_null;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to to find content(%s)", type);
- return tsk_null;
- }
+ tmedia_content_t* content = tmedia_content_create(type);
+ if (content) {
+ if (content->plugin->parse) {
+ int ret;
+ if ((ret = content->plugin->parse(content, data, size))) {
+ TSK_DEBUG_ERROR("Failed to parse the content(%d)", ret);
+ TSK_OBJECT_SAFE_FREE(content);
+ return tsk_null;
+ }
+ return content;
+ }
+ else {
+ TSK_DEBUG_ERROR("No parser function for this content (%s)", type);
+ TSK_OBJECT_SAFE_FREE(content);
+ return tsk_null;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to to find content(%s)", type);
+ return tsk_null;
+ }
}
int tmedia_content_init(tmedia_content_t* self)
{
- if (!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
int tmedia_content_deinit(tmedia_content_t* self)
{
- if (!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ return 0;
}
tsk_buffer_t* tmedia_content_get_data(tmedia_content_t* self)
{
- if (!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- return self->plugin->get_data(self);
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ return self->plugin->get_data(self);
}
@@ -202,19 +201,19 @@ tsk_buffer_t* tmedia_content_get_data(tmedia_content_t* self)
static int tmedia_content_dummy_parse(tmedia_content_t* self, const void* in_data, tsk_size_t in_size)
{
- tmedia_content_dummy_t *dummy = TMEDIA_CONTENT_DUMMY(self);
- if (!dummy || dummy->data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- dummy->data = tsk_buffer_create(in_data, in_size);
- return 0;
+ tmedia_content_dummy_t *dummy = TMEDIA_CONTENT_DUMMY(self);
+ if (!dummy || dummy->data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ dummy->data = tsk_buffer_create(in_data, in_size);
+ return 0;
}
static tsk_buffer_t* tmedia_content_dummy_get_data(tmedia_content_t* self)
{
- return tsk_object_ref(TMEDIA_CONTENT_DUMMY(self)->data);
+ return tsk_object_ref(TMEDIA_CONTENT_DUMMY(self)->data);
}
@@ -228,42 +227,40 @@ static tsk_buffer_t* tmedia_content_dummy_get_data(tmedia_content_t* self)
/* constructor */
static tsk_object_t* tmedia_content_dummy_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_content_dummy_t *dummy = self;
- if (dummy){
- /* init base: called by tmedia_content_create() */
- /* init self */
- }
- return self;
+ tmedia_content_dummy_t *dummy = self;
+ if (dummy) {
+ /* init base: called by tmedia_content_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_content_dummy_dtor(tsk_object_t * self)
{
- tmedia_content_dummy_t *dummy = self;
- if (dummy){
- /* deinit base */
- tmedia_content_deinit(TMEDIA_CONTENT(dummy));
- /* deinit self */
- TSK_OBJECT_SAFE_FREE(dummy->data);
- }
-
- return self;
+ tmedia_content_dummy_t *dummy = self;
+ if (dummy) {
+ /* deinit base */
+ tmedia_content_deinit(TMEDIA_CONTENT(dummy));
+ /* deinit self */
+ TSK_OBJECT_SAFE_FREE(dummy->data);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_content_dummy_def_s =
-{
- sizeof(tmedia_content_dummy_t),
- tmedia_content_dummy_ctor,
- tmedia_content_dummy_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_content_dummy_def_s = {
+ sizeof(tmedia_content_dummy_t),
+ tmedia_content_dummy_ctor,
+ tmedia_content_dummy_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_content_plugin_def_t tmedia_content_dummy_plugin_def_s =
-{
- &tmedia_content_dummy_def_s,
+static const tmedia_content_plugin_def_t tmedia_content_dummy_plugin_def_s = {
+ &tmedia_content_dummy_def_s,
- "dummy",
- tmedia_content_dummy_parse,
- tmedia_content_dummy_get_data
+ "dummy",
+ tmedia_content_dummy_parse,
+ tmedia_content_dummy_get_data
};
const tmedia_content_plugin_def_t *tmedia_content_dummy_plugin_def_t = &tmedia_content_dummy_plugin_def_s;
@@ -275,83 +272,82 @@ const tmedia_content_plugin_def_t *tmedia_content_dummy_plugin_def_t = &tmedia_c
tmedia_content_header_t* tmedia_content_header_create(const char* name, const char* value)
{
- tmedia_content_header_t* header = tsk_object_new(tmedia_content_header_def_t);
- const char* str;
-
- if (!header){
- TSK_DEBUG_ERROR("Failed to create new header object");
- return tsk_null;
- }
- header->name = tsk_strdup(name);
- if (value && (str = strstr(value, ";"))){
- header->value = tsk_strndup(value, (tsk_size_t)(str - value));
- header->params = tsk_params_fromstring((str + 1), ";", tsk_true);
- }
- else{
- header->value = tsk_strdup(value);
- }
-
- return header;
+ tmedia_content_header_t* header = tsk_object_new(tmedia_content_header_def_t);
+ const char* str;
+
+ if (!header) {
+ TSK_DEBUG_ERROR("Failed to create new header object");
+ return tsk_null;
+ }
+ header->name = tsk_strdup(name);
+ if (value && (str = strstr(value, ";"))) {
+ header->value = tsk_strndup(value, (tsk_size_t)(str - value));
+ header->params = tsk_params_fromstring((str + 1), ";", tsk_true);
+ }
+ else {
+ header->value = tsk_strdup(value);
+ }
+
+ return header;
}
int tmedia_content_header_deinit(tmedia_content_header_t* self)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_FREE(self->name);
- TSK_FREE(self->value);
- TSK_OBJECT_SAFE_FREE(self->params);
+ TSK_FREE(self->name);
+ TSK_FREE(self->value);
+ TSK_OBJECT_SAFE_FREE(self->params);
- return 0;
+ return 0;
}
char* tmedia_content_header_tostring(const tmedia_content_header_t* self)
{
- char* string = tsk_null;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsk_sprintf(&string, "%s: %s", self->name, self->value);
- if (self->params){
- const tsk_list_item_t* item;
- tsk_list_foreach(item, self->params){
- tsk_strcat_2(&string, ";%s=%s", TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value);
- }
- }
-
- return string;
+ char* string = tsk_null;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsk_sprintf(&string, "%s: %s", self->name, self->value);
+ if (self->params) {
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, self->params) {
+ tsk_strcat_2(&string, ";%s=%s", TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value);
+ }
+ }
+
+ return string;
}
/* constructor */
static tsk_object_t* tmedia_content_header_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_content_header_t *header = self;
- if (header){
- }
- return self;
+ tmedia_content_header_t *header = self;
+ if (header) {
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_content_header_dtor(tsk_object_t * self)
{
- tmedia_content_header_t *header = self;
- if (header){
- tmedia_content_header_deinit(header);
- }
+ tmedia_content_header_t *header = self;
+ if (header) {
+ tmedia_content_header_deinit(header);
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_content_header_def_s =
-{
- sizeof(tmedia_content_header_t),
- tmedia_content_header_ctor,
- tmedia_content_header_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_content_header_def_s = {
+ sizeof(tmedia_content_header_t),
+ tmedia_content_header_ctor,
+ tmedia_content_header_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmedia_content_header_def_t = &tmedia_content_header_def_s;
diff --git a/tinyMEDIA/src/content/tmedia_content_cpim.c b/tinyMEDIA/src/content/tmedia_content_cpim.c
index 8b36727..6fb9f32 100755
--- a/tinyMEDIA/src/content/tmedia_content_cpim.c
+++ b/tinyMEDIA/src/content/tmedia_content_cpim.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmedia_content_cpim.rl" */
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -67,337 +67,349 @@ A complete message looks something like this:
static int tmedia_content_cpim_parse(tmedia_content_t* self, const void* in_data, tsk_size_t in_size)
{
- int cs = 0;
- const char *p = in_data;
- const char *pe = p + in_size;
- const char *eof = pe;
-
- const char *tag_start = tsk_null;
-
- char* hname = tsk_null;
- char* hvalue = tsk_null;
- tsk_bool_t parsing_mime_headers = tsk_true;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 84 "./src/content/tmedia_content_cpim.c" */
-static const char _tmedia_machine_content_cpim_actions[] = {
- 0, 1, 0, 1, 3, 1, 4, 1,
- 5, 2, 0, 4, 2, 0, 5, 2,
- 1, 0, 2, 2, 0
-};
-
-static const char _tmedia_machine_content_cpim_key_offsets[] = {
- 0, 0, 14, 30, 32, 34, 35, 36,
- 51, 52, 66, 82, 84, 86, 87, 88,
- 103, 104, 104
-};
-
-static const char _tmedia_machine_content_cpim_trans_keys[] = {
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 58,
- 13, 32, 13, 10, 13, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 58, 13, 32, 13, 10,
- 13, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 0
-};
-
-static const char _tmedia_machine_content_cpim_single_lengths[] = {
- 0, 4, 6, 2, 2, 1, 1, 5,
- 1, 4, 6, 2, 2, 1, 1, 5,
- 1, 0, 0
-};
-
-static const char _tmedia_machine_content_cpim_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 5,
- 0, 5, 5, 0, 0, 0, 0, 5,
- 0, 0, 0
-};
-
-static const char _tmedia_machine_content_cpim_index_offsets[] = {
- 0, 0, 10, 22, 25, 28, 30, 32,
- 43, 45, 55, 67, 70, 73, 75, 77,
- 88, 90, 91
-};
-
-static const char _tmedia_machine_content_cpim_indicies[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 3, 3, 3, 4, 3,
- 3, 3, 3, 3, 3, 1, 5, 6,
- 1, 8, 6, 7, 10, 9, 11, 1,
- 12, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 1, 14, 1, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 1, 16,
- 17, 17, 17, 18, 17, 17, 17, 17,
- 17, 17, 1, 19, 20, 1, 22, 20,
- 21, 24, 23, 25, 1, 26, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 1,
- 28, 1, 29, 30, 0
-};
-
-static const char _tmedia_machine_content_cpim_trans_targs[] = {
- 2, 0, 3, 2, 4, 3, 4, 5,
- 6, 5, 6, 7, 8, 2, 9, 10,
- 11, 10, 12, 11, 12, 13, 14, 13,
- 14, 15, 16, 10, 17, 18, 18
-};
-
-static const char _tmedia_machine_content_cpim_trans_actions[] = {
- 15, 0, 3, 0, 3, 0, 0, 1,
- 9, 0, 5, 0, 0, 1, 0, 18,
- 3, 0, 3, 0, 0, 1, 9, 0,
- 5, 0, 0, 1, 0, 1, 0
-};
-
-static const char _tmedia_machine_content_cpim_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 12, 7
-};
-
-static const int tmedia_machine_content_cpim_start = 1;
-static const int tmedia_machine_content_cpim_first_final = 17;
-static const int tmedia_machine_content_cpim_error = 0;
-
-static const int tmedia_machine_content_cpim_en_main = 1;
-
-
-/* #line 142 "./ragel/tmedia_content_cpim.rl" */
- (void)(eof);
- (void)(tmedia_machine_content_cpim_first_final);
- (void)(tmedia_machine_content_cpim_error);
- (void)(tmedia_machine_content_cpim_en_main);
-
-/* #line 180 "./src/content/tmedia_content_cpim.c" */
- {
- cs = tmedia_machine_content_cpim_start;
- }
-
-/* #line 147 "./ragel/tmedia_content_cpim.rl" */
-
-/* #line 187 "./src/content/tmedia_content_cpim.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = in_data;
+ const char *pe = p + in_size;
+ const char *eof = pe;
+
+ const char *tag_start = tsk_null;
+
+ char* hname = tsk_null;
+ char* hvalue = tsk_null;
+ tsk_bool_t parsing_mime_headers = tsk_true;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 84 "./src/content/tmedia_content_cpim.c" */
+ static const char _tmedia_machine_content_cpim_actions[] = {
+ 0, 1, 0, 1, 3, 1, 4, 1,
+ 5, 2, 0, 4, 2, 0, 5, 2,
+ 1, 0, 2, 2, 0
+ };
+
+ static const char _tmedia_machine_content_cpim_key_offsets[] = {
+ 0, 0, 14, 30, 32, 34, 35, 36,
+ 51, 52, 66, 82, 84, 86, 87, 88,
+ 103, 104, 104
+ };
+
+ static const char _tmedia_machine_content_cpim_trans_keys[] = {
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 58,
+ 13, 32, 13, 10, 13, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 58, 13, 32, 13, 10,
+ 13, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 0
+ };
+
+ static const char _tmedia_machine_content_cpim_single_lengths[] = {
+ 0, 4, 6, 2, 2, 1, 1, 5,
+ 1, 4, 6, 2, 2, 1, 1, 5,
+ 1, 0, 0
+ };
+
+ static const char _tmedia_machine_content_cpim_range_lengths[] = {
+ 0, 5, 5, 0, 0, 0, 0, 5,
+ 0, 5, 5, 0, 0, 0, 0, 5,
+ 0, 0, 0
+ };
+
+ static const char _tmedia_machine_content_cpim_index_offsets[] = {
+ 0, 0, 10, 22, 25, 28, 30, 32,
+ 43, 45, 55, 67, 70, 73, 75, 77,
+ 88, 90, 91
+ };
+
+ static const char _tmedia_machine_content_cpim_indicies[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 2, 3, 3, 3, 4, 3,
+ 3, 3, 3, 3, 3, 1, 5, 6,
+ 1, 8, 6, 7, 10, 9, 11, 1,
+ 12, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 1, 14, 1, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 1, 16,
+ 17, 17, 17, 18, 17, 17, 17, 17,
+ 17, 17, 1, 19, 20, 1, 22, 20,
+ 21, 24, 23, 25, 1, 26, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 1,
+ 28, 1, 29, 30, 0
+ };
+
+ static const char _tmedia_machine_content_cpim_trans_targs[] = {
+ 2, 0, 3, 2, 4, 3, 4, 5,
+ 6, 5, 6, 7, 8, 2, 9, 10,
+ 11, 10, 12, 11, 12, 13, 14, 13,
+ 14, 15, 16, 10, 17, 18, 18
+ };
+
+ static const char _tmedia_machine_content_cpim_trans_actions[] = {
+ 15, 0, 3, 0, 3, 0, 0, 1,
+ 9, 0, 5, 0, 0, 1, 0, 18,
+ 3, 0, 3, 0, 0, 1, 9, 0,
+ 5, 0, 0, 1, 0, 1, 0
+ };
+
+ static const char _tmedia_machine_content_cpim_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 12, 7
+ };
+
+ static const int tmedia_machine_content_cpim_start = 1;
+ static const int tmedia_machine_content_cpim_first_final = 17;
+ static const int tmedia_machine_content_cpim_error = 0;
+
+ static const int tmedia_machine_content_cpim_en_main = 1;
+
+
+ /* #line 142 "./ragel/tmedia_content_cpim.rl" */
+ (void)(eof);
+ (void)(tmedia_machine_content_cpim_first_final);
+ (void)(tmedia_machine_content_cpim_error);
+ (void)(tmedia_machine_content_cpim_en_main);
+
+ /* #line 180 "./src/content/tmedia_content_cpim.c" */
+ {
+ cs = tmedia_machine_content_cpim_start;
+ }
+
+ /* #line 147 "./ragel/tmedia_content_cpim.rl" */
+
+ /* #line 187 "./src/content/tmedia_content_cpim.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmedia_machine_content_cpim_trans_keys + _tmedia_machine_content_cpim_key_offsets[cs];
- _trans = _tmedia_machine_content_cpim_index_offsets[cs];
-
- _klen = _tmedia_machine_content_cpim_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmedia_machine_content_cpim_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmedia_machine_content_cpim_trans_keys + _tmedia_machine_content_cpim_key_offsets[cs];
+ _trans = _tmedia_machine_content_cpim_index_offsets[cs];
+
+ _klen = _tmedia_machine_content_cpim_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmedia_machine_content_cpim_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmedia_machine_content_cpim_indicies[_trans];
- cs = _tmedia_machine_content_cpim_trans_targs[_trans];
-
- if ( _tmedia_machine_content_cpim_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmedia_machine_content_cpim_actions + _tmedia_machine_content_cpim_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 67 "./ragel/tmedia_content_cpim.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 71 "./ragel/tmedia_content_cpim.rl" */
- {
- parsing_mime_headers = tsk_true;
- }
- break;
- case 2:
-/* #line 75 "./ragel/tmedia_content_cpim.rl" */
- {
- parsing_mime_headers = tsk_false;
- }
- break;
- case 3:
-/* #line 79 "./ragel/tmedia_content_cpim.rl" */
- {
- TSK_PARSER_SET_STRING(hname);
- }
- break;
- case 4:
-/* #line 83 "./ragel/tmedia_content_cpim.rl" */
- {
- tmedia_content_header_t* header;
- TSK_PARSER_SET_STRING(hvalue);
- header = tmedia_content_header_create(hname, hvalue);
- TSK_FREE(hname); TSK_FREE(hvalue);
-
- if(parsing_mime_headers){
- if(!TMEDIA_CONTENT_CPIM(self)->m_headers){
- TMEDIA_CONTENT_CPIM(self)->m_headers = tsk_list_create();
- }
- tsk_list_push_back_data(TMEDIA_CONTENT_CPIM(self)->m_headers, (void**)&header);
- }
- else{
- if(!TMEDIA_CONTENT_CPIM(self)->h_headers){
- TMEDIA_CONTENT_CPIM(self)->h_headers = tsk_list_create();
- }
- tsk_list_push_back_data(TMEDIA_CONTENT_CPIM(self)->h_headers, (void**)&header);
- }
- }
- break;
-/* #line 307 "./src/content/tmedia_content_cpim.c" */
- }
- }
+ _trans = _tmedia_machine_content_cpim_indicies[_trans];
+ cs = _tmedia_machine_content_cpim_trans_targs[_trans];
+
+ if ( _tmedia_machine_content_cpim_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmedia_machine_content_cpim_actions + _tmedia_machine_content_cpim_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 67 "./ragel/tmedia_content_cpim.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 71 "./ragel/tmedia_content_cpim.rl" */
+ {
+ parsing_mime_headers = tsk_true;
+ }
+ break;
+ case 2:
+ /* #line 75 "./ragel/tmedia_content_cpim.rl" */
+ {
+ parsing_mime_headers = tsk_false;
+ }
+ break;
+ case 3:
+ /* #line 79 "./ragel/tmedia_content_cpim.rl" */
+ {
+ TSK_PARSER_SET_STRING(hname);
+ }
+ break;
+ case 4:
+ /* #line 83 "./ragel/tmedia_content_cpim.rl" */
+ {
+ tmedia_content_header_t* header;
+ TSK_PARSER_SET_STRING(hvalue);
+ header = tmedia_content_header_create(hname, hvalue);
+ TSK_FREE(hname);
+ TSK_FREE(hvalue);
+
+ if(parsing_mime_headers) {
+ if(!TMEDIA_CONTENT_CPIM(self)->m_headers) {
+ TMEDIA_CONTENT_CPIM(self)->m_headers = tsk_list_create();
+ }
+ tsk_list_push_back_data(TMEDIA_CONTENT_CPIM(self)->m_headers, (void**)&header);
+ }
+ else {
+ if(!TMEDIA_CONTENT_CPIM(self)->h_headers) {
+ TMEDIA_CONTENT_CPIM(self)->h_headers = tsk_list_create();
+ }
+ tsk_list_push_back_data(TMEDIA_CONTENT_CPIM(self)->h_headers, (void**)&header);
+ }
+ }
+ break;
+ /* #line 307 "./src/content/tmedia_content_cpim.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmedia_machine_content_cpim_actions + _tmedia_machine_content_cpim_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 67 "./ragel/tmedia_content_cpim.rl" */
- {
- tag_start = p;
- }
- break;
- case 5:
-/* #line 103 "./ragel/tmedia_content_cpim.rl" */
- {
- int len = (int)(p - tag_start);
- if(len && tag_start){
- if(TMEDIA_CONTENT_CPIM(self)->e){
- TSK_OBJECT_SAFE_FREE(TMEDIA_CONTENT_CPIM(self)->e); \
- }
- TMEDIA_CONTENT_CPIM(self)->e = tsk_buffer_create(tag_start, len);
- }
- }
- break;
-/* #line 341 "./src/content/tmedia_content_cpim.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 148 "./ragel/tmedia_content_cpim.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- TSK_FREE(hname);
- TSK_FREE(hvalue);
-
- if( cs <
-/* #line 356 "./src/content/tmedia_content_cpim.c" */
-17
-/* #line 153 "./ragel/tmedia_content_cpim.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse CPIM content");
- return -1;
- }
-
- return 0;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmedia_machine_content_cpim_actions + _tmedia_machine_content_cpim_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 67 "./ragel/tmedia_content_cpim.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 5:
+ /* #line 103 "./ragel/tmedia_content_cpim.rl" */
+ {
+ int len = (int)(p - tag_start);
+ if(len && tag_start) {
+ if(TMEDIA_CONTENT_CPIM(self)->e) {
+ TSK_OBJECT_SAFE_FREE(TMEDIA_CONTENT_CPIM(self)->e);
+ \
+ }
+ TMEDIA_CONTENT_CPIM(self)->e = tsk_buffer_create(tag_start, len);
+ }
+ }
+ break;
+ /* #line 341 "./src/content/tmedia_content_cpim.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 148 "./ragel/tmedia_content_cpim.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ TSK_FREE(hname);
+ TSK_FREE(hvalue);
+
+ if( cs <
+ /* #line 356 "./src/content/tmedia_content_cpim.c" */
+ 17
+ /* #line 153 "./ragel/tmedia_content_cpim.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse CPIM content");
+ return -1;
+ }
+
+ return 0;
}
static tsk_buffer_t* tmedia_content_cpim_get_data(tmedia_content_t* self)
{
- tsk_buffer_t* data = tsk_buffer_create_null();
- tmedia_content_cpim_t *cpim = TMEDIA_CONTENT_CPIM(self);
- const tsk_list_item_t* item;
- /*
- m: Content-type: Message/CPIM
- s:
- h: (message-metadata-headers)
- s:
- e: (encapsulated MIME message-body)
- x: MIME security multipart message wrapper
- */
- if(cpim->m_headers){
- tsk_list_foreach(item, cpim->m_headers){
- char* hstring = tmedia_content_header_tostring(TMEDIA_CONTENT_HEADER(item->data));
- tsk_buffer_append_2(data, TSK_LIST_IS_LAST(cpim->m_headers, item) ? "%s\r\n\r\n" : "%s\r\n", hstring);
- TSK_FREE(hstring);
- }
- }
- if(cpim->h_headers){
- tsk_list_foreach(item, cpim->h_headers){
- char* hstring = tmedia_content_header_tostring(TMEDIA_CONTENT_HEADER(item->data));
- tsk_buffer_append_2(data, TSK_LIST_IS_LAST(cpim->h_headers, item) ? "%s\r\n\r\n" : "%s\r\n", hstring);
- TSK_FREE(hstring);
- }
- }
- if(cpim->e){
- tsk_buffer_append(data, TSK_BUFFER_DATA(cpim->e), TSK_BUFFER_SIZE(cpim->e));
- }
- if(cpim->x){
- tsk_buffer_append(data, TSK_BUFFER_DATA(cpim->x), TSK_BUFFER_SIZE(cpim->x));
- }
-
- return data;
+ tsk_buffer_t* data = tsk_buffer_create_null();
+ tmedia_content_cpim_t *cpim = TMEDIA_CONTENT_CPIM(self);
+ const tsk_list_item_t* item;
+ /*
+ m: Content-type: Message/CPIM
+ s:
+ h: (message-metadata-headers)
+ s:
+ e: (encapsulated MIME message-body)
+ x: MIME security multipart message wrapper
+ */
+ if(cpim->m_headers) {
+ tsk_list_foreach(item, cpim->m_headers) {
+ char* hstring = tmedia_content_header_tostring(TMEDIA_CONTENT_HEADER(item->data));
+ tsk_buffer_append_2(data, TSK_LIST_IS_LAST(cpim->m_headers, item) ? "%s\r\n\r\n" : "%s\r\n", hstring);
+ TSK_FREE(hstring);
+ }
+ }
+ if(cpim->h_headers) {
+ tsk_list_foreach(item, cpim->h_headers) {
+ char* hstring = tmedia_content_header_tostring(TMEDIA_CONTENT_HEADER(item->data));
+ tsk_buffer_append_2(data, TSK_LIST_IS_LAST(cpim->h_headers, item) ? "%s\r\n\r\n" : "%s\r\n", hstring);
+ TSK_FREE(hstring);
+ }
+ }
+ if(cpim->e) {
+ tsk_buffer_append(data, TSK_BUFFER_DATA(cpim->e), TSK_BUFFER_SIZE(cpim->e));
+ }
+ if(cpim->x) {
+ tsk_buffer_append(data, TSK_BUFFER_DATA(cpim->x), TSK_BUFFER_SIZE(cpim->x));
+ }
+
+ return data;
}
//=================================================================================================
@@ -406,44 +418,42 @@ static tsk_buffer_t* tmedia_content_cpim_get_data(tmedia_content_t* self)
/* constructor */
static tsk_object_t* tmedia_content_cpim_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_content_cpim_t *cpim = self;
- if(cpim){
- /* init base: called by tmedia_content_create() */
- /* init self */
- }
- return self;
+ tmedia_content_cpim_t *cpim = self;
+ if(cpim) {
+ /* init base: called by tmedia_content_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_content_cpim_dtor(tsk_object_t * self)
-{
- tmedia_content_cpim_t *cpim = self;
- if(cpim){
- /* deinit base */
- tmedia_content_deinit(TMEDIA_CONTENT(cpim));
- /* deinit self */
- TSK_OBJECT_SAFE_FREE(cpim->m_headers);
- TSK_OBJECT_SAFE_FREE(cpim->h_headers);
- TSK_OBJECT_SAFE_FREE(cpim->e);
- TSK_OBJECT_SAFE_FREE(cpim->x);
- }
-
- return self;
+{
+ tmedia_content_cpim_t *cpim = self;
+ if(cpim) {
+ /* deinit base */
+ tmedia_content_deinit(TMEDIA_CONTENT(cpim));
+ /* deinit self */
+ TSK_OBJECT_SAFE_FREE(cpim->m_headers);
+ TSK_OBJECT_SAFE_FREE(cpim->h_headers);
+ TSK_OBJECT_SAFE_FREE(cpim->e);
+ TSK_OBJECT_SAFE_FREE(cpim->x);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_content_cpim_def_s =
-{
- sizeof(tmedia_content_cpim_t),
- tmedia_content_cpim_ctor,
- tmedia_content_cpim_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_content_cpim_def_s = {
+ sizeof(tmedia_content_cpim_t),
+ tmedia_content_cpim_ctor,
+ tmedia_content_cpim_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_content_plugin_def_t tmedia_content_cpim_plugin_def_s =
-{
- &tmedia_content_cpim_def_s,
+static const tmedia_content_plugin_def_t tmedia_content_cpim_plugin_def_s = {
+ &tmedia_content_cpim_def_s,
- TMEDIA_CONTENT_CPIM_TYPE,
- tmedia_content_cpim_parse,
- tmedia_content_cpim_get_data
+ TMEDIA_CONTENT_CPIM_TYPE,
+ tmedia_content_cpim_parse,
+ tmedia_content_cpim_get_data
};
const tmedia_content_plugin_def_t *tmedia_content_cpim_plugin_def_t = &tmedia_content_cpim_plugin_def_s; \ No newline at end of file
diff --git a/tinyMEDIA/src/tmedia.c b/tinyMEDIA/src/tmedia.c
index f43b4fa..daa907f 100755
--- a/tinyMEDIA/src/tmedia.c
+++ b/tinyMEDIA/src/tmedia.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,201 +40,201 @@ const tmedia_plugin_def_t* __tmedia_plugins[TMED_MAX_PLUGINS] = {0};
tmedia_t* tmedia_create(const char* name, const char* host, tnet_socket_type_t socket_type)
{
- return tsk_object_new(TMEDIA_VA_ARGS(name, host, socket_type));
+ return tsk_object_new(TMEDIA_VA_ARGS(name, host, socket_type));
}
tmedia_t* tmedia_create_null()
{
- return tmedia_create(tsk_null, TNET_SOCKET_HOST_ANY, tnet_socket_type_invalid);
+ return tmedia_create(tsk_null, TNET_SOCKET_HOST_ANY, tnet_socket_type_invalid);
}
int tmedia_init(tmedia_t* self, const char* name)
{
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- tsk_strupdate(&self->name, name);
+ tsk_strupdate(&self->name, name);
- return 0;
+ return 0;
}
int tmedia_deinit(tmedia_t* self)
{
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- TSK_FREE(self->name);
- TSK_FREE(self->protocol);
+ TSK_FREE(self->name);
+ TSK_FREE(self->protocol);
- return 0;
+ return 0;
}
int tmedia_plugin_register(const tmedia_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for(i=0; i<TMED_MAX_PLUGINS; i++){
- if(!__tmedia_plugins[i] || __tmedia_plugins[i] == plugin){
- __tmedia_plugins[i] = plugin;
- return 0;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_MAX_PLUGINS);
- return -2;
+ tsk_size_t i;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for(i=0; i<TMED_MAX_PLUGINS; i++) {
+ if(!__tmedia_plugins[i] || __tmedia_plugins[i] == plugin) {
+ __tmedia_plugins[i] = plugin;
+ return 0;
+ }
+ }
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_MAX_PLUGINS);
+ return -2;
}
tmedia_t* tmedia_factory_create(const char* name, const char* host, tnet_socket_type_t socket_type)
{
- tmedia_t* ret = tsk_null;
- const tmedia_plugin_def_t* plugin;
- tsk_size_t i = 0;
-
- while((i < TMED_MAX_PLUGINS) && (plugin = __tmedia_plugins[i++])){
- if(plugin->objdef && tsk_strequals(plugin->name, name)){
- if((ret = tsk_object_new(plugin->objdef, name, host, socket_type))){
- ret->plugin = plugin;
- break;
- }
- }
- }
-
- return ret;
+ tmedia_t* ret = tsk_null;
+ const tmedia_plugin_def_t* plugin;
+ tsk_size_t i = 0;
+
+ while((i < TMED_MAX_PLUGINS) && (plugin = __tmedia_plugins[i++])) {
+ if(plugin->objdef && tsk_strequals(plugin->name, name)) {
+ if((ret = tsk_object_new(plugin->objdef, name, host, socket_type))) {
+ ret->plugin = plugin;
+ break;
+ }
+ }
+ }
+
+ return ret;
}
int tmedia_start(tmedia_t* self)
{
- if(!self || !self->plugin){
- return -1;
- }
-
- if(!self->plugin->start){
- return -2;
- }
- else{
- return self->plugin->start(self);
- }
+ if(!self || !self->plugin) {
+ return -1;
+ }
+
+ if(!self->plugin->start) {
+ return -2;
+ }
+ else {
+ return self->plugin->start(self);
+ }
}
int tmedia_pause(tmedia_t*self )
{
- if(!self || !self->plugin){
- return -1;
- }
-
- if(!self->plugin->pause){
- return -2;
- }
- else{
- return self->plugin->pause(self);
- }
+ if(!self || !self->plugin) {
+ return -1;
+ }
+
+ if(!self->plugin->pause) {
+ return -2;
+ }
+ else {
+ return self->plugin->pause(self);
+ }
}
int tmedia_stop(tmedia_t* self)
{
- if(!self || !self->plugin){
- return -1;
- }
-
- if(!self->plugin->stop){
- return -2;
- }
- else{
- return self->plugin->stop(self);
- }
+ if(!self || !self->plugin) {
+ return -1;
+ }
+
+ if(!self->plugin->stop) {
+ return -2;
+ }
+ else {
+ return self->plugin->stop(self);
+ }
}
// Only SDP headers
const tsdp_header_M_t* tmedia_get_local_offer(tmedia_t* self, ...)
{
-
- if(!self || !self->plugin){
- return tsk_null;
- }
-
- if(!self->plugin->get_local_offer){
- return tsk_null;
- }
- else{
- va_list ap;
- const tsdp_header_M_t* M;
- va_start(ap, self);
- M = self->plugin->get_local_offer(self, &ap);
- va_end(ap);
- return M;
- }
+
+ if(!self || !self->plugin) {
+ return tsk_null;
+ }
+
+ if(!self->plugin->get_local_offer) {
+ return tsk_null;
+ }
+ else {
+ va_list ap;
+ const tsdp_header_M_t* M;
+ va_start(ap, self);
+ M = self->plugin->get_local_offer(self, &ap);
+ va_end(ap);
+ return M;
+ }
}
const tsdp_header_M_t* tmedia_get_negotiated_offer(tmedia_t* self)
{
- if(!self || !self->plugin){
- return tsk_null;
- }
-
- if(!self->plugin->get_negotiated_offer){
- return tsk_null;
- }
- else{
- return self->plugin->get_negotiated_offer(self);
- }
+ if(!self || !self->plugin) {
+ return tsk_null;
+ }
+
+ if(!self->plugin->get_negotiated_offer) {
+ return tsk_null;
+ }
+ else {
+ return self->plugin->get_negotiated_offer(self);
+ }
}
int tmedia_set_remote_offer(tmedia_t* self, const tsdp_message_t* offer)
{
- if(!self || !self->plugin){
- return -1;
- }
-
- if(!self->plugin->set_remote_offer){
- return -2;
- }
- else{
- return self->plugin->set_remote_offer(self, offer);
- }
+ if(!self || !self->plugin) {
+ return -1;
+ }
+
+ if(!self->plugin->set_remote_offer) {
+ return -2;
+ }
+ else {
+ return self->plugin->set_remote_offer(self, offer);
+ }
}
int tmedia_perform(tmedia_t* self, tmedia_action_t action, ... )
{
- int ret = -1;
-
- if(!self || !self->plugin){
- return -1;
- }
-
- if(!self->plugin->perform){
- return -2;
- }
- else{
- const tsk_object_def_t* objdef;
- tsk_param_t *param;
- tsk_params_L_t* params;
- va_list ap;
-
- va_start(ap, action);
- params = tsk_list_create();
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if(objdef != tsk_param_def_t){ // sanity check
- break;
- }
- if((param = tsk_object_new_2(objdef, &ap))){
- tsk_params_add_param_2(&params, param);
- TSK_OBJECT_SAFE_FREE(param);
- }
- }
-
- // Perform
- ret = self->plugin->perform(self, action, params);
-
- TSK_OBJECT_SAFE_FREE(params);
- va_end(ap);
-
- return ret;
- }
+ int ret = -1;
+
+ if(!self || !self->plugin) {
+ return -1;
+ }
+
+ if(!self->plugin->perform) {
+ return -2;
+ }
+ else {
+ const tsk_object_def_t* objdef;
+ tsk_param_t *param;
+ tsk_params_L_t* params;
+ va_list ap;
+
+ va_start(ap, action);
+ params = tsk_list_create();
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if(objdef != tsk_param_def_t) { // sanity check
+ break;
+ }
+ if((param = tsk_object_new_2(objdef, &ap))) {
+ tsk_params_add_param_2(&params, param);
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ }
+
+ // Perform
+ ret = self->plugin->perform(self, action, params);
+
+ TSK_OBJECT_SAFE_FREE(params);
+ va_end(ap);
+
+ return ret;
+ }
}
//========================================================
@@ -243,44 +243,43 @@ int tmedia_perform(tmedia_t* self, tmedia_action_t action, ... )
static void* tmedia_ctor(tsk_object_t *self, va_list * app)
{
- tmedia_t *media = self;
- if(media){
- const char* name = va_arg(*app, const char*);
- const char* host = va_arg(*app, const char*);
- tnet_socket_type_t socket_type = va_arg(*app, tnet_socket_type_t);
-
- tmedia_init(media, name);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new media.");
- }
- return self;
+ tmedia_t *media = self;
+ if(media) {
+ const char* name = va_arg(*app, const char*);
+ const char* host = va_arg(*app, const char*);
+ tnet_socket_type_t socket_type = va_arg(*app, tnet_socket_type_t);
+
+ tmedia_init(media, name);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new media.");
+ }
+ return self;
}
static void* tmedia_dtor(tsk_object_t *self)
{
- tmedia_t *media = self;
- if(media){
- tmedia_deinit(media);
- }
- else{
- TSK_DEBUG_ERROR("Null media.");
- }
-
- return self;
+ tmedia_t *media = self;
+ if(media) {
+ tmedia_deinit(media);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null media.");
+ }
+
+ return self;
}
static int tmedia_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tmedia_def_s =
-{
- sizeof(tmedia_t),
- tmedia_ctor,
- tmedia_dtor,
- tmedia_cmp
+static const tsk_object_def_t tmedia_def_s = {
+ sizeof(tmedia_t),
+ tmedia_ctor,
+ tmedia_dtor,
+ tmedia_cmp
};
const void *tmedia_def_t = &tmedia_def_s;
diff --git a/tinyMEDIA/src/tmedia_codec.c b/tinyMEDIA/src/tmedia_codec.c
index 2b2b140..a5fb8e2 100755
--- a/tinyMEDIA/src/tmedia_codec.c
+++ b/tinyMEDIA/src/tmedia_codec.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,23 +48,23 @@ const tmedia_codec_plugin_def_t* __tmedia_codec_plugins[TMED_CODEC_MAX_PLUGINS]
/*== Predicate function to find a codec object by format */
static int __pred_find_codec_by_format(const tsk_list_item_t *item, const void *format)
{
- if(item && item->data){
- return tsk_strcmp(((tmedia_codec_t *)item->data)->format, format);
- }
- return -1;
+ if(item && item->data) {
+ return tsk_strcmp(((tmedia_codec_t *)item->data)->format, format);
+ }
+ return -1;
}
/*== Predicate function to find a codec object by negociated format */
static int __pred_find_codec_by_neg_format(const tsk_list_item_t *item, const void *format)
{
- if(item && item->data){
- return tsk_strcmp(((tmedia_codec_t *)item->data)->neg_format, format);
- }
- return -1;
+ if(item && item->data) {
+ return tsk_strcmp(((tmedia_codec_t *)item->data)->neg_format, format);
+ }
+ return -1;
}
/**@ingroup tmedia_codec_group
-* Initialize a Codec
+* Initialize a Codec
* @param self The codec to initialize. Could be any type of codec (e.g. @ref tmedia_codec_audio_t or @ref tmedia_codec_video_t).
* @param type
* @param name the name of the codec. e.g. "G.711u" or "G.711a" etc used in the sdp.
@@ -74,71 +74,107 @@ static int __pred_find_codec_by_neg_format(const tsk_list_item_t *item, const vo
*/
int tmedia_codec_init(tmedia_codec_t* self, tmedia_type_t type, const char* name, const char* desc, const char* format)
{
- if(!self || tsk_strnullORempty(name)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->type = type;
- tsk_strupdate(&self->name, name);
- tsk_strupdate(&self->desc,desc);
- tsk_strupdate(&self->format, format);
- if(!self->bandwidth_max_upload) self->bandwidth_max_upload = (type == tmedia_video ? tmedia_defaults_get_bandwidth_video_upload_max() : INT_MAX); // INT_MAX or <=0 means undefined
- if(!self->bandwidth_max_download) self->bandwidth_max_download = (type == tmedia_video ? tmedia_defaults_get_bandwidth_video_download_max() : INT_MAX); // INT_MAX or <=0 means undefined
- if(!self->in.rate) self->in.rate = self->plugin->rate;
- if(!self->out.rate) self->out.rate = self->plugin->rate;
-
- if(type & tmedia_audio){
- tmedia_codec_audio_t* audio = TMEDIA_CODEC_AUDIO(self);
- if(!audio->in.ptime) audio->in.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
- if(!audio->out.ptime) audio->out.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
- if(!audio->in.channels) audio->in.channels = self->plugin->audio.channels;
- if(!audio->out.channels) audio->out.channels = self->plugin->audio.channels;
- if(!audio->in.timestamp_multiplier) audio->in.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(self->id, self->in.rate);
- if(!audio->out.timestamp_multiplier) audio->out.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(self->id, self->out.rate);
- }
- // Video flipping: For backward compatibility we have to initialize the default values
- // according to the CFLAGS: 'FLIP_ENCODED_PICT' and 'FLIP_DECODED_PICT'. At any time you
- // can update thse values (e.g. when the device switch from landscape to portrait) using video_session->set();
- else if(type & tmedia_video){
- tmedia_codec_video_t* video = TMEDIA_CODEC_VIDEO(self);
+ if(!self || tsk_strnullORempty(name)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->type = type;
+ tsk_strupdate(&self->name, name);
+ tsk_strupdate(&self->desc,desc);
+ tsk_strupdate(&self->format, format);
+ if(!self->bandwidth_max_upload) {
+ self->bandwidth_max_upload = (type == tmedia_video ? tmedia_defaults_get_bandwidth_video_upload_max() : INT_MAX); // INT_MAX or <=0 means undefined
+ }
+ if(!self->bandwidth_max_download) {
+ self->bandwidth_max_download = (type == tmedia_video ? tmedia_defaults_get_bandwidth_video_download_max() : INT_MAX); // INT_MAX or <=0 means undefined
+ }
+ if(!self->in.rate) {
+ self->in.rate = self->plugin->rate;
+ }
+ if(!self->out.rate) {
+ self->out.rate = self->plugin->rate;
+ }
+
+ if(type & tmedia_audio) {
+ tmedia_codec_audio_t* audio = TMEDIA_CODEC_AUDIO(self);
+ if(!audio->in.ptime) {
+ audio->in.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
+ }
+ if(!audio->out.ptime) {
+ audio->out.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
+ }
+ if(!audio->in.channels) {
+ audio->in.channels = self->plugin->audio.channels;
+ }
+ if(!audio->out.channels) {
+ audio->out.channels = self->plugin->audio.channels;
+ }
+ if(!audio->in.timestamp_multiplier) {
+ audio->in.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(self->id, self->in.rate);
+ }
+ if(!audio->out.timestamp_multiplier) {
+ audio->out.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(self->id, self->out.rate);
+ }
+ }
+ // Video flipping: For backward compatibility we have to initialize the default values
+ // according to the CFLAGS: 'FLIP_ENCODED_PICT' and 'FLIP_DECODED_PICT'. At any time you
+ // can update thse values (e.g. when the device switch from landscape to portrait) using video_session->set();
+ else if(type & tmedia_video) {
+ tmedia_codec_video_t* video = TMEDIA_CODEC_VIDEO(self);
#if FLIP_ENCODED_PICT
- video->out.flip = tsk_true;
+ video->out.flip = tsk_true;
#endif
#if FLIP_DECODED_PICT
- video->in.flip = tsk_true;
+ video->in.flip = tsk_true;
#endif
- if(!video->in.fps) video->in.fps = self->plugin->video.fps ? self->plugin->video.fps : tmedia_defaults_get_video_fps();
- if(!video->out.fps) video->out.fps = self->plugin->video.fps ? self->plugin->video.fps : tmedia_defaults_get_video_fps();
- if(video->in.chroma == tmedia_chroma_none) video->in.chroma = tmedia_chroma_yuv420p;
- if(video->out.chroma == tmedia_chroma_none) video->out.chroma = tmedia_chroma_yuv420p;
-
- if(0){ // @deprecated
- if(!video->in.width) video->in.width = video->out.width = self->plugin->video.width;
- if(!video->in.height) video->in.height = video->out.height = self->plugin->video.height;
- }
- else{
- int ret;
- unsigned width, height;
- video->pref_size = tmedia_defaults_get_pref_video_size();
- if((ret = tmedia_video_get_size(video->pref_size, &width, &height)) != 0){
- width = self->plugin->video.width;
- height = self->plugin->video.height;
- }
- if(!video->in.width) video->in.width = video->out.width = width;
- if(!video->in.height) video->in.height = video->out.height = height;
- }
-
- }
-
- return 0;
+ if(!video->in.fps) {
+ video->in.fps = self->plugin->video.fps ? self->plugin->video.fps : tmedia_defaults_get_video_fps();
+ }
+ if(!video->out.fps) {
+ video->out.fps = self->plugin->video.fps ? self->plugin->video.fps : tmedia_defaults_get_video_fps();
+ }
+ if(video->in.chroma == tmedia_chroma_none) {
+ video->in.chroma = tmedia_chroma_yuv420p;
+ }
+ if(video->out.chroma == tmedia_chroma_none) {
+ video->out.chroma = tmedia_chroma_yuv420p;
+ }
+
+ if(0) { // @deprecated
+ if(!video->in.width) {
+ video->in.width = video->out.width = self->plugin->video.width;
+ }
+ if(!video->in.height) {
+ video->in.height = video->out.height = self->plugin->video.height;
+ }
+ }
+ else {
+ int ret;
+ unsigned width, height;
+ video->pref_size = tmedia_defaults_get_pref_video_size();
+ if((ret = tmedia_video_get_size(video->pref_size, &width, &height)) != 0) {
+ width = self->plugin->video.width;
+ height = self->plugin->video.height;
+ }
+ if(!video->in.width) {
+ video->in.width = video->out.width = width;
+ }
+ if(!video->in.height) {
+ video->in.height = video->out.height = height;
+ }
+ }
+
+ }
+
+ return 0;
}
int tmedia_codec_set(tmedia_codec_t* self, const struct tmedia_param_s* param)
{
- if(self && self->plugin && self->plugin->set && param){
- return self->plugin->set(self, param);
- }
- return 0;
+ if(self && self->plugin && self->plugin->set && param) {
+ return self->plugin->set(self, param);
+ }
+ return 0;
}
/**@ingroup tmedia_codec_group
@@ -149,30 +185,30 @@ int tmedia_codec_set(tmedia_codec_t* self, const struct tmedia_param_s* param)
*/
int tmedia_codec_open(tmedia_codec_t* self)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->opened){
- TSK_DEBUG_WARN("Codec already opened");
- return 0;
- }
-
- if(self->plugin->open){
- int ret;
- if((ret = self->plugin->open(self))){
- TSK_DEBUG_ERROR("Failed to open [%s] codec", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_true;
- return 0;
- }
- }
- else{
- self->opened = tsk_true;
- return 0;
- }
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->opened) {
+ TSK_DEBUG_WARN("Codec already opened");
+ return 0;
+ }
+
+ if(self->plugin->open) {
+ int ret;
+ if((ret = self->plugin->open(self))) {
+ TSK_DEBUG_ERROR("Failed to open [%s] codec", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
}
/**@ingroup tmedia_codec_group
@@ -183,30 +219,30 @@ int tmedia_codec_open(tmedia_codec_t* self)
*/
int tmedia_codec_close(tmedia_codec_t* self)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->opened){
- return 0;
- }
-
- if(self->plugin->close){
- int ret;
-
- if((ret = self->plugin->close(self))){
- TSK_DEBUG_ERROR("Failed to close [%s] codec", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->opened) {
+ return 0;
+ }
+
+ if(self->plugin->close) {
+ int ret;
+
+ if((ret = self->plugin->close(self))) {
+ TSK_DEBUG_ERROR("Failed to close [%s] codec", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
}
/**@ingroup tmedia_codec_group
@@ -220,17 +256,17 @@ int tmedia_codec_close(tmedia_codec_t* self)
*/
int tmedia_codec_cmp(const tsk_object_t* codec1, const tsk_object_t* codec2)
{
- const tmedia_codec_t* _c1 = codec1;
- const tmedia_codec_t* _c2 = codec2;
-
- if((_c1 && _c2) && (_c1->type == _c2->type)){
- /* Do not compare names. For example, H264 base profile 1.0 will have the
- * same name than H264 base profile 3.0. */
- return tsk_stricmp(_c1->format, _c2->format);
- }
- else{
- return -1;
- }
+ const tmedia_codec_t* _c1 = codec1;
+ const tmedia_codec_t* _c2 = codec2;
+
+ if((_c1 && _c2) && (_c1->type == _c2->type)) {
+ /* Do not compare names. For example, H264 base profile 1.0 will have the
+ * same name than H264 base profile 3.0. */
+ return tsk_stricmp(_c1->format, _c2->format);
+ }
+ else {
+ return -1;
+ }
}
/**@ingroup tmedia_codec_group
@@ -241,65 +277,65 @@ int tmedia_codec_cmp(const tsk_object_t* codec1, const tsk_object_t* codec2)
*/
int tmedia_codec_plugin_register(const tmedia_codec_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin || tsk_strnullORempty(plugin->name) || tsk_strnullORempty(plugin->format)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* add or replace the plugin */
- for(i = 0; i<TMED_CODEC_MAX_PLUGINS; i++){
- if(!__tmedia_codec_plugins[i] || (__tmedia_codec_plugins[i] == plugin)){
- __tmedia_codec_plugins[i] = plugin;
- TSK_DEBUG_INFO("Register codec: %s, %s", plugin->name, plugin->desc);
- return 0;
- }
- if(__tmedia_codec_plugins[i]->codec_id == plugin->codec_id && plugin->codec_id != tmedia_codec_id_none){ // 'tmedia_codec_id_none' is used for fake codecs
- TSK_DEBUG_INFO("Codec Registration: '%s' ignored because '%s' already registered", plugin->desc, __tmedia_codec_plugins[i]->desc);
- return -3;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CODEC_MAX_PLUGINS);
- return -2;
+ tsk_size_t i;
+ if(!plugin || tsk_strnullORempty(plugin->name) || tsk_strnullORempty(plugin->format)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* add or replace the plugin */
+ for(i = 0; i<TMED_CODEC_MAX_PLUGINS; i++) {
+ if(!__tmedia_codec_plugins[i] || (__tmedia_codec_plugins[i] == plugin)) {
+ __tmedia_codec_plugins[i] = plugin;
+ TSK_DEBUG_INFO("Register codec: %s, %s", plugin->name, plugin->desc);
+ return 0;
+ }
+ if(__tmedia_codec_plugins[i]->codec_id == plugin->codec_id && plugin->codec_id != tmedia_codec_id_none) { // 'tmedia_codec_id_none' is used for fake codecs
+ TSK_DEBUG_INFO("Codec Registration: '%s' ignored because '%s' already registered", plugin->desc, __tmedia_codec_plugins[i]->desc);
+ return -3;
+ }
+ }
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CODEC_MAX_PLUGINS);
+ return -2;
}
int tmedia_codec_plugin_register_2(const tmedia_codec_plugin_def_t* plugin, int prio)
{
- tsk_size_t count = 0;
- tsk_bool_t already_registered = tsk_false;
- const tmedia_codec_plugin_def_t* tmp;
- if(!plugin || tsk_strnullORempty(plugin->name) || tsk_strnullORempty(plugin->format) || (prio + 1) >= TMED_CODEC_MAX_PLUGINS){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // count codecs and found if already registered
- while(__tmedia_codec_plugins[count]){
- if(__tmedia_codec_plugins[count] == plugin){
- already_registered = tsk_true;
- }
- ++count;
- }
-
- if(count >= TMED_CODEC_MAX_PLUGINS){
- TSK_DEBUG_ERROR("No room");
- return -1;
- }
-
- // unregister and compact
- if(already_registered){
- if(tmedia_codec_plugin_unregister(plugin) == 0){
- --count;
- }
- }
-
- // put current plugin at prio and old (which was at prio) at the end
- tmp = __tmedia_codec_plugins[prio];
- __tmedia_codec_plugins[count] = tmp;// put old codec add prio to the end of the list
- __tmedia_codec_plugins[prio] = plugin;
-
- return 0;
+ tsk_size_t count = 0;
+ tsk_bool_t already_registered = tsk_false;
+ const tmedia_codec_plugin_def_t* tmp;
+ if(!plugin || tsk_strnullORempty(plugin->name) || tsk_strnullORempty(plugin->format) || (prio + 1) >= TMED_CODEC_MAX_PLUGINS) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // count codecs and found if already registered
+ while(__tmedia_codec_plugins[count]) {
+ if(__tmedia_codec_plugins[count] == plugin) {
+ already_registered = tsk_true;
+ }
+ ++count;
+ }
+
+ if(count >= TMED_CODEC_MAX_PLUGINS) {
+ TSK_DEBUG_ERROR("No room");
+ return -1;
+ }
+
+ // unregister and compact
+ if(already_registered) {
+ if(tmedia_codec_plugin_unregister(plugin) == 0) {
+ --count;
+ }
+ }
+
+ // put current plugin at prio and old (which was at prio) at the end
+ tmp = __tmedia_codec_plugins[prio];
+ __tmedia_codec_plugins[count] = tmp;// put old codec add prio to the end of the list
+ __tmedia_codec_plugins[prio] = plugin;
+
+ return 0;
}
/**@ingroup tmedia_codec_group
@@ -310,15 +346,15 @@ int tmedia_codec_plugin_register_2(const tmedia_codec_plugin_def_t* plugin, int
*/
tsk_bool_t tmedia_codec_plugin_is_registered(const tmedia_codec_plugin_def_t* plugin)
{
- if(plugin){
- tsk_size_t i;
- for(i = 0; i < TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++){
- if(__tmedia_codec_plugins[i] == plugin){
- return tsk_true;
- }
- }
- }
- return tsk_false;
+ if(plugin) {
+ tsk_size_t i;
+ for(i = 0; i < TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++) {
+ if(__tmedia_codec_plugins[i] == plugin) {
+ return tsk_true;
+ }
+ }
+ }
+ return tsk_false;
}
/**@ingroup tmedia_codec_group
@@ -329,7 +365,7 @@ tsk_bool_t tmedia_codec_plugin_is_registered(const tmedia_codec_plugin_def_t* pl
*/
tsk_bool_t tmedia_codec_plugin_is_registered_2(tmedia_codec_id_t codec_id)
{
- return (tmedia_codec_plugin_registered_get_const(codec_id) != tsk_null);
+ return (tmedia_codec_plugin_registered_get_const(codec_id) != tsk_null);
}
/**@ingroup tmedia_codec_group
@@ -340,26 +376,26 @@ tsk_bool_t tmedia_codec_plugin_is_registered_2(tmedia_codec_id_t codec_id)
*/
int tmedia_codec_plugin_registered_get_all(const struct tmedia_codec_plugin_def_s*(** plugins)[TMED_CODEC_MAX_PLUGINS], tsk_size_t* count)
{
- if(!plugins || !count) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *plugins = &__tmedia_codec_plugins;
- *count = sizeof(__tmedia_codec_plugins)/sizeof(__tmedia_codec_plugins[0]);
- return 0;
+ if(!plugins || !count) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *plugins = &__tmedia_codec_plugins;
+ *count = sizeof(__tmedia_codec_plugins)/sizeof(__tmedia_codec_plugins[0]);
+ return 0;
}
/**@ingroup tmedia_codec_group
*/
const struct tmedia_codec_plugin_def_s* tmedia_codec_plugin_registered_get_const(tmedia_codec_id_t codec_id)
{
- tsk_size_t i;
- for(i = 0; i < TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++){
- if(__tmedia_codec_plugins[i]->codec_id == codec_id){
- return __tmedia_codec_plugins[i];
- }
- }
- return tsk_null;
+ tsk_size_t i;
+ for(i = 0; i < TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++) {
+ if(__tmedia_codec_plugins[i]->codec_id == codec_id) {
+ return __tmedia_codec_plugins[i];
+ }
+ }
+ return tsk_null;
}
/**@ingroup tmedia_codec_group
@@ -369,36 +405,36 @@ const struct tmedia_codec_plugin_def_s* tmedia_codec_plugin_registered_get_const
*/
int tmedia_codec_plugin_unregister(const tmedia_codec_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- /* find the plugin to unregister */
- for(i = 0; i<TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++){
- if(__tmedia_codec_plugins[i] == plugin){
- TSK_DEBUG_INFO("UnRegister codec: %s, %s", plugin->name, plugin->desc);
- __tmedia_codec_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if(found){
- for(; i<(TMED_CODEC_MAX_PLUGINS - 1); i++){
- if(__tmedia_codec_plugins[i+1]){
- __tmedia_codec_plugins[i] = __tmedia_codec_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_codec_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_CODEC_MAX_PLUGINS && __tmedia_codec_plugins[i]; i++) {
+ if(__tmedia_codec_plugins[i] == plugin) {
+ TSK_DEBUG_INFO("UnRegister codec: %s, %s", plugin->name, plugin->desc);
+ __tmedia_codec_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if(found) {
+ for(; i<(TMED_CODEC_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_codec_plugins[i+1]) {
+ __tmedia_codec_plugins[i] = __tmedia_codec_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_codec_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
/**@ingroup tmedia_codec_group
@@ -407,8 +443,8 @@ int tmedia_codec_plugin_unregister(const tmedia_codec_plugin_def_t* plugin)
*/
int tmedia_codec_plugin_unregister_all()
{
- memset((void*)__tmedia_codec_plugins, 0, sizeof(__tmedia_codec_plugins));
- return 0;
+ memset((void*)__tmedia_codec_plugins, 0, sizeof(__tmedia_codec_plugins));
+ return 0;
}
/**@ingroup tmedia_codec_group
@@ -418,48 +454,48 @@ int tmedia_codec_plugin_unregister_all()
*/
tmedia_codec_t* tmedia_codec_create(const char* format)
{
- tmedia_codec_t* codec = tsk_null;
- const tmedia_codec_plugin_def_t* plugin;
- tsk_size_t i = 0;
-
- while((i < TMED_CODEC_MAX_PLUGINS) && (plugin = __tmedia_codec_plugins[i++])){
- if(plugin->objdef && tsk_striequals(plugin->format, format)){
- if((codec = tsk_object_new(plugin->objdef))){
- /* initialize the newly created codec */
- codec->id = plugin->codec_id;
- codec->dyn = plugin->dyn;
- codec->plugin = plugin;
- codec->bl = tmedia_bl_medium;
- switch(plugin->type){
- case tmedia_audio:
- { /* Audio codec */
- tmedia_codec_audio_t* audio = TMEDIA_CODEC_AUDIO(codec);
- tmedia_codec_audio_init(TMEDIA_CODEC(audio), plugin->name, plugin->desc, plugin->format);
- break;
- }
- case tmedia_video:
- { /* Video codec */
- tmedia_codec_video_t* video = TMEDIA_CODEC_VIDEO(codec);
- tmedia_codec_video_init(TMEDIA_CODEC(video), plugin->name, plugin->desc, plugin->format);
- break;
- }
- case tmedia_msrp:
- { /* Msrp codec */
- tmedia_codec_msrp_init(codec, plugin->name, plugin->desc);
- break;
- }
- default:
- { /* Any other codec */
- tmedia_codec_init(codec, plugin->type, plugin->name, plugin->desc, plugin->format);
- break;
- }
- }
- break;
- }
- }
- }
-
- return codec;
+ tmedia_codec_t* codec = tsk_null;
+ const tmedia_codec_plugin_def_t* plugin;
+ tsk_size_t i = 0;
+
+ while((i < TMED_CODEC_MAX_PLUGINS) && (plugin = __tmedia_codec_plugins[i++])) {
+ if(plugin->objdef && tsk_striequals(plugin->format, format)) {
+ if((codec = tsk_object_new(plugin->objdef))) {
+ /* initialize the newly created codec */
+ codec->id = plugin->codec_id;
+ codec->dyn = plugin->dyn;
+ codec->plugin = plugin;
+ codec->bl = tmedia_bl_medium;
+ switch(plugin->type) {
+ case tmedia_audio: {
+ /* Audio codec */
+ tmedia_codec_audio_t* audio = TMEDIA_CODEC_AUDIO(codec);
+ tmedia_codec_audio_init(TMEDIA_CODEC(audio), plugin->name, plugin->desc, plugin->format);
+ break;
+ }
+ case tmedia_video: {
+ /* Video codec */
+ tmedia_codec_video_t* video = TMEDIA_CODEC_VIDEO(codec);
+ tmedia_codec_video_init(TMEDIA_CODEC(video), plugin->name, plugin->desc, plugin->format);
+ break;
+ }
+ case tmedia_msrp: {
+ /* Msrp codec */
+ tmedia_codec_msrp_init(codec, plugin->name, plugin->desc);
+ break;
+ }
+ default: {
+ /* Any other codec */
+ tmedia_codec_init(codec, plugin->type, plugin->name, plugin->desc, plugin->format);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ return codec;
}
/**@ingroup tmedia_codec_group
@@ -470,46 +506,46 @@ tmedia_codec_t* tmedia_codec_create(const char* format)
*/
char* tmedia_codec_get_rtpmap(const tmedia_codec_t* self)
{
- char* rtpmap = tsk_null;
-
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
- if(self->type & tmedia_video){
- /* const tmedia_codec_video_t* videoCodec = (const tmedia_codec_video_t*)self; */
- tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
- if(self->plugin->rate){
- tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
- }
- }
- else if(self->type & tmedia_audio){
- /* const tmedia_codec_audio_t* audioCodec = (const tmedia_codec_audio_t*)self; */
-
- // special case for G.722 which has fake rate
- if(tsk_strequals(self->plugin->format,TMEDIA_CODEC_FORMAT_G722)){
- tsk_sprintf(&rtpmap, "%s %s/8000/%d", self->neg_format? self->neg_format : self->format, self->name, self->plugin->audio.channels);
- }
- else{
- tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
- if(self->plugin->rate){
- tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
- }
- if(self->plugin->audio.channels > 0){
- tsk_strcat_2(&rtpmap, "/%d", self->plugin->audio.channels);
- }
- }
- }
- else if(self->type & tmedia_t140){
- tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
- if(self->plugin->rate){
- tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
- }
- }
- else{
- }
-
- return rtpmap;
+ char* rtpmap = tsk_null;
+
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
+ if(self->type & tmedia_video) {
+ /* const tmedia_codec_video_t* videoCodec = (const tmedia_codec_video_t*)self; */
+ tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
+ if(self->plugin->rate) {
+ tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
+ }
+ }
+ else if(self->type & tmedia_audio) {
+ /* const tmedia_codec_audio_t* audioCodec = (const tmedia_codec_audio_t*)self; */
+
+ // special case for G.722 which has fake rate
+ if(tsk_strequals(self->plugin->format,TMEDIA_CODEC_FORMAT_G722)) {
+ tsk_sprintf(&rtpmap, "%s %s/8000/%d", self->neg_format? self->neg_format : self->format, self->name, self->plugin->audio.channels);
+ }
+ else {
+ tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
+ if(self->plugin->rate) {
+ tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
+ }
+ if(self->plugin->audio.channels > 0) {
+ tsk_strcat_2(&rtpmap, "/%d", self->plugin->audio.channels);
+ }
+ }
+ }
+ else if(self->type & tmedia_t140) {
+ tsk_sprintf(&rtpmap, "%s %s", self->neg_format? self->neg_format : self->format, self->name);
+ if(self->plugin->rate) {
+ tsk_strcat_2(&rtpmap, "/%d", self->plugin->rate);
+ }
+ }
+ else {
+ }
+
+ return rtpmap;
}
/**@ingroup tmedia_codec_group
@@ -520,19 +556,19 @@ char* tmedia_codec_get_rtpmap(const tmedia_codec_t* self)
*/
tsk_bool_t tmedia_codec_sdp_att_match(const tmedia_codec_t* self, const char* att_name, const char* att_value)
{
- /* checks */
- if(!self || !self->plugin || !self->plugin->sdp_att_match || !att_name){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_false;
- }
-
- /* if attribute value is null or empty -> always match */
- if(tsk_strnullORempty(att_value)){
- return tsk_true;
- }
- else{
- return self->plugin->sdp_att_match(self, att_name, att_value);
- }
+ /* checks */
+ if(!self || !self->plugin || !self->plugin->sdp_att_match || !att_name) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_false;
+ }
+
+ /* if attribute value is null or empty -> always match */
+ if(tsk_strnullORempty(att_value)) {
+ return tsk_true;
+ }
+ else {
+ return self->plugin->sdp_att_match(self, att_name, att_value);
+ }
}
/**@ingroup tmedia_codec_group
@@ -544,14 +580,14 @@ tsk_bool_t tmedia_codec_sdp_att_match(const tmedia_codec_t* self, const char* at
*/
char* tmedia_codec_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
{
- if(!self || !self->plugin || !att_name){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
- if(self->plugin->sdp_att_get){ /* some codecs, like G711, won't produce fmtp */
- return self->plugin->sdp_att_get(self, att_name);
- }
- return tsk_null;
+ if(!self || !self->plugin || !att_name) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
+ if(self->plugin->sdp_att_get) { /* some codecs, like G711, won't produce fmtp */
+ return self->plugin->sdp_att_get(self, att_name);
+ }
+ return tsk_null;
}
@@ -563,19 +599,19 @@ char* tmedia_codec_sdp_att_get(const tmedia_codec_t* self, const char* att_name)
*/
int tmedia_codec_removeAll_exceptThese(tmedia_codecs_L_t* codecs, const tmedia_codecs_L_t * codecs2keep)
{
- tsk_list_item_t* item;
- if(!codecs || !codecs2keep){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_list_item_t* item;
+ if(!codecs || !codecs2keep) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
again:
- tsk_list_foreach(item, codecs){
- if(!tsk_list_find_item_by_pred(codecs2keep, __pred_find_codec_by_format, ((tmedia_codec_t*)item->data)->format)){
- tsk_list_remove_item(codecs, item);
- goto again;
- }
- }
- return 0;
+ tsk_list_foreach(item, codecs) {
+ if(!tsk_list_find_item_by_pred(codecs2keep, __pred_find_codec_by_format, ((tmedia_codec_t*)item->data)->format)) {
+ tsk_list_remove_item(codecs, item);
+ goto again;
+ }
+ }
+ return 0;
}
/**@ingroup tmedia_codec_group
@@ -587,78 +623,78 @@ again:
*/
int tmedia_codec_to_sdp(const tmedia_codecs_L_t* codecs, tsdp_header_M_t* m)
{
- const tsk_list_item_t* item;
- const tmedia_codec_t* codec;
- char *fmtp, *rtpmap, *imageattr;
- tsk_bool_t is_audio, is_video, is_text;
- int ret;
-
- if(!m){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- is_audio = tsk_striequals(m->media, "audio");
- is_video = tsk_striequals(m->media, "video");
- is_text = tsk_striequals(m->media, "text");
-
- tsk_list_foreach(item, codecs){
- const char *neg_format;
- codec = item->data;
- /* add fmt */
- neg_format = codec->neg_format? codec->neg_format : codec->format;
- if((ret = tsdp_header_M_add_fmt(m, neg_format))){
- TSK_DEBUG_ERROR("Failed to add format");
- return ret;
- }
-
- if(is_audio || is_video || is_text){
- char* temp = tsk_null;
- /* add rtpmap attributes */
- if((rtpmap = tmedia_codec_get_rtpmap(codec))){
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("rtpmap", rtpmap),
- tsk_null);
- TSK_FREE(rtpmap);
- }
- /* add 'imageattr' attributes */
- if((imageattr = tmedia_codec_sdp_att_get(codec, "imageattr"))){
- tsk_sprintf(&temp, "%s %s", neg_format, imageattr);
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("imageattr", temp),
- tsk_null);
- TSK_FREE(temp);
- TSK_FREE(imageattr);
- }
- /* add fmtp attributes */
- if((fmtp = tmedia_codec_sdp_att_get(codec, "fmtp"))){
- if(is_video && tmedia_defaults_get_screen_x() > 0 && tmedia_defaults_get_screen_y() > 0){
- tsk_sprintf(&temp, "%s %s;sx=%d;sy=%d", neg_format, fmtp, tmedia_defaults_get_screen_x(), tmedia_defaults_get_screen_y());//doubango clients
- }
- else{
- tsk_sprintf(&temp, "%s %s", neg_format, fmtp);
- }
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("fmtp", temp),
- tsk_null);
- TSK_FREE(temp);
- TSK_FREE(fmtp);
- }
- /* special case for T.140 + red */
- if(is_text && tsk_striequals(codec->format, TMEDIA_CODEC_FORMAT_RED)){
- const tmedia_codec_t* codec_t140 = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_format, TMEDIA_CODEC_FORMAT_T140);
- if(codec_t140){
- const char* neg_format_t140 = codec_t140->neg_format? codec_t140->neg_format : codec_t140->format;
- tsk_sprintf(&temp, "%s %s/%s/%s/%s", neg_format, neg_format_t140, neg_format_t140, neg_format_t140, neg_format_t140);
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("fmtp", temp),
- tsk_null);
- TSK_FREE(temp);
- }
- }
- }
- }
- return 0;
+ const tsk_list_item_t* item;
+ const tmedia_codec_t* codec;
+ char *fmtp, *rtpmap, *imageattr;
+ tsk_bool_t is_audio, is_video, is_text;
+ int ret;
+
+ if(!m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ is_audio = tsk_striequals(m->media, "audio");
+ is_video = tsk_striequals(m->media, "video");
+ is_text = tsk_striequals(m->media, "text");
+
+ tsk_list_foreach(item, codecs) {
+ const char *neg_format;
+ codec = item->data;
+ /* add fmt */
+ neg_format = codec->neg_format? codec->neg_format : codec->format;
+ if((ret = tsdp_header_M_add_fmt(m, neg_format))) {
+ TSK_DEBUG_ERROR("Failed to add format");
+ return ret;
+ }
+
+ if(is_audio || is_video || is_text) {
+ char* temp = tsk_null;
+ /* add rtpmap attributes */
+ if((rtpmap = tmedia_codec_get_rtpmap(codec))) {
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("rtpmap", rtpmap),
+ tsk_null);
+ TSK_FREE(rtpmap);
+ }
+ /* add 'imageattr' attributes */
+ if((imageattr = tmedia_codec_sdp_att_get(codec, "imageattr"))) {
+ tsk_sprintf(&temp, "%s %s", neg_format, imageattr);
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("imageattr", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ TSK_FREE(imageattr);
+ }
+ /* add fmtp attributes */
+ if((fmtp = tmedia_codec_sdp_att_get(codec, "fmtp"))) {
+ if(is_video && tmedia_defaults_get_screen_x() > 0 && tmedia_defaults_get_screen_y() > 0) {
+ tsk_sprintf(&temp, "%s %s;sx=%d;sy=%d", neg_format, fmtp, tmedia_defaults_get_screen_x(), tmedia_defaults_get_screen_y());//doubango clients
+ }
+ else {
+ tsk_sprintf(&temp, "%s %s", neg_format, fmtp);
+ }
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("fmtp", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ TSK_FREE(fmtp);
+ }
+ /* special case for T.140 + red */
+ if(is_text && tsk_striequals(codec->format, TMEDIA_CODEC_FORMAT_RED)) {
+ const tmedia_codec_t* codec_t140 = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_format, TMEDIA_CODEC_FORMAT_T140);
+ if(codec_t140) {
+ const char* neg_format_t140 = codec_t140->neg_format? codec_t140->neg_format : codec_t140->format;
+ tsk_sprintf(&temp, "%s %s/%s/%s/%s", neg_format, neg_format_t140, neg_format_t140, neg_format_t140, neg_format_t140);
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("fmtp", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+ }
+ }
+ }
+ return 0;
}
/**@ingroup tmedia_codec_group
@@ -669,88 +705,88 @@ int tmedia_codec_to_sdp(const tmedia_codecs_L_t* codecs, tsdp_header_M_t* m)
*/
tmedia_codec_t* tmedia_codec_find_by_format(tmedia_codecs_L_t* codecs, const char* format)
{
- const tmedia_codec_t* codec = tsk_null;
-
- if(!codecs || !format){
- TSK_DEBUG_ERROR("Inalid parameter");
- return tsk_null;
- }
-
- if((codec = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_format, format)) ||
- (codec = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_neg_format, format))){
- return tsk_object_ref((void*)codec);
- }
- else{
- return tsk_null;
- }
+ const tmedia_codec_t* codec = tsk_null;
+
+ if(!codecs || !format) {
+ TSK_DEBUG_ERROR("Inalid parameter");
+ return tsk_null;
+ }
+
+ if((codec = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_format, format)) ||
+ (codec = tsk_list_find_object_by_pred(codecs, __pred_find_codec_by_neg_format, format))) {
+ return tsk_object_ref((void*)codec);
+ }
+ else {
+ return tsk_null;
+ }
}
/**@ingroup tmedia_codec_group
*/
int tmedia_codec_parse_fmtp(const char* fmtp, unsigned* maxbr, unsigned* fps, unsigned *width, unsigned *height)
{
- char *copy, *pch, *saveptr;
- tsk_bool_t found = tsk_false;
-
- if(tsk_strnullORempty(fmtp)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- copy = tsk_strdup(fmtp);
- pch = tsk_strtok_r(copy, "; /", &saveptr);
-
- while(pch){
- unsigned div = 0;
-
- if(sscanf(pch, "QCIF=%u", &div) == 1 && div){
- *fps = 30/div;
- *width = 176;
- *height = 144;
- found = tsk_true;
- }
- else if(sscanf(pch, "CIF=%u", &div) == 1 && div){
- *fps = 30/div;
- *width = 352;
- *height = 288;
- found = tsk_true;
- }
- else if(sscanf(pch, "SQCIF=%u", &div) == 1 && div){
- *fps = 30/div;
- *width = 128;
- *height = 96;
- found = tsk_true;
- }
- else if(sscanf(pch, "QVGA=%u", &div) == 1 && div){
- *fps = 30/div;
- *width = 320;
- *height = 240;
- found = tsk_true;
- }
- // to be continued
-
- if(found){
- //found = tsk_false;
- pch = tsk_strtok_r(tsk_null, "; ", &saveptr);
- while(pch){
- if(sscanf(pch, "MaxBR=%u", maxbr) == 1){
- //found = tsk_true;
- break;
- }
- pch = tsk_strtok_r(tsk_null, "; /", &saveptr);
- }
- }
-
- if(found){
- break;
- }
-
- pch = tsk_strtok_r(tsk_null, "; /", &saveptr);
- }
-
- TSK_FREE(copy);
-
- return found ? 0 : -2;
+ char *copy, *pch, *saveptr;
+ tsk_bool_t found = tsk_false;
+
+ if(tsk_strnullORempty(fmtp)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ copy = tsk_strdup(fmtp);
+ pch = tsk_strtok_r(copy, "; /", &saveptr);
+
+ while(pch) {
+ unsigned div = 0;
+
+ if(sscanf(pch, "QCIF=%u", &div) == 1 && div) {
+ *fps = 30/div;
+ *width = 176;
+ *height = 144;
+ found = tsk_true;
+ }
+ else if(sscanf(pch, "CIF=%u", &div) == 1 && div) {
+ *fps = 30/div;
+ *width = 352;
+ *height = 288;
+ found = tsk_true;
+ }
+ else if(sscanf(pch, "SQCIF=%u", &div) == 1 && div) {
+ *fps = 30/div;
+ *width = 128;
+ *height = 96;
+ found = tsk_true;
+ }
+ else if(sscanf(pch, "QVGA=%u", &div) == 1 && div) {
+ *fps = 30/div;
+ *width = 320;
+ *height = 240;
+ found = tsk_true;
+ }
+ // to be continued
+
+ if(found) {
+ //found = tsk_false;
+ pch = tsk_strtok_r(tsk_null, "; ", &saveptr);
+ while(pch) {
+ if(sscanf(pch, "MaxBR=%u", maxbr) == 1) {
+ //found = tsk_true;
+ break;
+ }
+ pch = tsk_strtok_r(tsk_null, "; /", &saveptr);
+ }
+ }
+
+ if(found) {
+ break;
+ }
+
+ pch = tsk_strtok_r(tsk_null, "; /", &saveptr);
+ }
+
+ TSK_FREE(copy);
+
+ return found ? 0 : -2;
}
/**@ingroup tmedia_codec_group
@@ -760,74 +796,104 @@ int tmedia_codec_parse_fmtp(const char* fmtp, unsigned* maxbr, unsigned* fps, un
*/
int tmedia_codec_deinit(tmedia_codec_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(self->opened){
- tmedia_codec_close(self);
- }
+ if(self->opened) {
+ tmedia_codec_close(self);
+ }
- TSK_FREE(self->name);
- TSK_FREE(self->desc);
- TSK_FREE(self->format);
- TSK_FREE(self->neg_format);
+ TSK_FREE(self->name);
+ TSK_FREE(self->desc);
+ TSK_FREE(self->format);
+ TSK_FREE(self->neg_format);
- return 0;
+ return 0;
}
int tmedia_codec_video_set_enc_callback(tmedia_codec_video_t *self, tmedia_codec_video_enc_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->out.callback = callback;
- self->out.result.usr_data = callback_data;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->out.callback = callback;
+ self->out.result.usr_data = callback_data;
+ return 0;
}
int tmedia_codec_video_set_dec_callback(tmedia_codec_video_t *self, tmedia_codec_video_dec_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->in.callback = callback;
- self->in.result.usr_data = callback_data;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->in.callback = callback;
+ self->in.result.usr_data = callback_data;
+ return 0;
+}
+
+int tmedia_codec_video_clamp_out_size_to_range_max(tmedia_codec_video_t *self)
+{
+ int ret = 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (tmedia_defaults_get_adapt_video_size_range_enabled()) {
+ tmedia_pref_video_size_t min, max;
+ if ((ret = tmedia_defaults_get_pref_video_size_range(&min, &max)) == 0) {
+ unsigned width, height;
+ // clip(max)
+ if ((ret = tmedia_video_get_size(max, &width, &height)) == 0) {
+ unsigned new_width = TSK_CLAMP(0, self->out.width, width);
+ unsigned new_height = TSK_CLAMP(0, self->out.height, height);
+ TSK_DEBUG_INFO("Pref. video size range defined, video size clipped (%ux%u)->(%ux%u)",
+ width, height,
+ self->out.width, self->out.height);
+ self->out.width = width;
+ self->out.height = height;
+ }
+ // no clip(min) as we cannot increase the size to more than what was negotiated without sending reINVITE
+ }
+ }
+ return ret;
}
float tmedia_codec_audio_get_timestamp_multiplier(tmedia_codec_id_t id, uint32_t sample_rate)
{
- switch(id){
- case tmedia_codec_id_opus:
- {
- // draft-spittka-payload-rtp-opus-03 - 4.1. RTP Header Usage
- switch(sample_rate){
- case 8000: return 6.f;
- case 12000: return 4.f;
- case 16000: return 3.f;
- case 24000: return 2.f;
- default: case 48000: return 1.f;
- }
- break;
- }
- case tmedia_codec_id_g722:
- {
- /* http://www.ietf.org/rfc/rfc3551.txt
- Even though the actual sampling rate for G.722 audio is 16,000 Hz,
- the RTP clock rate for the G722 payload format is 8,000 Hz because
- that value was erroneously assigned in RFC 1890 and must remain
- unchanged for backward compatibility. The octet rate or sample-pair
- rate is 8,000 Hz.
- */
- return .5f;
- }
- default:
- {
- return 1;
- }
- }
+ switch(id) {
+ case tmedia_codec_id_opus: {
+ // draft-spittka-payload-rtp-opus-03 - 4.1. RTP Header Usage
+ switch(sample_rate) {
+ case 8000:
+ return 6.f;
+ case 12000:
+ return 4.f;
+ case 16000:
+ return 3.f;
+ case 24000:
+ return 2.f;
+ default:
+ case 48000:
+ return 1.f;
+ }
+ break;
+ }
+ case tmedia_codec_id_g722: {
+ /* http://www.ietf.org/rfc/rfc3551.txt
+ Even though the actual sampling rate for G.722 audio is 16,000 Hz,
+ the RTP clock rate for the G722 payload format is 8,000 Hz because
+ that value was erroneously assigned in RFC 1890 and must remain
+ unchanged for backward compatibility. The octet rate or sample-pair
+ rate is 8,000 Hz.
+ */
+ return .5f;
+ }
+ default: {
+ return 1;
+ }
+ }
} \ No newline at end of file
diff --git a/tinyMEDIA/src/tmedia_codec_dummy.c b/tinyMEDIA/src/tmedia_codec_dummy.c
index 377f629..f84b99d 100755
--- a/tinyMEDIA/src/tmedia_codec_dummy.c
+++ b/tinyMEDIA/src/tmedia_codec_dummy.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,68 +41,67 @@
#define tmedia_codec_dpcmu_fmtp_decode tsk_null
tsk_bool_t tmedia_codec_dpcmu_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
/* constructor */
static tsk_object_t* tmedia_codec_dpcmu_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_codec_dpcmu_t *dpcmu = self;
- if(dpcmu){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tmedia_codec_dpcmu_t *dpcmu = self;
+ if(dpcmu) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_codec_dpcmu_dtor(tsk_object_t * self)
-{
- tmedia_codec_dpcmu_t *dpcmu = self;
- if(dpcmu){
- /* deinit base */
- tmedia_codec_audio_deinit(dpcmu);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_codec_dpcmu_t *dpcmu = self;
+ if(dpcmu) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(dpcmu);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_codec_dpcmu_def_s =
-{
- sizeof(tmedia_codec_dpcmu_t),
- tmedia_codec_dpcmu_ctor,
- tmedia_codec_dpcmu_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tmedia_codec_dpcmu_def_s = {
+ sizeof(tmedia_codec_dpcmu_t),
+ tmedia_codec_dpcmu_ctor,
+ tmedia_codec_dpcmu_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tmedia_codec_dpcmu_plugin_def_s =
-{
- &tmedia_codec_dpcmu_def_s,
-
- tmedia_audio,
- tmedia_codec_id_pcmu,
- "G.711u",
- "Dummy G.711u codec",
- TMEDIA_CODEC_FORMAT_G711u,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 20 // ptime
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tsk_null, // open
- tsk_null, // close
- tmedia_codec_dpcmu_fmtp_encode,
- tmedia_codec_dpcmu_fmtp_decode,
- tmedia_codec_dpcmu_sdp_att_match,
- tmedia_codec_dpcmu_sdp_att_get,
+static const tmedia_codec_plugin_def_t tmedia_codec_dpcmu_plugin_def_s = {
+ &tmedia_codec_dpcmu_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_pcmu,
+ "G.711u",
+ "Dummy G.711u codec",
+ TMEDIA_CODEC_FORMAT_G711u,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 20 // ptime
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tsk_null, // open
+ tsk_null, // close
+ tmedia_codec_dpcmu_fmtp_encode,
+ tmedia_codec_dpcmu_fmtp_decode,
+ tmedia_codec_dpcmu_sdp_att_match,
+ tmedia_codec_dpcmu_sdp_att_get,
};
const tmedia_codec_plugin_def_t *tmedia_codec_dpcmu_plugin_def_t = &tmedia_codec_dpcmu_plugin_def_s;
@@ -116,68 +115,67 @@ const tmedia_codec_plugin_def_t *tmedia_codec_dpcmu_plugin_def_t = &tmedia_codec
#define tmedia_codec_dpcma_fmtp_decode tsk_null
tsk_bool_t tmedia_codec_dpcma_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{ /* always match */
- return tsk_true;
+{
+ /* always match */
+ return tsk_true;
}
/* constructor */
static tsk_object_t* tmedia_codec_dpcma_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_codec_dpcma_t *dpcma = self;
- if(dpcma){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tmedia_codec_dpcma_t *dpcma = self;
+ if(dpcma) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_codec_dpcma_dtor(tsk_object_t * self)
-{
- tmedia_codec_dpcma_t *dpcma = self;
- if(dpcma){
- /* deinit base */
- tmedia_codec_audio_deinit(dpcma);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_codec_dpcma_t *dpcma = self;
+ if(dpcma) {
+ /* deinit base */
+ tmedia_codec_audio_deinit(dpcma);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_codec_dpcma_def_s =
-{
- sizeof(tmedia_codec_dpcma_t),
- tmedia_codec_dpcma_ctor,
- tmedia_codec_dpcma_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tmedia_codec_dpcma_def_s = {
+ sizeof(tmedia_codec_dpcma_t),
+ tmedia_codec_dpcma_ctor,
+ tmedia_codec_dpcma_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tmedia_codec_dpcma_plugin_def_s =
-{
- &tmedia_codec_dpcma_def_s,
-
- tmedia_audio,
- tmedia_codec_id_pcma,
- "G.711a",
- "Dummy G.711a codec",
- TMEDIA_CODEC_FORMAT_G711a,
- tsk_false,
- 8000, // rate
-
- { /* audio */
- 1, // channels
- 20 // ptime
- },
-
- /* video */
- {0},
-
- tsk_null, // set()
- tsk_null, // open
- tsk_null, // close
- tmedia_codec_dpcma_fmtp_encode,
- tmedia_codec_dpcma_fmtp_decode,
- tmedia_codec_dpcma_sdp_att_match,
- tmedia_codec_dpcma_sdp_att_get
+static const tmedia_codec_plugin_def_t tmedia_codec_dpcma_plugin_def_s = {
+ &tmedia_codec_dpcma_def_s,
+
+ tmedia_audio,
+ tmedia_codec_id_pcma,
+ "G.711a",
+ "Dummy G.711a codec",
+ TMEDIA_CODEC_FORMAT_G711a,
+ tsk_false,
+ 8000, // rate
+
+ { /* audio */
+ 1, // channels
+ 20 // ptime
+ },
+
+ /* video */
+ {0},
+
+ tsk_null, // set()
+ tsk_null, // open
+ tsk_null, // close
+ tmedia_codec_dpcma_fmtp_encode,
+ tmedia_codec_dpcma_fmtp_decode,
+ tmedia_codec_dpcma_sdp_att_match,
+ tmedia_codec_dpcma_sdp_att_get
};
const tmedia_codec_plugin_def_t *tmedia_codec_dpcma_plugin_def_t = &tmedia_codec_dpcma_plugin_def_s;
@@ -189,88 +187,86 @@ const tmedia_codec_plugin_def_t *tmedia_codec_dpcma_plugin_def_t = &tmedia_codec
tsk_size_t tmedia_codec_dh263_fmtp_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- return 0;
+ return 0;
}
tsk_size_t tmedia_codec_dh263_fmtp_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- return 0;
+ return 0;
}
tsk_bool_t tmedia_codec_dh263_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- /* check whether we can match this fmtp with our local
- * check size, maxbr, fps ...*/
- return tsk_true;
+{
+ /* check whether we can match this fmtp with our local
+ * check size, maxbr, fps ...*/
+ return tsk_true;
}
char* tmedia_codec_dh263_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- return tsk_strdup("CIF=2/MaxBR=3840;QCIF=2/MaxBR=1920");
+ return tsk_strdup("CIF=2/MaxBR=3840;QCIF=2/MaxBR=1920");
}
int tmedia_codec_dh263_fmtp_set(tmedia_codec_t* self, const char* fmtp)
{
- TSK_DEBUG_INFO("remote fmtp=%s", fmtp);
- return 0;
+ TSK_DEBUG_INFO("remote fmtp=%s", fmtp);
+ return 0;
}
/* constructor */
static tsk_object_t* tmedia_codec_dh263_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_codec_dh263_t *dh263 = self;
- if(dh263){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tmedia_codec_dh263_t *dh263 = self;
+ if(dh263) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_codec_dh263_dtor(tsk_object_t * self)
-{
- tmedia_codec_dh263_t *dh263 = self;
- if(dh263){
- /* deinit base */
- tmedia_codec_video_deinit(dh263);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_codec_dh263_t *dh263 = self;
+ if(dh263) {
+ /* deinit base */
+ tmedia_codec_video_deinit(dh263);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_codec_dh263_def_s =
-{
- sizeof(tmedia_codec_dh263_t),
- tmedia_codec_dh263_ctor,
- tmedia_codec_dh263_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tmedia_codec_dh263_def_s = {
+ sizeof(tmedia_codec_dh263_t),
+ tmedia_codec_dh263_ctor,
+ tmedia_codec_dh263_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tmedia_codec_dh263_plugin_def_s =
-{
- &tmedia_codec_dh263_def_s,
-
- tmedia_video,
- tmedia_codec_id_h263,
- "H263",
- "Dummy H.263-1996 codec",
- TMEDIA_CODEC_FORMAT_H263,
- tsk_false,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {176, 144},
-
- tsk_null, // set()
- tsk_null, // open
- tsk_null, // close
- tmedia_codec_dh263_fmtp_encode,
- tmedia_codec_dh263_fmtp_decode,
- tmedia_codec_dh263_sdp_att_match,
- tmedia_codec_dh263_sdp_att_get
+static const tmedia_codec_plugin_def_t tmedia_codec_dh263_plugin_def_s = {
+ &tmedia_codec_dh263_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h263,
+ "H263",
+ "Dummy H.263-1996 codec",
+ TMEDIA_CODEC_FORMAT_H263,
+ tsk_false,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {176, 144},
+
+ tsk_null, // set()
+ tsk_null, // open
+ tsk_null, // close
+ tmedia_codec_dh263_fmtp_encode,
+ tmedia_codec_dh263_fmtp_decode,
+ tmedia_codec_dh263_sdp_att_match,
+ tmedia_codec_dh263_sdp_att_get
};
const tmedia_codec_plugin_def_t *tmedia_codec_dh263_plugin_def_t = &tmedia_codec_dh263_plugin_def_s;
@@ -283,87 +279,85 @@ const tmedia_codec_plugin_def_t *tmedia_codec_dh263_plugin_def_t = &tmedia_codec
tsk_size_t tmedia_codec_dh264_fmtp_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
- return 0;
+ return 0;
}
tsk_size_t tmedia_codec_dh264_fmtp_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
- return 0;
+ return 0;
}
tsk_bool_t tmedia_codec_dh264_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
-{
- /* check whether we can match this fmtp with our local
- * check size, maxbr, fps, profile-level-id, packetization-mode ...*/
- return tsk_true;
+{
+ /* check whether we can match this fmtp with our local
+ * check size, maxbr, fps, profile-level-id, packetization-mode ...*/
+ return tsk_true;
}
char* tmedia_codec_dh264_sdp_att_get(const tmedia_codec_t* codec, const char* att_name)
{
- return tsk_strdup("profile-level-id=42A01E;sprop-parameter-sets=Z0IACpZTBYmI,aMljiA==");
+ return tsk_strdup("profile-level-id=42A01E;sprop-parameter-sets=Z0IACpZTBYmI,aMljiA==");
}
int tmedia_codec_dh264_fmtp_set(tmedia_codec_t* self, const char* fmtp)
{
- TSK_DEBUG_INFO("remote fmtp=%s", fmtp);
- return 0;
+ TSK_DEBUG_INFO("remote fmtp=%s", fmtp);
+ return 0;
}
/* constructor */
static tsk_object_t* tmedia_codec_dh264_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_codec_dh264_t *dh264 = self;
- if(dh264){
- /* init base: called by tmedia_codec_create() */
- /* init self */
- }
- return self;
+ tmedia_codec_dh264_t *dh264 = self;
+ if(dh264) {
+ /* init base: called by tmedia_codec_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_codec_dh264_dtor(tsk_object_t * self)
-{
- tmedia_codec_dh264_t *dh264 = self;
- if(dh264){
- /* deinit base */
- tmedia_codec_video_deinit(dh264);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_codec_dh264_t *dh264 = self;
+ if(dh264) {
+ /* deinit base */
+ tmedia_codec_video_deinit(dh264);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_codec_dh264_def_s =
-{
- sizeof(tmedia_codec_dh264_t),
- tmedia_codec_dh264_ctor,
- tmedia_codec_dh264_dtor,
- tmedia_codec_cmp,
+static const tsk_object_def_t tmedia_codec_dh264_def_s = {
+ sizeof(tmedia_codec_dh264_t),
+ tmedia_codec_dh264_ctor,
+ tmedia_codec_dh264_dtor,
+ tmedia_codec_cmp,
};
/* plugin definition*/
-static const tmedia_codec_plugin_def_t tmedia_codec_dh264_plugin_def_s =
-{
- &tmedia_codec_dh264_def_s,
-
- tmedia_video,
- tmedia_codec_id_h264_bp,
- "H264",
- "Dummy H.264 (base profile 10) codec",
- TMEDIA_CODEC_FORMAT_H264_BP,
- tsk_true,
- 90000, // rate
-
- /* audio */
- { 0 },
-
- /* video */
- {176, 144},
-
- tsk_null, // set()
- tsk_null, // open
- tsk_null, // close
- tmedia_codec_dh264_fmtp_encode,
- tmedia_codec_dh264_fmtp_decode,
- tmedia_codec_dh264_sdp_att_match,
- tmedia_codec_dh264_sdp_att_get
+static const tmedia_codec_plugin_def_t tmedia_codec_dh264_plugin_def_s = {
+ &tmedia_codec_dh264_def_s,
+
+ tmedia_video,
+ tmedia_codec_id_h264_bp,
+ "H264",
+ "Dummy H.264 (base profile 10) codec",
+ TMEDIA_CODEC_FORMAT_H264_BP,
+ tsk_true,
+ 90000, // rate
+
+ /* audio */
+ { 0 },
+
+ /* video */
+ {176, 144},
+
+ tsk_null, // set()
+ tsk_null, // open
+ tsk_null, // close
+ tmedia_codec_dh264_fmtp_encode,
+ tmedia_codec_dh264_fmtp_decode,
+ tmedia_codec_dh264_sdp_att_match,
+ tmedia_codec_dh264_sdp_att_get
};
const tmedia_codec_plugin_def_t *tmedia_codec_dh264_plugin_def_t = &tmedia_codec_dh264_plugin_def_s;
diff --git a/tinyMEDIA/src/tmedia_common.c b/tinyMEDIA/src/tmedia_common.c
index 1e9faef..86832e1 100755
--- a/tinyMEDIA/src/tmedia_common.c
+++ b/tinyMEDIA/src/tmedia_common.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,400 +43,412 @@
#include <stdlib.h> /* atoi() */
-typedef struct fmtp_size_s{
- const char* name;
- tmedia_pref_video_size_t pref_vs;
- tsk_bool_t cif_family;
- unsigned width;
- unsigned height;
-}fmtp_size_t;
-static const fmtp_size_t fmtp_sizes[] =
-{
- /* must be sorted like this */
- {"2160P", tmedia_pref_video_size_2160p, tsk_false, 3840, 2160},
- {"1080P", tmedia_pref_video_size_1080p, tsk_false, 1920, 1080},
- {"16CIF", tmedia_pref_video_size_16cif, tsk_true, 1408, 1152},
- {"720P", tmedia_pref_video_size_720p, tsk_false, 1280, 720},
- {"XGA", tmedia_pref_video_size_xga, tsk_false, 1024, 768},
- {"480P", tmedia_pref_video_size_480p, tsk_false, 852, 480},
- {"WVGA", tmedia_pref_video_size_wvga, tsk_false, 800, 480},
- {"SVGA", tmedia_pref_video_size_svga, tsk_false, 800, 600},
- {"4CIF", tmedia_pref_video_size_4cif, tsk_true, 704, 576},
- {"VGA", tmedia_pref_video_size_vga, tsk_false, 640, 480},
- {"HVGA", tmedia_pref_video_size_hvga, tsk_false, 480, 320},
- {"CIF", tmedia_pref_video_size_cif, tsk_true, 352, 288},
- {"QVGA", tmedia_pref_video_size_qvga, tsk_false, 320, 240},
- {"QCIF", tmedia_pref_video_size_qcif, tsk_true, 176, 144},
- {"SQCIF", tmedia_pref_video_size_sqcif, tsk_true, 128, 96}
+typedef struct fmtp_size_s {
+ const char* name;
+ tmedia_pref_video_size_t pref_vs;
+ tsk_bool_t cif_family;
+ unsigned width;
+ unsigned height;
+} fmtp_size_t;
+static const fmtp_size_t fmtp_sizes[] = {
+ /* must be sorted like this */
+ {"2160P", tmedia_pref_video_size_2160p, tsk_false, 3840, 2160},
+ {"1080P", tmedia_pref_video_size_1080p, tsk_false, 1920, 1080},
+ {"16CIF", tmedia_pref_video_size_16cif, tsk_true, 1408, 1152},
+ {"720P", tmedia_pref_video_size_720p, tsk_false, 1280, 720},
+ {"XGA", tmedia_pref_video_size_xga, tsk_false, 1024, 768},
+ {"480P", tmedia_pref_video_size_480p, tsk_false, 852, 480},
+ {"WVGA", tmedia_pref_video_size_wvga, tsk_false, 800, 480},
+ {"SVGA", tmedia_pref_video_size_svga, tsk_false, 800, 600},
+ {"4CIF", tmedia_pref_video_size_4cif, tsk_true, 704, 576},
+ {"VGA", tmedia_pref_video_size_vga, tsk_false, 640, 480},
+ {"HVGA", tmedia_pref_video_size_hvga, tsk_false, 480, 320},
+ {"CIF", tmedia_pref_video_size_cif, tsk_true, 352, 288},
+ {"QVGA", tmedia_pref_video_size_qvga, tsk_false, 320, 240},
+ {"QCIF", tmedia_pref_video_size_qcif, tsk_true, 176, 144},
+ {"SQCIF", tmedia_pref_video_size_sqcif, tsk_true, 128, 96}
};
typedef int (*plugin_register)(const void* plugin_def);
typedef int (*plugin_unregister)(const void* plugin_def);
-typedef struct plugin_decl_s
-{
- tsk_plugin_def_type_t type;
- plugin_register fn_register;
- plugin_unregister fn_unregister;
+typedef struct plugin_decl_s {
+ tsk_plugin_def_type_t type;
+ plugin_register fn_register;
+ plugin_unregister fn_unregister;
}
plugin_decl_t;
-static const struct plugin_decl_s __plugin_def_types[] =
-{
- {tsk_plugin_def_type_consumer, tmedia_consumer_plugin_register, tmedia_consumer_plugin_unregister },
- {tsk_plugin_def_type_producer, tmedia_producer_plugin_register, tmedia_producer_plugin_unregister },
- {tsk_plugin_def_type_session, tmedia_session_plugin_register, tmedia_session_plugin_unregister },
- {tsk_plugin_def_type_codec, tmedia_codec_plugin_register, tmedia_codec_plugin_unregister },
- {tsk_plugin_def_type_converter, tmedia_converter_video_plugin_register, tmedia_converter_video_plugin_unregister },
- {tsk_plugin_def_type_resampler, tmedia_resampler_plugin_register, tmedia_resampler_plugin_unregister },
- {tsk_plugin_def_type_denoiser, tmedia_denoise_plugin_register, tmedia_denoise_plugin_unregister },
+static const struct plugin_decl_s __plugin_def_types[] = {
+ {tsk_plugin_def_type_consumer, tmedia_consumer_plugin_register, tmedia_consumer_plugin_unregister },
+ {tsk_plugin_def_type_producer, tmedia_producer_plugin_register, tmedia_producer_plugin_unregister },
+ {tsk_plugin_def_type_session, tmedia_session_plugin_register, tmedia_session_plugin_unregister },
+ {tsk_plugin_def_type_codec, tmedia_codec_plugin_register, tmedia_codec_plugin_unregister },
+ {tsk_plugin_def_type_converter, tmedia_converter_video_plugin_register, tmedia_converter_video_plugin_unregister },
+ {tsk_plugin_def_type_resampler, tmedia_resampler_plugin_register, tmedia_resampler_plugin_unregister },
+ {tsk_plugin_def_type_denoiser, tmedia_denoise_plugin_register, tmedia_denoise_plugin_unregister },
};
static const tsk_size_t __plugin_def_types_count = sizeof(__plugin_def_types)/sizeof(__plugin_def_types[0]);
-static const tsk_plugin_def_media_type_t __plugin_def_media_types[] =
-{
- tsk_plugin_def_media_type_audio,
- tsk_plugin_def_media_type_video,
- tsk_plugin_def_media_type_screencast
+static const tsk_plugin_def_media_type_t __plugin_def_media_types[] = {
+ tsk_plugin_def_media_type_audio,
+ tsk_plugin_def_media_type_video,
+ tsk_plugin_def_media_type_screencast
};
static const tsk_size_t __plugin_def_media_types_count = sizeof(__plugin_def_media_types)/sizeof(__plugin_def_media_types[0]);
static tsk_size_t _tmedia_plugin_register_or_unregister(struct tsk_plugin_s* plugin, enum tsk_plugin_def_type_e type, enum tsk_plugin_def_media_type_e media, tsk_bool_t _register)
{
- tsk_size_t ret = 0, i, j, index;
- tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- for(i = 0; i < __plugin_def_types_count; ++i){
- for(j = 0; j < __plugin_def_media_types_count; ++j){
- if((_register ? __plugin_def_types[i].fn_register : __plugin_def_types[i].fn_unregister) && (type & __plugin_def_types[i].type) == __plugin_def_types[i].type && (media & __plugin_def_media_types[j]) == __plugin_def_media_types[j]){
- for(index = 0; (plugin_def_ptr_const = tsk_plugin_get_def_2(plugin, __plugin_def_types[i].type, __plugin_def_media_types[j], index)); ++index){
- if((_register ? __plugin_def_types[i].fn_register : __plugin_def_types[i].fn_unregister)(plugin_def_ptr_const) == 0){
- ++ret;
- }
- }
- }
- }
- }
-
- return ret;
+ tsk_size_t ret = 0, i, j, index;
+ tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ for(i = 0; i < __plugin_def_types_count; ++i) {
+ for(j = 0; j < __plugin_def_media_types_count; ++j) {
+ if((_register ? __plugin_def_types[i].fn_register : __plugin_def_types[i].fn_unregister) && (type & __plugin_def_types[i].type) == __plugin_def_types[i].type && (media & __plugin_def_media_types[j]) == __plugin_def_media_types[j]) {
+ for(index = 0; (plugin_def_ptr_const = tsk_plugin_get_def_2(plugin, __plugin_def_types[i].type, __plugin_def_media_types[j], index)); ++index) {
+ if((_register ? __plugin_def_types[i].fn_register : __plugin_def_types[i].fn_unregister)(plugin_def_ptr_const) == 0) {
+ ++ret;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
}
tsk_size_t tmedia_plugin_register(struct tsk_plugin_s* plugin, enum tsk_plugin_def_type_e type, enum tsk_plugin_def_media_type_e media)
{
- return _tmedia_plugin_register_or_unregister(plugin, type, media, tsk_true);
+ return _tmedia_plugin_register_or_unregister(plugin, type, media, tsk_true);
}
tsk_size_t tmedia_plugin_unregister(struct tsk_plugin_s* plugin, enum tsk_plugin_def_type_e type, enum tsk_plugin_def_media_type_e media)
{
- return _tmedia_plugin_register_or_unregister(plugin, type, media, tsk_false);
+ return _tmedia_plugin_register_or_unregister(plugin, type, media, tsk_false);
}
tmedia_type_t tmedia_type_from_sdp(const tsdp_message_t* sdp)
{
- tmedia_type_t type = tmedia_none;
- const tsdp_header_M_t* M;
- tsk_size_t index = 0;
-
- if (!sdp) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return tmedia_none;
- }
-
- while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index++))) {
- type |= tmedia_type_from_sdp_headerM(M);
- }
- return type;
+ tmedia_type_t type = tmedia_none;
+ const tsdp_header_M_t* M;
+ tsk_size_t index = 0;
+
+ if (!sdp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tmedia_none;
+ }
+
+ while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index++))) {
+ type |= tmedia_type_from_sdp_headerM(M);
+ }
+ return type;
}
tmedia_type_t tmedia_type_from_sdp_headerM(const tsdp_header_M_t* M)
{
- const tmedia_session_plugin_def_t* plugin;
- const tsdp_header_A_t* A;
- if (!M) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return tmedia_none;
- }
- if (M->port && (plugin = tmedia_session_plugin_find_by_media(M->media))) {
- if (plugin->type == tmedia_audio || plugin->type == tmedia_video) {
- // check if it's BFCP audio/video session
- // content attribute described in http://tools.ietf.org/html/rfc4796
- if ((A = tsdp_header_M_findA(M, "content")) && (!tsk_striequals(A->value, "main"))) {
- return plugin->type == tmedia_audio ? tmedia_bfcp_audio : tmedia_bfcp_video;
- }
- }
- return plugin->type;
- }
- return tmedia_none;
+ const tmedia_session_plugin_def_t* plugin;
+ const tsdp_header_A_t* A;
+ if (!M) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tmedia_none;
+ }
+ if (M->port && (plugin = tmedia_session_plugin_find_by_media(M->media))) {
+ if (plugin->type == tmedia_audio || plugin->type == tmedia_video) {
+ // check if it's BFCP audio/video session
+ // content attribute described in http://tools.ietf.org/html/rfc4796
+ if ((A = tsdp_header_M_findA(M, "content")) && (!tsk_striequals(A->value, "main"))) {
+ return plugin->type == tmedia_audio ? tmedia_bfcp_audio : tmedia_bfcp_video;
+ }
+ }
+ return plugin->type;
+ }
+ return tmedia_none;
}
int tmedia_parse_rtpmap(const char* rtpmap, char** name, int32_t* rate, int32_t* channels)
{
- /* e.g. AMR-WB/16000/2 */
-
- int len;
- int index, pos = 0;
-
- if(tsk_strnullORempty(rtpmap)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- *name = tsk_null;
- *rate = *channels = 0;
- len = (int)tsk_strlen(rtpmap);
-
- /* name */
- if((index = tsk_strindexOf(rtpmap, len, "/")) != -1){
- *name = tsk_strndup(rtpmap, index);
- len -= (index + 1), pos = (index + 1);
- /* rate */
- if(len>0){
- if((index = tsk_strindexOf((rtpmap + pos), len, "/")) != -1){
- *rate = atoi(&rtpmap[pos]);
- len -= (index + 1), pos += (index + 1);
- /* channels */
- if(len>0){
- *channels = atoi(&rtpmap[pos]);
- }
- }
- else{
- *rate = atoi(&rtpmap[pos]);
- }
- }
- }
- else{
- *name = tsk_strdup(rtpmap);
- }
-
- return 0;
-
- ///* e.g. AMR-WB/16000/2 */
- //if(sscanf(rtpmap, "%*s/%*d/%*d") != EOF){
- // int index = tsk_strindexOf(rtpmap, len, "/");
- // *name = tsk_strndup(rtpmap, index);
- // sscanf(&rtpmap[index+1], "%d/%d", rate, channels);
- // return 0;
- //}
- ///* e.g. AMR-WB/16000 */
- //else if(sscanf(rtpmap, "%*s/%*d") != EOF){
- // int index = tsk_strindexOf(rtpmap, len, "/");
- // *name = tsk_strndup(rtpmap, index);
- // *rate = atoi(&rtpmap[index+1]);
- // return 0;
- //}
- ///* e.g. AMR-WB */
- //else if(sscanf(rtpmap, "%*s") != EOF){
- // *name = tsk_strdup(rtpmap);
- // return 0;
- //}
- //else{
- // TSK_DEBUG_ERROR("%s is not a valid rtpmap value", rtpmap);
- // return -2;
- //}
+ /* e.g. AMR-WB/16000/2 */
+
+ int len;
+ int index, pos = 0;
+
+ if(tsk_strnullORempty(rtpmap)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ *name = tsk_null;
+ *rate = *channels = 0;
+ len = (int)tsk_strlen(rtpmap);
+
+ /* name */
+ if((index = tsk_strindexOf(rtpmap, len, "/")) != -1) {
+ *name = tsk_strndup(rtpmap, index);
+ len -= (index + 1), pos = (index + 1);
+ /* rate */
+ if(len>0) {
+ if((index = tsk_strindexOf((rtpmap + pos), len, "/")) != -1) {
+ *rate = atoi(&rtpmap[pos]);
+ len -= (index + 1), pos += (index + 1);
+ /* channels */
+ if(len>0) {
+ *channels = atoi(&rtpmap[pos]);
+ }
+ }
+ else {
+ *rate = atoi(&rtpmap[pos]);
+ }
+ }
+ }
+ else {
+ *name = tsk_strdup(rtpmap);
+ }
+
+ return 0;
+
+ ///* e.g. AMR-WB/16000/2 */
+ //if(sscanf(rtpmap, "%*s/%*d/%*d") != EOF){
+ // int index = tsk_strindexOf(rtpmap, len, "/");
+ // *name = tsk_strndup(rtpmap, index);
+ // sscanf(&rtpmap[index+1], "%d/%d", rate, channels);
+ // return 0;
+ //}
+ ///* e.g. AMR-WB/16000 */
+ //else if(sscanf(rtpmap, "%*s/%*d") != EOF){
+ // int index = tsk_strindexOf(rtpmap, len, "/");
+ // *name = tsk_strndup(rtpmap, index);
+ // *rate = atoi(&rtpmap[index+1]);
+ // return 0;
+ //}
+ ///* e.g. AMR-WB */
+ //else if(sscanf(rtpmap, "%*s") != EOF){
+ // *name = tsk_strdup(rtpmap);
+ // return 0;
+ //}
+ //else{
+ // TSK_DEBUG_ERROR("%s is not a valid rtpmap value", rtpmap);
+ // return -2;
+ //}
}
int tmedia_video_get_size(tmedia_pref_video_size_t pref_vs, unsigned *width, unsigned *height)
{
- int i;
- for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++){
- if(fmtp_sizes[i].pref_vs == pref_vs){
- if(width) *width = fmtp_sizes[i].width;
- if(height) *height = fmtp_sizes[i].height;
- return 0;
- }
- }
- return -1;
+ int i;
+ for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++) {
+ if(fmtp_sizes[i].pref_vs == pref_vs) {
+ if(width) {
+ *width = fmtp_sizes[i].width;
+ }
+ if(height) {
+ *height = fmtp_sizes[i].height;
+ }
+ return 0;
+ }
+ }
+ return -1;
}
int tmedia_video_get_closest_cif_size(tmedia_pref_video_size_t pref_vs, tmedia_pref_video_size_t *cif_vs)
{
- int i;
- if(!cif_vs){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++){
- if(fmtp_sizes[i].pref_vs <= pref_vs && fmtp_sizes[i].cif_family){
- *cif_vs = fmtp_sizes[i].pref_vs;
- return 0;
- }
- }
- return -2;
+ int i;
+ if(!cif_vs) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++) {
+ if(fmtp_sizes[i].pref_vs <= pref_vs && fmtp_sizes[i].cif_family) {
+ *cif_vs = fmtp_sizes[i].pref_vs;
+ return 0;
+ }
+ }
+ return -2;
}
int tmedia_video_get_closest_pref_size(unsigned width, unsigned height, tmedia_pref_video_size_t *pref_vs)
{
- int i;
- unsigned size;
- if (!pref_vs){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- size = width * height;
- for (i = 0; i<sizeof(fmtp_sizes) / sizeof(fmtp_sizes[0]); i++){
- if (size >= fmtp_sizes[i].height * fmtp_sizes[i].width){
- *pref_vs = fmtp_sizes[i].pref_vs;
- return 0;
- }
- }
- return -2;
+ int i;
+ unsigned size;
+ if (!pref_vs) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ size = width * height;
+ for (i = 0; i<sizeof(fmtp_sizes) / sizeof(fmtp_sizes[0]); i++) {
+ if (size >= fmtp_sizes[i].height * fmtp_sizes[i].width) {
+ *pref_vs = fmtp_sizes[i].pref_vs;
+ return 0;
+ }
+ }
+ return -2;
}
int tmedia_parse_video_fmtp(const char* fmtp, tmedia_pref_video_size_t pref_vs, unsigned* width, unsigned* height, unsigned* fps)
{
- int ret = -2;
- tsk_params_L_t* params = tsk_null;
- const tsk_param_t* param = tsk_null;
- const tsk_list_item_t* item;
- int i;
- tmedia_pref_video_size_t best_vs;
-
- if(!fmtp || !width || !height || !fps){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // set default values
- best_vs = fmtp_sizes[(sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0])) - 1].pref_vs /* last = lowest resolution */;
- ret = tmedia_video_get_size(pref_vs, width, height);
- *fps = 15;
-
- if((params = tsk_params_fromstring(fmtp, ";", tsk_true))){
- // set real values
- tsk_list_foreach(item, params){
- if(!(param = TSK_PARAM(item->data)) || !param->name || !param->value){
- continue;
- }
- for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++){
- if((int)pref_vs >= (int)fmtp_sizes[i].pref_vs && tsk_striequals(fmtp_sizes[i].name, param->name) && ((int)best_vs <= (int)fmtp_sizes[i].pref_vs)){
- *width= fmtp_sizes[i].width;
- *height = fmtp_sizes[i].height;
- *fps = atoi(param->value);
- *fps = *fps ? 30/(*fps) : 15;
- ret = 0;
- best_vs = fmtp_sizes[i].pref_vs;
- // rfc 4629 section 8.2.1: Parameters offered first are the most preferred picture mode to be received.
- // /!\ asterisk do not respect this :)
- /* goto done */;
- }
- }
- }
-/* done: */
- TSK_OBJECT_SAFE_FREE(params);
- }
-
- return ret;
+ int ret = -2;
+ tsk_params_L_t* params = tsk_null;
+ const tsk_param_t* param = tsk_null;
+ const tsk_list_item_t* item;
+ int i;
+ tmedia_pref_video_size_t best_vs;
+
+ if(!fmtp || !width || !height || !fps) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // set default values
+ best_vs = fmtp_sizes[(sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0])) - 1].pref_vs /* last = lowest resolution */;
+ ret = tmedia_video_get_size(pref_vs, width, height);
+ *fps = 15;
+
+ if((params = tsk_params_fromstring(fmtp, ";", tsk_true))) {
+ // set real values
+ tsk_list_foreach(item, params) {
+ if(!(param = TSK_PARAM(item->data)) || !param->name || !param->value) {
+ continue;
+ }
+ for(i=0; i<sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); i++) {
+ if((int)pref_vs >= (int)fmtp_sizes[i].pref_vs && tsk_striequals(fmtp_sizes[i].name, param->name) && ((int)best_vs <= (int)fmtp_sizes[i].pref_vs)) {
+ *width= fmtp_sizes[i].width;
+ *height = fmtp_sizes[i].height;
+ *fps = atoi(param->value);
+ *fps = *fps ? 30/(*fps) : 15;
+ ret = 0;
+ best_vs = fmtp_sizes[i].pref_vs;
+ // rfc 4629 section 8.2.1: Parameters offered first are the most preferred picture mode to be received.
+ // /!\ asterisk do not respect this :)
+ /* goto done */;
+ }
+ }
+ }
+ /* done: */
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+
+ return ret;
}
static void _imageattr_get_best_size(const tmedia_imageattr_set_xt* set, xyvalue_t *width, xyvalue_t *height)
{
- tsk_size_t i;
- if(set->xrange.is_range){
- *width = TSK_MIN(set->xrange.range.end, *width);
- }
- else{
- for(i = 0; i < set->xrange.array.count; ++i){
- *width = TSK_MIN(set->xrange.array.values[i], *width);
- }
- }
- if(set->yrange.is_range){
- *height = TSK_MIN(set->yrange.range.end, *height);
- }
- else{
- for(i = 0; i < set->yrange.array.count; ++i){
- *height = TSK_MIN(set->yrange.array.values[i], *height);
- }
- }
+ tsk_size_t i;
+ if(set->xrange.is_range) {
+ *width = TSK_MIN(set->xrange.range.end, *width);
+ }
+ else {
+ for(i = 0; i < set->xrange.array.count; ++i) {
+ *width = TSK_MIN(set->xrange.array.values[i], *width);
+ }
+ }
+ if(set->yrange.is_range) {
+ *height = TSK_MIN(set->yrange.range.end, *height);
+ }
+ else {
+ for(i = 0; i < set->yrange.array.count; ++i) {
+ *height = TSK_MIN(set->yrange.array.values[i], *height);
+ }
+ }
}
int tmedia_parse_video_imageattr(const char* imageattr, tmedia_pref_video_size_t pref_vs, unsigned* in_width, unsigned* in_height, unsigned* out_width, unsigned* out_height)
{
- tmedia_imageattr_xt attr;
- int ret;
- tsk_size_t i;
-
- if(!imageattr || !in_width || !in_height || !out_width || !out_height){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // set default values
- ret = tmedia_video_get_size(pref_vs, in_width, in_height);
- if(ret != 0){
- TSK_DEBUG_ERROR("tmedia_video_get_size() failed with error code=%d", ret);
- return ret;
- }
- *out_width = *in_width, *out_height = *in_height;
-
- if((ret = tmedia_imageattr_parse(&attr, imageattr, (tsk_size_t)tsk_strlen(imageattr)))){
- TSK_DEBUG_ERROR("Failed to parse");
- return 0; // use default values
- }
-
-
- for(i = 0; i < attr.send.count; ++i) _imageattr_get_best_size(&attr.send.sets[i], (xyvalue_t*)out_width, (xyvalue_t*)out_height);
- for(i = 0; i < attr.recv.count; ++i) _imageattr_get_best_size(&attr.recv.sets[i], (xyvalue_t*)in_width, (xyvalue_t*)in_height);
-
- return 0;
+ tmedia_imageattr_xt attr;
+ int ret;
+ tsk_size_t i;
+
+ if(!imageattr || !in_width || !in_height || !out_width || !out_height) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // set default values
+ ret = tmedia_video_get_size(pref_vs, in_width, in_height);
+ if(ret != 0) {
+ TSK_DEBUG_ERROR("tmedia_video_get_size() failed with error code=%d", ret);
+ return ret;
+ }
+ *out_width = *in_width, *out_height = *in_height;
+
+ if((ret = tmedia_imageattr_parse(&attr, imageattr, (tsk_size_t)tsk_strlen(imageattr)))) {
+ TSK_DEBUG_ERROR("Failed to parse");
+ return 0; // use default values
+ }
+
+
+ for(i = 0; i < attr.send.count; ++i) {
+ _imageattr_get_best_size(&attr.send.sets[i], (xyvalue_t*)out_width, (xyvalue_t*)out_height);
+ }
+ for(i = 0; i < attr.recv.count; ++i) {
+ _imageattr_get_best_size(&attr.recv.sets[i], (xyvalue_t*)in_width, (xyvalue_t*)in_height);
+ }
+
+ return 0;
}
char* tmedia_get_video_fmtp(tmedia_pref_video_size_t pref_vs)
{
- tsk_size_t i;
- char* fmtp = tsk_null;
-
-
- for(i = 0; i < sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); ++i){
- if(fmtp_sizes[i].cif_family && fmtp_sizes[i].pref_vs <= pref_vs){
- if(!fmtp) tsk_strcat_2(&fmtp, "%s=2", fmtp_sizes[i].name);
- else tsk_strcat_2(&fmtp, ";%s=2", fmtp_sizes[i].name);
- }
- }
- return fmtp;
+ tsk_size_t i;
+ char* fmtp = tsk_null;
+
+
+ for(i = 0; i < sizeof(fmtp_sizes)/sizeof(fmtp_sizes[0]); ++i) {
+ if(fmtp_sizes[i].cif_family && fmtp_sizes[i].pref_vs <= pref_vs) {
+ if(!fmtp) {
+ tsk_strcat_2(&fmtp, "%s=2", fmtp_sizes[i].name);
+ }
+ else {
+ tsk_strcat_2(&fmtp, ";%s=2", fmtp_sizes[i].name);
+ }
+ }
+ }
+ return fmtp;
}
char* tmedia_get_video_imageattr(tmedia_pref_video_size_t pref_vs, unsigned in_width, unsigned in_height, unsigned out_width, unsigned out_height)
{
- unsigned width, height;
- const fmtp_size_t* size_min = &fmtp_sizes[(sizeof(fmtp_sizes) / sizeof(fmtp_sizes[0]))-1];
- char* ret = tsk_null;
- if(tmedia_video_get_size(pref_vs, &width, &height) == 0){
- tsk_sprintf(&ret, "recv [x=[%u:16:%u],y=[%u:16:%u]] send [x=[%u:16:%u],y=[%u:16:%u]]",
- size_min->width, in_width, size_min->height, in_height,
- size_min->width, out_width, size_min->height, out_height);
- }
- return ret;
+ unsigned width, height;
+ const fmtp_size_t* size_min = &fmtp_sizes[(sizeof(fmtp_sizes) / sizeof(fmtp_sizes[0]))-1];
+ char* ret = tsk_null;
+ if(tmedia_video_get_size(pref_vs, &width, &height) == 0) {
+ tsk_sprintf(&ret, "recv [x=[%u:16:%u],y=[%u:16:%u]] send [x=[%u:16:%u],y=[%u:16:%u]]",
+ size_min->width, in_width, size_min->height, in_height,
+ size_min->width, out_width, size_min->height, out_height);
+ }
+ return ret;
}
// #retval: 1(best)-31(worst) */
int tmedia_get_video_quality(tmedia_bandwidth_level_t bl)
{
- switch(bl){
- case tmedia_bl_low:
- default: return 13;
- case tmedia_bl_medium: return 9;
- case tmedia_bl_hight: return 5;
- case tmedia_bl_unrestricted: return 1;
- }
+ switch(bl) {
+ case tmedia_bl_low:
+ default:
+ return 13;
+ case tmedia_bl_medium:
+ return 9;
+ case tmedia_bl_hight:
+ return 5;
+ case tmedia_bl_unrestricted:
+ return 1;
+ }
}
int32_t tmedia_get_video_bandwidth_kbps(unsigned width, unsigned height, unsigned fps, unsigned motion_rank)
{
- return (int32_t)((width * height * fps * motion_rank * 0.07) / 1024);
+ return (int32_t)((width * height * fps * motion_rank * 0.07) / 1024);
}
int32_t tmedia_get_video_bandwidth_kbps_2(unsigned width, unsigned height, unsigned fps)
{
- return tmedia_get_video_bandwidth_kbps(width, height, fps, tmedia_defaults_get_video_motion_rank());
+ return tmedia_get_video_bandwidth_kbps(width, height, fps, tmedia_defaults_get_video_motion_rank());
}
int32_t tmedia_get_video_bandwidth_kbps_3()
{
- unsigned width = 3840;
- unsigned height = 2160;
- tmedia_video_get_size(tmedia_defaults_get_pref_video_size(), &width, &height);
- return tmedia_get_video_bandwidth_kbps(width, height, tmedia_defaults_get_video_fps(), tmedia_defaults_get_video_motion_rank());
+ unsigned width = 3840;
+ unsigned height = 2160;
+ tmedia_video_get_size(tmedia_defaults_get_pref_video_size(), &width, &height);
+ return tmedia_get_video_bandwidth_kbps(width, height, tmedia_defaults_get_video_fps(), tmedia_defaults_get_video_motion_rank());
} \ No newline at end of file
diff --git a/tinyMEDIA/src/tmedia_consumer.c b/tinyMEDIA/src/tmedia_consumer.c
index 215a959..96f42be 100755
--- a/tinyMEDIA/src/tmedia_consumer.c
+++ b/tinyMEDIA/src/tmedia_consumer.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,19 +42,19 @@ static const tmedia_consumer_plugin_def_t* __tmedia_consumer_plugins[TMED_CONSUM
*/
int tmedia_consumer_init(tmedia_consumer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->video.in.chroma = TMEDIA_CONSUMER_CHROMA_DEFAULT;
- self->video.display.chroma = TMEDIA_CONSUMER_CHROMA_DEFAULT;
+ self->video.in.chroma = TMEDIA_CONSUMER_CHROMA_DEFAULT;
+ self->video.display.chroma = TMEDIA_CONSUMER_CHROMA_DEFAULT;
- self->audio.bits_per_sample = TMEDIA_CONSUMER_BITS_PER_SAMPLE_DEFAULT;
- self->audio.ptime = tmedia_defaults_get_audio_ptime();
- self->audio.volume = tmedia_defaults_get_volume();
+ self->audio.bits_per_sample = TMEDIA_CONSUMER_BITS_PER_SAMPLE_DEFAULT;
+ self->audio.ptime = tmedia_defaults_get_audio_ptime();
+ self->audio.volume = tmedia_defaults_get_volume();
- return 0;
+ return 0;
}
/**@ingroup tmedia_consumer_group
@@ -62,11 +62,11 @@ int tmedia_consumer_init(tmedia_consumer_t* self)
*/
int tmedia_consumer_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
- if(!self || !self->plugin || !self->plugin->set || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->plugin->set(self, param);
+ if(!self || !self->plugin || !self->plugin->set || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->plugin->set(self, param);
}
/**@ingroup tmedia_consumer_group
@@ -77,15 +77,15 @@ int tmedia_consumer_set(tmedia_consumer_t *self, const tmedia_param_t* param)
*/
int tmedia_consumer_prepare(tmedia_consumer_t *self, const tmedia_codec_t* codec)
{
- int ret;
- if(!self || !self->plugin || !self->plugin->prepare || !codec){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = self->plugin->prepare(self, codec)) == 0){
- self->is_prepared = tsk_true;
- }
- return ret;
+ int ret;
+ if(!self || !self->plugin || !self->plugin->prepare || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = self->plugin->prepare(self, codec)) == 0) {
+ self->is_prepared = tsk_true;
+ }
+ return ret;
}
/**@ingroup tmedia_consumer_group
@@ -95,15 +95,15 @@ int tmedia_consumer_prepare(tmedia_consumer_t *self, const tmedia_codec_t* codec
*/
int tmedia_consumer_start(tmedia_consumer_t *self)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->start) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = self->plugin->start(self)) == 0) {
- self->is_started = tsk_true;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->start) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = self->plugin->start(self)) == 0) {
+ self->is_started = tsk_true;
+ }
+ return ret;
}
/**@ingroup tmedia_consumer_group
@@ -114,11 +114,11 @@ int tmedia_consumer_start(tmedia_consumer_t *self)
*/
int tmedia_consumer_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- if(!self || !self->plugin || !self->plugin->consume){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->plugin->consume(self, buffer, size, proto_hdr);
+ if(!self || !self->plugin || !self->plugin->consume) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->plugin->consume(self, buffer, size, proto_hdr);
}
/**@ingroup tmedia_consumer_group
@@ -128,11 +128,11 @@ int tmedia_consumer_consume(tmedia_consumer_t* self, const void* buffer, tsk_siz
*/
int tmedia_consumer_pause(tmedia_consumer_t *self)
{
- if(!self || !self->plugin || !self->plugin->pause){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->plugin->pause(self);
+ if(!self || !self->plugin || !self->plugin->pause) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->plugin->pause(self);
}
@@ -143,15 +143,15 @@ int tmedia_consumer_pause(tmedia_consumer_t *self)
*/
int tmedia_consumer_stop(tmedia_consumer_t *self)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->stop) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = self->plugin->stop(self)) == 0) {
- self->is_started = tsk_false;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->stop) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = self->plugin->stop(self)) == 0) {
+ self->is_started = tsk_false;
+ }
+ return ret;
}
@@ -164,11 +164,11 @@ int tmedia_consumer_stop(tmedia_consumer_t *self)
*/
int tmedia_consumer_deinit(tmedia_consumer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return 0;
}
/**@ingroup tmedia_consumer_group
@@ -179,22 +179,22 @@ int tmedia_consumer_deinit(tmedia_consumer_t* self)
*/
tmedia_consumer_t* tmedia_consumer_create(tmedia_type_t type, uint64_t session_id)
{
- tmedia_consumer_t* consumer = tsk_null;
- const tmedia_consumer_plugin_def_t* plugin;
- tsk_size_t i = 0;
+ tmedia_consumer_t* consumer = tsk_null;
+ const tmedia_consumer_plugin_def_t* plugin;
+ tsk_size_t i = 0;
- while((i < TMED_CONSUMER_MAX_PLUGINS) && (plugin = __tmedia_consumer_plugins[i++])){
- if(plugin->objdef && plugin->type == type){
- if((consumer = tsk_object_new(plugin->objdef))){
- /* initialize the newly created consumer */
- consumer->plugin = plugin;
- consumer->session_id = session_id;
- break;
- }
- }
- }
+ while((i < TMED_CONSUMER_MAX_PLUGINS) && (plugin = __tmedia_consumer_plugins[i++])) {
+ if(plugin->objdef && plugin->type == type) {
+ if((consumer = tsk_object_new(plugin->objdef))) {
+ /* initialize the newly created consumer */
+ consumer->plugin = plugin;
+ consumer->session_id = session_id;
+ break;
+ }
+ }
+ }
- return consumer;
+ return consumer;
}
/**@ingroup tmedia_consumer_group
@@ -205,22 +205,22 @@ tmedia_consumer_t* tmedia_consumer_create(tmedia_type_t type, uint64_t session_i
*/
int tmedia_consumer_plugin_register(const tmedia_consumer_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_size_t i;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* add or replace the plugin */
- for(i = 0; i<TMED_CONSUMER_MAX_PLUGINS; i++){
- if(!__tmedia_consumer_plugins[i] || (__tmedia_consumer_plugins[i] == plugin)){
- __tmedia_consumer_plugins[i] = plugin;
- return 0;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CONSUMER_MAX_PLUGINS);
- return -2;
+ /* add or replace the plugin */
+ for(i = 0; i<TMED_CONSUMER_MAX_PLUGINS; i++) {
+ if(!__tmedia_consumer_plugins[i] || (__tmedia_consumer_plugins[i] == plugin)) {
+ __tmedia_consumer_plugins[i] = plugin;
+ return 0;
+ }
+ }
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CONSUMER_MAX_PLUGINS);
+ return -2;
}
/**@ingroup tmedia_consumer_group
@@ -230,35 +230,35 @@ int tmedia_consumer_plugin_register(const tmedia_consumer_plugin_def_t* plugin)
*/
int tmedia_consumer_plugin_unregister(const tmedia_consumer_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
- /* find the plugin to unregister */
- for(i = 0; i<TMED_CONSUMER_MAX_PLUGINS && __tmedia_consumer_plugins[i]; i++){
- if(__tmedia_consumer_plugins[i] == plugin){
- __tmedia_consumer_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_CONSUMER_MAX_PLUGINS && __tmedia_consumer_plugins[i]; i++) {
+ if(__tmedia_consumer_plugins[i] == plugin) {
+ __tmedia_consumer_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
- /* compact */
- if(found){
- for(; i<(TMED_CONSUMER_MAX_PLUGINS - 1); i++){
- if(__tmedia_consumer_plugins[i+1]){
- __tmedia_consumer_plugins[i] = __tmedia_consumer_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_consumer_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ /* compact */
+ if(found) {
+ for(; i<(TMED_CONSUMER_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_consumer_plugins[i+1]) {
+ __tmedia_consumer_plugins[i] = __tmedia_consumer_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_consumer_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
/**@ingroup tmedia_consumer_group
@@ -268,21 +268,21 @@ int tmedia_consumer_plugin_unregister(const tmedia_consumer_plugin_def_t* plugin
*/
int tmedia_consumer_plugin_unregister_by_type(tmedia_type_t type)
{
- int i, j;
-
- /* find the plugin to unregister */
- for (i = 0; i < TMED_CONSUMER_MAX_PLUGINS && __tmedia_consumer_plugins[i]; ) {
- if ((__tmedia_consumer_plugins[i]->type & type) == __tmedia_consumer_plugins[i]->type) {
- __tmedia_consumer_plugins[i] = tsk_null;
- /* compact */
- for (j = i; j < (TMED_CONSUMER_MAX_PLUGINS - 1) && __tmedia_consumer_plugins[j + 1]; ++j) {
- __tmedia_consumer_plugins[j] = __tmedia_consumer_plugins[j + 1];
- }
- __tmedia_consumer_plugins[j] = tsk_null;
- }
- else {
- ++i;
- }
- }
- return 0;
+ int i, j;
+
+ /* find the plugin to unregister */
+ for (i = 0; i < TMED_CONSUMER_MAX_PLUGINS && __tmedia_consumer_plugins[i]; ) {
+ if ((__tmedia_consumer_plugins[i]->type & type) == __tmedia_consumer_plugins[i]->type) {
+ __tmedia_consumer_plugins[i] = tsk_null;
+ /* compact */
+ for (j = i; j < (TMED_CONSUMER_MAX_PLUGINS - 1) && __tmedia_consumer_plugins[j + 1]; ++j) {
+ __tmedia_consumer_plugins[j] = __tmedia_consumer_plugins[j + 1];
+ }
+ __tmedia_consumer_plugins[j] = tsk_null;
+ }
+ else {
+ ++i;
+ }
+ }
+ return 0;
}
diff --git a/tinyMEDIA/src/tmedia_converter_video.c b/tinyMEDIA/src/tmedia_converter_video.c
index 27cc252..f19830a 100755
--- a/tinyMEDIA/src/tmedia_converter_video.c
+++ b/tinyMEDIA/src/tmedia_converter_video.c
@@ -2,17 +2,17 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
-*
+*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,93 +34,93 @@ static const tmedia_converter_video_plugin_def_t* __tmedia_converter_video_plugi
tmedia_converter_video_t* tmedia_converter_video_create(tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma)
{
- tmedia_converter_video_t* converter = tsk_null;
- const tmedia_converter_video_plugin_def_t* plugin;
- tsk_size_t i = 0;
+ tmedia_converter_video_t* converter = tsk_null;
+ const tmedia_converter_video_plugin_def_t* plugin;
+ tsk_size_t i = 0;
- while((i < TMED_CONVERTER_VIDEO_MAX_PLUGINS) && (plugin = __tmedia_converter_video_plugins[i++])){
- if(plugin->objdef && (converter = tsk_object_new(plugin->objdef))){
- converter->plugin = plugin;
- converter->scale_rotated_frames = tsk_true;
- // must not set other values beacause 'zero' is meaningful
- if(converter->plugin->init){
- if(converter->plugin->init(converter, srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma)){
- TSK_DEBUG_ERROR("Failed to initialized the video converter");
- TSK_OBJECT_SAFE_FREE(converter);
- continue;
- }
- }
- converter->srcChroma = srcChroma;
- converter->dstChroma = dstChroma;
- converter->srcWidth = srcWidth ? srcWidth : dstWidth;
- converter->srcHeight = srcHeight ? srcHeight : dstHeight;
- converter->dstWidth = dstWidth ? dstWidth : srcWidth;
- converter->dstHeight = dstHeight ? dstHeight : srcHeight;
- break;
- }
- }
+ while((i < TMED_CONVERTER_VIDEO_MAX_PLUGINS) && (plugin = __tmedia_converter_video_plugins[i++])) {
+ if(plugin->objdef && (converter = tsk_object_new(plugin->objdef))) {
+ converter->plugin = plugin;
+ converter->scale_rotated_frames = tsk_true;
+ // must not set other values beacause 'zero' is meaningful
+ if(converter->plugin->init) {
+ if(converter->plugin->init(converter, srcWidth, srcHeight, srcChroma, dstWidth, dstHeight, dstChroma)) {
+ TSK_DEBUG_ERROR("Failed to initialized the video converter");
+ TSK_OBJECT_SAFE_FREE(converter);
+ continue;
+ }
+ }
+ converter->srcChroma = srcChroma;
+ converter->dstChroma = dstChroma;
+ converter->srcWidth = srcWidth ? srcWidth : dstWidth;
+ converter->srcHeight = srcHeight ? srcHeight : dstHeight;
+ converter->dstWidth = dstWidth ? dstWidth : srcWidth;
+ converter->dstHeight = dstHeight ? dstHeight : srcHeight;
+ break;
+ }
+ }
- return converter;
+ return converter;
}
int tmedia_converter_video_plugin_register(const tmedia_converter_video_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_size_t i;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* add or replace the plugin */
+ for(i = 0; i<TMED_CONVERTER_VIDEO_MAX_PLUGINS; i++) {
+ if(!__tmedia_converter_video_plugins[i] || (__tmedia_converter_video_plugins[i] == plugin)) {
+ __tmedia_converter_video_plugins[i] = plugin;
+ return 0;
+ }
+ }
- /* add or replace the plugin */
- for(i = 0; i<TMED_CONVERTER_VIDEO_MAX_PLUGINS; i++){
- if(!__tmedia_converter_video_plugins[i] || (__tmedia_converter_video_plugins[i] == plugin)){
- __tmedia_converter_video_plugins[i] = plugin;
- return 0;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CONVERTER_VIDEO_MAX_PLUGINS);
- return -2;
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_CONVERTER_VIDEO_MAX_PLUGINS);
+ return -2;
}
tsk_size_t tmedia_converter_video_plugin_registry_count()
{
- tsk_size_t count;
- for(count = 0;
- count < TMED_CONVERTER_VIDEO_MAX_PLUGINS && __tmedia_converter_video_plugins[count];
- ++count) ;
- return count;
+ tsk_size_t count;
+ for(count = 0;
+ count < TMED_CONVERTER_VIDEO_MAX_PLUGINS && __tmedia_converter_video_plugins[count];
+ ++count) ;
+ return count;
}
int tmedia_converter_video_plugin_unregister(const tmedia_converter_video_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
- /* find the plugin to unregister */
- for(i = 0; i<TMED_CONVERTER_VIDEO_MAX_PLUGINS && __tmedia_converter_video_plugins[i]; i++){
- if(__tmedia_converter_video_plugins[i] == plugin){
- __tmedia_converter_video_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_CONVERTER_VIDEO_MAX_PLUGINS && __tmedia_converter_video_plugins[i]; i++) {
+ if(__tmedia_converter_video_plugins[i] == plugin) {
+ __tmedia_converter_video_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
- /* compact */
- if(found){
- for(; i<(TMED_CONVERTER_VIDEO_MAX_PLUGINS - 1); i++){
- if(__tmedia_converter_video_plugins[i+1]){
- __tmedia_converter_video_plugins[i] = __tmedia_converter_video_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_converter_video_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ /* compact */
+ if(found) {
+ for(; i<(TMED_CONVERTER_VIDEO_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_converter_video_plugins[i+1]) {
+ __tmedia_converter_video_plugins[i] = __tmedia_converter_video_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_converter_video_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
diff --git a/tinyMEDIA/src/tmedia_defaults.c b/tinyMEDIA/src/tmedia_defaults.c
index b24c153..0c33b5b 100755
--- a/tinyMEDIA/src/tmedia_defaults.c
+++ b/tinyMEDIA/src/tmedia_defaults.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -30,12 +30,15 @@
static tmedia_profile_t __profile = tmedia_profile_default;
static tmedia_bandwidth_level_t __bl = tmedia_bl_unrestricted;
-static tsk_bool_t __congestion_ctrl_enabled = tsk_false;
+static tsk_bool_t __congestion_ctrl_enabled = tsk_true;
static int32_t __video_fps = 15; // allowed values: ]0 - 120]
static int32_t __video_motion_rank = 2; // allowed values: 1(low), 2(medium) or 4(high)
static int32_t __bw_video_up_max_kbps = INT_MAX; // <= 0: unrestricted, Unit: kbps
static int32_t __bw_video_down_max_kbps = INT_MAX; // <= 0: unrestricted, Unit: kbps
-static tmedia_pref_video_size_t __pref_video_size = tmedia_pref_video_size_cif; // 352 x 288: Android, iOS, WP7
+static tmedia_pref_video_size_t __pref_video_size = tmedia_pref_video_size_cif; // 352 x 288: Android, iOS, WP7
+static tmedia_pref_video_size_t __pref_video_size_range_min = tmedia_pref_video_size_cif;
+static tmedia_pref_video_size_t __pref_video_size_range_max = tmedia_pref_video_size_cif;
+static tsk_bool_t __pref_video_size_range_enabled = tsk_false;
static int32_t __jb_margin_ms = -1; // disable
static int32_t __jb_max_late_rate_percent = -1; // -1: disable 4: default for speex
static uint32_t __echo_tail = 100;
@@ -96,510 +99,692 @@ static unsigned short __webproxy_port = 0;
static char* __webproxy_login = tsk_null;
static char* __webproxy_password = tsk_null;
-int tmedia_defaults_set_profile(tmedia_profile_t profile){
- __profile = profile;
- return 0;
+int tmedia_defaults_set_profile(tmedia_profile_t profile)
+{
+ __profile = profile;
+ return 0;
}
-tmedia_profile_t tmedia_defaults_get_profile(){
- return __profile;
+tmedia_profile_t tmedia_defaults_get_profile()
+{
+ return __profile;
}
// @deprecated
-int tmedia_defaults_set_bl(tmedia_bandwidth_level_t bl){
- __bl = bl;
- return 0;
+int tmedia_defaults_set_bl(tmedia_bandwidth_level_t bl)
+{
+ __bl = bl;
+ return 0;
}
// @deprecated
-tmedia_bandwidth_level_t tmedia_defaults_get_bl(){
- return __bl;
+tmedia_bandwidth_level_t tmedia_defaults_get_bl()
+{
+ return __bl;
}
-int tmedia_defaults_set_congestion_ctrl_enabled(tsk_bool_t enabled){
- __congestion_ctrl_enabled = enabled;
- return 0;
+int tmedia_defaults_set_congestion_ctrl_enabled(tsk_bool_t enabled)
+{
+ __congestion_ctrl_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_congestion_ctrl_enabled(){
- return __congestion_ctrl_enabled;
+tsk_bool_t tmedia_defaults_get_congestion_ctrl_enabled()
+{
+ return __congestion_ctrl_enabled;
}
-int tmedia_defaults_set_video_fps(int32_t video_fps){
- if(video_fps > 0 && video_fps <= 120){
- __video_fps = video_fps;
- return 0;
- }
- TSK_DEBUG_ERROR("%d not valid for video fps", video_fps);
- return -1;
+int tmedia_defaults_set_video_fps(int32_t video_fps)
+{
+ if(video_fps > 0 && video_fps <= 120) {
+ __video_fps = video_fps;
+ return 0;
+ }
+ TSK_DEBUG_ERROR("%d not valid for video fps", video_fps);
+ return -1;
+}
+int32_t tmedia_defaults_get_video_fps()
+{
+ return __video_fps;
}
-int32_t tmedia_defaults_get_video_fps(){
- return __video_fps;
+
+int tmedia_defaults_set_video_motion_rank(int32_t video_motion_rank)
+{
+ switch(video_motion_rank) {
+ case 1/*low*/:
+ case 2/*medium*/:
+ case 4/*high*/:
+ __video_motion_rank = video_motion_rank;
+ return 0;
+ default:
+ TSK_DEBUG_ERROR("%d not valid for video motion rank. Must be 1, 2 or 4", video_motion_rank);
+ return -1;
+ }
+}
+int32_t tmedia_defaults_get_video_motion_rank()
+{
+ return __video_motion_rank;
}
-int tmedia_defaults_set_video_motion_rank(int32_t video_motion_rank){
- switch(video_motion_rank){
- case 1/*low*/: case 2/*medium*/: case 4/*high*/: __video_motion_rank = video_motion_rank; return 0;
- default: TSK_DEBUG_ERROR("%d not valid for video motion rank. Must be 1, 2 or 4", video_motion_rank); return -1;
- }
+int tmedia_defaults_set_bandwidth_video_upload_max(int32_t bw_video_up_max_kbps)
+{
+ __bw_video_up_max_kbps = bw_video_up_max_kbps > 0 ? bw_video_up_max_kbps : INT_MAX;
+ return 0;
}
-int32_t tmedia_defaults_get_video_motion_rank(){
- return __video_motion_rank;
+int32_t tmedia_defaults_get_bandwidth_video_upload_max()
+{
+ return __bw_video_up_max_kbps;
}
-int tmedia_defaults_set_bandwidth_video_upload_max(int32_t bw_video_up_max_kbps){
- __bw_video_up_max_kbps = bw_video_up_max_kbps > 0 ? bw_video_up_max_kbps : INT_MAX;
- return 0;
+int tmedia_defaults_set_bandwidth_video_download_max(int32_t bw_video_down_max_kbps)
+{
+ __bw_video_down_max_kbps = bw_video_down_max_kbps > 0 ? bw_video_down_max_kbps : INT_MAX;
+ return 0;
}
-int32_t tmedia_defaults_get_bandwidth_video_upload_max(){
- return __bw_video_up_max_kbps;
+int32_t tmedia_defaults_get_bandwidth_video_download_max()
+{
+ return __bw_video_down_max_kbps;
}
-int tmedia_defaults_set_bandwidth_video_download_max(int32_t bw_video_down_max_kbps){
- __bw_video_down_max_kbps = bw_video_down_max_kbps > 0 ? bw_video_down_max_kbps : INT_MAX;
- return 0;
+int tmedia_defaults_set_pref_video_size(tmedia_pref_video_size_t pref_video_size)
+{
+ __pref_video_size = pref_video_size;
+ return 0;
}
-int32_t tmedia_defaults_get_bandwidth_video_download_max(){
- return __bw_video_down_max_kbps;
+tmedia_pref_video_size_t tmedia_defaults_get_pref_video_size()
+{
+ return __pref_video_size;
}
-int tmedia_defaults_set_pref_video_size(tmedia_pref_video_size_t pref_video_size){
- __pref_video_size = pref_video_size;
- return 0;
+int tmedia_defaults_set_pref_video_size_range(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max)
+{
+ if (min <= max) {
+ __pref_video_size_range_min = min;
+ __pref_video_size_range_max = max;
+ return 0;
+ }
+ return -1;
+}
+int tmedia_defaults_get_pref_video_size_range(tmedia_pref_video_size_t *min, tmedia_pref_video_size_t* max)
+{
+ if (min) {
+ *min = __pref_video_size_range_min;
+ }
+ if (max) {
+ *max = __pref_video_size_range_max;
+ }
+ return 0;
}
-tmedia_pref_video_size_t tmedia_defaults_get_pref_video_size(){
- return __pref_video_size;
+
+int tmedia_defaults_set_adapt_video_size_range_enabled(tsk_bool_t enabled)
+{
+ __pref_video_size_range_enabled = enabled;
+ return 0;
+}
+tsk_bool_t tmedia_defaults_get_adapt_video_size_range_enabled()
+{
+ return __pref_video_size_range_enabled;
}
-int tmedia_defaults_set_jb_margin(int32_t jb_margin_ms){
- __jb_margin_ms = jb_margin_ms;
- return __jb_margin_ms;
+int tmedia_defaults_set_jb_margin(int32_t jb_margin_ms)
+{
+ __jb_margin_ms = jb_margin_ms;
+ return __jb_margin_ms;
}
-int32_t tmedia_defaults_get_jb_margin(){
- return __jb_margin_ms;
+int32_t tmedia_defaults_get_jb_margin()
+{
+ return __jb_margin_ms;
}
-int tmedia_defaults_set_jb_max_late_rate(int32_t jb_max_late_rate_percent){
- __jb_max_late_rate_percent = jb_max_late_rate_percent;
- return 0;
+int tmedia_defaults_set_jb_max_late_rate(int32_t jb_max_late_rate_percent)
+{
+ __jb_max_late_rate_percent = jb_max_late_rate_percent;
+ return 0;
}
-int32_t tmedia_defaults_get_jb_max_late_rate(){
- return __jb_max_late_rate_percent;
+int32_t tmedia_defaults_get_jb_max_late_rate()
+{
+ return __jb_max_late_rate_percent;
}
-int tmedia_defaults_set_echo_tail(uint32_t echo_tail){
- __echo_tail = echo_tail;
- return 0;
+int tmedia_defaults_set_echo_tail(uint32_t echo_tail)
+{
+ __echo_tail = echo_tail;
+ return 0;
}
-int tmedia_defaults_set_echo_skew(uint32_t echo_skew){
- __echo_skew = echo_skew;
- return 0;
+int tmedia_defaults_set_echo_skew(uint32_t echo_skew)
+{
+ __echo_skew = echo_skew;
+ return 0;
}
uint32_t tmedia_defaults_get_echo_tail()
{
- return __echo_tail;
+ return __echo_tail;
}
-uint32_t tmedia_defaults_get_echo_skew(){
- return __echo_skew;
+uint32_t tmedia_defaults_get_echo_skew()
+{
+ return __echo_skew;
}
-int tmedia_defaults_set_echo_supp_enabled(tsk_bool_t echo_supp_enabled){
- __echo_supp_enabled = echo_supp_enabled;
- return 0;
+int tmedia_defaults_set_echo_supp_enabled(tsk_bool_t echo_supp_enabled)
+{
+ __echo_supp_enabled = echo_supp_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_echo_supp_enabled(){
- return __echo_supp_enabled;
+tsk_bool_t tmedia_defaults_get_echo_supp_enabled()
+{
+ return __echo_supp_enabled;
}
-int tmedia_defaults_set_agc_enabled(tsk_bool_t agc_enabled){
- __agc_enabled = agc_enabled;
- return 0;
+int tmedia_defaults_set_agc_enabled(tsk_bool_t agc_enabled)
+{
+ __agc_enabled = agc_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_agc_enabled(){
- return __agc_enabled;
+tsk_bool_t tmedia_defaults_get_agc_enabled()
+{
+ return __agc_enabled;
}
-int tmedia_defaults_set_agc_level(float agc_level){
- __agc_level = agc_level;
- return 0;
+int tmedia_defaults_set_agc_level(float agc_level)
+{
+ __agc_level = agc_level;
+ return 0;
}
float tmedia_defaults_get_agc_level()
{
- return __agc_level;
+ return __agc_level;
}
-int tmedia_defaults_set_vad_enabled(tsk_bool_t vad_enabled){
- __vad_enabled = vad_enabled;
- return 0;
+int tmedia_defaults_set_vad_enabled(tsk_bool_t vad_enabled)
+{
+ __vad_enabled = vad_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_vad_enabled(){
- return __vad_enabled;
+tsk_bool_t tmedia_defaults_get_vad_enabled()
+{
+ return __vad_enabled;
}
-int tmedia_defaults_set_noise_supp_enabled(tsk_bool_t noise_supp_enabled){
- __noise_supp_enabled = noise_supp_enabled;
- return 0;
+int tmedia_defaults_set_noise_supp_enabled(tsk_bool_t noise_supp_enabled)
+{
+ __noise_supp_enabled = noise_supp_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_noise_supp_enabled(){
- return __noise_supp_enabled;
+tsk_bool_t tmedia_defaults_get_noise_supp_enabled()
+{
+ return __noise_supp_enabled;
}
-int tmedia_defaults_set_noise_supp_level(int32_t noise_supp_level){
- __noise_supp_level = noise_supp_level;
- return 0;
+int tmedia_defaults_set_noise_supp_level(int32_t noise_supp_level)
+{
+ __noise_supp_level = noise_supp_level;
+ return 0;
}
-int32_t tmedia_defaults_get_noise_supp_level(){
- return __noise_supp_level;
+int32_t tmedia_defaults_get_noise_supp_level()
+{
+ return __noise_supp_level;
}
-int tmedia_defaults_set_100rel_enabled(tsk_bool_t _100rel_enabled){
- __100rel_enabled = _100rel_enabled;
- return 0;
+int tmedia_defaults_set_100rel_enabled(tsk_bool_t _100rel_enabled)
+{
+ __100rel_enabled = _100rel_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_100rel_enabled(){
- return __100rel_enabled;
+tsk_bool_t tmedia_defaults_get_100rel_enabled()
+{
+ return __100rel_enabled;
}
-int tmedia_defaults_set_screen_size(int32_t sx, int32_t sy){
- __sx = sx;
- __sy = sy;
- return 0;
+int tmedia_defaults_set_screen_size(int32_t sx, int32_t sy)
+{
+ __sx = sx;
+ __sy = sy;
+ return 0;
}
-int32_t tmedia_defaults_get_screen_x(){
- return __sx;
+int32_t tmedia_defaults_get_screen_x()
+{
+ return __sx;
}
-int32_t tmedia_defaults_get_screen_y(){
- return __sy;
+int32_t tmedia_defaults_get_screen_y()
+{
+ return __sy;
}
-int tmedia_defaults_set_audio_ptime(int32_t audio_ptime){
- if(audio_ptime > 0){
- __audio_ptime = audio_ptime;
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
-}
-int32_t tmedia_defaults_get_audio_ptime(){
- return __audio_ptime;
+int tmedia_defaults_set_audio_ptime(int32_t audio_ptime)
+{
+ if(audio_ptime > 0) {
+ __audio_ptime = audio_ptime;
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+}
+int32_t tmedia_defaults_get_audio_ptime()
+{
+ return __audio_ptime;
}
-int tmedia_defaults_set_audio_channels(int32_t channels_playback, int32_t channels_record){
- if(channels_playback != 1 && channels_playback != 2) { TSK_DEBUG_ERROR("Invalid parameter"); return -1; }
- if(channels_record != 1 && channels_record != 2) { TSK_DEBUG_ERROR("Invalid parameter"); return -1; }
- __audio_channels_playback = channels_playback;
- __audio_channels_record = channels_record;
- return 0;
+int tmedia_defaults_set_audio_channels(int32_t channels_playback, int32_t channels_record)
+{
+ if(channels_playback != 1 && channels_playback != 2) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(channels_record != 1 && channels_record != 2) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ __audio_channels_playback = channels_playback;
+ __audio_channels_record = channels_record;
+ return 0;
}
-int32_t tmedia_defaults_get_audio_channels_playback(){
- return __audio_channels_playback;
+int32_t tmedia_defaults_get_audio_channels_playback()
+{
+ return __audio_channels_playback;
}
-int32_t tmedia_defaults_get_audio_channels_record(){
- return __audio_channels_record;
+int32_t tmedia_defaults_get_audio_channels_record()
+{
+ return __audio_channels_record;
}
-int tmedia_defaults_set_audio_gain(int32_t audio_producer_gain, int32_t audio_consumer_gain){
- __audio_producer_gain = audio_producer_gain;
- __audio_consumer_gain = audio_consumer_gain;
- return 0;
+int tmedia_defaults_set_audio_gain(int32_t audio_producer_gain, int32_t audio_consumer_gain)
+{
+ __audio_producer_gain = audio_producer_gain;
+ __audio_consumer_gain = audio_consumer_gain;
+ return 0;
}
-int32_t tmedia_defaults_get_audio_producer_gain(){
- return __audio_producer_gain;
+int32_t tmedia_defaults_get_audio_producer_gain()
+{
+ return __audio_producer_gain;
}
-int32_t tmedia_defaults_get_audio_consumer_gain(){
- return __audio_consumer_gain;
+int32_t tmedia_defaults_get_audio_consumer_gain()
+{
+ return __audio_consumer_gain;
}
-uint16_t tmedia_defaults_get_rtp_port_range_start(){
- return __rtp_port_range_start;
+uint16_t tmedia_defaults_get_rtp_port_range_start()
+{
+ return __rtp_port_range_start;
}
-uint16_t tmedia_defaults_get_rtp_port_range_stop(){
- return __rtp_port_range_stop;
+uint16_t tmedia_defaults_get_rtp_port_range_stop()
+{
+ return __rtp_port_range_stop;
}
-int tmedia_defaults_set_rtp_port_range(uint16_t start, uint16_t stop){
- if(start < 1024 || stop < 1024 || start >= stop){
- TSK_DEBUG_ERROR("Invalid parameter: (%u < 1024 || %u < 1024 || %u >= %u)", start, stop, start, stop);
- return -1;
- }
- __rtp_port_range_start = start;
- __rtp_port_range_stop = stop;
- return 0;
+int tmedia_defaults_set_rtp_port_range(uint16_t start, uint16_t stop)
+{
+ if(start < 1024 || stop < 1024 || start >= stop) {
+ TSK_DEBUG_ERROR("Invalid parameter: (%u < 1024 || %u < 1024 || %u >= %u)", start, stop, start, stop);
+ return -1;
+ }
+ __rtp_port_range_start = start;
+ __rtp_port_range_stop = stop;
+ return 0;
}
-int tmedia_defaults_set_rtp_symetric_enabled(tsk_bool_t enabled){
- __rtp_symetric_enabled = enabled;
- return 0;
+int tmedia_defaults_set_rtp_symetric_enabled(tsk_bool_t enabled)
+{
+ __rtp_symetric_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_rtp_symetric_enabled(){
- return __rtp_symetric_enabled;
+tsk_bool_t tmedia_defaults_get_rtp_symetric_enabled()
+{
+ return __rtp_symetric_enabled;
}
-tmedia_type_t tmedia_defaults_get_media_type(){
- return __media_type;
+tmedia_type_t tmedia_defaults_get_media_type()
+{
+ return __media_type;
}
-int tmedia_defaults_set_media_type(tmedia_type_t media_type){
- __media_type = media_type;
- return 0;
+int tmedia_defaults_set_media_type(tmedia_type_t media_type)
+{
+ __media_type = media_type;
+ return 0;
}
-int tmedia_defaults_set_volume(int32_t volume){
- __volume = TSK_CLAMP(0, volume, 100);
- return 0;
+int tmedia_defaults_set_volume(int32_t volume)
+{
+ __volume = TSK_CLAMP(0, volume, 100);
+ return 0;
}
-int32_t tmedia_defaults_get_volume(){
- return __volume;
+int32_t tmedia_defaults_get_volume()
+{
+ return __volume;
}
-int tmedia_producer_set_friendly_name(tmedia_type_t media_type, const char* friendly_name) {
- if(media_type != tmedia_audio && media_type != tmedia_video && media_type != tmedia_bfcp_video) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_strupdate(&__producer_friendly_name[(media_type == tmedia_audio) ? 0 : (media_type == tmedia_bfcp_video ? 2 : 1)], friendly_name);
- return 0;
+int tmedia_producer_set_friendly_name(tmedia_type_t media_type, const char* friendly_name)
+{
+ if(media_type != tmedia_audio && media_type != tmedia_video && media_type != tmedia_bfcp_video) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_strupdate(&__producer_friendly_name[(media_type == tmedia_audio) ? 0 : (media_type == tmedia_bfcp_video ? 2 : 1)], friendly_name);
+ return 0;
}
-const char* tmedia_producer_get_friendly_name(tmedia_type_t media_type){
- if(media_type != tmedia_audio && media_type != tmedia_video && media_type != tmedia_bfcp_video) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- return __producer_friendly_name[(media_type == tmedia_audio) ? 0 : (media_type == tmedia_bfcp_video ? 2 : 1)];
+const char* tmedia_producer_get_friendly_name(tmedia_type_t media_type)
+{
+ if(media_type != tmedia_audio && media_type != tmedia_video && media_type != tmedia_bfcp_video) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ return __producer_friendly_name[(media_type == tmedia_audio) ? 0 : (media_type == tmedia_bfcp_video ? 2 : 1)];
}
-int32_t tmedia_defaults_get_inv_session_expires(){
- return __inv_session_expires;
+int32_t tmedia_defaults_get_inv_session_expires()
+{
+ return __inv_session_expires;
}
-int tmedia_defaults_set_inv_session_expires(int32_t timeout){
- if(timeout >= 0){
- __inv_session_expires = timeout;
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+int tmedia_defaults_set_inv_session_expires(int32_t timeout)
+{
+ if(timeout >= 0) {
+ __inv_session_expires = timeout;
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
-const char* tmedia_defaults_get_inv_session_refresher(){
- return __inv_session_refresher;
+const char* tmedia_defaults_get_inv_session_refresher()
+{
+ return __inv_session_refresher;
}
-int tmedia_defaults_set_inv_session_refresher(const char* refresher){
- tsk_strupdate(&__inv_session_refresher, refresher);
- return 0;
+int tmedia_defaults_set_inv_session_refresher(const char* refresher)
+{
+ tsk_strupdate(&__inv_session_refresher, refresher);
+ return 0;
}
-tmedia_srtp_mode_t tmedia_defaults_get_srtp_mode(){
- return __srtp_mode;
+tmedia_srtp_mode_t tmedia_defaults_get_srtp_mode()
+{
+ return __srtp_mode;
}
-int tmedia_defaults_set_srtp_mode(tmedia_srtp_mode_t mode){
- __srtp_mode = mode;
- return 0;
+int tmedia_defaults_set_srtp_mode(tmedia_srtp_mode_t mode)
+{
+ __srtp_mode = mode;
+ return 0;
}
-tmedia_srtp_type_t tmedia_defaults_get_srtp_type(){
- return __srtp_type;
+tmedia_srtp_type_t tmedia_defaults_get_srtp_type()
+{
+ return __srtp_type;
}
-int tmedia_defaults_set_srtp_type(tmedia_srtp_type_t srtp_type){
- __srtp_type = srtp_type;
- return 0;
+int tmedia_defaults_set_srtp_type(tmedia_srtp_type_t srtp_type)
+{
+ __srtp_type = srtp_type;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_rtcp_enabled(){
- return __rtcp_enabled;
+tsk_bool_t tmedia_defaults_get_rtcp_enabled()
+{
+ return __rtcp_enabled;
}
-int tmedia_defaults_set_rtcp_enabled(tsk_bool_t rtcp_enabled){
- __rtcp_enabled = rtcp_enabled;
- return 0;
+int tmedia_defaults_set_rtcp_enabled(tsk_bool_t rtcp_enabled)
+{
+ __rtcp_enabled = rtcp_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_rtcpmux_enabled(){
- return __rtcpmux_enabled;
+tsk_bool_t tmedia_defaults_get_rtcpmux_enabled()
+{
+ return __rtcpmux_enabled;
}
-int tmedia_defaults_set_rtcpmux_enabled(tsk_bool_t rtcpmux_enabled){
- __rtcpmux_enabled = rtcpmux_enabled;
- return 0;
+int tmedia_defaults_set_rtcpmux_enabled(tsk_bool_t rtcpmux_enabled)
+{
+ __rtcpmux_enabled = rtcpmux_enabled;
+ return 0;
}
-int tmedia_defaults_set_stun_server(const char* server_ip, uint16_t server_port){
- tsk_strupdate(&__stun_server_ip, server_ip);
- __stun_server_port = server_port;
- return 0;
+int tmedia_defaults_set_stun_server(const char* server_ip, uint16_t server_port)
+{
+ tsk_strupdate(&__stun_server_ip, server_ip);
+ __stun_server_port = server_port;
+ return 0;
}
-int tmedia_defaults_get_stun_server(const char** server_ip, uint16_t*const server_port){
- static const char* __stun_server_ip_default = "numb.viagenie.ca"; // default server for backward compatibility
- if(server_ip) *server_ip = tsk_strnullORempty(__stun_server_ip) ? __stun_server_ip_default : __stun_server_ip;
- if(server_port) *server_port = __stun_server_port;
- return 0;
+int tmedia_defaults_get_stun_server(const char** server_ip, uint16_t*const server_port)
+{
+ static const char* __stun_server_ip_default = "numb.viagenie.ca"; // default server for backward compatibility
+ if(server_ip) {
+ *server_ip = tsk_strnullORempty(__stun_server_ip) ? __stun_server_ip_default : __stun_server_ip;
+ }
+ if(server_port) {
+ *server_port = __stun_server_port;
+ }
+ return 0;
}
-int tmedia_defaults_set_stun_cred(const char* usr_name, const char* usr_pwd) {
- tsk_strupdate(&__stun_usr_name, usr_name);
- tsk_strupdate(&__stun_usr_pwd, usr_pwd);
- return 0;
+int tmedia_defaults_set_stun_cred(const char* usr_name, const char* usr_pwd)
+{
+ tsk_strupdate(&__stun_usr_name, usr_name);
+ tsk_strupdate(&__stun_usr_pwd, usr_pwd);
+ return 0;
}
-int tmedia_defaults_get_stun_cred(const char** usr_name, const char** usr_pwd){
- if(usr_name) *usr_name = __stun_usr_name;
- if(usr_pwd) *usr_pwd = __stun_usr_pwd;
- return 0;
+int tmedia_defaults_get_stun_cred(const char** usr_name, const char** usr_pwd)
+{
+ if(usr_name) {
+ *usr_name = __stun_usr_name;
+ }
+ if(usr_pwd) {
+ *usr_pwd = __stun_usr_pwd;
+ }
+ return 0;
}
-int tmedia_defaults_set_stun_enabled(tsk_bool_t stun_enabled){
- __stun_enabled = stun_enabled;
- return 0;
+int tmedia_defaults_set_stun_enabled(tsk_bool_t stun_enabled)
+{
+ __stun_enabled = stun_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_stun_enabled(){
- return __stun_enabled;
+tsk_bool_t tmedia_defaults_get_stun_enabled()
+{
+ return __stun_enabled;
}
-int tmedia_defaults_set_icestun_enabled(tsk_bool_t icestun_enabled){
- __icestun_enabled = icestun_enabled;
- return 0;
+int tmedia_defaults_set_icestun_enabled(tsk_bool_t icestun_enabled)
+{
+ __icestun_enabled = icestun_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_icestun_enabled(){
- return __icestun_enabled;
+tsk_bool_t tmedia_defaults_get_icestun_enabled()
+{
+ return __icestun_enabled;
}
-int tmedia_defaults_set_iceturn_enabled(tsk_bool_t iceturn_enabled){
- __iceturn_enabled = iceturn_enabled;
- return 0;
+int tmedia_defaults_set_iceturn_enabled(tsk_bool_t iceturn_enabled)
+{
+ __iceturn_enabled = iceturn_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_iceturn_enabled(){
- return __iceturn_enabled;
+tsk_bool_t tmedia_defaults_get_iceturn_enabled()
+{
+ return __iceturn_enabled;
}
-int tmedia_defaults_set_ice_enabled(tsk_bool_t ice_enabled){
- __ice_enabled = ice_enabled;
- return 0;
+int tmedia_defaults_set_ice_enabled(tsk_bool_t ice_enabled)
+{
+ __ice_enabled = ice_enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_ice_enabled(){
- return __ice_enabled;
+tsk_bool_t tmedia_defaults_get_ice_enabled()
+{
+ return __ice_enabled;
}
-int tmedia_defaults_set_bypass_encoding(tsk_bool_t enabled){
- __bypass_encoding_enabled = enabled;
- return 0;
+int tmedia_defaults_set_bypass_encoding(tsk_bool_t enabled)
+{
+ __bypass_encoding_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_bypass_encoding(){
- return __bypass_encoding_enabled;
+tsk_bool_t tmedia_defaults_get_bypass_encoding()
+{
+ return __bypass_encoding_enabled;
}
-int tmedia_defaults_set_bypass_decoding(tsk_bool_t enabled){
- __bypass_decoding_enabled = enabled;
- return 0;
+int tmedia_defaults_set_bypass_decoding(tsk_bool_t enabled)
+{
+ __bypass_decoding_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_bypass_decoding(){
- return __bypass_decoding_enabled;
+tsk_bool_t tmedia_defaults_get_bypass_decoding()
+{
+ return __bypass_decoding_enabled;
}
-int tmedia_defaults_set_videojb_enabled(tsk_bool_t enabled){
- __videojb_enabled = enabled;
- return 0;
+int tmedia_defaults_set_videojb_enabled(tsk_bool_t enabled)
+{
+ __videojb_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_videojb_enabled(){
- return __videojb_enabled;
+tsk_bool_t tmedia_defaults_get_videojb_enabled()
+{
+ return __videojb_enabled;
}
-int tmedia_defaults_set_video_zeroartifacts_enabled(tsk_bool_t enabled){
- __video_zeroartifacts_enabled = enabled;
- return 0;
+int tmedia_defaults_set_video_zeroartifacts_enabled(tsk_bool_t enabled)
+{
+ __video_zeroartifacts_enabled = enabled;
+ return 0;
}
-tsk_bool_t tmedia_defaults_get_video_zeroartifacts_enabled(){
- return __video_zeroartifacts_enabled;
+tsk_bool_t tmedia_defaults_get_video_zeroartifacts_enabled()
+{
+ return __video_zeroartifacts_enabled;
}
-int tmedia_defaults_set_rtpbuff_size(tsk_size_t rtpbuff_size){
- __rtpbuff_size = rtpbuff_size;
- return 0;
+int tmedia_defaults_set_rtpbuff_size(tsk_size_t rtpbuff_size)
+{
+ __rtpbuff_size = rtpbuff_size;
+ return 0;
}
-tsk_size_t tmedia_defaults_get_rtpbuff_size(){
- return __rtpbuff_size;
+tsk_size_t tmedia_defaults_get_rtpbuff_size()
+{
+ return __rtpbuff_size;
}
-int tmedia_defaults_set_avpf_tail(tsk_size_t tail_min, tsk_size_t tail_max){
- __avpf_tail_min = tail_min;
- __avpf_tail_max = tail_max;
- return 0;
+int tmedia_defaults_set_avpf_tail(tsk_size_t tail_min, tsk_size_t tail_max)
+{
+ __avpf_tail_min = tail_min;
+ __avpf_tail_max = tail_max;
+ return 0;
}
-tsk_size_t tmedia_defaults_get_avpf_tail_min(){
- return __avpf_tail_min;
+tsk_size_t tmedia_defaults_get_avpf_tail_min()
+{
+ return __avpf_tail_min;
}
-tsk_size_t tmedia_defaults_get_avpf_tail_max(){
- return __avpf_tail_max;
+tsk_size_t tmedia_defaults_get_avpf_tail_max()
+{
+ return __avpf_tail_max;
}
-int tmedia_defaults_set_avpf_mode(enum tmedia_mode_e mode) {
- __avpf_mode = mode;
- return 0;
+int tmedia_defaults_set_avpf_mode(enum tmedia_mode_e mode)
+{
+ __avpf_mode = mode;
+ return 0;
}
-enum tmedia_mode_e tmedia_defaults_get_avpf_mode() {
- return __avpf_mode;
+enum tmedia_mode_e tmedia_defaults_get_avpf_mode()
+{
+ return __avpf_mode;
}
-int tmedia_defaults_set_opus_maxcapturerate(uint32_t opus_maxcapturerate){
- switch(opus_maxcapturerate){
- case 8000: case 12000: case 16000: case 24000: case 48000: __opus_maxcapturerate = opus_maxcapturerate; return 0;
- default: TSK_DEBUG_ERROR("%u not valid for opus_maxcapturerate", opus_maxcapturerate); return -1;
- }
-}
-uint32_t tmedia_defaults_get_opus_maxcapturerate(){
- return __opus_maxcapturerate;
+int tmedia_defaults_set_opus_maxcapturerate(uint32_t opus_maxcapturerate)
+{
+ switch(opus_maxcapturerate) {
+ case 8000:
+ case 12000:
+ case 16000:
+ case 24000:
+ case 48000:
+ __opus_maxcapturerate = opus_maxcapturerate;
+ return 0;
+ default:
+ TSK_DEBUG_ERROR("%u not valid for opus_maxcapturerate", opus_maxcapturerate);
+ return -1;
+ }
+}
+uint32_t tmedia_defaults_get_opus_maxcapturerate()
+{
+ return __opus_maxcapturerate;
}
-int tmedia_defaults_set_opus_maxplaybackrate(uint32_t opus_maxplaybackrate){
- switch(opus_maxplaybackrate){
- case 8000: case 12000: case 16000: case 24000: case 48000: __opus_maxplaybackrate = opus_maxplaybackrate; return 0;
- default: TSK_DEBUG_ERROR("%u not valid for opus_maxplaybackrate", opus_maxplaybackrate); return -1;
- }
-}
-uint32_t tmedia_defaults_get_opus_maxplaybackrate(){
- return __opus_maxplaybackrate;
+int tmedia_defaults_set_opus_maxplaybackrate(uint32_t opus_maxplaybackrate)
+{
+ switch(opus_maxplaybackrate) {
+ case 8000:
+ case 12000:
+ case 16000:
+ case 24000:
+ case 48000:
+ __opus_maxplaybackrate = opus_maxplaybackrate;
+ return 0;
+ default:
+ TSK_DEBUG_ERROR("%u not valid for opus_maxplaybackrate", opus_maxplaybackrate);
+ return -1;
+ }
+}
+uint32_t tmedia_defaults_get_opus_maxplaybackrate()
+{
+ return __opus_maxplaybackrate;
}
-int tmedia_defaults_set_ssl_certs(const char* priv_path, const char* pub_path, const char* ca_path, tsk_bool_t verify){
- tsk_strupdate(&__ssl_certs_priv_path, priv_path);
- tsk_strupdate(&__ssl_certs_pub_path, pub_path);
- tsk_strupdate(&__ssl_certs_ca_path, ca_path);
- __ssl_certs_verify = verify;
- return 0;
+int tmedia_defaults_set_ssl_certs(const char* priv_path, const char* pub_path, const char* ca_path, tsk_bool_t verify)
+{
+ tsk_strupdate(&__ssl_certs_priv_path, priv_path);
+ tsk_strupdate(&__ssl_certs_pub_path, pub_path);
+ tsk_strupdate(&__ssl_certs_ca_path, ca_path);
+ __ssl_certs_verify = verify;
+ return 0;
}
-int tmedia_defaults_get_ssl_certs(const char** priv_path, const char** pub_path, const char** ca_path, tsk_bool_t *verify){
- if(priv_path) *priv_path = __ssl_certs_priv_path;
- if(pub_path) *pub_path = __ssl_certs_pub_path;
- if(ca_path) *ca_path = __ssl_certs_ca_path;
- if(verify) *verify = __ssl_certs_verify;
- return 0;
+int tmedia_defaults_get_ssl_certs(const char** priv_path, const char** pub_path, const char** ca_path, tsk_bool_t *verify)
+{
+ if(priv_path) {
+ *priv_path = __ssl_certs_priv_path;
+ }
+ if(pub_path) {
+ *pub_path = __ssl_certs_pub_path;
+ }
+ if(ca_path) {
+ *ca_path = __ssl_certs_ca_path;
+ }
+ if(verify) {
+ *verify = __ssl_certs_verify;
+ }
+ return 0;
}
-int tmedia_defaults_set_max_fds(int32_t max_fds) {
- if (max_fds > 0 && max_fds < 0xFFFF) {
- __max_fds = (tsk_size_t)max_fds;
- return 0;
- }
- return -1;
+int tmedia_defaults_set_max_fds(int32_t max_fds)
+{
+ if (max_fds > 0 && max_fds < 0xFFFF) {
+ __max_fds = (tsk_size_t)max_fds;
+ return 0;
+ }
+ return -1;
}
-tsk_size_t tmedia_defaults_get_max_fds() {
- return __max_fds;
+tsk_size_t tmedia_defaults_get_max_fds()
+{
+ return __max_fds;
}
-int tmedia_defaults_set_webproxy_auto_detect(tsk_bool_t auto_detect) {
+int tmedia_defaults_set_webproxy_auto_detect(tsk_bool_t auto_detect)
+{
__webproxy_auto_detect = auto_detect;
return 0;
}
-tsk_bool_t tmedia_defaults_get_webproxy_auto_detect() {
+tsk_bool_t tmedia_defaults_get_webproxy_auto_detect()
+{
return __webproxy_auto_detect;
}
-int tmedia_defaults_set_webproxy_info(const char* type, const char* host, unsigned short port, const char* login, const char* password) {
+int tmedia_defaults_set_webproxy_info(const char* type, const char* host, unsigned short port, const char* login, const char* password)
+{
tsk_strupdate(&__webproxy_type, type);
tsk_strupdate(&__webproxy_host, host);
tsk_strupdate(&__webproxy_login, login);
@@ -608,11 +793,22 @@ int tmedia_defaults_set_webproxy_info(const char* type, const char* host, unsign
return 0;
}
-int tmedia_defaults_get_webproxy_info(const char** type, const char** host, unsigned short* port, const char** login, const char** password) {
- if (type) *type = __webproxy_type;
- if (host) *host = __webproxy_host;
- if (port) *port = __webproxy_port;
- if (login) *login = __webproxy_login;
- if (password) *password = __webproxy_password;
+int tmedia_defaults_get_webproxy_info(const char** type, const char** host, unsigned short* port, const char** login, const char** password)
+{
+ if (type) {
+ *type = __webproxy_type;
+ }
+ if (host) {
+ *host = __webproxy_host;
+ }
+ if (port) {
+ *port = __webproxy_port;
+ }
+ if (login) {
+ *login = __webproxy_login;
+ }
+ if (password) {
+ *password = __webproxy_password;
+ }
return 0;
}
diff --git a/tinyMEDIA/src/tmedia_denoise.c b/tinyMEDIA/src/tmedia_denoise.c
index 4c0f74b..7149e35 100755
--- a/tinyMEDIA/src/tmedia_denoise.c
+++ b/tinyMEDIA/src/tmedia_denoise.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,207 +36,207 @@ static const tmedia_denoise_plugin_def_t* __tmedia_denoise_plugin = tsk_null;
int tmedia_denoise_init(tmedia_denoise_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->echo_tail = tmedia_defaults_get_echo_tail();
- self->echo_skew = tmedia_defaults_get_echo_skew();
- self->echo_supp_enabled = tmedia_defaults_get_echo_supp_enabled();
- self->agc_enabled = tmedia_defaults_get_agc_enabled();
- self->agc_level = tmedia_defaults_get_agc_level();
- self->vad_enabled = tmedia_defaults_get_vad_enabled();
- self->noise_supp_enabled = tmedia_defaults_get_noise_supp_enabled();
- self->noise_supp_level = tmedia_defaults_get_noise_supp_level();
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->echo_tail = tmedia_defaults_get_echo_tail();
+ self->echo_skew = tmedia_defaults_get_echo_skew();
+ self->echo_supp_enabled = tmedia_defaults_get_echo_supp_enabled();
+ self->agc_enabled = tmedia_defaults_get_agc_enabled();
+ self->agc_level = tmedia_defaults_get_agc_level();
+ self->vad_enabled = tmedia_defaults_get_vad_enabled();
+ self->noise_supp_enabled = tmedia_defaults_get_noise_supp_enabled();
+ self->noise_supp_level = tmedia_defaults_get_noise_supp_level();
+
+ return 0;
}
int tmedia_denoise_set(tmedia_denoise_t* self, const tmedia_param_t* param)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(self->plugin->set){
- return self->plugin->set(self, param);
- }
- return 0;
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(self->plugin->set) {
+ return self->plugin->set(self, param);
+ }
+ return 0;
}
int tmedia_denoise_open(tmedia_denoise_t* self, uint32_t record_frame_size_samples, uint32_t record_sampling_rate, uint32_t record_channels, uint32_t playback_frame_size_samples, uint32_t playback_sampling_rate, uint32_t playback_channels)
{
- if (!self || !self->plugin) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (self->opened) {
- TSK_DEBUG_WARN("Denoiser already opened");
- return 0;
- }
-
- if (self->plugin->open) {
- int ret;
-
- TSK_OBJECT_SAFE_FREE(self->record_frame);
- TSK_OBJECT_SAFE_FREE(self->playback_frame);
- if (!(self->record_frame = tsk_buffer_create(tsk_null, (record_frame_size_samples * sizeof(int16_t))))) {
- TSK_DEBUG_ERROR("Failed to create record the buffer");
- return -2;
- }
- if (!(self->playback_frame = tsk_buffer_create(tsk_null, (playback_frame_size_samples * sizeof(int16_t))))) {
- TSK_DEBUG_ERROR("Failed to create playback the buffer");
- return -2;
- }
- if ((ret = self->plugin->open(self, record_frame_size_samples, record_sampling_rate, record_channels, playback_frame_size_samples, playback_sampling_rate, playback_channels))) {
- TSK_DEBUG_ERROR("Failed to open [%s] denoiser", self->plugin->desc);
- return ret;
- }
- else {
- self->opened = tsk_true;
- return 0;
- }
- }
- else{
- self->opened = tsk_true;
- return 0;
- }
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (self->opened) {
+ TSK_DEBUG_WARN("Denoiser already opened");
+ return 0;
+ }
+
+ if (self->plugin->open) {
+ int ret;
+
+ TSK_OBJECT_SAFE_FREE(self->record_frame);
+ TSK_OBJECT_SAFE_FREE(self->playback_frame);
+ if (!(self->record_frame = tsk_buffer_create(tsk_null, (record_frame_size_samples * sizeof(int16_t))))) {
+ TSK_DEBUG_ERROR("Failed to create record the buffer");
+ return -2;
+ }
+ if (!(self->playback_frame = tsk_buffer_create(tsk_null, (playback_frame_size_samples * sizeof(int16_t))))) {
+ TSK_DEBUG_ERROR("Failed to create playback the buffer");
+ return -2;
+ }
+ if ((ret = self->plugin->open(self, record_frame_size_samples, record_sampling_rate, record_channels, playback_frame_size_samples, playback_sampling_rate, playback_channels))) {
+ TSK_DEBUG_ERROR("Failed to open [%s] denoiser", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
}
int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->opened){
- TSK_DEBUG_ERROR("Denoiser not opened");
- return -2;
- }
-
- if(self->plugin->echo_playback){
- return self->plugin->echo_playback(self, echo_frame, echo_frame_size_bytes);
- }
- else{
- return 0;
- }
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Denoiser not opened");
+ return -2;
+ }
+
+ if(self->plugin->echo_playback) {
+ return self->plugin->echo_playback(self, echo_frame, echo_frame_size_bytes);
+ }
+ else {
+ return 0;
+ }
}
int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
- if(!self || !self->plugin || !silence_or_noise){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->opened){
- TSK_DEBUG_ERROR("Denoiser not opened");
- return -2;
- }
-
- if(self->plugin->process_record){
- return self->plugin->process_record(self, audio_frame, audio_frame_size_bytes, silence_or_noise);
- }
- else{
- *silence_or_noise = tsk_false;
- return 0;
- }
+ if(!self || !self->plugin || !silence_or_noise) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Denoiser not opened");
+ return -2;
+ }
+
+ if(self->plugin->process_record) {
+ return self->plugin->process_record(self, audio_frame, audio_frame_size_bytes, silence_or_noise);
+ }
+ else {
+ *silence_or_noise = tsk_false;
+ return 0;
+ }
}
int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->opened){
- TSK_DEBUG_ERROR("Denoiser not opened");
- return -2;
- }
-
- if(self->plugin->process_playback){
- return self->plugin->process_playback(self, audio_frame, audio_frame_size_bytes);
- }
- return 0;
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("Denoiser not opened");
+ return -2;
+ }
+
+ if(self->plugin->process_playback) {
+ return self->plugin->process_playback(self, audio_frame, audio_frame_size_bytes);
+ }
+ return 0;
}
int tmedia_denoise_close(tmedia_denoise_t* self)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->opened){
- return 0;
- }
-
- if(self->plugin->close){
- int ret;
-
- if((ret = self->plugin->close(self))){
- TSK_DEBUG_ERROR("Failed to close [%s] denoiser", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->opened) {
+ return 0;
+ }
+
+ if(self->plugin->close) {
+ int ret;
+
+ if((ret = self->plugin->close(self))) {
+ TSK_DEBUG_ERROR("Failed to close [%s] denoiser", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
}
int tmedia_denoise_deinit(tmedia_denoise_t* self)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (self->opened) {
- tmedia_denoise_close(self);
- }
-
- TSK_OBJECT_SAFE_FREE(self->record_frame);
- TSK_OBJECT_SAFE_FREE(self->playback_frame);
-
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (self->opened) {
+ tmedia_denoise_close(self);
+ }
+
+ TSK_OBJECT_SAFE_FREE(self->record_frame);
+ TSK_OBJECT_SAFE_FREE(self->playback_frame);
+
+ return 0;
}
int tmedia_denoise_plugin_register(const tmedia_denoise_plugin_def_t* plugin)
{
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!__tmedia_denoise_plugin) {
- TSK_DEBUG_INFO("Register denoiser: %s", plugin->desc);
- __tmedia_denoise_plugin = plugin;
- }
- return 0;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!__tmedia_denoise_plugin) {
+ TSK_DEBUG_INFO("Register denoiser: %s", plugin->desc);
+ __tmedia_denoise_plugin = plugin;
+ }
+ return 0;
}
int tmedia_denoise_plugin_unregister(const tmedia_denoise_plugin_def_t* plugin)
{
- (void)(plugin);
- __tmedia_denoise_plugin = tsk_null;
- return 0;
+ (void)(plugin);
+ __tmedia_denoise_plugin = tsk_null;
+ return 0;
}
tmedia_denoise_t* tmedia_denoise_create()
{
- tmedia_denoise_t* denoise = tsk_null;
-
- if(__tmedia_denoise_plugin){
- if((denoise = tsk_object_new(__tmedia_denoise_plugin->objdef))){
- denoise->plugin = __tmedia_denoise_plugin;
- }
- }
- return denoise;
+ tmedia_denoise_t* denoise = tsk_null;
+
+ if(__tmedia_denoise_plugin) {
+ if((denoise = tsk_object_new(__tmedia_denoise_plugin->objdef))) {
+ denoise->plugin = __tmedia_denoise_plugin;
+ }
+ }
+ return denoise;
}
diff --git a/tinyMEDIA/src/tmedia_imageattr.c b/tinyMEDIA/src/tmedia_imageattr.c
index 07440c4..9cc3543 100755
--- a/tinyMEDIA/src/tmedia_imageattr.c
+++ b/tinyMEDIA/src/tmedia_imageattr.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmedia_imageattr.rl" */
/*
* Copyright (C) 2012-2015 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,916 +39,952 @@
static int tmedia_imageattr_reset(tmedia_imageattr_xt* self)
{
- if(self){
- tsk_size_t i;
- memset(self, 0, sizeof(*self));
- for(i = 0; i < TMEDIA_imageattr_ARRAY_MAX_SIZE; ++i){
- self->send.sets[i].qvalue = 0.5;
- self->recv.sets[i].qvalue = 0.5;
- }
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self) {
+ tsk_size_t i;
+ memset(self, 0, sizeof(*self));
+ for(i = 0; i < TMEDIA_imageattr_ARRAY_MAX_SIZE; ++i) {
+ self->send.sets[i].qvalue = 0.5;
+ self->recv.sets[i].qvalue = 0.5;
+ }
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tmedia_imageattr_parse(tmedia_imageattr_xt* self, const void* in_data, tsk_size_t in_size)
{
- int cs = 0;
- const char *p = in_data;
- const char *pe = p + in_size;
- const char *eof = pe;
-
- const char *tag_start = tsk_null;
-
- tmedia_imageattr_set_xt* sets = tsk_null;
- tsk_size_t* sets_count = tsk_null;
- tmedia_imageattr_xyrange_xt* xyrange = tsk_null;
- tmedia_imageattr_srange_xt* srange = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 72 "./src/tmedia_imageattr.c" */
-static const char _tmedia_machine_imageattr_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16, 1, 17, 1, 18, 1,
- 19, 1, 20, 2, 3, 0, 2, 4,
- 0, 2, 6, 11, 2, 15, 0, 2,
- 16, 13
-};
-
-static const short _tmedia_machine_imageattr_key_offsets[] = {
- 0, 0, 6, 8, 10, 12, 14, 18,
- 20, 22, 24, 26, 30, 32, 33, 36,
- 39, 41, 42, 45, 49, 55, 57, 59,
- 60, 61, 64, 65, 67, 70, 73, 74,
- 76, 79, 82, 85, 86, 88, 91, 92,
- 94, 97, 100, 101, 102, 104, 105, 107,
- 108, 110, 114, 116, 117, 118, 121, 123,
- 125, 126, 130, 131, 133, 137, 141, 145,
- 147, 148, 150, 153, 154, 156, 160, 163,
- 164, 166, 170, 174, 178, 180, 182, 183,
- 185, 188, 189, 191, 194, 197, 200, 201,
- 203, 204, 206, 210, 214, 216, 217, 219,
- 223, 227, 231, 235, 237, 239, 243, 245,
- 249, 253, 257, 261, 265, 267, 269, 273,
- 277, 281, 285, 287, 289, 293, 297, 301,
- 305, 309, 311, 313, 316, 319, 322, 325,
- 328, 329, 331, 334, 337, 340, 343, 344,
- 346, 350, 352, 356, 360, 364, 368, 372,
- 374, 375, 379, 383, 387, 391, 393, 395,
- 399, 403, 407, 411, 415, 417, 419, 422,
- 425, 428, 431, 434, 435, 436, 438, 440,
- 442, 444, 446, 447, 450, 453, 455, 456,
- 459, 463, 469, 471, 473, 474, 475, 478,
- 479, 481, 484, 487, 488, 490, 493, 496,
- 499, 500, 502, 503, 505, 508, 511, 512,
- 513, 515, 516, 518, 519, 521, 525, 527,
- 528, 529, 532, 534, 536, 537, 541, 542,
- 544, 548, 552, 556, 558, 559, 561, 564,
- 565, 567, 571, 574, 575, 577, 581, 585,
- 589, 591, 593, 594, 596, 599, 600, 602,
- 605, 608, 611, 612, 614, 615, 617, 621,
- 625, 627, 628, 630, 634, 638, 642, 646,
- 648, 650, 654, 656, 660, 664, 668, 672,
- 676, 678, 680, 684, 688, 692, 696, 698,
- 700, 704, 708, 712, 716, 720, 722, 724,
- 727, 730, 733, 736, 739, 740, 742, 745,
- 748, 751, 754, 755, 757, 761, 763, 767,
- 771, 775, 779, 783, 785, 786, 790, 794,
- 798, 802, 804, 806, 810, 814, 818, 822,
- 826, 828, 830, 833, 836, 839, 842, 845,
- 846, 847, 849, 851, 853, 855, 861, 861,
- 863, 869
-};
-
-static const char _tmedia_machine_imageattr_trans_keys[] = {
- 9, 32, 82, 83, 114, 115, 69, 101,
- 67, 99, 86, 118, 9, 32, 9, 32,
- 42, 91, 69, 101, 67, 99, 86, 118,
- 9, 32, 9, 32, 42, 91, 88, 120,
- 61, 91, 49, 57, 44, 48, 57, 89,
- 121, 61, 91, 49, 57, 44, 93, 48,
- 57, 80, 81, 83, 112, 113, 115, 65,
- 97, 82, 114, 61, 91, 48, 49, 57,
- 46, 49, 57, 45, 48, 57, 48, 49,
- 57, 46, 49, 57, 93, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 44, 93,
- 9, 32, 91, 46, 48, 57, 45, 48,
- 57, 45, 48, 57, 45, 46, 48, 57,
- 61, 48, 49, 46, 48, 57, 44, 93,
- 48, 57, 44, 93, 46, 48, 44, 48,
- 93, 65, 97, 82, 114, 61, 48, 91,
- 49, 57, 46, 49, 57, 44, 93, 48,
- 57, 44, 93, 48, 57, 44, 93, 48,
- 57, 44, 93, 46, 48, 57, 48, 49,
- 57, 46, 49, 57, 44, 45, 48, 57,
- 48, 49, 57, 46, 49, 57, 44, 93,
- 48, 57, 44, 93, 48, 57, 44, 93,
- 48, 57, 44, 93, 44, 93, 46, 48,
- 57, 48, 49, 57, 46, 49, 57, 93,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 44, 93, 46, 48, 57, 44, 45,
- 48, 57, 44, 45, 48, 57, 44, 45,
- 46, 48, 57, 44, 93, 48, 57, 44,
- 93, 48, 57, 44, 93, 48, 57, 44,
- 93, 48, 57, 44, 93, 49, 57, 44,
- 58, 48, 57, 49, 57, 44, 93, 48,
- 57, 44, 93, 48, 57, 44, 93, 48,
- 57, 44, 93, 48, 57, 44, 93, 48,
- 57, 44, 93, 44, 93, 44, 58, 48,
- 57, 44, 58, 48, 57, 44, 58, 48,
- 57, 44, 58, 48, 57, 44, 58, 49,
- 57, 58, 93, 48, 57, 58, 93, 48,
- 57, 58, 93, 48, 57, 58, 93, 48,
- 57, 58, 93, 48, 57, 58, 93, 49,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 44, 93, 44, 48, 57, 44, 48,
- 57, 44, 48, 57, 44, 48, 57, 44,
- 49, 57, 44, 58, 48, 57, 49, 57,
- 44, 93, 48, 57, 44, 93, 48, 57,
- 44, 93, 48, 57, 44, 93, 48, 57,
- 44, 93, 48, 57, 44, 93, 44, 44,
- 58, 48, 57, 44, 58, 48, 57, 44,
- 58, 48, 57, 44, 58, 48, 57, 44,
- 58, 49, 57, 58, 93, 48, 57, 58,
- 93, 48, 57, 58, 93, 48, 57, 58,
- 93, 48, 57, 58, 93, 48, 57, 58,
- 93, 49, 57, 93, 48, 57, 93, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 44, 69, 101, 78, 110,
- 68, 100, 9, 32, 88, 120, 61, 91,
- 49, 57, 44, 48, 57, 89, 121, 61,
- 91, 49, 57, 44, 93, 48, 57, 80,
- 81, 83, 112, 113, 115, 65, 97, 82,
- 114, 61, 91, 48, 49, 57, 46, 49,
- 57, 45, 48, 57, 48, 49, 57, 46,
- 49, 57, 93, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 44, 93, 46, 48,
- 57, 45, 48, 57, 45, 48, 57, 45,
- 46, 48, 57, 61, 48, 49, 46, 48,
- 57, 44, 93, 48, 57, 44, 93, 46,
- 48, 44, 48, 93, 65, 97, 82, 114,
- 61, 48, 91, 49, 57, 46, 49, 57,
- 44, 93, 48, 57, 44, 93, 48, 57,
- 44, 93, 48, 57, 44, 93, 46, 48,
- 57, 48, 49, 57, 46, 49, 57, 44,
- 45, 48, 57, 48, 49, 57, 46, 49,
- 57, 44, 93, 48, 57, 44, 93, 48,
- 57, 44, 93, 48, 57, 44, 93, 44,
- 93, 46, 48, 57, 48, 49, 57, 46,
- 49, 57, 93, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 44, 93, 46, 48,
- 57, 44, 45, 48, 57, 44, 45, 48,
- 57, 44, 45, 46, 48, 57, 44, 93,
- 48, 57, 44, 93, 48, 57, 44, 93,
- 48, 57, 44, 93, 48, 57, 44, 93,
- 49, 57, 44, 58, 48, 57, 49, 57,
- 44, 93, 48, 57, 44, 93, 48, 57,
- 44, 93, 48, 57, 44, 93, 48, 57,
- 44, 93, 48, 57, 44, 93, 44, 93,
- 44, 58, 48, 57, 44, 58, 48, 57,
- 44, 58, 48, 57, 44, 58, 48, 57,
- 44, 58, 49, 57, 58, 93, 48, 57,
- 58, 93, 48, 57, 58, 93, 48, 57,
- 58, 93, 48, 57, 58, 93, 48, 57,
- 58, 93, 49, 57, 93, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 44, 93, 44, 48,
- 57, 44, 48, 57, 44, 48, 57, 44,
- 48, 57, 44, 49, 57, 44, 58, 48,
- 57, 49, 57, 44, 93, 48, 57, 44,
- 93, 48, 57, 44, 93, 48, 57, 44,
- 93, 48, 57, 44, 93, 48, 57, 44,
- 93, 44, 44, 58, 48, 57, 44, 58,
- 48, 57, 44, 58, 48, 57, 44, 58,
- 48, 57, 44, 58, 49, 57, 58, 93,
- 48, 57, 58, 93, 48, 57, 58, 93,
- 48, 57, 58, 93, 48, 57, 58, 93,
- 48, 57, 58, 93, 49, 57, 93, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 44, 69,
- 101, 78, 110, 68, 100, 9, 32, 9,
- 32, 82, 83, 114, 115, 9, 32, 9,
- 32, 82, 83, 114, 115, 9, 32, 82,
- 83, 91, 114, 115, 0
-};
-
-static const char _tmedia_machine_imageattr_single_lengths[] = {
- 0, 6, 2, 2, 2, 2, 4, 2,
- 2, 2, 2, 4, 2, 1, 1, 1,
- 2, 1, 1, 2, 6, 2, 2, 1,
- 1, 1, 1, 0, 1, 1, 1, 0,
- 1, 1, 1, 1, 2, 3, 1, 0,
- 1, 1, 1, 1, 0, 1, 2, 1,
- 0, 2, 2, 1, 1, 3, 2, 2,
- 1, 2, 1, 0, 2, 2, 2, 2,
- 1, 0, 1, 1, 0, 2, 1, 1,
- 0, 2, 2, 2, 2, 2, 1, 0,
- 1, 1, 0, 1, 1, 1, 1, 2,
- 1, 0, 2, 2, 2, 1, 0, 2,
- 2, 2, 2, 2, 0, 2, 0, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 0, 2, 2, 2, 2,
- 2, 2, 0, 1, 1, 1, 1, 1,
- 1, 2, 1, 1, 1, 1, 1, 0,
- 2, 0, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 0, 2,
- 2, 2, 2, 2, 2, 0, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 1, 1, 1, 2, 1, 1,
- 2, 6, 2, 2, 1, 1, 1, 1,
- 0, 1, 1, 1, 0, 1, 1, 1,
- 1, 2, 1, 0, 1, 1, 1, 1,
- 0, 1, 2, 1, 0, 2, 2, 1,
- 1, 3, 2, 2, 1, 2, 1, 0,
- 2, 2, 2, 2, 1, 0, 1, 1,
- 0, 2, 1, 1, 0, 2, 2, 2,
- 2, 2, 1, 0, 1, 1, 0, 1,
- 1, 1, 1, 2, 1, 0, 2, 2,
- 2, 1, 0, 2, 2, 2, 2, 2,
- 0, 2, 0, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 0,
- 2, 2, 2, 2, 2, 2, 0, 1,
- 1, 1, 1, 1, 1, 2, 1, 1,
- 1, 1, 1, 0, 2, 0, 2, 2,
- 2, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 0, 2, 2, 2, 2, 2,
- 2, 0, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 6, 0, 2,
- 6, 7
-};
-
-static const char _tmedia_machine_imageattr_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 1, 0, 1, 1, 1, 0, 1,
- 1, 1, 1, 0, 0, 0, 0, 1,
- 1, 1, 0, 0, 1, 0, 0, 0,
- 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 1, 1, 1, 1, 0,
- 0, 1, 1, 0, 1, 1, 1, 0,
- 1, 1, 1, 1, 0, 0, 0, 1,
- 1, 0, 1, 1, 1, 1, 0, 0,
- 0, 1, 1, 1, 0, 0, 1, 1,
- 1, 1, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 0, 1, 1,
- 1, 1, 0, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 0, 1, 1, 1, 1, 0, 1, 1,
- 1, 1, 1, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 1, 0,
- 1, 1, 1, 0, 1, 1, 1, 1,
- 0, 0, 0, 1, 1, 1, 0, 0,
- 1, 0, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 1,
- 1, 1, 1, 0, 0, 1, 1, 0,
- 1, 1, 1, 0, 1, 1, 1, 1,
- 0, 0, 0, 1, 1, 0, 1, 1,
- 1, 1, 0, 0, 0, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 0, 1,
- 1, 1, 1, 1, 1, 0, 1, 1,
- 1, 1, 1, 1, 0, 0, 1, 1,
- 1, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
-};
-
-static const short _tmedia_machine_imageattr_index_offsets[] = {
- 0, 0, 7, 10, 13, 16, 19, 24,
- 27, 30, 33, 36, 41, 44, 46, 49,
- 52, 55, 57, 60, 64, 71, 74, 77,
- 79, 81, 84, 86, 88, 91, 94, 96,
- 98, 101, 104, 107, 109, 112, 116, 118,
- 120, 123, 126, 128, 130, 132, 134, 137,
- 139, 141, 145, 148, 150, 152, 156, 159,
- 162, 164, 168, 170, 172, 176, 180, 184,
- 187, 189, 191, 194, 196, 198, 202, 205,
- 207, 209, 213, 217, 221, 224, 227, 229,
- 231, 234, 236, 238, 241, 244, 247, 249,
- 252, 254, 256, 260, 264, 267, 269, 271,
- 275, 279, 283, 287, 290, 292, 296, 298,
- 302, 306, 310, 314, 318, 321, 324, 328,
- 332, 336, 340, 343, 345, 349, 353, 357,
- 361, 365, 368, 370, 373, 376, 379, 382,
- 385, 387, 390, 393, 396, 399, 402, 404,
- 406, 410, 412, 416, 420, 424, 428, 432,
- 435, 437, 441, 445, 449, 453, 456, 458,
- 462, 466, 470, 474, 478, 481, 483, 486,
- 489, 492, 495, 498, 500, 502, 505, 508,
- 511, 514, 517, 519, 522, 525, 528, 530,
- 533, 537, 544, 547, 550, 552, 554, 557,
- 559, 561, 564, 567, 569, 571, 574, 577,
- 580, 582, 585, 587, 589, 592, 595, 597,
- 599, 601, 603, 606, 608, 610, 614, 617,
- 619, 621, 625, 628, 631, 633, 637, 639,
- 641, 645, 649, 653, 656, 658, 660, 663,
- 665, 667, 671, 674, 676, 678, 682, 686,
- 690, 693, 696, 698, 700, 703, 705, 707,
- 710, 713, 716, 718, 721, 723, 725, 729,
- 733, 736, 738, 740, 744, 748, 752, 756,
- 759, 761, 765, 767, 771, 775, 779, 783,
- 787, 790, 793, 797, 801, 805, 809, 812,
- 814, 818, 822, 826, 830, 834, 837, 839,
- 842, 845, 848, 851, 854, 856, 859, 862,
- 865, 868, 871, 873, 875, 879, 881, 885,
- 889, 893, 897, 901, 904, 906, 910, 914,
- 918, 922, 925, 927, 931, 935, 939, 943,
- 947, 950, 952, 955, 958, 961, 964, 967,
- 969, 971, 974, 977, 980, 983, 990, 991,
- 994, 1001
-};
-
-static const short _tmedia_machine_imageattr_trans_targs[] = {
- 1, 1, 2, 321, 2, 321, 0, 3,
- 3, 0, 4, 4, 0, 5, 5, 0,
- 6, 6, 0, 6, 6, 325, 169, 0,
- 8, 8, 0, 9, 9, 0, 10, 10,
- 0, 11, 11, 0, 11, 11, 326, 12,
- 0, 13, 13, 0, 14, 0, 135, 15,
- 0, 16, 130, 0, 17, 17, 0, 18,
- 0, 100, 19, 0, 20, 327, 95, 0,
- 21, 45, 54, 21, 45, 54, 0, 22,
- 22, 0, 23, 23, 0, 24, 0, 25,
- 0, 26, 43, 0, 27, 0, 28, 0,
- 29, 40, 0, 30, 38, 0, 31, 0,
- 32, 0, 36, 33, 0, 36, 34, 0,
- 36, 35, 0, 36, 0, 20, 327, 0,
- 37, 37, 12, 0, 39, 0, 32, 0,
- 29, 41, 0, 29, 42, 0, 29, 0,
- 44, 0, 28, 0, 46, 0, 47, 51,
- 0, 48, 0, 49, 0, 20, 327, 50,
- 0, 20, 327, 0, 52, 0, 53, 0,
- 20, 50, 327, 0, 55, 55, 0, 56,
- 56, 0, 57, 0, 58, 66, 64, 0,
- 59, 0, 60, 0, 20, 327, 61, 0,
- 20, 327, 62, 0, 20, 327, 63, 0,
- 20, 327, 0, 65, 0, 60, 0, 67,
- 93, 0, 68, 0, 69, 0, 70, 80,
- 90, 0, 71, 78, 0, 72, 0, 73,
- 0, 70, 77, 74, 0, 70, 77, 75,
- 0, 70, 77, 76, 0, 70, 77, 0,
- 20, 327, 0, 79, 0, 73, 0, 81,
- 88, 0, 82, 0, 83, 0, 87, 84,
- 0, 87, 85, 0, 87, 86, 0, 87,
- 0, 20, 327, 0, 89, 0, 83, 0,
- 70, 80, 91, 0, 70, 80, 92, 0,
- 70, 80, 0, 94, 0, 69, 0, 20,
- 327, 96, 0, 20, 327, 97, 0, 20,
- 327, 98, 0, 20, 327, 99, 0, 20,
- 327, 0, 101, 0, 102, 115, 110, 0,
- 103, 0, 102, 109, 104, 0, 102, 109,
- 105, 0, 102, 109, 106, 0, 102, 109,
- 107, 0, 102, 109, 108, 0, 102, 109,
- 0, 20, 327, 0, 102, 115, 111, 0,
- 102, 115, 112, 0, 102, 115, 113, 0,
- 102, 115, 114, 0, 102, 115, 0, 116,
- 0, 122, 129, 117, 0, 122, 129, 118,
- 0, 122, 129, 119, 0, 122, 129, 120,
- 0, 122, 129, 121, 0, 122, 129, 0,
- 123, 0, 129, 124, 0, 129, 125, 0,
- 129, 126, 0, 129, 127, 0, 129, 128,
- 0, 129, 0, 20, 327, 0, 16, 131,
- 0, 16, 132, 0, 16, 133, 0, 16,
- 134, 0, 16, 0, 136, 0, 137, 150,
- 145, 0, 138, 0, 137, 144, 139, 0,
- 137, 144, 140, 0, 137, 144, 141, 0,
- 137, 144, 142, 0, 137, 144, 143, 0,
- 137, 144, 0, 16, 0, 137, 150, 146,
- 0, 137, 150, 147, 0, 137, 150, 148,
- 0, 137, 150, 149, 0, 137, 150, 0,
- 151, 0, 157, 164, 152, 0, 157, 164,
- 153, 0, 157, 164, 154, 0, 157, 164,
- 155, 0, 157, 164, 156, 0, 157, 164,
- 0, 158, 0, 164, 159, 0, 164, 160,
- 0, 164, 161, 0, 164, 162, 0, 164,
- 163, 0, 164, 0, 16, 0, 166, 166,
- 0, 167, 167, 0, 168, 168, 0, 11,
- 11, 0, 170, 170, 0, 171, 0, 291,
- 172, 0, 173, 286, 0, 174, 174, 0,
- 175, 0, 256, 176, 0, 177, 328, 251,
- 0, 178, 201, 210, 178, 201, 210, 0,
- 179, 179, 0, 180, 180, 0, 181, 0,
- 182, 0, 183, 199, 0, 184, 0, 185,
- 0, 186, 196, 0, 187, 194, 0, 188,
- 0, 189, 0, 193, 190, 0, 193, 191,
- 0, 193, 192, 0, 193, 0, 177, 328,
- 0, 195, 0, 189, 0, 186, 197, 0,
- 186, 198, 0, 186, 0, 200, 0, 185,
- 0, 202, 0, 203, 207, 0, 204, 0,
- 205, 0, 177, 328, 206, 0, 177, 328,
- 0, 208, 0, 209, 0, 177, 206, 328,
- 0, 211, 211, 0, 212, 212, 0, 213,
- 0, 214, 222, 220, 0, 215, 0, 216,
- 0, 177, 328, 217, 0, 177, 328, 218,
- 0, 177, 328, 219, 0, 177, 328, 0,
- 221, 0, 216, 0, 223, 249, 0, 224,
- 0, 225, 0, 226, 236, 246, 0, 227,
- 234, 0, 228, 0, 229, 0, 226, 233,
- 230, 0, 226, 233, 231, 0, 226, 233,
- 232, 0, 226, 233, 0, 177, 328, 0,
- 235, 0, 229, 0, 237, 244, 0, 238,
- 0, 239, 0, 243, 240, 0, 243, 241,
- 0, 243, 242, 0, 243, 0, 177, 328,
- 0, 245, 0, 239, 0, 226, 236, 247,
- 0, 226, 236, 248, 0, 226, 236, 0,
- 250, 0, 225, 0, 177, 328, 252, 0,
- 177, 328, 253, 0, 177, 328, 254, 0,
- 177, 328, 255, 0, 177, 328, 0, 257,
- 0, 258, 271, 266, 0, 259, 0, 258,
- 265, 260, 0, 258, 265, 261, 0, 258,
- 265, 262, 0, 258, 265, 263, 0, 258,
- 265, 264, 0, 258, 265, 0, 177, 328,
- 0, 258, 271, 267, 0, 258, 271, 268,
- 0, 258, 271, 269, 0, 258, 271, 270,
- 0, 258, 271, 0, 272, 0, 278, 285,
- 273, 0, 278, 285, 274, 0, 278, 285,
- 275, 0, 278, 285, 276, 0, 278, 285,
- 277, 0, 278, 285, 0, 279, 0, 285,
- 280, 0, 285, 281, 0, 285, 282, 0,
- 285, 283, 0, 285, 284, 0, 285, 0,
- 177, 328, 0, 173, 287, 0, 173, 288,
- 0, 173, 289, 0, 173, 290, 0, 173,
- 0, 292, 0, 293, 306, 301, 0, 294,
- 0, 293, 300, 295, 0, 293, 300, 296,
- 0, 293, 300, 297, 0, 293, 300, 298,
- 0, 293, 300, 299, 0, 293, 300, 0,
- 173, 0, 293, 306, 302, 0, 293, 306,
- 303, 0, 293, 306, 304, 0, 293, 306,
- 305, 0, 293, 306, 0, 307, 0, 313,
- 320, 308, 0, 313, 320, 309, 0, 313,
- 320, 310, 0, 313, 320, 311, 0, 313,
- 320, 312, 0, 313, 320, 0, 314, 0,
- 320, 315, 0, 320, 316, 0, 320, 317,
- 0, 320, 318, 0, 320, 319, 0, 320,
- 0, 173, 0, 322, 322, 0, 323, 323,
- 0, 324, 324, 0, 6, 6, 0, 325,
- 325, 7, 165, 7, 165, 0, 0, 37,
- 37, 0, 329, 329, 7, 165, 7, 165,
- 0, 329, 329, 7, 165, 169, 7, 165,
- 0, 0
-};
-
-static const char _tmedia_machine_imageattr_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 43,
- 0, 49, 0, 0, 0, 0, 0, 0,
- 0, 9, 46, 0, 49, 49, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 0, 0, 0, 0, 0,
- 39, 0, 0, 1, 1, 0, 0, 0,
- 0, 0, 41, 0, 0, 41, 0, 0,
- 41, 0, 0, 41, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 39, 0, 0, 39, 0, 0, 39, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 0, 0, 0, 0, 25, 25, 0,
- 0, 25, 25, 0, 0, 0, 0, 0,
- 25, 0, 25, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 52, 31, 52, 0,
- 0, 0, 0, 0, 55, 55, 0, 0,
- 55, 55, 0, 0, 55, 55, 0, 0,
- 55, 55, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 33, 35,
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 33, 33, 0, 0, 33, 33, 0,
- 0, 33, 33, 0, 0, 33, 33, 0,
- 27, 27, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 37, 0,
- 0, 37, 0, 0, 37, 0, 0, 37,
- 0, 29, 29, 0, 0, 0, 0, 0,
- 33, 35, 0, 0, 33, 35, 0, 0,
- 33, 35, 0, 0, 0, 0, 0, 49,
- 49, 0, 0, 49, 49, 0, 0, 49,
- 49, 0, 0, 49, 49, 0, 0, 49,
- 49, 0, 1, 0, 23, 17, 0, 0,
- 1, 0, 23, 23, 0, 0, 23, 23,
- 0, 0, 23, 23, 0, 0, 23, 23,
- 0, 0, 23, 23, 0, 0, 23, 23,
- 0, 13, 13, 0, 23, 17, 0, 0,
- 23, 17, 0, 0, 23, 17, 0, 0,
- 23, 17, 0, 0, 23, 17, 0, 1,
- 0, 19, 21, 0, 0, 19, 21, 0,
- 0, 19, 21, 0, 0, 19, 21, 0,
- 0, 19, 21, 0, 0, 19, 21, 0,
- 1, 0, 21, 0, 0, 21, 0, 0,
- 21, 0, 0, 21, 0, 0, 21, 0,
- 0, 21, 0, 15, 15, 0, 49, 0,
- 0, 49, 0, 0, 49, 0, 0, 49,
- 0, 0, 49, 0, 1, 0, 23, 17,
- 0, 0, 1, 0, 23, 23, 0, 0,
- 23, 23, 0, 0, 23, 23, 0, 0,
- 23, 23, 0, 0, 23, 23, 0, 0,
- 23, 23, 0, 13, 0, 23, 17, 0,
- 0, 23, 17, 0, 0, 23, 17, 0,
- 0, 23, 17, 0, 0, 23, 17, 0,
- 1, 0, 19, 21, 0, 0, 19, 21,
- 0, 0, 19, 21, 0, 0, 19, 21,
- 0, 0, 19, 21, 0, 0, 19, 21,
- 0, 1, 0, 21, 0, 0, 21, 0,
- 0, 21, 0, 0, 21, 0, 0, 21,
- 0, 0, 21, 0, 15, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 3,
- 3, 0, 0, 0, 0, 0, 0, 7,
- 43, 0, 49, 0, 0, 0, 0, 0,
- 0, 0, 9, 46, 0, 49, 49, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 39, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 41, 0, 0, 41, 0,
- 0, 41, 0, 0, 41, 0, 0, 0,
- 0, 0, 0, 0, 0, 39, 0, 0,
- 39, 0, 0, 39, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 0,
- 0, 0, 25, 25, 0, 0, 25, 25,
- 0, 0, 0, 0, 0, 25, 0, 25,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 52, 31, 52, 0, 0, 0, 0,
- 0, 55, 55, 0, 0, 55, 55, 0,
- 0, 55, 55, 0, 0, 55, 55, 0,
- 0, 0, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 33, 35, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 33, 33,
- 0, 0, 33, 33, 0, 0, 33, 33,
- 0, 0, 33, 33, 0, 27, 27, 0,
- 0, 0, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 37, 0, 0, 37, 0,
- 0, 37, 0, 0, 37, 0, 29, 29,
- 0, 0, 0, 0, 0, 33, 35, 0,
- 0, 33, 35, 0, 0, 33, 35, 0,
- 0, 0, 0, 0, 49, 49, 0, 0,
- 49, 49, 0, 0, 49, 49, 0, 0,
- 49, 49, 0, 0, 49, 49, 0, 1,
- 0, 23, 17, 0, 0, 1, 0, 23,
- 23, 0, 0, 23, 23, 0, 0, 23,
- 23, 0, 0, 23, 23, 0, 0, 23,
- 23, 0, 0, 23, 23, 0, 13, 13,
- 0, 23, 17, 0, 0, 23, 17, 0,
- 0, 23, 17, 0, 0, 23, 17, 0,
- 0, 23, 17, 0, 1, 0, 19, 21,
- 0, 0, 19, 21, 0, 0, 19, 21,
- 0, 0, 19, 21, 0, 0, 19, 21,
- 0, 0, 19, 21, 0, 1, 0, 21,
- 0, 0, 21, 0, 0, 21, 0, 0,
- 21, 0, 0, 21, 0, 0, 21, 0,
- 15, 15, 0, 49, 0, 0, 49, 0,
- 0, 49, 0, 0, 49, 0, 0, 49,
- 0, 1, 0, 23, 17, 0, 0, 1,
- 0, 23, 23, 0, 0, 23, 23, 0,
- 0, 23, 23, 0, 0, 23, 23, 0,
- 0, 23, 23, 0, 0, 23, 23, 0,
- 13, 0, 23, 17, 0, 0, 23, 17,
- 0, 0, 23, 17, 0, 0, 23, 17,
- 0, 0, 23, 17, 0, 1, 0, 19,
- 21, 0, 0, 19, 21, 0, 0, 19,
- 21, 0, 0, 19, 21, 0, 0, 19,
- 21, 0, 0, 19, 21, 0, 1, 0,
- 21, 0, 0, 21, 0, 0, 21, 0,
- 0, 21, 0, 0, 21, 0, 0, 21,
- 0, 15, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 11,
- 11, 0, 11, 11, 11, 11, 11, 11,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
-};
-
-static const char _tmedia_machine_imageattr_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 11,
- 11, 0
-};
-
-static const int tmedia_machine_imageattr_start = 1;
-static const int tmedia_machine_imageattr_first_final = 325;
-static const int tmedia_machine_imageattr_error = 0;
-
-static const int tmedia_machine_imageattr_en_main = 1;
-
-
-/* #line 168 "./ragel/tmedia_imageattr.rl" */
- (void)(eof);
- (void)(tmedia_machine_imageattr_first_final);
- (void)(tmedia_machine_imageattr_error);
- (void)(tmedia_machine_imageattr_en_main);
-
-/* #line 695 "./src/tmedia_imageattr.c" */
- {
- cs = tmedia_machine_imageattr_start;
- }
-
-/* #line 173 "./ragel/tmedia_imageattr.rl" */
- tmedia_imageattr_reset(self);
-
-/* #line 703 "./src/tmedia_imageattr.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = in_data;
+ const char *pe = p + in_size;
+ const char *eof = pe;
+
+ const char *tag_start = tsk_null;
+
+ tmedia_imageattr_set_xt* sets = tsk_null;
+ tsk_size_t* sets_count = tsk_null;
+ tmedia_imageattr_xyrange_xt* xyrange = tsk_null;
+ tmedia_imageattr_srange_xt* srange = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 72 "./src/tmedia_imageattr.c" */
+ static const char _tmedia_machine_imageattr_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16, 1, 17, 1, 18, 1,
+ 19, 1, 20, 2, 3, 0, 2, 4,
+ 0, 2, 6, 11, 2, 15, 0, 2,
+ 16, 13
+ };
+
+ static const short _tmedia_machine_imageattr_key_offsets[] = {
+ 0, 0, 6, 8, 10, 12, 14, 18,
+ 20, 22, 24, 26, 30, 32, 33, 36,
+ 39, 41, 42, 45, 49, 55, 57, 59,
+ 60, 61, 64, 65, 67, 70, 73, 74,
+ 76, 79, 82, 85, 86, 88, 91, 92,
+ 94, 97, 100, 101, 102, 104, 105, 107,
+ 108, 110, 114, 116, 117, 118, 121, 123,
+ 125, 126, 130, 131, 133, 137, 141, 145,
+ 147, 148, 150, 153, 154, 156, 160, 163,
+ 164, 166, 170, 174, 178, 180, 182, 183,
+ 185, 188, 189, 191, 194, 197, 200, 201,
+ 203, 204, 206, 210, 214, 216, 217, 219,
+ 223, 227, 231, 235, 237, 239, 243, 245,
+ 249, 253, 257, 261, 265, 267, 269, 273,
+ 277, 281, 285, 287, 289, 293, 297, 301,
+ 305, 309, 311, 313, 316, 319, 322, 325,
+ 328, 329, 331, 334, 337, 340, 343, 344,
+ 346, 350, 352, 356, 360, 364, 368, 372,
+ 374, 375, 379, 383, 387, 391, 393, 395,
+ 399, 403, 407, 411, 415, 417, 419, 422,
+ 425, 428, 431, 434, 435, 436, 438, 440,
+ 442, 444, 446, 447, 450, 453, 455, 456,
+ 459, 463, 469, 471, 473, 474, 475, 478,
+ 479, 481, 484, 487, 488, 490, 493, 496,
+ 499, 500, 502, 503, 505, 508, 511, 512,
+ 513, 515, 516, 518, 519, 521, 525, 527,
+ 528, 529, 532, 534, 536, 537, 541, 542,
+ 544, 548, 552, 556, 558, 559, 561, 564,
+ 565, 567, 571, 574, 575, 577, 581, 585,
+ 589, 591, 593, 594, 596, 599, 600, 602,
+ 605, 608, 611, 612, 614, 615, 617, 621,
+ 625, 627, 628, 630, 634, 638, 642, 646,
+ 648, 650, 654, 656, 660, 664, 668, 672,
+ 676, 678, 680, 684, 688, 692, 696, 698,
+ 700, 704, 708, 712, 716, 720, 722, 724,
+ 727, 730, 733, 736, 739, 740, 742, 745,
+ 748, 751, 754, 755, 757, 761, 763, 767,
+ 771, 775, 779, 783, 785, 786, 790, 794,
+ 798, 802, 804, 806, 810, 814, 818, 822,
+ 826, 828, 830, 833, 836, 839, 842, 845,
+ 846, 847, 849, 851, 853, 855, 861, 861,
+ 863, 869
+ };
+
+ static const char _tmedia_machine_imageattr_trans_keys[] = {
+ 9, 32, 82, 83, 114, 115, 69, 101,
+ 67, 99, 86, 118, 9, 32, 9, 32,
+ 42, 91, 69, 101, 67, 99, 86, 118,
+ 9, 32, 9, 32, 42, 91, 88, 120,
+ 61, 91, 49, 57, 44, 48, 57, 89,
+ 121, 61, 91, 49, 57, 44, 93, 48,
+ 57, 80, 81, 83, 112, 113, 115, 65,
+ 97, 82, 114, 61, 91, 48, 49, 57,
+ 46, 49, 57, 45, 48, 57, 48, 49,
+ 57, 46, 49, 57, 93, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 44, 93,
+ 9, 32, 91, 46, 48, 57, 45, 48,
+ 57, 45, 48, 57, 45, 46, 48, 57,
+ 61, 48, 49, 46, 48, 57, 44, 93,
+ 48, 57, 44, 93, 46, 48, 44, 48,
+ 93, 65, 97, 82, 114, 61, 48, 91,
+ 49, 57, 46, 49, 57, 44, 93, 48,
+ 57, 44, 93, 48, 57, 44, 93, 48,
+ 57, 44, 93, 46, 48, 57, 48, 49,
+ 57, 46, 49, 57, 44, 45, 48, 57,
+ 48, 49, 57, 46, 49, 57, 44, 93,
+ 48, 57, 44, 93, 48, 57, 44, 93,
+ 48, 57, 44, 93, 44, 93, 46, 48,
+ 57, 48, 49, 57, 46, 49, 57, 93,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 44, 93, 46, 48, 57, 44, 45,
+ 48, 57, 44, 45, 48, 57, 44, 45,
+ 46, 48, 57, 44, 93, 48, 57, 44,
+ 93, 48, 57, 44, 93, 48, 57, 44,
+ 93, 48, 57, 44, 93, 49, 57, 44,
+ 58, 48, 57, 49, 57, 44, 93, 48,
+ 57, 44, 93, 48, 57, 44, 93, 48,
+ 57, 44, 93, 48, 57, 44, 93, 48,
+ 57, 44, 93, 44, 93, 44, 58, 48,
+ 57, 44, 58, 48, 57, 44, 58, 48,
+ 57, 44, 58, 48, 57, 44, 58, 49,
+ 57, 58, 93, 48, 57, 58, 93, 48,
+ 57, 58, 93, 48, 57, 58, 93, 48,
+ 57, 58, 93, 48, 57, 58, 93, 49,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 44, 93, 44, 48, 57, 44, 48,
+ 57, 44, 48, 57, 44, 48, 57, 44,
+ 49, 57, 44, 58, 48, 57, 49, 57,
+ 44, 93, 48, 57, 44, 93, 48, 57,
+ 44, 93, 48, 57, 44, 93, 48, 57,
+ 44, 93, 48, 57, 44, 93, 44, 44,
+ 58, 48, 57, 44, 58, 48, 57, 44,
+ 58, 48, 57, 44, 58, 48, 57, 44,
+ 58, 49, 57, 58, 93, 48, 57, 58,
+ 93, 48, 57, 58, 93, 48, 57, 58,
+ 93, 48, 57, 58, 93, 48, 57, 58,
+ 93, 49, 57, 93, 48, 57, 93, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 44, 69, 101, 78, 110,
+ 68, 100, 9, 32, 88, 120, 61, 91,
+ 49, 57, 44, 48, 57, 89, 121, 61,
+ 91, 49, 57, 44, 93, 48, 57, 80,
+ 81, 83, 112, 113, 115, 65, 97, 82,
+ 114, 61, 91, 48, 49, 57, 46, 49,
+ 57, 45, 48, 57, 48, 49, 57, 46,
+ 49, 57, 93, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 44, 93, 46, 48,
+ 57, 45, 48, 57, 45, 48, 57, 45,
+ 46, 48, 57, 61, 48, 49, 46, 48,
+ 57, 44, 93, 48, 57, 44, 93, 46,
+ 48, 44, 48, 93, 65, 97, 82, 114,
+ 61, 48, 91, 49, 57, 46, 49, 57,
+ 44, 93, 48, 57, 44, 93, 48, 57,
+ 44, 93, 48, 57, 44, 93, 46, 48,
+ 57, 48, 49, 57, 46, 49, 57, 44,
+ 45, 48, 57, 48, 49, 57, 46, 49,
+ 57, 44, 93, 48, 57, 44, 93, 48,
+ 57, 44, 93, 48, 57, 44, 93, 44,
+ 93, 46, 48, 57, 48, 49, 57, 46,
+ 49, 57, 93, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 44, 93, 46, 48,
+ 57, 44, 45, 48, 57, 44, 45, 48,
+ 57, 44, 45, 46, 48, 57, 44, 93,
+ 48, 57, 44, 93, 48, 57, 44, 93,
+ 48, 57, 44, 93, 48, 57, 44, 93,
+ 49, 57, 44, 58, 48, 57, 49, 57,
+ 44, 93, 48, 57, 44, 93, 48, 57,
+ 44, 93, 48, 57, 44, 93, 48, 57,
+ 44, 93, 48, 57, 44, 93, 44, 93,
+ 44, 58, 48, 57, 44, 58, 48, 57,
+ 44, 58, 48, 57, 44, 58, 48, 57,
+ 44, 58, 49, 57, 58, 93, 48, 57,
+ 58, 93, 48, 57, 58, 93, 48, 57,
+ 58, 93, 48, 57, 58, 93, 48, 57,
+ 58, 93, 49, 57, 93, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 44, 93, 44, 48,
+ 57, 44, 48, 57, 44, 48, 57, 44,
+ 48, 57, 44, 49, 57, 44, 58, 48,
+ 57, 49, 57, 44, 93, 48, 57, 44,
+ 93, 48, 57, 44, 93, 48, 57, 44,
+ 93, 48, 57, 44, 93, 48, 57, 44,
+ 93, 44, 44, 58, 48, 57, 44, 58,
+ 48, 57, 44, 58, 48, 57, 44, 58,
+ 48, 57, 44, 58, 49, 57, 58, 93,
+ 48, 57, 58, 93, 48, 57, 58, 93,
+ 48, 57, 58, 93, 48, 57, 58, 93,
+ 48, 57, 58, 93, 49, 57, 93, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 44, 69,
+ 101, 78, 110, 68, 100, 9, 32, 9,
+ 32, 82, 83, 114, 115, 9, 32, 9,
+ 32, 82, 83, 114, 115, 9, 32, 82,
+ 83, 91, 114, 115, 0
+ };
+
+ static const char _tmedia_machine_imageattr_single_lengths[] = {
+ 0, 6, 2, 2, 2, 2, 4, 2,
+ 2, 2, 2, 4, 2, 1, 1, 1,
+ 2, 1, 1, 2, 6, 2, 2, 1,
+ 1, 1, 1, 0, 1, 1, 1, 0,
+ 1, 1, 1, 1, 2, 3, 1, 0,
+ 1, 1, 1, 1, 0, 1, 2, 1,
+ 0, 2, 2, 1, 1, 3, 2, 2,
+ 1, 2, 1, 0, 2, 2, 2, 2,
+ 1, 0, 1, 1, 0, 2, 1, 1,
+ 0, 2, 2, 2, 2, 2, 1, 0,
+ 1, 1, 0, 1, 1, 1, 1, 2,
+ 1, 0, 2, 2, 2, 1, 0, 2,
+ 2, 2, 2, 2, 0, 2, 0, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 0, 2, 2, 2, 2,
+ 2, 2, 0, 1, 1, 1, 1, 1,
+ 1, 2, 1, 1, 1, 1, 1, 0,
+ 2, 0, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 0, 2,
+ 2, 2, 2, 2, 2, 0, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 2,
+ 2, 2, 1, 1, 1, 2, 1, 1,
+ 2, 6, 2, 2, 1, 1, 1, 1,
+ 0, 1, 1, 1, 0, 1, 1, 1,
+ 1, 2, 1, 0, 1, 1, 1, 1,
+ 0, 1, 2, 1, 0, 2, 2, 1,
+ 1, 3, 2, 2, 1, 2, 1, 0,
+ 2, 2, 2, 2, 1, 0, 1, 1,
+ 0, 2, 1, 1, 0, 2, 2, 2,
+ 2, 2, 1, 0, 1, 1, 0, 1,
+ 1, 1, 1, 2, 1, 0, 2, 2,
+ 2, 1, 0, 2, 2, 2, 2, 2,
+ 0, 2, 0, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 0, 1,
+ 1, 1, 1, 1, 1, 2, 1, 1,
+ 1, 1, 1, 0, 2, 0, 2, 2,
+ 2, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 0, 2, 2, 2, 2, 2,
+ 2, 0, 1, 1, 1, 1, 1, 1,
+ 1, 2, 2, 2, 2, 6, 0, 2,
+ 6, 7
+ };
+
+ static const char _tmedia_machine_imageattr_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 0, 1,
+ 1, 1, 1, 0, 0, 0, 0, 1,
+ 1, 1, 0, 0, 1, 0, 0, 0,
+ 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 0,
+ 0, 1, 1, 0, 1, 1, 1, 0,
+ 1, 1, 1, 1, 0, 0, 0, 1,
+ 1, 0, 1, 1, 1, 1, 0, 0,
+ 0, 1, 1, 1, 0, 0, 1, 1,
+ 1, 1, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 1, 1,
+ 1, 1, 0, 1, 1, 1, 1, 1,
+ 1, 0, 1, 1, 1, 1, 1, 1,
+ 0, 0, 1, 1, 1, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 0, 1, 1, 1, 1, 0, 1, 1,
+ 1, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 1, 0,
+ 1, 1, 1, 0, 1, 1, 1, 1,
+ 0, 0, 0, 1, 1, 1, 0, 0,
+ 1, 0, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 1,
+ 1, 1, 1, 0, 0, 1, 1, 0,
+ 1, 1, 1, 0, 1, 1, 1, 1,
+ 0, 0, 0, 1, 1, 0, 1, 1,
+ 1, 1, 0, 0, 0, 1, 1, 1,
+ 0, 0, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 1, 1, 1, 1, 0, 1,
+ 1, 1, 1, 1, 1, 0, 1, 1,
+ 1, 1, 1, 1, 0, 0, 1, 1,
+ 1, 1, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 1, 1, 1,
+ 1, 0, 1, 1, 1, 1, 1, 1,
+ 0, 1, 1, 1, 1, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const short _tmedia_machine_imageattr_index_offsets[] = {
+ 0, 0, 7, 10, 13, 16, 19, 24,
+ 27, 30, 33, 36, 41, 44, 46, 49,
+ 52, 55, 57, 60, 64, 71, 74, 77,
+ 79, 81, 84, 86, 88, 91, 94, 96,
+ 98, 101, 104, 107, 109, 112, 116, 118,
+ 120, 123, 126, 128, 130, 132, 134, 137,
+ 139, 141, 145, 148, 150, 152, 156, 159,
+ 162, 164, 168, 170, 172, 176, 180, 184,
+ 187, 189, 191, 194, 196, 198, 202, 205,
+ 207, 209, 213, 217, 221, 224, 227, 229,
+ 231, 234, 236, 238, 241, 244, 247, 249,
+ 252, 254, 256, 260, 264, 267, 269, 271,
+ 275, 279, 283, 287, 290, 292, 296, 298,
+ 302, 306, 310, 314, 318, 321, 324, 328,
+ 332, 336, 340, 343, 345, 349, 353, 357,
+ 361, 365, 368, 370, 373, 376, 379, 382,
+ 385, 387, 390, 393, 396, 399, 402, 404,
+ 406, 410, 412, 416, 420, 424, 428, 432,
+ 435, 437, 441, 445, 449, 453, 456, 458,
+ 462, 466, 470, 474, 478, 481, 483, 486,
+ 489, 492, 495, 498, 500, 502, 505, 508,
+ 511, 514, 517, 519, 522, 525, 528, 530,
+ 533, 537, 544, 547, 550, 552, 554, 557,
+ 559, 561, 564, 567, 569, 571, 574, 577,
+ 580, 582, 585, 587, 589, 592, 595, 597,
+ 599, 601, 603, 606, 608, 610, 614, 617,
+ 619, 621, 625, 628, 631, 633, 637, 639,
+ 641, 645, 649, 653, 656, 658, 660, 663,
+ 665, 667, 671, 674, 676, 678, 682, 686,
+ 690, 693, 696, 698, 700, 703, 705, 707,
+ 710, 713, 716, 718, 721, 723, 725, 729,
+ 733, 736, 738, 740, 744, 748, 752, 756,
+ 759, 761, 765, 767, 771, 775, 779, 783,
+ 787, 790, 793, 797, 801, 805, 809, 812,
+ 814, 818, 822, 826, 830, 834, 837, 839,
+ 842, 845, 848, 851, 854, 856, 859, 862,
+ 865, 868, 871, 873, 875, 879, 881, 885,
+ 889, 893, 897, 901, 904, 906, 910, 914,
+ 918, 922, 925, 927, 931, 935, 939, 943,
+ 947, 950, 952, 955, 958, 961, 964, 967,
+ 969, 971, 974, 977, 980, 983, 990, 991,
+ 994, 1001
+ };
+
+ static const short _tmedia_machine_imageattr_trans_targs[] = {
+ 1, 1, 2, 321, 2, 321, 0, 3,
+ 3, 0, 4, 4, 0, 5, 5, 0,
+ 6, 6, 0, 6, 6, 325, 169, 0,
+ 8, 8, 0, 9, 9, 0, 10, 10,
+ 0, 11, 11, 0, 11, 11, 326, 12,
+ 0, 13, 13, 0, 14, 0, 135, 15,
+ 0, 16, 130, 0, 17, 17, 0, 18,
+ 0, 100, 19, 0, 20, 327, 95, 0,
+ 21, 45, 54, 21, 45, 54, 0, 22,
+ 22, 0, 23, 23, 0, 24, 0, 25,
+ 0, 26, 43, 0, 27, 0, 28, 0,
+ 29, 40, 0, 30, 38, 0, 31, 0,
+ 32, 0, 36, 33, 0, 36, 34, 0,
+ 36, 35, 0, 36, 0, 20, 327, 0,
+ 37, 37, 12, 0, 39, 0, 32, 0,
+ 29, 41, 0, 29, 42, 0, 29, 0,
+ 44, 0, 28, 0, 46, 0, 47, 51,
+ 0, 48, 0, 49, 0, 20, 327, 50,
+ 0, 20, 327, 0, 52, 0, 53, 0,
+ 20, 50, 327, 0, 55, 55, 0, 56,
+ 56, 0, 57, 0, 58, 66, 64, 0,
+ 59, 0, 60, 0, 20, 327, 61, 0,
+ 20, 327, 62, 0, 20, 327, 63, 0,
+ 20, 327, 0, 65, 0, 60, 0, 67,
+ 93, 0, 68, 0, 69, 0, 70, 80,
+ 90, 0, 71, 78, 0, 72, 0, 73,
+ 0, 70, 77, 74, 0, 70, 77, 75,
+ 0, 70, 77, 76, 0, 70, 77, 0,
+ 20, 327, 0, 79, 0, 73, 0, 81,
+ 88, 0, 82, 0, 83, 0, 87, 84,
+ 0, 87, 85, 0, 87, 86, 0, 87,
+ 0, 20, 327, 0, 89, 0, 83, 0,
+ 70, 80, 91, 0, 70, 80, 92, 0,
+ 70, 80, 0, 94, 0, 69, 0, 20,
+ 327, 96, 0, 20, 327, 97, 0, 20,
+ 327, 98, 0, 20, 327, 99, 0, 20,
+ 327, 0, 101, 0, 102, 115, 110, 0,
+ 103, 0, 102, 109, 104, 0, 102, 109,
+ 105, 0, 102, 109, 106, 0, 102, 109,
+ 107, 0, 102, 109, 108, 0, 102, 109,
+ 0, 20, 327, 0, 102, 115, 111, 0,
+ 102, 115, 112, 0, 102, 115, 113, 0,
+ 102, 115, 114, 0, 102, 115, 0, 116,
+ 0, 122, 129, 117, 0, 122, 129, 118,
+ 0, 122, 129, 119, 0, 122, 129, 120,
+ 0, 122, 129, 121, 0, 122, 129, 0,
+ 123, 0, 129, 124, 0, 129, 125, 0,
+ 129, 126, 0, 129, 127, 0, 129, 128,
+ 0, 129, 0, 20, 327, 0, 16, 131,
+ 0, 16, 132, 0, 16, 133, 0, 16,
+ 134, 0, 16, 0, 136, 0, 137, 150,
+ 145, 0, 138, 0, 137, 144, 139, 0,
+ 137, 144, 140, 0, 137, 144, 141, 0,
+ 137, 144, 142, 0, 137, 144, 143, 0,
+ 137, 144, 0, 16, 0, 137, 150, 146,
+ 0, 137, 150, 147, 0, 137, 150, 148,
+ 0, 137, 150, 149, 0, 137, 150, 0,
+ 151, 0, 157, 164, 152, 0, 157, 164,
+ 153, 0, 157, 164, 154, 0, 157, 164,
+ 155, 0, 157, 164, 156, 0, 157, 164,
+ 0, 158, 0, 164, 159, 0, 164, 160,
+ 0, 164, 161, 0, 164, 162, 0, 164,
+ 163, 0, 164, 0, 16, 0, 166, 166,
+ 0, 167, 167, 0, 168, 168, 0, 11,
+ 11, 0, 170, 170, 0, 171, 0, 291,
+ 172, 0, 173, 286, 0, 174, 174, 0,
+ 175, 0, 256, 176, 0, 177, 328, 251,
+ 0, 178, 201, 210, 178, 201, 210, 0,
+ 179, 179, 0, 180, 180, 0, 181, 0,
+ 182, 0, 183, 199, 0, 184, 0, 185,
+ 0, 186, 196, 0, 187, 194, 0, 188,
+ 0, 189, 0, 193, 190, 0, 193, 191,
+ 0, 193, 192, 0, 193, 0, 177, 328,
+ 0, 195, 0, 189, 0, 186, 197, 0,
+ 186, 198, 0, 186, 0, 200, 0, 185,
+ 0, 202, 0, 203, 207, 0, 204, 0,
+ 205, 0, 177, 328, 206, 0, 177, 328,
+ 0, 208, 0, 209, 0, 177, 206, 328,
+ 0, 211, 211, 0, 212, 212, 0, 213,
+ 0, 214, 222, 220, 0, 215, 0, 216,
+ 0, 177, 328, 217, 0, 177, 328, 218,
+ 0, 177, 328, 219, 0, 177, 328, 0,
+ 221, 0, 216, 0, 223, 249, 0, 224,
+ 0, 225, 0, 226, 236, 246, 0, 227,
+ 234, 0, 228, 0, 229, 0, 226, 233,
+ 230, 0, 226, 233, 231, 0, 226, 233,
+ 232, 0, 226, 233, 0, 177, 328, 0,
+ 235, 0, 229, 0, 237, 244, 0, 238,
+ 0, 239, 0, 243, 240, 0, 243, 241,
+ 0, 243, 242, 0, 243, 0, 177, 328,
+ 0, 245, 0, 239, 0, 226, 236, 247,
+ 0, 226, 236, 248, 0, 226, 236, 0,
+ 250, 0, 225, 0, 177, 328, 252, 0,
+ 177, 328, 253, 0, 177, 328, 254, 0,
+ 177, 328, 255, 0, 177, 328, 0, 257,
+ 0, 258, 271, 266, 0, 259, 0, 258,
+ 265, 260, 0, 258, 265, 261, 0, 258,
+ 265, 262, 0, 258, 265, 263, 0, 258,
+ 265, 264, 0, 258, 265, 0, 177, 328,
+ 0, 258, 271, 267, 0, 258, 271, 268,
+ 0, 258, 271, 269, 0, 258, 271, 270,
+ 0, 258, 271, 0, 272, 0, 278, 285,
+ 273, 0, 278, 285, 274, 0, 278, 285,
+ 275, 0, 278, 285, 276, 0, 278, 285,
+ 277, 0, 278, 285, 0, 279, 0, 285,
+ 280, 0, 285, 281, 0, 285, 282, 0,
+ 285, 283, 0, 285, 284, 0, 285, 0,
+ 177, 328, 0, 173, 287, 0, 173, 288,
+ 0, 173, 289, 0, 173, 290, 0, 173,
+ 0, 292, 0, 293, 306, 301, 0, 294,
+ 0, 293, 300, 295, 0, 293, 300, 296,
+ 0, 293, 300, 297, 0, 293, 300, 298,
+ 0, 293, 300, 299, 0, 293, 300, 0,
+ 173, 0, 293, 306, 302, 0, 293, 306,
+ 303, 0, 293, 306, 304, 0, 293, 306,
+ 305, 0, 293, 306, 0, 307, 0, 313,
+ 320, 308, 0, 313, 320, 309, 0, 313,
+ 320, 310, 0, 313, 320, 311, 0, 313,
+ 320, 312, 0, 313, 320, 0, 314, 0,
+ 320, 315, 0, 320, 316, 0, 320, 317,
+ 0, 320, 318, 0, 320, 319, 0, 320,
+ 0, 173, 0, 322, 322, 0, 323, 323,
+ 0, 324, 324, 0, 6, 6, 0, 325,
+ 325, 7, 165, 7, 165, 0, 0, 37,
+ 37, 0, 329, 329, 7, 165, 7, 165,
+ 0, 329, 329, 7, 165, 169, 7, 165,
+ 0, 0
+ };
+
+ static const char _tmedia_machine_imageattr_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 43,
+ 0, 49, 0, 0, 0, 0, 0, 0,
+ 0, 9, 46, 0, 49, 49, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0, 0, 0, 0, 0,
+ 39, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 41, 0, 0, 41, 0, 0,
+ 41, 0, 0, 41, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 39, 0, 0, 39, 0, 0, 39, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 0, 0, 0, 0, 0, 25, 25, 0,
+ 0, 25, 25, 0, 0, 0, 0, 0,
+ 25, 0, 25, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 52, 31, 52, 0,
+ 0, 0, 0, 0, 55, 55, 0, 0,
+ 55, 55, 0, 0, 55, 55, 0, 0,
+ 55, 55, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 33, 35,
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 33, 33, 0, 0, 33, 33, 0,
+ 0, 33, 33, 0, 0, 33, 33, 0,
+ 27, 27, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 37, 0,
+ 0, 37, 0, 0, 37, 0, 0, 37,
+ 0, 29, 29, 0, 0, 0, 0, 0,
+ 33, 35, 0, 0, 33, 35, 0, 0,
+ 33, 35, 0, 0, 0, 0, 0, 49,
+ 49, 0, 0, 49, 49, 0, 0, 49,
+ 49, 0, 0, 49, 49, 0, 0, 49,
+ 49, 0, 1, 0, 23, 17, 0, 0,
+ 1, 0, 23, 23, 0, 0, 23, 23,
+ 0, 0, 23, 23, 0, 0, 23, 23,
+ 0, 0, 23, 23, 0, 0, 23, 23,
+ 0, 13, 13, 0, 23, 17, 0, 0,
+ 23, 17, 0, 0, 23, 17, 0, 0,
+ 23, 17, 0, 0, 23, 17, 0, 1,
+ 0, 19, 21, 0, 0, 19, 21, 0,
+ 0, 19, 21, 0, 0, 19, 21, 0,
+ 0, 19, 21, 0, 0, 19, 21, 0,
+ 1, 0, 21, 0, 0, 21, 0, 0,
+ 21, 0, 0, 21, 0, 0, 21, 0,
+ 0, 21, 0, 15, 15, 0, 49, 0,
+ 0, 49, 0, 0, 49, 0, 0, 49,
+ 0, 0, 49, 0, 1, 0, 23, 17,
+ 0, 0, 1, 0, 23, 23, 0, 0,
+ 23, 23, 0, 0, 23, 23, 0, 0,
+ 23, 23, 0, 0, 23, 23, 0, 0,
+ 23, 23, 0, 13, 0, 23, 17, 0,
+ 0, 23, 17, 0, 0, 23, 17, 0,
+ 0, 23, 17, 0, 0, 23, 17, 0,
+ 1, 0, 19, 21, 0, 0, 19, 21,
+ 0, 0, 19, 21, 0, 0, 19, 21,
+ 0, 0, 19, 21, 0, 0, 19, 21,
+ 0, 1, 0, 21, 0, 0, 21, 0,
+ 0, 21, 0, 0, 21, 0, 0, 21,
+ 0, 0, 21, 0, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3,
+ 3, 0, 0, 0, 0, 0, 0, 7,
+ 43, 0, 49, 0, 0, 0, 0, 0,
+ 0, 0, 9, 46, 0, 49, 49, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 39, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 41, 0, 0, 41, 0,
+ 0, 41, 0, 0, 41, 0, 0, 0,
+ 0, 0, 0, 0, 0, 39, 0, 0,
+ 39, 0, 0, 39, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 25, 25, 0, 0, 25, 25,
+ 0, 0, 0, 0, 0, 25, 0, 25,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 52, 31, 52, 0, 0, 0, 0,
+ 0, 55, 55, 0, 0, 55, 55, 0,
+ 0, 55, 55, 0, 0, 55, 55, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 33, 35, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 33, 33,
+ 0, 0, 33, 33, 0, 0, 33, 33,
+ 0, 0, 33, 33, 0, 27, 27, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 37, 0, 0, 37, 0,
+ 0, 37, 0, 0, 37, 0, 29, 29,
+ 0, 0, 0, 0, 0, 33, 35, 0,
+ 0, 33, 35, 0, 0, 33, 35, 0,
+ 0, 0, 0, 0, 49, 49, 0, 0,
+ 49, 49, 0, 0, 49, 49, 0, 0,
+ 49, 49, 0, 0, 49, 49, 0, 1,
+ 0, 23, 17, 0, 0, 1, 0, 23,
+ 23, 0, 0, 23, 23, 0, 0, 23,
+ 23, 0, 0, 23, 23, 0, 0, 23,
+ 23, 0, 0, 23, 23, 0, 13, 13,
+ 0, 23, 17, 0, 0, 23, 17, 0,
+ 0, 23, 17, 0, 0, 23, 17, 0,
+ 0, 23, 17, 0, 1, 0, 19, 21,
+ 0, 0, 19, 21, 0, 0, 19, 21,
+ 0, 0, 19, 21, 0, 0, 19, 21,
+ 0, 0, 19, 21, 0, 1, 0, 21,
+ 0, 0, 21, 0, 0, 21, 0, 0,
+ 21, 0, 0, 21, 0, 0, 21, 0,
+ 15, 15, 0, 49, 0, 0, 49, 0,
+ 0, 49, 0, 0, 49, 0, 0, 49,
+ 0, 1, 0, 23, 17, 0, 0, 1,
+ 0, 23, 23, 0, 0, 23, 23, 0,
+ 0, 23, 23, 0, 0, 23, 23, 0,
+ 0, 23, 23, 0, 0, 23, 23, 0,
+ 13, 0, 23, 17, 0, 0, 23, 17,
+ 0, 0, 23, 17, 0, 0, 23, 17,
+ 0, 0, 23, 17, 0, 1, 0, 19,
+ 21, 0, 0, 19, 21, 0, 0, 19,
+ 21, 0, 0, 19, 21, 0, 0, 19,
+ 21, 0, 0, 19, 21, 0, 1, 0,
+ 21, 0, 0, 21, 0, 0, 21, 0,
+ 0, 21, 0, 0, 21, 0, 0, 21,
+ 0, 15, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 11,
+ 11, 0, 11, 11, 11, 11, 11, 11,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const char _tmedia_machine_imageattr_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 11,
+ 11, 0
+ };
+
+ static const int tmedia_machine_imageattr_start = 1;
+ static const int tmedia_machine_imageattr_first_final = 325;
+ static const int tmedia_machine_imageattr_error = 0;
+
+ static const int tmedia_machine_imageattr_en_main = 1;
+
+
+ /* #line 168 "./ragel/tmedia_imageattr.rl" */
+ (void)(eof);
+ (void)(tmedia_machine_imageattr_first_final);
+ (void)(tmedia_machine_imageattr_error);
+ (void)(tmedia_machine_imageattr_en_main);
+
+ /* #line 695 "./src/tmedia_imageattr.c" */
+ {
+ cs = tmedia_machine_imageattr_start;
+ }
+
+ /* #line 173 "./ragel/tmedia_imageattr.rl" */
+ tmedia_imageattr_reset(self);
+
+ /* #line 703 "./src/tmedia_imageattr.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmedia_machine_imageattr_trans_keys + _tmedia_machine_imageattr_key_offsets[cs];
- _trans = _tmedia_machine_imageattr_index_offsets[cs];
-
- _klen = _tmedia_machine_imageattr_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmedia_machine_imageattr_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmedia_machine_imageattr_trans_keys + _tmedia_machine_imageattr_key_offsets[cs];
+ _trans = _tmedia_machine_imageattr_index_offsets[cs];
+
+ _klen = _tmedia_machine_imageattr_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmedia_machine_imageattr_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tmedia_machine_imageattr_trans_targs[_trans];
-
- if ( _tmedia_machine_imageattr_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmedia_machine_imageattr_actions + _tmedia_machine_imageattr_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 40 "./ragel/tmedia_imageattr.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 44 "./ragel/tmedia_imageattr.rl" */
- {
- sets = &self->send.sets[0];
- sets_count = &self->send.count;
- *sets_count = 0;
- }
- break;
- case 2:
-/* #line 50 "./ragel/tmedia_imageattr.rl" */
- {
- sets = &self->recv.sets[0];
- sets_count = &self->recv.count;
- *sets_count = 0;
- }
- break;
- case 3:
-/* #line 56 "./ragel/tmedia_imageattr.rl" */
- {
- xyrange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].xrange : tsk_null;
- }
- break;
- case 4:
-/* #line 59 "./ragel/tmedia_imageattr.rl" */
- {
- xyrange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].yrange : tsk_null;
- }
- break;
- case 5:
-/* #line 62 "./ragel/tmedia_imageattr.rl" */
- {
- if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) (*sets_count)++;
- }
- break;
- case 6:
-/* #line 65 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange) xyrange->is_range = 0;
- }
- break;
- case 7:
-/* #line 68 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange) xyrange->is_range = 1;
- }
- break;
- case 8:
-/* #line 71 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange)xyrange->range.start = atoi(tag_start);
- }
- break;
- case 9:
-/* #line 74 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange)xyrange->range.step = atoi(tag_start);
- }
- break;
- case 10:
-/* #line 77 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange)xyrange->range.end = atoi(tag_start);
- }
- break;
- case 11:
-/* #line 80 "./ragel/tmedia_imageattr.rl" */
- {
- if(xyrange && xyrange->array.count < TMEDIA_imageattr_ARRAY_MAX_SIZE){
- xyrange->array.values[xyrange->array.count++] = atoi(tag_start);
- }
- }
- break;
- case 12:
-/* #line 85 "./ragel/tmedia_imageattr.rl" */
- {
- if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE){
- sets[*sets_count].qvalue = atof(tag_start);
- }
- }
- break;
- case 13:
-/* #line 91 "./ragel/tmedia_imageattr.rl" */
- {
- if(srange) srange->is_range = 0;
- }
- break;
- case 14:
-/* #line 94 "./ragel/tmedia_imageattr.rl" */
- {
- if(srange) srange->is_range = 1;
- }
- break;
- case 15:
-/* #line 97 "./ragel/tmedia_imageattr.rl" */
- {
- srange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].srange : tsk_null;
- }
- break;
- case 16:
-/* #line 100 "./ragel/tmedia_imageattr.rl" */
- {
- if(srange && srange->array.count < TMEDIA_imageattr_ARRAY_MAX_SIZE){
- srange->array.values[srange->array.count++] = atof(tag_start);
- }
- }
- break;
- case 17:
-/* #line 105 "./ragel/tmedia_imageattr.rl" */
- {
- if(srange) srange->range.start = atof(tag_start);
- }
- break;
- case 18:
-/* #line 108 "./ragel/tmedia_imageattr.rl" */
- {
- if(srange) srange->range.end = atof(tag_start);
- }
- break;
- case 19:
-/* #line 112 "./ragel/tmedia_imageattr.rl" */
- {
- if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) sets[*sets_count].prange.start = atof(tag_start);
- }
- break;
- case 20:
-/* #line 115 "./ragel/tmedia_imageattr.rl" */
- {
- if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) sets[*sets_count].prange.end = atof(tag_start), sets[*sets_count].prange.is_present = 1;
- }
- break;
-/* #line 912 "./src/tmedia_imageattr.c" */
- }
- }
+ cs = _tmedia_machine_imageattr_trans_targs[_trans];
+
+ if ( _tmedia_machine_imageattr_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmedia_machine_imageattr_actions + _tmedia_machine_imageattr_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 40 "./ragel/tmedia_imageattr.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 44 "./ragel/tmedia_imageattr.rl" */
+ {
+ sets = &self->send.sets[0];
+ sets_count = &self->send.count;
+ *sets_count = 0;
+ }
+ break;
+ case 2:
+ /* #line 50 "./ragel/tmedia_imageattr.rl" */
+ {
+ sets = &self->recv.sets[0];
+ sets_count = &self->recv.count;
+ *sets_count = 0;
+ }
+ break;
+ case 3:
+ /* #line 56 "./ragel/tmedia_imageattr.rl" */
+ {
+ xyrange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].xrange : tsk_null;
+ }
+ break;
+ case 4:
+ /* #line 59 "./ragel/tmedia_imageattr.rl" */
+ {
+ xyrange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].yrange : tsk_null;
+ }
+ break;
+ case 5:
+ /* #line 62 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ (*sets_count)++;
+ }
+ }
+ break;
+ case 6:
+ /* #line 65 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange) {
+ xyrange->is_range = 0;
+ }
+ }
+ break;
+ case 7:
+ /* #line 68 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange) {
+ xyrange->is_range = 1;
+ }
+ }
+ break;
+ case 8:
+ /* #line 71 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange) {
+ xyrange->range.start = atoi(tag_start);
+ }
+ }
+ break;
+ case 9:
+ /* #line 74 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange) {
+ xyrange->range.step = atoi(tag_start);
+ }
+ }
+ break;
+ case 10:
+ /* #line 77 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange) {
+ xyrange->range.end = atoi(tag_start);
+ }
+ }
+ break;
+ case 11:
+ /* #line 80 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(xyrange && xyrange->array.count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ xyrange->array.values[xyrange->array.count++] = atoi(tag_start);
+ }
+ }
+ break;
+ case 12:
+ /* #line 85 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ sets[*sets_count].qvalue = atof(tag_start);
+ }
+ }
+ break;
+ case 13:
+ /* #line 91 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(srange) {
+ srange->is_range = 0;
+ }
+ }
+ break;
+ case 14:
+ /* #line 94 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(srange) {
+ srange->is_range = 1;
+ }
+ }
+ break;
+ case 15:
+ /* #line 97 "./ragel/tmedia_imageattr.rl" */
+ {
+ srange = (*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) ? &sets[*sets_count].srange : tsk_null;
+ }
+ break;
+ case 16:
+ /* #line 100 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(srange && srange->array.count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ srange->array.values[srange->array.count++] = atof(tag_start);
+ }
+ }
+ break;
+ case 17:
+ /* #line 105 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(srange) {
+ srange->range.start = atof(tag_start);
+ }
+ }
+ break;
+ case 18:
+ /* #line 108 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(srange) {
+ srange->range.end = atof(tag_start);
+ }
+ }
+ break;
+ case 19:
+ /* #line 112 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ sets[*sets_count].prange.start = atof(tag_start);
+ }
+ }
+ break;
+ case 20:
+ /* #line 115 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ sets[*sets_count].prange.end = atof(tag_start), sets[*sets_count].prange.is_present = 1;
+ }
+ }
+ break;
+ /* #line 912 "./src/tmedia_imageattr.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmedia_machine_imageattr_actions + _tmedia_machine_imageattr_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 5:
-/* #line 62 "./ragel/tmedia_imageattr.rl" */
- {
- if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) (*sets_count)++;
- }
- break;
-/* #line 934 "./src/tmedia_imageattr.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 175 "./ragel/tmedia_imageattr.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 946 "./src/tmedia_imageattr.c" */
-325
-/* #line 177 "./ragel/tmedia_imageattr.rl" */
- ){
- TSK_DEBUG_ERROR("Parsing failed to parse image-attr=%s", (char*)in_data);
- return -1;
- }
-
- return 0;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmedia_machine_imageattr_actions + _tmedia_machine_imageattr_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 5:
+ /* #line 62 "./ragel/tmedia_imageattr.rl" */
+ {
+ if(*sets_count < TMEDIA_imageattr_ARRAY_MAX_SIZE) {
+ (*sets_count)++;
+ }
+ }
+ break;
+ /* #line 934 "./src/tmedia_imageattr.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 175 "./ragel/tmedia_imageattr.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 946 "./src/tmedia_imageattr.c" */
+ 325
+ /* #line 177 "./ragel/tmedia_imageattr.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Parsing failed to parse image-attr=%s", (char*)in_data);
+ return -1;
+ }
+
+ return 0;
} \ No newline at end of file
diff --git a/tinyMEDIA/src/tmedia_jitterbuffer.c b/tinyMEDIA/src/tmedia_jitterbuffer.c
index 108eee1..bf43586 100755
--- a/tinyMEDIA/src/tmedia_jitterbuffer.c
+++ b/tinyMEDIA/src/tmedia_jitterbuffer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,183 +34,183 @@ static const tmedia_jitterbuffer_plugin_def_t* __tmedia_jitterbuffer_plugins[TME
int tmedia_jitterbuffer_init(tmedia_jitterbuffer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return 0;
}
int tmedia_jitterbuffer_set(tmedia_jitterbuffer_t *self, const tmedia_param_t* param)
{
- if(!self || !self->plugin || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return self->plugin->set ? self->plugin->set(self, param) : 0;
+ if(!self || !self->plugin || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return self->plugin->set ? self->plugin->set(self, param) : 0;
}
int tmedia_jitterbuffer_open(tmedia_jitterbuffer_t* self, uint32_t frame_duration, uint32_t rate, uint32_t channels)
{
- int ret;
-
- if(!self || !self->plugin || !self->plugin->open){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->opened){
- TSK_DEBUG_WARN("JitterBuffer already opened");
- return 0;
- }
-
- if((ret = self->plugin->open(self, frame_duration, rate, channels))){
- TSK_DEBUG_ERROR("Failed to open [%s] jitterbufferr", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_true;
- return 0;
- }
+ int ret;
+
+ if(!self || !self->plugin || !self->plugin->open) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->opened) {
+ TSK_DEBUG_WARN("JitterBuffer already opened");
+ return 0;
+ }
+
+ if((ret = self->plugin->open(self, frame_duration, rate, channels))) {
+ TSK_DEBUG_ERROR("Failed to open [%s] jitterbufferr", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
}
int tmedia_jitterbuffer_tick(tmedia_jitterbuffer_t* self)
{
- if(!self || !self->plugin || !self->plugin->tick){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !self->plugin || !self->plugin->tick) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!self->opened){
- TSK_DEBUG_ERROR("JitterBuffer not opened");
- return -1;
- }
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("JitterBuffer not opened");
+ return -1;
+ }
- return self->plugin->tick(self);
+ return self->plugin->tick(self);
}
int tmedia_jitterbuffer_put(tmedia_jitterbuffer_t* self, void* data, tsk_size_t data_size, const tsk_object_t* proto_hdr)
{
- if(!self || !self->plugin || !self->plugin->put){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !self->plugin || !self->plugin->put) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!self->opened){
- TSK_DEBUG_ERROR("JitterBuffer not opened");
- return -1;
- }
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("JitterBuffer not opened");
+ return -1;
+ }
- return self->plugin->put(self, data, data_size, proto_hdr);
+ return self->plugin->put(self, data, data_size, proto_hdr);
}
tsk_size_t tmedia_jitterbuffer_get(tmedia_jitterbuffer_t* self, void* out_data, tsk_size_t out_size)
{
- if(!self || !self->plugin || !self->plugin->get){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!self || !self->plugin || !self->plugin->get) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- if(!self->opened){
- TSK_DEBUG_ERROR("JitterBuffer not opened");
- return 0;
- }
+ if(!self->opened) {
+ TSK_DEBUG_ERROR("JitterBuffer not opened");
+ return 0;
+ }
- return self->plugin->get(self, out_data, out_size);
+ return self->plugin->get(self, out_data, out_size);
}
int tmedia_jitterbuffer_reset(tmedia_jitterbuffer_t* self)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->opened && self->plugin->reset){
- return self->plugin->reset(self);
- }
-
- return 0;
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->opened && self->plugin->reset) {
+ return self->plugin->reset(self);
+ }
+
+ return 0;
}
int tmedia_jitterbuffer_close(tmedia_jitterbuffer_t* self)
{
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->opened){
- TSK_DEBUG_WARN("JitterBuffer not opened");
- return 0;
- }
-
- if(self->plugin->close){
- int ret;
-
- if((ret = self->plugin->close(self))){
- TSK_DEBUG_ERROR("Failed to close [%s] jitterbufferr", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
- }
- else{
- self->opened = tsk_false;
- return 0;
- }
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->opened) {
+ TSK_DEBUG_WARN("JitterBuffer not opened");
+ return 0;
+ }
+
+ if(self->plugin->close) {
+ int ret;
+
+ if((ret = self->plugin->close(self))) {
+ TSK_DEBUG_ERROR("Failed to close [%s] jitterbufferr", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
}
int tmedia_jitterbuffer_deinit(tmedia_jitterbuffer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(self->opened){
- tmedia_jitterbuffer_close(self);
- }
+ if(self->opened) {
+ tmedia_jitterbuffer_close(self);
+ }
- return 0;
+ return 0;
}
tmedia_jitterbuffer_t* tmedia_jitterbuffer_create(tmedia_type_t type)
{
- tmedia_jitterbuffer_t* jitter_buffer = tsk_null;
- const tmedia_jitterbuffer_plugin_def_t* plugin;
- tsk_size_t i = 0;
-
- while((i < TMED_JITTER_BUFFER_MAX_PLUGINS) && (plugin = __tmedia_jitterbuffer_plugins[i++])){
- if(plugin->objdef && plugin->type == type){
- if((jitter_buffer = tsk_object_new(plugin->objdef))){
- /* initialize the newly created jitter_buffer */
- jitter_buffer->plugin = plugin;
- break;
- }
- }
- }
-
- return jitter_buffer;
+ tmedia_jitterbuffer_t* jitter_buffer = tsk_null;
+ const tmedia_jitterbuffer_plugin_def_t* plugin;
+ tsk_size_t i = 0;
+
+ while((i < TMED_JITTER_BUFFER_MAX_PLUGINS) && (plugin = __tmedia_jitterbuffer_plugins[i++])) {
+ if(plugin->objdef && plugin->type == type) {
+ if((jitter_buffer = tsk_object_new(plugin->objdef))) {
+ /* initialize the newly created jitter_buffer */
+ jitter_buffer->plugin = plugin;
+ break;
+ }
+ }
+ }
+
+ return jitter_buffer;
}
int tmedia_jitterbuffer_plugin_register(const tmedia_jitterbuffer_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* add or replace the plugin */
- for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS; i++){
- if(!__tmedia_jitterbuffer_plugins[i] || (__tmedia_jitterbuffer_plugins[i] == plugin)){
- __tmedia_jitterbuffer_plugins[i] = plugin;
- return 0;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_JITTER_BUFFER_MAX_PLUGINS);
- return -2;
+ tsk_size_t i;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* add or replace the plugin */
+ for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS; i++) {
+ if(!__tmedia_jitterbuffer_plugins[i] || (__tmedia_jitterbuffer_plugins[i] == plugin)) {
+ __tmedia_jitterbuffer_plugins[i] = plugin;
+ return 0;
+ }
+ }
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_JITTER_BUFFER_MAX_PLUGINS);
+ return -2;
}
/**@ingroup tmedia_jitterbuffer_group
@@ -220,62 +220,62 @@ int tmedia_jitterbuffer_plugin_register(const tmedia_jitterbuffer_plugin_def_t*
*/
int tmedia_jitterbuffer_plugin_unregister(const tmedia_jitterbuffer_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- /* find the plugin to unregister */
- for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS && __tmedia_jitterbuffer_plugins[i]; i++){
- if(__tmedia_jitterbuffer_plugins[i] == plugin){
- __tmedia_jitterbuffer_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if(found){
- for(; i<(TMED_JITTER_BUFFER_MAX_PLUGINS - 1); i++){
- if(__tmedia_jitterbuffer_plugins[i+1]){
- __tmedia_jitterbuffer_plugins[i] = __tmedia_jitterbuffer_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_jitterbuffer_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS && __tmedia_jitterbuffer_plugins[i]; i++) {
+ if(__tmedia_jitterbuffer_plugins[i] == plugin) {
+ __tmedia_jitterbuffer_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if(found) {
+ for(; i<(TMED_JITTER_BUFFER_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_jitterbuffer_plugins[i+1]) {
+ __tmedia_jitterbuffer_plugins[i] = __tmedia_jitterbuffer_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_jitterbuffer_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
int tmedia_jitterbuffer_plugin_unregister_by_type(tmedia_type_t type)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
-
- /* find the plugin to unregister */
- for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS && __tmedia_jitterbuffer_plugins[i]; i++){
- if((__tmedia_jitterbuffer_plugins[i]->type & type) == __tmedia_jitterbuffer_plugins[i]->type){
- __tmedia_jitterbuffer_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if(found){
- for(; i<(TMED_JITTER_BUFFER_MAX_PLUGINS - 1); i++){
- if(__tmedia_jitterbuffer_plugins[i+1]){
- __tmedia_jitterbuffer_plugins[i] = __tmedia_jitterbuffer_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_jitterbuffer_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_JITTER_BUFFER_MAX_PLUGINS && __tmedia_jitterbuffer_plugins[i]; i++) {
+ if((__tmedia_jitterbuffer_plugins[i]->type & type) == __tmedia_jitterbuffer_plugins[i]->type) {
+ __tmedia_jitterbuffer_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if(found) {
+ for(; i<(TMED_JITTER_BUFFER_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_jitterbuffer_plugins[i+1]) {
+ __tmedia_jitterbuffer_plugins[i] = __tmedia_jitterbuffer_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_jitterbuffer_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
diff --git a/tinyMEDIA/src/tmedia_params.c b/tinyMEDIA/src/tmedia_params.c
index 85e9df3..1586a7d 100755
--- a/tinyMEDIA/src/tmedia_params.c
+++ b/tinyMEDIA/src/tmedia_params.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,118 +35,118 @@
#include "tsk_debug.h"
#include "tsk_memory.h"
-tmedia_param_t* tmedia_param_create(tmedia_param_access_type_t access_type,
- tmedia_type_t media_type,
- tmedia_param_plugin_type_t plugin_type,
- tmedia_param_value_type_t value_type,
- const char* key,
- void* value)
+tmedia_param_t* tmedia_param_create(tmedia_param_access_type_t access_type,
+ tmedia_type_t media_type,
+ tmedia_param_plugin_type_t plugin_type,
+ tmedia_param_value_type_t value_type,
+ const char* key,
+ void* value)
{
- tmedia_param_t* param;
-
- if(!key || (!value && (value_type != tmedia_pvt_pobject && value_type != tmedia_pvt_pchar))){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if((param = tsk_object_new(tmedia_param_def_t))){
- param->access_type = access_type;
- param->media_type = media_type;
- param->plugin_type = plugin_type;
- param->value_type = value_type;
- param->key = tsk_strdup(key);
- if(access_type == tmedia_pat_get){
- param->value = (value);
- }
- else if(access_type == tmedia_pat_set){
- switch(value_type){
- case tmedia_pvt_int32:
- if((param->value = tsk_calloc(1, sizeof(int32_t)))){
- memcpy(param->value, value, sizeof(int32_t));
- }
- break;
- case tmedia_pvt_pobject:
- param->value = tsk_object_ref(value);
- break;
- case tmedia_pvt_pchar:
- param->value = tsk_strdup(value);
- break;
- case tmedia_pvt_int64:
- if((param->value = tsk_calloc(1, sizeof(int64_t)))){
- memcpy(param->value, value, sizeof(int64_t));
- }
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create media parameter");
- }
- return param;
+ tmedia_param_t* param;
+
+ if(!key || (!value && (value_type != tmedia_pvt_pobject && value_type != tmedia_pvt_pchar))) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if((param = tsk_object_new(tmedia_param_def_t))) {
+ param->access_type = access_type;
+ param->media_type = media_type;
+ param->plugin_type = plugin_type;
+ param->value_type = value_type;
+ param->key = tsk_strdup(key);
+ if(access_type == tmedia_pat_get) {
+ param->value = (value);
+ }
+ else if(access_type == tmedia_pat_set) {
+ switch(value_type) {
+ case tmedia_pvt_int32:
+ if((param->value = tsk_calloc(1, sizeof(int32_t)))) {
+ memcpy(param->value, value, sizeof(int32_t));
+ }
+ break;
+ case tmedia_pvt_pobject:
+ param->value = tsk_object_ref(value);
+ break;
+ case tmedia_pvt_pchar:
+ param->value = tsk_strdup(value);
+ break;
+ case tmedia_pvt_int64:
+ if((param->value = tsk_calloc(1, sizeof(int64_t)))) {
+ memcpy(param->value, value, sizeof(int64_t));
+ }
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create media parameter");
+ }
+ return param;
}
tmedia_params_L_t* tmedia_params_create_2(va_list *app)
{
- tmedia_session_param_type_t curr;
- tmedia_params_L_t* params;
-
- if(!app){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- params = tmedia_params_create();
-
- while((curr = va_arg(*app, tmedia_session_param_type_t)) != tmedia_sptype_null){
- switch(curr){
- case tmedia_sptype_set:
- case tmedia_sptype_get:
- { /* (tmedia_type_t)MEDIA_TYPE_ENUM, (tmedia_param_plugin_type_t)PLUGIN_TYPE_ENUM, (tmedia_param_value_type_t)VALUE_TYPE_ENUM \
- (const char*)KEY_STR, (void*)&VALUE */
- /* IMPORTANT: do not pass va_arg() directly into the function */
- tmedia_type_t media_type = va_arg(*app, tmedia_type_t);
- tmedia_param_plugin_type_t plugin_type = va_arg(*app, tmedia_param_plugin_type_t);
- tmedia_param_value_type_t value_type = va_arg(*app, tmedia_param_value_type_t);
- const char* key = va_arg(*app, const char*);
- void* value = va_arg(*app, void*);
- tmedia_params_add_param(&params, (curr == tmedia_sptype_set) ? tmedia_pat_set : tmedia_pat_get,
- media_type, plugin_type, value_type, key, value);
- break;
- }
- default:
- { /* va_list will be unsafe => exit */
- TSK_DEBUG_ERROR("%d NOT a valid pname", curr);
- break;
- }
- }/* switch */
- }/* while */
-
- return params;
+ tmedia_session_param_type_t curr;
+ tmedia_params_L_t* params;
+
+ if(!app) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ params = tmedia_params_create();
+
+ while((curr = va_arg(*app, tmedia_session_param_type_t)) != tmedia_sptype_null) {
+ switch(curr) {
+ case tmedia_sptype_set:
+ case tmedia_sptype_get: {
+ /* (tmedia_type_t)MEDIA_TYPE_ENUM, (tmedia_param_plugin_type_t)PLUGIN_TYPE_ENUM, (tmedia_param_value_type_t)VALUE_TYPE_ENUM \
+ (const char*)KEY_STR, (void*)&VALUE */
+ /* IMPORTANT: do not pass va_arg() directly into the function */
+ tmedia_type_t media_type = va_arg(*app, tmedia_type_t);
+ tmedia_param_plugin_type_t plugin_type = va_arg(*app, tmedia_param_plugin_type_t);
+ tmedia_param_value_type_t value_type = va_arg(*app, tmedia_param_value_type_t);
+ const char* key = va_arg(*app, const char*);
+ void* value = va_arg(*app, void*);
+ tmedia_params_add_param(&params, (curr == tmedia_sptype_set) ? tmedia_pat_set : tmedia_pat_get,
+ media_type, plugin_type, value_type, key, value);
+ break;
+ }
+ default: {
+ /* va_list will be unsafe => exit */
+ TSK_DEBUG_ERROR("%d NOT a valid pname", curr);
+ break;
+ }
+ }/* switch */
+ }/* while */
+
+ return params;
}
-int tmedia_params_add_param(tmedia_params_L_t **self,
- tmedia_param_access_type_t access_type,
- tmedia_type_t media_type,
- tmedia_param_plugin_type_t plugin_type,
- tmedia_param_value_type_t value_type,
- const char* key,
- void* value)
+int tmedia_params_add_param(tmedia_params_L_t **self,
+ tmedia_param_access_type_t access_type,
+ tmedia_type_t media_type,
+ tmedia_param_plugin_type_t plugin_type,
+ tmedia_param_value_type_t value_type,
+ const char* key,
+ void* value)
{
- tmedia_param_t *param;
+ tmedia_param_t *param;
- if(!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(!*self){
- *self = tmedia_params_create();
- }
+ if(!*self) {
+ *self = tmedia_params_create();
+ }
- if((param = tmedia_param_create(access_type, media_type, plugin_type, value_type, key, value))){
- tsk_list_push_back_data(*self, (void**)&param);
- }
- return 0;
+ if((param = tmedia_param_create(access_type, media_type, plugin_type, value_type, key, value))) {
+ tsk_list_push_back_data(*self, (void**)&param);
+ }
+ return 0;
}
@@ -157,41 +157,40 @@ int tmedia_params_add_param(tmedia_params_L_t **self,
//
static tsk_object_t* tmedia_param_ctor(tsk_object_t* self, va_list * app)
{
- tmedia_param_t *param = self;
- if(param){
- }
+ tmedia_param_t *param = self;
+ if(param) {
+ }
- return self;
+ return self;
}
static tsk_object_t* tmedia_param_dtor(tsk_object_t* self)
-{
- tmedia_param_t *param = self;
- if(param){
- TSK_FREE(param->key);
- if(param->access_type == tmedia_pat_set){
- switch(param->value_type){
- case tmedia_pvt_pobject:
- TSK_OBJECT_SAFE_FREE(param->value);
- break;
- case tmedia_pvt_pchar:
- case tmedia_pvt_int64:
- case tmedia_pvt_int32:
- TSK_FREE(param->value);
- break;
- }
- }
- }
-
- return self;
+{
+ tmedia_param_t *param = self;
+ if(param) {
+ TSK_FREE(param->key);
+ if(param->access_type == tmedia_pat_set) {
+ switch(param->value_type) {
+ case tmedia_pvt_pobject:
+ TSK_OBJECT_SAFE_FREE(param->value);
+ break;
+ case tmedia_pvt_pchar:
+ case tmedia_pvt_int64:
+ case tmedia_pvt_int32:
+ TSK_FREE(param->value);
+ break;
+ }
+ }
+ }
+
+ return self;
}
-static const tsk_object_def_t tmedia_param_def_s =
-{
- sizeof(tmedia_param_t),
- tmedia_param_ctor,
- tmedia_param_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_param_def_s = {
+ sizeof(tmedia_param_t),
+ tmedia_param_ctor,
+ tmedia_param_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmedia_param_def_t = &tmedia_param_def_s;
diff --git a/tinyMEDIA/src/tmedia_producer.c b/tinyMEDIA/src/tmedia_producer.c
index 4b7c252..7f71013 100755
--- a/tinyMEDIA/src/tmedia_producer.c
+++ b/tinyMEDIA/src/tmedia_producer.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,18 +41,18 @@ const tmedia_producer_plugin_def_t* __tmedia_producer_plugins[TMED_PRODUCER_MAX_
*/
int tmedia_producer_init(tmedia_producer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->video.chroma = TMEDIA_PRODUCER_CHROMA_DEFAULT;
- self->audio.bits_per_sample = TMEDIA_PRODUCER_BITS_PER_SAMPLE_DEFAULT;
- self->audio.channels = TMEDIA_PRODUCER_CHANNELS_DEFAULT;
- self->audio.rate = TMEDIA_PRODUCER_RATE_DEFAULT;
- self->audio.volume = tmedia_defaults_get_volume();
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->video.chroma = TMEDIA_PRODUCER_CHROMA_DEFAULT;
+ self->audio.bits_per_sample = TMEDIA_PRODUCER_BITS_PER_SAMPLE_DEFAULT;
+ self->audio.channels = TMEDIA_PRODUCER_CHANNELS_DEFAULT;
+ self->audio.rate = TMEDIA_PRODUCER_RATE_DEFAULT;
+ self->audio.volume = tmedia_defaults_get_volume();
+
+ return 0;
}
/**@ingroup tmedia_producer_group
@@ -60,15 +60,15 @@ int tmedia_producer_init(tmedia_producer_t* self)
*/
int tmedia_producer_set_enc_callback(tmedia_producer_t *self, tmedia_producer_enc_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->enc_cb.callback = callback;
- self->enc_cb.callback_data = callback_data;
+ self->enc_cb.callback = callback;
+ self->enc_cb.callback_data = callback_data;
- return 0;
+ return 0;
}
/**@ingroup tmedia_producer_group
@@ -76,15 +76,15 @@ int tmedia_producer_set_enc_callback(tmedia_producer_t *self, tmedia_producer_en
*/
int tmedia_producer_set_raw_callback(tmedia_producer_t *self, tmedia_producer_raw_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->raw_cb.callback = callback;
- self->raw_cb.chunck_curr.usr_data = callback_data;
+ self->raw_cb.callback = callback;
+ self->raw_cb.chunck_curr.usr_data = callback_data;
- return 0;
+ return 0;
}
/**@ingroup tmedia_producer_group
@@ -92,11 +92,11 @@ int tmedia_producer_set_raw_callback(tmedia_producer_t *self, tmedia_producer_ra
*/
int tmedia_producer_set(tmedia_producer_t* self, const tmedia_param_t* param)
{
- if(!self || !self->plugin || !self->plugin->set || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->plugin->set(self, param);
+ if(!self || !self->plugin || !self->plugin->set || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->plugin->set(self, param);
}
/**@ingroup tmedia_producer_group
@@ -107,15 +107,15 @@ int tmedia_producer_set(tmedia_producer_t* self, const tmedia_param_t* param)
*/
int tmedia_producer_prepare(tmedia_producer_t *self, const tmedia_codec_t* codec)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->prepare || !codec) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = self->plugin->prepare(self, codec)) == 0) {
- self->is_prepared = tsk_true;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->prepare || !codec) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = self->plugin->prepare(self, codec)) == 0) {
+ self->is_prepared = tsk_true;
+ }
+ return ret;
}
/**@ingroup tmedia_producer_group
@@ -125,15 +125,15 @@ int tmedia_producer_prepare(tmedia_producer_t *self, const tmedia_codec_t* codec
*/
int tmedia_producer_start(tmedia_producer_t *self)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->start) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = self->plugin->start(self)) == 0) {
- self->is_started = tsk_true;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->start) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = self->plugin->start(self)) == 0) {
+ self->is_started = tsk_true;
+ }
+ return ret;
}
@@ -144,11 +144,11 @@ int tmedia_producer_start(tmedia_producer_t *self)
*/
int tmedia_producer_pause(tmedia_producer_t *self)
{
- if (!self || !self->plugin || !self->plugin->pause) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return self->plugin->pause(self);
+ if (!self || !self->plugin || !self->plugin->pause) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return self->plugin->pause(self);
}
@@ -159,15 +159,15 @@ int tmedia_producer_pause(tmedia_producer_t *self)
*/
int tmedia_producer_stop(tmedia_producer_t *self)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->stop) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = self->plugin->stop(self)) == 0) {
- self->is_started = tsk_false;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->stop) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = self->plugin->stop(self)) == 0) {
+ self->is_started = tsk_false;
+ }
+ return ret;
}
@@ -180,11 +180,11 @@ int tmedia_producer_stop(tmedia_producer_t *self)
*/
int tmedia_producer_deinit(tmedia_producer_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return 0;
}
/**@ingroup tmedia_producer_group
@@ -195,22 +195,22 @@ int tmedia_producer_deinit(tmedia_producer_t* self)
*/
tmedia_producer_t* tmedia_producer_create(tmedia_type_t type, uint64_t session_id)
{
- tmedia_producer_t* producer = tsk_null;
- const tmedia_producer_plugin_def_t* plugin;
- tsk_size_t i = 0;
-
- while((i < TMED_PRODUCER_MAX_PLUGINS) && (plugin = __tmedia_producer_plugins[i++])){
- if(plugin->objdef && plugin->type == type){
- if((producer = tsk_object_new(plugin->objdef))){
- /* initialize the newly created producer */
- producer->plugin = plugin;
- producer->session_id = session_id;
- break;
- }
- }
- }
-
- return producer;
+ tmedia_producer_t* producer = tsk_null;
+ const tmedia_producer_plugin_def_t* plugin;
+ tsk_size_t i = 0;
+
+ while((i < TMED_PRODUCER_MAX_PLUGINS) && (plugin = __tmedia_producer_plugins[i++])) {
+ if(plugin->objdef && plugin->type == type) {
+ if((producer = tsk_object_new(plugin->objdef))) {
+ /* initialize the newly created producer */
+ producer->plugin = plugin;
+ producer->session_id = session_id;
+ break;
+ }
+ }
+ }
+
+ return producer;
}
/**@ingroup tmedia_producer_group
@@ -221,22 +221,22 @@ tmedia_producer_t* tmedia_producer_create(tmedia_type_t type, uint64_t session_i
*/
int tmedia_producer_plugin_register(const tmedia_producer_plugin_def_t* plugin)
{
- tsk_size_t i;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* add or replace the plugin */
- for(i = 0; i<TMED_PRODUCER_MAX_PLUGINS; i++){
- if(!__tmedia_producer_plugins[i] || (__tmedia_producer_plugins[i] == plugin)){
- __tmedia_producer_plugins[i] = plugin;
- return 0;
- }
- }
-
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_PRODUCER_MAX_PLUGINS);
- return -2;
+ tsk_size_t i;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* add or replace the plugin */
+ for(i = 0; i<TMED_PRODUCER_MAX_PLUGINS; i++) {
+ if(!__tmedia_producer_plugins[i] || (__tmedia_producer_plugins[i] == plugin)) {
+ __tmedia_producer_plugins[i] = plugin;
+ return 0;
+ }
+ }
+
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_PRODUCER_MAX_PLUGINS);
+ return -2;
}
/**@ingroup tmedia_producer_group
@@ -246,35 +246,35 @@ int tmedia_producer_plugin_register(const tmedia_producer_plugin_def_t* plugin)
*/
int tmedia_producer_plugin_unregister(const tmedia_producer_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- /* find the plugin to unregister */
- for(i = 0; i<TMED_PRODUCER_MAX_PLUGINS && __tmedia_producer_plugins[i]; i++){
- if(__tmedia_producer_plugins[i] == plugin){
- __tmedia_producer_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if(found){
- for(; i<(TMED_PRODUCER_MAX_PLUGINS - 1); i++){
- if(__tmedia_producer_plugins[i+1]){
- __tmedia_producer_plugins[i] = __tmedia_producer_plugins[i+1];
- }
- else{
- break;
- }
- }
- __tmedia_producer_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ /* find the plugin to unregister */
+ for(i = 0; i<TMED_PRODUCER_MAX_PLUGINS && __tmedia_producer_plugins[i]; i++) {
+ if(__tmedia_producer_plugins[i] == plugin) {
+ __tmedia_producer_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if(found) {
+ for(; i<(TMED_PRODUCER_MAX_PLUGINS - 1); i++) {
+ if(__tmedia_producer_plugins[i+1]) {
+ __tmedia_producer_plugins[i] = __tmedia_producer_plugins[i+1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_producer_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
/**@ingroup tmedia_producer_group
@@ -284,21 +284,21 @@ int tmedia_producer_plugin_unregister(const tmedia_producer_plugin_def_t* plugin
*/
int tmedia_producer_plugin_unregister_by_type(tmedia_type_t type)
{
- int i, j;
-
- /* find the plugin to unregister */
- for (i = 0; i < TMED_PRODUCER_MAX_PLUGINS && __tmedia_producer_plugins[i]; ) {
- if ((__tmedia_producer_plugins[i]->type & type) == __tmedia_producer_plugins[i]->type) {
- __tmedia_producer_plugins[i] = tsk_null;
- /* compact */
- for (j = i; j < (TMED_PRODUCER_MAX_PLUGINS - 1) && __tmedia_producer_plugins[j + 1]; ++j) {
- __tmedia_producer_plugins[j] = __tmedia_producer_plugins[j + 1];
- }
- __tmedia_producer_plugins[j] = tsk_null;
- }
- else {
- ++i;
- }
- }
- return 0;
+ int i, j;
+
+ /* find the plugin to unregister */
+ for (i = 0; i < TMED_PRODUCER_MAX_PLUGINS && __tmedia_producer_plugins[i]; ) {
+ if ((__tmedia_producer_plugins[i]->type & type) == __tmedia_producer_plugins[i]->type) {
+ __tmedia_producer_plugins[i] = tsk_null;
+ /* compact */
+ for (j = i; j < (TMED_PRODUCER_MAX_PLUGINS - 1) && __tmedia_producer_plugins[j + 1]; ++j) {
+ __tmedia_producer_plugins[j] = __tmedia_producer_plugins[j + 1];
+ }
+ __tmedia_producer_plugins[j] = tsk_null;
+ }
+ else {
+ ++i;
+ }
+ }
+ return 0;
}
diff --git a/tinyMEDIA/src/tmedia_qos.c b/tinyMEDIA/src/tmedia_qos.c
index c5c9d3d..1a4b0af 100755
--- a/tinyMEDIA/src/tmedia_qos.c
+++ b/tinyMEDIA/src/tmedia_qos.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,401 +36,402 @@
static const char* tmedia_qos_strength_tostring(tmedia_qos_strength_t strength)
{
- switch(strength){
- case tmedia_qos_strength_none:
- return "none";
- case tmedia_qos_strength_mandatory:
- return "mandatory";
- case tmedia_qos_strength_optional:
- return "optional";
- case tmedia_qos_strength_failure:
- return "failure";
- case tmedia_qos_strength_unknown:
- default:
- return "unknown";
- }
+ switch(strength) {
+ case tmedia_qos_strength_none:
+ return "none";
+ case tmedia_qos_strength_mandatory:
+ return "mandatory";
+ case tmedia_qos_strength_optional:
+ return "optional";
+ case tmedia_qos_strength_failure:
+ return "failure";
+ case tmedia_qos_strength_unknown:
+ default:
+ return "unknown";
+ }
}
static tmedia_qos_strength_t tmedia_qos_strength_fromstring(const char* strength)
{
- if(tsk_strequals(strength, "none")){
- return tmedia_qos_strength_none;
- }
- else if(tsk_strequals(strength, "mandatory")){
- return tmedia_qos_strength_mandatory;
- }
- else if(tsk_strequals(strength, "optional")){
- return tmedia_qos_strength_optional;
- }
- else if(tsk_strequals(strength, "failure")){
- return tmedia_qos_strength_failure;
- }
- else{
- return tmedia_qos_strength_unknown;
- }
+ if(tsk_strequals(strength, "none")) {
+ return tmedia_qos_strength_none;
+ }
+ else if(tsk_strequals(strength, "mandatory")) {
+ return tmedia_qos_strength_mandatory;
+ }
+ else if(tsk_strequals(strength, "optional")) {
+ return tmedia_qos_strength_optional;
+ }
+ else if(tsk_strequals(strength, "failure")) {
+ return tmedia_qos_strength_failure;
+ }
+ else {
+ return tmedia_qos_strength_unknown;
+ }
}
static tmedia_qos_direction_t tmedia_qos_direction_fromstring(const char* direction)
{
- if(tsk_strequals(direction, "send")){
- return tmedia_qos_direction_send;
- }
- else if(tsk_strequals(direction, "recv")){
- return tmedia_qos_direction_recv;
- }
- else if(tsk_strequals(direction, "sendrecv")){
- return tmedia_qos_direction_sendrecv;
- }
- else{
- return tmedia_qos_direction_none;
- }
+ if(tsk_strequals(direction, "send")) {
+ return tmedia_qos_direction_send;
+ }
+ else if(tsk_strequals(direction, "recv")) {
+ return tmedia_qos_direction_recv;
+ }
+ else if(tsk_strequals(direction, "sendrecv")) {
+ return tmedia_qos_direction_sendrecv;
+ }
+ else {
+ return tmedia_qos_direction_none;
+ }
}
/* ========================= Common ==================================*/
tmedia_qos_tline_t* tmedia_qos_tline_create(tmedia_qos_stype_t type, tmedia_qos_strength_t strength)
{
- switch(type){
- case tmedia_qos_stype_e2e:
- return (tmedia_qos_tline_t*)tmedia_qos_tline_e2e_create(strength);
- case tmedia_qos_stype_segmented:
- return (tmedia_qos_tline_t*)tmedia_qos_tline_segmented_create(strength);
- default: break;
- }
- return tsk_null;
+ switch(type) {
+ case tmedia_qos_stype_e2e:
+ return (tmedia_qos_tline_t*)tmedia_qos_tline_e2e_create(strength);
+ case tmedia_qos_stype_segmented:
+ return (tmedia_qos_tline_t*)tmedia_qos_tline_segmented_create(strength);
+ default:
+ break;
+ }
+ return tsk_null;
}
tmedia_qos_stype_t tmedia_qos_get_type(const tsdp_header_M_t* m)
{
- const tsdp_header_A_t* A;
- char s0[10];
-
- if(!m){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tmedia_qos_stype_none;
- }
-
- if((A = tsdp_header_M_findA(m, "curr"))){
- if(sscanf(A->value, "qos %s %*s", s0) != EOF){
- return tsk_strequals(s0, "e2e") ? tmedia_qos_stype_e2e : tmedia_qos_stype_segmented;
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- return tmedia_qos_stype_none;
+ const tsdp_header_A_t* A;
+ char s0[10];
+
+ if(!m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tmedia_qos_stype_none;
+ }
+
+ if((A = tsdp_header_M_findA(m, "curr"))) {
+ if(sscanf(A->value, "qos %s %*s", s0) != EOF) {
+ return tsk_strequals(s0, "e2e") ? tmedia_qos_stype_e2e : tmedia_qos_stype_segmented;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ return tmedia_qos_stype_none;
}
tmedia_qos_tline_t* tmedia_qos_tline_from_sdp(const tsdp_header_M_t* m)
{
- if(!m){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- switch(tmedia_qos_get_type(m)){
- case tmedia_qos_stype_e2e:
- return (tmedia_qos_tline_t*)tmedia_qos_tline_e2e_from_sdp(m);
- case tmedia_qos_stype_segmented:
- return (tmedia_qos_tline_t*)tmedia_qos_tline_segmented_from_sdp(m);
- default:
- return tsk_null;
- }
+ if(!m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ switch(tmedia_qos_get_type(m)) {
+ case tmedia_qos_stype_e2e:
+ return (tmedia_qos_tline_t*)tmedia_qos_tline_e2e_from_sdp(m);
+ case tmedia_qos_stype_segmented:
+ return (tmedia_qos_tline_t*)tmedia_qos_tline_segmented_from_sdp(m);
+ default:
+ return tsk_null;
+ }
}
int tmedia_qos_tline_to_sdp(const tmedia_qos_tline_t* self, tsdp_header_M_t* m)
{
- if(!self || !m){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->type){
- case tmedia_qos_stype_e2e:
- return tmedia_qos_tline_e2e_to_sdp((tmedia_qos_tline_e2e_t*)self, m);
- case tmedia_qos_stype_segmented:
- return tmedia_qos_tline_segmented_to_sdp((tmedia_qos_tline_segmented_t*)self, m);
- default:
- TSK_DEBUG_ERROR("Invalid type");
- return -2;
- }
+ if(!self || !m) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->type) {
+ case tmedia_qos_stype_e2e:
+ return tmedia_qos_tline_e2e_to_sdp((tmedia_qos_tline_e2e_t*)self, m);
+ case tmedia_qos_stype_segmented:
+ return tmedia_qos_tline_segmented_to_sdp((tmedia_qos_tline_segmented_t*)self, m);
+ default:
+ TSK_DEBUG_ERROR("Invalid type");
+ return -2;
+ }
}
int tmedia_qos_tline_set_ro(tmedia_qos_tline_t* self, const tmedia_qos_tline_t* ro)
{
- if(!self || !ro){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->type){
- case tmedia_qos_stype_e2e:
- return tmedia_qos_tline_e2e_set_ro((tmedia_qos_tline_e2e_t*)self, (const tmedia_qos_tline_e2e_t*)ro);
- case tmedia_qos_stype_segmented:
- return tmedia_qos_tline_segmented_set_ro((tmedia_qos_tline_segmented_t*)self, (const tmedia_qos_tline_segmented_t*)ro);
- default:
- TSK_DEBUG_ERROR("Invalid type");
- return -2;
- }
+ if(!self || !ro) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->type) {
+ case tmedia_qos_stype_e2e:
+ return tmedia_qos_tline_e2e_set_ro((tmedia_qos_tline_e2e_t*)self, (const tmedia_qos_tline_e2e_t*)ro);
+ case tmedia_qos_stype_segmented:
+ return tmedia_qos_tline_segmented_set_ro((tmedia_qos_tline_segmented_t*)self, (const tmedia_qos_tline_segmented_t*)ro);
+ default:
+ TSK_DEBUG_ERROR("Invalid type");
+ return -2;
+ }
}
tsk_bool_t tmedia_qos_tline_canresume(const tmedia_qos_tline_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_true;
- }
- switch(self->type){
- case tmedia_qos_stype_segmented:
- return tmedia_qos_tline_segmented_canresume((const tmedia_qos_tline_segmented_t*)self);
- case tmedia_qos_stype_e2e:
- return tmedia_qos_tline_e2e_canresume((const tmedia_qos_tline_e2e_t*)self);
- default:
- return tsk_true;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_true;
+ }
+ switch(self->type) {
+ case tmedia_qos_stype_segmented:
+ return tmedia_qos_tline_segmented_canresume((const tmedia_qos_tline_segmented_t*)self);
+ case tmedia_qos_stype_e2e:
+ return tmedia_qos_tline_e2e_canresume((const tmedia_qos_tline_e2e_t*)self);
+ default:
+ return tsk_true;
+ }
}
/* ========================= E2E ==================================*/
tmedia_qos_tline_e2e_t* tmedia_qos_tline_e2e_create(tmedia_qos_strength_t strength)
{
- return tsk_object_new(tmedia_qos_tline_e2e_def_t, strength);
+ return tsk_object_new(tmedia_qos_tline_e2e_def_t, strength);
}
tmedia_qos_tline_e2e_t* tmedia_qos_tline_e2e_from_sdp(const tsdp_header_M_t* m)
{
- tmedia_qos_tline_e2e_t* e2e = tsk_null;
- const tsdp_header_A_t* A;
- tsk_size_t i;
-
- char s0[10], s1[10];
-
- if(!m){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
-
- /* Example
- a=curr:qos e2e none
- a=des:qos mandatory e2e sendrecv
- a=conf:qos e2e recv
- */
-
- e2e = tmedia_qos_tline_e2e_create(tmedia_qos_strength_unknown);
-
- /* curr */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "curr", i)); i++){
- if(sscanf(A->value, "qos e2e %10s", s0) != EOF){
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s0);
- switch(dir){
- case tmedia_qos_direction_send:
- e2e->send.current = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- e2e->recv.current = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- e2e->send.current = tsk_true;
- e2e->recv.current = tsk_true;
- break;
- case tmedia_qos_direction_none:
- e2e->send.current = tsk_false;
- e2e->recv.current = tsk_false;
- break;
- default:
- break;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- /* des */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "des", i)); i++){
- if(sscanf(A->value, "qos %10s e2e %10s", s0, s1) != EOF){
- tmedia_qos_strength_t strength = tmedia_qos_strength_fromstring(s0);
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
- switch(dir){
- case tmedia_qos_direction_send:
- e2e->send.strength = strength;
- break;
- case tmedia_qos_direction_recv:
- e2e->recv.strength = strength;
- break;
- case tmedia_qos_direction_sendrecv:
- e2e->send.strength = strength;
- e2e->recv.strength = strength;
- break;
- default:
- break;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- /* conf */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "conf", i)); i++){
- if(sscanf(A->value, "qos e2e %10s", s0) != EOF){
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s0);
- switch(dir){
- case tmedia_qos_direction_send:
- e2e->send.confirm = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- e2e->recv.confirm = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- e2e->send.confirm = tsk_true;
- e2e->recv.confirm = tsk_true;
- break;
- default:
- break;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- return e2e;
+ tmedia_qos_tline_e2e_t* e2e = tsk_null;
+ const tsdp_header_A_t* A;
+ tsk_size_t i;
+
+ char s0[10], s1[10];
+
+ if(!m) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
+
+ /* Example
+ a=curr:qos e2e none
+ a=des:qos mandatory e2e sendrecv
+ a=conf:qos e2e recv
+ */
+
+ e2e = tmedia_qos_tline_e2e_create(tmedia_qos_strength_unknown);
+
+ /* curr */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "curr", i)); i++) {
+ if(sscanf(A->value, "qos e2e %10s", s0) != EOF) {
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s0);
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ e2e->send.current = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ e2e->recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ e2e->send.current = tsk_true;
+ e2e->recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_none:
+ e2e->send.current = tsk_false;
+ e2e->recv.current = tsk_false;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ /* des */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "des", i)); i++) {
+ if(sscanf(A->value, "qos %10s e2e %10s", s0, s1) != EOF) {
+ tmedia_qos_strength_t strength = tmedia_qos_strength_fromstring(s0);
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ e2e->send.strength = strength;
+ break;
+ case tmedia_qos_direction_recv:
+ e2e->recv.strength = strength;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ e2e->send.strength = strength;
+ e2e->recv.strength = strength;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ /* conf */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "conf", i)); i++) {
+ if(sscanf(A->value, "qos e2e %10s", s0) != EOF) {
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s0);
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ e2e->send.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ e2e->recv.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ e2e->send.confirm = tsk_true;
+ e2e->recv.confirm = tsk_true;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ return e2e;
}
int tmedia_qos_tline_e2e_to_sdp(const tmedia_qos_tline_e2e_t* self, tsdp_header_M_t* m)
{
- /* RFC 3312 - 5.1.1 SDP encoding
-
- For the end-to-end status type, the user agent MUST generate one
- current status line with the tag "e2e" for the media stream. If the
- strength-tags for both directions are equal (e.g., both "mandatory")
- in the transaction status table, the user agent MUST add one desired
- status line with the tag "sendrecv". If both tags are different, the
- user agent MUST include two desired status lines, one with the tag
- "send" and the other with the tag "recv".
- */
- char* temp = tsk_null;
-
- if(!self || !m){
- TSK_DEBUG_ERROR("invalid parameter");
- return -1;
- }
- /* Example
- a=curr:qos e2e none
- a=des:qos mandatory e2e sendrecv
- */
-
-
- /* curr */
- tsk_sprintf(&temp, "qos e2e %s", (self->recv.current && self->send.current) ? "sendrecv" : (self->recv.current ? "recv" : (self->send.current ? "send" : "none")));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("curr", temp),
- tsk_null);
- TSK_FREE(temp);
-
- /* des */
- if(self->recv.strength == self->send.strength){
- /* sendrecv */
- tsk_sprintf(&temp, "qos %s e2e sendrecv", tmedia_qos_strength_tostring(self->recv.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
- else{
- /* send */
- tsk_sprintf(&temp, "qos %s e2e send", tmedia_qos_strength_tostring(self->send.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
-
- /* recv */
- tsk_sprintf(&temp, "qos %s e2e recv", tmedia_qos_strength_tostring(self->recv.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
-
- /* conf (should not request confirm on "send" direction)*/
- if(self->recv.confirm){
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("conf", "qos e2e recv"),
- tsk_null);
- }
- return 0;
+ /* RFC 3312 - 5.1.1 SDP encoding
+
+ For the end-to-end status type, the user agent MUST generate one
+ current status line with the tag "e2e" for the media stream. If the
+ strength-tags for both directions are equal (e.g., both "mandatory")
+ in the transaction status table, the user agent MUST add one desired
+ status line with the tag "sendrecv". If both tags are different, the
+ user agent MUST include two desired status lines, one with the tag
+ "send" and the other with the tag "recv".
+ */
+ char* temp = tsk_null;
+
+ if(!self || !m) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+ /* Example
+ a=curr:qos e2e none
+ a=des:qos mandatory e2e sendrecv
+ */
+
+
+ /* curr */
+ tsk_sprintf(&temp, "qos e2e %s", (self->recv.current && self->send.current) ? "sendrecv" : (self->recv.current ? "recv" : (self->send.current ? "send" : "none")));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("curr", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+ /* des */
+ if(self->recv.strength == self->send.strength) {
+ /* sendrecv */
+ tsk_sprintf(&temp, "qos %s e2e sendrecv", tmedia_qos_strength_tostring(self->recv.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+ else {
+ /* send */
+ tsk_sprintf(&temp, "qos %s e2e send", tmedia_qos_strength_tostring(self->send.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+ /* recv */
+ tsk_sprintf(&temp, "qos %s e2e recv", tmedia_qos_strength_tostring(self->recv.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+
+ /* conf (should not request confirm on "send" direction)*/
+ if(self->recv.confirm) {
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("conf", "qos e2e recv"),
+ tsk_null);
+ }
+ return 0;
}
int tmedia_qos_tline_e2e_set_ro(tmedia_qos_tline_e2e_t* self, const tmedia_qos_tline_e2e_t* ro)
{
- if(!self || !ro){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* We were the offerer
- * Remote asked for confirmation in its "recv" direction?
- * "recv" direction for remote is our "send" direction
- * As we don't support RSVP (under the way), confirm immediatly.
- * "send" direction should not requested for confirmation
- */
- if(ro->recv.confirm){
- self->send.current = tsk_true;
- goto bail;
- }
- if(ro->send.current){
- self->recv.confirm = tsk_false; /* remote confirmed */
- self->recv.current = tsk_true; /* because ro confirmed */
- self->send.current = tsk_true; /* beacuse we don't support RSVP */
- goto bail;
- }
-
- /* We are the answerer
- * As we don't support RSVP (under the way):
- * ==> request confirmation for "recv" direction if equal to "none" (not reserved)
- * =>
- */
- if(!self->recv.current){
- self->recv.confirm = tsk_true;
- goto bail;
- }
+ if(!self || !ro) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* We were the offerer
+ * Remote asked for confirmation in its "recv" direction?
+ * "recv" direction for remote is our "send" direction
+ * As we don't support RSVP (under the way), confirm immediatly.
+ * "send" direction should not requested for confirmation
+ */
+ if(ro->recv.confirm) {
+ self->send.current = tsk_true;
+ goto bail;
+ }
+ if(ro->send.current) {
+ self->recv.confirm = tsk_false; /* remote confirmed */
+ self->recv.current = tsk_true; /* because ro confirmed */
+ self->send.current = tsk_true; /* beacuse we don't support RSVP */
+ goto bail;
+ }
+
+ /* We are the answerer
+ * As we don't support RSVP (under the way):
+ * ==> request confirmation for "recv" direction if equal to "none" (not reserved)
+ * =>
+ */
+ if(!self->recv.current) {
+ self->recv.confirm = tsk_true;
+ goto bail;
+ }
bail:
- /* all other cases: success */
- return 0;
+ /* all other cases: success */
+ return 0;
}
tsk_bool_t tmedia_qos_tline_e2e_canresume(const tmedia_qos_tline_e2e_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_true;
- }
-
- /* Example
- a=curr:qos e2e none
- a=des:qos mandatory e2e sendrecv
-
- Or
-
- a=curr:qos e2e send
- a=des:qos mandatory e2e recv
- a=des:qos optional e2e send
- */
-
- /* only "mandatory" strength should force the application to continue nego. */
- if(self->recv.strength == tmedia_qos_strength_mandatory && !self->recv.current){
- return tsk_false;
- }
- /*else */if(self->send.strength == tmedia_qos_strength_mandatory && !self->send.current){
- return tsk_false;
- }
-
- /* "optinal" and "none" strengths */
- return tsk_true;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_true;
+ }
+
+ /* Example
+ a=curr:qos e2e none
+ a=des:qos mandatory e2e sendrecv
+
+ Or
+
+ a=curr:qos e2e send
+ a=des:qos mandatory e2e recv
+ a=des:qos optional e2e send
+ */
+
+ /* only "mandatory" strength should force the application to continue nego. */
+ if(self->recv.strength == tmedia_qos_strength_mandatory && !self->recv.current) {
+ return tsk_false;
+ }
+ /*else */if(self->send.strength == tmedia_qos_strength_mandatory && !self->send.current) {
+ return tsk_false;
+ }
+
+ /* "optinal" and "none" strengths */
+ return tsk_true;
}
//
@@ -438,29 +439,28 @@ tsk_bool_t tmedia_qos_tline_e2e_canresume(const tmedia_qos_tline_e2e_t* self)
//
static tsk_object_t* tmedia_qos_tline_e2e_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_qos_tline_e2e_t *e2e = self;
- if(e2e){
- e2e->recv.strength = e2e->send.strength = va_arg(*app, tmedia_qos_strength_t);
- TMEDIA_QOS_TLINE(e2e)->type = tmedia_qos_stype_e2e;
- }
- return self;
+ tmedia_qos_tline_e2e_t *e2e = self;
+ if(e2e) {
+ e2e->recv.strength = e2e->send.strength = va_arg(*app, tmedia_qos_strength_t);
+ TMEDIA_QOS_TLINE(e2e)->type = tmedia_qos_stype_e2e;
+ }
+ return self;
}
static tsk_object_t* tmedia_qos_tline_e2e_dtor(tsk_object_t * self)
-{
- tmedia_qos_tline_e2e_t *e2e = self;
- if(e2e){
- }
+{
+ tmedia_qos_tline_e2e_t *e2e = self;
+ if(e2e) {
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tmedia_qos_tline_e2e_def_s =
-{
- sizeof(tmedia_qos_tline_e2e_t),
- tmedia_qos_tline_e2e_ctor,
- tmedia_qos_tline_e2e_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_qos_tline_e2e_def_s = {
+ sizeof(tmedia_qos_tline_e2e_t),
+ tmedia_qos_tline_e2e_ctor,
+ tmedia_qos_tline_e2e_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmedia_qos_tline_e2e_def_t = &tmedia_qos_tline_e2e_def_s;
@@ -477,356 +477,356 @@ const tsk_object_def_t *tmedia_qos_tline_e2e_def_t = &tmedia_qos_tline_e2e_def_s
tmedia_qos_tline_segmented_t* tmedia_qos_tline_segmented_create(tmedia_qos_strength_t strength)
{
- return tsk_object_new(tmedia_qos_tline_segmented_def_t, strength);
+ return tsk_object_new(tmedia_qos_tline_segmented_def_t, strength);
}
tmedia_qos_tline_segmented_t* tmedia_qos_tline_segmented_from_sdp(const tsdp_header_M_t* m)
{
- tmedia_qos_tline_segmented_t* segmented = tsk_null;
- const tsdp_header_A_t* A;
- tsk_size_t i;
-
- char s0[10], s1[10], s2[10];
-
- if(!m){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
-
- /* Example
- a=curr:qos local none
- a=curr:qos remote none
- a=des:qos optional remote send
- a=des:qos none remote recv
- a=des:qos none local sendrecv
- a=conf:qos local recv
- */
- segmented = tmedia_qos_tline_segmented_create(tmedia_qos_strength_unknown);
-
- /* curr */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "curr", i)); i++){
- if(sscanf(A->value, "qos %10s %10s", s0, s1) != EOF){
- /* For segmented, s0 should be equal to "local" or "remote" */
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
- if(tsk_strequals(s0, "local")){
- /* local */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->local_send.current = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- segmented->local_recv.current = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->local_send.current = tsk_true;
- segmented->local_recv.current = tsk_true;
- break;
- case tmedia_qos_direction_none:
- segmented->local_send.current = tsk_false;
- segmented->local_recv.current = tsk_false;
- break;
- default:
- break;
- }
- }
- else{
- /* remote */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->remote_send.current = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- segmented->remote_recv.current = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->remote_send.current = tsk_true;
- segmented->remote_recv.current = tsk_true;
- break;
- case tmedia_qos_direction_none:
- segmented->remote_send.current = tsk_false;
- segmented->remote_recv.current = tsk_false;
- break;
- default:
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- /* des */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "des", i)); i++){
- if(sscanf(A->value, "qos %10s %10s %10s", s0, s1, s2) != EOF){
- /* For segmented, s1 should be equal to "local" or "remote" */
- tmedia_qos_strength_t strength = tmedia_qos_strength_fromstring(s0);
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s2);
- if(tsk_strequals(s1, "local")){
- /* local */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->local_send.strength = strength;
- break;
- case tmedia_qos_direction_recv:
- segmented->local_recv.strength = strength;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->local_send.strength = strength;
- segmented->local_recv.strength = strength;
- break;
- default:
- break;
- }
- }
- else{
- /* remote */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->remote_send.strength = strength;
- break;
- case tmedia_qos_direction_recv:
- segmented->remote_recv.strength = strength;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->remote_send.strength = strength;
- segmented->remote_recv.strength = strength;
- break;
- default:
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- /* conf */
- for(i = 0; (A = tsdp_header_M_findA_at(m, "conf", i)); i++){
- if(sscanf(A->value, "qos %10s %10s", s0, s1) != EOF){
- /* For segmented, s0 should be equal to "local" or "remote" */
- tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
- if(tsk_strequals(s0, "local")){
- /* local */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->local_send.confirm = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- segmented->local_recv.confirm = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->local_send.confirm = tsk_true;
- segmented->local_recv.confirm = tsk_true;
- break;
- default:
- break;
- }
- }
- else{
- /* remote */
- switch(dir){
- case tmedia_qos_direction_send:
- segmented->remote_send.confirm = tsk_true;
- break;
- case tmedia_qos_direction_recv:
- segmented->remote_recv.confirm = tsk_true;
- break;
- case tmedia_qos_direction_sendrecv:
- segmented->remote_send.confirm = tsk_true;
- segmented->remote_recv.confirm = tsk_true;
- break;
- default:
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
- }
- }
-
- return segmented;
+ tmedia_qos_tline_segmented_t* segmented = tsk_null;
+ const tsdp_header_A_t* A;
+ tsk_size_t i;
+
+ char s0[10], s1[10], s2[10];
+
+ if(!m) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
+
+ /* Example
+ a=curr:qos local none
+ a=curr:qos remote none
+ a=des:qos optional remote send
+ a=des:qos none remote recv
+ a=des:qos none local sendrecv
+ a=conf:qos local recv
+ */
+ segmented = tmedia_qos_tline_segmented_create(tmedia_qos_strength_unknown);
+
+ /* curr */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "curr", i)); i++) {
+ if(sscanf(A->value, "qos %10s %10s", s0, s1) != EOF) {
+ /* For segmented, s0 should be equal to "local" or "remote" */
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
+ if(tsk_strequals(s0, "local")) {
+ /* local */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->local_send.current = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->local_recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->local_send.current = tsk_true;
+ segmented->local_recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_none:
+ segmented->local_send.current = tsk_false;
+ segmented->local_recv.current = tsk_false;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ /* remote */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->remote_send.current = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->remote_recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->remote_send.current = tsk_true;
+ segmented->remote_recv.current = tsk_true;
+ break;
+ case tmedia_qos_direction_none:
+ segmented->remote_send.current = tsk_false;
+ segmented->remote_recv.current = tsk_false;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ /* des */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "des", i)); i++) {
+ if(sscanf(A->value, "qos %10s %10s %10s", s0, s1, s2) != EOF) {
+ /* For segmented, s1 should be equal to "local" or "remote" */
+ tmedia_qos_strength_t strength = tmedia_qos_strength_fromstring(s0);
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s2);
+ if(tsk_strequals(s1, "local")) {
+ /* local */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->local_send.strength = strength;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->local_recv.strength = strength;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->local_send.strength = strength;
+ segmented->local_recv.strength = strength;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ /* remote */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->remote_send.strength = strength;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->remote_recv.strength = strength;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->remote_send.strength = strength;
+ segmented->remote_recv.strength = strength;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ /* conf */
+ for(i = 0; (A = tsdp_header_M_findA_at(m, "conf", i)); i++) {
+ if(sscanf(A->value, "qos %10s %10s", s0, s1) != EOF) {
+ /* For segmented, s0 should be equal to "local" or "remote" */
+ tmedia_qos_direction_t dir = tmedia_qos_direction_fromstring(s1);
+ if(tsk_strequals(s0, "local")) {
+ /* local */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->local_send.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->local_recv.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->local_send.confirm = tsk_true;
+ segmented->local_recv.confirm = tsk_true;
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ /* remote */
+ switch(dir) {
+ case tmedia_qos_direction_send:
+ segmented->remote_send.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_recv:
+ segmented->remote_recv.confirm = tsk_true;
+ break;
+ case tmedia_qos_direction_sendrecv:
+ segmented->remote_send.confirm = tsk_true;
+ segmented->remote_recv.confirm = tsk_true;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse a=%s:%s", A->field, A->value);
+ }
+ }
+
+ return segmented;
}
int tmedia_qos_tline_segmented_to_sdp(const tmedia_qos_tline_segmented_t* self, tsdp_header_M_t* m)
{
- /* RFC 3312 - 5.1.1 SDP encoding
-
- For the segmented status type, the user agent MUST generate two
- current status lines: one with the tag "local" and the other with the
- tag "remote". The user agent MUST add one or two desired status
- lines per segment (i.e., local and remote). If, for a particular
- segment (local or remote), the tags for both directions in the
- transaction status table are equal (e.g., both "mandatory"), the user
- agent MUST add one desired status line with the tag "sendrecv". If
- both tags are different, the user agent MUST include two desired
- status lines, one with the tag "send" and the other with the tag "recv".
- */
- char* temp = tsk_null;
-
- if(!self || !m){
- TSK_DEBUG_ERROR("invalid parameter");
- return -1;
- }
-
- /* Example
- a=curr:qos local none
- a=curr:qos remote none
- a=des:qos optional remote send
- a=des:qos none remote recv
- a=des:qos none local sendrecv
- */
-
- /* curr:local */
- tsk_sprintf(&temp, "qos local %s", (self->local_recv.current && self->local_send.current) ? "sendrecv" : (self->local_recv.current ? "recv" : (self->local_send.current ? "send" : "none")));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("curr", temp),
- tsk_null);
- TSK_FREE(temp);
-
- /* curr:remote */
- tsk_sprintf(&temp, "qos remote %s", (self->remote_recv.current && self->remote_send.current) ? "sendrecv" : (self->remote_recv.current ? "recv" : (self->remote_send.current ? "send" : "none")));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("curr", temp),
- tsk_null);
- TSK_FREE(temp);
-
-
- /* des:local */
- if(self->local_recv.strength == self->local_send.strength){
- /* sendrecv */
- tsk_sprintf(&temp, "qos %s local sendrecv", tmedia_qos_strength_tostring(self->local_send.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
- else{
- /* send */
- tsk_sprintf(&temp, "qos %s local send", tmedia_qos_strength_tostring(self->local_send.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
-
- /* recv */
- tsk_sprintf(&temp, "qos %s local recv", tmedia_qos_strength_tostring(self->local_recv.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
-
-
- /* des:remote */
- if(self->remote_recv.strength == self->remote_send.strength){
- /* sendrecv */
- tsk_sprintf(&temp, "qos %s remote sendrecv", tmedia_qos_strength_tostring(self->remote_send.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
- else{
- /* send */
- tsk_sprintf(&temp, "qos %s remote send", tmedia_qos_strength_tostring(self->remote_send.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
-
- /* recv */
- tsk_sprintf(&temp, "qos %s remote recv", tmedia_qos_strength_tostring(self->remote_recv.strength));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("des", temp),
- tsk_null);
- TSK_FREE(temp);
- }
-
- /* conf */
- if(self->remote_recv.confirm || self->remote_send.confirm){
- tsk_sprintf(&temp, "qos remote %s", (self->remote_recv.confirm && self->remote_send.confirm) ? "sendrecv" : (self->remote_recv.confirm ? "recv" : (self->remote_send.confirm ? "send" : "none")));
- tsdp_header_M_add_headers(m,
- TSDP_HEADER_A_VA_ARGS("conf", temp),
- tsk_null);
- TSK_FREE(temp);
- }
-
- return 0;
+ /* RFC 3312 - 5.1.1 SDP encoding
+
+ For the segmented status type, the user agent MUST generate two
+ current status lines: one with the tag "local" and the other with the
+ tag "remote". The user agent MUST add one or two desired status
+ lines per segment (i.e., local and remote). If, for a particular
+ segment (local or remote), the tags for both directions in the
+ transaction status table are equal (e.g., both "mandatory"), the user
+ agent MUST add one desired status line with the tag "sendrecv". If
+ both tags are different, the user agent MUST include two desired
+ status lines, one with the tag "send" and the other with the tag "recv".
+ */
+ char* temp = tsk_null;
+
+ if(!self || !m) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return -1;
+ }
+
+ /* Example
+ a=curr:qos local none
+ a=curr:qos remote none
+ a=des:qos optional remote send
+ a=des:qos none remote recv
+ a=des:qos none local sendrecv
+ */
+
+ /* curr:local */
+ tsk_sprintf(&temp, "qos local %s", (self->local_recv.current && self->local_send.current) ? "sendrecv" : (self->local_recv.current ? "recv" : (self->local_send.current ? "send" : "none")));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("curr", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+ /* curr:remote */
+ tsk_sprintf(&temp, "qos remote %s", (self->remote_recv.current && self->remote_send.current) ? "sendrecv" : (self->remote_recv.current ? "recv" : (self->remote_send.current ? "send" : "none")));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("curr", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+
+ /* des:local */
+ if(self->local_recv.strength == self->local_send.strength) {
+ /* sendrecv */
+ tsk_sprintf(&temp, "qos %s local sendrecv", tmedia_qos_strength_tostring(self->local_send.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+ else {
+ /* send */
+ tsk_sprintf(&temp, "qos %s local send", tmedia_qos_strength_tostring(self->local_send.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+ /* recv */
+ tsk_sprintf(&temp, "qos %s local recv", tmedia_qos_strength_tostring(self->local_recv.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+
+
+ /* des:remote */
+ if(self->remote_recv.strength == self->remote_send.strength) {
+ /* sendrecv */
+ tsk_sprintf(&temp, "qos %s remote sendrecv", tmedia_qos_strength_tostring(self->remote_send.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+ else {
+ /* send */
+ tsk_sprintf(&temp, "qos %s remote send", tmedia_qos_strength_tostring(self->remote_send.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+
+ /* recv */
+ tsk_sprintf(&temp, "qos %s remote recv", tmedia_qos_strength_tostring(self->remote_recv.strength));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("des", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+
+ /* conf */
+ if(self->remote_recv.confirm || self->remote_send.confirm) {
+ tsk_sprintf(&temp, "qos remote %s", (self->remote_recv.confirm && self->remote_send.confirm) ? "sendrecv" : (self->remote_recv.confirm ? "recv" : (self->remote_send.confirm ? "send" : "none")));
+ tsdp_header_M_add_headers(m,
+ TSDP_HEADER_A_VA_ARGS("conf", temp),
+ tsk_null);
+ TSK_FREE(temp);
+ }
+
+ return 0;
}
int tmedia_qos_tline_segmented_set_ro(tmedia_qos_tline_segmented_t* self, const tmedia_qos_tline_segmented_t* ro)
{
- if(!self || !ro){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- //////////////
- if(!ro->local_recv.current && !ro->remote_recv.confirm){
- /* request confirmation */
- self->remote_recv.confirm = tsk_true;
- }
- else{
- self->remote_recv.confirm = tsk_false;
- self->local_recv.current = tsk_true;
- }
- if(!ro->local_send.current && !ro->remote_send.confirm){
- /* request confirmation */
- self->remote_send.confirm = tsk_true;
- }
- else{
- self->remote_send.confirm = tsk_false;
- self->local_send.current = tsk_true;
- }
-
- //////////////
- if(ro->remote_recv.confirm){
- self->local_recv.current = tsk_true;
- }
- if(ro->remote_send.confirm){
- self->local_send.current = tsk_true;
- }
-
- //////////////
- if(ro->local_recv.current){
- self->remote_recv.current = tsk_true;
- }
- if(ro->local_send.current){
- self->remote_send.current = tsk_true;
- }
-
- return 0;
+ if(!self || !ro) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ //////////////
+ if(!ro->local_recv.current && !ro->remote_recv.confirm) {
+ /* request confirmation */
+ self->remote_recv.confirm = tsk_true;
+ }
+ else {
+ self->remote_recv.confirm = tsk_false;
+ self->local_recv.current = tsk_true;
+ }
+ if(!ro->local_send.current && !ro->remote_send.confirm) {
+ /* request confirmation */
+ self->remote_send.confirm = tsk_true;
+ }
+ else {
+ self->remote_send.confirm = tsk_false;
+ self->local_send.current = tsk_true;
+ }
+
+ //////////////
+ if(ro->remote_recv.confirm) {
+ self->local_recv.current = tsk_true;
+ }
+ if(ro->remote_send.confirm) {
+ self->local_send.current = tsk_true;
+ }
+
+ //////////////
+ if(ro->local_recv.current) {
+ self->remote_recv.current = tsk_true;
+ }
+ if(ro->local_send.current) {
+ self->remote_send.current = tsk_true;
+ }
+
+ return 0;
}
tsk_bool_t tmedia_qos_tline_segmented_canresume(const tmedia_qos_tline_segmented_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_true;
- }
-
- /* == Strength is mandatory == */
- if(self->local_recv.strength == tmedia_qos_strength_mandatory && !self->local_recv.current){
- return tsk_false;
- }
-
- if(self->local_send.strength == tmedia_qos_strength_mandatory && !self->local_send.current){
- return tsk_false;
- }
-
- if(self->remote_recv.strength == tmedia_qos_strength_mandatory && !self->remote_recv.current){
- return tsk_false;
- }
-
- if(self->remote_send.strength == tmedia_qos_strength_mandatory && !self->remote_send.current){
- return tsk_false;
- }
-
- /* "optinal" and "none" strengths */
- return tsk_true;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_true;
+ }
+
+ /* == Strength is mandatory == */
+ if(self->local_recv.strength == tmedia_qos_strength_mandatory && !self->local_recv.current) {
+ return tsk_false;
+ }
+
+ if(self->local_send.strength == tmedia_qos_strength_mandatory && !self->local_send.current) {
+ return tsk_false;
+ }
+
+ if(self->remote_recv.strength == tmedia_qos_strength_mandatory && !self->remote_recv.current) {
+ return tsk_false;
+ }
+
+ if(self->remote_send.strength == tmedia_qos_strength_mandatory && !self->remote_send.current) {
+ return tsk_false;
+ }
+
+ /* "optinal" and "none" strengths */
+ return tsk_true;
}
//
@@ -834,29 +834,28 @@ tsk_bool_t tmedia_qos_tline_segmented_canresume(const tmedia_qos_tline_segmented
//
static tsk_object_t* tmedia_qos_tline_segmented_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_qos_tline_segmented_t *segmented = self;
- if(segmented){
- segmented->local_recv.strength = segmented->local_send.strength
- = segmented->remote_recv.strength = segmented->remote_send.strength = va_arg(*app, tmedia_qos_strength_t);
- TMEDIA_QOS_TLINE(segmented)->type = tmedia_qos_stype_segmented;
- }
- return self;
+ tmedia_qos_tline_segmented_t *segmented = self;
+ if(segmented) {
+ segmented->local_recv.strength = segmented->local_send.strength
+ = segmented->remote_recv.strength = segmented->remote_send.strength = va_arg(*app, tmedia_qos_strength_t);
+ TMEDIA_QOS_TLINE(segmented)->type = tmedia_qos_stype_segmented;
+ }
+ return self;
}
static tsk_object_t* tmedia_qos_tline_segmented_dtor(tsk_object_t * self)
-{
- tmedia_qos_tline_segmented_t *segmented = self;
- if(segmented){
- }
+{
+ tmedia_qos_tline_segmented_t *segmented = self;
+ if(segmented) {
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tmedia_qos_tline_segmented_def_s =
-{
- sizeof(tmedia_qos_tline_segmented_t),
- tmedia_qos_tline_segmented_ctor,
- tmedia_qos_tline_segmented_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_qos_tline_segmented_def_s = {
+ sizeof(tmedia_qos_tline_segmented_t),
+ tmedia_qos_tline_segmented_ctor,
+ tmedia_qos_tline_segmented_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmedia_qos_tline_segmented_def_t = &tmedia_qos_tline_segmented_def_s; \ No newline at end of file
diff --git a/tinyMEDIA/src/tmedia_resampler.c b/tinyMEDIA/src/tmedia_resampler.c
index 0d547cf..d4113de 100755
--- a/tinyMEDIA/src/tmedia_resampler.c
+++ b/tinyMEDIA/src/tmedia_resampler.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,120 +33,120 @@ static const tmedia_resampler_plugin_def_t* __tmedia_resampler_plugin = tsk_null
int tmedia_resampler_init(tmedia_resampler_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return 0;
}
int tmedia_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, uint32_t bits_per_sample)
{
- int ret;
-
- if (!self || !self->plugin || !self->plugin->open) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (self->opened) {
- TSK_DEBUG_WARN("Resampler already opened");
- return 0;
- }
-
- if ((ret = self->plugin->open(self, in_freq, out_freq, frame_duration, in_channels, out_channels, quality, bits_per_sample))) {
- TSK_DEBUG_ERROR("Failed to open [%s] resamplerr", self->plugin->desc);
- return ret;
- }
- else{
- self->opened = tsk_true;
- return 0;
- }
+ int ret;
+
+ if (!self || !self->plugin || !self->plugin->open) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (self->opened) {
+ TSK_DEBUG_WARN("Resampler already opened");
+ return 0;
+ }
+
+ if ((ret = self->plugin->open(self, in_freq, out_freq, frame_duration, in_channels, out_channels, quality, bits_per_sample))) {
+ TSK_DEBUG_ERROR("Failed to open [%s] resamplerr", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_true;
+ return 0;
+ }
}
tsk_size_t tmedia_resampler_process(tmedia_resampler_t* self, const void* in_data, tsk_size_t in_size_in_sample, void* out_data, tsk_size_t out_size_in_sample)
{
- if (!self || !in_data || !in_size_in_sample || !out_size_in_sample || !self->plugin || !self->plugin->process) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- if (!self->opened) {
- TSK_DEBUG_ERROR("Resampler not opened");
- return 0;
- }
- return self->plugin->process(self, in_data, in_size_in_sample, out_data, out_size_in_sample);
+ if (!self || !in_data || !in_size_in_sample || !out_size_in_sample || !self->plugin || !self->plugin->process) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ if (!self->opened) {
+ TSK_DEBUG_ERROR("Resampler not opened");
+ return 0;
+ }
+ return self->plugin->process(self, in_data, in_size_in_sample, out_data, out_size_in_sample);
}
int tmedia_resampler_close(tmedia_resampler_t* self)
{
- if (!self || !self->plugin) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!self->opened) {
- TSK_DEBUG_WARN("Resampler not opened");
- return 0;
- }
-
- if (self->plugin->close) {
- int ret;
-
- if ((ret = self->plugin->close(self))) {
- TSK_DEBUG_ERROR("Failed to close [%s] resamplerr", self->plugin->desc);
- return ret;
- }
- else {
- self->opened = tsk_false;
- return 0;
- }
- }
- else {
- self->opened = tsk_false;
- return 0;
- }
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!self->opened) {
+ TSK_DEBUG_WARN("Resampler not opened");
+ return 0;
+ }
+
+ if (self->plugin->close) {
+ int ret;
+
+ if ((ret = self->plugin->close(self))) {
+ TSK_DEBUG_ERROR("Failed to close [%s] resamplerr", self->plugin->desc);
+ return ret;
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
+ }
+ else {
+ self->opened = tsk_false;
+ return 0;
+ }
}
int tmedia_resampler_deinit(tmedia_resampler_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if(self->opened){
- tmedia_resampler_close(self);
- }
+ if(self->opened) {
+ tmedia_resampler_close(self);
+ }
- return 0;
+ return 0;
}
int tmedia_resampler_plugin_register(const tmedia_resampler_plugin_def_t* plugin)
{
- if(!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!__tmedia_resampler_plugin) {
- TSK_DEBUG_INFO("Register resampler: %s", plugin->desc);
- __tmedia_resampler_plugin = plugin;
- }
- return 0;
+ if(!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!__tmedia_resampler_plugin) {
+ TSK_DEBUG_INFO("Register resampler: %s", plugin->desc);
+ __tmedia_resampler_plugin = plugin;
+ }
+ return 0;
}
int tmedia_resampler_plugin_unregister(const tmedia_resampler_plugin_def_t* plugin)
{
- (void)(plugin);
- __tmedia_resampler_plugin = tsk_null;
- return 0;
+ (void)(plugin);
+ __tmedia_resampler_plugin = tsk_null;
+ return 0;
}
tmedia_resampler_t* tmedia_resampler_create()
{
- tmedia_resampler_t* resampler = tsk_null;
-
- if(__tmedia_resampler_plugin){
- if((resampler = (tmedia_resampler_t*)tsk_object_new(__tmedia_resampler_plugin->objdef))){
- resampler->plugin = __tmedia_resampler_plugin;
- }
- }
- return resampler;
+ tmedia_resampler_t* resampler = tsk_null;
+
+ if(__tmedia_resampler_plugin) {
+ if((resampler = (tmedia_resampler_t*)tsk_object_new(__tmedia_resampler_plugin->objdef))) {
+ resampler->plugin = __tmedia_resampler_plugin;
+ }
+ }
+ return resampler;
}
diff --git a/tinyMEDIA/src/tmedia_session.c b/tinyMEDIA/src/tmedia_session.c
index 08348d3..72c924a 100755
--- a/tinyMEDIA/src/tmedia_session.c
+++ b/tinyMEDIA/src/tmedia_session.c
@@ -82,52 +82,56 @@ int tmedia_session_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m);
/*== Predicate function to find session object by media */
static int __pred_find_session_by_media(const tsk_list_item_t *item, const void *media)
{
- if (item && item->data){
- return tsk_stricmp(tmedia_session_get_media((const tmedia_session_t *)item->data), (const char*)media);
- }
- return -1;
+ if (item && item->data) {
+ return tsk_stricmp(tmedia_session_get_media((const tmedia_session_t *)item->data), (const char*)media);
+ }
+ return -1;
}
/*== Predicate function to find session object by type */
static int __pred_find_session_by_type(const tsk_list_item_t *item, const void *type)
{
- if (item && item->data){
- return ((const tmedia_session_t *)item->data)->type - *((tmedia_type_t*)type);
- }
- return -1;
+ if (item && item->data) {
+ return ((const tmedia_session_t *)item->data)->type - *((tmedia_type_t*)type);
+ }
+ return -1;
}
/*== Predicate function to find codec object by format */
static int __pred_find_codec_by_format(const tsk_list_item_t *item, const void *codec)
{
- if (item && item->data && codec){
- return tsk_stricmp(((const tmedia_codec_t*)item->data)->format, ((const tmedia_codec_t*)codec)->format);
- }
- return -1;
+ if (item && item->data && codec) {
+ return tsk_stricmp(((const tmedia_codec_t*)item->data)->format, ((const tmedia_codec_t*)codec)->format);
+ }
+ return -1;
}
/*== Predicate function to find codec object by id */
static int __pred_find_codec_by_id(const tsk_list_item_t *item, const void *id)
{
- if (item && item->data && id){
- if (((const tmedia_codec_t*)item->data)->id == *((const tmedia_codec_id_t*)id)){
- return 0;
- }
- }
- return -1;
+ if (item && item->data && id) {
+ if (((const tmedia_codec_t*)item->data)->id == *((const tmedia_codec_id_t*)id)) {
+ return 0;
+ }
+ }
+ return -1;
}
-static tsk_size_t __flags_sum(const tsk_bool_t *flags, tsk_size_t count) {
- tsk_size_t sum = 0, i;
- for (i = 0; i < count; ++i) {
- if (flags[i] == tsk_true) ++sum;
- }
- return sum;
+static tsk_size_t __flags_sum(const tsk_bool_t *flags, tsk_size_t count)
+{
+ tsk_size_t sum = 0, i;
+ for (i = 0; i < count; ++i) {
+ if (flags[i] == tsk_true) {
+ ++sum;
+ }
+ }
+ return sum;
}
-uint64_t tmedia_session_get_unique_id(){
- static uint64_t __UniqueId = 1; // MUST not be equal to zero
- return __UniqueId++;
+uint64_t tmedia_session_get_unique_id()
+{
+ static uint64_t __UniqueId = 1; // MUST not be equal to zero
+ return __UniqueId++;
}
/**@ingroup tmedia_session_group
@@ -138,135 +142,152 @@ uint64_t tmedia_session_get_unique_id(){
*/
int tmedia_session_init(tmedia_session_t* self, tmedia_type_t type)
{
- int ret = 0;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!self->initialized){
- /* set values */
- if (!self->id){
- self->id = tmedia_session_get_unique_id();
- }
- self->type = type;
- self->initialized = tsk_true;
- self->bl = tmedia_defaults_get_bl();
- self->codecs_allowed = tmedia_codec_id_all;
- self->bypass_encoding = tmedia_defaults_get_bypass_encoding();
- self->bypass_decoding = tmedia_defaults_get_bypass_decoding();
- /* SSL certificates */{
- const char* priv_path = tsk_null, *pub_path = tsk_null, *ca_path = tsk_null;
- tsk_bool_t verify = tsk_false;
- if ((ret = tmedia_defaults_get_ssl_certs(&priv_path, &pub_path, &ca_path, &verify))) {
- return ret;
- }
- self->dtls.file_pvk = tsk_strdup(priv_path);
- self->dtls.file_pbk = tsk_strdup(pub_path);
- self->dtls.file_ca = tsk_strdup(ca_path);
- self->dtls.verify = verify;
- }
- /* load associated codecs */
- ret = _tmedia_session_load_codecs(self);
- }
-
- return 0;
+ int ret = 0;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!self->initialized) {
+ /* set values */
+ if (!self->id) {
+ self->id = tmedia_session_get_unique_id();
+ }
+ self->type = type;
+ self->initialized = tsk_true;
+ self->bl = tmedia_defaults_get_bl();
+ self->codecs_allowed = tmedia_codec_id_all;
+ self->bypass_encoding = tmedia_defaults_get_bypass_encoding();
+ self->bypass_decoding = tmedia_defaults_get_bypass_decoding();
+ /* SSL certificates */{
+ const char* priv_path = tsk_null, *pub_path = tsk_null, *ca_path = tsk_null;
+ tsk_bool_t verify = tsk_false;
+ if ((ret = tmedia_defaults_get_ssl_certs(&priv_path, &pub_path, &ca_path, &verify))) {
+ return ret;
+ }
+ self->dtls.file_pvk = tsk_strdup(priv_path);
+ self->dtls.file_pbk = tsk_strdup(pub_path);
+ self->dtls.file_ca = tsk_strdup(ca_path);
+ self->dtls.verify = verify;
+ }
+ /* QoS metrics */
+ self->qos_metrics.q1 = 0.f;
+ self->qos_metrics.q2 = 0.f;
+ self->qos_metrics.q3 = 0.f;
+ self->qos_metrics.q4 = 0.f;
+ self->qos_metrics.qvag = 1.f;
+ self->qos_metrics.last_update_time = 0;
+ self->qos_metrics.bw_up_est_kbps = 0;
+ self->qos_metrics.bw_down_est_kbps = 0;
+ self->qos_metrics.video_out_width = 0;
+ self->qos_metrics.video_out_height = 0;
+ self->qos_metrics.video_in_width = 0;
+ self->qos_metrics.video_in_height = 0;
+ self->qos_metrics.video_in_avg_fps = 0;
+ self->qos_metrics.video_dec_avg_time = 0;
+ self->qos_metrics.video_enc_avg_time = 0;
+
+ /* load associated codecs */
+ ret = _tmedia_session_load_codecs(self);
+ }
+
+ return 0;
}
int tmedia_session_set(tmedia_session_t* self, ...)
{
- va_list ap;
- tmedia_params_L_t* params;
-
- if (!self || !self->plugin || !self->plugin->set){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
- if ((params = tmedia_params_create_2(&ap))){
- const tsk_list_item_t *item;
- const tmedia_param_t* param;
- tsk_list_foreach(item, params){
- if (!(param = item->data)){
- continue;
- }
- if ((self->type & param->media_type)){
- self->plugin->set(self, param);
- }
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
- va_end(ap);
- return 0;
+ va_list ap;
+ tmedia_params_L_t* params;
+
+ if (!self || !self->plugin || !self->plugin->set) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+ if ((params = tmedia_params_create_2(&ap))) {
+ const tsk_list_item_t *item;
+ const tmedia_param_t* param;
+ tsk_list_foreach(item, params) {
+ if (!(param = item->data)) {
+ continue;
+ }
+ if ((self->type & param->media_type)) {
+ self->plugin->set(self, param);
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ va_end(ap);
+ return 0;
}
tsk_bool_t tmedia_session_set_2(tmedia_session_t* self, const tmedia_param_t* param)
{
- if (!self || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- if (param->plugin_type == tmedia_ppt_session){
- if (param->value_type == tmedia_pvt_int32){
- if (tsk_striequals(param->key, "codecs-supported")){
- //if(self->M.lo){
- // TSK_DEBUG_WARN("Cannot change codec values at this stage");
- //}
- //else{
- int32_t codecs_allowed = *((int32_t*)param->value);
- if (self->codecs_allowed != codecs_allowed){
- self->codecs_allowed = codecs_allowed;
- return (_tmedia_session_load_codecs(self) == 0);
- }
- return 0;
- //}
- return tsk_true;
- }
- else if (tsk_striequals(param->key, "bypass-encoding")){
- self->bypass_encoding = *((int32_t*)param->value);
- return tsk_true;
- }
- else if (tsk_striequals(param->key, "bypass-decoding")){
- self->bypass_decoding = *((int32_t*)param->value);
- return tsk_true;
- }
- else if (tsk_striequals(param->key, "dtls-cert-verify")){
- self->dtls.verify = *((int32_t*)param->value) ? tsk_true : tsk_false;
- return tsk_true;
- }
- }
- else if (param->value_type == tmedia_pvt_pchar){
- if (tsk_striequals(param->key, "dtls-file-ca")){
- tsk_strupdate(&self->dtls.file_ca, param->value);
- return tsk_true;
- }
- else if (tsk_striequals(param->key, "dtls-file-pbk")){
- tsk_strupdate(&self->dtls.file_pbk, param->value);
- return tsk_true;
- }
- else if (tsk_striequals(param->key, "dtls-file-pvk")){
- tsk_strupdate(&self->dtls.file_pvk, param->value);
- return tsk_true;
- }
- }
- }
-
- return tsk_false;
+ if (!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ if (param->plugin_type == tmedia_ppt_session) {
+ if (param->value_type == tmedia_pvt_int32) {
+ if (tsk_striequals(param->key, "codecs-supported")) {
+ //if(self->M.lo){
+ // TSK_DEBUG_WARN("Cannot change codec values at this stage");
+ //}
+ //else{
+ int32_t codecs_allowed = *((int32_t*)param->value);
+ if (self->codecs_allowed != codecs_allowed) {
+ self->codecs_allowed = codecs_allowed;
+ return (_tmedia_session_load_codecs(self) == 0);
+ }
+ return 0;
+ //}
+ return tsk_true;
+ }
+ else if (tsk_striequals(param->key, "bypass-encoding")) {
+ self->bypass_encoding = *((int32_t*)param->value);
+ return tsk_true;
+ }
+ else if (tsk_striequals(param->key, "bypass-decoding")) {
+ self->bypass_decoding = *((int32_t*)param->value);
+ return tsk_true;
+ }
+ else if (tsk_striequals(param->key, "dtls-cert-verify")) {
+ self->dtls.verify = *((int32_t*)param->value) ? tsk_true : tsk_false;
+ return tsk_true;
+ }
+ }
+ else if (param->value_type == tmedia_pvt_pchar) {
+ if (tsk_striequals(param->key, "dtls-file-ca")) {
+ tsk_strupdate(&self->dtls.file_ca, param->value);
+ return tsk_true;
+ }
+ else if (tsk_striequals(param->key, "dtls-file-pbk")) {
+ tsk_strupdate(&self->dtls.file_pbk, param->value);
+ return tsk_true;
+ }
+ else if (tsk_striequals(param->key, "dtls-file-pvk")) {
+ tsk_strupdate(&self->dtls.file_pvk, param->value);
+ return tsk_true;
+ }
+ }
+ }
+
+ return tsk_false;
}
int tmedia_session_get(tmedia_session_t* self, tmedia_param_t* param)
{
- if (!self || !param) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (self->plugin && self->plugin->get) {
- return self->plugin->get(self, param);
- }
- return -2;
+ if (!self || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (self->plugin && self->plugin->get) {
+ return self->plugin->get(self, param);
+ }
+ return -2;
}
/**@ingroup tmedia_session_group
@@ -280,9 +301,9 @@ int tmedia_session_get(tmedia_session_t* self, tmedia_param_t* param)
*/
int tmedia_session_cmp(const tsk_object_t* sess1, const tsk_object_t* sess2)
{
- int ret;
- tsk_subsat_int32_ptr(sess1, sess2, &ret);
- return ret;
+ int ret;
+ tsk_subsat_int32_ptr(sess1, sess2, &ret);
+ return ret;
}
/**@ingroup tmedia_session_group
@@ -293,22 +314,22 @@ int tmedia_session_cmp(const tsk_object_t* sess1, const tsk_object_t* sess2)
*/
int tmedia_session_plugin_register(const tmedia_session_plugin_def_t* plugin)
{
- tsk_size_t i;
- if (!plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_size_t i;
+ if (!plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* add or replace the plugin */
- for (i = 0; i < TMED_SESSION_MAX_PLUGINS; i++){
- if (!__tmedia_session_plugins[i] || (__tmedia_session_plugins[i] == plugin)){
- __tmedia_session_plugins[i] = plugin;
- return 0;
- }
- }
+ /* add or replace the plugin */
+ for (i = 0; i < TMED_SESSION_MAX_PLUGINS; i++) {
+ if (!__tmedia_session_plugins[i] || (__tmedia_session_plugins[i] == plugin)) {
+ __tmedia_session_plugins[i] = plugin;
+ return 0;
+ }
+ }
- TSK_DEBUG_ERROR("There are already %d plugins.", TMED_SESSION_MAX_PLUGINS);
- return -2;
+ TSK_DEBUG_ERROR("There are already %d plugins.", TMED_SESSION_MAX_PLUGINS);
+ return -2;
}
/**@ingroup tmedia_session_group
@@ -316,20 +337,20 @@ int tmedia_session_plugin_register(const tmedia_session_plugin_def_t* plugin)
*/
const tmedia_session_plugin_def_t* tmedia_session_plugin_find_by_media(const char* media)
{
- tsk_size_t i = 0;
- if (tsk_strnullORempty(media)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ tsk_size_t i = 0;
+ if (tsk_strnullORempty(media)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- /* add or replace the plugin */
- while ((i < TMED_SESSION_MAX_PLUGINS) && (__tmedia_session_plugins[i])){
- if (tsk_striequals(__tmedia_session_plugins[i]->media, media)){
- return __tmedia_session_plugins[i];
- }
- i++;
- }
- return tsk_null;
+ /* add or replace the plugin */
+ while ((i < TMED_SESSION_MAX_PLUGINS) && (__tmedia_session_plugins[i])) {
+ if (tsk_striequals(__tmedia_session_plugins[i]->media, media)) {
+ return __tmedia_session_plugins[i];
+ }
+ i++;
+ }
+ return tsk_null;
}
/**@ingroup tmedia_session_group
@@ -339,35 +360,35 @@ const tmedia_session_plugin_def_t* tmedia_session_plugin_find_by_media(const cha
*/
int tmedia_session_plugin_unregister(const tmedia_session_plugin_def_t* plugin)
{
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
- if (!plugin){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- /* find the plugin to unregister */
- for (i = 0; i < TMED_SESSION_MAX_PLUGINS && __tmedia_session_plugins[i]; i++){
- if (__tmedia_session_plugins[i] == plugin){
- __tmedia_session_plugins[i] = tsk_null;
- found = tsk_true;
- break;
- }
- }
-
- /* compact */
- if (found){
- for (; i < (TMED_SESSION_MAX_PLUGINS - 1); i++){
- if (__tmedia_session_plugins[i + 1]){
- __tmedia_session_plugins[i] = __tmedia_session_plugins[i + 1];
- }
- else{
- break;
- }
- }
- __tmedia_session_plugins[i] = tsk_null;
- }
- return (found ? 0 : -2);
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+ if (!plugin) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ /* find the plugin to unregister */
+ for (i = 0; i < TMED_SESSION_MAX_PLUGINS && __tmedia_session_plugins[i]; i++) {
+ if (__tmedia_session_plugins[i] == plugin) {
+ __tmedia_session_plugins[i] = tsk_null;
+ found = tsk_true;
+ break;
+ }
+ }
+
+ /* compact */
+ if (found) {
+ for (; i < (TMED_SESSION_MAX_PLUGINS - 1); i++) {
+ if (__tmedia_session_plugins[i + 1]) {
+ __tmedia_session_plugins[i] = __tmedia_session_plugins[i + 1];
+ }
+ else {
+ break;
+ }
+ }
+ __tmedia_session_plugins[i] = tsk_null;
+ }
+ return (found ? 0 : -2);
}
/**@ingroup tmedia_session_group
@@ -377,252 +398,268 @@ int tmedia_session_plugin_unregister(const tmedia_session_plugin_def_t* plugin)
*/
tmedia_session_t* tmedia_session_create(tmedia_type_t type)
{
- tmedia_session_t* session = tsk_null;
- const tmedia_session_plugin_def_t* plugin;
- tsk_size_t i = 0;
+ tmedia_session_t* session = tsk_null;
+ const tmedia_session_plugin_def_t* plugin;
+ tsk_size_t i = 0;
- while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])){
- if (plugin->objdef && (plugin->type == type)){
- if ((session = tsk_object_new(plugin->objdef))){
- if (!session->initialized){
- tmedia_session_init(session, type);
- }
- session->plugin = plugin;
- }
- break;
- }
- }
- return session;
+ while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])) {
+ if (plugin->objdef && (plugin->type == type)) {
+ if ((session = tsk_object_new(plugin->objdef))) {
+ if (!session->initialized) {
+ tmedia_session_init(session, type);
+ }
+ session->plugin = plugin;
+ }
+ break;
+ }
+ }
+ return session;
}
/* internal funtion: prepare lo */
static int _tmedia_session_prepare(tmedia_session_t* self)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->prepare){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (self->prepared){
- TSK_DEBUG_WARN("Session already prepared");
- return 0;
- }
- if ((ret = self->plugin->prepare(self))){
- TSK_DEBUG_ERROR("Failed to prepare the session");
- }
- else{
- self->prepared = tsk_true;
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->prepare) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (self->prepared) {
+ TSK_DEBUG_WARN("Session already prepared");
+ return 0;
+ }
+ if ((ret = self->plugin->prepare(self))) {
+ TSK_DEBUG_ERROR("Failed to prepare the session");
+ }
+ else {
+ self->prepared = tsk_true;
+ }
+ return ret;
}
/* internal function used to set remote offer */
int _tmedia_session_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- int ret;
- if (!self || !self->plugin || !self->plugin->set_remote_offer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(ret = self->plugin->set_remote_offer(self, m))){
- self->ro_changed = tsk_true;
- self->ro_held = tsdp_header_M_is_held(m, tsk_false);
- }
- return ret;
+ int ret;
+ if (!self || !self->plugin || !self->plugin->set_remote_offer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(ret = self->plugin->set_remote_offer(self, m))) {
+ self->ro_changed = tsk_true;
+ self->ro_held = tsdp_header_M_is_held(m, tsk_false);
+ }
+ return ret;
}
/* internal function: get media */
const char* tmedia_session_get_media(const tmedia_session_t* self)
{
- if (!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if (!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- /* ghost? */
- if (self->plugin == tmedia_session_ghost_plugin_def_t){
- return ((const tmedia_session_ghost_t*)self)->media;
- }
- else{
- return self->plugin->media;
- }
+ /* ghost? */
+ if (self->plugin == tmedia_session_ghost_plugin_def_t) {
+ return ((const tmedia_session_ghost_t*)self)->media;
+ }
+ else {
+ return self->plugin->media;
+ }
}
/* internal function: get local offer */
const tsdp_header_M_t* tmedia_session_get_lo(tmedia_session_t* self)
{
- const tsdp_header_M_t* m;
+ const tsdp_header_M_t* m;
- if (!self || !self->plugin || !self->plugin->get_local_offer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if (!self || !self->plugin || !self->plugin->get_local_offer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- if ((m = self->plugin->get_local_offer(self))){
- self->ro_changed = tsk_false; /* we should have a fresh local offer (based on the latest ro) */
- }
- return m;
+ if ((m = self->plugin->get_local_offer(self))) {
+ self->ro_changed = tsk_false; /* we should have a fresh local offer (based on the latest ro) */
+ }
+ return m;
}
/* Match a codec */
tmedia_codecs_L_t* tmedia_session_match_codec(tmedia_session_t* self, const tsdp_header_M_t* M)
{
- const tmedia_codec_t *codec;
- char *rtpmap = tsk_null, *fmtp = tsk_null, *image_attr = tsk_null, *name = tsk_null;
- const tsdp_fmt_t* fmt;
- const tsk_list_item_t *it1, *it2;
- tsk_bool_t found = tsk_false;
- tmedia_codecs_L_t* matchingCodecs = tsk_null;
-
- if (!self || !M){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
-
- /* foreach format */
- tsk_list_foreach(it1, M->FMTs){
- fmt = it1->data;
-
- /* foreach codec */
- tsk_list_foreach(it2, self->codecs){
- /* 'tmedia_codec_id_none' is used for fake codecs (e.g. dtmf or msrp) and should not be filtered beacuse of backward compatibility*/
- if (!(codec = it2->data) || !codec->plugin || !(codec->id == tmedia_codec_id_none || (codec->id & self->codecs_allowed))){
- continue;
- }
-
- // Guard to avoid matching a codec more than once
- // For example, H.264 codecs without profiles (Jitsi, Tiscali PC client) to distinguish them could match more than once
- if (matchingCodecs && tsk_list_find_object_by_pred(matchingCodecs, __pred_find_codec_by_format, codec)){
- continue;
- }
-
- // Dyn. payload type
- if (codec->dyn && (rtpmap = tsdp_header_M_get_rtpmap(M, fmt->value))){
- int32_t rate, channels;
- /* parse rtpmap */
- if (tmedia_parse_rtpmap(rtpmap, &name, &rate, &channels)){
- goto next;
- }
-
- /* compare name and rate... what about channels? */
- if (tsk_striequals(name, codec->name) && (!rate || !codec->plugin->rate || (codec->plugin->rate == rate))){
- goto compare_fmtp;
- }
- }
- // Fixed payload type
- else{
- if (tsk_striequals(fmt->value, codec->format)){
- goto compare_fmtp;
- }
- }
-
- /* rtpmap do not match: free strings and try next codec */
- goto next;
-
- compare_fmtp:
- if ((fmtp = tsdp_header_M_get_fmtp(M, fmt->value))){ /* remote have fmtp? */
- if (tmedia_codec_sdp_att_match(codec, "fmtp", fmtp)){ /* fmtp matches? */
- if (codec->type & tmedia_video) goto compare_imageattr;
- else found = tsk_true;
- }
- else goto next;
- }
- else{ /* no fmtp -> always match */
- if (codec->type & tmedia_video) goto compare_imageattr;
- else found = tsk_true;
- }
-
- compare_imageattr:
- if (codec->type & tmedia_video){
- if ((image_attr = tsdp_header_M_get_imageattr(M, fmt->value))){
- if (tmedia_codec_sdp_att_match(codec, "imageattr", image_attr)) found = tsk_true;
- }
- else found = tsk_true;
- }
-
- // update neg. format
- if (found) tsk_strupdate((char**)&codec->neg_format, fmt->value);
-
- next:
- TSK_FREE(name);
- TSK_FREE(fmtp);
- TSK_FREE(rtpmap);
- TSK_FREE(image_attr);
- if (found){
- tmedia_codec_t * copy;
- if (!matchingCodecs){
- matchingCodecs = tsk_list_create();
- }
- copy = tsk_object_ref((void*)codec);
- tsk_list_push_back_data(matchingCodecs, (void**)&copy);
-
- found = tsk_false;
- break;
- }
- }
- }
-
-
- return matchingCodecs;
+ const tmedia_codec_t *codec;
+ char *rtpmap = tsk_null, *fmtp = tsk_null, *image_attr = tsk_null, *name = tsk_null;
+ const tsdp_fmt_t* fmt;
+ const tsk_list_item_t *it1, *it2;
+ tsk_bool_t found = tsk_false;
+ tmedia_codecs_L_t* matchingCodecs = tsk_null;
+
+ if (!self || !M) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+
+ /* foreach format */
+ tsk_list_foreach(it1, M->FMTs) {
+ fmt = it1->data;
+
+ /* foreach codec */
+ tsk_list_foreach(it2, self->codecs) {
+ /* 'tmedia_codec_id_none' is used for fake codecs (e.g. dtmf or msrp) and should not be filtered beacuse of backward compatibility*/
+ if (!(codec = it2->data) || !codec->plugin || !(codec->id == tmedia_codec_id_none || (codec->id & self->codecs_allowed))) {
+ continue;
+ }
+
+ // Guard to avoid matching a codec more than once
+ // For example, H.264 codecs without profiles (Jitsi, Tiscali PC client) to distinguish them could match more than once
+ if (matchingCodecs && tsk_list_find_object_by_pred(matchingCodecs, __pred_find_codec_by_format, codec)) {
+ continue;
+ }
+
+ // Dyn. payload type
+ if (codec->dyn && (rtpmap = tsdp_header_M_get_rtpmap(M, fmt->value))) {
+ int32_t rate, channels;
+ /* parse rtpmap */
+ if (tmedia_parse_rtpmap(rtpmap, &name, &rate, &channels)) {
+ goto next;
+ }
+
+ /* compare name and rate... what about channels? */
+ if (tsk_striequals(name, codec->name) && (!rate || !codec->plugin->rate || (codec->plugin->rate == rate))) {
+ goto compare_fmtp;
+ }
+ }
+ // Fixed payload type
+ else {
+ if (tsk_striequals(fmt->value, codec->format)) {
+ goto compare_fmtp;
+ }
+ }
+
+ /* rtpmap do not match: free strings and try next codec */
+ goto next;
+
+compare_fmtp:
+ if ((fmtp = tsdp_header_M_get_fmtp(M, fmt->value))) { /* remote have fmtp? */
+ if (tmedia_codec_sdp_att_match(codec, "fmtp", fmtp)) { /* fmtp matches? */
+ if (codec->type & tmedia_video) {
+ goto compare_imageattr;
+ }
+ else {
+ found = tsk_true;
+ }
+ }
+ else {
+ goto next;
+ }
+ }
+ else { /* no fmtp -> always match */
+ if (codec->type & tmedia_video) {
+ goto compare_imageattr;
+ }
+ else {
+ found = tsk_true;
+ }
+ }
+
+compare_imageattr:
+ if (codec->type & tmedia_video) {
+ if ((image_attr = tsdp_header_M_get_imageattr(M, fmt->value))) {
+ if (tmedia_codec_sdp_att_match(codec, "imageattr", image_attr)) {
+ found = tsk_true;
+ }
+ }
+ else {
+ found = tsk_true;
+ }
+ }
+
+ // update neg. format
+ if (found) {
+ tsk_strupdate((char**)&codec->neg_format, fmt->value);
+ }
+
+next:
+ TSK_FREE(name);
+ TSK_FREE(fmtp);
+ TSK_FREE(rtpmap);
+ TSK_FREE(image_attr);
+ if (found) {
+ tmedia_codec_t * copy;
+ if (!matchingCodecs) {
+ matchingCodecs = tsk_list_create();
+ }
+ copy = tsk_object_ref((void*)codec);
+ tsk_list_push_back_data(matchingCodecs, (void**)&copy);
+
+ found = tsk_false;
+ break;
+ }
+ }
+ }
+
+
+ return matchingCodecs;
}
int tmedia_session_set_onrtcp_cbfn(tmedia_session_t* self, const void* context, tmedia_session_rtcp_onevent_cb_f func)
{
- if (self && self->plugin && self->plugin->rtcp.set_onevent_cbfn){
- return self->plugin->rtcp.set_onevent_cbfn(self, context, func);
- }
- return -1;
+ if (self && self->plugin && self->plugin->rtcp.set_onevent_cbfn) {
+ return self->plugin->rtcp.set_onevent_cbfn(self, context, func);
+ }
+ return -1;
}
int tmedia_session_send_rtcp_event(tmedia_session_t* self, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media)
{
- if (self && self->plugin && self->plugin->rtcp.send_event){
- return self->plugin->rtcp.send_event(self, event_type, ssrc_media);
- }
- TSK_DEBUG_INFO("Not sending RTCP event with SSRC = %u because no callback function found", ssrc_media);
- return -1;
+ if (self && self->plugin && self->plugin->rtcp.send_event) {
+ return self->plugin->rtcp.send_event(self, event_type, ssrc_media);
+ }
+ TSK_DEBUG_INFO("Not sending RTCP event with SSRC = %u because no callback function found", ssrc_media);
+ return -1;
}
int tmedia_session_recv_rtcp_event(tmedia_session_t* self, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media)
{
- if (self && self->plugin && self->plugin->rtcp.recv_event){
- return self->plugin->rtcp.recv_event(self, event_type, ssrc_media);
- }
- TSK_DEBUG_INFO("Not receiving RTCP event with SSRC = %u because no callback function found", ssrc_media);
- return -1;
+ if (self && self->plugin && self->plugin->rtcp.recv_event) {
+ return self->plugin->rtcp.recv_event(self, event_type, ssrc_media);
+ }
+ TSK_DEBUG_INFO("Not receiving RTCP event with SSRC = %u because no callback function found", ssrc_media);
+ return -1;
}
int tmedia_session_set_onerror_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_onerror_cb_f fun)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->onerror_cb.fun = fun;
- self->onerror_cb.usrdata = usrdata;
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->onerror_cb.fun = fun;
+ self->onerror_cb.usrdata = usrdata;
+ return 0;
}
int tmedia_session_set_rfc5168_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_rfc5168_cb_f fun)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->rfc5168_cb.fun = fun;
- self->rfc5168_cb.usrdata = usrdata;
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->rfc5168_cb.fun = fun;
+ self->rfc5168_cb.usrdata = usrdata;
+ return 0;
}
int tmedia_session_set_bfcp_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_bfcp_cb_f fun)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->bfcp_cb.fun = fun;
- self->bfcp_cb.usrdata = usrdata;
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->bfcp_cb.fun = fun;
+ self->bfcp_cb.usrdata = usrdata;
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -632,28 +669,28 @@ int tmedia_session_set_bfcp_cbfn(tmedia_session_t* self, const void* usrdata, tm
*/
int tmedia_session_deinit(tmedia_session_t* self)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* free codecs */
- TSK_OBJECT_SAFE_FREE(self->codecs);
- TSK_OBJECT_SAFE_FREE(self->neg_codecs);
+ /* free codecs */
+ TSK_OBJECT_SAFE_FREE(self->codecs);
+ TSK_OBJECT_SAFE_FREE(self->neg_codecs);
- /* free lo, no and ro */
- TSK_OBJECT_SAFE_FREE(self->M.lo);
- TSK_OBJECT_SAFE_FREE(self->M.ro);
+ /* free lo, no and ro */
+ TSK_OBJECT_SAFE_FREE(self->M.lo);
+ TSK_OBJECT_SAFE_FREE(self->M.ro);
- /* QoS */
- TSK_OBJECT_SAFE_FREE(self->qos);
+ /* QoS */
+ TSK_OBJECT_SAFE_FREE(self->qos);
- /* DTLS */
- TSK_FREE(self->dtls.file_ca);
- TSK_FREE(self->dtls.file_pbk);
- TSK_FREE(self->dtls.file_pvk);
+ /* DTLS */
+ TSK_FREE(self->dtls.file_ca);
+ TSK_FREE(self->dtls.file_pbk);
+ TSK_FREE(self->dtls.file_pvk);
- return 0;
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -664,109 +701,109 @@ int tmedia_session_deinit(tmedia_session_t* self)
*/
int tmedia_session_audio_send_dtmf(tmedia_session_audio_t* self, uint8_t event)
{
- if (!self || !TMEDIA_SESSION(self)->plugin || !TMEDIA_SESSION(self)->plugin->audio.send_dtmf){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return TMEDIA_SESSION(self)->plugin->audio.send_dtmf(TMEDIA_SESSION(self), event);
+ if (!self || !TMEDIA_SESSION(self)->plugin || !TMEDIA_SESSION(self)->plugin->audio.send_dtmf) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return TMEDIA_SESSION(self)->plugin->audio.send_dtmf(TMEDIA_SESSION(self), event);
}
int tmedia_session_t140_set_ondata_cbfn(tmedia_session_t* self, const void* context, tmedia_session_t140_ondata_cb_f func)
{
- if (self && self->plugin && self->plugin->t140.set_ondata_cbfn){
- return self->plugin->t140.set_ondata_cbfn(self, context, func);
- }
- return -1;
+ if (self && self->plugin && self->plugin->t140.set_ondata_cbfn) {
+ return self->plugin->t140.set_ondata_cbfn(self, context, func);
+ }
+ return -1;
}
int tmedia_session_t140_send_data(tmedia_session_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- if (self && self->plugin && self->plugin->t140.send_data){
- return self->plugin->t140.send_data(self, data_type, data_ptr, data_size);
- }
- return -1;
+ if (self && self->plugin && self->plugin->t140.send_data) {
+ return self->plugin->t140.send_data(self, data_type, data_ptr, data_size);
+ }
+ return -1;
}
/* internal function used to prepare a session */
int _tmedia_session_load_codecs(tmedia_session_t* self)
{
- tsk_size_t i = 0;
- tmedia_codec_t* codec;
- const tmedia_codec_plugin_def_t* plugin;
- const tsk_list_item_t* item;
- tmedia_type_t type;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!self->codecs && !(self->codecs = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create new list");
- return -1;
- }
-
- tsk_list_lock(self->codecs);
-
- /* remove old codecs */
- tsk_list_clear_items(self->codecs);
-
- type = self->type;
- if ((type & tmedia_bfcp_video) == tmedia_bfcp_video) {
- type |= tmedia_video;
- }
- if ((type & tmedia_bfcp_audio) == tmedia_bfcp_audio) {
- type |= tmedia_audio;
- }
-
- /* for each registered plugin create a session instance */
- while ((i < TMED_CODEC_MAX_PLUGINS) && (plugin = __tmedia_codec_plugins[i++])){
- /* 'tmedia_codec_id_none' is used for fake codecs (e.g. dtmf, bfcp or msrp) and should not be filtered beacuse of backward compatibility*/
- if ((plugin->type & type) && (plugin->codec_id == tmedia_codec_id_none || (plugin->codec_id & self->codecs_allowed))){
- // do not load bfcp codec for "audiobfcp" and "videobfcp" session
- if ((plugin->type == tmedia_bfcp) && (type != tmedia_bfcp)) {
- continue;
- }
- if ((codec = tmedia_codec_create(plugin->format))){
- if (!self->codecs){
- self->codecs = tsk_list_create();
- }
- tsk_list_push_back_data(self->codecs, (void**)(&codec));
- }
- }
- }
-
- // filter negotiated codecs with the newly loaded codecs
- if (1){ // code valid for all use-cases but for now it's not fully tested and not needed for the clients
- filter_neg_codecs:
- tsk_list_foreach(item, self->neg_codecs){
- if (!(codec = (item->data))){
- continue;
- }
- if (!(tsk_list_find_item_by_pred(self->codecs, __pred_find_codec_by_id, &codec->id))){
- const char* codec_name = codec->plugin ? codec->plugin->name : "unknown";
- const char* neg_format = codec->neg_format ? codec->neg_format : codec->format;
- TSK_DEBUG_INFO("Codec '%s' with format '%s' was negotiated but [supported codecs] updated without it -> removing", codec_name, neg_format);
- // update sdp and remove the codec from the list
- if (self->M.lo && !TSK_LIST_IS_EMPTY(self->M.lo->FMTs)){
- if (self->M.lo->FMTs->head->next == tsk_null && tsdp_header_M_have_fmt(self->M.lo, neg_format)){ // single item?
- // rejecting a media with port equal to zero requires at least one format
- TSK_DEBUG_INFO("[supported codecs] updated but do not remove codec with name='%s' and format='%s' because it's the last one", codec_name, neg_format);
- self->M.lo->port = 0;
- }
- else{
- tsdp_header_M_remove_fmt(self->M.lo, neg_format);
- }
- }
- tsk_list_remove_item_by_data(self->neg_codecs, codec);
- goto filter_neg_codecs;
- }
- }
- }
-
- tsk_list_unlock(self->codecs);
-
- return 0;
+ tsk_size_t i = 0;
+ tmedia_codec_t* codec;
+ const tmedia_codec_plugin_def_t* plugin;
+ const tsk_list_item_t* item;
+ tmedia_type_t type;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!self->codecs && !(self->codecs = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create new list");
+ return -1;
+ }
+
+ tsk_list_lock(self->codecs);
+
+ /* remove old codecs */
+ tsk_list_clear_items(self->codecs);
+
+ type = self->type;
+ if ((type & tmedia_bfcp_video) == tmedia_bfcp_video) {
+ type |= tmedia_video;
+ }
+ if ((type & tmedia_bfcp_audio) == tmedia_bfcp_audio) {
+ type |= tmedia_audio;
+ }
+
+ /* for each registered plugin create a session instance */
+ while ((i < TMED_CODEC_MAX_PLUGINS) && (plugin = __tmedia_codec_plugins[i++])) {
+ /* 'tmedia_codec_id_none' is used for fake codecs (e.g. dtmf, bfcp or msrp) and should not be filtered beacuse of backward compatibility*/
+ if ((plugin->type & type) && (plugin->codec_id == tmedia_codec_id_none || (plugin->codec_id & self->codecs_allowed))) {
+ // do not load bfcp codec for "audiobfcp" and "videobfcp" session
+ if ((plugin->type == tmedia_bfcp) && (type != tmedia_bfcp)) {
+ continue;
+ }
+ if ((codec = tmedia_codec_create(plugin->format))) {
+ if (!self->codecs) {
+ self->codecs = tsk_list_create();
+ }
+ tsk_list_push_back_data(self->codecs, (void**)(&codec));
+ }
+ }
+ }
+
+ // filter negotiated codecs with the newly loaded codecs
+ if (1) { // code valid for all use-cases but for now it's not fully tested and not needed for the clients
+filter_neg_codecs:
+ tsk_list_foreach(item, self->neg_codecs) {
+ if (!(codec = (item->data))) {
+ continue;
+ }
+ if (!(tsk_list_find_item_by_pred(self->codecs, __pred_find_codec_by_id, &codec->id))) {
+ const char* codec_name = codec->plugin ? codec->plugin->name : "unknown";
+ const char* neg_format = codec->neg_format ? codec->neg_format : codec->format;
+ TSK_DEBUG_INFO("Codec '%s' with format '%s' was negotiated but [supported codecs] updated without it -> removing", codec_name, neg_format);
+ // update sdp and remove the codec from the list
+ if (self->M.lo && !TSK_LIST_IS_EMPTY(self->M.lo->FMTs)) {
+ if (self->M.lo->FMTs->head->next == tsk_null && tsdp_header_M_have_fmt(self->M.lo, neg_format)) { // single item?
+ // rejecting a media with port equal to zero requires at least one format
+ TSK_DEBUG_INFO("[supported codecs] updated but do not remove codec with name='%s' and format='%s' because it's the last one", codec_name, neg_format);
+ self->M.lo->port = 0;
+ }
+ else {
+ tsdp_header_M_remove_fmt(self->M.lo, neg_format);
+ }
+ }
+ tsk_list_remove_item_by_data(self->neg_codecs, codec);
+ goto filter_neg_codecs;
+ }
+ }
+ }
+
+ tsk_list_unlock(self->codecs);
+
+ return 0;
}
@@ -781,155 +818,169 @@ int _tmedia_session_load_codecs(tmedia_session_t* self)
*/
tmedia_session_mgr_t* tmedia_session_mgr_create(tmedia_type_t type, const char* addr, tsk_bool_t ipv6, tsk_bool_t offerer)
{
- tmedia_session_mgr_t* mgr;
+ tmedia_session_mgr_t* mgr;
- if (!(mgr = tsk_object_new(tmedia_session_mgr_def_t))){
- TSK_DEBUG_ERROR("Failed to create Media Session manager");
- return tsk_null;
- }
+ if (!(mgr = tsk_object_new(tmedia_session_mgr_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create Media Session manager");
+ return tsk_null;
+ }
- /* init */
- mgr->type = type;
- mgr->addr = tsk_strdup(addr);
- mgr->ipv6 = ipv6;
+ /* init */
+ mgr->type = type;
+ mgr->addr = tsk_strdup(addr);
+ mgr->ipv6 = ipv6;
- /* load sessions (will allow us to generate lo) */
- if (offerer){
- mgr->offerer = tsk_true;
- //if(_tmedia_session_mgr_load_sessions(mgr)){
- /* Do nothing */
- // TSK_DEBUG_ERROR("Failed to load sessions");
- //}
- }
+ /* load sessions (will allow us to generate lo) */
+ if (offerer) {
+ mgr->offerer = tsk_true;
+ //if(_tmedia_session_mgr_load_sessions(mgr)){
+ /* Do nothing */
+ // TSK_DEBUG_ERROR("Failed to load sessions");
+ //}
+ }
- return mgr;
+ return mgr;
}
/**@ingroup tmedia_session_group
*/
int tmedia_session_mgr_set_media_type(tmedia_session_mgr_t* self, tmedia_type_t type)
{
- static tsk_bool_t __force_set = tsk_false;
- return tmedia_session_mgr_set_media_type_2(self, type, __force_set);
+ static tsk_bool_t __force_set = tsk_false;
+ return tmedia_session_mgr_set_media_type_2(self, type, __force_set);
}
/**@ingroup tmedia_session_group
*/
int tmedia_session_mgr_set_media_type_2(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t force)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (force || self->type != type) {
- self->mediaType_changed = tsk_true;
- self->type = type;
- }
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (force || self->type != type) {
+ self->mediaType_changed = tsk_true;
+ self->type = type;
+ }
+ return 0;
}
// special set() case
int tmedia_session_mgr_set_codecs_supported(tmedia_session_mgr_t* self, tmedia_codec_id_t codecs_supported)
{
- int ret = 0;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // calling set() could create zombies (media sessions with port equal to zero)
- ret = tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_INT32(self->type, "codecs-supported", codecs_supported),
- tsk_null);
- if (ret == 0 && self->sdp.lo){
- // update type (will discard zombies)
- tmedia_type_t new_type = tmedia_type_from_sdp(self->sdp.lo);
- if (new_type != self->type){
- TSK_DEBUG_INFO("codecs-supported updated and media type changed from %d to %d", self->type, new_type);
- self->type = new_type;
- }
- }
- return ret;
+ int ret = 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // calling set() could create zombies (media sessions with port equal to zero)
+ ret = tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_INT32(self->type, "codecs-supported", codecs_supported),
+ tsk_null);
+ if (ret == 0 && self->sdp.lo) {
+ // update type (will discard zombies)
+ tmedia_type_t new_type = tmedia_type_from_sdp(self->sdp.lo);
+ if (new_type != self->type) {
+ TSK_DEBUG_INFO("codecs-supported updated and media type changed from %d to %d", self->type, new_type);
+ self->type = new_type;
+ }
+ }
+ return ret;
}
/**@ingroup tmedia_session_group
*/
tmedia_session_t* tmedia_session_mgr_find(tmedia_session_mgr_t* self, tmedia_type_t type)
{
- tmedia_session_t* session;
+ tmedia_session_t* session;
- tsk_list_lock(self->sessions);
- session = (tmedia_session_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &type);
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ session = (tmedia_session_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &type);
+ tsk_list_unlock(self->sessions);
- return tsk_object_ref(session);
+ return tsk_object_ref(session);
}
/**@ingroup tmedia_session_group
*/
int tmedia_session_mgr_set_natt_ctx(tmedia_session_mgr_t* self, struct tnet_nat_ctx_s* natt_ctx, const char* public_addr)
{
- if (!self || !natt_ctx){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(self->natt_ctx);
- self->natt_ctx = tsk_object_ref(natt_ctx);
- tsk_strupdate(&self->public_addr, public_addr);
+ if (!self || !natt_ctx) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(self->natt_ctx);
+ self->natt_ctx = tsk_object_ref(natt_ctx);
+ tsk_strupdate(&self->public_addr, public_addr);
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_POBJECT(self->type, "natt-ctx", self->natt_ctx),
- TMEDIA_SESSION_SET_NULL());
- return 0;
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_POBJECT(self->type, "natt-ctx", self->natt_ctx),
+ TMEDIA_SESSION_SET_NULL());
+ return 0;
}
// @deprecated
int tmedia_session_mgr_set_ice_ctx(tmedia_session_mgr_t* self, struct tnet_ice_ctx_s* ctx_audio, struct tnet_ice_ctx_s* ctx_video)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio); // backward compatibility
- TSK_OBJECT_SAFE_FREE(self->ice.ctx_video); // backward compatibility
- if (self->type & tmedia_audio) {
- tmedia_session_mgr_set_ice_ctx_2(self, tmedia_audio, ctx_audio);
- }
- if (self->type & tmedia_video) {
- tmedia_session_mgr_set_ice_ctx_2(self, tmedia_video, ctx_video);
- }
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio); // backward compatibility
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_video); // backward compatibility
+ if (self->type & tmedia_audio) {
+ tmedia_session_mgr_set_ice_ctx_2(self, tmedia_audio, ctx_audio);
+ }
+ if (self->type & tmedia_video) {
+ tmedia_session_mgr_set_ice_ctx_2(self, tmedia_video, ctx_video);
+ }
+ return 0;
}
int tmedia_session_mgr_set_ice_ctx_2(tmedia_session_mgr_t* self, tmedia_type_t type, struct tnet_ice_ctx_s* ctx)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((self->type & type) == type) {
- struct tnet_ice_ctx_s **_ctx = tsk_null;
- switch (type) {
- case tmedia_audio: _ctx = &self->ice.ctx_audio; break;
- case tmedia_video: _ctx = &self->ice.ctx_video; break;
- case tmedia_bfcp_video: _ctx = &self->ice.ctx_bfcpvid; break;
- default: TSK_DEBUG_ERROR("Media type(%d) not supported by this session manager", type); return -2;
- }
- TSK_OBJECT_SAFE_FREE((*_ctx));
- *_ctx = tsk_object_ref(ctx);
- return tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_POBJECT(type, "ice-ctx", ctx),
- TMEDIA_SESSION_SET_NULL());
- }
- else if (!ctx) { //cleanup
- switch (type) {
- case tmedia_audio: TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio); return 0;
- case tmedia_video: TSK_OBJECT_SAFE_FREE(self->ice.ctx_video); return 0;
- case tmedia_bfcp_video: TSK_OBJECT_SAFE_FREE(self->ice.ctx_bfcpvid); return 0;
- }
- }
- TSK_DEBUG_ERROR("Ignoring ICE context definition for media type %d", type);
- return -2;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((self->type & type) == type) {
+ struct tnet_ice_ctx_s **_ctx = tsk_null;
+ switch (type) {
+ case tmedia_audio:
+ _ctx = &self->ice.ctx_audio;
+ break;
+ case tmedia_video:
+ _ctx = &self->ice.ctx_video;
+ break;
+ case tmedia_bfcp_video:
+ _ctx = &self->ice.ctx_bfcpvid;
+ break;
+ default:
+ TSK_DEBUG_ERROR("Media type(%d) not supported by this session manager", type);
+ return -2;
+ }
+ TSK_OBJECT_SAFE_FREE((*_ctx));
+ *_ctx = tsk_object_ref(ctx);
+ return tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_POBJECT(type, "ice-ctx", ctx),
+ TMEDIA_SESSION_SET_NULL());
+ }
+ else if (!ctx) { //cleanup
+ switch (type) {
+ case tmedia_audio:
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio);
+ return 0;
+ case tmedia_video:
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_video);
+ return 0;
+ case tmedia_bfcp_video:
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_bfcpvid);
+ return 0;
+ }
+ }
+ TSK_DEBUG_ERROR("Ignoring ICE context definition for media type %d", type);
+ return -2;
}
/**@ingroup tmedia_session_group
@@ -942,7 +993,7 @@ int tmedia_session_mgr_set_ice_ctx_2(tmedia_session_mgr_t* self, tmedia_type_t t
*/
int tmedia_session_mgr_start(tmedia_session_mgr_t* self)
{
- return _tmedia_session_mgr_start(self, kSessionIndexAll);
+ return _tmedia_session_mgr_start(self, kSessionIndexAll);
}
/**@ingroup tmedia_session_group
@@ -953,19 +1004,19 @@ int tmedia_session_mgr_start(tmedia_session_mgr_t* self)
*/
int tmedia_session_mgr_set(tmedia_session_mgr_t* self, ...)
{
- va_list ap;
- int ret;
+ va_list ap;
+ int ret;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- va_start(ap, self);
- ret = tmedia_session_mgr_set_2(self, &ap);
- va_end(ap);
+ va_start(ap, self);
+ ret = tmedia_session_mgr_set_2(self, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
/**@ingroup tmedia_session_group
@@ -976,29 +1027,29 @@ int tmedia_session_mgr_set(tmedia_session_mgr_t* self, ...)
*/
int tmedia_session_mgr_set_2(tmedia_session_mgr_t* self, va_list *app)
{
- tmedia_params_L_t* params;
+ tmedia_params_L_t* params;
- if (!self || !app){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !app) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if ((params = tmedia_params_create_2(app))){
- if (!self->params){
- self->params = tsk_object_ref(params);
- }
- else{
- tsk_list_pushback_list(self->params, params);
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
+ if ((params = tmedia_params_create_2(app))) {
+ if (!self->params) {
+ self->params = tsk_object_ref(params);
+ }
+ else {
+ tsk_list_pushback_list(self->params, params);
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
- /* load params if we already have sessions */
- if (!TSK_LIST_IS_EMPTY(self->sessions)){
- _tmedia_session_mgr_apply_params(self);
- }
+ /* load params if we already have sessions */
+ if (!TSK_LIST_IS_EMPTY(self->sessions)) {
+ _tmedia_session_mgr_apply_params(self);
+ }
- return 0;
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -1009,59 +1060,59 @@ int tmedia_session_mgr_set_2(tmedia_session_mgr_t* self, va_list *app)
*/
int tmedia_session_mgr_set_3(tmedia_session_mgr_t* self, const tmedia_params_L_t* params)
{
- if (!self || !params){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !params) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!self->params){
- self->params = tsk_list_create();
- }
- tsk_list_pushback_list(self->params, params);
+ if (!self->params) {
+ self->params = tsk_list_create();
+ }
+ tsk_list_pushback_list(self->params, params);
- /* load params if we already have sessions */
- if (!TSK_LIST_IS_EMPTY(self->sessions)){
- _tmedia_session_mgr_apply_params(self);
- }
+ /* load params if we already have sessions */
+ if (!TSK_LIST_IS_EMPTY(self->sessions)) {
+ _tmedia_session_mgr_apply_params(self);
+ }
- return 0;
+ return 0;
}
int tmedia_session_mgr_get(tmedia_session_mgr_t* self, ...)
{
- va_list ap;
- int ret = 0;
- tmedia_params_L_t* params;
- const tsk_list_item_t *item1, *item2;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
-
- if ((params = tmedia_params_create_2(&ap))){
- tmedia_session_t* session;
- tmedia_param_t* param;
- tsk_list_foreach(item2, params){
- if ((param = item2->data)){
- tsk_list_foreach(item1, self->sessions){
- if (!(session = (tmedia_session_t*)item1->data) || !session->plugin){
- continue;
- }
- if ((session->type & param->media_type) == session->type && session->plugin->set){
- ret = session->plugin->get(session, param);
- }
- }
- }
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
-
- va_end(ap);
-
- return ret;
+ va_list ap;
+ int ret = 0;
+ tmedia_params_L_t* params;
+ const tsk_list_item_t *item1, *item2;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+
+ if ((params = tmedia_params_create_2(&ap))) {
+ tmedia_session_t* session;
+ tmedia_param_t* param;
+ tsk_list_foreach(item2, params) {
+ if ((param = item2->data)) {
+ tsk_list_foreach(item1, self->sessions) {
+ if (!(session = (tmedia_session_t*)item1->data) || !session->plugin) {
+ continue;
+ }
+ if ((session->type & param->media_type) == session->type && session->plugin->set) {
+ ret = session->plugin->get(session, param);
+ }
+ }
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+
+ va_end(ap);
+
+ return ret;
}
/**@ingroup tmedia_session_group
@@ -1073,7 +1124,7 @@ int tmedia_session_mgr_get(tmedia_session_mgr_t* self, ...)
*/
int tmedia_session_mgr_stop(tmedia_session_mgr_t* self)
{
- return _tmedia_session_mgr_stop(self, kSessionIndexAll);
+ return _tmedia_session_mgr_stop(self, kSessionIndexAll);
}
/**@ingroup tmedia_session_group
@@ -1081,7 +1132,7 @@ int tmedia_session_mgr_stop(tmedia_session_mgr_t* self)
*/
const tsdp_message_t* tmedia_session_mgr_get_lo(tmedia_session_mgr_t* self)
{
- return _tmedia_session_mgr_get_lo(self, kSkipSessionLoadFalse, kForceUpdateLOFalse);
+ return _tmedia_session_mgr_get_lo(self, kSkipSessionLoadFalse, kForceUpdateLOFalse);
}
@@ -1090,486 +1141,503 @@ const tsdp_message_t* tmedia_session_mgr_get_lo(tmedia_session_mgr_t* self)
*/
int tmedia_session_mgr_set_ro(tmedia_session_mgr_t* self, const tsdp_message_t* sdp, tmedia_ro_type_t ro_type)
{
- const tmedia_session_t* ms;
- const tsdp_header_M_t* M;
- const tsdp_header_C_t* C; /* global "c=" line */
- const tsdp_header_O_t* O;
- tsk_size_t index = 0;
- tsk_size_t active_sessions_count = 0, m_lines_count = 0;
- int ret = 0;
- tsk_bool_t found;
- tsk_bool_t stopped_to_reconf[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_ro_codecs_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_local_encoder_still_ok[TMEDIA_SESSION_MAX_LINES] = { tsk_false }; // decoder is dynamically mapped for each incoming rtp frame -> no need to check it
- tsk_bool_t is_ro_network_info_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_ro_hold_resume_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_ro_loopback_address[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_ice_enabled[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_ice_restart[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tsk_bool_t is_dtls_fingerprint_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ const tmedia_session_t* ms;
+ const tsdp_header_M_t* M;
+ const tsdp_header_C_t* C; /* global "c=" line */
+ const tsdp_header_O_t* O;
+ tsk_size_t index = 0;
+ tsk_size_t active_sessions_count = 0, m_lines_count = 0;
+ int ret = 0;
+ tsk_bool_t found;
+ tsk_bool_t stopped_to_reconf[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_ro_codecs_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_local_encoder_still_ok[TMEDIA_SESSION_MAX_LINES] = { tsk_false }; // decoder is dynamically mapped for each incoming rtp frame -> no need to check it
+ tsk_bool_t is_ro_network_info_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_ro_hold_resume_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_ro_loopback_address[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_ice_enabled[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_ice_restart[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
+ tsk_bool_t is_dtls_fingerprint_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
tsk_bool_t is_sdes_crypto_changed[TMEDIA_SESSION_MAX_LINES] = { tsk_false };
- tmedia_type_t media_types[TMEDIA_SESSION_MAX_LINES] = { tmedia_none };
- tsk_bool_t is_media_type_changed = tsk_false;
- tsk_bool_t is_ro_media_lines_changed = tsk_false;
- tsk_bool_t had_ro_sdp, had_lo_sdp, had_ro_provisional, is_ro_provisional_final_matching = tsk_false;
- tsk_bool_t is_new_mediatype_striped = tsk_false;
- tmedia_qos_stype_t qos_type = tmedia_qos_stype_none;
- tmedia_type_t new_mediatype = tmedia_none;
- tmedia_sessions_L_t *list_tmp_sessions;
-
- if (!self || !sdp) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(list_tmp_sessions = tsk_list_create())) {
- TSK_DEBUG_ERROR("Failed to create tmp list");
- return -2;
- }
-
- tsk_safeobj_lock(self);
- tsk_list_lock(self->sessions);
-
- new_mediatype = tmedia_type_from_sdp(sdp);
- had_ro_sdp = (self->sdp.ro != tsk_null);
- had_lo_sdp = (self->sdp.lo != tsk_null);
- had_ro_provisional = (had_ro_sdp && self->ro_provisional);
-
- // Remove BFCP offer if not locally enabled. Only the client can init BFCP session.
- if ((ro_type & tmedia_ro_type_offer)) {
- if (!(self->type & tmedia_bfcp_video)) {
- is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
- new_mediatype &= ~tmedia_bfcp_video;
- }
- if (!(self->type & tmedia_bfcp_audio)) {
- is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
- new_mediatype &= ~tmedia_bfcp_audio;
- }
- if (!(self->type & tmedia_bfcp)) {
- is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
- new_mediatype &= ~tmedia_bfcp;
- }
- }
-
- /* RFC 3264 subcaluse 8
- When issuing an offer that modifies the session, the "o=" line of the new SDP MUST be identical to that in the previous SDP,
- except that the version in the origin field MUST increment by one from the previous SDP. If the version in the origin line
- does not increment, the SDP MUST be identical to the SDP with that version number. The answerer MUST be prepared to receive
- an offer that contains SDP with a version that has not changed; this is effectively a no-op.
- */
- if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp, tsdp_htype_O))){
- tsk_bool_t is_ro_provisional;
- if (self->sdp.ro_ver == (int32_t)O->sess_version){
- TSK_DEBUG_INFO("Remote offer has not changed");
- ret = 0;
- goto bail;
- }
- // Last provisional and new final sdp messages match only if:
- // - session version diff is == 1
- // - previous sdp was provisional and new one is final
- // - the new final sdp is inside an answer
- is_ro_provisional = ((ro_type & tmedia_ro_type_provisional) == tmedia_ro_type_provisional);
- is_ro_provisional_final_matching = ((had_ro_provisional && !is_ro_provisional) && ((self->sdp.ro_ver + 1) == O->sess_version) && ((ro_type & tmedia_ro_type_answer) == tmedia_ro_type_answer));
- self->sdp.ro_ver = (int32_t)O->sess_version;
- }
- else{
- TSK_DEBUG_ERROR("o= line is missing");
- ret = -2;
- goto bail;
- }
-
- /* SDP comparison */
- if ((sdp && self->sdp.ro)){
- const tsdp_header_M_t *M0, *M1;
- const tsdp_header_C_t *C0, *C1;
- const tsdp_header_A_t *A0, *A1;
- const tsdp_header_A_t *A0_sess_fp, *A1_sess_fp; // session-level fingerprints
- tsdp_header_M_diff_t med_level_diff; // media-level diff
- index = 0;
- A0_sess_fp = tsdp_message_get_headerA(self->sdp.ro, "fingerprint");
- A1_sess_fp = tsdp_message_get_headerA(sdp, "fingerprint");
- while ((M0 = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self->sdp.ro, tsdp_htype_M, index))){
- ++m_lines_count;
- if (m_lines_count >= TMEDIA_SESSION_MAX_LINES) {
- TSK_DEBUG_ERROR("Too many m-lines %u>%u", (unsigned)m_lines_count, (unsigned)TMEDIA_SESSION_MAX_LINES);
- ret = -2;
- goto bail;
- }
- M1 = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index);
- // media-level diffs
-
- if ((ret = tsdp_header_M_diff(M0, M1, &med_level_diff)) != 0) {
- goto bail;
- }
- if (med_level_diff & tsdp_header_M_diff_hold_resume) is_ro_hold_resume_changed[index] = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_index) is_ro_media_lines_changed = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_codecs) is_ro_codecs_changed[index] = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_network_info) is_ro_network_info_changed[index] = tsk_true;
- if (tmedia_defaults_get_ice_enabled() && (med_level_diff & tsdp_header_M_diff_ice_enabled)) is_ice_enabled[index] = tsk_true;
- if (tmedia_defaults_get_ice_enabled() && (med_level_diff & tsdp_header_M_diff_ice_restart)) is_ice_restart[index] = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_dtls_fingerprint) is_dtls_fingerprint_changed[index] = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_sdes_crypto) is_sdes_crypto_changed[index] = tsk_true;
- if (med_level_diff & tsdp_header_M_diff_media_type); // cannot happen as media must keep same index
-
- // dtls fingerprint (session-level)
- if (!is_dtls_fingerprint_changed[index]) {
- A0 = tsdp_header_M_findA_at(M0, "fingerprint", 0);
- A1 = M1 ? tsdp_header_M_findA_at(M1, "fingerprint", 0) : tsk_null;
- is_dtls_fingerprint_changed[index] = (A0 && A1 && !tsk_striequals(A0->value, A1->value));
- }
- // network info (session-level)
- if (!is_ro_network_info_changed[index]) {
- C0 = (const tsdp_header_C_t*)tsdp_message_get_headerAt(self->sdp.ro, tsdp_htype_C, index);
- C1 = (const tsdp_header_C_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_C, index);
- // Connection informations must be both "null" or "not-null"
- if (!(is_ro_network_info_changed[index] = !((C0 && C1) || (!C0 && !C1)))){
- if (C0) {
- is_ro_network_info_changed[index] = (!tsk_strequals(C1->addr, C0->addr) || !tsk_strequals(C1->nettype, C0->nettype) || !tsk_strequals(C1->addrtype, C0->addrtype));
- }
- }
- }
+ tmedia_type_t media_types[TMEDIA_SESSION_MAX_LINES] = { tmedia_none };
+ tsk_bool_t is_media_type_changed = tsk_false;
+ tsk_bool_t is_ro_media_lines_changed = tsk_false;
+ tsk_bool_t had_ro_sdp, had_lo_sdp, had_ro_provisional, is_ro_provisional_final_matching = tsk_false;
+ tsk_bool_t is_new_mediatype_striped = tsk_false;
+ tmedia_qos_stype_t qos_type = tmedia_qos_stype_none;
+ tmedia_type_t new_mediatype = tmedia_none;
+ tmedia_sessions_L_t *list_tmp_sessions;
+
+ if (!self || !sdp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(list_tmp_sessions = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create tmp list");
+ return -2;
+ }
+
+ tsk_safeobj_lock(self);
+ tsk_list_lock(self->sessions);
+
+ new_mediatype = tmedia_type_from_sdp(sdp);
+ had_ro_sdp = (self->sdp.ro != tsk_null);
+ had_lo_sdp = (self->sdp.lo != tsk_null);
+ had_ro_provisional = (had_ro_sdp && self->ro_provisional);
+
+ // Remove BFCP offer if not locally enabled. Only the client can init BFCP session.
+ if ((ro_type & tmedia_ro_type_offer)) {
+ if (!(self->type & tmedia_bfcp_video)) {
+ is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
+ new_mediatype &= ~tmedia_bfcp_video;
+ }
+ if (!(self->type & tmedia_bfcp_audio)) {
+ is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
+ new_mediatype &= ~tmedia_bfcp_audio;
+ }
+ if (!(self->type & tmedia_bfcp)) {
+ is_new_mediatype_striped |= (new_mediatype & tmedia_bfcp_video);
+ new_mediatype &= ~tmedia_bfcp;
+ }
+ }
+
+ /* RFC 3264 subcaluse 8
+ When issuing an offer that modifies the session, the "o=" line of the new SDP MUST be identical to that in the previous SDP,
+ except that the version in the origin field MUST increment by one from the previous SDP. If the version in the origin line
+ does not increment, the SDP MUST be identical to the SDP with that version number. The answerer MUST be prepared to receive
+ an offer that contains SDP with a version that has not changed; this is effectively a no-op.
+ */
+ if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp, tsdp_htype_O))) {
+ tsk_bool_t is_ro_provisional;
+ if (self->sdp.ro_ver == (int32_t)O->sess_version) {
+ TSK_DEBUG_INFO("Remote offer has not changed");
+ ret = 0;
+ goto bail;
+ }
+ // Last provisional and new final sdp messages match only if:
+ // - session version diff is == 1
+ // - previous sdp was provisional and new one is final
+ // - the new final sdp is inside an answer
+ is_ro_provisional = ((ro_type & tmedia_ro_type_provisional) == tmedia_ro_type_provisional);
+ is_ro_provisional_final_matching = ((had_ro_provisional && !is_ro_provisional) && ((self->sdp.ro_ver + 1) == O->sess_version) && ((ro_type & tmedia_ro_type_answer) == tmedia_ro_type_answer));
+ self->sdp.ro_ver = (int32_t)O->sess_version;
+ }
+ else {
+ TSK_DEBUG_ERROR("o= line is missing");
+ ret = -2;
+ goto bail;
+ }
+
+ /* SDP comparison */
+ if ((sdp && self->sdp.ro)) {
+ const tsdp_header_M_t *M0, *M1;
+ const tsdp_header_C_t *C0, *C1;
+ const tsdp_header_A_t *A0, *A1;
+ const tsdp_header_A_t *A0_sess_fp, *A1_sess_fp; // session-level fingerprints
+ tsdp_header_M_diff_t med_level_diff; // media-level diff
+ index = 0;
+ A0_sess_fp = tsdp_message_get_headerA(self->sdp.ro, "fingerprint");
+ A1_sess_fp = tsdp_message_get_headerA(sdp, "fingerprint");
+ while ((M0 = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self->sdp.ro, tsdp_htype_M, index))) {
+ ++m_lines_count;
+ if (m_lines_count >= TMEDIA_SESSION_MAX_LINES) {
+ TSK_DEBUG_ERROR("Too many m-lines %u>%u", (unsigned)m_lines_count, (unsigned)TMEDIA_SESSION_MAX_LINES);
+ ret = -2;
+ goto bail;
+ }
+ M1 = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index);
+ // media-level diffs
+
+ if ((ret = tsdp_header_M_diff(M0, M1, &med_level_diff)) != 0) {
+ goto bail;
+ }
+ if (med_level_diff & tsdp_header_M_diff_hold_resume) {
+ is_ro_hold_resume_changed[index] = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_index) {
+ is_ro_media_lines_changed = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_codecs) {
+ is_ro_codecs_changed[index] = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_network_info) {
+ is_ro_network_info_changed[index] = tsk_true;
+ }
+ if (tmedia_defaults_get_ice_enabled() && (med_level_diff & tsdp_header_M_diff_ice_enabled)) {
+ is_ice_enabled[index] = tsk_true;
+ }
+ if (tmedia_defaults_get_ice_enabled() && (med_level_diff & tsdp_header_M_diff_ice_restart)) {
+ is_ice_restart[index] = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_dtls_fingerprint) {
+ is_dtls_fingerprint_changed[index] = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_sdes_crypto) {
+ is_sdes_crypto_changed[index] = tsk_true;
+ }
+ if (med_level_diff & tsdp_header_M_diff_media_type); // cannot happen as media must keep same index
+
+ // dtls fingerprint (session-level)
+ if (!is_dtls_fingerprint_changed[index]) {
+ A0 = tsdp_header_M_findA_at(M0, "fingerprint", 0);
+ A1 = M1 ? tsdp_header_M_findA_at(M1, "fingerprint", 0) : tsk_null;
+ is_dtls_fingerprint_changed[index] = (A0 && A1 && !tsk_striequals(A0->value, A1->value));
+ }
+ // network info (session-level)
+ if (!is_ro_network_info_changed[index]) {
+ C0 = (const tsdp_header_C_t*)tsdp_message_get_headerAt(self->sdp.ro, tsdp_htype_C, index);
+ C1 = (const tsdp_header_C_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_C, index);
+ // Connection informations must be both "null" or "not-null"
+ if (!(is_ro_network_info_changed[index] = !((C0 && C1) || (!C0 && !C1)))) {
+ if (C0) {
+ is_ro_network_info_changed[index] = (!tsk_strequals(C1->addr, C0->addr) || !tsk_strequals(C1->nettype, C0->nettype) || !tsk_strequals(C1->addrtype, C0->addrtype));
+ }
+ }
+ }
// TODO: sdes crypo lines (session-level)
- // media type
- media_types[index] = tmedia_type_from_sdp_headerM(M1);
-
- // ice (session-level)
- if (tmedia_defaults_get_ice_enabled()) {
- is_ice_enabled[index] |= tsdp_message_is_ice_enabled(sdp, index);
- is_ice_restart[index] |= tsdp_message_is_ice_restart(sdp, index);
- }
-
- // ro_codecs
- if (had_lo_sdp && is_ro_codecs_changed[index]) {
- // we already have a local sdp (means codecs already negotiated) and the remote is changing the codecs
- tmedia_session_t* ms = (tmedia_session_t*)tsk_object_ref(TSK_OBJECT(_tmedia_session_mgr_find_session_at_index(self->sessions, index)));
- if (ms && ms->prepared) {
- tmedia_codec_t* encoder = tsk_null;
- tmedia_param_t* param_get_codec = tmedia_param_create_get_session(media_types[index], tmedia_pvt_pobject, "codec-encoder", &encoder);
- if (param_get_codec) {
- if (tmedia_session_get(ms, param_get_codec) == 0) {
- if (encoder) {
- const char* codec_name = encoder->plugin ? encoder->plugin->name : "unknown";
- const char* neg_format = encoder->neg_format ? encoder->neg_format : encoder->format;
- if (tsdp_header_M_have_fmt(M1, neg_format) == tsk_true) { // new ro has the old encoder?
- // same rtpmap would produce same encoder -> change nothing
- char* old_rtpmap = tsdp_header_M_get_rtpmap(M0, neg_format);
- char* new_rtpmap = tsdp_header_M_get_rtpmap(M1, neg_format);
- is_local_encoder_still_ok[index] = tsk_striequals(old_rtpmap, new_rtpmap);
- TSK_FREE(old_rtpmap); TSK_FREE(new_rtpmap);
- if (is_local_encoder_still_ok[index]) {
- // TODO: add more checks
- }
- }
- TSK_OBJECT_SAFE_FREE(encoder); // destroying "param_get_codec" won't release "encoder"
- }
- }
- TSK_OBJECT_SAFE_FREE(param_get_codec);
- }
- }
- TSK_OBJECT_SAFE_FREE(ms);
- }
-
- ++index;
- }
- // the index was used against current ro which means at this step there is no longer any media at "index"
- // to be sure that new and old sdp have same number of media lines, we just check that there is no media in the new sdp at "index"
- is_ro_media_lines_changed |= (tsdp_message_get_headerAt(sdp, tsdp_htype_M, index) != tsk_null);
- }
-
- /*
- * Make sure that the provisional response is an preview of the final as explained rfc6337 section 3.1.1. We only check the most important part (IP addr and ports).
- * It's useless to check codecs or any other caps (SRTP, ICE, DTLS...) as our offer haven't changed
- * If the preview is different than the final response than this is a bug on the remote party:
- * As per rfc6337 section 3.1.1.:
- * - [RFC3261] requires all SDP in the responses to the INVITE request to be identical.
- * - After the UAS has sent the answer in a reliable provisional
- response to the INVITE, the UAS should not include any SDPs in
- subsequent responses to the INVITE.
- * If the remote party is buggy, then the newly generated local SDP will be sent in the ACK request
- */
- is_ro_provisional_final_matching &= !(is_ro_media_lines_changed || __flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count));
-
- /* This is to hack fake forking from ZTE => ignore SDP with loopback address in order to not start/stop the camera several
- * times which leads to more than ten seconds for session connection.
- * Gets the global connection line: "c="
- * Loopback address is only invalid on
- */
- if ((C = (const tsdp_header_C_t*)tsdp_message_get_header(sdp, tsdp_htype_C)) && C->addr){
- tsk_bool_t _is_ro_loopback_address = (tsk_striequals("IP4", C->addrtype) && tsk_striequals("127.0.0.1", C->addr))
- || (tsk_striequals("IP6", C->addrtype) && tsk_striequals("::1", C->addr));
- for (index = 0; index < m_lines_count; ++index) {
- is_ro_loopback_address[index] = _is_ro_loopback_address;
- }
- }
-
- /* Check if media type has changed or not
- * For initial offer we don't need to check anything
- */
- if (self->sdp.lo) {
- if ((is_media_type_changed = (new_mediatype != self->type)) || is_new_mediatype_striped) {
- tsk_bool_t force = !!is_new_mediatype_striped;
- tmedia_session_mgr_set_media_type_2(self, new_mediatype, force);
- TSK_DEBUG_INFO("media type has changed");
- }
- }
-
- TSK_DEBUG_INFO(
- "m_lines_count=%u,\n"
- "is_dtls_fingerprint_changed=%u,\n"
+ // media type
+ media_types[index] = tmedia_type_from_sdp_headerM(M1);
+
+ // ice (session-level)
+ if (tmedia_defaults_get_ice_enabled()) {
+ is_ice_enabled[index] |= tsdp_message_is_ice_enabled(sdp, index);
+ is_ice_restart[index] |= tsdp_message_is_ice_restart(sdp, index);
+ }
+
+ // ro_codecs
+ if (had_lo_sdp && is_ro_codecs_changed[index]) {
+ // we already have a local sdp (means codecs already negotiated) and the remote is changing the codecs
+ tmedia_session_t* ms = (tmedia_session_t*)tsk_object_ref(TSK_OBJECT(_tmedia_session_mgr_find_session_at_index(self->sessions, index)));
+ if (ms && ms->prepared) {
+ tmedia_codec_t* encoder = tsk_null;
+ tmedia_param_t* param_get_codec = tmedia_param_create_get_session(media_types[index], tmedia_pvt_pobject, "codec-encoder", &encoder);
+ if (param_get_codec) {
+ if (tmedia_session_get(ms, param_get_codec) == 0) {
+ if (encoder) {
+ const char* codec_name = encoder->plugin ? encoder->plugin->name : "unknown";
+ const char* neg_format = encoder->neg_format ? encoder->neg_format : encoder->format;
+ if (tsdp_header_M_have_fmt(M1, neg_format) == tsk_true) { // new ro has the old encoder?
+ // same rtpmap would produce same encoder -> change nothing
+ char* old_rtpmap = tsdp_header_M_get_rtpmap(M0, neg_format);
+ char* new_rtpmap = tsdp_header_M_get_rtpmap(M1, neg_format);
+ is_local_encoder_still_ok[index] = tsk_striequals(old_rtpmap, new_rtpmap);
+ TSK_FREE(old_rtpmap);
+ TSK_FREE(new_rtpmap);
+ if (is_local_encoder_still_ok[index]) {
+ // TODO: add more checks
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(encoder); // destroying "param_get_codec" won't release "encoder"
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(param_get_codec);
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(ms);
+ }
+
+ ++index;
+ }
+ // the index was used against current ro which means at this step there is no longer any media at "index"
+ // to be sure that new and old sdp have same number of media lines, we just check that there is no media in the new sdp at "index"
+ is_ro_media_lines_changed |= (tsdp_message_get_headerAt(sdp, tsdp_htype_M, index) != tsk_null);
+ }
+
+ /*
+ * Make sure that the provisional response is an preview of the final as explained rfc6337 section 3.1.1. We only check the most important part (IP addr and ports).
+ * It's useless to check codecs or any other caps (SRTP, ICE, DTLS...) as our offer haven't changed
+ * If the preview is different than the final response than this is a bug on the remote party:
+ * As per rfc6337 section 3.1.1.:
+ * - [RFC3261] requires all SDP in the responses to the INVITE request to be identical.
+ * - After the UAS has sent the answer in a reliable provisional
+ response to the INVITE, the UAS should not include any SDPs in
+ subsequent responses to the INVITE.
+ * If the remote party is buggy, then the newly generated local SDP will be sent in the ACK request
+ */
+ is_ro_provisional_final_matching &= !(is_ro_media_lines_changed || __flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count));
+
+ /* This is to hack fake forking from ZTE => ignore SDP with loopback address in order to not start/stop the camera several
+ * times which leads to more than ten seconds for session connection.
+ * Gets the global connection line: "c="
+ * Loopback address is only invalid on
+ */
+ if ((C = (const tsdp_header_C_t*)tsdp_message_get_header(sdp, tsdp_htype_C)) && C->addr) {
+ tsk_bool_t _is_ro_loopback_address = (tsk_striequals("IP4", C->addrtype) && tsk_striequals("127.0.0.1", C->addr))
+ || (tsk_striequals("IP6", C->addrtype) && tsk_striequals("::1", C->addr));
+ for (index = 0; index < m_lines_count; ++index) {
+ is_ro_loopback_address[index] = _is_ro_loopback_address;
+ }
+ }
+
+ /* Check if media type has changed or not
+ * For initial offer we don't need to check anything
+ */
+ if (self->sdp.lo) {
+ if ((is_media_type_changed = (new_mediatype != self->type)) || is_new_mediatype_striped) {
+ tsk_bool_t force = !!is_new_mediatype_striped;
+ tmedia_session_mgr_set_media_type_2(self, new_mediatype, force);
+ TSK_DEBUG_INFO("media type has changed");
+ }
+ }
+
+ TSK_DEBUG_INFO(
+ "m_lines_count=%u,\n"
+ "is_dtls_fingerprint_changed=%u,\n"
"is_sdes_crypto_changed=%u,\n"
- "is_ice_enabled=%u,\n"
- "is_ice_restart=%u,\n"
- "is_ro_hold_resume_changed=%u,\n"
- "is_ro_provisional_final_matching=%d,\n"
- "is_ro_media_lines_changed=%d,\n"
- "is_ro_network_info_changed=%u,\n"
- "is_ro_loopback_address=%u,\n"
- "is_media_type_changed=%d,\n"
- "is_ro_codecs_changed=%u\n"
- "is_local_encoder_still_ok=%u\n",
- (unsigned)m_lines_count,
- (unsigned)__flags_sum((const tsk_bool_t*)&is_dtls_fingerprint_changed, m_lines_count),
+ "is_ice_enabled=%u,\n"
+ "is_ice_restart=%u,\n"
+ "is_ro_hold_resume_changed=%u,\n"
+ "is_ro_provisional_final_matching=%d,\n"
+ "is_ro_media_lines_changed=%d,\n"
+ "is_ro_network_info_changed=%u,\n"
+ "is_ro_loopback_address=%u,\n"
+ "is_media_type_changed=%d,\n"
+ "is_ro_codecs_changed=%u\n"
+ "is_local_encoder_still_ok=%u\n",
+ (unsigned)m_lines_count,
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_dtls_fingerprint_changed, m_lines_count),
(unsigned)__flags_sum((const tsk_bool_t*)&is_sdes_crypto_changed, m_lines_count),
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ice_enabled, m_lines_count),
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ice_restart, m_lines_count),
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count),
- is_ro_provisional_final_matching,
- is_ro_media_lines_changed,
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count),
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_loopback_address, m_lines_count),
- is_media_type_changed,
- (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_codecs_changed, m_lines_count),
- (unsigned)__flags_sum((const tsk_bool_t*)&is_local_encoder_still_ok, m_lines_count)
- );
-
- /*
- * It's almost impossible to update the codecs, the connection information etc etc while the sessions are running
- * For example, if the video producer is already started then, you probably cannot update its configuration
- * without stoping it and restarting it again with the right config. Same for RTP Network config (ip addresses, NAT, ports, IP version, ...)
- *
- * "is_loopback_address" is used as a guard to avoid reconf for loopback address used for example by ZTE for fake forking. In all case
- * loopback address won't work on embedded devices such as iOS and Android.
- *
- */
- if (self->started) {
- for (index = 0; index < m_lines_count; ++index) {
- if (/* && (!is_ro_loopback_address[index]) && */ ((is_ro_codecs_changed[index] && !is_local_encoder_still_ok[index]) || is_ro_network_info_changed[index] || is_dtls_fingerprint_changed[index] || is_sdes_crypto_changed[index])) {
- TSK_DEBUG_INFO("Stop media index %d to reconf", (int)index);
- stopped_to_reconf[index] = tsk_true;
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_INT32(media_types[index], "stop-to-reconf", stopped_to_reconf[index]),
- TMEDIA_SESSION_SET_NULL());
- if ((ret = _tmedia_session_mgr_stop(self, (int)index))){
- TSK_DEBUG_ERROR("Failed to stop session manager");
- goto bail;
- }
- }
- }
- }
-
- /* update remote offer */
- TSK_OBJECT_SAFE_FREE(self->sdp.ro);
- self->sdp.ro = tsk_object_ref((void*)sdp);
-
- /* - if the session is running this means no session update is required unless some important changes
- - this check must be done after the "ro" update
- - "is_ro_hold_resume_changed" do not restart the session but updates the SDP
- */
- if (self->started && !(__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count) || __flags_sum((const tsk_bool_t*)&stopped_to_reconf, m_lines_count) || is_ro_media_lines_changed)) {
- goto end_of_sessions_update;
- }
-
- /* prepare the session manager if not already done (create all sessions with their codecs)
- * if network-initiated: think about tmedia_type_from_sdp() before creating the manager */
- if (_tmedia_session_mgr_load_sessions(self)){
- TSK_DEBUG_ERROR("Failed to prepare the session manager");
- ret = -3;
- goto bail;
- }
- // update media line counts
- index = m_lines_count; // save old "m_lines_count" before loading sessions
- m_lines_count = tsk_list_count_all(self->sessions); // "m_lines_count" after loading sessions
- TSK_DEBUG_INFO("new m_lines_count = %u -> %u", (unsigned)index, (unsigned)m_lines_count);
- if (index != m_lines_count) { // start new sessions
- for (; index < m_lines_count; ++index) { // for(session in new_sessions)
- stopped_to_reconf[index] = self->started; // start new session if mgr started
- if (tmedia_defaults_get_ice_enabled()) {
- is_ice_enabled[index] |= tsdp_message_is_ice_enabled(sdp, index);
- is_ice_restart[index] |= tsdp_message_is_ice_restart(sdp, index);
- }
- }
- }
-
- /* get global connection line (common to all sessions)
- * Each session should override this info if it has a different one in its "m=" line
- * /!\ "remote-ip" is deprecated by "remote-sdp-message" and pending before complete remove
- */
- if (C && C->addr){
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_STR(self->type, "remote-ip", C->addr),
- TMEDIA_SESSION_SET_NULL());
- }
-
- /* pass complete remote sdp to the sessions to allow them to use session-level attributes
- */
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_POBJECT(self->type, "remote-sdp-message", self->sdp.ro),
- TMEDIA_SESSION_SET_NULL());
-
- /* foreach "m=" line in the remote offer create/prepare a session (requires the session to be stopped)*/
- index = 0;
- tsk_list_pushback_list(list_tmp_sessions, self->sessions);
- tsk_list_clear_items(self->sessions);
- while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index++))) {
- found = tsk_false;
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ice_enabled, m_lines_count),
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ice_restart, m_lines_count),
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count),
+ is_ro_provisional_final_matching,
+ is_ro_media_lines_changed,
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count),
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_loopback_address, m_lines_count),
+ is_media_type_changed,
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_ro_codecs_changed, m_lines_count),
+ (unsigned)__flags_sum((const tsk_bool_t*)&is_local_encoder_still_ok, m_lines_count)
+ );
+
+ /*
+ * It's almost impossible to update the codecs, the connection information etc etc while the sessions are running
+ * For example, if the video producer is already started then, you probably cannot update its configuration
+ * without stoping it and restarting it again with the right config. Same for RTP Network config (ip addresses, NAT, ports, IP version, ...)
+ *
+ * "is_loopback_address" is used as a guard to avoid reconf for loopback address used for example by ZTE for fake forking. In all case
+ * loopback address won't work on embedded devices such as iOS and Android.
+ *
+ */
+ if (self->started) {
+ for (index = 0; index < m_lines_count; ++index) {
+ if (/* && (!is_ro_loopback_address[index]) && */ ((is_ro_codecs_changed[index] && !is_local_encoder_still_ok[index]) || is_ro_network_info_changed[index] || is_dtls_fingerprint_changed[index] || is_sdes_crypto_changed[index])) {
+ TSK_DEBUG_INFO("Stop media index %d to reconf", (int)index);
+ stopped_to_reconf[index] = tsk_true;
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_INT32(media_types[index], "stop-to-reconf", stopped_to_reconf[index]),
+ TMEDIA_SESSION_SET_NULL());
+ if ((ret = _tmedia_session_mgr_stop(self, (int)index))) {
+ TSK_DEBUG_ERROR("Failed to stop session manager");
+ goto bail;
+ }
+ }
+ }
+ }
+
+ /* update remote offer */
+ TSK_OBJECT_SAFE_FREE(self->sdp.ro);
+ self->sdp.ro = tsk_object_ref((void*)sdp);
+
+ /* - if the session is running this means no session update is required unless some important changes
+ - this check must be done after the "ro" update
+ - "is_ro_hold_resume_changed" do not restart the session but updates the SDP
+ */
+ if (self->started && !(__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count) || __flags_sum((const tsk_bool_t*)&stopped_to_reconf, m_lines_count) || is_ro_media_lines_changed)) {
+ goto end_of_sessions_update;
+ }
+
+ /* prepare the session manager if not already done (create all sessions with their codecs)
+ * if network-initiated: think about tmedia_type_from_sdp() before creating the manager */
+ if (_tmedia_session_mgr_load_sessions(self)) {
+ TSK_DEBUG_ERROR("Failed to prepare the session manager");
+ ret = -3;
+ goto bail;
+ }
+ // update media line counts
+ index = m_lines_count; // save old "m_lines_count" before loading sessions
+ m_lines_count = tsk_list_count_all(self->sessions); // "m_lines_count" after loading sessions
+ TSK_DEBUG_INFO("new m_lines_count = %u -> %u", (unsigned)index, (unsigned)m_lines_count);
+ if (index != m_lines_count) { // start new sessions
+ for (; index < m_lines_count; ++index) { // for(session in new_sessions)
+ stopped_to_reconf[index] = self->started; // start new session if mgr started
+ if (tmedia_defaults_get_ice_enabled()) {
+ is_ice_enabled[index] |= tsdp_message_is_ice_enabled(sdp, index);
+ is_ice_restart[index] |= tsdp_message_is_ice_restart(sdp, index);
+ }
+ }
+ }
+
+ /* get global connection line (common to all sessions)
+ * Each session should override this info if it has a different one in its "m=" line
+ * /!\ "remote-ip" is deprecated by "remote-sdp-message" and pending before complete remove
+ */
+ if (C && C->addr) {
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_STR(self->type, "remote-ip", C->addr),
+ TMEDIA_SESSION_SET_NULL());
+ }
+
+ /* pass complete remote sdp to the sessions to allow them to use session-level attributes
+ */
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_POBJECT(self->type, "remote-sdp-message", self->sdp.ro),
+ TMEDIA_SESSION_SET_NULL());
+
+ /* foreach "m=" line in the remote offer create/prepare a session (requires the session to be stopped)*/
+ index = 0;
+ tsk_list_pushback_list(list_tmp_sessions, self->sessions);
+ tsk_list_clear_items(self->sessions);
+ while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp, tsdp_htype_M, index++))) {
+ found = tsk_false;
#if 1
- // rfc3264 - 8 Modifying the Session
- // if the previous SDP had N "m=" lines, the new SDP MUST have at least N "m=" lines
- // Deleted media streams from a previous SDP MUST NOT be removed in a new SDP
- if (had_lo_sdp) {
- ms = _tmedia_session_mgr_find_session_at_index(list_tmp_sessions, (index - 1 - active_sessions_count));
- }
- else {
- // Initial Offer
- tmedia_type_t M_media_type = tmedia_type_from_sdp_headerM(M);
- ms = tsk_list_find_object_by_pred(list_tmp_sessions, __pred_find_session_by_type, &M_media_type);
- }
+ // rfc3264 - 8 Modifying the Session
+ // if the previous SDP had N "m=" lines, the new SDP MUST have at least N "m=" lines
+ // Deleted media streams from a previous SDP MUST NOT be removed in a new SDP
+ if (had_lo_sdp) {
+ ms = _tmedia_session_mgr_find_session_at_index(list_tmp_sessions, (index - 1 - active_sessions_count));
+ }
+ else {
+ // Initial Offer
+ tmedia_type_t M_media_type = tmedia_type_from_sdp_headerM(M);
+ ms = tsk_list_find_object_by_pred(list_tmp_sessions, __pred_find_session_by_type, &M_media_type);
+ }
#else
- if (ro_type & tmedia_ro_type_answer) {
- // Answer -> match by index
- ms = _tmedia_session_mgr_find_session_at_index(list_tmp_sessions, (index - 1 - active_sessions_count));
- }
- else {
- // Request -> match by type
- tmedia_type_t M_media_type = tmedia_type_from_sdp_headerM(M);
- ms = tsk_list_find_object_by_pred(list_tmp_sessions, __pred_find_session_by_type, &M_media_type);
- }
+ if (ro_type & tmedia_ro_type_answer) {
+ // Answer -> match by index
+ ms = _tmedia_session_mgr_find_session_at_index(list_tmp_sessions, (index - 1 - active_sessions_count));
+ }
+ else {
+ // Request -> match by type
+ tmedia_type_t M_media_type = tmedia_type_from_sdp_headerM(M);
+ ms = tsk_list_find_object_by_pred(list_tmp_sessions, __pred_find_session_by_type, &M_media_type);
+ }
#endif
- if (ms && (tsk_striequals(tmedia_session_get_media(ms), M->media))) {
- /* prepare the media session */
- if (!ms->prepared && M->port && (_tmedia_session_prepare(TMEDIA_SESSION(ms)))){
- TSK_DEBUG_ERROR("Failed to prepare session"); /* should never happen */
- goto bail;
- }
- /* set remote ro at session-level unless media is disabled (port=0) */
- if (M->port == 0 || (ret = _tmedia_session_set_ro(TMEDIA_SESSION(ms), M)) == 0) {
- tmedia_session_t* _ms = tsk_object_ref(TSK_OBJECT(ms));
- found = tsk_true;
- ++active_sessions_count;
- tsk_list_push_back_data(self->sessions, (void**)&_ms); // add at the same index
- tsk_list_remove_item_by_data(list_tmp_sessions, ms); // make sure not to use the session more than once
- }
- else {
- TSK_DEBUG_WARN("_tmedia_session_set_ro() failed");
- ret = 0; // add ghost for this session. Do not goto bail because set_ro() is allowed to fail (e.g. codec mismatch).
- }
- /* set QoS type (only if we are not the offerer) */
- if (/*!self->offerer ==> we suppose that the remote party respected our demand &&*/ qos_type == tmedia_qos_stype_none) {
- tmedia_qos_tline_t* tline = tmedia_qos_tline_from_sdp(M);
- if (tline) {
- qos_type = tline->type;
- TSK_OBJECT_SAFE_FREE(tline);
- }
- }
- }
-
- if (!found /*&& (self->sdp.lo == tsk_null)*/){
- /* Session not supported and we are not the initial offerer ==> add ghost session */
- /*
- An offered stream MAY be rejected in the answer, for any reason. If
- a stream is rejected, the offerer and answerer MUST NOT generate
- media (or RTCP packets) for that stream. To reject an offered
- stream, the port number in the corresponding stream in the answer
- MUST be set to zero. Any media formats listed are ignored. AT LEAST
- ONE MUST BE PRESENT, AS SPECIFIED BY SDP.
- */
- tmedia_session_ghost_t* ghost;
- if ((ghost = (tmedia_session_ghost_t*)tmedia_session_create(tmedia_ghost))){
- tsk_strupdate(&ghost->media, M->media); /* copy media */
- tsk_strupdate(&ghost->proto, M->proto); /* copy proto */
- if (!TSK_LIST_IS_EMPTY(M->FMTs)){
- tsk_strupdate(&ghost->first_format, ((const tsdp_fmt_t*)TSK_LIST_FIRST_DATA(M->FMTs))->value); /* copy format */
- }
- tsk_list_push_back_data(self->sessions, (void**)&ghost);
- }
- else {
- TSK_DEBUG_ERROR("Failed to create ghost session");
- continue;
- }
- }
- }
+ if (ms && (tsk_striequals(tmedia_session_get_media(ms), M->media))) {
+ /* prepare the media session */
+ if (!ms->prepared && M->port && (_tmedia_session_prepare(TMEDIA_SESSION(ms)))) {
+ TSK_DEBUG_ERROR("Failed to prepare session"); /* should never happen */
+ goto bail;
+ }
+ /* set remote ro at session-level unless media is disabled (port=0) */
+ if (M->port == 0 || (ret = _tmedia_session_set_ro(TMEDIA_SESSION(ms), M)) == 0) {
+ tmedia_session_t* _ms = tsk_object_ref(TSK_OBJECT(ms));
+ found = tsk_true;
+ ++active_sessions_count;
+ tsk_list_push_back_data(self->sessions, (void**)&_ms); // add at the same index
+ tsk_list_remove_item_by_data(list_tmp_sessions, ms); // make sure not to use the session more than once
+ }
+ else {
+ TSK_DEBUG_WARN("_tmedia_session_set_ro() failed");
+ ret = 0; // add ghost for this session. Do not goto bail because set_ro() is allowed to fail (e.g. codec mismatch).
+ }
+ /* set QoS type (only if we are not the offerer) */
+ if (/*!self->offerer ==> we suppose that the remote party respected our demand &&*/ qos_type == tmedia_qos_stype_none) {
+ tmedia_qos_tline_t* tline = tmedia_qos_tline_from_sdp(M);
+ if (tline) {
+ qos_type = tline->type;
+ TSK_OBJECT_SAFE_FREE(tline);
+ }
+ }
+ }
+
+ if (!found /*&& (self->sdp.lo == tsk_null)*/) {
+ /* Session not supported and we are not the initial offerer ==> add ghost session */
+ /*
+ An offered stream MAY be rejected in the answer, for any reason. If
+ a stream is rejected, the offerer and answerer MUST NOT generate
+ media (or RTCP packets) for that stream. To reject an offered
+ stream, the port number in the corresponding stream in the answer
+ MUST be set to zero. Any media formats listed are ignored. AT LEAST
+ ONE MUST BE PRESENT, AS SPECIFIED BY SDP.
+ */
+ tmedia_session_ghost_t* ghost;
+ if ((ghost = (tmedia_session_ghost_t*)tmedia_session_create(tmedia_ghost))) {
+ tsk_strupdate(&ghost->media, M->media); /* copy media */
+ tsk_strupdate(&ghost->proto, M->proto); /* copy proto */
+ if (!TSK_LIST_IS_EMPTY(M->FMTs)) {
+ tsk_strupdate(&ghost->first_format, ((const tsdp_fmt_t*)TSK_LIST_FIRST_DATA(M->FMTs))->value); /* copy format */
+ }
+ tsk_list_push_back_data(self->sessions, (void**)&ghost);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create ghost session");
+ continue;
+ }
+ }
+ }
end_of_sessions_update:
- /* update QoS type */
- if (!self->offerer && (qos_type != tmedia_qos_stype_none)){
- self->qos.type = qos_type;
- }
-
- /* signal that ro has changed (will be used to update lo) unless there was no ro_sdp */
- self->ro_changed = (had_ro_sdp && (__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count) || __flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count) || is_ro_media_lines_changed || __flags_sum((const tsk_bool_t*)&is_ro_codecs_changed, m_lines_count) /*|| is_media_type_changed || is_new_mediatype_striped*/));
-
- /* update "provisional" info */
- self->ro_provisional = ((ro_type & tmedia_ro_type_provisional) == tmedia_ro_type_provisional);
-
- if (self->ro_changed) {
- /* update local offer before restarting the session manager otherwise neg_codecs won't match if new codecs
- have been added or removed. No need to load sessions again. */
- (_tmedia_session_mgr_get_lo(self, kSkipSessionLoadTrue, kForceUpdateLOFalse));
- }
- /* manager was started and we stopped it in order to reconfigure it (codecs, network, ....)
- * When ICE is active ("is_ice_active" = yes), the media session will be explicitly restarted when conncheck succeed or fail.
- */
- for (index = 0; index < m_lines_count; ++index) {
- if (stopped_to_reconf[index] && !is_ice_enabled[index]) {
- if ((ret = _tmedia_session_mgr_start(self, (int)index))) {
- TSK_DEBUG_ERROR("Failed to re-start session at index = %d", (int)index);
- goto bail;
- }
- }
- }
-
- // will send [488 Not Acceptable] / [BYE] if no active session
- ret = (self->ro_changed && active_sessions_count <= 0) ? -0xFF : 0;
+ /* update QoS type */
+ if (!self->offerer && (qos_type != tmedia_qos_stype_none)) {
+ self->qos.type = qos_type;
+ }
+
+ /* signal that ro has changed (will be used to update lo) unless there was no ro_sdp */
+ self->ro_changed = (had_ro_sdp && (__flags_sum((const tsk_bool_t*)&is_ro_hold_resume_changed, m_lines_count) || __flags_sum((const tsk_bool_t*)&is_ro_network_info_changed, m_lines_count) || is_ro_media_lines_changed || __flags_sum((const tsk_bool_t*)&is_ro_codecs_changed, m_lines_count) /*|| is_media_type_changed || is_new_mediatype_striped*/));
+
+ /* update "provisional" info */
+ self->ro_provisional = ((ro_type & tmedia_ro_type_provisional) == tmedia_ro_type_provisional);
+
+ if (self->ro_changed) {
+ /* update local offer before restarting the session manager otherwise neg_codecs won't match if new codecs
+ have been added or removed. No need to load sessions again. */
+ (_tmedia_session_mgr_get_lo(self, kSkipSessionLoadTrue, kForceUpdateLOFalse));
+ }
+ /* manager was started and we stopped it in order to reconfigure it (codecs, network, ....)
+ * When ICE is active ("is_ice_active" = yes), the media session will be explicitly restarted when conncheck succeed or fail.
+ */
+ for (index = 0; index < m_lines_count; ++index) {
+ if (stopped_to_reconf[index] && !is_ice_enabled[index]) {
+ if ((ret = _tmedia_session_mgr_start(self, (int)index))) {
+ TSK_DEBUG_ERROR("Failed to re-start session at index = %d", (int)index);
+ goto bail;
+ }
+ }
+ }
+
+ // will send [488 Not Acceptable] / [BYE] if no active session
+ ret = (self->ro_changed && active_sessions_count <= 0) ? -0xFF : 0;
bail:
- TSK_OBJECT_SAFE_FREE(list_tmp_sessions);
+ TSK_OBJECT_SAFE_FREE(list_tmp_sessions);
- tsk_safeobj_unlock(self);
- tsk_list_unlock(self->sessions);
- return ret;
+ tsk_safeobj_unlock(self);
+ tsk_list_unlock(self->sessions);
+ return ret;
}
const tsdp_message_t* tmedia_session_mgr_get_ro(tmedia_session_mgr_t* self)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- return self->sdp.ro;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ return self->sdp.ro;
}
tsk_bool_t tmedia_session_mgr_is_new_ro(tmedia_session_mgr_t* self, const tsdp_message_t* sdp)
{
- tsk_bool_t is_new = tsk_true;
- const tsdp_header_O_t* O;
+ tsk_bool_t is_new = tsk_true;
+ const tsdp_header_O_t* O;
- if (!self || !sdp){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !sdp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
- if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp, tsdp_htype_O))) {
- is_new = (self->sdp.ro_ver != (int32_t)O->sess_version);
- }
- else {
- TSK_DEBUG_ERROR("o= line is missing");
- }
+ if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp, tsdp_htype_O))) {
+ is_new = (self->sdp.ro_ver != (int32_t)O->sess_version);
+ }
+ else {
+ TSK_DEBUG_ERROR("o= line is missing");
+ }
- tsk_safeobj_unlock(self);
- return is_new;
+ tsk_safeobj_unlock(self);
+ return is_new;
}
/**@ingroup tmedia_session_group
@@ -1581,23 +1649,23 @@ tsk_bool_t tmedia_session_mgr_is_new_ro(tmedia_session_mgr_t* self, const tsdp_m
*/
int tmedia_session_mgr_hold(tmedia_session_mgr_t* self, tmedia_type_t type)
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if (((session->type & type) == session->type) && session->M.lo){
- if (tsdp_header_M_hold(session->M.lo, tsk_true) == 0){
- self->state_changed = tsk_true;
- session->lo_held = tsk_true;
- }
- }
- }
- return 0;
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if (((session->type & type) == session->type) && session->M.lo) {
+ if (tsdp_header_M_hold(session->M.lo, tsk_true) == 0) {
+ self->state_changed = tsk_true;
+ session->lo_held = tsk_true;
+ }
+ }
+ }
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -1608,33 +1676,33 @@ int tmedia_session_mgr_hold(tmedia_session_mgr_t* self, tmedia_type_t type)
*/
tsk_bool_t tmedia_session_mgr_is_held(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t local)
{
- const tsk_list_item_t* item;
- tsk_bool_t have_these_sessions = tsk_false;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if ((session->type & type) == session->type){
- if (local && session->M.lo){
- have_these_sessions = tsk_true;
- if (!tsdp_header_M_is_held(session->M.lo, tsk_true)){
- return tsk_false;
- }
- }
- else if (!local && session->M.ro){
- have_these_sessions = tsk_true;
- if (!tsdp_header_M_is_held(session->M.ro, tsk_false)){
- return tsk_false;
- }
- }
- }
- }
- /* none is held */
- return have_these_sessions ? tsk_true : tsk_false;
+ const tsk_list_item_t* item;
+ tsk_bool_t have_these_sessions = tsk_false;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if ((session->type & type) == session->type) {
+ if (local && session->M.lo) {
+ have_these_sessions = tsk_true;
+ if (!tsdp_header_M_is_held(session->M.lo, tsk_true)) {
+ return tsk_false;
+ }
+ }
+ else if (!local && session->M.ro) {
+ have_these_sessions = tsk_true;
+ if (!tsdp_header_M_is_held(session->M.ro, tsk_false)) {
+ return tsk_false;
+ }
+ }
+ }
+ }
+ /* none is held */
+ return have_these_sessions ? tsk_true : tsk_false;
}
/**@ingroup tmedia_session_group
@@ -1647,28 +1715,28 @@ tsk_bool_t tmedia_session_mgr_is_held(tmedia_session_mgr_t* self, tmedia_type_t
*/
int tmedia_session_mgr_resume(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t local)
{
- const tsk_list_item_t* item;
- int ret = 0;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if (((session->type & type) == session->type) && session->M.lo){
- if ((ret = tsdp_header_M_resume(session->M.lo, local)) == 0){
- self->state_changed = tsk_true;
- if (local){
- session->lo_held = tsk_false;
- }
- else{
- session->ro_held = tsk_false;
- }
- }
- }
- }
- return ret;
+ const tsk_list_item_t* item;
+ int ret = 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if (((session->type & type) == session->type) && session->M.lo) {
+ if ((ret = tsdp_header_M_resume(session->M.lo, local)) == 0) {
+ self->state_changed = tsk_true;
+ if (local) {
+ session->lo_held = tsk_false;
+ }
+ else {
+ session->ro_held = tsk_false;
+ }
+ }
+ }
+ }
+ return ret;
}
/**@ingroup tmedia_session_group
@@ -1680,47 +1748,47 @@ int tmedia_session_mgr_resume(tmedia_session_mgr_t* self, tmedia_type_t type, ts
*/
int tmedia_session_mgr_add_media(tmedia_session_mgr_t* self, tmedia_type_t type)
{
- tsk_size_t i = 0;
- tmedia_session_t* session;
- const tmedia_session_plugin_def_t* plugin;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* for each registered plugin match with the supplied type */
- while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])){
- if ((plugin->type & type) == plugin->type){
- /* check whether we already support this media */
- if ((session = (tmedia_session_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &plugin->type)) && session->plugin){
- if (session->prepared){
- TSK_DEBUG_WARN("[%s] already active", plugin->media);
- }
- else{
- /* exist but unprepared(port=0) */
- _tmedia_session_prepare(session);
- if (self->started && session->plugin->start){
- session->plugin->start(session);
- }
- self->state_changed = tsk_true;
- }
- }
- else{
- /* session not supported */
- self->state_changed = tsk_true;
- if ((session = tmedia_session_create(plugin->type))){
- if (self->started && session->plugin->start){
- session->plugin->start(session);
- }
- tsk_list_push_back_data(self->sessions, (void**)(&session));
- self->state_changed = tsk_true;
- }
- }
- }
- }
-
- return self->state_changed ? 0 : -2;
+ tsk_size_t i = 0;
+ tmedia_session_t* session;
+ const tmedia_session_plugin_def_t* plugin;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* for each registered plugin match with the supplied type */
+ while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])) {
+ if ((plugin->type & type) == plugin->type) {
+ /* check whether we already support this media */
+ if ((session = (tmedia_session_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &plugin->type)) && session->plugin) {
+ if (session->prepared) {
+ TSK_DEBUG_WARN("[%s] already active", plugin->media);
+ }
+ else {
+ /* exist but unprepared(port=0) */
+ _tmedia_session_prepare(session);
+ if (self->started && session->plugin->start) {
+ session->plugin->start(session);
+ }
+ self->state_changed = tsk_true;
+ }
+ }
+ else {
+ /* session not supported */
+ self->state_changed = tsk_true;
+ if ((session = tmedia_session_create(plugin->type))) {
+ if (self->started && session->plugin->start) {
+ session->plugin->start(session);
+ }
+ tsk_list_push_back_data(self->sessions, (void**)(&session));
+ self->state_changed = tsk_true;
+ }
+ }
+ }
+ }
+
+ return self->state_changed ? 0 : -2;
}
/**@ingroup tmedia_session_group
@@ -1731,22 +1799,22 @@ int tmedia_session_mgr_add_media(tmedia_session_mgr_t* self, tmedia_type_t type)
*/
int tmedia_session_mgr_remove_media(tmedia_session_mgr_t* self, tmedia_type_t type)
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if (((session->type & type) == session->type) && session->plugin->stop){
- if (!session->plugin->stop(session)){
- self->state_changed = tsk_true;
- }
- }
- }
- return 0;
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if (((session->type & type) == session->type) && session->plugin->stop) {
+ if (!session->plugin->stop(session)) {
+ self->state_changed = tsk_true;
+ }
+ }
+ }
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -1758,14 +1826,14 @@ int tmedia_session_mgr_remove_media(tmedia_session_mgr_t* self, tmedia_type_t ty
*/
int tmedia_session_mgr_set_qos(tmedia_session_mgr_t* self, tmedia_qos_stype_t qos_type, tmedia_qos_strength_t qos_strength)
{
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->qos.type = qos_type;
- self->qos.strength = qos_strength;
- return 0;
+ self->qos.type = qos_type;
+ self->qos.strength = qos_strength;
+ return 0;
}
/**@ingroup tmedia_session_group
@@ -1775,20 +1843,20 @@ int tmedia_session_mgr_set_qos(tmedia_session_mgr_t* self, tmedia_qos_stype_t qo
*/
tsk_bool_t tmedia_session_mgr_canresume(tmedia_session_mgr_t* self)
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_true;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_true;
+ }
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if (session && session->qos && !tmedia_qos_tline_canresume(session->qos)){
- return tsk_false;
- }
- }
- return tsk_true;
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if (session && session->qos && !tmedia_qos_tline_canresume(session->qos)) {
+ return tsk_false;
+ }
+ }
+ return tsk_true;
}
@@ -1797,673 +1865,673 @@ tsk_bool_t tmedia_session_mgr_canresume(tmedia_session_mgr_t* self)
*/
tsk_bool_t tmedia_session_mgr_has_active_session(tmedia_session_mgr_t* self)
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
- tsk_list_foreach(item, self->sessions){
- tmedia_session_t* session = TMEDIA_SESSION(item->data);
- if (session && session->M.lo && session->M.lo->port){
- return tsk_true;
- }
- }
- return tsk_false;
+ tsk_list_foreach(item, self->sessions) {
+ tmedia_session_t* session = TMEDIA_SESSION(item->data);
+ if (session && session->M.lo && session->M.lo->port) {
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
int tmedia_session_mgr_send_dtmf(tmedia_session_mgr_t* self, uint8_t event)
{
- tmedia_session_audio_t* session;
- static const tmedia_type_t audio_type = tmedia_audio;
- int ret = -3;
+ tmedia_session_audio_t* session;
+ static const tmedia_type_t audio_type = tmedia_audio;
+ int ret = -3;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- session = (tmedia_session_audio_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &audio_type);
- if (session){
- session = tsk_object_ref(session);
- ret = tmedia_session_audio_send_dtmf(TMEDIA_SESSION_AUDIO(session), event);
- TSK_OBJECT_SAFE_FREE(session);
- }
- else{
- TSK_DEBUG_ERROR("No audio session associated to this manager");
- }
+ session = (tmedia_session_audio_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &audio_type);
+ if (session) {
+ session = tsk_object_ref(session);
+ ret = tmedia_session_audio_send_dtmf(TMEDIA_SESSION_AUDIO(session), event);
+ TSK_OBJECT_SAFE_FREE(session);
+ }
+ else {
+ TSK_DEBUG_ERROR("No audio session associated to this manager");
+ }
- return ret;
+ return ret;
}
int tmedia_session_mgr_set_t140_ondata_cbfn(tmedia_session_mgr_t* self, const void* context, tmedia_session_t140_ondata_cb_f func)
{
- tmedia_session_t* session;
- int ret = -1;
- if ((session = tmedia_session_mgr_find(self, tmedia_t140))){
- ret = tmedia_session_t140_set_ondata_cbfn(session, context, func);
- TSK_OBJECT_SAFE_FREE(session);
- }
- return ret;
+ tmedia_session_t* session;
+ int ret = -1;
+ if ((session = tmedia_session_mgr_find(self, tmedia_t140))) {
+ ret = tmedia_session_t140_set_ondata_cbfn(session, context, func);
+ TSK_OBJECT_SAFE_FREE(session);
+ }
+ return ret;
}
int tmedia_session_mgr_send_t140_data(tmedia_session_mgr_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- tmedia_session_t* session;
- int ret = -1;
- if ((session = tmedia_session_mgr_find(self, tmedia_t140))){
- ret = tmedia_session_t140_send_data(session, data_type, data_ptr, data_size);
- TSK_OBJECT_SAFE_FREE(session);
- }
- return ret;
+ tmedia_session_t* session;
+ int ret = -1;
+ if ((session = tmedia_session_mgr_find(self, tmedia_t140))) {
+ ret = tmedia_session_t140_send_data(session, data_type, data_ptr, data_size);
+ TSK_OBJECT_SAFE_FREE(session);
+ }
+ return ret;
}
int tmedia_session_mgr_set_onrtcp_cbfn(tmedia_session_mgr_t* self, tmedia_type_t media_type, const void* context, tmedia_session_rtcp_onevent_cb_f fun)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self){
- TSK_DEBUG_ERROR("Invlid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invlid parameter");
+ return -1;
+ }
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions){
- if (!(session = item->data) || !(session->type & media_type)){
- continue;
- }
- tmedia_session_set_onrtcp_cbfn(session, context, fun);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data) || !(session->type & media_type)) {
+ continue;
+ }
+ tmedia_session_set_onrtcp_cbfn(session, context, fun);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
int tmedia_session_mgr_send_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self){
- TSK_DEBUG_ERROR("Invlid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invlid parameter");
+ return -1;
+ }
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions){
- if (!(session = item->data) || !(session->type & media_type)){
- continue;
- }
- tmedia_session_send_rtcp_event(session, event_type, ssrc_media);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data) || !(session->type & media_type)) {
+ continue;
+ }
+ tmedia_session_send_rtcp_event(session, event_type, ssrc_media);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
int tmedia_session_mgr_recv_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media)
{
- static const uint64_t __fake_session_id = 0;
- return _tmedia_session_mgr_recv_rtcp_event(self, media_type, event_type, ssrc_media, __fake_session_id);
+ static const uint64_t __fake_session_id = 0;
+ return _tmedia_session_mgr_recv_rtcp_event(self, media_type, event_type, ssrc_media, __fake_session_id);
}
int tmedia_session_mgr_recv_rtcp_event_2(tmedia_session_mgr_t* self, tmedia_rtcp_event_type_t event_type, uint64_t session_id)
{
- static const uint32_t __fake_ssrc_media = 0;
- static const tmedia_type_t __fake_media_type = tmedia_none;
- return _tmedia_session_mgr_recv_rtcp_event(self, __fake_media_type, event_type, __fake_ssrc_media, session_id);
+ static const uint32_t __fake_ssrc_media = 0;
+ static const tmedia_type_t __fake_media_type = tmedia_none;
+ return _tmedia_session_mgr_recv_rtcp_event(self, __fake_media_type, event_type, __fake_ssrc_media, session_id);
}
int tmedia_session_mgr_send_file(tmedia_session_mgr_t* self, const char* path, ...)
{
- tmedia_session_msrp_t* session;
- tmedia_type_t msrp_type = tmedia_msrp;
- int ret = -3;
+ tmedia_session_msrp_t* session;
+ tmedia_type_t msrp_type = tmedia_msrp;
+ int ret = -3;
- if (!self || !path){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !path) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type);
- if (session && session->send_file){
- va_list ap;
- va_start(ap, path);
- session = tsk_object_ref(session);
- ret = session->send_file(TMEDIA_SESSION_MSRP(session), path, &ap);
- TSK_OBJECT_SAFE_FREE(session);
- va_end(ap);
- }
- else{
- TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
- }
+ session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type);
+ if (session && session->send_file) {
+ va_list ap;
+ va_start(ap, path);
+ session = tsk_object_ref(session);
+ ret = session->send_file(TMEDIA_SESSION_MSRP(session), path, &ap);
+ TSK_OBJECT_SAFE_FREE(session);
+ va_end(ap);
+ }
+ else {
+ TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
+ }
- return ret;
+ return ret;
}
int tmedia_session_mgr_send_message(tmedia_session_mgr_t* self, const void* data, tsk_size_t size, const tmedia_params_L_t *params)
{
- tmedia_session_msrp_t* session;
- tmedia_type_t msrp_type = tmedia_msrp;
- int ret = -3;
+ tmedia_session_msrp_t* session;
+ tmedia_type_t msrp_type = tmedia_msrp;
+ int ret = -3;
- if (!self || !size || !data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self || !size || !data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type);
- if (session && session->send_message){
- session = tsk_object_ref(session);
- ret = session->send_message(TMEDIA_SESSION_MSRP(session), data, size, params);
- TSK_OBJECT_SAFE_FREE(session);
- }
- else{
- TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
- }
+ session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type);
+ if (session && session->send_message) {
+ session = tsk_object_ref(session);
+ ret = session->send_message(TMEDIA_SESSION_MSRP(session), data, size, params);
+ TSK_OBJECT_SAFE_FREE(session);
+ }
+ else {
+ TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
+ }
- return ret;
+ return ret;
}
int tmedia_session_mgr_set_msrp_cb(tmedia_session_mgr_t* self, const void* callback_data, tmedia_session_msrp_cb_f func)
{
- tmedia_session_msrp_t* session;
- tmedia_type_t msrp_type = tmedia_msrp;
+ tmedia_session_msrp_t* session;
+ tmedia_type_t msrp_type = tmedia_msrp;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if ((session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type))){
- session->callback.data = callback_data;
- session->callback.func = func;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
- return -2;
- }
+ if ((session = (tmedia_session_msrp_t*)tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &msrp_type))) {
+ session->callback.data = callback_data;
+ session->callback.func = func;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("No MSRP session associated to this manager or session does not support file transfer");
+ return -2;
+ }
}
int tmedia_session_mgr_set_onerror_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_onerror_cb_f fun)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
// save for sessions created later
- self->onerror_cb.fun = fun;
- self->onerror_cb.usrdata = usrdata;
+ self->onerror_cb.fun = fun;
+ self->onerror_cb.usrdata = usrdata;
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions){
- if (!(session = item->data)){
- continue;
- }
- tmedia_session_set_onerror_cbfn(session, usrdata, fun);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data)) {
+ continue;
+ }
+ tmedia_session_set_onerror_cbfn(session, usrdata, fun);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
int tmedia_session_mgr_set_rfc5168_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_rfc5168_cb_f fun)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
// save for functions created later
- self->rfc5168_cb.fun = fun;
- self->rfc5168_cb.usrdata = usrdata;
+ self->rfc5168_cb.fun = fun;
+ self->rfc5168_cb.usrdata = usrdata;
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions){
- if (!(session = item->data)){
- continue;
- }
- tmedia_session_set_rfc5168_cbfn(session, usrdata, fun);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data)) {
+ continue;
+ }
+ tmedia_session_set_rfc5168_cbfn(session, usrdata, fun);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
int tmedia_session_mgr_set_bfcp_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_bfcp_cb_f fun)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions) {
- if (!(session = item->data)) {
- continue;
- }
- tmedia_session_set_bfcp_cbfn(session, usrdata, fun);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data)) {
+ continue;
+ }
+ tmedia_session_set_bfcp_cbfn(session, usrdata, fun);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
int tmedia_session_mgr_lo_apply_changes(tmedia_session_mgr_t* self)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- _tmedia_session_mgr_get_lo(self, kSkipSessionLoadTrue, kForceUpdateLOTrue);
- return 0;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ _tmedia_session_mgr_get_lo(self, kSkipSessionLoadTrue, kForceUpdateLOTrue);
+ return 0;
}
static int _tmedia_session_mgr_recv_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media, uint64_t session_id)
{
- tmedia_session_t* session;
- tsk_list_item_t *item;
+ tmedia_session_t* session;
+ tsk_list_item_t *item;
- if (!self){
- TSK_DEBUG_ERROR("Invlid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invlid parameter");
+ return -1;
+ }
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions) {
- if (!(session = item->data) || !((session->type & media_type) || (session->id == session_id))) {
- continue;
- }
- tmedia_session_recv_rtcp_event(session, event_type, ssrc_media);
- }
- tsk_list_unlock(self->sessions);
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if (!(session = item->data) || !((session->type & media_type) || (session->id == session_id))) {
+ continue;
+ }
+ tmedia_session_recv_rtcp_event(session, event_type, ssrc_media);
+ }
+ tsk_list_unlock(self->sessions);
- return 0;
+ return 0;
}
/** internal function used to load sessions */
static int _tmedia_session_mgr_load_sessions(tmedia_session_mgr_t* self)
{
- tsk_size_t i = 0;
- tmedia_session_t* session;
- const tmedia_session_plugin_def_t* plugin;
+ tsk_size_t i = 0;
+ tmedia_session_t* session;
+ const tmedia_session_plugin_def_t* plugin;
- tsk_list_lock(self->sessions);
+ tsk_list_lock(self->sessions);
#define has_media(media_type) (tsk_list_find_object_by_pred(self->sessions, __pred_find_session_by_type, &(media_type)))
- if (TSK_LIST_IS_EMPTY(self->sessions) || self->mediaType_changed) {
- //static tmedia_type_t __ghost_media_type = tmedia_ghost;
- //static tmedia_type_t __none_media_type = tmedia_none;
- // Remove ghost sessions. Up to the
- //while (tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &__ghost_media_type)) ;
- //while (tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &__none_media_type)) ;
- /* for each registered plugin create a session instance */
- while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])) {
- if ((plugin->type & self->type) == plugin->type) { /* media_type *IS* enabled */
- if (has_media(plugin->type)) {
- // we already have a matching media session -> enable it if not already done
- _tmedia_session_mgr_enable_session_with_type(self, plugin->type);
- }
- else {
- // we don't have a matching media session yet
- if ((session = tmedia_session_create(plugin->type))) {
- /* do not call "tmedia_session_mgr_set()" here to avoid applying parms before the creation of all session */
-
- /* set other default values */
-
- /* push session */
- tsk_list_push_back_data(self->sessions, (void**)(&session));
- }
- }
- }
- else { /* media_type *IS NOT* enabled */
- if (has_media(plugin->type)) {
- // do not remove to make sure media indexes match -> see rfc 3264 section 8
- // tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &(plugin->type));
- _tmedia_session_mgr_disable_session_with_type(self, plugin->type);
- }
- }
- }
- /* set default values and apply params*/
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_POBJECT(tmedia_audio, "ice-ctx", self->ice.ctx_audio),
- TMEDIA_SESSION_SET_POBJECT(tmedia_video, "ice-ctx", self->ice.ctx_video),
- TMEDIA_SESSION_SET_POBJECT(tmedia_bfcp_video, "ice-ctx", self->ice.ctx_bfcpvid),
-
- TMEDIA_SESSION_SET_STR(self->type, "local-ip", self->addr),
- TMEDIA_SESSION_SET_STR(self->type, "local-ipver", self->ipv6 ? "ipv6" : "ipv4"),
- TMEDIA_SESSION_SET_INT32(self->type, "bandwidth-level", self->bl),
- TMEDIA_SESSION_SET_NULL());
+ if (TSK_LIST_IS_EMPTY(self->sessions) || self->mediaType_changed) {
+ //static tmedia_type_t __ghost_media_type = tmedia_ghost;
+ //static tmedia_type_t __none_media_type = tmedia_none;
+ // Remove ghost sessions. Up to the
+ //while (tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &__ghost_media_type)) ;
+ //while (tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &__none_media_type)) ;
+ /* for each registered plugin create a session instance */
+ while ((i < TMED_SESSION_MAX_PLUGINS) && (plugin = __tmedia_session_plugins[i++])) {
+ if ((plugin->type & self->type) == plugin->type) { /* media_type *IS* enabled */
+ if (has_media(plugin->type)) {
+ // we already have a matching media session -> enable it if not already done
+ _tmedia_session_mgr_enable_session_with_type(self, plugin->type);
+ }
+ else {
+ // we don't have a matching media session yet
+ if ((session = tmedia_session_create(plugin->type))) {
+ /* do not call "tmedia_session_mgr_set()" here to avoid applying parms before the creation of all session */
+
+ /* set other default values */
+
+ /* push session */
+ tsk_list_push_back_data(self->sessions, (void**)(&session));
+ }
+ }
+ }
+ else { /* media_type *IS NOT* enabled */
+ if (has_media(plugin->type)) {
+ // do not remove to make sure media indexes match -> see rfc 3264 section 8
+ // tsk_list_remove_item_by_pred(self->sessions, __pred_find_session_by_type, &(plugin->type));
+ _tmedia_session_mgr_disable_session_with_type(self, plugin->type);
+ }
+ }
+ }
+ /* set default values and apply params*/
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_POBJECT(tmedia_audio, "ice-ctx", self->ice.ctx_audio),
+ TMEDIA_SESSION_SET_POBJECT(tmedia_video, "ice-ctx", self->ice.ctx_video),
+ TMEDIA_SESSION_SET_POBJECT(tmedia_bfcp_video, "ice-ctx", self->ice.ctx_bfcpvid),
+
+ TMEDIA_SESSION_SET_STR(self->type, "local-ip", self->addr),
+ TMEDIA_SESSION_SET_STR(self->type, "local-ipver", self->ipv6 ? "ipv6" : "ipv4"),
+ TMEDIA_SESSION_SET_INT32(self->type, "bandwidth-level", self->bl),
+ TMEDIA_SESSION_SET_NULL());
// set callback functions
tmedia_session_mgr_set_onerror_cbfn(self, self->onerror_cb.usrdata, self->onerror_cb.fun);
tmedia_session_mgr_set_rfc5168_cbfn(self, self->rfc5168_cb.usrdata, self->rfc5168_cb.fun);
- }
+ }
#undef has_media
- tsk_list_unlock(self->sessions);
- return 0;
+ tsk_list_unlock(self->sessions);
+ return 0;
}
//!\ not thread-safe
static const tmedia_session_t* _tmedia_session_mgr_find_session_at_index(const tmedia_sessions_L_t* list, tsk_size_t index)
{
- const tsk_list_item_t *item;
- tsk_size_t u = 0;
- tsk_list_foreach(item, list) {
- if (u++ == index) {
- return (const tmedia_session_t*)item->data;
- }
- }
- return tsk_null;
+ const tsk_list_item_t *item;
+ tsk_size_t u = 0;
+ tsk_list_foreach(item, list) {
+ if (u++ == index) {
+ return (const tmedia_session_t*)item->data;
+ }
+ }
+ return tsk_null;
}
/* internal function */
static int _tmedia_session_mgr_disable_or_enable_session_with_type(tmedia_session_mgr_t* self, tmedia_type_t media_type, tsk_bool_t enable)
{
- tsk_list_item_t *item;
- tmedia_session_t *session;
- tsk_list_lock(self->sessions);
-
- tsk_list_foreach(item, self->sessions) {
- if ((session = (tmedia_session_t*)item->data) && session->plugin && session->plugin->type == media_type) {
- if (enable) {
- if (session->M.lo && !session->M.lo->port) {
- TSK_OBJECT_SAFE_FREE(session->M.ro);
- TSK_OBJECT_SAFE_FREE(session->M.lo);
- session->prepared = tsk_false;
- }
- }
- else {
- if (session->plugin->stop) {
- session->plugin->stop(session);
- }
- if (session->M.lo) {
- session->M.lo->port = 0;
- }
- session->prepared = tsk_false;
- }
- }
- }
-
- tsk_list_unlock(self->sessions);
- return 0;
+ tsk_list_item_t *item;
+ tmedia_session_t *session;
+ tsk_list_lock(self->sessions);
+
+ tsk_list_foreach(item, self->sessions) {
+ if ((session = (tmedia_session_t*)item->data) && session->plugin && session->plugin->type == media_type) {
+ if (enable) {
+ if (session->M.lo && !session->M.lo->port) {
+ TSK_OBJECT_SAFE_FREE(session->M.ro);
+ TSK_OBJECT_SAFE_FREE(session->M.lo);
+ session->prepared = tsk_false;
+ }
+ }
+ else {
+ if (session->plugin->stop) {
+ session->plugin->stop(session);
+ }
+ if (session->M.lo) {
+ session->M.lo->port = 0;
+ }
+ session->prepared = tsk_false;
+ }
+ }
+ }
+
+ tsk_list_unlock(self->sessions);
+ return 0;
}
/* internal function */
static int _tmedia_session_mgr_clear_sessions(tmedia_session_mgr_t* self)
{
- if (self && self->sessions){
- tsk_list_clear_items(self->sessions);
- }
- return 0;
+ if (self && self->sessions) {
+ tsk_list_clear_items(self->sessions);
+ }
+ return 0;
}
/* internal function */
// force_update_lo: means use same sdp version number but update fields
static const tsdp_message_t* _tmedia_session_mgr_get_lo(tmedia_session_mgr_t* self, tsk_bool_t skip_session_load, tsk_bool_t force_update_lo)
{
- const tsk_list_item_t* item;
- const tmedia_session_t* ms;
- const tsdp_header_M_t* m;
- const tsdp_message_t* ret = tsk_null;
- uint32_t new_ver_num;
- tsk_bool_t inc_ver = tsk_false;
-
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsk_safeobj_lock(self);
-
- /* prepare the session manager if not already done (create all sessions) */
- if (TSK_LIST_IS_EMPTY(self->sessions)){
- if (_tmedia_session_mgr_load_sessions(self)){
- TSK_DEBUG_ERROR("Failed to prepare the session manager");
- goto bail;
- }
- }
-
- /* creates local sdp if not already done or update it's value (because of set_ro())*/
- if ((self->ro_changed || self->state_changed || self->mediaType_changed) && self->sdp.lo) {
- // delete current lo
- TSK_OBJECT_SAFE_FREE(self->sdp.lo);
- if (self->mediaType_changed && !skip_session_load) {
- // reload session with new medias and keep the old one
- _tmedia_session_mgr_load_sessions(self);
- }
- self->ro_changed = tsk_false;
- self->ro_provisional = tsk_false;
- self->state_changed = tsk_false;
- self->mediaType_changed = tsk_false;
- }
- if (force_update_lo && self->sdp.lo) {
- const tsdp_header_O_t* O;
-
- if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(self->sdp.lo, tsdp_htype_O))) {
- tsk_list_item_t *item;
- tmedia_session_t *session;
-
- new_ver_num = O->sess_version;
- tsk_list_lock(self->sessions);
- tsk_list_foreach(item, self->sessions) {
- if ((session = (tmedia_session_t*)item->data)) {
- TSK_OBJECT_SAFE_FREE(session->M.lo);
- }
- }
- tsk_list_unlock(self->sessions);
- TSK_OBJECT_SAFE_FREE(self->sdp.lo);
- }
- else {
- new_ver_num = (self->sdp.lo_ver + 1);
- inc_ver = tsk_true;
- }
- }
- else {
- new_ver_num = (self->sdp.lo_ver + 1);
- inc_ver = tsk_true;
- }
-
- if (self->sdp.lo) {
- ret = self->sdp.lo;
- goto bail;
- }
- else {
- if ((self->sdp.lo = tsdp_message_create_empty(self->public_addr ? self->public_addr : self->addr, self->ipv6, new_ver_num))) {
- /* Set connection "c=" */
- tsdp_message_add_headers(self->sdp.lo,
- TSDP_HEADER_C_VA_ARGS("IN", self->ipv6 ? "IP6" : "IP4", self->public_addr ? self->public_addr : self->addr),
- tsk_null);
- if (inc_ver) {
- ++self->sdp.lo_ver;
- }
- }
- else {
- TSK_DEBUG_ERROR("Failed to create empty SDP message");
- goto bail;
- }
- }
-
- /* pass complete local sdp to the sessions to allow them to use session-level attributes */
- tmedia_session_mgr_set(self,
- TMEDIA_SESSION_SET_POBJECT(self->type, "local-sdp-message", self->sdp.lo),
- TMEDIA_SESSION_SET_NULL());
-
- /* gets each "m=" line from the sessions and add them to the local sdp */
- tsk_list_foreach(item, self->sessions){
- if (!(ms = item->data) || !ms->plugin){
- TSK_DEBUG_ERROR("Invalid session");
- continue;
- }
- if ((self->type & ms->plugin->type) || ms->plugin->type == tmedia_ghost) {
- /* prepare the media session */
- if (!ms->prepared && (_tmedia_session_prepare(TMEDIA_SESSION(ms)))){
- TSK_DEBUG_ERROR("Failed to prepare session"); /* should never happen */
- continue;
- }
-
- /* Add QoS lines to our local media */
- if ((self->qos.type != tmedia_qos_stype_none) && !TMEDIA_SESSION(ms)->qos){
- TMEDIA_SESSION(ms)->qos = tmedia_qos_tline_create(self->qos.type, self->qos.strength);
- }
-
- /* add "m=" line from the session to the local sdp */
- if ((m = tmedia_session_get_lo(TMEDIA_SESSION(ms)))) {
- tsdp_message_add_header(self->sdp.lo, TSDP_HEADER(m));
- }
- else {
- TSK_DEBUG_ERROR("Failed to get m= line for [%s] media", ms->plugin->media);
- }
- }
- else if (ms->M.lo) {
- // media not enabled -> add sdp with port zero
- tsdp_message_add_header(self->sdp.lo, TSDP_HEADER(ms->M.lo));
- }
- }
-
- self->type = self->sdp.lo ? tmedia_type_from_sdp(self->sdp.lo) : tmedia_none;
- ret = self->sdp.lo;
+ const tsk_list_item_t* item;
+ const tmedia_session_t* ms;
+ const tsdp_header_M_t* m;
+ const tsdp_message_t* ret = tsk_null;
+ uint32_t new_ver_num;
+ tsk_bool_t inc_ver = tsk_false;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsk_safeobj_lock(self);
+
+ /* prepare the session manager if not already done (create all sessions) */
+ if (TSK_LIST_IS_EMPTY(self->sessions)) {
+ if (_tmedia_session_mgr_load_sessions(self)) {
+ TSK_DEBUG_ERROR("Failed to prepare the session manager");
+ goto bail;
+ }
+ }
+
+ /* creates local sdp if not already done or update it's value (because of set_ro())*/
+ if ((self->ro_changed || self->state_changed || self->mediaType_changed) && self->sdp.lo) {
+ // delete current lo
+ TSK_OBJECT_SAFE_FREE(self->sdp.lo);
+ if (self->mediaType_changed && !skip_session_load) {
+ // reload session with new medias and keep the old one
+ _tmedia_session_mgr_load_sessions(self);
+ }
+ self->ro_changed = tsk_false;
+ self->ro_provisional = tsk_false;
+ self->state_changed = tsk_false;
+ self->mediaType_changed = tsk_false;
+ }
+ if (force_update_lo && self->sdp.lo) {
+ const tsdp_header_O_t* O;
+
+ if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(self->sdp.lo, tsdp_htype_O))) {
+ tsk_list_item_t *item;
+ tmedia_session_t *session;
+
+ new_ver_num = O->sess_version;
+ tsk_list_lock(self->sessions);
+ tsk_list_foreach(item, self->sessions) {
+ if ((session = (tmedia_session_t*)item->data)) {
+ TSK_OBJECT_SAFE_FREE(session->M.lo);
+ }
+ }
+ tsk_list_unlock(self->sessions);
+ TSK_OBJECT_SAFE_FREE(self->sdp.lo);
+ }
+ else {
+ new_ver_num = (self->sdp.lo_ver + 1);
+ inc_ver = tsk_true;
+ }
+ }
+ else {
+ new_ver_num = (self->sdp.lo_ver + 1);
+ inc_ver = tsk_true;
+ }
+
+ if (self->sdp.lo) {
+ ret = self->sdp.lo;
+ goto bail;
+ }
+ else {
+ if ((self->sdp.lo = tsdp_message_create_empty(self->public_addr ? self->public_addr : self->addr, self->ipv6, new_ver_num))) {
+ /* Set connection "c=" */
+ tsdp_message_add_headers(self->sdp.lo,
+ TSDP_HEADER_C_VA_ARGS("IN", self->ipv6 ? "IP6" : "IP4", self->public_addr ? self->public_addr : self->addr),
+ tsk_null);
+ if (inc_ver) {
+ ++self->sdp.lo_ver;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create empty SDP message");
+ goto bail;
+ }
+ }
+
+ /* pass complete local sdp to the sessions to allow them to use session-level attributes */
+ tmedia_session_mgr_set(self,
+ TMEDIA_SESSION_SET_POBJECT(self->type, "local-sdp-message", self->sdp.lo),
+ TMEDIA_SESSION_SET_NULL());
+
+ /* gets each "m=" line from the sessions and add them to the local sdp */
+ tsk_list_foreach(item, self->sessions) {
+ if (!(ms = item->data) || !ms->plugin) {
+ TSK_DEBUG_ERROR("Invalid session");
+ continue;
+ }
+ if ((self->type & ms->plugin->type) || ms->plugin->type == tmedia_ghost) {
+ /* prepare the media session */
+ if (!ms->prepared && (_tmedia_session_prepare(TMEDIA_SESSION(ms)))) {
+ TSK_DEBUG_ERROR("Failed to prepare session"); /* should never happen */
+ continue;
+ }
+
+ /* Add QoS lines to our local media */
+ if ((self->qos.type != tmedia_qos_stype_none) && !TMEDIA_SESSION(ms)->qos) {
+ TMEDIA_SESSION(ms)->qos = tmedia_qos_tline_create(self->qos.type, self->qos.strength);
+ }
+
+ /* add "m=" line from the session to the local sdp */
+ if ((m = tmedia_session_get_lo(TMEDIA_SESSION(ms)))) {
+ tsdp_message_add_header(self->sdp.lo, TSDP_HEADER(m));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to get m= line for [%s] media", ms->plugin->media);
+ }
+ }
+ else if (ms->M.lo) {
+ // media not enabled -> add sdp with port zero
+ tsdp_message_add_header(self->sdp.lo, TSDP_HEADER(ms->M.lo));
+ }
+ }
+
+ self->type = self->sdp.lo ? tmedia_type_from_sdp(self->sdp.lo) : tmedia_none;
+ ret = self->sdp.lo;
bail:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return ret;
+ return ret;
}
static int _tmedia_session_mgr_start(tmedia_session_mgr_t* self, int session_index)
{
- int ret = 0, index = 0;
- tsk_list_item_t* item;
- tmedia_session_t* session;
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- tsk_list_foreach(item, self->sessions) {
- if (session_index == kSessionIndexAll || index++ == session_index) {
- if (!(session = item->data) || !session->plugin || !session->plugin->start) {
- TSK_DEBUG_ERROR("Invalid session");
- ret = -2;
- goto bail;
- }
- if (!session->M.lo || !session->M.lo->port) {
- continue;
- }
- if ((ret = session->plugin->start(session))) {
- TSK_DEBUG_ERROR("Failed to start %s session", session->plugin->media);
- continue;
- }
- }
- }
- if (session_index == kSessionIndexAll) {
- self->started = tsk_true;
- }
+ int ret = 0, index = 0;
+ tsk_list_item_t* item;
+ tmedia_session_t* session;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ tsk_list_foreach(item, self->sessions) {
+ if (session_index == kSessionIndexAll || index++ == session_index) {
+ if (!(session = item->data) || !session->plugin || !session->plugin->start) {
+ TSK_DEBUG_ERROR("Invalid session");
+ ret = -2;
+ goto bail;
+ }
+ if (!session->M.lo || !session->M.lo->port) {
+ continue;
+ }
+ if ((ret = session->plugin->start(session))) {
+ TSK_DEBUG_ERROR("Failed to start %s session", session->plugin->media);
+ continue;
+ }
+ }
+ }
+ if (session_index == kSessionIndexAll) {
+ self->started = tsk_true;
+ }
bail:
- tsk_safeobj_unlock(self);
- return ret;
+ tsk_safeobj_unlock(self);
+ return ret;
}
static int _tmedia_session_mgr_stop(tmedia_session_mgr_t* self, int session_index)
{
- int ret = 0, index = 0;
- tsk_list_item_t* item;
- tmedia_session_t* session;
-
- TSK_DEBUG_INFO("tmedia_session_mgr_stop()");
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(self);
-
- tsk_list_foreach(item, self->sessions) {
- if (session_index == kSessionIndexAll || index++ == session_index) {
- if (!(session = item->data) || !session->plugin || !session->plugin->stop) {
- TSK_DEBUG_ERROR("Invalid session");
- ret = -2;
- goto bail;
- }
- if ((ret = session->plugin->stop(session))) {
- TSK_DEBUG_ERROR("Failed to stop session");
- continue;
- }
- session->prepared = tsk_false;
- }
- }
- if (session_index == kSessionIndexAll) {
- self->started = tsk_false;
- }
+ int ret = 0, index = 0;
+ tsk_list_item_t* item;
+ tmedia_session_t* session;
+
+ TSK_DEBUG_INFO("tmedia_session_mgr_stop()");
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(self);
+
+ tsk_list_foreach(item, self->sessions) {
+ if (session_index == kSessionIndexAll || index++ == session_index) {
+ if (!(session = item->data) || !session->plugin || !session->plugin->stop) {
+ TSK_DEBUG_ERROR("Invalid session");
+ ret = -2;
+ goto bail;
+ }
+ if ((ret = session->plugin->stop(session))) {
+ TSK_DEBUG_ERROR("Failed to stop session");
+ continue;
+ }
+ session->prepared = tsk_false;
+ }
+ }
+ if (session_index == kSessionIndexAll) {
+ self->started = tsk_false;
+ }
bail:
- tsk_safeobj_unlock(self);
- return ret;
+ tsk_safeobj_unlock(self);
+ return ret;
}
/* internal function */
static int _tmedia_session_mgr_apply_params(tmedia_session_mgr_t* self)
{
- tsk_list_item_t *it1, *it2;
- tmedia_param_t* param;
- tmedia_session_t* session;
+ tsk_list_item_t *it1, *it2;
+ tmedia_param_t* param;
+ tmedia_session_t* session;
- if (!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- /* If no parameters ==> do nothing (not error) */
- if (TSK_LIST_IS_EMPTY(self->params)){
- return 0;
- }
+ /* If no parameters ==> do nothing (not error) */
+ if (TSK_LIST_IS_EMPTY(self->params)) {
+ return 0;
+ }
- tsk_list_lock(self->params);
+ tsk_list_lock(self->params);
- tsk_list_foreach(it1, self->params){
- if (!(param = it1->data)){
- continue;
- }
+ tsk_list_foreach(it1, self->params) {
+ if (!(param = it1->data)) {
+ continue;
+ }
- /* For us */
- if (param->plugin_type == tmedia_ppt_manager){
- continue;
- }
+ /* For us */
+ if (param->plugin_type == tmedia_ppt_manager) {
+ continue;
+ }
- /* For the session (or consumer or producer or codec) */
- tsk_list_foreach(it2, self->sessions){
- if (!(session = it2->data) || !session->plugin){
- continue;
- }
- if (session->plugin->set && (session->type & param->media_type) == session->type){
- session->plugin->set(session, param);
- }
- }
- }
+ /* For the session (or consumer or producer or codec) */
+ tsk_list_foreach(it2, self->sessions) {
+ if (!(session = it2->data) || !session->plugin) {
+ continue;
+ }
+ if (session->plugin->set && (session->type & param->media_type) == session->type) {
+ session->plugin->set(session, param);
+ }
+ }
+ }
- /* Clean up params */
- tsk_list_clear_items(self->params);
+ /* Clean up params */
+ tsk_list_clear_items(self->params);
- tsk_list_unlock(self->params);
+ tsk_list_unlock(self->params);
- return 0;
+ return 0;
}
//=================================================================================================
@@ -2471,54 +2539,53 @@ static int _tmedia_session_mgr_apply_params(tmedia_session_mgr_t* self)
//
static tsk_object_t* tmedia_session_mgr_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_session_mgr_t *mgr = self;
- if (mgr){
- mgr->sessions = tsk_list_create();
+ tmedia_session_mgr_t *mgr = self;
+ if (mgr) {
+ mgr->sessions = tsk_list_create();
- mgr->sdp.lo_ver = TSDP_HEADER_O_SESS_VERSION_DEFAULT;
- mgr->sdp.ro_ver = -1;
+ mgr->sdp.lo_ver = TSDP_HEADER_O_SESS_VERSION_DEFAULT;
+ mgr->sdp.ro_ver = -1;
- mgr->qos.type = tmedia_qos_stype_none;
- mgr->qos.strength = tmedia_qos_strength_optional;
- mgr->bl = tmedia_defaults_get_bl();
+ mgr->qos.type = tmedia_qos_stype_none;
+ mgr->qos.strength = tmedia_qos_strength_optional;
+ mgr->bl = tmedia_defaults_get_bl();
- tsk_safeobj_init(mgr);
- }
- return self;
+ tsk_safeobj_init(mgr);
+ }
+ return self;
}
static tsk_object_t* tmedia_session_mgr_dtor(tsk_object_t * self)
{
- tmedia_session_mgr_t *mgr = self;
- if (mgr){
- TSK_OBJECT_SAFE_FREE(mgr->sessions);
+ tmedia_session_mgr_t *mgr = self;
+ if (mgr) {
+ TSK_OBJECT_SAFE_FREE(mgr->sessions);
- TSK_OBJECT_SAFE_FREE(mgr->sdp.lo);
- TSK_OBJECT_SAFE_FREE(mgr->sdp.ro);
+ TSK_OBJECT_SAFE_FREE(mgr->sdp.lo);
+ TSK_OBJECT_SAFE_FREE(mgr->sdp.ro);
- TSK_OBJECT_SAFE_FREE(mgr->params);
+ TSK_OBJECT_SAFE_FREE(mgr->params);
- TSK_OBJECT_SAFE_FREE(mgr->natt_ctx);
- TSK_FREE(mgr->public_addr);
+ TSK_OBJECT_SAFE_FREE(mgr->natt_ctx);
+ TSK_FREE(mgr->public_addr);
- TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_audio);
- TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_video);
- TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_bfcpvid);
+ TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_audio);
+ TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_video);
+ TSK_OBJECT_SAFE_FREE(mgr->ice.ctx_bfcpvid);
- TSK_FREE(mgr->addr);
+ TSK_FREE(mgr->addr);
- tsk_safeobj_deinit(mgr);
- }
+ tsk_safeobj_deinit(mgr);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tmedia_session_mgr_def_s =
-{
- sizeof(tmedia_session_mgr_t),
- tmedia_session_mgr_ctor,
- tmedia_session_mgr_dtor,
- tsk_null,
+static const tsk_object_def_t tmedia_session_mgr_def_s = {
+ sizeof(tmedia_session_mgr_t),
+ tmedia_session_mgr_ctor,
+ tmedia_session_mgr_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmedia_session_mgr_def_t = &tmedia_session_mgr_def_s;
diff --git a/tinyMEDIA/src/tmedia_session_dummy.c b/tinyMEDIA/src/tmedia_session_dummy.c
index dfd141e..c65e512 100755
--- a/tinyMEDIA/src/tmedia_session_dummy.c
+++ b/tinyMEDIA/src/tmedia_session_dummy.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,286 +36,286 @@
int tmedia_session_daudio_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- tmedia_session_daudio_t* daudio;
+ tmedia_session_daudio_t* daudio;
- daudio = (tmedia_session_daudio_t*)self;
+ daudio = (tmedia_session_daudio_t*)self;
- return 0;
+ return 0;
}
int tmedia_session_daudio_get(tmedia_session_t* self, tmedia_param_t* param)
{
- return 0;
+ return 0;
}
int tmedia_session_daudio_prepare(tmedia_session_t* self)
{
- tmedia_session_daudio_t* daudio;
+ tmedia_session_daudio_t* daudio;
- daudio = (tmedia_session_daudio_t*)self;
+ daudio = (tmedia_session_daudio_t*)self;
- /* set local port */
- daudio->local_port = rand() ^ rand();
+ /* set local port */
+ daudio->local_port = rand() ^ rand();
- return 0;
+ return 0;
}
int tmedia_session_daudio_start(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
int tmedia_session_daudio_stop(tmedia_session_t* self)
{
- tmedia_session_daudio_t* daudio;
+ tmedia_session_daudio_t* daudio;
- daudio = (tmedia_session_daudio_t*)self;
+ daudio = (tmedia_session_daudio_t*)self;
- /* very important */
- daudio->local_port = 0;
+ /* very important */
+ daudio->local_port = 0;
- return 0;
+ return 0;
}
int tmedia_session_daudio_send_dtmf(tmedia_session_t* self, uint8_t event)
{
- return 0;
+ return 0;
}
int tmedia_session_daudio_pause(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
const tsdp_header_M_t* tmedia_session_daudio_get_lo(tmedia_session_t* self)
{
- tmedia_session_daudio_t* daudio;
- tsk_bool_t changed = tsk_false;
-
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- daudio = (tmedia_session_daudio_t*)self;
-
- if(self->ro_changed && self->M.lo){
- /* Codecs */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
- tsk_list_clear_items(self->M.lo->FMTs);
-
- /* QoS */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
- }
-
- changed = (self->ro_changed || !self->M.lo);
-
- if(!self->M.lo && !(self->M.lo = tsdp_header_M_create(self->plugin->media, daudio->local_port, "RTP/AVP"))){
- TSK_DEBUG_ERROR("Failed to create lo");
- return tsk_null;
- }
-
- if(changed){
- /* from codecs to sdp */
- tmedia_codec_to_sdp(self->neg_codecs ? self->neg_codecs : self->codecs, self->M.lo);
- /* QoS */
- if(self->qos){
- tmedia_qos_tline_t* ro_tline;
- if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))){
- tmedia_qos_tline_set_ro(self->qos, ro_tline);
- TSK_OBJECT_SAFE_FREE(ro_tline);
- }
- tmedia_qos_tline_to_sdp(self->qos, self->M.lo);
- }
- }
-
-
- return self->M.lo;
+ tmedia_session_daudio_t* daudio;
+ tsk_bool_t changed = tsk_false;
+
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ daudio = (tmedia_session_daudio_t*)self;
+
+ if(self->ro_changed && self->M.lo) {
+ /* Codecs */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
+ tsk_list_clear_items(self->M.lo->FMTs);
+
+ /* QoS */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
+ }
+
+ changed = (self->ro_changed || !self->M.lo);
+
+ if(!self->M.lo && !(self->M.lo = tsdp_header_M_create(self->plugin->media, daudio->local_port, "RTP/AVP"))) {
+ TSK_DEBUG_ERROR("Failed to create lo");
+ return tsk_null;
+ }
+
+ if(changed) {
+ /* from codecs to sdp */
+ tmedia_codec_to_sdp(self->neg_codecs ? self->neg_codecs : self->codecs, self->M.lo);
+ /* QoS */
+ if(self->qos) {
+ tmedia_qos_tline_t* ro_tline;
+ if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))) {
+ tmedia_qos_tline_set_ro(self->qos, ro_tline);
+ TSK_OBJECT_SAFE_FREE(ro_tline);
+ }
+ tmedia_qos_tline_to_sdp(self->qos, self->M.lo);
+ }
+ }
+
+
+ return self->M.lo;
}
int tmedia_session_daudio_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- tmedia_codecs_L_t* neg_codecs;
-
- if((neg_codecs = tmedia_session_match_codec(self, m))){
- /* update negociated codecs */
- TSK_OBJECT_SAFE_FREE(self->neg_codecs);
- self->neg_codecs = neg_codecs;
- /* update remote offer */
- TSK_OBJECT_SAFE_FREE(self->M.ro);
- self->M.ro = tsk_object_ref((void*)m);
-
- return 0;
- }
- return -1;
+ tmedia_codecs_L_t* neg_codecs;
+
+ if((neg_codecs = tmedia_session_match_codec(self, m))) {
+ /* update negociated codecs */
+ TSK_OBJECT_SAFE_FREE(self->neg_codecs);
+ self->neg_codecs = neg_codecs;
+ /* update remote offer */
+ TSK_OBJECT_SAFE_FREE(self->M.ro);
+ self->M.ro = tsk_object_ref((void*)m);
+
+ return 0;
+ }
+ return -1;
}
/* ============ Video Session ================= */
int tmedia_session_dvideo_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- tmedia_session_dvideo_t* dvideo;
+ tmedia_session_dvideo_t* dvideo;
- dvideo = (tmedia_session_dvideo_t*)self;
+ dvideo = (tmedia_session_dvideo_t*)self;
- return 0;
+ return 0;
}
int tmedia_session_dvideo_get(tmedia_session_t* self, tmedia_param_t* param)
{
- return 0;
+ return 0;
}
int tmedia_session_dvideo_prepare(tmedia_session_t* self)
{
- tmedia_session_dvideo_t* dvideo;
+ tmedia_session_dvideo_t* dvideo;
- dvideo = (tmedia_session_dvideo_t*)self;
+ dvideo = (tmedia_session_dvideo_t*)self;
- /* set local port */
- dvideo->local_port = rand() ^ rand();
+ /* set local port */
+ dvideo->local_port = rand() ^ rand();
- return 0;
+ return 0;
}
int tmedia_session_dvideo_start(tmedia_session_t* self)
{
- return -1;
+ return -1;
}
int tmedia_session_dvideo_stop(tmedia_session_t* self)
{
- tmedia_session_dvideo_t* dvideo;
+ tmedia_session_dvideo_t* dvideo;
- dvideo = (tmedia_session_dvideo_t*)self;
+ dvideo = (tmedia_session_dvideo_t*)self;
- /* very important */
- dvideo->local_port = 0;
+ /* very important */
+ dvideo->local_port = 0;
- return 0;
+ return 0;
}
int tmedia_session_dvideo_pause(tmedia_session_t* self)
{
- return -1;
+ return -1;
}
const tsdp_header_M_t* tmedia_session_dvideo_get_lo(tmedia_session_t* self)
{
- tmedia_session_dvideo_t* dvideo;
- tsk_bool_t changed = tsk_false;
-
- if(!self || !self->plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- dvideo = (tmedia_session_dvideo_t*)self;
-
- if(self->ro_changed && self->M.lo){
- /* Codecs */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
- tsk_list_clear_items(self->M.lo->FMTs);
-
- /* QoS */
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
- tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
- }
-
- changed = (self->ro_changed || !self->M.lo);
-
- if(!self->M.lo && !(self->M.lo = tsdp_header_M_create(self->plugin->media, dvideo->local_port, "RTP/AVP"))){
- TSK_DEBUG_ERROR("Failed to create lo");
- return tsk_null;
- }
-
- if(changed){
- /* from codecs to sdp */
- tmedia_codec_to_sdp(self->neg_codecs ? self->neg_codecs : self->codecs, self->M.lo);
- /* QoS */
- if(self->qos){
- tmedia_qos_tline_t* ro_tline;
- if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))){
- tmedia_qos_tline_set_ro(self->qos, ro_tline);
- TSK_OBJECT_SAFE_FREE(ro_tline);
- }
- tmedia_qos_tline_to_sdp(self->qos, self->M.lo);
- }
- }
-
- return self->M.lo;
+ tmedia_session_dvideo_t* dvideo;
+ tsk_bool_t changed = tsk_false;
+
+ if(!self || !self->plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ dvideo = (tmedia_session_dvideo_t*)self;
+
+ if(self->ro_changed && self->M.lo) {
+ /* Codecs */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "fmtp");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "rtpmap");
+ tsk_list_clear_items(self->M.lo->FMTs);
+
+ /* QoS */
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "curr");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "des");
+ tsdp_header_A_removeAll_by_field(self->M.lo->Attributes, "conf");
+ }
+
+ changed = (self->ro_changed || !self->M.lo);
+
+ if(!self->M.lo && !(self->M.lo = tsdp_header_M_create(self->plugin->media, dvideo->local_port, "RTP/AVP"))) {
+ TSK_DEBUG_ERROR("Failed to create lo");
+ return tsk_null;
+ }
+
+ if(changed) {
+ /* from codecs to sdp */
+ tmedia_codec_to_sdp(self->neg_codecs ? self->neg_codecs : self->codecs, self->M.lo);
+ /* QoS */
+ if(self->qos) {
+ tmedia_qos_tline_t* ro_tline;
+ if(self->M.ro && (ro_tline = tmedia_qos_tline_from_sdp(self->M.ro))) {
+ tmedia_qos_tline_set_ro(self->qos, ro_tline);
+ TSK_OBJECT_SAFE_FREE(ro_tline);
+ }
+ tmedia_qos_tline_to_sdp(self->qos, self->M.lo);
+ }
+ }
+
+ return self->M.lo;
}
int tmedia_session_dvideo_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- tmedia_codecs_L_t* neg_codecs;
-
- if((neg_codecs = tmedia_session_match_codec(self, m))){
- /* update negociated codecs */
- TSK_OBJECT_SAFE_FREE(self->neg_codecs);
- self->neg_codecs = neg_codecs;
- /* update remote offer */
- TSK_OBJECT_SAFE_FREE(self->M.ro);
- self->M.ro = tsk_object_ref((void*)m);
-
- return 0;
- }
- return -1;
+ tmedia_codecs_L_t* neg_codecs;
+
+ if((neg_codecs = tmedia_session_match_codec(self, m))) {
+ /* update negociated codecs */
+ TSK_OBJECT_SAFE_FREE(self->neg_codecs);
+ self->neg_codecs = neg_codecs;
+ /* update remote offer */
+ TSK_OBJECT_SAFE_FREE(self->M.ro);
+ self->M.ro = tsk_object_ref((void*)m);
+
+ return 0;
+ }
+ return -1;
}
/* ============ Msrp Session ================= */
int tmedia_session_dmsrp_set(tmedia_session_t* self, const tmedia_param_t* param)
{
- tmedia_session_dmsrp_t* dmsrp;
+ tmedia_session_dmsrp_t* dmsrp;
- dmsrp = (tmedia_session_dmsrp_t*)self;
+ dmsrp = (tmedia_session_dmsrp_t*)self;
- return 0;
+ return 0;
}
int tmedia_session_dmsrp_get(tmedia_session_t* self, tmedia_param_t* param)
{
- return 0;
+ return 0;
}
int tmedia_session_dmsrp_prepare(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
int tmedia_session_dmsrp_start(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
int tmedia_session_dmsrp_stop(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
int tmedia_session_dmsrp_pause(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
const tsdp_header_M_t* tmedia_session_dmsrp_get_lo(tmedia_session_t* self)
{
- if(self->ro_changed){
- TSK_OBJECT_SAFE_FREE(self->M.lo);
- }
+ if(self->ro_changed) {
+ TSK_OBJECT_SAFE_FREE(self->M.lo);
+ }
- return tsk_null;
+ return tsk_null;
}
int tmedia_session_dmsrp_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- return -1;
+ return -1;
}
//=================================================================================================
@@ -324,53 +324,51 @@ int tmedia_session_dmsrp_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m
/* constructor */
static tsk_object_t* tmedia_session_daudio_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_session_daudio_t *session = self;
- if(session){
- /* init base: called by tmedia_session_create() */
- /* init self */
- }
- return self;
+ tmedia_session_daudio_t *session = self;
+ if(session) {
+ /* init base: called by tmedia_session_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_session_daudio_dtor(tsk_object_t * self)
-{
- tmedia_session_daudio_t *session = self;
- if(session){
- /* deinit base */
- tmedia_session_deinit(self);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_session_daudio_t *session = self;
+ if(session) {
+ /* deinit base */
+ tmedia_session_deinit(self);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_session_daudio_def_s =
-{
- sizeof(tmedia_session_daudio_t),
- tmedia_session_daudio_ctor,
- tmedia_session_daudio_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tmedia_session_daudio_def_s = {
+ sizeof(tmedia_session_daudio_t),
+ tmedia_session_daudio_ctor,
+ tmedia_session_daudio_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tmedia_session_daudio_plugin_def_s =
-{
- &tmedia_session_daudio_def_s,
-
- tmedia_audio,
- "audio",
-
- tmedia_session_daudio_set,
- tmedia_session_daudio_get,
- tmedia_session_daudio_prepare,
- tmedia_session_daudio_start,
- tmedia_session_daudio_pause,
- tmedia_session_daudio_stop,
-
- /* Audio part */
- { tsk_null },
-
- tmedia_session_daudio_get_lo,
- tmedia_session_daudio_set_ro
+static const tmedia_session_plugin_def_t tmedia_session_daudio_plugin_def_s = {
+ &tmedia_session_daudio_def_s,
+
+ tmedia_audio,
+ "audio",
+
+ tmedia_session_daudio_set,
+ tmedia_session_daudio_get,
+ tmedia_session_daudio_prepare,
+ tmedia_session_daudio_start,
+ tmedia_session_daudio_pause,
+ tmedia_session_daudio_stop,
+
+ /* Audio part */
+ { tsk_null },
+
+ tmedia_session_daudio_get_lo,
+ tmedia_session_daudio_set_ro
};
const tmedia_session_plugin_def_t *tmedia_session_daudio_plugin_def_t = &tmedia_session_daudio_plugin_def_s;
@@ -381,53 +379,51 @@ const tmedia_session_plugin_def_t *tmedia_session_daudio_plugin_def_t = &tmedia_
/* constructor */
static tsk_object_t* tmedia_session_dvideo_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_session_dvideo_t *session = self;
- if(session){
- /* init base: called by tmedia_session_create() */
- /* init self */
- }
- return self;
+ tmedia_session_dvideo_t *session = self;
+ if(session) {
+ /* init base: called by tmedia_session_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_session_dvideo_dtor(tsk_object_t * self)
-{
- tmedia_session_dvideo_t *session = self;
- if(session){
- /* deinit base */
- tmedia_session_deinit(self);
- /* deinit self */
- }
-
- return self;
+{
+ tmedia_session_dvideo_t *session = self;
+ if(session) {
+ /* deinit base */
+ tmedia_session_deinit(self);
+ /* deinit self */
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_session_dvideo_def_s =
-{
- sizeof(tmedia_session_dvideo_t),
- tmedia_session_dvideo_ctor,
- tmedia_session_dvideo_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tmedia_session_dvideo_def_s = {
+ sizeof(tmedia_session_dvideo_t),
+ tmedia_session_dvideo_ctor,
+ tmedia_session_dvideo_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tmedia_session_dvideo_plugin_def_s =
-{
- &tmedia_session_dvideo_def_s,
-
- tmedia_video,
- "video",
-
- tmedia_session_dvideo_set,
- tmedia_session_dvideo_get,
- tmedia_session_dvideo_prepare,
- tmedia_session_dvideo_start,
- tmedia_session_dvideo_pause,
- tmedia_session_dvideo_stop,
-
- /* Audio part */
- { tsk_null },
-
- tmedia_session_dvideo_get_lo,
- tmedia_session_dvideo_set_ro
+static const tmedia_session_plugin_def_t tmedia_session_dvideo_plugin_def_s = {
+ &tmedia_session_dvideo_def_s,
+
+ tmedia_video,
+ "video",
+
+ tmedia_session_dvideo_set,
+ tmedia_session_dvideo_get,
+ tmedia_session_dvideo_prepare,
+ tmedia_session_dvideo_start,
+ tmedia_session_dvideo_pause,
+ tmedia_session_dvideo_stop,
+
+ /* Audio part */
+ { tsk_null },
+
+ tmedia_session_dvideo_get_lo,
+ tmedia_session_dvideo_set_ro
};
const tmedia_session_plugin_def_t *tmedia_session_dvideo_plugin_def_t = &tmedia_session_dvideo_plugin_def_s;
@@ -438,53 +434,51 @@ const tmedia_session_plugin_def_t *tmedia_session_dvideo_plugin_def_t = &tmedia_
/* constructor */
static tsk_object_t* tmedia_session_dmsrp_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_session_dmsrp_t *session = self;
- if(session){
- /* init base: called by tmedia_session_create() */
- /* init self */
- }
- return self;
+ tmedia_session_dmsrp_t *session = self;
+ if(session) {
+ /* init base: called by tmedia_session_create() */
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_session_dmsrp_dtor(tsk_object_t * self)
-{
- tmedia_session_dmsrp_t *session = self;
- if(session){
- /* deinit base */
- tmedia_session_deinit(self);
- /* deinit self */
+{
+ tmedia_session_dmsrp_t *session = self;
+ if(session) {
+ /* deinit base */
+ tmedia_session_deinit(self);
+ /* deinit self */
- }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_session_dmsrp_def_s =
-{
- sizeof(tmedia_session_dmsrp_t),
- tmedia_session_dmsrp_ctor,
- tmedia_session_dmsrp_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tmedia_session_dmsrp_def_s = {
+ sizeof(tmedia_session_dmsrp_t),
+ tmedia_session_dmsrp_ctor,
+ tmedia_session_dmsrp_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tmedia_session_dmsrp_plugin_def_s =
-{
- &tmedia_session_dmsrp_def_s,
-
- tmedia_msrp,
- "message",
-
- tmedia_session_dmsrp_set,
- tmedia_session_dmsrp_get,
- tmedia_session_dmsrp_prepare,
- tmedia_session_dmsrp_start,
- tmedia_session_dmsrp_pause,
- tmedia_session_dmsrp_stop,
-
- /* Audio part */
- { tsk_null },
-
- tmedia_session_dmsrp_get_lo,
- tmedia_session_dmsrp_set_ro
+static const tmedia_session_plugin_def_t tmedia_session_dmsrp_plugin_def_s = {
+ &tmedia_session_dmsrp_def_s,
+
+ tmedia_msrp,
+ "message",
+
+ tmedia_session_dmsrp_set,
+ tmedia_session_dmsrp_get,
+ tmedia_session_dmsrp_prepare,
+ tmedia_session_dmsrp_start,
+ tmedia_session_dmsrp_pause,
+ tmedia_session_dmsrp_stop,
+
+ /* Audio part */
+ { tsk_null },
+
+ tmedia_session_dmsrp_get_lo,
+ tmedia_session_dmsrp_set_ro
};
const tmedia_session_plugin_def_t *tmedia_session_dmsrp_plugin_def_t = &tmedia_session_dmsrp_plugin_def_s;
diff --git a/tinyMEDIA/src/tmedia_session_ghost.c b/tinyMEDIA/src/tmedia_session_ghost.c
index 7045e69..b6fb6cd 100755
--- a/tinyMEDIA/src/tmedia_session_ghost.c
+++ b/tinyMEDIA/src/tmedia_session_ghost.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,55 +36,55 @@
static int tmedia_session_ghost_prepare(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
static int tmedia_session_ghost_start(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
static int tmedia_session_ghost_stop(tmedia_session_t* self)
{
- TSK_DEBUG_INFO("tmedia_session_ghost_stop");
- return 0;
+ TSK_DEBUG_INFO("tmedia_session_ghost_stop");
+ return 0;
}
static int tmedia_session_ghost_pause(tmedia_session_t* self)
{
- return 0;
+ return 0;
}
static const tsdp_header_M_t* tmedia_session_ghost_get_lo(tmedia_session_t* self)
{
- tmedia_session_ghost_t* ghost;
-
- ghost = (tmedia_session_ghost_t*)self;
-
- if(self->M.lo){
- return self->M.lo;
- }
- else if(!(self->M.lo = tsdp_header_M_create(ghost->media, 0, ghost->proto ? ghost->proto: "RTP/AVP"))){
- TSK_DEBUG_ERROR("Failed to create lo");
- return tsk_null;
- }
-
- // add format
- if(!tsk_strnullORempty(ghost->first_format)){
- tsk_string_t* fmt = tsk_string_create(ghost->first_format);
- if(!self->M.lo->FMTs){
- self->M.lo->FMTs = tsk_list_create();
- }
- tsk_list_push_back_data(self->M.lo->FMTs, (void**)&fmt);
- TSK_OBJECT_SAFE_FREE(fmt);
- }
-
- return self->M.lo;
+ tmedia_session_ghost_t* ghost;
+
+ ghost = (tmedia_session_ghost_t*)self;
+
+ if(self->M.lo) {
+ return self->M.lo;
+ }
+ else if(!(self->M.lo = tsdp_header_M_create(ghost->media, 0, ghost->proto ? ghost->proto: "RTP/AVP"))) {
+ TSK_DEBUG_ERROR("Failed to create lo");
+ return tsk_null;
+ }
+
+ // add format
+ if(!tsk_strnullORempty(ghost->first_format)) {
+ tsk_string_t* fmt = tsk_string_create(ghost->first_format);
+ if(!self->M.lo->FMTs) {
+ self->M.lo->FMTs = tsk_list_create();
+ }
+ tsk_list_push_back_data(self->M.lo->FMTs, (void**)&fmt);
+ TSK_OBJECT_SAFE_FREE(fmt);
+ }
+
+ return self->M.lo;
}
static int tmedia_session_ghost_set_ro(tmedia_session_t* self, const tsdp_header_M_t* m)
{
- return 0;
+ return 0;
}
@@ -99,56 +99,54 @@ static int tmedia_session_ghost_set_ro(tmedia_session_t* self, const tsdp_header
/* constructor */
static tsk_object_t* tmedia_session_ghost_ctor(tsk_object_t * self, va_list * app)
{
- tmedia_session_ghost_t *session = self;
- if(session){
- /* init base */
- tmedia_session_init(TMEDIA_SESSION(session), tmedia_none);
- /* init self */
- }
- return self;
+ tmedia_session_ghost_t *session = self;
+ if(session) {
+ /* init base */
+ tmedia_session_init(TMEDIA_SESSION(session), tmedia_none);
+ /* init self */
+ }
+ return self;
}
/* destructor */
static tsk_object_t* tmedia_session_ghost_dtor(tsk_object_t * self)
-{
- tmedia_session_ghost_t *session = self;
- if(session){
- /* deinit base */
- tmedia_session_deinit(TMEDIA_SESSION(session));
- /* deinit self */
- TSK_FREE(session->media);
- TSK_FREE(session->proto);
- TSK_FREE(session->first_format);
- }
-
- return self;
+{
+ tmedia_session_ghost_t *session = self;
+ if(session) {
+ /* deinit base */
+ tmedia_session_deinit(TMEDIA_SESSION(session));
+ /* deinit self */
+ TSK_FREE(session->media);
+ TSK_FREE(session->proto);
+ TSK_FREE(session->first_format);
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t tmedia_session_ghost_def_s =
-{
- sizeof(tmedia_session_ghost_t),
- tmedia_session_ghost_ctor,
- tmedia_session_ghost_dtor,
- tmedia_session_cmp,
+static const tsk_object_def_t tmedia_session_ghost_def_s = {
+ sizeof(tmedia_session_ghost_t),
+ tmedia_session_ghost_ctor,
+ tmedia_session_ghost_dtor,
+ tmedia_session_cmp,
};
/* plugin definition*/
-static const tmedia_session_plugin_def_t tmedia_session_ghost_plugin_def_s =
-{
- &tmedia_session_ghost_def_s,
-
- tmedia_ghost,
- "ghost",
-
- tsk_null, /* set() */
- tsk_null, /* get() */
- tmedia_session_ghost_prepare,
- tmedia_session_ghost_start,
- tmedia_session_ghost_stop,
- tmedia_session_ghost_pause,
-
- /* Audio part */
- { tsk_null },
-
- tmedia_session_ghost_get_lo,
- tmedia_session_ghost_set_ro
+static const tmedia_session_plugin_def_t tmedia_session_ghost_plugin_def_s = {
+ &tmedia_session_ghost_def_s,
+
+ tmedia_ghost,
+ "ghost",
+
+ tsk_null, /* set() */
+ tsk_null, /* get() */
+ tmedia_session_ghost_prepare,
+ tmedia_session_ghost_start,
+ tmedia_session_ghost_stop,
+ tmedia_session_ghost_pause,
+
+ /* Audio part */
+ { tsk_null },
+
+ tmedia_session_ghost_get_lo,
+ tmedia_session_ghost_set_ro
};
const tmedia_session_plugin_def_t *tmedia_session_ghost_plugin_def_t = &tmedia_session_ghost_plugin_def_s;
diff --git a/tinyMEDIA/test/dummy.c b/tinyMEDIA/test/dummy.c
index 5874de5..e7ca8cd 100755
--- a/tinyMEDIA/test/dummy.c
+++ b/tinyMEDIA/test/dummy.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,73 +27,72 @@
int dummy_start(tmedia_t* self)
{
- dummy_t *dummy = DUMMY(self);
- TSK_DEBUG_INFO("dummy_start");
+ dummy_t *dummy = DUMMY(self);
+ TSK_DEBUG_INFO("dummy_start");
- return 0;
+ return 0;
}
int dummy_pause(tmedia_t* self)
{
- dummy_t *dummy = DUMMY(self);
- TSK_DEBUG_INFO("dummy_pause");
+ dummy_t *dummy = DUMMY(self);
+ TSK_DEBUG_INFO("dummy_pause");
- return 0;
+ return 0;
}
int dummy_stop(tmedia_t* self)
{
- dummy_t *dummy = DUMMY(self);
- TSK_DEBUG_INFO("dummy_stop");
-
- return 0;
+ dummy_t *dummy = DUMMY(self);
+ TSK_DEBUG_INFO("dummy_stop");
+
+ return 0;
}
const tsdp_header_M_t* dummy_get_local_offer(tmedia_t* self, va_list *app)
{
- dummy_t *dummy = DUMMY(self);
- const tsk_object_def_t* objdef;
- tsdp_header_t* header;
+ dummy_t *dummy = DUMMY(self);
+ const tsk_object_def_t* objdef;
+ tsdp_header_t* header;
- TSK_DEBUG_INFO("dummy_get_local_offer");
- while((objdef = va_arg(*app, const tsk_object_def_t*))){
- header = tsk_object_new_2(objdef, app);
+ TSK_DEBUG_INFO("dummy_get_local_offer");
+ while((objdef = va_arg(*app, const tsk_object_def_t*))) {
+ header = tsk_object_new_2(objdef, app);
- TSK_OBJECT_SAFE_FREE(header);
- }
+ TSK_OBJECT_SAFE_FREE(header);
+ }
- return tsk_null;
+ return tsk_null;
}
const tsdp_header_M_t* dummy_get_negotiated_offer(tmedia_t* self)
{
- dummy_t *dummy = DUMMY(self);
- TSK_DEBUG_INFO("dummy_get_negotiated_offer");
+ dummy_t *dummy = DUMMY(self);
+ TSK_DEBUG_INFO("dummy_get_negotiated_offer");
- return tsk_null;
+ return tsk_null;
}
int dummy_set_remote_offer(tmedia_t* self, const tsdp_message_t* offer)
{
- dummy_t *dummy = DUMMY(self);
- TSK_DEBUG_INFO("dummy_set_remote_offer");
+ dummy_t *dummy = DUMMY(self);
+ TSK_DEBUG_INFO("dummy_set_remote_offer");
- return 0;
+ return 0;
}
int dummy_perform(tmedia_t* self, tmedia_action_t action, const tsk_params_L_t* params)
{
- dummy_t *dummy = DUMMY(self);
-
- switch(action){
- case tma_dummy_say_hello:
- {
- TSK_DEBUG_INFO("dummy_perform (hello to \"%s\")", tsk_params_get_param_value(params, "to"));
- break;
- }
- }
-
- return 0;
+ dummy_t *dummy = DUMMY(self);
+
+ switch(action) {
+ case tma_dummy_say_hello: {
+ TSK_DEBUG_INFO("dummy_perform (hello to \"%s\")", tsk_params_get_param_value(params, "to"));
+ break;
+ }
+ }
+
+ return 0;
}
@@ -102,50 +101,48 @@ int dummy_perform(tmedia_t* self, tmedia_action_t action, const tsk_params_L_t*
//
static void* dummy_create(tsk_object_t *self, va_list * app)
{
- dummy_t *dummy = self;
- if(dummy)
- {
- // Parameters MUST appear in this order
- const char* name = va_arg(*app, const char*);
- const char* host = va_arg(*app, const char*);
- tnet_socket_type_t socket_type = va_arg(*app, tnet_socket_type_t);
-
- tmedia_init(TMEDIA(dummy), name);
-
- TMEDIA(dummy)->protocol = tsk_strdup("TCP/DUMMY");
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new dummy media.");
- }
- return self;
+ dummy_t *dummy = self;
+ if(dummy) {
+ // Parameters MUST appear in this order
+ const char* name = va_arg(*app, const char*);
+ const char* host = va_arg(*app, const char*);
+ tnet_socket_type_t socket_type = va_arg(*app, tnet_socket_type_t);
+
+ tmedia_init(TMEDIA(dummy), name);
+
+ TMEDIA(dummy)->protocol = tsk_strdup("TCP/DUMMY");
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new dummy media.");
+ }
+ return self;
}
static void* dummy_destroy(tsk_object_t *self)
{
- dummy_t *dummy = self;
- if(dummy){
- tmedia_deinit(TMEDIA(dummy));
- TSK_FREE(dummy->local_sdp);
- TSK_FREE(dummy->remote_sdp);
- TSK_FREE(dummy->negotiated_sdp);
- }
- else{
- TSK_DEBUG_ERROR("Null dummy media.");
- }
-
- return self;
+ dummy_t *dummy = self;
+ if(dummy) {
+ tmedia_deinit(TMEDIA(dummy));
+ TSK_FREE(dummy->local_sdp);
+ TSK_FREE(dummy->remote_sdp);
+ TSK_FREE(dummy->negotiated_sdp);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null dummy media.");
+ }
+
+ return self;
}
static int dummy_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t dummy_def_s =
-{
- sizeof(dummy_t),
- dummy_create,
- dummy_destroy,
- dummy_cmp
+static const tsk_object_def_t dummy_def_s = {
+ sizeof(dummy_t),
+ dummy_create,
+ dummy_destroy,
+ dummy_cmp
};
const tsk_object_def_t *dummy_def_t = &dummy_def_s;
@@ -153,21 +150,20 @@ const tsk_object_def_t *dummy_def_t = &dummy_def_s;
//========================================================
// Dummy media plugin definition
//
-static const tmedia_plugin_def_t dummy_plugin_def_s =
-{
- &dummy_def_s,
- "dummy plugin",
- "audio",
+static const tmedia_plugin_def_t dummy_plugin_def_s = {
+ &dummy_def_s,
+ "dummy plugin",
+ "audio",
- dummy_start,
- dummy_pause,
- dummy_stop,
+ dummy_start,
+ dummy_pause,
+ dummy_stop,
- dummy_get_local_offer,
- dummy_get_negotiated_offer,
- dummy_set_remote_offer,
+ dummy_get_local_offer,
+ dummy_get_negotiated_offer,
+ dummy_set_remote_offer,
- dummy_perform
+ dummy_perform
};
const tmedia_plugin_def_t *dummy_plugin_def_t = &dummy_plugin_def_s;
diff --git a/tinyMEDIA/test/dummy.h b/tinyMEDIA/test/dummy.h
index a916ea6..cb0d82e 100755
--- a/tinyMEDIA/test/dummy.h
+++ b/tinyMEDIA/test/dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,13 +26,12 @@
#define DUMMY(self) ((dummy_t*)(self))
-typedef struct dummy_s
-{
- TMED_DECLARE_MEDIA;
-
- char* local_sdp;
- char* remote_sdp;
- char* negotiated_sdp;
+typedef struct dummy_s {
+ TMED_DECLARE_MEDIA;
+
+ char* local_sdp;
+ char* remote_sdp;
+ char* negotiated_sdp;
}
dummy_t;
diff --git a/tinyMEDIA/test/test.c b/tinyMEDIA/test/test.c
index 759a96b..c11f2a0 100755
--- a/tinyMEDIA/test/test.c
+++ b/tinyMEDIA/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,78 +50,78 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- /* Register dummy plugins */
- test_register_dummy_plugins();
- /* Register content plugins */
- test_register_contents_plugins();
+ /* Register dummy plugins */
+ test_register_dummy_plugins();
+ /* Register content plugins */
+ test_register_contents_plugins();
- do {
+ do {
#if RUN_TEST_ALL || RUN_TEST_CODECS
- test_codecs();
+ test_codecs();
#endif
#if RUN_TEST_ALL || RUN_TEST_SESSIONS
- test_sessions();
+ test_sessions();
#endif
#if RUN_TEST_ALL || RUN_TEST_QOS
- test_qos();
+ test_qos();
#endif
#if RUN_TEST_ALL || RUN_TEST_IMAGEATTR
- test_qos_imageattr();
+ test_qos_imageattr();
#endif
#if RUN_TEST_ALL || RUN_TEST_CONTENTS
- test_contents();
+ test_contents();
#endif
-
- }
- while(RUN_TEST_LOOP);
-
- return 0;
+
+ }
+ while(RUN_TEST_LOOP);
+
+ return 0;
}
void test_register_contents_plugins()
{
- tmedia_content_plugin_register("text/html", tmedia_content_dummy_plugin_def_t);
- tmedia_content_plugin_register("text/plain", tmedia_content_dummy_plugin_def_t);
- tmedia_content_plugin_register("message/CPIM", tmedia_content_cpim_plugin_def_t);
+ tmedia_content_plugin_register("text/html", tmedia_content_dummy_plugin_def_t);
+ tmedia_content_plugin_register("text/plain", tmedia_content_dummy_plugin_def_t);
+ tmedia_content_plugin_register("message/CPIM", tmedia_content_cpim_plugin_def_t);
}
void test_register_dummy_plugins()
{
- int ret;
-
- /* === Sessions === */
- if((ret = tmedia_session_plugin_register(tmedia_session_daudio_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register audio plugin");
- }
- if((ret = tmedia_session_plugin_register(tmedia_session_dvideo_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register video plugin");
- }
- if((ret = tmedia_session_plugin_register(tmedia_session_dmsrp_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register msrp plugin");
- }
- if((ret = tmedia_session_plugin_register(tmedia_session_ghost_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register ghost plugin");
- }
-
- /* === Codecs === */
- if((ret = tmedia_codec_plugin_register(tmedia_codec_dpcma_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register G.711a plugin");
- }
- if((ret = tmedia_codec_plugin_register(tmedia_codec_dpcmu_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register G.711u plugin");
- }
- if((ret = tmedia_codec_plugin_register(tmedia_codec_dh263_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register H.263-1996 plugin");
- }
- if((ret = tmedia_codec_plugin_register(tmedia_codec_dh264_plugin_def_t))){
- TSK_DEBUG_ERROR("Failed to register H.264 (Base profile 10) plugin");
- }
+ int ret;
+
+ /* === Sessions === */
+ if((ret = tmedia_session_plugin_register(tmedia_session_daudio_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register audio plugin");
+ }
+ if((ret = tmedia_session_plugin_register(tmedia_session_dvideo_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register video plugin");
+ }
+ if((ret = tmedia_session_plugin_register(tmedia_session_dmsrp_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register msrp plugin");
+ }
+ if((ret = tmedia_session_plugin_register(tmedia_session_ghost_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register ghost plugin");
+ }
+
+ /* === Codecs === */
+ if((ret = tmedia_codec_plugin_register(tmedia_codec_dpcma_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register G.711a plugin");
+ }
+ if((ret = tmedia_codec_plugin_register(tmedia_codec_dpcmu_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register G.711u plugin");
+ }
+ if((ret = tmedia_codec_plugin_register(tmedia_codec_dh263_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register H.263-1996 plugin");
+ }
+ if((ret = tmedia_codec_plugin_register(tmedia_codec_dh264_plugin_def_t))) {
+ TSK_DEBUG_ERROR("Failed to register H.264 (Base profile 10) plugin");
+ }
}
//#ifdef _WIN32_WCE
@@ -133,23 +133,23 @@ void test_register_dummy_plugins()
// while(1)
// {
// tmedia_t* dummy = tsk_null;
-//
+//
// // Register dummy media
// tmedia_plugin_register(dummy_plugin_def_t);
// // ...if you have another one to register
// // ...and another
// // ...again and again
-//
+//
// // Create dummy media
// if((dummy = tmedia_factory_create("dummy plugin", "127.0.0.1", tnet_socket_type_udp_ipv4))){
//
// tmedia_get_local_offer(dummy,
// TSDP_HEADER_A_VA_ARGS("file-disposition", "attachment"),
-//
+//
// tsk_null
// );
// tmedia_get_negotiated_offer(dummy);
-// tmedia_set_remote_offer(dummy, tsk_null);
+// tmedia_set_remote_offer(dummy, tsk_null);
//
// tmedia_start(dummy);
// tmedia_pause(dummy);
@@ -160,11 +160,11 @@ void test_register_dummy_plugins()
// tsk_null);
//
// tmedia_stop(dummy);
-//
+//
// TSK_OBJECT_SAFE_FREE(dummy);
// }
// }
-//
+//
// return 0;
//}
diff --git a/tinyMEDIA/test/test_codecs.h b/tinyMEDIA/test/test_codecs.h
index 865953c..8fdb809 100755
--- a/tinyMEDIA/test/test_codecs.h
+++ b/tinyMEDIA/test/test_codecs.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,14 +24,14 @@
void test_codecs()
{
- tmedia_codec_t* pcmu, *pcma;
+ tmedia_codec_t* pcmu, *pcma;
- /* creates codecs */
- pcmu = tmedia_codec_create(TMEDIA_CODEC_FORMAT_G711u);
- pcma = tmedia_codec_create(TMEDIA_CODEC_FORMAT_G711a);
+ /* creates codecs */
+ pcmu = tmedia_codec_create(TMEDIA_CODEC_FORMAT_G711u);
+ pcma = tmedia_codec_create(TMEDIA_CODEC_FORMAT_G711a);
- TSK_OBJECT_SAFE_FREE(pcmu);
- TSK_OBJECT_SAFE_FREE(pcma);
+ TSK_OBJECT_SAFE_FREE(pcmu);
+ TSK_OBJECT_SAFE_FREE(pcma);
}
#endif /* _TEST_CODECS_H_ */
diff --git a/tinyMEDIA/test/test_contents.h b/tinyMEDIA/test/test_contents.h
index fe33797..abce61e 100755
--- a/tinyMEDIA/test/test_contents.h
+++ b/tinyMEDIA/test/test_contents.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,9 +28,9 @@ static void test_content_cpim();
static void test_contents()
{
- test_content_dummy();
- test_content_text_plain();
- test_content_cpim();
+ test_content_dummy();
+ test_content_text_plain();
+ test_content_cpim();
}
@@ -38,28 +38,28 @@ static void test_content_dummy()
{
#define CONTENT_DUMMY_DATA "salut"
#define CONTENT_DUMMY_TYPE "cool/ok"
- tmedia_content_t* content = tmedia_content_parse(CONTENT_DUMMY_DATA, tsk_strlen(CONTENT_DUMMY_DATA), CONTENT_DUMMY_TYPE);
- if(content){
- tsk_buffer_t* data = tmedia_content_get_data(content);
- TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
- tsk_object_unref(data);
- }
+ tmedia_content_t* content = tmedia_content_parse(CONTENT_DUMMY_DATA, tsk_strlen(CONTENT_DUMMY_DATA), CONTENT_DUMMY_TYPE);
+ if(content) {
+ tsk_buffer_t* data = tmedia_content_get_data(content);
+ TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
+ tsk_object_unref(data);
+ }
- TSK_OBJECT_SAFE_FREE(content);
+ TSK_OBJECT_SAFE_FREE(content);
}
static void test_content_text_plain()
{
#define CONTENT_TEXT_PLAIN_DATA "salut comment tu vas?"
#define CONTENT_TEXT_PLAIN_TYPE "text/plain"
- tmedia_content_t* content = tmedia_content_parse(CONTENT_TEXT_PLAIN_DATA, tsk_strlen(CONTENT_TEXT_PLAIN_DATA), CONTENT_TEXT_PLAIN_TYPE);
- if(content){
- tsk_buffer_t* data = tmedia_content_get_data(content);
- TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
- tsk_object_unref(data);
- }
+ tmedia_content_t* content = tmedia_content_parse(CONTENT_TEXT_PLAIN_DATA, tsk_strlen(CONTENT_TEXT_PLAIN_DATA), CONTENT_TEXT_PLAIN_TYPE);
+ if(content) {
+ tsk_buffer_t* data = tmedia_content_get_data(content);
+ TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
+ tsk_object_unref(data);
+ }
- TSK_OBJECT_SAFE_FREE(content);
+ TSK_OBJECT_SAFE_FREE(content);
}
static void test_content_cpim()
@@ -75,14 +75,14 @@ static void test_content_cpim()
"salut comment tu vas?\r\n"
#define CONTENT_CPIM_TYPE "message/CPIM"
- tmedia_content_t* content = tmedia_content_parse(CONTENT_CPIM_DATA, tsk_strlen(CONTENT_CPIM_DATA), CONTENT_CPIM_TYPE);
- if(content){
- tsk_buffer_t* data = tmedia_content_get_data(content);
- TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
- tsk_object_unref(data);
- }
+ tmedia_content_t* content = tmedia_content_parse(CONTENT_CPIM_DATA, tsk_strlen(CONTENT_CPIM_DATA), CONTENT_CPIM_TYPE);
+ if(content) {
+ tsk_buffer_t* data = tmedia_content_get_data(content);
+ TSK_DEBUG_INFO("content-type=%s\n\ncontent=%s", TMEDIA_CONTENT(content)->type, TSK_BUFFER_DATA(data));
+ tsk_object_unref(data);
+ }
- TSK_OBJECT_SAFE_FREE(content);
+ TSK_OBJECT_SAFE_FREE(content);
}
#endif /* _TEST_CONTENTS_H_ */
diff --git a/tinyMEDIA/test/test_image_attr.h b/tinyMEDIA/test/test_image_attr.h
index e91d25f..51dfe35 100755
--- a/tinyMEDIA/test/test_image_attr.h
+++ b/tinyMEDIA/test/test_image_attr.h
@@ -2,19 +2,19 @@
* Copyright (C) 20012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo[dot]fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,31 +22,30 @@
#ifndef _TEST_IMG_ATTR_H_
#define _TEST_IMG_ATTR_H_
-static const char* __test_imageattrs[] =
-{
- "send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]",
- "recv [x=800,y=640,sar=1.1] send [x=330,y=250]",
- "recv [x=800,y=640,sar=1.1] send [x=[320:16:640],y=[240:16:480],par=[1.2-1.3]]",
- "send [x=[480:16:800],y=[320:16:640],par=[1.2-1.3],q=0.6] [x=[176:8:208],y=[144:8:176],par=[1.2-1.3]] recv *",
- "send [x=176,y=144] [x=224,y=176] [x=272,y=224] [x=320,y=240] recv [x=176,y=144] [x=224,y=176] [x=272,y=224,q=0.6] [x=320,y=240]",
- "send [x=320,y=240]",
- "recv [x=320,y=240]",
- "send [x=[400:16:800],y=[320:16:640],sar=[1.0-1.3],par=[1.2-1.3]] recv [x=800,y=600,sar=1.1]",
- "recv [x=464,y=384,sar=1.15] send [x=800,y=600,sar=1.1]"
+static const char* __test_imageattrs[] = {
+ "send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]",
+ "recv [x=800,y=640,sar=1.1] send [x=330,y=250]",
+ "recv [x=800,y=640,sar=1.1] send [x=[320:16:640],y=[240:16:480],par=[1.2-1.3]]",
+ "send [x=[480:16:800],y=[320:16:640],par=[1.2-1.3],q=0.6] [x=[176:8:208],y=[144:8:176],par=[1.2-1.3]] recv *",
+ "send [x=176,y=144] [x=224,y=176] [x=272,y=224] [x=320,y=240] recv [x=176,y=144] [x=224,y=176] [x=272,y=224,q=0.6] [x=320,y=240]",
+ "send [x=320,y=240]",
+ "recv [x=320,y=240]",
+ "send [x=[400:16:800],y=[320:16:640],sar=[1.0-1.3],par=[1.2-1.3]] recv [x=800,y=600,sar=1.1]",
+ "recv [x=464,y=384,sar=1.15] send [x=800,y=600,sar=1.1]"
};
void test_qos_imageattr()
{
- tsk_size_t i;
- tmedia_imageattr_xt imageattr;
- for(i = 0; i < sizeof(__test_imageattrs)/sizeof(__test_imageattrs[0]); ++i){
- if(tmedia_imageattr_parse(&imageattr, __test_imageattrs[i], tsk_strlen(__test_imageattrs[i])) == 0){
- TSK_DEBUG_INFO("image-attr parsed (OK): %s", __test_imageattrs[i]);
- }
- else{
- TSK_DEBUG_ERROR("image-attr parsed (NOK): %s", __test_imageattrs[i]);
- }
- }
+ tsk_size_t i;
+ tmedia_imageattr_xt imageattr;
+ for(i = 0; i < sizeof(__test_imageattrs)/sizeof(__test_imageattrs[0]); ++i) {
+ if(tmedia_imageattr_parse(&imageattr, __test_imageattrs[i], tsk_strlen(__test_imageattrs[i])) == 0) {
+ TSK_DEBUG_INFO("image-attr parsed (OK): %s", __test_imageattrs[i]);
+ }
+ else {
+ TSK_DEBUG_ERROR("image-attr parsed (NOK): %s", __test_imageattrs[i]);
+ }
+ }
}
diff --git a/tinyMEDIA/test/test_qos.h b/tinyMEDIA/test/test_qos.h
index 3565cc2..b1c21ac 100755
--- a/tinyMEDIA/test/test_qos.h
+++ b/tinyMEDIA/test/test_qos.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,244 +24,244 @@
char* test_qos_tostring(const tmedia_qos_tline_t* tline)
{
- char* ret = tsk_null;
- tsdp_header_M_t* M;
-
- if(!tline){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- M = tsdp_header_M_create("audio", 20000, "RTP/AVP");
- tmedia_qos_tline_to_sdp(tline, M);
-
- ret = tsdp_header_tostring(TSDP_HEADER(M));
- TSK_OBJECT_SAFE_FREE(M);
-
- return ret;
+ char* ret = tsk_null;
+ tsdp_header_M_t* M;
+
+ if(!tline) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ M = tsdp_header_M_create("audio", 20000, "RTP/AVP");
+ tmedia_qos_tline_to_sdp(tline, M);
+
+ ret = tsdp_header_tostring(TSDP_HEADER(M));
+ TSK_OBJECT_SAFE_FREE(M);
+
+ return ret;
}
void test_qos_parser()
{
- tsdp_header_M_t* M;
- tmedia_qos_tline_e2e_t* e2e;
- tmedia_qos_tline_segmented_t* segmented;
- char* temp = tsk_null;
- tmedia_qos_stype_t type;
- tsk_bool_t canresume;
-
- /* test E2E */
- M = tsdp_header_M_create("audio", 20000, "RTP/AVP");
- e2e = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
- // to_sdp
- tmedia_qos_tline_e2e_to_sdp(e2e, M);
- if((type = tmedia_qos_get_type(M)) != tmedia_qos_stype_e2e){
- TSK_DEBUG_ERROR("Invalid type");
- }
- if((temp = tsdp_header_tostring(TSDP_HEADER(M)))){
- TSK_DEBUG_INFO("E2E to_sdp: %s", temp);
- TSK_FREE(temp);
- }
- // from_sdp
- TSK_OBJECT_SAFE_FREE(e2e);
- e2e = tmedia_qos_tline_e2e_from_sdp(M);
- canresume = tmedia_qos_tline_e2e_canresume(e2e);
- tmedia_qos_tline_e2e_to_sdp(e2e, M);
- if((temp = tsdp_header_tostring(TSDP_HEADER(M)))){
- TSK_DEBUG_INFO("e2e from_sdp: %s", temp);
- TSK_FREE(temp);
- }
-
-
- TSK_OBJECT_SAFE_FREE(e2e);
- TSK_OBJECT_SAFE_FREE(M);
-
- /* test Segmented */
- M = tsdp_header_M_create("video", 20002, "RTP/AVP");
- segmented = tmedia_qos_tline_segmented_create(tmedia_qos_strength_none);
- segmented->remote_send.strength = tmedia_qos_strength_optional;
- // to_sdp
- tmedia_qos_tline_segmented_to_sdp(segmented, M);
- if((type = tmedia_qos_get_type(M)) != tmedia_qos_stype_segmented){
- TSK_DEBUG_ERROR("Invalid type");
- }
- if((temp = tsdp_header_tostring(TSDP_HEADER(M)))){
- TSK_DEBUG_INFO("Segmented to_sdp: %s", temp);
- TSK_FREE(temp);
- }
- // from_sdp
- TSK_OBJECT_SAFE_FREE(segmented);
- segmented = tmedia_qos_tline_segmented_from_sdp(M);
- canresume = tmedia_qos_tline_segmented_canresume(segmented);
- tmedia_qos_tline_segmented_to_sdp(segmented, M);
- if((temp = tsdp_header_tostring(TSDP_HEADER(M)))){
- TSK_DEBUG_INFO("Segmented from_sdp: %s", temp);
- TSK_FREE(temp);
- }
-
-
-
- TSK_OBJECT_SAFE_FREE(segmented);
- TSK_OBJECT_SAFE_FREE(M);
+ tsdp_header_M_t* M;
+ tmedia_qos_tline_e2e_t* e2e;
+ tmedia_qos_tline_segmented_t* segmented;
+ char* temp = tsk_null;
+ tmedia_qos_stype_t type;
+ tsk_bool_t canresume;
+
+ /* test E2E */
+ M = tsdp_header_M_create("audio", 20000, "RTP/AVP");
+ e2e = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
+ // to_sdp
+ tmedia_qos_tline_e2e_to_sdp(e2e, M);
+ if((type = tmedia_qos_get_type(M)) != tmedia_qos_stype_e2e) {
+ TSK_DEBUG_ERROR("Invalid type");
+ }
+ if((temp = tsdp_header_tostring(TSDP_HEADER(M)))) {
+ TSK_DEBUG_INFO("E2E to_sdp: %s", temp);
+ TSK_FREE(temp);
+ }
+ // from_sdp
+ TSK_OBJECT_SAFE_FREE(e2e);
+ e2e = tmedia_qos_tline_e2e_from_sdp(M);
+ canresume = tmedia_qos_tline_e2e_canresume(e2e);
+ tmedia_qos_tline_e2e_to_sdp(e2e, M);
+ if((temp = tsdp_header_tostring(TSDP_HEADER(M)))) {
+ TSK_DEBUG_INFO("e2e from_sdp: %s", temp);
+ TSK_FREE(temp);
+ }
+
+
+ TSK_OBJECT_SAFE_FREE(e2e);
+ TSK_OBJECT_SAFE_FREE(M);
+
+ /* test Segmented */
+ M = tsdp_header_M_create("video", 20002, "RTP/AVP");
+ segmented = tmedia_qos_tline_segmented_create(tmedia_qos_strength_none);
+ segmented->remote_send.strength = tmedia_qos_strength_optional;
+ // to_sdp
+ tmedia_qos_tline_segmented_to_sdp(segmented, M);
+ if((type = tmedia_qos_get_type(M)) != tmedia_qos_stype_segmented) {
+ TSK_DEBUG_ERROR("Invalid type");
+ }
+ if((temp = tsdp_header_tostring(TSDP_HEADER(M)))) {
+ TSK_DEBUG_INFO("Segmented to_sdp: %s", temp);
+ TSK_FREE(temp);
+ }
+ // from_sdp
+ TSK_OBJECT_SAFE_FREE(segmented);
+ segmented = tmedia_qos_tline_segmented_from_sdp(M);
+ canresume = tmedia_qos_tline_segmented_canresume(segmented);
+ tmedia_qos_tline_segmented_to_sdp(segmented, M);
+ if((temp = tsdp_header_tostring(TSDP_HEADER(M)))) {
+ TSK_DEBUG_INFO("Segmented from_sdp: %s", temp);
+ TSK_FREE(temp);
+ }
+
+
+
+ TSK_OBJECT_SAFE_FREE(segmented);
+ TSK_OBJECT_SAFE_FREE(M);
}
void test_qos_e2e_neg()
{
- tmedia_qos_tline_e2e_t *e2eA = tsk_null, *e2eB = tsk_null;
- char* temp = tsk_null;
+ tmedia_qos_tline_e2e_t *e2eA = tsk_null, *e2eB = tsk_null;
+ char* temp = tsk_null;
- /* SDP1: A includes end-to-end quality of service preconditions in the
- initial offer.
+ /* SDP1: A includes end-to-end quality of service preconditions in the
+ initial offer.
- m=audio 20000 RTP/AVP 0
+ m=audio 20000 RTP/AVP 0
c=IN IP4 192.0.2.1
a=curr:qos e2e none
a=des:qos mandatory e2e sendrecv
- */
- e2eA = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))){
- TSK_DEBUG_INFO("SDP1=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* SDP2: Since B uses RSVP, it can know when resources in its "send"
- direction are available, because it will receive RESV messages from
- the network. However, it does not know the status of the
- reservations in the other direction. B requests confirmation for
- resource reservations in its "recv" direction to the peer user agent
- A in its answer.
-
- m=audio 30000 RTP/AVP 0
+ */
+ e2eA = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))) {
+ TSK_DEBUG_INFO("SDP1=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* SDP2: Since B uses RSVP, it can know when resources in its "send"
+ direction are available, because it will receive RESV messages from
+ the network. However, it does not know the status of the
+ reservations in the other direction. B requests confirmation for
+ resource reservations in its "recv" direction to the peer user agent
+ A in its answer.
+
+ m=audio 30000 RTP/AVP 0
c=IN IP4 192.0.2.4
a=curr:qos e2e none
a=des:qos mandatory e2e sendrecv
a=conf:qos e2e recv
- */
- e2eB = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
- tmedia_qos_tline_e2e_set_ro(e2eB, e2eA);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eB))){
- TSK_DEBUG_INFO("SDP2=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* SDP3: When A receives RESV messages, it sends an updated offer (5) to B:
-
- m=audio 20000 RTP/AVP 0
- c=IN IP4 192.0.2.1
- a=curr:qos e2e send
- a=des:qos mandatory e2e sendrecv
- */
- tmedia_qos_tline_e2e_set_ro(e2eA, e2eB);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))){
- TSK_DEBUG_INFO("SDP3=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* SDP4: B responds with an answer (6) which contains the current status
- of the resource reservation (i.e., sendrecv):
-
- m=audio 30000 RTP/AVP 0
- c=IN IP4 192.0.2.4
- a=curr:qos e2e sendrecv
- a=des:qos mandatory e2e sendrecv
- */
- tmedia_qos_tline_e2e_set_ro(e2eB, e2eA);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eB))){
- TSK_DEBUG_INFO("SDP4=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* A receive B's response */
- tmedia_qos_tline_e2e_set_ro(e2eA, e2eB);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))){
- TSK_DEBUG_INFO("SDP5=\n%s", temp);
- TSK_FREE(temp);
- }
-
- if(tmedia_qos_tline_e2e_canresume(e2eA)){
- TSK_DEBUG_INFO("A can resume");
- }
- else{
- TSK_DEBUG_ERROR("A can't resume");
- }
-
- if(tmedia_qos_tline_e2e_canresume(e2eB)){
- TSK_DEBUG_INFO("B can resume");
- }
- else{
- TSK_DEBUG_ERROR("B can't resume");
- }
-
- TSK_OBJECT_SAFE_FREE(e2eB);
- TSK_OBJECT_SAFE_FREE(e2eA);
+ */
+ e2eB = tmedia_qos_tline_e2e_create(tmedia_qos_strength_mandatory);
+ tmedia_qos_tline_e2e_set_ro(e2eB, e2eA);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eB))) {
+ TSK_DEBUG_INFO("SDP2=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* SDP3: When A receives RESV messages, it sends an updated offer (5) to B:
+
+ m=audio 20000 RTP/AVP 0
+ c=IN IP4 192.0.2.1
+ a=curr:qos e2e send
+ a=des:qos mandatory e2e sendrecv
+ */
+ tmedia_qos_tline_e2e_set_ro(e2eA, e2eB);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))) {
+ TSK_DEBUG_INFO("SDP3=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* SDP4: B responds with an answer (6) which contains the current status
+ of the resource reservation (i.e., sendrecv):
+
+ m=audio 30000 RTP/AVP 0
+ c=IN IP4 192.0.2.4
+ a=curr:qos e2e sendrecv
+ a=des:qos mandatory e2e sendrecv
+ */
+ tmedia_qos_tline_e2e_set_ro(e2eB, e2eA);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eB))) {
+ TSK_DEBUG_INFO("SDP4=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* A receive B's response */
+ tmedia_qos_tline_e2e_set_ro(e2eA, e2eB);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)e2eA))) {
+ TSK_DEBUG_INFO("SDP5=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ if(tmedia_qos_tline_e2e_canresume(e2eA)) {
+ TSK_DEBUG_INFO("A can resume");
+ }
+ else {
+ TSK_DEBUG_ERROR("A can't resume");
+ }
+
+ if(tmedia_qos_tline_e2e_canresume(e2eB)) {
+ TSK_DEBUG_INFO("B can resume");
+ }
+ else {
+ TSK_DEBUG_ERROR("B can't resume");
+ }
+
+ TSK_OBJECT_SAFE_FREE(e2eB);
+ TSK_OBJECT_SAFE_FREE(e2eA);
}
void test_qos_segmented_neg()
{
- tmedia_qos_tline_segmented_t *segA = tsk_null, *segB = tsk_null;
- char* temp = tsk_null;
-
- /* INVITE
- a=curr:qos local none
- a=curr:qos remote none
- a=des:qos mandatory local sendrecv
- a=des:qos mandatory remote sendrecv
- */
- segA = tmedia_qos_tline_segmented_create(tmedia_qos_strength_mandatory);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segA))){
- TSK_DEBUG_INFO("INVITE=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* 183 Sesson progress
- a=curr:qos local none
- a=curr:qos remote none
- a=des:qos mandatory local sendrecv
- a=des:qos mandatory remote sendrecv
- a=conf:qos remote sendrecv
- */
- segB = tmedia_qos_tline_segmented_create(tmedia_qos_strength_mandatory);
- tmedia_qos_tline_segmented_set_ro(segB, segA);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segB))){
- TSK_DEBUG_INFO("183=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* UPDATE
- a=curr:qos local sendrecv
- a=curr:qos remote none
- a=des:qos mandatory local sendrecv
- a=des:qos mandatory remote sendrecv
- */
- tmedia_qos_tline_segmented_set_ro(segA, segB);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segA))){
- TSK_DEBUG_INFO("UPDATE=\n%s", temp);
- TSK_FREE(temp);
- }
-
- /* 200 OK
- a=curr:qos local sendrecv
- a=curr:qos remote sendrecv
- a=des:qos mandatory local sendrecv
- a=des:qos mandatory remote sendrecv
- */
- tmedia_qos_tline_segmented_set_ro(segB, segA);
- if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segB))){
- TSK_DEBUG_INFO("200OK=\n%s", temp);
- TSK_FREE(temp);
- }
-
- TSK_OBJECT_SAFE_FREE(segA);
- TSK_OBJECT_SAFE_FREE(segB);
+ tmedia_qos_tline_segmented_t *segA = tsk_null, *segB = tsk_null;
+ char* temp = tsk_null;
+
+ /* INVITE
+ a=curr:qos local none
+ a=curr:qos remote none
+ a=des:qos mandatory local sendrecv
+ a=des:qos mandatory remote sendrecv
+ */
+ segA = tmedia_qos_tline_segmented_create(tmedia_qos_strength_mandatory);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segA))) {
+ TSK_DEBUG_INFO("INVITE=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* 183 Sesson progress
+ a=curr:qos local none
+ a=curr:qos remote none
+ a=des:qos mandatory local sendrecv
+ a=des:qos mandatory remote sendrecv
+ a=conf:qos remote sendrecv
+ */
+ segB = tmedia_qos_tline_segmented_create(tmedia_qos_strength_mandatory);
+ tmedia_qos_tline_segmented_set_ro(segB, segA);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segB))) {
+ TSK_DEBUG_INFO("183=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* UPDATE
+ a=curr:qos local sendrecv
+ a=curr:qos remote none
+ a=des:qos mandatory local sendrecv
+ a=des:qos mandatory remote sendrecv
+ */
+ tmedia_qos_tline_segmented_set_ro(segA, segB);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segA))) {
+ TSK_DEBUG_INFO("UPDATE=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* 200 OK
+ a=curr:qos local sendrecv
+ a=curr:qos remote sendrecv
+ a=des:qos mandatory local sendrecv
+ a=des:qos mandatory remote sendrecv
+ */
+ tmedia_qos_tline_segmented_set_ro(segB, segA);
+ if((temp = test_qos_tostring((const tmedia_qos_tline_t*)segB))) {
+ TSK_DEBUG_INFO("200OK=\n%s", temp);
+ TSK_FREE(temp);
+ }
+
+ TSK_OBJECT_SAFE_FREE(segA);
+ TSK_OBJECT_SAFE_FREE(segB);
}
void test_qos()
{
- //test_qos_parser();
- //test_qos_e2e_neg();
- test_qos_segmented_neg();
+ //test_qos_parser();
+ //test_qos_e2e_neg();
+ test_qos_segmented_neg();
}
#endif /* _TEST_QOS_H_ */
diff --git a/tinyMEDIA/test/test_sessions.h b/tinyMEDIA/test/test_sessions.h
index 97f5d56..bb39fd7 100755
--- a/tinyMEDIA/test/test_sessions.h
+++ b/tinyMEDIA/test/test_sessions.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -71,176 +71,176 @@
void test_sessions_client()
{
- tmedia_session_mgr_t* mgr;
- const tsdp_message_t* sdp_lo;
- tsdp_message_t* sdp_ro;
- char* temp;
- tsk_bool_t canresume;
- tmedia_type_t media_type = (tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38);
-
- int32_t width = 176;
- int64_t height = 144LL;
-
-
- /* create manager */
- mgr = tmedia_session_mgr_create((tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38),
- "0.0.0.0", tsk_false, tsk_true);
- tmedia_session_mgr_set_qos(mgr, tmedia_qos_stype_segmented, tmedia_qos_strength_mandatory);
-
- tmedia_session_mgr_set(mgr,
- TMEDIA_SESSION_VIDEO_SET_INT32("width", width),
- TMEDIA_SESSION_VIDEO_SET_INT64("height", height),
- TMEDIA_SESSION_VIDEO_SET_STR("description", "This is my session"),
- TMEDIA_SESSION_AUDIO_SET_INT32("rate", "8000"),
- TMEDIA_SESSION_SET_STR(tmedia_audio | tmedia_video, "hello", "world"),
- TMEDIA_SESSION_SET_NULL());
-
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- /* set ro */
- if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
- tmedia_session_mgr_set_ro(mgr, sdp_ro);
- TSK_OBJECT_SAFE_FREE(sdp_ro);
- }
-
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- tmedia_session_mgr_start(mgr);
-
- canresume = tmedia_session_mgr_canresume(mgr);
-
- TSK_OBJECT_SAFE_FREE(mgr);
+ tmedia_session_mgr_t* mgr;
+ const tsdp_message_t* sdp_lo;
+ tsdp_message_t* sdp_ro;
+ char* temp;
+ tsk_bool_t canresume;
+ tmedia_type_t media_type = (tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38);
+
+ int32_t width = 176;
+ int64_t height = 144LL;
+
+
+ /* create manager */
+ mgr = tmedia_session_mgr_create((tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38),
+ "0.0.0.0", tsk_false, tsk_true);
+ tmedia_session_mgr_set_qos(mgr, tmedia_qos_stype_segmented, tmedia_qos_strength_mandatory);
+
+ tmedia_session_mgr_set(mgr,
+ TMEDIA_SESSION_VIDEO_SET_INT32("width", width),
+ TMEDIA_SESSION_VIDEO_SET_INT64("height", height),
+ TMEDIA_SESSION_VIDEO_SET_STR("description", "This is my session"),
+ TMEDIA_SESSION_AUDIO_SET_INT32("rate", "8000"),
+ TMEDIA_SESSION_SET_STR(tmedia_audio | tmedia_video, "hello", "world"),
+ TMEDIA_SESSION_SET_NULL());
+
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* set ro */
+ if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))) {
+ tmedia_session_mgr_set_ro(mgr, sdp_ro);
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
+ }
+
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ tmedia_session_mgr_start(mgr);
+
+ canresume = tmedia_session_mgr_canresume(mgr);
+
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions_server()
{
- tmedia_session_mgr_t* mgr = tsk_null;
- const tsdp_message_t* sdp_lo;
- tsdp_message_t* sdp_ro = tsk_null;
- char* temp;
- tmedia_type_t type;
-
- /* parse ro */
- if(!(sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
- TSK_DEBUG_ERROR("Failed to parse ro");
- return;
- }
- else{
- /* get ro media type */
- type = tmedia_type_from_sdp(sdp_ro);
- }
-
- /* create manager */
- mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_false);
-
- /* set ro */
- tmedia_session_mgr_set_ro(mgr, sdp_ro);
-
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- TSK_OBJECT_SAFE_FREE(sdp_ro);
- TSK_OBJECT_SAFE_FREE(mgr);
+ tmedia_session_mgr_t* mgr = tsk_null;
+ const tsdp_message_t* sdp_lo;
+ tsdp_message_t* sdp_ro = tsk_null;
+ char* temp;
+ tmedia_type_t type;
+
+ /* parse ro */
+ if(!(sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))) {
+ TSK_DEBUG_ERROR("Failed to parse ro");
+ return;
+ }
+ else {
+ /* get ro media type */
+ type = tmedia_type_from_sdp(sdp_ro);
+ }
+
+ /* create manager */
+ mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_false);
+
+ /* set ro */
+ tmedia_session_mgr_set_ro(mgr, sdp_ro);
+
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions_hold_resume()
{
- tmedia_session_mgr_t* mgr;
- const tsdp_message_t* sdp_lo;
- char* temp;
- tmedia_type_t type = tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38;
-
- /* create manager */
- mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_true);
-
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- /* hold */
- tmedia_session_mgr_hold(mgr, type);
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo(hold)=%s", temp);
- TSK_FREE(temp);
- }
- TSK_DEBUG_INFO("Hold local=%s and remote=%s",
- tmedia_session_mgr_is_held(mgr, type, tsk_true) ? "yes" : "no",
- tmedia_session_mgr_is_held(mgr, type, tsk_false) ? "yes" : "no"
- );
-
- /* resume */
- tmedia_session_mgr_resume(mgr, type, tsk_true);
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo(resume)=%s", temp);
- TSK_FREE(temp);
- }
- TSK_DEBUG_INFO("Hold local=%s and remote=%s",
- tmedia_session_mgr_is_held(mgr, type, tsk_true) ? "yes" : "no",
- tmedia_session_mgr_is_held(mgr, type, tsk_false) ? "yes" : "no"
- );
-
- TSK_OBJECT_SAFE_FREE(mgr);
+ tmedia_session_mgr_t* mgr;
+ const tsdp_message_t* sdp_lo;
+ char* temp;
+ tmedia_type_t type = tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38;
+
+ /* create manager */
+ mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_true);
+
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ /* hold */
+ tmedia_session_mgr_hold(mgr, type);
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo(hold)=%s", temp);
+ TSK_FREE(temp);
+ }
+ TSK_DEBUG_INFO("Hold local=%s and remote=%s",
+ tmedia_session_mgr_is_held(mgr, type, tsk_true) ? "yes" : "no",
+ tmedia_session_mgr_is_held(mgr, type, tsk_false) ? "yes" : "no"
+ );
+
+ /* resume */
+ tmedia_session_mgr_resume(mgr, type, tsk_true);
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo(resume)=%s", temp);
+ TSK_FREE(temp);
+ }
+ TSK_DEBUG_INFO("Hold local=%s and remote=%s",
+ tmedia_session_mgr_is_held(mgr, type, tsk_true) ? "yes" : "no",
+ tmedia_session_mgr_is_held(mgr, type, tsk_false) ? "yes" : "no"
+ );
+
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions_add_remove()
{
- tmedia_session_mgr_t* mgr = tsk_null;
- const tsdp_message_t* sdp_lo;
- tsdp_message_t* sdp_ro = tsk_null;
- char* temp;
- tmedia_type_t type;
-
- /* parse ro */
- if(!(sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
- TSK_DEBUG_ERROR("Failed to parse ro");
- return;
- }
- else{
- /* get ro media type */
- type = tmedia_type_from_sdp(sdp_ro);
- }
-
- /* create manager */
- mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_false);
-
- /* set ro */
- tmedia_session_mgr_set_ro(mgr, sdp_ro);
-
- /* get lo */
- sdp_lo = tmedia_session_mgr_get_lo(mgr);
- if((temp = tsdp_message_tostring(sdp_lo))){
- TSK_DEBUG_INFO("sdp_lo=%s", temp);
- TSK_FREE(temp);
- }
-
- TSK_OBJECT_SAFE_FREE(sdp_ro);
- TSK_OBJECT_SAFE_FREE(mgr);
+ tmedia_session_mgr_t* mgr = tsk_null;
+ const tsdp_message_t* sdp_lo;
+ tsdp_message_t* sdp_ro = tsk_null;
+ char* temp;
+ tmedia_type_t type;
+
+ /* parse ro */
+ if(!(sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))) {
+ TSK_DEBUG_ERROR("Failed to parse ro");
+ return;
+ }
+ else {
+ /* get ro media type */
+ type = tmedia_type_from_sdp(sdp_ro);
+ }
+
+ /* create manager */
+ mgr = tmedia_session_mgr_create(type, "192.168.16.82", tsk_false, tsk_false);
+
+ /* set ro */
+ tmedia_session_mgr_set_ro(mgr, sdp_ro);
+
+ /* get lo */
+ sdp_lo = tmedia_session_mgr_get_lo(mgr);
+ if((temp = tsdp_message_tostring(sdp_lo))) {
+ TSK_DEBUG_INFO("sdp_lo=%s", temp);
+ TSK_FREE(temp);
+ }
+
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
+ TSK_OBJECT_SAFE_FREE(mgr);
}
void test_sessions()
{
- test_sessions_client();
- //test_sessions_server();
- //test_sessions_hold_resume();
+ test_sessions_client();
+ //test_sessions_server();
+ //test_sessions_hold_resume();
}
#endif /* _TEST_SESSIONS_H_ */
diff --git a/tinyMSRP/include/tinymsrp.h b/tinyMSRP/include/tinymsrp.h
index 5c707d0..768aec0 100755
--- a/tinyMSRP/include/tinymsrp.h
+++ b/tinyMSRP/include/tinymsrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header.h
index ad574a4..20bf236 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,34 +49,32 @@ typedef int (*tmsrp_header_value_tostring_f)(const struct tmsrp_header_s* header
*
* @brief List of all supported headers.
**/
-typedef enum tmsrp_header_type_e
-{
- tmsrp_htype_Authentication_Info,
- tmsrp_htype_Authorization,
- tmsrp_htype_Byte_Range,
- tmsrp_htype_Content_Type,
- tmsrp_htype_Dummy,
- tmsrp_htype_Expires,
- tmsrp_htype_Failure_Report,
- tmsrp_htype_From_Path,
- tmsrp_htype_Max_Expires,
- tmsrp_htype_Message_ID,
- tmsrp_htype_Min_Expires,
- tmsrp_htype_Status,
- tmsrp_htype_Success_Report,
- tmsrp_htype_To_Path,
- tmsrp_htype_Use_Path,
- tmsrp_htype_WWW_Authenticate
+typedef enum tmsrp_header_type_e {
+ tmsrp_htype_Authentication_Info,
+ tmsrp_htype_Authorization,
+ tmsrp_htype_Byte_Range,
+ tmsrp_htype_Content_Type,
+ tmsrp_htype_Dummy,
+ tmsrp_htype_Expires,
+ tmsrp_htype_Failure_Report,
+ tmsrp_htype_From_Path,
+ tmsrp_htype_Max_Expires,
+ tmsrp_htype_Message_ID,
+ tmsrp_htype_Min_Expires,
+ tmsrp_htype_Status,
+ tmsrp_htype_Success_Report,
+ tmsrp_htype_To_Path,
+ tmsrp_htype_Use_Path,
+ tmsrp_htype_WWW_Authenticate
}
tmsrp_header_type_t;
/*================================
*/
-typedef struct tmsrp_header_s
-{
- TSK_DECLARE_OBJECT;
- tmsrp_header_type_t type;
- tmsrp_header_value_tostring_f tostring;
+typedef struct tmsrp_header_s {
+ TSK_DECLARE_OBJECT;
+ tmsrp_header_type_t type;
+ tmsrp_header_value_tostring_f tostring;
}
tmsrp_header_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Authorization.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Authorization.h
index f671129..6340b9a 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Authorization.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Authorization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,7 +36,7 @@
TMSRP_BEGIN_DECLS
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP header 'Authorization' as per RFC 3261 subclause .
///
@@ -56,34 +56,33 @@ TMSRP_BEGIN_DECLS
/// dresponse = "response" EQUAL request-digest
/// request-digest = LDQUOT 32LHEX RDQUOT
/// auth-request-uri = not-defined
-///
+///
/// auth-param = auth-param-name EQUAL ( token / quoted-string )
/// auth-param-name = token
-///
+///
/// other-response = auth-scheme LWS auth-param *(COMMA auth-param)
/// auth-scheme = token
/// auts = "auts" EQUAL auts-param
/// auts-param = LDQUOT auts-value RDQUOT
/// auts-value = <base64 encoding of AUTS>
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Authorization_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Authorization_s {
+ TMSRP_DECLARE_HEADER;
- char* scheme;
- char* username;
- char* realm;
- char* nonce;
- char* uri;
- char* response;
- char* algorithm;
- char* cnonce;
- char* opaque;
- char* qop;
- char* nc;
+ char* scheme;
+ char* username;
+ char* realm;
+ char* nonce;
+ char* uri;
+ char* response;
+ char* algorithm;
+ char* cnonce;
+ char* opaque;
+ char* qop;
+ char* nc;
- tsk_params_L_t *params;
+ tsk_params_L_t *params;
}
tmsrp_header_Authorization_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Byte-Range.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Byte-Range.h
index f3db0e2..7612d31 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Byte-Range.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Byte-Range.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,23 +40,22 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_BYTE_RANGE_IS_VALID(self) ((self) && (self)->start > 0 && (self)->end > 0 && (self)->end > (self)->start)
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Byte-Range' header.
///
/// @par ABNF : Byte-Range = "Byte-Range:" SP range-start "-" range-end "/" total
/// range-start = 1*DIGIT
/// range-end = 1*DIGIT / "*"
-/// total = 1*DIGIT / "*"
+/// total = 1*DIGIT / "*"
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Byte_Range_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Byte_Range_s {
+ TMSRP_DECLARE_HEADER;
- int64_t start;
- int64_t end;
- int64_t total;
+ int64_t start;
+ int64_t end;
+ int64_t total;
}
tmsrp_header_Byte_Range_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Content-Type.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Content-Type.h
index 465bb80..9c8cfcd 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Content-Type.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Content-Type.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(type) tmsrp_header_Content_Type_def_t, (const char*)type
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP header 'Content-Type'.
/// @author Mamadou
@@ -50,15 +50,14 @@ TMSRP_BEGIN_DECLS
/// subtype = token
/// gen-param = pname [ "=" pval ]
/// pname = token
-/// pval = token / quoted-string
-///
+/// pval = token / quoted-string
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Content_Type_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Content_Type_s {
+ TMSRP_DECLARE_HEADER;
- char* value;
- tsk_params_L_t *params;
+ char* value;
+ tsk_params_L_t *params;
}
tmsrp_header_Content_Type_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Dummy.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Dummy.h
index 6c01856..d813487 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Dummy.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,19 +38,18 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_DUMMY_VA_ARGS(name, value) tmsrp_header_Dummy_def_t, (const char*)name, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP Dummy header.
///
/// @par ABNF : hname ":" SP hval CRLF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Dummy_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Dummy_s {
+ TMSRP_DECLARE_HEADER;
- char *name;
- char *value;
+ char *name;
+ char *value;
}
tmsrp_header_Dummy_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Expires.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Expires.h
index de715d7..565a1ba 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Expires.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_EXPIRES_VA_ARGS(value) tmsrp_header_Expires_def_t, (int64_t)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Expires' header.
///
/// @par ABNF : Expires = "Expires:" SP 1*DIGIT
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Expires_s
-{
- TMSRP_DECLARE_HEADER;
-
- int64_t value;
+typedef struct tmsrp_header_Expires_s {
+ TMSRP_DECLARE_HEADER;
+
+ int64_t value;
}
tmsrp_header_Expires_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Failure-Report.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Failure-Report.h
index 04360e8..b39b2ed 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Failure-Report.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Failure-Report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,26 +39,24 @@ TMSRP_BEGIN_DECLS
/** Failure report type;
*/
-typedef enum tmsrp_freport_type_e
-{
- freport_yes,
- freport_no,
- freport_partial
+typedef enum tmsrp_freport_type_e {
+ freport_yes,
+ freport_no,
+ freport_partial
}
tmsrp_freport_type_t;
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Failure-Report' header.
///
-/// @par ABNF : "Failure-Report:" ( "yes" / "no" / "partial" )
+/// @par ABNF : "Failure-Report:" ( "yes" / "no" / "partial" )
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Failure_Report_s
-{
- TMSRP_DECLARE_HEADER;
- tmsrp_freport_type_t type;
+typedef struct tmsrp_header_Failure_Report_s {
+ TMSRP_DECLARE_HEADER;
+ tmsrp_freport_type_t type;
}
tmsrp_header_Failure_Report_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_From-Path.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_From-Path.h
index cc994aa..7998eed 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_From-Path.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_From-Path.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,19 +40,18 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_FROM_PATH_VA_ARGS(uri) tmsrp_header_From_Path_def_t, (const tmsrp_uri_t*)uri
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'From-Path' header.
///
/// @par ABNF : "To-Path:" SP MSRP-URI *( SP MSRP-URI )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_From_Path_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_From_Path_s {
+ TMSRP_DECLARE_HEADER;
- tmsrp_uri_t *uri;
- tmsrp_uris_L_t *otherURIs;
+ tmsrp_uri_t *uri;
+ tmsrp_uris_L_t *otherURIs;
}
tmsrp_header_From_Path_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Max-Expires.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Max-Expires.h
index 07c0adf..c990c12 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Max-Expires.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Max-Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_MAX_EXPIRES_VA_ARGS(value) tmsrp_header_Max_Expires_def_t, (int64_t)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Max-Expires' header.
///
/// @par ABNF : Max-Expires = "Max-Expires:" SP 1*DIGIT
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Max_Expires_s
-{
- TMSRP_DECLARE_HEADER;
-
- int64_t value;
+typedef struct tmsrp_header_Max_Expires_s {
+ TMSRP_DECLARE_HEADER;
+
+ int64_t value;
}
tmsrp_header_Max_Expires_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Message-ID.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Message-ID.h
index 4862d58..8b9078a 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Message-ID.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Message-ID.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_MESSAGE_ID_VA_ARGS(value) tmsrp_header_Message_ID_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Message-Id' header.
///
@@ -47,11 +47,10 @@ TMSRP_BEGIN_DECLS
/// ident-char = ALPHANUM / "." / "-" / "+" / "%" / "="
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Message_ID_s
-{
- TMSRP_DECLARE_HEADER;
-
- char *value;
+typedef struct tmsrp_header_Message_ID_s {
+ TMSRP_DECLARE_HEADER;
+
+ char *value;
}
tmsrp_header_Message_ID_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Min-Expires.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Min-Expires.h
index 7607d71..5c07f44 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Min-Expires.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Min-Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_MIN_EXPIRES_VA_ARGS(value) tmsrp_header_Min_Expires_def_t, (int64_t)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Min-Expires' header.
///
/// @par ABNF : Min-Expires = "Min-Expires:" SP 1*DIGIT
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Min_Expires_s
-{
- TMSRP_DECLARE_HEADER;
-
- int64_t value;
+typedef struct tmsrp_header_Min_Expires_s {
+ TMSRP_DECLARE_HEADER;
+
+ int64_t value;
}
tmsrp_header_Min_Expires_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Status.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Status.h
index f571a69..d992b68 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Status.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Status.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,22 +38,21 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_STATUS_VA_ARGS(namespace, code, reason) tmsrp_header_Status_def_t, (short)namespace, (short)code, (const char*)reason
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Status' header.
///
/// @par ABNF : Status = "Status:" SP namespace SP status-code [SP text-reason]
/// namespace = 3(DIGIT) ; "000" for all codes defined in RFC 4975
-/// text-reason = utf8text
+/// text-reason = utf8text
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Status_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Status_s {
+ TMSRP_DECLARE_HEADER;
- short _namespace;
- short code;
- char* reason;
+ short _namespace;
+ short code;
+ char* reason;
}
tmsrp_header_Status_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Success-Report.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Success-Report.h
index 4b79372..19f58a2 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Success-Report.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Success-Report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,17 +38,16 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_SUCCESS_REPORT_VA_ARGS(isSuccess) tmsrp_header_Success_Report_def_t, (tsk_bool_t)isSuccess
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Success-Report' header.
///
/// @par ABNF : "Success-Report:" ( "yes" / "no" )
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Success_Report_s
-{
- TMSRP_DECLARE_HEADER;
- unsigned yes:1;
+typedef struct tmsrp_header_Success_Report_s {
+ TMSRP_DECLARE_HEADER;
+ unsigned yes:1;
}
tmsrp_header_Success_Report_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_To-Path.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_To-Path.h
index 59e0c56..0f4b967 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_To-Path.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_To-Path.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,19 +40,18 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_TO_PATH_VA_ARGS(uri) tmsrp_header_To_Path_def_t, (const tmsrp_uri_t*)uri
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'To-Path' header.
///
/// @par ABNF : "To-Path:" SP MSRP-URI *( SP MSRP-URI )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_To_Path_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_To_Path_s {
+ TMSRP_DECLARE_HEADER;
- tmsrp_uri_t *uri;
- tmsrp_uris_L_t *otherURIs;
+ tmsrp_uri_t *uri;
+ tmsrp_uris_L_t *otherURIs;
}
tmsrp_header_To_Path_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Use-Path.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Use-Path.h
index b819724..2c9237e 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Use-Path.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_Use-Path.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,19 +40,18 @@ TMSRP_BEGIN_DECLS
#define TMSRP_HEADER_USE_PATH_VA_ARGS(uri) tmsrp_header_Use_Path_def_t, (const tmsrp_uri_t*)uri
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP 'Use-Path' header.
///
/// @par ABNF : "Use-Path:" SP MSRP-URI *( SP MSRP-URI )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_Use_Path_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_Use_Path_s {
+ TMSRP_DECLARE_HEADER;
- tmsrp_uri_t *uri;
- tmsrp_uris_L_t *otherURIs;
+ tmsrp_uri_t *uri;
+ tmsrp_uris_L_t *otherURIs;
}
tmsrp_header_Use_Path_t;
diff --git a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_WWW-Authenticate.h b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_WWW-Authenticate.h
index d620928..6d4cfc8 100755
--- a/tinyMSRP/include/tinymsrp/headers/tmsrp_header_WWW-Authenticate.h
+++ b/tinyMSRP/include/tinymsrp/headers/tmsrp_header_WWW-Authenticate.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,7 +37,7 @@ TMSRP_BEGIN_DECLS
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief MSRP header 'WWW-Authenticate'.
///
@@ -53,22 +53,21 @@ TMSRP_BEGIN_DECLS
/// stale = "stale" EQUAL ( "true" / "false" )
/// qop-options = "qop" EQUAL LDQUOT qop-value *("," qop-value) RDQUOT
/// qop-value = "auth" / "auth-int" / token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tmsrp_header_WWW_Authenticate_s
-{
- TMSRP_DECLARE_HEADER;
+typedef struct tmsrp_header_WWW_Authenticate_s {
+ TMSRP_DECLARE_HEADER;
- char* scheme;
- char* realm;
- char* domain;
- char* nonce;
- char* opaque;
- unsigned stale:1;
- char* algorithm;
- char* qop;
+ char* scheme;
+ char* realm;
+ char* domain;
+ char* nonce;
+ char* opaque;
+ unsigned stale:1;
+ char* algorithm;
+ char* qop;
- tsk_params_L_t* params;
+ tsk_params_L_t* params;
}
tmsrp_header_WWW_Authenticate_t;
diff --git a/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_message.h b/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_message.h
index c6ef41d..e287b8a 100755
--- a/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_message.h
+++ b/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_uri.h b/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_uri.h
index f0cfdf2..937c885 100755
--- a/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_uri.h
+++ b/tinyMSRP/include/tinymsrp/parsers/tmsrp_parser_uri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_config.h b/tinyMSRP/include/tinymsrp/session/tmsrp_config.h
index 48472b2..f9bbe8b 100755
--- a/tinyMSRP/include/tinymsrp/session/tmsrp_config.h
+++ b/tinyMSRP/include/tinymsrp/session/tmsrp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,16 +43,15 @@ TMSRP_BEGIN_DECLS
# define TMSRP_MAX_CHUNK_SIZE 2048
#endif
-typedef struct tmsrp_config_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmsrp_config_s {
+ TSK_DECLARE_OBJECT;
- tmsrp_header_To_Path_t* To_Path;
- tmsrp_header_From_Path_t* From_Path;
+ tmsrp_header_To_Path_t* To_Path;
+ tmsrp_header_From_Path_t* From_Path;
- tsk_bool_t Failure_Report;
- tsk_bool_t Success_Report;
- tsk_bool_t OMA_Final_Report;
+ tsk_bool_t Failure_Report;
+ tsk_bool_t Success_Report;
+ tsk_bool_t OMA_Final_Report;
}
tmsrp_config_t;
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_data.h b/tinyMSRP/include/tinymsrp/session/tmsrp_data.h
index c24cdd8..2868d32 100755
--- a/tinyMSRP/include/tinymsrp/session/tmsrp_data.h
+++ b/tinyMSRP/include/tinymsrp/session/tmsrp_data.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,40 +42,37 @@ TMSRP_BEGIN_DECLS
#define TMSRP_DATA_IS_OUTGOING(self) (TMSRP_DATA(self)->outgoing)
-typedef struct tmsrp_data_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t outgoing;
- tsk_bool_t isOK;
-
- char* id;
- char* ctype;
- char* wctype;
+typedef struct tmsrp_data_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t outgoing;
+ tsk_bool_t isOK;
+
+ char* id;
+ char* ctype;
+ char* wctype;
}
tmsrp_data_t;
#define TMSRP_DECLARE_DATA tmsrp_data_t data
typedef tsk_list_t tmsrp_datas_L_t;
-typedef struct tmsrp_data_in_s
-{
- TMSRP_DECLARE_DATA;
+typedef struct tmsrp_data_in_s {
+ TMSRP_DECLARE_DATA;
- tsk_buffer_t* buffer;
+ tsk_buffer_t* buffer;
}
tmsrp_data_in_t;
int tmsrp_data_in_put(tmsrp_data_in_t* self, const void* pdata, tsk_size_t size);
tmsrp_message_t* tmsrp_data_in_get(tmsrp_data_in_t* self);
-typedef struct tmsrp_data_out_s
-{
- TMSRP_DECLARE_DATA;
-
- FILE* file;
- tsk_buffer_t* message;
- tsk_size_t size; // File/message size
+typedef struct tmsrp_data_out_s {
+ TMSRP_DECLARE_DATA;
+
+ FILE* file;
+ tsk_buffer_t* message;
+ tsk_size_t size; // File/message size
}
tmsrp_data_out_t;
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h b/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h
index 932ab8b..a4afdb5 100755
--- a/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h
+++ b/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,19 +42,18 @@
TMSRP_BEGIN_DECLS
-typedef struct tmsrp_receiver_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmsrp_receiver_s {
+ TSK_DECLARE_OBJECT;
- tmsrp_data_in_t* data_in;
- tmsrp_config_t* config;
- tnet_fd_t fd;
- tsk_buffer_t* buffer;
+ tmsrp_data_in_t* data_in;
+ tmsrp_config_t* config;
+ tnet_fd_t fd;
+ tsk_buffer_t* buffer;
- struct {
- tmsrp_event_cb_f func;
- const void* data;
- } callback;
+ struct {
+ tmsrp_event_cb_f func;
+ const void* data;
+ } callback;
}
tmsrp_receiver_t;
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h b/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h
index f0a814f..8e50c70 100755
--- a/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h
+++ b/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,14 +41,13 @@
TMSRP_BEGIN_DECLS
-typedef struct tmsrp_sender_s
-{
- TSK_DECLARE_RUNNABLE;
+typedef struct tmsrp_sender_s {
+ TSK_DECLARE_RUNNABLE;
- tmsrp_datas_L_t* outgoingList;
- tmsrp_config_t* config;
- tnet_fd_t fd;
- uint64_t chunck_duration;
+ tmsrp_datas_L_t* outgoingList;
+ tmsrp_config_t* config;
+ tnet_fd_t fd;
+ uint64_t chunck_duration;
}
tmsrp_sender_t;
diff --git a/tinyMSRP/include/tinymsrp/tmsrp_event.h b/tinyMSRP/include/tinymsrp/tmsrp_event.h
index 6629a66..3f769cb 100755
--- a/tinyMSRP/include/tinymsrp/tmsrp_event.h
+++ b/tinyMSRP/include/tinymsrp/tmsrp_event.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,25 +39,23 @@
TMSRP_BEGIN_DECLS
-typedef enum tmsrp_event_type_e
-{
- tmsrp_event_type_none,
- tmsrp_event_type_connected,
- tmsrp_event_type_disconnected,
- tmsrp_event_type_message,
+typedef enum tmsrp_event_type_e {
+ tmsrp_event_type_none,
+ tmsrp_event_type_connected,
+ tmsrp_event_type_disconnected,
+ tmsrp_event_type_message,
}
tmsrp_event_type_t;
-typedef struct tmsrp_event_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tmsrp_event_s {
+ TSK_DECLARE_OBJECT;
- const void* callback_data;
- unsigned outgoing:1;
+ const void* callback_data;
+ unsigned outgoing:1;
- tmsrp_event_type_t type;
- tmsrp_message_t* message;
+ tmsrp_event_type_t type;
+ tmsrp_message_t* message;
}
tmsrp_event_t;
diff --git a/tinyMSRP/include/tinymsrp/tmsrp_message.h b/tinyMSRP/include/tinymsrp/tmsrp_message.h
index a419d45..2045f32 100755
--- a/tinyMSRP/include/tinymsrp/tmsrp_message.h
+++ b/tinyMSRP/include/tinymsrp/tmsrp_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -74,68 +74,65 @@ TMSRP_BEGIN_DECLS
#define TMSRP_RESPONSE_IS_6XX(self) TMSRP_RESPONSE_IS_NXX(self, 6)
#define TMSRP_RESPONSE_IS_23456(self) (TMSRP_MESSAGE_IS_RESPONSE((self)) && 200<= TMSRP_RESPONSE_CODE((self)) && TMSRP_RESPONSE_CODE((self)) <= 699)
-/** Defines the message type (Request or Response).
+/** Defines the message type (Request or Response).
**/
-typedef enum tmsrp_message_type_e
-{
- tmsrp_unknown,
- tmsrp_request,
- tmsrp_response
+typedef enum tmsrp_message_type_e {
+ tmsrp_unknown,
+ tmsrp_request,
+ tmsrp_response
}
tmsrp_message_type_t;
-typedef enum tmsrp_request_type_e
-{
- tmsrp_NONE = 0,
+typedef enum tmsrp_request_type_e {
+ tmsrp_NONE = 0,
- tmsrp_SEND,
- tmsrp_REPORT,
- tmsrp_AUTH
- //...
+ tmsrp_SEND,
+ tmsrp_REPORT,
+ tmsrp_AUTH
+ //...
}
tmsrp_request_type_t;
-typedef struct tmsrp_message_s
-{
- TSK_DECLARE_OBJECT;
-
- tmsrp_message_type_t type;
- char* tid;
- union{
- struct{
- char* method;
- tmsrp_request_type_t type;
- } request;
-
- struct{
- short status;
- char* comment;
- } response;
- } line;
-
- // Very common headers
- tmsrp_header_To_Path_t* To;
- tmsrp_header_From_Path_t* From;
-
- tmsrp_header_Message_ID_t* MessageID;
-
- tmsrp_header_Byte_Range_t* ByteRange;
- tmsrp_header_Failure_Report_t* FailureReport;
- tmsrp_header_Success_Report_t* SuccessReport;
- tmsrp_header_Status_t* Status;
-
- //! List of @ref tmsrp_header_t elements.
- tmsrp_headers_L_t* headers;
-
- // Content
- tmsrp_header_Content_Type_t* ContentType;
- tsk_buffer_t *Content;
-
- // End line
- struct{
- char* tid;
- char cflag;
- }end_line;
+typedef struct tmsrp_message_s {
+ TSK_DECLARE_OBJECT;
+
+ tmsrp_message_type_t type;
+ char* tid;
+ union {
+ struct {
+ char* method;
+ tmsrp_request_type_t type;
+ } request;
+
+ struct {
+ short status;
+ char* comment;
+ } response;
+ } line;
+
+ // Very common headers
+ tmsrp_header_To_Path_t* To;
+ tmsrp_header_From_Path_t* From;
+
+ tmsrp_header_Message_ID_t* MessageID;
+
+ tmsrp_header_Byte_Range_t* ByteRange;
+ tmsrp_header_Failure_Report_t* FailureReport;
+ tmsrp_header_Success_Report_t* SuccessReport;
+ tmsrp_header_Status_t* Status;
+
+ //! List of @ref tmsrp_header_t elements.
+ tmsrp_headers_L_t* headers;
+
+ // Content
+ tmsrp_header_Content_Type_t* ContentType;
+ tsk_buffer_t *Content;
+
+ // End line
+ struct {
+ char* tid;
+ char cflag;
+ } end_line;
}
tmsrp_message_t;
@@ -153,19 +150,19 @@ TINYMSRP_API int tmsrp_message_add_headers(tmsrp_message_t *self, ...);
#if 0
static void TMSRP_MESSAGE_ADD_HEADER(tmsrp_message_t *self, ...)
- {
- va_list ap;
- tmsrp_header_t *header;
- const tsk_object_def_t *objdef;
-
- va_start(ap, self);
- objdef = va_arg(ap, const tsk_object_def_t*);
- header = tsk_object_new_2(objdef, &ap);
- va_end(ap);
-
- tmsrp_message_add_header(self, header);
- tsk_object_unref(header);
- }
+{
+ va_list ap;
+ tmsrp_header_t *header;
+ const tsk_object_def_t *objdef;
+
+ va_start(ap, self);
+ objdef = va_arg(ap, const tsk_object_def_t*);
+ header = tsk_object_new_2(objdef, &ap);
+ va_end(ap);
+
+ tmsrp_message_add_header(self, header);
+ tsk_object_unref(header);
+}
#else
#define TMSRP_MESSAGE_ADD_HEADER(self, objdef, ...) \
{ \
diff --git a/tinyMSRP/include/tinymsrp/tmsrp_uri.h b/tinyMSRP/include/tinymsrp/tmsrp_uri.h
index 61ae352..f4747a5 100755
--- a/tinyMSRP/include/tinymsrp/tmsrp_uri.h
+++ b/tinyMSRP/include/tinymsrp/tmsrp_uri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,12 +42,11 @@ TMSRP_BEGIN_DECLS
/** The type of the authority host.
*/
-typedef enum tmsrp_host_type_e
-{
- tmsrp_host_unknown,
- tmsrp_host_hostname,
- tmsrp_host_ipv4,
- tmsrp_host_ipv6
+typedef enum tmsrp_host_type_e {
+ tmsrp_host_unknown,
+ tmsrp_host_hostname,
+ tmsrp_host_ipv4,
+ tmsrp_host_ipv6
}
tmsrp_host_type_t;
@@ -56,21 +55,20 @@ tmsrp_host_type_t;
*
* @brief MSRP/MSRPS/TEL URI.
**/
-typedef struct tmsrp_uri_s
-{
- TSK_DECLARE_OBJECT;
-
- char *scheme;
- struct{
- char* userinfo;
- tmsrp_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
- char* host;
- int32_t port;
- }authority;
- char* session_id;
- char* transport;
-
- tsk_params_L_t *params; /**< list of @ref tsk_param_t elements containing all parameters. */
+typedef struct tmsrp_uri_s {
+ TSK_DECLARE_OBJECT;
+
+ char *scheme;
+ struct {
+ char* userinfo;
+ tmsrp_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
+ char* host;
+ int32_t port;
+ } authority;
+ char* session_id;
+ char* transport;
+
+ tsk_params_L_t *params; /**< list of @ref tsk_param_t elements containing all parameters. */
}
tmsrp_uri_t;
diff --git a/tinyMSRP/include/tinymsrp_config.h b/tinyMSRP/include/tinymsrp_config.h
index f722993..b94df07 100755
--- a/tinyMSRP/include/tinymsrp_config.h
+++ b/tinyMSRP/include/tinymsrp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,13 +59,13 @@
# define TINYMSRP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TMSRP_BEGIN_DECLS extern "C" {
# define TMSRP_END_DECLS }
#else
-# define TMSRP_BEGIN_DECLS
+# define TMSRP_BEGIN_DECLS
# define TMSRP_END_DECLS
#endif
@@ -81,7 +81,7 @@
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif /* _TINYMSRP_H_ */
diff --git a/tinyMSRP/include/tmsrp.h b/tinyMSRP/include/tmsrp.h
index c7fac6a..74b6b21 100755
--- a/tinyMSRP/include/tmsrp.h
+++ b/tinyMSRP/include/tmsrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/src/headers/tmsrp_header.c b/tinyMSRP/src/headers/tmsrp_header.c
index b7aab62..7564598 100755
--- a/tinyMSRP/src/headers/tmsrp_header.c
+++ b/tinyMSRP/src/headers/tmsrp_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,80 +33,95 @@
#include "tsk_string.h"
-/** Gets the name of the MSRP header with a type equal to @a type.
- * @param type The @a type of the header for which to retrieve the name.
+/** Gets the name of the MSRP header with a type equal to @a type.
+ * @param type The @a type of the header for which to retrieve the name.
*
* @return The name of the header.
**/
const char* tmsrp_header_get_name(tmsrp_header_type_t type)
{
- switch(type)
- {
- case tmsrp_htype_Authentication_Info: return "Authentication-Info";
- case tmsrp_htype_Authorization: return "Authorization";
- case tmsrp_htype_Byte_Range: return "Byte-Range";
- case tmsrp_htype_Content_Type: return "Content-Type";
- case tmsrp_htype_Expires: return "Expires";
- case tmsrp_htype_Failure_Report: return "Failure-Report";
- case tmsrp_htype_From_Path: return "From-Path";
- case tmsrp_htype_Max_Expires: return "Max-Expires";
- case tmsrp_htype_Message_ID: return "Message-ID";
- case tmsrp_htype_Min_Expires: return "Min-Expires";
- case tmsrp_htype_Status: return "Status";
- case tmsrp_htype_Success_Report: return "Success-Report";
- case tmsrp_htype_To_Path: return "To-Path";
- case tmsrp_htype_Use_Path: return "Use-Path";
- case tmsrp_htype_WWW_Authenticate: return "WWW-Authenticate";
+ switch(type) {
+ case tmsrp_htype_Authentication_Info:
+ return "Authentication-Info";
+ case tmsrp_htype_Authorization:
+ return "Authorization";
+ case tmsrp_htype_Byte_Range:
+ return "Byte-Range";
+ case tmsrp_htype_Content_Type:
+ return "Content-Type";
+ case tmsrp_htype_Expires:
+ return "Expires";
+ case tmsrp_htype_Failure_Report:
+ return "Failure-Report";
+ case tmsrp_htype_From_Path:
+ return "From-Path";
+ case tmsrp_htype_Max_Expires:
+ return "Max-Expires";
+ case tmsrp_htype_Message_ID:
+ return "Message-ID";
+ case tmsrp_htype_Min_Expires:
+ return "Min-Expires";
+ case tmsrp_htype_Status:
+ return "Status";
+ case tmsrp_htype_Success_Report:
+ return "Success-Report";
+ case tmsrp_htype_To_Path:
+ return "To-Path";
+ case tmsrp_htype_Use_Path:
+ return "Use-Path";
+ case tmsrp_htype_WWW_Authenticate:
+ return "WWW-Authenticate";
- default: return "unknown-header";
- }
+ default:
+ return "unknown-header";
+ }
}
const char* tmsrp_header_get_nameex(const tmsrp_header_t *self)
{
- if(self){
- if(self->type == tmsrp_htype_Dummy){
- return ((tmsrp_header_Dummy_t*)(self))->name;
- }
- else{
- return tmsrp_header_get_name(self->type);
- }
- }
- return "unknown-header";
+ if(self) {
+ if(self->type == tmsrp_htype_Dummy) {
+ return ((tmsrp_header_Dummy_t*)(self))->name;
+ }
+ else {
+ return tmsrp_header_get_name(self->type);
+ }
+ }
+ return "unknown-header";
}
int tmsrp_header_serialize(const tmsrp_header_t *self, tsk_buffer_t *output)
{
- int ret = -1;
- if(!self || !output){
- return -1;
- }
+ int ret = -1;
+ if(!self || !output) {
+ return -1;
+ }
- /* Name */
- tsk_buffer_append_2(output, "%s: ", tmsrp_header_get_nameex(self));
+ /* Name */
+ tsk_buffer_append_2(output, "%s: ", tmsrp_header_get_nameex(self));
- /* Value */
- if((ret = self->tostring(self, output))){
- // Abort?
- }
+ /* Value */
+ if((ret = self->tostring(self, output))) {
+ // Abort?
+ }
- /* CRLF*/
- ret = tsk_buffer_append(output, "\r\n", 2);
+ /* CRLF*/
+ ret = tsk_buffer_append(output, "\r\n", 2);
- return ret;
+ return ret;
}
char* tmsrp_header_tostring(const tmsrp_header_t *self)
{
- char* ret = tsk_null;
- tsk_buffer_t* buffer;
- if(self && self->tostring){
- if((buffer = tsk_buffer_create_null())){
- self->tostring(self, buffer);
- ret = tsk_strndup(buffer->data, buffer->size);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
- return ret;
+ char* ret = tsk_null;
+ tsk_buffer_t* buffer;
+ if(self && self->tostring) {
+ if((buffer = tsk_buffer_create_null())) {
+ self->tostring(self, buffer);
+ ret = tsk_strndup(buffer->data, buffer->size);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
+ return ret;
} \ No newline at end of file
diff --git a/tinyMSRP/src/headers/tmsrp_header_Authorization.c b/tinyMSRP/src/headers/tmsrp_header_Authorization.c
index 0b61d02..b8888b9 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Authorization.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Authorization.c
@@ -4,19 +4,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,88 +41,85 @@
tmsrp_header_Authorization_t* tmsrp_header_Authorization_create()
{
- return tsk_object_new(tmsrp_header_Authorization_def_t);
+ return tsk_object_new(tmsrp_header_Authorization_def_t);
}
int tmsrp_header_Authorization_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tmsrp_header_Authorization_t *Authorization = (const tmsrp_header_Authorization_t *)header;
- if(Authorization && Authorization->scheme)
- {
- return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- Authorization->scheme,
-
- Authorization->username ? "username=\"" : "",
- Authorization->username ? Authorization->username : "",
- Authorization->username ? "\"" : "",
-
- Authorization->realm ? ",realm=\"" : "",
- Authorization->realm ? Authorization->realm : "",
- Authorization->realm ? "\"" : "",
-
- Authorization->nonce ? ",nonce=\"" : "",
- Authorization->nonce ? Authorization->nonce : "",
- Authorization->nonce ? "\"" : "",
-
- Authorization->uri ? ",uri=\"" : "",
- Authorization->uri ? Authorization->uri : "",
- Authorization->uri ? "\"" : "",
-
- Authorization->response ? ",response=\"" : "",
- Authorization->response ? Authorization->response : "",
- Authorization->response ? "\"" : "",
-
- Authorization->algorithm ? ",algorithm=" : "",
- Authorization->algorithm ? Authorization->algorithm : "",
-
- Authorization->cnonce ? ",cnonce=\"" : "",
- Authorization->cnonce ? Authorization->cnonce : "",
- Authorization->cnonce ? "\"" : "",
-
- Authorization->opaque ? ",opaque=\"" : "",
- Authorization->opaque ? Authorization->opaque : "",
- Authorization->opaque ? "\"" : "",
-
- Authorization->qop ? ",qop=" : "",
- Authorization->qop ? Authorization->qop : "",
-
- Authorization->nc ? ",nc=" : "",
- Authorization->nc ? Authorization->nc : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tmsrp_header_Authorization_t *Authorization = (const tmsrp_header_Authorization_t *)header;
+ if(Authorization && Authorization->scheme) {
+ return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ Authorization->scheme,
+
+ Authorization->username ? "username=\"" : "",
+ Authorization->username ? Authorization->username : "",
+ Authorization->username ? "\"" : "",
+
+ Authorization->realm ? ",realm=\"" : "",
+ Authorization->realm ? Authorization->realm : "",
+ Authorization->realm ? "\"" : "",
+
+ Authorization->nonce ? ",nonce=\"" : "",
+ Authorization->nonce ? Authorization->nonce : "",
+ Authorization->nonce ? "\"" : "",
+
+ Authorization->uri ? ",uri=\"" : "",
+ Authorization->uri ? Authorization->uri : "",
+ Authorization->uri ? "\"" : "",
+
+ Authorization->response ? ",response=\"" : "",
+ Authorization->response ? Authorization->response : "",
+ Authorization->response ? "\"" : "",
+
+ Authorization->algorithm ? ",algorithm=" : "",
+ Authorization->algorithm ? Authorization->algorithm : "",
+
+ Authorization->cnonce ? ",cnonce=\"" : "",
+ Authorization->cnonce ? Authorization->cnonce : "",
+ Authorization->cnonce ? "\"" : "",
+
+ Authorization->opaque ? ",opaque=\"" : "",
+ Authorization->opaque ? Authorization->opaque : "",
+ Authorization->opaque ? "\"" : "",
+
+ Authorization->qop ? ",qop=" : "",
+ Authorization->qop ? Authorization->qop : "",
+
+ Authorization->nc ? ",nc=" : "",
+ Authorization->nc ? Authorization->nc : ""
+ );
+ }
+ }
+ return -1;
}
tmsrp_header_Authorization_t *tmsrp_header_Authorization_parse(const char *data, tsk_size_t size)
{
- tmsrp_header_Authorization_t *hdr_msrp = 0;
- thttp_header_Authorization_t* hdr_http;
-
- if((hdr_http = thttp_header_Authorization_parse(data, size)))
- {
- hdr_msrp = tmsrp_header_Authorization_create();
-
- hdr_msrp->scheme = tsk_strdup(hdr_http->scheme);
- hdr_msrp->username = tsk_strdup(hdr_http->username);
- hdr_msrp->realm = tsk_strdup(hdr_http->realm);
- hdr_msrp->nonce = tsk_strdup(hdr_http->nonce);
- hdr_msrp->uri = tsk_strdup(hdr_http->uri);
- hdr_msrp->response = tsk_strdup(hdr_http->response);
- hdr_msrp->algorithm = tsk_strdup(hdr_http->algorithm);
- hdr_msrp->cnonce = tsk_strdup(hdr_http->cnonce);
- hdr_msrp->opaque = tsk_strdup(hdr_http->opaque);
- hdr_msrp->qop = tsk_strdup(hdr_http->qop);
- hdr_msrp->nc = tsk_strdup(hdr_http->nc);
-
- hdr_msrp->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
-
- TSK_OBJECT_SAFE_FREE(hdr_http);
- }
-
- return hdr_msrp;
+ tmsrp_header_Authorization_t *hdr_msrp = 0;
+ thttp_header_Authorization_t* hdr_http;
+
+ if((hdr_http = thttp_header_Authorization_parse(data, size))) {
+ hdr_msrp = tmsrp_header_Authorization_create();
+
+ hdr_msrp->scheme = tsk_strdup(hdr_http->scheme);
+ hdr_msrp->username = tsk_strdup(hdr_http->username);
+ hdr_msrp->realm = tsk_strdup(hdr_http->realm);
+ hdr_msrp->nonce = tsk_strdup(hdr_http->nonce);
+ hdr_msrp->uri = tsk_strdup(hdr_http->uri);
+ hdr_msrp->response = tsk_strdup(hdr_http->response);
+ hdr_msrp->algorithm = tsk_strdup(hdr_http->algorithm);
+ hdr_msrp->cnonce = tsk_strdup(hdr_http->cnonce);
+ hdr_msrp->opaque = tsk_strdup(hdr_http->opaque);
+ hdr_msrp->qop = tsk_strdup(hdr_http->qop);
+ hdr_msrp->nc = tsk_strdup(hdr_http->nc);
+
+ hdr_msrp->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
+
+ TSK_OBJECT_SAFE_FREE(hdr_http);
+ }
+
+ return hdr_msrp;
}
@@ -135,47 +132,46 @@ tmsrp_header_Authorization_t *tmsrp_header_Authorization_parse(const char *data,
static tsk_object_t* tmsrp_header_Authorization_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Authorization_t *Authorization = self;
- if(Authorization){
- TMSRP_HEADER(Authorization)->type = tmsrp_htype_Authorization;
- TMSRP_HEADER(Authorization)->tostring = tmsrp_header_Authorization_tostring;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Authorization header.");
- }
- return self;
+ tmsrp_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ TMSRP_HEADER(Authorization)->type = tmsrp_htype_Authorization;
+ TMSRP_HEADER(Authorization)->tostring = tmsrp_header_Authorization_tostring;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Authorization header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Authorization_dtor(tsk_object_t *self)
{
- tmsrp_header_Authorization_t *Authorization = self;
- if(Authorization){
- TSK_FREE(Authorization->scheme);
- TSK_FREE(Authorization->username);
- TSK_FREE(Authorization->realm);
- TSK_FREE(Authorization->nonce);
- TSK_FREE(Authorization->uri);
- TSK_FREE(Authorization->response);
- TSK_FREE(Authorization->algorithm);
- TSK_FREE(Authorization->cnonce);
- TSK_FREE(Authorization->opaque);
- TSK_FREE(Authorization->qop);
- TSK_FREE(Authorization->nc);
-
- TSK_OBJECT_SAFE_FREE(Authorization->params);
- }
- else{
- TSK_DEBUG_ERROR("Null Authorization header.");
- }
-
- return self;
+ tmsrp_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ TSK_FREE(Authorization->scheme);
+ TSK_FREE(Authorization->username);
+ TSK_FREE(Authorization->realm);
+ TSK_FREE(Authorization->nonce);
+ TSK_FREE(Authorization->uri);
+ TSK_FREE(Authorization->response);
+ TSK_FREE(Authorization->algorithm);
+ TSK_FREE(Authorization->cnonce);
+ TSK_FREE(Authorization->opaque);
+ TSK_FREE(Authorization->qop);
+ TSK_FREE(Authorization->nc);
+
+ TSK_OBJECT_SAFE_FREE(Authorization->params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Authorization header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Authorization_def_s =
-{
- sizeof(tmsrp_header_Authorization_t),
- tmsrp_header_Authorization_ctor,
- tmsrp_header_Authorization_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Authorization_def_s = {
+ sizeof(tmsrp_header_Authorization_t),
+ tmsrp_header_Authorization_ctor,
+ tmsrp_header_Authorization_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Authorization_def_t = &tmsrp_header_Authorization_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Byte-Range.c b/tinyMSRP/src/headers/tmsrp_header_Byte-Range.c
index 301b576..3a59024 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Byte-Range.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Byte-Range.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,298 +40,308 @@
tmsrp_header_Byte_Range_t* tmsrp_header_Byte_Range_create(int64_t start, int64_t end, int64_t total)
{
- return tsk_object_new(TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total));
+ return tsk_object_new(TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total));
}
tmsrp_header_Byte_Range_t* tmsrp_header_Byte_Range_create_null()
{
- return tmsrp_header_Byte_Range_create(1, -1, -1);
+ return tmsrp_header_Byte_Range_create(1, -1, -1);
}
int tmsrp_header_Byte_Range_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Byte_Range_t *Byte_Range = (const tmsrp_header_Byte_Range_t *)header;
- tsk_istr_t start, end, total;
-
- if(Byte_Range->start>=0){
- tsk_itoa(Byte_Range->start, &start);
- }
- if(Byte_Range->end>=0){
- tsk_itoa(Byte_Range->end, &end);
- }
- if(Byte_Range->total>=0){
- tsk_itoa(Byte_Range->total, &total);
- }
-
- return tsk_buffer_append_2(output, "%s-%s/%s",
- Byte_Range->start>=0 ? start : "*",
- Byte_Range->end>=0 ? end : "*",
- Byte_Range->total>=0 ? total : "*"
- );
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Byte_Range_t *Byte_Range = (const tmsrp_header_Byte_Range_t *)header;
+ tsk_istr_t start, end, total;
+
+ if(Byte_Range->start>=0) {
+ tsk_itoa(Byte_Range->start, &start);
+ }
+ if(Byte_Range->end>=0) {
+ tsk_itoa(Byte_Range->end, &end);
+ }
+ if(Byte_Range->total>=0) {
+ tsk_itoa(Byte_Range->total, &total);
+ }
+
+ return tsk_buffer_append_2(output, "%s-%s/%s",
+ Byte_Range->start>=0 ? start : "*",
+ Byte_Range->end>=0 ? end : "*",
+ Byte_Range->total>=0 ? total : "*"
+ );
+ }
+
+ return -1;
}
tmsrp_header_Byte_Range_t *tmsrp_header_Byte_Range_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Byte_Range_t *hdr_Byte_Range = tmsrp_header_Byte_Range_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 90 "./src/headers/tmsrp_header_Byte-Range.c" */
-static const char _tmsrp_machine_parser_header_Byte_Range_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 9, 11,
- 13, 15, 17, 19, 20, 21, 23, 26,
- 29, 30, 33, 34, 37, 38, 38
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_trans_keys[] = {
- 66, 98, 89, 121, 84, 116, 69, 101,
- 45, 82, 114, 65, 97, 78, 110, 71,
- 103, 69, 101, 58, 32, 48, 57, 45,
- 48, 57, 42, 48, 57, 47, 42, 48,
- 57, 10, 47, 48, 57, 13, 13, 48,
- 57, 0
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_single_lengths[] = {
- 0, 2, 2, 2, 2, 1, 2, 2,
- 2, 2, 2, 1, 1, 0, 1, 1,
- 1, 1, 1, 1, 1, 0, 1
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 0, 1, 0, 1, 0, 0, 1
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 14, 17,
- 20, 23, 26, 29, 31, 33, 35, 38,
- 41, 43, 46, 48, 51, 53, 54
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 1, 12,
- 1, 13, 1, 14, 15, 1, 16, 17,
- 1, 18, 1, 19, 20, 1, 21, 1,
- 18, 22, 1, 23, 1, 1, 23, 24,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 14,
- 16, 19, 17, 20, 22, 21, 19, 18,
- 22
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 3, 0,
- 1, 1, 5, 1, 1, 0, 0, 7,
- 0
-};
-
-static const char _tmsrp_machine_parser_header_Byte_Range_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 0, 7
-};
-
-static const int tmsrp_machine_parser_header_Byte_Range_start = 1;
-static const int tmsrp_machine_parser_header_Byte_Range_first_final = 20;
-static const int tmsrp_machine_parser_header_Byte_Range_error = 0;
-
-static const int tmsrp_machine_parser_header_Byte_Range_en_main = 1;
-
-
-/* #line 126 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Byte_Range_first_final);
- (void)(tmsrp_machine_parser_header_Byte_Range_error);
- (void)(tmsrp_machine_parser_header_Byte_Range_en_main);
-
-/* #line 173 "./src/headers/tmsrp_header_Byte-Range.c" */
- {
- cs = tmsrp_machine_parser_header_Byte_Range_start;
- }
-
-/* #line 131 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
-
-/* #line 180 "./src/headers/tmsrp_header_Byte-Range.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Byte_Range_t *hdr_Byte_Range = tmsrp_header_Byte_Range_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 90 "./src/headers/tmsrp_header_Byte-Range.c" */
+ static const char _tmsrp_machine_parser_header_Byte_Range_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 9, 11,
+ 13, 15, 17, 19, 20, 21, 23, 26,
+ 29, 30, 33, 34, 37, 38, 38
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_trans_keys[] = {
+ 66, 98, 89, 121, 84, 116, 69, 101,
+ 45, 82, 114, 65, 97, 78, 110, 71,
+ 103, 69, 101, 58, 32, 48, 57, 45,
+ 48, 57, 42, 48, 57, 47, 42, 48,
+ 57, 10, 47, 48, 57, 13, 13, 48,
+ 57, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_single_lengths[] = {
+ 0, 2, 2, 2, 2, 1, 2, 2,
+ 2, 2, 2, 1, 1, 0, 1, 1,
+ 1, 1, 1, 1, 1, 0, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 0, 1, 0, 1, 0, 0, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 14, 17,
+ 20, 23, 26, 29, 31, 33, 35, 38,
+ 41, 43, 46, 48, 51, 53, 54
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 1, 12,
+ 1, 13, 1, 14, 15, 1, 16, 17,
+ 1, 18, 1, 19, 20, 1, 21, 1,
+ 18, 22, 1, 23, 1, 1, 23, 24,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 14,
+ 16, 19, 17, 20, 22, 21, 19, 18,
+ 22
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 3, 0,
+ 1, 1, 5, 1, 1, 0, 0, 7,
+ 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Byte_Range_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 7
+ };
+
+ static const int tmsrp_machine_parser_header_Byte_Range_start = 1;
+ static const int tmsrp_machine_parser_header_Byte_Range_first_final = 20;
+ static const int tmsrp_machine_parser_header_Byte_Range_error = 0;
+
+ static const int tmsrp_machine_parser_header_Byte_Range_en_main = 1;
+
+
+ /* #line 126 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Byte_Range_first_final);
+ (void)(tmsrp_machine_parser_header_Byte_Range_error);
+ (void)(tmsrp_machine_parser_header_Byte_Range_en_main);
+
+ /* #line 173 "./src/headers/tmsrp_header_Byte-Range.c" */
+ {
+ cs = tmsrp_machine_parser_header_Byte_Range_start;
+ }
+
+ /* #line 131 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+
+ /* #line 180 "./src/headers/tmsrp_header_Byte-Range.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Byte_Range_trans_keys + _tmsrp_machine_parser_header_Byte_Range_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Byte_Range_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Byte_Range_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Byte_Range_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Byte_Range_trans_keys + _tmsrp_machine_parser_header_Byte_Range_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Byte_Range_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Byte_Range_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Byte_Range_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Byte_Range_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Byte_Range_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Byte_Range_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Byte_Range_actions + _tmsrp_machine_parser_header_Byte_Range_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->start, int64_t, atoi64);
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- {
- if(tag_start && *tag_start == '*'){
- hdr_Byte_Range->end = -1;
- }
- else{
- TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->end, int64_t, atoi64);
- }
- }
- break;
- case 3:
-/* #line 58 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- {
- if(tag_start && *tag_start == '*'){
- hdr_Byte_Range->total = -1;
- }
- else{
- TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->total, int64_t, atoi64);
- }
- }
- break;
-/* #line 288 "./src/headers/tmsrp_header_Byte-Range.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Byte_Range_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Byte_Range_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Byte_Range_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Byte_Range_actions + _tmsrp_machine_parser_header_Byte_Range_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->start, int64_t, atoi64);
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ {
+ if(tag_start && *tag_start == '*') {
+ hdr_Byte_Range->end = -1;
+ }
+ else {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->end, int64_t, atoi64);
+ }
+ }
+ break;
+ case 3:
+ /* #line 58 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ {
+ if(tag_start && *tag_start == '*') {
+ hdr_Byte_Range->total = -1;
+ }
+ else {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->total, int64_t, atoi64);
+ }
+ }
+ break;
+ /* #line 288 "./src/headers/tmsrp_header_Byte-Range.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Byte_Range_actions + _tmsrp_machine_parser_header_Byte_Range_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 3:
-/* #line 58 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- {
- if(tag_start && *tag_start == '*'){
- hdr_Byte_Range->total = -1;
- }
- else{
- TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->total, int64_t, atoi64);
- }
- }
- break;
-/* #line 315 "./src/headers/tmsrp_header_Byte-Range.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 132 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 327 "./src/headers/tmsrp_header_Byte-Range.c" */
-20
-/* #line 134 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Byte-Range' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Byte_Range);
- }
-
- return hdr_Byte_Range;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Byte_Range_actions + _tmsrp_machine_parser_header_Byte_Range_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 3:
+ /* #line 58 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ {
+ if(tag_start && *tag_start == '*') {
+ hdr_Byte_Range->total = -1;
+ }
+ else {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Byte_Range->total, int64_t, atoi64);
+ }
+ }
+ break;
+ /* #line 315 "./src/headers/tmsrp_header_Byte-Range.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 132 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 327 "./src/headers/tmsrp_header_Byte-Range.c" */
+ 20
+ /* #line 134 "./ragel/tmsrp_parser_header_Byte-Range.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Byte-Range' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Byte_Range);
+ }
+
+ return hdr_Byte_Range;
}
@@ -346,39 +356,38 @@ _again:
static tsk_object_t* tmsrp_header_Byte_Range_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Byte_Range_t *Byte_Range = self;
- if(Byte_Range){
- TMSRP_HEADER(Byte_Range)->type = tmsrp_htype_Byte_Range;
- TMSRP_HEADER(Byte_Range)->tostring = tmsrp_header_Byte_Range_tostring;
-
- Byte_Range->start = va_arg(*app, int64_t);
- Byte_Range->end = va_arg(*app, int64_t);
- Byte_Range->total = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Byte-Range header.");
- }
- return self;
+ tmsrp_header_Byte_Range_t *Byte_Range = self;
+ if(Byte_Range) {
+ TMSRP_HEADER(Byte_Range)->type = tmsrp_htype_Byte_Range;
+ TMSRP_HEADER(Byte_Range)->tostring = tmsrp_header_Byte_Range_tostring;
+
+ Byte_Range->start = va_arg(*app, int64_t);
+ Byte_Range->end = va_arg(*app, int64_t);
+ Byte_Range->total = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Byte-Range header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Byte_Range_dtor(tsk_object_t *self)
{
- tmsrp_header_Byte_Range_t *Byte_Range = self;
- if(Byte_Range){
- }
- else{
- TSK_DEBUG_ERROR("Null Byte-Range header.");
- }
-
- return self;
+ tmsrp_header_Byte_Range_t *Byte_Range = self;
+ if(Byte_Range) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Byte-Range header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Byte_Range_def_s =
-{
- sizeof(tmsrp_header_Byte_Range_t),
- tmsrp_header_Byte_Range_ctor,
- tmsrp_header_Byte_Range_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Byte_Range_def_s = {
+ sizeof(tmsrp_header_Byte_Range_t),
+ tmsrp_header_Byte_Range_ctor,
+ tmsrp_header_Byte_Range_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Byte_Range_def_t = &tmsrp_header_Byte_Range_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Content-Type.c b/tinyMSRP/src/headers/tmsrp_header_Content-Type.c
index 7ec0dd2..b962e68 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Content-Type.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Content-Type.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Content-Type.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,361 +44,371 @@
tmsrp_header_Content_Type_t* tmsrp_header_Content_Type_create(const char* type)
{
- return tsk_object_new(TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(type));
+ return tsk_object_new(TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(type));
}
tmsrp_header_Content_Type_t* tmsrp_header_Content_Type_create_null()
{
- return tmsrp_header_Content_Type_create(tsk_null);
+ return tmsrp_header_Content_Type_create(tsk_null);
}
int tmsrp_header_Content_Type_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Content_Type_t *Content_Type = (const tmsrp_header_Content_Type_t *)header;
- const tsk_list_item_t *item;
-
- if(Content_Type->value){
- tsk_buffer_append(output, Content_Type->value, strlen(Content_Type->value));
- }
- // Params
- tsk_list_foreach(item, Content_Type->params){
- tsk_buffer_append(output, ";", 1);
- tsk_params_tostring(Content_Type->params, ';', output);
- }
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Content_Type_t *Content_Type = (const tmsrp_header_Content_Type_t *)header;
+ const tsk_list_item_t *item;
+
+ if(Content_Type->value) {
+ tsk_buffer_append(output, Content_Type->value, strlen(Content_Type->value));
+ }
+ // Params
+ tsk_list_foreach(item, Content_Type->params) {
+ tsk_buffer_append(output, ";", 1);
+ tsk_params_tostring(Content_Type->params, ';', output);
+ }
+ }
+
+ return -1;
}
tmsrp_header_Content_Type_t *tmsrp_header_Content_Type_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Content_Type_t *hdr_ctype = tmsrp_header_Content_Type_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 87 "./src/headers/tmsrp_header_Content-Type.c" */
-static const char _tmsrp_machine_parser_header_Content_Type_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const short _tmsrp_machine_parser_header_Content_Type_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 21, 23, 26, 43,
- 44, 46, 62, 78, 82, 83, 85, 88,
- 105, 106, 108, 124, 128, 129, 131, 134,
- 150, 151, 153, 168, 173, 174, 176, 180,
- 196, 197, 199, 214, 215, 221, 227, 233,
- 239, 257, 275, 292
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_trans_keys[] = {
- 67, 99, 79, 111, 78, 110, 84, 116,
- 69, 101, 78, 110, 84, 116, 45, 84,
- 116, 89, 121, 80, 112, 69, 101, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 47, 126, 42, 43,
- 45, 57, 65, 90, 95, 122, 9, 13,
- 32, 47, 10, 9, 32, 9, 32, 47,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 10, 9, 32, 9, 32, 59, 9, 13,
- 32, 33, 37, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 10, 9,
- 32, 9, 32, 33, 37, 93, 95, 126,
- 36, 43, 45, 58, 65, 91, 97, 122,
- 9, 13, 32, 59, 61, 10, 9, 32,
- 9, 32, 59, 61, 9, 13, 32, 33,
- 37, 93, 95, 126, 36, 43, 45, 58,
- 65, 91, 97, 122, 10, 9, 32, 9,
- 32, 33, 37, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 10, 48,
- 57, 65, 70, 97, 102, 48, 57, 65,
- 70, 97, 102, 48, 57, 65, 70, 97,
- 102, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 33, 37, 39, 59, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 59, 61,
- 93, 95, 126, 36, 43, 45, 58, 65,
- 91, 97, 122, 9, 13, 32, 33, 37,
- 59, 93, 95, 126, 36, 43, 45, 58,
- 65, 91, 97, 122, 0
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 3, 7, 1,
- 2, 6, 8, 4, 1, 2, 3, 7,
- 1, 2, 6, 4, 1, 2, 3, 8,
- 1, 2, 7, 5, 1, 2, 4, 8,
- 1, 2, 7, 1, 0, 0, 0, 0,
- 8, 10, 9, 0
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 5, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 0, 0, 0, 4,
- 0, 0, 4, 0, 0, 0, 0, 4,
- 0, 0, 4, 0, 3, 3, 3, 3,
- 5, 4, 4, 0
-};
-
-static const short _tmsrp_machine_parser_header_Content_Type_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 32, 35, 39, 52,
- 54, 57, 69, 82, 87, 89, 92, 96,
- 109, 111, 114, 126, 131, 133, 136, 140,
- 153, 155, 158, 170, 176, 178, 181, 186,
- 199, 201, 204, 216, 218, 222, 226, 230,
- 234, 248, 263, 277
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 12, 12, 13, 1, 13,
- 14, 13, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 1, 16, 1, 17, 17,
- 1, 17, 17, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 1, 18, 19, 18,
- 20, 20, 20, 21, 20, 20, 20, 20,
- 20, 1, 18, 19, 18, 21, 1, 22,
- 1, 23, 23, 1, 23, 23, 21, 1,
- 21, 24, 21, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 1, 26, 1, 27,
- 27, 1, 27, 27, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 1, 28, 29,
- 28, 30, 1, 31, 1, 32, 32, 1,
- 32, 32, 30, 1, 30, 33, 30, 34,
- 35, 34, 34, 34, 34, 34, 34, 34,
- 1, 36, 1, 37, 37, 1, 37, 37,
- 34, 35, 34, 34, 34, 34, 34, 34,
- 34, 1, 38, 39, 38, 30, 40, 1,
- 41, 1, 42, 42, 1, 42, 42, 30,
- 40, 1, 40, 43, 40, 44, 45, 44,
- 44, 44, 44, 44, 44, 44, 1, 46,
- 1, 47, 47, 1, 47, 47, 44, 45,
- 44, 44, 44, 44, 44, 44, 44, 1,
- 48, 1, 49, 49, 49, 1, 44, 44,
- 44, 1, 50, 50, 50, 1, 51, 51,
- 51, 1, 52, 53, 52, 25, 25, 25,
- 54, 25, 25, 25, 25, 25, 25, 1,
- 55, 56, 55, 51, 57, 58, 40, 51,
- 51, 51, 51, 51, 51, 51, 1, 59,
- 56, 59, 44, 45, 58, 44, 44, 44,
- 44, 44, 44, 44, 1, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 18,
- 16, 17, 19, 20, 18, 23, 21, 22,
- 24, 48, 25, 26, 27, 28, 31, 29,
- 30, 32, 49, 46, 33, 34, 35, 36,
- 39, 37, 38, 40, 50, 44, 41, 42,
- 51, 45, 47, 49, 27, 43, 31, 35,
- 43, 46, 31, 27
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 3, 3, 5,
- 5, 0, 5, 5
-};
-
-static const char _tmsrp_machine_parser_header_Content_Type_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 5, 5, 0
-};
-
-static const int tmsrp_machine_parser_header_Content_Type_start = 1;
-static const int tmsrp_machine_parser_header_Content_Type_first_final = 48;
-static const int tmsrp_machine_parser_header_Content_Type_error = 0;
-
-static const int tmsrp_machine_parser_header_Content_Type_en_main = 1;
-
-
-/* #line 112 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Content_Type_first_final);
- (void)(tmsrp_machine_parser_header_Content_Type_error);
- (void)(tmsrp_machine_parser_header_Content_Type_en_main);
-
-/* #line 255 "./src/headers/tmsrp_header_Content-Type.c" */
- {
- cs = tmsrp_machine_parser_header_Content_Type_start;
- }
-
-/* #line 117 "./ragel/tmsrp_parser_header_Content-Type.rl" */
-
-/* #line 262 "./src/headers/tmsrp_header_Content-Type.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Content_Type_t *hdr_ctype = tmsrp_header_Content_Type_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 87 "./src/headers/tmsrp_header_Content-Type.c" */
+ static const char _tmsrp_machine_parser_header_Content_Type_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const short _tmsrp_machine_parser_header_Content_Type_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 21, 23, 26, 43,
+ 44, 46, 62, 78, 82, 83, 85, 88,
+ 105, 106, 108, 124, 128, 129, 131, 134,
+ 150, 151, 153, 168, 173, 174, 176, 180,
+ 196, 197, 199, 214, 215, 221, 227, 233,
+ 239, 257, 275, 292
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_trans_keys[] = {
+ 67, 99, 79, 111, 78, 110, 84, 116,
+ 69, 101, 78, 110, 84, 116, 45, 84,
+ 116, 89, 121, 80, 112, 69, 101, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 47, 126, 42, 43,
+ 45, 57, 65, 90, 95, 122, 9, 13,
+ 32, 47, 10, 9, 32, 9, 32, 47,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 10, 9, 32, 9, 32, 59, 9, 13,
+ 32, 33, 37, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 10, 9,
+ 32, 9, 32, 33, 37, 93, 95, 126,
+ 36, 43, 45, 58, 65, 91, 97, 122,
+ 9, 13, 32, 59, 61, 10, 9, 32,
+ 9, 32, 59, 61, 9, 13, 32, 33,
+ 37, 93, 95, 126, 36, 43, 45, 58,
+ 65, 91, 97, 122, 10, 9, 32, 9,
+ 32, 33, 37, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 10, 48,
+ 57, 65, 70, 97, 102, 48, 57, 65,
+ 70, 97, 102, 48, 57, 65, 70, 97,
+ 102, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 33, 37, 39, 59, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 59, 61,
+ 93, 95, 126, 36, 43, 45, 58, 65,
+ 91, 97, 122, 9, 13, 32, 33, 37,
+ 59, 93, 95, 126, 36, 43, 45, 58,
+ 65, 91, 97, 122, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 3, 7, 1,
+ 2, 6, 8, 4, 1, 2, 3, 7,
+ 1, 2, 6, 4, 1, 2, 3, 8,
+ 1, 2, 7, 5, 1, 2, 4, 8,
+ 1, 2, 7, 1, 0, 0, 0, 0,
+ 8, 10, 9, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 5, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 0, 0, 0, 4,
+ 0, 0, 4, 0, 0, 0, 0, 4,
+ 0, 0, 4, 0, 3, 3, 3, 3,
+ 5, 4, 4, 0
+ };
+
+ static const short _tmsrp_machine_parser_header_Content_Type_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 32, 35, 39, 52,
+ 54, 57, 69, 82, 87, 89, 92, 96,
+ 109, 111, 114, 126, 131, 133, 136, 140,
+ 153, 155, 158, 170, 176, 178, 181, 186,
+ 199, 201, 204, 216, 218, 222, 226, 230,
+ 234, 248, 263, 277
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 12, 12, 13, 1, 13,
+ 14, 13, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 1, 16, 1, 17, 17,
+ 1, 17, 17, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 1, 18, 19, 18,
+ 20, 20, 20, 21, 20, 20, 20, 20,
+ 20, 1, 18, 19, 18, 21, 1, 22,
+ 1, 23, 23, 1, 23, 23, 21, 1,
+ 21, 24, 21, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 1, 26, 1, 27,
+ 27, 1, 27, 27, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 1, 28, 29,
+ 28, 30, 1, 31, 1, 32, 32, 1,
+ 32, 32, 30, 1, 30, 33, 30, 34,
+ 35, 34, 34, 34, 34, 34, 34, 34,
+ 1, 36, 1, 37, 37, 1, 37, 37,
+ 34, 35, 34, 34, 34, 34, 34, 34,
+ 34, 1, 38, 39, 38, 30, 40, 1,
+ 41, 1, 42, 42, 1, 42, 42, 30,
+ 40, 1, 40, 43, 40, 44, 45, 44,
+ 44, 44, 44, 44, 44, 44, 1, 46,
+ 1, 47, 47, 1, 47, 47, 44, 45,
+ 44, 44, 44, 44, 44, 44, 44, 1,
+ 48, 1, 49, 49, 49, 1, 44, 44,
+ 44, 1, 50, 50, 50, 1, 51, 51,
+ 51, 1, 52, 53, 52, 25, 25, 25,
+ 54, 25, 25, 25, 25, 25, 25, 1,
+ 55, 56, 55, 51, 57, 58, 40, 51,
+ 51, 51, 51, 51, 51, 51, 1, 59,
+ 56, 59, 44, 45, 58, 44, 44, 44,
+ 44, 44, 44, 44, 1, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 18,
+ 16, 17, 19, 20, 18, 23, 21, 22,
+ 24, 48, 25, 26, 27, 28, 31, 29,
+ 30, 32, 49, 46, 33, 34, 35, 36,
+ 39, 37, 38, 40, 50, 44, 41, 42,
+ 51, 45, 47, 49, 27, 43, 31, 35,
+ 43, 46, 31, 27
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 3, 3, 5,
+ 5, 0, 5, 5
+ };
+
+ static const char _tmsrp_machine_parser_header_Content_Type_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 5, 5, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Content_Type_start = 1;
+ static const int tmsrp_machine_parser_header_Content_Type_first_final = 48;
+ static const int tmsrp_machine_parser_header_Content_Type_error = 0;
+
+ static const int tmsrp_machine_parser_header_Content_Type_en_main = 1;
+
+
+ /* #line 112 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Content_Type_first_final);
+ (void)(tmsrp_machine_parser_header_Content_Type_error);
+ (void)(tmsrp_machine_parser_header_Content_Type_en_main);
+
+ /* #line 255 "./src/headers/tmsrp_header_Content-Type.c" */
+ {
+ cs = tmsrp_machine_parser_header_Content_Type_start;
+ }
+
+ /* #line 117 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+
+ /* #line 262 "./src/headers/tmsrp_header_Content-Type.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Content_Type_trans_keys + _tmsrp_machine_parser_header_Content_Type_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Content_Type_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Content_Type_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Content_Type_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Content_Type_trans_keys + _tmsrp_machine_parser_header_Content_Type_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Content_Type_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Content_Type_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Content_Type_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Content_Type_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Content_Type_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Content_Type_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Content_Type_actions + _tmsrp_machine_parser_header_Content_Type_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 44 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 48 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ctype->value);
- }
- break;
- case 2:
-/* #line 52 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- {
- TSK_PARSER_ADD_PARAM(hdr_ctype->params);
- }
- break;
-/* #line 354 "./src/headers/tmsrp_header_Content-Type.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Content_Type_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Content_Type_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Content_Type_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Content_Type_actions + _tmsrp_machine_parser_header_Content_Type_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 44 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 48 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ctype->value);
+ }
+ break;
+ case 2:
+ /* #line 52 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(hdr_ctype->params);
+ }
+ break;
+ /* #line 354 "./src/headers/tmsrp_header_Content-Type.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Content_Type_actions + _tmsrp_machine_parser_header_Content_Type_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 48 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ctype->value);
- }
- break;
- case 2:
-/* #line 52 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- {
- TSK_PARSER_ADD_PARAM(hdr_ctype->params);
- }
- break;
-/* #line 382 "./src/headers/tmsrp_header_Content-Type.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 118 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 394 "./src/headers/tmsrp_header_Content-Type.c" */
-48
-/* #line 120 "./ragel/tmsrp_parser_header_Content-Type.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Content-Type' header.");
- TSK_OBJECT_SAFE_FREE(hdr_ctype);
- }
-
- return hdr_ctype;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Content_Type_actions + _tmsrp_machine_parser_header_Content_Type_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 48 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ctype->value);
+ }
+ break;
+ case 2:
+ /* #line 52 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(hdr_ctype->params);
+ }
+ break;
+ /* #line 382 "./src/headers/tmsrp_header_Content-Type.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 118 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 394 "./src/headers/tmsrp_header_Content-Type.c" */
+ 48
+ /* #line 120 "./ragel/tmsrp_parser_header_Content-Type.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Content-Type' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ctype);
+ }
+
+ return hdr_ctype;
}
@@ -415,40 +425,39 @@ _again:
*/
static tsk_object_t* tmsrp_header_Content_Type_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- TMSRP_HEADER(Content_Type)->type = tmsrp_htype_Content_Type;
- TMSRP_HEADER(Content_Type)->tostring = tmsrp_header_Content_Type_tostring;
-
- Content_Type->value = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
- }
- return self;
+ tmsrp_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ TMSRP_HEADER(Content_Type)->type = tmsrp_htype_Content_Type;
+ TMSRP_HEADER(Content_Type)->tostring = tmsrp_header_Content_Type_tostring;
+
+ Content_Type->value = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
+ }
+ return self;
}
/**@ingroup tmsrp_header_Content_Type_group
*/
static tsk_object_t* tmsrp_header_Content_Type_dtor(tsk_object_t *self)
{
- tmsrp_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- TSK_FREE(Content_Type->value);
- TSK_OBJECT_SAFE_FREE(Content_Type->params);
- }
- else{
- TSK_DEBUG_ERROR("Null Content-Type header.");
- }
-
- return self;
+ tmsrp_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ TSK_FREE(Content_Type->value);
+ TSK_OBJECT_SAFE_FREE(Content_Type->params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Content-Type header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Content_Type_def_s =
-{
- sizeof(tmsrp_header_Content_Type_t),
- tmsrp_header_Content_Type_ctor,
- tmsrp_header_Content_Type_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Content_Type_def_s = {
+ sizeof(tmsrp_header_Content_Type_t),
+ tmsrp_header_Content_Type_ctor,
+ tmsrp_header_Content_Type_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Content_Type_def_t = &tmsrp_header_Content_Type_def_s; \ No newline at end of file
diff --git a/tinyMSRP/src/headers/tmsrp_header_Dummy.c b/tinyMSRP/src/headers/tmsrp_header_Dummy.c
index 09cfbe2..70af7e1 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Dummy.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Dummy.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Dummy.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,253 +41,263 @@
tmsrp_header_Dummy_t* tmsrp_header_Dummy_create(const char* name, const char* value)
{
- return tsk_object_new(TMSRP_HEADER_DUMMY_VA_ARGS(name, value));
+ return tsk_object_new(TMSRP_HEADER_DUMMY_VA_ARGS(name, value));
}
tmsrp_header_Dummy_t* tmsrp_header_Dummy_create_null()
{
- return tmsrp_header_Dummy_create(tsk_null, tsk_null);
+ return tmsrp_header_Dummy_create(tsk_null, tsk_null);
}
int tmsrp_header_Dummy_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Dummy_t *Dummy = (const tmsrp_header_Dummy_t *)header;
- if(Dummy->value){
- return tsk_buffer_append(output, Dummy->value, strlen(Dummy->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Dummy_t *Dummy = (const tmsrp_header_Dummy_t *)header;
+ if(Dummy->value) {
+ return tsk_buffer_append(output, Dummy->value, strlen(Dummy->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tmsrp_header_Dummy_t *tmsrp_header_Dummy_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Dummy_t *hdr_Dummy = tmsrp_header_Dummy_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 78 "./src/headers/tmsrp_header_Dummy.c" */
-static const char _tmsrp_machine_parser_header_Dummy_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 2
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_key_offsets[] = {
- 0, 0, 14, 30, 32, 33, 40, 46
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_trans_keys[] = {
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 58,
- 10, 13, 32, 127, 0, 8, 10, 31,
- 13, 127, 0, 8, 10, 31, 0
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_single_lengths[] = {
- 0, 4, 6, 2, 1, 3, 2, 0
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_range_lengths[] = {
- 0, 5, 5, 0, 0, 2, 2, 0
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_index_offsets[] = {
- 0, 0, 10, 22, 25, 27, 33, 38
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_indicies[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 3, 3, 3, 4, 3,
- 3, 3, 3, 3, 3, 1, 5, 6,
- 1, 7, 1, 9, 6, 1, 1, 1,
- 8, 11, 1, 1, 1, 10, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_trans_targs[] = {
- 2, 0, 3, 2, 5, 3, 5, 7,
- 6, 4, 6, 4
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_trans_actions[] = {
- 1, 0, 3, 0, 3, 0, 0, 0,
- 1, 7, 0, 5
-};
-
-static const char _tmsrp_machine_parser_header_Dummy_eof_actions[] = {
- 0, 0, 0, 0, 0, 7, 5, 0
-};
-
-static const int tmsrp_machine_parser_header_Dummy_start = 1;
-static const int tmsrp_machine_parser_header_Dummy_first_final = 5;
-static const int tmsrp_machine_parser_header_Dummy_error = 0;
-
-static const int tmsrp_machine_parser_header_Dummy_en_main = 1;
-
-
-/* #line 97 "./ragel/tmsrp_parser_header_Dummy.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Dummy_first_final);
- (void)(tmsrp_machine_parser_header_Dummy_error);
- (void)(tmsrp_machine_parser_header_Dummy_en_main);
-
-/* #line 144 "./src/headers/tmsrp_header_Dummy.c" */
- {
- cs = tmsrp_machine_parser_header_Dummy_start;
- }
-
-/* #line 102 "./ragel/tmsrp_parser_header_Dummy.rl" */
-
-/* #line 151 "./src/headers/tmsrp_header_Dummy.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Dummy_t *hdr_Dummy = tmsrp_header_Dummy_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 78 "./src/headers/tmsrp_header_Dummy.c" */
+ static const char _tmsrp_machine_parser_header_Dummy_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 2
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_key_offsets[] = {
+ 0, 0, 14, 30, 32, 33, 40, 46
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_trans_keys[] = {
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 58,
+ 10, 13, 32, 127, 0, 8, 10, 31,
+ 13, 127, 0, 8, 10, 31, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_single_lengths[] = {
+ 0, 4, 6, 2, 1, 3, 2, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_range_lengths[] = {
+ 0, 5, 5, 0, 0, 2, 2, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_index_offsets[] = {
+ 0, 0, 10, 22, 25, 27, 33, 38
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_indicies[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 2, 3, 3, 3, 4, 3,
+ 3, 3, 3, 3, 3, 1, 5, 6,
+ 1, 7, 1, 9, 6, 1, 1, 1,
+ 8, 11, 1, 1, 1, 10, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_trans_targs[] = {
+ 2, 0, 3, 2, 5, 3, 5, 7,
+ 6, 4, 6, 4
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_trans_actions[] = {
+ 1, 0, 3, 0, 3, 0, 0, 0,
+ 1, 7, 0, 5
+ };
+
+ static const char _tmsrp_machine_parser_header_Dummy_eof_actions[] = {
+ 0, 0, 0, 0, 0, 7, 5, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Dummy_start = 1;
+ static const int tmsrp_machine_parser_header_Dummy_first_final = 5;
+ static const int tmsrp_machine_parser_header_Dummy_error = 0;
+
+ static const int tmsrp_machine_parser_header_Dummy_en_main = 1;
+
+
+ /* #line 97 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Dummy_first_final);
+ (void)(tmsrp_machine_parser_header_Dummy_error);
+ (void)(tmsrp_machine_parser_header_Dummy_en_main);
+
+ /* #line 144 "./src/headers/tmsrp_header_Dummy.c" */
+ {
+ cs = tmsrp_machine_parser_header_Dummy_start;
+ }
+
+ /* #line 102 "./ragel/tmsrp_parser_header_Dummy.rl" */
+
+ /* #line 151 "./src/headers/tmsrp_header_Dummy.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Dummy_trans_keys + _tmsrp_machine_parser_header_Dummy_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Dummy_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Dummy_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Dummy_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Dummy_trans_keys + _tmsrp_machine_parser_header_Dummy_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Dummy_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Dummy_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Dummy_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Dummy_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Dummy_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Dummy_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Dummy_actions + _tmsrp_machine_parser_header_Dummy_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->name);
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
-/* #line 243 "./src/headers/tmsrp_header_Dummy.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Dummy_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Dummy_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Dummy_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Dummy_actions + _tmsrp_machine_parser_header_Dummy_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->name);
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ /* #line 243 "./src/headers/tmsrp_header_Dummy.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Dummy_actions + _tmsrp_machine_parser_header_Dummy_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
-/* #line 271 "./src/headers/tmsrp_header_Dummy.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 103 "./ragel/tmsrp_parser_header_Dummy.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 283 "./src/headers/tmsrp_header_Dummy.c" */
-5
-/* #line 105 "./ragel/tmsrp_parser_header_Dummy.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse Dummy header.");
- TSK_OBJECT_SAFE_FREE(hdr_Dummy);
- }
-
- return hdr_Dummy;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Dummy_actions + _tmsrp_machine_parser_header_Dummy_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ /* #line 271 "./src/headers/tmsrp_header_Dummy.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 103 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 283 "./src/headers/tmsrp_header_Dummy.c" */
+ 5
+ /* #line 105 "./ragel/tmsrp_parser_header_Dummy.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse Dummy header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Dummy);
+ }
+
+ return hdr_Dummy;
}
@@ -302,40 +312,39 @@ _again:
static tsk_object_t* tmsrp_header_Dummy_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Dummy_t *Dummy = self;
- if(Dummy){
- TMSRP_HEADER(Dummy)->type = tmsrp_htype_Dummy;
- TMSRP_HEADER(Dummy)->tostring = tmsrp_header_Dummy_tostring;
-
- Dummy->name = tsk_strdup(va_arg(*app, const char*));
- Dummy->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Dummy header.");
- }
- return self;
+ tmsrp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TMSRP_HEADER(Dummy)->type = tmsrp_htype_Dummy;
+ TMSRP_HEADER(Dummy)->tostring = tmsrp_header_Dummy_tostring;
+
+ Dummy->name = tsk_strdup(va_arg(*app, const char*));
+ Dummy->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Dummy header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Dummy_dtor(tsk_object_t *self)
{
- tmsrp_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSK_FREE(Dummy->name);
- TSK_FREE(Dummy->value);
- }
- else{
- TSK_DEBUG_ERROR("Null Dummy header.");
- }
-
- return self;
+ tmsrp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSK_FREE(Dummy->name);
+ TSK_FREE(Dummy->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Dummy header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Dummy_def_s =
-{
- sizeof(tmsrp_header_Dummy_t),
- tmsrp_header_Dummy_ctor,
- tmsrp_header_Dummy_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Dummy_def_s = {
+ sizeof(tmsrp_header_Dummy_t),
+ tmsrp_header_Dummy_ctor,
+ tmsrp_header_Dummy_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Dummy_def_t = &tmsrp_header_Dummy_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Expires.c b/tinyMSRP/src/headers/tmsrp_header_Expires.c
index 7d5c299..e77b9ba 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Expires.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Expires.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Expires.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,242 +41,252 @@
tmsrp_header_Expires_t* tmsrp_header_Expires_create(int64_t value)
{
- return tsk_object_new(TMSRP_HEADER_EXPIRES_VA_ARGS(value));
+ return tsk_object_new(TMSRP_HEADER_EXPIRES_VA_ARGS(value));
}
tmsrp_header_Expires_t* tmsrp_header_Expires_create_null()
{
- return tmsrp_header_Expires_create(-1);
+ return tmsrp_header_Expires_create(-1);
}
int tmsrp_header_Expires_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Expires_t *Expires = (const tmsrp_header_Expires_t *)header;
- if(Expires->value>=0){
- return tsk_buffer_append_2(output, "%lld", Expires->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Expires_t *Expires = (const tmsrp_header_Expires_t *)header;
+ if(Expires->value>=0) {
+ return tsk_buffer_append_2(output, "%lld", Expires->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
tmsrp_header_Expires_t *tmsrp_header_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Expires_t *hdr_Expires = tmsrp_header_Expires_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 78 "./src/headers/tmsrp_header_Expires.c" */
-static const char _tmsrp_machine_parser_header_Expires_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tmsrp_machine_parser_header_Expires_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 16, 18, 19, 22
-};
-
-static const char _tmsrp_machine_parser_header_Expires_trans_keys[] = {
- 69, 101, 88, 120, 80, 112, 73, 105,
- 82, 114, 69, 101, 83, 115, 58, 32,
- 48, 57, 10, 13, 48, 57, 0
-};
-
-static const char _tmsrp_machine_parser_header_Expires_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 1, 0, 1, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Expires_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 25, 27, 29, 32
-};
-
-static const char _tmsrp_machine_parser_header_Expires_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 1, 10, 1, 11, 1, 12, 13, 1,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Expires_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 12, 13, 11, 12
-};
-
-static const char _tmsrp_machine_parser_header_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 3, 0
-};
-
-static const char _tmsrp_machine_parser_header_Expires_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 0
-};
-
-static const int tmsrp_machine_parser_header_Expires_start = 1;
-static const int tmsrp_machine_parser_header_Expires_first_final = 12;
-static const int tmsrp_machine_parser_header_Expires_error = 0;
-
-static const int tmsrp_machine_parser_header_Expires_en_main = 1;
-
-
-/* #line 93 "./ragel/tmsrp_parser_header_Expires.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Expires_first_final);
- (void)(tmsrp_machine_parser_header_Expires_error);
- (void)(tmsrp_machine_parser_header_Expires_en_main);
-
-/* #line 145 "./src/headers/tmsrp_header_Expires.c" */
- {
- cs = tmsrp_machine_parser_header_Expires_start;
- }
-
-/* #line 98 "./ragel/tmsrp_parser_header_Expires.rl" */
-
-/* #line 152 "./src/headers/tmsrp_header_Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Expires_t *hdr_Expires = tmsrp_header_Expires_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 78 "./src/headers/tmsrp_header_Expires.c" */
+ static const char _tmsrp_machine_parser_header_Expires_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 16, 18, 19, 22
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_trans_keys[] = {
+ 69, 101, 88, 120, 80, 112, 73, 105,
+ 82, 114, 69, 101, 83, 115, 58, 32,
+ 48, 57, 10, 13, 48, 57, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 0, 1, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 25, 27, 29, 32
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 1, 10, 1, 11, 1, 12, 13, 1,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 12, 13, 11, 12
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 3, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Expires_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Expires_start = 1;
+ static const int tmsrp_machine_parser_header_Expires_first_final = 12;
+ static const int tmsrp_machine_parser_header_Expires_error = 0;
+
+ static const int tmsrp_machine_parser_header_Expires_en_main = 1;
+
+
+ /* #line 93 "./ragel/tmsrp_parser_header_Expires.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Expires_first_final);
+ (void)(tmsrp_machine_parser_header_Expires_error);
+ (void)(tmsrp_machine_parser_header_Expires_en_main);
+
+ /* #line 145 "./src/headers/tmsrp_header_Expires.c" */
+ {
+ cs = tmsrp_machine_parser_header_Expires_start;
+ }
+
+ /* #line 98 "./ragel/tmsrp_parser_header_Expires.rl" */
+
+ /* #line 152 "./src/headers/tmsrp_header_Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Expires_trans_keys + _tmsrp_machine_parser_header_Expires_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Expires_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Expires_trans_keys + _tmsrp_machine_parser_header_Expires_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Expires_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Expires_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Expires_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Expires_actions + _tmsrp_machine_parser_header_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 238 "./src/headers/tmsrp_header_Expires.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Expires_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Expires_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Expires_actions + _tmsrp_machine_parser_header_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 238 "./src/headers/tmsrp_header_Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Expires_actions + _tmsrp_machine_parser_header_Expires_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 260 "./src/headers/tmsrp_header_Expires.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 99 "./ragel/tmsrp_parser_header_Expires.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 272 "./src/headers/tmsrp_header_Expires.c" */
-12
-/* #line 101 "./ragel/tmsrp_parser_header_Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Expires);
- }
-
- return hdr_Expires;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Expires_actions + _tmsrp_machine_parser_header_Expires_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 260 "./src/headers/tmsrp_header_Expires.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 99 "./ragel/tmsrp_parser_header_Expires.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 272 "./src/headers/tmsrp_header_Expires.c" */
+ 12
+ /* #line 101 "./ragel/tmsrp_parser_header_Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Expires);
+ }
+
+ return hdr_Expires;
}
@@ -291,37 +301,36 @@ _again:
static tsk_object_t* tmsrp_header_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Expires_t *Expires = self;
- if(Expires){
- TMSRP_HEADER(Expires)->type = tmsrp_htype_Message_ID;
- TMSRP_HEADER(Expires)->tostring = tmsrp_header_Expires_tostring;
-
- Expires->value = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Expires header.");
- }
- return self;
+ tmsrp_header_Expires_t *Expires = self;
+ if(Expires) {
+ TMSRP_HEADER(Expires)->type = tmsrp_htype_Message_ID;
+ TMSRP_HEADER(Expires)->tostring = tmsrp_header_Expires_tostring;
+
+ Expires->value = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Expires header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Expires_dtor(tsk_object_t *self)
{
- tmsrp_header_Expires_t *Expires = self;
- if(Expires){
- }
- else{
- TSK_DEBUG_ERROR("Null Expires header.");
- }
-
- return self;
+ tmsrp_header_Expires_t *Expires = self;
+ if(Expires) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Expires_def_s =
-{
- sizeof(tmsrp_header_Expires_t),
- tmsrp_header_Expires_ctor,
- tmsrp_header_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Expires_def_s = {
+ sizeof(tmsrp_header_Expires_t),
+ tmsrp_header_Expires_ctor,
+ tmsrp_header_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Expires_def_t = &tmsrp_header_Expires_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Failure-Report.c b/tinyMSRP/src/headers/tmsrp_header_Failure-Report.c
index 3f45636..01f4687 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Failure-Report.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Failure-Report.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,284 +41,294 @@
tmsrp_header_Failure_Report_t* tmsrp_header_Failure_Report_create(tmsrp_freport_type_t freport_type)
{
- return tsk_object_new(TMSRP_HEADER_FAILURE_REPORT_VA_ARGS(freport_type));
+ return tsk_object_new(TMSRP_HEADER_FAILURE_REPORT_VA_ARGS(freport_type));
}
tmsrp_header_Failure_Report_t* tmsrp_header_Failure_Report_create_null()
{
- return tmsrp_header_Failure_Report_create(freport_yes);
+ return tmsrp_header_Failure_Report_create(freport_yes);
}
int tmsrp_header_Failure_Report_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Failure_Report_t *Failure_Report = (const tmsrp_header_Failure_Report_t *)header;
- const char* value = (Failure_Report->type == freport_yes) ? "yes" : (Failure_Report->type == freport_no ? "no" : "partial");
- return tsk_buffer_append(output, value, strlen(value));
- }
+ if(header) {
+ const tmsrp_header_Failure_Report_t *Failure_Report = (const tmsrp_header_Failure_Report_t *)header;
+ const char* value = (Failure_Report->type == freport_yes) ? "yes" : (Failure_Report->type == freport_no ? "no" : "partial");
+ return tsk_buffer_append(output, value, strlen(value));
+ }
- return -1;
+ return -1;
}
tmsrp_header_Failure_Report_t *tmsrp_header_Failure_Report_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Failure_Report_t *hdr_Failure_Report = tmsrp_header_Failure_Report_create_null();
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 74 "./src/headers/tmsrp_header_Failure-Report.c" */
-static const char _tmsrp_machine_parser_header_Failure_Report_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 21, 23, 25, 27,
- 28, 29, 35, 37, 38, 40, 42, 44,
- 46, 48, 50, 52, 54, 55, 55, 56
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_trans_keys[] = {
- 70, 102, 65, 97, 73, 105, 76, 108,
- 85, 117, 82, 114, 69, 101, 45, 82,
- 114, 69, 101, 80, 112, 79, 111, 82,
- 114, 84, 116, 58, 32, 78, 80, 89,
- 110, 112, 121, 79, 111, 10, 65, 97,
- 82, 114, 84, 116, 73, 105, 65, 97,
- 76, 108, 69, 101, 83, 115, 13, 13,
- 13, 0
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 1,
- 1, 6, 2, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 0, 1, 1
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 32, 35, 38, 41,
- 43, 45, 52, 55, 57, 60, 63, 66,
- 69, 72, 75, 78, 81, 83, 84, 86
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 1, 16, 1, 17, 18, 19,
- 17, 18, 19, 1, 20, 20, 1, 21,
- 1, 22, 22, 1, 23, 23, 1, 24,
- 24, 1, 25, 25, 1, 26, 26, 1,
- 27, 27, 1, 28, 28, 1, 29, 29,
- 1, 30, 1, 1, 31, 1, 32, 1,
- 0
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 20, 26, 28, 29, 21, 22,
- 23, 24, 25, 30, 27, 31, 19, 19,
- 19
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3, 5,
- 1
-};
-
-static const char _tmsrp_machine_parser_header_Failure_Report_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 5, 1
-};
-
-static const int tmsrp_machine_parser_header_Failure_Report_start = 1;
-static const int tmsrp_machine_parser_header_Failure_Report_first_final = 28;
-static const int tmsrp_machine_parser_header_Failure_Report_error = 0;
-
-static const int tmsrp_machine_parser_header_Failure_Report_en_main = 1;
-
-
-/* #line 93 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Failure_Report_first_final);
- (void)(tmsrp_machine_parser_header_Failure_Report_error);
- (void)(tmsrp_machine_parser_header_Failure_Report_en_main);
-
-/* #line 169 "./src/headers/tmsrp_header_Failure-Report.c" */
- {
- cs = tmsrp_machine_parser_header_Failure_Report_start;
- }
-
-/* #line 98 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
-
-/* #line 176 "./src/headers/tmsrp_header_Failure-Report.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Failure_Report_t *hdr_Failure_Report = tmsrp_header_Failure_Report_create_null();
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 74 "./src/headers/tmsrp_header_Failure-Report.c" */
+ static const char _tmsrp_machine_parser_header_Failure_Report_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 21, 23, 25, 27,
+ 28, 29, 35, 37, 38, 40, 42, 44,
+ 46, 48, 50, 52, 54, 55, 55, 56
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_trans_keys[] = {
+ 70, 102, 65, 97, 73, 105, 76, 108,
+ 85, 117, 82, 114, 69, 101, 45, 82,
+ 114, 69, 101, 80, 112, 79, 111, 82,
+ 114, 84, 116, 58, 32, 78, 80, 89,
+ 110, 112, 121, 79, 111, 10, 65, 97,
+ 82, 114, 84, 116, 73, 105, 65, 97,
+ 76, 108, 69, 101, 83, 115, 13, 13,
+ 13, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 1,
+ 1, 6, 2, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 1, 0, 1, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 32, 35, 38, 41,
+ 43, 45, 52, 55, 57, 60, 63, 66,
+ 69, 72, 75, 78, 81, 83, 84, 86
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 1, 16, 1, 17, 18, 19,
+ 17, 18, 19, 1, 20, 20, 1, 21,
+ 1, 22, 22, 1, 23, 23, 1, 24,
+ 24, 1, 25, 25, 1, 26, 26, 1,
+ 27, 27, 1, 28, 28, 1, 29, 29,
+ 1, 30, 1, 1, 31, 1, 32, 1,
+ 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 20, 26, 28, 29, 21, 22,
+ 23, 24, 25, 30, 27, 31, 19, 19,
+ 19
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 5,
+ 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Failure_Report_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0, 5, 1
+ };
+
+ static const int tmsrp_machine_parser_header_Failure_Report_start = 1;
+ static const int tmsrp_machine_parser_header_Failure_Report_first_final = 28;
+ static const int tmsrp_machine_parser_header_Failure_Report_error = 0;
+
+ static const int tmsrp_machine_parser_header_Failure_Report_en_main = 1;
+
+
+ /* #line 93 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Failure_Report_first_final);
+ (void)(tmsrp_machine_parser_header_Failure_Report_error);
+ (void)(tmsrp_machine_parser_header_Failure_Report_en_main);
+
+ /* #line 169 "./src/headers/tmsrp_header_Failure-Report.c" */
+ {
+ cs = tmsrp_machine_parser_header_Failure_Report_start;
+ }
+
+ /* #line 98 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+
+ /* #line 176 "./src/headers/tmsrp_header_Failure-Report.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Failure_Report_trans_keys + _tmsrp_machine_parser_header_Failure_Report_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Failure_Report_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Failure_Report_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Failure_Report_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Failure_Report_trans_keys + _tmsrp_machine_parser_header_Failure_Report_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Failure_Report_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Failure_Report_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Failure_Report_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Failure_Report_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Failure_Report_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Failure_Report_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Failure_Report_actions + _tmsrp_machine_parser_header_Failure_Report_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_yes;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_no;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_partial;
- }
- break;
-/* #line 268 "./src/headers/tmsrp_header_Failure-Report.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Failure_Report_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Failure_Report_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Failure_Report_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Failure_Report_actions + _tmsrp_machine_parser_header_Failure_Report_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_yes;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_no;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_partial;
+ }
+ break;
+ /* #line 268 "./src/headers/tmsrp_header_Failure-Report.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Failure_Report_actions + _tmsrp_machine_parser_header_Failure_Report_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_yes;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_no;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- {
- hdr_Failure_Report->type = freport_partial;
- }
- break;
-/* #line 302 "./src/headers/tmsrp_header_Failure-Report.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 99 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 314 "./src/headers/tmsrp_header_Failure-Report.c" */
-28
-/* #line 101 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Failure-Report' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Failure_Report);
- }
-
- return hdr_Failure_Report;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Failure_Report_actions + _tmsrp_machine_parser_header_Failure_Report_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_yes;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_no;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ {
+ hdr_Failure_Report->type = freport_partial;
+ }
+ break;
+ /* #line 302 "./src/headers/tmsrp_header_Failure-Report.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 99 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 314 "./src/headers/tmsrp_header_Failure-Report.c" */
+ 28
+ /* #line 101 "./ragel/tmsrp_parser_header_Failure-Report.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Failure-Report' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Failure_Report);
+ }
+
+ return hdr_Failure_Report;
}
@@ -333,37 +343,36 @@ _again:
static tsk_object_t* tmsrp_header_Failure_Report_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Failure_Report_t *Failure_Report = self;
- if(Failure_Report){
- TMSRP_HEADER(Failure_Report)->type = tmsrp_htype_Failure_Report;
- TMSRP_HEADER(Failure_Report)->tostring = tmsrp_header_Failure_Report_tostring;
-
- Failure_Report->type = va_arg(*app, tmsrp_freport_type_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Failure-Report header.");
- }
- return self;
+ tmsrp_header_Failure_Report_t *Failure_Report = self;
+ if(Failure_Report) {
+ TMSRP_HEADER(Failure_Report)->type = tmsrp_htype_Failure_Report;
+ TMSRP_HEADER(Failure_Report)->tostring = tmsrp_header_Failure_Report_tostring;
+
+ Failure_Report->type = va_arg(*app, tmsrp_freport_type_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Failure-Report header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Failure_Report_dtor(tsk_object_t *self)
{
- tmsrp_header_Failure_Report_t *Failure_Report = self;
- if(Failure_Report){
- }
- else{
- TSK_DEBUG_ERROR("Null Failure-Report header.");
- }
-
- return self;
+ tmsrp_header_Failure_Report_t *Failure_Report = self;
+ if(Failure_Report) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Failure-Report header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Failure_Report_def_s =
-{
- sizeof(tmsrp_header_Failure_Report_t),
- tmsrp_header_Failure_Report_ctor,
- tmsrp_header_Failure_Report_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Failure_Report_def_s = {
+ sizeof(tmsrp_header_Failure_Report_t),
+ tmsrp_header_Failure_Report_ctor,
+ tmsrp_header_Failure_Report_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Failure_Report_def_t = &tmsrp_header_Failure_Report_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_From-Path.c b/tinyMSRP/src/headers/tmsrp_header_From-Path.c
index 660b33f..32b79f9 100755
--- a/tinyMSRP/src/headers/tmsrp_header_From-Path.c
+++ b/tinyMSRP/src/headers/tmsrp_header_From-Path.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_From-Path.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,306 +41,316 @@
tmsrp_header_From_Path_t* tmsrp_header_From_Path_create(const tmsrp_uri_t* uri)
{
- return tsk_object_new(TMSRP_HEADER_FROM_PATH_VA_ARGS(uri));
+ return tsk_object_new(TMSRP_HEADER_FROM_PATH_VA_ARGS(uri));
}
tmsrp_header_From_Path_t* tmsrp_header_From_Path_create_null()
{
- return tmsrp_header_From_Path_create(tsk_null);
+ return tmsrp_header_From_Path_create(tsk_null);
}
int tmsrp_header_From_Path_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_From_Path_t *From_Path = (const tmsrp_header_From_Path_t *)header;
- const tsk_list_item_t *item;
-
- if(From_Path->uri){
- tmsrp_uri_serialize(From_Path->uri, output);
- }
- tsk_list_foreach(item, From_Path->otherURIs){
- tsk_buffer_append(output, " ", 1);
- tmsrp_uri_serialize(TMSRP_URI(item->data), output);
- }
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_From_Path_t *From_Path = (const tmsrp_header_From_Path_t *)header;
+ const tsk_list_item_t *item;
+
+ if(From_Path->uri) {
+ tmsrp_uri_serialize(From_Path->uri, output);
+ }
+ tsk_list_foreach(item, From_Path->otherURIs) {
+ tsk_buffer_append(output, " ", 1);
+ tmsrp_uri_serialize(TMSRP_URI(item->data), output);
+ }
+ }
+
+ return -1;
}
tmsrp_header_From_Path_t *tmsrp_header_From_Path_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_From_Path_t *header = tmsrp_header_From_Path_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 83 "./src/headers/tmsrp_header_From-Path.c" */
-static const char _tmsrp_machine_parser_header_From_Path_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 9, 11,
- 13, 15, 17, 18, 19, 20, 22, 24
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_trans_keys[] = {
- 70, 102, 82, 114, 79, 111, 77, 109,
- 45, 80, 112, 65, 97, 84, 116, 72,
- 104, 58, 32, 10, 13, 32, 13, 32,
- 0
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_single_lengths[] = {
- 0, 2, 2, 2, 2, 1, 2, 2,
- 2, 2, 1, 1, 1, 2, 2, 0
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 14, 17,
- 20, 23, 26, 28, 30, 32, 35, 38
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 1, 11, 1, 12, 1,
- 14, 15, 13, 17, 18, 16, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 13, 15, 14, 12, 13,
- 14, 12, 13
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 5, 5,
- 0, 3, 3
-};
-
-static const char _tmsrp_machine_parser_header_From_Path_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 3, 0
-};
-
-static const int tmsrp_machine_parser_header_From_Path_start = 1;
-static const int tmsrp_machine_parser_header_From_Path_first_final = 13;
-static const int tmsrp_machine_parser_header_From_Path_error = 0;
-
-static const int tmsrp_machine_parser_header_From_Path_en_main = 1;
-
-
-/* #line 112 "./ragel/tmsrp_parser_header_From-Path.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_From_Path_first_final);
- (void)(tmsrp_machine_parser_header_From_Path_error);
- (void)(tmsrp_machine_parser_header_From_Path_en_main);
-
-/* #line 154 "./src/headers/tmsrp_header_From-Path.c" */
- {
- cs = tmsrp_machine_parser_header_From_Path_start;
- }
-
-/* #line 117 "./ragel/tmsrp_parser_header_From-Path.rl" */
-
-/* #line 161 "./src/headers/tmsrp_header_From-Path.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_From_Path_t *header = tmsrp_header_From_Path_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 83 "./src/headers/tmsrp_header_From-Path.c" */
+ static const char _tmsrp_machine_parser_header_From_Path_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
+
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 9, 11,
+ 13, 15, 17, 18, 19, 20, 22, 24
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_trans_keys[] = {
+ 70, 102, 82, 114, 79, 111, 77, 109,
+ 45, 80, 112, 65, 97, 84, 116, 72,
+ 104, 58, 32, 10, 13, 32, 13, 32,
+ 0
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_single_lengths[] = {
+ 0, 2, 2, 2, 2, 1, 2, 2,
+ 2, 2, 1, 1, 1, 2, 2, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 14, 17,
+ 20, 23, 26, 28, 30, 32, 35, 38
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 1, 11, 1, 12, 1,
+ 14, 15, 13, 17, 18, 16, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 13, 15, 14, 12, 13,
+ 14, 12, 13
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 5, 5,
+ 0, 3, 3
+ };
+
+ static const char _tmsrp_machine_parser_header_From_Path_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_From_Path_start = 1;
+ static const int tmsrp_machine_parser_header_From_Path_first_final = 13;
+ static const int tmsrp_machine_parser_header_From_Path_error = 0;
+
+ static const int tmsrp_machine_parser_header_From_Path_en_main = 1;
+
+
+ /* #line 112 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_From_Path_first_final);
+ (void)(tmsrp_machine_parser_header_From_Path_error);
+ (void)(tmsrp_machine_parser_header_From_Path_en_main);
+
+ /* #line 154 "./src/headers/tmsrp_header_From-Path.c" */
+ {
+ cs = tmsrp_machine_parser_header_From_Path_start;
+ }
+
+ /* #line 117 "./ragel/tmsrp_parser_header_From-Path.rl" */
+
+ /* #line 161 "./src/headers/tmsrp_header_From-Path.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_From_Path_trans_keys + _tmsrp_machine_parser_header_From_Path_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_From_Path_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_From_Path_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_From_Path_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_From_Path_trans_keys + _tmsrp_machine_parser_header_From_Path_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_From_Path_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_From_Path_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_From_Path_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_From_Path_indicies[_trans];
- cs = _tmsrp_machine_parser_header_From_Path_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_From_Path_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_From_Path_actions + _tmsrp_machine_parser_header_From_Path_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_From-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_From-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 259 "./src/headers/tmsrp_header_From-Path.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_From_Path_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_From_Path_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_From_Path_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_From_Path_actions + _tmsrp_machine_parser_header_From_Path_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 259 "./src/headers/tmsrp_header_From-Path.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_From_Path_actions + _tmsrp_machine_parser_header_From_Path_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_From-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_From-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 299 "./src/headers/tmsrp_header_From-Path.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 118 "./ragel/tmsrp_parser_header_From-Path.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 311 "./src/headers/tmsrp_header_From-Path.c" */
-13
-/* #line 120 "./ragel/tmsrp_parser_header_From-Path.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'From-Path' header.");
- TSK_OBJECT_SAFE_FREE(header);
- }
-
- return header;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_From_Path_actions + _tmsrp_machine_parser_header_From_Path_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 299 "./src/headers/tmsrp_header_From-Path.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 118 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 311 "./src/headers/tmsrp_header_From-Path.c" */
+ 13
+ /* #line 120 "./ragel/tmsrp_parser_header_From-Path.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'From-Path' header.");
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+
+ return header;
}
tmsrp_header_From_Path_t *tmsrp_header_From_Path_clone(const tmsrp_header_From_Path_t* From_Path)
{
- tmsrp_header_From_Path_t* clone = tsk_null;
-
- if(!From_Path){
- goto bail;
- }
-
- clone = tmsrp_header_From_Path_create_null();
- clone->uri = tmsrp_uri_clone(From_Path->uri);
- if(From_Path->otherURIs){
- tsk_list_item_t *item;
- clone->otherURIs = tsk_list_create();
-
- tsk_list_foreach(item, From_Path->otherURIs){
- tmsrp_uri_t *uri = tmsrp_uri_clone(TMSRP_URI(item->data));
- tsk_list_push_back_data(clone->otherURIs, (void**)&uri);
- }
- }
+ tmsrp_header_From_Path_t* clone = tsk_null;
+
+ if(!From_Path) {
+ goto bail;
+ }
+
+ clone = tmsrp_header_From_Path_create_null();
+ clone->uri = tmsrp_uri_clone(From_Path->uri);
+ if(From_Path->otherURIs) {
+ tsk_list_item_t *item;
+ clone->otherURIs = tsk_list_create();
+
+ tsk_list_foreach(item, From_Path->otherURIs) {
+ tmsrp_uri_t *uri = tmsrp_uri_clone(TMSRP_URI(item->data));
+ tsk_list_push_back_data(clone->otherURIs, (void**)&uri);
+ }
+ }
bail:
- return clone;
+ return clone;
}
@@ -352,39 +362,38 @@ bail:
static tsk_object_t* tmsrp_header_From_Path_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_From_Path_t *From_Path = self;
- if(From_Path){
- TMSRP_HEADER(From_Path)->type = tmsrp_htype_From_Path;
- TMSRP_HEADER(From_Path)->tostring = tmsrp_header_From_Path_tostring;
-
- From_Path->uri = tsk_object_ref((void*)va_arg(*app, const tmsrp_uri_t*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new From-Path header.");
- }
- return self;
+ tmsrp_header_From_Path_t *From_Path = self;
+ if(From_Path) {
+ TMSRP_HEADER(From_Path)->type = tmsrp_htype_From_Path;
+ TMSRP_HEADER(From_Path)->tostring = tmsrp_header_From_Path_tostring;
+
+ From_Path->uri = tsk_object_ref((void*)va_arg(*app, const tmsrp_uri_t*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new From-Path header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_From_Path_dtor(tsk_object_t *self)
{
- tmsrp_header_From_Path_t *From_Path = self;
- if(From_Path){
- TSK_OBJECT_SAFE_FREE(From_Path->uri);
- TSK_OBJECT_SAFE_FREE(From_Path->otherURIs);
- }
- else{
- TSK_DEBUG_ERROR("Null From-Path header.");
- }
-
- return self;
+ tmsrp_header_From_Path_t *From_Path = self;
+ if(From_Path) {
+ TSK_OBJECT_SAFE_FREE(From_Path->uri);
+ TSK_OBJECT_SAFE_FREE(From_Path->otherURIs);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null From-Path header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_From_Path_def_s =
-{
- sizeof(tmsrp_header_From_Path_t),
- tmsrp_header_From_Path_ctor,
- tmsrp_header_From_Path_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_From_Path_def_s = {
+ sizeof(tmsrp_header_From_Path_t),
+ tmsrp_header_From_Path_ctor,
+ tmsrp_header_From_Path_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_From_Path_def_t = &tmsrp_header_From_Path_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Max-Expires.c b/tinyMSRP/src/headers/tmsrp_header_Max-Expires.c
index f23f26f..01c1d03 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Max-Expires.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Max-Expires.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,251 +41,261 @@
tmsrp_header_Max_Expires_t* tmsrp_header_Max_Expires_create(int64_t value)
{
- return tsk_object_new(TMSRP_HEADER_MAX_EXPIRES_VA_ARGS(value));
+ return tsk_object_new(TMSRP_HEADER_MAX_EXPIRES_VA_ARGS(value));
}
tmsrp_header_Max_Expires_t* tmsrp_header_Max_Expires_create_null()
{
- return tmsrp_header_Max_Expires_create(-1);
+ return tmsrp_header_Max_Expires_create(-1);
}
int tmsrp_header_Max_Expires_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Max_Expires_t *Max_Expires = (const tmsrp_header_Max_Expires_t *)header;
- if(Max_Expires->value>=0){
- return tsk_buffer_append_2(output, "%lld", Max_Expires->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Max_Expires_t *Max_Expires = (const tmsrp_header_Max_Expires_t *)header;
+ if(Max_Expires->value>=0) {
+ return tsk_buffer_append_2(output, "%lld", Max_Expires->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
tmsrp_header_Max_Expires_t *tmsrp_header_Max_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Max_Expires_t *hdr_Max_Expires = tmsrp_header_Max_Expires_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 78 "./src/headers/tmsrp_header_Max-Expires.c" */
-static const char _tmsrp_machine_parser_header_Max_Expires_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 22, 23, 25,
- 26, 29
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_trans_keys[] = {
- 77, 109, 65, 97, 88, 120, 45, 69,
- 101, 88, 120, 80, 112, 73, 105, 82,
- 114, 69, 101, 83, 115, 58, 32, 48,
- 57, 10, 13, 48, 57, 0
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 1, 1, 0, 1,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 34, 36, 38,
- 40, 43
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 1, 13, 1, 14, 1, 15, 1,
- 16, 17, 1, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 16, 17,
- 15, 16
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 3, 0
-};
-
-static const char _tmsrp_machine_parser_header_Max_Expires_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0
-};
-
-static const int tmsrp_machine_parser_header_Max_Expires_start = 1;
-static const int tmsrp_machine_parser_header_Max_Expires_first_final = 16;
-static const int tmsrp_machine_parser_header_Max_Expires_error = 0;
-
-static const int tmsrp_machine_parser_header_Max_Expires_en_main = 1;
-
-
-/* #line 93 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Max_Expires_first_final);
- (void)(tmsrp_machine_parser_header_Max_Expires_error);
- (void)(tmsrp_machine_parser_header_Max_Expires_en_main);
-
-/* #line 154 "./src/headers/tmsrp_header_Max-Expires.c" */
- {
- cs = tmsrp_machine_parser_header_Max_Expires_start;
- }
-
-/* #line 98 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
-
-/* #line 161 "./src/headers/tmsrp_header_Max-Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Max_Expires_t *hdr_Max_Expires = tmsrp_header_Max_Expires_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 78 "./src/headers/tmsrp_header_Max-Expires.c" */
+ static const char _tmsrp_machine_parser_header_Max_Expires_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 22, 23, 25,
+ 26, 29
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_trans_keys[] = {
+ 77, 109, 65, 97, 88, 120, 45, 69,
+ 101, 88, 120, 80, 112, 73, 105, 82,
+ 114, 69, 101, 83, 115, 58, 32, 48,
+ 57, 10, 13, 48, 57, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 1, 1, 0, 1,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 34, 36, 38,
+ 40, 43
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 1, 13, 1, 14, 1, 15, 1,
+ 16, 17, 1, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 16, 17,
+ 15, 16
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 3, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Max_Expires_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Max_Expires_start = 1;
+ static const int tmsrp_machine_parser_header_Max_Expires_first_final = 16;
+ static const int tmsrp_machine_parser_header_Max_Expires_error = 0;
+
+ static const int tmsrp_machine_parser_header_Max_Expires_en_main = 1;
+
+
+ /* #line 93 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Max_Expires_first_final);
+ (void)(tmsrp_machine_parser_header_Max_Expires_error);
+ (void)(tmsrp_machine_parser_header_Max_Expires_en_main);
+
+ /* #line 154 "./src/headers/tmsrp_header_Max-Expires.c" */
+ {
+ cs = tmsrp_machine_parser_header_Max_Expires_start;
+ }
+
+ /* #line 98 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+
+ /* #line 161 "./src/headers/tmsrp_header_Max-Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Max_Expires_trans_keys + _tmsrp_machine_parser_header_Max_Expires_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Max_Expires_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Max_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Max_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Max_Expires_trans_keys + _tmsrp_machine_parser_header_Max_Expires_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Max_Expires_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Max_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Max_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Max_Expires_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Max_Expires_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Max_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Max_Expires_actions + _tmsrp_machine_parser_header_Max_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Max_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 247 "./src/headers/tmsrp_header_Max-Expires.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Max_Expires_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Max_Expires_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Max_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Max_Expires_actions + _tmsrp_machine_parser_header_Max_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Max_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 247 "./src/headers/tmsrp_header_Max-Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Max_Expires_actions + _tmsrp_machine_parser_header_Max_Expires_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Max_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 269 "./src/headers/tmsrp_header_Max-Expires.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 99 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 281 "./src/headers/tmsrp_header_Max-Expires.c" */
-16
-/* #line 101 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Max-Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Max_Expires);
- }
-
- return hdr_Max_Expires;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Max_Expires_actions + _tmsrp_machine_parser_header_Max_Expires_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Max_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 269 "./src/headers/tmsrp_header_Max-Expires.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 99 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 281 "./src/headers/tmsrp_header_Max-Expires.c" */
+ 16
+ /* #line 101 "./ragel/tmsrp_parser_header_Max-Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Max-Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Max_Expires);
+ }
+
+ return hdr_Max_Expires;
}
@@ -300,37 +310,36 @@ _again:
static tsk_object_t* tmsrp_header_Max_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Max_Expires_t *Max_Expires = self;
- if(Max_Expires){
- TMSRP_HEADER(Max_Expires)->type = tmsrp_htype_Max_Expires;
- TMSRP_HEADER(Max_Expires)->tostring = tmsrp_header_Max_Expires_tostring;
-
- Max_Expires->value = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Max-Expires header.");
- }
- return self;
+ tmsrp_header_Max_Expires_t *Max_Expires = self;
+ if(Max_Expires) {
+ TMSRP_HEADER(Max_Expires)->type = tmsrp_htype_Max_Expires;
+ TMSRP_HEADER(Max_Expires)->tostring = tmsrp_header_Max_Expires_tostring;
+
+ Max_Expires->value = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Max-Expires header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Max_Expires_dtor(tsk_object_t *self)
{
- tmsrp_header_Max_Expires_t *Max_Expires = self;
- if(Max_Expires){
- }
- else{
- TSK_DEBUG_ERROR("Null Max-Expires header.");
- }
-
- return self;
+ tmsrp_header_Max_Expires_t *Max_Expires = self;
+ if(Max_Expires) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Max-Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Max_Expires_def_s =
-{
- sizeof(tmsrp_header_Max_Expires_t),
- tmsrp_header_Max_Expires_ctor,
- tmsrp_header_Max_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Max_Expires_def_s = {
+ sizeof(tmsrp_header_Max_Expires_t),
+ tmsrp_header_Max_Expires_ctor,
+ tmsrp_header_Max_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Max_Expires_def_t = &tmsrp_header_Max_Expires_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Message-ID.c b/tinyMSRP/src/headers/tmsrp_header_Message-ID.c
index 8c1f946..c542b44 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Message-ID.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Message-ID.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Message-ID.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,354 +42,363 @@
tmsrp_header_Message_ID_t* tmsrp_header_Message_ID_create(const char* value)
{
- return tsk_object_new(TMSRP_HEADER_MESSAGE_ID_VA_ARGS(value));
+ return tsk_object_new(TMSRP_HEADER_MESSAGE_ID_VA_ARGS(value));
}
tmsrp_header_Message_ID_t* tmsrp_header_Message_ID_create_null()
{
- return tmsrp_header_Message_ID_create(tsk_null);
+ return tmsrp_header_Message_ID_create(tsk_null);
}
int tmsrp_header_Message_ID_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tmsrp_header_Message_ID_t *Message_Id = (const tmsrp_header_Message_ID_t *)header;
- if(Message_Id->value){
- return tsk_buffer_append(output, Message_Id->value, strlen(Message_Id->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Message_ID_t *Message_Id = (const tmsrp_header_Message_ID_t *)header;
+ if(Message_Id->value) {
+ return tsk_buffer_append(output, Message_Id->value, strlen(Message_Id->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tmsrp_header_Message_ID_t *tmsrp_header_Message_ID_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Message_ID_t *hdr_Message_Id = tmsrp_header_Message_ID_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 81 "./src/headers/tmsrp_header_Message-ID.c" */
-static const char _tmsrp_machine_parser_header_Message_Id_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const short _tmsrp_machine_parser_header_Message_Id_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 20, 21, 27, 38,
- 49, 60, 61, 73, 73, 85, 97, 109,
- 121, 133, 145, 157, 169, 181, 193, 205,
- 217, 229, 241, 253, 265, 277, 289, 301,
- 313, 325, 337, 349, 361, 373, 385, 397
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_trans_keys[] = {
- 77, 109, 69, 101, 83, 115, 83, 115,
- 65, 97, 71, 103, 69, 101, 45, 73,
- 105, 68, 100, 58, 32, 48, 57, 65,
- 90, 97, 122, 37, 43, 61, 45, 46,
- 48, 57, 65, 90, 97, 122, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 10, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 13, 37, 43, 61, 45, 46, 48,
- 57, 65, 90, 97, 122, 13, 0
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 1, 1, 0, 3, 3,
- 3, 1, 4, 0, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 1
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3, 4, 4,
- 4, 0, 4, 0, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 0
-};
-
-static const short _tmsrp_machine_parser_header_Message_Id_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 31, 33, 37, 45,
- 53, 61, 63, 72, 73, 82, 91, 100,
- 109, 118, 127, 136, 145, 154, 163, 172,
- 181, 190, 199, 208, 217, 226, 235, 244,
- 253, 262, 271, 280, 289, 298, 307, 316
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 1, 12,
- 1, 13, 13, 13, 1, 14, 14, 14,
- 14, 14, 14, 14, 1, 15, 15, 15,
- 15, 15, 15, 15, 1, 16, 16, 16,
- 16, 16, 16, 16, 1, 17, 1, 18,
- 19, 19, 19, 19, 19, 19, 19, 1,
- 1, 18, 20, 20, 20, 20, 20, 20,
- 20, 1, 18, 21, 21, 21, 21, 21,
- 21, 21, 1, 18, 22, 22, 22, 22,
- 22, 22, 22, 1, 18, 23, 23, 23,
- 23, 23, 23, 23, 1, 18, 24, 24,
- 24, 24, 24, 24, 24, 1, 18, 25,
- 25, 25, 25, 25, 25, 25, 1, 18,
- 26, 26, 26, 26, 26, 26, 26, 1,
- 18, 27, 27, 27, 27, 27, 27, 27,
- 1, 18, 28, 28, 28, 28, 28, 28,
- 28, 1, 18, 29, 29, 29, 29, 29,
- 29, 29, 1, 18, 30, 30, 30, 30,
- 30, 30, 30, 1, 18, 31, 31, 31,
- 31, 31, 31, 31, 1, 18, 32, 32,
- 32, 32, 32, 32, 32, 1, 18, 33,
- 33, 33, 33, 33, 33, 33, 1, 18,
- 34, 34, 34, 34, 34, 34, 34, 1,
- 18, 35, 35, 35, 35, 35, 35, 35,
- 1, 18, 36, 36, 36, 36, 36, 36,
- 36, 1, 18, 37, 37, 37, 37, 37,
- 37, 37, 1, 18, 38, 38, 38, 38,
- 38, 38, 38, 1, 18, 39, 39, 39,
- 39, 39, 39, 39, 1, 18, 40, 40,
- 40, 40, 40, 40, 40, 1, 18, 41,
- 41, 41, 41, 41, 41, 41, 1, 18,
- 42, 42, 42, 42, 42, 42, 42, 1,
- 18, 43, 43, 43, 43, 43, 43, 43,
- 1, 18, 44, 44, 44, 44, 44, 44,
- 44, 1, 18, 45, 45, 45, 45, 45,
- 45, 45, 1, 18, 46, 46, 46, 46,
- 46, 46, 46, 1, 18, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 18, 19, 17, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_Message_Id_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 0, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3
-};
-
-static const int tmsrp_machine_parser_header_Message_Id_start = 1;
-static const int tmsrp_machine_parser_header_Message_Id_first_final = 18;
-static const int tmsrp_machine_parser_header_Message_Id_error = 0;
-
-static const int tmsrp_machine_parser_header_Message_Id_en_main = 1;
-
-
-/* #line 96 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Message_Id_first_final);
- (void)(tmsrp_machine_parser_header_Message_Id_error);
- (void)(tmsrp_machine_parser_header_Message_Id_en_main);
-
-/* #line 258 "./src/headers/tmsrp_header_Message-ID.c" */
- {
- cs = tmsrp_machine_parser_header_Message_Id_start;
- }
-
-/* #line 101 "./ragel/tmsrp_parser_header_Message-ID.rl" */
-
-/* #line 265 "./src/headers/tmsrp_header_Message-ID.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Message_ID_t *hdr_Message_Id = tmsrp_header_Message_ID_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 81 "./src/headers/tmsrp_header_Message-ID.c" */
+ static const char _tmsrp_machine_parser_header_Message_Id_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const short _tmsrp_machine_parser_header_Message_Id_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 20, 21, 27, 38,
+ 49, 60, 61, 73, 73, 85, 97, 109,
+ 121, 133, 145, 157, 169, 181, 193, 205,
+ 217, 229, 241, 253, 265, 277, 289, 301,
+ 313, 325, 337, 349, 361, 373, 385, 397
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_trans_keys[] = {
+ 77, 109, 69, 101, 83, 115, 83, 115,
+ 65, 97, 71, 103, 69, 101, 45, 73,
+ 105, 68, 100, 58, 32, 48, 57, 65,
+ 90, 97, 122, 37, 43, 61, 45, 46,
+ 48, 57, 65, 90, 97, 122, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 10, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 13, 37, 43, 61, 45, 46, 48,
+ 57, 65, 90, 97, 122, 13, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 1, 1, 0, 3, 3,
+ 3, 1, 4, 0, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 4, 4,
+ 4, 0, 4, 0, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 0
+ };
+
+ static const short _tmsrp_machine_parser_header_Message_Id_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 31, 33, 37, 45,
+ 53, 61, 63, 72, 73, 82, 91, 100,
+ 109, 118, 127, 136, 145, 154, 163, 172,
+ 181, 190, 199, 208, 217, 226, 235, 244,
+ 253, 262, 271, 280, 289, 298, 307, 316
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 1, 12,
+ 1, 13, 13, 13, 1, 14, 14, 14,
+ 14, 14, 14, 14, 1, 15, 15, 15,
+ 15, 15, 15, 15, 1, 16, 16, 16,
+ 16, 16, 16, 16, 1, 17, 1, 18,
+ 19, 19, 19, 19, 19, 19, 19, 1,
+ 1, 18, 20, 20, 20, 20, 20, 20,
+ 20, 1, 18, 21, 21, 21, 21, 21,
+ 21, 21, 1, 18, 22, 22, 22, 22,
+ 22, 22, 22, 1, 18, 23, 23, 23,
+ 23, 23, 23, 23, 1, 18, 24, 24,
+ 24, 24, 24, 24, 24, 1, 18, 25,
+ 25, 25, 25, 25, 25, 25, 1, 18,
+ 26, 26, 26, 26, 26, 26, 26, 1,
+ 18, 27, 27, 27, 27, 27, 27, 27,
+ 1, 18, 28, 28, 28, 28, 28, 28,
+ 28, 1, 18, 29, 29, 29, 29, 29,
+ 29, 29, 1, 18, 30, 30, 30, 30,
+ 30, 30, 30, 1, 18, 31, 31, 31,
+ 31, 31, 31, 31, 1, 18, 32, 32,
+ 32, 32, 32, 32, 32, 1, 18, 33,
+ 33, 33, 33, 33, 33, 33, 1, 18,
+ 34, 34, 34, 34, 34, 34, 34, 1,
+ 18, 35, 35, 35, 35, 35, 35, 35,
+ 1, 18, 36, 36, 36, 36, 36, 36,
+ 36, 1, 18, 37, 37, 37, 37, 37,
+ 37, 37, 1, 18, 38, 38, 38, 38,
+ 38, 38, 38, 1, 18, 39, 39, 39,
+ 39, 39, 39, 39, 1, 18, 40, 40,
+ 40, 40, 40, 40, 40, 1, 18, 41,
+ 41, 41, 41, 41, 41, 41, 1, 18,
+ 42, 42, 42, 42, 42, 42, 42, 1,
+ 18, 43, 43, 43, 43, 43, 43, 43,
+ 1, 18, 44, 44, 44, 44, 44, 44,
+ 44, 1, 18, 45, 45, 45, 45, 45,
+ 45, 45, 1, 18, 46, 46, 46, 46,
+ 46, 46, 46, 1, 18, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 18, 19, 17, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Message_Id_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3
+ };
+
+ static const int tmsrp_machine_parser_header_Message_Id_start = 1;
+ static const int tmsrp_machine_parser_header_Message_Id_first_final = 18;
+ static const int tmsrp_machine_parser_header_Message_Id_error = 0;
+
+ static const int tmsrp_machine_parser_header_Message_Id_en_main = 1;
+
+
+ /* #line 96 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Message_Id_first_final);
+ (void)(tmsrp_machine_parser_header_Message_Id_error);
+ (void)(tmsrp_machine_parser_header_Message_Id_en_main);
+
+ /* #line 258 "./src/headers/tmsrp_header_Message-ID.c" */
+ {
+ cs = tmsrp_machine_parser_header_Message_Id_start;
+ }
+
+ /* #line 101 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+
+ /* #line 265 "./src/headers/tmsrp_header_Message-ID.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Message_Id_trans_keys + _tmsrp_machine_parser_header_Message_Id_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Message_Id_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Message_Id_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Message_Id_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Message_Id_trans_keys + _tmsrp_machine_parser_header_Message_Id_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Message_Id_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Message_Id_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Message_Id_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Message_Id_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Message_Id_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Message_Id_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Message_Id_actions + _tmsrp_machine_parser_header_Message_Id_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Message_Id->value);
- }
- break;
-/* #line 351 "./src/headers/tmsrp_header_Message-ID.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Message_Id_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Message_Id_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Message_Id_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Message_Id_actions + _tmsrp_machine_parser_header_Message_Id_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Message_Id->value);
+ }
+ break;
+ /* #line 351 "./src/headers/tmsrp_header_Message-ID.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Message_Id_actions + _tmsrp_machine_parser_header_Message_Id_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 46 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Message_Id->value);
- }
- break;
-/* #line 373 "./src/headers/tmsrp_header_Message-ID.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 102 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 385 "./src/headers/tmsrp_header_Message-ID.c" */
-18
-/* #line 104 "./ragel/tmsrp_parser_header_Message-ID.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Message-Id' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Message_Id);
- }
-
- return hdr_Message_Id;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Message_Id_actions + _tmsrp_machine_parser_header_Message_Id_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 46 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Message_Id->value);
+ }
+ break;
+ /* #line 373 "./src/headers/tmsrp_header_Message-ID.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 102 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 385 "./src/headers/tmsrp_header_Message-ID.c" */
+ 18
+ /* #line 104 "./ragel/tmsrp_parser_header_Message-ID.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Message-Id' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Message_Id);
+ }
+
+ return hdr_Message_Id;
}
@@ -404,38 +413,37 @@ _again:
static tsk_object_t* tmsrp_header_Message_ID_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Message_ID_t *Message_Id = self;
- if(Message_Id){
- TMSRP_HEADER(Message_Id)->type = tmsrp_htype_Message_ID;
- TMSRP_HEADER(Message_Id)->tostring = tmsrp_header_Message_ID_tostring;
-
- Message_Id->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Message-Id header.");
- }
- return self;
+ tmsrp_header_Message_ID_t *Message_Id = self;
+ if(Message_Id) {
+ TMSRP_HEADER(Message_Id)->type = tmsrp_htype_Message_ID;
+ TMSRP_HEADER(Message_Id)->tostring = tmsrp_header_Message_ID_tostring;
+
+ Message_Id->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Message-Id header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Message_ID_dtor(tsk_object_t *self)
{
- tmsrp_header_Message_ID_t *Message_Id = self;
- if(Message_Id){
- TSK_FREE(Message_Id->value);
- }
- else{
- TSK_DEBUG_ERROR("Null Message-Id header.");
- }
-
- return self;
+ tmsrp_header_Message_ID_t *Message_Id = self;
+ if(Message_Id) {
+ TSK_FREE(Message_Id->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Message-Id header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Message_ID_def_s =
-{
- sizeof(tmsrp_header_Message_ID_t),
- tmsrp_header_Message_ID_ctor,
- tmsrp_header_Message_ID_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Message_ID_def_s = {
+ sizeof(tmsrp_header_Message_ID_t),
+ tmsrp_header_Message_ID_ctor,
+ tmsrp_header_Message_ID_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Message_ID_def_t = &tmsrp_header_Message_ID_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Min-Expires.c b/tinyMSRP/src/headers/tmsrp_header_Min-Expires.c
index f45795d..f64681e 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Min-Expires.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Min-Expires.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,251 +41,261 @@
tmsrp_header_Min_Expires_t* tmsrp_header_Min_Expires_create(int64_t value)
{
- return tsk_object_new(TMSRP_HEADER_MIN_EXPIRES_VA_ARGS(value));
+ return tsk_object_new(TMSRP_HEADER_MIN_EXPIRES_VA_ARGS(value));
}
tmsrp_header_Min_Expires_t* tmsrp_header_Min_Expires_create_null()
{
- return tmsrp_header_Min_Expires_create(-1);
+ return tmsrp_header_Min_Expires_create(-1);
}
int tmsrp_header_Min_Expires_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Min_Expires_t *Min_Expires = (const tmsrp_header_Min_Expires_t *)header;
- if(Min_Expires->value>=0){
- return tsk_buffer_append_2(output, "%lld", Min_Expires->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Min_Expires_t *Min_Expires = (const tmsrp_header_Min_Expires_t *)header;
+ if(Min_Expires->value>=0) {
+ return tsk_buffer_append_2(output, "%lld", Min_Expires->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
tmsrp_header_Min_Expires_t *tmsrp_header_Min_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Min_Expires_t *hdr_Min_Expires = tmsrp_header_Min_Expires_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 78 "./src/headers/tmsrp_header_Min-Expires.c" */
-static const char _tmsrp_machine_parser_header_Min_Expires_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 22, 23, 25,
- 26, 29
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_trans_keys[] = {
- 77, 109, 73, 105, 78, 110, 45, 69,
- 101, 88, 120, 80, 112, 73, 105, 82,
- 114, 69, 101, 83, 115, 58, 32, 48,
- 57, 10, 13, 48, 57, 0
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 1, 1, 0, 1,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 34, 36, 38,
- 40, 43
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 1, 13, 1, 14, 1, 15, 1,
- 16, 17, 1, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 16, 17,
- 15, 16
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 3, 0
-};
-
-static const char _tmsrp_machine_parser_header_Min_Expires_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0
-};
-
-static const int tmsrp_machine_parser_header_Min_Expires_start = 1;
-static const int tmsrp_machine_parser_header_Min_Expires_first_final = 16;
-static const int tmsrp_machine_parser_header_Min_Expires_error = 0;
-
-static const int tmsrp_machine_parser_header_Min_Expires_en_main = 1;
-
-
-/* #line 93 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Min_Expires_first_final);
- (void)(tmsrp_machine_parser_header_Min_Expires_error);
- (void)(tmsrp_machine_parser_header_Min_Expires_en_main);
-
-/* #line 154 "./src/headers/tmsrp_header_Min-Expires.c" */
- {
- cs = tmsrp_machine_parser_header_Min_Expires_start;
- }
-
-/* #line 98 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
-
-/* #line 161 "./src/headers/tmsrp_header_Min-Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Min_Expires_t *hdr_Min_Expires = tmsrp_header_Min_Expires_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 78 "./src/headers/tmsrp_header_Min-Expires.c" */
+ static const char _tmsrp_machine_parser_header_Min_Expires_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 22, 23, 25,
+ 26, 29
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_trans_keys[] = {
+ 77, 109, 73, 105, 78, 110, 45, 69,
+ 101, 88, 120, 80, 112, 73, 105, 82,
+ 114, 69, 101, 83, 115, 58, 32, 48,
+ 57, 10, 13, 48, 57, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 1, 1, 0, 1,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 34, 36, 38,
+ 40, 43
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 1, 13, 1, 14, 1, 15, 1,
+ 16, 17, 1, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 16, 17,
+ 15, 16
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 3, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Min_Expires_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Min_Expires_start = 1;
+ static const int tmsrp_machine_parser_header_Min_Expires_first_final = 16;
+ static const int tmsrp_machine_parser_header_Min_Expires_error = 0;
+
+ static const int tmsrp_machine_parser_header_Min_Expires_en_main = 1;
+
+
+ /* #line 93 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Min_Expires_first_final);
+ (void)(tmsrp_machine_parser_header_Min_Expires_error);
+ (void)(tmsrp_machine_parser_header_Min_Expires_en_main);
+
+ /* #line 154 "./src/headers/tmsrp_header_Min-Expires.c" */
+ {
+ cs = tmsrp_machine_parser_header_Min_Expires_start;
+ }
+
+ /* #line 98 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+
+ /* #line 161 "./src/headers/tmsrp_header_Min-Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Min_Expires_trans_keys + _tmsrp_machine_parser_header_Min_Expires_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Min_Expires_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Min_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Min_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Min_Expires_trans_keys + _tmsrp_machine_parser_header_Min_Expires_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Min_Expires_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Min_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Min_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Min_Expires_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Min_Expires_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Min_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Min_Expires_actions + _tmsrp_machine_parser_header_Min_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Min_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 247 "./src/headers/tmsrp_header_Min-Expires.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Min_Expires_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Min_Expires_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Min_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Min_Expires_actions + _tmsrp_machine_parser_header_Min_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Min_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 247 "./src/headers/tmsrp_header_Min-Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Min_Expires_actions + _tmsrp_machine_parser_header_Min_Expires_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_Min_Expires->value, int64_t, atoi64)
- }
- break;
-/* #line 269 "./src/headers/tmsrp_header_Min-Expires.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 99 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 281 "./src/headers/tmsrp_header_Min-Expires.c" */
-16
-/* #line 101 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Min-Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Min_Expires);
- }
-
- return hdr_Min_Expires;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Min_Expires_actions + _tmsrp_machine_parser_header_Min_Expires_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_Min_Expires->value, int64_t, atoi64)
+ }
+ break;
+ /* #line 269 "./src/headers/tmsrp_header_Min-Expires.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 99 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 281 "./src/headers/tmsrp_header_Min-Expires.c" */
+ 16
+ /* #line 101 "./ragel/tmsrp_parser_header_Min-Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Min-Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Min_Expires);
+ }
+
+ return hdr_Min_Expires;
}
@@ -300,37 +310,36 @@ _again:
static tsk_object_t* tmsrp_header_Min_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Min_Expires_t *Min_Expires = self;
- if(Min_Expires){
- TMSRP_HEADER(Min_Expires)->type = tmsrp_htype_Min_Expires;
- TMSRP_HEADER(Min_Expires)->tostring = tmsrp_header_Min_Expires_tostring;
-
- Min_Expires->value = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Min-Expires header.");
- }
- return self;
+ tmsrp_header_Min_Expires_t *Min_Expires = self;
+ if(Min_Expires) {
+ TMSRP_HEADER(Min_Expires)->type = tmsrp_htype_Min_Expires;
+ TMSRP_HEADER(Min_Expires)->tostring = tmsrp_header_Min_Expires_tostring;
+
+ Min_Expires->value = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Min-Expires header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Min_Expires_dtor(tsk_object_t *self)
{
- tmsrp_header_Min_Expires_t *Min_Expires = self;
- if(Min_Expires){
- }
- else{
- TSK_DEBUG_ERROR("Null Min-Expires header.");
- }
-
- return self;
+ tmsrp_header_Min_Expires_t *Min_Expires = self;
+ if(Min_Expires) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Min-Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Min_Expires_def_s =
-{
- sizeof(tmsrp_header_Min_Expires_t),
- tmsrp_header_Min_Expires_ctor,
- tmsrp_header_Min_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Min_Expires_def_s = {
+ sizeof(tmsrp_header_Min_Expires_t),
+ tmsrp_header_Min_Expires_ctor,
+ tmsrp_header_Min_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Min_Expires_def_t = &tmsrp_header_Min_Expires_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Status.c b/tinyMSRP/src/headers/tmsrp_header_Status.c
index dd1bafe..7948b49 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Status.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Status.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Status.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,284 +42,294 @@
tmsrp_header_Status_t* tmsrp_header_Status_create(short _namespace, short code, const char* reason)
{
- return tsk_object_new(TMSRP_HEADER_STATUS_VA_ARGS(_namespace, code, reason));
+ return tsk_object_new(TMSRP_HEADER_STATUS_VA_ARGS(_namespace, code, reason));
}
tmsrp_header_Status_t* tmsrp_header_Status_create_null()
{
- return tmsrp_header_Status_create(0, 200, tsk_null);
+ return tmsrp_header_Status_create(0, 200, tsk_null);
}
int tmsrp_header_Status_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Status_t *Status = (const tmsrp_header_Status_t *)header;
-
- // Status: 000 200 OK
- return tsk_buffer_append_2(output, "%.3hi %.3hi%s%s",
- Status->_namespace,
- Status->code,
- Status->reason ? " " : "",
- Status->reason ? Status->reason : ""
- );
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Status_t *Status = (const tmsrp_header_Status_t *)header;
+
+ // Status: 000 200 OK
+ return tsk_buffer_append_2(output, "%.3hi %.3hi%s%s",
+ Status->_namespace,
+ Status->code,
+ Status->reason ? " " : "",
+ Status->reason ? Status->reason : ""
+ );
+ }
+
+ return -1;
}
tmsrp_header_Status_t *tmsrp_header_Status_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Status_t *hdr_Status = tmsrp_header_Status_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 84 "./src/headers/tmsrp_header_Status.c" */
-static const char _tmsrp_machine_parser_header_Status_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 2, 0, 3
-};
-
-static const char _tmsrp_machine_parser_header_Status_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 13, 14, 16, 18, 20, 21, 23, 25,
- 27, 28, 30, 30, 36
-};
-
-static const char _tmsrp_machine_parser_header_Status_trans_keys[] = {
- 83, 115, 84, 116, 65, 97, 84, 116,
- 85, 117, 83, 115, 58, 32, 48, 57,
- 48, 57, 48, 57, 32, 48, 57, 48,
- 57, 48, 57, 10, 13, 32, 13, 127,
- 0, 8, 10, 31, 13, 127, 0, 8,
- 10, 31, 0
-};
-
-static const char _tmsrp_machine_parser_header_Status_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 1,
- 1, 0, 0, 0, 1, 0, 0, 0,
- 1, 2, 0, 2, 2
-};
-
-static const char _tmsrp_machine_parser_header_Status_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 0, 1, 1, 1,
- 0, 0, 0, 2, 2
-};
-
-static const char _tmsrp_machine_parser_header_Status_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 20, 22, 24, 26, 28, 30, 32, 34,
- 36, 38, 41, 42, 47
-};
-
-static const char _tmsrp_machine_parser_header_Status_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 1, 8, 1, 9, 1,
- 10, 1, 11, 1, 12, 1, 13, 1,
- 14, 1, 15, 1, 16, 1, 17, 18,
- 1, 1, 20, 1, 1, 1, 19, 22,
- 1, 1, 1, 21, 0
-};
-
-static const char _tmsrp_machine_parser_header_Status_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 17,
- 18, 16, 19, 20, 16, 20, 16
-};
-
-static const char _tmsrp_machine_parser_header_Status_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 3, 1, 0, 0,
- 0, 5, 5, 1, 9, 0, 7
-};
-
-static const char _tmsrp_machine_parser_header_Status_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 9, 7
-};
-
-static const int tmsrp_machine_parser_header_Status_start = 1;
-static const int tmsrp_machine_parser_header_Status_first_final = 17;
-static const int tmsrp_machine_parser_header_Status_error = 0;
-
-static const int tmsrp_machine_parser_header_Status_en_main = 1;
-
-
-/* #line 109 "./ragel/tmsrp_parser_header_Status.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Status_first_final);
- (void)(tmsrp_machine_parser_header_Status_error);
- (void)(tmsrp_machine_parser_header_Status_en_main);
-
-/* #line 164 "./src/headers/tmsrp_header_Status.c" */
- {
- cs = tmsrp_machine_parser_header_Status_start;
- }
-
-/* #line 114 "./ragel/tmsrp_parser_header_Status.rl" */
-
-/* #line 171 "./src/headers/tmsrp_header_Status.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Status_t *hdr_Status = tmsrp_header_Status_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 84 "./src/headers/tmsrp_header_Status.c" */
+ static const char _tmsrp_machine_parser_header_Status_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 2, 0, 3
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 13, 14, 16, 18, 20, 21, 23, 25,
+ 27, 28, 30, 30, 36
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_trans_keys[] = {
+ 83, 115, 84, 116, 65, 97, 84, 116,
+ 85, 117, 83, 115, 58, 32, 48, 57,
+ 48, 57, 48, 57, 32, 48, 57, 48,
+ 57, 48, 57, 10, 13, 32, 13, 127,
+ 0, 8, 10, 31, 13, 127, 0, 8,
+ 10, 31, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 1,
+ 1, 0, 0, 0, 1, 0, 0, 0,
+ 1, 2, 0, 2, 2
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 0, 1, 1, 1,
+ 0, 0, 0, 2, 2
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 20, 22, 24, 26, 28, 30, 32, 34,
+ 36, 38, 41, 42, 47
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 1, 8, 1, 9, 1,
+ 10, 1, 11, 1, 12, 1, 13, 1,
+ 14, 1, 15, 1, 16, 1, 17, 18,
+ 1, 1, 20, 1, 1, 1, 19, 22,
+ 1, 1, 1, 21, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 17,
+ 18, 16, 19, 20, 16, 20, 16
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 3, 1, 0, 0,
+ 0, 5, 5, 1, 9, 0, 7
+ };
+
+ static const char _tmsrp_machine_parser_header_Status_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 9, 7
+ };
+
+ static const int tmsrp_machine_parser_header_Status_start = 1;
+ static const int tmsrp_machine_parser_header_Status_first_final = 17;
+ static const int tmsrp_machine_parser_header_Status_error = 0;
+
+ static const int tmsrp_machine_parser_header_Status_en_main = 1;
+
+
+ /* #line 109 "./ragel/tmsrp_parser_header_Status.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Status_first_final);
+ (void)(tmsrp_machine_parser_header_Status_error);
+ (void)(tmsrp_machine_parser_header_Status_en_main);
+
+ /* #line 164 "./src/headers/tmsrp_header_Status.c" */
+ {
+ cs = tmsrp_machine_parser_header_Status_start;
+ }
+
+ /* #line 114 "./ragel/tmsrp_parser_header_Status.rl" */
+
+ /* #line 171 "./src/headers/tmsrp_header_Status.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Status_trans_keys + _tmsrp_machine_parser_header_Status_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Status_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Status_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Status_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Status_trans_keys + _tmsrp_machine_parser_header_Status_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Status_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Status_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Status_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Status_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Status_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Status_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Status_actions + _tmsrp_machine_parser_header_Status_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- TSK_PARSER_SET_INT(hdr_Status->_namespace);
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- TSK_PARSER_SET_INT(hdr_Status->code);
- }
- break;
- case 3:
-/* #line 53 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Status->reason);
- }
- break;
-/* #line 269 "./src/headers/tmsrp_header_Status.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Status_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Status_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Status_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Status_actions + _tmsrp_machine_parser_header_Status_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ TSK_PARSER_SET_INT(hdr_Status->_namespace);
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ TSK_PARSER_SET_INT(hdr_Status->code);
+ }
+ break;
+ case 3:
+ /* #line 53 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Status->reason);
+ }
+ break;
+ /* #line 269 "./src/headers/tmsrp_header_Status.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Status_actions + _tmsrp_machine_parser_header_Status_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- tag_start = p;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- TSK_PARSER_SET_INT(hdr_Status->code);
- }
- break;
- case 3:
-/* #line 53 "./ragel/tmsrp_parser_header_Status.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Status->reason);
- }
- break;
-/* #line 303 "./src/headers/tmsrp_header_Status.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 115 "./ragel/tmsrp_parser_header_Status.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 315 "./src/headers/tmsrp_header_Status.c" */
-17
-/* #line 117 "./ragel/tmsrp_parser_header_Status.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Status' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Status);
- }
-
- return hdr_Status;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Status_actions + _tmsrp_machine_parser_header_Status_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ TSK_PARSER_SET_INT(hdr_Status->code);
+ }
+ break;
+ case 3:
+ /* #line 53 "./ragel/tmsrp_parser_header_Status.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Status->reason);
+ }
+ break;
+ /* #line 303 "./src/headers/tmsrp_header_Status.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 115 "./ragel/tmsrp_parser_header_Status.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 315 "./src/headers/tmsrp_header_Status.c" */
+ 17
+ /* #line 117 "./ragel/tmsrp_parser_header_Status.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Status' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Status);
+ }
+
+ return hdr_Status;
}
@@ -334,44 +344,43 @@ _again:
static tsk_object_t* tmsrp_header_Status_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Status_t *Status = self;
- if(Status){
- TMSRP_HEADER(Status)->type = tmsrp_htype_Status;
- TMSRP_HEADER(Status)->tostring = tmsrp_header_Status_tostring;
+ tmsrp_header_Status_t *Status = self;
+ if(Status) {
+ TMSRP_HEADER(Status)->type = tmsrp_htype_Status;
+ TMSRP_HEADER(Status)->tostring = tmsrp_header_Status_tostring;
#if defined(__GNUC__)
- Status->_namespace = (short)va_arg(*app, int);
- Status->code = (short)va_arg(*app, int);
+ Status->_namespace = (short)va_arg(*app, int);
+ Status->code = (short)va_arg(*app, int);
#else
- Status->_namespace = va_arg(*app, short);
- Status->code = va_arg(*app, short);
+ Status->_namespace = va_arg(*app, short);
+ Status->code = va_arg(*app, short);
#endif
- Status->reason = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Status header.");
- }
- return self;
+ Status->reason = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Status header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Status_dtor(tsk_object_t *self)
{
- tmsrp_header_Status_t *Status = self;
- if(Status){
- TSK_FREE(Status->reason);
- }
- else{
- TSK_DEBUG_ERROR("Null Status header.");
- }
-
- return self;
+ tmsrp_header_Status_t *Status = self;
+ if(Status) {
+ TSK_FREE(Status->reason);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Status header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Status_def_s =
-{
- sizeof(tmsrp_header_Status_t),
- tmsrp_header_Status_ctor,
- tmsrp_header_Status_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Status_def_s = {
+ sizeof(tmsrp_header_Status_t),
+ tmsrp_header_Status_ctor,
+ tmsrp_header_Status_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Status_def_t = &tmsrp_header_Status_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Success-Report.c b/tinyMSRP/src/headers/tmsrp_header_Success-Report.c
index bb19c9e..afd046b 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Success-Report.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Success-Report.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Success-Report.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,265 +40,275 @@
tmsrp_header_Success_Report_t* tmsrp_header_Success_Report_create(tsk_bool_t isSuccess)
{
- return tsk_object_new(TMSRP_HEADER_SUCCESS_REPORT_VA_ARGS(isSuccess));
+ return tsk_object_new(TMSRP_HEADER_SUCCESS_REPORT_VA_ARGS(isSuccess));
}
tmsrp_header_Success_Report_t* tmsrp_header_Success_Report_create_null()
{
- return tmsrp_header_Success_Report_create(tsk_false);
+ return tmsrp_header_Success_Report_create(tsk_false);
}
int tmsrp_header_Success_Report_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Success_Report_t *Success_Report = (const tmsrp_header_Success_Report_t *)header;
- const char* value = Success_Report->yes ? "yes" : "no";
- return tsk_buffer_append(output, value, strlen(value));
- }
+ if(header) {
+ const tmsrp_header_Success_Report_t *Success_Report = (const tmsrp_header_Success_Report_t *)header;
+ const char* value = Success_Report->yes ? "yes" : "no";
+ return tsk_buffer_append(output, value, strlen(value));
+ }
- return -1;
+ return -1;
}
tmsrp_header_Success_Report_t *tmsrp_header_Success_Report_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Success_Report_t *hdr_Success_Report = tmsrp_header_Success_Report_create_null();
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 73 "./src/headers/tmsrp_header_Success-Report.c" */
-static const char _tmsrp_machine_parser_header_Success_Report_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 15, 17, 19, 21, 23, 25, 27,
- 28, 29, 33, 35, 36, 38, 40, 41,
- 41
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_trans_keys[] = {
- 83, 115, 85, 117, 67, 99, 67, 99,
- 69, 101, 83, 115, 83, 115, 45, 82,
- 114, 69, 101, 80, 112, 79, 111, 82,
- 114, 84, 116, 58, 32, 78, 89, 110,
- 121, 79, 111, 10, 69, 101, 83, 115,
- 13, 13, 0
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 1,
- 1, 4, 2, 1, 2, 2, 1, 0,
- 1
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 23, 26, 29, 32, 35, 38, 41,
- 43, 45, 50, 53, 55, 58, 61, 63,
- 64
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 1, 16, 1, 17, 18, 17,
- 18, 1, 19, 19, 1, 20, 1, 21,
- 21, 1, 22, 22, 1, 23, 1, 1,
- 24, 1, 0
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 20, 22, 23, 21, 24, 19,
- 19
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 3,
- 1
-};
-
-static const char _tmsrp_machine_parser_header_Success_Report_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3, 0,
- 1
-};
-
-static const int tmsrp_machine_parser_header_Success_Report_start = 1;
-static const int tmsrp_machine_parser_header_Success_Report_first_final = 22;
-static const int tmsrp_machine_parser_header_Success_Report_error = 0;
-
-static const int tmsrp_machine_parser_header_Success_Report_en_main = 1;
-
-
-/* #line 88 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Success_Report_first_final);
- (void)(tmsrp_machine_parser_header_Success_Report_error);
- (void)(tmsrp_machine_parser_header_Success_Report_en_main);
-
-/* #line 161 "./src/headers/tmsrp_header_Success-Report.c" */
- {
- cs = tmsrp_machine_parser_header_Success_Report_start;
- }
-
-/* #line 93 "./ragel/tmsrp_parser_header_Success-Report.rl" */
-
-/* #line 168 "./src/headers/tmsrp_header_Success-Report.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Success_Report_t *hdr_Success_Report = tmsrp_header_Success_Report_create_null();
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 73 "./src/headers/tmsrp_header_Success-Report.c" */
+ static const char _tmsrp_machine_parser_header_Success_Report_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 15, 17, 19, 21, 23, 25, 27,
+ 28, 29, 33, 35, 36, 38, 40, 41,
+ 41
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_trans_keys[] = {
+ 83, 115, 85, 117, 67, 99, 67, 99,
+ 69, 101, 83, 115, 83, 115, 45, 82,
+ 114, 69, 101, 80, 112, 79, 111, 82,
+ 114, 84, 116, 58, 32, 78, 89, 110,
+ 121, 79, 111, 10, 69, 101, 83, 115,
+ 13, 13, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 1,
+ 1, 4, 2, 1, 2, 2, 1, 0,
+ 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 23, 26, 29, 32, 35, 38, 41,
+ 43, 45, 50, 53, 55, 58, 61, 63,
+ 64
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 1, 16, 1, 17, 18, 17,
+ 18, 1, 19, 19, 1, 20, 1, 21,
+ 21, 1, 22, 22, 1, 23, 1, 1,
+ 24, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 20, 22, 23, 21, 24, 19,
+ 19
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3,
+ 1
+ };
+
+ static const char _tmsrp_machine_parser_header_Success_Report_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0,
+ 1
+ };
+
+ static const int tmsrp_machine_parser_header_Success_Report_start = 1;
+ static const int tmsrp_machine_parser_header_Success_Report_first_final = 22;
+ static const int tmsrp_machine_parser_header_Success_Report_error = 0;
+
+ static const int tmsrp_machine_parser_header_Success_Report_en_main = 1;
+
+
+ /* #line 88 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Success_Report_first_final);
+ (void)(tmsrp_machine_parser_header_Success_Report_error);
+ (void)(tmsrp_machine_parser_header_Success_Report_en_main);
+
+ /* #line 161 "./src/headers/tmsrp_header_Success-Report.c" */
+ {
+ cs = tmsrp_machine_parser_header_Success_Report_start;
+ }
+
+ /* #line 93 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+
+ /* #line 168 "./src/headers/tmsrp_header_Success-Report.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Success_Report_trans_keys + _tmsrp_machine_parser_header_Success_Report_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Success_Report_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Success_Report_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Success_Report_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Success_Report_trans_keys + _tmsrp_machine_parser_header_Success_Report_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Success_Report_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Success_Report_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Success_Report_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_header_Success_Report_indicies[_trans];
- cs = _tmsrp_machine_parser_header_Success_Report_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Success_Report_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Success_Report_actions + _tmsrp_machine_parser_header_Success_Report_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- {
- hdr_Success_Report->yes = 1;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- {
- hdr_Success_Report->yes = 0;
- }
- break;
-/* #line 254 "./src/headers/tmsrp_header_Success-Report.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_header_Success_Report_indicies[_trans];
+ cs = _tmsrp_machine_parser_header_Success_Report_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Success_Report_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Success_Report_actions + _tmsrp_machine_parser_header_Success_Report_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ {
+ hdr_Success_Report->yes = 1;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ {
+ hdr_Success_Report->yes = 0;
+ }
+ break;
+ /* #line 254 "./src/headers/tmsrp_header_Success-Report.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Success_Report_actions + _tmsrp_machine_parser_header_Success_Report_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- {
- hdr_Success_Report->yes = 1;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- {
- hdr_Success_Report->yes = 0;
- }
- break;
-/* #line 282 "./src/headers/tmsrp_header_Success-Report.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 94 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 294 "./src/headers/tmsrp_header_Success-Report.c" */
-22
-/* #line 96 "./ragel/tmsrp_parser_header_Success-Report.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Success-Report' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Success_Report);
- }
-
- return hdr_Success_Report;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Success_Report_actions + _tmsrp_machine_parser_header_Success_Report_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ {
+ hdr_Success_Report->yes = 1;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ {
+ hdr_Success_Report->yes = 0;
+ }
+ break;
+ /* #line 282 "./src/headers/tmsrp_header_Success-Report.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 94 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 294 "./src/headers/tmsrp_header_Success-Report.c" */
+ 22
+ /* #line 96 "./ragel/tmsrp_parser_header_Success-Report.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Success-Report' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Success_Report);
+ }
+
+ return hdr_Success_Report;
}
@@ -313,37 +323,36 @@ _again:
static tsk_object_t* tmsrp_header_Success_Report_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Success_Report_t *Success_Report = self;
- if(Success_Report){
- TMSRP_HEADER(Success_Report)->type = tmsrp_htype_Success_Report;
- TMSRP_HEADER(Success_Report)->tostring = tmsrp_header_Success_Report_tostring;
-
- Success_Report->yes = va_arg(*app, tsk_bool_t) ? 1 : 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Success-Report header.");
- }
- return self;
+ tmsrp_header_Success_Report_t *Success_Report = self;
+ if(Success_Report) {
+ TMSRP_HEADER(Success_Report)->type = tmsrp_htype_Success_Report;
+ TMSRP_HEADER(Success_Report)->tostring = tmsrp_header_Success_Report_tostring;
+
+ Success_Report->yes = va_arg(*app, tsk_bool_t) ? 1 : 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Success-Report header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Success_Report_dtor(tsk_object_t *self)
{
- tmsrp_header_Success_Report_t *Success_Report = self;
- if(Success_Report){
- }
- else{
- TSK_DEBUG_ERROR("Null Success-Report header.");
- }
-
- return self;
+ tmsrp_header_Success_Report_t *Success_Report = self;
+ if(Success_Report) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Success-Report header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Success_Report_def_s =
-{
- sizeof(tmsrp_header_Success_Report_t),
- tmsrp_header_Success_Report_ctor,
- tmsrp_header_Success_Report_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Success_Report_def_s = {
+ sizeof(tmsrp_header_Success_Report_t),
+ tmsrp_header_Success_Report_ctor,
+ tmsrp_header_Success_Report_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Success_Report_def_t = &tmsrp_header_Success_Report_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_To-Path.c b/tinyMSRP/src/headers/tmsrp_header_To-Path.c
index 3346311..3473209 100755
--- a/tinyMSRP/src/headers/tmsrp_header_To-Path.c
+++ b/tinyMSRP/src/headers/tmsrp_header_To-Path.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_To-Path.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,299 +40,309 @@
tmsrp_header_To_Path_t* tmsrp_header_To_Path_create(const tmsrp_uri_t* uri)
{
- return tsk_object_new(TMSRP_HEADER_TO_PATH_VA_ARGS(uri));
+ return tsk_object_new(TMSRP_HEADER_TO_PATH_VA_ARGS(uri));
}
tmsrp_header_To_Path_t* tmsrp_header_To_Path_create_null()
{
- return tmsrp_header_To_Path_create(tsk_null);
+ return tmsrp_header_To_Path_create(tsk_null);
}
int tmsrp_header_To_Path_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_To_Path_t *To_Path = (const tmsrp_header_To_Path_t *)header;
- const tsk_list_item_t *item;
-
- if(To_Path->uri){
- tmsrp_uri_serialize(To_Path->uri, output);
- }
- tsk_list_foreach(item, To_Path->otherURIs){
- tsk_buffer_append(output, " ", 1);
- tmsrp_uri_serialize(TMSRP_URI(item->data), output);
- }
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_To_Path_t *To_Path = (const tmsrp_header_To_Path_t *)header;
+ const tsk_list_item_t *item;
+
+ if(To_Path->uri) {
+ tmsrp_uri_serialize(To_Path->uri, output);
+ }
+ tsk_list_foreach(item, To_Path->otherURIs) {
+ tsk_buffer_append(output, " ", 1);
+ tmsrp_uri_serialize(TMSRP_URI(item->data), output);
+ }
+ }
+
+ return -1;
}
tmsrp_header_To_Path_t *tmsrp_header_To_Path_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_To_Path_t *header = tmsrp_header_To_Path_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 82 "./src/headers/tmsrp_header_To-Path.c" */
-static const char _tmsrp_machine_parser_header_To_Path_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_key_offsets[] = {
- 0, 0, 2, 4, 5, 7, 9, 11,
- 13, 14, 15, 16, 18, 20
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_trans_keys[] = {
- 84, 116, 79, 111, 45, 80, 112, 65,
- 97, 84, 116, 72, 104, 58, 32, 10,
- 13, 32, 13, 32, 0
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_single_lengths[] = {
- 0, 2, 2, 1, 2, 2, 2, 2,
- 1, 1, 1, 2, 2, 0
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_index_offsets[] = {
- 0, 0, 3, 6, 8, 11, 14, 17,
- 20, 22, 24, 26, 29, 32
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_trans_targs[] = {
- 2, 2, 0, 3, 3, 0, 4, 0,
- 5, 5, 0, 6, 6, 0, 7, 7,
- 0, 8, 8, 0, 9, 0, 11, 0,
- 13, 0, 10, 11, 12, 10, 11, 12,
- 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 1, 3, 3, 0,
- 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_To_Path_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 3, 0
-};
-
-static const int tmsrp_machine_parser_header_To_Path_start = 1;
-static const int tmsrp_machine_parser_header_To_Path_first_final = 11;
-static const int tmsrp_machine_parser_header_To_Path_error = 0;
-
-static const int tmsrp_machine_parser_header_To_Path_en_main = 1;
-
-
-/* #line 111 "./ragel/tmsrp_parser_header_To-Path.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_To_Path_first_final);
- (void)(tmsrp_machine_parser_header_To_Path_error);
- (void)(tmsrp_machine_parser_header_To_Path_en_main);
-
-/* #line 148 "./src/headers/tmsrp_header_To-Path.c" */
- {
- cs = tmsrp_machine_parser_header_To_Path_start;
- }
-
-/* #line 116 "./ragel/tmsrp_parser_header_To-Path.rl" */
-
-/* #line 155 "./src/headers/tmsrp_header_To-Path.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_To_Path_t *header = tmsrp_header_To_Path_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 82 "./src/headers/tmsrp_header_To-Path.c" */
+ static const char _tmsrp_machine_parser_header_To_Path_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
+
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_key_offsets[] = {
+ 0, 0, 2, 4, 5, 7, 9, 11,
+ 13, 14, 15, 16, 18, 20
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_trans_keys[] = {
+ 84, 116, 79, 111, 45, 80, 112, 65,
+ 97, 84, 116, 72, 104, 58, 32, 10,
+ 13, 32, 13, 32, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_single_lengths[] = {
+ 0, 2, 2, 1, 2, 2, 2, 2,
+ 1, 1, 1, 2, 2, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_index_offsets[] = {
+ 0, 0, 3, 6, 8, 11, 14, 17,
+ 20, 22, 24, 26, 29, 32
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_trans_targs[] = {
+ 2, 2, 0, 3, 3, 0, 4, 0,
+ 5, 5, 0, 6, 6, 0, 7, 7,
+ 0, 8, 8, 0, 9, 0, 11, 0,
+ 13, 0, 10, 11, 12, 10, 11, 12,
+ 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 1, 3, 3, 0,
+ 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_To_Path_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_To_Path_start = 1;
+ static const int tmsrp_machine_parser_header_To_Path_first_final = 11;
+ static const int tmsrp_machine_parser_header_To_Path_error = 0;
+
+ static const int tmsrp_machine_parser_header_To_Path_en_main = 1;
+
+
+ /* #line 111 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_To_Path_first_final);
+ (void)(tmsrp_machine_parser_header_To_Path_error);
+ (void)(tmsrp_machine_parser_header_To_Path_en_main);
+
+ /* #line 148 "./src/headers/tmsrp_header_To-Path.c" */
+ {
+ cs = tmsrp_machine_parser_header_To_Path_start;
+ }
+
+ /* #line 116 "./ragel/tmsrp_parser_header_To-Path.rl" */
+
+ /* #line 155 "./src/headers/tmsrp_header_To-Path.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_To_Path_trans_keys + _tmsrp_machine_parser_header_To_Path_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_To_Path_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_To_Path_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_To_Path_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_To_Path_trans_keys + _tmsrp_machine_parser_header_To_Path_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_To_Path_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_To_Path_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_To_Path_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tmsrp_machine_parser_header_To_Path_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_To_Path_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_To_Path_actions + _tmsrp_machine_parser_header_To_Path_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_To-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_To-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 252 "./src/headers/tmsrp_header_To-Path.c" */
- }
- }
+ cs = _tmsrp_machine_parser_header_To_Path_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_To_Path_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_To_Path_actions + _tmsrp_machine_parser_header_To_Path_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 252 "./src/headers/tmsrp_header_To-Path.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_To_Path_actions + _tmsrp_machine_parser_header_To_Path_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_To-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_To-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 292 "./src/headers/tmsrp_header_To-Path.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 117 "./ragel/tmsrp_parser_header_To-Path.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 304 "./src/headers/tmsrp_header_To-Path.c" */
-11
-/* #line 119 "./ragel/tmsrp_parser_header_To-Path.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'To-Path' header.");
- TSK_OBJECT_SAFE_FREE(header);
- }
-
- return header;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_To_Path_actions + _tmsrp_machine_parser_header_To_Path_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 292 "./src/headers/tmsrp_header_To-Path.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 117 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 304 "./src/headers/tmsrp_header_To-Path.c" */
+ 11
+ /* #line 119 "./ragel/tmsrp_parser_header_To-Path.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'To-Path' header.");
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+
+ return header;
}
tmsrp_header_To_Path_t *tmsrp_header_To_Path_clone(const tmsrp_header_To_Path_t* To_Path)
{
- tmsrp_header_To_Path_t* clone = tsk_null;
-
- if(!To_Path){
- goto bail;
- }
-
- clone = tmsrp_header_To_Path_create_null();
- clone->uri = tmsrp_uri_clone(To_Path->uri);
- if(To_Path->otherURIs){
- tsk_list_item_t *item;
- clone->otherURIs = tsk_list_create();
-
- tsk_list_foreach(item, To_Path->otherURIs){
- tmsrp_uri_t *uri = tmsrp_uri_clone(TMSRP_URI(item->data));
- tsk_list_push_back_data(clone->otherURIs, (void**)&uri);
- }
- }
+ tmsrp_header_To_Path_t* clone = tsk_null;
+
+ if(!To_Path) {
+ goto bail;
+ }
+
+ clone = tmsrp_header_To_Path_create_null();
+ clone->uri = tmsrp_uri_clone(To_Path->uri);
+ if(To_Path->otherURIs) {
+ tsk_list_item_t *item;
+ clone->otherURIs = tsk_list_create();
+
+ tsk_list_foreach(item, To_Path->otherURIs) {
+ tmsrp_uri_t *uri = tmsrp_uri_clone(TMSRP_URI(item->data));
+ tsk_list_push_back_data(clone->otherURIs, (void**)&uri);
+ }
+ }
bail:
- return clone;
+ return clone;
}
@@ -345,39 +355,38 @@ bail:
static tsk_object_t* tmsrp_header_To_Path_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_To_Path_t *To_Path = self;
- if(To_Path){
- TMSRP_HEADER(To_Path)->type = tmsrp_htype_To_Path;
- TMSRP_HEADER(To_Path)->tostring = tmsrp_header_To_Path_tostring;
-
- To_Path->uri = tsk_object_ref((void*)va_arg(*app, const tmsrp_uri_t*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new To-Path header.");
- }
- return self;
+ tmsrp_header_To_Path_t *To_Path = self;
+ if(To_Path) {
+ TMSRP_HEADER(To_Path)->type = tmsrp_htype_To_Path;
+ TMSRP_HEADER(To_Path)->tostring = tmsrp_header_To_Path_tostring;
+
+ To_Path->uri = tsk_object_ref((void*)va_arg(*app, const tmsrp_uri_t*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new To-Path header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_To_Path_dtor(tsk_object_t *self)
{
- tmsrp_header_To_Path_t *To_Path = self;
- if(To_Path){
- TSK_OBJECT_SAFE_FREE(To_Path->uri);
- TSK_OBJECT_SAFE_FREE(To_Path->otherURIs);
- }
- else{
- TSK_DEBUG_ERROR("Null To-Path header.");
- }
-
- return self;
+ tmsrp_header_To_Path_t *To_Path = self;
+ if(To_Path) {
+ TSK_OBJECT_SAFE_FREE(To_Path->uri);
+ TSK_OBJECT_SAFE_FREE(To_Path->otherURIs);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null To-Path header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_To_Path_def_s =
-{
- sizeof(tmsrp_header_To_Path_t),
- tmsrp_header_To_Path_ctor,
- tmsrp_header_To_Path_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_To_Path_def_s = {
+ sizeof(tmsrp_header_To_Path_t),
+ tmsrp_header_To_Path_ctor,
+ tmsrp_header_To_Path_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_To_Path_def_t = &tmsrp_header_To_Path_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_Use-Path.c b/tinyMSRP/src/headers/tmsrp_header_Use-Path.c
index 8415867..dc787f8 100755
--- a/tinyMSRP/src/headers/tmsrp_header_Use-Path.c
+++ b/tinyMSRP/src/headers/tmsrp_header_Use-Path.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_header_Use-Path.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,275 +42,285 @@
tmsrp_header_Use_Path_t* tmsrp_header_Use_Path_create(const tmsrp_uri_t* uri)
{
- return tsk_object_new(TMSRP_HEADER_USE_PATH_VA_ARGS(uri));
+ return tsk_object_new(TMSRP_HEADER_USE_PATH_VA_ARGS(uri));
}
tmsrp_header_Use_Path_t* tmsrp_header_Use_Path_create_null()
{
- return tmsrp_header_Use_Path_create(tsk_null);
+ return tmsrp_header_Use_Path_create(tsk_null);
}
int tmsrp_header_Use_Path_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tmsrp_header_Use_Path_t *Use_Path = (const tmsrp_header_Use_Path_t *)header;
- const tsk_list_item_t *item;
-
- if(Use_Path->uri){
- tmsrp_uri_serialize(Use_Path->uri, output);
- }
- tsk_list_foreach(item, Use_Path->otherURIs){
- tsk_buffer_append(output, " ", 1);
- tmsrp_uri_serialize(TMSRP_URI(item->data), output);
- }
- }
-
- return -1;
+ if(header) {
+ const tmsrp_header_Use_Path_t *Use_Path = (const tmsrp_header_Use_Path_t *)header;
+ const tsk_list_item_t *item;
+
+ if(Use_Path->uri) {
+ tmsrp_uri_serialize(Use_Path->uri, output);
+ }
+ tsk_list_foreach(item, Use_Path->otherURIs) {
+ tsk_buffer_append(output, " ", 1);
+ tmsrp_uri_serialize(TMSRP_URI(item->data), output);
+ }
+ }
+
+ return -1;
}
tmsrp_header_Use_Path_t *tmsrp_header_Use_Path_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_header_Use_Path_t *header = tmsrp_header_Use_Path_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 84 "./src/headers/tmsrp_header_Use-Path.c" */
-static const char _tmsrp_machine_parser_header_Use_Path_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 16, 17, 18, 20, 22
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_trans_keys[] = {
- 85, 117, 83, 115, 69, 101, 45, 80,
- 112, 65, 97, 84, 116, 72, 104, 58,
- 32, 10, 13, 32, 13, 32, 0
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 1, 1, 1, 2, 2, 0
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 25, 27, 29, 32, 35
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_trans_targs[] = {
- 2, 2, 0, 3, 3, 0, 4, 4,
- 0, 5, 0, 6, 6, 0, 7, 7,
- 0, 8, 8, 0, 9, 9, 0, 10,
- 0, 12, 0, 14, 0, 11, 12, 13,
- 11, 12, 13, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 5, 1,
- 3, 3, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_header_Use_Path_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0
-};
-
-static const int tmsrp_machine_parser_header_Use_Path_start = 1;
-static const int tmsrp_machine_parser_header_Use_Path_first_final = 12;
-static const int tmsrp_machine_parser_header_Use_Path_error = 0;
-
-static const int tmsrp_machine_parser_header_Use_Path_en_main = 1;
-
-
-/* #line 113 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_header_Use_Path_first_final);
- (void)(tmsrp_machine_parser_header_Use_Path_error);
- (void)(tmsrp_machine_parser_header_Use_Path_en_main);
-
-/* #line 150 "./src/headers/tmsrp_header_Use-Path.c" */
- {
- cs = tmsrp_machine_parser_header_Use_Path_start;
- }
-
-/* #line 118 "./ragel/tmsrp_parser_header_Use-Path.rl" */
-
-/* #line 157 "./src/headers/tmsrp_header_Use-Path.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_header_Use_Path_t *header = tmsrp_header_Use_Path_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 84 "./src/headers/tmsrp_header_Use-Path.c" */
+ static const char _tmsrp_machine_parser_header_Use_Path_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
+
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 16, 17, 18, 20, 22
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_trans_keys[] = {
+ 85, 117, 83, 115, 69, 101, 45, 80,
+ 112, 65, 97, 84, 116, 72, 104, 58,
+ 32, 10, 13, 32, 13, 32, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 1, 1, 1, 2, 2, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 25, 27, 29, 32, 35
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_trans_targs[] = {
+ 2, 2, 0, 3, 3, 0, 4, 4,
+ 0, 5, 0, 6, 6, 0, 7, 7,
+ 0, 8, 8, 0, 9, 9, 0, 10,
+ 0, 12, 0, 14, 0, 11, 12, 13,
+ 11, 12, 13, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 5, 1,
+ 3, 3, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_header_Use_Path_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tmsrp_machine_parser_header_Use_Path_start = 1;
+ static const int tmsrp_machine_parser_header_Use_Path_first_final = 12;
+ static const int tmsrp_machine_parser_header_Use_Path_error = 0;
+
+ static const int tmsrp_machine_parser_header_Use_Path_en_main = 1;
+
+
+ /* #line 113 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_header_Use_Path_first_final);
+ (void)(tmsrp_machine_parser_header_Use_Path_error);
+ (void)(tmsrp_machine_parser_header_Use_Path_en_main);
+
+ /* #line 150 "./src/headers/tmsrp_header_Use-Path.c" */
+ {
+ cs = tmsrp_machine_parser_header_Use_Path_start;
+ }
+
+ /* #line 118 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+
+ /* #line 157 "./src/headers/tmsrp_header_Use-Path.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_header_Use_Path_trans_keys + _tmsrp_machine_parser_header_Use_Path_key_offsets[cs];
- _trans = _tmsrp_machine_parser_header_Use_Path_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_header_Use_Path_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_header_Use_Path_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_header_Use_Path_trans_keys + _tmsrp_machine_parser_header_Use_Path_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_header_Use_Path_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_header_Use_Path_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_header_Use_Path_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tmsrp_machine_parser_header_Use_Path_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_header_Use_Path_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_header_Use_Path_actions + _tmsrp_machine_parser_header_Use_Path_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 254 "./src/headers/tmsrp_header_Use-Path.c" */
- }
- }
+ cs = _tmsrp_machine_parser_header_Use_Path_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_header_Use_Path_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_header_Use_Path_actions + _tmsrp_machine_parser_header_Use_Path_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 254 "./src/headers/tmsrp_header_Use-Path.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_header_Use_Path_actions + _tmsrp_machine_parser_header_Use_Path_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- {
- int len = (int)(p - tag_start);
- tmsrp_uri_t* uri;
- if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))){
- if(!header->uri){
- header->uri = uri;
- }
- else{
- if(!header->otherURIs){
- header->otherURIs = tsk_list_create();
- }
- tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
- }
- }
- }
- break;
-/* #line 294 "./src/headers/tmsrp_header_Use-Path.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 119 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 306 "./src/headers/tmsrp_header_Use-Path.c" */
-12
-/* #line 121 "./ragel/tmsrp_parser_header_Use-Path.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Use-Path' header.");
- TSK_OBJECT_SAFE_FREE(header);
- }
-
- return header;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_header_Use_Path_actions + _tmsrp_machine_parser_header_Use_Path_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ {
+ int len = (int)(p - tag_start);
+ tmsrp_uri_t* uri;
+ if((uri = tmsrp_uri_parse(tag_start, (tsk_size_t)len))) {
+ if(!header->uri) {
+ header->uri = uri;
+ }
+ else {
+ if(!header->otherURIs) {
+ header->otherURIs = tsk_list_create();
+ }
+ tsk_list_push_back_data(header->otherURIs, ((void**) &uri));
+ }
+ }
+ }
+ break;
+ /* #line 294 "./src/headers/tmsrp_header_Use-Path.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 119 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 306 "./src/headers/tmsrp_header_Use-Path.c" */
+ 12
+ /* #line 121 "./ragel/tmsrp_parser_header_Use-Path.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Use-Path' header.");
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+
+ return header;
}
@@ -325,43 +335,42 @@ _again:
static tsk_object_t* tmsrp_header_Use_Path_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_Use_Path_t *Use_Path = self;
- if(Use_Path){
- const tmsrp_uri_t* uri = va_arg(*app, const tmsrp_uri_t*);
-
- TMSRP_HEADER(Use_Path)->type = tmsrp_htype_Use_Path;
- TMSRP_HEADER(Use_Path)->tostring = tmsrp_header_Use_Path_tostring;
-
- if(uri){
- Use_Path->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Use-Path header.");
- }
- return self;
+ tmsrp_header_Use_Path_t *Use_Path = self;
+ if(Use_Path) {
+ const tmsrp_uri_t* uri = va_arg(*app, const tmsrp_uri_t*);
+
+ TMSRP_HEADER(Use_Path)->type = tmsrp_htype_Use_Path;
+ TMSRP_HEADER(Use_Path)->tostring = tmsrp_header_Use_Path_tostring;
+
+ if(uri) {
+ Use_Path->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Use-Path header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_Use_Path_dtor(tsk_object_t *self)
{
- tmsrp_header_Use_Path_t *Use_Path = self;
- if(Use_Path){
- TSK_OBJECT_SAFE_FREE(Use_Path->uri);
- TSK_OBJECT_SAFE_FREE(Use_Path->otherURIs);
- }
- else{
- TSK_DEBUG_ERROR("Null Use-Path header.");
- }
-
- return self;
+ tmsrp_header_Use_Path_t *Use_Path = self;
+ if(Use_Path) {
+ TSK_OBJECT_SAFE_FREE(Use_Path->uri);
+ TSK_OBJECT_SAFE_FREE(Use_Path->otherURIs);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Use-Path header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_Use_Path_def_s =
-{
- sizeof(tmsrp_header_Use_Path_t),
- tmsrp_header_Use_Path_ctor,
- tmsrp_header_Use_Path_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_Use_Path_def_s = {
+ sizeof(tmsrp_header_Use_Path_t),
+ tmsrp_header_Use_Path_ctor,
+ tmsrp_header_Use_Path_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_Use_Path_def_t = &tmsrp_header_Use_Path_def_s;
diff --git a/tinyMSRP/src/headers/tmsrp_header_WWW-Authenticate.c b/tinyMSRP/src/headers/tmsrp_header_WWW-Authenticate.c
index 90ec0f7..3096eef 100755
--- a/tinyMSRP/src/headers/tmsrp_header_WWW-Authenticate.c
+++ b/tinyMSRP/src/headers/tmsrp_header_WWW-Authenticate.c
@@ -4,19 +4,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,72 +41,69 @@
tmsrp_header_WWW_Authenticate_t* thttp_header_WWW_Authenticate_create()
{
- return tsk_object_new(tmsrp_header_WWW_Authenticate_def_t);
+ return tsk_object_new(tmsrp_header_WWW_Authenticate_def_t);
}
int tmsrp_header_WWW_Authenticate_tostring(const tmsrp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = (const tmsrp_header_WWW_Authenticate_t *)header;
- if(WWW_Authenticate && WWW_Authenticate->scheme)
- {
- return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
- WWW_Authenticate->scheme,
- WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
-
- WWW_Authenticate->domain ? ",domain=\"" : "",
- WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
- WWW_Authenticate->domain ? "\"" : "",
-
-
- WWW_Authenticate->qop ? ",qop=\"" : "",
- WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
- WWW_Authenticate->qop ? "\"" : "",
-
-
- WWW_Authenticate->nonce ? ",nonce=\"" : "",
- WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
- WWW_Authenticate->nonce ? "\"" : "",
-
- WWW_Authenticate->opaque ? ",opaque=\"" : "",
- WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
- WWW_Authenticate->opaque ? "\"" : "",
-
- WWW_Authenticate->stale ? "TRUE" : "FALSE",
-
- WWW_Authenticate->algorithm ? ",algorithm=" : "",
- WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = (const tmsrp_header_WWW_Authenticate_t *)header;
+ if(WWW_Authenticate && WWW_Authenticate->scheme) {
+ return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
+ WWW_Authenticate->scheme,
+ WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
+
+ WWW_Authenticate->domain ? ",domain=\"" : "",
+ WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
+ WWW_Authenticate->domain ? "\"" : "",
+
+
+ WWW_Authenticate->qop ? ",qop=\"" : "",
+ WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
+ WWW_Authenticate->qop ? "\"" : "",
+
+
+ WWW_Authenticate->nonce ? ",nonce=\"" : "",
+ WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
+ WWW_Authenticate->nonce ? "\"" : "",
+
+ WWW_Authenticate->opaque ? ",opaque=\"" : "",
+ WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
+ WWW_Authenticate->opaque ? "\"" : "",
+
+ WWW_Authenticate->stale ? "TRUE" : "FALSE",
+
+ WWW_Authenticate->algorithm ? ",algorithm=" : "",
+ WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
+ );
+ }
+ }
+ return -1;
}
tmsrp_header_WWW_Authenticate_t *tmsrp_header_WWW_Authenticate_parse(const char *data, tsk_size_t size)
{
- tmsrp_header_WWW_Authenticate_t *msrp_hdr = 0;
- thttp_header_WWW_Authenticate_t* http_hdr;
-
- if((http_hdr = thttp_header_WWW_Authenticate_parse(data, size)))
- {
- msrp_hdr = thttp_header_WWW_Authenticate_create();
-
- msrp_hdr->scheme = tsk_strdup(http_hdr->scheme);
- msrp_hdr->realm = tsk_strdup(http_hdr->realm);
- msrp_hdr->domain = tsk_strdup(http_hdr->domain);
- msrp_hdr->nonce = tsk_strdup(http_hdr->nonce);
- msrp_hdr->opaque = tsk_strdup(http_hdr->opaque);
- msrp_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
- msrp_hdr->qop = tsk_strdup(http_hdr->qop);
- msrp_hdr->stale = http_hdr->stale;
-
- msrp_hdr->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
-
- TSK_OBJECT_SAFE_FREE(http_hdr);
- }
-
- return msrp_hdr;
+ tmsrp_header_WWW_Authenticate_t *msrp_hdr = 0;
+ thttp_header_WWW_Authenticate_t* http_hdr;
+
+ if((http_hdr = thttp_header_WWW_Authenticate_parse(data, size))) {
+ msrp_hdr = thttp_header_WWW_Authenticate_create();
+
+ msrp_hdr->scheme = tsk_strdup(http_hdr->scheme);
+ msrp_hdr->realm = tsk_strdup(http_hdr->realm);
+ msrp_hdr->domain = tsk_strdup(http_hdr->domain);
+ msrp_hdr->nonce = tsk_strdup(http_hdr->nonce);
+ msrp_hdr->opaque = tsk_strdup(http_hdr->opaque);
+ msrp_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
+ msrp_hdr->qop = tsk_strdup(http_hdr->qop);
+ msrp_hdr->stale = http_hdr->stale;
+
+ msrp_hdr->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
+
+ TSK_OBJECT_SAFE_FREE(http_hdr);
+ }
+
+ return msrp_hdr;
}
@@ -121,43 +118,42 @@ tmsrp_header_WWW_Authenticate_t *tmsrp_header_WWW_Authenticate_parse(const char
static tsk_object_t* tmsrp_header_WWW_Authenticate_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- TMSRP_HEADER(WWW_Authenticate)->type = tmsrp_htype_WWW_Authenticate;
- TMSRP_HEADER(WWW_Authenticate)->tostring = tmsrp_header_WWW_Authenticate_tostring;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
- }
- return self;
+ tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ TMSRP_HEADER(WWW_Authenticate)->type = tmsrp_htype_WWW_Authenticate;
+ TMSRP_HEADER(WWW_Authenticate)->tostring = tmsrp_header_WWW_Authenticate_tostring;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_header_WWW_Authenticate_dtor(tsk_object_t *self)
{
- tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- TSK_FREE(WWW_Authenticate->scheme);
- TSK_FREE(WWW_Authenticate->realm);
- TSK_FREE(WWW_Authenticate->domain);
- TSK_FREE(WWW_Authenticate->nonce);
- TSK_FREE(WWW_Authenticate->opaque);
- TSK_FREE(WWW_Authenticate->algorithm);
- TSK_FREE(WWW_Authenticate->qop);
-
- TSK_OBJECT_SAFE_FREE(WWW_Authenticate->params);
- }
- else{
- TSK_DEBUG_ERROR("Null WWW-Authenticate header.");
- }
-
- return self;
+ tmsrp_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ TSK_FREE(WWW_Authenticate->scheme);
+ TSK_FREE(WWW_Authenticate->realm);
+ TSK_FREE(WWW_Authenticate->domain);
+ TSK_FREE(WWW_Authenticate->nonce);
+ TSK_FREE(WWW_Authenticate->opaque);
+ TSK_FREE(WWW_Authenticate->algorithm);
+ TSK_FREE(WWW_Authenticate->qop);
+
+ TSK_OBJECT_SAFE_FREE(WWW_Authenticate->params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null WWW-Authenticate header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_header_WWW_Authenticate_def_s =
-{
- sizeof(tmsrp_header_WWW_Authenticate_t),
- tmsrp_header_WWW_Authenticate_ctor,
- tmsrp_header_WWW_Authenticate_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_header_WWW_Authenticate_def_s = {
+ sizeof(tmsrp_header_WWW_Authenticate_t),
+ tmsrp_header_WWW_Authenticate_ctor,
+ tmsrp_header_WWW_Authenticate_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_header_WWW_Authenticate_def_t = &tmsrp_header_WWW_Authenticate_def_s;
diff --git a/tinyMSRP/src/parsers/tmsrp_parser_message.c b/tinyMSRP/src/parsers/tmsrp_parser_message.c
index f11344b..b4ec4d0 100755
--- a/tinyMSRP/src/parsers/tmsrp_parser_message.c
+++ b/tinyMSRP/src/parsers/tmsrp_parser_message.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_message.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,3338 +52,3338 @@ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
/* #line 54 "./src/parsers/tmsrp_parser_message.c" */
static const char _tmsrp_machine_message_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16, 1, 17, 1, 18, 1,
- 19, 1, 20, 1, 22, 1, 24, 1,
- 25, 1, 26, 2, 0, 18, 2, 0,
- 20, 2, 0, 21, 2, 1, 0, 2,
- 1, 26, 2, 2, 0, 2, 2, 26,
- 2, 3, 0, 2, 3, 26, 2, 4,
- 0, 2, 4, 26, 2, 5, 0, 2,
- 5, 26, 2, 6, 0, 2, 6, 26,
- 2, 7, 0, 2, 7, 26, 2, 8,
- 0, 2, 8, 26, 2, 9, 0, 2,
- 9, 26, 2, 10, 0, 2, 10, 26,
- 2, 11, 0, 2, 11, 26, 2, 12,
- 0, 2, 12, 26, 2, 13, 0, 2,
- 13, 26, 2, 14, 0, 2, 14, 26,
- 2, 15, 0, 2, 15, 26, 2, 16,
- 0, 2, 16, 26, 2, 23, 0, 3,
- 0, 21, 22
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16, 1, 17, 1, 18, 1,
+ 19, 1, 20, 1, 22, 1, 24, 1,
+ 25, 1, 26, 2, 0, 18, 2, 0,
+ 20, 2, 0, 21, 2, 1, 0, 2,
+ 1, 26, 2, 2, 0, 2, 2, 26,
+ 2, 3, 0, 2, 3, 26, 2, 4,
+ 0, 2, 4, 26, 2, 5, 0, 2,
+ 5, 26, 2, 6, 0, 2, 6, 26,
+ 2, 7, 0, 2, 7, 26, 2, 8,
+ 0, 2, 8, 26, 2, 9, 0, 2,
+ 9, 26, 2, 10, 0, 2, 10, 26,
+ 2, 11, 0, 2, 11, 26, 2, 12,
+ 0, 2, 12, 26, 2, 13, 0, 2,
+ 13, 26, 2, 14, 0, 2, 14, 26,
+ 2, 15, 0, 2, 15, 26, 2, 16,
+ 0, 2, 16, 26, 2, 23, 0, 3,
+ 0, 21, 22
};
static const short _tmsrp_machine_message_cond_offsets[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,
- 1, 1, 1, 2, 3, 4, 5, 6,
- 7, 8, 11, 19, 27, 35, 45, 46,
- 47, 57, 67, 77, 87, 97, 107, 117,
- 127, 137, 147, 157, 167, 177, 187, 197,
- 207, 217, 227, 237, 247, 257, 267, 277,
- 287, 297, 307, 317, 320, 324, 335, 346,
- 357, 368, 379, 390, 401, 412, 423, 434,
- 445, 456, 467, 478, 489, 500, 511, 522,
- 533, 544, 555, 566, 577, 588, 599, 610,
- 621, 621, 621, 621, 621, 622, 622, 622,
- 622, 622, 622, 622, 622, 622, 622, 622,
- 622, 622, 622, 622, 622, 622, 622, 622,
- 622, 622, 622, 622, 623, 623, 623, 623,
- 623, 623, 623, 623, 623, 623, 623, 623,
- 623, 623, 624, 624, 624, 624, 624, 624,
- 624, 624, 624, 624, 624, 624, 624, 624,
- 624, 624, 625, 625, 625, 625, 625, 625,
- 625, 625, 625, 625, 625, 626, 626, 626,
- 626, 626, 626, 626, 626, 626, 626, 626,
- 626, 626, 626, 626, 626, 626, 626, 627,
- 627, 627, 627, 627, 627, 627, 627, 627,
- 627, 627, 627, 627, 627, 627, 628, 628,
- 628, 628, 628, 628, 628, 628, 628, 628,
- 629, 629, 629, 629, 629, 629, 629, 629,
- 629, 629, 629, 630, 630, 630, 630, 630,
- 630, 630, 630, 630, 630, 630, 630, 631,
- 631, 631, 631, 631, 631, 631, 631, 631,
- 631, 631, 631, 631, 631, 631, 631, 631,
- 631, 631, 631, 632, 632, 632, 632, 632,
- 632, 632, 632, 632, 632, 632, 632, 632,
- 632, 632, 632, 632, 633, 633, 633, 633,
- 633, 633, 633, 633, 633, 633, 633, 633,
- 633, 634, 634, 634, 634, 634, 634, 634,
- 634, 634, 634, 634, 634, 634, 634, 635,
- 635, 635, 635, 635, 635, 635, 635, 635,
- 635, 635, 635, 636, 636, 636, 636, 636,
- 636, 636, 636, 636, 636, 636, 636, 636,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637, 637, 637,
- 637, 637, 637, 637, 637, 637
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 2, 3, 4, 5, 6,
+ 7, 8, 11, 19, 27, 35, 45, 46,
+ 47, 57, 67, 77, 87, 97, 107, 117,
+ 127, 137, 147, 157, 167, 177, 187, 197,
+ 207, 217, 227, 237, 247, 257, 267, 277,
+ 287, 297, 307, 317, 320, 324, 335, 346,
+ 357, 368, 379, 390, 401, 412, 423, 434,
+ 445, 456, 467, 478, 489, 500, 511, 522,
+ 533, 544, 555, 566, 577, 588, 599, 610,
+ 621, 621, 621, 621, 621, 622, 622, 622,
+ 622, 622, 622, 622, 622, 622, 622, 622,
+ 622, 622, 622, 622, 622, 622, 622, 622,
+ 622, 622, 622, 622, 623, 623, 623, 623,
+ 623, 623, 623, 623, 623, 623, 623, 623,
+ 623, 623, 624, 624, 624, 624, 624, 624,
+ 624, 624, 624, 624, 624, 624, 624, 624,
+ 624, 624, 625, 625, 625, 625, 625, 625,
+ 625, 625, 625, 625, 625, 626, 626, 626,
+ 626, 626, 626, 626, 626, 626, 626, 626,
+ 626, 626, 626, 626, 626, 626, 626, 627,
+ 627, 627, 627, 627, 627, 627, 627, 627,
+ 627, 627, 627, 627, 627, 627, 628, 628,
+ 628, 628, 628, 628, 628, 628, 628, 628,
+ 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 630, 630, 630, 630, 630,
+ 630, 630, 630, 630, 630, 630, 630, 631,
+ 631, 631, 631, 631, 631, 631, 631, 631,
+ 631, 631, 631, 631, 631, 631, 631, 631,
+ 631, 631, 631, 632, 632, 632, 632, 632,
+ 632, 632, 632, 632, 632, 632, 632, 632,
+ 632, 632, 632, 632, 633, 633, 633, 633,
+ 633, 633, 633, 633, 633, 633, 633, 633,
+ 633, 634, 634, 634, 634, 634, 634, 634,
+ 634, 634, 634, 634, 634, 634, 634, 635,
+ 635, 635, 635, 635, 635, 635, 635, 635,
+ 635, 635, 635, 636, 636, 636, 636, 636,
+ 636, 636, 636, 636, 636, 636, 636, 636,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637, 637, 637,
+ 637, 637, 637, 637, 637, 637
};
static const char _tmsrp_machine_message_cond_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 3, 8, 8, 8, 10, 1, 1,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 3, 4, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 3, 8, 8, 8, 10, 1, 1,
+ 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 3, 4, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
};
static const short _tmsrp_machine_message_cond_keys[] = {
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 48, 57, 65, 90, 97, 122, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 10, 10, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 35, 35, 36, 36, 43, 43,
- 13, 13, 35, 35, 36, 36, 43, 43,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 13, 13, 35, 35, 36, 36,
- 37, 37, 43, 43, 45, 45, 46, 46,
- 48, 57, 61, 61, 65, 90, 97, 122,
- 13, 13, 35, 35, 36, 36, 37, 37,
- 43, 43, 45, 45, 46, 46, 48, 57,
- 61, 61, 65, 90, 97, 122, 13, 13,
- 35, 35, 36, 36, 37, 37, 43, 43,
- 45, 45, 46, 46, 48, 57, 61, 61,
- 65, 90, 97, 122, 13, 13, 35, 35,
- 36, 36, 37, 37, 43, 43, 45, 45,
- 46, 46, 48, 57, 61, 61, 65, 90,
- 97, 122, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 0
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 48, 57, 65, 90, 97, 122, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 10, 10, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 35, 35, 36, 36, 43, 43,
+ 13, 13, 35, 35, 36, 36, 43, 43,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 13, 13, 35, 35, 36, 36,
+ 37, 37, 43, 43, 45, 45, 46, 46,
+ 48, 57, 61, 61, 65, 90, 97, 122,
+ 13, 13, 35, 35, 36, 36, 37, 37,
+ 43, 43, 45, 45, 46, 46, 48, 57,
+ 61, 61, 65, 90, 97, 122, 13, 13,
+ 35, 35, 36, 36, 37, 37, 43, 43,
+ 45, 45, 46, 46, 48, 57, 61, 61,
+ 65, 90, 97, 122, 13, 13, 35, 35,
+ 36, 36, 37, 37, 43, 43, 45, 45,
+ 46, 46, 48, 57, 61, 61, 65, 90,
+ 97, 122, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 0
};
static const char _tmsrp_machine_message_cond_spaces[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
};
static const short _tmsrp_machine_message_key_offsets[] = {
- 0, 0, 1, 2, 3, 4, 5, 11,
- 22, 33, 44, 56, 61, 62, 98, 99,
- 100, 101, 103, 110, 111, 112, 113, 114,
- 115, 116, 122, 133, 144, 155, 168, 169,
- 170, 183, 196, 209, 222, 235, 248, 261,
- 274, 287, 300, 313, 326, 339, 352, 365,
- 378, 391, 404, 417, 430, 443, 456, 469,
- 482, 495, 508, 521, 524, 528, 542, 556,
- 570, 584, 598, 612, 626, 640, 654, 668,
- 682, 696, 710, 724, 738, 752, 766, 780,
- 794, 808, 822, 836, 850, 864, 878, 892,
- 906, 921, 922, 928, 929, 965, 982, 999,
- 1016, 1035, 1052, 1069, 1086, 1103, 1120, 1137,
- 1154, 1171, 1188, 1203, 1220, 1237, 1254, 1271,
- 1286, 1287, 1288, 1289, 1325, 1342, 1359, 1376,
- 1391, 1408, 1425, 1442, 1459, 1476, 1491, 1492,
- 1493, 1494, 1530, 1547, 1564, 1581, 1598, 1615,
- 1632, 1647, 1664, 1681, 1698, 1715, 1730, 1731,
- 1732, 1733, 1769, 1786, 1803, 1820, 1837, 1854,
- 1871, 1886, 1887, 1888, 1889, 1925, 1944, 1961,
- 1978, 1995, 2012, 2029, 2044, 2061, 2078, 2095,
- 2112, 2129, 2146, 2161, 2162, 2163, 2164, 2200,
- 2221, 2238, 2253, 2270, 2287, 2304, 2321, 2338,
- 2355, 2372, 2387, 2388, 2389, 2390, 2426, 2445,
- 2462, 2479, 2496, 2513, 2528, 2529, 2530, 2531,
- 2567, 2584, 2599, 2616, 2633, 2650, 2667, 2682,
- 2683, 2684, 2685, 2721, 2738, 2755, 2770, 2787,
- 2804, 2821, 2838, 2853, 2854, 2855, 2856, 2892,
- 2909, 2926, 2941, 2958, 2975, 2992, 3009, 3026,
- 3043, 3060, 3077, 3094, 3111, 3128, 3145, 3160,
- 3161, 3162, 3163, 3199, 3216, 3233, 3250, 3267,
- 3284, 3299, 3316, 3333, 3350, 3367, 3384, 3401,
- 3416, 3417, 3418, 3419, 3455, 3472, 3489, 3506,
- 3523, 3540, 3555, 3572, 3589, 3604, 3605, 3606,
- 3607, 3643, 3660, 3675, 3692, 3709, 3726, 3743,
- 3760, 3777, 3794, 3809, 3810, 3811, 3812, 3848,
- 3865, 3882, 3897, 3914, 3931, 3948, 3965, 3980,
- 3981, 3982, 3983, 4019, 4036, 4053, 4070, 4087,
- 4104, 4121, 4138, 4155, 4170, 4171, 4172, 4173,
- 4209, 4211, 4213, 4215, 4216, 4250, 4265, 4266,
- 4272, 4273, 4307, 4322, 4337, 4352, 4367, 4382,
- 4397, 4414, 4432, 4450, 4468, 4488, 4489, 4490,
- 4510, 4530, 4550, 4570, 4590, 4610, 4630, 4650,
- 4670, 4690, 4710, 4730, 4750, 4770, 4790, 4810,
- 4830, 4850, 4870, 4890, 4910, 4930, 4950, 4970,
- 4990, 5010, 5030, 5047, 5063, 5081, 5084, 5105,
- 5118, 5122, 5143, 5156, 5170, 5191, 5204, 5218,
- 5239, 5252, 5266, 5287, 5300, 5314, 5335, 5348,
- 5362, 5383, 5396, 5410, 5431, 5444, 5458, 5479,
- 5492, 5506, 5527, 5540, 5554, 5575, 5588, 5602,
- 5623, 5636, 5650, 5671, 5684, 5698, 5719, 5732,
- 5746, 5767, 5780, 5794, 5815, 5828, 5842, 5863,
- 5876, 5890, 5911, 5924, 5938, 5959, 5972, 5986,
- 6007, 6020, 6034, 6055, 6068, 6082, 6103, 6116,
- 6130, 6151, 6164, 6178, 6199, 6212, 6226, 6247,
- 6260, 6274, 6295, 6308, 6322, 6343, 6356, 6370,
- 6383, 6397, 6408, 6419, 6436, 6453, 6470, 6489,
- 6506, 6523, 6540, 6557, 6574, 6591, 6608, 6625,
- 6642, 6657, 6674, 6691, 6708, 6725, 6740, 6741,
- 6742, 6743, 6777, 6794, 6811, 6828, 6843, 6860,
- 6877, 6894, 6911, 6928, 6943, 6944, 6945, 6946,
- 6980, 6997, 7014, 7031, 7048, 7065, 7082, 7097,
- 7114, 7131, 7148, 7165, 7180, 7181, 7182, 7183,
- 7217, 7234, 7251, 7268, 7285, 7302, 7319, 7334,
- 7335, 7336, 7337, 7371, 7390, 7407, 7424, 7441,
- 7458, 7475, 7490, 7507, 7524, 7541, 7558, 7575,
- 7592, 7607, 7608, 7609, 7610, 7644, 7665, 7682,
- 7697, 7714, 7731, 7748, 7765, 7782, 7799, 7816,
- 7831, 7832, 7833, 7834, 7868, 7887, 7904, 7921,
- 7938, 7955, 7970, 7971, 7972, 7973, 8007, 8024,
- 8039, 8056, 8073, 8090, 8107, 8122, 8123, 8124,
- 8125, 8159, 8176, 8193, 8208, 8225, 8242, 8259,
- 8276, 8291, 8292, 8293, 8294, 8328, 8345, 8362,
- 8377, 8394, 8411, 8428, 8445, 8462, 8479, 8496,
- 8513, 8530, 8547, 8564, 8581, 8596, 8597, 8598,
- 8599, 8633, 8650, 8667, 8684, 8701, 8718, 8733,
- 8750, 8767, 8784, 8801, 8818, 8835, 8850, 8851,
- 8852, 8853, 8887, 8904, 8921, 8938, 8955, 8972,
- 8987, 9004, 9021, 9036, 9037, 9038, 9039, 9073,
- 9090, 9105, 9122, 9139, 9156, 9173, 9190, 9207,
- 9224, 9239, 9240, 9241, 9242, 9276, 9293, 9310,
- 9325, 9342, 9359, 9376, 9393, 9408, 9409, 9410,
- 9411, 9445, 9462, 9479, 9496, 9513, 9530, 9547,
- 9564, 9581, 9596, 9597, 9598, 9599, 9633, 9639,
- 9645, 9648, 9660, 9672, 9684, 9696, 9708, 9720,
- 9732, 9744, 9756, 9768, 9780, 9792, 9804, 9816,
- 9828, 9840, 9852, 9864, 9876, 9888, 9900, 9912,
- 9924, 9936, 9948, 9960, 9972, 9973
+ 0, 0, 1, 2, 3, 4, 5, 11,
+ 22, 33, 44, 56, 61, 62, 98, 99,
+ 100, 101, 103, 110, 111, 112, 113, 114,
+ 115, 116, 122, 133, 144, 155, 168, 169,
+ 170, 183, 196, 209, 222, 235, 248, 261,
+ 274, 287, 300, 313, 326, 339, 352, 365,
+ 378, 391, 404, 417, 430, 443, 456, 469,
+ 482, 495, 508, 521, 524, 528, 542, 556,
+ 570, 584, 598, 612, 626, 640, 654, 668,
+ 682, 696, 710, 724, 738, 752, 766, 780,
+ 794, 808, 822, 836, 850, 864, 878, 892,
+ 906, 921, 922, 928, 929, 965, 982, 999,
+ 1016, 1035, 1052, 1069, 1086, 1103, 1120, 1137,
+ 1154, 1171, 1188, 1203, 1220, 1237, 1254, 1271,
+ 1286, 1287, 1288, 1289, 1325, 1342, 1359, 1376,
+ 1391, 1408, 1425, 1442, 1459, 1476, 1491, 1492,
+ 1493, 1494, 1530, 1547, 1564, 1581, 1598, 1615,
+ 1632, 1647, 1664, 1681, 1698, 1715, 1730, 1731,
+ 1732, 1733, 1769, 1786, 1803, 1820, 1837, 1854,
+ 1871, 1886, 1887, 1888, 1889, 1925, 1944, 1961,
+ 1978, 1995, 2012, 2029, 2044, 2061, 2078, 2095,
+ 2112, 2129, 2146, 2161, 2162, 2163, 2164, 2200,
+ 2221, 2238, 2253, 2270, 2287, 2304, 2321, 2338,
+ 2355, 2372, 2387, 2388, 2389, 2390, 2426, 2445,
+ 2462, 2479, 2496, 2513, 2528, 2529, 2530, 2531,
+ 2567, 2584, 2599, 2616, 2633, 2650, 2667, 2682,
+ 2683, 2684, 2685, 2721, 2738, 2755, 2770, 2787,
+ 2804, 2821, 2838, 2853, 2854, 2855, 2856, 2892,
+ 2909, 2926, 2941, 2958, 2975, 2992, 3009, 3026,
+ 3043, 3060, 3077, 3094, 3111, 3128, 3145, 3160,
+ 3161, 3162, 3163, 3199, 3216, 3233, 3250, 3267,
+ 3284, 3299, 3316, 3333, 3350, 3367, 3384, 3401,
+ 3416, 3417, 3418, 3419, 3455, 3472, 3489, 3506,
+ 3523, 3540, 3555, 3572, 3589, 3604, 3605, 3606,
+ 3607, 3643, 3660, 3675, 3692, 3709, 3726, 3743,
+ 3760, 3777, 3794, 3809, 3810, 3811, 3812, 3848,
+ 3865, 3882, 3897, 3914, 3931, 3948, 3965, 3980,
+ 3981, 3982, 3983, 4019, 4036, 4053, 4070, 4087,
+ 4104, 4121, 4138, 4155, 4170, 4171, 4172, 4173,
+ 4209, 4211, 4213, 4215, 4216, 4250, 4265, 4266,
+ 4272, 4273, 4307, 4322, 4337, 4352, 4367, 4382,
+ 4397, 4414, 4432, 4450, 4468, 4488, 4489, 4490,
+ 4510, 4530, 4550, 4570, 4590, 4610, 4630, 4650,
+ 4670, 4690, 4710, 4730, 4750, 4770, 4790, 4810,
+ 4830, 4850, 4870, 4890, 4910, 4930, 4950, 4970,
+ 4990, 5010, 5030, 5047, 5063, 5081, 5084, 5105,
+ 5118, 5122, 5143, 5156, 5170, 5191, 5204, 5218,
+ 5239, 5252, 5266, 5287, 5300, 5314, 5335, 5348,
+ 5362, 5383, 5396, 5410, 5431, 5444, 5458, 5479,
+ 5492, 5506, 5527, 5540, 5554, 5575, 5588, 5602,
+ 5623, 5636, 5650, 5671, 5684, 5698, 5719, 5732,
+ 5746, 5767, 5780, 5794, 5815, 5828, 5842, 5863,
+ 5876, 5890, 5911, 5924, 5938, 5959, 5972, 5986,
+ 6007, 6020, 6034, 6055, 6068, 6082, 6103, 6116,
+ 6130, 6151, 6164, 6178, 6199, 6212, 6226, 6247,
+ 6260, 6274, 6295, 6308, 6322, 6343, 6356, 6370,
+ 6383, 6397, 6408, 6419, 6436, 6453, 6470, 6489,
+ 6506, 6523, 6540, 6557, 6574, 6591, 6608, 6625,
+ 6642, 6657, 6674, 6691, 6708, 6725, 6740, 6741,
+ 6742, 6743, 6777, 6794, 6811, 6828, 6843, 6860,
+ 6877, 6894, 6911, 6928, 6943, 6944, 6945, 6946,
+ 6980, 6997, 7014, 7031, 7048, 7065, 7082, 7097,
+ 7114, 7131, 7148, 7165, 7180, 7181, 7182, 7183,
+ 7217, 7234, 7251, 7268, 7285, 7302, 7319, 7334,
+ 7335, 7336, 7337, 7371, 7390, 7407, 7424, 7441,
+ 7458, 7475, 7490, 7507, 7524, 7541, 7558, 7575,
+ 7592, 7607, 7608, 7609, 7610, 7644, 7665, 7682,
+ 7697, 7714, 7731, 7748, 7765, 7782, 7799, 7816,
+ 7831, 7832, 7833, 7834, 7868, 7887, 7904, 7921,
+ 7938, 7955, 7970, 7971, 7972, 7973, 8007, 8024,
+ 8039, 8056, 8073, 8090, 8107, 8122, 8123, 8124,
+ 8125, 8159, 8176, 8193, 8208, 8225, 8242, 8259,
+ 8276, 8291, 8292, 8293, 8294, 8328, 8345, 8362,
+ 8377, 8394, 8411, 8428, 8445, 8462, 8479, 8496,
+ 8513, 8530, 8547, 8564, 8581, 8596, 8597, 8598,
+ 8599, 8633, 8650, 8667, 8684, 8701, 8718, 8733,
+ 8750, 8767, 8784, 8801, 8818, 8835, 8850, 8851,
+ 8852, 8853, 8887, 8904, 8921, 8938, 8955, 8972,
+ 8987, 9004, 9021, 9036, 9037, 9038, 9039, 9073,
+ 9090, 9105, 9122, 9139, 9156, 9173, 9190, 9207,
+ 9224, 9239, 9240, 9241, 9242, 9276, 9293, 9310,
+ 9325, 9342, 9359, 9376, 9393, 9408, 9409, 9410,
+ 9411, 9445, 9462, 9479, 9496, 9513, 9530, 9547,
+ 9564, 9581, 9596, 9597, 9598, 9599, 9633, 9639,
+ 9645, 9648, 9660, 9672, 9684, 9696, 9708, 9720,
+ 9732, 9744, 9756, 9768, 9780, 9792, 9804, 9816,
+ 9828, 9840, 9852, 9864, 9876, 9888, 9900, 9912,
+ 9924, 9936, 9948, 9960, 9972, 9973
};
static const short _tmsrp_machine_message_trans_keys[] = {
- 77, 83, 82, 80, 32, 48, 57, 65,
- 90, 97, 122, 37, 43, 61, 45, 46,
- 48, 57, 65, 90, 97, 122, 37, 43,
- 61, 45, 46, 48, 57, 65, 90, 97,
- 122, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 13, 48, 57, 65, 90, 10, 13, 33,
- 37, 39, 46, 65, 66, 67, 69, 70,
- 77, 83, 84, 85, 87, 97, 98, 99,
- 101, 102, 109, 115, 116, 117, 119, 126,
- 301, 557, 42, 43, 48, 57, 68, 90,
- 95, 122, 10, 13, 13, 10, 13, 13,
- 301, 557, -128, 44, 46, 127, 557, 557,
- 557, 557, 557, 557, 560, 569, 577, 602,
- 609, 634, 549, 555, 573, 557, 558, 560,
- 569, 577, 602, 609, 634, 549, 555, 573,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 549, 555, 573, 557, 558, 560, 569, 577,
- 602, 609, 634, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 522, 549, 555, 573, 547, 548, 557,
- 558, 560, 569, 577, 602, 609, 634, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 549, 555, 573, 547,
- 548, 557, 558, 560, 569, 577, 602, 609,
- 634, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 549, 555,
- 573, 547, 548, 557, 558, 560, 569, 577,
- 602, 609, 634, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 549, 555, 573, 547, 548, 557, 558, 560,
- 569, 577, 602, 609, 634, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 549, 555, 573, 547, 548, 557,
- 558, 560, 569, 577, 602, 609, 634, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 549, 555, 573, 547,
- 548, 557, 558, 560, 569, 577, 602, 609,
- 634, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 549, 555,
- 573, 547, 548, 557, 558, 560, 569, 577,
- 602, 609, 634, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 549, 555, 573, 547, 548, 557, 558, 560,
- 569, 577, 602, 609, 634, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 549, 555, 573, 547, 548, 557,
- 558, 560, 569, 577, 602, 609, 634, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 549, 555, 573, 547,
- 548, 557, 558, 560, 569, 577, 602, 609,
- 634, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 549, 555,
- 573, 547, 548, 557, 558, 560, 569, 577,
- 602, 609, 634, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 549, 555, 573, 547, 548, 557, 558, 560,
- 569, 577, 602, 609, 634, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 549, 555, 573, 547, 548, 557,
- 558, 560, 569, 577, 602, 609, 634, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 549, 555, 573, 547,
- 548, 557, 558, 560, 569, 577, 602, 609,
- 634, 555, 547, 548, 525, 555, 547, 548,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 525, 549, 555, 573, 547, 548,
- 557, 558, 560, 569, 577, 602, 609, 634,
- 525, 549, 555, 573, 547, 548, 557, 558,
- 560, 569, 577, 602, 609, 634, 525, 549,
- 555, 573, 547, 548, 557, 558, 560, 569,
- 577, 602, 609, 634, 525, 549, 555, 573,
- 547, 548, 557, 558, 560, 569, 577, 602,
- 609, 634, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 32, 13, 127, 0, 8, 10, 31,
- 10, 13, 33, 37, 39, 46, 65, 66,
- 67, 69, 70, 77, 83, 84, 85, 87,
- 97, 98, 99, 101, 102, 109, 115, 116,
- 117, 119, 126, 301, 557, 42, 43, 48,
- 57, 68, 90, 95, 122, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 72, 104, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 69, 79, 101, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 70, 102, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 13,
- 10, 13, 33, 37, 39, 46, 65, 66,
- 67, 69, 70, 77, 83, 84, 85, 87,
- 97, 98, 99, 101, 102, 109, 115, 116,
- 117, 119, 126, 301, 557, 42, 43, 48,
- 57, 68, 90, 95, 122, 33, 37, 39,
- 58, 89, 121, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 32, 13, 10, 13, 33,
- 37, 39, 46, 65, 66, 67, 69, 70,
- 77, 83, 84, 85, 87, 97, 98, 99,
- 101, 102, 109, 115, 116, 117, 119, 126,
- 301, 557, 42, 43, 48, 57, 68, 90,
- 95, 122, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 89, 121, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 13, 33, 37,
- 39, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 301,
- 557, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 88, 120, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 80, 112,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 13,
- 10, 13, 33, 37, 39, 46, 65, 66,
- 67, 69, 70, 77, 83, 84, 85, 87,
- 97, 98, 99, 101, 102, 109, 115, 116,
- 117, 119, 126, 301, 557, 42, 43, 48,
- 57, 68, 90, 95, 122, 33, 37, 39,
- 58, 65, 82, 97, 114, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 76, 108, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 85, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 80, 112, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 32, 13, 10, 13, 33, 37, 39,
- 46, 65, 66, 67, 69, 70, 77, 83,
- 84, 85, 87, 97, 98, 99, 101, 102,
- 109, 115, 116, 117, 119, 126, 301, 557,
- 42, 43, 48, 57, 68, 90, 95, 122,
- 33, 37, 39, 58, 65, 69, 73, 97,
- 101, 105, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 33, 37, 39,
- 58, 88, 120, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 88, 120, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 32, 13, 10, 13, 33,
- 37, 39, 46, 65, 66, 67, 69, 70,
- 77, 83, 84, 85, 87, 97, 98, 99,
- 101, 102, 109, 115, 116, 117, 119, 126,
- 301, 557, 42, 43, 48, 57, 68, 90,
- 95, 122, 33, 37, 39, 58, 84, 85,
- 116, 117, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 85, 117, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 83, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 13, 10, 13, 33, 37, 39, 46,
- 65, 66, 67, 69, 70, 77, 83, 84,
- 85, 87, 97, 98, 99, 101, 102, 109,
- 115, 116, 117, 119, 126, 301, 557, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 72, 104,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 13, 33, 37,
- 39, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 301,
- 557, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 80, 112,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 32, 13, 10,
- 13, 33, 37, 39, 46, 65, 66, 67,
- 69, 70, 77, 83, 84, 85, 87, 97,
- 98, 99, 101, 102, 109, 115, 116, 117,
- 119, 126, 301, 557, 42, 43, 48, 57,
- 68, 90, 95, 122, 33, 37, 39, 58,
- 87, 119, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 87, 119, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 33, 37,
- 39, 58, 85, 117, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 72, 104, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 13, 10, 13, 33, 37, 39, 46,
- 65, 66, 67, 69, 70, 77, 83, 84,
- 85, 87, 97, 98, 99, 101, 102, 109,
- 115, 116, 117, 119, 126, 301, 557, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 67, 99, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 80, 112, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 13, 10, 13, 33, 37, 39, 46,
- 65, 66, 67, 69, 70, 77, 83, 84,
- 85, 87, 97, 98, 99, 101, 102, 109,
- 115, 116, 117, 119, 126, 301, 557, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 83, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 13,
- 33, 37, 39, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 301, 557, 42, 43, 48, 57, 68,
- 90, 95, 122, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 88, 120, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 80, 112, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 32, 13, 10, 13, 33, 37, 39,
- 46, 65, 66, 67, 69, 70, 77, 83,
- 84, 85, 87, 97, 98, 99, 101, 102,
- 109, 115, 116, 117, 119, 126, 301, 557,
- 42, 43, 48, 57, 68, 90, 95, 122,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 77, 109, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 72, 104, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 13,
- 33, 37, 39, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 301, 557, 42, 43, 48, 57, 68,
- 90, 95, 122, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 90, 122, 126, 42, 43, 45, 46,
- 48, 57, 65, 89, 95, 121, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 13, 33, 37,
- 39, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 301,
- 557, 42, 43, 48, 57, 68, 90, 95,
- 122, 48, 57, 48, 57, 13, 32, 10,
- 33, 37, 39, 45, 46, 65, 66, 67,
- 69, 70, 77, 83, 84, 85, 87, 97,
- 98, 99, 101, 102, 109, 115, 116, 117,
- 119, 126, 42, 43, 48, 57, 68, 90,
- 95, 122, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 32, 13, 127, 0, 8, 10, 31,
- 10, 33, 37, 39, 45, 46, 65, 66,
- 67, 69, 70, 77, 83, 84, 85, 87,
- 97, 98, 99, 101, 102, 109, 115, 116,
- 117, 119, 126, 42, 43, 48, 57, 68,
- 90, 95, 122, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 33, 37, 39, 42, 43, 58, 61, 126,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 33, 37, 39, 42,
- 43, 58, 61, 126, 35, 36, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 13, 10, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 61, 126, 35, 36,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 33, 37, 39, 42, 43, 58,
- 61, 126, 35, 36, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 33, 37,
- 39, 42, 43, 58, 126, 35, 36, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 33, 37, 39, 42, 43, 58, 126, 35,
- 36, 45, 46, 48, 57, 65, 90, 95,
- 122, 43, 35, 36, 13, 33, 37, 39,
- 42, 43, 58, 61, 126, 35, 36, 45,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 37, 43, 61, 35, 36, 45, 46,
- 48, 57, 65, 90, 97, 122, 13, 43,
- 35, 36, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 13, 33, 37, 39, 42, 43,
- 58, 61, 126, 35, 36, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 37,
- 43, 61, 35, 36, 45, 46, 48, 57,
- 65, 90, 97, 122, 13, 37, 43, 61,
- 35, 36, 45, 46, 48, 57, 65, 90,
- 97, 122, 37, 43, 61, 35, 36, 45,
- 46, 48, 57, 65, 90, 97, 122, 13,
- 37, 43, 61, 35, 36, 45, 46, 48,
- 57, 65, 90, 97, 122, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 37, 43, 61, 45, 46, 48, 57, 65,
- 90, 97, 122, 33, 37, 39, 58, 85,
- 117, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 69, 79, 101, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 67, 99, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 70,
- 102, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 33,
- 37, 39, 45, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 89, 121, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 71, 103, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 32,
- 13, 10, 33, 37, 39, 45, 46, 65,
- 66, 67, 69, 70, 77, 83, 84, 85,
- 87, 97, 98, 99, 101, 102, 109, 115,
- 116, 117, 119, 126, 42, 43, 48, 57,
- 68, 90, 95, 122, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 89, 121,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 80,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 33,
- 37, 39, 45, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 88, 120, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 80, 112,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 32, 13,
- 10, 33, 37, 39, 45, 46, 65, 66,
- 67, 69, 70, 77, 83, 84, 85, 87,
- 97, 98, 99, 101, 102, 109, 115, 116,
- 117, 119, 126, 42, 43, 48, 57, 68,
- 90, 95, 122, 33, 37, 39, 58, 65,
- 82, 97, 114, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 76, 108, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 85, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 32,
- 13, 10, 33, 37, 39, 45, 46, 65,
- 66, 67, 69, 70, 77, 83, 84, 85,
- 87, 97, 98, 99, 101, 102, 109, 115,
- 116, 117, 119, 126, 42, 43, 48, 57,
- 68, 90, 95, 122, 33, 37, 39, 58,
- 65, 69, 73, 97, 101, 105, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 33, 37, 39, 58, 88, 120, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 88, 120,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 80,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 32,
- 13, 10, 33, 37, 39, 45, 46, 65,
- 66, 67, 69, 70, 77, 83, 84, 85,
- 87, 97, 98, 99, 101, 102, 109, 115,
- 116, 117, 119, 126, 42, 43, 48, 57,
- 68, 90, 95, 122, 33, 37, 39, 58,
- 84, 85, 116, 117, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 33, 37, 39,
- 45, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 72, 104,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 33, 37, 39,
- 45, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 80, 112, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 72,
- 104, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 32, 13, 10, 33, 37,
- 39, 45, 46, 65, 66, 67, 69, 70,
- 77, 83, 84, 85, 87, 97, 98, 99,
- 101, 102, 109, 115, 116, 117, 119, 126,
- 42, 43, 48, 57, 68, 90, 95, 122,
- 33, 37, 39, 58, 87, 119, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 87, 119, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 33, 37, 39, 58, 85, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 72, 104, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 33,
- 37, 39, 45, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 13, 10, 33, 37, 39,
- 45, 46, 65, 66, 67, 69, 70, 77,
- 83, 84, 85, 87, 97, 98, 99, 101,
- 102, 109, 115, 116, 117, 119, 126, 42,
- 43, 48, 57, 68, 90, 95, 122, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 83, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 33,
- 37, 39, 45, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 42, 43, 48, 57, 68, 90, 95,
- 122, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 88, 120,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 80,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 32,
- 13, 10, 33, 37, 39, 45, 46, 65,
- 66, 67, 69, 70, 77, 83, 84, 85,
- 87, 97, 98, 99, 101, 102, 109, 115,
- 116, 117, 119, 126, 42, 43, 48, 57,
- 68, 90, 95, 122, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 77, 109, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 80, 112, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 33, 37, 39, 58, 72, 104, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 13, 10, 33, 37, 39, 45, 46,
- 65, 66, 67, 69, 70, 77, 83, 84,
- 85, 87, 97, 98, 99, 101, 102, 109,
- 115, 116, 117, 119, 126, 42, 43, 48,
- 57, 68, 90, 95, 122, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 58, 90, 122, 126, 42, 43,
- 45, 46, 48, 57, 65, 89, 95, 121,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 32, 13, 10, 33,
- 37, 39, 45, 46, 65, 66, 67, 69,
- 70, 77, 83, 84, 85, 87, 97, 98,
- 99, 101, 102, 109, 115, 116, 117, 119,
- 126, 42, 43, 48, 57, 68, 90, 95,
- 122, 13, 127, 0, 8, 10, 31, 13,
- 127, 0, 8, 10, 31, 13, 65, 90,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 37, 43, 61,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 32, 37, 43, 61, 45, 46, 48, 57,
- 65, 90, 97, 122, 32, 0
+ 77, 83, 82, 80, 32, 48, 57, 65,
+ 90, 97, 122, 37, 43, 61, 45, 46,
+ 48, 57, 65, 90, 97, 122, 37, 43,
+ 61, 45, 46, 48, 57, 65, 90, 97,
+ 122, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 13, 48, 57, 65, 90, 10, 13, 33,
+ 37, 39, 46, 65, 66, 67, 69, 70,
+ 77, 83, 84, 85, 87, 97, 98, 99,
+ 101, 102, 109, 115, 116, 117, 119, 126,
+ 301, 557, 42, 43, 48, 57, 68, 90,
+ 95, 122, 10, 13, 13, 10, 13, 13,
+ 301, 557, -128, 44, 46, 127, 557, 557,
+ 557, 557, 557, 557, 560, 569, 577, 602,
+ 609, 634, 549, 555, 573, 557, 558, 560,
+ 569, 577, 602, 609, 634, 549, 555, 573,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 549, 555, 573, 557, 558, 560, 569, 577,
+ 602, 609, 634, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 522, 549, 555, 573, 547, 548, 557,
+ 558, 560, 569, 577, 602, 609, 634, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 549, 555, 573, 547,
+ 548, 557, 558, 560, 569, 577, 602, 609,
+ 634, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 549, 555,
+ 573, 547, 548, 557, 558, 560, 569, 577,
+ 602, 609, 634, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 549, 555, 573, 547, 548, 557, 558, 560,
+ 569, 577, 602, 609, 634, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 549, 555, 573, 547, 548, 557,
+ 558, 560, 569, 577, 602, 609, 634, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 549, 555, 573, 547,
+ 548, 557, 558, 560, 569, 577, 602, 609,
+ 634, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 549, 555,
+ 573, 547, 548, 557, 558, 560, 569, 577,
+ 602, 609, 634, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 549, 555, 573, 547, 548, 557, 558, 560,
+ 569, 577, 602, 609, 634, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 549, 555, 573, 547, 548, 557,
+ 558, 560, 569, 577, 602, 609, 634, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 549, 555, 573, 547,
+ 548, 557, 558, 560, 569, 577, 602, 609,
+ 634, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 549, 555,
+ 573, 547, 548, 557, 558, 560, 569, 577,
+ 602, 609, 634, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 549, 555, 573, 547, 548, 557, 558, 560,
+ 569, 577, 602, 609, 634, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 549, 555, 573, 547, 548, 557,
+ 558, 560, 569, 577, 602, 609, 634, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 549, 555, 573, 547,
+ 548, 557, 558, 560, 569, 577, 602, 609,
+ 634, 555, 547, 548, 525, 555, 547, 548,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 525, 549, 555, 573, 547, 548,
+ 557, 558, 560, 569, 577, 602, 609, 634,
+ 525, 549, 555, 573, 547, 548, 557, 558,
+ 560, 569, 577, 602, 609, 634, 525, 549,
+ 555, 573, 547, 548, 557, 558, 560, 569,
+ 577, 602, 609, 634, 525, 549, 555, 573,
+ 547, 548, 557, 558, 560, 569, 577, 602,
+ 609, 634, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 32, 13, 127, 0, 8, 10, 31,
+ 10, 13, 33, 37, 39, 46, 65, 66,
+ 67, 69, 70, 77, 83, 84, 85, 87,
+ 97, 98, 99, 101, 102, 109, 115, 116,
+ 117, 119, 126, 301, 557, 42, 43, 48,
+ 57, 68, 90, 95, 122, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 72, 104, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 69, 79, 101, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 70, 102, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 13,
+ 10, 13, 33, 37, 39, 46, 65, 66,
+ 67, 69, 70, 77, 83, 84, 85, 87,
+ 97, 98, 99, 101, 102, 109, 115, 116,
+ 117, 119, 126, 301, 557, 42, 43, 48,
+ 57, 68, 90, 95, 122, 33, 37, 39,
+ 58, 89, 121, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 32, 13, 10, 13, 33,
+ 37, 39, 46, 65, 66, 67, 69, 70,
+ 77, 83, 84, 85, 87, 97, 98, 99,
+ 101, 102, 109, 115, 116, 117, 119, 126,
+ 301, 557, 42, 43, 48, 57, 68, 90,
+ 95, 122, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 89, 121, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 13, 33, 37,
+ 39, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 301,
+ 557, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 88, 120, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 80, 112,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 13,
+ 10, 13, 33, 37, 39, 46, 65, 66,
+ 67, 69, 70, 77, 83, 84, 85, 87,
+ 97, 98, 99, 101, 102, 109, 115, 116,
+ 117, 119, 126, 301, 557, 42, 43, 48,
+ 57, 68, 90, 95, 122, 33, 37, 39,
+ 58, 65, 82, 97, 114, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 76, 108, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 85, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 80, 112, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 32, 13, 10, 13, 33, 37, 39,
+ 46, 65, 66, 67, 69, 70, 77, 83,
+ 84, 85, 87, 97, 98, 99, 101, 102,
+ 109, 115, 116, 117, 119, 126, 301, 557,
+ 42, 43, 48, 57, 68, 90, 95, 122,
+ 33, 37, 39, 58, 65, 69, 73, 97,
+ 101, 105, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 33, 37, 39,
+ 58, 88, 120, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 88, 120, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 32, 13, 10, 13, 33,
+ 37, 39, 46, 65, 66, 67, 69, 70,
+ 77, 83, 84, 85, 87, 97, 98, 99,
+ 101, 102, 109, 115, 116, 117, 119, 126,
+ 301, 557, 42, 43, 48, 57, 68, 90,
+ 95, 122, 33, 37, 39, 58, 84, 85,
+ 116, 117, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 85, 117, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 83, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 13, 10, 13, 33, 37, 39, 46,
+ 65, 66, 67, 69, 70, 77, 83, 84,
+ 85, 87, 97, 98, 99, 101, 102, 109,
+ 115, 116, 117, 119, 126, 301, 557, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 72, 104,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 13, 33, 37,
+ 39, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 301,
+ 557, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 80, 112,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 32, 13, 10,
+ 13, 33, 37, 39, 46, 65, 66, 67,
+ 69, 70, 77, 83, 84, 85, 87, 97,
+ 98, 99, 101, 102, 109, 115, 116, 117,
+ 119, 126, 301, 557, 42, 43, 48, 57,
+ 68, 90, 95, 122, 33, 37, 39, 58,
+ 87, 119, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 87, 119, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 33, 37,
+ 39, 58, 85, 117, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 72, 104, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 13, 10, 13, 33, 37, 39, 46,
+ 65, 66, 67, 69, 70, 77, 83, 84,
+ 85, 87, 97, 98, 99, 101, 102, 109,
+ 115, 116, 117, 119, 126, 301, 557, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 67, 99, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 80, 112, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 13, 10, 13, 33, 37, 39, 46,
+ 65, 66, 67, 69, 70, 77, 83, 84,
+ 85, 87, 97, 98, 99, 101, 102, 109,
+ 115, 116, 117, 119, 126, 301, 557, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 83, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 13,
+ 33, 37, 39, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 301, 557, 42, 43, 48, 57, 68,
+ 90, 95, 122, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 88, 120, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 80, 112, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 32, 13, 10, 13, 33, 37, 39,
+ 46, 65, 66, 67, 69, 70, 77, 83,
+ 84, 85, 87, 97, 98, 99, 101, 102,
+ 109, 115, 116, 117, 119, 126, 301, 557,
+ 42, 43, 48, 57, 68, 90, 95, 122,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 77, 109, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 72, 104, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 13,
+ 33, 37, 39, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 301, 557, 42, 43, 48, 57, 68,
+ 90, 95, 122, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 90, 122, 126, 42, 43, 45, 46,
+ 48, 57, 65, 89, 95, 121, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 13, 33, 37,
+ 39, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 301,
+ 557, 42, 43, 48, 57, 68, 90, 95,
+ 122, 48, 57, 48, 57, 13, 32, 10,
+ 33, 37, 39, 45, 46, 65, 66, 67,
+ 69, 70, 77, 83, 84, 85, 87, 97,
+ 98, 99, 101, 102, 109, 115, 116, 117,
+ 119, 126, 42, 43, 48, 57, 68, 90,
+ 95, 122, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 32, 13, 127, 0, 8, 10, 31,
+ 10, 33, 37, 39, 45, 46, 65, 66,
+ 67, 69, 70, 77, 83, 84, 85, 87,
+ 97, 98, 99, 101, 102, 109, 115, 116,
+ 117, 119, 126, 42, 43, 48, 57, 68,
+ 90, 95, 122, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 33, 37, 39, 42, 43, 58, 61, 126,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 33, 37, 39, 42,
+ 43, 58, 61, 126, 35, 36, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 13, 10, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 61, 126, 35, 36,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 33, 37, 39, 42, 43, 58,
+ 61, 126, 35, 36, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 33, 37,
+ 39, 42, 43, 58, 126, 35, 36, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 33, 37, 39, 42, 43, 58, 126, 35,
+ 36, 45, 46, 48, 57, 65, 90, 95,
+ 122, 43, 35, 36, 13, 33, 37, 39,
+ 42, 43, 58, 61, 126, 35, 36, 45,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 37, 43, 61, 35, 36, 45, 46,
+ 48, 57, 65, 90, 97, 122, 13, 43,
+ 35, 36, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 13, 33, 37, 39, 42, 43,
+ 58, 61, 126, 35, 36, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 37,
+ 43, 61, 35, 36, 45, 46, 48, 57,
+ 65, 90, 97, 122, 13, 37, 43, 61,
+ 35, 36, 45, 46, 48, 57, 65, 90,
+ 97, 122, 37, 43, 61, 35, 36, 45,
+ 46, 48, 57, 65, 90, 97, 122, 13,
+ 37, 43, 61, 35, 36, 45, 46, 48,
+ 57, 65, 90, 97, 122, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 37, 43, 61, 45, 46, 48, 57, 65,
+ 90, 97, 122, 33, 37, 39, 58, 85,
+ 117, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 69, 79, 101, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 67, 99, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 70,
+ 102, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 33,
+ 37, 39, 45, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 89, 121, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 71, 103, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 32,
+ 13, 10, 33, 37, 39, 45, 46, 65,
+ 66, 67, 69, 70, 77, 83, 84, 85,
+ 87, 97, 98, 99, 101, 102, 109, 115,
+ 116, 117, 119, 126, 42, 43, 48, 57,
+ 68, 90, 95, 122, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 89, 121,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 80,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 33,
+ 37, 39, 45, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 88, 120, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 80, 112,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 32, 13,
+ 10, 33, 37, 39, 45, 46, 65, 66,
+ 67, 69, 70, 77, 83, 84, 85, 87,
+ 97, 98, 99, 101, 102, 109, 115, 116,
+ 117, 119, 126, 42, 43, 48, 57, 68,
+ 90, 95, 122, 33, 37, 39, 58, 65,
+ 82, 97, 114, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 76, 108, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 85, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 32,
+ 13, 10, 33, 37, 39, 45, 46, 65,
+ 66, 67, 69, 70, 77, 83, 84, 85,
+ 87, 97, 98, 99, 101, 102, 109, 115,
+ 116, 117, 119, 126, 42, 43, 48, 57,
+ 68, 90, 95, 122, 33, 37, 39, 58,
+ 65, 69, 73, 97, 101, 105, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 33, 37, 39, 58, 88, 120, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 88, 120,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 80,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 32,
+ 13, 10, 33, 37, 39, 45, 46, 65,
+ 66, 67, 69, 70, 77, 83, 84, 85,
+ 87, 97, 98, 99, 101, 102, 109, 115,
+ 116, 117, 119, 126, 42, 43, 48, 57,
+ 68, 90, 95, 122, 33, 37, 39, 58,
+ 84, 85, 116, 117, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 33, 37, 39,
+ 45, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 72, 104,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 33, 37, 39,
+ 45, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 80, 112, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 72,
+ 104, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 32, 13, 10, 33, 37,
+ 39, 45, 46, 65, 66, 67, 69, 70,
+ 77, 83, 84, 85, 87, 97, 98, 99,
+ 101, 102, 109, 115, 116, 117, 119, 126,
+ 42, 43, 48, 57, 68, 90, 95, 122,
+ 33, 37, 39, 58, 87, 119, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 87, 119, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 33, 37, 39, 58, 85, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 72, 104, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 33,
+ 37, 39, 45, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 13, 10, 33, 37, 39,
+ 45, 46, 65, 66, 67, 69, 70, 77,
+ 83, 84, 85, 87, 97, 98, 99, 101,
+ 102, 109, 115, 116, 117, 119, 126, 42,
+ 43, 48, 57, 68, 90, 95, 122, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 83, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 33,
+ 37, 39, 45, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 42, 43, 48, 57, 68, 90, 95,
+ 122, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 88, 120,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 80,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 32,
+ 13, 10, 33, 37, 39, 45, 46, 65,
+ 66, 67, 69, 70, 77, 83, 84, 85,
+ 87, 97, 98, 99, 101, 102, 109, 115,
+ 116, 117, 119, 126, 42, 43, 48, 57,
+ 68, 90, 95, 122, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 77, 109, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 80, 112, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 33, 37, 39, 58, 72, 104, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 13, 10, 33, 37, 39, 45, 46,
+ 65, 66, 67, 69, 70, 77, 83, 84,
+ 85, 87, 97, 98, 99, 101, 102, 109,
+ 115, 116, 117, 119, 126, 42, 43, 48,
+ 57, 68, 90, 95, 122, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 58, 90, 122, 126, 42, 43,
+ 45, 46, 48, 57, 65, 89, 95, 121,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 32, 13, 10, 33,
+ 37, 39, 45, 46, 65, 66, 67, 69,
+ 70, 77, 83, 84, 85, 87, 97, 98,
+ 99, 101, 102, 109, 115, 116, 117, 119,
+ 126, 42, 43, 48, 57, 68, 90, 95,
+ 122, 13, 127, 0, 8, 10, 31, 13,
+ 127, 0, 8, 10, 31, 13, 65, 90,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 37, 43, 61,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 32, 37, 43, 61, 45, 46, 48, 57,
+ 65, 90, 97, 122, 32, 0
};
static const char _tmsrp_machine_message_single_lengths[] = {
- 0, 1, 1, 1, 1, 1, 0, 3,
- 3, 3, 4, 1, 1, 28, 1, 1,
- 1, 2, 3, 1, 1, 1, 1, 1,
- 1, 0, 3, 3, 3, 3, 1, 1,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 1, 2, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 1, 2, 1, 28, 7, 7, 7,
- 9, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 5,
- 1, 1, 1, 28, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 5, 1, 1,
- 1, 28, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 5, 1, 1,
- 1, 28, 7, 7, 7, 7, 7, 7,
- 5, 1, 1, 1, 28, 9, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 5, 1, 1, 1, 28, 11,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 5, 1, 1, 1, 28, 9, 7,
- 7, 7, 7, 5, 1, 1, 1, 28,
- 7, 7, 7, 7, 7, 7, 5, 1,
- 1, 1, 28, 7, 7, 7, 7, 7,
- 7, 7, 5, 1, 1, 1, 28, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 5, 1,
- 1, 1, 28, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 5,
- 1, 1, 1, 28, 7, 7, 7, 7,
- 7, 7, 7, 7, 5, 1, 1, 1,
- 28, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 5, 1, 1, 1, 28, 7,
- 7, 7, 7, 7, 7, 7, 5, 1,
- 1, 1, 28, 7, 7, 7, 7, 7,
- 7, 7, 7, 5, 1, 1, 1, 28,
- 0, 0, 2, 1, 26, 5, 1, 2,
- 1, 26, 7, 7, 7, 7, 7, 7,
- 5, 8, 8, 8, 8, 1, 1, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 7, 6, 8, 1, 9, 3,
- 2, 9, 3, 4, 9, 3, 4, 9,
- 3, 4, 9, 3, 4, 9, 3, 4,
- 9, 3, 4, 9, 3, 4, 9, 3,
- 4, 9, 3, 4, 9, 3, 4, 9,
- 3, 4, 9, 3, 4, 9, 3, 4,
- 9, 3, 4, 9, 3, 4, 9, 3,
- 4, 9, 3, 4, 9, 3, 4, 9,
- 3, 4, 9, 3, 4, 9, 3, 4,
- 9, 3, 4, 9, 3, 4, 9, 3,
- 4, 9, 3, 4, 9, 3, 4, 3,
- 4, 3, 3, 7, 7, 7, 9, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 5, 1, 1,
- 1, 26, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 5, 1, 1, 1, 26,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 5, 1, 1, 1, 26,
- 7, 7, 7, 7, 7, 7, 5, 1,
- 1, 1, 26, 9, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 5, 1, 1, 1, 26, 11, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 5,
- 1, 1, 1, 26, 9, 7, 7, 7,
- 7, 5, 1, 1, 1, 26, 7, 7,
- 7, 7, 7, 7, 5, 1, 1, 1,
- 26, 7, 7, 7, 7, 7, 7, 7,
- 5, 1, 1, 1, 26, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 5, 1, 1, 1,
- 26, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 5, 1, 1,
- 1, 26, 7, 7, 7, 7, 7, 7,
- 7, 7, 5, 1, 1, 1, 26, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 5, 1, 1, 1, 26, 7, 7, 7,
- 7, 7, 7, 7, 5, 1, 1, 1,
- 26, 7, 7, 7, 7, 7, 7, 7,
- 7, 5, 1, 1, 1, 26, 2, 2,
- 1, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 1, 0
+ 0, 1, 1, 1, 1, 1, 0, 3,
+ 3, 3, 4, 1, 1, 28, 1, 1,
+ 1, 2, 3, 1, 1, 1, 1, 1,
+ 1, 0, 3, 3, 3, 3, 1, 1,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 1, 2, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 1, 2, 1, 28, 7, 7, 7,
+ 9, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 5,
+ 1, 1, 1, 28, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 5, 1, 1,
+ 1, 28, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 5, 1, 1,
+ 1, 28, 7, 7, 7, 7, 7, 7,
+ 5, 1, 1, 1, 28, 9, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 5, 1, 1, 1, 28, 11,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 5, 1, 1, 1, 28, 9, 7,
+ 7, 7, 7, 5, 1, 1, 1, 28,
+ 7, 7, 7, 7, 7, 7, 5, 1,
+ 1, 1, 28, 7, 7, 7, 7, 7,
+ 7, 7, 5, 1, 1, 1, 28, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 5, 1,
+ 1, 1, 28, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 5,
+ 1, 1, 1, 28, 7, 7, 7, 7,
+ 7, 7, 7, 7, 5, 1, 1, 1,
+ 28, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 5, 1, 1, 1, 28, 7,
+ 7, 7, 7, 7, 7, 7, 5, 1,
+ 1, 1, 28, 7, 7, 7, 7, 7,
+ 7, 7, 7, 5, 1, 1, 1, 28,
+ 0, 0, 2, 1, 26, 5, 1, 2,
+ 1, 26, 7, 7, 7, 7, 7, 7,
+ 5, 8, 8, 8, 8, 1, 1, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 7, 6, 8, 1, 9, 3,
+ 2, 9, 3, 4, 9, 3, 4, 9,
+ 3, 4, 9, 3, 4, 9, 3, 4,
+ 9, 3, 4, 9, 3, 4, 9, 3,
+ 4, 9, 3, 4, 9, 3, 4, 9,
+ 3, 4, 9, 3, 4, 9, 3, 4,
+ 9, 3, 4, 9, 3, 4, 9, 3,
+ 4, 9, 3, 4, 9, 3, 4, 9,
+ 3, 4, 9, 3, 4, 9, 3, 4,
+ 9, 3, 4, 9, 3, 4, 9, 3,
+ 4, 9, 3, 4, 9, 3, 4, 3,
+ 4, 3, 3, 7, 7, 7, 9, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 5, 1, 1,
+ 1, 26, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 5, 1, 1, 1, 26,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 5, 1, 1, 1, 26,
+ 7, 7, 7, 7, 7, 7, 5, 1,
+ 1, 1, 26, 9, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 5, 1, 1, 1, 26, 11, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 5,
+ 1, 1, 1, 26, 9, 7, 7, 7,
+ 7, 5, 1, 1, 1, 26, 7, 7,
+ 7, 7, 7, 7, 5, 1, 1, 1,
+ 26, 7, 7, 7, 7, 7, 7, 7,
+ 5, 1, 1, 1, 26, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 5, 1, 1, 1,
+ 26, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 5, 1, 1,
+ 1, 26, 7, 7, 7, 7, 7, 7,
+ 7, 7, 5, 1, 1, 1, 26, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 5, 1, 1, 1, 26, 7, 7, 7,
+ 7, 7, 7, 7, 5, 1, 1, 1,
+ 26, 7, 7, 7, 7, 7, 7, 7,
+ 7, 5, 1, 1, 1, 26, 2, 2,
+ 1, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 1, 0
};
static const char _tmsrp_machine_message_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 3, 4,
- 4, 4, 4, 2, 0, 4, 0, 0,
- 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 3, 4, 4, 4, 5, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 1, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 2, 0, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 4, 5, 5, 5, 5, 5,
- 0, 0, 0, 4, 5, 5, 5, 4,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 4, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 0, 0,
- 0, 4, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 4, 5, 5, 5,
- 5, 5, 5, 4, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 4, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 4,
- 5, 4, 5, 5, 5, 5, 5, 0,
- 0, 0, 4, 5, 5, 4, 5, 5,
- 5, 5, 5, 0, 0, 0, 4, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 4, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 4, 5, 5, 5, 5,
- 5, 4, 5, 5, 5, 0, 0, 0,
- 4, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 4, 5,
- 5, 4, 5, 5, 5, 5, 5, 0,
- 0, 0, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 4,
- 1, 1, 0, 0, 4, 5, 0, 2,
- 0, 4, 4, 4, 4, 4, 4, 4,
- 6, 5, 5, 5, 6, 0, 0, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 5, 5, 5, 1, 6, 5,
- 1, 6, 5, 5, 6, 5, 5, 6,
- 5, 5, 6, 5, 5, 6, 5, 5,
- 6, 5, 5, 6, 5, 5, 6, 5,
- 5, 6, 5, 5, 6, 5, 5, 6,
- 5, 5, 6, 5, 5, 6, 5, 5,
- 6, 5, 5, 6, 5, 5, 6, 5,
- 5, 6, 5, 5, 6, 5, 5, 6,
- 5, 5, 6, 5, 5, 6, 5, 5,
- 6, 5, 5, 6, 5, 5, 6, 5,
- 5, 6, 5, 5, 6, 5, 5, 5,
- 5, 4, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 0, 0,
- 0, 4, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 4,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 0, 0, 0, 4,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 4, 5, 5, 5, 5, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 4, 5, 5, 4,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 4, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 4, 5, 4,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 4, 5, 5, 4, 5, 5, 5, 5,
- 5, 0, 0, 0, 4, 5, 5, 4,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 4, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 4, 5, 5, 5, 5, 5, 4,
- 5, 5, 5, 0, 0, 0, 4, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 4, 5, 5, 4,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 4, 2, 2,
- 1, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 0, 0
+ 0, 0, 0, 0, 0, 0, 3, 4,
+ 4, 4, 4, 2, 0, 4, 0, 0,
+ 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 3, 4, 4, 4, 5, 0, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 1, 1, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 2, 0, 4, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 4, 5, 5, 5, 5, 5,
+ 0, 0, 0, 4, 5, 5, 5, 4,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 4, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 0, 0,
+ 0, 4, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 4, 5, 5, 5,
+ 5, 5, 5, 4, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 4, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 4,
+ 5, 4, 5, 5, 5, 5, 5, 0,
+ 0, 0, 4, 5, 5, 4, 5, 5,
+ 5, 5, 5, 0, 0, 0, 4, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 4, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 4, 5, 5, 5, 5,
+ 5, 4, 5, 5, 5, 0, 0, 0,
+ 4, 5, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 4, 5,
+ 5, 4, 5, 5, 5, 5, 5, 0,
+ 0, 0, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 4,
+ 1, 1, 0, 0, 4, 5, 0, 2,
+ 0, 4, 4, 4, 4, 4, 4, 4,
+ 6, 5, 5, 5, 6, 0, 0, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 5, 5, 5, 1, 6, 5,
+ 1, 6, 5, 5, 6, 5, 5, 6,
+ 5, 5, 6, 5, 5, 6, 5, 5,
+ 6, 5, 5, 6, 5, 5, 6, 5,
+ 5, 6, 5, 5, 6, 5, 5, 6,
+ 5, 5, 6, 5, 5, 6, 5, 5,
+ 6, 5, 5, 6, 5, 5, 6, 5,
+ 5, 6, 5, 5, 6, 5, 5, 6,
+ 5, 5, 6, 5, 5, 6, 5, 5,
+ 6, 5, 5, 6, 5, 5, 6, 5,
+ 5, 6, 5, 5, 6, 5, 5, 5,
+ 5, 4, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 0, 0,
+ 0, 4, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 4,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 0, 0, 0, 4,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 4, 5, 5, 5, 5, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 4, 5, 5, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 4, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 4, 5, 4,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 4, 5, 5, 4, 5, 5, 5, 5,
+ 5, 0, 0, 0, 4, 5, 5, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 4, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 4, 5, 5, 5, 5, 5, 4,
+ 5, 5, 5, 0, 0, 0, 4, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 4, 5, 5, 4,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 4, 2, 2,
+ 1, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 0, 0
};
static const short _tmsrp_machine_message_index_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 14,
- 22, 30, 38, 47, 51, 53, 86, 88,
- 90, 92, 95, 101, 103, 105, 107, 109,
- 111, 113, 117, 125, 133, 141, 150, 152,
- 154, 163, 172, 181, 190, 199, 208, 217,
- 226, 235, 244, 253, 262, 271, 280, 289,
- 298, 307, 316, 325, 334, 343, 352, 361,
- 370, 379, 388, 397, 400, 404, 414, 424,
- 434, 444, 454, 464, 474, 484, 494, 504,
- 514, 524, 534, 544, 554, 564, 574, 584,
- 594, 604, 614, 624, 634, 644, 654, 664,
- 674, 685, 687, 692, 694, 727, 740, 753,
- 766, 781, 794, 807, 820, 833, 846, 859,
- 872, 885, 898, 910, 923, 936, 949, 962,
- 973, 975, 977, 979, 1012, 1025, 1038, 1051,
- 1063, 1076, 1089, 1102, 1115, 1128, 1139, 1141,
- 1143, 1145, 1178, 1191, 1204, 1217, 1230, 1243,
- 1256, 1268, 1281, 1294, 1307, 1320, 1331, 1333,
- 1335, 1337, 1370, 1383, 1396, 1409, 1422, 1435,
- 1448, 1459, 1461, 1463, 1465, 1498, 1513, 1526,
- 1539, 1552, 1565, 1578, 1590, 1603, 1616, 1629,
- 1642, 1655, 1668, 1679, 1681, 1683, 1685, 1718,
- 1735, 1748, 1760, 1773, 1786, 1799, 1812, 1825,
- 1838, 1851, 1862, 1864, 1866, 1868, 1901, 1916,
- 1929, 1942, 1955, 1968, 1979, 1981, 1983, 1985,
- 2018, 2031, 2043, 2056, 2069, 2082, 2095, 2106,
- 2108, 2110, 2112, 2145, 2158, 2171, 2183, 2196,
- 2209, 2222, 2235, 2246, 2248, 2250, 2252, 2285,
- 2298, 2311, 2323, 2336, 2349, 2362, 2375, 2388,
- 2401, 2414, 2427, 2440, 2453, 2466, 2479, 2490,
- 2492, 2494, 2496, 2529, 2542, 2555, 2568, 2581,
- 2594, 2606, 2619, 2632, 2645, 2658, 2671, 2684,
- 2695, 2697, 2699, 2701, 2734, 2747, 2760, 2773,
- 2786, 2799, 2811, 2824, 2837, 2848, 2850, 2852,
- 2854, 2887, 2900, 2912, 2925, 2938, 2951, 2964,
- 2977, 2990, 3003, 3014, 3016, 3018, 3020, 3053,
- 3066, 3079, 3091, 3104, 3117, 3130, 3143, 3154,
- 3156, 3158, 3160, 3193, 3206, 3219, 3232, 3245,
- 3258, 3271, 3284, 3297, 3308, 3310, 3312, 3314,
- 3347, 3349, 3351, 3354, 3356, 3387, 3398, 3400,
- 3405, 3407, 3438, 3450, 3462, 3474, 3486, 3498,
- 3510, 3522, 3536, 3550, 3564, 3579, 3581, 3583,
- 3598, 3613, 3628, 3643, 3658, 3673, 3688, 3703,
- 3718, 3733, 3748, 3763, 3778, 3793, 3808, 3823,
- 3838, 3853, 3868, 3883, 3898, 3913, 3928, 3943,
- 3958, 3973, 3988, 4001, 4013, 4027, 4030, 4046,
- 4055, 4059, 4075, 4084, 4094, 4110, 4119, 4129,
- 4145, 4154, 4164, 4180, 4189, 4199, 4215, 4224,
- 4234, 4250, 4259, 4269, 4285, 4294, 4304, 4320,
- 4329, 4339, 4355, 4364, 4374, 4390, 4399, 4409,
- 4425, 4434, 4444, 4460, 4469, 4479, 4495, 4504,
- 4514, 4530, 4539, 4549, 4565, 4574, 4584, 4600,
- 4609, 4619, 4635, 4644, 4654, 4670, 4679, 4689,
- 4705, 4714, 4724, 4740, 4749, 4759, 4775, 4784,
- 4794, 4810, 4819, 4829, 4845, 4854, 4864, 4880,
- 4889, 4899, 4915, 4924, 4934, 4950, 4959, 4969,
- 4978, 4988, 4996, 5004, 5017, 5030, 5043, 5058,
- 5071, 5084, 5097, 5110, 5123, 5136, 5149, 5162,
- 5175, 5187, 5200, 5213, 5226, 5239, 5250, 5252,
- 5254, 5256, 5287, 5300, 5313, 5326, 5338, 5351,
- 5364, 5377, 5390, 5403, 5414, 5416, 5418, 5420,
- 5451, 5464, 5477, 5490, 5503, 5516, 5529, 5541,
- 5554, 5567, 5580, 5593, 5604, 5606, 5608, 5610,
- 5641, 5654, 5667, 5680, 5693, 5706, 5719, 5730,
- 5732, 5734, 5736, 5767, 5782, 5795, 5808, 5821,
- 5834, 5847, 5859, 5872, 5885, 5898, 5911, 5924,
- 5937, 5948, 5950, 5952, 5954, 5985, 6002, 6015,
- 6027, 6040, 6053, 6066, 6079, 6092, 6105, 6118,
- 6129, 6131, 6133, 6135, 6166, 6181, 6194, 6207,
- 6220, 6233, 6244, 6246, 6248, 6250, 6281, 6294,
- 6306, 6319, 6332, 6345, 6358, 6369, 6371, 6373,
- 6375, 6406, 6419, 6432, 6444, 6457, 6470, 6483,
- 6496, 6507, 6509, 6511, 6513, 6544, 6557, 6570,
- 6582, 6595, 6608, 6621, 6634, 6647, 6660, 6673,
- 6686, 6699, 6712, 6725, 6738, 6749, 6751, 6753,
- 6755, 6786, 6799, 6812, 6825, 6838, 6851, 6863,
- 6876, 6889, 6902, 6915, 6928, 6941, 6952, 6954,
- 6956, 6958, 6989, 7002, 7015, 7028, 7041, 7054,
- 7066, 7079, 7092, 7103, 7105, 7107, 7109, 7140,
- 7153, 7165, 7178, 7191, 7204, 7217, 7230, 7243,
- 7256, 7267, 7269, 7271, 7273, 7304, 7317, 7330,
- 7342, 7355, 7368, 7381, 7394, 7405, 7407, 7409,
- 7411, 7442, 7455, 7468, 7481, 7494, 7507, 7520,
- 7533, 7546, 7557, 7559, 7561, 7563, 7594, 7599,
- 7604, 7607, 7616, 7625, 7634, 7643, 7652, 7661,
- 7670, 7679, 7688, 7697, 7706, 7715, 7724, 7733,
- 7742, 7751, 7760, 7769, 7778, 7787, 7796, 7805,
- 7814, 7823, 7832, 7841, 7850, 7852
+ 0, 0, 2, 4, 6, 8, 10, 14,
+ 22, 30, 38, 47, 51, 53, 86, 88,
+ 90, 92, 95, 101, 103, 105, 107, 109,
+ 111, 113, 117, 125, 133, 141, 150, 152,
+ 154, 163, 172, 181, 190, 199, 208, 217,
+ 226, 235, 244, 253, 262, 271, 280, 289,
+ 298, 307, 316, 325, 334, 343, 352, 361,
+ 370, 379, 388, 397, 400, 404, 414, 424,
+ 434, 444, 454, 464, 474, 484, 494, 504,
+ 514, 524, 534, 544, 554, 564, 574, 584,
+ 594, 604, 614, 624, 634, 644, 654, 664,
+ 674, 685, 687, 692, 694, 727, 740, 753,
+ 766, 781, 794, 807, 820, 833, 846, 859,
+ 872, 885, 898, 910, 923, 936, 949, 962,
+ 973, 975, 977, 979, 1012, 1025, 1038, 1051,
+ 1063, 1076, 1089, 1102, 1115, 1128, 1139, 1141,
+ 1143, 1145, 1178, 1191, 1204, 1217, 1230, 1243,
+ 1256, 1268, 1281, 1294, 1307, 1320, 1331, 1333,
+ 1335, 1337, 1370, 1383, 1396, 1409, 1422, 1435,
+ 1448, 1459, 1461, 1463, 1465, 1498, 1513, 1526,
+ 1539, 1552, 1565, 1578, 1590, 1603, 1616, 1629,
+ 1642, 1655, 1668, 1679, 1681, 1683, 1685, 1718,
+ 1735, 1748, 1760, 1773, 1786, 1799, 1812, 1825,
+ 1838, 1851, 1862, 1864, 1866, 1868, 1901, 1916,
+ 1929, 1942, 1955, 1968, 1979, 1981, 1983, 1985,
+ 2018, 2031, 2043, 2056, 2069, 2082, 2095, 2106,
+ 2108, 2110, 2112, 2145, 2158, 2171, 2183, 2196,
+ 2209, 2222, 2235, 2246, 2248, 2250, 2252, 2285,
+ 2298, 2311, 2323, 2336, 2349, 2362, 2375, 2388,
+ 2401, 2414, 2427, 2440, 2453, 2466, 2479, 2490,
+ 2492, 2494, 2496, 2529, 2542, 2555, 2568, 2581,
+ 2594, 2606, 2619, 2632, 2645, 2658, 2671, 2684,
+ 2695, 2697, 2699, 2701, 2734, 2747, 2760, 2773,
+ 2786, 2799, 2811, 2824, 2837, 2848, 2850, 2852,
+ 2854, 2887, 2900, 2912, 2925, 2938, 2951, 2964,
+ 2977, 2990, 3003, 3014, 3016, 3018, 3020, 3053,
+ 3066, 3079, 3091, 3104, 3117, 3130, 3143, 3154,
+ 3156, 3158, 3160, 3193, 3206, 3219, 3232, 3245,
+ 3258, 3271, 3284, 3297, 3308, 3310, 3312, 3314,
+ 3347, 3349, 3351, 3354, 3356, 3387, 3398, 3400,
+ 3405, 3407, 3438, 3450, 3462, 3474, 3486, 3498,
+ 3510, 3522, 3536, 3550, 3564, 3579, 3581, 3583,
+ 3598, 3613, 3628, 3643, 3658, 3673, 3688, 3703,
+ 3718, 3733, 3748, 3763, 3778, 3793, 3808, 3823,
+ 3838, 3853, 3868, 3883, 3898, 3913, 3928, 3943,
+ 3958, 3973, 3988, 4001, 4013, 4027, 4030, 4046,
+ 4055, 4059, 4075, 4084, 4094, 4110, 4119, 4129,
+ 4145, 4154, 4164, 4180, 4189, 4199, 4215, 4224,
+ 4234, 4250, 4259, 4269, 4285, 4294, 4304, 4320,
+ 4329, 4339, 4355, 4364, 4374, 4390, 4399, 4409,
+ 4425, 4434, 4444, 4460, 4469, 4479, 4495, 4504,
+ 4514, 4530, 4539, 4549, 4565, 4574, 4584, 4600,
+ 4609, 4619, 4635, 4644, 4654, 4670, 4679, 4689,
+ 4705, 4714, 4724, 4740, 4749, 4759, 4775, 4784,
+ 4794, 4810, 4819, 4829, 4845, 4854, 4864, 4880,
+ 4889, 4899, 4915, 4924, 4934, 4950, 4959, 4969,
+ 4978, 4988, 4996, 5004, 5017, 5030, 5043, 5058,
+ 5071, 5084, 5097, 5110, 5123, 5136, 5149, 5162,
+ 5175, 5187, 5200, 5213, 5226, 5239, 5250, 5252,
+ 5254, 5256, 5287, 5300, 5313, 5326, 5338, 5351,
+ 5364, 5377, 5390, 5403, 5414, 5416, 5418, 5420,
+ 5451, 5464, 5477, 5490, 5503, 5516, 5529, 5541,
+ 5554, 5567, 5580, 5593, 5604, 5606, 5608, 5610,
+ 5641, 5654, 5667, 5680, 5693, 5706, 5719, 5730,
+ 5732, 5734, 5736, 5767, 5782, 5795, 5808, 5821,
+ 5834, 5847, 5859, 5872, 5885, 5898, 5911, 5924,
+ 5937, 5948, 5950, 5952, 5954, 5985, 6002, 6015,
+ 6027, 6040, 6053, 6066, 6079, 6092, 6105, 6118,
+ 6129, 6131, 6133, 6135, 6166, 6181, 6194, 6207,
+ 6220, 6233, 6244, 6246, 6248, 6250, 6281, 6294,
+ 6306, 6319, 6332, 6345, 6358, 6369, 6371, 6373,
+ 6375, 6406, 6419, 6432, 6444, 6457, 6470, 6483,
+ 6496, 6507, 6509, 6511, 6513, 6544, 6557, 6570,
+ 6582, 6595, 6608, 6621, 6634, 6647, 6660, 6673,
+ 6686, 6699, 6712, 6725, 6738, 6749, 6751, 6753,
+ 6755, 6786, 6799, 6812, 6825, 6838, 6851, 6863,
+ 6876, 6889, 6902, 6915, 6928, 6941, 6952, 6954,
+ 6956, 6958, 6989, 7002, 7015, 7028, 7041, 7054,
+ 7066, 7079, 7092, 7103, 7105, 7107, 7109, 7140,
+ 7153, 7165, 7178, 7191, 7204, 7217, 7230, 7243,
+ 7256, 7267, 7269, 7271, 7273, 7304, 7317, 7330,
+ 7342, 7355, 7368, 7381, 7394, 7405, 7407, 7409,
+ 7411, 7442, 7455, 7468, 7481, 7494, 7507, 7520,
+ 7533, 7546, 7557, 7559, 7561, 7563, 7594, 7599,
+ 7604, 7607, 7616, 7625, 7634, 7643, 7652, 7661,
+ 7670, 7679, 7688, 7697, 7706, 7715, 7724, 7733,
+ 7742, 7751, 7760, 7769, 7778, 7787, 7796, 7805,
+ 7814, 7823, 7832, 7841, 7850, 7852
};
static const short _tmsrp_machine_message_indicies[] = {
- 0, 1, 2, 1, 3, 1, 4, 1,
- 5, 1, 6, 6, 6, 1, 7, 7,
- 7, 7, 7, 7, 7, 1, 8, 8,
- 8, 8, 8, 8, 8, 1, 9, 9,
- 9, 9, 9, 9, 9, 1, 10, 11,
- 11, 11, 11, 11, 11, 11, 1, 12,
- 13, 14, 1, 15, 1, 16, 17, 17,
- 17, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 17, 17,
- 17, 17, 17, 17, 17, 1, 28, 1,
- 30, 29, 32, 31, 33, 32, 31, 32,
- 31, 34, 31, 31, 1, 35, 1, 36,
- 1, 37, 1, 38, 1, 39, 1, 40,
- 1, 41, 41, 41, 1, 42, 42, 42,
- 42, 42, 42, 42, 1, 43, 43, 43,
- 43, 43, 43, 43, 1, 44, 44, 44,
- 44, 44, 44, 44, 1, 46, 47, 46,
- 45, 46, 46, 46, 46, 1, 48, 1,
- 49, 1, 50, 51, 50, 45, 50, 50,
- 50, 50, 1, 52, 53, 52, 45, 52,
- 52, 52, 52, 1, 54, 55, 54, 45,
- 54, 54, 54, 54, 1, 56, 57, 56,
- 45, 56, 56, 56, 56, 1, 58, 59,
- 58, 45, 58, 58, 58, 58, 1, 60,
- 61, 60, 45, 60, 60, 60, 60, 1,
- 62, 63, 62, 45, 62, 62, 62, 62,
- 1, 64, 65, 64, 45, 64, 64, 64,
- 64, 1, 66, 67, 66, 45, 66, 66,
- 66, 66, 1, 68, 69, 68, 45, 68,
- 68, 68, 68, 1, 70, 71, 70, 45,
- 70, 70, 70, 70, 1, 72, 73, 72,
- 45, 72, 72, 72, 72, 1, 74, 75,
- 74, 45, 74, 74, 74, 74, 1, 76,
- 77, 76, 45, 76, 76, 76, 76, 1,
- 78, 79, 78, 45, 78, 78, 78, 78,
- 1, 80, 81, 80, 45, 80, 80, 80,
- 80, 1, 82, 83, 82, 45, 82, 82,
- 82, 82, 1, 84, 85, 84, 45, 84,
- 84, 84, 84, 1, 86, 87, 86, 45,
- 86, 86, 86, 86, 1, 88, 89, 88,
- 45, 88, 88, 88, 88, 1, 90, 91,
- 90, 45, 90, 90, 90, 90, 1, 92,
- 93, 92, 45, 92, 92, 92, 92, 1,
- 94, 95, 94, 45, 94, 94, 94, 94,
- 1, 96, 97, 96, 45, 96, 96, 96,
- 96, 1, 98, 99, 98, 45, 98, 98,
- 98, 98, 1, 100, 101, 100, 45, 100,
- 100, 100, 100, 1, 102, 103, 102, 45,
- 102, 102, 102, 102, 1, 45, 45, 1,
- 48, 45, 45, 1, 48, 102, 103, 102,
- 45, 102, 102, 102, 102, 1, 48, 100,
- 101, 100, 45, 100, 100, 100, 100, 1,
- 48, 98, 99, 98, 45, 98, 98, 98,
- 98, 1, 48, 96, 97, 96, 45, 96,
- 96, 96, 96, 1, 48, 94, 95, 94,
- 45, 94, 94, 94, 94, 1, 48, 92,
- 93, 92, 45, 92, 92, 92, 92, 1,
- 48, 90, 91, 90, 45, 90, 90, 90,
- 90, 1, 48, 88, 89, 88, 45, 88,
- 88, 88, 88, 1, 48, 86, 87, 86,
- 45, 86, 86, 86, 86, 1, 48, 84,
- 85, 84, 45, 84, 84, 84, 84, 1,
- 48, 82, 83, 82, 45, 82, 82, 82,
- 82, 1, 48, 80, 81, 80, 45, 80,
- 80, 80, 80, 1, 48, 78, 79, 78,
- 45, 78, 78, 78, 78, 1, 48, 76,
- 77, 76, 45, 76, 76, 76, 76, 1,
- 48, 74, 75, 74, 45, 74, 74, 74,
- 74, 1, 48, 72, 73, 72, 45, 72,
- 72, 72, 72, 1, 48, 70, 71, 70,
- 45, 70, 70, 70, 70, 1, 48, 68,
- 69, 68, 45, 68, 68, 68, 68, 1,
- 48, 66, 67, 66, 45, 66, 66, 66,
- 66, 1, 48, 64, 65, 64, 45, 64,
- 64, 64, 64, 1, 48, 62, 63, 62,
- 45, 62, 62, 62, 62, 1, 48, 60,
- 61, 60, 45, 60, 60, 60, 60, 1,
- 48, 58, 59, 58, 45, 58, 58, 58,
- 58, 1, 48, 56, 57, 56, 45, 56,
- 56, 56, 56, 1, 48, 54, 55, 54,
- 45, 54, 54, 54, 54, 1, 48, 52,
- 53, 52, 45, 52, 52, 52, 52, 1,
- 48, 50, 51, 50, 45, 50, 50, 50,
- 50, 1, 104, 104, 104, 105, 104, 104,
- 104, 104, 104, 104, 1, 106, 1, 107,
- 1, 1, 1, 106, 108, 1, 109, 110,
- 110, 110, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 110,
- 110, 121, 110, 110, 110, 110, 1, 104,
- 104, 104, 105, 122, 122, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 123, 123, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 124, 124, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 125, 126, 125, 126, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 127, 127, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 128, 128,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 129, 129, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 130, 130, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 131, 131, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 132, 132, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 133,
- 133, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 134, 134, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 135, 135, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 136, 104, 105,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 137, 137, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 138,
- 138, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 139, 139, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 140, 140, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 141, 104, 104,
- 104, 104, 104, 104, 1, 142, 1, 143,
- 142, 144, 1, 145, 146, 146, 146, 146,
- 147, 148, 149, 150, 151, 152, 153, 154,
- 155, 156, 147, 148, 149, 150, 151, 152,
- 153, 154, 155, 156, 146, 146, 157, 146,
- 146, 146, 146, 1, 104, 104, 104, 105,
- 158, 158, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 159, 159, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 160, 160, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 161, 104,
- 105, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 162, 162, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 163, 163, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 164, 164, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 165, 165, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 166,
- 166, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 167, 104, 104, 104, 104,
- 104, 104, 1, 168, 1, 169, 168, 170,
- 1, 171, 172, 172, 172, 172, 173, 174,
- 175, 176, 177, 178, 179, 180, 181, 182,
- 173, 174, 175, 176, 177, 178, 179, 180,
- 181, 182, 172, 172, 183, 172, 172, 172,
- 172, 1, 104, 104, 104, 105, 184, 184,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 185, 185, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 186, 186, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 187, 187, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 188, 188, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 189,
- 189, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 190, 104, 105, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 191, 191, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 192, 192, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 193, 193, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 194,
- 194, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 195, 104, 104, 104, 104,
- 104, 104, 1, 196, 1, 197, 196, 198,
- 1, 199, 200, 200, 200, 200, 201, 202,
- 203, 204, 205, 206, 207, 208, 209, 210,
- 201, 202, 203, 204, 205, 206, 207, 208,
- 209, 210, 200, 200, 211, 200, 200, 200,
- 200, 1, 104, 104, 104, 105, 212, 212,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 213, 213, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 214, 214, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 215, 215, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 216, 216, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 217,
- 217, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 218, 104, 104, 104, 104,
- 104, 104, 1, 219, 1, 220, 219, 221,
- 1, 222, 223, 223, 223, 223, 224, 225,
- 226, 227, 228, 229, 230, 231, 232, 233,
- 224, 225, 226, 227, 228, 229, 230, 231,
- 232, 233, 223, 223, 234, 223, 223, 223,
- 223, 1, 104, 104, 104, 105, 235, 236,
- 235, 236, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 237, 237, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 238, 238, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 239,
- 239, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 240, 240, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 241, 241, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 242, 104, 105,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 243, 243, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 244,
- 244, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 245, 245, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 246, 246, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 247, 247,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 248, 248, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 249,
- 104, 104, 104, 104, 104, 104, 1, 250,
- 1, 251, 250, 252, 1, 253, 254, 254,
- 254, 254, 255, 256, 257, 258, 259, 260,
- 261, 262, 263, 264, 255, 256, 257, 258,
- 259, 260, 261, 262, 263, 264, 254, 254,
- 265, 254, 254, 254, 254, 1, 104, 104,
- 104, 105, 266, 267, 268, 266, 267, 268,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 269, 269, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 270,
- 104, 105, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 271, 271, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 272, 272, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 273, 273,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 274, 274, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 275, 275, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 276, 276, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 277, 277, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 278, 104,
- 104, 104, 104, 104, 104, 1, 279, 1,
- 280, 279, 281, 1, 282, 283, 283, 283,
- 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 284, 285, 286, 287, 288,
- 289, 290, 291, 292, 293, 283, 283, 294,
- 283, 283, 283, 283, 1, 104, 104, 104,
- 105, 295, 296, 295, 296, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 297, 297, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 298, 298, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 299, 299, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 300,
- 300, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 301, 104, 104, 104, 104,
- 104, 104, 1, 302, 1, 303, 302, 304,
- 1, 305, 306, 306, 306, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316,
- 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, 306, 306, 317, 306, 306, 306,
- 306, 1, 104, 104, 104, 105, 318, 318,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 319, 104, 105, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 320,
- 320, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 321, 321, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 322, 322, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 323, 323,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 324, 104, 104, 104, 104, 104,
- 104, 1, 325, 1, 326, 325, 327, 1,
- 328, 329, 329, 329, 329, 330, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 330,
- 331, 332, 333, 334, 335, 336, 337, 338,
- 339, 329, 329, 340, 329, 329, 329, 329,
- 1, 104, 104, 104, 105, 341, 341, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 342, 342, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 343, 104,
- 105, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 344, 344, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 345, 345, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 346, 346, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 347, 347, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 348, 104,
- 104, 104, 104, 104, 104, 1, 349, 1,
- 350, 349, 351, 1, 352, 353, 353, 353,
- 353, 354, 355, 356, 357, 358, 359, 360,
- 361, 362, 363, 354, 355, 356, 357, 358,
- 359, 360, 361, 362, 363, 353, 353, 364,
- 353, 353, 353, 353, 1, 104, 104, 104,
- 105, 365, 365, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 366, 366,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 367, 104, 105, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 368,
- 368, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 369, 369, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 370, 370, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 371, 371,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 372, 372, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 373, 373, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 374, 374, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 375, 375, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 376,
- 376, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 377, 377, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 378, 378, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 379, 379,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 380, 104, 104, 104, 104, 104,
- 104, 1, 381, 1, 382, 381, 383, 1,
- 384, 385, 385, 385, 385, 386, 387, 388,
- 389, 390, 391, 392, 393, 394, 395, 386,
- 387, 388, 389, 390, 391, 392, 393, 394,
- 395, 385, 385, 396, 385, 385, 385, 385,
- 1, 104, 104, 104, 105, 397, 397, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 398, 398, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 399,
- 399, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 400, 400, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 401, 401, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 402, 104, 105,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 403, 403, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 404,
- 404, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 405, 405, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 406, 406, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 407, 407,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 408, 408, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 409,
- 104, 104, 104, 104, 104, 104, 1, 410,
- 1, 411, 410, 412, 1, 413, 414, 414,
- 414, 414, 415, 416, 417, 418, 419, 420,
- 421, 422, 423, 424, 415, 416, 417, 418,
- 419, 420, 421, 422, 423, 424, 414, 414,
- 425, 414, 414, 414, 414, 1, 104, 104,
- 104, 105, 426, 426, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 427,
- 427, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 428, 428, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 429, 429, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 430, 430,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 431, 104, 105, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 432,
- 432, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 433, 433, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 434, 104, 104, 104, 104, 104, 104, 1,
- 435, 1, 436, 435, 437, 1, 438, 439,
- 439, 439, 439, 440, 441, 442, 443, 444,
- 445, 446, 447, 448, 449, 440, 441, 442,
- 443, 444, 445, 446, 447, 448, 449, 439,
- 439, 450, 439, 439, 439, 439, 1, 104,
- 104, 104, 105, 451, 451, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 452,
- 104, 105, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 453, 453, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 454, 454, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 455, 455,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 456, 456, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 457, 457, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 105, 458, 458, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 459, 459, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 460, 104,
- 104, 104, 104, 104, 104, 1, 461, 1,
- 462, 461, 463, 1, 464, 465, 465, 465,
- 465, 466, 467, 468, 469, 470, 471, 472,
- 473, 474, 475, 466, 467, 468, 469, 470,
- 471, 472, 473, 474, 475, 465, 465, 476,
- 465, 465, 465, 465, 1, 104, 104, 104,
- 105, 477, 477, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 478, 478,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 479, 104, 105, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 480,
- 480, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 481, 481, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 482, 482, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 483, 483,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 484, 104, 104, 104, 104, 104,
- 104, 1, 485, 1, 486, 485, 487, 1,
- 488, 489, 489, 489, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 490,
- 491, 492, 493, 494, 495, 496, 497, 498,
- 499, 489, 489, 500, 489, 489, 489, 489,
- 1, 104, 104, 104, 105, 501, 501, 104,
- 104, 104, 104, 104, 104, 1, 104, 104,
- 104, 105, 502, 502, 104, 104, 104, 104,
- 104, 104, 1, 104, 104, 104, 105, 503,
- 503, 104, 104, 104, 104, 104, 104, 1,
- 104, 104, 104, 105, 504, 504, 104, 104,
- 104, 104, 104, 104, 1, 104, 104, 104,
- 105, 505, 505, 104, 104, 104, 104, 104,
- 104, 1, 104, 104, 104, 105, 506, 506,
- 104, 104, 104, 104, 104, 104, 1, 104,
- 104, 104, 105, 507, 507, 104, 104, 104,
- 104, 104, 104, 1, 104, 104, 104, 105,
- 508, 508, 104, 104, 104, 104, 104, 104,
- 1, 104, 104, 104, 509, 104, 104, 104,
- 104, 104, 104, 1, 510, 1, 511, 510,
- 512, 1, 513, 514, 514, 514, 514, 515,
- 516, 517, 518, 519, 520, 521, 522, 523,
- 524, 515, 516, 517, 518, 519, 520, 521,
- 522, 523, 524, 514, 514, 525, 514, 514,
- 514, 514, 1, 526, 1, 527, 1, 528,
- 529, 1, 530, 1, 531, 531, 531, 532,
- 531, 533, 534, 535, 536, 537, 538, 539,
- 540, 541, 542, 533, 534, 535, 536, 537,
- 538, 539, 540, 541, 542, 531, 531, 531,
- 531, 531, 1, 543, 543, 543, 544, 543,
- 543, 543, 543, 543, 543, 1, 545, 1,
- 546, 1, 1, 1, 545, 547, 1, 548,
- 548, 548, 549, 548, 550, 551, 552, 553,
- 554, 555, 556, 557, 558, 559, 550, 551,
- 552, 553, 554, 555, 556, 557, 558, 559,
- 548, 548, 548, 548, 548, 1, 543, 543,
- 543, 560, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 561, 543, 544,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 562, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 563, 543, 544,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 564, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 565, 543, 544,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 543, 543, 543, 566, 566, 543,
- 566, 1, 543, 567, 543, 543, 567, 544,
- 568, 543, 567, 567, 567, 543, 567, 1,
- 543, 569, 543, 543, 569, 544, 570, 543,
- 569, 569, 569, 543, 569, 1, 543, 571,
- 543, 543, 571, 544, 572, 543, 571, 571,
- 571, 543, 571, 1, 543, 574, 543, 543,
- 575, 544, 576, 543, 573, 574, 574, 574,
- 543, 574, 1, 577, 1, 49, 1, 543,
- 578, 543, 543, 579, 544, 580, 543, 573,
- 578, 578, 578, 543, 578, 1, 543, 581,
- 543, 543, 582, 544, 583, 543, 573, 581,
- 581, 581, 543, 581, 1, 543, 584, 543,
- 543, 585, 544, 586, 543, 573, 584, 584,
- 584, 543, 584, 1, 543, 587, 543, 543,
- 588, 544, 589, 543, 573, 587, 587, 587,
- 543, 587, 1, 543, 590, 543, 543, 591,
- 544, 592, 543, 573, 590, 590, 590, 543,
- 590, 1, 543, 593, 543, 543, 594, 544,
- 595, 543, 573, 593, 593, 593, 543, 593,
- 1, 543, 596, 543, 543, 597, 544, 598,
- 543, 573, 596, 596, 596, 543, 596, 1,
- 543, 599, 543, 543, 600, 544, 601, 543,
- 573, 599, 599, 599, 543, 599, 1, 543,
- 602, 543, 543, 603, 544, 604, 543, 573,
- 602, 602, 602, 543, 602, 1, 543, 605,
- 543, 543, 606, 544, 607, 543, 573, 605,
- 605, 605, 543, 605, 1, 543, 608, 543,
- 543, 609, 544, 610, 543, 573, 608, 608,
- 608, 543, 608, 1, 543, 611, 543, 543,
- 612, 544, 613, 543, 573, 611, 611, 611,
- 543, 611, 1, 543, 614, 543, 543, 615,
- 544, 616, 543, 573, 614, 614, 614, 543,
- 614, 1, 543, 617, 543, 543, 618, 544,
- 619, 543, 573, 617, 617, 617, 543, 617,
- 1, 543, 620, 543, 543, 621, 544, 622,
- 543, 573, 620, 620, 620, 543, 620, 1,
- 543, 623, 543, 543, 624, 544, 625, 543,
- 573, 623, 623, 623, 543, 623, 1, 543,
- 626, 543, 543, 627, 544, 628, 543, 573,
- 626, 626, 626, 543, 626, 1, 543, 629,
- 543, 543, 630, 544, 631, 543, 573, 629,
- 629, 629, 543, 629, 1, 543, 632, 543,
- 543, 633, 544, 634, 543, 573, 632, 632,
- 632, 543, 632, 1, 543, 635, 543, 543,
- 636, 544, 637, 543, 573, 635, 635, 635,
- 543, 635, 1, 543, 638, 543, 543, 639,
- 544, 640, 543, 573, 638, 638, 638, 543,
- 638, 1, 543, 641, 543, 543, 642, 544,
- 643, 543, 573, 641, 641, 641, 543, 641,
- 1, 543, 644, 543, 543, 645, 544, 646,
- 543, 573, 644, 644, 644, 543, 644, 1,
- 543, 647, 543, 543, 648, 544, 649, 543,
- 573, 647, 647, 647, 543, 647, 1, 543,
- 650, 543, 543, 651, 544, 652, 543, 573,
- 650, 650, 650, 543, 650, 1, 543, 653,
- 543, 543, 654, 544, 655, 543, 573, 653,
- 653, 653, 543, 653, 1, 543, 656, 543,
- 543, 657, 544, 658, 543, 573, 656, 656,
- 656, 543, 656, 1, 543, 543, 543, 543,
- 659, 544, 543, 573, 543, 543, 543, 543,
- 1, 577, 543, 543, 543, 544, 543, 543,
- 543, 543, 543, 543, 1, 577, 543, 543,
- 543, 543, 659, 544, 543, 573, 543, 543,
- 543, 543, 1, 573, 573, 1, 577, 543,
- 656, 543, 543, 657, 544, 658, 543, 573,
- 656, 656, 656, 543, 656, 1, 658, 660,
- 658, 573, 658, 658, 658, 658, 1, 577,
- 573, 573, 1, 577, 543, 653, 543, 543,
- 654, 544, 655, 543, 573, 653, 653, 653,
- 543, 653, 1, 655, 661, 655, 573, 655,
- 655, 655, 655, 1, 577, 658, 660, 658,
- 573, 658, 658, 658, 658, 1, 577, 543,
- 650, 543, 543, 651, 544, 652, 543, 573,
- 650, 650, 650, 543, 650, 1, 652, 662,
- 652, 573, 652, 652, 652, 652, 1, 577,
- 655, 661, 655, 573, 655, 655, 655, 655,
- 1, 577, 543, 647, 543, 543, 648, 544,
- 649, 543, 573, 647, 647, 647, 543, 647,
- 1, 649, 663, 649, 573, 649, 649, 649,
- 649, 1, 577, 652, 662, 652, 573, 652,
- 652, 652, 652, 1, 577, 543, 644, 543,
- 543, 645, 544, 646, 543, 573, 644, 644,
- 644, 543, 644, 1, 646, 664, 646, 573,
- 646, 646, 646, 646, 1, 577, 649, 663,
- 649, 573, 649, 649, 649, 649, 1, 577,
- 543, 641, 543, 543, 642, 544, 643, 543,
- 573, 641, 641, 641, 543, 641, 1, 643,
- 665, 643, 573, 643, 643, 643, 643, 1,
- 577, 646, 664, 646, 573, 646, 646, 646,
- 646, 1, 577, 543, 638, 543, 543, 639,
- 544, 640, 543, 573, 638, 638, 638, 543,
- 638, 1, 640, 666, 640, 573, 640, 640,
- 640, 640, 1, 577, 643, 665, 643, 573,
- 643, 643, 643, 643, 1, 577, 543, 635,
- 543, 543, 636, 544, 637, 543, 573, 635,
- 635, 635, 543, 635, 1, 637, 667, 637,
- 573, 637, 637, 637, 637, 1, 577, 640,
- 666, 640, 573, 640, 640, 640, 640, 1,
- 577, 543, 632, 543, 543, 633, 544, 634,
- 543, 573, 632, 632, 632, 543, 632, 1,
- 634, 668, 634, 573, 634, 634, 634, 634,
- 1, 577, 637, 667, 637, 573, 637, 637,
- 637, 637, 1, 577, 543, 629, 543, 543,
- 630, 544, 631, 543, 573, 629, 629, 629,
- 543, 629, 1, 631, 669, 631, 573, 631,
- 631, 631, 631, 1, 577, 634, 668, 634,
- 573, 634, 634, 634, 634, 1, 577, 543,
- 626, 543, 543, 627, 544, 628, 543, 573,
- 626, 626, 626, 543, 626, 1, 628, 670,
- 628, 573, 628, 628, 628, 628, 1, 577,
- 631, 669, 631, 573, 631, 631, 631, 631,
- 1, 577, 543, 623, 543, 543, 624, 544,
- 625, 543, 573, 623, 623, 623, 543, 623,
- 1, 625, 671, 625, 573, 625, 625, 625,
- 625, 1, 577, 628, 670, 628, 573, 628,
- 628, 628, 628, 1, 577, 543, 620, 543,
- 543, 621, 544, 622, 543, 573, 620, 620,
- 620, 543, 620, 1, 622, 672, 622, 573,
- 622, 622, 622, 622, 1, 577, 625, 671,
- 625, 573, 625, 625, 625, 625, 1, 577,
- 543, 617, 543, 543, 618, 544, 619, 543,
- 573, 617, 617, 617, 543, 617, 1, 619,
- 673, 619, 573, 619, 619, 619, 619, 1,
- 577, 622, 672, 622, 573, 622, 622, 622,
- 622, 1, 577, 543, 614, 543, 543, 615,
- 544, 616, 543, 573, 614, 614, 614, 543,
- 614, 1, 616, 674, 616, 573, 616, 616,
- 616, 616, 1, 577, 619, 673, 619, 573,
- 619, 619, 619, 619, 1, 577, 543, 611,
- 543, 543, 612, 544, 613, 543, 573, 611,
- 611, 611, 543, 611, 1, 613, 675, 613,
- 573, 613, 613, 613, 613, 1, 577, 616,
- 674, 616, 573, 616, 616, 616, 616, 1,
- 577, 543, 608, 543, 543, 609, 544, 610,
- 543, 573, 608, 608, 608, 543, 608, 1,
- 610, 676, 610, 573, 610, 610, 610, 610,
- 1, 577, 613, 675, 613, 573, 613, 613,
- 613, 613, 1, 577, 543, 605, 543, 543,
- 606, 544, 607, 543, 573, 605, 605, 605,
- 543, 605, 1, 607, 677, 607, 573, 607,
- 607, 607, 607, 1, 577, 610, 676, 610,
- 573, 610, 610, 610, 610, 1, 577, 543,
- 602, 543, 543, 603, 544, 604, 543, 573,
- 602, 602, 602, 543, 602, 1, 604, 678,
- 604, 573, 604, 604, 604, 604, 1, 577,
- 607, 677, 607, 573, 607, 607, 607, 607,
- 1, 577, 543, 599, 543, 543, 600, 544,
- 601, 543, 573, 599, 599, 599, 543, 599,
- 1, 601, 679, 601, 573, 601, 601, 601,
- 601, 1, 577, 604, 678, 604, 573, 604,
- 604, 604, 604, 1, 577, 543, 596, 543,
- 543, 597, 544, 598, 543, 573, 596, 596,
- 596, 543, 596, 1, 598, 680, 598, 573,
- 598, 598, 598, 598, 1, 577, 601, 679,
- 601, 573, 601, 601, 601, 601, 1, 577,
- 543, 593, 543, 543, 594, 544, 595, 543,
- 573, 593, 593, 593, 543, 593, 1, 595,
- 681, 595, 573, 595, 595, 595, 595, 1,
- 577, 598, 680, 598, 573, 598, 598, 598,
- 598, 1, 577, 543, 590, 543, 543, 591,
- 544, 592, 543, 573, 590, 590, 590, 543,
- 590, 1, 592, 682, 592, 573, 592, 592,
- 592, 592, 1, 577, 595, 681, 595, 573,
- 595, 595, 595, 595, 1, 577, 543, 587,
- 543, 543, 588, 544, 589, 543, 573, 587,
- 587, 587, 543, 587, 1, 589, 683, 589,
- 573, 589, 589, 589, 589, 1, 577, 592,
- 682, 592, 573, 592, 592, 592, 592, 1,
- 577, 543, 584, 543, 543, 585, 544, 586,
- 543, 573, 584, 584, 584, 543, 584, 1,
- 586, 684, 586, 573, 586, 586, 586, 586,
- 1, 577, 589, 683, 589, 573, 589, 589,
- 589, 589, 1, 577, 543, 581, 543, 543,
- 582, 544, 583, 543, 573, 581, 581, 581,
- 543, 581, 1, 583, 685, 583, 573, 583,
- 583, 583, 583, 1, 577, 586, 684, 586,
- 573, 586, 586, 586, 586, 1, 577, 543,
- 578, 543, 543, 579, 544, 580, 543, 573,
- 578, 578, 578, 543, 578, 1, 580, 686,
- 580, 573, 580, 580, 580, 580, 1, 577,
- 583, 685, 583, 573, 583, 583, 583, 583,
- 1, 576, 687, 576, 573, 576, 576, 576,
- 576, 1, 577, 580, 686, 580, 573, 580,
- 580, 580, 580, 1, 572, 572, 572, 572,
- 572, 572, 572, 1, 570, 570, 570, 570,
- 570, 570, 570, 1, 543, 543, 543, 544,
- 688, 688, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 689, 689, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 690, 690, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 691,
- 692, 691, 692, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 693, 693,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 694, 694, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 695, 695, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 696, 696, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 697, 697, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 698,
- 698, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 699, 699, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 700, 700, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 701, 701,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 702, 543, 544, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 703,
- 703, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 704, 704, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 705, 705, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 706, 706,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 707, 543, 543, 543, 543, 543,
- 543, 1, 708, 1, 709, 708, 710, 1,
- 711, 711, 711, 712, 711, 713, 714, 715,
- 716, 717, 718, 719, 720, 721, 722, 713,
- 714, 715, 716, 717, 718, 719, 720, 721,
- 722, 711, 711, 711, 711, 711, 1, 543,
- 543, 543, 544, 723, 723, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 724, 724, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 725, 725, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 726, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 727, 727,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 728, 728, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 729, 729, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 730, 730, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 731, 731, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 732, 543,
- 543, 543, 543, 543, 543, 1, 733, 1,
- 734, 733, 735, 1, 736, 736, 736, 737,
- 736, 738, 739, 740, 741, 742, 743, 744,
- 745, 746, 747, 738, 739, 740, 741, 742,
- 743, 744, 745, 746, 747, 736, 736, 736,
- 736, 736, 1, 543, 543, 543, 544, 748,
- 748, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 749, 749, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 750, 750, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 751, 751,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 752, 752, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 753, 753, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 754, 543, 544, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 755, 755, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 756, 756,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 757, 757, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 758, 758, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 759, 543, 543, 543,
- 543, 543, 543, 1, 760, 1, 761, 760,
- 762, 1, 763, 763, 763, 764, 763, 765,
- 766, 767, 768, 769, 770, 771, 772, 773,
- 774, 765, 766, 767, 768, 769, 770, 771,
- 772, 773, 774, 763, 763, 763, 763, 763,
- 1, 543, 543, 543, 544, 775, 775, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 776, 776, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 777,
- 777, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 778, 778, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 779, 779, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 780, 780,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 781, 543, 543, 543, 543, 543,
- 543, 1, 782, 1, 783, 782, 784, 1,
- 785, 785, 785, 786, 785, 787, 788, 789,
- 790, 791, 792, 793, 794, 795, 796, 787,
- 788, 789, 790, 791, 792, 793, 794, 795,
- 796, 785, 785, 785, 785, 785, 1, 543,
- 543, 543, 544, 797, 798, 797, 798, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 799, 799, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 800,
- 800, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 801, 801, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 802, 802, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 803, 803,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 804, 543, 544, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 805,
- 805, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 806, 806, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 807, 807, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 808, 808,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 809, 809, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 810, 810, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 811, 543, 543, 543,
- 543, 543, 543, 1, 812, 1, 813, 812,
- 814, 1, 815, 815, 815, 816, 815, 817,
- 818, 819, 820, 821, 822, 823, 824, 825,
- 826, 817, 818, 819, 820, 821, 822, 823,
- 824, 825, 826, 815, 815, 815, 815, 815,
- 1, 543, 543, 543, 544, 827, 828, 829,
- 827, 828, 829, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 830, 830,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 831, 543, 544, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 832,
- 832, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 833, 833, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 834, 834, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 835, 835,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 836, 836, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 837, 837, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 838, 838, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 839, 543, 543, 543, 543, 543, 543,
- 1, 840, 1, 841, 840, 842, 1, 843,
- 843, 843, 844, 843, 845, 846, 847, 848,
- 849, 850, 851, 852, 853, 854, 845, 846,
- 847, 848, 849, 850, 851, 852, 853, 854,
- 843, 843, 843, 843, 843, 1, 543, 543,
- 543, 544, 855, 856, 855, 856, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 857, 857, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 858, 858,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 859, 859, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 860, 860, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 861, 543, 543, 543,
- 543, 543, 543, 1, 862, 1, 863, 862,
- 864, 1, 865, 865, 865, 866, 865, 867,
- 868, 869, 870, 871, 872, 873, 874, 875,
- 876, 867, 868, 869, 870, 871, 872, 873,
- 874, 875, 876, 865, 865, 865, 865, 865,
- 1, 543, 543, 543, 544, 877, 877, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 878, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 879, 879,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 880, 880, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 881, 881, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 882, 882, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 883, 543, 543, 543, 543, 543, 543,
- 1, 884, 1, 885, 884, 886, 1, 887,
- 887, 887, 888, 887, 889, 890, 891, 892,
- 893, 894, 895, 896, 897, 898, 889, 890,
- 891, 892, 893, 894, 895, 896, 897, 898,
- 887, 887, 887, 887, 887, 1, 543, 543,
- 543, 544, 899, 899, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 900,
- 900, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 901, 543, 544, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 902, 902, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 903, 903, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 904, 904, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 905,
- 905, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 906, 543, 543, 543, 543,
- 543, 543, 1, 907, 1, 908, 907, 909,
- 1, 910, 910, 910, 911, 910, 912, 913,
- 914, 915, 916, 917, 918, 919, 920, 921,
- 912, 913, 914, 915, 916, 917, 918, 919,
- 920, 921, 910, 910, 910, 910, 910, 1,
- 543, 543, 543, 544, 922, 922, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 923, 923, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 924, 543, 544,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 925, 925, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 926,
- 926, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 927, 927, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 928, 928, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 929, 929,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 930, 930, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 931, 931, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 932, 932, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 933, 933, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 934,
- 934, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 935, 935, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 936, 936, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 937, 543, 543,
- 543, 543, 543, 543, 1, 938, 1, 939,
- 938, 940, 1, 941, 941, 941, 942, 941,
- 943, 944, 945, 946, 947, 948, 949, 950,
- 951, 952, 943, 944, 945, 946, 947, 948,
- 949, 950, 951, 952, 941, 941, 941, 941,
- 941, 1, 543, 543, 543, 544, 953, 953,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 954, 954, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 955, 955, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 956, 956, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 957, 957, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 958, 543,
- 544, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 959, 959, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 960, 960, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 961, 961, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 962, 962, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 963,
- 963, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 964, 964, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 965, 543, 543, 543, 543, 543, 543, 1,
- 966, 1, 967, 966, 968, 1, 969, 969,
- 969, 970, 969, 971, 972, 973, 974, 975,
- 976, 977, 978, 979, 980, 971, 972, 973,
- 974, 975, 976, 977, 978, 979, 980, 969,
- 969, 969, 969, 969, 1, 543, 543, 543,
- 544, 981, 981, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 982, 982,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 983, 983, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 984, 984, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 985, 985, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 986, 543, 544, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 987, 987,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 988, 988, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 989,
- 543, 543, 543, 543, 543, 543, 1, 990,
- 1, 991, 990, 992, 1, 993, 993, 993,
- 994, 993, 995, 996, 997, 998, 999, 1000,
- 1001, 1002, 1003, 1004, 995, 996, 997, 998,
- 999, 1000, 1001, 1002, 1003, 1004, 993, 993,
- 993, 993, 993, 1, 543, 543, 543, 544,
- 1005, 1005, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 1006, 543, 544, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 1007, 1007, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 544, 1008, 1008,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 1009, 1009, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 1010, 1010, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 1011, 1011, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 1012, 1012, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 1013,
- 1013, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 1014, 543, 543, 543, 543,
- 543, 543, 1, 1015, 1, 1016, 1015, 1017,
- 1, 1018, 1018, 1018, 1019, 1018, 1020, 1021,
- 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029,
- 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027,
- 1028, 1029, 1018, 1018, 1018, 1018, 1018, 1,
- 543, 543, 543, 544, 1030, 1030, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 1031, 1031, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 1032, 543, 544,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 1033, 1033, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 1034,
- 1034, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 1035, 1035, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 1036, 1036, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 1037, 543, 543,
- 543, 543, 543, 543, 1, 1038, 1, 1039,
- 1038, 1040, 1, 1041, 1041, 1041, 1042, 1041,
- 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050,
- 1051, 1052, 1043, 1044, 1045, 1046, 1047, 1048,
- 1049, 1050, 1051, 1052, 1041, 1041, 1041, 1041,
- 1041, 1, 543, 543, 543, 544, 1053, 1053,
- 543, 543, 543, 543, 543, 543, 1, 543,
- 543, 543, 544, 1054, 1054, 543, 543, 543,
- 543, 543, 543, 1, 543, 543, 543, 544,
- 1055, 1055, 543, 543, 543, 543, 543, 543,
- 1, 543, 543, 543, 544, 1056, 1056, 543,
- 543, 543, 543, 543, 543, 1, 543, 543,
- 543, 544, 1057, 1057, 543, 543, 543, 543,
- 543, 543, 1, 543, 543, 543, 544, 1058,
- 1058, 543, 543, 543, 543, 543, 543, 1,
- 543, 543, 543, 544, 1059, 1059, 543, 543,
- 543, 543, 543, 543, 1, 543, 543, 543,
- 544, 1060, 1060, 543, 543, 543, 543, 543,
- 543, 1, 543, 543, 543, 1061, 543, 543,
- 543, 543, 543, 543, 1, 1062, 1, 1063,
- 1062, 1064, 1, 1065, 1065, 1065, 1066, 1065,
- 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074,
- 1075, 1076, 1067, 1068, 1069, 1070, 1071, 1072,
- 1073, 1074, 1075, 1076, 1065, 1065, 1065, 1065,
- 1065, 1, 1078, 1, 1, 1, 1077, 1080,
- 1, 1, 1, 1079, 1081, 1082, 1, 10,
- 1083, 1083, 1083, 1083, 1083, 1083, 1083, 1,
- 10, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
- 1, 10, 1085, 1085, 1085, 1085, 1085, 1085,
- 1085, 1, 10, 1086, 1086, 1086, 1086, 1086,
- 1086, 1086, 1, 10, 1087, 1087, 1087, 1087,
- 1087, 1087, 1087, 1, 10, 1088, 1088, 1088,
- 1088, 1088, 1088, 1088, 1, 10, 1089, 1089,
- 1089, 1089, 1089, 1089, 1089, 1, 10, 1090,
- 1090, 1090, 1090, 1090, 1090, 1090, 1, 10,
- 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1,
- 10, 1092, 1092, 1092, 1092, 1092, 1092, 1092,
- 1, 10, 1093, 1093, 1093, 1093, 1093, 1093,
- 1093, 1, 10, 1094, 1094, 1094, 1094, 1094,
- 1094, 1094, 1, 10, 1095, 1095, 1095, 1095,
- 1095, 1095, 1095, 1, 10, 1096, 1096, 1096,
- 1096, 1096, 1096, 1096, 1, 10, 1097, 1097,
- 1097, 1097, 1097, 1097, 1097, 1, 10, 1098,
- 1098, 1098, 1098, 1098, 1098, 1098, 1, 10,
- 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1,
- 10, 1100, 1100, 1100, 1100, 1100, 1100, 1100,
- 1, 10, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1, 10, 1102, 1102, 1102, 1102, 1102,
- 1102, 1102, 1, 10, 1103, 1103, 1103, 1103,
- 1103, 1103, 1103, 1, 10, 1104, 1104, 1104,
- 1104, 1104, 1104, 1104, 1, 10, 1105, 1105,
- 1105, 1105, 1105, 1105, 1105, 1, 10, 1106,
- 1106, 1106, 1106, 1106, 1106, 1106, 1, 10,
- 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1,
- 10, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
- 1, 10, 1109, 1109, 1109, 1109, 1109, 1109,
- 1109, 1, 10, 1, 1110, 0
+ 0, 1, 2, 1, 3, 1, 4, 1,
+ 5, 1, 6, 6, 6, 1, 7, 7,
+ 7, 7, 7, 7, 7, 1, 8, 8,
+ 8, 8, 8, 8, 8, 1, 9, 9,
+ 9, 9, 9, 9, 9, 1, 10, 11,
+ 11, 11, 11, 11, 11, 11, 1, 12,
+ 13, 14, 1, 15, 1, 16, 17, 17,
+ 17, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 17, 17,
+ 17, 17, 17, 17, 17, 1, 28, 1,
+ 30, 29, 32, 31, 33, 32, 31, 32,
+ 31, 34, 31, 31, 1, 35, 1, 36,
+ 1, 37, 1, 38, 1, 39, 1, 40,
+ 1, 41, 41, 41, 1, 42, 42, 42,
+ 42, 42, 42, 42, 1, 43, 43, 43,
+ 43, 43, 43, 43, 1, 44, 44, 44,
+ 44, 44, 44, 44, 1, 46, 47, 46,
+ 45, 46, 46, 46, 46, 1, 48, 1,
+ 49, 1, 50, 51, 50, 45, 50, 50,
+ 50, 50, 1, 52, 53, 52, 45, 52,
+ 52, 52, 52, 1, 54, 55, 54, 45,
+ 54, 54, 54, 54, 1, 56, 57, 56,
+ 45, 56, 56, 56, 56, 1, 58, 59,
+ 58, 45, 58, 58, 58, 58, 1, 60,
+ 61, 60, 45, 60, 60, 60, 60, 1,
+ 62, 63, 62, 45, 62, 62, 62, 62,
+ 1, 64, 65, 64, 45, 64, 64, 64,
+ 64, 1, 66, 67, 66, 45, 66, 66,
+ 66, 66, 1, 68, 69, 68, 45, 68,
+ 68, 68, 68, 1, 70, 71, 70, 45,
+ 70, 70, 70, 70, 1, 72, 73, 72,
+ 45, 72, 72, 72, 72, 1, 74, 75,
+ 74, 45, 74, 74, 74, 74, 1, 76,
+ 77, 76, 45, 76, 76, 76, 76, 1,
+ 78, 79, 78, 45, 78, 78, 78, 78,
+ 1, 80, 81, 80, 45, 80, 80, 80,
+ 80, 1, 82, 83, 82, 45, 82, 82,
+ 82, 82, 1, 84, 85, 84, 45, 84,
+ 84, 84, 84, 1, 86, 87, 86, 45,
+ 86, 86, 86, 86, 1, 88, 89, 88,
+ 45, 88, 88, 88, 88, 1, 90, 91,
+ 90, 45, 90, 90, 90, 90, 1, 92,
+ 93, 92, 45, 92, 92, 92, 92, 1,
+ 94, 95, 94, 45, 94, 94, 94, 94,
+ 1, 96, 97, 96, 45, 96, 96, 96,
+ 96, 1, 98, 99, 98, 45, 98, 98,
+ 98, 98, 1, 100, 101, 100, 45, 100,
+ 100, 100, 100, 1, 102, 103, 102, 45,
+ 102, 102, 102, 102, 1, 45, 45, 1,
+ 48, 45, 45, 1, 48, 102, 103, 102,
+ 45, 102, 102, 102, 102, 1, 48, 100,
+ 101, 100, 45, 100, 100, 100, 100, 1,
+ 48, 98, 99, 98, 45, 98, 98, 98,
+ 98, 1, 48, 96, 97, 96, 45, 96,
+ 96, 96, 96, 1, 48, 94, 95, 94,
+ 45, 94, 94, 94, 94, 1, 48, 92,
+ 93, 92, 45, 92, 92, 92, 92, 1,
+ 48, 90, 91, 90, 45, 90, 90, 90,
+ 90, 1, 48, 88, 89, 88, 45, 88,
+ 88, 88, 88, 1, 48, 86, 87, 86,
+ 45, 86, 86, 86, 86, 1, 48, 84,
+ 85, 84, 45, 84, 84, 84, 84, 1,
+ 48, 82, 83, 82, 45, 82, 82, 82,
+ 82, 1, 48, 80, 81, 80, 45, 80,
+ 80, 80, 80, 1, 48, 78, 79, 78,
+ 45, 78, 78, 78, 78, 1, 48, 76,
+ 77, 76, 45, 76, 76, 76, 76, 1,
+ 48, 74, 75, 74, 45, 74, 74, 74,
+ 74, 1, 48, 72, 73, 72, 45, 72,
+ 72, 72, 72, 1, 48, 70, 71, 70,
+ 45, 70, 70, 70, 70, 1, 48, 68,
+ 69, 68, 45, 68, 68, 68, 68, 1,
+ 48, 66, 67, 66, 45, 66, 66, 66,
+ 66, 1, 48, 64, 65, 64, 45, 64,
+ 64, 64, 64, 1, 48, 62, 63, 62,
+ 45, 62, 62, 62, 62, 1, 48, 60,
+ 61, 60, 45, 60, 60, 60, 60, 1,
+ 48, 58, 59, 58, 45, 58, 58, 58,
+ 58, 1, 48, 56, 57, 56, 45, 56,
+ 56, 56, 56, 1, 48, 54, 55, 54,
+ 45, 54, 54, 54, 54, 1, 48, 52,
+ 53, 52, 45, 52, 52, 52, 52, 1,
+ 48, 50, 51, 50, 45, 50, 50, 50,
+ 50, 1, 104, 104, 104, 105, 104, 104,
+ 104, 104, 104, 104, 1, 106, 1, 107,
+ 1, 1, 1, 106, 108, 1, 109, 110,
+ 110, 110, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 110,
+ 110, 121, 110, 110, 110, 110, 1, 104,
+ 104, 104, 105, 122, 122, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 123, 123, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 124, 124, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 125, 126, 125, 126, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 127, 127, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 128, 128,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 129, 129, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 130, 130, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 131, 131, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 132, 132, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 133,
+ 133, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 134, 134, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 135, 135, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 136, 104, 105,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 137, 137, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 138,
+ 138, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 139, 139, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 140, 140, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 141, 104, 104,
+ 104, 104, 104, 104, 1, 142, 1, 143,
+ 142, 144, 1, 145, 146, 146, 146, 146,
+ 147, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 147, 148, 149, 150, 151, 152,
+ 153, 154, 155, 156, 146, 146, 157, 146,
+ 146, 146, 146, 1, 104, 104, 104, 105,
+ 158, 158, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 159, 159, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 160, 160, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 161, 104,
+ 105, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 162, 162, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 163, 163, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 164, 164, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 165, 165, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 166,
+ 166, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 167, 104, 104, 104, 104,
+ 104, 104, 1, 168, 1, 169, 168, 170,
+ 1, 171, 172, 172, 172, 172, 173, 174,
+ 175, 176, 177, 178, 179, 180, 181, 182,
+ 173, 174, 175, 176, 177, 178, 179, 180,
+ 181, 182, 172, 172, 183, 172, 172, 172,
+ 172, 1, 104, 104, 104, 105, 184, 184,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 185, 185, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 186, 186, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 187, 187, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 188, 188, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 189,
+ 189, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 190, 104, 105, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 191, 191, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 192, 192, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 193, 193, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 194,
+ 194, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 195, 104, 104, 104, 104,
+ 104, 104, 1, 196, 1, 197, 196, 198,
+ 1, 199, 200, 200, 200, 200, 201, 202,
+ 203, 204, 205, 206, 207, 208, 209, 210,
+ 201, 202, 203, 204, 205, 206, 207, 208,
+ 209, 210, 200, 200, 211, 200, 200, 200,
+ 200, 1, 104, 104, 104, 105, 212, 212,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 213, 213, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 214, 214, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 215, 215, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 216, 216, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 217,
+ 217, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 218, 104, 104, 104, 104,
+ 104, 104, 1, 219, 1, 220, 219, 221,
+ 1, 222, 223, 223, 223, 223, 224, 225,
+ 226, 227, 228, 229, 230, 231, 232, 233,
+ 224, 225, 226, 227, 228, 229, 230, 231,
+ 232, 233, 223, 223, 234, 223, 223, 223,
+ 223, 1, 104, 104, 104, 105, 235, 236,
+ 235, 236, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 237, 237, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 238, 238, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 239,
+ 239, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 240, 240, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 241, 241, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 242, 104, 105,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 243, 243, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 244,
+ 244, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 245, 245, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 246, 246, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 247, 247,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 248, 248, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 249,
+ 104, 104, 104, 104, 104, 104, 1, 250,
+ 1, 251, 250, 252, 1, 253, 254, 254,
+ 254, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 263, 264, 255, 256, 257, 258,
+ 259, 260, 261, 262, 263, 264, 254, 254,
+ 265, 254, 254, 254, 254, 1, 104, 104,
+ 104, 105, 266, 267, 268, 266, 267, 268,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 269, 269, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 270,
+ 104, 105, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 271, 271, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 272, 272, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 273, 273,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 274, 274, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 275, 275, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 276, 276, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 277, 277, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 278, 104,
+ 104, 104, 104, 104, 104, 1, 279, 1,
+ 280, 279, 281, 1, 282, 283, 283, 283,
+ 283, 284, 285, 286, 287, 288, 289, 290,
+ 291, 292, 293, 284, 285, 286, 287, 288,
+ 289, 290, 291, 292, 293, 283, 283, 294,
+ 283, 283, 283, 283, 1, 104, 104, 104,
+ 105, 295, 296, 295, 296, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 297, 297, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 298, 298, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 299, 299, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 300,
+ 300, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 301, 104, 104, 104, 104,
+ 104, 104, 1, 302, 1, 303, 302, 304,
+ 1, 305, 306, 306, 306, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316,
+ 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 306, 306, 317, 306, 306, 306,
+ 306, 1, 104, 104, 104, 105, 318, 318,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 319, 104, 105, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 320,
+ 320, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 321, 321, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 322, 322, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 323, 323,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 324, 104, 104, 104, 104, 104,
+ 104, 1, 325, 1, 326, 325, 327, 1,
+ 328, 329, 329, 329, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 330,
+ 331, 332, 333, 334, 335, 336, 337, 338,
+ 339, 329, 329, 340, 329, 329, 329, 329,
+ 1, 104, 104, 104, 105, 341, 341, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 342, 342, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 343, 104,
+ 105, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 344, 344, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 345, 345, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 346, 346, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 347, 347, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 348, 104,
+ 104, 104, 104, 104, 104, 1, 349, 1,
+ 350, 349, 351, 1, 352, 353, 353, 353,
+ 353, 354, 355, 356, 357, 358, 359, 360,
+ 361, 362, 363, 354, 355, 356, 357, 358,
+ 359, 360, 361, 362, 363, 353, 353, 364,
+ 353, 353, 353, 353, 1, 104, 104, 104,
+ 105, 365, 365, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 366, 366,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 367, 104, 105, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 368,
+ 368, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 369, 369, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 370, 370, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 371, 371,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 372, 372, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 373, 373, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 374, 374, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 375, 375, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 376,
+ 376, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 377, 377, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 378, 378, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 379, 379,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 380, 104, 104, 104, 104, 104,
+ 104, 1, 381, 1, 382, 381, 383, 1,
+ 384, 385, 385, 385, 385, 386, 387, 388,
+ 389, 390, 391, 392, 393, 394, 395, 386,
+ 387, 388, 389, 390, 391, 392, 393, 394,
+ 395, 385, 385, 396, 385, 385, 385, 385,
+ 1, 104, 104, 104, 105, 397, 397, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 398, 398, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 399,
+ 399, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 400, 400, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 401, 401, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 402, 104, 105,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 403, 403, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 404,
+ 404, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 405, 405, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 406, 406, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 407, 407,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 408, 408, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 409,
+ 104, 104, 104, 104, 104, 104, 1, 410,
+ 1, 411, 410, 412, 1, 413, 414, 414,
+ 414, 414, 415, 416, 417, 418, 419, 420,
+ 421, 422, 423, 424, 415, 416, 417, 418,
+ 419, 420, 421, 422, 423, 424, 414, 414,
+ 425, 414, 414, 414, 414, 1, 104, 104,
+ 104, 105, 426, 426, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 427,
+ 427, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 428, 428, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 429, 429, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 430, 430,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 431, 104, 105, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 432,
+ 432, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 433, 433, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 434, 104, 104, 104, 104, 104, 104, 1,
+ 435, 1, 436, 435, 437, 1, 438, 439,
+ 439, 439, 439, 440, 441, 442, 443, 444,
+ 445, 446, 447, 448, 449, 440, 441, 442,
+ 443, 444, 445, 446, 447, 448, 449, 439,
+ 439, 450, 439, 439, 439, 439, 1, 104,
+ 104, 104, 105, 451, 451, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 452,
+ 104, 105, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 453, 453, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 454, 454, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 455, 455,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 456, 456, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 457, 457, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 105, 458, 458, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 459, 459, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 460, 104,
+ 104, 104, 104, 104, 104, 1, 461, 1,
+ 462, 461, 463, 1, 464, 465, 465, 465,
+ 465, 466, 467, 468, 469, 470, 471, 472,
+ 473, 474, 475, 466, 467, 468, 469, 470,
+ 471, 472, 473, 474, 475, 465, 465, 476,
+ 465, 465, 465, 465, 1, 104, 104, 104,
+ 105, 477, 477, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 478, 478,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 479, 104, 105, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 480,
+ 480, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 481, 481, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 482, 482, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 483, 483,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 484, 104, 104, 104, 104, 104,
+ 104, 1, 485, 1, 486, 485, 487, 1,
+ 488, 489, 489, 489, 489, 490, 491, 492,
+ 493, 494, 495, 496, 497, 498, 499, 490,
+ 491, 492, 493, 494, 495, 496, 497, 498,
+ 499, 489, 489, 500, 489, 489, 489, 489,
+ 1, 104, 104, 104, 105, 501, 501, 104,
+ 104, 104, 104, 104, 104, 1, 104, 104,
+ 104, 105, 502, 502, 104, 104, 104, 104,
+ 104, 104, 1, 104, 104, 104, 105, 503,
+ 503, 104, 104, 104, 104, 104, 104, 1,
+ 104, 104, 104, 105, 504, 504, 104, 104,
+ 104, 104, 104, 104, 1, 104, 104, 104,
+ 105, 505, 505, 104, 104, 104, 104, 104,
+ 104, 1, 104, 104, 104, 105, 506, 506,
+ 104, 104, 104, 104, 104, 104, 1, 104,
+ 104, 104, 105, 507, 507, 104, 104, 104,
+ 104, 104, 104, 1, 104, 104, 104, 105,
+ 508, 508, 104, 104, 104, 104, 104, 104,
+ 1, 104, 104, 104, 509, 104, 104, 104,
+ 104, 104, 104, 1, 510, 1, 511, 510,
+ 512, 1, 513, 514, 514, 514, 514, 515,
+ 516, 517, 518, 519, 520, 521, 522, 523,
+ 524, 515, 516, 517, 518, 519, 520, 521,
+ 522, 523, 524, 514, 514, 525, 514, 514,
+ 514, 514, 1, 526, 1, 527, 1, 528,
+ 529, 1, 530, 1, 531, 531, 531, 532,
+ 531, 533, 534, 535, 536, 537, 538, 539,
+ 540, 541, 542, 533, 534, 535, 536, 537,
+ 538, 539, 540, 541, 542, 531, 531, 531,
+ 531, 531, 1, 543, 543, 543, 544, 543,
+ 543, 543, 543, 543, 543, 1, 545, 1,
+ 546, 1, 1, 1, 545, 547, 1, 548,
+ 548, 548, 549, 548, 550, 551, 552, 553,
+ 554, 555, 556, 557, 558, 559, 550, 551,
+ 552, 553, 554, 555, 556, 557, 558, 559,
+ 548, 548, 548, 548, 548, 1, 543, 543,
+ 543, 560, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 561, 543, 544,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 562, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 563, 543, 544,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 564, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 565, 543, 544,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 543, 543, 543, 566, 566, 543,
+ 566, 1, 543, 567, 543, 543, 567, 544,
+ 568, 543, 567, 567, 567, 543, 567, 1,
+ 543, 569, 543, 543, 569, 544, 570, 543,
+ 569, 569, 569, 543, 569, 1, 543, 571,
+ 543, 543, 571, 544, 572, 543, 571, 571,
+ 571, 543, 571, 1, 543, 574, 543, 543,
+ 575, 544, 576, 543, 573, 574, 574, 574,
+ 543, 574, 1, 577, 1, 49, 1, 543,
+ 578, 543, 543, 579, 544, 580, 543, 573,
+ 578, 578, 578, 543, 578, 1, 543, 581,
+ 543, 543, 582, 544, 583, 543, 573, 581,
+ 581, 581, 543, 581, 1, 543, 584, 543,
+ 543, 585, 544, 586, 543, 573, 584, 584,
+ 584, 543, 584, 1, 543, 587, 543, 543,
+ 588, 544, 589, 543, 573, 587, 587, 587,
+ 543, 587, 1, 543, 590, 543, 543, 591,
+ 544, 592, 543, 573, 590, 590, 590, 543,
+ 590, 1, 543, 593, 543, 543, 594, 544,
+ 595, 543, 573, 593, 593, 593, 543, 593,
+ 1, 543, 596, 543, 543, 597, 544, 598,
+ 543, 573, 596, 596, 596, 543, 596, 1,
+ 543, 599, 543, 543, 600, 544, 601, 543,
+ 573, 599, 599, 599, 543, 599, 1, 543,
+ 602, 543, 543, 603, 544, 604, 543, 573,
+ 602, 602, 602, 543, 602, 1, 543, 605,
+ 543, 543, 606, 544, 607, 543, 573, 605,
+ 605, 605, 543, 605, 1, 543, 608, 543,
+ 543, 609, 544, 610, 543, 573, 608, 608,
+ 608, 543, 608, 1, 543, 611, 543, 543,
+ 612, 544, 613, 543, 573, 611, 611, 611,
+ 543, 611, 1, 543, 614, 543, 543, 615,
+ 544, 616, 543, 573, 614, 614, 614, 543,
+ 614, 1, 543, 617, 543, 543, 618, 544,
+ 619, 543, 573, 617, 617, 617, 543, 617,
+ 1, 543, 620, 543, 543, 621, 544, 622,
+ 543, 573, 620, 620, 620, 543, 620, 1,
+ 543, 623, 543, 543, 624, 544, 625, 543,
+ 573, 623, 623, 623, 543, 623, 1, 543,
+ 626, 543, 543, 627, 544, 628, 543, 573,
+ 626, 626, 626, 543, 626, 1, 543, 629,
+ 543, 543, 630, 544, 631, 543, 573, 629,
+ 629, 629, 543, 629, 1, 543, 632, 543,
+ 543, 633, 544, 634, 543, 573, 632, 632,
+ 632, 543, 632, 1, 543, 635, 543, 543,
+ 636, 544, 637, 543, 573, 635, 635, 635,
+ 543, 635, 1, 543, 638, 543, 543, 639,
+ 544, 640, 543, 573, 638, 638, 638, 543,
+ 638, 1, 543, 641, 543, 543, 642, 544,
+ 643, 543, 573, 641, 641, 641, 543, 641,
+ 1, 543, 644, 543, 543, 645, 544, 646,
+ 543, 573, 644, 644, 644, 543, 644, 1,
+ 543, 647, 543, 543, 648, 544, 649, 543,
+ 573, 647, 647, 647, 543, 647, 1, 543,
+ 650, 543, 543, 651, 544, 652, 543, 573,
+ 650, 650, 650, 543, 650, 1, 543, 653,
+ 543, 543, 654, 544, 655, 543, 573, 653,
+ 653, 653, 543, 653, 1, 543, 656, 543,
+ 543, 657, 544, 658, 543, 573, 656, 656,
+ 656, 543, 656, 1, 543, 543, 543, 543,
+ 659, 544, 543, 573, 543, 543, 543, 543,
+ 1, 577, 543, 543, 543, 544, 543, 543,
+ 543, 543, 543, 543, 1, 577, 543, 543,
+ 543, 543, 659, 544, 543, 573, 543, 543,
+ 543, 543, 1, 573, 573, 1, 577, 543,
+ 656, 543, 543, 657, 544, 658, 543, 573,
+ 656, 656, 656, 543, 656, 1, 658, 660,
+ 658, 573, 658, 658, 658, 658, 1, 577,
+ 573, 573, 1, 577, 543, 653, 543, 543,
+ 654, 544, 655, 543, 573, 653, 653, 653,
+ 543, 653, 1, 655, 661, 655, 573, 655,
+ 655, 655, 655, 1, 577, 658, 660, 658,
+ 573, 658, 658, 658, 658, 1, 577, 543,
+ 650, 543, 543, 651, 544, 652, 543, 573,
+ 650, 650, 650, 543, 650, 1, 652, 662,
+ 652, 573, 652, 652, 652, 652, 1, 577,
+ 655, 661, 655, 573, 655, 655, 655, 655,
+ 1, 577, 543, 647, 543, 543, 648, 544,
+ 649, 543, 573, 647, 647, 647, 543, 647,
+ 1, 649, 663, 649, 573, 649, 649, 649,
+ 649, 1, 577, 652, 662, 652, 573, 652,
+ 652, 652, 652, 1, 577, 543, 644, 543,
+ 543, 645, 544, 646, 543, 573, 644, 644,
+ 644, 543, 644, 1, 646, 664, 646, 573,
+ 646, 646, 646, 646, 1, 577, 649, 663,
+ 649, 573, 649, 649, 649, 649, 1, 577,
+ 543, 641, 543, 543, 642, 544, 643, 543,
+ 573, 641, 641, 641, 543, 641, 1, 643,
+ 665, 643, 573, 643, 643, 643, 643, 1,
+ 577, 646, 664, 646, 573, 646, 646, 646,
+ 646, 1, 577, 543, 638, 543, 543, 639,
+ 544, 640, 543, 573, 638, 638, 638, 543,
+ 638, 1, 640, 666, 640, 573, 640, 640,
+ 640, 640, 1, 577, 643, 665, 643, 573,
+ 643, 643, 643, 643, 1, 577, 543, 635,
+ 543, 543, 636, 544, 637, 543, 573, 635,
+ 635, 635, 543, 635, 1, 637, 667, 637,
+ 573, 637, 637, 637, 637, 1, 577, 640,
+ 666, 640, 573, 640, 640, 640, 640, 1,
+ 577, 543, 632, 543, 543, 633, 544, 634,
+ 543, 573, 632, 632, 632, 543, 632, 1,
+ 634, 668, 634, 573, 634, 634, 634, 634,
+ 1, 577, 637, 667, 637, 573, 637, 637,
+ 637, 637, 1, 577, 543, 629, 543, 543,
+ 630, 544, 631, 543, 573, 629, 629, 629,
+ 543, 629, 1, 631, 669, 631, 573, 631,
+ 631, 631, 631, 1, 577, 634, 668, 634,
+ 573, 634, 634, 634, 634, 1, 577, 543,
+ 626, 543, 543, 627, 544, 628, 543, 573,
+ 626, 626, 626, 543, 626, 1, 628, 670,
+ 628, 573, 628, 628, 628, 628, 1, 577,
+ 631, 669, 631, 573, 631, 631, 631, 631,
+ 1, 577, 543, 623, 543, 543, 624, 544,
+ 625, 543, 573, 623, 623, 623, 543, 623,
+ 1, 625, 671, 625, 573, 625, 625, 625,
+ 625, 1, 577, 628, 670, 628, 573, 628,
+ 628, 628, 628, 1, 577, 543, 620, 543,
+ 543, 621, 544, 622, 543, 573, 620, 620,
+ 620, 543, 620, 1, 622, 672, 622, 573,
+ 622, 622, 622, 622, 1, 577, 625, 671,
+ 625, 573, 625, 625, 625, 625, 1, 577,
+ 543, 617, 543, 543, 618, 544, 619, 543,
+ 573, 617, 617, 617, 543, 617, 1, 619,
+ 673, 619, 573, 619, 619, 619, 619, 1,
+ 577, 622, 672, 622, 573, 622, 622, 622,
+ 622, 1, 577, 543, 614, 543, 543, 615,
+ 544, 616, 543, 573, 614, 614, 614, 543,
+ 614, 1, 616, 674, 616, 573, 616, 616,
+ 616, 616, 1, 577, 619, 673, 619, 573,
+ 619, 619, 619, 619, 1, 577, 543, 611,
+ 543, 543, 612, 544, 613, 543, 573, 611,
+ 611, 611, 543, 611, 1, 613, 675, 613,
+ 573, 613, 613, 613, 613, 1, 577, 616,
+ 674, 616, 573, 616, 616, 616, 616, 1,
+ 577, 543, 608, 543, 543, 609, 544, 610,
+ 543, 573, 608, 608, 608, 543, 608, 1,
+ 610, 676, 610, 573, 610, 610, 610, 610,
+ 1, 577, 613, 675, 613, 573, 613, 613,
+ 613, 613, 1, 577, 543, 605, 543, 543,
+ 606, 544, 607, 543, 573, 605, 605, 605,
+ 543, 605, 1, 607, 677, 607, 573, 607,
+ 607, 607, 607, 1, 577, 610, 676, 610,
+ 573, 610, 610, 610, 610, 1, 577, 543,
+ 602, 543, 543, 603, 544, 604, 543, 573,
+ 602, 602, 602, 543, 602, 1, 604, 678,
+ 604, 573, 604, 604, 604, 604, 1, 577,
+ 607, 677, 607, 573, 607, 607, 607, 607,
+ 1, 577, 543, 599, 543, 543, 600, 544,
+ 601, 543, 573, 599, 599, 599, 543, 599,
+ 1, 601, 679, 601, 573, 601, 601, 601,
+ 601, 1, 577, 604, 678, 604, 573, 604,
+ 604, 604, 604, 1, 577, 543, 596, 543,
+ 543, 597, 544, 598, 543, 573, 596, 596,
+ 596, 543, 596, 1, 598, 680, 598, 573,
+ 598, 598, 598, 598, 1, 577, 601, 679,
+ 601, 573, 601, 601, 601, 601, 1, 577,
+ 543, 593, 543, 543, 594, 544, 595, 543,
+ 573, 593, 593, 593, 543, 593, 1, 595,
+ 681, 595, 573, 595, 595, 595, 595, 1,
+ 577, 598, 680, 598, 573, 598, 598, 598,
+ 598, 1, 577, 543, 590, 543, 543, 591,
+ 544, 592, 543, 573, 590, 590, 590, 543,
+ 590, 1, 592, 682, 592, 573, 592, 592,
+ 592, 592, 1, 577, 595, 681, 595, 573,
+ 595, 595, 595, 595, 1, 577, 543, 587,
+ 543, 543, 588, 544, 589, 543, 573, 587,
+ 587, 587, 543, 587, 1, 589, 683, 589,
+ 573, 589, 589, 589, 589, 1, 577, 592,
+ 682, 592, 573, 592, 592, 592, 592, 1,
+ 577, 543, 584, 543, 543, 585, 544, 586,
+ 543, 573, 584, 584, 584, 543, 584, 1,
+ 586, 684, 586, 573, 586, 586, 586, 586,
+ 1, 577, 589, 683, 589, 573, 589, 589,
+ 589, 589, 1, 577, 543, 581, 543, 543,
+ 582, 544, 583, 543, 573, 581, 581, 581,
+ 543, 581, 1, 583, 685, 583, 573, 583,
+ 583, 583, 583, 1, 577, 586, 684, 586,
+ 573, 586, 586, 586, 586, 1, 577, 543,
+ 578, 543, 543, 579, 544, 580, 543, 573,
+ 578, 578, 578, 543, 578, 1, 580, 686,
+ 580, 573, 580, 580, 580, 580, 1, 577,
+ 583, 685, 583, 573, 583, 583, 583, 583,
+ 1, 576, 687, 576, 573, 576, 576, 576,
+ 576, 1, 577, 580, 686, 580, 573, 580,
+ 580, 580, 580, 1, 572, 572, 572, 572,
+ 572, 572, 572, 1, 570, 570, 570, 570,
+ 570, 570, 570, 1, 543, 543, 543, 544,
+ 688, 688, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 689, 689, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 690, 690, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 691,
+ 692, 691, 692, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 693, 693,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 694, 694, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 695, 695, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 696, 696, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 697, 697, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 698,
+ 698, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 699, 699, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 700, 700, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 701, 701,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 702, 543, 544, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 703,
+ 703, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 704, 704, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 705, 705, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 706, 706,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 707, 543, 543, 543, 543, 543,
+ 543, 1, 708, 1, 709, 708, 710, 1,
+ 711, 711, 711, 712, 711, 713, 714, 715,
+ 716, 717, 718, 719, 720, 721, 722, 713,
+ 714, 715, 716, 717, 718, 719, 720, 721,
+ 722, 711, 711, 711, 711, 711, 1, 543,
+ 543, 543, 544, 723, 723, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 724, 724, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 725, 725, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 726, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 727, 727,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 728, 728, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 729, 729, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 730, 730, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 731, 731, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 732, 543,
+ 543, 543, 543, 543, 543, 1, 733, 1,
+ 734, 733, 735, 1, 736, 736, 736, 737,
+ 736, 738, 739, 740, 741, 742, 743, 744,
+ 745, 746, 747, 738, 739, 740, 741, 742,
+ 743, 744, 745, 746, 747, 736, 736, 736,
+ 736, 736, 1, 543, 543, 543, 544, 748,
+ 748, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 749, 749, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 750, 750, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 751, 751,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 752, 752, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 753, 753, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 754, 543, 544, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 755, 755, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 756, 756,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 757, 757, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 758, 758, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 759, 543, 543, 543,
+ 543, 543, 543, 1, 760, 1, 761, 760,
+ 762, 1, 763, 763, 763, 764, 763, 765,
+ 766, 767, 768, 769, 770, 771, 772, 773,
+ 774, 765, 766, 767, 768, 769, 770, 771,
+ 772, 773, 774, 763, 763, 763, 763, 763,
+ 1, 543, 543, 543, 544, 775, 775, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 776, 776, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 777,
+ 777, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 778, 778, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 779, 779, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 780, 780,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 781, 543, 543, 543, 543, 543,
+ 543, 1, 782, 1, 783, 782, 784, 1,
+ 785, 785, 785, 786, 785, 787, 788, 789,
+ 790, 791, 792, 793, 794, 795, 796, 787,
+ 788, 789, 790, 791, 792, 793, 794, 795,
+ 796, 785, 785, 785, 785, 785, 1, 543,
+ 543, 543, 544, 797, 798, 797, 798, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 799, 799, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 800,
+ 800, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 801, 801, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 802, 802, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 803, 803,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 804, 543, 544, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 805,
+ 805, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 806, 806, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 807, 807, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 808, 808,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 809, 809, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 810, 810, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 811, 543, 543, 543,
+ 543, 543, 543, 1, 812, 1, 813, 812,
+ 814, 1, 815, 815, 815, 816, 815, 817,
+ 818, 819, 820, 821, 822, 823, 824, 825,
+ 826, 817, 818, 819, 820, 821, 822, 823,
+ 824, 825, 826, 815, 815, 815, 815, 815,
+ 1, 543, 543, 543, 544, 827, 828, 829,
+ 827, 828, 829, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 830, 830,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 831, 543, 544, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 832,
+ 832, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 833, 833, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 834, 834, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 835, 835,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 836, 836, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 837, 837, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 838, 838, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 839, 543, 543, 543, 543, 543, 543,
+ 1, 840, 1, 841, 840, 842, 1, 843,
+ 843, 843, 844, 843, 845, 846, 847, 848,
+ 849, 850, 851, 852, 853, 854, 845, 846,
+ 847, 848, 849, 850, 851, 852, 853, 854,
+ 843, 843, 843, 843, 843, 1, 543, 543,
+ 543, 544, 855, 856, 855, 856, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 857, 857, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 858, 858,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 859, 859, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 860, 860, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 861, 543, 543, 543,
+ 543, 543, 543, 1, 862, 1, 863, 862,
+ 864, 1, 865, 865, 865, 866, 865, 867,
+ 868, 869, 870, 871, 872, 873, 874, 875,
+ 876, 867, 868, 869, 870, 871, 872, 873,
+ 874, 875, 876, 865, 865, 865, 865, 865,
+ 1, 543, 543, 543, 544, 877, 877, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 878, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 879, 879,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 880, 880, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 881, 881, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 882, 882, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 883, 543, 543, 543, 543, 543, 543,
+ 1, 884, 1, 885, 884, 886, 1, 887,
+ 887, 887, 888, 887, 889, 890, 891, 892,
+ 893, 894, 895, 896, 897, 898, 889, 890,
+ 891, 892, 893, 894, 895, 896, 897, 898,
+ 887, 887, 887, 887, 887, 1, 543, 543,
+ 543, 544, 899, 899, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 900,
+ 900, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 901, 543, 544, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 902, 902, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 903, 903, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 904, 904, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 905,
+ 905, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 906, 543, 543, 543, 543,
+ 543, 543, 1, 907, 1, 908, 907, 909,
+ 1, 910, 910, 910, 911, 910, 912, 913,
+ 914, 915, 916, 917, 918, 919, 920, 921,
+ 912, 913, 914, 915, 916, 917, 918, 919,
+ 920, 921, 910, 910, 910, 910, 910, 1,
+ 543, 543, 543, 544, 922, 922, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 923, 923, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 924, 543, 544,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 925, 925, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 926,
+ 926, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 927, 927, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 928, 928, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 929, 929,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 930, 930, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 931, 931, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 932, 932, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 933, 933, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 934,
+ 934, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 935, 935, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 936, 936, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 937, 543, 543,
+ 543, 543, 543, 543, 1, 938, 1, 939,
+ 938, 940, 1, 941, 941, 941, 942, 941,
+ 943, 944, 945, 946, 947, 948, 949, 950,
+ 951, 952, 943, 944, 945, 946, 947, 948,
+ 949, 950, 951, 952, 941, 941, 941, 941,
+ 941, 1, 543, 543, 543, 544, 953, 953,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 954, 954, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 955, 955, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 956, 956, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 957, 957, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 958, 543,
+ 544, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 959, 959, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 960, 960, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 961, 961, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 962, 962, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 963,
+ 963, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 964, 964, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 965, 543, 543, 543, 543, 543, 543, 1,
+ 966, 1, 967, 966, 968, 1, 969, 969,
+ 969, 970, 969, 971, 972, 973, 974, 975,
+ 976, 977, 978, 979, 980, 971, 972, 973,
+ 974, 975, 976, 977, 978, 979, 980, 969,
+ 969, 969, 969, 969, 1, 543, 543, 543,
+ 544, 981, 981, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 982, 982,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 983, 983, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 984, 984, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 985, 985, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 986, 543, 544, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 987, 987,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 988, 988, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 989,
+ 543, 543, 543, 543, 543, 543, 1, 990,
+ 1, 991, 990, 992, 1, 993, 993, 993,
+ 994, 993, 995, 996, 997, 998, 999, 1000,
+ 1001, 1002, 1003, 1004, 995, 996, 997, 998,
+ 999, 1000, 1001, 1002, 1003, 1004, 993, 993,
+ 993, 993, 993, 1, 543, 543, 543, 544,
+ 1005, 1005, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 1006, 543, 544, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 1007, 1007, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 544, 1008, 1008,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 1009, 1009, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 1010, 1010, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 1011, 1011, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 1012, 1012, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 1013,
+ 1013, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 1014, 543, 543, 543, 543,
+ 543, 543, 1, 1015, 1, 1016, 1015, 1017,
+ 1, 1018, 1018, 1018, 1019, 1018, 1020, 1021,
+ 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029,
+ 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027,
+ 1028, 1029, 1018, 1018, 1018, 1018, 1018, 1,
+ 543, 543, 543, 544, 1030, 1030, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 1031, 1031, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 1032, 543, 544,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 1033, 1033, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 1034,
+ 1034, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 1035, 1035, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 1036, 1036, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 1037, 543, 543,
+ 543, 543, 543, 543, 1, 1038, 1, 1039,
+ 1038, 1040, 1, 1041, 1041, 1041, 1042, 1041,
+ 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050,
+ 1051, 1052, 1043, 1044, 1045, 1046, 1047, 1048,
+ 1049, 1050, 1051, 1052, 1041, 1041, 1041, 1041,
+ 1041, 1, 543, 543, 543, 544, 1053, 1053,
+ 543, 543, 543, 543, 543, 543, 1, 543,
+ 543, 543, 544, 1054, 1054, 543, 543, 543,
+ 543, 543, 543, 1, 543, 543, 543, 544,
+ 1055, 1055, 543, 543, 543, 543, 543, 543,
+ 1, 543, 543, 543, 544, 1056, 1056, 543,
+ 543, 543, 543, 543, 543, 1, 543, 543,
+ 543, 544, 1057, 1057, 543, 543, 543, 543,
+ 543, 543, 1, 543, 543, 543, 544, 1058,
+ 1058, 543, 543, 543, 543, 543, 543, 1,
+ 543, 543, 543, 544, 1059, 1059, 543, 543,
+ 543, 543, 543, 543, 1, 543, 543, 543,
+ 544, 1060, 1060, 543, 543, 543, 543, 543,
+ 543, 1, 543, 543, 543, 1061, 543, 543,
+ 543, 543, 543, 543, 1, 1062, 1, 1063,
+ 1062, 1064, 1, 1065, 1065, 1065, 1066, 1065,
+ 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074,
+ 1075, 1076, 1067, 1068, 1069, 1070, 1071, 1072,
+ 1073, 1074, 1075, 1076, 1065, 1065, 1065, 1065,
+ 1065, 1, 1078, 1, 1, 1, 1077, 1080,
+ 1, 1, 1, 1079, 1081, 1082, 1, 10,
+ 1083, 1083, 1083, 1083, 1083, 1083, 1083, 1,
+ 10, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+ 1, 10, 1085, 1085, 1085, 1085, 1085, 1085,
+ 1085, 1, 10, 1086, 1086, 1086, 1086, 1086,
+ 1086, 1086, 1, 10, 1087, 1087, 1087, 1087,
+ 1087, 1087, 1087, 1, 10, 1088, 1088, 1088,
+ 1088, 1088, 1088, 1088, 1, 10, 1089, 1089,
+ 1089, 1089, 1089, 1089, 1089, 1, 10, 1090,
+ 1090, 1090, 1090, 1090, 1090, 1090, 1, 10,
+ 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1,
+ 10, 1092, 1092, 1092, 1092, 1092, 1092, 1092,
+ 1, 10, 1093, 1093, 1093, 1093, 1093, 1093,
+ 1093, 1, 10, 1094, 1094, 1094, 1094, 1094,
+ 1094, 1094, 1, 10, 1095, 1095, 1095, 1095,
+ 1095, 1095, 1095, 1, 10, 1096, 1096, 1096,
+ 1096, 1096, 1096, 1096, 1, 10, 1097, 1097,
+ 1097, 1097, 1097, 1097, 1097, 1, 10, 1098,
+ 1098, 1098, 1098, 1098, 1098, 1098, 1, 10,
+ 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1,
+ 10, 1100, 1100, 1100, 1100, 1100, 1100, 1100,
+ 1, 10, 1101, 1101, 1101, 1101, 1101, 1101,
+ 1101, 1, 10, 1102, 1102, 1102, 1102, 1102,
+ 1102, 1102, 1, 10, 1103, 1103, 1103, 1103,
+ 1103, 1103, 1103, 1, 10, 1104, 1104, 1104,
+ 1104, 1104, 1104, 1104, 1, 10, 1105, 1105,
+ 1105, 1105, 1105, 1105, 1105, 1, 10, 1106,
+ 1106, 1106, 1106, 1106, 1106, 1106, 1, 10,
+ 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1,
+ 10, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
+ 1, 10, 1109, 1109, 1109, 1109, 1109, 1109,
+ 1109, 1, 10, 1, 1110, 0
};
static const short _tmsrp_machine_message_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 673, 12, 312, 672, 13,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 15, 16, 17, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 32, 87,
- 31, 701, 33, 86, 34, 85, 35, 84,
- 36, 83, 37, 82, 38, 81, 39, 80,
- 40, 79, 41, 78, 42, 77, 43, 76,
- 44, 75, 45, 74, 46, 73, 47, 72,
- 48, 71, 49, 70, 50, 69, 51, 68,
- 52, 67, 53, 66, 54, 65, 55, 64,
- 56, 63, 57, 62, 58, 61, 59, 60,
- 88, 89, 90, 91, 92, 14, 88, 93,
- 116, 130, 146, 157, 175, 190, 200, 211,
- 223, 19, 94, 95, 96, 97, 299, 98,
- 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 14, 88, 93, 116, 130, 146, 157,
- 175, 190, 200, 211, 223, 19, 117, 118,
- 119, 120, 121, 122, 123, 124, 125, 126,
- 127, 128, 129, 14, 88, 93, 116, 130,
- 146, 157, 175, 190, 200, 211, 223, 19,
- 131, 132, 133, 134, 135, 136, 137, 138,
- 139, 140, 141, 142, 143, 144, 145, 14,
- 88, 93, 116, 130, 146, 157, 175, 190,
- 200, 211, 223, 19, 147, 148, 149, 150,
- 151, 152, 153, 154, 155, 156, 14, 88,
- 93, 116, 130, 146, 157, 175, 190, 200,
- 211, 223, 19, 158, 287, 159, 160, 161,
- 162, 163, 164, 165, 166, 167, 168, 169,
- 170, 171, 172, 173, 174, 14, 88, 93,
- 116, 130, 146, 157, 175, 190, 200, 211,
- 223, 19, 176, 260, 273, 177, 178, 179,
- 180, 181, 182, 183, 184, 185, 186, 187,
- 188, 189, 14, 88, 93, 116, 130, 146,
- 157, 175, 190, 200, 211, 223, 19, 191,
- 243, 192, 193, 194, 195, 196, 197, 198,
- 199, 14, 88, 93, 116, 130, 146, 157,
- 175, 190, 200, 211, 223, 19, 201, 202,
- 203, 204, 205, 206, 207, 208, 209, 210,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 19, 212, 213, 214,
- 215, 216, 217, 218, 219, 220, 221, 222,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 19, 224, 225, 226,
- 227, 228, 229, 230, 231, 232, 233, 234,
- 235, 236, 237, 238, 239, 240, 241, 242,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 19, 244, 245, 246,
- 247, 248, 249, 250, 251, 252, 253, 254,
- 255, 256, 257, 258, 259, 14, 88, 93,
- 116, 130, 146, 157, 175, 190, 200, 211,
- 223, 19, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 14, 88,
- 93, 116, 130, 146, 157, 175, 190, 200,
- 211, 223, 19, 274, 275, 276, 277, 278,
- 279, 280, 281, 282, 283, 284, 285, 286,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 19, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298,
- 14, 88, 93, 116, 130, 146, 157, 175,
- 190, 200, 211, 223, 19, 300, 301, 302,
- 303, 304, 305, 306, 307, 308, 309, 310,
- 311, 14, 88, 93, 116, 130, 146, 157,
- 175, 190, 200, 211, 223, 19, 313, 314,
- 315, 670, 316, 317, 322, 451, 474, 488,
- 504, 515, 533, 548, 558, 569, 581, 317,
- 318, 319, 320, 321, 317, 322, 451, 474,
- 488, 504, 515, 533, 548, 558, 569, 581,
- 323, 324, 325, 326, 327, 328, 329, 330,
- 450, 331, 449, 332, 447, 333, 335, 444,
- 445, 334, 336, 441, 442, 337, 438, 439,
- 338, 435, 436, 339, 432, 433, 340, 429,
- 430, 341, 426, 427, 342, 423, 424, 343,
- 420, 421, 344, 417, 418, 345, 414, 415,
- 346, 411, 412, 347, 408, 409, 348, 405,
- 406, 349, 402, 403, 350, 399, 400, 351,
- 396, 397, 352, 393, 394, 353, 390, 391,
- 354, 387, 388, 355, 384, 385, 356, 381,
- 382, 357, 378, 379, 358, 375, 376, 359,
- 372, 373, 360, 369, 370, 361, 366, 367,
- 362, 364, 365, 363, 368, 371, 374, 377,
- 380, 383, 386, 389, 392, 395, 398, 401,
- 404, 407, 410, 413, 416, 419, 422, 425,
- 428, 431, 434, 437, 440, 443, 446, 448,
- 452, 453, 454, 455, 657, 456, 457, 458,
- 459, 460, 461, 462, 463, 464, 465, 466,
- 467, 468, 469, 470, 471, 472, 473, 317,
- 322, 451, 474, 488, 504, 515, 533, 548,
- 558, 569, 581, 475, 476, 477, 478, 479,
- 480, 481, 482, 483, 484, 485, 486, 487,
- 317, 322, 451, 474, 488, 504, 515, 533,
- 548, 558, 569, 581, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 500,
- 501, 502, 503, 317, 322, 451, 474, 488,
- 504, 515, 533, 548, 558, 569, 581, 505,
- 506, 507, 508, 509, 510, 511, 512, 513,
- 514, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 516, 645, 517,
- 518, 519, 520, 521, 522, 523, 524, 525,
- 526, 527, 528, 529, 530, 531, 532, 317,
- 322, 451, 474, 488, 504, 515, 533, 548,
- 558, 569, 581, 534, 618, 631, 535, 536,
- 537, 538, 539, 540, 541, 542, 543, 544,
- 545, 546, 547, 317, 322, 451, 474, 488,
- 504, 515, 533, 548, 558, 569, 581, 549,
- 601, 550, 551, 552, 553, 554, 555, 556,
- 557, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 559, 560, 561,
- 562, 563, 564, 565, 566, 567, 568, 317,
- 322, 451, 474, 488, 504, 515, 533, 548,
- 558, 569, 581, 570, 571, 572, 573, 574,
- 575, 576, 577, 578, 579, 580, 317, 322,
- 451, 474, 488, 504, 515, 533, 548, 558,
- 569, 581, 582, 583, 584, 585, 586, 587,
- 588, 589, 590, 591, 592, 593, 594, 595,
- 596, 597, 598, 599, 600, 317, 322, 451,
- 474, 488, 504, 515, 533, 548, 558, 569,
- 581, 602, 603, 604, 605, 606, 607, 608,
- 609, 610, 611, 612, 613, 614, 615, 616,
- 617, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 619, 620, 621,
- 622, 623, 624, 625, 626, 627, 628, 629,
- 630, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 632, 633, 634,
- 635, 636, 637, 638, 639, 640, 641, 642,
- 643, 644, 317, 322, 451, 474, 488, 504,
- 515, 533, 548, 558, 569, 581, 646, 647,
- 648, 649, 650, 651, 652, 653, 654, 655,
- 656, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 658, 659, 660,
- 661, 662, 663, 664, 665, 666, 667, 668,
- 669, 317, 322, 451, 474, 488, 504, 515,
- 533, 548, 558, 569, 581, 671, 315, 671,
- 315, 12, 672, 674, 675, 676, 677, 678,
- 679, 680, 681, 682, 683, 684, 685, 686,
- 687, 688, 689, 690, 691, 692, 693, 694,
- 695, 696, 697, 698, 699, 700, 701
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 673, 12, 312, 672, 13,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 15, 16, 17, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 32, 87,
+ 31, 701, 33, 86, 34, 85, 35, 84,
+ 36, 83, 37, 82, 38, 81, 39, 80,
+ 40, 79, 41, 78, 42, 77, 43, 76,
+ 44, 75, 45, 74, 46, 73, 47, 72,
+ 48, 71, 49, 70, 50, 69, 51, 68,
+ 52, 67, 53, 66, 54, 65, 55, 64,
+ 56, 63, 57, 62, 58, 61, 59, 60,
+ 88, 89, 90, 91, 92, 14, 88, 93,
+ 116, 130, 146, 157, 175, 190, 200, 211,
+ 223, 19, 94, 95, 96, 97, 299, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 14, 88, 93, 116, 130, 146, 157,
+ 175, 190, 200, 211, 223, 19, 117, 118,
+ 119, 120, 121, 122, 123, 124, 125, 126,
+ 127, 128, 129, 14, 88, 93, 116, 130,
+ 146, 157, 175, 190, 200, 211, 223, 19,
+ 131, 132, 133, 134, 135, 136, 137, 138,
+ 139, 140, 141, 142, 143, 144, 145, 14,
+ 88, 93, 116, 130, 146, 157, 175, 190,
+ 200, 211, 223, 19, 147, 148, 149, 150,
+ 151, 152, 153, 154, 155, 156, 14, 88,
+ 93, 116, 130, 146, 157, 175, 190, 200,
+ 211, 223, 19, 158, 287, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169,
+ 170, 171, 172, 173, 174, 14, 88, 93,
+ 116, 130, 146, 157, 175, 190, 200, 211,
+ 223, 19, 176, 260, 273, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187,
+ 188, 189, 14, 88, 93, 116, 130, 146,
+ 157, 175, 190, 200, 211, 223, 19, 191,
+ 243, 192, 193, 194, 195, 196, 197, 198,
+ 199, 14, 88, 93, 116, 130, 146, 157,
+ 175, 190, 200, 211, 223, 19, 201, 202,
+ 203, 204, 205, 206, 207, 208, 209, 210,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 19, 212, 213, 214,
+ 215, 216, 217, 218, 219, 220, 221, 222,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 19, 224, 225, 226,
+ 227, 228, 229, 230, 231, 232, 233, 234,
+ 235, 236, 237, 238, 239, 240, 241, 242,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 19, 244, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254,
+ 255, 256, 257, 258, 259, 14, 88, 93,
+ 116, 130, 146, 157, 175, 190, 200, 211,
+ 223, 19, 261, 262, 263, 264, 265, 266,
+ 267, 268, 269, 270, 271, 272, 14, 88,
+ 93, 116, 130, 146, 157, 175, 190, 200,
+ 211, 223, 19, 274, 275, 276, 277, 278,
+ 279, 280, 281, 282, 283, 284, 285, 286,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 19, 288, 289, 290,
+ 291, 292, 293, 294, 295, 296, 297, 298,
+ 14, 88, 93, 116, 130, 146, 157, 175,
+ 190, 200, 211, 223, 19, 300, 301, 302,
+ 303, 304, 305, 306, 307, 308, 309, 310,
+ 311, 14, 88, 93, 116, 130, 146, 157,
+ 175, 190, 200, 211, 223, 19, 313, 314,
+ 315, 670, 316, 317, 322, 451, 474, 488,
+ 504, 515, 533, 548, 558, 569, 581, 317,
+ 318, 319, 320, 321, 317, 322, 451, 474,
+ 488, 504, 515, 533, 548, 558, 569, 581,
+ 323, 324, 325, 326, 327, 328, 329, 330,
+ 450, 331, 449, 332, 447, 333, 335, 444,
+ 445, 334, 336, 441, 442, 337, 438, 439,
+ 338, 435, 436, 339, 432, 433, 340, 429,
+ 430, 341, 426, 427, 342, 423, 424, 343,
+ 420, 421, 344, 417, 418, 345, 414, 415,
+ 346, 411, 412, 347, 408, 409, 348, 405,
+ 406, 349, 402, 403, 350, 399, 400, 351,
+ 396, 397, 352, 393, 394, 353, 390, 391,
+ 354, 387, 388, 355, 384, 385, 356, 381,
+ 382, 357, 378, 379, 358, 375, 376, 359,
+ 372, 373, 360, 369, 370, 361, 366, 367,
+ 362, 364, 365, 363, 368, 371, 374, 377,
+ 380, 383, 386, 389, 392, 395, 398, 401,
+ 404, 407, 410, 413, 416, 419, 422, 425,
+ 428, 431, 434, 437, 440, 443, 446, 448,
+ 452, 453, 454, 455, 657, 456, 457, 458,
+ 459, 460, 461, 462, 463, 464, 465, 466,
+ 467, 468, 469, 470, 471, 472, 473, 317,
+ 322, 451, 474, 488, 504, 515, 533, 548,
+ 558, 569, 581, 475, 476, 477, 478, 479,
+ 480, 481, 482, 483, 484, 485, 486, 487,
+ 317, 322, 451, 474, 488, 504, 515, 533,
+ 548, 558, 569, 581, 489, 490, 491, 492,
+ 493, 494, 495, 496, 497, 498, 499, 500,
+ 501, 502, 503, 317, 322, 451, 474, 488,
+ 504, 515, 533, 548, 558, 569, 581, 505,
+ 506, 507, 508, 509, 510, 511, 512, 513,
+ 514, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 516, 645, 517,
+ 518, 519, 520, 521, 522, 523, 524, 525,
+ 526, 527, 528, 529, 530, 531, 532, 317,
+ 322, 451, 474, 488, 504, 515, 533, 548,
+ 558, 569, 581, 534, 618, 631, 535, 536,
+ 537, 538, 539, 540, 541, 542, 543, 544,
+ 545, 546, 547, 317, 322, 451, 474, 488,
+ 504, 515, 533, 548, 558, 569, 581, 549,
+ 601, 550, 551, 552, 553, 554, 555, 556,
+ 557, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 559, 560, 561,
+ 562, 563, 564, 565, 566, 567, 568, 317,
+ 322, 451, 474, 488, 504, 515, 533, 548,
+ 558, 569, 581, 570, 571, 572, 573, 574,
+ 575, 576, 577, 578, 579, 580, 317, 322,
+ 451, 474, 488, 504, 515, 533, 548, 558,
+ 569, 581, 582, 583, 584, 585, 586, 587,
+ 588, 589, 590, 591, 592, 593, 594, 595,
+ 596, 597, 598, 599, 600, 317, 322, 451,
+ 474, 488, 504, 515, 533, 548, 558, 569,
+ 581, 602, 603, 604, 605, 606, 607, 608,
+ 609, 610, 611, 612, 613, 614, 615, 616,
+ 617, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 619, 620, 621,
+ 622, 623, 624, 625, 626, 627, 628, 629,
+ 630, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 632, 633, 634,
+ 635, 636, 637, 638, 639, 640, 641, 642,
+ 643, 644, 317, 322, 451, 474, 488, 504,
+ 515, 533, 548, 558, 569, 581, 646, 647,
+ 648, 649, 650, 651, 652, 653, 654, 655,
+ 656, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 658, 659, 660,
+ 661, 662, 663, 664, 665, 666, 667, 668,
+ 669, 317, 322, 451, 474, 488, 504, 515,
+ 533, 548, 558, 569, 581, 671, 315, 671,
+ 315, 12, 672, 674, 675, 676, 677, 678,
+ 679, 680, 681, 682, 683, 684, 685, 686,
+ 687, 688, 689, 690, 691, 692, 693, 694,
+ 695, 696, 697, 698, 699, 700, 701
};
static const unsigned char _tmsrp_machine_message_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 35, 0, 51, 1, 1, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 57, 159, 0,
- 43, 0, 49, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 156, 0, 156,
- 45, 47, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 156, 0, 156, 0, 156, 0, 156,
- 0, 0, 0, 0, 0, 33, 150, 150,
- 150, 150, 150, 150, 150, 150, 150, 150,
- 150, 153, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 3, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 63, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 7, 72, 72, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 75,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 9,
- 78, 78, 78, 78, 78, 78, 78, 78,
- 78, 78, 78, 81, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 11, 84,
- 84, 84, 84, 84, 84, 84, 84, 84,
- 84, 84, 87, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 13, 90, 90,
- 90, 90, 90, 90, 90, 90, 90, 90,
- 90, 93, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 105, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 23, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 120, 123, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 27, 132, 132, 132, 132, 132, 132, 132,
- 132, 132, 132, 132, 135, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 29, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 141, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 147, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 25, 126, 126,
- 126, 126, 126, 126, 126, 126, 126, 126,
- 126, 129, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 19, 108,
- 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 111, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 21, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 117, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 15, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 99, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 66, 66, 66, 66, 66, 66,
- 66, 66, 66, 66, 66, 69, 0, 0,
- 39, 39, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 0, 150, 150, 150, 150,
- 150, 150, 150, 150, 150, 150, 150, 150,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 156, 0, 156,
- 0, 45, 0, 156, 0, 0, 156, 0,
- 0, 156, 0, 0, 156, 0, 0, 156,
- 0, 0, 156, 0, 0, 156, 0, 0,
- 156, 0, 0, 156, 0, 0, 156, 0,
- 0, 156, 0, 0, 156, 0, 0, 156,
- 0, 0, 156, 0, 0, 156, 0, 0,
- 156, 0, 0, 156, 0, 0, 156, 0,
- 0, 156, 0, 0, 156, 0, 0, 156,
- 0, 0, 156, 0, 0, 156, 0, 0,
- 156, 0, 0, 156, 0, 0, 156, 0,
- 0, 156, 0, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 60,
- 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 72, 72, 72, 72, 72, 72, 72, 72,
- 72, 72, 72, 72, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 78, 78, 78, 78, 78,
- 78, 78, 78, 78, 78, 78, 78, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 84, 84, 84, 84, 84, 84, 84,
- 84, 84, 84, 84, 84, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 90,
- 90, 90, 90, 90, 90, 90, 90, 90,
- 90, 90, 90, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 120, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 120, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 132,
- 132, 132, 132, 132, 132, 132, 132, 132,
- 132, 132, 132, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 126, 126, 126, 126, 126, 126, 126,
- 126, 126, 126, 126, 126, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 96, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 66, 66, 66, 66, 66, 66, 66,
- 66, 66, 66, 66, 66, 1, 54, 0,
- 41, 37, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 35, 0, 51, 1, 1, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 57, 159, 0,
+ 43, 0, 49, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 156, 0, 156,
+ 45, 47, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 156, 0, 156, 0, 156, 0, 156,
+ 0, 0, 0, 0, 0, 33, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 153, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 60, 60, 60, 60, 60, 60,
+ 60, 60, 60, 60, 60, 63, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 75,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 9,
+ 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 81, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 11, 84,
+ 84, 84, 84, 84, 84, 84, 84, 84,
+ 84, 84, 87, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 13, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 93, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 17, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 105, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 23, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 123, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 27, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 135, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 29, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 141, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 31, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 147, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 25, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 129, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 19, 108,
+ 108, 108, 108, 108, 108, 108, 108, 108,
+ 108, 108, 111, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 21, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 117, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 15, 96, 96, 96, 96, 96, 96, 96,
+ 96, 96, 96, 96, 99, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 69, 0, 0,
+ 39, 39, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 0, 0, 0, 0, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 156, 0, 156,
+ 0, 45, 0, 156, 0, 0, 156, 0,
+ 0, 156, 0, 0, 156, 0, 0, 156,
+ 0, 0, 156, 0, 0, 156, 0, 0,
+ 156, 0, 0, 156, 0, 0, 156, 0,
+ 0, 156, 0, 0, 156, 0, 0, 156,
+ 0, 0, 156, 0, 0, 156, 0, 0,
+ 156, 0, 0, 156, 0, 0, 156, 0,
+ 0, 156, 0, 0, 156, 0, 0, 156,
+ 0, 0, 156, 0, 0, 156, 0, 0,
+ 156, 0, 0, 156, 0, 0, 156, 0,
+ 0, 156, 0, 156, 156, 156, 156, 156,
+ 156, 156, 156, 156, 156, 156, 156, 156,
+ 156, 156, 156, 156, 156, 156, 156, 156,
+ 156, 156, 156, 156, 156, 156, 156, 156,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 60,
+ 60, 60, 60, 60, 60, 60, 60, 60,
+ 60, 60, 60, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 84, 84, 84, 84, 84, 84, 84,
+ 84, 84, 84, 84, 84, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 108, 108, 108, 108, 108, 108, 108,
+ 108, 108, 108, 108, 108, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 96, 96, 96, 96, 96, 96, 96,
+ 96, 96, 96, 96, 96, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 1, 54, 0,
+ 41, 37, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
};
static const int tmsrp_machine_message_start = 1;
@@ -3398,413 +3398,431 @@ TSK_RAGEL_DISABLE_WARNINGS_END()
tmsrp_message_t* tmsrp_message_parse(const void *input, tsk_size_t size)
{
- tsk_size_t msg_size;
- return tmsrp_message_parse_2(input, size, &msg_size);
+ tsk_size_t msg_size;
+ return tmsrp_message_parse_2(input, size, &msg_size);
}
tmsrp_message_t* tmsrp_message_parse_2(const void *input, tsk_size_t size, tsk_size_t* msg_size)
{
- tmsrp_message_t* msrp_msg = tsk_null;
- const char* tag_start = tsk_null;
- tmsrp_header_t* header = tsk_null;
- tsk_bool_t into_endline = tsk_false;
- tsk_bool_t payload_parsed = tsk_false;
-
- /* Ragel variables */
- int cs = 0;
- const char* p = input;
- const char* pe = p + size;
- const char* eof = tsk_null;
+ tmsrp_message_t* msrp_msg = tsk_null;
+ const char* tag_start = tsk_null;
+ tmsrp_header_t* header = tsk_null;
+ tsk_bool_t into_endline = tsk_false;
+ tsk_bool_t payload_parsed = tsk_false;
- (void)(eof);
- (void)(tmsrp_machine_message_first_final);
- (void)(tmsrp_machine_message_error);
- (void)(tmsrp_machine_message_en_main);
+ /* Ragel variables */
+ int cs = 0;
+ const char* p = input;
+ const char* pe = p + size;
+ const char* eof = tsk_null;
- *msg_size = 0;
+ (void)(eof);
+ (void)(tmsrp_machine_message_first_final);
+ (void)(tmsrp_machine_message_error);
+ (void)(tmsrp_machine_message_en_main);
- if(!input || !size){
- //TSK_DEBUG_ERROR("Null or empty buffer."); // --> very common case(stream): do not bother us...
- goto bail;
- }
+ *msg_size = 0;
- if(!(msrp_msg = tmsrp_message_create_null())){
- goto bail;
- }
+ if(!input || !size) {
+ //TSK_DEBUG_ERROR("Null or empty buffer."); // --> very common case(stream): do not bother us...
+ goto bail;
+ }
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
- /* Ragel init */
-
-/* #line 3439 "./src/parsers/tmsrp_parser_message.c" */
- {
- cs = tmsrp_machine_message_start;
- }
+ if(!(msrp_msg = tmsrp_message_create_null())) {
+ goto bail;
+ }
-/* #line 308 "./ragel/tmsrp_parser_message.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+ /* Ragel init */
- /* Ragel execute */
-
-/* #line 3448 "./src/parsers/tmsrp_parser_message.c" */
- {
- int _klen;
- unsigned int _trans;
- short _widec;
- const char *_acts;
- unsigned int _nacts;
- const short *_keys;
+ /* #line 3439 "./src/parsers/tmsrp_parser_message.c" */
+ {
+ cs = tmsrp_machine_message_start;
+ }
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 308 "./ragel/tmsrp_parser_message.rl" */
+
+ /* Ragel execute */
+
+ /* #line 3448 "./src/parsers/tmsrp_parser_message.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ short _widec;
+ const char *_acts;
+ unsigned int _nacts;
+ const short *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _widec = (*p);
- _klen = _tmsrp_machine_message_cond_lengths[cs];
- _keys = _tmsrp_machine_message_cond_keys + (_tmsrp_machine_message_cond_offsets[cs]*2);
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _widec = (*p);
+ _klen = _tmsrp_machine_message_cond_lengths[cs];
+ _keys = _tmsrp_machine_message_cond_keys + (_tmsrp_machine_message_cond_offsets[cs]*2);
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- switch ( _tmsrp_machine_message_cond_spaces[_tmsrp_machine_message_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
- case 0: {
- _widec = (short)(128 + ((*p) - -128));
- if (
-/* #line 192 "./ragel/tmsrp_parser_message.rl" */
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ switch ( _tmsrp_machine_message_cond_spaces[_tmsrp_machine_message_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
+ case 0: {
+ _widec = (short)(128 + ((*p) - -128));
+ if (
+ /* #line 192 "./ragel/tmsrp_parser_message.rl" */
- ( into_endline || (((pe-p) >7/*seven hyphens*/) && (msrp_msg->tid) && tsk_strniequals(msrp_msg->tid, (p+7), tsk_strlen(msrp_msg->tid))) )
- ) _widec += 256;
- break;
- }
- }
- break;
- }
- }
- }
+ ( into_endline || (((pe-p) >7/*seven hyphens*/) && (msrp_msg->tid) && tsk_strniequals(msrp_msg->tid, (p+7), tsk_strlen(msrp_msg->tid))) )
+ ) {
+ _widec += 256;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
- _keys = _tmsrp_machine_message_trans_keys + _tmsrp_machine_message_key_offsets[cs];
- _trans = _tmsrp_machine_message_index_offsets[cs];
+ _keys = _tmsrp_machine_message_trans_keys + _tmsrp_machine_message_key_offsets[cs];
+ _trans = _tmsrp_machine_message_index_offsets[cs];
- _klen = _tmsrp_machine_message_single_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tmsrp_machine_message_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( _widec < *_mid )
- _upper = _mid - 1;
- else if ( _widec > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( _widec < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( _widec > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _tmsrp_machine_message_range_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tmsrp_machine_message_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_message_indicies[_trans];
- cs = _tmsrp_machine_message_trans_targs[_trans];
+ _trans = _tmsrp_machine_message_indicies[_trans];
+ cs = _tmsrp_machine_message_trans_targs[_trans];
- if ( _tmsrp_machine_message_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _tmsrp_machine_message_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _tmsrp_machine_message_actions + _tmsrp_machine_message_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 52 "./ragel/tmsrp_parser_message.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 59 "./ragel/tmsrp_parser_message.rl" */
- {
- //FIXME: TMSRP_MSG_PARSER_ADD_HEADER(Authentication_Info);
- TSK_DEBUG_WARN("Authentication_Info Not implemented");
- }
- break;
- case 2:
-/* #line 64 "./ragel/tmsrp_parser_message.rl" */
- {
- //FIXME: TMSRP_MSG_PARSER_ADD_HEADER(Authorization);
- TSK_DEBUG_WARN("Authorization Not implemented");
- }
- break;
- case 3:
-/* #line 69 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Byte_Range);
- }
- break;
- case 4:
-/* #line 73 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Content_Type);
- }
- break;
- case 5:
-/* #line 77 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Expires);
- }
- break;
- case 6:
-/* #line 81 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Failure_Report);
- }
- break;
- case 7:
-/* #line 85 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(From_Path);
- }
- break;
- case 8:
-/* #line 89 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Max_Expires);
- }
- break;
- case 9:
-/* #line 93 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Message_ID);
- }
- break;
- case 10:
-/* #line 97 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Min_Expires);
- }
- break;
- case 11:
-/* #line 101 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Status);
- }
- break;
- case 12:
-/* #line 105 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Success_Report);
- }
- break;
- case 13:
-/* #line 109 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(To_Path);
- }
- break;
- case 14:
-/* #line 113 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Use_Path);
- }
- break;
- case 15:
-/* #line 117 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(WWW_Authenticate);
- }
- break;
- case 16:
-/* #line 121 "./ragel/tmsrp_parser_message.rl" */
- {
- TMSRP_MSG_PARSER_ADD_HEADER(Dummy);
- }
- break;
- case 17:
-/* #line 125 "./ragel/tmsrp_parser_message.rl" */
- {
- TSK_PARSER_SET_STRING(msrp_msg->tid);
- }
- break;
- case 18:
-/* #line 129 "./ragel/tmsrp_parser_message.rl" */
- {
- if(msrp_msg->type == tmsrp_unknown){
- msrp_msg->type = tmsrp_request;
- TSK_PARSER_SET_STRING(msrp_msg->line.request.method);
- msrp_msg->line.request.type = tmsrp_request_get_type(msrp_msg->line.request.method);
- }
- else{
- //cs = %%{ write first_final; }%%;
- cs = tmsrp_machine_message_error;
- TSK_DEBUG_ERROR("Message type already defined.");
- }
- }
- break;
- case 19:
-/* #line 143 "./ragel/tmsrp_parser_message.rl" */
- {
- if(msrp_msg->type == tmsrp_unknown){
- msrp_msg->type = tmsrp_response;
- TSK_PARSER_SET_INT(msrp_msg->line.response.status);
- }
- else{
- //cs = %%{ write first_final; }%%;
- cs = tmsrp_machine_message_error;
- TSK_DEBUG_ERROR("Message type already defined.");
- }
- }
- break;
- case 20:
-/* #line 154 "./ragel/tmsrp_parser_message.rl" */
- {
- TSK_PARSER_SET_STRING(msrp_msg->line.response.comment);
- }
- break;
- case 21:
-/* #line 159 "./ragel/tmsrp_parser_message.rl" */
- {
- parse_payload(msrp_msg, tag_start, &p, pe, &payload_parsed); // will update "p"
- }
- break;
- case 22:
-/* #line 163 "./ragel/tmsrp_parser_message.rl" */
- {
- // if the msrp message contain a valid content-type, then gob it otherwise continue until we reach the endline
- int len;
- if(parse_payload(msrp_msg, tag_start, &p, pe, &payload_parsed)){ // will update "p"
- // (This space left deliberately blank)
- }
- else if((len = (int)(p - tag_start))>0){
- set_payload(msrp_msg, tag_start, (tsk_size_t)len);
- }
- }
- break;
- case 23:
-/* #line 174 "./ragel/tmsrp_parser_message.rl" */
- {
- TSK_PARSER_SET_STRING(msrp_msg->end_line.tid);
- }
- break;
- case 24:
-/* #line 178 "./ragel/tmsrp_parser_message.rl" */
- {
- if(tag_start){
- msrp_msg->end_line.cflag = *tag_start;
- }
- else msrp_msg->end_line.cflag = '#';
- }
- break;
- case 25:
-/* #line 185 "./ragel/tmsrp_parser_message.rl" */
- {
- *msg_size = (p - (const char*)input) + 1;
- }
- break;
- case 26:
-/* #line 189 "./ragel/tmsrp_parser_message.rl" */
- {
- into_endline = tsk_true;
- }
- break;
-/* #line 3747 "./src/parsers/tmsrp_parser_message.c" */
- }
- }
+ _acts = _tmsrp_machine_message_actions + _tmsrp_machine_message_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 52 "./ragel/tmsrp_parser_message.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 59 "./ragel/tmsrp_parser_message.rl" */
+ {
+ //FIXME: TMSRP_MSG_PARSER_ADD_HEADER(Authentication_Info);
+ TSK_DEBUG_WARN("Authentication_Info Not implemented");
+ }
+ break;
+ case 2:
+ /* #line 64 "./ragel/tmsrp_parser_message.rl" */
+ {
+ //FIXME: TMSRP_MSG_PARSER_ADD_HEADER(Authorization);
+ TSK_DEBUG_WARN("Authorization Not implemented");
+ }
+ break;
+ case 3:
+ /* #line 69 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Byte_Range);
+ }
+ break;
+ case 4:
+ /* #line 73 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Content_Type);
+ }
+ break;
+ case 5:
+ /* #line 77 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Expires);
+ }
+ break;
+ case 6:
+ /* #line 81 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Failure_Report);
+ }
+ break;
+ case 7:
+ /* #line 85 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(From_Path);
+ }
+ break;
+ case 8:
+ /* #line 89 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Max_Expires);
+ }
+ break;
+ case 9:
+ /* #line 93 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Message_ID);
+ }
+ break;
+ case 10:
+ /* #line 97 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Min_Expires);
+ }
+ break;
+ case 11:
+ /* #line 101 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Status);
+ }
+ break;
+ case 12:
+ /* #line 105 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Success_Report);
+ }
+ break;
+ case 13:
+ /* #line 109 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(To_Path);
+ }
+ break;
+ case 14:
+ /* #line 113 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Use_Path);
+ }
+ break;
+ case 15:
+ /* #line 117 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(WWW_Authenticate);
+ }
+ break;
+ case 16:
+ /* #line 121 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TMSRP_MSG_PARSER_ADD_HEADER(Dummy);
+ }
+ break;
+ case 17:
+ /* #line 125 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TSK_PARSER_SET_STRING(msrp_msg->tid);
+ }
+ break;
+ case 18:
+ /* #line 129 "./ragel/tmsrp_parser_message.rl" */
+ {
+ if(msrp_msg->type == tmsrp_unknown) {
+ msrp_msg->type = tmsrp_request;
+ TSK_PARSER_SET_STRING(msrp_msg->line.request.method);
+ msrp_msg->line.request.type = tmsrp_request_get_type(msrp_msg->line.request.method);
+ }
+ else {
+ //cs = %%{ write first_final; }%%;
+ cs = tmsrp_machine_message_error;
+ TSK_DEBUG_ERROR("Message type already defined.");
+ }
+ }
+ break;
+ case 19:
+ /* #line 143 "./ragel/tmsrp_parser_message.rl" */
+ {
+ if(msrp_msg->type == tmsrp_unknown) {
+ msrp_msg->type = tmsrp_response;
+ TSK_PARSER_SET_INT(msrp_msg->line.response.status);
+ }
+ else {
+ //cs = %%{ write first_final; }%%;
+ cs = tmsrp_machine_message_error;
+ TSK_DEBUG_ERROR("Message type already defined.");
+ }
+ }
+ break;
+ case 20:
+ /* #line 154 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TSK_PARSER_SET_STRING(msrp_msg->line.response.comment);
+ }
+ break;
+ case 21:
+ /* #line 159 "./ragel/tmsrp_parser_message.rl" */
+ {
+ parse_payload(msrp_msg, tag_start, &p, pe, &payload_parsed); // will update "p"
+ }
+ break;
+ case 22:
+ /* #line 163 "./ragel/tmsrp_parser_message.rl" */
+ {
+ // if the msrp message contain a valid content-type, then gob it otherwise continue until we reach the endline
+ int len;
+ if(parse_payload(msrp_msg, tag_start, &p, pe, &payload_parsed)) { // will update "p"
+ // (This space left deliberately blank)
+ }
+ else if((len = (int)(p - tag_start))>0) {
+ set_payload(msrp_msg, tag_start, (tsk_size_t)len);
+ }
+ }
+ break;
+ case 23:
+ /* #line 174 "./ragel/tmsrp_parser_message.rl" */
+ {
+ TSK_PARSER_SET_STRING(msrp_msg->end_line.tid);
+ }
+ break;
+ case 24:
+ /* #line 178 "./ragel/tmsrp_parser_message.rl" */
+ {
+ if(tag_start) {
+ msrp_msg->end_line.cflag = *tag_start;
+ }
+ else {
+ msrp_msg->end_line.cflag = '#';
+ }
+ }
+ break;
+ case 25:
+ /* #line 185 "./ragel/tmsrp_parser_message.rl" */
+ {
+ *msg_size = (p - (const char*)input) + 1;
+ }
+ break;
+ case 26:
+ /* #line 189 "./ragel/tmsrp_parser_message.rl" */
+ {
+ into_endline = tsk_true;
+ }
+ break;
+ /* #line 3747 "./src/parsers/tmsrp_parser_message.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
-/* #line 311 "./ragel/tmsrp_parser_message.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
+ /* #line 311 "./ragel/tmsrp_parser_message.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ /* Check result */
+ if( cs <
+ /* #line 3765 "./src/parsers/tmsrp_parser_message.c" */
+ 701
+ /* #line 314 "./ragel/tmsrp_parser_message.rl" */
+ ) {
+ //TSK_DEBUG_ERROR("Failed to parse MSRP message."); --> very common case(stream): do not bother us...
+ TSK_OBJECT_SAFE_FREE(msrp_msg);
+ goto bail;
+ }
- /* Check result */
- if( cs <
-/* #line 3765 "./src/parsers/tmsrp_parser_message.c" */
-701
-/* #line 314 "./ragel/tmsrp_parser_message.rl" */
- ){
- //TSK_DEBUG_ERROR("Failed to parse MSRP message."); --> very common case(stream): do not bother us...
- TSK_OBJECT_SAFE_FREE(msrp_msg);
- goto bail;
- }
-
bail:
- return msrp_msg;
+ return msrp_msg;
}
static tsk_bool_t parse_payload(tmsrp_message_t* msrp_msg, const char* tag_start, const char** p, const char* pe, tsk_bool_t* payload_parsed)
{
- int64_t payload_len, endline_len;
- tsk_bool_t can_parse_payload;
+ int64_t payload_len, endline_len;
+ tsk_bool_t can_parse_payload;
- if(*payload_parsed){
- TSK_DEBUG_INFO("payload already parsed");
- return tsk_true;
- }
+ if(*payload_parsed) {
+ TSK_DEBUG_INFO("payload already parsed");
+ return tsk_true;
+ }
- if(pe && p && *p && msrp_msg && (can_parse_payload = TMSRP_HEADER_BYTE_RANGE_IS_VALID(msrp_msg->ByteRange))){
- payload_len = (msrp_msg->ByteRange->end - msrp_msg->ByteRange->start) + 1;
- endline_len = 2/*CRLF*/ + 7/*hyphens*/ + tsk_strlen(msrp_msg->tid) + 2/*CRLF*/;
- can_parse_payload = (pe - tag_start) > (payload_len + endline_len);
- if(can_parse_payload){
- set_payload(msrp_msg, tag_start, (tsk_size_t)payload_len);
- *p = ((tag_start + payload_len) - 1);
- *payload_parsed = tsk_true;
- return tsk_true;
- }
- }
- return tsk_false;
+ if(pe && p && *p && msrp_msg && (can_parse_payload = TMSRP_HEADER_BYTE_RANGE_IS_VALID(msrp_msg->ByteRange))) {
+ payload_len = (msrp_msg->ByteRange->end - msrp_msg->ByteRange->start) + 1;
+ endline_len = 2/*CRLF*/ + 7/*hyphens*/ + tsk_strlen(msrp_msg->tid) + 2/*CRLF*/;
+ can_parse_payload = (pe - tag_start) > (payload_len + endline_len);
+ if(can_parse_payload) {
+ set_payload(msrp_msg, tag_start, (tsk_size_t)payload_len);
+ *p = ((tag_start + payload_len) - 1);
+ *payload_parsed = tsk_true;
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
static void set_payload(tmsrp_message_t* msrp_msg, const void* ptr, tsk_size_t len)
{
- if(msrp_msg->Content){
- tsk_buffer_cleanup(msrp_msg->Content);
- tsk_buffer_append(msrp_msg->Content, ptr, len);
- }
- else{
- msrp_msg->Content = tsk_buffer_create(ptr, len);
- }
+ if(msrp_msg->Content) {
+ tsk_buffer_cleanup(msrp_msg->Content);
+ tsk_buffer_append(msrp_msg->Content, ptr, len);
+ }
+ else {
+ msrp_msg->Content = tsk_buffer_create(ptr, len);
+ }
} \ No newline at end of file
diff --git a/tinyMSRP/src/parsers/tmsrp_parser_uri.c b/tinyMSRP/src/parsers/tmsrp_parser_uri.c
index e46339b..d433ad9 100755
--- a/tinyMSRP/src/parsers/tmsrp_parser_uri.c
+++ b/tinyMSRP/src/parsers/tmsrp_parser_uri.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tmsrp_parser_uri.rl" */
/*
* Copyright (C) 2009-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,598 +40,614 @@
tmsrp_uri_t *tmsrp_uri_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tmsrp_uri_t *uri = tmsrp_uri_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 54 "./src/parsers/tmsrp_parser_uri.c" */
-static const char _tmsrp_machine_parser_uri_actions[] = {
- 0, 1, 0, 1, 4, 1, 5, 1,
- 6, 1, 7, 1, 8, 1, 9, 1,
- 10, 2, 0, 1, 2, 0, 2, 2,
- 0, 3, 2, 0, 5, 2, 0, 9
-
-};
-
-static const short _tmsrp_machine_parser_uri_key_offsets[] = {
- 0, 0, 1, 2, 3, 4, 6, 7,
- 8, 25, 39, 45, 51, 58, 61, 63,
- 66, 68, 71, 73, 78, 90, 103, 117,
- 131, 136, 139, 141, 145, 148, 149, 152,
- 153, 156, 157, 168, 175, 184, 192, 199,
- 205, 212, 220, 228, 236, 238, 245, 254,
- 256, 259, 261, 264, 266, 269, 272, 273,
- 276, 277, 280, 281, 290, 299, 307, 315,
- 323, 331, 333, 339, 348, 357, 366, 368,
- 371, 374, 375, 376, 393, 409, 426, 442,
- 459, 475, 492, 509, 524, 540, 557, 577,
- 597, 614, 629, 646, 661, 678, 693, 712,
- 729, 746, 764, 781, 797, 798, 805, 812,
- 828, 843, 859, 875, 895, 917, 939, 959,
- 980
-};
-
-static const char _tmsrp_machine_parser_uri_trans_keys[] = {
- 109, 115, 114, 112, 58, 115, 47, 47,
- 33, 37, 61, 64, 91, 95, 126, 36,
- 46, 48, 57, 58, 59, 65, 90, 97,
- 122, 33, 37, 61, 64, 95, 126, 36,
- 46, 48, 59, 65, 90, 97, 122, 48,
- 57, 65, 70, 97, 102, 48, 57, 65,
- 70, 97, 102, 91, 48, 57, 65, 90,
- 97, 122, 46, 48, 57, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 47, 58, 59, 48, 57, 33, 61,
- 95, 126, 39, 43, 45, 57, 65, 90,
- 97, 122, 33, 59, 61, 95, 126, 39,
- 43, 45, 57, 65, 90, 97, 122, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 47, 58, 59, 48, 57,
- 47, 58, 59, 48, 57, 47, 59, 48,
- 57, 46, 48, 57, 46, 46, 48, 57,
- 46, 46, 48, 57, 46, 45, 46, 47,
- 58, 59, 48, 57, 65, 90, 97, 122,
- 45, 48, 57, 65, 90, 97, 122, 47,
- 58, 59, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 48, 57, 65, 90, 97, 122, 48,
- 57, 65, 90, 97, 122, 58, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 58, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 48, 57, 46, 48, 57,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 46, 48, 57, 46, 46, 48, 57,
- 46, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 46, 48, 57, 46, 58,
- 33, 37, 46, 61, 64, 95, 126, 36,
- 45, 48, 57, 58, 59, 65, 90, 97,
- 122, 33, 37, 61, 64, 95, 126, 36,
- 46, 48, 57, 58, 59, 65, 90, 97,
- 122, 33, 37, 46, 61, 64, 95, 126,
- 36, 45, 48, 57, 58, 59, 65, 90,
- 97, 122, 33, 37, 61, 64, 95, 126,
- 36, 46, 48, 57, 58, 59, 65, 90,
- 97, 122, 33, 37, 46, 61, 64, 95,
- 126, 36, 45, 48, 57, 58, 59, 65,
- 90, 97, 122, 33, 37, 61, 64, 95,
- 126, 36, 46, 48, 57, 58, 59, 65,
- 90, 97, 122, 33, 37, 47, 58, 59,
- 61, 64, 95, 126, 36, 46, 48, 57,
- 65, 90, 97, 122, 33, 37, 47, 58,
- 59, 61, 64, 95, 126, 36, 46, 48,
- 57, 65, 90, 97, 122, 33, 37, 47,
- 58, 59, 61, 64, 95, 126, 36, 57,
- 65, 90, 97, 122, 33, 37, 61, 64,
- 95, 126, 36, 46, 48, 57, 58, 59,
- 65, 90, 97, 122, 33, 37, 47, 58,
- 59, 61, 64, 95, 126, 36, 46, 48,
- 57, 65, 90, 97, 122, 33, 37, 39,
- 44, 61, 64, 96, 126, 36, 41, 42,
- 46, 48, 57, 58, 59, 65, 90, 95,
- 122, 33, 37, 39, 44, 61, 64, 96,
- 126, 36, 41, 42, 46, 48, 57, 58,
- 59, 65, 90, 95, 122, 33, 37, 46,
- 61, 64, 95, 126, 36, 45, 48, 57,
- 58, 59, 65, 90, 97, 122, 33, 37,
- 46, 61, 64, 95, 126, 36, 45, 48,
- 59, 65, 90, 97, 122, 33, 37, 46,
- 61, 64, 95, 126, 36, 45, 48, 57,
- 58, 59, 65, 90, 97, 122, 33, 37,
- 46, 61, 64, 95, 126, 36, 45, 48,
- 59, 65, 90, 97, 122, 33, 37, 46,
- 61, 64, 95, 126, 36, 45, 48, 57,
- 58, 59, 65, 90, 97, 122, 33, 37,
- 46, 61, 64, 95, 126, 36, 45, 48,
- 59, 65, 90, 97, 122, 33, 37, 45,
- 46, 47, 58, 59, 61, 64, 95, 126,
- 36, 44, 48, 57, 65, 90, 97, 122,
- 33, 37, 45, 61, 64, 95, 126, 36,
- 46, 48, 57, 58, 59, 65, 90, 97,
- 122, 33, 37, 47, 58, 59, 61, 64,
- 95, 126, 36, 46, 48, 57, 65, 90,
- 97, 122, 33, 37, 45, 46, 61, 64,
- 95, 126, 36, 44, 48, 57, 58, 59,
- 65, 90, 97, 122, 33, 37, 45, 61,
- 64, 95, 126, 36, 46, 48, 57, 58,
- 59, 65, 90, 97, 122, 33, 37, 61,
- 64, 95, 126, 36, 46, 48, 57, 58,
- 59, 65, 90, 97, 122, 58, 59, 48,
- 57, 65, 90, 97, 122, 59, 48, 57,
- 65, 90, 97, 122, 33, 37, 39, 59,
- 61, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 33, 37, 39, 59,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 33, 37, 58, 59, 61,
- 64, 95, 126, 36, 46, 48, 57, 65,
- 90, 97, 122, 33, 37, 58, 59, 61,
- 64, 95, 126, 36, 46, 48, 57, 65,
- 90, 97, 122, 33, 37, 39, 44, 58,
- 59, 61, 64, 96, 126, 36, 41, 42,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 59, 61, 126, 42, 43, 45,
- 46, 48, 57, 65, 70, 71, 90, 95,
- 96, 97, 102, 103, 122, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 70, 71, 90, 95, 96, 97,
- 102, 103, 122, 33, 37, 39, 44, 58,
- 59, 61, 64, 96, 126, 36, 41, 42,
- 46, 48, 57, 65, 90, 95, 122, 33,
- 37, 39, 59, 126, 42, 43, 45, 46,
- 48, 57, 65, 70, 71, 90, 95, 96,
- 97, 102, 103, 122, 33, 37, 39, 59,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 70, 71, 90, 95, 96, 97, 102, 103,
- 122, 0
-};
-
-static const char _tmsrp_machine_parser_uri_single_lengths[] = {
- 0, 1, 1, 1, 1, 2, 1, 1,
- 7, 6, 0, 0, 1, 1, 0, 1,
- 0, 1, 0, 3, 4, 5, 4, 4,
- 3, 3, 0, 2, 1, 1, 1, 1,
- 1, 1, 5, 1, 3, 2, 1, 0,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 2, 2, 2,
- 2, 2, 0, 3, 3, 3, 0, 1,
- 1, 1, 1, 7, 6, 7, 6, 7,
- 6, 9, 9, 9, 6, 9, 8, 8,
- 7, 7, 7, 7, 7, 7, 11, 7,
- 9, 8, 7, 6, 1, 1, 1, 6,
- 5, 8, 8, 10, 6, 6, 10, 5,
- 5
-};
-
-static const char _tmsrp_machine_parser_uri_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 4, 3, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 4, 4, 5, 5,
- 1, 0, 1, 1, 1, 0, 1, 0,
- 1, 0, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 1,
- 0, 1, 0, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 3, 3, 1, 1,
- 1, 0, 0, 5, 5, 5, 5, 5,
- 5, 4, 4, 3, 5, 4, 6, 6,
- 5, 4, 5, 4, 5, 4, 4, 5,
- 4, 5, 5, 5, 0, 3, 3, 5,
- 5, 4, 4, 5, 8, 8, 5, 8,
- 8
-};
-
-static const short _tmsrp_machine_parser_uri_index_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 13,
- 15, 28, 39, 43, 47, 52, 55, 57,
- 60, 62, 65, 67, 72, 81, 91, 101,
- 111, 116, 120, 122, 126, 129, 131, 134,
- 136, 139, 141, 150, 155, 162, 168, 173,
- 177, 182, 188, 194, 200, 203, 208, 215,
- 217, 220, 222, 225, 227, 230, 233, 235,
- 238, 240, 243, 245, 252, 259, 265, 271,
- 277, 283, 286, 290, 297, 304, 311, 313,
- 316, 319, 321, 323, 336, 348, 361, 373,
- 386, 398, 412, 426, 439, 451, 465, 480,
- 495, 508, 520, 533, 545, 558, 570, 586,
- 599, 613, 627, 640, 652, 654, 659, 664,
- 676, 687, 700, 713, 729, 744, 759, 775,
- 789
-};
-
-static const unsigned char _tmsrp_machine_parser_uri_indicies[] = {
- 0, 1, 2, 1, 3, 1, 4, 1,
- 5, 6, 1, 7, 1, 8, 1, 9,
- 10, 9, 12, 14, 9, 9, 9, 11,
- 9, 13, 13, 1, 15, 16, 15, 17,
- 15, 15, 15, 15, 15, 15, 1, 18,
- 18, 18, 1, 15, 15, 15, 1, 14,
- 19, 20, 20, 1, 21, 22, 1, 23,
- 1, 24, 25, 1, 26, 1, 27, 28,
- 1, 29, 1, 30, 32, 33, 31, 1,
- 34, 34, 34, 34, 34, 34, 34, 34,
- 1, 35, 36, 35, 35, 35, 35, 35,
- 35, 35, 1, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 1, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 1, 30,
- 32, 33, 39, 1, 30, 32, 33, 1,
- 40, 1, 41, 43, 42, 1, 27, 44,
- 1, 27, 1, 24, 45, 1, 24, 1,
- 21, 46, 1, 21, 1, 47, 48, 30,
- 32, 33, 49, 49, 49, 1, 47, 49,
- 49, 49, 1, 30, 32, 33, 50, 49,
- 49, 1, 51, 52, 50, 50, 50, 1,
- 51, 50, 50, 50, 1, 50, 49, 49,
- 1, 54, 53, 53, 53, 1, 56, 39,
- 55, 55, 55, 1, 56, 39, 57, 57,
- 57, 1, 56, 39, 58, 58, 58, 1,
- 56, 39, 1, 60, 59, 53, 53, 1,
- 61, 56, 39, 62, 55, 55, 1, 63,
- 1, 64, 65, 1, 66, 1, 67, 68,
- 1, 69, 1, 39, 70, 1, 39, 71,
- 1, 39, 1, 67, 72, 1, 67, 1,
- 64, 73, 1, 64, 1, 61, 56, 39,
- 74, 57, 57, 1, 61, 56, 39, 58,
- 58, 58, 1, 76, 39, 75, 75, 75,
- 1, 78, 39, 77, 77, 77, 1, 78,
- 39, 79, 79, 79, 1, 78, 39, 80,
- 80, 80, 1, 78, 39, 1, 81, 75,
- 75, 1, 61, 78, 39, 82, 77, 77,
- 1, 61, 78, 39, 83, 79, 79, 1,
- 61, 78, 39, 80, 80, 80, 1, 84,
- 1, 61, 85, 1, 61, 86, 1, 61,
- 1, 60, 1, 15, 16, 87, 15, 17,
- 15, 15, 15, 88, 15, 15, 15, 1,
- 15, 16, 15, 17, 15, 15, 15, 89,
- 15, 15, 15, 1, 15, 16, 90, 15,
- 17, 15, 15, 15, 91, 15, 15, 15,
- 1, 15, 16, 15, 17, 15, 15, 15,
- 92, 15, 15, 15, 1, 15, 16, 93,
- 15, 17, 15, 15, 15, 94, 15, 15,
- 15, 1, 15, 16, 15, 17, 15, 15,
- 15, 95, 15, 15, 15, 1, 15, 16,
- 30, 97, 98, 15, 17, 15, 15, 15,
- 96, 15, 15, 1, 15, 16, 30, 97,
- 98, 15, 17, 15, 15, 15, 99, 15,
- 15, 1, 15, 16, 30, 97, 98, 15,
- 17, 15, 15, 15, 15, 15, 1, 15,
- 16, 15, 17, 15, 15, 15, 100, 15,
- 15, 15, 1, 15, 16, 41, 15, 102,
- 15, 17, 15, 15, 15, 101, 15, 15,
- 1, 103, 104, 103, 15, 15, 17, 37,
- 103, 15, 103, 103, 15, 103, 103, 1,
- 105, 106, 105, 15, 15, 17, 38, 105,
- 15, 105, 105, 15, 105, 105, 1, 15,
- 16, 93, 15, 17, 15, 15, 15, 107,
- 15, 15, 15, 1, 15, 16, 93, 15,
- 17, 15, 15, 15, 15, 15, 15, 1,
- 15, 16, 90, 15, 17, 15, 15, 15,
- 108, 15, 15, 15, 1, 15, 16, 90,
- 15, 17, 15, 15, 15, 15, 15, 15,
- 1, 15, 16, 87, 15, 17, 15, 15,
- 15, 109, 15, 15, 15, 1, 15, 16,
- 87, 15, 17, 15, 15, 15, 15, 15,
- 15, 1, 15, 16, 110, 111, 30, 97,
- 98, 15, 17, 15, 15, 15, 112, 112,
- 112, 1, 15, 16, 110, 15, 17, 15,
- 15, 15, 112, 15, 112, 112, 1, 15,
- 16, 30, 97, 98, 15, 17, 15, 15,
- 15, 113, 112, 112, 1, 15, 16, 114,
- 115, 15, 17, 15, 15, 15, 113, 15,
- 113, 113, 1, 15, 16, 114, 15, 17,
- 15, 15, 15, 113, 15, 113, 113, 1,
- 15, 16, 15, 17, 15, 15, 15, 113,
- 15, 112, 112, 1, 5, 1, 117, 116,
- 116, 116, 1, 119, 118, 118, 118, 1,
- 120, 120, 120, 121, 122, 120, 120, 120,
- 120, 120, 120, 1, 38, 38, 38, 121,
- 38, 38, 38, 38, 38, 38, 1, 15,
- 16, 15, 124, 15, 17, 15, 15, 15,
- 123, 123, 123, 1, 15, 16, 15, 126,
- 15, 17, 15, 15, 15, 125, 125, 125,
- 1, 127, 128, 127, 15, 15, 129, 130,
- 17, 120, 127, 15, 127, 127, 127, 127,
- 1, 120, 120, 120, 121, 122, 120, 120,
- 120, 131, 131, 120, 120, 131, 120, 1,
- 120, 120, 120, 121, 122, 120, 120, 120,
- 127, 127, 120, 120, 127, 120, 1, 105,
- 106, 105, 15, 15, 129, 15, 17, 38,
- 105, 15, 105, 105, 105, 105, 1, 38,
- 38, 38, 121, 38, 38, 38, 132, 132,
- 38, 38, 132, 38, 1, 38, 38, 38,
- 121, 38, 38, 38, 105, 105, 38, 38,
- 105, 38, 1, 0
-};
-
-static const char _tmsrp_machine_parser_uri_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 100, 7,
- 8, 9, 10, 75, 12, 94, 40, 9,
- 10, 12, 11, 13, 34, 14, 32, 15,
- 16, 30, 17, 18, 28, 19, 20, 24,
- 26, 101, 21, 21, 101, 103, 104, 25,
- 27, 20, 27, 101, 29, 31, 33, 35,
- 36, 34, 37, 38, 39, 41, 74, 42,
- 45, 43, 44, 46, 61, 47, 59, 48,
- 49, 57, 50, 51, 55, 52, 53, 54,
- 56, 58, 60, 62, 70, 63, 66, 64,
- 65, 67, 68, 69, 71, 72, 73, 76,
- 92, 77, 78, 90, 79, 80, 88, 81,
- 82, 84, 105, 83, 85, 85, 105, 107,
- 108, 110, 111, 89, 91, 93, 95, 96,
- 94, 97, 98, 99, 102, 22, 102, 22,
- 103, 22, 23, 106, 86, 106, 86, 107,
- 108, 86, 87, 109, 112
-};
-
-static const char _tmsrp_machine_parser_uri_trans_actions[] = {
- 1, 0, 0, 0, 0, 3, 0, 0,
- 0, 1, 1, 17, 26, 23, 20, 0,
- 0, 5, 0, 17, 23, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 0,
- 7, 7, 1, 0, 11, 1, 0, 0,
- 1, 9, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 7, 0, 1, 0, 9, 1,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 29, 0, 13,
- 0, 15, 0, 1, 29, 0, 13, 0,
- 0, 15, 0, 0, 0
-};
-
-static const char _tmsrp_machine_parser_uri_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 29, 13, 15,
- 15, 29, 13, 15, 15, 15, 15, 15,
- 15
-};
-
-static const int tmsrp_machine_parser_uri_start = 1;
-static const int tmsrp_machine_parser_uri_first_final = 101;
-static const int tmsrp_machine_parser_uri_error = 0;
-
-static const int tmsrp_machine_parser_uri_en_main = 1;
-
-
-/* #line 120 "./ragel/tmsrp_parser_uri.rl" */
- (void)(eof);
- (void)(tmsrp_machine_parser_uri_first_final);
- (void)(tmsrp_machine_parser_uri_error);
- (void)(tmsrp_machine_parser_uri_en_main);
-
-/* #line 439 "./src/parsers/tmsrp_parser_uri.c" */
- {
- cs = tmsrp_machine_parser_uri_start;
- }
-
-/* #line 125 "./ragel/tmsrp_parser_uri.rl" */
-
-/* #line 446 "./src/parsers/tmsrp_parser_uri.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tmsrp_uri_t *uri = tmsrp_uri_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 54 "./src/parsers/tmsrp_parser_uri.c" */
+ static const char _tmsrp_machine_parser_uri_actions[] = {
+ 0, 1, 0, 1, 4, 1, 5, 1,
+ 6, 1, 7, 1, 8, 1, 9, 1,
+ 10, 2, 0, 1, 2, 0, 2, 2,
+ 0, 3, 2, 0, 5, 2, 0, 9
+
+ };
+
+ static const short _tmsrp_machine_parser_uri_key_offsets[] = {
+ 0, 0, 1, 2, 3, 4, 6, 7,
+ 8, 25, 39, 45, 51, 58, 61, 63,
+ 66, 68, 71, 73, 78, 90, 103, 117,
+ 131, 136, 139, 141, 145, 148, 149, 152,
+ 153, 156, 157, 168, 175, 184, 192, 199,
+ 205, 212, 220, 228, 236, 238, 245, 254,
+ 256, 259, 261, 264, 266, 269, 272, 273,
+ 276, 277, 280, 281, 290, 299, 307, 315,
+ 323, 331, 333, 339, 348, 357, 366, 368,
+ 371, 374, 375, 376, 393, 409, 426, 442,
+ 459, 475, 492, 509, 524, 540, 557, 577,
+ 597, 614, 629, 646, 661, 678, 693, 712,
+ 729, 746, 764, 781, 797, 798, 805, 812,
+ 828, 843, 859, 875, 895, 917, 939, 959,
+ 980
+ };
+
+ static const char _tmsrp_machine_parser_uri_trans_keys[] = {
+ 109, 115, 114, 112, 58, 115, 47, 47,
+ 33, 37, 61, 64, 91, 95, 126, 36,
+ 46, 48, 57, 58, 59, 65, 90, 97,
+ 122, 33, 37, 61, 64, 95, 126, 36,
+ 46, 48, 59, 65, 90, 97, 122, 48,
+ 57, 65, 70, 97, 102, 48, 57, 65,
+ 70, 97, 102, 91, 48, 57, 65, 90,
+ 97, 122, 46, 48, 57, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 47, 58, 59, 48, 57, 33, 61,
+ 95, 126, 39, 43, 45, 57, 65, 90,
+ 97, 122, 33, 59, 61, 95, 126, 39,
+ 43, 45, 57, 65, 90, 97, 122, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 47, 58, 59, 48, 57,
+ 47, 58, 59, 48, 57, 47, 59, 48,
+ 57, 46, 48, 57, 46, 46, 48, 57,
+ 46, 46, 48, 57, 46, 45, 46, 47,
+ 58, 59, 48, 57, 65, 90, 97, 122,
+ 45, 48, 57, 65, 90, 97, 122, 47,
+ 58, 59, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 48, 57, 65, 90, 97, 122, 48,
+ 57, 65, 90, 97, 122, 58, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 48, 57, 46, 48, 57,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 46, 48, 57, 46, 46, 48, 57,
+ 46, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 46, 48, 57, 46, 58,
+ 33, 37, 46, 61, 64, 95, 126, 36,
+ 45, 48, 57, 58, 59, 65, 90, 97,
+ 122, 33, 37, 61, 64, 95, 126, 36,
+ 46, 48, 57, 58, 59, 65, 90, 97,
+ 122, 33, 37, 46, 61, 64, 95, 126,
+ 36, 45, 48, 57, 58, 59, 65, 90,
+ 97, 122, 33, 37, 61, 64, 95, 126,
+ 36, 46, 48, 57, 58, 59, 65, 90,
+ 97, 122, 33, 37, 46, 61, 64, 95,
+ 126, 36, 45, 48, 57, 58, 59, 65,
+ 90, 97, 122, 33, 37, 61, 64, 95,
+ 126, 36, 46, 48, 57, 58, 59, 65,
+ 90, 97, 122, 33, 37, 47, 58, 59,
+ 61, 64, 95, 126, 36, 46, 48, 57,
+ 65, 90, 97, 122, 33, 37, 47, 58,
+ 59, 61, 64, 95, 126, 36, 46, 48,
+ 57, 65, 90, 97, 122, 33, 37, 47,
+ 58, 59, 61, 64, 95, 126, 36, 57,
+ 65, 90, 97, 122, 33, 37, 61, 64,
+ 95, 126, 36, 46, 48, 57, 58, 59,
+ 65, 90, 97, 122, 33, 37, 47, 58,
+ 59, 61, 64, 95, 126, 36, 46, 48,
+ 57, 65, 90, 97, 122, 33, 37, 39,
+ 44, 61, 64, 96, 126, 36, 41, 42,
+ 46, 48, 57, 58, 59, 65, 90, 95,
+ 122, 33, 37, 39, 44, 61, 64, 96,
+ 126, 36, 41, 42, 46, 48, 57, 58,
+ 59, 65, 90, 95, 122, 33, 37, 46,
+ 61, 64, 95, 126, 36, 45, 48, 57,
+ 58, 59, 65, 90, 97, 122, 33, 37,
+ 46, 61, 64, 95, 126, 36, 45, 48,
+ 59, 65, 90, 97, 122, 33, 37, 46,
+ 61, 64, 95, 126, 36, 45, 48, 57,
+ 58, 59, 65, 90, 97, 122, 33, 37,
+ 46, 61, 64, 95, 126, 36, 45, 48,
+ 59, 65, 90, 97, 122, 33, 37, 46,
+ 61, 64, 95, 126, 36, 45, 48, 57,
+ 58, 59, 65, 90, 97, 122, 33, 37,
+ 46, 61, 64, 95, 126, 36, 45, 48,
+ 59, 65, 90, 97, 122, 33, 37, 45,
+ 46, 47, 58, 59, 61, 64, 95, 126,
+ 36, 44, 48, 57, 65, 90, 97, 122,
+ 33, 37, 45, 61, 64, 95, 126, 36,
+ 46, 48, 57, 58, 59, 65, 90, 97,
+ 122, 33, 37, 47, 58, 59, 61, 64,
+ 95, 126, 36, 46, 48, 57, 65, 90,
+ 97, 122, 33, 37, 45, 46, 61, 64,
+ 95, 126, 36, 44, 48, 57, 58, 59,
+ 65, 90, 97, 122, 33, 37, 45, 61,
+ 64, 95, 126, 36, 46, 48, 57, 58,
+ 59, 65, 90, 97, 122, 33, 37, 61,
+ 64, 95, 126, 36, 46, 48, 57, 58,
+ 59, 65, 90, 97, 122, 58, 59, 48,
+ 57, 65, 90, 97, 122, 59, 48, 57,
+ 65, 90, 97, 122, 33, 37, 39, 59,
+ 61, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 33, 37, 39, 59,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 33, 37, 58, 59, 61,
+ 64, 95, 126, 36, 46, 48, 57, 65,
+ 90, 97, 122, 33, 37, 58, 59, 61,
+ 64, 95, 126, 36, 46, 48, 57, 65,
+ 90, 97, 122, 33, 37, 39, 44, 58,
+ 59, 61, 64, 96, 126, 36, 41, 42,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 59, 61, 126, 42, 43, 45,
+ 46, 48, 57, 65, 70, 71, 90, 95,
+ 96, 97, 102, 103, 122, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 70, 71, 90, 95, 96, 97,
+ 102, 103, 122, 33, 37, 39, 44, 58,
+ 59, 61, 64, 96, 126, 36, 41, 42,
+ 46, 48, 57, 65, 90, 95, 122, 33,
+ 37, 39, 59, 126, 42, 43, 45, 46,
+ 48, 57, 65, 70, 71, 90, 95, 96,
+ 97, 102, 103, 122, 33, 37, 39, 59,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 70, 71, 90, 95, 96, 97, 102, 103,
+ 122, 0
+ };
+
+ static const char _tmsrp_machine_parser_uri_single_lengths[] = {
+ 0, 1, 1, 1, 1, 2, 1, 1,
+ 7, 6, 0, 0, 1, 1, 0, 1,
+ 0, 1, 0, 3, 4, 5, 4, 4,
+ 3, 3, 0, 2, 1, 1, 1, 1,
+ 1, 1, 5, 1, 3, 2, 1, 0,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 2, 2, 2,
+ 2, 2, 0, 3, 3, 3, 0, 1,
+ 1, 1, 1, 7, 6, 7, 6, 7,
+ 6, 9, 9, 9, 6, 9, 8, 8,
+ 7, 7, 7, 7, 7, 7, 11, 7,
+ 9, 8, 7, 6, 1, 1, 1, 6,
+ 5, 8, 8, 10, 6, 6, 10, 5,
+ 5
+ };
+
+ static const char _tmsrp_machine_parser_uri_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 4, 3, 3, 3, 1, 1, 1,
+ 1, 1, 1, 1, 4, 4, 5, 5,
+ 1, 0, 1, 1, 1, 0, 1, 0,
+ 1, 0, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 1, 0, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 1, 1,
+ 1, 0, 0, 5, 5, 5, 5, 5,
+ 5, 4, 4, 3, 5, 4, 6, 6,
+ 5, 4, 5, 4, 5, 4, 4, 5,
+ 4, 5, 5, 5, 0, 3, 3, 5,
+ 5, 4, 4, 5, 8, 8, 5, 8,
+ 8
+ };
+
+ static const short _tmsrp_machine_parser_uri_index_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 13,
+ 15, 28, 39, 43, 47, 52, 55, 57,
+ 60, 62, 65, 67, 72, 81, 91, 101,
+ 111, 116, 120, 122, 126, 129, 131, 134,
+ 136, 139, 141, 150, 155, 162, 168, 173,
+ 177, 182, 188, 194, 200, 203, 208, 215,
+ 217, 220, 222, 225, 227, 230, 233, 235,
+ 238, 240, 243, 245, 252, 259, 265, 271,
+ 277, 283, 286, 290, 297, 304, 311, 313,
+ 316, 319, 321, 323, 336, 348, 361, 373,
+ 386, 398, 412, 426, 439, 451, 465, 480,
+ 495, 508, 520, 533, 545, 558, 570, 586,
+ 599, 613, 627, 640, 652, 654, 659, 664,
+ 676, 687, 700, 713, 729, 744, 759, 775,
+ 789
+ };
+
+ static const unsigned char _tmsrp_machine_parser_uri_indicies[] = {
+ 0, 1, 2, 1, 3, 1, 4, 1,
+ 5, 6, 1, 7, 1, 8, 1, 9,
+ 10, 9, 12, 14, 9, 9, 9, 11,
+ 9, 13, 13, 1, 15, 16, 15, 17,
+ 15, 15, 15, 15, 15, 15, 1, 18,
+ 18, 18, 1, 15, 15, 15, 1, 14,
+ 19, 20, 20, 1, 21, 22, 1, 23,
+ 1, 24, 25, 1, 26, 1, 27, 28,
+ 1, 29, 1, 30, 32, 33, 31, 1,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 1, 35, 36, 35, 35, 35, 35, 35,
+ 35, 35, 1, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 1, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 1, 30,
+ 32, 33, 39, 1, 30, 32, 33, 1,
+ 40, 1, 41, 43, 42, 1, 27, 44,
+ 1, 27, 1, 24, 45, 1, 24, 1,
+ 21, 46, 1, 21, 1, 47, 48, 30,
+ 32, 33, 49, 49, 49, 1, 47, 49,
+ 49, 49, 1, 30, 32, 33, 50, 49,
+ 49, 1, 51, 52, 50, 50, 50, 1,
+ 51, 50, 50, 50, 1, 50, 49, 49,
+ 1, 54, 53, 53, 53, 1, 56, 39,
+ 55, 55, 55, 1, 56, 39, 57, 57,
+ 57, 1, 56, 39, 58, 58, 58, 1,
+ 56, 39, 1, 60, 59, 53, 53, 1,
+ 61, 56, 39, 62, 55, 55, 1, 63,
+ 1, 64, 65, 1, 66, 1, 67, 68,
+ 1, 69, 1, 39, 70, 1, 39, 71,
+ 1, 39, 1, 67, 72, 1, 67, 1,
+ 64, 73, 1, 64, 1, 61, 56, 39,
+ 74, 57, 57, 1, 61, 56, 39, 58,
+ 58, 58, 1, 76, 39, 75, 75, 75,
+ 1, 78, 39, 77, 77, 77, 1, 78,
+ 39, 79, 79, 79, 1, 78, 39, 80,
+ 80, 80, 1, 78, 39, 1, 81, 75,
+ 75, 1, 61, 78, 39, 82, 77, 77,
+ 1, 61, 78, 39, 83, 79, 79, 1,
+ 61, 78, 39, 80, 80, 80, 1, 84,
+ 1, 61, 85, 1, 61, 86, 1, 61,
+ 1, 60, 1, 15, 16, 87, 15, 17,
+ 15, 15, 15, 88, 15, 15, 15, 1,
+ 15, 16, 15, 17, 15, 15, 15, 89,
+ 15, 15, 15, 1, 15, 16, 90, 15,
+ 17, 15, 15, 15, 91, 15, 15, 15,
+ 1, 15, 16, 15, 17, 15, 15, 15,
+ 92, 15, 15, 15, 1, 15, 16, 93,
+ 15, 17, 15, 15, 15, 94, 15, 15,
+ 15, 1, 15, 16, 15, 17, 15, 15,
+ 15, 95, 15, 15, 15, 1, 15, 16,
+ 30, 97, 98, 15, 17, 15, 15, 15,
+ 96, 15, 15, 1, 15, 16, 30, 97,
+ 98, 15, 17, 15, 15, 15, 99, 15,
+ 15, 1, 15, 16, 30, 97, 98, 15,
+ 17, 15, 15, 15, 15, 15, 1, 15,
+ 16, 15, 17, 15, 15, 15, 100, 15,
+ 15, 15, 1, 15, 16, 41, 15, 102,
+ 15, 17, 15, 15, 15, 101, 15, 15,
+ 1, 103, 104, 103, 15, 15, 17, 37,
+ 103, 15, 103, 103, 15, 103, 103, 1,
+ 105, 106, 105, 15, 15, 17, 38, 105,
+ 15, 105, 105, 15, 105, 105, 1, 15,
+ 16, 93, 15, 17, 15, 15, 15, 107,
+ 15, 15, 15, 1, 15, 16, 93, 15,
+ 17, 15, 15, 15, 15, 15, 15, 1,
+ 15, 16, 90, 15, 17, 15, 15, 15,
+ 108, 15, 15, 15, 1, 15, 16, 90,
+ 15, 17, 15, 15, 15, 15, 15, 15,
+ 1, 15, 16, 87, 15, 17, 15, 15,
+ 15, 109, 15, 15, 15, 1, 15, 16,
+ 87, 15, 17, 15, 15, 15, 15, 15,
+ 15, 1, 15, 16, 110, 111, 30, 97,
+ 98, 15, 17, 15, 15, 15, 112, 112,
+ 112, 1, 15, 16, 110, 15, 17, 15,
+ 15, 15, 112, 15, 112, 112, 1, 15,
+ 16, 30, 97, 98, 15, 17, 15, 15,
+ 15, 113, 112, 112, 1, 15, 16, 114,
+ 115, 15, 17, 15, 15, 15, 113, 15,
+ 113, 113, 1, 15, 16, 114, 15, 17,
+ 15, 15, 15, 113, 15, 113, 113, 1,
+ 15, 16, 15, 17, 15, 15, 15, 113,
+ 15, 112, 112, 1, 5, 1, 117, 116,
+ 116, 116, 1, 119, 118, 118, 118, 1,
+ 120, 120, 120, 121, 122, 120, 120, 120,
+ 120, 120, 120, 1, 38, 38, 38, 121,
+ 38, 38, 38, 38, 38, 38, 1, 15,
+ 16, 15, 124, 15, 17, 15, 15, 15,
+ 123, 123, 123, 1, 15, 16, 15, 126,
+ 15, 17, 15, 15, 15, 125, 125, 125,
+ 1, 127, 128, 127, 15, 15, 129, 130,
+ 17, 120, 127, 15, 127, 127, 127, 127,
+ 1, 120, 120, 120, 121, 122, 120, 120,
+ 120, 131, 131, 120, 120, 131, 120, 1,
+ 120, 120, 120, 121, 122, 120, 120, 120,
+ 127, 127, 120, 120, 127, 120, 1, 105,
+ 106, 105, 15, 15, 129, 15, 17, 38,
+ 105, 15, 105, 105, 105, 105, 1, 38,
+ 38, 38, 121, 38, 38, 38, 132, 132,
+ 38, 38, 132, 38, 1, 38, 38, 38,
+ 121, 38, 38, 38, 105, 105, 38, 38,
+ 105, 38, 1, 0
+ };
+
+ static const char _tmsrp_machine_parser_uri_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 100, 7,
+ 8, 9, 10, 75, 12, 94, 40, 9,
+ 10, 12, 11, 13, 34, 14, 32, 15,
+ 16, 30, 17, 18, 28, 19, 20, 24,
+ 26, 101, 21, 21, 101, 103, 104, 25,
+ 27, 20, 27, 101, 29, 31, 33, 35,
+ 36, 34, 37, 38, 39, 41, 74, 42,
+ 45, 43, 44, 46, 61, 47, 59, 48,
+ 49, 57, 50, 51, 55, 52, 53, 54,
+ 56, 58, 60, 62, 70, 63, 66, 64,
+ 65, 67, 68, 69, 71, 72, 73, 76,
+ 92, 77, 78, 90, 79, 80, 88, 81,
+ 82, 84, 105, 83, 85, 85, 105, 107,
+ 108, 110, 111, 89, 91, 93, 95, 96,
+ 94, 97, 98, 99, 102, 22, 102, 22,
+ 103, 22, 23, 106, 86, 106, 86, 107,
+ 108, 86, 87, 109, 112
+ };
+
+ static const char _tmsrp_machine_parser_uri_trans_actions[] = {
+ 1, 0, 0, 0, 0, 3, 0, 0,
+ 0, 1, 1, 17, 26, 23, 20, 0,
+ 0, 5, 0, 17, 23, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 0,
+ 7, 7, 1, 0, 11, 1, 0, 0,
+ 1, 9, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 7, 0, 1, 0, 9, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 29, 0, 13,
+ 0, 15, 0, 1, 29, 0, 13, 0,
+ 0, 15, 0, 0, 0
+ };
+
+ static const char _tmsrp_machine_parser_uri_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 29, 13, 15,
+ 15, 29, 13, 15, 15, 15, 15, 15,
+ 15
+ };
+
+ static const int tmsrp_machine_parser_uri_start = 1;
+ static const int tmsrp_machine_parser_uri_first_final = 101;
+ static const int tmsrp_machine_parser_uri_error = 0;
+
+ static const int tmsrp_machine_parser_uri_en_main = 1;
+
+
+ /* #line 120 "./ragel/tmsrp_parser_uri.rl" */
+ (void)(eof);
+ (void)(tmsrp_machine_parser_uri_first_final);
+ (void)(tmsrp_machine_parser_uri_error);
+ (void)(tmsrp_machine_parser_uri_en_main);
+
+ /* #line 439 "./src/parsers/tmsrp_parser_uri.c" */
+ {
+ cs = tmsrp_machine_parser_uri_start;
+ }
+
+ /* #line 125 "./ragel/tmsrp_parser_uri.rl" */
+
+ /* #line 446 "./src/parsers/tmsrp_parser_uri.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tmsrp_machine_parser_uri_trans_keys + _tmsrp_machine_parser_uri_key_offsets[cs];
- _trans = _tmsrp_machine_parser_uri_index_offsets[cs];
-
- _klen = _tmsrp_machine_parser_uri_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tmsrp_machine_parser_uri_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tmsrp_machine_parser_uri_trans_keys + _tmsrp_machine_parser_uri_key_offsets[cs];
+ _trans = _tmsrp_machine_parser_uri_index_offsets[cs];
+
+ _klen = _tmsrp_machine_parser_uri_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tmsrp_machine_parser_uri_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tmsrp_machine_parser_uri_indicies[_trans];
- cs = _tmsrp_machine_parser_uri_trans_targs[_trans];
-
- if ( _tmsrp_machine_parser_uri_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tmsrp_machine_parser_uri_actions + _tmsrp_machine_parser_uri_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_uri.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tmsrp_parser_uri.rl" */
- { uri->authority.host_type = tmsrp_host_ipv4; }
- break;
- case 2:
-/* #line 47 "./ragel/tmsrp_parser_uri.rl" */
- { uri->authority.host_type = tmsrp_host_ipv6; }
- break;
- case 3:
-/* #line 48 "./ragel/tmsrp_parser_uri.rl" */
- { uri->authority.host_type = tmsrp_host_hostname; }
- break;
- case 4:
-/* #line 50 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->scheme);
- }
- break;
- case 5:
-/* #line 54 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->authority.userinfo);
- }
- break;
- case 6:
-/* #line 58 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->authority.host);
- if(uri->authority.host_type == tmsrp_host_ipv6){
- tsk_strunquote_2(&uri->authority.host, '[', ']');
- }
- }
- break;
- case 7:
-/* #line 65 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_INT(uri->authority.port);
- }
- break;
- case 8:
-/* #line 69 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->session_id);
- }
- break;
- case 9:
-/* #line 73 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->transport);
- }
- break;
- case 10:
-/* #line 77 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_ADD_PARAM(uri->params);
- }
- break;
-/* #line 583 "./src/parsers/tmsrp_parser_uri.c" */
- }
- }
+ _trans = _tmsrp_machine_parser_uri_indicies[_trans];
+ cs = _tmsrp_machine_parser_uri_trans_targs[_trans];
+
+ if ( _tmsrp_machine_parser_uri_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tmsrp_machine_parser_uri_actions + _tmsrp_machine_parser_uri_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ uri->authority.host_type = tmsrp_host_ipv4;
+ }
+ break;
+ case 2:
+ /* #line 47 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ uri->authority.host_type = tmsrp_host_ipv6;
+ }
+ break;
+ case 3:
+ /* #line 48 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ uri->authority.host_type = tmsrp_host_hostname;
+ }
+ break;
+ case 4:
+ /* #line 50 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->scheme);
+ }
+ break;
+ case 5:
+ /* #line 54 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->authority.userinfo);
+ }
+ break;
+ case 6:
+ /* #line 58 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->authority.host);
+ if(uri->authority.host_type == tmsrp_host_ipv6) {
+ tsk_strunquote_2(&uri->authority.host, '[', ']');
+ }
+ }
+ break;
+ case 7:
+ /* #line 65 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_INT(uri->authority.port);
+ }
+ break;
+ case 8:
+ /* #line 69 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->session_id);
+ }
+ break;
+ case 9:
+ /* #line 73 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->transport);
+ }
+ break;
+ case 10:
+ /* #line 77 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(uri->params);
+ }
+ break;
+ /* #line 583 "./src/parsers/tmsrp_parser_uri.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tmsrp_machine_parser_uri_actions + _tmsrp_machine_parser_uri_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tmsrp_parser_uri.rl" */
- {
- tag_start = p;
- }
- break;
- case 9:
-/* #line 73 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->transport);
- }
- break;
- case 10:
-/* #line 77 "./ragel/tmsrp_parser_uri.rl" */
- {
- TSK_PARSER_ADD_PARAM(uri->params);
- }
- break;
-/* #line 617 "./src/parsers/tmsrp_parser_uri.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 126 "./ragel/tmsrp_parser_uri.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 629 "./src/parsers/tmsrp_parser_uri.c" */
-101
-/* #line 128 "./ragel/tmsrp_parser_uri.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse MSRP/MSRPS header.");
- TSK_OBJECT_SAFE_FREE(uri);
- }
-
- return uri;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tmsrp_machine_parser_uri_actions + _tmsrp_machine_parser_uri_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 9:
+ /* #line 73 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->transport);
+ }
+ break;
+ case 10:
+ /* #line 77 "./ragel/tmsrp_parser_uri.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(uri->params);
+ }
+ break;
+ /* #line 617 "./src/parsers/tmsrp_parser_uri.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 126 "./ragel/tmsrp_parser_uri.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 629 "./src/parsers/tmsrp_parser_uri.c" */
+ 101
+ /* #line 128 "./ragel/tmsrp_parser_uri.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse MSRP/MSRPS header.");
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+
+ return uri;
} \ No newline at end of file
diff --git a/tinyMSRP/src/session/tmsrp_config.c b/tinyMSRP/src/session/tmsrp_config.c
index 4394bf0..3810097 100755
--- a/tinyMSRP/src/session/tmsrp_config.c
+++ b/tinyMSRP/src/session/tmsrp_config.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,7 +34,7 @@
TINYMSRP_API tmsrp_config_t* tmsrp_config_create()
{
- return tsk_object_new(tmsrp_config_def_t);
+ return tsk_object_new(tmsrp_config_def_t);
}
@@ -53,30 +53,29 @@ TINYMSRP_API tmsrp_config_t* tmsrp_config_create()
//
static void* tmsrp_config_ctor(tsk_object_t * self, va_list * app)
{
- tmsrp_config_t *config = self;
- if(config){
- config->Failure_Report = tsk_true;
- }
- return self;
+ tmsrp_config_t *config = self;
+ if(config) {
+ config->Failure_Report = tsk_true;
+ }
+ return self;
}
static void* tmsrp_config_dtor(tsk_object_t * self)
-{
- tmsrp_config_t *config = self;
- if(config){
- TSK_OBJECT_SAFE_FREE(config->From_Path);
- TSK_OBJECT_SAFE_FREE(config->To_Path);
- }
-
- return self;
+{
+ tmsrp_config_t *config = self;
+ if(config) {
+ TSK_OBJECT_SAFE_FREE(config->From_Path);
+ TSK_OBJECT_SAFE_FREE(config->To_Path);
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_config_def_s =
-{
- sizeof(tmsrp_config_t),
- tmsrp_config_ctor,
- tmsrp_config_dtor,
- tsk_null,
+static const tsk_object_def_t tmsrp_config_def_s = {
+ sizeof(tmsrp_config_t),
+ tmsrp_config_ctor,
+ tmsrp_config_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmsrp_config_def_t = &tmsrp_config_def_s;
diff --git a/tinyMSRP/src/session/tmsrp_data.c b/tinyMSRP/src/session/tmsrp_data.c
index e8c750e..d872da1 100755
--- a/tinyMSRP/src/session/tmsrp_data.c
+++ b/tinyMSRP/src/session/tmsrp_data.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,38 +43,38 @@
tmsrp_data_in_t* tmsrp_data_in_create()
{
- return tsk_object_new(tmsrp_data_in_def_t);
+ return tsk_object_new(tmsrp_data_in_def_t);
}
tmsrp_data_out_t* _tmsrp_data_out_create(const void* pdata, tsk_size_t size, tsk_bool_t isfilepath)
{
- return tsk_object_new(tmsrp_data_out_def_t, pdata, size, isfilepath);
+ return tsk_object_new(tmsrp_data_out_def_t, pdata, size, isfilepath);
}
tmsrp_data_out_t* tmsrp_data_out_create(const void* pdata, tsk_size_t size)
-{
- return _tmsrp_data_out_create(pdata, size, tsk_false);
+{
+ return _tmsrp_data_out_create(pdata, size, tsk_false);
}
tmsrp_data_out_t* tmsrp_data_out_file_create(const char* filepath)
{
- return _tmsrp_data_out_create(filepath, tsk_strlen(filepath), tsk_true);
+ return _tmsrp_data_out_create(filepath, tsk_strlen(filepath), tsk_true);
}
/* =========================== Common ============================= */
static int tmsrp_data_deinit(tmsrp_data_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_FREE(self->id);
- TSK_FREE(self->ctype);
- TSK_FREE(self->wctype);
+ TSK_FREE(self->id);
+ TSK_FREE(self->ctype);
+ TSK_FREE(self->wctype);
- return 0;
+ return 0;
}
@@ -87,45 +87,45 @@ static int tmsrp_data_deinit(tmsrp_data_t* self)
int tmsrp_data_in_put(tmsrp_data_in_t* self, const void* pdata, tsk_size_t size)
{
- int ret = -1;
-
- if(!self || !self->buffer || !pdata || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return ret;
- }
-
- if((ret = tsk_buffer_append(self->buffer, pdata, size))){
- TSK_DEBUG_ERROR("Failed to append data");
- tsk_buffer_cleanup(self->buffer);
- return ret;
- }
- else{
- if(TSK_BUFFER_SIZE(self->buffer) > TMSRP_DATA_IN_MAX_BUFFER){
- tsk_buffer_cleanup(self->buffer);
- TSK_DEBUG_ERROR("Too many bytes are waiting.");
- return -3;
- }
- }
-
- return ret;
+ int ret = -1;
+
+ if(!self || !self->buffer || !pdata || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return ret;
+ }
+
+ if((ret = tsk_buffer_append(self->buffer, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to append data");
+ tsk_buffer_cleanup(self->buffer);
+ return ret;
+ }
+ else {
+ if(TSK_BUFFER_SIZE(self->buffer) > TMSRP_DATA_IN_MAX_BUFFER) {
+ tsk_buffer_cleanup(self->buffer);
+ TSK_DEBUG_ERROR("Too many bytes are waiting.");
+ return -3;
+ }
+ }
+
+ return ret;
}
tmsrp_message_t* tmsrp_data_in_get(tmsrp_data_in_t* self)
{
- tmsrp_message_t* ret;
- tsk_size_t msg_size;
+ tmsrp_message_t* ret;
+ tsk_size_t msg_size;
- if(!self || !self->buffer || !TSK_BUFFER_DATA(self->buffer) || !TSK_BUFFER_SIZE(self->buffer)){
- //...this is not an error
- return tsk_null;
- }
+ if(!self || !self->buffer || !TSK_BUFFER_DATA(self->buffer) || !TSK_BUFFER_SIZE(self->buffer)) {
+ //...this is not an error
+ return tsk_null;
+ }
- if((ret = tmsrp_message_parse_2(self->buffer->data, self->buffer->size, &msg_size))){
- tsk_buffer_remove(self->buffer, 0, msg_size);
- return ret;
- }
+ if((ret = tmsrp_message_parse_2(self->buffer->data, self->buffer->size, &msg_size))) {
+ tsk_buffer_remove(self->buffer, 0, msg_size);
+ return ret;
+ }
- return tsk_null;
+ return tsk_null;
}
@@ -133,38 +133,38 @@ tmsrp_message_t* tmsrp_data_in_get(tmsrp_data_in_t* self)
tsk_buffer_t* tmsrp_data_out_get(tmsrp_data_out_t* self)
{
- tsk_buffer_t* ret = tsk_null;
- tsk_size_t toread;
-
- if(!self){
- return tsk_null;
- }
-
- if(!(toread = self->size > TMSRP_MAX_CHUNK_SIZE ? TMSRP_MAX_CHUNK_SIZE : self->size)){
- return tsk_null;
- }
-
- if(self->message){
- ret = tsk_buffer_create(TSK_BUFFER_DATA(self->message), toread);
- tsk_buffer_remove(self->message, 0, toread);
- self->size = self->message->size;
- }
- else if(self->file){
- // Buffer hack
- tsk_size_t read;
- ret = tsk_buffer_create_null();
- ret->data = tsk_calloc(toread, sizeof(uint8_t));
- ret->size = toread;
- if((read = (tsk_size_t)fread(ret->data, sizeof(uint8_t), toread, self->file)) == toread){
- self->size -= toread;
- }
- else{
- TSK_OBJECT_SAFE_FREE(ret);
- }
- }
-
-
- return ret;
+ tsk_buffer_t* ret = tsk_null;
+ tsk_size_t toread;
+
+ if(!self) {
+ return tsk_null;
+ }
+
+ if(!(toread = self->size > TMSRP_MAX_CHUNK_SIZE ? TMSRP_MAX_CHUNK_SIZE : self->size)) {
+ return tsk_null;
+ }
+
+ if(self->message) {
+ ret = tsk_buffer_create(TSK_BUFFER_DATA(self->message), toread);
+ tsk_buffer_remove(self->message, 0, toread);
+ self->size = self->message->size;
+ }
+ else if(self->file) {
+ // Buffer hack
+ tsk_size_t read;
+ ret = tsk_buffer_create_null();
+ ret->data = tsk_calloc(toread, sizeof(uint8_t));
+ ret->size = toread;
+ if((read = (tsk_size_t)fread(ret->data, sizeof(uint8_t), toread, self->file)) == toread) {
+ self->size -= toread;
+ }
+ else {
+ TSK_OBJECT_SAFE_FREE(ret);
+ }
+ }
+
+
+ return ret;
}
@@ -179,30 +179,29 @@ tsk_buffer_t* tmsrp_data_out_get(tmsrp_data_out_t* self)
//
static void* tmsrp_data_in_ctor(tsk_object_t * self, va_list * app)
{
- tmsrp_data_in_t *data_in = self;
- if(data_in){
- data_in->buffer = tsk_buffer_create_null();
- }
- return self;
+ tmsrp_data_in_t *data_in = self;
+ if(data_in) {
+ data_in->buffer = tsk_buffer_create_null();
+ }
+ return self;
}
static void* tmsrp_data_in_dtor(tsk_object_t * self)
-{
- tmsrp_data_in_t *data_in = self;
- if(data_in){
- tmsrp_data_deinit(TMSRP_DATA(data_in));
- TSK_OBJECT_SAFE_FREE(data_in->buffer);
- }
-
- return self;
+{
+ tmsrp_data_in_t *data_in = self;
+ if(data_in) {
+ tmsrp_data_deinit(TMSRP_DATA(data_in));
+ TSK_OBJECT_SAFE_FREE(data_in->buffer);
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_data_in_def_s =
-{
- sizeof(tmsrp_data_in_t),
- tmsrp_data_in_ctor,
- tmsrp_data_in_dtor,
- tsk_null,
+static const tsk_object_def_t tmsrp_data_in_def_s = {
+ sizeof(tmsrp_data_in_t),
+ tmsrp_data_in_ctor,
+ tmsrp_data_in_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmsrp_data_in_def_t = &tmsrp_data_in_def_s;
@@ -211,74 +210,73 @@ const tsk_object_def_t *tmsrp_data_in_def_t = &tmsrp_data_in_def_s;
//
static void* tmsrp_data_out_ctor(tsk_object_t * self, va_list * app)
{
- tmsrp_data_out_t *data_out = self;
- if(data_out){
- tsk_istr_t id;
- const void* pdata = va_arg(*app, const void*);
- tsk_size_t size = va_arg(*app, tsk_size_t);
- tsk_bool_t isfilepath = va_arg(*app, tsk_bool_t);
-
- if(isfilepath){
- if((data_out->file = fopen((const char*)pdata, "rb"))){
- int ret;
- if((ret = fseek(data_out->file, 0L, SEEK_END))){
- TSK_DEBUG_ERROR("fseek for file:[%s] failed with error code %d.", (const char*)pdata, ret);
- TMSRP_DATA(data_out)->isOK = tsk_false;
- }
- else{
- data_out->size = ftell(data_out->file);
- if((ret = fseek(data_out->file, 0L, SEEK_SET))){
- TSK_DEBUG_ERROR("fseek for file:[%s] failed with error code %d.", (const char*)pdata, ret);
- TMSRP_DATA(data_out)->isOK = tsk_false;
- }
- else{
- TMSRP_DATA(data_out)->isOK = tsk_true;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to open(rb) this file:[%s]", (const char*)pdata);
- TMSRP_DATA(data_out)->isOK = tsk_false;
- }
- }
- else{
- if((data_out->message = tsk_buffer_create(pdata, size))){
- TMSRP_DATA(data_out)->isOK = (data_out->message->size == size);
- data_out->size = data_out->message->size;
- }
- }
-
- // content type
- TMSRP_DATA(data_out)->ctype = tsk_strdup("application/octet-stream");
- TMSRP_DATA(data_out)->wctype = tsk_strdup("text/plain");
- // random id
- tsk_strrandom(&id);
- TMSRP_DATA(data_out)->id = tsk_strdup(id);
- }
- return self;
+ tmsrp_data_out_t *data_out = self;
+ if(data_out) {
+ tsk_istr_t id;
+ const void* pdata = va_arg(*app, const void*);
+ tsk_size_t size = va_arg(*app, tsk_size_t);
+ tsk_bool_t isfilepath = va_arg(*app, tsk_bool_t);
+
+ if(isfilepath) {
+ if((data_out->file = fopen((const char*)pdata, "rb"))) {
+ int ret;
+ if((ret = fseek(data_out->file, 0L, SEEK_END))) {
+ TSK_DEBUG_ERROR("fseek for file:[%s] failed with error code %d.", (const char*)pdata, ret);
+ TMSRP_DATA(data_out)->isOK = tsk_false;
+ }
+ else {
+ data_out->size = ftell(data_out->file);
+ if((ret = fseek(data_out->file, 0L, SEEK_SET))) {
+ TSK_DEBUG_ERROR("fseek for file:[%s] failed with error code %d.", (const char*)pdata, ret);
+ TMSRP_DATA(data_out)->isOK = tsk_false;
+ }
+ else {
+ TMSRP_DATA(data_out)->isOK = tsk_true;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to open(rb) this file:[%s]", (const char*)pdata);
+ TMSRP_DATA(data_out)->isOK = tsk_false;
+ }
+ }
+ else {
+ if((data_out->message = tsk_buffer_create(pdata, size))) {
+ TMSRP_DATA(data_out)->isOK = (data_out->message->size == size);
+ data_out->size = data_out->message->size;
+ }
+ }
+
+ // content type
+ TMSRP_DATA(data_out)->ctype = tsk_strdup("application/octet-stream");
+ TMSRP_DATA(data_out)->wctype = tsk_strdup("text/plain");
+ // random id
+ tsk_strrandom(&id);
+ TMSRP_DATA(data_out)->id = tsk_strdup(id);
+ }
+ return self;
}
static void* tmsrp_data_out_dtor(tsk_object_t * self)
-{
- tmsrp_data_out_t *data_out = self;
- if(data_out){
- tmsrp_data_deinit(TMSRP_DATA(data_out));
- TSK_OBJECT_SAFE_FREE(data_out->message);
-
- if(data_out->file){
- fclose(data_out->file);
- data_out->file = tsk_null;
- }
- }
-
- return self;
+{
+ tmsrp_data_out_t *data_out = self;
+ if(data_out) {
+ tmsrp_data_deinit(TMSRP_DATA(data_out));
+ TSK_OBJECT_SAFE_FREE(data_out->message);
+
+ if(data_out->file) {
+ fclose(data_out->file);
+ data_out->file = tsk_null;
+ }
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_data_out_def_s =
-{
- sizeof(tmsrp_data_out_t),
- tmsrp_data_out_ctor,
- tmsrp_data_out_dtor,
- tsk_null,
+static const tsk_object_def_t tmsrp_data_out_def_s = {
+ sizeof(tmsrp_data_out_t),
+ tmsrp_data_out_ctor,
+ tmsrp_data_out_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmsrp_data_out_def_t = &tmsrp_data_out_def_s;
diff --git a/tinyMSRP/src/session/tmsrp_receiver.c b/tinyMSRP/src/session/tmsrp_receiver.c
index 3ec1333..3a15780 100755
--- a/tinyMSRP/src/session/tmsrp_receiver.c
+++ b/tinyMSRP/src/session/tmsrp_receiver.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,125 +39,125 @@
static void _tmsrp_receiver_alert_user(tmsrp_receiver_t* self, tsk_bool_t outgoing, tmsrp_message_t* message)
{
- if(self->callback.func){
- tmsrp_event_t* _event = tmsrp_event_create(self->callback.data, outgoing, tmsrp_event_type_message, message);
- self->callback.func(_event);
- TSK_OBJECT_SAFE_FREE(_event);
- }
+ if(self->callback.func) {
+ tmsrp_event_t* _event = tmsrp_event_create(self->callback.data, outgoing, tmsrp_event_type_message, message);
+ self->callback.func(_event);
+ TSK_OBJECT_SAFE_FREE(_event);
+ }
}
tmsrp_receiver_t* tmsrp_receiver_create(tmsrp_config_t* config, tnet_fd_t fd)
{
- return tsk_object_new(tmsrp_receiver_def_t, config, fd);
+ return tsk_object_new(tmsrp_receiver_def_t, config, fd);
}
int tmsrp_receiver_set_fd(tmsrp_receiver_t* self, tnet_fd_t fd)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->fd = fd;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->fd = fd;
+ return 0;
}
int tmsrp_receiver_start(tmsrp_receiver_t* self, const void* callback_data, tmsrp_event_cb_f func)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->callback.data = callback_data;
- self->callback.func = func;
+ self->callback.data = callback_data;
+ self->callback.func = func;
- return 0;
+ return 0;
}
int tmsrp_receiver_stop(tmsrp_receiver_t* self)
{
- return 0;
+ return 0;
}
int tmsrp_receiver_recv(tmsrp_receiver_t* self, const void* data, tsk_size_t size)
{
- tmsrp_message_t* message;
-
- if(!self || !data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // put the data
- tmsrp_data_in_put(self->data_in, data, size);
- // get msrp messages
- while((message = tmsrp_data_in_get(self->data_in))){
-
- /* alert that we have received a message (Request or Response) */
- _tmsrp_receiver_alert_user(self, tsk_false, message);
-
- //
- // REQUEST
- //
- if(TMSRP_MESSAGE_IS_REQUEST(message)){
- /* ============= SEND =============== */
- if(TMSRP_REQUEST_IS_SEND(message)){
- tmsrp_response_t* r2xx;
- tmsrp_request_t* REPORT;
-
- // send 200 OK
- if((r2xx = tmsrp_create_response(message, 200, "OK"))){
- if(tmsrp_message_serialize(r2xx, self->buffer) == 0 && self->buffer->data){
- tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
- }
-
- tsk_buffer_cleanup(self->buffer);
- TSK_OBJECT_SAFE_FREE(r2xx);
- }
- // send REPORT
- if(tmsrp_isReportRequired(message, tsk_false)){
- if((REPORT = tmsrp_create_report(message, 200, "OK"))){
- if(tmsrp_message_serialize(REPORT, self->buffer) == 0 && self->buffer->data){
- tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
- }
- tsk_buffer_cleanup(self->buffer);
- TSK_OBJECT_SAFE_FREE(REPORT);
- }
- }
- }
- /* ============= REPORT =============== */
- if(TMSRP_REQUEST_IS_REPORT(message)){
- tmsrp_response_t* r2xx;
-
- // send 200 OK
- if((r2xx = tmsrp_create_response(message, 200, "Report received"))){
- if(tmsrp_message_serialize(r2xx, self->buffer) == 0 && self->buffer->data){
- tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
- }
-
- tsk_buffer_cleanup(self->buffer);
- TSK_OBJECT_SAFE_FREE(r2xx);
- }
- }
-
- /* ============= AUTH =============== */
- /* ============= METHOD =============== */
- }
- //
- // RESPONSE
- //
- else{
- //short code = TMSRP_RESPONSE_CODE(message);
- //TSK_DEBUG_INFO("code=%u, tid=%s, phrase=%s", code, message->tid, TMSRP_RESPONSE_PHRASE(message));
- }
-
-
- // alert user layer
-
- TSK_OBJECT_SAFE_FREE(message);
- }
-
- return 0;
+ tmsrp_message_t* message;
+
+ if(!self || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // put the data
+ tmsrp_data_in_put(self->data_in, data, size);
+ // get msrp messages
+ while((message = tmsrp_data_in_get(self->data_in))) {
+
+ /* alert that we have received a message (Request or Response) */
+ _tmsrp_receiver_alert_user(self, tsk_false, message);
+
+ //
+ // REQUEST
+ //
+ if(TMSRP_MESSAGE_IS_REQUEST(message)) {
+ /* ============= SEND =============== */
+ if(TMSRP_REQUEST_IS_SEND(message)) {
+ tmsrp_response_t* r2xx;
+ tmsrp_request_t* REPORT;
+
+ // send 200 OK
+ if((r2xx = tmsrp_create_response(message, 200, "OK"))) {
+ if(tmsrp_message_serialize(r2xx, self->buffer) == 0 && self->buffer->data) {
+ tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
+ }
+
+ tsk_buffer_cleanup(self->buffer);
+ TSK_OBJECT_SAFE_FREE(r2xx);
+ }
+ // send REPORT
+ if(tmsrp_isReportRequired(message, tsk_false)) {
+ if((REPORT = tmsrp_create_report(message, 200, "OK"))) {
+ if(tmsrp_message_serialize(REPORT, self->buffer) == 0 && self->buffer->data) {
+ tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
+ }
+ tsk_buffer_cleanup(self->buffer);
+ TSK_OBJECT_SAFE_FREE(REPORT);
+ }
+ }
+ }
+ /* ============= REPORT =============== */
+ if(TMSRP_REQUEST_IS_REPORT(message)) {
+ tmsrp_response_t* r2xx;
+
+ // send 200 OK
+ if((r2xx = tmsrp_create_response(message, 200, "Report received"))) {
+ if(tmsrp_message_serialize(r2xx, self->buffer) == 0 && self->buffer->data) {
+ tnet_sockfd_send(self->fd, self->buffer->data, self->buffer->size, 0);
+ }
+
+ tsk_buffer_cleanup(self->buffer);
+ TSK_OBJECT_SAFE_FREE(r2xx);
+ }
+ }
+
+ /* ============= AUTH =============== */
+ /* ============= METHOD =============== */
+ }
+ //
+ // RESPONSE
+ //
+ else {
+ //short code = TMSRP_RESPONSE_CODE(message);
+ //TSK_DEBUG_INFO("code=%u, tid=%s, phrase=%s", code, message->tid, TMSRP_RESPONSE_PHRASE(message));
+ }
+
+
+ // alert user layer
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
+
+ return 0;
}
@@ -166,38 +166,37 @@ int tmsrp_receiver_recv(tmsrp_receiver_t* self, const void* data, tsk_size_t siz
//
static void* tmsrp_receiver_ctor(tsk_object_t * self, va_list *app)
{
- tmsrp_receiver_t *receiver = self;
- if(receiver){
- receiver->config = tsk_object_ref(va_arg(*app, tmsrp_config_t*));
- receiver->fd = va_arg(*app, tnet_fd_t);
-
- receiver->data_in = tmsrp_data_in_create();
- receiver->buffer = tsk_buffer_create_null();
- }
- return self;
+ tmsrp_receiver_t *receiver = self;
+ if(receiver) {
+ receiver->config = tsk_object_ref(va_arg(*app, tmsrp_config_t*));
+ receiver->fd = va_arg(*app, tnet_fd_t);
+
+ receiver->data_in = tmsrp_data_in_create();
+ receiver->buffer = tsk_buffer_create_null();
+ }
+ return self;
}
static void* tmsrp_receiver_dtor(tsk_object_t * self)
-{
- tmsrp_receiver_t *receiver = self;
- if(receiver){
- /* Stop */
- tmsrp_receiver_stop(receiver);
-
- TSK_OBJECT_SAFE_FREE(receiver->config);
- TSK_OBJECT_SAFE_FREE(receiver->data_in);
- TSK_OBJECT_SAFE_FREE(receiver->buffer);
- // the FD is owned by the transport ...do not close it
- }
- return self;
+{
+ tmsrp_receiver_t *receiver = self;
+ if(receiver) {
+ /* Stop */
+ tmsrp_receiver_stop(receiver);
+
+ TSK_OBJECT_SAFE_FREE(receiver->config);
+ TSK_OBJECT_SAFE_FREE(receiver->data_in);
+ TSK_OBJECT_SAFE_FREE(receiver->buffer);
+ // the FD is owned by the transport ...do not close it
+ }
+ return self;
}
-static const tsk_object_def_t tmsrp_receiver_def_s =
-{
- sizeof(tmsrp_receiver_t),
- tmsrp_receiver_ctor,
- tmsrp_receiver_dtor,
- tsk_null,
+static const tsk_object_def_t tmsrp_receiver_def_s = {
+ sizeof(tmsrp_receiver_t),
+ tmsrp_receiver_ctor,
+ tmsrp_receiver_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmsrp_receiver_def_t = &tmsrp_receiver_def_s;
diff --git a/tinyMSRP/src/session/tmsrp_sender.c b/tinyMSRP/src/session/tmsrp_sender.c
index 5fdf86f..1d6637c 100755
--- a/tinyMSRP/src/session/tmsrp_sender.c
+++ b/tinyMSRP/src/session/tmsrp_sender.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,96 +43,96 @@ static void* TSK_STDCALL run(void* self);
tmsrp_sender_t* tmsrp_sender_create(tmsrp_config_t* config, tnet_fd_t fd)
{
- return (tmsrp_sender_t*)tsk_object_new(tmsrp_sender_def_t, config, fd);
+ return (tmsrp_sender_t*)tsk_object_new(tmsrp_sender_def_t, config, fd);
}
int tmsrp_sender_set_fd(tmsrp_sender_t* self, tnet_fd_t fd)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->fd = fd;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->fd = fd;
+ return 0;
}
int tmsrp_sender_start(tmsrp_sender_t* self)
{
- int ret = -1;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- TSK_RUNNABLE(self)->run = run;
- if((ret = tsk_runnable_start(TSK_RUNNABLE(self), tmsrp_data_out_def_t))){
- goto bail;
- }
-
+ int ret = -1;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ TSK_RUNNABLE(self)->run = run;
+ if((ret = tsk_runnable_start(TSK_RUNNABLE(self), tmsrp_data_out_def_t))) {
+ goto bail;
+ }
+
bail:
- return ret;
+ return ret;
}
int tsmrp_sender_send_data(tmsrp_sender_t* self, const void* pdata, tsk_size_t size, const char* ctype, const char* wctype)
{
- tmsrp_data_out_t* data_out;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((data_out = tmsrp_data_out_create(pdata, size))){
- if(ctype){
- tsk_strupdate(&TMSRP_DATA(data_out)->ctype, ctype);
- }
- if(wctype){
- tsk_strupdate(&TMSRP_DATA(data_out)->wctype, wctype);
- }
- TSK_RUNNABLE_ENQUEUE_OBJECT(self, data_out);
- return 0;
- }
- return -2;
+ tmsrp_data_out_t* data_out;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((data_out = tmsrp_data_out_create(pdata, size))) {
+ if(ctype) {
+ tsk_strupdate(&TMSRP_DATA(data_out)->ctype, ctype);
+ }
+ if(wctype) {
+ tsk_strupdate(&TMSRP_DATA(data_out)->wctype, wctype);
+ }
+ TSK_RUNNABLE_ENQUEUE_OBJECT(self, data_out);
+ return 0;
+ }
+ return -2;
}
int tsmrp_sender_send_file(tmsrp_sender_t* self, const char* filepath)
{
- tmsrp_data_out_t* data_out;
-
- if(!self || !filepath){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((data_out = tmsrp_data_out_file_create(filepath))){
- if(TMSRP_DATA(data_out)->isOK){
- TSK_RUNNABLE_ENQUEUE_OBJECT(self, data_out);
- return 0;
- }
- else{
- TSK_OBJECT_SAFE_FREE(data_out);
- return -3;
- }
- }
- return -2;
+ tmsrp_data_out_t* data_out;
+
+ if(!self || !filepath) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((data_out = tmsrp_data_out_file_create(filepath))) {
+ if(TMSRP_DATA(data_out)->isOK) {
+ TSK_RUNNABLE_ENQUEUE_OBJECT(self, data_out);
+ return 0;
+ }
+ else {
+ TSK_OBJECT_SAFE_FREE(data_out);
+ return -3;
+ }
+ }
+ return -2;
}
int tmsrp_sender_stop(tmsrp_sender_t* self)
{
- int ret = -1;
+ int ret = -1;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
- if((ret = tsk_runnable_stop(TSK_RUNNABLE(self)))){
- goto bail;
- }
+ if((ret = tsk_runnable_stop(TSK_RUNNABLE(self)))) {
+ goto bail;
+ }
bail:
- return ret;
+ return ret;
}
@@ -140,109 +140,109 @@ bail:
static void* TSK_STDCALL run(void* self)
{
- tsk_list_item_t *curr;
- tmsrp_sender_t *sender = (tmsrp_sender_t*)self;
- tmsrp_data_out_t *data_out;
- tsk_buffer_t* chunck, *message = tsk_buffer_create_null();
- tsk_size_t start;
- tsk_size_t end;
- tsk_size_t total;
- tsk_istr_t tid;
- int64_t __now = (int64_t)tsk_time_now();
- tsk_bool_t error = tsk_false;
-
- TSK_DEBUG_INFO("MSRP SENDER::run -- START");
-
- TSK_RUNNABLE_RUN_BEGIN(sender);
-
- if((curr = TSK_RUNNABLE_POP_FIRST(sender))){
- if(!(data_out = (tmsrp_data_out_t*)curr->data)){
- continue;
- }
-
- error = tsk_false;
- start = 1;
- total = data_out->size;
-
- while(TSK_RUNNABLE(self)->running && !error && (chunck = tmsrp_data_out_get(data_out))){
- tmsrp_request_t* SEND;
- // set end
- end = (start + chunck->size) - 1;
- // compute new transaction id
- tsk_itoa(++__now, &tid);
- // create SEND request
- SEND = tmsrp_request_create(tid, "SEND");
- // T-Path and From-Path (because of otherURIs)
- SEND->To = tsk_object_ref(sender->config->To_Path);
- SEND->From = tsk_object_ref(sender->config->From_Path);
- // add other headers
- tmsrp_message_add_headers(SEND,
- TMSRP_HEADER_MESSAGE_ID_VA_ARGS(TMSRP_DATA(data_out)->id),
- // TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total), => See below
- TMSRP_HEADER_FAILURE_REPORT_VA_ARGS(sender->config->Failure_Report ? freport_yes : freport_no),
- TMSRP_HEADER_SUCCESS_REPORT_VA_ARGS(sender->config->Success_Report),
-
- tsk_null);
- // add data
- if(start == 1 && chunck->size && tsk_striequals(TMSRP_DATA(data_out)->ctype, "message/CPIM")){
- tsk_buffer_t* content_cpim = tsk_buffer_create_null();
- if(content_cpim){
- tsk_buffer_append_2(content_cpim, "Subject: %s\r\n\r\nContent-Type: %s\r\n\r\n",
- "test", TMSRP_DATA(data_out)->wctype);
- end += content_cpim->size;
- total += content_cpim->size;
- tsk_buffer_append(content_cpim, chunck->data, chunck->size);
- tmsrp_message_add_content(SEND, TMSRP_DATA(data_out)->ctype, content_cpim->data, content_cpim->size);
- TSK_OBJECT_SAFE_FREE(content_cpim);
- }
- else{
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- }
- }
- else{
- tmsrp_message_add_content(SEND, TMSRP_DATA(data_out)->ctype, chunck->data, chunck->size);
- }
- // add byte range here not before: think about message/cpim
- tmsrp_message_add_headers(SEND,
- TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total),
-
- tsk_null);
-
-
- // set continuation flag
- SEND->end_line.cflag = (end == total) ? '$' : '+';
- // serialize and send
- if(!(tmsrp_message_serialize(SEND, message))){
- if(tnet_sockfd_send(sender->fd, message->data, message->size, 0) == 0){
- error = tsk_true;
- // abort
- }
- }
- tsk_buffer_cleanup(message);
-
- // set start
- start = (end + 1);
- // cleanup
- TSK_OBJECT_SAFE_FREE(chunck);
- TSK_OBJECT_SAFE_FREE(SEND);
-
- /* wait */
- if(sender->chunck_duration){
- tsk_thread_sleep(sender->chunck_duration);
- }
- }
-
-
- tsk_object_unref(curr);
- }
-
- TSK_RUNNABLE_RUN_END(self);
-
- TSK_OBJECT_SAFE_FREE(message);
-
- TSK_DEBUG_INFO("MSRP SENDER::run -- STOP");
-
- return 0;
+ tsk_list_item_t *curr;
+ tmsrp_sender_t *sender = (tmsrp_sender_t*)self;
+ tmsrp_data_out_t *data_out;
+ tsk_buffer_t* chunck, *message = tsk_buffer_create_null();
+ tsk_size_t start;
+ tsk_size_t end;
+ tsk_size_t total;
+ tsk_istr_t tid;
+ int64_t __now = (int64_t)tsk_time_now();
+ tsk_bool_t error = tsk_false;
+
+ TSK_DEBUG_INFO("MSRP SENDER::run -- START");
+
+ TSK_RUNNABLE_RUN_BEGIN(sender);
+
+ if((curr = TSK_RUNNABLE_POP_FIRST(sender))) {
+ if(!(data_out = (tmsrp_data_out_t*)curr->data)) {
+ continue;
+ }
+
+ error = tsk_false;
+ start = 1;
+ total = data_out->size;
+
+ while(TSK_RUNNABLE(self)->running && !error && (chunck = tmsrp_data_out_get(data_out))) {
+ tmsrp_request_t* SEND;
+ // set end
+ end = (start + chunck->size) - 1;
+ // compute new transaction id
+ tsk_itoa(++__now, &tid);
+ // create SEND request
+ SEND = tmsrp_request_create(tid, "SEND");
+ // T-Path and From-Path (because of otherURIs)
+ SEND->To = tsk_object_ref(sender->config->To_Path);
+ SEND->From = tsk_object_ref(sender->config->From_Path);
+ // add other headers
+ tmsrp_message_add_headers(SEND,
+ TMSRP_HEADER_MESSAGE_ID_VA_ARGS(TMSRP_DATA(data_out)->id),
+ // TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total), => See below
+ TMSRP_HEADER_FAILURE_REPORT_VA_ARGS(sender->config->Failure_Report ? freport_yes : freport_no),
+ TMSRP_HEADER_SUCCESS_REPORT_VA_ARGS(sender->config->Success_Report),
+
+ tsk_null);
+ // add data
+ if(start == 1 && chunck->size && tsk_striequals(TMSRP_DATA(data_out)->ctype, "message/CPIM")) {
+ tsk_buffer_t* content_cpim = tsk_buffer_create_null();
+ if(content_cpim) {
+ tsk_buffer_append_2(content_cpim, "Subject: %s\r\n\r\nContent-Type: %s\r\n\r\n",
+ "test", TMSRP_DATA(data_out)->wctype);
+ end += content_cpim->size;
+ total += content_cpim->size;
+ tsk_buffer_append(content_cpim, chunck->data, chunck->size);
+ tmsrp_message_add_content(SEND, TMSRP_DATA(data_out)->ctype, content_cpim->data, content_cpim->size);
+ TSK_OBJECT_SAFE_FREE(content_cpim);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ }
+ }
+ else {
+ tmsrp_message_add_content(SEND, TMSRP_DATA(data_out)->ctype, chunck->data, chunck->size);
+ }
+ // add byte range here not before: think about message/cpim
+ tmsrp_message_add_headers(SEND,
+ TMSRP_HEADER_BYTE_RANGE_VA_ARGS(start, end, total),
+
+ tsk_null);
+
+
+ // set continuation flag
+ SEND->end_line.cflag = (end == total) ? '$' : '+';
+ // serialize and send
+ if(!(tmsrp_message_serialize(SEND, message))) {
+ if(tnet_sockfd_send(sender->fd, message->data, message->size, 0) == 0) {
+ error = tsk_true;
+ // abort
+ }
+ }
+ tsk_buffer_cleanup(message);
+
+ // set start
+ start = (end + 1);
+ // cleanup
+ TSK_OBJECT_SAFE_FREE(chunck);
+ TSK_OBJECT_SAFE_FREE(SEND);
+
+ /* wait */
+ if(sender->chunck_duration) {
+ tsk_thread_sleep(sender->chunck_duration);
+ }
+ }
+
+
+ tsk_object_unref(curr);
+ }
+
+ TSK_RUNNABLE_RUN_END(self);
+
+ TSK_OBJECT_SAFE_FREE(message);
+
+ TSK_DEBUG_INFO("MSRP SENDER::run -- STOP");
+
+ return 0;
}
@@ -252,35 +252,34 @@ static void* TSK_STDCALL run(void* self)
//
static void* tmsrp_sender_ctor(tsk_object_t * self, va_list *app)
{
- tmsrp_sender_t *sender = (tmsrp_sender_t*)self;
- if(sender){
- sender->config = (tmsrp_config_t*)tsk_object_ref(va_arg(*app, tmsrp_config_t*));
- sender->fd = va_arg(*app, tnet_fd_t);
-
- sender->outgoingList = tsk_list_create();
- }
- return self;
+ tmsrp_sender_t *sender = (tmsrp_sender_t*)self;
+ if(sender) {
+ sender->config = (tmsrp_config_t*)tsk_object_ref(va_arg(*app, tmsrp_config_t*));
+ sender->fd = va_arg(*app, tnet_fd_t);
+
+ sender->outgoingList = tsk_list_create();
+ }
+ return self;
}
static void* tmsrp_sender_dtor(tsk_object_t * self)
-{
- tmsrp_sender_t *sender = self;
- if(sender){
- /* Stop */
- tmsrp_sender_stop(sender);
-
- TSK_OBJECT_SAFE_FREE(sender->config);
- TSK_OBJECT_SAFE_FREE(sender->outgoingList);
- // the FD is owned by the transport ...do not close it
- }
- return self;
+{
+ tmsrp_sender_t *sender = self;
+ if(sender) {
+ /* Stop */
+ tmsrp_sender_stop(sender);
+
+ TSK_OBJECT_SAFE_FREE(sender->config);
+ TSK_OBJECT_SAFE_FREE(sender->outgoingList);
+ // the FD is owned by the transport ...do not close it
+ }
+ return self;
}
-static const tsk_object_def_t tmsrp_sender_def_s =
-{
- sizeof(tmsrp_sender_t),
- tmsrp_sender_ctor,
- tmsrp_sender_dtor,
- tsk_null,
+static const tsk_object_def_t tmsrp_sender_def_s = {
+ sizeof(tmsrp_sender_t),
+ tmsrp_sender_ctor,
+ tmsrp_sender_dtor,
+ tsk_null,
};
const tsk_object_def_t *tmsrp_sender_def_t = &tmsrp_sender_def_s;
diff --git a/tinyMSRP/src/tmsrp.c b/tinyMSRP/src/tmsrp.c
index 913b96e..16c2bce 100755
--- a/tinyMSRP/src/tmsrp.c
+++ b/tinyMSRP/src/tmsrp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,128 +36,128 @@
tmsrp_request_t* tmsrp_create_bodiless(const tmsrp_uri_t* To, const tmsrp_uri_t* From)
{
- /* RFC 4975 - 7.1. Constructing Requests
- Requests with no bodies are useful when a client wishes to send
- "traffic", but does not wish to send content to be rendered to the
- peer user. For example, the active endpoint sends a SEND request
- immediately upon establishing a connection. If it has nothing to
- say at the moment, it can send a request with no body. Bodiless
- requests may also be used in certain applications to keep Network
- Address Translation (NAT) bindings alive, etc.
-
- Bodiless requests are distinct from requests with empty bodies. A
- request with an empty body will have a Content-Type header field
- value and will generally be rendered to the recipient according to
- the rules for that type.
- */
- tmsrp_request_t* BODILESS = tsk_null;
- tsk_istr_t tid;
- tsk_istr_t mid;
-
- tsk_strrandom(&tid);
- tsk_strrandom(&mid);
-
- if(!(BODILESS = tmsrp_request_create(tid, "SEND"))){
- goto bail;
- }
- // To-Path
- // From-Path
- // Message-ID
- tmsrp_message_add_headers(BODILESS,
- TMSRP_HEADER_TO_PATH_VA_ARGS(To),
- TMSRP_HEADER_FROM_PATH_VA_ARGS(From),
- TMSRP_HEADER_MESSAGE_ID_VA_ARGS(mid),
-
- tsk_null);
+ /* RFC 4975 - 7.1. Constructing Requests
+ Requests with no bodies are useful when a client wishes to send
+ "traffic", but does not wish to send content to be rendered to the
+ peer user. For example, the active endpoint sends a SEND request
+ immediately upon establishing a connection. If it has nothing to
+ say at the moment, it can send a request with no body. Bodiless
+ requests may also be used in certain applications to keep Network
+ Address Translation (NAT) bindings alive, etc.
+
+ Bodiless requests are distinct from requests with empty bodies. A
+ request with an empty body will have a Content-Type header field
+ value and will generally be rendered to the recipient according to
+ the rules for that type.
+ */
+ tmsrp_request_t* BODILESS = tsk_null;
+ tsk_istr_t tid;
+ tsk_istr_t mid;
+
+ tsk_strrandom(&tid);
+ tsk_strrandom(&mid);
+
+ if(!(BODILESS = tmsrp_request_create(tid, "SEND"))) {
+ goto bail;
+ }
+ // To-Path
+ // From-Path
+ // Message-ID
+ tmsrp_message_add_headers(BODILESS,
+ TMSRP_HEADER_TO_PATH_VA_ARGS(To),
+ TMSRP_HEADER_FROM_PATH_VA_ARGS(From),
+ TMSRP_HEADER_MESSAGE_ID_VA_ARGS(mid),
+
+ tsk_null);
bail:
- return BODILESS;
+ return BODILESS;
}
tmsrp_response_t* tmsrp_create_response(const tmsrp_request_t* request, short status, const char* comment)
{
- tmsrp_response_t* response = tsk_null;
-
- if(!request){
- goto bail;
- }
- /* MSRP response will have the same tid ==> nothing to do */
- if(!(response = tmsrp_response_create(request->tid, status, comment))){
- goto bail;
- }
- /* reverse To-Path and From-Path */
- response->To = (tmsrp_header_To_Path_t*)tmsrp_header_From_Path_clone(request->From);
- TMSRP_HEADER(response->To)->type = tmsrp_htype_To_Path; /* as it's a clone we shall change type */
- response->From = (tmsrp_header_From_Path_t*)tmsrp_header_To_Path_clone(request->To);
- TMSRP_HEADER(response->From)->type = tmsrp_htype_From_Path; /* as it's a clone we shall change type */
- /* Byte-Range */
- response->ByteRange = tsk_object_ref((void*)request->ByteRange);
-
+ tmsrp_response_t* response = tsk_null;
+
+ if(!request) {
+ goto bail;
+ }
+ /* MSRP response will have the same tid ==> nothing to do */
+ if(!(response = tmsrp_response_create(request->tid, status, comment))) {
+ goto bail;
+ }
+ /* reverse To-Path and From-Path */
+ response->To = (tmsrp_header_To_Path_t*)tmsrp_header_From_Path_clone(request->From);
+ TMSRP_HEADER(response->To)->type = tmsrp_htype_To_Path; /* as it's a clone we shall change type */
+ response->From = (tmsrp_header_From_Path_t*)tmsrp_header_To_Path_clone(request->To);
+ TMSRP_HEADER(response->From)->type = tmsrp_htype_From_Path; /* as it's a clone we shall change type */
+ /* Byte-Range */
+ response->ByteRange = tsk_object_ref((void*)request->ByteRange);
+
bail:
- return response;
+ return response;
}
tmsrp_request_t* tmsrp_create_report(const tmsrp_request_t* SEND, short status, const char* reason)
{
- /* RFC 4975 - 7.1.2. Sending REPORT Requests
-
- * REPORT requests are similar to SEND requests, except that report
- * requests MUST NOT include Success-Report or Failure-Report header
- * fields, and MUST contain a Status header field. REPORT requests MUST
- * contain the Message-ID header field from the original SEND request.
- */
- tmsrp_request_t* REPORT = tsk_null;
- tsk_istr_t tid;
-
- /* If an MSRP element receives a REPORT for a Message-ID it does not
- recognize, it SHOULD silently ignore the REPORT.
- */
- if(!SEND || !SEND->MessageID){
- goto bail;
- }
-
- /* Generate new tid (Report has it's own tid) */
- tsk_strrandom(&tid);
-
- /* MSRP response will have the same tid ==> nothing to do */
- if(!(REPORT = tmsrp_request_create(tid, "REPORT"))){
- goto bail;
- }
-
- /* reverse To-Path and From-Path */
- REPORT->To = (tmsrp_header_To_Path_t*)tmsrp_header_From_Path_clone(SEND->From);
- TMSRP_HEADER(REPORT->To)->type = tmsrp_htype_To_Path; /* as it's a clone we shall change type */
- REPORT->From = (tmsrp_header_From_Path_t*)tmsrp_header_To_Path_clone(SEND->To);
- TMSRP_HEADER(REPORT->From)->type = tmsrp_htype_From_Path; /* as it's a clone we shall change type */
- /* Byte-Range */
- REPORT->ByteRange = tsk_object_ref((void*)SEND->ByteRange);
-
- /* Message ID */
- /* Status */
- tmsrp_message_add_headers(REPORT,
- TMSRP_HEADER_MESSAGE_ID_VA_ARGS(SEND->MessageID->value),
- TMSRP_HEADER_STATUS_VA_ARGS(TMSR_DEFAULT_NAMESPACE, status, reason),
-
- tsk_null);
+ /* RFC 4975 - 7.1.2. Sending REPORT Requests
+
+ * REPORT requests are similar to SEND requests, except that report
+ * requests MUST NOT include Success-Report or Failure-Report header
+ * fields, and MUST contain a Status header field. REPORT requests MUST
+ * contain the Message-ID header field from the original SEND request.
+ */
+ tmsrp_request_t* REPORT = tsk_null;
+ tsk_istr_t tid;
+
+ /* If an MSRP element receives a REPORT for a Message-ID it does not
+ recognize, it SHOULD silently ignore the REPORT.
+ */
+ if(!SEND || !SEND->MessageID) {
+ goto bail;
+ }
+
+ /* Generate new tid (Report has it's own tid) */
+ tsk_strrandom(&tid);
+
+ /* MSRP response will have the same tid ==> nothing to do */
+ if(!(REPORT = tmsrp_request_create(tid, "REPORT"))) {
+ goto bail;
+ }
+
+ /* reverse To-Path and From-Path */
+ REPORT->To = (tmsrp_header_To_Path_t*)tmsrp_header_From_Path_clone(SEND->From);
+ TMSRP_HEADER(REPORT->To)->type = tmsrp_htype_To_Path; /* as it's a clone we shall change type */
+ REPORT->From = (tmsrp_header_From_Path_t*)tmsrp_header_To_Path_clone(SEND->To);
+ TMSRP_HEADER(REPORT->From)->type = tmsrp_htype_From_Path; /* as it's a clone we shall change type */
+ /* Byte-Range */
+ REPORT->ByteRange = tsk_object_ref((void*)SEND->ByteRange);
+
+ /* Message ID */
+ /* Status */
+ tmsrp_message_add_headers(REPORT,
+ TMSRP_HEADER_MESSAGE_ID_VA_ARGS(SEND->MessageID->value),
+ TMSRP_HEADER_STATUS_VA_ARGS(TMSR_DEFAULT_NAMESPACE, status, reason),
+
+ tsk_null);
bail:
- return REPORT;
+ return REPORT;
}
tsk_bool_t tmsrp_isReportRequired(const tmsrp_request_t* request, tsk_bool_t failed)
{
- if(!request){
- return tsk_false;
- }
+ if(!request) {
+ return tsk_false;
+ }
- /* Success Report. */
- if(request->SuccessReport && request->SuccessReport->yes){
- return tsk_true;
- }
+ /* Success Report. */
+ if(request->SuccessReport && request->SuccessReport->yes) {
+ return tsk_true;
+ }
- /* Failure Report */
- if(!request->FailureReport || (request->FailureReport && request->FailureReport->type != freport_no)){
- return failed;
- }
+ /* Failure Report */
+ if(!request->FailureReport || (request->FailureReport && request->FailureReport->type != freport_no)) {
+ return failed;
+ }
- return tsk_false;
+ return tsk_false;
}
diff --git a/tinyMSRP/src/tmsrp_event.c b/tinyMSRP/src/tmsrp_event.c
index 1d4a930..c37c3c2 100755
--- a/tinyMSRP/src/tmsrp_event.c
+++ b/tinyMSRP/src/tmsrp_event.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,18 +33,18 @@
tmsrp_event_t* tmsrp_event_create(const void* callback_data, tsk_bool_t outgoing, tmsrp_event_type_t type, tmsrp_message_t* message)
{
- tmsrp_event_t* _event;
- if((_event = tsk_object_new(tmsrp_event_def_t))){
- _event->callback_data = callback_data;
- _event->outgoing = outgoing;
- _event->type = type;
- _event->message = tsk_object_ref(message);
- }
- else{
- TSK_DEBUG_ERROR("Faile to create new MSRP event");
- }
+ tmsrp_event_t* _event;
+ if((_event = tsk_object_new(tmsrp_event_def_t))) {
+ _event->callback_data = callback_data;
+ _event->outgoing = outgoing;
+ _event->type = type;
+ _event->message = tsk_object_ref(message);
+ }
+ else {
+ TSK_DEBUG_ERROR("Faile to create new MSRP event");
+ }
- return _event;
+ return _event;
}
//========================================================
@@ -55,35 +55,34 @@ tmsrp_event_t* tmsrp_event_create(const void* callback_data, tsk_bool_t outgoing
*/
static tsk_object_t* tmsrp_event_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_event_t *_event = self;
- if(_event){
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new MSRP Event");
- }
- return self;
+ tmsrp_event_t *_event = self;
+ if(_event) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new MSRP Event");
+ }
+ return self;
}
/**@ingroup tmsrp_event_group
*/
static tsk_object_t* tmsrp_event_dtor(tsk_object_t *self)
{
- tmsrp_event_t *_event = self;
- if(_event){
- TSK_OBJECT_SAFE_FREE(_event->message);
- }
- else{
- TSK_DEBUG_ERROR("Null MSRP Event");
- }
+ tmsrp_event_t *_event = self;
+ if(_event) {
+ TSK_OBJECT_SAFE_FREE(_event->message);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null MSRP Event");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tmsrp_event_def_s =
-{
- sizeof(tmsrp_event_t),
- tmsrp_event_ctor,
- tmsrp_event_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_event_def_s = {
+ sizeof(tmsrp_event_t),
+ tmsrp_event_ctor,
+ tmsrp_event_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_event_def_t = &tmsrp_event_def_s;
diff --git a/tinyMSRP/src/tmsrp_message.c b/tinyMSRP/src/tmsrp_message.c
index ecefe60..e31072b 100755
--- a/tinyMSRP/src/tmsrp_message.c
+++ b/tinyMSRP/src/tmsrp_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,67 +37,67 @@
/*== Predicate function to find tmsrp_header_t object by type. */
static int pred_find_header_by_type(const tsk_list_item_t *item, const void *tmsrp_htype)
{
- if(item && item->data){
- tmsrp_header_t *header = item->data;
- tmsrp_header_type_t htype = *((tmsrp_header_type_t*)tmsrp_htype);
- return (header->type - htype);
- }
- return -1;
+ if(item && item->data) {
+ tmsrp_header_t *header = item->data;
+ tmsrp_header_type_t htype = *((tmsrp_header_type_t*)tmsrp_htype);
+ return (header->type - htype);
+ }
+ return -1;
}
/*== Predicate function to find tmsrp_header_t object by name. */
static int pred_find_header_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data && name){
- tmsrp_header_t *header = item->data;
- return tsk_stricmp(tmsrp_header_get_nameex(header), (const char*)name);
- }
- return -1;
+ if(item && item->data && name) {
+ tmsrp_header_t *header = item->data;
+ return tsk_stricmp(tmsrp_header_get_nameex(header), (const char*)name);
+ }
+ return -1;
}
tmsrp_message_t* tmsrp_message_create(tmsrp_message_type_t type, const char* tid, const char* method, short status, const char* comment)
{
- tmsrp_message_t* message;
- if((message = tsk_object_new(tmsrp_message_def_t))){
- message->type = type;
- message->tid = tsk_strdup(tid);
- if(message->type == tmsrp_response){
- message->line.response.status = status;
- message->line.response.comment = tsk_strdup(comment);
- }
- else{
- message->line.request.method = tsk_strdup(method);
- message->line.request.type = tmsrp_request_get_type(method);
- }
-
- message->headers = tsk_list_create();
-
- message->end_line.tid = tsk_strdup(message->tid);
- message->end_line.cflag = '$';
- }
- return message;
+ tmsrp_message_t* message;
+ if((message = tsk_object_new(tmsrp_message_def_t))) {
+ message->type = type;
+ message->tid = tsk_strdup(tid);
+ if(message->type == tmsrp_response) {
+ message->line.response.status = status;
+ message->line.response.comment = tsk_strdup(comment);
+ }
+ else {
+ message->line.request.method = tsk_strdup(method);
+ message->line.request.type = tmsrp_request_get_type(method);
+ }
+
+ message->headers = tsk_list_create();
+
+ message->end_line.tid = tsk_strdup(message->tid);
+ message->end_line.cflag = '$';
+ }
+ return message;
}
tmsrp_message_t* tmsrp_request_create(const char* tid, const char* method)
{
- return tmsrp_message_create(tmsrp_request, tid, method, 0, tsk_null);
+ return tmsrp_message_create(tmsrp_request, tid, method, 0, tsk_null);
}
tmsrp_message_t* tmsrp_response_create(const char* tid, short status, const char* comment)
{
- return tmsrp_message_create(tmsrp_response, tid, tsk_null, status, comment);
+ return tmsrp_message_create(tmsrp_response, tid, tsk_null, status, comment);
}
tmsrp_message_t* tmsrp_message_create_null()
{
- return tmsrp_message_create(tmsrp_unknown, tsk_null, tsk_null, 0, tsk_null);
+ return tmsrp_message_create(tmsrp_unknown, tsk_null, tsk_null, 0, tsk_null);
}
int tmsrp_message_add_header(tmsrp_message_t *self, const tmsrp_header_t *hdr)
{
- #define ADD_HEADER(type, field) \
+#define ADD_HEADER(type, field) \
case tmsrp_htype_##type: \
{ \
if(!self->field) \
@@ -107,270 +107,298 @@ int tmsrp_message_add_header(tmsrp_message_t *self, const tmsrp_header_t *hdr)
} \
break; \
}
-
- if(self && hdr)
- {
- tmsrp_header_t *header = tsk_object_ref((void*)hdr);
-
- switch(header->type)
- {
- ADD_HEADER(To_Path, To);
- ADD_HEADER(From_Path, From);
- ADD_HEADER(Message_ID, MessageID);
- ADD_HEADER(Byte_Range, ByteRange);
- ADD_HEADER(Failure_Report, FailureReport);
- ADD_HEADER(Success_Report, SuccessReport);
- ADD_HEADER(Status, Status);
- ADD_HEADER(Content_Type, ContentType);
-
- default: break;
- }
-
- tsk_list_push_back_data(self->headers, (void**)&header);
-
- return 0;
- }
- return -1;
+
+ if(self && hdr) {
+ tmsrp_header_t *header = tsk_object_ref((void*)hdr);
+
+ switch(header->type) {
+ ADD_HEADER(To_Path, To);
+ ADD_HEADER(From_Path, From);
+ ADD_HEADER(Message_ID, MessageID);
+ ADD_HEADER(Byte_Range, ByteRange);
+ ADD_HEADER(Failure_Report, FailureReport);
+ ADD_HEADER(Success_Report, SuccessReport);
+ ADD_HEADER(Status, Status);
+ ADD_HEADER(Content_Type, ContentType);
+
+ default:
+ break;
+ }
+
+ tsk_list_push_back_data(self->headers, (void**)&header);
+
+ return 0;
+ }
+ return -1;
}
int tmsrp_message_add_headers(tmsrp_message_t *self, ...)
{
- const tsk_object_def_t* objdef;
- tmsrp_header_t *header;
- va_list ap;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if((header = tsk_object_new_2(objdef, &ap))){
- tmsrp_message_add_header(self, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- va_end(ap);
-
- return 0;
+ const tsk_object_def_t* objdef;
+ tmsrp_header_t *header;
+ va_list ap;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ tmsrp_message_add_header(self, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
tmsrp_request_type_t tmsrp_request_get_type(const char* method)
{
- if(method){
- if(tsk_strequals(method, "SEND")){
- return tmsrp_SEND;
- }
- else if(tsk_strequals(method, "REPORT")){
- return tmsrp_REPORT;
- }
- else if(tsk_strequals(method, "AUTH")){
- return tmsrp_AUTH;
- }
- }
- return tmsrp_NONE;
+ if(method) {
+ if(tsk_strequals(method, "SEND")) {
+ return tmsrp_SEND;
+ }
+ else if(tsk_strequals(method, "REPORT")) {
+ return tmsrp_REPORT;
+ }
+ else if(tsk_strequals(method, "AUTH")) {
+ return tmsrp_AUTH;
+ }
+ }
+ return tmsrp_NONE;
}
const tmsrp_header_t *tmsrp_message_get_headerAt(const tmsrp_message_t *self, tmsrp_header_type_t type, tsk_size_t index)
{
- tsk_size_t pos = 0;
- tsk_list_item_t *item;
- const tmsrp_header_t* hdr = 0;
-
- if(self)
- {
- switch(type)
- {
- case tmsrp_htype_To_Path:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->To;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_From_Path:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->From;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_Message_ID:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->MessageID;
- goto bail; break;
- }else pos++;
- case tmsrp_htype_Byte_Range:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->ByteRange;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_Failure_Report:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->FailureReport;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_Success_Report:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->SuccessReport;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_Status:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->Status;
- goto bail;
- }else pos++; break;
- case tmsrp_htype_Content_Type:
- if(index == 0){
- hdr = (const tmsrp_header_t*)self->ContentType;
- goto bail;
- }else pos++; break;
- default:
- break;
- }
-
- tsk_list_foreach(item, self->headers){
- if(!pred_find_header_by_type(item, &type)){
- if(pos++ >= index){
- hdr = item->data;
- break;
- }
- }
- }
- }
+ tsk_size_t pos = 0;
+ tsk_list_item_t *item;
+ const tmsrp_header_t* hdr = 0;
+
+ if(self) {
+ switch(type) {
+ case tmsrp_htype_To_Path:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_From_Path:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_Message_ID:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->MessageID;
+ goto bail;
+ break;
+ }
+ else {
+ pos++;
+ }
+ case tmsrp_htype_Byte_Range:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->ByteRange;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_Failure_Report:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->FailureReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_Success_Report:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->SuccessReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_Status:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->Status;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tmsrp_htype_Content_Type:
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)self->ContentType;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ default:
+ break;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ if(!pred_find_header_by_type(item, &type)) {
+ if(pos++ >= index) {
+ hdr = item->data;
+ break;
+ }
+ }
+ }
+ }
bail:
- return hdr;
+ return hdr;
}
const tmsrp_header_t *tmsrp_message_get_header(const tmsrp_message_t *self, tmsrp_header_type_t type)
{
- return tmsrp_message_get_headerAt(self, type, 0);
+ return tmsrp_message_get_headerAt(self, type, 0);
}
const tmsrp_header_t *tmsrp_message_get_headerByName(const tmsrp_message_t *self, const char* name)
{
- if(self && self->headers){
- const tsk_list_item_t* item;
- if((item = tsk_list_find_item_by_pred(self->headers, pred_find_header_by_name, name))){
- return item->data;
- }
- }
- return tsk_null;
+ if(self && self->headers) {
+ const tsk_list_item_t* item;
+ if((item = tsk_list_find_item_by_pred(self->headers, pred_find_header_by_name, name))) {
+ return item->data;
+ }
+ }
+ return tsk_null;
}
int tmsrp_message_add_content(tmsrp_message_t *self, const char* content_type, const void* content, tsk_size_t size)
{
- if(self)
- {
- if(content_type){
- TSK_OBJECT_SAFE_FREE(self->ContentType);
- }
- TSK_OBJECT_SAFE_FREE(self->Content);
-
- if(content_type){
- TMSRP_MESSAGE_ADD_HEADER(self, TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
- }
- self->Content = tsk_buffer_create(content, size);
-
- return 0;
- }
- return -1;
+ if(self) {
+ if(content_type) {
+ TSK_OBJECT_SAFE_FREE(self->ContentType);
+ }
+ TSK_OBJECT_SAFE_FREE(self->Content);
+
+ if(content_type) {
+ TMSRP_MESSAGE_ADD_HEADER(self, TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
+ }
+ self->Content = tsk_buffer_create(content, size);
+
+ return 0;
+ }
+ return -1;
}
int tmsrp_message_serialize(const tmsrp_message_t *self, tsk_buffer_t *output)
{
- if(!self || !output){
- return -1;
- }
-
- if(TMSRP_MESSAGE_IS_REQUEST(self)){
- /* pMSRP SP transact-id SP method CRLF */
- tsk_buffer_append_2(output, "MSRP %s %s\r\n", self->tid, self->line.request.method);
- }
- else{
- /* pMSRP SP transact-id SP status-code [SP comment] CRLF */
- tsk_buffer_append_2(output, "MSRP %s %3hi%s%s\r\n",
- self->tid,
- self->line.response.status,
- self->line.response.comment ? " " : "",
- self->line.response.comment ? self->line.response.comment : ""
- );
- }
-
- /* To-Path */
- if(self->To){
- tmsrp_header_serialize(TMSRP_HEADER(self->To), output);
- }
- /* From-Path */
- if(self->From){
- tmsrp_header_serialize(TMSRP_HEADER(self->From), output);
- }
- /* Message-Id */
- if(self->MessageID){
- tmsrp_header_serialize(TMSRP_HEADER(self->MessageID), output);
- }
- /* Byte-Range */
- if(self->ByteRange){
- tmsrp_header_serialize(TMSRP_HEADER(self->ByteRange), output);
- }
- /* Failure-Report */
- if(self->FailureReport){
- tmsrp_header_serialize(TMSRP_HEADER(self->FailureReport), output);
- }
- /* Success-Report */
- if(self->SuccessReport){
- tmsrp_header_serialize(TMSRP_HEADER(self->SuccessReport), output);
- }
- /* Status */
- if(self->Status){
- tmsrp_header_serialize(TMSRP_HEADER(self->Status), output);
- }
-
- /* All other headers (Other-Mime-headers)
- - Should be empty if no content is added (see below) but ...
- */
- {
- tsk_list_item_t *item;
- tsk_list_foreach(item, self->headers){
- tmsrp_header_t *hdr = item->data;
- tmsrp_header_serialize(hdr, output);
- }
- }
-
- /* RFC 4975 - 7.1. Constructing Requests
- A request with no body MUST NOT include a Content-Type or any other
- MIME-specific header fields. A request without a body MUST contain
- an end-line after the final header field. No extra CRLF will be
- present between the header section and the end-line.
- */
- /* CONTENT */
- if(TMSRP_MESSAGE_HAS_CONTENT(self)){
- /* Content-Type */
- if(self->ContentType){
- tmsrp_header_serialize(TMSRP_HEADER(self->ContentType), output);
- }
- tsk_buffer_append(output, "\r\n", 2);
- tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
- tsk_buffer_append(output, "\r\n", 2);
- }
-
- /* END LINE */
- tsk_buffer_append_2(output, "-------%s%c\r\n", self->end_line.tid, self->end_line.cflag);
-
- return 0;
+ if(!self || !output) {
+ return -1;
+ }
+
+ if(TMSRP_MESSAGE_IS_REQUEST(self)) {
+ /* pMSRP SP transact-id SP method CRLF */
+ tsk_buffer_append_2(output, "MSRP %s %s\r\n", self->tid, self->line.request.method);
+ }
+ else {
+ /* pMSRP SP transact-id SP status-code [SP comment] CRLF */
+ tsk_buffer_append_2(output, "MSRP %s %3hi%s%s\r\n",
+ self->tid,
+ self->line.response.status,
+ self->line.response.comment ? " " : "",
+ self->line.response.comment ? self->line.response.comment : ""
+ );
+ }
+
+ /* To-Path */
+ if(self->To) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->To), output);
+ }
+ /* From-Path */
+ if(self->From) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->From), output);
+ }
+ /* Message-Id */
+ if(self->MessageID) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->MessageID), output);
+ }
+ /* Byte-Range */
+ if(self->ByteRange) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->ByteRange), output);
+ }
+ /* Failure-Report */
+ if(self->FailureReport) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->FailureReport), output);
+ }
+ /* Success-Report */
+ if(self->SuccessReport) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->SuccessReport), output);
+ }
+ /* Status */
+ if(self->Status) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->Status), output);
+ }
+
+ /* All other headers (Other-Mime-headers)
+ - Should be empty if no content is added (see below) but ...
+ */
+ {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, self->headers) {
+ tmsrp_header_t *hdr = item->data;
+ tmsrp_header_serialize(hdr, output);
+ }
+ }
+
+ /* RFC 4975 - 7.1. Constructing Requests
+ A request with no body MUST NOT include a Content-Type or any other
+ MIME-specific header fields. A request without a body MUST contain
+ an end-line after the final header field. No extra CRLF will be
+ present between the header section and the end-line.
+ */
+ /* CONTENT */
+ if(TMSRP_MESSAGE_HAS_CONTENT(self)) {
+ /* Content-Type */
+ if(self->ContentType) {
+ tmsrp_header_serialize(TMSRP_HEADER(self->ContentType), output);
+ }
+ tsk_buffer_append(output, "\r\n", 2);
+ tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
+ tsk_buffer_append(output, "\r\n", 2);
+ }
+
+ /* END LINE */
+ tsk_buffer_append_2(output, "-------%s%c\r\n", self->end_line.tid, self->end_line.cflag);
+
+ return 0;
}
char* tmsrp_message_tostring(const tmsrp_message_t *self)
{
- tsk_buffer_t* output;
- char* ret = tsk_null;
-
- if((output = tsk_buffer_create_null())){
- if(!tmsrp_message_serialize(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
- return ret;
+ tsk_buffer_t* output;
+ char* ret = tsk_null;
+
+ if((output = tsk_buffer_create_null())) {
+ if(!tmsrp_message_serialize(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
+ return ret;
}
@@ -405,61 +433,60 @@ char* tmsrp_message_tostring(const tmsrp_message_t *self)
//
static void* tmsrp_message_ctor(tsk_object_t * self, va_list * app)
{
- tmsrp_message_t *message = self;
- if(message){
- }
- return self;
+ tmsrp_message_t *message = self;
+ if(message) {
+ }
+ return self;
}
static void* tmsrp_message_dtor(tsk_object_t * self)
-{
- tmsrp_message_t *message = self;
- if(message){
- TSK_FREE(message->tid);
-
- // request
- if(TMSRP_MESSAGE_IS_REQUEST(message)){
- TSK_FREE(message->line.request.method);
- }
- // response
- if(TMSRP_MESSAGE_IS_RESPONSE(message)){
- TSK_FREE(message->line.response.comment);
- }
-
- // Very common headers
- TSK_OBJECT_SAFE_FREE(message->To);
- TSK_OBJECT_SAFE_FREE(message->From);
-
- TSK_OBJECT_SAFE_FREE(message->MessageID);
-
- TSK_OBJECT_SAFE_FREE(message->ByteRange);
- TSK_OBJECT_SAFE_FREE(message->FailureReport);
- TSK_OBJECT_SAFE_FREE(message->SuccessReport);
- TSK_OBJECT_SAFE_FREE(message->Status);
-
- // all other headers
- TSK_OBJECT_SAFE_FREE(message->headers);
-
- // content
- TSK_OBJECT_SAFE_FREE(message->ContentType);
- TSK_OBJECT_SAFE_FREE(message->Content);
-
- // end-line
- TSK_FREE(message->end_line.tid);
- }
- return self;
+{
+ tmsrp_message_t *message = self;
+ if(message) {
+ TSK_FREE(message->tid);
+
+ // request
+ if(TMSRP_MESSAGE_IS_REQUEST(message)) {
+ TSK_FREE(message->line.request.method);
+ }
+ // response
+ if(TMSRP_MESSAGE_IS_RESPONSE(message)) {
+ TSK_FREE(message->line.response.comment);
+ }
+
+ // Very common headers
+ TSK_OBJECT_SAFE_FREE(message->To);
+ TSK_OBJECT_SAFE_FREE(message->From);
+
+ TSK_OBJECT_SAFE_FREE(message->MessageID);
+
+ TSK_OBJECT_SAFE_FREE(message->ByteRange);
+ TSK_OBJECT_SAFE_FREE(message->FailureReport);
+ TSK_OBJECT_SAFE_FREE(message->SuccessReport);
+ TSK_OBJECT_SAFE_FREE(message->Status);
+
+ // all other headers
+ TSK_OBJECT_SAFE_FREE(message->headers);
+
+ // content
+ TSK_OBJECT_SAFE_FREE(message->ContentType);
+ TSK_OBJECT_SAFE_FREE(message->Content);
+
+ // end-line
+ TSK_FREE(message->end_line.tid);
+ }
+ return self;
}
static int tmsrp_message_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tmsrp_message_def_s =
-{
- sizeof(tmsrp_message_t),
- tmsrp_message_ctor,
- tmsrp_message_dtor,
- tmsrp_message_cmp,
+static const tsk_object_def_t tmsrp_message_def_s = {
+ sizeof(tmsrp_message_t),
+ tmsrp_message_ctor,
+ tmsrp_message_dtor,
+ tmsrp_message_cmp,
};
const tsk_object_def_t *tmsrp_message_def_t = &tmsrp_message_def_s;
diff --git a/tinyMSRP/src/tmsrp_uri.c b/tinyMSRP/src/tmsrp_uri.c
index 273616d..4d009f7 100755
--- a/tinyMSRP/src/tmsrp_uri.c
+++ b/tinyMSRP/src/tmsrp_uri.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -54,85 +54,85 @@
*/
tmsrp_uri_t* tmsrp_uri_create(const char*scheme, const char* host, tmsrp_host_type_t host_type, int32_t port, const char* session_id, const char*transport)
{
- return tsk_object_new(tmsrp_uri_def_t, scheme, host, host_type, port, session_id, transport);
+ return tsk_object_new(tmsrp_uri_def_t, scheme, host, host_type, port, session_id, transport);
}
tmsrp_uri_t* tmsrp_uri_create_null()
{
- return tmsrp_uri_create(tsk_null, tsk_null, tmsrp_host_unknown, -1, tsk_null, tsk_null);
+ return tmsrp_uri_create(tsk_null, tsk_null, tmsrp_host_unknown, -1, tsk_null, tsk_null);
}
int tmsrp_uri_serialize(const tmsrp_uri_t *uri, tsk_buffer_t *output)
{
- tsk_istr_t port;
- if(!uri || !output){
- return -1;
- }
-
- if(uri->authority.port >= 0){
- tsk_itoa(uri->authority.port, &port);
- }
-
- /* msrp://atlanta.example.com:7654/jshA7weztas;tcp
- * msrp-scheme "://" authority ["/" session-id] ";" transport *( ";" URI-parameter)
- * authority = [ userinfo "@" ] host [ ":" port ]
- */
- tsk_buffer_append_2(output, "%s://%s%s%s%s%s%s%s%s%s;%s",
-
- // scheme
- uri->scheme,
-
- // authority
- uri->authority.userinfo ? uri->authority.userinfo : "",
- uri->authority.userinfo ? "@" : "",
- uri->authority.host_type == tmsrp_host_ipv6 ? "[" : "",
- uri->authority.host,
- uri->authority.host_type == tmsrp_host_ipv6 ? "]" : "",
- uri->authority.port >= 0 ? ":" : "",
- uri->authority.port >= 0 ? port : "",
-
- // session-id
- uri->session_id ? "/" : "",
- uri->session_id ? uri->session_id : "",
-
- // transport
- uri->transport
- );
-
- /* Params */
- if(!TSK_LIST_IS_EMPTY(uri->params)){
- tsk_buffer_append(output, ";", 1);
- tsk_params_tostring(uri->params, ';', output);
- }
-
- return 0;
+ tsk_istr_t port;
+ if(!uri || !output) {
+ return -1;
+ }
+
+ if(uri->authority.port >= 0) {
+ tsk_itoa(uri->authority.port, &port);
+ }
+
+ /* msrp://atlanta.example.com:7654/jshA7weztas;tcp
+ * msrp-scheme "://" authority ["/" session-id] ";" transport *( ";" URI-parameter)
+ * authority = [ userinfo "@" ] host [ ":" port ]
+ */
+ tsk_buffer_append_2(output, "%s://%s%s%s%s%s%s%s%s%s;%s",
+
+ // scheme
+ uri->scheme,
+
+ // authority
+ uri->authority.userinfo ? uri->authority.userinfo : "",
+ uri->authority.userinfo ? "@" : "",
+ uri->authority.host_type == tmsrp_host_ipv6 ? "[" : "",
+ uri->authority.host,
+ uri->authority.host_type == tmsrp_host_ipv6 ? "]" : "",
+ uri->authority.port >= 0 ? ":" : "",
+ uri->authority.port >= 0 ? port : "",
+
+ // session-id
+ uri->session_id ? "/" : "",
+ uri->session_id ? uri->session_id : "",
+
+ // transport
+ uri->transport
+ );
+
+ /* Params */
+ if(!TSK_LIST_IS_EMPTY(uri->params)) {
+ tsk_buffer_append(output, ";", 1);
+ tsk_params_tostring(uri->params, ';', output);
+ }
+
+ return 0;
}
char* tmsrp_uri_tostring(const tmsrp_uri_t *uri)
{
- tsk_buffer_t *output = tsk_buffer_create_null();
- char* ret = 0;
-
- if(!tmsrp_uri_serialize(uri, output)){
- ret = tsk_strndup((const char*)output->data, output->size);
- }
- else{
- TSK_DEBUG_ERROR("Failed to serialize URI.");
- }
-
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ char* ret = 0;
+
+ if(!tmsrp_uri_serialize(uri, output)) {
+ ret = tsk_strndup((const char*)output->data, output->size);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to serialize URI.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
tmsrp_uri_t *tmsrp_uri_clone(const tmsrp_uri_t *uri)
{
- tmsrp_uri_t *newuri = 0;
- tsk_buffer_t *output = tsk_buffer_create_null();
- tmsrp_uri_serialize(uri, output);
- newuri = tmsrp_uri_parse(output->data, output->size);
- TSK_OBJECT_SAFE_FREE(output);
+ tmsrp_uri_t *newuri = 0;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ tmsrp_uri_serialize(uri, output);
+ newuri = tmsrp_uri_parse(output->data, output->size);
+ TSK_OBJECT_SAFE_FREE(output);
- return newuri;
+ return newuri;
}
@@ -147,52 +147,51 @@ tmsrp_uri_t *tmsrp_uri_clone(const tmsrp_uri_t *uri)
//
static tsk_object_t* tmsrp_uri_ctor(tsk_object_t *self, va_list * app)
{
- tmsrp_uri_t *uri = self;
- if(uri){
- uri->scheme = tsk_strdup( va_arg(*app, const char*) );
-
- // authority
- uri->authority.host = tsk_strdup( va_arg(*app, const char*) );
- uri->authority.host_type = va_arg(*app, tmsrp_host_type_t);
- uri->authority.port = va_arg(*app, int32_t);
-
- uri->session_id = tsk_strdup( va_arg(*app, const char*) );
- uri->transport = tsk_strdup( va_arg(*app, const char*) );
-
- uri->params = tsk_list_create(); /* Empty list. */
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new MSRP/MSRPS.");
- }
- return self;
+ tmsrp_uri_t *uri = self;
+ if(uri) {
+ uri->scheme = tsk_strdup( va_arg(*app, const char*) );
+
+ // authority
+ uri->authority.host = tsk_strdup( va_arg(*app, const char*) );
+ uri->authority.host_type = va_arg(*app, tmsrp_host_type_t);
+ uri->authority.port = va_arg(*app, int32_t);
+
+ uri->session_id = tsk_strdup( va_arg(*app, const char*) );
+ uri->transport = tsk_strdup( va_arg(*app, const char*) );
+
+ uri->params = tsk_list_create(); /* Empty list. */
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new MSRP/MSRPS.");
+ }
+ return self;
}
static tsk_object_t* tmsrp_uri_dtor(tsk_object_t *self)
{
- tmsrp_uri_t *uri = self;
- if(uri){
- TSK_FREE(uri->scheme);
- // authority
- TSK_FREE(uri->authority.userinfo);
- TSK_FREE(uri->authority.host);
- //
- TSK_FREE(uri->session_id);
- TSK_FREE(uri->transport);
-
- TSK_OBJECT_SAFE_FREE(uri->params);
- }
- else{
- TSK_DEBUG_ERROR("Null MSRP/MSRPS URI.");
- }
-
- return self;
+ tmsrp_uri_t *uri = self;
+ if(uri) {
+ TSK_FREE(uri->scheme);
+ // authority
+ TSK_FREE(uri->authority.userinfo);
+ TSK_FREE(uri->authority.host);
+ //
+ TSK_FREE(uri->session_id);
+ TSK_FREE(uri->transport);
+
+ TSK_OBJECT_SAFE_FREE(uri->params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null MSRP/MSRPS URI.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tmsrp_uri_def_s =
-{
- sizeof(tmsrp_uri_t),
- tmsrp_uri_ctor,
- tmsrp_uri_dtor,
- tsk_null
+static const tsk_object_def_t tmsrp_uri_def_s = {
+ sizeof(tmsrp_uri_t),
+ tmsrp_uri_ctor,
+ tmsrp_uri_dtor,
+ tsk_null
};
const tsk_object_def_t *tmsrp_uri_def_t = &tmsrp_uri_def_s;
diff --git a/tinyMSRP/test/test/stdafx.c b/tinyMSRP/test/test/stdafx.c
index cc34b11..de4c0ec 100755
--- a/tinyMSRP/test/test/stdafx.c
+++ b/tinyMSRP/test/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/test/test/stdafx.h b/tinyMSRP/test/test/stdafx.h
index 38723b5..05e1cee 100755
--- a/tinyMSRP/test/test/stdafx.h
+++ b/tinyMSRP/test/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyMSRP/test/test/targetver.h b/tinyMSRP/test/test/targetver.h
index 2ad5194..456a4fe 100755
--- a/tinyMSRP/test/test/targetver.h
+++ b/tinyMSRP/test/test/targetver.h
@@ -1,8 +1,8 @@
#ifndef TMSRP_TEST_TARGETVER_H
#define TMSRP_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinyMSRP/test/test/test.c b/tinyMSRP/test/test/test.c
index 9389936..bfdfab7 100755
--- a/tinyMSRP/test/test/test.c
+++ b/tinyMSRP/test/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,26 +48,26 @@ int main()
#endif
{
#if RUN_TEST_LOOP
- for(;;)
+ for(;;)
#endif
- {
- tnet_startup();
+ {
+ tnet_startup();
+
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
-
#if RUN_TEST_ALL || RUN_TEST_URI
- test_uri();
+ test_uri();
#endif
#if RUN_TEST_ALL || RUN_TEST_PARSER
- test_parser();
+ test_parser();
#endif
#if RUN_TEST_ALL || RUN_TEST_SESSION
- test_session();
+ test_session();
#endif
- tnet_cleanup();
- }
+ tnet_cleanup();
+ }
} \ No newline at end of file
diff --git a/tinyMSRP/test/test/test_parser.h b/tinyMSRP/test/test/test_parser.h
index 30eacfa..6a46e49 100755
--- a/tinyMSRP/test/test/test_parser.h
+++ b/tinyMSRP/test/test/test_parser.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,92 +59,92 @@
void test_parser()
{
- tmsrp_message_t *message;
- const tmsrp_header_Dummy_t* header;
- size_t msg_size;
- char* str;
-
- //
- // Serialization / Deserialization
- //
- /* deserialize the message */
- if((message = tmsrp_message_parse_2(MSRP_MSG_TO_TEST, strlen(MSRP_MSG_TO_TEST), &msg_size))){
-
- tmsrp_message_add_headers(message,
- TMSRP_HEADER_DUMMY_VA_ARGS("NS", "imdn <urn:ietf:params:imdn>"),
- TMSRP_HEADER_DUMMY_VA_ARGS("imdn.Message-ID", "MsgiQqFZqTYAA"),
- TMSRP_HEADER_DUMMY_VA_ARGS("DateTime", "2012-10-25T18:02:08.000Z"),
- TMSRP_HEADER_DUMMY_VA_ARGS("imdn.Disposition-Notification", "positive-delivery, display"),
-
- tsk_null);
-
- if((header = (const tmsrp_header_Dummy_t*)tmsrp_message_get_headerByName(message, "NS"))){
- TSK_DEBUG_INFO("NS=%s\n", header->value);
- }
- if((header = (const tmsrp_header_Dummy_t*)tmsrp_message_get_headerByName(message, "imdn.Message-ID"))){
- TSK_DEBUG_INFO("imdn.Message-ID=%s\n", header->value);
- }
-
- /* serialize the message */
- if((str = tmsrp_message_tostring(message))){
- TSK_DEBUG_INFO("\nMSRP Message=\n%s\n\n", str);
- TSK_FREE(str);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse MSRP message(1).");
- }
- TSK_OBJECT_SAFE_FREE(message);
-
- //
- // Create Response from Request
- //
- if((message = tmsrp_message_parse(MSRP_MSG_REQUEST, strlen(MSRP_MSG_REQUEST)))){
- tmsrp_response_t* response = tmsrp_create_response(message, 202, "Accepted");
-
- if((str = tmsrp_message_tostring(response))){
- TSK_DEBUG_INFO("\nMSRP Response=\n%s\n\n", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse MSRP message(2).");
- }
- TSK_OBJECT_SAFE_FREE(message);
-
- //
- // Create Report from Request
- //
- if((message = tmsrp_message_parse(MSRP_MSG_REQUEST, strlen(MSRP_MSG_REQUEST)))){
- tmsrp_request_t* report = tmsrp_create_report(message, 403, "Stop-sending-message");
-
- if((str = tmsrp_message_tostring(report))){
- TSK_DEBUG_INFO("\nMSRP Response=\n%s\n\n", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(report);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse MSRP message(2).");
- }
- TSK_OBJECT_SAFE_FREE(message);
-
- //
- // Create bodiless Request
- //
- {
- tmsrp_request_t* bodiless = tmsrp_create_bodiless(tsk_null, tsk_null);
-
- if((str = tmsrp_message_tostring(bodiless))){
- TSK_DEBUG_INFO("\nMSRP Bodiless=\n%s\n\n", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(bodiless);
- }
+ tmsrp_message_t *message;
+ const tmsrp_header_Dummy_t* header;
+ size_t msg_size;
+ char* str;
+
+ //
+ // Serialization / Deserialization
+ //
+ /* deserialize the message */
+ if((message = tmsrp_message_parse_2(MSRP_MSG_TO_TEST, strlen(MSRP_MSG_TO_TEST), &msg_size))) {
+
+ tmsrp_message_add_headers(message,
+ TMSRP_HEADER_DUMMY_VA_ARGS("NS", "imdn <urn:ietf:params:imdn>"),
+ TMSRP_HEADER_DUMMY_VA_ARGS("imdn.Message-ID", "MsgiQqFZqTYAA"),
+ TMSRP_HEADER_DUMMY_VA_ARGS("DateTime", "2012-10-25T18:02:08.000Z"),
+ TMSRP_HEADER_DUMMY_VA_ARGS("imdn.Disposition-Notification", "positive-delivery, display"),
+
+ tsk_null);
+
+ if((header = (const tmsrp_header_Dummy_t*)tmsrp_message_get_headerByName(message, "NS"))) {
+ TSK_DEBUG_INFO("NS=%s\n", header->value);
+ }
+ if((header = (const tmsrp_header_Dummy_t*)tmsrp_message_get_headerByName(message, "imdn.Message-ID"))) {
+ TSK_DEBUG_INFO("imdn.Message-ID=%s\n", header->value);
+ }
+
+ /* serialize the message */
+ if((str = tmsrp_message_tostring(message))) {
+ TSK_DEBUG_INFO("\nMSRP Message=\n%s\n\n", str);
+ TSK_FREE(str);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse MSRP message(1).");
+ }
+ TSK_OBJECT_SAFE_FREE(message);
+
+ //
+ // Create Response from Request
+ //
+ if((message = tmsrp_message_parse(MSRP_MSG_REQUEST, strlen(MSRP_MSG_REQUEST)))) {
+ tmsrp_response_t* response = tmsrp_create_response(message, 202, "Accepted");
+
+ if((str = tmsrp_message_tostring(response))) {
+ TSK_DEBUG_INFO("\nMSRP Response=\n%s\n\n", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse MSRP message(2).");
+ }
+ TSK_OBJECT_SAFE_FREE(message);
+
+ //
+ // Create Report from Request
+ //
+ if((message = tmsrp_message_parse(MSRP_MSG_REQUEST, strlen(MSRP_MSG_REQUEST)))) {
+ tmsrp_request_t* report = tmsrp_create_report(message, 403, "Stop-sending-message");
+
+ if((str = tmsrp_message_tostring(report))) {
+ TSK_DEBUG_INFO("\nMSRP Response=\n%s\n\n", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(report);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse MSRP message(2).");
+ }
+ TSK_OBJECT_SAFE_FREE(message);
+
+ //
+ // Create bodiless Request
+ //
+ {
+ tmsrp_request_t* bodiless = tmsrp_create_bodiless(tsk_null, tsk_null);
+
+ if((str = tmsrp_message_tostring(bodiless))) {
+ TSK_DEBUG_INFO("\nMSRP Bodiless=\n%s\n\n", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(bodiless);
+ }
}
#endif /* _TEST_MSRPPARSER_H */
diff --git a/tinyMSRP/test/test/test_session.h b/tinyMSRP/test/test/test_session.h
index 6ee1a56..5636865 100755
--- a/tinyMSRP/test/test/test_session.h
+++ b/tinyMSRP/test/test/test_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,79 +47,79 @@
void test_session()
{
- tmedia_t* msrp = tsk_null;
- char* str;
- const tsdp_header_M_t *m;
- tsdp_message_t* remote;
-
- // Register dummy media
- tmedia_plugin_register(tmsrp_media_plugin_def_t);
-
- if((msrp = tmedia_factory_create("msrp", TNET_SOCKET_HOST_ANY, tnet_socket_type_tcp_ipv4))){
-
- // Get offer
- if((m = tmedia_get_local_offer(msrp,
- TSDP_HEADER_I_VA_ARGS("This is my latest picture"),
- TSDP_HEADER_A_VA_ARGS("sendonly", tsk_null),
- TSDP_HEADER_A_VA_ARGS("file-selector", "\"My cool picture.jpg\" type:image/jpeg size:32349 hash:sha-1:72:24:5F:E8:65:3D:DA:F3:71:36:2F:86:D4:71:91:3E:E4:A2:CE:2E"),
- TSDP_HEADER_A_VA_ARGS("file-transfer-id", "vBnG916bdberum2fFEABR1FR3ExZMUrd"),
- TSDP_HEADER_A_VA_ARGS("file-disposition", "attachment"),
- TSDP_HEADER_A_VA_ARGS("file-date", "creation:\"Mon, 15 May 2006 15:01:31 +0300\""),
- TSDP_HEADER_A_VA_ARGS("file-icon", "cid:id2@alicepc.example.com"),
- TSDP_HEADER_A_VA_ARGS("file-range", "1-32349"),
-
- TSDP_HEADER_DUMMY_VA_ARGS("x", "007"),
-
- tsk_null
- ))){
- if((str = tsdp_header_tostring(TSDP_HEADER(m)))){
- TSK_DEBUG_INFO("m(offer)=%s", str);
- TSK_FREE(str);
- }
- }
-
- /*if((m = tmedia_get_local_offer(msrp,
- TSDP_HEADER_I_VA_ARGS("Message Transfer"),
- TSDP_HEADER_A_VA_ARGS("accept-types", "text/plain")
-
- tsk_null
- ))){
- if((str = tsdp_header_tostring(TSDP_HEADER(m)))){
- TSK_DEBUG_INFO("m(offer)=%s", str);
- TSK_FREE(str);
- }
- }*/
-
- // Set offer
- if((remote = tsdp_message_parse(REMOTE_SDP, strlen(REMOTE_SDP)))){
- tmedia_set_remote_offer(msrp, remote);
- TSK_OBJECT_SAFE_FREE(remote);
- }
-
- tmedia_get_negotiated_offer(msrp);
-
- tmedia_start(msrp);
- //tmedia_pause(msrp);
-
- /*
- tmedia_perform(msrp, tma_msrp_send_data,
- TSK_PARAM_VA_ARGS("Content", "hello world!"),
-
- tsk_null);
- */
-
- tmedia_perform(msrp, tma_msrp_send_file,
- TSK_PARAM_VA_ARGS("Path", "C:\\Projects\\Doubango\\doubango.ncb"),
-
- tsk_null);
-
-
- getchar();
-
- tmedia_stop(msrp);
-
- TSK_OBJECT_SAFE_FREE(msrp);
- }
+ tmedia_t* msrp = tsk_null;
+ char* str;
+ const tsdp_header_M_t *m;
+ tsdp_message_t* remote;
+
+ // Register dummy media
+ tmedia_plugin_register(tmsrp_media_plugin_def_t);
+
+ if((msrp = tmedia_factory_create("msrp", TNET_SOCKET_HOST_ANY, tnet_socket_type_tcp_ipv4))) {
+
+ // Get offer
+ if((m = tmedia_get_local_offer(msrp,
+ TSDP_HEADER_I_VA_ARGS("This is my latest picture"),
+ TSDP_HEADER_A_VA_ARGS("sendonly", tsk_null),
+ TSDP_HEADER_A_VA_ARGS("file-selector", "\"My cool picture.jpg\" type:image/jpeg size:32349 hash:sha-1:72:24:5F:E8:65:3D:DA:F3:71:36:2F:86:D4:71:91:3E:E4:A2:CE:2E"),
+ TSDP_HEADER_A_VA_ARGS("file-transfer-id", "vBnG916bdberum2fFEABR1FR3ExZMUrd"),
+ TSDP_HEADER_A_VA_ARGS("file-disposition", "attachment"),
+ TSDP_HEADER_A_VA_ARGS("file-date", "creation:\"Mon, 15 May 2006 15:01:31 +0300\""),
+ TSDP_HEADER_A_VA_ARGS("file-icon", "cid:id2@alicepc.example.com"),
+ TSDP_HEADER_A_VA_ARGS("file-range", "1-32349"),
+
+ TSDP_HEADER_DUMMY_VA_ARGS("x", "007"),
+
+ tsk_null
+ ))) {
+ if((str = tsdp_header_tostring(TSDP_HEADER(m)))) {
+ TSK_DEBUG_INFO("m(offer)=%s", str);
+ TSK_FREE(str);
+ }
+ }
+
+ /*if((m = tmedia_get_local_offer(msrp,
+ TSDP_HEADER_I_VA_ARGS("Message Transfer"),
+ TSDP_HEADER_A_VA_ARGS("accept-types", "text/plain")
+
+ tsk_null
+ ))){
+ if((str = tsdp_header_tostring(TSDP_HEADER(m)))){
+ TSK_DEBUG_INFO("m(offer)=%s", str);
+ TSK_FREE(str);
+ }
+ }*/
+
+ // Set offer
+ if((remote = tsdp_message_parse(REMOTE_SDP, strlen(REMOTE_SDP)))) {
+ tmedia_set_remote_offer(msrp, remote);
+ TSK_OBJECT_SAFE_FREE(remote);
+ }
+
+ tmedia_get_negotiated_offer(msrp);
+
+ tmedia_start(msrp);
+ //tmedia_pause(msrp);
+
+ /*
+ tmedia_perform(msrp, tma_msrp_send_data,
+ TSK_PARAM_VA_ARGS("Content", "hello world!"),
+
+ tsk_null);
+ */
+
+ tmedia_perform(msrp, tma_msrp_send_file,
+ TSK_PARAM_VA_ARGS("Path", "C:\\Projects\\Doubango\\doubango.ncb"),
+
+ tsk_null);
+
+
+ getchar();
+
+ tmedia_stop(msrp);
+
+ TSK_OBJECT_SAFE_FREE(msrp);
+ }
}
#endif /* _TEST_MSRPSESSION_H */
diff --git a/tinyMSRP/test/test/test_uri.h b/tinyMSRP/test/test/test_uri.h
index 1b4c1b3..f0d9544 100755
--- a/tinyMSRP/test/test/test_uri.h
+++ b/tinyMSRP/test/test/test_uri.h
@@ -24,90 +24,87 @@
#include "tinymsrp/parsers/tmsrp_parser_uri.h"
-const char* uris[] =
-{
- "msrp://atlanta.example.com:7654/jshA7weztas;tcp;p1=1;p2=2",
- "msrps://atlanta.example.com:7654/jshA7weztas;tcp",
-
- // hostname, IPv4 and IPv6 (without userinfo and with port)
- "msrp://biloxi.msrp.com:12763/kjhd37s2s20w2a;sctp",
- "msrps://192.168.0.10:7654/jshA7weztas;tcp;p3=4",
- "msrps://[::127]:7654/jshA7weztas;tcp;p=0",
-
- // hostname, IPv4 and IPv6 (without userinfo and without port)
- "msrp://biloxi.msrp.com/kjhd37s2s20w2a;sctp",
- "msrps://192.168.0.10/jshA7weztas;tcp;p3=4",
- "msrps://[::127]/jshA7weztas;tcp;p=0",
-
- // hostname, IPv4 and IPv6 (with userinfo and with port)
- "msrp://bob@biloxi.msrp.com:12763/kjhd37s2s20w2a;sctp",
- "msrps://alice@192.168.0.10:7654/jshA7weztas;tcp;p3=4",
- "msrps://carol@[::127]:7654/jshA7weztas;tcp;p=0",
-
- // hostname, IPv4 and IPv6 (with userinfo and without port)
- "msrp://bob@biloxi.msrp.com/kjhd37s2s20w2a;sctp",
- "msrps://alice@192.168.0.10/jshA7weztas;tcp;p3=4",
- "msrps://carol@[::127]/jshA7weztas;tcp;p=0",
-
- // without session_id
- "msrps://[::127]:7654;tcp;p=0",
+const char* uris[] = {
+ "msrp://atlanta.example.com:7654/jshA7weztas;tcp;p1=1;p2=2",
+ "msrps://atlanta.example.com:7654/jshA7weztas;tcp",
+
+ // hostname, IPv4 and IPv6 (without userinfo and with port)
+ "msrp://biloxi.msrp.com:12763/kjhd37s2s20w2a;sctp",
+ "msrps://192.168.0.10:7654/jshA7weztas;tcp;p3=4",
+ "msrps://[::127]:7654/jshA7weztas;tcp;p=0",
+
+ // hostname, IPv4 and IPv6 (without userinfo and without port)
+ "msrp://biloxi.msrp.com/kjhd37s2s20w2a;sctp",
+ "msrps://192.168.0.10/jshA7weztas;tcp;p3=4",
+ "msrps://[::127]/jshA7weztas;tcp;p=0",
+
+ // hostname, IPv4 and IPv6 (with userinfo and with port)
+ "msrp://bob@biloxi.msrp.com:12763/kjhd37s2s20w2a;sctp",
+ "msrps://alice@192.168.0.10:7654/jshA7weztas;tcp;p3=4",
+ "msrps://carol@[::127]:7654/jshA7weztas;tcp;p=0",
+
+ // hostname, IPv4 and IPv6 (with userinfo and without port)
+ "msrp://bob@biloxi.msrp.com/kjhd37s2s20w2a;sctp",
+ "msrps://alice@192.168.0.10/jshA7weztas;tcp;p3=4",
+ "msrps://carol@[::127]/jshA7weztas;tcp;p=0",
+
+ // without session_id
+ "msrps://[::127]:7654;tcp;p=0",
};
void test_uri_tostring(const tmsrp_uri_t *uri)
{
- char* ret = tmsrp_uri_tostring(uri);
- TSK_DEBUG_INFO("uri_to_string=%s", ret);
- TSK_FREE(ret);
+ char* ret = tmsrp_uri_tostring(uri);
+ TSK_DEBUG_INFO("uri_to_string=%s", ret);
+ TSK_FREE(ret);
}
void test_uri_parser()
{
- int i;
- tsk_list_item_t *item = 0;
-
- for(i=0; i<sizeof(uris)/sizeof(const char*); i++)
- {
- tmsrp_uri_t *uri = tmsrp_uri_parse(uris[i], strlen(uris[i]));
-
- printf("\n== Parsing {{ %s }} ==\n\n", uris[i]);
-
- if(uri)
- {
- printf("scheme: %s\n", uri->scheme);
- printf("userinfo: %s\n", uri->authority.userinfo);
- printf("host: %s\n", uri->authority.host);
- printf("port: %d\n", uri->authority.port);
- printf("host-type: %s\n", uri->authority.host_type == tmsrp_host_ipv4 ? "IPv4" : (uri->authority.host_type == tmsrp_host_ipv6 ? "IPv6" : (uri->authority.host_type == tmsrp_host_hostname ? "HOSTNAME" : "UNKNOWN")) );
- printf("session-id: %s\n", uri->session_id);
- printf("transport: %s\n", uri->transport);
-
- printf("---PARAMS---\n");
-
- /* dump all parameters */
- tsk_list_foreach(item, uri->params){
- tsk_param_t* param = item->data;
- printf("-->%s=%s\n", param->name, param->value);
- }
-
- printf("Is-secure: %s\n", TMSRP_URI_IS_SECURE(uri) ? "YES" : "NO");
-
- test_uri_tostring(uri);
- }
- else{
- printf("INVALID MSRP URI.\n");
- }
-
- printf("\n\n");
- getchar();
-
- TSK_OBJECT_SAFE_FREE(uri);
- }
+ int i;
+ tsk_list_item_t *item = 0;
+
+ for(i=0; i<sizeof(uris)/sizeof(const char*); i++) {
+ tmsrp_uri_t *uri = tmsrp_uri_parse(uris[i], strlen(uris[i]));
+
+ printf("\n== Parsing {{ %s }} ==\n\n", uris[i]);
+
+ if(uri) {
+ printf("scheme: %s\n", uri->scheme);
+ printf("userinfo: %s\n", uri->authority.userinfo);
+ printf("host: %s\n", uri->authority.host);
+ printf("port: %d\n", uri->authority.port);
+ printf("host-type: %s\n", uri->authority.host_type == tmsrp_host_ipv4 ? "IPv4" : (uri->authority.host_type == tmsrp_host_ipv6 ? "IPv6" : (uri->authority.host_type == tmsrp_host_hostname ? "HOSTNAME" : "UNKNOWN")) );
+ printf("session-id: %s\n", uri->session_id);
+ printf("transport: %s\n", uri->transport);
+
+ printf("---PARAMS---\n");
+
+ /* dump all parameters */
+ tsk_list_foreach(item, uri->params) {
+ tsk_param_t* param = item->data;
+ printf("-->%s=%s\n", param->name, param->value);
+ }
+
+ printf("Is-secure: %s\n", TMSRP_URI_IS_SECURE(uri) ? "YES" : "NO");
+
+ test_uri_tostring(uri);
+ }
+ else {
+ printf("INVALID MSRP URI.\n");
+ }
+
+ printf("\n\n");
+ getchar();
+
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
}
void test_uri()
{
- test_uri_parser();
+ test_uri_parser();
}
#endif /* _TEST_MSRPURI_H */
diff --git a/tinyNET/src/dhcp/tnet_dhcp.c b/tinyNET/src/dhcp/tnet_dhcp.c
index efd57c5..80a1150 100755
--- a/tinyNET/src/dhcp/tnet_dhcp.c
+++ b/tinyNET/src/dhcp/tnet_dhcp.c
@@ -47,7 +47,7 @@
*/
tnet_dhcp_ctx_t* tnet_dhcp_ctx_create()
{
- return tsk_object_new(tnet_dhcp_ctx_def_t);
+ return tsk_object_new(tnet_dhcp_ctx_def_t);
}
/**@ingroup tnet_dhcp_group
@@ -55,7 +55,7 @@ tnet_dhcp_ctx_t* tnet_dhcp_ctx_create()
*/
tnet_dhcp_params_t* tnet_dhcp_params_create()
{
- return tsk_object_new(tnet_dhcp_params_def_t);
+ return tsk_object_new(tnet_dhcp_params_def_t);
}
/* FIXME: USE retransmission mech (*2*2...)
@@ -64,189 +64,191 @@ tnet_dhcp_params_t* tnet_dhcp_params_create()
*/
tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_request_t* request)
{
- tsk_buffer_t *output;
- tnet_dhcp_reply_t* reply = tsk_null;
- int ret;
- struct timeval tv;
- fd_set set;
- uint64_t timeout = 0;
- tsk_list_item_t *item;
- const tnet_interface_t *iface;
-
- tnet_socket_t *localsocket4 = tsk_null;
- struct sockaddr_storage server;
-
- if (!ctx || !request){
- goto bail;
- }
-
- localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv4);
- if (!TNET_SOCKET_IS_VALID(localsocket4)){
- TSK_DEBUG_ERROR("Failed to create/bind DHCP client socket.");
- goto bail;
- }
-
- /* Always wait for 200ms before retransmission */
- tv.tv_sec = 0;
- tv.tv_usec = (200 * 1000);
-
- if (tnet_sockaddr_init("255.255.255.255", ctx->server_port, tnet_socket_type_udp_ipv4, &server)){
- TNET_PRINT_LAST_ERROR("Failed to initialize the DHCP server address");
- goto bail;
- }
-
- /* ENABLE BROADCASTING */
- {
+ tsk_buffer_t *output;
+ tnet_dhcp_reply_t* reply = tsk_null;
+ int ret;
+ struct timeval tv;
+ fd_set set;
+ uint64_t timeout = 0;
+ tsk_list_item_t *item;
+ const tnet_interface_t *iface;
+
+ tnet_socket_t *localsocket4 = tsk_null;
+ struct sockaddr_storage server;
+
+ if (!ctx || !request) {
+ goto bail;
+ }
+
+ localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv4);
+ if (!TNET_SOCKET_IS_VALID(localsocket4)) {
+ TSK_DEBUG_ERROR("Failed to create/bind DHCP client socket.");
+ goto bail;
+ }
+
+ /* Always wait for 200ms before retransmission */
+ tv.tv_sec = 0;
+ tv.tv_usec = (200 * 1000);
+
+ if (tnet_sockaddr_init("255.255.255.255", ctx->server_port, tnet_socket_type_udp_ipv4, &server)) {
+ TNET_PRINT_LAST_ERROR("Failed to initialize the DHCP server address");
+ goto bail;
+ }
+
+ /* ENABLE BROADCASTING */
+ {
#if defined(SOLARIS)
- char yes = '1';
+ char yes = '1';
#else
- int yes = 1;
+ int yes = 1;
#endif
- if (setsockopt(localsocket4->fd, SOL_SOCKET, SO_BROADCAST, (char*)&yes, sizeof(int))){
- TNET_PRINT_LAST_ERROR("Failed to enable broadcast option");
- goto bail;
- }
- }
-
- /* Set timeout */
- timeout = tsk_time_now() + ctx->timeout;
-
- do
- {
- /* RFC 2131 - 3.6 Use of DHCP in clients with multiple interfaces
- A client with multiple network interfaces must use DHCP through each
- interface independently to obtain configuration information
- parameters for those separate interfaces.
- */
-
- tsk_list_foreach(item, ctx->interfaces){
- iface = item->data;
-
- /* Set FD */
- FD_ZERO(&set);
- FD_SET(localsocket4->fd, &set);
-
- /* ciaddr */
- if (request->type == dhcp_type_inform){
- struct sockaddr_storage ss;
- if (!tnet_getsockname(localsocket4->fd, &ss)){
- uint32_t addr = (uint32_t)tnet_htonl_2(&((struct sockaddr_in*)&ss)->sin_addr);
- memcpy(&request->ciaddr, &addr, 4);
- }
- }
-
- /* chaddr */
- memset(request->chaddr, 0, sizeof(request->chaddr));
- request->hlen = (uint8_t)(iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length);
- memcpy(request->chaddr, iface->mac_address, request->hlen);
-
- /* Serialize and send to the server. */
- if (!(output = tnet_dhcp_message_serialize(ctx, request))){
- TSK_DEBUG_ERROR("Failed to serialize the DHCP message.");
- goto next_iface;
- }
- /* Send the request to the DHCP server */
- if ((ret = tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size)) < 0){
- TNET_PRINT_LAST_ERROR("Failed to send DHCP request");
-
- tsk_thread_sleep(150); // wait 150ms before trying the next iface.
- goto next_iface;
- }
- /* wait for response */
- if ((ret = select(localsocket4->fd + 1, &set, NULL, NULL, &tv)) < 0){ /* Error */
- TNET_PRINT_LAST_ERROR("select have failed.");
- tsk_thread_sleep(150); // wait 150ms before trying the next iface.
- goto next_iface;
- }
- else if (ret == 0)
- { /* timeout ==> do nothing */
- }
- else
- { /* there is data to read */
- unsigned int len = 0;
- void* data = tsk_null;
-
- /* Check how how many bytes are pending */
- if ((ret = tnet_ioctlt(localsocket4->fd, FIONREAD, &len)) < 0){
- goto next_iface;
- }
-
- /* Receive pending data */
- data = tsk_calloc(len, sizeof(uint8_t));
- if ((ret = tnet_sockfd_recv(localsocket4->fd, data, len, 0)) < 0){
- TSK_FREE(data);
-
- TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams.");
- goto next_iface;
- }
-
- /* Parse the incoming response. */
- reply = tnet_dhcp_message_deserialize(ctx, data, (tsk_size_t)ret);
- TSK_FREE(data);
-
- if (reply)
- { /* response successfuly parsed */
- if (request->xid != reply->xid)
- { /* Not same transaction id ==> continue*/
- TSK_OBJECT_SAFE_FREE(reply);
- }
- }
- }
-
- next_iface:
- TSK_OBJECT_SAFE_FREE(output);
- if (reply){
- goto bail;
- }
- }
- //break;//FIXME
- } while (timeout > tsk_time_epoch());
+ if (setsockopt(localsocket4->fd, SOL_SOCKET, SO_BROADCAST, (char*)&yes, sizeof(int))) {
+ TNET_PRINT_LAST_ERROR("Failed to enable broadcast option");
+ goto bail;
+ }
+ }
+
+ /* Set timeout */
+ timeout = tsk_time_now() + ctx->timeout;
+
+ do {
+ /* RFC 2131 - 3.6 Use of DHCP in clients with multiple interfaces
+ A client with multiple network interfaces must use DHCP through each
+ interface independently to obtain configuration information
+ parameters for those separate interfaces.
+ */
+
+ tsk_list_foreach(item, ctx->interfaces) {
+ iface = item->data;
+
+ /* Set FD */
+ FD_ZERO(&set);
+ FD_SET(localsocket4->fd, &set);
+
+ /* ciaddr */
+ if (request->type == dhcp_type_inform) {
+ struct sockaddr_storage ss;
+ if (!tnet_getsockname(localsocket4->fd, &ss)) {
+ uint32_t addr = (uint32_t)tnet_htonl_2(&((struct sockaddr_in*)&ss)->sin_addr);
+ memcpy(&request->ciaddr, &addr, 4);
+ }
+ }
+
+ /* chaddr */
+ memset(request->chaddr, 0, sizeof(request->chaddr));
+ request->hlen = (uint8_t)(iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length);
+ memcpy(request->chaddr, iface->mac_address, request->hlen);
+
+ /* Serialize and send to the server. */
+ if (!(output = tnet_dhcp_message_serialize(ctx, request))) {
+ TSK_DEBUG_ERROR("Failed to serialize the DHCP message.");
+ goto next_iface;
+ }
+ /* Send the request to the DHCP server */
+ if ((ret = tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size)) < 0) {
+ TNET_PRINT_LAST_ERROR("Failed to send DHCP request");
+
+ tsk_thread_sleep(150); // wait 150ms before trying the next iface.
+ goto next_iface;
+ }
+ /* wait for response */
+ if ((ret = select(localsocket4->fd + 1, &set, NULL, NULL, &tv)) < 0) { /* Error */
+ TNET_PRINT_LAST_ERROR("select have failed.");
+ tsk_thread_sleep(150); // wait 150ms before trying the next iface.
+ goto next_iface;
+ }
+ else if (ret == 0) {
+ /* timeout ==> do nothing */
+ }
+ else {
+ /* there is data to read */
+ unsigned int len = 0;
+ void* data = tsk_null;
+
+ /* Check how how many bytes are pending */
+ if ((ret = tnet_ioctlt(localsocket4->fd, FIONREAD, &len)) < 0) {
+ goto next_iface;
+ }
+
+ /* Receive pending data */
+ data = tsk_calloc(len, sizeof(uint8_t));
+ if ((ret = tnet_sockfd_recv(localsocket4->fd, data, len, 0)) < 0) {
+ TSK_FREE(data);
+
+ TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams.");
+ goto next_iface;
+ }
+
+ /* Parse the incoming response. */
+ reply = tnet_dhcp_message_deserialize(ctx, data, (tsk_size_t)ret);
+ TSK_FREE(data);
+
+ if (reply) {
+ /* response successfuly parsed */
+ if (request->xid != reply->xid) {
+ /* Not same transaction id ==> continue*/
+ TSK_OBJECT_SAFE_FREE(reply);
+ }
+ }
+ }
+
+next_iface:
+ TSK_OBJECT_SAFE_FREE(output);
+ if (reply) {
+ goto bail;
+ }
+ }
+ //break;//FIXME
+ }
+ while (timeout > tsk_time_epoch());
bail:
- TSK_OBJECT_SAFE_FREE(localsocket4);
+ TSK_OBJECT_SAFE_FREE(localsocket4);
- return reply;
+ return reply;
}
/**@ingroup tnet_dhcp_group
*/
tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_message_type_t type, tnet_dhcp_params_t* params)
{
- tnet_dhcp_reply_t* reply = tsk_null;
- tnet_dhcp_request_t* request = tnet_dhcp_request_create();
+ tnet_dhcp_reply_t* reply = tsk_null;
+ tnet_dhcp_request_t* request = tnet_dhcp_request_create();
- if (!ctx || !params || !request){
- goto bail;
- }
+ if (!ctx || !params || !request) {
+ goto bail;
+ }
- request->type = type;
- tnet_dhcp_message_add_codes(request, params->codes, params->codes_count);
+ request->type = type;
+ tnet_dhcp_message_add_codes(request, params->codes, params->codes_count);
- reply = tnet_dhcp_send_request(ctx, request);
+ reply = tnet_dhcp_send_request(ctx, request);
bail:
- TSK_OBJECT_SAFE_FREE(request);
+ TSK_OBJECT_SAFE_FREE(request);
- return reply;
+ return reply;
}
/**@ingroup tnet_dhcp_group
*/
int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_t code)
{
- if (params){
- if (params->codes_count < TNET_DHCP_MAX_CODES){
- unsigned i;
- for (i = 0; i < params->codes_count; i++){
- if (params->codes[i] == code){
- return -3;
- }
- }
- params->codes[params->codes_count++] = code;
- }
- else return -2;
- }
- return -1;
+ if (params) {
+ if (params->codes_count < TNET_DHCP_MAX_CODES) {
+ unsigned i;
+ for (i = 0; i < params->codes_count; i++) {
+ if (params->codes[i] == code) {
+ return -3;
+ }
+ }
+ params->codes[params->codes_count++] = code;
+ }
+ else {
+ return -2;
+ }
+ }
+ return -1;
}
@@ -256,49 +258,48 @@ int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_
//
static tsk_object_t* tnet_dhcp_ctx_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_ctx_t *ctx = self;
- if (ctx){
- tnet_host_t host;
-
- ctx->vendor_id = tsk_strdup(TNET_DHCP_VENDOR_ID_DEFAULT);
- if (!tnet_gethostname(&host)){
- ctx->hostname = tsk_strndup(host, tsk_strlen(host));
- }
- ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT;
- ctx->max_msg_size = TNET_DHCP_MAX_MSG_SIZE;
- ctx->port_client = TNET_DHCP_CLIENT_PORT;
- ctx->server_port = TNET_DHCP_SERVER_PORT;
- ctx->interfaces = tnet_get_interfaces();
-
- if (!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces)){
- TSK_DEBUG_ERROR("Failed to retrieve network interfaces.");
- }
-
- tsk_safeobj_init(ctx);
- }
- return self;
+ tnet_dhcp_ctx_t *ctx = self;
+ if (ctx) {
+ tnet_host_t host;
+
+ ctx->vendor_id = tsk_strdup(TNET_DHCP_VENDOR_ID_DEFAULT);
+ if (!tnet_gethostname(&host)) {
+ ctx->hostname = tsk_strndup(host, tsk_strlen(host));
+ }
+ ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT;
+ ctx->max_msg_size = TNET_DHCP_MAX_MSG_SIZE;
+ ctx->port_client = TNET_DHCP_CLIENT_PORT;
+ ctx->server_port = TNET_DHCP_SERVER_PORT;
+ ctx->interfaces = tnet_get_interfaces();
+
+ if (!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces)) {
+ TSK_DEBUG_ERROR("Failed to retrieve network interfaces.");
+ }
+
+ tsk_safeobj_init(ctx);
+ }
+ return self;
}
static tsk_object_t* tnet_dhcp_ctx_dtor(tsk_object_t * self)
{
- tnet_dhcp_ctx_t *ctx = self;
- if (ctx){
- tsk_safeobj_deinit(ctx);
+ tnet_dhcp_ctx_t *ctx = self;
+ if (ctx) {
+ tsk_safeobj_deinit(ctx);
- TSK_FREE(ctx->vendor_id);
- TSK_FREE(ctx->hostname);
+ TSK_FREE(ctx->vendor_id);
+ TSK_FREE(ctx->hostname);
- TSK_OBJECT_SAFE_FREE(ctx->interfaces);
- }
- return self;
+ TSK_OBJECT_SAFE_FREE(ctx->interfaces);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_ctx_def_s =
-{
- sizeof(tnet_dhcp_ctx_t),
- tnet_dhcp_ctx_ctor,
- tnet_dhcp_ctx_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_ctx_def_s = {
+ sizeof(tnet_dhcp_ctx_t),
+ tnet_dhcp_ctx_ctor,
+ tnet_dhcp_ctx_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_ctx_def_t = &tnet_dhcp_ctx_def_s;
@@ -307,25 +308,24 @@ const tsk_object_def_t *tnet_dhcp_ctx_def_t = &tnet_dhcp_ctx_def_s;
//
static tsk_object_t* tnet_dhcp_params_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_params_t *params = self;
- if (params){
- }
- return self;
+ tnet_dhcp_params_t *params = self;
+ if (params) {
+ }
+ return self;
}
static tsk_object_t* tnet_dhcp_params_dtor(tsk_object_t * self)
{
- tnet_dhcp_params_t *params = self;
- if (params){
- }
- return self;
+ tnet_dhcp_params_t *params = self;
+ if (params) {
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_params_def_s =
-{
- sizeof(tnet_dhcp_params_t),
- tnet_dhcp_params_ctor,
- tnet_dhcp_params_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_params_def_s = {
+ sizeof(tnet_dhcp_params_t),
+ tnet_dhcp_params_ctor,
+ tnet_dhcp_params_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_params_def_t = &tnet_dhcp_params_def_s;
diff --git a/tinyNET/src/dhcp/tnet_dhcp.h b/tinyNET/src/dhcp/tnet_dhcp.h
index 9572641..0751914 100755
--- a/tinyNET/src/dhcp/tnet_dhcp.h
+++ b/tinyNET/src/dhcp/tnet_dhcp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,8 +42,8 @@
TNET_BEGIN_DECLS
-/**@ingroup tnet_dhcp_group
-* Default timeout (in milliseconds) value for DHCP requests.
+/**@ingroup tnet_dhcp_group
+* Default timeout (in milliseconds) value for DHCP requests.
*/
#define TNET_DHCP_TIMEOUT_DEFAULT 2000
@@ -70,32 +70,30 @@ TNET_BEGIN_DECLS
/**@ingroup tnet_dhcp_group
* Parameter Request List (55)
*/
-typedef struct tnet_dhcp_params_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_dhcp_params_s {
+ TSK_DECLARE_OBJECT;
- tnet_dhcp_option_code_t codes[TNET_DHCP_MAX_CODES];
- unsigned codes_count;
+ tnet_dhcp_option_code_t codes[TNET_DHCP_MAX_CODES];
+ unsigned codes_count;
}
tnet_dhcp_params_t;
/**@ingroup tnet_dhcp_group
*/
-typedef struct tnet_dhcp_ctx_s
-{
- TSK_DECLARE_OBJECT;
-
- char* vendor_id;
- char* hostname;
- uint16_t max_msg_size; /**< Option code 57. */
-
- uint64_t timeout;
-
- tnet_port_t port_client; /**< Local port to bind to for incloming DHCP messages. Default: 68 */
- tnet_port_t server_port; /**< Destination port for outgoing DHCP messages. Default: 64 */
- tnet_interfaces_L_t *interfaces;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tnet_dhcp_ctx_s {
+ TSK_DECLARE_OBJECT;
+
+ char* vendor_id;
+ char* hostname;
+ uint16_t max_msg_size; /**< Option code 57. */
+
+ uint64_t timeout;
+
+ tnet_port_t port_client; /**< Local port to bind to for incloming DHCP messages. Default: 68 */
+ tnet_port_t server_port; /**< Destination port for outgoing DHCP messages. Default: 64 */
+ tnet_interfaces_L_t *interfaces;
+
+ TSK_DECLARE_SAFEOBJ;
}
tnet_dhcp_ctx_t;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_message.c b/tinyNET/src/dhcp/tnet_dhcp_message.c
index 005327d..3e24474 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_message.c
+++ b/tinyNET/src/dhcp/tnet_dhcp_message.c
@@ -35,278 +35,276 @@
tnet_dhcp_message_t* tnet_dhcp_message_create(tnet_dhcp_message_op_t opcode)
{
- return tsk_object_new(tnet_dhcp_message_def_t, opcode);
+ return tsk_object_new(tnet_dhcp_message_def_t, opcode);
}
tnet_dhcp_request_t* tnet_dhcp_request_create()
{
- return tnet_dhcp_message_create(dhcp_op_bootrequest);
+ return tnet_dhcp_message_create(dhcp_op_bootrequest);
}
tnet_dhcp_message_t* tnet_dhcp_reply_create()
{
- return tnet_dhcp_message_create(dhcp_op_bootreply);
+ return tnet_dhcp_message_create(dhcp_op_bootreply);
}
tsk_buffer_t* tnet_dhcp_message_serialize(const tnet_dhcp_ctx_t *ctx, const tnet_dhcp_message_t *message)
{
- tsk_buffer_t* output = 0;
- uint8_t _1byte;
- uint16_t _2bytes;
- uint32_t _4bytes;
-
- /* Check message validity */
- if (!message){
- goto bail;
- }
-
- output = tsk_buffer_create_null();
-
- /*== OP HTYPE HLEN HOPS */
- _4bytes = (((uint32_t)(message->op)) << 24) |
- (((uint32_t)(message->htype)) << 16) |
- (((uint16_t)(message->hlen)) << 8) | message->hops;
- _4bytes = (uint32_t)tnet_ntohl(_4bytes);
- tsk_buffer_append(output, &(_4bytes), 4);
-
- /*== XID */
- _4bytes = (uint32_t)tnet_ntohl(message->xid);
- tsk_buffer_append(output, &(_4bytes), 4);
- /*== SECS */
- _2bytes = tnet_ntohs(message->secs);
- tsk_buffer_append(output, &(_2bytes), 2);
- /*== FLAGS */
- _2bytes = tnet_ntohs(message->flags);
- tsk_buffer_append(output, &(_2bytes), 2);
- /*== CIADDR */
- _4bytes = (uint32_t)tnet_ntohl(message->ciaddr);
- tsk_buffer_append(output, &(_4bytes), 4);
- /*== YIADDR */
- _4bytes = (uint32_t)tnet_ntohl(message->yiaddr);
- tsk_buffer_append(output, &(_4bytes), 4);
- /*== SIADDR */
- _4bytes = (uint32_t)tnet_ntohl(message->siaddr);
- tsk_buffer_append(output, &(_4bytes), 4);
- /*== GIADDR */
- _4bytes = (uint32_t)tnet_ntohl(message->giaddr);
- tsk_buffer_append(output, &(_4bytes), 4);
- /*== CHADDR */
- tsk_buffer_append(output, message->chaddr, sizeof(message->chaddr));
- /*== sname (unused) */
- tsk_buffer_append(output, message->sname, sizeof(message->sname));
- /*== file (unused) */
- tsk_buffer_append(output, message->file, sizeof(message->file));
- /*== Magic Cookie */
- _4bytes = (uint32_t)tnet_ntohl(TNET_DHCP_MAGIC_COOKIE);
- tsk_buffer_append(output, &(_4bytes), 4);
-
- /*== Message Type (option 53)
- */
- tnet_dhcp_option_serializeex(dhcp_code_DHCP_Msg_Type, 1, &message->type, output);
-
- /*== Client Identifier (option 61) ==> RFC 2132 - 9.14. Client-identifier
- Code Len Type Client-Identifier
- +-----+-----+-----+-----+-----+---
- | 61 | n | t1 | i1 | i2 | ...
- +-----+-----+-----+-----+-----+---
- */
- if (message->hlen){
- uint8_t client_id[17]; // 16 /*sizeof(chaddr)*/+ 1/*htype*/
- /*if(client_id)*/{
- client_id[0] = message->htype;
- memcpy(&client_id[1], message->chaddr, message->hlen);
- tnet_dhcp_option_serializeex(dhcp_code_Client_Id, (message->hlen + 1), client_id, output);
- }
- }
- /*== Host name(10) ==> RFC 2132 - 3.14. Host Name Option
- Code Len Host Name
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- | 12 | n | h1 | h2 | h3 | h4 | h5 | h6 | ...
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- */
- if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->hostname){
- tnet_dhcp_option_serializeex(dhcp_code_Hostname, (uint8_t)tsk_strlen(ctx->hostname), ctx->hostname, output);
- }
- /*== Vendor classId(60) ==> RFC 2132 - 9.13. Vendor class identifier
- Code Len Vendor class Identifier
- +-----+-----+-----+-----+---
- | 60 | n | i1 | i2 | ...
- +-----+-----+-----+-----+---
- */
- if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->vendor_id){
- tnet_dhcp_option_serializeex(dhcp_code_Class_Id, (uint8_t)tsk_strlen(ctx->vendor_id), ctx->vendor_id, output);
- }
-
- /*== RFC 2132 - 9.10. Maximum DHCP Message Size (57)
- Code Len Length
- +-----+-----+-----+-----+
- | 57 | 2 | l1 | l2 |
- +-----+-----+-----+-----+
- */
- if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->max_msg_size){
- _2bytes = tnet_ntohs(ctx->max_msg_size);
- tnet_dhcp_option_serializeex(dhcp_code_DHCP_Max_Msg_Size, 2, &_2bytes, output);
- }
-
- /*== DHCP Options
- */
- {
- tsk_list_item_t *item;
- tnet_dhcp_option_t* option;
- tsk_list_foreach(item, message->options)
- {
- option = (tnet_dhcp_option_t*)item->data;
- if (tnet_dhcp_option_serialize(option, output)){
- TSK_DEBUG_WARN("Failed to serialize DHCP OPTION (%u)", option->code);
- }
- }
- }
-
- /* RFC 2131 - 4.1 Constructing and sending DHCP messages
- The last option must always be the 'end' option.
- */
- _1byte = dhcp_code_End;
- tsk_buffer_append(output, &(_1byte), 1);
+ tsk_buffer_t* output = 0;
+ uint8_t _1byte;
+ uint16_t _2bytes;
+ uint32_t _4bytes;
+
+ /* Check message validity */
+ if (!message) {
+ goto bail;
+ }
+
+ output = tsk_buffer_create_null();
+
+ /*== OP HTYPE HLEN HOPS */
+ _4bytes = (((uint32_t)(message->op)) << 24) |
+ (((uint32_t)(message->htype)) << 16) |
+ (((uint16_t)(message->hlen)) << 8) | message->hops;
+ _4bytes = (uint32_t)tnet_ntohl(_4bytes);
+ tsk_buffer_append(output, &(_4bytes), 4);
+
+ /*== XID */
+ _4bytes = (uint32_t)tnet_ntohl(message->xid);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ /*== SECS */
+ _2bytes = tnet_ntohs(message->secs);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /*== FLAGS */
+ _2bytes = tnet_ntohs(message->flags);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /*== CIADDR */
+ _4bytes = (uint32_t)tnet_ntohl(message->ciaddr);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ /*== YIADDR */
+ _4bytes = (uint32_t)tnet_ntohl(message->yiaddr);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ /*== SIADDR */
+ _4bytes = (uint32_t)tnet_ntohl(message->siaddr);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ /*== GIADDR */
+ _4bytes = (uint32_t)tnet_ntohl(message->giaddr);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ /*== CHADDR */
+ tsk_buffer_append(output, message->chaddr, sizeof(message->chaddr));
+ /*== sname (unused) */
+ tsk_buffer_append(output, message->sname, sizeof(message->sname));
+ /*== file (unused) */
+ tsk_buffer_append(output, message->file, sizeof(message->file));
+ /*== Magic Cookie */
+ _4bytes = (uint32_t)tnet_ntohl(TNET_DHCP_MAGIC_COOKIE);
+ tsk_buffer_append(output, &(_4bytes), 4);
+
+ /*== Message Type (option 53)
+ */
+ tnet_dhcp_option_serializeex(dhcp_code_DHCP_Msg_Type, 1, &message->type, output);
+
+ /*== Client Identifier (option 61) ==> RFC 2132 - 9.14. Client-identifier
+ Code Len Type Client-Identifier
+ +-----+-----+-----+-----+-----+---
+ | 61 | n | t1 | i1 | i2 | ...
+ +-----+-----+-----+-----+-----+---
+ */
+ if (message->hlen) {
+ uint8_t client_id[17]; // 16 /*sizeof(chaddr)*/+ 1/*htype*/
+ /*if(client_id)*/{
+ client_id[0] = message->htype;
+ memcpy(&client_id[1], message->chaddr, message->hlen);
+ tnet_dhcp_option_serializeex(dhcp_code_Client_Id, (message->hlen + 1), client_id, output);
+ }
+ }
+ /*== Host name(10) ==> RFC 2132 - 3.14. Host Name Option
+ Code Len Host Name
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ | 12 | n | h1 | h2 | h3 | h4 | h5 | h6 | ...
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ */
+ if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->hostname) {
+ tnet_dhcp_option_serializeex(dhcp_code_Hostname, (uint8_t)tsk_strlen(ctx->hostname), ctx->hostname, output);
+ }
+ /*== Vendor classId(60) ==> RFC 2132 - 9.13. Vendor class identifier
+ Code Len Vendor class Identifier
+ +-----+-----+-----+-----+---
+ | 60 | n | i1 | i2 | ...
+ +-----+-----+-----+-----+---
+ */
+ if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->vendor_id) {
+ tnet_dhcp_option_serializeex(dhcp_code_Class_Id, (uint8_t)tsk_strlen(ctx->vendor_id), ctx->vendor_id, output);
+ }
+
+ /*== RFC 2132 - 9.10. Maximum DHCP Message Size (57)
+ Code Len Length
+ +-----+-----+-----+-----+
+ | 57 | 2 | l1 | l2 |
+ +-----+-----+-----+-----+
+ */
+ if (TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->max_msg_size) {
+ _2bytes = tnet_ntohs(ctx->max_msg_size);
+ tnet_dhcp_option_serializeex(dhcp_code_DHCP_Max_Msg_Size, 2, &_2bytes, output);
+ }
+
+ /*== DHCP Options
+ */
+ {
+ tsk_list_item_t *item;
+ tnet_dhcp_option_t* option;
+ tsk_list_foreach(item, message->options) {
+ option = (tnet_dhcp_option_t*)item->data;
+ if (tnet_dhcp_option_serialize(option, output)) {
+ TSK_DEBUG_WARN("Failed to serialize DHCP OPTION (%u)", option->code);
+ }
+ }
+ }
+
+ /* RFC 2131 - 4.1 Constructing and sending DHCP messages
+ The last option must always be the 'end' option.
+ */
+ _1byte = dhcp_code_End;
+ tsk_buffer_append(output, &(_1byte), 1);
bail:
- return output;
+ return output;
}
tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const struct tnet_dhcp_ctx_s *ctx, const uint8_t *data, tsk_size_t size)
{
- tnet_dhcp_message_t *message = 0;
- uint8_t *dataPtr, *dataEnd, *dataStart;
-
- if (!data || !size)
- {
- goto bail;
- }
-
- if (size < TNET_DHCP_MESSAGE_MIN_SIZE){
- TSK_DEBUG_ERROR("DHCP message too short.");
- goto bail;
- }
-
- if (!(message = tnet_dhcp_reply_create())){ /* If REQUEST OP will be overridedden */
- TSK_DEBUG_ERROR("Failed to create new DHCP message.");
- goto bail;
- }
-
- dataPtr = (uint8_t*)data;
- dataStart = dataPtr;
- dataEnd = (dataStart + size);
-
- /*== op (1)*/
- message->op = *(dataPtr++);
- /*== htype (1) */
- message->htype = *(dataPtr++);
- /*== hlen (1) */
- message->hlen = *(dataPtr++);
- /*== htype (1) */
- message->hops = *(dataPtr++);
- /*== xid (4) */
- message->xid = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4;
- /*== secs (2) */
- message->secs = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /*== flags (2) */
- message->flags = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /*== ciaddr (4) */
- message->ciaddr = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4;
- /*== yiaddr (4) */
- message->yiaddr = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4;
- /*== siaddr (4) */
- message->siaddr = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4;
- /*== giaddr (4) */
- message->giaddr = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4;
- /*== chaddr (16[max]) */
- memcpy(message->chaddr, dataPtr, message->hlen > 16 ? 16 : message->hlen);
- dataPtr += 16;
- /*== sname (64) */
- memcpy(message->sname, dataPtr, 64);
- dataPtr += 64;
- /*== file (128) */
- memcpy(message->file, dataPtr, 128);
- dataPtr += 128;
- /*== Magic Cookie (4) */
- if (tnet_htonl_2(dataPtr) != TNET_DHCP_MAGIC_COOKIE){
- TSK_DEBUG_ERROR("Invalid DHCP magic cookie.");
- // Do not exit ==> continue parsing.
- }
- dataPtr += 4;
-
- /*== options (variable) */
- while (dataPtr < dataEnd && *dataPtr != dhcp_code_End)
- {
- tnet_dhcp_option_t* option = tnet_dhcp_option_deserialize(dataPtr, (tsk_size_t)(dataEnd - dataPtr));
- if (option && option->value){
-
- if (option->code == dhcp_code_DHCP_Msg_Type){
- message->type = (tnet_dhcp_message_type_t)*TSK_BUFFER_TO_U8(option->value);
- }
-
- dataPtr += option->value->size + 2/*Code Len*/;
- tsk_list_push_back_data(message->options, (void**)&option);
- }
- else break;
- }
+ tnet_dhcp_message_t *message = 0;
+ uint8_t *dataPtr, *dataEnd, *dataStart;
+
+ if (!data || !size) {
+ goto bail;
+ }
+
+ if (size < TNET_DHCP_MESSAGE_MIN_SIZE) {
+ TSK_DEBUG_ERROR("DHCP message too short.");
+ goto bail;
+ }
+
+ if (!(message = tnet_dhcp_reply_create())) { /* If REQUEST OP will be overridedden */
+ TSK_DEBUG_ERROR("Failed to create new DHCP message.");
+ goto bail;
+ }
+
+ dataPtr = (uint8_t*)data;
+ dataStart = dataPtr;
+ dataEnd = (dataStart + size);
+
+ /*== op (1)*/
+ message->op = *(dataPtr++);
+ /*== htype (1) */
+ message->htype = *(dataPtr++);
+ /*== hlen (1) */
+ message->hlen = *(dataPtr++);
+ /*== htype (1) */
+ message->hops = *(dataPtr++);
+ /*== xid (4) */
+ message->xid = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4;
+ /*== secs (2) */
+ message->secs = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /*== flags (2) */
+ message->flags = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /*== ciaddr (4) */
+ message->ciaddr = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4;
+ /*== yiaddr (4) */
+ message->yiaddr = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4;
+ /*== siaddr (4) */
+ message->siaddr = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4;
+ /*== giaddr (4) */
+ message->giaddr = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4;
+ /*== chaddr (16[max]) */
+ memcpy(message->chaddr, dataPtr, message->hlen > 16 ? 16 : message->hlen);
+ dataPtr += 16;
+ /*== sname (64) */
+ memcpy(message->sname, dataPtr, 64);
+ dataPtr += 64;
+ /*== file (128) */
+ memcpy(message->file, dataPtr, 128);
+ dataPtr += 128;
+ /*== Magic Cookie (4) */
+ if (tnet_htonl_2(dataPtr) != TNET_DHCP_MAGIC_COOKIE) {
+ TSK_DEBUG_ERROR("Invalid DHCP magic cookie.");
+ // Do not exit ==> continue parsing.
+ }
+ dataPtr += 4;
+
+ /*== options (variable) */
+ while (dataPtr < dataEnd && *dataPtr != dhcp_code_End) {
+ tnet_dhcp_option_t* option = tnet_dhcp_option_deserialize(dataPtr, (tsk_size_t)(dataEnd - dataPtr));
+ if (option && option->value) {
+
+ if (option->code == dhcp_code_DHCP_Msg_Type) {
+ message->type = (tnet_dhcp_message_type_t)*TSK_BUFFER_TO_U8(option->value);
+ }
+
+ dataPtr += option->value->size + 2/*Code Len*/;
+ tsk_list_push_back_data(message->options, (void**)&option);
+ }
+ else {
+ break;
+ }
+ }
bail:
- return message;
+ return message;
}
const tnet_dhcp_option_t* tnet_dhcp_message_find_option(const tnet_dhcp_message_t *message, tnet_dhcp_option_code_t code)
{
- tsk_list_item_t *item;
+ tsk_list_item_t *item;
- if (!message){
- goto bail;
- }
+ if (!message) {
+ goto bail;
+ }
- tsk_list_foreach(item, message->options)
- {
- if (((tnet_dhcp_option_t*)item->data)->code == code){
- return ((tnet_dhcp_option_t*)item->data);
- }
- }
+ tsk_list_foreach(item, message->options) {
+ if (((tnet_dhcp_option_t*)item->data)->code == code) {
+ return ((tnet_dhcp_option_t*)item->data);
+ }
+ }
bail:
- return 0;
+ return 0;
}
int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count)
{
- int ret = -1;
-
- if (!self){
- goto bail;
- }
- if (codes_count){
- unsigned i;
-
- tnet_dhcp_option_paramslist_t* option = (tnet_dhcp_option_paramslist_t*)tnet_dhcp_message_find_option(self, dhcp_code_Parameter_List);
- if (!option){
- tnet_dhcp_option_paramslist_t *option_paramslist = tnet_dhcp_option_paramslist_create();
- option = option_paramslist;
- tsk_list_push_back_data(self->options, (void**)&option_paramslist);
- }
-
- for (i = 0; i < codes_count; i++){
- if ((ret = tnet_dhcp_option_paramslist_add_code(option, codes[i]))){
- break;
- }
- }
- }
+ int ret = -1;
+
+ if (!self) {
+ goto bail;
+ }
+ if (codes_count) {
+ unsigned i;
+
+ tnet_dhcp_option_paramslist_t* option = (tnet_dhcp_option_paramslist_t*)tnet_dhcp_message_find_option(self, dhcp_code_Parameter_List);
+ if (!option) {
+ tnet_dhcp_option_paramslist_t *option_paramslist = tnet_dhcp_option_paramslist_create();
+ option = option_paramslist;
+ tsk_list_push_back_data(self->options, (void**)&option_paramslist);
+ }
+
+ for (i = 0; i < codes_count; i++) {
+ if ((ret = tnet_dhcp_option_paramslist_add_code(option, codes[i]))) {
+ break;
+ }
+ }
+ }
bail:
- return ret;
+ return ret;
}
@@ -315,35 +313,34 @@ bail:
//
static tsk_object_t* tnet_dhcp_message_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_message_t *message = self;
- if (message){
- static uint32_t __dhcpmessage_unique_xid = 0;//(uint32_t)tsk_time_epoch();
-
- message->op = va_arg(*app, tnet_dhcp_message_op_t);
- message->htype = tnet_htype_Ethernet_10Mb;
- message->hlen = 0x06;
-
- message->xid = ++(__dhcpmessage_unique_xid);
- message->options = tsk_list_create();
- }
- return self;
+ tnet_dhcp_message_t *message = self;
+ if (message) {
+ static uint32_t __dhcpmessage_unique_xid = 0;//(uint32_t)tsk_time_epoch();
+
+ message->op = va_arg(*app, tnet_dhcp_message_op_t);
+ message->htype = tnet_htype_Ethernet_10Mb;
+ message->hlen = 0x06;
+
+ message->xid = ++(__dhcpmessage_unique_xid);
+ message->options = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* tnet_dhcp_message_dtor(tsk_object_t * self)
{
- tnet_dhcp_message_t *message = self;
- if (message){
- TSK_OBJECT_SAFE_FREE(message->options);
- }
- return self;
+ tnet_dhcp_message_t *message = self;
+ if (message) {
+ TSK_OBJECT_SAFE_FREE(message->options);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_message_def_s =
-{
- sizeof(tnet_dhcp_message_t),
- tnet_dhcp_message_ctor,
- tnet_dhcp_message_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_message_def_s = {
+ sizeof(tnet_dhcp_message_t),
+ tnet_dhcp_message_ctor,
+ tnet_dhcp_message_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_message_def_t = &tnet_dhcp_message_def_s;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_message.h b/tinyNET/src/dhcp/tnet_dhcp_message.h
index c7005fa..53ead75 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_message.h
+++ b/tinyNET/src/dhcp/tnet_dhcp_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,158 +50,155 @@ struct tnet_dhcp_ctx_s;
/** List of all supported DHCP message (see RFC 2131).
*/
-typedef enum tnet_dhcp_message_type_e
-{
- /**< DHCPDISCOVER - Client broadcast to locate available servers.
- */
- dhcp_type_discover = 1,
-
- /**< DHCPOFFER - Server to client in response to DHCPDISCOVER with
- offer of configuration parameters.
- */
- dhcp_type_offer = 2,
-
- /**< DHCPREQUEST - Client message to servers either (a) requesting
- offered parameters from one server and implicitly
- declining offers from all others, (b) confirming
- correctness of previously allocated address after,
- e.g., system reboot, or (c) extending the lease on a
- particular network address.
- */
- dhcp_type_request = 3,
-
- /**< DHCPDECLINE - Client to server indicating network address is already
+typedef enum tnet_dhcp_message_type_e {
+ /**< DHCPDISCOVER - Client broadcast to locate available servers.
+ */
+ dhcp_type_discover = 1,
+
+ /**< DHCPOFFER - Server to client in response to DHCPDISCOVER with
+ offer of configuration parameters.
+ */
+ dhcp_type_offer = 2,
+
+ /**< DHCPREQUEST - Client message to servers either (a) requesting
+ offered parameters from one server and implicitly
+ declining offers from all others, (b) confirming
+ correctness of previously allocated address after,
+ e.g., system reboot, or (c) extending the lease on a
+ particular network address.
+ */
+ dhcp_type_request = 3,
+
+ /**< DHCPDECLINE - Client to server indicating network address is already
in use.
- */
- dhcp_type_decline = 4,
-
- /**< DHCPACK - Server to client with configuration parameters,
- including committed network address.
- */
- dhcp_type_ack = 5,
-
- /**< DHCPNAK - Server to client indicating client's notion of network
- address is incorrect (e.g., client has moved to new
- subnet) or client's lease as expired
- */
- dhcp_type_nack = 6,
-
- /**< DHCPRELEASE - Client to server relinquishing network address and
- cancelling remaining lease.
- */
- dhcp_type_release = 7,
-
- /**< DHCPINFORM - Client to server, asking only for local configuration
- parameters; client already has externally configured
- network address.
- */
- dhcp_type_inform = 8,
+ */
+ dhcp_type_decline = 4,
+
+ /**< DHCPACK - Server to client with configuration parameters,
+ including committed network address.
+ */
+ dhcp_type_ack = 5,
+
+ /**< DHCPNAK - Server to client indicating client's notion of network
+ address is incorrect (e.g., client has moved to new
+ subnet) or client's lease as expired
+ */
+ dhcp_type_nack = 6,
+
+ /**< DHCPRELEASE - Client to server relinquishing network address and
+ cancelling remaining lease.
+ */
+ dhcp_type_release = 7,
+
+ /**< DHCPINFORM - Client to server, asking only for local configuration
+ parameters; client already has externally configured
+ network address.
+ */
+ dhcp_type_inform = 8,
}
tnet_dhcp_message_type_t;
/** DHCP message OP code / message type.
*/
-typedef enum tnet_dhcp_message_op_e
-{
- dhcp_op_bootrequest = 1,
- dhcp_op_bootreply = 2
+typedef enum tnet_dhcp_message_op_e {
+ dhcp_op_bootrequest = 1,
+ dhcp_op_bootreply = 2
}
tnet_dhcp_message_op_t;
/** BOOTP/DHCP message as per RFC 2131 subclause 2.
*/
-typedef struct tnet_dhcp_message_s
-{
- TSK_DECLARE_OBJECT;
-
- /**< DHCP message type. Mandatory.
- */
- tnet_dhcp_message_type_t type;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | op (1) | htype (1) | hlen (1) | hops (1) |
- +---------------+---------------+---------------+---------------+
- | xid (4) |
- +-------------------------------+-------------------------------+
- | secs (2) | flags (2) |
- +-------------------------------+-------------------------------+
- | ciaddr (4) |
- +---------------------------------------------------------------+
- | yiaddr (4) |
- +---------------------------------------------------------------+
- | siaddr (4) |
- +---------------------------------------------------------------+
- | giaddr (4) |
- +---------------------------------------------------------------+
- | |
- | chaddr (16) |
- | |
- | |
- +---------------------------------------------------------------+
- | |
- | sname (64) |
- +---------------------------------------------------------------+
- | |
- | file (128) |
- +---------------------------------------------------------------+
- | |
- | options (variable) |
- +---------------------------------------------------------------+
- */
-
- /**< Message op code / message type (1-byte).
+typedef struct tnet_dhcp_message_s {
+ TSK_DECLARE_OBJECT;
+
+ /**< DHCP message type. Mandatory.
+ */
+ tnet_dhcp_message_type_t type;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | op (1) | htype (1) | hlen (1) | hops (1) |
+ +---------------+---------------+---------------+---------------+
+ | xid (4) |
+ +-------------------------------+-------------------------------+
+ | secs (2) | flags (2) |
+ +-------------------------------+-------------------------------+
+ | ciaddr (4) |
+ +---------------------------------------------------------------+
+ | yiaddr (4) |
+ +---------------------------------------------------------------+
+ | siaddr (4) |
+ +---------------------------------------------------------------+
+ | giaddr (4) |
+ +---------------------------------------------------------------+
+ | |
+ | chaddr (16) |
+ | |
+ | |
+ +---------------------------------------------------------------+
+ | |
+ | sname (64) |
+ +---------------------------------------------------------------+
+ | |
+ | file (128) |
+ +---------------------------------------------------------------+
+ | |
+ | options (variable) |
+ +---------------------------------------------------------------+
+ */
+
+ /**< Message op code / message type (1-byte).
1 = BOOTREQUEST, 2 = BOOTREPLY
- */
- tnet_dhcp_message_op_t op;
- /**< Hardware address type, see ARP section in "Assigned Numbers" RFC; e.g., '1' = 10mb ethernet.
- For more information see RFC 1340.
- */
+ */
+ tnet_dhcp_message_op_t op;
+ /**< Hardware address type, see ARP section in "Assigned Numbers" RFC; e.g., '1' = 10mb ethernet.
+ For more information see RFC 1340.
+ */
tnet_hardware_type_t htype;
- /**< Hardware address length (e.g. '6' for 10mb ethernet). tsk_strlen(chaddr).
- */
+ /**< Hardware address length (e.g. '6' for 10mb ethernet). tsk_strlen(chaddr).
+ */
uint8_t hlen;
- /**< Client sets to zero, optionally used by relay agents when booting via a relay agent.
- */
+ /**< Client sets to zero, optionally used by relay agents when booting via a relay agent.
+ */
uint8_t hops;
- /**< Transaction ID, a random number chosen by the client, used by the client
- and server to associate messages and responses between a client and a server.
- */
+ /**< Transaction ID, a random number chosen by the client, used by the client
+ and server to associate messages and responses between a client and a server.
+ */
uint32_t xid;
- /**< Filled in by client, seconds elapsed since client began address acquisition or renewal process.
- */
+ /**< Filled in by client, seconds elapsed since client began address acquisition or renewal process.
+ */
uint16_t secs;
- /**< Flags (see figure 2)
- */
+ /**< Flags (see figure 2)
+ */
uint16_t flags;
- /**< Client IP address; only filled in if client is in BOUND, RENEW or REBINDING
- state and can respond to ARP requests.
- */
+ /**< Client IP address; only filled in if client is in BOUND, RENEW or REBINDING
+ state and can respond to ARP requests.
+ */
uint32_t ciaddr;
- /**< 'your' (client) IP address.
- */
+ /**< 'your' (client) IP address.
+ */
uint32_t yiaddr;
- /**< IP address of next server to use in bootstrap;
- returned in DHCPOFFER, DHCPACK by server.
- */
+ /**< IP address of next server to use in bootstrap;
+ returned in DHCPOFFER, DHCPACK by server.
+ */
uint32_t siaddr;
- /**< Relay agent IP address, used in booting via a relay agent.
- */
+ /**< Relay agent IP address, used in booting via a relay agent.
+ */
uint32_t giaddr;
- /**< Client hardware address.
- */
+ /**< Client hardware address.
+ */
uint8_t chaddr[16];
- /**< Optional server host name, null terminated string.
- */
+ /**< Optional server host name, null terminated string.
+ */
uint8_t sname[64];
- /**<Boot file name, null terminated string; "generic" name or null in DHCPDISCOVER,
- fully qualifieddirectory-path name in DHCPOFFER.
- */
+ /**<Boot file name, null terminated string; "generic" name or null in DHCPDISCOVER,
+ fully qualifieddirectory-path name in DHCPOFFER.
+ */
uint8_t file[128];
- /**Optional parameters field. See the options documents for a list of defined options.
- For more information please refer to RFC 2132, 1497 and 1533.
- */
+ /**Optional parameters field. See the options documents for a list of defined options.
+ For more information please refer to RFC 2132, 1497 and 1533.
+ */
tnet_dhcp_options_L_t *options;
}
tnet_dhcp_message_t;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_option.c b/tinyNET/src/dhcp/tnet_dhcp_option.c
index 3679a62..037d65a 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_option.c
+++ b/tinyNET/src/dhcp/tnet_dhcp_option.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,140 +38,132 @@
tnet_dhcp_option_t* tnet_dhcp_option_create(tnet_dhcp_option_code_t code)
{
- return tsk_object_new(tnet_dhcp_option_def_t, code);
+ return tsk_object_new(tnet_dhcp_option_def_t, code);
}
tnet_dhcp_option_paramslist_t* tnet_dhcp_option_paramslist_create()
{
- return tsk_object_new(tnet_dhcp_option_paramslist_def_t);
+ return tsk_object_new(tnet_dhcp_option_paramslist_def_t);
}
tnet_dhcp_option_dns_t* tnet_dhcp_option_dns_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp_option_dns_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp_option_dns_def_t, payload, payload_size);
}
-/** Initializes DHCPv4 option.
+/** Initializes DHCPv4 option.
*
- * @param [in,out] self The option to initialize.
- * @param code The code of the option to initialize.
+ * @param [in,out] self The option to initialize.
+ * @param code The code of the option to initialize.
*
* @return Zero if succeed and non-zero error code otherwise.
**/
int tnet_dhcp_option_init(tnet_dhcp_option_t *self, tnet_dhcp_option_code_t code)
{
- if(self)
- {
- if(!self->initialized)
- {
- self->code = code;
- //option->value = tsk_buffer_create_null();
-
- self->initialized = tsk_true;
- return 0;
- }
- return -2;
- }
- return -1;
+ if(self) {
+ if(!self->initialized) {
+ self->code = code;
+ //option->value = tsk_buffer_create_null();
+
+ self->initialized = tsk_true;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
int tnet_dhcp_option_deinit(tnet_dhcp_option_t *self)
{
- if(self)
- {
- if(self->initialized)
- {
- TSK_OBJECT_SAFE_FREE(self->value);
-
- self->initialized = tsk_false;
- return 0;
- }
- return -2;
- }
- return -1;
+ if(self) {
+ if(self->initialized) {
+ TSK_OBJECT_SAFE_FREE(self->value);
+
+ self->initialized = tsk_false;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
tnet_dhcp_option_t* tnet_dhcp_option_deserialize(const void* data, tsk_size_t size)
{
- tnet_dhcp_option_t *option = 0;
- uint8_t* dataPtr = ((uint8_t*)data);
- //uint8_t* dataEnd = (dataPtr+size);
-
- tnet_dhcp_option_code_t code;
- uint8_t len;
-
- /* Check validity */
- if(!dataPtr || size<2/*Code Len*/){
- goto bail;
- }
-
- code = (tnet_dhcp_option_code_t)*dataPtr++;
- len = *dataPtr++;
-
- switch(code)
- {
- case dhcp_code_SIP_Servers_DHCP_Option:
- {
- option = (tnet_dhcp_option_t *)tnet_dhcp_option_sip_create(dataPtr, len);
- break;
- }
-
- case dhcp_code_Domain_Server:
- {
- option = (tnet_dhcp_option_t *)tnet_dhcp_option_dns_create(dataPtr, len);
- break;
- }
-
- default:
- {
- option = tnet_dhcp_option_create(code);
- }
- }
-
- /* In all case */
- if(option && !option->value && len){
- option->value = tsk_buffer_create((((uint8_t*)data) + 2/*Code Len*/), len);
- }
+ tnet_dhcp_option_t *option = 0;
+ uint8_t* dataPtr = ((uint8_t*)data);
+ //uint8_t* dataEnd = (dataPtr+size);
+
+ tnet_dhcp_option_code_t code;
+ uint8_t len;
+
+ /* Check validity */
+ if(!dataPtr || size<2/*Code Len*/) {
+ goto bail;
+ }
+
+ code = (tnet_dhcp_option_code_t)*dataPtr++;
+ len = *dataPtr++;
+
+ switch(code) {
+ case dhcp_code_SIP_Servers_DHCP_Option: {
+ option = (tnet_dhcp_option_t *)tnet_dhcp_option_sip_create(dataPtr, len);
+ break;
+ }
+
+ case dhcp_code_Domain_Server: {
+ option = (tnet_dhcp_option_t *)tnet_dhcp_option_dns_create(dataPtr, len);
+ break;
+ }
+
+ default: {
+ option = tnet_dhcp_option_create(code);
+ }
+ }
+
+ /* In all case */
+ if(option && !option->value && len) {
+ option->value = tsk_buffer_create((((uint8_t*)data) + 2/*Code Len*/), len);
+ }
bail:
- return option;
+ return option;
}
int tnet_dhcp_option_serialize(const tnet_dhcp_option_t* self, tsk_buffer_t *output)
{
- if(!self || !output){
- return -1;
- }
-
- /* Code */
- tsk_buffer_append(output, &(self->code), 1);
-
- if(self->value){
- /* Length */
- tsk_buffer_append(output, &(self->value->size), 1);
-
- /* Value */
- tsk_buffer_append(output, self->value->data, self->value->size);
- }
- else{
- /* Length */
- static uint8_t zero = 0x00;
- tsk_buffer_append(output, &zero, 1);
- }
-
- return 0;
+ if(!self || !output) {
+ return -1;
+ }
+
+ /* Code */
+ tsk_buffer_append(output, &(self->code), 1);
+
+ if(self->value) {
+ /* Length */
+ tsk_buffer_append(output, &(self->value->size), 1);
+
+ /* Value */
+ tsk_buffer_append(output, self->value->data, self->value->size);
+ }
+ else {
+ /* Length */
+ static uint8_t zero = 0x00;
+ tsk_buffer_append(output, &zero, 1);
+ }
+
+ return 0;
}
int tnet_dhcp_option_serializeex(tnet_dhcp_option_code_t code, uint8_t length, const void* value, tsk_buffer_t *output)
{
- if(value && length && output){
- tsk_buffer_append(output, &(code), 1);
- tsk_buffer_append(output, &(length), 1);
- tsk_buffer_append(output, value, length);
-
- return 0;
- }
- return -1;
+ if(value && length && output) {
+ tsk_buffer_append(output, &(code), 1);
+ tsk_buffer_append(output, &(length), 1);
+ tsk_buffer_append(output, value, length);
+
+ return 0;
+ }
+ return -1;
}
//
@@ -179,28 +171,27 @@ int tnet_dhcp_option_serializeex(tnet_dhcp_option_code_t code, uint8_t length, c
//
static tsk_object_t* tnet_dhcp_option_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_option_t *option = self;
- if(option){
- tnet_dhcp_option_init(option, va_arg(*app, tnet_dhcp_option_code_t));
- }
- return self;
+ tnet_dhcp_option_t *option = self;
+ if(option) {
+ tnet_dhcp_option_init(option, va_arg(*app, tnet_dhcp_option_code_t));
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp_option_dtor(tsk_object_t * self)
-{
- tnet_dhcp_option_t *option = self;
- if(option){
- tnet_dhcp_option_deinit(option);
- }
- return self;
+static tsk_object_t* tnet_dhcp_option_dtor(tsk_object_t * self)
+{
+ tnet_dhcp_option_t *option = self;
+ if(option) {
+ tnet_dhcp_option_deinit(option);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_option_def_s =
-{
- sizeof(tnet_dhcp_option_t),
- tnet_dhcp_option_ctor,
- tnet_dhcp_option_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_option_def_s = {
+ sizeof(tnet_dhcp_option_t),
+ tnet_dhcp_option_ctor,
+ tnet_dhcp_option_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_option_def_t = &tnet_dhcp_option_def_s;
@@ -211,13 +202,13 @@ const tsk_object_def_t *tnet_dhcp_option_def_t = &tnet_dhcp_option_def_s;
*=======================================================================================*/
int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tnet_dhcp_option_code_t code)
{
- if(self){
- if(!TNET_DHCP_OPTION(self)->value){
- TNET_DHCP_OPTION(self)->value = tsk_buffer_create_null();
- }
- return tsk_buffer_append(TNET_DHCP_OPTION(self)->value, &code, 1);
- }
- return -1;
+ if(self) {
+ if(!TNET_DHCP_OPTION(self)->value) {
+ TNET_DHCP_OPTION(self)->value = tsk_buffer_create_null();
+ }
+ return tsk_buffer_append(TNET_DHCP_OPTION(self)->value, &code, 1);
+ }
+ return -1;
}
//
@@ -225,30 +216,29 @@ int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tn
//
static tsk_object_t* tnet_dhcp_option_paramslist_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_option_paramslist_t *option = self;
- if(option){
- /* init base */
- tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_Parameter_List);
- }
- return self;
+ tnet_dhcp_option_paramslist_t *option = self;
+ if(option) {
+ /* init base */
+ tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_Parameter_List);
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp_option_paramslist_dtor(tsk_object_t * self)
-{
- tnet_dhcp_option_paramslist_t *option = self;
- if(option){
- /* deinit base */
- tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
- }
- return self;
+static tsk_object_t* tnet_dhcp_option_paramslist_dtor(tsk_object_t * self)
+{
+ tnet_dhcp_option_paramslist_t *option = self;
+ if(option) {
+ /* deinit base */
+ tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_option_paramslist_def_s =
-{
- sizeof(tnet_dhcp_option_paramslist_t),
- tnet_dhcp_option_paramslist_ctor,
- tnet_dhcp_option_paramslist_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_option_paramslist_def_s = {
+ sizeof(tnet_dhcp_option_paramslist_t),
+ tnet_dhcp_option_paramslist_ctor,
+ tnet_dhcp_option_paramslist_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_option_paramslist_def_t = &tnet_dhcp_option_paramslist_def_s;
@@ -261,66 +251,65 @@ const tsk_object_def_t *tnet_dhcp_option_paramslist_def_t = &tnet_dhcp_option_pa
//
static tsk_object_t* tnet_dhcp_option_dns_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_option_dns_t *option = self;
- if(option){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- const uint8_t* payloadPtr = (const uint8_t*)payload;
- const uint8_t* payloadEnd = (payloadPtr + payload_size);
-
- /* init base */
- tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_Domain_Server);
-
- option->servers = tsk_list_create();
-
- if(payload_size<4 || payload_size%4){
- TSK_DEBUG_ERROR("DHCP - The minimum length for this option is 4 octets, and the length MUST always be a multiple of 4.");
- }
- else{
- tsk_size_t i;
- char* ip4 = 0;
- uint32_t address;
- tsk_string_t* addrstring;
-
- for(i=0; i<payload_size && (payloadPtr< payloadEnd); i+=4){
- /*
- Code Len Address 1 Address 2
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- | 6 | n | a1 | a2 | a3 | a4 | a1 | a2 | ...
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- */
- address = (uint32_t)tnet_htonl_2(payloadPtr);
- tsk_sprintf(&ip4, "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
-
- addrstring = tsk_string_create(ip4);
- tsk_list_push_back_data(option->servers, (void*)&addrstring);
-
- TSK_FREE(ip4);
- payloadPtr+= 4;
- }
- }
- }
- return self;
+ tnet_dhcp_option_dns_t *option = self;
+ if(option) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ const uint8_t* payloadPtr = (const uint8_t*)payload;
+ const uint8_t* payloadEnd = (payloadPtr + payload_size);
+
+ /* init base */
+ tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_Domain_Server);
+
+ option->servers = tsk_list_create();
+
+ if(payload_size<4 || payload_size%4) {
+ TSK_DEBUG_ERROR("DHCP - The minimum length for this option is 4 octets, and the length MUST always be a multiple of 4.");
+ }
+ else {
+ tsk_size_t i;
+ char* ip4 = 0;
+ uint32_t address;
+ tsk_string_t* addrstring;
+
+ for(i=0; i<payload_size && (payloadPtr< payloadEnd); i+=4) {
+ /*
+ Code Len Address 1 Address 2
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ | 6 | n | a1 | a2 | a3 | a4 | a1 | a2 | ...
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ */
+ address = (uint32_t)tnet_htonl_2(payloadPtr);
+ tsk_sprintf(&ip4, "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
+
+ addrstring = tsk_string_create(ip4);
+ tsk_list_push_back_data(option->servers, (void*)&addrstring);
+
+ TSK_FREE(ip4);
+ payloadPtr+= 4;
+ }
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp_option_dns_dtor(tsk_object_t * self)
-{
- tnet_dhcp_option_dns_t *option = self;
- if(option){
- /* deinit base */
- tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
-
- TSK_OBJECT_SAFE_FREE(option->servers);
- }
- return self;
+static tsk_object_t* tnet_dhcp_option_dns_dtor(tsk_object_t * self)
+{
+ tnet_dhcp_option_dns_t *option = self;
+ if(option) {
+ /* deinit base */
+ tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
+
+ TSK_OBJECT_SAFE_FREE(option->servers);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_option_dns_def_s =
-{
- sizeof(tnet_dhcp_option_dns_t),
- tnet_dhcp_option_dns_ctor,
- tnet_dhcp_option_dns_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp_option_dns_def_s = {
+ sizeof(tnet_dhcp_option_dns_t),
+ tnet_dhcp_option_dns_ctor,
+ tnet_dhcp_option_dns_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_option_dns_def_t = &tnet_dhcp_option_dns_def_s;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_option.h b/tinyNET/src/dhcp/tnet_dhcp_option.h
index 0d16ac1..db3ac16 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_option.h
+++ b/tinyNET/src/dhcp/tnet_dhcp_option.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,191 +39,189 @@ TNET_BEGIN_DECLS
#define TNET_DHCP_OPTION(self) ((tnet_dhcp_option_t*)(self))
-typedef enum tnet_dhcp_option_code_e
-{
- dhcp_code_Pad= 0 ,/**< Pad 0 None [RFC2132] */
- dhcp_code_Subnet_Mask= 1 ,/**< Subnet Mask 4 Subnet Mask Value [RFC2132] */
- dhcp_code_Time_Offset= 2 ,/**< Time Offset 4 Time Offset in Seconds from UTC [RFC2132] (note: deprecated by 100 and 101) */
- dhcp_code_Router= 3 ,/**< Router N N/4 Router addresses [RFC2132] */
- dhcp_code_Time_Server= 4 ,/**< Time Server N N/4 Timeserver addresses [RFC2132] */
- dhcp_code_Name_Server= 5 ,/**< Name Server N N/4 IEN-116 Server addresses [RFC2132] */
- dhcp_code_Domain_Server= 6 ,/**< Domain Server N N/4 DNS Server addresses [RFC2132] */
- dhcp_code_Log_Server= 7 ,/**< Log Server N N/4 Logging Server addresses [RFC2132] */
- dhcp_code_Quotes_Server= 8 ,/**< Quotes Server N N/4 Quotes Server addresses [RFC2132] */
- dhcp_code_LPR_Server= 9 ,/**< LPR Server N N/4 Printer Server addresses [RFC2132] */
- dhcp_code_Impress_Server= 10 ,/**< Impress Server N N/4 Impress Server addresses [RFC2132] */
- dhcp_code_RLP_Server= 11 ,/**< RLP Server N N/4 RLP Server addresses [RFC2132] */
- dhcp_code_Hostname= 12 ,/**< Hostname N Hostname string [RFC2132] */
- dhcp_code_Boot_File_Size= 13 ,/**< Boot File Size 2 Size of boot file in 512 byte chunks [RFC2132] */
- dhcp_code_Merit_Dump_File= 14 ,/**< Merit Dump File N Client to dump and name the file to dump it to [RFC2132] */
- dhcp_code_Domain_Name= 15 ,/**< Domain Name N The DNS domain name of the client [RFC2132] */
- dhcp_code_Swap_Server= 16 ,/**< Swap Server N Swap Server address [RFC2132] */
- dhcp_code_Root_Path= 17 ,/**< Root Path N Path name for root disk [RFC2132] */
- dhcp_code_Extension_File= 18 ,/**< Extension File N Path name for more BOOTP info [RFC2132] */
- dhcp_code_Forward_On_Off= 19 ,/**< Forward On/Off 1 Enable/Disable IP Forwarding [RFC2132] */
- dhcp_code_SrcRte_On_Off = 20 ,/**< SrcRte On/Off 1 Enable/Disable Source Routing [RFC2132] */
- dhcp_code_Policy_Filter= 21 ,/**< Policy Filter N Routing Policy Filters [RFC2132] */
- dhcp_code_Max_DG_Assembly= 22 ,/**< Max DG Assembly 2 Max Datagram Reassembly Size [RFC2132] */
- dhcp_code_Default_IP_TTL= 23 ,/**< Default IP TTL 1 Default IP Time to Live [RFC2132] */
- dhcp_code_MTU_Timeout= 24 ,/**< MTU Timeout 4 Path MTU Aging Timeout [RFC2132] */
- dhcp_code_MTU_Plateau= 25 ,/**< MTU Plateau N Path MTU Plateau Table [RFC2132] */
- dhcp_code_MTU_Interface= 26 ,/**< MTU Interface 2 Interface MTU Size [RFC2132] */
- dhcp_code_MTU_Subnet= 27 ,/**< MTU Subnet 1 All Subnets are Local [RFC2132] */
- dhcp_code_Broadcast_Address= 28 ,/**< Broadcast Address 4 Broadcast Address [RFC2132] */
- dhcp_code_Mask_Discovery= 29 ,/**< Mask Discovery 1 Perform Mask Discovery [RFC2132] */
- dhcp_code_Mask_Supplier= 30 ,/**< Mask Supplier 1 Provide Mask to Others [RFC2132] */
- dhcp_code_Router_Discovery= 31 ,/**< Router Discovery 1 Perform Router Discovery [RFC2132] */
- dhcp_code_Router_Request= 32 ,/**< Router Request 4 Router Solicitation Address [RFC2132] */
- dhcp_code_Static_Route= 33 ,/**< Static Route N Static Routing Table [RFC2132] */
- dhcp_code_Trailers= 34 ,/**< Trailers 1 Trailer Encapsulation [RFC2132] */
- dhcp_code_ARP_Timeout= 35 ,/**< ARP Timeout 4 ARP Cache Timeout [RFC2132] */
- dhcp_code_Ethernet= 36 ,/**< Ethernet 1 Ethernet Encapsulation [RFC2132] */
- dhcp_code_Default_TCP_TTL= 37 ,/**< Default TCP TTL 1 Default TCP Time to Live [RFC2132] */
- dhcp_code_Keepalive_Time= 38 ,/**< Keepalive Time 4 TCP Keepalive Interval [RFC2132] */
- dhcp_code_Keepalive_Data= 39 ,/**< Keepalive Data 1 TCP Keepalive Garbage [RFC2132] */
- dhcp_code_NIS_Domain= 40 ,/**< NIS Domain N NIS Domain Name [RFC2132] */
- dhcp_code_NIS_Servers= 41 ,/**< NIS Servers N NIS Server Addresses [RFC2132] */
- dhcp_code_NTP_Servers= 42 ,/**< NTP Servers N NTP Server Addresses [RFC2132] */
- dhcp_code_Vendor_Specific= 43 ,/**< Vendor Specific N Vendor Specific Information [RFC2132] */
- dhcp_code_NETBIOS_Name_Srv= 44 ,/**< NETBIOS Name Srv N NETBIOS Name Servers [RFC2132] */
- dhcp_code_NETBIOS_Dist_Srv= 45 ,/**< NETBIOS Dist Srv N NETBIOS Datagram Distribution [RFC2132] */
- dhcp_code_NETBIOS_Node_Type= 46 ,/**< NETBIOS Node Type 1 NETBIOS Node Type [RFC2132] */
- dhcp_code_NETBIOS_Scope= 47 ,/**< NETBIOS Scope N NETBIOS Scope [RFC2132] */
- dhcp_code_X_Window_Font= 48 ,/**< X Window Font N X Window Font Server [RFC2132] */
- dhcp_code_X_Window_Manager= 49 ,/**< X Window Manager N X Window Display Manager [RFC2132] */
- dhcp_code_Address_Request= 50 ,/**< Address Request 4 Requested IP Address [RFC2132] */
- dhcp_code_Address_Time= 51 ,/**< Address Time 4 IP Address Lease Time [RFC2132] */
- dhcp_code_Overload= 52 ,/**< Overload 1 Overload "sname" or "file" [RFC2132] */
- dhcp_code_DHCP_Msg_Type= 53 ,/**< DHCP Msg Type 1 DHCP Message Type [RFC2132] */
- dhcp_code_DHCP_Server_Id= 54 ,/**< DHCP Server Id 4 DHCP Server Identification [RFC2132] */
- dhcp_code_Parameter_List= 55 ,/**< Parameter List N Parameter Request List [RFC2132] */
- dhcp_code_DHCP_Error_Message= 56 ,/**< DHCP Message N DHCP Error Message [RFC2132] */
- dhcp_code_DHCP_Max_Msg_Size= 57 ,/**< DHCP Max Msg Size 2 DHCP Maximum Message Size [RFC2132] */
- dhcp_code_Renewal_Time= 58 ,/**< Renewal Time 4 DHCP Renewal (T1) Time [RFC2132] */
- dhcp_code_Rebinding_Time= 59 ,/**< Rebinding Time 4 DHCP Rebinding (T2) Time [RFC2132] */
- dhcp_code_Class_Id= 60 ,/**< Class Id N Class Identifier [RFC2132] */
- dhcp_code_Client_Id= 61 ,/**< Client Id N Client Identifier [RFC2132] */
- dhcp_code_NetWare_IP_Domain= 62 ,/**< NetWare/IP Domain N NetWare/IP Domain Name [RFC2242] */
- dhcp_code_NetWare_IP_Option= 63 ,/**< NetWare/IP Option N NetWare/IP sub Options [RFC2242] */
- dhcp_code_NIS_Domain_Name= 64 ,/**< NIS-Domain-Name N NIS+ v3 Client Domain Name [RFC2132] */
- dhcp_code_NIS_Server_Addr = 65 ,/**< NIS-Server-Addr N NIS+ v3 Server Addresses [RFC2132] */
- dhcp_code_Server_Name= 66 ,/**< Server-Name N TFTP Server Name [RFC2132] */
- dhcp_code_Bootfile_Name= 67 ,/**< Bootfile-Name N Boot File Name [RFC2132] */
- dhcp_code_Home_Agent_Addrs= 68 ,/**< Home-Agent-Addrs N Home Agent Addresses [RFC2132] */
- dhcp_code_SMTP_Server= 69 ,/**< SMTP-Server N Simple Mail Server Addresses [RFC2132] */
- dhcp_code_POP3_Server= 70 ,/**< POP3-Server N Post Office Server Addresses [RFC2132] */
- dhcp_code_NNTP_Server= 71 ,/**< NNTP-Server N Network News Server Addresses [RFC2132] */
- dhcp_code_WWW_Server= 72 ,/**< WWW-Server N WWW Server Addresses [RFC2132] */
- dhcp_code_Finger_Server= 73 ,/**< Finger-Server N Finger Server Addresses [RFC2132] */
- dhcp_code_IRC_Server= 74 ,/**< IRC-Server N Chat Server Addresses [RFC2132] */
- dhcp_code_StreetTalk_Server= 75 ,/**< StreetTalk-Server N StreetTalk Server Addresses [RFC2132] */
- dhcp_code_STDA_Server= 76 ,/**< STDA-Server N ST Directory Assist. Addresses [RFC2132] */
- dhcp_code_User_Class= 77 ,/**< User-Class N User Class Information [RFC3004] */
- dhcp_code_Directory_Agent = 78 ,/**< Directory Agent N directory agent information [RFC2610] */
- dhcp_code_Service_Scope = 79 ,/**< Service Scope N service location agent scope [RFC2610] */
- dhcp_code_Rapid_Commit= 80 ,/**< Rapid Commit 0 Rapid Commit [RFC4039] */
- dhcp_code_Client_FQDN = 81 ,/**< Client FQDN N Fully Qualified Domain Name [RFC4702] */
- dhcp_code_Relay_Agent_Information= 82 ,/**< Relay Agent Information N Relay Agent Information [RFC3046] */
- dhcp_code_iSNS= 83 ,/**< iSNS N Internet Storage Name Service [RFC4174] */
- //84 REMOVED/Unassigned [RFC3679] */
- dhcp_code_NDS_Servers= 85 ,/**< NDS Servers N Novell Directory Services [RFC2241] */
- dhcp_code_NDS_Tree_Name= 86 ,/**< NDS Tree Name N Novell Directory Services [RFC2241] */
- dhcp_code_NDS_Context= 87 ,/**< NDS Context N Novell Directory Services [RFC2241] */
- dhcp_code_BCMCS_Controller_Domain_Name_list= 88 ,/**< BCMCS Controller Domain Name list [RFC4280] */
- dhcp_code_BCMCS_Controller_IPv4_address_option= 89 ,/**< BCMCS Controller IPv4 address option [RFC4280] */
- dhcp_code_Authentication= 90 ,/**< Authentication N Authentication [RFC3118] */
- dhcp_code_client_last_transaction_time= 91 ,/**< client-last-transaction-time option [RFC4388] */
- dhcp_code_associated_ip= 92 ,/**< associated-ip option [RFC4388] */
- dhcp_code_Client_System = 93 ,/**< Client System N Client System Architecture [RFC4578] */
- dhcp_code_Client_NDI = 94 ,/**< Client NDI N Client Network Device Interface [RFC4578] */
- dhcp_code_LDAP= 95 ,/**< LDAP N Lightweight Directory Access Protocol [RFC3679] */
- dhcp_code_REMOVED_Unassigned= 96 ,/**< REMOVED/Unassigned [RFC3679] */
- dhcp_code_UUID_GUID= 97 ,/**< UUID/GUID N UUID/GUID-based Client Identifier [RFC4578] */
- dhcp_code_User_Auth= 98 ,/**< User-Auth N Open Group's User Authentication [RFC2485] */
- dhcp_code_GEOCONF_CIVIC= 99 ,/**< GEOCONF_CIVIC [RFC4776] */
- dhcp_code_PCode= 100 ,/**< PCode N IEEE 1003.1 TZ String [RFC4833] */
- dhcp_code_TCode= 101 ,/**< TCode N Reference to the TZ Database [RFC4833] */
- //102-107 REMOVED/Unassigned [RFC3679]
- //108 REMOVED/Unassigned [RFC3679]
- //109 Unassigned [RFC3679]
- //110 REMOVED/Unassigned [RFC3679]
- //111 Unassigned [RFC3679]
- dhcp_code_Netinfo_Address= 112 ,/**< Netinfo Address N NetInfo Parent Server Address [RFC3679] */
- dhcp_code_Netinfo_Tag= 113 ,/**< Netinfo Tag N NetInfo Parent Server Tag [RFC3679] */
- dhcp_code_= 114 ,/**< URL N URL [RFC3679] */
- //115 REMOVED/Unassigned [RFC3679]
- dhcp_code_Auto_Config= 116 ,/**< Auto-Config N DHCP Auto-Configuration [RFC2563] */
- dhcp_code_Name_Service_Search= 117 ,/**< Name Service Search N Name Service Search [RFC2937] */
- dhcp_code_Subnet_Selection_Option= 118 ,/**< Subnet Selection Option 4 Subnet Selection Option [RFC3011] */
- dhcp_code_Domain_Search= 119 ,/**< Domain Search N DNS domain search list [RFC3397] */
- dhcp_code_SIP_Servers_DHCP_Option= 120 ,/**< SIP Servers DHCP Option N SIP Servers DHCP Option [RFC3361] */
- dhcp_code_Classless_Static_Route_Option= 121 ,/**< Classless Static Route Option N Classless Static Route Option [RFC3442] */
- dhcp_code_CCC= 122 ,/**< CCC N CableLabs Client Configuration [RFC3495] */
- dhcp_code_GeoConf_Option= 123 ,/**< GeoConf Option 16 GeoConf Option [RFC3825] */
- dhcp_code_V_I_Vendor_Class= 124 ,/**< V-I Vendor Class Vendor-Identifying Vendor Class [RFC3925] */
- dhcp_code_V_I_Vendor_Specific_Information= 125 ,/**< V-I Vendor-Specific Information Vendor-Identifying Vendor-Specific Information [RFC3925] */
- //dhcp_code_= 126 ,/**< Removed/Unassigned [RFC3679] */
- //dhcp_code_= 127 ,/**< Removed/Unassigned [RFC3679] */
- //dhcp_code_PXE - undefined= 128 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_Etherboot_signature= 128 ,/**< Etherboot signature. 6 bytes: E4:45:74:68:00:00 */
- dhcp_code_DOCSIS= 128 ,/**< DOCSIS "full security" server IP address */
- dhcp_code_TFTP_Server_IP= 128 ,/**< TFTP Server IP address (for IP Phone software load) */
- //dhcp_code_= 129 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_Kernel_options= 129 ,/**< Kernel options. Variable length string */
- dhcp_code_Call_Server_IP= 129 ,/**< Call Server IP address */
- //dhcp_code_= 130 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_Ethernet_interface= 130 ,/**< Ethernet interface. Variable length string. */
- dhcp_code_Discrimination= 130 ,/**< Discrimination string (to identify vendor) */
- //dhcp_code_= 131 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_Remote_statistics_server_IP= 131 ,/**< Remote statistics server IP address */
- //dhcp_code_= 132 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_IEEE_802_1Q_VLAN_ID= 132 ,/**< IEEE 802.1Q VLAN ID */
- //dhcp_code_= 133 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_IEEE_802_1D_p= 133 ,/**< IEEE 802.1D/p Layer 2 Priority */
- //dhcp_code_= 134 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_DSCP= 134 ,/**< Diffserv Code Point (DSCP) for VoIP signalling and media streams */
- //dhcp_code_= 135 ,/**< PXE - undefined (vendor specific) [RFC4578] */
- dhcp_code_HTTP_Proxy= 135 ,/**< HTTP Proxy for phone-specific applications */
- dhcp_code_OPTION_PANA_AGENT= 136 ,/**< OPTION_PANA_AGENT [RFC5192] */
- dhcp_code_OPTION_V4_LOST= 137 ,/**< OPTION_V4_LOST [RFC5223] */
- dhcp_code_OPTION_CAPWAP_AC_V4= 138 ,/**< OPTION_CAPWAP_AC_V4 N CAPWAP Access Controller addresses [RFC5417] */
- dhcp_code_OPTION_IPv4_Address_MoS= 139 ,/**< OPTION-IPv4_Address-MoS N a series of suboptions [RFC5678] */
- dhcp_code_OPTION_IPv4_FQDN_MoS= 140 ,/**< OPTION-IPv4_FQDN-MoS N a series of suboptions [RFC5678] */
- //141-149 Unassigned [RFC3942] */
- dhcp_code_TFTP_server_address= 150 ,/**< TFTP server address (Tentatively Assigned - 2005-06-23) */
- dhcp_code_Etherboot= 150 ,/**< Etherboot */
- dhcp_code_GRUB_configuration_path_name= 150 ,/**< GRUB configuration path name */
- //151-174 Unassigned [RFC3942]
- //dhcp_code_Etherboot= 175 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
- dhcp_code_IP_Telephone= 176 ,/**< IP Telephone (Tentatively Assigned - 2005-06-23) */
- //dhcp_code_Etherboot= 177 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
- dhcp_code_PacketCable_and_CableHome= 177 ,/**< PacketCable and CableHome (replaced by 122) */
- //178-207 Unassigned [RFC3942]
- dhcp_code_PXELINUX_Magic= 208 ,/**< PXELINUX Magic 4 magic string = F1:00:74:7E [RFC5071] Deprecated */
- dhcp_code_Configuration_File= 209 ,/**< Configuration File N Configuration file [RFC5071] */
- dhcp_code_Path_Prefix= 210 ,/**< Path Prefix N Path Prefix Option [RFC5071] */
- dhcp_code_Reboot_Time = 211 ,/**< Reboot Time 4 Reboot Time [RFC5071] */
- // 212-219 Unassigned
- dhcp_code_Subnet_Allocation= 220 ,/**< Subnet Allocation Option (Tentatively Assigned - 2005-06-23) */
- dhcp_code_Virtual_Subnet= 221 ,/**< Virtual Subnet Selection Option (Tentatively Assigned - 2005-06-23) */
- // 222-223 Unassigned [RFC3942]
- //224-254 Reserved (Private Use)
- dhcp_code_null=224 ,
- dhcp_code_End= 255 ,/**< End 0 None [RFC2132] */
+typedef enum tnet_dhcp_option_code_e {
+ dhcp_code_Pad= 0 ,/**< Pad 0 None [RFC2132] */
+ dhcp_code_Subnet_Mask= 1 ,/**< Subnet Mask 4 Subnet Mask Value [RFC2132] */
+ dhcp_code_Time_Offset= 2 ,/**< Time Offset 4 Time Offset in Seconds from UTC [RFC2132] (note: deprecated by 100 and 101) */
+ dhcp_code_Router= 3 ,/**< Router N N/4 Router addresses [RFC2132] */
+ dhcp_code_Time_Server= 4 ,/**< Time Server N N/4 Timeserver addresses [RFC2132] */
+ dhcp_code_Name_Server= 5 ,/**< Name Server N N/4 IEN-116 Server addresses [RFC2132] */
+ dhcp_code_Domain_Server= 6 ,/**< Domain Server N N/4 DNS Server addresses [RFC2132] */
+ dhcp_code_Log_Server= 7 ,/**< Log Server N N/4 Logging Server addresses [RFC2132] */
+ dhcp_code_Quotes_Server= 8 ,/**< Quotes Server N N/4 Quotes Server addresses [RFC2132] */
+ dhcp_code_LPR_Server= 9 ,/**< LPR Server N N/4 Printer Server addresses [RFC2132] */
+ dhcp_code_Impress_Server= 10 ,/**< Impress Server N N/4 Impress Server addresses [RFC2132] */
+ dhcp_code_RLP_Server= 11 ,/**< RLP Server N N/4 RLP Server addresses [RFC2132] */
+ dhcp_code_Hostname= 12 ,/**< Hostname N Hostname string [RFC2132] */
+ dhcp_code_Boot_File_Size= 13 ,/**< Boot File Size 2 Size of boot file in 512 byte chunks [RFC2132] */
+ dhcp_code_Merit_Dump_File= 14 ,/**< Merit Dump File N Client to dump and name the file to dump it to [RFC2132] */
+ dhcp_code_Domain_Name= 15 ,/**< Domain Name N The DNS domain name of the client [RFC2132] */
+ dhcp_code_Swap_Server= 16 ,/**< Swap Server N Swap Server address [RFC2132] */
+ dhcp_code_Root_Path= 17 ,/**< Root Path N Path name for root disk [RFC2132] */
+ dhcp_code_Extension_File= 18 ,/**< Extension File N Path name for more BOOTP info [RFC2132] */
+ dhcp_code_Forward_On_Off= 19 ,/**< Forward On/Off 1 Enable/Disable IP Forwarding [RFC2132] */
+ dhcp_code_SrcRte_On_Off = 20 ,/**< SrcRte On/Off 1 Enable/Disable Source Routing [RFC2132] */
+ dhcp_code_Policy_Filter= 21 ,/**< Policy Filter N Routing Policy Filters [RFC2132] */
+ dhcp_code_Max_DG_Assembly= 22 ,/**< Max DG Assembly 2 Max Datagram Reassembly Size [RFC2132] */
+ dhcp_code_Default_IP_TTL= 23 ,/**< Default IP TTL 1 Default IP Time to Live [RFC2132] */
+ dhcp_code_MTU_Timeout= 24 ,/**< MTU Timeout 4 Path MTU Aging Timeout [RFC2132] */
+ dhcp_code_MTU_Plateau= 25 ,/**< MTU Plateau N Path MTU Plateau Table [RFC2132] */
+ dhcp_code_MTU_Interface= 26 ,/**< MTU Interface 2 Interface MTU Size [RFC2132] */
+ dhcp_code_MTU_Subnet= 27 ,/**< MTU Subnet 1 All Subnets are Local [RFC2132] */
+ dhcp_code_Broadcast_Address= 28 ,/**< Broadcast Address 4 Broadcast Address [RFC2132] */
+ dhcp_code_Mask_Discovery= 29 ,/**< Mask Discovery 1 Perform Mask Discovery [RFC2132] */
+ dhcp_code_Mask_Supplier= 30 ,/**< Mask Supplier 1 Provide Mask to Others [RFC2132] */
+ dhcp_code_Router_Discovery= 31 ,/**< Router Discovery 1 Perform Router Discovery [RFC2132] */
+ dhcp_code_Router_Request= 32 ,/**< Router Request 4 Router Solicitation Address [RFC2132] */
+ dhcp_code_Static_Route= 33 ,/**< Static Route N Static Routing Table [RFC2132] */
+ dhcp_code_Trailers= 34 ,/**< Trailers 1 Trailer Encapsulation [RFC2132] */
+ dhcp_code_ARP_Timeout= 35 ,/**< ARP Timeout 4 ARP Cache Timeout [RFC2132] */
+ dhcp_code_Ethernet= 36 ,/**< Ethernet 1 Ethernet Encapsulation [RFC2132] */
+ dhcp_code_Default_TCP_TTL= 37 ,/**< Default TCP TTL 1 Default TCP Time to Live [RFC2132] */
+ dhcp_code_Keepalive_Time= 38 ,/**< Keepalive Time 4 TCP Keepalive Interval [RFC2132] */
+ dhcp_code_Keepalive_Data= 39 ,/**< Keepalive Data 1 TCP Keepalive Garbage [RFC2132] */
+ dhcp_code_NIS_Domain= 40 ,/**< NIS Domain N NIS Domain Name [RFC2132] */
+ dhcp_code_NIS_Servers= 41 ,/**< NIS Servers N NIS Server Addresses [RFC2132] */
+ dhcp_code_NTP_Servers= 42 ,/**< NTP Servers N NTP Server Addresses [RFC2132] */
+ dhcp_code_Vendor_Specific= 43 ,/**< Vendor Specific N Vendor Specific Information [RFC2132] */
+ dhcp_code_NETBIOS_Name_Srv= 44 ,/**< NETBIOS Name Srv N NETBIOS Name Servers [RFC2132] */
+ dhcp_code_NETBIOS_Dist_Srv= 45 ,/**< NETBIOS Dist Srv N NETBIOS Datagram Distribution [RFC2132] */
+ dhcp_code_NETBIOS_Node_Type= 46 ,/**< NETBIOS Node Type 1 NETBIOS Node Type [RFC2132] */
+ dhcp_code_NETBIOS_Scope= 47 ,/**< NETBIOS Scope N NETBIOS Scope [RFC2132] */
+ dhcp_code_X_Window_Font= 48 ,/**< X Window Font N X Window Font Server [RFC2132] */
+ dhcp_code_X_Window_Manager= 49 ,/**< X Window Manager N X Window Display Manager [RFC2132] */
+ dhcp_code_Address_Request= 50 ,/**< Address Request 4 Requested IP Address [RFC2132] */
+ dhcp_code_Address_Time= 51 ,/**< Address Time 4 IP Address Lease Time [RFC2132] */
+ dhcp_code_Overload= 52 ,/**< Overload 1 Overload "sname" or "file" [RFC2132] */
+ dhcp_code_DHCP_Msg_Type= 53 ,/**< DHCP Msg Type 1 DHCP Message Type [RFC2132] */
+ dhcp_code_DHCP_Server_Id= 54 ,/**< DHCP Server Id 4 DHCP Server Identification [RFC2132] */
+ dhcp_code_Parameter_List= 55 ,/**< Parameter List N Parameter Request List [RFC2132] */
+ dhcp_code_DHCP_Error_Message= 56 ,/**< DHCP Message N DHCP Error Message [RFC2132] */
+ dhcp_code_DHCP_Max_Msg_Size= 57 ,/**< DHCP Max Msg Size 2 DHCP Maximum Message Size [RFC2132] */
+ dhcp_code_Renewal_Time= 58 ,/**< Renewal Time 4 DHCP Renewal (T1) Time [RFC2132] */
+ dhcp_code_Rebinding_Time= 59 ,/**< Rebinding Time 4 DHCP Rebinding (T2) Time [RFC2132] */
+ dhcp_code_Class_Id= 60 ,/**< Class Id N Class Identifier [RFC2132] */
+ dhcp_code_Client_Id= 61 ,/**< Client Id N Client Identifier [RFC2132] */
+ dhcp_code_NetWare_IP_Domain= 62 ,/**< NetWare/IP Domain N NetWare/IP Domain Name [RFC2242] */
+ dhcp_code_NetWare_IP_Option= 63 ,/**< NetWare/IP Option N NetWare/IP sub Options [RFC2242] */
+ dhcp_code_NIS_Domain_Name= 64 ,/**< NIS-Domain-Name N NIS+ v3 Client Domain Name [RFC2132] */
+ dhcp_code_NIS_Server_Addr = 65 ,/**< NIS-Server-Addr N NIS+ v3 Server Addresses [RFC2132] */
+ dhcp_code_Server_Name= 66 ,/**< Server-Name N TFTP Server Name [RFC2132] */
+ dhcp_code_Bootfile_Name= 67 ,/**< Bootfile-Name N Boot File Name [RFC2132] */
+ dhcp_code_Home_Agent_Addrs= 68 ,/**< Home-Agent-Addrs N Home Agent Addresses [RFC2132] */
+ dhcp_code_SMTP_Server= 69 ,/**< SMTP-Server N Simple Mail Server Addresses [RFC2132] */
+ dhcp_code_POP3_Server= 70 ,/**< POP3-Server N Post Office Server Addresses [RFC2132] */
+ dhcp_code_NNTP_Server= 71 ,/**< NNTP-Server N Network News Server Addresses [RFC2132] */
+ dhcp_code_WWW_Server= 72 ,/**< WWW-Server N WWW Server Addresses [RFC2132] */
+ dhcp_code_Finger_Server= 73 ,/**< Finger-Server N Finger Server Addresses [RFC2132] */
+ dhcp_code_IRC_Server= 74 ,/**< IRC-Server N Chat Server Addresses [RFC2132] */
+ dhcp_code_StreetTalk_Server= 75 ,/**< StreetTalk-Server N StreetTalk Server Addresses [RFC2132] */
+ dhcp_code_STDA_Server= 76 ,/**< STDA-Server N ST Directory Assist. Addresses [RFC2132] */
+ dhcp_code_User_Class= 77 ,/**< User-Class N User Class Information [RFC3004] */
+ dhcp_code_Directory_Agent = 78 ,/**< Directory Agent N directory agent information [RFC2610] */
+ dhcp_code_Service_Scope = 79 ,/**< Service Scope N service location agent scope [RFC2610] */
+ dhcp_code_Rapid_Commit= 80 ,/**< Rapid Commit 0 Rapid Commit [RFC4039] */
+ dhcp_code_Client_FQDN = 81 ,/**< Client FQDN N Fully Qualified Domain Name [RFC4702] */
+ dhcp_code_Relay_Agent_Information= 82 ,/**< Relay Agent Information N Relay Agent Information [RFC3046] */
+ dhcp_code_iSNS= 83 ,/**< iSNS N Internet Storage Name Service [RFC4174] */
+ //84 REMOVED/Unassigned [RFC3679] */
+ dhcp_code_NDS_Servers= 85 ,/**< NDS Servers N Novell Directory Services [RFC2241] */
+ dhcp_code_NDS_Tree_Name= 86 ,/**< NDS Tree Name N Novell Directory Services [RFC2241] */
+ dhcp_code_NDS_Context= 87 ,/**< NDS Context N Novell Directory Services [RFC2241] */
+ dhcp_code_BCMCS_Controller_Domain_Name_list= 88 ,/**< BCMCS Controller Domain Name list [RFC4280] */
+ dhcp_code_BCMCS_Controller_IPv4_address_option= 89 ,/**< BCMCS Controller IPv4 address option [RFC4280] */
+ dhcp_code_Authentication= 90 ,/**< Authentication N Authentication [RFC3118] */
+ dhcp_code_client_last_transaction_time= 91 ,/**< client-last-transaction-time option [RFC4388] */
+ dhcp_code_associated_ip= 92 ,/**< associated-ip option [RFC4388] */
+ dhcp_code_Client_System = 93 ,/**< Client System N Client System Architecture [RFC4578] */
+ dhcp_code_Client_NDI = 94 ,/**< Client NDI N Client Network Device Interface [RFC4578] */
+ dhcp_code_LDAP= 95 ,/**< LDAP N Lightweight Directory Access Protocol [RFC3679] */
+ dhcp_code_REMOVED_Unassigned= 96 ,/**< REMOVED/Unassigned [RFC3679] */
+ dhcp_code_UUID_GUID= 97 ,/**< UUID/GUID N UUID/GUID-based Client Identifier [RFC4578] */
+ dhcp_code_User_Auth= 98 ,/**< User-Auth N Open Group's User Authentication [RFC2485] */
+ dhcp_code_GEOCONF_CIVIC= 99 ,/**< GEOCONF_CIVIC [RFC4776] */
+ dhcp_code_PCode= 100 ,/**< PCode N IEEE 1003.1 TZ String [RFC4833] */
+ dhcp_code_TCode= 101 ,/**< TCode N Reference to the TZ Database [RFC4833] */
+ //102-107 REMOVED/Unassigned [RFC3679]
+ //108 REMOVED/Unassigned [RFC3679]
+ //109 Unassigned [RFC3679]
+ //110 REMOVED/Unassigned [RFC3679]
+ //111 Unassigned [RFC3679]
+ dhcp_code_Netinfo_Address= 112 ,/**< Netinfo Address N NetInfo Parent Server Address [RFC3679] */
+ dhcp_code_Netinfo_Tag= 113 ,/**< Netinfo Tag N NetInfo Parent Server Tag [RFC3679] */
+ dhcp_code_= 114 ,/**< URL N URL [RFC3679] */
+ //115 REMOVED/Unassigned [RFC3679]
+ dhcp_code_Auto_Config= 116 ,/**< Auto-Config N DHCP Auto-Configuration [RFC2563] */
+ dhcp_code_Name_Service_Search= 117 ,/**< Name Service Search N Name Service Search [RFC2937] */
+ dhcp_code_Subnet_Selection_Option= 118 ,/**< Subnet Selection Option 4 Subnet Selection Option [RFC3011] */
+ dhcp_code_Domain_Search= 119 ,/**< Domain Search N DNS domain search list [RFC3397] */
+ dhcp_code_SIP_Servers_DHCP_Option= 120 ,/**< SIP Servers DHCP Option N SIP Servers DHCP Option [RFC3361] */
+ dhcp_code_Classless_Static_Route_Option= 121 ,/**< Classless Static Route Option N Classless Static Route Option [RFC3442] */
+ dhcp_code_CCC= 122 ,/**< CCC N CableLabs Client Configuration [RFC3495] */
+ dhcp_code_GeoConf_Option= 123 ,/**< GeoConf Option 16 GeoConf Option [RFC3825] */
+ dhcp_code_V_I_Vendor_Class= 124 ,/**< V-I Vendor Class Vendor-Identifying Vendor Class [RFC3925] */
+ dhcp_code_V_I_Vendor_Specific_Information= 125 ,/**< V-I Vendor-Specific Information Vendor-Identifying Vendor-Specific Information [RFC3925] */
+ //dhcp_code_= 126 ,/**< Removed/Unassigned [RFC3679] */
+ //dhcp_code_= 127 ,/**< Removed/Unassigned [RFC3679] */
+ //dhcp_code_PXE - undefined= 128 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_Etherboot_signature= 128 ,/**< Etherboot signature. 6 bytes: E4:45:74:68:00:00 */
+ dhcp_code_DOCSIS= 128 ,/**< DOCSIS "full security" server IP address */
+ dhcp_code_TFTP_Server_IP= 128 ,/**< TFTP Server IP address (for IP Phone software load) */
+ //dhcp_code_= 129 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_Kernel_options= 129 ,/**< Kernel options. Variable length string */
+ dhcp_code_Call_Server_IP= 129 ,/**< Call Server IP address */
+ //dhcp_code_= 130 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_Ethernet_interface= 130 ,/**< Ethernet interface. Variable length string. */
+ dhcp_code_Discrimination= 130 ,/**< Discrimination string (to identify vendor) */
+ //dhcp_code_= 131 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_Remote_statistics_server_IP= 131 ,/**< Remote statistics server IP address */
+ //dhcp_code_= 132 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_IEEE_802_1Q_VLAN_ID= 132 ,/**< IEEE 802.1Q VLAN ID */
+ //dhcp_code_= 133 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_IEEE_802_1D_p= 133 ,/**< IEEE 802.1D/p Layer 2 Priority */
+ //dhcp_code_= 134 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_DSCP= 134 ,/**< Diffserv Code Point (DSCP) for VoIP signalling and media streams */
+ //dhcp_code_= 135 ,/**< PXE - undefined (vendor specific) [RFC4578] */
+ dhcp_code_HTTP_Proxy= 135 ,/**< HTTP Proxy for phone-specific applications */
+ dhcp_code_OPTION_PANA_AGENT= 136 ,/**< OPTION_PANA_AGENT [RFC5192] */
+ dhcp_code_OPTION_V4_LOST= 137 ,/**< OPTION_V4_LOST [RFC5223] */
+ dhcp_code_OPTION_CAPWAP_AC_V4= 138 ,/**< OPTION_CAPWAP_AC_V4 N CAPWAP Access Controller addresses [RFC5417] */
+ dhcp_code_OPTION_IPv4_Address_MoS= 139 ,/**< OPTION-IPv4_Address-MoS N a series of suboptions [RFC5678] */
+ dhcp_code_OPTION_IPv4_FQDN_MoS= 140 ,/**< OPTION-IPv4_FQDN-MoS N a series of suboptions [RFC5678] */
+ //141-149 Unassigned [RFC3942] */
+ dhcp_code_TFTP_server_address= 150 ,/**< TFTP server address (Tentatively Assigned - 2005-06-23) */
+ dhcp_code_Etherboot= 150 ,/**< Etherboot */
+ dhcp_code_GRUB_configuration_path_name= 150 ,/**< GRUB configuration path name */
+ //151-174 Unassigned [RFC3942]
+ //dhcp_code_Etherboot= 175 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
+ dhcp_code_IP_Telephone= 176 ,/**< IP Telephone (Tentatively Assigned - 2005-06-23) */
+ //dhcp_code_Etherboot= 177 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
+ dhcp_code_PacketCable_and_CableHome= 177 ,/**< PacketCable and CableHome (replaced by 122) */
+ //178-207 Unassigned [RFC3942]
+ dhcp_code_PXELINUX_Magic= 208 ,/**< PXELINUX Magic 4 magic string = F1:00:74:7E [RFC5071] Deprecated */
+ dhcp_code_Configuration_File= 209 ,/**< Configuration File N Configuration file [RFC5071] */
+ dhcp_code_Path_Prefix= 210 ,/**< Path Prefix N Path Prefix Option [RFC5071] */
+ dhcp_code_Reboot_Time = 211 ,/**< Reboot Time 4 Reboot Time [RFC5071] */
+ // 212-219 Unassigned
+ dhcp_code_Subnet_Allocation= 220 ,/**< Subnet Allocation Option (Tentatively Assigned - 2005-06-23) */
+ dhcp_code_Virtual_Subnet= 221 ,/**< Virtual Subnet Selection Option (Tentatively Assigned - 2005-06-23) */
+ // 222-223 Unassigned [RFC3942]
+ //224-254 Reserved (Private Use)
+ dhcp_code_null=224 ,
+ dhcp_code_End= 255 ,/**< End 0 None [RFC2132] */
}
tnet_dhcp_option_code_t;
/** DHCP/BOOTP option as per RFC 2132.
* Format ==> subclause 2.
*/
-typedef struct tnet_dhcp_option_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t initialized;
-
- tnet_dhcp_option_code_t code; /**< 1-byte option-code. */
- tsk_buffer_t *value;
+typedef struct tnet_dhcp_option_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t initialized;
+
+ tnet_dhcp_option_code_t code; /**< 1-byte option-code. */
+ tsk_buffer_t *value;
}
tnet_dhcp_option_t;
@@ -243,16 +241,15 @@ int tnet_dhcp_option_serializeex(tnet_dhcp_option_code_t code, uint8_t length, c
*=======================================================================================*/
/** Parameter Request List Option */
-typedef struct tnet_dhcp_option_paramslist_s
-{
- TNET_DECLARE_DHCP_OPTION;
+typedef struct tnet_dhcp_option_paramslist_s {
+ TNET_DECLARE_DHCP_OPTION;
- /* RFC 2132 - 9.8. Parameter Request List
- Code Len Option Codes
- +-----+-----+-----+-----+---
- | 55 | n | c1 | c2 | ...
- +-----+-----+-----+-----+---
- */
+ /* RFC 2132 - 9.8. Parameter Request List
+ Code Len Option Codes
+ +-----+-----+-----+-----+---
+ | 55 | n | c1 | c2 | ...
+ +-----+-----+-----+-----+---
+ */
}
tnet_dhcp_option_paramslist_t;
int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tnet_dhcp_option_code_t code);
@@ -262,17 +259,16 @@ int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tn
*=======================================================================================*/
/** Domain Name Server Option */
-typedef struct tnet_dhcp_option_dns_s
-{
- TNET_DECLARE_DHCP_OPTION;
+typedef struct tnet_dhcp_option_dns_s {
+ TNET_DECLARE_DHCP_OPTION;
- /* RFC 2132 - 3.8. Domain Name Server Option
- Code Len Address 1 Address 2
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- | 6 | n | a1 | a2 | a3 | a4 | a1 | a2 | ...
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- */
- tsk_strings_L_t *servers;
+ /* RFC 2132 - 3.8. Domain Name Server Option
+ Code Len Address 1 Address 2
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ | 6 | n | a1 | a2 | a3 | a4 | a1 | a2 | ...
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ */
+ tsk_strings_L_t *servers;
}
tnet_dhcp_option_dns_t;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_option_sip.c b/tinyNET/src/dhcp/tnet_dhcp_option_sip.c
index 0c763fb..bbfd39a 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_option_sip.c
+++ b/tinyNET/src/dhcp/tnet_dhcp_option_sip.c
@@ -2,25 +2,25 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
*/
/**@file tnet_dhcp_option_sip.c
- * @brief Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for
+ * @brief Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for
* Session Initiation Protocol (SIP) Servers as per RFC 3361.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
@@ -39,7 +39,7 @@
tnet_dhcp_option_sip_t* tnet_dhcp_option_sip_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp_option_sip_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp_option_sip_def_t, payload, payload_size);
}
//
@@ -47,85 +47,84 @@ tnet_dhcp_option_sip_t* tnet_dhcp_option_sip_create(const void* payload, tsk_siz
//
static tsk_object_t* tnet_dhcp_option_sip_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp_option_sip_t *option = self;
- if(option){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- const uint8_t* payloadPtr = (const uint8_t*)payload;
- const uint8_t* payloadEnd = (payloadPtr + payload_size);
-
- /* init base */
- tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_SIP_Servers_DHCP_Option);
-
- option->servers = tsk_list_create();
-
- /* Set values as per RFC 3361. */
- if(*payloadPtr == 0){ /* enc=0 */
- /*
- +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- |120|27 | 0 | 7 |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'c'|'o'|'m'| 0 |
- +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 7
- |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'n'|'e'|'t'| 0 | +---+---+---
- +---+---+---+---+---+---+---+---+---+---+
- */
- tsk_size_t offset = 1;
- char* server = 0;
- payloadPtr++;
- while((payloadPtr < payloadEnd) && !tnet_dns_rr_qname_deserialize(payload, &server, &offset)){
- tsk_string_t* string = tsk_string_create(server);
- tsk_list_push_back_data(option->servers, (void*)&string);
- TSK_FREE(server);
- payloadPtr += offset;
- }
- }
- else{
- /*
- Code Len enc Address 1 Address 2
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- | 120 | n | 1 | a1 | a2 | a3 | a4 | a1 | ...
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- */
- uint32_t address;
- tsk_string_t* addrstring;
- char* ip4 = 0;
-
- while(payloadPtr < payloadEnd){
- ++payloadPtr;
- address = (uint32_t)tnet_htonl_2(payloadPtr);
-
- tsk_sprintf(&ip4, "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
-
- addrstring = tsk_string_create(ip4);
- tsk_list_push_back_data(option->servers, (void*)&addrstring);
-
- TSK_FREE(ip4);
-
- payloadPtr+= 4;
- }
- }
- }
- return self;
-}
+ tnet_dhcp_option_sip_t *option = self;
+ if(option) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ const uint8_t* payloadPtr = (const uint8_t*)payload;
+ const uint8_t* payloadEnd = (payloadPtr + payload_size);
+
+ /* init base */
+ tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_SIP_Servers_DHCP_Option);
+
+ option->servers = tsk_list_create();
-static tsk_object_t* tnet_dhcp_option_sip_dtor(tsk_object_t * self)
-{
- tnet_dhcp_option_sip_t *option = self;
- if(option){
- /* deinit base */
- tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
+ /* Set values as per RFC 3361. */
+ if(*payloadPtr == 0) { /* enc=0 */
+ /*
+ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ |120|27 | 0 | 7 |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'c'|'o'|'m'| 0 |
+ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 7
+ |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'n'|'e'|'t'| 0 | +---+---+---
+ +---+---+---+---+---+---+---+---+---+---+
+ */
+ tsk_size_t offset = 1;
+ char* server = 0;
+ payloadPtr++;
+ while((payloadPtr < payloadEnd) && !tnet_dns_rr_qname_deserialize(payload, &server, &offset)) {
+ tsk_string_t* string = tsk_string_create(server);
+ tsk_list_push_back_data(option->servers, (void*)&string);
+ TSK_FREE(server);
+ payloadPtr += offset;
+ }
+ }
+ else {
+ /*
+ Code Len enc Address 1 Address 2
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ | 120 | n | 1 | a1 | a2 | a3 | a4 | a1 | ...
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ */
+ uint32_t address;
+ tsk_string_t* addrstring;
+ char* ip4 = 0;
- TSK_OBJECT_SAFE_FREE(option->servers);
- }
- return self;
+ while(payloadPtr < payloadEnd) {
+ ++payloadPtr;
+ address = (uint32_t)tnet_htonl_2(payloadPtr);
+
+ tsk_sprintf(&ip4, "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
+
+ addrstring = tsk_string_create(ip4);
+ tsk_list_push_back_data(option->servers, (void*)&addrstring);
+
+ TSK_FREE(ip4);
+
+ payloadPtr+= 4;
+ }
+ }
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp_option_sip_def_s =
+static tsk_object_t* tnet_dhcp_option_sip_dtor(tsk_object_t * self)
{
- sizeof(tnet_dhcp_option_sip_t),
- tnet_dhcp_option_sip_ctor,
- tnet_dhcp_option_sip_dtor,
- tsk_null,
+ tnet_dhcp_option_sip_t *option = self;
+ if(option) {
+ /* deinit base */
+ tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
+
+ TSK_OBJECT_SAFE_FREE(option->servers);
+ }
+ return self;
+}
+
+static const tsk_object_def_t tnet_dhcp_option_sip_def_s = {
+ sizeof(tnet_dhcp_option_sip_t),
+ tnet_dhcp_option_sip_ctor,
+ tnet_dhcp_option_sip_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp_option_sip_def_t = &tnet_dhcp_option_sip_def_s;
diff --git a/tinyNET/src/dhcp/tnet_dhcp_option_sip.h b/tinyNET/src/dhcp/tnet_dhcp_option_sip.h
index 2e35bf5..f08c2e6 100755
--- a/tinyNET/src/dhcp/tnet_dhcp_option_sip.h
+++ b/tinyNET/src/dhcp/tnet_dhcp_option_sip.h
@@ -2,25 +2,25 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
*/
/**@file tnet_dhcp_option_sip.h
- * @brief Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for
+ * @brief Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for
* Session Initiation Protocol (SIP) Servers as per RFC 3361.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
@@ -39,17 +39,16 @@
TNET_BEGIN_DECLS
-typedef struct tnet_dhcp_option_sip_s
-{
- TNET_DECLARE_DHCP_OPTION;
-
- /* RFC 3361 subclause 3.1
- Code Len enc DNS name of SIP server
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- | 120 | n | 0 | s1 | s2 | s3 | s4 | s5 | ...
- +-----+-----+-----+-----+-----+-----+-----+-----+--
- */
- tsk_strings_L_t *servers;
+typedef struct tnet_dhcp_option_sip_s {
+ TNET_DECLARE_DHCP_OPTION;
+
+ /* RFC 3361 subclause 3.1
+ Code Len enc DNS name of SIP server
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ | 120 | n | 0 | s1 | s2 | s3 | s4 | s5 | ...
+ +-----+-----+-----+-----+-----+-----+-----+-----+--
+ */
+ tsk_strings_L_t *servers;
}
tnet_dhcp_option_sip_t;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6.c b/tinyNET/src/dhcp6/tnet_dhcp6.c
index 8e2fdb7..94bf8cc 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6.c
+++ b/tinyNET/src/dhcp6/tnet_dhcp6.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,145 +43,144 @@
tnet_dhcp6_ctx_t* tnet_dhcp6_ctx_create()
{
- return tsk_object_new(tnet_dhcp6_ctx_def_t);
+ return tsk_object_new(tnet_dhcp6_ctx_def_t);
}
/**@ingroup tnet_dhcp6_group
*/
tnet_dhcp6_reply_t* tnet_dhcp6_send_request(const tnet_dhcp6_ctx_t* ctx, tnet_dhcp6_request_t* request)
{
- tsk_buffer_t *output;
- tnet_dhcp6_reply_t* reply = 0;
- int ret;
- struct timeval tv;
- fd_set set;
- uint64_t timeout = 0;
- tsk_list_item_t *item;
- const tnet_interface_t *iface;
- tnet_ip_t bestsource;
-
- tnet_socket_t *localsocket6 = 0;
- struct sockaddr_storage server;
-
- if(!ctx || !request){
- goto bail;
- }
-
- if((ret = tnet_getbestsource(TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port, tnet_socket_type_udp_ipv6, &bestsource))){
- TSK_DEBUG_WARN("Failed to get best source for [%s]:%u.", TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port);
- //fe80::21b:63ff:fea9:c14e%4
- localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv6);
- }
- else{
- localsocket6 = tnet_socket_create(bestsource, ctx->port_client, tnet_socket_type_udp_ipv6);
- }
-
- /* Check local socket. */
- if(!TNET_SOCKET_IS_VALID(localsocket6)){
- TSK_DEBUG_ERROR("Failed to create/bind DHCPv6 client socket.");
- goto bail;
- }
-
- /* Always wait for 200ms before retransmission */
- tv.tv_sec = 0;
- tv.tv_usec = (200 * 1000);
-
- if(tnet_sockaddr_init(TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port, tnet_socket_type_udp_ipv6, &server)){
- TNET_PRINT_LAST_ERROR("Failed to initialize the DHCPv6 server address.");
- goto bail;
- }
-
- /* Set timeout */
- timeout = tsk_time_epoch() + ctx->timeout;
-
- do
- {
- tsk_list_foreach(item, ctx->interfaces){
- iface = item->data;
-
- /* Set FD */
- FD_ZERO(&set);
- FD_SET(localsocket6->fd, &set);
-
- ///* ciaddr */
- //if(request->type == dhcp_type_inform){
- // struct sockaddr_storage ss;
- // if(!tnet_get_sockaddr(localsocket4->fd, &ss)){
- // uint32_t addr = tnet_htonl_2(&((struct sockaddr_in*)&ss)->sin_addr);
- // memcpy(&request->ciaddr, &addr, 4);
- // }
- //}
-
- ///* chaddr */
- //memset(request->chaddr, 0, sizeof(request->chaddr));
- //request->hlen = iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length;
- //memcpy(request->chaddr, iface->mac_address, request->hlen);
-
- /* Serialize and send to the server. */
- if(!(output = tnet_dhcp6_message_serialize(ctx, request))){
- TSK_DEBUG_ERROR("Failed to serialize the DHCPv6 message.");
- goto next_iface;
- }
- /* Send the request to the DHCP server */
- if((ret =tnet_sockfd_sendto(localsocket6->fd, (const struct sockaddr*)&server, output->data, output->size))<0){
- TNET_PRINT_LAST_ERROR("Failed to send DHCPv6 request.");
-
- tsk_thread_sleep(150); // wait 150ms before trying the next iface.
- goto next_iface;
- }
- /* wait for response */
- if((ret = select(localsocket6->fd+1, &set, NULL, NULL, &tv))<0){ /* Error */
- TNET_PRINT_LAST_ERROR("select have failed.");
- tsk_thread_sleep(150); // wait 150ms before trying the next iface.
- goto next_iface;
- }
- else if(ret == 0){ /* timeout ==> do nothing */
- }
- else{ /* there is data to read. */
- unsigned int len = 0;
- void* data = 0;
-
- /* Check how how many bytes are pending */
- if((ret = tnet_ioctlt(localsocket6->fd, FIONREAD, &len))<0){
- goto next_iface;
- }
-
- /* Receive pending data */
- data = tsk_calloc(len, sizeof(uint8_t));
- if((ret = tnet_sockfd_recv(localsocket6->fd, data, len, 0))<0){
- TSK_FREE(data);
-
- TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams.");
- goto next_iface;
- }
-
- /* Parse the incoming response. */
- reply = tnet_dhcp6_message_deserialize(ctx, data, (tsk_size_t)ret);
- TSK_FREE(data);
-
- if(reply)
- { /* response successfuly parsed */
- if(request->transaction_id != reply->transaction_id)
- { /* Not same transaction id ==> continue*/
- TSK_OBJECT_SAFE_FREE(reply);
- }
- }
- }
-
- next_iface:
- TSK_OBJECT_SAFE_FREE(output);
- if(reply){
- goto bail;
- }
- }
- break;//FIXME
- }
- while(timeout > tsk_time_epoch());
+ tsk_buffer_t *output;
+ tnet_dhcp6_reply_t* reply = 0;
+ int ret;
+ struct timeval tv;
+ fd_set set;
+ uint64_t timeout = 0;
+ tsk_list_item_t *item;
+ const tnet_interface_t *iface;
+ tnet_ip_t bestsource;
+
+ tnet_socket_t *localsocket6 = 0;
+ struct sockaddr_storage server;
+
+ if(!ctx || !request) {
+ goto bail;
+ }
+
+ if((ret = tnet_getbestsource(TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port, tnet_socket_type_udp_ipv6, &bestsource))) {
+ TSK_DEBUG_WARN("Failed to get best source for [%s]:%u.", TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port);
+ //fe80::21b:63ff:fea9:c14e%4
+ localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv6);
+ }
+ else {
+ localsocket6 = tnet_socket_create(bestsource, ctx->port_client, tnet_socket_type_udp_ipv6);
+ }
+
+ /* Check local socket. */
+ if(!TNET_SOCKET_IS_VALID(localsocket6)) {
+ TSK_DEBUG_ERROR("Failed to create/bind DHCPv6 client socket.");
+ goto bail;
+ }
+
+ /* Always wait for 200ms before retransmission */
+ tv.tv_sec = 0;
+ tv.tv_usec = (200 * 1000);
+
+ if(tnet_sockaddr_init(TNET_DHCP6_All_DHCP_Relay_Agents_and_Servers, ctx->server_port, tnet_socket_type_udp_ipv6, &server)) {
+ TNET_PRINT_LAST_ERROR("Failed to initialize the DHCPv6 server address.");
+ goto bail;
+ }
+
+ /* Set timeout */
+ timeout = tsk_time_epoch() + ctx->timeout;
+
+ do {
+ tsk_list_foreach(item, ctx->interfaces) {
+ iface = item->data;
+
+ /* Set FD */
+ FD_ZERO(&set);
+ FD_SET(localsocket6->fd, &set);
+
+ ///* ciaddr */
+ //if(request->type == dhcp_type_inform){
+ // struct sockaddr_storage ss;
+ // if(!tnet_get_sockaddr(localsocket4->fd, &ss)){
+ // uint32_t addr = tnet_htonl_2(&((struct sockaddr_in*)&ss)->sin_addr);
+ // memcpy(&request->ciaddr, &addr, 4);
+ // }
+ //}
+
+ ///* chaddr */
+ //memset(request->chaddr, 0, sizeof(request->chaddr));
+ //request->hlen = iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length;
+ //memcpy(request->chaddr, iface->mac_address, request->hlen);
+
+ /* Serialize and send to the server. */
+ if(!(output = tnet_dhcp6_message_serialize(ctx, request))) {
+ TSK_DEBUG_ERROR("Failed to serialize the DHCPv6 message.");
+ goto next_iface;
+ }
+ /* Send the request to the DHCP server */
+ if((ret =tnet_sockfd_sendto(localsocket6->fd, (const struct sockaddr*)&server, output->data, output->size))<0) {
+ TNET_PRINT_LAST_ERROR("Failed to send DHCPv6 request.");
+
+ tsk_thread_sleep(150); // wait 150ms before trying the next iface.
+ goto next_iface;
+ }
+ /* wait for response */
+ if((ret = select(localsocket6->fd+1, &set, NULL, NULL, &tv))<0) { /* Error */
+ TNET_PRINT_LAST_ERROR("select have failed.");
+ tsk_thread_sleep(150); // wait 150ms before trying the next iface.
+ goto next_iface;
+ }
+ else if(ret == 0) { /* timeout ==> do nothing */
+ }
+ else { /* there is data to read. */
+ unsigned int len = 0;
+ void* data = 0;
+
+ /* Check how how many bytes are pending */
+ if((ret = tnet_ioctlt(localsocket6->fd, FIONREAD, &len))<0) {
+ goto next_iface;
+ }
+
+ /* Receive pending data */
+ data = tsk_calloc(len, sizeof(uint8_t));
+ if((ret = tnet_sockfd_recv(localsocket6->fd, data, len, 0))<0) {
+ TSK_FREE(data);
+
+ TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams.");
+ goto next_iface;
+ }
+
+ /* Parse the incoming response. */
+ reply = tnet_dhcp6_message_deserialize(ctx, data, (tsk_size_t)ret);
+ TSK_FREE(data);
+
+ if(reply) {
+ /* response successfuly parsed */
+ if(request->transaction_id != reply->transaction_id) {
+ /* Not same transaction id ==> continue*/
+ TSK_OBJECT_SAFE_FREE(reply);
+ }
+ }
+ }
+
+next_iface:
+ TSK_OBJECT_SAFE_FREE(output);
+ if(reply) {
+ goto bail;
+ }
+ }
+ break;//FIXME
+ }
+ while(timeout > tsk_time_epoch());
bail:
- TSK_OBJECT_SAFE_FREE(localsocket6);
+ TSK_OBJECT_SAFE_FREE(localsocket6);
- return reply;
+ return reply;
}
@@ -193,28 +192,28 @@ bail:
*/
tnet_dhcp6_reply_t* tnet_dhcp6_requestinfo(const tnet_dhcp6_ctx_t* ctx, const tnet_dhcp6_option_orequest_t *orequest)
{
- tnet_dhcp6_reply_t* reply = 0;
- tnet_dhcp6_request_t* request = tnet_dhcp6_request_create(dhcp6_type_information_request);
- tnet_dhcp6_option_t* option = 0;
+ tnet_dhcp6_reply_t* reply = 0;
+ tnet_dhcp6_request_t* request = tnet_dhcp6_request_create(dhcp6_type_information_request);
+ tnet_dhcp6_option_t* option = 0;
- if(!ctx || !orequest || !request){
- goto bail;
- }
+ if(!ctx || !orequest || !request) {
+ goto bail;
+ }
- if((option = tnet_dhcp6_option_create(dhcp6_code_oro, orequest, sizeof(*orequest)))){
- tsk_list_push_back_data(request->options, (void**)&option);
- }
+ if((option = tnet_dhcp6_option_create(dhcp6_code_oro, orequest, sizeof(*orequest)))) {
+ tsk_list_push_back_data(request->options, (void**)&option);
+ }
- /* Vendor class */
- {
-
- }
+ /* Vendor class */
+ {
- reply = tnet_dhcp6_send_request(ctx, request);
+ }
+
+ reply = tnet_dhcp6_send_request(ctx, request);
bail:
- return reply;
+ return reply;
}
@@ -226,44 +225,43 @@ bail:
//
static tsk_object_t* tnet_dhcp6_ctx_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_ctx_t *ctx = self;
- if(ctx){
- ctx->pen = TNET_IANA_PEN;
- ctx->vendor_class_data = tsk_strdup(TNET_DHCP6_VENDOR_CLASS_DATA_DEFAULT);
-
- ctx->port_client = TNET_DHCP6_CLIENT_PORT;
- ctx->server_port = TNET_DHCP6_SERVER_PORT;
- ctx->interfaces = tnet_get_interfaces();
-
- ctx->timeout = 0xffff; /* FIXME */
-
- if(!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces)){
- TSK_DEBUG_ERROR("Failed to retrieve network interfaces.");
- }
-
- tsk_safeobj_init(ctx);
- }
- return self;
-}
+ tnet_dhcp6_ctx_t *ctx = self;
+ if(ctx) {
+ ctx->pen = TNET_IANA_PEN;
+ ctx->vendor_class_data = tsk_strdup(TNET_DHCP6_VENDOR_CLASS_DATA_DEFAULT);
+
+ ctx->port_client = TNET_DHCP6_CLIENT_PORT;
+ ctx->server_port = TNET_DHCP6_SERVER_PORT;
+ ctx->interfaces = tnet_get_interfaces();
-static tsk_object_t* tnet_dhcp6_ctx_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_ctx_t *ctx = self;
- if(ctx){
- tsk_safeobj_deinit(ctx);
-
- TSK_FREE(ctx->vendor_class_data);
-
- TSK_OBJECT_SAFE_FREE(ctx->interfaces);
- }
- return self;
+ ctx->timeout = 0xffff; /* FIXME */
+
+ if(!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces)) {
+ TSK_DEBUG_ERROR("Failed to retrieve network interfaces.");
+ }
+
+ tsk_safeobj_init(ctx);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_ctx_def_s =
+static tsk_object_t* tnet_dhcp6_ctx_dtor(tsk_object_t * self)
{
- sizeof(tnet_dhcp6_ctx_t),
- tnet_dhcp6_ctx_ctor,
- tnet_dhcp6_ctx_dtor,
- tsk_null,
+ tnet_dhcp6_ctx_t *ctx = self;
+ if(ctx) {
+ tsk_safeobj_deinit(ctx);
+
+ TSK_FREE(ctx->vendor_class_data);
+
+ TSK_OBJECT_SAFE_FREE(ctx->interfaces);
+ }
+ return self;
+}
+
+static const tsk_object_def_t tnet_dhcp6_ctx_def_s = {
+ sizeof(tnet_dhcp6_ctx_t),
+ tnet_dhcp6_ctx_ctor,
+ tnet_dhcp6_ctx_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_ctx_def_t = &tnet_dhcp6_ctx_def_s;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6.h b/tinyNET/src/dhcp6/tnet_dhcp6.h
index 156f5a9..fa556f8 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6.h
+++ b/tinyNET/src/dhcp6/tnet_dhcp6.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -61,7 +61,7 @@ TNET_BEGIN_DECLS
#define TNET_DHCP6_All_DHCP_Servers "FF05::1:3"
/*== RFC 3315 - 5.5. Transmission and Retransmission Parameters
- * This section presents a table of values used to describe the message
+ * This section presents a table of values used to describe the message
* transmission behavior of clients and servers.
*/
#define TNET_DHCP6_RT_SOL_MAX_DELAY 1 /**< 1 sec Max delay of first Solicit */
@@ -100,20 +100,19 @@ TNET_BEGIN_DECLS
/**@ingroup tnet_dhcpv_group
* DHCPv6 context.
*/
-typedef struct tnet_dhcp6_ctx_s
-{
- TSK_DECLARE_OBJECT;
-
- uint16_t pen; /**< Private Enterprise Number assigned by the IANA. Default= @ref TNET_IANA_PEN.*/
- char* vendor_class_data;
-
- uint64_t timeout;
-
- tnet_port_t port_client; /**< Local port to bind to for incloming DHCPv6 messages. Default: 546 */
- tnet_port_t server_port; /**< Destination port for outgoing DHCPv6 messages. Default: 547 */
- tnet_interfaces_L_t *interfaces;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tnet_dhcp6_ctx_s {
+ TSK_DECLARE_OBJECT;
+
+ uint16_t pen; /**< Private Enterprise Number assigned by the IANA. Default= @ref TNET_IANA_PEN.*/
+ char* vendor_class_data;
+
+ uint64_t timeout;
+
+ tnet_port_t port_client; /**< Local port to bind to for incloming DHCPv6 messages. Default: 546 */
+ tnet_port_t server_port; /**< Destination port for outgoing DHCPv6 messages. Default: 547 */
+ tnet_interfaces_L_t *interfaces;
+
+ TSK_DECLARE_SAFEOBJ;
}
tnet_dhcp6_ctx_t;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_duid.c b/tinyNET/src/dhcp6/tnet_dhcp6_duid.c
index 38f2a52..3bec2f4 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_duid.c
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_duid.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,101 +38,97 @@ int tnet_dhcp6_duid_ll_serialize(const tnet_dhcp6_duid_ll_t* self, tsk_buffer_t
tnet_dhcp6_duid_llt_t* tnet_dhcp6_duid_llt_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_duid_llt_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_duid_llt_def_t, payload, payload_size);
}
tnet_dhcp6_duid_en_t* tnet_dhcp6_duid_en_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_duid_en_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_duid_en_def_t, payload, payload_size);
}
tnet_dhcp6_duid_ll_t* tnet_dhcp6_duid_ll_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_duid_ll_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_duid_ll_def_t, payload, payload_size);
}
int tnet_dhcp6_duid_init(tnet_dhcp6_duid_t *self, tnet_dhcp6_duid_type_t type)
{
- if(self){
- if(!self->initialized){
- self->type = type;
- self->initialized = tsk_true;
- return 0;
- }
- return -2;
- }
- return -1;
+ if(self) {
+ if(!self->initialized) {
+ self->type = type;
+ self->initialized = tsk_true;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
int tnet_dhcp6_duid_deinit(tnet_dhcp6_duid_t *self)
{
- if(self){
- if(self->initialized){
- self->initialized = tsk_true;
- return 0;
- }
- return -2;
- }
- return -1;
+ if(self) {
+ if(self->initialized) {
+ self->initialized = tsk_true;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
tnet_dhcp6_duid_t* tnet_dhcp6_duid_deserialize(const void* data, tsk_size_t size)
{
- tnet_dhcp6_duid_t *duid = 0;
- uint8_t* dataPtr = ((uint8_t*)data);
- //uint8_t* dataEnd = (dataPtr+size);
+ tnet_dhcp6_duid_t *duid = 0;
+ uint8_t* dataPtr = ((uint8_t*)data);
+ //uint8_t* dataEnd = (dataPtr+size);
- tnet_dhcp6_duid_type_t type;
- //uint8_t len = 0;
+ tnet_dhcp6_duid_type_t type;
+ //uint8_t len = 0;
- /* Check validity */
- if(!dataPtr || size<2/*Type*/){
- goto bail;
- }
+ /* Check validity */
+ if(!dataPtr || size<2/*Type*/) {
+ goto bail;
+ }
- type = (tnet_dhcp6_duid_type_t) tnet_ntohs_2(dataPtr);
- dataPtr += 2;
+ type = (tnet_dhcp6_duid_type_t) tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
bail:
- return duid;
+ return duid;
}
int tnet_dhcp6_duid_serialize(const tnet_dhcp6_duid_t* self, tsk_buffer_t *output)
{
- int ret = -1;
-
- if(!self || !output){
- return ret;
- }
-
- switch(self->type){
- case dhcp6_duid_linklayer_plus_time:
- {
- ret = tnet_dhcp6_duid_llt_serialize(TNET_DHCP6_DUID_LLT(self), output);
- break;
- }
-
- case dhcp6_duid_Vendor_assigned_id:
- {
- ret = tnet_dhcp6_duid_en_serialize(TNET_DHCP6_DUID_EN(self), output);
- break;
- }
-
- case dhcp6_duid_linklayer:
- {
- ret = tnet_dhcp6_duid_ll_serialize(TNET_DHCP6_DUID_LL(self), output);
- break;
- }
-
- default:
- {
- ret = -2;
- goto bail;
- }
- }
+ int ret = -1;
+
+ if(!self || !output) {
+ return ret;
+ }
+
+ switch(self->type) {
+ case dhcp6_duid_linklayer_plus_time: {
+ ret = tnet_dhcp6_duid_llt_serialize(TNET_DHCP6_DUID_LLT(self), output);
+ break;
+ }
+
+ case dhcp6_duid_Vendor_assigned_id: {
+ ret = tnet_dhcp6_duid_en_serialize(TNET_DHCP6_DUID_EN(self), output);
+ break;
+ }
+
+ case dhcp6_duid_linklayer: {
+ ret = tnet_dhcp6_duid_ll_serialize(TNET_DHCP6_DUID_LL(self), output);
+ break;
+ }
+
+ default: {
+ ret = -2;
+ goto bail;
+ }
+ }
bail:
- return ret;
+ return ret;
}
/*=======================================================================================
@@ -141,7 +137,7 @@ bail:
int tnet_dhcp6_duid_llt_serialize(const tnet_dhcp6_duid_llt_t* self, tsk_buffer_t *output)
{
- return -1;
+ return -1;
}
//
@@ -149,39 +145,38 @@ int tnet_dhcp6_duid_llt_serialize(const tnet_dhcp6_duid_llt_t* self, tsk_buffer_
//
static tsk_object_t* tnet_dhcp6_duid_llt_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_duid_llt_t *duid = self;
- if(duid){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- /* init base */
- tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_linklayer_plus_time);
-
- if(payload && payload_size){
- /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_duid_llt_t *duid = self;
+ if(duid) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ /* init base */
+ tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_linklayer_plus_time);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_duid_llt_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_duid_llt_t *duid = self;
- if(duid){
- /* deinit base */
- tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
-
- TSK_OBJECT_SAFE_FREE(duid->address);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_duid_llt_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_duid_llt_t *duid = self;
+ if(duid) {
+ /* deinit base */
+ tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
+
+ TSK_OBJECT_SAFE_FREE(duid->address);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_duid_llt_def_s =
-{
- sizeof(tnet_dhcp6_duid_llt_t),
- tnet_dhcp6_duid_llt_ctor,
- tnet_dhcp6_duid_llt_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_duid_llt_def_s = {
+ sizeof(tnet_dhcp6_duid_llt_t),
+ tnet_dhcp6_duid_llt_ctor,
+ tnet_dhcp6_duid_llt_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_duid_llt_def_t = &tnet_dhcp6_duid_llt_def_s;
@@ -192,7 +187,7 @@ const tsk_object_def_t *tnet_dhcp6_duid_llt_def_t = &tnet_dhcp6_duid_llt_def_s;
int tnet_dhcp6_duid_en_serialize(const tnet_dhcp6_duid_en_t* self, tsk_buffer_t *output)
{
- return -1;
+ return -1;
}
//
@@ -200,39 +195,38 @@ int tnet_dhcp6_duid_en_serialize(const tnet_dhcp6_duid_en_t* self, tsk_buffer_t
//
static tsk_object_t* tnet_dhcp6_duid_en_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_duid_en_t *duid = self;
- if(duid){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- /* init base */
- tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_Vendor_assigned_id);
-
- if(payload && payload_size){
- /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_duid_en_t *duid = self;
+ if(duid) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ /* init base */
+ tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_Vendor_assigned_id);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_duid_en_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_duid_en_t *duid = self;
- if(duid){
- /* deinit base */
- tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
-
- TSK_OBJECT_SAFE_FREE(duid->indentifier);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_duid_en_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_duid_en_t *duid = self;
+ if(duid) {
+ /* deinit base */
+ tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
+
+ TSK_OBJECT_SAFE_FREE(duid->indentifier);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_duid_en_def_s =
-{
- sizeof(tnet_dhcp6_duid_en_t),
- tnet_dhcp6_duid_en_ctor,
- tnet_dhcp6_duid_en_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_duid_en_def_s = {
+ sizeof(tnet_dhcp6_duid_en_t),
+ tnet_dhcp6_duid_en_ctor,
+ tnet_dhcp6_duid_en_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_duid_en_def_t = &tnet_dhcp6_duid_en_def_s;
@@ -243,7 +237,7 @@ const tsk_object_def_t *tnet_dhcp6_duid_en_def_t = &tnet_dhcp6_duid_en_def_s;
int tnet_dhcp6_duid_ll_serialize(const tnet_dhcp6_duid_ll_t* self, tsk_buffer_t *output)
{
- return -1;
+ return -1;
}
//
@@ -251,38 +245,37 @@ int tnet_dhcp6_duid_ll_serialize(const tnet_dhcp6_duid_ll_t* self, tsk_buffer_t
//
static tsk_object_t* tnet_dhcp6_duid_ll_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_duid_ll_t *duid = self;
- if(duid){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- /* init base */
- tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_linklayer);
-
- if(payload && payload_size){
- /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_duid_ll_t *duid = self;
+ if(duid) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ /* init base */
+ tnet_dhcp6_duid_init(TNET_DHCP6_DUID(duid), dhcp6_duid_linklayer);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_duid_ll_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_duid_ll_t *duid = self;
- if(duid){
- /* deinit base */
- tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
-
- TSK_OBJECT_SAFE_FREE(duid->address);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_duid_ll_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_duid_ll_t *duid = self;
+ if(duid) {
+ /* deinit base */
+ tnet_dhcp6_duid_deinit(TNET_DHCP6_DUID(duid));
+
+ TSK_OBJECT_SAFE_FREE(duid->address);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_duid_ll_def_s =
-{
- sizeof(tnet_dhcp6_duid_ll_t),
- tnet_dhcp6_duid_ll_ctor,
- tnet_dhcp6_duid_ll_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_duid_ll_def_s = {
+ sizeof(tnet_dhcp6_duid_ll_t),
+ tnet_dhcp6_duid_ll_ctor,
+ tnet_dhcp6_duid_ll_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_duid_ll_def_t = &tnet_dhcp6_duid_ll_def_s;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_duid.h b/tinyNET/src/dhcp6/tnet_dhcp6_duid.h
index 34383fa..94c2b32 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_duid.h
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_duid.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,23 +44,21 @@ TNET_BEGIN_DECLS
/** List of DHCPv6 DUIDs types as per RFC 3315 subclause 9.1.
*/
-typedef enum tnet_dhcp6_duid_type_e
-{
- dhcp6_duid_linklayer_plus_time = 1, /**< Link-layer address plus time. */
- dhcp6_duid_Vendor_assigned_id = 2, /**< Vendor-assigned unique ID based on Enterprise Number. */
- dhcp6_duid_linklayer = 3, /**< Link-layer address. */
+typedef enum tnet_dhcp6_duid_type_e {
+ dhcp6_duid_linklayer_plus_time = 1, /**< Link-layer address plus time. */
+ dhcp6_duid_Vendor_assigned_id = 2, /**< Vendor-assigned unique ID based on Enterprise Number. */
+ dhcp6_duid_linklayer = 3, /**< Link-layer address. */
}
tnet_dhcp6_duid_type_t;
/** DHCP Unique Identifier (DUID) base class (subclause 9).
*/
-typedef struct tnet_dhcp6_duid_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t initialized;
+typedef struct tnet_dhcp6_duid_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t initialized;
- tnet_dhcp6_duid_type_t type; /* DUID type. 2-bytes value. */
+ tnet_dhcp6_duid_type_t type; /* DUID type. 2-bytes value. */
}
tnet_dhcp6_duid_t;
@@ -80,29 +78,28 @@ int tnet_dhcp6_duid_serialize(const tnet_dhcp6_duid_t* self, tsk_buffer_t *outpu
/** DUID Based on Link-layer Address Plus Time [DUID-LLT]
*/
-typedef struct tnet_dhcp6_duid_llt_s
-{
- TNET_DECLARE_DHCP6_DUID;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | 1 | hardware type (16 bits) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | time (32 bits) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- . .
- . link-layer address (variable length) .
- . .
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /* The hardware type code as maintained by IANA. */
- tnet_hardware_type_t htype;
- /* The time value is the time that the DUID is generated represented in seconds
- since midnight (UTC), January 1, 2000, modulo 2^32. */
- uint32_t time;
- /* The link-layer address. */
- tsk_buffer_t *address;
+typedef struct tnet_dhcp6_duid_llt_s {
+ TNET_DECLARE_DHCP6_DUID;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | 1 | hardware type (16 bits) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | time (32 bits) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ . .
+ . link-layer address (variable length) .
+ . .
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ /* The hardware type code as maintained by IANA. */
+ tnet_hardware_type_t htype;
+ /* The time value is the time that the DUID is generated represented in seconds
+ since midnight (UTC), January 1, 2000, modulo 2^32. */
+ uint32_t time;
+ /* The link-layer address. */
+ tsk_buffer_t *address;
}
tnet_dhcp6_duid_llt_t;
@@ -113,27 +110,26 @@ tnet_dhcp6_duid_llt_t;
/** DUID Assigned by Vendor Based on Enterprise Number [DUID-EN]
*/
-typedef struct tnet_dhcp6_duid_en_s
-{
- TNET_DECLARE_DHCP6_DUID;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | 2 | enterprise-number |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | enterprise-number (contd) | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
- . identifier .
- . (variable length) .
- . .
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /* Tthe vendor's registered Private Enterprise Number as maintained by IANA.
- For more information: http://www.iana.org/assignments/enterprise-numbers. */
- uint32_t en;
- /* The link-layer address. */
- tsk_buffer_t *indentifier;
+typedef struct tnet_dhcp6_duid_en_s {
+ TNET_DECLARE_DHCP6_DUID;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | 2 | enterprise-number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | enterprise-number (contd) | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
+ . identifier .
+ . (variable length) .
+ . .
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ /* Tthe vendor's registered Private Enterprise Number as maintained by IANA.
+ For more information: http://www.iana.org/assignments/enterprise-numbers. */
+ uint32_t en;
+ /* The link-layer address. */
+ tsk_buffer_t *indentifier;
}
tnet_dhcp6_duid_en_t;
@@ -143,11 +139,10 @@ tnet_dhcp6_duid_en_t;
/** DUID Based on Link-layer Address [DUID-LL]
*/
-typedef struct tnet_dhcp6_duid_ll_s
-{
- TNET_DECLARE_DHCP6_DUID;
- /*
- 0 1 2 3
+typedef struct tnet_dhcp6_duid_ll_s {
+ TNET_DECLARE_DHCP6_DUID;
+ /*
+ 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 3 | hardware type (16 bits) |
@@ -156,11 +151,11 @@ typedef struct tnet_dhcp6_duid_ll_s
. link-layer address (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /* The hardware type code as maintained by IANA. */
- tnet_hardware_type_t htype;
- /* The link-layer address. */
- tsk_buffer_t *address;
+ */
+ /* The hardware type code as maintained by IANA. */
+ tnet_hardware_type_t htype;
+ /* The link-layer address. */
+ tsk_buffer_t *address;
}
tnet_dhcp6_duid_ll_t;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_message.c b/tinyNET/src/dhcp6/tnet_dhcp6_message.c
index 4691714..9979335 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_message.c
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_message.c
@@ -32,65 +32,64 @@
tnet_dhcp6_message_t* tnet_dhcp6_message_create(tnet_dhcp6_message_type_t type)
{
- return tsk_object_new(tnet_dhcp6_message_def_t, type);
+ return tsk_object_new(tnet_dhcp6_message_def_t, type);
}
tnet_dhcp6_request_t* tnet_dhcp6_request_create(tnet_dhcp6_message_type_t type)
{
- return tnet_dhcp6_message_create(type);
+ return tnet_dhcp6_message_create(type);
}
tsk_buffer_t* tnet_dhcp6_message_serialize(const tnet_dhcp6_ctx_t *ctx, const tnet_dhcp6_message_t *self)
{
- tsk_buffer_t* output = 0;
- //uint8_t _1byte;
- uint16_t _2bytes;
- uint32_t _4bytes;
-
- /* Check message validity */
- if (!self){
- goto bail;
- }
-
- output = tsk_buffer_create_null();
-
- /*== msg-type + transaction-id */
- _4bytes = (((uint32_t)(self->type)) << 24) | (self->transaction_id & 0xFFFFFF);
- _4bytes = tnet_ntohl(_4bytes);
- tsk_buffer_append(output, &(_4bytes), 4);
-
- /*== Vendor class
- */
- {
- _2bytes = tnet_htons(dhcp6_code_vendor_class);
- tsk_buffer_append(output, &(_2bytes), 2);
- _2bytes = tnet_htons((unsigned short)(4 + tsk_strlen(ctx->vendor_class_data)));
- tsk_buffer_append(output, &(_2bytes), 2);
- _4bytes = tnet_ntohl(ctx->pen);
- tsk_buffer_append(output, &(_4bytes), 4);
- tsk_buffer_append(output, ctx->vendor_class_data, tsk_strlen(ctx->vendor_class_data));
- }
-
- /*== DHCP Options
- */
- {
- tsk_list_item_t *item;
- tnet_dhcp6_option_t* option;
- tsk_list_foreach(item, self->options)
- {
- option = (tnet_dhcp6_option_t*)item->data;
- if (tnet_dhcp6_option_serialize(option, output)){
- TSK_DEBUG_WARN("Failed to serialize DHCPv6 OPTION (%u)", option->code);
- }
- }
- }
+ tsk_buffer_t* output = 0;
+ //uint8_t _1byte;
+ uint16_t _2bytes;
+ uint32_t _4bytes;
+
+ /* Check message validity */
+ if (!self) {
+ goto bail;
+ }
+
+ output = tsk_buffer_create_null();
+
+ /*== msg-type + transaction-id */
+ _4bytes = (((uint32_t)(self->type)) << 24) | (self->transaction_id & 0xFFFFFF);
+ _4bytes = tnet_ntohl(_4bytes);
+ tsk_buffer_append(output, &(_4bytes), 4);
+
+ /*== Vendor class
+ */
+ {
+ _2bytes = tnet_htons(dhcp6_code_vendor_class);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ _2bytes = tnet_htons((unsigned short)(4 + tsk_strlen(ctx->vendor_class_data)));
+ tsk_buffer_append(output, &(_2bytes), 2);
+ _4bytes = tnet_ntohl(ctx->pen);
+ tsk_buffer_append(output, &(_4bytes), 4);
+ tsk_buffer_append(output, ctx->vendor_class_data, tsk_strlen(ctx->vendor_class_data));
+ }
+
+ /*== DHCP Options
+ */
+ {
+ tsk_list_item_t *item;
+ tnet_dhcp6_option_t* option;
+ tsk_list_foreach(item, self->options) {
+ option = (tnet_dhcp6_option_t*)item->data;
+ if (tnet_dhcp6_option_serialize(option, output)) {
+ TSK_DEBUG_WARN("Failed to serialize DHCPv6 OPTION (%u)", option->code);
+ }
+ }
+ }
bail:
- return output;
+ return output;
}
tnet_dhcp6_message_t* tnet_dhcp6_message_deserialize(const tnet_dhcp6_ctx_t *ctx, const uint8_t *data, tsk_size_t size)
{
- return 0;
+ return 0;
}
@@ -100,32 +99,31 @@ tnet_dhcp6_message_t* tnet_dhcp6_message_deserialize(const tnet_dhcp6_ctx_t *ctx
//
static tsk_object_t* tnet_dhcp6_message_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_message_t *message = self;
- if (message){
- static uint16_t __dhcp6message_unique_tid = 0;//(uint32_t)tsk_time_epoch();
-
- message->type = va_arg(*app, tnet_dhcp6_message_type_t);
- message->transaction_id = ++__dhcp6message_unique_tid;
- message->options = tsk_list_create();
- }
- return self;
+ tnet_dhcp6_message_t *message = self;
+ if (message) {
+ static uint16_t __dhcp6message_unique_tid = 0;//(uint32_t)tsk_time_epoch();
+
+ message->type = va_arg(*app, tnet_dhcp6_message_type_t);
+ message->transaction_id = ++__dhcp6message_unique_tid;
+ message->options = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* tnet_dhcp6_message_dtor(tsk_object_t * self)
{
- tnet_dhcp6_message_t *message = self;
- if (message){
- TSK_OBJECT_SAFE_FREE(message->options);
- }
- return self;
+ tnet_dhcp6_message_t *message = self;
+ if (message) {
+ TSK_OBJECT_SAFE_FREE(message->options);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_message_def_s =
-{
- sizeof(tnet_dhcp6_message_t),
- tnet_dhcp6_message_ctor,
- tnet_dhcp6_message_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_message_def_s = {
+ sizeof(tnet_dhcp6_message_t),
+ tnet_dhcp6_message_ctor,
+ tnet_dhcp6_message_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_message_def_t = &tnet_dhcp6_message_def_s;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_message.h b/tinyNET/src/dhcp6/tnet_dhcp6_message.h
index dc5d9d2..3dfd6c6 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_message.h
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,86 +42,84 @@ struct tnet_dhcp6_ctx_s;
/** List of all supported DHCPv6 messages.
* For more info: RFC 3315 - 5.3. DHCP Message Types
*/
-typedef enum tnet_dhcp6_message_type_e
-{
- /* A client sends a Solicit message to locate servers. */
- dhcp6_type_solicit = 1,
- /* A server sends an Advertise message to indicate that it is available for DHCP service, in
- response to a Solicit message received from a client. */
- dhcp6_type_advertise = 2,
- /* A client sends a Request message to request configuration parameters, including IP
- addresses, from a specific server. */
- dhcp6_type_request = 3,
- /* A client sends a Confirm message to any available server to determine whether the
- addresses it was assigned are still appropriate to the link to which the client is connected. */
- dhcp6_type_confirm = 4,
- /* A client sends a Renew message to the server that originally provided the client's addresses
- and configuration parameters to extend the lifetimes on the addresses assigned to the
- client and to update other configurationparameters. */
- dhcp6_type_renew = 5,
- /* A client sends a Rebind message to any available server to extend the lifetimes on the
- addresses assigned to the client and to update other configuration parameters; this message is
- sent after a client receives no response to a Renew message.*/
- dhcp6_type_rebind = 6,
- /* A server sends a Reply message containing assigned addresses and configuration parameters
- in response to a Solicit, Request, Renew, Rebind message received from a client. A
- server sends a Reply message containing configuration parameters in response to an
- Information-request message. A server sends a Reply message in response to a Confirm message
- confirming or denying that the addresses assigned to the client are appropriate to the
- link to which the client is connected. A server sends a Reply message to acknowledge
- receipt of a Release or Decline message.*/
- dhcp6_type_reply = 7,
- /* A client sends a Release message to the server that assigned addresses to the client to
- indicate that the client will no longer use one or more of the assigned addresses.*/
- dhcp6_type_release = 8,
- /* A client sends a Decline message to a server to indicate that the client has determined that
- one or more addresses assigned by the server are already in use on the link to which the
- client is connected.*/
- dhcp6_type_decline = 9,
- /*A server sends a Reconfigure message to a client to inform the client that the server has
- new or updated configuration parameters, and that the client is to initiate a Renew/Reply
- or Information-request/Reply transaction with the server in order to receive the updatedinformation. */
- dhcp6_type_reconfigure = 10,
- /* A client sends an Information-request message to a server to request configuration
- parameters without the assignment of any IP addresses to the client.*/
- dhcp6_type_information_request = 11,
- /* A relay agent sends a Relay-forward message to relay messages to servers, either directly
- or through another relay agent. The received message, either a client message or a
- Relay-forward message from another relay agent, is encapsulated in an option in the Relay-forward message.*/
- dhcp6_type_relay_forw = 12,
- /* A server sends a Relay-reply message to a relay agent containing a message that the relay
- agent delivers to a client. The Relay-reply message may be relayed by other relay agents
- for delivery to the destination relay agent.
- The server encapsulates the client message as an option in the Relay-reply message, which the
- relay agent extracts and relays to the client.*/
- dhcp6_type_relay_repl = 13,
+typedef enum tnet_dhcp6_message_type_e {
+ /* A client sends a Solicit message to locate servers. */
+ dhcp6_type_solicit = 1,
+ /* A server sends an Advertise message to indicate that it is available for DHCP service, in
+ response to a Solicit message received from a client. */
+ dhcp6_type_advertise = 2,
+ /* A client sends a Request message to request configuration parameters, including IP
+ addresses, from a specific server. */
+ dhcp6_type_request = 3,
+ /* A client sends a Confirm message to any available server to determine whether the
+ addresses it was assigned are still appropriate to the link to which the client is connected. */
+ dhcp6_type_confirm = 4,
+ /* A client sends a Renew message to the server that originally provided the client's addresses
+ and configuration parameters to extend the lifetimes on the addresses assigned to the
+ client and to update other configurationparameters. */
+ dhcp6_type_renew = 5,
+ /* A client sends a Rebind message to any available server to extend the lifetimes on the
+ addresses assigned to the client and to update other configuration parameters; this message is
+ sent after a client receives no response to a Renew message.*/
+ dhcp6_type_rebind = 6,
+ /* A server sends a Reply message containing assigned addresses and configuration parameters
+ in response to a Solicit, Request, Renew, Rebind message received from a client. A
+ server sends a Reply message containing configuration parameters in response to an
+ Information-request message. A server sends a Reply message in response to a Confirm message
+ confirming or denying that the addresses assigned to the client are appropriate to the
+ link to which the client is connected. A server sends a Reply message to acknowledge
+ receipt of a Release or Decline message.*/
+ dhcp6_type_reply = 7,
+ /* A client sends a Release message to the server that assigned addresses to the client to
+ indicate that the client will no longer use one or more of the assigned addresses.*/
+ dhcp6_type_release = 8,
+ /* A client sends a Decline message to a server to indicate that the client has determined that
+ one or more addresses assigned by the server are already in use on the link to which the
+ client is connected.*/
+ dhcp6_type_decline = 9,
+ /*A server sends a Reconfigure message to a client to inform the client that the server has
+ new or updated configuration parameters, and that the client is to initiate a Renew/Reply
+ or Information-request/Reply transaction with the server in order to receive the updatedinformation. */
+ dhcp6_type_reconfigure = 10,
+ /* A client sends an Information-request message to a server to request configuration
+ parameters without the assignment of any IP addresses to the client.*/
+ dhcp6_type_information_request = 11,
+ /* A relay agent sends a Relay-forward message to relay messages to servers, either directly
+ or through another relay agent. The received message, either a client message or a
+ Relay-forward message from another relay agent, is encapsulated in an option in the Relay-forward message.*/
+ dhcp6_type_relay_forw = 12,
+ /* A server sends a Relay-reply message to a relay agent containing a message that the relay
+ agent delivers to a client. The Relay-reply message may be relayed by other relay agents
+ for delivery to the destination relay agent.
+ The server encapsulates the client message as an option in the Relay-reply message, which the
+ relay agent extracts and relays to the client.*/
+ dhcp6_type_relay_repl = 13,
}
tnet_dhcp6_message_type_t;
/** DHCPv6 message (common fields) as per RFC 3315 subclause 6.
*/
-typedef struct tnet_dhcp6_message_s
-{
- TSK_DECLARE_OBJECT;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | msg-type | transaction-id |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- . options .
- . (variable) .
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /* Identifies the DHCP message type. 1-byte value. */
- tnet_dhcp6_message_type_t type;
- /* The transaction ID for this message exchange. 3-bytes value. */
- uint32_t transaction_id;
- /* Options carried in this message. */
- tnet_dhcp6_options_L_t *options;
+typedef struct tnet_dhcp6_message_s {
+ TSK_DECLARE_OBJECT;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | msg-type | transaction-id |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . options .
+ . (variable) .
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ /* Identifies the DHCP message type. 1-byte value. */
+ tnet_dhcp6_message_type_t type;
+ /* The transaction ID for this message exchange. 3-bytes value. */
+ uint32_t transaction_id;
+ /* Options carried in this message. */
+ tnet_dhcp6_options_L_t *options;
}
tnet_dhcp6_message_t;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_option.c b/tinyNET/src/dhcp6/tnet_dhcp6_option.c
index 91ec16a..58107c6 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_option.c
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_option.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,125 +37,120 @@
tnet_dhcp6_option_t* tnet_dhcp6_option_create(tnet_dhcp6_option_code_t code, const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_option_def_t, code, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_option_def_t, code, payload, payload_size);
}
tnet_dhcp6_option_identifier_t* tnet_dhcp6_option_indentifer_create(tnet_dhcp6_option_code_t code, const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_option_identifier_def_t, code, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_option_identifier_def_t, code, payload, payload_size);
}
tnet_dhcp6_option_identifier_t* tnet_dhcp6_option_clientid_create(const void* payload, tsk_size_t payload_size)
{
- return tnet_dhcp6_option_indentifer_create(dhcp6_code_clientid, payload, payload_size);
+ return tnet_dhcp6_option_indentifer_create(dhcp6_code_clientid, payload, payload_size);
}
tnet_dhcp6_option_identifier_t* tnet_dhcp6_option_serverid_create(const void* payload, tsk_size_t payload_size)
{
- return tnet_dhcp6_option_indentifer_create(dhcp6_code_serverid, payload, payload_size);
+ return tnet_dhcp6_option_indentifer_create(dhcp6_code_serverid, payload, payload_size);
}
tnet_dhcp6_option_orequest_t* tnet_dhcp6_option_orequest_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_option_orequest_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_option_orequest_def_t, payload, payload_size);
}
tnet_dhcp6_option_orequest_t* tnet_dhcp6_option_orequest_create_null()
{
- return tnet_dhcp6_option_orequest_create(tsk_null, 0);
+ return tnet_dhcp6_option_orequest_create(tsk_null, 0);
}
tnet_dhcp6_option_vendorclass_t* tnet_dhcp6_option_vendorclass_create(const void* payload, tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dhcp6_option_vendorclass_def_t, payload, payload_size);
+ return tsk_object_new(tnet_dhcp6_option_vendorclass_def_t, payload, payload_size);
}
tnet_dhcp6_option_vendorclass_t* tnet_dhcp6_option_vendorclass_create_null()
{
- return tnet_dhcp6_option_vendorclass_create(tsk_null, 0);
+ return tnet_dhcp6_option_vendorclass_create(tsk_null, 0);
}
tnet_dhcp6_option_t* tnet_dhcp6_option_deserialize(const void* data, tsk_size_t size)
{
- tnet_dhcp6_option_t *option = 0;
- uint8_t* dataPtr = ((uint8_t*)data);
- //uint8_t* dataEnd = (dataPtr+size);
-
- tnet_dhcp6_option_code_t code;
- uint16_t len;
-
- /* Check validity */
- if(!dataPtr || size<4/*Code Len*/){
- goto bail;
- }
-
- code = (tnet_dhcp6_option_code_t) tnet_ntohs_2(dataPtr);
- dataPtr += 2;
-
- len = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
-
- switch(code){
- case dhcp6_code_clientid:
- case dhcp6_code_serverid:
- {
- break;
- }
-
- default:
- {
- break;
- }
- }
+ tnet_dhcp6_option_t *option = 0;
+ uint8_t* dataPtr = ((uint8_t*)data);
+ //uint8_t* dataEnd = (dataPtr+size);
+
+ tnet_dhcp6_option_code_t code;
+ uint16_t len;
+
+ /* Check validity */
+ if(!dataPtr || size<4/*Code Len*/) {
+ goto bail;
+ }
+
+ code = (tnet_dhcp6_option_code_t) tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+
+ len = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+
+ switch(code) {
+ case dhcp6_code_clientid:
+ case dhcp6_code_serverid: {
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
bail:
- return option;
+ return option;
}
int tnet_dhcp6_option_serialize(const tnet_dhcp6_option_t* self, tsk_buffer_t *output)
{
- uint16_t _2bytes;
- int ret = -1;
-
- if(!self || !output){
- goto bail;
- }
-
- /*== Code */
- _2bytes = tnet_htons(self->code);
- tsk_buffer_append(output, &(_2bytes), 2);
-
- switch(self->code){
- case dhcp6_code_clientid:
- case dhcp6_code_serverid:
- {
- break;
- }
-
- case dhcp6_code_oro:
- default:
- {
- if(self->data)
- {
- const tnet_dhcp6_option_orequest_t* opt = (const tnet_dhcp6_option_orequest_t*)self->data;
- if(opt->codes){
- /* option-len */
- _2bytes = tnet_htons((unsigned short)opt->codes->size);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* option-data */
- ret = tsk_buffer_append(output, opt->codes->data, opt->codes->size);
- }
-
- }
- break;
- }
- }
+ uint16_t _2bytes;
+ int ret = -1;
+
+ if(!self || !output) {
+ goto bail;
+ }
+
+ /*== Code */
+ _2bytes = tnet_htons(self->code);
+ tsk_buffer_append(output, &(_2bytes), 2);
+
+ switch(self->code) {
+ case dhcp6_code_clientid:
+ case dhcp6_code_serverid: {
+ break;
+ }
+
+ case dhcp6_code_oro:
+ default: {
+ if(self->data) {
+ const tnet_dhcp6_option_orequest_t* opt = (const tnet_dhcp6_option_orequest_t*)self->data;
+ if(opt->codes) {
+ /* option-len */
+ _2bytes = tnet_htons((unsigned short)opt->codes->size);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* option-data */
+ ret = tsk_buffer_append(output, opt->codes->data, opt->codes->size);
+ }
+
+ }
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tnet_dhcp6_option_serializeex(tnet_dhcp6_option_code_t code, uint8_t length, const void* value, tsk_buffer_t *output)
{
- return -1;
+ return -1;
}
//
@@ -163,43 +158,42 @@ int tnet_dhcp6_option_serializeex(tnet_dhcp6_option_code_t code, uint8_t length,
//
static tsk_object_t* tnet_dhcp6_option_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_option_t *option = self;
- if(option){
- tnet_dhcp6_option_code_t code = va_arg(*app, tnet_dhcp6_option_code_t);
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- option->code = code;
- if(payload && payload_size){
- if((option->data = (tnet_dhcp6_option_data_t*)tsk_calloc(payload_size, sizeof(uint8_t)))){
- memcpy(option->data, payload, payload_size);
- option->len = (uint16_t)payload_size;
- }
- }
- }
- return self;
+ tnet_dhcp6_option_t *option = self;
+ if(option) {
+ tnet_dhcp6_option_code_t code = va_arg(*app, tnet_dhcp6_option_code_t);
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ option->code = code;
+ if(payload && payload_size) {
+ if((option->data = (tnet_dhcp6_option_data_t*)tsk_calloc(payload_size, sizeof(uint8_t)))) {
+ memcpy(option->data, payload, payload_size);
+ option->len = (uint16_t)payload_size;
+ }
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_option_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_option_t *option = self;
- if(option){
- TSK_OBJECT_SAFE_FREE(option->data);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_option_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_option_t *option = self;
+ if(option) {
+ TSK_OBJECT_SAFE_FREE(option->data);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_option_def_s =
-{
- sizeof(tnet_dhcp6_option_t),
- tnet_dhcp6_option_ctor,
- tnet_dhcp6_option_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_option_def_s = {
+ sizeof(tnet_dhcp6_option_t),
+ tnet_dhcp6_option_ctor,
+ tnet_dhcp6_option_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_option_def_t = &tnet_dhcp6_option_def_s;
/*======================================================================================
-* RFC 3315 -
+* RFC 3315 -
22.2. Client Identifier Option
22.3. Server Identifier Option
*=======================================================================================*/
@@ -208,34 +202,33 @@ const tsk_object_def_t *tnet_dhcp6_option_def_t = &tnet_dhcp6_option_def_s;
//
static tsk_object_t* tnet_dhcp6_option_identifier_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_option_identifier_t *option = self;
- if(option){
- //tnet_dhcp6_option_code_t code = va_arg(*app, tnet_dhcp6_option_code_t);
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- if(payload && payload_size){
- /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_option_identifier_t *option = self;
+ if(option) {
+ //tnet_dhcp6_option_code_t code = va_arg(*app, tnet_dhcp6_option_code_t);
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_option_identifier_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_option_identifier_t *option = self;
- if(option){
- TSK_OBJECT_SAFE_FREE(option->duid);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_option_identifier_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_option_identifier_t *option = self;
+ if(option) {
+ TSK_OBJECT_SAFE_FREE(option->duid);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_option_identifier_def_s =
-{
- sizeof(tnet_dhcp6_option_identifier_t),
- tnet_dhcp6_option_identifier_ctor,
- tnet_dhcp6_option_identifier_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_option_identifier_def_s = {
+ sizeof(tnet_dhcp6_option_identifier_t),
+ tnet_dhcp6_option_identifier_ctor,
+ tnet_dhcp6_option_identifier_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_option_identifier_def_t = &tnet_dhcp6_option_identifier_def_s;
@@ -245,20 +238,20 @@ const tsk_object_def_t *tnet_dhcp6_option_identifier_def_t = &tnet_dhcp6_option_
int tnet_dhcp6_option_orequest_add_code(tnet_dhcp6_option_orequest_t* self, uint16_t code)
{
- uint16_t _2bytes;
- int ret = -1;
- if(self){
- if(!self->codes){
- if(!(self->codes = tsk_buffer_create_null())){
- return -3;
- }
- }
- _2bytes = tnet_ntohs(code);
- if(!(ret = tsk_buffer_append(self->codes, &_2bytes, 2))){
- TNET_DHCP6_OPTION(self)->len += 2;
- }
- }
- return ret;
+ uint16_t _2bytes;
+ int ret = -1;
+ if(self) {
+ if(!self->codes) {
+ if(!(self->codes = tsk_buffer_create_null())) {
+ return -3;
+ }
+ }
+ _2bytes = tnet_ntohs(code);
+ if(!(ret = tsk_buffer_append(self->codes, &_2bytes, 2))) {
+ TNET_DHCP6_OPTION(self)->len += 2;
+ }
+ }
+ return ret;
}
//
@@ -266,33 +259,32 @@ int tnet_dhcp6_option_orequest_add_code(tnet_dhcp6_option_orequest_t* self, uint
//
static tsk_object_t* tnet_dhcp6_option_orequest_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_option_orequest_t *option = self;
- if(option){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- if(payload && payload_size)
- { /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_option_orequest_t *option = self;
+ if(option) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_option_orequest_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_option_orequest_t *option = self;
- if(option){
- TSK_OBJECT_SAFE_FREE(option->codes);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_option_orequest_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_option_orequest_t *option = self;
+ if(option) {
+ TSK_OBJECT_SAFE_FREE(option->codes);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_option_orequest_def_s =
-{
- sizeof(tnet_dhcp6_option_orequest_t),
- tnet_dhcp6_option_orequest_ctor,
- tnet_dhcp6_option_orequest_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_option_orequest_def_s = {
+ sizeof(tnet_dhcp6_option_orequest_t),
+ tnet_dhcp6_option_orequest_ctor,
+ tnet_dhcp6_option_orequest_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_option_orequest_def_t = &tnet_dhcp6_option_orequest_def_s;
@@ -305,32 +297,31 @@ const tsk_object_def_t *tnet_dhcp6_option_orequest_def_t = &tnet_dhcp6_option_or
//
static tsk_object_t* tnet_dhcp6_option_vendorclass_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dhcp6_option_vendorclass_t *option = self;
- if(option){
- const void* payload = va_arg(*app, const void*);
- tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-
- if(payload && payload_size){
- /* DESERIALIZATION */
- }
- }
- return self;
+ tnet_dhcp6_option_vendorclass_t *option = self;
+ if(option) {
+ const void* payload = va_arg(*app, const void*);
+ tsk_size_t payload_size = va_arg(*app, tsk_size_t);
+
+ if(payload && payload_size) {
+ /* DESERIALIZATION */
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dhcp6_option_vendorclass_dtor(tsk_object_t * self)
-{
- tnet_dhcp6_option_vendorclass_t *option = self;
- if(option){
- TSK_OBJECT_SAFE_FREE(option->vendor_class_data);
- }
- return self;
+static tsk_object_t* tnet_dhcp6_option_vendorclass_dtor(tsk_object_t * self)
+{
+ tnet_dhcp6_option_vendorclass_t *option = self;
+ if(option) {
+ TSK_OBJECT_SAFE_FREE(option->vendor_class_data);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dhcp6_option_vendorclass_def_s =
-{
- sizeof(tnet_dhcp6_option_vendorclass_t),
- tnet_dhcp6_option_vendorclass_ctor,
- tnet_dhcp6_option_vendorclass_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dhcp6_option_vendorclass_def_s = {
+ sizeof(tnet_dhcp6_option_vendorclass_t),
+ tnet_dhcp6_option_vendorclass_ctor,
+ tnet_dhcp6_option_vendorclass_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dhcp6_option_vendorclass_def_t = &tnet_dhcp6_option_vendorclass_def_s;
diff --git a/tinyNET/src/dhcp6/tnet_dhcp6_option.h b/tinyNET/src/dhcp6/tnet_dhcp6_option.h
index 71241b9..56ec83e 100755
--- a/tinyNET/src/dhcp6/tnet_dhcp6_option.h
+++ b/tinyNET/src/dhcp6/tnet_dhcp6_option.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,47 +42,45 @@ TNET_BEGIN_DECLS
#define TNET_DHCP6_OPTION(self) ((tnet_dhcp6_option_t*)(self))
/** List of DHCPv6 option as registered by IANA (RFC 3315 subcaluse 24.3)*/
-typedef enum tnet_dhcp6_option_code_e
-{
- dhcp6_code_clientid = 1, /**< Client Identifier Option. */
- dhcp6_code_serverid = 2, /**< Server Identifier Option. */
- dhcp6_code_ia_na = 3, /**< Identity Association for Non-temporary Addresses Option. */
- dhcp6_code_ia_ta = 4, /**< Identity Association for Temporary Addresses Option. */
- dhcp6_code_iaaddr = 5, /**< IA Address Option. */
- dhcp6_code_oro = 6, /**< Option Request Option. */
- dhcp6_code_preference = 7, /**< Preference Option. */
- dhcp6_code_elapsed_time = 8, /**< Elapsed Time Option. */
- dhcp6_code_relay_msg = 9, /**< Relay Message Option. */
- dhcp6_code_auth = 11, /**< Authentication Option. */
- dhcp6_code_unicast = 12, /**< Server Unicast Option. */
- dhcp6_code_status_code = 13, /**< Status Code Option. */
- dhcp6_code_rapid_commit = 14, /**< Rapid Commit Option. */
- dhcp6_code_user_class = 15, /**< User Class Option. */
- dhcp6_code_vendor_class = 16, /**< Vendor Class Option. */
- dhcp6_code_vendor_opts = 17, /**< Vendor-specific Information Option. */
- dhcp6_code_interface_id = 18, /**< Interface-Id Option. */
- dhcp6_code_reconf_msg = 19, /**< Reconfigure Message Option. */
- dhcp6_code_reconf_accept = 20, /**< Reconfigure Accept Option. */
+typedef enum tnet_dhcp6_option_code_e {
+ dhcp6_code_clientid = 1, /**< Client Identifier Option. */
+ dhcp6_code_serverid = 2, /**< Server Identifier Option. */
+ dhcp6_code_ia_na = 3, /**< Identity Association for Non-temporary Addresses Option. */
+ dhcp6_code_ia_ta = 4, /**< Identity Association for Temporary Addresses Option. */
+ dhcp6_code_iaaddr = 5, /**< IA Address Option. */
+ dhcp6_code_oro = 6, /**< Option Request Option. */
+ dhcp6_code_preference = 7, /**< Preference Option. */
+ dhcp6_code_elapsed_time = 8, /**< Elapsed Time Option. */
+ dhcp6_code_relay_msg = 9, /**< Relay Message Option. */
+ dhcp6_code_auth = 11, /**< Authentication Option. */
+ dhcp6_code_unicast = 12, /**< Server Unicast Option. */
+ dhcp6_code_status_code = 13, /**< Status Code Option. */
+ dhcp6_code_rapid_commit = 14, /**< Rapid Commit Option. */
+ dhcp6_code_user_class = 15, /**< User Class Option. */
+ dhcp6_code_vendor_class = 16, /**< Vendor Class Option. */
+ dhcp6_code_vendor_opts = 17, /**< Vendor-specific Information Option. */
+ dhcp6_code_interface_id = 18, /**< Interface-Id Option. */
+ dhcp6_code_reconf_msg = 19, /**< Reconfigure Message Option. */
+ dhcp6_code_reconf_accept = 20, /**< Reconfigure Accept Option. */
}
tnet_dhcp6_option_code_t;
/** List of DHCPv6 status codes as registered by IANA (RFC 3315 subclause 24.4) */
-typedef enum tnet_dhcp6_statuscode_e
-{
- /* Success */
- dhcp6_statuscode_Success = 0,
- /* Failure, reason unspecified; this status code is sent by either a client
- or a server to indicate a failure not explicitly specified in this document (RFC 3315). */
- dhcp6_statuscode_UnspecFail = 1,
- /* Server has no addresses available to assign to the IA(s). */
- dhcp6_statuscode_NoAddrsAvail = 2,
- /* Client record (binding) unavailable. */
- dhcp6_statuscode_NoBinding = 3,
- /* The prefix for the address is not appropriate for the link to which the client is attached. */
- dhcp6_statuscode_NotOnLink = 4,
- /* Sent by a server to a client to force the client to send messages to the server.
- using the All_DHCP_Relay_Agents_and_Servers address.*/
- dhcp6_statuscode_UseMulticast = 5
+typedef enum tnet_dhcp6_statuscode_e {
+ /* Success */
+ dhcp6_statuscode_Success = 0,
+ /* Failure, reason unspecified; this status code is sent by either a client
+ or a server to indicate a failure not explicitly specified in this document (RFC 3315). */
+ dhcp6_statuscode_UnspecFail = 1,
+ /* Server has no addresses available to assign to the IA(s). */
+ dhcp6_statuscode_NoAddrsAvail = 2,
+ /* Client record (binding) unavailable. */
+ dhcp6_statuscode_NoBinding = 3,
+ /* The prefix for the address is not appropriate for the link to which the client is attached. */
+ dhcp6_statuscode_NotOnLink = 4,
+ /* Sent by a server to a client to force the client to send messages to the server.
+ using the All_DHCP_Relay_Agents_and_Servers address.*/
+ dhcp6_statuscode_UseMulticast = 5
}
tnet_dhcp6_statuscode_t;
@@ -93,34 +91,32 @@ tnet_dhcp6_statuscode_t;
/**@ingroup tnet_dhcpv_group
* DHCPv6 option-data.
*/
-typedef struct tnet_dhcp6_option_data_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_dhcp6_option_data_s {
+ TSK_DECLARE_OBJECT;
}
tnet_dhcp6_option_data_t;
#define TNET_DECLARE_DHCP6_OPTION_DATA tnet_dhcp6_option_data_t dhcp6_option_data
-typedef struct tnet_dhcp6_option_s
-{
- TSK_DECLARE_OBJECT;
-
- /* RFC 3315 - 22.1. Format of DHCP Options
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | option-code(2) | option-len(2) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | option-data |
- | (option-len octets) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- /* An unsigned integer identifying the specific option type carried in this option.*/
- tnet_dhcp6_option_code_t code;
- /* Option length. Same as tsk_strlen(data buffer)*/
- uint16_t len;
- /* opton-data */
- tnet_dhcp6_option_data_t *data;
+typedef struct tnet_dhcp6_option_s {
+ TSK_DECLARE_OBJECT;
+
+ /* RFC 3315 - 22.1. Format of DHCP Options
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | option-code(2) | option-len(2) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | option-data |
+ | (option-len octets) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ /* An unsigned integer identifying the specific option type carried in this option.*/
+ tnet_dhcp6_option_code_t code;
+ /* Option length. Same as tsk_strlen(data buffer)*/
+ uint16_t len;
+ /* opton-data */
+ tnet_dhcp6_option_data_t *data;
}
tnet_dhcp6_option_t;
@@ -136,29 +132,28 @@ int tnet_dhcp6_option_serializeex(tnet_dhcp6_option_code_t code, uint8_t length,
/*======================================================================================
-* RFC 3315 -
+* RFC 3315 -
22.2. Client Identifier Option
22.3. Server Identifier Option
*=======================================================================================*/
/** DHCPv6 Client /server Identifier Option (subclause 22.2 and 22.3).
*/
-typedef struct tnet_dhcp6_option_identifier_s
-{
- TNET_DECLARE_DHCP6_OPTION_DATA;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | OPTION_XXXXXXID | option-len |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- . .
- . DUID .
- . (variable length) .
- . .
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- OPTION_XXXXXXID = OPTION_CLIENTID or OPTION_SERVERID
- */
- tnet_dhcp6_duid_t *duid;
+typedef struct tnet_dhcp6_option_identifier_s {
+ TNET_DECLARE_DHCP6_OPTION_DATA;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | OPTION_XXXXXXID | option-len |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ . .
+ . DUID .
+ . (variable length) .
+ . .
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ OPTION_XXXXXXID = OPTION_CLIENTID or OPTION_SERVERID
+ */
+ tnet_dhcp6_duid_t *duid;
}
tnet_dhcp6_option_identifier_t;
typedef tnet_dhcp6_option_identifier_t tnet_dhcp6_option_clientid_t;
@@ -175,21 +170,20 @@ typedef tnet_dhcp6_option_identifier_t tnet_dhcp6_option_serverid_t;
/** DHCPv6 Option Request Option (subclause 22.7).
*/
-typedef struct tnet_dhcp6_option_orequest_s
-{
- TNET_DECLARE_DHCP6_OPTION_DATA;
- /*
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | OPTION_ORO | option-len |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | requested-option-code-1 | requested-option-code-2 |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | ... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- tsk_buffer_t* codes;
+typedef struct tnet_dhcp6_option_orequest_s {
+ TNET_DECLARE_DHCP6_OPTION_DATA;
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | OPTION_ORO | option-len |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | requested-option-code-1 | requested-option-code-2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | ... |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ tsk_buffer_t* codes;
}
tnet_dhcp6_option_orequest_t;
@@ -201,11 +195,10 @@ TINYNET_API int tnet_dhcp6_option_orequest_add_code(tnet_dhcp6_option_orequest_t
/** DHCPv6 Vendor Class Option (subclause 22.16).
*/
-typedef struct tnet_dhcp6_option_vendorclass_s
-{
- TNET_DECLARE_DHCP6_OPTION_DATA;
- /*
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+typedef struct tnet_dhcp6_option_vendorclass_s {
+ TNET_DECLARE_DHCP6_OPTION_DATA;
+ /*
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_VENDOR_CLASS | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -215,14 +208,14 @@ typedef struct tnet_dhcp6_option_vendorclass_s
. vendor-class-data .
. . . . .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- uint32_t enterprise_number;
- /*
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
+ */
+ uint32_t enterprise_number;
+ /*
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
| vendor-class-len | opaque-data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
- */
- tsk_buffer_t* vendor_class_data;
+ */
+ tsk_buffer_t* vendor_class_data;
}
tnet_dhcp6_option_vendorclass_t;
diff --git a/tinyNET/src/dns/tnet_dns.c b/tinyNET/src/dns/tnet_dns.c
index 87cd9b5..e131c4d 100755
--- a/tinyNET/src/dns/tnet_dns.c
+++ b/tinyNET/src/dns/tnet_dns.c
@@ -158,7 +158,7 @@ TSK_OBJECT_SAFE_FREE(ctx);
*/
tnet_dns_ctx_t* tnet_dns_ctx_create()
{
- return tsk_object_new(tnet_dns_ctx_def_t);
+ return tsk_object_new(tnet_dns_ctx_def_t);
}
/**@ingroup tnet_dns_group
@@ -166,7 +166,7 @@ tnet_dns_ctx_t* tnet_dns_ctx_create()
*/
tnet_dns_cache_entry_t* tnet_dns_cache_entry_create(const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype, tnet_dns_response_t* answer)
{
- return tsk_object_new(tnet_dns_cache_entry_def_t, qname, qclass, qtype, answer);
+ return tsk_object_new(tnet_dns_cache_entry_def_t, qname, qclass, qtype, answer);
}
@@ -178,14 +178,14 @@ tnet_dns_cache_entry_t* tnet_dns_cache_entry_create(const char* qname, tnet_dns_
*/
int tnet_dns_cache_clear(tnet_dns_ctx_t* ctx)
{
- if (ctx){
- tsk_safeobj_lock(ctx);
- tsk_list_clear_items(ctx->cache);
- tsk_safeobj_unlock(ctx);
-
- return 0;
- }
- return -1;
+ if (ctx) {
+ tsk_safeobj_lock(ctx);
+ tsk_list_clear_items(ctx->cache);
+ tsk_safeobj_unlock(ctx);
+
+ return 0;
+ }
+ return -1;
}
/**@ingroup tnet_dns_group
@@ -208,274 +208,275 @@ int tnet_dns_cache_clear(tnet_dns_ctx_t* ctx)
tnet_dns_response_t *tnet_dns_resolve(tnet_dns_ctx_t* ctx, const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype)
{
#if HAVE_DNS_H
- struct sockaddr_storage result;
- struct sockaddr *from;
- uint32_t fromlen;
- char buf[TNET_DNS_DGRAM_SIZE_DEFAULT];
- int32_t ret;
-
- tnet_dns_response_t *response = tsk_null;
-
- tnet_socket_t *localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv4);
- tnet_socket_t *localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv6);
-
- tsk_safeobj_lock(ctx);
-
- // First, try with IPv4
- if(TNET_SOCKET_IS_VALID(localsocket4)){
- if((ret = tnet_getsockname(localsocket4->fd, &result))){
- TNET_PRINT_LAST_ERROR("tnet_getsockname() failed.");
- goto ipv6;
- }
- from = (struct sockaddr *) &result;
- fromlen = tnet_get_sockaddr_size(from);
-
- if ((ret = dns_search(ctx->resolv_handle, qname, qclass, qtype, buf, TNET_DNS_DGRAM_SIZE_DEFAULT, from, &fromlen)) > 0) {
- response = tnet_dns_message_deserialize((uint8_t *) buf, ret);
- goto done;
- }
- else{
- TNET_PRINT_LAST_ERROR("dns_search_v4()");
- }
- }
+ struct sockaddr_storage result;
+ struct sockaddr *from;
+ uint32_t fromlen;
+ char buf[TNET_DNS_DGRAM_SIZE_DEFAULT];
+ int32_t ret;
+
+ tnet_dns_response_t *response = tsk_null;
+
+ tnet_socket_t *localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv4);
+ tnet_socket_t *localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv6);
+
+ tsk_safeobj_lock(ctx);
+
+ // First, try with IPv4
+ if(TNET_SOCKET_IS_VALID(localsocket4)) {
+ if((ret = tnet_getsockname(localsocket4->fd, &result))) {
+ TNET_PRINT_LAST_ERROR("tnet_getsockname() failed.");
+ goto ipv6;
+ }
+ from = (struct sockaddr *) &result;
+ fromlen = tnet_get_sockaddr_size(from);
+
+ if ((ret = dns_search(ctx->resolv_handle, qname, qclass, qtype, buf, TNET_DNS_DGRAM_SIZE_DEFAULT, from, &fromlen)) > 0) {
+ response = tnet_dns_message_deserialize((uint8_t *) buf, ret);
+ goto done;
+ }
+ else {
+ TNET_PRINT_LAST_ERROR("dns_search_v4()");
+ }
+ }
ipv6:
- // Then, try with IPv6
- if(TNET_SOCKET_IS_VALID(localsocket6)){
- if((ret = tnet_getsockname(localsocket6->fd, &result))){
- TNET_PRINT_LAST_ERROR("tnet_getsockname() failed.");
- goto done;
- }
- from = (struct sockaddr *) &result;
- fromlen = tnet_get_sockaddr_size(from);
-
- if((ret = dns_search(ctx->resolv_handle, qname, qclass, qtype, buf, TNET_DNS_DGRAM_SIZE_DEFAULT, from, &fromlen)) > 0){
- response = tnet_dns_message_deserialize((uint8_t *) buf, ret);
- goto done;
- }
- else{
- TNET_PRINT_LAST_ERROR("dns_search_v6()");
- }
- }
+ // Then, try with IPv6
+ if(TNET_SOCKET_IS_VALID(localsocket6)) {
+ if((ret = tnet_getsockname(localsocket6->fd, &result))) {
+ TNET_PRINT_LAST_ERROR("tnet_getsockname() failed.");
+ goto done;
+ }
+ from = (struct sockaddr *) &result;
+ fromlen = tnet_get_sockaddr_size(from);
+
+ if((ret = dns_search(ctx->resolv_handle, qname, qclass, qtype, buf, TNET_DNS_DGRAM_SIZE_DEFAULT, from, &fromlen)) > 0) {
+ response = tnet_dns_message_deserialize((uint8_t *) buf, ret);
+ goto done;
+ }
+ else {
+ TNET_PRINT_LAST_ERROR("dns_search_v6()");
+ }
+ }
done:
- tsk_safeobj_unlock(ctx);
+ tsk_safeobj_unlock(ctx);
- TSK_OBJECT_SAFE_FREE(localsocket4);
- TSK_OBJECT_SAFE_FREE(localsocket6);
+ TSK_OBJECT_SAFE_FREE(localsocket4);
+ TSK_OBJECT_SAFE_FREE(localsocket6);
- return response;
+ return response;
#else
- tsk_buffer_t *output = tsk_null;
- tnet_dns_query_t* query = tnet_dns_query_create(qname, qclass, qtype);
- tnet_dns_response_t *response = tsk_null;
- tsk_bool_t from_cache = tsk_false;
-
- /* Check validity */
- if (!ctx || !query){
- goto bail;
- }
-
- /* Is there any DNS Server? */
- if (TSK_LIST_IS_EMPTY(ctx->servers)){
- TSK_DEBUG_ERROR("Failed to load DNS Servers. You can add new DNS servers by using \"tnet_dns_add_server\".");
- goto bail;
- }
-
- /* Cache maintenance */
- if (!TSK_LIST_IS_EMPTY(ctx->cache)){
- /* Only do maintenance if the cache is not empty */
- tnet_dns_cache_maintenance(ctx);
- }
-
- /* Retrieve data from cache. */
- if (ctx->caching){
- const tnet_dns_cache_entry_t *entry = tnet_dns_cache_entry_get(ctx, qname, qclass, qtype);
- if (entry){
- response = tsk_object_ref(((tnet_dns_cache_entry_t*)entry)->response);
- from_cache = tsk_true;
- goto bail;
- }
- }
-
- /* Set user preference */
- query->Header.RD = ctx->recursion;
-
- /* EDNS0 */
- if (ctx->edns0){
- tnet_dns_opt_t *rr_opt = tnet_dns_opt_create(TNET_DNS_DGRAM_SIZE_DEFAULT);
- if (!query->Additionals){
- query->Additionals = tsk_list_create();
- }
- tsk_list_push_back_data(query->Additionals, (void**)&rr_opt);
- query->Header.ARCOUNT++;
- }
-
- /* Serialize and send to the server. */
- if (!(output = tnet_dns_message_serialize(query))){
- TSK_DEBUG_ERROR("Failed to serialize the DNS message.");
- goto bail;
- }
-
- /* ============================ */
- // Send and Recaive data
- /* ============================ */
- {
- int ret = -1;
- struct timeval tv;
- fd_set set;
- tnet_fd_t maxFD;
- uint64_t timeout = 0;
- tsk_list_item_t *item;
- const tnet_address_t *address;
- struct sockaddr_storage server;
- tnet_socket_t *localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv4);
- tnet_socket_t *localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv6);
- tsk_bool_t useIPv6 = TNET_SOCKET_IS_VALID(localsocket6);
-
- tsk_safeobj_lock(ctx);
-
- /* Check socket validity */
- if (!TNET_SOCKET_IS_VALID(localsocket4)){
- goto done;
- }
-
- /* Always wait 500ms before retransmission */
- tv.tv_sec = 0;
- tv.tv_usec = (500 * 1000);
-
- do
- {
- //
- // Send data (loop through all intefaces)
- //
- tsk_list_foreach(item, ctx->servers)
- {
- address = item->data;
- if (!address->ip ||
- (address->family != AF_INET && address->family != AF_INET6) ||
- (address->family == AF_INET6 && !TNET_SOCKET_IS_VALID(localsocket6))){
- continue;
- }
-
- if (tnet_sockaddr_init(address->ip, ctx->server_port, (address->family == AF_INET ? tnet_socket_type_udp_ipv4 : tnet_socket_type_udp_ipv6), &server)){
- TSK_DEBUG_ERROR("Failed to initialize the DNS server address: \"%s\"", address->ip);
- continue;
- }
-
- TSK_DEBUG_INFO("Sending DNS query to \"%s\"", address->ip);
-
- if (address->family == AF_INET6){
- if ((ret = tnet_sockfd_sendto(localsocket6->fd, (const struct sockaddr*)&server, output->data, output->size))){
- // succeed?
- break;
- }
- }
- else{
- if ((ret = tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size))){
- // succeed?
- break;
- }
- }
- }
-
- //
- // Received data
- //
- /* First time? ==> set timeout value */
- if (!timeout){
- timeout = tsk_time_epoch() + ctx->timeout;
- }
-
- /* Set FDs */
- FD_ZERO(&set);
- FD_SET(localsocket4->fd, &set);
- if (useIPv6){
- FD_SET(localsocket6->fd, &set);
- maxFD = TSK_MAX(localsocket4->fd, localsocket6->fd);
- }
- else{
- maxFD = localsocket4->fd;
- }
-
- /* wait for response */
- if ((ret = select(maxFD + 1, &set, NULL, NULL, &tv)) < 0){ /* Error */
- TNET_PRINT_LAST_ERROR("Select failed.");
- goto done;
- }
- else if (ret == 0){ /* timeout ==> do nothing */
-
- }
- else{ /* there is data to read */
- unsigned int len = 0;
- void* data = 0;
- tnet_fd_t active_fd;
-
- /* Find active file descriptor */
- if (FD_ISSET(localsocket4->fd, &set)){
- active_fd = localsocket4->fd;
- }
- else if (FD_ISSET(localsocket6->fd, &set)){
- active_fd = localsocket4->fd;
- }
- else{
- TSK_DEBUG_ERROR("FD_ISSET ==> Invalid file descriptor.");
- continue;
- }
-
- /* Check how how many bytes are pending */
- if ((ret = tnet_ioctlt(active_fd, FIONREAD, &len)) < 0){
- TSK_DEBUG_ERROR("tnet_ioctlt failed with error code:%d", tnet_geterrno());
- goto done;
- }
-
- /* Receive pending data */
- data = tsk_calloc(len, sizeof(uint8_t));
- if ((ret = tnet_sockfd_recv(active_fd, data, len, 0)) < 0){
- TSK_FREE(data);
-
- TSK_DEBUG_ERROR("tnet_sockfd_recv failed with error code:%d", tnet_geterrno());
- goto done;
- }
-
- /* Parse the incoming response. */
- response = tnet_dns_message_deserialize(data, (tsk_size_t)ret);
- TSK_FREE(data);
-
- if (response)
- { /* response successfuly parsed */
- if (query->Header.ID != response->Header.ID || !TNET_DNS_MESSAGE_IS_RESPONSE(response)){
- /* Not same transaction id ==> continue*/
- TSK_OBJECT_SAFE_FREE(response);
- }
- else goto done;
- }
- }
- } while (timeout > tsk_time_epoch());
-
- done:
- tsk_safeobj_unlock(ctx);
-
- TSK_OBJECT_SAFE_FREE(localsocket4);
- TSK_OBJECT_SAFE_FREE(localsocket6);
- goto bail;
- }
+ tsk_buffer_t *output = tsk_null;
+ tnet_dns_query_t* query = tnet_dns_query_create(qname, qclass, qtype);
+ tnet_dns_response_t *response = tsk_null;
+ tsk_bool_t from_cache = tsk_false;
+
+ /* Check validity */
+ if (!ctx || !query) {
+ goto bail;
+ }
+
+ /* Is there any DNS Server? */
+ if (TSK_LIST_IS_EMPTY(ctx->servers)) {
+ TSK_DEBUG_ERROR("Failed to load DNS Servers. You can add new DNS servers by using \"tnet_dns_add_server\".");
+ goto bail;
+ }
+
+ /* Cache maintenance */
+ if (!TSK_LIST_IS_EMPTY(ctx->cache)) {
+ /* Only do maintenance if the cache is not empty */
+ tnet_dns_cache_maintenance(ctx);
+ }
+
+ /* Retrieve data from cache. */
+ if (ctx->caching) {
+ const tnet_dns_cache_entry_t *entry = tnet_dns_cache_entry_get(ctx, qname, qclass, qtype);
+ if (entry) {
+ response = tsk_object_ref(((tnet_dns_cache_entry_t*)entry)->response);
+ from_cache = tsk_true;
+ goto bail;
+ }
+ }
+
+ /* Set user preference */
+ query->Header.RD = ctx->recursion;
+
+ /* EDNS0 */
+ if (ctx->edns0) {
+ tnet_dns_opt_t *rr_opt = tnet_dns_opt_create(TNET_DNS_DGRAM_SIZE_DEFAULT);
+ if (!query->Additionals) {
+ query->Additionals = tsk_list_create();
+ }
+ tsk_list_push_back_data(query->Additionals, (void**)&rr_opt);
+ query->Header.ARCOUNT++;
+ }
+
+ /* Serialize and send to the server. */
+ if (!(output = tnet_dns_message_serialize(query))) {
+ TSK_DEBUG_ERROR("Failed to serialize the DNS message.");
+ goto bail;
+ }
+
+ /* ============================ */
+ // Send and Recaive data
+ /* ============================ */
+ {
+ int ret = -1;
+ struct timeval tv;
+ fd_set set;
+ tnet_fd_t maxFD;
+ uint64_t timeout = 0;
+ tsk_list_item_t *item;
+ const tnet_address_t *address;
+ struct sockaddr_storage server;
+ tnet_socket_t *localsocket4 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv4);
+ tnet_socket_t *localsocket6 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_udp_ipv6);
+ tsk_bool_t useIPv6 = TNET_SOCKET_IS_VALID(localsocket6);
+
+ tsk_safeobj_lock(ctx);
+
+ /* Check socket validity */
+ if (!TNET_SOCKET_IS_VALID(localsocket4)) {
+ goto done;
+ }
+
+ /* Always wait 500ms before retransmission */
+ tv.tv_sec = 0;
+ tv.tv_usec = (500 * 1000);
+
+ do {
+ //
+ // Send data (loop through all intefaces)
+ //
+ tsk_list_foreach(item, ctx->servers) {
+ address = item->data;
+ if (!address->ip ||
+ (address->family != AF_INET && address->family != AF_INET6) ||
+ (address->family == AF_INET6 && !TNET_SOCKET_IS_VALID(localsocket6))) {
+ continue;
+ }
+
+ if (tnet_sockaddr_init(address->ip, ctx->server_port, (address->family == AF_INET ? tnet_socket_type_udp_ipv4 : tnet_socket_type_udp_ipv6), &server)) {
+ TSK_DEBUG_ERROR("Failed to initialize the DNS server address: \"%s\"", address->ip);
+ continue;
+ }
+
+ TSK_DEBUG_INFO("Sending DNS query to \"%s\"", address->ip);
+
+ if (address->family == AF_INET6) {
+ if ((ret = tnet_sockfd_sendto(localsocket6->fd, (const struct sockaddr*)&server, output->data, output->size))) {
+ // succeed?
+ break;
+ }
+ }
+ else {
+ if ((ret = tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size))) {
+ // succeed?
+ break;
+ }
+ }
+ }
+
+ //
+ // Received data
+ //
+ /* First time? ==> set timeout value */
+ if (!timeout) {
+ timeout = tsk_time_epoch() + ctx->timeout;
+ }
+
+ /* Set FDs */
+ FD_ZERO(&set);
+ FD_SET(localsocket4->fd, &set);
+ if (useIPv6) {
+ FD_SET(localsocket6->fd, &set);
+ maxFD = TSK_MAX(localsocket4->fd, localsocket6->fd);
+ }
+ else {
+ maxFD = localsocket4->fd;
+ }
+
+ /* wait for response */
+ if ((ret = select(maxFD + 1, &set, NULL, NULL, &tv)) < 0) { /* Error */
+ TNET_PRINT_LAST_ERROR("Select failed.");
+ goto done;
+ }
+ else if (ret == 0) { /* timeout ==> do nothing */
+
+ }
+ else { /* there is data to read */
+ unsigned int len = 0;
+ void* data = 0;
+ tnet_fd_t active_fd;
+
+ /* Find active file descriptor */
+ if (FD_ISSET(localsocket4->fd, &set)) {
+ active_fd = localsocket4->fd;
+ }
+ else if (FD_ISSET(localsocket6->fd, &set)) {
+ active_fd = localsocket4->fd;
+ }
+ else {
+ TSK_DEBUG_ERROR("FD_ISSET ==> Invalid file descriptor.");
+ continue;
+ }
+
+ /* Check how how many bytes are pending */
+ if ((ret = tnet_ioctlt(active_fd, FIONREAD, &len)) < 0) {
+ TSK_DEBUG_ERROR("tnet_ioctlt failed with error code:%d", tnet_geterrno());
+ goto done;
+ }
+
+ /* Receive pending data */
+ data = tsk_calloc(len, sizeof(uint8_t));
+ if ((ret = tnet_sockfd_recv(active_fd, data, len, 0)) < 0) {
+ TSK_FREE(data);
+
+ TSK_DEBUG_ERROR("tnet_sockfd_recv failed with error code:%d", tnet_geterrno());
+ goto done;
+ }
+
+ /* Parse the incoming response. */
+ response = tnet_dns_message_deserialize(data, (tsk_size_t)ret);
+ TSK_FREE(data);
+
+ if (response) {
+ /* response successfuly parsed */
+ if (query->Header.ID != response->Header.ID || !TNET_DNS_MESSAGE_IS_RESPONSE(response)) {
+ /* Not same transaction id ==> continue*/
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ goto done;
+ }
+ }
+ }
+ }
+ while (timeout > tsk_time_epoch());
+
+done:
+ tsk_safeobj_unlock(ctx);
+
+ TSK_OBJECT_SAFE_FREE(localsocket4);
+ TSK_OBJECT_SAFE_FREE(localsocket6);
+ goto bail;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(query);
- TSK_OBJECT_SAFE_FREE(output);
-
- /* Add the result to the cache. */
- if (response){
- if (!from_cache && ctx->caching){
- tnet_dns_cache_entry_add(ctx, qname, qclass, qtype, response);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to contact the DNS server.");
- }
-
- return response;
+ TSK_OBJECT_SAFE_FREE(query);
+ TSK_OBJECT_SAFE_FREE(output);
+
+ /* Add the result to the cache. */
+ if (response) {
+ if (!from_cache && ctx->caching) {
+ tnet_dns_cache_entry_add(ctx, qname, qclass, qtype, response);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to contact the DNS server.");
+ }
+
+ return response;
#endif
}
@@ -491,65 +492,65 @@ bail:
*/
tnet_dns_response_t* tnet_dns_enum(tnet_dns_ctx_t* ctx, const char* e164num, const char* domain)
{
- char e164domain[255];
- tnet_dns_response_t* ret = tsk_null;
- int e164size;
- int i, j; // must be signed
-
- e164size = (int)tsk_strlen(e164num);
-
- if (!ctx || !e164num || !e164size){
- goto bail;
- }
-
- if (e164size /* max=15 digits + ".e164.arpa" + '+' */ >= (sizeof(e164domain) - 1)){
- TSK_DEBUG_ERROR("%s is an invalid E.164 number.", e164num);
- goto bail;
- }
-
- memset(e164domain, '\0', sizeof(e164domain));
-
- /* RFC 3761 - 2.4. Valid Databases
- 1. Remove all characters with the exception of the digits. For
- example, the First Well Known Rule produced the Key
- "+442079460148". This step would simply remove the leading "+",
- producing "442079460148".
-
- 2. Put dots (".") between each digit. Example:
- 4.4.2.0.7.9.4.6.0.1.4.8
-
- 3. Reverse the order of the digits. Example:
- 8.4.1.0.6.4.9.7.0.2.4.4
-
- 4. Append the string ".e164.arpa" to the end. Example:
- 8.4.1.0.6.4.9.7.0.2.4.4.e164.arpa
-
- This domain-name is used to request NAPTR records which may contain
- the end result or, if the flags field is blank, produces new keys in
- the form of domain-names from the DNS.
- */
- for (i = e164size - 1, j = 0; i >= 0; i--){
- if (!isdigit(e164num[i])){
- continue;
- }
- e164domain[j++] = e164num[i];
- e164domain[j++] = '.';
- }
-
- // append domain name
- if (domain){
- memcpy(&e164domain[j], domain, ((tsk_strlen(domain) + j) >= sizeof(e164domain) - 1) ? (sizeof(e164domain) - j - 1) : tsk_strlen(domain));
- }
- else{
- memcpy(&e164domain[j], "e164.arpa", 9);
- }
-
- /* == Performs DNS (NAPTR) lookup == */
- ret = tnet_dns_resolve(ctx, e164domain, qclass_in, qtype_naptr);
+ char e164domain[255];
+ tnet_dns_response_t* ret = tsk_null;
+ int e164size;
+ int i, j; // must be signed
+
+ e164size = (int)tsk_strlen(e164num);
+
+ if (!ctx || !e164num || !e164size) {
+ goto bail;
+ }
+
+ if (e164size /* max=15 digits + ".e164.arpa" + '+' */ >= (sizeof(e164domain) - 1)) {
+ TSK_DEBUG_ERROR("%s is an invalid E.164 number.", e164num);
+ goto bail;
+ }
+
+ memset(e164domain, '\0', sizeof(e164domain));
+
+ /* RFC 3761 - 2.4. Valid Databases
+ 1. Remove all characters with the exception of the digits. For
+ example, the First Well Known Rule produced the Key
+ "+442079460148". This step would simply remove the leading "+",
+ producing "442079460148".
+
+ 2. Put dots (".") between each digit. Example:
+ 4.4.2.0.7.9.4.6.0.1.4.8
+
+ 3. Reverse the order of the digits. Example:
+ 8.4.1.0.6.4.9.7.0.2.4.4
+
+ 4. Append the string ".e164.arpa" to the end. Example:
+ 8.4.1.0.6.4.9.7.0.2.4.4.e164.arpa
+
+ This domain-name is used to request NAPTR records which may contain
+ the end result or, if the flags field is blank, produces new keys in
+ the form of domain-names from the DNS.
+ */
+ for (i = e164size - 1, j = 0; i >= 0; i--) {
+ if (!isdigit(e164num[i])) {
+ continue;
+ }
+ e164domain[j++] = e164num[i];
+ e164domain[j++] = '.';
+ }
+
+ // append domain name
+ if (domain) {
+ memcpy(&e164domain[j], domain, ((tsk_strlen(domain) + j) >= sizeof(e164domain) - 1) ? (sizeof(e164domain) - j - 1) : tsk_strlen(domain));
+ }
+ else {
+ memcpy(&e164domain[j], "e164.arpa", 9);
+ }
+
+ /* == Performs DNS (NAPTR) lookup == */
+ ret = tnet_dns_resolve(ctx, e164domain, qclass_in, qtype_naptr);
bail:
- return ret;
+ return ret;
}
/**@ingroup tnet_dns_group
@@ -568,48 +569,48 @@ bail:
*/
char* tnet_dns_enum_2(tnet_dns_ctx_t* ctx, const char* service, const char* e164num, const char* domain)
{
- tnet_dns_response_t* response;
- const tsk_list_item_t* item;
- char* ret = tsk_null;
- const tnet_dns_rr_t* rr;
-
- if ((response = tnet_dns_enum(ctx, e164num, domain))){
- if (TNET_DNS_RESPONSE_IS_SUCCESS(response)){
- tsk_list_foreach(item, response->Answers){
- rr = item->data;
- if (rr->qtype == qtype_naptr){
- const tnet_dns_naptr_t *naptr = (const tnet_dns_naptr_t*)rr;
- /* RFC 3403 - 6.2 E164 Example
- Both the ENUM [18] and URI Resolution [4] Applications use the 'u'
- flag. This flag states that the Rule is terminal and that the output
- is a URI which contains the information needed to contact that
- telephone service.
- */
- if (tsk_striequals(naptr->flags, "u") && tsk_striequals(naptr->services, service)){
- /* RFC 3403 - 4.1 Packet Format
- The fields (replacement and regexp) are also mutually exclusive. If a record is
- returned that has values for both fields then it is considered to
- be in error and SHOULD be either ignored or an error returned.
- */
- if (naptr->regexp && naptr->replacement){
- continue;
- }
-
- if ((ret = tnet_dns_regex_parse(e164num, naptr->regexp))){
- break;
- }
- }
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("We got an error response from the DNS server. Error code: %u", response->Header.RCODE);
- }
-
- TSK_OBJECT_SAFE_FREE(response);
- }
-
- return ret;
+ tnet_dns_response_t* response;
+ const tsk_list_item_t* item;
+ char* ret = tsk_null;
+ const tnet_dns_rr_t* rr;
+
+ if ((response = tnet_dns_enum(ctx, e164num, domain))) {
+ if (TNET_DNS_RESPONSE_IS_SUCCESS(response)) {
+ tsk_list_foreach(item, response->Answers) {
+ rr = item->data;
+ if (rr->qtype == qtype_naptr) {
+ const tnet_dns_naptr_t *naptr = (const tnet_dns_naptr_t*)rr;
+ /* RFC 3403 - 6.2 E164 Example
+ Both the ENUM [18] and URI Resolution [4] Applications use the 'u'
+ flag. This flag states that the Rule is terminal and that the output
+ is a URI which contains the information needed to contact that
+ telephone service.
+ */
+ if (tsk_striequals(naptr->flags, "u") && tsk_striequals(naptr->services, service)) {
+ /* RFC 3403 - 4.1 Packet Format
+ The fields (replacement and regexp) are also mutually exclusive. If a record is
+ returned that has values for both fields then it is considered to
+ be in error and SHOULD be either ignored or an error returned.
+ */
+ if (naptr->regexp && naptr->replacement) {
+ continue;
+ }
+
+ if ((ret = tnet_dns_regex_parse(e164num, naptr->regexp))) {
+ break;
+ }
+ }
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("We got an error response from the DNS server. Error code: %u", response->Header.RCODE);
+ }
+
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+
+ return ret;
}
/**@ingroup tnet_dns_group
@@ -637,33 +638,31 @@ char* tnet_dns_enum_2(tnet_dns_ctx_t* ctx, const char* service, const char* e164
*/
int tnet_dns_query_srv(tnet_dns_ctx_t *ctx, const char* service, char** hostname, tnet_port_t* port)
{
- tnet_dns_response_t *response;
-
- if (!ctx){
- return -1;
- }
-
- // tnet_dns_resolve is thread-safe
- if ((response = tnet_dns_resolve(ctx, service, qclass_in, qtype_srv)))
- {
- const tsk_list_item_t *item;
- const tnet_dns_rr_t* rr;
- tsk_list_foreach(item, response->Answers) /* Already Filtered ==> Peek the first One */
- {
- rr = item->data;
- if (rr->qtype == qtype_srv){
- const tnet_dns_srv_t *srv = (const tnet_dns_srv_t*)rr;
-
- tsk_strupdate(hostname, srv->target);
- *port = srv->port;
- break;
- }
- }
- }
-
- TSK_OBJECT_SAFE_FREE(response);
-
- return (hostname && !tsk_strnullORempty(*hostname)) ? 0 : -2;
+ tnet_dns_response_t *response;
+
+ if (!ctx) {
+ return -1;
+ }
+
+ // tnet_dns_resolve is thread-safe
+ if ((response = tnet_dns_resolve(ctx, service, qclass_in, qtype_srv))) {
+ const tsk_list_item_t *item;
+ const tnet_dns_rr_t* rr;
+ tsk_list_foreach(item, response->Answers) { /* Already Filtered ==> Peek the first One */
+ rr = item->data;
+ if (rr->qtype == qtype_srv) {
+ const tnet_dns_srv_t *srv = (const tnet_dns_srv_t*)rr;
+
+ tsk_strupdate(hostname, srv->target);
+ *port = srv->port;
+ break;
+ }
+ }
+ }
+
+ TSK_OBJECT_SAFE_FREE(response);
+
+ return (hostname && !tsk_strnullORempty(*hostname)) ? 0 : -2;
}
/**@ingroup tnet_dns_group
@@ -692,157 +691,152 @@ int tnet_dns_query_srv(tnet_dns_ctx_t *ctx, const char* service, char** hostname
*/
int tnet_dns_query_naptr_srv(tnet_dns_ctx_t *ctx, const char* domain, const char* service, char** hostname, tnet_port_t* port)
{
- tnet_dns_response_t *response;
-
- if (!ctx || !hostname){
- TSK_DEBUG_ERROR("Invalid parameters.");
- return -1;
- }
-
- /* reset (do not free the user supplied value). trying to free dummy value will cause access violation error ==> zero. */
- *hostname = tsk_null;
-
- // tnet_dns_resolve is thread-safe
- if ((response = tnet_dns_resolve(ctx, domain, qclass_in, qtype_naptr))){
- const tsk_list_item_t *item;
- const tnet_dns_rr_t* rr;
-
- char* replacement = tsk_null; /* e.g. _sip._udp.example.com */
- char* flags = tsk_null;/* e.g. S, A, AAAA, A6, U, P ... */
-
- tsk_list_foreach(item, response->Answers) /* Already Filtered ==> Peek the first One */
- {
- rr = item->data;
- if (rr->qtype == qtype_naptr){
- tnet_dns_naptr_t *naptr = (tnet_dns_naptr_t*)rr;
-
- if (tsk_striequals(service, naptr->services)){
- tsk_strupdate(&replacement, naptr->replacement);
- tsk_strupdate(&flags, naptr->flags);
-
- break;
- }
- }
- }
-
- if (flags && replacement){
- if (tsk_striequals(flags, "S")){
- tnet_dns_query_srv(ctx, replacement, hostname, port);
- }
- else if (tsk_striequals(flags, "A") || tsk_striequals(flags, "AAAA") || tsk_striequals(flags, "A6")){
- TSK_DEBUG_WARN("Defaulting port value.");
- tsk_strupdate(hostname, replacement);
- *port = 5060;
- }
- else{
- TSK_DEBUG_ERROR("DNS NAPTR query returned invalid flags");
- }
- }
- else{
- TSK_DEBUG_INFO("DNS NAPTR (%s) query returned zero result", domain);
- }
-
- TSK_FREE(flags);
- TSK_FREE(replacement);
- }
-
- TSK_OBJECT_SAFE_FREE(response);
-
- return (hostname && *hostname && !tsk_strempty(*hostname)) ? 0 : -2;
+ tnet_dns_response_t *response;
+
+ if (!ctx || !hostname) {
+ TSK_DEBUG_ERROR("Invalid parameters.");
+ return -1;
+ }
+
+ /* reset (do not free the user supplied value). trying to free dummy value will cause access violation error ==> zero. */
+ *hostname = tsk_null;
+
+ // tnet_dns_resolve is thread-safe
+ if ((response = tnet_dns_resolve(ctx, domain, qclass_in, qtype_naptr))) {
+ const tsk_list_item_t *item;
+ const tnet_dns_rr_t* rr;
+
+ char* replacement = tsk_null; /* e.g. _sip._udp.example.com */
+ char* flags = tsk_null;/* e.g. S, A, AAAA, A6, U, P ... */
+
+ tsk_list_foreach(item, response->Answers) { /* Already Filtered ==> Peek the first One */
+ rr = item->data;
+ if (rr->qtype == qtype_naptr) {
+ tnet_dns_naptr_t *naptr = (tnet_dns_naptr_t*)rr;
+
+ if (tsk_striequals(service, naptr->services)) {
+ tsk_strupdate(&replacement, naptr->replacement);
+ tsk_strupdate(&flags, naptr->flags);
+
+ break;
+ }
+ }
+ }
+
+ if (flags && replacement) {
+ if (tsk_striequals(flags, "S")) {
+ tnet_dns_query_srv(ctx, replacement, hostname, port);
+ }
+ else if (tsk_striequals(flags, "A") || tsk_striequals(flags, "AAAA") || tsk_striequals(flags, "A6")) {
+ TSK_DEBUG_WARN("Defaulting port value.");
+ tsk_strupdate(hostname, replacement);
+ *port = 5060;
+ }
+ else {
+ TSK_DEBUG_ERROR("DNS NAPTR query returned invalid flags");
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("DNS NAPTR (%s) query returned zero result", domain);
+ }
+
+ TSK_FREE(flags);
+ TSK_FREE(replacement);
+ }
+
+ TSK_OBJECT_SAFE_FREE(response);
+
+ return (hostname && *hostname && !tsk_strempty(*hostname)) ? 0 : -2;
}
// remove timedout entries
int tnet_dns_cache_maintenance(tnet_dns_ctx_t *ctx)
{
- if (ctx)
- {
- tsk_list_item_t *item;
- tsk_safeobj_lock(ctx);
- again:
-
- tsk_list_foreach(item, ctx->cache)
- {
- // FIXME: ttl should be from RR::ttl
- tnet_dns_cache_entry_t *entry = (tnet_dns_cache_entry_t*)item->data;
- if ((entry->epoch + ctx->cache_ttl) < tsk_time_epoch()){
- tsk_list_remove_item_by_data(ctx->cache, entry);
- goto again; /* Do not delete data while looping */
- }
- }
-
- tsk_safeobj_unlock(ctx);
-
- return 0;
- }
- return -1;
+ if (ctx) {
+ tsk_list_item_t *item;
+ tsk_safeobj_lock(ctx);
+again:
+
+ tsk_list_foreach(item, ctx->cache) {
+ // FIXME: ttl should be from RR::ttl
+ tnet_dns_cache_entry_t *entry = (tnet_dns_cache_entry_t*)item->data;
+ if ((entry->epoch + ctx->cache_ttl) < tsk_time_epoch()) {
+ tsk_list_remove_item_by_data(ctx->cache, entry);
+ goto again; /* Do not delete data while looping */
+ }
+ }
+
+ tsk_safeobj_unlock(ctx);
+
+ return 0;
+ }
+ return -1;
}
// add an entry to the cache
int tnet_dns_cache_entry_add(tnet_dns_ctx_t *ctx, const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype, tnet_dns_response_t* response)
{
- int ret = -1;
-
- if (ctx)
- {
- tnet_dns_cache_entry_t *entry;
-
- tsk_safeobj_lock(ctx);
-
- entry = 0;
-
- /* Retrieve from cache */
- entry = (tnet_dns_cache_entry_t*)tnet_dns_cache_entry_get(ctx, qname, qclass, qtype);
-
- if (entry){
- /* UPDATE */
- TSK_OBJECT_SAFE_FREE(entry->response);
- entry->response = tsk_object_ref(response);
- entry->epoch = tsk_time_epoch();
- ret = 0;
- goto done;
- }
- else{
- /* CREATE */
- entry = tnet_dns_cache_entry_create(qname, qclass, qtype, response);
- if (entry){
- tsk_list_push_back_data(ctx->cache, (void**)&entry);
- ret = 0;
- goto done;
- }
- else{
- ret = -2;
- goto done;
- }
- }
- done:
- tsk_safeobj_unlock(ctx);
- }
- return ret;
+ int ret = -1;
+
+ if (ctx) {
+ tnet_dns_cache_entry_t *entry;
+
+ tsk_safeobj_lock(ctx);
+
+ entry = 0;
+
+ /* Retrieve from cache */
+ entry = (tnet_dns_cache_entry_t*)tnet_dns_cache_entry_get(ctx, qname, qclass, qtype);
+
+ if (entry) {
+ /* UPDATE */
+ TSK_OBJECT_SAFE_FREE(entry->response);
+ entry->response = tsk_object_ref(response);
+ entry->epoch = tsk_time_epoch();
+ ret = 0;
+ goto done;
+ }
+ else {
+ /* CREATE */
+ entry = tnet_dns_cache_entry_create(qname, qclass, qtype, response);
+ if (entry) {
+ tsk_list_push_back_data(ctx->cache, (void**)&entry);
+ ret = 0;
+ goto done;
+ }
+ else {
+ ret = -2;
+ goto done;
+ }
+ }
+done:
+ tsk_safeobj_unlock(ctx);
+ }
+ return ret;
}
// get an entry from the cache
const tnet_dns_cache_entry_t* tnet_dns_cache_entry_get(tnet_dns_ctx_t *ctx, const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype)
{
- tnet_dns_cache_entry_t *ret = tsk_null;
- if (ctx)
- {
- tsk_list_item_t *item;
+ tnet_dns_cache_entry_t *ret = tsk_null;
+ if (ctx) {
+ tsk_list_item_t *item;
- tsk_safeobj_lock(ctx);
+ tsk_safeobj_lock(ctx);
- tsk_list_foreach(item, ctx->cache){
- tnet_dns_cache_entry_t *entry = (tnet_dns_cache_entry_t*)item->data;
- if (entry->qtype == qtype && entry->qclass == qclass && tsk_strequals(entry->qname, qname)){
- ret = entry;
- break;
- }
- }
+ tsk_list_foreach(item, ctx->cache) {
+ tnet_dns_cache_entry_t *entry = (tnet_dns_cache_entry_t*)item->data;
+ if (entry->qtype == qtype && entry->qclass == qclass && tsk_strequals(entry->qname, qname)) {
+ ret = entry;
+ break;
+ }
+ }
- tsk_safeobj_unlock(ctx);
- }
+ tsk_safeobj_unlock(ctx);
+ }
- return ret;
+ return ret;
}
@@ -854,25 +848,25 @@ const tnet_dns_cache_entry_t* tnet_dns_cache_entry_get(tnet_dns_ctx_t *ctx, cons
*/
int tnet_dns_add_server(tnet_dns_ctx_t *ctx, const char* host)
{
- tnet_address_t *address;
+ tnet_address_t *address;
- if (!ctx || !host){
- return -1;
- }
+ if (!ctx || !host) {
+ return -1;
+ }
- if (!ctx->servers){
- ctx->servers = tsk_list_create();
- }
+ if (!ctx->servers) {
+ ctx->servers = tsk_list_create();
+ }
- if ((address = tnet_address_create(host))){
- address->family = tnet_get_family(host, TNET_DNS_SERVER_PORT_DEFAULT);
- address->dnsserver = 1;
- tsk_list_push_ascending_data(ctx->servers, (void**)&address);
+ if ((address = tnet_address_create(host))) {
+ address->family = tnet_get_family(host, TNET_DNS_SERVER_PORT_DEFAULT);
+ address->dnsserver = 1;
+ tsk_list_push_ascending_data(ctx->servers, (void**)&address);
- return 0;
- }
+ return 0;
+ }
- return -2;
+ return -2;
}
//=================================================================================================
@@ -880,33 +874,32 @@ int tnet_dns_add_server(tnet_dns_ctx_t *ctx, const char* host)
//
static tsk_object_t* tnet_dns_cache_entry_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_cache_entry_t *entry = self;
- if (entry){
- entry->qname = tsk_strdup(va_arg(*app, const char*));
- entry->qclass = va_arg(*app, tnet_dns_qclass_t);
- entry->qtype = va_arg(*app, tnet_dns_qtype_t);
- entry->response = tsk_object_ref(va_arg(*app, tnet_dns_response_t*));
-
- entry->epoch = tsk_time_epoch();
- }
- return self;
+ tnet_dns_cache_entry_t *entry = self;
+ if (entry) {
+ entry->qname = tsk_strdup(va_arg(*app, const char*));
+ entry->qclass = va_arg(*app, tnet_dns_qclass_t);
+ entry->qtype = va_arg(*app, tnet_dns_qtype_t);
+ entry->response = tsk_object_ref(va_arg(*app, tnet_dns_response_t*));
+
+ entry->epoch = tsk_time_epoch();
+ }
+ return self;
}
static tsk_object_t* tnet_dns_cache_entry_dtor(tsk_object_t * self)
{
- tnet_dns_cache_entry_t *entry = self;
- if (entry){
- TSK_OBJECT_SAFE_FREE(entry->response);
- }
- return self;
+ tnet_dns_cache_entry_t *entry = self;
+ if (entry) {
+ TSK_OBJECT_SAFE_FREE(entry->response);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_cache_entry_def_s =
-{
- sizeof(tnet_dns_cache_entry_t),
- tnet_dns_cache_entry_ctor,
- tnet_dns_cache_entry_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_cache_entry_def_s = {
+ sizeof(tnet_dns_cache_entry_t),
+ tnet_dns_cache_entry_ctor,
+ tnet_dns_cache_entry_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_cache_entry_def_t = &tnet_dns_cache_entry_def_s;
@@ -916,52 +909,51 @@ const tsk_object_def_t *tnet_dns_cache_entry_def_t = &tnet_dns_cache_entry_def_s
//
static tsk_object_t* tnet_dns_ctx_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_ctx_t *ctx = self;
- if (ctx){
- ctx->timeout = TNET_DNS_TIMEOUT_DEFAULT;
- ctx->recursion = tsk_true;
- ctx->edns0 = tsk_true;
- ctx->caching = tsk_false;
+ tnet_dns_ctx_t *ctx = self;
+ if (ctx) {
+ ctx->timeout = TNET_DNS_TIMEOUT_DEFAULT;
+ ctx->recursion = tsk_true;
+ ctx->edns0 = tsk_true;
+ ctx->caching = tsk_false;
- ctx->cache_ttl = TNET_DNS_CACHE_TTL;
+ ctx->cache_ttl = TNET_DNS_CACHE_TTL;
- ctx->server_port = TNET_DNS_SERVER_PORT_DEFAULT;
+ ctx->server_port = TNET_DNS_SERVER_PORT_DEFAULT;
- /* Gets all dns servers. */
- ctx->servers = tnet_get_addresses_all_dnsservers();
- /* Creates empty cache. */
- ctx->cache = tsk_list_create();
+ /* Gets all dns servers. */
+ ctx->servers = tnet_get_addresses_all_dnsservers();
+ /* Creates empty cache. */
+ ctx->cache = tsk_list_create();
#if HAVE_DNS_H
- ctx->resolv_handle = dns_open(NULL);
+ ctx->resolv_handle = dns_open(NULL);
#endif
- tsk_safeobj_init(ctx);
- }
- return self;
- }
+ tsk_safeobj_init(ctx);
+ }
+ return self;
+}
static tsk_object_t* tnet_dns_ctx_dtor(tsk_object_t * self)
{
- tnet_dns_ctx_t *ctx = self;
- if (ctx){
- tsk_safeobj_deinit(ctx);
+ tnet_dns_ctx_t *ctx = self;
+ if (ctx) {
+ tsk_safeobj_deinit(ctx);
- TSK_OBJECT_SAFE_FREE(ctx->servers);
- TSK_OBJECT_SAFE_FREE(ctx->cache);
+ TSK_OBJECT_SAFE_FREE(ctx->servers);
+ TSK_OBJECT_SAFE_FREE(ctx->cache);
#if HAVE_DNS_H
- dns_free(ctx->resolv_handle);
+ dns_free(ctx->resolv_handle);
#endif
- }
- return self;
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_ctx_def_s =
-{
- sizeof(tnet_dns_ctx_t),
- tnet_dns_ctx_ctor,
- tnet_dns_ctx_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_ctx_def_s = {
+ sizeof(tnet_dns_ctx_t),
+ tnet_dns_ctx_ctor,
+ tnet_dns_ctx_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_ctx_def_t = &tnet_dns_ctx_def_s;
diff --git a/tinyNET/src/dns/tnet_dns.h b/tinyNET/src/dns/tnet_dns.h
index d4c2e6d..6d17356 100755
--- a/tinyNET/src/dns/tnet_dns.h
+++ b/tinyNET/src/dns/tnet_dns.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,12 +49,12 @@ TNET_BEGIN_DECLS
#define TNET_DNS_CACHE_TTL (15000 * 1000)
/**@ingroup tnet_dns_group
-* Default timeout (in milliseconds) value for DNS queries.
+* Default timeout (in milliseconds) value for DNS queries.
*/
#define TNET_DNS_TIMEOUT_DEFAULT 5000 //(5 seconds)
/**@ingroup tnet_dns_group
-* Maximum supported Dgram size to advertise using EDNS0.
+* Maximum supported Dgram size to advertise using EDNS0.
*/
#define TNET_DNS_DGRAM_SIZE_DEFAULT 4096
@@ -64,17 +64,16 @@ TNET_BEGIN_DECLS
/**DNS cache entry.
*/
-typedef struct tnet_dns_cache_entry_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_dns_cache_entry_s {
+ TSK_DECLARE_OBJECT;
- char* qname;
- tnet_dns_qclass_t qclass;
- tnet_dns_qtype_t qtype;
+ char* qname;
+ tnet_dns_qclass_t qclass;
+ tnet_dns_qtype_t qtype;
- uint64_t epoch;
+ uint64_t epoch;
- tnet_dns_response_t *response;
+ tnet_dns_response_t *response;
}
tnet_dns_cache_entry_t;
typedef tsk_list_t tnet_dns_cache_entries_L_t;
@@ -82,23 +81,22 @@ typedef tnet_dns_cache_entries_L_t tnet_dns_cache_t;
/**DNS context.
*/
-typedef struct tnet_dns_ctx_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_dns_ctx_s {
+ TSK_DECLARE_OBJECT;
+
+ uint64_t timeout; /**< In milliseconds. Default: @ref TNET_DNS_TIMEOUT_DEFAULT. */
+ tsk_bool_t recursion; /**< Indicates whether to direct the name server to pursue the query recursively. Default: enabled.*/
+ tsk_bool_t edns0; /**< Indicates whether to enable EDNS0 (Extension Mechanisms for DNS) or not. This option will allow you to send DNS packet larger than 512 bytes. Default: enabled. */
+ tsk_bool_t caching; /**< Indicates whether to enable the DNS cache or not. Default: no. */
- uint64_t timeout; /**< In milliseconds. Default: @ref TNET_DNS_TIMEOUT_DEFAULT. */
- tsk_bool_t recursion; /**< Indicates whether to direct the name server to pursue the query recursively. Default: enabled.*/
- tsk_bool_t edns0; /**< Indicates whether to enable EDNS0 (Extension Mechanisms for DNS) or not. This option will allow you to send DNS packet larger than 512 bytes. Default: enabled. */
- tsk_bool_t caching; /**< Indicates whether to enable the DNS cache or not. Default: no. */
+ int32_t cache_ttl;
- int32_t cache_ttl;
+ tnet_port_t server_port; /**< Default port (@a TNET_DNS_SERVER_PORT_DEFAULT)) */
- tnet_port_t server_port; /**< Default port (@a TNET_DNS_SERVER_PORT_DEFAULT)) */
+ tnet_dns_cache_t *cache;
+ tnet_addresses_L_t *servers;
- tnet_dns_cache_t *cache;
- tnet_addresses_L_t *servers;
-
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
#if HAVE_DNS_H
dns_handle_t resolv_handle;
diff --git a/tinyNET/src/dns/tnet_dns_a.c b/tinyNET/src/dns/tnet_dns_a.c
index 27a3603..b08d056 100755
--- a/tinyNET/src/dns/tnet_dns_a.c
+++ b/tinyNET/src/dns/tnet_dns_a.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,7 +39,7 @@
*/
tnet_dns_a_t* tnet_dns_a_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_a_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_a_def_t, name, qclass, ttl, rdlength, data, offset);
}
@@ -48,55 +48,54 @@ tnet_dns_a_t* tnet_dns_a_create(const char* name, tnet_dns_qclass_t qclass, uint
//
static tsk_object_t* tnet_dns_a_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_a_t *a = self;
- if(a){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_a_t *a = self;
+ if(a) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- const uint8_t* rddata = (((uint8_t*)data) + offset);
- //const uint8_t* dataEnd = (rddata + rdlength);
+ const uint8_t* rddata = (((uint8_t*)data) + offset);
+ //const uint8_t* dataEnd = (rddata + rdlength);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(a), qtype_a, qclass);
- TNET_DNS_RR(a)->name = tsk_strdup(name);
- TNET_DNS_RR(a)->rdlength = rdlength;
- TNET_DNS_RR(a)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(a), qtype_a, qclass);
+ TNET_DNS_RR(a)->name = tsk_strdup(name);
+ TNET_DNS_RR(a)->rdlength = rdlength;
+ TNET_DNS_RR(a)->ttl = ttl;
- if(rddata && rdlength && (rdlength == 4/* 32bits */)){
- // ==> DESERIALIZATION
- /* ADDRESS */
- uint32_t address = (uint32_t)tnet_htonl_2(rddata);
- tsk_sprintf(&(a->address), "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
- }
- else{
- TSK_DEBUG_ERROR("Invalid IPv4 address.");
- }
+ if(rddata && rdlength && (rdlength == 4/* 32bits */)) {
+ // ==> DESERIALIZATION
+ /* ADDRESS */
+ uint32_t address = (uint32_t)tnet_htonl_2(rddata);
+ tsk_sprintf(&(a->address), "%u.%u.%u.%u", (address>>24)&0xFF, (address>>16)&0xFF, (address>>8)&0xFF, (address>>0)&0xFF);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid IPv4 address.");
+ }
- }
- return self;
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_a_dtor(tsk_object_t * self)
-{
- tnet_dns_a_t *a = self;
- if(a){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(a));
+static tsk_object_t* tnet_dns_a_dtor(tsk_object_t * self)
+{
+ tnet_dns_a_t *a = self;
+ if(a) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(a));
- TSK_FREE(a->address);
- }
- return self;
+ TSK_FREE(a->address);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_a_def_s =
-{
- sizeof(tnet_dns_a_t),
- tnet_dns_a_ctor,
- tnet_dns_a_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_a_def_s = {
+ sizeof(tnet_dns_a_t),
+ tnet_dns_a_ctor,
+ tnet_dns_a_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_a_def_t = &tnet_dns_a_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_a.h b/tinyNET/src/dns/tnet_dns_a.h
index e5db962..066fe3b 100755
--- a/tinyNET/src/dns/tnet_dns_a.h
+++ b/tinyNET/src/dns/tnet_dns_a.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,16 +38,15 @@ TNET_BEGIN_DECLS
/**DNS A Resource Record.
*/
-typedef struct tnet_dns_a_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_a_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.4.1. A RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.4.1. A RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ADDRESS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* address;
+ */
+ char* address;
}
tnet_dns_a_t;
diff --git a/tinyNET/src/dns/tnet_dns_aaaa.c b/tinyNET/src/dns/tnet_dns_aaaa.c
index 4855827..90cae5b 100755
--- a/tinyNET/src/dns/tnet_dns_aaaa.c
+++ b/tinyNET/src/dns/tnet_dns_aaaa.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,7 +40,7 @@
tnet_dns_aaaa_t* tnet_dns_aaaa_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_aaaa_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_aaaa_def_t, name, qclass, ttl, rdlength, data, offset);
}
@@ -49,56 +49,55 @@ tnet_dns_aaaa_t* tnet_dns_aaaa_create(const char* name, tnet_dns_qclass_t qclass
//
static tsk_object_t* tnet_dns_aaaa_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_aaaa_t *aaaa = self;
- if(aaaa){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_aaaa_t *aaaa = self;
+ if(aaaa) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- const uint8_t* rddata = (((uint8_t*)data) + offset);
- //const uint8_t* dataEnd = (rddata + rdlength);
+ const uint8_t* rddata = (((uint8_t*)data) + offset);
+ //const uint8_t* dataEnd = (rddata + rdlength);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(aaaa), qtype_aaaa, qclass);
- TNET_DNS_RR(aaaa)->name = tsk_strdup(name);
- TNET_DNS_RR(aaaa)->rdlength = rdlength;
- TNET_DNS_RR(aaaa)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(aaaa), qtype_aaaa, qclass);
+ TNET_DNS_RR(aaaa)->name = tsk_strdup(name);
+ TNET_DNS_RR(aaaa)->rdlength = rdlength;
+ TNET_DNS_RR(aaaa)->ttl = ttl;
- if(rddata && rdlength && (rdlength == 16/* 128bits */)){
- // ==> DESERIALIZATION
- /* ADDRESS */
- tsk_sprintf(&(aaaa->address), "%x:%x:%x:%x:%x:%x:%x:%x",
- tnet_ntohs_2(&rddata[0]), tnet_ntohs_2(&rddata[2]), tnet_ntohs_2(&rddata[4]), tnet_ntohs_2(&rddata[6]),
- tnet_ntohs_2(&rddata[8]), tnet_ntohs_2(&rddata[10]), tnet_ntohs_2(&rddata[12]), tnet_ntohs_2(&rddata[14]));
- }
- else{
- TSK_DEBUG_ERROR("Invalid IPv6 address.");
- }
+ if(rddata && rdlength && (rdlength == 16/* 128bits */)) {
+ // ==> DESERIALIZATION
+ /* ADDRESS */
+ tsk_sprintf(&(aaaa->address), "%x:%x:%x:%x:%x:%x:%x:%x",
+ tnet_ntohs_2(&rddata[0]), tnet_ntohs_2(&rddata[2]), tnet_ntohs_2(&rddata[4]), tnet_ntohs_2(&rddata[6]),
+ tnet_ntohs_2(&rddata[8]), tnet_ntohs_2(&rddata[10]), tnet_ntohs_2(&rddata[12]), tnet_ntohs_2(&rddata[14]));
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid IPv6 address.");
+ }
- }
- return self;
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_aaaa_dtor(tsk_object_t * self)
-{
- tnet_dns_aaaa_t *aaaa = self;
- if(aaaa){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(aaaa));
+static tsk_object_t* tnet_dns_aaaa_dtor(tsk_object_t * self)
+{
+ tnet_dns_aaaa_t *aaaa = self;
+ if(aaaa) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(aaaa));
- TSK_FREE(aaaa->address);
- }
- return self;
+ TSK_FREE(aaaa->address);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_aaaa_def_s =
-{
- sizeof(tnet_dns_aaaa_t),
- tnet_dns_aaaa_ctor,
- tnet_dns_aaaa_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_aaaa_def_s = {
+ sizeof(tnet_dns_aaaa_t),
+ tnet_dns_aaaa_ctor,
+ tnet_dns_aaaa_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_aaaa_def_t = &tnet_dns_aaaa_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_aaaa.h b/tinyNET/src/dns/tnet_dns_aaaa.h
index 759adf1..7fdd018 100755
--- a/tinyNET/src/dns/tnet_dns_aaaa.h
+++ b/tinyNET/src/dns/tnet_dns_aaaa.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,13 +38,12 @@ TNET_BEGIN_DECLS
/**DNS AAAA Resource Record.
*/
-typedef struct tnet_dns_aaaa_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_aaaa_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 3596 -
- */
- char* address;
+ /* RFC 3596 -
+ */
+ char* address;
}
tnet_dns_aaaa_t;
diff --git a/tinyNET/src/dns/tnet_dns_cname.c b/tinyNET/src/dns/tnet_dns_cname.c
index 8bec3e8..e64d515 100755
--- a/tinyNET/src/dns/tnet_dns_cname.c
+++ b/tinyNET/src/dns/tnet_dns_cname.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
tnet_dns_cname_t* tnet_dns_cname_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_cname_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_cname_def_t, name, qclass, ttl, rdlength, data, offset);
}
@@ -47,47 +47,46 @@ tnet_dns_cname_t* tnet_dns_cname_create(const char* name, tnet_dns_qclass_t qcla
//
static tsk_object_t* tnet_dns_cname_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_cname_t *cname = self;
- if(cname){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_cname_t *cname = self;
+ if(cname) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(cname), qtype_cname, qclass);
- TNET_DNS_RR(cname)->name = tsk_strdup(name);
- TNET_DNS_RR(cname)->rdlength = rdlength;
- TNET_DNS_RR(cname)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(cname), qtype_cname, qclass);
+ TNET_DNS_RR(cname)->name = tsk_strdup(name);
+ TNET_DNS_RR(cname)->rdlength = rdlength;
+ TNET_DNS_RR(cname)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* CNAME */
- tnet_dns_rr_qname_deserialize(data, &(cname->cname), &offset);
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* CNAME */
+ tnet_dns_rr_qname_deserialize(data, &(cname->cname), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_cname_dtor(tsk_object_t * self)
-{
- tnet_dns_cname_t *cname = self;
- if(cname){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(cname));
+static tsk_object_t* tnet_dns_cname_dtor(tsk_object_t * self)
+{
+ tnet_dns_cname_t *cname = self;
+ if(cname) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(cname));
- TSK_FREE(cname->cname);
- }
- return self;
+ TSK_FREE(cname->cname);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_cname_def_s =
-{
- sizeof(tnet_dns_cname_t),
- tnet_dns_cname_ctor,
- tnet_dns_cname_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_cname_def_s = {
+ sizeof(tnet_dns_cname_t),
+ tnet_dns_cname_ctor,
+ tnet_dns_cname_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_cname_def_t = &tnet_dns_cname_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_cname.h b/tinyNET/src/dns/tnet_dns_cname.h
index f97087d..8d8b658 100755
--- a/tinyNET/src/dns/tnet_dns_cname.h
+++ b/tinyNET/src/dns/tnet_dns_cname.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,17 +39,16 @@ TNET_BEGIN_DECLS
/** DNS CNAME Resource Record
*/
-typedef struct tnet_dns_cname_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_cname_s {
+ TNET_DECLARE_DNS_RR;
- /* 3.3.1. CNAME RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* 3.3.1. CNAME RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ CNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* cname;
+ */
+ char* cname;
}
tnet_dns_cname_t;
diff --git a/tinyNET/src/dns/tnet_dns_message.c b/tinyNET/src/dns/tnet_dns_message.c
index 594f499..4c1ef76 100755
--- a/tinyNET/src/dns/tnet_dns_message.c
+++ b/tinyNET/src/dns/tnet_dns_message.c
@@ -38,7 +38,7 @@
*/
tnet_dns_message_t* tnet_dns_message_create(const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype, tsk_bool_t isquery)
{
- return tsk_object_new(tnet_dns_message_def_t, qname, qclass, qtype, isquery);
+ return tsk_object_new(tnet_dns_message_def_t, qname, qclass, qtype, isquery);
}
/**@ingroup tnet_dns_group
@@ -47,7 +47,7 @@ tnet_dns_message_t* tnet_dns_message_create(const char* qname, tnet_dns_qclass_t
*/
tnet_dns_message_t* tnet_dns_message_create_null()
{
- return tnet_dns_message_create(tsk_null, qclass_any, qtype_any, tsk_false);
+ return tnet_dns_message_create(tsk_null, qclass_any, qtype_any, tsk_false);
}
/**@ingroup tnet_dns_group
@@ -56,7 +56,7 @@ tnet_dns_message_t* tnet_dns_message_create_null()
*/
tnet_dns_response_t* tnet_dns_response_create(const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype)
{
- return tnet_dns_message_create(qname, qclass, qtype, tsk_false);
+ return tnet_dns_message_create(qname, qclass, qtype, tsk_false);
}
/**@ingroup tnet_dns_group
@@ -65,7 +65,7 @@ tnet_dns_response_t* tnet_dns_response_create(const char* qname, tnet_dns_qclass
*/
tnet_dns_query_t* tnet_dns_query_create(const char* qname, tnet_dns_qclass_t qclass, tnet_dns_qtype_t qtype)
{
- return tnet_dns_message_create(qname, qclass, qtype, tsk_true);
+ return tnet_dns_message_create(qname, qclass, qtype, tsk_true);
}
/**@ingroup tnet_dns_group
@@ -76,113 +76,109 @@ tnet_dns_query_t* tnet_dns_query_create(const char* qname, tnet_dns_qclass_t qcl
*/
tsk_buffer_t* tnet_dns_message_serialize(const tnet_dns_message_t *message)
{
- tsk_buffer_t* output = tsk_null;
- uint16_t _2bytes;
- tsk_list_item_t *item;
-
- /* Check message validity */
- if (!message){
- goto bail;
- }
-
- /* Creates empty buffer */
- output = tsk_buffer_create_null();
-
- /* ==============================
- * HEADER
- */
- //tsk_buffer_append(output, &(message->Header), sizeof(message->Header));
-
- /* ID */
- _2bytes = tnet_ntohs(message->Header.ID);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* |QR| Opcode |AA|TC|RD|RA| Z | RCODE | */
- {
- uint16_t temp, _2bytes = 0;
-
- temp = message->Header.QR, temp <<= 15;
- _2bytes |= temp;
-
- temp = message->Header.OPCODE, temp <<= 11;
- _2bytes |= temp;
-
- temp = message->Header.AA, temp <<= 10;
- _2bytes |= temp;
-
- temp = message->Header.TC, temp <<= 9;
- _2bytes |= temp;
-
- temp = message->Header.RD, temp <<= 8;
- _2bytes |= temp;
-
- temp = message->Header.RA, temp <<= 7;
- _2bytes |= temp;
-
- temp = message->Header.Z, temp <<= 4;
- _2bytes |= temp;
-
- temp = message->Header.RCODE, temp <<= 4;
- _2bytes |= temp;
-
- _2bytes = tnet_ntohs(_2bytes);
- tsk_buffer_append(output, &(_2bytes), 2);
- }
- /* QDCOUNT */
- _2bytes = tnet_ntohs(message->Header.QDCOUNT);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* ANCOUNT */
- _2bytes = tnet_ntohs(message->Header.ANCOUNT);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* NSCOUNT */
- _2bytes = tnet_ntohs(message->Header.NSCOUNT);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* ARCOUNT */
- _2bytes = tnet_ntohs(message->Header.ARCOUNT);
- tsk_buffer_append(output, &(_2bytes), 2);
-
-
- /* ==============================
- * QUESTION
- */
- if (TNET_DNS_MESSAGE_IS_QUERY(message))
- {
- /* QNAME */
- tnet_dns_rr_qname_serialize(message->Question.QNAME, output);
- /* QTYPE */
- _2bytes = tnet_ntohs(message->Question.QTYPE);
- tsk_buffer_append(output, &(_2bytes), 2);
- /* QCLASS */
- _2bytes = tnet_ntohs(message->Question.QCLASS);
- tsk_buffer_append(output, &(_2bytes), 2);
- }
-
- /* ==============================
- * ANSWERS
- */
- tsk_list_foreach(item, message->Answers)
- {
- tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
- }
-
- /* ==============================
- * AUTHORITIES
- */
- tsk_list_foreach(item, message->Authorities)
- {
- tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
- }
-
- /* ==============================
- * ADDITIONALS
- */
- tsk_list_foreach(item, message->Additionals)
- {
- tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
- }
+ tsk_buffer_t* output = tsk_null;
+ uint16_t _2bytes;
+ tsk_list_item_t *item;
+
+ /* Check message validity */
+ if (!message) {
+ goto bail;
+ }
+
+ /* Creates empty buffer */
+ output = tsk_buffer_create_null();
+
+ /* ==============================
+ * HEADER
+ */
+ //tsk_buffer_append(output, &(message->Header), sizeof(message->Header));
+
+ /* ID */
+ _2bytes = tnet_ntohs(message->Header.ID);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* |QR| Opcode |AA|TC|RD|RA| Z | RCODE | */
+ {
+ uint16_t temp, _2bytes = 0;
+
+ temp = message->Header.QR, temp <<= 15;
+ _2bytes |= temp;
+
+ temp = message->Header.OPCODE, temp <<= 11;
+ _2bytes |= temp;
+
+ temp = message->Header.AA, temp <<= 10;
+ _2bytes |= temp;
+
+ temp = message->Header.TC, temp <<= 9;
+ _2bytes |= temp;
+
+ temp = message->Header.RD, temp <<= 8;
+ _2bytes |= temp;
+
+ temp = message->Header.RA, temp <<= 7;
+ _2bytes |= temp;
+
+ temp = message->Header.Z, temp <<= 4;
+ _2bytes |= temp;
+
+ temp = message->Header.RCODE, temp <<= 4;
+ _2bytes |= temp;
+
+ _2bytes = tnet_ntohs(_2bytes);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ }
+ /* QDCOUNT */
+ _2bytes = tnet_ntohs(message->Header.QDCOUNT);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* ANCOUNT */
+ _2bytes = tnet_ntohs(message->Header.ANCOUNT);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* NSCOUNT */
+ _2bytes = tnet_ntohs(message->Header.NSCOUNT);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* ARCOUNT */
+ _2bytes = tnet_ntohs(message->Header.ARCOUNT);
+ tsk_buffer_append(output, &(_2bytes), 2);
+
+
+ /* ==============================
+ * QUESTION
+ */
+ if (TNET_DNS_MESSAGE_IS_QUERY(message)) {
+ /* QNAME */
+ tnet_dns_rr_qname_serialize(message->Question.QNAME, output);
+ /* QTYPE */
+ _2bytes = tnet_ntohs(message->Question.QTYPE);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ /* QCLASS */
+ _2bytes = tnet_ntohs(message->Question.QCLASS);
+ tsk_buffer_append(output, &(_2bytes), 2);
+ }
+
+ /* ==============================
+ * ANSWERS
+ */
+ tsk_list_foreach(item, message->Answers) {
+ tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
+ }
+
+ /* ==============================
+ * AUTHORITIES
+ */
+ tsk_list_foreach(item, message->Authorities) {
+ tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
+ }
+
+ /* ==============================
+ * ADDITIONALS
+ */
+ tsk_list_foreach(item, message->Additionals) {
+ tnet_dns_rr_serialize((tnet_dns_rr_t *)item->data, output);
+ }
bail:
- return output;
+ return output;
}
/**@ingroup tnet_dns_group
@@ -194,112 +190,108 @@ bail:
*/
tnet_dns_message_t* tnet_dns_message_deserialize(const uint8_t *data, tsk_size_t size)
{
- tnet_dns_message_t *message = 0;
- uint8_t *dataPtr, *dataEnd, *dataStart;
- uint16_t i;
- tsk_size_t offset = 0;
-
- if (!data || !size){
- goto bail;
- }
-
- dataPtr = (uint8_t*)data;
- dataStart = dataPtr;
- dataEnd = (dataStart + size);
-
- message = tnet_dns_message_create_null();
-
- /* === HEADER ===*/
- /* ID */
- message->Header.ID = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /* |QR| Opcode |AA|TC|RD|RA| Z | RCODE | */
- {
- uint16_t flags = tnet_ntohs_2(dataPtr);
-
- message->Header.QR = (flags >> 15);
- message->Header.OPCODE = ((flags >> 11) & 0x000F);
- message->Header.AA = ((flags >> 10) & 0x0001);
- message->Header.TC = ((flags >> 9) & 0x0001);
- message->Header.RD = ((flags >> 8) & 0x0001);
- message->Header.RA = ((flags >> 7) & 0x0001);
- message->Header.Z = ((flags >> 4) & 0x0007);
- message->Header.RCODE = (flags & 0x000F);
-
- dataPtr += 2;
- }
- /* QDCOUNT */
- message->Header.QDCOUNT = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /* ANCOUNT */
- message->Header.ANCOUNT = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /* NSCOUNT */
- message->Header.NSCOUNT = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
- /* ARCOUNT */
- message->Header.ARCOUNT = tnet_ntohs_2(dataPtr);
- dataPtr += 2;
-
- /* === Queries ===*/
- offset = (tsk_size_t)(dataPtr - dataStart);
- for (i = 0; i < message->Header.QDCOUNT; i++)
- {
- /* Do not need to parse queries in the response ==> silently ignore */
- char* name = 0;
- tnet_dns_rr_qname_deserialize(dataStart, &name, &offset); /* QNAME */
- dataPtr += offset;
- dataPtr += 4, offset += 4; /* QTYPE + QCLASS */
- TSK_FREE(name);
- }
- dataPtr = (dataStart + offset); /* TODO: remove ==> obly for debug tests */
-
- /* === Answers ===*/
- offset = (tsk_size_t)(dataPtr - dataStart);
- for (i = 0; i < message->Header.ANCOUNT; i++)
- {
- tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
- if (rr){
- if (!message->Answers){
- message->Answers = tsk_list_create();
- }
- /* Push in descending order (useful for NAPTR and SRV records). */
- tsk_list_push_descending_data(message->Answers, (void**)&rr);
- }
- }
- dataPtr = (dataStart + offset);
-
- /* === Authorities ===*/
- offset = (tsk_size_t)(dataPtr - dataStart);
- for (i = 0; i < message->Header.NSCOUNT; i++)
- {
- tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
- if (rr){
- if (!message->Authorities){
- message->Authorities = tsk_list_create();
- }
- tsk_list_push_back_data(message->Authorities, (void**)&rr);
- }
- }
- dataPtr = (dataStart + offset);
-
- /* === Additionals ===*/
- offset = (tsk_size_t)(dataPtr - dataStart);
- for (i = 0; i < message->Header.ARCOUNT; i++)
- {
- tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
- if (rr){
- if (!message->Additionals){
- message->Additionals = tsk_list_create();
- }
- tsk_list_push_back_data(message->Additionals, (void**)&rr);
- }
- }
- dataPtr = (dataStart + offset);
+ tnet_dns_message_t *message = 0;
+ uint8_t *dataPtr, *dataEnd, *dataStart;
+ uint16_t i;
+ tsk_size_t offset = 0;
+
+ if (!data || !size) {
+ goto bail;
+ }
+
+ dataPtr = (uint8_t*)data;
+ dataStart = dataPtr;
+ dataEnd = (dataStart + size);
+
+ message = tnet_dns_message_create_null();
+
+ /* === HEADER ===*/
+ /* ID */
+ message->Header.ID = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /* |QR| Opcode |AA|TC|RD|RA| Z | RCODE | */
+ {
+ uint16_t flags = tnet_ntohs_2(dataPtr);
+
+ message->Header.QR = (flags >> 15);
+ message->Header.OPCODE = ((flags >> 11) & 0x000F);
+ message->Header.AA = ((flags >> 10) & 0x0001);
+ message->Header.TC = ((flags >> 9) & 0x0001);
+ message->Header.RD = ((flags >> 8) & 0x0001);
+ message->Header.RA = ((flags >> 7) & 0x0001);
+ message->Header.Z = ((flags >> 4) & 0x0007);
+ message->Header.RCODE = (flags & 0x000F);
+
+ dataPtr += 2;
+ }
+ /* QDCOUNT */
+ message->Header.QDCOUNT = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /* ANCOUNT */
+ message->Header.ANCOUNT = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /* NSCOUNT */
+ message->Header.NSCOUNT = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+ /* ARCOUNT */
+ message->Header.ARCOUNT = tnet_ntohs_2(dataPtr);
+ dataPtr += 2;
+
+ /* === Queries ===*/
+ offset = (tsk_size_t)(dataPtr - dataStart);
+ for (i = 0; i < message->Header.QDCOUNT; i++) {
+ /* Do not need to parse queries in the response ==> silently ignore */
+ char* name = 0;
+ tnet_dns_rr_qname_deserialize(dataStart, &name, &offset); /* QNAME */
+ dataPtr += offset;
+ dataPtr += 4, offset += 4; /* QTYPE + QCLASS */
+ TSK_FREE(name);
+ }
+ dataPtr = (dataStart + offset); /* TODO: remove ==> obly for debug tests */
+
+ /* === Answers ===*/
+ offset = (tsk_size_t)(dataPtr - dataStart);
+ for (i = 0; i < message->Header.ANCOUNT; i++) {
+ tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
+ if (rr) {
+ if (!message->Answers) {
+ message->Answers = tsk_list_create();
+ }
+ /* Push in descending order (useful for NAPTR and SRV records). */
+ tsk_list_push_descending_data(message->Answers, (void**)&rr);
+ }
+ }
+ dataPtr = (dataStart + offset);
+
+ /* === Authorities ===*/
+ offset = (tsk_size_t)(dataPtr - dataStart);
+ for (i = 0; i < message->Header.NSCOUNT; i++) {
+ tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
+ if (rr) {
+ if (!message->Authorities) {
+ message->Authorities = tsk_list_create();
+ }
+ tsk_list_push_back_data(message->Authorities, (void**)&rr);
+ }
+ }
+ dataPtr = (dataStart + offset);
+
+ /* === Additionals ===*/
+ offset = (tsk_size_t)(dataPtr - dataStart);
+ for (i = 0; i < message->Header.ARCOUNT; i++) {
+ tnet_dns_rr_t* rr = tnet_dns_rr_deserialize(dataStart, (tsk_size_t)(dataEnd - dataPtr), &offset);
+ if (rr) {
+ if (!message->Additionals) {
+ message->Additionals = tsk_list_create();
+ }
+ tsk_list_push_back_data(message->Additionals, (void**)&rr);
+ }
+ }
+ dataPtr = (dataStart + offset);
bail:
- return message;
+ return message;
}
//=================================================================================================
@@ -307,53 +299,52 @@ bail:
//
static tsk_object_t* tnet_dns_message_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_message_t *message = self;
- if (message){
- static uint16_t __dnsmessage_unique_id = 0;
-
- const char* qname = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- tnet_dns_qtype_t qtype = va_arg(*app, tnet_dns_qtype_t);
- tsk_bool_t isquery = va_arg(*app, tsk_bool_t);
-
- /* Create random ID. */
- message->Header.ID = ++__dnsmessage_unique_id;
-
- /* QR field ==> query (0) - response (1) */
- message->Header.QR = isquery ? 0 : 1;
-
- if (isquery){
- /* QDCOUNT field ==> at least one question */
- message->Header.QDCOUNT = 1;
- }
-
- if (qname){
- message->Question.QNAME = tsk_strdup(qname);
- message->Question.QTYPE = qtype;
- message->Question.QCLASS = qclass;
- }
- }
- return self;
+ tnet_dns_message_t *message = self;
+ if (message) {
+ static uint16_t __dnsmessage_unique_id = 0;
+
+ const char* qname = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ tnet_dns_qtype_t qtype = va_arg(*app, tnet_dns_qtype_t);
+ tsk_bool_t isquery = va_arg(*app, tsk_bool_t);
+
+ /* Create random ID. */
+ message->Header.ID = ++__dnsmessage_unique_id;
+
+ /* QR field ==> query (0) - response (1) */
+ message->Header.QR = isquery ? 0 : 1;
+
+ if (isquery) {
+ /* QDCOUNT field ==> at least one question */
+ message->Header.QDCOUNT = 1;
+ }
+
+ if (qname) {
+ message->Question.QNAME = tsk_strdup(qname);
+ message->Question.QTYPE = qtype;
+ message->Question.QCLASS = qclass;
+ }
+ }
+ return self;
}
static tsk_object_t* tnet_dns_message_dtor(tsk_object_t * self)
{
- tnet_dns_message_t *message = self;
- if (message){
- TSK_FREE(message->Question.QNAME);
-
- TSK_OBJECT_SAFE_FREE(message->Answers);
- TSK_OBJECT_SAFE_FREE(message->Authorities);
- TSK_OBJECT_SAFE_FREE(message->Additionals);
- }
- return self;
+ tnet_dns_message_t *message = self;
+ if (message) {
+ TSK_FREE(message->Question.QNAME);
+
+ TSK_OBJECT_SAFE_FREE(message->Answers);
+ TSK_OBJECT_SAFE_FREE(message->Authorities);
+ TSK_OBJECT_SAFE_FREE(message->Additionals);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_message_def_s =
-{
- sizeof(tnet_dns_message_t),
- tnet_dns_message_ctor,
- tnet_dns_message_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_message_def_s = {
+ sizeof(tnet_dns_message_t),
+ tnet_dns_message_ctor,
+ tnet_dns_message_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_message_def_t = &tnet_dns_message_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_message.h b/tinyNET/src/dns/tnet_dns_message.h
index 8506ff8..bea318a 100755
--- a/tinyNET/src/dns/tnet_dns_message.h
+++ b/tinyNET/src/dns/tnet_dns_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -68,22 +68,20 @@ TNET_BEGIN_DECLS
/**Response codes as per RFC 1035 subclause 4.1.1.
*/
-typedef enum tnet_dns_rcode_e
-{
- rcode_noerror = 0,
- rcode_error_format = 1,
- rcode_server_failure = 2,
- rcode_error_name = 3,
- rcode_notimplemented = 4,
- rcode_refused = 5
+typedef enum tnet_dns_rcode_e {
+ rcode_noerror = 0,
+ rcode_error_format = 1,
+ rcode_server_failure = 2,
+ rcode_error_name = 3,
+ rcode_notimplemented = 4,
+ rcode_refused = 5
}
tnet_dns_rcode_t;
/**OPCODE defining the kind of query as per RFC 1035 subclause 4.1.1.
*/
-typedef enum tnet_dns_opcode_e
-{
- opcode_query = 0, /**< 0 a standard query (QUERY) */
+typedef enum tnet_dns_opcode_e {
+ opcode_query = 0, /**< 0 a standard query (QUERY) */
opcode_iquery = 1, /**< 1 an inverse query (IQUERY) */
opcode_status = 2, /**< 2 a server status request (STATUS) */
}
@@ -91,12 +89,11 @@ tnet_dns_opcode_t;
/** DNS message as per RFC 1035 subclause 4.
*/
-typedef struct tnet_dns_message_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_dns_message_s {
+ TSK_DECLARE_OBJECT;
- /* RFC 1035 - 4.1. Format
- +---------------------+
+ /* RFC 1035 - 4.1. Format
+ +---------------------+
| Header |
+---------------------+
| Question | the question for the name server
@@ -107,10 +104,10 @@ typedef struct tnet_dns_message_s
+---------------------+
| Additional | RRs holding additional information
+---------------------+
- */
+ */
- /* RFC 1035 - 4.1.1. Header section format
- 1 1 1 1 1 1
+ /* RFC 1035 - 4.1.1. Header section format
+ 1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
@@ -125,27 +122,26 @@ typedef struct tnet_dns_message_s
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ARCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- struct
- {
- uint16_t ID;
- unsigned QR:1;
- unsigned OPCODE:4; /* see @ref tnet_dns_opcode_t */
- unsigned AA:1;
- unsigned TC:1;
- unsigned RD:1;
- unsigned RA:1;
- unsigned Z:3;
- unsigned RCODE:4; /* see @ref tnet_dns_rcode_t */
- uint16_t QDCOUNT;
- uint16_t ANCOUNT;
- uint16_t NSCOUNT;
- uint16_t ARCOUNT;
- }
- Header;
-
- /* RFc 1035 - 4.1.2. Question section format
- 1 1 1 1 1 1
+ */
+ struct {
+ uint16_t ID;
+ unsigned QR:1;
+ unsigned OPCODE:4; /* see @ref tnet_dns_opcode_t */
+ unsigned AA:1;
+ unsigned TC:1;
+ unsigned RD:1;
+ unsigned RA:1;
+ unsigned Z:3;
+ unsigned RCODE:4; /* see @ref tnet_dns_rcode_t */
+ uint16_t QDCOUNT;
+ uint16_t ANCOUNT;
+ uint16_t NSCOUNT;
+ uint16_t ARCOUNT;
+ }
+ Header;
+
+ /* RFc 1035 - 4.1.2. Question section format
+ 1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
@@ -156,34 +152,33 @@ typedef struct tnet_dns_message_s
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QCLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- struct
- {
- /** RFC 1035 - 4.1.2. Question section format
- a domain name represented as a sequence of labels, where
- each label consists of a length octet followed by that
- number of octets. The domain name terminates with the
- zero length octet for the null label of the root. Note
- that this field may be an odd number of octets; no
- padding is used.*/
- void* QNAME;
- /** RFC 1035 - 4.1.2. Question section format
- a two octet code which specifies the type of the query.
- The values for this field include all codes valid for a
- TYPE field, together with some more general codes which
- can match more than one type of RR.*/
- tnet_dns_qtype_t QTYPE;
- /* RFC 1035 - 4.1.2. Question section format
- a two octet code that specifies the class of the query.
- For example, the QCLASS field is IN for the Internet.
- */
- tnet_dns_qclass_t QCLASS;
- }
- Question;
-
- tnet_dns_rrs_L_t *Answers; /**< Filtered answers by priority. */
- tnet_dns_rrs_L_t *Authorities;
- tnet_dns_rrs_L_t *Additionals;
+ */
+ struct {
+ /** RFC 1035 - 4.1.2. Question section format
+ a domain name represented as a sequence of labels, where
+ each label consists of a length octet followed by that
+ number of octets. The domain name terminates with the
+ zero length octet for the null label of the root. Note
+ that this field may be an odd number of octets; no
+ padding is used.*/
+ void* QNAME;
+ /** RFC 1035 - 4.1.2. Question section format
+ a two octet code which specifies the type of the query.
+ The values for this field include all codes valid for a
+ TYPE field, together with some more general codes which
+ can match more than one type of RR.*/
+ tnet_dns_qtype_t QTYPE;
+ /* RFC 1035 - 4.1.2. Question section format
+ a two octet code that specifies the class of the query.
+ For example, the QCLASS field is IN for the Internet.
+ */
+ tnet_dns_qclass_t QCLASS;
+ }
+ Question;
+
+ tnet_dns_rrs_L_t *Answers; /**< Filtered answers by priority. */
+ tnet_dns_rrs_L_t *Authorities;
+ tnet_dns_rrs_L_t *Additionals;
}
tnet_dns_message_t;
diff --git a/tinyNET/src/dns/tnet_dns_mx.c b/tinyNET/src/dns/tnet_dns_mx.c
index edc59b1..5b8b801 100755
--- a/tinyNET/src/dns/tnet_dns_mx.c
+++ b/tinyNET/src/dns/tnet_dns_mx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
*/
tnet_dns_mx_t* tnet_dns_mx_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_mx_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_mx_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -46,50 +46,49 @@ tnet_dns_mx_t* tnet_dns_mx_create(const char* name, tnet_dns_qclass_t qclass, ui
//
static tsk_object_t* tnet_dns_mx_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_mx_t *mx = self;
- if(mx){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_mx_t *mx = self;
+ if(mx) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(mx), qtype_mx, qclass);
- TNET_DNS_RR(mx)->name = tsk_strdup(name);
- TNET_DNS_RR(mx)->rdlength = rdlength;
- TNET_DNS_RR(mx)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(mx), qtype_mx, qclass);
+ TNET_DNS_RR(mx)->name = tsk_strdup(name);
+ TNET_DNS_RR(mx)->rdlength = rdlength;
+ TNET_DNS_RR(mx)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* PREFERENCE */
- mx->preference = tnet_ntohs_2(((uint8_t*)data) + offset);
- offset += 2;
- /* EXCHANGE */
- tnet_dns_rr_qname_deserialize(data, &(mx->exchange), &offset);
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* PREFERENCE */
+ mx->preference = tnet_ntohs_2(((uint8_t*)data) + offset);
+ offset += 2;
+ /* EXCHANGE */
+ tnet_dns_rr_qname_deserialize(data, &(mx->exchange), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_mx_dtor(tsk_object_t * self)
-{
- tnet_dns_mx_t *mx = self;
- if(mx){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(mx));
+static tsk_object_t* tnet_dns_mx_dtor(tsk_object_t * self)
+{
+ tnet_dns_mx_t *mx = self;
+ if(mx) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(mx));
- TSK_FREE(mx->exchange);
- }
- return self;
+ TSK_FREE(mx->exchange);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_mx_def_s =
-{
- sizeof(tnet_dns_mx_t),
- tnet_dns_mx_ctor,
- tnet_dns_mx_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_mx_def_s = {
+ sizeof(tnet_dns_mx_t),
+ tnet_dns_mx_ctor,
+ tnet_dns_mx_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_mx_def_t = &tnet_dns_mx_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_mx.h b/tinyNET/src/dns/tnet_dns_mx.h
index 98a00f1..6c0b999 100755
--- a/tinyNET/src/dns/tnet_dns_mx.h
+++ b/tinyNET/src/dns/tnet_dns_mx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,20 +39,19 @@ TNET_BEGIN_DECLS
/** DNS MX Resource Record
*/
-typedef struct tnet_dns_mx_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_mx_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.3.9. MX RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.3.9. MX RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| PREFERENCE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ EXCHANGE /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- uint16_t preference;
- char* exchange;
+ */
+ uint16_t preference;
+ char* exchange;
}
tnet_dns_mx_t;
diff --git a/tinyNET/src/dns/tnet_dns_naptr.c b/tinyNET/src/dns/tnet_dns_naptr.c
index 79d7f70..c69f168 100755
--- a/tinyNET/src/dns/tnet_dns_naptr.c
+++ b/tinyNET/src/dns/tnet_dns_naptr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,7 +39,7 @@
*/
tnet_dns_naptr_t* tnet_dns_naptr_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_naptr_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_naptr_def_t, name, qclass, ttl, rdlength, data, offset);
}
@@ -49,94 +49,93 @@ tnet_dns_naptr_t* tnet_dns_naptr_create(const char* name, tnet_dns_qclass_t qcla
//
static tsk_object_t* tnet_dns_naptr_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_naptr_t *naptr = self;
- if(naptr){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
-
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(naptr), qtype_naptr, qclass);
- TNET_DNS_RR(naptr)->name = tsk_strdup(name);
- TNET_DNS_RR(naptr)->rdlength = rdlength;
- TNET_DNS_RR(naptr)->ttl = ttl;
-
- if(rdlength){
- // ==> DESERIALIZATION
- /* ORDER */
- naptr->order = tnet_ntohs_2(((uint8_t*)data) + offset);
- offset += 2;
- /* PREFERENCE */
- naptr->preference = tnet_ntohs_2(((uint8_t*)data) + offset);
- offset += 2;
- /* FLAGS */
- tnet_dns_rr_charstring_deserialize(data, &(naptr->flags), &offset);
- /* SERVICES */
- tnet_dns_rr_charstring_deserialize(data, &(naptr->services), &offset);
- /* REGEXP */
- tnet_dns_rr_charstring_deserialize(data, &(naptr->regexp), &offset);
- /* REPLACEMENT */
- tnet_dns_rr_qname_deserialize(data, &(naptr->replacement), &offset);
- }
- }
- return self;
+ tnet_dns_naptr_t *naptr = self;
+ if(naptr) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
+
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(naptr), qtype_naptr, qclass);
+ TNET_DNS_RR(naptr)->name = tsk_strdup(name);
+ TNET_DNS_RR(naptr)->rdlength = rdlength;
+ TNET_DNS_RR(naptr)->ttl = ttl;
+
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* ORDER */
+ naptr->order = tnet_ntohs_2(((uint8_t*)data) + offset);
+ offset += 2;
+ /* PREFERENCE */
+ naptr->preference = tnet_ntohs_2(((uint8_t*)data) + offset);
+ offset += 2;
+ /* FLAGS */
+ tnet_dns_rr_charstring_deserialize(data, &(naptr->flags), &offset);
+ /* SERVICES */
+ tnet_dns_rr_charstring_deserialize(data, &(naptr->services), &offset);
+ /* REGEXP */
+ tnet_dns_rr_charstring_deserialize(data, &(naptr->regexp), &offset);
+ /* REPLACEMENT */
+ tnet_dns_rr_qname_deserialize(data, &(naptr->replacement), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_naptr_dtor(tsk_object_t * self)
-{
- tnet_dns_naptr_t *naptr = self;
- if(naptr){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(naptr));
-
- TSK_FREE(naptr->flags);
- TSK_FREE(naptr->services);
- TSK_FREE(naptr->regexp);
- TSK_FREE(naptr->replacement);
- }
- return self;
+static tsk_object_t* tnet_dns_naptr_dtor(tsk_object_t * self)
+{
+ tnet_dns_naptr_t *naptr = self;
+ if(naptr) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(naptr));
+
+ TSK_FREE(naptr->flags);
+ TSK_FREE(naptr->services);
+ TSK_FREE(naptr->regexp);
+ TSK_FREE(naptr->replacement);
+ }
+ return self;
}
static int tnet_dns_naptr_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
-{
- const tnet_dns_rr_t* rr1 = obj1;
- const tnet_dns_rr_t* rr2 = obj2;
-
- if(rr1 && rr2 && (rr1->qtype==qtype_naptr) && (rr2->qtype==qtype_naptr)){
- const tnet_dns_naptr_t* naptr1 = (tnet_dns_naptr_t*)rr1;
- const tnet_dns_naptr_t* naptr2 = (tnet_dns_naptr_t*)rr2;
-
- /* Compare orders. */
- if(naptr1->order < naptr2->order){ /* Lowest order is tried first. */
- return 1;
- }
- else if(naptr1->order > naptr2->order){
- return -1;
- }
-
- /* Compare preference */
- if(naptr1->order < naptr2->order){ /* Lowest preference is tried first. */
- return 1;
- }
- else if(naptr1->order > naptr2->order){
- return -1;
- }
-
- return 0;
- }
- else{
- return -1;
- }
+{
+ const tnet_dns_rr_t* rr1 = obj1;
+ const tnet_dns_rr_t* rr2 = obj2;
+
+ if(rr1 && rr2 && (rr1->qtype==qtype_naptr) && (rr2->qtype==qtype_naptr)) {
+ const tnet_dns_naptr_t* naptr1 = (tnet_dns_naptr_t*)rr1;
+ const tnet_dns_naptr_t* naptr2 = (tnet_dns_naptr_t*)rr2;
+
+ /* Compare orders. */
+ if(naptr1->order < naptr2->order) { /* Lowest order is tried first. */
+ return 1;
+ }
+ else if(naptr1->order > naptr2->order) {
+ return -1;
+ }
+
+ /* Compare preference */
+ if(naptr1->order < naptr2->order) { /* Lowest preference is tried first. */
+ return 1;
+ }
+ else if(naptr1->order > naptr2->order) {
+ return -1;
+ }
+
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_dns_naptr_def_s =
-{
- sizeof(tnet_dns_naptr_t),
- tnet_dns_naptr_ctor,
- tnet_dns_naptr_dtor,
- tnet_dns_naptr_cmp,
+static const tsk_object_def_t tnet_dns_naptr_def_s = {
+ sizeof(tnet_dns_naptr_t),
+ tnet_dns_naptr_ctor,
+ tnet_dns_naptr_dtor,
+ tnet_dns_naptr_cmp,
};
const tsk_object_def_t *tnet_dns_naptr_def_t = &tnet_dns_naptr_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_naptr.h b/tinyNET/src/dns/tnet_dns_naptr.h
index b960809..f11b970 100755
--- a/tinyNET/src/dns/tnet_dns_naptr.h
+++ b/tinyNET/src/dns/tnet_dns_naptr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,13 +37,12 @@ TNET_BEGIN_DECLS
/** DNS NAPTR Resource Record
*/
-typedef struct tnet_dns_naptr_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_naptr_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 3403 - 4.1 Packet Format
+ /* RFC 3403 - 4.1 Packet Format
- The packet format for the NAPTR record is as follows
+ The packet format for the NAPTR record is as follows
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
@@ -60,14 +59,14 @@ typedef struct tnet_dns_naptr_s
/ REPLACEMENT /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- <character-string> and <domain-name> as used here are defined in RFC 1035.
- */
- uint16_t order;
- uint16_t preference;
- char* flags;
- char* services;
- char* regexp;
- char* replacement;
+ <character-string> and <domain-name> as used here are defined in RFC 1035.
+ */
+ uint16_t order;
+ uint16_t preference;
+ char* flags;
+ char* services;
+ char* regexp;
+ char* replacement;
}
tnet_dns_naptr_t;
diff --git a/tinyNET/src/dns/tnet_dns_ns.c b/tinyNET/src/dns/tnet_dns_ns.c
index a23426c..64d348b 100755
--- a/tinyNET/src/dns/tnet_dns_ns.c
+++ b/tinyNET/src/dns/tnet_dns_ns.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,7 +37,7 @@
*/
tnet_dns_ns_t* tnet_dns_ns_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_ns_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_ns_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -45,48 +45,47 @@ tnet_dns_ns_t* tnet_dns_ns_create(const char* name, tnet_dns_qclass_t qclass, ui
//
static tsk_object_t* tnet_dns_ns_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_ns_t *ns = self;
- if(ns){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_ns_t *ns = self;
+ if(ns) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(ns), qtype_ns, qclass);
- TNET_DNS_RR(ns)->name = tsk_strdup(name);
- TNET_DNS_RR(ns)->rdlength = rdlength;
- TNET_DNS_RR(ns)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(ns), qtype_ns, qclass);
+ TNET_DNS_RR(ns)->name = tsk_strdup(name);
+ TNET_DNS_RR(ns)->rdlength = rdlength;
+ TNET_DNS_RR(ns)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* NSDNAME */
- tnet_dns_rr_qname_deserialize(data, &(ns->nsdname), &offset);
- }
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* NSDNAME */
+ tnet_dns_rr_qname_deserialize(data, &(ns->nsdname), &offset);
+ }
- }
- return self;
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_ns_dtor(tsk_object_t * self)
-{
- tnet_dns_ns_t *ns = self;
- if(ns){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(ns));
+static tsk_object_t* tnet_dns_ns_dtor(tsk_object_t * self)
+{
+ tnet_dns_ns_t *ns = self;
+ if(ns) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(ns));
- TSK_FREE(ns->nsdname);
- }
- return self;
+ TSK_FREE(ns->nsdname);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_ns_def_s =
-{
- sizeof(tnet_dns_ns_t),
- tnet_dns_ns_ctor,
- tnet_dns_ns_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_ns_def_s = {
+ sizeof(tnet_dns_ns_t),
+ tnet_dns_ns_ctor,
+ tnet_dns_ns_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_ns_def_t = &tnet_dns_ns_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_ns.h b/tinyNET/src/dns/tnet_dns_ns.h
index 9a77f26..22b3bf0 100755
--- a/tinyNET/src/dns/tnet_dns_ns.h
+++ b/tinyNET/src/dns/tnet_dns_ns.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,17 +39,16 @@ TNET_BEGIN_DECLS
/** DNS NS Resource Record.
*/
-typedef struct tnet_dns_ns_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_ns_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.3.11. NS RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.3.11. NS RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ NSDNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* nsdname;
+ */
+ char* nsdname;
}
tnet_dns_ns_t;
diff --git a/tinyNET/src/dns/tnet_dns_opt.c b/tinyNET/src/dns/tnet_dns_opt.c
index dab4fea..9ee2421 100755
--- a/tinyNET/src/dns/tnet_dns_opt.c
+++ b/tinyNET/src/dns/tnet_dns_opt.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,7 +34,7 @@
*/
tnet_dns_opt_t* tnet_dns_opt_create(tsk_size_t payload_size)
{
- return tsk_object_new(tnet_dns_opt_def_t, payload_size);
+ return tsk_object_new(tnet_dns_opt_def_t, payload_size);
}
@@ -50,42 +50,41 @@ tnet_dns_opt_t* tnet_dns_opt_create(tsk_size_t payload_size)
//
static tsk_object_t* tnet_dns_opt_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_opt_t *rr_opt = self;
- if(rr_opt){
- uint16_t payload_size = (uint16_t)va_arg(*app, tsk_size_t);
-
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(rr_opt), qtype_opt, qclass_any);
-
- /*
- NAME domain name empty (root domain)
- TYPE u_int16_t OPT
- CLASS u_int16_t sender's UDP payload size
- TTL u_int32_t extended RCODE and flags
- RDLEN u_int16_t describes RDATA
- RDATA octet stream {attribute,value} pairs
-
- */
- TNET_DNS_RR(rr_opt)->qclass = payload_size;
- }
- return self;
+ tnet_dns_opt_t *rr_opt = self;
+ if(rr_opt) {
+ uint16_t payload_size = (uint16_t)va_arg(*app, tsk_size_t);
+
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(rr_opt), qtype_opt, qclass_any);
+
+ /*
+ NAME domain name empty (root domain)
+ TYPE u_int16_t OPT
+ CLASS u_int16_t sender's UDP payload size
+ TTL u_int32_t extended RCODE and flags
+ RDLEN u_int16_t describes RDATA
+ RDATA octet stream {attribute,value} pairs
+
+ */
+ TNET_DNS_RR(rr_opt)->qclass = payload_size;
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_opt_dtor(tsk_object_t * self)
-{
- tnet_dns_opt_t *rr_opt = self;
- if(rr_opt){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(rr_opt));
- }
- return self;
+static tsk_object_t* tnet_dns_opt_dtor(tsk_object_t * self)
+{
+ tnet_dns_opt_t *rr_opt = self;
+ if(rr_opt) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(rr_opt));
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_opt_def_s =
-{
- sizeof(tnet_dns_opt_t),
- tnet_dns_opt_ctor,
- tnet_dns_opt_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_opt_def_s = {
+ sizeof(tnet_dns_opt_t),
+ tnet_dns_opt_ctor,
+ tnet_dns_opt_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_opt_def_t = &tnet_dns_opt_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_opt.h b/tinyNET/src/dns/tnet_dns_opt.h
index 24485b9..ea6bd1d 100755
--- a/tinyNET/src/dns/tnet_dns_opt.h
+++ b/tinyNET/src/dns/tnet_dns_opt.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,9 +38,8 @@ TNET_BEGIN_DECLS
/** DNS OPT Resource Record
*/
-typedef struct tnet_dns_opt_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_opt_s {
+ TNET_DECLARE_DNS_RR;
}
tnet_dns_opt_t;
diff --git a/tinyNET/src/dns/tnet_dns_ptr.c b/tinyNET/src/dns/tnet_dns_ptr.c
index 23b7733..494fd57 100755
--- a/tinyNET/src/dns/tnet_dns_ptr.c
+++ b/tinyNET/src/dns/tnet_dns_ptr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,7 +39,7 @@
tnet_dns_ptr_t* tnet_dns_ptr_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void*data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_ptr_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_ptr_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -47,47 +47,46 @@ tnet_dns_ptr_t* tnet_dns_ptr_create(const char* name, tnet_dns_qclass_t qclass,
//
static tsk_object_t* tnet_dns_ptr_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_ptr_t *ptr = self;
- if(ptr){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_ptr_t *ptr = self;
+ if(ptr) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(ptr), qtype_ptr, qclass);
- TNET_DNS_RR(ptr)->name = tsk_strdup(name);
- TNET_DNS_RR(ptr)->rdlength = rdlength;
- TNET_DNS_RR(ptr)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(ptr), qtype_ptr, qclass);
+ TNET_DNS_RR(ptr)->name = tsk_strdup(name);
+ TNET_DNS_RR(ptr)->rdlength = rdlength;
+ TNET_DNS_RR(ptr)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* PTRDNAME */
- tnet_dns_rr_qname_deserialize(data, &(ptr->ptrdname), &offset);
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* PTRDNAME */
+ tnet_dns_rr_qname_deserialize(data, &(ptr->ptrdname), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_ptr_dtor(tsk_object_t * self)
-{
- tnet_dns_ptr_t *ptr = self;
- if(ptr){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(ptr));
+static tsk_object_t* tnet_dns_ptr_dtor(tsk_object_t * self)
+{
+ tnet_dns_ptr_t *ptr = self;
+ if(ptr) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(ptr));
- TSK_FREE(ptr->ptrdname);
- }
- return self;
+ TSK_FREE(ptr->ptrdname);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_ptr_def_s =
-{
- sizeof(tnet_dns_ptr_t),
- tnet_dns_ptr_ctor,
- tnet_dns_ptr_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_ptr_def_s = {
+ sizeof(tnet_dns_ptr_t),
+ tnet_dns_ptr_ctor,
+ tnet_dns_ptr_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_ptr_def_t = &tnet_dns_ptr_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_ptr.h b/tinyNET/src/dns/tnet_dns_ptr.h
index fc2cbdc..778366c 100755
--- a/tinyNET/src/dns/tnet_dns_ptr.h
+++ b/tinyNET/src/dns/tnet_dns_ptr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,16 +38,15 @@ TNET_BEGIN_DECLS
/** DNS PTR Resource Record
*/
-typedef struct tnet_dns_ptr_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_ptr_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.3.12. PTR RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.3.12. PTR RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ PTRDNAME /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* ptrdname;
+ */
+ char* ptrdname;
}
tnet_dns_ptr_t;
diff --git a/tinyNET/src/dns/tnet_dns_regexp.c b/tinyNET/src/dns/tnet_dns_regexp.c
index 5cafeb8..ea2f5d8 100755
--- a/tinyNET/src/dns/tnet_dns_regexp.c
+++ b/tinyNET/src/dns/tnet_dns_regexp.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tnet_dns_regexp.rl" */
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,241 +46,252 @@
*/
char* tnet_dns_regex_parse(const char* e164num, const char* regexp)
{
- char* ret = tsk_null;
- char* prefix = tsk_null;
- const char* tag_start;
- tsk_size_t e164len;
-
- // Ragel
- int cs = 0;
- const char *p = tag_start = regexp;
- const char *pe;
- const char *eof;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 63 "./src/dns/tnet_dns_regexp.c" */
-static const char _tdns_machine_regexp_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 1, 2, 0, 2, 2, 2, 0,
- 2, 3, 0, 3, 3, 0, 2
-};
-
-static const char _tdns_machine_regexp_key_offsets[] = {
- 0, 0, 1, 2, 5, 6, 7, 8,
- 9, 10, 11, 13, 15, 17, 19, 21,
- 23, 25, 26, 27
-};
-
-static const char _tdns_machine_regexp_trans_keys[] = {
- 33, 94, 40, 46, 92, 40, 46, 42,
- 41, 36, 33, 33, 92, 33, 92, 48,
- 57, 33, 92, 33, 92, 40, 42, 36,
- 40, 40, 105, 0
-};
-
-static const char _tdns_machine_regexp_single_lengths[] = {
- 0, 1, 1, 3, 1, 1, 1, 1,
- 1, 1, 2, 2, 0, 2, 2, 2,
- 2, 1, 1, 0
-};
-
-static const char _tdns_machine_regexp_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-static const char _tdns_machine_regexp_index_offsets[] = {
- 0, 0, 2, 4, 8, 10, 12, 14,
- 16, 18, 20, 23, 26, 28, 31, 34,
- 37, 40, 42, 44
-};
-
-static const char _tdns_machine_regexp_trans_targs[] = {
- 2, 0, 3, 0, 5, 15, 17, 4,
- 5, 4, 6, 0, 7, 0, 8, 0,
- 9, 0, 10, 0, 18, 12, 11, 18,
- 12, 11, 13, 0, 18, 0, 14, 18,
- 0, 14, 5, 16, 4, 9, 5, 4,
- 5, 4, 19, 0, 0, 0
-};
-
-static const char _tdns_machine_regexp_trans_actions[] = {
- 0, 0, 0, 0, 7, 1, 0, 1,
- 3, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 10, 10, 10, 13,
- 13, 13, 0, 0, 19, 0, 16, 5,
- 0, 0, 3, 0, 0, 0, 3, 0,
- 7, 1, 0, 0, 0, 0
-};
-
-static const int tdns_machine_regexp_start = 1;
-static const int tdns_machine_regexp_first_final = 18;
-static const int tdns_machine_regexp_error = 0;
-
-static const int tdns_machine_regexp_en_main = 1;
-
-
-/* #line 96 "./ragel/tnet_dns_regexp.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
- (void)(eof);
- (void)(tdns_machine_regexp_first_final);
- (void)(tdns_machine_regexp_error);
- (void)(tdns_machine_regexp_en_main);
-
- if (!e164num) {
- goto bail;
- }
-
- if (!regexp) {
- ret = tsk_strdup(e164num);
- goto bail;
- }
-
- e164len = (tsk_size_t)tsk_strlen(e164num);
- pe = p + tsk_strlen(regexp);
- eof = pe;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 148 "./src/dns/tnet_dns_regexp.c" */
- {
- cs = tdns_machine_regexp_start;
- }
-
-/* #line 117 "./ragel/tnet_dns_regexp.rl" */
-
-/* #line 155 "./src/dns/tnet_dns_regexp.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ char* ret = tsk_null;
+ char* prefix = tsk_null;
+ const char* tag_start;
+ tsk_size_t e164len;
+
+ // Ragel
+ int cs = 0;
+ const char *p = tag_start = regexp;
+ const char *pe;
+ const char *eof;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 63 "./src/dns/tnet_dns_regexp.c" */
+ static const char _tdns_machine_regexp_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 1, 2, 0, 2, 2, 2, 0,
+ 2, 3, 0, 3, 3, 0, 2
+ };
+
+ static const char _tdns_machine_regexp_key_offsets[] = {
+ 0, 0, 1, 2, 5, 6, 7, 8,
+ 9, 10, 11, 13, 15, 17, 19, 21,
+ 23, 25, 26, 27
+ };
+
+ static const char _tdns_machine_regexp_trans_keys[] = {
+ 33, 94, 40, 46, 92, 40, 46, 42,
+ 41, 36, 33, 33, 92, 33, 92, 48,
+ 57, 33, 92, 33, 92, 40, 42, 36,
+ 40, 40, 105, 0
+ };
+
+ static const char _tdns_machine_regexp_single_lengths[] = {
+ 0, 1, 1, 3, 1, 1, 1, 1,
+ 1, 1, 2, 2, 0, 2, 2, 2,
+ 2, 1, 1, 0
+ };
+
+ static const char _tdns_machine_regexp_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0
+ };
+
+ static const char _tdns_machine_regexp_index_offsets[] = {
+ 0, 0, 2, 4, 8, 10, 12, 14,
+ 16, 18, 20, 23, 26, 28, 31, 34,
+ 37, 40, 42, 44
+ };
+
+ static const char _tdns_machine_regexp_trans_targs[] = {
+ 2, 0, 3, 0, 5, 15, 17, 4,
+ 5, 4, 6, 0, 7, 0, 8, 0,
+ 9, 0, 10, 0, 18, 12, 11, 18,
+ 12, 11, 13, 0, 18, 0, 14, 18,
+ 0, 14, 5, 16, 4, 9, 5, 4,
+ 5, 4, 19, 0, 0, 0
+ };
+
+ static const char _tdns_machine_regexp_trans_actions[] = {
+ 0, 0, 0, 0, 7, 1, 0, 1,
+ 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 10, 10, 10, 13,
+ 13, 13, 0, 0, 19, 0, 16, 5,
+ 0, 0, 3, 0, 0, 0, 3, 0,
+ 7, 1, 0, 0, 0, 0
+ };
+
+ static const int tdns_machine_regexp_start = 1;
+ static const int tdns_machine_regexp_first_final = 18;
+ static const int tdns_machine_regexp_error = 0;
+
+ static const int tdns_machine_regexp_en_main = 1;
+
+
+ /* #line 96 "./ragel/tnet_dns_regexp.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+ (void)(eof);
+ (void)(tdns_machine_regexp_first_final);
+ (void)(tdns_machine_regexp_error);
+ (void)(tdns_machine_regexp_en_main);
+
+ if (!e164num) {
+ goto bail;
+ }
+
+ if (!regexp) {
+ ret = tsk_strdup(e164num);
+ goto bail;
+ }
+
+ e164len = (tsk_size_t)tsk_strlen(e164num);
+ pe = p + tsk_strlen(regexp);
+ eof = pe;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 148 "./src/dns/tnet_dns_regexp.c" */
+ {
+ cs = tdns_machine_regexp_start;
+ }
+
+ /* #line 117 "./ragel/tnet_dns_regexp.rl" */
+
+ /* #line 155 "./src/dns/tnet_dns_regexp.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tdns_machine_regexp_trans_keys + _tdns_machine_regexp_key_offsets[cs];
- _trans = _tdns_machine_regexp_index_offsets[cs];
-
- _klen = _tdns_machine_regexp_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tdns_machine_regexp_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tdns_machine_regexp_trans_keys + _tdns_machine_regexp_key_offsets[cs];
+ _trans = _tdns_machine_regexp_index_offsets[cs];
+
+ _klen = _tdns_machine_regexp_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tdns_machine_regexp_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tdns_machine_regexp_trans_targs[_trans];
-
- if ( _tdns_machine_regexp_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tdns_machine_regexp_actions + _tdns_machine_regexp_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 36 "./ragel/tnet_dns_regexp.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 40 "./ragel/tnet_dns_regexp.rl" */
- {
- TSK_PARSER_SET_STRING(prefix);
- }
- break;
- case 2:
-/* #line 44 "./ragel/tnet_dns_regexp.rl" */
- {
- int len = (int)(p - tag_start);
- if (len) {
- tsk_strncat(&ret, tag_start, len);
- }
- }
- break;
- case 3:
-/* #line 51 "./ragel/tnet_dns_regexp.rl" */
- {
- if (prefix) {
- int prefixlen = (int)tsk_strlen(prefix);
- tsk_strncat(&ret, e164num + prefixlen, (e164len - prefixlen));
- }
- }
- break;
-/* #line 258 "./src/dns/tnet_dns_regexp.c" */
- }
- }
+ cs = _tdns_machine_regexp_trans_targs[_trans];
+
+ if ( _tdns_machine_regexp_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tdns_machine_regexp_actions + _tdns_machine_regexp_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 36 "./ragel/tnet_dns_regexp.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 40 "./ragel/tnet_dns_regexp.rl" */
+ {
+ TSK_PARSER_SET_STRING(prefix);
+ }
+ break;
+ case 2:
+ /* #line 44 "./ragel/tnet_dns_regexp.rl" */
+ {
+ int len = (int)(p - tag_start);
+ if (len) {
+ tsk_strncat(&ret, tag_start, len);
+ }
+ }
+ break;
+ case 3:
+ /* #line 51 "./ragel/tnet_dns_regexp.rl" */
+ {
+ if (prefix) {
+ int prefixlen = (int)tsk_strlen(prefix);
+ tsk_strncat(&ret, e164num + prefixlen, (e164len - prefixlen));
+ }
+ }
+ break;
+ /* #line 258 "./src/dns/tnet_dns_regexp.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 118 "./ragel/tnet_dns_regexp.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if (cs <
-/* #line 275 "./src/dns/tnet_dns_regexp.c" */
-18
-/* #line 120 "./ragel/tnet_dns_regexp.rl" */
- ){
- TSK_DEBUG_ERROR("regexp substitition failed.");
- TSK_FREE(ret);
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 118 "./ragel/tnet_dns_regexp.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if (cs <
+ /* #line 275 "./src/dns/tnet_dns_regexp.c" */
+ 18
+ /* #line 120 "./ragel/tnet_dns_regexp.rl" */
+ ) {
+ TSK_DEBUG_ERROR("regexp substitition failed.");
+ TSK_FREE(ret);
+ }
bail:
- TSK_FREE(prefix);
-
- return ret;
+ TSK_FREE(prefix);
+
+ return ret;
}
diff --git a/tinyNET/src/dns/tnet_dns_regexp.h b/tinyNET/src/dns/tnet_dns_regexp.h
index d40abce..6fab026 100755
--- a/tinyNET/src/dns/tnet_dns_regexp.h
+++ b/tinyNET/src/dns/tnet_dns_regexp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/dns/tnet_dns_resolvconf.c b/tinyNET/src/dns/tnet_dns_resolvconf.c
index a4a0fbf..b77ba8f 100755
--- a/tinyNET/src/dns/tnet_dns_resolvconf.c
+++ b/tinyNET/src/dns/tnet_dns_resolvconf.c
@@ -9,12 +9,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,265 +50,273 @@
*/
tnet_addresses_L_t * tnet_dns_resolvconf_parse(const char* path)
{
- tnet_addresses_L_t* servers = tsk_null;
- tnet_ip_t ip;
- const char* fullpath = path;
- const char* tag_start = tsk_null;
- FILE* fd;
- char* buf = tsk_null;
-
- // Ragel
- int cs = 0;
- const char *p;
- const char *pe;
- const char *eof;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 69 "./src/dns/tnet_dns_resolvconf.c" */
-static const char _tdns_machine_resolvconf_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tdns_machine_resolvconf_key_offsets[] = {
- 0, 7, 8, 9, 12, 15, 15, 22,
- 24, 27, 30, 33, 36, 39, 42, 45,
- 48, 51, 52, 53, 56
-};
-
-static const char _tdns_machine_resolvconf_trans_keys[] = {
- 10, 13, 32, 35, 59, 78, 110, 32,
- 32, 10, 13, 32, 10, 13, 32, 10,
- 13, 32, 35, 59, 78, 110, 10, 13,
- 32, 65, 97, 32, 77, 109, 32, 69,
- 101, 32, 83, 115, 32, 69, 101, 32,
- 82, 114, 32, 86, 118, 32, 69, 101,
- 32, 82, 114, 32, 32, 10, 13, 32,
- 32, 35, 59, 78, 110, 0
-};
-
-static const char _tdns_machine_resolvconf_single_lengths[] = {
- 7, 1, 1, 3, 3, 0, 7, 2,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 1, 1, 3, 5
-};
-
-static const char _tdns_machine_resolvconf_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0
-};
-
-static const char _tdns_machine_resolvconf_index_offsets[] = {
- 0, 8, 10, 12, 16, 20, 21, 29,
- 32, 36, 40, 44, 48, 52, 56, 60,
- 64, 68, 70, 72, 76
-};
-
-static const char _tdns_machine_resolvconf_indicies[] = {
- 1, 1, 2, 3, 3, 4, 4, 0,
- 5, 0, 5, 6, 7, 7, 8, 6,
- 7, 7, 8, 9, 9, 1, 1, 5,
- 3, 3, 4, 4, 0, 7, 7, 3,
- 5, 10, 10, 0, 5, 11, 11, 0,
- 5, 12, 12, 0, 5, 13, 13, 0,
- 5, 14, 14, 0, 5, 15, 15, 0,
- 5, 16, 16, 0, 5, 17, 17, 0,
- 5, 18, 18, 0, 19, 0, 19, 20,
- 22, 22, 23, 21, 2, 3, 3, 4,
- 4, 0, 0
-};
-
-static const char _tdns_machine_resolvconf_trans_targs[] = {
- 1, 6, 20, 7, 8, 2, 3, 0,
- 4, 5, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 19, 0, 4
-};
-
-static const char _tdns_machine_resolvconf_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 3, 3
-};
-
-static const int tdns_machine_resolvconf_start = 0;
-static const int tdns_machine_resolvconf_first_final = 0;
-static const int tdns_machine_resolvconf_error = -1;
-
-static const int tdns_machine_resolvconf_en_main = 0;
-
-
-/* #line 101 "./ragel/tnet_dns_resolvconf.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
- (void)(eof);
- (void)(tdns_machine_resolvconf_first_final);
- (void)(tdns_machine_resolvconf_error);
- (void)(tdns_machine_resolvconf_en_main);
-
- if(tsk_strnullORempty(fullpath)){
- fullpath = TNET_RESOLV_CONF_PATH;
- }
-
- /* Open the file and read all data */
- if((fd = fopen(fullpath, "r"))){
- long len;
- fseek(fd, 0L, SEEK_END);
- len = ftell(fd);
- fseek(fd, 0L, SEEK_SET);
- if (!(buf = (char*)tsk_calloc(len + 1, 1))) {
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %ld", (len + 1));
- goto bail;
- }
- fread(buf, 1, len, fd);
- p = &buf[0];
- pe = p + len + 1/*hack*/;
- eof = pe;
- fclose(fd);
-
- buf[len] = '\n'; // hack to have perfect lines
-
- servers = tsk_list_create();
- }
- else {
+ tnet_addresses_L_t* servers = tsk_null;
+ tnet_ip_t ip;
+ const char* fullpath = path;
+ const char* tag_start = tsk_null;
+ FILE* fd;
+ char* buf = tsk_null;
+
+ // Ragel
+ int cs = 0;
+ const char *p;
+ const char *pe;
+ const char *eof;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 69 "./src/dns/tnet_dns_resolvconf.c" */
+ static const char _tdns_machine_resolvconf_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tdns_machine_resolvconf_key_offsets[] = {
+ 0, 7, 8, 9, 12, 15, 15, 22,
+ 24, 27, 30, 33, 36, 39, 42, 45,
+ 48, 51, 52, 53, 56
+ };
+
+ static const char _tdns_machine_resolvconf_trans_keys[] = {
+ 10, 13, 32, 35, 59, 78, 110, 32,
+ 32, 10, 13, 32, 10, 13, 32, 10,
+ 13, 32, 35, 59, 78, 110, 10, 13,
+ 32, 65, 97, 32, 77, 109, 32, 69,
+ 101, 32, 83, 115, 32, 69, 101, 32,
+ 82, 114, 32, 86, 118, 32, 69, 101,
+ 32, 82, 114, 32, 32, 10, 13, 32,
+ 32, 35, 59, 78, 110, 0
+ };
+
+ static const char _tdns_machine_resolvconf_single_lengths[] = {
+ 7, 1, 1, 3, 3, 0, 7, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 1, 1, 3, 5
+ };
+
+ static const char _tdns_machine_resolvconf_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0
+ };
+
+ static const char _tdns_machine_resolvconf_index_offsets[] = {
+ 0, 8, 10, 12, 16, 20, 21, 29,
+ 32, 36, 40, 44, 48, 52, 56, 60,
+ 64, 68, 70, 72, 76
+ };
+
+ static const char _tdns_machine_resolvconf_indicies[] = {
+ 1, 1, 2, 3, 3, 4, 4, 0,
+ 5, 0, 5, 6, 7, 7, 8, 6,
+ 7, 7, 8, 9, 9, 1, 1, 5,
+ 3, 3, 4, 4, 0, 7, 7, 3,
+ 5, 10, 10, 0, 5, 11, 11, 0,
+ 5, 12, 12, 0, 5, 13, 13, 0,
+ 5, 14, 14, 0, 5, 15, 15, 0,
+ 5, 16, 16, 0, 5, 17, 17, 0,
+ 5, 18, 18, 0, 19, 0, 19, 20,
+ 22, 22, 23, 21, 2, 3, 3, 4,
+ 4, 0, 0
+ };
+
+ static const char _tdns_machine_resolvconf_trans_targs[] = {
+ 1, 6, 20, 7, 8, 2, 3, 0,
+ 4, 5, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 19, 0, 4
+ };
+
+ static const char _tdns_machine_resolvconf_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 3, 3
+ };
+
+ static const int tdns_machine_resolvconf_start = 0;
+ static const int tdns_machine_resolvconf_first_final = 0;
+ static const int tdns_machine_resolvconf_error = -1;
+
+ static const int tdns_machine_resolvconf_en_main = 0;
+
+
+ /* #line 101 "./ragel/tnet_dns_resolvconf.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+ (void)(eof);
+ (void)(tdns_machine_resolvconf_first_final);
+ (void)(tdns_machine_resolvconf_error);
+ (void)(tdns_machine_resolvconf_en_main);
+
+ if(tsk_strnullORempty(fullpath)) {
+ fullpath = TNET_RESOLV_CONF_PATH;
+ }
+
+ /* Open the file and read all data */
+ if((fd = fopen(fullpath, "r"))) {
+ long len;
+ fseek(fd, 0L, SEEK_END);
+ len = ftell(fd);
+ fseek(fd, 0L, SEEK_SET);
+ if (!(buf = (char*)tsk_calloc(len + 1, 1))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %ld", (len + 1));
+ goto bail;
+ }
+ fread(buf, 1, len, fd);
+ p = &buf[0];
+ pe = p + len + 1/*hack*/;
+ eof = pe;
+ fclose(fd);
+
+ buf[len] = '\n'; // hack to have perfect lines
+
+ servers = tsk_list_create();
+ }
+ else {
#if ANDROID || defined(__APPLE__) /* TARGET_OS_IPHONE not defined for bsd libraries */
- TSK_DEBUG_INFO("Failed to open [%s]. But don't panic, we have detected that you are using Google Android/iOS Systems.\n"
- "You should look at the Progammer's Guide for more information.\n If you are not using DNS functions, don't worry about this warning.",
- fullpath);
+ TSK_DEBUG_INFO("Failed to open [%s]. But don't panic, we have detected that you are using Google Android/iOS Systems.\n"
+ "You should look at the Progammer's Guide for more information.\n If you are not using DNS functions, don't worry about this warning.",
+ fullpath);
#else
- TSK_DEBUG_ERROR("Failed to open %s.", fullpath);
+ TSK_DEBUG_ERROR("Failed to open %s.", fullpath);
#endif
- goto bail;
- }
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 186 "./src/dns/tnet_dns_resolvconf.c" */
- {
- cs = tdns_machine_resolvconf_start;
- }
-
-/* #line 144 "./ragel/tnet_dns_resolvconf.rl" */
-
-/* #line 193 "./src/dns/tnet_dns_resolvconf.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
+ goto bail;
+ }
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 186 "./src/dns/tnet_dns_resolvconf.c" */
+ {
+ cs = tdns_machine_resolvconf_start;
+ }
+
+ /* #line 144 "./ragel/tnet_dns_resolvconf.rl" */
+
+ /* #line 193 "./src/dns/tnet_dns_resolvconf.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
_resume:
- _keys = _tdns_machine_resolvconf_trans_keys + _tdns_machine_resolvconf_key_offsets[cs];
- _trans = _tdns_machine_resolvconf_index_offsets[cs];
-
- _klen = _tdns_machine_resolvconf_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tdns_machine_resolvconf_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tdns_machine_resolvconf_trans_keys + _tdns_machine_resolvconf_key_offsets[cs];
+ _trans = _tdns_machine_resolvconf_index_offsets[cs];
+
+ _klen = _tdns_machine_resolvconf_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tdns_machine_resolvconf_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tdns_machine_resolvconf_indicies[_trans];
- cs = _tdns_machine_resolvconf_trans_targs[_trans];
-
- if ( _tdns_machine_resolvconf_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tdns_machine_resolvconf_actions + _tdns_machine_resolvconf_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tnet_dns_resolvconf.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tnet_dns_resolvconf.rl" */
- {
- int len = (int)(p - tag_start);
- if(len && len<=sizeof(ip)){
- tnet_address_t *address;
- memset(ip, '\0', sizeof(ip));
- memcpy(ip, tag_start, len);
- TSK_DEBUG_INFO("Adding DNS server = %s:%d", ip, TNET_DNS_SERVER_PORT_DEFAULT);
-
- address = tnet_address_create(ip);
- address->family = tnet_get_family(ip, TNET_DNS_SERVER_PORT_DEFAULT);
- address->dnsserver = 1;
- tsk_list_push_ascending_data(servers, (void**)&address);
- }
- }
- break;
-/* #line 288 "./src/dns/tnet_dns_resolvconf.c" */
- }
- }
+ _trans = _tdns_machine_resolvconf_indicies[_trans];
+ cs = _tdns_machine_resolvconf_trans_targs[_trans];
+
+ if ( _tdns_machine_resolvconf_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tdns_machine_resolvconf_actions + _tdns_machine_resolvconf_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tnet_dns_resolvconf.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tnet_dns_resolvconf.rl" */
+ {
+ int len = (int)(p - tag_start);
+ if(len && len<=sizeof(ip)) {
+ tnet_address_t *address;
+ memset(ip, '\0', sizeof(ip));
+ memcpy(ip, tag_start, len);
+ TSK_DEBUG_INFO("Adding DNS server = %s:%d", ip, TNET_DNS_SERVER_PORT_DEFAULT);
+
+ address = tnet_address_create(ip);
+ address->family = tnet_get_family(ip, TNET_DNS_SERVER_PORT_DEFAULT);
+ address->dnsserver = 1;
+ tsk_list_push_ascending_data(servers, (void**)&address);
+ }
+ }
+ break;
+ /* #line 288 "./src/dns/tnet_dns_resolvconf.c" */
+ }
+ }
_again:
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- }
-
-/* #line 145 "./ragel/tnet_dns_resolvconf.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if (cs <
-/* #line 302 "./src/dns/tnet_dns_resolvconf.c" */
-0
-/* #line 147 "./ragel/tnet_dns_resolvconf.rl" */
- ) {
- TSK_DEBUG_ERROR("Failed to parse %s.", fullpath);
- TSK_OBJECT_SAFE_FREE(servers);
- }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ }
+
+ /* #line 145 "./ragel/tnet_dns_resolvconf.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if (cs <
+ /* #line 302 "./src/dns/tnet_dns_resolvconf.c" */
+ 0
+ /* #line 147 "./ragel/tnet_dns_resolvconf.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse %s.", fullpath);
+ TSK_OBJECT_SAFE_FREE(servers);
+ }
bail:
- TSK_FREE(buf);
- return servers;
+ TSK_FREE(buf);
+ return servers;
}
diff --git a/tinyNET/src/dns/tnet_dns_resolvconf.h b/tinyNET/src/dns/tnet_dns_resolvconf.h
index 5290c41..53c5b70 100755
--- a/tinyNET/src/dns/tnet_dns_resolvconf.h
+++ b/tinyNET/src/dns/tnet_dns_resolvconf.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/dns/tnet_dns_rr.c b/tinyNET/src/dns/tnet_dns_rr.c
index b74a31d..eb5125a 100755
--- a/tinyNET/src/dns/tnet_dns_rr.c
+++ b/tinyNET/src/dns/tnet_dns_rr.c
@@ -50,7 +50,7 @@
tnet_dns_rr_t* tnet_dns_rr_create()
{
- return tsk_object_new(tnet_dns_rr_def_t);
+ return tsk_object_new(tnet_dns_rr_def_t);
}
/** Initializes any DNS RR (either NAPTR or SRV ...).
@@ -61,17 +61,17 @@ tnet_dns_rr_t* tnet_dns_rr_create()
*/
int tnet_dns_rr_init(tnet_dns_rr_t *rr, tnet_dns_qtype_t qtype, tnet_dns_qclass_t qclass)
{
- if (rr){
- if (!rr->initialized){
- rr->qtype = qtype;
- rr->qclass = qclass;
-
- rr->initialized = tsk_true;
- return 0;
- }
- return -2;
- }
- return -1;
+ if (rr) {
+ if (!rr->initialized) {
+ rr->qtype = qtype;
+ rr->qclass = qclass;
+
+ rr->initialized = tsk_true;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
/** Deinitializes any DNS RR (either NAPTR or SRV ...).
@@ -80,79 +80,79 @@ int tnet_dns_rr_init(tnet_dns_rr_t *rr, tnet_dns_qtype_t qtype, tnet_dns_qclass_
*/
int tnet_dns_rr_deinit(tnet_dns_rr_t *rr)
{
- if (rr){
- if (rr->initialized){
- TSK_FREE(rr->name);
- TSK_FREE(rr->rpdata);
-
- rr->initialized = tsk_false;
- return 0;
- }
- return -2;
- }
- return -1;
+ if (rr) {
+ if (rr->initialized) {
+ TSK_FREE(rr->name);
+ TSK_FREE(rr->rpdata);
+
+ rr->initialized = tsk_false;
+ return 0;
+ }
+ return -2;
+ }
+ return -1;
}
/** Deserialize <character-string>.
*/
int tnet_dns_rr_charstring_deserialize(const void* data, char** charstring, tsk_size_t *offset)
{
- /* RFC 1035 - 3.3. Standard RRs
- <character-string> is a single length octet followed by that number of characters.
- <character-string> is treated as binary information, and can be up to 256 characters in
- length (including the length octet).
- */
- uint8_t* dataPtr = (((uint8_t*)data) + *offset);
- uint8_t length = *dataPtr;
-
- *charstring = tsk_strndup((const char*)(dataPtr + 1), length);
- *offset += (1 + length);
-
- return 0;
+ /* RFC 1035 - 3.3. Standard RRs
+ <character-string> is a single length octet followed by that number of characters.
+ <character-string> is treated as binary information, and can be up to 256 characters in
+ length (including the length octet).
+ */
+ uint8_t* dataPtr = (((uint8_t*)data) + *offset);
+ uint8_t length = *dataPtr;
+
+ *charstring = tsk_strndup((const char*)(dataPtr + 1), length);
+ *offset += (1 + length);
+
+ return 0;
}
/** Deserializes a QName.
*/
int tnet_dns_rr_qname_deserialize(const void* data, char** name, tsk_size_t *offset)
{
- /* RFC 1035 - 4.1.4. Message compression
+ /* RFC 1035 - 4.1.4. Message compression
- The pointer takes the form of a two octet sequence:
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | 1 1| OFFSET |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- uint8_t* dataPtr = (((uint8_t*)data) + *offset);
- unsigned usingPtr = 0; /* Do not change. */
+ The pointer takes the form of a two octet sequence:
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | 1 1| OFFSET |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ */
+ uint8_t* dataPtr = (((uint8_t*)data) + *offset);
+ unsigned usingPtr = 0; /* Do not change. */
- while (*dataPtr){
- usingPtr = ((*dataPtr & 0xC0) == 0xC0);
+ while (*dataPtr) {
+ usingPtr = ((*dataPtr & 0xC0) == 0xC0);
- if (usingPtr){
- tsk_size_t ptr_offset = (*dataPtr & 0x3F);
- ptr_offset = ptr_offset << 8 | *(dataPtr + 1);
+ if (usingPtr) {
+ tsk_size_t ptr_offset = (*dataPtr & 0x3F);
+ ptr_offset = ptr_offset << 8 | *(dataPtr + 1);
- *offset += 2;
- return tnet_dns_rr_qname_deserialize(data, name, &ptr_offset);
- }
- else{
- uint8_t length;
+ *offset += 2;
+ return tnet_dns_rr_qname_deserialize(data, name, &ptr_offset);
+ }
+ else {
+ uint8_t length;
- if (*name){
- tsk_strcat(name, ".");
- }
+ if (*name) {
+ tsk_strcat(name, ".");
+ }
- length = *dataPtr;
- *offset += 1, dataPtr++;
+ length = *dataPtr;
+ *offset += 1, dataPtr++;
- tsk_strncat(name, (const char*)dataPtr, length);
- *offset += length, dataPtr += length;
- }
- }
+ tsk_strncat(name, (const char*)dataPtr, length);
+ *offset += length, dataPtr += length;
+ }
+ }
- *offset += 1;
+ *offset += 1;
- return 0;
+ return 0;
}
//int tnet_dns_rr_qname_deserialize(const void* data, tsk_size_t size, char** name, tsk_size_t *offset)
@@ -179,7 +179,7 @@ int tnet_dns_rr_qname_deserialize(const void* data, char** name, tsk_size_t *off
// uint16_t ptr_offset = (*dataPtr & 0x3F);
// ptr_offset = ptr_offset << 8 | *(dataPtr+1);
// Ptr = ((uint8_t*)data) + ptr_offset;
-//
+//
// tnet_qname_label_parse(Ptr, (dataEnd - Ptr), name, &islast);
// *offset += 2, dataPtr += 2;
// }
@@ -199,221 +199,208 @@ int tnet_dns_rr_qname_deserialize(const void* data, char** name, tsk_size_t *off
*/
int tnet_dns_rr_qname_serialize(const char* qname, tsk_buffer_t* output)
{
- /*
- QNAME a domain name represented as a sequence of labels, where
- each label consists of a length octet followed by that
- number of octets. The domain name terminates with the
- zero length octet for the null label of the root. Note
- that this field may be an odd number of octets; no
- padding is used.
-
- Example: "doubango.com" ==> 8doubango3comNULL
- */
- static uint8_t null = 0;
-
- if (qname){
- char* saveptr;
- char* _qname = tsk_strdup(qname);
- char* label = tsk_strtok_r(_qname, ".", &saveptr);
-
- while (label){
- uint8_t length = (uint8_t)tsk_strlen(label);
- tsk_buffer_append(output, &length, 1);
- tsk_buffer_append(output, label, tsk_strlen(label));
-
- label = tsk_strtok_r(tsk_null, ".", &saveptr);
- }
-
- TSK_FREE(_qname);
- }
-
- /* terminates domain name */
- tsk_buffer_append(output, &null, 1);
-
- return 0;
+ /*
+ QNAME a domain name represented as a sequence of labels, where
+ each label consists of a length octet followed by that
+ number of octets. The domain name terminates with the
+ zero length octet for the null label of the root. Note
+ that this field may be an odd number of octets; no
+ padding is used.
+
+ Example: "doubango.com" ==> 8doubango3comNULL
+ */
+ static uint8_t null = 0;
+
+ if (qname) {
+ char* saveptr;
+ char* _qname = tsk_strdup(qname);
+ char* label = tsk_strtok_r(_qname, ".", &saveptr);
+
+ while (label) {
+ uint8_t length = (uint8_t)tsk_strlen(label);
+ tsk_buffer_append(output, &length, 1);
+ tsk_buffer_append(output, label, tsk_strlen(label));
+
+ label = tsk_strtok_r(tsk_null, ".", &saveptr);
+ }
+
+ TSK_FREE(_qname);
+ }
+
+ /* terminates domain name */
+ tsk_buffer_append(output, &null, 1);
+
+ return 0;
}
/** Deserializes a DNS RR.
*/
tnet_dns_rr_t* tnet_dns_rr_deserialize(const void* data, tsk_size_t size, tsk_size_t* offset)
{
- tnet_dns_rr_t *rr = tsk_null;
- uint8_t* dataStart = (uint8_t*)data;
- uint8_t* dataPtr = (dataStart + *offset);
- //uint8_t* dataEnd = (dataPtr+size);
- tnet_dns_qtype_t qtype;
- tnet_dns_qclass_t qclass;
- uint32_t ttl;
- uint16_t rdlength;
- char* qname = tsk_null;
-
- /* Check validity */
- if (!dataPtr || !size){
- goto bail;
- }
-
- /* == Parse QNAME == */
- tnet_dns_rr_qname_deserialize(dataStart, &qname, offset);
- dataPtr = (dataStart + *offset);
- /* == Parse QTYPE == */
- qtype = (tnet_dns_qtype_t)tnet_ntohs_2(dataPtr);
- dataPtr += 2, *offset += 2;
- /* == Parse QCLASS == */
- qclass = (tnet_dns_qclass_t)tnet_ntohs_2(dataPtr);
- dataPtr += 2, *offset += 2;
- /* == Parse TTL == */
- ttl = (uint32_t)tnet_htonl_2(dataPtr);
- dataPtr += 4, *offset += 4;
- /* == Parse RDLENGTH == */
- rdlength = tnet_ntohs_2(dataPtr);
- dataPtr += 2, *offset += 2;
-
- switch (qtype){
- case qtype_a:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_a_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_aaaa:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_aaaa_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_cname:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_cname_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_mx:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_mx_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_naptr:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_naptr_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_ns:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_ns_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_opt:
- {
- unsigned payload_size = qclass;
- rr = (tnet_dns_rr_t *)tnet_dns_opt_create(payload_size);
- break;
- }
-
- case qtype_ptr:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_ptr_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_soa:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_soa_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_srv:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_srv_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- case qtype_txt:
- {
- rr = (tnet_dns_rr_t *)tnet_dns_txt_create(qname, qclass, ttl, rdlength, dataStart, *offset);
- break;
- }
-
- default:
- {
- TSK_DEBUG_ERROR("NOT IMPLEMENTED");
- break;
- }
- }
+ tnet_dns_rr_t *rr = tsk_null;
+ uint8_t* dataStart = (uint8_t*)data;
+ uint8_t* dataPtr = (dataStart + *offset);
+ //uint8_t* dataEnd = (dataPtr+size);
+ tnet_dns_qtype_t qtype;
+ tnet_dns_qclass_t qclass;
+ uint32_t ttl;
+ uint16_t rdlength;
+ char* qname = tsk_null;
+
+ /* Check validity */
+ if (!dataPtr || !size) {
+ goto bail;
+ }
+
+ /* == Parse QNAME == */
+ tnet_dns_rr_qname_deserialize(dataStart, &qname, offset);
+ dataPtr = (dataStart + *offset);
+ /* == Parse QTYPE == */
+ qtype = (tnet_dns_qtype_t)tnet_ntohs_2(dataPtr);
+ dataPtr += 2, *offset += 2;
+ /* == Parse QCLASS == */
+ qclass = (tnet_dns_qclass_t)tnet_ntohs_2(dataPtr);
+ dataPtr += 2, *offset += 2;
+ /* == Parse TTL == */
+ ttl = (uint32_t)tnet_htonl_2(dataPtr);
+ dataPtr += 4, *offset += 4;
+ /* == Parse RDLENGTH == */
+ rdlength = tnet_ntohs_2(dataPtr);
+ dataPtr += 2, *offset += 2;
+
+ switch (qtype) {
+ case qtype_a: {
+ rr = (tnet_dns_rr_t *)tnet_dns_a_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_aaaa: {
+ rr = (tnet_dns_rr_t *)tnet_dns_aaaa_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_cname: {
+ rr = (tnet_dns_rr_t *)tnet_dns_cname_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_mx: {
+ rr = (tnet_dns_rr_t *)tnet_dns_mx_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_naptr: {
+ rr = (tnet_dns_rr_t *)tnet_dns_naptr_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_ns: {
+ rr = (tnet_dns_rr_t *)tnet_dns_ns_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_opt: {
+ unsigned payload_size = qclass;
+ rr = (tnet_dns_rr_t *)tnet_dns_opt_create(payload_size);
+ break;
+ }
+
+ case qtype_ptr: {
+ rr = (tnet_dns_rr_t *)tnet_dns_ptr_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_soa: {
+ rr = (tnet_dns_rr_t *)tnet_dns_soa_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_srv: {
+ rr = (tnet_dns_rr_t *)tnet_dns_srv_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ case qtype_txt: {
+ rr = (tnet_dns_rr_t *)tnet_dns_txt_create(qname, qclass, ttl, rdlength, dataStart, *offset);
+ break;
+ }
+
+ default: {
+ TSK_DEBUG_ERROR("NOT IMPLEMENTED");
+ break;
+ }
+ }
bail:
- TSK_FREE(qname);
+ TSK_FREE(qname);
- *offset += rdlength;
- return rr;
+ *offset += rdlength;
+ return rr;
}
/** Serializes a DNS RR.
*/
int tnet_dns_rr_serialize(const tnet_dns_rr_t* rr, tsk_buffer_t *output)
{
- if (!rr || !output){
- return -1;
- }
-
- /*=== NAME ===*/
- {
- tnet_dns_rr_qname_serialize(rr->name, output);
- }
-
- /*=== TYPE ===*/
- {
- uint16_t qtype = tnet_htons(rr->qtype);
- tsk_buffer_append(output, &(qtype), 2);
- }
-
- /*=== CLASS ===*/
- {
- uint16_t qclass = tnet_htons(rr->qclass);
- tsk_buffer_append(output, &(qclass), 2);
- }
-
- /*=== TTL ===*/
- {
- uint32_t ttl = (uint32_t)tnet_htonl(rr->ttl);
- tsk_buffer_append(output, &(ttl), 4);
- }
-
- /*=== RDLENGTH ===*/
- {
- uint16_t length = tnet_htons(rr->rdlength);
- tsk_buffer_append(output, &(length), 2);
- }
-
- /*=== RDATA : Request never contains data
- ===*/
- if (!rr->rpdata){
- goto done;
- }
-
- switch (rr->qtype){
- case qtype_a:
- case qtype_aaaa:
- case qtype_cname:
- case qtype_mx:
- case qtype_naptr:
- case qtype_ns:
- case qtype_opt:
- case qtype_ptr:
- case qtype_soa:
- case qtype_srv:
- case qtype_txt:
- default:
- {
- TSK_DEBUG_WARN("DNS Request should not contains RDATA (not supported).");
- break;
- }
- }
+ if (!rr || !output) {
+ return -1;
+ }
+
+ /*=== NAME ===*/
+ {
+ tnet_dns_rr_qname_serialize(rr->name, output);
+ }
+
+ /*=== TYPE ===*/
+ {
+ uint16_t qtype = tnet_htons(rr->qtype);
+ tsk_buffer_append(output, &(qtype), 2);
+ }
+
+ /*=== CLASS ===*/
+ {
+ uint16_t qclass = tnet_htons(rr->qclass);
+ tsk_buffer_append(output, &(qclass), 2);
+ }
+
+ /*=== TTL ===*/
+ {
+ uint32_t ttl = (uint32_t)tnet_htonl(rr->ttl);
+ tsk_buffer_append(output, &(ttl), 4);
+ }
+
+ /*=== RDLENGTH ===*/
+ {
+ uint16_t length = tnet_htons(rr->rdlength);
+ tsk_buffer_append(output, &(length), 2);
+ }
+
+ /*=== RDATA : Request never contains data
+ ===*/
+ if (!rr->rpdata) {
+ goto done;
+ }
+
+ switch (rr->qtype) {
+ case qtype_a:
+ case qtype_aaaa:
+ case qtype_cname:
+ case qtype_mx:
+ case qtype_naptr:
+ case qtype_ns:
+ case qtype_opt:
+ case qtype_ptr:
+ case qtype_soa:
+ case qtype_srv:
+ case qtype_txt:
+ default: {
+ TSK_DEBUG_WARN("DNS Request should not contains RDATA (not supported).");
+ break;
+ }
+ }
done:
- return 0;
+ return 0;
}
@@ -422,27 +409,26 @@ done:
//
static tsk_object_t* tnet_dns_rr_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_rr_t *rr = self;
- if (rr){
- tnet_dns_rr_init(rr, qtype_any, qclass_any);
- }
- return self;
+ tnet_dns_rr_t *rr = self;
+ if (rr) {
+ tnet_dns_rr_init(rr, qtype_any, qclass_any);
+ }
+ return self;
}
static tsk_object_t* tnet_dns_rr_dtor(tsk_object_t * self)
{
- tnet_dns_rr_t *rr = self;
- if (rr){
- tnet_dns_rr_deinit(rr);
- }
- return self;
+ tnet_dns_rr_t *rr = self;
+ if (rr) {
+ tnet_dns_rr_deinit(rr);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_rr_def_s =
-{
- sizeof(tnet_dns_rr_t),
- tnet_dns_rr_ctor,
- tnet_dns_rr_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_rr_def_s = {
+ sizeof(tnet_dns_rr_t),
+ tnet_dns_rr_ctor,
+ tnet_dns_rr_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_rr_def_t = &tnet_dns_rr_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_rr.h b/tinyNET/src/dns/tnet_dns_rr.h
index f4a1b6b..895c648 100755
--- a/tinyNET/src/dns/tnet_dns_rr.h
+++ b/tinyNET/src/dns/tnet_dns_rr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,106 +46,103 @@ TNET_BEGIN_DECLS
/** RFC 1035 - 3.2.2. TYPE values
* @sa http://en.wikipedia.org/wiki/List_of_DNS_record_types
*/
-typedef enum tnet_dns_qtype_e
-{
- qtype_a = 1, /**< A 1 a host address */
- qtype_ns = 2, /**< NS 2 an authoritative name server */
- qtype_md = 3, /**< MD 3 a mail destination (Obsolete - use MX) */
- qtype_mf = 4, /**< MF 4 a mail forwarder (Obsolete - use MX) */
- qtype_cname = 5, /**< CNAME 5 the canonical name for an alias */
- qtype_soa = 6, /**< SOA 6 marks the start of a zone of authority */
- qtype_mb = 7, /**< MB 7 a mailbox domain name (EXPERIMENTAL) */
- qtype_mg = 8, /**< MG 8 a mail group member (EXPERIMENTAL) */
- qtype_mr = 9, /**< MR 9 a mail rename domain name (EXPERIMENTAL) */
- qtype_null = 10, /**< NULL 10 a null RR (EXPERIMENTAL) */
- qtype_wks = 11, /**< WKS 11 a well known service description */
- qtype_ptr = 12, /**< PTR 12 a domain name pointer */
- qtype_hinfo = 13, /**< HINFO 13 host information */
- qtype_minfo = 14, /**< MINFO 14 mailbox or mail list information */
- qtype_mx = 15, /**< MX 15 mail exchange */
- qtype_txt = 16, /**< TXT 16 text strings */
-
- qtype_aaaa = 28, /**< AAAA 28 IPv6 host address */
-
- qtype_srv = 33, /**< SRV 33 Service locator */
-
- qtype_naptr = 35, /**< NAPTR 35 Naming Authority Pointer */
-
- qtype_opt = 41, /**< OPT 41 Option */
-
- qtype_ipseckey = 45,/**< IPSECKEY 45 IPSEC Key */
-
- qtype_spf = 99, /**< SPF 99 SPF record */
-
- qtype_any = 255 /**< * 255 A request for all records (3.2.3. QTYPE values)*/
+typedef enum tnet_dns_qtype_e {
+ qtype_a = 1, /**< A 1 a host address */
+ qtype_ns = 2, /**< NS 2 an authoritative name server */
+ qtype_md = 3, /**< MD 3 a mail destination (Obsolete - use MX) */
+ qtype_mf = 4, /**< MF 4 a mail forwarder (Obsolete - use MX) */
+ qtype_cname = 5, /**< CNAME 5 the canonical name for an alias */
+ qtype_soa = 6, /**< SOA 6 marks the start of a zone of authority */
+ qtype_mb = 7, /**< MB 7 a mailbox domain name (EXPERIMENTAL) */
+ qtype_mg = 8, /**< MG 8 a mail group member (EXPERIMENTAL) */
+ qtype_mr = 9, /**< MR 9 a mail rename domain name (EXPERIMENTAL) */
+ qtype_null = 10, /**< NULL 10 a null RR (EXPERIMENTAL) */
+ qtype_wks = 11, /**< WKS 11 a well known service description */
+ qtype_ptr = 12, /**< PTR 12 a domain name pointer */
+ qtype_hinfo = 13, /**< HINFO 13 host information */
+ qtype_minfo = 14, /**< MINFO 14 mailbox or mail list information */
+ qtype_mx = 15, /**< MX 15 mail exchange */
+ qtype_txt = 16, /**< TXT 16 text strings */
+
+ qtype_aaaa = 28, /**< AAAA 28 IPv6 host address */
+
+ qtype_srv = 33, /**< SRV 33 Service locator */
+
+ qtype_naptr = 35, /**< NAPTR 35 Naming Authority Pointer */
+
+ qtype_opt = 41, /**< OPT 41 Option */
+
+ qtype_ipseckey = 45,/**< IPSECKEY 45 IPSEC Key */
+
+ qtype_spf = 99, /**< SPF 99 SPF record */
+
+ qtype_any = 255 /**< * 255 A request for all records (3.2.3. QTYPE values)*/
}
tnet_dns_qtype_t;
/** RFC 1035 - 3.2.4. CLASS values
*/
-typedef enum tnet_dns_qclass_e
-{
- qclass_in = 1, /**< IN 1 the Internet */
- qclass_ics = 2, /**< CS 2 the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */
- qclass_ch = 3, /**< CH 3 the CHAOS class */
- qclass_hs = 4, /**< HS 4 Hesiod [Dyer 87] */
-
- qclass_any = 255 /**< * 255 any class (3.2.5. QCLASS values) */
+typedef enum tnet_dns_qclass_e {
+ qclass_in = 1, /**< IN 1 the Internet */
+ qclass_ics = 2, /**< CS 2 the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */
+ qclass_ch = 3, /**< CH 3 the CHAOS class */
+ qclass_hs = 4, /**< HS 4 Hesiod [Dyer 87] */
+
+ qclass_any = 255 /**< * 255 any class (3.2.5. QCLASS values) */
}
tnet_dns_qclass_t;
-/** RFC 1034 (3.6. Resource Records) and 1035 (3.2.1. Format)
+/** RFC 1034 (3.6. Resource Records) and 1035 (3.2.1. Format)
*/
-typedef struct tnet_dns_rr_s
-{
- TSK_DECLARE_OBJECT;
-
- /* RFC 1035 - 3.2.1. Format
- 1 1 1 1 1 1
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | |
- / /
- / NAME /
- | |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | TYPE |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | CLASS |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | TTL |
- | |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | RDLENGTH |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
- / RDATA /
- / /
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
-
- tsk_bool_t initialized;
-
- /** An owner name, i.e., the name of the node to which this resource record pertains. */
- char* name;
-
- /** Two octets containing one of the RR TYPE codes. */
- tnet_dns_qtype_t qtype;
-
- /** Two octets containing one of the RR CLASS codes. */
- tnet_dns_qclass_t qclass;
-
- /** A 32 bit signed integer that specifies the time interval (seconds) that the resource record may be cached before the source
- of the information should again be consulted.
- Zero values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached.
- For example, SOA records are always distributed with a zero TTL to prohibit caching. Zero values can also be used for extremely volatile data. */
- int32_t ttl;
-
- /** An unsigned 16 bit integer that specifies the length in octets of the RDATA field. */
- uint16_t rdlength;
-
- /** A variable length string of octets that describes the resource.
- The format of this information varies according to the TYPE and CLASS of the resource record.*/
- void *rpdata;
+typedef struct tnet_dns_rr_s {
+ TSK_DECLARE_OBJECT;
+
+ /* RFC 1035 - 3.2.1. Format
+ 1 1 1 1 1 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | |
+ / /
+ / NAME /
+ | |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | TYPE |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | CLASS |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | TTL |
+ | |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ | RDLENGTH |
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
+ / RDATA /
+ / /
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ */
+
+ tsk_bool_t initialized;
+
+ /** An owner name, i.e., the name of the node to which this resource record pertains. */
+ char* name;
+
+ /** Two octets containing one of the RR TYPE codes. */
+ tnet_dns_qtype_t qtype;
+
+ /** Two octets containing one of the RR CLASS codes. */
+ tnet_dns_qclass_t qclass;
+
+ /** A 32 bit signed integer that specifies the time interval (seconds) that the resource record may be cached before the source
+ of the information should again be consulted.
+ Zero values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached.
+ For example, SOA records are always distributed with a zero TTL to prohibit caching. Zero values can also be used for extremely volatile data. */
+ int32_t ttl;
+
+ /** An unsigned 16 bit integer that specifies the length in octets of the RDATA field. */
+ uint16_t rdlength;
+
+ /** A variable length string of octets that describes the resource.
+ The format of this information varies according to the TYPE and CLASS of the resource record.*/
+ void *rpdata;
}
tnet_dns_rr_t;
diff --git a/tinyNET/src/dns/tnet_dns_soa.c b/tinyNET/src/dns/tnet_dns_soa.c
index a1844f4..8aefc5f 100755
--- a/tinyNET/src/dns/tnet_dns_soa.c
+++ b/tinyNET/src/dns/tnet_dns_soa.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,7 +36,7 @@
tnet_dns_soa_t* tnet_dns_soa_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_soa_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_soa_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -44,65 +44,64 @@ tnet_dns_soa_t* tnet_dns_soa_create(const char* name, tnet_dns_qclass_t qclass,
//
static tsk_object_t* tnet_dns_soa_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_soa_t *soa = self;
- if(soa){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_soa_t *soa = self;
+ if(soa) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(soa), qtype_soa, qclass);
- TNET_DNS_RR(soa)->name = tsk_strdup(name);
- TNET_DNS_RR(soa)->rdlength = rdlength;
- TNET_DNS_RR(soa)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(soa), qtype_soa, qclass);
+ TNET_DNS_RR(soa)->name = tsk_strdup(name);
+ TNET_DNS_RR(soa)->rdlength = rdlength;
+ TNET_DNS_RR(soa)->ttl = ttl;
- if(rdlength)
- { // ==> DESERIALIZATION
- /* MNAME */
- tnet_dns_rr_qname_deserialize(data, &(soa->mname), &offset);
- /* RNAME */
- tnet_dns_rr_qname_deserialize(data, &(soa->rname), &offset);
- /* SERIAL */
- soa->serial = tnet_htonl_2(((uint8_t*)data) + offset),
- offset += 2;
- /* REFRESH */
- soa->refresh = tnet_htonl_2(((uint8_t*)data) + offset),
- offset += 2;
- /* RETRY */
- soa->retry = tnet_htonl_2(((uint8_t*)data) + offset),
- offset += 2;
- /* EXPIRE */
- soa->expire = tnet_htonl_2(((uint8_t*)data) + offset),
- offset += 2;
- /* MINIMUM */
- soa->minimum = tnet_htonl_2(((uint8_t*)data) + offset),
- offset += 2;
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* MNAME */
+ tnet_dns_rr_qname_deserialize(data, &(soa->mname), &offset);
+ /* RNAME */
+ tnet_dns_rr_qname_deserialize(data, &(soa->rname), &offset);
+ /* SERIAL */
+ soa->serial = tnet_htonl_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* REFRESH */
+ soa->refresh = tnet_htonl_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* RETRY */
+ soa->retry = tnet_htonl_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* EXPIRE */
+ soa->expire = tnet_htonl_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* MINIMUM */
+ soa->minimum = tnet_htonl_2(((uint8_t*)data) + offset),
+ offset += 2;
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_soa_dtor(tsk_object_t * self)
-{
- tnet_dns_soa_t *soa = self;
- if(soa){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(soa));
+static tsk_object_t* tnet_dns_soa_dtor(tsk_object_t * self)
+{
+ tnet_dns_soa_t *soa = self;
+ if(soa) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(soa));
- TSK_FREE(soa->mname);
- TSK_FREE(soa->rname);
- }
- return self;
+ TSK_FREE(soa->mname);
+ TSK_FREE(soa->rname);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_soa_def_s =
-{
- sizeof(tnet_dns_soa_t),
- tnet_dns_soa_ctor,
- tnet_dns_soa_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_soa_def_s = {
+ sizeof(tnet_dns_soa_t),
+ tnet_dns_soa_ctor,
+ tnet_dns_soa_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_soa_def_t = &tnet_dns_soa_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_soa.h b/tinyNET/src/dns/tnet_dns_soa.h
index 298e907..9faea75 100755
--- a/tinyNET/src/dns/tnet_dns_soa.h
+++ b/tinyNET/src/dns/tnet_dns_soa.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,12 +35,11 @@
TNET_BEGIN_DECLS
-typedef struct tnet_dns_soa_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_soa_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.3.13. SOA RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.3.13. SOA RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ MNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
@@ -61,14 +60,14 @@ typedef struct tnet_dns_soa_s
| MINIMUM |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* mname;
- char* rname;
- uint32_t serial;
- uint32_t refresh;
- uint32_t retry;
- uint32_t expire;
- uint32_t minimum;
+ */
+ char* mname;
+ char* rname;
+ uint32_t serial;
+ uint32_t refresh;
+ uint32_t retry;
+ uint32_t expire;
+ uint32_t minimum;
}
tnet_dns_soa_t;
diff --git a/tinyNET/src/dns/tnet_dns_srv.c b/tinyNET/src/dns/tnet_dns_srv.c
index 4625d68..852bda0 100755
--- a/tinyNET/src/dns/tnet_dns_srv.c
+++ b/tinyNET/src/dns/tnet_dns_srv.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
*/
tnet_dns_srv_t* tnet_dns_srv_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_srv_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_srv_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -46,88 +46,87 @@ tnet_dns_srv_t* tnet_dns_srv_create(const char* name, tnet_dns_qclass_t qclass,
//
static tsk_object_t* tnet_dns_srv_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_srv_t *srv = self;
- if(srv){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_srv_t *srv = self;
+ if(srv) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(srv), qtype_srv, qclass);
- TNET_DNS_RR(srv)->name = tsk_strdup(name);
- TNET_DNS_RR(srv)->rdlength = rdlength;
- TNET_DNS_RR(srv)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(srv), qtype_srv, qclass);
+ TNET_DNS_RR(srv)->name = tsk_strdup(name);
+ TNET_DNS_RR(srv)->rdlength = rdlength;
+ TNET_DNS_RR(srv)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* Priority */
- srv->priority = tnet_ntohs_2(((uint8_t*)data) + offset),
- offset += 2;
- /* Weight */
- srv->weight = tnet_ntohs_2(((uint8_t*)data) + offset),
- offset += 2;
- /* Port */
- srv->port = tnet_ntohs_2(((uint8_t*)data) + offset),
- offset += 2;
- /* Target */
- tnet_dns_rr_qname_deserialize(data, &(srv->target), &offset);
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* Priority */
+ srv->priority = tnet_ntohs_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* Weight */
+ srv->weight = tnet_ntohs_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* Port */
+ srv->port = tnet_ntohs_2(((uint8_t*)data) + offset),
+ offset += 2;
+ /* Target */
+ tnet_dns_rr_qname_deserialize(data, &(srv->target), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_srv_dtor(tsk_object_t * self)
-{
- tnet_dns_srv_t *srv = self;
- if(srv){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(srv));
+static tsk_object_t* tnet_dns_srv_dtor(tsk_object_t * self)
+{
+ tnet_dns_srv_t *srv = self;
+ if(srv) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(srv));
- TSK_FREE(srv->target);
- }
- return self;
+ TSK_FREE(srv->target);
+ }
+ return self;
}
static int tnet_dns_srv_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
-{
- const tnet_dns_rr_t* rr1 = obj1;
- const tnet_dns_rr_t* rr2 = obj2;
+{
+ const tnet_dns_rr_t* rr1 = obj1;
+ const tnet_dns_rr_t* rr2 = obj2;
+
+ if(rr1 && rr2 && (rr1->qtype==qtype_srv) && (rr2->qtype==qtype_srv)) {
+ const tnet_dns_srv_t* srv1 = (tnet_dns_srv_t*)rr1;
+ const tnet_dns_srv_t* srv2 = (tnet_dns_srv_t*)rr2;
- if(rr1 && rr2 && (rr1->qtype==qtype_srv) && (rr2->qtype==qtype_srv)){
- const tnet_dns_srv_t* srv1 = (tnet_dns_srv_t*)rr1;
- const tnet_dns_srv_t* srv2 = (tnet_dns_srv_t*)rr2;
+ /* Compare priorities. */
+ if(srv1->priority < srv2->priority) { /* Lowest priority is tried first. */
+ return 1;
+ }
+ else if(srv1->priority > srv2->priority) {
+ return -1;
+ }
- /* Compare priorities. */
- if(srv1->priority < srv2->priority){ /* Lowest priority is tried first. */
- return 1;
- }
- else if(srv1->priority > srv2->priority){
- return -1;
- }
+ /* Compare weight */
+ if(srv1->weight > srv2->weight) {
+ return 1;
+ }
+ else if(srv1->weight < srv2->weight) {
+ return -1;
+ }
- /* Compare weight */
- if(srv1->weight > srv2->weight){
- return 1;
- }
- else if(srv1->weight < srv2->weight){
- return -1;
- }
-
- return 0;
- }
- else{
- return -1;
- }
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_dns_srv_def_s =
-{
- sizeof(tnet_dns_srv_t),
- tnet_dns_srv_ctor,
- tnet_dns_srv_dtor,
- tnet_dns_srv_cmp,
+static const tsk_object_def_t tnet_dns_srv_def_s = {
+ sizeof(tnet_dns_srv_t),
+ tnet_dns_srv_ctor,
+ tnet_dns_srv_dtor,
+ tnet_dns_srv_cmp,
};
const tsk_object_def_t *tnet_dns_srv_def_t = &tnet_dns_srv_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_srv.h b/tinyNET/src/dns/tnet_dns_srv.h
index c8cc94d..7a3dc83 100755
--- a/tinyNET/src/dns/tnet_dns_srv.h
+++ b/tinyNET/src/dns/tnet_dns_srv.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,14 +38,13 @@ TNET_BEGIN_DECLS
/** DNS SRV Resource Record
*/
-typedef struct tnet_dns_srv_s
-{
- TNET_DECLARE_DNS_RR;
-
- uint16_t priority;
- uint16_t weight;
- uint16_t port;
- char* target;
+typedef struct tnet_dns_srv_s {
+ TNET_DECLARE_DNS_RR;
+
+ uint16_t priority;
+ uint16_t weight;
+ uint16_t port;
+ char* target;
}
tnet_dns_srv_t;
diff --git a/tinyNET/src/dns/tnet_dns_txt.c b/tinyNET/src/dns/tnet_dns_txt.c
index 9d152e9..3a76d9b 100755
--- a/tinyNET/src/dns/tnet_dns_txt.c
+++ b/tinyNET/src/dns/tnet_dns_txt.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
tnet_dns_txt_t* tnet_dns_txt_create(const char* name, tnet_dns_qclass_t qclass, uint32_t ttl, uint16_t rdlength, const void* data, tsk_size_t offset)
{
- return tsk_object_new(tnet_dns_txt_def_t, name, qclass, ttl, rdlength, data, offset);
+ return tsk_object_new(tnet_dns_txt_def_t, name, qclass, ttl, rdlength, data, offset);
}
//=================================================================================================
@@ -46,47 +46,46 @@ tnet_dns_txt_t* tnet_dns_txt_create(const char* name, tnet_dns_qclass_t qclass,
//
static tsk_object_t* tnet_dns_txt_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dns_txt_t *txt = self;
- if(txt){
- const char* name = va_arg(*app, const char*);
- tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
- uint32_t ttl = va_arg(*app, uint32_t);
- uint16_t rdlength = tsk_va_arg_u16(*app);
- const void* data = va_arg(*app, const void*);
- tsk_size_t offset = va_arg(*app, tsk_size_t);
+ tnet_dns_txt_t *txt = self;
+ if(txt) {
+ const char* name = va_arg(*app, const char*);
+ tnet_dns_qclass_t qclass = va_arg(*app, tnet_dns_qclass_t);
+ uint32_t ttl = va_arg(*app, uint32_t);
+ uint16_t rdlength = tsk_va_arg_u16(*app);
+ const void* data = va_arg(*app, const void*);
+ tsk_size_t offset = va_arg(*app, tsk_size_t);
- /* init base */
- tnet_dns_rr_init(TNET_DNS_RR(txt), qtype_txt, qclass);
- TNET_DNS_RR(txt)->name = tsk_strdup(name);
- TNET_DNS_RR(txt)->rdlength = rdlength;
- TNET_DNS_RR(txt)->ttl = ttl;
+ /* init base */
+ tnet_dns_rr_init(TNET_DNS_RR(txt), qtype_txt, qclass);
+ TNET_DNS_RR(txt)->name = tsk_strdup(name);
+ TNET_DNS_RR(txt)->rdlength = rdlength;
+ TNET_DNS_RR(txt)->ttl = ttl;
- if(rdlength){
- // ==> DESERIALIZATION
- /* TXT-DATA */
- tnet_dns_rr_charstring_deserialize(data, &(txt->txt_data), &offset);
- }
- }
- return self;
+ if(rdlength) {
+ // ==> DESERIALIZATION
+ /* TXT-DATA */
+ tnet_dns_rr_charstring_deserialize(data, &(txt->txt_data), &offset);
+ }
+ }
+ return self;
}
-static tsk_object_t* tnet_dns_txt_dtor(tsk_object_t * self)
-{
- tnet_dns_txt_t *txt = self;
- if(txt){
- /* deinit base */
- tnet_dns_rr_deinit(TNET_DNS_RR(txt));
+static tsk_object_t* tnet_dns_txt_dtor(tsk_object_t * self)
+{
+ tnet_dns_txt_t *txt = self;
+ if(txt) {
+ /* deinit base */
+ tnet_dns_rr_deinit(TNET_DNS_RR(txt));
- TSK_FREE(txt->txt_data);
- }
- return self;
+ TSK_FREE(txt->txt_data);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dns_txt_def_s =
-{
- sizeof(tnet_dns_txt_t),
- tnet_dns_txt_ctor,
- tnet_dns_txt_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dns_txt_def_s = {
+ sizeof(tnet_dns_txt_t),
+ tnet_dns_txt_ctor,
+ tnet_dns_txt_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dns_txt_def_t = &tnet_dns_txt_def_s;
diff --git a/tinyNET/src/dns/tnet_dns_txt.h b/tinyNET/src/dns/tnet_dns_txt.h
index 05f54d9..0bac6c7 100755
--- a/tinyNET/src/dns/tnet_dns_txt.h
+++ b/tinyNET/src/dns/tnet_dns_txt.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,16 +38,15 @@ TNET_BEGIN_DECLS
/** DNS TXT Resource Record
*/
-typedef struct tnet_dns_txt_s
-{
- TNET_DECLARE_DNS_RR;
+typedef struct tnet_dns_txt_s {
+ TNET_DECLARE_DNS_RR;
- /* RFC 1035 - 3.3.14. TXT RDATA format
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ /* RFC 1035 - 3.3.14. TXT RDATA format
+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ TXT-DATA /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- */
- char* txt_data;
+ */
+ char* txt_data;
}
tnet_dns_txt_t;
diff --git a/tinyNET/src/ice/tnet_ice.c b/tinyNET/src/ice/tnet_ice.c
index 196009b..1252ff6 100755
--- a/tinyNET/src/ice/tnet_ice.c
+++ b/tinyNET/src/ice/tnet_ice.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/ice/tnet_ice.h b/tinyNET/src/ice/tnet_ice.h
index daffd08..53f9d22 100755
--- a/tinyNET/src/ice/tnet_ice.h
+++ b/tinyNET/src/ice/tnet_ice.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/ice/tnet_ice_candidate.c b/tinyNET/src/ice/tnet_ice_candidate.c
index bb75b33..7900933 100755
--- a/tinyNET/src/ice/tnet_ice_candidate.c
+++ b/tinyNET/src/ice/tnet_ice_candidate.c
@@ -34,15 +34,15 @@
#include <ctype.h>
static int _tnet_ice_candidate_tostring(
- uint8_t* foundation,
- uint32_t comp_id,
- const char* transport_str,
- uint32_t priority,
- const char* connection_addr,
- tnet_port_t port,
- const char* cand_type_str,
- const tsk_params_L_t *extension_att_list,
- char** output);
+ uint8_t* foundation,
+ uint32_t comp_id,
+ const char* transport_str,
+ uint32_t priority,
+ const char* connection_addr,
+ tnet_port_t port,
+ const char* cand_type_str,
+ const tsk_params_L_t *extension_att_list,
+ char** output);
static const char* _tnet_ice_candidate_get_foundation(tnet_ice_cand_type_t type);
static tnet_stun_pkt_t * _tnet_ice_candidate_stun_create_bind_request(tnet_ice_candidate_t* self, const char* username, const char* password);
static tsk_bool_t _tnet_ice_candidate_stun_transac_id_equals(const tnet_stun_transac_id_t id1, const tnet_stun_transac_id_t id2);
@@ -54,7 +54,7 @@ static tnet_ice_cand_type_t _tnet_ice_candtype_get_transport_type(const char* ca
static tsk_object_t* tnet_ice_candidate_ctor(tsk_object_t * self, va_list * app)
{
tnet_ice_candidate_t *candidate = self;
- if (candidate){
+ if (candidate) {
candidate->extension_att_list = tsk_list_create();
}
return self;
@@ -63,23 +63,23 @@ static tsk_object_t* tnet_ice_candidate_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tnet_ice_candidate_dtor(tsk_object_t * self)
{
tnet_ice_candidate_t *candidate = self;
- if (candidate){
+ if (candidate) {
TSK_SAFE_FREE(candidate->transport_str);
TSK_SAFE_FREE(candidate->cand_type_str);
TSK_OBJECT_SAFE_FREE(candidate->extension_att_list);
TSK_OBJECT_SAFE_FREE(candidate->socket);
-
-
+
+
TSK_SAFE_FREE(candidate->stun.nonce);
TSK_SAFE_FREE(candidate->stun.realm);
TSK_SAFE_FREE(candidate->stun.srflx_addr);
-
+
TSK_SAFE_FREE(candidate->turn.relay_addr);
TSK_OBJECT_SAFE_FREE(candidate->turn.ss);
-
+
TSK_SAFE_FREE(candidate->ufrag);
TSK_SAFE_FREE(candidate->pwd);
-
+
TSK_SAFE_FREE(candidate->tostring);
}
return self;
@@ -89,16 +89,19 @@ static int tnet_ice_candidate_cmp(const tsk_object_t *_s1, const tsk_object_t *_
{
const tnet_ice_candidate_t *c1 = _s1;
const tnet_ice_candidate_t *c2 = _s2;
-
- if (c1 && c2){
+
+ if (c1 && c2) {
return (int)(c1->priority - c2->priority);
}
- else if (!c1 && !c2) return 0;
- else return -1;
+ else if (!c1 && !c2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_ice_candidate_def_s =
-{
+static const tsk_object_def_t tnet_ice_candidate_def_s = {
sizeof(tnet_ice_candidate_t),
tnet_ice_candidate_ctor,
tnet_ice_candidate_dtor,
@@ -108,12 +111,12 @@ static const tsk_object_def_t tnet_ice_candidate_def_s =
tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, tnet_socket_t* socket, tsk_bool_t is_ice_jingle, tsk_bool_t is_rtp, tsk_bool_t is_video, const char* ufrag, const char* pwd, const char *foundation)
{
tnet_ice_candidate_t* candidate;
-
- if (!(candidate = tsk_object_new(&tnet_ice_candidate_def_s))){
+
+ if (!(candidate = tsk_object_new(&tnet_ice_candidate_def_s))) {
TSK_DEBUG_ERROR("Failed to create candidate");
return tsk_null;
}
-
+
candidate->type_e = type_e;
candidate->socket = tsk_object_ref(socket);
candidate->local_pref = 0xFFFF;
@@ -121,20 +124,20 @@ tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, tne
candidate->is_rtp = is_rtp;
candidate->is_video = is_video;
candidate->comp_id = is_rtp ? TNET_ICE_CANDIDATE_COMPID_RTP : TNET_ICE_CANDIDATE_COMPID_RTCP;
- if (foundation){
+ if (foundation) {
memcpy(candidate->foundation, foundation, TSK_MIN(tsk_strlen(foundation), TNET_ICE_CANDIDATE_FOUND_SIZE_PREF));
}
- else{
+ else {
tnet_ice_utils_compute_foundation((char*)candidate->foundation, TSK_MIN(sizeof(candidate->foundation), TNET_ICE_CANDIDATE_FOUND_SIZE_PREF));
}
candidate->priority = tnet_ice_utils_get_priority(candidate->type_e, candidate->local_pref, candidate->is_rtp);
- if (candidate->socket){
+ if (candidate->socket) {
memcpy(candidate->connection_addr, candidate->socket->ip, sizeof(candidate->socket->ip));
candidate->port = candidate->socket->port;
candidate->transport_e = socket->type;
}
tnet_ice_candidate_set_credential(candidate, ufrag, pwd);
-
+
return candidate;
}
@@ -144,104 +147,96 @@ tnet_ice_candidate_t* tnet_ice_candidate_parse(const char* str)
char *v, *copy, *saveptr;
int32_t k;
tnet_ice_candidate_t* candidate;
-
- if (tsk_strnullORempty(str)){
+
+ if (tsk_strnullORempty(str)) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- if (!(candidate = tsk_object_new(&tnet_ice_candidate_def_s))){
+
+ if (!(candidate = tsk_object_new(&tnet_ice_candidate_def_s))) {
TSK_DEBUG_ERROR("Failed to create candidate");
return tsk_null;
}
-
+
k = 0;
copy = tsk_strdup(str);
v = tsk_strtok_r(copy, " ", &saveptr);
-
- while (v){
- switch (k){
- case 0:
- {
- memcpy(candidate->foundation, v, TSK_MIN(tsk_strlen(v), sizeof(candidate->foundation)));
- break;
- }
- case 1:
- {
- candidate->comp_id = atoi(v);
- break;
- }
- case 2:
- {
- candidate->transport_str = tsk_strdup(v);
- break;
- }
- case 3:
- {
- candidate->priority = atoi(v);
- break;
- }
- case 4:
- {
- memcpy(candidate->connection_addr, v, TSK_MIN(tsk_strlen(v), sizeof(candidate->connection_addr)));
- break;
- }
- case 5:
- {
- tnet_family_t family;
- candidate->port = atoi(v);
- family = tnet_get_family(candidate->connection_addr, candidate->port);
- candidate->transport_e = _tnet_ice_candidate_get_transport_type((family == AF_INET6), candidate->transport_str);
- break;
- }
- case 6:
- {
- v = tsk_strtok_r(tsk_null, " ", &saveptr);
- tsk_strupdate(&candidate->cand_type_str, v);
- candidate->type_e = _tnet_ice_candtype_get_transport_type(v);
- break;
- }
- default:
- {
- const char* name = v;
- const char* value = (v = tsk_strtok_r(tsk_null, " ", &saveptr));
- tsk_param_t* param = tsk_param_create(name, value);
- if (param){
- tsk_list_push_back_data(candidate->extension_att_list, (void**)&param);
- }
- break;
+
+ while (v) {
+ switch (k) {
+ case 0: {
+ memcpy(candidate->foundation, v, TSK_MIN(tsk_strlen(v), sizeof(candidate->foundation)));
+ break;
+ }
+ case 1: {
+ candidate->comp_id = atoi(v);
+ break;
+ }
+ case 2: {
+ candidate->transport_str = tsk_strdup(v);
+ break;
+ }
+ case 3: {
+ candidate->priority = atoi(v);
+ break;
+ }
+ case 4: {
+ memcpy(candidate->connection_addr, v, TSK_MIN(tsk_strlen(v), sizeof(candidate->connection_addr)));
+ break;
+ }
+ case 5: {
+ tnet_family_t family;
+ candidate->port = atoi(v);
+ family = tnet_get_family(candidate->connection_addr, candidate->port);
+ candidate->transport_e = _tnet_ice_candidate_get_transport_type((family == AF_INET6), candidate->transport_str);
+ break;
+ }
+ case 6: {
+ v = tsk_strtok_r(tsk_null, " ", &saveptr);
+ tsk_strupdate(&candidate->cand_type_str, v);
+ candidate->type_e = _tnet_ice_candtype_get_transport_type(v);
+ break;
+ }
+ default: {
+ const char* name = v;
+ const char* value = (v = tsk_strtok_r(tsk_null, " ", &saveptr));
+ tsk_param_t* param = tsk_param_create(name, value);
+ if (param) {
+ tsk_list_push_back_data(candidate->extension_att_list, (void**)&param);
}
+ break;
+ }
}
-
+
++k;
v = tsk_strtok_r(tsk_null, " ", &saveptr);
}
-
- if (k < 6){
+
+ if (k < 6) {
TSK_DEBUG_ERROR("Failed to parse: %s", str);
TSK_OBJECT_SAFE_FREE(candidate);
}
TSK_FREE(copy);
-
+
return candidate;
}
int tnet_ice_candidate_set_credential(tnet_ice_candidate_t* self, const char* ufrag, const char* pwd)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_strupdate(&self->ufrag, ufrag);
tsk_strupdate(&self->pwd, pwd);
-
+
return 0;
}
int tnet_ice_candidate_set_rflx_addr(tnet_ice_candidate_t* self, const char* addr, tnet_port_t port)
{
- if (!self || !addr || !port){
+ if (!self || !addr || !port) {
TSK_DEBUG_ERROR("Invalid argument");
return -1;
}
@@ -253,7 +248,7 @@ int tnet_ice_candidate_set_rflx_addr(tnet_ice_candidate_t* self, const char* add
const char* tnet_ice_candidate_get_att_value(const tnet_ice_candidate_t* self, const char* att_name)
{
- if (!self || !att_name){
+ if (!self || !att_name) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
@@ -262,7 +257,7 @@ const char* tnet_ice_candidate_get_att_value(const tnet_ice_candidate_t* self, c
int tnet_ice_candidate_set_local_pref(tnet_ice_candidate_t* self, uint16_t local_pref)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -275,12 +270,12 @@ const char* tnet_ice_candidate_tostring(tnet_ice_candidate_t* self)
{
const char* _transport_str;
char __str[255]; // always allocated: bad idea :(
-
- if (!self){
+
+ if (!self) {
TSK_DEBUG_ERROR("Invalid argument");
return tsk_null;
}
-
+
if (self->type_e == tnet_ice_cand_type_relay && self->turn.ss) {
enum tnet_turn_transport_e e_req_transport = tnet_turn_transport_udp;
tnet_turn_session_get_req_transport(self->turn.ss, &e_req_transport);
@@ -288,47 +283,45 @@ const char* tnet_ice_candidate_tostring(tnet_ice_candidate_t* self)
}
else {
_transport_str = self->transport_str ? self->transport_str : _tnet_ice_candidate_get_transport_str(self->transport_e);
- if (self->is_ice_jingle){
+ if (self->is_ice_jingle) {
tsk_size_t i, s = tsk_strlen(_transport_str);
memset(__str, 0, sizeof(__str));
- for (i = 0; i < s && i < sizeof(__str) / sizeof(__str[0]); ++i){
+ for (i = 0; i < s && i < sizeof(__str) / sizeof(__str[0]); ++i) {
__str[i] = tolower(_transport_str[i]);
}
_transport_str = &__str[0];
}
}
-
+
_tnet_ice_candidate_tostring(
- self->foundation,
- self->comp_id,
- _transport_str,
- self->priority,
- (tsk_strnullORempty(self->connection_addr) && self->socket) ? self->socket->ip : self->connection_addr,
- (self->port <= 0 && self->socket) ? self->socket->port : self->port,
- self->cand_type_str ? self->cand_type_str : _tnet_ice_candidate_get_candtype_str(self->type_e),
- self->extension_att_list,
- &self->tostring);
-
+ self->foundation,
+ self->comp_id,
+ _transport_str,
+ self->priority,
+ (tsk_strnullORempty(self->connection_addr) && self->socket) ? self->socket->ip : self->connection_addr,
+ (self->port <= 0 && self->socket) ? self->socket->port : self->port,
+ self->cand_type_str ? self->cand_type_str : _tnet_ice_candidate_get_candtype_str(self->type_e),
+ self->extension_att_list,
+ &self->tostring);
+
/* <rel-addr> and <rel-port>: convey transport addresses related to the
candidate, useful for diagnostics and other purposes. <rel-addr>
and <rel-port> MUST be present for server reflexive, peer
reflexive, and relayed candidates. */
- switch (self->type_e){
- case tnet_ice_cand_type_srflx:
- case tnet_ice_cand_type_prflx:
- case tnet_ice_cand_type_relay:
- {
- if (self->socket){ // when called from the browser(IE, Safari, Opera or Firefox) webrtc4all
- tsk_strcat_2(&self->tostring, " raddr %s rport %d", self->socket->ip, self->socket->port);
- }
- break;
- }
- default:
- {
- break;
+ switch (self->type_e) {
+ case tnet_ice_cand_type_srflx:
+ case tnet_ice_cand_type_prflx:
+ case tnet_ice_cand_type_relay: {
+ if (self->socket) { // when called from the browser(IE, Safari, Opera or Firefox) webrtc4all
+ tsk_strcat_2(&self->tostring, " raddr %s rport %d", self->socket->ip, self->socket->port);
}
+ break;
}
-
+ default: {
+ break;
+ }
+ }
+
// To ease debugging
if (self->socket) {
tsk_strcat_2(&self->tostring, " tr %s", _tnet_ice_candidate_get_transport_str(self->socket->type));
@@ -343,26 +336,26 @@ const char* tnet_ice_candidate_tostring(tnet_ice_candidate_t* self)
tsk_strcat_2(&self->tostring, " fd %d", self->socket->fd);
}
}
-
+
// WebRTC (Chrome) specific
if (self->is_ice_jingle) {
- if (!tsk_params_have_param(self->extension_att_list, "name")){
+ if (!tsk_params_have_param(self->extension_att_list, "name")) {
tsk_strcat_2(&self->tostring, " name %s", self->is_rtp ? (self->is_video ? "video_rtp" : "rtp") : (self->is_video ? "video_rtcp" : "rtcp"));
}
- if (!tsk_params_have_param(self->extension_att_list, "username")){
+ if (!tsk_params_have_param(self->extension_att_list, "username")) {
tsk_strcat_2(&self->tostring, " username %s", self->ufrag);
}
- if (!tsk_params_have_param(self->extension_att_list, "password")){
+ if (!tsk_params_have_param(self->extension_att_list, "password")) {
tsk_strcat_2(&self->tostring, " password %s", self->pwd);
}
- if (!tsk_params_have_param(self->extension_att_list, "network_name")){
+ if (!tsk_params_have_param(self->extension_att_list, "network_name")) {
tsk_strcat_2(&self->tostring, " network_name %s", "{9EBBE687-CCE6-42D3-87F5-B57BB30DEE23}");
}
- if (!tsk_params_have_param(self->extension_att_list, "generation")){
+ if (!tsk_params_have_param(self->extension_att_list, "generation")) {
tsk_strcat_2(&self->tostring, " generation %s", "0");
}
}
-
+
return self->tostring;
}
@@ -371,56 +364,56 @@ int tnet_ice_candidate_send_stun_bind_request(tnet_ice_candidate_t* self, const
tnet_stun_pkt_t *request = tsk_null;
tsk_buffer_t *buffer = tsk_null;
int ret, sendBytes;
-
- if (!self || !server_addr || !TNET_SOCKET_IS_VALID(self->socket)){
+
+ if (!self || !server_addr || !TNET_SOCKET_IS_VALID(self->socket)) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
request = _tnet_ice_candidate_stun_create_bind_request(self, username, password);
- if (!request){
+ if (!request) {
TSK_DEBUG_ERROR("Failed to create STUN request");
ret = -2;
goto bail;
}
-
- if ((ret = tnet_stun_pkt_write_with_padding_2(request, &buffer))){
+
+ if ((ret = tnet_stun_pkt_write_with_padding_2(request, &buffer))) {
TSK_DEBUG_ERROR("Failed to serialize STUN request");
goto bail;
}
-
+
sendBytes = tnet_sockfd_sendto(self->socket->fd, (const struct sockaddr*)server_addr, buffer->data, buffer->size);// return number of sent bytes
- if (sendBytes == buffer->size){
+ if (sendBytes == buffer->size) {
memcpy(self->stun.transac_id, request->transac_id, sizeof(tnet_stun_transac_id_t));
ret = 0;
}
- else{
+ else {
TSK_DEBUG_ERROR("Only %d bytes sent", sendBytes);
ret = -4;
goto bail;
}
-
+
bail:
TSK_OBJECT_SAFE_FREE(request);
TSK_OBJECT_SAFE_FREE(buffer);
-
+
return 0;
}
int tnet_ice_candidate_process_stun_response(tnet_ice_candidate_t* self, const tnet_stun_pkt_resp_t* response, tnet_fd_t fd)
{
int ret = 0;
-
- if (!self || !response){
+
+ if (!self || !response) {
TSK_DEBUG_ERROR("Inavlid parameter");
return -1;
}
-
+
//if(!(_tnet_ice_candidate_stun_transac_id_equals(response->transac_id, self->stun.transac_id))){
// TSK_DEBUG_ERROR("Transaction id mismatch");
// return -2;
//}
-
+
if (TNET_STUN_PKT_RESP_IS_ERROR(response)) {
uint16_t u_code;
if ((ret = tnet_stun_pkt_get_errorcode(response, &u_code))) {
@@ -452,7 +445,7 @@ int tnet_ice_candidate_process_stun_response(tnet_ice_candidate_t* self, const t
else if (TNET_STUN_PKT_RESP_IS_SUCCESS(response)) {
const tnet_stun_attr_address_t* pc_attr_addr;
if (((ret = tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t**)&pc_attr_addr)) == 0 && pc_attr_addr)
- || ((ret = tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t**)&pc_attr_addr)) == 0 && pc_attr_addr)) {
+ || ((ret = tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t**)&pc_attr_addr)) == 0 && pc_attr_addr)) {
tnet_ip_t ip;
if ((ret = tnet_stun_utils_inet_ntop((pc_attr_addr->e_family == tnet_stun_address_family_ipv6), &pc_attr_addr->address, &ip))) {
return ret;
@@ -461,7 +454,7 @@ int tnet_ice_candidate_process_stun_response(tnet_ice_candidate_t* self, const t
self->stun.srflx_port = pc_attr_addr->u_port;
}
}
-
+
return ret;
}
@@ -470,7 +463,7 @@ const tnet_ice_candidate_t* tnet_ice_candidate_find_by_fd(tnet_ice_candidates_L_
if (candidates) {
const tsk_list_item_t *item;
const tnet_ice_candidate_t* candidate;
-
+
tsk_list_lock(candidates);
tsk_list_foreach(item, candidates) {
if (!(candidate = item->data)) {
@@ -482,13 +475,13 @@ const tnet_ice_candidate_t* tnet_ice_candidate_find_by_fd(tnet_ice_candidates_L_
}
}
}
-
+
return tsk_null;
}
const char* tnet_ice_candidate_get_ufrag(const tnet_ice_candidate_t* self)
{
- if (self){
+ if (self) {
return self->ufrag ? self->ufrag : tnet_ice_candidate_get_att_value(self, "username");
}
return tsk_null;
@@ -496,22 +489,22 @@ const char* tnet_ice_candidate_get_ufrag(const tnet_ice_candidate_t* self)
const char* tnet_ice_candidate_get_pwd(const tnet_ice_candidate_t* self)
{
- if (self){
+ if (self) {
return self->pwd ? self->pwd : tnet_ice_candidate_get_att_value(self, "password");
}
return tsk_null;
}
static int _tnet_ice_candidate_tostring(
- uint8_t* foundation,
- uint32_t comp_id,
- const char* transport_str,
- uint32_t priority,
- const char* connection_addr,
- tnet_port_t port,
- const char* cand_type_str,
- const tsk_params_L_t *extension_att_list,
- char** output)
+ uint8_t* foundation,
+ uint32_t comp_id,
+ const char* transport_str,
+ uint32_t priority,
+ const char* connection_addr,
+ tnet_port_t port,
+ const char* cand_type_str,
+ const tsk_params_L_t *extension_att_list,
+ char** output)
{
if (!output) {
TSK_DEBUG_ERROR("Invalid argument");
@@ -525,10 +518,10 @@ static int _tnet_ice_candidate_tostring(
connection_addr,
port,
cand_type_str);
-
+
if (extension_att_list) {
const tsk_list_item_t *item;
- tsk_list_foreach(item, extension_att_list){
+ tsk_list_foreach(item, extension_att_list) {
tsk_strcat_2(output, " %s %s", TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value);
}
}
@@ -537,11 +530,16 @@ static int _tnet_ice_candidate_tostring(
static const char* _tnet_ice_candidate_get_foundation(tnet_ice_cand_type_t type)
{
- switch (type){
- case tnet_ice_cand_type_host: return TNET_ICE_CANDIDATE_FOUNDATION_HOST;
- case tnet_ice_cand_type_srflx: return TNET_ICE_CANDIDATE_FOUNDATION_SRFLX;
- case tnet_ice_cand_type_prflx: return TNET_ICE_CANDIDATE_FOUNDATION_PRFLX;
- case tnet_ice_cand_type_relay: default: return TNET_ICE_CANDIDATE_FOUNDATION_RELAY;
+ switch (type) {
+ case tnet_ice_cand_type_host:
+ return TNET_ICE_CANDIDATE_FOUNDATION_HOST;
+ case tnet_ice_cand_type_srflx:
+ return TNET_ICE_CANDIDATE_FOUNDATION_SRFLX;
+ case tnet_ice_cand_type_prflx:
+ return TNET_ICE_CANDIDATE_FOUNDATION_PRFLX;
+ case tnet_ice_cand_type_relay:
+ default:
+ return TNET_ICE_CANDIDATE_FOUNDATION_RELAY;
}
}
@@ -550,8 +548,8 @@ static tsk_bool_t _tnet_ice_candidate_stun_transac_id_equals(const tnet_stun_tra
{
tsk_size_t i;
static const tsk_size_t size = sizeof(tnet_stun_transac_id_t);
- for (i = 0; i < size; i++){
- if (id1[i] != id2[i]){
+ for (i = 0; i < size; i++) {
+ if (id1[i] != id2[i]) {
return tsk_false;
}
}
@@ -562,12 +560,12 @@ static tnet_stun_pkt_t * _tnet_ice_candidate_stun_create_bind_request(tnet_ice_c
{
tnet_stun_pkt_t *request = tsk_null;
int ret;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_binding_request, &request))) {
TSK_DEBUG_ERROR("Failed to create STUN Bind request");
goto bail;
@@ -585,7 +583,7 @@ static tnet_stun_pkt_t * _tnet_ice_candidate_stun_create_bind_request(tnet_ice_c
goto bail;
}
}
-
+
bail:
if (ret) {
TSK_OBJECT_SAFE_FREE(request);
@@ -606,7 +604,7 @@ return TNET_ICE_CANDIDATE_TRANSPORT_##STR; \
TRANSPORT_GET(WS);
TRANSPORT_GET(WSS);
return "UNKNOWN";
-
+
#undef TRANSPORT_GET
}
@@ -616,7 +614,7 @@ static tnet_socket_type_t _tnet_ice_candidate_get_transport_type(tsk_bool_t ipv6
if(tsk_striequals(TNET_ICE_CANDIDATE_TRANSPORT_##STR, transport_str)){ \
return tnet_socket_type_##str##_ipv4; \
}
-
+
TRANSPORT_GET(UDP, udp);
TRANSPORT_GET(TCP, tcp);
TRANSPORT_GET(TLS, tls);
@@ -624,37 +622,42 @@ return tnet_socket_type_##str##_ipv4; \
TRANSPORT_GET(WS, ws);
TRANSPORT_GET(WSS, wss);
return tnet_socket_type_invalid;
-
+
#undef TRANSPORT_GET
}
static const char* _tnet_ice_candidate_get_candtype_str(tnet_ice_cand_type_t candtype_e)
{
- switch (candtype_e){
- case tnet_ice_cand_type_unknown:
- default: return "unknown";
- case tnet_ice_cand_type_host: return TNET_ICE_CANDIDATE_TYPE_HOST;
- case tnet_ice_cand_type_srflx: return TNET_ICE_CANDIDATE_TYPE_SRFLX;
- case tnet_ice_cand_type_prflx: return TNET_ICE_CANDIDATE_TYPE_PRFLX;
- case tnet_ice_cand_type_relay: return TNET_ICE_CANDIDATE_TYPE_RELAY;
+ switch (candtype_e) {
+ case tnet_ice_cand_type_unknown:
+ default:
+ return "unknown";
+ case tnet_ice_cand_type_host:
+ return TNET_ICE_CANDIDATE_TYPE_HOST;
+ case tnet_ice_cand_type_srflx:
+ return TNET_ICE_CANDIDATE_TYPE_SRFLX;
+ case tnet_ice_cand_type_prflx:
+ return TNET_ICE_CANDIDATE_TYPE_PRFLX;
+ case tnet_ice_cand_type_relay:
+ return TNET_ICE_CANDIDATE_TYPE_RELAY;
}
}
static tnet_ice_cand_type_t _tnet_ice_candtype_get_transport_type(const char* candtype_str)
{
- if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_HOST, candtype_str)){
+ if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_HOST, candtype_str)) {
return tnet_ice_cand_type_host;
}
- else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_SRFLX, candtype_str)){
+ else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_SRFLX, candtype_str)) {
return tnet_ice_cand_type_srflx;
}
- else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_PRFLX, candtype_str)){
+ else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_PRFLX, candtype_str)) {
return tnet_ice_cand_type_prflx;
}
- else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_RELAY, candtype_str)){
+ else if (tsk_striequals(TNET_ICE_CANDIDATE_TYPE_RELAY, candtype_str)) {
return tnet_ice_cand_type_relay;
}
- else{
+ else {
return tnet_ice_cand_type_unknown;
}
}
diff --git a/tinyNET/src/ice/tnet_ice_candidate.h b/tinyNET/src/ice/tnet_ice_candidate.h
index d2cb126..749192d 100755
--- a/tinyNET/src/ice/tnet_ice_candidate.h
+++ b/tinyNET/src/ice/tnet_ice_candidate.h
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,54 +59,52 @@ TNET_BEGIN_DECLS
#define TNET_ICE_CANDIDATE_FOUND_SIZE_PREF 15
-typedef enum tnet_ice_cand_type_e
-{
- tnet_ice_cand_type_unknown,
- tnet_ice_cand_type_host,
- tnet_ice_cand_type_srflx,
- tnet_ice_cand_type_prflx,
- tnet_ice_cand_type_relay
+typedef enum tnet_ice_cand_type_e {
+ tnet_ice_cand_type_unknown,
+ tnet_ice_cand_type_host,
+ tnet_ice_cand_type_srflx,
+ tnet_ice_cand_type_prflx,
+ tnet_ice_cand_type_relay
}
tnet_ice_cand_type_t;
-typedef struct tnet_ice_candidate_s
-{
- TSK_DECLARE_OBJECT;
-
- tnet_ice_cand_type_t type_e;
- uint8_t foundation[33]; // 1*32ice-char
- uint32_t comp_id; // 1*5DIGIT
- char* transport_str; // "UP" / token
- enum tnet_socket_type_e transport_e;
- uint32_t priority; // 1*10DIGIST [1 - (2**31 - 1)]
- char* cand_type_str; // "host" / "srflx" / "prflx" / "relay" / "token"
- tnet_ip_t connection_addr;
- tnet_port_t port;
- tsk_params_L_t *extension_att_list;
-
- tsk_bool_t is_ice_jingle;
- tsk_bool_t is_rtp;
- tsk_bool_t is_video;
- uint16_t local_pref; // [0 - 65535]
-
- char* ufrag;
- char* pwd;
-
- struct tnet_socket_s* socket;
- struct{
- char* nonce;
- char* realm;
- char* srflx_addr;
- tnet_stun_transac_id_t transac_id;
- tnet_port_t srflx_port;
- } stun;
- struct {
- struct tnet_turn_session_s* ss;
- char* relay_addr;
- tnet_port_t relay_port;
- } turn;
-
- char *tostring;
+typedef struct tnet_ice_candidate_s {
+ TSK_DECLARE_OBJECT;
+
+ tnet_ice_cand_type_t type_e;
+ uint8_t foundation[33]; // 1*32ice-char
+ uint32_t comp_id; // 1*5DIGIT
+ char* transport_str; // "UP" / token
+ enum tnet_socket_type_e transport_e;
+ uint32_t priority; // 1*10DIGIST [1 - (2**31 - 1)]
+ char* cand_type_str; // "host" / "srflx" / "prflx" / "relay" / "token"
+ tnet_ip_t connection_addr;
+ tnet_port_t port;
+ tsk_params_L_t *extension_att_list;
+
+ tsk_bool_t is_ice_jingle;
+ tsk_bool_t is_rtp;
+ tsk_bool_t is_video;
+ uint16_t local_pref; // [0 - 65535]
+
+ char* ufrag;
+ char* pwd;
+
+ struct tnet_socket_s* socket;
+ struct {
+ char* nonce;
+ char* realm;
+ char* srflx_addr;
+ tnet_stun_transac_id_t transac_id;
+ tnet_port_t srflx_port;
+ } stun;
+ struct {
+ struct tnet_turn_session_s* ss;
+ char* relay_addr;
+ tnet_port_t relay_port;
+ } turn;
+
+ char *tostring;
}
tnet_ice_candidate_t;
diff --git a/tinyNET/src/ice/tnet_ice_ctx.c b/tinyNET/src/ice/tnet_ice_ctx.c
index 94d3042..6e5e5be 100755
--- a/tinyNET/src/ice/tnet_ice_ctx.c
+++ b/tinyNET/src/ice/tnet_ice_ctx.c
@@ -84,8 +84,7 @@ typedef tsk_list_t tnet_ice_servers_L_t;
static const char* foundation_default = tsk_null;
-typedef enum tnet_ice_server_proto_e
-{
+typedef enum tnet_ice_server_proto_e {
tnet_ice_server_proto_none = 0x00,
tnet_ice_server_proto_stun = (0x01 << 0),
tnet_ice_server_proto_turn = (0x01 << 1),
@@ -134,10 +133,9 @@ static int _tnet_ice_ctx_fsm_OnTerminated(struct tnet_ice_ctx_s* self);
static tsk_bool_t _tnet_ice_ctx_fsm_cond_NotStarted(struct tnet_ice_ctx_s* self, const void* _any);
static int _tnet_ice_ctx_turn_callback(const struct tnet_turn_session_event_xs *e);
-typedef struct tnet_ice_server_s
-{
+typedef struct tnet_ice_server_s {
TSK_DECLARE_OBJECT;
-
+
enum tnet_socket_type_e e_transport;
tnet_ice_server_proto_t e_proto;
char* str_server_addr;
@@ -165,13 +163,12 @@ static tsk_object_t* tnet_ice_server_dtor(tsk_object_t * self)
TSK_FREE(ice_server->str_software);
TSK_FREE(ice_server->str_username);
TSK_FREE(ice_server->str_password);
-
+
TSK_DEBUG_INFO("*** ICE server destroyed ***");
}
return self;
}
-static const tsk_object_def_t tnet_ice_server_def_s =
-{
+static const tsk_object_def_t tnet_ice_server_def_s = {
sizeof(tnet_ice_server_t),
tnet_ice_server_ctor,
tnet_ice_server_dtor,
@@ -179,25 +176,25 @@ static const tsk_object_def_t tnet_ice_server_def_s =
};
static tnet_ice_server_t* tnet_ice_server_create(
- enum tnet_ice_server_proto_e e_proto,
- enum tnet_socket_type_e e_transport,
- const char* str_server_addr, uint16_t u_server_port,
- const char* str_software,
- const char* str_username, const char* str_password)
+ enum tnet_ice_server_proto_e e_proto,
+ enum tnet_socket_type_e e_transport,
+ const char* str_server_addr, uint16_t u_server_port,
+ const char* str_software,
+ const char* str_username, const char* str_password)
{
tnet_ice_server_t *ice_server;
struct sockaddr_storage obj_server_addr;
-
+
if (tsk_strnullORempty(str_server_addr) || !u_server_port) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
if (tnet_sockaddr_init(str_server_addr, u_server_port, e_transport, &obj_server_addr) != 0) {
TSK_DEBUG_ERROR("Invalid server address (host=%s, port=%d, transport=%d)", str_server_addr, u_server_port, e_transport);
return tsk_null;
}
-
+
if ((ice_server = tsk_object_new(&tnet_ice_server_def_s))) {
ice_server->e_proto = e_proto;
ice_server->e_transport = e_transport;
@@ -211,10 +208,9 @@ static tnet_ice_server_t* tnet_ice_server_create(
return ice_server;
}
-typedef struct tnet_ice_ctx_s
-{
+typedef struct tnet_ice_ctx_s {
TSK_DECLARE_RUNNABLE;
-
+
tsk_bool_t is_started;
tsk_bool_t is_active;
tsk_bool_t is_sync_mode;
@@ -229,7 +225,7 @@ typedef struct tnet_ice_ctx_s
tsk_bool_t unicast;
tsk_bool_t anycast;
tsk_bool_t multicast;
-
+
tsk_bool_t is_connchecking;
tsk_bool_t is_controlling;
tsk_bool_t is_ice_jingle;
@@ -237,19 +233,19 @@ typedef struct tnet_ice_ctx_s
tsk_bool_t is_stun_enabled;
uint64_t tie_breaker;
uint64_t concheck_timeout;
-
+
const void* rtp_callback_data;
tnet_ice_rtp_callback_f rtp_callback;
-
+
tnet_ice_servers_L_t *servers;
-
+
char* ufrag;
char* pwd;
-
+
tsk_timer_manager_handle_t* h_timer_mgr;
-
+
tsk_fsm_t* fsm;
-
+
tsk_condwait_handle_t* condwait_pairs;
tnet_ice_candidates_L_t* candidates_local;
tnet_ice_candidates_L_t* candidates_remote;
@@ -257,23 +253,23 @@ typedef struct tnet_ice_ctx_s
tsk_bool_t have_nominated_offer;
tsk_bool_t have_nominated_answer;
tsk_bool_t have_nominated_symetric; /**< Whether symetic RTP has been negotiated */
-
+
uint16_t RTO; /**< Estimate of the round-trip time (RTT) in millisecond */
uint16_t Rc; /**< Number of retransmissions for UDP in millisecond */
-
+
struct {
char* path_priv;
char* path_pub;
char* path_ca;
tsk_bool_t verify;
} ssl;
-
+
struct {
tsk_bool_t auto_detect;
struct tnet_proxyinfo_s* info;
}
proxy;
-
+
struct {
tsk_condwait_handle_t* condwait;
struct tnet_turn_session_s* ss_nominated_rtp;
@@ -281,21 +277,19 @@ typedef struct tnet_ice_ctx_s
struct tnet_turn_session_s* ss_nominated_rtcp;
tnet_turn_peer_id_t peer_id_rtcp;
} turn;
-
+
TSK_DECLARE_SAFEOBJ;
}
tnet_ice_ctx_t;
-typedef struct tnet_ice_action_s
-{
+typedef struct tnet_ice_action_s {
TSK_DECLARE_OBJECT;
-
+
tsk_fsm_action_id id;
}
tnet_ice_action_t;
-typedef enum _fsm_state_e
-{
+typedef enum _fsm_state_e {
_fsm_state_Started,
_fsm_state_GatheringHostCandidates,
_fsm_state_GatheringHostCandidatesDone,
@@ -310,8 +304,7 @@ typedef enum _fsm_state_e
}
_fsm_state_t;
-typedef enum _fsm_action_e
-{
+typedef enum _fsm_action_e {
_fsm_action_Success,
_fsm_action_Failure,
_fsm_action_GatherHostCandidates,
@@ -327,19 +320,18 @@ _fsm_action_t;
static tsk_object_t* tnet_ice_action_ctor(tsk_object_t * self, va_list * app)
{
tnet_ice_action_t *action = self;
- if (action){
+ if (action) {
}
return self;
}
static tsk_object_t* tnet_ice_action_dtor(tsk_object_t * self)
{
tnet_ice_action_t *action = self;
- if (action){
+ if (action) {
}
return self;
}
-static const tsk_object_def_t tnet_ice_action_def_s =
-{
+static const tsk_object_def_t tnet_ice_action_def_s = {
sizeof(tnet_ice_action_t),
tnet_ice_action_ctor,
tnet_ice_action_dtor,
@@ -348,7 +340,7 @@ static const tsk_object_def_t tnet_ice_action_def_s =
static tnet_ice_action_t* tnet_ice_action_create(tsk_fsm_action_id id)
{
tnet_ice_action_t *action = tsk_object_new(&tnet_ice_action_def_s);
- if (action){
+ if (action) {
action->id = id;
}
return action;
@@ -360,59 +352,59 @@ static tnet_ice_action_t* tnet_ice_action_create(tsk_fsm_action_id id)
static tsk_object_t* tnet_ice_ctx_ctor(tsk_object_t * self, va_list * app)
{
tnet_ice_ctx_t *ctx = self;
- if (ctx){
+ if (ctx) {
tsk_safeobj_init(ctx);
-
- if (!(ctx->h_timer_mgr = tsk_timer_manager_create())){
+
+ if (!(ctx->h_timer_mgr = tsk_timer_manager_create())) {
TSK_DEBUG_ERROR("Failed to create timer manager");
return tsk_null;
}
- if (!(ctx->fsm = tsk_fsm_create(_fsm_state_Started, _fsm_state_Terminated))){
+ if (!(ctx->fsm = tsk_fsm_create(_fsm_state_Started, _fsm_state_Terminated))) {
TSK_DEBUG_ERROR("Failed to create state machine");
return tsk_null;
}
- if (!(ctx->candidates_local = tsk_list_create())){
+ if (!(ctx->candidates_local = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create candidates list");
return tsk_null;
}
- if (!(ctx->candidates_remote = tsk_list_create())){
+ if (!(ctx->candidates_remote = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create candidates list");
return tsk_null;
}
- if (!(ctx->candidates_pairs = tsk_list_create())){
+ if (!(ctx->candidates_pairs = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create candidates list");
return tsk_null;
}
-
+
// Create condwait for pairs
if (!(ctx->condwait_pairs = tsk_condwait_create())) {
TSK_DEBUG_ERROR("Failed to create condwait for pairs");
return tsk_null;
}
-
+
// Create list objects to hold the servers
- if (!(ctx->servers = tsk_list_create())){
+ if (!(ctx->servers = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create server list");
return tsk_null;
}
-
+
tsk_runnable_set_important(TSK_RUNNABLE(self), tsk_false);
-
+
/* 7.2.1. Sending over UDP
In fixed-line access links, a value of 500 ms is RECOMMENDED.
*/
ctx->RTO = kIceDefaultRTO;
-
+
/* 7.2.1. Sending over UDP
Rc SHOULD be configurable and SHOULD have a default of 7.
*/
ctx->Rc = kIceDefaultRC;
-
+
ctx->tie_breaker = ((tsk_time_now() << 32) ^ tsk_time_now());
ctx->is_ice_jingle = tsk_false;
ctx->is_stun_enabled = kIceDefaultStunEnabled;
ctx->is_turn_enabled = kIceDefaultTurnEnabled;
-
+
ctx->concheck_timeout = LONG_MAX;
}
return self;
@@ -420,17 +412,17 @@ static tsk_object_t* tnet_ice_ctx_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tnet_ice_ctx_dtor(tsk_object_t * self)
{
tnet_ice_ctx_t *ctx = self;
- if (ctx){
+ if (ctx) {
tnet_ice_ctx_stop(ctx);
- if (ctx->h_timer_mgr){
+ if (ctx->h_timer_mgr) {
tsk_timer_manager_destroy(&ctx->h_timer_mgr);
}
-
+
TSK_OBJECT_SAFE_FREE(ctx->fsm);
TSK_OBJECT_SAFE_FREE(ctx->candidates_local);
TSK_OBJECT_SAFE_FREE(ctx->candidates_remote);
TSK_OBJECT_SAFE_FREE(ctx->candidates_pairs);
-
+
TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtp);
TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtcp);
if (ctx->turn.condwait) {
@@ -440,20 +432,19 @@ static tsk_object_t* tnet_ice_ctx_dtor(tsk_object_t * self)
tsk_condwait_destroy(&ctx->condwait_pairs);
}
TSK_OBJECT_SAFE_FREE(ctx->servers);
-
+
TSK_OBJECT_SAFE_FREE(ctx->proxy.info);
-
+
TSK_FREE(ctx->ssl.path_priv);
TSK_FREE(ctx->ssl.path_pub);
TSK_FREE(ctx->ssl.path_ca);
-
+
tsk_safeobj_deinit(ctx);
}
TSK_DEBUG_INFO("*** ICE context destroyed ***");
return self;
}
-static const tsk_object_def_t tnet_ice_ctx_def_s =
-{
+static const tsk_object_def_t tnet_ice_ctx_def_s = {
sizeof(tnet_ice_ctx_t),
tnet_ice_ctx_ctor,
tnet_ice_ctx_dtor,
@@ -464,12 +455,12 @@ static const tsk_object_def_t tnet_ice_ctx_def_s =
tnet_ice_ctx_t* tnet_ice_ctx_create(tsk_bool_t is_ice_jingle, tsk_bool_t use_ipv6, tsk_bool_t use_rtcp, tsk_bool_t is_video, tnet_ice_callback_f callback, const void* userdata)
{
tnet_ice_ctx_t* ctx;
-
- if (!(ctx = tsk_object_new(&tnet_ice_ctx_def_s))){
+
+ if (!(ctx = tsk_object_new(&tnet_ice_ctx_def_s))) {
TSK_DEBUG_ERROR("Failed to create ICE context object");
return tsk_null;
}
-
+
ctx->is_ice_jingle = is_ice_jingle;
ctx->use_ipv6 = use_ipv6;
ctx->use_rtcp = use_rtcp;
@@ -479,10 +470,10 @@ tnet_ice_ctx_t* tnet_ice_ctx_create(tsk_bool_t is_ice_jingle, tsk_bool_t use_ipv
ctx->unicast = tsk_true;
ctx->anycast = tsk_false;
ctx->multicast = tsk_false;
-
+
tnet_ice_utils_set_ufrag(&ctx->ufrag);
tnet_ice_utils_set_pwd(&ctx->pwd);
-
+
ctx->fsm->debug = TNET_ICE_DEBUG_STATE_MACHINE;
tsk_fsm_set_callback_terminated(ctx->fsm, TSK_FSM_ONTERMINATED_F(_tnet_ice_ctx_fsm_OnTerminated), (const void*)ctx);
tsk_fsm_set(ctx->fsm,
@@ -492,14 +483,14 @@ tnet_ice_ctx_t* tnet_ice_ctx_create(tsk_bool_t is_ice_jingle, tsk_bool_t use_ipv
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringHostCandidates, _fsm_action_Success, _fsm_state_GatheringHostCandidatesDone, _tnet_ice_ctx_fsm_GatheringHostCandidates_2_GatheringHostCandidatesDone_X_Success, "ICE_GatheringHostCandidates_2_GatheringHostCandidatesDone_X_Success"),
// (GatheringHostCandidates) -> (Failure) -> (Terminated)
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringHostCandidates, _fsm_action_Failure, _fsm_state_Terminated, _tnet_ice_ctx_fsm_GatheringHostCandidates_2_Terminated_X_Failure, "ICE_GatheringHostCandidates_2_Terminated_X_Failure"),
-
+
// (GatheringHostCandidatesDone) -> (GatherReflexiveCandidates) -> (GatheringReflexiveCandidates)
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringHostCandidatesDone, _fsm_action_GatherReflexiveCandidates, _fsm_state_GatheringReflexiveCandidates, _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCandidates_X_GatherReflexiveCandidates, "ICE_GatheringHostCandidatesDone_2_GatheringReflexiveCandidates_X_GatherReflexiveCandidates"),
// (GatheringReflexiveCandidates) -> (Success) -> GatheringReflexiveCandidatesDone
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringReflexiveCandidates, _fsm_action_Success, _fsm_state_GatheringReflexiveCandidatesDone, _tnet_ice_ctx_fsm_GatheringReflexiveCandidates_2_GatheringReflexiveCandidatesDone_X_Success, "ICE_fsm_GatheringReflexiveCandidates_2_GatheringReflexiveCandidatesDone_X_Success"),
// (GatheringReflexiveCandidates) -> (Failure) -> Terminated
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringReflexiveCandidates, _fsm_action_Failure, _fsm_state_Terminated, _tnet_ice_ctx_fsm_GatheringReflexiveCandidates_2_Terminated_X_Failure, "ICE_GatheringReflexiveCandidates_2_Terminated_X_Failure"),
-
+
// (GatheringReflexiveCandidatesDone) -> (GatherRelayCandidates) -> (GatheringRelayCandidates)
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringReflexiveCandidatesDone, _fsm_action_GatherRelayCandidates, _fsm_state_GatheringRelayCandidates, _tnet_ice_ctx_fsm_GatheringReflexiveCandidatesDone_2_GatheringRelayCandidates_X_GatherRelayCandidates, "ICE_GatheringReflexiveCandidatesDone_2_GatheringRelayCandidates_X_GatherRelayCandidates"),
// (GatheringHostCandidatesDone) -> (GatherRelayCandidates) -> (GatheringRelayCandidates)
@@ -508,28 +499,28 @@ tnet_ice_ctx_t* tnet_ice_ctx_create(tsk_bool_t is_ice_jingle, tsk_bool_t use_ipv
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringRelayCandidates, _fsm_action_Success, _fsm_state_GatheringRelayCandidatesDone, _tnet_ice_ctx_fsm_GatheringRelayCandidates_2_GatheringRelayCandidatesDone_X_Success, "ICE_fsm_GatheringRelayCandidates_2_GatheringRelayCandidatesDone_X_Success"),
// (GatheringRelayCandidates) -> (Failure) -> Terminated
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringRelayCandidates, _fsm_action_Failure, _fsm_state_Terminated, _tnet_ice_ctx_fsm_GatheringRelayCandidates_2_Terminated_X_Failure, "ICE_GatheringRelayCandidates_2_Terminated_X_Failure"),
-
+
// (GatheringComplet) -> (ConnCheck) -> ConnChecking
TSK_FSM_ADD_ALWAYS(_fsm_state_GatheringCompleted, _fsm_action_ConnCheck, _fsm_state_ConnChecking, _tnet_ice_ctx_fsm_GatheringCompleted_2_ConnChecking_X_ConnCheck, "ICE_GatheringCompleted_2_ConnChecking_X_ConnCheck"),
// (ConnChecking) -> (Success) -> ConnCheckingCompleted
TSK_FSM_ADD_ALWAYS(_fsm_state_ConnChecking, _fsm_action_Success, _fsm_state_ConnCheckingCompleted, _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success, "ICE_ConnChecking_2_ConnCheckingCompleted_X_Success"),
// (ConnChecking) -> (Failure) -> Terminated
TSK_FSM_ADD_ALWAYS(_fsm_state_ConnChecking, _fsm_action_Failure, _fsm_state_Terminated, _tnet_ice_ctx_fsm_ConnChecking_2_Terminated_X_Failure, "ICE_ConnChecking_2_Terminated_X_Failure"),
-
+
// (Any) -> (GatheringComplet) -> GatheringCompleted
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_GatheringComplet, _fsm_state_GatheringCompleted, _tnet_ice_ctx_fsm_Any_2_GatheringCompleted_X_GatheringComplet, "ICE_Any_2_GatheringCompleted_X_GatheringComplet"),
// (Any) -> (Cancel) -> Started
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_Cancel, _fsm_state_Started, _tnet_ice_ctx_fsm_Any_2_Started_X_Cancel, "ICE_Any_2_Started_X_Cancel"),
// (Any) -> (AnyNotStarted) -> Terminated
TSK_FSM_ADD(tsk_fsm_state_any, tsk_fsm_action_any, _tnet_ice_ctx_fsm_cond_NotStarted, _fsm_state_Terminated, _tnet_ice_ctx_fsm_Any_2_Terminated_X_AnyNotStarted, "ICE_fsm_Any_2_Terminated_X_AnyNotStarted")
- );
-
+ );
+
return ctx;
}
int tnet_ice_ctx_set_userdata(tnet_ice_ctx_t* self, const void* userdata)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -539,34 +530,34 @@ int tnet_ice_ctx_set_userdata(tnet_ice_ctx_t* self, const void* userdata)
// @deprecated: use "tnet_ice_ctx_add_server()"
int tnet_ice_ctx_set_stun(
- tnet_ice_ctx_t* self,
- const char* server_addr,
- uint16_t server_port,
- const char* software,
- const char* username,
- const char* password)
+ tnet_ice_ctx_t* self,
+ const char* server_addr,
+ uint16_t server_port,
+ const char* software,
+ const char* username,
+ const char* password)
{
_tnet_ice_ctx_servers_clear(self);
return tnet_ice_ctx_add_server(
- self,
- "udp",
- server_addr,
- server_port,
- (!tsk_strnullORempty(username) && !tsk_strnullORempty(password)), /* use_turn*/
- tsk_true, /* use_stun*/
- username,
- password);
+ self,
+ "udp",
+ server_addr,
+ server_port,
+ (!tsk_strnullORempty(username) && !tsk_strnullORempty(password)), /* use_turn*/
+ tsk_true, /* use_stun*/
+ username,
+ password);
}
int tnet_ice_ctx_add_server(
- struct tnet_ice_ctx_s* self,
- const char* transport_proto, // "udp", "tcp", "tls", "ws", "wss"
- const char* server_addr,
- uint16_t server_port,
- tsk_bool_t use_turn,
- tsk_bool_t use_stun,
- const char* username,
- const char* password)
+ struct tnet_ice_ctx_s* self,
+ const char* transport_proto, // "udp", "tcp", "tls", "ws", "wss"
+ const char* server_addr,
+ uint16_t server_port,
+ tsk_bool_t use_turn,
+ tsk_bool_t use_stun,
+ const char* username,
+ const char* password)
{
tnet_socket_type_t socket_type;
tnet_ice_server_proto_t e_proto = tnet_ice_server_proto_none;
@@ -584,7 +575,7 @@ int tnet_ice_ctx_add_server(
if (use_turn) {
e_proto |= tnet_ice_server_proto_turn;
}
-
+
if (tsk_striequals(transport_proto, "udp")) {
socket_type = self->use_ipv6 ? tnet_socket_type_udp_ipv6 : tnet_socket_type_udp_ipv4;
}
@@ -612,7 +603,7 @@ int tnet_ice_ctx_add_server(
int tnet_ice_ctx_set_sync_mode(tnet_ice_ctx_t* self, tsk_bool_t sync_mode)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -622,7 +613,7 @@ int tnet_ice_ctx_set_sync_mode(tnet_ice_ctx_t* self, tsk_bool_t sync_mode)
int tnet_ice_ctx_set_silent_mode(struct tnet_ice_ctx_s* self, tsk_bool_t silent_mode)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -633,7 +624,7 @@ int tnet_ice_ctx_set_silent_mode(struct tnet_ice_ctx_s* self, tsk_bool_t silent_
// Whether to gather reflexive candidates
int tnet_ice_ctx_set_stun_enabled(struct tnet_ice_ctx_s* self, tsk_bool_t stun_enabled)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -644,7 +635,7 @@ int tnet_ice_ctx_set_stun_enabled(struct tnet_ice_ctx_s* self, tsk_bool_t stun_e
// Whether to gather relay candidates
int tnet_ice_ctx_set_turn_enabled(struct tnet_ice_ctx_s* self, tsk_bool_t turn_enabled)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -658,19 +649,19 @@ int tnet_ice_ctx_start(tnet_ice_ctx_t* self)
tsk_bool_t timer_mgr_started = tsk_false;
tsk_bool_t runnable_started = tsk_false;
const char* err = tsk_null;
-
- if (!self){
+
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(self);
-
+
TSK_DEBUG_INFO("tnet_ice_ctx_start");
-
- if (self->is_started){
+
+ if (self->is_started) {
ret = 0;
- if (!self->is_active){
+ if (!self->is_active) {
TSK_DEBUG_INFO("ICE restart");
ret = _tnet_ice_ctx_restart(self);
}
@@ -678,42 +669,42 @@ int tnet_ice_ctx_start(tnet_ice_ctx_t* self)
tsk_safeobj_unlock(self);
return ret;
}
-
+
/* === Timer manager === */
- if ((ret = tsk_timer_manager_start(self->h_timer_mgr))){
+ if ((ret = tsk_timer_manager_start(self->h_timer_mgr))) {
err = "Failed to start timer manager";
TSK_DEBUG_ERROR("%s", err);
goto bail;
}
timer_mgr_started = tsk_true;
-
+
/* === Runnable === */
TSK_RUNNABLE(self)->run = _tnet_ice_ctx_run;
- if ((ret = tsk_runnable_start(TSK_RUNNABLE(self), tnet_ice_event_def_t))){
+ if ((ret = tsk_runnable_start(TSK_RUNNABLE(self), tnet_ice_event_def_t))) {
err = "Failed to start runnable";
TSK_DEBUG_ERROR("%s", err);
goto bail;
}
runnable_started = tsk_true;
-
+
self->is_started = tsk_true; // needed by FSM -> "Must" be before fsm_ast()
self->is_active = tsk_true;
-
- if ((ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_GatherHostCandidates))){
+
+ if ((ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_GatherHostCandidates))) {
err = "FSM execution failed";
TSK_DEBUG_ERROR("%s", err);
goto bail;
}
-
+
bail:
tsk_safeobj_unlock(self);
-
- if (ret){
+
+ if (ret) {
_tnet_ice_ctx_signal_async(self, tnet_ice_event_type_start_failed, err);
- if (timer_mgr_started){
+ if (timer_mgr_started) {
tsk_timer_manager_stop(self->h_timer_mgr);
}
- if (runnable_started){
+ if (runnable_started) {
tsk_runnable_stop(TSK_RUNNABLE(self));
}
self->is_started = tsk_false;
@@ -725,11 +716,11 @@ bail:
// register callback to call when we receive early RTP packets while negotaiating ICE pairs
int tnet_ice_ctx_rtp_callback(tnet_ice_ctx_t* self, tnet_ice_rtp_callback_f rtp_callback, const void* rtp_callback_data)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
self->rtp_callback_data = rtp_callback_data;
self->rtp_callback = rtp_callback;
return 0;
@@ -738,13 +729,13 @@ int tnet_ice_ctx_rtp_callback(tnet_ice_ctx_t* self, tnet_ice_rtp_callback_f rtp_
// timeout (millis): <=0 to disable
int tnet_ice_ctx_set_concheck_timeout(tnet_ice_ctx_t* self, int64_t timeout)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
self->concheck_timeout = (timeout <= 0 ? LONG_MAX : timeout);
-
+
return 0;
}
@@ -761,34 +752,34 @@ int tnet_ice_ctx_set_remote_candidates_2(struct tnet_ice_ctx_s* self, const char
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
self->is_controlling = is_controlling;
self->is_ice_jingle = is_ice_jingle;
tnet_ice_ctx_set_rtcpmux(self, use_rtcpmux);
-
+
if (tsk_strnullORempty(candidates)) {
// remote party is ICE-lite or doesn't support ICE
return tnet_ice_ctx_cancel(self);
}
-
+
TSK_DEBUG_INFO("tnet_ice_ctx_set_remote_candidates(ufrag=%s, pwd=%s, is_controlling=%d, is_ice_jingle=%d, use_rtcpmux=%d)",
ufrag, pwd, is_controlling, is_ice_jingle, use_rtcpmux);
-
+
tsk_list_lock(self->candidates_pairs);
if (!TSK_LIST_IS_EMPTY(self->candidates_pairs)) {
TSK_DEBUG_WARN("Adding Remote ICE candidates after pairs building");
}
tsk_list_unlock(self->candidates_pairs);
-
+
// active if remote is full-ICE
// in all case we are always full-ICE
// self->is_active = tsk_true;
-
+
tsk_list_lock(self->candidates_remote);
-
+
// clear old candidates
tsk_list_clear_items(self->candidates_remote);
-
+
copy = tsk_strdup(candidates);
size = (tsk_size_t)tsk_strlen(copy);
do {
@@ -819,13 +810,14 @@ int tnet_ice_ctx_set_remote_candidates_2(struct tnet_ice_ctx_s* self, const char
}
TSK_OBJECT_SAFE_FREE(candidate);
}
- } while (v && (idx < size));
-
+ }
+ while (v && (idx < size));
+
tsk_list_unlock(self->candidates_remote);
-
+
TSK_FREE(copy);
TSK_OBJECT_SAFE_FREE(added_candidates);
-
+
if (!tnet_ice_ctx_is_connected(self) && tnet_ice_ctx_got_local_candidates(self) && !TSK_LIST_IS_EMPTY(self->candidates_remote)) {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_ConnCheck);
}
@@ -866,7 +858,7 @@ int tnet_ice_ctx_set_ssl_certs(struct tnet_ice_ctx_s* self, const char* path_pri
tsk_size_t tnet_ice_ctx_count_local_candidates(const tnet_ice_ctx_t* self)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
@@ -876,16 +868,16 @@ tsk_size_t tnet_ice_ctx_count_local_candidates(const tnet_ice_ctx_t* self)
tsk_bool_t tnet_ice_ctx_got_local_candidates(const tnet_ice_ctx_t* self)
{
tsk_fsm_state_id curr_state;
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_false;
}
- if (!self->is_started){
+ if (!self->is_started) {
return tsk_false;
}
-
+
curr_state = tsk_fsm_get_current_state(self->fsm);
-
+
return (curr_state >= _fsm_state_GatheringCompleted && curr_state < _fsm_state_Terminated);
}
@@ -893,13 +885,13 @@ const tnet_ice_candidate_t* tnet_ice_ctx_get_local_candidate_at(const tnet_ice_c
{
const tsk_list_item_t *item;
tsk_size_t pos = 0;
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- tsk_list_foreach(item, self->candidates_local){
- if (pos++ == index){
+
+ tsk_list_foreach(item, self->candidates_local) {
+ if (pos++ == index) {
return (const tnet_ice_candidate_t*)item->data;
}
}
@@ -922,9 +914,9 @@ tsk_bool_t tnet_ice_ctx_is_turn_rtp_active(const struct tnet_ice_ctx_s* self)
{
tsk_bool_t b_active;
return tnet_ice_ctx_is_active(self)
- && self->turn.ss_nominated_rtp
- && tnet_turn_session_is_active(self->turn.ss_nominated_rtp, self->turn.peer_id_rtp, &b_active) == 0
- && b_active;
+ && self->turn.ss_nominated_rtp
+ && tnet_turn_session_is_active(self->turn.ss_nominated_rtp, self->turn.peer_id_rtp, &b_active) == 0
+ && b_active;
}
tsk_bool_t tnet_ice_ctx_is_turn_rtcp_active(const struct tnet_ice_ctx_s* self)
@@ -935,9 +927,9 @@ tsk_bool_t tnet_ice_ctx_is_turn_rtcp_active(const struct tnet_ice_ctx_s* self)
else {
tsk_bool_t b_active;
return tnet_ice_ctx_is_active(self)
- && self->turn.ss_nominated_rtcp
- && tnet_turn_session_is_active(self->turn.ss_nominated_rtcp, self->turn.peer_id_rtcp, &b_active) == 0
- && b_active;
+ && self->turn.ss_nominated_rtcp
+ && tnet_turn_session_is_active(self->turn.ss_nominated_rtcp, self->turn.peer_id_rtcp, &b_active) == 0
+ && b_active;
}
}
@@ -968,11 +960,11 @@ tsk_bool_t tnet_ice_ctx_use_rtcp(const tnet_ice_ctx_t* self)
}
int tnet_ice_ctx_get_nominated_symetric_candidates(const tnet_ice_ctx_t* self, uint32_t comp_id,
- const tnet_ice_candidate_t** candidate_offer,
- const tnet_ice_candidate_t** candidate_answer_src,
- const tnet_ice_candidate_t** candidate_answer_dest)
+ const tnet_ice_candidate_t** candidate_offer,
+ const tnet_ice_candidate_t** candidate_answer_src,
+ const tnet_ice_candidate_t** candidate_answer_dest)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -993,14 +985,14 @@ int tnet_ice_ctx_send_turn_rtp(struct tnet_ice_ctx_s* self, const void* data, ts
int tnet_ice_ctx_send_turn_rtcp(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size)
{
return self->use_rtcpmux
- ? tnet_ice_ctx_send_turn_rtp(self, data, size)
- : _tnet_ice_ctx_send_turn_raw(self, self->turn.ss_nominated_rtcp, self->turn.peer_id_rtcp, data, size);
+ ? tnet_ice_ctx_send_turn_rtp(self, data, size)
+ : _tnet_ice_ctx_send_turn_raw(self, self->turn.ss_nominated_rtcp, self->turn.peer_id_rtcp, data, size);
}
int tnet_ice_ctx_turn_get_bytes_count(const struct tnet_ice_ctx_s* self, uint64_t* bytes_in, uint64_t* bytes_out)
{
int ret;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -1010,8 +1002,12 @@ int tnet_ice_ctx_turn_get_bytes_count(const struct tnet_ice_ctx_s* self, uint64_
uint64_t _bytes_in, _bytes_out;
ret = tnet_turn_session_get_bytes_count(self->turn.ss_nominated_rtcp, &_bytes_in, &_bytes_out);
if (ret == 0) {
- if (bytes_in) *bytes_in += _bytes_in;
- if (bytes_out) *bytes_out += _bytes_out;
+ if (bytes_in) {
+ *bytes_in += _bytes_in;
+ }
+ if (bytes_out) {
+ *bytes_out += _bytes_out;
+ }
}
}
return ret;
@@ -1058,19 +1054,19 @@ int tnet_ice_ctx_set_proxy_info(struct tnet_ice_ctx_s* self, enum tnet_proxy_typ
int tnet_ice_ctx_cancel(tnet_ice_ctx_t* self)
{
int ret;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(self);
if (tsk_fsm_get_current_state(self->fsm) == _fsm_state_Started) {
// Do nothing if already in the "started" state
ret = 0;
goto bail;
}
-
+
self->is_active = tsk_false;
self->have_nominated_symetric = tsk_false;
self->have_nominated_answer = tsk_false;
@@ -1080,7 +1076,7 @@ int tnet_ice_ctx_cancel(tnet_ice_ctx_t* self)
ret = tsk_condwait_broadcast(self->turn.condwait);
}
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Cancel);
-
+
bail:
tsk_safeobj_unlock(self);
return ret;
@@ -1089,18 +1085,18 @@ bail:
int tnet_ice_ctx_stop(tnet_ice_ctx_t* self)
{
int ret;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_safeobj_lock(self);
if (!self->is_started) {
ret = 0;
goto bail;
}
-
+
self->is_started = tsk_false;
tsk_condwait_broadcast(self->condwait_pairs);
if (self->turn.condwait) {
@@ -1108,7 +1104,7 @@ int tnet_ice_ctx_stop(tnet_ice_ctx_t* self)
}
ret = tsk_timer_manager_stop(self->h_timer_mgr);
ret = tsk_runnable_stop(TSK_RUNNABLE(self));
-
+
bail:
tsk_safeobj_unlock(self);
return ret;
@@ -1136,92 +1132,92 @@ static int _tnet_ice_ctx_fsm_Started_2_GatheringHostCandidates_X_GatherHostCandi
static const tsk_bool_t dnsserver = tsk_false;
static const long if_index_any = -1; // any interface
static const char* destination = "doubango.org";
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
socket_type = self->use_ipv6 ? tnet_socket_type_udp_ipv6 : tnet_socket_type_udp_ipv4;
-
+
addresses = tnet_get_addresses((self->use_ipv6 ? AF_INET6 : AF_INET), self->unicast, self->anycast, self->multicast, dnsserver, if_index_any);
- if (!addresses || TSK_LIST_IS_EMPTY(addresses)){
+ if (!addresses || TSK_LIST_IS_EMPTY(addresses)) {
TSK_DEBUG_ERROR("Failed to get addresses");
ret = -1;
goto bail;
}
-
-
+
+
check_best_local_ip = (tnet_getbestsource(destination, 5060, socket_type, &best_local_ip) == 0);
curr_local_pref = local_pref = check_best_local_ip ? 0xFFFE : 0xFFFF;
-
+
// lock-list
tsk_list_lock(self->candidates_local);
// clear-list
tsk_list_clear_items(self->candidates_local);
-
- tsk_list_foreach(item, addresses){
- if (!(address = item->data)){
+
+ tsk_list_foreach(item, addresses) {
+ if (!(address = item->data)) {
continue;
}
-
+
// Skip loopback address to avoid problems :)
- if ((address->family == AF_INET && tsk_striequals(address->ip, "127.0.0.1")) || (address->family == AF_INET6 && tsk_striequals(address->ip, "::1"))){
+ if ((address->family == AF_INET && tsk_striequals(address->ip, "127.0.0.1")) || (address->family == AF_INET6 && tsk_striequals(address->ip, "::1"))) {
continue;
}
-
+
// host candidates
ret = tnet_ice_utils_create_sockets(socket_type,
address->ip, &socket_rtp,
self->use_rtcp ? &socket_rtcp : tsk_null);
- if (ret == 0){
+ if (ret == 0) {
const char* foundation_rtp = foundation_default;
tsk_list_lock(self->candidates_local);
- if (socket_rtp){
- if ((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtp, self->is_ice_jingle, tsk_true, self->is_video, self->ufrag, self->pwd, foundation_default))){
+ if (socket_rtp) {
+ if ((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtp, self->is_ice_jingle, tsk_true, self->is_video, self->ufrag, self->pwd, foundation_default))) {
foundation_rtp = (const char*)candidate->foundation;
- if (check_best_local_ip && (candidate->socket && (tsk_striequals(candidate->socket->ip, best_local_ip)))){
+ if (check_best_local_ip && (candidate->socket && (tsk_striequals(candidate->socket->ip, best_local_ip)))) {
curr_local_pref = 0xFFFF;
check_best_local_ip = tsk_false;
tnet_ice_candidate_set_local_pref(candidate, curr_local_pref);
tsk_list_push_front_data(self->candidates_local, (void**)&candidate);
}
- else{
+ else {
curr_local_pref = local_pref--;
tnet_ice_candidate_set_local_pref(candidate, curr_local_pref);
tsk_list_push_back_data(self->candidates_local, (void**)&candidate);
}
}
}
- if (socket_rtcp){
- if ((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtcp, self->is_ice_jingle, tsk_false, self->is_video, self->ufrag, self->pwd, foundation_rtp))){
+ if (socket_rtcp) {
+ if ((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtcp, self->is_ice_jingle, tsk_false, self->is_video, self->ufrag, self->pwd, foundation_rtp))) {
tnet_ice_candidate_set_local_pref(candidate, curr_local_pref);
tsk_list_push_back_data(self->candidates_local, (void**)&candidate);
}
}
tsk_list_unlock(self->candidates_local);
}
-
+
TSK_OBJECT_SAFE_FREE(socket_rtp);
TSK_OBJECT_SAFE_FREE(socket_rtcp);
-
+
// break if no longer running
- if (!self->is_started){
+ if (!self->is_started) {
break;
}
-
+
TSK_DEBUG_INFO("local ip address = %s", address->ip);
}
-
+
// unlock-list
tsk_list_unlock(self->candidates_local);
-
+
bail:
- if (self->is_started){
- if (ret == 0 && !TSK_LIST_IS_EMPTY(self->candidates_local)){
+ if (self->is_started) {
+ if (ret == 0 && !TSK_LIST_IS_EMPTY(self->candidates_local)) {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Success);
}
- else{
+ else {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Failure);
}
}
-
+
TSK_OBJECT_SAFE_FREE(addresses);
return ret;
}
@@ -1231,9 +1227,9 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidates_2_GatheringHostCandidatesDo
{
int ret;
tnet_ice_ctx_t* self;
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
ret = _tnet_ice_ctx_signal_async(self, tnet_ice_event_type_gathering_host_candidates_succeed, "Gathering host candidates succeed");
if (ret == 0) {
if (self->is_stun_enabled && _tnet_ice_ctx_servers_count_by_proto(self, tnet_ice_server_proto_stun) > 0) {
@@ -1251,7 +1247,7 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidates_2_GatheringHostCandidatesDo
}
}
}
-
+
return ret;
}
@@ -1259,7 +1255,7 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidates_2_GatheringHostCandidatesDo
static int _tnet_ice_ctx_fsm_GatheringHostCandidates_2_Terminated_X_Failure(va_list *app)
{
tnet_ice_ctx_t* self;
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
return _tnet_ice_ctx_signal_async(self, tnet_ice_event_type_gathering_host_candidates_failed, "Gathering host candidates failed");
}
@@ -1287,16 +1283,16 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
fd_set set;
tsk_size_t srflx_addr_count_added = 0, srflx_addr_count_skipped = 0, host_addr_count = 0;
long tv_sec, tv_usec; //very important to save these values as timeval could be modified by select() - happens on iOS -
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
// Get ICE servers to use to gather reflexive candidates
ice_servers = _tnet_ice_ctx_servers_copy(self, tnet_ice_server_proto_stun);
if (!ice_servers || TSK_LIST_IS_EMPTY(ice_servers)) { // not expected to be null or empty because we checked the number of such servers before calling this transition
TSK_DEBUG_WARN("No valid STUN server could be used to gather reflexive candidates");
goto bail;
}
-
+
// set all default values to -1
// = {{ -1 }} will only set the first element
for (i = 0; i < sizeof(fds) / sizeof(fds[0]); ++i) {
@@ -1305,17 +1301,17 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
for (i = 0; i < sizeof(fds_skipped) / sizeof(fds_skipped[0]); ++i) {
fds_skipped[i] = TNET_INVALID_FD;
}
-
+
rc = self->Rc;
tv.tv_sec = tv_sec = 0;
tv.tv_usec = tv_usec = 0;
-
+
// load fds for both rtp and rtcp sockets
tsk_list_foreach(item, self->candidates_local) {
if (!(candidate = item->data)) {
continue;
}
-
+
++host_addr_count;
if ((fds_count < sizeof(fds) / sizeof(fds[0])) && candidate->socket) {
fds[fds_count++] = candidate->socket->fd;
@@ -1324,13 +1320,13 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
}
}
}
-
-
+
+
/* RFC 5389 - 7.2.1. Sending over UDP
A client SHOULD retransmit a STUN request message starting with an
interval of RTO ("Retransmission TimeOut"), doubling after each
retransmission.
-
+
e.g. 0 ms, 500 ms, 1500 ms, 3500 ms, 7500ms, 15500 ms, and 31500 ms
*/
for (i = 0; (i < rc && self->is_started && ((srflx_addr_count_added + srflx_addr_count_skipped) < host_addr_count)); ++i) {
@@ -1362,16 +1358,16 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
#else
tv.tv_usec = tv_usec;
#endif
-
+
TSK_DEBUG_INFO("ICE reflexive candidates gathering ...srv_addr=%s,srv_port=%u,tv_sec=%lu,tv_usec=%lu,rto=%d", ice_server->str_server_addr, ice_server->u_server_port, tv_sec, tv_usec, ice_server->rto);
-
+
FD_ZERO(&set);
for (k = 0; k < fds_count; ++k) {
FD_SET(fds[k], &set);
}
-
+
// sends STUN binding requets
- tsk_list_foreach(item, self->candidates_local){
+ tsk_list_foreach(item, self->candidates_local) {
if (!(candidate = (tnet_ice_candidate_t*)item->data)) {
continue;
}
@@ -1379,7 +1375,7 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
ret = tnet_ice_candidate_send_stun_bind_request(candidate, &ice_server->obj_server_addr, ice_server->str_username, ice_server->str_password);
}
}
-
+
if ((ret = select(fd_max + 1, &set, NULL, NULL, &tv)) < 0) {
TSK_DEBUG_ERROR("select() failed with error code = %d", tnet_geterrno());
goto bail;
@@ -1398,27 +1394,27 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
unsigned int len = 0;
void* data = 0;
const tnet_ice_candidate_t* candidate_curr;
-
+
// Check how many bytes are pending
if ((ret = tnet_ioctlt(fd, FIONREAD, &len)) < 0) {
TSK_DEBUG_ERROR("tnet_ioctlt() failed");
continue;
}
-
+
if (len == 0) {
TSK_DEBUG_INFO("tnet_ioctlt() retured zero bytes");
continue;
}
-
+
// Receive pending data
data = tsk_calloc(len, sizeof(uint8_t));
if ((ret = tnet_sockfd_recv(fd, data, len, 0)) < 0) {
TSK_FREE(data);
-
+
TSK_DEBUG_ERROR("Recving STUN dgrams failed with error code:%d", tnet_geterrno());
continue;
}
-
+
// Parse the incoming response
if ((ret = tnet_stun_pkt_read(data, (tsk_size_t)ret, &response))) {
TSK_FREE(data);
@@ -1435,7 +1431,7 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
tsk_size_t j;
tsk_bool_t already_skipped = tsk_false;
/* refc 5245- 4.1.3. Eliminating Redundant Candidates
-
+
Next, the agent eliminates redundant candidates. A candidate is
redundant if its transport address equals another candidate, and its
base equals the base of that other candidate. Note that two
@@ -1450,7 +1446,7 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
break;
}
}
-
+
if (!already_skipped) {
++srflx_addr_count_skipped;
fds_skipped[j] = fd;
@@ -1488,19 +1484,21 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
}
} // tsk_list_foreach (item, ice_servers)...
} // for (i = 0; (i < rc....
-
+
bail:
TSK_DEBUG_INFO("srflx_addr_count_added=%u, srflx_addr_count_skipped=%u", (unsigned)srflx_addr_count_added, (unsigned)srflx_addr_count_skipped);
- if ((srflx_addr_count_added + srflx_addr_count_skipped) > 0) ret = 0; // Hack the returned value if we have at least one success (happens when timeouts)
+ if ((srflx_addr_count_added + srflx_addr_count_skipped) > 0) {
+ ret = 0; // Hack the returned value if we have at least one success (happens when timeouts)
+ }
if (self->is_started) {
if (ret == 0) {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Success);
}
- else{
+ else {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Failure);
}
}
-
+
tsk_list_foreach(item, self->candidates_local) {
if (!(candidate = (tnet_ice_candidate_t*)item->data)) {
continue;
@@ -1515,9 +1513,9 @@ bail:
static int _tnet_ice_ctx_fsm_GatheringReflexiveCandidates_2_GatheringReflexiveCandidatesDone_X_Success(va_list *app)
{
tnet_ice_ctx_t* self;
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
if (self->is_started) {
int ret = _tnet_ice_ctx_signal_async(self, tnet_ice_event_type_gathering_reflexive_candidates_succeed, "Gathering reflexive candidates succeed");
if (ret == 0) {
@@ -1560,19 +1558,19 @@ static int _tnet_ice_ctx_fsm_GatheringReflexiveCandidatesDone_2_GatheringRelayCa
tnet_ice_servers_L_t* ice_servers = tsk_null;
tnet_ice_server_t* ice_server;
tnet_ice_candidates_L_t* candidates_local_copy = tsk_null;;
-
+
// Create TURN condwait handle if not already done
if (!self->turn.condwait && !(self->turn.condwait = tsk_condwait_create())) {
TSK_DEBUG_ERROR("Failed to create TURN condwait handle");
ret = -2;
goto bail;
}
-
+
// Copy local ICE candidates
tsk_list_lock(self->candidates_local);
candidates_local_copy = tsk_list_clone(self->candidates_local);
tsk_list_unlock(self->candidates_local);
-
+
// Take reference to the TURN servers
ice_servers = _tnet_ice_ctx_servers_copy(self, tnet_ice_server_proto_turn);
if (!ice_servers || TSK_LIST_IS_EMPTY(ice_servers)) {
@@ -1595,14 +1593,14 @@ next_server:
goto bail;
}
ice_server = (tnet_ice_server_t*)item_server->data;
-
+
// Create TURN sessions for each local host candidate
tsk_list_foreach(item, candidates_local_copy) {
if (!(candidate = item->data)) {
continue;
}
TSK_DEBUG_INFO("Gathering relay candidate: local addr=%s=%d, TURN server=%s:%d", candidate->connection_addr, candidate->port, ice_server->str_server_addr, ice_server->u_server_port);
-
+
// Destroy previvious TURN session (if exist)
TSK_OBJECT_SAFE_FREE(candidate->turn.ss);
if (candidate->type_e == tnet_ice_cand_type_host && candidate->socket) { // do not create TURN session for reflexive candidates
@@ -1648,16 +1646,16 @@ next_server:
++host_addr_count;
}
} // tsk_list_foreach(item, self->candidates_local) {
-
+
rto = self->RTO;
rc = self->Rc;
-
+
for (i = 0; (i < rc && self->is_started && ((relay_addr_count_ok + relay_addr_count_nok) < host_addr_count));) {
if (!self->is_started || !self->is_active) {
TSK_DEBUG_INFO("ICE context stopped/cancelled while gathering TURN candidates");
goto bail;
}
-
+
u_t0 = tsk_time_now();
tsk_condwait_timedwait(self->turn.condwait, rto);
u_t1 = tsk_time_now();
@@ -1666,7 +1664,7 @@ next_server:
rto <<= 1;
++i;
}
-
+
// count the number of TURN sessions with alloc() = ok/nok and ignore ones without response
relay_addr_count_ok = 0;
tsk_list_foreach(item, candidates_local_copy) {
@@ -1685,7 +1683,7 @@ next_server:
}
}
}
-
+
// add/delete TURN candidates
tsk_list_foreach(item, candidates_local_copy) {
if (!(candidate = item->data) || !candidate->turn.ss) {
@@ -1701,7 +1699,7 @@ next_server:
tnet_port_t relay_port;
tnet_ice_candidate_t* new_cand = tsk_null;
struct tnet_socket_s* p_lcl_sock = tsk_null;
-
+
if ((ret = tnet_turn_session_get_relayed_addr(candidate->turn.ss, &relay_addr, &relay_port, &__b_ipv6))) {
goto bail;
}
@@ -1733,12 +1731,12 @@ next_server:
TSK_OBJECT_SAFE_FREE(candidate->turn.ss);
}
}
-
+
// Try next TURN server
if (self->is_started && item_server && relay_addr_count_added == 0) {
goto next_server;
}
-
+
bail:
if (self->is_started) {
if (ret == 0) {
@@ -1778,34 +1776,34 @@ static int _tnet_ice_ctx_fsm_Any_2_Started_X_Cancel(va_list *app)
{
tnet_ice_ctx_t* self;
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
tsk_list_lock(self->candidates_remote);
tsk_list_clear_items(self->candidates_remote);
tsk_list_unlock(self->candidates_remote);
-
+
tsk_list_lock(self->candidates_pairs);
tsk_list_clear_items(self->candidates_pairs);
tsk_list_unlock(self->candidates_pairs);
-
+
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtp);
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtcp);
-
+
// Do not clear local candidates because then will be used as fallback if the remote peer is an ICE-lite
// These candidates will be cleared before the next local gathering
// tsk_list_lock(self->candidates_local);
// tsk_list_clear_items(self->candidates_local);
// tsk_list_unlock(self->candidates_local);
-
+
// restore "is_cancelled" until next cancel
// set "is_active" to false to allow ICE re-start
// self->is_cancelled = tsk_false;
// self->is_active = tsk_false;
-
+
// alert user
_tnet_ice_ctx_signal_async(self, tnet_ice_event_type_cancelled, "Cancelled");
-
+
return 0;
-
+
}
// Any -> (GatheringComplet) -> GatheringCompleted
@@ -1814,25 +1812,25 @@ static int _tnet_ice_ctx_fsm_Any_2_GatheringCompleted_X_GatheringComplet(va_list
int ret = 0;
tnet_ice_ctx_t* self;
tsk_bool_t has_remote_candidates;
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
// alert user
_tnet_ice_ctx_signal_async(self, tnet_ice_event_type_gathering_completed, "Gathering candidates completed");
-
- if (self->is_started){
+
+ if (self->is_started) {
tsk_list_lock(self->candidates_remote);
has_remote_candidates = !TSK_LIST_IS_EMPTY(self->candidates_remote);
tsk_list_unlock(self->candidates_remote);
-
- if (has_remote_candidates){
+
+ if (has_remote_candidates) {
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_ConnCheck);
}
}
- else{
+ else {
return -1;
}
-
+
return ret;
}
@@ -1861,42 +1859,42 @@ static int _tnet_ice_ctx_fsm_GatheringCompleted_2_ConnChecking_X_ConnCheck(va_li
void* recvfrom_buff_ptr = tsk_null;
tsk_size_t recvfrom_buff_size = 0, tries_count = 0, tries_count_min = kIceConnCheckMinTriesMin;
enum tnet_stun_state_e e_state;
-
+
self = va_arg(*app, tnet_ice_ctx_t *);
-
+
self->is_connchecking = tsk_true;
-
+
// "tries_count" and "tries_count_min"
// The connection checks to to the "relay", "prflx", "srflx" and "host" candidates are sent at the same time.
// Because the requests are sent at the same time it's possible to have success check for "relay" (or "srflx") candidates before the "host" candidates.
// "tries_count_min" is the minimum (if success check is not for "host" candidates) tries before giving up.
// The pairs are already sorted ("host"->"srflx"->"prflx", "relay") to make sure to choose the best candidates when there are more than one success conncheck.
-
+
start_conneck:
role_conflict = tsk_false;
restart_conneck = tsk_false;
-
+
tsk_list_lock(self->candidates_pairs);
tsk_list_clear_items(self->candidates_pairs);
tsk_list_unlock(self->candidates_pairs);
-
+
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtp);
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtcp);
-
+
if ((ret = _tnet_ice_ctx_build_pairs(self, self->candidates_local, self->candidates_remote, self->candidates_pairs, self->is_controlling, self->tie_breaker, self->is_ice_jingle, self->use_rtcpmux))) {
TSK_DEBUG_ERROR("_tnet_ice_ctx_build_pairs() failed");
goto bail;
}
-
+
#define _FD_ISSET(_fds, _fds_count, _fd, _isset) { uint16_t __i; *_isset = 0; for (__i = 0; __i < _fds_count; ++__i) { if (_fds[__i] == _fd) { *_isset = 1; break; } } }
-
+
// load fds for both rtp and rtcp sockets / create TURN permissions
tsk_list_lock(self->candidates_pairs);
- tsk_list_foreach(item, self->candidates_pairs){
- if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->socket){
+ tsk_list_foreach(item, self->candidates_pairs) {
+ if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->socket) {
continue;
}
-
+
if ((fds_count < sizeof(fds) / sizeof(fds[0])) && pair->candidate_offer->socket) {
if (pair->candidate_offer->turn.ss && (ret = tnet_turn_session_get_state_createperm(pair->candidate_offer->turn.ss, pair->turn_peer_id, &e_state)) == 0) {
if (e_state == tnet_stun_state_none) {
@@ -1924,21 +1922,21 @@ start_conneck:
}
}
tsk_list_unlock(self->candidates_pairs);
-
+
concheck_timeout = self->concheck_timeout;
time_start = time_curr = tsk_time_now();
time_end = (time_start + concheck_timeout);
tries_count_min = fds_turn_count > 0 ? kIceConnCheckMinTriesMax : kIceConnCheckMinTriesMin;
-
+
while (self->is_started && self->is_active && (time_curr < time_end) && !self->have_nominated_symetric) {
tv.tv_sec = 0;
tv.tv_usec = (rto * 1000);
-
+
FD_ZERO(&set);
for (k = 0; k < fds_count; ++k) {
FD_SET(fds[k], &set);
}
-
+
// set new current time here to avoid "continue" skips
// ignore already ellapsed time if new timeout value is defined
time_curr = tsk_time_now();
@@ -1947,7 +1945,7 @@ start_conneck:
time_start = time_curr;
time_end = (time_start + concheck_timeout);
}
-
+
// Send ConnCheck requests
// the pairs are already sorted by priority (from high to low)
if (!self->have_nominated_symetric) {
@@ -1956,21 +1954,22 @@ start_conneck:
continue;
}
switch (pair->state_offer) {
- case tnet_ice_pair_state_failed:
- case tnet_ice_pair_state_succeed:
- continue;
- default: break;
+ case tnet_ice_pair_state_failed:
+ case tnet_ice_pair_state_succeed:
+ continue;
+ default:
+ break;
}
-
+
ret = tnet_ice_pair_send_conncheck((tnet_ice_pair_t *)pair);
}
}
-
+
if (fds_count == 0) {
tsk_thread_sleep(10);
goto check_nomination;
}
-
+
if ((ret = select(fd_max + 1, &set, NULL, NULL, &tv)) < 0) {
TNET_PRINT_LAST_ERROR("select() failed");
goto bail;
@@ -1986,30 +1985,30 @@ start_conneck:
tnet_fd_t fd = fds[k];
unsigned int len = 0;
tsk_size_t read = 0;
-
+
if (!FD_ISSET(fd, &set)) {
continue;
}
-
+
// Check how many bytes are pending
if ((ret = tnet_ioctlt(fd, FIONREAD, &len)) < 0) {
continue;
}
-
- if (len == 0){
+
+ if (len == 0) {
// TSK_DEBUG_INFO("tnet_ioctlt() returent zero bytes");
continue;
}
-
+
// Receive pending data
- if (recvfrom_buff_size < len){
- if (!(recvfrom_buff_ptr = tsk_realloc(recvfrom_buff_ptr, len))){
+ if (recvfrom_buff_size < len) {
+ if (!(recvfrom_buff_ptr = tsk_realloc(recvfrom_buff_ptr, len))) {
recvfrom_buff_size = 0;
goto bail;
}
recvfrom_buff_size = len;
}
-
+
// receive all messages
while (self->is_started && self->is_active && read < len && ret == 0) {
if ((ret = tnet_sockfd_recvfrom(fd, recvfrom_buff_ptr, recvfrom_buff_size, 0, (struct sockaddr *)&remote_addr)) < 0) {
@@ -2024,13 +2023,13 @@ start_conneck:
len = 0;
continue;
}
-
+
TNET_PRINT_LAST_ERROR("Receiving STUN dgrams failed with errno=%d", err);
goto bail;
}
-
+
read += ret;
-
+
// recv() STUN message (request / response)
ret = tnet_ice_ctx_recv_stun_message(self, recvfrom_buff_ptr, (tsk_size_t)ret, fd, &remote_addr, &role_conflict);
if (ret == 0 && role_conflict) {
@@ -2041,13 +2040,13 @@ start_conneck:
}
}
}
-
- check_nomination:
+
+check_nomination:
// check whether we need to re-start connection checking
if (restart_conneck) {
goto start_conneck;
}
-
+
check_rtcp = (self->use_rtcp && !self->use_rtcpmux);
if (!self->have_nominated_offer) {
self->have_nominated_offer = tnet_ice_pairs_have_nominated_offer(self->candidates_pairs, check_rtcp);
@@ -2060,11 +2059,11 @@ start_conneck:
self->have_nominated_symetric &= (got_hosts || ((tries_count++) >= tries_count_min));
}
} // while (self->is_started...
-
+
// "ret" could be "<>0" if last function used was "select()", "recvfrom()", "ioctlt()"...this is why we set the value to #0.
// if there was an error then, we'll jump to "bail:" and next code is skipped
ret = 0;
-
+
bail:
// move to the next state depending on the conncheck result
if (self->is_started) {
@@ -2081,11 +2080,11 @@ bail:
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_Failure);
}
}
-
+
TSK_FREE(recvfrom_buff_ptr);
-
+
self->is_connchecking = tsk_false;
-
+
return ret;
}
@@ -2099,19 +2098,19 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
const tnet_ice_candidate_t *candidate;
tsk_list_t* sessions = tsk_list_create(); // for lock-free TURN sessions destroying
int ret;
-
+
// When destroying TURN sessions the transport is locked by shutdown()
// This function locks "self->candidates_pairs"
// TURN callback locks "self->candidates_pairs"
// TURN callback locks the transport
// => We must not lock the candidates when destroying the TURN session
// Test with WES8 if you want to reproduce the issue
-
+
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtp);
TSK_OBJECT_SAFE_FREE(self->turn.ss_nominated_rtcp);
-
+
tsk_list_lock(self->candidates_pairs);
-
+
// take a reference to the negotiated TURN sessions
ret = tnet_ice_pairs_get_nominated_symetric_pairs(self->candidates_pairs, TNET_ICE_CANDIDATE_COMPID_RTP, &pair_offer, &pair_answer_src, &pair_answer_dest);
if (ret == 0) {
@@ -2123,8 +2122,10 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
TSK_DEBUG_INFO("ICE: nominated symetric RTP pairs: offer:%llu, answer-src:%llu, answser-dest:%llu",
pair_offer ? pair_offer->id : 0, pair_answer_src ? pair_answer_src->id : 0, pair_answer_dest ? pair_answer_dest->id : 0);
}
- if (ret == 0 && pair_offer) { ((tnet_ice_pair_t *)pair_offer)->is_nominated = tsk_true; } // "is_nominated" is used do decide whether to include "USE-CANDIDATE" attribute when aggressive mode is disabled
-
+ if (ret == 0 && pair_offer) {
+ ((tnet_ice_pair_t *)pair_offer)->is_nominated = tsk_true; // "is_nominated" is used do decide whether to include "USE-CANDIDATE" attribute when aggressive mode is disabled
+ }
+
ret = tnet_ice_pairs_get_nominated_symetric_pairs(self->candidates_pairs, TNET_ICE_CANDIDATE_COMPID_RTCP, &pair_offer, &pair_answer_src, &pair_answer_dest);
if (ret == 0) {
if (pair_offer && pair_offer->candidate_offer && pair_offer->candidate_offer->type_e == tnet_ice_cand_type_relay && pair_offer->candidate_offer->turn.ss) {
@@ -2136,8 +2137,10 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
self->use_rtcp ? 1 : 0, self->use_rtcpmux ? 1 : 0,
pair_offer ? pair_offer->id : 0, pair_answer_src ? pair_answer_src->id : 0, pair_answer_dest ? pair_answer_dest->id : 0);
}
- if (ret == 0 && pair_offer) { ((tnet_ice_pair_t *)pair_offer)->is_nominated = tsk_true; } // "is_nominated" is used do decide whether to include "USE-CANDIDATE" attribute when aggressive mode is disabled
-
+ if (ret == 0 && pair_offer) {
+ ((tnet_ice_pair_t *)pair_offer)->is_nominated = tsk_true; // "is_nominated" is used do decide whether to include "USE-CANDIDATE" attribute when aggressive mode is disabled
+ }
+
// collect all useless TURN sessions (pairs)
tsk_list_foreach(item, self->candidates_pairs) {
if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->turn.ss) {
@@ -2148,9 +2151,9 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
TSK_OBJECT_SAFE_FREE(pair->candidate_offer->turn.ss);
}
}
-
+
tsk_list_unlock(self->candidates_pairs);
-
+
// collect all useless TURN sessions (local candidates)
tsk_list_lock(self->candidates_local);
tsk_list_foreach(item, self->candidates_local) {
@@ -2163,7 +2166,7 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
}
}
tsk_list_unlock(self->candidates_local);
-
+
// collect all useless TURN sessions (remote candidates)
tsk_list_lock(self->candidates_remote);
tsk_list_foreach(item, self->candidates_remote) {
@@ -2176,10 +2179,10 @@ static int _tnet_ice_ctx_fsm_ConnChecking_2_ConnCheckingCompleted_X_Success(va_l
}
}
tsk_list_unlock(self->candidates_remote);
-
+
// lock-free destruction
TSK_OBJECT_SAFE_FREE(sessions);
-
+
return _tnet_ice_ctx_signal_async(self, tnet_ice_event_type_conncheck_succeed, "ConnCheck succeed");
}
@@ -2203,15 +2206,15 @@ static int _tnet_ice_ctx_fsm_Any_2_Terminated_X_AnyNotStarted(va_list *app)
static int _tnet_ice_ctx_fsm_OnTerminated(tnet_ice_ctx_t* self)
{
TSK_DEBUG_INFO("=== ICE CTX SM Terminated ===");
-
- if (!self){
+
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter.");
return -1;
}
-
+
// still started but no longer active
self->is_active = tsk_false;
-
+
return 0;
}
@@ -2227,10 +2230,10 @@ static int _tnet_ice_ctx_restart(tnet_ice_ctx_t* self)
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
ret = tsk_fsm_set_current_state(self->fsm, _fsm_state_Started);
ret = _tnet_ice_ctx_fsm_act(self, _fsm_action_GatherHostCandidates);
-
+
self->is_active = (ret == 0);
return ret;
}
@@ -2243,9 +2246,9 @@ static int _tnet_ice_ctx_recv_stun_message_for_pair(tnet_ice_ctx_t* self, const
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
*role_conflict = tsk_false;
-
+
if (!TNET_STUN_BUFF_IS_STUN2(((uint8_t*)data), size)) {
if (self->rtp_callback) {
return self->rtp_callback(self->rtp_callback_data, data, size, local_fd, remote_addr);
@@ -2253,12 +2256,12 @@ static int _tnet_ice_ctx_recv_stun_message_for_pair(tnet_ice_ctx_t* self, const
TSK_DEBUG_INFO("Not STUN message");
return 0;
}
-
+
if (!self->is_active) {
TSK_DEBUG_INFO("ICE context not active yet");
return 0;
}
-
+
if ((ret = tnet_stun_pkt_read(data, size, &message)) == 0 && message) {
if (message->e_type == tnet_stun_pkt_type_binding_request) {
tsk_bool_t is_local_conncheck_started;
@@ -2278,7 +2281,7 @@ static int _tnet_ice_ctx_recv_stun_message_for_pair(tnet_ice_ctx_t* self, const
if (!pair && is_local_conncheck_started) {
pair = tnet_ice_pairs_find_by_fd_and_addr(self->candidates_pairs, local_fd, remote_addr);
}
- if (!pair && !self->have_nominated_symetric && is_local_conncheck_started){ // pair not found and we're still negotiating
+ if (!pair && !self->have_nominated_symetric && is_local_conncheck_started) { // pair not found and we're still negotiating
// rfc 5245 - 7.1.3.2.1. Discovering Peer Reflexive Candidates
tnet_ice_pair_t* pair_peer = tnet_ice_pair_prflx_create(self->candidates_pairs, local_fd, remote_addr);
if (pair_peer) {
@@ -2292,12 +2295,12 @@ static int _tnet_ice_ctx_recv_stun_message_for_pair(tnet_ice_ctx_t* self, const
char* resp_phrase = tsk_null;
// authenticate the request
tnet_ice_pair_auth_conncheck(pair, message, data, size, &resp_code, &resp_phrase);
- if (resp_code > 0 && resp_phrase){
- if (resp_code >= 200 && resp_code <= 299){
+ if (resp_code > 0 && resp_phrase) {
+ if (resp_code >= 200 && resp_code <= 299) {
// Before sending the success response check that there are no role conflict
- if (self->is_controlling){ // I'm ICE-CONTROLLING
+ if (self->is_controlling) { // I'm ICE-CONTROLLING
const tnet_stun_attr_vdata_t* stun_att_ice_controlling;
- if ((ret = tnet_stun_pkt_attr_find_first(message, tnet_stun_attr_type_ice_controlling, (const tnet_stun_attr_t**)&stun_att_ice_controlling)) == 0 && stun_att_ice_controlling){
+ if ((ret = tnet_stun_pkt_attr_find_first(message, tnet_stun_attr_type_ice_controlling, (const tnet_stun_attr_t**)&stun_att_ice_controlling)) == 0 && stun_att_ice_controlling) {
TSK_DEBUG_WARN("Role conflicts (SEND)");
if (self->tie_breaker >= *((uint64_t*)stun_att_ice_controlling->p_data_ptr)) {
resp_code = kStunErrCodeIceConflict;
@@ -2363,13 +2366,13 @@ static int _tnet_ice_ctx_recv_stun_message_for_pair(tnet_ice_ctx_t* self, const
}
}
TSK_OBJECT_SAFE_FREE(message);
-
+
return ret;
}
static int _tnet_ice_ctx_send_turn_raw(struct tnet_ice_ctx_s* self, struct tnet_turn_session_s* turn_ss, tnet_turn_peer_id_t turn_peer_id, const void* data, tsk_size_t size)
{
- if (!self || !turn_ss || !data || !size){
+ if (!self || !turn_ss || !data || !size) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -2386,21 +2389,21 @@ static int _tnet_ice_ctx_build_pairs(struct tnet_ice_ctx_s* self, tnet_ice_candi
tnet_ice_pair_t *pair;
enum tnet_turn_transport_e e_req_transport;
tnet_family_t addr_family_local, addr_family_remote;
-
+
if (!self || TSK_LIST_IS_EMPTY(local_candidates) || TSK_LIST_IS_EMPTY(remote_candidates) || !result_pairs) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
self->is_building_pairs = tsk_true;
TSK_DEBUG_INFO("ICE: begin building pairs(is_rtcpmuxed=%d)", is_rtcpmuxed);
-
+
tsk_list_clear_items(result_pairs);
-
+
tsk_list_lock(local_candidates);
tsk_list_lock(remote_candidates);
tsk_list_lock(result_pairs);
-
+
tsk_list_foreach(item_local, local_candidates) {
if (!(cand_local = item_local->data)) {
continue;
@@ -2413,7 +2416,7 @@ static int _tnet_ice_ctx_build_pairs(struct tnet_ice_ctx_s* self, tnet_ice_candi
continue;
}
#endif
-
+
tsk_list_foreach(item_remote, remote_candidates) {
if (!(cand_remote = item_remote->data)) {
continue;
@@ -2423,9 +2426,9 @@ static int _tnet_ice_ctx_build_pairs(struct tnet_ice_ctx_s* self, tnet_ice_candi
TSK_DEBUG_INFO("Skipping remote ICE candidate with port = 0");
continue;
}
-
+
// CompIds(1=RTP, 2=RTCP) must match
- if ((cand_remote->comp_id != cand_local->comp_id)){
+ if ((cand_remote->comp_id != cand_local->comp_id)) {
continue;
}
// IP versions must match. Cannot use IPv4 socket to send/recv to IPv6 address.
@@ -2453,18 +2456,18 @@ static int _tnet_ice_ctx_build_pairs(struct tnet_ice_ctx_s* self, tnet_ice_candi
continue;
}
}
-
+
if ((pair = tnet_ice_pair_create(cand_local, cand_remote, is_controlling, tie_breaker, is_ice_jingle))) {
TSK_DEBUG_INFO("ICE Pair(%llu, %llu): [%s %u %u %s %d] -> [%s %u %u %s %d]",
pair->id,
pair->priority,
-
+
cand_local->foundation,
cand_local->priority,
cand_local->comp_id,
cand_local->connection_addr,
cand_local->port,
-
+
cand_remote->foundation,
cand_remote->priority,
cand_remote->comp_id,
@@ -2479,31 +2482,31 @@ static int _tnet_ice_ctx_build_pairs(struct tnet_ice_ctx_s* self, tnet_ice_candi
if (!(pair = item_local->data)) {
continue;
}
-
+
TSK_DEBUG_INFO("ICE Pair(%llu, %llu): [%s %u %s %d] -> [%s %u %s %d]",
pair->id,
pair->priority,
-
+
pair->candidate_offer->foundation,
pair->candidate_offer->comp_id,
pair->candidate_offer->connection_addr,
pair->candidate_offer->port,
-
+
pair->candidate_answer->foundation,
pair->candidate_answer->comp_id,
pair->candidate_answer->connection_addr,
pair->candidate_answer->port);
}
#endif
-
+
tsk_list_unlock(local_candidates);
tsk_list_unlock(remote_candidates);
tsk_list_unlock(result_pairs);
-
+
self->is_building_pairs = tsk_false;
tsk_condwait_broadcast(self->condwait_pairs);
TSK_DEBUG_INFO("ICE: end building pairs");
-
+
return 0;
}
@@ -2514,32 +2517,32 @@ static int _tnet_ice_ctx_fsm_act(tnet_ice_ctx_t* self, tsk_fsm_action_id action_
tnet_ice_event_t* e = tsk_null;
static const char* phrase = "$action$";
int ret = 0;
-
- if (!self || !self->fsm){
+
+ if (!self || !self->fsm) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if (!(action = tnet_ice_action_create(action_id))){
+ if (!(action = tnet_ice_action_create(action_id))) {
TSK_DEBUG_ERROR("Failed to create action");
return -2;
}
-
+
if (self->is_sync_mode) {
ret = tsk_fsm_act(self->fsm, action->id, self, action, self, action);
}
else {
- if ((e = tnet_ice_event_create(self, tnet_ice_event_type_action, phrase, self->userdata))){
+ if ((e = tnet_ice_event_create(self, tnet_ice_event_type_action, phrase, self->userdata))) {
tnet_ice_event_set_action(e, action);
TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(self), e);
goto bail;
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create ICE event");
ret = -2;
goto bail;
}
}
-
+
bail:
TSK_OBJECT_SAFE_FREE(e);
TSK_OBJECT_SAFE_FREE(action);
@@ -2549,21 +2552,21 @@ bail:
static int _tnet_ice_ctx_signal_async(tnet_ice_ctx_t* self, tnet_ice_event_type_t type, const char* phrase)
{
tnet_ice_event_t* e;
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (self->is_silent_mode && type != tnet_ice_event_type_action) { // silent mode ON and not action to move the FSM
TSK_DEBUG_INFO("ICE silent mode ON...to not notify '%d:%s'", type, phrase);
return 0;
}
-
- if ((e = tnet_ice_event_create(self, type, phrase, self->userdata))){
+
+ if ((e = tnet_ice_event_create(self, type, phrase, self->userdata))) {
TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(self), e);
return 0;
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create ICE event");
return -2;
}
@@ -2574,114 +2577,110 @@ static int _tnet_ice_ctx_turn_callback(const struct tnet_turn_session_event_xs *
tnet_ice_ctx_t *ctx = tsk_object_ref(TSK_OBJECT(e->pc_usr_data));
struct tnet_turn_session_s* session = tsk_object_ref(TSK_OBJECT(e->pc_session));
int ret = 0;
-
+
if (!ctx) {
// the ICE context is being destroyed but TURN session not freed yet
goto bail;
}
-
+
switch (e->e_type) {
- case tnet_turn_session_event_type_alloc_ok:
- case tnet_turn_session_event_type_refresh_ok:
- case tnet_turn_session_event_type_chanbind_ok:
- case tnet_turn_session_event_type_connect_ok:
- default:
- {
- break;
- }
-
- case tnet_turn_session_event_type_alloc_nok:
- case tnet_turn_session_event_type_refresh_nok:
- case tnet_turn_session_event_type_perm_nok:
- case tnet_turn_session_event_type_chanbind_nok:
- case tnet_turn_session_event_type_connect_nok:
- {
- // Do not raise error event if no nominated candidate because
- // TURN error could be raised by the session when we're in "conncheck" state and this is a normal case.
- if (ctx->is_active && ctx->is_started && ctx->turn.ss_nominated_rtp && ctx->turn.peer_id_rtp == e->u_peer_id) {
- TSK_DEBUG_ERROR("TURN connection broken (peer-id=%ld)", e->u_peer_id);
- if ((ret = _tnet_ice_ctx_signal_async(ctx, tnet_ice_event_type_turn_connection_broken, "TURN connection is broken"))) {
- goto bail;
- }
+ case tnet_turn_session_event_type_alloc_ok:
+ case tnet_turn_session_event_type_refresh_ok:
+ case tnet_turn_session_event_type_chanbind_ok:
+ case tnet_turn_session_event_type_connect_ok:
+ default: {
+ break;
+ }
+
+ case tnet_turn_session_event_type_alloc_nok:
+ case tnet_turn_session_event_type_refresh_nok:
+ case tnet_turn_session_event_type_perm_nok:
+ case tnet_turn_session_event_type_chanbind_nok:
+ case tnet_turn_session_event_type_connect_nok: {
+ // Do not raise error event if no nominated candidate because
+ // TURN error could be raised by the session when we're in "conncheck" state and this is a normal case.
+ if (ctx->is_active && ctx->is_started && ctx->turn.ss_nominated_rtp && ctx->turn.peer_id_rtp == e->u_peer_id) {
+ TSK_DEBUG_ERROR("TURN connection broken (peer-id=%ld)", e->u_peer_id);
+ if ((ret = _tnet_ice_ctx_signal_async(ctx, tnet_ice_event_type_turn_connection_broken, "TURN connection is broken"))) {
+ goto bail;
}
- break;
}
-
- case tnet_turn_session_event_type_perm_ok:
- {
- enum tnet_turn_transport_e e_req_transport;
- if ((ret = tnet_turn_session_get_req_transport(session, &e_req_transport))) {
+ break;
+ }
+
+ case tnet_turn_session_event_type_perm_ok: {
+ enum tnet_turn_transport_e e_req_transport;
+ if ((ret = tnet_turn_session_get_req_transport(session, &e_req_transport))) {
+ goto bail;
+ }
+
+ if (e_req_transport == tnet_turn_transport_tcp) {
+ // TCP-Connect: rfc6062 - 4.3. Initiating a Connection
+ if ((ret = tnet_turn_session_connect(session, e->u_peer_id))) {
goto bail;
}
-
- if (e_req_transport == tnet_turn_transport_tcp) {
- // TCP-Connect: rfc6062 - 4.3. Initiating a Connection
- if ((ret = tnet_turn_session_connect(session, e->u_peer_id))) {
- goto bail;
- }
+ }
+ else {
+ // Bind a channel (not required). If succeed, will be used to save bandwidth usage.
+ // TODO: should be done only if first "get_state(chanbind)==none". Not an issue, if it already exists then, will be refreshed.
+ if ((ret = tnet_turn_session_chanbind(session, e->u_peer_id))) {
+ goto bail;
}
- else {
- // Bind a channel (not required). If succeed, will be used to save bandwidth usage.
- // TODO: should be done only if first "get_state(chanbind)==none". Not an issue, if it already exists then, will be refreshed.
- if ((ret = tnet_turn_session_chanbind(session, e->u_peer_id))) {
- goto bail;
+ }
+ break;
+ }
+
+ case tnet_turn_session_event_type_recv_data: {
+ tsk_bool_t role_conflict;
+ tnet_ice_pair_t* pair = tsk_null;
+ if (e->u_peer_id != kTurnPeerIdInvalid) {
+ const tsk_list_item_t *item;
+ tsk_list_lock(ctx->candidates_pairs);
+ tsk_list_foreach(item, ctx->candidates_pairs) {
+ if (((const tnet_ice_pair_t*)item->data)->turn_peer_id == e->u_peer_id) {
+ pair = tsk_object_ref((void*)item->data);
+ break;
}
}
- break;
+ tsk_list_unlock(ctx->candidates_pairs);
}
-
- case tnet_turn_session_event_type_recv_data:
- {
- tsk_bool_t role_conflict;
- tnet_ice_pair_t* pair = tsk_null;
- if (e->u_peer_id != kTurnPeerIdInvalid) {
- const tsk_list_item_t *item;
- tsk_list_lock(ctx->candidates_pairs);
- tsk_list_foreach(item, ctx->candidates_pairs) {
- if (((const tnet_ice_pair_t*)item->data)->turn_peer_id == e->u_peer_id) {
- pair = tsk_object_ref((void*)item->data);
- break;
- }
- }
- tsk_list_unlock(ctx->candidates_pairs);
- }
-
- ret = _tnet_ice_ctx_recv_stun_message_for_pair(
- ctx,
- pair,
- e->data.pc_data_ptr, e->data.u_data_size,
- e->pc_enet ? e->pc_enet->local_fd : TNET_INVALID_FD,
- e->pc_enet ? &e->pc_enet->remote_addr : tsk_null,
- &role_conflict);
- TSK_OBJECT_SAFE_FREE(pair);
- if (ret) {
+
+ ret = _tnet_ice_ctx_recv_stun_message_for_pair(
+ ctx,
+ pair,
+ e->data.pc_data_ptr, e->data.u_data_size,
+ e->pc_enet ? e->pc_enet->local_fd : TNET_INVALID_FD,
+ e->pc_enet ? &e->pc_enet->remote_addr : tsk_null,
+ &role_conflict);
+ TSK_OBJECT_SAFE_FREE(pair);
+ if (ret) {
+ goto bail;
+ }
+
+ // rebuild candidates if role conflict
+ if (role_conflict) {
+ tsk_list_lock(ctx->candidates_pairs);
+ tsk_list_clear_items(ctx->candidates_pairs);
+ tsk_list_unlock(ctx->candidates_pairs);
+
+ TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtp);
+ TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtcp);
+
+ if ((ret = _tnet_ice_ctx_build_pairs(ctx, ctx->candidates_local, ctx->candidates_remote, ctx->candidates_pairs, ctx->is_controlling, ctx->tie_breaker, ctx->is_ice_jingle, ctx->use_rtcpmux))) {
+ TSK_DEBUG_ERROR("_tnet_ice_ctx_build_pairs() failed");
goto bail;
}
-
- // rebuild candidates if role conflict
- if (role_conflict) {
- tsk_list_lock(ctx->candidates_pairs);
- tsk_list_clear_items(ctx->candidates_pairs);
- tsk_list_unlock(ctx->candidates_pairs);
-
- TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtp);
- TSK_OBJECT_SAFE_FREE(ctx->turn.ss_nominated_rtcp);
-
- if ((ret = _tnet_ice_ctx_build_pairs(ctx, ctx->candidates_local, ctx->candidates_remote, ctx->candidates_pairs, ctx->is_controlling, ctx->tie_breaker, ctx->is_ice_jingle, ctx->use_rtcpmux))) {
- TSK_DEBUG_ERROR("_tnet_ice_ctx_build_pairs() failed");
- goto bail;
- }
- }
-
- break;
}
+
+ break;
}
-
+ }
+
// alert() waiting threads
if ((ret = tsk_condwait_broadcast(ctx->turn.condwait))) {
goto bail;
}
-
+
bail:
tsk_object_unref(ctx);
tsk_object_unref(session);
@@ -2694,42 +2693,40 @@ static void* TSK_STDCALL _tnet_ice_ctx_run(void* self)
tsk_list_item_t *curr;
tnet_ice_ctx_t *ctx = (tnet_ice_ctx_t *)(self);
tnet_ice_event_t *e;
-
+
TSK_DEBUG_INFO("ICE CTX::run -- START");
-
+
TSK_RUNNABLE_RUN_BEGIN(ctx);
-
+
// must because "ctx->callback(e);" could call a function trying to free "ctx"
// do not move before "TSK_RUNNABLE_RUN_BEGIN(ctx)", otherwise it'll be required to stop the "runnable" to have "ctx->refCount==0"
ctx = tsk_object_ref(ctx);
-
+
if (ctx->is_started && (curr = TSK_RUNNABLE_POP_FIRST(ctx))) {
e = (tnet_ice_event_t*)curr->data;
switch (e->type) {
- case tnet_ice_event_type_action:
- {
- if (e->action) {
- tsk_fsm_act(ctx->fsm, e->action->id, ctx, e->action, ctx, e->action);
- }
- break;
+ case tnet_ice_event_type_action: {
+ if (e->action) {
+ tsk_fsm_act(ctx->fsm, e->action->id, ctx, e->action, ctx, e->action);
}
- default:
- {
- if (ctx->callback){
- ctx->callback(e);
- }
- break;
+ break;
+ }
+ default: {
+ if (ctx->callback) {
+ ctx->callback(e);
}
+ break;
+ }
}
tsk_object_unref(curr);
}
-
+
if (!(ctx = tsk_object_unref(ctx))) {
goto exit;
}
-
+
TSK_RUNNABLE_RUN_END(ctx);
-
+
exit:
if (ctx) {
tsk_list_clear_items(ctx->candidates_local);
@@ -2738,9 +2735,9 @@ exit:
tsk_list_clear_items(ctx->candidates_pairs);
tsk_list_unlock(ctx->candidates_pairs);
}
-
+
TSK_DEBUG_INFO("ICE CTX::run -- STOP");
-
+
return 0;
}
@@ -2768,7 +2765,7 @@ static int _tnet_ice_ctx_server_add(struct tnet_ice_ctx_s* self, enum tnet_ice_s
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// TURN requires credentials
if ((e_proto & tnet_ice_server_proto_turn) == tnet_ice_server_proto_turn && (tsk_strnullORempty(str_username) || tsk_strnullORempty(str_password))) {
/* rfc5766 - 4. General Behavior
@@ -2791,7 +2788,7 @@ static int _tnet_ice_ctx_server_add(struct tnet_ice_ctx_s* self, enum tnet_ice_s
}
tsk_list_push_back_data(self->servers, (void**)&ice_server);
TSK_OBJECT_SAFE_FREE(ice_server);
-
+
ret = 0;
bail:
tsk_list_unlock(self->servers);
diff --git a/tinyNET/src/ice/tnet_ice_ctx.h b/tinyNET/src/ice/tnet_ice_ctx.h
index 015fdcf..8be8164 100755
--- a/tinyNET/src/ice/tnet_ice_ctx.h
+++ b/tinyNET/src/ice/tnet_ice_ctx.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012-2015 Doubango Telecom <http://www.doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,21 +46,21 @@ TINYNET_API struct tnet_ice_ctx_s* tnet_ice_ctx_create(tsk_bool_t is_ice_jingle,
TINYNET_API int tnet_ice_ctx_set_userdata(struct tnet_ice_ctx_s* self, const void* userdata);
//@deprecated: Use "tnet_ice_ctx_add_server()"
TNET_DEPRECATED(TINYNET_API int tnet_ice_ctx_set_stun(
- struct tnet_ice_ctx_s* self,
- const char* server_addr,
- uint16_t server_port,
- const char* software,
- const char* username,
- const char* password));
+ struct tnet_ice_ctx_s* self,
+ const char* server_addr,
+ uint16_t server_port,
+ const char* software,
+ const char* username,
+ const char* password));
TINYNET_API int tnet_ice_ctx_add_server(
- struct tnet_ice_ctx_s* self,
- const char* transport_proto, // "udp", "tcp", "tls", "ws", "wss"...
- const char* server_addr,
- uint16_t server_port,
- tsk_bool_t use_turn,
- tsk_bool_t use_stun,
- const char* username,
- const char* password);
+ struct tnet_ice_ctx_s* self,
+ const char* transport_proto, // "udp", "tcp", "tls", "ws", "wss"...
+ const char* server_addr,
+ uint16_t server_port,
+ tsk_bool_t use_turn,
+ tsk_bool_t use_stun,
+ const char* username,
+ const char* password);
#define tnet_ice_ctx_add_server_turn(self, transport_proto, server_addr, server_port, username, password) \
tnet_ice_ctx_add_server((self), (transport_proto), (server_addr), (server_port), tsk_true/*use_turn*/, tsk_false/*use_stun*/, (username), (password))
#define tnet_ice_ctx_add_server_stun(self, transport_proto, server_addr, server_port, username, password) \
@@ -90,9 +90,9 @@ TINYNET_API tsk_bool_t tnet_ice_ctx_is_can_recv(const struct tnet_ice_ctx_s* sel
TINYNET_API tsk_bool_t tnet_ice_ctx_use_ipv6(const struct tnet_ice_ctx_s* self);
TINYNET_API tsk_bool_t tnet_ice_ctx_use_rtcp(const struct tnet_ice_ctx_s* self);
TINYNET_API int tnet_ice_ctx_get_nominated_symetric_candidates(const struct tnet_ice_ctx_s* self, uint32_t comp_id,
- const struct tnet_ice_candidate_s** candidate_offer,
- const struct tnet_ice_candidate_s** candidate_answer_src,
- const struct tnet_ice_candidate_s** candidate_answer_dest);
+ const struct tnet_ice_candidate_s** candidate_offer,
+ const struct tnet_ice_candidate_s** candidate_answer_src,
+ const struct tnet_ice_candidate_s** candidate_answer_dest);
TINYNET_API int tnet_ice_ctx_recv_stun_message(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size, tnet_fd_t local_fd, const struct sockaddr_storage* remote_addr, tsk_bool_t *role_conflict);
TINYNET_API int tnet_ice_ctx_send_turn_rtp(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size);
TINYNET_API int tnet_ice_ctx_send_turn_rtcp(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size);
diff --git a/tinyNET/src/ice/tnet_ice_event.c b/tinyNET/src/ice/tnet_ice_event.c
index 480202f..1826c3b 100755
--- a/tinyNET/src/ice/tnet_ice_event.c
+++ b/tinyNET/src/ice/tnet_ice_event.c
@@ -27,24 +27,23 @@
static tsk_object_t* tnet_ice_event_ctor(tsk_object_t * self, va_list * app)
{
tnet_ice_event_t *e = self;
- if(e){
-
+ if(e) {
+
}
return self;
}
static tsk_object_t* tnet_ice_event_dtor(tsk_object_t * self)
{
tnet_ice_event_t *e = self;
- if(e){
+ if(e) {
TSK_SAFE_FREE(e->phrase);
TSK_OBJECT_SAFE_FREE(e->action);
e->ctx = tsk_null; // not the owner (const)
}
-
+
return self;
}
-static const tsk_object_def_t tnet_ice_event_def_s =
-{
+static const tsk_object_def_t tnet_ice_event_def_s = {
sizeof(tnet_ice_event_t),
tnet_ice_event_ctor,
tnet_ice_event_dtor,
@@ -56,29 +55,29 @@ const tsk_object_def_t *tnet_ice_event_def_t = &tnet_ice_event_def_s;
tnet_ice_event_t* tnet_ice_event_create(const struct tnet_ice_ctx_s* ctx, tnet_ice_event_type_t type, const char* phrase, const void* userdata)
{
tnet_ice_event_t* e;
-
- if((e = tsk_object_new(tnet_ice_event_def_t))){
+
+ if((e = tsk_object_new(tnet_ice_event_def_t))) {
e->ctx = ctx;
e->type = type;
e->phrase = tsk_strdup(phrase);
e->userdata = userdata;
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create ICE event");
}
-
+
return e;
}
int tnet_ice_event_set_action(tnet_ice_event_t* self, struct tnet_ice_action_s* action)
{
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
self->type = tnet_ice_event_type_action;
TSK_OBJECT_SAFE_FREE(self->action);
- if(action){
+ if(action) {
self->action = tsk_object_ref(action);
}
return 0;
diff --git a/tinyNET/src/ice/tnet_ice_event.h b/tinyNET/src/ice/tnet_ice_event.h
index 8f2f72e..404f765 100755
--- a/tinyNET/src/ice/tnet_ice_event.h
+++ b/tinyNET/src/ice/tnet_ice_event.h
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,40 +28,38 @@
TNET_BEGIN_DECLS
-typedef enum tnet_ice_event_type_e
-{
- // Public events
- tnet_ice_event_type_started,
- tnet_ice_event_type_start_failed,
- tnet_ice_event_type_stopped,
- tnet_ice_event_type_stop_failed,
- tnet_ice_event_type_gathering_host_candidates_failed,
- tnet_ice_event_type_gathering_host_candidates_succeed,
- tnet_ice_event_type_gathering_reflexive_candidates_failed,
- tnet_ice_event_type_gathering_reflexive_candidates_succeed,
- tnet_ice_event_type_gathering_relay_candidates_failed,
- tnet_ice_event_type_gathering_relay_candidates_succeed,
- tnet_ice_event_type_gathering_completed,
- tnet_ice_event_type_conncheck_succeed,
- tnet_ice_event_type_conncheck_failed,
- tnet_ice_event_type_cancelled,
- tnet_ice_event_type_turn_connection_broken,
+typedef enum tnet_ice_event_type_e {
+ // Public events
+ tnet_ice_event_type_started,
+ tnet_ice_event_type_start_failed,
+ tnet_ice_event_type_stopped,
+ tnet_ice_event_type_stop_failed,
+ tnet_ice_event_type_gathering_host_candidates_failed,
+ tnet_ice_event_type_gathering_host_candidates_succeed,
+ tnet_ice_event_type_gathering_reflexive_candidates_failed,
+ tnet_ice_event_type_gathering_reflexive_candidates_succeed,
+ tnet_ice_event_type_gathering_relay_candidates_failed,
+ tnet_ice_event_type_gathering_relay_candidates_succeed,
+ tnet_ice_event_type_gathering_completed,
+ tnet_ice_event_type_conncheck_succeed,
+ tnet_ice_event_type_conncheck_failed,
+ tnet_ice_event_type_cancelled,
+ tnet_ice_event_type_turn_connection_broken,
- // Private events
- tnet_ice_event_type_action
+ // Private events
+ tnet_ice_event_type_action
}
tnet_ice_event_type_t;
-typedef struct tnet_ice_event_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_ice_event_s {
+ TSK_DECLARE_OBJECT;
- tnet_ice_event_type_t type;
- char* phrase;
- struct tnet_ice_action_s* action;
- const struct tnet_ice_ctx_s* ctx;
+ tnet_ice_event_type_t type;
+ char* phrase;
+ struct tnet_ice_action_s* action;
+ const struct tnet_ice_ctx_s* ctx;
- const void* userdata;
+ const void* userdata;
}
tnet_ice_event_t;
diff --git a/tinyNET/src/ice/tnet_ice_pair.c b/tinyNET/src/ice/tnet_ice_pair.c
index 33e71a5..f917ea2 100755
--- a/tinyNET/src/ice/tnet_ice_pair.c
+++ b/tinyNET/src/ice/tnet_ice_pair.c
@@ -58,7 +58,7 @@
static int __pred_find_by_pair(const tsk_list_item_t *item, const void *pair)
{
- if(item && item->data){
+ if(item && item->data) {
int ret;
tsk_subsat_int32_ptr(item->data, pair, &ret);
return ret;
@@ -70,7 +70,7 @@ static int __pred_find_by_pair(const tsk_list_item_t *item, const void *pair)
static tsk_object_t* tnet_ice_pair_ctor(tsk_object_t * self, va_list * app)
{
tnet_ice_pair_t *pair = self;
- if(pair){
+ if(pair) {
pair->state_offer = tnet_ice_pair_state_frozen;
pair->state_answer = tnet_ice_pair_state_frozen;
}
@@ -90,7 +90,7 @@ static int tnet_ice_pair_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
{
const tnet_ice_pair_t *p1 = _p1;
const tnet_ice_pair_t *p2 = _p2;
-
+
if (p1 && p2) {
#if 0
// This is not correct and most differences (if not all) will be equal to "INT_MIN" or "INT_MAX" and this will produce invalid sorting.
@@ -102,11 +102,14 @@ static int tnet_ice_pair_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
return (p1->priority == p2->priority) ? 0 : (p1->priority > p2->priority ? 1 : -1);
#endif
}
- else if (!p1 && !p2) return 0;
- else return -1;
+ else if (!p1 && !p2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_ice_pair_def_s =
-{
+static const tsk_object_def_t tnet_ice_pair_def_s = {
sizeof(tnet_ice_pair_t),
tnet_ice_pair_ctor,
tnet_ice_pair_dtor,
@@ -117,11 +120,11 @@ tnet_ice_pair_t* tnet_ice_pair_create(const tnet_ice_candidate_t* candidate_offe
{
static uint64_t __unique_id = 0;
tnet_ice_pair_t *pair;
- if(!candidate_offer || !candidate_answer){
+ if(!candidate_offer || !candidate_answer) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
if ((pair = tsk_object_new(&tnet_ice_pair_def_s))) {
uint64_t G, D;
pair->id = ++__unique_id; // not part of the standard, used to ease debugging
@@ -136,7 +139,7 @@ tnet_ice_pair_t* tnet_ice_pair_create(const tnet_ice_candidate_t* candidate_offe
pair->priority = ((TSK_MIN(G, D)) << 32) + (TSK_MAX(G, D) << 1) + ((G > D) ? 1 : 0);
pair->turn_peer_id = kTurnPeerIdInvalid;
}
-
+
return pair;
}
@@ -148,12 +151,12 @@ tnet_ice_pair_t* tnet_ice_pair_prflx_create(tnet_ice_pairs_L_t* pairs, tnet_fd_t
const tnet_ice_pair_t *pair_local = tsk_null, *pair = tsk_null;
tnet_ip_t remote_ip;
tnet_port_t remote_port;
-
+
if (!pairs || !remote_addr) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
+
tsk_list_foreach(item, pairs) {
if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_answer || !pair->candidate_offer->socket || pair->candidate_offer->socket->fd != local_fd) {
continue;
@@ -161,12 +164,12 @@ tnet_ice_pair_t* tnet_ice_pair_prflx_create(tnet_ice_pairs_L_t* pairs, tnet_fd_t
pair_local = pair;
break;
}
-
+
if ((ret = tnet_get_sockip_n_port((const struct sockaddr*)remote_addr, &remote_ip, &remote_port))) {
TNET_PRINT_LAST_ERROR("tnet_get_sockip_n_port() failed");
return tsk_null;
}
-
+
if (!pair_local) {
TSK_DEBUG_ERROR("Cannot create prflx candidate with remote ip = %s, remote port = %u and local_fd = %d", remote_ip, remote_port, local_fd);
return tsk_null;
@@ -182,42 +185,42 @@ tnet_ice_pair_t* tnet_ice_pair_prflx_create(tnet_ice_pairs_L_t* pairs, tnet_fd_t
cand_remote->comp_id = pair_local->candidate_offer->comp_id;
memcpy(cand_remote->connection_addr, remote_ip, sizeof(tnet_ip_t));
cand_remote->port = remote_port;
-
+
TSK_DEBUG_INFO("ICE Pair Reflexive Candidate (%llu, %llu): [%s %u %u %s %d] -> [%s %u %u %s %d]",
pair->id,
pair->priority,
-
+
cand_local->foundation,
cand_local->priority,
cand_local->comp_id,
cand_local->connection_addr,
cand_local->port,
-
+
cand_remote->foundation,
cand_remote->priority,
cand_remote->comp_id,
cand_remote->connection_addr,
cand_remote->port);
-
+
pair_peer = tnet_ice_pair_create(cand_local, cand_remote, pair_local->is_controlling, pair_local->tie_breaker, pair_local->is_ice_jingle);
}
TSK_OBJECT_SAFE_FREE(cand_local);
TSK_OBJECT_SAFE_FREE(cand_remote);
return pair_peer;
}
-
+
return tsk_null;
}
int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
{
int ret;
-
- if(!self){
+
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (self->candidate_offer->turn.ss) {
enum tnet_stun_state_e e_state;
enum tnet_turn_transport_e e_req_transport;
@@ -228,7 +231,7 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
TSK_DEBUG_INFO("TURN CreatePerm not ready yet... to send STUN ConnCheck (peer-id=%ld)", self->turn_peer_id);
goto bail;
}
-
+
if ((ret = tnet_turn_session_get_req_transport(self->candidate_offer->turn.ss, &e_req_transport))) {
goto bail;
}
@@ -244,16 +247,16 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
}
}
}
-
+
if (!self->last_request) {
uint32_t priority;
-
+
// Init remote address
if ((ret = tnet_sockaddr_init(self->candidate_answer->connection_addr, self->candidate_answer->port, self->candidate_offer->socket->type, &self->remote_addr))) {
TNET_PRINT_LAST_ERROR("tnet_sockaddr_init(%s:%d) failed", self->candidate_answer->connection_addr, self->candidate_answer->port);
goto bail;
}
-
+
if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_binding_request, &self->last_request))) {
goto bail;
}
@@ -266,7 +269,7 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
if (self->is_ice_jingle) {
tsk_sprintf(&p_uname, "%s%s", tnet_ice_candidate_get_ufrag(self->candidate_answer), tnet_ice_candidate_get_ufrag(self->candidate_offer));
}
- else{
+ else {
tsk_sprintf(&p_uname, "%s:%s", tnet_ice_candidate_get_ufrag(self->candidate_answer), tnet_ice_candidate_get_ufrag(self->candidate_offer));
}
pc_pwd = tnet_ice_candidate_get_pwd(self->candidate_answer);
@@ -276,7 +279,7 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
goto bail;
}
}
-
+
priority = tnet_ice_utils_get_priority(tnet_ice_cand_type_prflx, self->candidate_offer->local_pref, self->candidate_offer->is_rtp);
// add attributes
self->last_request->opt.dontfrag = 0;
@@ -333,176 +336,176 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
#if TNET_ICE_AGGRESSIVE_NOMINATION
if (!tnet_stun_pkt_attr_exists(self->last_request, tnet_stun_attr_type_ice_use_candidate)) {
#else
- if (self->is_nominated && !tnet_stun_pkt_attr_exists(self->last_request, tnet_stun_attr_type_ice_use_candidate)) {
+ if (self->is_nominated && !tnet_stun_pkt_attr_exists(self->last_request, tnet_stun_attr_type_ice_use_candidate)) {
#endif
- ret = tnet_stun_pkt_attrs_add(self->last_request,
- TNET_STUN_PKT_ATTR_ADD_ICE_USE_CANDIDATE(),
+ ret = tnet_stun_pkt_attrs_add(self->last_request,
+ TNET_STUN_PKT_ATTR_ADD_ICE_USE_CANDIDATE(),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+
+ if (ret) {
+ goto bail;
+ }
+ b_changed = tsk_true;
+ }
+ }
+ else {
+ tnet_stun_pkt_attr_remove(self->last_request, tnet_stun_attr_type_ice_use_candidate);
+ tnet_stun_pkt_attr_remove(self->last_request, tnet_stun_attr_type_ice_controlling);
+ if (!tnet_stun_pkt_attr_exists(self->last_request, tnet_stun_attr_type_ice_controlled)) {
+ ret = tnet_stun_pkt_attrs_add(self->last_request,
+ TNET_STUN_PKT_ATTR_ADD_ICE_CONTROLLED(self->tie_breaker),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ b_changed = tsk_true;
+ }
+ }
+ // update transac-id if the request structure changed
+ if ((b_changed && (ret = tnet_stun_utils_transac_id_rand(&self->last_request->transac_id)))) {
+ goto bail;
+ }
+ }
+
+ // Send request
+ {
+ tsk_buffer_t *req_buffer = tsk_null;
+ self->last_request->opt.fingerprint = !self->is_ice_jingle;
+ if ((ret = tnet_stun_pkt_write_with_padding_2(self->last_request, &req_buffer))) {
+ goto bail;
+ }
+ if (self->candidate_offer->turn.ss) {
+ // Send using TURN session. Above, we already checked that the TURN session is ready (Alloc=OK, Permission=OK)
+ ret = tnet_turn_session_send_data(self->candidate_offer->turn.ss, self->turn_peer_id, req_buffer->data, (uint16_t)req_buffer->size);
+ }
+ else {
+ int sendBytes = tnet_sockfd_sendto(self->candidate_offer->socket->fd, (const struct sockaddr*)&self->remote_addr, req_buffer->data, req_buffer->size);
+ ret = (sendBytes == req_buffer->size) ? 0 : -9;
+ }
+ TSK_OBJECT_SAFE_FREE(req_buffer);
+ if (ret) {
+ goto bail;
+ }
+ }
+
+bail:
+ if (ret == 0 && self->state_offer == tnet_ice_pair_state_frozen) {
+ self->state_offer = tnet_ice_pair_state_in_progress;
+ }
+ return ret;
+}
+
+int tnet_ice_pair_send_response(tnet_ice_pair_t *self, const tnet_stun_pkt_req_t* request, const short code, const char* phrase, const struct sockaddr_storage *remote_addr)
+{
+ tnet_stun_pkt_t* message = tsk_null;
+ const char *password, *username;
+ int ret = -1;
+ tsk_bool_t is_error = ((code / 100) != 2);
+
+ if(!self || !phrase || !request || !self->candidate_offer || !self->candidate_answer) {
+ TSK_DEBUG_ERROR("Invalid paramter");
+ return -1;
+ }
+
+ username = tsk_null;
+ password = tnet_ice_candidate_get_pwd(self->candidate_offer);
+
+ if ((ret = tnet_stun_pkt_create_empty(is_error ? tnet_stun_pkt_type_binding_error_response : tnet_stun_pkt_type_binding_success_response, &message)) == 0) {
+ tsk_buffer_t *req_buffer = tsk_null;
+ memcpy(message->transac_id, request->transac_id, sizeof(request->transac_id));
+ message->opt.fingerprint = !self->is_ice_jingle;
+ message->opt.dontfrag = 0;
+
+ // SOFWARE
+ ret = tnet_stun_pkt_attrs_add(message,
+ TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ // SHORT-TERM authentication even for responses
+ if ((ret = tnet_stun_pkt_auth_prepare_shortterm_2(message, password))) {
+ goto bail;
+ }
+
+ // ERROR
+ if (is_error) {
+ ret = tnet_stun_pkt_attrs_add(message,
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE(((code / 100) & 0x07), (code - ((code / 100) * 100)), phrase),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ else {
+ tnet_ip_t remote_ip;
+ tnet_port_t remote_port;
+ if (self->is_ice_jingle) {
+ const tnet_stun_attr_vdata_t *pc_attr_vdata;
+ // USERNAME
+ if ((ret = tnet_stun_pkt_attr_find_first(request, tnet_stun_attr_type_username, (const tnet_stun_attr_t **)&pc_attr_vdata)) == 0 && pc_attr_vdata) {
+ ret = tnet_stun_pkt_attrs_add(message,
+ TNET_STUN_PKT_ATTR_ADD_USERNAME(pc_attr_vdata->p_data_ptr, pc_attr_vdata->u_data_size),
TNET_STUN_PKT_ATTR_ADD_NULL());
-
if (ret) {
goto bail;
}
- b_changed = tsk_true;
}
}
- else {
- tnet_stun_pkt_attr_remove(self->last_request, tnet_stun_attr_type_ice_use_candidate);
- tnet_stun_pkt_attr_remove(self->last_request, tnet_stun_attr_type_ice_controlling);
- if (!tnet_stun_pkt_attr_exists(self->last_request, tnet_stun_attr_type_ice_controlled)) {
- ret = tnet_stun_pkt_attrs_add(self->last_request,
- TNET_STUN_PKT_ATTR_ADD_ICE_CONTROLLED(self->tie_breaker),
+ // MAPPED-ADDRESS and XOR-MAPPED-ADDRESS
+ if ((ret = tnet_get_sockip_n_port((const struct sockaddr*)remote_addr, &remote_ip, &remote_port)) == 0) {
+ tnet_stun_addr_t _addr;
+ tnet_stun_address_family_t _familly = (remote_addr->ss_family == AF_INET6) ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4;
+ if ((ret = tnet_stun_utils_inet_pton((_familly == tnet_stun_address_family_ipv6), remote_ip, &_addr)) == 0) {
+ ret = tnet_stun_pkt_attrs_add(message,
+ TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS(_familly, remote_port, &_addr),
+ TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS(_familly, remote_port, &_addr),
TNET_STUN_PKT_ATTR_ADD_NULL());
if (ret) {
goto bail;
}
- b_changed = tsk_true;
}
}
- // update transac-id if the request structure changed
- if ((b_changed && (ret = tnet_stun_utils_transac_id_rand(&self->last_request->transac_id)))) {
- goto bail;
- }
}
-
- // Send request
- {
- tsk_buffer_t *req_buffer = tsk_null;
- self->last_request->opt.fingerprint = !self->is_ice_jingle;
- if ((ret = tnet_stun_pkt_write_with_padding_2(self->last_request, &req_buffer))) {
+
+ if (self->candidate_offer->turn.ss) {
+ enum tnet_stun_state_e e_state;
+ if ((ret = tnet_turn_session_get_state_createperm(self->candidate_offer->turn.ss, self->turn_peer_id, &e_state))) {
goto bail;
}
- if (self->candidate_offer->turn.ss) {
- // Send using TURN session. Above, we already checked that the TURN session is ready (Alloc=OK, Permission=OK)
- ret = tnet_turn_session_send_data(self->candidate_offer->turn.ss, self->turn_peer_id, req_buffer->data, (uint16_t)req_buffer->size);
+ if (e_state != tnet_stun_state_ok) {
+ TSK_DEBUG_INFO("TURN CreatePerm not ready yet... to send STUN response (peer-id=%ld)", self->turn_peer_id);
+ goto bail;
}
- else {
- int sendBytes = tnet_sockfd_sendto(self->candidate_offer->socket->fd, (const struct sockaddr*)&self->remote_addr, req_buffer->data, req_buffer->size);
- ret = (sendBytes == req_buffer->size) ? 0 : -9;
+ if ((ret = tnet_stun_pkt_write_with_padding_2(message, &req_buffer))) {
+ goto bail;
}
- TSK_OBJECT_SAFE_FREE(req_buffer);
- if (ret) {
+ if ((ret = tnet_turn_session_send_data(self->candidate_offer->turn.ss, self->turn_peer_id, req_buffer->data, (uint16_t)req_buffer->size))) {
goto bail;
}
}
-
- bail:
- if (ret == 0 && self->state_offer == tnet_ice_pair_state_frozen) {
- self->state_offer = tnet_ice_pair_state_in_progress;
- }
- return ret;
- }
-
- int tnet_ice_pair_send_response(tnet_ice_pair_t *self, const tnet_stun_pkt_req_t* request, const short code, const char* phrase, const struct sockaddr_storage *remote_addr)
- {
- tnet_stun_pkt_t* message = tsk_null;
- const char *password, *username;
- int ret = -1;
- tsk_bool_t is_error = ((code / 100) != 2);
-
- if(!self || !phrase || !request || !self->candidate_offer || !self->candidate_answer){
- TSK_DEBUG_ERROR("Invalid paramter");
- return -1;
- }
-
- username = tsk_null;
- password = tnet_ice_candidate_get_pwd(self->candidate_offer);
-
- if ((ret = tnet_stun_pkt_create_empty(is_error ? tnet_stun_pkt_type_binding_error_response : tnet_stun_pkt_type_binding_success_response, &message)) == 0) {
- tsk_buffer_t *req_buffer = tsk_null;
- memcpy(message->transac_id, request->transac_id, sizeof(request->transac_id));
- message->opt.fingerprint = !self->is_ice_jingle;
- message->opt.dontfrag = 0;
-
- // SOFWARE
- ret = tnet_stun_pkt_attrs_add(message,
- TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
+ else {
+ struct sockaddr_storage dest_addr;
+ int sendBytes;
+ if ((ret = tnet_sockaddr_init(self->candidate_answer->connection_addr, self->candidate_answer->port, self->candidate_offer->socket->type, &dest_addr))) {
+ TNET_PRINT_LAST_ERROR("tnet_sockaddr_init(%s:%d) failed", self->candidate_answer->connection_addr, self->candidate_answer->port);
goto bail;
}
-
- // SHORT-TERM authentication even for responses
- if ((ret = tnet_stun_pkt_auth_prepare_shortterm_2(message, password))) {
+ if ((ret = tnet_stun_pkt_write_with_padding_2(message, &req_buffer))) {
goto bail;
}
-
- // ERROR
- if (is_error) {
- ret = tnet_stun_pkt_attrs_add(message,
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE(((code / 100) & 0x07), (code - ((code / 100) * 100)), phrase),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- else {
- tnet_ip_t remote_ip;
- tnet_port_t remote_port;
- if (self->is_ice_jingle) {
- const tnet_stun_attr_vdata_t *pc_attr_vdata;
- // USERNAME
- if ((ret = tnet_stun_pkt_attr_find_first(request, tnet_stun_attr_type_username, (const tnet_stun_attr_t **)&pc_attr_vdata)) == 0 && pc_attr_vdata) {
- ret = tnet_stun_pkt_attrs_add(message,
- TNET_STUN_PKT_ATTR_ADD_USERNAME(pc_attr_vdata->p_data_ptr, pc_attr_vdata->u_data_size),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- }
- // MAPPED-ADDRESS and XOR-MAPPED-ADDRESS
- if ((ret = tnet_get_sockip_n_port((const struct sockaddr*)remote_addr, &remote_ip, &remote_port)) == 0) {
- tnet_stun_addr_t _addr;
- tnet_stun_address_family_t _familly = (remote_addr->ss_family == AF_INET6) ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4;
- if ((ret = tnet_stun_utils_inet_pton((_familly == tnet_stun_address_family_ipv6), remote_ip, &_addr)) == 0) {
- ret = tnet_stun_pkt_attrs_add(message,
- TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS(_familly, remote_port, &_addr),
- TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS(_familly, remote_port, &_addr),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- }
- }
-
- if (self->candidate_offer->turn.ss) {
- enum tnet_stun_state_e e_state;
- if ((ret = tnet_turn_session_get_state_createperm(self->candidate_offer->turn.ss, self->turn_peer_id, &e_state))) {
- goto bail;
- }
- if (e_state != tnet_stun_state_ok) {
- TSK_DEBUG_INFO("TURN CreatePerm not ready yet... to send STUN response (peer-id=%ld)", self->turn_peer_id);
- goto bail;
- }
- if ((ret = tnet_stun_pkt_write_with_padding_2(message, &req_buffer))) {
- goto bail;
- }
- if ((ret = tnet_turn_session_send_data(self->candidate_offer->turn.ss, self->turn_peer_id, req_buffer->data, (uint16_t)req_buffer->size))) {
- goto bail;
- }
- }
- else {
- struct sockaddr_storage dest_addr;
- int sendBytes;
- if ((ret = tnet_sockaddr_init(self->candidate_answer->connection_addr, self->candidate_answer->port, self->candidate_offer->socket->type, &dest_addr))) {
- TNET_PRINT_LAST_ERROR("tnet_sockaddr_init(%s:%d) failed", self->candidate_answer->connection_addr, self->candidate_answer->port);
- goto bail;
- }
- if ((ret = tnet_stun_pkt_write_with_padding_2(message, &req_buffer))) {
- goto bail;
- }
- sendBytes = tnet_sockfd_sendto(self->candidate_offer->socket->fd, (const struct sockaddr*)&dest_addr, req_buffer->data, req_buffer->size);
- TSK_OBJECT_SAFE_FREE(req_buffer);
- ret = (sendBytes > 0) ? 0 : -2;
- if (ret != 0) {
- TSK_DEBUG_ERROR("ICE pair-answer: failed to send response");
- }
+ sendBytes = tnet_sockfd_sendto(self->candidate_offer->socket->fd, (const struct sockaddr*)&dest_addr, req_buffer->data, req_buffer->size);
+ TSK_OBJECT_SAFE_FREE(req_buffer);
+ ret = (sendBytes > 0) ? 0 : -2;
+ if (ret != 0) {
+ TSK_DEBUG_ERROR("ICE pair-answer: failed to send response");
}
}
-
- if (ret == 0 && !is_error) {
- tsk_bool_t change_state =
+ }
+
+ if (ret == 0 && !is_error) {
+ tsk_bool_t change_state =
self->is_ice_jingle // ICE-JINGLE don't have ICE-CONTROLLING/ICE-CONTROLLED attributes
|| (!self->is_controlling && tnet_stun_pkt_attr_exists(request, tnet_stun_attr_type_ice_use_candidate)) // Sender is controlling and uses "ICE-USE-CANDIDATE" attribute
#if TNET_ICE_AGGRESSIVE_NOMINATION || 1 // This is not a typo but a *must*. We've to change the answer state regardless the nomination mode otherwise we'll never get a nominee. Only the offer state is controlled based on the mode and depends on "is_nominated".
@@ -511,301 +514,300 @@ int tnet_ice_pair_send_conncheck(tnet_ice_pair_t *self)
|| (self->is_controlling && self->is_nominated) // We're controlling and using regular mode
#endif
;
- TNET_ICE_PAIR_DEBUG_INFO("ICE pair-answer changing state to 'succeed' ? %s, comp-id=%d, found=%s, addr=%s",
- change_state?"yes":"no",
- self->candidate_answer->comp_id,
- self->candidate_answer->foundation,
- self->candidate_answer->connection_addr
- );
- if (change_state) {
- self->state_answer = tnet_ice_pair_state_succeed;
- }
- }
-
-
- bail:
- TSK_OBJECT_SAFE_FREE(message);
- return ret;
+ TNET_ICE_PAIR_DEBUG_INFO("ICE pair-answer changing state to 'succeed' ? %s, comp-id=%d, found=%s, addr=%s",
+ change_state?"yes":"no",
+ self->candidate_answer->comp_id,
+ self->candidate_answer->foundation,
+ self->candidate_answer->connection_addr
+ );
+ if (change_state) {
+ self->state_answer = tnet_ice_pair_state_succeed;
+ }
}
-
- int tnet_ice_pair_auth_conncheck(const tnet_ice_pair_t *self, const tnet_stun_pkt_req_t* request, const void* request_buff, tsk_size_t request_buff_size, short* resp_code, char** resp_phrase)
- {
- const uint8_t* _request_buff = (const uint8_t*)request_buff;
-
- const tnet_stun_attr_t* stun_att;
- const tnet_stun_attr_vdata_t *stun_att_usr_name;
- const tnet_stun_attr_vdata_t *stun_att_fingerprint;
- const tnet_stun_attr_vdata_t *stun_att_integrity;
-
- const tsk_list_item_t *item;
- tsk_sha1digest_t hmac;
- const char* pwd;
-
- tsk_size_t msg_integrity_start = 0, length, i;
-
- if(!self || !request || !request_buff || !request_buff_size || !resp_code || !resp_phrase){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!TNET_STUN_BUFF_IS_STUN2(_request_buff, request_buff_size)){
- TSK_DEBUG_ERROR("Not STUN buffer");
- return -1;
- }
-
- pwd = tnet_ice_candidate_get_pwd(self->candidate_offer);
- stun_att_usr_name = tsk_null;
- stun_att_fingerprint = tsk_null;
- stun_att_integrity = tsk_null;
-
- tsk_list_foreach(item, request->p_list_attrs) {
- if ((!(stun_att = (const tnet_stun_attr_t*)item->data))) {
- continue;
- }
-
- switch (stun_att->hdr.e_type) {
- case tnet_stun_attr_type_username:
- {
- stun_att_usr_name = (const tnet_stun_attr_vdata_t *)stun_att;
- break;
- }
- case tnet_stun_attr_type_fingerprint:
- {
- stun_att_fingerprint = (const tnet_stun_attr_vdata_t *)stun_att;
- break;
- }
- case tnet_stun_attr_type_message_integrity:
- {
- stun_att_integrity = (const tnet_stun_attr_vdata_t *)stun_att;
- break;
- }
- default: break;
- }
-
- if (!stun_att_integrity) {
- if ((length = (kStunAttrHdrSizeInOctets + stun_att->hdr.u_length)) & 0x03) {
- length += (4 - (length & 0x03));
- }
- msg_integrity_start += length;
- }
+
+
+bail:
+ TSK_OBJECT_SAFE_FREE(message);
+ return ret;
+}
+
+int tnet_ice_pair_auth_conncheck(const tnet_ice_pair_t *self, const tnet_stun_pkt_req_t* request, const void* request_buff, tsk_size_t request_buff_size, short* resp_code, char** resp_phrase)
+{
+ const uint8_t* _request_buff = (const uint8_t*)request_buff;
+
+ const tnet_stun_attr_t* stun_att;
+ const tnet_stun_attr_vdata_t *stun_att_usr_name;
+ const tnet_stun_attr_vdata_t *stun_att_fingerprint;
+ const tnet_stun_attr_vdata_t *stun_att_integrity;
+
+ const tsk_list_item_t *item;
+ tsk_sha1digest_t hmac;
+ const char* pwd;
+
+ tsk_size_t msg_integrity_start = 0, length, i;
+
+ if(!self || !request || !request_buff || !request_buff_size || !resp_code || !resp_phrase) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!TNET_STUN_BUFF_IS_STUN2(_request_buff, request_buff_size)) {
+ TSK_DEBUG_ERROR("Not STUN buffer");
+ return -1;
+ }
+
+ pwd = tnet_ice_candidate_get_pwd(self->candidate_offer);
+ stun_att_usr_name = tsk_null;
+ stun_att_fingerprint = tsk_null;
+ stun_att_integrity = tsk_null;
+
+ tsk_list_foreach(item, request->p_list_attrs) {
+ if ((!(stun_att = (const tnet_stun_attr_t*)item->data))) {
+ continue;
}
-
- if (!stun_att_usr_name) {
- TSK_DEBUG_ERROR("USERNAME is missing");
- *resp_code = 400;
- tsk_strupdate(resp_phrase, "USERNAME is missing");
- return -2;
- }
-
- if (!stun_att_integrity || stun_att_integrity->u_data_size != TSK_SHA1_DIGEST_SIZE) {
- if (self->is_ice_jingle) { // Bug introduced in Chrome 20.0.1120.0 (Not security issue as ICE-JINGLE is deprecated and will never be ON)
- *resp_code = 200;
- tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY is missing but accepted");
- return 0;
- }
- else {
- TSK_DEBUG_ERROR("MESSAGE-INTEGRITY is missing");
- *resp_code = 400;
- tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY is missing");
- return -3;
+
+ switch (stun_att->hdr.e_type) {
+ case tnet_stun_attr_type_username: {
+ stun_att_usr_name = (const tnet_stun_attr_vdata_t *)stun_att;
+ break;
+ }
+ case tnet_stun_attr_type_fingerprint: {
+ stun_att_fingerprint = (const tnet_stun_attr_vdata_t *)stun_att;
+ break;
+ }
+ case tnet_stun_attr_type_message_integrity: {
+ stun_att_integrity = (const tnet_stun_attr_vdata_t *)stun_att;
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (!stun_att_integrity) {
+ if ((length = (kStunAttrHdrSizeInOctets + stun_att->hdr.u_length)) & 0x03) {
+ length += (4 - (length & 0x03));
}
+ msg_integrity_start += length;
}
-
- if ((kStunPktHdrSizeInOctets + msg_integrity_start) >= request_buff_size) {
- TSK_DEBUG_ERROR("Invalid length");
- *resp_code = 400;
- tsk_strupdate(resp_phrase, "Invalid length");
- return -20;
- }
-
- if (request->u_length != msg_integrity_start) {
- tsk_size_t size = (kStunPktHdrSizeInOctets + msg_integrity_start);
- uint8_t* new_buffer = (uint8_t*)tsk_calloc(size, 1);
- if (!new_buffer) {
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", (unsigned)msg_integrity_start);
- return -30;
- }
- memcpy(new_buffer, request_buff, size);
- length = msg_integrity_start + (kStunAttrHdrSizeInOctets + TSK_SHA1_DIGEST_SIZE /* INTEGRITY VALUE*/);
- new_buffer[2] = (length >> 8) & 0xFF;
- new_buffer[3] = (length & 0xFF);
- hmac_sha1digest_compute(new_buffer, size, pwd, tsk_strlen(pwd), hmac);
- TSK_FREE(new_buffer);
+ }
+
+ if (!stun_att_usr_name) {
+ TSK_DEBUG_ERROR("USERNAME is missing");
+ *resp_code = 400;
+ tsk_strupdate(resp_phrase, "USERNAME is missing");
+ return -2;
+ }
+
+ if (!stun_att_integrity || stun_att_integrity->u_data_size != TSK_SHA1_DIGEST_SIZE) {
+ if (self->is_ice_jingle) { // Bug introduced in Chrome 20.0.1120.0 (Not security issue as ICE-JINGLE is deprecated and will never be ON)
+ *resp_code = 200;
+ tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY is missing but accepted");
+ return 0;
}
else {
- // must never happen
- hmac_sha1digest_compute(request_buff, request_buff_size, pwd, tsk_strlen(pwd), hmac);
- }
-
- for (i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
- if (hmac[i] != stun_att_integrity->p_data_ptr[i]) {
- TSK_DEBUG_ERROR("MESSAGE-INTEGRITY mismatch");
- *resp_code = 401;
- tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY mismatch");
- return -40;
- }
- }
-
- *resp_code = 200;
- tsk_strupdate(resp_phrase, "Ok");
-
- return 0;
+ TSK_DEBUG_ERROR("MESSAGE-INTEGRITY is missing");
+ *resp_code = 400;
+ tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY is missing");
+ return -3;
+ }
}
-
- int tnet_ice_pair_recv_response(tnet_ice_pair_t *self, const tnet_stun_pkt_resp_t* response, tsk_bool_t is_4conncheck)
- {
- if (self && response && TNET_STUN_PKT_IS_RESP(response)) {
- if (self->last_request && tnet_stun_utils_transac_id_equals(self->last_request->transac_id, response->transac_id)){
- // ignore errors (e.g. STALE-CREDENTIALS) which could happen in some special cases before success
- if (TNET_STUN_PKT_RESP_IS_SUCCESS(response)) {
- if (is_4conncheck) {
- self->state_offer = tnet_ice_pair_state_succeed; // we must not change the state after connection cheking to make sure another pair won't be picked as nominated
- TNET_ICE_PAIR_DEBUG_INFO("ICE pair-offer changing state to 'succeed', comp-id=%d, found=%s, addr=%s",
- self->candidate_offer->comp_id,
- self->candidate_offer->foundation,
- self->candidate_offer->connection_addr
- );
- }
+
+ if ((kStunPktHdrSizeInOctets + msg_integrity_start) >= request_buff_size) {
+ TSK_DEBUG_ERROR("Invalid length");
+ *resp_code = 400;
+ tsk_strupdate(resp_phrase, "Invalid length");
+ return -20;
+ }
+
+ if (request->u_length != msg_integrity_start) {
+ tsk_size_t size = (kStunPktHdrSizeInOctets + msg_integrity_start);
+ uint8_t* new_buffer = (uint8_t*)tsk_calloc(size, 1);
+ if (!new_buffer) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", (unsigned)msg_integrity_start);
+ return -30;
+ }
+ memcpy(new_buffer, request_buff, size);
+ length = msg_integrity_start + (kStunAttrHdrSizeInOctets + TSK_SHA1_DIGEST_SIZE /* INTEGRITY VALUE*/);
+ new_buffer[2] = (length >> 8) & 0xFF;
+ new_buffer[3] = (length & 0xFF);
+ hmac_sha1digest_compute(new_buffer, size, pwd, tsk_strlen(pwd), hmac);
+ TSK_FREE(new_buffer);
+ }
+ else {
+ // must never happen
+ hmac_sha1digest_compute(request_buff, request_buff_size, pwd, tsk_strlen(pwd), hmac);
+ }
+
+ for (i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
+ if (hmac[i] != stun_att_integrity->p_data_ptr[i]) {
+ TSK_DEBUG_ERROR("MESSAGE-INTEGRITY mismatch");
+ *resp_code = 401;
+ tsk_strupdate(resp_phrase, "MESSAGE-INTEGRITY mismatch");
+ return -40;
+ }
+ }
+
+ *resp_code = 200;
+ tsk_strupdate(resp_phrase, "Ok");
+
+ return 0;
+}
+
+int tnet_ice_pair_recv_response(tnet_ice_pair_t *self, const tnet_stun_pkt_resp_t* response, tsk_bool_t is_4conncheck)
+{
+ if (self && response && TNET_STUN_PKT_IS_RESP(response)) {
+ if (self->last_request && tnet_stun_utils_transac_id_equals(self->last_request->transac_id, response->transac_id)) {
+ // ignore errors (e.g. STALE-CREDENTIALS) which could happen in some special cases before success
+ if (TNET_STUN_PKT_RESP_IS_SUCCESS(response)) {
+ if (is_4conncheck) {
+ self->state_offer = tnet_ice_pair_state_succeed; // we must not change the state after connection cheking to make sure another pair won't be picked as nominated
+ TNET_ICE_PAIR_DEBUG_INFO("ICE pair-offer changing state to 'succeed', comp-id=%d, found=%s, addr=%s",
+ self->candidate_offer->comp_id,
+ self->candidate_offer->foundation,
+ self->candidate_offer->connection_addr
+ );
}
- else {
- // The response is an error
- uint16_t u_code;
- int ret;
- if ((ret = tnet_stun_pkt_get_errorcode(response, &u_code)) == 0 && u_code == kStunErrCodeIceConflict) {
- TSK_DEBUG_INFO("ICE Pair %llu received conflict error message", self->id);
- // If this code is called this means that we have lower tie-breaker and we must toggle our role
- self->is_controlling = !self->is_controlling;
- TSK_OBJECT_SAFE_FREE(self->last_request); // delete the "last_request" to make sure a new one will be created with right attributes
- }
+ }
+ else {
+ // The response is an error
+ uint16_t u_code;
+ int ret;
+ if ((ret = tnet_stun_pkt_get_errorcode(response, &u_code)) == 0 && u_code == kStunErrCodeIceConflict) {
+ TSK_DEBUG_INFO("ICE Pair %llu received conflict error message", self->id);
+ // If this code is called this means that we have lower tie-breaker and we must toggle our role
+ self->is_controlling = !self->is_controlling;
+ TSK_OBJECT_SAFE_FREE(self->last_request); // delete the "last_request" to make sure a new one will be created with right attributes
}
}
}
- return 0;
}
-
- const tnet_ice_pair_t* tnet_ice_pairs_find_by_response(tnet_ice_pairs_L_t* pairs, const tnet_stun_pkt_t* response)
- {
- if(pairs && response){
- const tsk_list_item_t *item;
- const tnet_ice_pair_t *pair;
- tnet_port_t mapped_port;
- tnet_ip_t mapped_ip;
- tsk_list_foreach(item, pairs){
- if(!(pair = item->data) || !pair->candidate_answer || !pair->candidate_offer){
- continue;
+ return 0;
+}
+
+const tnet_ice_pair_t* tnet_ice_pairs_find_by_response(tnet_ice_pairs_L_t* pairs, const tnet_stun_pkt_t* response)
+{
+ if(pairs && response) {
+ const tsk_list_item_t *item;
+ const tnet_ice_pair_t *pair;
+ tnet_port_t mapped_port;
+ tnet_ip_t mapped_ip;
+ tsk_list_foreach(item, pairs) {
+ if(!(pair = item->data) || !pair->candidate_answer || !pair->candidate_offer) {
+ continue;
+ }
+ if(pair->last_request && tnet_stun_utils_transac_id_equals(pair->last_request->transac_id, response->transac_id)) {
+ // check that mapped/xmapped address match destination
+ const tnet_stun_attr_address_t *xmapped_addr = tsk_null;
+ const tnet_stun_attr_address_t* mapped_addr = tsk_null;
+ const tnet_stun_attr_address_t* _addr;
+
+ tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t **)&xmapped_addr);
+ tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t **)&mapped_addr);
+ _addr = xmapped_addr ? xmapped_addr : mapped_addr;
+
+ if (!_addr) {
+ return pair; // do nothing if the client doesn't return mapped address STUN attribute
}
- if(pair->last_request && tnet_stun_utils_transac_id_equals(pair->last_request->transac_id, response->transac_id)){
- // check that mapped/xmapped address match destination
- const tnet_stun_attr_address_t *xmapped_addr = tsk_null;
- const tnet_stun_attr_address_t* mapped_addr = tsk_null;
- const tnet_stun_attr_address_t* _addr;
-
- tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t **)&xmapped_addr);
- tnet_stun_pkt_attr_find_first(response, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t **)&mapped_addr);
- _addr = xmapped_addr ? xmapped_addr : mapped_addr;
-
- if (!_addr) {
- return pair; // do nothing if the client doesn't return mapped address STUN attribute
- }
- /* rfc 5245 7.1.3.2.1. Discovering Peer Reflexive Candidates
-
- The agent checks the mapped address from the STUN response. If the
- transport address does not match any of the local candidates that the
- agent knows about, the mapped address represents a new candidate -- a
- peer reflexive candidate. Like other candidates, it has a type,
- base, priority, and foundation. They are computed as follows:
-
- o Its type is equal to peer reflexive.
-
- o Its base is set equal to the local candidate of the candidate pair
- from which the STUN check was sent.
-
- o Its priority is set equal to the value of the PRIORITY attribute
- in the Binding request.
-
- o Its foundation is selected as described in Section 4.1.1.3.
-
- This peer reflexive candidate is then added to the list of local
- candidates for the media stream. Its username fragment and password
- are the same as all other local candidates for that media stream.
- */
-
- tnet_stun_utils_inet_ntop((_addr->e_family == tnet_stun_address_family_ipv6), &_addr->address, &mapped_ip);
- mapped_port = _addr->u_port;
- if (pair->candidate_offer->type_e != tnet_ice_cand_type_host && (mapped_port != pair->candidate_offer->port || !tsk_striequals(mapped_ip, pair->candidate_offer->connection_addr))) {
- TSK_DEBUG_INFO("Mapped address different than local connection address...probably symetric NAT: %s#%s or %u#%u",
- pair->candidate_offer->connection_addr, mapped_ip,
- pair->candidate_offer->port, mapped_port);
- // do we really need to add new local candidate?
- // continue;
- }
- return pair;
+ /* rfc 5245 7.1.3.2.1. Discovering Peer Reflexive Candidates
+
+ The agent checks the mapped address from the STUN response. If the
+ transport address does not match any of the local candidates that the
+ agent knows about, the mapped address represents a new candidate -- a
+ peer reflexive candidate. Like other candidates, it has a type,
+ base, priority, and foundation. They are computed as follows:
+
+ o Its type is equal to peer reflexive.
+
+ o Its base is set equal to the local candidate of the candidate pair
+ from which the STUN check was sent.
+
+ o Its priority is set equal to the value of the PRIORITY attribute
+ in the Binding request.
+
+ o Its foundation is selected as described in Section 4.1.1.3.
+
+ This peer reflexive candidate is then added to the list of local
+ candidates for the media stream. Its username fragment and password
+ are the same as all other local candidates for that media stream.
+ */
+
+ tnet_stun_utils_inet_ntop((_addr->e_family == tnet_stun_address_family_ipv6), &_addr->address, &mapped_ip);
+ mapped_port = _addr->u_port;
+ if (pair->candidate_offer->type_e != tnet_ice_cand_type_host && (mapped_port != pair->candidate_offer->port || !tsk_striequals(mapped_ip, pair->candidate_offer->connection_addr))) {
+ TSK_DEBUG_INFO("Mapped address different than local connection address...probably symetric NAT: %s#%s or %u#%u",
+ pair->candidate_offer->connection_addr, mapped_ip,
+ pair->candidate_offer->port, mapped_port);
+ // do we really need to add new local candidate?
+ // continue;
}
+ return pair;
}
}
+ }
+ return tsk_null;
+}
+
+const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pairs, tnet_fd_t local_fd, const struct sockaddr_storage *remote_addr)
+{
+ int ret;
+ const tsk_list_item_t *item;
+ const tnet_ice_pair_t *pair;
+ tnet_ip_t remote_ip;
+ tnet_port_t remote_port;
+
+ if(!pairs || !remote_addr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pairs, tnet_fd_t local_fd, const struct sockaddr_storage *remote_addr)
- {
- int ret;
+
+ if((ret = tnet_get_sockip_n_port((const struct sockaddr*)remote_addr, &remote_ip, &remote_port))) {
+ TNET_PRINT_LAST_ERROR("tnet_get_sockip_n_port() failed");
+ return tsk_null;
+ }
+
+ tsk_list_foreach(item, pairs) {
+ if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->socket || pair->candidate_offer->socket->fd != local_fd) {
+ continue;
+ }
+ if (!tsk_striequals(pair->candidate_answer->connection_addr, remote_ip) || pair->candidate_answer->port != remote_port) {
+ continue;
+ }
+
+ return pair;
+ }
+
+ TSK_DEBUG_INFO("No ICE candidate with remote ip = %s, port = %u and local_fd = %d could be found...probably symetric NAT", remote_ip, remote_port, local_fd);
+
+ return tsk_null;
+}
+
+
+static tsk_bool_t _tnet_ice_pairs_none_succeed(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id, const char* foundation, tsk_bool_t answer)
+{
+ if(pairs && foundation) {
const tsk_list_item_t *item;
const tnet_ice_pair_t *pair;
- tnet_ip_t remote_ip;
- tnet_port_t remote_port;
-
- if(!pairs || !remote_addr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if((ret = tnet_get_sockip_n_port((const struct sockaddr*)remote_addr, &remote_ip, &remote_port))){
- TNET_PRINT_LAST_ERROR("tnet_get_sockip_n_port() failed");
- return tsk_null;
- }
-
- tsk_list_foreach(item, pairs){
- if (!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->socket || pair->candidate_offer->socket->fd != local_fd) {
+ const tnet_ice_candidate_t* candidate;
+ tsk_list_foreach(item, pairs) {
+ if(!(pair = item->data) || !(candidate = (answer ? pair->candidate_answer : pair->candidate_offer))) {
continue;
}
- if (!tsk_striequals(pair->candidate_answer->connection_addr, remote_ip) || pair->candidate_answer->port != remote_port) {
+ if(candidate->comp_id != comp_id || !tsk_striequals(candidate->foundation, foundation)) {
continue;
}
-
- return pair;
- }
-
- TSK_DEBUG_INFO("No ICE candidate with remote ip = %s, port = %u and local_fd = %d could be found...probably symetric NAT", remote_ip, remote_port, local_fd);
-
- return tsk_null;
- }
-
-
- static tsk_bool_t _tnet_ice_pairs_none_succeed(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id, const char* foundation, tsk_bool_t answer){
- if(pairs && foundation){
- const tsk_list_item_t *item;
- const tnet_ice_pair_t *pair;
- const tnet_ice_candidate_t* candidate;
- tsk_list_foreach(item, pairs){
- if(!(pair = item->data) || !(candidate = (answer ? pair->candidate_answer : pair->candidate_offer))){
- continue;
- }
- if(candidate->comp_id != comp_id || !tsk_striequals(candidate->foundation, foundation)){
- continue;
- }
- if((answer ? pair->state_answer : pair->state_offer) == tnet_ice_pair_state_succeed){
- TNET_ICE_PAIR_DEBUG_INFO("_tnet_ice_pairs_none_succeed_%s(%u, %s):false", answer?"anwser":"offer", comp_id, foundation);
- return tsk_false;
- }
+ if((answer ? pair->state_answer : pair->state_offer) == tnet_ice_pair_state_succeed) {
+ TNET_ICE_PAIR_DEBUG_INFO("_tnet_ice_pairs_none_succeed_%s(%u, %s):false", answer?"anwser":"offer", comp_id, foundation);
+ return tsk_false;
}
}
- TNET_ICE_PAIR_DEBUG_INFO("_tnet_ice_pairs_none_succeed_%s(%u, %s):true", answer?"anwser":"offer", comp_id, foundation);
- return tsk_true;
}
+ TNET_ICE_PAIR_DEBUG_INFO("_tnet_ice_pairs_none_succeed_%s(%u, %s):true", answer?"anwser":"offer", comp_id, foundation);
+ return tsk_true;
+}
#define _tnet_ice_pairs_none_succeed_answer(pairs, comp_id, foundation) _tnet_ice_pairs_none_succeed((pairs), (comp_id), (foundation), tsk_true)
#define _tnet_ice_pairs_none_succeed_offer(pairs, comp_id, foundation) _tnet_ice_pairs_none_succeed((pairs), (comp_id), (foundation), tsk_false)
-
- // both RTP and RTCP have succeeded
+
+// both RTP and RTCP have succeeded
#define _tnet_ice_pairs_get_nominated_offer_at(pairs, index, comp_id, check_fullness, ret) _tnet_ice_pairs_get_nominated_at((pairs), offer, answer, (index), (comp_id), (check_fullness), (ret))
#define _tnet_ice_pairs_get_nominated_answer_at(pairs, index, comp_id, check_fullness, ret) _tnet_ice_pairs_get_nominated_at((pairs), answer, offer, (index), (comp_id), (check_fullness), (ret))
#define _tnet_ice_pairs_get_nominated_at(pairs, dir_1, dir_2, index, _comp_id, check_fullness, ret) \
@@ -851,138 +853,146 @@ break; \
} \
} \
} \
+
+// true only if both RTP and RTCP are nominated
+tsk_bool_t tnet_ice_pairs_have_nominated_offer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
+{
+ const tnet_ice_pair_t *pair_ = tsk_null;
+ tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
+ TNET_ICE_PAIR_DEBUG_INFO("tnet_ice_pairs_have_nominated_offer()");
+ _tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
+ if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp) {
+ _tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
+ is_nominated_rtcp =(pair_ != tsk_null);
+ }
+ TNET_ICE_PAIR_DEBUG_INFO("is_nominated_rtp_offer=%s, is_nominated_rtcp_offer=%s", is_nominated_rtp?"yes":"no", is_nominated_rtcp?"yes":"no");
+ return (is_nominated_rtp && is_nominated_rtcp);
+}
- // true only if both RTP and RTCP are nominated
- tsk_bool_t tnet_ice_pairs_have_nominated_offer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
- {
- const tnet_ice_pair_t *pair_ = tsk_null;
- tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
- TNET_ICE_PAIR_DEBUG_INFO("tnet_ice_pairs_have_nominated_offer()");
- _tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
- if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp){
- _tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
- is_nominated_rtcp =(pair_ != tsk_null);
- }
- TNET_ICE_PAIR_DEBUG_INFO("is_nominated_rtp_offer=%s, is_nominated_rtcp_offer=%s", is_nominated_rtp?"yes":"no", is_nominated_rtcp?"yes":"no");
- return (is_nominated_rtp && is_nominated_rtcp);
- }
-
- // true only if both RTP and RTCP are nominated
- tsk_bool_t tnet_ice_pairs_have_nominated_answer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
- {
- const tnet_ice_pair_t *pair_ = tsk_null;
- tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
- TNET_ICE_PAIR_DEBUG_INFO("tnet_ice_pairs_have_nominated_answer()");
- _tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
- if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp){
- _tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
- is_nominated_rtcp =(pair_ != tsk_null);
- }
- TNET_ICE_PAIR_DEBUG_INFO("is_nominated_rtp_answer=%s, is_nominated_rtcp_answer=%s", is_nominated_rtp?"yes":"no", is_nominated_rtcp?"yes":"no");
- return (is_nominated_rtp && is_nominated_rtcp);
- }
-
- // true only if both RTP and RTCP are nominated in symetric way
- tsk_bool_t tnet_ice_pairs_have_nominated_symetric_2(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp, tsk_bool_t *got_hosts)
- {
- const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
- tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
- int ret;
-
- if (got_hosts) {
- *got_hosts = tsk_false;
- }
- ret = tnet_ice_pairs_get_nominated_symetric_candidates(pairs, TNET_ICE_CANDIDATE_COMPID_RTP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- if ((is_nominated_rtp = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest)) && got_hosts) {
- *got_hosts = (candidate_offer->type_e == tnet_ice_cand_type_host
- && candidate_answer_src->type_e == tnet_ice_cand_type_host
- && candidate_answer_dest->type_e == tnet_ice_cand_type_host);
- }
- if(is_nominated_rtp && check_rtcp){
- ret = tnet_ice_pairs_get_nominated_symetric_candidates(pairs, TNET_ICE_CANDIDATE_COMPID_RTCP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- if ((is_nominated_rtcp = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest)) && got_hosts) {
- *got_hosts &= (candidate_offer->type_e == tnet_ice_cand_type_host
- && candidate_answer_src->type_e == tnet_ice_cand_type_host
- && candidate_answer_dest->type_e == tnet_ice_cand_type_host);
- }
+// true only if both RTP and RTCP are nominated
+tsk_bool_t tnet_ice_pairs_have_nominated_answer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
+{
+ const tnet_ice_pair_t *pair_ = tsk_null;
+ tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
+ TNET_ICE_PAIR_DEBUG_INFO("tnet_ice_pairs_have_nominated_answer()");
+ _tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
+ if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp) {
+ _tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
+ is_nominated_rtcp =(pair_ != tsk_null);
+ }
+ TNET_ICE_PAIR_DEBUG_INFO("is_nominated_rtp_answer=%s, is_nominated_rtcp_answer=%s", is_nominated_rtp?"yes":"no", is_nominated_rtcp?"yes":"no");
+ return (is_nominated_rtp && is_nominated_rtcp);
+}
+
+// true only if both RTP and RTCP are nominated in symetric way
+tsk_bool_t tnet_ice_pairs_have_nominated_symetric_2(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp, tsk_bool_t *got_hosts)
+{
+ const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
+ tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
+ int ret;
+
+ if (got_hosts) {
+ *got_hosts = tsk_false;
+ }
+ ret = tnet_ice_pairs_get_nominated_symetric_candidates(pairs, TNET_ICE_CANDIDATE_COMPID_RTP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ if ((is_nominated_rtp = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest)) && got_hosts) {
+ *got_hosts = (candidate_offer->type_e == tnet_ice_cand_type_host
+ && candidate_answer_src->type_e == tnet_ice_cand_type_host
+ && candidate_answer_dest->type_e == tnet_ice_cand_type_host);
+ }
+ if(is_nominated_rtp && check_rtcp) {
+ ret = tnet_ice_pairs_get_nominated_symetric_candidates(pairs, TNET_ICE_CANDIDATE_COMPID_RTCP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ if ((is_nominated_rtcp = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest)) && got_hosts) {
+ *got_hosts &= (candidate_offer->type_e == tnet_ice_cand_type_host
+ && candidate_answer_src->type_e == tnet_ice_cand_type_host
+ && candidate_answer_dest->type_e == tnet_ice_cand_type_host);
}
- return (is_nominated_rtp && is_nominated_rtcp);
}
-
- // true only if both RTP and RTCP are nominated in symetric way
- tsk_bool_t tnet_ice_pairs_have_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
- {
+ return (is_nominated_rtp && is_nominated_rtcp);
+}
+
+// true only if both RTP and RTCP are nominated in symetric way
+tsk_bool_t tnet_ice_pairs_have_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
+{
#define got_hosts tsk_null
- return tnet_ice_pairs_have_nominated_symetric_2(pairs, check_rtcp, got_hosts);
- }
-
- // gets symetric nominated candidates with the highest priority
- // will succeed only if both RTP and RTCP are ok
- int tnet_ice_pairs_get_nominated_symetric_candidates(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
- const tnet_ice_candidate_t** candidate_offer,
- const tnet_ice_candidate_t** candidate_answer_src,
- const tnet_ice_candidate_t** candidate_answer_dest)
- {
- int ret;
- const tnet_ice_pair_t *pair_offer = tsk_null, *pair_answer_src = tsk_null, *pair_answer_dest = tsk_null;
- if (!pairs || !candidate_offer || !candidate_answer_src || !candidate_answer_dest) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- *candidate_offer = tsk_null;
- *candidate_answer_src = tsk_null;
- *candidate_answer_dest = tsk_null;
-
- if ((ret = tnet_ice_pairs_get_nominated_symetric_pairs(pairs, comp_id, &pair_offer, &pair_answer_src, &pair_answer_dest)) == 0) {
- *candidate_offer = pair_offer ? pair_offer->candidate_offer : tsk_null;
- *candidate_answer_src = pair_answer_src ? pair_answer_src->candidate_answer : tsk_null;
- *candidate_answer_dest = pair_answer_dest ? pair_answer_dest->candidate_answer : tsk_null;
- }
- return ret;
+ return tnet_ice_pairs_have_nominated_symetric_2(pairs, check_rtcp, got_hosts);
+}
+
+// gets symetric nominated candidates with the highest priority
+// will succeed only if both RTP and RTCP are ok
+int tnet_ice_pairs_get_nominated_symetric_candidates(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
+ const tnet_ice_candidate_t** candidate_offer,
+ const tnet_ice_candidate_t** candidate_answer_src,
+ const tnet_ice_candidate_t** candidate_answer_dest)
+{
+ int ret;
+ const tnet_ice_pair_t *pair_offer = tsk_null, *pair_answer_src = tsk_null, *pair_answer_dest = tsk_null;
+ if (!pairs || !candidate_offer || !candidate_answer_src || !candidate_answer_dest) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
-
- int tnet_ice_pairs_get_nominated_symetric_pairs(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
- const struct tnet_ice_pair_s** _pair_offer,
- const struct tnet_ice_pair_s** _pair_answer_src,
- const struct tnet_ice_pair_s** _pair_answer_dest)
- {
- const tnet_ice_pair_t *pair_offer = tsk_null;
- const tnet_ice_pair_t *pair_answer = tsk_null;
- tsk_size_t i_offer, i_answer;
- static const tsk_bool_t __check_fullness = tsk_false; // pairs will be checked seperatly
-
- if (!pairs || !_pair_offer || !_pair_answer_src || !_pair_answer_dest) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- *_pair_offer = tsk_null;
- *_pair_answer_src = tsk_null;
- *_pair_answer_dest = tsk_null;
-
- i_offer = 0;
+
+ *candidate_offer = tsk_null;
+ *candidate_answer_src = tsk_null;
+ *candidate_answer_dest = tsk_null;
+
+ if ((ret = tnet_ice_pairs_get_nominated_symetric_pairs(pairs, comp_id, &pair_offer, &pair_answer_src, &pair_answer_dest)) == 0) {
+ *candidate_offer = pair_offer ? pair_offer->candidate_offer : tsk_null;
+ *candidate_answer_src = pair_answer_src ? pair_answer_src->candidate_answer : tsk_null;
+ *candidate_answer_dest = pair_answer_dest ? pair_answer_dest->candidate_answer : tsk_null;
+ }
+ return ret;
+}
+
+int tnet_ice_pairs_get_nominated_symetric_pairs(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
+ const struct tnet_ice_pair_s** _pair_offer,
+ const struct tnet_ice_pair_s** _pair_answer_src,
+ const struct tnet_ice_pair_s** _pair_answer_dest)
+{
+ const tnet_ice_pair_t *pair_offer = tsk_null;
+ const tnet_ice_pair_t *pair_answer = tsk_null;
+ tsk_size_t i_offer, i_answer;
+ static const tsk_bool_t __check_fullness = tsk_false; // pairs will be checked seperatly
+
+ if (!pairs || !_pair_offer || !_pair_answer_src || !_pair_answer_dest) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ *_pair_offer = tsk_null;
+ *_pair_answer_src = tsk_null;
+ *_pair_answer_dest = tsk_null;
+
+ i_offer = 0;
+ while (1) {
+ _tnet_ice_pairs_get_nominated_offer_at((pairs), i_offer, comp_id, __check_fullness, (pair_offer)); // pair with socket SO as sender
+ if(!pair_offer) {
+ return 0;
+ }
+ ++i_offer;
+ if (pair_offer->candidate_offer->comp_id != comp_id) {
+ continue;
+ }
+ // find another pair with socket SO as receiver
+
+ i_answer = 0;
while (1) {
- _tnet_ice_pairs_get_nominated_offer_at((pairs), i_offer, comp_id, __check_fullness, (pair_offer)); // pair with socket SO as sender
- if(!pair_offer) return 0;
- ++i_offer;
- if (pair_offer->candidate_offer->comp_id != comp_id) continue;
- // find another pair with socket SO as receiver
-
- i_answer = 0;
- while (1) {
- _tnet_ice_pairs_get_nominated_answer_at((pairs), i_answer, comp_id, __check_fullness, (pair_answer));
- if (!pair_answer) break;
- ++i_answer;
- if (pair_answer->candidate_offer->comp_id != comp_id) continue;
- if (pair_answer->candidate_offer == pair_offer->candidate_offer) {
- *_pair_offer = pair_offer;
- *_pair_answer_src = pair_answer;
- *_pair_answer_dest = pair_offer;
- return 0;
- }
+ _tnet_ice_pairs_get_nominated_answer_at((pairs), i_answer, comp_id, __check_fullness, (pair_answer));
+ if (!pair_answer) {
+ break;
+ }
+ ++i_answer;
+ if (pair_answer->candidate_offer->comp_id != comp_id) {
+ continue;
+ }
+ if (pair_answer->candidate_offer == pair_offer->candidate_offer) {
+ *_pair_offer = pair_offer;
+ *_pair_answer_src = pair_answer;
+ *_pair_answer_dest = pair_offer;
+ return 0;
}
}
- return 0;
-
}
+ return 0;
+
+}
diff --git a/tinyNET/src/ice/tnet_ice_pair.h b/tinyNET/src/ice/tnet_ice_pair.h
index 7e40eb8..f3fb73d 100755
--- a/tinyNET/src/ice/tnet_ice_pair.h
+++ b/tinyNET/src/ice/tnet_ice_pair.h
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,33 +32,31 @@ typedef tsk_list_t tnet_ice_pairs_L_t;
struct tnet_ice_candidate_s;
-typedef enum tnet_ice_pair_state_e
-{
- tnet_ice_pair_state_frozen,
- tnet_ice_pair_state_waiting,
- tnet_ice_pair_state_in_progress,
- tnet_ice_pair_state_succeed,
- tnet_ice_pair_state_failed
+typedef enum tnet_ice_pair_state_e {
+ tnet_ice_pair_state_frozen,
+ tnet_ice_pair_state_waiting,
+ tnet_ice_pair_state_in_progress,
+ tnet_ice_pair_state_succeed,
+ tnet_ice_pair_state_failed
}
tnet_ice_pair_state_t;
-typedef struct tnet_ice_pair_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_ice_pair_s {
+ TSK_DECLARE_OBJECT;
- uint64_t id;
- uint64_t priority;
- tnet_ice_pair_state_t state_offer;
- tnet_ice_pair_state_t state_answer;
- tsk_bool_t is_ice_jingle;
- tsk_bool_t is_controlling;
- tsk_bool_t is_nominated;
- uint64_t tie_breaker;
- struct tnet_ice_candidate_s* candidate_offer;
- struct tnet_ice_candidate_s* candidate_answer;
- struct tnet_stun_pkt_s* last_request;
- struct sockaddr_storage remote_addr;
- tnet_turn_peer_id_t turn_peer_id;
+ uint64_t id;
+ uint64_t priority;
+ tnet_ice_pair_state_t state_offer;
+ tnet_ice_pair_state_t state_answer;
+ tsk_bool_t is_ice_jingle;
+ tsk_bool_t is_controlling;
+ tsk_bool_t is_nominated;
+ uint64_t tie_breaker;
+ struct tnet_ice_candidate_s* candidate_offer;
+ struct tnet_ice_candidate_s* candidate_answer;
+ struct tnet_stun_pkt_s* last_request;
+ struct sockaddr_storage remote_addr;
+ tnet_turn_peer_id_t turn_peer_id;
}
tnet_ice_pair_t;
@@ -75,12 +73,12 @@ tsk_bool_t tnet_ice_pairs_have_nominated_answer(const tnet_ice_pairs_L_t* pairs,
tsk_bool_t tnet_ice_pairs_have_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp);
tsk_bool_t tnet_ice_pairs_have_nominated_symetric_2(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp, tsk_bool_t *got_hosts);
int tnet_ice_pairs_get_nominated_symetric_candidates(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
- const struct tnet_ice_candidate_s** candidate_offer,
- const struct tnet_ice_candidate_s** candidate_answer_src,
- const struct tnet_ice_candidate_s** candidate_answer_dest);
+ const struct tnet_ice_candidate_s** candidate_offer,
+ const struct tnet_ice_candidate_s** candidate_answer_src,
+ const struct tnet_ice_candidate_s** candidate_answer_dest);
int tnet_ice_pairs_get_nominated_symetric_pairs(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
- const struct tnet_ice_pair_s** pair_offer,
- const struct tnet_ice_pair_s** pair_answer_src,
- const struct tnet_ice_pair_s** pair_answer_dest);
+ const struct tnet_ice_pair_s** pair_offer,
+ const struct tnet_ice_pair_s** pair_answer_src,
+ const struct tnet_ice_pair_s** pair_answer_dest);
#endif /* TNET_ICE_PAIR_H */
diff --git a/tinyNET/src/ice/tnet_ice_utils.c b/tinyNET/src/ice/tnet_ice_utils.c
index d4ba8a7..eae514e 100755
--- a/tinyNET/src/ice/tnet_ice_utils.c
+++ b/tinyNET/src/ice/tnet_ice_utils.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,132 +29,144 @@
#include <stdlib.h>
-static const char ice_chars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'k', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'K', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
- '0','1', '2', '3', '4', '5', '6', '7', '8', '9'}; // /!\do not add '/' and '+' because of WebRTC password
+static const char ice_chars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'k', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'K', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '0','1', '2', '3', '4', '5', '6', '7', '8', '9'
+ }; // /!\do not add '/' and '+' because of WebRTC password
static const tsk_size_t ice_chars_count = sizeof(ice_chars);
uint32_t tnet_ice_utils_get_priority(tnet_ice_cand_type_t type, uint16_t local_pref, tsk_bool_t is_rtp)
{
- uint32_t pref;
- switch(type){
- case tnet_ice_cand_type_host: pref = TNET_ICE_CANDIDATE_PREF_HOST; break;
- case tnet_ice_cand_type_srflx: pref = TNET_ICE_CANDIDATE_PREF_SRFLX; break;
- case tnet_ice_cand_type_prflx: pref = TNET_ICE_CANDIDATE_PREF_PRFLX; break;
- case tnet_ice_cand_type_relay: default: pref = TNET_ICE_CANDIDATE_PREF_RELAY; break;
- }
- return (pref << 24) +
- (local_pref << 8) +
- ((256 - (is_rtp ? TNET_ICE_CANDIDATE_COMPID_RTP : TNET_ICE_CANDIDATE_COMPID_RTCP)) << 0);
+ uint32_t pref;
+ switch(type) {
+ case tnet_ice_cand_type_host:
+ pref = TNET_ICE_CANDIDATE_PREF_HOST;
+ break;
+ case tnet_ice_cand_type_srflx:
+ pref = TNET_ICE_CANDIDATE_PREF_SRFLX;
+ break;
+ case tnet_ice_cand_type_prflx:
+ pref = TNET_ICE_CANDIDATE_PREF_PRFLX;
+ break;
+ case tnet_ice_cand_type_relay:
+ default:
+ pref = TNET_ICE_CANDIDATE_PREF_RELAY;
+ break;
+ }
+ return (pref << 24) +
+ (local_pref << 8) +
+ ((256 - (is_rtp ? TNET_ICE_CANDIDATE_COMPID_RTP : TNET_ICE_CANDIDATE_COMPID_RTCP)) << 0);
}
int tnet_ice_utils_compute_foundation(char* foundation, tsk_size_t size)
{
-
- tsk_size_t i;
-
- if(!foundation || !size){
- TSK_DEBUG_ERROR("Invalid argument");
- return -1;
- }
- for(
- i = 0; i < size; ++i){
- foundation[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
- }
-
- return 0;
+
+ tsk_size_t i;
+
+ if(!foundation || !size) {
+ TSK_DEBUG_ERROR("Invalid argument");
+ return -1;
+ }
+ for(
+ i = 0; i < size; ++i) {
+ foundation[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
+ }
+
+ return 0;
}
int tnet_ice_utils_create_sockets(tnet_socket_type_t socket_type, const char* local_ip, tnet_socket_t** socket_rtp, tnet_socket_t** socket_rtcp)
{
- tsk_bool_t look4_rtp = (socket_rtp != tsk_null);
- tsk_bool_t look4_rtcp = (socket_rtcp != tsk_null);
- uint8_t retry_count = 10;
- tnet_port_t local_port;
- static const uint64_t port_range_start = 1024;
- static const uint64_t port_range_stop = (65535 - 1/* to be sure rtcp port will be valid */);
- static uint64_t counter = 0;
-
- /* Creates local rtp and rtcp sockets */
- while(retry_count--){
- if(look4_rtp && look4_rtcp){
- tnet_socket_t* socket_fake = tnet_socket_create(local_ip, TNET_SOCKET_PORT_ANY, socket_type);
- if(!socket_fake){
- continue;
- }
- if(!(socket_fake->port & 0x01)){ // even number ?
- *socket_rtp = socket_fake;
- }
- else{
- *socket_rtcp = socket_fake;
- }
- local_port = (socket_fake->port & ~1);
- }
- else{
- local_port = (tnet_port_t)((((tsk_time_epoch() + rand() ) ^ ++counter) % (port_range_stop - port_range_start)) + port_range_start);
- local_port = (local_port & 0xFFFE); /* turn to even number */
- }
-
- /* beacuse failure will cause errors in the log, print a message to alert that there is
- * nothing to worry about */
- TSK_DEBUG_INFO("RTP/RTCP manager[Begin]: Trying to bind to random ports [%s:%d]", local_ip, local_port);
-
- if(look4_rtp){
- if(!*socket_rtp && !(*socket_rtp = tnet_socket_create(local_ip, local_port, socket_type))){
- TSK_DEBUG_INFO("Failed to bind to %d", local_port);
- continue;
- }
- }
-
- if(look4_rtcp){
- if(!*socket_rtcp && !(*socket_rtcp = tnet_socket_create(local_ip, (local_port + 1), socket_type))){
- TSK_DEBUG_INFO("Failed to bind to %d", (local_port + 1));
- if(look4_rtp){
- TSK_OBJECT_SAFE_FREE((*socket_rtp));
- }
- continue;
- }
- }
-
- TSK_DEBUG_INFO("RTP/RTCP manager[End]: Trying to bind to random ports");
- return 0;
- }
-
- TSK_DEBUG_ERROR("Failed to bind sockets");
- return -1;
+ tsk_bool_t look4_rtp = (socket_rtp != tsk_null);
+ tsk_bool_t look4_rtcp = (socket_rtcp != tsk_null);
+ uint8_t retry_count = 10;
+ tnet_port_t local_port;
+ static const uint64_t port_range_start = 1024;
+ static const uint64_t port_range_stop = (65535 - 1/* to be sure rtcp port will be valid */);
+ static uint64_t counter = 0;
+
+ /* Creates local rtp and rtcp sockets */
+ while(retry_count--) {
+ if(look4_rtp && look4_rtcp) {
+ tnet_socket_t* socket_fake = tnet_socket_create(local_ip, TNET_SOCKET_PORT_ANY, socket_type);
+ if(!socket_fake) {
+ continue;
+ }
+ if(!(socket_fake->port & 0x01)) { // even number ?
+ *socket_rtp = socket_fake;
+ }
+ else {
+ *socket_rtcp = socket_fake;
+ }
+ local_port = (socket_fake->port & ~1);
+ }
+ else {
+ local_port = (tnet_port_t)((((tsk_time_epoch() + rand() ) ^ ++counter) % (port_range_stop - port_range_start)) + port_range_start);
+ local_port = (local_port & 0xFFFE); /* turn to even number */
+ }
+
+ /* beacuse failure will cause errors in the log, print a message to alert that there is
+ * nothing to worry about */
+ TSK_DEBUG_INFO("RTP/RTCP manager[Begin]: Trying to bind to random ports [%s:%d]", local_ip, local_port);
+
+ if(look4_rtp) {
+ if(!*socket_rtp && !(*socket_rtp = tnet_socket_create(local_ip, local_port, socket_type))) {
+ TSK_DEBUG_INFO("Failed to bind to %d", local_port);
+ continue;
+ }
+ }
+
+ if(look4_rtcp) {
+ if(!*socket_rtcp && !(*socket_rtcp = tnet_socket_create(local_ip, (local_port + 1), socket_type))) {
+ TSK_DEBUG_INFO("Failed to bind to %d", (local_port + 1));
+ if(look4_rtp) {
+ TSK_OBJECT_SAFE_FREE((*socket_rtp));
+ }
+ continue;
+ }
+ }
+
+ TSK_DEBUG_INFO("RTP/RTCP manager[End]: Trying to bind to random ports");
+ return 0;
+ }
+
+ TSK_DEBUG_ERROR("Failed to bind sockets");
+ return -1;
}
int tnet_ice_utils_set_ufrag(char** ufrag)
{
- if(ufrag){
- char tmp[16]; int i;
- for(i = 0; i < (sizeof(tmp)/sizeof(tmp[0])) - 1; ++i){
- tmp[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
- }
- tmp[i] = '\0';
- tsk_strupdate(ufrag, tmp);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(ufrag) {
+ char tmp[16];
+ int i;
+ for(i = 0; i < (sizeof(tmp)/sizeof(tmp[0])) - 1; ++i) {
+ tmp[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
+ }
+ tmp[i] = '\0';
+ tsk_strupdate(ufrag, tmp);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
int tnet_ice_utils_set_pwd(char** pwd)
{
- if(pwd){
- char tmp[23]; int i;
- for(i = 0; i < (sizeof(tmp)/sizeof(tmp[0])) - 1; ++i){
- tmp[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
- }
- tmp[i] = '\0';
- tsk_strupdate(pwd, tmp);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(pwd) {
+ char tmp[23];
+ int i;
+ for(i = 0; i < (sizeof(tmp)/sizeof(tmp[0])) - 1; ++i) {
+ tmp[i] = ice_chars[(rand() ^ rand()) % ice_chars_count];
+ }
+ tmp[i] = '\0';
+ tsk_strupdate(pwd, tmp);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
} \ No newline at end of file
diff --git a/tinyNET/src/ice/tnet_ice_utils.h b/tinyNET/src/ice/tnet_ice_utils.h
index 8e53915..541bb9a 100755
--- a/tinyNET/src/ice/tnet_ice_utils.h
+++ b/tinyNET/src/ice/tnet_ice_utils.h
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/stun/tnet_stun_attr.c b/tinyNET/src/stun/tnet_stun_attr.c
index 4c31c05..25ad6c7 100755
--- a/tinyNET/src/stun/tnet_stun_attr.c
+++ b/tinyNET/src/stun/tnet_stun_attr.c
@@ -53,479 +53,479 @@
static int _tnet_stun_attr_cmp(const tsk_object_t *_att1, const tsk_object_t *_att2)
{
- const tnet_stun_attr_t *pc_att1 = (const tnet_stun_attr_t *)_att1;
- const tnet_stun_attr_t *pc_att2 = (const tnet_stun_attr_t *)_att2;
+ const tnet_stun_attr_t *pc_att1 = (const tnet_stun_attr_t *)_att1;
+ const tnet_stun_attr_t *pc_att2 = (const tnet_stun_attr_t *)_att2;
- return (int)(pc_att1 - pc_att2);
+ return (int)(pc_att1 - pc_att2);
}
static int _tnet_stun_attr_get_size_in_octetunits(const tnet_stun_attr_t* pc_self, tsk_bool_t with_padding, tsk_size_t* p_size)
{
- if (!pc_self || !p_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- switch (pc_self->hdr.e_type) {
- case tnet_stun_attr_type_mapped_address:
- case tnet_stun_attr_type_alternate_server:
- case tnet_stun_attr_type_xor_mapped_address:
- case tnet_stun_attr_type_xor_peer_address:
- case tnet_stun_attr_type_xor_relayed_address: {
- extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
- const tnet_stun_attr_address_t* _pc_self = (const tnet_stun_attr_address_t*)pc_self;
- if (pc_self->__def__ != tnet_stun_attr_address_def_t) {
- TSK_DEBUG_ERROR("Invalid base type");
- return -2;
- }
- *p_size = (kStunAttrHdrSizeInOctets + 1/*Ignored*/ + 1/*Family*/ + 2/*Port*/ + ((_pc_self->e_family == tnet_stun_address_family_ipv6) ? 16 : 4));
- if (with_padding) {
- ALIGN_ON_32BITS(*p_size);
- }
- return 0;
- }
- case tnet_stun_attr_type_data:
- case tnet_stun_attr_type_unknown_attrs:
- case tnet_stun_attr_type_dont_fragment:
- case tnet_stun_attr_type_software:
- case tnet_stun_attr_type_nonce:
- case tnet_stun_attr_type_realm:
- case tnet_stun_attr_type_username:
- case tnet_stun_attr_type_password:
- case tnet_stun_attr_type_channel_number:
- case tnet_stun_attr_type_message_integrity:
- case tnet_stun_attr_type_fingerprint:
- case tnet_stun_attr_type_lifetime:
- case tnet_stun_attr_type_requested_transport:
- case tnet_stun_attr_type_ice_use_candidate:
- case tnet_stun_attr_type_ice_priority:
- case tnet_stun_attr_type_ice_controlled:
- case tnet_stun_attr_type_ice_controlling:
- case tnet_stun_attr_type_connection_id: {
- extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
- const tnet_stun_attr_vdata_t* _pc_self = (const tnet_stun_attr_vdata_t*)pc_self;
- if (pc_self->__def__ != tnet_stun_attr_vdata_def_t) {
- TSK_DEBUG_ERROR("Invalid base type");
- return -2;
- }
- *p_size = (kStunAttrHdrSizeInOctets + _pc_self->u_data_size);
- if (with_padding) {
- ALIGN_ON_32BITS(*p_size);
- }
- return 0;
- }
- case tnet_stun_attr_type_error_code: {
- const tnet_stun_attr_error_code_t* _pc_self = (const tnet_stun_attr_error_code_t*)pc_self;
- *p_size = (kStunAttrHdrSizeInOctets + 4 + (tsk_size_t)tsk_strlen(_pc_self->p_reason_phrase));
- if (with_padding) {
- ALIGN_ON_32BITS(*p_size);
- }
- return 0;
- }
- default: {
- TSK_DEBUG_WARN("Attribute type=%d is unknown. Don't be surprised if something goes wrong.", pc_self->hdr.e_type);
- *p_size = (kStunAttrHdrSizeInOctets + pc_self->hdr.u_length);
- if (with_padding) {
- ALIGN_ON_32BITS(*p_size);
- }
- return 0;
- }
- }
+ if (!pc_self || !p_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ switch (pc_self->hdr.e_type) {
+ case tnet_stun_attr_type_mapped_address:
+ case tnet_stun_attr_type_alternate_server:
+ case tnet_stun_attr_type_xor_mapped_address:
+ case tnet_stun_attr_type_xor_peer_address:
+ case tnet_stun_attr_type_xor_relayed_address: {
+ extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
+ const tnet_stun_attr_address_t* _pc_self = (const tnet_stun_attr_address_t*)pc_self;
+ if (pc_self->__def__ != tnet_stun_attr_address_def_t) {
+ TSK_DEBUG_ERROR("Invalid base type");
+ return -2;
+ }
+ *p_size = (kStunAttrHdrSizeInOctets + 1/*Ignored*/ + 1/*Family*/ + 2/*Port*/ + ((_pc_self->e_family == tnet_stun_address_family_ipv6) ? 16 : 4));
+ if (with_padding) {
+ ALIGN_ON_32BITS(*p_size);
+ }
+ return 0;
+ }
+ case tnet_stun_attr_type_data:
+ case tnet_stun_attr_type_unknown_attrs:
+ case tnet_stun_attr_type_dont_fragment:
+ case tnet_stun_attr_type_software:
+ case tnet_stun_attr_type_nonce:
+ case tnet_stun_attr_type_realm:
+ case tnet_stun_attr_type_username:
+ case tnet_stun_attr_type_password:
+ case tnet_stun_attr_type_channel_number:
+ case tnet_stun_attr_type_message_integrity:
+ case tnet_stun_attr_type_fingerprint:
+ case tnet_stun_attr_type_lifetime:
+ case tnet_stun_attr_type_requested_transport:
+ case tnet_stun_attr_type_ice_use_candidate:
+ case tnet_stun_attr_type_ice_priority:
+ case tnet_stun_attr_type_ice_controlled:
+ case tnet_stun_attr_type_ice_controlling:
+ case tnet_stun_attr_type_connection_id: {
+ extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
+ const tnet_stun_attr_vdata_t* _pc_self = (const tnet_stun_attr_vdata_t*)pc_self;
+ if (pc_self->__def__ != tnet_stun_attr_vdata_def_t) {
+ TSK_DEBUG_ERROR("Invalid base type");
+ return -2;
+ }
+ *p_size = (kStunAttrHdrSizeInOctets + _pc_self->u_data_size);
+ if (with_padding) {
+ ALIGN_ON_32BITS(*p_size);
+ }
+ return 0;
+ }
+ case tnet_stun_attr_type_error_code: {
+ const tnet_stun_attr_error_code_t* _pc_self = (const tnet_stun_attr_error_code_t*)pc_self;
+ *p_size = (kStunAttrHdrSizeInOctets + 4 + (tsk_size_t)tsk_strlen(_pc_self->p_reason_phrase));
+ if (with_padding) {
+ ALIGN_ON_32BITS(*p_size);
+ }
+ return 0;
+ }
+ default: {
+ TSK_DEBUG_WARN("Attribute type=%d is unknown. Don't be surprised if something goes wrong.", pc_self->hdr.e_type);
+ *p_size = (kStunAttrHdrSizeInOctets + pc_self->hdr.u_length);
+ if (with_padding) {
+ ALIGN_ON_32BITS(*p_size);
+ }
+ return 0;
+ }
+ }
}
static int _tnet_stun_attr_write(const tnet_stun_transac_id_t* pc_transac_id, const tnet_stun_attr_t* pc_self, uint8_t* p_buff_ptr, tsk_size_t n_buff_size, tsk_bool_t with_padding, tsk_size_t *p_written)
{
- tsk_size_t n_min_req_size;
- int ret;
- if (!pc_self || !p_buff_ptr || !n_buff_size || !p_written) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = _tnet_stun_attr_get_size_in_octetunits(pc_self, with_padding, &n_min_req_size))) {
- return ret;
- }
- if (n_min_req_size > n_buff_size) {
- TSK_DEBUG_ERROR("Buffer too short %u<%u", (unsigned)n_buff_size, (unsigned)n_min_req_size);
- return -2;
- }
-
- *((uint16_t*)&p_buff_ptr[0]) = tnet_htons((unsigned short)pc_self->hdr.e_type);
- // *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)pc_self->hdr.u_length);
- *p_written = kStunAttrHdrSizeInOctets;
-
- switch (pc_self->hdr.e_type) {
- case tnet_stun_attr_type_mapped_address:
- case tnet_stun_attr_type_alternate_server:
- case tnet_stun_attr_type_xor_mapped_address:
- case tnet_stun_attr_type_xor_peer_address:
- case tnet_stun_attr_type_xor_relayed_address: {
- tsk_size_t u_addr_size;
- extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
- const tnet_stun_attr_address_t* _pc_self = (const tnet_stun_attr_address_t*)pc_self;
- tsk_bool_t b_xor = IS_ADDRESS_XOR(pc_self->hdr.e_type);
- if (pc_self->__def__ != tnet_stun_attr_address_def_t) {
- TSK_DEBUG_ERROR("Invalid base type");
- return -2;
- }
- p_buff_ptr[*p_written] = 0x00; // Reserved
- p_buff_ptr[*p_written + 1] = _pc_self->e_family;
- u_addr_size = (_pc_self->e_family == tnet_stun_address_family_ipv6 ? 16 : 4);
- if (b_xor) {
- tsk_size_t u;
- *((uint16_t*)&p_buff_ptr[*p_written + 2]) = tnet_htons(_pc_self->u_port ^ kStunMagicCookieShort);
- *((uint32_t*)&p_buff_ptr[*p_written + 4]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[0])) ^ kStunMagicCookieLong);
- for (u = 4; u < u_addr_size; u += 4) {
- if (pc_transac_id) {
- *((uint32_t*)&p_buff_ptr[*p_written + 4 + u]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[u])) ^ tnet_ntohl(*((uint32_t*)(*pc_transac_id + u - 4))));
- }
- else {
- *((uint32_t*)&p_buff_ptr[*p_written + 4 + u]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[u])) ^ 0);
- }
- }
- }
- else {
- *((uint16_t*)&p_buff_ptr[*p_written + 2]) = tnet_htons(_pc_self->u_port);
- memcpy(&p_buff_ptr[*p_written + 4], _pc_self->address, u_addr_size);
- }
-
- *p_written += 4 + u_addr_size;
- *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
- if (with_padding) {
- ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
- }
- return 0;
- }
-
- case tnet_stun_attr_type_data:
- case tnet_stun_attr_type_unknown_attrs:
- case tnet_stun_attr_type_dont_fragment:
- case tnet_stun_attr_type_software:
- case tnet_stun_attr_type_nonce:
- case tnet_stun_attr_type_realm:
- case tnet_stun_attr_type_username:
- case tnet_stun_attr_type_password:
- case tnet_stun_attr_type_channel_number:
- case tnet_stun_attr_type_message_integrity:
- case tnet_stun_attr_type_fingerprint:
- case tnet_stun_attr_type_lifetime:
- case tnet_stun_attr_type_requested_transport:
- case tnet_stun_attr_type_ice_use_candidate:
- case tnet_stun_attr_type_ice_priority:
- case tnet_stun_attr_type_ice_controlled:
- case tnet_stun_attr_type_ice_controlling:
- case tnet_stun_attr_type_connection_id: {
- extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
- const tnet_stun_attr_vdata_t* _pc_self = (const tnet_stun_attr_vdata_t*)pc_self;
- if (pc_self->__def__ != tnet_stun_attr_vdata_def_t) {
- TSK_DEBUG_ERROR("Invalid base type");
- return -2;
- }
- if (_pc_self->p_data_ptr && _pc_self->u_data_size) {
- if (IS_VDATA_UINT16(pc_self->hdr.e_type) && _pc_self->u_data_size == 2) {
- *((uint16_t*)&p_buff_ptr[*p_written]) = tnet_htons_2(&_pc_self->p_data_ptr[0]);
- }
- else if (IS_VDATA_UINT32(pc_self->hdr.e_type) && _pc_self->u_data_size == 4) {
- *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[0]);
- }
- else if (IS_VDATA_UINT64(pc_self->hdr.e_type) && _pc_self->u_data_size == 8) {
- *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[0]);
- *((uint32_t*)&p_buff_ptr[*p_written + 4]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[4]);
- }
- else if (pc_self->hdr.e_type == tnet_stun_attr_type_unknown_attrs && _pc_self->u_data_size && !(_pc_self->u_data_size & 1)) {
- uint16_t u;
- for (u = 0; u < _pc_self->u_data_size; u += 2) {
- *((uint16_t*)&p_buff_ptr[*p_written + u]) = tnet_htons_2(&_pc_self->p_data_ptr[u]);
- }
- }
- else {
- memcpy(&p_buff_ptr[*p_written], _pc_self->p_data_ptr, _pc_self->u_data_size);
- }
- *p_written += _pc_self->u_data_size;
- }
- if (with_padding) {
- ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
- }
- *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
- return 0;
- }
- case tnet_stun_attr_type_error_code: {
- const tnet_stun_attr_error_code_t* _pc_self = (const tnet_stun_attr_error_code_t*)pc_self;
- *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl(((_pc_self->u_class & 0x07) << 8) | _pc_self->u_number);
- if (_pc_self->p_reason_phrase) {
- memcpy(&p_buff_ptr[*p_written + 4], _pc_self->p_reason_phrase, tsk_strlen(_pc_self->p_reason_phrase));
- }
- *p_written += 4 + tsk_strlen(_pc_self->p_reason_phrase);
- if (with_padding) {
- ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
- }
- *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
- return 0;
- }
- default: {
- TSK_DEBUG_ERROR("Attribute type=%d is unknown.", pc_self->hdr.e_type);
- return -2;
- }
- }
+ tsk_size_t n_min_req_size;
+ int ret;
+ if (!pc_self || !p_buff_ptr || !n_buff_size || !p_written) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = _tnet_stun_attr_get_size_in_octetunits(pc_self, with_padding, &n_min_req_size))) {
+ return ret;
+ }
+ if (n_min_req_size > n_buff_size) {
+ TSK_DEBUG_ERROR("Buffer too short %u<%u", (unsigned)n_buff_size, (unsigned)n_min_req_size);
+ return -2;
+ }
+
+ *((uint16_t*)&p_buff_ptr[0]) = tnet_htons((unsigned short)pc_self->hdr.e_type);
+ // *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)pc_self->hdr.u_length);
+ *p_written = kStunAttrHdrSizeInOctets;
+
+ switch (pc_self->hdr.e_type) {
+ case tnet_stun_attr_type_mapped_address:
+ case tnet_stun_attr_type_alternate_server:
+ case tnet_stun_attr_type_xor_mapped_address:
+ case tnet_stun_attr_type_xor_peer_address:
+ case tnet_stun_attr_type_xor_relayed_address: {
+ tsk_size_t u_addr_size;
+ extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
+ const tnet_stun_attr_address_t* _pc_self = (const tnet_stun_attr_address_t*)pc_self;
+ tsk_bool_t b_xor = IS_ADDRESS_XOR(pc_self->hdr.e_type);
+ if (pc_self->__def__ != tnet_stun_attr_address_def_t) {
+ TSK_DEBUG_ERROR("Invalid base type");
+ return -2;
+ }
+ p_buff_ptr[*p_written] = 0x00; // Reserved
+ p_buff_ptr[*p_written + 1] = _pc_self->e_family;
+ u_addr_size = (_pc_self->e_family == tnet_stun_address_family_ipv6 ? 16 : 4);
+ if (b_xor) {
+ tsk_size_t u;
+ *((uint16_t*)&p_buff_ptr[*p_written + 2]) = tnet_htons(_pc_self->u_port ^ kStunMagicCookieShort);
+ *((uint32_t*)&p_buff_ptr[*p_written + 4]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[0])) ^ kStunMagicCookieLong);
+ for (u = 4; u < u_addr_size; u += 4) {
+ if (pc_transac_id) {
+ *((uint32_t*)&p_buff_ptr[*p_written + 4 + u]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[u])) ^ tnet_ntohl(*((uint32_t*)(*pc_transac_id + u - 4))));
+ }
+ else {
+ *((uint32_t*)&p_buff_ptr[*p_written + 4 + u]) = (uint32_t)tnet_htonl(tnet_ntohl(*((uint32_t*)&_pc_self->address[u])) ^ 0);
+ }
+ }
+ }
+ else {
+ *((uint16_t*)&p_buff_ptr[*p_written + 2]) = tnet_htons(_pc_self->u_port);
+ memcpy(&p_buff_ptr[*p_written + 4], _pc_self->address, u_addr_size);
+ }
+
+ *p_written += 4 + u_addr_size;
+ *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
+ if (with_padding) {
+ ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
+ }
+ return 0;
+ }
+
+ case tnet_stun_attr_type_data:
+ case tnet_stun_attr_type_unknown_attrs:
+ case tnet_stun_attr_type_dont_fragment:
+ case tnet_stun_attr_type_software:
+ case tnet_stun_attr_type_nonce:
+ case tnet_stun_attr_type_realm:
+ case tnet_stun_attr_type_username:
+ case tnet_stun_attr_type_password:
+ case tnet_stun_attr_type_channel_number:
+ case tnet_stun_attr_type_message_integrity:
+ case tnet_stun_attr_type_fingerprint:
+ case tnet_stun_attr_type_lifetime:
+ case tnet_stun_attr_type_requested_transport:
+ case tnet_stun_attr_type_ice_use_candidate:
+ case tnet_stun_attr_type_ice_priority:
+ case tnet_stun_attr_type_ice_controlled:
+ case tnet_stun_attr_type_ice_controlling:
+ case tnet_stun_attr_type_connection_id: {
+ extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
+ const tnet_stun_attr_vdata_t* _pc_self = (const tnet_stun_attr_vdata_t*)pc_self;
+ if (pc_self->__def__ != tnet_stun_attr_vdata_def_t) {
+ TSK_DEBUG_ERROR("Invalid base type");
+ return -2;
+ }
+ if (_pc_self->p_data_ptr && _pc_self->u_data_size) {
+ if (IS_VDATA_UINT16(pc_self->hdr.e_type) && _pc_self->u_data_size == 2) {
+ *((uint16_t*)&p_buff_ptr[*p_written]) = tnet_htons_2(&_pc_self->p_data_ptr[0]);
+ }
+ else if (IS_VDATA_UINT32(pc_self->hdr.e_type) && _pc_self->u_data_size == 4) {
+ *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[0]);
+ }
+ else if (IS_VDATA_UINT64(pc_self->hdr.e_type) && _pc_self->u_data_size == 8) {
+ *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[0]);
+ *((uint32_t*)&p_buff_ptr[*p_written + 4]) = (uint32_t)tnet_htonl_2(&_pc_self->p_data_ptr[4]);
+ }
+ else if (pc_self->hdr.e_type == tnet_stun_attr_type_unknown_attrs && _pc_self->u_data_size && !(_pc_self->u_data_size & 1)) {
+ uint16_t u;
+ for (u = 0; u < _pc_self->u_data_size; u += 2) {
+ *((uint16_t*)&p_buff_ptr[*p_written + u]) = tnet_htons_2(&_pc_self->p_data_ptr[u]);
+ }
+ }
+ else {
+ memcpy(&p_buff_ptr[*p_written], _pc_self->p_data_ptr, _pc_self->u_data_size);
+ }
+ *p_written += _pc_self->u_data_size;
+ }
+ if (with_padding) {
+ ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
+ }
+ *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
+ return 0;
+ }
+ case tnet_stun_attr_type_error_code: {
+ const tnet_stun_attr_error_code_t* _pc_self = (const tnet_stun_attr_error_code_t*)pc_self;
+ *((uint32_t*)&p_buff_ptr[*p_written]) = (uint32_t)tnet_htonl(((_pc_self->u_class & 0x07) << 8) | _pc_self->u_number);
+ if (_pc_self->p_reason_phrase) {
+ memcpy(&p_buff_ptr[*p_written + 4], _pc_self->p_reason_phrase, tsk_strlen(_pc_self->p_reason_phrase));
+ }
+ *p_written += 4 + tsk_strlen(_pc_self->p_reason_phrase);
+ if (with_padding) {
+ ALIGN_ON_32BITS_AND_SET_PADDING_ZEROS(&p_buff_ptr[*p_written], *p_written);
+ }
+ *((uint16_t*)&p_buff_ptr[2]) = tnet_htons((unsigned short)*p_written - kStunAttrHdrSizeInOctets);
+ return 0;
+ }
+ default: {
+ TSK_DEBUG_ERROR("Attribute type=%d is unknown.", pc_self->hdr.e_type);
+ return -2;
+ }
+ }
}
int tnet_stun_attr_init(tnet_stun_attr_t* p_self, tnet_stun_attr_type_t e_type, uint16_t u_length)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- p_self->hdr.e_type = e_type;
- p_self->hdr.u_length = u_length;
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ p_self->hdr.e_type = e_type;
+ p_self->hdr.u_length = u_length;
+ return 0;
}
int tnet_stun_attr_get_size_in_octetunits_without_padding(const tnet_stun_attr_t* pc_self, tsk_size_t* p_size)
{
- return _tnet_stun_attr_get_size_in_octetunits(pc_self, kWithoutPadding, p_size);
+ return _tnet_stun_attr_get_size_in_octetunits(pc_self, kWithoutPadding, p_size);
}
int tnet_stun_attr_get_size_in_octetunits_with_padding(const tnet_stun_attr_t* pc_self, tsk_size_t* p_size)
{
- return _tnet_stun_attr_get_size_in_octetunits(pc_self, kWithPadding, p_size);
+ return _tnet_stun_attr_get_size_in_octetunits(pc_self, kWithPadding, p_size);
}
int tnet_stun_attr_write_without_padding(const tnet_stun_transac_id_t* pc_transac_id, const tnet_stun_attr_t* pc_self, uint8_t* p_buff_ptr, tsk_size_t n_buff_size, tsk_size_t *p_written)
{
- return _tnet_stun_attr_write(pc_transac_id, pc_self, p_buff_ptr, n_buff_size, kWithoutPadding, p_written);
+ return _tnet_stun_attr_write(pc_transac_id, pc_self, p_buff_ptr, n_buff_size, kWithoutPadding, p_written);
}
int tnet_stun_attr_write_with_padding(const tnet_stun_transac_id_t* pc_transac_id, const tnet_stun_attr_t* pc_self, uint8_t* p_buff_ptr, tsk_size_t n_buff_size, tsk_size_t *p_written)
{
- return _tnet_stun_attr_write(pc_transac_id, pc_self, p_buff_ptr, n_buff_size, kWithPadding, p_written);
+ return _tnet_stun_attr_write(pc_transac_id, pc_self, p_buff_ptr, n_buff_size, kWithPadding, p_written);
}
int tnet_stun_attr_read(const tnet_stun_transac_id_t* pc_transac_id, const uint8_t* pc_buff_ptr, tsk_size_t n_buff_size, tsk_size_t *p_consumed_octets, tnet_stun_attr_t** pp_attr)
{
- tnet_stun_attr_type_t Type;
- uint16_t Length, PadLength;
- int ret = -1;
- static const void* kNullBuffPtr = tsk_null;
- if (!pc_buff_ptr || !n_buff_size || !pp_attr || !p_consumed_octets) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (n_buff_size < kStunAttrHdrSizeInOctets) {
- TSK_DEBUG_ERROR("Buffer too short(%u)", (unsigned)n_buff_size);
- return -2;
- }
-
- Type = tnet_ntohs_2(&pc_buff_ptr[0]);
- Length = tnet_ntohs_2(&pc_buff_ptr[2]);
- if (Length > n_buff_size) {
- TSK_DEBUG_ERROR("Buffer too short(%u). Length=%u", (unsigned)n_buff_size, (unsigned)Length);
- return -3;
- }
-
- PadLength = (Length & 0x03) ? (4 - (Length & 0x03)) : 0;
-
- *pp_attr = tsk_null;
- *p_consumed_octets = kStunAttrHdrSizeInOctets + Length + PadLength;
-
- switch (Type) {
- case tnet_stun_attr_type_mapped_address:
- case tnet_stun_attr_type_alternate_server:
- case tnet_stun_attr_type_xor_mapped_address:
- case tnet_stun_attr_type_xor_peer_address:
- case tnet_stun_attr_type_xor_relayed_address: {
- // First 8bits must be ignored
- tnet_stun_address_family_t e_family = pc_buff_ptr[5];
- uint16_t u_port = tnet_ntohs_2(&pc_buff_ptr[6]);
- tnet_stun_attr_address_t* p_attr;
- tsk_bool_t b_xor = IS_ADDRESS_XOR(Type);
- uint16_t u, u_addr_size = (e_family == tnet_stun_address_family_ipv6) ? 16 : 4;
-
- if (b_xor) {
- u_port ^= kStunMagicCookieShort;
- }
- if ((ret = tnet_stun_attr_address_create(Type, e_family, u_port, (const tnet_stun_addr_t*)kNullBuffPtr, &p_attr))) {
- return ret;
- }
- if (b_xor) {
- *((uint32_t*)&p_attr->address[0]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8]) ^ kStunMagicCookieLong);
- for (u = 4; u < u_addr_size; u += 4) {
- if (pc_transac_id) {
- *((uint32_t*)&p_attr->address[u]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8 + u]) ^ tnet_ntohl_2(((uint32_t*)(*pc_transac_id + u - 4))));
- }
- else {
- *((uint32_t*)&p_attr->address[u]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8 + u]) ^ 0);
- }
- }
- }
- else {
- memcpy(p_attr->address, &pc_buff_ptr[8], u_addr_size);
- }
- *pp_attr = TNET_STUN_ATTR(p_attr);
- break;
- }
-
- case tnet_stun_attr_type_error_code: {
- // First 21bits must be ignored
- uint8_t Class = pc_buff_ptr[6] & 0x07;
- uint8_t Number = pc_buff_ptr[7] & 0xff;
- tnet_stun_attr_error_code_t* p_attr;
- if ((ret = tnet_stun_attr_error_code_create(Class, Number, &pc_buff_ptr[8], (Length - 4), &p_attr))) {
- return ret;
- }
- *pp_attr = TNET_STUN_ATTR(p_attr);
- break;
- }
-
- case tnet_stun_attr_type_data:
- case tnet_stun_attr_type_unknown_attrs:
- case tnet_stun_attr_type_dont_fragment:
- case tnet_stun_attr_type_software:
- case tnet_stun_attr_type_nonce:
- case tnet_stun_attr_type_realm:
- case tnet_stun_attr_type_username:
- case tnet_stun_attr_type_password:
- case tnet_stun_attr_type_channel_number:
- case tnet_stun_attr_type_message_integrity:
- case tnet_stun_attr_type_fingerprint:
- case tnet_stun_attr_type_lifetime:
- case tnet_stun_attr_type_requested_transport:
- case tnet_stun_attr_type_ice_use_candidate:
- case tnet_stun_attr_type_ice_priority:
- case tnet_stun_attr_type_ice_controlled:
- case tnet_stun_attr_type_ice_controlling:
- case tnet_stun_attr_type_connection_id:
- default: {
- tnet_stun_attr_vdata_t* p_attr;
- if (IS_VDATA_UINT16(Type) && Length == 2) {
- uint16_t u16 = tnet_ntohs_2(&pc_buff_ptr[4]);
- if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u16, 2, &p_attr))) {
- return ret;
- }
- }
- else if (IS_VDATA_UINT32(Type) && Length == 4) {
- uint32_t u32 = (uint32_t)tnet_ntohl_2(&pc_buff_ptr[4]);
- if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u32, 4, &p_attr))) {
- return ret;
- }
- }
- else if (IS_VDATA_UINT64(Type) && Length == 8) {
- uint64_t u64 = ((uint64_t)tnet_ntohl_2(&pc_buff_ptr[4])) << 32;
- u64 |= tnet_ntohl_2(&pc_buff_ptr[8]);
- if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u64, 8, &p_attr))) {
- return ret;
- }
- }
- else if (Type == tnet_stun_attr_type_unknown_attrs && Length && !(Length & 1)) {
- uint16_t u;
- uint8_t *_p_data_ptr = tsk_malloc(Length);
- if (!_p_data_ptr) {
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", Length);
- return -4;
- }
- memcpy(_p_data_ptr, &pc_buff_ptr[4], Length);
- for (u = 0; u < Length; u += 2) {
- *((uint16_t*)&_p_data_ptr[u]) = tnet_htons_2(&_p_data_ptr[u]);
- }
- if ((ret = tnet_stun_attr_vdata_create(Type, _p_data_ptr, Length, &p_attr))) {
- TSK_FREE(_p_data_ptr);
- return ret;
- }
- TSK_FREE(_p_data_ptr);
- }
- else {
- if ((ret = tnet_stun_attr_vdata_create(Type, &pc_buff_ptr[4], Length, &p_attr))) {
- return ret;
- }
- }
- *pp_attr = TNET_STUN_ATTR(p_attr);
- break;
- }
- }
- return ret;
+ tnet_stun_attr_type_t Type;
+ uint16_t Length, PadLength;
+ int ret = -1;
+ static const void* kNullBuffPtr = tsk_null;
+ if (!pc_buff_ptr || !n_buff_size || !pp_attr || !p_consumed_octets) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (n_buff_size < kStunAttrHdrSizeInOctets) {
+ TSK_DEBUG_ERROR("Buffer too short(%u)", (unsigned)n_buff_size);
+ return -2;
+ }
+
+ Type = tnet_ntohs_2(&pc_buff_ptr[0]);
+ Length = tnet_ntohs_2(&pc_buff_ptr[2]);
+ if (Length > n_buff_size) {
+ TSK_DEBUG_ERROR("Buffer too short(%u). Length=%u", (unsigned)n_buff_size, (unsigned)Length);
+ return -3;
+ }
+
+ PadLength = (Length & 0x03) ? (4 - (Length & 0x03)) : 0;
+
+ *pp_attr = tsk_null;
+ *p_consumed_octets = kStunAttrHdrSizeInOctets + Length + PadLength;
+
+ switch (Type) {
+ case tnet_stun_attr_type_mapped_address:
+ case tnet_stun_attr_type_alternate_server:
+ case tnet_stun_attr_type_xor_mapped_address:
+ case tnet_stun_attr_type_xor_peer_address:
+ case tnet_stun_attr_type_xor_relayed_address: {
+ // First 8bits must be ignored
+ tnet_stun_address_family_t e_family = pc_buff_ptr[5];
+ uint16_t u_port = tnet_ntohs_2(&pc_buff_ptr[6]);
+ tnet_stun_attr_address_t* p_attr;
+ tsk_bool_t b_xor = IS_ADDRESS_XOR(Type);
+ uint16_t u, u_addr_size = (e_family == tnet_stun_address_family_ipv6) ? 16 : 4;
+
+ if (b_xor) {
+ u_port ^= kStunMagicCookieShort;
+ }
+ if ((ret = tnet_stun_attr_address_create(Type, e_family, u_port, (const tnet_stun_addr_t*)kNullBuffPtr, &p_attr))) {
+ return ret;
+ }
+ if (b_xor) {
+ *((uint32_t*)&p_attr->address[0]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8]) ^ kStunMagicCookieLong);
+ for (u = 4; u < u_addr_size; u += 4) {
+ if (pc_transac_id) {
+ *((uint32_t*)&p_attr->address[u]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8 + u]) ^ tnet_ntohl_2(((uint32_t*)(*pc_transac_id + u - 4))));
+ }
+ else {
+ *((uint32_t*)&p_attr->address[u]) = (uint32_t)tnet_htonl(tnet_ntohl_2(&pc_buff_ptr[8 + u]) ^ 0);
+ }
+ }
+ }
+ else {
+ memcpy(p_attr->address, &pc_buff_ptr[8], u_addr_size);
+ }
+ *pp_attr = TNET_STUN_ATTR(p_attr);
+ break;
+ }
+
+ case tnet_stun_attr_type_error_code: {
+ // First 21bits must be ignored
+ uint8_t Class = pc_buff_ptr[6] & 0x07;
+ uint8_t Number = pc_buff_ptr[7] & 0xff;
+ tnet_stun_attr_error_code_t* p_attr;
+ if ((ret = tnet_stun_attr_error_code_create(Class, Number, &pc_buff_ptr[8], (Length - 4), &p_attr))) {
+ return ret;
+ }
+ *pp_attr = TNET_STUN_ATTR(p_attr);
+ break;
+ }
+
+ case tnet_stun_attr_type_data:
+ case tnet_stun_attr_type_unknown_attrs:
+ case tnet_stun_attr_type_dont_fragment:
+ case tnet_stun_attr_type_software:
+ case tnet_stun_attr_type_nonce:
+ case tnet_stun_attr_type_realm:
+ case tnet_stun_attr_type_username:
+ case tnet_stun_attr_type_password:
+ case tnet_stun_attr_type_channel_number:
+ case tnet_stun_attr_type_message_integrity:
+ case tnet_stun_attr_type_fingerprint:
+ case tnet_stun_attr_type_lifetime:
+ case tnet_stun_attr_type_requested_transport:
+ case tnet_stun_attr_type_ice_use_candidate:
+ case tnet_stun_attr_type_ice_priority:
+ case tnet_stun_attr_type_ice_controlled:
+ case tnet_stun_attr_type_ice_controlling:
+ case tnet_stun_attr_type_connection_id:
+ default: {
+ tnet_stun_attr_vdata_t* p_attr;
+ if (IS_VDATA_UINT16(Type) && Length == 2) {
+ uint16_t u16 = tnet_ntohs_2(&pc_buff_ptr[4]);
+ if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u16, 2, &p_attr))) {
+ return ret;
+ }
+ }
+ else if (IS_VDATA_UINT32(Type) && Length == 4) {
+ uint32_t u32 = (uint32_t)tnet_ntohl_2(&pc_buff_ptr[4]);
+ if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u32, 4, &p_attr))) {
+ return ret;
+ }
+ }
+ else if (IS_VDATA_UINT64(Type) && Length == 8) {
+ uint64_t u64 = ((uint64_t)tnet_ntohl_2(&pc_buff_ptr[4])) << 32;
+ u64 |= tnet_ntohl_2(&pc_buff_ptr[8]);
+ if ((ret = tnet_stun_attr_vdata_create(Type, (uint8_t*)&u64, 8, &p_attr))) {
+ return ret;
+ }
+ }
+ else if (Type == tnet_stun_attr_type_unknown_attrs && Length && !(Length & 1)) {
+ uint16_t u;
+ uint8_t *_p_data_ptr = tsk_malloc(Length);
+ if (!_p_data_ptr) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", Length);
+ return -4;
+ }
+ memcpy(_p_data_ptr, &pc_buff_ptr[4], Length);
+ for (u = 0; u < Length; u += 2) {
+ *((uint16_t*)&_p_data_ptr[u]) = tnet_htons_2(&_p_data_ptr[u]);
+ }
+ if ((ret = tnet_stun_attr_vdata_create(Type, _p_data_ptr, Length, &p_attr))) {
+ TSK_FREE(_p_data_ptr);
+ return ret;
+ }
+ TSK_FREE(_p_data_ptr);
+ }
+ else {
+ if ((ret = tnet_stun_attr_vdata_create(Type, &pc_buff_ptr[4], Length, &p_attr))) {
+ return ret;
+ }
+ }
+ *pp_attr = TNET_STUN_ATTR(p_attr);
+ break;
+ }
+ }
+ return ret;
}
// ============== VDATA (USERNAME, MESSAGE-INTEGRITY, ...) ================ //
int tnet_stun_attr_vdata_create(tnet_stun_attr_type_t e_type, const uint8_t* pc_data_ptr, uint16_t u_data_size, tnet_stun_attr_vdata_t** pp_attr)
{
- int ret = -1;
- uint16_t u_length = pc_data_ptr ? u_data_size : 0;
- tnet_stun_attr_vdata_t* p_attr = tsk_null;
- extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
- if (!pp_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!(p_attr = tsk_object_new(tnet_stun_attr_vdata_def_t))) {
- ret = -2;
- goto bail;
- }
- if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), e_type, u_length))) {
- goto bail;
- }
- if (u_length) {
- if (!(p_attr->p_data_ptr = tsk_malloc(u_length + 1))) {
- ret = -3;
- goto bail;
- }
- memcpy(p_attr->p_data_ptr, pc_data_ptr, u_length);
- p_attr->u_data_size = u_length;
- p_attr->p_data_ptr[u_length] = '\0';
- }
- *pp_attr = p_attr;
+ int ret = -1;
+ uint16_t u_length = pc_data_ptr ? u_data_size : 0;
+ tnet_stun_attr_vdata_t* p_attr = tsk_null;
+ extern const tsk_object_def_t *tnet_stun_attr_vdata_def_t;
+ if (!pp_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!(p_attr = tsk_object_new(tnet_stun_attr_vdata_def_t))) {
+ ret = -2;
+ goto bail;
+ }
+ if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), e_type, u_length))) {
+ goto bail;
+ }
+ if (u_length) {
+ if (!(p_attr->p_data_ptr = tsk_malloc(u_length + 1))) {
+ ret = -3;
+ goto bail;
+ }
+ memcpy(p_attr->p_data_ptr, pc_data_ptr, u_length);
+ p_attr->u_data_size = u_length;
+ p_attr->p_data_ptr[u_length] = '\0';
+ }
+ *pp_attr = p_attr;
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ }
+ return ret;
}
int tnet_stun_attr_vdata_update(tnet_stun_attr_vdata_t* p_self, const uint8_t* pc_data_ptr, uint16_t u_data_size)
{
- uint16_t _u_data_size = (pc_data_ptr && u_data_size) ? u_data_size : 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (_u_data_size) {
- if (!(p_self->p_data_ptr = tsk_realloc(p_self->p_data_ptr, _u_data_size + 1))) {
- p_self->u_data_size = 0;
- ((tnet_stun_attr_t*)p_self)->hdr.u_length = 0;
- return -3;
- }
- memcpy(p_self->p_data_ptr, pc_data_ptr, _u_data_size);
- p_self->p_data_ptr[_u_data_size] = '\0';
- }
- else {
- TSK_FREE(p_self->p_data_ptr);
- }
- p_self->u_data_size = _u_data_size;
- ((tnet_stun_attr_t*)p_self)->hdr.u_length = p_self->u_data_size;
- return 0;
+ uint16_t _u_data_size = (pc_data_ptr && u_data_size) ? u_data_size : 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (_u_data_size) {
+ if (!(p_self->p_data_ptr = tsk_realloc(p_self->p_data_ptr, _u_data_size + 1))) {
+ p_self->u_data_size = 0;
+ ((tnet_stun_attr_t*)p_self)->hdr.u_length = 0;
+ return -3;
+ }
+ memcpy(p_self->p_data_ptr, pc_data_ptr, _u_data_size);
+ p_self->p_data_ptr[_u_data_size] = '\0';
+ }
+ else {
+ TSK_FREE(p_self->p_data_ptr);
+ }
+ p_self->u_data_size = _u_data_size;
+ ((tnet_stun_attr_t*)p_self)->hdr.u_length = p_self->u_data_size;
+ return 0;
}
static tsk_object_t* tnet_stun_attr_vdata_ctor(tsk_object_t * self, va_list * app)
{
- tnet_stun_attr_vdata_t *p_vdata = (tnet_stun_attr_vdata_t *)self;
- if (p_vdata) {
- }
- return self;
+ tnet_stun_attr_vdata_t *p_vdata = (tnet_stun_attr_vdata_t *)self;
+ if (p_vdata) {
+ }
+ return self;
}
static tsk_object_t* tnet_stun_attr_vdata_dtor(tsk_object_t * self)
{
- tnet_stun_attr_vdata_t *p_vdata = (tnet_stun_attr_vdata_t *)self;
- if (p_vdata) {
+ tnet_stun_attr_vdata_t *p_vdata = (tnet_stun_attr_vdata_t *)self;
+ if (p_vdata) {
#if PRINT_DESTROYED_MSG
- TSK_DEBUG_INFO("*** STUN Attribute(VDATA) destroyed ***");
+ TSK_DEBUG_INFO("*** STUN Attribute(VDATA) destroyed ***");
#endif
- TSK_FREE(p_vdata->p_data_ptr);
- }
- return self;
+ TSK_FREE(p_vdata->p_data_ptr);
+ }
+ return self;
}
static const tsk_object_def_t tnet_stun_attr_vdata_def_s = {
- sizeof(tnet_stun_attr_vdata_t),
- tnet_stun_attr_vdata_ctor,
- tnet_stun_attr_vdata_dtor,
- _tnet_stun_attr_cmp,
+ sizeof(tnet_stun_attr_vdata_t),
+ tnet_stun_attr_vdata_ctor,
+ tnet_stun_attr_vdata_dtor,
+ _tnet_stun_attr_cmp,
};
const tsk_object_def_t *tnet_stun_attr_vdata_def_t = &tnet_stun_attr_vdata_def_s;
@@ -533,57 +533,57 @@ const tsk_object_def_t *tnet_stun_attr_vdata_def_t = &tnet_stun_attr_vdata_def_s
// ============== ADDRESS ================ //
int tnet_stun_attr_address_create(tnet_stun_attr_type_t e_type, tnet_stun_address_family_t e_family, uint16_t u_port, const tnet_stun_addr_t* pc_addr, tnet_stun_attr_address_t** pp_attr)
{
- int ret = -1;
- extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
- tnet_stun_attr_address_t* p_attr = tsk_null;
- uint16_t u_length = (e_family == tnet_stun_address_family_ipv6) ? 16 : 4;
- if (!pp_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(p_attr = tsk_object_new(tnet_stun_attr_address_def_t))) {
- ret = -2;
- goto bail;
- }
- if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), e_type, u_length))) {
- goto bail;
- }
- p_attr->e_family = e_family;
- p_attr->u_port = u_port;
- if (pc_addr) {
- memcpy(p_attr->address, *pc_addr, u_length);
- }
- *pp_attr = p_attr;
+ int ret = -1;
+ extern const tsk_object_def_t *tnet_stun_attr_address_def_t;
+ tnet_stun_attr_address_t* p_attr = tsk_null;
+ uint16_t u_length = (e_family == tnet_stun_address_family_ipv6) ? 16 : 4;
+ if (!pp_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(p_attr = tsk_object_new(tnet_stun_attr_address_def_t))) {
+ ret = -2;
+ goto bail;
+ }
+ if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), e_type, u_length))) {
+ goto bail;
+ }
+ p_attr->e_family = e_family;
+ p_attr->u_port = u_port;
+ if (pc_addr) {
+ memcpy(p_attr->address, *pc_addr, u_length);
+ }
+ *pp_attr = p_attr;
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ }
+ return ret;
}
static tsk_object_t* tnet_stun_attr_address_ctor(tsk_object_t * self, va_list * app)
{
- tnet_stun_attr_address_t *p_addr = (tnet_stun_attr_address_t *)self;
- if (p_addr) {
- }
- return self;
+ tnet_stun_attr_address_t *p_addr = (tnet_stun_attr_address_t *)self;
+ if (p_addr) {
+ }
+ return self;
}
static tsk_object_t* tnet_stun_attr_address_dtor(tsk_object_t * self)
{
- tnet_stun_attr_address_t *p_addr = (tnet_stun_attr_address_t *)self;
- if (p_addr) {
+ tnet_stun_attr_address_t *p_addr = (tnet_stun_attr_address_t *)self;
+ if (p_addr) {
#if PRINT_DESTROYED_MSG
- TSK_DEBUG_INFO("*** STUN Attribute(ADDRESS) destroyed ***");
+ TSK_DEBUG_INFO("*** STUN Attribute(ADDRESS) destroyed ***");
#endif
- }
- return self;
+ }
+ return self;
}
static const tsk_object_def_t tnet_stun_attr_address_def_s = {
- sizeof(tnet_stun_attr_address_t),
- tnet_stun_attr_address_ctor,
- tnet_stun_attr_address_dtor,
- _tnet_stun_attr_cmp,
+ sizeof(tnet_stun_attr_address_t),
+ tnet_stun_attr_address_ctor,
+ tnet_stun_attr_address_dtor,
+ _tnet_stun_attr_cmp,
};
const tsk_object_def_t *tnet_stun_attr_address_def_t = &tnet_stun_attr_address_def_s;
@@ -592,60 +592,60 @@ const tsk_object_def_t *tnet_stun_attr_address_def_t = &tnet_stun_attr_address_d
// ================ 15.6. ERROR-CODE ========== //
int tnet_stun_attr_error_code_create(uint8_t u_class, uint8_t u_number, const void* pc_reason_phrase, uint16_t u_reason_phrase, struct tnet_stun_attr_error_code_s** pp_attr)
{
- int ret = -1;
- extern const tsk_object_def_t *tnet_stun_attr_error_code_def_t;
- tnet_stun_attr_error_code_t* p_attr = tsk_null;
- uint16_t u_length = (uint16_t)(4 + tsk_strlen(pc_reason_phrase));
- if (!pp_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(p_attr = tsk_object_new(tnet_stun_attr_error_code_def_t))) {
- ret = -2;
- goto bail;
- }
- if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), tnet_stun_attr_type_error_code, u_length))) {
- goto bail;
- }
- p_attr->u_class = u_class;
- p_attr->u_number = u_number;
- if (pc_reason_phrase && u_reason_phrase) {
- if (!(p_attr->p_reason_phrase = tsk_strndup(pc_reason_phrase, u_reason_phrase))) {
- ret = -3;
- goto bail;
- }
- }
- *pp_attr = p_attr;
+ int ret = -1;
+ extern const tsk_object_def_t *tnet_stun_attr_error_code_def_t;
+ tnet_stun_attr_error_code_t* p_attr = tsk_null;
+ uint16_t u_length = (uint16_t)(4 + tsk_strlen(pc_reason_phrase));
+ if (!pp_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(p_attr = tsk_object_new(tnet_stun_attr_error_code_def_t))) {
+ ret = -2;
+ goto bail;
+ }
+ if ((ret = tnet_stun_attr_init(TNET_STUN_ATTR(p_attr), tnet_stun_attr_type_error_code, u_length))) {
+ goto bail;
+ }
+ p_attr->u_class = u_class;
+ p_attr->u_number = u_number;
+ if (pc_reason_phrase && u_reason_phrase) {
+ if (!(p_attr->p_reason_phrase = tsk_strndup(pc_reason_phrase, u_reason_phrase))) {
+ ret = -3;
+ goto bail;
+ }
+ }
+ *pp_attr = p_attr;
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ }
+ return ret;
}
static tsk_object_t* tnet_stun_attr_error_code_ctor(tsk_object_t * self, va_list * app)
{
- tnet_stun_attr_error_code_t *p_ec = (tnet_stun_attr_error_code_t *)self;
- if (p_ec) {
- }
- return self;
+ tnet_stun_attr_error_code_t *p_ec = (tnet_stun_attr_error_code_t *)self;
+ if (p_ec) {
+ }
+ return self;
}
static tsk_object_t* tnet_stun_attr_error_code_dtor(tsk_object_t * self)
{
- tnet_stun_attr_error_code_t *p_ec = (tnet_stun_attr_error_code_t *)self;
- if (p_ec) {
+ tnet_stun_attr_error_code_t *p_ec = (tnet_stun_attr_error_code_t *)self;
+ if (p_ec) {
#if PRINT_DESTROYED_MSG
- TSK_DEBUG_INFO("*** STUN Attribute(ERROR-CODE) destroyed ***");
+ TSK_DEBUG_INFO("*** STUN Attribute(ERROR-CODE) destroyed ***");
#endif
- TSK_FREE(p_ec->p_reason_phrase);
- }
- return self;
+ TSK_FREE(p_ec->p_reason_phrase);
+ }
+ return self;
}
static const tsk_object_def_t tnet_stun_attr_error_code_def_s = {
- sizeof(tnet_stun_attr_error_code_t),
- tnet_stun_attr_error_code_ctor,
- tnet_stun_attr_error_code_dtor,
- _tnet_stun_attr_cmp,
+ sizeof(tnet_stun_attr_error_code_t),
+ tnet_stun_attr_error_code_ctor,
+ tnet_stun_attr_error_code_dtor,
+ _tnet_stun_attr_cmp,
};
const tsk_object_def_t *tnet_stun_attr_error_code_def_t = &tnet_stun_attr_error_code_def_s;
diff --git a/tinyNET/src/stun/tnet_stun_pkt.c b/tinyNET/src/stun/tnet_stun_pkt.c
index e4d559d..a996897 100755
--- a/tinyNET/src/stun/tnet_stun_pkt.c
+++ b/tinyNET/src/stun/tnet_stun_pkt.c
@@ -36,716 +36,717 @@
int tnet_stun_pkt_create(tnet_stun_pkt_type_t e_type, uint16_t u_length, const tnet_stun_transac_id_t* pc_transac_id, tnet_stun_pkt_t** pp_attr)
{
- extern const tsk_object_def_t *tnet_stun_pkt_def_t;
- if (!pp_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(*pp_attr = tsk_object_new(tnet_stun_pkt_def_t))) {
- TSK_DEBUG_ERROR("Failed to create STUN pkt object");
- return -2;
- }
- if (!((*pp_attr)->p_list_attrs = tsk_list_create())) {
- TSK_OBJECT_SAFE_FREE(*pp_attr);
- return -3;
- }
- if (pc_transac_id) {
- memcpy((*pp_attr)->transac_id, *pc_transac_id, sizeof(tnet_stun_transac_id_t));
- }
- else {
- tnet_stun_utils_transac_id_rand(&(*pp_attr)->transac_id);
- }
- (*pp_attr)->e_type = e_type;
- (*pp_attr)->u_length = u_length;
- return 0;
+ extern const tsk_object_def_t *tnet_stun_pkt_def_t;
+ if (!pp_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(*pp_attr = tsk_object_new(tnet_stun_pkt_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create STUN pkt object");
+ return -2;
+ }
+ if (!((*pp_attr)->p_list_attrs = tsk_list_create())) {
+ TSK_OBJECT_SAFE_FREE(*pp_attr);
+ return -3;
+ }
+ if (pc_transac_id) {
+ memcpy((*pp_attr)->transac_id, *pc_transac_id, sizeof(tnet_stun_transac_id_t));
+ }
+ else {
+ tnet_stun_utils_transac_id_rand(&(*pp_attr)->transac_id);
+ }
+ (*pp_attr)->e_type = e_type;
+ (*pp_attr)->u_length = u_length;
+ return 0;
}
int tnet_stun_pkt_attr_add(tnet_stun_pkt_t* p_self, tnet_stun_attr_t** pp_attr)
{
- if (!p_self || !pp_attr || !*pp_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_push_back_data(p_self->p_list_attrs, (void**)pp_attr);
- return 0;
+ if (!p_self || !pp_attr || !*pp_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_push_back_data(p_self->p_list_attrs, (void**)pp_attr);
+ return 0;
}
int tnet_stun_pkt_attrs_add(tnet_stun_pkt_t* p_self, ...)
{
- va_list ap;
- int ret = 0;
- tnet_stun_pkt_attr_add_t e_add_attr;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- va_start(ap, p_self);
-
- while ((e_add_attr = va_arg(ap, tnet_stun_pkt_attr_add_t)) != tnet_stun_pkt_attr_add_null) {
- switch (e_add_attr) {
- case tnet_stun_pkt_attr_add_vdata: {
- // (enum tnet_stun_attr_type_e)(E_TYPE), (const uint8_t*)(P_DATA_PTR), (uint16_t)(U_DATA_SIZE)
- enum tnet_stun_attr_type_e E_TYPE = va_arg(ap, enum tnet_stun_attr_type_e);
- const uint8_t* P_DATA_PTR = va_arg(ap, const uint8_t*);
- uint16_t U_DATA_SIZE = tsk_va_arg_u16(ap);
- tnet_stun_attr_vdata_t *p_attr;
- if ((ret = tnet_stun_attr_vdata_create(E_TYPE, P_DATA_PTR, U_DATA_SIZE, &p_attr))) {
- goto bail;
- }
- if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- goto bail;
- }
- break;
- }
- case tnet_stun_pkt_attr_add_address: {
- // (enum tnet_stun_attr_type_e)(E_TYPE), (enum tnet_stun_address_family_e)(E_FAMILY), (uint16_t)(U_PORT), (const tnet_stun_addr_t*)PC_ADDR_PTR
- enum tnet_stun_attr_type_e E_TYPE = va_arg(ap, enum tnet_stun_attr_type_e);
- enum tnet_stun_address_family_e E_FAMILY = va_arg(ap, enum tnet_stun_address_family_e);
- uint16_t U_PORT = tsk_va_arg_u16(ap);
- const tnet_stun_addr_t* PC_ADDR_PTR = va_arg(ap, const tnet_stun_addr_t*);
- tnet_stun_attr_address_t *p_attr;
- if ((ret = tnet_stun_attr_address_create(E_TYPE, E_FAMILY, U_PORT, PC_ADDR_PTR, &p_attr))) {
- goto bail;
- }
- if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- goto bail;
- }
- break;
- }
- case tnet_stun_pkt_attr_add_error_code: {
- // (uint8_t)(U8_CLASS), (uint8_t)(U8_NUMBER), (const char*)(PC_REASON_STR)
- uint8_t U8_CLASS = tsk_va_arg_u8(ap);
- uint8_t U8_NUMBER = tsk_va_arg_u8(ap);
- const char* PC_REASON_STR = va_arg(ap, const char*);
- tnet_stun_attr_error_code_t *p_attr;
- if ((ret = tnet_stun_attr_error_code_create(U8_CLASS, U8_NUMBER, PC_REASON_STR, (uint16_t)tsk_strlen(PC_REASON_STR), &p_attr))) {
- goto bail;
- }
- if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- goto bail;
- }
- break;
- }
- case tnet_stun_pkt_attr_add_unknown_attrs: {
- // (...)
- tsk_buffer_t* p_buffer = tsk_buffer_create_null();
- tnet_stun_attr_vdata_t *p_attr;
- uint16_t u_16;
- if (!p_buffer) {
- TSK_DEBUG_ERROR("Failed to create buffer");
- ret = -4;
- goto bail;
- }
- while ((e_add_attr = va_arg(ap, tnet_stun_pkt_attr_add_t)) != tnet_stun_pkt_attr_add_null) {
- if (e_add_attr != tnet_stun_pkt_attr_add_unknown_attrs_val) {
- TSK_OBJECT_SAFE_FREE(p_buffer);
- TSK_DEBUG_ERROR("Arguments corrupted or invalid.");
- ret = -3;
- goto bail;
- }
- u_16 = tsk_va_arg_u16(ap);
- tsk_buffer_append(p_buffer, &u_16, 2);
- }
- if ((ret = tnet_stun_attr_vdata_create(tnet_stun_attr_type_unknown_attrs, p_buffer->data, (uint16_t)p_buffer->size, &p_attr))) {
- TSK_OBJECT_SAFE_FREE(p_buffer);
- goto bail;
- }
- TSK_OBJECT_SAFE_FREE(p_buffer);
- if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
- TSK_OBJECT_SAFE_FREE(p_attr);
- goto bail;
- }
- break;
- }
- default: {
- TSK_DEBUG_ERROR("Arguments corrupted or invalid.");
- ret = -2;
- goto bail;
- }
- }
- }
+ va_list ap;
+ int ret = 0;
+ tnet_stun_pkt_attr_add_t e_add_attr;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ va_start(ap, p_self);
+
+ while ((e_add_attr = va_arg(ap, tnet_stun_pkt_attr_add_t)) != tnet_stun_pkt_attr_add_null) {
+ switch (e_add_attr) {
+ case tnet_stun_pkt_attr_add_vdata: {
+ // (enum tnet_stun_attr_type_e)(E_TYPE), (const uint8_t*)(P_DATA_PTR), (uint16_t)(U_DATA_SIZE)
+ enum tnet_stun_attr_type_e E_TYPE = va_arg(ap, enum tnet_stun_attr_type_e);
+ const uint8_t* P_DATA_PTR = va_arg(ap, const uint8_t*);
+ uint16_t U_DATA_SIZE = tsk_va_arg_u16(ap);
+ tnet_stun_attr_vdata_t *p_attr;
+ if ((ret = tnet_stun_attr_vdata_create(E_TYPE, P_DATA_PTR, U_DATA_SIZE, &p_attr))) {
+ goto bail;
+ }
+ if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ goto bail;
+ }
+ break;
+ }
+ case tnet_stun_pkt_attr_add_address: {
+ // (enum tnet_stun_attr_type_e)(E_TYPE), (enum tnet_stun_address_family_e)(E_FAMILY), (uint16_t)(U_PORT), (const tnet_stun_addr_t*)PC_ADDR_PTR
+ enum tnet_stun_attr_type_e E_TYPE = va_arg(ap, enum tnet_stun_attr_type_e);
+ enum tnet_stun_address_family_e E_FAMILY = va_arg(ap, enum tnet_stun_address_family_e);
+ uint16_t U_PORT = tsk_va_arg_u16(ap);
+ const tnet_stun_addr_t* PC_ADDR_PTR = va_arg(ap, const tnet_stun_addr_t*);
+ tnet_stun_attr_address_t *p_attr;
+ if ((ret = tnet_stun_attr_address_create(E_TYPE, E_FAMILY, U_PORT, PC_ADDR_PTR, &p_attr))) {
+ goto bail;
+ }
+ if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ goto bail;
+ }
+ break;
+ }
+ case tnet_stun_pkt_attr_add_error_code: {
+ // (uint8_t)(U8_CLASS), (uint8_t)(U8_NUMBER), (const char*)(PC_REASON_STR)
+ uint8_t U8_CLASS = tsk_va_arg_u8(ap);
+ uint8_t U8_NUMBER = tsk_va_arg_u8(ap);
+ const char* PC_REASON_STR = va_arg(ap, const char*);
+ tnet_stun_attr_error_code_t *p_attr;
+ if ((ret = tnet_stun_attr_error_code_create(U8_CLASS, U8_NUMBER, PC_REASON_STR, (uint16_t)tsk_strlen(PC_REASON_STR), &p_attr))) {
+ goto bail;
+ }
+ if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ goto bail;
+ }
+ break;
+ }
+ case tnet_stun_pkt_attr_add_unknown_attrs: {
+ // (...)
+ tsk_buffer_t* p_buffer = tsk_buffer_create_null();
+ tnet_stun_attr_vdata_t *p_attr;
+ uint16_t u_16;
+ if (!p_buffer) {
+ TSK_DEBUG_ERROR("Failed to create buffer");
+ ret = -4;
+ goto bail;
+ }
+ while ((e_add_attr = va_arg(ap, tnet_stun_pkt_attr_add_t)) != tnet_stun_pkt_attr_add_null) {
+ if (e_add_attr != tnet_stun_pkt_attr_add_unknown_attrs_val) {
+ TSK_OBJECT_SAFE_FREE(p_buffer);
+ TSK_DEBUG_ERROR("Arguments corrupted or invalid.");
+ ret = -3;
+ goto bail;
+ }
+ u_16 = tsk_va_arg_u16(ap);
+ tsk_buffer_append(p_buffer, &u_16, 2);
+ }
+ if ((ret = tnet_stun_attr_vdata_create(tnet_stun_attr_type_unknown_attrs, p_buffer->data, (uint16_t)p_buffer->size, &p_attr))) {
+ TSK_OBJECT_SAFE_FREE(p_buffer);
+ goto bail;
+ }
+ TSK_OBJECT_SAFE_FREE(p_buffer);
+ if ((ret = tnet_stun_pkt_attr_add(p_self, (tnet_stun_attr_t**)&p_attr))) {
+ TSK_OBJECT_SAFE_FREE(p_attr);
+ goto bail;
+ }
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("Arguments corrupted or invalid.");
+ ret = -2;
+ goto bail;
+ }
+ }
+ }
bail:
- va_end(ap);
- return ret;
+ va_end(ap);
+ return ret;
}
int tnet_stun_pkt_attr_remove(struct tnet_stun_pkt_s* p_self, enum tnet_stun_attr_type_e e_type)
{
- tsk_list_item_t* pc_item;
- tnet_stun_attr_t* pc_attr;
- if (!p_self || !p_self->p_list_attrs) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_list_item_t* pc_item;
+ tnet_stun_attr_t* pc_attr;
+ if (!p_self || !p_self->p_list_attrs) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
again:
- tsk_list_foreach(pc_item, p_self->p_list_attrs) {
- if ((pc_attr = (tnet_stun_attr_t*)pc_item->data)) {
- if (pc_attr->hdr.e_type == e_type) {
- tsk_list_remove_item(p_self->p_list_attrs, pc_item);
- goto again;
- }
- }
- }
- return 0;
+ tsk_list_foreach(pc_item, p_self->p_list_attrs) {
+ if ((pc_attr = (tnet_stun_attr_t*)pc_item->data)) {
+ if (pc_attr->hdr.e_type == e_type) {
+ tsk_list_remove_item(p_self->p_list_attrs, pc_item);
+ goto again;
+ }
+ }
+ }
+ return 0;
}
int tnet_stun_pkt_attr_find(const tnet_stun_pkt_t* pc_self, tnet_stun_attr_type_t e_type, tsk_size_t u_index, const tnet_stun_attr_t** ppc_attr)
{
- const tsk_list_item_t* pc_item;
- const tnet_stun_attr_t* pc_attr;
- if (!pc_self || !ppc_attr) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_attr = tsk_null;
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
- if (pc_attr->hdr.e_type == e_type && !u_index--) {
- *ppc_attr = pc_attr;
- break;
- }
- }
- }
- return 0;
+ const tsk_list_item_t* pc_item;
+ const tnet_stun_attr_t* pc_attr;
+ if (!pc_self || !ppc_attr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_attr = tsk_null;
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
+ if (pc_attr->hdr.e_type == e_type && !u_index--) {
+ *ppc_attr = pc_attr;
+ break;
+ }
+ }
+ }
+ return 0;
}
tsk_bool_t tnet_stun_pkt_attr_exists(const tnet_stun_pkt_t* pc_self, tnet_stun_attr_type_t e_type)
{
- const tnet_stun_attr_t* pc_attr;
- int ret = tnet_stun_pkt_attr_find(pc_self, e_type, 0, &pc_attr);
- return (pc_attr && (ret == 0));
+ const tnet_stun_attr_t* pc_attr;
+ int ret = tnet_stun_pkt_attr_find(pc_self, e_type, 0, &pc_attr);
+ return (pc_attr && (ret == 0));
}
int tnet_stun_pkt_get_size_in_octetunits_without_padding(const tnet_stun_pkt_t* pc_self, tsk_size_t* p_size)
{
- const tsk_list_item_t* pc_item;
- const tnet_stun_attr_t* pc_attr;
- tsk_size_t n_size;
- int ret;
- if (!pc_self || !p_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *p_size = kStunPktHdrSizeInOctets;
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
- if ((ret = tnet_stun_attr_get_size_in_octetunits_without_padding(pc_attr, &n_size))) {
- return ret;
- }
- *p_size += n_size;
- }
- }
- if (pc_self->opt.fingerprint) {
- *p_size += kStunAttrHdrSizeInOctets + 4;
- }
- if (pc_self->opt.dontfrag) {
- *p_size += kStunAttrHdrSizeInOctets;
- }
- return 0;
+ const tsk_list_item_t* pc_item;
+ const tnet_stun_attr_t* pc_attr;
+ tsk_size_t n_size;
+ int ret;
+ if (!pc_self || !p_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *p_size = kStunPktHdrSizeInOctets;
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
+ if ((ret = tnet_stun_attr_get_size_in_octetunits_without_padding(pc_attr, &n_size))) {
+ return ret;
+ }
+ *p_size += n_size;
+ }
+ }
+ if (pc_self->opt.fingerprint) {
+ *p_size += kStunAttrHdrSizeInOctets + 4;
+ }
+ if (pc_self->opt.dontfrag) {
+ *p_size += kStunAttrHdrSizeInOctets;
+ }
+ return 0;
}
int tnet_stun_pkt_get_size_in_octetunits_with_padding(const tnet_stun_pkt_t* pc_self, tsk_size_t* p_size)
{
- const tsk_list_item_t* pc_item;
- const tnet_stun_attr_t* pc_attr;
- tsk_size_t n_size;
- int ret;
- if (!pc_self || !p_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *p_size = kStunPktHdrSizeInOctets;
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
- if ((ret = tnet_stun_attr_get_size_in_octetunits_with_padding(pc_attr, &n_size))) {
- return ret;
- }
- *p_size += n_size;
- }
- }
- if (pc_self->opt.fingerprint) {
- *p_size += kStunAttrHdrSizeInOctets + 4;
- }
- if (pc_self->opt.dontfrag) {
- *p_size += kStunAttrHdrSizeInOctets;
- }
- return 0;
+ const tsk_list_item_t* pc_item;
+ const tnet_stun_attr_t* pc_attr;
+ tsk_size_t n_size;
+ int ret;
+ if (!pc_self || !p_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *p_size = kStunPktHdrSizeInOctets;
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
+ if ((ret = tnet_stun_attr_get_size_in_octetunits_with_padding(pc_attr, &n_size))) {
+ return ret;
+ }
+ *p_size += n_size;
+ }
+ }
+ if (pc_self->opt.fingerprint) {
+ *p_size += kStunAttrHdrSizeInOctets + 4;
+ }
+ if (pc_self->opt.dontfrag) {
+ *p_size += kStunAttrHdrSizeInOctets;
+ }
+ return 0;
}
int tnet_stun_pkt_write_with_padding(const tnet_stun_pkt_t* pc_self, uint8_t* p_buff_ptr, tsk_size_t n_buff_size, tsk_size_t *p_written)
{
- const tsk_list_item_t* pc_item;
- const tnet_stun_attr_t* pc_attr;
- tsk_size_t n_size;
- int ret;
- uint8_t *_p_buff_ptr = p_buff_ptr, *_p_msg_int_start;
- if (!pc_self || !p_buff_ptr || !n_buff_size || !p_written) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_self, p_written))) {
- return ret;
- }
- if ((n_buff_size < *p_written)) {
- TSK_DEBUG_ERROR("Buffer too short: %u<%u", (unsigned)n_buff_size, (unsigned)*p_written);
- return -1;
- }
-
- // write header
- *((uint16_t*)&p_buff_ptr[0]) = tnet_htons((unsigned short)pc_self->e_type);
- *((uint32_t*)&p_buff_ptr[4]) = (uint32_t)tnet_htonl(kStunMagicCookie);
- memcpy(&p_buff_ptr[8], pc_self->transac_id, sizeof(pc_self->transac_id));
-
- p_buff_ptr += kStunPktHdrSizeInOctets;
- n_buff_size -= kStunPktHdrSizeInOctets;
-
- // write attributes
- tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
- if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
- if ((pc_attr->hdr.e_type == tnet_stun_attr_type_message_integrity)) {
- continue; // because 'MESSAGE-INTEGRITY' must be the latest attribute
- }
- if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, p_buff_ptr, n_buff_size, &n_size))) {
- return ret;
- }
- p_buff_ptr += n_size;
- n_buff_size -= n_size;
- }
- }
-
- // DONT-FRAGMENT
- if (pc_self->opt.dontfrag && tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_dont_fragment, &pc_attr) == 0 && !pc_attr) {
- *((uint16_t*)&p_buff_ptr[0]) = tnet_htons(tnet_stun_attr_type_dont_fragment); // Type
- *((uint16_t*)&p_buff_ptr[2]) = 0; // Length
- p_buff_ptr += 4;
- }
-
- // MESSAGE-INTEGRITY
- if (!tsk_strnullORempty(pc_self->p_pwd) && tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_message_integrity, &pc_attr) == 0 && pc_attr) {
- /* RFC 5389 - 15.4. MESSAGE-INTEGRITY
- The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [RFC2104] of the STUN message.
-
- For long-term credentials ==> key = MD5(username ":" realm ":" SASLprep(password))
- For short-term credentials ==> key = SASLprep(password)
- */
-
- tsk_sha1digest_t hmac;
- const tnet_stun_attr_vdata_t *pc_attr_username = tsk_null, *pc_attr_realm = tsk_null, *pc_attr_nonce = tsk_null;
- static const uint16_t kMsgIntTotalLength = kStunAttrHdrSizeInOctets + TSK_SHA1_DIGEST_SIZE;
- _p_msg_int_start = p_buff_ptr;
-
- // write attribute
- if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, p_buff_ptr, n_buff_size, &n_size))) {
- return ret;
- }
- p_buff_ptr += n_size;
- n_buff_size -= n_size;
-
- // Length (must be correct before computing message integrity)
- *((uint16_t*)&_p_buff_ptr[2]) = tnet_htons((unsigned short)((p_buff_ptr - _p_buff_ptr) - kStunPktHdrSizeInOctets));
-
- if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_username, (const tnet_stun_attr_t**)&pc_attr_username))) {
- return ret;
- }
- if (pc_attr_username) {
- if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr_realm))) {
- return ret;
- }
- if (pc_attr_realm) {
- if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce))) {
- return ret;
- }
- }
- }
- if (pc_attr_username && pc_attr_realm && pc_attr_nonce) {
- // LONG-TERM
- char* p_keystr = tsk_null;
- tsk_md5digest_t md5;
- tsk_sprintf(&p_keystr, "%s:%s:%s", pc_attr_username->p_data_ptr, pc_attr_realm->p_data_ptr, pc_self->p_pwd);
- TSK_MD5_DIGEST_CALC(p_keystr, (tsk_size_t)tsk_strlen(p_keystr), md5);
- hmac_sha1digest_compute(_p_buff_ptr, (tsk_size_t)(_p_msg_int_start - _p_buff_ptr), (const char*)md5, TSK_MD5_DIGEST_SIZE, hmac);
- TSK_FREE(p_keystr);
- }
- else {
- // SHORT-TERM
- hmac_sha1digest_compute(_p_buff_ptr, (tsk_size_t)(_p_msg_int_start - _p_buff_ptr), pc_self->p_pwd, (tsk_size_t)tsk_strlen(pc_self->p_pwd), hmac);
- }
-
- // update MESSAGE-INTEGRITY attribute value
- if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, hmac, TSK_SHA1_DIGEST_SIZE))) {
- return ret;
- }
- if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, _p_msg_int_start, kMsgIntTotalLength, &n_size))) {
- return ret;
- }
- }
-
- // Length before computing FINGERPRINT
- *((uint16_t*)&_p_buff_ptr[2]) = tnet_htons((unsigned short)((p_buff_ptr - _p_buff_ptr) - kStunPktHdrSizeInOctets + ((pc_self->opt.fingerprint && (p_buff_ptr - _p_buff_ptr) >= 8) ? 8 : 0)));
-
- if (pc_self->opt.fingerprint && (p_buff_ptr - _p_buff_ptr) >= 8) {
- /* RFC 5389 - 15.5. FINGERPRINT
- The FINGERPRINT attribute MAY be present in all STUN messages. The
- value of the attribute is computed as the CRC-32 of the STUN message
- up to (but excluding) the FINGERPRINT attribute itself, XOR'ed with
- the 32-bit value 0x5354554e
- */
- uint32_t u_fingerprint = tsk_pppfcs32(TSK_PPPINITFCS32, _p_buff_ptr, (int32_t)(p_buff_ptr - _p_buff_ptr)) ^ kStunFingerprintXorConst;
- *((uint16_t*)&p_buff_ptr[0]) = tnet_htons(tnet_stun_attr_type_fingerprint); // Type
- *((uint16_t*)&p_buff_ptr[2]) = tnet_htons(4); // Length
- *((uint32_t*)&p_buff_ptr[4]) = (uint32_t)tnet_htonl(u_fingerprint);
- p_buff_ptr += 8;
- }
-
- *p_written = (tsk_size_t)(p_buff_ptr - _p_buff_ptr);
- return 0;
+ const tsk_list_item_t* pc_item;
+ const tnet_stun_attr_t* pc_attr;
+ tsk_size_t n_size;
+ int ret;
+ uint8_t *_p_buff_ptr = p_buff_ptr, *_p_msg_int_start;
+ if (!pc_self || !p_buff_ptr || !n_buff_size || !p_written) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_self, p_written))) {
+ return ret;
+ }
+ if ((n_buff_size < *p_written)) {
+ TSK_DEBUG_ERROR("Buffer too short: %u<%u", (unsigned)n_buff_size, (unsigned)*p_written);
+ return -1;
+ }
+
+ // write header
+ *((uint16_t*)&p_buff_ptr[0]) = tnet_htons((unsigned short)pc_self->e_type);
+ *((uint32_t*)&p_buff_ptr[4]) = (uint32_t)tnet_htonl(kStunMagicCookie);
+ memcpy(&p_buff_ptr[8], pc_self->transac_id, sizeof(pc_self->transac_id));
+
+ p_buff_ptr += kStunPktHdrSizeInOctets;
+ n_buff_size -= kStunPktHdrSizeInOctets;
+
+ // write attributes
+ tsk_list_foreach(pc_item, pc_self->p_list_attrs) {
+ if ((pc_attr = (const tnet_stun_attr_t*)pc_item->data)) {
+ if ((pc_attr->hdr.e_type == tnet_stun_attr_type_message_integrity)) {
+ continue; // because 'MESSAGE-INTEGRITY' must be the latest attribute
+ }
+ if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, p_buff_ptr, n_buff_size, &n_size))) {
+ return ret;
+ }
+ p_buff_ptr += n_size;
+ n_buff_size -= n_size;
+ }
+ }
+
+ // DONT-FRAGMENT
+ if (pc_self->opt.dontfrag && tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_dont_fragment, &pc_attr) == 0 && !pc_attr) {
+ *((uint16_t*)&p_buff_ptr[0]) = tnet_htons(tnet_stun_attr_type_dont_fragment); // Type
+ *((uint16_t*)&p_buff_ptr[2]) = 0; // Length
+ p_buff_ptr += 4;
+ }
+
+ // MESSAGE-INTEGRITY
+ if (!tsk_strnullORempty(pc_self->p_pwd) && tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_message_integrity, &pc_attr) == 0 && pc_attr) {
+ /* RFC 5389 - 15.4. MESSAGE-INTEGRITY
+ The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [RFC2104] of the STUN message.
+
+ For long-term credentials ==> key = MD5(username ":" realm ":" SASLprep(password))
+ For short-term credentials ==> key = SASLprep(password)
+ */
+
+ tsk_sha1digest_t hmac;
+ const tnet_stun_attr_vdata_t *pc_attr_username = tsk_null, *pc_attr_realm = tsk_null, *pc_attr_nonce = tsk_null;
+ static const uint16_t kMsgIntTotalLength = kStunAttrHdrSizeInOctets + TSK_SHA1_DIGEST_SIZE;
+ _p_msg_int_start = p_buff_ptr;
+
+ // write attribute
+ if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, p_buff_ptr, n_buff_size, &n_size))) {
+ return ret;
+ }
+ p_buff_ptr += n_size;
+ n_buff_size -= n_size;
+
+ // Length (must be correct before computing message integrity)
+ *((uint16_t*)&_p_buff_ptr[2]) = tnet_htons((unsigned short)((p_buff_ptr - _p_buff_ptr) - kStunPktHdrSizeInOctets));
+
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_username, (const tnet_stun_attr_t**)&pc_attr_username))) {
+ return ret;
+ }
+ if (pc_attr_username) {
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr_realm))) {
+ return ret;
+ }
+ if (pc_attr_realm) {
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce))) {
+ return ret;
+ }
+ }
+ }
+ if (pc_attr_username && pc_attr_realm && pc_attr_nonce) {
+ // LONG-TERM
+ char* p_keystr = tsk_null;
+ tsk_md5digest_t md5;
+ tsk_sprintf(&p_keystr, "%s:%s:%s", pc_attr_username->p_data_ptr, pc_attr_realm->p_data_ptr, pc_self->p_pwd);
+ TSK_MD5_DIGEST_CALC(p_keystr, (tsk_size_t)tsk_strlen(p_keystr), md5);
+ hmac_sha1digest_compute(_p_buff_ptr, (tsk_size_t)(_p_msg_int_start - _p_buff_ptr), (const char*)md5, TSK_MD5_DIGEST_SIZE, hmac);
+ TSK_FREE(p_keystr);
+ }
+ else {
+ // SHORT-TERM
+ hmac_sha1digest_compute(_p_buff_ptr, (tsk_size_t)(_p_msg_int_start - _p_buff_ptr), pc_self->p_pwd, (tsk_size_t)tsk_strlen(pc_self->p_pwd), hmac);
+ }
+
+ // update MESSAGE-INTEGRITY attribute value
+ if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, hmac, TSK_SHA1_DIGEST_SIZE))) {
+ return ret;
+ }
+ if ((ret = tnet_stun_attr_write_with_padding(&pc_self->transac_id, pc_attr, _p_msg_int_start, kMsgIntTotalLength, &n_size))) {
+ return ret;
+ }
+ }
+
+ // Length before computing FINGERPRINT
+ *((uint16_t*)&_p_buff_ptr[2]) = tnet_htons((unsigned short)((p_buff_ptr - _p_buff_ptr) - kStunPktHdrSizeInOctets + ((pc_self->opt.fingerprint && (p_buff_ptr - _p_buff_ptr) >= 8) ? 8 : 0)));
+
+ if (pc_self->opt.fingerprint && (p_buff_ptr - _p_buff_ptr) >= 8) {
+ /* RFC 5389 - 15.5. FINGERPRINT
+ The FINGERPRINT attribute MAY be present in all STUN messages. The
+ value of the attribute is computed as the CRC-32 of the STUN message
+ up to (but excluding) the FINGERPRINT attribute itself, XOR'ed with
+ the 32-bit value 0x5354554e
+ */
+ uint32_t u_fingerprint = tsk_pppfcs32(TSK_PPPINITFCS32, _p_buff_ptr, (int32_t)(p_buff_ptr - _p_buff_ptr)) ^ kStunFingerprintXorConst;
+ *((uint16_t*)&p_buff_ptr[0]) = tnet_htons(tnet_stun_attr_type_fingerprint); // Type
+ *((uint16_t*)&p_buff_ptr[2]) = tnet_htons(4); // Length
+ *((uint32_t*)&p_buff_ptr[4]) = (uint32_t)tnet_htonl(u_fingerprint);
+ p_buff_ptr += 8;
+ }
+
+ *p_written = (tsk_size_t)(p_buff_ptr - _p_buff_ptr);
+ return 0;
}
int tnet_stun_pkt_write_with_padding_2(const struct tnet_stun_pkt_s* pc_self, struct tsk_buffer_s** pp_buff)
{
- tsk_size_t u_buff_size;
- int ret;
- if (!pc_self || !pp_buff) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *pp_buff = tsk_null;
- if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_self, &u_buff_size))) {
- goto bail;
- }
- u_buff_size += kStunBuffMinPad;
- if (!(*pp_buff = tsk_buffer_create(tsk_null, u_buff_size))) {
- goto bail;
- }
- if ((ret = tnet_stun_pkt_write_with_padding(pc_self, (*pp_buff)->data, (*pp_buff)->size, &(*pp_buff)->size))) {
- goto bail;
- }
+ tsk_size_t u_buff_size;
+ int ret;
+ if (!pc_self || !pp_buff) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *pp_buff = tsk_null;
+ if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_self, &u_buff_size))) {
+ goto bail;
+ }
+ u_buff_size += kStunBuffMinPad;
+ if (!(*pp_buff = tsk_buffer_create(tsk_null, u_buff_size))) {
+ goto bail;
+ }
+ if ((ret = tnet_stun_pkt_write_with_padding(pc_self, (*pp_buff)->data, (*pp_buff)->size, &(*pp_buff)->size))) {
+ goto bail;
+ }
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE(*pp_buff);
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE(*pp_buff);
+ }
+ return ret;
}
int tnet_stun_pkt_is_complete(const uint8_t* pc_buff_ptr, tsk_size_t n_buff_size, tsk_bool_t *pb_is_complete)
{
- if (!pb_is_complete) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *pb_is_complete = tsk_false;
- if (pc_buff_ptr && n_buff_size >= kStunPktHdrSizeInOctets) {
- tsk_size_t n_paylen_in_octets = tnet_ntohs_2(&pc_buff_ptr[2]);
- *pb_is_complete = ((n_buff_size - kStunPktHdrSizeInOctets) >= n_paylen_in_octets);
- }
- return 0;
+ if (!pb_is_complete) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *pb_is_complete = tsk_false;
+ if (pc_buff_ptr && n_buff_size >= kStunPktHdrSizeInOctets) {
+ tsk_size_t n_paylen_in_octets = tnet_ntohs_2(&pc_buff_ptr[2]);
+ *pb_is_complete = ((n_buff_size - kStunPktHdrSizeInOctets) >= n_paylen_in_octets);
+ }
+ return 0;
}
int tnet_stun_pkt_read(const uint8_t* pc_buff_ptr, tsk_size_t n_buff_size, tnet_stun_pkt_t** pp_pkt)
{
- tsk_bool_t b_is_complete;
- uint16_t PayloadLengthInOctets;
- tnet_stun_pkt_type_t Type;
- tnet_stun_transac_id_t transac_id;
- uint32_t MagicCookie;
- int ret;
-
- if (!pc_buff_ptr || !n_buff_size || !pp_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!TNET_STUN_BUFF_IS_STUN2(pc_buff_ptr, n_buff_size)) {
- TSK_DEBUG_ERROR("Buffer doesn't contain a valid STUN2 pkt");
- return -2;
- }
- if ((ret = tnet_stun_pkt_is_complete(pc_buff_ptr, n_buff_size, &b_is_complete))) {
- return ret;
- }
- if (!b_is_complete) {
- TSK_DEBUG_ERROR("Buffer too short(%u)", (unsigned)n_buff_size);
- return -3;
- }
-
- // read the header
- Type = tnet_ntohs_2(&pc_buff_ptr[0]);
- PayloadLengthInOctets = tnet_ntohs_2(&pc_buff_ptr[2]);
- MagicCookie = (uint32_t)tnet_ntohl_2(&pc_buff_ptr[4]);
- if (MagicCookie != kStunMagicCookieLong) {
- TSK_DEBUG_ERROR("%x not a valid STUN2 magic cookie", MagicCookie);
- return -4;
- }
- memcpy(transac_id, &pc_buff_ptr[8], sizeof(tnet_stun_transac_id_t));
- // create the pkt
- if ((ret = tnet_stun_pkt_create(Type, PayloadLengthInOctets, (const tnet_stun_transac_id_t*)&transac_id, pp_pkt))) {
- return ret;
- }
-
- if (PayloadLengthInOctets > 0) {
- tnet_stun_attr_t* p_attr;
- tsk_size_t n_consumed_octets;
- pc_buff_ptr += kStunPktHdrSizeInOctets;
- do {
- if ((ret = tnet_stun_attr_read((const tnet_stun_transac_id_t*)&(*pp_pkt)->transac_id, pc_buff_ptr, PayloadLengthInOctets, &n_consumed_octets, &p_attr))) {
- return ret;
- }
- if ((ret = tnet_stun_pkt_attr_add((*pp_pkt), &p_attr))) {
- TSK_OBJECT_SAFE_FREE((*pp_pkt));
- return ret;
- }
- PayloadLengthInOctets -= (uint16_t)n_consumed_octets;
- pc_buff_ptr += n_consumed_octets;
- } while (PayloadLengthInOctets >= kStunAttrHdrSizeInOctets);
- }
-
- return 0;
+ tsk_bool_t b_is_complete;
+ uint16_t PayloadLengthInOctets;
+ tnet_stun_pkt_type_t Type;
+ tnet_stun_transac_id_t transac_id;
+ uint32_t MagicCookie;
+ int ret;
+
+ if (!pc_buff_ptr || !n_buff_size || !pp_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!TNET_STUN_BUFF_IS_STUN2(pc_buff_ptr, n_buff_size)) {
+ TSK_DEBUG_ERROR("Buffer doesn't contain a valid STUN2 pkt");
+ return -2;
+ }
+ if ((ret = tnet_stun_pkt_is_complete(pc_buff_ptr, n_buff_size, &b_is_complete))) {
+ return ret;
+ }
+ if (!b_is_complete) {
+ TSK_DEBUG_ERROR("Buffer too short(%u)", (unsigned)n_buff_size);
+ return -3;
+ }
+
+ // read the header
+ Type = tnet_ntohs_2(&pc_buff_ptr[0]);
+ PayloadLengthInOctets = tnet_ntohs_2(&pc_buff_ptr[2]);
+ MagicCookie = (uint32_t)tnet_ntohl_2(&pc_buff_ptr[4]);
+ if (MagicCookie != kStunMagicCookieLong) {
+ TSK_DEBUG_ERROR("%x not a valid STUN2 magic cookie", MagicCookie);
+ return -4;
+ }
+ memcpy(transac_id, &pc_buff_ptr[8], sizeof(tnet_stun_transac_id_t));
+ // create the pkt
+ if ((ret = tnet_stun_pkt_create(Type, PayloadLengthInOctets, (const tnet_stun_transac_id_t*)&transac_id, pp_pkt))) {
+ return ret;
+ }
+
+ if (PayloadLengthInOctets > 0) {
+ tnet_stun_attr_t* p_attr;
+ tsk_size_t n_consumed_octets;
+ pc_buff_ptr += kStunPktHdrSizeInOctets;
+ do {
+ if ((ret = tnet_stun_attr_read((const tnet_stun_transac_id_t*)&(*pp_pkt)->transac_id, pc_buff_ptr, PayloadLengthInOctets, &n_consumed_octets, &p_attr))) {
+ return ret;
+ }
+ if ((ret = tnet_stun_pkt_attr_add((*pp_pkt), &p_attr))) {
+ TSK_OBJECT_SAFE_FREE((*pp_pkt));
+ return ret;
+ }
+ PayloadLengthInOctets -= (uint16_t)n_consumed_octets;
+ pc_buff_ptr += n_consumed_octets;
+ }
+ while (PayloadLengthInOctets >= kStunAttrHdrSizeInOctets);
+ }
+
+ return 0;
}
int tnet_stun_pkt_auth_prepare(tnet_stun_pkt_t* p_self, const char* pc_usr_name, const char* pc_pwd, const char* pc_realm, const char* pc_nonce)
{
- const tnet_stun_attr_t* pc_attr;
- int ret;
- static const tsk_sha1digest_t __pc_sha1digestEmpty = { 0 };
- static const uint16_t __u_sha1digestEmpty = sizeof(__pc_sha1digestEmpty);
- if (!p_self /*|| !pc_usr_name*/ || !pc_pwd /*|| !pc_realm || !pc_nonce*/) { // "username", "realm" and "nonce" are null for short-term authentication
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // USERNAME
- if (pc_usr_name) { // LONG-TERM, optional for SHORT-TERM
- if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_username, &pc_attr))) {
- goto bail;
- }
- if (pc_attr) {
- if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_usr_name, (uint16_t)tsk_strlen(pc_usr_name)))) {
- goto bail;
- }
- }
- else {
- ret = tnet_stun_pkt_attrs_add(p_self,
- TNET_STUN_PKT_ATTR_ADD_USERNAME_ZT(pc_usr_name),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- }
- // REALM
- if (pc_realm) { // LONG-TERM
- if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_realm, &pc_attr))) {
- goto bail;
- }
- if (pc_attr) {
- if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_realm, (uint16_t)tsk_strlen(pc_realm)))) {
- goto bail;
- }
- }
- else {
- ret = tnet_stun_pkt_attrs_add(p_self,
- TNET_STUN_PKT_ATTR_ADD_REALM_ZT(pc_realm),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- }
- // NONCE
- if (pc_nonce) { // LONG-TERM
- if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_nonce, &pc_attr))) {
- goto bail;
- }
- if (pc_attr) {
- if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_nonce, (uint16_t)tsk_strlen(pc_nonce)))) {
- goto bail;
- }
- }
- else {
- ret = tnet_stun_pkt_attrs_add(p_self,
- TNET_STUN_PKT_ATTR_ADD_NONCE_ZT(pc_nonce),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- }
- // MESSAGE-INTEGRITY
- if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_message_integrity, &pc_attr))) {
- goto bail;
- }
- if (!pc_attr) {
- ret = tnet_stun_pkt_attrs_add(p_self,
- TNET_STUN_PKT_ATTR_ADD_MESSAGE_INTEGRITY(__pc_sha1digestEmpty, __u_sha1digestEmpty),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
-
- // PASSWORD
- tsk_strupdate(&p_self->p_pwd, pc_pwd);
+ const tnet_stun_attr_t* pc_attr;
+ int ret;
+ static const tsk_sha1digest_t __pc_sha1digestEmpty = { 0 };
+ static const uint16_t __u_sha1digestEmpty = sizeof(__pc_sha1digestEmpty);
+ if (!p_self /*|| !pc_usr_name*/ || !pc_pwd /*|| !pc_realm || !pc_nonce*/) { // "username", "realm" and "nonce" are null for short-term authentication
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // USERNAME
+ if (pc_usr_name) { // LONG-TERM, optional for SHORT-TERM
+ if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_username, &pc_attr))) {
+ goto bail;
+ }
+ if (pc_attr) {
+ if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_usr_name, (uint16_t)tsk_strlen(pc_usr_name)))) {
+ goto bail;
+ }
+ }
+ else {
+ ret = tnet_stun_pkt_attrs_add(p_self,
+ TNET_STUN_PKT_ATTR_ADD_USERNAME_ZT(pc_usr_name),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ }
+ // REALM
+ if (pc_realm) { // LONG-TERM
+ if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_realm, &pc_attr))) {
+ goto bail;
+ }
+ if (pc_attr) {
+ if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_realm, (uint16_t)tsk_strlen(pc_realm)))) {
+ goto bail;
+ }
+ }
+ else {
+ ret = tnet_stun_pkt_attrs_add(p_self,
+ TNET_STUN_PKT_ATTR_ADD_REALM_ZT(pc_realm),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ }
+ // NONCE
+ if (pc_nonce) { // LONG-TERM
+ if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_nonce, &pc_attr))) {
+ goto bail;
+ }
+ if (pc_attr) {
+ if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr, (const uint8_t*)pc_nonce, (uint16_t)tsk_strlen(pc_nonce)))) {
+ goto bail;
+ }
+ }
+ else {
+ ret = tnet_stun_pkt_attrs_add(p_self,
+ TNET_STUN_PKT_ATTR_ADD_NONCE_ZT(pc_nonce),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ }
+ // MESSAGE-INTEGRITY
+ if ((ret = tnet_stun_pkt_attr_find_first(p_self, tnet_stun_attr_type_message_integrity, &pc_attr))) {
+ goto bail;
+ }
+ if (!pc_attr) {
+ ret = tnet_stun_pkt_attrs_add(p_self,
+ TNET_STUN_PKT_ATTR_ADD_MESSAGE_INTEGRITY(__pc_sha1digestEmpty, __u_sha1digestEmpty),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+
+ // PASSWORD
+ tsk_strupdate(&p_self->p_pwd, pc_pwd);
bail:
- return ret;
+ return ret;
}
// pc_resp = 401 or 438
int tnet_stun_pkt_auth_prepare_2(struct tnet_stun_pkt_s* p_self, const char* pc_usr_name, const char* pc_pwd, const struct tnet_stun_pkt_s* pc_resp)
{
- const tnet_stun_attr_vdata_t* pc_attr;
- const char *pc_nonce, *pc_realm;
- int ret;
- if (!p_self || !pc_usr_name || !pc_pwd || !pc_resp) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // NONCE
- if ((ret = tnet_stun_pkt_attr_find_first(pc_resp, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr))) {
- goto bail;
- }
- if (!pc_attr || !pc_attr->p_data_ptr || !pc_attr->u_data_size) {
- TSK_DEBUG_ERROR("Invalid NONCE in 401");
- ret = -3;
- goto bail;
- }
- pc_nonce = (const char*)pc_attr->p_data_ptr;
- // REALM
- if ((ret = tnet_stun_pkt_attr_find_first(pc_resp, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr))) {
- goto bail;
- }
- if (!pc_attr || !pc_attr->p_data_ptr || !pc_attr->u_data_size) {
- TSK_DEBUG_ERROR("Invalid REALM in 401");
- ret = -3;
- goto bail;
- }
- pc_realm = (const char*)pc_attr->p_data_ptr;
-
- if ((ret = tnet_stun_pkt_auth_prepare(p_self, pc_usr_name, pc_pwd, pc_realm, pc_nonce))) {
- goto bail;
- }
-
- // TRANSACTION-ID
- if ((ret = tnet_stun_utils_transac_id_rand(&p_self->transac_id))) {
- goto bail;
- }
+ const tnet_stun_attr_vdata_t* pc_attr;
+ const char *pc_nonce, *pc_realm;
+ int ret;
+ if (!p_self || !pc_usr_name || !pc_pwd || !pc_resp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // NONCE
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_resp, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr))) {
+ goto bail;
+ }
+ if (!pc_attr || !pc_attr->p_data_ptr || !pc_attr->u_data_size) {
+ TSK_DEBUG_ERROR("Invalid NONCE in 401");
+ ret = -3;
+ goto bail;
+ }
+ pc_nonce = (const char*)pc_attr->p_data_ptr;
+ // REALM
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_resp, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr))) {
+ goto bail;
+ }
+ if (!pc_attr || !pc_attr->p_data_ptr || !pc_attr->u_data_size) {
+ TSK_DEBUG_ERROR("Invalid REALM in 401");
+ ret = -3;
+ goto bail;
+ }
+ pc_realm = (const char*)pc_attr->p_data_ptr;
+
+ if ((ret = tnet_stun_pkt_auth_prepare(p_self, pc_usr_name, pc_pwd, pc_realm, pc_nonce))) {
+ goto bail;
+ }
+
+ // TRANSACTION-ID
+ if ((ret = tnet_stun_utils_transac_id_rand(&p_self->transac_id))) {
+ goto bail;
+ }
bail:
- return ret;
+ return ret;
}
int tnet_stun_pkt_auth_copy(tnet_stun_pkt_t* p_self, const char* pc_usr_name, const char* pc_pwd, const tnet_stun_pkt_t* pc_pkt)
{
- const tnet_stun_attr_vdata_t *pc_attr_realm = tsk_null, *pc_attr_nonce = tsk_null;
- int ret;
- tsk_bool_t b_ok;
- if (!p_self || !pc_pwd || !pc_usr_name || !pc_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- b_ok =
- (ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr_realm)) == 0 && pc_attr_realm
- && (ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce)) == 0 && pc_attr_nonce;
-
- if (b_ok && (ret = tnet_stun_pkt_auth_prepare(p_self, pc_usr_name, pc_pwd, (const char*)pc_attr_realm->p_data_ptr, (const char*)pc_attr_nonce->p_data_ptr))) {
- goto bail;
- }
+ const tnet_stun_attr_vdata_t *pc_attr_realm = tsk_null, *pc_attr_nonce = tsk_null;
+ int ret;
+ tsk_bool_t b_ok;
+ if (!p_self || !pc_pwd || !pc_usr_name || !pc_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ b_ok =
+ (ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_realm, (const tnet_stun_attr_t**)&pc_attr_realm)) == 0 && pc_attr_realm
+ && (ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce)) == 0 && pc_attr_nonce;
+
+ if (b_ok && (ret = tnet_stun_pkt_auth_prepare(p_self, pc_usr_name, pc_pwd, (const char*)pc_attr_realm->p_data_ptr, (const char*)pc_attr_nonce->p_data_ptr))) {
+ goto bail;
+ }
bail:
- return ret;
+ return ret;
}
int tnet_stun_pkt_get_errorcode(const struct tnet_stun_pkt_s* pc_self, uint16_t* pu_code)
{
- const tnet_stun_attr_error_code_t* pc_attr;
- int ret;
- if (!pc_self && !pu_code) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *pu_code = 0;
- if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_error_code, (const tnet_stun_attr_t**)&pc_attr))) {
- return ret;
- }
- if (pc_attr) {
- *pu_code = (pc_attr->u_class * 100) + pc_attr->u_number;
- }
- return 0;
+ const tnet_stun_attr_error_code_t* pc_attr;
+ int ret;
+ if (!pc_self && !pu_code) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *pu_code = 0;
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_self, tnet_stun_attr_type_error_code, (const tnet_stun_attr_t**)&pc_attr))) {
+ return ret;
+ }
+ if (pc_attr) {
+ *pu_code = (pc_attr->u_class * 100) + pc_attr->u_number;
+ }
+ return 0;
}
int tnet_stun_pkt_process_err420(struct tnet_stun_pkt_s *p_self, const struct tnet_stun_pkt_s *pc_pkt_resp420)
{
- const tnet_stun_attr_vdata_t* pc_attr;
- uint16_t u16;
- int ret;
- tsk_bool_t b_done = tsk_false;
- if (!p_self || !pc_pkt_resp420) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt_resp420, tnet_stun_attr_type_unknown_attrs, (const tnet_stun_attr_t**)&pc_attr))) {
- goto bail;
- }
- if (!pc_attr || !pc_attr->p_data_ptr || (pc_attr->u_data_size & 1)) {
- TSK_DEBUG_ERROR("UNKNOWN-ATTRIBUTES missing in 420");
- ret = -3;
- goto bail;
- }
- for (u16 = 0; u16 < pc_attr->u_data_size; u16 += 2) {
- switch (*((uint16_t*)&pc_attr->p_data_ptr[u16])) {
- case tnet_stun_attr_type_dont_fragment: {
- p_self->opt.dontfrag = 0;
- b_done = tsk_true;
- break;
- }
- case tnet_stun_attr_type_fingerprint: {
- p_self->opt.fingerprint = 0;
- b_done = tsk_true;
- break;
- }
- }
- }
-
- if (b_done) {
- // TRANSACTION-ID
- if ((ret = tnet_stun_utils_transac_id_rand(&p_self->transac_id))) {
- goto bail;
- }
- }
+ const tnet_stun_attr_vdata_t* pc_attr;
+ uint16_t u16;
+ int ret;
+ tsk_bool_t b_done = tsk_false;
+ if (!p_self || !pc_pkt_resp420) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt_resp420, tnet_stun_attr_type_unknown_attrs, (const tnet_stun_attr_t**)&pc_attr))) {
+ goto bail;
+ }
+ if (!pc_attr || !pc_attr->p_data_ptr || (pc_attr->u_data_size & 1)) {
+ TSK_DEBUG_ERROR("UNKNOWN-ATTRIBUTES missing in 420");
+ ret = -3;
+ goto bail;
+ }
+ for (u16 = 0; u16 < pc_attr->u_data_size; u16 += 2) {
+ switch (*((uint16_t*)&pc_attr->p_data_ptr[u16])) {
+ case tnet_stun_attr_type_dont_fragment: {
+ p_self->opt.dontfrag = 0;
+ b_done = tsk_true;
+ break;
+ }
+ case tnet_stun_attr_type_fingerprint: {
+ p_self->opt.fingerprint = 0;
+ b_done = tsk_true;
+ break;
+ }
+ }
+ }
+
+ if (b_done) {
+ // TRANSACTION-ID
+ if ((ret = tnet_stun_utils_transac_id_rand(&p_self->transac_id))) {
+ goto bail;
+ }
+ }
bail:
- return ret;
+ return ret;
}
static tsk_object_t* tnet_stun_pkt_ctor(tsk_object_t * self, va_list * app)
{
- tnet_stun_pkt_t *p_pkt = (tnet_stun_pkt_t *)self;
- if (p_pkt) {
- p_pkt->opt.fingerprint = kStunOptFingerPrint;
- p_pkt->opt.dontfrag = kStunOptDontFragment;
- }
- return self;
+ tnet_stun_pkt_t *p_pkt = (tnet_stun_pkt_t *)self;
+ if (p_pkt) {
+ p_pkt->opt.fingerprint = kStunOptFingerPrint;
+ p_pkt->opt.dontfrag = kStunOptDontFragment;
+ }
+ return self;
}
static tsk_object_t* tnet_stun_pkt_dtor(tsk_object_t * self)
{
- tnet_stun_pkt_t *p_pkt = (tnet_stun_pkt_t *)self;
- if (p_pkt) {
+ tnet_stun_pkt_t *p_pkt = (tnet_stun_pkt_t *)self;
+ if (p_pkt) {
#if PRINT_DESTROYED_MSG
- TSK_DEBUG_INFO("*** STUN pkt destroyed ***");
+ TSK_DEBUG_INFO("*** STUN pkt destroyed ***");
#endif
- TSK_OBJECT_SAFE_FREE(p_pkt->p_list_attrs);
- TSK_FREE(p_pkt->p_pwd);
- }
- return self;
+ TSK_OBJECT_SAFE_FREE(p_pkt->p_list_attrs);
+ TSK_FREE(p_pkt->p_pwd);
+ }
+ return self;
}
static const tsk_object_def_t tnet_stun_pkt_def_s = {
- sizeof(tnet_stun_pkt_t),
- tnet_stun_pkt_ctor,
- tnet_stun_pkt_dtor,
- tsk_null,
+ sizeof(tnet_stun_pkt_t),
+ tnet_stun_pkt_ctor,
+ tnet_stun_pkt_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_stun_pkt_def_t = &tnet_stun_pkt_def_s;
diff --git a/tinyNET/src/stun/tnet_stun_types.h b/tinyNET/src/stun/tnet_stun_types.h
index 386f471..d09bf99 100755
--- a/tinyNET/src/stun/tnet_stun_types.h
+++ b/tinyNET/src/stun/tnet_stun_types.h
@@ -141,9 +141,9 @@ typedef enum tnet_stun_method_e {
tnet_stun_method_data = 0x0007, /**< rfc5766 - Data (only indication semantics defined) */
tnet_stun_method_createpermission = 0x0008, /**< rfc5766 - CreatePermission (only request/response semantics defined */
tnet_stun_method_channelbind = 0x0009, /**< rfc5766 - ChannelBind (only request/response semantics defined) */
- tnet_stun_method_connect = 0x000a,/**< rfc6062 - Connect */
- tnet_stun_method_connectionbind = 0x000b,/**< rfc6062 - ConnectionBind */
- tnet_stun_method_connectionattempt = 0x000c,/**< rfc6062 - ConnectionAttempt */
+ tnet_stun_method_connect = 0x000a,/**< rfc6062 - Connect */
+ tnet_stun_method_connectionbind = 0x000b,/**< rfc6062 - ConnectionBind */
+ tnet_stun_method_connectionattempt = 0x000c,/**< rfc6062 - ConnectionAttempt */
}
tnet_stun_method_t;
@@ -167,8 +167,8 @@ typedef enum tnet_stun_address_family_e {
// rfc5766 - 14.7. REQUESTED-TRANSPORT
typedef enum tnet_turn_transport_e {
- tnet_turn_transport_udp = 17,
- tnet_turn_transport_tcp = 6
+ tnet_turn_transport_udp = 17,
+ tnet_turn_transport_tcp = 6
}
tnet_turn_transport_t;
@@ -257,8 +257,8 @@ typedef enum tnet_stun_attr_type_e {
tnet_stun_attr_type_ice_controlled = 0x8029, /**< 21.2. STUN Attributes */
tnet_stun_attr_type_ice_controlling = 0x802A, /**< 21.2. STUN Attributes */
- /* rfc6062 */
- tnet_stun_attr_type_connection_id = 0x002a, /**< 6.2. New STUN Attributes */
+ /* rfc6062 */
+ tnet_stun_attr_type_connection_id = 0x002a, /**< 6.2. New STUN Attributes */
} tnet_stun_attr_type_t;
@@ -316,17 +316,17 @@ typedef enum tnet_stun_pkt_type_e {
tnet_stun_pkt_type_channelbind_success_response = (tnet_stun_method_channelbind | tnet_stun_mask_success),
tnet_stun_pkt_type_channelbind_error_response = (tnet_stun_method_channelbind | tnet_stun_mask_error),
- tnet_stun_pkt_type_connect_request = (tnet_stun_method_connect | tnet_stun_mask_request),
+ tnet_stun_pkt_type_connect_request = (tnet_stun_method_connect | tnet_stun_mask_request),
tnet_stun_pkt_type_connect_indication = (tnet_stun_method_connect | tnet_stun_mask_indication),
tnet_stun_pkt_type_connect_success_response = (tnet_stun_method_connect | tnet_stun_mask_success),
tnet_stun_pkt_type_connect_error_response = (tnet_stun_method_connect | tnet_stun_mask_error),
- tnet_stun_pkt_type_connectionbind_request = (tnet_stun_method_connectionbind | tnet_stun_mask_request),
+ tnet_stun_pkt_type_connectionbind_request = (tnet_stun_method_connectionbind | tnet_stun_mask_request),
tnet_stun_pkt_type_connectionbind_indication = (tnet_stun_method_connectionbind | tnet_stun_mask_indication),
tnet_stun_pkt_type_connectionbind_success_response = (tnet_stun_method_connectionbind | tnet_stun_mask_success),
tnet_stun_pkt_type_connectionbind_error_response = (tnet_stun_method_connectionbind | tnet_stun_mask_error),
- tnet_stun_pkt_type_connectionattempt_indication = (tnet_stun_method_connectionattempt | tnet_stun_mask_indication),
+ tnet_stun_pkt_type_connectionattempt_indication = (tnet_stun_method_connectionattempt | tnet_stun_mask_indication),
}
tnet_stun_pkt_type_t;
diff --git a/tinyNET/src/tinynet.h b/tinyNET/src/tinynet.h
index 63df285..b888c8e 100755
--- a/tinyNET/src/tinynet.h
+++ b/tinyNET/src/tinynet.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tinynet_config.h b/tinyNET/src/tinynet_config.h
index 813c2c0..2633d2f 100755
--- a/tinyNET/src/tinynet_config.h
+++ b/tinyNET/src/tinynet_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -98,7 +98,7 @@
# define TNET_BEGIN_DECLS extern "C" {
# define TNET_END_DECLS }
#else
-# define TNET_BEGIN_DECLS
+# define TNET_BEGIN_DECLS
# define TNET_END_DECLS
#endif
@@ -107,7 +107,7 @@
#elif defined(__GNUC__) && !defined(__APPLE__)
# define TNET_INLINE __inline
#else
-# define TNET_INLINE
+# define TNET_INLINE
#endif
/* have poll()? */
diff --git a/tinyNET/src/tls/tnet_dtls.c b/tinyNET/src/tls/tnet_dtls.c
index 6420c9e..b49bd46 100755
--- a/tinyNET/src/tls/tnet_dtls.c
+++ b/tinyNET/src/tls/tnet_dtls.c
@@ -33,46 +33,45 @@
#include "tsk_safeobj.h"
#include "tsk_debug.h"
-typedef struct tnet_dtls_socket_s
-{
- TSK_DECLARE_OBJECT;
-
- struct tnet_socket_s* wrapped_sock; /* not owner: do not try to close */
- tsk_bool_t verify_peer;
- tsk_bool_t use_srtp;
- tsk_bool_t handshake_completed;
- tsk_bool_t handshake_started;
- tsk_bool_t handshake_storedata; // whether to store handshaking data or to send it to the remote party
- tnet_dtls_setup_t setup;
-
- struct {
- void* ptr;
- tsk_size_t size;
- tsk_size_t count;
- } handshake_data;
-
- struct{
- const void* usrdata;
- tnet_dtls_socket_cb_f func;
- } cb;
-
- struct{
- tnet_fingerprint_t fp;
- tnet_dtls_hash_type_t hash;
- struct sockaddr_storage addr;
- } remote;
- struct{
- tnet_fingerprint_t fp;
- tnet_dtls_hash_type_t hash;
- } local;
+typedef struct tnet_dtls_socket_s {
+ TSK_DECLARE_OBJECT;
+
+ struct tnet_socket_s* wrapped_sock; /* not owner: do not try to close */
+ tsk_bool_t verify_peer;
+ tsk_bool_t use_srtp;
+ tsk_bool_t handshake_completed;
+ tsk_bool_t handshake_started;
+ tsk_bool_t handshake_storedata; // whether to store handshaking data or to send it to the remote party
+ tnet_dtls_setup_t setup;
+
+ struct {
+ void* ptr;
+ tsk_size_t size;
+ tsk_size_t count;
+ } handshake_data;
+
+ struct {
+ const void* usrdata;
+ tnet_dtls_socket_cb_f func;
+ } cb;
+
+ struct {
+ tnet_fingerprint_t fp;
+ tnet_dtls_hash_type_t hash;
+ struct sockaddr_storage addr;
+ } remote;
+ struct {
+ tnet_fingerprint_t fp;
+ tnet_dtls_hash_type_t hash;
+ } local;
#if HAVE_OPENSSL
- SSL *ssl;
- BIO* rbio;
- BIO* wbio;
+ SSL *ssl;
+ BIO* rbio;
+ BIO* wbio;
#endif
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tnet_dtls_socket_t;
@@ -83,18 +82,18 @@ tnet_dtls_socket_t;
tsk_bool_t tnet_dtls_is_srtp_supported()
{
#if HAVE_OPENSSL_DTLS_SRTP
- return tsk_true;
+ return tsk_true;
#else
- return tsk_false;
+ return tsk_false;
#endif
}
tsk_bool_t tnet_dtls_is_supported()
{
#if HAVE_OPENSSL_DTLS
- return tsk_true;
+ return tsk_true;
#else
- return tsk_false;
+ return tsk_false;
#endif
}
@@ -105,298 +104,304 @@ static tsk_bool_t _tnet_dtls_is_fingerprint_matching(X509* cert, tnet_fingerprin
static int _tnet_dtls_verify_cert(int preverify_ok, X509_STORE_CTX *ctx)
{
- SSL *ssl;
- tnet_dtls_socket_t* socket;
-
- TSK_DEBUG_INFO("_tnet_dtls_verify_cert");
-
- ssl = X509_STORE_CTX_get_app_data(ctx);
- socket = (tnet_dtls_socket_t*)SSL_get_app_data(ssl);
- if (!ssl || !socket){
- TSK_DEBUG_ERROR("Not expected");
- return 0;
- }
- tsk_safeobj_lock(socket);
- if (_tnet_dtls_is_fingerprint_matching(ctx->cert, &socket->remote.fp, socket->remote.hash) == tsk_false) {
- TSK_DEBUG_ERROR("Failed to match fingerprint");
- tsk_safeobj_unlock(socket);
- return 0;
- }
- tsk_safeobj_unlock(socket);
- return 1;
+ SSL *ssl;
+ tnet_dtls_socket_t* socket;
+
+ TSK_DEBUG_INFO("_tnet_dtls_verify_cert");
+
+ ssl = X509_STORE_CTX_get_app_data(ctx);
+ socket = (tnet_dtls_socket_t*)SSL_get_app_data(ssl);
+ if (!ssl || !socket) {
+ TSK_DEBUG_ERROR("Not expected");
+ return 0;
+ }
+ tsk_safeobj_lock(socket);
+ if (_tnet_dtls_is_fingerprint_matching(ctx->cert, &socket->remote.fp, socket->remote.hash) == tsk_false) {
+ TSK_DEBUG_ERROR("Failed to match fingerprint");
+ tsk_safeobj_unlock(socket);
+ return 0;
+ }
+ tsk_safeobj_unlock(socket);
+ return 1;
}
static const EVP_MD *_tnet_dtls_get_hash_evp(tnet_dtls_hash_type_t hash)
{
- switch (hash){
- case tnet_dtls_hash_type_md5: return EVP_md5();
- case tnet_dtls_hash_type_sha1: return EVP_sha1();
- case tnet_dtls_hash_type_sha256: return EVP_sha256();
- case tnet_dtls_hash_type_sha512: return EVP_sha512();
- default: TSK_DEBUG_ERROR("Invalid parameter: %d not valid as hash type", hash); return tsk_null;
- }
+ switch (hash) {
+ case tnet_dtls_hash_type_md5:
+ return EVP_md5();
+ case tnet_dtls_hash_type_sha1:
+ return EVP_sha1();
+ case tnet_dtls_hash_type_sha256:
+ return EVP_sha256();
+ case tnet_dtls_hash_type_sha512:
+ return EVP_sha512();
+ default:
+ TSK_DEBUG_ERROR("Invalid parameter: %d not valid as hash type", hash);
+ return tsk_null;
+ }
}
static int _tnet_dtls_get_fingerprint(X509* cert, const EVP_MD *evp, tnet_fingerprint_t* fingerprint)
{
- if (!cert || !evp || !fingerprint){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- else{
- unsigned len = 0, i, j;
- tnet_fingerprint_t fp;
-
- if (X509_digest(cert, evp, fp, &len) != 1 || len <= 0){
- TSK_DEBUG_ERROR("X509_digest() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- return -2;
- }
- for (i = 0, j = 0; i < len; ++i, j += 3){
- sprintf((char*)&(*fingerprint)[j], (i == (len - 1)) ? "%.2X" : "%.2X:", fp[i]);
- }
- (*fingerprint)[len * 3] = '\0';
- return 0;
- }
+ if (!cert || !evp || !fingerprint) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ else {
+ unsigned len = 0, i, j;
+ tnet_fingerprint_t fp;
+
+ if (X509_digest(cert, evp, fp, &len) != 1 || len <= 0) {
+ TSK_DEBUG_ERROR("X509_digest() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ return -2;
+ }
+ for (i = 0, j = 0; i < len; ++i, j += 3) {
+ sprintf((char*)&(*fingerprint)[j], (i == (len - 1)) ? "%.2X" : "%.2X:", fp[i]);
+ }
+ (*fingerprint)[len * 3] = '\0';
+ return 0;
+ }
}
static tsk_bool_t _tnet_dtls_is_fingerprint_matching(X509* cert, tnet_fingerprint_t* fingerprint, tnet_dtls_hash_type_t hash)
{
- const EVP_MD* evp;
- tnet_fingerprint_t fp;
- int ret;
-
- if (!cert || !fingerprint){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- if (!(evp = _tnet_dtls_get_hash_evp(hash))){
- return tsk_false;
- }
- if ((ret = _tnet_dtls_get_fingerprint(cert, evp, &fp))){
- return tsk_false;
- }
- if (!tsk_striequals(fp, fingerprint)){
- TSK_DEBUG_ERROR("DTLS certificate fingerprints mismatch: [%s]#[%s]", fp, *fingerprint);
- return tsk_false;
- }
- return tsk_true;
+ const EVP_MD* evp;
+ tnet_fingerprint_t fp;
+ int ret;
+
+ if (!cert || !fingerprint) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ if (!(evp = _tnet_dtls_get_hash_evp(hash))) {
+ return tsk_false;
+ }
+ if ((ret = _tnet_dtls_get_fingerprint(cert, evp, &fp))) {
+ return tsk_false;
+ }
+ if (!tsk_striequals(fp, fingerprint)) {
+ TSK_DEBUG_ERROR("DTLS certificate fingerprints mismatch: [%s]#[%s]", fp, *fingerprint);
+ return tsk_false;
+ }
+ return tsk_true;
}
static tsk_bool_t _tnet_dtls_socket_is_remote_cert_fp_match(tnet_dtls_socket_t* socket)
{
- if (!socket){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- else if (socket->verify_peer){
- X509* cert;
-
- if (!(cert = SSL_get_peer_certificate(socket->ssl))){
- if (socket->verify_peer){ // print error only if verify certs is enabled
- TSK_DEBUG_ERROR("Failed to get peer certificate [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- }
- return tsk_false;
- }
- if (!_tnet_dtls_is_fingerprint_matching(cert, &socket->remote.fp, socket->remote.hash)){
- X509_free(cert);
- return tsk_false;
- }
- X509_free(cert);
-
- if (SSL_get_verify_result(socket->ssl) != X509_V_OK){
- TSK_DEBUG_ERROR("SSL_get_verify_result()#X509_V_OK [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- return tsk_false;
- }
- }
-
- return tsk_true;
+ if (!socket) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ else if (socket->verify_peer) {
+ X509* cert;
+
+ if (!(cert = SSL_get_peer_certificate(socket->ssl))) {
+ if (socket->verify_peer) { // print error only if verify certs is enabled
+ TSK_DEBUG_ERROR("Failed to get peer certificate [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ }
+ return tsk_false;
+ }
+ if (!_tnet_dtls_is_fingerprint_matching(cert, &socket->remote.fp, socket->remote.hash)) {
+ X509_free(cert);
+ return tsk_false;
+ }
+ X509_free(cert);
+
+ if (SSL_get_verify_result(socket->ssl) != X509_V_OK) {
+ TSK_DEBUG_ERROR("SSL_get_verify_result()#X509_V_OK [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ return tsk_false;
+ }
+ }
+
+ return tsk_true;
}
#endif /* HAVE_OPENSSL */
tnet_dtls_hash_type_t tnet_dtls_get_hash_from_string(const char* hash)
{
- if (hash){
- int32_t i;
- for (i = 0; i < TNET_DTLS_HASH_TYPE_MAX; ++i){
- if (tsk_striequals(TNET_DTLS_HASH_NAMES[i], hash)){
- return (tnet_dtls_hash_type_t)i;
- }
- }
- }
- return tnet_dtls_hash_type_none;
+ if (hash) {
+ int32_t i;
+ for (i = 0; i < TNET_DTLS_HASH_TYPE_MAX; ++i) {
+ if (tsk_striequals(TNET_DTLS_HASH_NAMES[i], hash)) {
+ return (tnet_dtls_hash_type_t)i;
+ }
+ }
+ }
+ return tnet_dtls_hash_type_none;
}
tnet_dtls_setup_t tnet_dtls_get_setup_from_string(const char* setup)
{
- if (setup){
- int32_t i;
- for (i = 0; i < TNET_DTLS_SETUP_MAX; ++i){
- if (tsk_striequals(TNET_DTLS_SETUP_NAMES[i], setup)){
- return (tnet_dtls_setup_t)i;
- }
- }
- }
- return tnet_dtls_setup_none;
+ if (setup) {
+ int32_t i;
+ for (i = 0; i < TNET_DTLS_SETUP_MAX; ++i) {
+ if (tsk_striequals(TNET_DTLS_SETUP_NAMES[i], setup)) {
+ return (tnet_dtls_setup_t)i;
+ }
+ }
+ }
+ return tnet_dtls_setup_none;
}
int tnet_dtls_get_fingerprint(const char* certfile, tnet_fingerprint_t* fingerprint, tnet_dtls_hash_type_t hash)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -200;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -200;
#else
- {
- X509* x509;
- BIO* bio;
- int ret = 0;
- const EVP_MD *evp;
-
- if (tsk_strnullORempty(certfile) || !fingerprint){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!(evp = _tnet_dtls_get_hash_evp(hash))){
- return -1;
- }
-
- x509 = tsk_null;
- bio = tsk_null;
-
- if (!(bio = BIO_new(BIO_s_file()))){
- TSK_DEBUG_ERROR("BIO_new(BIO_s_file()) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- ret = -3;
- goto bail;
- }
- if (BIO_read_filename(bio, certfile) != 1){
- TSK_DEBUG_ERROR("BIO_read_filename(%s) failed [%s]", certfile, ERR_error_string(ERR_get_error(), tsk_null));
- ret = -4;
- goto bail;
- }
- if (!(x509 = PEM_read_bio_X509(bio, tsk_null, 0, tsk_null))){
- TSK_DEBUG_ERROR("PEM_read_bio() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- ret = -5;
- goto bail;
- }
- if ((ret = _tnet_dtls_get_fingerprint(x509, evp, fingerprint))){
- goto bail;
- }
-
- bail:
- if (bio){
- BIO_free_all(bio);
- }
- return ret;
- }
+ {
+ X509* x509;
+ BIO* bio;
+ int ret = 0;
+ const EVP_MD *evp;
+
+ if (tsk_strnullORempty(certfile) || !fingerprint) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!(evp = _tnet_dtls_get_hash_evp(hash))) {
+ return -1;
+ }
+
+ x509 = tsk_null;
+ bio = tsk_null;
+
+ if (!(bio = BIO_new(BIO_s_file()))) {
+ TSK_DEBUG_ERROR("BIO_new(BIO_s_file()) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -3;
+ goto bail;
+ }
+ if (BIO_read_filename(bio, certfile) != 1) {
+ TSK_DEBUG_ERROR("BIO_read_filename(%s) failed [%s]", certfile, ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -4;
+ goto bail;
+ }
+ if (!(x509 = PEM_read_bio_X509(bio, tsk_null, 0, tsk_null))) {
+ TSK_DEBUG_ERROR("PEM_read_bio() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -5;
+ goto bail;
+ }
+ if ((ret = _tnet_dtls_get_fingerprint(x509, evp, fingerprint))) {
+ goto bail;
+ }
+
+bail:
+ if (bio) {
+ BIO_free_all(bio);
+ }
+ return ret;
+ }
#endif
}
tnet_dtls_socket_handle_t* tnet_dtls_socket_create(struct tnet_socket_s* wrapped_sock, struct ssl_ctx_st* ssl_ctx)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return tsk_null;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return tsk_null;
#else
- tnet_dtls_socket_t* socket;
-
- if (!wrapped_sock || !ssl_ctx){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if ((socket = tsk_object_new(tnet_dtls_socket_def_t))) {
- EC_KEY* ecdh;
- const tsk_bool_t set_mtu = TNET_SOCKET_TYPE_IS_DGRAM(wrapped_sock->type) || 1; //!\ This is required even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
- socket->wrapped_sock = tsk_object_ref(wrapped_sock);
- if (!(socket->ssl = SSL_new(ssl_ctx))) {
- TSK_DEBUG_ERROR("SSL_new(CTX) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- TSK_OBJECT_SAFE_FREE(socket);
- return tsk_null;
- }
- if (set_mtu) {
- SSL_set_options(socket->ssl, SSL_OP_NO_QUERY_MTU);
- SSL_set_mtu(socket->ssl, TNET_DTLS_MTU - 28);
- socket->ssl->d1->mtu = TNET_DTLS_MTU - 28;
- }
- if (!(socket->rbio = BIO_new(BIO_s_mem())) || !(socket->wbio = BIO_new(BIO_s_mem()))){
- TSK_DEBUG_ERROR("BIO_new_socket(%d) failed [%s]", socket->wrapped_sock->fd, ERR_error_string(ERR_get_error(), tsk_null));
- if (socket->rbio){
- BIO_free(socket->rbio);
- }
- if (socket->wbio){
- BIO_free(socket->wbio);
- }
- TSK_OBJECT_SAFE_FREE(socket);
- return tsk_null;
- }
- BIO_set_mem_eof_return(socket->rbio, -1);
- BIO_set_mem_eof_return(socket->wbio, -1);
- SSL_set_bio(socket->ssl, socket->rbio, socket->wbio);
- SSL_set_mode(socket->ssl, SSL_MODE_AUTO_RETRY);
- SSL_set_read_ahead(socket->ssl, 1);
- // https://groups.google.com/forum/#!topic/doubango/Oo0t1e3tlL8
- if ((ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1))) {
- SSL_set_options(socket->ssl, SSL_OP_SINGLE_ECDH_USE);
- SSL_set_tmp_ecdh(socket->ssl, ecdh);
- EC_KEY_free(ecdh);
- }
-
- if (set_mtu) {
- BIO_ctrl(SSL_get_wbio(socket->ssl), BIO_CTRL_DGRAM_SET_MTU, TNET_DTLS_MTU - 28, NULL);
- }
-
- if ((socket->verify_peer = (SSL_CTX_get_verify_mode(ssl_ctx) != SSL_VERIFY_NONE))){
- TSK_DEBUG_INFO("SSL cert verify: ON");
- socket->verify_peer = tsk_true;
- SSL_set_verify(socket->ssl, (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT), _tnet_dtls_verify_cert);
- }
- else {
- TSK_DEBUG_ERROR("Verity not enabled");
- }
-
- SSL_set_app_data(socket->ssl, socket);
- }
- return socket;
+ tnet_dtls_socket_t* socket;
+
+ if (!wrapped_sock || !ssl_ctx) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if ((socket = tsk_object_new(tnet_dtls_socket_def_t))) {
+ EC_KEY* ecdh;
+ const tsk_bool_t set_mtu = TNET_SOCKET_TYPE_IS_DGRAM(wrapped_sock->type) || 1; //!\ This is required even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
+ socket->wrapped_sock = tsk_object_ref(wrapped_sock);
+ if (!(socket->ssl = SSL_new(ssl_ctx))) {
+ TSK_DEBUG_ERROR("SSL_new(CTX) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ TSK_OBJECT_SAFE_FREE(socket);
+ return tsk_null;
+ }
+ if (set_mtu) {
+ SSL_set_options(socket->ssl, SSL_OP_NO_QUERY_MTU);
+ SSL_set_mtu(socket->ssl, TNET_DTLS_MTU - 28);
+ socket->ssl->d1->mtu = TNET_DTLS_MTU - 28;
+ }
+ if (!(socket->rbio = BIO_new(BIO_s_mem())) || !(socket->wbio = BIO_new(BIO_s_mem()))) {
+ TSK_DEBUG_ERROR("BIO_new_socket(%d) failed [%s]", socket->wrapped_sock->fd, ERR_error_string(ERR_get_error(), tsk_null));
+ if (socket->rbio) {
+ BIO_free(socket->rbio);
+ }
+ if (socket->wbio) {
+ BIO_free(socket->wbio);
+ }
+ TSK_OBJECT_SAFE_FREE(socket);
+ return tsk_null;
+ }
+ BIO_set_mem_eof_return(socket->rbio, -1);
+ BIO_set_mem_eof_return(socket->wbio, -1);
+ SSL_set_bio(socket->ssl, socket->rbio, socket->wbio);
+ SSL_set_mode(socket->ssl, SSL_MODE_AUTO_RETRY);
+ SSL_set_read_ahead(socket->ssl, 1);
+ // https://groups.google.com/forum/#!topic/doubango/Oo0t1e3tlL8
+ if ((ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1))) {
+ SSL_set_options(socket->ssl, SSL_OP_SINGLE_ECDH_USE);
+ SSL_set_tmp_ecdh(socket->ssl, ecdh);
+ EC_KEY_free(ecdh);
+ }
+
+ if (set_mtu) {
+ BIO_ctrl(SSL_get_wbio(socket->ssl), BIO_CTRL_DGRAM_SET_MTU, TNET_DTLS_MTU - 28, NULL);
+ }
+
+ if ((socket->verify_peer = (SSL_CTX_get_verify_mode(ssl_ctx) != SSL_VERIFY_NONE))) {
+ TSK_DEBUG_INFO("SSL cert verify: ON");
+ socket->verify_peer = tsk_true;
+ SSL_set_verify(socket->ssl, (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT), _tnet_dtls_verify_cert);
+ }
+ else {
+ TSK_DEBUG_ERROR("Verity not enabled");
+ }
+
+ SSL_set_app_data(socket->ssl, socket);
+ }
+ return socket;
#endif
}
tnet_fd_t tnet_dtls_socket_get_fd(const tnet_dtls_socket_handle_t* handle)
{
- return handle ? ((const tnet_dtls_socket_t*)handle)->wrapped_sock->fd : TNET_INVALID_FD;
+ return handle ? ((const tnet_dtls_socket_t*)handle)->wrapped_sock->fd : TNET_INVALID_FD;
}
const struct sockaddr_storage* tnet_dtls_socket_get_remote_addr(const tnet_dtls_socket_handle_t* handle)
{
- return handle ? &((const tnet_dtls_socket_t*)handle)->remote.addr : tsk_null;
+ return handle ? &((const tnet_dtls_socket_t*)handle)->remote.addr : tsk_null;
}
int tnet_dtls_socket_set_callback(tnet_dtls_socket_handle_t* handle, const void* usrdata, tnet_dtls_socket_cb_f func)
{
- tnet_dtls_socket_t* socket = handle;
+ tnet_dtls_socket_t* socket = handle;
- if (!socket){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!socket) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- socket->cb.usrdata = usrdata;
- socket->cb.func = func;
- return 0;
+ socket->cb.usrdata = usrdata;
+ socket->cb.func = func;
+ return 0;
}
int tnet_dtls_socket_set_remote_fingerprint(tnet_dtls_socket_handle_t* handle, const tnet_fingerprint_t* fingerprint, tnet_dtls_hash_type_t hash)
{
- tnet_dtls_socket_t* socket = handle;
+ tnet_dtls_socket_t* socket = handle;
- if (!socket || !fingerprint){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!socket || !fingerprint) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- memcpy(socket->remote.fp, &(*fingerprint)[0], sizeof(tnet_fingerprint_t));
- socket->remote.hash = hash;
- return 0;
+ memcpy(socket->remote.fp, &(*fingerprint)[0], sizeof(tnet_fingerprint_t));
+ socket->remote.hash = hash;
+ return 0;
}
/*
@@ -405,267 +410,267 @@ rfc5764: 4.1. The use_srtp Extension
int tnet_dtls_socket_use_srtp(tnet_dtls_socket_handle_t*handle)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS || !HAVE_OPENSSL_DTLS_SRTP
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -200;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -200;
#else
- tnet_dtls_socket_t* socket = handle;
- if (!socket){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if ((socket->use_srtp = tsk_true)){
- if (!socket->verify_peer){
- socket->verify_peer = tsk_true; // DTLS-SRTP requires certtificates
- SSL_set_verify(socket->ssl, (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT), _tnet_dtls_verify_cert);
- }
- }
- return 0;
+ tnet_dtls_socket_t* socket = handle;
+ if (!socket) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if ((socket->use_srtp = tsk_true)) {
+ if (!socket->verify_peer) {
+ socket->verify_peer = tsk_true; // DTLS-SRTP requires certtificates
+ SSL_set_verify(socket->ssl, (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT), _tnet_dtls_verify_cert);
+ }
+ }
+ return 0;
#endif
}
int tnet_dtls_socket_set_setup(tnet_dtls_socket_handle_t* handle, tnet_dtls_setup_t setup)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -200;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -200;
#else
- tnet_dtls_socket_t* socket = handle;
- if (!socket){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch ((socket->setup = setup)){
- case tnet_dtls_setup_passive:
- SSL_set_accept_state(socket->ssl);
- break;
- case tnet_dtls_setup_active:
- case tnet_dtls_setup_actpass:
- case tnet_dtls_setup_none:
- if (setup != tnet_dtls_setup_active){
- TSK_DEBUG_WARN("using setup=%s is not a good idea", TNET_DTLS_SETUP_NAMES[setup]);
- }
- SSL_set_connect_state(socket->ssl);
- break;
- default:
- TSK_DEBUG_ERROR("%d not valid value for DTLS setup", (int32_t)setup);
- break;
- }
- return 0;
+ tnet_dtls_socket_t* socket = handle;
+ if (!socket) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch ((socket->setup = setup)) {
+ case tnet_dtls_setup_passive:
+ SSL_set_accept_state(socket->ssl);
+ break;
+ case tnet_dtls_setup_active:
+ case tnet_dtls_setup_actpass:
+ case tnet_dtls_setup_none:
+ if (setup != tnet_dtls_setup_active) {
+ TSK_DEBUG_WARN("using setup=%s is not a good idea", TNET_DTLS_SETUP_NAMES[setup]);
+ }
+ SSL_set_connect_state(socket->ssl);
+ break;
+ default:
+ TSK_DEBUG_ERROR("%d not valid value for DTLS setup", (int32_t)setup);
+ break;
+ }
+ return 0;
#endif
}
int tnet_dtls_socket_set_store_handshakingdata(tnet_dtls_socket_handle_t* handle, tsk_bool_t handshake_storedata)
{
- if (!handle) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- ((tnet_dtls_socket_t*)handle)->handshake_storedata = handshake_storedata;
- return 0;
+ if (!handle) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ ((tnet_dtls_socket_t*)handle)->handshake_storedata = handshake_storedata;
+ return 0;
}
int tnet_dtls_socket_get_handshakingdata(tnet_dtls_socket_handle_t* handle, const void** data, tsk_size_t *size)
{
- if (!handle || !data || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *data = ((tnet_dtls_socket_t*)handle)->handshake_data.ptr;
- *size = ((tnet_dtls_socket_t*)handle)->handshake_data.count;
- return 0;
+ if (!handle || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *data = ((tnet_dtls_socket_t*)handle)->handshake_data.ptr;
+ *size = ((tnet_dtls_socket_t*)handle)->handshake_data.count;
+ return 0;
}
// This function returns first DTLS record. It's useful to send handshaking data by records to avoid IP fragmentation
int tnet_dtls_socket_get_record_first(const void* records, tsk_size_t records_size, const void** record, tsk_size_t* size)
{
- /* https://tools.ietf.org/html/rfc6347#section-3.2.3
- TLS and DTLS handshake messages can be quite large(in theory up to
- 2 ^ 24 - 1 bytes, in practice many kilobytes).By contrast, UDP
- datagrams are often limited to <1500 bytes if IP fragmentation is not
- desired.In order to compensate for this limitation, each DTLS
- handshake message may be fragmented over several DTLS records, each
- of which is intended to fit in a single IP datagram.Each DTLS
- handshake message contains both a fragment offset and a fragment
- length.Thus, a recipient in possession of all bytes of a handshake
- message can reassemble the original unfragmented message. */
- // 4.1. Record Layer - https://tools.ietf.org/html/rfc6347#section-4.1
+ /* https://tools.ietf.org/html/rfc6347#section-3.2.3
+ TLS and DTLS handshake messages can be quite large(in theory up to
+ 2 ^ 24 - 1 bytes, in practice many kilobytes).By contrast, UDP
+ datagrams are often limited to <1500 bytes if IP fragmentation is not
+ desired.In order to compensate for this limitation, each DTLS
+ handshake message may be fragmented over several DTLS records, each
+ of which is intended to fit in a single IP datagram.Each DTLS
+ handshake message contains both a fragment offset and a fragment
+ length.Thus, a recipient in possession of all bytes of a handshake
+ message can reassemble the original unfragmented message. */
+ // 4.1. Record Layer - https://tools.ietf.org/html/rfc6347#section-4.1
#define kDTLSv1RecordHdrStartIndex 11
#define kDTLSv1RecordHdrLengthFieldLen 2 // uint16
#define kDTLSv1RecordHdrLen (kDTLSv1RecordHdrStartIndex + kDTLSv1RecordHdrLengthFieldLen)
-
- const uint8_t* pc_records;
- tsk_size_t record_length;
- if (!records || records_size < kDTLSv1RecordHdrLen || !record || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- pc_records = (const uint8_t*)records;
- record_length = ((pc_records[kDTLSv1RecordHdrStartIndex] << 8) & 0xFF00) | (pc_records[kDTLSv1RecordHdrStartIndex + 1] & 0xFF);
- *record = records;
- *size = kDTLSv1RecordHdrLen + record_length;
- if ((*size) > TNET_DTLS_MTU) {
- TSK_DEBUG_WARN("DTLS record length(%u) > MTU(%u)", (unsigned)(*size), TNET_DTLS_MTU);
- }
-
- return 0;
+
+ const uint8_t* pc_records;
+ tsk_size_t record_length;
+ if (!records || records_size < kDTLSv1RecordHdrLen || !record || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ pc_records = (const uint8_t*)records;
+ record_length = ((pc_records[kDTLSv1RecordHdrStartIndex] << 8) & 0xFF00) | (pc_records[kDTLSv1RecordHdrStartIndex + 1] & 0xFF);
+ *record = records;
+ *size = kDTLSv1RecordHdrLen + record_length;
+ if ((*size) > TNET_DTLS_MTU) {
+ TSK_DEBUG_WARN("DTLS record length(%u) > MTU(%u)", (unsigned)(*size), TNET_DTLS_MTU);
+ }
+
+ return 0;
}
tsk_bool_t tnet_dtls_socket_is_remote_cert_fp_match(tnet_dtls_socket_handle_t* handle)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -1;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -1;
#else
- return _tnet_dtls_socket_is_remote_cert_fp_match((tnet_dtls_socket_t*)handle);
+ return _tnet_dtls_socket_is_remote_cert_fp_match((tnet_dtls_socket_t*)handle);
#endif
}
int tnet_dtls_socket_do_handshake(tnet_dtls_socket_handle_t* handle, const struct sockaddr_storage* remote_addr)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -1;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -1;
#else
- tnet_dtls_socket_t *socket = handle;
- int ret = 0, len;
- void* out_data;
-
- if (!socket) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(socket);
-
- // update remote address even if handshaking is completed
- if (remote_addr) {
- socket->remote.addr = *remote_addr;
- }
-
- if (socket->handshake_completed) {
- TSK_DEBUG_INFO("Handshake completed");
- ret = 0;
- goto bail;
- }
-
- if (!socket->handshake_started) {
- if ((ret = SSL_do_handshake(socket->ssl)) != 1) {
- switch ((ret = SSL_get_error(socket->ssl, ret))) {
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- case SSL_ERROR_NONE:
- break;
- default:
- TSK_DEBUG_ERROR("DTLS handshake failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_handshake_failed);
- ret = -2;
- goto bail;
- }
- }
- socket->handshake_started = (ret == SSL_ERROR_NONE); // TODO: reset for renegotiation
- }
-
- if ((len = (int)BIO_get_mem_data(socket->wbio, &out_data)) > 0 && out_data) {
- if (socket->handshake_storedata) { // e.g. when TURN is enabled we have to query handshaking data and sent it via the negotiated channel
- if ((int)socket->handshake_data.size < len) {
- if (!(socket->handshake_data.ptr = tsk_realloc(socket->handshake_data.ptr, len))) {
- socket->handshake_data.size = 0;
- socket->handshake_data.count = 0;
- ret = -5;
- goto bail;
- }
- socket->handshake_data.size = len;
- }
- socket->handshake_data.count = len;
- memcpy(socket->handshake_data.ptr, out_data, len);
- }
- else {
- int sentlen = 0;
- tnet_port_t port;
- tnet_ip_t ip;
- tsk_bool_t is_dgram = TNET_SOCKET_TYPE_IS_DGRAM(socket->wrapped_sock->type);
- const uint8_t *record_ptr, *records_ptr = out_data;
- tsk_size_t record_size;
- int records_len = len;
-
- tnet_get_sockip_n_port((const struct sockaddr *)&socket->remote.addr, &ip, &port);
- TSK_DEBUG_INFO("DTLS data handshake to send with len = %d, from(%.*s/%d) to(%.*s/%d)", len, (int)sizeof(socket->wrapped_sock->ip), socket->wrapped_sock->ip, socket->wrapped_sock->port, (int)sizeof(ip), ip, port);
-
- //!\ IP fragmentation issues must be avoided even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
- while (records_len > 0 && (ret = tnet_dtls_socket_get_record_first(records_ptr, (tsk_size_t)records_len, (const void**)&record_ptr, &record_size)) == 0) {
- if (is_dgram) {
- sentlen += tnet_sockfd_sendto(socket->wrapped_sock->fd, (const struct sockaddr *)&socket->remote.addr, record_ptr, record_size);
- }
- else {
- sentlen += tnet_socket_send_stream(socket->wrapped_sock, record_ptr, record_size);
- }
- records_len -= (int)record_size;
- records_ptr += record_size;
- }
- TSK_DEBUG_INFO("DTLS data handshake sent len = %d", sentlen);
- }
- }
-
- BIO_reset(socket->rbio);
- BIO_reset(socket->wbio);
-
- if ((socket->handshake_completed = SSL_is_init_finished(socket->ssl))) {
- TSK_DEBUG_INFO("DTLS handshake completed");
+ tnet_dtls_socket_t *socket = handle;
+ int ret = 0, len;
+ void* out_data;
+
+ if (!socket) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(socket);
+
+ // update remote address even if handshaking is completed
+ if (remote_addr) {
+ socket->remote.addr = *remote_addr;
+ }
+
+ if (socket->handshake_completed) {
+ TSK_DEBUG_INFO("Handshake completed");
+ ret = 0;
+ goto bail;
+ }
+
+ if (!socket->handshake_started) {
+ if ((ret = SSL_do_handshake(socket->ssl)) != 1) {
+ switch ((ret = SSL_get_error(socket->ssl, ret))) {
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_NONE:
+ break;
+ default:
+ TSK_DEBUG_ERROR("DTLS handshake failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_handshake_failed);
+ ret = -2;
+ goto bail;
+ }
+ }
+ socket->handshake_started = (ret == SSL_ERROR_NONE); // TODO: reset for renegotiation
+ }
+
+ if ((len = (int)BIO_get_mem_data(socket->wbio, &out_data)) > 0 && out_data) {
+ if (socket->handshake_storedata) { // e.g. when TURN is enabled we have to query handshaking data and sent it via the negotiated channel
+ if ((int)socket->handshake_data.size < len) {
+ if (!(socket->handshake_data.ptr = tsk_realloc(socket->handshake_data.ptr, len))) {
+ socket->handshake_data.size = 0;
+ socket->handshake_data.count = 0;
+ ret = -5;
+ goto bail;
+ }
+ socket->handshake_data.size = len;
+ }
+ socket->handshake_data.count = len;
+ memcpy(socket->handshake_data.ptr, out_data, len);
+ }
+ else {
+ int sentlen = 0;
+ tnet_port_t port;
+ tnet_ip_t ip;
+ tsk_bool_t is_dgram = TNET_SOCKET_TYPE_IS_DGRAM(socket->wrapped_sock->type);
+ const uint8_t *record_ptr, *records_ptr = out_data;
+ tsk_size_t record_size;
+ int records_len = len;
+
+ tnet_get_sockip_n_port((const struct sockaddr *)&socket->remote.addr, &ip, &port);
+ TSK_DEBUG_INFO("DTLS data handshake to send with len = %d, from(%.*s/%d) to(%.*s/%d)", len, (int)sizeof(socket->wrapped_sock->ip), socket->wrapped_sock->ip, socket->wrapped_sock->port, (int)sizeof(ip), ip, port);
+
+ //!\ IP fragmentation issues must be avoided even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
+ while (records_len > 0 && (ret = tnet_dtls_socket_get_record_first(records_ptr, (tsk_size_t)records_len, (const void**)&record_ptr, &record_size)) == 0) {
+ if (is_dgram) {
+ sentlen += tnet_sockfd_sendto(socket->wrapped_sock->fd, (const struct sockaddr *)&socket->remote.addr, record_ptr, record_size);
+ }
+ else {
+ sentlen += tnet_socket_send_stream(socket->wrapped_sock, record_ptr, record_size);
+ }
+ records_len -= (int)record_size;
+ records_ptr += record_size;
+ }
+ TSK_DEBUG_INFO("DTLS data handshake sent len = %d", sentlen);
+ }
+ }
+
+ BIO_reset(socket->rbio);
+ BIO_reset(socket->wbio);
+
+ if ((socket->handshake_completed = SSL_is_init_finished(socket->ssl))) {
+ TSK_DEBUG_INFO("DTLS handshake completed");
#if HAVE_OPENSSL_DTLS_SRTP
- if (socket->use_srtp){
+ if (socket->use_srtp) {
#if !defined(SRTP_MAX_KEY_LEN)
# define cipher_key_length (128 >> 3) // rfc5764 4.1.2. SRTP Protection Profiles
# define cipher_salt_length (112 >> 3) // rfc5764 4.1.2. SRTP Protection Profiles
- // "cipher_key_length" is also equal to srtp_profile_get_master_key_length(srtp_profile_aes128_cm_sha1_80)
- // "cipher_salt_length" is also srtp_profile_get_master_salt_length(srtp_profile_aes128_cm_sha1_80)
+ // "cipher_key_length" is also equal to srtp_profile_get_master_key_length(srtp_profile_aes128_cm_sha1_80)
+ // "cipher_salt_length" is also srtp_profile_get_master_salt_length(srtp_profile_aes128_cm_sha1_80)
# define SRTP_MAX_KEY_LEN (cipher_key_length + cipher_salt_length)
#endif /* SRTP_MAX_KEY_LEN */
#define EXTRACTOR_dtls_srtp_text "EXTRACTOR-dtls_srtp"
#define EXTRACTOR_dtls_srtp_text_len 19
- uint8_t keying_material[SRTP_MAX_KEY_LEN << 1];
- static const tsk_size_t keying_material_size = sizeof(keying_material);
- /*if(socket->use_srtp)*/{
- SRTP_PROTECTION_PROFILE *p = SSL_get_selected_srtp_profile(socket->ssl);
- if (!p) {
- TSK_DEBUG_ERROR("SSL_get_selected_srtp_profile() returned null [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- ret = -2;
- goto bail;
- }
- // alert user
- _tnet_dtls_socket_raise_event(socket, tnet_dtls_socket_event_type_dtls_srtp_profile_selected, p->name, tsk_strlen(p->name));
-
- memset(keying_material, 0, sizeof(keying_material));
-
- // rfc5764 - 4.2. Key Derivation
- ret = SSL_export_keying_material(socket->ssl, keying_material, sizeof(keying_material), EXTRACTOR_dtls_srtp_text, EXTRACTOR_dtls_srtp_text_len, tsk_null, 0, 0);
- if (ret != 1) {
- // alert listener
- _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_error);
- TSK_DEBUG_ERROR("SSL_export_keying_material() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- ret = -2;
- goto bail;
- }
- }
- // alert listener
- _tnet_dtls_socket_raise_event(socket, tnet_dtls_socket_event_type_dtls_srtp_data, keying_material, keying_material_size);
- }
+ uint8_t keying_material[SRTP_MAX_KEY_LEN << 1];
+ static const tsk_size_t keying_material_size = sizeof(keying_material);
+ /*if(socket->use_srtp)*/{
+ SRTP_PROTECTION_PROFILE *p = SSL_get_selected_srtp_profile(socket->ssl);
+ if (!p) {
+ TSK_DEBUG_ERROR("SSL_get_selected_srtp_profile() returned null [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -2;
+ goto bail;
+ }
+ // alert user
+ _tnet_dtls_socket_raise_event(socket, tnet_dtls_socket_event_type_dtls_srtp_profile_selected, p->name, tsk_strlen(p->name));
+
+ memset(keying_material, 0, sizeof(keying_material));
+
+ // rfc5764 - 4.2. Key Derivation
+ ret = SSL_export_keying_material(socket->ssl, keying_material, sizeof(keying_material), EXTRACTOR_dtls_srtp_text, EXTRACTOR_dtls_srtp_text_len, tsk_null, 0, 0);
+ if (ret != 1) {
+ // alert listener
+ _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_error);
+ TSK_DEBUG_ERROR("SSL_export_keying_material() failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -2;
+ goto bail;
+ }
+ }
+ // alert listener
+ _tnet_dtls_socket_raise_event(socket, tnet_dtls_socket_event_type_dtls_srtp_data, keying_material, keying_material_size);
+ }
#endif /* HAVE_OPENSSL_DTLS_SRTP */
- _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_handshake_succeed);
- }
- ret = 0; // clear "ret", error will directly jump to "bail:"
+ _tnet_dtls_socket_raise_event_dataless(socket, tnet_dtls_socket_event_type_handshake_succeed);
+ }
+ ret = 0; // clear "ret", error will directly jump to "bail:"
bail:
- tsk_safeobj_unlock(socket);
- return ret;
+ tsk_safeobj_unlock(socket);
+ return ret;
#endif
}
tsk_bool_t tnet_dtls_socket_is_handshake_completed(const tnet_dtls_socket_handle_t* handle)
{
- return (handle && ((const tnet_dtls_socket_t *)handle)->handshake_completed);
+ return (handle && ((const tnet_dtls_socket_t *)handle)->handshake_completed);
}
/*
@@ -678,79 +683,79 @@ Handles DTLS data received over the network using standard functions (e.g. recvf
int tnet_dtls_socket_handle_incoming_data(tnet_dtls_socket_handle_t* handle, const void* data, tsk_size_t size)
{
#if !HAVE_OPENSSL || !HAVE_OPENSSL_DTLS
- TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
- return -200;
+ TSK_DEBUG_ERROR("OpenSSL or DTLS not enabled");
+ return -200;
#else
- tnet_dtls_socket_t *socket = handle;
- int ret = 0;
-
- if (!socket || !data || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(socket);
-
- TSK_DEBUG_INFO("Receive DTLS data: %lu", (unsigned long)size);
-
- // BIO_reset(socket->rbio);
- // BIO_reset(socket->wbio);
-
- if (!socket->rbio || !socket->wbio) {
- TSK_DEBUG_ERROR("BIO not initialized yet");
- ret = -2;
- goto bail;
- }
-
- if ((ret = _tnet_dtls_socket_do_handshake(socket))) {
- goto bail;
- }
-
- if ((ret = BIO_write(socket->rbio, data, (int)size)) != size) {
- ret = SSL_get_error(socket->ssl, ret);
- TSK_DEBUG_ERROR("BIO_write(rbio, %lu) failed [%s]", (unsigned long)size, ERR_error_string(ERR_get_error(), tsk_null));
- ret = -1;
- goto bail;
- }
-
- /*if((ret = SSL_read(socket->ssl, (void*)data, size)) <= 0){
- switch((ret = SSL_get_error(socket->ssl, ret))){
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- case SSL_ERROR_NONE:
- break;
- default:
- {
- unsigned long sslErr = ERR_get_error();
- const uint8_t* pData = (const uint8_t*)data;
- TSK_DEBUG_ERROR("%lu = SSL_read(rbio, %u) failed [%s]", sslErr, size, ERR_error_string(ret, tsk_null));
- // try to understand what's going on
- // rfc6347 - 4.1. Record Layer
- // rfc6347 - 4.2.2. Handshake Message Format
- // rfc6347 - 4.3.2. Handshake Protocol
- if(size > 14 && pData[0] == 0x16){ // content-type=='Handshake'
- if(pData[13] == 0x01 && (socket->setup == tnet_dtls_setup_active || socket->setup == tnet_dtls_setup_actpass)){ // Handshake Type=='client Hello'
- TSK_DEBUG_INFO("DTLS engine was in client mode but we are receiving 'Client Hello' messages. This is a bug in the remote peer: Re-negotiating!");
- tnet_dtls_socket_set_setup(socket, tnet_dtls_setup_passive);
- break;
- }
- else if(pData[13] == 0x02 && (socket->setup == tnet_dtls_setup_passive || socket->setup == tnet_dtls_setup_actpass)){ // Handshake Type=='server Hello'
- TSK_DEBUG_INFO("DTLS engine was in server mode but we are receiving 'Server Hello' messages. This is a bug in the remote peer: Re-negotiating!");
- tnet_dtls_socket_set_setup(socket, tnet_dtls_setup_active);
- break;
- }
- }
- //return -1;
- break;
- }
- }
- }*/
-
- ret = _tnet_dtls_socket_do_handshake(socket);
+ tnet_dtls_socket_t *socket = handle;
+ int ret = 0;
+
+ if (!socket || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(socket);
+
+ TSK_DEBUG_INFO("Receive DTLS data: %lu", (unsigned long)size);
+
+ // BIO_reset(socket->rbio);
+ // BIO_reset(socket->wbio);
+
+ if (!socket->rbio || !socket->wbio) {
+ TSK_DEBUG_ERROR("BIO not initialized yet");
+ ret = -2;
+ goto bail;
+ }
+
+ if ((ret = _tnet_dtls_socket_do_handshake(socket))) {
+ goto bail;
+ }
+
+ if ((ret = BIO_write(socket->rbio, data, (int)size)) != size) {
+ ret = SSL_get_error(socket->ssl, ret);
+ TSK_DEBUG_ERROR("BIO_write(rbio, %lu) failed [%s]", (unsigned long)size, ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -1;
+ goto bail;
+ }
+
+ /*if((ret = SSL_read(socket->ssl, (void*)data, size)) <= 0){
+ switch((ret = SSL_get_error(socket->ssl, ret))){
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_NONE:
+ break;
+ default:
+ {
+ unsigned long sslErr = ERR_get_error();
+ const uint8_t* pData = (const uint8_t*)data;
+ TSK_DEBUG_ERROR("%lu = SSL_read(rbio, %u) failed [%s]", sslErr, size, ERR_error_string(ret, tsk_null));
+ // try to understand what's going on
+ // rfc6347 - 4.1. Record Layer
+ // rfc6347 - 4.2.2. Handshake Message Format
+ // rfc6347 - 4.3.2. Handshake Protocol
+ if(size > 14 && pData[0] == 0x16){ // content-type=='Handshake'
+ if(pData[13] == 0x01 && (socket->setup == tnet_dtls_setup_active || socket->setup == tnet_dtls_setup_actpass)){ // Handshake Type=='client Hello'
+ TSK_DEBUG_INFO("DTLS engine was in client mode but we are receiving 'Client Hello' messages. This is a bug in the remote peer: Re-negotiating!");
+ tnet_dtls_socket_set_setup(socket, tnet_dtls_setup_passive);
+ break;
+ }
+ else if(pData[13] == 0x02 && (socket->setup == tnet_dtls_setup_passive || socket->setup == tnet_dtls_setup_actpass)){ // Handshake Type=='server Hello'
+ TSK_DEBUG_INFO("DTLS engine was in server mode but we are receiving 'Server Hello' messages. This is a bug in the remote peer: Re-negotiating!");
+ tnet_dtls_socket_set_setup(socket, tnet_dtls_setup_active);
+ break;
+ }
+ }
+ //return -1;
+ break;
+ }
+ }
+ }*/
+
+ ret = _tnet_dtls_socket_do_handshake(socket);
bail:
- tsk_safeobj_unlock(socket);
- return ret;
+ tsk_safeobj_unlock(socket);
+ return ret;
#endif
}
@@ -760,47 +765,46 @@ bail:
//
static tsk_object_t* tnet_dtls_socket_ctor(tsk_object_t * self, va_list * app)
{
- tnet_dtls_socket_t *socket = self;
- if (socket){
- tsk_safeobj_init(socket);
- }
- return self;
+ tnet_dtls_socket_t *socket = self;
+ if (socket) {
+ tsk_safeobj_init(socket);
+ }
+ return self;
}
static tsk_object_t* tnet_dtls_socket_dtor(tsk_object_t * self)
{
- tnet_dtls_socket_t *socket = self;
- if (socket){
+ tnet_dtls_socket_t *socket = self;
+ if (socket) {
#if HAVE_OPENSSL
- if (socket->rbio) {
- //BIO_free(socket->rbio);
- socket->rbio = tsk_null;
- }
- if (socket->wbio) {
- //BIO_free(socket->wbio);
- socket->wbio = tsk_null;
- }
- if (socket->ssl) {
- SSL_shutdown(socket->ssl);
- // https://www.openssl.org/docs/crypto/BIO_s_bio.html
- // implicitly frees internal_bio
- SSL_free(socket->ssl);
- }
+ if (socket->rbio) {
+ //BIO_free(socket->rbio);
+ socket->rbio = tsk_null;
+ }
+ if (socket->wbio) {
+ //BIO_free(socket->wbio);
+ socket->wbio = tsk_null;
+ }
+ if (socket->ssl) {
+ SSL_shutdown(socket->ssl);
+ // https://www.openssl.org/docs/crypto/BIO_s_bio.html
+ // implicitly frees internal_bio
+ SSL_free(socket->ssl);
+ }
#endif
- TSK_FREE(socket->handshake_data.ptr);
- TSK_OBJECT_SAFE_FREE(socket->wrapped_sock);
- tsk_safeobj_deinit(socket);
+ TSK_FREE(socket->handshake_data.ptr);
+ TSK_OBJECT_SAFE_FREE(socket->wrapped_sock);
+ tsk_safeobj_deinit(socket);
- TSK_DEBUG_INFO("*** tnet_dtls_socket_t destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** tnet_dtls_socket_t destroyed ***");
+ }
+ return self;
}
-static const tsk_object_def_t tnet_dtls_socket_def_s =
-{
- sizeof(tnet_dtls_socket_t),
- tnet_dtls_socket_ctor,
- tnet_dtls_socket_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_dtls_socket_def_s = {
+ sizeof(tnet_dtls_socket_t),
+ tnet_dtls_socket_ctor,
+ tnet_dtls_socket_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_dtls_socket_def_t = &tnet_dtls_socket_def_s;
diff --git a/tinyNET/src/tls/tnet_dtls.h b/tinyNET/src/tls/tnet_dtls.h
index e5b518c..19bb074 100755
--- a/tinyNET/src/tls/tnet_dtls.h
+++ b/tinyNET/src/tls/tnet_dtls.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,15 +34,14 @@ struct tnet_socket_s;
typedef void tnet_dtls_socket_handle_t;
-typedef enum tnet_dtls_socket_event_type_e
-{
- tnet_dtls_socket_event_type_handshake_started,
- tnet_dtls_socket_event_type_handshake_succeed,
- tnet_dtls_socket_event_type_handshake_failed,
- tnet_dtls_socket_event_type_fingerprint_mismatch,
- tnet_dtls_socket_event_type_error,
- tnet_dtls_socket_event_type_dtls_srtp_profile_selected, /* SRTP_AES128_CM_SHA1_80 | SRTP_AES128_CM_SHA1_32 */
- tnet_dtls_socket_event_type_dtls_srtp_data, /* key||salt */
+typedef enum tnet_dtls_socket_event_type_e {
+ tnet_dtls_socket_event_type_handshake_started,
+ tnet_dtls_socket_event_type_handshake_succeed,
+ tnet_dtls_socket_event_type_handshake_failed,
+ tnet_dtls_socket_event_type_fingerprint_mismatch,
+ tnet_dtls_socket_event_type_error,
+ tnet_dtls_socket_event_type_dtls_srtp_profile_selected, /* SRTP_AES128_CM_SHA1_80 | SRTP_AES128_CM_SHA1_32 */
+ tnet_dtls_socket_event_type_dtls_srtp_data, /* key||salt */
}
tnet_dtls_socket_event_type_t;
diff --git a/tinyNET/src/tls/tnet_tls.c b/tinyNET/src/tls/tnet_tls.c
index 0ae520c..1904fa3 100755
--- a/tinyNET/src/tls/tnet_tls.c
+++ b/tinyNET/src/tls/tnet_tls.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2012 Mamadou Diop.
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,270 +34,266 @@
#define TNET_TLS_TIMEOUT 2000
#define TNET_TLS_RETRY_COUNT 10
-typedef struct tnet_tls_socket_s
-{
- TSK_DECLARE_OBJECT;
-
- tnet_fd_t fd; /* not owner: do not try to close */
+typedef struct tnet_tls_socket_s {
+ TSK_DECLARE_OBJECT;
+
+ tnet_fd_t fd; /* not owner: do not try to close */
#if HAVE_OPENSSL
- SSL *ssl;
+ SSL *ssl;
#endif
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tnet_tls_socket_t;
tsk_bool_t tnet_tls_is_supported()
{
#if HAVE_OPENSSL
- return tsk_true;
+ return tsk_true;
#else
- return tsk_false;
+ return tsk_false;
#endif
}
tnet_tls_socket_handle_t* tnet_tls_socket_create(tnet_fd_t fd, struct ssl_ctx_st* ssl_ctx)
{
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("OpenSSL not enabled");
- return tsk_null;
+ TSK_DEBUG_ERROR("OpenSSL not enabled");
+ return tsk_null;
#else
- tnet_tls_socket_t* socket;
- if(fd <= 0 || !ssl_ctx){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if((socket = tsk_object_new(tnet_tls_socket_def_t))){
- socket->fd = fd;
- if(!(socket->ssl = SSL_new(ssl_ctx))){
- TSK_DEBUG_ERROR("SSL_new(CTX) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- TSK_OBJECT_SAFE_FREE(socket);
- return tsk_null;
- }
- if(SSL_set_fd(socket->ssl, socket->fd) != 1){
- TSK_DEBUG_ERROR("SSL_set_fd(%d) failed [%s]", socket->fd, ERR_error_string(ERR_get_error(), tsk_null));
- TSK_OBJECT_SAFE_FREE(socket);
- return tsk_null;
- }
- }
- return socket;
+ tnet_tls_socket_t* socket;
+ if(fd <= 0 || !ssl_ctx) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if((socket = tsk_object_new(tnet_tls_socket_def_t))) {
+ socket->fd = fd;
+ if(!(socket->ssl = SSL_new(ssl_ctx))) {
+ TSK_DEBUG_ERROR("SSL_new(CTX) failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ TSK_OBJECT_SAFE_FREE(socket);
+ return tsk_null;
+ }
+ if(SSL_set_fd(socket->ssl, socket->fd) != 1) {
+ TSK_DEBUG_ERROR("SSL_set_fd(%d) failed [%s]", socket->fd, ERR_error_string(ERR_get_error(), tsk_null));
+ TSK_OBJECT_SAFE_FREE(socket);
+ return tsk_null;
+ }
+ }
+ return socket;
#endif
}
int tnet_tls_socket_connect(tnet_tls_socket_handle_t* self)
{
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("You MUST enable OpenSSL");
- return -200;
+ TSK_DEBUG_ERROR("You MUST enable OpenSSL");
+ return -200;
#else
- int ret;
- tnet_tls_socket_t* socket = self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = SSL_connect(socket->ssl)) != 1){
- ret = SSL_get_error(socket->ssl, ret);
- if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ || ret == SSL_ERROR_SYSCALL){
- ret = 0; /* up to the caller to check that the socket is writable and valid */
- }
- else{
- TSK_DEBUG_ERROR("SSL_connect failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
- }
- }
- else{
- ret = 0;
- }
-
- return ret;
+ int ret;
+ tnet_tls_socket_t* socket = self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = SSL_connect(socket->ssl)) != 1) {
+ ret = SSL_get_error(socket->ssl, ret);
+ if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ || ret == SSL_ERROR_SYSCALL) {
+ ret = 0; /* up to the caller to check that the socket is writable and valid */
+ }
+ else {
+ TSK_DEBUG_ERROR("SSL_connect failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
+ }
+ }
+ else {
+ ret = 0;
+ }
+
+ return ret;
#endif
}
int tnet_tls_socket_accept(tnet_tls_socket_handle_t* self)
{
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("You MUST enable OpenSSL");
- return -200;
+ TSK_DEBUG_ERROR("You MUST enable OpenSSL");
+ return -200;
#else
- int ret = -1;
- tnet_tls_socket_t* socket = self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = SSL_accept(socket->ssl)) != 1){
- ret = SSL_get_error(socket->ssl, ret);
- if(ret == SSL_ERROR_WANT_READ){
- int retval;
- fd_set rfds;
- while (1)
- {
- FD_ZERO(&rfds);
- FD_SET(socket->fd, &rfds);
- retval = select(socket->fd + 1, &rfds, NULL, NULL, NULL);
- if (retval == -1){
- TNET_PRINT_LAST_ERROR("select() failed");
- }
- else if (retval)
- {
- if (FD_ISSET(socket->fd, &rfds)){
- ret = SSL_accept(socket->ssl);
- ret = SSL_get_error(socket->ssl, ret);
- if (ret == SSL_ERROR_WANT_READ){
- continue;
- }
- else{
- if(ret == SSL_ERROR_NONE){
- return 0;
- }
- break;
- }
- }
- }
- else
- {
- break;
- }
- }
- }
- TSK_DEBUG_ERROR("SSL_accept() failed with error code [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
- return -3;
- }
-
- return 0;
+ int ret = -1;
+ tnet_tls_socket_t* socket = self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = SSL_accept(socket->ssl)) != 1) {
+ ret = SSL_get_error(socket->ssl, ret);
+ if(ret == SSL_ERROR_WANT_READ) {
+ int retval;
+ fd_set rfds;
+ while (1) {
+ FD_ZERO(&rfds);
+ FD_SET(socket->fd, &rfds);
+ retval = select(socket->fd + 1, &rfds, NULL, NULL, NULL);
+ if (retval == -1) {
+ TNET_PRINT_LAST_ERROR("select() failed");
+ }
+ else if (retval) {
+ if (FD_ISSET(socket->fd, &rfds)) {
+ ret = SSL_accept(socket->ssl);
+ ret = SSL_get_error(socket->ssl, ret);
+ if (ret == SSL_ERROR_WANT_READ) {
+ continue;
+ }
+ else {
+ if(ret == SSL_ERROR_NONE) {
+ return 0;
+ }
+ break;
+ }
+ }
+ }
+ else {
+ break;
+ }
+ }
+ }
+ TSK_DEBUG_ERROR("SSL_accept() failed with error code [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
+ return -3;
+ }
+
+ return 0;
#endif
}
int tnet_tls_socket_write(tnet_tls_socket_handle_t* self, const void* data, tsk_size_t size)
{
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("You MUST enable OpenSSL");
- return -200;
+ TSK_DEBUG_ERROR("You MUST enable OpenSSL");
+ return -200;
#else
- int ret = -1;
- tnet_tls_socket_t* socket = self;
- tsk_bool_t try_again = tsk_true, want_read, want_write;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* Write */
- tsk_safeobj_lock(socket);
- while(((ret = SSL_write(socket->ssl, data, (int)size)) <= 0) && try_again){
- ret = SSL_get_error(socket->ssl, ret);
- want_read = (ret == SSL_ERROR_WANT_READ);
- want_write = (ret == SSL_ERROR_WANT_WRITE);
-
- if(want_write || want_read){
- if(!(ret = tnet_sockfd_waitUntil(socket->fd, TNET_TLS_TIMEOUT, want_write))){
- continue;
- }
- }
- else{
- TSK_DEBUG_ERROR("SSL_write failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
- ret = -3;
- try_again = tsk_false;
- }
- }
- tsk_safeobj_unlock(socket);
-
- ret = (ret > 0) ? 0 : -3;
- return ret;
+ int ret = -1;
+ tnet_tls_socket_t* socket = self;
+ tsk_bool_t try_again = tsk_true, want_read, want_write;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* Write */
+ tsk_safeobj_lock(socket);
+ while(((ret = SSL_write(socket->ssl, data, (int)size)) <= 0) && try_again) {
+ ret = SSL_get_error(socket->ssl, ret);
+ want_read = (ret == SSL_ERROR_WANT_READ);
+ want_write = (ret == SSL_ERROR_WANT_WRITE);
+
+ if(want_write || want_read) {
+ if(!(ret = tnet_sockfd_waitUntil(socket->fd, TNET_TLS_TIMEOUT, want_write))) {
+ continue;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("SSL_write failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
+ ret = -3;
+ try_again = tsk_false;
+ }
+ }
+ tsk_safeobj_unlock(socket);
+
+ ret = (ret > 0) ? 0 : -3;
+ return ret;
#endif
}
int tnet_tls_socket_recv(tnet_tls_socket_handle_t* self, void** data, tsk_size_t *size, tsk_bool_t *isEncrypted)
{
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("You MUST enable OpenSSL");
- return -200;
+ TSK_DEBUG_ERROR("You MUST enable OpenSSL");
+ return -200;
#else
- int ret = -1;
- tsk_size_t read = 0;
- tsk_size_t to_read = *size;
- int rcount = TNET_TLS_RETRY_COUNT;
- tnet_tls_socket_t* socket = self;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(socket);
-
- *isEncrypted = SSL_is_init_finished(socket->ssl) ? tsk_false : tsk_true;
-
- /* SSL handshake has completed? */
- if(*isEncrypted){
- char* buffer[1024];
- if((ret = SSL_read(socket->ssl, buffer, sizeof(buffer))) <= 0){
- ret = SSL_get_error(socket->ssl, ret);
- if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ){
- ret = 0;
- }
- else{
- TSK_DEBUG_ERROR("SSL_read failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
- }
- *size = 0;
- }
- else{
- *size = ret;
- ret = 0;
- }
-
- goto bail;
- }
-
- /* Read Application data */
-ssl_read:
- if(rcount && ((ret = SSL_read(socket->ssl, (((uint8_t*)*data)+read), (int)to_read)) <= 0)){
- ret = SSL_get_error(socket->ssl, ret);
- if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ){
- if(!(ret = tnet_sockfd_waitUntil(socket->fd, TNET_TLS_TIMEOUT, (ret == SSL_ERROR_WANT_WRITE)))){
- rcount--;
- goto ssl_read;
- }
- }
- else if(SSL_ERROR_ZERO_RETURN){ /* connection closed: do nothing, the transport layer will be alerted. */
- *size = 0;
- ret = 0;
- TSK_DEBUG_INFO("TLS connection closed.");
- }
- else{
- TSK_DEBUG_ERROR("SSL_read failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
- }
- }
- else if(ret >=0){
- read += (tsk_size_t)ret;
-
- if((ret = SSL_pending(socket->ssl)) > 0){
- void *ptr;
- to_read = ret;
-
- if((ptr = tsk_realloc(*data, (read + to_read)))){
- *data = ptr;
- goto ssl_read;
- }
- }
- }
+ int ret = -1;
+ tsk_size_t read = 0;
+ tsk_size_t to_read = *size;
+ int rcount = TNET_TLS_RETRY_COUNT;
+ tnet_tls_socket_t* socket = self;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(socket);
+
+ *isEncrypted = SSL_is_init_finished(socket->ssl) ? tsk_false : tsk_true;
+
+ /* SSL handshake has completed? */
+ if(*isEncrypted) {
+ char* buffer[1024];
+ if((ret = SSL_read(socket->ssl, buffer, sizeof(buffer))) <= 0) {
+ ret = SSL_get_error(socket->ssl, ret);
+ if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ) {
+ ret = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("SSL_read failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
+ }
+ *size = 0;
+ }
+ else {
+ *size = ret;
+ ret = 0;
+ }
+
+ goto bail;
+ }
+
+ /* Read Application data */
+ssl_read:
+ if(rcount && ((ret = SSL_read(socket->ssl, (((uint8_t*)*data)+read), (int)to_read)) <= 0)) {
+ ret = SSL_get_error(socket->ssl, ret);
+ if(ret == SSL_ERROR_WANT_WRITE || ret == SSL_ERROR_WANT_READ) {
+ if(!(ret = tnet_sockfd_waitUntil(socket->fd, TNET_TLS_TIMEOUT, (ret == SSL_ERROR_WANT_WRITE)))) {
+ rcount--;
+ goto ssl_read;
+ }
+ }
+ else if(SSL_ERROR_ZERO_RETURN) { /* connection closed: do nothing, the transport layer will be alerted. */
+ *size = 0;
+ ret = 0;
+ TSK_DEBUG_INFO("TLS connection closed.");
+ }
+ else {
+ TSK_DEBUG_ERROR("SSL_read failed [%d, %s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
+ }
+ }
+ else if(ret >=0) {
+ read += (tsk_size_t)ret;
+
+ if((ret = SSL_pending(socket->ssl)) > 0) {
+ void *ptr;
+ to_read = ret;
+
+ if((ptr = tsk_realloc(*data, (read + to_read)))) {
+ *data = ptr;
+ goto ssl_read;
+ }
+ }
+ }
bail:
- tsk_safeobj_unlock(socket);
-
- if(read){
- *size = read;
- return 0;
- }
- else{
- return ret;
- }
+ tsk_safeobj_unlock(socket);
+
+ if(read) {
+ *size = read;
+ return 0;
+ }
+ else {
+ return ret;
+ }
#endif
}
@@ -309,34 +305,33 @@ bail:
//
static tsk_object_t* tnet_tls_socket_ctor(tsk_object_t * self, va_list * app)
{
- tnet_tls_socket_t *socket = self;
- if(socket){
- tsk_safeobj_init(socket);
- }
- return self;
+ tnet_tls_socket_t *socket = self;
+ if(socket) {
+ tsk_safeobj_init(socket);
+ }
+ return self;
}
static tsk_object_t* tnet_tls_socket_dtor(tsk_object_t * self)
-{
- tnet_tls_socket_t *socket = self;
- if(socket){
+{
+ tnet_tls_socket_t *socket = self;
+ if(socket) {
#if HAVE_OPENSSL
- if(socket->ssl){
- SSL_shutdown(socket->ssl);
- SSL_free(socket->ssl);
- }
+ if(socket->ssl) {
+ SSL_shutdown(socket->ssl);
+ SSL_free(socket->ssl);
+ }
#endif
- tsk_safeobj_deinit(socket);
- }
- return self;
+ tsk_safeobj_deinit(socket);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_tls_socket_def_s =
-{
- sizeof(tnet_tls_socket_t),
- tnet_tls_socket_ctor,
- tnet_tls_socket_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_tls_socket_def_s = {
+ sizeof(tnet_tls_socket_t),
+ tnet_tls_socket_ctor,
+ tnet_tls_socket_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_tls_socket_def_t = &tnet_tls_socket_def_s;
diff --git a/tinyNET/src/tls/tnet_tls.h b/tinyNET/src/tls/tnet_tls.h
index 5e00ec8..d7bacbc 100755
--- a/tinyNET/src/tls/tnet_tls.h
+++ b/tinyNET/src/tls/tnet_tls.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2012 Mamadou Diop.
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet.c b/tinyNET/src/tnet.c
index 25d763b..0bd15e0 100755
--- a/tinyNET/src/tnet.c
+++ b/tinyNET/src/tnet.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,7 +45,7 @@
*
* ======
*
-* - @ref tnet_socket_group
+* - @ref tnet_socket_group
* - @ref tnet_utils_group
* - @ref tnet_dhcp_group
* - @ref tnet_dhcp6_group
@@ -70,32 +70,32 @@ tsk_bool_t tnet_isBigEndian = tsk_false;
* You MUST call @ref tnet_cleanup to cleanup the network stack if you no longer need to use networking function.
*
* @sa @ref tnet_cleanup.
- * @return 0 if succeed and error code otherwise.
+ * @return 0 if succeed and error code otherwise.
**/
int tnet_startup()
{
- int err = 0;
- short word = 0x4321;
+ int err = 0;
+ short word = 0x4321;
+
+ if (__tnet_started) {
+ goto bail;
+ }
- if (__tnet_started) {
- goto bail;
- }
-
if ((err = tnet_proxy_node_plugin_register(tnet_proxy_node_socks_plugin_def_t)) != 0) {
goto bail;
}
- // rand()
- srand((unsigned int) tsk_time_epoch());
+ // rand()
+ srand((unsigned int) tsk_time_epoch());
- // endianness
- tnet_isBigEndian = ((*(int8_t *)&word) != 0x21);
+ // endianness
+ tnet_isBigEndian = ((*(int8_t *)&word) != 0x21);
#if TNET_UNDER_WINDOWS
- if (tnet_isBigEndian){
- TSK_DEBUG_ERROR("Big endian on Windows machine. Is it right?");
- }
+ if (tnet_isBigEndian) {
+ TSK_DEBUG_ERROR("Big endian on Windows machine. Is it right?");
+ }
#endif
- // Print messages regardless the debug level
+ // Print messages regardless the debug level
#if TNET_UNDER_WINDOWS_CE && (BUILD_TYPE_GE && SIN_CITY)
# define PRINT_INFO TSK_DEBUG_INFO
# define PRINT_ERROR TSK_DEBUG_ERROR
@@ -105,45 +105,45 @@ int tnet_startup()
#endif
#if TNET_UNDER_WINDOWS
- {
- WORD wVersionRequested;
- WSADATA wsaData;
-
- wVersionRequested = MAKEWORD(2, 2);
-
- err = WSAStartup(wVersionRequested, &wsaData);
- if (err != 0) {
- PRINT_ERROR("WSAStartup failed with error: %d", err);
- return -1;
- }
-
- if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
- PRINT_ERROR("Could not find a usable version of Winsock.dll");
- tnet_cleanup();
- return -2;
- }
- else {
- PRINT_INFO("The Winsock 2.2 dll was found okay");
- }
- }
+ {
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+ if (err != 0) {
+ PRINT_ERROR("WSAStartup failed with error: %d", err);
+ return -1;
+ }
+
+ if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
+ PRINT_ERROR("Could not find a usable version of Winsock.dll");
+ tnet_cleanup();
+ return -2;
+ }
+ else {
+ PRINT_INFO("The Winsock 2.2 dll was found okay");
+ }
+ }
#endif /* TNET_UNDER_WINDOWS */
#if HAVE_OPENSSL
- PRINT_INFO("SSL is enabled :)");
- SSL_library_init();
- OpenSSL_add_all_algorithms();
- SSL_load_error_strings();
+ PRINT_INFO("SSL is enabled :)");
+ SSL_library_init();
+ OpenSSL_add_all_algorithms();
+ SSL_load_error_strings();
- PRINT_INFO("DTLS supported: %s", tnet_dtls_is_supported() ? "yes" : "no");
- PRINT_INFO("DTLS-SRTP supported: %s", tnet_dtls_is_srtp_supported() ? "yes" : "no");
+ PRINT_INFO("DTLS supported: %s", tnet_dtls_is_supported() ? "yes" : "no");
+ PRINT_INFO("DTLS-SRTP supported: %s", tnet_dtls_is_srtp_supported() ? "yes" : "no");
#else
- PRINT_ERROR("SSL is disabled :(");
+ PRINT_ERROR("SSL is disabled :(");
#endif
-
- __tnet_started = tsk_true;
+
+ __tnet_started = tsk_true;
bail:
- return err;
+ return err;
}
@@ -155,20 +155,20 @@ bail:
**/
int tnet_cleanup()
{
- if (!__tnet_started){
- goto bail;
- }
-
+ if (!__tnet_started) {
+ goto bail;
+ }
+
tnet_proxy_node_plugin_unregister(tnet_proxy_node_socks_plugin_def_t);
#if TNET_UNDER_WINDOWS
- __tnet_started = tsk_false;
- return WSACleanup();
+ __tnet_started = tsk_false;
+ return WSACleanup();
#else
- __tnet_started = tsk_false;
+ __tnet_started = tsk_false;
#endif
bail:
- return 0;
+ return 0;
}
diff --git a/tinyNET/src/tnet.h b/tinyNET/src/tnet.h
index 92b8e53..94385cc 100755
--- a/tinyNET/src/tnet.h
+++ b/tinyNET/src/tnet.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet_auth.c b/tinyNET/src/tnet_auth.c
index 941db1e..e8cbcfb 100755
--- a/tinyNET/src/tnet_auth.c
+++ b/tinyNET/src/tnet_auth.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet_auth.h b/tinyNET/src/tnet_auth.h
index 1f9642e..36880fd 100755
--- a/tinyNET/src/tnet_auth.h
+++ b/tinyNET/src/tnet_auth.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet_endianness.c b/tinyNET/src/tnet_endianness.c
index 62f1708..f204f0e 100755
--- a/tinyNET/src/tnet_endianness.c
+++ b/tinyNET/src/tnet_endianness.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,20 +39,20 @@ extern tsk_bool_t tnet_isBigEndian;
*/
unsigned short tnet_htons(unsigned short x)
{
- if(tnet_is_BE()){
- return x;
- }
- else{
- return ((((uint16_t)(x) & 0xff00) >> 8) |
- (((uint16_t)(x) & 0x00ff) << 8));
- }
+ if(tnet_is_BE()) {
+ return x;
+ }
+ else {
+ return ((((uint16_t)(x) & 0xff00) >> 8) |
+ (((uint16_t)(x) & 0x00ff) << 8));
+ }
}
/* Memory alignment hack */
unsigned short tnet_htons_2(const void* px)
{
- unsigned short y = TSK_TO_UINT16((const uint8_t*)px);
- return tnet_htons(y);
+ unsigned short y = TSK_TO_UINT16((const uint8_t*)px);
+ return tnet_htons(y);
}
/** Converts a 32-bit value from host to TCP/IP network byte order (big-endian).
@@ -61,22 +61,22 @@ unsigned short tnet_htons_2(const void* px)
*/
unsigned long tnet_htonl(unsigned long x)
{
- if(tnet_is_BE()){
- return x;
- }
- else{
- return ((((uint32_t)(x) & 0xff000000) >> 24) | \
- (((uint32_t)(x) & 0x00ff0000) >> 8) | \
- (((uint32_t)(x) & 0x0000ff00) << 8) | \
- (((uint32_t)(x) & 0x000000ff) << 24));
- }
+ if(tnet_is_BE()) {
+ return x;
+ }
+ else {
+ return ((((uint32_t)(x) & 0xff000000) >> 24) | \
+ (((uint32_t)(x) & 0x00ff0000) >> 8) | \
+ (((uint32_t)(x) & 0x0000ff00) << 8) | \
+ (((uint32_t)(x) & 0x000000ff) << 24));
+ }
}
/* Memory alignment hack */
unsigned long tnet_htonl_2(const void* px)
{
- unsigned long y = TSK_TO_UINT32((const uint8_t*)px);
- return tnet_htonl(y);
+ unsigned long y = TSK_TO_UINT32((const uint8_t*)px);
+ return tnet_htonl(y);
}
/** Indicates whether we are on a Big Endian host or not.<br>
@@ -84,15 +84,16 @@ unsigned long tnet_htonl_2(const void* px)
* @ref tnet_startup().
* @retval @a tsk_true if the program is runnin on a Big Endian host and @a tsk_false otherwise.
*/
-tsk_bool_t tnet_is_BE(){
- /* If LITTLE_ENDIAN or BIG_ENDIAN macros have been defined in config.h ==> use them
- * otherwise ==> dyn retrieve the endianness
- */
+tsk_bool_t tnet_is_BE()
+{
+ /* If LITTLE_ENDIAN or BIG_ENDIAN macros have been defined in config.h ==> use them
+ * otherwise ==> dyn retrieve the endianness
+ */
#if LITTLE_ENDIAN
- return tsk_false;
+ return tsk_false;
#elif BIG_ENDIAN
- return tsk_true;
+ return tsk_true;
#else
- return tnet_isBigEndian;
+ return tnet_isBigEndian;
#endif
}
diff --git a/tinyNET/src/tnet_endianness.h b/tinyNET/src/tnet_endianness.h
index 80a1232..4e28e04 100755
--- a/tinyNET/src/tnet_endianness.h
+++ b/tinyNET/src/tnet_endianness.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet_hardwares.h b/tinyNET/src/tnet_hardwares.h
index 7d015b5..641e85d 100755
--- a/tinyNET/src/tnet_hardwares.h
+++ b/tinyNET/src/tnet_hardwares.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,24 +38,23 @@ TNET_BEGIN_DECLS
* List of Hardware types as assigned by the IANA.
* See RFC 1340, 826 and... for more information.
*/
-typedef enum tnet_hardware_type_e
-{
- tnet_htype_Ethernet_10Mb = 1, /**< Ethernet (10Mb) */
- tnet_htype_Ethernet_3Mb = 2, /**< Experimental Ethernet (3Mb) */
- tnet_htype_AX_25 = 3, /**< Amateur Radio AX.25 */
- tnet_htype_Token_Ring = 4, /**< Proteon ProNET Token Ring */
- tnet_htype_Chaos = 5, /**< Chaos */
- tnet_htype_IEEE_802_Networks = 6, /**< IEEE 802 Networks */
- tnet_htype_ARCNET = 7, /**< ARCNET */
- tnet_htype_Hyperchannel = 8, /**< Hyperchannel */
- tnet_htype_Lanstar = 9, /**< Lanstar */
- tnet_htype_Autonet_Short_Address = 10, /**< Autonet Short Address */
- tnet_htype_ALocalTalk = 11, /**< LocalTalk */
- tnet_htype_LocalNet= 12, /**< LocalNet (IBM PCNet or SYTEK LocalNET) */
- tnet_htype_Ultra_link = 13, /**< Ultra link */
- tnet_htype_SMDS = 14, /**< SMDS */
- tnet_htype_Frame_Relay = 15, /**< Frame Relay */
- tnet_htype_ATM = 16, /**< Asynchronous Transmission Mode (ATM) */
+typedef enum tnet_hardware_type_e {
+ tnet_htype_Ethernet_10Mb = 1, /**< Ethernet (10Mb) */
+ tnet_htype_Ethernet_3Mb = 2, /**< Experimental Ethernet (3Mb) */
+ tnet_htype_AX_25 = 3, /**< Amateur Radio AX.25 */
+ tnet_htype_Token_Ring = 4, /**< Proteon ProNET Token Ring */
+ tnet_htype_Chaos = 5, /**< Chaos */
+ tnet_htype_IEEE_802_Networks = 6, /**< IEEE 802 Networks */
+ tnet_htype_ARCNET = 7, /**< ARCNET */
+ tnet_htype_Hyperchannel = 8, /**< Hyperchannel */
+ tnet_htype_Lanstar = 9, /**< Lanstar */
+ tnet_htype_Autonet_Short_Address = 10, /**< Autonet Short Address */
+ tnet_htype_ALocalTalk = 11, /**< LocalTalk */
+ tnet_htype_LocalNet= 12, /**< LocalNet (IBM PCNet or SYTEK LocalNET) */
+ tnet_htype_Ultra_link = 13, /**< Ultra link */
+ tnet_htype_SMDS = 14, /**< SMDS */
+ tnet_htype_Frame_Relay = 15, /**< Frame Relay */
+ tnet_htype_ATM = 16, /**< Asynchronous Transmission Mode (ATM) */
}
tnet_hardware_type_t;
diff --git a/tinyNET/src/tnet_nat.c b/tinyNET/src/tnet_nat.c
index 53a009a..7e536c1 100755
--- a/tinyNET/src/tnet_nat.c
+++ b/tinyNET/src/tnet_nat.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,24 +40,23 @@
/**@defgroup tnet_nat_group NAT Traversal API (STUN, TURN and ICE).
*/
-typedef struct tnet_nat_ctx_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_nat_ctx_s {
+ TSK_DECLARE_OBJECT;
- tnet_socket_type_t socket_type;
+ tnet_socket_type_t socket_type;
- char* username; /**< The username to use to authenticate against the TURN/STUN server. */
- char* password; /**< The password to use to authenticate against the TURN/STUN server. */
+ char* username; /**< The username to use to authenticate against the TURN/STUN server. */
+ char* password; /**< The password to use to authenticate against the TURN/STUN server. */
- char* server_address; /**< TURN/STUN server address (could be FQDN or IP) */
- tnet_port_t server_port; /**< TURN/STUN server port. */
+ char* server_address; /**< TURN/STUN server address (could be FQDN or IP) */
+ tnet_port_t server_port; /**< TURN/STUN server port. */
- uint16_t RTO; /**< Estimate of the round-trip time (RTT) in millisecond. */
- uint16_t Rc; /**< Number of retransmissions for UDP in millisecond. */
+ uint16_t RTO; /**< Estimate of the round-trip time (RTT) in millisecond. */
+ uint16_t Rc; /**< Number of retransmissions for UDP in millisecond. */
- unsigned use_dnsquery:1; /**< Indicates whether to use DNS SRV query to find the stun/turn ip address. */
-
- tnet_stun_bindings_L_t *stun_bindings; /**< List of all STUN2 bindings associated to this context. */
+ unsigned use_dnsquery:1; /**< Indicates whether to use DNS SRV query to find the stun/turn ip address. */
+
+ tnet_stun_bindings_L_t *stun_bindings; /**< List of all STUN2 bindings associated to this context. */
}
tnet_nat_ctx_t;
@@ -67,88 +66,88 @@ tnet_nat_ctx_t;
*/
struct tnet_nat_ctx_s* tnet_nat_context_create(tnet_socket_type_t socket_type, const char* pc_username, const char* pc_password)
{
- extern const tsk_object_def_t *tnet_nat_context_def_t;
- struct tnet_nat_ctx_s* p_ctx;
-
- if (!(p_ctx = tsk_object_new(tnet_nat_context_def_t)) || !(p_ctx->stun_bindings = tsk_list_create())) {
- TSK_OBJECT_SAFE_FREE(p_ctx);
- TSK_DEBUG_ERROR("Failed to create NAT context");
- return tsk_null;
- }
-
- p_ctx->socket_type = socket_type;
- p_ctx->username = tsk_strdup(pc_username);
- p_ctx->password = tsk_strdup(pc_password);
- p_ctx->server_port = kStunPortDefaultTcpUdp;
- /* 7.2.1. Sending over UDP
- In fixed-line access links, a value of 500 ms is RECOMMENDED.
- */
- p_ctx->RTO = kStunRTO;
- /* 7.2.1. Sending over UDP
- Rc SHOULD be configurable and SHOULD have a default of 7.
- */
- p_ctx->Rc = kStunRC;
-
- return p_ctx;
+ extern const tsk_object_def_t *tnet_nat_context_def_t;
+ struct tnet_nat_ctx_s* p_ctx;
+
+ if (!(p_ctx = tsk_object_new(tnet_nat_context_def_t)) || !(p_ctx->stun_bindings = tsk_list_create())) {
+ TSK_OBJECT_SAFE_FREE(p_ctx);
+ TSK_DEBUG_ERROR("Failed to create NAT context");
+ return tsk_null;
+ }
+
+ p_ctx->socket_type = socket_type;
+ p_ctx->username = tsk_strdup(pc_username);
+ p_ctx->password = tsk_strdup(pc_password);
+ p_ctx->server_port = kStunPortDefaultTcpUdp;
+ /* 7.2.1. Sending over UDP
+ In fixed-line access links, a value of 500 ms is RECOMMENDED.
+ */
+ p_ctx->RTO = kStunRTO;
+ /* 7.2.1. Sending over UDP
+ Rc SHOULD be configurable and SHOULD have a default of 7.
+ */
+ p_ctx->Rc = kStunRC;
+
+ return p_ctx;
}
-/** Predicate function to find stun binding by id.
+/** Predicate function to find stun binding by id.
*
- * @param [in,out] item The current list item.
- * @param [in,out] id A pointer to the binding identifier.
+ * @param [in,out] item The current list item.
+ * @param [in,out] id A pointer to the binding identifier.
*
- * @return Zero if current list item hold a binding with the same id and -1 otherwise.
+ * @return Zero if current list item hold a binding with the same id and -1 otherwise.
**/
int __pred_find_stun_binding(const tsk_list_item_t* item, const void* id)
{
- if(item) {
- tnet_stun_binding_t *p_bind = item->data;
- if (p_bind) {
- tnet_stun_binding_id_t binding_id = *((tnet_stun_binding_id_t*)id);
- return (p_bind->id == binding_id) ? 0 : -1;
- }
- }
- return -1;
+ if(item) {
+ tnet_stun_binding_t *p_bind = item->data;
+ if (p_bind) {
+ tnet_stun_binding_id_t binding_id = *((tnet_stun_binding_id_t*)id);
+ return (p_bind->id == binding_id) ? 0 : -1;
+ }
+ }
+ return -1;
}
/**@ingroup tnet_nat_group
*
* Sets the address of the STUN/TURN server.
*
- * @param [in,out] p_self The NAT context.
- * @param [in,out] pc_server_address The address of server.
+ * @param [in,out] p_self The NAT context.
+ * @param [in,out] pc_server_address The address of server.
*
- * @return Zero if succeed and non zero error code otherwise.
+ * @return Zero if succeed and non zero error code otherwise.
**/
int tnet_nat_set_server_address(struct tnet_nat_ctx_s* p_self, const char* pc_server_address)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_strupdate(&(p_self->server_address), pc_server_address);
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_strupdate(&(p_self->server_address), pc_server_address);
+ return 0;
}
/**@ingroup tnet_nat_group
*
* Sets the address and port of the STUN/TURN server.
*
- * @param [in,out] p_self The NAT context.
- * @param [in,out] pc_server_address The address of server.
- * @param u_server_port The server port.
+ * @param [in,out] p_self The NAT context.
+ * @param [in,out] pc_server_address The address of server.
+ * @param u_server_port The server port.
*
- * @return Zero if succeed and non zero error code otherwise.
+ * @return Zero if succeed and non zero error code otherwise.
**/
int tnet_nat_set_server(struct tnet_nat_ctx_s* p_self, const char* pc_server_address, tnet_port_t u_server_port)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_strupdate(&(p_self->server_address), pc_server_address);
- p_self->server_port = u_server_port;
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_strupdate(&(p_self->server_address), pc_server_address);
+ p_self->server_port = u_server_port;
+ return 0;
}
/**@ingroup tnet_nat_group
@@ -156,7 +155,7 @@ int tnet_nat_set_server(struct tnet_nat_ctx_s* p_self, const char* pc_server_add
* Creates and sends a STUN2 binding request to the STUN/TURN server in order to get the server reflexive
* address associated to this file descriptor (or socket). The caller should call @ref tnet_nat_stun_unbind to destroy the binding.
*
- * @param [in,out] p_self The NAT context.
+ * @param [in,out] p_self The NAT context.
* @param localFD The local file descriptor (or socket) for which to get the reflexive server address.
*
* @return A valid binding id if succeed and @ref kStunBindingInvalidId otherwise. If the returned id is valid then
@@ -166,13 +165,13 @@ int tnet_nat_set_server(struct tnet_nat_ctx_s* p_self, const char* pc_server_add
**/
tnet_stun_binding_id_t tnet_nat_stun_bind(const struct tnet_nat_ctx_s* p_self, const tnet_fd_t localFD)
{
- tnet_stun_binding_id_t id = kStunBindingInvalidId;
- tnet_stun_binding_t *p_binding = tsk_null;
- int ret;
- if (!p_self || localFD == TNET_INVALID_FD) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
+ tnet_stun_binding_id_t id = kStunBindingInvalidId;
+ tnet_stun_binding_t *p_binding = tsk_null;
+ int ret;
+ if (!p_self || localFD == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
if ((ret = tnet_stun_binding_create(localFD, p_self->socket_type, p_self->server_address, p_self->server_port, p_self->username, p_self->password, &p_binding))) {
goto bail;
}
@@ -183,7 +182,7 @@ tnet_stun_binding_id_t tnet_nat_stun_bind(const struct tnet_nat_ctx_s* p_self, c
tsk_list_push_back_data(p_self->stun_bindings, (void**)&p_binding);
bail:
- TSK_OBJECT_SAFE_FREE(p_binding);
+ TSK_OBJECT_SAFE_FREE(p_binding);
return id;
}
@@ -198,19 +197,19 @@ bail:
**/
int tnet_nat_stun_send_bind(const struct tnet_nat_ctx_s* pc_self, struct tnet_stun_binding_s *p_binding)
{
- int ret = -1;
+ int ret = -1;
tnet_stun_pkt_resp_t *p_pkt_resp = tsk_null;
tnet_stun_pkt_req_t *p_pkt_req = tsk_null;
- if (!pc_self || !p_binding) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!pc_self || !p_binding) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!TNET_SOCKET_TYPE_IS_DGRAM(p_binding->socket_type)) {
- TSK_DEBUG_ERROR("Only DGRAM could be used for STUN transport");
- return -2;
- }
+ if (!TNET_SOCKET_TYPE_IS_DGRAM(p_binding->socket_type)) {
+ TSK_DEBUG_ERROR("Only DGRAM could be used for STUN transport");
+ return -2;
+ }
if ((ret = tnet_stun_binding_create_req(p_binding, &p_pkt_req))) {
goto bail;
@@ -225,51 +224,51 @@ int tnet_nat_stun_send_bind(const struct tnet_nat_ctx_s* pc_self, struct tnet_st
authentication or message integrity applied.
*/
stun_phase0: {
- if ((ret = tnet_stun_utils_send_unreliably(p_binding->localFD, pc_self->RTO, pc_self->Rc, p_pkt_req, (struct sockaddr*)&p_binding->addr_server, &p_pkt_resp))) {
- goto bail;
- }
+ if ((ret = tnet_stun_utils_send_unreliably(p_binding->localFD, pc_self->RTO, pc_self->Rc, p_pkt_req, (struct sockaddr*)&p_binding->addr_server, &p_pkt_resp))) {
+ goto bail;
+ }
if (p_pkt_resp) {
if (TNET_STUN_PKT_RESP_IS_ERROR(p_pkt_resp)) {
- uint16_t u_code;
- if ((ret = tnet_stun_pkt_get_errorcode(p_pkt_resp, &u_code))) {
- goto bail;
- }
- if (u_code == kStunErrCodeUnauthorized || u_code == kStunErrCodeStaleNonce) {
- if (u_code == kStunErrCodeUnauthorized) {
- // Make sure this is not an authentication failure (#2 401)
- // Do not send another req to avoid endless messages
- if ((tnet_stun_pkt_attr_exists(p_pkt_req, tnet_stun_attr_type_message_integrity))) { // already has a MESSAGE-INTEGRITY?
- TSK_DEBUG_ERROR("STUN authentication failed");
- goto bail;
- }
- }
- if ((ret = tnet_stun_pkt_auth_prepare_2(p_pkt_req, p_binding->p_username, p_binding->p_password, p_pkt_resp))) {
- goto bail;
- }
- // Try to send again now that authinfo is up2date
- goto stun_phase0;
- }
- else if (u_code == kStunErrCodeUnknownAttributes) {
- if((ret = tnet_stun_pkt_process_err420(p_pkt_req, p_pkt_resp))) {
- goto bail;
- }
- // Try to send again now that authinfo is up2date
- goto stun_phase0;
- }
- ret = -3;
+ uint16_t u_code;
+ if ((ret = tnet_stun_pkt_get_errorcode(p_pkt_resp, &u_code))) {
+ goto bail;
+ }
+ if (u_code == kStunErrCodeUnauthorized || u_code == kStunErrCodeStaleNonce) {
+ if (u_code == kStunErrCodeUnauthorized) {
+ // Make sure this is not an authentication failure (#2 401)
+ // Do not send another req to avoid endless messages
+ if ((tnet_stun_pkt_attr_exists(p_pkt_req, tnet_stun_attr_type_message_integrity))) { // already has a MESSAGE-INTEGRITY?
+ TSK_DEBUG_ERROR("STUN authentication failed");
+ goto bail;
+ }
+ }
+ if ((ret = tnet_stun_pkt_auth_prepare_2(p_pkt_req, p_binding->p_username, p_binding->p_password, p_pkt_resp))) {
+ goto bail;
+ }
+ // Try to send again now that authinfo is up2date
+ goto stun_phase0;
+ }
+ else if (u_code == kStunErrCodeUnknownAttributes) {
+ if((ret = tnet_stun_pkt_process_err420(p_pkt_req, p_pkt_resp))) {
+ goto bail;
+ }
+ // Try to send again now that authinfo is up2date
+ goto stun_phase0;
+ }
+ ret = -3;
}
else {
- const tnet_stun_attr_address_t* pc_addr;
- if ((ret = tnet_stun_pkt_attr_find_first(p_pkt_resp, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t**)&pc_addr)) == 0 && pc_addr) {
- TSK_OBJECT_SAFE_FREE(p_binding->p_xmaddr);
- p_binding->p_xmaddr = tsk_object_ref(TSK_OBJECT(pc_addr));
- }
- if ((ret = tnet_stun_pkt_attr_find_first(p_pkt_resp, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t**)&pc_addr)) == 0 && pc_addr) {
- TSK_OBJECT_SAFE_FREE(p_binding->p_maddr);
- p_binding->p_maddr = tsk_object_ref(TSK_OBJECT(pc_addr));
- }
- }
+ const tnet_stun_attr_address_t* pc_addr;
+ if ((ret = tnet_stun_pkt_attr_find_first(p_pkt_resp, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t**)&pc_addr)) == 0 && pc_addr) {
+ TSK_OBJECT_SAFE_FREE(p_binding->p_xmaddr);
+ p_binding->p_xmaddr = tsk_object_ref(TSK_OBJECT(pc_addr));
+ }
+ if ((ret = tnet_stun_pkt_attr_find_first(p_pkt_resp, tnet_stun_attr_type_mapped_address, (const tnet_stun_attr_t**)&pc_addr)) == 0 && pc_addr) {
+ TSK_OBJECT_SAFE_FREE(p_binding->p_maddr);
+ p_binding->p_maddr = tsk_object_ref(TSK_OBJECT(pc_addr));
+ }
+ }
}
}
/* END OF stun_phase0 */
@@ -285,51 +284,51 @@ bail:
* Gets the server reflexive address associated to this STUN2 binding.
*
*
- * @param [in,out] p_self The NAT context.
- * @param id The id of the STUN2 binding conetxt (obtained using @ref tnet_nat_stun_bind) holding the server-reflexive address.
- * @param [in,out] pp_ip The reflexive IP address. It is up the the caller to free the returned string
- * @param [in,out] pu_port The reflexive port.
+ * @param [in,out] p_self The NAT context.
+ * @param id The id of the STUN2 binding conetxt (obtained using @ref tnet_nat_stun_bind) holding the server-reflexive address.
+ * @param [in,out] pp_ip The reflexive IP address. It is up the the caller to free the returned string
+ * @param [in,out] pu_port The reflexive port.
*
- * @return Zero if succeed and non zero error code otherwise.
+ * @return Zero if succeed and non zero error code otherwise.
**/
int tnet_nat_stun_get_reflexive_address(const struct tnet_nat_ctx_s* p_self, tnet_stun_binding_id_t id, char** pp_ip, tnet_port_t *pu_port)
{
- const tsk_list_item_t* item;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!pp_ip && !pu_port) {
- return 0;
- }
-
- if ((item = tsk_list_find_item_by_pred(p_self->stun_bindings, __pred_find_stun_binding, &id)) && item->data) {
- const tnet_stun_binding_t *pc_bind = (const tnet_stun_binding_t *)item->data;
- const struct tnet_stun_attr_address_s *pc_addr = pc_bind->p_xmaddr ? pc_bind->p_xmaddr : pc_bind->p_maddr;
- if (pc_addr) {
- tnet_ip_t ip;
- int ret;
- if ((ret = tnet_stun_utils_inet_ntop((pc_addr->e_family == tnet_stun_address_family_ipv6), &pc_addr->address, &ip))) {
- return ret;
- }
- if (pp_ip) {
- tsk_strupdate(pp_ip, ip);
- }
- if (pu_port) {
- *pu_port = pc_addr->u_port;
- }
- return 0;
- }
- }
- return -2;
+ const tsk_list_item_t* item;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!pp_ip && !pu_port) {
+ return 0;
+ }
+
+ if ((item = tsk_list_find_item_by_pred(p_self->stun_bindings, __pred_find_stun_binding, &id)) && item->data) {
+ const tnet_stun_binding_t *pc_bind = (const tnet_stun_binding_t *)item->data;
+ const struct tnet_stun_attr_address_s *pc_addr = pc_bind->p_xmaddr ? pc_bind->p_xmaddr : pc_bind->p_maddr;
+ if (pc_addr) {
+ tnet_ip_t ip;
+ int ret;
+ if ((ret = tnet_stun_utils_inet_ntop((pc_addr->e_family == tnet_stun_address_family_ipv6), &pc_addr->address, &ip))) {
+ return ret;
+ }
+ if (pp_ip) {
+ tsk_strupdate(pp_ip, ip);
+ }
+ if (pu_port) {
+ *pu_port = pc_addr->u_port;
+ }
+ return 0;
+ }
+ }
+ return -2;
}
/**@ingroup tnet_nat_group
*
* Removes a STUN2 binding from the NAT context.
*
- * @param [in,out] p_self The NAT context from which to remove the STUN2 binding.
- * @param id The id of the STUN2 binding to remove.
+ * @param [in,out] p_self The NAT context from which to remove the STUN2 binding.
+ * @param id The id of the STUN2 binding to remove.
*
* @return Zero if succeed and non zero error code otherwise.
*
@@ -338,12 +337,12 @@ int tnet_nat_stun_get_reflexive_address(const struct tnet_nat_ctx_s* p_self, tne
**/
int tnet_nat_stun_unbind(const struct tnet_nat_ctx_s* p_self, tnet_stun_binding_id_t id)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_remove_item_by_pred(p_self->stun_bindings, __pred_find_stun_binding, &id);
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_remove_item_by_pred(p_self->stun_bindings, __pred_find_stun_binding, &id);
+ return 0;
}
@@ -352,30 +351,29 @@ int tnet_nat_stun_unbind(const struct tnet_nat_ctx_s* p_self, tnet_stun_binding_
//
static tsk_object_t* tnet_nat_context_ctor(tsk_object_t * self, va_list * app)
{
- tnet_nat_ctx_t *p_ctx = (tnet_nat_ctx_t*)self;
- if (p_ctx) {
- }
- return self;
+ tnet_nat_ctx_t *p_ctx = (tnet_nat_ctx_t*)self;
+ if (p_ctx) {
+ }
+ return self;
}
static tsk_object_t* tnet_nat_context_dtor(tsk_object_t * self)
-{
- tnet_nat_ctx_t *p_ctx = (tnet_nat_ctx_t*)self;
- if (p_ctx) {
- TSK_FREE(p_ctx->username);
- TSK_FREE(p_ctx->password);
- TSK_FREE(p_ctx->server_address);
-
- TSK_OBJECT_SAFE_FREE(p_ctx->stun_bindings);
- TSK_DEBUG_INFO("*** NAT context destroyed ***");
- }
-
- return self;
-}
-static const tsk_object_def_t tnet_nat_context_def_s =
{
- sizeof(tnet_nat_ctx_t),
- tnet_nat_context_ctor,
- tnet_nat_context_dtor,
- tsk_null,
+ tnet_nat_ctx_t *p_ctx = (tnet_nat_ctx_t*)self;
+ if (p_ctx) {
+ TSK_FREE(p_ctx->username);
+ TSK_FREE(p_ctx->password);
+ TSK_FREE(p_ctx->server_address);
+
+ TSK_OBJECT_SAFE_FREE(p_ctx->stun_bindings);
+ TSK_DEBUG_INFO("*** NAT context destroyed ***");
+ }
+
+ return self;
+}
+static const tsk_object_def_t tnet_nat_context_def_s = {
+ sizeof(tnet_nat_ctx_t),
+ tnet_nat_context_ctor,
+ tnet_nat_context_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_nat_context_def_t = &tnet_nat_context_def_s;
diff --git a/tinyNET/src/tnet_nat.h b/tinyNET/src/tnet_nat.h
index 46d774f..626851d 100755
--- a/tinyNET/src/tnet_nat.h
+++ b/tinyNET/src/tnet_nat.h
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyNET/src/tnet_poll.c b/tinyNET/src/tnet_poll.c
index 816f9c6..ebde819 100755
--- a/tinyNET/src/tnet_poll.c
+++ b/tinyNET/src/tnet_poll.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,11 +25,11 @@
/**
*
- * @brief poll() method implementation for multiplexing network sockets.
+ * @brief poll() method implementation for multiplexing network sockets.
*
- * @param fds An array of pollfd structures.
- * @param nfds The number of file descriptors set in fds[ ].
- * @param timeout How long poll() should wait for an event to occur (in milliseconds).
+ * @param fds An array of pollfd structures.
+ * @param nfds The number of file descriptors set in fds[ ].
+ * @param timeout How long poll() should wait for an event to occur (in milliseconds).
*
* @return The number of elements in fdarray for which an revents member of the POLLFD structure is nonzero.
* If the the returned value if <0 this mean that error occurred.
@@ -37,71 +37,71 @@
int tnet_poll(tnet_pollfd_t fds[ ], tnet_nfds_t nfds, int timeout)
{
- tsk_size_t i;
- int ret;
- int highest_fd = -1;
+ tsk_size_t i;
+ int ret;
+ int highest_fd = -1;
+
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptfds;
+ struct timeval timetowait;
+
+ /*
+ * cleanup fd_sets
+ */
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
- fd_set readfds;
- fd_set writefds;
- fd_set exceptfds;
- struct timeval timetowait;
+ /*
+ * set timeout
+ */
+ if(timeout >=0) {
+ timetowait.tv_sec = (timeout/1000);
+ timetowait.tv_usec = (timeout%1000) * 1000;
+ }
- /*
- * cleanup fd_sets
- */
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
+ /*
+ * add descriptors to the fd_sets
+ */
+ for(i = 0; i<nfds; i++) {
+ if(fds[i].fd != TNET_INVALID_FD) {
+ if(fds[i].events & TNET_POLLIN) {
+ FD_SET(fds[i].fd, &readfds);
+ }
+ if(fds[i].events & TNET_POLLOUT) {
+ FD_SET(fds[i].fd, &writefds);
+ }
+ if(fds[i].events & TNET_POLLPRI) {
+ FD_SET(fds[i].fd, &exceptfds);
+ }
+ }
- /*
- * set timeout
- */
- if(timeout >=0){
- timetowait.tv_sec = (timeout/1000);
- timetowait.tv_usec = (timeout%1000) * 1000;
- }
+ highest_fd = (highest_fd < fds[i].fd) ? fds[i].fd : highest_fd;
+ }
- /*
- * add descriptors to the fd_sets
- */
- for(i = 0; i<nfds; i++){
- if(fds[i].fd != TNET_INVALID_FD){
- if(fds[i].events & TNET_POLLIN){
- FD_SET(fds[i].fd, &readfds);
- }
- if(fds[i].events & TNET_POLLOUT){
- FD_SET(fds[i].fd, &writefds);
- }
- if(fds[i].events & TNET_POLLPRI){
- FD_SET(fds[i].fd, &exceptfds);
- }
- }
-
- highest_fd = (highest_fd < fds[i].fd) ? fds[i].fd : highest_fd;
- }
-
- /*======================================
- * select
- */
- if((ret = select(highest_fd + 1, &readfds, &writefds, &exceptfds, (timeout >=0) ? &timetowait : 0)) >= 0){
- for(i = 0; i<nfds; i++){
- if(fds[i].fd != TNET_INVALID_FD){
- fds[i].revents = 0;
+ /*======================================
+ * select
+ */
+ if((ret = select(highest_fd + 1, &readfds, &writefds, &exceptfds, (timeout >=0) ? &timetowait : 0)) >= 0) {
+ for(i = 0; i<nfds; i++) {
+ if(fds[i].fd != TNET_INVALID_FD) {
+ fds[i].revents = 0;
- if(FD_ISSET(fds[i].fd, &readfds)){
- fds[i].revents |= TNET_POLLIN;
- }
- if(FD_ISSET(fds[i].fd, &writefds)){
- fds[i].revents |= TNET_POLLOUT;
- }
- if(FD_ISSET(fds[i].fd, &exceptfds)){
- fds[i].revents |= TNET_POLLPRI;
- }
- }
- }
- }
+ if(FD_ISSET(fds[i].fd, &readfds)) {
+ fds[i].revents |= TNET_POLLIN;
+ }
+ if(FD_ISSET(fds[i].fd, &writefds)) {
+ fds[i].revents |= TNET_POLLOUT;
+ }
+ if(FD_ISSET(fds[i].fd, &exceptfds)) {
+ fds[i].revents |= TNET_POLLPRI;
+ }
+ }
+ }
+ }
- return ret;
+ return ret;
}
#endif /* TNET_USE_POLL */
diff --git a/tinyNET/src/tnet_poll.h b/tinyNET/src/tnet_poll.h
index becd1c3..a9c4a0f 100755
--- a/tinyNET/src/tnet_poll.h
+++ b/tinyNET/src/tnet_poll.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,7 +44,7 @@ typedef unsigned long tnet_nfds_t;
typedef struct pollfd tnet_pollfd_t;
-#define TNET_POLLRDNORM POLLRDNORM
+#define TNET_POLLRDNORM POLLRDNORM
#define TNET_POLLRDBAND POLLRDBAND
#define TNET_POLLIN POLLIN
#define TNET_POLLPRI POLLPRI
@@ -65,8 +65,7 @@ typedef struct pollfd tnet_pollfd_t;
#else
-typedef struct tnet_pollfd_s
-{
+typedef struct tnet_pollfd_s {
tnet_fd_t fd;
short events;
short revents;
diff --git a/tinyNET/src/tnet_proto.h b/tinyNET/src/tnet_proto.h
index ef7d89e..3365989 100755
--- a/tinyNET/src/tnet_proto.h
+++ b/tinyNET/src/tnet_proto.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,156 +37,155 @@ TNET_BEGIN_DECLS
/**
* @enum tnet_proto_e
*
- * @brief List of all assigned protocols as defined by the IANA
+ * @brief List of all assigned protocols as defined by the IANA
(http://www.iana.org/assignments/protocol-numbers/).
**/
-typedef enum tnet_proto_e
-{
- TNET_PROTO_HOPOPT = 0, /**< HOPOPT IPv6 Hop-by-Hop Option [RFC1883] */
- TNET_PROTO_ICMP = 1, /**< ICMP Internet Control Message [RFC792] */
- TNET_PROTO_IGMP = 2, /**< IGMP Internet Group Management [RFC1112] */
- TNET_PROTO_GGP = 3, /**< GGP Gateway-to-Gateway [RFC823] */
- TNET_PROTO_IP = 4, /**< IP IP in IP (encapsulation) [RFC2003] */
- TNET_PROTO_ST = 5, /**< ST Stream [RFC1190][RFC1819] */
- TNET_PROTO_TCP = 6, /**< TCP Transmission Control [RFC793] */
- TNET_PROTO_CBT = 7, /**< CBT CBT [Ballardie] */
- TNET_PROTO_EGP = 8, /**< EGP Exterior Gateway Protocol [RFC888][DLM1] */
- TNET_PROTO_IGP = 9, /**< IGP any private interior gateway [IANA](used by Cisco for their IGRP) */
- TNET_PROTO_BBN_RCC_MON = 10, /**< BBN-RCC-MON BBN RCC Monitoring [SGC] */
- TNET_PROTO_NVP_II = 11, /**< NVP-II Network Voice Protocol [RFC741][SC3] */
- TNET_PROTO_PUP = 12, /**< PUP PUP [PUP][XEROX] */
- TNET_PROTO_ARGUS = 13, /**< ARGUS ARGUS [RWS4] */
- TNET_PROTO_EMCON = 14, /**< EMCON EMCON [BN7] */
- TNET_PROTO_XNET = 15, /**< XNET Cross Net Debugger [IEN158][JFH2] */
- TNET_PROTO_CHAOS = 16, /**< CHAOS Chaos [NC3] */
- TNET_PROTO_UDP = 17, /**< UDP User Datagram [RFC768][JBP] */
- TNET_PROTO_MUX = 18, /**< MUX Multiplexing [IEN90][JBP] */
- TNET_PROTO_DCN_MEAS = 19, /**< DCN-MEAS DCN Measurement Subsystems [DLM1] */
- TNET_PROTO_HMP = 20, /**< HMP Host Monitoring [RFC869][RH6] */
- TNET_PROTO_PRM = 21, /**< PRM Packet Radio Measurement [ZSU] */
- TNET_PROTO_XNS_IDP = 22, /**< XNS-IDP XEROX NS IDP [ETHERNET][XEROX] */
- TNET_PROTO_TRUNK_1 = 23, /**< TRUNK-1 Trunk-1 [BWB6] */
- TNET_PROTO_TRUNK_2 = 24, /**< TRUNK-2 Trunk-2 [BWB6] */
- TNET_PROTO_LEAF_1 = 25, /**< LEAF-1 Leaf-1 [BWB6] */
- TNET_PROTO_LEAF_2 = 26, /**< LEAF-2 Leaf-2 [BWB6] */
- TNET_PROTO_RDP = 27, /**< RDP Reliable Data Protocol [RFC908][RH6] */
- TNET_PROTO_IRTP = 28, /**< IRTP Internet Reliable Transaction [RFC938][TXM] */
- TNET_PROTO_ISO_TP4 = 29, /**< ISO-TP4 ISO Transport Protocol Class 4 [RFC905][RC77] */
- TNET_PROTO_NETBLT = 30, /**< NETBLT Bulk Data Transfer Protocol [RFC969][DDC1] */
- TNET_PROTO_MFE_NSP = 31, /**< MFE-NSP MFE Network Services Protocol [MFENET][BCH2] */
- TNET_PROTO_MERIT_INP = 32, /**< MERIT-INP MERIT Internodal Protocol [HWB] */
- TNET_PROTO_DCCP = 33, /**< DCCP Datagram Congestion Control Protocol [RFC4340] */
- TNET_PROTO_3PC = 34, /**< 3PC Third Party Connect Protocol [SAF3] */
- TNET_PROTO_IDPR = 35, /**< IDPR Inter-Domain Policy Routing Protocol [MXS1] */
- TNET_PROTO_XTP = 36, /**< XTP XTP [GXC] */
- TNET_PROTO_DDP = 37, /**< DDP Datagram Delivery Protocol [WXC] */
- TNET_PROTO_IDPR_CMTP = 38, /**< IDPR-CMTP IDPR Control Message Transport Proto [MXS1] */
- TNET_PROTO_TP_PP = 39, /**< TP++ TP++ Transport Protocol [DXF] */
- TNET_PROTO_IL = 40, /**< IL IL Transport Protocol [Presotto] */
- TNET_PROTO_IPv6 = 41, /**< IPv6 Ipv6 [Deering] */
- TNET_PROTO_SDRP = 42, /**< SDRP Source Demand Routing Protocol [DXE1] */
- TNET_PROTO_IPv6_Route = 43, /**< IPv6-Route Routing Header for IPv6 [Deering] */
- TNET_PROTO_IPv6_Frag = 44, /**< IPv6-Frag Fragment Header for IPv6 [Deering] */
- TNET_PROTO_IDRP = 45, /**< IDRP Inter-Domain Routing Protocol [Hares] */
- TNET_PROTO_RSVP = 46, /**< RSVP Reservation Protocol [Braden] */
- TNET_PROTO_GRE = 47, /**< GRE General Routing Encapsulation [Li] */
- TNET_PROTO_DSR = 48, /**< DSR Dynamic Source Routing Protocol [RFC4728] */
- TNET_PROTO_BNA = 49, /**< BNA BNA [Salamon] */
- TNET_PROTO_ESP = 50, /**< ESP Encap Security Payload [RFC4303] */
- TNET_PROTO_AH = 51, /**< AH Authentication Header [RFC4302] */
- TNET_PROTO_I_NLSP = 52, /**< I-NLSP Integrated Net Layer Security TUBA [GLENN] */
- TNET_PROTO_SWIPE = 53, /**< SWIPE IP with Encryption [JI6] */
- TNET_PROTO_NARP = 54, /**< NARP NBMA Address Resolution Protocol [RFC1735] */
- TNET_PROTO_MOBILE = 55, /**< MOBILE IP Mobility [Perkins] */
- TNET_PROTO_TLSP = 56, /**< TLSP Transport Layer Security Protocol [Oberg] using Kryptonet key management */
- TNET_PROTO_SKIP = 57, /**< SKIP SKIP [Markson] */
- TNET_PROTO_IPv6_ICMP = 58, /**< IPv6-ICMP ICMP for IPv6 [RFC1883] */
- TNET_PROTO_IPv6_NoNxt = 59, /**< IPv6-NoNxt No Next Header for IPv6 [RFC1883] */
- TNET_PROTO_IPv6_Opts = 60, /**< IPv6-Opts Destination Options for IPv6 [RFC1883] */
- TNET_PROTO_ANY_INTERNAL = 61, /**< any host internal protocol [IANA] */
- TNET_PROTO_CFTP = 62, /**< CFTP CFTP [CFTP][HCF2] */
- TNET_PROTO_ANY_LOCAL = 63, /**< any local network [IANA] */
- TNET_PROTO_SAT_EXPAK = 64, /**< SAT-EXPAK SATNET and Backroom EXPAK [SHB] */
- TNET_PROTO_KRYPTOLAN = 65, /**< KRYPTOLAN Kryptolan [PXL1] */
- TNET_PROTO_RVD = 66, /**< RVD MIT Remote Virtual Disk Protocol [MBG] */
- TNET_PROTO_IPPC = 67, /**< IPPC Internet Pluribus Packet Core [SHB] */
- TNET_PROTO_ANY_DISTRIBUTED = 68, /**< any distributed file system [IANA] */
- TNET_PROTO_SAT_MON = 69, /**< SAT-MON SATNET Monitoring [SHB] */
- TNET_PROTO_VISA = 70, /**< VISA VISA Protocol [GXT1] */
- TNET_PROTO_IPCV = 71, /**< IPCV Internet Packet Core Utility [SHB] */
- TNET_PROTO_CPNX = 72, /**< CPNX Computer Protocol Network Executive [DXM2] */
- TNET_PROTO_CPHB = 73, /**< CPHB Computer Protocol Heart Beat [DXM2] */
- TNET_PROTO_WSN = 74, /**< WSN Wang Span Network [VXD] */
- TNET_PROTO_PVP = 75, /**< PVP Packet Video Protocol [SC3] */
- TNET_PROTO_BR_SAT_MON = 76, /**< BR-SAT-MON Backroom SATNET Monitoring [SHB] */
- TNET_PROTO_SUN_ND = 77, /**< SUN-ND SUN ND PROTOCOL-Temporary [WM3] */
- TNET_PROTO_WB_MON = 78, /**< WB-MON WIDEBAND Monitoring [SHB] */
- TNET_PROTO_WB_EXPAK = 79, /**< WB-EXPAK WIDEBAND EXPAK [SHB] */
- TNET_PROTO_ISO_IP = 80, /**< ISO-IP ISO Internet Protocol [MTR] */
- TNET_PROTO_VMTP = 81, /**< VMTP VMTP [DRC3] */
- TNET_PROTO_SECURE_VMTP = 82, /**< SECURE-VMTP SECURE-VMTP [DRC3] */
- TNET_PROTO_VINES = 83, /**< VINES VINES [BXH] */
- TNET_PROTO_TTP = 84, /**< TTP TTP [JXS] */
- TNET_PROTO_NSFNET_IGP = 85, /**< NSFNET-IGP NSFNET-IGP [HWB] */
- TNET_PROTO_DGP = 86, /**< DGP Dissimilar Gateway Protocol [DGP][ML109] */
- TNET_PROTO_TCF = 87, /**< TCF TCF [GAL5] */
- TNET_PROTO_EIGRP = 88, /**< EIGRP EIGRP [CISCO][GXS] */
- TNET_PROTO_OSPFIGP = 89, /**< OSPFIGP OSPFIGP [RFC1583][JTM4] */
- TNET_PROTO_Sprite_RPC = 90, /**< Sprite-RPC Sprite RPC Protocol [SPRITE][BXW] */
- TNET_PROTO_LARP = 91, /**< LARP Locus Address Resolution Protocol [BXH] */
- TNET_PROTO_MTP = 92, /**< MTP Multicast Transport Protocol [SXA] */
- TNET_PROTO_AX25 = 93, /**< AX.25 AX.25 Frames [BK29] */
- TNET_PROTO_IPIP = 94, /**< IPIP IP-within-IP Encapsulation Protocol [JI6] */
- TNET_PROTO_MICP = 95, /**< MICP Mobile Internetworking Control Pro. [JI6] */
- TNET_PROTO_SCC_SP = 96, /**< SCC-SP Semaphore Communications Sec. Pro. [HXH] */
- TNET_PROTO_ETHERIP = 97, /**< ETHERIP Ethernet-within-IP Encapsulation [RFC3378] */
- TNET_PROTO_ENCAP = 98, /**< ENCAP Encapsulation Header [RFC1241,RXB3] */
- TNET_PROTO_ANY_PRIV_ENC = 99, /**< any private encryption scheme [IANA] */
- TNET_PROTO_GMTP = 100, /**< GMTP GMTP [RXB5] */
- TNET_PROTO_IFMP = 101, /**< IFMP Ipsilon Flow Management Protocol [Hinden] */
- TNET_PROTO_PNNI = 102, /**< PNNI PNNI over IP [Callon] */
- TNET_PROTO_PIM = 103, /**< PIM Protocol Independent Multicast [Farinacci] */
- TNET_PROTO_ARIS = 104, /**< ARIS ARIS [Feldman] */
- TNET_PROTO_SCPS = 105, /**< SCPS SCPS [Durst] */
- TNET_PROTO_QNX = 106, /**< QNX QNX [Hunter] */
- TNET_PROTO_AN = 107, /**< A/N Active Networks [Braden] */
- TNET_PROTO_IPComp = 108, /**< IPComp IP Payload Compression Protocol [RFC2393] */
- TNET_PROTO_SNP = 109, /**< SNP Sitara Networks Protocol [Sridhar] */
- TNET_PROTO_Compaq_Peer = 110, /**< Compaq-Peer Compaq Peer Protocol [Volpe] */
- TNET_PROTO_IPX_in_IP = 11, /**< IPX-in-IP IPX in IP [Lee] */
- TNET_PROTO_VRRP = 112, /**< VRRP Virtual Router Redundancy Protocol [RFC3768][RFC-ietf-vrrp-unified-spec-05.txt] */
- TNET_PROTO_PGM = 113, /**< PGM PGM Reliable Transport Protocol [Speakman] */
- TNET_PROTO_ANY_ZERO_HOP = 114, /**< any 0-hop protocol [IANA] */
- TNET_PROTO_L2TP = 115, /**< L2TP Layer Two Tunneling Protocol [Aboba] */
- TNET_PROTO_DDX = 116, /**< DDX D-II Data Exchange (DDX) [Worley] */
- TNET_PROTO_IATP = 117, /**< IATP Interactive Agent Transfer Protocol [Murphy] */
- TNET_PROTO_STP = 118, /**< STP Schedule Transfer Protocol [JMP] */
- TNET_PROTO_SRP = 119, /**< SRP SpectraLink Radio Protocol [Hamilton] */
- TNET_PROTO_UTI = 120, /**< UTI UTI [Lothberg] */
- TNET_PROTO_SMP = 121, /**< SMP Simple Message Protocol [Ekblad] */
- TNET_PROTO_SM = 122, /**< SM SM [Crowcroft] */
- TNET_PROTO_PTP = 123, /**< PTP Performance Transparency Protocol [Welzl] */
- TNET_PROTO_ISIS = 124, /**< ISIS over IPv4 [Przygienda] */
- TNET_PROTO_FIRE = 125, /**< FIRE [Partridge] */
- TNET_PROTO_CRTP = 126, /**< CRTP Combat Radio Transport Protocol [Sautter] */
- TNET_PROTO_CRUDP = 127, /**< CRUDP Combat Radio User Datagram [Sautter] */
- TNET_PROTO_SSCOPMCE = 128, /**< SSCOPMCE [Waber] */
- TNET_PROTO_IPLT = 129, /**< IPLT [Hollbach] */
- TNET_PROTO_SPS = 130, /**< SPS Secure Packet Shield [McIntosh] */
- TNET_PROTO_PIPE = 131, /**< PIPE Private IP Encapsulation within IP [Petri] */
- TNET_PROTO_SCTP = 132, /**< SCTP Stream Control Transmission Protocol [Stewart] */
- TNET_PROTO_FC = 133, /**< FC Fibre Channel [Rajagopal] */
- TNET_PROTO_RSVP_E2E_IGNORE = 134, /**< RSVP-E2E-IGNORE [RFC3175] */
- TNET_PROTO_Mobility_Header = 135, /**< Mobility Header [RFC3775] */
- TNET_PROTO_UDPLite = 136, /**< UDPLite [RFC3828] */
- TNET_PROTO_MPLS_in_IP = 137, /**< MPLS-in-IP [RFC4023] */
- TNET_PROTO_manet = 138, /**< manet MANET Protocols [RFC5498] */
- TNET_PROTO_HIP = 139, /**< HIP Host Identity Protocol [RFC5201] */
- TNET_PROTO_Shim6 = 140, /**< Shim6 Shim6 Protocol [RFC5533] */
- //TNET_PROTO_ = 141-252 Unassigned [IANA]
- TNET_PROTO_EXP1 = 253, /**< Use for experimentation and testing [RFC3692] */
- TNET_PROTO_EXP2 = 254, /**< Use for experimentation and testing [RFC3692] */
- TNET_PROTO_Reserved = 255, /**< Reserved [IANA] */
+typedef enum tnet_proto_e {
+ TNET_PROTO_HOPOPT = 0, /**< HOPOPT IPv6 Hop-by-Hop Option [RFC1883] */
+ TNET_PROTO_ICMP = 1, /**< ICMP Internet Control Message [RFC792] */
+ TNET_PROTO_IGMP = 2, /**< IGMP Internet Group Management [RFC1112] */
+ TNET_PROTO_GGP = 3, /**< GGP Gateway-to-Gateway [RFC823] */
+ TNET_PROTO_IP = 4, /**< IP IP in IP (encapsulation) [RFC2003] */
+ TNET_PROTO_ST = 5, /**< ST Stream [RFC1190][RFC1819] */
+ TNET_PROTO_TCP = 6, /**< TCP Transmission Control [RFC793] */
+ TNET_PROTO_CBT = 7, /**< CBT CBT [Ballardie] */
+ TNET_PROTO_EGP = 8, /**< EGP Exterior Gateway Protocol [RFC888][DLM1] */
+ TNET_PROTO_IGP = 9, /**< IGP any private interior gateway [IANA](used by Cisco for their IGRP) */
+ TNET_PROTO_BBN_RCC_MON = 10, /**< BBN-RCC-MON BBN RCC Monitoring [SGC] */
+ TNET_PROTO_NVP_II = 11, /**< NVP-II Network Voice Protocol [RFC741][SC3] */
+ TNET_PROTO_PUP = 12, /**< PUP PUP [PUP][XEROX] */
+ TNET_PROTO_ARGUS = 13, /**< ARGUS ARGUS [RWS4] */
+ TNET_PROTO_EMCON = 14, /**< EMCON EMCON [BN7] */
+ TNET_PROTO_XNET = 15, /**< XNET Cross Net Debugger [IEN158][JFH2] */
+ TNET_PROTO_CHAOS = 16, /**< CHAOS Chaos [NC3] */
+ TNET_PROTO_UDP = 17, /**< UDP User Datagram [RFC768][JBP] */
+ TNET_PROTO_MUX = 18, /**< MUX Multiplexing [IEN90][JBP] */
+ TNET_PROTO_DCN_MEAS = 19, /**< DCN-MEAS DCN Measurement Subsystems [DLM1] */
+ TNET_PROTO_HMP = 20, /**< HMP Host Monitoring [RFC869][RH6] */
+ TNET_PROTO_PRM = 21, /**< PRM Packet Radio Measurement [ZSU] */
+ TNET_PROTO_XNS_IDP = 22, /**< XNS-IDP XEROX NS IDP [ETHERNET][XEROX] */
+ TNET_PROTO_TRUNK_1 = 23, /**< TRUNK-1 Trunk-1 [BWB6] */
+ TNET_PROTO_TRUNK_2 = 24, /**< TRUNK-2 Trunk-2 [BWB6] */
+ TNET_PROTO_LEAF_1 = 25, /**< LEAF-1 Leaf-1 [BWB6] */
+ TNET_PROTO_LEAF_2 = 26, /**< LEAF-2 Leaf-2 [BWB6] */
+ TNET_PROTO_RDP = 27, /**< RDP Reliable Data Protocol [RFC908][RH6] */
+ TNET_PROTO_IRTP = 28, /**< IRTP Internet Reliable Transaction [RFC938][TXM] */
+ TNET_PROTO_ISO_TP4 = 29, /**< ISO-TP4 ISO Transport Protocol Class 4 [RFC905][RC77] */
+ TNET_PROTO_NETBLT = 30, /**< NETBLT Bulk Data Transfer Protocol [RFC969][DDC1] */
+ TNET_PROTO_MFE_NSP = 31, /**< MFE-NSP MFE Network Services Protocol [MFENET][BCH2] */
+ TNET_PROTO_MERIT_INP = 32, /**< MERIT-INP MERIT Internodal Protocol [HWB] */
+ TNET_PROTO_DCCP = 33, /**< DCCP Datagram Congestion Control Protocol [RFC4340] */
+ TNET_PROTO_3PC = 34, /**< 3PC Third Party Connect Protocol [SAF3] */
+ TNET_PROTO_IDPR = 35, /**< IDPR Inter-Domain Policy Routing Protocol [MXS1] */
+ TNET_PROTO_XTP = 36, /**< XTP XTP [GXC] */
+ TNET_PROTO_DDP = 37, /**< DDP Datagram Delivery Protocol [WXC] */
+ TNET_PROTO_IDPR_CMTP = 38, /**< IDPR-CMTP IDPR Control Message Transport Proto [MXS1] */
+ TNET_PROTO_TP_PP = 39, /**< TP++ TP++ Transport Protocol [DXF] */
+ TNET_PROTO_IL = 40, /**< IL IL Transport Protocol [Presotto] */
+ TNET_PROTO_IPv6 = 41, /**< IPv6 Ipv6 [Deering] */
+ TNET_PROTO_SDRP = 42, /**< SDRP Source Demand Routing Protocol [DXE1] */
+ TNET_PROTO_IPv6_Route = 43, /**< IPv6-Route Routing Header for IPv6 [Deering] */
+ TNET_PROTO_IPv6_Frag = 44, /**< IPv6-Frag Fragment Header for IPv6 [Deering] */
+ TNET_PROTO_IDRP = 45, /**< IDRP Inter-Domain Routing Protocol [Hares] */
+ TNET_PROTO_RSVP = 46, /**< RSVP Reservation Protocol [Braden] */
+ TNET_PROTO_GRE = 47, /**< GRE General Routing Encapsulation [Li] */
+ TNET_PROTO_DSR = 48, /**< DSR Dynamic Source Routing Protocol [RFC4728] */
+ TNET_PROTO_BNA = 49, /**< BNA BNA [Salamon] */
+ TNET_PROTO_ESP = 50, /**< ESP Encap Security Payload [RFC4303] */
+ TNET_PROTO_AH = 51, /**< AH Authentication Header [RFC4302] */
+ TNET_PROTO_I_NLSP = 52, /**< I-NLSP Integrated Net Layer Security TUBA [GLENN] */
+ TNET_PROTO_SWIPE = 53, /**< SWIPE IP with Encryption [JI6] */
+ TNET_PROTO_NARP = 54, /**< NARP NBMA Address Resolution Protocol [RFC1735] */
+ TNET_PROTO_MOBILE = 55, /**< MOBILE IP Mobility [Perkins] */
+ TNET_PROTO_TLSP = 56, /**< TLSP Transport Layer Security Protocol [Oberg] using Kryptonet key management */
+ TNET_PROTO_SKIP = 57, /**< SKIP SKIP [Markson] */
+ TNET_PROTO_IPv6_ICMP = 58, /**< IPv6-ICMP ICMP for IPv6 [RFC1883] */
+ TNET_PROTO_IPv6_NoNxt = 59, /**< IPv6-NoNxt No Next Header for IPv6 [RFC1883] */
+ TNET_PROTO_IPv6_Opts = 60, /**< IPv6-Opts Destination Options for IPv6 [RFC1883] */
+ TNET_PROTO_ANY_INTERNAL = 61, /**< any host internal protocol [IANA] */
+ TNET_PROTO_CFTP = 62, /**< CFTP CFTP [CFTP][HCF2] */
+ TNET_PROTO_ANY_LOCAL = 63, /**< any local network [IANA] */
+ TNET_PROTO_SAT_EXPAK = 64, /**< SAT-EXPAK SATNET and Backroom EXPAK [SHB] */
+ TNET_PROTO_KRYPTOLAN = 65, /**< KRYPTOLAN Kryptolan [PXL1] */
+ TNET_PROTO_RVD = 66, /**< RVD MIT Remote Virtual Disk Protocol [MBG] */
+ TNET_PROTO_IPPC = 67, /**< IPPC Internet Pluribus Packet Core [SHB] */
+ TNET_PROTO_ANY_DISTRIBUTED = 68, /**< any distributed file system [IANA] */
+ TNET_PROTO_SAT_MON = 69, /**< SAT-MON SATNET Monitoring [SHB] */
+ TNET_PROTO_VISA = 70, /**< VISA VISA Protocol [GXT1] */
+ TNET_PROTO_IPCV = 71, /**< IPCV Internet Packet Core Utility [SHB] */
+ TNET_PROTO_CPNX = 72, /**< CPNX Computer Protocol Network Executive [DXM2] */
+ TNET_PROTO_CPHB = 73, /**< CPHB Computer Protocol Heart Beat [DXM2] */
+ TNET_PROTO_WSN = 74, /**< WSN Wang Span Network [VXD] */
+ TNET_PROTO_PVP = 75, /**< PVP Packet Video Protocol [SC3] */
+ TNET_PROTO_BR_SAT_MON = 76, /**< BR-SAT-MON Backroom SATNET Monitoring [SHB] */
+ TNET_PROTO_SUN_ND = 77, /**< SUN-ND SUN ND PROTOCOL-Temporary [WM3] */
+ TNET_PROTO_WB_MON = 78, /**< WB-MON WIDEBAND Monitoring [SHB] */
+ TNET_PROTO_WB_EXPAK = 79, /**< WB-EXPAK WIDEBAND EXPAK [SHB] */
+ TNET_PROTO_ISO_IP = 80, /**< ISO-IP ISO Internet Protocol [MTR] */
+ TNET_PROTO_VMTP = 81, /**< VMTP VMTP [DRC3] */
+ TNET_PROTO_SECURE_VMTP = 82, /**< SECURE-VMTP SECURE-VMTP [DRC3] */
+ TNET_PROTO_VINES = 83, /**< VINES VINES [BXH] */
+ TNET_PROTO_TTP = 84, /**< TTP TTP [JXS] */
+ TNET_PROTO_NSFNET_IGP = 85, /**< NSFNET-IGP NSFNET-IGP [HWB] */
+ TNET_PROTO_DGP = 86, /**< DGP Dissimilar Gateway Protocol [DGP][ML109] */
+ TNET_PROTO_TCF = 87, /**< TCF TCF [GAL5] */
+ TNET_PROTO_EIGRP = 88, /**< EIGRP EIGRP [CISCO][GXS] */
+ TNET_PROTO_OSPFIGP = 89, /**< OSPFIGP OSPFIGP [RFC1583][JTM4] */
+ TNET_PROTO_Sprite_RPC = 90, /**< Sprite-RPC Sprite RPC Protocol [SPRITE][BXW] */
+ TNET_PROTO_LARP = 91, /**< LARP Locus Address Resolution Protocol [BXH] */
+ TNET_PROTO_MTP = 92, /**< MTP Multicast Transport Protocol [SXA] */
+ TNET_PROTO_AX25 = 93, /**< AX.25 AX.25 Frames [BK29] */
+ TNET_PROTO_IPIP = 94, /**< IPIP IP-within-IP Encapsulation Protocol [JI6] */
+ TNET_PROTO_MICP = 95, /**< MICP Mobile Internetworking Control Pro. [JI6] */
+ TNET_PROTO_SCC_SP = 96, /**< SCC-SP Semaphore Communications Sec. Pro. [HXH] */
+ TNET_PROTO_ETHERIP = 97, /**< ETHERIP Ethernet-within-IP Encapsulation [RFC3378] */
+ TNET_PROTO_ENCAP = 98, /**< ENCAP Encapsulation Header [RFC1241,RXB3] */
+ TNET_PROTO_ANY_PRIV_ENC = 99, /**< any private encryption scheme [IANA] */
+ TNET_PROTO_GMTP = 100, /**< GMTP GMTP [RXB5] */
+ TNET_PROTO_IFMP = 101, /**< IFMP Ipsilon Flow Management Protocol [Hinden] */
+ TNET_PROTO_PNNI = 102, /**< PNNI PNNI over IP [Callon] */
+ TNET_PROTO_PIM = 103, /**< PIM Protocol Independent Multicast [Farinacci] */
+ TNET_PROTO_ARIS = 104, /**< ARIS ARIS [Feldman] */
+ TNET_PROTO_SCPS = 105, /**< SCPS SCPS [Durst] */
+ TNET_PROTO_QNX = 106, /**< QNX QNX [Hunter] */
+ TNET_PROTO_AN = 107, /**< A/N Active Networks [Braden] */
+ TNET_PROTO_IPComp = 108, /**< IPComp IP Payload Compression Protocol [RFC2393] */
+ TNET_PROTO_SNP = 109, /**< SNP Sitara Networks Protocol [Sridhar] */
+ TNET_PROTO_Compaq_Peer = 110, /**< Compaq-Peer Compaq Peer Protocol [Volpe] */
+ TNET_PROTO_IPX_in_IP = 11, /**< IPX-in-IP IPX in IP [Lee] */
+ TNET_PROTO_VRRP = 112, /**< VRRP Virtual Router Redundancy Protocol [RFC3768][RFC-ietf-vrrp-unified-spec-05.txt] */
+ TNET_PROTO_PGM = 113, /**< PGM PGM Reliable Transport Protocol [Speakman] */
+ TNET_PROTO_ANY_ZERO_HOP = 114, /**< any 0-hop protocol [IANA] */
+ TNET_PROTO_L2TP = 115, /**< L2TP Layer Two Tunneling Protocol [Aboba] */
+ TNET_PROTO_DDX = 116, /**< DDX D-II Data Exchange (DDX) [Worley] */
+ TNET_PROTO_IATP = 117, /**< IATP Interactive Agent Transfer Protocol [Murphy] */
+ TNET_PROTO_STP = 118, /**< STP Schedule Transfer Protocol [JMP] */
+ TNET_PROTO_SRP = 119, /**< SRP SpectraLink Radio Protocol [Hamilton] */
+ TNET_PROTO_UTI = 120, /**< UTI UTI [Lothberg] */
+ TNET_PROTO_SMP = 121, /**< SMP Simple Message Protocol [Ekblad] */
+ TNET_PROTO_SM = 122, /**< SM SM [Crowcroft] */
+ TNET_PROTO_PTP = 123, /**< PTP Performance Transparency Protocol [Welzl] */
+ TNET_PROTO_ISIS = 124, /**< ISIS over IPv4 [Przygienda] */
+ TNET_PROTO_FIRE = 125, /**< FIRE [Partridge] */
+ TNET_PROTO_CRTP = 126, /**< CRTP Combat Radio Transport Protocol [Sautter] */
+ TNET_PROTO_CRUDP = 127, /**< CRUDP Combat Radio User Datagram [Sautter] */
+ TNET_PROTO_SSCOPMCE = 128, /**< SSCOPMCE [Waber] */
+ TNET_PROTO_IPLT = 129, /**< IPLT [Hollbach] */
+ TNET_PROTO_SPS = 130, /**< SPS Secure Packet Shield [McIntosh] */
+ TNET_PROTO_PIPE = 131, /**< PIPE Private IP Encapsulation within IP [Petri] */
+ TNET_PROTO_SCTP = 132, /**< SCTP Stream Control Transmission Protocol [Stewart] */
+ TNET_PROTO_FC = 133, /**< FC Fibre Channel [Rajagopal] */
+ TNET_PROTO_RSVP_E2E_IGNORE = 134, /**< RSVP-E2E-IGNORE [RFC3175] */
+ TNET_PROTO_Mobility_Header = 135, /**< Mobility Header [RFC3775] */
+ TNET_PROTO_UDPLite = 136, /**< UDPLite [RFC3828] */
+ TNET_PROTO_MPLS_in_IP = 137, /**< MPLS-in-IP [RFC4023] */
+ TNET_PROTO_manet = 138, /**< manet MANET Protocols [RFC5498] */
+ TNET_PROTO_HIP = 139, /**< HIP Host Identity Protocol [RFC5201] */
+ TNET_PROTO_Shim6 = 140, /**< Shim6 Shim6 Protocol [RFC5533] */
+ //TNET_PROTO_ = 141-252 Unassigned [IANA]
+ TNET_PROTO_EXP1 = 253, /**< Use for experimentation and testing [RFC3692] */
+ TNET_PROTO_EXP2 = 254, /**< Use for experimentation and testing [RFC3692] */
+ TNET_PROTO_Reserved = 255, /**< Reserved [IANA] */
}
tnet_proto_t;
diff --git a/tinyNET/src/tnet_proxy_node_socks_plugin.c b/tinyNET/src/tnet_proxy_node_socks_plugin.c
index e5f8d08..f15f706 100755
--- a/tinyNET/src/tnet_proxy_node_socks_plugin.c
+++ b/tinyNET/src/tnet_proxy_node_socks_plugin.c
@@ -89,22 +89,21 @@ typedef enum socks5_state_e {
socks5_state_auth_req,
socks5_state_conn_req,
socks5_state_conn_accept,
-
+
socks5_state_error
}
socks5_state_t;
-typedef struct tnet_proxy_node_socks_plugin_s
-{
+typedef struct tnet_proxy_node_socks_plugin_s {
TNET_DECLARE_PROXY_NONE;
-
+
struct {
tsk_bool_t completed;
tsk_bool_t started;
tsk_buffer_t* buff;
uint8_t* pending_data_ptr;
tsk_size_t pending_data_len;
-
+
socks5_state_t socks5_state;
socks5_auth_method_t socks5_auth_method;
#if TNET_SOCKS5_HAVE_AUTH_GSSAPI
@@ -114,10 +113,10 @@ typedef struct tnet_proxy_node_socks_plugin_s
OM_uint32 status_major;
gss_name_t server_name;
tsk_bool_t init_sec_complete;
- }gss;
+ } gss;
#endif /* TNET_SOCKS5_HAVE_AUTH_GSSAPI */
} handshacking;
-
+
TSK_DECLARE_SAFEOBJ;
}
tnet_proxy_node_socks_plugin_t;
@@ -135,18 +134,18 @@ static int _tnet_proxy_node_socks_plugin_configure(tnet_proxy_node_t* self, ...)
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
va_list ap;
int ret = 0;
-
+
// input parameters already checked by the caller
-
+
tsk_safeobj_lock(node);
-
+
// extract dst_host, dst_port, proxy_host, proxy_port, ipv6_enabled, ...
va_start(ap, self);
ret = tnet_proxy_node_configure_2(self, &ap);
va_end(ap);
-
+
tsk_safeobj_unlock(node);
-
+
return 0;
}
@@ -154,9 +153,9 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
{
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
int ret = 0;
-
+
// input parameters already checked by the caller
-
+
tsk_safeobj_lock(node);
if (node->handshacking.started) {
TSK_DEBUG_ERROR("handshaking already started");
@@ -167,11 +166,11 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
ret = -2;
goto bail;
}
-
+
// reset pending data
TSK_FREE(node->handshacking.pending_data_ptr);
node->handshacking.pending_data_len = 0;
-
+
#if USING_CFSTREAM
if (tsk_strnullORempty(self->proxy_host) || !self->proxy_port) {
TSK_DEBUG_ERROR("Invalid proxy host and/or port for socks server %s:%hu", self->proxy_host, self->proxy_port);
@@ -183,7 +182,7 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
ret = -3;
goto bail;
}
-
+
CFStringRef cfstrHost = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, self->proxy_host, kCFStringEncodingUTF8, NULL);
int intPort = (int)self->proxy_port;
CFNumberRef cfintPort = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &intPort);
@@ -202,10 +201,10 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
CFDictionarySetValue(socksConfig, kCFStreamPropertySOCKSPassword, cfstrPassword);
CFRelease(cfstrPassword);
}
-
+
if (!CFReadStreamSetProperty(self->cf_read_stream, kCFStreamPropertySOCKSProxy, socksConfig)) {
CFStreamError error = CFReadStreamGetError(self->cf_read_stream);
-
+
TSK_DEBUG_INFO("CFReadStreamSetProperty(kCFStreamPropertySOCKSProxy) failed code=%d, domain=%ld", (int)error.error, error.domain);
ret = -4;
}
@@ -214,12 +213,12 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
TSK_DEBUG_INFO("CFWriteStreamSetProperty(kCFStreamPropertySOCKSProxy) code=%d, domain=%ld", (int)error.error, error.domain);
ret = -5;
}
-
+
CFRelease(cfstrHost);
CFRelease(cfintPort);
CFRelease(socksConfig);
CFRelease(proxyDict);
-
+
node->handshacking.started = (ret == 0);
node->handshacking.completed = node->handshacking.started; // no handshaking data to send, up to the system
#else
@@ -227,15 +226,15 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
tsk_size_t size_to_reserve, userid_len = tsk_strlen(self->login), domain_len = 0;
if (self->type == tnet_proxy_type_socks4 || self->type == tnet_proxy_type_socks4a) {
size_to_reserve = 1 /* version number */
- + 1 /* command code */
- + 2 /* network byte order port number */
- + 4 /* network byte order IP address */
- + userid_len + 1 /* the user ID string, variable length, terminated with a null (0x00) */
- ;
+ + 1 /* command code */
+ + 2 /* network byte order port number */
+ + 4 /* network byte order IP address */
+ + userid_len + 1 /* the user ID string, variable length, terminated with a null (0x00) */
+ ;
if (self->type == tnet_proxy_type_socks4a) {
domain_len = tsk_strlen(self->dst_host);
size_to_reserve += domain_len + 1/* the domain name of the host we want to contact, variable length, terminated with a null (0x00) */
- ;
+ ;
}
}
else { // SOCKS5
@@ -246,17 +245,17 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
}
// Greeting
size_to_reserve = 1 /* version number */
- + 1 /* number of authentication methods supported */
+ + 1 /* number of authentication methods supported */
#if TNET_SOCKS5_HAVE_AUTH_NONE
- + 1
+ + 1
#endif
#if TNET_SOCKS5_HAVE_AUTH_USRPWD
- + 1
+ + 1
#endif
#if TNET_SOCKS5_HAVE_AUTH_GSSAPI
- + 1
+ + 1
#endif
- ;
+ ;
}
node->handshacking.pending_data_ptr = (uint8_t*)tsk_realloc(node->handshacking.pending_data_ptr, size_to_reserve);
if (!node->handshacking.pending_data_ptr) {
@@ -266,7 +265,7 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
goto bail;
}
node->handshacking.pending_data_len = size_to_reserve;
-
+
if (self->type == tnet_proxy_type_socks4 || self->type == tnet_proxy_type_socks4a) {
node->handshacking.pending_data_ptr[0] = 0x04; // version number
node->handshacking.pending_data_ptr[1] = 0x01; // establish a TCP/IP stream connection (caller aldready check we're dealing with Streams)
@@ -294,7 +293,7 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
memcpy(&node->handshacking.pending_data_ptr[8], self->login, userid_len);
}
node->handshacking.pending_data_ptr[8 + userid_len] = 0x00;
-
+
// the domain name of the host we want to contact, variable length, terminated with a null (0x00)
if (self->type == tnet_proxy_type_socks4a) {
if (domain_len > 0) {
@@ -331,8 +330,8 @@ static int _tnet_proxy_node_socks_plugin_start_handshaking(tnet_proxy_node_t* se
node->handshacking.started = tsk_true;
}
#endif
-
-
+
+
bail:
tsk_safeobj_unlock(node);
return ret;
@@ -342,17 +341,17 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
{
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
int ret = 0;
-
+
// input parameters already checked by the caller
-
+
tsk_safeobj_lock(node);
-
+
if (!node->handshacking.started) {
TSK_DEBUG_ERROR("handshaking not started");
ret = -3;
goto bail;
}
-
+
#if USING_CFSTREAM
TSK_DEBUG_ERROR("Up to CFStreams to handle handshaking");
ret = -2;
@@ -400,7 +399,8 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
}
if (buff[0] != 0x05) {
TSK_DEBUG_ERROR("Invalid version (%d)", buff[0]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
if (buff[1] == kSocks5AuthMethodNone || buff[1] == kSocks5AuthMethodUsrPwd || buff[1] == kSocks5AuthMethodGSSAPI) {
node->handshacking.socks5_auth_method = (socks5_auth_method_t)buff[1];
@@ -410,16 +410,17 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
node->handshacking.socks5_state = socks5_state_conn_req;
// FIXME:
TSK_DEBUG_ERROR("Not implemented yet");
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
else {
if (node->handshacking.socks5_auth_method == kSocks5AuthMethodUsrPwd) {
tsk_size_t userlen = tsk_strlen(self->login), pwdlen = tsk_strlen(self->password);
tsk_size_t size_to_reserve = 1 /* version number */
- + 1 /* username length */
- + userlen /* username */
- + 1 /* password length */
- + pwdlen;
+ + 1 /* username length */
+ + userlen /* username */
+ + 1 /* password length */
+ + pwdlen;
node->handshacking.pending_data_ptr = (uint8_t*)tsk_realloc(node->handshacking.pending_data_ptr, size_to_reserve);
if (!node->handshacking.pending_data_ptr) {
TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", (unsigned)size_to_reserve);
@@ -428,7 +429,7 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
goto bail;
}
node->handshacking.pending_data_len = size_to_reserve;
-
+
node->handshacking.pending_data_ptr[0] = 0x01;
node->handshacking.pending_data_ptr[1] = (userlen & 0xFF);
if (userlen > 0) {
@@ -450,21 +451,24 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
TSK_DEBUG_ERROR("gss_import_name() failed");
goto bail;
}
-
+
#else
TSK_DEBUG_ERROR("GSSAPI not supported");
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
#endif
}
else {
TSK_DEBUG_ERROR("Not implemented yet");
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
}
}
else {
TSK_DEBUG_ERROR("Invalid authentication method (%d)", buff[1]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
}
else if (node->handshacking.socks5_state == socks5_state_auth_req) {
@@ -476,12 +480,14 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
}
if (buff[0] != 0x1) {
TSK_DEBUG_ERROR("Invalid version :%d", buff[0]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
TSK_DEBUG_INFO("Socks5 authentication status code: %d", buff[1]);
if (buff[1] != 0x00) {
TSK_DEBUG_ERROR("Authentication failed with status code :%d", buff[1]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
tsk_buffer_remove(node->handshacking.buff, 0, 2); // remove parsed bytes
node->handshacking.socks5_state = socks5_state_conn_req;
@@ -489,13 +495,15 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
else if (node->handshacking.socks5_auth_method == kSocks5AuthMethodGSSAPI) {
// FIXME:
TSK_DEBUG_ERROR("Not implemented yet");
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
else {
TSK_DEBUG_ERROR("Invalid authentication method (%d)", buff[1]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
-
+
// State changed from "auth_req" to "conn_req" : build connection request
if (node->handshacking.socks5_state == socks5_state_conn_req) {
#define kAddrTypeIPv4 0x01
@@ -505,12 +513,12 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
tsk_bool_t is_ip = tsk_false; // ip or domain name
uint8_t addr_type = 0x00;
tsk_size_t dst_addr_len = 0, size_to_reserve = 1 /* version number */
- + 1 /* command code */
- + 1 /* reserved, must be 0x00 */
- + 1 /* address type */
- + 0 /* destination address (==to be computed later==) */
- + 2 /* port number in a network byte order */
- ;
+ + 1 /* command code */
+ + 1 /* reserved, must be 0x00 */
+ + 1 /* address type */
+ + 0 /* destination address (==to be computed later==) */
+ + 2 /* port number in a network byte order */
+ ;
if ((ret = tnet_sockaddr_init(self->dst_host, self->dst_port, self->socket.type, &addr)) != 0) {
TSK_DEBUG_WARN("tnet_sockaddr_init(%s, %d, %d) failed", self->dst_host, self->dst_port, self->socket.type);
// maybe DNS issue (e.g UDP blocked), do not exit, up to the server to resolve it
@@ -534,10 +542,11 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
if (!node->handshacking.pending_data_ptr) {
TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", (unsigned)size_to_reserve);
node->handshacking.pending_data_len = 0;
- ret = -5; goto bail;
+ ret = -5;
+ goto bail;
}
node->handshacking.pending_data_len = size_to_reserve;
-
+
node->handshacking.pending_data_ptr[0] = 0x05; // version number
node->handshacking.pending_data_ptr[1] = 0x01; // establish a TCP/IP stream connection
node->handshacking.pending_data_ptr[2] = 0x00; // reserved, must be 0x00
@@ -564,12 +573,14 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
}
if (buff[0] != 0x05) {
TSK_DEBUG_ERROR("Invalid version (%d)", buff[0]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
TSK_DEBUG_INFO("Socks5 connection request status code: %d", buff[1]);
if (buff[1] != 0x00) {
TSK_DEBUG_ERROR("Socks5 connection request failed with status code :%d", buff[1]);
- ret = -3; goto bail;
+ ret = -3;
+ goto bail;
}
tsk_buffer_remove(node->handshacking.buff, 0, 2); // remove parsed bytes
node->handshacking.socks5_state = socks5_state_conn_accept;
@@ -592,7 +603,7 @@ static int _tnet_proxy_node_socks_plugin_set_handshaking_data(tnet_proxy_node_t*
goto bail;
}
#endif
-
+
bail:
if (ret != 0) {
if (self->type == tnet_proxy_type_socks5) {
@@ -607,11 +618,11 @@ static int _tnet_proxy_node_socks_plugin_get_handshaking_pending_data(tnet_proxy
{
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
int ret = -1;
-
+
// input parameters already checked by the caller
-
+
tsk_safeobj_lock(node);
-
+
#if USING_CFSTREAM
*data_psize = 0; // no pending data
ret = 0;
@@ -627,7 +638,7 @@ static int _tnet_proxy_node_socks_plugin_get_handshaking_pending_data(tnet_proxy
node->handshacking.pending_data_len = 0;
}
#endif
-
+
tsk_safeobj_unlock(node);
return ret;
}
@@ -636,9 +647,9 @@ static int _tnet_proxy_node_socks_plugin_get_handshaking_completed(tnet_proxy_no
{
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
int ret = 0;
-
+
// input parameters already checked by the caller
-
+
tsk_safeobj_lock(node);
*completed = node->handshacking.completed;
tsk_safeobj_unlock(node);
@@ -648,23 +659,34 @@ static int _tnet_proxy_node_socks_plugin_get_handshaking_completed(tnet_proxy_no
static const char* __socks5_state_to_string(socks5_state_t state)
{
switch (state) {
- case socks5_state_none: return "none";
- case socks5_state_greeting: return "greeting";
- case socks5_state_auth_req: return "auth_req";
- case socks5_state_conn_req: return "conn_req";
- case socks5_state_conn_accept: return "conn_accept";
- case socks5_state_error: return "error";
- default: return "unknown";
+ case socks5_state_none:
+ return "none";
+ case socks5_state_greeting:
+ return "greeting";
+ case socks5_state_auth_req:
+ return "auth_req";
+ case socks5_state_conn_req:
+ return "conn_req";
+ case socks5_state_conn_accept:
+ return "conn_accept";
+ case socks5_state_error:
+ return "error";
+ default:
+ return "unknown";
}
}
static const char* __socks5_method_to_string(socks5_auth_method_t method)
{
switch (method) {
- case kSocks5AuthMethodNone: return "none";
- case kSocks5AuthMethodGSSAPI: return "gssapi";
- case kSocks5AuthMethodUsrPwd: return "usr/pwd";
- default: return "unknown";
+ case kSocks5AuthMethodNone:
+ return "none";
+ case kSocks5AuthMethodGSSAPI:
+ return "gssapi";
+ case kSocks5AuthMethodUsrPwd:
+ return "usr/pwd";
+ default:
+ return "unknown";
}
}
@@ -676,7 +698,7 @@ static int __socks5_gss_import_name(tnet_proxy_node_t* self)
int i, ret = 0;
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
gss_buffer_desc input_name_buffer = GSS_C_EMPTY_BUFFER;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -686,7 +708,7 @@ static int __socks5_gss_import_name(tnet_proxy_node_t* self)
// reset pending handshaking data
TSK_FREE(node->handshacking.pending_data_ptr);
node->handshacking.pending_data_len = 0;
-
+
/*
For example, when using Kerberos V5 naming, the imported name may be
of the form "SERVICE:socks@socks_server_hostname" where
@@ -697,7 +719,7 @@ static int __socks5_gss_import_name(tnet_proxy_node_t* self)
for (i = 0; i < input_name_buffer.length; ++i) {
((char*)input_name_buffer.value)[i] = tolower(((char*)input_name_buffer.value)[i]);
}
-
+
/*
The client should call gss_import_name to obtain an internal
representation of the server name. For maximal portability the
@@ -709,19 +731,20 @@ static int __socks5_gss_import_name(tnet_proxy_node_t* self)
TSK_DEBUG_INFO("gss_import_name(%.*s, GSS_C_NULL_OID): minor_status = %u, major_status = %u", (int)input_name_buffer.length, (const char*)input_name_buffer.value, node->handshacking.gss.status_minor, node->handshacking.gss.status_major);
if (node->handshacking.gss.status_major != GSS_S_COMPLETE) {
__socks_gss_print_error("gss_import_name failed", node->handshacking.gss.status_major, node->handshacking.gss.status_minor);
- ret = -2; goto bail;
+ ret = -2;
+ goto bail;
}
/* debug */{
gss_OID output_name_type;
gss_buffer_desc output_name = GSS_C_EMPTY_BUFFER;
node->handshacking.gss.status_major = gss_display_name(&node->handshacking.gss.status_minor,
- node->handshacking.gss.server_name,
- &output_name,
- &output_name_type);
+ node->handshacking.gss.server_name,
+ &output_name,
+ &output_name_type);
TSK_DEBUG_INFO("gss_display_name(%.*s): minor_status = %u, major_status = %u, output = %.*s", (int)input_name_buffer.length, (const char*)input_name_buffer.value, node->handshacking.gss.status_minor, node->handshacking.gss.status_major, (int)output_name.length, (const char*)output_name.value);
node->handshacking.gss.status_major = gss_release_buffer(&node->handshacking.gss.status_minor, &output_name);
}
-
+
bail:
gss_release_buffer(&node->handshacking.gss.status_minor, &input_name_buffer);
return 0;
@@ -736,17 +759,17 @@ static int __socks5_gss_init_sec_context(tnet_proxy_node_t* self)
tnet_proxy_node_socks_plugin_t* node = (tnet_proxy_node_socks_plugin_t*)self;
gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER, *input_token_ptr = GSS_C_NO_BUFFER;
gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
-
-/*
- +------+------+------+.......................+
- + ver | mtyp | len | token |
- +------+------+------+.......................+
- + 0x01 | 0x01 | 0x02 | up to 2^16 - 1 octets |
- +------+------+------+.......................+
-*/
+
+ /*
+ +------+------+------+.......................+
+ + ver | mtyp | len | token |
+ +------+------+------+.......................+
+ + 0x01 | 0x01 | 0x02 | up to 2^16 - 1 octets |
+ +------+------+------+.......................+
+ */
#define kTokenMsgHdrLongLen 4 // with "len" field
#define kTokenMsgHdrShortLen 2 // without "len" field
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -766,44 +789,46 @@ static int __socks5_gss_init_sec_context(tnet_proxy_node_t* self)
}
else {
TSK_DEBUG_ERROR("GSS invalid mtyp(%u)", buff[1]);
- ret = -5; goto bail;
+ ret = -5;
+ goto bail;
}
}
-
+
req_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG | GSS_C_DELEG_FLAG;
// However, GSS_C_SEQUENCE_FLAG should only be passed in for TCP-based clients, not for UDP-based clients.
if (TNET_SOCKET_TYPE_IS_STREAM(self->socket.type)) {
req_flags |= GSS_C_SEQUENCE_FLAG;
}
-
+
node->handshacking.gss.status_major = gss_delete_sec_context(&node->handshacking.gss.status_minor, &node->handshacking.gss.ctx, NULL);
-
+
node->handshacking.gss.ctx = GSS_C_NO_CONTEXT;
node->handshacking.gss.status_major = gss_init_sec_context(&node->handshacking.gss.status_minor,
- GSS_C_NO_CREDENTIAL, // GSS_C_NO_CREDENTIAL into cred_handle to specify the default credential (for initiator usage)
- &node->handshacking.gss.ctx,
- node->handshacking.gss.server_name,
- GSS_C_NULL_OID, // GSS_C_NULL_OID into mech_type to specify the default mechanism
- req_flags,
- GSS_C_INDEFINITE,
- GSS_C_NO_CHANNEL_BINDINGS,
- input_token_ptr,
- tsk_null,
- &output_token,
- tsk_null,
- tsk_null);
-
-
+ GSS_C_NO_CREDENTIAL, // GSS_C_NO_CREDENTIAL into cred_handle to specify the default credential (for initiator usage)
+ &node->handshacking.gss.ctx,
+ node->handshacking.gss.server_name,
+ GSS_C_NULL_OID, // GSS_C_NULL_OID into mech_type to specify the default mechanism
+ req_flags,
+ GSS_C_INDEFINITE,
+ GSS_C_NO_CHANNEL_BINDINGS,
+ input_token_ptr,
+ tsk_null,
+ &output_token,
+ tsk_null,
+ tsk_null);
+
+
// Only "GSS_S_COMPLETE" and "GSS_S_CONTINUE_NEEDED" are acceptable
if (node->handshacking.gss.status_major != GSS_S_COMPLETE && node->handshacking.gss.status_major != GSS_S_CONTINUE_NEEDED) {
__socks_gss_print_error("gss_init_sec_context failed", node->handshacking.gss.status_major, node->handshacking.gss.status_minor);
- ret = -2; goto bail;
+ ret = -2;
+ goto bail;
}
-
+
// reset pending handshaking data
TSK_FREE(node->handshacking.pending_data_ptr);
node->handshacking.pending_data_len = 0;
-
+
if (output_token.length > 0 && output_token.value) {
node->handshacking.pending_data_len = kTokenMsgHdrLongLen + output_token.length;
node->handshacking.pending_data_ptr = tsk_realloc(node->handshacking.pending_data_ptr, node->handshacking.pending_data_len);
@@ -819,14 +844,14 @@ static int __socks5_gss_init_sec_context(tnet_proxy_node_t* self)
node->handshacking.pending_data_ptr[3] = output_token.length & 0xFF;
memcpy(&node->handshacking.pending_data_ptr[4], output_token.value, output_token.length);
}
-
+
if (input_token.length > 0) {
tsk_buffer_remove(node->handshacking.buff, 0, kTokenMsgHdrLongLen + input_token.length);
}
-
+
// update "init_sec_complete"
node->handshacking.gss.init_sec_complete = (ret == 0) && (node->handshacking.gss.status_major == GSS_S_COMPLETE);
-
+
bail:
return ret;
}
@@ -835,7 +860,7 @@ static void __socks_gss_print_error(const char* info, OM_uint32 status_major, OM
{
OM_uint32 m1, m2, s1, s2;
gss_buffer_desc out1 = {.value = tsk_null, .length = 0}, out2 = {.value = tsk_null, .length = 0};
-
+
// print the error
m1 = 0, s1 = 0;
gss_display_status(&s1, status_major, GSS_C_GSS_CODE, GSS_C_NULL_OID, &m1, &out1);
@@ -885,29 +910,27 @@ static tsk_object_t* tnet_proxy_node_socks_plugin_dtor(tsk_object_t * self)
}
#endif /* TNET_SOCKS5_HAVE_AUTH_GSSAPI */
tsk_safeobj_deinit(node);
-
+
TSK_DEBUG_INFO("*** Socks(4/4a/5) proxy node destroyed ***");
}
return self;
}
/* object definition */
-static const tsk_object_def_t thttp_proxy_node_def_s =
-{
+static const tsk_object_def_t thttp_proxy_node_def_s = {
sizeof(tnet_proxy_node_socks_plugin_t),
tnet_proxy_node_socks_plugin_ctor,
tnet_proxy_node_socks_plugin_dtor,
tsk_null,
};
/* plugin definition*/
-static const struct tnet_proxy_node_plugin_def_s tnet_proxy_node_socks_plugin_def_s =
-{
+static const struct tnet_proxy_node_plugin_def_s tnet_proxy_node_socks_plugin_def_s = {
&thttp_proxy_node_def_s,
-
+
(tnet_proxy_type_socks4 | tnet_proxy_type_socks4a | tnet_proxy_type_socks5),
-
+
"SOCKS(4/4a/5) proxy node plugin",
-
+
_tnet_proxy_node_socks_plugin_configure,
_tnet_proxy_node_socks_plugin_start_handshaking,
_tnet_proxy_node_socks_plugin_set_handshaking_data,
diff --git a/tinyNET/src/tnet_proxy_plugin.c b/tinyNET/src/tnet_proxy_plugin.c
index dbcd143..1555dce 100755
--- a/tinyNET/src/tnet_proxy_plugin.c
+++ b/tinyNET/src/tnet_proxy_plugin.c
@@ -34,17 +34,17 @@ const tnet_proxy_node_plugin_def_t* __tnet_proxy_node_plugins[TNET_PROXY_NODE_MA
tsk_bool_t tnet_proxy_node_is_nettransport_supported(enum tnet_proxy_type_e proxy_type, enum tnet_socket_type_e socket_type)
{
switch (proxy_type) {
- case tnet_proxy_type_http:
+ case tnet_proxy_type_http:
case tnet_proxy_type_https:
- return TNET_SOCKET_TYPE_IS_STREAM(socket_type);
-
- case tnet_proxy_type_socks4:
- case tnet_proxy_type_socks4a:
- return TNET_SOCKET_TYPE_IS_STREAM(socket_type) && TNET_SOCKET_TYPE_IS_IPV4(socket_type);
- case tnet_proxy_type_socks5: // SOCKS5 adds support for UDP and IPv6
- return TNET_SOCKET_TYPE_IS_STREAM(socket_type) || TNET_SOCKET_TYPE_IS_DGRAM(socket_type);// for now we don't support socks for UDP (just like a browser)
- default:
- return tsk_false;
+ return TNET_SOCKET_TYPE_IS_STREAM(socket_type);
+
+ case tnet_proxy_type_socks4:
+ case tnet_proxy_type_socks4a:
+ return TNET_SOCKET_TYPE_IS_STREAM(socket_type) && TNET_SOCKET_TYPE_IS_IPV4(socket_type);
+ case tnet_proxy_type_socks5: // SOCKS5 adds support for UDP and IPv6
+ return TNET_SOCKET_TYPE_IS_STREAM(socket_type) || TNET_SOCKET_TYPE_IS_DGRAM(socket_type);// for now we don't support socks for UDP (just like a browser)
+ default:
+ return tsk_false;
}
}
@@ -61,12 +61,12 @@ int tnet_proxy_node_configure(tnet_proxy_node_t* self, ...)
{
va_list ap;
int ret = 0;
-
+
if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
va_start(ap, self);
ret = tnet_proxy_node_configure_2(self, &ap);
va_end(ap);
@@ -77,73 +77,81 @@ int tnet_proxy_node_configure_2(tnet_proxy_node_t* self, va_list* app)
{
int ret = 0;
tnet_proxy_node_param_type_t ptype;
-
+
if (!self || !app) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
while ((ptype = va_arg(*app, tnet_proxy_node_param_type_t)) != tnet_proxy_node_param_type_null) {
switch (ptype) {
- case tnet_proxy_node_param_type_destination_address:
- case tnet_proxy_node_param_type_proxy_address: {
- // (const char*)(HOST_STR), (int)(PORT_INT)
- const char* HOST_STR = va_arg(*app, const char*);
- int PORT_INT = va_arg(*app, int);
- if (PORT_INT < 1 || PORT_INT > 0xFFF) {
- TSK_DEBUG_ERROR("Invalid value for port number: %d", PORT_INT);
- ret = -3;
- goto bail;
- }
- if (ptype == tnet_proxy_node_param_type_destination_address) {
- tsk_strupdate(&self->dst_host, HOST_STR);
- self->dst_port = (tnet_port_t)PORT_INT;
- }
- else {
- tsk_strupdate(&self->proxy_host, HOST_STR);
- self->proxy_port = (tnet_port_t)PORT_INT;
- }
- break;
+ case tnet_proxy_node_param_type_destination_address:
+ case tnet_proxy_node_param_type_proxy_address: {
+ // (const char*)(HOST_STR), (int)(PORT_INT)
+ const char* HOST_STR = va_arg(*app, const char*);
+ int PORT_INT = va_arg(*app, int);
+ if (PORT_INT < 1 || PORT_INT > 0xFFF) {
+ TSK_DEBUG_ERROR("Invalid value for port number: %d", PORT_INT);
+ ret = -3;
+ goto bail;
}
- case tnet_proxy_node_param_type_ipv6: {
- /* (tsk_bool_t)(IPV6_BOOL) */
- self->ipv6 = va_arg(*app, tsk_bool_t);
- break;
+ if (ptype == tnet_proxy_node_param_type_destination_address) {
+ tsk_strupdate(&self->dst_host, HOST_STR);
+ self->dst_port = (tnet_port_t)PORT_INT;
}
- case tnet_proxy_node_param_type_credentials: {
- /* (const char*)(LOGIN_STR), (const char*)(PASSWORD_STR) */
- const char* LOGIN_STR = va_arg(*app, const char*);
- const char* PASSWORD_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->login, LOGIN_STR);
- tsk_strupdate(&self->password, PASSWORD_STR);
- break;
- }
- case tnet_proxy_node_param_type_socket: {
- /* (tnet_fd_t)(FD_FD), (enum tnet_socket_type_e)(type) */
- self->socket.fd = va_arg(*app, tnet_fd_t);
- self->socket.type = va_arg(*app, enum tnet_socket_type_e);
- break;
+ else {
+ tsk_strupdate(&self->proxy_host, HOST_STR);
+ self->proxy_port = (tnet_port_t)PORT_INT;
}
+ break;
+ }
+ case tnet_proxy_node_param_type_ipv6: {
+ /* (tsk_bool_t)(IPV6_BOOL) */
+ self->ipv6 = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case tnet_proxy_node_param_type_credentials: {
+ /* (const char*)(LOGIN_STR), (const char*)(PASSWORD_STR) */
+ const char* LOGIN_STR = va_arg(*app, const char*);
+ const char* PASSWORD_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->login, LOGIN_STR);
+ tsk_strupdate(&self->password, PASSWORD_STR);
+ break;
+ }
+ case tnet_proxy_node_param_type_socket: {
+ /* (tnet_fd_t)(FD_FD), (enum tnet_socket_type_e)(type) */
+ self->socket.fd = va_arg(*app, tnet_fd_t);
+ self->socket.type = va_arg(*app, enum tnet_socket_type_e);
+ break;
+ }
#if TNET_UNDER_APPLE
- case tnet_proxy_node_param_type_cfstreams: {
- /* (CFReadStreamRef)(READ_CFSTREAM), (CFWriteStreamRef)(WRITE_CFSTREAM) */
- CFReadStreamRef READ_CFSTREAM = va_arg(*app, CFReadStreamRef);
- CFWriteStreamRef WRITE_CFSTREAM = va_arg(*app, CFWriteStreamRef);
- if (self->cf_read_stream) CFRelease(self->cf_read_stream), self->cf_read_stream = tsk_null;
- if (self->cf_write_stream) CFRelease(self->cf_write_stream), self->cf_write_stream = tsk_null;
- if (READ_CFSTREAM) self->cf_read_stream = (CFReadStreamRef)CFRetain(READ_CFSTREAM);
- if (WRITE_CFSTREAM) self->cf_write_stream = (CFWriteStreamRef)CFRetain(WRITE_CFSTREAM);
- break;
+ case tnet_proxy_node_param_type_cfstreams: {
+ /* (CFReadStreamRef)(READ_CFSTREAM), (CFWriteStreamRef)(WRITE_CFSTREAM) */
+ CFReadStreamRef READ_CFSTREAM = va_arg(*app, CFReadStreamRef);
+ CFWriteStreamRef WRITE_CFSTREAM = va_arg(*app, CFWriteStreamRef);
+ if (self->cf_read_stream) {
+ CFRelease(self->cf_read_stream), self->cf_read_stream = tsk_null;
}
-#endif /* TNET_UNDER_APPLE */
- default: {
- TSK_DEBUG_ERROR("%d not valid param type", ptype);
- ret = -2;
- goto bail;
+ if (self->cf_write_stream) {
+ CFRelease(self->cf_write_stream), self->cf_write_stream = tsk_null;
+ }
+ if (READ_CFSTREAM) {
+ self->cf_read_stream = (CFReadStreamRef)CFRetain(READ_CFSTREAM);
}
+ if (WRITE_CFSTREAM) {
+ self->cf_write_stream = (CFWriteStreamRef)CFRetain(WRITE_CFSTREAM);
+ }
+ break;
+ }
+#endif /* TNET_UNDER_APPLE */
+ default: {
+ TSK_DEBUG_ERROR("%d not valid param type", ptype);
+ ret = -2;
+ goto bail;
+ }
}
}
-
+
bail:
return ret;
}
@@ -210,16 +218,16 @@ int tnet_proxy_node_plugin_register(const tnet_proxy_node_plugin_def_t* plugin)
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
/* add or replace the plugin */
for (i = 0; i<TNET_PROXY_NODE_MAX_PLUGINS; i++) {
- if (!__tnet_proxy_node_plugins[i] || (__tnet_proxy_node_plugins[i] == plugin)){
+ if (!__tnet_proxy_node_plugins[i] || (__tnet_proxy_node_plugins[i] == plugin)) {
__tnet_proxy_node_plugins[i] = plugin;
TSK_DEBUG_INFO("Register network proxy node plugin: %s", plugin->desc);
return 0;
}
}
-
+
TSK_DEBUG_ERROR("There are already %d network proxy node plugins.", TNET_PROXY_NODE_MAX_PLUGINS);
return -2;
}
@@ -232,7 +240,7 @@ int tnet_proxy_node_plugin_unregister(const tnet_proxy_node_plugin_def_t* plugin
TSK_DEBUG_ERROR("Invalid Parameter");
return -1;
}
-
+
/* find the plugin to unregister */
for (i = 0; i<TNET_PROXY_NODE_MAX_PLUGINS && __tnet_proxy_node_plugins[i]; i++) {
if (__tnet_proxy_node_plugins[i] == plugin) {
@@ -242,7 +250,7 @@ int tnet_proxy_node_plugin_unregister(const tnet_proxy_node_plugin_def_t* plugin
break;
}
}
-
+
/* compact */
if (found) {
for (; i<(TNET_PROXY_NODE_MAX_PLUGINS - 1); i++) {
@@ -262,8 +270,8 @@ tsk_size_t tnet_proxy_node_plugin_registry_count()
{
tsk_size_t count;
for(count = 0;
- count < TNET_PROXY_NODE_MAX_PLUGINS && __tnet_proxy_node_plugins[count];
- ++count) ;
+ count < TNET_PROXY_NODE_MAX_PLUGINS && __tnet_proxy_node_plugins[count];
+ ++count) ;
return count;
}
diff --git a/tinyNET/src/tnet_proxy_plugin.h b/tinyNET/src/tnet_proxy_plugin.h
index 0a247bc..75d9612 100755
--- a/tinyNET/src/tnet_proxy_plugin.h
+++ b/tinyNET/src/tnet_proxy_plugin.h
@@ -35,7 +35,7 @@ TNET_BEGIN_DECLS
typedef struct tnet_proxy_node_s {
TSK_DECLARE_OBJECT;
-
+
enum tnet_proxy_type_e type;
tsk_bool_t ipv6;
char* dst_host;
@@ -52,7 +52,7 @@ typedef struct tnet_proxy_node_s {
CFReadStreamRef cf_read_stream;
CFWriteStreamRef cf_write_stream;
#endif /* TNET_UNDER_APPLE */
-
+
const struct tnet_proxy_node_plugin_def_s* plugin;
}
tnet_proxy_node_t;
@@ -60,8 +60,7 @@ tnet_proxy_node_t;
#define TNET_PROXY_NODE(self) ((tnet_proxy_node_t*)(self))
#define TNET_DECLARE_PROXY_NONE tnet_proxy_node_t __node__
-typedef enum tnet_proxy_node_param_type_e
-{
+typedef enum tnet_proxy_node_param_type_e {
tnet_proxy_node_param_type_null = 0,
tnet_proxy_node_param_type_destination_address,
tnet_proxy_node_param_type_proxy_address,
@@ -85,17 +84,16 @@ tnet_proxy_node_param_type_t;
#endif /* TNET_UNDER_APPLE */
/** Virtual table used to define a proxy node plugin */
-typedef struct tnet_proxy_node_plugin_def_s
-{
+typedef struct tnet_proxy_node_plugin_def_s {
//! object definition used to create an instance of the plugin
const tsk_object_def_t* objdef;
-
+
//! plugin type
enum tnet_proxy_type_e type;
-
+
//! full description (usefull for debugging)
const char* desc;
-
+
int (* configure) (tnet_proxy_node_t* self, ...);
int (* start_handshaking) (tnet_proxy_node_t* self);
int (* set_handshaking_data) (tnet_proxy_node_t* self, const void* data_ptr, tsk_size_t data_size);
diff --git a/tinyNET/src/tnet_proxydetect.c b/tinyNET/src/tnet_proxydetect.c
index 162985c..af0bec7 100755
--- a/tinyNET/src/tnet_proxydetect.c
+++ b/tinyNET/src/tnet_proxydetect.c
@@ -29,29 +29,28 @@ static tsk_object_t* _tnet_proxyinfo_ctor(tsk_object_t * self, va_list * app)
{
tnet_proxyinfo_t *info = (tnet_proxyinfo_t *)self;
if (info) {
-
+
}
return self;
}
static tsk_object_t* _tnet_proxyinfo_dtor(tsk_object_t * self)
{
tnet_proxyinfo_t *info = (tnet_proxyinfo_t *)self;
- if (info){
+ if (info) {
TSK_FREE(info->autoconfig_url);
TSK_FREE(info->bypass_list);
TSK_FREE(info->hostname);
TSK_FREE(info->username);
TSK_FREE(info->password);
}
-
+
return self;
}
-static const tsk_object_def_t tnet_proxyinfo_def_s =
-{
+static const tsk_object_def_t tnet_proxyinfo_def_s = {
sizeof(tnet_proxyinfo_t),
_tnet_proxyinfo_ctor,
_tnet_proxyinfo_dtor,
- tsk_null,
+ tsk_null,
};
const tsk_object_def_t *tnet_proxyinfo_def_t = &tnet_proxyinfo_def_s;
@@ -62,7 +61,7 @@ tnet_proxyinfo_t* tnet_proxyinfo_create()
TSK_DEBUG_ERROR("Failed to creatr 'tnet_proxyinfo_t' instance");
return info;
}
-
+
return info;
}
@@ -121,7 +120,7 @@ tnet_proxyinfo_t* tnet_proxydetect_get_info(const char* url, tnet_socket_type_t
TSK_DEBUG_ERROR("CFNetworkCopySystemProxySettings returned nil");
goto resolve_done;
}
-
+
cfProxies = CFNetworkCopyProxiesForURL(cfTargetUrl, cfProxySettings);
if (!cfProxies) {
TSK_DEBUG_ERROR("CFNetworkCopyProxiesForURL returned 0-array");
@@ -129,8 +128,8 @@ tnet_proxyinfo_t* tnet_proxydetect_get_info(const char* url, tnet_socket_type_t
}
// find best proxy
_appl_find_best_proxy(cfTargetUrl, cfProxies, &_info);
-
-
+
+
resolve_done:
if (cfUrl) {
CFRelease(cfUrl);
@@ -144,7 +143,7 @@ resolve_done:
if (cfProxies) {
CFRelease(cfProxies);
}
-
+
if (_appl_proxyinfo_is_valid(&_info)) {
info = tnet_proxyinfo_create();
if (info) {
@@ -157,7 +156,7 @@ resolve_done:
}
}
_appl_proxyinfo_release(&_info);
-
+
return info;
}
@@ -165,8 +164,8 @@ static tsk_bool_t _appl_proxyinfo_is_valid(const appl_proxyinfo_xt * info)
{
if (info) {
return info->port
- && info->type && !CFEqual(info->type, kCFProxyTypeNone)
- && info->host && CFStringGetLength(info->host) > 0 && CFStringCompare(info->host, CFSTR("127.0.0.1"), 0) != kCFCompareEqualTo;
+ && info->type && !CFEqual(info->type, kCFProxyTypeNone)
+ && info->host && CFStringGetLength(info->host) > 0 && CFStringCompare(info->host, CFSTR("127.0.0.1"), 0) != kCFCompareEqualTo;
}
return tsk_false;
}
@@ -201,7 +200,8 @@ static void _ProxyAutoConfigurationResultCallback(void *client, CFArrayRef proxy
CFTypeRef* cfResult = (CFTypeRef*)client;
if (error != NULL) {
*cfResult = CFRetain(error);
- } else {
+ }
+ else {
*cfResult = CFRetain(proxyList);
}
CFRunLoopStop(CFRunLoopGetCurrent());
@@ -212,14 +212,14 @@ static void _appl_find_best_proxy(CFURLRef cfTargetURL, CFArrayRef _cfProxies, a
CFDictionaryRef cfProxy;
CFIndex index = 0;
CFIndex count = CFArrayGetCount(_cfProxies);
-
+
while (index < count && (cfProxy = CFArrayGetValueAtIndex(_cfProxies, index++)) && !_appl_proxyinfo_is_valid(_proxyInfo)) {
_appl_proxyinfo_release(_proxyInfo);
CFStringRef cfProxyType = CFDictionaryGetValue(cfProxy, (const void*)kCFProxyTypeKey);
if (!cfProxyType) {
continue;
}
-
+
TSK_DEBUG_INFO("Found at %li proxy type = %s", (index - 1), CFStringGetCStringPtr(cfProxyType, kCFStringEncodingUTF8));
if (CFEqual(cfProxyType, kCFProxyTypeNone)) {
continue;
@@ -255,9 +255,9 @@ static void _appl_find_best_proxy(CFURLRef cfTargetURL, CFArrayRef _cfProxies, a
CFTypeRef cfResult = NULL;
CFStreamClientContext context = { 0, &cfResult, NULL, NULL, NULL };
CFRunLoopSourceRef cfrunLoop = CFNetworkExecuteProxyAutoConfigurationURL(cfPACUrl,
- cfTargetURL,
- _ProxyAutoConfigurationResultCallback,
- &context);
+ cfTargetURL,
+ _ProxyAutoConfigurationResultCallback,
+ &context);
if (!cfrunLoop) {
TSK_DEBUG_ERROR("CFNetworkExecuteProxyAutoConfigurationURL(%li, %s) failed", (index - 1), CFStringGetCStringPtr(CFURLGetString(cfPACUrl), kCFStringEncodingUTF8));
continue;
diff --git a/tinyNET/src/tnet_proxydetect.h b/tinyNET/src/tnet_proxydetect.h
index 23c5439..1f5597c 100755
--- a/tinyNET/src/tnet_proxydetect.h
+++ b/tinyNET/src/tnet_proxydetect.h
@@ -27,17 +27,17 @@
TNET_BEGIN_DECLS
typedef struct tnet_proxyinfo_s {
- TSK_DECLARE_OBJECT;
+ TSK_DECLARE_OBJECT;
- tnet_proxy_type_t type;
- char* autoconfig_url;
- tsk_bool_t autodetect;
- char* bypass_list;
+ tnet_proxy_type_t type;
+ char* autoconfig_url;
+ tsk_bool_t autodetect;
+ char* bypass_list;
char* hostname;
tnet_socket_type_t socket_type;
tnet_port_t port;
- char* username;
- char* password;
+ char* username;
+ char* password;
}
tnet_proxyinfo_t;
diff --git a/tinyNET/src/tnet_socket.c b/tinyNET/src/tnet_socket.c
index 2d104d1..5f071de 100755
--- a/tinyNET/src/tnet_socket.c
+++ b/tinyNET/src/tnet_socket.c
@@ -93,133 +93,133 @@ static int tnet_socket_close(tnet_socket_t *sock);
*/
tnet_socket_t* tnet_socket_create_2(const char* host, tnet_port_t port_, tnet_socket_type_t type, tsk_bool_t nonblocking, tsk_bool_t bindsocket)
{
- tnet_socket_t *sock;
- if ((sock = tsk_object_new(tnet_socket_def_t))) {
- int status;
- tsk_istr_t port;
- struct addrinfo *result = tsk_null;
- struct addrinfo *ptr = tsk_null;
- struct addrinfo hints;
- tnet_host_t local_hostname;
-
- sock->port = port_;
- tsk_itoa(sock->port, &port);
- sock->type = type;
-
- memset(local_hostname, 0, sizeof(local_hostname));
-
- /* Get the local host name */
- if (host != TNET_SOCKET_HOST_ANY && !tsk_strempty(host)){
- memcpy(local_hostname, host, tsk_strlen(host) > sizeof(local_hostname) - 1 ? sizeof(local_hostname) - 1 : tsk_strlen(host));
- }
- else{
- if (TNET_SOCKET_TYPE_IS_IPV6(sock->type)){
- memcpy(local_hostname, "::", 2);
- }
- else {
- memcpy(local_hostname, "0.0.0.0", 7);
- }
- }
-
- /* hints address info structure */
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = TNET_SOCKET_TYPE_IS_IPV46(sock->type) ? AF_UNSPEC : (TNET_SOCKET_TYPE_IS_IPV6(sock->type) ? AF_INET6 : AF_INET);
- hints.ai_socktype = TNET_SOCKET_TYPE_IS_STREAM(sock->type) ? SOCK_STREAM : SOCK_DGRAM;
- hints.ai_protocol = TNET_SOCKET_TYPE_IS_STREAM(sock->type) ? IPPROTO_TCP : IPPROTO_UDP;
- hints.ai_flags = AI_PASSIVE
+ tnet_socket_t *sock;
+ if ((sock = tsk_object_new(tnet_socket_def_t))) {
+ int status;
+ tsk_istr_t port;
+ struct addrinfo *result = tsk_null;
+ struct addrinfo *ptr = tsk_null;
+ struct addrinfo hints;
+ tnet_host_t local_hostname;
+
+ sock->port = port_;
+ tsk_itoa(sock->port, &port);
+ sock->type = type;
+
+ memset(local_hostname, 0, sizeof(local_hostname));
+
+ /* Get the local host name */
+ if (host != TNET_SOCKET_HOST_ANY && !tsk_strempty(host)) {
+ memcpy(local_hostname, host, tsk_strlen(host) > sizeof(local_hostname) - 1 ? sizeof(local_hostname) - 1 : tsk_strlen(host));
+ }
+ else {
+ if (TNET_SOCKET_TYPE_IS_IPV6(sock->type)) {
+ memcpy(local_hostname, "::", 2);
+ }
+ else {
+ memcpy(local_hostname, "0.0.0.0", 7);
+ }
+ }
+
+ /* hints address info structure */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = TNET_SOCKET_TYPE_IS_IPV46(sock->type) ? AF_UNSPEC : (TNET_SOCKET_TYPE_IS_IPV6(sock->type) ? AF_INET6 : AF_INET);
+ hints.ai_socktype = TNET_SOCKET_TYPE_IS_STREAM(sock->type) ? SOCK_STREAM : SOCK_DGRAM;
+ hints.ai_protocol = TNET_SOCKET_TYPE_IS_STREAM(sock->type) ? IPPROTO_TCP : IPPROTO_UDP;
+ hints.ai_flags = AI_PASSIVE
#if !TNET_UNDER_WINDOWS || _WIN32_WINNT>=0x600
- | AI_ADDRCONFIG
+ | AI_ADDRCONFIG
#endif
- ;
-
- /* Performs getaddrinfo */
- if ((status = tnet_getaddrinfo(local_hostname, port, &hints, &result))) {
- TNET_PRINT_LAST_ERROR("tnet_getaddrinfo(family=%d, hostname=%s and port=%s) failed: [%s]",
- hints.ai_family, local_hostname, port, tnet_gai_strerror(status));
- goto bail;
- }
-
- /* Find our address. */
- for (ptr = result; ptr; ptr = ptr->ai_next){
- sock->fd = (tnet_fd_t)tnet_soccket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);
- if (ptr->ai_family != AF_INET6 && ptr->ai_family != AF_INET){
- continue;
- }
- /* To avoid "Address already in use" error
- * Check issue 368 (https://code.google.com/p/doubango/issues/detail?id=368) to understand why it's not used for UDP/DTLS.
- */
- //
- if (TNET_SOCKET_TYPE_IS_STREAM(sock->type)) {
- if ((status = tnet_sockfd_reuseaddr(sock->fd, 1))) {
- // do not break...continue
- }
- }
-
- if (bindsocket){
- /* Bind the socket */
- if ((status = bind(sock->fd, ptr->ai_addr, (int)ptr->ai_addrlen))){
- TNET_PRINT_LAST_ERROR("bind to [%s:%s]have failed", local_hostname, port);
- tnet_socket_close(sock);
- continue;
- }
-
- /* Get local IP string. */
- if ((status = tnet_get_ip_n_port(sock->fd, tsk_true/*local*/, &sock->ip, &sock->port))) /* % */
- //if((status = tnet_getnameinfo(ptr->ai_addr, ptr->ai_addrlen, sock->ip, sizeof(sock->ip), 0, 0, NI_NUMERICHOST)))
- {
- TNET_PRINT_LAST_ERROR("Failed to get local IP and port.");
- tnet_socket_close(sock);
- continue;
- }
- }
-
- /* sets the real socket type (if ipv46) */
- if (ptr->ai_family == AF_INET6) {
- TNET_SOCKET_TYPE_SET_IPV6Only(sock->type);
- }
- else {
- TNET_SOCKET_TYPE_SET_IPV4Only(sock->type);
- }
- break;
- }
-
- /* Check socket validity. */
- if (!TNET_SOCKET_IS_VALID(sock)) {
- TNET_PRINT_LAST_ERROR("Invalid socket.");
- goto bail;
- }
+ ;
+
+ /* Performs getaddrinfo */
+ if ((status = tnet_getaddrinfo(local_hostname, port, &hints, &result))) {
+ TNET_PRINT_LAST_ERROR("tnet_getaddrinfo(family=%d, hostname=%s and port=%s) failed: [%s]",
+ hints.ai_family, local_hostname, port, tnet_gai_strerror(status));
+ goto bail;
+ }
+
+ /* Find our address. */
+ for (ptr = result; ptr; ptr = ptr->ai_next) {
+ sock->fd = (tnet_fd_t)tnet_soccket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);
+ if (ptr->ai_family != AF_INET6 && ptr->ai_family != AF_INET) {
+ continue;
+ }
+ /* To avoid "Address already in use" error
+ * Check issue 368 (https://code.google.com/p/doubango/issues/detail?id=368) to understand why it's not used for UDP/DTLS.
+ */
+ //
+ if (TNET_SOCKET_TYPE_IS_STREAM(sock->type)) {
+ if ((status = tnet_sockfd_reuseaddr(sock->fd, 1))) {
+ // do not break...continue
+ }
+ }
+
+ if (bindsocket) {
+ /* Bind the socket */
+ if ((status = bind(sock->fd, ptr->ai_addr, (int)ptr->ai_addrlen))) {
+ TNET_PRINT_LAST_ERROR("bind to [%s:%s]have failed", local_hostname, port);
+ tnet_socket_close(sock);
+ continue;
+ }
+
+ /* Get local IP string. */
+ if ((status = tnet_get_ip_n_port(sock->fd, tsk_true/*local*/, &sock->ip, &sock->port))) /* % */
+ //if((status = tnet_getnameinfo(ptr->ai_addr, ptr->ai_addrlen, sock->ip, sizeof(sock->ip), 0, 0, NI_NUMERICHOST)))
+ {
+ TNET_PRINT_LAST_ERROR("Failed to get local IP and port.");
+ tnet_socket_close(sock);
+ continue;
+ }
+ }
+
+ /* sets the real socket type (if ipv46) */
+ if (ptr->ai_family == AF_INET6) {
+ TNET_SOCKET_TYPE_SET_IPV6Only(sock->type);
+ }
+ else {
+ TNET_SOCKET_TYPE_SET_IPV4Only(sock->type);
+ }
+ break;
+ }
+
+ /* Check socket validity. */
+ if (!TNET_SOCKET_IS_VALID(sock)) {
+ TNET_PRINT_LAST_ERROR("Invalid socket.");
+ goto bail;
+ }
#if TNET_UNDER_IPHONE || TNET_UNDER_IPHONE_SIMULATOR
- /* disable SIGPIPE signal */
- {
- int yes = 1;
- if (setsockopt(sock->fd, SOL_SOCKET, SO_NOSIGPIPE, (char*)&yes, sizeof(int))){
- TNET_PRINT_LAST_ERROR("setsockopt(SO_NOSIGPIPE) have failed.");
- }
- }
+ /* disable SIGPIPE signal */
+ {
+ int yes = 1;
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_NOSIGPIPE, (char*)&yes, sizeof(int))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SO_NOSIGPIPE) have failed.");
+ }
+ }
#endif /* TNET_UNDER_IPHONE */
- /* Sets the socket to nonblocking mode */
- if(nonblocking){
- if((status = tnet_sockfd_set_nonblocking(sock->fd))){
- goto bail;
- }
- }
-
- bail:
- /* Free addrinfo */
- tnet_freeaddrinfo(result);
-
- /* Close socket if failed. */
- if (status){
- if (TNET_SOCKET_IS_VALID(sock)){
- tnet_socket_close(sock);
- }
- return tsk_null;
- }
-}
+ /* Sets the socket to nonblocking mode */
+ if(nonblocking) {
+ if((status = tnet_sockfd_set_nonblocking(sock->fd))) {
+ goto bail;
+ }
+ }
+
+bail:
+ /* Free addrinfo */
+ tnet_freeaddrinfo(result);
- return sock;
+ /* Close socket if failed. */
+ if (status) {
+ if (TNET_SOCKET_IS_VALID(sock)) {
+ tnet_socket_close(sock);
+ }
+ return tsk_null;
+ }
+ }
+
+ return sock;
}
/**@ingroup tnet_socket_group
@@ -232,7 +232,7 @@ tnet_socket_t* tnet_socket_create_2(const char* host, tnet_port_t port_, tnet_so
*/
tnet_socket_t* tnet_socket_create(const char* host, tnet_port_t port, tnet_socket_type_t type)
{
- return tnet_socket_create_2(host, port, type, tsk_true, tsk_true);
+ return tnet_socket_create_2(host, port, type, tsk_true, tsk_true);
}
/**@ingroup tnet_socket_group
@@ -240,15 +240,15 @@ tnet_socket_t* tnet_socket_create(const char* host, tnet_port_t port, tnet_socke
*/
int tnet_socket_send_stream(tnet_socket_t* self, const void* data, tsk_size_t size)
{
- if (!self || self->fd == TNET_INVALID_FD || !data || !size || !TNET_SOCKET_TYPE_IS_STREAM(self->type)) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (self->tlshandle && (TNET_SOCKET_TYPE_IS_TLS(self->type) || TNET_SOCKET_TYPE_IS_WSS(self->type))) {
- return tnet_tls_socket_send(self->tlshandle, data, size) == 0 ? (int)size : -1; // returns zero on success
- }
-
- return (int)tnet_sockfd_send(self->fd, data, size, 0);
+ if (!self || self->fd == TNET_INVALID_FD || !data || !size || !TNET_SOCKET_TYPE_IS_STREAM(self->type)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (self->tlshandle && (TNET_SOCKET_TYPE_IS_TLS(self->type) || TNET_SOCKET_TYPE_IS_WSS(self->type))) {
+ return tnet_tls_socket_send(self->tlshandle, data, size) == 0 ? (int)size : -1; // returns zero on success
+ }
+
+ return (int)tnet_sockfd_send(self->fd, data, size, 0);
}
/**@ingroup tnet_socket_group
@@ -264,7 +264,7 @@ int tnet_socket_handle_brokenpipe(tnet_socket_t* self)
}
fd_old = self->fd;
fd_new = TNET_INVALID_FD;
-
+
// close old fd
ret = tnet_sockfd_close(&self->fd);
// try to create an fd binding to the same address
@@ -277,7 +277,7 @@ int tnet_socket_handle_brokenpipe(tnet_socket_t* self)
/* disable SIGPIPE signal */
{
int yes = 1;
- if (setsockopt(fd_new, SOL_SOCKET, SO_NOSIGPIPE, (char*)&yes, sizeof(int))){
+ if (setsockopt(fd_new, SOL_SOCKET, SO_NOSIGPIPE, (char*)&yes, sizeof(int))) {
TNET_PRINT_LAST_ERROR("setsockopt(%d, SO_NOSIGPIPE) have failed", fd_new);
}
}
@@ -294,7 +294,7 @@ int tnet_socket_handle_brokenpipe(tnet_socket_t* self)
**/
static int tnet_socket_close(tnet_socket_t *sock)
{
- return tnet_sockfd_close(&(sock->fd));
+ return tnet_sockfd_close(&(sock->fd));
}
//=================================================================================================
@@ -302,37 +302,36 @@ static int tnet_socket_close(tnet_socket_t *sock)
//
static tsk_object_t* tnet_socket_ctor(tsk_object_t * self, va_list * app)
{
- tnet_socket_t *sock = self;
- if (sock){
- }
- return self;
+ tnet_socket_t *sock = self;
+ if (sock) {
+ }
+ return self;
}
static tsk_object_t* tnet_socket_dtor(tsk_object_t * self)
{
- tnet_socket_t *sock = self;
+ tnet_socket_t *sock = self;
- if (sock){
- /* Close the socket */
- if (TNET_SOCKET_IS_VALID(sock)){
- tnet_socket_close(sock);
- }
- /* Clean up TLS handle */
- TSK_OBJECT_SAFE_FREE(sock->tlshandle);
+ if (sock) {
+ /* Close the socket */
+ if (TNET_SOCKET_IS_VALID(sock)) {
+ tnet_socket_close(sock);
+ }
+ /* Clean up TLS handle */
+ TSK_OBJECT_SAFE_FREE(sock->tlshandle);
- /* Clean up DTLS handle */
- TSK_OBJECT_SAFE_FREE(sock->dtlshandle);
- }
+ /* Clean up DTLS handle */
+ TSK_OBJECT_SAFE_FREE(sock->dtlshandle);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tnet_socket_def_s =
-{
- sizeof(tnet_socket_t),
- tnet_socket_ctor,
- tnet_socket_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_socket_def_s = {
+ sizeof(tnet_socket_t),
+ tnet_socket_ctor,
+ tnet_socket_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_socket_def_t = &tnet_socket_def_s;
diff --git a/tinyNET/src/tnet_socket.h b/tinyNET/src/tnet_socket.h
index 3c7dc34..daceb53 100755
--- a/tinyNET/src/tnet_socket.h
+++ b/tinyNET/src/tnet_socket.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,9 +38,8 @@
TNET_BEGIN_DECLS
-typedef enum tnet_socket_type_e
-{
- tnet_socket_type_invalid = 0x0000, /**< Invalid socket.*/
+typedef enum tnet_socket_type_e {
+ tnet_socket_type_invalid = 0x0000, /**< Invalid socket.*/
#define TNET_SOCKET_TYPE_IPV4 (0x0001 << 0)
#define TNET_SOCKET_TYPE_UDP (0x0001 << 1)
@@ -50,53 +49,53 @@ typedef enum tnet_socket_type_e
#define TNET_SOCKET_TYPE_SCTP (0x0001 << 5)
#define TNET_SOCKET_TYPE_WS (0x0001 << 6)
#define TNET_SOCKET_TYPE_WSS (0x0001 << 7)
- tnet_socket_type_udp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_UDP), /**< UDP/IPv4 socket.*/
- tnet_socket_type_dtls_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_DTLS), /**< DTLS/IPv4 socket.*/
- tnet_socket_type_tcp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_TCP), /**< TCP/IPv4 socket.*/
- tnet_socket_type_tls_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_TLS), /**< TLS/IPv4 socket.*/
- tnet_socket_type_sctp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_SCTP), /**< SCTP/IPv4 socket.*/
- tnet_socket_type_ws_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_WS), /**< WebSocket/IPv4 socket.*/
- tnet_socket_type_wss_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_WSS), /**< WebSocket Secure/IPv4 socket.*/
+ tnet_socket_type_udp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_UDP), /**< UDP/IPv4 socket.*/
+ tnet_socket_type_dtls_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_DTLS), /**< DTLS/IPv4 socket.*/
+ tnet_socket_type_tcp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_TCP), /**< TCP/IPv4 socket.*/
+ tnet_socket_type_tls_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_TLS), /**< TLS/IPv4 socket.*/
+ tnet_socket_type_sctp_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_SCTP), /**< SCTP/IPv4 socket.*/
+ tnet_socket_type_ws_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_WS), /**< WebSocket/IPv4 socket.*/
+ tnet_socket_type_wss_ipv4 = (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_WSS), /**< WebSocket Secure/IPv4 socket.*/
#define TNET_SOCKET_TYPE_IPSEC (0x0001 << 8)
- tnet_socket_type_udp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv4), /**< UDP/IPSec/IPv4 socket.*/
- tnet_socket_type_dtls_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_dtls_ipv4), /**< DTLS/IPSec/IPv4 socket.*/
- tnet_socket_type_tcp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv4), /**< TCP/IPSec/IPv4 socket.*/
- tnet_socket_type_tls_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv4), /**< TLS/IPSec /IPv4socket.*/
- tnet_socket_type_sctp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv4), /**< SCTP/IPSec/IPv4 socket.*/
- tnet_socket_type_ws_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv4), /**< WS/IPSec/IPv4 socket.*/
- tnet_socket_type_wss_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv4), /**< WSS/IPSec/IPv4 socket.*/
+ tnet_socket_type_udp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv4), /**< UDP/IPSec/IPv4 socket.*/
+ tnet_socket_type_dtls_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_dtls_ipv4), /**< DTLS/IPSec/IPv4 socket.*/
+ tnet_socket_type_tcp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv4), /**< TCP/IPSec/IPv4 socket.*/
+ tnet_socket_type_tls_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv4), /**< TLS/IPSec /IPv4socket.*/
+ tnet_socket_type_sctp_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv4), /**< SCTP/IPSec/IPv4 socket.*/
+ tnet_socket_type_ws_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv4), /**< WS/IPSec/IPv4 socket.*/
+ tnet_socket_type_wss_ipsec_ipv4 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv4), /**< WSS/IPSec/IPv4 socket.*/
#define TNET_SOCKET_TYPE_IPV6 (0x0001 << 12)
- tnet_socket_type_udp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_udp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< UDP/IPv6 socket.*/
- tnet_socket_type_dtls_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_dtls_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< DTLS/IPv6 socket.*/
- tnet_socket_type_tcp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_tcp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< TCP/IPv6 socket.*/
- tnet_socket_type_tls_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_tls_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< TLS/IPv6 socket.*/
- tnet_socket_type_sctp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_sctp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< SCTP/IPv6 socket.*/
- tnet_socket_type_ws_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_ws_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< WS/IPv6 socket.*/
- tnet_socket_type_wss_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_wss_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< WSS/IPv6 socket.*/
- tnet_socket_type_udp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv6), /**< UDP/IPSec/IPv6 socket.*/
- tnet_socket_type_tcp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv6), /**< TCP/IPSec/IPv6 socket.*/
- tnet_socket_type_tls_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv6), /**< TLS/IPSec/IPv6 socket.*/
- tnet_socket_type_sctp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv6),/**< SCTP/IPSec/IPv6 socket.*/
- tnet_socket_type_ws_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv6), /**< WS/IPSec/IPv6 socket.*/
- tnet_socket_type_wss_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv6),/**< WSS/IPSec/IPv6 socket.*/
+ tnet_socket_type_udp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_udp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< UDP/IPv6 socket.*/
+ tnet_socket_type_dtls_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_dtls_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< DTLS/IPv6 socket.*/
+ tnet_socket_type_tcp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_tcp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< TCP/IPv6 socket.*/
+ tnet_socket_type_tls_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_tls_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< TLS/IPv6 socket.*/
+ tnet_socket_type_sctp_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_sctp_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< SCTP/IPv6 socket.*/
+ tnet_socket_type_ws_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_ws_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< WS/IPv6 socket.*/
+ tnet_socket_type_wss_ipv6 = (TNET_SOCKET_TYPE_IPV6 | (tnet_socket_type_wss_ipv4 ^ TNET_SOCKET_TYPE_IPV4)), /**< WSS/IPv6 socket.*/
+ tnet_socket_type_udp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv6), /**< UDP/IPSec/IPv6 socket.*/
+ tnet_socket_type_tcp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv6), /**< TCP/IPSec/IPv6 socket.*/
+ tnet_socket_type_tls_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv6), /**< TLS/IPSec/IPv6 socket.*/
+ tnet_socket_type_sctp_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv6),/**< SCTP/IPSec/IPv6 socket.*/
+ tnet_socket_type_ws_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv6), /**< WS/IPSec/IPv6 socket.*/
+ tnet_socket_type_wss_ipsec_ipv6 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv6),/**< WSS/IPSec/IPv6 socket.*/
#define TNET_SOCKET_TYPE_IPV46 (TNET_SOCKET_TYPE_IPV4 | TNET_SOCKET_TYPE_IPV6)
- tnet_socket_type_udp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_udp_ipv4 | tnet_socket_type_udp_ipv6)), /**< UDP/IPv4/6 socket.*/
- tnet_socket_type_dtls_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_dtls_ipv4 | tnet_socket_type_dtls_ipv6)), /**< DTLS/IPv4/6 socket.*/
- tnet_socket_type_tcp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_tcp_ipv4 | tnet_socket_type_tcp_ipv6)), /**< TCP/IPv4/6 socket.*/
- tnet_socket_type_tls_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_tls_ipv4 | tnet_socket_type_tls_ipv6)), /**< TLS/IPv4/6 socket.*/
- tnet_socket_type_sctp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_sctp_ipv4 | tnet_socket_type_sctp_ipv6)), /**< SCTP/IPv4/6 socket.*/
- tnet_socket_type_ws_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_ws_ipv4 | tnet_socket_type_ws_ipv6)), /**< WS/IPv4/6 socket.*/
- tnet_socket_type_wss_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_wss_ipv4 | tnet_socket_type_wss_ipv6)), /**< WSS/IPv4/6 socket.*/
- tnet_socket_type_udp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv46), /**< UDP/IPSec/IPv4/6 socket.*/
- tnet_socket_type_dtls_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_dtls_ipv46), /**< DTLS/IPSec/IPv4/6 socket.*/
- tnet_socket_type_tcp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv46), /**< TCP/IPSec/IPv4/6 socket.*/
- tnet_socket_type_tls_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv46), /**< TLS/IPSec/IPv4/6 socket.*/
- tnet_socket_type_sctp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv46),/**< SCTP/IPSec/IPv4/6 socket.*/
- tnet_socket_type_ws_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv46),/**< WS/IPSec/IPv4/6 socket.*/
- tnet_socket_type_wss_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv46),/**< WSS/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_udp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_udp_ipv4 | tnet_socket_type_udp_ipv6)), /**< UDP/IPv4/6 socket.*/
+ tnet_socket_type_dtls_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_dtls_ipv4 | tnet_socket_type_dtls_ipv6)), /**< DTLS/IPv4/6 socket.*/
+ tnet_socket_type_tcp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_tcp_ipv4 | tnet_socket_type_tcp_ipv6)), /**< TCP/IPv4/6 socket.*/
+ tnet_socket_type_tls_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_tls_ipv4 | tnet_socket_type_tls_ipv6)), /**< TLS/IPv4/6 socket.*/
+ tnet_socket_type_sctp_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_sctp_ipv4 | tnet_socket_type_sctp_ipv6)), /**< SCTP/IPv4/6 socket.*/
+ tnet_socket_type_ws_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_ws_ipv4 | tnet_socket_type_ws_ipv6)), /**< WS/IPv4/6 socket.*/
+ tnet_socket_type_wss_ipv46 = (TNET_SOCKET_TYPE_IPV46 | (tnet_socket_type_wss_ipv4 | tnet_socket_type_wss_ipv6)), /**< WSS/IPv4/6 socket.*/
+ tnet_socket_type_udp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_udp_ipv46), /**< UDP/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_dtls_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_dtls_ipv46), /**< DTLS/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_tcp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tcp_ipv46), /**< TCP/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_tls_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_tls_ipv46), /**< TLS/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_sctp_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_sctp_ipv46),/**< SCTP/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_ws_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_ws_ipv46),/**< WS/IPSec/IPv4/6 socket.*/
+ tnet_socket_type_wss_ipsec_ipv46 = (TNET_SOCKET_TYPE_IPSEC | tnet_socket_type_wss_ipv46),/**< WSS/IPSec/IPv4/6 socket.*/
}
tnet_socket_type_t;
@@ -165,17 +164,16 @@ tnet_socket_type_t;
/**
* Socket.
*/
-typedef struct tnet_socket_s
-{
- TSK_DECLARE_OBJECT;
-
- tnet_socket_type_t type;
- tnet_fd_t fd;
- tnet_ip_t ip;
- uint16_t port;
-
- tnet_tls_socket_handle_t* tlshandle;
- tnet_dtls_socket_handle_t* dtlshandle;
+typedef struct tnet_socket_s {
+ TSK_DECLARE_OBJECT;
+
+ tnet_socket_type_t type;
+ tnet_fd_t fd;
+ tnet_ip_t ip;
+ uint16_t port;
+
+ tnet_tls_socket_handle_t* tlshandle;
+ tnet_dtls_socket_handle_t* dtlshandle;
}
tnet_socket_t;
diff --git a/tinyNET/src/tnet_transport.c b/tinyNET/src/tnet_transport.c
index 7d26d08..fe9810e 100755
--- a/tinyNET/src/tnet_transport.c
+++ b/tinyNET/src/tnet_transport.c
@@ -56,7 +56,7 @@ static int _tnet_transport_dtls_cb(const void* usrdata, tnet_dtls_socket_event_t
static int _tnet_transport_ssl_init(tnet_transport_t* transport)
{
- if (!transport){
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -65,20 +65,20 @@ static int _tnet_transport_ssl_init(tnet_transport_t* transport)
tnet_socket_type_t type = tnet_transport_get_type(transport);
tsk_bool_t is_tls = (TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type));
tsk_bool_t is_dtls = transport->dtls.enabled/* TNET_SOCKET_TYPE_IS_DTLS(type)*/; // DTLS-RTP, not raw DTLS
- if (is_dtls && !tnet_dtls_is_supported()){
+ if (is_dtls && !tnet_dtls_is_supported()) {
TSK_DEBUG_ERROR("Requesting to create DTLS transport but source code not built with support for this feature");
return -1;
}
- if (is_tls && !tnet_tls_is_supported()){
+ if (is_tls && !tnet_tls_is_supported()) {
TSK_DEBUG_ERROR("Requesting to create TLS transport but source code not built with support for this feature");
return -1;
}
- if ((transport->tls.enabled = is_tls)){
- if (!transport->tls.ctx_client && !(transport->tls.ctx_client = SSL_CTX_new(SSLv23_client_method()))){
+ if ((transport->tls.enabled = is_tls)) {
+ if (!transport->tls.ctx_client && !(transport->tls.ctx_client = SSL_CTX_new(SSLv23_client_method()))) {
TSK_DEBUG_ERROR("Failed to create SSL client context");
return -2;
}
- if (!transport->tls.ctx_server && !(transport->tls.ctx_server = SSL_CTX_new(SSLv23_server_method()))){
+ if (!transport->tls.ctx_server && !(transport->tls.ctx_server = SSL_CTX_new(SSLv23_server_method()))) {
TSK_DEBUG_ERROR("Failed to create SSL server context");
return -3;
}
@@ -86,56 +86,56 @@ static int _tnet_transport_ssl_init(tnet_transport_t* transport)
SSL_CTX_set_mode(transport->tls.ctx_server, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify(transport->tls.ctx_server, SSL_VERIFY_NONE, tsk_null); // to be updated by tnet_transport_tls_set_certs()
SSL_CTX_set_verify(transport->tls.ctx_client, SSL_VERIFY_NONE, tsk_null); // to be updated by tnet_transport_tls_set_certs()
- if (SSL_CTX_set_cipher_list(transport->tls.ctx_client, TNET_CIPHER_LIST) <= 0 || SSL_CTX_set_cipher_list(transport->tls.ctx_server, TNET_CIPHER_LIST) <= 0){
+ if (SSL_CTX_set_cipher_list(transport->tls.ctx_client, TNET_CIPHER_LIST) <= 0 || SSL_CTX_set_cipher_list(transport->tls.ctx_server, TNET_CIPHER_LIST) <= 0) {
TSK_DEBUG_ERROR("SSL_CTX_set_cipher_list failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
return -4;
}
}
#if HAVE_OPENSSL_DTLS
- if ((transport->dtls.enabled = is_dtls)){
- if (!transport->dtls.ctx && !(transport->dtls.ctx = SSL_CTX_new(DTLSv1_method()))){
- TSK_DEBUG_ERROR("Failed to create DTLSv1 context");
- TSK_OBJECT_SAFE_FREE(transport);
- return -5;
- }
- SSL_CTX_set_read_ahead(transport->dtls.ctx, 1);
- // SSL_CTX_set_options(transport->dtls.ctx, SSL_OP_ALL);
- // SSL_CTX_set_mode(transport->dtls.ctx, SSL_MODE_AUTO_RETRY);
- SSL_CTX_set_verify(transport->dtls.ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, tsk_null); // to be updated by tnet_transport_tls_set_certs()
- if (SSL_CTX_set_cipher_list(transport->dtls.ctx, TNET_CIPHER_LIST) <= 0){
- TSK_DEBUG_ERROR("SSL_CTX_set_cipher_list failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
- return -6;
- }
- //!\ This is required even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
- // Up to the DTLS socket to set the default MTU value
- SSL_CTX_set_options(transport->dtls.ctx, SSL_OP_NO_QUERY_MTU);
- SSL_CTX_ctrl(transport->dtls.ctx, SSL_CTRL_SET_MTU, TNET_DTLS_MTU - 28, NULL);
-
- transport->dtls.activated = tsk_true;
- }
+ if ((transport->dtls.enabled = is_dtls)) {
+ if (!transport->dtls.ctx && !(transport->dtls.ctx = SSL_CTX_new(DTLSv1_method()))) {
+ TSK_DEBUG_ERROR("Failed to create DTLSv1 context");
+ TSK_OBJECT_SAFE_FREE(transport);
+ return -5;
+ }
+ SSL_CTX_set_read_ahead(transport->dtls.ctx, 1);
+ // SSL_CTX_set_options(transport->dtls.ctx, SSL_OP_ALL);
+ // SSL_CTX_set_mode(transport->dtls.ctx, SSL_MODE_AUTO_RETRY);
+ SSL_CTX_set_verify(transport->dtls.ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, tsk_null); // to be updated by tnet_transport_tls_set_certs()
+ if (SSL_CTX_set_cipher_list(transport->dtls.ctx, TNET_CIPHER_LIST) <= 0) {
+ TSK_DEBUG_ERROR("SSL_CTX_set_cipher_list failed [%s]", ERR_error_string(ERR_get_error(), tsk_null));
+ return -6;
+ }
+ //!\ This is required even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
+ // Up to the DTLS socket to set the default MTU value
+ SSL_CTX_set_options(transport->dtls.ctx, SSL_OP_NO_QUERY_MTU);
+ SSL_CTX_ctrl(transport->dtls.ctx, SSL_CTRL_SET_MTU, TNET_DTLS_MTU - 28, NULL);
+
+ transport->dtls.activated = tsk_true;
+ }
#endif /* HAVE_OPENSSL_DTLS */
}
#endif /* HAVE_OPENSSL */
-
+
return 0;
}
static int _tnet_transport_ssl_deinit(tnet_transport_t* transport)
{
- if (!transport){
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if HAVE_OPENSSL
- if (transport->tls.ctx_client){
+ if (transport->tls.ctx_client) {
SSL_CTX_free(transport->tls.ctx_client);
transport->tls.ctx_client = tsk_null;
}
- if (transport->tls.ctx_server){
+ if (transport->tls.ctx_server) {
SSL_CTX_free(transport->tls.ctx_server);
transport->tls.ctx_server = tsk_null;
}
- if (transport->dtls.ctx){
+ if (transport->dtls.ctx) {
SSL_CTX_free(transport->dtls.ctx);
transport->dtls.ctx = tsk_null;
}
@@ -146,63 +146,63 @@ static int _tnet_transport_ssl_deinit(tnet_transport_t* transport)
tnet_transport_t* tnet_transport_create(const char* host, tnet_port_t port, tnet_socket_type_t type, const char* description)
{
tnet_transport_t* transport;
-
- if ((transport = tsk_object_new(tnet_transport_def_t))){
+
+ if ((transport = tsk_object_new(tnet_transport_def_t))) {
transport->description = tsk_strdup(description);
transport->local_host = tsk_strdup(host);
transport->req_local_port = port;
transport->type = type;
transport->context = tnet_transport_context_create();
-
- if ((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))){
+
+ if ((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))) {
transport->local_ip = tsk_strdup(transport->master->ip);
transport->bind_local_port = transport->master->port;
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create master socket");
TSK_OBJECT_SAFE_FREE(transport);
}
-
- if (_tnet_transport_ssl_init(transport) != 0){
+
+ if (_tnet_transport_ssl_init(transport) != 0) {
TSK_DEBUG_ERROR("Failed to initialize TLS and/or DTLS caps");
TSK_OBJECT_SAFE_FREE(transport);
}
// set priority
tsk_runnable_set_priority(TSK_RUNNABLE(transport), TSK_THREAD_PRIORITY_TIME_CRITICAL);
}
-
+
return transport;
}
tnet_transport_t* tnet_transport_create_2(tnet_socket_t *master, const char* description)
{
tnet_transport_t* transport;
- if (!master){
+ if (!master) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- if ((transport = tsk_object_new(tnet_transport_def_t))){
+
+ if ((transport = tsk_object_new(tnet_transport_def_t))) {
transport->description = tsk_strdup(description);
transport->local_host = tsk_strdup(master->ip);
transport->req_local_port = master->port;
transport->type = master->type;
-
+
transport->master = tsk_object_ref(master);
transport->local_ip = tsk_strdup(transport->master->ip);
transport->bind_local_port = transport->master->port;
-
+
transport->context = tnet_transport_context_create();
-
- if (_tnet_transport_ssl_init(transport) != 0){
+
+ if (_tnet_transport_ssl_init(transport) != 0) {
TSK_DEBUG_ERROR("Failed to initialize TLS and/or DTLS caps");
TSK_OBJECT_SAFE_FREE(transport);
}
-
+
// set priority
tsk_runnable_set_priority(TSK_RUNNABLE(transport), TSK_THREAD_PRIORITY_TIME_CRITICAL);
}
-
+
return transport;
}
@@ -215,53 +215,53 @@ int tnet_transport_tls_set_certs(tnet_transport_handle_t *handle, const char* ca
{
tnet_transport_t *transport = handle;
static const char* ssl_password = tsk_null;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
tsk_strupdate(&transport->tls.ca, ca);
tsk_strupdate(&transport->tls.pvk, pvk);
tsk_strupdate(&transport->tls.pbk, pbk);
transport->tls.verify = verify;
-
+
#if HAVE_OPENSSL
{
int32_t i, ret;
SSL_CTX* contexts[3] = { tsk_null };
-
+
/* init DTLS/TLS contexts */
- if ((ret = _tnet_transport_ssl_init(transport))){
+ if ((ret = _tnet_transport_ssl_init(transport))) {
return ret;
}
-
- if (transport->tls.enabled){
+
+ if (transport->tls.enabled) {
contexts[0] = transport->tls.ctx_client;
contexts[1] = transport->tls.ctx_server;
}
- if (transport->dtls.enabled){
+ if (transport->dtls.enabled) {
contexts[2] = transport->dtls.ctx;
/* Reset fingerprints */
memset(transport->dtls.fingerprints, 0, sizeof(transport->dtls.fingerprints));
}
-
- for (i = 0; i < sizeof(contexts) / sizeof(contexts[0]); ++i){
- if (!contexts[i]){
+
+ for (i = 0; i < sizeof(contexts) / sizeof(contexts[0]); ++i) {
+ if (!contexts[i]) {
continue;
}
SSL_CTX_set_verify(contexts[i], transport->tls.verify ? (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT) : SSL_VERIFY_NONE, tsk_null);
- if (!tsk_strnullORempty(transport->tls.pbk) || !tsk_strnullORempty(transport->tls.pvk) || !tsk_strnullORempty(transport->tls.ca)){
+ if (!tsk_strnullORempty(transport->tls.pbk) || !tsk_strnullORempty(transport->tls.pvk) || !tsk_strnullORempty(transport->tls.ca)) {
/* Sets Public key (cert) */
if (!tsk_strnullORempty(transport->tls.pbk) && (ret = SSL_CTX_use_certificate_file(contexts[i], transport->tls.pbk, SSL_FILETYPE_PEM)) != 1) {
TSK_DEBUG_ERROR("SSL_CTX_use_certificate_file failed [%d,%s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
return -3;
}
/*Sets the password of the private key*/
- if (!tsk_strnullORempty(ssl_password)){
+ if (!tsk_strnullORempty(ssl_password)) {
SSL_CTX_set_default_passwd_cb_userdata(contexts[i], (void*)ssl_password);
}
-
+
/* Sets Private key (cert) */
if (!tsk_strnullORempty(transport->tls.pvk) && (ret = SSL_CTX_use_PrivateKey_file(contexts[i], transport->tls.pvk, SSL_FILETYPE_PEM)) != 1) {
TSK_DEBUG_ERROR("SSL_CTX_use_PrivateKey_file failed [%d,%s]", ret, ERR_error_string(ERR_get_error(), tsk_null));
@@ -281,47 +281,46 @@ int tnet_transport_tls_set_certs(tnet_transport_handle_t *handle, const char* ca
}
}
#endif /* HAVE_OPENSSL */
-
+
return 0;
}
int tnet_transport_start(tnet_transport_handle_t* handle)
{
int ret = -1;
- if (handle){
+ if (handle) {
tnet_transport_t *transport = handle;
-
+
/* prepare transport */
- if ((ret = tnet_transport_prepare(transport))){
+ if ((ret = tnet_transport_prepare(transport))) {
TSK_DEBUG_ERROR("Failed to prepare transport.");
goto bail;
}
-
+
/* start transport */
TSK_RUNNABLE(transport)->run = run;
- if ((ret = tsk_runnable_start(TSK_RUNNABLE(transport), tnet_transport_event_def_t))){
+ if ((ret = tsk_runnable_start(TSK_RUNNABLE(transport), tnet_transport_event_def_t))) {
TSK_DEBUG_ERROR("Failed to start transport.");
goto bail;
}
}
- else{
+ else {
TSK_DEBUG_ERROR("NULL transport object.");
}
-
+
bail:
return ret;
}
int tnet_transport_issecure(const tnet_transport_handle_t *handle)
{
- if (handle)
- {
+ if (handle) {
const tnet_transport_t *transport = handle;
- if (transport->master){
+ if (transport->master) {
return TNET_SOCKET_TYPE_IS_SECURE(transport->master->type);
}
}
- else{
+ else {
TSK_DEBUG_ERROR("NULL transport object.");
}
return 0;
@@ -329,11 +328,11 @@ int tnet_transport_issecure(const tnet_transport_handle_t *handle)
const char* tnet_transport_get_description(const tnet_transport_handle_t *handle)
{
- if (handle){
+ if (handle) {
const tnet_transport_t *transport = handle;
return transport->description;
}
- else{
+ else {
TSK_DEBUG_ERROR("NULL transport object.");
return tsk_null;
}
@@ -341,10 +340,10 @@ const char* tnet_transport_get_description(const tnet_transport_handle_t *handle
int tnet_transport_get_ip_n_port(const tnet_transport_handle_t *handle, tnet_fd_t fd, tnet_ip_t *ip, tnet_port_t *port)
{
- if (handle){
+ if (handle) {
return tnet_get_ip_n_port(fd, tsk_true/*local*/, ip, port);
}
- else{
+ else {
TSK_DEBUG_ERROR("NULL transport object.");
}
return -1;
@@ -353,17 +352,17 @@ int tnet_transport_get_ip_n_port(const tnet_transport_handle_t *handle, tnet_fd_
int tnet_transport_get_ip_n_port_2(const tnet_transport_handle_t *handle, tnet_ip_t *ip, tnet_port_t *port)
{
const tnet_transport_t *transport = handle;
- if (transport){
+ if (transport) {
// do not check the master, let the application die if "null"
- if (ip){
+ if (ip) {
memcpy(*ip, transport->master->ip, sizeof(transport->master->ip));
}
- if (port){
+ if (port) {
*port = transport->master->port;
}
return 0;
}
- else{
+ else {
TSK_DEBUG_ERROR("NULL transport object.");
return -1;
}
@@ -385,27 +384,27 @@ int tnet_transport_get_public_ip_n_port(const tnet_transport_handle_t *handle, t
tsk_bool_t stun_ok = tsk_false;
struct tnet_nat_ctx_s* natt_ctx;
const tnet_transport_t *transport = handle;
- if (!transport){
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (TNET_SOCKET_TYPE_IS_DGRAM(transport->type) && (natt_ctx = tsk_object_ref(transport->natt_ctx))) {
tnet_stun_binding_id_t bind_id = kStunBindingInvalidId;
// if the socket is already monitored by the transport we should pause because both the transport and
// NAT binder will try to read from it
-
+
// Pause the soket
tnet_transport_pause_socket(transport, fd, tsk_true);
// Performs STUN binding
bind_id = tnet_nat_stun_bind(transport->natt_ctx, fd);
// Resume the socket
tnet_transport_pause_socket(transport, fd, tsk_false);
-
+
if (bind_id != kStunBindingInvalidId) {
char* public_ip = tsk_null;
- if (tnet_nat_stun_get_reflexive_address(transport->natt_ctx, bind_id, &public_ip, port) == 0){
- if (ip && public_ip){
+ if (tnet_nat_stun_get_reflexive_address(transport->natt_ctx, bind_id, &public_ip, port) == 0) {
+ if (ip && public_ip) {
tsk_size_t ip_len = tsk_strlen(public_ip);
memcpy(ip, public_ip, ip_len > sizeof(*ip) ? sizeof(*ip) : ip_len);
}
@@ -416,44 +415,44 @@ int tnet_transport_get_public_ip_n_port(const tnet_transport_handle_t *handle, t
}
tsk_object_unref(natt_ctx);
}
-
- if (!stun_ok){
- if (fd == TNET_INVALID_FD && transport->local_ip){
+
+ if (!stun_ok) {
+ if (fd == TNET_INVALID_FD && transport->local_ip) {
memcpy(*ip, transport->local_ip, TSK_MIN(sizeof(tnet_ip_t), tsk_strlen(transport->local_ip)));
*port = transport->bind_local_port;
return 0;
}
- else{
+ else {
return tnet_transport_get_ip_n_port(handle, fd, ip, port);
}
}
-
+
return 0;
}
const char* tnet_transport_dtls_get_local_fingerprint(const tnet_transport_handle_t *handle, tnet_dtls_hash_type_t hash)
{
const tnet_transport_t *transport = handle;
-
- if (!transport){
+
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
-
- if (!transport->dtls.enabled){
+
+ if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return tsk_null;
}
- if (hash > sizeof(transport->dtls.fingerprints) / sizeof(transport->dtls.fingerprints[0])){
+ if (hash > sizeof(transport->dtls.fingerprints) / sizeof(transport->dtls.fingerprints[0])) {
TSK_DEBUG_ERROR("%d not valid for fingerprint hash", hash);
return tsk_null;
}
- if (tsk_strnullORempty(transport->tls.pbk)){
+ if (tsk_strnullORempty(transport->tls.pbk)) {
TSK_DEBUG_ERROR("No certificate for which to get fingerprint");
return tsk_null;
}
-
- if (tnet_dtls_get_fingerprint(transport->tls.pbk, &((tnet_transport_t *)transport)->dtls.fingerprints[hash], hash) == 0){
+
+ if (tnet_dtls_get_fingerprint(transport->tls.pbk, &((tnet_transport_t *)transport)->dtls.fingerprints[hash], hash) == 0) {
return (const char*)transport->dtls.fingerprints[hash];
}
return tsk_null;
@@ -465,12 +464,12 @@ const char* tnet_transport_dtls_get_local_fingerprint(const tnet_transport_handl
int tnet_transport_dtls_use_srtp(tnet_transport_handle_t *handle, const char* srtp_profiles, struct tnet_socket_s** sockets, tsk_size_t sockets_count)
{
tnet_transport_t *transport = handle;
-
- if (!transport || !srtp_profiles){
+
+ if (!transport || !srtp_profiles) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if (!transport->dtls.enabled){
+ if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
}
@@ -479,9 +478,9 @@ int tnet_transport_dtls_use_srtp(tnet_transport_handle_t *handle, const char* sr
tsk_size_t i;
transport->dtls.use_srtp = tsk_true;
SSL_CTX_set_tlsext_use_srtp(transport->dtls.ctx, srtp_profiles);
- if (sockets){
- for (i = 0; i < sockets_count; ++i){
- if (sockets[i] && sockets[i]->dtlshandle){
+ if (sockets) {
+ for (i = 0; i < sockets_count; ++i) {
+ if (sockets[i] && sockets[i]->dtlshandle) {
tnet_dtls_socket_use_srtp(sockets[i]->dtlshandle);
}
}
@@ -497,20 +496,20 @@ int tnet_transport_dtls_use_srtp(tnet_transport_handle_t *handle, const char* sr
int tnet_transport_dtls_set_remote_fingerprint(tnet_transport_handle_t *handle, const tnet_fingerprint_t* fingerprint, tnet_dtls_hash_type_t hash, struct tnet_socket_s** sockets, tsk_size_t sockets_count)
{
const tnet_transport_t *transport = handle;
-
- if (!transport || !fingerprint){
+
+ if (!transport || !fingerprint) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if (!transport->dtls.enabled){
+ if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
}
#if HAVE_OPENSSL_DTLS
- if (sockets){
+ if (sockets) {
tsk_size_t i;
- for (i = 0; i < sockets_count; ++i){
- if (sockets[i] && sockets[i]->dtlshandle){
+ for (i = 0; i < sockets_count; ++i) {
+ if (sockets[i] && sockets[i]->dtlshandle) {
tnet_dtls_socket_set_remote_fingerprint(sockets[i]->dtlshandle, fingerprint, hash);
}
}
@@ -525,7 +524,7 @@ int tnet_transport_dtls_set_remote_fingerprint(tnet_transport_handle_t *handle,
tsk_bool_t tnet_transport_dtls_is_enabled(const tnet_transport_handle_t *handle)
{
const tnet_transport_t *transport = handle;
- if (!transport){
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -545,18 +544,18 @@ int tnet_transport_dtls_set_enabled(tnet_transport_handle_t *handle, tsk_bool_t
tnet_transport_t *transport = handle;
tnet_socket_type_t type;
int ret;
-
- if (!transport){
+
+ if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
type = tnet_transport_get_type(transport);
-
+
if (enabled & !tnet_dtls_is_supported()) {
TSK_DEBUG_ERROR("Trying to enable DTLS but code source not built with this feature");
return -1;
}
-
+
if ((transport->dtls.enabled = enabled)) {
if ((ret = _tnet_transport_ssl_init(transport))) {
return ret;
@@ -565,7 +564,7 @@ int tnet_transport_dtls_set_enabled(tnet_transport_handle_t *handle, tsk_bool_t
else {
ret = _tnet_transport_ssl_deinit(transport);
}
-
+
if (sockets && sockets_count) {
tsk_size_t i;
for (i = 0; i < sockets_count; ++i) {
@@ -588,19 +587,19 @@ int tnet_transport_dtls_set_enabled(tnet_transport_handle_t *handle, tsk_bool_t
}
}
}
-
+
return ret;
}
int tnet_transport_dtls_set_setup(tnet_transport_handle_t* handle, tnet_dtls_setup_t setup, struct tnet_socket_s** sockets, tsk_size_t sockets_count)
{
tnet_transport_t *transport = handle;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
@@ -620,12 +619,12 @@ int tnet_transport_dtls_set_setup(tnet_transport_handle_t* handle, tnet_dtls_set
int tnet_transport_dtls_set_store_handshakingdata(tnet_transport_handle_t* handle, tsk_bool_t handshake_storedata, struct tnet_socket_s** sockets, tsk_size_t sockets_count)
{
tnet_transport_t *transport = handle;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
@@ -646,29 +645,29 @@ int tnet_transport_dtls_do_handshake(tnet_transport_handle_t *handle, struct tne
{
tnet_transport_t *transport = handle;
tsk_size_t i;
-
+
if (!transport || !sockets) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
}
-
+
if (sockets) {
int ret;
for (i = 0; i < sockets_count; ++i) {
if (sockets[i] && sockets[i]->dtlshandle) {
if ((ret = tnet_dtls_socket_do_handshake(sockets[i]->dtlshandle,
- (remote_addrs && i < remote_addrs_count) ? remote_addrs[i] : tsk_null)) != 0){
+ (remote_addrs && i < remote_addrs_count) ? remote_addrs[i] : tsk_null)) != 0) {
return ret;
}
}
}
}
-
+
return 0;
}
@@ -676,22 +675,22 @@ int tnet_transport_dtls_get_handshakingdata(tnet_transport_handle_t* handle, con
{
tnet_transport_t *transport = handle;
tsk_size_t i;
-
+
if (!transport || !sockets) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (!transport->dtls.enabled) {
TSK_DEBUG_ERROR("DTLS not enabled on this transport");
return -2;
}
-
+
if (sockets) {
int ret;
for (i = 0; i < sockets_count; ++i) {
if (sockets[i] && sockets[i]->dtlshandle) {
- if ((ret = tnet_dtls_socket_get_handshakingdata(sockets[i]->dtlshandle, &data[i], &size[i])) != 0){
+ if ((ret = tnet_dtls_socket_get_handshakingdata(sockets[i]->dtlshandle, &data[i], &size[i])) != 0) {
return ret;
}
}
@@ -701,13 +700,13 @@ int tnet_transport_dtls_get_handshakingdata(tnet_transport_handle_t* handle, con
}
}
}
-
+
return 0;
}
tnet_socket_type_t tnet_transport_get_type(const tnet_transport_handle_t *handle)
{
- if (!handle){
+ if (!handle) {
TSK_DEBUG_ERROR("Invalid parameter");
return tnet_socket_type_invalid;
}
@@ -716,7 +715,7 @@ tnet_socket_type_t tnet_transport_get_type(const tnet_transport_handle_t *handle
tnet_fd_t tnet_transport_get_master_fd(const tnet_transport_handle_t *handle)
{
- if (!handle){
+ if (!handle) {
TSK_DEBUG_ERROR("Invalid parameter");
return TNET_INVALID_FD;
}
@@ -725,12 +724,16 @@ tnet_fd_t tnet_transport_get_master_fd(const tnet_transport_handle_t *handle)
int tnet_transport_get_bytes_count(const tnet_transport_handle_t *handle, uint64_t* bytes_in, uint64_t* bytes_out)
{
- if (!handle){
+ if (!handle) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if (bytes_in) *bytes_in = ((const tnet_transport_t *)handle)->bytes_in;
- if (bytes_out) *bytes_out = ((const tnet_transport_t *)handle)->bytes_out;
+ if (bytes_in) {
+ *bytes_in = ((const tnet_transport_t *)handle)->bytes_in;
+ }
+ if (bytes_out) {
+ *bytes_out = ((const tnet_transport_t *)handle)->bytes_out;
+ }
return 0;
}
@@ -762,18 +765,18 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
tnet_port_t to_port = port;
tnet_socket_type_t to_type = type;
tnet_proxyinfo_t* proxy_info = tsk_null;
-
+
if (!transport || !transport->master) {
TSK_DEBUG_ERROR("Invalid transport handle");
goto bail;
}
-
+
if ((TNET_SOCKET_TYPE_IS_STREAM(transport->master->type) && !TNET_SOCKET_TYPE_IS_STREAM(type)) ||
- (TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type) && !TNET_SOCKET_TYPE_IS_DGRAM(type))) {
+ (TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type) && !TNET_SOCKET_TYPE_IS_DGRAM(type))) {
TSK_DEBUG_ERROR("Master/destination types mismatch [%u/%u]", transport->master->type, type);
goto bail;
}
-
+
if (use_proxy) {
// auto-detect the proxy
if (transport->proxy.auto_detect) {
@@ -788,7 +791,7 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
proxy_info = tsk_object_ref(transport->proxy.info);
}
}
-
+
use_proxy &= tnet_proxyinfo_is_valid(proxy_info);
if (use_proxy) {
if (tnet_proxy_node_is_nettransport_supported(proxy_info->type, type)) {
@@ -807,9 +810,9 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
use_proxy = tsk_false;
}
}
-
+
TSK_DEBUG_INFO("tnet_transport_connectto_3(host=%s, port=%d, type=%d, fd=%d, use_proxy=%d, to_host=%s, to_port=%d, to_type=%d, proxy_type=%d)" , host, port, type, fd, use_proxy, to_host, to_port, to_type, proxy_info ? proxy_info->type : 0);
-
+
/* Init destination sockaddr fields */
if ((status = tnet_sockaddr_init(to_host, to_port, to_type, &to))) {
TSK_DEBUG_ERROR("Invalid HOST/PORT [%s/%u]", host, port);
@@ -824,7 +827,7 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
TNET_SOCKET_TYPE_SET_IPV4Only(type);
}
}
-
+
/*
* STREAM ==> create new socket and connect it to the remote host.
* DGRAM ==> connect the master to the remote host.
@@ -836,7 +839,7 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
goto bail;
}
}
-
+
if ((status = tnet_sockfd_connectto(fd, (const struct sockaddr_storage *)&to))) {
if (fd != transport->master->fd) {
tnet_sockfd_close(&fd);
@@ -866,7 +869,7 @@ tnet_fd_t tnet_transport_connectto_3(const tnet_transport_handle_t *handle, stru
goto bail;
}
}
-
+
bail:
TSK_OBJECT_SAFE_FREE(tls_handle);
TSK_OBJECT_SAFE_FREE(proxy_info);
@@ -876,12 +879,12 @@ bail:
int tnet_transport_set_callback(const tnet_transport_handle_t *handle, tnet_transport_cb_f callback, const void* callback_data)
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid server handle.");
return -1;
}
-
+
transport->callback = callback;
transport->callback_data = callback_data;
return 0;
@@ -912,7 +915,7 @@ int tnet_transport_set_proxy_info(tnet_transport_handle_t *handle, enum tnet_pro
proxy_info->port = port;
proxy_info->username = tsk_strdup(login);
proxy_info->password = tsk_strdup(password);
-
+
TSK_OBJECT_SAFE_FREE(transport->proxy.info);
transport->proxy.info = proxy_info;
return 0;
@@ -927,7 +930,7 @@ int tnet_transport_shutdown(tnet_transport_handle_t* handle)
{
if (handle) {
int ret;
- if ((ret = tnet_transport_stop(handle)) == 0){
+ if ((ret = tnet_transport_stop(handle)) == 0) {
ret = tnet_transport_unprepare(handle);
}
return ret;
@@ -947,16 +950,32 @@ static int _tnet_transport_dtls_cb(const void* usrdata, tnet_dtls_socket_event_t
const struct sockaddr_storage* remote_addr;
tnet_fd_t fd;
tnet_transport_event_t* e;
-
+
switch (dtls_e) {
- case tnet_dtls_socket_event_type_handshake_started: t_e = event_dtls_handshake_started; break;
- case tnet_dtls_socket_event_type_handshake_succeed: t_e = event_dtls_handshake_succeed; break;
- case tnet_dtls_socket_event_type_handshake_failed: t_e = event_dtls_handshake_failed; break;
- case tnet_dtls_socket_event_type_fingerprint_mismatch: t_e = event_dtls_fingerprint_mismatch; break;
- case tnet_dtls_socket_event_type_dtls_srtp_profile_selected: t_e = event_dtls_srtp_profile_selected; break;
- case tnet_dtls_socket_event_type_dtls_srtp_data: t_e = event_dtls_srtp_data; break;
- case tnet_dtls_socket_event_type_error: t_e = event_dtls_error; break;
- default: TSK_DEBUG_ERROR("DTLS event = %d ignored", dtls_e); return -1;
+ case tnet_dtls_socket_event_type_handshake_started:
+ t_e = event_dtls_handshake_started;
+ break;
+ case tnet_dtls_socket_event_type_handshake_succeed:
+ t_e = event_dtls_handshake_succeed;
+ break;
+ case tnet_dtls_socket_event_type_handshake_failed:
+ t_e = event_dtls_handshake_failed;
+ break;
+ case tnet_dtls_socket_event_type_fingerprint_mismatch:
+ t_e = event_dtls_fingerprint_mismatch;
+ break;
+ case tnet_dtls_socket_event_type_dtls_srtp_profile_selected:
+ t_e = event_dtls_srtp_profile_selected;
+ break;
+ case tnet_dtls_socket_event_type_dtls_srtp_data:
+ t_e = event_dtls_srtp_data;
+ break;
+ case tnet_dtls_socket_event_type_error:
+ t_e = event_dtls_error;
+ break;
+ default:
+ TSK_DEBUG_ERROR("DTLS event = %d ignored", dtls_e);
+ return -1;
}
remote_addr = tnet_dtls_socket_get_remote_addr(handle);
fd = tnet_dtls_socket_get_fd(handle);
@@ -994,11 +1013,11 @@ static void* TSK_STDCALL run(void* self)
int ret = 0;
tsk_list_item_t *curr;
tnet_transport_t *transport = self;
-
+
TSK_DEBUG_INFO("Transport::run(%s) - enter", transport->description);
-
+
/* create main thread */
- if ((ret = tsk_thread_create(transport->mainThreadId, tnet_transport_mainthread, transport))){ /* More important than "tsk_runnable_start" ==> start it first. */
+ if ((ret = tsk_thread_create(transport->mainThreadId, tnet_transport_mainthread, transport))) { /* More important than "tsk_runnable_start" ==> start it first. */
TSK_FREE(transport->context); /* Otherwise (tsk_thread_create is ok) will be freed when mainthread exit. */
TSK_DEBUG_FATAL("Failed to create main thread [%d]", ret);
return tsk_null;
@@ -1009,22 +1028,22 @@ static void* TSK_STDCALL run(void* self)
#if !TNET_UNDER_APPLE
ret = tsk_thread_set_priority(transport->mainThreadId[0], TSK_THREAD_PRIORITY_TIME_CRITICAL);
#endif
-
+
TSK_RUNNABLE_RUN_BEGIN(transport);
-
- if ((curr = TSK_RUNNABLE_POP_FIRST_SAFE(TSK_RUNNABLE(transport)))){
+
+ if ((curr = TSK_RUNNABLE_POP_FIRST_SAFE(TSK_RUNNABLE(transport)))) {
const tnet_transport_event_t *e = (const tnet_transport_event_t*)curr->data;
-
+
if (transport->callback) {
transport->callback(e);
}
tsk_object_unref(curr);
}
-
+
TSK_RUNNABLE_RUN_END(transport);
-
+
TSK_DEBUG_INFO("Transport::run(%s) - exit", transport->description);
-
+
return tsk_null;
}
@@ -1037,7 +1056,7 @@ static void* TSK_STDCALL run(void* self)
static tsk_object_t* tnet_transport_ctor(tsk_object_t * self, va_list * app)
{
tnet_transport_t *transport = self;
- if (transport){
+ if (transport) {
}
return self;
}
@@ -1045,7 +1064,7 @@ static tsk_object_t* tnet_transport_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tnet_transport_dtor(tsk_object_t * self)
{
tnet_transport_t *transport = self;
- if (transport){
+ if (transport) {
tnet_transport_set_callback(transport, tsk_null, tsk_null);
tnet_transport_shutdown(transport);
TSK_OBJECT_SAFE_FREE(transport->master);
@@ -1053,25 +1072,24 @@ static tsk_object_t* tnet_transport_dtor(tsk_object_t * self)
TSK_OBJECT_SAFE_FREE(transport->natt_ctx);
TSK_FREE(transport->local_ip);
TSK_FREE(transport->local_host);
-
+
// proxy
TSK_OBJECT_SAFE_FREE(transport->proxy.info);
-
+
// (tls and dtls) = ssl
TSK_FREE(transport->tls.ca);
TSK_FREE(transport->tls.pbk);
TSK_FREE(transport->tls.pvk);
_tnet_transport_ssl_deinit(transport); // openssl contexts
-
+
TSK_DEBUG_INFO("*** Transport (%s) destroyed ***", transport->description);
TSK_FREE(transport->description);
}
-
+
return self;
}
-static const tsk_object_def_t tnet_transport_def_s =
-{
+static const tsk_object_def_t tnet_transport_def_s = {
sizeof(tnet_transport_t),
tnet_transport_ctor,
tnet_transport_dtor,
@@ -1087,7 +1105,7 @@ const tsk_object_def_t *tnet_transport_def_t = &tnet_transport_def_s;
static tsk_object_t* tnet_transport_event_ctor(tsk_object_t * self, va_list * app)
{
tnet_transport_event_t *e = self;
- if (e){
+ if (e) {
e->type = va_arg(*app, tnet_transport_event_type_t);
e->callback_data = va_arg(*app, const void*);
e->local_fd = va_arg(*app, tnet_fd_t);
@@ -1098,15 +1116,14 @@ static tsk_object_t* tnet_transport_event_ctor(tsk_object_t * self, va_list * ap
static tsk_object_t* tnet_transport_event_dtor(tsk_object_t * self)
{
tnet_transport_event_t *e = self;
- if (e){
+ if (e) {
TSK_FREE(e->data);
}
-
+
return self;
}
-static const tsk_object_def_t tnet_transport_event_def_s =
-{
+static const tsk_object_def_t tnet_transport_event_def_s = {
sizeof(tnet_transport_event_t),
tnet_transport_event_ctor,
tnet_transport_event_dtor,
diff --git a/tinyNET/src/tnet_transport.h b/tinyNET/src/tnet_transport.h
index c4da35b..f86829c 100755
--- a/tinyNET/src/tnet_transport.h
+++ b/tinyNET/src/tnet_transport.h
@@ -41,38 +41,36 @@ TNET_BEGIN_DECLS
#define TNET_TRANSPORT_CB_F(callback) ((tnet_transport_cb_f)callback)
-typedef enum tnet_transport_event_type_e
-{
- event_data,
- event_closed,
- event_error,
- event_removed,
- event_connected,
- event_accepted,
+typedef enum tnet_transport_event_type_e {
+ event_data,
+ event_closed,
+ event_error,
+ event_removed,
+ event_connected,
+ event_accepted,
event_brokenpipe, // iOS: UDP sockets closed, to be restored now that the app is on foreground
- event_dtls_handshake_started,
- event_dtls_handshake_succeed,
- event_dtls_handshake_failed,
- event_dtls_fingerprint_mismatch,
- event_dtls_srtp_data,
- event_dtls_srtp_profile_selected,
- event_dtls_error
+ event_dtls_handshake_started,
+ event_dtls_handshake_succeed,
+ event_dtls_handshake_failed,
+ event_dtls_fingerprint_mismatch,
+ event_dtls_srtp_data,
+ event_dtls_srtp_profile_selected,
+ event_dtls_error
}
tnet_transport_event_type_t;
-typedef struct tnet_transport_event_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_transport_event_s {
+ TSK_DECLARE_OBJECT;
- tnet_transport_event_type_t type;
+ tnet_transport_event_type_t type;
- void* data;
- tsk_size_t size;
+ void* data;
+ tsk_size_t size;
- const void* callback_data;
- tnet_fd_t local_fd;
- struct sockaddr_storage remote_addr;
+ const void* callback_data;
+ tnet_fd_t local_fd;
+ struct sockaddr_storage remote_addr;
}
tnet_transport_event_t;
@@ -123,52 +121,51 @@ TINYNET_API tnet_fd_t tnet_transport_get_master_fd(const tnet_transport_handle_t
TINYNET_API int tnet_transport_get_bytes_count(const tnet_transport_handle_t *handle, uint64_t* bytes_in, uint64_t* bytes_out);
TINYNET_API int tnet_transport_shutdown(tnet_transport_handle_t* handle);
-typedef struct tnet_transport_s
-{
- TSK_DECLARE_RUNNABLE;
-
- tnet_socket_type_t type;
- char* local_ip;
- char* local_host;
- tnet_port_t req_local_port; // user requested local port
- tnet_port_t bind_local_port; // local port on which we are listening (same as master socket)
- struct tnet_nat_ctx_s* natt_ctx;
- tnet_socket_t *master;
-
- tsk_object_t *context;
- tsk_bool_t prepared;
-
+typedef struct tnet_transport_s {
+ TSK_DECLARE_RUNNABLE;
+
+ tnet_socket_type_t type;
+ char* local_ip;
+ char* local_host;
+ tnet_port_t req_local_port; // user requested local port
+ tnet_port_t bind_local_port; // local port on which we are listening (same as master socket)
+ struct tnet_nat_ctx_s* natt_ctx;
+ tnet_socket_t *master;
+
+ tsk_object_t *context;
+ tsk_bool_t prepared;
+
uint64_t bytes_out;
uint64_t bytes_in;
- //unsigned connected:1;
- void* mainThreadId[1];
-
- char *description;
-
- tnet_transport_cb_f callback;
- const void* callback_data;
-
- /* TLS certs */
- struct {
- char* ca;
- char* pvk;
- char* pbk;
- tsk_bool_t enabled;
- tsk_bool_t verify; // whether to verify client/server certificate
- struct ssl_ctx_st *ctx_client;
- struct ssl_ctx_st *ctx_server;
- }tls;
-
- /* DTLS */
- struct{
- tsk_bool_t enabled;
- tsk_bool_t activated;
- tsk_bool_t use_srtp;
- struct ssl_ctx_st *ctx;
- tnet_fingerprint_t fingerprints[TNET_DTLS_HASH_TYPE_MAX];
- }dtls;
-
+ //unsigned connected:1;
+ void* mainThreadId[1];
+
+ char *description;
+
+ tnet_transport_cb_f callback;
+ const void* callback_data;
+
+ /* TLS certs */
+ struct {
+ char* ca;
+ char* pvk;
+ char* pbk;
+ tsk_bool_t enabled;
+ tsk_bool_t verify; // whether to verify client/server certificate
+ struct ssl_ctx_st *ctx_client;
+ struct ssl_ctx_st *ctx_server;
+ } tls;
+
+ /* DTLS */
+ struct {
+ tsk_bool_t enabled;
+ tsk_bool_t activated;
+ tsk_bool_t use_srtp;
+ struct ssl_ctx_st *ctx;
+ tnet_fingerprint_t fingerprints[TNET_DTLS_HASH_TYPE_MAX];
+ } dtls;
+
/* PROXY */
struct {
tsk_bool_t auto_detect;
diff --git a/tinyNET/src/tnet_transport_cfsocket.c b/tinyNET/src/tnet_transport_cfsocket.c
index 4115b22..ed844b6 100755
--- a/tinyNET/src/tnet_transport_cfsocket.c
+++ b/tinyNET/src/tnet_transport_cfsocket.c
@@ -55,25 +55,24 @@
#define TNET_BUFFER_STREAM_MIN_SIZE 1024
/*== Socket description ==*/
-typedef struct transport_socket_xs
-{
+typedef struct transport_socket_xs {
tnet_fd_t fd;
tsk_bool_t owner;
tsk_bool_t readable;
tsk_bool_t writable;
tsk_bool_t paused;
tsk_bool_t is_client;
-
+
tnet_proxy_node_t *proxy_node;
tnet_proxyinfo_t* proxy_info;
tsk_bool_t proxy_handshacking_completed;
tsk_bool_t proxy_handshacking_started;
-
+
char* dst_host;
tnet_port_t dst_port;
-
+
tnet_socket_type_t type;
-
+
CFSocketRef cf_socket;
CFReadStreamRef cf_read_stream;
CFWriteStreamRef cf_write_stream;
@@ -82,15 +81,14 @@ typedef struct transport_socket_xs
transport_socket_xt;
/*== Transport context structure definition ==*/
-typedef struct transport_context_s
-{
+typedef struct transport_context_s {
TSK_DECLARE_OBJECT;
-
+
tsk_size_t count;
transport_socket_xt* sockets[TNET_MAX_FDS];
-
+
CFRunLoopRef cf_run_loop;
-
+
TSK_DECLARE_SAFEOBJ;
}
transport_context_t;
@@ -114,32 +112,32 @@ static BOOL isTrusted(tnet_transport_t *transport, id cfStream, BOOL bReadStream
SecCertificateRef certArray[2] = { NULL, NULL };
CFArrayRef refCertArray = NULL;
CFIndex certArrayCount = 0;
-
+
trust = bReadStream
- ? (SecTrustRef)CFReadStreamCopyProperty((CFReadStreamRef)cfStream, kCFStreamPropertySSLPeerTrust)
- : (SecTrustRef)CFWriteStreamCopyProperty((CFWriteStreamRef)cfStream, kCFStreamPropertySSLPeerTrust);
+ ? (SecTrustRef)CFReadStreamCopyProperty((CFReadStreamRef)cfStream, kCFStreamPropertySSLPeerTrust)
+ : (SecTrustRef)CFWriteStreamCopyProperty((CFWriteStreamRef)cfStream, kCFStreamPropertySSLPeerTrust);
if (!trust) {
TSK_DEBUG_ERROR("Failed to get SecTrustRef object from '%s' stream", bReadStream ? "read" : "write");
goto bail;
}
-
+
NSString *caName = NULL, *pbName = NULL;
-
+
if (!tsk_strnullORempty(transport->tls.ca)) {
- caName = [[[NSString stringWithCString:transport->tls.ca encoding: NSUTF8StringEncoding] lastPathComponent] stringByDeletingPathExtension];
+caName = [[[NSString stringWithCString:transport->tls.ca encoding: NSUTF8StringEncoding] lastPathComponent] stringByDeletingPathExtension];
}
if (!tsk_strnullORempty(transport->tls.pbk)) {
- pbName = [[[NSString stringWithCString:transport->tls.pbk encoding: NSUTF8StringEncoding] lastPathComponent] stringByDeletingPathExtension];
+pbName = [[[NSString stringWithCString:transport->tls.pbk encoding: NSUTF8StringEncoding] lastPathComponent] stringByDeletingPathExtension];
}
TSK_DEBUG_INFO("SSL::isTrusted(ca=%s, pb=%s)", [caName UTF8String], [pbName UTF8String]);
-
+
if (caName) {
- NSString *caPath = [[NSBundle mainBundle] pathForResource:caName ofType:@"der"];
- if (![[NSFileManager defaultManager] fileExistsAtPath:caPath]) {
+NSString *caPath = [[NSBundle mainBundle] pathForResource:caName ofType:@"der"];
+if (![[NSFileManager defaultManager] fileExistsAtPath:caPath]) {
TSK_DEBUG_WARN("Cannot find SSL CA file '%s.der'", [caPath UTF8String]);
}
else {
- NSData *certData = [[NSData alloc] initWithContentsOfFile:caPath];
+NSData *certData = [[NSData alloc] initWithContentsOfFile:caPath];
CFDataRef certDataRef = (CFDataRef)certData;
SecCertificateRef cert = certDataRef ? SecCertificateCreateWithData(NULL, certDataRef) : NULL;
[certData release];
@@ -153,12 +151,12 @@ static BOOL isTrusted(tnet_transport_t *transport, id cfStream, BOOL bReadStream
}
}
if (pbName) {
- NSString *pbPath = [[NSBundle mainBundle] pathForResource:pbName ofType:@"der"];
- if (![[NSFileManager defaultManager] fileExistsAtPath:pbPath]) {
+NSString *pbPath = [[NSBundle mainBundle] pathForResource:pbName ofType:@"der"];
+if (![[NSFileManager defaultManager] fileExistsAtPath:pbPath]) {
TSK_DEBUG_WARN("Cannot find SSL PUB file '%s.der'", [pbPath UTF8String]);
}
else {
- NSData *certData = [[NSData alloc] initWithContentsOfFile:pbPath];
+NSData *certData = [[NSData alloc] initWithContentsOfFile:pbPath];
CFDataRef certDataRef = (CFDataRef)certData;
SecCertificateRef cert = certDataRef ? SecCertificateCreateWithData(NULL, certDataRef) : NULL;
[certData release];
@@ -191,7 +189,7 @@ static BOOL isTrusted(tnet_transport_t *transport, id cfStream, BOOL bReadStream
}
bTrusted = (result == kSecTrustResultProceed || result == kSecTrustResultUnspecified);
TSK_DEBUG_INFO("SecTrustEvaluate result = %d", result);
-
+
bail:
CFRelease(trust);
CFRelease(refCertArray);
@@ -202,28 +200,28 @@ bail:
static int recvData(tnet_transport_t *transport, transport_socket_xt* active_socket)
{
int ret;
- if(!transport || !transport->context || !active_socket){
+ if(!transport || !transport->context || !active_socket) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
void* buffer = tsk_null;
tsk_size_t len = 0;
struct sockaddr_storage remote_addr = {0};
-
+
/* check whether the socket is paused or not */
if (active_socket->paused) {
TSK_DEBUG_INFO("Socket is paused");
goto bail;
}
-
+
tsk_bool_t is_stream = TNET_SOCKET_TYPE_IS_STREAM(active_socket->type);
-
+
if (tnet_ioctlt(active_socket->fd, FIONREAD, &len) < 0) {
TNET_PRINT_LAST_ERROR("ioctl() failed");
goto bail;
}
-
+
if (!len) {
// probably incoming connection
if (is_stream && !active_socket->is_client) {
@@ -235,26 +233,26 @@ static int recvData(tnet_transport_t *transport, transport_socket_xt* active_soc
goto bail;
}
}
-
+
if (is_stream && CFReadStreamHasBytesAvailable(active_socket->cf_read_stream)) {
if ((buffer = tsk_calloc(TNET_BUFFER_STREAM_MIN_SIZE, sizeof(uint8_t)))) {
len = CFReadStreamRead(active_socket->cf_read_stream, buffer, (CFIndex)TNET_BUFFER_STREAM_MIN_SIZE);
ret = (int)len;
}
}
-
+
if (ret <= 0) {
TSK_DEBUG_WARN("ioctl() returned zero for fd=%d", active_socket->fd);
goto bail;
}
}
-
+
if (len && !buffer) {
- if(!(buffer = tsk_calloc(len, sizeof(uint8_t)))){
+ if(!(buffer = tsk_calloc(len, sizeof(uint8_t)))) {
TSK_DEBUG_ERROR("calloc(%zu) failed", len);
goto bail;
}
-
+
// Receive the waiting data
if (is_stream) {
ret = tnet_getpeername(active_socket->fd, &remote_addr);
@@ -269,23 +267,23 @@ static int recvData(tnet_transport_t *transport, transport_socket_xt* active_soc
ret = tnet_sockfd_recvfrom(active_socket->fd, buffer, len, 0, (struct sockaddr*)&remote_addr);
}
}
-
-
- if(ret < 0){
+
+
+ if(ret < 0) {
removeSocket(active_socket, transport->context);
TNET_PRINT_LAST_ERROR("recv/recvfrom have failed.");
goto bail;
}
-
+
if ((len != (tsk_size_t)ret) && len) {
len = (tsk_size_t)ret;
}
-
+
if (!active_socket->proxy_handshacking_completed && active_socket->proxy_handshacking_started && active_socket->proxy_node && active_socket->proxy_info) {
void* handshaking_data_ptr = tsk_null;
tsk_size_t handshaking_data_size = 0;
TSK_DEBUG_INFO("Proxy handshaking data:%.*s", (int)len, buffer);
-
+
// handle incoming hadshaking data
if ((ret = tnet_proxy_node_set_handshaking_data(active_socket->proxy_node, buffer, len)) != 0) {
TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
@@ -318,18 +316,19 @@ static int recvData(tnet_transport_t *transport, transport_socket_xt* active_soc
}
goto bail; // do not forward the data to the end-user
}
-
+
if (len && buffer) {
tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
if (e && buffer && len) {
- e->data = buffer; buffer = NULL;
+ e->data = buffer;
+ buffer = NULL;
e->size = len;
e->remote_addr = remote_addr;
-
+
TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
}
}
-
+
bail:
TSK_FREE(buffer);
return 0;
@@ -341,31 +340,31 @@ int tnet_transport_add_socket_2(const tnet_transport_handle_t *handle, tnet_fd_t
transport_context_t* context;
int ret = -1;
(void)(tlsHandle);
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid server handle.");
return ret;
}
-
+
if (!(context = (transport_context_t*)transport->context)) {
TSK_DEBUG_ERROR("Invalid context.");
return -2;
}
-
- if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)){
+
+ if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)) {
transport->tls.enabled = 1;
}
-
+
if ((ret = addSocket2(fd, type, transport, take_ownership, isClient, dst_host, dst_port, proxy_info))) {
TSK_DEBUG_ERROR("Failed to add new Socket.");
return ret;
}
-
+
if (context->cf_run_loop) {
// Signal the run-loop
CFRunLoopWakeUp(context->cf_run_loop);
}
-
+
return 0;
}
@@ -377,23 +376,24 @@ int tnet_transport_add_socket(const tnet_transport_handle_t *handle, tnet_fd_t f
return tnet_transport_add_socket_2(handle, fd, type, take_ownership, isClient, tlsHandle, __dst_host_null, __dst_port_zero, __proxy_info_null);
}
-int tnet_transport_pause_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tsk_bool_t pause){
+int tnet_transport_pause_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tsk_bool_t pause)
+{
tnet_transport_t *transport = (tnet_transport_t*)handle;
transport_context_t *context;
transport_socket_xt* socket;
-
- if(!transport || !(context = (transport_context_t *)transport->context)){
+
+ if(!transport || !(context = (transport_context_t *)transport->context)) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if((socket = (transport_socket_xt*)getSocket(context, fd))){
+
+ if((socket = (transport_socket_xt*)getSocket(context, fd))) {
socket->paused = pause;
}
else {
TSK_DEBUG_WARN("Failed to find socket with fd=%d", (int)fd);
}
-
+
return 0;
}
@@ -404,19 +404,19 @@ int tnet_transport_remove_socket(const tnet_transport_handle_t *handle, tnet_fd_
transport_context_t *context;
tsk_size_t i;
tsk_bool_t found = tsk_false;
-
+
if (!transport || !fd) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
TSK_DEBUG_INFO("Removing socket %d", *fd);
-
+
if (!(context = (transport_context_t*)transport->context)) {
TSK_DEBUG_ERROR("Invalid context.");
return -2;
}
-
+
for(i=0; i<context->count; ++i) {
if (context->sockets[i]->fd == *fd) {
removeSocketAtIndex((int)i, context);
@@ -425,15 +425,15 @@ int tnet_transport_remove_socket(const tnet_transport_handle_t *handle, tnet_fd_
break;
}
}
-
+
if (found && context->cf_run_loop) {
// Signal the run-loop
CFRunLoopWakeUp(context->cf_run_loop);
return 0;
}
-
+
// ...
-
+
return -1;
}
@@ -441,29 +441,29 @@ tsk_size_t tnet_transport_send(const tnet_transport_handle_t *handle, tnet_fd_t
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
int numberOfBytesSent = 0;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid transport handle.");
goto bail;
}
-
+
const transport_socket_xt* sock = getSocket(transport->context, from);
if (sock && sock->cf_write_stream && TNET_SOCKET_TYPE_IS_STREAM(sock->type) && sock->cf_write_stream) {
int sent = 0, to_send;
const uint8_t* buff_ptr = (const uint8_t*)buf;
// on iOS when TLS is enabled sending more than 1024 bytes could fails
static const int max_size_to_send = 1024;
-
+
to_send = (int)TSK_MIN(max_size_to_send, size);
-
+
if (CFWriteStreamGetStatus(sock->cf_write_stream) == kCFStreamStatusNotOpen) {
- if(!CFWriteStreamOpen(sock->cf_write_stream)){
+ if(!CFWriteStreamOpen(sock->cf_write_stream)) {
TSK_DEBUG_ERROR("CFWriteStreamOpen() failed");
return numberOfBytesSent;
}
}
if (CFReadStreamGetStatus(sock->cf_read_stream) == kCFStreamStatusNotOpen) {
- if(!CFReadStreamOpen(sock->cf_read_stream)){
+ if(!CFReadStreamOpen(sock->cf_read_stream)) {
TSK_DEBUG_ERROR("CFReadStreamOpen() failed");
return numberOfBytesSent;
}
@@ -472,17 +472,18 @@ tsk_size_t tnet_transport_send(const tnet_transport_handle_t *handle, tnet_fd_t
numberOfBytesSent += sent;
to_send = (int)TSK_MIN(max_size_to_send, (size - numberOfBytesSent));
}
- if(sent < 0){
+ if(sent < 0) {
TNET_PRINT_LAST_ERROR("Send have failed");
goto bail;
}
- } else {
+ }
+ else {
if ((numberOfBytesSent = (int)send(from, buf, size, 0)) < size) {
TNET_PRINT_LAST_ERROR("Send have failed");
goto bail;
}
}
-
+
bail:
return numberOfBytesSent;
}
@@ -491,17 +492,17 @@ tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
int numberOfBytesSent = 0, ret;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid server handle");
goto bail;
}
-
+
if (!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
TSK_DEBUG_ERROR("In order to use sendto you must use an udp transport");
goto bail;
}
-
+
while (numberOfBytesSent < size && (ret = (int)sendto(from, buf, size, 0, to, tnet_get_sockaddr_size(to))) >= 0) {
numberOfBytesSent += ret;
}
@@ -514,7 +515,7 @@ tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_
TNET_PRINT_LAST_ERROR("sendto(fd=%d) have failed", from);
}
}
-
+
bail:
return numberOfBytesSent;
}
@@ -522,20 +523,20 @@ bail:
int tnet_transport_have_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid server handle.");
return 0;
}
-
+
return (getSocket((transport_context_t*)transport->context, fd) != 0);
}
const tnet_tls_socket_handle_t* tnet_transport_get_tlshandle(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
-
- if(!transport){
+
+ if(!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
@@ -548,7 +549,7 @@ static const transport_socket_xt* getSocket(transport_context_t *context, tnet_f
{
tsk_size_t i;
transport_socket_xt* ret = tsk_null;
-
+
if (context) {
tsk_safeobj_lock(context);
for(i=0; i<context->count; i++) {
@@ -559,14 +560,14 @@ static const transport_socket_xt* getSocket(transport_context_t *context, tnet_f
}
tsk_safeobj_unlock(context);
}
-
+
return ret;
}
static const transport_socket_xt* getSocketByStream(transport_context_t *context, void* cf_stream)
{
tsk_size_t i;
transport_socket_xt* ret = tsk_null;
-
+
if (context) {
tsk_safeobj_lock(context);
for(i=0; i<context->count; i++) {
@@ -577,13 +578,14 @@ static const transport_socket_xt* getSocketByStream(transport_context_t *context
}
tsk_safeobj_unlock(context);
}
-
+
return ret;
}
/*== Add new socket ==*/
-int addSocket2(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport, tsk_bool_t take_ownership, tsk_bool_t is_client , const char* dst_host, tnet_port_t dst_port, struct tnet_proxyinfo_s* proxy_info) {
+int addSocket2(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport, tsk_bool_t take_ownership, tsk_bool_t is_client , const char* dst_host, tnet_port_t dst_port, struct tnet_proxyinfo_s* proxy_info)
+{
transport_context_t *context = transport?transport->context:0;
if (context) {
transport_socket_xt *sock = tsk_calloc(1, sizeof(transport_socket_xt));
@@ -596,24 +598,24 @@ int addSocket2(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transpor
if (dst_host && dst_port && tnet_proxyinfo_is_valid(proxy_info)) {
sock->proxy_info = tsk_object_ref(proxy_info);
}
-
+
if (!sock) {
TSK_DEBUG_ERROR("Failed to allocate socket");
return -1;
}
-
+
tsk_safeobj_lock(context);
wrapSocket(transport, sock);
context->sockets[context->count] = sock;
context->count++;
-
+
tsk_safeobj_unlock(context);
-
+
TSK_DEBUG_INFO("Socket added");
-
+
return 0;
}
- else{
+ else {
TSK_DEBUG_ERROR("Context is Null.");
return -1;
}
@@ -631,19 +633,19 @@ int addSocket(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport
int removeSocketAtIndex(int index, transport_context_t *context)
{
int i;
-
+
tsk_safeobj_lock(context);
-
+
if (index < (int)context->count) {
transport_socket_xt *sock = context->sockets[index];
tnet_fd_t fd = sock->fd;
-
+
// Remove from runloop
if (context->cf_run_loop && sock->cf_run_loop_source) {
CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes);
CFRelease(sock->cf_run_loop_source), sock->cf_run_loop_source = NULL;
}
-
+
// Invalidate CFSocket
if (sock->cf_socket) {
if (CFSocketIsValid(sock->cf_socket)) {
@@ -652,7 +654,7 @@ int removeSocketAtIndex(int index, transport_context_t *context)
CFRelease(sock->cf_socket);
sock->cf_socket = NULL;
}
-
+
// Close and free write stream
if (sock->cf_write_stream) {
if (CFWriteStreamGetStatus(sock->cf_write_stream) != kCFStreamStatusClosed) {
@@ -661,7 +663,7 @@ int removeSocketAtIndex(int index, transport_context_t *context)
CFRelease(sock->cf_write_stream);
sock->cf_write_stream = NULL;
}
-
+
// Close and free read stream
if (sock->cf_read_stream) {
if (CFReadStreamGetStatus(sock->cf_read_stream) != kCFStreamStatusClosed) {
@@ -670,38 +672,38 @@ int removeSocketAtIndex(int index, transport_context_t *context)
CFRelease(sock->cf_read_stream);
sock->cf_read_stream = NULL;
}
-
+
// Close the socket if we are the owner.
if (sock->owner) {
tnet_sockfd_close(&(sock->fd));
}
-
+
TSK_FREE(sock->dst_host);
TSK_OBJECT_SAFE_FREE(sock->proxy_node);
TSK_OBJECT_SAFE_FREE(sock->proxy_info);
TSK_FREE(sock);
-
+
for (i = index ; i<context->count-1; ++i) {
context->sockets[i] = context->sockets[i+1];
}
-
+
context->sockets[context->count-1] = tsk_null;
context->count--;
-
+
TSK_DEBUG_INFO("Socket removed: %d", fd);
}
-
+
tsk_safeobj_unlock(context);
-
+
return 0;
}
int removeSocket(transport_socket_xt *value, transport_context_t *context)
{
int i;
-
+
tsk_safeobj_lock(context);
-
+
for(i = 0; i < context->count; i++) {
transport_socket_xt *sock = context->sockets[i];
if (sock == value) {
@@ -709,9 +711,9 @@ int removeSocket(transport_socket_xt *value, transport_context_t *context)
break;
}
}
-
+
tsk_safeobj_unlock(context);
-
+
return 0;
}
@@ -719,19 +721,19 @@ int tnet_transport_stop(tnet_transport_t *transport)
{
int ret;
transport_context_t *context;
-
+
if (!transport) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
context = transport->context;
-
+
if ((ret = tsk_runnable_stop(TSK_RUNNABLE(transport)))) {
return ret;
}
-
- if(transport->mainThreadId[0]){
+
+ if(transport->mainThreadId[0]) {
if (context && context->cf_run_loop) {
// Signal the run-loop
CFRunLoopWakeUp(context->cf_run_loop);
@@ -747,29 +749,29 @@ int tnet_transport_prepare(tnet_transport_t *transport)
{
int ret = -1;
transport_context_t *context;
-
+
if (!transport || !(context = transport->context)) {
TSK_DEBUG_ERROR("Invalid parameter.");
return -1;
}
-
+
if (transport->prepared) {
TSK_DEBUG_ERROR("Transport already prepared.");
return -2;
}
-
+
/* Prepare master */
- if(!transport->master){
- if((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))){
+ if(!transport->master) {
+ if((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))) {
tsk_strupdate(&transport->local_ip, transport->master->ip);
transport->bind_local_port = transport->master->port;
}
- else{
+ else {
TSK_DEBUG_ERROR("Failed to create master socket");
return -3;
}
}
-
+
/* Start listening */
if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
if ((ret = tnet_sockfd_listen(transport->master->fd, TNET_MAX_FDS))) {
@@ -777,7 +779,7 @@ int tnet_transport_prepare(tnet_transport_t *transport)
goto bail;
}
}
-
+
/* Add the master socket to the context. */
// don't take ownership: will be closed by the dtor() when refCount==0
// otherwise will be cosed twice: dtor() and removeSocket
@@ -785,281 +787,275 @@ int tnet_transport_prepare(tnet_transport_t *transport)
TSK_DEBUG_ERROR("Failed to add master socket");
goto bail;
}
-
+
transport->prepared = tsk_true;
-
+
bail:
return ret;
}
-int tnet_transport_unprepare(tnet_transport_t *transport){
+int tnet_transport_unprepare(tnet_transport_t *transport)
+{
transport_context_t *context;
-
- if(!transport || !(context = transport->context)){
+
+ if(!transport || !(context = transport->context)) {
TSK_DEBUG_ERROR("Invalid parameter.");
return -1;
}
-
- if(!transport->prepared){
+
+ if(!transport->prepared) {
return 0;
}
-
+
transport->prepared = tsk_false;
-
- while(context->count){
+
+ while(context->count) {
removeSocketAtIndex(0, context); // safe
}
-
+
// destroy master as it has been closed by removeSocket()
TSK_OBJECT_SAFE_FREE(transport->master);
-
+
return 0;
}
-void __CFReadStreamClientCallBack(CFReadStreamRef stream, CFStreamEventType eventType, void *clientCallBackInfo) {
+void __CFReadStreamClientCallBack(CFReadStreamRef stream, CFStreamEventType eventType, void *clientCallBackInfo)
+{
// Extract the context
tnet_transport_t *transport = (tnet_transport_t *) clientCallBackInfo;
transport_context_t *context = transport->context;
-
+
/* lock context */
tsk_safeobj_lock(context);
-
+
// Extract the native socket
CFDataRef data = CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle);
transport_socket_xt *sock = tsk_null;
- if(data){
+ if(data) {
CFSocketNativeHandle fd;
CFDataGetBytes(data, CFRangeMake(0, sizeof(CFSocketNativeHandle)), (UInt8*) &fd);
CFRelease(data);
sock = (transport_socket_xt *) getSocket(context, fd);
- } else if (eventType == kCFStreamEventErrorOccurred) { // this event returns null data
+ }
+ else if (eventType == kCFStreamEventErrorOccurred) { // this event returns null data
sock = (transport_socket_xt *) getSocketByStream(context, stream);
}
-
+
if(!sock) {
goto bail;
}
-
+
switch(eventType) {
- case kCFStreamEventOpenCompleted:
- {
- TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> kCFStreamEventOpenCompleted(fd=%d)", sock->fd);
+ case kCFStreamEventOpenCompleted: {
+ TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> kCFStreamEventOpenCompleted(fd=%d)", sock->fd);
#if 0
- // Check SSL certificates
- if (TNET_SOCKET_TYPE_IS_TLS(sock->type) && transport->tls.verify) {
- if (!isTrusted(transport, (__bridge id)stream, YES/*YES read stream*/)) {
- TSK_DEBUG_ERROR("Remote SSL certs not trusted...closing the write stream");
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
- removeSocket(sock, context);
- break;
- }
+ // Check SSL certificates
+ if (TNET_SOCKET_TYPE_IS_TLS(sock->type) && transport->tls.verify) {
+ if (!isTrusted(transport, (__bridge id)stream, YES/*YES read stream*/)) {
+ TSK_DEBUG_ERROR("Remote SSL certs not trusted...closing the write stream");
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
+ removeSocket(sock, context);
+ break;
}
+ }
#endif
- // Set "readable" flag
- if (!sock->readable) {
- sock->readable = tsk_true;
- if (sock->writable) {
- if (!sock->proxy_info || sock->proxy_handshacking_completed) {
- // no proxy or handshaking not done yet
- TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, sock->fd);
- }
- else if (sock->proxy_info && !sock->proxy_handshacking_started) {
- // proxy handshaking not done yet
- sock->proxy_handshacking_started = tsk_true;
- startProxyHandshaking(transport, sock);
- }
+ // Set "readable" flag
+ if (!sock->readable) {
+ sock->readable = tsk_true;
+ if (sock->writable) {
+ if (!sock->proxy_info || sock->proxy_handshacking_completed) {
+ // no proxy or handshaking not done yet
+ TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, sock->fd);
+ }
+ else if (sock->proxy_info && !sock->proxy_handshacking_started) {
+ // proxy handshaking not done yet
+ sock->proxy_handshacking_started = tsk_true;
+ startProxyHandshaking(transport, sock);
}
}
- break;
- }
- case kCFStreamEventEndEncountered:
- {
- TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> kCFStreamEventEndEncountered(fd=%d)", sock->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
- removeSocket(sock, context);
- break;
- }
- case kCFStreamEventHasBytesAvailable:
- {
- recvData(transport, sock);
- break;
- }
- case kCFStreamEventErrorOccurred:
- {
- // Get the error code
- CFErrorRef error = CFReadStreamCopyError(stream);
- if (error) {
- TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> Error=%lu -> %s, fd=%d, status=%ld", CFErrorGetCode(error), CFStringGetCStringPtr(CFErrorGetDomain(error), kCFStringEncodingUTF8), sock->fd, CFReadStreamGetStatus(stream));
- CFRelease(error);
- }
-
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, sock->fd);
- removeSocket(sock, context);
- break;
}
- default:
- {
- // Not Implemented
- TSK_DEBUG_WARN("Not implemented");
- break;
+ break;
+ }
+ case kCFStreamEventEndEncountered: {
+ TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> kCFStreamEventEndEncountered(fd=%d)", sock->fd);
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
+ removeSocket(sock, context);
+ break;
+ }
+ case kCFStreamEventHasBytesAvailable: {
+ recvData(transport, sock);
+ break;
+ }
+ case kCFStreamEventErrorOccurred: {
+ // Get the error code
+ CFErrorRef error = CFReadStreamCopyError(stream);
+ if (error) {
+ TSK_DEBUG_INFO("__CFReadStreamClientCallBack --> Error=%lu -> %s, fd=%d, status=%ld", CFErrorGetCode(error), CFStringGetCStringPtr(CFErrorGetDomain(error), kCFStringEncodingUTF8), sock->fd, CFReadStreamGetStatus(stream));
+ CFRelease(error);
}
+
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, sock->fd);
+ removeSocket(sock, context);
+ break;
+ }
+ default: {
+ // Not Implemented
+ TSK_DEBUG_WARN("Not implemented");
+ break;
+ }
}
-
+
/* unlock context */
bail:
tsk_safeobj_unlock(context);
}
-void __CFWriteStreamClientCallBack(CFWriteStreamRef stream, CFStreamEventType eventType, void *clientCallBackInfo) {
+void __CFWriteStreamClientCallBack(CFWriteStreamRef stream, CFStreamEventType eventType, void *clientCallBackInfo)
+{
// Extract the context
tnet_transport_t *transport = (tnet_transport_t *) clientCallBackInfo;
transport_context_t *context = transport->context;
-
+
/* lock context */
tsk_safeobj_lock(context);
-
+
// Extract the native socket
CFDataRef data = CFWriteStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle);
transport_socket_xt *sock = tsk_null;
- if(data){
+ if(data) {
CFSocketNativeHandle fd;
CFDataGetBytes(data, CFRangeMake(0, sizeof(CFSocketNativeHandle)), (UInt8*) &fd);
CFRelease(data);
sock = (transport_socket_xt *) getSocket(context, fd);
- } else if (eventType == kCFStreamEventErrorOccurred) { // this event returns null data
+ }
+ else if (eventType == kCFStreamEventErrorOccurred) { // this event returns null data
sock = (transport_socket_xt *) getSocketByStream(context, stream);
}
-
+
if(!sock) {
goto bail;
}
-
+
switch(eventType) {
- case kCFStreamEventOpenCompleted:
- {
- TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventOpenCompleted(fd=%d)", sock->fd);
- // still not connected, see kCFStreamEventCanAcceptBytes
- break;
+ case kCFStreamEventOpenCompleted: {
+ TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventOpenCompleted(fd=%d)", sock->fd);
+ // still not connected, see kCFStreamEventCanAcceptBytes
+ break;
+ }
+ case kCFStreamEventCanAcceptBytes: {
+ // To avoid blocking, call this function only if CFWriteStreamCanAcceptBytes returns true or after the stream’s client (set with CFWriteStreamSetClient) is notified of a kCFStreamEventCanAcceptBytes event.
+ TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventCanAcceptBytes(fd=%d)", sock->fd);
+ // Check SSL certificates
+ if (TNET_SOCKET_TYPE_IS_TLS(sock->type) && transport->tls.verify) {
+ if (!isTrusted(transport, (__bridge id)stream, FALSE/*NOT read stream*/)) {
+ TSK_DEBUG_ERROR("Remote SSL certs not trusted...closing the write stream");
+ removeSocket(sock, context);
+ break;
+ }
}
- case kCFStreamEventCanAcceptBytes:
- {
- // To avoid blocking, call this function only if CFWriteStreamCanAcceptBytes returns true or after the stream’s client (set with CFWriteStreamSetClient) is notified of a kCFStreamEventCanAcceptBytes event.
- TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventCanAcceptBytes(fd=%d)", sock->fd);
- // Check SSL certificates
- if (TNET_SOCKET_TYPE_IS_TLS(sock->type) && transport->tls.verify) {
- if (!isTrusted(transport, (__bridge id)stream, FALSE/*NOT read stream*/)) {
- TSK_DEBUG_ERROR("Remote SSL certs not trusted...closing the write stream");
- removeSocket(sock, context);
- break;
+ // Set "writable" flag
+ if (!sock->writable) {
+ sock->writable = tsk_true;
+ if (sock->readable) {
+ if (!sock->proxy_info || sock->proxy_handshacking_completed) {
+ // no proxy or handshaking not done yet
+ TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, sock->fd);
}
- }
- // Set "writable" flag
- if (!sock->writable) {
- sock->writable = tsk_true;
- if (sock->readable) {
- if (!sock->proxy_info || sock->proxy_handshacking_completed) {
- // no proxy or handshaking not done yet
- TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, sock->fd);
- }
- else if (sock->proxy_info && !sock->proxy_handshacking_started) {
- // proxy handshaking not done yet
- sock->proxy_handshacking_started = tsk_true;
- startProxyHandshaking(transport, sock);
- }
+ else if (sock->proxy_info && !sock->proxy_handshacking_started) {
+ // proxy handshaking not done yet
+ sock->proxy_handshacking_started = tsk_true;
+ startProxyHandshaking(transport, sock);
}
}
- break;
- }
- case kCFStreamEventEndEncountered:
- {
- TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventEndEncountered(fd=%d)", sock->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
- removeSocket(sock, context);
- break;
}
- case kCFStreamEventErrorOccurred:
- {
- // Get the error code
- CFErrorRef error = CFWriteStreamCopyError(stream);
- if (error) {
- TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> Error=%lu -> %s, fd=%d", CFErrorGetCode(error), CFStringGetCStringPtr(CFErrorGetDomain(error), kCFStringEncodingUTF8), sock->fd);
- CFRelease(error);
- }
-
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, sock->fd);
- removeSocket(sock, context);
- break;
- }
- default:
- {
- // Not Implemented
- TSK_DEBUG_ERROR("Not implemented");
- break;
+ break;
+ }
+ case kCFStreamEventEndEncountered: {
+ TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventEndEncountered(fd=%d)", sock->fd);
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, sock->fd);
+ removeSocket(sock, context);
+ break;
+ }
+ case kCFStreamEventErrorOccurred: {
+ // Get the error code
+ CFErrorRef error = CFWriteStreamCopyError(stream);
+ if (error) {
+ TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> Error=%lu -> %s, fd=%d", CFErrorGetCode(error), CFStringGetCStringPtr(CFErrorGetDomain(error), kCFStringEncodingUTF8), sock->fd);
+ CFRelease(error);
}
+
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, sock->fd);
+ removeSocket(sock, context);
+ break;
+ }
+ default: {
+ // Not Implemented
+ TSK_DEBUG_ERROR("Not implemented");
+ break;
+ }
}
-
+
/* unlock context */
bail:
tsk_safeobj_unlock(context);
}
-void __CFSocketCallBack(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) {
+void __CFSocketCallBack(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info)
+{
// Extract the context
tnet_transport_t *transport = (tnet_transport_t *) info;
transport_context_t *context = transport->context;
-
+
// Extract the native socket
int fd = CFSocketGetNative(s);
transport_socket_xt *sock = (transport_socket_xt *) getSocket(context, fd);
- if(!sock) goto bail;
-
+ if(!sock) {
+ goto bail;
+ }
+
/* lock context */
tsk_safeobj_lock(context);
-
+
switch (callbackType) {
- case kCFSocketReadCallBack:
- {
- recvData(transport, sock);
- break;
- }
- case kCFSocketAcceptCallBack:
- case kCFSocketConnectCallBack:
- case kCFSocketWriteCallBack:
- {
- TSK_DEBUG_INFO("__CFSocketCallBack(fd=%d), callbackType=%lu", sock->fd, callbackType);
- wrapSocket(transport, sock);
- break;
- }
- case kCFSocketDataCallBack:
- {
- if (data) {
- const UInt8 *ptr = CFDataGetBytePtr((CFDataRef)data);
- int len = (int)CFDataGetLength((CFDataRef)data);
- if (ptr && len > 0) {
- tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, sock->fd);
- if (e) {
- e->data = tsk_malloc(len);
- if (e->data) {
- memcpy(e->data, ptr, len);
- e->size = len;
- }
- struct sockaddr* address_ = (struct sockaddr*)CFDataGetBytePtr(address);
- memcpy(&e->remote_addr, address_, tnet_get_sockaddr_size(address_));
- TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
+ case kCFSocketReadCallBack: {
+ recvData(transport, sock);
+ break;
+ }
+ case kCFSocketAcceptCallBack:
+ case kCFSocketConnectCallBack:
+ case kCFSocketWriteCallBack: {
+ TSK_DEBUG_INFO("__CFSocketCallBack(fd=%d), callbackType=%lu", sock->fd, callbackType);
+ wrapSocket(transport, sock);
+ break;
+ }
+ case kCFSocketDataCallBack: {
+ if (data) {
+ const UInt8 *ptr = CFDataGetBytePtr((CFDataRef)data);
+ int len = (int)CFDataGetLength((CFDataRef)data);
+ if (ptr && len > 0) {
+ tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, sock->fd);
+ if (e) {
+ e->data = tsk_malloc(len);
+ if (e->data) {
+ memcpy(e->data, ptr, len);
+ e->size = len;
}
+ struct sockaddr* address_ = (struct sockaddr*)CFDataGetBytePtr(address);
+ memcpy(&e->remote_addr, address_, tnet_get_sockaddr_size(address_));
+ TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
}
}
- break;
- }
-
- default:
- {
- // Not Implemented
- TSK_DEBUG_ERROR("Not implemented");
- break;
}
+ break;
}
-
+
+ default: {
+ // Not Implemented
+ TSK_DEBUG_ERROR("Not implemented");
+ break;
+ }
+ }
+
/* unlock context */
bail:
tsk_safeobj_unlock(context);
@@ -1076,52 +1072,53 @@ int wrapSocket(tnet_transport_t *transport, transport_socket_xt *sock)
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// If the socket is already wrapped in a CFSocket or mainthead not started yet then return
if (!context->cf_run_loop) {
return 0;
}
-
+
// Put a reference to the transport context
const CFSocketContext socket_context = { 0, transport, NULL, NULL, NULL };
-
+
// Wrap socket and listen to events
if (!sock->cf_socket && !sock->cf_read_stream && !sock->cf_write_stream) {
sock->cf_socket = CFSocketCreateWithNative(kCFAllocatorDefault,
- sock->fd,
- kCFSocketReadCallBack | kCFSocketConnectCallBack | kCFSocketWriteCallBack | kCFSocketAcceptCallBack | kCFSocketDataCallBack,
- &__CFSocketCallBack,
- &socket_context);
-
+ sock->fd,
+ kCFSocketReadCallBack | kCFSocketConnectCallBack | kCFSocketWriteCallBack | kCFSocketAcceptCallBack | kCFSocketDataCallBack,
+ &__CFSocketCallBack,
+ &socket_context);
+
// Don't close the socket if the CFSocket is invalidated
CFOptionFlags flags = CFSocketGetSocketFlags(sock->cf_socket);
flags = flags & ~kCFSocketCloseOnInvalidate;
CFSocketSetSocketFlags(sock->cf_socket, flags);
-
+
// Create a new RunLoopSource and register it with the main thread RunLoop
sock->cf_run_loop_source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, sock->cf_socket, 0);
CFRunLoopAddSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes);
}
-
+
if (TNET_SOCKET_TYPE_IS_DGRAM(sock->type)) {
// Nothing to do
-
- } else if (TNET_SOCKET_TYPE_IS_STREAM(sock->type)) {
+
+ }
+ else if (TNET_SOCKET_TYPE_IS_STREAM(sock->type)) {
if (!sock->cf_read_stream && !sock->cf_write_stream) {
// Create a pair of streams (read/write) from the socket
CFStreamCreatePairWithSocket(kCFAllocatorDefault, sock->fd, &sock->cf_read_stream, &sock->cf_write_stream);
-
+
// Don't close underlying socket
CFReadStreamSetProperty(sock->cf_read_stream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanFalse);
CFWriteStreamSetProperty(sock->cf_write_stream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanFalse);
-
+
// Mark the stream for VoIP usage
CFReadStreamSetProperty(sock->cf_read_stream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);
CFWriteStreamSetProperty(sock->cf_write_stream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);
-
+
// Setup a context for the streams
CFStreamClientContext streamContext = { 0, transport, NULL, NULL, NULL };
-
+
// Set the client callback for the stream
CFReadStreamSetClient(sock->cf_read_stream,
kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable | kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered,
@@ -1131,18 +1128,18 @@ int wrapSocket(tnet_transport_t *transport, transport_socket_xt *sock)
kCFStreamEventOpenCompleted | kCFStreamEventErrorOccurred | kCFStreamEventCanAcceptBytes |kCFStreamEventEndEncountered,
&__CFWriteStreamClientCallBack,
&streamContext);
-
+
if (TNET_SOCKET_TYPE_IS_TLS(sock->type)) {
if ((ret = enableSSL(transport, sock)) != 0) {
return ret;
}
}
-
+
// Enroll streams in the run-loop
CFReadStreamScheduleWithRunLoop(sock->cf_read_stream, context->cf_run_loop, kCFRunLoopCommonModes);
CFWriteStreamScheduleWithRunLoop(sock->cf_write_stream, context->cf_run_loop, kCFRunLoopCommonModes);
}
-
+
// Open streams only if ready (otherwise, fails on iOS8)
if (tnet_sockfd_waitUntilReadable(sock->fd, 1) == 0 || tnet_sockfd_waitUntilWritable(sock->fd, 1) == 0) {
// switch from cf_socket to streams
@@ -1155,11 +1152,11 @@ int wrapSocket(tnet_transport_t *transport, transport_socket_xt *sock)
CFRelease(sock->cf_socket);
sock->cf_socket = NULL;
}
-
+
should_open_streams = tsk_true;
}
}
-
+
// Proxy
if (sock->proxy_info) {
if (sock->proxy_node && sock->proxy_node->type != sock->proxy_info->type) {
@@ -1178,7 +1175,7 @@ int wrapSocket(tnet_transport_t *transport, transport_socket_xt *sock)
TNET_PROXY_SET_SOCKET(sock->fd, sock->type),
TNET_PROXY_NODE_SET_NULL());
}
-
+
// Open streams
if (should_open_streams) {
if (!CFReadStreamOpen(sock->cf_read_stream)) {
@@ -1198,7 +1195,7 @@ int wrapSocket(tnet_transport_t *transport, transport_socket_xt *sock)
TSK_DEBUG_INFO("CFWriteStreamOpen(fd=%d) returned with status=%ld", sock->fd, status);
}
}
-
+
return 0;
}
@@ -1213,7 +1210,7 @@ static int enableSSL(tnet_transport_t *transport, transport_socket_xt *sock)
CFReadStreamSetProperty(sock->cf_read_stream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFWriteStreamSetProperty(sock->cf_write_stream, kCFStreamSSLLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFReadStreamSetProperty(sock->cf_read_stream, kCFStreamSSLLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
-
+
CFMutableDictionaryRef settings = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
#if (__IPHONE_OS_VERSION_MIN_REQUIRED < 40000) // @Deprecated
CFDictionaryAddValue(settings, kCFStreamSSLAllowsExpiredCertificates, kCFBooleanTrue);
@@ -1223,11 +1220,11 @@ static int enableSSL(tnet_transport_t *transport, transport_socket_xt *sock)
CFDictionaryAddValue(settings, kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse);
CFDictionaryAddValue(settings, kCFStreamSSLIsServer, sock->is_client ? kCFBooleanFalse : kCFBooleanTrue);
CFDictionaryAddValue(settings, kCFStreamSSLPeerName, kCFNull);
-
+
// Set the SSL settings
CFReadStreamSetProperty(sock->cf_read_stream, kCFStreamPropertySSLSettings, settings);
CFWriteStreamSetProperty(sock->cf_write_stream, kCFStreamPropertySSLSettings, settings);
-
+
CFRelease(settings);
}
return 0;
@@ -1239,12 +1236,12 @@ static int startProxyHandshaking(tnet_transport_t *transport, transport_socket_x
int ret;
void* handshaking_data_ptr = tsk_null;
tsk_size_t handshaking_data_size = 0;
-
+
if (!transport || !(context = transport->context) || !sock || !sock->proxy_info || !sock->proxy_node) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// start handshaking
if ((ret = tnet_proxy_node_start_handshaking(sock->proxy_node)) != 0) {
return ret;
@@ -1260,7 +1257,7 @@ static int startProxyHandshaking(tnet_transport_t *transport, transport_socket_x
TSK_FREE(handshaking_data_ptr);
// check if handshaking completed
tnet_proxy_node_get_handshaking_completed(sock->proxy_node, &sock->proxy_handshacking_completed);
-
+
return ret;
}
@@ -1270,15 +1267,15 @@ void *tnet_transport_mainthread(void *param)
tnet_transport_t *transport = param;
transport_context_t *context = transport->context;
int i;
-
+
/* check whether the transport is already prepared */
if (!transport->prepared) {
TSK_DEBUG_ERROR("Transport must be prepared before strating.");
goto bail;
}
-
+
TSK_DEBUG_INFO("Starting [%s] server with IP {%s} on port {%d} with fd {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->fd);
-
+
// Set the RunLoop of the context
context->cf_run_loop = CFRunLoopGetCurrent();
CFRetain(context->cf_run_loop);
@@ -1288,22 +1285,22 @@ void *tnet_transport_mainthread(void *param)
wrapSocket(transport, context->sockets[i]);
}
tsk_safeobj_unlock(context);
-
+
while(TSK_RUNNABLE(transport)->running) {
// Give some time to process sources
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0, false);
-
+
if (!TSK_RUNNABLE(transport)->running) {
goto bail;
}
}
-
+
// Remove all the sockets, streams and sources from the run loop
tsk_safeobj_lock(context);
for(i = 0; i < context->count; i++) {
transport_context_t *context = transport->context;
transport_socket_xt *sock = context->sockets[i];
-
+
if (!sock) {
continue;
}
@@ -1320,11 +1317,11 @@ void *tnet_transport_mainthread(void *param)
}
}
tsk_safeobj_unlock(context);
-
-
+
+
bail:
TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}...", transport->description, transport->master->ip, transport->master->port);
- if(context->cf_run_loop){
+ if(context->cf_run_loop) {
CFRelease(context->cf_run_loop);
context->cf_run_loop = NULL;
}
@@ -1357,7 +1354,7 @@ static tsk_object_t* transport_context_ctor(tsk_object_t * self, va_list * app)
}
static tsk_object_t* transport_context_dtor(tsk_object_t * self)
-{
+{
transport_context_t *context = self;
if (context) {
while(context->count) {
@@ -1368,12 +1365,11 @@ static tsk_object_t* transport_context_dtor(tsk_object_t * self)
return self;
}
-static const tsk_object_def_t tnet_transport_context_def_s =
-{
+static const tsk_object_def_t tnet_transport_context_def_s = {
sizeof(transport_context_t),
- transport_context_ctor,
+ transport_context_ctor,
transport_context_dtor,
- tsk_null,
+ tsk_null,
};
const tsk_object_def_t *tnet_transport_context_def_t = &tnet_transport_context_def_s;
diff --git a/tinyNET/src/tnet_transport_poll.c b/tinyNET/src/tnet_transport_poll.c
index 0774823..3aa8913 100755
--- a/tinyNET/src/tnet_transport_poll.c
+++ b/tinyNET/src/tnet_transport_poll.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,31 +51,29 @@
#endif
/*== Socket description ==*/
-typedef struct transport_socket_xs
-{
- tnet_fd_t fd;
- tsk_bool_t owner;
- tsk_bool_t connected;
- tsk_bool_t paused;
+typedef struct transport_socket_xs {
+ tnet_fd_t fd;
+ tsk_bool_t owner;
+ tsk_bool_t connected;
+ tsk_bool_t paused;
- tnet_socket_type_t type;
- tnet_tls_socket_handle_t* tlshandle;
+ tnet_socket_type_t type;
+ tnet_tls_socket_handle_t* tlshandle;
}
transport_socket_xt;
/*== Transport context structure definition ==*/
-typedef struct transport_context_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_size_t count;
- tnet_fd_t pipeW;
- tnet_fd_t pipeR;
- tnet_pollfd_t ufds[TNET_MAX_FDS];
- transport_socket_xt* sockets[TNET_MAX_FDS];
- tsk_bool_t polling; // whether we are poll()ing
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct transport_context_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_size_t count;
+ tnet_fd_t pipeW;
+ tnet_fd_t pipeR;
+ tnet_pollfd_t ufds[TNET_MAX_FDS];
+ transport_socket_xt* sockets[TNET_MAX_FDS];
+ tsk_bool_t polling; // whether we are poll()ing
+
+ TSK_DECLARE_SAFEOBJ;
}
transport_context_t;
@@ -95,269 +93,270 @@ int tnet_transport_add_socket_2(const tnet_transport_handle_t *handle, tnet_fd_t
int tnet_transport_add_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tnet_socket_type_t type, tsk_bool_t take_ownership, tsk_bool_t isClient, tnet_tls_socket_handle_t* tlsHandle)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t* context;
- static char c = '\0';
- int ret = -1;
-
- if(!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return ret;
- }
-
- if(!(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid context.");
- return -2;
- }
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t* context;
+ static char c = '\0';
+ int ret = -1;
+
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return ret;
+ }
- if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)){
- transport->tls.enabled = 1;
- }
-
- if((ret = addSocket(fd, type, transport, take_ownership, isClient, tlsHandle))){
- TSK_DEBUG_ERROR("Failed to add new Socket.");
- return ret;
- }
+ if(!(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid context.");
+ return -2;
+ }
- // signal
- if(context->pipeW && (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started)){
- if((ret = write(context->pipeW, &c, 1)) > 0){
- TSK_DEBUG_INFO("Socket added (external call) %d", fd);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to add new Socket.");
- return ret;
- }
- } else {
- TSK_DEBUG_INFO("pipeW (write site) not initialized yet.");
- return 0; //Will be taken when mainthead start
- }
+ if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)) {
+ transport->tls.enabled = 1;
+ }
+
+ if((ret = addSocket(fd, type, transport, take_ownership, isClient, tlsHandle))) {
+ TSK_DEBUG_ERROR("Failed to add new Socket.");
+ return ret;
+ }
+
+ // signal
+ if(context->pipeW && (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started)) {
+ if((ret = write(context->pipeW, &c, 1)) > 0) {
+ TSK_DEBUG_INFO("Socket added (external call) %d", fd);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to add new Socket.");
+ return ret;
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("pipeW (write site) not initialized yet.");
+ return 0; //Will be taken when mainthead start
+ }
}
int tnet_transport_pause_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tsk_bool_t pause)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t *context;
- transport_socket_xt* socket;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t *context;
+ transport_socket_xt* socket;
- if(!transport || !(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!transport || !(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if((socket = getSocket(context, fd))){
- socket->paused = pause;
- }
- else{
- TSK_DEBUG_WARN("Socket does not exist in this context");
- }
- return 0;
+ if((socket = getSocket(context, fd))) {
+ socket->paused = pause;
+ }
+ else {
+ TSK_DEBUG_WARN("Socket does not exist in this context");
+ }
+ return 0;
}
/* Remove socket */
int tnet_transport_remove_socket(const tnet_transport_handle_t *handle, tnet_fd_t *pfd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t *context;
- int ret = -1;
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t *context;
+ int ret = -1;
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
tnet_fd_t fd = *pfd;
-
- TSK_DEBUG_INFO("Removing socket %d", fd);
- if(!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return ret;
- }
-
- if(!(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid context.");
- return -2;
- }
-
- tsk_safeobj_lock(context);
+ TSK_DEBUG_INFO("Removing socket %d", fd);
- for(i=0; i<context->count; i++){
- if(context->sockets[i]->fd == fd){
- tsk_bool_t self_ref = (&context->sockets[i]->fd == pfd);
- removeSocket(i, context); // sockets[i] will be destroyed
- found = tsk_true;
- TSK_RUNNABLE_ENQUEUE(transport, event_removed, transport->callback_data, fd);
- if(!self_ref){ // if self_ref then, pfd no longer valid after removeSocket()
- *pfd = TNET_INVALID_FD;
- }
- break;
- }
- }
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return ret;
+ }
- tsk_safeobj_unlock(context);
-
- if(found){
- /* Signal */
- static char c = '\0';
- ret = write(context->pipeW, &c, 1);
- return (ret > 0 ? 0 : ret);
- }
-
- // ...
-
- return -1;
+ if(!(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid context.");
+ return -2;
+ }
+
+ tsk_safeobj_lock(context);
+
+ for(i=0; i<context->count; i++) {
+ if(context->sockets[i]->fd == fd) {
+ tsk_bool_t self_ref = (&context->sockets[i]->fd == pfd);
+ removeSocket(i, context); // sockets[i] will be destroyed
+ found = tsk_true;
+ TSK_RUNNABLE_ENQUEUE(transport, event_removed, transport->callback_data, fd);
+ if(!self_ref) { // if self_ref then, pfd no longer valid after removeSocket()
+ *pfd = TNET_INVALID_FD;
+ }
+ break;
+ }
+ }
+
+ tsk_safeobj_unlock(context);
+
+ if(found) {
+ /* Signal */
+ static char c = '\0';
+ ret = write(context->pipeW, &c, 1);
+ return (ret > 0 ? 0 : ret);
+ }
+
+ // ...
+
+ return -1;
}
tsk_size_t tnet_transport_send(const tnet_transport_handle_t *handle, tnet_fd_t from, const void* buf, tsk_size_t size)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- int numberOfBytesSent = 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ int numberOfBytesSent = 0;
- if(!transport){
- TSK_DEBUG_ERROR("Invalid transport handle.");
- goto bail;
- }
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid transport handle.");
+ goto bail;
+ }
- if(transport->tls.enabled){
- const transport_socket_xt* socket = getSocket(transport->context, from);
- if(socket && socket->tlshandle){
- if(!tnet_tls_socket_send(socket->tlshandle, buf, size)){
- numberOfBytesSent = size;
- }
- else{
- numberOfBytesSent = 0;
- }
- goto bail;
- }
- }
- else if((numberOfBytesSent = tnet_sockfd_send(from, buf, size, 0)) <= 0){
- TNET_PRINT_LAST_ERROR("send have failed.");
+ if(transport->tls.enabled) {
+ const transport_socket_xt* socket = getSocket(transport->context, from);
+ if(socket && socket->tlshandle) {
+ if(!tnet_tls_socket_send(socket->tlshandle, buf, size)) {
+ numberOfBytesSent = size;
+ }
+ else {
+ numberOfBytesSent = 0;
+ }
+ goto bail;
+ }
+ }
+ else if((numberOfBytesSent = tnet_sockfd_send(from, buf, size, 0)) <= 0) {
+ TNET_PRINT_LAST_ERROR("send have failed.");
- //tnet_sockfd_close(&from);
- goto bail;
- }
+ //tnet_sockfd_close(&from);
+ goto bail;
+ }
bail:
transport->bytes_out += numberOfBytesSent;
- return numberOfBytesSent;
+ return numberOfBytesSent;
}
tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_t from, const struct sockaddr *to, const void* buf, tsk_size_t size)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- int numberOfBytesSent = 0;
-
- if(!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- goto bail;
- }
-
- if(!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)){
- TSK_DEBUG_ERROR("In order to use sendto() you must use an udp transport.");
- goto bail;
- }
-
- if((numberOfBytesSent = tnet_sockfd_sendto(from, to, buf, size)) <= 0){
- TNET_PRINT_LAST_ERROR("sendto have failed.");
- goto bail;
- }
-
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ int numberOfBytesSent = 0;
+
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ goto bail;
+ }
+
+ if(!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
+ TSK_DEBUG_ERROR("In order to use sendto() you must use an udp transport.");
+ goto bail;
+ }
+
+ if((numberOfBytesSent = tnet_sockfd_sendto(from, to, buf, size)) <= 0) {
+ TNET_PRINT_LAST_ERROR("sendto have failed.");
+ goto bail;
+ }
+
bail:
transport->bytes_out += numberOfBytesSent;
- return numberOfBytesSent;
+ return numberOfBytesSent;
}
int tnet_transport_have_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
-
- if(!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return 0;
- }
-
- return (getSocket((transport_context_t*)transport->context, fd) != 0);
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return 0;
+ }
+
+ return (getSocket((transport_context_t*)transport->context, fd) != 0);
}
const tnet_tls_socket_handle_t* tnet_transport_get_tlshandle(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- const transport_socket_xt *socket;
-
- if(!transport){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if((socket = getSocket((transport_context_t*)transport->context, fd))){
- return socket->tlshandle;
- }
- return 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ const transport_socket_xt *socket;
+
+ if(!transport) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if((socket = getSocket((transport_context_t*)transport->context, fd))) {
+ return socket->tlshandle;
+ }
+ return 0;
}
/*== Get socket ==*/
static transport_socket_xt* getSocket(transport_context_t *context, tnet_fd_t fd)
{
- tsk_size_t i;
- transport_socket_xt* ret = 0;
-
- if(context){
- tsk_safeobj_lock(context);
- for(i=0; i<context->count; i++){
- if(context->sockets[i]->fd == fd){
- ret = context->sockets[i];
- break;
- }
- }
- tsk_safeobj_unlock(context);
- }
-
- return ret;
+ tsk_size_t i;
+ transport_socket_xt* ret = 0;
+
+ if(context) {
+ tsk_safeobj_lock(context);
+ for(i=0; i<context->count; i++) {
+ if(context->sockets[i]->fd == fd) {
+ ret = context->sockets[i];
+ break;
+ }
+ }
+ tsk_safeobj_unlock(context);
+ }
+
+ return ret;
}
/*== Add new socket ==*/
int addSocket(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport, tsk_bool_t take_ownership, tsk_bool_t is_client, tnet_tls_socket_handle_t* tlsHandle)
{
- transport_context_t *context = transport?transport->context:0;
- if(context){
- transport_socket_xt *sock = tsk_calloc(1, sizeof(transport_socket_xt));
- sock->fd = fd;
- sock->type = type;
- sock->owner = take_ownership;
-
- if((TNET_SOCKET_TYPE_IS_TLS(sock->type) || TNET_SOCKET_TYPE_IS_WSS(sock->type)) && transport->tls.enabled){
- if(tlsHandle){
- sock->tlshandle = tsk_object_ref(tlsHandle);
- }
- else{
+ transport_context_t *context = transport?transport->context:0;
+ if(context) {
+ transport_socket_xt *sock = tsk_calloc(1, sizeof(transport_socket_xt));
+ sock->fd = fd;
+ sock->type = type;
+ sock->owner = take_ownership;
+
+ if((TNET_SOCKET_TYPE_IS_TLS(sock->type) || TNET_SOCKET_TYPE_IS_WSS(sock->type)) && transport->tls.enabled) {
+ if(tlsHandle) {
+ sock->tlshandle = tsk_object_ref(tlsHandle);
+ }
+ else {
#if HAVE_OPENSSL
- sock->tlshandle = tnet_tls_socket_create(sock->fd, is_client ? transport->tls.ctx_client : transport->tls.ctx_server);
+ sock->tlshandle = tnet_tls_socket_create(sock->fd, is_client ? transport->tls.ctx_client : transport->tls.ctx_server);
#endif
- }
- }
-
- tsk_safeobj_lock(context);
-
- context->ufds[context->count].fd = fd;
- context->ufds[context->count].events = (fd == context->pipeR) ? TNET_POLLIN : (TNET_POLLIN | TNET_POLLNVAL | TNET_POLLERR);
- if(TNET_SOCKET_TYPE_IS_STREAM(sock->type) && fd != context->pipeR){
- context->ufds[context->count].events |= TNET_POLLOUT; // emulate WinSock2 FD_CONNECT event
- }
- context->ufds[context->count].revents = 0;
- context->sockets[context->count] = sock;
-
- context->count++;
-
- tsk_safeobj_unlock(context);
-
- TSK_DEBUG_INFO("Socket added[%s]: fd=%d, tail.count=%d", transport->description, fd, (int)context->count);
-
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Context is Null.");
- return -1;
- }
+ }
+ }
+
+ tsk_safeobj_lock(context);
+
+ context->ufds[context->count].fd = fd;
+ context->ufds[context->count].events = (fd == context->pipeR) ? TNET_POLLIN : (TNET_POLLIN | TNET_POLLNVAL | TNET_POLLERR);
+ if(TNET_SOCKET_TYPE_IS_STREAM(sock->type) && fd != context->pipeR) {
+ context->ufds[context->count].events |= TNET_POLLOUT; // emulate WinSock2 FD_CONNECT event
+ }
+ context->ufds[context->count].revents = 0;
+ context->sockets[context->count] = sock;
+
+ context->count++;
+
+ tsk_safeobj_unlock(context);
+
+ TSK_DEBUG_INFO("Socket added[%s]: fd=%d, tail.count=%d", transport->description, fd, (int)context->count);
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Context is Null.");
+ return -1;
+ }
}
/*== change connection state ==*/
@@ -378,180 +377,180 @@ static void setConnected(tnet_fd_t fd, transport_context_t *context, int connect
/*== Remove socket ==*/
int removeSocket(int index, transport_context_t *context)
{
- int i;
-
- tsk_safeobj_lock(context);
-
- if(index < (int)context->count){
- /* Close the socket if we are the owner. */
- TSK_DEBUG_INFO("Socket to remove: fd=%d, index=%d, tail.count=%d", context->sockets[index]->fd, index, (int)context->count);
- if(context->sockets[index]->owner){
- // do not close the socket while it's being poll()ed
- // http://stackoverflow.com/questions/5039608/poll-cant-detect-event-when-socket-is-closed-locally
- if(context->polling){
- TSK_DEBUG_INFO("RemoveSocket(fd=%d) has been requested but we are poll()ing the socket. ShutdownSocket(fd) called on the socket and we deferred the request.", context->sockets[index]->fd);
- TSK_DEBUG_INFO("ShutdownSocket(fd=%d)", context->sockets[index]->fd);
- tnet_sockfd_shutdown(context->sockets[index]->fd);
- goto done;
- }
- tnet_sockfd_close(&(context->sockets[index]->fd));
- }
-
- /* Free tls context */
- TSK_OBJECT_SAFE_FREE(context->sockets[index]->tlshandle);
-
- // Free socket
- TSK_FREE(context->sockets[index]);
-
- for(i=index ; i<context->count-1; i++){
- context->sockets[i] = context->sockets[i+1];
- context->ufds[i] = context->ufds[i+1];
- }
-
- context->sockets[context->count-1] = tsk_null;
- context->ufds[context->count-1].fd = TNET_INVALID_FD;
- context->ufds[context->count-1].events = 0;
- context->ufds[context->count-1].revents = 0;
-
- context->count--;
- }
+ int i;
+
+ tsk_safeobj_lock(context);
+
+ if(index < (int)context->count) {
+ /* Close the socket if we are the owner. */
+ TSK_DEBUG_INFO("Socket to remove: fd=%d, index=%d, tail.count=%d", context->sockets[index]->fd, index, (int)context->count);
+ if(context->sockets[index]->owner) {
+ // do not close the socket while it's being poll()ed
+ // http://stackoverflow.com/questions/5039608/poll-cant-detect-event-when-socket-is-closed-locally
+ if(context->polling) {
+ TSK_DEBUG_INFO("RemoveSocket(fd=%d) has been requested but we are poll()ing the socket. ShutdownSocket(fd) called on the socket and we deferred the request.", context->sockets[index]->fd);
+ TSK_DEBUG_INFO("ShutdownSocket(fd=%d)", context->sockets[index]->fd);
+ tnet_sockfd_shutdown(context->sockets[index]->fd);
+ goto done;
+ }
+ tnet_sockfd_close(&(context->sockets[index]->fd));
+ }
+
+ /* Free tls context */
+ TSK_OBJECT_SAFE_FREE(context->sockets[index]->tlshandle);
+
+ // Free socket
+ TSK_FREE(context->sockets[index]);
+
+ for(i=index ; i<context->count-1; i++) {
+ context->sockets[i] = context->sockets[i+1];
+ context->ufds[i] = context->ufds[i+1];
+ }
+
+ context->sockets[context->count-1] = tsk_null;
+ context->ufds[context->count-1].fd = TNET_INVALID_FD;
+ context->ufds[context->count-1].events = 0;
+ context->ufds[context->count-1].revents = 0;
+
+ context->count--;
+ }
done:
- tsk_safeobj_unlock(context);
-
- return 0;
+ tsk_safeobj_unlock(context);
+
+ return 0;
}
int tnet_transport_stop(tnet_transport_t *transport)
-{
- int ret;
- transport_context_t *context;
+{
+ int ret;
+ transport_context_t *context;
- if(!transport){
- return -1;
- }
-
- context = transport->context;
+ if(!transport) {
+ return -1;
+ }
- if((ret = tsk_runnable_stop(TSK_RUNNABLE(transport)))){
- return ret;
- }
-
- if(context){
- static char c = '\0';
-
- // signal
- tsk_safeobj_lock(context); // =>MUST
- if(tnet_transport_have_socket(transport, context->pipeR)){ // to avoid SIGPIPE=> check that there is at least one reader
- write(context->pipeW, &c, 1);
- }
- tsk_safeobj_unlock(context);
- }
-
- if(transport->mainThreadId[0]){
- return tsk_thread_join(transport->mainThreadId);
- }
- else{
- /* already soppped */
- return 0;
- }
+ context = transport->context;
+
+ if((ret = tsk_runnable_stop(TSK_RUNNABLE(transport)))) {
+ return ret;
+ }
+
+ if(context) {
+ static char c = '\0';
+
+ // signal
+ tsk_safeobj_lock(context); // =>MUST
+ if(tnet_transport_have_socket(transport, context->pipeR)) { // to avoid SIGPIPE=> check that there is at least one reader
+ write(context->pipeW, &c, 1);
+ }
+ tsk_safeobj_unlock(context);
+ }
+
+ if(transport->mainThreadId[0]) {
+ return tsk_thread_join(transport->mainThreadId);
+ }
+ else {
+ /* already soppped */
+ return 0;
+ }
}
int tnet_transport_prepare(tnet_transport_t *transport)
{
- int ret = -1;
- transport_context_t *context;
- tnet_fd_t pipes[2];
-
- TSK_DEBUG_INFO("tnet_transport_prepare()");
-
- if(!transport || !transport->context){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
- else{
- context = transport->context;
- }
-
- if(transport->prepared){
- TSK_DEBUG_ERROR("Transport already prepared.");
- return -2;
- }
+ int ret = -1;
+ transport_context_t *context;
+ tnet_fd_t pipes[2];
+
+ TSK_DEBUG_INFO("tnet_transport_prepare()");
+
+ if(!transport || !transport->context) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+ else {
+ context = transport->context;
+ }
+
+ if(transport->prepared) {
+ TSK_DEBUG_ERROR("Transport already prepared.");
+ return -2;
+ }
+
+ /* Prepare master */
+ if(!transport->master) {
+ if((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))) {
+ tsk_strupdate(&transport->local_ip, transport->master->ip);
+ transport->bind_local_port = transport->master->port;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create master socket");
+ return -3;
+ }
+ }
+
+ /* Start listening */
+ if(TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
+ if((ret = tnet_sockfd_listen(transport->master->fd, TNET_MAX_FDS))) {
+ TNET_PRINT_LAST_ERROR("listen have failed.");
+ goto bail;
+ }
+ }
+
+ /* Create and add pipes to the fd_set */
+ if((ret = pipe(pipes))) {
+ TNET_PRINT_LAST_ERROR("Failed to create new pipes.");
+ goto bail;
+ }
+
+ /* set both R and W sides */
+ context->pipeR = pipes[0];
+ context->pipeW = pipes[1];
+
+ /* add R side */
+ TSK_DEBUG_INFO("pipeR fd=%d, pipeW=%d", context->pipeR, context->pipeW);
+ if((ret = addSocket(context->pipeR, transport->master->type, transport, tsk_true, tsk_false, tsk_null))) {
+ goto bail;
+ }
+
+ /* Add the master socket to the context. */
+ TSK_DEBUG_INFO("master fd=%d", transport->master->fd);
+ // don't take ownership: will be closed by the dctor() when refCount==0
+ // otherwise will be closed twice: dctor() and removeSocket()
+ if((ret = addSocket(transport->master->fd, transport->master->type, transport, tsk_false, tsk_false, tsk_null))) {
+ TSK_DEBUG_ERROR("Failed to add master socket");
+ goto bail;
+ }
+
+ transport->prepared = tsk_true;
- /* Prepare master */
- if(!transport->master){
- if((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))){
- tsk_strupdate(&transport->local_ip, transport->master->ip);
- transport->bind_local_port = transport->master->port;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create master socket");
- return -3;
- }
- }
-
- /* Start listening */
- if(TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)){
- if((ret = tnet_sockfd_listen(transport->master->fd, TNET_MAX_FDS))){
- TNET_PRINT_LAST_ERROR("listen have failed.");
- goto bail;
- }
- }
-
- /* Create and add pipes to the fd_set */
- if((ret = pipe(pipes))){
- TNET_PRINT_LAST_ERROR("Failed to create new pipes.");
- goto bail;
- }
-
- /* set both R and W sides */
- context->pipeR = pipes[0];
- context->pipeW = pipes[1];
-
- /* add R side */
- TSK_DEBUG_INFO("pipeR fd=%d, pipeW=%d", context->pipeR, context->pipeW);
- if((ret = addSocket(context->pipeR, transport->master->type, transport, tsk_true, tsk_false, tsk_null))){
- goto bail;
- }
-
- /* Add the master socket to the context. */
- TSK_DEBUG_INFO("master fd=%d", transport->master->fd);
- // don't take ownership: will be closed by the dctor() when refCount==0
- // otherwise will be closed twice: dctor() and removeSocket()
- if((ret = addSocket(transport->master->fd, transport->master->type, transport, tsk_false, tsk_false, tsk_null))){
- TSK_DEBUG_ERROR("Failed to add master socket");
- goto bail;
- }
-
- transport->prepared = tsk_true;
-
bail:
- return ret;
+ return ret;
}
int tnet_transport_unprepare(tnet_transport_t *transport)
{
- //int ret = -1;
- transport_context_t *context;
-
- if(!transport || !transport->context){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
- else{
- context = transport->context;
- }
+ //int ret = -1;
+ transport_context_t *context;
- if(!transport->prepared){
- return 0;
- }
+ if(!transport || !transport->context) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+ else {
+ context = transport->context;
+ }
- transport->prepared = tsk_false;
-
- while(context->count){
- removeSocket(0, context); // safe
- }
+ if(!transport->prepared) {
+ return 0;
+ }
- /* reset both R and W sides */
+ transport->prepared = tsk_false;
+
+ while(context->count) {
+ removeSocket(0, context); // safe
+ }
+
+ /* reset both R and W sides */
if (context->pipeW != -1) {
if (close(context->pipeW)) {
TSK_DEBUG_ERROR("Failed to close pipeW:%d", context->pipeW);
@@ -560,244 +559,242 @@ int tnet_transport_unprepare(tnet_transport_t *transport)
}
context->pipeR = -1;
- // destroy master as it has been closed by removeSocket()
- TSK_OBJECT_SAFE_FREE(transport->master);
+ // destroy master as it has been closed by removeSocket()
+ TSK_OBJECT_SAFE_FREE(transport->master);
- return 0;
+ return 0;
}
/*=== Main thread */
void *tnet_transport_mainthread(void *param)
{
- tnet_transport_t *transport = param;
- transport_context_t *context = transport->context;
- int ret, status;
- tsk_size_t i;
- tsk_bool_t is_stream;
+ tnet_transport_t *transport = param;
+ transport_context_t *context = transport->context;
+ int ret, status;
+ tsk_size_t i;
+ tsk_bool_t is_stream;
tnet_fd_t fd;
- struct sockaddr_storage remote_addr = {0};
- transport_socket_xt* active_socket;
+ struct sockaddr_storage remote_addr = {0};
+ transport_socket_xt* active_socket;
- /* check whether the transport is already prepared */
- if(!transport->prepared){
- TSK_DEBUG_ERROR("Transport must be prepared before strating.");
- goto bail;
- }
-
- is_stream = TNET_SOCKET_TYPE_IS_STREAM(transport->master->type);
-
- TSK_DEBUG_INFO("Starting [%s] server with IP {%s} on port {%d} using master fd {%d} with type {%d} with max_fds {%lu}...",
- transport->description,
- transport->master->ip,
- transport->master->port,
- transport->master->fd,
- transport->master->type,
- sizeof(context->ufds)/sizeof(context->ufds[0]));
-
- while(TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started){
- context->polling = tsk_true;
- ret = tnet_poll(context->ufds, context->count, -1);
- context->polling = tsk_false;
- if(ret < 0){
- TNET_PRINT_LAST_ERROR("poll() have failed.");
- goto bail;
- }
+ /* check whether the transport is already prepared */
+ if(!transport->prepared) {
+ TSK_DEBUG_ERROR("Transport must be prepared before strating.");
+ goto bail;
+ }
+
+ is_stream = TNET_SOCKET_TYPE_IS_STREAM(transport->master->type);
+
+ TSK_DEBUG_INFO("Starting [%s] server with IP {%s} on port {%d} using master fd {%d} with type {%d} with max_fds {%lu}...",
+ transport->description,
+ transport->master->ip,
+ transport->master->port,
+ transport->master->fd,
+ transport->master->type,
+ sizeof(context->ufds)/sizeof(context->ufds[0]));
+
+ while(TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started) {
+ context->polling = tsk_true;
+ ret = tnet_poll(context->ufds, context->count, -1);
+ context->polling = tsk_false;
+ if(ret < 0) {
+ TNET_PRINT_LAST_ERROR("poll() have failed.");
+ goto bail;
+ }
+
+ if(!TSK_RUNNABLE(transport)->running && !TSK_RUNNABLE(transport)->started) {
+ TSK_DEBUG_INFO("Stopping [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
+ goto bail;
+ }
+
+ /* lock context */
+ tsk_safeobj_lock(context);
+
+ /* == == */
+ for(i=0; i<context->count; i++) {
+ if(!context->ufds[i].revents) {
+ continue;
+ }
+
+ // TSK_DEBUG_INFO("REVENTS(i=%d) = %d", i, context->ufds[i].revents);
+
+ if(context->ufds[i].fd == context->pipeR) {
+ TSK_DEBUG_INFO("PipeR event = %d", context->ufds[i].revents);
+ if(context->ufds[i].revents & TNET_POLLIN) {
+ static char __buffer[1024];
+ if(read(context->pipeR, __buffer, sizeof(__buffer)) < 0) {
+ TNET_PRINT_LAST_ERROR("Failed to read from the Pipe");
+ }
+ }
+ else if(context->ufds[i].revents & TNET_POLLHUP) {
+ TNET_PRINT_LAST_ERROR("Pipe Error");
+ goto bail;
+ }
+ context->ufds[i].revents = 0;
+ continue;
+ }
+
+ /* Get active event and socket */
+ active_socket = context->sockets[i];
- if(!TSK_RUNNABLE(transport)->running && !TSK_RUNNABLE(transport)->started){
- TSK_DEBUG_INFO("Stopping [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
- goto bail;
- }
-
- /* lock context */
- tsk_safeobj_lock(context);
-
- /* == == */
- for(i=0; i<context->count; i++)
- {
- if(!context->ufds[i].revents){
- continue;
- }
-
- // TSK_DEBUG_INFO("REVENTS(i=%d) = %d", i, context->ufds[i].revents);
-
- if(context->ufds[i].fd == context->pipeR){
- TSK_DEBUG_INFO("PipeR event = %d", context->ufds[i].revents);
- if(context->ufds[i].revents & TNET_POLLIN){
- static char __buffer[1024];
- if(read(context->pipeR, __buffer, sizeof(__buffer)) < 0){
- TNET_PRINT_LAST_ERROR("Failed to read from the Pipe");
- }
- }
- else if(context->ufds[i].revents & TNET_POLLHUP){
- TNET_PRINT_LAST_ERROR("Pipe Error");
- goto bail;
- }
- context->ufds[i].revents = 0;
- continue;
- }
-
- /* Get active event and socket */
- active_socket = context->sockets[i];
-
/*================== TNET_POLLHUP ==================*/
- if(context->ufds[i].revents & (TNET_POLLHUP)){
- if(context->ufds[i].revents & TNET_POLLOUT){
- TSK_DEBUG_INFO("POLLOUT and POLLHUP are exclusive");
- }
- else{
- fd = active_socket->fd;
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLHUP(%d)", transport->description, fd);
-
- tnet_transport_remove_socket(transport, &active_socket->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
- continue;
- }
- }
-
- /*================== TNET_POLLERR ==================*/
- if(context->ufds[i].revents & (TNET_POLLERR)){
+ if(context->ufds[i].revents & (TNET_POLLHUP)) {
+ if(context->ufds[i].revents & TNET_POLLOUT) {
+ TSK_DEBUG_INFO("POLLOUT and POLLHUP are exclusive");
+ }
+ else {
+ fd = active_socket->fd;
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLHUP(%d)", transport->description, fd);
+
+ tnet_transport_remove_socket(transport, &active_socket->fd);
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
+ continue;
+ }
+ }
+
+ /*================== TNET_POLLERR ==================*/
+ if(context->ufds[i].revents & (TNET_POLLERR)) {
fd = active_socket->fd;
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLERR(%d)", transport->description, fd);
-
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLERR(%d)", transport->description, fd);
+
tnet_transport_remove_socket(transport, &active_socket->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
- continue;
- }
-
- /*================== TNET_POLLNVAL ==================*/
- if(context->ufds[i].revents & (TNET_POLLNVAL)){
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
+ continue;
+ }
+
+ /*================== TNET_POLLNVAL ==================*/
+ if(context->ufds[i].revents & (TNET_POLLNVAL)) {
fd = active_socket->fd;
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLNVAL(%d)", transport->description, fd);
-
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLNVAL(%d)", transport->description, fd);
+
tnet_transport_remove_socket(transport, &active_socket->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
- continue;
- }
-
- /*================== POLLIN ==================*/
- if(context->ufds[i].revents & TNET_POLLIN)
- {
- tsk_size_t len = 0;
- void* buffer = tsk_null;
- tnet_transport_event_t* e;
-
- // TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLIN(%d)", transport->description, active_socket->fd);
-
- /* check whether the socket is paused or not */
- if(active_socket->paused){
- TSK_DEBUG_INFO("Socket is paused");
- goto TNET_POLLIN_DONE;
- }
-
- /* Retrieve the amount of pending data.
- * IMPORTANT: If you are using Symbian please update your SDK to the latest build (August 2009) to have 'FIONREAD'.
- * This apply whatever you are using the 3rd or 5th edition.
- * Download link: http://wiki.forum.nokia.com/index.php/Open_C/C%2B%2B_Release_History
- */
- ret = tnet_ioctlt(active_socket->fd, FIONREAD, &len);
- if((ret < 0 || !len) && is_stream){
- /* It's probably an incoming connection --> try to accept() it */
- int listening = 0, remove_socket = 0;
- socklen_t socklen = sizeof(listening);
-
- TSK_DEBUG_INFO("ioctlt(%d), len=%u returned zero or failed", active_socket->fd, (unsigned)len);
-
- // check if socket is listening
- if(getsockopt(active_socket->fd, SOL_SOCKET, SO_ACCEPTCONN, &listening, &socklen) != 0){
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
+ continue;
+ }
+
+ /*================== POLLIN ==================*/
+ if(context->ufds[i].revents & TNET_POLLIN) {
+ tsk_size_t len = 0;
+ void* buffer = tsk_null;
+ tnet_transport_event_t* e;
+
+ // TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLIN(%d)", transport->description, active_socket->fd);
+
+ /* check whether the socket is paused or not */
+ if(active_socket->paused) {
+ TSK_DEBUG_INFO("Socket is paused");
+ goto TNET_POLLIN_DONE;
+ }
+
+ /* Retrieve the amount of pending data.
+ * IMPORTANT: If you are using Symbian please update your SDK to the latest build (August 2009) to have 'FIONREAD'.
+ * This apply whatever you are using the 3rd or 5th edition.
+ * Download link: http://wiki.forum.nokia.com/index.php/Open_C/C%2B%2B_Release_History
+ */
+ ret = tnet_ioctlt(active_socket->fd, FIONREAD, &len);
+ if((ret < 0 || !len) && is_stream) {
+ /* It's probably an incoming connection --> try to accept() it */
+ int listening = 0, remove_socket = 0;
+ socklen_t socklen = sizeof(listening);
+
+ TSK_DEBUG_INFO("ioctlt(%d), len=%u returned zero or failed", active_socket->fd, (unsigned)len);
+
+ // check if socket is listening
+ if(getsockopt(active_socket->fd, SOL_SOCKET, SO_ACCEPTCONN, &listening, &socklen) != 0) {
#if defined(BSD) /* old FreeBSD versions (and OSX up to Lion) do not support SO_ACCEPTCONN */
listening = 1;
#else
- TNET_PRINT_LAST_ERROR("getsockopt(SO_ACCEPTCONN, %d) failed\n", active_socket->fd);
+ TNET_PRINT_LAST_ERROR("getsockopt(SO_ACCEPTCONN, %d) failed\n", active_socket->fd);
/* not socket accepted -> no socket to remove */
goto TNET_POLLIN_DONE;
#endif
- }
- if (listening){
- if((fd = accept(active_socket->fd, tsk_null, tsk_null)) != TNET_INVALID_SOCKET){
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_ACCEPT(fd=%d)", transport->description, fd);
- addSocket(fd, transport->master->type, transport, tsk_true, tsk_false, tsk_null);
- TSK_RUNNABLE_ENQUEUE(transport, event_accepted, transport->callback_data, fd);
- if(active_socket->tlshandle){
- transport_socket_xt* tls_socket;
- if((tls_socket = getSocket(context, fd))){
- if(tnet_tls_socket_accept(tls_socket->tlshandle) != 0){
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
- tnet_transport_remove_socket(transport, &fd);
- TNET_PRINT_LAST_ERROR("SSL_accept() failed");
- continue;
- }
- }
- }
- }
- else{
- TNET_PRINT_LAST_ERROR("accept(%d) failed", active_socket->fd);
- remove_socket = 1;
- }
- }
- else{
- TSK_DEBUG_INFO("Closing socket with fd = %d because ioctlt() returned zero or failed", active_socket->fd);
- remove_socket = 1;
- }
-
- if(remove_socket){
- fd = active_socket->fd;
- tnet_transport_remove_socket(transport, &active_socket->fd);
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
- continue;
- }
- goto TNET_POLLIN_DONE;
- }
-
- if(len <= 0){
+ }
+ if (listening) {
+ if((fd = accept(active_socket->fd, tsk_null, tsk_null)) != TNET_INVALID_SOCKET) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_ACCEPT(fd=%d)", transport->description, fd);
+ addSocket(fd, transport->master->type, transport, tsk_true, tsk_false, tsk_null);
+ TSK_RUNNABLE_ENQUEUE(transport, event_accepted, transport->callback_data, fd);
+ if(active_socket->tlshandle) {
+ transport_socket_xt* tls_socket;
+ if((tls_socket = getSocket(context, fd))) {
+ if(tnet_tls_socket_accept(tls_socket->tlshandle) != 0) {
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
+ tnet_transport_remove_socket(transport, &fd);
+ TNET_PRINT_LAST_ERROR("SSL_accept() failed");
+ continue;
+ }
+ }
+ }
+ }
+ else {
+ TNET_PRINT_LAST_ERROR("accept(%d) failed", active_socket->fd);
+ remove_socket = 1;
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("Closing socket with fd = %d because ioctlt() returned zero or failed", active_socket->fd);
+ remove_socket = 1;
+ }
+
+ if(remove_socket) {
+ fd = active_socket->fd;
+ tnet_transport_remove_socket(transport, &active_socket->fd);
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, fd);
+ continue;
+ }
+ goto TNET_POLLIN_DONE;
+ }
+
+ if(len <= 0) {
#if ANDROID
- // workaround for indoona OSX which sends bodiless UDP packets
- // vand Android requires to call recv() even if len is equal to zero
- if(len == 0 && ret == 0){
- static char __fake_buff[1];
- ret = recv(active_socket->fd, __fake_buff, len, 0);
- }
+ // workaround for indoona OSX which sends bodiless UDP packets
+ // vand Android requires to call recv() even if len is equal to zero
+ if(len == 0 && ret == 0) {
+ static char __fake_buff[1];
+ ret = recv(active_socket->fd, __fake_buff, len, 0);
+ }
#endif
- goto TNET_POLLIN_DONE;
- }
-
- if (!(buffer = tsk_calloc(len, sizeof(uint8_t)))) {
- TSK_DEBUG_ERROR("TSK_CALLOC FAILED");
- goto TNET_POLLIN_DONE;
- }
-
- // Retrieve the remote address
- if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
- ret = tnet_getpeername(active_socket->fd, &remote_addr);
- }
-
- // Receive the waiting data
- if (active_socket->tlshandle) {
- int isEncrypted;
- tsk_size_t tlslen = len;
- if ((ret = tnet_tls_socket_recv(active_socket->tlshandle, &buffer, &tlslen, &isEncrypted)) == 0) {
- if (isEncrypted) {
- TSK_FREE(buffer);
- goto TNET_POLLIN_DONE;
- }
- if (ret == 0) {
- len = ret = tlslen;
- }
- }
- }
- else {
- if (is_stream) {
- ret = tnet_sockfd_recv(active_socket->fd, buffer, len, 0);
- }
- else {
- ret = tnet_sockfd_recvfrom(active_socket->fd, buffer, len, 0, (struct sockaddr*)&remote_addr);
- }
- }
-
- if(ret < 0){
- TSK_FREE(buffer);
+ goto TNET_POLLIN_DONE;
+ }
+
+ if (!(buffer = tsk_calloc(len, sizeof(uint8_t)))) {
+ TSK_DEBUG_ERROR("TSK_CALLOC FAILED");
+ goto TNET_POLLIN_DONE;
+ }
+
+ // Retrieve the remote address
+ if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
+ ret = tnet_getpeername(active_socket->fd, &remote_addr);
+ }
+
+ // Receive the waiting data
+ if (active_socket->tlshandle) {
+ int isEncrypted;
+ tsk_size_t tlslen = len;
+ if ((ret = tnet_tls_socket_recv(active_socket->tlshandle, &buffer, &tlslen, &isEncrypted)) == 0) {
+ if (isEncrypted) {
+ TSK_FREE(buffer);
+ goto TNET_POLLIN_DONE;
+ }
+ if (ret == 0) {
+ len = ret = tlslen;
+ }
+ }
+ }
+ else {
+ if (is_stream) {
+ ret = tnet_sockfd_recv(active_socket->fd, buffer, len, 0);
+ }
+ else {
+ ret = tnet_sockfd_recvfrom(active_socket->fd, buffer, len, 0, (struct sockaddr*)&remote_addr);
+ }
+ }
+
+ if(ret < 0) {
+ TSK_FREE(buffer);
status = tnet_geterrno();
- // do not remove the socket for i/o pending errors
+ // do not remove the socket for i/o pending errors
if (status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_INPROGRESS || status == TNET_ERROR_EAGAIN) {
TSK_DEBUG_WARN("recv returned error code:%d", status);
}
@@ -805,61 +802,62 @@ void *tnet_transport_mainthread(void *param)
TNET_PRINT_LAST_ERROR("recv/recvfrom have failed");
removeSocket(i, context);
}
- goto TNET_POLLIN_DONE;
- }
-
- if((len != (tsk_size_t)ret) && len){
- len = (tsk_size_t)ret;
- // buffer = tsk_realloc(buffer, len);
- }
-
- if(len > 0){
+ goto TNET_POLLIN_DONE;
+ }
+
+ if((len != (tsk_size_t)ret) && len) {
+ len = (tsk_size_t)ret;
+ // buffer = tsk_realloc(buffer, len);
+ }
+
+ if(len > 0) {
transport->bytes_in += len;
- e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
- e->data = buffer, buffer = tsk_null;
- e->size = len;
- e->remote_addr = remote_addr;
-
- TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
- }
- TSK_FREE(buffer);
+ e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
+ e->data = buffer, buffer = tsk_null;
+ e->size = len;
+ e->remote_addr = remote_addr;
+
+ TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
+ }
+ TSK_FREE(buffer);
TNET_POLLIN_DONE:
- /*context->ufds[i].revents &= ~TNET_POLLIN*/;
- }
+ /*context->ufds[i].revents &= ~TNET_POLLIN*/
+ ;
+ }
- /*================== TNET_POLLOUT ==================*/
- if(context->ufds[i].revents & TNET_POLLOUT){
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLOUT", transport->description);
- if(!active_socket->connected){
- active_socket->connected = tsk_true;
- TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, active_socket->fd);
- }
- //else{
- context->ufds[i].events &= ~TNET_POLLOUT;
- //}
- }
+ /*================== TNET_POLLOUT ==================*/
+ if(context->ufds[i].revents & TNET_POLLOUT) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLOUT", transport->description);
+ if(!active_socket->connected) {
+ active_socket->connected = tsk_true;
+ TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, active_socket->fd);
+ }
+ //else{
+ context->ufds[i].events &= ~TNET_POLLOUT;
+ //}
+ }
- /*================== TNET_POLLPRI ==================*/
- if(context->ufds[i].revents & TNET_POLLPRI){
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLPRI", transport->description);
- }
+ /*================== TNET_POLLPRI ==================*/
+ if(context->ufds[i].revents & TNET_POLLPRI) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLPRI", transport->description);
+ }
context->ufds[i].revents = 0;
- }/* for */
+ }/* for */
done:
- /* unlock context */
- tsk_safeobj_unlock(context);
+ /* unlock context */
+ tsk_safeobj_unlock(context);
- } /* while */
+ } /* while */
bail:
-
- TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}", transport->description, transport->master->ip, transport->master->port);
- return 0;
+
+ TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}", transport->description, transport->master->ip, transport->master->port);
+ return 0;
}
@@ -871,7 +869,7 @@ bail:
void* tnet_transport_context_create()
{
- return tsk_object_new(tnet_transport_context_def_t);
+ return tsk_object_new(tnet_transport_context_def_t);
}
@@ -880,32 +878,31 @@ void* tnet_transport_context_create()
//
static tsk_object_t* transport_context_ctor(tsk_object_t * self, va_list * app)
{
- transport_context_t *context = self;
- if(context){
+ transport_context_t *context = self;
+ if(context) {
context->pipeR = context->pipeW = -1;
- tsk_safeobj_init(context);
- }
- return self;
+ tsk_safeobj_init(context);
+ }
+ return self;
}
static tsk_object_t* transport_context_dtor(tsk_object_t * self)
-{
- transport_context_t *context = self;
- if(context){
- while(context->count){
- removeSocket(0, context);
- }
- tsk_safeobj_deinit(context);
- }
- return self;
+{
+ transport_context_t *context = self;
+ if(context) {
+ while(context->count) {
+ removeSocket(0, context);
+ }
+ tsk_safeobj_deinit(context);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_transport_context_def_s =
-{
-sizeof(transport_context_t),
-transport_context_ctor,
-transport_context_dtor,
-tsk_null,
+static const tsk_object_def_t tnet_transport_context_def_s = {
+ sizeof(transport_context_t),
+ transport_context_ctor,
+ transport_context_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_transport_context_def_t = &tnet_transport_context_def_s;
diff --git a/tinyNET/src/tnet_transport_win32.c b/tinyNET/src/tnet_transport_win32.c
index 6f7886f..626cccc 100755
--- a/tinyNET/src/tnet_transport_win32.c
+++ b/tinyNET/src/tnet_transport_win32.c
@@ -36,28 +36,26 @@
#if TNET_UNDER_WINDOWS && !TNET_USE_POLL
/*== Socket description ==*/
-typedef struct transport_socket_xs
-{
- tnet_fd_t fd;
- unsigned owner : 1;
- unsigned connected : 1;
- unsigned paused : 1;
-
- tnet_socket_type_t type;
- tnet_tls_socket_handle_t* tlshandle;
+typedef struct transport_socket_xs {
+ tnet_fd_t fd;
+ unsigned owner : 1;
+ unsigned connected : 1;
+ unsigned paused : 1;
+
+ tnet_socket_type_t type;
+ tnet_tls_socket_handle_t* tlshandle;
}
transport_socket_xt;
/*== Transport context structure definition ==*/
-typedef struct transport_context_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct transport_context_s {
+ TSK_DECLARE_OBJECT;
- tsk_size_t count;
- WSAEVENT events[WSA_MAXIMUM_WAIT_EVENTS];
- transport_socket_xt* sockets[WSA_MAXIMUM_WAIT_EVENTS];
+ tsk_size_t count;
+ WSAEVENT events[WSA_MAXIMUM_WAIT_EVENTS];
+ transport_socket_xt* sockets[WSA_MAXIMUM_WAIT_EVENTS];
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
transport_context_t;
@@ -68,54 +66,52 @@ static int removeSocket(int index, transport_context_t *context);
/* Checks if socket is connected */
int tnet_transport_isconnected(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t *context;
- tsk_size_t i;
-
- if (!transport)
- {
- TSK_DEBUG_ERROR("Invalid server handle.");
- return 0;
- }
-
- context = (transport_context_t*)transport->context;
- for (i = 0; i < context->count; i++)
- {
- const transport_socket_xt* socket = context->sockets[i];
- if (socket->fd == fd){
- return socket->connected;
- }
- }
-
- return 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t *context;
+ tsk_size_t i;
+
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return 0;
+ }
+
+ context = (transport_context_t*)transport->context;
+ for (i = 0; i < context->count; i++) {
+ const transport_socket_xt* socket = context->sockets[i];
+ if (socket->fd == fd) {
+ return socket->connected;
+ }
+ }
+
+ return 0;
}
int tnet_transport_have_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
- if (!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return 0;
- }
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return 0;
+ }
- return (getSocket((transport_context_t*)transport->context, fd) != 0);
+ return (getSocket((transport_context_t*)transport->context, fd) != 0);
}
const tnet_tls_socket_handle_t* tnet_transport_get_tlshandle(const tnet_transport_handle_t *handle, tnet_fd_t fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_socket_xt *socket;
-
- if (!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return 0;
- }
-
- if ((socket = getSocket((transport_context_t*)transport->context, fd))){
- return socket->tlshandle;
- }
- return 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_socket_xt *socket;
+
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return 0;
+ }
+
+ if ((socket = getSocket((transport_context_t*)transport->context, fd))) {
+ return socket->tlshandle;
+ }
+ return 0;
}
int tnet_transport_add_socket_2(const tnet_transport_handle_t *handle, tnet_fd_t fd, tnet_socket_type_t type, tsk_bool_t take_ownership, tsk_bool_t isClient, tnet_tls_socket_handle_t* tlsHandle, const char* dst_host, tnet_port_t dst_port, struct tnet_proxyinfo_s* proxy_info)
@@ -132,102 +128,102 @@ int tnet_transport_add_socket_2(const tnet_transport_handle_t *handle, tnet_fd_t
*/
int tnet_transport_add_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tnet_socket_type_t type, tsk_bool_t take_ownership, tsk_bool_t isClient, tnet_tls_socket_handle_t* tlsHandle)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t* context;
- int ret = -1;
-
- if (!transport){
- TSK_DEBUG_ERROR("Invalid server handle.");
- return ret;
- }
-
- if (!(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid context.");
- return -2;
- }
-
- if (TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)){
- transport->tls.enabled = tsk_true;
- }
-
- addSocket(fd, type, transport, take_ownership, isClient, tlsHandle);
-
- if (WSAEventSelect(fd, context->events[context->count - 1], FD_ALL_EVENTS) == SOCKET_ERROR){
- removeSocket((int)(context->count - 1), context);
- TNET_PRINT_LAST_ERROR("WSAEventSelect have failed.");
- return -1;
- }
-
- /* Signal if transport is running */
- if (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started){
- if (WSASetEvent(context->events[0])){
- TSK_DEBUG_INFO("New socket added to the network transport.");
- return 0;
- }
- TSK_DEBUG_ERROR("Transport not started yet");
- return -1;
- }
-
- TSK_DEBUG_INFO("Adding socket delayed");
- return 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t* context;
+ int ret = -1;
+
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ return ret;
+ }
+
+ if (!(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid context.");
+ return -2;
+ }
+
+ if (TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)) {
+ transport->tls.enabled = tsk_true;
+ }
+
+ addSocket(fd, type, transport, take_ownership, isClient, tlsHandle);
+
+ if (WSAEventSelect(fd, context->events[context->count - 1], FD_ALL_EVENTS) == SOCKET_ERROR) {
+ removeSocket((int)(context->count - 1), context);
+ TNET_PRINT_LAST_ERROR("WSAEventSelect have failed.");
+ return -1;
+ }
+
+ /* Signal if transport is running */
+ if (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started) {
+ if (WSASetEvent(context->events[0])) {
+ TSK_DEBUG_INFO("New socket added to the network transport.");
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Transport not started yet");
+ return -1;
+ }
+
+ TSK_DEBUG_INFO("Adding socket delayed");
+ return 0;
}
int tnet_transport_pause_socket(const tnet_transport_handle_t *handle, tnet_fd_t fd, tsk_bool_t pause)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t *context;
- transport_socket_xt* socket;
-
- if (!transport || !(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if ((socket = getSocket(context, fd))){
- socket->paused = pause;
- }
- else{
- TSK_DEBUG_WARN("Socket does not exist in this context");
- }
- return 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t *context;
+ transport_socket_xt* socket;
+
+ if (!transport || !(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if ((socket = getSocket(context, fd))) {
+ socket->paused = pause;
+ }
+ else {
+ TSK_DEBUG_WARN("Socket does not exist in this context");
+ }
+ return 0;
}
/* Remove socket
*/
int tnet_transport_remove_socket(const tnet_transport_handle_t *handle, tnet_fd_t* fd)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- transport_context_t *context;
- int ret = -1;
- tsk_size_t i;
- tsk_bool_t found = tsk_false;
-
- if (!transport || !(context = (transport_context_t*)transport->context)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for (i = 0; i < context->count; i++){
- if (context->sockets[i]->fd == *fd){
- removeSocket((int)i, context);
- found = tsk_true;
- TSK_RUNNABLE_ENQUEUE(transport, event_removed, transport->callback_data, *fd);
- *fd = TNET_INVALID_FD;
- break;
- }
- }
-
- if (found){
- /* Signal */
- if (WSASetEvent(context->events[0])){
- TSK_DEBUG_INFO("Old socket removed from the network transport.");
- return 0;
- }
- }
-
- // ...
-
- return -1;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ transport_context_t *context;
+ int ret = -1;
+ tsk_size_t i;
+ tsk_bool_t found = tsk_false;
+
+ if (!transport || !(context = (transport_context_t*)transport->context)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for (i = 0; i < context->count; i++) {
+ if (context->sockets[i]->fd == *fd) {
+ removeSocket((int)i, context);
+ found = tsk_true;
+ TSK_RUNNABLE_ENQUEUE(transport, event_removed, transport->callback_data, *fd);
+ *fd = TNET_INVALID_FD;
+ break;
+ }
+ }
+
+ if (found) {
+ /* Signal */
+ if (WSASetEvent(context->events[0])) {
+ TSK_DEBUG_INFO("Old socket removed from the network transport.");
+ return 0;
+ }
+ }
+
+ // ...
+
+ return -1;
}
/*
@@ -235,58 +231,58 @@ int tnet_transport_remove_socket(const tnet_transport_handle_t *handle, tnet_fd_
*/
tsk_size_t tnet_transport_send(const tnet_transport_handle_t *handle, tnet_fd_t from, const void* buf, tsk_size_t size)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- int ret = -1;
- tsk_size_t sent = 0;
-
- if (!transport){
- TSK_DEBUG_ERROR("Invalid transport handle.");
- goto bail;
- }
-
- while (sent < size) {
- int try_guard = 10;
- if (transport->tls.enabled){
- transport_socket_xt* socket = getSocket(transport->context, from);
- if (socket && socket->tlshandle) {
- if (tnet_tls_socket_send(socket->tlshandle, buf, size) == 0) {
- sent = size;
- }
- else {
- TSK_DEBUG_ERROR("Tring to use a socket without TLS handle to send data");
- }
- goto bail; // TLS do not retry
- }
- }
- else {
- WSABUF wsaBuffer;
- DWORD numberOfBytesSent = 0;
- wsaBuffer.buf = ((CHAR*)buf) + sent;
- wsaBuffer.len = (ULONG)(size - sent);
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ int ret = -1;
+ tsk_size_t sent = 0;
+
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid transport handle.");
+ goto bail;
+ }
+
+ while (sent < size) {
+ int try_guard = 10;
+ if (transport->tls.enabled) {
+ transport_socket_xt* socket = getSocket(transport->context, from);
+ if (socket && socket->tlshandle) {
+ if (tnet_tls_socket_send(socket->tlshandle, buf, size) == 0) {
+ sent = size;
+ }
+ else {
+ TSK_DEBUG_ERROR("Tring to use a socket without TLS handle to send data");
+ }
+ goto bail; // TLS do not retry
+ }
+ }
+ else {
+ WSABUF wsaBuffer;
+ DWORD numberOfBytesSent = 0;
+ wsaBuffer.buf = ((CHAR*)buf) + sent;
+ wsaBuffer.len = (ULONG)(size - sent);
try_again:
- if ((ret = WSASend(from, &wsaBuffer, 1, &numberOfBytesSent, 0, NULL, NULL)) == SOCKET_ERROR) {
- ret = WSAGetLastError();
- if (ret == WSA_IO_PENDING || ret == WSAEWOULDBLOCK) {
- TSK_DEBUG_INFO("SendTCP() - WouldBlock. Retrying...");
- if (try_guard--) {
- tsk_thread_sleep(10);
- goto try_again;
- }
- }
- else {
- TNET_PRINT_LAST_ERROR("WSASend have failed.");
- goto bail;
- }
- }
- else {
- sent += numberOfBytesSent;
- }
- }
- }
+ if ((ret = WSASend(from, &wsaBuffer, 1, &numberOfBytesSent, 0, NULL, NULL)) == SOCKET_ERROR) {
+ ret = WSAGetLastError();
+ if (ret == WSA_IO_PENDING || ret == WSAEWOULDBLOCK) {
+ TSK_DEBUG_INFO("SendTCP() - WouldBlock. Retrying...");
+ if (try_guard--) {
+ tsk_thread_sleep(10);
+ goto try_again;
+ }
+ }
+ else {
+ TNET_PRINT_LAST_ERROR("WSASend have failed.");
+ goto bail;
+ }
+ }
+ else {
+ sent += numberOfBytesSent;
+ }
+ }
+ }
bail:
transport->bytes_out += sent;
- return sent;
+ return sent;
}
/*
@@ -294,27 +290,27 @@ bail:
*/
tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_t from, const struct sockaddr *to, const void* buf, tsk_size_t size)
{
- tnet_transport_t *transport = (tnet_transport_t*)handle;
- int numberOfBytesSent = 0;
+ tnet_transport_t *transport = (tnet_transport_t*)handle;
+ int numberOfBytesSent = 0;
- if (!transport) {
- TSK_DEBUG_ERROR("Invalid server handle.");
- goto bail;
- }
+ if (!transport) {
+ TSK_DEBUG_ERROR("Invalid server handle.");
+ goto bail;
+ }
- if (!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
- TSK_DEBUG_ERROR("In order to use sendto() you must use an udp transport.");
- goto bail;
- }
+ if (!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
+ TSK_DEBUG_ERROR("In order to use sendto() you must use an udp transport.");
+ goto bail;
+ }
- if ((numberOfBytesSent = tnet_sockfd_sendto(from, to, buf, size)) <= 0) {
- TNET_PRINT_LAST_ERROR("sendto have failed.");
- goto bail;
- }
+ if ((numberOfBytesSent = tnet_sockfd_sendto(from, to, buf, size)) <= 0) {
+ TNET_PRINT_LAST_ERROR("sendto have failed.");
+ goto bail;
+ }
bail:
transport->bytes_out += numberOfBytesSent;
- return numberOfBytesSent;
+ return numberOfBytesSent;
}
@@ -327,472 +323,472 @@ bail:
/*== CAllback function to check if we should accept the new socket or not == */
int CALLBACK AcceptCondFunc(LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS lpSQos, LPQOS lpGQos, LPWSABUF lpCalleeId, LPWSABUF lpCalleeData, GROUP FAR *Group, DWORD_PTR CallbackData)
{
- transport_context_t *context = (transport_context_t*)CallbackData;
- return context->count < WSA_MAXIMUM_WAIT_EVENTS ? CF_ACCEPT : CF_REJECT;
+ transport_context_t *context = (transport_context_t*)CallbackData;
+ return context->count < WSA_MAXIMUM_WAIT_EVENTS ? CF_ACCEPT : CF_REJECT;
}
/*== Get socket ==*/
static transport_socket_xt* getSocket(transport_context_t *context, tnet_fd_t fd)
{
- tsk_size_t i;
- transport_socket_xt* ret = 0;
-
- if (context) {
- tsk_safeobj_lock(context);
- for (i = 0; i < context->count; i++) {
- if (context->sockets[i]->fd == fd) {
- ret = context->sockets[i];
- break;
- }
- }
- tsk_safeobj_unlock(context);
- }
-
- return ret;
+ tsk_size_t i;
+ transport_socket_xt* ret = 0;
+
+ if (context) {
+ tsk_safeobj_lock(context);
+ for (i = 0; i < context->count; i++) {
+ if (context->sockets[i]->fd == fd) {
+ ret = context->sockets[i];
+ break;
+ }
+ }
+ tsk_safeobj_unlock(context);
+ }
+
+ return ret;
}
/*== Add new socket ==*/
static int addSocket(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport, tsk_bool_t take_ownership, tsk_bool_t is_client, tnet_tls_socket_handle_t* tlsHandle)
{
- transport_context_t *context;
+ transport_context_t *context;
- if (TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)) {
+ if (TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type)) {
#if !HAVE_OPENSSL
- TSK_DEBUG_ERROR("Cannot create TLS socket: OpenSSL missing");
- return -2;
+ TSK_DEBUG_ERROR("Cannot create TLS socket: OpenSSL missing");
+ return -2;
#endif
- }
-
- if ((context = transport ? transport->context : tsk_null)) {
- transport_socket_xt *sock = tsk_calloc(1, sizeof(transport_socket_xt));
- sock->fd = fd;
- sock->type = type;
- sock->owner = take_ownership ? 1 : 0;
-
- if ((TNET_SOCKET_TYPE_IS_TLS(sock->type) || TNET_SOCKET_TYPE_IS_WSS(sock->type)) && transport->tls.enabled) {
- if (tlsHandle) {
- sock->tlshandle = tsk_object_ref(tlsHandle);
- }
- else{
+ }
+
+ if ((context = transport ? transport->context : tsk_null)) {
+ transport_socket_xt *sock = tsk_calloc(1, sizeof(transport_socket_xt));
+ sock->fd = fd;
+ sock->type = type;
+ sock->owner = take_ownership ? 1 : 0;
+
+ if ((TNET_SOCKET_TYPE_IS_TLS(sock->type) || TNET_SOCKET_TYPE_IS_WSS(sock->type)) && transport->tls.enabled) {
+ if (tlsHandle) {
+ sock->tlshandle = tsk_object_ref(tlsHandle);
+ }
+ else {
#if HAVE_OPENSSL
- sock->tlshandle = tnet_tls_socket_create(sock->fd, is_client ? transport->tls.ctx_client : transport->tls.ctx_server);
+ sock->tlshandle = tnet_tls_socket_create(sock->fd, is_client ? transport->tls.ctx_client : transport->tls.ctx_server);
#endif
- }
- }
+ }
+ }
- tsk_safeobj_lock(context);
- context->events[context->count] = WSACreateEvent();
- context->sockets[context->count] = sock;
+ tsk_safeobj_lock(context);
+ context->events[context->count] = WSACreateEvent();
+ context->sockets[context->count] = sock;
- context->count++;
+ context->count++;
- TSK_DEBUG_INFO("Transport[%s] sockets count = %u", transport->description, context->count);
+ TSK_DEBUG_INFO("Transport[%s] sockets count = %u", transport->description, context->count);
- tsk_safeobj_unlock(context);
+ tsk_safeobj_unlock(context);
- return 0;
- }
- else {
- TSK_DEBUG_ERROR("Context is Null.");
- return -1;
- }
- }
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Context is Null.");
+ return -1;
+ }
+}
/*== Remove socket ==*/
static int removeSocket(int index, transport_context_t *context)
{
- tsk_size_t i;
+ tsk_size_t i;
- tsk_safeobj_lock(context);
+ tsk_safeobj_lock(context);
- if (index < (int)context->count) {
+ if (index < (int)context->count) {
- /* Close the socket if we are the owner. */
- if (context->sockets[index]->owner) {
- tnet_sockfd_close(&(context->sockets[index]->fd));
- }
+ /* Close the socket if we are the owner. */
+ if (context->sockets[index]->owner) {
+ tnet_sockfd_close(&(context->sockets[index]->fd));
+ }
- /* Free tls context */
- if (context->sockets[index]->tlshandle) {
- TSK_OBJECT_SAFE_FREE(context->sockets[index]->tlshandle);
- }
- // Free socket
- TSK_FREE(context->sockets[index]);
+ /* Free tls context */
+ if (context->sockets[index]->tlshandle) {
+ TSK_OBJECT_SAFE_FREE(context->sockets[index]->tlshandle);
+ }
+ // Free socket
+ TSK_FREE(context->sockets[index]);
- // Close event
- WSACloseEvent(context->events[index]);
+ // Close event
+ WSACloseEvent(context->events[index]);
- for (i = index; i < context->count - 1; i++) {
- context->sockets[i] = context->sockets[i + 1];
- context->events[i] = context->events[i + 1];
- }
+ for (i = index; i < context->count - 1; i++) {
+ context->sockets[i] = context->sockets[i + 1];
+ context->events[i] = context->events[i + 1];
+ }
- context->sockets[context->count - 1] = 0;
- context->events[context->count - 1] = 0;
+ context->sockets[context->count - 1] = 0;
+ context->events[context->count - 1] = 0;
- context->count--;
- TSK_DEBUG_INFO("Transport sockets count = %u", context->count);
- }
+ context->count--;
+ TSK_DEBUG_INFO("Transport sockets count = %u", context->count);
+ }
- tsk_safeobj_unlock(context);
+ tsk_safeobj_unlock(context);
- return 0;
+ return 0;
}
/*=== stop all threads */
int tnet_transport_stop(tnet_transport_t *transport)
{
- int ret;
-
- if ((ret = tsk_runnable_stop(TSK_RUNNABLE(transport)))){
- return ret;
- }
-
- if (transport->mainThreadId[0]){
- WSASetEvent(((transport_context_t*)(transport->context))->events[0]);
- return tsk_thread_join(transport->mainThreadId);
- }
- else{
- /* already stoppped */
- return 0;
- }
+ int ret;
+
+ if ((ret = tsk_runnable_stop(TSK_RUNNABLE(transport)))) {
+ return ret;
+ }
+
+ if (transport->mainThreadId[0]) {
+ WSASetEvent(((transport_context_t*)(transport->context))->events[0]);
+ return tsk_thread_join(transport->mainThreadId);
+ }
+ else {
+ /* already stoppped */
+ return 0;
+ }
}
int tnet_transport_prepare(tnet_transport_t *transport)
{
- int ret = -1;
- transport_context_t *context;
-
- if (!transport || !transport->context){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
- else{
- context = transport->context;
- }
-
- if (transport->prepared){
- TSK_DEBUG_ERROR("Transport already prepared.");
- return -2;
- }
-
- /* Prepare master */
- if (!transport->master){
- if ((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))){
- tsk_strupdate(&transport->local_ip, transport->master->ip);
- transport->bind_local_port = transport->master->port;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create master socket");
- return -3;
- }
- }
-
- /* Start listening */
- if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
- if ((ret = tnet_sockfd_listen(transport->master->fd, WSA_MAXIMUM_WAIT_EVENTS))) {
- TNET_PRINT_LAST_ERROR("listen have failed.");
- goto bail;
- }
- }
-
- /* Add the master socket to the context. */
- // don't take ownership: will be closed by the dctor() when refCount==0
- // otherwise will be closed twice: dctor() and removeSocket()
- if ((ret = addSocket(transport->master->fd, transport->master->type, transport, tsk_false, tsk_false, tsk_null))) {
- TSK_DEBUG_ERROR("Failed to add master socket");
- goto bail;
- }
-
- /* set events on master socket */
- if ((ret = WSAEventSelect(transport->master->fd, context->events[context->count - 1], FD_ALL_EVENTS) == SOCKET_ERROR)) {
- TNET_PRINT_LAST_ERROR("WSAEventSelect have failed.");
- goto bail;
- }
-
- transport->prepared = tsk_true;
+ int ret = -1;
+ transport_context_t *context;
+
+ if (!transport || !transport->context) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+ else {
+ context = transport->context;
+ }
+
+ if (transport->prepared) {
+ TSK_DEBUG_ERROR("Transport already prepared.");
+ return -2;
+ }
+
+ /* Prepare master */
+ if (!transport->master) {
+ if ((transport->master = tnet_socket_create(transport->local_host, transport->req_local_port, transport->type))) {
+ tsk_strupdate(&transport->local_ip, transport->master->ip);
+ transport->bind_local_port = transport->master->port;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create master socket");
+ return -3;
+ }
+ }
+
+ /* Start listening */
+ if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
+ if ((ret = tnet_sockfd_listen(transport->master->fd, WSA_MAXIMUM_WAIT_EVENTS))) {
+ TNET_PRINT_LAST_ERROR("listen have failed.");
+ goto bail;
+ }
+ }
+
+ /* Add the master socket to the context. */
+ // don't take ownership: will be closed by the dctor() when refCount==0
+ // otherwise will be closed twice: dctor() and removeSocket()
+ if ((ret = addSocket(transport->master->fd, transport->master->type, transport, tsk_false, tsk_false, tsk_null))) {
+ TSK_DEBUG_ERROR("Failed to add master socket");
+ goto bail;
+ }
+
+ /* set events on master socket */
+ if ((ret = WSAEventSelect(transport->master->fd, context->events[context->count - 1], FD_ALL_EVENTS) == SOCKET_ERROR)) {
+ TNET_PRINT_LAST_ERROR("WSAEventSelect have failed.");
+ goto bail;
+ }
+
+ transport->prepared = tsk_true;
bail:
- return ret;
+ return ret;
}
int tnet_transport_unprepare(tnet_transport_t *transport)
{
- int ret = -1;
- transport_context_t *context;
-
- if (!transport || !transport->context){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
- else{
- context = transport->context;
- }
-
- if (!transport->prepared){
- return 0;
- }
-
- transport->prepared = tsk_false;
-
- while (context->count){
- removeSocket(0, context); // safe
- }
- // destroy master as it has been close by removeSocket()
- TSK_OBJECT_SAFE_FREE(transport->master);
-
- return 0;
+ int ret = -1;
+ transport_context_t *context;
+
+ if (!transport || !transport->context) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+ else {
+ context = transport->context;
+ }
+
+ if (!transport->prepared) {
+ return 0;
+ }
+
+ transport->prepared = tsk_false;
+
+ while (context->count) {
+ removeSocket(0, context); // safe
+ }
+ // destroy master as it has been close by removeSocket()
+ TSK_OBJECT_SAFE_FREE(transport->master);
+
+ return 0;
}
/*=== Main thread */
void* TSK_STDCALL tnet_transport_mainthread(void *param)
{
- tnet_transport_t *transport = (tnet_transport_t*)param;
- transport_context_t *context = (transport_context_t*)transport->context;
- DWORD evt;
- WSANETWORKEVENTS networkEvents;
- DWORD flags = 0;
- int ret;
-
- struct sockaddr_storage remote_addr = { 0 };
- WSAEVENT active_event;
- transport_socket_xt* active_socket;
- int index;
-
- TSK_DEBUG_INFO("Starting [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
-
- while (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started) {
- /* Wait for multiple events */
- if ((evt = WSAWaitForMultipleEvents((DWORD)context->count, context->events, FALSE, WSA_INFINITE, FALSE)) == WSA_WAIT_FAILED) {
- TNET_PRINT_LAST_ERROR("WSAWaitForMultipleEvents have failed.");
- goto bail;
- }
-
- if (!TSK_RUNNABLE(transport)->running && !TSK_RUNNABLE(transport)->started) {
- goto bail;
- }
-
- /* lock context */
- tsk_safeobj_lock(context);
-
- /* Get active event and socket */
- index = (evt - WSA_WAIT_EVENT_0);
- active_event = context->events[index];
- if (!(active_socket = context->sockets[index])) {
- goto done;
- }
-
- /* Get the network events flags */
- if (WSAEnumNetworkEvents(active_socket->fd, active_event, &networkEvents) == SOCKET_ERROR) {
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
- TNET_PRINT_LAST_ERROR("WSAEnumNetworkEvents have failed.");
-
- tsk_safeobj_unlock(context);
- goto bail;
- }
-
- /*================== FD_ACCEPT ==================*/
- if (networkEvents.lNetworkEvents & FD_ACCEPT) {
- tnet_fd_t fd;
-
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_ACCEPT", transport->description);
-
- if (networkEvents.iErrorCode[FD_ACCEPT_BIT]) {
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
- TNET_PRINT_LAST_ERROR("ACCEPT FAILED.");
- goto done;
- }
-
- /* Accept the connection */
- if ((fd = (tnet_fd_t)WSAAccept(active_socket->fd, NULL, NULL, AcceptCondFunc, (DWORD_PTR)context)) != INVALID_SOCKET) {
- /* Add the new fd to the server context */
- addSocket(fd, transport->master->type, transport, tsk_true, tsk_false, tsk_null);
- if (active_socket->tlshandle) {
- transport_socket_xt* tls_socket;
- if ((tls_socket = getSocket(context, fd))) {
- if (tnet_tls_socket_accept(tls_socket->tlshandle)) {
- tnet_transport_remove_socket(transport, &fd);
- TNET_PRINT_LAST_ERROR("SSL_accept() failed");
- goto done;
- }
- }
- }
- if (WSAEventSelect(fd, context->events[context->count - 1], FD_READ | FD_WRITE | FD_CLOSE) == SOCKET_ERROR) {
- tnet_transport_remove_socket(transport, &fd);
- TNET_PRINT_LAST_ERROR("WSAEventSelect() have failed.");
- goto done;
- }
- TSK_RUNNABLE_ENQUEUE(transport, event_accepted, transport->callback_data, fd);
- }
- else {
- TNET_PRINT_LAST_ERROR("ACCEPT FAILED.");
- goto done;
- }
-
-
-
-
- }
-
- /*================== FD_CONNECT ==================*/
- if (networkEvents.lNetworkEvents & FD_CONNECT) {
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_CONNECT", transport->description);
-
- if (networkEvents.iErrorCode[FD_CONNECT_BIT]) {
- tnet_fd_t fd = active_socket->fd;
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
- tnet_transport_remove_socket(transport, &fd);
- TNET_PRINT_LAST_ERROR("CONNECT FAILED.");
- goto done;
- }
- else {
- TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, active_socket->fd);
- active_socket->connected = 1;
- }
- }
-
-
- /*================== FD_READ ==================*/
- if (networkEvents.lNetworkEvents & FD_READ) {
- DWORD readCount = 0;
- WSABUF wsaBuffer;
-
- /* TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_READ", transport->description); */
-
- /* check whether the socket is paused or not */
- if (active_socket->paused){
- TSK_DEBUG_INFO("Socket is paused");
- goto FD_READ_DONE;
- }
-
- if (networkEvents.iErrorCode[FD_READ_BIT]) {
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
- TNET_PRINT_LAST_ERROR("READ FAILED.");
- goto done;
- }
-
- /* Retrieve the amount of pending data */
- if (tnet_ioctlt(active_socket->fd, FIONREAD, &(wsaBuffer.len)) < 0) {
- TNET_PRINT_LAST_ERROR("IOCTLT FAILED.");
- goto done;
- }
-
- if (!wsaBuffer.len) {
- goto done;
- }
-
- /* Alloc data */
- if (!(wsaBuffer.buf = tsk_calloc(wsaBuffer.len, sizeof(uint8_t)))) {
- goto done;
- }
-
- /* Retrieve the remote address */
- if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
- ret = tnet_getpeername(active_socket->fd, &remote_addr);
- }
-
- /* Receive the waiting data. */
- if (active_socket->tlshandle) {
- int isEncrypted;
- tsk_size_t len = wsaBuffer.len;
- if (!(ret = tnet_tls_socket_recv(active_socket->tlshandle, &wsaBuffer.buf, &len, &isEncrypted))) {
- if (isEncrypted) {
- TSK_FREE(wsaBuffer.buf);
- goto done;
- }
- wsaBuffer.len = (ULONG)len;
- }
- }
- else {
- if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
- ret = WSARecv(active_socket->fd, &wsaBuffer, 1, &readCount, &flags, 0, 0);
- }
- else {
- int len = sizeof(remote_addr);
- ret = WSARecvFrom(active_socket->fd, &wsaBuffer, 1, &readCount, &flags,
- (struct sockaddr*)&remote_addr, &len, 0, 0);
- }
- if (readCount < wsaBuffer.len) {
- wsaBuffer.len = readCount;
- /* wsaBuffer.buf = tsk_realloc(wsaBuffer.buf, readCount); */
- }
- }
-
- if (ret) {
- ret = WSAGetLastError();
- if (ret == WSAEWOULDBLOCK) {
- // Doesn't (always) mean congestion but... another thread is also poll()ing the FD. For example, when TURN session has a reference to the fd.
- TSK_DEBUG_WARN("WSAEWOULDBLOCK error for READ SSESSION");
- }
- else if (ret == WSAECONNRESET && TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
- /* For DGRAM ==> The sent packet gernerated "ICMP Destination/Port unreachable" result. */
- TSK_FREE(wsaBuffer.buf);
- goto done; // ignore and retry.
- }
- else {
- TSK_FREE(wsaBuffer.buf);
-
- removeSocket(index, context);
- TNET_PRINT_LAST_ERROR("WSARecv have failed.");
- goto done;
- }
- }
- else
- {
- tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
+ tnet_transport_t *transport = (tnet_transport_t*)param;
+ transport_context_t *context = (transport_context_t*)transport->context;
+ DWORD evt;
+ WSANETWORKEVENTS networkEvents;
+ DWORD flags = 0;
+ int ret;
+
+ struct sockaddr_storage remote_addr = { 0 };
+ WSAEVENT active_event;
+ transport_socket_xt* active_socket;
+ int index;
+
+ TSK_DEBUG_INFO("Starting [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
+
+ while (TSK_RUNNABLE(transport)->running || TSK_RUNNABLE(transport)->started) {
+ /* Wait for multiple events */
+ if ((evt = WSAWaitForMultipleEvents((DWORD)context->count, context->events, FALSE, WSA_INFINITE, FALSE)) == WSA_WAIT_FAILED) {
+ TNET_PRINT_LAST_ERROR("WSAWaitForMultipleEvents have failed.");
+ goto bail;
+ }
+
+ if (!TSK_RUNNABLE(transport)->running && !TSK_RUNNABLE(transport)->started) {
+ goto bail;
+ }
+
+ /* lock context */
+ tsk_safeobj_lock(context);
+
+ /* Get active event and socket */
+ index = (evt - WSA_WAIT_EVENT_0);
+ active_event = context->events[index];
+ if (!(active_socket = context->sockets[index])) {
+ goto done;
+ }
+
+ /* Get the network events flags */
+ if (WSAEnumNetworkEvents(active_socket->fd, active_event, &networkEvents) == SOCKET_ERROR) {
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
+ TNET_PRINT_LAST_ERROR("WSAEnumNetworkEvents have failed.");
+
+ tsk_safeobj_unlock(context);
+ goto bail;
+ }
+
+ /*================== FD_ACCEPT ==================*/
+ if (networkEvents.lNetworkEvents & FD_ACCEPT) {
+ tnet_fd_t fd;
+
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_ACCEPT", transport->description);
+
+ if (networkEvents.iErrorCode[FD_ACCEPT_BIT]) {
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
+ TNET_PRINT_LAST_ERROR("ACCEPT FAILED.");
+ goto done;
+ }
+
+ /* Accept the connection */
+ if ((fd = (tnet_fd_t)WSAAccept(active_socket->fd, NULL, NULL, AcceptCondFunc, (DWORD_PTR)context)) != INVALID_SOCKET) {
+ /* Add the new fd to the server context */
+ addSocket(fd, transport->master->type, transport, tsk_true, tsk_false, tsk_null);
+ if (active_socket->tlshandle) {
+ transport_socket_xt* tls_socket;
+ if ((tls_socket = getSocket(context, fd))) {
+ if (tnet_tls_socket_accept(tls_socket->tlshandle)) {
+ tnet_transport_remove_socket(transport, &fd);
+ TNET_PRINT_LAST_ERROR("SSL_accept() failed");
+ goto done;
+ }
+ }
+ }
+ if (WSAEventSelect(fd, context->events[context->count - 1], FD_READ | FD_WRITE | FD_CLOSE) == SOCKET_ERROR) {
+ tnet_transport_remove_socket(transport, &fd);
+ TNET_PRINT_LAST_ERROR("WSAEventSelect() have failed.");
+ goto done;
+ }
+ TSK_RUNNABLE_ENQUEUE(transport, event_accepted, transport->callback_data, fd);
+ }
+ else {
+ TNET_PRINT_LAST_ERROR("ACCEPT FAILED.");
+ goto done;
+ }
+
+
+
+
+ }
+
+ /*================== FD_CONNECT ==================*/
+ if (networkEvents.lNetworkEvents & FD_CONNECT) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_CONNECT", transport->description);
+
+ if (networkEvents.iErrorCode[FD_CONNECT_BIT]) {
+ tnet_fd_t fd = active_socket->fd;
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, fd);
+ tnet_transport_remove_socket(transport, &fd);
+ TNET_PRINT_LAST_ERROR("CONNECT FAILED.");
+ goto done;
+ }
+ else {
+ TSK_RUNNABLE_ENQUEUE(transport, event_connected, transport->callback_data, active_socket->fd);
+ active_socket->connected = 1;
+ }
+ }
+
+
+ /*================== FD_READ ==================*/
+ if (networkEvents.lNetworkEvents & FD_READ) {
+ DWORD readCount = 0;
+ WSABUF wsaBuffer;
+
+ /* TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_READ", transport->description); */
+
+ /* check whether the socket is paused or not */
+ if (active_socket->paused) {
+ TSK_DEBUG_INFO("Socket is paused");
+ goto FD_READ_DONE;
+ }
+
+ if (networkEvents.iErrorCode[FD_READ_BIT]) {
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
+ TNET_PRINT_LAST_ERROR("READ FAILED.");
+ goto done;
+ }
+
+ /* Retrieve the amount of pending data */
+ if (tnet_ioctlt(active_socket->fd, FIONREAD, &(wsaBuffer.len)) < 0) {
+ TNET_PRINT_LAST_ERROR("IOCTLT FAILED.");
+ goto done;
+ }
+
+ if (!wsaBuffer.len) {
+ goto done;
+ }
+
+ /* Alloc data */
+ if (!(wsaBuffer.buf = tsk_calloc(wsaBuffer.len, sizeof(uint8_t)))) {
+ goto done;
+ }
+
+ /* Retrieve the remote address */
+ if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
+ ret = tnet_getpeername(active_socket->fd, &remote_addr);
+ }
+
+ /* Receive the waiting data. */
+ if (active_socket->tlshandle) {
+ int isEncrypted;
+ tsk_size_t len = wsaBuffer.len;
+ if (!(ret = tnet_tls_socket_recv(active_socket->tlshandle, &wsaBuffer.buf, &len, &isEncrypted))) {
+ if (isEncrypted) {
+ TSK_FREE(wsaBuffer.buf);
+ goto done;
+ }
+ wsaBuffer.len = (ULONG)len;
+ }
+ }
+ else {
+ if (TNET_SOCKET_TYPE_IS_STREAM(transport->master->type)) {
+ ret = WSARecv(active_socket->fd, &wsaBuffer, 1, &readCount, &flags, 0, 0);
+ }
+ else {
+ int len = sizeof(remote_addr);
+ ret = WSARecvFrom(active_socket->fd, &wsaBuffer, 1, &readCount, &flags,
+ (struct sockaddr*)&remote_addr, &len, 0, 0);
+ }
+ if (readCount < wsaBuffer.len) {
+ wsaBuffer.len = readCount;
+ /* wsaBuffer.buf = tsk_realloc(wsaBuffer.buf, readCount); */
+ }
+ }
+
+ if (ret) {
+ ret = WSAGetLastError();
+ if (ret == WSAEWOULDBLOCK) {
+ // Doesn't (always) mean congestion but... another thread is also poll()ing the FD. For example, when TURN session has a reference to the fd.
+ TSK_DEBUG_WARN("WSAEWOULDBLOCK error for READ SSESSION");
+ }
+ else if (ret == WSAECONNRESET && TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)) {
+ /* For DGRAM ==> The sent packet gernerated "ICMP Destination/Port unreachable" result. */
+ TSK_FREE(wsaBuffer.buf);
+ goto done; // ignore and retry.
+ }
+ else {
+ TSK_FREE(wsaBuffer.buf);
+
+ removeSocket(index, context);
+ TNET_PRINT_LAST_ERROR("WSARecv have failed.");
+ goto done;
+ }
+ }
+ else {
+ tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
transport->bytes_in += wsaBuffer.len;
- e->data = wsaBuffer.buf;
- e->size = wsaBuffer.len;
- e->remote_addr = remote_addr;
+ e->data = wsaBuffer.buf;
+ e->size = wsaBuffer.len;
+ e->remote_addr = remote_addr;
- TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
- }
- FD_READ_DONE:;
- }
+ TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
+ }
+FD_READ_DONE:
+ ;
+ }
- /*================== FD_WRITE ==================*/
- if (networkEvents.lNetworkEvents & FD_WRITE) {
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_WRITE", transport->description);
+ /*================== FD_WRITE ==================*/
+ if (networkEvents.lNetworkEvents & FD_WRITE) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_WRITE", transport->description);
- if (networkEvents.iErrorCode[FD_WRITE_BIT]) {
- TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
- TNET_PRINT_LAST_ERROR("WRITE FAILED.");
- goto done;
- }
- }
+ if (networkEvents.iErrorCode[FD_WRITE_BIT]) {
+ TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd);
+ TNET_PRINT_LAST_ERROR("WRITE FAILED.");
+ goto done;
+ }
+ }
- /*================== FD_CLOSE ==================*/
- if (networkEvents.lNetworkEvents & FD_CLOSE) {
- TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_CLOSE", transport->description);
+ /*================== FD_CLOSE ==================*/
+ if (networkEvents.lNetworkEvents & FD_CLOSE) {
+ TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- FD_CLOSE", transport->description);
- TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, active_socket->fd);
- removeSocket(index, context);
- }
+ TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, active_socket->fd);
+ removeSocket(index, context);
+ }
- /* http://msdn.microsoft.com/en-us/library/ms741690(VS.85).aspx
+ /* http://msdn.microsoft.com/en-us/library/ms741690(VS.85).aspx
- The proper way to reset the state of an event object used with the WSAEventSelect function
- is to pass the handle of the event object to the WSAEnumNetworkEvents function in the hEventObject parameter.
- This will reset the event object and adjust the status of active FD events on the socket in an atomic fashion.
- */
- /* WSAResetEvent(active_event); <== DO NOT USE (see above) */
+ The proper way to reset the state of an event object used with the WSAEventSelect function
+ is to pass the handle of the event object to the WSAEnumNetworkEvents function in the hEventObject parameter.
+ This will reset the event object and adjust the status of active FD events on the socket in an atomic fashion.
+ */
+ /* WSAResetEvent(active_event); <== DO NOT USE (see above) */
- done:
- /* unlock context */
- tsk_safeobj_unlock(context);
- } /* while(transport->running) */
+done:
+ /* unlock context */
+ tsk_safeobj_unlock(context);
+ } /* while(transport->running) */
bail:
- TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
- return tsk_null;
+ TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d} with type {%d}...", transport->description, transport->master->ip, transport->master->port, transport->master->type);
+ return tsk_null;
}
@@ -800,7 +796,7 @@ bail:
tsk_object_t* tnet_transport_context_create()
{
- return tsk_object_new(tnet_transport_context_def_t);
+ return tsk_object_new(tnet_transport_context_def_t);
}
@@ -809,31 +805,30 @@ tsk_object_t* tnet_transport_context_create()
//
static tsk_object_t* transport_context_ctor(tsk_object_t * self, va_list * app)
{
- transport_context_t *context = self;
- if (context){
- tsk_safeobj_init(context);
- }
- return self;
+ transport_context_t *context = self;
+ if (context) {
+ tsk_safeobj_init(context);
+ }
+ return self;
}
static tsk_object_t* transport_context_dtor(tsk_object_t * self)
{
- transport_context_t *context = self;
- if (context) {
- while (context->count) {
- removeSocket(0, context);
- }
- tsk_safeobj_deinit(context);
- }
- return self;
+ transport_context_t *context = self;
+ if (context) {
+ while (context->count) {
+ removeSocket(0, context);
+ }
+ tsk_safeobj_deinit(context);
+ }
+ return self;
}
-static const tsk_object_def_t tnet_transport_context_def_s =
-{
- sizeof(transport_context_t),
- transport_context_ctor,
- transport_context_dtor,
- tsk_null,
+static const tsk_object_def_t tnet_transport_context_def_s = {
+ sizeof(transport_context_t),
+ transport_context_ctor,
+ transport_context_dtor,
+ tsk_null,
};
const tsk_object_def_t *tnet_transport_context_def_t = &tnet_transport_context_def_s;
#endif /* TNET_UNDER_WINDOWS */
diff --git a/tinyNET/src/tnet_types.h b/tinyNET/src/tnet_types.h
index f4b55e2..6edd9cf 100755
--- a/tinyNET/src/tnet_types.h
+++ b/tinyNET/src/tnet_types.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -82,14 +82,13 @@ typedef void tnet_transport_handle_t;
typedef tsk_list_t tnet_interfaces_L_t; /**< List of @ref tnet_interface_t elements*/
typedef tsk_list_t tnet_addresses_L_t; /**< List of @ref tnet_address_t elements*/
-typedef enum tnet_dtls_setup_e
-{
- tnet_dtls_setup_none,
- tnet_dtls_setup_actpass,
- tnet_dtls_setup_active,
- tnet_dtls_setup_passive,
+typedef enum tnet_dtls_setup_e {
+ tnet_dtls_setup_none,
+ tnet_dtls_setup_actpass,
+ tnet_dtls_setup_active,
+ tnet_dtls_setup_passive,
- TNET_DTLS_SETUP_MAX
+ TNET_DTLS_SETUP_MAX
}
tnet_dtls_setup_t;
@@ -103,27 +102,24 @@ typedef enum tnet_proxy_type_e {
}
tnet_proxy_type_t;
-static const char* TNET_DTLS_SETUP_NAMES[TNET_DTLS_SETUP_MAX] =
-{
- "UNKNOWN", "actpass", "active", "passive"
+static const char* TNET_DTLS_SETUP_NAMES[TNET_DTLS_SETUP_MAX] = {
+ "UNKNOWN", "actpass", "active", "passive"
};
-typedef enum tnet_dtls_hash_type_e
-{
- tnet_dtls_hash_type_none,
- tnet_dtls_hash_type_md5,
- tnet_dtls_hash_type_sha1,
- tnet_dtls_hash_type_sha256,
- tnet_dtls_hash_type_sha512,
+typedef enum tnet_dtls_hash_type_e {
+ tnet_dtls_hash_type_none,
+ tnet_dtls_hash_type_md5,
+ tnet_dtls_hash_type_sha1,
+ tnet_dtls_hash_type_sha256,
+ tnet_dtls_hash_type_sha512,
- TNET_DTLS_HASH_TYPE_MAX
+ TNET_DTLS_HASH_TYPE_MAX
}
tnet_dtls_hash_type_t;
// Hash names are case-insensitive but use lower case values because of https://bugzilla.mozilla.org/show_bug.cgi?id=828027
-static const char* TNET_DTLS_HASH_NAMES[TNET_DTLS_HASH_TYPE_MAX] =
-{
- "UNKNOWN", "md5", "sha-1", "sha-256", "sha-512"
+static const char* TNET_DTLS_HASH_NAMES[TNET_DTLS_HASH_TYPE_MAX] = {
+ "UNKNOWN", "md5", "sha-1", "sha-256", "sha-512"
};
#if TNET_UNDER_WINDOWS
@@ -139,22 +135,20 @@ static const char* TNET_DTLS_HASH_NAMES[TNET_DTLS_HASH_TYPE_MAX] =
# if !defined (WC_ERR_INVALID_CHARS)
# define WC_ERR_INVALID_CHARS 0
# endif
- static TNET_INLINE const char* tnet_gai_strerror(int ecode)
- {
- static char aBuff[1024] = {0};
-
- WCHAR *wBuff = gai_strerrorW(ecode);
- int len;
- if((len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), aBuff, sizeof(aBuff) - 1, NULL, NULL)) > 0)
- {
- aBuff[len] = '\0';
- }
- else
- {
- aBuff[0] = '\0';
- }
- return aBuff;
- }
+static TNET_INLINE const char* tnet_gai_strerror(int ecode)
+{
+ static char aBuff[1024] = {0};
+
+ WCHAR *wBuff = gai_strerrorW(ecode);
+ int len;
+ if((len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), aBuff, sizeof(aBuff) - 1, NULL, NULL)) > 0) {
+ aBuff[len] = '\0';
+ }
+ else {
+ aBuff[0] = '\0';
+ }
+ return aBuff;
+}
# else
# define tnet_gai_strerror gai_strerrorA
# endif
diff --git a/tinyNET/src/tnet_utils.c b/tinyNET/src/tnet_utils.c
index 64b1ea8..d01facd 100755
--- a/tinyNET/src/tnet_utils.c
+++ b/tinyNET/src/tnet_utils.c
@@ -117,18 +117,18 @@ void tnet_getlasterror(tnet_error_t *error)
{
int err = tnet_geterrno();
memset(*error, 0, sizeof(*error));
-
+
#if TNET_UNDER_WINDOWS_RT
// FormatMessageA Not allowed on Market
static WCHAR wBuff[1024] = { 0 };
FormatMessageW(
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- err,
- 0,
- wBuff,
- sizeof(wBuff)-1,
- tsk_null);
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ err,
+ 0,
+ wBuff,
+ sizeof(wBuff)-1,
+ tsk_null);
WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), *error, sizeof(*error) - 1, NULL, NULL);
#elif TNET_UNDER_WINDOWS
{
@@ -138,13 +138,13 @@ void tnet_getlasterror(tnet_error_t *error)
FormatMessageA
#endif
(
- FORMAT_MESSAGE_FROM_SYSTEM,
- tsk_null,
- err,
- 0,
- *error,
- sizeof(*error) - 1,
- tsk_null);
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ tsk_null,
+ err,
+ 0,
+ *error,
+ sizeof(*error) - 1,
+ tsk_null);
}
#else
strerror_r(err, *error, sizeof(*error));
@@ -175,7 +175,7 @@ int tnet_geterrno()
tnet_interfaces_L_t* tnet_get_interfaces()
{
tnet_interfaces_L_t * ifaces = tsk_list_create();
-
+
#if TNET_UNDER_WINDOWS/*=== WINDOWS XP/VISTA/7/CE===*/
#if TNET_UNDER_WINDOWS_RT
TSK_DEBUG_ERROR("Not implemented on your OS");
@@ -183,101 +183,95 @@ tnet_interfaces_L_t* tnet_get_interfaces()
#else /* !TNET_UNDER_WINDOWS_RT */
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
-
+
PIP_ADAPTER_INFO pAdapterInfo = NULL;
PIP_ADAPTER_INFO pAdapter = NULL;
DWORD dwRetVal = 0;
-
+
ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO);
pAdapterInfo = (IP_ADAPTER_INFO *)MALLOC(sizeof(IP_ADAPTER_INFO));
- if (pAdapterInfo == NULL)
- {
+ if (pAdapterInfo == NULL) {
TSK_DEBUG_ERROR("Error allocating memory needed to call GetAdaptersinfo.");
goto bail;
}
// Make an initial call to GetAdaptersInfo to get the necessary size into the ulOutBufLen variable
- if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW)
- {
+ if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) {
FREE(pAdapterInfo);
pAdapterInfo = (IP_ADAPTER_INFO *)MALLOC(ulOutBufLen);
- if (pAdapterInfo == NULL)
- {
+ if (pAdapterInfo == NULL) {
TSK_DEBUG_ERROR("Error allocating memory needed to call GetAdaptersinfo.");
goto bail;
}
}
-
- if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == NO_ERROR)
- {
+
+ if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == NO_ERROR) {
pAdapter = pAdapterInfo;
- while (pAdapter)
- {
+ while (pAdapter) {
tnet_interface_t *iface;
-
- if (pAdapter->Type == MIB_IF_TYPE_LOOPBACK){
+
+ if (pAdapter->Type == MIB_IF_TYPE_LOOPBACK) {
continue;
}
-
+
iface = tnet_interface_create(pAdapter->Description, pAdapter->Address, pAdapter->AddressLength);
iface->index = pAdapter->Index;
tsk_list_push_back_data(ifaces, &(iface));
-
+
pAdapter = pAdapter->Next;
}
}
-
- if (pAdapterInfo)
- {
+
+ if (pAdapterInfo) {
FREE(pAdapterInfo);
}
-
-
+
+
#undef MALLOC
#undef FREE
#endif /* !TNET_UNDER_WINDOWS_RT */
-
+
#elif HAVE_IFADDRS_H && HAVE_GETIFADDRS /*=== Using getifaddrs ===*/
-
+
// see http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html
struct ifaddrs *ifaddr = tsk_null, *ifa = tsk_null;
-
+
/* Get interfaces */
- if(getifaddrs(&ifaddr) == -1){
+ if(getifaddrs(&ifaddr) == -1) {
TSK_DEBUG_ERROR("getifaddrs failed and errno= [%d]", tnet_geterrno());
goto bail;
}
-
- for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
+
+ for(ifa = ifaddr; ifa; ifa = ifa->ifa_next) {
if((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
continue;
}
-
- if(ifa->ifa_addr->sa_family != AF_LINK){
+
+ if(ifa->ifa_addr->sa_family != AF_LINK) {
continue;
}
-
+
#if defined(__linux__) && 0 /* FIXME */
{
struct ifreq ifr;
tnet_fd_t fd = TNET_INVALID_FD;
-
- if((fd = socket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP)) < 0){
+
+ if((fd = socket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno());
goto next;
}
-
+
ifr.ifr_addr.sa_family = ifa->ifa_addr->sa_family;
strcpy(ifr.ifr_name, ifa.ifa_name);
- if(tnet_ioctl(fd, SIOCGIFHWADDR, &ifr)<0){
+ if(tnet_ioctl(fd, SIOCGIFHWADDR, &ifr)<0) {
TSK_DEBUG_ERROR("tnet_ioctl(SIOCGIFHWADDR)", tnet_geterrno());
goto next;
}
- else{
+ else {
//sockaddr_dl* sdl = (struct sockaddr_dl *)ifa->ifa_addr;
tnet_interface_t *iface = tnet_interface_create(ifr->ifr_name, ifr->ifr_hwaddr.sa_data, 6);
tsk_list_push_back_data(ifaces, (void**)&(iface));
}
- next:
+next:
tnet_sockfd_close(&fd);
}
#else
@@ -288,66 +282,65 @@ tnet_interfaces_L_t* tnet_get_interfaces()
tsk_list_push_back_data(ifaces, (void**)&(iface));
}
#endif
-
+
}/* for */
-
+
freeifaddrs(ifaddr);
-
+
#else /*=== ANDROID,... --> Using SIOCGIFCONF and SIOCGIFHWADDR ===*/
-
+
tnet_fd_t fd = TNET_INVALID_FD;
char buffer[1024];
struct ifconf ifc;
-
+
struct sockaddr_in *sin;
struct ifreq *ifr;
-
- if((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0){
+
+ if((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno());
goto done;
}
-
+
ifc.ifc_len = sizeof(buffer);
ifc.ifc_buf = buffer;
-
- if(ioctl(fd, SIOCGIFCONF, &ifc) < 0){
+
+ if(ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
TSK_DEBUG_ERROR("ioctl(SIOCGIFCONF) failed and errno= [%d]", tnet_geterrno());
goto done;
}
- if(!ifr || !ifc.ifc_req){
+ if(!ifr || !ifc.ifc_req) {
TSK_DEBUG_ERROR("ifr or ifc.ifc_req is null");
goto done;
}
-
- if(!ifr->ifr_name){
+
+ if(!ifr->ifr_name) {
TSK_DEBUG_ERROR("ifr->ifr_name is null");
goto done;
}
-
- for(ifr = ifc.ifc_req; ifr && !tsk_strempty(ifr->ifr_name); ifr++){
+
+ for(ifr = ifc.ifc_req; ifr && !tsk_strempty(ifr->ifr_name); ifr++) {
sin = (struct sockaddr_in *)&(ifr->ifr_addr);
// TODO: IPAddress if needed
- if(/*ioctl(fd, SIOCGIFFLAGS, &ifr) == 0*/1){
- if (!(ifr->ifr_flags & IFF_LOOPBACK) && (ifr->ifr_flags & IFF_UP)){
- if(/*ioctl(fd, SIOCGIFHWADDR, &ifr) == 0*/1){
+ if(/*ioctl(fd, SIOCGIFFLAGS, &ifr) == 0*/1) {
+ if (!(ifr->ifr_flags & IFF_LOOPBACK) && (ifr->ifr_flags & IFF_UP)) {
+ if(/*ioctl(fd, SIOCGIFHWADDR, &ifr) == 0*/1) {
tnet_interface_t *iface = tnet_interface_create(ifr->ifr_name, ifr->ifr_hwaddr.sa_data, 6);
tsk_list_push_back_data(ifaces, (void**)&(iface));
//iface->index = if_nametoindex(ifr->ifr_name);
}
}
}
- else
- {
+ else {
TSK_DEBUG_ERROR("ioctl(SIOCGIFFLAGS) failed and errno= [%d]", tnet_geterrno());
}
}
-
+
done:
tnet_sockfd_close(&fd);
-
-
+
+
#endif
-
+
bail:
return ifaces;
}
@@ -366,69 +359,71 @@ bail:
tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast, tsk_bool_t anycast, tsk_bool_t multicast, tsk_bool_t dnsserver, long if_index)
{
tnet_addresses_L_t *addresses = tsk_list_create();
-
+
#if TNET_UNDER_WINDOWS
#if TNET_UNDER_WINDOWS_RT
TSK_DEBUG_ERROR("Not implemented on your OS");
#else /* !TSK_UNDER_WINDOWS_RT */
-
+
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
-
+
/* Declare and initialize variables */
tnet_ip_t ip;
DWORD dwSize = 0;
DWORD dwRetVal = 0;
-
+
int i = 0;
-
+
// Set the flags to pass to GetAdaptersAddresses
ULONG flags = GAA_FLAG_INCLUDE_PREFIX;
-
+
LPVOID lpMsgBuf = NULL;
-
+
PIP_ADAPTER_ADDRESSES pAddresses = NULL;
ULONG outBufLen = 0;
-
+
PIP_ADAPTER_ADDRESSES pCurrAddresses = NULL;
PIP_ADAPTER_UNICAST_ADDRESS pUnicast = NULL;
PIP_ADAPTER_ANYCAST_ADDRESS pAnycast = NULL;
PIP_ADAPTER_MULTICAST_ADDRESS pMulticast = NULL;
IP_ADAPTER_DNS_SERVER_ADDRESS *pDnServer = NULL;
IP_ADAPTER_PREFIX *pPrefix = NULL;
-
-
+
+
outBufLen = sizeof(IP_ADAPTER_ADDRESSES);
pAddresses = (IP_ADAPTER_ADDRESSES *)MALLOC(outBufLen);
-
+
// Make an initial call to GetAdaptersAddresses to get the
// size needed into the outBufLen variable
- if (GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen) == ERROR_BUFFER_OVERFLOW){
+ if (GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen) == ERROR_BUFFER_OVERFLOW) {
FREE(pAddresses);
pAddresses = (IP_ADAPTER_ADDRESSES *)MALLOC(outBufLen);
}
- else goto bail;
-
- if (pAddresses == NULL){
+ else {
+ goto bail;
+ }
+
+ if (pAddresses == NULL) {
TSK_DEBUG_ERROR("Memory allocation failed for IP_ADAPTER_ADDRESSES struct.");
goto bail;
}
-
+
dwRetVal = GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen);
-
+
if (dwRetVal == NO_ERROR) {
pCurrAddresses = pAddresses;
- while (pCurrAddresses){
- if ((if_index != -1) && (pCurrAddresses->IfIndex != if_index && pCurrAddresses->Ipv6IfIndex != if_index)){
+ while (pCurrAddresses) {
+ if ((if_index != -1) && (pCurrAddresses->IfIndex != if_index && pCurrAddresses->Ipv6IfIndex != if_index)) {
goto next;
}
- if (pCurrAddresses->OperStatus != IfOperStatusUp){
+ if (pCurrAddresses->OperStatus != IfOperStatusUp) {
goto next;
}
-
+
/* == UNICAST addresses == */
pUnicast = pCurrAddresses->FirstUnicastAddress;
- while (unicast && pUnicast){
+ while (unicast && pUnicast) {
//memset(ip, '\0', sizeof(ip));
tnet_get_sockip(pUnicast->Address.lpSockaddr, &ip);
TSK_DEBUG_INFO("Found local IP address = AdapterName=%s Ip=%s", pCurrAddresses->AdapterName, ip);
@@ -438,13 +433,13 @@ tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast,
address->unicast = 1;
tsk_list_push_ascending_data(addresses, &address);
}
-
+
pUnicast = pUnicast->Next;
}
-
+
/* == ANYCAST addresses == */
pAnycast = pCurrAddresses->FirstAnycastAddress;
- while (anycast && pAnycast){
+ while (anycast && pAnycast) {
//memset(ip, '\0', sizeof(ip));
tnet_get_sockip(pAnycast->Address.lpSockaddr, &ip);
{
@@ -453,13 +448,13 @@ tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast,
address->anycast = 1;
tsk_list_push_ascending_data(addresses, &address);
}
-
+
pAnycast = pAnycast->Next;
}
-
+
/* == MULTYCAST addresses == */
pMulticast = pCurrAddresses->FirstMulticastAddress;
- while (multicast && pMulticast){
+ while (multicast && pMulticast) {
//memset(ip, '\0', sizeof(ip));
tnet_get_sockip(pMulticast->Address.lpSockaddr, &ip);
{
@@ -468,69 +463,69 @@ tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast,
address->multicast = 1;
tsk_list_push_ascending_data(addresses, &address);
}
-
+
pMulticast = pMulticast->Next;
}
-
+
/* == DNS servers == */
pDnServer = pCurrAddresses->FirstDnsServerAddress;
- while (dnsserver && pDnServer){
+ while (dnsserver && pDnServer) {
//memset(ip, '\0', sizeof(ip));
- if (!tnet_get_sockip(pDnServer->Address.lpSockaddr, &ip)){
+ if (!tnet_get_sockip(pDnServer->Address.lpSockaddr, &ip)) {
tnet_address_t *address = tnet_address_create(ip);
address->family = pDnServer->Address.lpSockaddr->sa_family;
address->dnsserver = 1;
tsk_list_push_ascending_data(addresses, &address);
}
-
+
pDnServer = pDnServer->Next;
}
- next:
+next:
pCurrAddresses = pCurrAddresses->Next;
}
}
-
- if (pAddresses){
+
+ if (pAddresses) {
FREE(pAddresses);
}
-
+
#undef MALLOC
#undef FREE
-
- bail :
-
+
+bail :
+
#endif /* !TSK_UNDER_WINDOWS_RT */
-
+
#else /* !TSK_UNDER_WINDOWS (MAC OS X, UNIX, ANDROID ...) */
-
+
tnet_ip_t ip;
#if HAVE_IFADDRS_H && HAVE_GETIFADDRS /*=== Using getifaddrs ===*/
-
+
// see http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html
struct ifaddrs *ifaddr = tsk_null, *ifa = tsk_null;
struct sockaddr *addr;
-
+
/* Get interfaces */
- if(getifaddrs(&ifaddr) == -1){
+ if(getifaddrs(&ifaddr) == -1) {
TSK_DEBUG_ERROR("getifaddrs failed and errno= [%d]", tnet_geterrno());
goto bail;
}
-
+
/* == Unicast addresses == */
- for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
- if(!ifa->ifa_addr){
+ for(ifa = ifaddr; ifa; ifa = ifa->ifa_next) {
+ if(!ifa->ifa_addr) {
continue;
}
// Skip loopback
if ((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
continue;
}
-
+
// Skip unwanted interface
if (if_index != -1 && if_nametoindex(ifa->ifa_name) != if_index) {
continue;
}
-
+
// Only deal with Unicast address
if (unicast) {
if (family == AF_INET && ifa->ifa_addr->sa_family != AF_INET) {
@@ -542,11 +537,11 @@ tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast,
if (ifa->ifa_addr->sa_family != AF_INET && ifa->ifa_addr->sa_family != AF_INET6) {
continue;
}
-
+
// Get the IP string
addr = (struct sockaddr *) ifa->ifa_addr;
tnet_get_sockip(addr, &ip);
-
+
// Push a new address
tnet_address_t *address = tnet_address_create(ip);
address->family = ifa->ifa_addr->sa_family;
@@ -554,81 +549,81 @@ tnet_addresses_L_t* tnet_get_addresses(tnet_family_t family, tsk_bool_t unicast,
tsk_list_push_ascending_data(addresses, (void **) &address);
}
}
-
+
if (ifaddr) {
free(ifaddr);
}
-
+
#else /* ANDROID or any system without getifaddrs */
-
+
tnet_address_t *address;
tnet_fd_t fd = TNET_INVALID_FD;
struct ifconf ifc;
struct ifreq *ifr = 0;
memset(&ifc, 0, sizeof(ifc));
-
- if((fd = socket(family, SOCK_DGRAM, IPPROTO_UDP)) < 0){
+
+ if((fd = socket(family, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno());
goto done;
}
-
- if(ioctl(fd, SIOCGIFCONF, &ifc) < 0){
+
+ if(ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
TSK_DEBUG_ERROR("ioctl(SIOCGIFCONF) failed and errno= [%d]", tnet_geterrno());
goto done;
}
-
+
if (!(ifr = (struct ifreq*) malloc(ifc.ifc_len))) {
TSK_DEBUG_ERROR("Could not malloc ifreq with size =%d", ifc.ifc_len);
goto done;
}
-
+
ifc.ifc_ifcu.ifcu_req = ifr;
if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
TSK_DEBUG_ERROR("ioctl SIOCGIFCONF failed");
goto done;
}
-
+
int i;
- for(i = 0; i < ifc.ifc_len / sizeof(struct ifreq); ++i){
+ for(i = 0; i < ifc.ifc_len / sizeof(struct ifreq); ++i) {
if (unicast) {
-
+
}
// Skip unwanted interface
if (if_index != -1 && ifr->ifr_ifindex != if_index) {
continue;
}
-
+
// Get the IP string
- if(tnet_get_sockip(&ifr[i].ifr_addr, &ip) == 0){
+ if(tnet_get_sockip(&ifr[i].ifr_addr, &ip) == 0) {
// Push a new address
- if((address = tnet_address_create(ip))){
+ if((address = tnet_address_create(ip))) {
address->family = family;
address->unicast = unicast;
tsk_list_push_ascending_data(addresses, (void **) &address);
}
}
}
-
+
done:
TSK_FREE(ifr);
tnet_sockfd_close(&fd);
-
+
#endif /* HAVE_IFADDRS_H && HAVE_GETIFADDRS */
-
+
bail:
-
+
/* == DNS servers == */
- if(dnsserver){
+ if(dnsserver) {
TSK_DEBUG_INFO("Calling 'tnet_dns_resolvconf_parse()' to load DNS servers");
tnet_addresses_L_t * dns_servers;
- if((dns_servers = tnet_dns_resolvconf_parse("/etc/resolv.conf"))){
+ if((dns_servers = tnet_dns_resolvconf_parse("/etc/resolv.conf"))) {
tsk_list_pushback_list(addresses, dns_servers);
TSK_OBJECT_SAFE_FREE(dns_servers);
}
}
-
+
#endif
-
+
return addresses;
}
@@ -637,39 +632,39 @@ bail:
*/
int tnet_get_mac_address(tnet_mac_address* address)
{
- static const tsk_size_t __tnet_mac_address_len = sizeof(tnet_mac_address) / sizeof(uint8_t/*tnet_mac_address[0]*/);
- int ret = -1;
- if (!address) {
- TSK_DEBUG_ERROR("Invalid parameter");
- }
+ static const tsk_size_t __tnet_mac_address_len = sizeof(tnet_mac_address) / sizeof(uint8_t/*tnet_mac_address[0]*/);
+ int ret = -1;
+ if (!address) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
#if TNET_UNDER_WINDOWS
# if TNET_UNDER_WINDOWS_RT
- TSK_DEBUG_ERROR("Not implemented on your OS");
+ TSK_DEBUG_ERROR("Not implemented on your OS");
# else /* !TSK_UNDER_WINDOWS_RT */
- {
- IP_ADAPTER_INFO *info = NULL, *pos;
- DWORD size = 0;
- ULONG _ret;
-
- if ((_ret = GetAdaptersInfo(info, &size)) == ERROR_SUCCESS || _ret == ERROR_BUFFER_OVERFLOW) {
- info = (IP_ADAPTER_INFO *)tsk_calloc(size + 1, 1);
- if (info) {
- if ((_ret = GetAdaptersInfo(info, &size)) == ERROR_SUCCESS) {
- UINT i;
- for (pos = info; pos != NULL && ret != 0; pos = pos->Next) {
- if (pos->Type == MIB_IF_TYPE_LOOPBACK && pos->Next) { // skip loopback if we still have items to check
- continue;
- }
- for (i = 0; i < pos->AddressLength && i < __tnet_mac_address_len; ++i) {
- (*address)[i] = pos->Address[i];
- }
- ret = 0;
- }
- }
- }
- TSK_FREE(info);
- }
- }
+ {
+ IP_ADAPTER_INFO *info = NULL, *pos;
+ DWORD size = 0;
+ ULONG _ret;
+
+ if ((_ret = GetAdaptersInfo(info, &size)) == ERROR_SUCCESS || _ret == ERROR_BUFFER_OVERFLOW) {
+ info = (IP_ADAPTER_INFO *)tsk_calloc(size + 1, 1);
+ if (info) {
+ if ((_ret = GetAdaptersInfo(info, &size)) == ERROR_SUCCESS) {
+ UINT i;
+ for (pos = info; pos != NULL && ret != 0; pos = pos->Next) {
+ if (pos->Type == MIB_IF_TYPE_LOOPBACK && pos->Next) { // skip loopback if we still have items to check
+ continue;
+ }
+ for (i = 0; i < pos->AddressLength && i < __tnet_mac_address_len; ++i) {
+ (*address)[i] = pos->Address[i];
+ }
+ ret = 0;
+ }
+ }
+ }
+ TSK_FREE(info);
+ }
+ }
# endif /* TSK_UNDER_WINDOWS_RT */
#elif HAVE_IFADDRS_H && HAVE_GETIFADDRS && HAVE_STRUCT_SOCKADDR_DL
struct ifaddrs *ifaddrs, *ifaddr;
@@ -696,13 +691,13 @@ int tnet_get_mac_address(tnet_mac_address* address)
struct ifreq ifr;
struct ifconf ifc;
char buf[1024];
-
+
tnet_fd_t fd = tnet_soccket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (fd == TNET_INVALID_FD) {
TSK_DEBUG_ERROR("Failed to create socket");
return -1;
}
-
+
ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;
if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {
@@ -710,10 +705,10 @@ int tnet_get_mac_address(tnet_mac_address* address)
tnet_sockfd_close(&fd);
return -1;
}
-
+
struct ifreq* it = ifc.ifc_req;
const struct ifreq* const end = it + (ifc.ifc_len / sizeof(struct ifreq));
-
+
for (; it != end; ++it) {
strcpy(ifr.ifr_name, it->ifr_name);
if (ioctl(fd, SIOCGIFFLAGS, &ifr) == 0) {
@@ -732,7 +727,7 @@ int tnet_get_mac_address(tnet_mac_address* address)
}
#endif
- return ret;
+ return ret;
}
/**@ingroup tnet_utils_group
@@ -747,82 +742,76 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
{
int ret = -1;
struct sockaddr_storage destAddr;
-
+
#if TNET_UNDER_WINDOWS
long dwBestIfIndex = -1;
#endif
#if TNET_UNDER_WINDOWS_RT
Windows::Networking::Connectivity::ConnectionProfile^ profile;
#endif
-
- if (!destination || !source){
+
+ if (!destination || !source) {
TSK_DEBUG_ERROR("Invalid parameter");
goto bail;
}
-
+
memset(*source, '\0', sizeof(*source));
-
+
// special cases for Windows Phone device and emulator
#if TNET_UNDER_WINDOWS_PHONE
- if (tsk_strequals(destination, "127.0.0.1")){
+ if (tsk_strequals(destination, "127.0.0.1")) {
memcpy(*source, "127.0.0.1", 9);
- ret = 0; goto bail;
+ ret = 0;
+ goto bail;
}
- if(tsk_strequals(destination, "::1")){
+ if(tsk_strequals(destination, "::1")) {
memcpy(*source, "::1", 3);
- ret = 0; goto bail;
+ ret = 0;
+ goto bail;
}
#endif
-
- if((ret = tnet_sockaddr_init(destination, port, type, &destAddr))){
+
+ if((ret = tnet_sockaddr_init(destination, port, type, &destAddr))) {
goto bail;
}
-
+
#if TNET_UNDER_WINDOWS_RT /* Windows Phone 8, Surface or any RT */
profile = Windows::Networking::Connectivity::NetworkInformation::GetInternetConnectionProfile();
-
- if (profile != nullptr && profile->NetworkAdapter != nullptr){
+
+ if (profile != nullptr && profile->NetworkAdapter != nullptr) {
TSK_DEBUG_INFO("Network profile IanaInterfaceType = %d", profile->NetworkAdapter->IanaInterfaceType);
Windows::Foundation::Collections::IVectorView<Windows::Networking::HostName^>^ HostNames = Windows::Networking::Connectivity::NetworkInformation::GetHostNames();
-
- if(HostNames->Size > 0)
- {
+
+ if(HostNames->Size > 0) {
Windows::Foundation::Collections::IIterator<Windows::Networking::HostName^>^ HostName = HostNames->First();
- do
- {
+ do {
std::vector<char> CanonicalName = rt_tsk_str_to_native(HostName->Current->CanonicalName);
TSK_DEBUG_INFO("Checking IP address = %s", CanonicalName.data());
- if((TNET_SOCKET_TYPE_IS_IPV4(type) && HostName->Current->IPInformation->PrefixLength->Value > 32) || (TNET_SOCKET_TYPE_IS_IPV6(type) && HostName->Current->IPInformation->PrefixLength->Value > 128))
- {
+ if((TNET_SOCKET_TYPE_IS_IPV4(type) && HostName->Current->IPInformation->PrefixLength->Value > 32) || (TNET_SOCKET_TYPE_IS_IPV6(type) && HostName->Current->IPInformation->PrefixLength->Value > 128)) {
TSK_DEBUG_INFO("Type mismatch - Skiping IP address=%s, IanaInterfaceType=%d, PrefixLength=%d", CanonicalName.data(), HostName->Current->IPInformation->NetworkAdapter->IanaInterfaceType, HostName->Current->IPInformation->PrefixLength->Value);
continue;
}
-
-
- if(HostName->Current->IPInformation != nullptr)
- {
+
+
+ if(HostName->Current->IPInformation != nullptr) {
// http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.networkadapterid.aspx
// HostName->Current->IPInformation->NetworkAdapter->NetworkAdapterId not implemented on WP8
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
tnet_socket_t* ss = tnet_socket_create(CanonicalName.data(), TNET_SOCKET_PORT_ANY, type);
- if(ss)
- {
+ if(ss) {
ret = connect(ss->fd, (const sockaddr*)&destAddr, tnet_get_sockaddr_size((const sockaddr*)&destAddr));
- if(ret && tnet_geterrno() == TNET_ERROR_EAGAIN)
- {
+ if(ret && tnet_geterrno() == TNET_ERROR_EAGAIN) {
ret = tnet_sockfd_waitUntilWritable(ss->fd, 500);
}
TSK_OBJECT_SAFE_FREE(ss);
}
# else
- if(HostName->Current->IPInformation->NetworkAdapter->IanaInterfaceType == profile->NetworkAdapter->IanaInterfaceType)
- {
+ if(HostName->Current->IPInformation->NetworkAdapter->IanaInterfaceType == profile->NetworkAdapter->IanaInterfaceType) {
ret = 0;
}
#endif /* */
-
- if(ret == 0)
- {
+
+ if(ret == 0) {
TSK_DEBUG_INFO("Using best IP address = %s :)", CanonicalName.data());
memcpy(*source, CanonicalName.data(), TSK_MIN(tsk_strlen(CanonicalName.data()), sizeof(*source)));
ret = 0;
@@ -834,30 +823,29 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
while(HostName->MoveNext());
}
}
- else
- {
+ else {
TSK_DEBUG_ERROR("No network connection available");
}
-
+
#elif TNET_UNDER_WINDOWS /* Windows XP/Vista/7 and Windows Mobile */
- if(GetBestInterfaceEx((struct sockaddr*)&destAddr, &dwBestIfIndex) != NO_ERROR){
+ if(GetBestInterfaceEx((struct sockaddr*)&destAddr, &dwBestIfIndex) != NO_ERROR) {
ret = tnet_geterrno();
TNET_PRINT_LAST_ERROR("GetBestInterfaceEx() failed.");
goto bail;
}
- else{
+ else {
tnet_addresses_L_t* addresses = tsk_null;
const tsk_list_item_t* item;
-
- if (!(addresses = tnet_get_addresses(TNET_SOCKET_TYPE_IS_IPV6(type) ? AF_INET6 : AF_INET, tsk_true, tsk_false, tsk_false, tsk_false, dwBestIfIndex))){
+
+ if (!(addresses = tnet_get_addresses(TNET_SOCKET_TYPE_IS_IPV6(type) ? AF_INET6 : AF_INET, tsk_true, tsk_false, tsk_false, tsk_false, dwBestIfIndex))) {
ret = -2;
TSK_DEBUG_ERROR("Failed to retrieve addresses.");
goto bail;
}
-
- tsk_list_foreach(item, addresses){
+
+ tsk_list_foreach(item, addresses) {
const tnet_address_t* address = item->data;
- if (address && address->ip){
+ if (address && address->ip) {
memcpy(*source, address->ip, tsk_strlen(address->ip) > sizeof(*source) ? sizeof(*source) : tsk_strlen(address->ip));
ret = 0;
break; // First is good for us.
@@ -867,9 +855,9 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
}
#elif HAVE_NET_ROUTE_H && HAVE_IFADDRS_H && HAVE_GETIFADDRS /* Mac OS X, iPhone, iPod Touch, iPad and Linux family except Android */
/* Thanks to Laurent Etiemble */
-
+
int sdl_index = -1;
-
+
#if HAVE_STRUCT_RT_METRICS && HAVE_STRUCT_SOCKADDR_DL
static int seq = 1234;
char buf[1024];
@@ -882,20 +870,20 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
struct rt_msghdr *rtm = (struct rt_msghdr *)buf;
struct sockaddr_dl so_ifp;
#endif /* HAVE_STRUCT_RT_METRICS && HAVE_STRUCT_SOCKADDR_DL */
-
+
struct sockaddr_storage so_dst = destAddr;
struct sockaddr *sa = NULL;
struct ifaddrs *ifaddr = 0, *ifa = tsk_null;
tnet_ip_t ip;
-
+
#if HAVE_STRUCT_RT_METRICS && HAVE_STRUCT_SOCKADDR_DL
bzero(rtm, 1024);
cp = (char *)(rtm + 1);
-
+
so_ifp.sdl_index = 0;
so_ifp.sdl_family = AF_LINK;
so_ifp.sdl_len = sizeof(struct sockaddr_dl);
-
+
rtm->rtm_type = RTM_GET;
rtm->rtm_flags = RTF_STATIC | RTF_UP | RTF_GATEWAY;
rtm->rtm_version = RTM_VERSION;
@@ -904,103 +892,104 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
rtm->rtm_rmx = rt_metrics;
rtm->rtm_inits = rtm_inits;
rtm->rtm_index = 0;
-
+
/** Roundup value to a 4 bytes boundary. */
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a) - 1) | (sizeof(uint32_t) - 1))) : sizeof(uint32_t))
-
+
l = ROUNDUP(so_dst.ss_len);
memcpy(&so_dst, cp, l);
cp += l;
-
+
l = ROUNDUP(so_ifp.sdl_len);
memcpy(&so_ifp, cp, l);
cp += l;
-
+
l = cp - buf;
rtm->rtm_msglen = l;
-
+
s = socket(PF_ROUTE, SOCK_RAW, 0);
if (s < 0) {
// TODO
}
-
+
if ((rlen = write(s, rtm, l)) < 0) {
TSK_DEBUG_INFO("writing to routing socket");
// TODO
}
do {
l = read(s, rtm, 1024);
- } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid));
-
+ }
+ while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid));
+
/** Advance an address to the closest 4 bytes boundary. */
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
+
if (rtm->rtm_errno == 0 && rtm->rtm_addrs) {
cp = (char *)(rtm + 1);
for (i = 1; i; i <<= 1) {
if (i & rtm->rtm_addrs) {
sa = (struct sockaddr *)cp;
switch (i) {
- case RTA_IFP:
- ifp = (struct sockaddr_dl *) sa;
- break;
+ case RTA_IFP:
+ ifp = (struct sockaddr_dl *) sa;
+ break;
}
ADVANCE(cp, sa);
}
}
}
- if(ifp){
+ if(ifp) {
sdl_index = ifp->sdl_index;
}
#endif /* HAVE_STRUCT_RT_METRICS && HAVE_STRUCT_SOCKADDR_DL */
-
+
/* Get interfaces */
- if(getifaddrs(&ifaddr) == -1){
+ if(getifaddrs(&ifaddr) == -1) {
TNET_PRINT_LAST_ERROR("getifaddrs() failed.");
goto bail;
}
-
- for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
+
+ for(ifa = ifaddr; ifa; ifa = ifa->ifa_next) {
if ((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
continue;
}
-
+
if (sdl_index != -1 && if_nametoindex(ifa->ifa_name) != sdl_index) {
continue;
}
-
+
if (!ifa->ifa_addr || ifa->ifa_addr->sa_family != destAddr.ss_family) {
continue;
}
-
+
if (destAddr.ss_family == AF_INET6) {
if (IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_addr) ^
- IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *) &destAddr)->sin6_addr)) {
+ IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *) &destAddr)->sin6_addr)) {
continue;
}
if (IN6_IS_ADDR_SITELOCAL(&((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_addr) ^
- IN6_IS_ADDR_SITELOCAL(&((struct sockaddr_in6 *) &destAddr)->sin6_addr)) {
+ IN6_IS_ADDR_SITELOCAL(&((struct sockaddr_in6 *) &destAddr)->sin6_addr)) {
continue;
}
}
-
+
tnet_get_sockip((struct sockaddr *) ifa->ifa_addr, &ip);
-
+
memcpy(*source, ip, tsk_strlen(ip) > sizeof(*source) ? sizeof(*source) : tsk_strlen(ip));
ret = 0;
goto bail; // First is good for us.
}
-
-
+
+
#else /* All other systems (Google Android, Unix-Like systems, uLinux, ....) */
TSK_DEBUG_WARN("getbestroute() not supported on this OS");
memcpy(*source,
TNET_SOCKET_TYPE_IS_IPV6(type) ? "::" : "0.0.0.0",
TNET_SOCKET_TYPE_IS_IPV6(type) ? 2 : 7
- );
+ );
#endif
-
+
bail:
return ret;
}
@@ -1021,7 +1010,7 @@ bail:
int tnet_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
{
int ret = -1;
- if (hints && (ret = getaddrinfo(node, service, hints, res))){
+ if (hints && (ret = getaddrinfo(node, service, hints, res))) {
TSK_DEBUG_ERROR("getaddrinfo(family=%d, node=%s and service=%s) failed: [%s]", hints->ai_family, node, service, tnet_gai_strerror(ret));
}
return ret;
@@ -1035,7 +1024,7 @@ int tnet_getaddrinfo(const char *node, const char *service, const struct addrinf
**/
void tnet_freeaddrinfo(struct addrinfo *ai)
{
- if (ai){
+ if (ai) {
freeaddrinfo(ai);
}
}
@@ -1048,7 +1037,7 @@ void tnet_freeaddrinfo(struct addrinfo *ai)
*/
int tnet_getsockname(tnet_fd_t fd, struct sockaddr_storage *result)
{
- if (fd > 0 && result){
+ if (fd > 0 && result) {
socklen_t namelen = sizeof(*result);
return getsockname(fd, (struct sockaddr*)result, &namelen);
}
@@ -1057,7 +1046,7 @@ int tnet_getsockname(tnet_fd_t fd, struct sockaddr_storage *result)
int tnet_getpeername(tnet_fd_t fd, struct sockaddr_storage *result)
{
- if (fd > 0 && result){
+ if (fd > 0 && result) {
socklen_t namelen = sizeof(*result);
return getpeername(fd, (struct sockaddr*)result, &namelen);
}
@@ -1072,7 +1061,7 @@ int tnet_getpeername(tnet_fd_t fd, struct sockaddr_storage *result)
tnet_socket_type_t tnet_get_socket_type(tnet_fd_t fd)
{
tnet_socket_type_t type = tnet_socket_type_invalid;
-
+
/*if(fd >0)
{
struct sockaddr_storage ss;
@@ -1088,7 +1077,7 @@ tnet_socket_type_t tnet_get_socket_type(tnet_fd_t fd)
}
}
}*/
-
+
return type;
}
@@ -1102,39 +1091,39 @@ tnet_socket_type_t tnet_get_socket_type(tnet_fd_t fd)
tnet_family_t tnet_get_family(const char* host, tnet_port_t port)
{
tnet_family_t ret = AF_UNSPEC;
- if (host){
+ if (host) {
int status;
tsk_istr_t srv;
struct addrinfo *result = tsk_null;
struct addrinfo hints;
-
+
/* set the port: used as the default service */
- if (port){
+ if (port) {
tsk_itoa(port, &srv);
}
- else{
+ else {
memset(srv, '\0', sizeof(srv));
}
-
+
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
-
+
if ((status = tnet_getaddrinfo(host, srv, &hints, &result))) {
TNET_PRINT_LAST_ERROR("getaddrinfo(%s:%d) failed", host, port);
goto done;
}
-
+
/* Get the First result. */
if (result) {
ret = result->ai_family;
goto done;
}
- done:
+done:
tnet_freeaddrinfo(result);
}
-
+
return ret;
}
@@ -1148,47 +1137,45 @@ tnet_family_t tnet_get_family(const char* host, tnet_port_t port)
int tnet_get_sockip_n_port(const struct sockaddr *addr, tnet_ip_t *ip, tnet_port_t *port)
{
int status = -1;
-
- if (addr->sa_family == AF_INET){
+
+ if (addr->sa_family == AF_INET) {
const struct sockaddr_in *sin = (const struct sockaddr_in *)addr;
- if (port){
+ if (port) {
*port = tnet_ntohs(sin->sin_port);
status = 0;
}
- if (ip){
- if ((status = tnet_getnameinfo((const struct sockaddr*)sin, sizeof(*sin), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST))){
+ if (ip) {
+ if ((status = tnet_getnameinfo((const struct sockaddr*)sin, sizeof(*sin), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST))) {
return status;
}
}
}
- else if (addr->sa_family == AF_INET6)
- {
+ else if (addr->sa_family == AF_INET6) {
const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)addr;
#if TNET_UNDER_WINDOWS
int index;
#endif
- if (port){
+ if (port) {
*port = tnet_ntohs(sin6->sin6_port);
status = 0;
}
- if (ip){
- if ((status = tnet_getnameinfo((const struct sockaddr*)sin6, sizeof(*sin6), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST))){
+ if (ip) {
+ if ((status = tnet_getnameinfo((const struct sockaddr*)sin6, sizeof(*sin6), *ip, sizeof(*ip), 0, 0, NI_NUMERICHOST))) {
return status;
}
-
+
#if TNET_UNDER_WINDOWS
- if ((index = tsk_strindexOf(*ip, tsk_strlen(*ip), "%")) > 0){
+ if ((index = tsk_strindexOf(*ip, tsk_strlen(*ip), "%")) > 0) {
*(*ip + index) = '\0';
}
#endif
}
}
- else
- {
+ else {
TSK_DEBUG_ERROR("Unsupported address family.");
return status;
}
-
+
return status;
}
@@ -1202,24 +1189,24 @@ int tnet_get_sockip_n_port(const struct sockaddr *addr, tnet_ip_t *ip, tnet_port
*/
int tnet_get_peerip_n_port(tnet_fd_t localFD, tnet_ip_t *ip, tnet_port_t *port)
{
- if (port){
+ if (port) {
*port = 0;
}
-
- if (localFD > 0){
+
+ if (localFD > 0) {
int status;
socklen_t len;
struct sockaddr_storage ss;
-
+
len = sizeof(ss);
- if ((status = getpeername(localFD, (struct sockaddr *)&ss, &len))){
+ if ((status = getpeername(localFD, (struct sockaddr *)&ss, &len))) {
TSK_DEBUG_ERROR("TNET_GET_SOCKADDR has failed with status code: %d", status);
return -1;
}
-
+
return tnet_get_sockip_n_port(((struct sockaddr *)&ss), ip, port);
}
-
+
TSK_DEBUG_ERROR("Could not use an invalid socket description.");
return -1;
}
@@ -1230,27 +1217,27 @@ int tnet_get_peerip_n_port(tnet_fd_t localFD, tnet_ip_t *ip, tnet_port_t *port)
* @param getlocal Whether to get local or remote ip and port
* @param ip [out] The IP address of the local socket.
* @param port [out] The port of the local socket.
-
+
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tnet_get_ip_n_port(tnet_fd_t fd, tsk_bool_t getlocal, tnet_ip_t *ip, tnet_port_t *port)
{
- if (port){
+ if (port) {
*port = 0;
}
-
- if (fd > 0){
+
+ if (fd > 0) {
int status;
struct sockaddr_storage ss;
status = getlocal ? tnet_getsockname(fd, &ss) : tnet_getpeername(fd, &ss);
- if (status){
+ if (status) {
TNET_PRINT_LAST_ERROR("TNET_GET_SOCKADDR has failed with status code: %d", status);
return -1;
}
-
+
return tnet_get_sockip_n_port(((struct sockaddr *)&ss), ip, port);
}
-
+
TSK_DEBUG_ERROR("Could not use an invalid socket description.");
return -1;
}
@@ -1310,7 +1297,7 @@ int tnet_get_fd_opened_count(tsk_size_t* count)
char buf[1024];
struct dirent *dp;
DIR *dir;
-
+
if (!count) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -1457,7 +1444,7 @@ const char *tnet_inet_ntop(int af, const void *src, char *dst, int size)
}
addr.ss_family = AF_INET6;
((struct sockaddr_in6 *)&addr)->sin6_addr = *((struct in6_addr *)src);
-
+
if (tnet_get_sockip((const struct sockaddr *)&addr, &ip)) {
return tsk_null;
}
@@ -1495,29 +1482,29 @@ int tnet_sockfd_waitUntil(tnet_fd_t fd, long timeout, tsk_bool_t writable)
int ret = -1;
fd_set fds;
struct timeval timetowait;
-
- if (fd <= 0){
+
+ if (fd <= 0) {
goto bail;
}
-
- if (timeout >= 0){
+
+ if (timeout >= 0) {
timetowait.tv_sec = (timeout / 1000);
timetowait.tv_usec = (timeout % 1000) * 1000;
}
-
+
FD_ZERO(&fds);
FD_SET(fd, &fds);
-
+
ret = select(fd + 1, writable ? 0 : &fds, writable ? &fds : 0, 0, (timeout >= 0) ? &timetowait : 0);
-
- if (ret == 0){ /* timedout */
+
+ if (ret == 0) { /* timedout */
ret = -2;
}
- else if (ret == 1/* the total number of socket handles that are ready */){
+ else if (ret == 1/* the total number of socket handles that are ready */) {
ret = 0; // Ok
}
//else: error
-
+
bail:
return ret;
}
@@ -1530,21 +1517,21 @@ int tnet_sockfd_joingroup6(tnet_fd_t fd, const char* multiaddr, unsigned iface_i
int ret = -1;
//struct ipv6_mreq mreq6;
//struct sockaddr_storage ss;
-
+
//if((ret = tnet_sockaddr_init(multiaddr, 0, tnet_socket_type_udp_ipv6, &ss)))
//{
// return ret;
//}
-
+
//memcpy(&mreq6.ipv6mr_multiaddr, &((struct sockaddr_in6 *) &ss)->sin6_addr, sizeof(struct in6_addr));
//mreq6.ipv6mr_interface = iface_index;
-
+
//if((ret = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char*)&mreq6, sizeof(mreq6))))
//{
// TNET_PRINT_LAST_ERROR("Failed to join IPv6 multicast group.");
// return ret;
//}
-
+
return ret;
}
/**@ingroup tnet_utils_group
@@ -1565,7 +1552,7 @@ int tnet_resolve(const char *fqdn, tnet_port_t port, tnet_socket_type_t type, tn
{
struct sockaddr_storage addr;
int ret = tnet_sockaddr_init(fqdn, port, type, &addr);
- if (ret == 0){
+ if (ret == 0) {
return tnet_get_sockip_n_port((const struct sockaddr *)&addr, out_ip, out_port);
}
return ret;
@@ -1581,26 +1568,26 @@ int tnet_sockaddrinfo_init(const char *host, tnet_port_t port, enum tnet_socket_
struct addrinfo *ptr = 0;
struct addrinfo hints;
tsk_istr_t p;
-
+
tsk_itoa(port, &p);
-
+
/* hints address info structure */
memset(&hints, 0, sizeof(hints));
hints.ai_family = TNET_SOCKET_TYPE_IS_IPV46(type) ? AF_UNSPEC : (TNET_SOCKET_TYPE_IS_IPV6(type) ? AF_INET6 : AF_INET);
hints.ai_socktype = TNET_SOCKET_TYPE_IS_STREAM(type) ? SOCK_STREAM : SOCK_DGRAM;
hints.ai_protocol = TNET_SOCKET_TYPE_IS_STREAM(type) ? IPPROTO_TCP : IPPROTO_UDP;
hints.ai_flags = AI_PASSIVE;
-
+
/* Performs getaddrinfo */
- if ((status = tnet_getaddrinfo(host, p, &hints, &result))){
+ if ((status = tnet_getaddrinfo(host, p, &hints, &result))) {
TNET_PRINT_LAST_ERROR("getaddrinfo have failed.");
goto bail;
}
-
+
/* Find our address. */
- for (ptr = result; ptr; ptr = ptr->ai_next){
+ for (ptr = result; ptr; ptr = ptr->ai_next) {
/* Only IPv4 and IPv6 are supported */
- if (ptr->ai_family != AF_INET6 && ptr->ai_family != AF_INET){
+ if (ptr->ai_family != AF_INET6 && ptr->ai_family != AF_INET) {
continue;
}
/* duplicate addrinfo ==> Bad idea
@@ -1611,21 +1598,29 @@ int tnet_sockaddrinfo_init(const char *host, tnet_port_t port, enum tnet_socket_
(*ai)->ai_addrlen = ptr->ai_addrlen;
(*ai)->ai_next = 0;
(*ai)->ai_canonname = 0;*/
-
- if (ai_addr)memcpy(ai_addr, ptr->ai_addr, ptr->ai_addrlen);
- if (ai_family) *ai_family = ptr->ai_family;
- if (ai_socktype) *ai_socktype = ptr->ai_socktype;
- if (ai_protocol) *ai_protocol = ptr->ai_protocol;
-
+
+ if (ai_addr) {
+ memcpy(ai_addr, ptr->ai_addr, ptr->ai_addrlen);
+ }
+ if (ai_family) {
+ *ai_family = ptr->ai_family;
+ }
+ if (ai_socktype) {
+ *ai_socktype = ptr->ai_socktype;
+ }
+ if (ai_protocol) {
+ *ai_protocol = ptr->ai_protocol;
+ }
+
/* We prefer IPv4 but IPv6 can also work */
- if (ptr->ai_family == AF_INET){
+ if (ptr->ai_family == AF_INET) {
break;
}
}
-
+
bail:
tnet_freeaddrinfo(result);
-
+
return status;
}
@@ -1641,13 +1636,13 @@ int tnet_sockaddr_init(const char *host, tnet_port_t port, tnet_socket_type_t ty
{
int status;
struct sockaddr_storage ai_addr;
-
- if ((status = tnet_sockaddrinfo_init(host, port, type, &ai_addr, 0, 0, 0))){
+
+ if ((status = tnet_sockaddrinfo_init(host, port, type, &ai_addr, 0, 0, 0))) {
return status;
}
-
+
memcpy(addr, &ai_addr, sizeof(ai_addr));
-
+
return status;
}
@@ -1665,34 +1660,34 @@ int tnet_sockfd_init(const char *host, tnet_port_t port, enum tnet_socket_type_e
struct sockaddr_storage ai_addr;
int ai_family, ai_socktype, ai_protocol;
*fd = TNET_INVALID_SOCKET;
-
- if ((status = tnet_sockaddrinfo_init(host, port, type, &ai_addr, &ai_family, &ai_socktype, &ai_protocol))){
+
+ if ((status = tnet_sockaddrinfo_init(host, port, type, &ai_addr, &ai_family, &ai_socktype, &ai_protocol))) {
goto bail;
}
-
- if ((*fd = (tnet_fd_t)socket(ai_family, ai_socktype, ai_protocol)) == TNET_INVALID_SOCKET){
+
+ if ((*fd = (tnet_fd_t)socket(ai_family, ai_socktype, ai_protocol)) == TNET_INVALID_SOCKET) {
TNET_PRINT_LAST_ERROR("Failed to create new socket.");
goto bail;
}
-
+
#if TNET_USE_POLL || USE_POLL /* For win32 WSA* function the socket is auto. set to nonblocking mode. */
- if ((status = tnet_sockfd_set_nonblocking(*fd))){
+ if ((status = tnet_sockfd_set_nonblocking(*fd))) {
goto bail;
}
#endif
-
+
#if TNET_HAVE_SS_LEN
if((status = bind(*fd, (const struct sockaddr*)&ai_addr, ai_addr.ss_len)))
#else
- if ((status = bind(*fd, (const struct sockaddr*)&ai_addr, sizeof(ai_addr))))
+ if ((status = bind(*fd, (const struct sockaddr*)&ai_addr, sizeof(ai_addr))))
#endif
- {
- TNET_PRINT_LAST_ERROR("bind have failed.");
- tnet_sockfd_close(fd);
-
- goto bail;
- }
-
+ {
+ TNET_PRINT_LAST_ERROR("bind have failed.");
+ tnet_sockfd_close(fd);
+
+ goto bail;
+ }
+
bail:
return (*fd == TNET_INVALID_SOCKET) ? status : 0;
}
@@ -1705,8 +1700,7 @@ bail:
*/
int tnet_sockfd_set_mode(tnet_fd_t fd, int nonBlocking)
{
- if (fd != TNET_INVALID_FD)
- {
+ if (fd != TNET_INVALID_FD) {
#if TNET_UNDER_WINDOWS
ULONG mode = nonBlocking;
if (ioctlsocket(fd, FIONBIO, &mode))
@@ -1721,15 +1715,15 @@ int tnet_sockfd_set_mode(tnet_fd_t fd, int nonBlocking)
TNET_PRINT_LAST_ERROR("fcntl(F_GETFL) have failed.");
return -1;
}
- if(fcntl(fd, F_SETFL, flags | (nonBlocking ? O_NONBLOCK : ~O_NONBLOCK)) < 0){
+ if(fcntl(fd, F_SETFL, flags | (nonBlocking ? O_NONBLOCK : ~O_NONBLOCK)) < 0) {
TNET_PRINT_LAST_ERROR("fcntl(O_NONBLOCK/O_NONBLOCK) have failed.");
return -1;
}
#endif
-
+
// int on = 1;
// ioctl(fd, FIONBIO, (char *)&on);
-
+
}
return 0;
}
@@ -1775,7 +1769,7 @@ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf,
{
tsk_size_t sent = 0;
int ret = -1;
-
+
if (fd == TNET_INVALID_FD) {
TSK_DEBUG_ERROR("Using invalid FD to send data.");
goto bail;
@@ -1785,7 +1779,7 @@ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf,
ret = -2;
goto bail;
}
-
+
while (sent < size) {
int try_guard = 10;
#if TNET_UNDER_WINDOWS
@@ -1793,13 +1787,13 @@ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf,
DWORD numberOfBytesSent = 0;
wsaBuffer.buf = ((CHAR*)buf) + sent;
wsaBuffer.len = (ULONG)(size - sent);
- try_again:
+try_again:
ret = WSASendTo(fd, &wsaBuffer, 1, &numberOfBytesSent, 0, to, tnet_get_sockaddr_size(to), 0, 0); // returns zero if succeed
if (ret == 0) {
ret = numberOfBytesSent;
}
#else
- try_again:
+try_again:
ret = sendto(fd, (((const uint8_t*)buf) + sent), (size - sent), 0, to, tnet_get_sockaddr_size(to)); // returns number of sent bytes if succeed
#endif
if (ret <= 0) {
@@ -1819,7 +1813,7 @@ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf,
sent += ret;
}
}
-
+
bail:
return (int)((size == sent) ? sent : ret);
}
@@ -1838,12 +1832,12 @@ bail:
int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, tsk_size_t size, int flags, struct sockaddr *from)
{
socklen_t fromlen;
-
- if (fd == TNET_INVALID_FD){
+
+ if (fd == TNET_INVALID_FD) {
TSK_DEBUG_ERROR("Using invalid FD to recv data.");
return -1;
}
-
+
fromlen = tnet_get_sockaddr_size(from);
return recvfrom(fd, (char*)buf, (int)size, flags, from, &fromlen);
}
@@ -1861,32 +1855,34 @@ tsk_size_t tnet_sockfd_send(tnet_fd_t fd, const void* buf, tsk_size_t size, int
{
int ret = -1;
tsk_size_t sent = 0;
-
- if (fd == TNET_INVALID_FD){
+
+ if (fd == TNET_INVALID_FD) {
TSK_DEBUG_ERROR("Using invalid FD to send data.");
goto bail;
}
-
- while (sent < size){
- if ((ret = send(fd, (((const char*)buf) + sent), (int)(size - sent), flags)) <= 0){
- if (tnet_geterrno() == TNET_ERROR_WOULDBLOCK){
- if ((ret = tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT))){
+
+ while (sent < size) {
+ if ((ret = send(fd, (((const char*)buf) + sent), (int)(size - sent), flags)) <= 0) {
+ if (tnet_geterrno() == TNET_ERROR_WOULDBLOCK) {
+ if ((ret = tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT))) {
break;
}
- else continue;
+ else {
+ continue;
+ }
}
- else{
+ else {
TNET_PRINT_LAST_ERROR("send failed");
// Under Windows XP if WSAGetLastError()==WSAEINTR then try to disable both the ICS and the Firewall
// More info about How to disable the ISC: http://support.microsoft.com/?scid=kb%3Ben-us%3B230112&x=6&y=11
goto bail;
}
}
- else{
+ else {
sent += ret;
}
}
-
+
bail:
//return (size == sent) ? sent : ret;
return sent;
@@ -1905,17 +1901,17 @@ bail:
int tnet_sockfd_recv(tnet_fd_t fd, void* buf, tsk_size_t size, int flags)
{
int ret = -1;
-
- if (fd == TNET_INVALID_FD){
+
+ if (fd == TNET_INVALID_FD) {
TSK_DEBUG_ERROR("Using invalid FD to recv data.");
goto bail;
}
-
- if ((ret = (int)recv(fd, (char*)buf, (int)size, flags)) <= 0){
+
+ if ((ret = (int)recv(fd, (char*)buf, (int)size, flags)) <= 0) {
TNET_PRINT_LAST_ERROR("recv failed.");
goto bail;
}
-
+
bail:
return ret;
}
@@ -1929,40 +1925,40 @@ bail:
int tnet_sockfd_connectto(tnet_fd_t fd, const struct sockaddr_storage *to)
{
int status = -1;
-
+
#if TNET_UNDER_WINDOWS
-
- if ((status = WSAConnect(fd, (LPSOCKADDR)to, sizeof(*to), NULL, NULL, NULL, NULL)) == SOCKET_ERROR){
+
+ if ((status = WSAConnect(fd, (LPSOCKADDR)to, sizeof(*to), NULL, NULL, NULL, NULL)) == SOCKET_ERROR) {
status = WSAGetLastError();
- if (status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_ISCONN || status == TNET_ERROR_INTR || status == TNET_ERROR_INPROGRESS){
+ if (status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_ISCONN || status == TNET_ERROR_INTR || status == TNET_ERROR_INPROGRESS) {
TSK_DEBUG_WARN("TNET_ERROR_WOULDBLOCK/TNET_ERROR_ISCONN/TNET_ERROR_INTR/TNET_ERROR_INPROGRESS -> you should use tnet_sockfd_waitUntilWritable() before trying to send data");
status = 0;
}
- else{
+ else {
TNET_PRINT_LAST_ERROR("WSAConnect have failed");
}
}
-
+
#else /* !TNET_UNDER_WINDOWS */
-
+
#if TNET_HAVE_SS_LEN
if ((status = connect(fd, (struct sockaddr*)to, to->ss_len)))
# else
- if((status = connect(fd, (struct sockaddr*)to, sizeof(*to))))
+ if((status = connect(fd, (struct sockaddr*)to, sizeof(*to))))
# endif
- {
- status = tnet_geterrno();
- if(status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_ISCONN || status == TNET_ERROR_INPROGRESS || status == TNET_ERROR_EAGAIN){
- TSK_DEBUG_INFO("TNET_ERROR_WOULDBLOCK/TNET_ERROR_ISCONN/TNET_ERROR_INPROGRESS/TNET_ERROR_EAGAIN ==> use tnet_sockfd_waitUntilWritable.");
- status = 0;
- }
- else{
- TNET_PRINT_LAST_ERROR("connect have failed.");
- }
+ {
+ status = tnet_geterrno();
+ if(status == TNET_ERROR_WOULDBLOCK || status == TNET_ERROR_ISCONN || status == TNET_ERROR_INPROGRESS || status == TNET_ERROR_EAGAIN) {
+ TSK_DEBUG_INFO("TNET_ERROR_WOULDBLOCK/TNET_ERROR_ISCONN/TNET_ERROR_INPROGRESS/TNET_ERROR_EAGAIN ==> use tnet_sockfd_waitUntilWritable.");
+ status = 0;
}
-
+ else {
+ TNET_PRINT_LAST_ERROR("connect have failed.");
+ }
+ }
+
#endif /* TNET_UNDER_WINDOWS */
-
+
return status;
}
@@ -1970,10 +1966,12 @@ int tnet_sockfd_connectto(tnet_fd_t fd, const struct sockaddr_storage *to)
*/
int tnet_sockfd_listen(tnet_fd_t fd, int backlog)
{
- if (fd > 0){
+ if (fd > 0) {
return listen(fd, backlog);
}
- else return -1;
+ else {
+ return -1;
+ }
}
/**@ingroup tnet_utils_group
@@ -1981,11 +1979,11 @@ int tnet_sockfd_listen(tnet_fd_t fd, int backlog)
tnet_fd_t tnet_sockfd_accept(tnet_fd_t fd, struct sockaddr *addr, socklen_t *addrlen)
{
tnet_fd_t ret = TNET_INVALID_FD;
-
- if (fd > 0){
+
+ if (fd > 0) {
ret = (tnet_fd_t)accept(fd, addr, addrlen);
}
-
+
return ret;
}
@@ -1996,7 +1994,7 @@ tnet_fd_t tnet_sockfd_accept(tnet_fd_t fd, struct sockaddr *addr, socklen_t *add
*/
int tnet_sockfd_close(tnet_fd_t *fd)
{
- if (*fd != TNET_INVALID_FD){
+ if (*fd != TNET_INVALID_FD) {
int ret;
#if TNET_UNDER_WINDOWS
ret = closesocket(*fd);
@@ -2025,12 +2023,24 @@ int tnet_sockfd_shutdown(tnet_fd_t fd)
*/
tnet_proxy_type_t tnet_proxy_type_from_string(const char* type)
{
- if (tsk_striequals(type, "http")) return tnet_proxy_type_http;
- else if (tsk_striequals(type, "https")) return tnet_proxy_type_https;
- else if (tsk_striequals(type, "socks4")) return tnet_proxy_type_socks4;
- else if (tsk_striequals(type, "socks4a")) return tnet_proxy_type_socks4a;
- else if (tsk_striequals(type, "socks5")) return tnet_proxy_type_socks5;
- else return tnet_proxy_type_none;
+ if (tsk_striequals(type, "http")) {
+ return tnet_proxy_type_http;
+ }
+ else if (tsk_striequals(type, "https")) {
+ return tnet_proxy_type_https;
+ }
+ else if (tsk_striequals(type, "socks4")) {
+ return tnet_proxy_type_socks4;
+ }
+ else if (tsk_striequals(type, "socks4a")) {
+ return tnet_proxy_type_socks4a;
+ }
+ else if (tsk_striequals(type, "socks5")) {
+ return tnet_proxy_type_socks5;
+ }
+ else {
+ return tnet_proxy_type_none;
+ }
}
/**@ingroup tnet_utils_group
@@ -2038,12 +2048,18 @@ tnet_proxy_type_t tnet_proxy_type_from_string(const char* type)
const char* tnet_proxy_type_to_string(tnet_proxy_type_t type)
{
switch (type) {
- case tnet_proxy_type_http: return "http";
- case tnet_proxy_type_https: return "https";
- case tnet_proxy_type_socks4: return "socks4";
- case tnet_proxy_type_socks4a: return "socks4a";
- case tnet_proxy_type_socks5: return "socks5";
- default: return "none";
+ case tnet_proxy_type_http:
+ return "http";
+ case tnet_proxy_type_https:
+ return "https";
+ case tnet_proxy_type_socks4:
+ return "socks4";
+ case tnet_proxy_type_socks4a:
+ return "socks4a";
+ case tnet_proxy_type_socks5:
+ return "socks5";
+ default:
+ return "none";
}
}
@@ -2092,13 +2108,13 @@ const char* tnet_proxy_type_to_string(tnet_proxy_type_t type)
static tsk_object_t* tnet_interface_ctor(tsk_object_t * self, va_list * app)
{
tnet_interface_t *iface = (tnet_interface_t *)self;
- if (iface){
+ if (iface) {
const char* description = va_arg(*app, const char*);
const void* mac_address = va_arg(*app, const void*);
tsk_size_t mac_address_length = va_arg(*app, tsk_size_t);
-
+
iface->description = tsk_strdup(description);
- if ((iface->mac_address = (uint8_t*)tsk_calloc(mac_address_length, sizeof(uint8_t)))){
+ if ((iface->mac_address = (uint8_t*)tsk_calloc(mac_address_length, sizeof(uint8_t)))) {
memcpy(iface->mac_address, mac_address, mac_address_length);
}
iface->mac_address_length = mac_address_length;
@@ -2109,11 +2125,11 @@ static tsk_object_t* tnet_interface_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tnet_interface_dtor(tsk_object_t * self)
{
tnet_interface_t *iface = (tnet_interface_t *)self;
- if (iface){
+ if (iface) {
TSK_FREE(iface->description);
TSK_FREE(iface->mac_address);
}
-
+
return self;
}
@@ -2121,16 +2137,19 @@ static int tnet_interface_cmp(const tsk_object_t *if1, const tsk_object_t *if2)
{
const tnet_interface_t *iface1 = (const tnet_interface_t *)if1;
const tnet_interface_t *iface2 = (const tnet_interface_t *)if2;
-
- if (iface1 && iface2){
+
+ if (iface1 && iface2) {
return tsk_stricmp(iface1->description, iface1->description);
}
- else if (!iface1 && !iface2) return 0;
- else return -1;
+ else if (!iface1 && !iface2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_interface_def_s =
-{
+static const tsk_object_def_t tnet_interface_def_s = {
sizeof(tnet_interface_t),
tnet_interface_ctor,
tnet_interface_dtor,
@@ -2147,7 +2166,7 @@ const tsk_object_def_t *tnet_interface_def_t = &tnet_interface_def_s;
static tsk_object_t* tnet_address_ctor(tsk_object_t * self, va_list * app)
{
tnet_address_t *address = (tnet_address_t *)self;
- if (address){
+ if (address) {
address->ip = tsk_strdup(va_arg(*app, const char*));
}
return self;
@@ -2156,10 +2175,10 @@ static tsk_object_t* tnet_address_ctor(tsk_object_t * self, va_list * app)
static tsk_object_t* tnet_address_dtor(tsk_object_t * self)
{
tnet_address_t *address = (tnet_address_t *)self;
- if (address){
+ if (address) {
TSK_FREE(address->ip);
}
-
+
return self;
}
@@ -2167,17 +2186,20 @@ static int tnet_address_cmp(const tsk_object_t *_a1, const tsk_object_t *_a2)
{
const tnet_address_t *a1 = (const tnet_address_t *)_a1;
const tnet_address_t *a2 = (const tnet_address_t *)_a2;
-
- if (a1 && a2){
+
+ if (a1 && a2) {
// to have AF_UNSPEC, AF_UNIX, AF_INET, ... first
return (a1->family - a2->family);
}
- else if (!a1 && !a2) return 0;
- else return -1;
+ else if (!a1 && !a2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tnet_address_def_s =
-{
+static const tsk_object_def_t tnet_address_def_s = {
sizeof(tnet_address_t),
tnet_address_ctor,
tnet_address_dtor,
diff --git a/tinyNET/src/tnet_utils.h b/tinyNET/src/tnet_utils.h
index 6673696..a3abbc9 100755
--- a/tinyNET/src/tnet_utils.h
+++ b/tinyNET/src/tnet_utils.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,33 +40,31 @@ TNET_BEGIN_DECLS
/**Interface.
*/
-typedef struct tnet_interface_s
-{
- TSK_DECLARE_OBJECT;
-
- unsigned index;
-
- char* description;
- uint8_t* mac_address;
- tsk_size_t mac_address_length;
+typedef struct tnet_interface_s {
+ TSK_DECLARE_OBJECT;
+
+ unsigned index;
+
+ char* description;
+ uint8_t* mac_address;
+ tsk_size_t mac_address_length;
}
tnet_interface_t;
/**Address.
*/
-typedef struct tnet_address_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_address_s {
+ TSK_DECLARE_OBJECT;
- tnet_family_t family;
+ tnet_family_t family;
- unsigned unicast:1;
- unsigned anycast:1;
- unsigned multicast:1;
- unsigned dnsserver:1;
+ unsigned unicast:1;
+ unsigned anycast:1;
+ unsigned multicast:1;
+ unsigned dnsserver:1;
- char* ip;
+ char* ip;
}
tnet_address_t;
diff --git a/tinyNET/src/turn/tnet_turn.c b/tinyNET/src/turn/tnet_turn.c
index 0f38d02..fc37d68 100755
--- a/tinyNET/src/turn/tnet_turn.c
+++ b/tinyNET/src/turn/tnet_turn.c
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -97,7 +97,7 @@
// request->nonce = tsk_strdup(allocation->nonce);
//
// /* Create random transaction id */
-// {
+// {
// tsk_istr_t random;
// tsk_md5digest_t digest;
//
@@ -176,8 +176,8 @@
// tnet_turn_attribute_t *attribute;
// tnet_turn_channel_binding_id_t number;
// uint32_t lifetime;
-//
-//
+//
+//
// channel_binding = va_arg(*app, const tnet_turn_channel_binding_t *);
// number = tnet_htons(channel_binding->id);
// lifetime = tnet_htonl(channel_binding->timeout);
@@ -216,7 +216,7 @@
// tnet_turn_attribute_xpeer_addr_t* xpeer = tsk_object_ref(va_arg(*app, tnet_turn_attribute_xpeer_addr_t *));
// const void* data = va_arg(*app, const void *);
// tsk_size_t size = va_arg(*app, tsk_size_t);
-//
+//
// /*
// draft-ietf-behave-turn-16 - 10.1. Forming a Send Indication
//
@@ -255,7 +255,7 @@
// attribute->xaddress[1] = 0xA1;
// attribute->xaddress[2] = 0x83;
// attribute->xaddress[3] = 0x47;
-//
+//
// tnet_stun_message_add_attribute(request, (tnet_stun_attr_t**)&attribute);
//
// /*if((attribute = tnet_turn_attribute_even_port_create(context->enable_evenport)))
@@ -293,7 +293,7 @@
// { /* First time we get a nonce */
// tsk_strupdate(&allocation->nonce, nonce);
// tsk_strupdate(&allocation->realm, realm);
-//
+//
// /* Delete the message and response before retrying*/
// TSK_OBJECT_SAFE_FREE(response);
// TSK_OBJECT_SAFE_FREE(request);
@@ -347,7 +347,7 @@
// TSK_OBJECT_SAFE_FREE(response);
// }
// }
-//
+//
// TSK_OBJECT_SAFE_FREE(request);
// return ret;
//}
@@ -357,12 +357,12 @@
//tnet_turn_allocation_id_t tnet_turn_allocate(const tnet_nat_context_t* nat_context, const tnet_fd_t localFD, tnet_socket_type_t socket_type)
//{
// tnet_turn_allocation_id_t id = TNET_TURN_INVALID_ALLOCATION_ID;
-//
+//
// if(nat_context){
// int ret;
// tnet_turn_allocation_t* allocation = tnet_turn_allocation_create(localFD, nat_context->socket_type, nat_context->server_address, nat_context->server_port, nat_context->username, nat_context->password);
// allocation->software = tsk_strdup(nat_context->software);
-//
+//
// if((ret = tnet_turn_send_request(nat_context, allocation, tnet_turn_create_request_allocate))){
// TSK_DEBUG_ERROR("TURN allocation failed with error code:%d.", ret);
// TSK_OBJECT_SAFE_FREE(allocation);
@@ -422,9 +422,9 @@
//
// if(nat_context && allocation){
// int ret;
-//
+//
// channel_binding = tnet_turn_channel_binding_create(allocation);
-//
+//
// if(channel_binding){
// if(((struct sockaddr*)peer)->sa_family == AF_INET){
// struct sockaddr_in *sin = ((struct sockaddr_in*)peer);
@@ -433,7 +433,7 @@
// channel_binding->xpeer = tnet_turn_attribute_xpeer_addr_create_null();
// channel_binding->xpeer->family = stun_ipv4;
// channel_binding->xpeer->xport = ((sin->sin_port) ^ tnet_htons(0x2112));
-//
+//
// _sin_addr = tnet_htonl_2(&sin->sin_addr) ^tnet_htonl(kStunMagicCookieLong);
// memcpy(channel_binding->xpeer->xaddress, &_sin_addr, sizeof(_sin_addr));
// }
@@ -453,7 +453,7 @@
// if((ret = tnet_turn_send_request(nat_context, allocation, tnet_turn_create_request_channel_bind, channel_binding))){
// TSK_DEBUG_ERROR("TURN (CHANNEL-BIND) failed with error code:%d.", ret);
// TSK_OBJECT_SAFE_FREE(channel_binding);
-//
+//
// goto bail;
// }
// else{
@@ -566,8 +566,8 @@
//{
// tnet_turn_channel_binding_t *channel_binding = self;
// if(channel_binding){
-// static tnet_turn_channel_binding_id_t __allocation_unique_id = 0x4000; /* 0x4000 through 0x7FFF */
-//
+// static tnet_turn_channel_binding_id_t __allocation_unique_id = 0x4000; /* 0x4000 through 0x7FFF */
+//
// channel_binding->id = __allocation_unique_id++;
// channel_binding->allocation = va_arg(*app, const tnet_turn_allocation_t *);
// channel_binding->timeout = TNET_TURN_CHANBIND_TIMEOUT_DEFAULT; /* 10 minutes as per draft-ietf-behave-turn-16 subclause 11 */
@@ -580,21 +580,21 @@
//}
//
//static tsk_object_t* tnet_turn_channel_binding_dtor(tsk_object_t * self)
-//{
+//{
// tnet_turn_channel_binding_t *channel_binding = self;
// if(channel_binding){
// TSK_OBJECT_SAFE_FREE(channel_binding->xpeer);
// }
-//
+//
// return self;
//}
//
-//static const tsk_object_def_t tnet_turn_channel_binding_def_s =
+//static const tsk_object_def_t tnet_turn_channel_binding_def_s =
//{
// sizeof(tnet_turn_channel_binding_t),
-// tnet_turn_channel_binding_ctor,
+// tnet_turn_channel_binding_ctor,
// tnet_turn_channel_binding_dtor,
-// tsk_null,
+// tsk_null,
//};
//const tsk_object_def_t *tnet_turn_channel_binding_def_t = &tnet_turn_channel_binding_def_s;
//
@@ -611,21 +611,21 @@
//}
//
//static tsk_object_t* tnet_turn_permission_dtor(tsk_object_t * self)
-//{
+//{
// tnet_turn_permission_t *permission = self;
// if(permission){
// TSK_OBJECT_SAFE_FREE(permission->xpeer);
// }
-//
+//
// return self;
//}
//
-//static const tsk_object_def_t tnet_turn_permission_def_s =
+//static const tsk_object_def_t tnet_turn_permission_def_s =
//{
// sizeof(tnet_turn_permission_t),
-// tnet_turn_permission_ctor,
+// tnet_turn_permission_ctor,
// tnet_turn_permission_dtor,
-// tsk_null,
+// tsk_null,
//};
//const tsk_object_def_t *tnet_turn_permission_def_t = &tnet_turn_permission_def_s;
//
@@ -639,7 +639,7 @@
// tnet_turn_allocation_t *allocation = self;
// if(allocation){
// static tnet_turn_allocation_id_t __allocation_unique_id = 0;
-//
+//
// const char* server_address;
// tnet_port_t server_port;
//
@@ -647,7 +647,7 @@
//
// allocation->localFD = va_arg(*app, tnet_fd_t);
// allocation->socket_type = va_arg(*app, tnet_socket_type_t);
-//
+//
// server_address = va_arg(*app, const char*);
//#if defined(__GNUC__)
// server_port = (tnet_port_t)va_arg(*app, unsigned);
@@ -668,7 +668,7 @@
//}
//
//static tsk_object_t* tnet_turn_allocation_dtor(tsk_object_t * self)
-//{
+//{
// tnet_turn_allocation_t *allocation = self;
// if(allocation){
// TSK_FREE(allocation->relay_address);
@@ -679,23 +679,23 @@
// TSK_FREE(allocation->nonce);
//
// TSK_FREE(allocation->software);
-//
+//
// TSK_OBJECT_SAFE_FREE(allocation->xmaddr);
// TSK_OBJECT_SAFE_FREE(allocation->maddr);
//
// TSK_OBJECT_SAFE_FREE(allocation->channel_bindings);
// TSK_OBJECT_SAFE_FREE(allocation->permissions);
// }
-//
+//
// return self;
//}
//
-//static const tsk_object_def_t tnet_turn_allocation_def_s =
+//static const tsk_object_def_t tnet_turn_allocation_def_s =
//{
// sizeof(tnet_turn_allocation_t),
-// tnet_turn_allocation_ctor,
+// tnet_turn_allocation_ctor,
// tnet_turn_allocation_dtor,
-// tsk_null,
+// tsk_null,
//};
//const tsk_object_def_t *tnet_turn_allocation_def_t = &tnet_turn_allocation_def_s;
//
diff --git a/tinyNET/src/turn/tnet_turn.h b/tinyNET/src/turn/tnet_turn.h
index af3a5e4..f1c050e 100755
--- a/tinyNET/src/turn/tnet_turn.h
+++ b/tinyNET/src/turn/tnet_turn.h
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -113,15 +113,15 @@
//typedef struct tnet_turn_allocation_s
//{
// TSK_DECLARE_OBJECT;
-//
+//
// tnet_turn_allocation_id_t id; /**< Unique id. */
-//
+//
// char* relay_address; /**< the relayed transport address */
// //! Server reflexive address of the local socket(STUN1 as per RFC 3489).
// tnet_stun_attribute_mapped_addr_t *maddr;
// //! XORed server reflexive address (STUN2 as per RFC 5389).
// tnet_stun_attribute_xmapped_addr_t *xmaddr;
-//
+//
// /* 5-tuple */
// tnet_fd_t localFD;
// tnet_socket_type_t socket_type;
diff --git a/tinyNET/src/turn/tnet_turn_attribute.c b/tinyNET/src/turn/tnet_turn_attribute.c
index 719f926..5dc3ee3 100755
--- a/tinyNET/src/turn/tnet_turn_attribute.c
+++ b/tinyNET/src/turn/tnet_turn_attribute.c
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -116,7 +116,7 @@
//
// /* Attribute Value
// */
-//
+//
// switch(type)
// {
// /* draft-ietf-behave-turn-16 - 14.1. CHANNEL-NUMBER */
@@ -176,7 +176,7 @@
// TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
// break;
// }
-//
+//
// /* draft-ietf-behave-turn-16 - 14.9. RESERVATION-TOKEN */
// case stun_reservation_token:
// {
@@ -296,7 +296,7 @@
// TSK_DEBUG_ERROR("SERIALIZE:TOKEN ==> NOT IMPLEMENTED");
// return -3;
// }
-//
+//
// default: break;
// }
//
@@ -324,8 +324,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_channelnum_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_channelnum_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_channelnum_t *attribute = self;
// if(attribute){
// }
@@ -357,8 +357,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_lifetime_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_lifetime_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_lifetime_t *attribute = self;
// if(attribute){
// }
@@ -386,7 +386,7 @@
// if(attribute){
// const void *payload = va_arg(*app, const void*);
// tsk_size_t payload_size = va_arg(*app, tsk_size_t);
-//
+//
// if(payload && payload_size){
// }
// TNET_STUN_ATTRIBUTE(attribute)->type = stun_xor_peer_address;
@@ -395,8 +395,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_xpeer_addr_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_xpeer_addr_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_xpeer_addr_t *attribute = self;
// if(attribute){
// }
@@ -432,8 +432,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_data_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_data_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_data_t *attribute = self;
// if(attribute){
// TSK_OBJECT_SAFE_FREE(attribute->value);
@@ -466,7 +466,7 @@
//
// TNET_STUN_ATTRIBUTE(attribute)->type = stun_xor_relayed_address;
// TNET_STUN_ATTRIBUTE(attribute)->length = payload_size;
-//
+//
// attribute->family = (tnet_stun_addr_family_t)(*(payloadPtr++));
//
// attribute->xport = tnet_ntohs_2(payloadPtr);
@@ -475,7 +475,7 @@
//
// { /*=== Compute IP address */
// tsk_size_t addr_size = (attribute->family == stun_ipv6) ? 16 : (attribute->family == stun_ipv4 ? 4 : 0);
-// if(addr_size){
+// if(addr_size){
// tsk_size_t i;
// uint32_t addr;
//
@@ -489,14 +489,14 @@
// else{
// TSK_DEBUG_ERROR("UNKNOWN FAMILY [%u].", attribute->family);
// }
-// }
+// }
// }
// }
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_xrelayed_addr_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_xrelayed_addr_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_xrelayed_addr_t *attribute = self;
// if(attribute){
// }
@@ -528,8 +528,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_even_port_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_even_port_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_even_port_t *attribute = self;
// if(attribute){
// }
@@ -561,8 +561,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_reqtrans_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_reqtrans_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_reqtrans_t *attribute = self;
// if(attribute){
// }
@@ -594,8 +594,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_dontfrag_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_dontfrag_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_dontfrag_t *attribute = self;
// if(attribute){
// }
@@ -628,8 +628,8 @@
// return self;
//}
//
-//static tsk_object_t* tnet_turn_attribute_restoken_dtor(tsk_object_t * self)
-//{
+//static tsk_object_t* tnet_turn_attribute_restoken_dtor(tsk_object_t * self)
+//{
// tnet_turn_attribute_restoken_t *attribute = self;
// if(attribute){
// }
diff --git a/tinyNET/src/turn/tnet_turn_attribute.h b/tinyNET/src/turn/tnet_turn_attribute.h
index 127116c..998379e 100755
--- a/tinyNET/src/turn/tnet_turn_attribute.h
+++ b/tinyNET/src/turn/tnet_turn_attribute.h
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -117,7 +117,7 @@
//typedef struct tnet_turn_attribute_even_port_s
//{
// TNET_STUN_DECLARE_ATTRIBUTE;
-//
+//
///*
// 0 1 2 3 4 5 6 7
// +-+-+-+-+-+-+-+-+
@@ -136,7 +136,7 @@
//typedef struct tnet_turn_attribute_reqtrans_s
//{
// TNET_STUN_DECLARE_ATTRIBUTE;
-///*
+///*
// draft-ietf-behave-turn-16 - 14.7. REQUESTED-TRANSPORT
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
diff --git a/tinyNET/src/turn/tnet_turn_message.c b/tinyNET/src/turn/tnet_turn_message.c
index 989fd2b..b0eff46 100755
--- a/tinyNET/src/turn/tnet_turn_message.c
+++ b/tinyNET/src/turn/tnet_turn_message.c
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -144,20 +144,20 @@
//}
//
//static tsk_object_t* tnet_turn_channel_data_dtor(tsk_object_t * self)
-//{
+//{
// tnet_turn_channel_data_t *message = self;
// if(message){
// TSK_FREE(message->data);
// }
-//
+//
// return self;
//}
//
-//static const tsk_object_def_t tnet_turn_channel_data_def_s =
+//static const tsk_object_def_t tnet_turn_channel_data_def_s =
//{
// sizeof(tnet_turn_channel_data_t),
-// tnet_turn_channel_data_ctor,
+// tnet_turn_channel_data_ctor,
// tnet_turn_channel_data_dtor,
-// tsk_null,
+// tsk_null,
//};
//const tsk_object_def_t *tnet_turn_channel_data_def_t = &tnet_turn_channel_data_def_s;
diff --git a/tinyNET/src/turn/tnet_turn_message.h b/tinyNET/src/turn/tnet_turn_message.h
index c518366..c98d4f0 100755
--- a/tinyNET/src/turn/tnet_turn_message.h
+++ b/tinyNET/src/turn/tnet_turn_message.h
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
diff --git a/tinyNET/src/turn/tnet_turn_session.c b/tinyNET/src/turn/tnet_turn_session.c
index e131dbc..801f01a 100755
--- a/tinyNET/src/turn/tnet_turn_session.c
+++ b/tinyNET/src/turn/tnet_turn_session.c
@@ -45,143 +45,141 @@
typedef tnet_stun_pkt_t tnet_turn_pkt_t;
-typedef struct tnet_turn_peer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_turn_peer_s {
+ TSK_DECLARE_OBJECT;
- tnet_turn_peer_id_t id;
+ tnet_turn_peer_id_t id;
- uint16_t u_chan_num;
- uint32_t u_conn_id; // rfc6062 - 6.2.1. CONNECTION-ID, For streams only
- tnet_fd_t conn_fd; // Connected FD: used for Streams only
+ uint16_t u_chan_num;
+ uint32_t u_conn_id; // rfc6062 - 6.2.1. CONNECTION-ID, For streams only
+ tnet_fd_t conn_fd; // Connected FD: used for Streams only
- tnet_stun_addr_t addr_ip;
- char* p_addr_ip;
- uint16_t u_addr_port;
- tsk_bool_t b_ipv6;
- tsk_bool_t b_stream_connected;
- tsk_buffer_t *p_stream_buff_in;
+ tnet_stun_addr_t addr_ip;
+ char* p_addr_ip;
+ uint16_t u_addr_port;
+ tsk_bool_t b_ipv6;
+ tsk_bool_t b_stream_connected;
+ tsk_buffer_t *p_stream_buff_in;
tsk_buffer_t *p_stream_buff_out;
-
- tnet_stun_state_t e_createperm_state;
- tnet_stun_state_t e_chanbind_state;
- tnet_stun_state_t e_connect_state;
- tnet_stun_state_t e_connbind_state;
-
- tnet_turn_pkt_t* p_pkt_createperm;
- tnet_stun_pkt_t* p_pkt_sendind;
- tnet_stun_pkt_t* p_pkt_chanbind;
- tnet_stun_pkt_t* p_pkt_connect; // For streams only
- tnet_stun_pkt_t* p_pkt_connbind; // For streams only
-
- struct {
- struct {
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } createperm;
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } chanbind;
- } fresh; // schedule refresh
- struct {
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } createperm;
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } chanbind;
- } rtt; // retransmit (UDP only, to deal with pkt loss)
- } timer;
+
+ tnet_stun_state_t e_createperm_state;
+ tnet_stun_state_t e_chanbind_state;
+ tnet_stun_state_t e_connect_state;
+ tnet_stun_state_t e_connbind_state;
+
+ tnet_turn_pkt_t* p_pkt_createperm;
+ tnet_stun_pkt_t* p_pkt_sendind;
+ tnet_stun_pkt_t* p_pkt_chanbind;
+ tnet_stun_pkt_t* p_pkt_connect; // For streams only
+ tnet_stun_pkt_t* p_pkt_connbind; // For streams only
+
+ struct {
+ struct {
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } createperm;
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } chanbind;
+ } fresh; // schedule refresh
+ struct {
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } createperm;
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } chanbind;
+ } rtt; // retransmit (UDP only, to deal with pkt loss)
+ } timer;
}
tnet_turn_peer_t;
typedef tsk_list_t tnet_turn_peers_L_t;
-typedef struct tnet_turn_session_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tnet_turn_session_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_started;
+ tsk_bool_t b_stopping;
+ enum tnet_stun_state_e e_alloc_state;
+ enum tnet_stun_state_e e_refresh_state;
- tsk_bool_t b_prepared;
- tsk_bool_t b_started;
- tsk_bool_t b_stopping;
- enum tnet_stun_state_e e_alloc_state;
- enum tnet_stun_state_e e_refresh_state;
-
- enum tnet_turn_transport_e e_req_transport;
+ enum tnet_turn_transport_e e_req_transport;
- uint32_t u_lifetime_alloc_in_sec;
+ uint32_t u_lifetime_alloc_in_sec;
- tnet_turn_pkt_t* p_pkt_alloc;
- tnet_stun_pkt_t* p_pkt_refresh;
+ tnet_turn_pkt_t* p_pkt_alloc;
+ tnet_stun_pkt_t* p_pkt_refresh;
- void* p_buff_send_ptr;
- tsk_size_t u_buff_send_size;
+ void* p_buff_send_ptr;
+ tsk_size_t u_buff_send_size;
- void* p_buff_chandata_ptr;
- tsk_size_t u_buff_chandata_size;
+ void* p_buff_chandata_ptr;
+ tsk_size_t u_buff_chandata_size;
- char* p_rel_ip;
- uint16_t u_rel_port;
- tsk_bool_t b_rel_ipv6;
+ char* p_rel_ip;
+ uint16_t u_rel_port;
+ tsk_bool_t b_rel_ipv6;
+
+ char* p_srflx_ip;
+ uint16_t u_srflx_port;
+ tsk_bool_t b_srflx_ipv6;
- char* p_srflx_ip;
- uint16_t u_srflx_port;
- tsk_bool_t b_srflx_ipv6;
-
struct {
tsk_bool_t auto_detect;
struct tnet_proxyinfo_s* info;
}
proxy;
- struct {
- char* path_priv;
- char* path_pub;
- char* path_ca;
- tsk_bool_t verify;
- } ssl;
-
- struct {
- char* p_usr_name;
- char* p_pwd;
- } cred;
-
- struct {
- tnet_turn_session_callback_f f_fun;
- struct tnet_turn_session_event_xs e;
- } cb;
-
- struct {
- tsk_timer_manager_handle_t *p_mgr;
- tsk_timer_id_t u_timer_id_refresh; // To refresh Alloc (Send Refresh Indication)
- struct {
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } alloc;
- struct {
- tsk_timer_id_t id;
- uint64_t u_timeout;
- } refresh;
- } rtt; // retransmit (UDP only)
- } timer;
-
- tnet_socket_t* p_lcl_sock;
- char* p_srv_host;
- uint16_t u_srv_port;
- tsk_bool_t b_stream_connected;
+ struct {
+ char* path_priv;
+ char* path_pub;
+ char* path_ca;
+ tsk_bool_t verify;
+ } ssl;
+
+ struct {
+ char* p_usr_name;
+ char* p_pwd;
+ } cred;
+
+ struct {
+ tnet_turn_session_callback_f f_fun;
+ struct tnet_turn_session_event_xs e;
+ } cb;
+
+ struct {
+ tsk_timer_manager_handle_t *p_mgr;
+ tsk_timer_id_t u_timer_id_refresh; // To refresh Alloc (Send Refresh Indication)
+ struct {
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } alloc;
+ struct {
+ tsk_timer_id_t id;
+ uint64_t u_timeout;
+ } refresh;
+ } rtt; // retransmit (UDP only)
+ } timer;
+
+ tnet_socket_t* p_lcl_sock;
+ char* p_srv_host;
+ uint16_t u_srv_port;
+ tsk_bool_t b_stream_connected;
tsk_buffer_t* p_stream_buff_out; // data pending until the socket is connected
- tsk_bool_t b_stream_error; // Unrecoverable error occured
- tsk_buffer_t *p_stream_buff_in;
- struct sockaddr_storage srv_addr;
- struct tnet_transport_s* p_transport;
+ tsk_bool_t b_stream_error; // Unrecoverable error occured
+ tsk_buffer_t *p_stream_buff_in;
+ struct sockaddr_storage srv_addr;
+ struct tnet_transport_s* p_transport;
- tnet_turn_peers_L_t* p_list_peers;
+ tnet_turn_peers_L_t* p_list_peers;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tnet_turn_session_t;
@@ -207,87 +205,99 @@ static int _tnet_turn_peer_create(const char* pc_peer_ip, uint16_t u_peer_port,
static int _tnet_turn_peer_find_by_xpeer(const tnet_turn_peers_L_t* pc_peers, const tnet_stun_attr_address_t* pc_xpeer, const tnet_turn_peer_t **ppc_peer);
/*** PREDICATES ***/
-static int __pred_find_peer_by_id(const tsk_list_item_t *item, const void *id) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->id - *((const tnet_turn_peer_id_t*)id));
- }
- return -1;
+static int __pred_find_peer_by_id(const tsk_list_item_t *item, const void *id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->id - *((const tnet_turn_peer_id_t*)id));
+ }
+ return -1;
}
-static int __pred_find_peer_by_fd(const tsk_list_item_t *item, const void *fd) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->conn_fd - *((const tnet_fd_t*)fd));
- }
- return -1;
+static int __pred_find_peer_by_fd(const tsk_list_item_t *item, const void *fd)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->conn_fd - *((const tnet_fd_t*)fd));
+ }
+ return -1;
}
-static int __pred_find_peer_by_channum(const tsk_list_item_t *item, const void *pu_chan_num) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->u_chan_num - *((const uint16_t*)pu_chan_num));
- }
- return -1;
+static int __pred_find_peer_by_channum(const tsk_list_item_t *item, const void *pu_chan_num)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->u_chan_num - *((const uint16_t*)pu_chan_num));
+ }
+ return -1;
}
-static int __pred_find_peer_by_timer_rtt_createperm(const tsk_list_item_t *item, const void *id) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.rtt.createperm.id - *((const tsk_timer_id_t*)id));
- }
- return -1;
+static int __pred_find_peer_by_timer_rtt_createperm(const tsk_list_item_t *item, const void *id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.rtt.createperm.id - *((const tsk_timer_id_t*)id));
+ }
+ return -1;
}
-static int __pred_find_peer_by_timer_fresh_createperm(const tsk_list_item_t *item, const void *id) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.fresh.createperm.id - *((const tsk_timer_id_t*)id));
- }
- return -1;
+static int __pred_find_peer_by_timer_fresh_createperm(const tsk_list_item_t *item, const void *id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.fresh.createperm.id - *((const tsk_timer_id_t*)id));
+ }
+ return -1;
}
-static int __pred_find_peer_by_transacid_createperm(const tsk_list_item_t *item, const void *pc_transacid) {
- if (item && item->data) {
- return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_createperm
- ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_createperm->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
- : +1;
- }
- return -1;
+static int __pred_find_peer_by_transacid_createperm(const tsk_list_item_t *item, const void *pc_transacid)
+{
+ if (item && item->data) {
+ return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_createperm
+ ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_createperm->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
+ : +1;
+ }
+ return -1;
}
-static int __pred_find_peer_by_timer_rtt_chanbind(const tsk_list_item_t *item, const void *id) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.rtt.chanbind.id - *((const tsk_timer_id_t*)id));
- }
- return -1;
+static int __pred_find_peer_by_timer_rtt_chanbind(const tsk_list_item_t *item, const void *id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.rtt.chanbind.id - *((const tsk_timer_id_t*)id));
+ }
+ return -1;
}
-static int __pred_find_peer_by_timer_fresh_chanbind(const tsk_list_item_t *item, const void *id) {
- if (item && item->data) {
- return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.fresh.chanbind.id - *((const tsk_timer_id_t*)id));
- }
- return -1;
+static int __pred_find_peer_by_timer_fresh_chanbind(const tsk_list_item_t *item, const void *id)
+{
+ if (item && item->data) {
+ return (int)(((const struct tnet_turn_peer_s *)item->data)->timer.fresh.chanbind.id - *((const tsk_timer_id_t*)id));
+ }
+ return -1;
}
-static int __pred_find_peer_by_transacid_chanbind(const tsk_list_item_t *item, const void *pc_transacid) {
- if (item && item->data) {
- return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_chanbind
- ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_chanbind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
- : +1;
- }
- return -1;
+static int __pred_find_peer_by_transacid_chanbind(const tsk_list_item_t *item, const void *pc_transacid)
+{
+ if (item && item->data) {
+ return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_chanbind
+ ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_chanbind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
+ : +1;
+ }
+ return -1;
}
-static int __pred_find_peer_by_transacid_connect(const tsk_list_item_t *item, const void *pc_transacid) {
- if (item && item->data) {
- return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_connect
- ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_connect->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
- : +1;
- }
- return -1;
+static int __pred_find_peer_by_transacid_connect(const tsk_list_item_t *item, const void *pc_transacid)
+{
+ if (item && item->data) {
+ return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_connect
+ ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_connect->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
+ : +1;
+ }
+ return -1;
}
-static int __pred_find_peer_by_transacid_connectionbind(const tsk_list_item_t *item, const void *pc_transacid) {
- if (item && item->data) {
- return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_connbind
- ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_connbind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
- : +1;
- }
- return -1;
+static int __pred_find_peer_by_transacid_connectionbind(const tsk_list_item_t *item, const void *pc_transacid)
+{
+ if (item && item->data) {
+ return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_connbind
+ ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_connbind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
+ : +1;
+ }
+ return -1;
}
-static int __pred_find_peer_by_transacid_sendind(const tsk_list_item_t *item, const void *pc_transacid) {
- if (item && item->data) {
- return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_sendind
- ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_sendind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
- : +1;
- }
- return -1;
+static int __pred_find_peer_by_transacid_sendind(const tsk_list_item_t *item, const void *pc_transacid)
+{
+ if (item && item->data) {
+ return ((const struct tnet_turn_peer_s *)item->data)->p_pkt_sendind
+ ? tnet_stun_utils_transac_id_cmp(((const struct tnet_turn_peer_s *)item->data)->p_pkt_sendind->transac_id, *((const tnet_stun_transac_id_t*)pc_transacid))
+ : +1;
+ }
+ return -1;
}
#define _tnet_turn_session_raise_event0(_p_self, _e_type, _u_peer_id) \
@@ -321,117 +331,117 @@ static int __pred_find_peer_by_transacid_sendind(const tsk_list_item_t *item, co
int tnet_turn_session_create(struct tnet_socket_s* p_lcl_sock, enum tnet_turn_transport_e e_req_transport, const char* pc_srv_host, uint16_t u_srv_port, struct tnet_turn_session_s** pp_self)
{
- int ret;
- extern const tsk_object_def_t *tnet_turn_session_def_t;
- tnet_turn_session_t* p_self;
- if (!p_lcl_sock || !TNET_SOCKET_IS_VALID(p_lcl_sock) || !pc_srv_host || !u_srv_port || !pp_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (!(p_self = tsk_object_new(tnet_turn_session_def_t))) {
- TSK_DEBUG_ERROR("Failed to create 'tnet_turn_session_def_t' object");
- return -2;
- }
- if (!(p_self->p_list_peers = tsk_list_create())) {
- TSK_DEBUG_ERROR("Failed to create list");
- ret = -3;
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_STREAM(p_lcl_sock->type) && !(p_self->p_stream_buff_in = tsk_buffer_create_null())) {
- TSK_DEBUG_ERROR("Failed to stream buffer");
- ret = -4;
- goto bail;
- }
- if ((ret = tnet_sockaddr_init(pc_srv_host, u_srv_port, p_lcl_sock->type, &p_self->srv_addr))) {
- TSK_DEBUG_ERROR("Invalid TURN SRV address [%s:%u]", pc_srv_host, u_srv_port);
- goto bail;
- }
- tsk_strupdate(&p_self->p_srv_host, pc_srv_host);
- p_self->u_srv_port = u_srv_port;
- p_self->p_lcl_sock = tsk_object_ref(p_lcl_sock);
- p_self->e_req_transport = e_req_transport;
- p_self->cb.e.pc_session = p_self;
- *pp_self = p_self;
+ int ret;
+ extern const tsk_object_def_t *tnet_turn_session_def_t;
+ tnet_turn_session_t* p_self;
+ if (!p_lcl_sock || !TNET_SOCKET_IS_VALID(p_lcl_sock) || !pc_srv_host || !u_srv_port || !pp_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (!(p_self = tsk_object_new(tnet_turn_session_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create 'tnet_turn_session_def_t' object");
+ return -2;
+ }
+ if (!(p_self->p_list_peers = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create list");
+ ret = -3;
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_STREAM(p_lcl_sock->type) && !(p_self->p_stream_buff_in = tsk_buffer_create_null())) {
+ TSK_DEBUG_ERROR("Failed to stream buffer");
+ ret = -4;
+ goto bail;
+ }
+ if ((ret = tnet_sockaddr_init(pc_srv_host, u_srv_port, p_lcl_sock->type, &p_self->srv_addr))) {
+ TSK_DEBUG_ERROR("Invalid TURN SRV address [%s:%u]", pc_srv_host, u_srv_port);
+ goto bail;
+ }
+ tsk_strupdate(&p_self->p_srv_host, pc_srv_host);
+ p_self->u_srv_port = u_srv_port;
+ p_self->p_lcl_sock = tsk_object_ref(p_lcl_sock);
+ p_self->e_req_transport = e_req_transport;
+ p_self->cb.e.pc_session = p_self;
+ *pp_self = p_self;
bail:
- if (ret) {
- TSK_OBJECT_SAFE_FREE(p_self);
- }
- return ret;
+ if (ret) {
+ TSK_OBJECT_SAFE_FREE(p_self);
+ }
+ return ret;
}
int tnet_turn_session_create_2(const char* pc_lcl_ip, uint16_t u_lcl_port, enum tnet_socket_type_e e_lcl_type, enum tnet_turn_transport_e e_req_transport, const char* pc_srv_host, uint16_t u_srv_port, struct tnet_turn_session_s** pp_self)
{
- tnet_socket_t* p_lcl_sock;
- int ret;
- if (!pc_srv_host || !u_srv_port || !pp_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!(p_lcl_sock = tnet_socket_create(pc_lcl_ip, u_lcl_port, e_lcl_type))) {
- TSK_DEBUG_ERROR("Failed to create socket(%s:%u$%d)", pc_lcl_ip, u_lcl_port, e_lcl_type);
- return -2;
- }
- ret = tnet_turn_session_create(p_lcl_sock, e_req_transport, pc_srv_host, u_srv_port, pp_self);
- TSK_OBJECT_SAFE_FREE(p_lcl_sock);
- return ret;
+ tnet_socket_t* p_lcl_sock;
+ int ret;
+ if (!pc_srv_host || !u_srv_port || !pp_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!(p_lcl_sock = tnet_socket_create(pc_lcl_ip, u_lcl_port, e_lcl_type))) {
+ TSK_DEBUG_ERROR("Failed to create socket(%s:%u$%d)", pc_lcl_ip, u_lcl_port, e_lcl_type);
+ return -2;
+ }
+ ret = tnet_turn_session_create(p_lcl_sock, e_req_transport, pc_srv_host, u_srv_port, pp_self);
+ TSK_OBJECT_SAFE_FREE(p_lcl_sock);
+ return ret;
}
int tnet_turn_session_create_4(struct tnet_socket_s* p_lcl_sock, enum tnet_turn_transport_e e_req_transport, const char* pc_srv_host, uint16_t u_srv_port, enum tnet_socket_type_e e_srv_type, struct tnet_turn_session_s** pp_self)
{
- struct tnet_socket_s* _p_lcl_sock;
- int ret;
+ struct tnet_socket_s* _p_lcl_sock;
+ int ret;
- if (TNET_SOCKET_TYPE_IS_STREAM(e_srv_type)) {
- // For stream the socket will be connected to the server and this is why we need to create a new socket
- if (!(_p_lcl_sock = tnet_socket_create(p_lcl_sock->ip, TNET_SOCKET_PORT_ANY/*p_lcl_sock->port*/, e_srv_type))) {
- return -2;
- }
- }
- else {
- // For UDP, use the socket socket
- _p_lcl_sock = tsk_object_ref(p_lcl_sock);
- }
- ret = tnet_turn_session_create(_p_lcl_sock, e_req_transport, pc_srv_host, u_srv_port, pp_self);
- TSK_OBJECT_SAFE_FREE(_p_lcl_sock);
- return ret;
+ if (TNET_SOCKET_TYPE_IS_STREAM(e_srv_type)) {
+ // For stream the socket will be connected to the server and this is why we need to create a new socket
+ if (!(_p_lcl_sock = tnet_socket_create(p_lcl_sock->ip, TNET_SOCKET_PORT_ANY/*p_lcl_sock->port*/, e_srv_type))) {
+ return -2;
+ }
+ }
+ else {
+ // For UDP, use the socket socket
+ _p_lcl_sock = tsk_object_ref(p_lcl_sock);
+ }
+ ret = tnet_turn_session_create(_p_lcl_sock, e_req_transport, pc_srv_host, u_srv_port, pp_self);
+ TSK_OBJECT_SAFE_FREE(_p_lcl_sock);
+ return ret;
}
int tnet_turn_session_set_cred(tnet_turn_session_t* p_self, const char* pc_usr_name, const char* pc_pwd)
{
- if (!p_self || !pc_usr_name || !pc_pwd) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_strupdate(&p_self->cred.p_usr_name, pc_usr_name);
- tsk_strupdate(&p_self->cred.p_pwd, pc_pwd);
+ if (!p_self || !pc_usr_name || !pc_pwd) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_strupdate(&p_self->cred.p_usr_name, pc_usr_name);
+ tsk_strupdate(&p_self->cred.p_pwd, pc_pwd);
- return 0;
+ return 0;
}
int tnet_turn_session_set_callback(struct tnet_turn_session_s* p_self, tnet_turn_session_callback_f f_fun, const void* pc_usr_data)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- p_self->cb.f_fun = f_fun;
- p_self->cb.e.pc_usr_data = pc_usr_data;
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ p_self->cb.f_fun = f_fun;
+ p_self->cb.e.pc_usr_data = pc_usr_data;
+ return 0;
}
int tnet_turn_session_set_ssl_certs(struct tnet_turn_session_s* p_self, const char* path_priv, const char* path_pub, const char* path_ca, tsk_bool_t verify)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(p_self);
- tsk_strupdate(&p_self->ssl.path_priv, path_priv);
- tsk_strupdate(&p_self->ssl.path_pub, path_pub);
- tsk_strupdate(&p_self->ssl.path_ca, path_ca);
- p_self->ssl.verify = verify;
- tsk_safeobj_unlock(p_self);
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(p_self);
+ tsk_strupdate(&p_self->ssl.path_priv, path_priv);
+ tsk_strupdate(&p_self->ssl.path_pub, path_pub);
+ tsk_strupdate(&p_self->ssl.path_ca, path_ca);
+ p_self->ssl.verify = verify;
+ tsk_safeobj_unlock(p_self);
+ return 0;
}
int tnet_turn_session_set_proxy_auto_detect(struct tnet_turn_session_s* p_self, tsk_bool_t auto_detect)
@@ -461,99 +471,99 @@ int tnet_turn_session_set_proxy_info(struct tnet_turn_session_s* p_self, struct
int tnet_turn_session_prepare(tnet_turn_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (p_self->b_prepared) {
- goto bail;
- }
+ if (p_self->b_prepared) {
+ goto bail;
+ }
- p_self->e_alloc_state = tnet_stun_state_none;
- p_self->e_refresh_state = tnet_stun_state_none;
+ p_self->e_alloc_state = tnet_stun_state_none;
+ p_self->e_refresh_state = tnet_stun_state_none;
- p_self->timer.rtt.alloc.id = TSK_INVALID_TIMER_ID;
- p_self->timer.rtt.refresh.id = TSK_INVALID_TIMER_ID;
+ p_self->timer.rtt.alloc.id = TSK_INVALID_TIMER_ID;
+ p_self->timer.rtt.refresh.id = TSK_INVALID_TIMER_ID;
- p_self->timer.u_timer_id_refresh = TSK_INVALID_TIMER_ID;
- p_self->u_lifetime_alloc_in_sec = kTurnAllocationTimeOutInSec;
+ p_self->timer.u_timer_id_refresh = TSK_INVALID_TIMER_ID;
+ p_self->u_lifetime_alloc_in_sec = kTurnAllocationTimeOutInSec;
- TSK_OBJECT_SAFE_FREE(p_self->p_pkt_alloc);
- TSK_OBJECT_SAFE_FREE(p_self->p_pkt_refresh);
+ TSK_OBJECT_SAFE_FREE(p_self->p_pkt_alloc);
+ TSK_OBJECT_SAFE_FREE(p_self->p_pkt_refresh);
- // create timer manager
- if (!p_self->timer.p_mgr && !(p_self->timer.p_mgr = tsk_timer_manager_create())) {
- TSK_DEBUG_ERROR("Failed to create timer manager");
+ // create timer manager
+ if (!p_self->timer.p_mgr && !(p_self->timer.p_mgr = tsk_timer_manager_create())) {
+ TSK_DEBUG_ERROR("Failed to create timer manager");
ret = -4;
- goto bail;
- }
+ goto bail;
+ }
- // create transport
+ // create transport
if (!p_self->p_transport) {
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- // Use the DGram socket as master
- p_self->p_transport = tnet_transport_create_2(p_self->p_lcl_sock, kTurnTransportFriendlyName);
- }
- else {
- // Use the Stream socket later and connect it
- p_self->p_transport = tnet_transport_create(p_self->p_lcl_sock->ip, TNET_SOCKET_PORT_ANY, p_self->p_lcl_sock->type, kTurnTransportFriendlyName);
- }
- if (!p_self->p_transport) {
- TSK_DEBUG_ERROR("Failed to create %s Transport", kTurnTransportFriendlyName);
- ret = -5;
- goto bail;
- }
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ // Use the DGram socket as master
+ p_self->p_transport = tnet_transport_create_2(p_self->p_lcl_sock, kTurnTransportFriendlyName);
+ }
+ else {
+ // Use the Stream socket later and connect it
+ p_self->p_transport = tnet_transport_create(p_self->p_lcl_sock->ip, TNET_SOCKET_PORT_ANY, p_self->p_lcl_sock->type, kTurnTransportFriendlyName);
+ }
+ if (!p_self->p_transport) {
+ TSK_DEBUG_ERROR("Failed to create %s Transport", kTurnTransportFriendlyName);
+ ret = -5;
+ goto bail;
+ }
}
// set transport callback
- if ((ret = tnet_transport_set_callback(p_self->p_transport, TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type) ? _tnet_turn_session_transport_layer_dgram_cb : _tnet_turn_session_transport_layer_stream_cb, p_self))) {
+ if ((ret = tnet_transport_set_callback(p_self->p_transport, TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type) ? _tnet_turn_session_transport_layer_dgram_cb : _tnet_turn_session_transport_layer_stream_cb, p_self))) {
goto bail;
- }
+ }
- p_self->b_prepared = tsk_true;
+ p_self->b_prepared = tsk_true;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_start(tnet_turn_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (p_self->b_started) {
- goto bail;
- }
- if (!p_self->b_prepared) {
- TSK_DEBUG_ERROR("TURN session not prepared yet");
- ret = -2;
- goto bail;
- }
+ if (p_self->b_started) {
+ goto bail;
+ }
+ if (!p_self->b_prepared) {
+ TSK_DEBUG_ERROR("TURN session not prepared yet");
+ ret = -2;
+ goto bail;
+ }
- // start timer manager
- if ((ret = tsk_timer_manager_start(p_self->timer.p_mgr))) {
- TSK_DEBUG_ERROR("Failed to start TURN timer manager");
- goto bail;
- }
+ // start timer manager
+ if ((ret = tsk_timer_manager_start(p_self->timer.p_mgr))) {
+ TSK_DEBUG_ERROR("Failed to start TURN timer manager");
+ goto bail;
+ }
+
+ // set SSL certificates
+ if (TNET_SOCKET_TYPE_IS_TLS(p_self->p_lcl_sock->type) || TNET_SOCKET_TYPE_IS_WSS(p_self->p_lcl_sock->type)) {
+ if ((ret = tnet_transport_tls_set_certs(p_self->p_transport, p_self->ssl.path_ca, p_self->ssl.path_pub, p_self->ssl.path_priv, p_self->ssl.verify))) {
+ TSK_DEBUG_ERROR("Failed to set SSL certificates: '%s', '%s', '%s'", p_self->ssl.path_ca, p_self->ssl.path_pub, p_self->ssl.path_priv);
+ goto bail;
+ }
+ }
- // set SSL certificates
- if (TNET_SOCKET_TYPE_IS_TLS(p_self->p_lcl_sock->type) || TNET_SOCKET_TYPE_IS_WSS(p_self->p_lcl_sock->type)) {
- if ((ret = tnet_transport_tls_set_certs(p_self->p_transport, p_self->ssl.path_ca, p_self->ssl.path_pub, p_self->ssl.path_priv, p_self->ssl.verify))) {
- TSK_DEBUG_ERROR("Failed to set SSL certificates: '%s', '%s', '%s'", p_self->ssl.path_ca, p_self->ssl.path_pub, p_self->ssl.path_priv);
- goto bail;
- }
- }
-
// Proxy info
if ((ret = tnet_transport_set_proxy_auto_detect(p_self->p_transport, p_self->proxy.auto_detect))) {
TSK_DEBUG_ERROR("Failed to set proxy autodetect option");
@@ -566,218 +576,218 @@ int tnet_turn_session_start(tnet_turn_session_t* p_self)
}
}
- // start network transport
- if ((ret = tnet_transport_start(p_self->p_transport))) {
- TSK_DEBUG_ERROR("Failed to start TURN transport");
- goto bail;
- }
-
- // Connect to the server
- if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type)) {
- tnet_fd_t fd;
- p_self->b_stream_connected = tsk_false;
- p_self->b_stream_error = tsk_false;
- fd = tnet_transport_connectto_3(p_self->p_transport, p_self->p_lcl_sock, p_self->p_srv_host, p_self->u_srv_port, p_self->p_lcl_sock->type);
- if (fd != p_self->p_lcl_sock->fd) {
- TSK_DEBUG_ERROR("Failed to connect to TURN server(%s:%d)", p_self->p_srv_host, p_self->u_srv_port);
- ret = -3;
- goto bail;
- }
- TSK_DEBUG_INFO("TURN server connection fd = %d", p_self->p_lcl_sock->fd);
- }
+ // start network transport
+ if ((ret = tnet_transport_start(p_self->p_transport))) {
+ TSK_DEBUG_ERROR("Failed to start TURN transport");
+ goto bail;
+ }
+
+ // Connect to the server
+ if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type)) {
+ tnet_fd_t fd;
+ p_self->b_stream_connected = tsk_false;
+ p_self->b_stream_error = tsk_false;
+ fd = tnet_transport_connectto_3(p_self->p_transport, p_self->p_lcl_sock, p_self->p_srv_host, p_self->u_srv_port, p_self->p_lcl_sock->type);
+ if (fd != p_self->p_lcl_sock->fd) {
+ TSK_DEBUG_ERROR("Failed to connect to TURN server(%s:%d)", p_self->p_srv_host, p_self->u_srv_port);
+ ret = -3;
+ goto bail;
+ }
+ TSK_DEBUG_INFO("TURN server connection fd = %d", p_self->p_lcl_sock->fd);
+ }
- p_self->b_started = tsk_true;
+ p_self->b_started = tsk_true;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_allocate(tnet_turn_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
- // create Allocate Request
- p_self->e_alloc_state = tnet_stun_state_none;
- p_self->timer.rtt.alloc.id = TSK_INVALID_TIMER_ID;
- TSK_OBJECT_SAFE_FREE(p_self->p_pkt_alloc);
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_allocate_request, &p_self->p_pkt_alloc))) {
- TSK_DEBUG_ERROR("Failed to create TURN Allocate request");
- goto bail;
- }
- // add attributes
- p_self->p_pkt_alloc->opt.dontfrag = 0;
- ret = tnet_stun_pkt_attrs_add(p_self->p_pkt_alloc,
- TNET_STUN_PKT_ATTR_ADD_LIFETIME(p_self->u_lifetime_alloc_in_sec),
- TNET_STUN_PKT_ATTR_ADD_REQUESTED_TRANSPORT(p_self->e_req_transport),
- TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware), // recommended for Alloc and Refresh
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
-
- if ((ret = _tnet_turn_session_send_pkt(p_self, p_self->p_pkt_alloc))) {
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- p_self->timer.rtt.alloc.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_self->timer.rtt.alloc.id, p_self->timer.rtt.alloc.u_timeout);
- }
- p_self->e_alloc_state = tnet_stun_state_trying;
+ // create Allocate Request
+ p_self->e_alloc_state = tnet_stun_state_none;
+ p_self->timer.rtt.alloc.id = TSK_INVALID_TIMER_ID;
+ TSK_OBJECT_SAFE_FREE(p_self->p_pkt_alloc);
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_allocate_request, &p_self->p_pkt_alloc))) {
+ TSK_DEBUG_ERROR("Failed to create TURN Allocate request");
+ goto bail;
+ }
+ // add attributes
+ p_self->p_pkt_alloc->opt.dontfrag = 0;
+ ret = tnet_stun_pkt_attrs_add(p_self->p_pkt_alloc,
+ TNET_STUN_PKT_ATTR_ADD_LIFETIME(p_self->u_lifetime_alloc_in_sec),
+ TNET_STUN_PKT_ATTR_ADD_REQUESTED_TRANSPORT(p_self->e_req_transport),
+ TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware), // recommended for Alloc and Refresh
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ if ((ret = _tnet_turn_session_send_pkt(p_self, p_self->p_pkt_alloc))) {
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ p_self->timer.rtt.alloc.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_self->timer.rtt.alloc.id, p_self->timer.rtt.alloc.u_timeout);
+ }
+ p_self->e_alloc_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_get_relayed_addr(const struct tnet_turn_session_s* p_self, char** pp_ip, uint16_t *pu_port, tsk_bool_t *pb_ipv6)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self || !pp_ip || !pu_port || !pb_ipv6) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self || !pp_ip || !pu_port || !pb_ipv6) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
- tsk_strupdate(pp_ip, p_self->p_rel_ip);
- *pu_port = p_self->u_rel_port;
- *pb_ipv6 = p_self->b_rel_ipv6;
+ tsk_strupdate(pp_ip, p_self->p_rel_ip);
+ *pu_port = p_self->u_rel_port;
+ *pb_ipv6 = p_self->b_rel_ipv6;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_get_srflx_addr(const tnet_turn_session_t* p_self, char** pp_ip, uint16_t *pu_port, tsk_bool_t *pb_ipv6)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self || !pp_ip || !pu_port || !pb_ipv6) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self || !pp_ip || !pu_port || !pb_ipv6) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
- tsk_strupdate(pp_ip, p_self->p_srflx_ip);
- *pu_port = p_self->u_srflx_port;
- *pb_ipv6 = p_self->b_srflx_ipv6;
+ tsk_strupdate(pp_ip, p_self->p_srflx_ip);
+ *pu_port = p_self->u_srflx_port;
+ *pb_ipv6 = p_self->b_srflx_ipv6;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_get_state_alloc(const struct tnet_turn_session_s* pc_self, enum tnet_stun_state_e *pe_state)
{
- if (!pc_self || !pe_state) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *pe_state = pc_self->e_alloc_state;
- return 0;
+ if (!pc_self || !pe_state) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *pe_state = pc_self->e_alloc_state;
+ return 0;
}
int tnet_turn_session_get_socket_local(struct tnet_turn_session_s* p_self, struct tnet_socket_s** pp_lcl_sock)
{
- if (!p_self || !pp_lcl_sock) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(p_self);
- *pp_lcl_sock = (struct tnet_socket_s*)tsk_object_ref(p_self->p_lcl_sock);
- tsk_safeobj_unlock(p_self);
- return 0;
+ if (!p_self || !pp_lcl_sock) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(p_self);
+ *pp_lcl_sock = (struct tnet_socket_s*)tsk_object_ref(p_self->p_lcl_sock);
+ tsk_safeobj_unlock(p_self);
+ return 0;
}
int tnet_turn_session_get_state_createperm(const struct tnet_turn_session_s* pc_self, tnet_turn_peer_id_t u_peer_id, enum tnet_stun_state_e *pe_state)
{
- const tnet_turn_peer_t *pc_peer;
- if (!pc_self || !pe_state) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- if ((pc_peer = tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- *pe_state = pc_peer->e_createperm_state;
- }
- else {
- *pe_state = tnet_stun_state_none;
- if (u_peer_id != kTurnPeerIdInvalid) {
- TSK_DEBUG_WARN("TURN peer with id =%ld doesn't exist", u_peer_id);
- }
- }
- tsk_safeobj_unlock(pc_self);
- return 0;
+ const tnet_turn_peer_t *pc_peer;
+ if (!pc_self || !pe_state) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ if ((pc_peer = tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ *pe_state = pc_peer->e_createperm_state;
+ }
+ else {
+ *pe_state = tnet_stun_state_none;
+ if (u_peer_id != kTurnPeerIdInvalid) {
+ TSK_DEBUG_WARN("TURN peer with id =%ld doesn't exist", u_peer_id);
+ }
+ }
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
int tnet_turn_session_get_state_connbind(const struct tnet_turn_session_s* pc_self, tnet_turn_peer_id_t u_peer_id, enum tnet_stun_state_e *pe_state)
{
- const tnet_turn_peer_t *pc_peer;
- if (!pc_self || !pe_state) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- if ((pc_peer = tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- *pe_state = pc_peer->e_connbind_state;
- }
- else {
- *pe_state = tnet_stun_state_none;
- if (u_peer_id != kTurnPeerIdInvalid) {
- TSK_DEBUG_WARN("TURN peer with id =%ld doesn't exist", u_peer_id);
- }
- }
- tsk_safeobj_unlock(pc_self);
- return 0;
+ const tnet_turn_peer_t *pc_peer;
+ if (!pc_self || !pe_state) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ if ((pc_peer = tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ *pe_state = pc_peer->e_connbind_state;
+ }
+ else {
+ *pe_state = tnet_stun_state_none;
+ if (u_peer_id != kTurnPeerIdInvalid) {
+ TSK_DEBUG_WARN("TURN peer with id =%ld doesn't exist", u_peer_id);
+ }
+ }
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
int tnet_turn_session_get_req_transport(const struct tnet_turn_session_s* pc_self, enum tnet_turn_transport_e *pe_transport)
{
- if (!pc_self || !pe_transport) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- *pe_transport = pc_self->e_req_transport;
- tsk_safeobj_unlock(pc_self);
- return 0;
+ if (!pc_self || !pe_transport) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ *pe_transport = pc_self->e_req_transport;
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
int tnet_turn_session_get_bytes_count(const struct tnet_turn_session_s* pc_self, uint64_t* bytes_in, uint64_t* bytes_out)
@@ -791,459 +801,459 @@ int tnet_turn_session_get_bytes_count(const struct tnet_turn_session_s* pc_self,
int tnet_turn_session_createpermission(struct tnet_turn_session_s* p_self, const char* pc_peer_addr, uint16_t u_peer_port, tnet_turn_peer_id_t* pu_id)
{
- int ret = 0;
- tnet_turn_peer_t *p_peer = tsk_null;
+ int ret = 0;
+ tnet_turn_peer_t *p_peer = tsk_null;
- if (!p_self || !pc_peer_addr || !u_peer_port || !pu_id) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_self);
+ if (!p_self || !pc_peer_addr || !u_peer_port || !pu_id) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
- if ((ret = _tnet_turn_peer_create(pc_peer_addr, u_peer_port, TNET_SOCKET_TYPE_IS_IPV6(p_self->p_lcl_sock->type), &p_peer))) {
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type)) {
- if (!p_peer->p_stream_buff_in && !(p_peer->p_stream_buff_in = tsk_buffer_create_null())) {
- TSK_DEBUG_ERROR("Failed to create stream buffer for peer with id=%ld", p_peer->id);
- ret = -5;
- goto bail;
- }
- }
- if ((ret = _tnet_turn_session_send_permission(p_self, p_peer))) {
- goto bail;
- }
- *pu_id = p_peer->id;
- tsk_list_push_back_data(p_self->p_list_peers, (void**)&p_peer);
+ tsk_safeobj_lock(p_self);
+
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
+ if ((ret = _tnet_turn_peer_create(pc_peer_addr, u_peer_port, TNET_SOCKET_TYPE_IS_IPV6(p_self->p_lcl_sock->type), &p_peer))) {
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type)) {
+ if (!p_peer->p_stream_buff_in && !(p_peer->p_stream_buff_in = tsk_buffer_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create stream buffer for peer with id=%ld", p_peer->id);
+ ret = -5;
+ goto bail;
+ }
+ }
+ if ((ret = _tnet_turn_session_send_permission(p_self, p_peer))) {
+ goto bail;
+ }
+ *pu_id = p_peer->id;
+ tsk_list_push_back_data(p_self->p_list_peers, (void**)&p_peer);
bail:
- TSK_OBJECT_SAFE_FREE(p_peer);
- tsk_safeobj_unlock(p_self);
- return ret;
+ TSK_OBJECT_SAFE_FREE(p_peer);
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_deletepermission(struct tnet_turn_session_s* p_self, tnet_turn_peer_id_t u_id)
{
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(p_self);
- tsk_list_remove_item_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_id);
- tsk_safeobj_unlock(p_self);
- return 0;
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(p_self);
+ tsk_list_remove_item_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_id);
+ tsk_safeobj_unlock(p_self);
+ return 0;
}
int tnet_turn_session_chanbind(tnet_turn_session_t* p_self, tnet_turn_peer_id_t u_peer_id)
{
- int ret = 0;
- tnet_turn_peer_t *pc_peer;
+ int ret = 0;
+ tnet_turn_peer_t *pc_peer;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
- if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
- ret = -5;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
+ if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
+ ret = -5;
+ goto bail;
+ }
- // ChannelBind must not be used for streams (e.g. TCP, TLS....)
- if (p_self->e_req_transport != tnet_turn_transport_udp) {
- TSK_DEBUG_ERROR("TURN ChannelBind not supported for stream");
- ret = -6;
- goto bail;
- }
+ // ChannelBind must not be used for streams (e.g. TCP, TLS....)
+ if (p_self->e_req_transport != tnet_turn_transport_udp) {
+ TSK_DEBUG_ERROR("TURN ChannelBind not supported for stream");
+ ret = -6;
+ goto bail;
+ }
- // create ChannelBind Request if doesn't exist (ChannelBind refresh *must* have same id)
- pc_peer->e_chanbind_state = tnet_stun_state_none;
- pc_peer->timer.rtt.chanbind.id = TSK_INVALID_TIMER_ID;
- if (!pc_peer->p_pkt_chanbind) {
- pc_peer->u_chan_num = _tnet_turn_session_get_unique_chan_num();
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_channelbind_request, &pc_peer->p_pkt_chanbind))) {
- TSK_DEBUG_ERROR("Failed to create TURN ChannelBind request");
- goto bail;
- }
- // add authentication info
- tnet_stun_pkt_auth_copy(pc_peer->p_pkt_chanbind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
- // add attributes
- pc_peer->p_pkt_chanbind->opt.dontfrag = 0;
- ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_chanbind,
- /* Must not add LIFETIME and there is no way to delete permission */
- TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
- TNET_STUN_PKT_ATTR_ADD_CHANNEL_NUMBER(pc_peer->u_chan_num),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
-
- }
- else {
- if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_chanbind->transac_id))) {
- goto bail;
- }
- }
-
- if ((ret = _tnet_turn_session_send_pkt(p_self, pc_peer->p_pkt_chanbind))) {
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- pc_peer->timer.rtt.chanbind.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.rtt.chanbind.id, pc_peer->timer.rtt.chanbind.u_timeout);
- }
- pc_peer->e_chanbind_state = tnet_stun_state_trying;
+ // create ChannelBind Request if doesn't exist (ChannelBind refresh *must* have same id)
+ pc_peer->e_chanbind_state = tnet_stun_state_none;
+ pc_peer->timer.rtt.chanbind.id = TSK_INVALID_TIMER_ID;
+ if (!pc_peer->p_pkt_chanbind) {
+ pc_peer->u_chan_num = _tnet_turn_session_get_unique_chan_num();
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_channelbind_request, &pc_peer->p_pkt_chanbind))) {
+ TSK_DEBUG_ERROR("Failed to create TURN ChannelBind request");
+ goto bail;
+ }
+ // add authentication info
+ tnet_stun_pkt_auth_copy(pc_peer->p_pkt_chanbind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ // add attributes
+ pc_peer->p_pkt_chanbind->opt.dontfrag = 0;
+ ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_chanbind,
+ /* Must not add LIFETIME and there is no way to delete permission */
+ TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
+ TNET_STUN_PKT_ATTR_ADD_CHANNEL_NUMBER(pc_peer->u_chan_num),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ }
+ else {
+ if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_chanbind->transac_id))) {
+ goto bail;
+ }
+ }
+
+ if ((ret = _tnet_turn_session_send_pkt(p_self, pc_peer->p_pkt_chanbind))) {
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ pc_peer->timer.rtt.chanbind.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.rtt.chanbind.id, pc_peer->timer.rtt.chanbind.u_timeout);
+ }
+ pc_peer->e_chanbind_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
// TCP-Connect rfc6062 - 4.3. Initiating a Connection
int tnet_turn_session_connect(struct tnet_turn_session_s* p_self, tnet_turn_peer_id_t u_peer_id)
{
- int ret = 0;
- tnet_turn_peer_t *pc_peer;
+ int ret = 0;
+ tnet_turn_peer_t *pc_peer;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
- if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
- ret = -5;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
+ if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
+ ret = -5;
+ goto bail;
+ }
- // Connect must be used for streams (e.g. TCP, TLS....) only
- if (p_self->e_req_transport != tnet_turn_transport_tcp) {
- TSK_DEBUG_ERROR("TURN Connect not supported for UDP relay");
- ret = -6;
- goto bail;
- }
+ // Connect must be used for streams (e.g. TCP, TLS....) only
+ if (p_self->e_req_transport != tnet_turn_transport_tcp) {
+ TSK_DEBUG_ERROR("TURN Connect not supported for UDP relay");
+ ret = -6;
+ goto bail;
+ }
- // create Connect Request if doesn't exist (Connect refresh *must* have same id)
- pc_peer->e_connect_state = tnet_stun_state_none;
- pc_peer->e_connbind_state = tnet_stun_state_none;
- if (!pc_peer->p_pkt_connect) {
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_connect_request, &pc_peer->p_pkt_connect))) {
- TSK_DEBUG_ERROR("Failed to create TURN Connect request");
- goto bail;
- }
- // add authentication info
- tnet_stun_pkt_auth_copy(pc_peer->p_pkt_connect, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
- // add attributes
- pc_peer->p_pkt_connect->opt.dontfrag = 0;
- ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_connect,
- /* Must not add LIFETIME and there is no way to delete permission */
- TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
-
- }
- else {
- if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_connect->transac_id))) {
- goto bail;
- }
- }
-
- if ((ret = _tnet_turn_session_send_pkt(p_self, pc_peer->p_pkt_connect))) {
- goto bail;
- }
- pc_peer->e_connect_state = tnet_stun_state_trying;
+ // create Connect Request if doesn't exist (Connect refresh *must* have same id)
+ pc_peer->e_connect_state = tnet_stun_state_none;
+ pc_peer->e_connbind_state = tnet_stun_state_none;
+ if (!pc_peer->p_pkt_connect) {
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_connect_request, &pc_peer->p_pkt_connect))) {
+ TSK_DEBUG_ERROR("Failed to create TURN Connect request");
+ goto bail;
+ }
+ // add authentication info
+ tnet_stun_pkt_auth_copy(pc_peer->p_pkt_connect, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ // add attributes
+ pc_peer->p_pkt_connect->opt.dontfrag = 0;
+ ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_connect,
+ /* Must not add LIFETIME and there is no way to delete permission */
+ TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ }
+ else {
+ if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_connect->transac_id))) {
+ goto bail;
+ }
+ }
+
+ if ((ret = _tnet_turn_session_send_pkt(p_self, pc_peer->p_pkt_connect))) {
+ goto bail;
+ }
+ pc_peer->e_connect_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_send_data(tnet_turn_session_t* p_self, tnet_turn_peer_id_t u_peer_id, const void* pc_data_ptr, uint16_t u_data_size)
{
- int ret = 0;
- tnet_turn_peer_t* pc_peer;
+ int ret = 0;
+ tnet_turn_peer_t* pc_peer;
- if (!p_self || !pc_data_ptr || !u_data_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self || !pc_data_ptr || !u_data_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -3;
- goto bail;
- }
- if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
- ret = -4;
- goto bail;
- }
- if (pc_peer->e_createperm_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN permission for the remote peer");
- ret = -5;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -3;
+ goto bail;
+ }
+ if (!(pc_peer = (tnet_turn_peer_t *)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ TSK_DEBUG_ERROR("Cannot find TURN peer with id = %ld", u_peer_id);
+ ret = -4;
+ goto bail;
+ }
+ if (pc_peer->e_createperm_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN permission for the remote peer");
+ ret = -5;
+ goto bail;
+ }
- /** Send Stream **/
- if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type) && p_self->e_req_transport == tnet_turn_transport_tcp) {
- ret = _tnet_turn_session_send_stream_raw(p_self, pc_peer, pc_data_ptr, u_data_size);
- goto bail;
- }
+ /** Send Stream **/
+ if (TNET_SOCKET_TYPE_IS_STREAM(p_self->p_lcl_sock->type) && p_self->e_req_transport == tnet_turn_transport_tcp) {
+ ret = _tnet_turn_session_send_stream_raw(p_self, pc_peer, pc_data_ptr, u_data_size);
+ goto bail;
+ }
- /*** ChannelData ***/
- if (pc_peer->e_chanbind_state == tnet_stun_state_ok) {
- ret = _tnet_turn_session_send_chandata(p_self, pc_peer, pc_data_ptr, u_data_size);
- goto bail;
- }
+ /*** ChannelData ***/
+ if (pc_peer->e_chanbind_state == tnet_stun_state_ok) {
+ ret = _tnet_turn_session_send_chandata(p_self, pc_peer, pc_data_ptr, u_data_size);
+ goto bail;
+ }
+
+ /*** Send indication ***/
+ if (!pc_peer->p_pkt_sendind) {
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_send_indication, &pc_peer->p_pkt_sendind))) {
+ TSK_DEBUG_ERROR("Failed to create TURN SendIndication request");
+ goto bail;
+ }
+ pc_peer->p_pkt_sendind->opt.dontfrag = 0;
+ // add authinfo
+ tnet_stun_pkt_auth_copy(pc_peer->p_pkt_sendind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ // add attributes
+ ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_sendind,
+ TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
+ TNET_STUN_PKT_ATTR_ADD_DATA(pc_data_ptr, u_data_size),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ else {
+ const tnet_stun_attr_vdata_t *pc_attr_data;
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_peer->p_pkt_sendind, tnet_stun_attr_type_data, (const tnet_stun_attr_t**)&pc_attr_data))) {
+ goto bail;
+ }
+ if (!pc_attr_data) {
+ ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_sendind,
+ TNET_STUN_PKT_ATTR_ADD_DATA(pc_data_ptr, u_data_size),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ }
+ else {
+ if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr_data, pc_data_ptr, u_data_size))) {
+ goto bail;
+ }
+ }
+ if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_sendind->transac_id))) {
+ goto bail;
+ }
+ }
+ if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_peer->p_pkt_sendind))) {
+ goto bail;
+ }
- /*** Send indication ***/
- if (!pc_peer->p_pkt_sendind) {
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_send_indication, &pc_peer->p_pkt_sendind))) {
- TSK_DEBUG_ERROR("Failed to create TURN SendIndication request");
- goto bail;
- }
- pc_peer->p_pkt_sendind->opt.dontfrag = 0;
- // add authinfo
- tnet_stun_pkt_auth_copy(pc_peer->p_pkt_sendind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
- // add attributes
- ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_sendind,
- TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(pc_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, pc_peer->u_addr_port, &pc_peer->addr_ip),
- TNET_STUN_PKT_ATTR_ADD_DATA(pc_data_ptr, u_data_size),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- else {
- const tnet_stun_attr_vdata_t *pc_attr_data;
- if ((ret = tnet_stun_pkt_attr_find_first(pc_peer->p_pkt_sendind, tnet_stun_attr_type_data, (const tnet_stun_attr_t**)&pc_attr_data))) {
- goto bail;
- }
- if (!pc_attr_data) {
- ret = tnet_stun_pkt_attrs_add(pc_peer->p_pkt_sendind,
- TNET_STUN_PKT_ATTR_ADD_DATA(pc_data_ptr, u_data_size),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- }
- else {
- if ((ret = tnet_stun_attr_vdata_update((tnet_stun_attr_vdata_t*)pc_attr_data, pc_data_ptr, u_data_size))) {
- goto bail;
- }
- }
- if ((ret = tnet_stun_utils_transac_id_rand(&pc_peer->p_pkt_sendind->transac_id))) {
- goto bail;
- }
- }
- if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_peer->p_pkt_sendind))) {
- goto bail;
- }
-
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
int tnet_turn_session_is_active(const struct tnet_turn_session_s* pc_self, tnet_turn_peer_id_t u_peer_id, tsk_bool_t *pb_active)
{
- if (!pc_self || !pb_active) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- *pb_active = pc_self->b_started
- && (pc_self->e_alloc_state == tnet_stun_state_ok);
- if (*pb_active) {
- const tnet_turn_peer_t* pc_peer;
- if ((pc_peer = (const tnet_turn_peer_t *)tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- *pb_active = (pc_peer->e_createperm_state == tnet_stun_state_ok);
- }
- else {
- *pb_active = tsk_false;
- }
- }
- tsk_safeobj_unlock(pc_self);
- return 0;
+ if (!pc_self || !pb_active) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ *pb_active = pc_self->b_started
+ && (pc_self->e_alloc_state == tnet_stun_state_ok);
+ if (*pb_active) {
+ const tnet_turn_peer_t* pc_peer;
+ if ((pc_peer = (const tnet_turn_peer_t *)tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ *pb_active = (pc_peer->e_createperm_state == tnet_stun_state_ok);
+ }
+ else {
+ *pb_active = tsk_false;
+ }
+ }
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
int tnet_turn_session_is_stream(const struct tnet_turn_session_s* pc_self, tsk_bool_t *pb_stream)
{
- if (!pc_self || !pb_stream) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- *pb_stream = TNET_SOCKET_TYPE_IS_STREAM(pc_self->p_lcl_sock->type) ? tsk_true : tsk_false;
- tsk_safeobj_unlock(pc_self);
- return 0;
+ if (!pc_self || !pb_stream) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ *pb_stream = TNET_SOCKET_TYPE_IS_STREAM(pc_self->p_lcl_sock->type) ? tsk_true : tsk_false;
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
// Check "ConnectionBind" sent and underlaying socket is connected
int tnet_turn_session_is_stream_connected(const struct tnet_turn_session_s* pc_self, tnet_turn_peer_id_t u_peer_id, tsk_bool_t *pb_connected)
{
- if (!pc_self || !pb_connected) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(pc_self);
- *pb_connected = pc_self->b_started
- && (pc_self->e_alloc_state == tnet_stun_state_ok);
- if (*pb_connected) {
- const tnet_turn_peer_t* pc_peer;
- if ((pc_peer = (const tnet_turn_peer_t *)tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
- *pb_connected = (pc_peer->conn_fd != TNET_INVALID_FD && pc_peer->b_stream_connected && pc_peer->e_connbind_state == tnet_stun_state_ok);
- }
- else {
- *pb_connected = tsk_false;
- }
- }
- tsk_safeobj_unlock(pc_self);
- return 0;
+ if (!pc_self || !pb_connected) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(pc_self);
+ *pb_connected = pc_self->b_started
+ && (pc_self->e_alloc_state == tnet_stun_state_ok);
+ if (*pb_connected) {
+ const tnet_turn_peer_t* pc_peer;
+ if ((pc_peer = (const tnet_turn_peer_t *)tsk_list_find_object_by_pred(pc_self->p_list_peers, __pred_find_peer_by_id, &u_peer_id))) {
+ *pb_connected = (pc_peer->conn_fd != TNET_INVALID_FD && pc_peer->b_stream_connected && pc_peer->e_connbind_state == tnet_stun_state_ok);
+ }
+ else {
+ *pb_connected = tsk_false;
+ }
+ }
+ tsk_safeobj_unlock(pc_self);
+ return 0;
}
int tnet_turn_session_stop(tnet_turn_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- // FIXME
- // tsk_safeobj_lock(p_self);
+ // FIXME
+ // tsk_safeobj_lock(p_self);
- p_self->b_stopping = tsk_true;
+ p_self->b_stopping = tsk_true;
- if (p_self->e_alloc_state == tnet_stun_state_ok) {
- // UnAlloc
- p_self->u_lifetime_alloc_in_sec = 0;
- _tnet_turn_session_send_refresh(p_self);
- }
+ if (p_self->e_alloc_state == tnet_stun_state_ok) {
+ // UnAlloc
+ p_self->u_lifetime_alloc_in_sec = 0;
+ _tnet_turn_session_send_refresh(p_self);
+ }
- if (p_self->timer.p_mgr) {
- ret = tsk_timer_manager_stop(p_self->timer.p_mgr);
- }
+ if (p_self->timer.p_mgr) {
+ ret = tsk_timer_manager_stop(p_self->timer.p_mgr);
+ }
- // free transport to force next call to prepare() to create new one with new sockets
+ // free transport to force next call to prepare() to create new one with new sockets
if (p_self->p_transport) {
tnet_transport_shutdown(p_self->p_transport);
TSK_OBJECT_SAFE_FREE(p_self->p_transport);
}
- // clear peers
- tsk_list_clear_items(p_self->p_list_peers);
+ // clear peers
+ tsk_list_clear_items(p_self->p_list_peers);
- p_self->b_prepared = tsk_false;
- p_self->b_started = tsk_false;
- p_self->b_stopping = tsk_false;
+ p_self->b_prepared = tsk_false;
+ p_self->b_started = tsk_false;
+ p_self->b_stopping = tsk_false;
- // tsk_safeobj_unlock(p_self);
+ // tsk_safeobj_unlock(p_self);
- return ret;
+ return ret;
}
static int _tnet_turn_session_peer_find_by_id(const tnet_turn_session_t* pc_self, tnet_turn_peer_id_t id, const struct tnet_turn_peer_s **ppc_peer)
{
- const tsk_list_item_t *pc_item;
- const struct tnet_turn_peer_s *pc_peer;
- if (!pc_self || !ppc_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_peer = tsk_null;
- tsk_list_foreach(pc_item, pc_self->p_list_peers) {
- if (!(pc_peer = pc_item->data)) {
- continue;
- }
- if (pc_peer->id == id) {
- *ppc_peer = pc_peer;
- break;
- }
- }
- return 0;
+ const tsk_list_item_t *pc_item;
+ const struct tnet_turn_peer_s *pc_peer;
+ if (!pc_self || !ppc_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_peer = tsk_null;
+ tsk_list_foreach(pc_item, pc_self->p_list_peers) {
+ if (!(pc_peer = pc_item->data)) {
+ continue;
+ }
+ if (pc_peer->id == id) {
+ *ppc_peer = pc_peer;
+ break;
+ }
+ }
+ return 0;
}
static int _tnet_turn_session_peer_find_by_timer(const tnet_turn_session_t* pc_self, tsk_timer_id_t id, const struct tnet_turn_peer_s **ppc_peer)
{
- const tsk_list_item_t *pc_item;
- const struct tnet_turn_peer_s *pc_peer;
- if (!pc_self || !ppc_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_peer = tsk_null;
- tsk_list_foreach(pc_item, pc_self->p_list_peers) {
- if (!(pc_peer = pc_item->data)) {
- continue;
- }
- if (pc_peer->timer.rtt.chanbind.id == id || pc_peer->timer.rtt.createperm.id == id) {
- *ppc_peer = pc_peer;
- break;
- }
- }
- return 0;
+ const tsk_list_item_t *pc_item;
+ const struct tnet_turn_peer_s *pc_peer;
+ if (!pc_self || !ppc_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_peer = tsk_null;
+ tsk_list_foreach(pc_item, pc_self->p_list_peers) {
+ if (!(pc_peer = pc_item->data)) {
+ continue;
+ }
+ if (pc_peer->timer.rtt.chanbind.id == id || pc_peer->timer.rtt.createperm.id == id) {
+ *ppc_peer = pc_peer;
+ break;
+ }
+ }
+ return 0;
}
static uint16_t _tnet_turn_session_get_unique_chan_num()
{
- // rfc5766 - The channel number is in the range 0x4000 through 0x7FFE (inclusive)
- static long __l_chan_num = 0;
- tsk_atomic_inc(&__l_chan_num);
- return (__l_chan_num % (0x7FFE - 0x4000)) + 0x4000;
+ // rfc5766 - The channel number is in the range 0x4000 through 0x7FFE (inclusive)
+ static long __l_chan_num = 0;
+ tsk_atomic_inc(&__l_chan_num);
+ return (__l_chan_num % (0x7FFE - 0x4000)) + 0x4000;
}
static int _tnet_turn_session_send_chandata(tnet_turn_session_t* p_self, const tnet_turn_peer_t* pc_peer, const void* pc_buff_ptr, tsk_size_t u_buff_size)
{
- int ret = 0;
- tsk_size_t PadSize, NeededSize;
- uint8_t* _p_buff_chandata_ptr;
+ int ret = 0;
+ tsk_size_t PadSize, NeededSize;
+ uint8_t* _p_buff_chandata_ptr;
if (!p_self || !pc_peer || !pc_buff_ptr || !u_buff_size) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -1257,45 +1267,45 @@ static int _tnet_turn_session_send_chandata(tnet_turn_session_t* p_self, const t
ret = -2;
goto bail;
}
- if (pc_peer->e_chanbind_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN data channel for peer id = %ld", pc_peer->id);
+ if (pc_peer->e_chanbind_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN data channel for peer id = %ld", pc_peer->id);
ret = -3;
goto bail;
}
- // rfc5766 - 11.5. Sending a ChannelData Message
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- // Over UDP, the padding is not required but MAY be included.
- PadSize = 0;
- }
- else {
- // Over TCP and TLS-over-TCP, the ChannelData message MUST be padded to
- // a multiple of four bytes in order to ensure the alignment of subsequent messages.
- PadSize = (u_buff_size & 0x03) ? (4 - (u_buff_size & 0x03)) : 0;
- }
- NeededSize = kStunChannelDataHdrSizeInOctets + u_buff_size + PadSize;
-
- if (p_self->u_buff_chandata_size < NeededSize) {
- if (!(p_self->p_buff_chandata_ptr = tsk_realloc(p_self->p_buff_chandata_ptr, NeededSize))) {
- p_self->u_buff_chandata_size = 0;
- ret = -4;
- goto bail;
- }
- p_self->u_buff_chandata_size = NeededSize;
- }
- _p_buff_chandata_ptr = (uint8_t*)p_self->p_buff_chandata_ptr;
+ // rfc5766 - 11.5. Sending a ChannelData Message
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ // Over UDP, the padding is not required but MAY be included.
+ PadSize = 0;
+ }
+ else {
+ // Over TCP and TLS-over-TCP, the ChannelData message MUST be padded to
+ // a multiple of four bytes in order to ensure the alignment of subsequent messages.
+ PadSize = (u_buff_size & 0x03) ? (4 - (u_buff_size & 0x03)) : 0;
+ }
+ NeededSize = kStunChannelDataHdrSizeInOctets + u_buff_size + PadSize;
- *((uint16_t*)&_p_buff_chandata_ptr[0]) = tnet_htons(pc_peer->u_chan_num); // Channel Number
- *((uint16_t*)&_p_buff_chandata_ptr[2]) = tnet_htons((uint16_t)u_buff_size); // Length
- memcpy(&_p_buff_chandata_ptr[kStunChannelDataHdrSizeInOctets], pc_buff_ptr, u_buff_size); // Application Data
- if (PadSize) {
- memset(&_p_buff_chandata_ptr[kStunChannelDataHdrSizeInOctets + u_buff_size], 0, PadSize); // Set padding bytes to zero (not required but ease debugging)
- }
+ if (p_self->u_buff_chandata_size < NeededSize) {
+ if (!(p_self->p_buff_chandata_ptr = tsk_realloc(p_self->p_buff_chandata_ptr, NeededSize))) {
+ p_self->u_buff_chandata_size = 0;
+ ret = -4;
+ goto bail;
+ }
+ p_self->u_buff_chandata_size = NeededSize;
+ }
+ _p_buff_chandata_ptr = (uint8_t*)p_self->p_buff_chandata_ptr;
+
+ *((uint16_t*)&_p_buff_chandata_ptr[0]) = tnet_htons(pc_peer->u_chan_num); // Channel Number
+ *((uint16_t*)&_p_buff_chandata_ptr[2]) = tnet_htons((uint16_t)u_buff_size); // Length
+ memcpy(&_p_buff_chandata_ptr[kStunChannelDataHdrSizeInOctets], pc_buff_ptr, u_buff_size); // Application Data
+ if (PadSize) {
+ memset(&_p_buff_chandata_ptr[kStunChannelDataHdrSizeInOctets + u_buff_size], 0, PadSize); // Set padding bytes to zero (not required but ease debugging)
+ }
+
+ if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, p_self->p_buff_chandata_ptr, NeededSize))) {
+ goto bail;
+ }
- if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, p_self->p_buff_chandata_ptr, NeededSize))) {
- goto bail;
- }
-
bail:
// unlock()
tsk_safeobj_unlock(p_self);
@@ -1304,7 +1314,7 @@ bail:
static int _tnet_turn_session_send_stream_raw(tnet_turn_session_t* p_self, tnet_turn_peer_t* pc_peer, const void* pc_buff_ptr, tsk_size_t u_buff_size)
{
- int ret = 0;
+ int ret = 0;
if (!p_self || !pc_peer || !pc_buff_ptr || !u_buff_size) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -1318,20 +1328,20 @@ static int _tnet_turn_session_send_stream_raw(tnet_turn_session_t* p_self, tnet_
ret = -2;
goto bail;
}
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- TSK_DEBUG_ERROR("Must not call this function for non-stream transports");
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ TSK_DEBUG_ERROR("Must not call this function for non-stream transports");
ret = -3;
goto bail;
- }
- if (pc_peer->e_connbind_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN TCP connection for peer id = %ld", pc_peer->id);
+ }
+ if (pc_peer->e_connbind_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN TCP connection for peer id = %ld", pc_peer->id);
ret = -4;
goto bail;
}
- if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, pc_buff_ptr, u_buff_size))) {
- goto bail;
- }
+ if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, pc_buff_ptr, u_buff_size))) {
+ goto bail;
+ }
bail:
// unlock()
@@ -1341,202 +1351,202 @@ bail:
static int _tnet_turn_session_send_refresh(tnet_turn_session_t* p_self)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
- p_self->e_refresh_state = tnet_stun_state_none;
- // create RefreshIndication Request
- p_self->timer.rtt.refresh.id = TSK_INVALID_TIMER_ID;
- TSK_OBJECT_SAFE_FREE(p_self->p_pkt_refresh);
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_refresh_request, &p_self->p_pkt_refresh))) {
- TSK_DEBUG_ERROR("Failed to create TURN RefreshIndication request");
- goto bail;
- }
- // add authentication info
- tnet_stun_pkt_auth_copy(p_self->p_pkt_refresh, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ p_self->e_refresh_state = tnet_stun_state_none;
+ // create RefreshIndication Request
+ p_self->timer.rtt.refresh.id = TSK_INVALID_TIMER_ID;
+ TSK_OBJECT_SAFE_FREE(p_self->p_pkt_refresh);
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_refresh_request, &p_self->p_pkt_refresh))) {
+ TSK_DEBUG_ERROR("Failed to create TURN RefreshIndication request");
+ goto bail;
+ }
+ // add authentication info
+ tnet_stun_pkt_auth_copy(p_self->p_pkt_refresh, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
#if 0
- if (p_self->u_lifetime_alloc_in_sec == 0) {
- const tnet_stun_attr_vdata_t *pc_attr_nonce = tsk_null;
- tnet_stun_pkt_attr_find_first(p_self->p_pkt_refresh, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce);
- if (pc_attr_nonce) {
- pc_attr_nonce->p_data_ptr[0] = 'a';
- }
- }
+ if (p_self->u_lifetime_alloc_in_sec == 0) {
+ const tnet_stun_attr_vdata_t *pc_attr_nonce = tsk_null;
+ tnet_stun_pkt_attr_find_first(p_self->p_pkt_refresh, tnet_stun_attr_type_nonce, (const tnet_stun_attr_t**)&pc_attr_nonce);
+ if (pc_attr_nonce) {
+ pc_attr_nonce->p_data_ptr[0] = 'a';
+ }
+ }
#endif
- // add attributes
- ret = tnet_stun_pkt_attrs_add(p_self->p_pkt_refresh,
- TNET_STUN_PKT_ATTR_ADD_LIFETIME(p_self->u_lifetime_alloc_in_sec),
- TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware), // recommended for Alloc and Refresh
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
- p_self->p_pkt_refresh->opt.dontfrag = 0;
- p_self->p_pkt_refresh->opt.fingerprint = 0;
- if ((ret = _tnet_turn_session_send_pkt(p_self, p_self->p_pkt_refresh))) {
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- p_self->timer.rtt.refresh.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_self->timer.rtt.refresh.id, p_self->timer.rtt.refresh.u_timeout);
- }
- p_self->e_refresh_state = tnet_stun_state_trying;
+ // add attributes
+ ret = tnet_stun_pkt_attrs_add(p_self->p_pkt_refresh,
+ TNET_STUN_PKT_ATTR_ADD_LIFETIME(p_self->u_lifetime_alloc_in_sec),
+ TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(kStunSoftware), // recommended for Alloc and Refresh
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+ p_self->p_pkt_refresh->opt.dontfrag = 0;
+ p_self->p_pkt_refresh->opt.fingerprint = 0;
+ if ((ret = _tnet_turn_session_send_pkt(p_self, p_self->p_pkt_refresh))) {
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ p_self->timer.rtt.refresh.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_self->timer.rtt.refresh.id, p_self->timer.rtt.refresh.u_timeout);
+ }
+ p_self->e_refresh_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int _tnet_turn_session_send_permission(struct tnet_turn_session_s* p_self, tnet_turn_peer_t *p_peer)
{
- int ret = 0;
- if (!p_self || !p_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(p_self);
+ int ret = 0;
+ if (!p_self || !p_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
+ tsk_safeobj_lock(p_self);
- // create CreatePermission Request
- p_peer->e_createperm_state = tnet_stun_state_none;
- p_peer->timer.rtt.createperm.id = TSK_INVALID_TIMER_ID;
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_createperm);
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_createpermission_request, &p_peer->p_pkt_createperm))) {
- TSK_DEBUG_ERROR("Failed to create TURN CreatePermission request");
- goto bail;
- }
- // add authinfo
- tnet_stun_pkt_auth_copy(p_peer->p_pkt_createperm, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
- // add attributes
- p_peer->p_pkt_createperm->opt.dontfrag = 0;
- ret = tnet_stun_pkt_attrs_add(p_peer->p_pkt_createperm,
- /* Must not add LIFETIME and there is no way to delete permission */
- TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(p_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, p_peer->u_addr_port, &p_peer->addr_ip),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
-
- if ((ret = _tnet_turn_session_send_pkt(p_self, p_peer->p_pkt_createperm))) {
- goto bail;
- }
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
- p_peer->timer.rtt.createperm.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_peer->timer.rtt.createperm.id, p_peer->timer.rtt.createperm.u_timeout);
- }
- p_peer->e_createperm_state = tnet_stun_state_trying;
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
+
+ // create CreatePermission Request
+ p_peer->e_createperm_state = tnet_stun_state_none;
+ p_peer->timer.rtt.createperm.id = TSK_INVALID_TIMER_ID;
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_createperm);
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_createpermission_request, &p_peer->p_pkt_createperm))) {
+ TSK_DEBUG_ERROR("Failed to create TURN CreatePermission request");
+ goto bail;
+ }
+ // add authinfo
+ tnet_stun_pkt_auth_copy(p_peer->p_pkt_createperm, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ // add attributes
+ p_peer->p_pkt_createperm->opt.dontfrag = 0;
+ ret = tnet_stun_pkt_attrs_add(p_peer->p_pkt_createperm,
+ /* Must not add LIFETIME and there is no way to delete permission */
+ TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(p_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, p_peer->u_addr_port, &p_peer->addr_ip),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ if ((ret = _tnet_turn_session_send_pkt(p_self, p_peer->p_pkt_createperm))) {
+ goto bail;
+ }
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ p_peer->timer.rtt.createperm.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, p_peer->timer.rtt.createperm.id, p_peer->timer.rtt.createperm.u_timeout);
+ }
+ p_peer->e_createperm_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
// TCP-Connect rfc6062 - 4.3. Initiating a Connection
static int _tnet_turn_session_send_connbind(struct tnet_turn_session_s* p_self, tnet_turn_peer_t *p_peer)
{
- int ret = 0;
+ int ret = 0;
- if (!p_self || !p_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!p_self || !p_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if (!p_self->b_started) {
- TSK_DEBUG_ERROR("TURN session not started yet");
- ret = -3;
- goto bail;
- }
- if (p_self->e_alloc_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN allocation yet");
- ret = -4;
- goto bail;
- }
+ if (!p_self->b_started) {
+ TSK_DEBUG_ERROR("TURN session not started yet");
+ ret = -3;
+ goto bail;
+ }
+ if (p_self->e_alloc_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN allocation yet");
+ ret = -4;
+ goto bail;
+ }
- // ConnectionBind must be sent after Connect
- if (p_peer->e_connect_state != tnet_stun_state_ok) {
- TSK_DEBUG_ERROR("No active TURN connection yet");
- ret = -6;
- goto bail;
- }
-
- // Connect must be used for streams (e.g. TCP, TLS....) only
- if (p_self->e_req_transport != tnet_turn_transport_tcp) {
- TSK_DEBUG_ERROR("TURN ConnectionBind not supported for UDP transport");
- ret = -7;
- goto bail;
- }
+ // ConnectionBind must be sent after Connect
+ if (p_peer->e_connect_state != tnet_stun_state_ok) {
+ TSK_DEBUG_ERROR("No active TURN connection yet");
+ ret = -6;
+ goto bail;
+ }
- // create Connect Request if doesn't exist (Connect refresh *must* have same id)
- p_peer->e_connbind_state = tnet_stun_state_none;
- if (!p_peer->p_pkt_connbind) {
- if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_connectionbind_request, &p_peer->p_pkt_connbind))) {
- TSK_DEBUG_ERROR("Failed to create TURN ConnectionBind request");
- goto bail;
- }
- // add authentication info
- tnet_stun_pkt_auth_copy(p_peer->p_pkt_connbind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
- // add attributes
- p_peer->p_pkt_connbind->opt.dontfrag = 0;
- ret = tnet_stun_pkt_attrs_add(p_peer->p_pkt_connbind,
- // Error "420" when XOR-PEER-ADDRESS attribute is added to ConnectionBind request
- /* TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(p_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, p_peer->u_addr_port, &p_peer->addr_ip), */
- TNET_STUN_PKT_ATTR_ADD_CONNECTION_ID(p_peer->u_conn_id),
- TNET_STUN_PKT_ATTR_ADD_NULL());
- if (ret) {
- goto bail;
- }
-
- }
- else {
- if ((ret = tnet_stun_utils_transac_id_rand(&p_peer->p_pkt_connbind->transac_id))) {
- goto bail;
- }
- }
-
- if ((ret = _tnet_turn_session_send_pkt_0(p_self, p_peer, p_peer->p_pkt_connbind))) {
- goto bail;
- }
- p_peer->e_connbind_state = tnet_stun_state_trying;
+ // Connect must be used for streams (e.g. TCP, TLS....) only
+ if (p_self->e_req_transport != tnet_turn_transport_tcp) {
+ TSK_DEBUG_ERROR("TURN ConnectionBind not supported for UDP transport");
+ ret = -7;
+ goto bail;
+ }
+
+ // create Connect Request if doesn't exist (Connect refresh *must* have same id)
+ p_peer->e_connbind_state = tnet_stun_state_none;
+ if (!p_peer->p_pkt_connbind) {
+ if ((ret = tnet_stun_pkt_create_empty(tnet_stun_pkt_type_connectionbind_request, &p_peer->p_pkt_connbind))) {
+ TSK_DEBUG_ERROR("Failed to create TURN ConnectionBind request");
+ goto bail;
+ }
+ // add authentication info
+ tnet_stun_pkt_auth_copy(p_peer->p_pkt_connbind, p_self->cred.p_usr_name, p_self->cred.p_pwd, p_self->p_pkt_alloc);
+ // add attributes
+ p_peer->p_pkt_connbind->opt.dontfrag = 0;
+ ret = tnet_stun_pkt_attrs_add(p_peer->p_pkt_connbind,
+ // Error "420" when XOR-PEER-ADDRESS attribute is added to ConnectionBind request
+ /* TNET_STUN_PKT_ATTR_ADD_XOR_PEER_ADDRESS(p_peer->b_ipv6 ? tnet_stun_address_family_ipv6 : tnet_stun_address_family_ipv4, p_peer->u_addr_port, &p_peer->addr_ip), */
+ TNET_STUN_PKT_ATTR_ADD_CONNECTION_ID(p_peer->u_conn_id),
+ TNET_STUN_PKT_ATTR_ADD_NULL());
+ if (ret) {
+ goto bail;
+ }
+
+ }
+ else {
+ if ((ret = tnet_stun_utils_transac_id_rand(&p_peer->p_pkt_connbind->transac_id))) {
+ goto bail;
+ }
+ }
+
+ if ((ret = _tnet_turn_session_send_pkt_0(p_self, p_peer, p_peer->p_pkt_connbind))) {
+ goto bail;
+ }
+ p_peer->e_connbind_state = tnet_stun_state_trying;
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int _tnet_turn_session_send_buff_0(tnet_turn_session_t* p_self, const tnet_turn_peer_t* pc_peer, const void* pc_buff_ptr, tsk_size_t u_buff_size)
{
int ret = 0;
- tsk_size_t u_sent_bytes = 0;
+ tsk_size_t u_sent_bytes = 0;
if (!p_self || !pc_buff_ptr || !u_buff_size) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
@@ -1551,28 +1561,28 @@ static int _tnet_turn_session_send_buff_0(tnet_turn_session_t* p_self, const tne
goto bail;
}
- if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
+ if (TNET_SOCKET_TYPE_IS_DGRAM(p_self->p_lcl_sock->type)) {
#if 1
- u_sent_bytes = tnet_transport_sendto(p_self->p_transport, p_self->p_lcl_sock->fd, (const struct sockaddr *)&p_self->srv_addr, pc_buff_ptr, u_buff_size);
+ u_sent_bytes = tnet_transport_sendto(p_self->p_transport, p_self->p_lcl_sock->fd, (const struct sockaddr *)&p_self->srv_addr, pc_buff_ptr, u_buff_size);
#else
- u_sent_bytes = tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr *)&p_self->srv_addr, pc_buff_ptr, u_buff_size);
+ u_sent_bytes = tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr *)&p_self->srv_addr, pc_buff_ptr, u_buff_size);
#endif
}
else {
- if (pc_peer && pc_peer->b_stream_connected && pc_peer->conn_fd != TNET_INVALID_FD) {
- // Send using Peer connection if connected
- // Should never be called because for now requested transport is always equal to UDP
+ if (pc_peer && pc_peer->b_stream_connected && pc_peer->conn_fd != TNET_INVALID_FD) {
+ // Send using Peer connection if connected
+ // Should never be called because for now requested transport is always equal to UDP
#if 1
- u_sent_bytes = tnet_transport_send(p_self->p_transport, pc_peer->conn_fd, pc_buff_ptr, u_buff_size);
+ u_sent_bytes = tnet_transport_send(p_self->p_transport, pc_peer->conn_fd, pc_buff_ptr, u_buff_size);
#else
- u_sent_bytes = tnet_sockfd_send(pc_peer->conn_fd, pc_buff_ptr, u_buff_size, 0);
+ u_sent_bytes = tnet_sockfd_send(pc_peer->conn_fd, pc_buff_ptr, u_buff_size, 0);
#endif
- }
- else {
+ }
+ else {
tsk_bool_t b_delay_send = tsk_false;
- // Connect if not already done
- if (!p_self->b_stream_connected) {
- ret = tnet_sockfd_waitUntilWritable(p_self->p_lcl_sock->fd, kTurnTransportConnectTimeout);
+ // Connect if not already done
+ if (!p_self->b_stream_connected) {
+ ret = tnet_sockfd_waitUntilWritable(p_self->p_lcl_sock->fd, kTurnTransportConnectTimeout);
if (ret == 0) { // socket is valid but not connected (e.g. Proxy handshaking not completed yet)
TSK_DEBUG_INFO("Saving %u TURN bytes and waiting for 'connected' event before sending", (unsigned)u_buff_size);
if (!p_self->p_stream_buff_out && !(p_self->p_stream_buff_out = tsk_buffer_create_null())) {
@@ -1594,17 +1604,17 @@ static int _tnet_turn_session_send_buff_0(tnet_turn_session_t* p_self, const tne
ret = -6;
goto bail;
}
- }
- if (!b_delay_send && p_self->b_stream_connected) {
+ }
+ if (!b_delay_send && p_self->b_stream_connected) {
#if 1
- u_sent_bytes = tnet_transport_send(p_self->p_transport, p_self->p_lcl_sock->fd, pc_buff_ptr, u_buff_size);
+ u_sent_bytes = tnet_transport_send(p_self->p_transport, p_self->p_lcl_sock->fd, pc_buff_ptr, u_buff_size);
#else
- u_sent_bytes = tnet_socket_send_stream(p_self->p_lcl_sock, pc_buff_ptr, u_buff_size);
+ u_sent_bytes = tnet_socket_send_stream(p_self->p_lcl_sock, pc_buff_ptr, u_buff_size);
#endif
- }
- }
+ }
+ }
}
- if (u_sent_bytes != u_buff_size) {
+ if (u_sent_bytes != u_buff_size) {
TSK_DEBUG_ERROR("Failed to send %u bytes. Only %u sent", (unsigned)u_buff_size, (unsigned)u_sent_bytes);
ret = -2;
goto bail;
@@ -1618,21 +1628,21 @@ bail:
static int _tnet_turn_session_send_buff(tnet_turn_session_t* p_self, const void* pc_buff_ptr, tsk_size_t u_buff_size)
{
- return _tnet_turn_session_send_buff_0(p_self, tsk_null/*peer*/, pc_buff_ptr, u_buff_size);
+ return _tnet_turn_session_send_buff_0(p_self, tsk_null/*peer*/, pc_buff_ptr, u_buff_size);
}
static int _tnet_turn_session_send_pkt_0(tnet_turn_session_t* p_self, const tnet_turn_peer_t* pc_peer, const tnet_turn_pkt_t *pc_pkt)
{
- int ret;
- tsk_size_t u_min_size;
- if (!p_self || !pc_pkt) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ int ret;
+ tsk_size_t u_min_size;
+ if (!p_self || !pc_pkt) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(p_self);
+ tsk_safeobj_lock(p_self);
- if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_pkt, &u_min_size))) {
+ if ((ret = tnet_stun_pkt_get_size_in_octetunits_with_padding(pc_pkt, &u_min_size))) {
goto bail;
}
u_min_size += kStunBuffMinPad;
@@ -1649,32 +1659,32 @@ static int _tnet_turn_session_send_pkt_0(tnet_turn_session_t* p_self, const tnet
if ((ret = tnet_stun_pkt_write_with_padding(pc_pkt, p_self->p_buff_send_ptr, p_self->u_buff_send_size, &u_min_size))) {
goto bail;
}
- if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, p_self->p_buff_send_ptr, u_min_size))) {
- goto bail;
- }
+ if ((ret = _tnet_turn_session_send_buff_0(p_self, pc_peer, p_self->p_buff_send_ptr, u_min_size))) {
+ goto bail;
+ }
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int _tnet_turn_session_send_pkt(tnet_turn_session_t* p_self, const tnet_turn_pkt_t *pc_pkt)
{
- return _tnet_turn_session_send_pkt_0(p_self, tsk_null/*peer*/, pc_pkt);
+ return _tnet_turn_session_send_pkt_0(p_self, tsk_null/*peer*/, pc_pkt);
}
// 420 = Unknown Attribute
int _tnet_turn_session_process_err420_pkt(tnet_turn_pkt_t *p_pkt_req, const tnet_turn_pkt_t *pc_pkt_resp420)
{
- const tnet_stun_attr_vdata_t* pc_attr;
- uint16_t u16;
- int ret;
- tsk_bool_t b_done = tsk_false;
- if (!p_pkt_req || !pc_pkt_resp420) {
- TSK_DEBUG_ERROR("Invalid parameter");
+ const tnet_stun_attr_vdata_t* pc_attr;
+ uint16_t u16;
+ int ret;
+ tsk_bool_t b_done = tsk_false;
+ if (!p_pkt_req || !pc_pkt_resp420) {
+ TSK_DEBUG_ERROR("Invalid parameter");
return -1;
- }
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt_resp420, tnet_stun_attr_type_unknown_attrs, (const tnet_stun_attr_t**)&pc_attr))) {
+ }
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt_resp420, tnet_stun_attr_type_unknown_attrs, (const tnet_stun_attr_t**)&pc_attr))) {
goto bail;
}
if (!pc_attr || !pc_attr->p_data_ptr || (pc_attr->u_data_size & 1)) {
@@ -1682,288 +1692,284 @@ int _tnet_turn_session_process_err420_pkt(tnet_turn_pkt_t *p_pkt_req, const tnet
ret = -3;
goto bail;
}
- for (u16 = 0; u16 < pc_attr->u_data_size; u16+=2) {
- switch (*((uint16_t*)&pc_attr->p_data_ptr[u16])) {
- case tnet_stun_attr_type_dont_fragment:
- {
- p_pkt_req->opt.dontfrag = 0;
- b_done = tsk_true;
- break;
- }
- case tnet_stun_attr_type_fingerprint:
- {
- p_pkt_req->opt.fingerprint = 0;
- b_done = tsk_true;
- break;
- }
- }
- }
+ for (u16 = 0; u16 < pc_attr->u_data_size; u16+=2) {
+ switch (*((uint16_t*)&pc_attr->p_data_ptr[u16])) {
+ case tnet_stun_attr_type_dont_fragment: {
+ p_pkt_req->opt.dontfrag = 0;
+ b_done = tsk_true;
+ break;
+ }
+ case tnet_stun_attr_type_fingerprint: {
+ p_pkt_req->opt.fingerprint = 0;
+ b_done = tsk_true;
+ break;
+ }
+ }
+ }
- if (b_done) {
- // TRANSACTION-ID
- if ((ret = tnet_stun_utils_transac_id_rand(&p_pkt_req->transac_id))) {
- goto bail;
- }
- }
+ if (b_done) {
+ // TRANSACTION-ID
+ if ((ret = tnet_stun_utils_transac_id_rand(&p_pkt_req->transac_id))) {
+ goto bail;
+ }
+ }
bail:
- return ret;
+ return ret;
}
static int _tnet_turn_session_process_incoming_pkt(struct tnet_turn_session_s* p_self, const tnet_turn_pkt_t *pc_pkt, tsk_bool_t *pb_processed)
{
- int ret = 0;
+ int ret = 0;
if (!p_self || !pc_pkt || !pb_processed) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- *pb_processed = tsk_false;
+ *pb_processed = tsk_false;
// lock()
tsk_safeobj_lock(p_self);
- switch (pc_pkt->e_type) {
- case tnet_stun_pkt_type_allocate_success_response:
- case tnet_stun_pkt_type_allocate_error_response:
- case tnet_stun_pkt_type_createpermission_success_response:
- case tnet_stun_pkt_type_createpermission_error_response:
- case tnet_stun_pkt_type_channelbind_success_response:
- case tnet_stun_pkt_type_channelbind_error_response:
- case tnet_stun_pkt_type_refresh_success_response:
- case tnet_stun_pkt_type_refresh_error_response:
- case tnet_stun_pkt_type_connect_success_response:
- case tnet_stun_pkt_type_connect_error_response:
- case tnet_stun_pkt_type_connectionbind_success_response:
- case tnet_stun_pkt_type_connectionbind_error_response:
- {
- const tnet_stun_attr_error_code_t* pc_attr_err = tsk_null;
- uint16_t u_code = 0;
- tnet_turn_pkt_t *pc_pkt_req = tsk_null;
- tnet_turn_peer_t* pc_peer = tsk_null;
-
+ switch (pc_pkt->e_type) {
+ case tnet_stun_pkt_type_allocate_success_response:
+ case tnet_stun_pkt_type_allocate_error_response:
+ case tnet_stun_pkt_type_createpermission_success_response:
+ case tnet_stun_pkt_type_createpermission_error_response:
+ case tnet_stun_pkt_type_channelbind_success_response:
+ case tnet_stun_pkt_type_channelbind_error_response:
+ case tnet_stun_pkt_type_refresh_success_response:
+ case tnet_stun_pkt_type_refresh_error_response:
+ case tnet_stun_pkt_type_connect_success_response:
+ case tnet_stun_pkt_type_connect_error_response:
+ case tnet_stun_pkt_type_connectionbind_success_response:
+ case tnet_stun_pkt_type_connectionbind_error_response: {
+ const tnet_stun_attr_error_code_t* pc_attr_err = tsk_null;
+ uint16_t u_code = 0;
+ tnet_turn_pkt_t *pc_pkt_req = tsk_null;
+ tnet_turn_peer_t* pc_peer = tsk_null;
+
#define CANCEL_TIMER(parent, which) \
if (TSK_TIMER_ID_IS_VALID(parent->timer.rtt.which.id)) { \
tsk_timer_manager_cancel(p_self->timer.p_mgr, parent->timer.rtt.which.id); \
parent->timer.rtt.which.id = TSK_INVALID_TIMER_ID; \
}
- // Find request
- if (p_self->p_pkt_alloc && tnet_stun_utils_transac_id_cmp(p_self->p_pkt_alloc->transac_id, pc_pkt->transac_id) == 0) {
- pc_pkt_req = p_self->p_pkt_alloc;
- CANCEL_TIMER(p_self, alloc);
- CANCEL_TIMER(p_self, refresh);
- }
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_createperm, &pc_pkt->transac_id))) {
- pc_pkt_req = pc_peer->p_pkt_createperm;
- CANCEL_TIMER(pc_peer, createperm);
- }
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_sendind, &pc_pkt->transac_id))) {
- pc_pkt_req = pc_peer->p_pkt_sendind;
- }
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_chanbind, &pc_pkt->transac_id))) {
- pc_pkt_req = pc_peer->p_pkt_chanbind;
- CANCEL_TIMER(pc_peer, chanbind);
- }
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_connect, &pc_pkt->transac_id))) {
- pc_pkt_req = pc_peer->p_pkt_connect;
- // TCP: no timer
- }
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_connectionbind, &pc_pkt->transac_id))) {
- pc_pkt_req = pc_peer->p_pkt_connbind;
- // TCP: no timer
- }
- else if (p_self->p_pkt_refresh && tnet_stun_utils_transac_id_cmp(p_self->p_pkt_refresh->transac_id, pc_pkt->transac_id) == 0) {
- pc_pkt_req = p_self->p_pkt_refresh;
- CANCEL_TIMER(p_self, refresh);
- }
-
- if (!pc_pkt_req) {
- TSK_DEBUG_INFO("No matching request[TID=%s]", pc_pkt->transac_id);
- // Not an error as the "fd" could be shared by several processes (e.g. ICE)
- goto bail;
- }
-
- /*** SUCCESS ***/
- if (TNET_STUN_PKT_RESP_IS_SUCCESS(pc_pkt)) {
- // --- ALLOC --- //
- if (pc_pkt_req == p_self->p_pkt_alloc) {
- const tnet_stun_attr_address_t *pc_attr_addr;
- tnet_ip_t ip_addr;
- const tnet_stun_attr_vdata_t *pc_attr_lifetime;
- // XOR-MAPPED-ADDRESS (optional)
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t**)&pc_attr_addr)) == 0 && pc_attr_addr) {
- if ((ret = tnet_stun_utils_inet_ntop((pc_attr_addr->e_family == tnet_stun_address_family_ipv6), &pc_attr_addr->address, &ip_addr)) == 0) {
- p_self->b_srflx_ipv6 = (pc_attr_addr->e_family == tnet_stun_address_family_ipv6);
- p_self->u_srflx_port = pc_attr_addr->u_port;
- tsk_strupdate(&p_self->p_srflx_ip, ip_addr);
- }
- }
- // LIFETIME (optional)
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_lifetime, (const tnet_stun_attr_t**)&pc_attr_lifetime)) == 0 && pc_attr_lifetime && pc_attr_lifetime->u_data_size == 4) {
- p_self->u_lifetime_alloc_in_sec = TSK_TO_UINT32(pc_attr_lifetime->p_data_ptr);
- }
- // XOR-RELAYED-ADDRESS (required)
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_relayed_address, (const tnet_stun_attr_t**)&pc_attr_addr))) {
- _tnet_turn_session_raise_event_alloc_nok(p_self);
- goto bail;
- }
- if (!pc_attr_addr) {
- TSK_DEBUG_ERROR("XOR-RELAYED-ADDRESS missing in success response for Allocate");
- ret = -4;
- _tnet_turn_session_raise_event_alloc_nok(p_self);
- goto bail;
- }
- if ((ret = tnet_stun_utils_inet_ntop((pc_attr_addr->e_family == tnet_stun_address_family_ipv6), &pc_attr_addr->address, &ip_addr))) {
- _tnet_turn_session_raise_event_alloc_nok(p_self);
- goto bail;
- }
-
- // Uncomment to test [TURN Client] <-> [Turn Server] <-> [Any Client]
+ // Find request
+ if (p_self->p_pkt_alloc && tnet_stun_utils_transac_id_cmp(p_self->p_pkt_alloc->transac_id, pc_pkt->transac_id) == 0) {
+ pc_pkt_req = p_self->p_pkt_alloc;
+ CANCEL_TIMER(p_self, alloc);
+ CANCEL_TIMER(p_self, refresh);
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_createperm, &pc_pkt->transac_id))) {
+ pc_pkt_req = pc_peer->p_pkt_createperm;
+ CANCEL_TIMER(pc_peer, createperm);
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_sendind, &pc_pkt->transac_id))) {
+ pc_pkt_req = pc_peer->p_pkt_sendind;
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_chanbind, &pc_pkt->transac_id))) {
+ pc_pkt_req = pc_peer->p_pkt_chanbind;
+ CANCEL_TIMER(pc_peer, chanbind);
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_connect, &pc_pkt->transac_id))) {
+ pc_pkt_req = pc_peer->p_pkt_connect;
+ // TCP: no timer
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_self->p_list_peers, __pred_find_peer_by_transacid_connectionbind, &pc_pkt->transac_id))) {
+ pc_pkt_req = pc_peer->p_pkt_connbind;
+ // TCP: no timer
+ }
+ else if (p_self->p_pkt_refresh && tnet_stun_utils_transac_id_cmp(p_self->p_pkt_refresh->transac_id, pc_pkt->transac_id) == 0) {
+ pc_pkt_req = p_self->p_pkt_refresh;
+ CANCEL_TIMER(p_self, refresh);
+ }
+
+ if (!pc_pkt_req) {
+ TSK_DEBUG_INFO("No matching request[TID=%s]", pc_pkt->transac_id);
+ // Not an error as the "fd" could be shared by several processes (e.g. ICE)
+ goto bail;
+ }
+
+ /*** SUCCESS ***/
+ if (TNET_STUN_PKT_RESP_IS_SUCCESS(pc_pkt)) {
+ // --- ALLOC --- //
+ if (pc_pkt_req == p_self->p_pkt_alloc) {
+ const tnet_stun_attr_address_t *pc_attr_addr;
+ tnet_ip_t ip_addr;
+ const tnet_stun_attr_vdata_t *pc_attr_lifetime;
+ // XOR-MAPPED-ADDRESS (optional)
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_mapped_address, (const tnet_stun_attr_t**)&pc_attr_addr)) == 0 && pc_attr_addr) {
+ if ((ret = tnet_stun_utils_inet_ntop((pc_attr_addr->e_family == tnet_stun_address_family_ipv6), &pc_attr_addr->address, &ip_addr)) == 0) {
+ p_self->b_srflx_ipv6 = (pc_attr_addr->e_family == tnet_stun_address_family_ipv6);
+ p_self->u_srflx_port = pc_attr_addr->u_port;
+ tsk_strupdate(&p_self->p_srflx_ip, ip_addr);
+ }
+ }
+ // LIFETIME (optional)
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_lifetime, (const tnet_stun_attr_t**)&pc_attr_lifetime)) == 0 && pc_attr_lifetime && pc_attr_lifetime->u_data_size == 4) {
+ p_self->u_lifetime_alloc_in_sec = TSK_TO_UINT32(pc_attr_lifetime->p_data_ptr);
+ }
+ // XOR-RELAYED-ADDRESS (required)
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_relayed_address, (const tnet_stun_attr_t**)&pc_attr_addr))) {
+ _tnet_turn_session_raise_event_alloc_nok(p_self);
+ goto bail;
+ }
+ if (!pc_attr_addr) {
+ TSK_DEBUG_ERROR("XOR-RELAYED-ADDRESS missing in success response for Allocate");
+ ret = -4;
+ _tnet_turn_session_raise_event_alloc_nok(p_self);
+ goto bail;
+ }
+ if ((ret = tnet_stun_utils_inet_ntop((pc_attr_addr->e_family == tnet_stun_address_family_ipv6), &pc_attr_addr->address, &ip_addr))) {
+ _tnet_turn_session_raise_event_alloc_nok(p_self);
+ goto bail;
+ }
+
+ // Uncomment to test [TURN Client] <-> [Turn Server] <-> [Any Client]
#if 0
- {
- struct sockaddr_storage to;
- tnet_sockaddr_init(ip_addr, pc_attr_addr->u_port, p_self->p_lcl_sock->type, &to);
- tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr*)&to, "pinhole", 7); // open pinhole to allow incoming data
- tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr*)&to, "pinhole", 7); // open pinhole to allow incoming data
- }
+ {
+ struct sockaddr_storage to;
+ tnet_sockaddr_init(ip_addr, pc_attr_addr->u_port, p_self->p_lcl_sock->type, &to);
+ tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr*)&to, "pinhole", 7); // open pinhole to allow incoming data
+ tnet_sockfd_sendto(p_self->p_lcl_sock->fd, (const struct sockaddr*)&to, "pinhole", 7); // open pinhole to allow incoming data
+ }
#endif
- // Schedule refresh
- TNET_TURN_SESSION_TIMER_SCHEDULE_SEC(p_self, p_self->timer.u_timer_id_refresh, p_self->u_lifetime_alloc_in_sec);
-
- p_self->e_alloc_state = tnet_stun_state_ok;
- p_self->b_rel_ipv6 = (pc_attr_addr->e_family == tnet_stun_address_family_ipv6);
- p_self->u_rel_port = pc_attr_addr->u_port;
- tsk_strupdate(&p_self->p_rel_ip, ip_addr);
-
- _tnet_turn_session_raise_event_alloc_ok(p_self);
- }
- // --- CREATE-PERMISSION --- //
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_createpermission_request) {
- TSK_DEBUG_INFO("TURN 'CREATE-PERMISSION' OK for peer-id = %ld", pc_peer->id);
- pc_peer->e_createperm_state = tnet_stun_state_ok;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.fresh.createperm.id, pc_peer->timer.fresh.createperm.u_timeout);
- _tnet_turn_session_raise_event_createperm_ok(p_self, pc_peer->id);
- }
- // --- CHANNEL-BIND --- //
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_channelbind_request) {
- TSK_DEBUG_INFO("TURN 'CHANNEL-BIND' OK for peer-id = %ld", pc_peer->id);
- pc_peer->e_chanbind_state = tnet_stun_state_ok;
- TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.fresh.chanbind.id, pc_peer->timer.fresh.chanbind.u_timeout);
- _tnet_turn_session_raise_event_chanbind_ok(p_self, pc_peer->id);
- }
- // --- CONNECT --- //
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_connect_request) {
- TSK_DEBUG_INFO("TURN 'CONNECT' OK for peer-id = %ld", pc_peer->id);
- if ((ret = _tnet_turn_session_process_success_connect_pkt(p_self, pc_peer, pc_pkt))) {
- goto bail;
- }
- }
- // --- CONNECTION-BIND --- //
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_connectionbind_request) {
- TSK_DEBUG_INFO("TURN 'CONNECTION-BIND' OK for peer-id = %ld", pc_peer->id);
- pc_peer->e_connbind_state = tnet_stun_state_ok;
- _tnet_turn_session_raise_event_connectionbind_ok(p_self, pc_peer->id);
- }
- // --- REFRESH --- //
- else if (pc_pkt_req == p_self->p_pkt_refresh) {
- const tnet_stun_attr_vdata_t *pc_attr_lifetime;
- TSK_DEBUG_INFO("TURN 'REFRESH' OK for peer-id = %ld", pc_peer ? pc_peer->id : -1);
- p_self->e_refresh_state = tnet_stun_state_ok;
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_lifetime, (const tnet_stun_attr_t**)&pc_attr_lifetime)) == 0 && pc_attr_lifetime && pc_attr_lifetime->u_data_size == 4) {
- p_self->u_lifetime_alloc_in_sec = TSK_TO_UINT32(pc_attr_lifetime->p_data_ptr);
- }
- TNET_TURN_SESSION_TIMER_SCHEDULE_SEC(p_self, p_self->timer.u_timer_id_refresh, p_self->u_lifetime_alloc_in_sec);
- _tnet_turn_session_raise_event_refresh_ok(p_self);
- }
- }
- /*** ERROR ***/
- else {
- tsk_bool_t b_nok = tsk_true;
- if ((ret = tnet_stun_pkt_get_errorcode(pc_pkt, &u_code))) {
- goto bail;
- }
- if (u_code > 299) {
- tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_error_code, (const tnet_stun_attr_t**)&pc_attr_err);
- }
- if (u_code == kStunErrCodeUnauthorized || u_code == kStunErrCodeStaleNonce) {
- if (u_code == kStunErrCodeUnauthorized) {
- // Make sure this is not an authentication failure (#2 401)
- // Do not send another req to avoid endless messages
- if ((tnet_stun_pkt_attr_exists(pc_pkt_req, tnet_stun_attr_type_message_integrity))) { // already has a MESSAGE-INTEGRITY?
- TSK_DEBUG_ERROR("TURN authentication failed");
- goto check_nok;
- // INDICATION messages cannot receive 401 responses
- }
- }
- if ((ret = tnet_stun_pkt_auth_prepare_2(pc_pkt_req, p_self->cred.p_usr_name, p_self->cred.p_pwd, pc_pkt))) {
- goto check_nok;
- }
- if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_pkt_req)) == 0) {
- b_nok = tsk_false; goto check_nok;
- }
- }
- else if (u_code == kStunErrCodeUnknownAttributes) {
- if((ret = _tnet_turn_session_process_err420_pkt(pc_pkt_req, pc_pkt))) {
- goto check_nok;
- }
- if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_pkt_req)) == 0) {
- b_nok = tsk_false; goto check_nok;
- }
- }
+ // Schedule refresh
+ TNET_TURN_SESSION_TIMER_SCHEDULE_SEC(p_self, p_self->timer.u_timer_id_refresh, p_self->u_lifetime_alloc_in_sec);
+
+ p_self->e_alloc_state = tnet_stun_state_ok;
+ p_self->b_rel_ipv6 = (pc_attr_addr->e_family == tnet_stun_address_family_ipv6);
+ p_self->u_rel_port = pc_attr_addr->u_port;
+ tsk_strupdate(&p_self->p_rel_ip, ip_addr);
+
+ _tnet_turn_session_raise_event_alloc_ok(p_self);
+ }
+ // --- CREATE-PERMISSION --- //
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_createpermission_request) {
+ TSK_DEBUG_INFO("TURN 'CREATE-PERMISSION' OK for peer-id = %ld", pc_peer->id);
+ pc_peer->e_createperm_state = tnet_stun_state_ok;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.fresh.createperm.id, pc_peer->timer.fresh.createperm.u_timeout);
+ _tnet_turn_session_raise_event_createperm_ok(p_self, pc_peer->id);
+ }
+ // --- CHANNEL-BIND --- //
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_channelbind_request) {
+ TSK_DEBUG_INFO("TURN 'CHANNEL-BIND' OK for peer-id = %ld", pc_peer->id);
+ pc_peer->e_chanbind_state = tnet_stun_state_ok;
+ TNET_TURN_SESSION_TIMER_SCHEDULE_MILLIS(p_self, pc_peer->timer.fresh.chanbind.id, pc_peer->timer.fresh.chanbind.u_timeout);
+ _tnet_turn_session_raise_event_chanbind_ok(p_self, pc_peer->id);
+ }
+ // --- CONNECT --- //
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_connect_request) {
+ TSK_DEBUG_INFO("TURN 'CONNECT' OK for peer-id = %ld", pc_peer->id);
+ if ((ret = _tnet_turn_session_process_success_connect_pkt(p_self, pc_peer, pc_pkt))) {
+ goto bail;
+ }
+ }
+ // --- CONNECTION-BIND --- //
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_connectionbind_request) {
+ TSK_DEBUG_INFO("TURN 'CONNECTION-BIND' OK for peer-id = %ld", pc_peer->id);
+ pc_peer->e_connbind_state = tnet_stun_state_ok;
+ _tnet_turn_session_raise_event_connectionbind_ok(p_self, pc_peer->id);
+ }
+ // --- REFRESH --- //
+ else if (pc_pkt_req == p_self->p_pkt_refresh) {
+ const tnet_stun_attr_vdata_t *pc_attr_lifetime;
+ TSK_DEBUG_INFO("TURN 'REFRESH' OK for peer-id = %ld", pc_peer ? pc_peer->id : -1);
+ p_self->e_refresh_state = tnet_stun_state_ok;
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_lifetime, (const tnet_stun_attr_t**)&pc_attr_lifetime)) == 0 && pc_attr_lifetime && pc_attr_lifetime->u_data_size == 4) {
+ p_self->u_lifetime_alloc_in_sec = TSK_TO_UINT32(pc_attr_lifetime->p_data_ptr);
+ }
+ TNET_TURN_SESSION_TIMER_SCHEDULE_SEC(p_self, p_self->timer.u_timer_id_refresh, p_self->u_lifetime_alloc_in_sec);
+ _tnet_turn_session_raise_event_refresh_ok(p_self);
+ }
+ }
+ /*** ERROR ***/
+ else {
+ tsk_bool_t b_nok = tsk_true;
+ if ((ret = tnet_stun_pkt_get_errorcode(pc_pkt, &u_code))) {
+ goto bail;
+ }
+ if (u_code > 299) {
+ tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_error_code, (const tnet_stun_attr_t**)&pc_attr_err);
+ }
+ if (u_code == kStunErrCodeUnauthorized || u_code == kStunErrCodeStaleNonce) {
+ if (u_code == kStunErrCodeUnauthorized) {
+ // Make sure this is not an authentication failure (#2 401)
+ // Do not send another req to avoid endless messages
+ if ((tnet_stun_pkt_attr_exists(pc_pkt_req, tnet_stun_attr_type_message_integrity))) { // already has a MESSAGE-INTEGRITY?
+ TSK_DEBUG_ERROR("TURN authentication failed");
+ goto check_nok;
+ // INDICATION messages cannot receive 401 responses
+ }
+ }
+ if ((ret = tnet_stun_pkt_auth_prepare_2(pc_pkt_req, p_self->cred.p_usr_name, p_self->cred.p_pwd, pc_pkt))) {
+ goto check_nok;
+ }
+ if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_pkt_req)) == 0) {
+ b_nok = tsk_false;
+ goto check_nok;
+ }
+ }
+ else if (u_code == kStunErrCodeUnknownAttributes) {
+ if((ret = _tnet_turn_session_process_err420_pkt(pc_pkt_req, pc_pkt))) {
+ goto check_nok;
+ }
+ if ((ret = _tnet_turn_session_send_pkt_0(p_self, pc_peer, pc_pkt_req)) == 0) {
+ b_nok = tsk_false;
+ goto check_nok;
+ }
+ }
check_nok:
- if (b_nok) {
- TSK_DEBUG_INFO("--- TURN response code = %hu, phrase = %s, peer-id=%ld, ---",
- u_code, pc_attr_err ? pc_attr_err->p_reason_phrase : "null", pc_peer ? pc_peer->id : -1);
- if (pc_pkt_req == p_self->p_pkt_alloc) {
- p_self->e_alloc_state = tnet_stun_state_nok;
- _tnet_turn_session_raise_event_alloc_nok(p_self);
- }
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_channelbind_request) {
- pc_peer->e_chanbind_state = tnet_stun_state_nok;
- _tnet_turn_session_raise_event_chanbind_nok(p_self, pc_peer->id);
- }
- else if (pc_pkt_req->e_type == tnet_stun_pkt_type_createpermission_request) {
- pc_peer->e_createperm_state = tnet_stun_state_nok;
- _tnet_turn_session_raise_event_createperm_nok(p_self, pc_peer->id);
- }
- else if (pc_pkt_req == p_self->p_pkt_refresh) {
- p_self->e_refresh_state = tnet_stun_state_nok;
- _tnet_turn_session_raise_event_refresh_nok(p_self);
- }
- }
- }
-
- break;
- }
- case tnet_stun_pkt_type_connectionattempt_indication:
- {
- // Indicates we already have an active connection
- const tnet_stun_attr_address_t *pc_attr_xor_peer_addr;
- tnet_turn_peer_t* pc_peer = tsk_null;
- // XOR-PEER-ADDRESS
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_peer_address, (const tnet_stun_attr_t**)&pc_attr_xor_peer_addr)) == 0 && pc_attr_xor_peer_addr) {
- if ((ret = _tnet_turn_peer_find_by_xpeer(p_self->p_list_peers, pc_attr_xor_peer_addr, (const tnet_turn_peer_t**)&pc_peer)) == 0 && pc_peer) {
- if ((ret = _tnet_turn_session_process_success_connect_pkt(p_self, pc_peer, pc_pkt))) {
- goto bail;
- }
- }
- }
- break;
- }
- case tnet_stun_pkt_type_data_indication:
- {
- TSK_DEBUG_ERROR("Unexpected code called"); // --> DATA-INDICATION must be handled in net-event
- break;
- }
- default:
- {
- goto bail;
- }
- }
+ if (b_nok) {
+ TSK_DEBUG_INFO("--- TURN response code = %hu, phrase = %s, peer-id=%ld, ---",
+ u_code, pc_attr_err ? pc_attr_err->p_reason_phrase : "null", pc_peer ? pc_peer->id : -1);
+ if (pc_pkt_req == p_self->p_pkt_alloc) {
+ p_self->e_alloc_state = tnet_stun_state_nok;
+ _tnet_turn_session_raise_event_alloc_nok(p_self);
+ }
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_channelbind_request) {
+ pc_peer->e_chanbind_state = tnet_stun_state_nok;
+ _tnet_turn_session_raise_event_chanbind_nok(p_self, pc_peer->id);
+ }
+ else if (pc_pkt_req->e_type == tnet_stun_pkt_type_createpermission_request) {
+ pc_peer->e_createperm_state = tnet_stun_state_nok;
+ _tnet_turn_session_raise_event_createperm_nok(p_self, pc_peer->id);
+ }
+ else if (pc_pkt_req == p_self->p_pkt_refresh) {
+ p_self->e_refresh_state = tnet_stun_state_nok;
+ _tnet_turn_session_raise_event_refresh_nok(p_self);
+ }
+ }
+ }
- *pb_processed = tsk_true;
+ break;
+ }
+ case tnet_stun_pkt_type_connectionattempt_indication: {
+ // Indicates we already have an active connection
+ const tnet_stun_attr_address_t *pc_attr_xor_peer_addr;
+ tnet_turn_peer_t* pc_peer = tsk_null;
+ // XOR-PEER-ADDRESS
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_xor_peer_address, (const tnet_stun_attr_t**)&pc_attr_xor_peer_addr)) == 0 && pc_attr_xor_peer_addr) {
+ if ((ret = _tnet_turn_peer_find_by_xpeer(p_self->p_list_peers, pc_attr_xor_peer_addr, (const tnet_turn_peer_t**)&pc_peer)) == 0 && pc_peer) {
+ if ((ret = _tnet_turn_session_process_success_connect_pkt(p_self, pc_peer, pc_pkt))) {
+ goto bail;
+ }
+ }
+ }
+ break;
+ }
+ case tnet_stun_pkt_type_data_indication: {
+ TSK_DEBUG_ERROR("Unexpected code called"); // --> DATA-INDICATION must be handled in net-event
+ break;
+ }
+ default: {
+ goto bail;
+ }
+ }
+
+ *pb_processed = tsk_true;
bail:
// unlock()
@@ -1974,38 +1980,38 @@ bail:
// "pc_pkt" could be "200 response" or "CONNECTATTEMP-INDICATION"
int _tnet_turn_session_process_success_connect_pkt(struct tnet_turn_session_s* p_self, tnet_turn_peer_t* pc_peer, const tnet_turn_pkt_t *pc_pkt)
{
- int ret = 0;
- const tnet_stun_attr_vdata_t *pc_attr_connection_id;
+ int ret = 0;
+ const tnet_stun_attr_vdata_t *pc_attr_connection_id;
if (!p_self || !pc_peer || !pc_pkt) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if (pc_pkt->e_type != tnet_stun_pkt_type_connectionattempt_indication && !TNET_STUN_PKT_RESP_IS_SUCCESS(pc_pkt)) {
- TSK_DEBUG_ERROR("Invalid packet type");
- ret = -2;
- goto bail;
- }
-
+ if (pc_pkt->e_type != tnet_stun_pkt_type_connectionattempt_indication && !TNET_STUN_PKT_RESP_IS_SUCCESS(pc_pkt)) {
+ TSK_DEBUG_ERROR("Invalid packet type");
+ ret = -2;
+ goto bail;
+ }
+
// lock()
tsk_safeobj_lock(p_self);
-
- if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_connection_id, (const tnet_stun_attr_t**)&pc_attr_connection_id)) == 0 && pc_attr_connection_id && pc_attr_connection_id->u_data_size == 4) {
- pc_peer->u_conn_id = TSK_TO_UINT32(pc_attr_connection_id->p_data_ptr);
- pc_peer->e_connect_state = tnet_stun_state_ok;
- _tnet_turn_session_raise_event_connect_ok(p_self, pc_peer->id);
- // Connect to the server and send "ConnectionBind" request using the "CONNECTION-ID" once connection is completed
- pc_peer->conn_fd = tnet_transport_connectto(p_self->p_transport, p_self->p_srv_host, p_self->u_srv_port, p_self->p_transport->type);
- if (pc_peer->conn_fd == TNET_INVALID_FD) {
- TSK_DEBUG_ERROR("Failed to connect to %s:%d", p_self->p_srv_host, p_self->u_srv_port);
- ret = -3;
- goto bail;
- }
- }
+
+ if ((ret = tnet_stun_pkt_attr_find_first(pc_pkt, tnet_stun_attr_type_connection_id, (const tnet_stun_attr_t**)&pc_attr_connection_id)) == 0 && pc_attr_connection_id && pc_attr_connection_id->u_data_size == 4) {
+ pc_peer->u_conn_id = TSK_TO_UINT32(pc_attr_connection_id->p_data_ptr);
+ pc_peer->e_connect_state = tnet_stun_state_ok;
+ _tnet_turn_session_raise_event_connect_ok(p_self, pc_peer->id);
+ // Connect to the server and send "ConnectionBind" request using the "CONNECTION-ID" once connection is completed
+ pc_peer->conn_fd = tnet_transport_connectto(p_self->p_transport, p_self->p_srv_host, p_self->u_srv_port, p_self->p_transport->type);
+ if (pc_peer->conn_fd == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect to %s:%d", p_self->p_srv_host, p_self->u_srv_port);
+ ret = -3;
+ goto bail;
+ }
+ }
bail:
- tsk_safeobj_unlock(p_self);
- return ret;
+ tsk_safeobj_unlock(p_self);
+ return ret;
}
static int _tnet_turn_session_transport_layer_dgram_cb(const tnet_transport_event_t* e)
@@ -2015,252 +2021,252 @@ static int _tnet_turn_session_transport_layer_dgram_cb(const tnet_transport_even
static int _tnet_turn_session_transport_layer_stream_cb(const tnet_transport_event_t* e)
{
- return _tnet_turn_session_transport_layer_process_cb(e);
+ return _tnet_turn_session_transport_layer_process_cb(e);
}
static int _tnet_turn_session_transport_layer_process_cb(const tnet_transport_event_t* e)
{
- tnet_turn_session_t* p_ss = (tnet_turn_session_t*)e->callback_data;
- int ret = 0;
- tnet_turn_pkt_t* p_pkt = tsk_null;
- tsk_buffer_t* p_stream_buff_in = tsk_null;
- const void* pc_data = tsk_null;
- tsk_size_t u_data_size = 0;
- tsk_bool_t b_stream = tsk_false, b_stream_appended = tsk_false, b_pkt_is_complete = tsk_false, b_got_msg= tsk_false;
- tnet_turn_peer_t* pc_peer = tsk_null;
- switch(e->type){
- case event_data:
- break;
- case event_brokenpipe:
- tsk_safeobj_lock(p_ss);
- if (p_ss->p_lcl_sock && e->local_fd == p_ss->p_lcl_sock->fd) {
- tnet_fd_t broken_fd = e->local_fd;
- tsk_bool_t registered_fd = !!tnet_transport_have_socket(p_ss->p_transport, broken_fd);
+ tnet_turn_session_t* p_ss = (tnet_turn_session_t*)e->callback_data;
+ int ret = 0;
+ tnet_turn_pkt_t* p_pkt = tsk_null;
+ tsk_buffer_t* p_stream_buff_in = tsk_null;
+ const void* pc_data = tsk_null;
+ tsk_size_t u_data_size = 0;
+ tsk_bool_t b_stream = tsk_false, b_stream_appended = tsk_false, b_pkt_is_complete = tsk_false, b_got_msg= tsk_false;
+ tnet_turn_peer_t* pc_peer = tsk_null;
+ switch(e->type) {
+ case event_data:
+ break;
+ case event_brokenpipe:
+ tsk_safeobj_lock(p_ss);
+ if (p_ss->p_lcl_sock && e->local_fd == p_ss->p_lcl_sock->fd) {
+ tnet_fd_t broken_fd = e->local_fd;
+ tsk_bool_t registered_fd = !!tnet_transport_have_socket(p_ss->p_transport, broken_fd);
+ if (registered_fd) {
+ tnet_transport_remove_socket(p_ss->p_transport, &broken_fd);
+ }
+ if (tnet_socket_handle_brokenpipe(p_ss->p_lcl_sock) == 0) {
if (registered_fd) {
- tnet_transport_remove_socket(p_ss->p_transport, &broken_fd);
- }
- if (tnet_socket_handle_brokenpipe(p_ss->p_lcl_sock) == 0) {
- if (registered_fd) {
- tnet_transport_add_socket(p_ss->p_transport, p_ss->p_lcl_sock->fd, p_ss->p_lcl_sock->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null);
- }
+ tnet_transport_add_socket(p_ss->p_transport, p_ss->p_lcl_sock->fd, p_ss->p_lcl_sock->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null);
}
}
+ }
+ tsk_safeobj_unlock(p_ss);
+ return 0;
+ case event_connected:
+ if (p_ss->p_lcl_sock && p_ss->p_lcl_sock->fd == e->local_fd) {
+ tsk_safeobj_lock(p_ss);
+ p_ss->b_stream_connected = tsk_true;
+ if (p_ss->p_stream_buff_out && p_ss->p_stream_buff_out->size > 0) {
+ TSK_DEBUG_INFO("Sending %u TURN pending bytes", (unsigned)p_ss->p_stream_buff_out->size);
+ _tnet_turn_session_send_buff(p_ss, p_ss->p_stream_buff_out->data, (uint16_t)p_ss->p_stream_buff_out->size);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_out);
+ }
tsk_safeobj_unlock(p_ss);
- return 0;
- case event_connected:
- if (p_ss->p_lcl_sock && p_ss->p_lcl_sock->fd == e->local_fd) {
- tsk_safeobj_lock(p_ss);
- p_ss->b_stream_connected = tsk_true;
- if (p_ss->p_stream_buff_out && p_ss->p_stream_buff_out->size > 0) {
- TSK_DEBUG_INFO("Sending %u TURN pending bytes", (unsigned)p_ss->p_stream_buff_out->size);
- _tnet_turn_session_send_buff(p_ss, p_ss->p_stream_buff_out->data, (uint16_t)p_ss->p_stream_buff_out->size);
- TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_out);
+ }
+ else {
+ tsk_safeobj_lock(p_ss);
+ pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
+ if (pc_peer) {
+ pc_peer->b_stream_connected = tsk_true;
+ // Send ConnectionBind
+ if ((ret = _tnet_turn_session_send_connbind(p_ss, pc_peer))) {
+ goto bail;
}
- tsk_safeobj_unlock(p_ss);
- }
- else {
- tsk_safeobj_lock(p_ss);
- pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
- if (pc_peer) {
- pc_peer->b_stream_connected = tsk_true;
- // Send ConnectionBind
- if ((ret = _tnet_turn_session_send_connbind(p_ss, pc_peer))) {
- goto bail;
- }
- }
- tsk_safeobj_unlock(p_ss);
- }
- return 0;
- case event_error:
- case event_closed:
- case event_removed:
- /* case event_removed: */
- if (p_ss->p_lcl_sock && p_ss->p_lcl_sock->fd == e->local_fd) {
- tsk_safeobj_lock(p_ss);
- p_ss->b_stream_connected = tsk_false;
- p_ss->b_stream_error = (e->type == event_error);
- TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_out);
- tsk_safeobj_unlock(p_ss);
- }
- else {
- tsk_safeobj_lock(p_ss);
- pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
- if (pc_peer) {
- pc_peer->b_stream_connected = tsk_false;
- pc_peer->conn_fd = TNET_INVALID_FD;
- }
- tsk_safeobj_unlock(p_ss);
- }
- return 0;
- default:
- return 0;
- }
+ }
+ tsk_safeobj_unlock(p_ss);
+ }
+ return 0;
+ case event_error:
+ case event_closed:
+ case event_removed:
+ /* case event_removed: */
+ if (p_ss->p_lcl_sock && p_ss->p_lcl_sock->fd == e->local_fd) {
+ tsk_safeobj_lock(p_ss);
+ p_ss->b_stream_connected = tsk_false;
+ p_ss->b_stream_error = (e->type == event_error);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_out);
+ tsk_safeobj_unlock(p_ss);
+ }
+ else {
+ tsk_safeobj_lock(p_ss);
+ pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
+ if (pc_peer) {
+ pc_peer->b_stream_connected = tsk_false;
+ pc_peer->conn_fd = TNET_INVALID_FD;
+ }
+ tsk_safeobj_unlock(p_ss);
+ }
+ return 0;
+ default:
+ return 0;
+ }
- /*** If the code reach this line it means we have to deal with a "NET-DATA-EVENT" ***/
+ /*** If the code reach this line it means we have to deal with a "NET-DATA-EVENT" ***/
- p_ss->cb.e.pc_enet = e;
- pc_data = e->data;
- u_data_size = e->size;
- b_stream = TNET_SOCKET_TYPE_IS_STREAM(p_ss->p_lcl_sock->type);
- b_stream_appended = tsk_false;
+ p_ss->cb.e.pc_enet = e;
+ pc_data = e->data;
+ u_data_size = e->size;
+ b_stream = TNET_SOCKET_TYPE_IS_STREAM(p_ss->p_lcl_sock->type);
+ b_stream_appended = tsk_false;
handle_data:
- b_got_msg = tsk_false;
-
- // TODO: /!\
- // - When the requested transport is TCP/TLS then we will receive RAW data on the connected peer socket which means no way to guess the end-of-the message
- // - No issue for when requested transport is UDP because we'll always have the data encapsulated in CHANNEL-DATA or DATA-INDICATION.
- if (b_stream) {
- if (!b_stream_appended) {
- tsk_safeobj_lock(p_ss);
- pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
- if (pc_peer) {
- p_stream_buff_in = tsk_object_ref(pc_peer->p_stream_buff_in);
- }
- else {
- p_stream_buff_in = tsk_object_ref(p_ss->p_stream_buff_in);
- }
- tsk_safeobj_unlock(p_ss);
-
- if ((ret = tsk_buffer_append(p_stream_buff_in, e->data, e->size))) {
- goto bail;
- }
- b_stream_appended = tsk_true;
- }
- // Guard
- if (p_stream_buff_in->size > kTurnStreamChunckMaxSize) {
- TSK_DEBUG_ERROR("Too much data in the stream buffer: %u", (unsigned)p_stream_buff_in->size);
- tsk_buffer_cleanup(p_stream_buff_in);
- goto bail;
- }
- pc_data = p_stream_buff_in->data;
- u_data_size = p_stream_buff_in->size;
- }
+ b_got_msg = tsk_false;
- if (!TNET_STUN_BUFF_IS_STUN2(((const uint8_t*)pc_data), u_data_size)) {
- // ChannelData ?
- if (TNET_STUN_BUFF_IS_CHANNEL_DATA(((const uint8_t*)pc_data), u_data_size)) {
- const uint8_t* _p_data = (const uint8_t*)pc_data;
- // Channel Number in [0x4000 - 0x7FFF]
- // rfc5766 - 11.6. Receiving a ChannelData Message
- // rfc5766 - 11.4. The ChannelData Message
- // If the message uses a value in the reserved range (0x8000 through 0xFFFF), then the message is silently discarded
- static const tsk_size_t kChannelDataHdrSize = 4; // Channel Number(2 bytes) + Length (2 bytes)
- uint16_t u_chan_num = tnet_ntohs_2(&_p_data[0]);
- if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_channum, &u_chan_num))) {
- uint16_t u_len = tnet_ntohs_2(&_p_data[2]);
- if (u_len <= (u_data_size - kChannelDataHdrSize)) {
- b_got_msg = tsk_true;
- _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer->id, &_p_data[kChannelDataHdrSize], u_len);
- if (p_stream_buff_in) {
- /* The padding is not reflected in the length
- field of the ChannelData message, so the actual size of a ChannelData
- message (including padding) is (4 + Length) rounded up to the nearest
- multiple of 4. Over UDP, the padding is not required but MAY be
- included.
- */
- tsk_size_t u_pad_len = (u_len & 3) ? (4 - (u_len & 3)) : 0;
- tsk_buffer_remove(p_stream_buff_in, 0, kChannelDataHdrSize + u_len + u_pad_len);
- }
- }
- else {
- TSK_DEBUG_INFO("TURN channel data too short");
- }
- }
- goto bail;
- } // if (TNET_STUN_BUFF_IS_CHANNEL_DATA...
-
- // Must never happen: Data must be received via CHANNEL-DATA or DATA-INDICATION
- TSK_DEBUG_INFO("Calling unexpected code :(");
-
- if (b_stream) {
- tsk_safeobj_lock(p_ss);
- pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
- tsk_safeobj_unlock(p_ss);
- }
- _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_data, u_data_size);
- if (p_stream_buff_in) {
- tsk_buffer_cleanup(p_stream_buff_in);
- }
- goto bail;
- } // if (!TNET_STUN_BUFF_IS_STUN2...
-
- /*** At this step it means we have a STUN packet in the buffer ***/
-
- // Make sure we have a complete packet in the buffer
- if (b_stream) {
- if ((ret = tnet_stun_pkt_is_complete(pc_data, u_data_size, &b_pkt_is_complete))) {
- goto bail;
- }
- if (!b_pkt_is_complete) {
- TSK_DEBUG_INFO("The stream length is too short to contains a complete STUN/TURN packet");
- goto bail;
- }
- }
+ // TODO: /!\
+ // - When the requested transport is TCP/TLS then we will receive RAW data on the connected peer socket which means no way to guess the end-of-the message
+ // - No issue for when requested transport is UDP because we'll always have the data encapsulated in CHANNEL-DATA or DATA-INDICATION.
+ if (b_stream) {
+ if (!b_stream_appended) {
+ tsk_safeobj_lock(p_ss);
+ pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
+ if (pc_peer) {
+ p_stream_buff_in = tsk_object_ref(pc_peer->p_stream_buff_in);
+ }
+ else {
+ p_stream_buff_in = tsk_object_ref(p_ss->p_stream_buff_in);
+ }
+ tsk_safeobj_unlock(p_ss);
- // Parse the packet
- if ((ret = tnet_stun_pkt_read(pc_data, u_data_size, &p_pkt))) {
- goto bail;
- }
+ if ((ret = tsk_buffer_append(p_stream_buff_in, e->data, e->size))) {
+ goto bail;
+ }
+ b_stream_appended = tsk_true;
+ }
+ // Guard
+ if (p_stream_buff_in->size > kTurnStreamChunckMaxSize) {
+ TSK_DEBUG_ERROR("Too much data in the stream buffer: %u", (unsigned)p_stream_buff_in->size);
+ tsk_buffer_cleanup(p_stream_buff_in);
+ goto bail;
+ }
+ pc_data = p_stream_buff_in->data;
+ u_data_size = p_stream_buff_in->size;
+ }
- // Remove the parsed data
- if (p_stream_buff_in && p_pkt) {
- tsk_size_t u_pad_len = (p_pkt->u_length & 3) ? (4 - (p_pkt->u_length & 3)) : 0;
- tsk_buffer_remove(p_stream_buff_in, 0, kStunPktHdrSizeInOctets + p_pkt->u_length + u_pad_len);
- }
+ if (!TNET_STUN_BUFF_IS_STUN2(((const uint8_t*)pc_data), u_data_size)) {
+ // ChannelData ?
+ if (TNET_STUN_BUFF_IS_CHANNEL_DATA(((const uint8_t*)pc_data), u_data_size)) {
+ const uint8_t* _p_data = (const uint8_t*)pc_data;
+ // Channel Number in [0x4000 - 0x7FFF]
+ // rfc5766 - 11.6. Receiving a ChannelData Message
+ // rfc5766 - 11.4. The ChannelData Message
+ // If the message uses a value in the reserved range (0x8000 through 0xFFFF), then the message is silently discarded
+ static const tsk_size_t kChannelDataHdrSize = 4; // Channel Number(2 bytes) + Length (2 bytes)
+ uint16_t u_chan_num = tnet_ntohs_2(&_p_data[0]);
+ if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_channum, &u_chan_num))) {
+ uint16_t u_len = tnet_ntohs_2(&_p_data[2]);
+ if (u_len <= (u_data_size - kChannelDataHdrSize)) {
+ b_got_msg = tsk_true;
+ _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer->id, &_p_data[kChannelDataHdrSize], u_len);
+ if (p_stream_buff_in) {
+ /* The padding is not reflected in the length
+ field of the ChannelData message, so the actual size of a ChannelData
+ message (including padding) is (4 + Length) rounded up to the nearest
+ multiple of 4. Over UDP, the padding is not required but MAY be
+ included.
+ */
+ tsk_size_t u_pad_len = (u_len & 3) ? (4 - (u_len & 3)) : 0;
+ tsk_buffer_remove(p_stream_buff_in, 0, kChannelDataHdrSize + u_len + u_pad_len);
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("TURN channel data too short");
+ }
+ }
+ goto bail;
+ } // if (TNET_STUN_BUFF_IS_CHANNEL_DATA...
- if (p_pkt) {
- b_got_msg = tsk_true;
- if (p_pkt->e_type == tnet_stun_pkt_type_data_indication) {
- const tnet_stun_attr_vdata_t *pc_attr_data;
- const tnet_stun_attr_address_t *pc_attr_xpeer;
- const tnet_turn_peer_t *pc_peer;
- // XOR-PEER-ADDRESS (required)
- if ((ret = tnet_stun_pkt_attr_find_first(p_pkt, tnet_stun_attr_type_xor_peer_address, (const tnet_stun_attr_t**)&pc_attr_xpeer)) || !pc_attr_xpeer) {
- TSK_DEBUG_ERROR("XOR-PEER-ADDRESS missing in DATA-INDICATION");
- ret = -4;
- goto bail;
- }
- tsk_safeobj_lock(p_ss); // lock to make sure the list will not be modified
- if ((ret = _tnet_turn_peer_find_by_xpeer(p_ss->p_list_peers, pc_attr_xpeer, &pc_peer))) {
- tsk_safeobj_unlock(p_ss);
- goto bail;
- }
- tsk_safeobj_unlock(p_ss); // unlock()
- // DATA (required)
- if ((ret = tnet_stun_pkt_attr_find_first(p_pkt, tnet_stun_attr_type_data, (const tnet_stun_attr_t**)&pc_attr_data)) || !pc_attr_data) {
- TSK_DEBUG_ERROR("DATA missing in DATA-INDICAION");
- ret = -4;
- goto bail;
- }
-
- _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_attr_data->p_data_ptr, pc_attr_data->u_data_size);
- }
- else {
- tsk_bool_t b_processed;
- if ((ret = _tnet_turn_session_process_incoming_pkt(p_ss, p_pkt, &b_processed))) {
- goto bail;
- }
- if (!b_processed) {
- const tnet_turn_peer_t *pc_peer;
- tsk_safeobj_lock(p_ss);
- pc_peer = (const tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
- tsk_safeobj_unlock(p_ss); // unlock()
- // Forward to listeners (e.g. ICE context)
- _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_data, u_data_size);
- }
- }
- }
+ // Must never happen: Data must be received via CHANNEL-DATA or DATA-INDICATION
+ TSK_DEBUG_INFO("Calling unexpected code :(");
+
+ if (b_stream) {
+ tsk_safeobj_lock(p_ss);
+ pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
+ tsk_safeobj_unlock(p_ss);
+ }
+ _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_data, u_data_size);
+ if (p_stream_buff_in) {
+ tsk_buffer_cleanup(p_stream_buff_in);
+ }
+ goto bail;
+ } // if (!TNET_STUN_BUFF_IS_STUN2...
+
+ /*** At this step it means we have a STUN packet in the buffer ***/
+
+ // Make sure we have a complete packet in the buffer
+ if (b_stream) {
+ if ((ret = tnet_stun_pkt_is_complete(pc_data, u_data_size, &b_pkt_is_complete))) {
+ goto bail;
+ }
+ if (!b_pkt_is_complete) {
+ TSK_DEBUG_INFO("The stream length is too short to contains a complete STUN/TURN packet");
+ goto bail;
+ }
+ }
+
+ // Parse the packet
+ if ((ret = tnet_stun_pkt_read(pc_data, u_data_size, &p_pkt))) {
+ goto bail;
+ }
+
+ // Remove the parsed data
+ if (p_stream_buff_in && p_pkt) {
+ tsk_size_t u_pad_len = (p_pkt->u_length & 3) ? (4 - (p_pkt->u_length & 3)) : 0;
+ tsk_buffer_remove(p_stream_buff_in, 0, kStunPktHdrSizeInOctets + p_pkt->u_length + u_pad_len);
+ }
+
+ if (p_pkt) {
+ b_got_msg = tsk_true;
+ if (p_pkt->e_type == tnet_stun_pkt_type_data_indication) {
+ const tnet_stun_attr_vdata_t *pc_attr_data;
+ const tnet_stun_attr_address_t *pc_attr_xpeer;
+ const tnet_turn_peer_t *pc_peer;
+ // XOR-PEER-ADDRESS (required)
+ if ((ret = tnet_stun_pkt_attr_find_first(p_pkt, tnet_stun_attr_type_xor_peer_address, (const tnet_stun_attr_t**)&pc_attr_xpeer)) || !pc_attr_xpeer) {
+ TSK_DEBUG_ERROR("XOR-PEER-ADDRESS missing in DATA-INDICATION");
+ ret = -4;
+ goto bail;
+ }
+ tsk_safeobj_lock(p_ss); // lock to make sure the list will not be modified
+ if ((ret = _tnet_turn_peer_find_by_xpeer(p_ss->p_list_peers, pc_attr_xpeer, &pc_peer))) {
+ tsk_safeobj_unlock(p_ss);
+ goto bail;
+ }
+ tsk_safeobj_unlock(p_ss); // unlock()
+ // DATA (required)
+ if ((ret = tnet_stun_pkt_attr_find_first(p_pkt, tnet_stun_attr_type_data, (const tnet_stun_attr_t**)&pc_attr_data)) || !pc_attr_data) {
+ TSK_DEBUG_ERROR("DATA missing in DATA-INDICAION");
+ ret = -4;
+ goto bail;
+ }
+
+ _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_attr_data->p_data_ptr, pc_attr_data->u_data_size);
+ }
+ else {
+ tsk_bool_t b_processed;
+ if ((ret = _tnet_turn_session_process_incoming_pkt(p_ss, p_pkt, &b_processed))) {
+ goto bail;
+ }
+ if (!b_processed) {
+ const tnet_turn_peer_t *pc_peer;
+ tsk_safeobj_lock(p_ss);
+ pc_peer = (const tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_fd, &e->local_fd);
+ tsk_safeobj_unlock(p_ss); // unlock()
+ // Forward to listeners (e.g. ICE context)
+ _tnet_turn_session_raise_event_recv_data(p_ss, pc_peer ? pc_peer->id : kTurnPeerIdInvalid, pc_data, u_data_size);
+ }
+ }
+ }
bail:
- // Handle next message in the stream buffer
- if (ret == 0 && b_got_msg && b_stream && p_stream_buff_in && p_stream_buff_in->size > 0) {
- goto handle_data;
- }
+ // Handle next message in the stream buffer
+ if (ret == 0 && b_got_msg && b_stream && p_stream_buff_in && p_stream_buff_in->size > 0) {
+ goto handle_data;
+ }
- TSK_OBJECT_SAFE_FREE(p_pkt);
- TSK_OBJECT_SAFE_FREE(p_stream_buff_in);
- p_ss->cb.e.pc_enet = tsk_null;
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ TSK_OBJECT_SAFE_FREE(p_stream_buff_in);
+ p_ss->cb.e.pc_enet = tsk_null;
return ret;
}
@@ -2288,36 +2294,36 @@ static int _tnet_turn_session_timer_callback(const void* pc_arg, tsk_timer_id_t
}
tnet_turn_session_t* p_ss = (tnet_turn_session_t*)pc_arg;
- tnet_turn_peer_t* pc_peer;
- int ret = 0;
+ tnet_turn_peer_t* pc_peer;
+ int ret = 0;
tsk_safeobj_lock(p_ss); // must
- if (p_ss->timer.rtt.alloc.id == timer_id) {
- RETRANSMIT(p_ss, alloc, kTurnPeerIdInvalid);
+ if (p_ss->timer.rtt.alloc.id == timer_id) {
+ RETRANSMIT(p_ss, alloc, kTurnPeerIdInvalid);
}
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_rtt_chanbind, &timer_id))) {
- RETRANSMIT(pc_peer, chanbind, pc_peer->id);
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_rtt_chanbind, &timer_id))) {
+ RETRANSMIT(pc_peer, chanbind, pc_peer->id);
}
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_rtt_createperm, &timer_id))) {
- RETRANSMIT(pc_peer, createperm, pc_peer->id);
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_rtt_createperm, &timer_id))) {
+ RETRANSMIT(pc_peer, createperm, pc_peer->id);
}
- else if (p_ss->timer.rtt.refresh.id == timer_id) {
- RETRANSMIT(p_ss, refresh, kTurnPeerIdInvalid);
+ else if (p_ss->timer.rtt.refresh.id == timer_id) {
+ RETRANSMIT(p_ss, refresh, kTurnPeerIdInvalid);
}
- else if (p_ss->timer.u_timer_id_refresh == timer_id) {
- if ((ret = _tnet_turn_session_send_refresh(p_ss))) {
- goto bail;
- }
+ else if (p_ss->timer.u_timer_id_refresh == timer_id) {
+ if ((ret = _tnet_turn_session_send_refresh(p_ss))) {
+ goto bail;
+ }
}
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_fresh_chanbind, &timer_id))) {
- if ((ret = tnet_turn_session_chanbind(p_ss, pc_peer->id))) {
- goto bail;
- }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_fresh_chanbind, &timer_id))) {
+ if ((ret = tnet_turn_session_chanbind(p_ss, pc_peer->id))) {
+ goto bail;
+ }
+ }
+ else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_fresh_createperm, &timer_id))) {
+ if ((ret = _tnet_turn_session_send_permission(p_ss, pc_peer))) {
+ goto bail;
+ }
}
- else if ((pc_peer = (tnet_turn_peer_t*)tsk_list_find_object_by_pred(p_ss->p_list_peers, __pred_find_peer_by_timer_fresh_createperm, &timer_id))) {
- if ((ret = _tnet_turn_session_send_permission(p_ss, pc_peer))) {
- goto bail;
- }
- }
bail:
tsk_safeobj_unlock(p_ss);
@@ -2326,71 +2332,71 @@ bail:
static int _tnet_turn_peer_create(const char* pc_peer_ip, uint16_t u_peer_port, tsk_bool_t b_ipv6, struct tnet_turn_peer_s **pp_peer)
{
- extern const tsk_object_def_t *tnet_turn_peer_def_t;
- static tnet_turn_peer_id_t __l_peer_id = 0;
- tnet_stun_addr_t peer_addr;
- int ret;
- if (!pc_peer_ip || !u_peer_port || !pp_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((ret = tnet_stun_utils_inet_pton(b_ipv6, pc_peer_ip, &peer_addr))) {
+ extern const tsk_object_def_t *tnet_turn_peer_def_t;
+ static tnet_turn_peer_id_t __l_peer_id = 0;
+ tnet_stun_addr_t peer_addr;
+ int ret;
+ if (!pc_peer_ip || !u_peer_port || !pp_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((ret = tnet_stun_utils_inet_pton(b_ipv6, pc_peer_ip, &peer_addr))) {
TSK_DEBUG_ERROR("inet_pton(%s,IPv6=%d) failed", pc_peer_ip, b_ipv6);
goto bail;
}
- if (!(*pp_peer = tsk_object_new(tnet_turn_peer_def_t))) {
- TSK_DEBUG_ERROR("Failed to create TURN peer object");
- return -2;
- }
- (*pp_peer)->p_addr_ip = tsk_strdup(pc_peer_ip);
- memcpy((*pp_peer)->addr_ip, peer_addr, sizeof(peer_addr));
- (*pp_peer)->u_addr_port = u_peer_port;
- (*pp_peer)->b_ipv6 = b_ipv6;
- tsk_atomic_inc(&__l_peer_id);
- (*pp_peer)->id = __l_peer_id;
- (*pp_peer)->timer.rtt.chanbind.id = TSK_INVALID_TIMER_ID;
- (*pp_peer)->timer.rtt.createperm.id = TSK_INVALID_TIMER_ID;
- (*pp_peer)->timer.rtt.chanbind.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- (*pp_peer)->timer.rtt.createperm.u_timeout = kStunUdpRetransmitTimoutMinInMs;
- (*pp_peer)->timer.fresh.chanbind.id = TSK_INVALID_TIMER_ID;
- (*pp_peer)->timer.fresh.createperm.id = TSK_INVALID_TIMER_ID;
- (*pp_peer)->timer.fresh.chanbind.u_timeout = kTurnChannelBindingTimeOutInSec * 1000;
- (*pp_peer)->timer.fresh.createperm.u_timeout = kTurnPermissionTimeOutInSec * 1000;
- (*pp_peer)->e_chanbind_state = tnet_stun_state_none;
- (*pp_peer)->e_createperm_state = tnet_stun_state_none;
+ if (!(*pp_peer = tsk_object_new(tnet_turn_peer_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create TURN peer object");
+ return -2;
+ }
+ (*pp_peer)->p_addr_ip = tsk_strdup(pc_peer_ip);
+ memcpy((*pp_peer)->addr_ip, peer_addr, sizeof(peer_addr));
+ (*pp_peer)->u_addr_port = u_peer_port;
+ (*pp_peer)->b_ipv6 = b_ipv6;
+ tsk_atomic_inc(&__l_peer_id);
+ (*pp_peer)->id = __l_peer_id;
+ (*pp_peer)->timer.rtt.chanbind.id = TSK_INVALID_TIMER_ID;
+ (*pp_peer)->timer.rtt.createperm.id = TSK_INVALID_TIMER_ID;
+ (*pp_peer)->timer.rtt.chanbind.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ (*pp_peer)->timer.rtt.createperm.u_timeout = kStunUdpRetransmitTimoutMinInMs;
+ (*pp_peer)->timer.fresh.chanbind.id = TSK_INVALID_TIMER_ID;
+ (*pp_peer)->timer.fresh.createperm.id = TSK_INVALID_TIMER_ID;
+ (*pp_peer)->timer.fresh.chanbind.u_timeout = kTurnChannelBindingTimeOutInSec * 1000;
+ (*pp_peer)->timer.fresh.createperm.u_timeout = kTurnPermissionTimeOutInSec * 1000;
+ (*pp_peer)->e_chanbind_state = tnet_stun_state_none;
+ (*pp_peer)->e_createperm_state = tnet_stun_state_none;
bail:
- return ret;
+ return ret;
}
static int _tnet_turn_peer_find_by_xpeer(const tnet_turn_peers_L_t* pc_peers, const tnet_stun_attr_address_t* pc_xpeer, const tnet_turn_peer_t **ppc_peer)
{
- const tsk_list_item_t *pc_item;
- const tnet_turn_peer_t *pc_peer;
- if (!pc_peers || !pc_xpeer || !ppc_peer) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *ppc_peer = tsk_null;
- tsk_list_foreach(pc_item, pc_peers) {
- pc_peer = (const tnet_turn_peer_t *)pc_item->data;
- if (pc_peer->u_addr_port == pc_xpeer->u_port) {
- if (tnet_stun_utils_buff_cmp(
- pc_peer->addr_ip, pc_peer->b_ipv6 ? 16 : 4,
- pc_xpeer->address, (pc_xpeer->e_family == tnet_stun_address_family_ipv6) ? 16 : 4) == 0) {
- *ppc_peer = pc_peer;
- return 0;
- }
- }
- }
- return 0;
+ const tsk_list_item_t *pc_item;
+ const tnet_turn_peer_t *pc_peer;
+ if (!pc_peers || !pc_xpeer || !ppc_peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *ppc_peer = tsk_null;
+ tsk_list_foreach(pc_item, pc_peers) {
+ pc_peer = (const tnet_turn_peer_t *)pc_item->data;
+ if (pc_peer->u_addr_port == pc_xpeer->u_port) {
+ if (tnet_stun_utils_buff_cmp(
+ pc_peer->addr_ip, pc_peer->b_ipv6 ? 16 : 4,
+ pc_xpeer->address, (pc_xpeer->e_family == tnet_stun_address_family_ipv6) ? 16 : 4) == 0) {
+ *ppc_peer = pc_peer;
+ return 0;
+ }
+ }
+ }
+ return 0;
}
static tsk_object_t* tnet_turn_session_ctor(tsk_object_t * self, va_list * app)
{
tnet_turn_session_t *p_ss = (tnet_turn_session_t *)self;
if (p_ss) {
- tsk_safeobj_init(p_ss);
+ tsk_safeobj_init(p_ss);
}
return self;
}
@@ -2398,41 +2404,41 @@ static tsk_object_t* tnet_turn_session_dtor(tsk_object_t * self)
{
tnet_turn_session_t *p_ss = (tnet_turn_session_t *)self;
if (p_ss) {
- // stop()
- tnet_turn_session_stop(p_ss);
- // timer.free()
- TSK_OBJECT_SAFE_FREE(p_ss->timer.p_mgr);
- // cred.free()
- TSK_FREE(p_ss->cred.p_usr_name);
- TSK_FREE(p_ss->cred.p_pwd);
- // others.free()
- TSK_OBJECT_SAFE_FREE(p_ss->p_pkt_alloc);
- TSK_OBJECT_SAFE_FREE(p_ss->p_pkt_refresh);
- TSK_OBJECT_SAFE_FREE(p_ss->p_lcl_sock);
-
- TSK_FREE(p_ss->p_buff_chandata_ptr);
- TSK_FREE(p_ss->p_buff_send_ptr);
- TSK_FREE(p_ss->p_rel_ip);
- TSK_FREE(p_ss->p_srflx_ip);
- TSK_FREE(p_ss->p_srv_host);
-
- if (p_ss->p_transport) {
- tnet_transport_shutdown(p_ss->p_transport);
- TSK_OBJECT_SAFE_FREE(p_ss->p_transport);
- }
-
- TSK_OBJECT_SAFE_FREE(p_ss->p_list_peers);
- TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_in);
+ // stop()
+ tnet_turn_session_stop(p_ss);
+ // timer.free()
+ TSK_OBJECT_SAFE_FREE(p_ss->timer.p_mgr);
+ // cred.free()
+ TSK_FREE(p_ss->cred.p_usr_name);
+ TSK_FREE(p_ss->cred.p_pwd);
+ // others.free()
+ TSK_OBJECT_SAFE_FREE(p_ss->p_pkt_alloc);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_pkt_refresh);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_lcl_sock);
+
+ TSK_FREE(p_ss->p_buff_chandata_ptr);
+ TSK_FREE(p_ss->p_buff_send_ptr);
+ TSK_FREE(p_ss->p_rel_ip);
+ TSK_FREE(p_ss->p_srflx_ip);
+ TSK_FREE(p_ss->p_srv_host);
+
+ if (p_ss->p_transport) {
+ tnet_transport_shutdown(p_ss->p_transport);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_transport);
+ }
+
+ TSK_OBJECT_SAFE_FREE(p_ss->p_list_peers);
+ TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_in);
TSK_OBJECT_SAFE_FREE(p_ss->p_stream_buff_out);
-
+
TSK_OBJECT_SAFE_FREE(p_ss->proxy.info);
- TSK_FREE(p_ss->ssl.path_priv);
- TSK_FREE(p_ss->ssl.path_pub);
- TSK_FREE(p_ss->ssl.path_ca);
+ TSK_FREE(p_ss->ssl.path_priv);
+ TSK_FREE(p_ss->ssl.path_pub);
+ TSK_FREE(p_ss->ssl.path_ca);
- tsk_safeobj_deinit(p_ss);
- TSK_DEBUG_INFO("*** TURN Session destroyed ***");
+ tsk_safeobj_deinit(p_ss);
+ TSK_DEBUG_INFO("*** TURN Session destroyed ***");
}
return self;
}
@@ -2456,7 +2462,7 @@ static tsk_object_t* tnet_turn_peer_ctor(tsk_object_t * self, va_list * app)
{
tnet_turn_peer_t *p_peer = (tnet_turn_peer_t *)self;
if (p_peer) {
-
+
}
return self;
}
@@ -2464,13 +2470,13 @@ static tsk_object_t* tnet_turn_peer_dtor(tsk_object_t * self)
{
tnet_turn_peer_t *p_peer = (tnet_turn_peer_t *)self;
if (p_peer) {
- TSK_FREE(p_peer->p_addr_ip);
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_chanbind);
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_createperm);
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_sendind);
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_connect);
- TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_connbind);
- TSK_OBJECT_SAFE_FREE(p_peer->p_stream_buff_in);
+ TSK_FREE(p_peer->p_addr_ip);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_chanbind);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_createperm);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_sendind);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_connect);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_pkt_connbind);
+ TSK_OBJECT_SAFE_FREE(p_peer->p_stream_buff_in);
TSK_OBJECT_SAFE_FREE(p_peer->p_stream_buff_out);
#if PRINT_DESTROYED_MSG || 1
TSK_DEBUG_INFO("*** TURN peer destroyed ***");
diff --git a/tinyNET/src/turn/tnet_turn_session.h b/tinyNET/src/turn/tnet_turn_session.h
index fa4a030..7357bb1 100755
--- a/tinyNET/src/turn/tnet_turn_session.h
+++ b/tinyNET/src/turn/tnet_turn_session.h
@@ -33,34 +33,33 @@ struct tnet_proxyinfo_s;
enum tnet_socket_type_e;
#define kTurnPeerIdInvalid -1
-typedef enum tnet_turn_session_event_type_e
-{
- tnet_turn_session_event_type_alloc_ok,
- tnet_turn_session_event_type_alloc_nok,
- tnet_turn_session_event_type_refresh_ok,
- tnet_turn_session_event_type_refresh_nok,
- tnet_turn_session_event_type_perm_ok,
- tnet_turn_session_event_type_perm_nok,
- tnet_turn_session_event_type_recv_data,
- tnet_turn_session_event_type_chanbind_ok,
- tnet_turn_session_event_type_chanbind_nok,
- tnet_turn_session_event_type_connect_ok,
- tnet_turn_session_event_type_connect_nok,
- tnet_turn_session_event_type_connectionbind_ok,
- tnet_turn_session_event_type_connectionbind_nok,
+typedef enum tnet_turn_session_event_type_e {
+ tnet_turn_session_event_type_alloc_ok,
+ tnet_turn_session_event_type_alloc_nok,
+ tnet_turn_session_event_type_refresh_ok,
+ tnet_turn_session_event_type_refresh_nok,
+ tnet_turn_session_event_type_perm_ok,
+ tnet_turn_session_event_type_perm_nok,
+ tnet_turn_session_event_type_recv_data,
+ tnet_turn_session_event_type_chanbind_ok,
+ tnet_turn_session_event_type_chanbind_nok,
+ tnet_turn_session_event_type_connect_ok,
+ tnet_turn_session_event_type_connect_nok,
+ tnet_turn_session_event_type_connectionbind_ok,
+ tnet_turn_session_event_type_connectionbind_nok,
}
tnet_turn_session_event_type_t;
typedef struct tnet_turn_session_event_xs {
- enum tnet_turn_session_event_type_e e_type;
- tnet_turn_peer_id_t u_peer_id;
- const void* pc_usr_data;
- const struct tnet_transport_event_s* pc_enet;
- struct tnet_turn_session_s* pc_session;
- struct {
- const void* pc_data_ptr;
- tsk_size_t u_data_size;
- } data;
+ enum tnet_turn_session_event_type_e e_type;
+ tnet_turn_peer_id_t u_peer_id;
+ const void* pc_usr_data;
+ const struct tnet_transport_event_s* pc_enet;
+ struct tnet_turn_session_s* pc_session;
+ struct {
+ const void* pc_data_ptr;
+ tsk_size_t u_data_size;
+ } data;
} tnet_turn_session_event_xt;
typedef int (*tnet_turn_session_callback_f)(const struct tnet_turn_session_event_xs *e);
diff --git a/tinyNET/test/targetver.h b/tinyNET/test/targetver.h
index 21af608..5972193 100755
--- a/tinyNET/test/targetver.h
+++ b/tinyNET/test/targetver.h
@@ -20,8 +20,8 @@
#define TNET_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinyNET/test/test.c b/tinyNET/test/test.c
index 64e0349..d8af3a8 100755
--- a/tinyNET/test/test.c
+++ b/tinyNET/test/test.c
@@ -57,65 +57,65 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- /* Startup the network stack. */
- if(tnet_startup()){
- return -1;
- }
+ /* Startup the network stack. */
+ if(tnet_startup()) {
+ return -1;
+ }
#if RUN_TEST_LOOP
- for(;;)
+ for(;;)
#endif
- {
-
+ {
+
#if RUN_TEST_ALL || RUN_TEST_SOCKETS
- test_sockets();
+ test_sockets();
#endif
#if RUN_TEST_ALL || RUN_TEST_TRANSPORT
- test_transport();
+ test_transport();
#endif
#if RUN_TEST_ALL || RUN_TEST_AUTH
- test_auth();
+ test_auth();
#endif
#if RUN_TEST_ALL || RUN_TEST_STUN
- test_stun();
+ test_stun();
#endif
#if RUN_TEST_ALL || RUN_TEST_ICE
- test_ice();
+ test_ice();
#endif
#if RUN_TEST_ALL || RUN_TEST_NAT
- test_nat();
+ test_nat();
#endif
#if RUN_TEST_ALL || RUN_TEST_IFACES
- test_ifaces();
+ test_ifaces();
#endif
#if RUN_TEST_ALL || RUN_TEST_DNS
- test_dns();
+ test_dns();
#endif
#if RUN_TEST_ALL || RUN_TEST_DHCP
- test_dhcp();
+ test_dhcp();
#endif
#if RUN_TEST_ALL || RUN_TEST_DHCP6
- test_dhcp6();
+ test_dhcp6();
#endif
#if RUN_TEST_ALL || RUN_TEST_TLS
- test_tls();
+ test_tls();
#endif
- }
+ }
- /* Cleanup the network stack */
- tnet_cleanup();
+ /* Cleanup the network stack */
+ tnet_cleanup();
- return 0;
+ return 0;
}
diff --git a/tinyNET/test/test_dhcp.h b/tinyNET/test/test_dhcp.h
index c74e99c..ee6e767 100755
--- a/tinyNET/test/test_dhcp.h
+++ b/tinyNET/test/test_dhcp.h
@@ -35,84 +35,75 @@ void test_dhcp_request(tnet_dhcp_ctx_t *ctx)
void test_dhcp_inform(tnet_dhcp_ctx_t *ctx)
{
- tnet_dhcp_params_t *params = tsk_null;
- tnet_dhcp_reply_t *reply = tsk_null;
-
- params = tnet_dhcp_params_create();
- tnet_dhcp_params_add_code(params, dhcp_code_SIP_Servers_DHCP_Option); /* SIP Servers */
- tnet_dhcp_params_add_code(params, dhcp_code_Domain_Server); /* DNS Server */
-
- reply = tnet_dhcp_query_inform(ctx, params);
-
- if(reply && !TNET_DHCP_MESSAGE_IS_REPLY(reply)){
- TSK_DEBUG_ERROR("DHCP request is not expected in response to a request.");
- goto bail;
- }
-
- if(reply){
- switch(reply->type)
- {
- case dhcp_type_ack:
- {
- tsk_list_item_t *item;
- TSK_DEBUG_INFO("DHCP response type ==> ACK.");
-
- tsk_list_foreach(item, reply->options)
- {
- const tnet_dhcp_option_t *option = item->data;
-
- /* SIP SERVERS */
- if(option->code == dhcp_code_SIP_Servers_DHCP_Option)
- {
- tsk_list_item_t *item2;
- const tnet_dhcp_option_sip_t *option_sip4 = (const tnet_dhcp_option_sip_t*)option;;
- tsk_list_foreach(item2, option_sip4->servers)
- {
- const tsk_string_t *str = item2->data;
- TSK_DEBUG_INFO("DHCP-SIP_SERVER ==>%s", str->value);
- }
- }
-
- /* DNS SERVERS */
- if(option->code == dhcp_code_Domain_Server)
- {
- tsk_list_item_t *item2;
- const tnet_dhcp_option_dns_t *option_dns = (const tnet_dhcp_option_dns_t*)option;;
- tsk_list_foreach(item2, option_dns->servers)
- {
- const tsk_string_t *str = item2->data;
- TSK_DEBUG_INFO("DHCP-DNS_SERVER ==>%s", str->value);
- }
- }
- }
- break;
- }
-
- default:
- {
- break;
- }
- }
- }
- else
- {
- TSK_DEBUG_ERROR("DHCP reply is NULL.");
- goto bail;
- }
-
+ tnet_dhcp_params_t *params = tsk_null;
+ tnet_dhcp_reply_t *reply = tsk_null;
+
+ params = tnet_dhcp_params_create();
+ tnet_dhcp_params_add_code(params, dhcp_code_SIP_Servers_DHCP_Option); /* SIP Servers */
+ tnet_dhcp_params_add_code(params, dhcp_code_Domain_Server); /* DNS Server */
+
+ reply = tnet_dhcp_query_inform(ctx, params);
+
+ if(reply && !TNET_DHCP_MESSAGE_IS_REPLY(reply)) {
+ TSK_DEBUG_ERROR("DHCP request is not expected in response to a request.");
+ goto bail;
+ }
+
+ if(reply) {
+ switch(reply->type) {
+ case dhcp_type_ack: {
+ tsk_list_item_t *item;
+ TSK_DEBUG_INFO("DHCP response type ==> ACK.");
+
+ tsk_list_foreach(item, reply->options) {
+ const tnet_dhcp_option_t *option = item->data;
+
+ /* SIP SERVERS */
+ if(option->code == dhcp_code_SIP_Servers_DHCP_Option) {
+ tsk_list_item_t *item2;
+ const tnet_dhcp_option_sip_t *option_sip4 = (const tnet_dhcp_option_sip_t*)option;;
+ tsk_list_foreach(item2, option_sip4->servers) {
+ const tsk_string_t *str = item2->data;
+ TSK_DEBUG_INFO("DHCP-SIP_SERVER ==>%s", str->value);
+ }
+ }
+
+ /* DNS SERVERS */
+ if(option->code == dhcp_code_Domain_Server) {
+ tsk_list_item_t *item2;
+ const tnet_dhcp_option_dns_t *option_dns = (const tnet_dhcp_option_dns_t*)option;;
+ tsk_list_foreach(item2, option_dns->servers) {
+ const tsk_string_t *str = item2->data;
+ TSK_DEBUG_INFO("DHCP-DNS_SERVER ==>%s", str->value);
+ }
+ }
+ }
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("DHCP reply is NULL.");
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(reply);
- TSK_OBJECT_SAFE_FREE(params);
+ TSK_OBJECT_SAFE_FREE(reply);
+ TSK_OBJECT_SAFE_FREE(params);
- //tsk_thread_sleep(1000);
+ //tsk_thread_sleep(1000);
}
void test_dhcp()
{
- tnet_dhcp_ctx_t *ctx = tnet_dhcp_ctx_create();
- test_dhcp_inform(ctx);
+ tnet_dhcp_ctx_t *ctx = tnet_dhcp_ctx_create();
+ test_dhcp_inform(ctx);
- TSK_OBJECT_SAFE_FREE(ctx);
+ TSK_OBJECT_SAFE_FREE(ctx);
}
#endif /* TNET_TEST_DHCP_H */
diff --git a/tinyNET/test/test_dhcp6.h b/tinyNET/test/test_dhcp6.h
index c96fd96..1844dcc 100755
--- a/tinyNET/test/test_dhcp6.h
+++ b/tinyNET/test/test_dhcp6.h
@@ -23,26 +23,26 @@
void test_dhcp6_requestinfo(tnet_dhcp6_ctx_t *ctx)
{
- tnet_dhcp6_option_orequest_t *orequest = tnet_dhcp6_option_orequest_create_null();
- tnet_dhcp6_reply_t* reply = 0;
+ tnet_dhcp6_option_orequest_t *orequest = tnet_dhcp6_option_orequest_create_null();
+ tnet_dhcp6_reply_t* reply = 0;
- tnet_dhcp6_option_orequest_add_code(orequest, 24);
- tnet_dhcp6_option_orequest_add_code(orequest, 23);
- tnet_dhcp6_option_orequest_add_code(orequest, 21); /* SIP Servers Domain Name List */
- tnet_dhcp6_option_orequest_add_code(orequest, 22); /* SIP Servers IPv6 Address List */
+ tnet_dhcp6_option_orequest_add_code(orequest, 24);
+ tnet_dhcp6_option_orequest_add_code(orequest, 23);
+ tnet_dhcp6_option_orequest_add_code(orequest, 21); /* SIP Servers Domain Name List */
+ tnet_dhcp6_option_orequest_add_code(orequest, 22); /* SIP Servers IPv6 Address List */
- reply = tnet_dhcp6_requestinfo(ctx, orequest);
+ reply = tnet_dhcp6_requestinfo(ctx, orequest);
- TSK_OBJECT_SAFE_FREE(orequest);
- TSK_OBJECT_SAFE_FREE(reply);
+ TSK_OBJECT_SAFE_FREE(orequest);
+ TSK_OBJECT_SAFE_FREE(reply);
}
void test_dhcp6()
{
- tnet_dhcp6_ctx_t *ctx = tnet_dhcp6_ctx_create();
- test_dhcp6_requestinfo(ctx);
+ tnet_dhcp6_ctx_t *ctx = tnet_dhcp6_ctx_create();
+ test_dhcp6_requestinfo(ctx);
- TSK_OBJECT_SAFE_FREE(ctx);
+ TSK_OBJECT_SAFE_FREE(ctx);
}
#endif /* TNET_TEST_DHCP6_H */
diff --git a/tinyNET/test/test_dns.h b/tinyNET/test/test_dns.h
index f2ab145..83c8002 100755
--- a/tinyNET/test/test_dns.h
+++ b/tinyNET/test/test_dns.h
@@ -23,201 +23,199 @@
void test_dns_query()
{
- tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
- tnet_dns_response_t *response = tsk_null;
- const tsk_list_item_t* item;
- const tnet_dns_rr_t* rr;
-
- //if((response = tnet_dns_resolve(ctx, "_sip._udp.sip2sip.info", qclass_in, qtype_srv)))
- if((response = tnet_dns_resolve(ctx, "sip2sip.info", qclass_in, qtype_naptr)))
- {
- if(TNET_DNS_RESPONSE_IS_SUCCESS(response)){
- TSK_DEBUG_INFO("We got a success response from the DNS server.");
- // loop through the answers
- tsk_list_foreach(item, response->Answers){
- rr = item->data;
- if(rr->qtype == qtype_naptr){
- const tnet_dns_naptr_t *naptr = (const tnet_dns_naptr_t*)rr;
-
- TSK_DEBUG_INFO("order=%u pref=%u flags=%s services=%s regexp=%s replacement=%s",
- naptr->order,
- naptr->preference,
- naptr->flags,
- naptr->services,
- naptr->regexp,
- naptr->replacement);
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("We got an error response from the DNS server. Erro code: %u", response->Header.RCODE);
- }
- }
-
- tnet_dns_cache_clear(ctx);
-
- TSK_OBJECT_SAFE_FREE(response);
- TSK_OBJECT_SAFE_FREE(ctx);
-
-
- tsk_thread_sleep(2000);
+ tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
+ tnet_dns_response_t *response = tsk_null;
+ const tsk_list_item_t* item;
+ const tnet_dns_rr_t* rr;
+
+ //if((response = tnet_dns_resolve(ctx, "_sip._udp.sip2sip.info", qclass_in, qtype_srv)))
+ if((response = tnet_dns_resolve(ctx, "sip2sip.info", qclass_in, qtype_naptr))) {
+ if(TNET_DNS_RESPONSE_IS_SUCCESS(response)) {
+ TSK_DEBUG_INFO("We got a success response from the DNS server.");
+ // loop through the answers
+ tsk_list_foreach(item, response->Answers) {
+ rr = item->data;
+ if(rr->qtype == qtype_naptr) {
+ const tnet_dns_naptr_t *naptr = (const tnet_dns_naptr_t*)rr;
+
+ TSK_DEBUG_INFO("order=%u pref=%u flags=%s services=%s regexp=%s replacement=%s",
+ naptr->order,
+ naptr->preference,
+ naptr->flags,
+ naptr->services,
+ naptr->regexp,
+ naptr->replacement);
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("We got an error response from the DNS server. Erro code: %u", response->Header.RCODE);
+ }
+ }
+
+ tnet_dns_cache_clear(ctx);
+
+ TSK_OBJECT_SAFE_FREE(response);
+ TSK_OBJECT_SAFE_FREE(ctx);
+
+
+ tsk_thread_sleep(2000);
}
void test_dns_srv()
{
- tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
- char* hostname = 0;
- tnet_port_t port = 0;
+ tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
+ char* hostname = 0;
+ tnet_port_t port = 0;
- if(!tnet_dns_query_srv(ctx, "_sip._udp.sip2sip.info", &hostname, &port)){
- TSK_DEBUG_INFO("DNS SRV succeed ==> hostname=%s and port=%u", hostname, port);
- }
+ if(!tnet_dns_query_srv(ctx, "_sip._udp.sip2sip.info", &hostname, &port)) {
+ TSK_DEBUG_INFO("DNS SRV succeed ==> hostname=%s and port=%u", hostname, port);
+ }
- TSK_FREE(hostname);
- TSK_OBJECT_SAFE_FREE(ctx);
+ TSK_FREE(hostname);
+ TSK_OBJECT_SAFE_FREE(ctx);
- tsk_thread_sleep(2000);
+ tsk_thread_sleep(2000);
}
void test_dns_naptr_srv()
{
- tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
- char* hostname = tsk_null;
- tnet_port_t port = 0;
+ tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
+ char* hostname = tsk_null;
+ tnet_port_t port = 0;
- if(!tnet_dns_query_naptr_srv(ctx, "sip2sip.info", "SIP+D2U", &hostname, &port)){
- TSK_DEBUG_INFO("DNS NAPTR+SRV succeed ==> hostname=%s and port=%u", hostname, port);
- }
+ if(!tnet_dns_query_naptr_srv(ctx, "sip2sip.info", "SIP+D2U", &hostname, &port)) {
+ TSK_DEBUG_INFO("DNS NAPTR+SRV succeed ==> hostname=%s and port=%u", hostname, port);
+ }
- TSK_FREE(hostname);
- TSK_OBJECT_SAFE_FREE(ctx);
+ TSK_FREE(hostname);
+ TSK_OBJECT_SAFE_FREE(ctx);
- tsk_thread_sleep(2000);
+ tsk_thread_sleep(2000);
}
void test_enum()
{
- tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
- tnet_dns_response_t* response = tsk_null;
+ tnet_dns_ctx_t *ctx = tnet_dns_ctx_create();
+ tnet_dns_response_t* response = tsk_null;
// const tsk_list_item_t* item;
// const tnet_dns_naptr_t* record;
- char* uri = tsk_null;
- const char* e164num = "+1-800-555-5555";
- //const char* e164num = "+33660188661";
-
- //tnet_dns_add_server(ctx, "192.168.16.9");
-
- //if((uri = tnet_dns_enum_2(ctx, "E2U+SIP", e164num, "e164.org"))){
- if((uri = tnet_dns_enum_2(ctx, "E2U+SIP", e164num, "e164.org"))){
- TSK_DEBUG_INFO("URI=%s", uri);
- TSK_FREE(uri);
- }
- else{
- TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
- }
-
- /*if((response = tnet_dns_enum(ctx, "+1-800-555-5555", "e164.org"))){
- if(TNET_DNS_RESPONSE_IS_SUCCESS(response)){
- TSK_DEBUG_INFO("We got a success response from the DNS server.");
- // loop through the answers
- tsk_list_foreach(item, response->Answers){
- record = item->data;
-
- TSK_DEBUG_INFO("order=%u pref=%u flags=%s services=%s regexp=%s replacement=%s",
- record->order,
- record->preference,
- record->flags,
- record->services,
- record->regexp,
- record->replacement);
- }
- }
- else{
- TSK_DEBUG_ERROR("We got an error response from the DNS server. Erro code: %u", response->Header.RCODE);
- }
- }*/
-
-
- TSK_OBJECT_SAFE_FREE(response);
- TSK_OBJECT_SAFE_FREE(ctx);
-
- tsk_thread_sleep(2000);
+ char* uri = tsk_null;
+ const char* e164num = "+1-800-555-5555";
+ //const char* e164num = "+33660188661";
+
+ //tnet_dns_add_server(ctx, "192.168.16.9");
+
+ //if((uri = tnet_dns_enum_2(ctx, "E2U+SIP", e164num, "e164.org"))){
+ if((uri = tnet_dns_enum_2(ctx, "E2U+SIP", e164num, "e164.org"))) {
+ TSK_DEBUG_INFO("URI=%s", uri);
+ TSK_FREE(uri);
+ }
+ else {
+ TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
+ }
+
+ /*if((response = tnet_dns_enum(ctx, "+1-800-555-5555", "e164.org"))){
+ if(TNET_DNS_RESPONSE_IS_SUCCESS(response)){
+ TSK_DEBUG_INFO("We got a success response from the DNS server.");
+ // loop through the answers
+ tsk_list_foreach(item, response->Answers){
+ record = item->data;
+
+ TSK_DEBUG_INFO("order=%u pref=%u flags=%s services=%s regexp=%s replacement=%s",
+ record->order,
+ record->preference,
+ record->flags,
+ record->services,
+ record->regexp,
+ record->replacement);
+ }
+ }
+ else{
+ TSK_DEBUG_ERROR("We got an error response from the DNS server. Erro code: %u", response->Header.RCODE);
+ }
+ }*/
+
+
+ TSK_OBJECT_SAFE_FREE(response);
+ TSK_OBJECT_SAFE_FREE(ctx);
+
+ tsk_thread_sleep(2000);
}
-typedef struct regexp_test_s{
- const char* e164num;
- const char* regexp;
- const char* xres;
+typedef struct regexp_test_s {
+ const char* e164num;
+ const char* regexp;
+ const char* xres;
}
regexp_test_t;
regexp_test_t regexp_tests[] = {
- "+18005551234", "!^.*$!sip:customer-service@example.com!i", "sip:customer-service@example.com",
- "+18005551234", "!^.*$!mailto:information@example.com!i", "mailto:information@example.com",
+ "+18005551234", "!^.*$!sip:customer-service@example.com!i", "sip:customer-service@example.com",
+ "+18005551234", "!^.*$!mailto:information@example.com!i", "mailto:information@example.com",
- "+18005555555", "!^\\+1800(.*)$!sip:1641641800\\1@tollfree.sip-happens.com!", "sip:16416418005555555@tollfree.sip-happens.com",
- "+18005555555", "!^\\+1800(.*)$!sip:1641641800\\1@sip.tollfreegateway.com!", "sip:16416418005555555@sip.tollfreegateway.com",
-
- "+468971234", "!^+46(.*)$!ldap://ldap.telco.se/cn=0\\1!", "ldap://ldap.telco.se/cn=08971234",
- "+468971234", "!^+46(.*)$!mailto:spam@paf.se!", "mailto:spam@paf.se",
+ "+18005555555", "!^\\+1800(.*)$!sip:1641641800\\1@tollfree.sip-happens.com!", "sip:16416418005555555@tollfree.sip-happens.com",
+ "+18005555555", "!^\\+1800(.*)$!sip:1641641800\\1@sip.tollfreegateway.com!", "sip:16416418005555555@sip.tollfreegateway.com",
- "urn:cid:199606121851.1@bar.example.com", "!!^urn:cid:.+@([^\\.]+\\.)(.*)$!\\2!i", "example.com",
+ "+468971234", "!^+46(.*)$!ldap://ldap.telco.se/cn=0\\1!", "ldap://ldap.telco.se/cn=08971234",
+ "+468971234", "!^+46(.*)$!mailto:spam@paf.se!", "mailto:spam@paf.se",
+
+ "urn:cid:199606121851.1@bar.example.com", "!!^urn:cid:.+@([^\\.]+\\.)(.*)$!\\2!i", "example.com",
};
void test_regex()
{
- char* ret;
- size_t i;
-
- for(i=0; i< sizeof(regexp_tests)/sizeof(regexp_test_t); i++)
- {
- if((ret = tnet_dns_regex_parse(regexp_tests[i].e164num, regexp_tests[i].regexp))){
- TSK_DEBUG_INFO("ENUM(%s) = %s", regexp_tests[i].e164num, ret);
- if(!tsk_strequals(ret, regexp_tests[i].xres)){
- TSK_DEBUG_ERROR("Failed to match ENUM(%s)", regexp_tests[i].e164num);
- }
- TSK_FREE(ret);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse ENUM(%s)", regexp_tests[i].e164num);
- }
-
- TSK_DEBUG_INFO("---------");
- }
+ char* ret;
+ size_t i;
+
+ for(i=0; i< sizeof(regexp_tests)/sizeof(regexp_test_t); i++) {
+ if((ret = tnet_dns_regex_parse(regexp_tests[i].e164num, regexp_tests[i].regexp))) {
+ TSK_DEBUG_INFO("ENUM(%s) = %s", regexp_tests[i].e164num, ret);
+ if(!tsk_strequals(ret, regexp_tests[i].xres)) {
+ TSK_DEBUG_ERROR("Failed to match ENUM(%s)", regexp_tests[i].e164num);
+ }
+ TSK_FREE(ret);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse ENUM(%s)", regexp_tests[i].e164num);
+ }
+
+ TSK_DEBUG_INFO("---------");
+ }
}
void test_resolvconf()
{
- tnet_addresses_L_t * servers;
- const tnet_address_t* address;
- const tsk_list_item_t* item;
- const char* path = "C:\\tmp\\resolv32.conf";
- //const char* path = "C:\\tmp\\resolv.conf";
- //const char* path = "/etc/resolv.conf";
-
- if((servers = tnet_dns_resolvconf_parse(path))){
- tsk_list_foreach(item, servers){
- address = item->data;
-
- TSK_DEBUG_INFO("DNS Server host=%s Family=%d", address->ip, address->family);
- }
-
- TSK_OBJECT_SAFE_FREE(servers);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse DNS servers from %s.", path);
- }
+ tnet_addresses_L_t * servers;
+ const tnet_address_t* address;
+ const tsk_list_item_t* item;
+ const char* path = "C:\\tmp\\resolv32.conf";
+ //const char* path = "C:\\tmp\\resolv.conf";
+ //const char* path = "/etc/resolv.conf";
+
+ if((servers = tnet_dns_resolvconf_parse(path))) {
+ tsk_list_foreach(item, servers) {
+ address = item->data;
+
+ TSK_DEBUG_INFO("DNS Server host=%s Family=%d", address->ip, address->family);
+ }
+
+ TSK_OBJECT_SAFE_FREE(servers);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse DNS servers from %s.", path);
+ }
}
void test_dns()
{
- test_dns_naptr_srv();
- //test_dns_srv();
- //test_dns_query();
- //test_enum();
- //test_regex();
- //test_resolvconf();
+ test_dns_naptr_srv();
+ //test_dns_srv();
+ //test_dns_query();
+ //test_enum();
+ //test_regex();
+ //test_resolvconf();
}
diff --git a/tinyNET/test/test_ice.h b/tinyNET/test/test_ice.h
index 023a2c2..c7341b2 100755
--- a/tinyNET/test/test_ice.h
+++ b/tinyNET/test/test_ice.h
@@ -44,193 +44,190 @@ static struct tnet_ice_ctx_s *p_ice_ctx2 = tsk_null;
static void test_ice_print_local_candidates(const struct tnet_ice_ctx_s *pc_ctx)
{
- tsk_size_t index = 0;
- const tnet_ice_candidate_t* candidate;
- char* p_str = tsk_null;
-
- while ((candidate = tnet_ice_ctx_get_local_candidate_at(pc_ctx, index++))) {
- tsk_strcat_2(&p_str, "%s\r\n", tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate));
- }
- TSK_DEBUG_INFO("ICE LOCAL CANDIDATES:\n%s", p_str);
- TSK_FREE(p_str);
+ tsk_size_t index = 0;
+ const tnet_ice_candidate_t* candidate;
+ char* p_str = tsk_null;
+
+ while ((candidate = tnet_ice_ctx_get_local_candidate_at(pc_ctx, index++))) {
+ tsk_strcat_2(&p_str, "%s\r\n", tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate));
+ }
+ TSK_DEBUG_INFO("ICE LOCAL CANDIDATES:\n%s", p_str);
+ TSK_FREE(p_str);
}
static char* test_ice_get_local_candidates(const struct tnet_ice_ctx_s *pc_ctx)
{
- tsk_size_t index = 0;
- const tnet_ice_candidate_t* candidate;
- char* p_str = tsk_null;
-
- while ((candidate = tnet_ice_ctx_get_local_candidate_at(pc_ctx, index++))) {
- if (kSkipHosts && candidate->type_e == tnet_ice_cand_type_host) {
- continue;
- }
- if (kSkipReflexives && candidate->type_e == tnet_ice_cand_type_srflx) {
- continue;
- }
- if (kSkipRelays && candidate->type_e == tnet_ice_cand_type_relay) {
- continue;
- }
- if (kSkipPeers && candidate->type_e == tnet_ice_cand_type_prflx) {
- continue;
- }
- tsk_strcat_2(&p_str, "%s\r\n", tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate));
- }
- return p_str;
+ tsk_size_t index = 0;
+ const tnet_ice_candidate_t* candidate;
+ char* p_str = tsk_null;
+
+ while ((candidate = tnet_ice_ctx_get_local_candidate_at(pc_ctx, index++))) {
+ if (kSkipHosts && candidate->type_e == tnet_ice_cand_type_host) {
+ continue;
+ }
+ if (kSkipReflexives && candidate->type_e == tnet_ice_cand_type_srflx) {
+ continue;
+ }
+ if (kSkipRelays && candidate->type_e == tnet_ice_cand_type_relay) {
+ continue;
+ }
+ if (kSkipPeers && candidate->type_e == tnet_ice_cand_type_prflx) {
+ continue;
+ }
+ tsk_strcat_2(&p_str, "%s\r\n", tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate));
+ }
+ return p_str;
}
static int test_ice_rtp_callback(const void* callback_data, const uint8_t* data_ptr, tsk_size_t data_size, tnet_fd_t local_fd, const struct sockaddr_storage* remote_addr)
{
- struct tnet_ice_ctx_s *p_ice_ctx = (struct tnet_ice_ctx_s *)callback_data;
+ struct tnet_ice_ctx_s *p_ice_ctx = (struct tnet_ice_ctx_s *)callback_data;
- TSK_DEBUG_INFO("\n\nICE rtp callback (incoming data): %.*s\n\n", data_size, data_ptr);
+ TSK_DEBUG_INFO("\n\nICE rtp callback (incoming data): %.*s\n\n", data_size, data_ptr);
#if 0
- tnet_ice_ctx_send_turn_rtp(p_ice_ctx, data_ptr, data_size);
+ tnet_ice_ctx_send_turn_rtp(p_ice_ctx, data_ptr, data_size);
#endif
- return 0;
+ return 0;
}
static int test_ice_state_callback(const tnet_ice_event_t *e)
{
- struct tnet_ice_ctx_s *p_ice_ctx = (struct tnet_ice_ctx_s *)e->ctx;
- int ret = 0;
-
- TSK_DEBUG_INFO("ICE state callback: %s", e->phrase);
-
- switch(e->type)
- {
- case tnet_ice_event_type_gathering_completed:
- {
- test_ice_print_local_candidates(p_ice_ctx);
- if (p_ice_ctx == p_ice_ctx1) {
- if ((ret = tnet_ice_ctx_start(p_ice_ctx2))) {
- goto bail;
- }
- }
- else {
- const tnet_ice_candidate_t* candidate;
- char* p_cand;
-
- p_cand = test_ice_get_local_candidates(p_ice_ctx2);
- candidate = tnet_ice_ctx_get_local_candidate_first(p_ice_ctx2);
- ret = tnet_ice_ctx_set_remote_candidates(p_ice_ctx1, p_cand, candidate->ufrag, candidate->pwd, tsk_true, tsk_false);
- if (ret == 0) {
- TSK_FREE(p_cand);
- p_cand = test_ice_get_local_candidates(p_ice_ctx1);
- candidate = tnet_ice_ctx_get_local_candidate_first(p_ice_ctx1);
- ret = tnet_ice_ctx_set_remote_candidates(p_ice_ctx2, p_cand, candidate->ufrag, candidate->pwd, tsk_false, tsk_false);
- TSK_FREE(p_cand);
- }
- }
- break;
- }
-
- case tnet_ice_event_type_conncheck_succeed:
- {
- const char kTurnData[] = "TURN data to send for testing";
- const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
-
- // === RTP === //
- ret = tnet_ice_ctx_get_nominated_symetric_candidates(p_ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- if (ret == 0) {
- TSK_DEBUG_INFO("Nominated candidate(RTP): Offer=[[%s]], AnswerSrc=[[%s]], AnswerDest=[[%s]]",
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_offer),
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_src),
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_dest));
-
- if (tnet_ice_ctx_is_turn_rtp_active(p_ice_ctx)) {
- tnet_ice_ctx_send_turn_rtp(p_ice_ctx, kTurnData, sizeof(kTurnData));
- }
- }
- // === RTCP === //
- if (use_rtcp) {
- ret = tnet_ice_ctx_get_nominated_symetric_candidates(p_ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTCP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- if (ret == 0) {
- TSK_DEBUG_INFO("Nominated candidate(RTCP): Offer=[[%s]], AnswerSrc=[[%s]], AnswerDest=[[%s]]",
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_offer),
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_src),
- tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_dest));
- if (tnet_ice_ctx_is_turn_rtcp_active(p_ice_ctx)) {
- tnet_ice_ctx_send_turn_rtcp(p_ice_ctx, kTurnData, sizeof(kTurnData));
- }
- }
- }
- break;
- }
- }
+ struct tnet_ice_ctx_s *p_ice_ctx = (struct tnet_ice_ctx_s *)e->ctx;
+ int ret = 0;
+
+ TSK_DEBUG_INFO("ICE state callback: %s", e->phrase);
+
+ switch(e->type) {
+ case tnet_ice_event_type_gathering_completed: {
+ test_ice_print_local_candidates(p_ice_ctx);
+ if (p_ice_ctx == p_ice_ctx1) {
+ if ((ret = tnet_ice_ctx_start(p_ice_ctx2))) {
+ goto bail;
+ }
+ }
+ else {
+ const tnet_ice_candidate_t* candidate;
+ char* p_cand;
+
+ p_cand = test_ice_get_local_candidates(p_ice_ctx2);
+ candidate = tnet_ice_ctx_get_local_candidate_first(p_ice_ctx2);
+ ret = tnet_ice_ctx_set_remote_candidates(p_ice_ctx1, p_cand, candidate->ufrag, candidate->pwd, tsk_true, tsk_false);
+ if (ret == 0) {
+ TSK_FREE(p_cand);
+ p_cand = test_ice_get_local_candidates(p_ice_ctx1);
+ candidate = tnet_ice_ctx_get_local_candidate_first(p_ice_ctx1);
+ ret = tnet_ice_ctx_set_remote_candidates(p_ice_ctx2, p_cand, candidate->ufrag, candidate->pwd, tsk_false, tsk_false);
+ TSK_FREE(p_cand);
+ }
+ }
+ break;
+ }
+
+ case tnet_ice_event_type_conncheck_succeed: {
+ const char kTurnData[] = "TURN data to send for testing";
+ const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
+
+ // === RTP === //
+ ret = tnet_ice_ctx_get_nominated_symetric_candidates(p_ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ if (ret == 0) {
+ TSK_DEBUG_INFO("Nominated candidate(RTP): Offer=[[%s]], AnswerSrc=[[%s]], AnswerDest=[[%s]]",
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_offer),
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_src),
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_dest));
+
+ if (tnet_ice_ctx_is_turn_rtp_active(p_ice_ctx)) {
+ tnet_ice_ctx_send_turn_rtp(p_ice_ctx, kTurnData, sizeof(kTurnData));
+ }
+ }
+ // === RTCP === //
+ if (use_rtcp) {
+ ret = tnet_ice_ctx_get_nominated_symetric_candidates(p_ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTCP, &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ if (ret == 0) {
+ TSK_DEBUG_INFO("Nominated candidate(RTCP): Offer=[[%s]], AnswerSrc=[[%s]], AnswerDest=[[%s]]",
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_offer),
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_src),
+ tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate_answer_dest));
+ if (tnet_ice_ctx_is_turn_rtcp_active(p_ice_ctx)) {
+ tnet_ice_ctx_send_turn_rtcp(p_ice_ctx, kTurnData, sizeof(kTurnData));
+ }
+ }
+ }
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
void test_ice()
{
- int ret;
- static const tsk_bool_t use_ipv6 = tsk_false;
- static const tsk_bool_t use_ice_jingle = tsk_false;
- static const tsk_bool_t use_video = tsk_false;
-
- if (!(p_ice_ctx1 = tnet_ice_ctx_create(use_ice_jingle, use_ipv6, use_rtcp, use_video, test_ice_state_callback, tsk_null))) {
- goto bail;
- }
- if (!(p_ice_ctx2 = tnet_ice_ctx_create(use_ice_jingle, use_ipv6, use_rtcp, use_video, test_ice_state_callback, tsk_null))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_turn_enabled(p_ice_ctx1, 1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_turn_enabled(p_ice_ctx2, 1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_stun_enabled(p_ice_ctx1, 1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_stun_enabled(p_ice_ctx2, 1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_userdata(p_ice_ctx1, p_ice_ctx1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_userdata(p_ice_ctx2, p_ice_ctx2))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_rtp_callback(p_ice_ctx1, test_ice_rtp_callback, p_ice_ctx1))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_rtp_callback(p_ice_ctx2, test_ice_rtp_callback, p_ice_ctx2))) {
- goto bail;
- }
+ int ret;
+ static const tsk_bool_t use_ipv6 = tsk_false;
+ static const tsk_bool_t use_ice_jingle = tsk_false;
+ static const tsk_bool_t use_video = tsk_false;
+
+ if (!(p_ice_ctx1 = tnet_ice_ctx_create(use_ice_jingle, use_ipv6, use_rtcp, use_video, test_ice_state_callback, tsk_null))) {
+ goto bail;
+ }
+ if (!(p_ice_ctx2 = tnet_ice_ctx_create(use_ice_jingle, use_ipv6, use_rtcp, use_video, test_ice_state_callback, tsk_null))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_turn_enabled(p_ice_ctx1, 1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_turn_enabled(p_ice_ctx2, 1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_stun_enabled(p_ice_ctx1, 1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_stun_enabled(p_ice_ctx2, 1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_userdata(p_ice_ctx1, p_ice_ctx1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_userdata(p_ice_ctx2, p_ice_ctx2))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_rtp_callback(p_ice_ctx1, test_ice_rtp_callback, p_ice_ctx1))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_rtp_callback(p_ice_ctx2, test_ice_rtp_callback, p_ice_ctx2))) {
+ goto bail;
+ }
#if 0 //@deprecated
- if ((ret = tnet_ice_ctx_set_stun(p_ice_ctx1, kStunServerIP, 3478, kStunSoftware, kStunUsrName, kStunPwd))) {
- goto bail;
- }
- if ((ret = tnet_ice_ctx_set_stun(p_ice_ctx2, kStunServerIP, 3478, kStunSoftware, kStunUsrName, kStunPwd))) {
- goto bail;
- }
+ if ((ret = tnet_ice_ctx_set_stun(p_ice_ctx1, kStunServerIP, 3478, kStunSoftware, kStunUsrName, kStunPwd))) {
+ goto bail;
+ }
+ if ((ret = tnet_ice_ctx_set_stun(p_ice_ctx2, kStunServerIP, 3478, kStunSoftware, kStunUsrName, kStunPwd))) {
+ goto bail;
+ }
#else
- tnet_ice_ctx_add_server(p_ice_ctx1, "udp", kStunServerIP, 3478, kTurnFalse, kStunTrue, kStunUsrName, kStunPwd); // STUN-UDP
- tnet_ice_ctx_add_server(p_ice_ctx1, "tcp", kStunServerIP, 3478, kTurnTrue, kStunFalse, kStunUsrName, kStunPwd); // TURN-TCP
- tnet_ice_ctx_add_server(p_ice_ctx2, "udp", kStunServerIP, 3478, kTurnFalse, kStunTrue, kStunUsrName, kStunPwd); // STUN-UDP
- tnet_ice_ctx_add_server(p_ice_ctx2, "tcp", kStunServerIP, 3478, kTurnTrue, kStunFalse, kStunUsrName, kStunPwd); // TURN-TCP
+ tnet_ice_ctx_add_server(p_ice_ctx1, "udp", kStunServerIP, 3478, kTurnFalse, kStunTrue, kStunUsrName, kStunPwd); // STUN-UDP
+ tnet_ice_ctx_add_server(p_ice_ctx1, "tcp", kStunServerIP, 3478, kTurnTrue, kStunFalse, kStunUsrName, kStunPwd); // TURN-TCP
+ tnet_ice_ctx_add_server(p_ice_ctx2, "udp", kStunServerIP, 3478, kTurnFalse, kStunTrue, kStunUsrName, kStunPwd); // STUN-UDP
+ tnet_ice_ctx_add_server(p_ice_ctx2, "tcp", kStunServerIP, 3478, kTurnTrue, kStunFalse, kStunUsrName, kStunPwd); // TURN-TCP
#endif
- if ((ret = tnet_ice_ctx_start(p_ice_ctx1))) {
- goto bail;
- }
- // start ctx2 when we finish gathering ctx1's candidates
- //if ((ret = tnet_ice_ctx_start(p_ice_ctx2))) {
- // goto bail;
- //}
-
- getchar();
-
- // ret = tnet_ice_ctx_stop(p_ice_ctx1);
- // ret = tnet_ice_ctx_stop(p_ice_ctx2);
+ if ((ret = tnet_ice_ctx_start(p_ice_ctx1))) {
+ goto bail;
+ }
+ // start ctx2 when we finish gathering ctx1's candidates
+ //if ((ret = tnet_ice_ctx_start(p_ice_ctx2))) {
+ // goto bail;
+ //}
+
+ getchar();
+
+ // ret = tnet_ice_ctx_stop(p_ice_ctx1);
+ // ret = tnet_ice_ctx_stop(p_ice_ctx2);
bail:
- TSK_OBJECT_SAFE_FREE(p_ice_ctx1);
- TSK_OBJECT_SAFE_FREE(p_ice_ctx2);
+ TSK_OBJECT_SAFE_FREE(p_ice_ctx1);
+ TSK_OBJECT_SAFE_FREE(p_ice_ctx2);
}
diff --git a/tinyNET/test/test_ifaces.h b/tinyNET/test/test_ifaces.h
index 2fd4e43..a1cf920 100755
--- a/tinyNET/test/test_ifaces.h
+++ b/tinyNET/test/test_ifaces.h
@@ -21,79 +21,73 @@
void test_faces_bestsource()
{
- tnet_ip_t source;
+ tnet_ip_t source;
// IPv6
- if(!tnet_getbestsource("fe80::fe4c:3ea1", 5060, tnet_socket_type_udp_ipv6, &source)){
- TSK_DEBUG_INFO("Best IPv6 source is [%s]", source);
- }
- else{
- TSK_DEBUG_ERROR("Failed to get best IPv6 source.");
- }
+ if(!tnet_getbestsource("fe80::fe4c:3ea1", 5060, tnet_socket_type_udp_ipv6, &source)) {
+ TSK_DEBUG_INFO("Best IPv6 source is [%s]", source);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to get best IPv6 source.");
+ }
// IPv6
- if(!tnet_getbestsource("2a01:e35:8b32:7050:212:f0ff:fe4c:3ea1", 5060, tnet_socket_type_udp_ipv6, &source)){
- TSK_DEBUG_INFO("Best IPv6 source is [%s]", source);
- }
- else{
- TSK_DEBUG_ERROR("Failed to get best IPv6 source.");
- }
- // IPv4
- if(!tnet_getbestsource("192.168.0.11", 5060, tnet_socket_type_udp_ipv4, &source)){
- TSK_DEBUG_INFO("Best IPv4 source is [%s]", source);
- }
- else{
- TSK_DEBUG_ERROR("Failed to get best IPv4 source.");
- }
+ if(!tnet_getbestsource("2a01:e35:8b32:7050:212:f0ff:fe4c:3ea1", 5060, tnet_socket_type_udp_ipv6, &source)) {
+ TSK_DEBUG_INFO("Best IPv6 source is [%s]", source);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to get best IPv6 source.");
+ }
+ // IPv4
+ if(!tnet_getbestsource("192.168.0.11", 5060, tnet_socket_type_udp_ipv4, &source)) {
+ TSK_DEBUG_INFO("Best IPv4 source is [%s]", source);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to get best IPv4 source.");
+ }
}
void test_ifaces_dump_ifaces()
{
- tnet_interfaces_L_t* ifaces = tnet_get_interfaces();
- tsk_list_item_t *item;
+ tnet_interfaces_L_t* ifaces = tnet_get_interfaces();
+ tsk_list_item_t *item;
- tsk_list_foreach(item, ifaces)
- {
- const tnet_interface_t *iface = item->data;
- TSK_DEBUG_INFO("Interface: %s", iface->description);
- }
+ tsk_list_foreach(item, ifaces) {
+ const tnet_interface_t *iface = item->data;
+ TSK_DEBUG_INFO("Interface: %s", iface->description);
+ }
- TSK_OBJECT_SAFE_FREE(ifaces);
+ TSK_OBJECT_SAFE_FREE(ifaces);
}
void test_ifaces_dump_addresses()
{
- tnet_addresses_L_t* addresses = tnet_get_addresses_all();
- tsk_list_item_t *item;
+ tnet_addresses_L_t* addresses = tnet_get_addresses_all();
+ tsk_list_item_t *item;
- tsk_list_foreach(item, addresses)
- {
- const tnet_address_t *address = item->data;
- if(address->anycast)
- {
- TSK_DEBUG_INFO("ANYCAST address: %s", address->ip);
- }
- else if(address->unicast)
- {
- TSK_DEBUG_INFO("UNICAST address: %s", address->ip);
- }
- else if(address->multicast)
- {
- TSK_DEBUG_INFO("MULTICAST address: %s", address->ip);
- }
- else if(address->dnsserver)
- {
- TSK_DEBUG_INFO("DNSSERVER address: %s", address->ip);
- }
- }
+ tsk_list_foreach(item, addresses) {
+ const tnet_address_t *address = item->data;
+ if(address->anycast) {
+ TSK_DEBUG_INFO("ANYCAST address: %s", address->ip);
+ }
+ else if(address->unicast) {
+ TSK_DEBUG_INFO("UNICAST address: %s", address->ip);
+ }
+ else if(address->multicast) {
+ TSK_DEBUG_INFO("MULTICAST address: %s", address->ip);
+ }
+ else if(address->dnsserver) {
+ TSK_DEBUG_INFO("DNSSERVER address: %s", address->ip);
+ }
+ }
- TSK_OBJECT_SAFE_FREE(addresses);
+ TSK_OBJECT_SAFE_FREE(addresses);
}
void test_ifaces()
{
- test_faces_bestsource();
- test_ifaces_dump_ifaces();
- test_ifaces_dump_addresses();
+ test_faces_bestsource();
+ test_ifaces_dump_ifaces();
+ test_ifaces_dump_addresses();
}
#endif /* TNET_TEST_IFACES_H */
diff --git a/tinyNET/test/test_nat.h b/tinyNET/test/test_nat.h
index 1a9bd68..c9723d0 100755
--- a/tinyNET/test/test_nat.h
+++ b/tinyNET/test/test_nat.h
@@ -27,55 +27,55 @@
void test_nat_stun()
{
- tnet_socket_t *socket1 = 0, *socket2 = 0;
- struct tnet_nat_ctx_s *context = 0;
+ tnet_socket_t *socket1 = 0, *socket2 = 0;
+ struct tnet_nat_ctx_s *context = 0;
- tnet_stun_binding_id_t bind_id1, bind_id2;
+ tnet_stun_binding_id_t bind_id1, bind_id2;
- char* public_ip1 = 0, *public_ip2 = 0;
- tnet_port_t public_port1 = 0, public_port2 = 0;
-
- if(!(socket1 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO))
- || !(socket2 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO))) {
- goto bail;
- }
+ char* public_ip1 = 0, *public_ip2 = 0;
+ tnet_port_t public_port1 = 0, public_port2 = 0;
- context = tnet_nat_context_create(STUN_SERVER_PROTO, STUN_USERNAME, STUN_PASSWORD);
+ if(!(socket1 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO))
+ || !(socket2 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO))) {
+ goto bail;
+ }
- if(tnet_nat_set_server_address(context, STUN_SERVER_IP)) {
- TSK_DEBUG_ERROR("Failed to set STUN/TURN address.");
- goto bail;
- }
+ context = tnet_nat_context_create(STUN_SERVER_PROTO, STUN_USERNAME, STUN_PASSWORD);
- // == BIND == //
- bind_id1 = tnet_nat_stun_bind(context, socket1->fd);
- bind_id2 = tnet_nat_stun_bind(context, socket2->fd);
+ if(tnet_nat_set_server_address(context, STUN_SERVER_IP)) {
+ TSK_DEBUG_ERROR("Failed to set STUN/TURN address.");
+ goto bail;
+ }
- if(!bind_id1 || !bind_id2) {
- TSK_DEBUG_ERROR("Failed to get public IP/port using stun");
- goto bail;
- }
+ // == BIND == //
+ bind_id1 = tnet_nat_stun_bind(context, socket1->fd);
+ bind_id2 = tnet_nat_stun_bind(context, socket2->fd);
- if (tnet_nat_stun_get_reflexive_address(context, bind_id1, &public_ip1, &public_port1) == 0) {
- TSK_DEBUG_INFO("Public IP1/Port1 ==> %s:%u", public_ip1, public_port1);
- }
+ if(!bind_id1 || !bind_id2) {
+ TSK_DEBUG_ERROR("Failed to get public IP/port using stun");
+ goto bail;
+ }
- if (tnet_nat_stun_get_reflexive_address(context, bind_id2, &public_ip2, &public_port2) == 0) {
- TSK_DEBUG_INFO("Public IP2/Port2 ==> %s:%u", public_ip2, public_port2);
- }
+ if (tnet_nat_stun_get_reflexive_address(context, bind_id1, &public_ip1, &public_port1) == 0) {
+ TSK_DEBUG_INFO("Public IP1/Port1 ==> %s:%u", public_ip1, public_port1);
+ }
- // == UNBIND == //
- tnet_nat_stun_unbind(context, bind_id1);
- tnet_nat_stun_unbind(context, bind_id2);
+ if (tnet_nat_stun_get_reflexive_address(context, bind_id2, &public_ip2, &public_port2) == 0) {
+ TSK_DEBUG_INFO("Public IP2/Port2 ==> %s:%u", public_ip2, public_port2);
+ }
+
+ // == UNBIND == //
+ tnet_nat_stun_unbind(context, bind_id1);
+ tnet_nat_stun_unbind(context, bind_id2);
bail:
- TSK_OBJECT_SAFE_FREE(socket1);
- TSK_OBJECT_SAFE_FREE(socket2);
+ TSK_OBJECT_SAFE_FREE(socket1);
+ TSK_OBJECT_SAFE_FREE(socket2);
- TSK_FREE(public_ip1);
- TSK_FREE(public_ip1);
+ TSK_FREE(public_ip1);
+ TSK_FREE(public_ip1);
- TSK_OBJECT_SAFE_FREE(context);
+ TSK_OBJECT_SAFE_FREE(context);
}
void test_nat_turn()
@@ -90,7 +90,7 @@ void test_nat_turn()
// tnet_turn_channel_binding_id_t channel_id;
//
// int ret;
-//
+//
// if(!(socket1 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO))
// || !(socket2 = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, STUN_SERVER_PROTO)))
// {
@@ -201,9 +201,9 @@ void test_nat_turn()
void test_nat()
{
- test_nat_stun();
- //test_nat_turn();
- //tsk_thread_sleep(1000);
+ test_nat_stun();
+ //test_nat_turn();
+ //tsk_thread_sleep(1000);
}
diff --git a/tinyNET/test/test_sockets.h b/tinyNET/test/test_sockets.h
index 3edd1bd..857ce6b 100755
--- a/tinyNET/test/test_sockets.h
+++ b/tinyNET/test/test_sockets.h
@@ -21,41 +21,40 @@
void test_sockets()
{
- int test;
- tnet_socket_tcp_t * tcp_socket;
- tnet_socket_type_t type = tnet_socket_type_udp_ipv4;
- struct sockaddr_storage to;
-
- TNET_SOCKET_TYPE_SET_IPV4(type);
- TNET_SOCKET_TYPE_SET_IPV6(type);
- TNET_SOCKET_TYPE_SET_IPV4Only(type);
- TNET_SOCKET_TYPE_SET_IPV6Only(type);
- TNET_SOCKET_TYPE_SET_IPV6Only(type);
- TNET_SOCKET_TYPE_SET_IPV4(type);
- TNET_SOCKET_TYPE_SET_IPV6(type);
-
- TNET_SOCKET_TYPE_SET_TLS(type);
- TNET_SOCKET_TYPE_SET_UDP(type);
- TNET_SOCKET_TYPE_SET_SCTP(type);
- TNET_SOCKET_TYPE_SET_TCP(type);
-
- tcp_socket = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, type);
-
- if(!TNET_SOCKET_IS_VALID(tcp_socket))
- {
- TSK_OBJECT_SAFE_FREE(tcp_socket);
- return;
- }
-
- //if(!(test = tnet_sockaddr_init("www.google.com", 80, type, &to))){
- // test = tnet_sockfd_connetto(tcp_socket->fd, (const struct sockaddr_storage *)&to);
- //}
-
- if(!(test = tnet_sockaddr_init("ipv6.google.com", 80, type, &to))){
- test = tnet_sockfd_connectto(tcp_socket->fd, (const struct sockaddr_storage *)&to);
- }
-
- TSK_OBJECT_SAFE_FREE(tcp_socket);
+ int test;
+ tnet_socket_tcp_t * tcp_socket;
+ tnet_socket_type_t type = tnet_socket_type_udp_ipv4;
+ struct sockaddr_storage to;
+
+ TNET_SOCKET_TYPE_SET_IPV4(type);
+ TNET_SOCKET_TYPE_SET_IPV6(type);
+ TNET_SOCKET_TYPE_SET_IPV4Only(type);
+ TNET_SOCKET_TYPE_SET_IPV6Only(type);
+ TNET_SOCKET_TYPE_SET_IPV6Only(type);
+ TNET_SOCKET_TYPE_SET_IPV4(type);
+ TNET_SOCKET_TYPE_SET_IPV6(type);
+
+ TNET_SOCKET_TYPE_SET_TLS(type);
+ TNET_SOCKET_TYPE_SET_UDP(type);
+ TNET_SOCKET_TYPE_SET_SCTP(type);
+ TNET_SOCKET_TYPE_SET_TCP(type);
+
+ tcp_socket = tnet_socket_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, type);
+
+ if(!TNET_SOCKET_IS_VALID(tcp_socket)) {
+ TSK_OBJECT_SAFE_FREE(tcp_socket);
+ return;
+ }
+
+ //if(!(test = tnet_sockaddr_init("www.google.com", 80, type, &to))){
+ // test = tnet_sockfd_connetto(tcp_socket->fd, (const struct sockaddr_storage *)&to);
+ //}
+
+ if(!(test = tnet_sockaddr_init("ipv6.google.com", 80, type, &to))) {
+ test = tnet_sockfd_connectto(tcp_socket->fd, (const struct sockaddr_storage *)&to);
+ }
+
+ TSK_OBJECT_SAFE_FREE(tcp_socket);
}
#endif /* TNET_TEST_SOCKETS_H */
diff --git a/tinyNET/test/test_stun.h b/tinyNET/test/test_stun.h
index 58fc9b1..cc9033b 100755
--- a/tinyNET/test/test_stun.h
+++ b/tinyNET/test/test_stun.h
@@ -65,79 +65,79 @@ static int test_stun_buff_cmp(const uint8_t* pc_buf1_ptr, tsk_size_t n_buff1_siz
static void test_stun_parser()
{
- tnet_stun_pkt_t* p_pkt = tsk_null;
- tsk_size_t n_written_bytes, n_read_bytes;
- static const char* __pc_mapped_addr_ipv4 = "192.168.0.37";
- static const char* __pc_mapped_addr_ipv6 = "fdf8:f53b:82e4::53";
- static const uint16_t __u_mapped_addr_port = 5060;
- static const char __pc_username[] = "Mamadou DIOP";
- static const uint16_t __u_username = sizeof(__pc_username);
- static const char __pc_integrity[TSK_SHA1_DIGEST_SIZE] = { 0 };
- static const uint16_t __u_integrity = sizeof(__pc_integrity);
- static const uint32_t __u_fingerprint = 19831983;
- static const uint8_t __u_error_class = 4; // (4 * 100) = 404
- static const uint8_t __u_error_number = 4; // + 4 = 404
- static const char* __pc_error_reason = "Not Found";
- tnet_stun_addr_t addr_ipv4, addr_ipv6;
- static const char __pc_realm[] = "doubango.org";
- static const uint16_t __u_realm = sizeof(__pc_realm);
- static const char __pc_nonce[128] = { 0 };
- static const uint16_t __u_nonce = sizeof(__pc_nonce);
- static const char __pc_software[] = "tinyNET 2.0";
- static const uint16_t __u_software = sizeof(__pc_software);
- static const uint32_t __u_life_time = 600;
- static const uint32_t __u_req_transport = 17; // UDP
+ tnet_stun_pkt_t* p_pkt = tsk_null;
+ tsk_size_t n_written_bytes, n_read_bytes;
+ static const char* __pc_mapped_addr_ipv4 = "192.168.0.37";
+ static const char* __pc_mapped_addr_ipv6 = "fdf8:f53b:82e4::53";
+ static const uint16_t __u_mapped_addr_port = 5060;
+ static const char __pc_username[] = "Mamadou DIOP";
+ static const uint16_t __u_username = sizeof(__pc_username);
+ static const char __pc_integrity[TSK_SHA1_DIGEST_SIZE] = { 0 };
+ static const uint16_t __u_integrity = sizeof(__pc_integrity);
+ static const uint32_t __u_fingerprint = 19831983;
+ static const uint8_t __u_error_class = 4; // (4 * 100) = 404
+ static const uint8_t __u_error_number = 4; // + 4 = 404
+ static const char* __pc_error_reason = "Not Found";
+ tnet_stun_addr_t addr_ipv4, addr_ipv6;
+ static const char __pc_realm[] = "doubango.org";
+ static const uint16_t __u_realm = sizeof(__pc_realm);
+ static const char __pc_nonce[128] = { 0 };
+ static const uint16_t __u_nonce = sizeof(__pc_nonce);
+ static const char __pc_software[] = "tinyNET 2.0";
+ static const uint16_t __u_software = sizeof(__pc_software);
+ static const uint32_t __u_life_time = 600;
+ static const uint32_t __u_req_transport = 17; // UDP
(n_read_bytes);
- BAIL_IF_ERR(tnet_stun_pkt_create_empty(tnet_stun_pkt_type_binding_request, &p_pkt));
- BAIL_IF_ERR(tnet_stun_utils_inet_pton_v4(__pc_mapped_addr_ipv4, &addr_ipv4));
- BAIL_IF_ERR(tnet_stun_utils_inet_pton_v6(__pc_mapped_addr_ipv6, &addr_ipv6));
- BAIL_IF_ERR(tnet_stun_pkt_attrs_add(p_pkt,
- TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS_V4(__u_mapped_addr_port, &addr_ipv4),
- TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS_V6(__u_mapped_addr_port, &addr_ipv6),
- TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS_V4(__u_mapped_addr_port, &addr_ipv4),
- TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS_V6(__u_mapped_addr_port, &addr_ipv6),
- TNET_STUN_PKT_ATTR_ADD_USERNAME_ZT(__pc_username),
- TNET_STUN_PKT_ATTR_ADD_MESSAGE_INTEGRITY(__pc_integrity, __u_integrity),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE(__u_error_class, __u_error_number, __pc_error_reason),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_TRY_ALTERNATE(),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_BAD_REQUEST(),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_UNAUTHORIZED(),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_UNKNOWN_ATTRIBUTE(),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_STALE_NONCE(),
- TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_SERVER_ERROR(),
- TNET_STUN_PKT_ATTR_ADD_REALM_ZT(__pc_realm),
- TNET_STUN_PKT_ATTR_ADD_NONCE(__pc_nonce, __u_nonce),
-
- TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS(
- TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0001), // MAPPED-ADDRESS
- TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0006), // USERNAME
- TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0007), // PASSWORD
- TNET_STUN_PKT_ATTR_ADD_NULL()),
-
- TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(__pc_software),
- TNET_STUN_PKT_ATTR_ADD_ALTERNATE_SERVER_V4(__u_mapped_addr_port, &addr_ipv4),
- TNET_STUN_PKT_ATTR_ADD_ALTERNATE_SERVER_V6(__u_mapped_addr_port, &addr_ipv6),
- TNET_STUN_PKT_ATTR_ADD_LIFETIME(__u_life_time),
- TNET_STUN_PKT_ATTR_ADD_REQUESTED_TRANSPORT(__u_req_transport),
- TNET_STUN_PKT_ATTR_ADD_DONT_FRAGMENT(),
-
- TNET_STUN_PKT_ATTR_ADD_FINGERPRINT(__u_fingerprint),
- TNET_STUN_PKT_ATTR_ADD_NULL()));
- BAIL_IF_ERR(tnet_stun_pkt_write_with_padding(p_pkt, __parse_buff_write_ptr, __parse_buff_write_size, &n_written_bytes));
- TNET_TEST_STUN_SEND_BUFF(__parse_buff_write_ptr, n_written_bytes);
-
- TSK_OBJECT_SAFE_FREE(p_pkt);
- BAIL_IF_ERR(tnet_stun_pkt_read(__parse_buff_write_ptr, n_written_bytes, &p_pkt));
- BAIL_IF_ERR(tnet_stun_pkt_write_with_padding(p_pkt, __parse_buff_read_ptr, __parse_buff_read_size, &n_read_bytes));
- //TNET_TEST_STUN_SEND_BUFF(__parse_buff_read_ptr, n_read_bytes);
-
- BAIL_IF_ERR(test_stun_buff_cmp(__parse_buff_write_ptr, n_written_bytes, __parse_buff_read_ptr, n_read_bytes));
+ BAIL_IF_ERR(tnet_stun_pkt_create_empty(tnet_stun_pkt_type_binding_request, &p_pkt));
+ BAIL_IF_ERR(tnet_stun_utils_inet_pton_v4(__pc_mapped_addr_ipv4, &addr_ipv4));
+ BAIL_IF_ERR(tnet_stun_utils_inet_pton_v6(__pc_mapped_addr_ipv6, &addr_ipv6));
+ BAIL_IF_ERR(tnet_stun_pkt_attrs_add(p_pkt,
+ TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS_V4(__u_mapped_addr_port, &addr_ipv4),
+ TNET_STUN_PKT_ATTR_ADD_MAPPED_ADDRESS_V6(__u_mapped_addr_port, &addr_ipv6),
+ TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS_V4(__u_mapped_addr_port, &addr_ipv4),
+ TNET_STUN_PKT_ATTR_ADD_XOR_MAPPED_ADDRESS_V6(__u_mapped_addr_port, &addr_ipv6),
+ TNET_STUN_PKT_ATTR_ADD_USERNAME_ZT(__pc_username),
+ TNET_STUN_PKT_ATTR_ADD_MESSAGE_INTEGRITY(__pc_integrity, __u_integrity),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE(__u_error_class, __u_error_number, __pc_error_reason),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_TRY_ALTERNATE(),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_BAD_REQUEST(),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_UNAUTHORIZED(),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_UNKNOWN_ATTRIBUTE(),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_STALE_NONCE(),
+ TNET_STUN_PKT_ATTR_ADD_ERROR_CODE_SERVER_ERROR(),
+ TNET_STUN_PKT_ATTR_ADD_REALM_ZT(__pc_realm),
+ TNET_STUN_PKT_ATTR_ADD_NONCE(__pc_nonce, __u_nonce),
+
+ TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS(
+ TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0001), // MAPPED-ADDRESS
+ TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0006), // USERNAME
+ TNET_STUN_PKT_ATTR_ADD_UNKNOWN_ATTRS_VAL(0x0007), // PASSWORD
+ TNET_STUN_PKT_ATTR_ADD_NULL()),
+
+ TNET_STUN_PKT_ATTR_ADD_SOFTWARE_ZT(__pc_software),
+ TNET_STUN_PKT_ATTR_ADD_ALTERNATE_SERVER_V4(__u_mapped_addr_port, &addr_ipv4),
+ TNET_STUN_PKT_ATTR_ADD_ALTERNATE_SERVER_V6(__u_mapped_addr_port, &addr_ipv6),
+ TNET_STUN_PKT_ATTR_ADD_LIFETIME(__u_life_time),
+ TNET_STUN_PKT_ATTR_ADD_REQUESTED_TRANSPORT(__u_req_transport),
+ TNET_STUN_PKT_ATTR_ADD_DONT_FRAGMENT(),
+
+ TNET_STUN_PKT_ATTR_ADD_FINGERPRINT(__u_fingerprint),
+ TNET_STUN_PKT_ATTR_ADD_NULL()));
+ BAIL_IF_ERR(tnet_stun_pkt_write_with_padding(p_pkt, __parse_buff_write_ptr, __parse_buff_write_size, &n_written_bytes));
+ TNET_TEST_STUN_SEND_BUFF(__parse_buff_write_ptr, n_written_bytes);
+
+ TSK_OBJECT_SAFE_FREE(p_pkt);
+ BAIL_IF_ERR(tnet_stun_pkt_read(__parse_buff_write_ptr, n_written_bytes, &p_pkt));
+ BAIL_IF_ERR(tnet_stun_pkt_write_with_padding(p_pkt, __parse_buff_read_ptr, __parse_buff_read_size, &n_read_bytes));
+ //TNET_TEST_STUN_SEND_BUFF(__parse_buff_read_ptr, n_read_bytes);
+
+ BAIL_IF_ERR(test_stun_buff_cmp(__parse_buff_write_ptr, n_written_bytes, __parse_buff_read_ptr, n_read_bytes));
TSK_DEBUG_INFO("test_stun_parser...OK");
bail:
- TSK_OBJECT_SAFE_FREE(p_pkt);
+ TSK_OBJECT_SAFE_FREE(p_pkt);
}
static struct tnet_turn_session_s* __pc_ss1 = tsk_null;
@@ -153,103 +153,95 @@ static tnet_turn_peer_id_t __u_peer_id2 = kTurnPeerIdInvalid;
static int _test_turn_session_callback(const struct tnet_turn_session_event_xs *e)
{
- const struct tnet_turn_session_s* pc_ss = (const struct tnet_turn_session_s*)e->pc_usr_data;
- int ret = 0;
- switch (e->e_type) {
- case tnet_turn_session_event_type_alloc_ok:
- {
- uint16_t *pu_port = (pc_ss == __pc_ss2) ? &__u_rel_port_ss1 : &__u_rel_port_ss2;
- char** pp_ip = (pc_ss == __pc_ss2) ? &__p_rel_ip_ss1 : &__p_rel_ip_ss2;
- tsk_bool_t *pb_ipv6 = (pc_ss == __pc_ss2) ? &__b_rel_ipv6_ss1 : &__b_rel_ipv6_ss2;
- tnet_turn_peer_id_t *pu_peer_id = (pc_ss == __pc_ss2) ? &__u_peer_id2 : &__u_peer_id1;
-
- BAIL_IF_ERR(tnet_turn_session_get_relayed_addr(pc_ss, pp_ip, pu_port, pb_ipv6));
- // BAIL_IF_ERR(tnet_turn_session_get_srflx_addr(pc_ss, pu_port, &u_port, &b_ipv6)); // get my own server reflexive address (in order to send data to myself)
- BAIL_IF_ERR(tnet_turn_session_createpermission((struct tnet_turn_session_s*)pc_ss, *pp_ip, *pu_port, pu_peer_id)); // Input = ADDR(remote.candidate.relay)
- break;
- }
- case tnet_turn_session_event_type_alloc_nok:
- {
- TSK_DEBUG_INFO("*** TURN ALLOC NOK ***");
- break;
- }
- case tnet_turn_session_event_type_perm_ok:
- {
- static const char __pc_data[] = { "TURN Sample Data (Send Indication)" };
- int i;
- tnet_turn_peer_id_t u_peer_id = (pc_ss == __pc_ss2) ? __u_peer_id2 : __u_peer_id1;
- // Bind a channel (not required). If succeed, will be used to save data.
- tnet_turn_session_chanbind((struct tnet_turn_session_s*)pc_ss, u_peer_id);
- // Send data (will use channel if one is active. Otherwise (no channel), SendIndications will be used)
- for (i = 0; i < 10; ++i) {
- BAIL_IF_ERR(tnet_turn_session_send_data((struct tnet_turn_session_s*)pc_ss, u_peer_id, __pc_data, sizeof(__pc_data)));
- }
- break;
- }
- case tnet_turn_session_event_type_perm_nok:
- {
- TSK_DEBUG_INFO("*** TURN PERM NOK ***");
- break;
- }
- case tnet_turn_session_event_type_chanbind_ok:
- {
- static const char __pc_data[] = { "TURN Sample Data (ChannelData)" };
- int i;
- tnet_turn_peer_id_t u_peer_id = (pc_ss == __pc_ss2) ? __u_peer_id2 : __u_peer_id1;
- for (i = 0; i < 10; ++i) {
- BAIL_IF_ERR(tnet_turn_session_send_data((struct tnet_turn_session_s*)pc_ss, u_peer_id, __pc_data, sizeof(__pc_data)));
- }
- break;
- }
- case tnet_turn_session_event_type_chanbind_nok:
- {
- TSK_DEBUG_INFO("*** TURN CHANBIND NOK ***");
- break;
- }
- case tnet_turn_session_event_type_recv_data:
- {
- TSK_DEBUG_INFO("RECV DATA:%.*s", e->data.u_data_size, (const char*)e->data.pc_data_ptr);
- break;
- }
- default:
- {
- break;
- }
- }
+ const struct tnet_turn_session_s* pc_ss = (const struct tnet_turn_session_s*)e->pc_usr_data;
+ int ret = 0;
+ switch (e->e_type) {
+ case tnet_turn_session_event_type_alloc_ok: {
+ uint16_t *pu_port = (pc_ss == __pc_ss2) ? &__u_rel_port_ss1 : &__u_rel_port_ss2;
+ char** pp_ip = (pc_ss == __pc_ss2) ? &__p_rel_ip_ss1 : &__p_rel_ip_ss2;
+ tsk_bool_t *pb_ipv6 = (pc_ss == __pc_ss2) ? &__b_rel_ipv6_ss1 : &__b_rel_ipv6_ss2;
+ tnet_turn_peer_id_t *pu_peer_id = (pc_ss == __pc_ss2) ? &__u_peer_id2 : &__u_peer_id1;
+
+ BAIL_IF_ERR(tnet_turn_session_get_relayed_addr(pc_ss, pp_ip, pu_port, pb_ipv6));
+ // BAIL_IF_ERR(tnet_turn_session_get_srflx_addr(pc_ss, pu_port, &u_port, &b_ipv6)); // get my own server reflexive address (in order to send data to myself)
+ BAIL_IF_ERR(tnet_turn_session_createpermission((struct tnet_turn_session_s*)pc_ss, *pp_ip, *pu_port, pu_peer_id)); // Input = ADDR(remote.candidate.relay)
+ break;
+ }
+ case tnet_turn_session_event_type_alloc_nok: {
+ TSK_DEBUG_INFO("*** TURN ALLOC NOK ***");
+ break;
+ }
+ case tnet_turn_session_event_type_perm_ok: {
+ static const char __pc_data[] = { "TURN Sample Data (Send Indication)" };
+ int i;
+ tnet_turn_peer_id_t u_peer_id = (pc_ss == __pc_ss2) ? __u_peer_id2 : __u_peer_id1;
+ // Bind a channel (not required). If succeed, will be used to save data.
+ tnet_turn_session_chanbind((struct tnet_turn_session_s*)pc_ss, u_peer_id);
+ // Send data (will use channel if one is active. Otherwise (no channel), SendIndications will be used)
+ for (i = 0; i < 10; ++i) {
+ BAIL_IF_ERR(tnet_turn_session_send_data((struct tnet_turn_session_s*)pc_ss, u_peer_id, __pc_data, sizeof(__pc_data)));
+ }
+ break;
+ }
+ case tnet_turn_session_event_type_perm_nok: {
+ TSK_DEBUG_INFO("*** TURN PERM NOK ***");
+ break;
+ }
+ case tnet_turn_session_event_type_chanbind_ok: {
+ static const char __pc_data[] = { "TURN Sample Data (ChannelData)" };
+ int i;
+ tnet_turn_peer_id_t u_peer_id = (pc_ss == __pc_ss2) ? __u_peer_id2 : __u_peer_id1;
+ for (i = 0; i < 10; ++i) {
+ BAIL_IF_ERR(tnet_turn_session_send_data((struct tnet_turn_session_s*)pc_ss, u_peer_id, __pc_data, sizeof(__pc_data)));
+ }
+ break;
+ }
+ case tnet_turn_session_event_type_chanbind_nok: {
+ TSK_DEBUG_INFO("*** TURN CHANBIND NOK ***");
+ break;
+ }
+ case tnet_turn_session_event_type_recv_data: {
+ TSK_DEBUG_INFO("RECV DATA:%.*s", e->data.u_data_size, (const char*)e->data.pc_data_ptr);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
static void test_turn_session()
{
- BAIL_IF_ERR(tnet_turn_session_create_udp_ipv4(tnet_turn_transport_udp, kStunServerIP, kStunServerPort, &__pc_ss1));
- BAIL_IF_ERR(tnet_turn_session_set_callback(__pc_ss1, _test_turn_session_callback, __pc_ss1));
- BAIL_IF_ERR(tnet_turn_session_set_cred(__pc_ss1, kStunUsrName, kStunPwd));
- BAIL_IF_ERR(tnet_turn_session_prepare(__pc_ss1));
- BAIL_IF_ERR(tnet_turn_session_start(__pc_ss1));
+ BAIL_IF_ERR(tnet_turn_session_create_udp_ipv4(tnet_turn_transport_udp, kStunServerIP, kStunServerPort, &__pc_ss1));
+ BAIL_IF_ERR(tnet_turn_session_set_callback(__pc_ss1, _test_turn_session_callback, __pc_ss1));
+ BAIL_IF_ERR(tnet_turn_session_set_cred(__pc_ss1, kStunUsrName, kStunPwd));
+ BAIL_IF_ERR(tnet_turn_session_prepare(__pc_ss1));
+ BAIL_IF_ERR(tnet_turn_session_start(__pc_ss1));
- BAIL_IF_ERR(tnet_turn_session_create_udp_ipv4(tnet_turn_transport_udp, kStunServerIP, kStunServerPort, &__pc_ss2));
- BAIL_IF_ERR(tnet_turn_session_set_callback(__pc_ss2, _test_turn_session_callback, __pc_ss2));
- BAIL_IF_ERR(tnet_turn_session_set_cred(__pc_ss2, kStunUsrName, kStunPwd));
- BAIL_IF_ERR(tnet_turn_session_prepare(__pc_ss2));
- BAIL_IF_ERR(tnet_turn_session_start(__pc_ss2));
+ BAIL_IF_ERR(tnet_turn_session_create_udp_ipv4(tnet_turn_transport_udp, kStunServerIP, kStunServerPort, &__pc_ss2));
+ BAIL_IF_ERR(tnet_turn_session_set_callback(__pc_ss2, _test_turn_session_callback, __pc_ss2));
+ BAIL_IF_ERR(tnet_turn_session_set_cred(__pc_ss2, kStunUsrName, kStunPwd));
+ BAIL_IF_ERR(tnet_turn_session_prepare(__pc_ss2));
+ BAIL_IF_ERR(tnet_turn_session_start(__pc_ss2));
- BAIL_IF_ERR(tnet_turn_session_allocate(__pc_ss1));
- BAIL_IF_ERR(tnet_turn_session_allocate(__pc_ss2));
+ BAIL_IF_ERR(tnet_turn_session_allocate(__pc_ss1));
+ BAIL_IF_ERR(tnet_turn_session_allocate(__pc_ss2));
- TSK_DEBUG_INFO("*** Press ENTER to continue ***");
- getchar();
+ TSK_DEBUG_INFO("*** Press ENTER to continue ***");
+ getchar();
bail:
- TSK_OBJECT_SAFE_FREE(__pc_ss1);
- TSK_OBJECT_SAFE_FREE(__pc_ss2);
+ TSK_OBJECT_SAFE_FREE(__pc_ss1);
+ TSK_OBJECT_SAFE_FREE(__pc_ss2);
}
static void test_stun()
{
- //test_stun_parser();
- test_turn_session();
+ //test_stun_parser();
+ test_turn_session();
}
#endif /* TNET_TEST_STUN_H */
diff --git a/tinyNET/test/test_tls.h b/tinyNET/test/test_tls.h
index 48ae865..5b1661e 100755
--- a/tinyNET/test/test_tls.h
+++ b/tinyNET/test/test_tls.h
@@ -36,69 +36,66 @@
static int tnet_tls_cb(const tnet_transport_event_t* e)
{
- switch(e->type){
- case event_data:
- {
- TSK_DEBUG_INFO("--- TLS ---\n%s\n", (const char*)e->data);
- break;
- }
- case event_closed:
- case event_connected:
- default:
- {
- break;
- }
- }
- return 0;
+ switch(e->type) {
+ case event_data: {
+ TSK_DEBUG_INFO("--- TLS ---\n%s\n", (const char*)e->data);
+ break;
+ }
+ case event_closed:
+ case event_connected:
+ default: {
+ break;
+ }
+ }
+ return 0;
}
void test_tls()
{
- tnet_transport_handle_t *transport = tnet_transport_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_tls_ipv4, "TLS/IPV4 TRANSPORT");
-
- tnet_ip_t ip;
- tnet_port_t port;
- tnet_fd_t fd = TNET_INVALID_FD;
-
- if(tnet_transport_start(transport)){
- TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
- return;
- }
-
- /* Set our callback function */
- tnet_transport_set_callback(transport, tnet_tls_cb, "callbackdata");
-
-
-
- /* Connect to the SIP Registrar */
- if((fd = tnet_transport_connectto_2(transport, TEST_TLS_REMOTE_IP, TEST_TLS_REMOTE_PORT)) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
- return;
- }
-
- if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)){
- TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
- tnet_transport_remove_socket(transport, &fd);
- return;
- }
-
- /* Send our SIP message */
- {
- char* message = 0;
- tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
- tsk_sprintf(&message, TLS_TEST_SIP_MESSAGE, "TLS", ip, port, port, ip, port, "tls");
-
- if(!tnet_transport_send(transport, fd, message, strlen(message)))
- {
- TSK_DEBUG_ERROR("Failed to send data using TCP/IPv4 transport.");
- TSK_FREE(message);
- return;
- }
- TSK_FREE(message);
- }
-
- TSK_OBJECT_SAFE_FREE(transport);
+ tnet_transport_handle_t *transport = tnet_transport_create(TNET_SOCKET_HOST_ANY, TNET_SOCKET_PORT_ANY, tnet_socket_type_tls_ipv4, "TLS/IPV4 TRANSPORT");
+
+ tnet_ip_t ip;
+ tnet_port_t port;
+ tnet_fd_t fd = TNET_INVALID_FD;
+
+ if(tnet_transport_start(transport)) {
+ TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
+ return;
+ }
+
+ /* Set our callback function */
+ tnet_transport_set_callback(transport, tnet_tls_cb, "callbackdata");
+
+
+
+ /* Connect to the SIP Registrar */
+ if((fd = tnet_transport_connectto_2(transport, TEST_TLS_REMOTE_IP, TEST_TLS_REMOTE_PORT)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
+ return;
+ }
+
+ if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)) {
+ TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
+ tnet_transport_remove_socket(transport, &fd);
+ return;
+ }
+
+ /* Send our SIP message */
+ {
+ char* message = 0;
+ tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
+ tsk_sprintf(&message, TLS_TEST_SIP_MESSAGE, "TLS", ip, port, port, ip, port, "tls");
+
+ if(!tnet_transport_send(transport, fd, message, strlen(message))) {
+ TSK_DEBUG_ERROR("Failed to send data using TCP/IPv4 transport.");
+ TSK_FREE(message);
+ return;
+ }
+ TSK_FREE(message);
+ }
+
+ TSK_OBJECT_SAFE_FREE(transport);
}
#endif /* TNET_TEST_TLS_H */
diff --git a/tinyNET/test/test_transport.h b/tinyNET/test/test_transport.h
index b52b554..0384546 100755
--- a/tinyNET/test/test_transport.h
+++ b/tinyNET/test/test_transport.h
@@ -53,133 +53,129 @@
static int tnet_tcp_cb(const tnet_transport_event_t* e)
{
- switch(e->type){
- case event_data:
- {
- TSK_DEBUG_INFO("--- TCP ---\n%s\n", (const char*)e->data);
- break;
- }
- case event_closed:
- case event_connected:
- default:
- {
- break;
- }
- }
- return 0;
+ switch(e->type) {
+ case event_data: {
+ TSK_DEBUG_INFO("--- TCP ---\n%s\n", (const char*)e->data);
+ break;
+ }
+ case event_closed:
+ case event_connected:
+ default: {
+ break;
+ }
+ }
+ return 0;
}
static int tnet_udp_cb(const tnet_transport_event_t* e)
{
- switch(e->type){
- case event_data:
- {
- TSK_DEBUG_INFO("--- UDP ---\n%s\n", (const char*)e->data);
- break;
- }
- case event_closed:
- case event_connected:
- default: break;
-
- }
- return 0;
+ switch(e->type) {
+ case event_data: {
+ TSK_DEBUG_INFO("--- UDP ---\n%s\n", (const char*)e->data);
+ break;
+ }
+ case event_closed:
+ case event_connected:
+ default:
+ break;
+
+ }
+ return 0;
}
void test_transport_tcp_ipv4(tnet_transport_handle_t *transport)
{
- //tnet_socket_type_t type = tnet_socket_type_tcp_ipv4;
- tnet_ip_t ip;
- tnet_port_t port;
- tnet_fd_t fd = TNET_INVALID_FD;
-
- /* Set our callback function */
- tnet_transport_set_callback(transport, tnet_tcp_cb, "callbackdata");
-
- if(tnet_transport_start(transport)){
- TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
- return;
- }
-
- /* Connect to the SIP Registrar */
- if((fd = tnet_transport_connectto_2(transport, REMOTE_IP, REMOTE_PORT)) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
- return;
- }
-
- if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)){
- TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
- tnet_transport_remove_socket(transport, &fd);
- return;
- }
-
-
- /* Send our SIP message */
- {
- char* message = 0;
- tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
- tsk_sprintf(&message, SIP_MESSAGE, "TCP", ip, port, port, ip, port, "tcp");
-
- if(!tnet_transport_send(transport, fd, message, strlen(message)))
- {
- TSK_DEBUG_ERROR("Failed to send data using %s.", tnet_transport_get_description(transport));
- TSK_FREE(message);
- return;
- }
- TSK_FREE(message);
- }
-
+ //tnet_socket_type_t type = tnet_socket_type_tcp_ipv4;
+ tnet_ip_t ip;
+ tnet_port_t port;
+ tnet_fd_t fd = TNET_INVALID_FD;
+
+ /* Set our callback function */
+ tnet_transport_set_callback(transport, tnet_tcp_cb, "callbackdata");
+
+ if(tnet_transport_start(transport)) {
+ TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
+ return;
+ }
+
+ /* Connect to the SIP Registrar */
+ if((fd = tnet_transport_connectto_2(transport, REMOTE_IP, REMOTE_PORT)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
+ return;
+ }
+
+ if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)) {
+ TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
+ tnet_transport_remove_socket(transport, &fd);
+ return;
+ }
+
+
+ /* Send our SIP message */
+ {
+ char* message = 0;
+ tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
+ tsk_sprintf(&message, SIP_MESSAGE, "TCP", ip, port, port, ip, port, "tcp");
+
+ if(!tnet_transport_send(transport, fd, message, strlen(message))) {
+ TSK_DEBUG_ERROR("Failed to send data using %s.", tnet_transport_get_description(transport));
+ TSK_FREE(message);
+ return;
+ }
+ TSK_FREE(message);
+ }
+
}
int test_transport_udp_ipv4(tnet_transport_handle_t *transport)
{
- //tnet_socket_type_t type = tnet_socket_type_udp_ipv4;
- tnet_ip_t ip;
- tnet_port_t port;
- tnet_fd_t fd = TNET_INVALID_FD;
-
- /* Set our callback function */
- tnet_transport_set_callback(transport, tnet_udp_cb, "callbackdata");
-
- if(tnet_transport_start(transport)){
- TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
- return -1;
- }
-
- /* Connect to our SIP REGISTRAR */
- if((fd = tnet_transport_connectto_2(transport, REMOTE_IP, REMOTE_PORT)) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
- //tnet_transport_shutdown(transport);
- return -2;
- }
-
- if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)){
- TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
- tnet_transport_remove_socket(transport, &fd);
- return -3;
- }
-
- //tsk_thread_sleep(2000);
-
- /* Send our SIP message */
- /*while(1)*/{
- char* message = 0;
- tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
- //memset(ip, 0, sizeof(ip));
- //memcpy(ip, "192.168.0.12", 12);
- tsk_sprintf(&message, SIP_MESSAGE, "UDP", ip, port, port, ip, port, "udp");
-
- if(!tnet_transport_send(transport, fd, message, strlen(message)))
- {
- TSK_DEBUG_ERROR("Failed to send data using %s.", tnet_transport_get_description(transport));
- //tnet_transport_shutdown(transport);
- TSK_FREE(message);
- return -4;
- }
- TSK_FREE(message);
- }
-
- return 0;
+ //tnet_socket_type_t type = tnet_socket_type_udp_ipv4;
+ tnet_ip_t ip;
+ tnet_port_t port;
+ tnet_fd_t fd = TNET_INVALID_FD;
+
+ /* Set our callback function */
+ tnet_transport_set_callback(transport, tnet_udp_cb, "callbackdata");
+
+ if(tnet_transport_start(transport)) {
+ TSK_DEBUG_ERROR("Failed to create %s.", tnet_transport_get_description(transport));
+ return -1;
+ }
+
+ /* Connect to our SIP REGISTRAR */
+ if((fd = tnet_transport_connectto_2(transport, REMOTE_IP, REMOTE_PORT)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect %s.", tnet_transport_get_description(transport));
+ //tnet_transport_shutdown(transport);
+ return -2;
+ }
+
+ if(tnet_sockfd_waitUntilWritable(fd, TNET_CONNECT_TIMEOUT)) {
+ TSK_DEBUG_ERROR("%d milliseconds elapsed and the socket is still not connected.", TNET_CONNECT_TIMEOUT);
+ tnet_transport_remove_socket(transport, &fd);
+ return -3;
+ }
+
+ //tsk_thread_sleep(2000);
+
+ /* Send our SIP message */
+ /*while(1)*/{
+ char* message = 0;
+ tnet_transport_get_ip_n_port(transport, fd, &ip, &port);
+ //memset(ip, 0, sizeof(ip));
+ //memcpy(ip, "192.168.0.12", 12);
+ tsk_sprintf(&message, SIP_MESSAGE, "UDP", ip, port, port, ip, port, "udp");
+
+ if(!tnet_transport_send(transport, fd, message, strlen(message))) {
+ TSK_DEBUG_ERROR("Failed to send data using %s.", tnet_transport_get_description(transport));
+ //tnet_transport_shutdown(transport);
+ TSK_FREE(message);
+ return -4;
+ }
+ TSK_FREE(message);
+ }
+
+ return 0;
}
void test_transport()
@@ -189,27 +185,27 @@ void test_transport()
#if TEST_UDP
- tnet_transport_handle_t *udp = tnet_transport_create(LOCAL_IP4, LOCAL_PORT, tnet_socket_type_udp_ipv4, "UDP/IPV4 TRANSPORT");
- test_transport_udp_ipv4(udp);
+ tnet_transport_handle_t *udp = tnet_transport_create(LOCAL_IP4, LOCAL_PORT, tnet_socket_type_udp_ipv4, "UDP/IPV4 TRANSPORT");
+ test_transport_udp_ipv4(udp);
#endif
#if TEST_TCP
- tnet_transport_handle_t *tcp = tnet_transport_create(LOCAL_IP4, LOCAL_PORT, tnet_socket_type_tcp_ipv4, "TCP/IPV4 TRANSPORT");
- test_transport_tcp_ipv4(tcp);
-#endif
+ tnet_transport_handle_t *tcp = tnet_transport_create(LOCAL_IP4, LOCAL_PORT, tnet_socket_type_tcp_ipv4, "TCP/IPV4 TRANSPORT");
+ test_transport_tcp_ipv4(tcp);
+#endif
//#if defined(ANDROID)
- tsk_thread_sleep(1000000);
+ tsk_thread_sleep(1000000);
//#else
- getchar();
+ getchar();
//#endif
#if TEST_UDP
- TSK_OBJECT_SAFE_FREE(udp);
+ TSK_OBJECT_SAFE_FREE(udp);
#endif
#if TEST_TCP
- TSK_OBJECT_SAFE_FREE(tcp);
+ TSK_OBJECT_SAFE_FREE(tcp);
#endif
}
diff --git a/tinyROHC/include/tinyrohc_config.h b/tinyROHC/include/tinyrohc_config.h
index fdb7d3d..a66927a 100755
--- a/tinyROHC/include/tinyrohc_config.h
+++ b/tinyROHC/include/tinyrohc_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,13 +45,13 @@
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TROHC_BEGIN_DECLS extern "C" {
# define TROHC_END_DECLS }
#else
-# define TROHC_BEGIN_DECLS
+# define TROHC_BEGIN_DECLS
# define TROHC_END_DECLS
#endif
@@ -73,7 +73,7 @@
#endif
#if HAVE_CONFIG_H
- #include "../config.h"
+#include "../config.h"
#endif
#endif // TINYROHC_CONFIG_H
diff --git a/tinyROHC/include/trohc.h b/tinyROHC/include/trohc.h
index 49c4e00..422dab7 100755
--- a/tinyROHC/include/trohc.h
+++ b/tinyROHC/include/trohc.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyROHC/src/trohc.c b/tinyROHC/src/trohc.c
index 35bb166..6688930 100755
--- a/tinyROHC/src/trohc.c
+++ b/tinyROHC/src/trohc.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp.h b/tinyRTP/include/tinyrtp.h
index 8707f81..f12217a 100755
--- a/tinyRTP/include/tinyrtp.h
+++ b/tinyRTP/include/tinyrtp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
index 9cf6a1a..354c082 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,16 +33,15 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtcp_header_s
-{
- TSK_DECLARE_OBJECT;
-
- unsigned version:2;
- unsigned padding:1;
- unsigned rc:5;
- trtp_rtcp_packet_type_t type; /**< Packet Type on 8bits */
- uint16_t length_in_words_minus1; /**< The length of this RTCP packet in 32-bit words minus one */
- uint32_t length_in_bytes;
+typedef struct trtp_rtcp_header_s {
+ TSK_DECLARE_OBJECT;
+
+ unsigned version:2;
+ unsigned padding:1;
+ unsigned rc:5;
+ trtp_rtcp_packet_type_t type; /**< Packet Type on 8bits */
+ uint16_t length_in_words_minus1; /**< The length of this RTCP packet in 32-bit words minus one */
+ uint32_t length_in_bytes;
}
trtp_rtcp_header_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
index 9045be7..00867f5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,23 +35,21 @@ TRTP_BEGIN_DECLS
// RFC 3550 12.1 RTCP Packet Types
// RFC 4585
// RFC 5104 (FIXME: not supported yet!)
-typedef enum trtp_rtcp_packet_type_e
-{
- trtp_rtcp_packet_type_sr = 200,
- trtp_rtcp_packet_type_rr = 201,
- trtp_rtcp_packet_type_sdes = 202,
- trtp_rtcp_packet_type_bye = 203,
- trtp_rtcp_packet_type_app = 204,
- trtp_rtcp_packet_type_rtpfb = 205,
- trtp_rtcp_packet_type_psfb = 206
+typedef enum trtp_rtcp_packet_type_e {
+ trtp_rtcp_packet_type_sr = 200,
+ trtp_rtcp_packet_type_rr = 201,
+ trtp_rtcp_packet_type_sdes = 202,
+ trtp_rtcp_packet_type_bye = 203,
+ trtp_rtcp_packet_type_app = 204,
+ trtp_rtcp_packet_type_rtpfb = 205,
+ trtp_rtcp_packet_type_psfb = 206
}
trtp_rtcp_packet_type_t;
-typedef struct trtp_rtcp_packet_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_packet_s {
+ TSK_DECLARE_OBJECT;
- struct trtp_rtcp_header_s *header;
+ struct trtp_rtcp_header_s *header;
}
trtp_rtcp_packet_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
index 5ea54e6..cc5285d 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,17 +33,16 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_RBLOCK(self) ((trtp_rtcp_rblock_t*)(self))
// RFC 3550 6.4.1 SR: Sender Report RTCP Packet => Report block part
-typedef struct trtp_rtcp_rblock_s
-{
- TSK_DECLARE_OBJECT;
-
- uint32_t ssrc; /* data source being reported */
- unsigned int fraction:8; /* fraction lost since last SR/RR */
- int cumulative_no_lost:24; /* cumul. no. pkts lost (signed!) */
- uint32_t last_seq; /* extended last seq. no. received */
- uint32_t jitter; /* interarrival jitter */
- uint32_t lsr; /* last SR packet from this source */
- uint32_t dlsr; /* delay since last SR packet */
+typedef struct trtp_rtcp_rblock_s {
+ TSK_DECLARE_OBJECT;
+
+ uint32_t ssrc; /* data source being reported */
+ unsigned int fraction:8; /* fraction lost since last SR/RR */
+ int cumulative_no_lost:24; /* cumul. no. pkts lost (signed!) */
+ uint32_t last_seq; /* extended last seq. no. received */
+ uint32_t jitter; /* interarrival jitter */
+ uint32_t lsr; /* last SR packet from this source */
+ uint32_t dlsr; /* delay since last SR packet */
}
trtp_rtcp_rblock_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
index c30351f..34031a5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
index 796e9fc..dac4e6c 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,12 +26,11 @@
#include "tinyrtp/rtcp/trtp_rtcp_packet.h"
-typedef struct trtp_rtcp_report_bye_s
-{
- TRTP_DECLARE_RTCP_PACKET;
+typedef struct trtp_rtcp_report_bye_s {
+ TRTP_DECLARE_RTCP_PACKET;
- uint32_t *ssrc_list;
- trtp_rtcp_packets_L_t* packets;
+ uint32_t *ssrc_list;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_bye_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
index 1ad30b4..a1bf9fe 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,42 +30,39 @@
#define TRTP_DECLARE_RTCP_FB_PACKET trtp_rtcp_report_fb_t __packet_fb__
// RFC 4585 6.1. Common Packet Format for Feedback Messages
-typedef struct trtp_rtcp_report_fb_s
-{
- TRTP_DECLARE_RTCP_PACKET;
+typedef struct trtp_rtcp_report_fb_s {
+ TRTP_DECLARE_RTCP_PACKET;
- uint32_t ssrc_sender; /* SSRC of packet sender */
- uint32_t ssrc_media; /* SSRC of media source */
+ uint32_t ssrc_sender; /* SSRC of packet sender */
+ uint32_t ssrc_media; /* SSRC of media source */
}
trtp_rtcp_report_fb_t;
-typedef enum trtp_rtcp_rtpfb_fci_type_e
-{
- trtp_rtcp_rtpfb_fci_type_nack = 1, // RFC 4585
- trtp_rtcp_rtpfb_fci_type_tmmbn = 4, // RFC 5104
+typedef enum trtp_rtcp_rtpfb_fci_type_e {
+ trtp_rtcp_rtpfb_fci_type_nack = 1, // RFC 4585
+ trtp_rtcp_rtpfb_fci_type_tmmbn = 4, // RFC 5104
}
trtp_rtcp_rtpfb_fci_type_t;
// Transport layer FB message
-typedef struct trtp_rtcp_report_rtpfb_s
-{
- TRTP_DECLARE_RTCP_FB_PACKET;
-
- trtp_rtcp_rtpfb_fci_type_t fci_type;
- union{
- struct{
- tsk_size_t count; // not part of the specification
- uint16_t* pid; // 16 bits
- uint16_t* blp; // 16 bits
- }nack;
- struct{
- tsk_size_t count; // not part of the specification
- uint32_t* ssrc; // 32 bits
- uint8_t* MxTBR_Exp; // 6 bits
- uint32_t* MxTBR_Mantissa; // 17 bits
- uint16_t* MeasuredOverhead; // 9 bits
- }tmmbn;
- };
+typedef struct trtp_rtcp_report_rtpfb_s {
+ TRTP_DECLARE_RTCP_FB_PACKET;
+
+ trtp_rtcp_rtpfb_fci_type_t fci_type;
+ union {
+ struct {
+ tsk_size_t count; // not part of the specification
+ uint16_t* pid; // 16 bits
+ uint16_t* blp; // 16 bits
+ } nack;
+ struct {
+ tsk_size_t count; // not part of the specification
+ uint32_t* ssrc; // 32 bits
+ uint8_t* MxTBR_Exp; // 6 bits
+ uint32_t* MxTBR_Mantissa; // 17 bits
+ uint16_t* MeasuredOverhead; // 9 bits
+ } tmmbn;
+ };
}
trtp_rtcp_report_rtpfb_t;
@@ -78,64 +75,67 @@ int trtp_rtcp_report_rtpfb_serialize_to(const trtp_rtcp_report_rtpfb_t* self, vo
tsk_size_t trtp_rtcp_report_rtpfb_get_size(const trtp_rtcp_report_rtpfb_t* self);
-typedef enum trtp_rtcp_psfb_fci_type_e
-{
- trtp_rtcp_psfb_fci_type_pli = 1, /* rfc 4585: Picture Loss Indication (PLI) */
- trtp_rtcp_psfb_fci_type_sli = 2, /* rfc 4585: Slice Loss Indication (SLI) */
- trtp_rtcp_psfb_fci_type_rpsi = 3, /* rfc 4585: Reference Picture Selection Indication (RPSI) */
- trtp_rtcp_psfb_fci_type_fir = 4, /* rfc 5104: Full Intra Request (FIR) Command*/
- trtp_rtcp_psfb_fci_type_afb = 15, /* rfc 4585: Application layer FB (AFB) message */
+typedef enum trtp_rtcp_psfb_fci_type_e {
+ trtp_rtcp_psfb_fci_type_pli = 1, /* rfc 4585: Picture Loss Indication (PLI) */
+ trtp_rtcp_psfb_fci_type_sli = 2, /* rfc 4585: Slice Loss Indication (SLI) */
+ trtp_rtcp_psfb_fci_type_rpsi = 3, /* rfc 4585: Reference Picture Selection Indication (RPSI) */
+ trtp_rtcp_psfb_fci_type_fir = 4, /* rfc 5104: Full Intra Request (FIR) Command*/
+ trtp_rtcp_psfb_fci_type_afb = 15, /* rfc 4585: Application layer FB (AFB) message */
}
trtp_rtcp_psfb_fci_type_t;
/* rfc 4585: Application layer FB (AFB) message */
-typedef enum trtp_rtcp_psfb_afb_type_e
-{
- trtp_rtcp_psfb_afb_type_none,
- trtp_rtcp_psfb_afb_type_remb // draft-alvestrand-rmcat-remb-02
+typedef enum trtp_rtcp_psfb_afb_type_e {
+ trtp_rtcp_psfb_afb_type_none,
+ trtp_rtcp_psfb_afb_type_remb, // draft-alvestrand-rmcat-remb-02
+ trtp_rtcp_psfb_afb_type_jcng, // doubango congestion control estimation
}
trtp_rtcp_psfb_afb_type_t;
// Payload-specific FB message
-typedef struct trtp_rtcp_report_psfb_s
-{
- TRTP_DECLARE_RTCP_FB_PACKET;
-
- trtp_rtcp_psfb_fci_type_t fci_type;
- union{
- // struct{ //rfc 4585: 6.3.1.2
- // } pli;
- struct{ // rfc 4585: 6.3.2.2
- uint16_t* first;
- uint16_t* number;
- uint8_t* pic_id;
- } sli;
- struct{ // rfc 4585: 6.3.3.2
- unsigned pb:8;
- unsigned pt:7;
- uint8_t* bytes;
- } rpsi;
- struct{// rfc 5104: 4.3.1.1
- tsk_size_t count;
- uint32_t* ssrc; // 32 bits
- uint8_t* seq_num; // 8 bits
- }fir;
- struct{ // rfc 4585: 6.4
- trtp_rtcp_psfb_afb_type_t type;
- union{
- struct{ // draft-alvestrand-rmcat-remb-02: 2.2
- // MxTBR = mantissa * 2^exp = (mantissa << exp) bps
- uint8_t num_ssrc;
- uint8_t exp; // 6bits
- uint32_t mantissa; // 18bits
- uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
- }remb;
- struct{
- uint8_t* bytes; // store bytes to allow reconstruction
- }none; // unknown type
- };
- }afb;
- };
+typedef struct trtp_rtcp_report_psfb_s {
+ TRTP_DECLARE_RTCP_FB_PACKET;
+
+ trtp_rtcp_psfb_fci_type_t fci_type;
+ union {
+ // struct{ //rfc 4585: 6.3.1.2
+ // } pli;
+ struct { // rfc 4585: 6.3.2.2
+ uint16_t* first;
+ uint16_t* number;
+ uint8_t* pic_id;
+ } sli;
+ struct { // rfc 4585: 6.3.3.2
+ unsigned pb:8;
+ unsigned pt:7;
+ uint8_t* bytes;
+ } rpsi;
+ struct { // rfc 5104: 4.3.1.1
+ tsk_size_t count;
+ uint32_t* ssrc; // 32 bits
+ uint8_t* seq_num; // 8 bits
+ } fir;
+ struct { // rfc 4585: 6.4
+ trtp_rtcp_psfb_afb_type_t type;
+ union {
+ struct { // draft-alvestrand-rmcat-remb-02: 2.2
+ // MxTBR = mantissa * 2^exp = (mantissa << exp) bps
+ uint8_t num_ssrc;
+ uint8_t exp; // 6bits
+ uint32_t mantissa; // 18bits
+ uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
+ } remb;
+ struct { // jitter buffer congestion estimation: doubango
+ uint8_t num_ssrc;
+ uint8_t q; // 8bits
+ uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
+ } jcng;
+ struct {
+ uint8_t* bytes; // store bytes to allow reconstruction
+ } none; // unknown type
+ };
+ } afb;
+ };
}
trtp_rtcp_report_psfb_t;
@@ -145,6 +145,7 @@ trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_pli(uint32_t ssrc_sender, uint32_t ssrc_media_src);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_fir(uint8_t seq_num, uint32_t ssrc_sender, uint32_t ssrc_media_src);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_remb(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, uint32_t bitrate/*in bps*/);
+trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_jcng(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, float jcng_q/*in quality metric*/);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_deserialize(const void* data, tsk_size_t size);
int trtp_rtcp_report_psfb_serialize_to(const trtp_rtcp_report_psfb_t* self, void* data, tsk_size_t size);
tsk_size_t trtp_rtcp_report_psfb_get_size(const trtp_rtcp_report_psfb_t* self);
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
index 2f25779..6a417d3 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,13 +32,12 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_RR(self) ((trtp_rtcp_report_rr_t*)(self))
// RFC 3550 6.4.2 RR: Receiver Report RTCP Packet
-typedef struct trtp_rtcp_report_rr_s
-{
- TRTP_DECLARE_RTCP_PACKET;
-
- uint32_t ssrc;
- trtp_rtcp_rblocks_L_t* blocks;
- trtp_rtcp_packets_L_t* packets;
+typedef struct trtp_rtcp_report_rr_s {
+ TRTP_DECLARE_RTCP_PACKET;
+
+ uint32_t ssrc;
+ trtp_rtcp_rblocks_L_t* blocks;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_rr_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
index 04efb5c..b8df1e5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,10 +32,9 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_SDES(self) ((trtp_rtcp_report_sdes_t*)(self))
/* RFC 3550 6.5 SDES: Source Description RTCP Packet */
-typedef struct trtp_rtcp_report_sdes_s
-{
- TRTP_DECLARE_RTCP_PACKET;
- trtp_rtcp_sdes_chuncks_L_t* chuncks;
+typedef struct trtp_rtcp_report_sdes_s {
+ TRTP_DECLARE_RTCP_PACKET;
+ trtp_rtcp_sdes_chuncks_L_t* chuncks;
}
trtp_rtcp_report_sdes_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
index 09d442f..73de26e 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,21 +32,20 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_SR(self) ((trtp_rtcp_report_sr_t*)(self))
// RFC 3550 6.4.1 SR: Sender Report RTCP Packet
-typedef struct trtp_rtcp_report_sr_s
-{
- TRTP_DECLARE_RTCP_PACKET;
-
- uint32_t ssrc;
- struct{
- uint32_t ntp_msw; /**< NTP timestamp, most significant word */
- uint32_t ntp_lsw; /**< NTP timestamp, least significant word */
- uint32_t rtp_timestamp;/**< RTP timestamp */
- uint32_t sender_pcount; /**< sender's packet count */
- uint32_t sender_ocount; /**< sender's octet count */
- } sender_info;
-
- trtp_rtcp_rblocks_L_t* blocks;
- trtp_rtcp_packets_L_t* packets;
+typedef struct trtp_rtcp_report_sr_s {
+ TRTP_DECLARE_RTCP_PACKET;
+
+ uint32_t ssrc;
+ struct {
+ uint32_t ntp_msw; /**< NTP timestamp, most significant word */
+ uint32_t ntp_lsw; /**< NTP timestamp, least significant word */
+ uint32_t rtp_timestamp;/**< RTP timestamp */
+ uint32_t sender_pcount; /**< sender's packet count */
+ uint32_t sender_ocount; /**< sender's octet count */
+ } sender_info;
+
+ trtp_rtcp_rblocks_L_t* blocks;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_sr_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
index b08e096..dda4dcc 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
index ec3a8d8..bf47f53 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,12 +33,11 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtcp_sdes_chunck_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_sdes_chunck_s {
+ TSK_DECLARE_OBJECT;
- uint32_t ssrc;
- trtp_rtcp_sdes_items_L_t* items;
+ uint32_t ssrc;
+ trtp_rtcp_sdes_items_L_t* items;
}
trtp_rtcp_sdes_chunck_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
index 8356a74..f485e24 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,26 +34,24 @@
TRTP_BEGIN_DECLS
// RFC 3550 12.2 SDES Types
-typedef enum trtp_rtcp_sdes_item_type_e
-{
- trtp_rtcp_sdes_item_type_end = 0, /**< end of SDES list */
- trtp_rtcp_sdes_item_type_cname = 1, /**< canonical name*/
- trtp_rtcp_sdes_item_type_name = 2, /**< user name */
- trtp_rtcp_sdes_item_type_email = 3, /**< user's electronic mail address*/
- trtp_rtcp_sdes_item_type_phone = 4, /**< user's phone number */
- trtp_rtcp_sdes_item_type_loc = 5, /**< geographic user location*/
- trtp_rtcp_sdes_item_type_tool = 6, /**< name of application or tool*/
- trtp_rtcp_sdes_item_type_note = 7, /**< notice about the source*/
- trtp_rtcp_sdes_item_type_priv = 8, /**< private extensions*/
+typedef enum trtp_rtcp_sdes_item_type_e {
+ trtp_rtcp_sdes_item_type_end = 0, /**< end of SDES list */
+ trtp_rtcp_sdes_item_type_cname = 1, /**< canonical name*/
+ trtp_rtcp_sdes_item_type_name = 2, /**< user name */
+ trtp_rtcp_sdes_item_type_email = 3, /**< user's electronic mail address*/
+ trtp_rtcp_sdes_item_type_phone = 4, /**< user's phone number */
+ trtp_rtcp_sdes_item_type_loc = 5, /**< geographic user location*/
+ trtp_rtcp_sdes_item_type_tool = 6, /**< name of application or tool*/
+ trtp_rtcp_sdes_item_type_note = 7, /**< notice about the source*/
+ trtp_rtcp_sdes_item_type_priv = 8, /**< private extensions*/
}
trtp_rtcp_sdes_item_type_t;
-typedef struct trtp_rtcp_sdes_item_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_sdes_item_s {
+ TSK_DECLARE_OBJECT;
- trtp_rtcp_sdes_item_type_t type;
- tsk_buffer_t *data;
+ trtp_rtcp_sdes_item_type_t type;
+ tsk_buffer_t *data;
}
trtp_rtcp_sdes_item_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
index 34ddbbc..4ea08e0 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,7 +51,7 @@ int trtp_rtcp_session_set_callback(struct trtp_rtcp_session_s* self, trtp_rtcp_c
#if HAVE_SRTP
int trtp_rtcp_session_set_srtp_sess(struct trtp_rtcp_session_s* self, const srtp_t* session);
#endif
-int trtp_rtcp_session_set_app_bandwidth_max(struct trtp_rtcp_session_s* self, int32_t bw_upload_kbps, int32_t bw_download_kbps);
+int trtp_rtcp_session_set_app_bw_and_jcng(struct trtp_rtcp_session_s* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float jcng_q);
int trtp_rtcp_session_start(struct trtp_rtcp_session_s* self, tnet_fd_t local_fd, const struct sockaddr* remote_addr);
int trtp_rtcp_session_stop(struct trtp_rtcp_session_s* self);
int trtp_rtcp_session_process_rtp_out(struct trtp_rtcp_session_s* self, const struct trtp_rtp_packet_s* packet_rtp, tsk_size_t size);
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
index 15d177c..8b8a3b3 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,36 +37,35 @@ TRTP_BEGIN_DECLS
#define TRTP_RTP_HEADER_MIN_SIZE 12
#define TRTP_RTP_HEADER(self) ((trtp_rtp_header_t*)(self))
-typedef struct trtp_rtp_header_s
-{
- TSK_DECLARE_OBJECT;
- /* RFC 3550 section 5.1 - RTP Fixed Header Fields
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P|X| CC |M| PT | sequence number |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | timestamp |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | synchronization source (SSRC) identifier |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | contributing source (CSRC) identifiers |
- | .... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- unsigned version:2;
- unsigned padding:1;
- unsigned extension:1;
- unsigned csrc_count:4;
- unsigned marker:1;
- unsigned payload_type:7;
- uint16_t seq_num;
- uint32_t timestamp;
- uint32_t ssrc;
- uint32_t csrc[15];
+typedef struct trtp_rtp_header_s {
+ TSK_DECLARE_OBJECT;
+ /* RFC 3550 section 5.1 - RTP Fixed Header Fields
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |V=2|P|X| CC |M| PT | sequence number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | timestamp |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | synchronization source (SSRC) identifier |
+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
+ | contributing source (CSRC) identifiers |
+ | .... |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ unsigned version:2;
+ unsigned padding:1;
+ unsigned extension:1;
+ unsigned csrc_count:4;
+ unsigned marker:1;
+ unsigned payload_type:7;
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint32_t ssrc;
+ uint32_t csrc[15];
- // for internal use
- enum tmedia_codec_id_e codec_id;
+ // for internal use
+ enum tmedia_codec_id_e codec_id;
}
trtp_rtp_header_t;
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
index c7f8cf3..b9d81b3 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,23 +37,22 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtp_packet_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtp_packet_s {
+ TSK_DECLARE_OBJECT;
+
+ trtp_rtp_header_t* header;
- trtp_rtp_header_t* header;
+ struct {
+ void* data;
+ const void* data_const; // never free()d. an alternative to "data"
+ tsk_size_t size;
+ } payload;
- struct{
- void* data;
- const void* data_const; // never free()d. an alternative to "data"
- tsk_size_t size;
- } payload;
-
- /* extension header as per RFC 3550 section 5.3.1 */
- struct{
- void* data;
- tsk_size_t size; /* contains the first two 16-bit fields */
- } extension;
+ /* extension header as per RFC 3550 section 5.3.1 */
+ struct {
+ void* data;
+ tsk_size_t size; /* contains the first two 16-bit fields */
+ } extension;
}
trtp_rtp_packet_t;
typedef tsk_list_t trtp_rtp_packets_L_t;
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
index 475502a..f5d8770 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/trtp.h b/tinyRTP/include/tinyrtp/trtp.h
index 3359a70..ea72491 100755
--- a/tinyRTP/include/tinyrtp/trtp.h
+++ b/tinyRTP/include/tinyrtp/trtp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/trtp_manager.h b/tinyRTP/include/tinyrtp/trtp_manager.h
index 1594f9c..e409c7b 100755
--- a/tinyRTP/include/tinyrtp/trtp_manager.h
+++ b/tinyRTP/include/tinyrtp/trtp_manager.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,140 +40,140 @@ struct trtp_rtp_packet_s;
struct tnet_proxyinfo_s;
/** RTP/RTCP manager */
-typedef struct trtp_manager_s
-{
- TSK_DECLARE_OBJECT;
-
- char* local_ip;
- tsk_bool_t use_ipv6;
- tsk_bool_t is_started;
- tsk_bool_t use_rtcp;
- tsk_bool_t use_rtcpmux;
- tsk_bool_t is_socket_disabled;
- tsk_bool_t is_ice_neg_ok;
- tsk_bool_t is_ice_turn_active;
- tsk_bool_t is_force_symetric_rtp;
- tsk_bool_t is_symetric_rtp_checked;
- tsk_bool_t is_symetric_rtcp_checked;
- int32_t app_bw_max_upload; // application specific (kbps)
- int32_t app_bw_max_download; // application specific (kbps)
-
- tnet_transport_t* transport;
-
- struct tnet_ice_ctx_s* ice_ctx;
-
- tsk_timer_manager_handle_t* timer_mgr_global;
-
- struct{
- tmedia_rtcweb_type_t local;
- tmedia_rtcweb_type_t remote;
- } rtcweb_type;
-
+typedef struct trtp_manager_s {
+ TSK_DECLARE_OBJECT;
+
+ char* local_ip;
+ tsk_bool_t use_ipv6;
+ tsk_bool_t is_started;
+ tsk_bool_t use_rtcp;
+ tsk_bool_t use_rtcpmux;
+ tsk_bool_t is_socket_disabled;
+ tsk_bool_t is_ice_neg_ok;
+ tsk_bool_t is_ice_turn_active;
+ tsk_bool_t is_force_symetric_rtp;
+ tsk_bool_t is_symetric_rtp_checked;
+ tsk_bool_t is_symetric_rtcp_checked;
+ int32_t app_bw_max_upload; // application specific (kbps)
+ int32_t app_bw_max_download; // application specific (kbps)
+ float app_jitter_cng; // application specific jitter buffer congestion estimation (quality in ]0, 1], 1f meaning no congestion)
+
+ tnet_transport_t* transport;
+
+ struct tnet_ice_ctx_s* ice_ctx;
+
+ tsk_timer_manager_handle_t* timer_mgr_global;
+
+ struct {
+ tmedia_rtcweb_type_t local;
+ tmedia_rtcweb_type_t remote;
+ } rtcweb_type;
+
struct {
tsk_bool_t auto_detect;
struct tnet_proxyinfo_s* info;
}
proxy;
- struct{
- uint16_t start;
- uint16_t stop;
- } port_range;
+ struct {
+ uint16_t start;
+ uint16_t stop;
+ } port_range;
- struct{
- uint16_t seq_num;
- uint32_t timestamp;
- uint8_t payload_type;
+ struct {
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint8_t payload_type;
int32_t dscp;
- char* remote_ip;
- tnet_port_t remote_port;
- struct sockaddr_storage remote_addr;
-
- char* public_ip;
- tnet_port_t public_port;
-
- struct{
- uint32_t local;
- uint32_t remote;
- } ssrc;
-
- struct{
- const void* usrdata;
- trtp_rtp_cb_f fun;
- } cb;
-
- struct{
- void* ptr;
- tsk_size_t size;
+ char* remote_ip;
+ tnet_port_t remote_port;
+ struct sockaddr_storage remote_addr;
+
+ char* public_ip;
+ tnet_port_t public_port;
+
+ struct {
+ uint32_t local;
+ uint32_t remote;
+ } ssrc;
+
+ struct {
+ const void* usrdata;
+ trtp_rtp_cb_f fun;
+ } cb;
+
+ struct {
+ void* ptr;
+ tsk_size_t size;
tsk_size_t index;
- } serial_buffer;
- } rtp;
-
- struct{
- char* cname;
- char* remote_ip;
- tnet_port_t remote_port;
- struct sockaddr_storage remote_addr;
- tnet_socket_t* local_socket;
-
- char* public_ip;
- tnet_port_t public_port;
-
- struct{
- const void* usrdata;
- trtp_rtcp_cb_f fun;
- } cb;
-
- struct trtp_rtcp_session_s* session;
- } rtcp;
-
- TSK_DECLARE_SAFEOBJ;
-
-#if HAVE_SRTP
- enum tmedia_srtp_type_e srtp_type;
- enum tmedia_srtp_mode_e srtp_mode;
- trtp_srtp_state_t srtp_state;
- trtp_srtp_ctx_xt srtp_contexts[2/*LINE_IDX*/][2/*CRYPTO_TYPE*/];
- const struct trtp_srtp_ctx_xs* srtp_ctx_neg_local;
- const struct trtp_srtp_ctx_xs* srtp_ctx_neg_remote;
-
- struct{
- char* file_ca;
- char* file_pbk;
- char* file_pvk;
- tsk_bool_t cert_verif;
-
- trtp_srtp_state_t state;
- // enable() could be postponed if net transport not ready yet (e.g. when ICE is ON)
- tsk_bool_t enable_postponed;
-
- tsk_bool_t srtp_connected;
- tsk_bool_t srtcp_connected;
- tsk_bool_t srtp_handshake_succeed;
- tsk_bool_t srtcp_handshake_succeed;
-
- trtp_srtp_crypto_type_t crypto_selected;
-
- struct{
- uint64_t timeout;
- tsk_timer_id_t id;
- } timer_hanshaking;
-
- struct{
- const void* usrdata;
- trtp_srtp_dtls_cb_f fun;
- } cb;
-
- struct{
- tnet_fingerprint_t fp;
- tnet_dtls_hash_type_t fp_hash;
- } remote;
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new;
- }local;
- } dtls;
+ } serial_buffer;
+ } rtp;
+
+ struct {
+ char* cname;
+ char* remote_ip;
+ tnet_port_t remote_port;
+ struct sockaddr_storage remote_addr;
+ tnet_socket_t* local_socket;
+
+ char* public_ip;
+ tnet_port_t public_port;
+
+ struct {
+ const void* usrdata;
+ trtp_rtcp_cb_f fun;
+ } cb;
+
+ struct trtp_rtcp_session_s* session;
+ } rtcp;
+
+ TSK_DECLARE_SAFEOBJ;
+
+#if HAVE_SRTP
+ enum tmedia_srtp_type_e srtp_type;
+ enum tmedia_srtp_mode_e srtp_mode;
+ trtp_srtp_state_t srtp_state;
+ trtp_srtp_ctx_xt srtp_contexts[2/*LINE_IDX*/][2/*CRYPTO_TYPE*/];
+ const struct trtp_srtp_ctx_xs* srtp_ctx_neg_local;
+ const struct trtp_srtp_ctx_xs* srtp_ctx_neg_remote;
+
+ struct {
+ char* file_ca;
+ char* file_pbk;
+ char* file_pvk;
+ tsk_bool_t cert_verif;
+
+ trtp_srtp_state_t state;
+ // enable() could be postponed if net transport not ready yet (e.g. when ICE is ON)
+ tsk_bool_t enable_postponed;
+
+ tsk_bool_t srtp_connected;
+ tsk_bool_t srtcp_connected;
+ tsk_bool_t srtp_handshake_succeed;
+ tsk_bool_t srtcp_handshake_succeed;
+
+ trtp_srtp_crypto_type_t crypto_selected;
+
+ struct {
+ uint64_t timeout;
+ tsk_timer_id_t id;
+ } timer_hanshaking;
+
+ struct {
+ const void* usrdata;
+ trtp_srtp_dtls_cb_f fun;
+ } cb;
+
+ struct {
+ tnet_fingerprint_t fp;
+ tnet_dtls_hash_type_t fp_hash;
+ } remote;
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new;
+ } local;
+ } dtls;
#endif
}
trtp_manager_t;
@@ -214,7 +214,7 @@ TINYRTP_API tsk_size_t trtp_manager_send_rtp(trtp_manager_t* self, const void* d
TINYRTP_API tsk_size_t trtp_manager_send_rtp_packet(trtp_manager_t* self, const struct trtp_rtp_packet_s* packet, tsk_bool_t bypass_encrypt);
TINYRTP_API int trtp_manager_get_bytes_count(trtp_manager_t* self, uint64_t* bytes_in, uint64_t* bytes_out);
TINYRTP_API tsk_size_t trtp_manager_send_rtp_raw(trtp_manager_t* self, const void* data, tsk_size_t size);
-TINYRTP_API int trtp_manager_set_app_bandwidth_max(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps);
+TINYRTP_API int trtp_manager_set_app_bw_and_jcng(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float jcng_q);
TINYRTP_API int trtp_manager_signal_pkt_loss(trtp_manager_t* self, uint32_t ssrc_media, const uint16_t* seq_nums, tsk_size_t count);
TINYRTP_API int trtp_manager_signal_frame_corrupted(trtp_manager_t* self, uint32_t ssrc_media);
TINYRTP_API int trtp_manager_signal_jb_error(trtp_manager_t* self, uint32_t ssrc_media);
diff --git a/tinyRTP/include/tinyrtp/trtp_srtp.h b/tinyRTP/include/tinyrtp/trtp_srtp.h
index 9992bbb..2b3ac13 100755
--- a/tinyRTP/include/tinyrtp/trtp_srtp.h
+++ b/tinyRTP/include/tinyrtp/trtp_srtp.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,48 +26,45 @@
#include "tinyrtp_config.h"
#if HAVE_SRTP
-# include "tsk_common.h"
+# include "tsk_common.h"
# include <srtp/srtp.h>
struct trtp_manager_s;
-typedef enum trtp_srtp_dtls_event_type_e
-{
- trtp_srtp_dtls_event_type_handshake_failed,
- trtp_srtp_dtls_event_type_handshake_succeed,
- trtp_srtp_dtls_event_type_fatal_error,
- trtp_srtp_dtls_event_type_started
+typedef enum trtp_srtp_dtls_event_type_e {
+ trtp_srtp_dtls_event_type_handshake_failed,
+ trtp_srtp_dtls_event_type_handshake_succeed,
+ trtp_srtp_dtls_event_type_fatal_error,
+ trtp_srtp_dtls_event_type_started
}
trtp_srtp_dtls_event_type_t;
-typedef enum trtp_srtp_crypto_type_e
-{
- NONE = -1,
- HMAC_SHA1_80,
- HMAC_SHA1_32,
+typedef enum trtp_srtp_crypto_type_e {
+ NONE = -1,
+ HMAC_SHA1_80,
+ HMAC_SHA1_32,
- SRTP_CRYPTO_TYPES_MAX
+ SRTP_CRYPTO_TYPES_MAX
}
trtp_srtp_crypto_type_t;
-typedef enum trtp_srtp_state_e
-{
- trtp_srtp_state_none,
- /* at this state we're able to generated DTLS "fingerprints" and SDES "crypro" attributes
+typedef enum trtp_srtp_state_e {
+ trtp_srtp_state_none,
+ /* at this state we're able to generated DTLS "fingerprints" and SDES "crypro" attributes
but neither encrypt() nor decrypt() is possible.
it's possible to move backward and disable SRTP (e.g. because of negotiation error)
it's required to move to this state in order to be able to negotiate SRTP when mode is "optional" or "mandatory"
*/
- trtp_srtp_state_enabled,
- /* at this state both required parameters (e.g. "crypto" attributes) have been successfuly proceeded
+ trtp_srtp_state_enabled,
+ /* at this state both required parameters (e.g. "crypto" attributes) have been successfuly proceeded
it's not possible to move backward and disable SRTP
if type="SDES": start()ing the engine means we'll be imediately able to encrypt()/decrypt() data
if type="DTLS": start()ing the engine doesn't mean we will be able to encrypt()/decrypt() data unless handshaking process successfuly completed
*/
- trtp_srtp_state_activated,
- /* at this state we're able to encrypt()/decrypt() SRTP data
+ trtp_srtp_state_activated,
+ /* at this state we're able to encrypt()/decrypt() SRTP data
*/
- trtp_srtp_state_started
+ trtp_srtp_state_started
}
trtp_srtp_state_t;
@@ -79,31 +76,28 @@ typedef int (*trtp_srtp_dtls_cb_f)(const void* usrdata, enum trtp_srtp_dtls_eve
#define TRTP_SRTP_LINE_IDX_LOCAL 0
#define TRTP_SRTP_LINE_IDX_REMOTE 1
-static const char* trtp_srtp_crypto_type_strings[2] =
-{
- TRTP_SRTP_AES_CM_128_HMAC_SHA1_80, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32
+static const char* trtp_srtp_crypto_type_strings[2] = {
+ TRTP_SRTP_AES_CM_128_HMAC_SHA1_80, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32
};
-typedef struct trtp_srtp_ctx_internal_xs
-{
- int32_t tag;
- trtp_srtp_crypto_type_t crypto_type;
- char key_str[SRTP_MAX_KEY_LEN];
- char key_bin[SRTP_MASTER_KEY_LEN];
+typedef struct trtp_srtp_ctx_internal_xs {
+ int32_t tag;
+ trtp_srtp_crypto_type_t crypto_type;
+ char key_str[SRTP_MAX_KEY_LEN];
+ char key_bin[SRTP_MASTER_KEY_LEN];
tsk_bool_t have_valid_key;
- srtp_t session;
- srtp_policy_t policy;
- tsk_bool_t initialized;
+ srtp_t session;
+ srtp_policy_t policy;
+ tsk_bool_t initialized;
}
trtp_srtp_ctx_internal_xt;
-typedef struct trtp_srtp_ctx_xs
-{
- // (rtp == rtcp) for SDES but different for DTLS
- struct trtp_srtp_ctx_internal_xs rtp;
- struct trtp_srtp_ctx_internal_xs rtcp;
+typedef struct trtp_srtp_ctx_xs {
+ // (rtp == rtcp) for SDES but different for DTLS
+ struct trtp_srtp_ctx_internal_xs rtp;
+ struct trtp_srtp_ctx_internal_xs rtcp;
}
trtp_srtp_ctx_xt;
diff --git a/tinyRTP/include/tinyrtp_config.h b/tinyRTP/include/tinyrtp_config.h
index 422b68f..cb1faed 100755
--- a/tinyRTP/include/tinyrtp_config.h
+++ b/tinyRTP/include/tinyrtp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,13 +49,13 @@
# define TINYRTP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TRTP_BEGIN_DECLS extern "C" {
# define TRTP_END_DECLS }
#else
-# define TRTP_BEGIN_DECLS
+# define TRTP_BEGIN_DECLS
# define TRTP_END_DECLS
#endif
@@ -86,7 +86,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYRTP_CONFIG_H
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_header.c b/tinyRTP/src/rtcp/trtp_rtcp_header.c
index e93772a..d11d32f 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_header.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,73 +35,73 @@ header |V=2|P| RC | PT=SR=200 | length |
trtp_rtcp_header_t* trtp_rtcp_header_create_null()
{
- return tsk_object_new(trtp_rtcp_header_def_t);
+ return tsk_object_new(trtp_rtcp_header_def_t);
}
trtp_rtcp_header_t* trtp_rtcp_header_create(uint8_t version, uint8_t padding, uint8_t rc, trtp_rtcp_packet_type_t type, uint16_t length_in_bytes)
{
- trtp_rtcp_header_t* header;
- if((header = trtp_rtcp_header_create_null())){
- header->version = version;
- header->padding = padding;
- header->rc = rc;
- header->type = type;
- header->length_in_words_minus1 = ((length_in_bytes >> 2) - 1);
- header->length_in_bytes = length_in_bytes;
- }
+ trtp_rtcp_header_t* header;
+ if((header = trtp_rtcp_header_create_null())) {
+ header->version = version;
+ header->padding = padding;
+ header->rc = rc;
+ header->type = type;
+ header->length_in_words_minus1 = ((length_in_bytes >> 2) - 1);
+ header->length_in_bytes = length_in_bytes;
+ }
- return header;
+ return header;
}
int trtp_rtcp_header_serialize_to(const trtp_rtcp_header_t *self, void* data, tsk_size_t size)
{
- uint8_t* pdata = (uint8_t*)data;
- if(!self || !data || size < TRTP_RTCP_HEADER_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // Octet-0: version(2), Padding(1), RC(5)
- pdata[0] = ((uint8_t)self->version)<<6 |
- ((uint8_t)self->padding)<<5 |
- ((uint8_t)self->rc);
- // Octet-1: PT(8)
- pdata[1] = self->type;
- // Octet-2 and Octet3: length (16)
- pdata[2] = self->length_in_words_minus1 >> 8;
- pdata[3] = self->length_in_words_minus1 & 0xFF;
- return 0;
+ uint8_t* pdata = (uint8_t*)data;
+ if(!self || !data || size < TRTP_RTCP_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // Octet-0: version(2), Padding(1), RC(5)
+ pdata[0] = ((uint8_t)self->version)<<6 |
+ ((uint8_t)self->padding)<<5 |
+ ((uint8_t)self->rc);
+ // Octet-1: PT(8)
+ pdata[1] = self->type;
+ // Octet-2 and Octet3: length (16)
+ pdata[2] = self->length_in_words_minus1 >> 8;
+ pdata[3] = self->length_in_words_minus1 & 0xFF;
+ return 0;
}
trtp_rtcp_header_t* trtp_rtcp_header_deserialize(const void *data, tsk_size_t size)
{
- trtp_rtcp_header_t* header = tsk_null;
- if(trtp_rtcp_header_deserialize_to(&header, data, size) != 0){
- TSK_DEBUG_ERROR("Failed to deserialize the rtcp header");
- TSK_OBJECT_SAFE_FREE(header);
- }
- return header;
+ trtp_rtcp_header_t* header = tsk_null;
+ if(trtp_rtcp_header_deserialize_to(&header, data, size) != 0) {
+ TSK_DEBUG_ERROR("Failed to deserialize the rtcp header");
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ return header;
}
int trtp_rtcp_header_deserialize_to(trtp_rtcp_header_t** self, const void *data, tsk_size_t size)
{
- const uint8_t* pdata = (uint8_t*)data;
- if(!self || !data || size < TRTP_RTCP_HEADER_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!*self && !(*self = trtp_rtcp_header_create_null())){
- TSK_DEBUG_ERROR("Failed to create new rtcp header");
- return -3;
- }
- (*self)->version = pdata[0] >> 6;
- (*self)->padding = (pdata[0] >> 5) & 0x01;
- (*self)->rc = (pdata[0] & 0x1f);
- (*self)->type = (enum trtp_rtcp_packet_type_e)pdata[1];
- (*self)->length_in_words_minus1 = tnet_ntohs_2(&pdata[2]);
- (*self)->length_in_bytes = ((*self)->length_in_words_minus1 + 1) << 2;
+ const uint8_t* pdata = (uint8_t*)data;
+ if(!self || !data || size < TRTP_RTCP_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return 0;
+ if(!*self && !(*self = trtp_rtcp_header_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create new rtcp header");
+ return -3;
+ }
+ (*self)->version = pdata[0] >> 6;
+ (*self)->padding = (pdata[0] >> 5) & 0x01;
+ (*self)->rc = (pdata[0] & 0x1f);
+ (*self)->type = (enum trtp_rtcp_packet_type_e)pdata[1];
+ (*self)->length_in_words_minus1 = tnet_ntohs_2(&pdata[2]);
+ (*self)->length_in_bytes = ((*self)->length_in_words_minus1 + 1) << 2;
+
+ return 0;
}
//=================================================================================================
@@ -109,26 +109,25 @@ int trtp_rtcp_header_deserialize_to(trtp_rtcp_header_t** self, const void *data,
//
static tsk_object_t* trtp_rtcp_header_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_header_t *header = self;
- if(header){
- }
- return self;
+ trtp_rtcp_header_t *header = self;
+ if(header) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_header_dtor(tsk_object_t * self)
-{
- trtp_rtcp_header_t *header = self;
- if(header){
- }
+{
+ trtp_rtcp_header_t *header = self;
+ if(header) {
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_header_def_s =
-{
- sizeof(trtp_rtcp_header_t),
- trtp_rtcp_header_ctor,
- trtp_rtcp_header_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_header_def_s = {
+ sizeof(trtp_rtcp_header_t),
+ trtp_rtcp_header_ctor,
+ trtp_rtcp_header_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_header_def_t = &trtp_rtcp_header_def_s;
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_packet.c b/tinyRTP/src/rtcp/trtp_rtcp_packet.c
index d2ec856..d5614b8 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_packet.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_packet.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,224 +32,255 @@
static tsk_object_t* trtp_rtcp_packet_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_packet_t *packet = self;
- if(packet){
- }
- return self;
+ trtp_rtcp_packet_t *packet = self;
+ if(packet) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_packet_dtor(tsk_object_t * self)
-{
- trtp_rtcp_packet_t *packet = self;
- if(packet){
+{
+ trtp_rtcp_packet_t *packet = self;
+ if(packet) {
- }
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_packet_def_s =
-{
- sizeof(trtp_rtcp_packet_t),
- trtp_rtcp_packet_ctor,
- trtp_rtcp_packet_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_packet_def_s = {
+ sizeof(trtp_rtcp_packet_t),
+ trtp_rtcp_packet_ctor,
+ trtp_rtcp_packet_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_packet_def_t = &trtp_rtcp_packet_def_s;
trtp_rtcp_packet_t* trtp_rtcp_packet_create(struct trtp_rtcp_header_s* header)
{
- trtp_rtcp_packet_t* packet;
- if((packet = tsk_object_new(trtp_rtcp_packet_def_t)) && header){
- packet->header = tsk_object_ref(header);
- }
- return packet;
+ trtp_rtcp_packet_t* packet;
+ if((packet = tsk_object_new(trtp_rtcp_packet_def_t)) && header) {
+ packet->header = tsk_object_ref(header);
+ }
+ return packet;
}
int trtp_rtcp_packet_init(trtp_rtcp_packet_t* self, uint8_t version, uint8_t padding, uint8_t rc, trtp_rtcp_packet_type_t type, uint16_t length_in_bytes)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->header){
- self->header = trtp_rtcp_header_create(version, padding, rc, type, length_in_bytes);
- }
- else{
- self->header->version = version;
- self->header->padding = padding;
- self->header->rc = rc;
- self->header->type = type;
- self->header->length_in_bytes = length_in_bytes;
- self->header->length_in_words_minus1 = ((length_in_bytes >> 2) - 1);
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->header) {
+ self->header = trtp_rtcp_header_create(version, padding, rc, type, length_in_bytes);
+ }
+ else {
+ self->header->version = version;
+ self->header->padding = padding;
+ self->header->rc = rc;
+ self->header->type = type;
+ self->header->length_in_bytes = length_in_bytes;
+ self->header->length_in_words_minus1 = ((length_in_bytes >> 2) - 1);
+ }
+ return 0;
}
trtp_rtcp_packet_t* trtp_rtcp_packet_deserialize(const void* data, tsk_size_t size)
{
- trtp_rtcp_packet_type_t type;
-
- if(!data || size < TRTP_RTCP_HEADER_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- type = (trtp_rtcp_packet_type_t)((const uint8_t*)data)[1];
-
- switch(type){
- case trtp_rtcp_packet_type_rr: return (trtp_rtcp_packet_t*)trtp_rtcp_report_rr_deserialize(data, size);
- case trtp_rtcp_packet_type_sr: return (trtp_rtcp_packet_t*)trtp_rtcp_report_sr_deserialize(data, size);
- case trtp_rtcp_packet_type_sdes: return (trtp_rtcp_packet_t*)trtp_rtcp_report_sdes_deserialize(data, size);
- case trtp_rtcp_packet_type_bye: return (trtp_rtcp_packet_t*)trtp_rtcp_report_bye_deserialize(data, size);
- case trtp_rtcp_packet_type_rtpfb: return (trtp_rtcp_packet_t*)trtp_rtcp_report_rtpfb_deserialize(data, size);
- case trtp_rtcp_packet_type_psfb: return (trtp_rtcp_packet_t*)trtp_rtcp_report_psfb_deserialize(data, size);
- default:
- {
- // returns abstract RTCP packet
- trtp_rtcp_header_t* header;
- TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)type);
- if((header = trtp_rtcp_header_deserialize(data, size))){
- trtp_rtcp_packet_t* packet = trtp_rtcp_packet_create(header);
- TSK_OBJECT_SAFE_FREE(header);
- return packet;
- }
- break;
- }
- }
-
- return tsk_null;
+ trtp_rtcp_packet_type_t type;
+
+ if(!data || size < TRTP_RTCP_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ type = (trtp_rtcp_packet_type_t)((const uint8_t*)data)[1];
+
+ switch(type) {
+ case trtp_rtcp_packet_type_rr:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_rr_deserialize(data, size);
+ case trtp_rtcp_packet_type_sr:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_sr_deserialize(data, size);
+ case trtp_rtcp_packet_type_sdes:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_sdes_deserialize(data, size);
+ case trtp_rtcp_packet_type_bye:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_bye_deserialize(data, size);
+ case trtp_rtcp_packet_type_rtpfb:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_rtpfb_deserialize(data, size);
+ case trtp_rtcp_packet_type_psfb:
+ return (trtp_rtcp_packet_t*)trtp_rtcp_report_psfb_deserialize(data, size);
+ default: {
+ // returns abstract RTCP packet
+ trtp_rtcp_header_t* header;
+ TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)type);
+ if((header = trtp_rtcp_header_deserialize(data, size))) {
+ trtp_rtcp_packet_t* packet = trtp_rtcp_packet_create(header);
+ TSK_OBJECT_SAFE_FREE(header);
+ return packet;
+ }
+ break;
+ }
+ }
+
+ return tsk_null;
}
int trtp_rtcp_packet_serialize_to(const trtp_rtcp_packet_t* self, void* data, tsk_size_t size)
{
- if(!self || !self->header || !data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->header->type){
- case trtp_rtcp_packet_type_rr: return trtp_rtcp_report_rr_serialize_to((const trtp_rtcp_report_rr_t*)self, data, size);
- case trtp_rtcp_packet_type_sr: return trtp_rtcp_report_sr_serialize_to((const trtp_rtcp_report_sr_t*)self, data, size);
- case trtp_rtcp_packet_type_sdes: return trtp_rtcp_report_sdes_serialize_to((const trtp_rtcp_report_sdes_t*)self, data, size);
- case trtp_rtcp_packet_type_bye: return trtp_rtcp_report_bye_serialize_to((const trtp_rtcp_report_bye_t*)self, data, size);
- case trtp_rtcp_packet_type_psfb: return trtp_rtcp_report_psfb_serialize_to((const trtp_rtcp_report_psfb_t*)self, data, size);
- case trtp_rtcp_packet_type_rtpfb: return trtp_rtcp_report_rtpfb_serialize_to((const trtp_rtcp_report_rtpfb_t*)self, data, size);
- default:
- {
- TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)self->header->type);
- return -2;
- }
- }
+ if(!self || !self->header || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->header->type) {
+ case trtp_rtcp_packet_type_rr:
+ return trtp_rtcp_report_rr_serialize_to((const trtp_rtcp_report_rr_t*)self, data, size);
+ case trtp_rtcp_packet_type_sr:
+ return trtp_rtcp_report_sr_serialize_to((const trtp_rtcp_report_sr_t*)self, data, size);
+ case trtp_rtcp_packet_type_sdes:
+ return trtp_rtcp_report_sdes_serialize_to((const trtp_rtcp_report_sdes_t*)self, data, size);
+ case trtp_rtcp_packet_type_bye:
+ return trtp_rtcp_report_bye_serialize_to((const trtp_rtcp_report_bye_t*)self, data, size);
+ case trtp_rtcp_packet_type_psfb:
+ return trtp_rtcp_report_psfb_serialize_to((const trtp_rtcp_report_psfb_t*)self, data, size);
+ case trtp_rtcp_packet_type_rtpfb:
+ return trtp_rtcp_report_rtpfb_serialize_to((const trtp_rtcp_report_rtpfb_t*)self, data, size);
+ default: {
+ TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)self->header->type);
+ return -2;
+ }
+ }
}
tsk_buffer_t* trtp_rtcp_packet_serialize(const trtp_rtcp_packet_t* self, tsk_size_t num_bytes_pad)
{
- tsk_size_t size = trtp_rtcp_packet_get_size(self);
- if(self && size){
- tsk_buffer_t* buffer;
- const tsk_size_t _size = (size + num_bytes_pad);
- if((buffer = tsk_buffer_create(tsk_null, _size))){
- if(trtp_rtcp_packet_serialize_to(self, buffer->data, size) != 0){
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- else buffer->size = size;
- return buffer;
- }
- }
- return tsk_null;
+ tsk_size_t size = trtp_rtcp_packet_get_size(self);
+ if(self && size) {
+ tsk_buffer_t* buffer;
+ const tsk_size_t _size = (size + num_bytes_pad);
+ if((buffer = tsk_buffer_create(tsk_null, _size))) {
+ if(trtp_rtcp_packet_serialize_to(self, buffer->data, size) != 0) {
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ else {
+ buffer->size = size;
+ }
+ return buffer;
+ }
+ }
+ return tsk_null;
}
int trtp_rtcp_packet_add_packet(trtp_rtcp_packet_t* self, trtp_rtcp_packet_t* packet, tsk_bool_t front)
{
- trtp_rtcp_packets_L_t* packets = tsk_null;
- if(!self || !self->header || !packet){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->header->type){
- case trtp_rtcp_packet_type_rr: packets = ((trtp_rtcp_report_rr_t*)self)->packets; break;
- case trtp_rtcp_packet_type_sr: packets = ((trtp_rtcp_report_sr_t*)self)->packets; break;
- case trtp_rtcp_packet_type_bye: packets = ((trtp_rtcp_report_bye_t*)self)->packets; break;
- default: TSK_DEBUG_ERROR("not valid operation for packet type %d", (int)self->header->type); return -2;
- }
-
- if(packets){
- //tsk_size_t packet_size = trtp_rtcp_packet_get_size(packet);
- packet = tsk_object_ref(packet);
- // self->header->length_in_bytes += packet_size;
- // self->header->length_in_words_minus1 = ((self->header->length_in_bytes >> 2) - 1) +
- // ((self->header->length_in_bytes & 0x03) ? 1 : 0);
- tsk_list_push_data(packets, (void**)&packet, !front);
- }
-
- return 0;
+ trtp_rtcp_packets_L_t* packets = tsk_null;
+ if(!self || !self->header || !packet) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->header->type) {
+ case trtp_rtcp_packet_type_rr:
+ packets = ((trtp_rtcp_report_rr_t*)self)->packets;
+ break;
+ case trtp_rtcp_packet_type_sr:
+ packets = ((trtp_rtcp_report_sr_t*)self)->packets;
+ break;
+ case trtp_rtcp_packet_type_bye:
+ packets = ((trtp_rtcp_report_bye_t*)self)->packets;
+ break;
+ default:
+ TSK_DEBUG_ERROR("not valid operation for packet type %d", (int)self->header->type);
+ return -2;
+ }
+
+ if(packets) {
+ //tsk_size_t packet_size = trtp_rtcp_packet_get_size(packet);
+ packet = tsk_object_ref(packet);
+ // self->header->length_in_bytes += packet_size;
+ // self->header->length_in_words_minus1 = ((self->header->length_in_bytes >> 2) - 1) +
+ // ((self->header->length_in_bytes & 0x03) ? 1 : 0);
+ tsk_list_push_data(packets, (void**)&packet, !front);
+ }
+
+ return 0;
}
const trtp_rtcp_packet_t* trtp_rtcp_packet_get_at(const trtp_rtcp_packet_t* self, trtp_rtcp_packet_type_t type, tsk_size_t index)
{
- const tsk_list_item_t *item;
- const trtp_rtcp_packets_L_t* packets = tsk_null;
- tsk_size_t i;
-
- if(!self || !self->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if(self->header->type == type && index == 0){
- return self;
- }
- switch(self->header->type){
- case trtp_rtcp_packet_type_rr: packets = ((const trtp_rtcp_report_rr_t*)self)->packets; break;
- case trtp_rtcp_packet_type_sr: packets = ((const trtp_rtcp_report_sr_t*)self)->packets; break;
- case trtp_rtcp_packet_type_bye: packets = ((const trtp_rtcp_report_bye_t*)self)->packets; break;
- default: break;
- }
-
- i = 0;
- tsk_list_foreach(item, packets){
- if(TRTP_RTCP_PACKET(item->data)->header->type == type && i++ >= index){
- return TRTP_RTCP_PACKET(item->data);
- }
- }
- return tsk_null;
+ const tsk_list_item_t *item;
+ const trtp_rtcp_packets_L_t* packets = tsk_null;
+ tsk_size_t i;
+
+ if(!self || !self->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if(self->header->type == type && index == 0) {
+ return self;
+ }
+ switch(self->header->type) {
+ case trtp_rtcp_packet_type_rr:
+ packets = ((const trtp_rtcp_report_rr_t*)self)->packets;
+ break;
+ case trtp_rtcp_packet_type_sr:
+ packets = ((const trtp_rtcp_report_sr_t*)self)->packets;
+ break;
+ case trtp_rtcp_packet_type_bye:
+ packets = ((const trtp_rtcp_report_bye_t*)self)->packets;
+ break;
+ default:
+ break;
+ }
+
+ i = 0;
+ tsk_list_foreach(item, packets) {
+ if(TRTP_RTCP_PACKET(item->data)->header->type == type && i++ >= index) {
+ return TRTP_RTCP_PACKET(item->data);
+ }
+ }
+ return tsk_null;
}
const trtp_rtcp_packet_t* trtp_rtcp_packet_get(const trtp_rtcp_packet_t* self, trtp_rtcp_packet_type_t type)
{
- return trtp_rtcp_packet_get_at(self, type, 0);
+ return trtp_rtcp_packet_get_at(self, type, 0);
}
tsk_size_t trtp_rtcp_packet_get_size(const trtp_rtcp_packet_t* self)
{
- if(!self || !self->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- switch(self->header->type){
- case trtp_rtcp_packet_type_rr: return trtp_rtcp_report_rr_get_size((const trtp_rtcp_report_rr_t*)self);
- case trtp_rtcp_packet_type_sr: return trtp_rtcp_report_sr_get_size((const trtp_rtcp_report_sr_t*)self);
- case trtp_rtcp_packet_type_sdes: return trtp_rtcp_report_sdes_get_size((const trtp_rtcp_report_sdes_t*)self);
- case trtp_rtcp_packet_type_bye: return trtp_rtcp_report_bye_get_size((const trtp_rtcp_report_bye_t*)self);
- case trtp_rtcp_packet_type_rtpfb: return trtp_rtcp_report_rtpfb_get_size((const trtp_rtcp_report_rtpfb_t*)self);
- case trtp_rtcp_packet_type_psfb: return trtp_rtcp_report_psfb_get_size((const trtp_rtcp_report_psfb_t*)self);
- default:
- {
- TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)self->header->type);
- return self->header->length_in_bytes;
- }
- }
+ if(!self || !self->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ switch(self->header->type) {
+ case trtp_rtcp_packet_type_rr:
+ return trtp_rtcp_report_rr_get_size((const trtp_rtcp_report_rr_t*)self);
+ case trtp_rtcp_packet_type_sr:
+ return trtp_rtcp_report_sr_get_size((const trtp_rtcp_report_sr_t*)self);
+ case trtp_rtcp_packet_type_sdes:
+ return trtp_rtcp_report_sdes_get_size((const trtp_rtcp_report_sdes_t*)self);
+ case trtp_rtcp_packet_type_bye:
+ return trtp_rtcp_report_bye_get_size((const trtp_rtcp_report_bye_t*)self);
+ case trtp_rtcp_packet_type_rtpfb:
+ return trtp_rtcp_report_rtpfb_get_size((const trtp_rtcp_report_rtpfb_t*)self);
+ case trtp_rtcp_packet_type_psfb:
+ return trtp_rtcp_report_psfb_get_size((const trtp_rtcp_report_psfb_t*)self);
+ default: {
+ TSK_DEBUG_ERROR("%d not recognized as valid RTCP packet type", (int)self->header->type);
+ return self->header->length_in_bytes;
+ }
+ }
}
int trtp_rtcp_packet_deinit(trtp_rtcp_packet_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(self->header);
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(self->header);
+ return 0;
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_rblock.c b/tinyRTP/src/rtcp/trtp_rtcp_rblock.c
index 9a85b4b..3c9bc51 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_rblock.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_rblock.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,112 +42,111 @@ block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
static tsk_object_t* trtp_rtcp_rblock_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_rblock_t *block = self;
- if(block){
- }
- return self;
+ trtp_rtcp_rblock_t *block = self;
+ if(block) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_rblock_dtor(tsk_object_t * self)
-{
- trtp_rtcp_rblock_t *block = self;
- if(block){
- }
+{
+ trtp_rtcp_rblock_t *block = self;
+ if(block) {
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_rblock_def_s =
-{
- sizeof(trtp_rtcp_rblock_t),
- trtp_rtcp_rblock_ctor,
- trtp_rtcp_rblock_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_rblock_def_s = {
+ sizeof(trtp_rtcp_rblock_t),
+ trtp_rtcp_rblock_ctor,
+ trtp_rtcp_rblock_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_rblock_def_t = &trtp_rtcp_rblock_def_s;
trtp_rtcp_rblock_t* trtp_rtcp_rblock_create_null()
{
- return tsk_object_new(trtp_rtcp_rblock_def_t);
+ return tsk_object_new(trtp_rtcp_rblock_def_t);
}
trtp_rtcp_rblock_t* trtp_rtcp_rblock_deserialize(const void* data, tsk_size_t size)
{
- trtp_rtcp_rblock_t* rblock = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- if(!data || size < TRTP_RTCP_RBLOCK_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if((rblock = trtp_rtcp_rblock_create_null())){
- rblock->ssrc = (uint32_t)tnet_ntohl_2(pdata);
- rblock->fraction = pdata[4];
- rblock->cumulative_no_lost = (tnet_ntohl_2(&pdata[5]) >> 8) & 0xFFFFFF;
- rblock->last_seq = (uint32_t)tnet_ntohl_2(&pdata[8]);
- rblock->jitter = (uint32_t)tnet_ntohl_2(&pdata[12]);
- rblock->lsr = (uint32_t)tnet_ntohl_2(&pdata[16]);
- rblock->dlsr = (uint32_t)tnet_ntohl_2(&pdata[20]);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create report block object");
- }
+ trtp_rtcp_rblock_t* rblock = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ if(!data || size < TRTP_RTCP_RBLOCK_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if((rblock = trtp_rtcp_rblock_create_null())) {
+ rblock->ssrc = (uint32_t)tnet_ntohl_2(pdata);
+ rblock->fraction = pdata[4];
+ rblock->cumulative_no_lost = (tnet_ntohl_2(&pdata[5]) >> 8) & 0xFFFFFF;
+ rblock->last_seq = (uint32_t)tnet_ntohl_2(&pdata[8]);
+ rblock->jitter = (uint32_t)tnet_ntohl_2(&pdata[12]);
+ rblock->lsr = (uint32_t)tnet_ntohl_2(&pdata[16]);
+ rblock->dlsr = (uint32_t)tnet_ntohl_2(&pdata[20]);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create report block object");
+ }
- return rblock;
+ return rblock;
}
// Up to the
int trtp_rtcp_rblock_deserialize_list(const void* data, tsk_size_t _size, trtp_rtcp_rblocks_L_t* dest_list)
{
- int32_t size = (int32_t)_size;
- const uint8_t* pdata = (const uint8_t*)data;
- trtp_rtcp_rblock_t* rblock;
+ int32_t size = (int32_t)_size;
+ const uint8_t* pdata = (const uint8_t*)data;
+ trtp_rtcp_rblock_t* rblock;
- if(!data || !size || !dest_list){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!data || !size || !dest_list) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- while(size >= TRTP_RTCP_RBLOCK_SIZE){
- if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))){
- tsk_list_push_back_data(dest_list, (void**)&rblock);
- }
- if((size -= TRTP_RTCP_RBLOCK_SIZE) > 0){
- pdata += TRTP_RTCP_RBLOCK_SIZE;
- }
- }
- return 0;
+ while(size >= TRTP_RTCP_RBLOCK_SIZE) {
+ if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))) {
+ tsk_list_push_back_data(dest_list, (void**)&rblock);
+ }
+ if((size -= TRTP_RTCP_RBLOCK_SIZE) > 0) {
+ pdata += TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+ return 0;
}
int trtp_rtcp_rblock_serialize_to(const trtp_rtcp_rblock_t* self, void* data, tsk_size_t size)
{
- uint8_t* pdata = (uint8_t*)data;
- if(!self || !data || size < TRTP_RTCP_RBLOCK_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ uint8_t* pdata = (uint8_t*)data;
+ if(!self || !data || size < TRTP_RTCP_RBLOCK_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- pdata[0] = self->ssrc >> 24;
- pdata[1] = (self->ssrc >> 16) & 0xFF;
- pdata[2] = (self->ssrc >> 8) & 0xFF;
- pdata[3] = (self->ssrc & 0xFF);
- pdata[4] = self->fraction;
- pdata[5] = (self->cumulative_no_lost >> 16) & 0xFF;
- pdata[6] = (self->cumulative_no_lost >> 8) & 0xFF;
- pdata[7] = (self->cumulative_no_lost & 0xFF);
- pdata[8] = self->last_seq >> 24;
- pdata[9] = (self->last_seq >> 16) & 0xFF;
- pdata[10] = (self->last_seq >> 8) & 0xFF;
- pdata[11] = (self->last_seq & 0xFF);
- pdata[12] = self->jitter >> 24;
- pdata[13] = (self->jitter >> 16) & 0xFF;
- pdata[14] = (self->jitter >> 8) & 0xFF;
- pdata[15] = (self->jitter & 0xFF);
- pdata[16] = self->lsr >> 24;
- pdata[17] = (self->lsr >> 16) & 0xFF;
- pdata[18] = (self->lsr >> 8) & 0xFF;
- pdata[19] = (self->lsr & 0xFF);
- pdata[20] = self->dlsr >> 24;
- pdata[21] = (self->dlsr >> 16) & 0xFF;
- pdata[22] = (self->dlsr >> 8) & 0xFF;
- pdata[23] = (self->dlsr & 0xFF);
+ pdata[0] = self->ssrc >> 24;
+ pdata[1] = (self->ssrc >> 16) & 0xFF;
+ pdata[2] = (self->ssrc >> 8) & 0xFF;
+ pdata[3] = (self->ssrc & 0xFF);
+ pdata[4] = self->fraction;
+ pdata[5] = (self->cumulative_no_lost >> 16) & 0xFF;
+ pdata[6] = (self->cumulative_no_lost >> 8) & 0xFF;
+ pdata[7] = (self->cumulative_no_lost & 0xFF);
+ pdata[8] = self->last_seq >> 24;
+ pdata[9] = (self->last_seq >> 16) & 0xFF;
+ pdata[10] = (self->last_seq >> 8) & 0xFF;
+ pdata[11] = (self->last_seq & 0xFF);
+ pdata[12] = self->jitter >> 24;
+ pdata[13] = (self->jitter >> 16) & 0xFF;
+ pdata[14] = (self->jitter >> 8) & 0xFF;
+ pdata[15] = (self->jitter & 0xFF);
+ pdata[16] = self->lsr >> 24;
+ pdata[17] = (self->lsr >> 16) & 0xFF;
+ pdata[18] = (self->lsr >> 8) & 0xFF;
+ pdata[19] = (self->lsr & 0xFF);
+ pdata[20] = self->dlsr >> 24;
+ pdata[21] = (self->dlsr >> 16) & 0xFF;
+ pdata[22] = (self->dlsr >> 8) & 0xFF;
+ pdata[23] = (self->dlsr & 0xFF);
- return 0;
+ return 0;
} \ No newline at end of file
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report.c b/tinyRTP/src/rtcp/trtp_rtcp_report.c
index 5fb2697..41e177b 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_bye.c b/tinyRTP/src/rtcp/trtp_rtcp_report_bye.c
index 0f44608..9085160 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_bye.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_bye.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,195 +31,194 @@
static tsk_object_t* trtp_rtcp_report_bye_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_bye_t *bye = self;
- if(bye){
- bye->packets = tsk_list_create();
- }
- return self;
+ trtp_rtcp_report_bye_t *bye = self;
+ if(bye) {
+ bye->packets = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_bye_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_bye_t *bye = self;
- if(bye){
- // deinit self
- TSK_OBJECT_SAFE_FREE(bye->packets);
- TSK_FREE(bye->ssrc_list);
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(bye));
- }
-
- return self;
+{
+ trtp_rtcp_report_bye_t *bye = self;
+ if(bye) {
+ // deinit self
+ TSK_OBJECT_SAFE_FREE(bye->packets);
+ TSK_FREE(bye->ssrc_list);
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(bye));
+ }
+
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_report_bye_def_s =
-{
- sizeof(trtp_rtcp_report_bye_t),
- trtp_rtcp_report_bye_ctor,
- trtp_rtcp_report_bye_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_report_bye_def_s = {
+ sizeof(trtp_rtcp_report_bye_t),
+ trtp_rtcp_report_bye_ctor,
+ trtp_rtcp_report_bye_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_bye_def_t = &trtp_rtcp_report_bye_def_s;
trtp_rtcp_report_bye_t* trtp_rtcp_report_bye_create_null()
{
- trtp_rtcp_report_bye_t* bye;
- if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(bye), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_bye, TRTP_RTCP_HEADER_SIZE);
- }
- return bye;
+ trtp_rtcp_report_bye_t* bye;
+ if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(bye), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_bye, TRTP_RTCP_HEADER_SIZE);
+ }
+ return bye;
}
trtp_rtcp_report_bye_t* trtp_rtcp_report_bye_create(struct trtp_rtcp_header_s* header)
{
- trtp_rtcp_report_bye_t* bye;
- if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))){
- TRTP_RTCP_PACKET(bye)->header = tsk_object_ref(header);
- }
- return bye;
+ trtp_rtcp_report_bye_t* bye;
+ if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))) {
+ TRTP_RTCP_PACKET(bye)->header = tsk_object_ref(header);
+ }
+ return bye;
}
trtp_rtcp_report_bye_t* trtp_rtcp_report_bye_create_2(uint32_t ssrc)
{
- uint32_t* ssrc_list = tsk_malloc(sizeof(uint32_t));
- if(ssrc_list){
- trtp_rtcp_report_bye_t* bye;
- if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(bye), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_bye, (TRTP_RTCP_HEADER_SIZE + 4));
- TRTP_RTCP_PACKET(bye)->header->rc = 1;
- *ssrc_list = ssrc, bye->ssrc_list = ssrc_list, ssrc_list = tsk_null;
- }
- TSK_FREE(ssrc_list);
- return bye;
- }
- return tsk_null;
+ uint32_t* ssrc_list = tsk_malloc(sizeof(uint32_t));
+ if(ssrc_list) {
+ trtp_rtcp_report_bye_t* bye;
+ if((bye = (trtp_rtcp_report_bye_t*)tsk_object_new(trtp_rtcp_report_bye_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(bye), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_bye, (TRTP_RTCP_HEADER_SIZE + 4));
+ TRTP_RTCP_PACKET(bye)->header->rc = 1;
+ *ssrc_list = ssrc, bye->ssrc_list = ssrc_list, ssrc_list = tsk_null;
+ }
+ TSK_FREE(ssrc_list);
+ return bye;
+ }
+ return tsk_null;
}
trtp_rtcp_report_bye_t* trtp_rtcp_report_bye_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_bye_t* bye = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- int32_t size = (int32_t)_size;
-
- if(!data || size < TRTP_RTCP_PACKET_BYE_MIN_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!(header = trtp_rtcp_header_deserialize(pdata, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the header");
- goto bail;
- }
- if(header->length_in_bytes < TRTP_RTCP_PACKET_BYE_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
-
- if(!(bye = trtp_rtcp_report_bye_create(header))){
- TSK_DEBUG_ERROR("Failed to create object");
- goto bail;
- }
-
- pdata += (TRTP_RTCP_HEADER_SIZE);
- size -= (TRTP_RTCP_HEADER_SIZE);
-
- // SSRCs
- if(header->rc > 0){
- tsk_size_t i;
- if((int32_t)(header->rc * sizeof(uint32_t)) > size){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
- if(!(bye->ssrc_list = tsk_calloc(header->rc, sizeof(uint32_t)))){
- goto bail;
- }
- for(i = 0; i < header->rc; ++i){
- bye->ssrc_list[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
- pdata += sizeof(uint32_t);
- size -= sizeof(uint32_t);
- }
- }
-
- // Other Packets
- while(size > TRTP_RTCP_HEADER_SIZE){
- trtp_rtcp_packet_t* packet;
-
- if((packet = trtp_rtcp_packet_deserialize(pdata, size))){
- if((size -= packet->header->length_in_bytes) > 0){
- pdata += packet->header->length_in_bytes;
- }
- tsk_list_push_back_data(bye->packets, (void**)&packet);
- continue;
- }
- break;
- }
+ trtp_rtcp_report_bye_t* bye = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ int32_t size = (int32_t)_size;
+
+ if(!data || size < TRTP_RTCP_PACKET_BYE_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!(header = trtp_rtcp_header_deserialize(pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the header");
+ goto bail;
+ }
+ if(header->length_in_bytes < TRTP_RTCP_PACKET_BYE_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+
+ if(!(bye = trtp_rtcp_report_bye_create(header))) {
+ TSK_DEBUG_ERROR("Failed to create object");
+ goto bail;
+ }
+
+ pdata += (TRTP_RTCP_HEADER_SIZE);
+ size -= (TRTP_RTCP_HEADER_SIZE);
+
+ // SSRCs
+ if(header->rc > 0) {
+ tsk_size_t i;
+ if((int32_t)(header->rc * sizeof(uint32_t)) > size) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ if(!(bye->ssrc_list = tsk_calloc(header->rc, sizeof(uint32_t)))) {
+ goto bail;
+ }
+ for(i = 0; i < header->rc; ++i) {
+ bye->ssrc_list[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
+ pdata += sizeof(uint32_t);
+ size -= sizeof(uint32_t);
+ }
+ }
+
+ // Other Packets
+ while(size > TRTP_RTCP_HEADER_SIZE) {
+ trtp_rtcp_packet_t* packet;
+
+ if((packet = trtp_rtcp_packet_deserialize(pdata, size))) {
+ if((size -= packet->header->length_in_bytes) > 0) {
+ pdata += packet->header->length_in_bytes;
+ }
+ tsk_list_push_back_data(bye->packets, (void**)&packet);
+ continue;
+ }
+ break;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(header);
- return bye;
+ TSK_OBJECT_SAFE_FREE(header);
+ return bye;
}
int trtp_rtcp_report_bye_serialize_to(const trtp_rtcp_report_bye_t* self, void* data, tsk_size_t size)
{
- int ret;
- tsk_size_t i;
- uint8_t* pdata = (uint8_t*)data;
- const tsk_list_item_t* item;
-
- if(!self || !data || size < trtp_rtcp_report_bye_get_size(self)){
- return -1;
- }
-
- if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the header");
- return ret;
- }
-
- pdata += (TRTP_RTCP_HEADER_SIZE);
- size -= (TRTP_RTCP_HEADER_SIZE);
-
- for(i = 0; i < TRTP_RTCP_PACKET(self)->header->rc; ++i){
- pdata[0] = self->ssrc_list[i] >> 24;
- pdata[1] = (self->ssrc_list[i] >> 16) & 0xFF;
- pdata[2] = (self->ssrc_list[i] >> 8) & 0xFF;
- pdata[3] = (self->ssrc_list[i] & 0xFF);
- pdata += 4;
- size -= 4;
- }
-
- tsk_list_foreach(item, self->packets){
- if(!item->data){
- continue;
- }
- if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize packet");
- goto bail;
- }
- pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
+ int ret;
+ tsk_size_t i;
+ uint8_t* pdata = (uint8_t*)data;
+ const tsk_list_item_t* item;
+
+ if(!self || !data || size < trtp_rtcp_report_bye_get_size(self)) {
+ return -1;
+ }
+
+ if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the header");
+ return ret;
+ }
+
+ pdata += (TRTP_RTCP_HEADER_SIZE);
+ size -= (TRTP_RTCP_HEADER_SIZE);
+
+ for(i = 0; i < TRTP_RTCP_PACKET(self)->header->rc; ++i) {
+ pdata[0] = self->ssrc_list[i] >> 24;
+ pdata[1] = (self->ssrc_list[i] >> 16) & 0xFF;
+ pdata[2] = (self->ssrc_list[i] >> 8) & 0xFF;
+ pdata[3] = (self->ssrc_list[i] & 0xFF);
+ pdata += 4;
+ size -= 4;
+ }
+
+ tsk_list_foreach(item, self->packets) {
+ if(!item->data) {
+ continue;
+ }
+ if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize packet");
+ goto bail;
+ }
+ pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
bail:
- return ret;
+ return ret;
}
tsk_size_t trtp_rtcp_report_bye_get_size(const trtp_rtcp_report_bye_t* self)
{
- tsk_size_t size;
- const tsk_list_item_t* item;
-
- if(!self || !TRTP_RTCP_PACKET(self)->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
- tsk_list_foreach(item, self->packets){
- if(item->data && TRTP_RTCP_PACKET(item->data)->header){
- size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
- }
-
- return size;
+ tsk_size_t size;
+ const tsk_list_item_t* item;
+
+ if(!self || !TRTP_RTCP_PACKET(self)->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
+ tsk_list_foreach(item, self->packets) {
+ if(item->data && TRTP_RTCP_PACKET(item->data)->header) {
+ size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
+ }
+
+ return size;
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_fb.c b/tinyRTP/src/rtcp/trtp_rtcp_report_fb.c
index bbc80b1..bb6690e 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_fb.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_fb.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WArtpfbANTY; without even the implied wartpfbanty 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 DOUBANGO.
*
@@ -35,270 +35,274 @@
static int _trtp_rtcp_report_fb_deserialize(const void* data, tsk_size_t _size, trtp_rtcp_header_t** header, uint32_t* ssrc_sender, uint32_t* ssrc_media_src)
{
- const uint8_t* pdata = data;
- if(!data || !header || _size < TRTP_RTCP_PACKET_FB_MIN_SIZE || (_size & 0x03)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!(*header = trtp_rtcp_header_deserialize(pdata, _size))){
- TSK_DEBUG_ERROR("Failed to deserialize the header");
- return -3;
- }
- if((*header)->length_in_bytes < TRTP_RTCP_PACKET_FB_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short");
- return -4;
- }
- else if((*header)->length_in_bytes > _size){
- TSK_DEBUG_ERROR("Too long");
- return -5;
- }
-
- *ssrc_sender = (uint32_t)tnet_ntohl_2(&pdata[4]);
- *ssrc_media_src = (uint32_t)tnet_ntohl_2(&pdata[8]);
- return 0;
+ const uint8_t* pdata = data;
+ if(!data || !header || _size < TRTP_RTCP_PACKET_FB_MIN_SIZE || (_size & 0x03)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!(*header = trtp_rtcp_header_deserialize(pdata, _size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the header");
+ return -3;
+ }
+ if((*header)->length_in_bytes < TRTP_RTCP_PACKET_FB_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ return -4;
+ }
+ else if((*header)->length_in_bytes > _size) {
+ TSK_DEBUG_ERROR("Too long");
+ return -5;
+ }
+
+ *ssrc_sender = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ *ssrc_media_src = (uint32_t)tnet_ntohl_2(&pdata[8]);
+ return 0;
}
static int _trtp_rtcp_report_fb_serialize_to(const trtp_rtcp_report_fb_t* self, void* data, tsk_size_t size)
{
- int ret;
- uint8_t* pdata = (uint8_t*)data;
-
- if(!self || !data || size < TRTP_RTCP_PACKET_FB_MIN_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the header");
- return ret;
- }
-
- pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc_sender >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc_sender >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc_sender >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc_sender & 0xFF);
- pdata[TRTP_RTCP_HEADER_SIZE + 4] = self->ssrc_media >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 5] = (self->ssrc_media >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 6] = (self->ssrc_media >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 7] = (self->ssrc_media & 0xFF);
-
- return 0;
+ int ret;
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(!self || !data || size < TRTP_RTCP_PACKET_FB_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the header");
+ return ret;
+ }
+
+ pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc_sender >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc_sender >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc_sender >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc_sender & 0xFF);
+ pdata[TRTP_RTCP_HEADER_SIZE + 4] = self->ssrc_media >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 5] = (self->ssrc_media >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 6] = (self->ssrc_media >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 7] = (self->ssrc_media & 0xFF);
+
+ return 0;
}
static tsk_object_t* trtp_rtcp_report_rtpfb_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_rtpfb_t *rtpfb = self;
- if(rtpfb){
-
- }
- return self;
+ trtp_rtcp_report_rtpfb_t *rtpfb = self;
+ if(rtpfb) {
+
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_rtpfb_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_rtpfb_t *rtpfb = self;
- if(rtpfb){
- // deinit self
- switch(rtpfb->fci_type){
- case trtp_rtcp_rtpfb_fci_type_nack:
- {
- TSK_FREE(rtpfb->nack.pid);
- TSK_FREE(rtpfb->nack.blp);
- break;
- }
- case trtp_rtcp_rtpfb_fci_type_tmmbn:
- {
- TSK_FREE(rtpfb->tmmbn.ssrc);
- TSK_FREE(rtpfb->tmmbn.MxTBR_Exp);
- TSK_FREE(rtpfb->tmmbn.MxTBR_Mantissa);
- TSK_FREE(rtpfb->tmmbn.MeasuredOverhead);
- break;
- }
- }
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(rtpfb));
- }
-
- return self;
-}
-static const tsk_object_def_t trtp_rtcp_report_rtpfb_def_s =
{
- sizeof(trtp_rtcp_report_rtpfb_t),
- trtp_rtcp_report_rtpfb_ctor,
- trtp_rtcp_report_rtpfb_dtor,
- tsk_null,
+ trtp_rtcp_report_rtpfb_t *rtpfb = self;
+ if(rtpfb) {
+ // deinit self
+ switch(rtpfb->fci_type) {
+ case trtp_rtcp_rtpfb_fci_type_nack: {
+ TSK_FREE(rtpfb->nack.pid);
+ TSK_FREE(rtpfb->nack.blp);
+ break;
+ }
+ case trtp_rtcp_rtpfb_fci_type_tmmbn: {
+ TSK_FREE(rtpfb->tmmbn.ssrc);
+ TSK_FREE(rtpfb->tmmbn.MxTBR_Exp);
+ TSK_FREE(rtpfb->tmmbn.MxTBR_Mantissa);
+ TSK_FREE(rtpfb->tmmbn.MeasuredOverhead);
+ break;
+ }
+ }
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(rtpfb));
+ }
+
+ return self;
+}
+static const tsk_object_def_t trtp_rtcp_report_rtpfb_def_s = {
+ sizeof(trtp_rtcp_report_rtpfb_t),
+ trtp_rtcp_report_rtpfb_ctor,
+ trtp_rtcp_report_rtpfb_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_rtpfb_def_t = &trtp_rtcp_report_rtpfb_def_s;
trtp_rtcp_report_rtpfb_t* trtp_rtcp_report_rtpfb_create_null()
{
- trtp_rtcp_report_rtpfb_t* rtpfb;
- if((rtpfb = (trtp_rtcp_report_rtpfb_t*)tsk_object_new(trtp_rtcp_report_rtpfb_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(rtpfb), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_rtpfb, TRTP_RTCP_PACKET_FB_MIN_SIZE);
- }
- return rtpfb;
+ trtp_rtcp_report_rtpfb_t* rtpfb;
+ if((rtpfb = (trtp_rtcp_report_rtpfb_t*)tsk_object_new(trtp_rtcp_report_rtpfb_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(rtpfb), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_rtpfb, TRTP_RTCP_PACKET_FB_MIN_SIZE);
+ }
+ return rtpfb;
}
trtp_rtcp_report_rtpfb_t* trtp_rtcp_report_rtpfb_create(trtp_rtcp_header_t* header)
{
- trtp_rtcp_report_rtpfb_t* rtpfb;
- if((rtpfb = (trtp_rtcp_report_rtpfb_t*)tsk_object_new(trtp_rtcp_report_rtpfb_def_t))){
- TRTP_RTCP_PACKET(rtpfb)->header = tsk_object_ref(header);
- }
- return rtpfb;
+ trtp_rtcp_report_rtpfb_t* rtpfb;
+ if((rtpfb = (trtp_rtcp_report_rtpfb_t*)tsk_object_new(trtp_rtcp_report_rtpfb_def_t))) {
+ TRTP_RTCP_PACKET(rtpfb)->header = tsk_object_ref(header);
+ }
+ return rtpfb;
}
trtp_rtcp_report_rtpfb_t* trtp_rtcp_report_rtpfb_create_2(trtp_rtcp_rtpfb_fci_type_t fci_type, uint32_t ssrc_sender, uint32_t ssrc_media_src)
{
- trtp_rtcp_report_rtpfb_t* rtpfb;
- if((rtpfb = trtp_rtcp_report_rtpfb_create_null())){
- rtpfb->fci_type = TRTP_RTCP_PACKET(rtpfb)->header->rc = fci_type;
- TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_sender = ssrc_sender;
- TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_media = ssrc_media_src;
- }
- return rtpfb;
+ trtp_rtcp_report_rtpfb_t* rtpfb;
+ if((rtpfb = trtp_rtcp_report_rtpfb_create_null())) {
+ rtpfb->fci_type = TRTP_RTCP_PACKET(rtpfb)->header->rc = fci_type;
+ TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_sender = ssrc_sender;
+ TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_media = ssrc_media_src;
+ }
+ return rtpfb;
}
// seq_nums[n] must be in [seq_nums[0], seq_nums[0] + 16] and > seq_nums[n - 1]
trtp_rtcp_report_rtpfb_t* trtp_rtcp_report_rtpfb_create_nack(uint32_t ssrc_sender, uint32_t ssrc_media_src, const uint16_t* seq_nums, tsk_size_t count)
{
- trtp_rtcp_report_rtpfb_t* rtpfb;
- if(!seq_nums || !count){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if((rtpfb = trtp_rtcp_report_rtpfb_create_2(trtp_rtcp_rtpfb_fci_type_nack, ssrc_sender, ssrc_media_src))){
- tsk_size_t i, j;
- rtpfb->nack.count = 1; // max = 16
- rtpfb->nack.blp = tsk_malloc(sizeof(uint16_t));
- rtpfb->nack.pid = tsk_malloc(sizeof(uint16_t));
- if(!rtpfb->nack.blp || !rtpfb->nack.pid){
- TSK_OBJECT_SAFE_FREE(rtpfb);
- return tsk_null;
- }
- rtpfb->nack.pid[0] = seq_nums[0];
- rtpfb->nack.blp[0] = 0;
- for(i = 1; i <= 16 && i < count; ++i){
- j = seq_nums[i] - rtpfb->nack.pid[0];
- rtpfb->nack.blp[0] |= (1 << (j - 1));
- }
-
- TRTP_RTCP_PACKET(rtpfb)->header->length_in_bytes += (uint32_t)(rtpfb->nack.count << 2);
- TRTP_RTCP_PACKET(rtpfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(rtpfb)->header->length_in_bytes >> 2) - 1);
- }
- return rtpfb;
+ trtp_rtcp_report_rtpfb_t* rtpfb;
+ if(!seq_nums || !count) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if((rtpfb = trtp_rtcp_report_rtpfb_create_2(trtp_rtcp_rtpfb_fci_type_nack, ssrc_sender, ssrc_media_src))) {
+ tsk_size_t i, j;
+ rtpfb->nack.count = 1; // max = 16
+ rtpfb->nack.blp = tsk_malloc(sizeof(uint16_t));
+ rtpfb->nack.pid = tsk_malloc(sizeof(uint16_t));
+ if(!rtpfb->nack.blp || !rtpfb->nack.pid) {
+ TSK_OBJECT_SAFE_FREE(rtpfb);
+ return tsk_null;
+ }
+ rtpfb->nack.pid[0] = seq_nums[0];
+ rtpfb->nack.blp[0] = 0;
+ for(i = 1; i <= 16 && i < count; ++i) {
+ j = seq_nums[i] - rtpfb->nack.pid[0];
+ rtpfb->nack.blp[0] |= (1 << (j - 1));
+ }
+
+ TRTP_RTCP_PACKET(rtpfb)->header->length_in_bytes += (uint32_t)(rtpfb->nack.count << 2);
+ TRTP_RTCP_PACKET(rtpfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(rtpfb)->header->length_in_bytes >> 2) - 1);
+ }
+ return rtpfb;
}
trtp_rtcp_report_rtpfb_t* trtp_rtcp_report_rtpfb_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_rtpfb_t* rtpfb = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- uint32_t ssrc_sender, ssrc_media_src;
-
- if(_trtp_rtcp_report_fb_deserialize(data, _size, &header, &ssrc_sender, &ssrc_media_src) == 0){
- if((rtpfb = trtp_rtcp_report_rtpfb_create(header))){
- const uint8_t* pdata = ((const uint8_t*)data) + TRTP_RTCP_PACKET_FB_MIN_SIZE;
- tsk_size_t size = (header->length_in_bytes - TRTP_RTCP_PACKET_FB_MIN_SIZE), i;
-
- TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_sender = ssrc_sender;
- TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_media = ssrc_media_src;
-
- switch(rtpfb->fci_type = (trtp_rtcp_rtpfb_fci_type_t)header->rc){
- case trtp_rtcp_rtpfb_fci_type_nack:
- {
- if((rtpfb->nack.count = (size >> 2)) > 0){
- rtpfb->nack.pid = tsk_realloc(rtpfb->nack.pid, (rtpfb->nack.count * sizeof(uint16_t)));
- rtpfb->nack.blp = tsk_realloc(rtpfb->nack.blp, (rtpfb->nack.count * sizeof(uint16_t)));
- for(i = 0; i < rtpfb->nack.count; ++i){
- if(rtpfb->nack.pid) rtpfb->nack.pid[i] = tnet_ntohs_2(&pdata[0]);
- if(rtpfb->nack.blp) rtpfb->nack.blp[i] = tnet_ntohs_2(&pdata[2]);
- pdata += 4;
- }
- }
- break;
- }
- case trtp_rtcp_rtpfb_fci_type_tmmbn:
- {
- TSK_DEBUG_INFO("TMMBN");
- if((rtpfb->tmmbn.count = (size >> 3)) > 0){
- uint32_t u32;
- rtpfb->tmmbn.ssrc = tsk_realloc(rtpfb->tmmbn.ssrc, (rtpfb->tmmbn.count * sizeof(uint32_t)));
- rtpfb->tmmbn.MxTBR_Exp = tsk_realloc(rtpfb->tmmbn.MxTBR_Exp, (rtpfb->tmmbn.count * sizeof(uint16_t)));
- rtpfb->tmmbn.MxTBR_Mantissa = tsk_realloc(rtpfb->tmmbn.MxTBR_Mantissa, (rtpfb->tmmbn.count * sizeof(uint32_t)));
- rtpfb->tmmbn.MeasuredOverhead = tsk_realloc(rtpfb->tmmbn.MeasuredOverhead, (rtpfb->tmmbn.count * sizeof(uint16_t)));
- for(i = 0; i < rtpfb->tmmbn.count; ++i){
- if(rtpfb->tmmbn.ssrc) rtpfb->tmmbn.ssrc[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
- u32 = (uint32_t)tnet_ntohl_2(&pdata[4]);
- if(rtpfb->tmmbn.MxTBR_Exp) rtpfb->tmmbn.MxTBR_Exp[i] = (u32 >> 26);
- if(rtpfb->tmmbn.MxTBR_Mantissa) rtpfb->tmmbn.MxTBR_Mantissa[i] = ((u32 >> 9) & 0x1FFFF);
- if(rtpfb->tmmbn.MeasuredOverhead) rtpfb->tmmbn.MeasuredOverhead[i] = (u32 & 0x1FF);
- pdata += 8;
- }
- }
- break;
- }
-
- default:
- {
- TSK_DEBUG_ERROR("Unsupported Feedback message type %d", (int)rtpfb->fci_type);
- break;
- }
- }
- }
- }
-
- TSK_OBJECT_SAFE_FREE(header);
- return rtpfb;
+ trtp_rtcp_report_rtpfb_t* rtpfb = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ uint32_t ssrc_sender, ssrc_media_src;
+
+ if(_trtp_rtcp_report_fb_deserialize(data, _size, &header, &ssrc_sender, &ssrc_media_src) == 0) {
+ if((rtpfb = trtp_rtcp_report_rtpfb_create(header))) {
+ const uint8_t* pdata = ((const uint8_t*)data) + TRTP_RTCP_PACKET_FB_MIN_SIZE;
+ tsk_size_t size = (header->length_in_bytes - TRTP_RTCP_PACKET_FB_MIN_SIZE), i;
+
+ TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_sender = ssrc_sender;
+ TRTP_RTCP_REPORT_FB(rtpfb)->ssrc_media = ssrc_media_src;
+
+ switch(rtpfb->fci_type = (trtp_rtcp_rtpfb_fci_type_t)header->rc) {
+ case trtp_rtcp_rtpfb_fci_type_nack: {
+ if((rtpfb->nack.count = (size >> 2)) > 0) {
+ rtpfb->nack.pid = tsk_realloc(rtpfb->nack.pid, (rtpfb->nack.count * sizeof(uint16_t)));
+ rtpfb->nack.blp = tsk_realloc(rtpfb->nack.blp, (rtpfb->nack.count * sizeof(uint16_t)));
+ for(i = 0; i < rtpfb->nack.count; ++i) {
+ if(rtpfb->nack.pid) {
+ rtpfb->nack.pid[i] = tnet_ntohs_2(&pdata[0]);
+ }
+ if(rtpfb->nack.blp) {
+ rtpfb->nack.blp[i] = tnet_ntohs_2(&pdata[2]);
+ }
+ pdata += 4;
+ }
+ }
+ break;
+ }
+ case trtp_rtcp_rtpfb_fci_type_tmmbn: {
+ TSK_DEBUG_INFO("TMMBN");
+ if((rtpfb->tmmbn.count = (size >> 3)) > 0) {
+ uint32_t u32;
+ rtpfb->tmmbn.ssrc = tsk_realloc(rtpfb->tmmbn.ssrc, (rtpfb->tmmbn.count * sizeof(uint32_t)));
+ rtpfb->tmmbn.MxTBR_Exp = tsk_realloc(rtpfb->tmmbn.MxTBR_Exp, (rtpfb->tmmbn.count * sizeof(uint16_t)));
+ rtpfb->tmmbn.MxTBR_Mantissa = tsk_realloc(rtpfb->tmmbn.MxTBR_Mantissa, (rtpfb->tmmbn.count * sizeof(uint32_t)));
+ rtpfb->tmmbn.MeasuredOverhead = tsk_realloc(rtpfb->tmmbn.MeasuredOverhead, (rtpfb->tmmbn.count * sizeof(uint16_t)));
+ for(i = 0; i < rtpfb->tmmbn.count; ++i) {
+ if(rtpfb->tmmbn.ssrc) {
+ rtpfb->tmmbn.ssrc[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
+ }
+ u32 = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ if(rtpfb->tmmbn.MxTBR_Exp) {
+ rtpfb->tmmbn.MxTBR_Exp[i] = (u32 >> 26);
+ }
+ if(rtpfb->tmmbn.MxTBR_Mantissa) {
+ rtpfb->tmmbn.MxTBR_Mantissa[i] = ((u32 >> 9) & 0x1FFFF);
+ }
+ if(rtpfb->tmmbn.MeasuredOverhead) {
+ rtpfb->tmmbn.MeasuredOverhead[i] = (u32 & 0x1FF);
+ }
+ pdata += 8;
+ }
+ }
+ break;
+ }
+
+ default: {
+ TSK_DEBUG_ERROR("Unsupported Feedback message type %d", (int)rtpfb->fci_type);
+ break;
+ }
+ }
+ }
+ }
+
+ TSK_OBJECT_SAFE_FREE(header);
+ return rtpfb;
}
int trtp_rtcp_report_rtpfb_serialize_to(const trtp_rtcp_report_rtpfb_t* self, void* data, tsk_size_t size)
{
- int ret;
- uint8_t* pdata = (uint8_t*)data;
-
- if(!self || !data || size < trtp_rtcp_report_rtpfb_get_size(self)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = _trtp_rtcp_report_fb_serialize_to(TRTP_RTCP_REPORT_FB(self), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize FB message");
- return ret;
- }
- pdata += TRTP_RTCP_PACKET_FB_MIN_SIZE;
- size -= TRTP_RTCP_PACKET_FB_MIN_SIZE;
-
- switch(self->fci_type){
- case trtp_rtcp_rtpfb_fci_type_nack:
- {
- tsk_size_t i;
- for(i = 0; i < self->nack.count; ++i){
- pdata[0] = self->nack.pid[i] >> 8;
- pdata[1] = (self->nack.pid[i] & 0xFF);
- pdata[2] = self->nack.blp[i] >> 8;
- pdata[3] = (self->nack.blp[i] & 0xFF);
- pdata += 4;
- }
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("Not implemented");
- return -2;
- }
- }
- return 0;
+ int ret;
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(!self || !data || size < trtp_rtcp_report_rtpfb_get_size(self)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = _trtp_rtcp_report_fb_serialize_to(TRTP_RTCP_REPORT_FB(self), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize FB message");
+ return ret;
+ }
+ pdata += TRTP_RTCP_PACKET_FB_MIN_SIZE;
+ size -= TRTP_RTCP_PACKET_FB_MIN_SIZE;
+
+ switch(self->fci_type) {
+ case trtp_rtcp_rtpfb_fci_type_nack: {
+ tsk_size_t i;
+ for(i = 0; i < self->nack.count; ++i) {
+ pdata[0] = self->nack.pid[i] >> 8;
+ pdata[1] = (self->nack.pid[i] & 0xFF);
+ pdata[2] = self->nack.blp[i] >> 8;
+ pdata[3] = (self->nack.blp[i] & 0xFF);
+ pdata += 4;
+ }
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("Not implemented");
+ return -2;
+ }
+ }
+ return 0;
}
tsk_size_t trtp_rtcp_report_rtpfb_get_size(const trtp_rtcp_report_rtpfb_t* self)
{
- if(!self || !TRTP_RTCP_PACKET(self)->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return TRTP_RTCP_PACKET(self)->header->length_in_bytes;
+ if(!self || !TRTP_RTCP_PACKET(self)->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return TRTP_RTCP_PACKET(self)->header->length_in_bytes;
}
@@ -311,341 +315,406 @@ tsk_size_t trtp_rtcp_report_rtpfb_get_size(const trtp_rtcp_report_rtpfb_t* self)
static tsk_object_t* trtp_rtcp_report_psfb_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_psfb_t *psfb = self;
- if(psfb){
-
- }
- return self;
+ trtp_rtcp_report_psfb_t *psfb = self;
+ if(psfb) {
+
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_psfb_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_psfb_t *psfb = self;
- if(psfb){
- // deinit self
- switch(psfb->fci_type){
- case trtp_rtcp_psfb_fci_type_pli:
- break;
- case trtp_rtcp_psfb_fci_type_sli:
- TSK_FREE(psfb->sli.first);
- TSK_FREE(psfb->sli.number);
- TSK_FREE(psfb->sli.pic_id);
- break;
- case trtp_rtcp_psfb_fci_type_rpsi:
- TSK_FREE(psfb->rpsi.bytes);
- break;
- case trtp_rtcp_psfb_fci_type_fir:
- TSK_FREE(psfb->fir.ssrc);
- TSK_FREE(psfb->fir.seq_num);
- break;
- case trtp_rtcp_psfb_fci_type_afb:
- switch(psfb->afb.type){
- case trtp_rtcp_psfb_afb_type_none:
- TSK_FREE(psfb->afb.none.bytes);
- break;
- case trtp_rtcp_psfb_afb_type_remb:
- TSK_FREE(psfb->afb.remb.ssrc_feedbacks);
- break;
- }
- break;
- }
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(psfb));
- }
-
- return self;
-}
-static const tsk_object_def_t trtp_rtcp_report_psfb_def_s =
{
- sizeof(trtp_rtcp_report_psfb_t),
- trtp_rtcp_report_psfb_ctor,
- trtp_rtcp_report_psfb_dtor,
- tsk_null,
+ trtp_rtcp_report_psfb_t *psfb = self;
+ if(psfb) {
+ // deinit self
+ switch(psfb->fci_type) {
+ case trtp_rtcp_psfb_fci_type_pli:
+ break;
+ case trtp_rtcp_psfb_fci_type_sli:
+ TSK_FREE(psfb->sli.first);
+ TSK_FREE(psfb->sli.number);
+ TSK_FREE(psfb->sli.pic_id);
+ break;
+ case trtp_rtcp_psfb_fci_type_rpsi:
+ TSK_FREE(psfb->rpsi.bytes);
+ break;
+ case trtp_rtcp_psfb_fci_type_fir:
+ TSK_FREE(psfb->fir.ssrc);
+ TSK_FREE(psfb->fir.seq_num);
+ break;
+ case trtp_rtcp_psfb_fci_type_afb:
+ switch(psfb->afb.type) {
+ case trtp_rtcp_psfb_afb_type_none:
+ TSK_FREE(psfb->afb.none.bytes);
+ break;
+ case trtp_rtcp_psfb_afb_type_remb:
+ TSK_FREE(psfb->afb.remb.ssrc_feedbacks);
+ break;
+ case trtp_rtcp_psfb_afb_type_jcng:
+ TSK_FREE(psfb->afb.jcng.ssrc_feedbacks);
+ break;
+ }
+ break;
+ }
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(psfb));
+ }
+
+ return self;
+}
+static const tsk_object_def_t trtp_rtcp_report_psfb_def_s = {
+ sizeof(trtp_rtcp_report_psfb_t),
+ trtp_rtcp_report_psfb_ctor,
+ trtp_rtcp_report_psfb_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_psfb_def_t = &trtp_rtcp_report_psfb_def_s;
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_null()
{
- trtp_rtcp_report_psfb_t* psfb;
- if((psfb = (trtp_rtcp_report_psfb_t*)tsk_object_new(trtp_rtcp_report_psfb_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(psfb), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_psfb, TRTP_RTCP_PACKET_FB_MIN_SIZE);
- }
- return psfb;
+ trtp_rtcp_report_psfb_t* psfb;
+ if ((psfb = (trtp_rtcp_report_psfb_t*)tsk_object_new(trtp_rtcp_report_psfb_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(psfb), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_psfb, TRTP_RTCP_PACKET_FB_MIN_SIZE);
+ }
+ return psfb;
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create(trtp_rtcp_header_t* header)
{
- trtp_rtcp_report_psfb_t* psfb;
- if((psfb = (trtp_rtcp_report_psfb_t*)tsk_object_new(trtp_rtcp_report_psfb_def_t))){
- TRTP_RTCP_PACKET(psfb)->header = tsk_object_ref(header);
- }
- return psfb;
+ trtp_rtcp_report_psfb_t* psfb;
+ if ((psfb = (trtp_rtcp_report_psfb_t*)tsk_object_new(trtp_rtcp_report_psfb_def_t))) {
+ TRTP_RTCP_PACKET(psfb)->header = tsk_object_ref(header);
+ }
+ return psfb;
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_t fci_type, uint32_t ssrc_sender, uint32_t ssrc_media_src)
{
- trtp_rtcp_report_psfb_t* psfb;
- if((psfb = trtp_rtcp_report_psfb_create_null())){
- TRTP_RTCP_PACKET(psfb)->header->rc = psfb->fci_type = fci_type;
- TRTP_RTCP_REPORT_FB(psfb)->ssrc_sender = ssrc_sender;
- TRTP_RTCP_REPORT_FB(psfb)->ssrc_media = ssrc_media_src;
- }
- return psfb;
+ trtp_rtcp_report_psfb_t* psfb;
+ if ((psfb = trtp_rtcp_report_psfb_create_null())) {
+ TRTP_RTCP_PACKET(psfb)->header->rc = psfb->fci_type = fci_type;
+ TRTP_RTCP_REPORT_FB(psfb)->ssrc_sender = ssrc_sender;
+ TRTP_RTCP_REPORT_FB(psfb)->ssrc_media = ssrc_media_src;
+ }
+ return psfb;
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_pli(uint32_t ssrc_sender, uint32_t ssrc_media_src)
{
- return trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_pli, ssrc_sender, ssrc_media_src);
+ return trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_pli, ssrc_sender, ssrc_media_src);
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_fir(uint8_t seq_num, uint32_t ssrc_sender, uint32_t ssrc_media_src)
{
- trtp_rtcp_report_psfb_t* psfb;
- if((psfb = trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_fir, ssrc_sender, ssrc_media_src))){
- psfb->fir.ssrc = tsk_malloc(sizeof(uint32_t));
- psfb->fir.seq_num = tsk_malloc(sizeof(uint8_t));
- if(!psfb->fir.ssrc || !psfb->fir.seq_num){
- TSK_OBJECT_SAFE_FREE(psfb);
- return tsk_null;
- }
- psfb->fir.count = 1;
- psfb->fir.seq_num[0] = seq_num;
- psfb->fir.ssrc[0] = ssrc_media_src;
- TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += (uint32_t)(psfb->fir.count << 3);
- TRTP_RTCP_PACKET(psfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(psfb)->header->length_in_bytes >> 2) - 1);
- }
- return psfb;
+ trtp_rtcp_report_psfb_t* psfb;
+ if ((psfb = trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_fir, ssrc_sender, ssrc_media_src))) {
+ psfb->fir.ssrc = tsk_malloc(sizeof(uint32_t));
+ psfb->fir.seq_num = tsk_malloc(sizeof(uint8_t));
+ if (!psfb->fir.ssrc || !psfb->fir.seq_num) {
+ TSK_OBJECT_SAFE_FREE(psfb);
+ return tsk_null;
+ }
+ psfb->fir.count = 1;
+ psfb->fir.seq_num[0] = seq_num;
+ psfb->fir.ssrc[0] = ssrc_media_src;
+ TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += (uint32_t)(psfb->fir.count << 3);
+ TRTP_RTCP_PACKET(psfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(psfb)->header->length_in_bytes >> 2) - 1);
+ }
+ return psfb;
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_remb(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, uint32_t bitrate/*in bps*/)
{
- trtp_rtcp_report_psfb_t* psfb;
- // draft-alvestrand-rmcat-remb-02 2.2: SSRC media source always equal to zero
- if((psfb = trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_afb, ssrc_sender, 0))){
- static const uint32_t __max_mantissa = 131072;
- psfb->afb.type = trtp_rtcp_psfb_afb_type_remb;
- psfb->afb.remb.exp = 0;
- if(bitrate <= __max_mantissa){
- psfb->afb.remb.mantissa = bitrate;
- }
- else{
- while(bitrate >= (__max_mantissa << psfb->afb.remb.exp) && psfb->afb.remb.exp < 63) ++psfb->afb.remb.exp;
- psfb->afb.remb.mantissa = (bitrate >> psfb->afb.remb.exp);
- }
- if(ssrc_media_src_list && ssrc_media_src_list_count > 0 && (psfb->afb.remb.ssrc_feedbacks = (uint32_t*)tsk_malloc(ssrc_media_src_list_count << 2))){
- uint32_t i;
- psfb->afb.remb.num_ssrc = ssrc_media_src_list_count;
- for(i = 0; i < ssrc_media_src_list_count; ++i){
- psfb->afb.remb.ssrc_feedbacks[i] = ssrc_media_src_list[i];
- }
- }
- TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += 8; /*'R' 'E' 'M' 'B', Num SSRC, BR Exp, BR Mantissa */
- TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += (psfb->afb.remb.num_ssrc << 2);
- TRTP_RTCP_PACKET(psfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(psfb)->header->length_in_bytes >> 2) - 1);
- }
- return psfb;
+ trtp_rtcp_report_psfb_t* psfb;
+ // draft-alvestrand-rmcat-remb-02 2.2: SSRC media source always equal to zero
+ if ((psfb = trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_afb, ssrc_sender, 0))) {
+ static const uint32_t __max_mantissa = 131072;
+ psfb->afb.type = trtp_rtcp_psfb_afb_type_remb;
+ psfb->afb.remb.exp = 0;
+ if (bitrate <= __max_mantissa) {
+ psfb->afb.remb.mantissa = bitrate;
+ }
+ else {
+ while (bitrate >= (__max_mantissa << psfb->afb.remb.exp) && psfb->afb.remb.exp < 63) {
+ ++psfb->afb.remb.exp;
+ }
+ psfb->afb.remb.mantissa = (bitrate >> psfb->afb.remb.exp);
+ }
+ if (ssrc_media_src_list && ssrc_media_src_list_count > 0 && (psfb->afb.remb.ssrc_feedbacks = (uint32_t*)tsk_malloc(ssrc_media_src_list_count << 2))) {
+ uint32_t i;
+ psfb->afb.remb.num_ssrc = ssrc_media_src_list_count;
+ for (i = 0; i < ssrc_media_src_list_count; ++i) {
+ psfb->afb.remb.ssrc_feedbacks[i] = ssrc_media_src_list[i];
+ }
+ }
+ TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += 8; /*'R' 'E' 'M' 'B', Num SSRC, BR Exp, BR Mantissa */
+ TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += (psfb->afb.remb.num_ssrc << 2);
+ TRTP_RTCP_PACKET(psfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(psfb)->header->length_in_bytes >> 2) - 1);
+ }
+ return psfb;
+}
+
+trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_jcng(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, float jcng_q/*in quality metric*/)
+{
+ trtp_rtcp_report_psfb_t* psfb;
+ // SSRC media source always equal to zero
+ if ((psfb = trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_afb, ssrc_sender, 0))) {
+ psfb->afb.type = trtp_rtcp_psfb_afb_type_jcng;
+ psfb->afb.jcng.q = (uint8_t)(jcng_q * 255.f);
+ if (ssrc_media_src_list && ssrc_media_src_list_count > 0 && (psfb->afb.jcng.ssrc_feedbacks = (uint32_t*)tsk_malloc(ssrc_media_src_list_count << 2))) {
+ uint32_t i;
+ psfb->afb.jcng.num_ssrc = ssrc_media_src_list_count;
+ for (i = 0; i < ssrc_media_src_list_count; ++i) {
+ psfb->afb.jcng.ssrc_feedbacks[i] = ssrc_media_src_list[i];
+ }
+ }
+ TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += 8; /*'J' 'C' 'N' 'G', Num SSRC, Q, Reserverd */
+ TRTP_RTCP_PACKET(psfb)->header->length_in_bytes += (psfb->afb.jcng.num_ssrc << 2);
+ TRTP_RTCP_PACKET(psfb)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(psfb)->header->length_in_bytes >> 2) - 1);
+ }
+ return psfb;
}
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_psfb_t* psfb = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- uint32_t ssrc_sender, ssrc_media_src;
-
- if(_trtp_rtcp_report_fb_deserialize(data, _size, &header, &ssrc_sender, &ssrc_media_src) == 0){
- if((psfb = trtp_rtcp_report_psfb_create(header))){
- const uint8_t* pdata = ((const uint8_t*)data) + TRTP_RTCP_PACKET_FB_MIN_SIZE;
- tsk_size_t size = (header->length_in_bytes - TRTP_RTCP_PACKET_FB_MIN_SIZE);
-
- TRTP_RTCP_REPORT_FB(psfb)->ssrc_sender = ssrc_sender;
- TRTP_RTCP_REPORT_FB(psfb)->ssrc_media = ssrc_media_src;
-
- switch((psfb->fci_type = header->rc)/* FMT for RTCP-FB messages */){
- case trtp_rtcp_psfb_fci_type_pli:
- {
- // No FCI in PLI
- // TSK_DEBUG_INFO("PLI");
- break;
- }
- case trtp_rtcp_psfb_fci_type_sli:
- {
- tsk_size_t sli_count = (size >> 2), i;
- uint32_t u32;
- if(sli_count == 0){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
- psfb->sli.first = tsk_realloc(psfb->sli.first, (sli_count * sizeof(uint16_t)));
- psfb->sli.number = tsk_realloc(psfb->sli.number, (sli_count * sizeof(uint16_t)));
- psfb->sli.pic_id = tsk_realloc(psfb->sli.pic_id, (sli_count * sizeof(uint16_t)));
- for(i = 0; i < sli_count; ++i){
- u32 = (uint32_t)tnet_ntohl_2(&pdata[i >> 2]);
- if(psfb->sli.first) psfb->sli.first[i] = (u32 >> 19);
- if(psfb->sli.number) psfb->sli.number[i] = (u32 >> 6) & 0x1FFF;
- if(psfb->sli.pic_id) psfb->sli.pic_id[i] = u32 & 0x3F;
- }
-
- break;
- }
- case trtp_rtcp_psfb_fci_type_rpsi:
- {
- uint16_t u16;
- if(size < 2){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
- u16 = tnet_ntohs_2(&pdata[0]);
- psfb->rpsi.pb = (u16 >> 8);
- psfb->rpsi.pt = (u16 & 0x7F);
- if((psfb->rpsi.bytes = tsk_calloc((size - 2), sizeof(uint8_t)))){
- memcpy(psfb->rpsi.bytes, &pdata[2], (size - 2));
- }
- break;
- }
- case trtp_rtcp_psfb_fci_type_fir:
- {
- tsk_size_t fir_count = (size >> 3), i;
- if(fir_count == 0){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
- psfb->fir.count = fir_count;
- psfb->fir.ssrc = tsk_realloc(psfb->fir.seq_num, (fir_count * sizeof(uint32_t)));
- psfb->fir.seq_num = tsk_realloc(psfb->fir.seq_num, (fir_count * sizeof(uint8_t)));
- for(i = 0; i < fir_count; ++i){
- if(psfb->fir.ssrc) psfb->fir.ssrc[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
- if(psfb->fir.seq_num) psfb->fir.seq_num[i] = pdata[4];
- pdata+=8;
- }
- break;
- }
- case trtp_rtcp_psfb_fci_type_afb:
- {
- if(size > 0){
- psfb->afb.type = trtp_rtcp_psfb_afb_type_none;
- // REMB (http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-02) ?
- if(size > 4 && tsk_strniequals(pdata, "REMB", 4)){
- uint32_t _u32;
- if(size < 8){ // REMB, Num SSRC, BR Exp, BR Mantissa
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
- psfb->afb.type = trtp_rtcp_psfb_afb_type_remb;
- _u32 = (uint32_t)tnet_ntohl_2(&pdata[4]);
- psfb->afb.remb.num_ssrc = ((_u32 >> 24) & 0xFF);
- if((psfb->afb.remb.num_ssrc << 2) != (size - 8)){
- TSK_DEBUG_ERROR("Invalid size");
- psfb->afb.remb.num_ssrc = 0;
- goto bail;
- }
- psfb->afb.remb.exp = ((_u32 >> 18) & 0x3F);
- psfb->afb.remb.mantissa = (_u32 & 0x3FFFF);
- if((psfb->afb.remb.ssrc_feedbacks = tsk_malloc(psfb->afb.remb.num_ssrc << 2))){
- for(_u32 = 0; _u32 < psfb->afb.remb.num_ssrc; ++_u32){
- psfb->afb.remb.ssrc_feedbacks[_u32] = (uint32_t)tnet_ntohl_2(&pdata[8 + (_u32 << 2)]);
- }
- }
- }
- else{
- if((psfb->afb.none.bytes = tsk_calloc(size, sizeof(uint8_t)))){
- memcpy(psfb->afb.none.bytes, &pdata[0], size);
- }
- }
- }
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("%d not a valid FCI", psfb->fci_type);
- goto bail;
- }
- }
- }
- }
+ trtp_rtcp_report_psfb_t* psfb = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ uint32_t ssrc_sender, ssrc_media_src;
+
+ if(_trtp_rtcp_report_fb_deserialize(data, _size, &header, &ssrc_sender, &ssrc_media_src) == 0) {
+ if((psfb = trtp_rtcp_report_psfb_create(header))) {
+ const uint8_t* pdata = ((const uint8_t*)data) + TRTP_RTCP_PACKET_FB_MIN_SIZE;
+ tsk_size_t size = (header->length_in_bytes - TRTP_RTCP_PACKET_FB_MIN_SIZE);
+
+ TRTP_RTCP_REPORT_FB(psfb)->ssrc_sender = ssrc_sender;
+ TRTP_RTCP_REPORT_FB(psfb)->ssrc_media = ssrc_media_src;
+
+ switch((psfb->fci_type = header->rc)/* FMT for RTCP-FB messages */) {
+ case trtp_rtcp_psfb_fci_type_pli: {
+ // No FCI in PLI
+ // TSK_DEBUG_INFO("PLI");
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_sli: {
+ tsk_size_t sli_count = (size >> 2), i;
+ uint32_t u32;
+ if(sli_count == 0) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ psfb->sli.first = tsk_realloc(psfb->sli.first, (sli_count * sizeof(uint16_t)));
+ psfb->sli.number = tsk_realloc(psfb->sli.number, (sli_count * sizeof(uint16_t)));
+ psfb->sli.pic_id = tsk_realloc(psfb->sli.pic_id, (sli_count * sizeof(uint16_t)));
+ for(i = 0; i < sli_count; ++i) {
+ u32 = (uint32_t)tnet_ntohl_2(&pdata[i >> 2]);
+ if(psfb->sli.first) {
+ psfb->sli.first[i] = (u32 >> 19);
+ }
+ if(psfb->sli.number) {
+ psfb->sli.number[i] = (u32 >> 6) & 0x1FFF;
+ }
+ if(psfb->sli.pic_id) {
+ psfb->sli.pic_id[i] = u32 & 0x3F;
+ }
+ }
+
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_rpsi: {
+ uint16_t u16;
+ if(size < 2) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ u16 = tnet_ntohs_2(&pdata[0]);
+ psfb->rpsi.pb = (u16 >> 8);
+ psfb->rpsi.pt = (u16 & 0x7F);
+ if((psfb->rpsi.bytes = tsk_calloc((size - 2), sizeof(uint8_t)))) {
+ memcpy(psfb->rpsi.bytes, &pdata[2], (size - 2));
+ }
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_fir: {
+ tsk_size_t fir_count = (size >> 3), i;
+ if(fir_count == 0) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ psfb->fir.count = fir_count;
+ psfb->fir.ssrc = tsk_realloc(psfb->fir.seq_num, (fir_count * sizeof(uint32_t)));
+ psfb->fir.seq_num = tsk_realloc(psfb->fir.seq_num, (fir_count * sizeof(uint8_t)));
+ for(i = 0; i < fir_count; ++i) {
+ if(psfb->fir.ssrc) {
+ psfb->fir.ssrc[i] = (uint32_t)tnet_ntohl_2(&pdata[0]);
+ }
+ if(psfb->fir.seq_num) {
+ psfb->fir.seq_num[i] = pdata[4];
+ }
+ pdata+=8;
+ }
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_afb: {
+ if(size > 0) {
+ psfb->afb.type = trtp_rtcp_psfb_afb_type_none;
+ // REMB (http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-02) or jitter buffer congestion estimation message?
+ if (size > 4 && tsk_strniequals(pdata, "REMB", 4)) {
+ uint32_t _u32;
+ if (size < 8) { // REMB, Num SSRC, BR Exp, BR Mantissa
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ psfb->afb.type = trtp_rtcp_psfb_afb_type_remb;
+ _u32 = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ psfb->afb.remb.num_ssrc = ((_u32 >> 24) & 0xFF);
+ if ((psfb->afb.remb.num_ssrc << 2) != (size - 8)) {
+ TSK_DEBUG_ERROR("Invalid size");
+ psfb->afb.remb.num_ssrc = 0;
+ goto bail;
+ }
+ psfb->afb.remb.exp = ((_u32 >> 18) & 0x3F);
+ psfb->afb.remb.mantissa = (_u32 & 0x3FFFF);
+ if ((psfb->afb.remb.ssrc_feedbacks = tsk_malloc(psfb->afb.remb.num_ssrc << 2))) {
+ for (_u32 = 0; _u32 < psfb->afb.remb.num_ssrc; ++_u32) {
+ psfb->afb.remb.ssrc_feedbacks[_u32] = (uint32_t)tnet_ntohl_2(&pdata[8 + (_u32 << 2)]);
+ }
+ }
+ }
+ else if (size > 4 && tsk_strniequals(pdata, "JCNG", 4)) {
+ uint32_t _u32;
+ if (size < 8) { // JCNG, Num SSRC, Q, Reserved
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+ psfb->afb.type = trtp_rtcp_psfb_afb_type_jcng;
+ _u32 = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ psfb->afb.jcng.num_ssrc = ((_u32 >> 24) & 0xFF);
+ if ((psfb->afb.jcng.num_ssrc << 2) != (size - 8)) {
+ TSK_DEBUG_ERROR("Invalid size");
+ psfb->afb.jcng.num_ssrc = 0;
+ goto bail;
+ }
+ psfb->afb.jcng.q = ((_u32 >> 16) & 0xFF);
+ if ((psfb->afb.jcng.ssrc_feedbacks = tsk_malloc(psfb->afb.jcng.num_ssrc << 2))) {
+ for (_u32 = 0; _u32 < psfb->afb.jcng.num_ssrc; ++_u32) {
+ psfb->afb.jcng.ssrc_feedbacks[_u32] = (uint32_t)tnet_ntohl_2(&pdata[8 + (_u32 << 2)]);
+ }
+ }
+ }
+ else {
+ if ((psfb->afb.none.bytes = tsk_calloc(size, sizeof(uint8_t)))) {
+ memcpy(psfb->afb.none.bytes, &pdata[0], size);
+ }
+ }
+ }
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("%d not a valid FCI", psfb->fci_type);
+ goto bail;
+ }
+ }
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(header);
- return psfb;
+ TSK_OBJECT_SAFE_FREE(header);
+ return psfb;
}
int trtp_rtcp_report_psfb_serialize_to(const trtp_rtcp_report_psfb_t* self, void* data, tsk_size_t size)
{
- int ret;
- uint8_t* pdata = (uint8_t*)data;
-
- if(!self || !data || size < trtp_rtcp_report_psfb_get_size(self)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = _trtp_rtcp_report_fb_serialize_to(TRTP_RTCP_REPORT_FB(self), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize FB message");
- return ret;
- }
- pdata += TRTP_RTCP_PACKET_FB_MIN_SIZE;
- size -= TRTP_RTCP_PACKET_FB_MIN_SIZE;
-
- switch(self->fci_type){
- case trtp_rtcp_psfb_fci_type_pli:
- {
- // No FCI in PLI
- break;
- }
- case trtp_rtcp_psfb_fci_type_fir:
- {
- tsk_size_t i;
- for(i = 0; i < self->fir.count; ++i){
- pdata[0] = self->fir.ssrc[i] >> 24;
- pdata[1] = (self->fir.ssrc[i] >> 16) & 0xFF;
- pdata[2] = (self->fir.ssrc[i] >> 8) & 0xFF;
- pdata[3] = (self->fir.ssrc[i] & 0xFF);
- pdata[4] = self->fir.seq_num[i];
- pdata += 8; // SSRC (4), Seq nr(1), Reserved(3)
- }
- break;
- }
- case trtp_rtcp_psfb_fci_type_afb:
- {
- if(self->afb.type == trtp_rtcp_psfb_afb_type_remb){
- tsk_size_t i;
- // 'R' 'E' 'M' 'B'
- pdata[0] = 'R', pdata[1] = 'E', pdata[2] = 'M', pdata[3] = 'B';
- // | Num SSRC | BR Exp | BR Mantissa
- pdata[4] = self->afb.remb.num_ssrc; // 8bits
- pdata[5] = (self->afb.remb.exp << 2) & 0xFC;// 6bits
- // 18bits
- pdata[5] |= (self->afb.remb.mantissa >> 16) & 0x3;
- pdata[6] = (self->afb.remb.mantissa >> 8) & 0xFF;
- pdata[7] = (self->afb.remb.mantissa & 0xFF);
- if(self->afb.remb.ssrc_feedbacks){
- for(i = 0; i < self->afb.remb.num_ssrc; ++i){
- pdata[8 + (i<<2)] = self->afb.remb.ssrc_feedbacks[i] >> 24;
- pdata[8 + (i<<2) + 1] = (self->afb.remb.ssrc_feedbacks[i] >> 16) & 0xFF;
- pdata[8 + (i<<2) + 2] = (self->afb.remb.ssrc_feedbacks[i] >> 8) & 0xFF;
- pdata[8 + (i<<2) + 3] = (self->afb.remb.ssrc_feedbacks[i] & 0xFF);
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Not implemented yet");
- return -1;
- }
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("Not implemented yet");
- return -1;
- }
- }
-
- return ret;
+ int ret;
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(!self || !data || size < trtp_rtcp_report_psfb_get_size(self)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = _trtp_rtcp_report_fb_serialize_to(TRTP_RTCP_REPORT_FB(self), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize FB message");
+ return ret;
+ }
+ pdata += TRTP_RTCP_PACKET_FB_MIN_SIZE;
+ size -= TRTP_RTCP_PACKET_FB_MIN_SIZE;
+
+ switch(self->fci_type) {
+ case trtp_rtcp_psfb_fci_type_pli: {
+ // No FCI in PLI
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_fir: {
+ tsk_size_t i;
+ for(i = 0; i < self->fir.count; ++i) {
+ pdata[0] = self->fir.ssrc[i] >> 24;
+ pdata[1] = (self->fir.ssrc[i] >> 16) & 0xFF;
+ pdata[2] = (self->fir.ssrc[i] >> 8) & 0xFF;
+ pdata[3] = (self->fir.ssrc[i] & 0xFF);
+ pdata[4] = self->fir.seq_num[i];
+ pdata += 8; // SSRC (4), Seq nr(1), Reserved(3)
+ }
+ break;
+ }
+ case trtp_rtcp_psfb_fci_type_afb: {
+ if (self->afb.type == trtp_rtcp_psfb_afb_type_remb) {
+ tsk_size_t i;
+ // 'R' 'E' 'M' 'B'
+ pdata[0] = 'R', pdata[1] = 'E', pdata[2] = 'M', pdata[3] = 'B';
+ // | Num SSRC | BR Exp | BR Mantissa
+ pdata[4] = self->afb.remb.num_ssrc; // 8bits
+ pdata[5] = (self->afb.remb.exp << 2) & 0xFC;// 6bits
+ // 18bits
+ pdata[5] |= (self->afb.remb.mantissa >> 16) & 0x3;
+ pdata[6] = (self->afb.remb.mantissa >> 8) & 0xFF;
+ pdata[7] = (self->afb.remb.mantissa & 0xFF);
+ if (self->afb.remb.ssrc_feedbacks) {
+ for (i = 0; i < self->afb.remb.num_ssrc; ++i) {
+ pdata[8 + (i<<2)] = self->afb.remb.ssrc_feedbacks[i] >> 24;
+ pdata[8 + (i<<2) + 1] = (self->afb.remb.ssrc_feedbacks[i] >> 16) & 0xFF;
+ pdata[8 + (i<<2) + 2] = (self->afb.remb.ssrc_feedbacks[i] >> 8) & 0xFF;
+ pdata[8 + (i<<2) + 3] = (self->afb.remb.ssrc_feedbacks[i] & 0xFF);
+ }
+ }
+ }
+ else if (self->afb.type == trtp_rtcp_psfb_afb_type_jcng) {
+ tsk_size_t i;
+ // 'J' 'C' 'N' 'G'
+ pdata[0] = 'J', pdata[1] = 'C', pdata[2] = 'N', pdata[3] = 'G';
+ // | Num SSRC | Q | Reserved
+ pdata[4] = self->afb.jcng.num_ssrc; // 8bits
+ pdata[5] = self->afb.jcng.q;// 8bits
+ // 16bits, reserved, zeros
+ pdata[6] = 0x00;
+ pdata[7] = 0x00;
+ if (self->afb.jcng.ssrc_feedbacks) {
+ for (i = 0; i < self->afb.jcng.num_ssrc; ++i) {
+ pdata[8 + (i<<2)] = self->afb.jcng.ssrc_feedbacks[i] >> 24;
+ pdata[8 + (i<<2) + 1] = (self->afb.jcng.ssrc_feedbacks[i] >> 16) & 0xFF;
+ pdata[8 + (i<<2) + 2] = (self->afb.jcng.ssrc_feedbacks[i] >> 8) & 0xFF;
+ pdata[8 + (i<<2) + 3] = (self->afb.jcng.ssrc_feedbacks[i] & 0xFF);
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Not implemented yet");
+ return -1;
+ }
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("Not implemented yet");
+ return -1;
+ }
+ }
+
+ return ret;
}
tsk_size_t trtp_rtcp_report_psfb_get_size(const trtp_rtcp_report_psfb_t* self)
{
- if(!self || !TRTP_RTCP_PACKET(self)->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return TRTP_RTCP_PACKET(self)->header->length_in_bytes;
+ if(!self || !TRTP_RTCP_PACKET(self)->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return TRTP_RTCP_PACKET(self)->header->length_in_bytes;
} \ No newline at end of file
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_rr.c b/tinyRTP/src/rtcp/trtp_rtcp_report_rr.c
index 2a38a4c..0842921 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_rr.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_rr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,203 +30,202 @@
static tsk_object_t* trtp_rtcp_report_rr_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_rr_t *rr = self;
- if(rr){
- rr->packets = tsk_list_create();
- rr->blocks = tsk_list_create();
- }
- return self;
+ trtp_rtcp_report_rr_t *rr = self;
+ if(rr) {
+ rr->packets = tsk_list_create();
+ rr->blocks = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_rr_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_rr_t *rr = self;
- if(rr){
- // deinit self
- TSK_OBJECT_SAFE_FREE(rr->packets);
- TSK_OBJECT_SAFE_FREE(rr->blocks);
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(rr));
- }
-
- return self;
-}
-static const tsk_object_def_t trtp_rtcp_report_rr_def_s =
{
- sizeof(trtp_rtcp_report_rr_t),
- trtp_rtcp_report_rr_ctor,
- trtp_rtcp_report_rr_dtor,
- tsk_null,
+ trtp_rtcp_report_rr_t *rr = self;
+ if(rr) {
+ // deinit self
+ TSK_OBJECT_SAFE_FREE(rr->packets);
+ TSK_OBJECT_SAFE_FREE(rr->blocks);
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(rr));
+ }
+
+ return self;
+}
+static const tsk_object_def_t trtp_rtcp_report_rr_def_s = {
+ sizeof(trtp_rtcp_report_rr_t),
+ trtp_rtcp_report_rr_ctor,
+ trtp_rtcp_report_rr_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_rr_def_t = &trtp_rtcp_report_rr_def_s;
trtp_rtcp_report_rr_t* trtp_rtcp_report_rr_create_null()
{
- trtp_rtcp_report_rr_t* rr;
- if((rr = (trtp_rtcp_report_rr_t*)tsk_object_new(trtp_rtcp_report_rr_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(rr), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_rr, (TRTP_RTCP_HEADER_SIZE + 4));
- }
- return rr;
+ trtp_rtcp_report_rr_t* rr;
+ if((rr = (trtp_rtcp_report_rr_t*)tsk_object_new(trtp_rtcp_report_rr_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(rr), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_rr, (TRTP_RTCP_HEADER_SIZE + 4));
+ }
+ return rr;
}
trtp_rtcp_report_rr_t* trtp_rtcp_report_rr_create(trtp_rtcp_header_t* header)
{
- trtp_rtcp_report_rr_t* rr;
- if((rr = (trtp_rtcp_report_rr_t*)tsk_object_new(trtp_rtcp_report_rr_def_t))){
- TRTP_RTCP_PACKET(rr)->header = tsk_object_ref(header);
- }
- return rr;
+ trtp_rtcp_report_rr_t* rr;
+ if((rr = (trtp_rtcp_report_rr_t*)tsk_object_new(trtp_rtcp_report_rr_def_t))) {
+ TRTP_RTCP_PACKET(rr)->header = tsk_object_ref(header);
+ }
+ return rr;
}
trtp_rtcp_report_rr_t* trtp_rtcp_report_rr_create_2(uint32_t ssrc)
{
- trtp_rtcp_report_rr_t* rr;
- if((rr = trtp_rtcp_report_rr_create_null())){
- rr->ssrc = ssrc;
- }
- return rr;
+ trtp_rtcp_report_rr_t* rr;
+ if((rr = trtp_rtcp_report_rr_create_null())) {
+ rr->ssrc = ssrc;
+ }
+ return rr;
}
trtp_rtcp_report_rr_t* trtp_rtcp_report_rr_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_rr_t* rr = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- int32_t size = (int32_t)_size;
-
- if(!data || size < TRTP_RTCP_PACKET_RR_MIN_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!(header = trtp_rtcp_header_deserialize(pdata, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the header");
- goto bail;
- }
- if(header->length_in_bytes < TRTP_RTCP_PACKET_RR_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
-
- if(!(rr = trtp_rtcp_report_rr_create(header))){
- TSK_DEBUG_ERROR("Failed to create object");
- goto bail;
- }
-
- rr->ssrc = (uint32_t)tnet_ntohl_2(&pdata[4]);
-
- pdata += (TRTP_RTCP_HEADER_SIZE + 4);
- size -= (TRTP_RTCP_HEADER_SIZE + 4);
-
- // Blocks
- if(header->rc > 0){
- tsk_size_t i = 0;
- trtp_rtcp_rblock_t* rblock;
-
- while(i++ < header->rc && size >= TRTP_RTCP_RBLOCK_SIZE){
- if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))){
- tsk_list_push_back_data(rr->blocks, (void**)&rblock);
- }
- pdata += TRTP_RTCP_RBLOCK_SIZE;
- size -= TRTP_RTCP_RBLOCK_SIZE;
- }
- }
-
- // Other Packets
- while(size > TRTP_RTCP_HEADER_SIZE){
- trtp_rtcp_packet_t* packet;
-
- if((packet = trtp_rtcp_packet_deserialize(pdata, size))){
- if((size -= packet->header->length_in_bytes) > 0){
- pdata += packet->header->length_in_bytes;
- }
- tsk_list_push_back_data(rr->packets, (void**)&packet);
- continue;
- }
- break;
- }
+ trtp_rtcp_report_rr_t* rr = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ int32_t size = (int32_t)_size;
+
+ if(!data || size < TRTP_RTCP_PACKET_RR_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!(header = trtp_rtcp_header_deserialize(pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the header");
+ goto bail;
+ }
+ if(header->length_in_bytes < TRTP_RTCP_PACKET_RR_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+
+ if(!(rr = trtp_rtcp_report_rr_create(header))) {
+ TSK_DEBUG_ERROR("Failed to create object");
+ goto bail;
+ }
+
+ rr->ssrc = (uint32_t)tnet_ntohl_2(&pdata[4]);
+
+ pdata += (TRTP_RTCP_HEADER_SIZE + 4);
+ size -= (TRTP_RTCP_HEADER_SIZE + 4);
+
+ // Blocks
+ if(header->rc > 0) {
+ tsk_size_t i = 0;
+ trtp_rtcp_rblock_t* rblock;
+
+ while(i++ < header->rc && size >= TRTP_RTCP_RBLOCK_SIZE) {
+ if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))) {
+ tsk_list_push_back_data(rr->blocks, (void**)&rblock);
+ }
+ pdata += TRTP_RTCP_RBLOCK_SIZE;
+ size -= TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+
+ // Other Packets
+ while(size > TRTP_RTCP_HEADER_SIZE) {
+ trtp_rtcp_packet_t* packet;
+
+ if((packet = trtp_rtcp_packet_deserialize(pdata, size))) {
+ if((size -= packet->header->length_in_bytes) > 0) {
+ pdata += packet->header->length_in_bytes;
+ }
+ tsk_list_push_back_data(rr->packets, (void**)&packet);
+ continue;
+ }
+ break;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(header);
- return rr;
+ TSK_OBJECT_SAFE_FREE(header);
+ return rr;
}
int trtp_rtcp_report_rr_serialize_to(const trtp_rtcp_report_rr_t* self, void* data, tsk_size_t size)
{
- int ret;
- const tsk_list_item_t* item;
- uint8_t* pdata = (uint8_t*)data;
-
- if(!self || !data || size < trtp_rtcp_report_rr_get_size(self)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the header");
- return ret;
- }
-
- pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc & 0xFF);
-
- pdata += (TRTP_RTCP_HEADER_SIZE + 4);
- size -= (TRTP_RTCP_HEADER_SIZE + 4);
-
- if(TRTP_RTCP_PACKET(self)->header->rc > 0){
- tsk_list_foreach(item, self->blocks){
- if(!item->data){
- continue;
- }
- if((ret = trtp_rtcp_rblock_serialize_to(TRTP_RTCP_RBLOCK(item->data), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the rblock");
- goto bail;
- }
- pdata += TRTP_RTCP_RBLOCK_SIZE;
- size -= TRTP_RTCP_RBLOCK_SIZE;
- }
- }
-
- tsk_list_foreach(item, self->packets){
- if(!item->data){
- continue;
- }
- if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize packet");
- goto bail;
- }
- pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
+ int ret;
+ const tsk_list_item_t* item;
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(!self || !data || size < trtp_rtcp_report_rr_get_size(self)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the header");
+ return ret;
+ }
+
+ pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc & 0xFF);
+
+ pdata += (TRTP_RTCP_HEADER_SIZE + 4);
+ size -= (TRTP_RTCP_HEADER_SIZE + 4);
+
+ if(TRTP_RTCP_PACKET(self)->header->rc > 0) {
+ tsk_list_foreach(item, self->blocks) {
+ if(!item->data) {
+ continue;
+ }
+ if((ret = trtp_rtcp_rblock_serialize_to(TRTP_RTCP_RBLOCK(item->data), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the rblock");
+ goto bail;
+ }
+ pdata += TRTP_RTCP_RBLOCK_SIZE;
+ size -= TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+
+ tsk_list_foreach(item, self->packets) {
+ if(!item->data) {
+ continue;
+ }
+ if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize packet");
+ goto bail;
+ }
+ pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
bail:
- return ret;
+ return ret;
}
tsk_size_t trtp_rtcp_report_rr_get_size(const trtp_rtcp_report_rr_t* self)
{
- tsk_size_t size;
- const tsk_list_item_t* item;
-
- if(!self || !TRTP_RTCP_PACKET(self)->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
- if(TRTP_RTCP_PACKET(self)->header->rc > 0){
- tsk_list_foreach(item, self->blocks){
- if(item->data){
- size += TRTP_RTCP_RBLOCK_SIZE;
- }
- }
- }
- tsk_list_foreach(item, self->packets){
- if(item->data && TRTP_RTCP_PACKET(item->data)->header){
- size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
- }
-
- return size;
+ tsk_size_t size;
+ const tsk_list_item_t* item;
+
+ if(!self || !TRTP_RTCP_PACKET(self)->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
+ if(TRTP_RTCP_PACKET(self)->header->rc > 0) {
+ tsk_list_foreach(item, self->blocks) {
+ if(item->data) {
+ size += TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+ }
+ tsk_list_foreach(item, self->packets) {
+ if(item->data && TRTP_RTCP_PACKET(item->data)->header) {
+ size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
+ }
+
+ return size;
} \ No newline at end of file
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_sdes.c b/tinyRTP/src/rtcp/trtp_rtcp_report_sdes.c
index 4f5e944..8013509 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_sdes.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_sdes.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,7 +26,7 @@
/*
6.5 SDES: Source Description RTCP Packet
- 0 1 2
+ 0 1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
header |V=2|P| SC | PT=SDES=202 | length |
@@ -45,170 +45,169 @@ chunk | SSRC/CSRC_2 |
static tsk_object_t* trtp_rtcp_report_sdes_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_sdes_t *sdes = self;
- if(sdes){
- sdes->chuncks = tsk_list_create();
- }
- return self;
+ trtp_rtcp_report_sdes_t *sdes = self;
+ if(sdes) {
+ sdes->chuncks = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_sdes_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_sdes_t *sdes = self;
- if(sdes){
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(sdes));
- // deinit self
- TSK_OBJECT_SAFE_FREE(sdes->chuncks);
- }
-
- return self;
-}
-static const tsk_object_def_t trtp_rtcp_report_sdes_def_s =
{
- sizeof(trtp_rtcp_report_sdes_t),
- trtp_rtcp_report_sdes_ctor,
- trtp_rtcp_report_sdes_dtor,
- tsk_null,
+ trtp_rtcp_report_sdes_t *sdes = self;
+ if(sdes) {
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(sdes));
+ // deinit self
+ TSK_OBJECT_SAFE_FREE(sdes->chuncks);
+ }
+
+ return self;
+}
+static const tsk_object_def_t trtp_rtcp_report_sdes_def_s = {
+ sizeof(trtp_rtcp_report_sdes_t),
+ trtp_rtcp_report_sdes_ctor,
+ trtp_rtcp_report_sdes_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_sdes_def_t = &trtp_rtcp_report_sdes_def_s;
trtp_rtcp_report_sdes_t* trtp_rtcp_report_sdes_create_null()
{
- trtp_rtcp_report_sdes_t* sdes;
- if((sdes = (trtp_rtcp_report_sdes_t*)tsk_object_new(trtp_rtcp_report_sdes_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(sdes), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_sdes, TRTP_RTCP_HEADER_SIZE);
- }
- return sdes;
+ trtp_rtcp_report_sdes_t* sdes;
+ if((sdes = (trtp_rtcp_report_sdes_t*)tsk_object_new(trtp_rtcp_report_sdes_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(sdes), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_sdes, TRTP_RTCP_HEADER_SIZE);
+ }
+ return sdes;
}
trtp_rtcp_report_sdes_t* trtp_rtcp_report_sdes_create(trtp_rtcp_header_t* header)
{
- trtp_rtcp_report_sdes_t* sdes;
- if((sdes = (trtp_rtcp_report_sdes_t*)tsk_object_new(trtp_rtcp_report_sdes_def_t))){
- TRTP_RTCP_PACKET(sdes)->header = tsk_object_ref(header);
- }
- return sdes;
+ trtp_rtcp_report_sdes_t* sdes;
+ if((sdes = (trtp_rtcp_report_sdes_t*)tsk_object_new(trtp_rtcp_report_sdes_def_t))) {
+ TRTP_RTCP_PACKET(sdes)->header = tsk_object_ref(header);
+ }
+ return sdes;
}
trtp_rtcp_report_sdes_t* trtp_rtcp_report_sdes_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_sdes_t* sdes = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- int32_t size = (int32_t)_size;
-
- if(!data || size < TRTP_RTCP_HEADER_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!(header = trtp_rtcp_header_deserialize(pdata, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the header");
- goto bail;
- }
- if(header->length_in_bytes < (TRTP_RTCP_HEADER_SIZE + 4)){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
-
- if(!(sdes = trtp_rtcp_report_sdes_create(header))){
- TSK_DEBUG_ERROR("Failed to create object");
- goto bail;
- }
-
- pdata += TRTP_RTCP_HEADER_SIZE;
- size -= TRTP_RTCP_HEADER_SIZE;
-
- // Chuncks
- if(header->rc > 0){
- tsk_size_t i = 0, chunck_size;
- trtp_rtcp_sdes_chunck_t* chunck;
- while(i++ < header->rc && size > TRTP_RTCP_SDES_CHUNCK_MIN_SIZE){
- if((chunck = trtp_rtcp_sdes_chunck_deserialize(pdata, size))){
- chunck_size = trtp_rtcp_sdes_chunck_get_size(chunck);
- if((size -= (int32_t)chunck_size)){
- pdata += chunck_size;
- }
- tsk_list_push_ascending_data(sdes->chuncks, (void**)&chunck);
- continue;
- }
- break;
- }
- }
+ trtp_rtcp_report_sdes_t* sdes = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ int32_t size = (int32_t)_size;
+
+ if(!data || size < TRTP_RTCP_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!(header = trtp_rtcp_header_deserialize(pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the header");
+ goto bail;
+ }
+ if(header->length_in_bytes < (TRTP_RTCP_HEADER_SIZE + 4)) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+
+ if(!(sdes = trtp_rtcp_report_sdes_create(header))) {
+ TSK_DEBUG_ERROR("Failed to create object");
+ goto bail;
+ }
+
+ pdata += TRTP_RTCP_HEADER_SIZE;
+ size -= TRTP_RTCP_HEADER_SIZE;
+
+ // Chuncks
+ if(header->rc > 0) {
+ tsk_size_t i = 0, chunck_size;
+ trtp_rtcp_sdes_chunck_t* chunck;
+ while(i++ < header->rc && size > TRTP_RTCP_SDES_CHUNCK_MIN_SIZE) {
+ if((chunck = trtp_rtcp_sdes_chunck_deserialize(pdata, size))) {
+ chunck_size = trtp_rtcp_sdes_chunck_get_size(chunck);
+ if((size -= (int32_t)chunck_size)) {
+ pdata += chunck_size;
+ }
+ tsk_list_push_ascending_data(sdes->chuncks, (void**)&chunck);
+ continue;
+ }
+ break;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(header);
- return sdes;
+ TSK_OBJECT_SAFE_FREE(header);
+ return sdes;
}
int trtp_rtcp_report_sdes_serialize_to(const trtp_rtcp_report_sdes_t* self, void* data, tsk_size_t size)
{
- int ret;
- uint8_t* pdata = (uint8_t*)data;
- if(!self || !data || size < trtp_rtcp_report_sdes_get_size(self)){
- return -1;
- }
-
- if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the header");
- return ret;
- }
-
- pdata += (TRTP_RTCP_HEADER_SIZE);
- size -= (TRTP_RTCP_HEADER_SIZE);
-
- if(TRTP_RTCP_PACKET(self)->header->rc > 0){
- const tsk_list_item_t* item;
- tsk_size_t chunck_size;
- const trtp_rtcp_sdes_chunck_t* chunck;
- tsk_list_foreach(item, self->chuncks){
- if(!(chunck = item->data)){
- continue;
- }
- if((ret = trtp_rtcp_sdes_chunck_serialize_to(chunck, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize SDES chunck");
- goto bail;
- }
- chunck_size = trtp_rtcp_sdes_chunck_get_size(chunck);
- pdata += chunck_size;
- size -= chunck_size;
- }
- }
+ int ret;
+ uint8_t* pdata = (uint8_t*)data;
+ if(!self || !data || size < trtp_rtcp_report_sdes_get_size(self)) {
+ return -1;
+ }
+
+ if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the header");
+ return ret;
+ }
+
+ pdata += (TRTP_RTCP_HEADER_SIZE);
+ size -= (TRTP_RTCP_HEADER_SIZE);
+
+ if(TRTP_RTCP_PACKET(self)->header->rc > 0) {
+ const tsk_list_item_t* item;
+ tsk_size_t chunck_size;
+ const trtp_rtcp_sdes_chunck_t* chunck;
+ tsk_list_foreach(item, self->chuncks) {
+ if(!(chunck = item->data)) {
+ continue;
+ }
+ if((ret = trtp_rtcp_sdes_chunck_serialize_to(chunck, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize SDES chunck");
+ goto bail;
+ }
+ chunck_size = trtp_rtcp_sdes_chunck_get_size(chunck);
+ pdata += chunck_size;
+ size -= chunck_size;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int trtp_rtcp_report_sdes_add_chunck(trtp_rtcp_report_sdes_t* self, trtp_rtcp_sdes_chunck_t* chunck)
{
- if(!self || !self->chuncks || !chunck){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- chunck = tsk_object_ref(chunck);
- TRTP_RTCP_PACKET(self)->header->length_in_bytes += (uint32_t)trtp_rtcp_sdes_chunck_get_size(chunck);
- TRTP_RTCP_PACKET(self)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(self)->header->length_in_bytes >> 2) - 1)
- + ((TRTP_RTCP_PACKET(self)->header->length_in_bytes & 0x03) ? 1 : 0);
- ++TRTP_RTCP_PACKET(self)->header->rc;
- tsk_list_push_back_data(self->chuncks, (void**)&chunck);
- return 0;
+ if(!self || !self->chuncks || !chunck) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ chunck = tsk_object_ref(chunck);
+ TRTP_RTCP_PACKET(self)->header->length_in_bytes += (uint32_t)trtp_rtcp_sdes_chunck_get_size(chunck);
+ TRTP_RTCP_PACKET(self)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(self)->header->length_in_bytes >> 2) - 1)
+ + ((TRTP_RTCP_PACKET(self)->header->length_in_bytes & 0x03) ? 1 : 0);
+ ++TRTP_RTCP_PACKET(self)->header->rc;
+ tsk_list_push_back_data(self->chuncks, (void**)&chunck);
+ return 0;
}
tsk_size_t trtp_rtcp_report_sdes_get_size(const trtp_rtcp_report_sdes_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- else{
- tsk_size_t size = TRTP_RTCP_HEADER_SIZE;
- const tsk_list_item_t* item;
- tsk_list_foreach(item, self->chuncks){
- size += trtp_rtcp_sdes_chunck_get_size(TRTP_RTCP_SDES_CHUNCK(item->data));
- }
- return size;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ else {
+ tsk_size_t size = TRTP_RTCP_HEADER_SIZE;
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, self->chuncks) {
+ size += trtp_rtcp_sdes_chunck_get_size(TRTP_RTCP_SDES_CHUNCK(item->data));
+ }
+ return size;
+ }
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_sr.c b/tinyRTP/src/rtcp/trtp_rtcp_report_sr.c
index 5d8ceda..e807f17 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_sr.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_sr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,241 +30,240 @@
static tsk_object_t* trtp_rtcp_report_sr_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_report_sr_t *sr = self;
- if(sr){
- sr->blocks = tsk_list_create();
- sr->packets = tsk_list_create();
- }
- return self;
+ trtp_rtcp_report_sr_t *sr = self;
+ if(sr) {
+ sr->blocks = tsk_list_create();
+ sr->packets = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_report_sr_dtor(tsk_object_t * self)
-{
- trtp_rtcp_report_sr_t *sr = self;
- if(sr){
- // deinit self
- TSK_OBJECT_SAFE_FREE(sr->blocks);
- TSK_OBJECT_SAFE_FREE(sr->packets);
- // deinit base
- trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(sr));
- }
-
- return self;
+{
+ trtp_rtcp_report_sr_t *sr = self;
+ if(sr) {
+ // deinit self
+ TSK_OBJECT_SAFE_FREE(sr->blocks);
+ TSK_OBJECT_SAFE_FREE(sr->packets);
+ // deinit base
+ trtp_rtcp_packet_deinit(TRTP_RTCP_PACKET(sr));
+ }
+
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_report_sr_def_s =
-{
- sizeof(trtp_rtcp_report_sr_t),
- trtp_rtcp_report_sr_ctor,
- trtp_rtcp_report_sr_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_report_sr_def_s = {
+ sizeof(trtp_rtcp_report_sr_t),
+ trtp_rtcp_report_sr_ctor,
+ trtp_rtcp_report_sr_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_report_sr_def_t = &trtp_rtcp_report_sr_def_s;
trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_create_null()
{
- trtp_rtcp_report_sr_t* sr;
- if((sr = (trtp_rtcp_report_sr_t*)tsk_object_new(trtp_rtcp_report_sr_def_t))){
- trtp_rtcp_packet_init(TRTP_RTCP_PACKET(sr), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_sr, (TRTP_RTCP_HEADER_SIZE + 4 + 20));
- }
- return sr;
+ trtp_rtcp_report_sr_t* sr;
+ if((sr = (trtp_rtcp_report_sr_t*)tsk_object_new(trtp_rtcp_report_sr_def_t))) {
+ trtp_rtcp_packet_init(TRTP_RTCP_PACKET(sr), TRTP_RTCP_HEADER_VERSION_DEFAULT, 0, 0, trtp_rtcp_packet_type_sr, (TRTP_RTCP_HEADER_SIZE + 4 + 20));
+ }
+ return sr;
}
trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_create(struct trtp_rtcp_header_s* header)
{
- trtp_rtcp_report_sr_t* sr;
- if((sr = (trtp_rtcp_report_sr_t*)tsk_object_new(trtp_rtcp_report_sr_def_t))){
- TRTP_RTCP_PACKET(sr)->header = tsk_object_ref(header);
- }
- return sr;
+ trtp_rtcp_report_sr_t* sr;
+ if((sr = (trtp_rtcp_report_sr_t*)tsk_object_new(trtp_rtcp_report_sr_def_t))) {
+ TRTP_RTCP_PACKET(sr)->header = tsk_object_ref(header);
+ }
+ return sr;
}
trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_deserialize(const void* data, tsk_size_t _size)
{
- trtp_rtcp_report_sr_t* sr = tsk_null;
- trtp_rtcp_header_t* header = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- int32_t size = (int32_t)_size;
-
- if(!data || size < TRTP_RTCP_PACKET_SR_MIN_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!(header = trtp_rtcp_header_deserialize(pdata, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the header");
- goto bail;
- }
- if(header->length_in_bytes < TRTP_RTCP_PACKET_SR_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short");
- goto bail;
- }
-
- if(!(sr = trtp_rtcp_report_sr_create(header))){
- TSK_DEBUG_ERROR("Failed to create object");
- goto bail;
- }
-
- sr->ssrc = (uint32_t)tnet_ntohl_2(&pdata[4]);
- pdata += (TRTP_RTCP_HEADER_SIZE + 4);
- size -= (TRTP_RTCP_HEADER_SIZE + 4);
-
- // sender info
- sr->sender_info.ntp_msw = (uint32_t)tnet_ntohl_2(&pdata[0]);
- sr->sender_info.ntp_lsw = (uint32_t)tnet_ntohl_2(&pdata[4]);
- sr->sender_info.rtp_timestamp = (uint32_t)tnet_ntohl_2(&pdata[8]);
- sr->sender_info.sender_pcount = (uint32_t)tnet_ntohl_2(&pdata[12]);
- sr->sender_info.sender_ocount = (uint32_t)tnet_ntohl_2(&pdata[16]);
- pdata += 20;
- size -= 20;
-
- // Blocks
- if(header->rc > 0){
- tsk_size_t i = 0;
- trtp_rtcp_rblock_t* rblock;
-
- while(i++ < header->rc && size >= TRTP_RTCP_RBLOCK_SIZE){
- if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))){
- tsk_list_push_back_data(sr->blocks, (void**)&rblock);
- }
- pdata += TRTP_RTCP_RBLOCK_SIZE;
- size -= TRTP_RTCP_RBLOCK_SIZE;
- }
- }
-
- // Other Packets
- while(size > TRTP_RTCP_HEADER_SIZE){
- trtp_rtcp_packet_t* packet;
-
- if((packet = trtp_rtcp_packet_deserialize(pdata, size))){
- if((size -= packet->header->length_in_bytes) > 0){
- pdata += packet->header->length_in_bytes;
- }
- tsk_list_push_back_data(sr->packets, (void**)&packet);
- continue;
- }
- break;
- }
+ trtp_rtcp_report_sr_t* sr = tsk_null;
+ trtp_rtcp_header_t* header = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ int32_t size = (int32_t)_size;
+
+ if(!data || size < TRTP_RTCP_PACKET_SR_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!(header = trtp_rtcp_header_deserialize(pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the header");
+ goto bail;
+ }
+ if(header->length_in_bytes < TRTP_RTCP_PACKET_SR_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short");
+ goto bail;
+ }
+
+ if(!(sr = trtp_rtcp_report_sr_create(header))) {
+ TSK_DEBUG_ERROR("Failed to create object");
+ goto bail;
+ }
+
+ sr->ssrc = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ pdata += (TRTP_RTCP_HEADER_SIZE + 4);
+ size -= (TRTP_RTCP_HEADER_SIZE + 4);
+
+ // sender info
+ sr->sender_info.ntp_msw = (uint32_t)tnet_ntohl_2(&pdata[0]);
+ sr->sender_info.ntp_lsw = (uint32_t)tnet_ntohl_2(&pdata[4]);
+ sr->sender_info.rtp_timestamp = (uint32_t)tnet_ntohl_2(&pdata[8]);
+ sr->sender_info.sender_pcount = (uint32_t)tnet_ntohl_2(&pdata[12]);
+ sr->sender_info.sender_ocount = (uint32_t)tnet_ntohl_2(&pdata[16]);
+ pdata += 20;
+ size -= 20;
+
+ // Blocks
+ if(header->rc > 0) {
+ tsk_size_t i = 0;
+ trtp_rtcp_rblock_t* rblock;
+
+ while(i++ < header->rc && size >= TRTP_RTCP_RBLOCK_SIZE) {
+ if((rblock = trtp_rtcp_rblock_deserialize(pdata, size))) {
+ tsk_list_push_back_data(sr->blocks, (void**)&rblock);
+ }
+ pdata += TRTP_RTCP_RBLOCK_SIZE;
+ size -= TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+
+ // Other Packets
+ while(size > TRTP_RTCP_HEADER_SIZE) {
+ trtp_rtcp_packet_t* packet;
+
+ if((packet = trtp_rtcp_packet_deserialize(pdata, size))) {
+ if((size -= packet->header->length_in_bytes) > 0) {
+ pdata += packet->header->length_in_bytes;
+ }
+ tsk_list_push_back_data(sr->packets, (void**)&packet);
+ continue;
+ }
+ break;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(header);
- return sr;
+ TSK_OBJECT_SAFE_FREE(header);
+ return sr;
}
int trtp_rtcp_report_sr_serialize_to(const trtp_rtcp_report_sr_t* self, void* data, tsk_size_t size)
{
- int ret;
- const tsk_list_item_t* item;
- uint8_t* pdata = (uint8_t*)data;
-
- if(!self || !data || size < trtp_rtcp_report_sr_get_size(self)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the header");
- return ret;
- }
-
- pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc & 0xFF);
- pdata[TRTP_RTCP_HEADER_SIZE + 4] = self->sender_info.ntp_msw >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 5] = (self->sender_info.ntp_msw >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 6] = (self->sender_info.ntp_msw >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 7] = self->sender_info.ntp_msw & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 8] = self->sender_info.ntp_lsw >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 9] = (self->sender_info.ntp_lsw >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 10] = (self->sender_info.ntp_lsw >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 11] = self->sender_info.ntp_lsw & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 12] = self->sender_info.rtp_timestamp >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 13] = (self->sender_info.rtp_timestamp >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 14] = (self->sender_info.rtp_timestamp >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 15] = self->sender_info.rtp_timestamp & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 16] = self->sender_info.sender_pcount >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 17] = (self->sender_info.sender_pcount >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 18] = (self->sender_info.sender_pcount >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 19] = self->sender_info.sender_pcount & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 20] = self->sender_info.sender_ocount >> 24;
- pdata[TRTP_RTCP_HEADER_SIZE + 21] = (self->sender_info.sender_ocount >> 16) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 22] = (self->sender_info.sender_ocount >> 8) & 0xFF;
- pdata[TRTP_RTCP_HEADER_SIZE + 23] = self->sender_info.sender_ocount & 0xFF;
-
- pdata += (TRTP_RTCP_HEADER_SIZE + 4 + 20);
- size -= (TRTP_RTCP_HEADER_SIZE + 4 + 20);
-
- if(TRTP_RTCP_PACKET(self)->header->rc > 0){
- tsk_list_foreach(item, self->blocks){
- if(!item->data){
- continue;
- }
- if((ret = trtp_rtcp_rblock_serialize_to(TRTP_RTCP_RBLOCK(item->data), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize the rblock");
- goto bail;
- }
- pdata += TRTP_RTCP_RBLOCK_SIZE;
- size -= TRTP_RTCP_RBLOCK_SIZE;
- }
- }
-
- tsk_list_foreach(item, self->packets){
- if(!item->data){
- continue;
- }
- if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))){
- TSK_DEBUG_ERROR("Failed to serialize packet");
- goto bail;
- }
- pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
+ int ret;
+ const tsk_list_item_t* item;
+ uint8_t* pdata = (uint8_t*)data;
+
+ if(!self || !data || size < trtp_rtcp_report_sr_get_size(self)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((ret = trtp_rtcp_header_serialize_to(TRTP_RTCP_PACKET(self)->header, pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the header");
+ return ret;
+ }
+
+ pdata[TRTP_RTCP_HEADER_SIZE] = self->ssrc >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 1] = (self->ssrc >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 2] = (self->ssrc >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 3] = (self->ssrc & 0xFF);
+ pdata[TRTP_RTCP_HEADER_SIZE + 4] = self->sender_info.ntp_msw >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 5] = (self->sender_info.ntp_msw >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 6] = (self->sender_info.ntp_msw >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 7] = self->sender_info.ntp_msw & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 8] = self->sender_info.ntp_lsw >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 9] = (self->sender_info.ntp_lsw >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 10] = (self->sender_info.ntp_lsw >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 11] = self->sender_info.ntp_lsw & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 12] = self->sender_info.rtp_timestamp >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 13] = (self->sender_info.rtp_timestamp >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 14] = (self->sender_info.rtp_timestamp >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 15] = self->sender_info.rtp_timestamp & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 16] = self->sender_info.sender_pcount >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 17] = (self->sender_info.sender_pcount >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 18] = (self->sender_info.sender_pcount >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 19] = self->sender_info.sender_pcount & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 20] = self->sender_info.sender_ocount >> 24;
+ pdata[TRTP_RTCP_HEADER_SIZE + 21] = (self->sender_info.sender_ocount >> 16) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 22] = (self->sender_info.sender_ocount >> 8) & 0xFF;
+ pdata[TRTP_RTCP_HEADER_SIZE + 23] = self->sender_info.sender_ocount & 0xFF;
+
+ pdata += (TRTP_RTCP_HEADER_SIZE + 4 + 20);
+ size -= (TRTP_RTCP_HEADER_SIZE + 4 + 20);
+
+ if(TRTP_RTCP_PACKET(self)->header->rc > 0) {
+ tsk_list_foreach(item, self->blocks) {
+ if(!item->data) {
+ continue;
+ }
+ if((ret = trtp_rtcp_rblock_serialize_to(TRTP_RTCP_RBLOCK(item->data), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize the rblock");
+ goto bail;
+ }
+ pdata += TRTP_RTCP_RBLOCK_SIZE;
+ size -= TRTP_RTCP_RBLOCK_SIZE;
+ }
+ }
+
+ tsk_list_foreach(item, self->packets) {
+ if(!item->data) {
+ continue;
+ }
+ if((ret = trtp_rtcp_packet_serialize_to(TRTP_RTCP_PACKET(item->data), pdata, size))) {
+ TSK_DEBUG_ERROR("Failed to serialize packet");
+ goto bail;
+ }
+ pdata += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ size -= TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
bail:
- return ret;
+ return ret;
}
int trtp_rtcp_report_sr_add_block(trtp_rtcp_report_sr_t* self, trtp_rtcp_rblock_t* rblock)
{
- if(!self || !TRTP_RTCP_PACKET(self)->header || !rblock){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- rblock = tsk_object_ref(rblock);
- tsk_list_push_back_data(self->blocks, (void**)&rblock);
- ++TRTP_RTCP_PACKET(self)->header->rc;
- TRTP_RTCP_PACKET(self)->header->length_in_bytes += TRTP_RTCP_RBLOCK_SIZE;
- TRTP_RTCP_PACKET(self)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(self)->header->length_in_bytes >> 2) - 1) +
- ((TRTP_RTCP_PACKET(self)->header->length_in_bytes & 0x03) ? 1 : 0);
- return 0;
+ if(!self || !TRTP_RTCP_PACKET(self)->header || !rblock) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ rblock = tsk_object_ref(rblock);
+ tsk_list_push_back_data(self->blocks, (void**)&rblock);
+ ++TRTP_RTCP_PACKET(self)->header->rc;
+ TRTP_RTCP_PACKET(self)->header->length_in_bytes += TRTP_RTCP_RBLOCK_SIZE;
+ TRTP_RTCP_PACKET(self)->header->length_in_words_minus1 = ((TRTP_RTCP_PACKET(self)->header->length_in_bytes >> 2) - 1) +
+ ((TRTP_RTCP_PACKET(self)->header->length_in_bytes & 0x03) ? 1 : 0);
+ return 0;
}
tsk_size_t trtp_rtcp_report_sr_get_size(const trtp_rtcp_report_sr_t* self)
{
- tsk_size_t size;
- const tsk_list_item_t* item;
-
- if(!self || !TRTP_RTCP_PACKET(self)->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
- //if(TRTP_RTCP_PACKET(self)->header->rc > 0){
- // tsk_list_foreach(item, self->blocks){
- // if(item->data){
- // size += TRTP_RTCP_RBLOCK_SIZE;
- // }
- // }
- //}
- tsk_list_foreach(item, self->packets){
- if(item->data && TRTP_RTCP_PACKET(item->data)->header){
- size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
- }
- }
-
- return size;
+ tsk_size_t size;
+ const tsk_list_item_t* item;
+
+ if(!self || !TRTP_RTCP_PACKET(self)->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ size = TRTP_RTCP_PACKET(self)->header->length_in_bytes;
+ //if(TRTP_RTCP_PACKET(self)->header->rc > 0){
+ // tsk_list_foreach(item, self->blocks){
+ // if(item->data){
+ // size += TRTP_RTCP_RBLOCK_SIZE;
+ // }
+ // }
+ //}
+ tsk_list_foreach(item, self->packets) {
+ if(item->data && TRTP_RTCP_PACKET(item->data)->header) {
+ size += TRTP_RTCP_PACKET(item->data)->header->length_in_bytes;
+ }
+ }
+
+ return size;
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_report_xr.c b/tinyRTP/src/rtcp/trtp_rtcp_report_xr.c
index 5fb2697..41e177b 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_report_xr.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_report_xr.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_sdes_chunck.c b/tinyRTP/src/rtcp/trtp_rtcp_sdes_chunck.c
index 9104580..f8bed63 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_sdes_chunck.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_sdes_chunck.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,27 +44,26 @@ Each chunk consists of an SSRC/CSRC identifier followed by a list of
static tsk_object_t* trtp_rtcp_sdes_chunck_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_sdes_chunck_t *chunck = self;
- if(chunck){
- chunck->items = tsk_list_create();
- }
- return self;
+ trtp_rtcp_sdes_chunck_t *chunck = self;
+ if(chunck) {
+ chunck->items = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_sdes_chunck_dtor(tsk_object_t * self)
-{
- trtp_rtcp_sdes_chunck_t *chunck = self;
- if(chunck){
- TSK_OBJECT_SAFE_FREE(chunck->items);
- }
+{
+ trtp_rtcp_sdes_chunck_t *chunck = self;
+ if(chunck) {
+ TSK_OBJECT_SAFE_FREE(chunck->items);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_sdes_chunck_def_s =
-{
- sizeof(trtp_rtcp_sdes_chunck_t),
- trtp_rtcp_sdes_chunck_ctor,
- trtp_rtcp_sdes_chunck_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_sdes_chunck_def_s = {
+ sizeof(trtp_rtcp_sdes_chunck_t),
+ trtp_rtcp_sdes_chunck_ctor,
+ trtp_rtcp_sdes_chunck_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_sdes_chunck_def_t = &trtp_rtcp_sdes_chunck_def_s;
@@ -72,119 +71,120 @@ const tsk_object_def_t *trtp_rtcp_sdes_chunck_def_t = &trtp_rtcp_sdes_chunck_def
trtp_rtcp_sdes_chunck_t* trtp_rtcp_sdes_chunck_create_null()
{
- return tsk_object_new(trtp_rtcp_sdes_chunck_def_t);
+ return tsk_object_new(trtp_rtcp_sdes_chunck_def_t);
}
trtp_rtcp_sdes_chunck_t* trtp_rtcp_sdes_chunck_create(uint32_t ssrc)
{
- trtp_rtcp_sdes_chunck_t* chunck;
- if((chunck = trtp_rtcp_sdes_chunck_create_null())){
- chunck->ssrc = ssrc;
- }
- return chunck;
+ trtp_rtcp_sdes_chunck_t* chunck;
+ if((chunck = trtp_rtcp_sdes_chunck_create_null())) {
+ chunck->ssrc = ssrc;
+ }
+ return chunck;
}
trtp_rtcp_sdes_chunck_t* trtp_rtcp_sdes_chunck_deserialize(const void* data, tsk_size_t size)
{
- trtp_rtcp_sdes_chunck_t* chunck = tsk_null;
- const uint8_t* pdata = (uint8_t*)data;
- const uint8_t* pend;
- if(!data || size < TRTP_RTCP_SDES_CHUNCK_MIN_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- pend = (pdata + size);
- if((chunck = trtp_rtcp_sdes_chunck_create_null())){
- trtp_rtcp_sdes_item_t* item;
- tsk_bool_t is_last_item = tsk_false;
- // SSRC/CSRC
- chunck->ssrc = (uint32_t)tnet_ntohl_2(pdata);
- pdata += TRTP_RTCP_SDES_CHUNCK_SSRC_OR_CSRC_SIZE;
- while((pdata < pend) && !is_last_item){
- if((item = trtp_rtcp_sdes_item_deserialize(pdata, (pend-pdata)))){
- is_last_item = (item->type == trtp_rtcp_sdes_item_type_end);
- pdata += trtp_rtcp_sdes_item_get_size(item);
- tsk_list_push_back_data(chunck->items, (void**)&item);
- }
- else{
- TSK_DEBUG_ERROR("Failed to deserialize sdes item");
- break;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new sdes_chunck object");
- return tsk_null;
- }
-
- return chunck;
+ trtp_rtcp_sdes_chunck_t* chunck = tsk_null;
+ const uint8_t* pdata = (uint8_t*)data;
+ const uint8_t* pend;
+ if(!data || size < TRTP_RTCP_SDES_CHUNCK_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ pend = (pdata + size);
+ if((chunck = trtp_rtcp_sdes_chunck_create_null())) {
+ trtp_rtcp_sdes_item_t* item;
+ tsk_bool_t is_last_item = tsk_false;
+ // SSRC/CSRC
+ chunck->ssrc = (uint32_t)tnet_ntohl_2(pdata);
+ pdata += TRTP_RTCP_SDES_CHUNCK_SSRC_OR_CSRC_SIZE;
+ while((pdata < pend) && !is_last_item) {
+ if((item = trtp_rtcp_sdes_item_deserialize(pdata, (pend-pdata)))) {
+ is_last_item = (item->type == trtp_rtcp_sdes_item_type_end);
+ pdata += trtp_rtcp_sdes_item_get_size(item);
+ tsk_list_push_back_data(chunck->items, (void**)&item);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to deserialize sdes item");
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new sdes_chunck object");
+ return tsk_null;
+ }
+
+ return chunck;
}
int trtp_rtcp_sdes_chunck_serialize_to(const trtp_rtcp_sdes_chunck_t* self, void* data, tsk_size_t size)
{
- uint8_t* pdata = (uint8_t*)data;
- const tsk_list_item_t* item;
- const trtp_rtcp_sdes_item_t* sdes_item;
- tsk_size_t sdes_item_size;
- int ret = 0;
-
- if(!self || !data || size < trtp_rtcp_sdes_chunck_get_size(self)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- pdata[0] = self->ssrc >> 24;
- pdata[1] = (self->ssrc >> 16) & 0xFF;
- pdata[2] = (self->ssrc >> 8) & 0xFF;
- pdata[3] = (self->ssrc & 0xFF);
- pdata += 4;
-
- tsk_list_foreach(item, self->items){
- if(!(sdes_item = TRTP_RTCP_SDES_ITEM(item->data))){
- continue;
- }
- if((ret = trtp_rtcp_sdes_item_serialize_to(sdes_item, pdata, size))){
- TSK_DEBUG_ERROR("SDES item serialization failed");
- goto bail;
- }
- sdes_item_size = trtp_rtcp_sdes_item_get_size(sdes_item);
- pdata += sdes_item_size; size -= sdes_item_size;
- }
+ uint8_t* pdata = (uint8_t*)data;
+ const tsk_list_item_t* item;
+ const trtp_rtcp_sdes_item_t* sdes_item;
+ tsk_size_t sdes_item_size;
+ int ret = 0;
+
+ if(!self || !data || size < trtp_rtcp_sdes_chunck_get_size(self)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ pdata[0] = self->ssrc >> 24;
+ pdata[1] = (self->ssrc >> 16) & 0xFF;
+ pdata[2] = (self->ssrc >> 8) & 0xFF;
+ pdata[3] = (self->ssrc & 0xFF);
+ pdata += 4;
+
+ tsk_list_foreach(item, self->items) {
+ if(!(sdes_item = TRTP_RTCP_SDES_ITEM(item->data))) {
+ continue;
+ }
+ if((ret = trtp_rtcp_sdes_item_serialize_to(sdes_item, pdata, size))) {
+ TSK_DEBUG_ERROR("SDES item serialization failed");
+ goto bail;
+ }
+ sdes_item_size = trtp_rtcp_sdes_item_get_size(sdes_item);
+ pdata += sdes_item_size;
+ size -= sdes_item_size;
+ }
bail:
- return ret;
+ return ret;
}
int trtp_rtcp_sdes_chunck_add_item(trtp_rtcp_sdes_chunck_t* self, trtp_rtcp_sdes_item_type_t type, const void* data, uint8_t length)
{
- trtp_rtcp_sdes_item_t *item;
- if(!self || !self->items){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((item = trtp_rtcp_sdes_item_create(type, data, length))){
- tsk_list_push_back_data(self->items, (void**)&item);
- }
- return 0;
+ trtp_rtcp_sdes_item_t *item;
+ if(!self || !self->items) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((item = trtp_rtcp_sdes_item_create(type, data, length))) {
+ tsk_list_push_back_data(self->items, (void**)&item);
+ }
+ return 0;
}
tsk_size_t trtp_rtcp_sdes_chunck_get_size(const trtp_rtcp_sdes_chunck_t* self)
{
- const tsk_list_item_t* item;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- else{
- tsk_size_t size = TRTP_RTCP_SDES_CHUNCK_SSRC_OR_CSRC_SIZE;
- tsk_list_foreach(item, self->items){
- size += trtp_rtcp_sdes_item_get_size(TRTP_RTCP_SDES_ITEM(item->data));
- }
- if(size & 0x03){//Each chunk starts on a 32-bit boundary
- size += (4 - (size & 0x03));
- }
- return size;
- }
+ const tsk_list_item_t* item;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ else {
+ tsk_size_t size = TRTP_RTCP_SDES_CHUNCK_SSRC_OR_CSRC_SIZE;
+ tsk_list_foreach(item, self->items) {
+ size += trtp_rtcp_sdes_item_get_size(TRTP_RTCP_SDES_ITEM(item->data));
+ }
+ if(size & 0x03) { //Each chunk starts on a 32-bit boundary
+ size += (4 - (size & 0x03));
+ }
+ return size;
+ }
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_sdes_item.c b/tinyRTP/src/rtcp/trtp_rtcp_sdes_item.c
index 7f22537..6d70a46 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_sdes_item.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_sdes_item.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,117 +32,118 @@
static tsk_object_t* trtp_rtcp_sdes_item_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_sdes_item_t *item = self;
- if(item){
- }
- return self;
+ trtp_rtcp_sdes_item_t *item = self;
+ if(item) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_sdes_item_dtor(tsk_object_t * self)
-{
- trtp_rtcp_sdes_item_t *item = self;
- if(item){
- TSK_OBJECT_SAFE_FREE(item->data);
- }
+{
+ trtp_rtcp_sdes_item_t *item = self;
+ if(item) {
+ TSK_OBJECT_SAFE_FREE(item->data);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_sdes_item_def_s =
-{
- sizeof(trtp_rtcp_sdes_item_t),
- trtp_rtcp_sdes_item_ctor,
- trtp_rtcp_sdes_item_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_sdes_item_def_s = {
+ sizeof(trtp_rtcp_sdes_item_t),
+ trtp_rtcp_sdes_item_ctor,
+ trtp_rtcp_sdes_item_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_sdes_item_def_t = &trtp_rtcp_sdes_item_def_s;
trtp_rtcp_sdes_item_t* _trtp_rtcp_sdes_item_create_null(trtp_rtcp_sdes_item_type_t type)
{
- return tsk_object_new(trtp_rtcp_sdes_item_def_t);
+ return tsk_object_new(trtp_rtcp_sdes_item_def_t);
}
trtp_rtcp_sdes_item_t* trtp_rtcp_sdes_item_create(trtp_rtcp_sdes_item_type_t type, const void* data, uint8_t length)
{
- trtp_rtcp_sdes_item_t* item;
- if(!(item = _trtp_rtcp_sdes_item_create_null(type))){
- TSK_DEBUG_ERROR("Failed to create new SDES item");
- return tsk_null;
- }
- item->type = type;
- if(data && length){
- item->data = tsk_buffer_create(data, length);
- }
-
- return item;
+ trtp_rtcp_sdes_item_t* item;
+ if(!(item = _trtp_rtcp_sdes_item_create_null(type))) {
+ TSK_DEBUG_ERROR("Failed to create new SDES item");
+ return tsk_null;
+ }
+ item->type = type;
+ if(data && length) {
+ item->data = tsk_buffer_create(data, length);
+ }
+
+ return item;
}
trtp_rtcp_sdes_item_t* trtp_rtcp_sdes_item_deserialize(const void* data, tsk_size_t size)
{
- const uint8_t* pdata = (const uint8_t*)data;
-
- if(!data || !size){
- TSK_DEBUG_ERROR("Invlaid parameter");
- return tsk_null;
- }
-
- if(pdata[0] == trtp_rtcp_sdes_item_type_end){
- return trtp_rtcp_sdes_item_create(trtp_rtcp_sdes_item_type_end, tsk_null, 0);
- }
-
- if(size < TRTP_RTCP_SDES_ITEM_MIN_SIZE || size < (tsk_size_t)(pdata[1] + 2)){
- TSK_DEBUG_ERROR("Too short");
- return tsk_null;
- }
-
- return trtp_rtcp_sdes_item_create((trtp_rtcp_sdes_item_type_t)pdata[0], &pdata[2], pdata[1]);
+ const uint8_t* pdata = (const uint8_t*)data;
+
+ if(!data || !size) {
+ TSK_DEBUG_ERROR("Invlaid parameter");
+ return tsk_null;
+ }
+
+ if(pdata[0] == trtp_rtcp_sdes_item_type_end) {
+ return trtp_rtcp_sdes_item_create(trtp_rtcp_sdes_item_type_end, tsk_null, 0);
+ }
+
+ if(size < TRTP_RTCP_SDES_ITEM_MIN_SIZE || size < (tsk_size_t)(pdata[1] + 2)) {
+ TSK_DEBUG_ERROR("Too short");
+ return tsk_null;
+ }
+
+ return trtp_rtcp_sdes_item_create((trtp_rtcp_sdes_item_type_t)pdata[0], &pdata[2], pdata[1]);
}
tsk_buffer_t* trtp_rtcp_sdes_item_serialize(const trtp_rtcp_sdes_item_t* self)
{
- tsk_buffer_t*buffer = tsk_null;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if((buffer = tsk_buffer_create(tsk_null, trtp_rtcp_sdes_item_get_size(self)))){
- if(trtp_rtcp_sdes_item_serialize_to(self, buffer->data, buffer->size) != 0){
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
- return buffer;
+ tsk_buffer_t*buffer = tsk_null;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if((buffer = tsk_buffer_create(tsk_null, trtp_rtcp_sdes_item_get_size(self)))) {
+ if(trtp_rtcp_sdes_item_serialize_to(self, buffer->data, buffer->size) != 0) {
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
+ return buffer;
}
int trtp_rtcp_sdes_item_serialize_to(const trtp_rtcp_sdes_item_t* self, void* data, tsk_size_t size)
{
- if(!self || !data || (size < trtp_rtcp_sdes_item_get_size(self))){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->type == trtp_rtcp_sdes_item_type_end){
- ((uint8_t*)data)[0] = trtp_rtcp_sdes_item_type_end;
- }
- else{
- ((uint8_t*)data)[0] = self->type;
- if(self->data){
- ((uint8_t*)data)[1] = (uint8_t)self->data->size;
- memcpy(&((uint8_t*)data)[2], self->data->data, self->data->size);
- }
- else{
- ((uint8_t*)data)[1] = 0;
- }
- }
- return 0;
+ if(!self || !data || (size < trtp_rtcp_sdes_item_get_size(self))) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->type == trtp_rtcp_sdes_item_type_end) {
+ ((uint8_t*)data)[0] = trtp_rtcp_sdes_item_type_end;
+ }
+ else {
+ ((uint8_t*)data)[0] = self->type;
+ if(self->data) {
+ ((uint8_t*)data)[1] = (uint8_t)self->data->size;
+ memcpy(&((uint8_t*)data)[2], self->data->data, self->data->size);
+ }
+ else {
+ ((uint8_t*)data)[1] = 0;
+ }
+ }
+ return 0;
}
tsk_size_t trtp_rtcp_sdes_item_get_size(const trtp_rtcp_sdes_item_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- switch(self->type){
- case trtp_rtcp_sdes_item_type_end: return 1;
- default: return 2 + (self->data ? self->data->size : 0);
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ switch(self->type) {
+ case trtp_rtcp_sdes_item_type_end:
+ return 1;
+ default:
+ return 2 + (self->data ? self->data->size : 0);
+ }
}
diff --git a/tinyRTP/src/rtcp/trtp_rtcp_session.c b/tinyRTP/src/rtcp/trtp_rtcp_session.c
index b2f4733..226b0cd 100755
--- a/tinyRTP/src/rtcp/trtp_rtcp_session.c
+++ b/tinyRTP/src/rtcp/trtp_rtcp_session.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,8 +56,14 @@
#include <limits.h> /* INT_MAX */
#ifdef _MSC_VER
-static double drand48() { return (((double)rand()) / RAND_MAX); }
-static void srand48(long sv) { srand((unsigned int) sv); }
+static double drand48()
+{
+ return (((double)rand()) / RAND_MAX);
+}
+static void srand48(long sv)
+{
+ srand((unsigned int) sv);
+}
#endif
#define RTCP_BW (160 * 50) // FIXME: default bandwidth (octet/second)
@@ -70,19 +76,17 @@ static void srand48(long sv) { srand((unsigned int) sv); }
typedef double time_tp;
typedef void* packet_;
-typedef enum event_
-{
- EVENT_BYE,
- EVENT_REPORT,
- EVENT_RTP
+typedef enum event_ {
+ EVENT_BYE,
+ EVENT_REPORT,
+ EVENT_RTP
}
event_;
-typedef enum PacketType_
-{
- PACKET_RTCP_REPORT,
- PACKET_BYE,
- PACKET_RTP,
+typedef enum PacketType_ {
+ PACKET_RTCP_REPORT,
+ PACKET_BYE,
+ PACKET_RTP,
}
PacketType_;
@@ -90,53 +94,51 @@ PacketType_;
#define TRTP_RTCP_SOURCE(self) ((trtp_rtcp_source_t*)self)
-typedef struct trtp_rtcp_source_s
-{
- TSK_DECLARE_OBJECT;
-
- uint32_t ssrc; /* source's ssrc */
- uint16_t max_seq; /* highest seq. number seen */
- uint32_t cycles; /* shifted count of seq. number cycles */
- uint32_t base_seq; /* base seq number */
- uint32_t bad_seq; /* last 'bad' seq number + 1 */
- uint32_t probation; /* sequ. packets till source is valid */
- uint32_t received; /* packets received */
- uint32_t expected_prior; /* packet expected at last interval */
- uint32_t received_prior; /* packet received at last interval */
- uint32_t transit; /* relative trans time for prev pkt */
- double jitter; /* estimated jitter */
-
- uint32_t base_ts; /* base timestamp */
- uint32_t max_ts; /* highest timestamp number seen */
- uint32_t rate; /* codec sampling rate */
-
- uint32_t ntp_msw; /* last received NTP timestamp from RTCP sender */
- uint32_t ntp_lsw; /* last received NTP timestamp from RTCP sender */
- uint64_t dlsr; /* delay since last SR */
+typedef struct trtp_rtcp_source_s {
+ TSK_DECLARE_OBJECT;
+
+ uint32_t ssrc; /* source's ssrc */
+ uint16_t max_seq; /* highest seq. number seen */
+ uint32_t cycles; /* shifted count of seq. number cycles */
+ uint32_t base_seq; /* base seq number */
+ uint32_t bad_seq; /* last 'bad' seq number + 1 */
+ uint32_t probation; /* sequ. packets till source is valid */
+ uint32_t received; /* packets received */
+ uint32_t expected_prior; /* packet expected at last interval */
+ uint32_t received_prior; /* packet received at last interval */
+ uint32_t transit; /* relative trans time for prev pkt */
+ double jitter; /* estimated jitter */
+
+ uint32_t base_ts; /* base timestamp */
+ uint32_t max_ts; /* highest timestamp number seen */
+ uint32_t rate; /* codec sampling rate */
+
+ uint32_t ntp_msw; /* last received NTP timestamp from RTCP sender */
+ uint32_t ntp_lsw; /* last received NTP timestamp from RTCP sender */
+ uint64_t dlsr; /* delay since last SR */
}
trtp_rtcp_source_t;
typedef tsk_list_t trtp_rtcp_sources_L_t; /**< List of @ref trtp_rtcp_header_t elements */
static tsk_object_t* trtp_rtcp_source_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_source_t *source = self;
- if(source){
- }
- return self;
+ trtp_rtcp_source_t *source = self;
+ if(source) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_source_dtor(tsk_object_t * self)
-{
- trtp_rtcp_source_t *source = self;
- if(source){
- }
- return self;
-}
-static const tsk_object_def_t trtp_rtcp_source_def_s =
{
- sizeof(trtp_rtcp_source_t),
- trtp_rtcp_source_ctor,
- trtp_rtcp_source_dtor,
- tsk_null,
+ trtp_rtcp_source_t *source = self;
+ if(source) {
+ }
+ return self;
+}
+static const tsk_object_def_t trtp_rtcp_source_def_s = {
+ sizeof(trtp_rtcp_source_t),
+ trtp_rtcp_source_ctor,
+ trtp_rtcp_source_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_source_def_t = &trtp_rtcp_source_def_s;
@@ -145,113 +147,117 @@ static tsk_bool_t _trtp_rtcp_source_update_seq(trtp_rtcp_source_t* self, uint16_
static int __pred_find_source_by_ssrc(const tsk_list_item_t *item, const void *pssrc)
{
- if(item && item->data){
- trtp_rtcp_source_t *source = item->data;
- return source->ssrc - *((uint32_t*)pssrc);
- }
- return -1;
+ if(item && item->data) {
+ trtp_rtcp_source_t *source = item->data;
+ return source->ssrc - *((uint32_t*)pssrc);
+ }
+ return -1;
}
static trtp_rtcp_source_t* _trtp_rtcp_source_create(uint32_t ssrc, uint16_t seq, uint32_t ts)
{
- trtp_rtcp_source_t* source;
- if(!(source = tsk_object_new(trtp_rtcp_source_def_t))){
- TSK_DEBUG_ERROR("Failed to create source object");
- return tsk_null;
- }
-
- _trtp_rtcp_source_init_seq(source, seq, ts);
- source->ssrc = ssrc;
- source->max_seq = seq - 1;
- source->probation = MIN_SEQUENTIAL;
- source->rate = CODEC_RATE;//FIXME
-
- return source;
+ trtp_rtcp_source_t* source;
+ if(!(source = tsk_object_new(trtp_rtcp_source_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create source object");
+ return tsk_null;
+ }
+
+ _trtp_rtcp_source_init_seq(source, seq, ts);
+ source->ssrc = ssrc;
+ source->max_seq = seq - 1;
+ source->probation = MIN_SEQUENTIAL;
+ source->rate = CODEC_RATE;//FIXME
+
+ return source;
}
static int _trtp_rtcp_source_init_seq(trtp_rtcp_source_t* self, uint16_t seq, uint32_t ts)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->base_seq = seq;
- self->max_seq = seq;
- self->bad_seq = RTP_SEQ_MOD + 1; /* so seq == bad_seq is false */
- self->cycles = 0;
- self->received = 0;
- self->received_prior = 0;
- self->expected_prior = 0;
- self->base_ts = ts;
- self->max_ts = ts;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->base_seq = seq;
+ self->max_seq = seq;
+ self->bad_seq = RTP_SEQ_MOD + 1; /* so seq == bad_seq is false */
+ self->cycles = 0;
+ self->received = 0;
+ self->received_prior = 0;
+ self->expected_prior = 0;
+ self->base_ts = ts;
+ self->max_ts = ts;
+ return 0;
}
static tsk_bool_t _trtp_rtcp_source_update_seq(trtp_rtcp_source_t* self, uint16_t seq, uint32_t ts)
{
- uint16_t udelta;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- udelta = seq - self->max_seq;
-
- /*
- * Source is not valid until MIN_SEQUENTIAL packets with
- * sequential sequence numbers have been received.
- */
- if (self->probation) {
- /* packet is in sequence */
- if (seq == self->max_seq + 1) {
- self->probation--;
- self->max_seq = seq;
- self->max_ts = ts;
- if (self->probation == 0) {
- _trtp_rtcp_source_init_seq(self, seq, ts);
- self->received++;
- return tsk_true;
- }
- } else {
- self->probation = MIN_SEQUENTIAL - 1;
- self->max_seq = seq;
- self->max_ts = ts;
- }
- return tsk_false;
- } else if (udelta < MAX_DROPOUT) {
- /* in order, with permissible gap */
- if (seq < self->max_seq) {
- /*
- * Sequence number wrapped - count another 64K cycle.
- */
- self->cycles += RTP_SEQ_MOD;
- }
- self->max_seq = seq;
- self->max_ts = ts;
- } else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER) {
- /* the sequence number made a very large jump */
- if (seq == self->bad_seq) {
- /*
- * Two sequential packets -- assume that the other side
- * restarted without telling us so just re-sync
- * (i.e., pretend this was the first packet).
- */
- _trtp_rtcp_source_init_seq(self, seq, ts);
- }
- else {
- self->bad_seq = (seq + 1) & (RTP_SEQ_MOD-1);
- return tsk_false;
- }
- } else {
- /* duplicate or reordered packet */
- }
- self->received++;
- return tsk_true;
+ uint16_t udelta;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ udelta = seq - self->max_seq;
+
+ /*
+ * Source is not valid until MIN_SEQUENTIAL packets with
+ * sequential sequence numbers have been received.
+ */
+ if (self->probation) {
+ /* packet is in sequence */
+ if (seq == self->max_seq + 1) {
+ self->probation--;
+ self->max_seq = seq;
+ self->max_ts = ts;
+ if (self->probation == 0) {
+ _trtp_rtcp_source_init_seq(self, seq, ts);
+ self->received++;
+ return tsk_true;
+ }
+ }
+ else {
+ self->probation = MIN_SEQUENTIAL - 1;
+ self->max_seq = seq;
+ self->max_ts = ts;
+ }
+ return tsk_false;
+ }
+ else if (udelta < MAX_DROPOUT) {
+ /* in order, with permissible gap */
+ if (seq < self->max_seq) {
+ /*
+ * Sequence number wrapped - count another 64K cycle.
+ */
+ self->cycles += RTP_SEQ_MOD;
+ }
+ self->max_seq = seq;
+ self->max_ts = ts;
+ }
+ else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER) {
+ /* the sequence number made a very large jump */
+ if (seq == self->bad_seq) {
+ /*
+ * Two sequential packets -- assume that the other side
+ * restarted without telling us so just re-sync
+ * (i.e., pretend this was the first packet).
+ */
+ _trtp_rtcp_source_init_seq(self, seq, ts);
+ }
+ else {
+ self->bad_seq = (seq + 1) & (RTP_SEQ_MOD-1);
+ return tsk_false;
+ }
+ }
+ else {
+ /* duplicate or reordered packet */
+ }
+ self->received++;
+ return tsk_true;
}
static tsk_bool_t _trtp_rtcp_source_is_probed(const trtp_rtcp_source_t* self)
{
- return (self && self->probation == 0);
+ return (self && self->probation == 0);
}
@@ -261,118 +267,120 @@ static tsk_bool_t _trtp_rtcp_source_is_probed(const trtp_rtcp_source_t* self)
typedef time_tp (*tc_f)();
-static time_tp _trtp_rtcp_session_tc() { return (time_tp)tsk_time_now(); }
-
-typedef struct trtp_rtcp_session_s
+static time_tp _trtp_rtcp_session_tc()
{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t is_started;
- tnet_fd_t local_fd;
+ return (time_tp)tsk_time_now();
+}
+
+typedef struct trtp_rtcp_session_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t is_started;
+ tnet_fd_t local_fd;
struct tnet_transport_s* transport; // not starter -> do not stop
- const struct sockaddr * remote_addr;
- struct tnet_ice_ctx_s* ice_ctx; // not starter -> do not stop
- tsk_bool_t is_ice_turn_active;
-
- const void* callback_data;
- trtp_rtcp_cb_f callback;
-
- int32_t app_bw_max_upload; // application specific (kbps)
- int32_t app_bw_max_download; // application specific (kbps)
-
- struct{
- tsk_timer_manager_handle_t* handle_global;
- tsk_timer_id_t id_report;
- tsk_timer_id_t id_bye;
- } timer;
-
- trtp_rtcp_source_t* source_local; /**< local source */
- trtp_rtcp_report_sdes_t* sdes;
- uint64_t time_start; /**< Start time in millis (NOT in NTP unit yet) */
-
- // <RTCP-FB>
- uint8_t fir_seqnr;
- // </RTCP-FB>
-
- // <sender>
- char* cname;
- uint32_t packets_count;
- uint32_t octets_count;
- // </sender>
-
- // <others>
- time_tp tp; /**< the last time an RTCP packet was transmitted; */
- tc_f tc; /**< the current time */
- time_tp tn; /**< the next scheduled transmission time of an RTCP packet */
- int32_t pmembers; /**< the estimated number of session members at the time tn was last recomputed */
- int32_t members; /**< the most current estimate for the number of session members */
- int32_t senders; /**< the most current estimate for the number of senders in the session */
- double rtcp_bw; /**< The target RTCP bandwidth, i.e., the total bandwidth
+ const struct sockaddr * remote_addr;
+ struct tnet_ice_ctx_s* ice_ctx; // not starter -> do not stop
+ tsk_bool_t is_ice_turn_active;
+
+ const void* callback_data;
+ trtp_rtcp_cb_f callback;
+
+ int32_t app_bw_max_upload; // application specific (kbps)
+ int32_t app_bw_max_download; // application specific (kbps)
+ float app_jcng_q; // application specific for jitter buffer congestion estimation (quality in [0, 1])
+
+ struct {
+ tsk_timer_manager_handle_t* handle_global;
+ tsk_timer_id_t id_report;
+ tsk_timer_id_t id_bye;
+ } timer;
+
+ trtp_rtcp_source_t* source_local; /**< local source */
+ trtp_rtcp_report_sdes_t* sdes;
+ uint64_t time_start; /**< Start time in millis (NOT in NTP unit yet) */
+
+ // <RTCP-FB>
+ uint8_t fir_seqnr;
+ // </RTCP-FB>
+
+ // <sender>
+ char* cname;
+ uint32_t packets_count;
+ uint32_t octets_count;
+ // </sender>
+
+ // <others>
+ time_tp tp; /**< the last time an RTCP packet was transmitted; */
+ tc_f tc; /**< the current time */
+ time_tp tn; /**< the next scheduled transmission time of an RTCP packet */
+ int32_t pmembers; /**< the estimated number of session members at the time tn was last recomputed */
+ int32_t members; /**< the most current estimate for the number of session members */
+ int32_t senders; /**< the most current estimate for the number of senders in the session */
+ double rtcp_bw; /**< The target RTCP bandwidth, i.e., the total bandwidth
that will be used for RTCP packets by all members of this session,
in octets per second. This will be a specified fraction of the
"session bandwidth" parameter supplied to the application at
startup*/
- tsk_bool_t we_sent; /**< Flag that is true if the application has sent data since the 2nd previous RTCP report was transmitted */
- double avg_rtcp_size; /**< The average compound RTCP packet size, in octets,
+ tsk_bool_t we_sent; /**< Flag that is true if the application has sent data since the 2nd previous RTCP report was transmitted */
+ double avg_rtcp_size; /**< The average compound RTCP packet size, in octets,
over all RTCP packets sent and received by this participant. The
size includes lower-layer transport and network protocol headers
(e.g., UDP and IP) as explained in Section 6.2*/
- tsk_bool_t initial; /**< Flag that is true if the application has not yet sent an RTCP packet */
- // </others>
+ tsk_bool_t initial; /**< Flag that is true if the application has not yet sent an RTCP packet */
+ // </others>
- trtp_rtcp_sources_L_t *sources;
+ trtp_rtcp_sources_L_t *sources;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
#if HAVE_SRTP
- struct{
- const srtp_t* session;
- } srtp;
+ struct {
+ const srtp_t* session;
+ } srtp;
#endif
}
trtp_rtcp_session_t;
static tsk_object_t* trtp_rtcp_session_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtcp_session_t *session = self;
- if(session){
- session->app_bw_max_upload = INT_MAX; // INT_MAX or <=0 means undefined
- session->app_bw_max_download = INT_MAX; // INT_MAX or <=0 means undefined
- session->sources = tsk_list_create();
- session->timer.id_report = TSK_INVALID_TIMER_ID;
- session->timer.id_bye = TSK_INVALID_TIMER_ID;
- session->tc = _trtp_rtcp_session_tc;
- // get a handle for the global timer manager
- session->timer.handle_global = tsk_timer_mgr_global_ref();
- tsk_safeobj_init(session);
- }
- return self;
+ trtp_rtcp_session_t *session = self;
+ if(session) {
+ session->app_bw_max_upload = INT_MAX; // INT_MAX or <=0 means undefined
+ session->app_bw_max_download = INT_MAX; // INT_MAX or <=0 means undefined
+ session->sources = tsk_list_create();
+ session->timer.id_report = TSK_INVALID_TIMER_ID;
+ session->timer.id_bye = TSK_INVALID_TIMER_ID;
+ session->tc = _trtp_rtcp_session_tc;
+ // get a handle for the global timer manager
+ session->timer.handle_global = tsk_timer_mgr_global_ref();
+ tsk_safeobj_init(session);
+ }
+ return self;
}
static tsk_object_t* trtp_rtcp_session_dtor(tsk_object_t * self)
-{
- trtp_rtcp_session_t *session = self;
- if(session){
- trtp_rtcp_session_stop(session);
-
- TSK_OBJECT_SAFE_FREE(session->sources);
- TSK_OBJECT_SAFE_FREE(session->source_local);
- TSK_OBJECT_SAFE_FREE(session->sdes);
- TSK_OBJECT_SAFE_FREE(session->ice_ctx); // not starter -> do not stop
- TSK_FREE(session->cname);
+{
+ trtp_rtcp_session_t *session = self;
+ if(session) {
+ trtp_rtcp_session_stop(session);
+
+ TSK_OBJECT_SAFE_FREE(session->sources);
+ TSK_OBJECT_SAFE_FREE(session->source_local);
+ TSK_OBJECT_SAFE_FREE(session->sdes);
+ TSK_OBJECT_SAFE_FREE(session->ice_ctx); // not starter -> do not stop
+ TSK_FREE(session->cname);
TSK_OBJECT_SAFE_FREE(session->transport); // not starter -> do not stop
- // release the handle for the global timer manager
- tsk_timer_mgr_global_unref(&session->timer.handle_global);
+ // release the handle for the global timer manager
+ tsk_timer_mgr_global_unref(&session->timer.handle_global);
- tsk_safeobj_deinit(session);
- }
- return self;
+ tsk_safeobj_deinit(session);
+ }
+ return self;
}
-static const tsk_object_def_t trtp_rtcp_session_def_s =
-{
- sizeof(trtp_rtcp_session_t),
- trtp_rtcp_session_ctor,
- trtp_rtcp_session_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtcp_session_def_s = {
+ sizeof(trtp_rtcp_session_t),
+ trtp_rtcp_session_ctor,
+ trtp_rtcp_session_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtcp_session_def_t = &trtp_rtcp_session_def_s;
@@ -394,378 +402,394 @@ static void SendBYEPacket(trtp_rtcp_session_t* session, event_ e);
trtp_rtcp_session_t* trtp_rtcp_session_create(uint32_t ssrc, const char* cname)
{
- trtp_rtcp_session_t* session;
-
- if(!(session = tsk_object_new(trtp_rtcp_session_def_t))){
- TSK_DEBUG_ERROR("Failed to create new session object");
- return tsk_null;
- }
-
- // RFC 3550 - 6.3.2 Initialization
- if(!(session->source_local = _trtp_rtcp_source_create(ssrc, 0, 0))){
- TSK_DEBUG_ERROR("Failed to create new local source");
- TSK_OBJECT_SAFE_FREE(session);
- goto bail;
- }
- _trtp_rtcp_session_add_source(session, session->source_local);
- session->initial = tsk_true;
- session->we_sent = tsk_false;
- session->senders = 1;
- session->members = 1;
- session->rtcp_bw = RTCP_BW;//FIXME: as parameter from the code, Also added possiblities to update this value
- session->cname = tsk_strdup(cname);
-
+ trtp_rtcp_session_t* session;
+
+ if(!(session = tsk_object_new(trtp_rtcp_session_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create new session object");
+ return tsk_null;
+ }
+
+ // RFC 3550 - 6.3.2 Initialization
+ if(!(session->source_local = _trtp_rtcp_source_create(ssrc, 0, 0))) {
+ TSK_DEBUG_ERROR("Failed to create new local source");
+ TSK_OBJECT_SAFE_FREE(session);
+ goto bail;
+ }
+ _trtp_rtcp_session_add_source(session, session->source_local);
+ session->initial = tsk_true;
+ session->we_sent = tsk_false;
+ session->senders = 1;
+ session->members = 1;
+ session->rtcp_bw = RTCP_BW;//FIXME: as parameter from the code, Also added possiblities to update this value
+ session->cname = tsk_strdup(cname);
+
bail:
- return session;
+ return session;
}
struct trtp_rtcp_session_s* trtp_rtcp_session_create_2(struct tnet_ice_ctx_s* ice_ctx, uint32_t ssrc, const char* cname)
{
- struct trtp_rtcp_session_s* session = trtp_rtcp_session_create(ssrc, cname);
- if (session) {
- if ((session->ice_ctx = tsk_object_ref(ice_ctx))) {
- session->is_ice_turn_active = tnet_ice_ctx_is_turn_rtcp_active(session->ice_ctx);
- }
- }
- return session;
+ struct trtp_rtcp_session_s* session = trtp_rtcp_session_create(ssrc, cname);
+ if (session) {
+ if ((session->ice_ctx = tsk_object_ref(ice_ctx))) {
+ session->is_ice_turn_active = tnet_ice_ctx_is_turn_rtcp_active(session->ice_ctx);
+ }
+ }
+ return session;
}
int trtp_rtcp_session_set_callback(trtp_rtcp_session_t* self, trtp_rtcp_cb_f callback, const void* callback_data)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_safeobj_lock(self);
- self->callback = callback;
- self->callback_data = callback_data;
- tsk_safeobj_unlock(self);
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_safeobj_lock(self);
+ self->callback = callback;
+ self->callback_data = callback_data;
+ tsk_safeobj_unlock(self);
+ return 0;
}
#if HAVE_SRTP
int trtp_rtcp_session_set_srtp_sess(trtp_rtcp_session_t* self, const srtp_t* session)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(self);
- self->srtp.session = session;
- tsk_safeobj_unlock(self);
+ tsk_safeobj_lock(self);
+ self->srtp.session = session;
+ tsk_safeobj_unlock(self);
- return 0;
+ return 0;
}
#endif
-int trtp_rtcp_session_set_app_bandwidth_max(trtp_rtcp_session_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps)
+int trtp_rtcp_session_set_app_bw_and_jcng(trtp_rtcp_session_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float jcng_q)
{
- trtp_rtcp_report_rr_t* rr;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- self->app_bw_max_upload = bw_upload_kbps;
- self->app_bw_max_download = bw_download_kbps;
-
- if(self->is_started && self->source_local && self->app_bw_max_download > 0 && self->app_bw_max_download != INT_MAX){ // INT_MAX or <=0 means undefined
- tsk_list_item_t* item;
- uint32_t media_ssrc_list[256] = {0};
- uint32_t media_ssrc_list_count = 0;
- // retrieve sources as array
- tsk_list_foreach(item, self->sources){
- if(!item->data){
- continue;
- }
- if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])){
- media_ssrc_list[media_ssrc_list_count++] = TRTP_RTCP_SOURCE(item->data)->ssrc;
- }
- }
- // create RTCP-RR packet and send it over the network
- if(media_ssrc_list_count > 0 && (rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
- // app_bw_max_download unit is kbps while create_afb_remb() expect bps
- trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(self->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (self->app_bw_max_download * 1024));
- if(psfb_afb_remb){
- TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-RR", self->app_bw_max_download);
- if(trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false) == 0){
- _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
- }
- TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
- }
- TSK_OBJECT_SAFE_FREE(rr);
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return 0;
+ trtp_rtcp_report_rr_t* rr;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ self->app_bw_max_upload = bw_upload_kbps;
+ self->app_bw_max_download = bw_download_kbps;
+ self->app_jcng_q = jcng_q;
+
+ if(self->is_started && self->source_local) { // INT_MAX or <=0 means undefined
+ tsk_list_item_t* item;
+ uint32_t media_ssrc_list[256] = {0};
+ uint32_t media_ssrc_list_count = 0;
+ // retrieve sources as array
+ tsk_list_foreach(item, self->sources) {
+ if(!item->data) {
+ continue;
+ }
+ if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])) {
+ media_ssrc_list[media_ssrc_list_count++] = TRTP_RTCP_SOURCE(item->data)->ssrc;
+ }
+ }
+ // create RTCP-RR packet and send it over the network
+ if (media_ssrc_list_count > 0 && (rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))) {
+ // RTCP-REMB
+ if (self->app_bw_max_download > 0 && self->app_bw_max_download != INT_MAX) {
+ // app_bw_max_download unit is kbps while create_afb_remb() expect bps
+ trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(self->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (self->app_bw_max_download << 10));
+ if (psfb_afb_remb) {
+ TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-RR", self->app_bw_max_download);
+ trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false);
+ TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
+ }
+ }
+ // RTCP-JCNG
+ if (self->app_jcng_q > 0.f && self->app_jcng_q <= 1.f) {
+ // app_bw_max_download unit is kbps while create_afb_remb() expect bps
+ trtp_rtcp_report_psfb_t* psfb_afb_jcng = trtp_rtcp_report_psfb_create_afb_jcng(self->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, self->app_jcng_q);
+ if (psfb_afb_jcng) {
+ TSK_DEBUG_INFO("Packing RTCP-AFB-JCNG (q=%f) for outgoing RTCP-RR", self->app_jcng_q);
+ trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_afb_jcng, tsk_false);
+ TSK_OBJECT_SAFE_FREE(psfb_afb_jcng);
+ }
+ }
+ // send the RR message
+ _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
+ TSK_OBJECT_SAFE_FREE(rr);
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return 0;
}
int trtp_rtcp_session_start(trtp_rtcp_session_t* self, tnet_fd_t local_fd, const struct sockaddr * remote_addr)
{
- int ret;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->is_started){
- TSK_DEBUG_WARN("Already started");
- return 0;
- }
-
- // start global timer manager
- if((ret = tsk_timer_manager_start(self->timer.handle_global))){
- TSK_DEBUG_ERROR("Failed to start timer");
- return ret;
- }
-
- self->local_fd = local_fd;
- self->remote_addr = remote_addr;
-
- // Send Initial RR (mandatory)
- Schedule(self, 0., EVENT_REPORT);
-
- // set start time
- self->time_start = tsk_time_now();
-
- self->is_started = tsk_true;
-
- return ret;
+ int ret;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->is_started) {
+ TSK_DEBUG_WARN("Already started");
+ return 0;
+ }
+
+ // start global timer manager
+ if((ret = tsk_timer_manager_start(self->timer.handle_global))) {
+ TSK_DEBUG_ERROR("Failed to start timer");
+ return ret;
+ }
+
+ self->local_fd = local_fd;
+ self->remote_addr = remote_addr;
+
+ // Send Initial RR (mandatory)
+ Schedule(self, 0., EVENT_REPORT);
+
+ // set start time
+ self->time_start = tsk_time_now();
+
+ self->is_started = tsk_true;
+
+ return ret;
}
int trtp_rtcp_session_stop(trtp_rtcp_session_t* self)
{
- int ret = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(self->is_started){
- // send BYE synchronous way
- SendBYEPacket(self, EVENT_REPORT);
-
- // this is a global timer shared by many components -> stopping it won't remove
- // all scheduled items as it could continue running if still used
- tsk_safeobj_lock(self); // must
- if(TSK_TIMER_ID_IS_VALID(self->timer.id_bye)){
- tsk_timer_manager_cancel(self->timer.handle_global, self->timer.id_bye);
- self->timer.id_bye = TSK_INVALID_TIMER_ID;
- }
- if(TSK_TIMER_ID_IS_VALID(self->timer.id_report)){
- tsk_timer_manager_cancel(self->timer.handle_global, self->timer.id_report);
- self->timer.id_report = TSK_INVALID_TIMER_ID;
- }
- tsk_safeobj_unlock(self);
- self->is_started = tsk_false;
- }
-
- return ret;
+ int ret = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(self->is_started) {
+ // send BYE synchronous way
+ SendBYEPacket(self, EVENT_REPORT);
+
+ // this is a global timer shared by many components -> stopping it won't remove
+ // all scheduled items as it could continue running if still used
+ tsk_safeobj_lock(self); // must
+ if(TSK_TIMER_ID_IS_VALID(self->timer.id_bye)) {
+ tsk_timer_manager_cancel(self->timer.handle_global, self->timer.id_bye);
+ self->timer.id_bye = TSK_INVALID_TIMER_ID;
+ }
+ if(TSK_TIMER_ID_IS_VALID(self->timer.id_report)) {
+ tsk_timer_manager_cancel(self->timer.handle_global, self->timer.id_report);
+ self->timer.id_report = TSK_INVALID_TIMER_ID;
+ }
+ tsk_safeobj_unlock(self);
+ self->is_started = tsk_false;
+ }
+
+ return ret;
}
int trtp_rtcp_session_process_rtp_out(trtp_rtcp_session_t* self, const trtp_rtp_packet_t* packet_rtp, tsk_size_t size)
{
- int ret = 0;
-
- if(!self || !packet_rtp || !packet_rtp->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->is_started){
- TSK_DEBUG_ERROR("Not started");
- return -2;
- }
-
- tsk_safeobj_lock(self);
-
- // create local source if not already done
- // first destroy it if the ssrc don't match
- if(self->source_local && self->source_local->ssrc != packet_rtp->header->ssrc){
- tsk_bool_t removed = tsk_false;
- // local ssrc has changed: sould never happen ...but who know?
- // remove the source
- TSK_DEBUG_WARN("Not expected to be called");
- _trtp_rtcp_session_remove_source(self, self->source_local->ssrc, &removed);
- TSK_OBJECT_SAFE_FREE(self->source_local);
- TSK_OBJECT_SAFE_FREE(self->sdes);
- self->packets_count = 0;
- self->octets_count = 0;
- if(removed){
- --self->senders;
- --self->members;
- }
- }
- if(!self->source_local){
- if(!(self->source_local = _trtp_rtcp_source_create(packet_rtp->header->ssrc, packet_rtp->header->seq_num, packet_rtp->header->timestamp))){
- TSK_DEBUG_ERROR("Failed to create new local source");
- }
- // add the source (refresh the number of senders, ...)
- _trtp_rtcp_session_add_source(self, self->source_local);
- // 'members' and 'senders' were already initialized in the constructor
- }
-
- if(!self->we_sent){
- self->we_sent = tsk_true;
- }
-
- ++self->packets_count;
- self->octets_count += (uint32_t)size;
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ int ret = 0;
+
+ if(!self || !packet_rtp || !packet_rtp->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->is_started) {
+ TSK_DEBUG_ERROR("Not started");
+ return -2;
+ }
+
+ tsk_safeobj_lock(self);
+
+ // create local source if not already done
+ // first destroy it if the ssrc don't match
+ if(self->source_local && self->source_local->ssrc != packet_rtp->header->ssrc) {
+ tsk_bool_t removed = tsk_false;
+ // local ssrc has changed: sould never happen ...but who know?
+ // remove the source
+ TSK_DEBUG_WARN("Not expected to be called");
+ _trtp_rtcp_session_remove_source(self, self->source_local->ssrc, &removed);
+ TSK_OBJECT_SAFE_FREE(self->source_local);
+ TSK_OBJECT_SAFE_FREE(self->sdes);
+ self->packets_count = 0;
+ self->octets_count = 0;
+ if(removed) {
+ --self->senders;
+ --self->members;
+ }
+ }
+ if(!self->source_local) {
+ if(!(self->source_local = _trtp_rtcp_source_create(packet_rtp->header->ssrc, packet_rtp->header->seq_num, packet_rtp->header->timestamp))) {
+ TSK_DEBUG_ERROR("Failed to create new local source");
+ }
+ // add the source (refresh the number of senders, ...)
+ _trtp_rtcp_session_add_source(self, self->source_local);
+ // 'members' and 'senders' were already initialized in the constructor
+ }
+
+ if(!self->we_sent) {
+ self->we_sent = tsk_true;
+ }
+
+ ++self->packets_count;
+ self->octets_count += (uint32_t)size;
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
int trtp_rtcp_session_process_rtp_in(trtp_rtcp_session_t* self, const trtp_rtp_packet_t* packet_rtp, tsk_size_t size)
{
- int ret = 0;
- trtp_rtcp_source_t* source;
-
- if(!self || !packet_rtp || !packet_rtp->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->is_started){
- TSK_DEBUG_INFO("RTCP session not started");
- return -2;
- }
-
- tsk_safeobj_lock(self);
- OnReceive(self, (const packet_)packet_rtp, EVENT_RTP, size);
- if((source = _trtp_rtcp_session_find_source(self, packet_rtp->header->ssrc))){
- if(_trtp_rtcp_source_update_seq(source, packet_rtp->header->seq_num, packet_rtp->header->timestamp)){
- // RFC 3550 A.8 Estimating the Interarrival Jitter
- /* uint32_t expected = (source->cycles + source->max_seq) - source->base_seq + 1; */
- double arrival = (((double)(source->max_ts - source->base_ts) / (double)source->rate) * 1000);
- int32_t transit = (int32_t)arrival - packet_rtp->header->timestamp;
- int32_t d = (transit - source->transit);
- if(d < 0) d = -d;
- source->transit = transit;
- source->jitter += (1./16.) * ((double)d - source->jitter);
- }
- TSK_OBJECT_SAFE_FREE(source);
- }
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ int ret = 0;
+ trtp_rtcp_source_t* source;
+
+ if(!self || !packet_rtp || !packet_rtp->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->is_started) {
+ TSK_DEBUG_INFO("RTCP session not started");
+ return -2;
+ }
+
+ tsk_safeobj_lock(self);
+ OnReceive(self, (const packet_)packet_rtp, EVENT_RTP, size);
+ if((source = _trtp_rtcp_session_find_source(self, packet_rtp->header->ssrc))) {
+ if(_trtp_rtcp_source_update_seq(source, packet_rtp->header->seq_num, packet_rtp->header->timestamp)) {
+ // RFC 3550 A.8 Estimating the Interarrival Jitter
+ /* uint32_t expected = (source->cycles + source->max_seq) - source->base_seq + 1; */
+ double arrival = (((double)(source->max_ts - source->base_ts) / (double)source->rate) * 1000);
+ int32_t transit = (int32_t)arrival - packet_rtp->header->timestamp;
+ int32_t d = (transit - source->transit);
+ if(d < 0) {
+ d = -d;
+ }
+ source->transit = transit;
+ source->jitter += (1./16.) * ((double)d - source->jitter);
+ }
+ TSK_OBJECT_SAFE_FREE(source);
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
int trtp_rtcp_session_process_rtcp_in(trtp_rtcp_session_t* self, const void* buffer, tsk_size_t size)
{
- int ret = 0;
- trtp_rtcp_packet_t* packet_rtcp = tsk_null;
-
- if(!self || !buffer || size < TRTP_RTCP_HEADER_SIZE){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->is_started){
- TSK_DEBUG_ERROR("Not started");
- return -2;
- }
-
- // derialize the RTCP packet for processing
- packet_rtcp = trtp_rtcp_packet_deserialize(buffer, size);
- if(packet_rtcp){
- tsk_safeobj_lock(self);
- OnReceive(self,
- (const packet_)packet_rtcp,
- (packet_rtcp->header->type == trtp_rtcp_packet_type_bye) ? EVENT_BYE : EVENT_REPORT,
- size);
- if(packet_rtcp->header->type == trtp_rtcp_packet_type_sr){
- trtp_rtcp_source_t* source;
- const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)packet_rtcp;
- if((source = _trtp_rtcp_session_find_source(self, sr->ssrc))){
- source->ntp_lsw = sr->sender_info.ntp_lsw;
- source->ntp_msw = sr->sender_info.ntp_msw;
- source->dlsr = tsk_time_now();
- TSK_OBJECT_SAFE_FREE(source);
- }
- }
- tsk_safeobj_unlock(self); // must be before callback()
-
- if(self->callback){
- ret = self->callback(self->callback_data, packet_rtcp);
- }
- TSK_OBJECT_SAFE_FREE(packet_rtcp);
- }
-
-
- return ret;
+ int ret = 0;
+ trtp_rtcp_packet_t* packet_rtcp = tsk_null;
+
+ if(!self || !buffer || size < TRTP_RTCP_HEADER_SIZE) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->is_started) {
+ TSK_DEBUG_ERROR("Not started");
+ return -2;
+ }
+
+ // derialize the RTCP packet for processing
+ packet_rtcp = trtp_rtcp_packet_deserialize(buffer, size);
+ if(packet_rtcp) {
+ tsk_safeobj_lock(self);
+ OnReceive(self,
+ (const packet_)packet_rtcp,
+ (packet_rtcp->header->type == trtp_rtcp_packet_type_bye) ? EVENT_BYE : EVENT_REPORT,
+ size);
+ if(packet_rtcp->header->type == trtp_rtcp_packet_type_sr) {
+ trtp_rtcp_source_t* source;
+ const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)packet_rtcp;
+ if((source = _trtp_rtcp_session_find_source(self, sr->ssrc))) {
+ source->ntp_lsw = sr->sender_info.ntp_lsw;
+ source->ntp_msw = sr->sender_info.ntp_msw;
+ source->dlsr = tsk_time_now();
+ TSK_OBJECT_SAFE_FREE(source);
+ }
+ }
+ tsk_safeobj_unlock(self); // must be before callback()
+
+ if(self->callback) {
+ ret = self->callback(self->callback_data, packet_rtcp);
+ }
+ TSK_OBJECT_SAFE_FREE(packet_rtcp);
+ }
+
+
+ return ret;
}
int trtp_rtcp_session_signal_pkt_loss(trtp_rtcp_session_t* self, uint32_t ssrc_media, const uint16_t* seq_nums, tsk_size_t count)
{
- trtp_rtcp_report_rr_t* rr;
- if(!self || !self->source_local || !seq_nums || !count){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->is_started){
- TSK_DEBUG_ERROR("Not started");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
- trtp_rtcp_report_rtpfb_t* rtpfb;
- if((rtpfb = trtp_rtcp_report_rtpfb_create_nack(self->source_local->ssrc, ssrc_media, seq_nums, count))){
- trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)rtpfb, tsk_false);
- _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
- TSK_OBJECT_SAFE_FREE(rtpfb);
- }
- TSK_OBJECT_SAFE_FREE(rr);
- }
-
- tsk_safeobj_unlock(self);
-
- return 0;
+ trtp_rtcp_report_rr_t* rr;
+ if(!self || !self->source_local || !seq_nums || !count) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->is_started) {
+ TSK_DEBUG_ERROR("Not started");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))) {
+ trtp_rtcp_report_rtpfb_t* rtpfb;
+ if((rtpfb = trtp_rtcp_report_rtpfb_create_nack(self->source_local->ssrc, ssrc_media, seq_nums, count))) {
+ trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)rtpfb, tsk_false);
+ _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
+ TSK_OBJECT_SAFE_FREE(rtpfb);
+ }
+ TSK_OBJECT_SAFE_FREE(rr);
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return 0;
}
// Frame corrupted means the prediction chain is broken -> Send FIR
int trtp_rtcp_session_signal_frame_corrupted(trtp_rtcp_session_t* self, uint32_t ssrc_media)
{
- trtp_rtcp_report_rr_t* rr;
- if(!self || !self->source_local){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!self->is_started){
- TSK_DEBUG_ERROR("Not started");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
- trtp_rtcp_report_psfb_t* psfb_fir = trtp_rtcp_report_psfb_create_fir(self->fir_seqnr++, self->source_local->ssrc, ssrc_media);
- if(psfb_fir){
- trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_fir, tsk_false);
- _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
- TSK_OBJECT_SAFE_FREE(psfb_fir);
- }
- TSK_OBJECT_SAFE_FREE(rr);
- }
-
- tsk_safeobj_unlock(self);
- return 0;
+ trtp_rtcp_report_rr_t* rr;
+ if(!self || !self->source_local) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!self->is_started) {
+ TSK_DEBUG_ERROR("Not started");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))) {
+ trtp_rtcp_report_psfb_t* psfb_fir = trtp_rtcp_report_psfb_create_fir(self->fir_seqnr++, self->source_local->ssrc, ssrc_media);
+ if(psfb_fir) {
+ trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_fir, tsk_false);
+ _trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
+ TSK_OBJECT_SAFE_FREE(psfb_fir);
+ }
+ TSK_OBJECT_SAFE_FREE(rr);
+ }
+
+ tsk_safeobj_unlock(self);
+ return 0;
}
// for now send just a FIR
int trtp_rtcp_session_signal_jb_error(struct trtp_rtcp_session_s* self, uint32_t ssrc_media)
{
- return trtp_rtcp_session_signal_frame_corrupted(self, ssrc_media);
+ return trtp_rtcp_session_signal_frame_corrupted(self, ssrc_media);
}
tnet_fd_t trtp_rtcp_session_get_local_fd(const struct trtp_rtcp_session_s* self)
@@ -800,314 +824,329 @@ int trtp_rtcp_session_set_net_transport(struct trtp_rtcp_session_s* self, struct
static tsk_bool_t _trtp_rtcp_session_have_source(trtp_rtcp_session_t* self, uint32_t ssrc)
{
- tsk_list_item_t* item;
- tsk_list_foreach(item, self->sources){
- if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc){
- return tsk_true;
- }
- }
- return tsk_false;
+ tsk_list_item_t* item;
+ tsk_list_foreach(item, self->sources) {
+ if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc) {
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
// find source by ssrc
// the caller must release the returned object
static trtp_rtcp_source_t* _trtp_rtcp_session_find_source(trtp_rtcp_session_t* self, uint32_t ssrc)
{
- tsk_list_item_t* item;
- tsk_list_foreach(item, self->sources){
- if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc){
- return tsk_object_ref(item->data);
- }
- }
- return tsk_null;
+ tsk_list_item_t* item;
+ tsk_list_foreach(item, self->sources) {
+ if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc) {
+ return tsk_object_ref(item->data);
+ }
+ }
+ return tsk_null;
}
// find or add source by ssrc
// the caller must release the returned object
static trtp_rtcp_source_t* _trtp_rtcp_session_find_or_add_source(trtp_rtcp_session_t* self, uint32_t ssrc, uint16_t seq_if_add, uint32_t ts_id_add)
{
- trtp_rtcp_source_t* source;
- if((source = _trtp_rtcp_session_find_source(self, ssrc))){
- return source;
- }
-
- if((source = _trtp_rtcp_source_create(ssrc, seq_if_add, ts_id_add))){
- if((_trtp_rtcp_session_add_source(self, source)) != 0){
- TSK_DEBUG_ERROR("Failed to add source");
- TSK_OBJECT_SAFE_FREE(source);
- return tsk_null;
- }
- return tsk_object_ref(source);
- }
- return tsk_null;
+ trtp_rtcp_source_t* source;
+ if((source = _trtp_rtcp_session_find_source(self, ssrc))) {
+ return source;
+ }
+
+ if((source = _trtp_rtcp_source_create(ssrc, seq_if_add, ts_id_add))) {
+ if((_trtp_rtcp_session_add_source(self, source)) != 0) {
+ TSK_DEBUG_ERROR("Failed to add source");
+ TSK_OBJECT_SAFE_FREE(source);
+ return tsk_null;
+ }
+ return tsk_object_ref(source);
+ }
+ return tsk_null;
}
int _trtp_rtcp_session_add_source(trtp_rtcp_session_t* self, trtp_rtcp_source_t* source)
{
- if(!self || !source){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !source) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_list_lock(self->sources);
- source = tsk_object_ref(source);
- tsk_list_push_back_data(self->sources, (void**)&source);
- tsk_list_unlock(self->sources);
+ tsk_list_lock(self->sources);
+ source = tsk_object_ref(source);
+ tsk_list_push_back_data(self->sources, (void**)&source);
+ tsk_list_unlock(self->sources);
- return 0;
+ return 0;
}
// adds a source if doesn't exist
static int _trtp_rtcp_session_add_source_2(trtp_rtcp_session_t* self, uint32_t ssrc, uint16_t seq, uint32_t ts, tsk_bool_t *added)
{
- int ret = 0;
- tsk_list_item_t* item;
- trtp_rtcp_source_t* source;
-
- tsk_list_lock(self->sources);
- tsk_list_foreach(item, self->sources){
- if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc){
- tsk_list_unlock(self->sources);
- *added = tsk_false;
- return 0;
- }
- }
+ int ret = 0;
+ tsk_list_item_t* item;
+ trtp_rtcp_source_t* source;
+
+ tsk_list_lock(self->sources);
+ tsk_list_foreach(item, self->sources) {
+ if(TRTP_RTCP_SOURCE(item->data)->ssrc == ssrc) {
+ tsk_list_unlock(self->sources);
+ *added = tsk_false;
+ return 0;
+ }
+ }
- tsk_list_unlock(self->sources);
+ tsk_list_unlock(self->sources);
- if((source = _trtp_rtcp_source_create(ssrc, seq, ts))){
- ret = _trtp_rtcp_session_add_source(self, source);
- }
+ if((source = _trtp_rtcp_source_create(ssrc, seq, ts))) {
+ ret = _trtp_rtcp_session_add_source(self, source);
+ }
- TSK_OBJECT_SAFE_FREE(source);
+ TSK_OBJECT_SAFE_FREE(source);
- *added = tsk_true;
- return ret;
+ *added = tsk_true;
+ return ret;
}
int _trtp_rtcp_session_remove_source(trtp_rtcp_session_t* self, uint32_t ssrc, tsk_bool_t *removed)
{
- *removed = tsk_false;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_list_lock(self->sources);
- if((*removed = tsk_list_remove_item_by_pred(self->sources, __pred_find_source_by_ssrc, &ssrc)) == tsk_true){
- // ...
- }
- tsk_list_unlock(self->sources);
- return 0;
+ *removed = tsk_false;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_list_lock(self->sources);
+ if((*removed = tsk_list_remove_item_by_pred(self->sources, __pred_find_source_by_ssrc, &ssrc)) == tsk_true) {
+ // ...
+ }
+ tsk_list_unlock(self->sources);
+ return 0;
}
static tsk_size_t _trtp_rtcp_session_send_pkt(trtp_rtcp_session_t* self, trtp_rtcp_packet_t* pkt)
{
- tsk_size_t ret = 0;
- tsk_size_t __num_bytes_pad = 0;
- tsk_buffer_t* buffer;
+ tsk_size_t ret = 0;
+ tsk_size_t __num_bytes_pad = 0;
+ tsk_buffer_t* buffer;
- if(!self->remote_addr || self->local_fd <= 0){
- TSK_DEBUG_ERROR("Invalid network settings");
- return 0;
- }
+ if(!self->remote_addr || self->local_fd <= 0) {
+ TSK_DEBUG_ERROR("Invalid network settings");
+ return 0;
+ }
#if HAVE_SRTP
- if(self->srtp.session) __num_bytes_pad = (SRTP_MAX_TRAILER_LEN + 0x4);
+ if(self->srtp.session) {
+ __num_bytes_pad = (SRTP_MAX_TRAILER_LEN + 0x4);
+ }
#endif
- // SDES
- if(!self->sdes && (self->sdes = trtp_rtcp_report_sdes_create_null())){
- trtp_rtcp_sdes_chunck_t* chunck = trtp_rtcp_sdes_chunck_create(self->source_local->ssrc);
- if(chunck){
- static const char* _name = "test@doubango.org";
- trtp_rtcp_sdes_chunck_add_item(chunck, trtp_rtcp_sdes_item_type_cname, self->cname, (uint8_t)tsk_strlen(self->cname));
- trtp_rtcp_sdes_chunck_add_item(chunck, trtp_rtcp_sdes_item_type_name, _name, (uint8_t)tsk_strlen(_name));
- trtp_rtcp_report_sdes_add_chunck(self->sdes, chunck);
- TSK_OBJECT_SAFE_FREE(chunck);
- }
- }
- if(self->sdes){
- trtp_rtcp_packet_add_packet(pkt, (trtp_rtcp_packet_t*)self->sdes, tsk_true);
- }
-
- if((buffer = trtp_rtcp_packet_serialize(pkt, __num_bytes_pad))){
- void* data = buffer->data;
- int size = (int)buffer->size;
+ // SDES
+ if(!self->sdes && (self->sdes = trtp_rtcp_report_sdes_create_null())) {
+ trtp_rtcp_sdes_chunck_t* chunck = trtp_rtcp_sdes_chunck_create(self->source_local->ssrc);
+ if(chunck) {
+ static const char* _name = "test@doubango.org";
+ trtp_rtcp_sdes_chunck_add_item(chunck, trtp_rtcp_sdes_item_type_cname, self->cname, (uint8_t)tsk_strlen(self->cname));
+ trtp_rtcp_sdes_chunck_add_item(chunck, trtp_rtcp_sdes_item_type_name, _name, (uint8_t)tsk_strlen(_name));
+ trtp_rtcp_report_sdes_add_chunck(self->sdes, chunck);
+ TSK_OBJECT_SAFE_FREE(chunck);
+ }
+ }
+ if(self->sdes) {
+ trtp_rtcp_packet_add_packet(pkt, (trtp_rtcp_packet_t*)self->sdes, tsk_true);
+ }
+
+ if((buffer = trtp_rtcp_packet_serialize(pkt, __num_bytes_pad))) {
+ void* data = buffer->data;
+ int size = (int)buffer->size;
#if HAVE_SRTP
- if(self->srtp.session){
- if(srtp_protect_rtcp(((srtp_t)*self->srtp.session), data, &size) != err_status_ok){
- TSK_DEBUG_ERROR("srtp_protect_rtcp() failed");
- }
- }
+ if(self->srtp.session) {
+ if(srtp_protect_rtcp(((srtp_t)*self->srtp.session), data, &size) != err_status_ok) {
+ TSK_DEBUG_ERROR("srtp_protect_rtcp() failed");
+ }
+ }
#endif
- ret = _trtp_rtcp_session_send_raw(self, data, size);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
+ ret = _trtp_rtcp_session_send_raw(self, data, size);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
- return ret;
+ return ret;
}
static tsk_size_t _trtp_rtcp_session_send_raw(trtp_rtcp_session_t* self, const void* data, tsk_size_t size)
{
- tsk_size_t ret = 0;
- if (!self || !data || !size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- if (self->is_ice_turn_active) {
- ret = (tnet_ice_ctx_send_turn_rtcp(self->ice_ctx, data, size) == 0) ? size : 0; // returns #0 if ok
- }
- else {
+ tsk_size_t ret = 0;
+ if (!self || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ if (self->is_ice_turn_active) {
+ ret = (tnet_ice_ctx_send_turn_rtcp(self->ice_ctx, data, size) == 0) ? size : 0; // returns #0 if ok
+ }
+ else {
ret = self->transport
- ? tnet_transport_sendto(self->transport, self->local_fd, self->remote_addr, data, size)
- : tnet_sockfd_sendto(self->local_fd, self->remote_addr, data, size);
- }
- return ret;
+ ? tnet_transport_sendto(self->transport, self->local_fd, self->remote_addr, data, size)
+ : tnet_sockfd_sendto(self->local_fd, self->remote_addr, data, size);
+ }
+ return ret;
}
static int _trtp_rtcp_session_timer_callback(const void* arg, tsk_timer_id_t timer_id)
{
- trtp_rtcp_session_t* session = (trtp_rtcp_session_t*)arg;
- tsk_safeobj_lock(session); // must
- if(session->timer.id_bye == timer_id){
- session->timer.id_bye = TSK_INVALID_TIMER_ID;
- OnExpire(session, EVENT_BYE);
- }
- else if(session->timer.id_report == timer_id){
- session->timer.id_report = TSK_INVALID_TIMER_ID;
- OnExpire(session, EVENT_REPORT);
- }
- tsk_safeobj_unlock(session);
- return 0;
+ trtp_rtcp_session_t* session = (trtp_rtcp_session_t*)arg;
+ tsk_safeobj_lock(session); // must
+ if(session->timer.id_bye == timer_id) {
+ session->timer.id_bye = TSK_INVALID_TIMER_ID;
+ OnExpire(session, EVENT_BYE);
+ }
+ else if(session->timer.id_report == timer_id) {
+ session->timer.id_report = TSK_INVALID_TIMER_ID;
+ OnExpire(session, EVENT_REPORT);
+ }
+ tsk_safeobj_unlock(session);
+ return 0;
}
static tsk_bool_t IsRtpPacket(const packet_ p)
{
- return (TSK_OBJECT_HEADER(p)->__def__ == trtp_rtp_packet_def_t);
+ return (TSK_OBJECT_HEADER(p)->__def__ == trtp_rtp_packet_def_t);
}
static PacketType_ PacketType(const packet_ p)
{
- if(IsRtpPacket(p)){
- return PACKET_RTP;
- }
- else{
- switch(((const trtp_rtcp_packet_t*)p)->header->type){
- case trtp_rtcp_packet_type_bye: return PACKET_BYE;
- default: return PACKET_RTCP_REPORT;
- }
- }
+ if(IsRtpPacket(p)) {
+ return PACKET_RTP;
+ }
+ else {
+ switch(((const trtp_rtcp_packet_t*)p)->header->type) {
+ case trtp_rtcp_packet_type_bye:
+ return PACKET_BYE;
+ default:
+ return PACKET_RTCP_REPORT;
+ }
+ }
}
// Returns true if the packet is from a member or not
// also checks all csrc
static tsk_bool_t NewMember(trtp_rtcp_session_t* session, const packet_ p)
{
- uint32_t ssrc = 0;
- if(IsRtpPacket(p)){
- const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
- tsk_size_t i;
- for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i){
- if(!(_trtp_rtcp_session_have_source(session, packet_rtp->header->csrc[i]))){
- return tsk_false;
- }
- }
- ssrc = packet_rtp->header->ssrc;
- }
- else{
- switch(((const trtp_rtcp_packet_t*)p)->header->type){
- case trtp_rtcp_packet_type_rr: ssrc = ((const trtp_rtcp_report_rr_t*)p)->ssrc; break;
- case trtp_rtcp_packet_type_sr: ssrc = ((const trtp_rtcp_report_sr_t*)p)->ssrc; break;
- case trtp_rtcp_packet_type_bye:
- {
- tsk_size_t i;
- const trtp_rtcp_report_bye_t* bye = (const trtp_rtcp_report_bye_t*)p;
- for(i = 0; i < TRTP_RTCP_PACKET(bye)->header->rc; ++i){
- if(!_trtp_rtcp_session_have_source(session, bye->ssrc_list[i])){
- return tsk_false;
- }
- }
- return tsk_true;
- }
- default: return tsk_false;
- }
- }
-
- return !_trtp_rtcp_session_have_source(session, ssrc);
+ uint32_t ssrc = 0;
+ if(IsRtpPacket(p)) {
+ const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
+ tsk_size_t i;
+ for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i) {
+ if(!(_trtp_rtcp_session_have_source(session, packet_rtp->header->csrc[i]))) {
+ return tsk_false;
+ }
+ }
+ ssrc = packet_rtp->header->ssrc;
+ }
+ else {
+ switch(((const trtp_rtcp_packet_t*)p)->header->type) {
+ case trtp_rtcp_packet_type_rr:
+ ssrc = ((const trtp_rtcp_report_rr_t*)p)->ssrc;
+ break;
+ case trtp_rtcp_packet_type_sr:
+ ssrc = ((const trtp_rtcp_report_sr_t*)p)->ssrc;
+ break;
+ case trtp_rtcp_packet_type_bye: {
+ tsk_size_t i;
+ const trtp_rtcp_report_bye_t* bye = (const trtp_rtcp_report_bye_t*)p;
+ for(i = 0; i < TRTP_RTCP_PACKET(bye)->header->rc; ++i) {
+ if(!_trtp_rtcp_session_have_source(session, bye->ssrc_list[i])) {
+ return tsk_false;
+ }
+ }
+ return tsk_true;
+ }
+ default:
+ return tsk_false;
+ }
+ }
+
+ return !_trtp_rtcp_session_have_source(session, ssrc);
}
#define NewSender(session, p) NewMember((session), (p))
static tsk_size_t AddMemberUsingRTCPPacket(trtp_rtcp_session_t* session, const trtp_rtcp_packet_t* p, tsk_bool_t sender)
{
- trtp_rtcp_packets_L_t* packets = tsk_null;
- trtp_rtcp_rblocks_L_t* blocks = tsk_null;
- tsk_bool_t added = tsk_false;
- tsk_size_t count = 0;
-
- switch(p->header->type){
- case trtp_rtcp_packet_type_rr:
- {
- const trtp_rtcp_report_rr_t* rr = (const trtp_rtcp_report_rr_t*)p;
- _trtp_rtcp_session_add_source_2(session, ((const trtp_rtcp_report_rr_t*)p)->ssrc, 0, 0, &added);
- if(added) ++count;
-
- packets = rr->packets;
- blocks = rr->blocks;
- break;
- }
- case trtp_rtcp_packet_type_sr:
- {
- const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)p;
- _trtp_rtcp_session_add_source_2(session, ((const trtp_rtcp_report_sr_t*)p)->ssrc, 0, 0, &added);
- if(added) ++count;
- packets = sr->packets;
- blocks = sr->blocks;
- break;
- }
- default:
- {
- break;
+ trtp_rtcp_packets_L_t* packets = tsk_null;
+ trtp_rtcp_rblocks_L_t* blocks = tsk_null;
+ tsk_bool_t added = tsk_false;
+ tsk_size_t count = 0;
+
+ switch(p->header->type) {
+ case trtp_rtcp_packet_type_rr: {
+ const trtp_rtcp_report_rr_t* rr = (const trtp_rtcp_report_rr_t*)p;
+ _trtp_rtcp_session_add_source_2(session, ((const trtp_rtcp_report_rr_t*)p)->ssrc, 0, 0, &added);
+ if(added) {
+ ++count;
+ }
+
+ packets = rr->packets;
+ blocks = rr->blocks;
+ break;
+ }
+ case trtp_rtcp_packet_type_sr: {
+ const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)p;
+ _trtp_rtcp_session_add_source_2(session, ((const trtp_rtcp_report_sr_t*)p)->ssrc, 0, 0, &added);
+ if(added) {
+ ++count;
+ }
+ packets = sr->packets;
+ blocks = sr->blocks;
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+
+ if(!sender) {
+ if(packets) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, packets) {
+ AddMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*)item->data, sender);
+ }
+ }
+ if(blocks) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, blocks) {
+ _trtp_rtcp_session_add_source_2(session, TRTP_RTCP_RBLOCK(item->data)->ssrc, 0, 0, &added);
+ if(added) {
+ ++count;
+ }
}
- }
-
- if(!sender){
- if(packets){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, packets){
- AddMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*)item->data, sender);
- }
- }
- if(blocks){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, blocks){
- _trtp_rtcp_session_add_source_2(session, TRTP_RTCP_RBLOCK(item->data)->ssrc, 0, 0, &added);
- if(added) ++count;
- }
- }
- }
-
- return count;
+ }
+ }
+
+ return count;
}
static tsk_size_t AddMember_(trtp_rtcp_session_t* session, const packet_ p, tsk_bool_t sender)
{
- tsk_size_t count = 0;
- if(IsRtpPacket(p)){
- const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
- tsk_size_t i;
- tsk_bool_t added = tsk_false;
- _trtp_rtcp_session_add_source_2(session, packet_rtp->header->ssrc, packet_rtp->header->seq_num, packet_rtp->header->timestamp, &added);
- if(added) ++count;
- for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i){
- _trtp_rtcp_session_add_source_2(session, packet_rtp->header->csrc[i], 0, 0, &added);
- if(added) ++count;
- }
- }
- else{
- count += AddMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*) p, sender);
- }
- return count;
+ tsk_size_t count = 0;
+ if(IsRtpPacket(p)) {
+ const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
+ tsk_size_t i;
+ tsk_bool_t added = tsk_false;
+ _trtp_rtcp_session_add_source_2(session, packet_rtp->header->ssrc, packet_rtp->header->seq_num, packet_rtp->header->timestamp, &added);
+ if(added) {
+ ++count;
+ }
+ for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i) {
+ _trtp_rtcp_session_add_source_2(session, packet_rtp->header->csrc[i], 0, 0, &added);
+ if(added) {
+ ++count;
+ }
+ }
+ }
+ else {
+ count += AddMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*) p, sender);
+ }
+ return count;
}
#define AddMember(session, p) AddMember_((session), (p), tsk_false)
@@ -1116,73 +1155,80 @@ static tsk_size_t AddMember_(trtp_rtcp_session_t* session, const packet_ p, tsk_
static tsk_size_t RemoveMemberUsingRTCPPacket(trtp_rtcp_session_t* session, const trtp_rtcp_packet_t* p)
{
- trtp_rtcp_packets_L_t* packets = tsk_null;
- trtp_rtcp_rblocks_L_t* blocks = tsk_null;
- tsk_bool_t removed = tsk_false;
- tsk_size_t count = 0;
-
- switch(p->header->type){
- case trtp_rtcp_packet_type_rr:
- {
- const trtp_rtcp_report_rr_t* rr = (const trtp_rtcp_report_rr_t*)p;
- _trtp_rtcp_session_remove_source(session, ((const trtp_rtcp_report_rr_t*)p)->ssrc, &removed);
- if(removed) ++count;
-
- packets = rr->packets;
- blocks = rr->blocks;
- break;
- }
- case trtp_rtcp_packet_type_sr:
- {
- const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)p;
- _trtp_rtcp_session_remove_source(session, ((const trtp_rtcp_report_sr_t*)p)->ssrc, &removed);
- if(removed) ++count;
- packets = sr->packets;
- blocks = sr->blocks;
- break;
- }
- default:
- {
- break;
+ trtp_rtcp_packets_L_t* packets = tsk_null;
+ trtp_rtcp_rblocks_L_t* blocks = tsk_null;
+ tsk_bool_t removed = tsk_false;
+ tsk_size_t count = 0;
+
+ switch(p->header->type) {
+ case trtp_rtcp_packet_type_rr: {
+ const trtp_rtcp_report_rr_t* rr = (const trtp_rtcp_report_rr_t*)p;
+ _trtp_rtcp_session_remove_source(session, ((const trtp_rtcp_report_rr_t*)p)->ssrc, &removed);
+ if(removed) {
+ ++count;
+ }
+
+ packets = rr->packets;
+ blocks = rr->blocks;
+ break;
+ }
+ case trtp_rtcp_packet_type_sr: {
+ const trtp_rtcp_report_sr_t* sr = (const trtp_rtcp_report_sr_t*)p;
+ _trtp_rtcp_session_remove_source(session, ((const trtp_rtcp_report_sr_t*)p)->ssrc, &removed);
+ if(removed) {
+ ++count;
+ }
+ packets = sr->packets;
+ blocks = sr->blocks;
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+
+ if(packets) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, packets) {
+ RemoveMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*)item->data);
+ }
+ }
+ if(blocks) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, blocks) {
+ _trtp_rtcp_session_remove_source(session, TRTP_RTCP_RBLOCK(item->data)->ssrc, &removed);
+ if(removed) {
+ ++count;
}
- }
-
- if(packets){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, packets){
- RemoveMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*)item->data);
- }
- }
- if(blocks){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, blocks){
- _trtp_rtcp_session_remove_source(session, TRTP_RTCP_RBLOCK(item->data)->ssrc, &removed);
- if(removed) ++count;
- }
- }
-
-
- return count;
+ }
+ }
+
+
+ return count;
}
static tsk_size_t RemoveMember(trtp_rtcp_session_t* session, const packet_ p)
{
- tsk_size_t count = 0;
- if(IsRtpPacket(p)){
- const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
- tsk_size_t i;
- tsk_bool_t removed = tsk_false;
- _trtp_rtcp_session_remove_source(session, packet_rtp->header->ssrc, &removed);
- if(removed) ++count;
- for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i){
- _trtp_rtcp_session_remove_source(session, packet_rtp->header->csrc[i], &removed);
- if(removed) ++count;
- }
- }
- else{
- count += RemoveMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*) p);
- }
- return count;
+ tsk_size_t count = 0;
+ if(IsRtpPacket(p)) {
+ const trtp_rtp_packet_t* packet_rtp = (const trtp_rtp_packet_t*)p;
+ tsk_size_t i;
+ tsk_bool_t removed = tsk_false;
+ _trtp_rtcp_session_remove_source(session, packet_rtp->header->ssrc, &removed);
+ if(removed) {
+ ++count;
+ }
+ for(i = 0; i < packet_rtp->header->csrc_count && i < sizeof(packet_rtp->header->csrc)/sizeof(packet_rtp->header->csrc[0]); ++i) {
+ _trtp_rtcp_session_remove_source(session, packet_rtp->header->csrc[i], &removed);
+ if(removed) {
+ ++count;
+ }
+ }
+ }
+ else {
+ count += RemoveMemberUsingRTCPPacket(session, (const trtp_rtcp_packet_t*) p);
+ }
+ return count;
}
#define RemoveSender(session, p) RemoveMember((session), (p))
@@ -1190,395 +1236,414 @@ static tsk_size_t RemoveMember(trtp_rtcp_session_t* session, const packet_ p)
// Sends BYE in synchronous mode
static void SendBYEPacket(trtp_rtcp_session_t* session, event_ e)
{
- trtp_rtcp_report_bye_t* bye;
- tsk_size_t __num_bytes_pad = 0;
+ trtp_rtcp_report_bye_t* bye;
+ tsk_size_t __num_bytes_pad = 0;
- if(!session->remote_addr || session->local_fd <= 0){
- TSK_DEBUG_ERROR("Invalid network settings");
- return;
- }
+ if(!session->remote_addr || session->local_fd <= 0) {
+ TSK_DEBUG_ERROR("Invalid network settings");
+ return;
+ }
- tsk_safeobj_lock(session);
+ tsk_safeobj_lock(session);
#if HAVE_SRTP
- if(session->srtp.session) __num_bytes_pad = (SRTP_MAX_TRAILER_LEN + 0x4);
+ if(session->srtp.session) {
+ __num_bytes_pad = (SRTP_MAX_TRAILER_LEN + 0x4);
+ }
#endif
- if(session->source_local && (bye = trtp_rtcp_report_bye_create_2(session->source_local->ssrc))){
- tsk_buffer_t* buffer;
- // serialize and send the packet
- if((buffer = trtp_rtcp_packet_serialize((const trtp_rtcp_packet_t*)bye, __num_bytes_pad))){
- void* data = buffer->data;
- int size = (int)buffer->size;
+ if(session->source_local && (bye = trtp_rtcp_report_bye_create_2(session->source_local->ssrc))) {
+ tsk_buffer_t* buffer;
+ // serialize and send the packet
+ if((buffer = trtp_rtcp_packet_serialize((const trtp_rtcp_packet_t*)bye, __num_bytes_pad))) {
+ void* data = buffer->data;
+ int size = (int)buffer->size;
#if HAVE_SRTP
- if(session->srtp.session){
- if(srtp_protect_rtcp(((srtp_t)*session->srtp.session), data, &size) != err_status_ok){
- TSK_DEBUG_ERROR("srtp_protect_rtcp() failed");
- }
- }
+ if(session->srtp.session) {
+ if(srtp_protect_rtcp(((srtp_t)*session->srtp.session), data, &size) != err_status_ok) {
+ TSK_DEBUG_ERROR("srtp_protect_rtcp() failed");
+ }
+ }
#endif
- _trtp_rtcp_session_send_raw(session, data, size);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- TSK_OBJECT_SAFE_FREE(bye);
- }
+ _trtp_rtcp_session_send_raw(session, data, size);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ TSK_OBJECT_SAFE_FREE(bye);
+ }
- tsk_safeobj_unlock(session);
+ tsk_safeobj_unlock(session);
}
// returns sent packet size
static tsk_size_t SendRTCPReport(trtp_rtcp_session_t* session, event_ e)
{
- tsk_size_t ret = 0;
-
- tsk_safeobj_lock(session);
-
- if(session->initial){
- // Send Receiver report (manadatory to be the first on)
- trtp_rtcp_report_rr_t* rr = trtp_rtcp_report_rr_create_2(session->source_local->ssrc);
- if(rr){
- // serialize and send the packet
- ret = _trtp_rtcp_session_send_pkt(session, (trtp_rtcp_packet_t*)rr);
- TSK_OBJECT_SAFE_FREE(rr);
- }
- }
- else{
- trtp_rtcp_report_sr_t* sr = trtp_rtcp_report_sr_create_null();
- uint32_t media_ssrc_list[16] = {0};
- uint32_t media_ssrc_list_count = 0;
- if(sr){
- uint64_t ntp_now = tsk_time_ntp();
- uint64_t time_now = tsk_time_now();
- trtp_rtcp_rblock_t* rblock;
- trtp_rtcp_source_t* source;
- tsk_list_item_t *item;
- tsk_bool_t packet_lost = tsk_false;
-
- // sender info
- sr->ssrc = session->source_local->ssrc;
- sr->sender_info.ntp_msw = (ntp_now >> 32);
- sr->sender_info.ntp_lsw = (ntp_now & 0xFFFFFFFF);
- sr->sender_info.sender_pcount = session->packets_count;
- sr->sender_info.sender_ocount = session->octets_count;
- { /* rtp_timestamp */
- struct timeval tv;
- uint64_t rtp_timestamp = (time_now - session->time_start) * (session->source_local->rate / 1000);
- tv.tv_sec = (long)(rtp_timestamp / 1000);
- tv.tv_usec = (long)(rtp_timestamp - ((rtp_timestamp / 1000) * 1000)) * 1000;
+ tsk_size_t ret = 0;
+
+ tsk_safeobj_lock(session);
+
+ if(session->initial) {
+ // Send Receiver report (manadatory to be the first on)
+ trtp_rtcp_report_rr_t* rr = trtp_rtcp_report_rr_create_2(session->source_local->ssrc);
+ if(rr) {
+ // serialize and send the packet
+ ret = _trtp_rtcp_session_send_pkt(session, (trtp_rtcp_packet_t*)rr);
+ TSK_OBJECT_SAFE_FREE(rr);
+ }
+ }
+ else {
+ trtp_rtcp_report_sr_t* sr = trtp_rtcp_report_sr_create_null();
+ uint32_t media_ssrc_list[16] = {0};
+ uint32_t media_ssrc_list_count = 0;
+ if(sr) {
+ uint64_t ntp_now = tsk_time_ntp();
+ uint64_t time_now = tsk_time_now();
+ trtp_rtcp_rblock_t* rblock;
+ trtp_rtcp_source_t* source;
+ tsk_list_item_t *item;
+ tsk_bool_t packet_lost = tsk_false;
+
+ // sender info
+ sr->ssrc = session->source_local->ssrc;
+ sr->sender_info.ntp_msw = (ntp_now >> 32);
+ sr->sender_info.ntp_lsw = (ntp_now & 0xFFFFFFFF);
+ sr->sender_info.sender_pcount = session->packets_count;
+ sr->sender_info.sender_ocount = session->octets_count;
+ { /* rtp_timestamp */
+ struct timeval tv;
+ uint64_t rtp_timestamp = (time_now - session->time_start) * (session->source_local->rate / 1000);
+ tv.tv_sec = (long)(rtp_timestamp / 1000);
+ tv.tv_usec = (long)(rtp_timestamp - ((rtp_timestamp / 1000) * 1000)) * 1000;
#if 1
- sr->sender_info.rtp_timestamp = (uint32_t)tsk_time_get_ms(&tv);
+ sr->sender_info.rtp_timestamp = (uint32_t)tsk_time_get_ms(&tv);
#else
- sr->sender_info.rtp_timestamp = (uint32_t)tsk_time_get_ntp_ms(&tv);
+ sr->sender_info.rtp_timestamp = (uint32_t)tsk_time_get_ntp_ms(&tv);
#endif
- }
-
- // report blocks
- tsk_list_foreach(item, session->sources){
- if(!(source = (trtp_rtcp_source_t*)item->data) || !_trtp_rtcp_source_is_probed(source)){
- continue;
- }
- if((rblock = trtp_rtcp_rblock_create_null())){
- int32_t expected, expected_interval, received_interval, lost_interval;
-
- rblock->ssrc = source->ssrc;
- // RFC 3550 - A.3 Determining Number of Packets Expected and Lost
- expected = (source->cycles + source->max_seq) - source->base_seq + 1;
- expected_interval = expected - source->expected_prior;
- source->expected_prior = expected;
- received_interval = source->received - source->received_prior;
- source->received_prior = source->received;
- lost_interval = expected_interval - received_interval;
- if (expected_interval == 0 || lost_interval <= 0) rblock->fraction = 0;
- else rblock->fraction = (lost_interval << 8) / expected_interval;
- rblock->cumulative_no_lost = ((expected - source->received));
- if(!packet_lost && rblock->fraction) packet_lost = tsk_true;
-
- rblock->last_seq = ((source->cycles & 0xFFFF) << 16) | source->max_seq;
- rblock->jitter = (uint32_t)source->jitter;
- rblock->lsr = ((source->ntp_msw & 0xFFFF) << 16) | ((source->ntp_lsw & 0xFFFF0000) >> 16);
- if(source->dlsr){
- rblock->dlsr = (uint32_t)(((time_now - source->dlsr) * 65536) / 1000); // in units of 1/65536 seconds
- }
-
- trtp_rtcp_report_sr_add_block(sr, rblock);
- TSK_OBJECT_SAFE_FREE(rblock);
- }
-
- if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])){
- media_ssrc_list[media_ssrc_list_count++] = source->ssrc;
- }
- }
-
- if(media_ssrc_list_count > 0){
- // draft-alvestrand-rmcat-remb-02
- if(session->app_bw_max_download > 0 && session->app_bw_max_download != INT_MAX){ // INT_MAX or <=0 means undefined
- // app_bw_max_download unit is kbps while create_afb_remb() expect bps
- trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(session->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (session->app_bw_max_download * 1024));
- if(psfb_afb_remb){
- TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-SR", session->app_bw_max_download);
- trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)sr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false);
- TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
- }
- }
- }
-
- // serialize and send the packet
- ret = _trtp_rtcp_session_send_pkt(session, (trtp_rtcp_packet_t*)sr);
- TSK_OBJECT_SAFE_FREE(sr);
- }
- }
-
- tsk_safeobj_unlock(session);
- return ret;
+ }
+
+ // report blocks
+ tsk_list_foreach(item, session->sources) {
+ if(!(source = (trtp_rtcp_source_t*)item->data) || !_trtp_rtcp_source_is_probed(source)) {
+ continue;
+ }
+ if((rblock = trtp_rtcp_rblock_create_null())) {
+ int32_t expected, expected_interval, received_interval, lost_interval;
+
+ rblock->ssrc = source->ssrc;
+ // RFC 3550 - A.3 Determining Number of Packets Expected and Lost
+ expected = (source->cycles + source->max_seq) - source->base_seq + 1;
+ expected_interval = expected - source->expected_prior;
+ source->expected_prior = expected;
+ received_interval = source->received - source->received_prior;
+ source->received_prior = source->received;
+ lost_interval = expected_interval - received_interval;
+ if (expected_interval == 0 || lost_interval <= 0) {
+ rblock->fraction = 0;
+ }
+ else {
+ rblock->fraction = (lost_interval << 8) / expected_interval;
+ }
+ rblock->cumulative_no_lost = ((expected - source->received));
+ if(!packet_lost && rblock->fraction) {
+ packet_lost = tsk_true;
+ }
+
+ rblock->last_seq = ((source->cycles & 0xFFFF) << 16) | source->max_seq;
+ rblock->jitter = (uint32_t)source->jitter;
+ rblock->lsr = ((source->ntp_msw & 0xFFFF) << 16) | ((source->ntp_lsw & 0xFFFF0000) >> 16);
+ if(source->dlsr) {
+ rblock->dlsr = (uint32_t)(((time_now - source->dlsr) * 65536) / 1000); // in units of 1/65536 seconds
+ }
+
+ trtp_rtcp_report_sr_add_block(sr, rblock);
+ TSK_OBJECT_SAFE_FREE(rblock);
+ }
+
+ if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])) {
+ media_ssrc_list[media_ssrc_list_count++] = source->ssrc;
+ }
+ }
+
+ if(media_ssrc_list_count > 0) {
+ // draft-alvestrand-rmcat-remb-02
+ if(session->app_bw_max_download > 0 && session->app_bw_max_download != INT_MAX) { // INT_MAX or <=0 means undefined
+ // app_bw_max_download unit is kbps while create_afb_remb() expect bps
+ trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(session->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (session->app_bw_max_download * 1024));
+ if(psfb_afb_remb) {
+ TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-SR", session->app_bw_max_download);
+ trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)sr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false);
+ TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
+ }
+ }
+ }
+
+ // serialize and send the packet
+ ret = _trtp_rtcp_session_send_pkt(session, (trtp_rtcp_packet_t*)sr);
+ TSK_OBJECT_SAFE_FREE(sr);
+ }
+ }
+
+ tsk_safeobj_unlock(session);
+ return ret;
}
static void Schedule(trtp_rtcp_session_t* session, double tn, event_ e)
{
- tsk_safeobj_lock(session); // must
- switch(e){
- case EVENT_BYE:
- if(!TSK_TIMER_ID_IS_VALID(session->timer.id_bye)){
- session->timer.id_bye = tsk_timer_manager_schedule(session->timer.handle_global, (uint64_t)tn, _trtp_rtcp_session_timer_callback, session);
- }
- break;
- case EVENT_REPORT:
- if(!TSK_TIMER_ID_IS_VALID(session->timer.id_report)){
- session->timer.id_report = tsk_timer_manager_schedule(session->timer.handle_global, (uint64_t)tn, _trtp_rtcp_session_timer_callback, session);
- }
- break;
- default: TSK_DEBUG_ERROR("Unexpected code called"); break;
- }
- tsk_safeobj_unlock(session);
+ tsk_safeobj_lock(session); // must
+ switch(e) {
+ case EVENT_BYE:
+ if(!TSK_TIMER_ID_IS_VALID(session->timer.id_bye)) {
+ session->timer.id_bye = tsk_timer_manager_schedule(session->timer.handle_global, (uint64_t)tn, _trtp_rtcp_session_timer_callback, session);
+ }
+ break;
+ case EVENT_REPORT:
+ if(!TSK_TIMER_ID_IS_VALID(session->timer.id_report)) {
+ session->timer.id_report = tsk_timer_manager_schedule(session->timer.handle_global, (uint64_t)tn, _trtp_rtcp_session_timer_callback, session);
+ }
+ break;
+ default:
+ TSK_DEBUG_ERROR("Unexpected code called");
+ break;
+ }
+ tsk_safeobj_unlock(session);
}
#define Reschedule(session, tn, e) Schedule((session), (tn), (e))
static double rtcp_interval(int32_t members,
- int32_t senders,
- double rtcp_bw,
- int32_t we_sent,
- double avg_rtcp_size,
- tsk_bool_t initial)
+ int32_t senders,
+ double rtcp_bw,
+ int32_t we_sent,
+ double avg_rtcp_size,
+ tsk_bool_t initial)
{
- /*
- * Minimum average time between RTCP packets from this site (in
- * seconds). This time prevents the reports from `clumping' when
- * sessions are small and the law of large numbers isn't helping
- * to smooth out the traffic. It also keeps the report interval
- * from becoming ridiculously small during transient outages like
- * a network partition.
- */
- #define RTCP_MIN_TIME 5.
- /*
- * Fraction of the RTCP bandwidth to be shared among active
- * senders. (This fraction was chosen so that in a typical
- * session with one or two active senders, the computed report
- * time would be roughly equal to the minimum report time so that
- * we don't unnecessarily slow down receiver reports.) The
- * receiver fraction must be 1 - the sender fraction.
- */
- #define RTCP_SENDER_BW_FRACTION 0.25
- #define RTCP_RCVR_BW_FRACTION (1 - RTCP_SENDER_BW_FRACTION)
- /*
- * To compensate for "timer reconsideration" converging to a
- * value below the intended average.
- */
- #define COMPENSATION (2.71828 - 1.5)
-
- double t; /* interval */
- double rtcp_min_time = RTCP_MIN_TIME;
- int n; /* no. of members for computation */
-
- /*
- * Very first call at application start-up uses half the min
- * delay for quicker notification while still allowing some time
- * before reporting for randomization and to learn about other
- * sources so the report interval will converge to the correct
- * interval more quickly.
- */
- if (initial) {
- rtcp_min_time /= 2;
- }
- /*
- * Dedicate a fraction of the RTCP bandwidth to senders unless
- * the number of senders is large enough that their share is
- * more than that fraction.
- */
- n = members;
- if (senders <= members * RTCP_SENDER_BW_FRACTION) {
- if (we_sent) {
- rtcp_bw *= RTCP_SENDER_BW_FRACTION;
- n = senders;
- } else {
- rtcp_bw *= RTCP_RCVR_BW_FRACTION;
- n -= senders;
- }
- }
-
- /*
- * The effective number of sites times the average packet size is
- * the total number of octets sent when each site sends a report.
- * Dividing this by the effective bandwidth gives the time
- * interval over which those packets must be sent in order to
- * meet the bandwidth target, with a minimum enforced. In that
- * time interval we send one report so this time is also our
- * average time between reports.
- */
- t = avg_rtcp_size * n / rtcp_bw;
- if (t < rtcp_min_time) t = rtcp_min_time;
-
- /*
- * To avoid traffic bursts from unintended synchronization with
- * other sites, we then pick our actual next report interval as a
- * random number uniformly distributed between 0.5*t and 1.5*t.
- */
- t = t * (drand48() + 0.5);
- t = t / COMPENSATION;
-
- return (t * 1000);
+ /*
+ * Minimum average time between RTCP packets from this site (in
+ * seconds). This time prevents the reports from `clumping' when
+ * sessions are small and the law of large numbers isn't helping
+ * to smooth out the traffic. It also keeps the report interval
+ * from becoming ridiculously small during transient outages like
+ * a network partition.
+ */
+#define RTCP_MIN_TIME 5.
+ /*
+ * Fraction of the RTCP bandwidth to be shared among active
+ * senders. (This fraction was chosen so that in a typical
+ * session with one or two active senders, the computed report
+ * time would be roughly equal to the minimum report time so that
+ * we don't unnecessarily slow down receiver reports.) The
+ * receiver fraction must be 1 - the sender fraction.
+ */
+#define RTCP_SENDER_BW_FRACTION 0.25
+#define RTCP_RCVR_BW_FRACTION (1 - RTCP_SENDER_BW_FRACTION)
+ /*
+ * To compensate for "timer reconsideration" converging to a
+ * value below the intended average.
+ */
+#define COMPENSATION (2.71828 - 1.5)
+
+ double t; /* interval */
+ double rtcp_min_time = RTCP_MIN_TIME;
+ int n; /* no. of members for computation */
+
+ /*
+ * Very first call at application start-up uses half the min
+ * delay for quicker notification while still allowing some time
+ * before reporting for randomization and to learn about other
+ * sources so the report interval will converge to the correct
+ * interval more quickly.
+ */
+ if (initial) {
+ rtcp_min_time /= 2;
+ }
+ /*
+ * Dedicate a fraction of the RTCP bandwidth to senders unless
+ * the number of senders is large enough that their share is
+ * more than that fraction.
+ */
+ n = members;
+ if (senders <= members * RTCP_SENDER_BW_FRACTION) {
+ if (we_sent) {
+ rtcp_bw *= RTCP_SENDER_BW_FRACTION;
+ n = senders;
+ }
+ else {
+ rtcp_bw *= RTCP_RCVR_BW_FRACTION;
+ n -= senders;
+ }
+ }
+
+ /*
+ * The effective number of sites times the average packet size is
+ * the total number of octets sent when each site sends a report.
+ * Dividing this by the effective bandwidth gives the time
+ * interval over which those packets must be sent in order to
+ * meet the bandwidth target, with a minimum enforced. In that
+ * time interval we send one report so this time is also our
+ * average time between reports.
+ */
+ t = avg_rtcp_size * n / rtcp_bw;
+ if (t < rtcp_min_time) {
+ t = rtcp_min_time;
+ }
+
+ /*
+ * To avoid traffic bursts from unintended synchronization with
+ * other sites, we then pick our actual next report interval as a
+ * random number uniformly distributed between 0.5*t and 1.5*t.
+ */
+ t = t * (drand48() + 0.5);
+ t = t / COMPENSATION;
+
+ return (t * 1000);
}
static void OnExpire(trtp_rtcp_session_t* session, event_ e)
{
- /* This function is responsible for deciding whether to send an
- * RTCP report or BYE packet now, or to reschedule transmission.
- * It is also responsible for updating the pmembers, initial, tp,
- * and avg_rtcp_size state variables. This function should be
- * called upon expiration of the event timer used by Schedule().
- */
-
- double t; /* Interval */
- double tn; /* Next transmit time */
- double tc;
-
- /* In the case of a BYE, we use "timer reconsideration" to
- * reschedule the transmission of the BYE if necessary */
-
- if (TypeOfEvent(e) == EVENT_BYE) {
- t = rtcp_interval(session->members,
- session->senders,
- session->rtcp_bw,
- session->we_sent,
- session->avg_rtcp_size,
- session->initial);
- tn = session->tp + t;
- if (tn <= session->tc()) {
- SendBYEPacket(session, e);
+ /* This function is responsible for deciding whether to send an
+ * RTCP report or BYE packet now, or to reschedule transmission.
+ * It is also responsible for updating the pmembers, initial, tp,
+ * and avg_rtcp_size state variables. This function should be
+ * called upon expiration of the event timer used by Schedule().
+ */
+
+ double t; /* Interval */
+ double tn; /* Next transmit time */
+ double tc;
+
+ /* In the case of a BYE, we use "timer reconsideration" to
+ * reschedule the transmission of the BYE if necessary */
+
+ if (TypeOfEvent(e) == EVENT_BYE) {
+ t = rtcp_interval(session->members,
+ session->senders,
+ session->rtcp_bw,
+ session->we_sent,
+ session->avg_rtcp_size,
+ session->initial);
+ tn = session->tp + t;
+ if (tn <= session->tc()) {
+ SendBYEPacket(session, e);
#if 0
- exit(1);
+ exit(1);
#endif
- } else {
+ }
+ else {
#if 0
- Schedule(session, tn, e);
+ Schedule(session, tn, e);
#else
- Schedule(session, 0, e);
+ Schedule(session, 0, e);
#endif
- }
-
- } else if (TypeOfEvent(e) == EVENT_REPORT) {
- t = rtcp_interval(session->members,
- session->senders,
- session->rtcp_bw,
- session->we_sent,
- session->avg_rtcp_size,
- session->initial);
- tn = session->tp + t;
- if (tn <= (tc = session->tc())) {
- tsk_size_t SentPacketSize = SendRTCPReport(session, e);
- session->avg_rtcp_size = (1./16.)*SentPacketSize + (15./16.)*(session->avg_rtcp_size);
- session->tp = tc;
-
- /* We must redraw the interval. Don't reuse the
- one computed above, since its not actually
- distributed the same, as we are conditioned
- on it being small enough to cause a packet to
- be sent */
-
- t = rtcp_interval(session->members,
- session->senders,
- session->rtcp_bw,
- session->we_sent,
- session->avg_rtcp_size,
- session->initial);
+ }
+
+ }
+ else if (TypeOfEvent(e) == EVENT_REPORT) {
+ t = rtcp_interval(session->members,
+ session->senders,
+ session->rtcp_bw,
+ session->we_sent,
+ session->avg_rtcp_size,
+ session->initial);
+ tn = session->tp + t;
+ if (tn <= (tc = session->tc())) {
+ tsk_size_t SentPacketSize = SendRTCPReport(session, e);
+ session->avg_rtcp_size = (1./16.)*SentPacketSize + (15./16.)*(session->avg_rtcp_size);
+ session->tp = tc;
+
+ /* We must redraw the interval. Don't reuse the
+ one computed above, since its not actually
+ distributed the same, as we are conditioned
+ on it being small enough to cause a packet to
+ be sent */
+
+ t = rtcp_interval(session->members,
+ session->senders,
+ session->rtcp_bw,
+ session->we_sent,
+ session->avg_rtcp_size,
+ session->initial);
#if 0
- Schedule(session, t+tc, e);
+ Schedule(session, t+tc, e);
#else
- Schedule(session, t, e);
+ Schedule(session, t, e);
#endif
- session->initial = tsk_false;
- } else {
+ session->initial = tsk_false;
+ }
+ else {
#if 0
- Schedule(session, tn, e);
+ Schedule(session, tn, e);
#else
- Schedule(session, 0, e);
+ Schedule(session, 0, e);
#endif
- }
- session->pmembers = session->members;
- }
+ }
+ session->pmembers = session->members;
+ }
}
static void OnReceive(trtp_rtcp_session_t* session, const packet_ p, event_ e, tsk_size_t ReceivedPacketSize)
{
- /* What we do depends on whether we have left the group, and are
- * waiting to send a BYE (TypeOfEvent(e) == EVENT_BYE) or an RTCP
- * report. p represents the packet that was just received. */
-
- if (PacketType(p) == PACKET_RTCP_REPORT) {
- if (NewMember(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
- session->members += (int32_t)AddMember(session, p);
- }
- session->avg_rtcp_size = (1./16.)*ReceivedPacketSize + (15./16.)*(session->avg_rtcp_size);
- } else if (PacketType(p) == PACKET_RTP) {
+ /* What we do depends on whether we have left the group, and are
+ * waiting to send a BYE (TypeOfEvent(e) == EVENT_BYE) or an RTCP
+ * report. p represents the packet that was just received. */
+
+ if (PacketType(p) == PACKET_RTCP_REPORT) {
+ if (NewMember(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
+ session->members += (int32_t)AddMember(session, p);
+ }
+ session->avg_rtcp_size = (1./16.)*ReceivedPacketSize + (15./16.)*(session->avg_rtcp_size);
+ }
+ else if (PacketType(p) == PACKET_RTP) {
#if 0
- if (NewMember(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
- session->members += AddMember(session, p);
- }
- if (NewSender(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
- tsk_size_t count = AddSender(session, p);
- session->senders += count;
- session->members += count;
- }
+ if (NewMember(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
+ session->members += AddMember(session, p);
+ }
+ if (NewSender(session, p) && (TypeOfEvent(e) == EVENT_REPORT)) {
+ tsk_size_t count = AddSender(session, p);
+ session->senders += count;
+ session->members += count;
+ }
#else
- if (NewSender(session, p)) {
- tsk_size_t count = AddSender(session, p);
- session->senders += (int32_t)count;
- session->members += (int32_t)count;
- }
+ if (NewSender(session, p)) {
+ tsk_size_t count = AddSender(session, p);
+ session->senders += (int32_t)count;
+ session->members += (int32_t)count;
+ }
#endif
- } else if (PacketType(p) == PACKET_BYE) {
- session->avg_rtcp_size = (1./16.)*ReceivedPacketSize + (15./16.)*(session->avg_rtcp_size);
-
- if (TypeOfEvent(e) == EVENT_REPORT) {
- double tc = session->tc();
- tsk_size_t count = RemoveMember(session, p);
- session->senders -= (int32_t)count;
- session->members -= (int32_t)count;
+ }
+ else if (PacketType(p) == PACKET_BYE) {
+ session->avg_rtcp_size = (1./16.)*ReceivedPacketSize + (15./16.)*(session->avg_rtcp_size);
+
+ if (TypeOfEvent(e) == EVENT_REPORT) {
+ double tc = session->tc();
+ tsk_size_t count = RemoveMember(session, p);
+ session->senders -= (int32_t)count;
+ session->members -= (int32_t)count;
#if 0
- if (NewSender(session, p) == tsk_false) {
- RemoveSender(p);
- session->senders -= 1;
- }
- if (NewMember(session, p) == tsk_false) {
- RemoveMember(p);
- session->members -= 1;
- }
+ if (NewSender(session, p) == tsk_false) {
+ RemoveSender(p);
+ session->senders -= 1;
+ }
+ if (NewMember(session, p) == tsk_false) {
+ RemoveMember(p);
+ session->members -= 1;
+ }
#endif
- if (session->members < session->pmembers && session->pmembers) {
- session->tn = (time_tp)(tc +
- (((double) session->members)/(session->pmembers))*(session->tn - tc));
- session->tp = (time_tp)(tc -
- (((double) session->members)/(session->pmembers))*(tc - session->tp));
+ if (session->members < session->pmembers && session->pmembers) {
+ session->tn = (time_tp)(tc +
+ (((double) session->members)/(session->pmembers))*(session->tn - tc));
+ session->tp = (time_tp)(tc -
+ (((double) session->members)/(session->pmembers))*(tc - session->tp));
- /* Reschedule the next report for time tn */
+ /* Reschedule the next report for time tn */
- Reschedule(session, session->tn, e);
- session->pmembers = session->members;
- }
+ Reschedule(session, session->tn, e);
+ session->pmembers = session->members;
+ }
- } else if (TypeOfEvent(e) == EVENT_BYE) {
- session->members += 1;
- }
- }
+ }
+ else if (TypeOfEvent(e) == EVENT_BYE) {
+ session->members += 1;
+ }
+ }
}
diff --git a/tinyRTP/src/rtp/trtp_rtp_header.c b/tinyRTP/src/rtp/trtp_rtp_header.c
index e833b10..7843d1b 100755
--- a/tinyRTP/src/rtp/trtp_rtp_header.c
+++ b/tinyRTP/src/rtp/trtp_rtp_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,49 +33,49 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
- /* RFC 3550 section 5.1 - RTP Fixed Header Fields
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P|X| CC |M| PT | sequence number |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | timestamp |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | synchronization source (SSRC) identifier |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | contributing source (CSRC) identifiers |
- | .... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
+/* RFC 3550 section 5.1 - RTP Fixed Header Fields
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |V=2|P|X| CC |M| PT | sequence number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | timestamp |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | synchronization source (SSRC) identifier |
+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
+ | contributing source (CSRC) identifiers |
+ | .... |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+*/
/* Create new RTP header */
trtp_rtp_header_t* trtp_rtp_header_create_null()
{
- return tsk_object_new(trtp_rtp_header_def_t);
+ return tsk_object_new(trtp_rtp_header_def_t);
}
trtp_rtp_header_t* trtp_rtp_header_create(uint32_t ssrc, uint16_t seq_num, uint32_t timestamp, uint8_t payload_type, tsk_bool_t marker)
{
- trtp_rtp_header_t* header;
- if((header = trtp_rtp_header_create_null())){
- header->version = TRTP_RTP_VERSION;
- header->marker = marker ? 1 : 0;
- header->payload_type = payload_type;
- header->seq_num = seq_num;
- header->timestamp = timestamp;
- header->ssrc = ssrc;
- }
- return header;
+ trtp_rtp_header_t* header;
+ if((header = trtp_rtp_header_create_null())) {
+ header->version = TRTP_RTP_VERSION;
+ header->marker = marker ? 1 : 0;
+ header->payload_type = payload_type;
+ header->seq_num = seq_num;
+ header->timestamp = timestamp;
+ header->ssrc = ssrc;
+ }
+ return header;
}
/* guess what is the minimum required size to serialize the header */
tsk_size_t trtp_rtp_header_guess_serialbuff_size(const trtp_rtp_header_t *self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return (TRTP_RTP_HEADER_MIN_SIZE + (self->csrc_count << 2));
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return (TRTP_RTP_HEADER_MIN_SIZE + (self->csrc_count << 2));
}
/* serialize the RTP header to a buffer */
@@ -83,145 +83,145 @@ tsk_size_t trtp_rtp_header_guess_serialbuff_size(const trtp_rtp_header_t *self)
// returns the number of written bytes
tsk_size_t trtp_rtp_header_serialize_to(const trtp_rtp_header_t *self, void *buffer, tsk_size_t size)
{
- tsk_size_t ret;
- tsk_size_t i, j;
- uint8_t* pbuff = (uint8_t*)buffer;
-
- if(!buffer || (size < (ret = trtp_rtp_header_guess_serialbuff_size(self)))){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- // Octet-0: version(2), Padding(1), Extension(1), CSRC Count(4)
- pbuff[0] = (((uint8_t)self->version)<< 6) |
- (((uint8_t)self->padding)<< 5) |
- (((uint8_t)self->extension)<< 4) |
- ((uint8_t)self->csrc_count);
- // Octet-1: Marker(1), Payload Type(7)
- pbuff[1] = (((uint8_t)self->marker)<< 7) |
- ((uint8_t)self->payload_type);
- // Octet-2-3: Sequence number (16)
- // *((uint16_t*)&pbuff[2]) = tnet_htons(self->seq_num);
- pbuff[2] = self->seq_num >> 8;
- pbuff[3] = self->seq_num & 0xFF;
- // Octet-4-5-6-7: timestamp (32)
- // ((uint32_t*)&pbuff[4]) = tnet_htonl(self->timestamp);
- pbuff[4] = self->timestamp >> 24;
- pbuff[5] = (self->timestamp >> 16) & 0xFF;
- pbuff[6] = (self->timestamp >> 8) & 0xFF;
- pbuff[7] = self->timestamp & 0xFF;
- // Octet-8-9-10-11: SSRC (32)
- //((uint32_t*)&pbuff[8]) = tnet_htonl(self->ssrc);
- pbuff[8] = self->ssrc >> 24;
- pbuff[9] = (self->ssrc >> 16) & 0xFF;
- pbuff[10] = (self->ssrc >> 8) & 0xFF;
- pbuff[11] = self->ssrc & 0xFF;
-
- // Octet-12-13-14-15-****: CSRC
- for(i = 0, j = 12; i<self->csrc_count; ++i, ++j){
- // *((uint32_t*)&pbuff[12+i]) = tnet_htonl(self->csrc[i]);
- pbuff[j] = self->csrc[i] >> 24;
- pbuff[j + 1] = (self->csrc[i] >> 16) & 0xFF;
- pbuff[j + 2] = (self->csrc[i] >> 8) & 0xFF;
- pbuff[j + 3] = self->csrc[i] & 0xFF;
- }
-
- return ret;
+ tsk_size_t ret;
+ tsk_size_t i, j;
+ uint8_t* pbuff = (uint8_t*)buffer;
+
+ if(!buffer || (size < (ret = trtp_rtp_header_guess_serialbuff_size(self)))) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ // Octet-0: version(2), Padding(1), Extension(1), CSRC Count(4)
+ pbuff[0] = (((uint8_t)self->version)<< 6) |
+ (((uint8_t)self->padding)<< 5) |
+ (((uint8_t)self->extension)<< 4) |
+ ((uint8_t)self->csrc_count);
+ // Octet-1: Marker(1), Payload Type(7)
+ pbuff[1] = (((uint8_t)self->marker)<< 7) |
+ ((uint8_t)self->payload_type);
+ // Octet-2-3: Sequence number (16)
+ // *((uint16_t*)&pbuff[2]) = tnet_htons(self->seq_num);
+ pbuff[2] = self->seq_num >> 8;
+ pbuff[3] = self->seq_num & 0xFF;
+ // Octet-4-5-6-7: timestamp (32)
+ // ((uint32_t*)&pbuff[4]) = tnet_htonl(self->timestamp);
+ pbuff[4] = self->timestamp >> 24;
+ pbuff[5] = (self->timestamp >> 16) & 0xFF;
+ pbuff[6] = (self->timestamp >> 8) & 0xFF;
+ pbuff[7] = self->timestamp & 0xFF;
+ // Octet-8-9-10-11: SSRC (32)
+ //((uint32_t*)&pbuff[8]) = tnet_htonl(self->ssrc);
+ pbuff[8] = self->ssrc >> 24;
+ pbuff[9] = (self->ssrc >> 16) & 0xFF;
+ pbuff[10] = (self->ssrc >> 8) & 0xFF;
+ pbuff[11] = self->ssrc & 0xFF;
+
+ // Octet-12-13-14-15-****: CSRC
+ for(i = 0, j = 12; i<self->csrc_count; ++i, ++j) {
+ // *((uint32_t*)&pbuff[12+i]) = tnet_htonl(self->csrc[i]);
+ pbuff[j] = self->csrc[i] >> 24;
+ pbuff[j + 1] = (self->csrc[i] >> 16) & 0xFF;
+ pbuff[j + 2] = (self->csrc[i] >> 8) & 0xFF;
+ pbuff[j + 3] = self->csrc[i] & 0xFF;
+ }
+
+ return ret;
}
/** Serialize rtp header object into binary buffer */
tsk_buffer_t* trtp_rtp_header_serialize(const trtp_rtp_header_t *self)
{
- tsk_buffer_t* buffer;
- tsk_size_t size;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- size = trtp_rtp_header_guess_serialbuff_size(self);
- if(!(buffer = tsk_buffer_create(tsk_null, size))){
- TSK_DEBUG_ERROR("Failed to create new buffer");
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- else{
- size = trtp_rtp_header_serialize_to(self, buffer->data, buffer->size);
- }
-
- return buffer;
+ tsk_buffer_t* buffer;
+ tsk_size_t size;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ size = trtp_rtp_header_guess_serialbuff_size(self);
+ if(!(buffer = tsk_buffer_create(tsk_null, size))) {
+ TSK_DEBUG_ERROR("Failed to create new buffer");
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ else {
+ size = trtp_rtp_header_serialize_to(self, buffer->data, buffer->size);
+ }
+
+ return buffer;
}
/** Deserialize rtp header object from binary buffer */
trtp_rtp_header_t* trtp_rtp_header_deserialize(const void *data, tsk_size_t size)
{
- trtp_rtp_header_t* header = tsk_null;
- const uint8_t* pdata = (const uint8_t*)data;
- uint8_t csrc_count, i;
-
- if(!data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(size <TRTP_RTP_HEADER_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short to contain RTP header");
- return tsk_null;
- }
-
- /* Before starting to deserialize, get the "csrc_count" and check the length validity
- * CSRC count (4 last bits)
- */
- csrc_count = (*pdata & 0x0F);
- if(size <(tsk_size_t)TRTP_RTP_HEADER_MIN_SIZE + (csrc_count << 2)){
- TSK_DEBUG_ERROR("Too short to contain RTP header");
- return tsk_null;
- }
-
- if(!(header = trtp_rtp_header_create_null())){
- TSK_DEBUG_ERROR("Failed to create new RTP header");
- return tsk_null;
- }
-
- /* version (2bits) */
- header->version = (*pdata >> 6);
- /* Padding (1bit) */
- header->padding = ((*pdata >>5) & 0x01);
- /* Extension (1bit) */
- header->extension = ((*pdata >>4) & 0x01);
- /* CSRC Count (4bits) */
- header->csrc_count = csrc_count;
- // skip octet
- ++pdata;
-
- /* Marker (1bit) */
- header->marker = (*pdata >> 7);
- /* Payload Type (7bits) */
- header->payload_type = (*pdata & 0x7F);
- // skip octet
- ++pdata;
-
- /* Sequence Number (16bits) */
- header->seq_num = pdata[0] << 8 | pdata[1];
- // skip octets
- pdata += 2;
-
- /* timestamp (32bits) */
- header->timestamp = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
- // skip octets
- pdata += 4;
-
- /* synchronization source (SSRC) identifier (32bits) */
- header->ssrc = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
- // skip octets
- pdata += 4;
-
- /* contributing source (CSRC) identifiers */
- for(i=0; i<csrc_count; i++, pdata += 4){
- header->csrc[i] = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
- }
-
- return header;
+ trtp_rtp_header_t* header = tsk_null;
+ const uint8_t* pdata = (const uint8_t*)data;
+ uint8_t csrc_count, i;
+
+ if(!data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(size <TRTP_RTP_HEADER_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short to contain RTP header");
+ return tsk_null;
+ }
+
+ /* Before starting to deserialize, get the "csrc_count" and check the length validity
+ * CSRC count (4 last bits)
+ */
+ csrc_count = (*pdata & 0x0F);
+ if(size <(tsk_size_t)TRTP_RTP_HEADER_MIN_SIZE + (csrc_count << 2)) {
+ TSK_DEBUG_ERROR("Too short to contain RTP header");
+ return tsk_null;
+ }
+
+ if(!(header = trtp_rtp_header_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create new RTP header");
+ return tsk_null;
+ }
+
+ /* version (2bits) */
+ header->version = (*pdata >> 6);
+ /* Padding (1bit) */
+ header->padding = ((*pdata >>5) & 0x01);
+ /* Extension (1bit) */
+ header->extension = ((*pdata >>4) & 0x01);
+ /* CSRC Count (4bits) */
+ header->csrc_count = csrc_count;
+ // skip octet
+ ++pdata;
+
+ /* Marker (1bit) */
+ header->marker = (*pdata >> 7);
+ /* Payload Type (7bits) */
+ header->payload_type = (*pdata & 0x7F);
+ // skip octet
+ ++pdata;
+
+ /* Sequence Number (16bits) */
+ header->seq_num = pdata[0] << 8 | pdata[1];
+ // skip octets
+ pdata += 2;
+
+ /* timestamp (32bits) */
+ header->timestamp = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
+ // skip octets
+ pdata += 4;
+
+ /* synchronization source (SSRC) identifier (32bits) */
+ header->ssrc = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
+ // skip octets
+ pdata += 4;
+
+ /* contributing source (CSRC) identifiers */
+ for(i=0; i<csrc_count; i++, pdata += 4) {
+ header->csrc[i] = pdata[0] << 24 | pdata[1] << 16 | pdata[2] << 8 | pdata[3];
+ }
+
+ return header;
}
@@ -234,26 +234,25 @@ trtp_rtp_header_t* trtp_rtp_header_deserialize(const void *data, tsk_size_t size
//
static tsk_object_t* trtp_rtp_header_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtp_header_t *header = self;
- if(header){
- }
- return self;
+ trtp_rtp_header_t *header = self;
+ if(header) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtp_header_dtor(tsk_object_t * self)
-{
- trtp_rtp_header_t *header = self;
- if(header){
- }
+{
+ trtp_rtp_header_t *header = self;
+ if(header) {
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_rtp_header_def_s =
-{
- sizeof(trtp_rtp_header_t),
- trtp_rtp_header_ctor,
- trtp_rtp_header_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_rtp_header_def_s = {
+ sizeof(trtp_rtp_header_t),
+ trtp_rtp_header_ctor,
+ trtp_rtp_header_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_rtp_header_def_t = &trtp_rtp_header_def_s;
diff --git a/tinyRTP/src/rtp/trtp_rtp_packet.c b/tinyRTP/src/rtp/trtp_rtp_packet.c
index dc5c7ea..4d10023 100755
--- a/tinyRTP/src/rtp/trtp_rtp_packet.c
+++ b/tinyRTP/src/rtp/trtp_rtp_packet.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,46 +38,46 @@
/** Create new RTP packet */
trtp_rtp_packet_t* trtp_rtp_packet_create_null()
{
- return tsk_object_new(trtp_rtp_packet_def_t);
+ return tsk_object_new(trtp_rtp_packet_def_t);
}
trtp_rtp_packet_t* trtp_rtp_packet_create(uint32_t ssrc, uint16_t seq_num, uint32_t timestamp, uint8_t payload_type, tsk_bool_t marker)
{
- trtp_rtp_packet_t* packet;
- if((packet = tsk_object_new(trtp_rtp_packet_def_t))){
- packet->header = trtp_rtp_header_create(ssrc, seq_num, timestamp, payload_type, marker);
- }
- return packet;
+ trtp_rtp_packet_t* packet;
+ if((packet = tsk_object_new(trtp_rtp_packet_def_t))) {
+ packet->header = trtp_rtp_header_create(ssrc, seq_num, timestamp, payload_type, marker);
+ }
+ return packet;
}
trtp_rtp_packet_t* trtp_rtp_packet_create_2(const trtp_rtp_header_t* header)
{
- trtp_rtp_packet_t* packet;
-
- if(!header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if((packet = tsk_object_new(trtp_rtp_packet_def_t))){
- packet->header = tsk_object_ref(TSK_OBJECT(header));
- }
- return packet;
+ trtp_rtp_packet_t* packet;
+
+ if(!header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if((packet = tsk_object_new(trtp_rtp_packet_def_t))) {
+ packet->header = tsk_object_ref(TSK_OBJECT(header));
+ }
+ return packet;
}
/* guess what is the minimum required size to serialize the packet */
tsk_size_t trtp_rtp_packet_guess_serialbuff_size(const trtp_rtp_packet_t *self)
-{
- tsk_size_t size = 0;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- size += trtp_rtp_header_guess_serialbuff_size(self->header);
- if(self->extension.data && self->extension.size && self->header->extension){
- size += self->extension.size;
- }
- size += self->payload.size;
- return size;
+{
+ tsk_size_t size = 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ size += trtp_rtp_header_guess_serialbuff_size(self->header);
+ if(self->extension.data && self->extension.size && self->header->extension) {
+ size += self->extension.size;
+ }
+ size += self->payload.size;
+ return size;
}
/* serialize the RTP packet to a buffer */
@@ -85,27 +85,27 @@ tsk_size_t trtp_rtp_packet_guess_serialbuff_size(const trtp_rtp_packet_t *self)
// returns the number of written bytes
tsk_size_t trtp_rtp_packet_serialize_to(const trtp_rtp_packet_t *self, void* buffer, tsk_size_t size)
{
- tsk_size_t ret;
- tsk_size_t s;
- uint8_t* pbuff = (uint8_t*)buffer;
-
- if(!buffer || (size < (ret = trtp_rtp_packet_guess_serialbuff_size(self)))){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- s = trtp_rtp_header_serialize_to(self->header, pbuff, size);
- pbuff += s;
-
- /* extension */
- if(self->extension.data && self->extension.size && self->header->extension){
- memcpy(pbuff, self->extension.data, self->extension.size);
- pbuff += self->extension.size;
- }
- /* append payload */
- memcpy(pbuff, self->payload.data_const ? self->payload.data_const : self->payload.data, self->payload.size);
-
- return ret;
+ tsk_size_t ret;
+ tsk_size_t s;
+ uint8_t* pbuff = (uint8_t*)buffer;
+
+ if(!buffer || (size < (ret = trtp_rtp_packet_guess_serialbuff_size(self)))) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ s = trtp_rtp_header_serialize_to(self->header, pbuff, size);
+ pbuff += s;
+
+ /* extension */
+ if(self->extension.data && self->extension.size && self->header->extension) {
+ memcpy(pbuff, self->extension.data, self->extension.size);
+ pbuff += self->extension.size;
+ }
+ /* append payload */
+ memcpy(pbuff, self->payload.data_const ? self->payload.data_const : self->payload.data, self->payload.size);
+
+ return ret;
}
/** Serialize rtp packet object into binary buffer */
@@ -113,98 +113,100 @@ tsk_size_t trtp_rtp_packet_serialize_to(const trtp_rtp_packet_t *self, void* buf
// the padding bytes will not be added to the final buffer size
tsk_buffer_t* trtp_rtp_packet_serialize(const trtp_rtp_packet_t *self, tsk_size_t num_bytes_pad)
{
- tsk_buffer_t* buffer = tsk_null;
- tsk_size_t size;
-
- if(!self || !self->header){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- size = (trtp_rtp_packet_guess_serialbuff_size(self) + num_bytes_pad);
- if(size & 0x03) size += (4 - (size & 0x03));
-
- if(!(buffer = tsk_buffer_create(tsk_null, size))){
- TSK_DEBUG_ERROR("Failed to create buffer with size = %u", (unsigned)size);
- return tsk_null;
- }
- // shorten the buffer to hide the padding
- buffer->size = trtp_rtp_packet_serialize_to(self, buffer->data, buffer->size);
- return buffer;
+ tsk_buffer_t* buffer = tsk_null;
+ tsk_size_t size;
+
+ if(!self || !self->header) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ size = (trtp_rtp_packet_guess_serialbuff_size(self) + num_bytes_pad);
+ if(size & 0x03) {
+ size += (4 - (size & 0x03));
+ }
+
+ if(!(buffer = tsk_buffer_create(tsk_null, size))) {
+ TSK_DEBUG_ERROR("Failed to create buffer with size = %u", (unsigned)size);
+ return tsk_null;
+ }
+ // shorten the buffer to hide the padding
+ buffer->size = trtp_rtp_packet_serialize_to(self, buffer->data, buffer->size);
+ return buffer;
}
/** Deserialize rtp packet object from binary buffer */
trtp_rtp_packet_t* trtp_rtp_packet_deserialize(const void *data, tsk_size_t size)
{
- trtp_rtp_packet_t* packet = tsk_null;
- trtp_rtp_header_t *header;
- tsk_size_t payload_size;
- const uint8_t* pdata = data;
-
- if(!data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(size< TRTP_RTP_HEADER_MIN_SIZE){
- TSK_DEBUG_ERROR("Too short to contain RTP message");
- return tsk_null;
- }
-
- /* deserialize the RTP header (the packet itsel will be deserialized only if the header deserialization succeed) */
- if(!(header = trtp_rtp_header_deserialize(data, size))){
- TSK_DEBUG_ERROR("Failed to deserialize RTP header");
- return tsk_null;
- }
- else{
- /* create the packet */
- if(!(packet = trtp_rtp_packet_create_null())){
- TSK_DEBUG_ERROR("Failed to create new RTP packet");
- TSK_OBJECT_SAFE_FREE(header);
- return tsk_null;
- }
- /* set the header */
- packet->header = header,
- header = tsk_null;
-
- /* do not need to check overflow (have been done by trtp_rtp_header_deserialize()) */
- payload_size = (size - TRTP_RTP_HEADER_MIN_SIZE - (packet->header->csrc_count << 2));
- pdata = ((const uint8_t*)data) + (size - payload_size);
-
- /* RFC 3550 - 5.3.1 RTP Header Extension
- If the X bit in the RTP header is one, a variable-length header
- extension MUST be appended to the RTP header, following the CSRC list
- if present. The header extension contains a 16-bit length field that
- counts the number of 32-bit words in the extension, excluding the
- four-octet extension header (therefore zero is a valid length). Only
- a single extension can be appended to the RTP data header.
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | defined by profile | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | header extension |
- | .... |
- */
- if(packet->header->extension && payload_size>=4 /* extension min-size */){
- packet->extension.size = 4 /* first two 16-bit fields */ + (tnet_ntohs(*((uint16_t*)&pdata[2])) << 2/*words(32-bit)*/);
- if((packet->extension.data = tsk_calloc(packet->extension.size, sizeof(uint8_t)))){
- memcpy(packet->extension.data, pdata, packet->extension.size);
- }
- payload_size -= packet->extension.size;
- }
-
- packet->payload.size = payload_size;
- if(payload_size && (packet->payload.data = tsk_calloc(packet->payload.size, sizeof(uint8_t)))){
- memcpy(packet->payload.data, (pdata + packet->extension.size), packet->payload.size);
- }
- else{
- TSK_DEBUG_ERROR("Failed to allocate new buffer");
- packet->payload.size = 0;
- }
- }
-
- return packet;
+ trtp_rtp_packet_t* packet = tsk_null;
+ trtp_rtp_header_t *header;
+ tsk_size_t payload_size;
+ const uint8_t* pdata = data;
+
+ if(!data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(size< TRTP_RTP_HEADER_MIN_SIZE) {
+ TSK_DEBUG_ERROR("Too short to contain RTP message");
+ return tsk_null;
+ }
+
+ /* deserialize the RTP header (the packet itsel will be deserialized only if the header deserialization succeed) */
+ if(!(header = trtp_rtp_header_deserialize(data, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize RTP header");
+ return tsk_null;
+ }
+ else {
+ /* create the packet */
+ if(!(packet = trtp_rtp_packet_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create new RTP packet");
+ TSK_OBJECT_SAFE_FREE(header);
+ return tsk_null;
+ }
+ /* set the header */
+ packet->header = header,
+ header = tsk_null;
+
+ /* do not need to check overflow (have been done by trtp_rtp_header_deserialize()) */
+ payload_size = (size - TRTP_RTP_HEADER_MIN_SIZE - (packet->header->csrc_count << 2));
+ pdata = ((const uint8_t*)data) + (size - payload_size);
+
+ /* RFC 3550 - 5.3.1 RTP Header Extension
+ If the X bit in the RTP header is one, a variable-length header
+ extension MUST be appended to the RTP header, following the CSRC list
+ if present. The header extension contains a 16-bit length field that
+ counts the number of 32-bit words in the extension, excluding the
+ four-octet extension header (therefore zero is a valid length). Only
+ a single extension can be appended to the RTP data header.
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | defined by profile | length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | header extension |
+ | .... |
+ */
+ if(packet->header->extension && payload_size>=4 /* extension min-size */) {
+ packet->extension.size = 4 /* first two 16-bit fields */ + (tnet_ntohs(*((uint16_t*)&pdata[2])) << 2/*words(32-bit)*/);
+ if((packet->extension.data = tsk_calloc(packet->extension.size, sizeof(uint8_t)))) {
+ memcpy(packet->extension.data, pdata, packet->extension.size);
+ }
+ payload_size -= packet->extension.size;
+ }
+
+ packet->payload.size = payload_size;
+ if(payload_size && (packet->payload.data = tsk_calloc(packet->payload.size, sizeof(uint8_t)))) {
+ memcpy(packet->payload.data, (pdata + packet->extension.size), packet->payload.size);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to allocate new buffer");
+ packet->payload.size = 0;
+ }
+ }
+
+ return packet;
}
@@ -220,41 +222,44 @@ trtp_rtp_packet_t* trtp_rtp_packet_deserialize(const void *data, tsk_size_t size
//
static tsk_object_t* trtp_rtp_packet_ctor(tsk_object_t * self, va_list * app)
{
- trtp_rtp_packet_t *packet = self;
- if(packet){
- }
- return self;
+ trtp_rtp_packet_t *packet = self;
+ if(packet) {
+ }
+ return self;
}
static tsk_object_t* trtp_rtp_packet_dtor(tsk_object_t * self)
-{
- trtp_rtp_packet_t *packet = self;
- if(packet){
- TSK_OBJECT_SAFE_FREE(packet->header);
- TSK_FREE(packet->payload.data);
- TSK_FREE(packet->extension.data);
- packet->payload.data_const = tsk_null;
- }
-
- return self;
+{
+ trtp_rtp_packet_t *packet = self;
+ if(packet) {
+ TSK_OBJECT_SAFE_FREE(packet->header);
+ TSK_FREE(packet->payload.data);
+ TSK_FREE(packet->extension.data);
+ packet->payload.data_const = tsk_null;
+ }
+
+ return self;
}
// comparison must be by sequence number because of the jb
static int trtp_rtp_packet_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
{
- const trtp_rtp_packet_t *p1 = _p1;
- const trtp_rtp_packet_t *p2 = _p2;
-
- if(p1 && p1->header && p2 && p2->header){
- return (int)(p1->header->seq_num - p2->header->seq_num);
- }
- else if(!p1 && !p2) return 0;
- else return -1;
+ const trtp_rtp_packet_t *p1 = _p1;
+ const trtp_rtp_packet_t *p2 = _p2;
+
+ if(p1 && p1->header && p2 && p2->header) {
+ return (int)(p1->header->seq_num - p2->header->seq_num);
+ }
+ else if(!p1 && !p2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t trtp_rtp_packet_def_s =
-{
- sizeof(trtp_rtp_packet_t),
- trtp_rtp_packet_ctor,
- trtp_rtp_packet_dtor,
- trtp_rtp_packet_cmp,
+static const tsk_object_def_t trtp_rtp_packet_def_s = {
+ sizeof(trtp_rtp_packet_t),
+ trtp_rtp_packet_ctor,
+ trtp_rtp_packet_dtor,
+ trtp_rtp_packet_cmp,
};
const tsk_object_def_t *trtp_rtp_packet_def_t = &trtp_rtp_packet_def_s;
diff --git a/tinyRTP/src/rtp/trtp_rtp_session.c b/tinyRTP/src/rtp/trtp_rtp_session.c
index 3ebfe03..919a888 100755
--- a/tinyRTP/src/rtp/trtp_rtp_session.c
+++ b/tinyRTP/src/rtp/trtp_rtp_session.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/src/trtp.c b/tinyRTP/src/trtp.c
index a0150d9..6581304 100755
--- a/tinyRTP/src/trtp.c
+++ b/tinyRTP/src/trtp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyRTP/src/trtp_manager.c b/tinyRTP/src/trtp_manager.c
index 70968d3..16aeab1 100755
--- a/tinyRTP/src/trtp_manager.c
+++ b/tinyRTP/src/trtp_manager.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -86,381 +86,388 @@ static int _trtp_manager_srtp_start(trtp_manager_t* self, tmedia_srtp_type_t srt
/* ======================= Transport callback ========================== */
static int _trtp_transport_layer_cb(const tnet_transport_event_t* e)
{
- trtp_manager_t* manager = (trtp_manager_t*)e->callback_data;
-
- switch(e->type){
- case event_data:
- {
- return _trtp_manager_recv_data(manager, e->data, e->size, e->local_fd, &e->remote_addr);
- }
- case event_brokenpipe:
- {
- tnet_fd_t broken_fd;
- tnet_socket_t* socket;
- tsk_bool_t is_rtcp_socket;
-
- tsk_safeobj_lock(manager);
- broken_fd = e->local_fd;
- socket = tsk_null;
- is_rtcp_socket = tsk_false;
-
- if (manager->transport && manager->transport->master && manager->transport->master->fd == broken_fd) {
- socket = manager->transport->master;
- }
- else if (manager->rtcp.local_socket && manager->rtcp.local_socket->fd == broken_fd) {
- socket = manager->rtcp.local_socket;
- is_rtcp_socket = tsk_true;
+ trtp_manager_t* manager = (trtp_manager_t*)e->callback_data;
+
+ switch(e->type) {
+ case event_data: {
+ return _trtp_manager_recv_data(manager, e->data, e->size, e->local_fd, &e->remote_addr);
+ }
+ case event_brokenpipe: {
+ tnet_fd_t broken_fd;
+ tnet_socket_t* socket;
+ tsk_bool_t is_rtcp_socket;
+
+ tsk_safeobj_lock(manager);
+ broken_fd = e->local_fd;
+ socket = tsk_null;
+ is_rtcp_socket = tsk_false;
+
+ if (manager->transport && manager->transport->master && manager->transport->master->fd == broken_fd) {
+ socket = manager->transport->master;
+ }
+ else if (manager->rtcp.local_socket && manager->rtcp.local_socket->fd == broken_fd) {
+ socket = manager->rtcp.local_socket;
+ is_rtcp_socket = tsk_true;
+ }
+ if (socket) {
+ tsk_bool_t registered_fd = !!tnet_transport_have_socket(manager->transport, broken_fd);
+ if (registered_fd) {
+ tnet_transport_remove_socket(manager->transport, &broken_fd); // broken_fd=-1
+ broken_fd = e->local_fd; // restore
+ }
+ if (tnet_socket_handle_brokenpipe(socket) == 0) {
+ if (registered_fd) {
+ tnet_transport_add_socket(manager->transport, socket->fd, socket->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null);
}
- if (socket) {
- tsk_bool_t registered_fd = !!tnet_transport_have_socket(manager->transport, broken_fd);
- if (registered_fd) {
- tnet_transport_remove_socket(manager->transport, &broken_fd); // broken_fd=-1
- broken_fd = e->local_fd; // restore
- }
- if (tnet_socket_handle_brokenpipe(socket) == 0) {
- if (registered_fd) {
- tnet_transport_add_socket(manager->transport, socket->fd, socket->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null);
- }
- if (manager->rtcp.session && trtp_rtcp_session_get_local_fd(manager->rtcp.session) == broken_fd) {
- trtp_rtcp_session_set_local_fd(manager->rtcp.session, socket->fd);
- }
- }
+ if (manager->rtcp.session && trtp_rtcp_session_get_local_fd(manager->rtcp.session) == broken_fd) {
+ trtp_rtcp_session_set_local_fd(manager->rtcp.session, socket->fd);
}
- tsk_safeobj_unlock(manager);
- return 0;
}
+ }
+ tsk_safeobj_unlock(manager);
+ return 0;
+ }
#if HAVE_SRTP
- /* DTLS - SRTP events */
- case event_dtls_handshake_succeed:
- {
- const tnet_socket_t* socket = manager->transport && manager->transport->master && (manager->transport->master->fd == e->local_fd)
- ? manager->transport->master
- : ((manager->rtcp.local_socket && manager->rtcp.local_socket->fd == e->local_fd) ? manager->rtcp.local_socket : tsk_null);
- if(!socket){
- TSK_DEBUG_ERROR("DTLS data from unknown socket");
- break;
- }
-
- if (!manager->dtls.srtp_handshake_succeed) {
- manager->dtls.srtp_handshake_succeed = (socket == manager->transport->master);
- }
- if (!manager->dtls.srtcp_handshake_succeed) {
- manager->dtls.srtcp_handshake_succeed = (socket == manager->rtcp.local_socket) || _trtp_manager_is_rtcpmux_active(manager);
- }
-
- TSK_DEBUG_INFO("dtls.srtp_handshake_succeed=%d, dtls.srtcp_handshake_succeed=%d", manager->dtls.srtp_handshake_succeed, manager->dtls.srtcp_handshake_succeed);
- TSK_DEBUG_INFO("DTLS-DTLS-SRTP socket [%s]:%d handshake succeed", socket->ip, socket->port);
-
- if(manager->dtls.srtp_handshake_succeed && manager->dtls.srtcp_handshake_succeed){
- // alter listeners
- if(manager->dtls.cb.fun){
- manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_handshake_succeed, "DTLS handshake succeed");
- }
- }
- break;
- }
- case event_dtls_fingerprint_mismatch:
- case event_dtls_handshake_failed:
- case event_dtls_error:
- {
- // alter listeners
- if(manager->dtls.cb.fun){
- const char* reason = (e->type == event_dtls_fingerprint_mismatch)
- ? "DTLS-SRTP fingerprint mismatch"
- : (e->type == event_dtls_handshake_failed ? "DTLS-SRTP handshake failed" : "DTLS error");
- manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_handshake_failed, reason);
- }
- break;
- }
- case event_dtls_srtp_data:
- {
- /* KEY||SALT */
- /* rfc 5764 - 4.2. Key Derivation */
- tsk_bool_t is_rtp = (manager->transport->master && manager->transport->master->fd == e->local_fd);
- tsk_bool_t is_rtcp = (manager->rtcp.local_socket && manager->rtcp.local_socket->fd == e->local_fd);
- if(is_rtp || is_rtcp){
- unsigned int master_salt_length, master_key_length;
-
+ /* DTLS - SRTP events */
+ case event_dtls_handshake_succeed: {
+ const tnet_socket_t* socket = manager->transport && manager->transport->master && (manager->transport->master->fd == e->local_fd)
+ ? manager->transport->master
+ : ((manager->rtcp.local_socket && manager->rtcp.local_socket->fd == e->local_fd) ? manager->rtcp.local_socket : tsk_null);
+ if(!socket) {
+ TSK_DEBUG_ERROR("DTLS data from unknown socket");
+ break;
+ }
+
+ if (!manager->dtls.srtp_handshake_succeed) {
+ manager->dtls.srtp_handshake_succeed = (socket == manager->transport->master);
+ }
+ if (!manager->dtls.srtcp_handshake_succeed) {
+ manager->dtls.srtcp_handshake_succeed = (socket == manager->rtcp.local_socket) || _trtp_manager_is_rtcpmux_active(manager);
+ }
+
+ TSK_DEBUG_INFO("dtls.srtp_handshake_succeed=%d, dtls.srtcp_handshake_succeed=%d", manager->dtls.srtp_handshake_succeed, manager->dtls.srtcp_handshake_succeed);
+ TSK_DEBUG_INFO("DTLS-DTLS-SRTP socket [%s]:%d handshake succeed", socket->ip, socket->port);
+
+ if(manager->dtls.srtp_handshake_succeed && manager->dtls.srtcp_handshake_succeed) {
+ // alter listeners
+ if(manager->dtls.cb.fun) {
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_handshake_succeed, "DTLS handshake succeed");
+ }
+ }
+ break;
+ }
+ case event_dtls_fingerprint_mismatch:
+ case event_dtls_handshake_failed:
+ case event_dtls_error: {
+ // alter listeners
+ if(manager->dtls.cb.fun) {
+ const char* reason = (e->type == event_dtls_fingerprint_mismatch)
+ ? "DTLS-SRTP fingerprint mismatch"
+ : (e->type == event_dtls_handshake_failed ? "DTLS-SRTP handshake failed" : "DTLS error");
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_handshake_failed, reason);
+ }
+ break;
+ }
+ case event_dtls_srtp_data: {
+ /* KEY||SALT */
+ /* rfc 5764 - 4.2. Key Derivation */
+ tsk_bool_t is_rtp = (manager->transport->master && manager->transport->master->fd == e->local_fd);
+ tsk_bool_t is_rtcp = (manager->rtcp.local_socket && manager->rtcp.local_socket->fd == e->local_fd);
+ if(is_rtp || is_rtcp) {
+ unsigned int master_salt_length, master_key_length;
+
#if HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH
- master_key_length = srtp_profile_get_master_key_length(manager->dtls.crypto_selected == HMAC_SHA1_32 ? srtp_profile_aes128_cm_sha1_32 : srtp_profile_aes128_cm_sha1_80);
+ master_key_length = srtp_profile_get_master_key_length(manager->dtls.crypto_selected == HMAC_SHA1_32 ? srtp_profile_aes128_cm_sha1_32 : srtp_profile_aes128_cm_sha1_80);
#else
- master_key_length = (128 >> 3); // cipher_key_length - rfc5764 4.1.2. SRTP Protection Profiles
+ master_key_length = (128 >> 3); // cipher_key_length - rfc5764 4.1.2. SRTP Protection Profiles
#endif
#if HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH
- master_salt_length = srtp_profile_get_master_salt_length(manager->dtls.crypto_selected == HMAC_SHA1_32 ? srtp_profile_aes128_cm_sha1_32 : srtp_profile_aes128_cm_sha1_80);
+ master_salt_length = srtp_profile_get_master_salt_length(manager->dtls.crypto_selected == HMAC_SHA1_32 ? srtp_profile_aes128_cm_sha1_32 : srtp_profile_aes128_cm_sha1_80);
#else
- master_salt_length = (112 >> 3); // cipher_salt_length - rfc5764 4.1.2. SRTP Protection Profiles
+ master_salt_length = (112 >> 3); // cipher_salt_length - rfc5764 4.1.2. SRTP Protection Profiles
#endif
- if(((master_key_length + master_salt_length) << 1) > e->size){
- TSK_DEBUG_ERROR("%d not a valid size for this profile", (int)e->size);
- }
- else{
- int ret;
- const uint8_t* data_ptr = e->data;
- const uint8_t *lk, *ls, *rk, *rs;
- if(manager->dtls.local.setup == tnet_dtls_setup_passive){
- rk = &data_ptr[0];
- lk = rk + master_key_length;
- rs = (lk + master_key_length);
- ls = (rs + master_salt_length);
- }
- else{
- lk = &data_ptr[0];
- rk = lk + master_key_length;
- ls = (rk + master_key_length);
- rs = (ls + master_salt_length);
- }
- // set key||salt
- if((ret = trtp_srtp_set_key_and_salt_remote(manager, manager->dtls.crypto_selected, rk, master_key_length, rs, master_salt_length, is_rtp))){
- if(manager->dtls.cb.fun) manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set remote DTSL-SRTP key||salt");
- return ret;
- }
- if((ret = trtp_srtp_set_key_and_salt_local(manager, manager->dtls.crypto_selected, lk, master_key_length, ls, master_salt_length, is_rtp))){
- if(manager->dtls.cb.fun) manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set local DTSL-SRTP key||salt");
- return ret;
- }
-
- if(is_rtp){
- manager->dtls.srtp_connected = manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][manager->dtls.crypto_selected].rtp.initialized;
- if(_trtp_manager_is_rtcpmux_active(manager)){
- manager->dtls.srtcp_connected = tsk_true;
- }
- }
- else{ // rtcp
- manager->dtls.srtcp_connected = manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][manager->dtls.crypto_selected].rtcp.initialized;
- }
- TSK_DEBUG_INFO("dtls.srtp_connected=%d, dtls.srtcp_connected=%d", manager->dtls.srtp_connected, manager->dtls.srtcp_connected);
-
- if(manager->dtls.srtp_connected && manager->dtls.srtcp_connected){
- // start DTLS-SRTP
- if((ret = _trtp_manager_srtp_start(manager, manager->srtp_type))){
- if(manager->dtls.cb.fun) manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set start DTSL-SRTP engine");
- return ret;
- }
-
- TSK_DEBUG_INFO("!!DTLS-SRTP started!!");
-
- // alter listeners
- if(manager->dtls.cb.fun){
- manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_started, "DTLS started");
- }
- }
- }
- }
-
- break;
- }
- case event_dtls_srtp_profile_selected:
- {
- if(manager->transport->master && manager->transport->master->fd == e->local_fd){
- /* Only (SRTP_AES128_CM_SHA1_80 | SRTP_AES128_CM_SHA1_32) because of _trtp_manager_srtp_activate() */
- TSK_DEBUG_INFO("event_dtls_srtp_profile_selected: %.*s", 22, (const char*)e->data);
- manager->dtls.crypto_selected = HMAC_SHA1_80;
- if(tsk_strnequals(e->data, "SRTP_AES128_CM_SHA1_32", 22)){
- manager->dtls.crypto_selected = HMAC_SHA1_32;
- }
- }
- break;
- }
+ if(((master_key_length + master_salt_length) << 1) > e->size) {
+ TSK_DEBUG_ERROR("%d not a valid size for this profile", (int)e->size);
+ }
+ else {
+ int ret;
+ const uint8_t* data_ptr = e->data;
+ const uint8_t *lk, *ls, *rk, *rs;
+ if(manager->dtls.local.setup == tnet_dtls_setup_passive) {
+ rk = &data_ptr[0];
+ lk = rk + master_key_length;
+ rs = (lk + master_key_length);
+ ls = (rs + master_salt_length);
+ }
+ else {
+ lk = &data_ptr[0];
+ rk = lk + master_key_length;
+ ls = (rk + master_key_length);
+ rs = (ls + master_salt_length);
+ }
+ // set key||salt
+ if((ret = trtp_srtp_set_key_and_salt_remote(manager, manager->dtls.crypto_selected, rk, master_key_length, rs, master_salt_length, is_rtp))) {
+ if(manager->dtls.cb.fun) {
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set remote DTSL-SRTP key||salt");
+ }
+ return ret;
+ }
+ if((ret = trtp_srtp_set_key_and_salt_local(manager, manager->dtls.crypto_selected, lk, master_key_length, ls, master_salt_length, is_rtp))) {
+ if(manager->dtls.cb.fun) {
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set local DTSL-SRTP key||salt");
+ }
+ return ret;
+ }
+
+ if(is_rtp) {
+ manager->dtls.srtp_connected = manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][manager->dtls.crypto_selected].rtp.initialized;
+ if(_trtp_manager_is_rtcpmux_active(manager)) {
+ manager->dtls.srtcp_connected = tsk_true;
+ }
+ }
+ else { // rtcp
+ manager->dtls.srtcp_connected = manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][manager->dtls.crypto_selected].rtcp.initialized;
+ }
+ TSK_DEBUG_INFO("dtls.srtp_connected=%d, dtls.srtcp_connected=%d", manager->dtls.srtp_connected, manager->dtls.srtcp_connected);
+
+ if(manager->dtls.srtp_connected && manager->dtls.srtcp_connected) {
+ // start DTLS-SRTP
+ if((ret = _trtp_manager_srtp_start(manager, manager->srtp_type))) {
+ if(manager->dtls.cb.fun) {
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_fatal_error, "Failed to set start DTSL-SRTP engine");
+ }
+ return ret;
+ }
+
+ TSK_DEBUG_INFO("!!DTLS-SRTP started!!");
+
+ // alter listeners
+ if(manager->dtls.cb.fun) {
+ manager->dtls.cb.fun(manager->dtls.cb.usrdata, trtp_srtp_dtls_event_type_started, "DTLS started");
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ case event_dtls_srtp_profile_selected: {
+ if(manager->transport->master && manager->transport->master->fd == e->local_fd) {
+ /* Only (SRTP_AES128_CM_SHA1_80 | SRTP_AES128_CM_SHA1_32) because of _trtp_manager_srtp_activate() */
+ TSK_DEBUG_INFO("event_dtls_srtp_profile_selected: %.*s", 22, (const char*)e->data);
+ manager->dtls.crypto_selected = HMAC_SHA1_80;
+ if(tsk_strnequals(e->data, "SRTP_AES128_CM_SHA1_32", 22)) {
+ manager->dtls.crypto_selected = HMAC_SHA1_32;
+ }
+ }
+ break;
+ }
#endif /* HAVE_SRTP */
- case event_connected:
- case event_closed:
- {
-
- break;
- }
- default:
- break;
- }
- return 0;
+ case event_connected:
+ case event_closed: {
+
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
}
static int _trtp_transport_dtls_handshaking_timer_cb(const void* arg, tsk_timer_id_t timer_id)
{
- int ret = 0;
+ int ret = 0;
#if HAVE_SRTP
- trtp_manager_t* manager = (trtp_manager_t*)arg;
-
- tsk_safeobj_lock(manager);
- if (manager->is_started && manager->dtls.timer_hanshaking.id == timer_id && manager->srtp_state == trtp_srtp_state_activated && manager->srtp_type == tmedia_srtp_type_dtls) {
- // retry DTLS-SRTP handshaking if srtp-type is DTLS-SRTP and the engine is activated
- struct tnet_socket_s* sockets[] = { manager->dtls.srtp_connected ? tsk_null : manager->transport->master , manager->dtls.srtcp_connected ? tsk_null : manager->rtcp.local_socket };
- const struct sockaddr_storage* remote_addrs[] = { &manager->rtp.remote_addr, &manager->rtcp.remote_addr };
- TSK_DEBUG_INFO("_trtp_transport_dtls_handshaking_timer_cb(timeout=%llu)", manager->dtls.timer_hanshaking.timeout);
- tnet_transport_dtls_do_handshake(manager->transport, sockets, 2, remote_addrs, 2);
- if (manager->is_ice_turn_active) {
- // means TURN is active and handshaking data must be sent using this channel
- const void* data[] = { tsk_null, tsk_null };
- tsk_size_t size[] = { 0, 0 };
- if ((ret = tnet_transport_dtls_get_handshakingdata(manager->transport, (const struct tnet_socket_s**)sockets, 2, data, size))) {
- return ret;
- }
- if (data[0] && size[0]) {
- ret = _trtp_manager_send_turn_dtls_rtp(manager->ice_ctx, data[0], size[0]);
- }
- if (data[1] && size[1]) {
- ret = _trtp_manager_send_turn_dtls_rtcp(manager->ice_ctx, data[1], size[1]);
- }
- }
- // increase timeout
- manager->dtls.timer_hanshaking.timeout += (TRTP_DTLS_HANDSHAKING_TIMEOUT >> 1);
- if ((manager->dtls.timer_hanshaking.timeout < TRTP_DTLS_HANDSHAKING_TIMEOUT_MAX) && !(manager->dtls.srtp_connected && manager->dtls.srtcp_connected)) {
- manager->dtls.timer_hanshaking.id = tsk_timer_manager_schedule(manager->timer_mgr_global, manager->dtls.timer_hanshaking.timeout, _trtp_transport_dtls_handshaking_timer_cb, manager);
- }
- else {
- manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID; // invalidate timer id (not required but should be done by good citizen)
- manager->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT; // reset timeout
- }
- }
- tsk_safeobj_unlock(manager);
+ trtp_manager_t* manager = (trtp_manager_t*)arg;
+
+ tsk_safeobj_lock(manager);
+ if (manager->is_started && manager->dtls.timer_hanshaking.id == timer_id && manager->srtp_state == trtp_srtp_state_activated && manager->srtp_type == tmedia_srtp_type_dtls) {
+ // retry DTLS-SRTP handshaking if srtp-type is DTLS-SRTP and the engine is activated
+ struct tnet_socket_s* sockets[] = { manager->dtls.srtp_connected ? tsk_null : manager->transport->master , manager->dtls.srtcp_connected ? tsk_null : manager->rtcp.local_socket };
+ const struct sockaddr_storage* remote_addrs[] = { &manager->rtp.remote_addr, &manager->rtcp.remote_addr };
+ TSK_DEBUG_INFO("_trtp_transport_dtls_handshaking_timer_cb(timeout=%llu)", manager->dtls.timer_hanshaking.timeout);
+ tnet_transport_dtls_do_handshake(manager->transport, sockets, 2, remote_addrs, 2);
+ if (manager->is_ice_turn_active) {
+ // means TURN is active and handshaking data must be sent using this channel
+ const void* data[] = { tsk_null, tsk_null };
+ tsk_size_t size[] = { 0, 0 };
+ if ((ret = tnet_transport_dtls_get_handshakingdata(manager->transport, (const struct tnet_socket_s**)sockets, 2, data, size))) {
+ return ret;
+ }
+ if (data[0] && size[0]) {
+ ret = _trtp_manager_send_turn_dtls_rtp(manager->ice_ctx, data[0], size[0]);
+ }
+ if (data[1] && size[1]) {
+ ret = _trtp_manager_send_turn_dtls_rtcp(manager->ice_ctx, data[1], size[1]);
+ }
+ }
+ // increase timeout
+ manager->dtls.timer_hanshaking.timeout += (TRTP_DTLS_HANDSHAKING_TIMEOUT >> 1);
+ if ((manager->dtls.timer_hanshaking.timeout < TRTP_DTLS_HANDSHAKING_TIMEOUT_MAX) && !(manager->dtls.srtp_connected && manager->dtls.srtcp_connected)) {
+ manager->dtls.timer_hanshaking.id = tsk_timer_manager_schedule(manager->timer_mgr_global, manager->dtls.timer_hanshaking.timeout, _trtp_transport_dtls_handshaking_timer_cb, manager);
+ }
+ else {
+ manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID; // invalidate timer id (not required but should be done by good citizen)
+ manager->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT; // reset timeout
+ }
+ }
+ tsk_safeobj_unlock(manager);
#endif
-
- return ret;
+
+ return ret;
}
#if 0
static int _trtp_manager_enable_sockets(trtp_manager_t* self)
{
- int rcv_buf = tmedia_defaults_get_rtpbuff_size();
- int snd_buf = tmedia_defaults_get_rtpbuff_size();
- int ret;
-
- if(!self->socket_disabled){
- return 0;
- }
-
- if(!self || !self->transport){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&rcv_buf, sizeof(rcv_buf)))){
- TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", ret);
- return ret;
- }
- if((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_SNDBUF, (char*)&snd_buf, sizeof(snd_buf)))){
- TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", ret);
- return ret;
- }
-
- self->socket_disabled = tsk_false;
- return 0;
+ int rcv_buf = tmedia_defaults_get_rtpbuff_size();
+ int snd_buf = tmedia_defaults_get_rtpbuff_size();
+ int ret;
+
+ if(!self->socket_disabled) {
+ return 0;
+ }
+
+ if(!self || !self->transport) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&rcv_buf, sizeof(rcv_buf)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", ret);
+ return ret;
+ }
+ if((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_SNDBUF, (char*)&snd_buf, sizeof(snd_buf)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", ret);
+ return ret;
+ }
+
+ self->socket_disabled = tsk_false;
+ return 0;
}
#endif
static trtp_manager_t* _trtp_manager_create(tsk_bool_t use_rtcp, const char* local_ip, tsk_bool_t ipv6, tmedia_srtp_type_t srtp_type, tmedia_srtp_mode_t srtp_mode)
{
- trtp_manager_t* manager;
+ trtp_manager_t* manager;
#if HAVE_SRTP
- static tsk_bool_t __strp_initialized = tsk_false;
- err_status_t srtp_err;
- if(!__strp_initialized){
- if((srtp_err = srtp_init()) != err_status_ok){
- TSK_DEBUG_ERROR("srtp_init() failed with error code = %d", srtp_err);
- }
- __strp_initialized = (srtp_err == err_status_ok);
- }
+ static tsk_bool_t __strp_initialized = tsk_false;
+ err_status_t srtp_err;
+ if(!__strp_initialized) {
+ if((srtp_err = srtp_init()) != err_status_ok) {
+ TSK_DEBUG_ERROR("srtp_init() failed with error code = %d", srtp_err);
+ }
+ __strp_initialized = (srtp_err == err_status_ok);
+ }
#endif
- if((manager = tsk_object_new(trtp_manager_def_t))){
- manager->use_rtcp = use_rtcp;
- manager->local_ip = tsk_strdup(local_ip);
- manager->use_ipv6 = ipv6;
+ if((manager = tsk_object_new(trtp_manager_def_t))) {
+ manager->use_rtcp = use_rtcp;
+ manager->local_ip = tsk_strdup(local_ip);
+ manager->use_ipv6 = ipv6;
#if HAVE_SRTP
- manager->srtp_type = srtp_type;
- manager->srtp_mode = srtp_mode;
+ manager->srtp_type = srtp_type;
+ manager->srtp_mode = srtp_mode;
#endif
- manager->rtp.payload_type = 127;
- }
- return manager;
+ manager->rtp.payload_type = 127;
+ }
+ return manager;
}
static int _trtp_manager_recv_data(const trtp_manager_t* self, const uint8_t* data_ptr, tsk_size_t data_size, tnet_fd_t local_fd, const struct sockaddr_storage* remote_addr)
{
- tsk_bool_t is_rtp_rtcp, is_rtcp = tsk_false, is_rtp = tsk_false, is_stun, is_dtls;
-
- if (!self->is_started) {
- TSK_DEBUG_INFO("RTP manager not started yet");
- return 0;
- }
-
- // defined when RTCP-MUX is disabled and RTCP port is equal to "RTP Port + 1"
-
- // rfc5764 - 5.1.2. Reception
- // rfc5761 - 4. Distinguishable RTP and RTCP Packets
-
- is_rtp_rtcp = (127 < *data_ptr && *data_ptr < 192);
- if(is_rtp_rtcp){
- is_stun = is_dtls = tsk_false;
- is_rtcp = (self->rtcp.local_socket && self->rtcp.local_socket->fd == local_fd);
- if(!is_rtcp && data_size >= 2 && (data_ptr[1] & 0x80)){
- if(is_rtp_rtcp){
- switch((data_ptr[1] & 0x7F)){
- case 64: case 65:
- case 72: case 73: case 74: case 75: case 76:
- case 77: case 78:
- case 79: is_rtcp = tsk_true; break;
- }
- }
- }
- is_rtp = !is_rtcp;
- }
- else{
- is_dtls = !is_rtp_rtcp && (19 < *data_ptr && *data_ptr < 64);
- is_stun = !is_dtls && TNET_STUN_BUFF_IS_STUN2(data_ptr, data_size); /* MUST NOT USE: "(*data_ptr < 2)" beacause of "Old VAT" which starts with "0x00" */;
- }
-
- if(is_dtls){
- tnet_socket_t* socket = (self->transport && self->transport->master && self->transport->master->fd == local_fd)
- ? self->transport->master
- : ((self->rtcp.local_socket && self->rtcp.local_socket->fd == local_fd) ? self->rtcp.local_socket : tsk_null);
- if (socket && socket->dtlshandle) {
- TSK_DEBUG_INFO("Receive %s-DTLS data on ip=%s and port=%d", (socket == self->transport->master) ? "RTP" : "RTCP", socket->ip, socket->port);
- // Handle incoming data then do handshaking
- tnet_dtls_socket_handle_incoming_data(socket->dtlshandle, data_ptr, data_size);
- if (self->is_ice_turn_active) {
- // means TURN is active and handshaking data must be sent using the channel
- const void* data = tsk_null;
- tsk_size_t size = 0;
- if (tnet_transport_dtls_get_handshakingdata(self->transport, (const struct tnet_socket_s**)&socket, 1, &data, &size) == 0) {
- if (data && size > 0){
- if (self->rtcp.local_socket == socket) {
- /*ret = */_trtp_manager_send_turn_dtls_rtcp(self->ice_ctx, data, size);
- }
- else {
- /*ret = */_trtp_manager_send_turn_dtls_rtp(self->ice_ctx, data, size);
- }
- }
- }
- }
- }
- return 0;
- }
-
- if(is_stun){
- static tsk_bool_t role_conflict = tsk_false;
- if(self->ice_ctx){
- return tnet_ice_ctx_recv_stun_message(self->ice_ctx, data_ptr, data_size, local_fd, remote_addr, &role_conflict);
- }
- return 0;
- }
- if(is_rtcp){
- if(!self->is_symetric_rtcp_checked && self->is_force_symetric_rtp){
- ((trtp_manager_t*)self)->is_symetric_rtcp_checked = tsk_true;
- if(!self->is_ice_neg_ok && remote_addr){ // do not force symetric RTCP is ICE negotiation succeed
- TSK_DEBUG_INFO("Using symetric RTCP for [%s]:%d", self->rtcp.remote_ip, self->rtcp.remote_port);
- ((trtp_manager_t*)self)->rtcp.remote_addr = *remote_addr;
- }
- }
-
- if(self->rtcp.session){
- #if HAVE_SRTP
- err_status_t status;
- if(self->srtp_ctx_neg_remote){
- srtp_t session = self->srtp_ctx_neg_remote->rtcp.initialized ? self->srtp_ctx_neg_remote->rtcp.session : self->srtp_ctx_neg_remote->rtp.session;
- if((status = srtp_unprotect_rtcp(session, (void*)data_ptr, (int*)&data_size)) != err_status_ok){
+ tsk_bool_t is_rtp_rtcp, is_rtcp = tsk_false, is_rtp = tsk_false, is_stun, is_dtls;
+
+ if (!self->is_started) {
+ TSK_DEBUG_INFO("RTP manager not started yet");
+ return 0;
+ }
+
+ // defined when RTCP-MUX is disabled and RTCP port is equal to "RTP Port + 1"
+
+ // rfc5764 - 5.1.2. Reception
+ // rfc5761 - 4. Distinguishable RTP and RTCP Packets
+
+ is_rtp_rtcp = (127 < *data_ptr && *data_ptr < 192);
+ if(is_rtp_rtcp) {
+ is_stun = is_dtls = tsk_false;
+ is_rtcp = (self->rtcp.local_socket && self->rtcp.local_socket->fd == local_fd);
+ if(!is_rtcp && data_size >= 2 && (data_ptr[1] & 0x80)) {
+ if(is_rtp_rtcp) {
+ switch((data_ptr[1] & 0x7F)) {
+ case 64:
+ case 65:
+ case 72:
+ case 73:
+ case 74:
+ case 75:
+ case 76:
+ case 77:
+ case 78:
+ case 79:
+ is_rtcp = tsk_true;
+ break;
+ }
+ }
+ }
+ is_rtp = !is_rtcp;
+ }
+ else {
+ is_dtls = !is_rtp_rtcp && (19 < *data_ptr && *data_ptr < 64);
+ is_stun = !is_dtls && TNET_STUN_BUFF_IS_STUN2(data_ptr, data_size); /* MUST NOT USE: "(*data_ptr < 2)" beacause of "Old VAT" which starts with "0x00" */;
+ }
+
+ if(is_dtls) {
+ tnet_socket_t* socket = (self->transport && self->transport->master && self->transport->master->fd == local_fd)
+ ? self->transport->master
+ : ((self->rtcp.local_socket && self->rtcp.local_socket->fd == local_fd) ? self->rtcp.local_socket : tsk_null);
+ if (socket && socket->dtlshandle) {
+ TSK_DEBUG_INFO("Receive %s-DTLS data on ip=%s and port=%d", (socket == self->transport->master) ? "RTP" : "RTCP", socket->ip, socket->port);
+ // Handle incoming data then do handshaking
+ tnet_dtls_socket_handle_incoming_data(socket->dtlshandle, data_ptr, data_size);
+ if (self->is_ice_turn_active) {
+ // means TURN is active and handshaking data must be sent using the channel
+ const void* data = tsk_null;
+ tsk_size_t size = 0;
+ if (tnet_transport_dtls_get_handshakingdata(self->transport, (const struct tnet_socket_s**)&socket, 1, &data, &size) == 0) {
+ if (data && size > 0) {
+ if (self->rtcp.local_socket == socket) {
+ /*ret = */_trtp_manager_send_turn_dtls_rtcp(self->ice_ctx, data, size);
+ }
+ else {
+ /*ret = */_trtp_manager_send_turn_dtls_rtp(self->ice_ctx, data, size);
+ }
+ }
+ }
+ }
+ }
+ return 0;
+ }
+
+ if(is_stun) {
+ static tsk_bool_t role_conflict = tsk_false;
+ if(self->ice_ctx) {
+ return tnet_ice_ctx_recv_stun_message(self->ice_ctx, data_ptr, data_size, local_fd, remote_addr, &role_conflict);
+ }
+ return 0;
+ }
+ if(is_rtcp) {
+ if(!self->is_symetric_rtcp_checked && self->is_force_symetric_rtp) {
+ ((trtp_manager_t*)self)->is_symetric_rtcp_checked = tsk_true;
+ if(!self->is_ice_neg_ok && remote_addr) { // do not force symetric RTCP is ICE negotiation succeed
+ TSK_DEBUG_INFO("Using symetric RTCP for [%s]:%d", self->rtcp.remote_ip, self->rtcp.remote_port);
+ ((trtp_manager_t*)self)->rtcp.remote_addr = *remote_addr;
+ }
+ }
+
+ if(self->rtcp.session) {
+#if HAVE_SRTP
+ err_status_t status;
+ if(self->srtp_ctx_neg_remote) {
+ srtp_t session = self->srtp_ctx_neg_remote->rtcp.initialized ? self->srtp_ctx_neg_remote->rtcp.session : self->srtp_ctx_neg_remote->rtp.session;
+ if((status = srtp_unprotect_rtcp(session, (void*)data_ptr, (int*)&data_size)) != err_status_ok) {
if (status == err_status_replay_fail) {
// replay (because of RTCP-NACK nothing to worry about)
TSK_DEBUG_INFO("srtp_unprotect(RTCP) returned 'err_status_replay_fail'");
@@ -470,29 +477,29 @@ static int _trtp_manager_recv_data(const trtp_manager_t* self, const uint8_t* da
TSK_DEBUG_ERROR("srtp_unprotect(RTCP) failed with error code=%d", (int)status);
return -1;
}
- }
- }
- #endif
- return trtp_rtcp_session_process_rtcp_in(self->rtcp.session, data_ptr, data_size);
- }
- TSK_DEBUG_WARN("No RTCP session");
- return 0;
- }
- if(is_rtp){
- if(!self->is_symetric_rtp_checked && self->is_force_symetric_rtp){
- ((trtp_manager_t*)self)->is_symetric_rtp_checked = tsk_true;
- if(!self->is_ice_neg_ok && remote_addr){ // do not force symetric RTP is ICE negotiation succeed
- TSK_DEBUG_INFO("Using symetric RTP for [%s]:%d", self->rtp.remote_ip, self->rtp.remote_port);
- ((trtp_manager_t*)self)->rtp.remote_addr = *remote_addr;
- }
- }
-
- if(self->rtp.cb.fun){
- trtp_rtp_packet_t* packet_rtp = tsk_null;
- #if HAVE_SRTP
- err_status_t status;
- if(self->srtp_ctx_neg_remote){
- if((status = srtp_unprotect(self->srtp_ctx_neg_remote->rtp.session, (void*)data_ptr, (int*)&data_size)) != err_status_ok){
+ }
+ }
+#endif
+ return trtp_rtcp_session_process_rtcp_in(self->rtcp.session, data_ptr, data_size);
+ }
+ TSK_DEBUG_WARN("No RTCP session");
+ return 0;
+ }
+ if(is_rtp) {
+ if(!self->is_symetric_rtp_checked && self->is_force_symetric_rtp) {
+ ((trtp_manager_t*)self)->is_symetric_rtp_checked = tsk_true;
+ if(!self->is_ice_neg_ok && remote_addr) { // do not force symetric RTP is ICE negotiation succeed
+ TSK_DEBUG_INFO("Using symetric RTP for [%s]:%d", self->rtp.remote_ip, self->rtp.remote_port);
+ ((trtp_manager_t*)self)->rtp.remote_addr = *remote_addr;
+ }
+ }
+
+ if(self->rtp.cb.fun) {
+ trtp_rtp_packet_t* packet_rtp = tsk_null;
+#if HAVE_SRTP
+ err_status_t status;
+ if(self->srtp_ctx_neg_remote) {
+ if((status = srtp_unprotect(self->srtp_ctx_neg_remote->rtp.session, (void*)data_ptr, (int*)&data_size)) != err_status_ok) {
if (status == err_status_replay_fail) {
// replay (because of RTCP-NACK nothing to worry about)
TSK_DEBUG_INFO("srtp_unprotect(RTP) returned 'err_status_replay_fail'");
@@ -502,52 +509,52 @@ static int _trtp_manager_recv_data(const trtp_manager_t* self, const uint8_t* da
TSK_DEBUG_ERROR("srtp_unprotect(RTP) failed with error code=%d, seq_num=%u", (int)status, (data_size > 4 ? tnet_ntohs_2(&data_ptr[2]) : 0x0000));
return -1;
}
- }
- }
- #endif
- if((packet_rtp = trtp_rtp_packet_deserialize(data_ptr, data_size))){
- // update remote SSRC based on received RTP packet
- ((trtp_manager_t*)self)->rtp.ssrc.remote = packet_rtp->header->ssrc;
- // forward to the callback function (most likely "session_av")
- self->rtp.cb.fun(self->rtp.cb.usrdata, packet_rtp);
- // forward packet to the RTCP session
- if(self->rtcp.session){
- trtp_rtcp_session_process_rtp_in(self->rtcp.session, packet_rtp, data_size);
- }
- TSK_OBJECT_SAFE_FREE(packet_rtp);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("RTP packet === NOK");
- return -1;
- }
- }
- return 0;
- }
-
- TSK_DEBUG_INFO("Received unknown packet type");
- return 0;
+ }
+ }
+#endif
+ if((packet_rtp = trtp_rtp_packet_deserialize(data_ptr, data_size))) {
+ // update remote SSRC based on received RTP packet
+ ((trtp_manager_t*)self)->rtp.ssrc.remote = packet_rtp->header->ssrc;
+ // forward to the callback function (most likely "session_av")
+ self->rtp.cb.fun(self->rtp.cb.usrdata, packet_rtp);
+ // forward packet to the RTCP session
+ if(self->rtcp.session) {
+ trtp_rtcp_session_process_rtp_in(self->rtcp.session, packet_rtp, data_size);
+ }
+ TSK_OBJECT_SAFE_FREE(packet_rtp);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("RTP packet === NOK");
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ TSK_DEBUG_INFO("Received unknown packet type");
+ return 0;
}
// Sends DTLS handshaking data record by record to avoid UDP IP fragmentation issues (each record length will be < Length(MTU))
//!\ This is required even if the local transport is TCP/TLS because the relayed (TURN) transport could be UDP
static int _trtp_manager_send_turn_dtls(struct tnet_ice_ctx_s* ice_ctx, const void* handshaking_data_ptr, tsk_size_t handshaking_data_size, tsk_bool_t use_rtcp_channel)
{
- const uint8_t *record_ptr, *records_ptr = handshaking_data_ptr;
- tsk_size_t record_size;
- int records_len = (int)handshaking_data_size, ret = 0;
- int(*_ice_ctx_send_turn_data)(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size) = use_rtcp_channel ? tnet_ice_ctx_send_turn_rtcp : tnet_ice_ctx_send_turn_rtp;
- if (!ice_ctx || !handshaking_data_ptr || !handshaking_data_size) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- while (records_len > 0 && (ret = tnet_dtls_socket_get_record_first(records_ptr, (tsk_size_t)records_len, &record_ptr, &record_size)) == 0) {
- ret = _ice_ctx_send_turn_data(ice_ctx, record_ptr, record_size);
-
- records_len -= (int)record_size;
- records_ptr += record_size;
- }
- return ret;
+ const uint8_t *record_ptr, *records_ptr = handshaking_data_ptr;
+ tsk_size_t record_size;
+ int records_len = (int)handshaking_data_size, ret = 0;
+ int(*_ice_ctx_send_turn_data)(struct tnet_ice_ctx_s* self, const void* data, tsk_size_t size) = use_rtcp_channel ? tnet_ice_ctx_send_turn_rtcp : tnet_ice_ctx_send_turn_rtp;
+ if (!ice_ctx || !handshaking_data_ptr || !handshaking_data_size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ while (records_len > 0 && (ret = tnet_dtls_socket_get_record_first(records_ptr, (tsk_size_t)records_len, &record_ptr, &record_size)) == 0) {
+ ret = _ice_ctx_send_turn_data(ice_ctx, record_ptr, record_size);
+
+ records_len -= (int)record_size;
+ records_ptr += record_size;
+ }
+ return ret;
}
#if HAVE_SRTP
@@ -559,634 +566,634 @@ If ICE is enabled DTLS-SRTP will not be enabled as the transport is "null"
*/
static int _trtp_manager_srtp_set_enabled(trtp_manager_t* self, tmedia_srtp_type_t srtp_type, struct tnet_socket_s** sockets, tsk_size_t count, tsk_bool_t enabled)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if((self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)){
- int ret;
- if(enabled){
- if(srtp_type & tmedia_srtp_type_sdes){
- trtp_srtp_ctx_init(
- &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80],
- 1,
- HMAC_SHA1_80,
- self->rtp.ssrc.local
- );
- trtp_srtp_ctx_init(
- &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32],
- 2,
- HMAC_SHA1_32,
- self->rtp.ssrc.local
- );
- }
-
- if(srtp_type & tmedia_srtp_type_dtls){
- /*
- Enables DTLS on the transport without activating it on the sockets
- Enabling DTLS will allow us to get the certificate fingerprints for negotiation
- At this stage the sockets are not ready to send DTLS datagrams -> Good for ICE negotiation
- */
- if(self->transport){
- if((ret = tnet_transport_dtls_set_enabled(self->transport, enabled, tsk_null, 0))){
- return ret;
- }
- if((ret = trtp_manager_set_dtls_certs(self, self->dtls.file_ca, self->dtls.file_pbk, self->dtls.file_pvk, self->dtls.cert_verif))){
- return ret;
- }
- self->dtls.state = trtp_srtp_state_enabled;
- }
- else{
- self->dtls.enable_postponed = tsk_true;
- }
- }
- self->srtp_state = trtp_srtp_state_enabled;
- }
- else {
- if (srtp_type & tmedia_srtp_type_dtls) {
- if (self->transport) {
- ret = tnet_transport_dtls_set_enabled(self->transport, tsk_false, sockets, count);
- }
- self->dtls.state = trtp_srtp_state_none;
- self->dtls.enable_postponed = tsk_false;
- self->dtls.srtp_connected = self->dtls.srtp_handshake_succeed = tsk_false;
- self->dtls.srtcp_connected = self->dtls.srtcp_handshake_succeed = tsk_false;
- }
-
- // SRTP context is used by both DTLS and SDES -> only destroy them if requested to be disabled on both
- if((~srtp_type & self->srtp_type) == tmedia_srtp_type_none){
- trtp_srtp_ctx_deinit(&self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][0]);
- trtp_srtp_ctx_deinit(&self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][1]);
- self->srtp_ctx_neg_local = tsk_null;
- self->srtp_ctx_neg_remote = tsk_null;
- self->srtp_state = trtp_srtp_state_none;
- // Reset SRTP session to the RTCP session manager
- if (self->rtcp.session) {
- trtp_rtcp_session_set_srtp_sess(self->rtcp.session, tsk_null);
- }
- }
- }
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if((self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)) {
+ int ret;
+ if(enabled) {
+ if(srtp_type & tmedia_srtp_type_sdes) {
+ trtp_srtp_ctx_init(
+ &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80],
+ 1,
+ HMAC_SHA1_80,
+ self->rtp.ssrc.local
+ );
+ trtp_srtp_ctx_init(
+ &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32],
+ 2,
+ HMAC_SHA1_32,
+ self->rtp.ssrc.local
+ );
+ }
+
+ if(srtp_type & tmedia_srtp_type_dtls) {
+ /*
+ Enables DTLS on the transport without activating it on the sockets
+ Enabling DTLS will allow us to get the certificate fingerprints for negotiation
+ At this stage the sockets are not ready to send DTLS datagrams -> Good for ICE negotiation
+ */
+ if(self->transport) {
+ if((ret = tnet_transport_dtls_set_enabled(self->transport, enabled, tsk_null, 0))) {
+ return ret;
+ }
+ if((ret = trtp_manager_set_dtls_certs(self, self->dtls.file_ca, self->dtls.file_pbk, self->dtls.file_pvk, self->dtls.cert_verif))) {
+ return ret;
+ }
+ self->dtls.state = trtp_srtp_state_enabled;
+ }
+ else {
+ self->dtls.enable_postponed = tsk_true;
+ }
+ }
+ self->srtp_state = trtp_srtp_state_enabled;
+ }
+ else {
+ if (srtp_type & tmedia_srtp_type_dtls) {
+ if (self->transport) {
+ ret = tnet_transport_dtls_set_enabled(self->transport, tsk_false, sockets, count);
+ }
+ self->dtls.state = trtp_srtp_state_none;
+ self->dtls.enable_postponed = tsk_false;
+ self->dtls.srtp_connected = self->dtls.srtp_handshake_succeed = tsk_false;
+ self->dtls.srtcp_connected = self->dtls.srtcp_handshake_succeed = tsk_false;
+ }
+
+ // SRTP context is used by both DTLS and SDES -> only destroy them if requested to be disabled on both
+ if((~srtp_type & self->srtp_type) == tmedia_srtp_type_none) {
+ trtp_srtp_ctx_deinit(&self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][0]);
+ trtp_srtp_ctx_deinit(&self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][1]);
+ self->srtp_ctx_neg_local = tsk_null;
+ self->srtp_ctx_neg_remote = tsk_null;
+ self->srtp_state = trtp_srtp_state_none;
+ // Reset SRTP session to the RTCP session manager
+ if (self->rtcp.session) {
+ trtp_rtcp_session_set_srtp_sess(self->rtcp.session, tsk_null);
+ }
+ }
+ }
+ }
+
+ return 0;
}
static int _trtp_manager_srtp_activate(trtp_manager_t* self, tmedia_srtp_type_t srtp_type)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(srtp_type != tmedia_srtp_type_none && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)){
- int ret;
- if(self->srtp_state < trtp_srtp_state_enabled){
- TSK_DEBUG_ERROR("SRTP engine not enabled yet");
- return -2;
- }
- if((srtp_type & tmedia_srtp_type_dtls) && (self->dtls.state >= trtp_srtp_state_enabled || self->dtls.enable_postponed)){
- /*
- Activates DTLS on the transport and on both RTP and RTCP sockets
- At this stage the sockets are ready to send/recv DTLS datagrams
- */
- struct tnet_socket_s* sockets[] = { self->transport->master , self->rtcp.local_socket };
- const struct sockaddr_storage* remote_addrs[] = { &self->rtp.remote_addr, &self->rtcp.remote_addr };
- tsk_bool_t store_handshakingdata[] = { self->is_ice_turn_active, self->is_ice_turn_active };
-
- // check if DTLS-SRTP enabling was postponed because the net transport was not ready (could happen if ICE is ON)
- if(self->dtls.enable_postponed){
- if ((ret = _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_true))) {
- return ret;
- }
- self->dtls.enable_postponed = tsk_false;
- }
-
- // activate "use_srtp" (rfc5764 section 4.1) on the transport
- // this should be done before enabling DTLS sockets to be sure that newly created/enabled ones will use "use_srtp" extension
- if((ret = tnet_transport_dtls_use_srtp(self->transport, "SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32", sockets, 2))){
- return ret;
- }
- // enabling DTLS on the sockets will create the "dtlshandle" field and change the type from UDP to DTLS
- if((ret = tnet_transport_dtls_set_enabled(self->transport, tsk_true, sockets, 2))){
- return ret;
- }
-
- /* At this step the DTLS "dtlshandle" is created and the socket types changed from UDP to DTLS */
-
- // pass the remote certificate fingerprint to both SRTP and SRTCP sockets
- // the fingerprint will be verified if this option is enabled on the SSL context
- // we'll be notified via the callback if there are fingerprint mismatch after the begining of the handshaking
- if((ret = tnet_transport_dtls_set_remote_fingerprint(self->transport, &self->dtls.remote.fp, self->dtls.remote.fp_hash, sockets, 2))){
- return ret;
- }
- // setting the "setup" allow each DTLS socket to know if it's a client or server
- // setup="active" means it's up to us to send the "DTLS client hello" message (otherwise "server hello" will be sent)
- if((ret = tnet_transport_dtls_set_setup(self->transport, self->dtls.local.setup, sockets, 2))){
- return ret;
- }
- // whether to send DTLS handshaking data using the provided sockets or TURN session
- if ((ret = tnet_transport_dtls_set_store_handshakingdata(self->transport, store_handshakingdata[0], sockets, 2))) {
- return ret;
- }
- // start handshaking process (will do nothing if already completed)
- if ((ret = tnet_transport_dtls_do_handshake(self->transport, sockets, 2, remote_addrs, 2))) {
- return ret;
- }
- if (store_handshakingdata[0]) {
- // means TURN is active and handshaking data must be sent using the channel
- const void* data[] = { tsk_null, tsk_null };
- tsk_size_t size[] = { 0, 0 };
- if ((ret = tnet_transport_dtls_get_handshakingdata(self->transport, (const struct tnet_socket_s**)sockets, 2, data, size))) {
- return ret;
- }
- if (data[0] && size[0]) {
- ret = tnet_ice_ctx_send_turn_rtp(self->ice_ctx, data[0], size[0]);
- }
- if (data[1] && size[1]) {
- ret = tnet_ice_ctx_send_turn_rtcp(self->ice_ctx, data[1], size[1]);
- }
- }
-
- self->dtls.state = trtp_srtp_state_activated;
- }
-
- self->srtp_state = trtp_srtp_state_activated;
-
- // SDES-SRTP could be started right now while DTLS requires the handshaking to terminate
- if (srtp_type & tmedia_srtp_type_sdes) {
- return _trtp_manager_srtp_start(self, self->srtp_type);
- }
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(srtp_type != tmedia_srtp_type_none && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)) {
+ int ret;
+ if(self->srtp_state < trtp_srtp_state_enabled) {
+ TSK_DEBUG_ERROR("SRTP engine not enabled yet");
+ return -2;
+ }
+ if((srtp_type & tmedia_srtp_type_dtls) && (self->dtls.state >= trtp_srtp_state_enabled || self->dtls.enable_postponed)) {
+ /*
+ Activates DTLS on the transport and on both RTP and RTCP sockets
+ At this stage the sockets are ready to send/recv DTLS datagrams
+ */
+ struct tnet_socket_s* sockets[] = { self->transport->master , self->rtcp.local_socket };
+ const struct sockaddr_storage* remote_addrs[] = { &self->rtp.remote_addr, &self->rtcp.remote_addr };
+ tsk_bool_t store_handshakingdata[] = { self->is_ice_turn_active, self->is_ice_turn_active };
+
+ // check if DTLS-SRTP enabling was postponed because the net transport was not ready (could happen if ICE is ON)
+ if(self->dtls.enable_postponed) {
+ if ((ret = _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_true))) {
+ return ret;
+ }
+ self->dtls.enable_postponed = tsk_false;
+ }
+
+ // activate "use_srtp" (rfc5764 section 4.1) on the transport
+ // this should be done before enabling DTLS sockets to be sure that newly created/enabled ones will use "use_srtp" extension
+ if((ret = tnet_transport_dtls_use_srtp(self->transport, "SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32", sockets, 2))) {
+ return ret;
+ }
+ // enabling DTLS on the sockets will create the "dtlshandle" field and change the type from UDP to DTLS
+ if((ret = tnet_transport_dtls_set_enabled(self->transport, tsk_true, sockets, 2))) {
+ return ret;
+ }
+
+ /* At this step the DTLS "dtlshandle" is created and the socket types changed from UDP to DTLS */
+
+ // pass the remote certificate fingerprint to both SRTP and SRTCP sockets
+ // the fingerprint will be verified if this option is enabled on the SSL context
+ // we'll be notified via the callback if there are fingerprint mismatch after the begining of the handshaking
+ if((ret = tnet_transport_dtls_set_remote_fingerprint(self->transport, &self->dtls.remote.fp, self->dtls.remote.fp_hash, sockets, 2))) {
+ return ret;
+ }
+ // setting the "setup" allow each DTLS socket to know if it's a client or server
+ // setup="active" means it's up to us to send the "DTLS client hello" message (otherwise "server hello" will be sent)
+ if((ret = tnet_transport_dtls_set_setup(self->transport, self->dtls.local.setup, sockets, 2))) {
+ return ret;
+ }
+ // whether to send DTLS handshaking data using the provided sockets or TURN session
+ if ((ret = tnet_transport_dtls_set_store_handshakingdata(self->transport, store_handshakingdata[0], sockets, 2))) {
+ return ret;
+ }
+ // start handshaking process (will do nothing if already completed)
+ if ((ret = tnet_transport_dtls_do_handshake(self->transport, sockets, 2, remote_addrs, 2))) {
+ return ret;
+ }
+ if (store_handshakingdata[0]) {
+ // means TURN is active and handshaking data must be sent using the channel
+ const void* data[] = { tsk_null, tsk_null };
+ tsk_size_t size[] = { 0, 0 };
+ if ((ret = tnet_transport_dtls_get_handshakingdata(self->transport, (const struct tnet_socket_s**)sockets, 2, data, size))) {
+ return ret;
+ }
+ if (data[0] && size[0]) {
+ ret = tnet_ice_ctx_send_turn_rtp(self->ice_ctx, data[0], size[0]);
+ }
+ if (data[1] && size[1]) {
+ ret = tnet_ice_ctx_send_turn_rtcp(self->ice_ctx, data[1], size[1]);
+ }
+ }
+
+ self->dtls.state = trtp_srtp_state_activated;
+ }
+
+ self->srtp_state = trtp_srtp_state_activated;
+
+ // SDES-SRTP could be started right now while DTLS requires the handshaking to terminate
+ if (srtp_type & tmedia_srtp_type_sdes) {
+ return _trtp_manager_srtp_start(self, self->srtp_type);
+ }
+ }
+ return 0;
}
static int _trtp_manager_srtp_start(trtp_manager_t* self, tmedia_srtp_type_t srtp_type)
{
- const trtp_srtp_ctx_xt *ctx_remote, *ctx_local;
- tsk_bool_t use_different_keys;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(self->srtp_state < trtp_srtp_state_activated){
- TSK_DEBUG_ERROR("SRTP engine not activated yet");
- return -2;
- }
-
- ctx_remote = self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_80].rtp.initialized
- ? &self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_80]
- : &self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_32];
-
- // dtls uses different keys for rtp and srtp which is not the case for sdes
- use_different_keys = !_trtp_manager_is_rtcpmux_active(self) && ((srtp_type & tmedia_srtp_type_dtls) == tmedia_srtp_type_dtls);
- TSK_DEBUG_INFO("srtp_use_different_keys=%s", use_different_keys ? "true" : "false");
-
- if(!ctx_remote->rtp.initialized || (use_different_keys && !ctx_remote->rtcp.initialized)){
- TSK_DEBUG_ERROR("SRTP remote context not initialized: Not expected at this state");
- return -2;
- }
-
- // use same crypto type on both sides
- ctx_local = &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][(int32_t)ctx_remote->rtp.crypto_type];
- if(!ctx_local->rtp.initialized || (use_different_keys && !ctx_local->rtcp.initialized)){
- TSK_DEBUG_ERROR("SRTP local context not initialized: Not expected at this state");
- return -2;
- }
-
- // update negotiated crypto contexts used to encrypt()/decrypt() SRTP data
- self->srtp_ctx_neg_remote = ctx_remote;
- self->srtp_ctx_neg_local = ctx_local;
-
- self->srtp_state = trtp_srtp_state_started;
- if(self->dtls.state >= trtp_srtp_state_activated){
- // this means the DTLS-SRTP is the active type intead of SDES
- self->dtls.state = trtp_srtp_state_started;
- }
-
- // Pass SRTP session to the RTCP session manager
- trtp_rtcp_session_set_srtp_sess(
- self->rtcp.session,
- self->srtp_ctx_neg_local ? (use_different_keys ? &self->srtp_ctx_neg_local->rtcp.session : &self->srtp_ctx_neg_local->rtp.session) : tsk_null
- );
-
- /* At this step we are able to encrypt()/decrypt() SRTP data */
-
- return 0;
+ const trtp_srtp_ctx_xt *ctx_remote, *ctx_local;
+ tsk_bool_t use_different_keys;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(self->srtp_state < trtp_srtp_state_activated) {
+ TSK_DEBUG_ERROR("SRTP engine not activated yet");
+ return -2;
+ }
+
+ ctx_remote = self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_80].rtp.initialized
+ ? &self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_80]
+ : &self->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][HMAC_SHA1_32];
+
+ // dtls uses different keys for rtp and srtp which is not the case for sdes
+ use_different_keys = !_trtp_manager_is_rtcpmux_active(self) && ((srtp_type & tmedia_srtp_type_dtls) == tmedia_srtp_type_dtls);
+ TSK_DEBUG_INFO("srtp_use_different_keys=%s", use_different_keys ? "true" : "false");
+
+ if(!ctx_remote->rtp.initialized || (use_different_keys && !ctx_remote->rtcp.initialized)) {
+ TSK_DEBUG_ERROR("SRTP remote context not initialized: Not expected at this state");
+ return -2;
+ }
+
+ // use same crypto type on both sides
+ ctx_local = &self->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][(int32_t)ctx_remote->rtp.crypto_type];
+ if(!ctx_local->rtp.initialized || (use_different_keys && !ctx_local->rtcp.initialized)) {
+ TSK_DEBUG_ERROR("SRTP local context not initialized: Not expected at this state");
+ return -2;
+ }
+
+ // update negotiated crypto contexts used to encrypt()/decrypt() SRTP data
+ self->srtp_ctx_neg_remote = ctx_remote;
+ self->srtp_ctx_neg_local = ctx_local;
+
+ self->srtp_state = trtp_srtp_state_started;
+ if(self->dtls.state >= trtp_srtp_state_activated) {
+ // this means the DTLS-SRTP is the active type intead of SDES
+ self->dtls.state = trtp_srtp_state_started;
+ }
+
+ // Pass SRTP session to the RTCP session manager
+ trtp_rtcp_session_set_srtp_sess(
+ self->rtcp.session,
+ self->srtp_ctx_neg_local ? (use_different_keys ? &self->srtp_ctx_neg_local->rtcp.session : &self->srtp_ctx_neg_local->rtp.session) : tsk_null
+ );
+
+ /* At this step we are able to encrypt()/decrypt() SRTP data */
+
+ return 0;
}
#endif /* HAVE_SRTP */
static int _trtp_manager_ice_init(trtp_manager_t* self)
{
- int ret = 0;
- const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
- struct tnet_socket_s *rtp_socket = tsk_null;
-
- if (!self || !self->ice_ctx) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!self->transport) {
- // get rtp nominated symetric candidates
- ret = tnet_ice_ctx_get_nominated_symetric_candidates(self->ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTP,
- &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- self->is_ice_neg_ok = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest);
- self->is_ice_turn_active = self->is_ice_neg_ok && tnet_ice_ctx_is_turn_rtp_active(self->ice_ctx);
- if (!self->is_ice_neg_ok) {
- // If this code is called this means that ICE negotiation has failed
- // This is not really an error because it could happen if the remote peer is not an ICE agent or is an ICE-lite
- // in this case, use the first offered candidate which is the best one and already used in the "c=" line
- if (!(candidate_offer = tnet_ice_ctx_get_local_candidate_first(self->ice_ctx))) {
- // Must never happen as we always have at least one local "host" candidate
- TSK_DEBUG_ERROR("ICE context not ready");
- ret = -3;
- goto bail;
- }
- }
-
- // Get RTP socket
- if (self->is_ice_turn_active && candidate_offer->turn.ss) {
- if ((ret = tnet_turn_session_get_socket_local(candidate_offer->turn.ss, &rtp_socket))) {
- goto bail;
- }
- }
- else {
- rtp_socket = tsk_object_ref(candidate_offer->socket);
- }
-
- // create transport
- if (!(self->transport = tnet_transport_create_2(rtp_socket, TRTP_TRANSPORT_NAME))) {
- TSK_DEBUG_ERROR("Failed to create transport(%s:%u)", rtp_socket->ip, rtp_socket->port);
- ret = -4;
- goto bail;
- }
- // set rtp local and remote IPs and ports
- if (candidate_answer_dest) { // could be "null" if remote peer is ICE-lite
- tsk_strupdate(&self->rtp.remote_ip, candidate_answer_dest->connection_addr);
- self->rtp.remote_port = candidate_answer_dest->port;
- tsk_strupdate(&self->rtp.public_ip, candidate_offer->connection_addr);
- self->rtp.public_port = candidate_offer->port;
- }
-
- // get rtp nominated symetric candidates
- if (self->use_rtcp) {
- ret = tnet_ice_ctx_get_nominated_symetric_candidates(self->ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTCP,
- &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
- if (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest) {
- // set rtp local and remote IPs and ports
- tsk_strupdate(&self->rtcp.remote_ip, candidate_answer_dest->connection_addr);
- self->rtcp.remote_port = candidate_answer_dest->port;
- tsk_strupdate(&self->rtcp.public_ip, candidate_offer->connection_addr);
- self->rtcp.public_port = candidate_offer->port;
- TSK_OBJECT_SAFE_FREE(self->rtcp.local_socket);
- // Get RTCP socket
- if (self->is_ice_turn_active && candidate_offer->turn.ss) {
- ret = tnet_turn_session_get_socket_local(candidate_offer->turn.ss, &self->rtcp.local_socket);
- if (ret) {
- goto bail;
- }
- }
- else {
- self->rtcp.local_socket = tsk_object_ref(candidate_offer->socket);
- }
- }
- }
- }
-
- // set callback functions
- ret = tnet_transport_set_callback(self->transport, _trtp_transport_layer_cb, self); // NetTransport -> RtpManager
- ret = tnet_ice_ctx_rtp_callback(self->ice_ctx, (tnet_ice_rtp_callback_f)_trtp_manager_recv_data, self); // ICE -> RtpManager
+ int ret = 0;
+ const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
+ struct tnet_socket_s *rtp_socket = tsk_null;
+
+ if (!self || !self->ice_ctx) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!self->transport) {
+ // get rtp nominated symetric candidates
+ ret = tnet_ice_ctx_get_nominated_symetric_candidates(self->ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTP,
+ &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ self->is_ice_neg_ok = (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest);
+ self->is_ice_turn_active = self->is_ice_neg_ok && tnet_ice_ctx_is_turn_rtp_active(self->ice_ctx);
+ if (!self->is_ice_neg_ok) {
+ // If this code is called this means that ICE negotiation has failed
+ // This is not really an error because it could happen if the remote peer is not an ICE agent or is an ICE-lite
+ // in this case, use the first offered candidate which is the best one and already used in the "c=" line
+ if (!(candidate_offer = tnet_ice_ctx_get_local_candidate_first(self->ice_ctx))) {
+ // Must never happen as we always have at least one local "host" candidate
+ TSK_DEBUG_ERROR("ICE context not ready");
+ ret = -3;
+ goto bail;
+ }
+ }
+
+ // Get RTP socket
+ if (self->is_ice_turn_active && candidate_offer->turn.ss) {
+ if ((ret = tnet_turn_session_get_socket_local(candidate_offer->turn.ss, &rtp_socket))) {
+ goto bail;
+ }
+ }
+ else {
+ rtp_socket = tsk_object_ref(candidate_offer->socket);
+ }
+
+ // create transport
+ if (!(self->transport = tnet_transport_create_2(rtp_socket, TRTP_TRANSPORT_NAME))) {
+ TSK_DEBUG_ERROR("Failed to create transport(%s:%u)", rtp_socket->ip, rtp_socket->port);
+ ret = -4;
+ goto bail;
+ }
+ // set rtp local and remote IPs and ports
+ if (candidate_answer_dest) { // could be "null" if remote peer is ICE-lite
+ tsk_strupdate(&self->rtp.remote_ip, candidate_answer_dest->connection_addr);
+ self->rtp.remote_port = candidate_answer_dest->port;
+ tsk_strupdate(&self->rtp.public_ip, candidate_offer->connection_addr);
+ self->rtp.public_port = candidate_offer->port;
+ }
+
+ // get rtp nominated symetric candidates
+ if (self->use_rtcp) {
+ ret = tnet_ice_ctx_get_nominated_symetric_candidates(self->ice_ctx, TNET_ICE_CANDIDATE_COMPID_RTCP,
+ &candidate_offer, &candidate_answer_src, &candidate_answer_dest);
+ if (ret == 0 && candidate_offer && candidate_answer_src && candidate_answer_dest) {
+ // set rtp local and remote IPs and ports
+ tsk_strupdate(&self->rtcp.remote_ip, candidate_answer_dest->connection_addr);
+ self->rtcp.remote_port = candidate_answer_dest->port;
+ tsk_strupdate(&self->rtcp.public_ip, candidate_offer->connection_addr);
+ self->rtcp.public_port = candidate_offer->port;
+ TSK_OBJECT_SAFE_FREE(self->rtcp.local_socket);
+ // Get RTCP socket
+ if (self->is_ice_turn_active && candidate_offer->turn.ss) {
+ ret = tnet_turn_session_get_socket_local(candidate_offer->turn.ss, &self->rtcp.local_socket);
+ if (ret) {
+ goto bail;
+ }
+ }
+ else {
+ self->rtcp.local_socket = tsk_object_ref(candidate_offer->socket);
+ }
+ }
+ }
+ }
+
+ // set callback functions
+ ret = tnet_transport_set_callback(self->transport, _trtp_transport_layer_cb, self); // NetTransport -> RtpManager
+ ret = tnet_ice_ctx_rtp_callback(self->ice_ctx, (tnet_ice_rtp_callback_f)_trtp_manager_recv_data, self); // ICE -> RtpManager
bail:
- TSK_OBJECT_SAFE_FREE(rtp_socket);
- return ret;
+ TSK_OBJECT_SAFE_FREE(rtp_socket);
+ return ret;
}
/** Create RTP/RTCP manager */
trtp_manager_t* trtp_manager_create(tsk_bool_t use_rtcp, const char* local_ip, tsk_bool_t ipv6, tmedia_srtp_type_t srtp_type, tmedia_srtp_mode_t srtp_mode)
{
- trtp_manager_t* manager;
- if((manager = _trtp_manager_create(use_rtcp, local_ip, ipv6, srtp_type, srtp_mode))){
- }
- return manager;
+ trtp_manager_t* manager;
+ if((manager = _trtp_manager_create(use_rtcp, local_ip, ipv6, srtp_type, srtp_mode))) {
+ }
+ return manager;
}
/** Create RTP/RTCP manager */
trtp_manager_t* trtp_manager_create_2(struct tnet_ice_ctx_s* ice_ctx, tmedia_srtp_type_t srtp_type, tmedia_srtp_mode_t srtp_mode)
{
- trtp_manager_t* manager;
- const char* local_ip;
- tsk_bool_t use_ipv6, use_rtcp;
-
- if(!ice_ctx){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- local_ip = (use_ipv6 = tnet_ice_ctx_use_ipv6(ice_ctx)) ? "::1" : "127.0.0.1";
- use_rtcp = tnet_ice_ctx_use_rtcp(ice_ctx);
-
- if((manager = _trtp_manager_create(use_rtcp, local_ip, use_ipv6, srtp_type, srtp_mode))){
- manager->ice_ctx = tsk_object_ref(ice_ctx);
- }
- return manager;
+ trtp_manager_t* manager;
+ const char* local_ip;
+ tsk_bool_t use_ipv6, use_rtcp;
+
+ if(!ice_ctx) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ local_ip = (use_ipv6 = tnet_ice_ctx_use_ipv6(ice_ctx)) ? "::1" : "127.0.0.1";
+ use_rtcp = tnet_ice_ctx_use_rtcp(ice_ctx);
+
+ if((manager = _trtp_manager_create(use_rtcp, local_ip, use_ipv6, srtp_type, srtp_mode))) {
+ manager->ice_ctx = tsk_object_ref(ice_ctx);
+ }
+ return manager;
}
int trtp_manager_set_ice_ctx(trtp_manager_t* self, struct tnet_ice_ctx_s* ice_ctx)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid ICE context");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(self->ice_ctx);
- self->ice_ctx = tsk_object_ref(ice_ctx);
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid ICE context");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(self->ice_ctx);
+ self->ice_ctx = tsk_object_ref(ice_ctx);
+ return 0;
}
/** Prepares the RTP/RTCP manager */
int trtp_manager_prepare(trtp_manager_t* self)
{
- const char *rtp_local_ip = tsk_null, *rtcp_local_ip = tsk_null;
- tnet_port_t rtp_local_port = 0, rtcp_local_port = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->transport){
- TSK_DEBUG_ERROR("RTP/RTCP manager already prepared");
- return -2;
- }
-
- if(self->ice_ctx){
- TSK_DEBUG_INFO("ICE enabled on RTP manager");
- // Get Sockets when the transport is started
- rtp_local_ip = rtcp_local_ip = self->use_ipv6 ? "::1" : "127.0.0.1";
- rtp_local_port = 2; // ICE default rtp port, do not use zero which is reserved to disabled medias
- rtcp_local_port = 1; // ICE default rtcp port, do not use zero which is reserved to disabled medias
- }
- else{
- #define __retry_count_max 5
- #define __retry_count_max_minus1 (__retry_count_max - 1)
- uint8_t retry_count = __retry_count_max;
- tnet_socket_type_t socket_type = self->use_ipv6 ? tnet_socket_type_udp_ipv6 : tnet_socket_type_udp_ipv4;
-
- /* Creates local rtp and rtcp sockets */
- while(retry_count--){
- /* random number in the range 1024 to 65535 */
- static int counter = 0;
+ const char *rtp_local_ip = tsk_null, *rtcp_local_ip = tsk_null;
+ tnet_port_t rtp_local_port = 0, rtcp_local_port = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->transport) {
+ TSK_DEBUG_ERROR("RTP/RTCP manager already prepared");
+ return -2;
+ }
+
+ if(self->ice_ctx) {
+ TSK_DEBUG_INFO("ICE enabled on RTP manager");
+ // Get Sockets when the transport is started
+ rtp_local_ip = rtcp_local_ip = self->use_ipv6 ? "::1" : "127.0.0.1";
+ rtp_local_port = 2; // ICE default rtp port, do not use zero which is reserved to disabled medias
+ rtcp_local_port = 1; // ICE default rtcp port, do not use zero which is reserved to disabled medias
+ }
+ else {
+#define __retry_count_max 5
+#define __retry_count_max_minus1 (__retry_count_max - 1)
+ uint8_t retry_count = __retry_count_max;
+ tnet_socket_type_t socket_type = self->use_ipv6 ? tnet_socket_type_udp_ipv6 : tnet_socket_type_udp_ipv4;
+
+ /* Creates local rtp and rtcp sockets */
+ while(retry_count--) {
+ /* random number in the range 1024 to 65535 */
+ static int counter = 0;
#if 0
- tnet_port_t local_port = 6060;
+ tnet_port_t local_port = 6060;
#else
- // first check => try to use port from latest active session if exist
- tnet_port_t local_port = (retry_count == __retry_count_max_minus1 && (self->port_range.start <= self->rtp.public_port && self->rtp.public_port <= self->port_range.stop))
- ? self->rtp.public_port
- : (((rand() ^ ++counter) % (self->port_range.stop - self->port_range.start)) + self->port_range.start);
+ // first check => try to use port from latest active session if exist
+ tnet_port_t local_port = (retry_count == __retry_count_max_minus1 && (self->port_range.start <= self->rtp.public_port && self->rtp.public_port <= self->port_range.stop))
+ ? self->rtp.public_port
+ : (((rand() ^ ++counter) % (self->port_range.stop - self->port_range.start)) + self->port_range.start);
#endif
- local_port = (local_port & 0xFFFE); /* turn to even number */
-
- /* beacuse failure will cause errors in the log, print a message to alert that there is
- * nothing to worry about */
- TSK_DEBUG_INFO("RTP/RTCP manager[Begin]: Trying to bind to random ports");
-
- /* RTP */
- if(!(self->transport = tnet_transport_create(self->local_ip, local_port, socket_type, TRTP_TRANSPORT_NAME))){
- TSK_DEBUG_ERROR("Failed to create RTP/RTCP Transport");
- return -3;
- }
-
- /* RTCP */
- if (self->use_rtcp) {
- if(!(self->rtcp.local_socket = tnet_socket_create(self->local_ip, local_port+1, socket_type))){
- TSK_DEBUG_WARN("Failed to bind to %d", local_port+1);
- TSK_OBJECT_SAFE_FREE(self->transport);
- continue;
- }
- }
-
- TSK_DEBUG_INFO("RTP/RTCP manager[End]: Trying to bind to random ports");
- break;
- }// end-of-while(retry_count)
-
- rtp_local_ip = self->transport->master->ip;
- rtp_local_port = self->transport->master->port;
- if(self->rtcp.local_socket){
- rtcp_local_ip = self->rtcp.local_socket->ip;
- rtcp_local_port = self->rtcp.local_socket->port;
-
- }
- }// end-of-else(!ice)
-
- tsk_strupdate(&self->rtp.public_ip, rtp_local_ip);
- self->rtp.public_port = rtp_local_port;
-
- tsk_strupdate(&self->rtcp.public_ip, rtcp_local_ip);
- self->rtcp.public_port = rtcp_local_port;
-
- if(self->transport){
- /* set callback function */
- tnet_transport_set_callback(self->transport, _trtp_transport_layer_cb, self);
- /* Disable receiving until we start the transport (To avoid buffering) */
+ local_port = (local_port & 0xFFFE); /* turn to even number */
+
+ /* beacuse failure will cause errors in the log, print a message to alert that there is
+ * nothing to worry about */
+ TSK_DEBUG_INFO("RTP/RTCP manager[Begin]: Trying to bind to random ports");
+
+ /* RTP */
+ if(!(self->transport = tnet_transport_create(self->local_ip, local_port, socket_type, TRTP_TRANSPORT_NAME))) {
+ TSK_DEBUG_ERROR("Failed to create RTP/RTCP Transport");
+ return -3;
+ }
+
+ /* RTCP */
+ if (self->use_rtcp) {
+ if(!(self->rtcp.local_socket = tnet_socket_create(self->local_ip, local_port+1, socket_type))) {
+ TSK_DEBUG_WARN("Failed to bind to %d", local_port+1);
+ TSK_OBJECT_SAFE_FREE(self->transport);
+ continue;
+ }
+ }
+
+ TSK_DEBUG_INFO("RTP/RTCP manager[End]: Trying to bind to random ports");
+ break;
+ }// end-of-while(retry_count)
+
+ rtp_local_ip = self->transport->master->ip;
+ rtp_local_port = self->transport->master->port;
+ if(self->rtcp.local_socket) {
+ rtcp_local_ip = self->rtcp.local_socket->ip;
+ rtcp_local_port = self->rtcp.local_socket->port;
+
+ }
+ }// end-of-else(!ice)
+
+ tsk_strupdate(&self->rtp.public_ip, rtp_local_ip);
+ self->rtp.public_port = rtp_local_port;
+
+ tsk_strupdate(&self->rtcp.public_ip, rtcp_local_ip);
+ self->rtcp.public_port = rtcp_local_port;
+
+ if(self->transport) {
+ /* set callback function */
+ tnet_transport_set_callback(self->transport, _trtp_transport_layer_cb, self);
+ /* Disable receiving until we start the transport (To avoid buffering) */
#if TRTP_DISABLE_SOCKETS_BEFORE_START
- if(!self->socket_disabled){
- int err, optval = TRTP_TINY_RCVBUF;
- if((err = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&optval, sizeof(optval)))){
- TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", err);
- }
- self->socket_disabled = (err == 0);
- }
+ if(!self->socket_disabled) {
+ int err, optval = TRTP_TINY_RCVBUF;
+ if((err = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&optval, sizeof(optval)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF) has failed with error code %d", err);
+ }
+ self->socket_disabled = (err == 0);
+ }
#endif
- }
+ }
- /* SRTP */
+ /* SRTP */
#if HAVE_SRTP
- {
- // enable SRTP to allow negotiation
- if (self->srtp_type != tmedia_srtp_mode_none) {
- struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
- _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets)/sizeof(sockets[0]), tsk_true);
- }
- }
+ {
+ // enable SRTP to allow negotiation
+ if (self->srtp_type != tmedia_srtp_mode_none) {
+ struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
+ _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets)/sizeof(sockets[0]), tsk_true);
+ }
+ }
#endif
- return 0;
+ return 0;
}
#if HAVE_SRTP
int trtp_manager_set_dtls_certs(trtp_manager_t* self, const char* ca, const char* pbk, const char* pvk, tsk_bool_t verify)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // always save certificates even if not DTLS-SRTP transport
- tsk_strupdate(&self->dtls.file_ca, ca);
- tsk_strupdate(&self->dtls.file_pbk, pbk);
- tsk_strupdate(&self->dtls.file_pvk, pvk);
- self->dtls.cert_verif = verify;
-
- if((self->srtp_type & tmedia_srtp_type_dtls) && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)){
- if(self->transport && tnet_transport_dtls_is_enabled(self->transport)){
- return tnet_transport_dtls_srtp_set_certs(self->transport, self->dtls.file_ca, self->dtls.file_pbk, self->dtls.file_pvk, self->dtls.cert_verif);
- }
- }
- else{
- TSK_DEBUG_ERROR("DTLS certificates setting ignored for non-DTLS-SRTP transport");
- return -2;
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // always save certificates even if not DTLS-SRTP transport
+ tsk_strupdate(&self->dtls.file_ca, ca);
+ tsk_strupdate(&self->dtls.file_pbk, pbk);
+ tsk_strupdate(&self->dtls.file_pvk, pvk);
+ self->dtls.cert_verif = verify;
+
+ if((self->srtp_type & tmedia_srtp_type_dtls) && (self->srtp_mode == tmedia_srtp_mode_optional || self->srtp_mode == tmedia_srtp_mode_mandatory)) {
+ if(self->transport && tnet_transport_dtls_is_enabled(self->transport)) {
+ return tnet_transport_dtls_srtp_set_certs(self->transport, self->dtls.file_ca, self->dtls.file_pbk, self->dtls.file_pvk, self->dtls.cert_verif);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("DTLS certificates setting ignored for non-DTLS-SRTP transport");
+ return -2;
+ }
+
+ return 0;
}
int trtp_manager_set_dtls_callback(trtp_manager_t* self, const void* usrdata, trtp_srtp_dtls_cb_f fun)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->dtls.cb.usrdata = usrdata;
- self->dtls.cb.fun = fun;
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->dtls.cb.usrdata = usrdata;
+ self->dtls.cb.fun = fun;
+
+ return 0;
}
int trtp_manager_set_dtls_remote_fingerprint(trtp_manager_t* self, const tnet_fingerprint_t* fp, const char* fp_hash)
{
- tnet_dtls_hash_type_t hash;
- if(!self || !fp || !fp_hash){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- hash = tnet_dtls_get_hash_from_string(fp_hash);
- if(hash != tnet_dtls_hash_type_sha1 && hash != tnet_dtls_hash_type_sha256){
- TSK_DEBUG_ERROR("%s not supported as fingerprint hash", fp_hash);
- return -2;
- }
- self->dtls.remote.fp_hash = hash;
- memcpy(self->dtls.remote.fp, &(*fp)[0], sizeof(tnet_fingerprint_t));
- return 0;
+ tnet_dtls_hash_type_t hash;
+ if(!self || !fp || !fp_hash) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ hash = tnet_dtls_get_hash_from_string(fp_hash);
+ if(hash != tnet_dtls_hash_type_sha1 && hash != tnet_dtls_hash_type_sha256) {
+ TSK_DEBUG_ERROR("%s not supported as fingerprint hash", fp_hash);
+ return -2;
+ }
+ self->dtls.remote.fp_hash = hash;
+ memcpy(self->dtls.remote.fp, &(*fp)[0], sizeof(tnet_fingerprint_t));
+ return 0;
}
enum tnet_dtls_hash_type_e trtp_manager_get_dtls_remote_fingerprint_hash(trtp_manager_t* self)
{
- return (self ? self->dtls.remote.fp_hash : tnet_dtls_hash_type_none);
+ return (self ? self->dtls.remote.fp_hash : tnet_dtls_hash_type_none);
}
int trtp_manager_set_dtls_local_setup(trtp_manager_t* self, tnet_dtls_setup_t setup, tsk_bool_t connection_new)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->dtls.local.setup = setup;
- self->dtls.local.connection_new = connection_new;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->dtls.local.setup = setup;
+ self->dtls.local.connection_new = connection_new;
+ return 0;
}
const char* trtp_manager_get_dtls_local_fingerprint(trtp_manager_t* self, enum tnet_dtls_hash_type_e hash)
{
- if(!self || (int32_t)hash < 0 || (int32_t)hash >= TNET_DTLS_HASH_TYPE_MAX){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if(!self->transport && self->dtls.file_pbk){
- static tnet_fingerprint_t fingerprint[TNET_DTLS_HASH_TYPE_MAX];
- if(tnet_dtls_get_fingerprint(self->dtls.file_pbk, &fingerprint[hash], hash) == 0){
- return (const char*)fingerprint[hash];
- }
- }
- return tnet_transport_dtls_get_local_fingerprint(self->transport, hash);
+ if(!self || (int32_t)hash < 0 || (int32_t)hash >= TNET_DTLS_HASH_TYPE_MAX) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if(!self->transport && self->dtls.file_pbk) {
+ static tnet_fingerprint_t fingerprint[TNET_DTLS_HASH_TYPE_MAX];
+ if(tnet_dtls_get_fingerprint(self->dtls.file_pbk, &fingerprint[hash], hash) == 0) {
+ return (const char*)fingerprint[hash];
+ }
+ }
+ return tnet_transport_dtls_get_local_fingerprint(self->transport, hash);
}
tsk_bool_t trtp_manager_is_dtls_enabled(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->dtls.state >= trtp_srtp_state_enabled);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->dtls.state >= trtp_srtp_state_enabled);
}
tsk_bool_t trtp_manager_is_dtls_activated(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->dtls.state >= trtp_srtp_state_activated);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->dtls.state >= trtp_srtp_state_activated);
}
tsk_bool_t trtp_manager_is_dtls_started(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->dtls.state >= trtp_srtp_state_started);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->dtls.state >= trtp_srtp_state_started);
}
tsk_bool_t trtp_manager_is_srtp_activated(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->srtp_state >= trtp_srtp_state_activated);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->srtp_state >= trtp_srtp_state_activated);
}
tsk_bool_t trtp_manager_is_srtp_started(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->srtp_state >= trtp_srtp_state_started);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->srtp_state >= trtp_srtp_state_started);
}
/** Sets SRTP type used by the remote party */
int trtp_manager_set_srtp_type_remote(trtp_manager_t* self, tmedia_srtp_type_t srtp_type_remote)
{
- tsk_size_t i;
- int ret;
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for(i = 0; i < sizeof(__srtp_types)/sizeof(__srtp_types[i]); ++i) {
- if ((self->srtp_type & __srtp_types[i]) && !(srtp_type_remote & __srtp_types[i])) {
- struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
- if ((ret = _trtp_manager_srtp_set_enabled(self, __srtp_types[i], sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false))) {
- return ret;
- }
- self->srtp_type &= ~__srtp_types[i];
- }
- }
- return 0;
+ tsk_size_t i;
+ int ret;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for(i = 0; i < sizeof(__srtp_types)/sizeof(__srtp_types[i]); ++i) {
+ if ((self->srtp_type & __srtp_types[i]) && !(srtp_type_remote & __srtp_types[i])) {
+ struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
+ if ((ret = _trtp_manager_srtp_set_enabled(self, __srtp_types[i], sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false))) {
+ return ret;
+ }
+ self->srtp_type &= ~__srtp_types[i];
+ }
+ }
+ return 0;
}
int trtp_manager_set_srtp_type_local(trtp_manager_t* self, enum tmedia_srtp_type_e srtp_type, enum tmedia_srtp_mode_e srtp_mode)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid ICE context");
- return -1;
- }
- if (srtp_mode == tmedia_srtp_mode_none || srtp_type == tmedia_srtp_type_none) {
- struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
- _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false);
- self->srtp_type = srtp_type;
- self->srtp_mode = srtp_mode;
- return 0;
- }
-
- self->srtp_mode = srtp_mode;
- return trtp_manager_set_srtp_type_remote(self, srtp_type);
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid ICE context");
+ return -1;
+ }
+ if (srtp_mode == tmedia_srtp_mode_none || srtp_type == tmedia_srtp_type_none) {
+ struct tnet_socket_s* sockets[] = { self->transport ? self->transport->master : tsk_null, self->rtcp.local_socket };
+ _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false);
+ self->srtp_type = srtp_type;
+ self->srtp_mode = srtp_mode;
+ return 0;
+ }
+
+ self->srtp_mode = srtp_mode;
+ return trtp_manager_set_srtp_type_remote(self, srtp_type);
}
#endif /* HAVE_SRTP */
@@ -1194,152 +1201,152 @@ int trtp_manager_set_srtp_type_local(trtp_manager_t* self, enum tmedia_srtp_type
/** Indicates whether the manager is already ready or not */
tsk_bool_t trtp_manager_is_ready(trtp_manager_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
- return (self->transport != tsk_null);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+ return (self->transport != tsk_null);
}
/** Sets NAT Traversal context */
int trtp_manager_set_natt_ctx(trtp_manager_t* self, struct tnet_nat_ctx_s* natt_ctx)
{
- int ret;
-
- if(!self || !self->transport || !natt_ctx){
- if(self && self->ice_ctx){
- return 0; // Nat context is not needed when ICE is enabled
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!(ret = tnet_transport_set_natt_ctx(self->transport, natt_ctx))){
- tnet_ip_t public_ip = {0};
- tnet_port_t public_port = 0;
- // get RTP public IP and Port
- if(!tnet_transport_get_public_ip_n_port(self->transport, self->transport->master->fd, &public_ip, &public_port)){
- tsk_strupdate(&self->rtp.public_ip, public_ip);
- self->rtp.public_port = public_port;
- }
- // get RTCP public IP and Port
- memset(public_ip, 0, sizeof(public_ip));
- public_port = 0;
- if(self->rtcp.local_socket && !tnet_transport_get_public_ip_n_port(self->transport, self->rtcp.local_socket->fd, &public_ip, &public_port)){
- tsk_strupdate(&self->rtcp.public_ip, public_ip);
- self->rtcp.public_port = public_port;
- }
- // re-enable sockets to be able to receive STUN packets
+ int ret;
+
+ if(!self || !self->transport || !natt_ctx) {
+ if(self && self->ice_ctx) {
+ return 0; // Nat context is not needed when ICE is enabled
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!(ret = tnet_transport_set_natt_ctx(self->transport, natt_ctx))) {
+ tnet_ip_t public_ip = {0};
+ tnet_port_t public_port = 0;
+ // get RTP public IP and Port
+ if(!tnet_transport_get_public_ip_n_port(self->transport, self->transport->master->fd, &public_ip, &public_port)) {
+ tsk_strupdate(&self->rtp.public_ip, public_ip);
+ self->rtp.public_port = public_port;
+ }
+ // get RTCP public IP and Port
+ memset(public_ip, 0, sizeof(public_ip));
+ public_port = 0;
+ if(self->rtcp.local_socket && !tnet_transport_get_public_ip_n_port(self->transport, self->rtcp.local_socket->fd, &public_ip, &public_port)) {
+ tsk_strupdate(&self->rtcp.public_ip, public_ip);
+ self->rtcp.public_port = public_port;
+ }
+ // re-enable sockets to be able to receive STUN packets
#if 0
- _trtp_manager_enable_sockets(self);
+ _trtp_manager_enable_sockets(self);
#endif
- }
- return ret;
+ }
+ return ret;
}
/** Sets RTP callback */
int trtp_manager_set_rtp_callback(trtp_manager_t* self, trtp_rtp_cb_f fun, const void* usrdata)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- self->rtp.cb.fun = fun;
- self->rtp.cb.usrdata = usrdata;
+ self->rtp.cb.fun = fun;
+ self->rtp.cb.usrdata = usrdata;
- return 0;
+ return 0;
}
/** Sets RTCP callback */
int trtp_manager_set_rtcp_callback(trtp_manager_t* self, trtp_rtcp_cb_f fun, const void* usrdata)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->rtcp.cb.fun = fun;
- self->rtcp.cb.usrdata = usrdata;
- if(self->rtcp.session){
- return trtp_rtcp_session_set_callback(self->rtcp.session, fun, usrdata);
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->rtcp.cb.fun = fun;
+ self->rtcp.cb.usrdata = usrdata;
+ if(self->rtcp.session) {
+ return trtp_rtcp_session_set_callback(self->rtcp.session, fun, usrdata);
+ }
+
+ return 0;
}
/** Sets the payload type */
int trtp_manager_set_payload_type(trtp_manager_t* self, uint8_t payload_type)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->rtp.payload_type = payload_type;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->rtp.payload_type = payload_type;
+ return 0;
}
int trtp_manager_set_rtp_dscp(trtp_manager_t* self, int32_t dscp)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->rtp.dscp = dscp;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->rtp.dscp = dscp;
+ return 0;
}
/** Sets remote parameters for rtp session */
int trtp_manager_set_rtp_remote(trtp_manager_t* self, const char* remote_ip, tnet_port_t remote_port)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // if ICE is enabled then, these values will be updated when the manager start()s and call ice_init()
- tsk_strupdate(&self->rtp.remote_ip, remote_ip);
- self->rtp.remote_port = remote_port;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // if ICE is enabled then, these values will be updated when the manager start()s and call ice_init()
+ tsk_strupdate(&self->rtp.remote_ip, remote_ip);
+ self->rtp.remote_port = remote_port;
+ return 0;
}
/** Sets remote parameters for rtcp session */
int trtp_manager_set_rtcp_remote(trtp_manager_t* self, const char* remote_ip, tnet_port_t remote_port)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(self->ice_ctx){
- TSK_DEBUG_WARN("Manually setting RTCP remote IP and Port while ICE is enabled");
- }
- tsk_strupdate(&self->rtcp.remote_ip, remote_ip);
- self->rtcp.remote_port = remote_port;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(self->ice_ctx) {
+ TSK_DEBUG_WARN("Manually setting RTCP remote IP and Port while ICE is enabled");
+ }
+ tsk_strupdate(&self->rtcp.remote_ip, remote_ip);
+ self->rtcp.remote_port = remote_port;
+ return 0;
}
int trtp_manager_set_port_range(trtp_manager_t* self, uint16_t start, uint16_t stop)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->port_range.start = start;
- self->port_range.stop = stop;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->port_range.start = start;
+ self->port_range.stop = stop;
+ return 0;
}
int trtp_manager_set_rtcweb_type_remote(trtp_manager_t* self, tmedia_rtcweb_type_t rtcweb_type)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->rtcweb_type.remote = rtcweb_type;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->rtcweb_type.remote = rtcweb_type;
+ return 0;
}
int trtp_manager_set_proxy_auto_detect(trtp_manager_t* self, tsk_bool_t auto_detect)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -1349,7 +1356,7 @@ int trtp_manager_set_proxy_auto_detect(trtp_manager_t* self, tsk_bool_t auto_det
int trtp_manager_set_proxy_info(trtp_manager_t* self, enum tnet_proxy_type_e type, const char* host, tnet_port_t port, const char* login, const char* password)
{
- if (!self){
+ if (!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -1367,41 +1374,41 @@ int trtp_manager_set_proxy_info(trtp_manager_t* self, enum tnet_proxy_type_e typ
/** Starts the RTP/RTCP manager */
int trtp_manager_start(trtp_manager_t* self)
{
- int ret = 0;
- int rcv_buf = (int)tmedia_defaults_get_rtpbuff_size();
- int snd_buf = (int)tmedia_defaults_get_rtpbuff_size();
+ int ret = 0;
+ int rcv_buf = (int)tmedia_defaults_get_rtpbuff_size();
+ int snd_buf = (int)tmedia_defaults_get_rtpbuff_size();
#if !TRTP_UNDER_WINDOWS_CE
int32_t dscp_rtp;
#endif
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(self);
-
- if (self->is_started) {
- goto bail;
- }
-
- // Initialize transport with ICE context
- if (self->ice_ctx && (ret = _trtp_manager_ice_init(self)) != 0) {
- TSK_DEBUG_ERROR("_trtp_manager_ice_init() failed");
- goto bail;
- }
-
- if(!self->transport && (ret = trtp_manager_prepare(self))){
- TSK_DEBUG_ERROR("Failed to prepare RTP/RTCP mamanger");
- goto bail;
- }
-
- if(!self->transport || !self->transport->master){
- TSK_DEBUG_ERROR("RTP/RTCP manager not prepared");
- ret = -2;
- goto bail;
- }
-
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+
+ if (self->is_started) {
+ goto bail;
+ }
+
+ // Initialize transport with ICE context
+ if (self->ice_ctx && (ret = _trtp_manager_ice_init(self)) != 0) {
+ TSK_DEBUG_ERROR("_trtp_manager_ice_init() failed");
+ goto bail;
+ }
+
+ if(!self->transport && (ret = trtp_manager_prepare(self))) {
+ TSK_DEBUG_ERROR("Failed to prepare RTP/RTCP mamanger");
+ goto bail;
+ }
+
+ if(!self->transport || !self->transport->master) {
+ TSK_DEBUG_ERROR("RTP/RTCP manager not prepared");
+ ret = -2;
+ goto bail;
+ }
+
/* Proxy */
// Proxy info
if ((ret = tnet_transport_set_proxy_auto_detect(self->transport, self->proxy.auto_detect))) {
@@ -1415,289 +1422,291 @@ int trtp_manager_start(trtp_manager_t* self)
}
}
- /* Flush buffers and re-enable sockets */
- if(self->transport->master && self->is_socket_disabled){
- static char buff[1024];
- tsk_size_t guard_count = 0;
+ /* Flush buffers and re-enable sockets */
+ if(self->transport->master && self->is_socket_disabled) {
+ static char buff[1024];
+ tsk_size_t guard_count = 0;
#if 0
- // re-enable sockets
- _trtp_manager_enable_sockets(self);
+ // re-enable sockets
+ _trtp_manager_enable_sockets(self);
#endif
- TSK_DEBUG_INFO("Start flushing RTP socket...");
- // Buffer should be empty ...but who know?
- // rcv() should never block() as we are always using non-blocking sockets
- while ((ret = (int)recv(self->transport->master->fd, buff, sizeof(buff), 0)) > 0 && ++guard_count < 0xF0){
- TSK_DEBUG_INFO("Flushing RTP Buffer %d", ret);
- }
- TSK_DEBUG_INFO("End flushing RTP socket");
- }
+ TSK_DEBUG_INFO("Start flushing RTP socket...");
+ // Buffer should be empty ...but who know?
+ // rcv() should never block() as we are always using non-blocking sockets
+ while ((ret = (int)recv(self->transport->master->fd, buff, sizeof(buff), 0)) > 0 && ++guard_count < 0xF0) {
+ TSK_DEBUG_INFO("Flushing RTP Buffer %d", ret);
+ }
+ TSK_DEBUG_INFO("End flushing RTP socket");
+ }
- /* enlarge socket buffer */
+ /* enlarge socket buffer */
#if !TRTP_UNDER_WINDOWS_CE
- TSK_DEBUG_INFO("SO_RCVBUF = %d, SO_SNDBUF = %d", rcv_buf, snd_buf);
- if ((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&rcv_buf, sizeof(rcv_buf)))) {
- TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF, %d) has failed with error code %d", rcv_buf, ret);
- }
- if ((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_SNDBUF, (char*)&snd_buf, sizeof(snd_buf)))) {
- TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_SNDBUF, %d) has failed with error code %d", snd_buf, ret);
- }
- dscp_rtp = (self->rtp.dscp << 2);
- if ((ret = setsockopt(self->transport->master->fd, IPPROTO_IP, IP_TOS, (char*)&dscp_rtp, sizeof(dscp_rtp)))) {
- TNET_PRINT_LAST_ERROR("setsockopt(IPPROTO_IP, IP_TOS) has failed with error code %d", ret);
- }
+ TSK_DEBUG_INFO("SO_RCVBUF = %d, SO_SNDBUF = %d", rcv_buf, snd_buf);
+ if ((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_RCVBUF, (char*)&rcv_buf, sizeof(rcv_buf)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_RCVBUF, %d) has failed with error code %d", rcv_buf, ret);
+ }
+ if ((ret = setsockopt(self->transport->master->fd, SOL_SOCKET, SO_SNDBUF, (char*)&snd_buf, sizeof(snd_buf)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(SOL_SOCKET, SO_SNDBUF, %d) has failed with error code %d", snd_buf, ret);
+ }
+ dscp_rtp = (self->rtp.dscp << 2);
+ if ((ret = setsockopt(self->transport->master->fd, IPPROTO_IP, IP_TOS, (char*)&dscp_rtp, sizeof(dscp_rtp)))) {
+ TNET_PRINT_LAST_ERROR("setsockopt(IPPROTO_IP, IP_TOS) has failed with error code %d", ret);
+ }
#endif /* !TRTP_UNDER_WINDOWS_CE */
- /* RTP */
-
- // check remote IP address validity
- if((tsk_striequals(self->rtp.remote_ip, "0.0.0.0") || tsk_striequals(self->rtp.remote_ip, "::"))) { // most likely loopback testing
- tnet_ip_t source = {0};
- tsk_bool_t updated = tsk_false;
- if(self->transport && self->transport->master){
- updated = (tnet_getbestsource(self->transport->master->ip, self->transport->master->port, self->transport->master->type, &source) == 0);
- }
- // Not allowed to send data to "0.0.0.0"
- TSK_DEBUG_INFO("RTP remote IP contains not allowed value ...changing to '%s'", updated ? source : "oops");
- if(updated){
- tsk_strupdate(&self->rtp.remote_ip, source);
- }
- }
- if((ret = tnet_sockaddr_init(self->rtp.remote_ip, self->rtp.remote_port, self->transport->master->type, &self->rtp.remote_addr))){
- tnet_transport_shutdown(self->transport);
- TSK_OBJECT_SAFE_FREE(self->transport);
- TSK_DEBUG_ERROR("Invalid RTP host:port [%s:%u]", self->rtp.remote_ip, self->rtp.remote_port);
- goto bail;
- }
- TSK_DEBUG_INFO("rtp.remote_ip=%s, rtp.remote_port=%d, rtp.local_fd=%d", self->rtp.remote_ip, self->rtp.remote_port, self->transport->master->fd);
-
- /* RTCP */
- if(self->use_rtcp){
- tnet_fd_t local_rtcp_fd = self->rtcp.local_socket ? self->rtcp.local_socket->fd : -1;
- if(local_rtcp_fd < 0 || self->use_rtcpmux){ // use RTP local port to send RTCP packets
- local_rtcp_fd = self->transport->master->fd;
- }
-
- if(!self->rtcp.remote_ip){
- self->rtcp.remote_ip = tsk_strdup(self->rtcp.remote_ip ? self->rtcp.remote_ip : self->rtp.remote_ip);
- }
- if(!self->rtcp.remote_port){
- self->rtcp.remote_port = self->rtcp.remote_port ? self->rtcp.remote_port : (self->use_rtcpmux ? self->rtp.remote_port : (self->rtp.remote_port + 1));
- }
-
- TSK_DEBUG_INFO("rtcp.remote_ip=%s, rtcp.remote_port=%d, rtcp.local_fd=%d", self->rtcp.remote_ip, self->rtcp.remote_port, local_rtcp_fd);
- if((ret = tnet_sockaddr_init(self->rtcp.remote_ip, self->rtcp.remote_port, self->transport->master->type, &self->rtcp.remote_addr))){
- TSK_DEBUG_ERROR("Invalid RTCP host:port [%s:%u]", self->rtcp.remote_ip, self->rtcp.remote_port);
- /* do not exit */
- }
-
- /* add RTCP socket to the transport */
- if(self->rtcp.local_socket){
- TSK_DEBUG_INFO("rtcp.local_ip=%s, rtcp.local_port=%d, rtcp.local_fd=%d", self->rtcp.local_socket->ip, self->rtcp.local_socket->port, self->rtcp.local_socket->fd);
- if(ret == 0 && (ret = tnet_transport_add_socket(self->transport, self->rtcp.local_socket->fd, self->rtcp.local_socket->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null))){
- TSK_DEBUG_ERROR("Failed to add RTCP socket");
- /* do not exit */
- }
- }
- /* create and start RTCP session */
- if(!self->rtcp.session && ret == 0){
- self->rtcp.session = trtp_rtcp_session_create_2(self->ice_ctx, self->rtp.ssrc.local, self->rtcp.cname);
- }
- if(self->rtcp.session){
- ret = trtp_rtcp_session_set_callback(self->rtcp.session, self->rtcp.cb.fun, self->rtcp.cb.usrdata);
- ret = trtp_rtcp_session_set_app_bandwidth_max(self->rtcp.session, self->app_bw_max_upload, self->app_bw_max_download);
+ /* RTP */
+
+ // check remote IP address validity
+ if((tsk_striequals(self->rtp.remote_ip, "0.0.0.0") || tsk_striequals(self->rtp.remote_ip, "::"))) { // most likely loopback testing
+ tnet_ip_t source = {0};
+ tsk_bool_t updated = tsk_false;
+ if(self->transport && self->transport->master) {
+ updated = (tnet_getbestsource(self->transport->master->ip, self->transport->master->port, self->transport->master->type, &source) == 0);
+ }
+ // Not allowed to send data to "0.0.0.0"
+ TSK_DEBUG_INFO("RTP remote IP contains not allowed value ...changing to '%s'", updated ? source : "oops");
+ if(updated) {
+ tsk_strupdate(&self->rtp.remote_ip, source);
+ }
+ }
+ if((ret = tnet_sockaddr_init(self->rtp.remote_ip, self->rtp.remote_port, self->transport->master->type, &self->rtp.remote_addr))) {
+ tnet_transport_shutdown(self->transport);
+ TSK_OBJECT_SAFE_FREE(self->transport);
+ TSK_DEBUG_ERROR("Invalid RTP host:port [%s:%u]", self->rtp.remote_ip, self->rtp.remote_port);
+ goto bail;
+ }
+ TSK_DEBUG_INFO("rtp.remote_ip=%s, rtp.remote_port=%d, rtp.local_fd=%d", self->rtp.remote_ip, self->rtp.remote_port, self->transport->master->fd);
+
+ /* RTCP */
+ if(self->use_rtcp) {
+ tnet_fd_t local_rtcp_fd = self->rtcp.local_socket ? self->rtcp.local_socket->fd : -1;
+ if(local_rtcp_fd < 0 || self->use_rtcpmux) { // use RTP local port to send RTCP packets
+ local_rtcp_fd = self->transport->master->fd;
+ }
+
+ if(!self->rtcp.remote_ip) {
+ self->rtcp.remote_ip = tsk_strdup(self->rtcp.remote_ip ? self->rtcp.remote_ip : self->rtp.remote_ip);
+ }
+ if(!self->rtcp.remote_port) {
+ self->rtcp.remote_port = self->rtcp.remote_port ? self->rtcp.remote_port : (self->use_rtcpmux ? self->rtp.remote_port : (self->rtp.remote_port + 1));
+ }
+
+ TSK_DEBUG_INFO("rtcp.remote_ip=%s, rtcp.remote_port=%d, rtcp.local_fd=%d", self->rtcp.remote_ip, self->rtcp.remote_port, local_rtcp_fd);
+ if((ret = tnet_sockaddr_init(self->rtcp.remote_ip, self->rtcp.remote_port, self->transport->master->type, &self->rtcp.remote_addr))) {
+ TSK_DEBUG_ERROR("Invalid RTCP host:port [%s:%u]", self->rtcp.remote_ip, self->rtcp.remote_port);
+ /* do not exit */
+ }
+
+ /* add RTCP socket to the transport */
+ if(self->rtcp.local_socket) {
+ TSK_DEBUG_INFO("rtcp.local_ip=%s, rtcp.local_port=%d, rtcp.local_fd=%d", self->rtcp.local_socket->ip, self->rtcp.local_socket->port, self->rtcp.local_socket->fd);
+ if(ret == 0 && (ret = tnet_transport_add_socket(self->transport, self->rtcp.local_socket->fd, self->rtcp.local_socket->type, tsk_false/* do not take ownership */, tsk_true/* only Meaningful for tls*/, tsk_null))) {
+ TSK_DEBUG_ERROR("Failed to add RTCP socket");
+ /* do not exit */
+ }
+ }
+ /* create and start RTCP session */
+ if(!self->rtcp.session && ret == 0) {
+ self->rtcp.session = trtp_rtcp_session_create_2(self->ice_ctx, self->rtp.ssrc.local, self->rtcp.cname);
+ }
+ if(self->rtcp.session) {
+ ret = trtp_rtcp_session_set_callback(self->rtcp.session, self->rtcp.cb.fun, self->rtcp.cb.usrdata);
+ ret = trtp_rtcp_session_set_app_bw_and_jcng(self->rtcp.session, self->app_bw_max_upload, self->app_bw_max_download, self->app_jitter_cng);
ret = trtp_rtcp_session_set_net_transport(self->rtcp.session, self->transport);
- if((ret = trtp_rtcp_session_start(self->rtcp.session, local_rtcp_fd, (const struct sockaddr *)&self->rtcp.remote_addr))){
- TSK_DEBUG_ERROR("Failed to start RTCP session");
- goto bail;
- }
- }
- }
-
- /*SRTP*/
+ if((ret = trtp_rtcp_session_start(self->rtcp.session, local_rtcp_fd, (const struct sockaddr *)&self->rtcp.remote_addr))) {
+ TSK_DEBUG_ERROR("Failed to start RTCP session");
+ goto bail;
+ }
+ }
+ }
+
+ /*SRTP*/
#if HAVE_SRTP
- {
- // activate SRTP (nothing will be done is srtp_mode is # "optional/mandatory")
- // will also start the manager if we're using SDES mode
- if((ret = _trtp_manager_srtp_activate(self, self->srtp_type))){
- goto bail;
- }
-
- /* DTLS handshaking Timer */
- if (self->timer_mgr_global && self->srtp_state == trtp_srtp_state_activated && (self->srtp_type & tmedia_srtp_type_dtls) == tmedia_srtp_type_dtls) {
- ret = tsk_timer_manager_start(self->timer_mgr_global);
- self->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT;
- // start handshaking timer
- // never mind if net work transport not started yet: the DTLS sockets will send the handshaking data by themself
- self->dtls.timer_hanshaking.id = tsk_timer_manager_schedule(self->timer_mgr_global, self->dtls.timer_hanshaking.timeout, _trtp_transport_dtls_handshaking_timer_cb, self);
- }
- }
+ {
+ // activate SRTP (nothing will be done is srtp_mode is # "optional/mandatory")
+ // will also start the manager if we're using SDES mode
+ if((ret = _trtp_manager_srtp_activate(self, self->srtp_type))) {
+ goto bail;
+ }
+
+ /* DTLS handshaking Timer */
+ if (self->timer_mgr_global && self->srtp_state == trtp_srtp_state_activated && (self->srtp_type & tmedia_srtp_type_dtls) == tmedia_srtp_type_dtls) {
+ ret = tsk_timer_manager_start(self->timer_mgr_global);
+ self->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT;
+ // start handshaking timer
+ // never mind if net work transport not started yet: the DTLS sockets will send the handshaking data by themself
+ self->dtls.timer_hanshaking.id = tsk_timer_manager_schedule(self->timer_mgr_global, self->dtls.timer_hanshaking.timeout, _trtp_transport_dtls_handshaking_timer_cb, self);
+ }
+ }
#endif /* HAVE_SRTP */
- /* start the transport if TURN is not active (otherwise TURN data will be received directly on RTP manager with channel headers) */
- if (!self->is_ice_turn_active && (ret = tnet_transport_start(self->transport))) {
- TSK_DEBUG_ERROR("Failed to start the RTP/RTCP transport");
- goto bail;
- }
+ /* start the transport if TURN is not active (otherwise TURN data will be received directly on RTP manager with channel headers) */
+ if (!self->is_ice_turn_active && (ret = tnet_transport_start(self->transport))) {
+ TSK_DEBUG_ERROR("Failed to start the RTP/RTCP transport");
+ goto bail;
+ }
- self->is_started = tsk_true;
+ self->is_started = tsk_true;
bail:
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return ret;
+ return ret;
}
-/* Encapsulate raw data into RTP packet and send it over the network
+/* Encapsulate raw data into RTP packet and send it over the network
* Very IMPORTANT: For voice packets, the marker bits indicates the beginning of a talkspurt */
tsk_size_t trtp_manager_send_rtp(trtp_manager_t* self, const void* data, tsk_size_t size, uint32_t duration, tsk_bool_t marker, tsk_bool_t last_packet)
{
- trtp_rtp_packet_t* packet;
- tsk_size_t ret;
-
- if(!self || !self->transport || !data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* check if transport is started */
- if(!self->is_started || !self->transport->master){
- TSK_DEBUG_WARN("RTP engine not ready yet");
- return 0;
- }
+ trtp_rtp_packet_t* packet;
+ tsk_size_t ret;
+
+ if(!self || !self->transport || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* check if transport is started */
+ if(!self->is_started || !self->transport->master) {
+ TSK_DEBUG_WARN("RTP engine not ready yet");
+ return 0;
+ }
#if HAVE_SRTP
- /* check that SRTP engine is ready or disabled */
- if(self->srtp_state != trtp_srtp_state_none && self->srtp_state != trtp_srtp_state_started){
- TSK_DEBUG_WARN("SRTP engine not ready yet");
- return 0;
- }
+ /* check that SRTP engine is ready or disabled */
+ if(self->srtp_state != trtp_srtp_state_none && self->srtp_state != trtp_srtp_state_started) {
+ TSK_DEBUG_WARN("SRTP engine not ready yet");
+ return 0;
+ }
#endif
- /* create packet with header */
- if(!(packet = trtp_rtp_packet_create(self->rtp.ssrc.local, ++self->rtp.seq_num, self->rtp.timestamp, self->rtp.payload_type, marker))){
- return 0;
- }
- if(last_packet){
- self->rtp.timestamp += duration;
- }
-
- /* set data */
+ /* create packet with header */
+ if(!(packet = trtp_rtp_packet_create(self->rtp.ssrc.local, ++self->rtp.seq_num, self->rtp.timestamp, self->rtp.payload_type, marker))) {
+ return 0;
+ }
+ if(last_packet) {
+ self->rtp.timestamp += duration;
+ }
+
+ /* set data */
#if 0
- if((packet->payload.data = tsk_calloc(size, sizeof(uint8_t)))){
- memcpy(packet->payload.data, data, size);
- packet->payload.size = size;
- }
+ if((packet->payload.data = tsk_calloc(size, sizeof(uint8_t)))) {
+ memcpy(packet->payload.data, data, size);
+ packet->payload.size = size;
+ }
#else
- packet->payload.data_const = data;
- packet->payload.size = size;
+ packet->payload.data_const = data;
+ packet->payload.size = size;
#endif
- ret = trtp_manager_send_rtp_packet(self, packet, tsk_false);
- TSK_OBJECT_SAFE_FREE(packet);
- return ret;
+ ret = trtp_manager_send_rtp_packet(self, packet, tsk_false);
+ TSK_OBJECT_SAFE_FREE(packet);
+ return ret;
}
// serialize, encrypt then send the data
tsk_size_t trtp_manager_send_rtp_packet(trtp_manager_t* self, const struct trtp_rtp_packet_s* packet, tsk_bool_t bypass_encrypt)
{
- int ret = 0;
- tsk_size_t rtp_buff_pad_count = 0;
- tsk_size_t xsize;
-
- /* check validity */
- if(!self || !packet){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_safeobj_lock(self);
-
+ int ret = 0;
+ tsk_size_t rtp_buff_pad_count = 0;
+ tsk_size_t xsize;
+
+ /* check validity */
+ if(!self || !packet) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_safeobj_lock(self);
+
// reset index
self->rtp.serial_buffer.index = 0;
- /* check if transport is started */
- if(!self->is_started || !self->transport || !self->transport->master){
- TSK_DEBUG_WARN("RTP engine not ready yet");
- ret = 0;
- goto bail;
- }
+ /* check if transport is started */
+ if(!self->is_started || !self->transport || !self->transport->master) {
+ TSK_DEBUG_WARN("RTP engine not ready yet");
+ ret = 0;
+ goto bail;
+ }
#if HAVE_SRTP
- /* check that SRTP engine is ready or disabled */
- if(self->srtp_state != trtp_srtp_state_none && self->srtp_state != trtp_srtp_state_started){
- TSK_DEBUG_WARN("SRTP engine not ready yet");
- ret = 0;
- goto bail;
- }
- if(self->srtp_ctx_neg_local && !bypass_encrypt){
- rtp_buff_pad_count = (SRTP_MAX_TRAILER_LEN + 0x04);
- }
+ /* check that SRTP engine is ready or disabled */
+ if(self->srtp_state != trtp_srtp_state_none && self->srtp_state != trtp_srtp_state_started) {
+ TSK_DEBUG_WARN("SRTP engine not ready yet");
+ ret = 0;
+ goto bail;
+ }
+ if(self->srtp_ctx_neg_local && !bypass_encrypt) {
+ rtp_buff_pad_count = (SRTP_MAX_TRAILER_LEN + 0x04);
+ }
#endif /* HAVE_SRTP */
- xsize = (trtp_rtp_packet_guess_serialbuff_size(packet) + rtp_buff_pad_count);
- if(self->rtp.serial_buffer.size < xsize){
- if(!(self->rtp.serial_buffer.ptr = tsk_realloc(self->rtp.serial_buffer.ptr, xsize))){
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %d", (int)xsize);
- self->rtp.serial_buffer.size = 0;
- goto bail;
- }
- self->rtp.serial_buffer.size = xsize;
- }
-
- /* serialize and send over the network */
- if ((ret = (int)trtp_rtp_packet_serialize_to(packet, self->rtp.serial_buffer.ptr, xsize))) {
- void* data_ptr = self->rtp.serial_buffer.ptr;
- int data_size = ret;
+ xsize = (trtp_rtp_packet_guess_serialbuff_size(packet) + rtp_buff_pad_count);
+ if(self->rtp.serial_buffer.size < xsize) {
+ if(!(self->rtp.serial_buffer.ptr = tsk_realloc(self->rtp.serial_buffer.ptr, xsize))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %d", (int)xsize);
+ self->rtp.serial_buffer.size = 0;
+ goto bail;
+ }
+ self->rtp.serial_buffer.size = xsize;
+ }
+
+ /* serialize and send over the network */
+ if ((ret = (int)trtp_rtp_packet_serialize_to(packet, self->rtp.serial_buffer.ptr, xsize))) {
+ void* data_ptr = self->rtp.serial_buffer.ptr;
+ int data_size = ret;
#if HAVE_SRTP
- err_status_t status;
- if(self->srtp_ctx_neg_local && !bypass_encrypt){
- if((status = srtp_protect(self->srtp_ctx_neg_local->rtp.session, data_ptr, &data_size)) != err_status_ok){
- TSK_DEBUG_ERROR("srtp_protect() failed with error code =%d", (int)status);
- goto bail;
- }
- }
+ err_status_t status;
+ if(self->srtp_ctx_neg_local && !bypass_encrypt) {
+ if((status = srtp_protect(self->srtp_ctx_neg_local->rtp.session, data_ptr, &data_size)) != err_status_ok) {
+ TSK_DEBUG_ERROR("srtp_protect() failed with error code =%d", (int)status);
+ goto bail;
+ }
+ }
#endif
self->rtp.serial_buffer.index = data_size; // update index
- if (/* number of bytes sent */(ret = (int)trtp_manager_send_rtp_raw(self, data_ptr, data_size)) > 0) {
- // forward packet to the RTCP session
- if (self->rtcp.session) {
- trtp_rtcp_session_process_rtp_out(self->rtcp.session, packet, data_size);
- }
- }
- else ret = 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to serialize RTP packet");
- }
+ if (/* number of bytes sent */(ret = (int)trtp_manager_send_rtp_raw(self, data_ptr, data_size)) > 0) {
+ // forward packet to the RTCP session
+ if (self->rtcp.session) {
+ trtp_rtcp_session_process_rtp_out(self->rtcp.session, packet, data_size);
+ }
+ }
+ else {
+ ret = 0;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to serialize RTP packet");
+ }
bail:
- tsk_safeobj_unlock(self);
- return ret;
+ tsk_safeobj_unlock(self);
+ return ret;
}
// send raw data "as is" without adding any RTP header or SRTP encryption
tsk_size_t trtp_manager_send_rtp_raw(trtp_manager_t* self, const void* data, tsk_size_t size)
{
- tsk_size_t ret = 0;
-
- if(!self || !self->transport || !self->transport->master || !data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- tsk_safeobj_lock(self);
- if (self->is_ice_turn_active) {
- // Send UDP/TCP/TLS buffer using TURN sockets
- ret = (tnet_ice_ctx_send_turn_rtp(self->ice_ctx, data, size) == 0) ? size : 0; // returns #0 if ok
- }
- else {
+ tsk_size_t ret = 0;
+
+ if(!self || !self->transport || !self->transport->master || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ tsk_safeobj_lock(self);
+ if (self->is_ice_turn_active) {
+ // Send UDP/TCP/TLS buffer using TURN sockets
+ ret = (tnet_ice_ctx_send_turn_rtp(self->ice_ctx, data, size) == 0) ? size : 0; // returns #0 if ok
+ }
+ else {
#if 1
ret = tnet_transport_sendto(self->transport, self->transport->master->fd, (const struct sockaddr *)&self->rtp.remote_addr, data, size); // returns number of sent bytes
#else
- ret = tnet_sockfd_sendto(self->transport->master->fd, (const struct sockaddr *)&self->rtp.remote_addr, data, size); // returns number of sent bytes
+ ret = tnet_sockfd_sendto(self->transport->master->fd, (const struct sockaddr *)&self->rtp.remote_addr, data, size); // returns number of sent bytes
#endif
- }
- tsk_safeobj_unlock(self);
- return ret;
+ }
+ tsk_safeobj_unlock(self);
+ return ret;
}
int trtp_manager_get_bytes_count(trtp_manager_t* self, uint64_t* bytes_in, uint64_t* bytes_out)
@@ -1708,125 +1717,130 @@ int trtp_manager_get_bytes_count(trtp_manager_t* self, uint64_t* bytes_in, uint6
}
if (!self->is_started) {
TSK_DEBUG_INFO("trtp_manager_get_bytes_count() called before starting RTP manager... returning zeros");
- if (bytes_in) *bytes_in = 0;
- if (bytes_out) *bytes_out = 0;
+ if (bytes_in) {
+ *bytes_in = 0;
+ }
+ if (bytes_out) {
+ *bytes_out = 0;
+ }
return 0;
}
-
+
if (self->is_ice_turn_active) {
return tnet_ice_ctx_turn_get_bytes_count(self->ice_ctx, bytes_in, bytes_out);
}
return tnet_transport_get_bytes_count(self->transport, bytes_in, bytes_out);
}
-int trtp_manager_set_app_bandwidth_max(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps)
+int trtp_manager_set_app_bw_and_jcng(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float q_jcng)
{
- if(self){
- self->app_bw_max_upload = bw_upload_kbps;
- self->app_bw_max_download = bw_download_kbps;
- if(self->rtcp.session){
- return trtp_rtcp_session_set_app_bandwidth_max(self->rtcp.session, bw_upload_kbps, bw_download_kbps);
- }
- return 0;
- }
- return -1;
+ if(self) {
+ self->app_bw_max_upload = bw_upload_kbps;
+ self->app_bw_max_download = bw_download_kbps;
+ self->app_jitter_cng = q_jcng;
+ if(self->rtcp.session) {
+ return trtp_rtcp_session_set_app_bw_and_jcng(self->rtcp.session, bw_upload_kbps, bw_download_kbps, q_jcng);
+ }
+ return 0;
+ }
+ return -1;
}
int trtp_manager_signal_pkt_loss(trtp_manager_t* self, uint32_t ssrc_media, const uint16_t* seq_nums, tsk_size_t count)
{
- if(self && self->rtcp.session){
- return trtp_rtcp_session_signal_pkt_loss(self->rtcp.session, ssrc_media, seq_nums, count);
- }
- return -1;
+ if(self && self->rtcp.session) {
+ return trtp_rtcp_session_signal_pkt_loss(self->rtcp.session, ssrc_media, seq_nums, count);
+ }
+ return -1;
}
int trtp_manager_signal_frame_corrupted(trtp_manager_t* self, uint32_t ssrc_media)
{
- if(self && self->rtcp.session){
- return trtp_rtcp_session_signal_frame_corrupted(self->rtcp.session, ssrc_media);
- }
- return -1;
+ if(self && self->rtcp.session) {
+ return trtp_rtcp_session_signal_frame_corrupted(self->rtcp.session, ssrc_media);
+ }
+ return -1;
}
int trtp_manager_signal_jb_error(trtp_manager_t* self, uint32_t ssrc_media)
{
- if(self && self->rtcp.session){
- return trtp_rtcp_session_signal_jb_error(self->rtcp.session, ssrc_media);
- }
- return -1;
+ if(self && self->rtcp.session) {
+ return trtp_rtcp_session_signal_jb_error(self->rtcp.session, ssrc_media);
+ }
+ return -1;
}
/** Stops the RTP/RTCP manager */
int trtp_manager_stop(trtp_manager_t* self)
{
- int ret = 0;
+ int ret = 0;
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSK_DEBUG_INFO("trtp_manager_stop()");
+ TSK_DEBUG_INFO("trtp_manager_stop()");
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
- // We haven't started the ICE context which means we must not stop it
- //if(self->ice_ctx){
- // ret = tnet_ice_ctx_stop(self->ice_ctx);
- //}
+ // We haven't started the ICE context which means we must not stop it
+ //if(self->ice_ctx){
+ // ret = tnet_ice_ctx_stop(self->ice_ctx);
+ //}
- // callbacks
- if (self->transport) {
- ret = tnet_transport_set_callback(self->transport, tsk_null, tsk_null);
- }
- if (self->ice_ctx) {
- ret = tnet_ice_ctx_rtp_callback(self->ice_ctx, tsk_null, tsk_null);
- }
+ // callbacks
+ if (self->transport) {
+ ret = tnet_transport_set_callback(self->transport, tsk_null, tsk_null);
+ }
+ if (self->ice_ctx) {
+ ret = tnet_ice_ctx_rtp_callback(self->ice_ctx, tsk_null, tsk_null);
+ }
- // Stop the RTCP session first (will send BYE)
- if(self->rtcp.session){
- ret = trtp_rtcp_session_stop(self->rtcp.session);
+ // Stop the RTCP session first (will send BYE)
+ if(self->rtcp.session) {
+ ret = trtp_rtcp_session_stop(self->rtcp.session);
ret = trtp_rtcp_session_set_net_transport(self->rtcp.session, tsk_null);
- }
+ }
- // Free transport to force next call to start() to create new one with new sockets
- if (self->transport) {
- tnet_socket_t *master_copy = tsk_object_ref(self->transport->master); // "tnet_transport_shutdown" will free the master
- tnet_transport_shutdown(self->transport);
+ // Free transport to force next call to start() to create new one with new sockets
+ if (self->transport) {
+ tnet_socket_t *master_copy = tsk_object_ref(self->transport->master); // "tnet_transport_shutdown" will free the master
+ tnet_transport_shutdown(self->transport);
#if HAVE_SRTP
- {
- struct tnet_socket_s* sockets[] = { master_copy, self->rtcp.local_socket };
- // cancel DTLS handshaking timer
- if (self->timer_mgr_global && self->dtls.timer_hanshaking.id != TSK_INVALID_TIMER_ID) {
- tsk_timer_manager_cancel(self->timer_mgr_global, self->dtls.timer_hanshaking.id);
- self->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID; // invalidate timer id
- self->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT; // reset timeout
- }
- // destroy all SRTP contexts
- _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false);
- }
+ {
+ struct tnet_socket_s* sockets[] = { master_copy, self->rtcp.local_socket };
+ // cancel DTLS handshaking timer
+ if (self->timer_mgr_global && self->dtls.timer_hanshaking.id != TSK_INVALID_TIMER_ID) {
+ tsk_timer_manager_cancel(self->timer_mgr_global, self->dtls.timer_hanshaking.id);
+ self->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID; // invalidate timer id
+ self->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT; // reset timeout
+ }
+ // destroy all SRTP contexts
+ _trtp_manager_srtp_set_enabled(self, self->srtp_type, sockets, sizeof(sockets) / sizeof(sockets[0]), tsk_false);
+ }
#endif /* HAVE_SRTP */
- TSK_OBJECT_SAFE_FREE(master_copy);
- TSK_OBJECT_SAFE_FREE(self->transport);
- }
- // Free RTCP info to make sure these values will be updated in next start()
- TSK_OBJECT_SAFE_FREE(self->rtcp.local_socket);
+ TSK_OBJECT_SAFE_FREE(master_copy);
+ TSK_OBJECT_SAFE_FREE(self->transport);
+ }
+ // Free RTCP info to make sure these values will be updated in next start()
+ TSK_OBJECT_SAFE_FREE(self->rtcp.local_socket);
TSK_OBJECT_SAFE_FREE(self->rtcp.session);
self->rtcp.public_port = self->rtcp.remote_port = 0;
TSK_FREE(self->rtcp.public_ip);
TSK_FREE(self->rtcp.remote_ip);
- // reset default values
- self->is_symetric_rtp_checked = self->is_symetric_rtcp_checked = tsk_false;
- self->is_ice_neg_ok = tsk_false;
- self->is_ice_turn_active = tsk_false;
- self->is_socket_disabled = tsk_false;
+ // reset default values
+ self->is_symetric_rtp_checked = self->is_symetric_rtcp_checked = tsk_false;
+ self->is_ice_neg_ok = tsk_false;
+ self->is_ice_turn_active = tsk_false;
+ self->is_socket_disabled = tsk_false;
- self->is_started = tsk_false;
+ self->is_started = tsk_false;
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return ret;
+ return ret;
}
@@ -1837,29 +1851,30 @@ int trtp_manager_stop(trtp_manager_t* self)
//
static tsk_object_t* trtp_manager_ctor(tsk_object_t * self, va_list * app)
{
- trtp_manager_t *manager = (trtp_manager_t*)self;
- if(manager){
- manager->port_range.start = tmedia_defaults_get_rtp_port_range_start();
- manager->port_range.stop = tmedia_defaults_get_rtp_port_range_stop();
- manager->is_force_symetric_rtp = tmedia_defaults_get_rtp_symetric_enabled();
- manager->app_bw_max_upload = INT_MAX; // INT_MAX or <=0 means undefined
- manager->app_bw_max_download = INT_MAX; // INT_MAX or <=0 means undefined
-
- /* srtp */
+ trtp_manager_t *manager = (trtp_manager_t*)self;
+ if(manager) {
+ manager->port_range.start = tmedia_defaults_get_rtp_port_range_start();
+ manager->port_range.stop = tmedia_defaults_get_rtp_port_range_stop();
+ manager->is_force_symetric_rtp = tmedia_defaults_get_rtp_symetric_enabled();
+ manager->app_bw_max_upload = INT_MAX; // INT_MAX or <=0 means undefined
+ manager->app_bw_max_download = INT_MAX; // INT_MAX or <=0 means undefined
+ manager->app_jitter_cng = 1.f; // Within [0, 1], in quality metric unit: 1 is best, 0 worst
+
+ /* srtp */
#if HAVE_SRTP
- manager->srtp_type = tmedia_defaults_get_srtp_type();
- manager->srtp_mode = tmedia_defaults_get_srtp_mode();
- manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID;
- manager->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT;
+ manager->srtp_type = tmedia_defaults_get_srtp_type();
+ manager->srtp_mode = tmedia_defaults_get_srtp_mode();
+ manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID;
+ manager->dtls.timer_hanshaking.timeout = TRTP_DTLS_HANDSHAKING_TIMEOUT;
#endif /* HAVE_SRTP */
- /* rtp */
- manager->rtp.timestamp = rand()^rand();
- manager->rtp.seq_num = rand()^rand();
- manager->rtp.ssrc.local = rand()^rand()^(int)tsk_time_epoch();
+ /* rtp */
+ manager->rtp.timestamp = rand()^rand();
+ manager->rtp.seq_num = rand()^rand();
+ manager->rtp.ssrc.local = rand()^rand()^(int)tsk_time_epoch();
manager->rtp.dscp = TRTP_DSCP_RTP_DEFAULT;
- /* rtcp */
+ /* rtcp */
{
// use MD5 string to avoid padding issues
tsk_md5string_t md5 = { 0 };
@@ -1868,97 +1883,96 @@ static tsk_object_t* trtp_manager_ctor(tsk_object_t * self, va_list * app)
tsk_strupdate(&manager->rtcp.cname, md5);
}
- /* timer */
- manager->timer_mgr_global = tsk_timer_mgr_global_ref();
+ /* timer */
+ manager->timer_mgr_global = tsk_timer_mgr_global_ref();
- tsk_safeobj_init(manager);
- }
- return self;
+ tsk_safeobj_init(manager);
+ }
+ return self;
}
static tsk_object_t* trtp_manager_dtor(tsk_object_t * self)
-{
- trtp_manager_t *manager = self;
- if(manager){
- /* callbacks */
- if (manager->ice_ctx) {
- tnet_ice_ctx_rtp_callback(manager->ice_ctx, tsk_null, tsk_null);
- }
- if (manager->transport) {
-
- }
-
- /* stop */
- if (manager->is_started) {
- trtp_manager_stop(manager);
- }
-
- TSK_OBJECT_SAFE_FREE(manager->transport);
-
- TSK_FREE(manager->local_ip);
-
- /* rtp */
- TSK_FREE(manager->rtp.remote_ip);
- TSK_FREE(manager->rtp.public_ip);
- TSK_FREE(manager->rtp.serial_buffer.ptr);
-
- /* rtcp */
- TSK_OBJECT_SAFE_FREE(manager->rtcp.session);
- TSK_FREE(manager->rtcp.remote_ip);
- TSK_FREE(manager->rtcp.public_ip);
- TSK_FREE(manager->rtcp.cname);
- TSK_OBJECT_SAFE_FREE(manager->rtcp.local_socket);
-
- /* SRTP */
+{
+ trtp_manager_t *manager = self;
+ if(manager) {
+ /* callbacks */
+ if (manager->ice_ctx) {
+ tnet_ice_ctx_rtp_callback(manager->ice_ctx, tsk_null, tsk_null);
+ }
+ if (manager->transport) {
+
+ }
+
+ /* stop */
+ if (manager->is_started) {
+ trtp_manager_stop(manager);
+ }
+
+ TSK_OBJECT_SAFE_FREE(manager->transport);
+
+ TSK_FREE(manager->local_ip);
+
+ /* rtp */
+ TSK_FREE(manager->rtp.remote_ip);
+ TSK_FREE(manager->rtp.public_ip);
+ TSK_FREE(manager->rtp.serial_buffer.ptr);
+
+ /* rtcp */
+ TSK_OBJECT_SAFE_FREE(manager->rtcp.session);
+ TSK_FREE(manager->rtcp.remote_ip);
+ TSK_FREE(manager->rtcp.public_ip);
+ TSK_FREE(manager->rtcp.cname);
+ TSK_OBJECT_SAFE_FREE(manager->rtcp.local_socket);
+
+ /* SRTP */
#if HAVE_SRTP
- {
- int i;
-
- /* Timer */
- // cancel DTLS handshaking timer
- if(manager->timer_mgr_global && manager->dtls.timer_hanshaking.id != TSK_INVALID_TIMER_ID){
- tsk_timer_manager_cancel(manager->timer_mgr_global, manager->dtls.timer_hanshaking.id);
- manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID;
- }
-
- for(i = 0; i < 2; ++i){
- trtp_srtp_ctx_deinit(&manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][i]);
- trtp_srtp_ctx_deinit(&manager->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][i]);
- }
-
- /* SRTP-DTLS */
- TSK_FREE(manager->dtls.file_ca);
- TSK_FREE(manager->dtls.file_pbk);
- TSK_FREE(manager->dtls.file_pvk);
- }
+ {
+ int i;
+
+ /* Timer */
+ // cancel DTLS handshaking timer
+ if(manager->timer_mgr_global && manager->dtls.timer_hanshaking.id != TSK_INVALID_TIMER_ID) {
+ tsk_timer_manager_cancel(manager->timer_mgr_global, manager->dtls.timer_hanshaking.id);
+ manager->dtls.timer_hanshaking.id = TSK_INVALID_TIMER_ID;
+ }
+
+ for(i = 0; i < 2; ++i) {
+ trtp_srtp_ctx_deinit(&manager->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][i]);
+ trtp_srtp_ctx_deinit(&manager->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][i]);
+ }
+
+ /* SRTP-DTLS */
+ TSK_FREE(manager->dtls.file_ca);
+ TSK_FREE(manager->dtls.file_pbk);
+ TSK_FREE(manager->dtls.file_pvk);
+ }
#endif /* HAVE_SRTP */
- /* Timer manager */
- if(manager->timer_mgr_global){
- tsk_timer_mgr_global_unref(&manager->timer_mgr_global);
- }
+ /* Timer manager */
+ if(manager->timer_mgr_global) {
+ tsk_timer_mgr_global_unref(&manager->timer_mgr_global);
+ }
+
+ /* ICE */
+ if (manager->ice_ctx) {
+ TSK_OBJECT_SAFE_FREE(manager->ice_ctx);
+ }
- /* ICE */
- if (manager->ice_ctx) {
- TSK_OBJECT_SAFE_FREE(manager->ice_ctx);
- }
-
/* Proxy */
TSK_OBJECT_SAFE_FREE(manager->proxy.info);
- tsk_safeobj_deinit(manager);
+ tsk_safeobj_deinit(manager);
- TSK_DEBUG_INFO("*** RTP manager destroyed ***");
- }
+ TSK_DEBUG_INFO("*** RTP manager destroyed ***");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t trtp_manager_def_s =
-{
- sizeof(trtp_manager_t),
- trtp_manager_ctor,
- trtp_manager_dtor,
- tsk_null,
+static const tsk_object_def_t trtp_manager_def_s = {
+ sizeof(trtp_manager_t),
+ trtp_manager_ctor,
+ trtp_manager_dtor,
+ tsk_null,
};
const tsk_object_def_t *trtp_manager_def_t = &trtp_manager_def_s;
diff --git a/tinyRTP/src/trtp_srtp.c b/tinyRTP/src/trtp_srtp.c
index 5e2d033..e754a59 100755
--- a/tinyRTP/src/trtp_srtp.c
+++ b/tinyRTP/src/trtp_srtp.c
@@ -33,16 +33,16 @@ int trtp_srtp_ctx_internal_init(struct trtp_srtp_ctx_internal_xs* ctx, int32_t t
char* key_str = ctx->key_str;
err_status_t srtp_err;
tsk_size_t size;
-
+
if (!ctx) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
if (ctx->initialized) {
trtp_srtp_ctx_internal_deinit(ctx);
}
-
+
ctx->tag = tag;
ctx->crypto_type = type;
if (!ctx->have_valid_key) { // use same key to avoid unseless SRTP re-negs (also fix interop-issues against buggy clients -reINVITEs-)
@@ -54,23 +54,21 @@ int trtp_srtp_ctx_internal_init(struct trtp_srtp_ctx_internal_xs* ctx, int32_t t
key_str[size] = '\0';
ctx->have_valid_key = tsk_true;
}
-
- switch(ctx->crypto_type){
- case HMAC_SHA1_80:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtcp);
- break;
- }
- case HMAC_SHA1_32:
- default:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_32(&ctx->policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtcp); // RTCP always 80
- break;
- }
+
+ switch(ctx->crypto_type) {
+ case HMAC_SHA1_80: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtcp);
+ break;
+ }
+ case HMAC_SHA1_32:
+ default: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_32(&ctx->policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&ctx->policy.rtcp); // RTCP always 80
+ break;
}
-
+ }
+
ctx->policy.key = (unsigned char*)ctx->key_bin;
ctx->policy.ssrc.type = ssrc_any_outbound;
ctx->policy.ssrc.value = ssrc;
@@ -86,11 +84,11 @@ int trtp_srtp_ctx_internal_init(struct trtp_srtp_ctx_internal_xs* ctx, int32_t t
int trtp_srtp_ctx_internal_deinit(struct trtp_srtp_ctx_internal_xs* ctx)
{
- if(!ctx){
+ if(!ctx) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(ctx->initialized){
+ if(ctx->initialized) {
/*err_status_t srtp_err =*/ srtp_dealloc(ctx->session);
memset(&ctx->policy, 0, sizeof(ctx->policy));
ctx->initialized = tsk_false;
@@ -101,11 +99,11 @@ int trtp_srtp_ctx_internal_deinit(struct trtp_srtp_ctx_internal_xs* ctx)
int trtp_srtp_ctx_init(trtp_srtp_ctx_xt* ctx, int32_t tag, trtp_srtp_crypto_type_t type, uint32_t ssrc)
{
int ret;
- if(!ctx){
+ if(!ctx) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if((ret = trtp_srtp_ctx_internal_init(&ctx->rtp, tag, type, ssrc))){
+ if((ret = trtp_srtp_ctx_internal_init(&ctx->rtp, tag, type, ssrc))) {
return ret;
}
return trtp_srtp_ctx_internal_init(&ctx->rtcp, tag, type, ssrc);
@@ -114,11 +112,11 @@ int trtp_srtp_ctx_init(trtp_srtp_ctx_xt* ctx, int32_t tag, trtp_srtp_crypto_type
int trtp_srtp_ctx_deinit(trtp_srtp_ctx_xt* ctx)
{
int ret;
- if(!ctx){
+ if(!ctx) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if((ret = trtp_srtp_ctx_internal_deinit(&ctx->rtp))){
+ if((ret = trtp_srtp_ctx_internal_deinit(&ctx->rtp))) {
return ret;
}
return trtp_srtp_ctx_internal_deinit(&ctx->rtcp);
@@ -131,47 +129,46 @@ int trtp_srtp_match_line(const char* crypto_line, int32_t* tag, int32_t* crypto_
char* v = tsk_strtok_r(copyptr, " :|;", &saveptr);
int32_t k = 0;
int ret = -0xF0;
- while(v){
- switch(k){
- case 0:
- {
- if(tag){
- *tag = atoi(v);
- }
- break;
+ while(v) {
+ switch(k) {
+ case 0: {
+ if(tag) {
+ *tag = atoi(v);
}
- case 1:
- {
- if(tsk_striequals(v, TRTP_SRTP_AES_CM_128_HMAC_SHA1_80)){
- if(crypto_type){
- *crypto_type = HMAC_SHA1_80;
- }
- }
- else if(tsk_striequals(v, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32)){
- if(crypto_type){
- *crypto_type = HMAC_SHA1_32;
- }
- }
- else {
- ret = -0xFF; goto bail;
+ break;
+ }
+ case 1: {
+ if(tsk_striequals(v, TRTP_SRTP_AES_CM_128_HMAC_SHA1_80)) {
+ if(crypto_type) {
+ *crypto_type = HMAC_SHA1_80;
}
- break;
}
- case 2:
- {
- if(!tsk_striequals(v, "inline")){
- ret = -0xFF; goto bail;
+ else if(tsk_striequals(v, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32)) {
+ if(crypto_type) {
+ *crypto_type = HMAC_SHA1_32;
}
- break;
}
- case 3:
- {
- if(key && key_size){
- memset(key, 0, key_size);
- memcpy(key, v, TSK_MIN(key_size, tsk_strlen(v)));
- }
- ret = 0; goto bail;
+ else {
+ ret = -0xFF;
+ goto bail;
+ }
+ break;
+ }
+ case 2: {
+ if(!tsk_striequals(v, "inline")) {
+ ret = -0xFF;
+ goto bail;
+ }
+ break;
+ }
+ case 3: {
+ if(key && key_size) {
+ memset(key, 0, key_size);
+ memcpy(key, v, TSK_MIN(key_size, tsk_strlen(v)));
}
+ ret = 0;
+ goto bail;
+ }
}
++k;
v = tsk_strtok_r(tsk_null, " :|;", &saveptr);
@@ -184,11 +181,11 @@ bail:
tsk_size_t trtp_srtp_get_local_contexts(trtp_manager_t* rtp_mgr, const struct trtp_srtp_ctx_xs ** contexts, tsk_size_t contexts_count)
{
tsk_size_t ret = 0;
- if(!rtp_mgr || !contexts){
+ if(!rtp_mgr || !contexts) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
-
+
if (contexts_count > ret && rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80].rtp.initialized) {
contexts[ret++] = &rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80];
}
@@ -207,46 +204,45 @@ int trtp_srtp_set_crypto(struct trtp_manager_s* rtp_mgr, const char* crypto_line
err_status_t srtp_err;
int32_t tag, crypto_type;
char key_str[SRTP_MAX_KEY_LEN + 1];
-
+
memset(key_str, 0, sizeof(key_str));
-
+
if ((ret = trtp_srtp_match_line(crypto_line, &tag, &crypto_type, key_str, sizeof(key_str) - 1))) {
return ret;
}
-
+
srtp_ctx = &rtp_mgr->srtp_contexts[idx][crypto_type];
ret = trtp_srtp_ctx_deinit(srtp_ctx);
-
+
srtp_ctx->rtp.tag = tag;
srtp_ctx->rtp.crypto_type = (trtp_srtp_crypto_type_t)crypto_type;
memcpy(srtp_ctx->rtp.key_str, key_str, sizeof(srtp_ctx->rtp.key_str));
-
- switch(srtp_ctx->rtp.crypto_type){
- case HMAC_SHA1_80:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtcp);
- if (idx == TRTP_SRTP_LINE_IDX_REMOTE) {
- trtp_srtp_ctx_deinit(&rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32]);
- rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80].rtp.tag =
+
+ switch(srtp_ctx->rtp.crypto_type) {
+ case HMAC_SHA1_80: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtcp);
+ if (idx == TRTP_SRTP_LINE_IDX_REMOTE) {
+ trtp_srtp_ctx_deinit(&rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32]);
+ rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80].rtp.tag =
rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80].rtcp.tag = srtp_ctx->rtp.tag;
- }
- break;
}
- case HMAC_SHA1_32:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_32(&srtp_ctx->rtp.policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtcp); // RTCP always 80
- if (idx == TRTP_SRTP_LINE_IDX_REMOTE) {
- trtp_srtp_ctx_deinit(&rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80]);
- rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32].rtp.tag =
+ break;
+ }
+ case HMAC_SHA1_32: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_32(&srtp_ctx->rtp.policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->rtp.policy.rtcp); // RTCP always 80
+ if (idx == TRTP_SRTP_LINE_IDX_REMOTE) {
+ trtp_srtp_ctx_deinit(&rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_80]);
+ rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32].rtp.tag =
rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][HMAC_SHA1_32].rtcp.tag = srtp_ctx->rtp.tag;
- }
- break;
}
- default: break;
+ break;
+ }
+ default:
+ break;
}
-
+
key_bin = (unsigned char*)srtp_ctx->rtp.key_bin;
tsk_base64_decode((const uint8_t*)srtp_ctx->rtp.key_str, (tsk_size_t)tsk_strlen(srtp_ctx->rtp.key_str), (char**)&key_bin);
srtp_ctx->rtp.policy.key = key_bin;
@@ -270,40 +266,38 @@ int trtp_srtp_set_key_and_salt(trtp_manager_t* rtp_mgr, trtp_srtp_crypto_type_t
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
srtp_ctx = is_rtp ? &rtp_mgr->srtp_contexts[idx][crypto_type].rtp : &rtp_mgr->srtp_contexts[idx][crypto_type].rtcp;
if ((ret = trtp_srtp_ctx_internal_deinit(srtp_ctx))) {
return ret;
}
-
+
switch ((srtp_ctx->crypto_type = crypto_type)) {
- case HMAC_SHA1_80:
- default:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtcp);
- break;
- }
- case HMAC_SHA1_32:
- {
- crypto_policy_set_aes_cm_128_hmac_sha1_32(&srtp_ctx->policy.rtp);
- crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtcp); // always 80
- break;
- }
+ case HMAC_SHA1_80:
+ default: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtcp);
+ break;
+ }
+ case HMAC_SHA1_32: {
+ crypto_policy_set_aes_cm_128_hmac_sha1_32(&srtp_ctx->policy.rtp);
+ crypto_policy_set_aes_cm_128_hmac_sha1_80(&srtp_ctx->policy.rtcp); // always 80
+ break;
+ }
}
-
+
memcpy(srtp_ctx->key_bin, key, key_size);
#if HAVE_APPEND_SALT_TO_KEY
append_salt_to_key(srtp_ctx->key_bin, key_size, (void*)salt, salt_size);
#else
memcpy(&srtp_ctx->key_bin[key_size], salt, salt_size);
#endif
-
+
srtp_ctx->policy.key = (unsigned char *)srtp_ctx->key_bin;
srtp_ctx->policy.ssrc.type = idx == TRTP_SRTP_LINE_IDX_REMOTE ? ssrc_any_inbound : ssrc_any_outbound;
srtp_ctx->policy.window_size = 2048;
srtp_ctx->policy.allow_repeat_tx = 1;
- if((srtp_err = srtp_create(&srtp_ctx->session, &srtp_ctx->policy)) != err_status_ok){
+ if((srtp_err = srtp_create(&srtp_ctx->session, &srtp_ctx->policy)) != err_status_ok) {
TSK_DEBUG_ERROR("srtp_create() failed: %d", srtp_err);
return -3;
}
@@ -316,7 +310,7 @@ tsk_bool_t trtp_srtp_is_initialized(trtp_manager_t* rtp_mgr)
if (!rtp_mgr) {
return tsk_false;
}
- return ((rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][0].rtp.initialized || rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][1].rtp.initialized)
+ return ((rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][0].rtp.initialized || rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_LOCAL][1].rtp.initialized)
&& rtp_mgr->srtp_contexts[TRTP_SRTP_LINE_IDX_REMOTE][0].rtp.initialized);
}
diff --git a/tinyRTP/test/test.c b/tinyRTP/test/test.c
index f0f15f6..dc5f9e2 100755
--- a/tinyRTP/test/test.c
+++ b/tinyRTP/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -41,25 +41,25 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- tnet_startup();
+ tnet_startup();
- do{
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009-2010 Mamadou Diop \n\n");
+ do {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009-2010 Mamadou Diop \n\n");
#if RUN_TEST_PARSER || RUN_TEST_ALL
- test_parser();
+ test_parser();
#endif
#if RUN_TEST_MANAGER || RUN_TEST_ALL
- test_manager();
+ test_manager();
#endif
- }
- while(LOOP);
+ }
+ while(LOOP);
- tnet_cleanup();
+ tnet_cleanup();
- return 0;
+ return 0;
}
diff --git a/tinyRTP/test/test_manager.h b/tinyRTP/test/test_manager.h
index 29c2dcc..bbe406c 100755
--- a/tinyRTP/test/test_manager.h
+++ b/tinyRTP/test/test_manager.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -24,45 +24,45 @@
void test_manager()
{
- tsk_size_t i;
- trtp_manager_t* manager;
+ tsk_size_t i;
+ trtp_manager_t* manager;
+
+ if(!(manager = trtp_manager_create(tsk_true, "192.168.0.12", tsk_false))) {
+ goto bail;
+ }
+
+ trtp_manager_set_payload_type(manager, 8);
- if(!(manager = trtp_manager_create(tsk_true, "192.168.0.12", tsk_false))){
- goto bail;
- }
+ /* Prepare: this will allow you to generate local port and ip */
+ if(trtp_manager_prepare(manager)) {
+ goto bail;
+ }
- trtp_manager_set_payload_type(manager, 8);
+ /* set remote parameters (rtcp ip:port not mandator, could be retrieved from rtp values) */
+ if(trtp_manager_set_rtp_remote(manager, "192.168.0.13", 5081)) {
+ goto bail;
+ }
+ if(trtp_manager_set_rtcp_remote(manager, "192.168.0.13", 2861)) {
+ goto bail;
+ }
- /* Prepare: this will allow you to generate local port and ip */
- if(trtp_manager_prepare(manager)){
- goto bail;
- }
+ /* start */
+ if(trtp_manager_start(manager)) {
+ goto bail;
+ }
- /* set remote parameters (rtcp ip:port not mandator, could be retrieved from rtp values) */
- if(trtp_manager_set_rtp_remote(manager, "192.168.0.13", 5081)){
- goto bail;
- }
- if(trtp_manager_set_rtcp_remote(manager, "192.168.0.13", 2861)){
- goto bail;
- }
+ /* send data */
+ for(i=0; i<2; i++) {
+ if(trtp_manager_send_rtp(manager, "test", tsk_strlen("test"), 160, tsk_true)) {
+ goto bail;
+ }
+ }
- /* start */
- if(trtp_manager_start(manager)){
- goto bail;
- }
-
- /* send data */
- for(i=0;i<2; i++){
- if(trtp_manager_send_rtp(manager, "test", tsk_strlen("test"), 160, tsk_true)){
- goto bail;
- }
- }
-
- getchar();
+ getchar();
bail:
- /* stop and destroy */
- TSK_OBJECT_SAFE_FREE(manager);
+ /* stop and destroy */
+ TSK_OBJECT_SAFE_FREE(manager);
}
#endif /* _TEST_MANAGER_H_ */
diff --git a/tinyRTP/test/test_parser.h b/tinyRTP/test/test_parser.h
index a65b816..0d63215 100755
--- a/tinyRTP/test/test_parser.h
+++ b/tinyRTP/test/test_parser.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -23,258 +23,269 @@
#define _TEST_PARSER_H_
char packet_0[] = {
-0x80, 0x88, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0,
-0xd2, 0xbd, 0x4e, 0x3e, 0xdc, 0xde, 0xc4, 0xc5,
-0xdc, 0xd0, 0xd5, 0x51, 0x53, 0x5d, 0x5f, 0x5b,
-0x46, 0x46, 0x46, 0x5b, 0x44, 0x41, 0x42, 0x4f,
-0x42, 0x47, 0x42, 0x43, 0x59, 0x58, 0x59, 0x5f,
-0x5f, 0x52, 0x59, 0x44, 0x44, 0x5f, 0x51, 0x54,
-0x55, 0x55, 0x51, 0x56, 0x50, 0x52, 0x5e, 0x58,
-0x5d, 0x52, 0x52, 0x50, 0x57, 0x54, 0xd4, 0xd6,
-0xd5, 0x51, 0x53, 0x57, 0xd6, 0xd6, 0xd0, 0xd7,
-0x57, 0x56, 0x57, 0xd0, 0xd3, 0xd6, 0xd5, 0x55,
-0x51, 0x50, 0xd6, 0xdf, 0xd2, 0xd1, 0xd4, 0xd6,
-0xdc, 0xdb, 0xda, 0xdd, 0xd6, 0x55, 0xdc, 0xd0,
-0xd4, 0x5d, 0x44, 0x5c, 0x56, 0xd6, 0xd5, 0xd4,
-0xd5, 0xd7, 0x50, 0xd4, 0x51, 0xd0, 0x61, 0x6f,
-0x76, 0xfe, 0xef, 0xf7, 0x77, 0x66, 0x50, 0xff,
-0xe5, 0xd7, 0x74, 0x4a, 0xc9, 0xf9, 0xf7, 0x5c,
-0x76, 0x5f, 0xf5, 0xf3, 0xdd, 0x4e, 0x42, 0xd8,
-0xf7, 0xc9, 0x50, 0x44, 0x50, 0xcd, 0xc9, 0xd4,
-0x4d, 0x41, 0x57, 0xd1, 0x51, 0x58, 0x44, 0x52,
-0xd3, 0xd1, 0x50, 0x58, 0x5b, 0x55, 0xd4, 0x53,
-0x59, 0x43, 0x47, 0x5f, 0x51, 0x5d, 0x56, 0xd2,
-0xde, 0xd7, 0x52, 0xd5 };
+ 0x80, 0x88, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0xdc, 0xde, 0xc4, 0xc5,
+ 0xdc, 0xd0, 0xd5, 0x51, 0x53, 0x5d, 0x5f, 0x5b,
+ 0x46, 0x46, 0x46, 0x5b, 0x44, 0x41, 0x42, 0x4f,
+ 0x42, 0x47, 0x42, 0x43, 0x59, 0x58, 0x59, 0x5f,
+ 0x5f, 0x52, 0x59, 0x44, 0x44, 0x5f, 0x51, 0x54,
+ 0x55, 0x55, 0x51, 0x56, 0x50, 0x52, 0x5e, 0x58,
+ 0x5d, 0x52, 0x52, 0x50, 0x57, 0x54, 0xd4, 0xd6,
+ 0xd5, 0x51, 0x53, 0x57, 0xd6, 0xd6, 0xd0, 0xd7,
+ 0x57, 0x56, 0x57, 0xd0, 0xd3, 0xd6, 0xd5, 0x55,
+ 0x51, 0x50, 0xd6, 0xdf, 0xd2, 0xd1, 0xd4, 0xd6,
+ 0xdc, 0xdb, 0xda, 0xdd, 0xd6, 0x55, 0xdc, 0xd0,
+ 0xd4, 0x5d, 0x44, 0x5c, 0x56, 0xd6, 0xd5, 0xd4,
+ 0xd5, 0xd7, 0x50, 0xd4, 0x51, 0xd0, 0x61, 0x6f,
+ 0x76, 0xfe, 0xef, 0xf7, 0x77, 0x66, 0x50, 0xff,
+ 0xe5, 0xd7, 0x74, 0x4a, 0xc9, 0xf9, 0xf7, 0x5c,
+ 0x76, 0x5f, 0xf5, 0xf3, 0xdd, 0x4e, 0x42, 0xd8,
+ 0xf7, 0xc9, 0x50, 0x44, 0x50, 0xcd, 0xc9, 0xd4,
+ 0x4d, 0x41, 0x57, 0xd1, 0x51, 0x58, 0x44, 0x52,
+ 0xd3, 0xd1, 0x50, 0x58, 0x5b, 0x55, 0xd4, 0x53,
+ 0x59, 0x43, 0x47, 0x5f, 0x51, 0x5d, 0x56, 0xd2,
+ 0xde, 0xd7, 0x52, 0xd5
+};
char packet_1[] = {
-0x80, 0x08, 0x00, 0x02, 0x00, 0x00, 0x01, 0x40,
-0xd2, 0xbd, 0x4e, 0x3e, 0xd2, 0xc7, 0xc5, 0xd3,
-0xd1, 0xd6, 0xd5, 0x55, 0xd2, 0xd2, 0xd3, 0xdf,
-0xc4, 0xd9, 0xdb, 0xc6, 0xc6, 0xc9, 0xc1, 0xf5,
-0xcf, 0xf0, 0xcb, 0xe4, 0x7d, 0x14, 0x7a, 0xfd,
-0xfd, 0x62, 0x63, 0x41, 0xee, 0xe7, 0x40, 0x6c,
-0x46, 0xf8, 0xf3, 0x74, 0x7b, 0x58, 0xf3, 0xf1,
-0xd6, 0x5d, 0xc7, 0xfd, 0xff, 0xf5, 0x55, 0xd9,
-0xcb, 0xcb, 0xde, 0xd1, 0xda, 0xca, 0xcd, 0xc5,
-0xc4, 0x41, 0x72, 0x41, 0x55, 0xda, 0x54, 0x5c,
-0x40, 0x59, 0xd1, 0x5f, 0x4b, 0x40, 0x51, 0x52,
-0x45, 0x4b, 0x77, 0x49, 0x4e, 0x4e, 0x48, 0x4a,
-0x75, 0x47, 0x75, 0x7b, 0x72, 0x42, 0x58, 0x4c,
-0x46, 0xd5, 0xc2, 0xd1, 0x5d, 0x44, 0x50, 0xd0,
-0x53, 0x43, 0x41, 0x52, 0x53, 0x5a, 0x44, 0x50,
-0xdd, 0x45, 0x65, 0x7d, 0x74, 0x4c, 0x70, 0x43,
-0x53, 0xc4, 0xc5, 0x5b, 0x5a, 0x5c, 0x51, 0x4f,
-0x70, 0x4a, 0x58, 0x5e, 0x75, 0x76, 0x40, 0x57,
-0x51, 0x46, 0x5e, 0x5c, 0xd5, 0x5c, 0x5c, 0x5e,
-0x5e, 0x4d, 0x41, 0x44, 0xd4, 0xd6, 0xd5, 0x52,
-0x54, 0xdd, 0xd7, 0xd3, 0x56, 0x51, 0x55, 0xdf,
-0x54, 0xd1, 0xd2, 0xda };
+ 0x80, 0x08, 0x00, 0x02, 0x00, 0x00, 0x01, 0x40,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0xd2, 0xc7, 0xc5, 0xd3,
+ 0xd1, 0xd6, 0xd5, 0x55, 0xd2, 0xd2, 0xd3, 0xdf,
+ 0xc4, 0xd9, 0xdb, 0xc6, 0xc6, 0xc9, 0xc1, 0xf5,
+ 0xcf, 0xf0, 0xcb, 0xe4, 0x7d, 0x14, 0x7a, 0xfd,
+ 0xfd, 0x62, 0x63, 0x41, 0xee, 0xe7, 0x40, 0x6c,
+ 0x46, 0xf8, 0xf3, 0x74, 0x7b, 0x58, 0xf3, 0xf1,
+ 0xd6, 0x5d, 0xc7, 0xfd, 0xff, 0xf5, 0x55, 0xd9,
+ 0xcb, 0xcb, 0xde, 0xd1, 0xda, 0xca, 0xcd, 0xc5,
+ 0xc4, 0x41, 0x72, 0x41, 0x55, 0xda, 0x54, 0x5c,
+ 0x40, 0x59, 0xd1, 0x5f, 0x4b, 0x40, 0x51, 0x52,
+ 0x45, 0x4b, 0x77, 0x49, 0x4e, 0x4e, 0x48, 0x4a,
+ 0x75, 0x47, 0x75, 0x7b, 0x72, 0x42, 0x58, 0x4c,
+ 0x46, 0xd5, 0xc2, 0xd1, 0x5d, 0x44, 0x50, 0xd0,
+ 0x53, 0x43, 0x41, 0x52, 0x53, 0x5a, 0x44, 0x50,
+ 0xdd, 0x45, 0x65, 0x7d, 0x74, 0x4c, 0x70, 0x43,
+ 0x53, 0xc4, 0xc5, 0x5b, 0x5a, 0x5c, 0x51, 0x4f,
+ 0x70, 0x4a, 0x58, 0x5e, 0x75, 0x76, 0x40, 0x57,
+ 0x51, 0x46, 0x5e, 0x5c, 0xd5, 0x5c, 0x5c, 0x5e,
+ 0x5e, 0x4d, 0x41, 0x44, 0xd4, 0xd6, 0xd5, 0x52,
+ 0x54, 0xdd, 0xd7, 0xd3, 0x56, 0x51, 0x55, 0xdf,
+ 0x54, 0xd1, 0xd2, 0xda
+};
char packet_2[] = {
-0x80, 0x08, 0x00, 0x03, 0x00, 0x00, 0x01, 0xe0,
-0xd2, 0xbd, 0x4e, 0x3e, 0xdb, 0xd1, 0xd5, 0xd0,
-0xd2, 0xd3, 0x57, 0xd5, 0xd6, 0xd6, 0xd1, 0xd5,
-0xd1, 0xdd, 0xd5, 0xd1, 0xd1, 0xd4, 0x5f, 0x56,
-0x5f, 0x5a, 0x53, 0x59, 0x5c, 0x5f, 0x5d, 0x5d,
-0xd6, 0xd0, 0xd8, 0x54, 0xc4, 0xd9, 0xc6, 0xdc,
-0x57, 0x56, 0x56, 0x57, 0x51, 0x54, 0x53, 0x57,
-0x59, 0x44, 0x44, 0x5e, 0x45, 0x45, 0x5a, 0x5e,
-0x53, 0x58, 0x4c, 0x45, 0x59, 0x45, 0x5b, 0x57,
-0x52, 0x5e, 0x5e, 0x59, 0x5c, 0x51, 0xd7, 0xd0,
-0xc5, 0xc1, 0xd8, 0xc1, 0xcd, 0xcd, 0xc2, 0xcd,
-0xc6, 0xcc, 0xc0, 0xc6, 0xc1, 0xc9, 0xcb, 0xdb,
-0xd0, 0xdd, 0xc6, 0xd8, 0xd5, 0x5f, 0x41, 0x46,
-0x4f, 0x74, 0x76, 0x70, 0x72, 0x7f, 0x72, 0x77,
-0x49, 0x4a, 0x76, 0x4a, 0x44, 0x45, 0x44, 0x59,
-0x50, 0x55, 0xd3, 0xd9, 0xcc, 0xf7, 0xf1, 0xca,
-0xc2, 0xf7, 0xf8, 0xe7, 0xe7, 0xe2, 0xee, 0xe9,
-0xed, 0xe4, 0xc2, 0xcb, 0xf7, 0xd2, 0x48, 0x76,
-0x45, 0x77, 0x64, 0x64, 0x4a, 0x51, 0x46, 0x41,
-0xdd, 0xc2, 0xd4, 0x51, 0x50, 0x4a, 0x74, 0x71,
-0x7e, 0x61, 0x67, 0x7e, 0x67, 0x60, 0x67, 0x77,
-0x45, 0x43, 0x5f, 0xc8 };
+ 0x80, 0x08, 0x00, 0x03, 0x00, 0x00, 0x01, 0xe0,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0xdb, 0xd1, 0xd5, 0xd0,
+ 0xd2, 0xd3, 0x57, 0xd5, 0xd6, 0xd6, 0xd1, 0xd5,
+ 0xd1, 0xdd, 0xd5, 0xd1, 0xd1, 0xd4, 0x5f, 0x56,
+ 0x5f, 0x5a, 0x53, 0x59, 0x5c, 0x5f, 0x5d, 0x5d,
+ 0xd6, 0xd0, 0xd8, 0x54, 0xc4, 0xd9, 0xc6, 0xdc,
+ 0x57, 0x56, 0x56, 0x57, 0x51, 0x54, 0x53, 0x57,
+ 0x59, 0x44, 0x44, 0x5e, 0x45, 0x45, 0x5a, 0x5e,
+ 0x53, 0x58, 0x4c, 0x45, 0x59, 0x45, 0x5b, 0x57,
+ 0x52, 0x5e, 0x5e, 0x59, 0x5c, 0x51, 0xd7, 0xd0,
+ 0xc5, 0xc1, 0xd8, 0xc1, 0xcd, 0xcd, 0xc2, 0xcd,
+ 0xc6, 0xcc, 0xc0, 0xc6, 0xc1, 0xc9, 0xcb, 0xdb,
+ 0xd0, 0xdd, 0xc6, 0xd8, 0xd5, 0x5f, 0x41, 0x46,
+ 0x4f, 0x74, 0x76, 0x70, 0x72, 0x7f, 0x72, 0x77,
+ 0x49, 0x4a, 0x76, 0x4a, 0x44, 0x45, 0x44, 0x59,
+ 0x50, 0x55, 0xd3, 0xd9, 0xcc, 0xf7, 0xf1, 0xca,
+ 0xc2, 0xf7, 0xf8, 0xe7, 0xe7, 0xe2, 0xee, 0xe9,
+ 0xed, 0xe4, 0xc2, 0xcb, 0xf7, 0xd2, 0x48, 0x76,
+ 0x45, 0x77, 0x64, 0x64, 0x4a, 0x51, 0x46, 0x41,
+ 0xdd, 0xc2, 0xd4, 0x51, 0x50, 0x4a, 0x74, 0x71,
+ 0x7e, 0x61, 0x67, 0x7e, 0x67, 0x60, 0x67, 0x77,
+ 0x45, 0x43, 0x5f, 0xc8
+};
char packet_3[] = {
-0x80, 0x08, 0x2c, 0x43, 0x11, 0x47, 0x31, 0xa2,
-0x58, 0xf3, 0x3d, 0xea, 0x53, 0x45, 0x56, 0x47,
-0x5f, 0xd4, 0xd4, 0x55, 0x56, 0x58, 0x40, 0x53,
-0x54, 0xd5, 0xc7, 0xc4, 0x57, 0xd5, 0xdd, 0xd9,
-0xde, 0xdd, 0xdc, 0xd4, 0x55, 0x54, 0xdc, 0xcf,
-0xc7, 0x5e, 0x43, 0x5a, 0x5a, 0x43, 0x5b, 0x51,
-0x54, 0x51, 0xd6, 0xd4, 0x5b, 0x53, 0xd3, 0x57,
-0xd5, 0xc0, 0xc7, 0x53, 0x5d, 0xd1, 0xc5, 0xc1,
-0xd9, 0x5d, 0x57, 0xdc, 0xd0, 0xd0, 0x54, 0x45,
-0x44, 0x42, 0x45, 0xd0, 0xd4, 0xd5, 0xd9, 0xc7,
-0x57, 0x5e, 0x5f, 0x47, 0x56, 0xc5, 0xca, 0xc5,
-0xd3, 0xdf, 0x57, 0x43, 0x4b, 0x5a, 0x5c, 0x5f,
-0x45, 0x52, 0xd0, 0xc7, 0xcb, 0xc9, 0xc5, 0x5f,
-0x47, 0x57, 0x55, 0xdc, 0xc7, 0x5d, 0x4b, 0x5a,
-0xdb, 0xcf, 0xc5, 0x52, 0x43, 0x5a, 0x56, 0xde,
-0xdf, 0xd6, 0xd5, 0x45, 0x5b, 0xdc, 0xdb, 0x55,
-0x52, 0x54, 0x51, 0xd5, 0xc4, 0xdf, 0xd1, 0x56,
-0x51, 0xd5, 0xd3, 0xde, 0x54, 0x44, 0x46, 0x52,
-0x56, 0x5b, 0x5a, 0xd3, 0xc3, 0xdf, 0x57, 0xd1,
-0xd9, 0xd6, 0x5f, 0x5f, 0xd4, 0xd6, 0xd5, 0xd1,
-0x53, 0xd4, 0xc1, 0xdb, 0xdd, 0xd8, 0xd7, 0x47,
-0x4b, 0x75, 0x4c, 0x5c };
+ 0x80, 0x08, 0x2c, 0x43, 0x11, 0x47, 0x31, 0xa2,
+ 0x58, 0xf3, 0x3d, 0xea, 0x53, 0x45, 0x56, 0x47,
+ 0x5f, 0xd4, 0xd4, 0x55, 0x56, 0x58, 0x40, 0x53,
+ 0x54, 0xd5, 0xc7, 0xc4, 0x57, 0xd5, 0xdd, 0xd9,
+ 0xde, 0xdd, 0xdc, 0xd4, 0x55, 0x54, 0xdc, 0xcf,
+ 0xc7, 0x5e, 0x43, 0x5a, 0x5a, 0x43, 0x5b, 0x51,
+ 0x54, 0x51, 0xd6, 0xd4, 0x5b, 0x53, 0xd3, 0x57,
+ 0xd5, 0xc0, 0xc7, 0x53, 0x5d, 0xd1, 0xc5, 0xc1,
+ 0xd9, 0x5d, 0x57, 0xdc, 0xd0, 0xd0, 0x54, 0x45,
+ 0x44, 0x42, 0x45, 0xd0, 0xd4, 0xd5, 0xd9, 0xc7,
+ 0x57, 0x5e, 0x5f, 0x47, 0x56, 0xc5, 0xca, 0xc5,
+ 0xd3, 0xdf, 0x57, 0x43, 0x4b, 0x5a, 0x5c, 0x5f,
+ 0x45, 0x52, 0xd0, 0xc7, 0xcb, 0xc9, 0xc5, 0x5f,
+ 0x47, 0x57, 0x55, 0xdc, 0xc7, 0x5d, 0x4b, 0x5a,
+ 0xdb, 0xcf, 0xc5, 0x52, 0x43, 0x5a, 0x56, 0xde,
+ 0xdf, 0xd6, 0xd5, 0x45, 0x5b, 0xdc, 0xdb, 0x55,
+ 0x52, 0x54, 0x51, 0xd5, 0xc4, 0xdf, 0xd1, 0x56,
+ 0x51, 0xd5, 0xd3, 0xde, 0x54, 0x44, 0x46, 0x52,
+ 0x56, 0x5b, 0x5a, 0xd3, 0xc3, 0xdf, 0x57, 0xd1,
+ 0xd9, 0xd6, 0x5f, 0x5f, 0xd4, 0xd6, 0xd5, 0xd1,
+ 0x53, 0xd4, 0xc1, 0xdb, 0xdd, 0xd8, 0xd7, 0x47,
+ 0x4b, 0x75, 0x4c, 0x5c
+};
char packet_4[] = {
-0x80, 0x08, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80,
-0xd2, 0xbd, 0x4e, 0x3e, 0xff, 0xf3, 0xff, 0xe1,
-0xe7, 0xe4, 0xe5, 0xe2, 0xec, 0xef, 0xeb, 0xe9,
-0x95, 0x97, 0xf8, 0xcc, 0xe4, 0xf9, 0x58, 0x6d,
-0x72, 0x46, 0x7c, 0x62, 0x60, 0x42, 0x40, 0x70,
-0x4e, 0xd3, 0xcb, 0xda, 0xd9, 0x54, 0x57, 0xd6,
-0x4a, 0x62, 0x6e, 0x64, 0x60, 0x15, 0x15, 0x63,
-0x67, 0x62, 0x60, 0x7f, 0x46, 0x46, 0x40, 0xd5,
-0xcf, 0xf6, 0xc9, 0xcb, 0xf0, 0xfd, 0xf8, 0xe6,
-0xec, 0xe9, 0x94, 0x91, 0x96, 0xf7, 0xd0, 0xe7,
-0xf3, 0x7d, 0x6b, 0x7d, 0x5d, 0x65, 0x68, 0x61,
-0x5d, 0x5c, 0x72, 0x43, 0xcd, 0xf6, 0xdf, 0xd2,
-0xd2, 0x51, 0xdf, 0x49, 0x62, 0x14, 0x68, 0x6e,
-0x10, 0x11, 0x69, 0x64, 0x61, 0x6d, 0x64, 0x75,
-0x44, 0x74, 0x5e, 0xcf, 0xff, 0xf1, 0xc1, 0xf7,
-0xf6, 0xe5, 0xe4, 0xe6, 0xe9, 0x91, 0x93, 0x90,
-0x95, 0xce, 0xe5, 0xe0, 0xc7, 0x66, 0x62, 0x45,
-0x75, 0x63, 0x6e, 0x79, 0x55, 0x49, 0x71, 0x53,
-0xca, 0xcb, 0xd0, 0xdb, 0xd3, 0xd5, 0x5b, 0x67,
-0x6b, 0x15, 0x61, 0x69, 0x17, 0x14, 0x6c, 0x66,
-0x6f, 0x62, 0x7f, 0x48, 0x74, 0x75, 0x59, 0xd0,
-0xdb, 0x54, 0xd7, 0xc3 };
+ 0x80, 0x08, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0xff, 0xf3, 0xff, 0xe1,
+ 0xe7, 0xe4, 0xe5, 0xe2, 0xec, 0xef, 0xeb, 0xe9,
+ 0x95, 0x97, 0xf8, 0xcc, 0xe4, 0xf9, 0x58, 0x6d,
+ 0x72, 0x46, 0x7c, 0x62, 0x60, 0x42, 0x40, 0x70,
+ 0x4e, 0xd3, 0xcb, 0xda, 0xd9, 0x54, 0x57, 0xd6,
+ 0x4a, 0x62, 0x6e, 0x64, 0x60, 0x15, 0x15, 0x63,
+ 0x67, 0x62, 0x60, 0x7f, 0x46, 0x46, 0x40, 0xd5,
+ 0xcf, 0xf6, 0xc9, 0xcb, 0xf0, 0xfd, 0xf8, 0xe6,
+ 0xec, 0xe9, 0x94, 0x91, 0x96, 0xf7, 0xd0, 0xe7,
+ 0xf3, 0x7d, 0x6b, 0x7d, 0x5d, 0x65, 0x68, 0x61,
+ 0x5d, 0x5c, 0x72, 0x43, 0xcd, 0xf6, 0xdf, 0xd2,
+ 0xd2, 0x51, 0xdf, 0x49, 0x62, 0x14, 0x68, 0x6e,
+ 0x10, 0x11, 0x69, 0x64, 0x61, 0x6d, 0x64, 0x75,
+ 0x44, 0x74, 0x5e, 0xcf, 0xff, 0xf1, 0xc1, 0xf7,
+ 0xf6, 0xe5, 0xe4, 0xe6, 0xe9, 0x91, 0x93, 0x90,
+ 0x95, 0xce, 0xe5, 0xe0, 0xc7, 0x66, 0x62, 0x45,
+ 0x75, 0x63, 0x6e, 0x79, 0x55, 0x49, 0x71, 0x53,
+ 0xca, 0xcb, 0xd0, 0xdb, 0xd3, 0xd5, 0x5b, 0x67,
+ 0x6b, 0x15, 0x61, 0x69, 0x17, 0x14, 0x6c, 0x66,
+ 0x6f, 0x62, 0x7f, 0x48, 0x74, 0x75, 0x59, 0xd0,
+ 0xdb, 0x54, 0xd7, 0xc3
+};
char packet_5[] = {
-0x80, 0x08, 0x2c, 0x44, 0x11, 0x47, 0x32, 0x42,
-0x58, 0xf3, 0x3d, 0xea, 0x54, 0xd5, 0xde, 0xc4,
-0xc0, 0xce, 0xd8, 0xd5, 0xdc, 0xde, 0xd4, 0xd9,
-0x54, 0x4d, 0x74, 0x47, 0x44, 0x58, 0xc7, 0xc3,
-0xc4, 0xd4, 0x55, 0x50, 0x43, 0x45, 0xd4, 0xc7,
-0xcf, 0xc0, 0x55, 0x42, 0x48, 0x76, 0x4f, 0xd7,
-0xc7, 0xcf, 0xc6, 0xc6, 0xf5, 0xc6, 0x53, 0x5a,
-0x42, 0x5e, 0x51, 0xd6, 0xc4, 0xde, 0x56, 0x42,
-0x42, 0x5e, 0xd7, 0xd4, 0xdb, 0xcb, 0xda, 0xd6,
-0xd7, 0x53, 0x47, 0x4d, 0xd4, 0xdf, 0xdc, 0xd5,
-0x5a, 0x59, 0x5a, 0x5a, 0xd5, 0xc4, 0xd7, 0x55,
-0xc3, 0xce, 0xde, 0xd2, 0xd6, 0x46, 0x71, 0x7c,
-0x4c, 0xd8, 0xf5, 0xf7, 0xcf, 0x54, 0x56, 0xd5,
-0xdc, 0xda, 0xd7, 0xd7, 0x57, 0x5a, 0x5c, 0x52,
-0x47, 0x5c, 0xd4, 0xd3, 0xd4, 0x47, 0x42, 0x4d,
-0x54, 0xcf, 0xf3, 0xf0, 0xc0, 0xdb, 0xd1, 0x50,
-0x47, 0x5e, 0x58, 0x49, 0x43, 0x5a, 0x54, 0xdc,
-0x56, 0x56, 0xd9, 0xc8, 0xc2, 0xd2, 0x5d, 0x5a,
-0x5a, 0x49, 0x40, 0x57, 0xda, 0xdb, 0xd6, 0x55,
-0xdd, 0xcf, 0xdb, 0x5c, 0x51, 0xd0, 0xd5, 0x5f,
-0x53, 0xd8, 0xc3, 0xc3, 0xd0, 0x5c, 0x5b, 0x44,
-0x4e, 0x74, 0x4f, 0x56 };
+ 0x80, 0x08, 0x2c, 0x44, 0x11, 0x47, 0x32, 0x42,
+ 0x58, 0xf3, 0x3d, 0xea, 0x54, 0xd5, 0xde, 0xc4,
+ 0xc0, 0xce, 0xd8, 0xd5, 0xdc, 0xde, 0xd4, 0xd9,
+ 0x54, 0x4d, 0x74, 0x47, 0x44, 0x58, 0xc7, 0xc3,
+ 0xc4, 0xd4, 0x55, 0x50, 0x43, 0x45, 0xd4, 0xc7,
+ 0xcf, 0xc0, 0x55, 0x42, 0x48, 0x76, 0x4f, 0xd7,
+ 0xc7, 0xcf, 0xc6, 0xc6, 0xf5, 0xc6, 0x53, 0x5a,
+ 0x42, 0x5e, 0x51, 0xd6, 0xc4, 0xde, 0x56, 0x42,
+ 0x42, 0x5e, 0xd7, 0xd4, 0xdb, 0xcb, 0xda, 0xd6,
+ 0xd7, 0x53, 0x47, 0x4d, 0xd4, 0xdf, 0xdc, 0xd5,
+ 0x5a, 0x59, 0x5a, 0x5a, 0xd5, 0xc4, 0xd7, 0x55,
+ 0xc3, 0xce, 0xde, 0xd2, 0xd6, 0x46, 0x71, 0x7c,
+ 0x4c, 0xd8, 0xf5, 0xf7, 0xcf, 0x54, 0x56, 0xd5,
+ 0xdc, 0xda, 0xd7, 0xd7, 0x57, 0x5a, 0x5c, 0x52,
+ 0x47, 0x5c, 0xd4, 0xd3, 0xd4, 0x47, 0x42, 0x4d,
+ 0x54, 0xcf, 0xf3, 0xf0, 0xc0, 0xdb, 0xd1, 0x50,
+ 0x47, 0x5e, 0x58, 0x49, 0x43, 0x5a, 0x54, 0xdc,
+ 0x56, 0x56, 0xd9, 0xc8, 0xc2, 0xd2, 0x5d, 0x5a,
+ 0x5a, 0x49, 0x40, 0x57, 0xda, 0xdb, 0xd6, 0x55,
+ 0xdd, 0xcf, 0xdb, 0x5c, 0x51, 0xd0, 0xd5, 0x5f,
+ 0x53, 0xd8, 0xc3, 0xc3, 0xd0, 0x5c, 0x5b, 0x44,
+ 0x4e, 0x74, 0x4f, 0x56
+};
char packet_6[] = {
-0x80, 0x08, 0x00, 0x05, 0x00, 0x00, 0x03, 0x20,
-0xd2, 0xbd, 0x4e, 0x3e, 0xca, 0xf0, 0xfd, 0xe2,
-0xea, 0x96, 0x91, 0x91, 0xe7, 0xd9, 0xf9, 0xf9,
-0x48, 0x6b, 0x61, 0x74, 0x66, 0x15, 0x69, 0x74,
-0x42, 0x7d, 0x75, 0xd2, 0xf7, 0xc8, 0xc3, 0xd1,
-0x5f, 0x5f, 0x7d, 0x6f, 0x15, 0x6d, 0x6e, 0x16,
-0x16, 0x68, 0x61, 0x62, 0x6c, 0x66, 0x79, 0x7d,
-0x7f, 0x77, 0x5c, 0xd9, 0xdb, 0x5e, 0x55, 0xcf,
-0xf1, 0xf0, 0xe5, 0xef, 0x95, 0x96, 0x93, 0x97,
-0xcd, 0xc3, 0xe4, 0xf7, 0x64, 0x15, 0x7a, 0x73,
-0x60, 0x68, 0x64, 0xd1, 0x53, 0x4e, 0x5d, 0xf7,
-0xf9, 0xf3, 0xf5, 0xd5, 0xd4, 0x58, 0x67, 0x6e,
-0x6c, 0x61, 0x68, 0x14, 0x68, 0x61, 0x64, 0x63,
-0x61, 0x79, 0x75, 0x4b, 0x4f, 0x44, 0xd7, 0xcb,
-0xc0, 0xd8, 0xf6, 0xe4, 0xe1, 0xe7, 0xed, 0x97,
-0x91, 0x93, 0x9d, 0x96, 0xff, 0xfd, 0xe5, 0xc7,
-0x66, 0x67, 0x4d, 0x4e, 0x64, 0x62, 0x71, 0x54,
-0xd5, 0x5f, 0xd0, 0xce, 0xce, 0xdf, 0x5d, 0x73,
-0x72, 0x73, 0x6c, 0x15, 0x6d, 0x6d, 0x15, 0x14,
-0x69, 0x63, 0x62, 0x62, 0x66, 0x78, 0x72, 0x76,
-0x43, 0x5b, 0xd5, 0xc0, 0xd9, 0xdd, 0xca, 0xf8,
-0xe4, 0xe7, 0xef, 0x96 };
+ 0x80, 0x08, 0x00, 0x05, 0x00, 0x00, 0x03, 0x20,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0xca, 0xf0, 0xfd, 0xe2,
+ 0xea, 0x96, 0x91, 0x91, 0xe7, 0xd9, 0xf9, 0xf9,
+ 0x48, 0x6b, 0x61, 0x74, 0x66, 0x15, 0x69, 0x74,
+ 0x42, 0x7d, 0x75, 0xd2, 0xf7, 0xc8, 0xc3, 0xd1,
+ 0x5f, 0x5f, 0x7d, 0x6f, 0x15, 0x6d, 0x6e, 0x16,
+ 0x16, 0x68, 0x61, 0x62, 0x6c, 0x66, 0x79, 0x7d,
+ 0x7f, 0x77, 0x5c, 0xd9, 0xdb, 0x5e, 0x55, 0xcf,
+ 0xf1, 0xf0, 0xe5, 0xef, 0x95, 0x96, 0x93, 0x97,
+ 0xcd, 0xc3, 0xe4, 0xf7, 0x64, 0x15, 0x7a, 0x73,
+ 0x60, 0x68, 0x64, 0xd1, 0x53, 0x4e, 0x5d, 0xf7,
+ 0xf9, 0xf3, 0xf5, 0xd5, 0xd4, 0x58, 0x67, 0x6e,
+ 0x6c, 0x61, 0x68, 0x14, 0x68, 0x61, 0x64, 0x63,
+ 0x61, 0x79, 0x75, 0x4b, 0x4f, 0x44, 0xd7, 0xcb,
+ 0xc0, 0xd8, 0xf6, 0xe4, 0xe1, 0xe7, 0xed, 0x97,
+ 0x91, 0x93, 0x9d, 0x96, 0xff, 0xfd, 0xe5, 0xc7,
+ 0x66, 0x67, 0x4d, 0x4e, 0x64, 0x62, 0x71, 0x54,
+ 0xd5, 0x5f, 0xd0, 0xce, 0xce, 0xdf, 0x5d, 0x73,
+ 0x72, 0x73, 0x6c, 0x15, 0x6d, 0x6d, 0x15, 0x14,
+ 0x69, 0x63, 0x62, 0x62, 0x66, 0x78, 0x72, 0x76,
+ 0x43, 0x5b, 0xd5, 0xc0, 0xd9, 0xdd, 0xca, 0xf8,
+ 0xe4, 0xe7, 0xef, 0x96
+};
char packet_7[] = {
-0x80, 0x08, 0x2c, 0x45, 0x11, 0x47, 0x32, 0xe2,
-0x58, 0xf3, 0x3d, 0xea, 0xdd, 0xd9, 0xd2, 0xd6,
-0xd0, 0xd6, 0xdf, 0xd7, 0xd7, 0x54, 0xd5, 0x57,
-0x57, 0xd0, 0xd4, 0x55, 0xd5, 0xd8, 0xdb, 0xc0,
-0xc2, 0x53, 0x58, 0x5d, 0x57, 0x5e, 0x47, 0x41,
-0x4a, 0x5f, 0xde, 0xd9, 0x55, 0xd0, 0xc5, 0xdd,
-0xd3, 0xdd, 0xc6, 0xc1, 0xd1, 0x52, 0x5b, 0xd1,
-0xcc, 0xd9, 0x43, 0x7a, 0x78, 0x4e, 0x55, 0xd2,
-0xc5, 0xc3, 0xda, 0xc5, 0xd4, 0xd3, 0xc7, 0xd2,
-0xd9, 0xdb, 0x55, 0x45, 0x59, 0x51, 0x59, 0xd4,
-0xc2, 0xc6, 0xd0, 0xd1, 0x59, 0x48, 0x40, 0x47,
-0x5a, 0x55, 0xd2, 0xdc, 0xd9, 0xc9, 0xf6, 0xd9,
-0x42, 0x72, 0x40, 0xd1, 0x50, 0xd7, 0xc4, 0xc9,
-0xc5, 0xc1, 0xc3, 0x54, 0x5b, 0x48, 0x43, 0x57,
-0xd3, 0xd1, 0x5c, 0x47, 0x47, 0x49, 0x47, 0x59,
-0xd1, 0xf5, 0xd8, 0xd6, 0xdd, 0xd8, 0x5c, 0x53,
-0xc7, 0xc9, 0xc9, 0xc0, 0xd4, 0x4d, 0x4f, 0x47,
-0x50, 0xdf, 0xce, 0xd8, 0x5d, 0x43, 0x40, 0x5f,
-0xd1, 0x56, 0x58, 0xd0, 0xd0, 0xd0, 0xdb, 0x55,
-0x5b, 0x5b, 0xd4, 0xda, 0xc0, 0xc6, 0xd4, 0x58,
-0x5a, 0xd8, 0xc7, 0xdf, 0x54, 0x4a, 0x71, 0x43,
-0xd0, 0xc3, 0xc9, 0xde };
+ 0x80, 0x08, 0x2c, 0x45, 0x11, 0x47, 0x32, 0xe2,
+ 0x58, 0xf3, 0x3d, 0xea, 0xdd, 0xd9, 0xd2, 0xd6,
+ 0xd0, 0xd6, 0xdf, 0xd7, 0xd7, 0x54, 0xd5, 0x57,
+ 0x57, 0xd0, 0xd4, 0x55, 0xd5, 0xd8, 0xdb, 0xc0,
+ 0xc2, 0x53, 0x58, 0x5d, 0x57, 0x5e, 0x47, 0x41,
+ 0x4a, 0x5f, 0xde, 0xd9, 0x55, 0xd0, 0xc5, 0xdd,
+ 0xd3, 0xdd, 0xc6, 0xc1, 0xd1, 0x52, 0x5b, 0xd1,
+ 0xcc, 0xd9, 0x43, 0x7a, 0x78, 0x4e, 0x55, 0xd2,
+ 0xc5, 0xc3, 0xda, 0xc5, 0xd4, 0xd3, 0xc7, 0xd2,
+ 0xd9, 0xdb, 0x55, 0x45, 0x59, 0x51, 0x59, 0xd4,
+ 0xc2, 0xc6, 0xd0, 0xd1, 0x59, 0x48, 0x40, 0x47,
+ 0x5a, 0x55, 0xd2, 0xdc, 0xd9, 0xc9, 0xf6, 0xd9,
+ 0x42, 0x72, 0x40, 0xd1, 0x50, 0xd7, 0xc4, 0xc9,
+ 0xc5, 0xc1, 0xc3, 0x54, 0x5b, 0x48, 0x43, 0x57,
+ 0xd3, 0xd1, 0x5c, 0x47, 0x47, 0x49, 0x47, 0x59,
+ 0xd1, 0xf5, 0xd8, 0xd6, 0xdd, 0xd8, 0x5c, 0x53,
+ 0xc7, 0xc9, 0xc9, 0xc0, 0xd4, 0x4d, 0x4f, 0x47,
+ 0x50, 0xdf, 0xce, 0xd8, 0x5d, 0x43, 0x40, 0x5f,
+ 0xd1, 0x56, 0x58, 0xd0, 0xd0, 0xd0, 0xdb, 0x55,
+ 0x5b, 0x5b, 0xd4, 0xda, 0xc0, 0xc6, 0xd4, 0x58,
+ 0x5a, 0xd8, 0xc7, 0xdf, 0x54, 0x4a, 0x71, 0x43,
+ 0xd0, 0xc3, 0xc9, 0xde
+};
char packet_8[] = {
-0x80, 0x08, 0x00, 0x06, 0x00, 0x00, 0x03, 0xc0,
-0xd2, 0xbd, 0x4e, 0x3e, 0x90, 0x93, 0x92, 0x92,
-0xe0, 0xf1, 0xff, 0xf6, 0x73, 0x60, 0x73, 0x75,
-0x7f, 0x66, 0x7e, 0x5b, 0xd7, 0x56, 0xd5, 0xd2,
-0xdf, 0xd2, 0xd0, 0x48, 0x78, 0x65, 0x66, 0x6f,
-0x6b, 0x6c, 0x6f, 0x68, 0x6b, 0x6e, 0x6c, 0x62,
-0x65, 0x78, 0x7d, 0x48, 0x4b, 0x4a, 0x42, 0xda,
-0xf4, 0xc0, 0xcf, 0xfd, 0xe6, 0xe0, 0xe3, 0xe9,
-0x91, 0x92, 0x9c, 0x9f, 0x90, 0xe2, 0xe7, 0xfa,
-0xc3, 0x46, 0x75, 0x5f, 0x47, 0x42, 0x48, 0x44,
-0xd3, 0xd0, 0xc5, 0xdf, 0xd2, 0xd8, 0xd8, 0x58,
-0x7c, 0x72, 0x73, 0x7e, 0x60, 0x61, 0x65, 0x67,
-0x60, 0x6d, 0x66, 0x7c, 0x71, 0x7d, 0x7d, 0x4a,
-0xd4, 0xd8, 0xd2, 0xc1, 0xf5, 0xce, 0xdb, 0xf0,
-0xe6, 0xe6, 0xe6, 0xed, 0xea, 0x97, 0x91, 0x92,
-0x9c, 0x97, 0xe4, 0xfb, 0xe4, 0xc1, 0x74, 0x40,
-0x54, 0x50, 0x4e, 0x75, 0x45, 0x54, 0x50, 0x44,
-0x5f, 0x5d, 0x5b, 0x46, 0x73, 0x64, 0x7a, 0x7e,
-0x67, 0x63, 0x66, 0x60, 0x6c, 0x69, 0x6c, 0x60,
-0x64, 0x7a, 0x7b, 0x7c, 0x48, 0x45, 0x5b, 0x59,
-0xd8, 0xca, 0xcc, 0xc3, 0xf0, 0xfa, 0xe5, 0xe1,
-0xed, 0xea, 0x96, 0x91 };
+ 0x80, 0x08, 0x00, 0x06, 0x00, 0x00, 0x03, 0xc0,
+ 0xd2, 0xbd, 0x4e, 0x3e, 0x90, 0x93, 0x92, 0x92,
+ 0xe0, 0xf1, 0xff, 0xf6, 0x73, 0x60, 0x73, 0x75,
+ 0x7f, 0x66, 0x7e, 0x5b, 0xd7, 0x56, 0xd5, 0xd2,
+ 0xdf, 0xd2, 0xd0, 0x48, 0x78, 0x65, 0x66, 0x6f,
+ 0x6b, 0x6c, 0x6f, 0x68, 0x6b, 0x6e, 0x6c, 0x62,
+ 0x65, 0x78, 0x7d, 0x48, 0x4b, 0x4a, 0x42, 0xda,
+ 0xf4, 0xc0, 0xcf, 0xfd, 0xe6, 0xe0, 0xe3, 0xe9,
+ 0x91, 0x92, 0x9c, 0x9f, 0x90, 0xe2, 0xe7, 0xfa,
+ 0xc3, 0x46, 0x75, 0x5f, 0x47, 0x42, 0x48, 0x44,
+ 0xd3, 0xd0, 0xc5, 0xdf, 0xd2, 0xd8, 0xd8, 0x58,
+ 0x7c, 0x72, 0x73, 0x7e, 0x60, 0x61, 0x65, 0x67,
+ 0x60, 0x6d, 0x66, 0x7c, 0x71, 0x7d, 0x7d, 0x4a,
+ 0xd4, 0xd8, 0xd2, 0xc1, 0xf5, 0xce, 0xdb, 0xf0,
+ 0xe6, 0xe6, 0xe6, 0xed, 0xea, 0x97, 0x91, 0x92,
+ 0x9c, 0x97, 0xe4, 0xfb, 0xe4, 0xc1, 0x74, 0x40,
+ 0x54, 0x50, 0x4e, 0x75, 0x45, 0x54, 0x50, 0x44,
+ 0x5f, 0x5d, 0x5b, 0x46, 0x73, 0x64, 0x7a, 0x7e,
+ 0x67, 0x63, 0x66, 0x60, 0x6c, 0x69, 0x6c, 0x60,
+ 0x64, 0x7a, 0x7b, 0x7c, 0x48, 0x45, 0x5b, 0x59,
+ 0xd8, 0xca, 0xcc, 0xc3, 0xf0, 0xfa, 0xe5, 0xe1,
+ 0xed, 0xea, 0x96, 0x91
+};
char packet_9[] = {
-0x80, 0x08, 0x2c, 0x46, 0x11, 0x47, 0x33, 0x82,
-0x58, 0xf3, 0x3d, 0xea, 0x5b, 0x47, 0x55, 0xdf,
-0xd1, 0xd5, 0x54, 0xd3, 0xc4, 0x55, 0x5e, 0x56,
-0xd1, 0xd2, 0xde, 0xdd, 0x54, 0x5c, 0x45, 0x5d,
-0x55, 0x5d, 0x59, 0xd6, 0x55, 0x5a, 0xd3, 0xd9,
-0xd0, 0xdc, 0xd8, 0xd8, 0xc6, 0xca, 0xc6, 0xd1,
-0x5a, 0x7f, 0x7e, 0x4f, 0xdd, 0xd9, 0x57, 0x45,
-0x59, 0xd7, 0xdd, 0xc3, 0xc6, 0x54, 0x5c, 0xd4,
-0xdd, 0xdd, 0x5d, 0x43, 0x55, 0xdf, 0xda, 0xcc,
-0xc9, 0x54, 0x4f, 0x5c, 0x55, 0xd2, 0xd0, 0xd1,
-0x52, 0x5f, 0xdd, 0x53, 0x58, 0x53, 0xd6, 0xdd,
-0xd9, 0xdc, 0xc1, 0xd7, 0x4a, 0x4e, 0x47, 0x51,
-0xdf, 0xf5, 0xc6, 0x57, 0x5b, 0x75, 0x74, 0x55,
-0xf6, 0xdb, 0x5e, 0x50, 0xd4, 0xd3, 0x56, 0x58,
-0x5f, 0xd7, 0xdd, 0xde, 0xd2, 0xd5, 0x4d, 0x71,
-0x5f, 0xf4, 0xf2, 0xc0, 0x50, 0x41, 0x5c, 0xd0,
-0xd7, 0xdc, 0xd1, 0x45, 0x4e, 0x5c, 0x54, 0x5e,
-0x77, 0x72, 0x5a, 0xcf, 0xf2, 0xf4, 0xda, 0xd2,
-0xd6, 0x58, 0x5e, 0xdf, 0xc1, 0xc2, 0x57, 0x40,
-0x56, 0xd7, 0xd7, 0xd5, 0x56, 0x45, 0x43, 0x50,
-0xd9, 0xd2, 0x52, 0x5e, 0x5d, 0xd2, 0xd8, 0xd2,
-0x54, 0x58, 0x41, 0x43 };
+ 0x80, 0x08, 0x2c, 0x46, 0x11, 0x47, 0x33, 0x82,
+ 0x58, 0xf3, 0x3d, 0xea, 0x5b, 0x47, 0x55, 0xdf,
+ 0xd1, 0xd5, 0x54, 0xd3, 0xc4, 0x55, 0x5e, 0x56,
+ 0xd1, 0xd2, 0xde, 0xdd, 0x54, 0x5c, 0x45, 0x5d,
+ 0x55, 0x5d, 0x59, 0xd6, 0x55, 0x5a, 0xd3, 0xd9,
+ 0xd0, 0xdc, 0xd8, 0xd8, 0xc6, 0xca, 0xc6, 0xd1,
+ 0x5a, 0x7f, 0x7e, 0x4f, 0xdd, 0xd9, 0x57, 0x45,
+ 0x59, 0xd7, 0xdd, 0xc3, 0xc6, 0x54, 0x5c, 0xd4,
+ 0xdd, 0xdd, 0x5d, 0x43, 0x55, 0xdf, 0xda, 0xcc,
+ 0xc9, 0x54, 0x4f, 0x5c, 0x55, 0xd2, 0xd0, 0xd1,
+ 0x52, 0x5f, 0xdd, 0x53, 0x58, 0x53, 0xd6, 0xdd,
+ 0xd9, 0xdc, 0xc1, 0xd7, 0x4a, 0x4e, 0x47, 0x51,
+ 0xdf, 0xf5, 0xc6, 0x57, 0x5b, 0x75, 0x74, 0x55,
+ 0xf6, 0xdb, 0x5e, 0x50, 0xd4, 0xd3, 0x56, 0x58,
+ 0x5f, 0xd7, 0xdd, 0xde, 0xd2, 0xd5, 0x4d, 0x71,
+ 0x5f, 0xf4, 0xf2, 0xc0, 0x50, 0x41, 0x5c, 0xd0,
+ 0xd7, 0xdc, 0xd1, 0x45, 0x4e, 0x5c, 0x54, 0x5e,
+ 0x77, 0x72, 0x5a, 0xcf, 0xf2, 0xf4, 0xda, 0xd2,
+ 0xd6, 0x58, 0x5e, 0xdf, 0xc1, 0xc2, 0x57, 0x40,
+ 0x56, 0xd7, 0xd7, 0xd5, 0x56, 0x45, 0x43, 0x50,
+ 0xd9, 0xd2, 0x52, 0x5e, 0x5d, 0xd2, 0xd8, 0xd2,
+ 0x54, 0x58, 0x41, 0x43
+};
char packet_10[] = {
-0x80, 0x08, 0x2c, 0x47, 0x11, 0x47, 0x34, 0x22,
-0x58, 0xf3, 0x3d, 0xea, 0x56, 0xd4, 0xd6, 0x58,
-0x42, 0x53, 0xc4, 0xf7, 0xcb, 0xf5, 0xf4, 0xc1,
-0xd0, 0x4d, 0x45, 0xd6, 0x57, 0xd0, 0xd9, 0xdb,
-0x50, 0x44, 0x59, 0x4b, 0x4f, 0xd6, 0xd8, 0x57,
-0x5e, 0xd6, 0x57, 0xd0, 0xc5, 0xdf, 0xc6, 0xcd,
-0xc5, 0x51, 0x50, 0xd0, 0xd6, 0xd2, 0xdb, 0x5d,
-0x75, 0x75, 0x73, 0x75, 0xc0, 0xf7, 0xf0, 0xf6,
-0xc9, 0xd8, 0xd5, 0x57, 0x56, 0x48, 0x70, 0x75,
-0x42, 0x42, 0x5f, 0xd0, 0x5d, 0x5b, 0x5c, 0x55,
-0xd6, 0xc1, 0xcf, 0xd8, 0xd3, 0xd0, 0x45, 0x4f,
-0x54, 0xc6, 0xd0, 0x59, 0x55, 0xc4, 0xd1, 0x5a,
-0x73, 0x7f, 0x47, 0x54, 0xd1, 0xdf, 0xdc, 0xd7,
-0xc7, 0xc8, 0xdb, 0xc7, 0xca, 0xc9, 0xc0, 0xc7,
-0xc1, 0x51, 0x40, 0x5f, 0x52, 0xd7, 0xda, 0xdf,
-0x41, 0x4c, 0x56, 0x54, 0x5f, 0x4a, 0x4a, 0x4e,
-0x5d, 0xc4, 0xc6, 0xcd, 0xc7, 0xd6, 0x52, 0xd4,
-0xc4, 0xc4, 0xc6, 0xd5, 0x5b, 0x41, 0x4e, 0x56,
-0xc4, 0xd8, 0x54, 0x5e, 0x4d, 0x48, 0x76, 0x73,
-0x4d, 0x5b, 0x59, 0xd8, 0xf0, 0xf7, 0xde, 0x52,
-0xd0, 0xc3, 0xfd, 0xfa, 0xfd, 0xc1, 0x40, 0x4a,
-0x5a, 0x45, 0x5d, 0xd0 };
+ 0x80, 0x08, 0x2c, 0x47, 0x11, 0x47, 0x34, 0x22,
+ 0x58, 0xf3, 0x3d, 0xea, 0x56, 0xd4, 0xd6, 0x58,
+ 0x42, 0x53, 0xc4, 0xf7, 0xcb, 0xf5, 0xf4, 0xc1,
+ 0xd0, 0x4d, 0x45, 0xd6, 0x57, 0xd0, 0xd9, 0xdb,
+ 0x50, 0x44, 0x59, 0x4b, 0x4f, 0xd6, 0xd8, 0x57,
+ 0x5e, 0xd6, 0x57, 0xd0, 0xc5, 0xdf, 0xc6, 0xcd,
+ 0xc5, 0x51, 0x50, 0xd0, 0xd6, 0xd2, 0xdb, 0x5d,
+ 0x75, 0x75, 0x73, 0x75, 0xc0, 0xf7, 0xf0, 0xf6,
+ 0xc9, 0xd8, 0xd5, 0x57, 0x56, 0x48, 0x70, 0x75,
+ 0x42, 0x42, 0x5f, 0xd0, 0x5d, 0x5b, 0x5c, 0x55,
+ 0xd6, 0xc1, 0xcf, 0xd8, 0xd3, 0xd0, 0x45, 0x4f,
+ 0x54, 0xc6, 0xd0, 0x59, 0x55, 0xc4, 0xd1, 0x5a,
+ 0x73, 0x7f, 0x47, 0x54, 0xd1, 0xdf, 0xdc, 0xd7,
+ 0xc7, 0xc8, 0xdb, 0xc7, 0xca, 0xc9, 0xc0, 0xc7,
+ 0xc1, 0x51, 0x40, 0x5f, 0x52, 0xd7, 0xda, 0xdf,
+ 0x41, 0x4c, 0x56, 0x54, 0x5f, 0x4a, 0x4a, 0x4e,
+ 0x5d, 0xc4, 0xc6, 0xcd, 0xc7, 0xd6, 0x52, 0xd4,
+ 0xc4, 0xc4, 0xc6, 0xd5, 0x5b, 0x41, 0x4e, 0x56,
+ 0xc4, 0xd8, 0x54, 0x5e, 0x4d, 0x48, 0x76, 0x73,
+ 0x4d, 0x5b, 0x59, 0xd8, 0xf0, 0xf7, 0xde, 0x52,
+ 0xd0, 0xc3, 0xfd, 0xfa, 0xfd, 0xc1, 0x40, 0x4a,
+ 0x5a, 0x45, 0x5d, 0xd0
+};
#define MAKE_TEST(n) \
/* deserialize the packet*/ \
@@ -310,21 +321,21 @@ char packet_10[] = {
void test_parser()
{
- trtp_rtp_packet_t* packet;
- tsk_buffer_t* buffer;
- tsk_size_t i;
+ trtp_rtp_packet_t* packet;
+ tsk_buffer_t* buffer;
+ tsk_size_t i;
- MAKE_TEST(0);
- MAKE_TEST(1);
- MAKE_TEST(2);
- MAKE_TEST(3);
- MAKE_TEST(4);
- MAKE_TEST(5);
- MAKE_TEST(6);
- MAKE_TEST(7);
- MAKE_TEST(8);
- MAKE_TEST(9);
- MAKE_TEST(10);
+ MAKE_TEST(0);
+ MAKE_TEST(1);
+ MAKE_TEST(2);
+ MAKE_TEST(3);
+ MAKE_TEST(4);
+ MAKE_TEST(5);
+ MAKE_TEST(6);
+ MAKE_TEST(7);
+ MAKE_TEST(8);
+ MAKE_TEST(9);
+ MAKE_TEST(10);
}
diff --git a/tinySAK/src/tinysak_config.h b/tinySAK/src/tinysak_config.h
index 4e40556..629dc07 100755
--- a/tinySAK/src/tinysak_config.h
+++ b/tinySAK/src/tinysak_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -88,7 +88,7 @@
# define TSK_BEGIN_DECLS extern "C" {
# define TSK_END_DECLS }
#else
-# define TSK_BEGIN_DECLS
+# define TSK_BEGIN_DECLS
# define TSK_END_DECLS
#endif
@@ -97,7 +97,7 @@
#elif defined(__GNUC__) && !defined(__APPLE__)
# define TSK_INLINE __inline
#else
-# define TSK_INLINE
+# define TSK_INLINE
#endif
@@ -111,11 +111,11 @@
/* Features */
#if !defined (HAVE_GETTIMEOFDAY)
- #if TSK_UNDER_WINDOWS
- # define HAVE_GETTIMEOFDAY 0
- #else
- # define HAVE_GETTIMEOFDAY 1
- #endif
+#if TSK_UNDER_WINDOWS
+# define HAVE_GETTIMEOFDAY 0
+#else
+# define HAVE_GETTIMEOFDAY 1
+#endif
#endif /* HAVE_GETTIMEOFDAY */
#if ANDROID
diff --git a/tinySAK/src/tsk.c b/tinySAK/src/tsk.c
index 195ec96..672cf2d 100755
--- a/tinySAK/src/tsk.c
+++ b/tinySAK/src/tsk.c
@@ -5,19 +5,19 @@
*
* @section LICENSE
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -79,14 +79,14 @@ tsk_object_def_t;
* Below, an example of how to declare an object definition:<br>
* @code
* //(Object defnition)
- static const tsk_object_def_t person_def_t =
+ static const tsk_object_def_t person_def_t =
{
sizeof(person_t),
person_ctor,
person_dtor,
person_cmp
};
-* @endcode
+* @endcode
* <h2>6.2 Constructor</h2>
* The constructor is only responsible for the initialization and won’t allocate the object. When passed to the constructor, the object is already allocated.<br>
* Here is an example:<br>
@@ -100,14 +100,14 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
}
return self;
}
-* @endcode
+* @endcode
* <h2>6.3 Destructor</h2>
* The destructor will free the object’s members and won’t destroy the object itself (Phase 1). The destructor function must return a pointer to itself to allow the caller to perform the second phase.<br>
* Here is an example:<br>
* @code
// (destructor)
static tsk_object_t * person_dtor(tsk_object_t * self)
- {
+ {
person_t *person = self;
if(person){
TSK_FREE(person->name);
@@ -115,7 +115,7 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
}
return self;
}
-* @endcode
+* @endcode
* <h2>6.4 Comparator</h2>
* The comparator function is used to compare two well-defined objects. The objects to compare shall have the same definition (or type). <br>
* Here is an example:<br>
@@ -126,7 +126,7 @@ static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
const person_t *p1 = _p1;
const person_t *p1 = _p2;
int ret;
-
+
// do they have the same name?
if((ret = tsk_stricmp(p1->name, p2->name))){
return ret;
@@ -135,7 +135,7 @@ static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
if((ret = tsk_object_cmp(p1->girlfriend, p2->girlfriend))){
return ret;
}
-
+
// they are the same
return 0;
}
@@ -144,7 +144,7 @@ static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
* Reference counting is used to emulate garbage collection. Each well-defined object contains a reference counter field which indicates how many object have a reference to the actual object.<br>
* When an object is created (see below) the counter value is initialized to 1; this is automatically done and you have nothing to do. The counter is incremented by 1 when you call @ref tsk_object_ref() and decremented (by 1) when you call @ref tsk_object_unref().<br>
* When the counter value reaches zero, then the object is garbaged (freed).<br>
-*
+*
* <h2>6.6 Inheritence</h2>
* As you expect, inheritance is not supported in ANSI-C. <br>
* As any C Structure could be casted to a pointer to its first element, inheritance could be achieved like this:<br>
@@ -163,7 +163,7 @@ student_t* s = tsk_null;
//....
((person_t*)s)->name = tsk_strdup("bob");
* @endcode
-*
+*
* As @code person_t is a well-defined object, then @code student_t is also well-defined.<br>
* <h2>6.7 Usage</h2>
* Once the object’s definition is declared and all its mandatory functions implemented, it is used like this:<br>
@@ -180,7 +180,7 @@ tsk_object_unref(bob);
// create a person
#define PERSON_CREATE(name) tsk_object_new(&person_def_t, (const char*)name)
* @endcode
-*
+*
* As the destructor has fixed parameters, there is a common macro to destroy all kind of well-defined objects. <br>
* TSK_OBJECT_SAFE_FREE() is used to destroy any object. <br>
* The object will be freed only if; when decremented by 1 the reference count of the object is equal to zero. In all case (freed or not) the pointer value will be set to NULL.<br>
@@ -200,7 +200,7 @@ TSK_OBJECT_SAFE_FREE(bob);
*
* <h2>7 Threading</h2>
* The framework provides an operating system agnostic threading functions for both WIN32 and Unix-like systems.<br>
-*
+*
* <h2>7.1 Threads</h2>
* You don’t need thousands of functions to manage threads. In the Framework we only need to create, pause and destroy threads.<br>
* Threads can be created using @ref tsk_thread_create() and joined using @ref tsk_thread_join().<br>
@@ -218,7 +218,7 @@ void test_threads()
{
void* tid[1] = {tsk_null}; // thread id
int arg = 112; // arg to pass to the function
-
+
// creates the thread
tsk_thread_create(&tid[0], MyThreadFunction, &arg);
@@ -226,7 +226,7 @@ void test_threads()
tsk_thread_join(&(tid[0]));
}
* @endcode
-*
+*
* <h2>7.2 Mutexes</h2>
* Mutexes (Mutual exclusion) are used to protect a portion of code or function against concurrent access. Concurrent access happens when two or several threads try to execute the same portion of code at nearly the same time.<br>
* @code
@@ -234,7 +234,7 @@ void test_threads()
// create the mutext
tsk_mutex_handle_t *mutex = tsk_mutex_create();
-
+
tsk_mutex_lock(mutex);
// ...portion of code to protect
tsk_mutex_unlock(mutex);
@@ -243,12 +243,12 @@ tsk_mutex_unlock(mutex);
tsk_mutex_destroy(&mutex);
* @endcode
* Mutexes are not well-defined objects; you should use @ref tsk_mutex_destroy instead of TSK_OBJECT_SAFE_FREE() to destroy them.<br>
-*
+*
* <h2>7.3 Thread-Safe Objects</h2>
-*
+*
* Any C Structure could be declared as thread-safe using @ref TSK_DECLARE_SAFEOBJ macro. It’s not mandatory for the object to be well-defined.<br>
* A thread-safe object is initialized using @ref tsk_safeobj_init() and deinitilized using @ref tsk_safeobj_deinit(). To lock and unlock a portion of code which accesses the object you should use @ref tsk_safeobj_lock() and @ref tsk_safeobj_unlock() respectively.<br>
-*
+*
* <h2>7.4 Semaphores</h2>
* Only counting semaphores are supported by the framework.
* Counting semaphores are used to control the access to a portion of code which might be executed by multiple threads. A thread will have rights to execute the portion of code only if the semaphore’s internal counter value is different than zero. Before executing the code to control, a thread should decrement the counter to check if it has permit.<br>
@@ -266,19 +266,19 @@ tsk_semaphore_destroy(&sem);
* @endcode
* Semaphores are not well-defined objects; you should use @ref tsk_semaphore_destroy instead of TSK_OBJECT_SAFE_FREE() to destroy them.<br>
* Mutexes are binary semaphores (counter value is always equals to 1 or 0).<br>
-*
+*
* <h2>7.5 Condition Variables</h2>
* Condition variables are used to control the access to a portion of code which might be executed by multiple threads. Each thread will block until a certain condition is signaled or ms milliseconds have passed.<br>
* @ref tsk_condwait_create is used to create a condition variable, @ref tsk_condwait_wait() to wait indefinitely until the condition is signaled and @ref tsk_condwait_timedwait() to wait until the condition is signaled or ms milliseconds have passed.<br>
* @ref tsk_condwait_signal() is used to alert the first waiting thread that the condition is now true and @ref tsk_condwait_broadcast() is used to alert all waiting threads.<br>
* Condition variables are not well-defined objects; you should use @ref tsk_condwait_destroy() instead of TSK_OBJECT_SAFE_FREE() to destroy them.<br>
-*
+*
* <h2>7.6 Runnable</h2>
* A <i>runnable</i> object is a well-defined object and is declared using @ref TSK_DECLARE_RUNNABLE() macro.<br>
* A <i>runnable</i> object must be explicitly started using @ref tsk_runnable_start() and is implicitly stopped when destroyed. You can explicitly stop the object by calling @ref tsk_runnable_stop().<br>
-*
+*
* <h2>8 Final Sate Machine</h2>
-*
+*
* <h2>9 Timer Manager</h2>
*
*/
diff --git a/tinySAK/src/tsk.h b/tinySAK/src/tsk.h
index 93e7e1b..2cd0c19 100755
--- a/tinySAK/src/tsk.h
+++ b/tinySAK/src/tsk.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_base64.c b/tinySAK/src/tsk_base64.c
index b10fac0..5c06b4a 100755
--- a/tinySAK/src/tsk_base64.c
+++ b/tinySAK/src/tsk_base64.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -70,7 +70,7 @@
* Encodes arbitrary data into base64 format.
* @param input The input data to encode in base64 format.
* @param input_size The size of the @a input data.
-* @param output A pointer where to copy the encoded data.
+* @param output A pointer where to copy the encoded data.
* If you don't know what will be the size of the output result then set the pointer value to NULL to let the function allocate it of you.
* In all case it is up to you to free the @a ouput.
* You can also use @ref TSK_BASE64_ENCODE_LEN to allocate the buffer before calling this method.
@@ -79,72 +79,72 @@
*/
tsk_size_t tsk_base64_encode(const uint8_t* input, tsk_size_t input_size, char **output)
{
- static const char* TSK_BASE64_ENCODE_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- /*=================================================================================
- content T S K
- ASCII 0x54 0x53 0x4B
- Binary 0101 0100 0101 0011 0100 1011
- ------------------------------------------------------------------------------
- ------------------------------------------------------------------------------
- Packs of 6bits 010101 000101 001101 001011
- Indexes 21 5 13 11
- Base64 encoded V F N L <=== HERE IS THE RESULT OF tsk_base64_encode("TSK")
- */
-
- tsk_size_t i = 0;
- tsk_size_t output_size = 0;
-
- /* Caller provided his own buffer? */
- if (!*output) {
- *output = (char*)tsk_calloc((TSK_BASE64_ENCODE_LEN(input_size) + 1), sizeof(char));
- }
-
- /* Too short? */
- if (input_size < TSK_BASE64_ENCODE_BLOCK_SIZE) {
- goto quantum;
- }
-
- do {
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i]<<4) | (input[i+1]>>4)) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i+1]<<2) | (input[i+2]>>6)) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ input[i+2] & 0x3F ];
-
- i += TSK_BASE64_ENCODE_BLOCK_SIZE;
- }
- while (( i + TSK_BASE64_ENCODE_BLOCK_SIZE) <= input_size);
+ static const char* TSK_BASE64_ENCODE_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ /*=================================================================================
+ content T S K
+ ASCII 0x54 0x53 0x4B
+ Binary 0101 0100 0101 0011 0100 1011
+ ------------------------------------------------------------------------------
+ ------------------------------------------------------------------------------
+ Packs of 6bits 010101 000101 001101 001011
+ Indexes 21 5 13 11
+ Base64 encoded V F N L <=== HERE IS THE RESULT OF tsk_base64_encode("TSK")
+ */
+
+ tsk_size_t i = 0;
+ tsk_size_t output_size = 0;
+
+ /* Caller provided his own buffer? */
+ if (!*output) {
+ *output = (char*)tsk_calloc((TSK_BASE64_ENCODE_LEN(input_size) + 1), sizeof(char));
+ }
+
+ /* Too short? */
+ if (input_size < TSK_BASE64_ENCODE_BLOCK_SIZE) {
+ goto quantum;
+ }
+
+ do {
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i]<<4) | (input[i+1]>>4)) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i+1]<<2) | (input[i+2]>>6)) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ input[i+2] & 0x3F ];
+
+ i += TSK_BASE64_ENCODE_BLOCK_SIZE;
+ }
+ while (( i + TSK_BASE64_ENCODE_BLOCK_SIZE) <= input_size);
quantum:
-
- if ((input_size - i) == 1) {
- /* The final quantum of encoding input is exactly 8 bits; here, the
- final unit of encoded output will be two characters followed by
- two "=" padding characters.
- */
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]<<4) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_PAD, *(*output + output_size++) = TSK_BASE64_PAD;
- }
- else if ((input_size - i) == 2) {
- /* The final quantum of encoding input is exactly 16 bits; here, the
- final unit of encoded output will be three characters followed by
- one "=" padding character.
- */
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i]<<4) | (input[i+1]>>4)) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i+1]<<2) | (input[i+2]>>6)) & 0x3F ];
- *(*output + output_size++) = TSK_BASE64_PAD;
- }
-
- return output_size;
+
+ if ((input_size - i) == 1) {
+ /* The final quantum of encoding input is exactly 8 bits; here, the
+ final unit of encoded output will be two characters followed by
+ two "=" padding characters.
+ */
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]<<4) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_PAD, *(*output + output_size++) = TSK_BASE64_PAD;
+ }
+ else if ((input_size - i) == 2) {
+ /* The final quantum of encoding input is exactly 16 bits; here, the
+ final unit of encoded output will be three characters followed by
+ one "=" padding character.
+ */
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ (input[i]>> 2) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i]<<4) | (input[i+1]>>4)) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_ENCODE_ALPHABET [ ((input[i+1]<<2) | (input[i+2]>>6)) & 0x3F ];
+ *(*output + output_size++) = TSK_BASE64_PAD;
+ }
+
+ return output_size;
}
/**@ingroup tsk_base64_group
* Decodes arbitrary base64 data.
* @param input The input base64 data to decode.
* @param input_size The size of the @a input data.
-* @param output A pointer where to copy the decoded data.
+* @param output A pointer where to copy the decoded data.
* If you don't know what will be the size of the output result then set the pointer value to NULL to let the function allocate it of you.
* In all case it is up to you to free the @a ouput.
* You can also use @ref TSK_BASE64_DECODE_LEN to allocate the buffer before calling this method.
@@ -153,84 +153,83 @@ quantum:
*/
tsk_size_t tsk_base64_decode(const uint8_t* input, tsk_size_t input_size, char **output)
{
- static const uint8_t TSK_BASE64_DECODE_ALPHABET[256] =
- {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- 62,
- -1, -1, -1,
- 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- -1, -1, -1, -1, -1, -1,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1,
- };
-
- tsk_size_t i, pay_size;
- tsk_size_t output_size = 0;
-
- /* Caller provided his own buffer? */
- if(!*output){
- *output = (char*)tsk_calloc(1, (TSK_BASE64_DECODE_LEN(input_size)+1));
- }
-
- /* Count pads and remove them from the base64 string */
- for(i = input_size, pay_size = input_size; i > 0; i--){
- if(input[i-1] == TSK_BASE64_PAD) {
- pay_size--;
- }
- else{
- break;
- }
- }
-
- /* Reset i */
- i = 0;
-
- if(pay_size < TSK_BASE64_DECODE_BLOCK_SIZE){
- goto quantum;
- }
-
- do{
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
- | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]<< 4
- | TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]>>2);
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]<<6
- | TSK_BASE64_DECODE_ALPHABET [ input[i+3] ]);
-
- i += TSK_BASE64_DECODE_BLOCK_SIZE;
- }
- while(( i+ TSK_BASE64_DECODE_BLOCK_SIZE) <= pay_size);
+ static const uint8_t TSK_BASE64_DECODE_ALPHABET[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ 62,
+ -1, -1, -1,
+ 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ -1, -1, -1, -1, -1, -1, -1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ -1, -1, -1, -1, -1, -1,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1,
+ };
+
+ tsk_size_t i, pay_size;
+ tsk_size_t output_size = 0;
+
+ /* Caller provided his own buffer? */
+ if(!*output) {
+ *output = (char*)tsk_calloc(1, (TSK_BASE64_DECODE_LEN(input_size)+1));
+ }
+
+ /* Count pads and remove them from the base64 string */
+ for(i = input_size, pay_size = input_size; i > 0; i--) {
+ if(input[i-1] == TSK_BASE64_PAD) {
+ pay_size--;
+ }
+ else {
+ break;
+ }
+ }
+
+ /* Reset i */
+ i = 0;
+
+ if(pay_size < TSK_BASE64_DECODE_BLOCK_SIZE) {
+ goto quantum;
+ }
+
+ do {
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]<< 4
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]>>2);
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]<<6
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+3] ]);
+
+ i += TSK_BASE64_DECODE_BLOCK_SIZE;
+ }
+ while(( i+ TSK_BASE64_DECODE_BLOCK_SIZE) <= pay_size);
quantum:
-
- if((input_size - pay_size) == 1){
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
- | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]<< 4
- | TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]>>2);
- }
- else if((input_size-pay_size) == 2){
- *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
- | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
- }
-
- return output_size;
+
+ if((input_size - pay_size) == 1) {
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]<< 4
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+2] ]>>2);
+ }
+ else if((input_size-pay_size) == 2) {
+ *(*output + output_size++) = (TSK_BASE64_DECODE_ALPHABET [ input[i] ]<< 2
+ | TSK_BASE64_DECODE_ALPHABET [ input[i+1] ]>>4);
+ }
+
+ return output_size;
}
diff --git a/tinySAK/src/tsk_base64.h b/tinySAK/src/tsk_base64.h
index 6c22c5f..60f49b1 100755
--- a/tinySAK/src/tsk_base64.h
+++ b/tinySAK/src/tsk_base64.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_binaryutils.c b/tinySAK/src/tsk_binaryutils.c
index 0600efe..f4053d0 100755
--- a/tinySAK/src/tsk_binaryutils.c
+++ b/tinySAK/src/tsk_binaryutils.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_binaryutils.h b/tinySAK/src/tsk_binaryutils.h
index 1d09cd1..711e2c8 100755
--- a/tinySAK/src/tsk_binaryutils.h
+++ b/tinySAK/src/tsk_binaryutils.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -58,7 +58,7 @@ static uint16_t TSK_LSB_2_MSB( void const * buffer )
{
const uint8_t* dummy = (const uint8_t*)buffer;
return ( ((uint16_t)dummy[0] << 8) | dummy[1] );
-}
+}
/**@ingroup tsk_binaryutils_group
* @def TSK_BINARY_GET_2BYTES
@@ -87,68 +87,66 @@ static uint16_t TSK_LSB_2_MSB( void const * buffer )
// RFC 3320 - 7.3. Uploading UDVM bytecode
static const uint16_t sigcomp_encoding_destination[]
-= { 0, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024 };
+ = { 0, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024 };
// RFC 3320 - 7.2. Accessing Stored State
static const uint8_t sigcomp_encoding_partial_id_length[]
-= { 0, 6, 9, 12 };
+ = { 0, 6, 9, 12 };
// RFC 3320 - 3.3.1. Memory Size and UDVM Cycles
static const uint8_t sigcomp_encoding_cycles_per_bit[]
-= { 16, 32, 64, 128 };
+ = { 16, 32, 64, 128 };
static const uint32_t sigcomp_encoding_state_memory_size[]
-= { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 };
+ = { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 };
static const uint32_t sigcomp_encoding_decompression_memory_size[]
-= { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 }; // the bit pattern 000 cannot be used.
+ = { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 }; // the bit pattern 000 cannot be used.
// 3.3.1. Memory Size and UDVM Cycles
// 3.3. SigComp Parameters
static const uint8_t sigcomp_encoding_cpb[]
-= { 16, 32, 64, 128 };
+ = { 16, 32, 64, 128 };
static const uint32_t sigcomp_encoding_sms[]
-= { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 };
+ = { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 };
static const uint32_t sigcomp_encoding_dms[]
-= { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 }; // the bit pattern 000 cannot be used.
+ = { 0, 2048, 4096, 8192, 16384, 32768, 65536, 131072 }; // the bit pattern 000 cannot be used.
// RFC 3320: Figure 10: Bytecode for a multitype (%) operand
-static const int8_t operand_multitype_indexes [256] =
-{
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-9,
-10,
--1, -1, -1, -1,
-3, 3,
-4, 4, 4, 4, 4, 4, 4, 4,
-6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+static const int8_t operand_multitype_indexes [256] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 9,
+ 10,
+ -1, -1, -1, -1,
+ 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
};
// Used LSB<->MSB bits reverse/swap
/**@ingroup tsk_binaryutils_group
* Lookup table for bit reversing.
*/
-static const unsigned char Tsk_BitReverseTable256[] =
-{
- 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
- 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
- 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
- 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
- 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
- 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
- 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
- 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
- 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
- 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
- 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
- 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
- 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
- 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
- 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
- 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
+static const unsigned char Tsk_BitReverseTable256[] = {
+ 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
+ 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
+ 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
+ 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
+ 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
+ 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
+ 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
+ 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
+ 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
+ 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
+ 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
+ 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
+ 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
+ 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
+ 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
+ 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
};
TSK_END_DECLS
diff --git a/tinySAK/src/tsk_buffer.c b/tinySAK/src/tsk_buffer.c
index 80ee02d..5cd7f49 100755
--- a/tinySAK/src/tsk_buffer.c
+++ b/tinySAK/src/tsk_buffer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,7 +56,7 @@
*/
tsk_buffer_t* tsk_buffer_create(const void* data, tsk_size_t size)
{
- return (tsk_buffer_t*)tsk_object_new(tsk_buffer_def_t, data, size);
+ return (tsk_buffer_t*)tsk_object_new(tsk_buffer_def_t, data, size);
}
/**@ingroup tsk_buffer_group
@@ -66,7 +66,7 @@ tsk_buffer_t* tsk_buffer_create(const void* data, tsk_size_t size)
*/
tsk_buffer_t* tsk_buffer_create_null()
{
- return tsk_buffer_create(tsk_null, 0);
+ return tsk_buffer_create(tsk_null, 0);
}
/**@ingroup tsk_buffer_group
@@ -86,62 +86,62 @@ tsk_buffer_t* tsk_buffer_create_null()
*/
int tsk_buffer_append_2(tsk_buffer_t* self, const char* format, ...)
{
- /*
- * I suppose that sizeof(char) = 1-byte
- */
- int len = 0;
- va_list ap;
- char *buffer;
- tsk_size_t oldsize;
+ /*
+ * I suppose that sizeof(char) = 1-byte
+ */
+ int len = 0;
+ va_list ap;
+ char *buffer;
+ tsk_size_t oldsize;
va_list ap2;
- if(!self){
- return -1;
- }
-
- oldsize = self->size;
- buffer = (char*)TSK_BUFFER_DATA(self);
-
- /* initialize variable arguments (needed for 64bit platforms where vsnprintf will change the va_list) */
- va_start(ap, format);
- va_start(ap2, format);
-
- /* compute destination len for windows mobile
- */
+ if(!self) {
+ return -1;
+ }
+
+ oldsize = self->size;
+ buffer = (char*)TSK_BUFFER_DATA(self);
+
+ /* initialize variable arguments (needed for 64bit platforms where vsnprintf will change the va_list) */
+ va_start(ap, format);
+ va_start(ap2, format);
+
+ /* compute destination len for windows mobile
+ */
#if defined(_WIN32_WCE)
- {
- int n;
- len = (tsk_strlen(format)*2);
- buffer = (char*)tsk_realloc(buffer, (oldsize+len));
- for(;;){
- if( (n = vsnprintf((char*)(buffer + oldsize), len, format, ap)) >= 0 && (n<=len) ){
- len = n;
- break;
- }
- else{
- len += 10;
- buffer = (char*)tsk_realloc(buffer, (oldsize+len));
- }
- }
- }
+ {
+ int n;
+ len = (tsk_strlen(format)*2);
+ buffer = (char*)tsk_realloc(buffer, (oldsize+len));
+ for(;;) {
+ if( (n = vsnprintf((char*)(buffer + oldsize), len, format, ap)) >= 0 && (n<=len) ) {
+ len = n;
+ break;
+ }
+ else {
+ len += 10;
+ buffer = (char*)tsk_realloc(buffer, (oldsize+len));
+ }
+ }
+ }
#else
len = vsnprintf(tsk_null, 0, format, ap);
buffer = (char*)tsk_realloc(buffer, oldsize+len+1);
vsnprintf((buffer + oldsize), len
#if !defined(_MSC_VER) || defined(__GNUC__)
- +1
+ +1
#endif
- , format, ap2);
+ , format, ap2);
#endif
-
- /* reset variable arguments */
- va_end(ap);
- va_end(ap2);
-
- self->data = buffer;
- self->size = (oldsize+len);
-
- return 0;
+
+ /* reset variable arguments */
+ va_end(ap);
+ va_end(ap2);
+
+ self->data = buffer;
+ self->size = (oldsize+len);
+
+ return 0;
}
/**@ingroup tsk_buffer_group
@@ -161,29 +161,29 @@ int tsk_buffer_append_2(tsk_buffer_t* self, const char* format, ...)
*/
int tsk_buffer_append(tsk_buffer_t* self, const void* data, tsk_size_t size)
{
- if(self && size){
- tsk_size_t oldsize = self->size;
- tsk_size_t newsize = oldsize + size;
-
- if(oldsize){
- self->data = tsk_realloc(self->data, newsize);
- }
- else{
- self->data = tsk_calloc(size, sizeof(uint8_t));
- }
-
- if(self->data){
- if(data){
- memcpy((void*)(TSK_BUFFER_TO_U8(self) + oldsize), data, size);
- }
- self->size = newsize;
- return 0;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return -1;
+ if(self && size) {
+ tsk_size_t oldsize = self->size;
+ tsk_size_t newsize = oldsize + size;
+
+ if(oldsize) {
+ self->data = tsk_realloc(self->data, newsize);
+ }
+ else {
+ self->data = tsk_calloc(size, sizeof(uint8_t));
+ }
+
+ if(self->data) {
+ if(data) {
+ memcpy((void*)(TSK_BUFFER_TO_U8(self) + oldsize), data, size);
+ }
+ self->size = newsize;
+ return 0;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return -1;
}
/**@ingroup tsk_buffer_group
@@ -194,23 +194,22 @@ int tsk_buffer_append(tsk_buffer_t* self, const void* data, tsk_size_t size)
*/
int tsk_buffer_realloc(tsk_buffer_t* self, tsk_size_t size)
{
- if(self)
- {
- if(size == 0){
- return tsk_buffer_cleanup(self);
- }
-
- if(self->size == 0){ // first time?
- self->data = tsk_calloc(size, sizeof(uint8_t));
- }
- else if(self->size != size){ // only realloc if different sizes
- self->data = tsk_realloc(self->data, size);
- }
-
- self->size = size;
- return 0;
- }
- return -1;
+ if(self) {
+ if(size == 0) {
+ return tsk_buffer_cleanup(self);
+ }
+
+ if(self->size == 0) { // first time?
+ self->data = tsk_calloc(size, sizeof(uint8_t));
+ }
+ else if(self->size != size) { // only realloc if different sizes
+ self->data = tsk_realloc(self->data, size);
+ }
+
+ self->size = size;
+ return 0;
+ }
+ return -1;
}
/**@ingroup tsk_buffer_group
@@ -222,17 +221,17 @@ int tsk_buffer_realloc(tsk_buffer_t* self, tsk_size_t size)
*/
int tsk_buffer_remove(tsk_buffer_t* self, tsk_size_t position, tsk_size_t size)
{
- if(self && self->data && size){
- if((position == 0) && ((position + size) >= self->size)){ /* Very common case. */
- return tsk_buffer_cleanup(self);
- }
- else if((position + size) < self->size){
- memcpy(((uint8_t*)self->data) + position, ((uint8_t*)self->data) + position + size,
- self->size-(position+size));
- return tsk_buffer_realloc(self, (self->size-size));
- }
- }
- return -1;
+ if(self && self->data && size) {
+ if((position == 0) && ((position + size) >= self->size)) { /* Very common case. */
+ return tsk_buffer_cleanup(self);
+ }
+ else if((position + size) < self->size) {
+ memcpy(((uint8_t*)self->data) + position, ((uint8_t*)self->data) + position + size,
+ self->size-(position+size));
+ return tsk_buffer_realloc(self, (self->size-size));
+ }
+ }
+ return -1;
}
/**@ingroup tsk_buffer_group
@@ -245,53 +244,52 @@ int tsk_buffer_remove(tsk_buffer_t* self, tsk_size_t position, tsk_size_t size)
*/
int tsk_buffer_insert(tsk_buffer_t* self, tsk_size_t position, const void* data, tsk_size_t size)
{
- if(self && size)
- {
- int ret;
- tsk_size_t tomove;
-
- if(position > self->size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -2;
- }
-
- tomove = (self->size - position);
-
- if((ret = tsk_buffer_realloc(self, (self->size + size)))){
- return ret;
- }
- memmove(((uint8_t*)self->data) + position + size, ((uint8_t*)self->data) + position,
- tomove/*self->size - (position + size)*/);
-
-
- if(data){
- memcpy(((uint8_t*)self->data) + position, data, size);
- }
- else{
- memset(((uint8_t*)self->data) + position, 0, size);
- }
-
- return 0;
- }
- return -1;
+ if(self && size) {
+ int ret;
+ tsk_size_t tomove;
+
+ if(position > self->size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -2;
+ }
+
+ tomove = (self->size - position);
+
+ if((ret = tsk_buffer_realloc(self, (self->size + size)))) {
+ return ret;
+ }
+ memmove(((uint8_t*)self->data) + position + size, ((uint8_t*)self->data) + position,
+ tomove/*self->size - (position + size)*/);
+
+
+ if(data) {
+ memcpy(((uint8_t*)self->data) + position, data, size);
+ }
+ else {
+ memset(((uint8_t*)self->data) + position, 0, size);
+ }
+
+ return 0;
+ }
+ return -1;
}
int tsk_buffer_copy(tsk_buffer_t* self, tsk_size_t start, const void* data, tsk_size_t size)
{
- int ret = 0;
- if(!self || !data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- // realloc the buffer to match the overral size
- if(self->size != (start + size) && (ret = tsk_buffer_realloc(self, (start + size)))){
- TSK_DEBUG_ERROR("failed to realloc the buffer");
- return ret;
- }
-
- memcpy(((uint8_t*)self->data) + start, data, size);
- return ret;
+ int ret = 0;
+ if(!self || !data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ // realloc the buffer to match the overral size
+ if(self->size != (start + size) && (ret = tsk_buffer_realloc(self, (start + size)))) {
+ TSK_DEBUG_ERROR("failed to realloc the buffer");
+ return ret;
+ }
+
+ memcpy(((uint8_t*)self->data) + start, data, size);
+ return ret;
}
/**@ingroup tsk_buffer_group
@@ -301,11 +299,11 @@ int tsk_buffer_copy(tsk_buffer_t* self, tsk_size_t start, const void* data, tsk_
*/
int tsk_buffer_cleanup(tsk_buffer_t* self)
{
- if(self && self->data){
- tsk_free(&(self->data));
- self->size = 0;
- }
- return 0;
+ if(self && self->data) {
+ tsk_free(&(self->data));
+ self->size = 0;
+ }
+ return 0;
}
/**@ingroup tsk_buffer_group
@@ -318,19 +316,19 @@ int tsk_buffer_cleanup(tsk_buffer_t* self)
*/
int tsk_buffer_takeownership(tsk_buffer_t* self, void** data, tsk_size_t size)
{
- if(!self || !data || !*data || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(self->data){
- tsk_free(&(self->data));
- }
- self->data = *data;
- self->size = size;
- *data = tsk_null;
-
- return 0;
+ if(!self || !data || !*data || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(self->data) {
+ tsk_free(&(self->data));
+ }
+ self->data = *data;
+ self->size = size;
+ *data = tsk_null;
+
+ return 0;
}
@@ -349,37 +347,36 @@ int tsk_buffer_takeownership(tsk_buffer_t* self, void** data, tsk_size_t size)
//
static tsk_object_t* tsk_buffer_ctor(tsk_object_t * self, va_list * app)
{
- tsk_buffer_t *buffer = (tsk_buffer_t *)self;
- const void *data = va_arg(*app, const void *);
- tsk_size_t size = va_arg(*app, tsk_size_t);
-
- if (size) {
- buffer->data = tsk_calloc((size+1), sizeof(uint8_t));
- if (data) {
- memcpy(buffer->data, data, size);
- }
- buffer->size = size;
- }
- return self;
+ tsk_buffer_t *buffer = (tsk_buffer_t *)self;
+ const void *data = va_arg(*app, const void *);
+ tsk_size_t size = va_arg(*app, tsk_size_t);
+
+ if (size) {
+ buffer->data = tsk_calloc((size+1), sizeof(uint8_t));
+ if (data) {
+ memcpy(buffer->data, data, size);
+ }
+ buffer->size = size;
+ }
+ return self;
}
static tsk_object_t* tsk_buffer_dtor(tsk_object_t * self)
-{
- tsk_buffer_t *buffer = (tsk_buffer_t *)self;
- if(buffer){
- TSK_FREE(buffer->data);
- buffer->size = 0;
- }
-
- return self;
+{
+ tsk_buffer_t *buffer = (tsk_buffer_t *)self;
+ if(buffer) {
+ TSK_FREE(buffer->data);
+ buffer->size = 0;
+ }
+
+ return self;
}
-static const tsk_object_def_t tsk_buffer_def_s =
-{
- sizeof(tsk_buffer_t),
- tsk_buffer_ctor,
- tsk_buffer_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_buffer_def_s = {
+ sizeof(tsk_buffer_t),
+ tsk_buffer_ctor,
+ tsk_buffer_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsk_buffer_def_t = &tsk_buffer_def_s;
diff --git a/tinySAK/src/tsk_buffer.h b/tinySAK/src/tsk_buffer.h
index 8afb526..8977238 100755
--- a/tinySAK/src/tsk_buffer.h
+++ b/tinySAK/src/tsk_buffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -72,12 +72,11 @@ TSK_BEGIN_DECLS
/**@ingroup tsk_buffer_group
* Buffer object.
*/
-typedef struct tsk_buffer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_buffer_s {
+ TSK_DECLARE_OBJECT;
- void *data; /**< Interanl data. */
- tsk_size_t size; /**< The size of the internal data. */
+ void *data; /**< Interanl data. */
+ tsk_size_t size; /**< The size of the internal data. */
}
tsk_buffer_t;
diff --git a/tinySAK/src/tsk_common.h b/tinySAK/src/tsk_common.h
index e5ba5d2..35c952a 100755
--- a/tinySAK/src/tsk_common.h
+++ b/tinySAK/src/tsk_common.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_condwait.c b/tinySAK/src/tsk_condwait.c
index 74b6389..f361c2c 100755
--- a/tinySAK/src/tsk_condwait.c
+++ b/tinySAK/src/tsk_condwait.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,13 +38,13 @@
# include <windows.h>
# include "tsk_errno.h"
# define CONDWAIT_S void
- typedef HANDLE CONDWAIT_T;
+typedef HANDLE CONDWAIT_T;
# define TIMED_OUT WAIT_TIMEOUT
#else
# include <sys/time.h>
# include <pthread.h>
# define CONDWAIT_S pthread_cond_t
- typedef CONDWAIT_S* CONDWAIT_T;
+typedef CONDWAIT_S* CONDWAIT_T;
# define TIMED_OUT ETIMEDOUT
#endif
@@ -79,11 +79,10 @@
/**@ingroup tsk_condwait_group
* Represents both PThread an Windows condwait object.
*/
-typedef struct tsk_condwait_s
-{
- CONDWAIT_T pcond; /**< Pthread handle pointing to the internal condwait object. */
+typedef struct tsk_condwait_s {
+ CONDWAIT_T pcond; /**< Pthread handle pointing to the internal condwait object. */
#if !TSK_UNDER_WINDOWS
- tsk_mutex_handle_t* mutex; /**< Locker. */
+ tsk_mutex_handle_t* mutex; /**< Locker. */
#endif
}
tsk_condwait_t;
@@ -95,82 +94,76 @@ tsk_condwait_t;
*/
tsk_condwait_handle_t* tsk_condwait_create()
{
- tsk_condwait_t *condwait = (tsk_condwait_t*)tsk_calloc(1, sizeof(tsk_condwait_t));
+ tsk_condwait_t *condwait = (tsk_condwait_t*)tsk_calloc(1, sizeof(tsk_condwait_t));
- if(condwait)
- {
+ if(condwait) {
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- condwait->pcond = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
- #else
- condwait->pcond = CreateEvent(NULL, TRUE, FALSE, NULL);
+ condwait->pcond = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
+#else
+ condwait->pcond = CreateEvent(NULL, TRUE, FALSE, NULL);
# endif
- if(!condwait->pcond)
- {
- TSK_FREE(condwait);
- }
+ if(!condwait->pcond) {
+ TSK_FREE(condwait);
+ }
#else
- condwait->pcond = (CONDWAIT_T)tsk_calloc(1, sizeof(CONDWAIT_S));
- if(pthread_cond_init(condwait->pcond, 0))
- {
- TSK_DEBUG_ERROR("Failed to initialize the new conwait.");
- }
+ condwait->pcond = (CONDWAIT_T)tsk_calloc(1, sizeof(CONDWAIT_S));
+ if(pthread_cond_init(condwait->pcond, 0)) {
+ TSK_DEBUG_ERROR("Failed to initialize the new conwait.");
+ }
- if(!(condwait->mutex = tsk_mutex_create()))
- {
- pthread_cond_destroy(condwait->pcond);
+ if(!(condwait->mutex = tsk_mutex_create())) {
+ pthread_cond_destroy(condwait->pcond);
- TSK_FREE(condwait);
- TSK_DEBUG_ERROR("Failed to initialize the internal mutex.");
- }
+ TSK_FREE(condwait);
+ TSK_DEBUG_ERROR("Failed to initialize the internal mutex.");
+ }
#endif
- }
+ }
- if(!condwait)
- {
- TSK_DEBUG_ERROR("Failed to create new conwait.");
- }
- return condwait;
+ if(!condwait) {
+ TSK_DEBUG_ERROR("Failed to create new conwait.");
+ }
+ return condwait;
}
/**@ingroup tsk_condwait_group
-* Block the current thread until the condition is opened.
+* Block the current thread until the condition is opened.
* @param handle CondWait handle created using @ref tsk_condwait_create.
* @retval Zero if succeed and non-zero otherwise.
* @sa @ref tsk_condwait_timedwait.
*/
int tsk_condwait_wait(tsk_condwait_handle_t* handle)
{
- int ret = EINVAL;
- tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
- if(!condwait){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ int ret = EINVAL;
+ tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
+ if(!condwait) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- if((ret = (WaitForSingleObjectEx(condwait->pcond, INFINITE, TRUE) == WAIT_FAILED) ? -1 : 0)){
+ if((ret = (WaitForSingleObjectEx(condwait->pcond, INFINITE, TRUE) == WAIT_FAILED) ? -1 : 0)) {
# else
- if((ret = (WaitForSingleObject(condwait->pcond, INFINITE) == WAIT_FAILED) ? -1 : 0)){
+ if((ret = (WaitForSingleObject(condwait->pcond, INFINITE) == WAIT_FAILED) ? -1 : 0)) {
#endif
- TSK_DEBUG_ERROR("WaitForSingleObject function failed: %d", ret);
- }
+ TSK_DEBUG_ERROR("WaitForSingleObject function failed: %d", ret);
+ }
#else
- if(condwait && condwait->mutex){
- tsk_mutex_lock(condwait->mutex);
- if((ret = pthread_cond_wait(condwait->pcond, (pthread_mutex_t*)condwait->mutex)))
- {
- TSK_DEBUG_ERROR("pthread_cond_wait function failed: %d", ret);
- }
- tsk_mutex_unlock(condwait->mutex);
- }
+ if(condwait && condwait->mutex) {
+ tsk_mutex_lock(condwait->mutex);
+ if((ret = pthread_cond_wait(condwait->pcond, (pthread_mutex_t*)condwait->mutex))) {
+ TSK_DEBUG_ERROR("pthread_cond_wait function failed: %d", ret);
+ }
+ tsk_mutex_unlock(condwait->mutex);
+ }
#endif
- return ret;
+ return ret;
}
/**@ingroup tsk_condwait_group
-* Block the current thread until the condition is opened or until @a ms milliseconds have passed.
+* Block the current thread until the condition is opened or until @a ms milliseconds have passed.
* @param handle condwait handle created using @ref tsk_condwait_create.
* @param ms The number of milliseconds to wait for a given condition.
* @retval Zero if succeed and non-zero error code otherwise.
@@ -179,53 +172,55 @@ int tsk_condwait_wait(tsk_condwait_handle_t* handle)
int tsk_condwait_timedwait(tsk_condwait_handle_t* handle, uint64_t ms)
{
#if TSK_UNDER_WINDOWS
- DWORD ret = WAIT_FAILED;
+ DWORD ret = WAIT_FAILED;
#else
- int ret = EINVAL;
+ int ret = EINVAL;
#endif
- tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
+ tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- if((ret = WaitForSingleObjectEx(condwait->pcond, (DWORD)ms, TRUE)) != WAIT_OBJECT_0){
+ if((ret = WaitForSingleObjectEx(condwait->pcond, (DWORD)ms, TRUE)) != WAIT_OBJECT_0) {
# else
- if((ret = WaitForSingleObject(condwait->pcond, (DWORD)ms)) != WAIT_OBJECT_0){
+ if((ret = WaitForSingleObject(condwait->pcond, (DWORD)ms)) != WAIT_OBJECT_0) {
#endif
- if(ret == TIMED_OUT){
- /* TSK_DEBUG_INFO("WaitForSingleObject function timedout: %d", ret); */
- }
- else{
- TSK_DEBUG_ERROR("WaitForSingleObject function failed: %d", ret);
- }
- return ((ret == TIMED_OUT) ? 0 : ret);
- }
+ if(ret == TIMED_OUT) {
+ /* TSK_DEBUG_INFO("WaitForSingleObject function timedout: %d", ret); */
+ }
+ else {
+ TSK_DEBUG_ERROR("WaitForSingleObject function failed: %d", ret);
+ }
+ return ((ret == TIMED_OUT) ? 0 : ret);
+ }
#else
- if(condwait && condwait->mutex){
- struct timespec ts = {0, 0};
- struct timeval tv = {0, 0};
- /*int rc =*/ tsk_gettimeofday(&tv, 0);
+ if(condwait && condwait->mutex) {
+ struct timespec ts = {0, 0};
+ struct timeval tv = {0, 0};
+ /*int rc =*/ tsk_gettimeofday(&tv, 0);
+
+ ts.tv_sec = ( tv.tv_sec + ((long)ms/1000) );
+ ts.tv_nsec += ( (tv.tv_usec * 1000) + ((long)ms % 1000 * 1000000) );
+ if(ts.tv_nsec > 999999999) {
+ ts.tv_sec+=1, ts.tv_nsec = ts.tv_nsec % 1000000000;
+ }
- ts.tv_sec = ( tv.tv_sec + ((long)ms/1000) );
- ts.tv_nsec += ( (tv.tv_usec * 1000) + ((long)ms % 1000 * 1000000) );
- if(ts.tv_nsec > 999999999) ts.tv_sec+=1, ts.tv_nsec = ts.tv_nsec % 1000000000;
-
- tsk_mutex_lock(condwait->mutex);
- if((ret = pthread_cond_timedwait(condwait->pcond, (pthread_mutex_t*)condwait->mutex, &ts))){
- if(ret == TIMED_OUT){
- /* TSK_DEBUG_INFO("pthread_cond_timedwait function timedout: %d", ret); */
- }
- else{
- TSK_DEBUG_ERROR("pthread_cond_timedwait function failed: %d", ret);
- }
- }
+ tsk_mutex_lock(condwait->mutex);
+ if((ret = pthread_cond_timedwait(condwait->pcond, (pthread_mutex_t*)condwait->mutex, &ts))) {
+ if(ret == TIMED_OUT) {
+ /* TSK_DEBUG_INFO("pthread_cond_timedwait function timedout: %d", ret); */
+ }
+ else {
+ TSK_DEBUG_ERROR("pthread_cond_timedwait function failed: %d", ret);
+ }
+ }
- tsk_mutex_unlock(condwait->mutex);
+ tsk_mutex_unlock(condwait->mutex);
- return ((ret == TIMED_OUT) ? 0 : ret);
- }
+ return ((ret == TIMED_OUT) ? 0 : ret);
+ }
#endif
- return ret;
+ return ret;
}
/**@ingroup tsk_condwait_group
@@ -236,29 +231,29 @@ int tsk_condwait_timedwait(tsk_condwait_handle_t* handle, uint64_t ms)
*/
int tsk_condwait_signal(tsk_condwait_handle_t* handle)
{
- int ret = EINVAL;
- tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
- if(!condwait){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ int ret = EINVAL;
+ tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
+ if(!condwait) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TSK_UNDER_WINDOWS
- if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)){
- ret = GetLastError();
- TSK_DEBUG_ERROR("SetEvent/ResetEvent function failed: %d", ret);
- }
+ if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)) {
+ ret = GetLastError();
+ TSK_DEBUG_ERROR("SetEvent/ResetEvent function failed: %d", ret);
+ }
#else
- if(condwait && condwait->mutex){
- tsk_mutex_lock(condwait->mutex);
+ if(condwait && condwait->mutex) {
+ tsk_mutex_lock(condwait->mutex);
- if((ret = pthread_cond_signal(condwait->pcond))){
- TSK_DEBUG_ERROR("pthread_cond_signal function failed: %d", ret);
- }
- tsk_mutex_unlock(condwait->mutex);
- }
+ if((ret = pthread_cond_signal(condwait->pcond))) {
+ TSK_DEBUG_ERROR("pthread_cond_signal function failed: %d", ret);
+ }
+ tsk_mutex_unlock(condwait->mutex);
+ }
#endif
- return ret;
+ return ret;
}
@@ -270,29 +265,29 @@ int tsk_condwait_signal(tsk_condwait_handle_t* handle)
*/
int tsk_condwait_broadcast(tsk_condwait_handle_t* handle)
{
- int ret = EINVAL;
- tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
- if(!condwait){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ int ret = EINVAL;
+ tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
+ if(!condwait) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TSK_UNDER_WINDOWS
- if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)){
- ret = GetLastError();
- TSK_DEBUG_ERROR("SetEvent function failed: %d", ret);
- }
+ if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)) {
+ ret = GetLastError();
+ TSK_DEBUG_ERROR("SetEvent function failed: %d", ret);
+ }
#else
- if(condwait && condwait->mutex){
- tsk_mutex_lock(condwait->mutex);
- if((ret = pthread_cond_broadcast(condwait->pcond))){
- TSK_DEBUG_ERROR("pthread_cond_broadcast function failed: %d", ret);
- }
- tsk_mutex_unlock(condwait->mutex);
- }
+ if(condwait && condwait->mutex) {
+ tsk_mutex_lock(condwait->mutex);
+ if((ret = pthread_cond_broadcast(condwait->pcond))) {
+ TSK_DEBUG_ERROR("pthread_cond_broadcast function failed: %d", ret);
+ }
+ tsk_mutex_unlock(condwait->mutex);
+ }
#endif
- return ret;
+ return ret;
}
/**@ingroup tsk_condwait_group
@@ -302,20 +297,20 @@ int tsk_condwait_broadcast(tsk_condwait_handle_t* handle)
*/
void tsk_condwait_destroy(tsk_condwait_handle_t** handle)
{
- tsk_condwait_t **condwait = (tsk_condwait_t**)handle;
-
- if(condwait && *condwait){
+ tsk_condwait_t **condwait = (tsk_condwait_t**)handle;
+
+ if(condwait && *condwait) {
#if TSK_UNDER_WINDOWS
- CloseHandle((*condwait)->pcond);
+ CloseHandle((*condwait)->pcond);
#else
- tsk_mutex_destroy(&((*condwait)->mutex));
- pthread_cond_destroy((*condwait)->pcond);
- TSK_FREE((*condwait)->pcond);
+ tsk_mutex_destroy(&((*condwait)->mutex));
+ pthread_cond_destroy((*condwait)->pcond);
+ TSK_FREE((*condwait)->pcond);
#endif
- tsk_free((void**)condwait);
- }
- else{
- TSK_DEBUG_WARN("Cannot free an uninitialized condwait object");
- }
+ tsk_free((void**)condwait);
+ }
+ else {
+ TSK_DEBUG_WARN("Cannot free an uninitialized condwait object");
+ }
}
diff --git a/tinySAK/src/tsk_condwait.h b/tinySAK/src/tsk_condwait.h
index 5d5c550..3194ded 100755
--- a/tinySAK/src/tsk_condwait.h
+++ b/tinySAK/src/tsk_condwait.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_debug.c b/tinySAK/src/tsk_debug.c
index e1cf28a..cb84549 100755
--- a/tinySAK/src/tsk_debug.c
+++ b/tinySAK/src/tsk_debug.c
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,92 +41,104 @@ static int tsk_debug_level = DEBUG_LEVEL;
* @param arg_data The callback data.
* @sa @ref tsk_debug_get_arg_data()
*/
-void tsk_debug_set_arg_data(const void* arg_data){
- tsk_debug_arg_data = arg_data;
+void tsk_debug_set_arg_data(const void* arg_data)
+{
+ tsk_debug_arg_data = arg_data;
}
/**@ingroup tsk_debug_group
* Gets the callback data passed to the framework using @ref tsk_debug_set_arg_data().
* @retval The callback data.
* @sa @ref tsk_debug_set_arg_data()
*/
-const void* tsk_debug_get_arg_data(){
- return tsk_debug_arg_data;
+const void* tsk_debug_get_arg_data()
+{
+ return tsk_debug_arg_data;
}
/**@ingroup tsk_debug_group
* Sets the callback function to call when @ref TSK_DEBUG_INFO() is internally used.
* @param cb A pointer to the callback function.
* @sa @ref tsk_debug_set_warn_cb() @ref tsk_debug_set_error_cb() @ref tsk_debug_set_fatal_cb().
*/
-void tsk_debug_set_info_cb(tsk_debug_f cb){
- tsk_debug_info_cb = cb;
+void tsk_debug_set_info_cb(tsk_debug_f cb)
+{
+ tsk_debug_info_cb = cb;
}
/**@ingroup tsk_debug_group
* Gets the callback function defined using @ref tsk_debug_set_info_cb().
* @retval A pointer to the callback function.
*/
-tsk_debug_f tsk_debug_get_info_cb(){
- return tsk_debug_info_cb;
+tsk_debug_f tsk_debug_get_info_cb()
+{
+ return tsk_debug_info_cb;
}
/**@ingroup tsk_debug_group
* Sets the callback function to call when @ref TSK_DEBUG_WARN() is internally used.
* @param cb A pointer to the callback function.
* @sa @ref tsk_debug_set_info_cb() @ref tsk_debug_set_error_cb() @ref tsk_debug_set_fatal_cb().
*/
-void tsk_debug_set_warn_cb(tsk_debug_f cb){
- tsk_debug_warn_cb = cb;
+void tsk_debug_set_warn_cb(tsk_debug_f cb)
+{
+ tsk_debug_warn_cb = cb;
}
/**@ingroup tsk_debug_group
* Gets the callback function defined using @ref tsk_debug_set_warn_cb().
* @retval A pointer to the callback function.
*/
-tsk_debug_f tsk_debug_get_warn_cb(){
- return tsk_debug_warn_cb;
+tsk_debug_f tsk_debug_get_warn_cb()
+{
+ return tsk_debug_warn_cb;
}
/**@ingroup tsk_debug_group
* Sets the callback function to call when @ref TSK_DEBUG_ERROR() is internally used.
* @param cb A pointer to the callback function.
* @sa @ref tsk_debug_set_info_cb() @ref tsk_debug_set_warn_cb() @ref tsk_debug_set_fatal_cb().
*/
-void tsk_debug_set_error_cb(tsk_debug_f cb){
- tsk_debug_error_cb = cb;
+void tsk_debug_set_error_cb(tsk_debug_f cb)
+{
+ tsk_debug_error_cb = cb;
}
/**@ingroup tsk_debug_group
* Gets the callback function defined using @ref tsk_debug_set_error_cb().
* @retval A pointer to the callback function.
*/
-tsk_debug_f tsk_debug_get_error_cb(){
- return tsk_debug_error_cb;
+tsk_debug_f tsk_debug_get_error_cb()
+{
+ return tsk_debug_error_cb;
}
/**@ingroup tsk_debug_group
* Sets the callback function to call when @ref TSK_DEBUG_FATAL() is internally used.
* @param cb A pointer to the callback function.
* @sa @ref tsk_debug_set_info_cb() @ref tsk_debug_set_warn_cb() @ref tsk_debug_set_error_cb().
*/
-void tsk_debug_set_fatal_cb(tsk_debug_f cb){
- tsk_debug_fatal_cb = cb;
+void tsk_debug_set_fatal_cb(tsk_debug_f cb)
+{
+ tsk_debug_fatal_cb = cb;
}
/**@ingroup tsk_debug_group
* Gets the callback function defined using @ref tsk_debug_set_fatal_cb().
* @retval A pointer to the callback function.
*/
-tsk_debug_f tsk_debug_get_fatal_cb(){
- return tsk_debug_fatal_cb;
+tsk_debug_f tsk_debug_get_fatal_cb()
+{
+ return tsk_debug_fatal_cb;
}
/**@ingroup tsk_debug_group
* Gets the debug level defined using @ref tsk_debug_set_level.
* @retval The debug level. <b>Must be</b>: @ref DEBUG_LEVEL_INFO, @ref DEBUG_LEVEL_WARN, @ref DEBUG_LEVEL_ERROR or @ref DEBUG_LEVEL_FATAL.
* @sa @ref tsk_debug_set_level()
*/
-int tsk_debug_get_level(){
- return tsk_debug_level;
+int tsk_debug_get_level()
+{
+ return tsk_debug_level;
}
/**@ingroup tsk_debug_group
* Sets the debug level.
* @param level The debug level. <b>Must be</b>: @ref DEBUG_LEVEL_INFO, @ref DEBUG_LEVEL_WARN, @ref DEBUG_LEVEL_ERROR or @ref DEBUG_LEVEL_FATAL.
* @sa @ref tsk_debug_get_level()
*/
-void tsk_debug_set_level(int level){
- tsk_debug_level = level;
+void tsk_debug_set_level(int level)
+{
+ tsk_debug_level = level;
}
#endif /* TSK_HAVE_DEBUG_H */
@@ -147,7 +159,7 @@ void tsk_debug_set_level(int level){
* - @ref DEBUG_LEVEL_INFO is the minimum value. Used to log user information, application progress, configuration ...
* - @ref DEBUG_LEVEL_WARN signals that something that could change the normal process happened. This type of error should not block the application.
* - @ref DEBUG_LEVEL_ERROR is the <b>default</b> minimum value. Signals that the current operation has failed. If the operation was critical (e.g. thread creation) then, this will badly change the application behavior, otherwise (e.g. sending data over network) the application will continue to behave as expected.
-* - @ref DEBUG_LEVEL_FATAL is the maximum value. This kind of errors are signaled just before the application crashes or enters in a state from which it's impossible to recover from.
+* - @ref DEBUG_LEVEL_FATAL is the maximum value. This kind of errors are signaled just before the application crashes or enters in a state from which it's impossible to recover from.
*
* At any time you can change the debug level using @ref tsk_debug_set_level().
*
@@ -183,7 +195,7 @@ FILE* file = fopen("logs.txt", "w+"); // do not forget to close the file using f
fputs(msg, file);
TSK_FREE(msg);
va_end(ap);
-
+
return 0;
}
// optional: set callback data (will be passed to _debug_info_write_to_file() as "arg" parameter)
@@ -194,14 +206,14 @@ tsk_debug_set_info_cb(_debug_info_write_to_file);
* @endcode
* Anywhere in Doubango code when @ref TSK_DEBUG_INFO() is called then, your callback function will be called to write the message to a file. <br />
* This is the best way to use custom loggers such as @a log4j, @a log4net or @a logfile.
-*
+*
* <h3>@anchor _Anchor_TinySAK_Debugging_Custom_Debug_Header Custom debug header</h3>
* This is an ANSI-C header file (<b>*.h</b>) overriding the macros used to print the debug messages. <br />
* This file:
* - must be named @a my_debug.h and in the same folder as @a tsk_debug.h.
* - must contain your own definitions of @ref TSK_DEBUG_INFO(), @ref TSK_DEBUG_WARN(), @ref TSK_DEBUG_ERROR() and @ref TSK_DEBUG_FATAL().
* - and you must add <i>-DTSK_HAVE_DEBUG_H=1</i> in your <i>CFLAGS</i> before building @a tinySAK project.
-*
+*
* <h2>@anchor _Anchor_TinySAK_Debugging_Public_Fuctions Public functions </h2>
* - @ref tsk_debug_get_arg_data
* - @ref tsk_debug_get_error_cb
diff --git a/tinySAK/src/tsk_debug.h b/tinySAK/src/tsk_debug.h
index e4538fa..6e29d67 100755
--- a/tinySAK/src/tsk_debug.h
+++ b/tinySAK/src/tsk_debug.h
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -103,9 +103,9 @@ TSK_BEGIN_DECLS
#if TSK_HAVE_DEBUG_H
# include <my_debug.h>
#else
- typedef int (*tsk_debug_f)(const void* arg, const char* fmt, ...);
+typedef int (*tsk_debug_f)(const void* arg, const char* fmt, ...);
- /* INFO */
+/* INFO */
#define TSK_DEBUG_INFO(FMT, ...) \
if(tsk_debug_get_level() >= DEBUG_LEVEL_INFO){ \
if(tsk_debug_get_info_cb()) \
@@ -115,7 +115,7 @@ TSK_BEGIN_DECLS
}
- /* WARN */
+/* WARN */
#define TSK_DEBUG_WARN(FMT, ...) \
if(tsk_debug_get_level() >= DEBUG_LEVEL_WARN){ \
if(tsk_debug_get_warn_cb()) \
@@ -124,7 +124,7 @@ TSK_BEGIN_DECLS
fprintf(stderr, "**[DOUBANGO WARN]: function: \"%s()\" \nfile: \"%s\" \nline: \"%u\" \nMSG: " FMT "\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__); \
}
- /* ERROR */
+/* ERROR */
#define TSK_DEBUG_ERROR(FMT, ...) \
if(tsk_debug_get_level() >= DEBUG_LEVEL_ERROR){ \
if(tsk_debug_get_error_cb()) \
@@ -134,7 +134,7 @@ TSK_BEGIN_DECLS
}
- /* FATAL */
+/* FATAL */
#define TSK_DEBUG_FATAL(FMT, ...) \
if(tsk_debug_get_level() >= DEBUG_LEVEL_FATAL){ \
if(tsk_debug_get_fatal_cb()) \
diff --git a/tinySAK/src/tsk_errno.h b/tinySAK/src/tsk_errno.h
index 5435d8e..8f3f488 100755
--- a/tinySAK/src/tsk_errno.h
+++ b/tinySAK/src/tsk_errno.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_fsm.c b/tinySAK/src/tsk_fsm.c
index ba1324b..4768b0a 100755
--- a/tinySAK/src/tsk_fsm.c
+++ b/tinySAK/src/tsk_fsm.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,57 +35,63 @@
/**@defgroup tsk_fsm_group Finite-state machine (FSM) implementation.
*/
-int tsk_fsm_exec_nothing(va_list *app){ return 0/*success*/; }
-tsk_bool_t tsk_fsm_cond_always(const void* data1, const void* data2) { return tsk_true; }
+int tsk_fsm_exec_nothing(va_list *app)
+{
+ return 0/*success*/;
+}
+tsk_bool_t tsk_fsm_cond_always(const void* data1, const void* data2)
+{
+ return tsk_true;
+}
/**@ingroup tsk_fsm_group
*/
tsk_fsm_t* tsk_fsm_create(tsk_fsm_state_id state_curr, tsk_fsm_state_id state_term)
{
- return (tsk_fsm_t*)tsk_object_new(tsk_fsm_def_t, state_curr, state_term);
+ return (tsk_fsm_t*)tsk_object_new(tsk_fsm_def_t, state_curr, state_term);
}
/**@ingroup tsk_fsm_group
*/
tsk_fsm_entry_t* tsk_fsm_entry_create()
{
- return (tsk_fsm_entry_t*)tsk_object_new(tsk_fsm_entry_def_t);
+ return (tsk_fsm_entry_t*)tsk_object_new(tsk_fsm_entry_def_t);
}
/**@ingroup tsk_fsm_group
* Add entries (states) to the FSM.
* @param self The FSM.
-* @param ... One of these helper macros: @b TSK_FSM_ADD_*. MUST end with
+* @param ... One of these helper macros: @b TSK_FSM_ADD_*. MUST end with
* @b TSK_FSM_ADD_NULL.
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsk_fsm_set(tsk_fsm_t* self, ...)
{
- va_list args;
- int guard;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(args, self);
- while((guard = va_arg(args, int)) == 1){
- tsk_fsm_entry_t* entry;
- if((entry = tsk_fsm_entry_create())){
- entry->from = va_arg(args, tsk_fsm_state_id);
- entry->action = va_arg(args, tsk_fsm_action_id);
- entry->cond = va_arg(args, tsk_fsm_cond);
- entry->to = va_arg(args, tsk_fsm_state_id);
- entry->exec = va_arg(args, tsk_fsm_exec);
- entry->desc = va_arg(args, const char*);
-
- tsk_list_push_descending_data(self->entries, (void**)&entry);
- }
- }
- va_end(args);
-
- return 0;
+ va_list args;
+ int guard;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(args, self);
+ while((guard = va_arg(args, int)) == 1) {
+ tsk_fsm_entry_t* entry;
+ if((entry = tsk_fsm_entry_create())) {
+ entry->from = va_arg(args, tsk_fsm_state_id);
+ entry->action = va_arg(args, tsk_fsm_action_id);
+ entry->cond = va_arg(args, tsk_fsm_cond);
+ entry->to = va_arg(args, tsk_fsm_state_id);
+ entry->exec = va_arg(args, tsk_fsm_exec);
+ entry->desc = va_arg(args, const char*);
+
+ tsk_list_push_descending_data(self->entries, (void**)&entry);
+ }
+ }
+ va_end(args);
+
+ return 0;
}
/**@ingroup tsk_fsm_group
@@ -97,15 +103,15 @@ int tsk_fsm_set(tsk_fsm_t* self, ...)
*/
int tsk_fsm_set_callback_terminated(tsk_fsm_t* self, tsk_fsm_onterminated_f callback, const void* callbackdata)
{
- if(self){
- self->callback_term = callback;
- self->callback_data = callbackdata;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ self->callback_term = callback;
+ self->callback_data = callbackdata;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_fsm_group
@@ -119,108 +125,107 @@ int tsk_fsm_set_callback_terminated(tsk_fsm_t* self, tsk_fsm_onterminated_f call
*/
int tsk_fsm_act(tsk_fsm_t* self, tsk_fsm_action_id action, const void* cond_data1, const void* cond_data2, ...)
{
- tsk_list_item_t *item;
- va_list ap;
- tsk_bool_t found = tsk_false;
- tsk_bool_t terminates = tsk_false; /* thread-safeness -> DO NOT REMOVE THIS VARIABLE */
- int ret_exec = 0; /* success */
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(tsk_fsm_terminated(self)){
- TSK_DEBUG_WARN("The FSM is in the final state.");
- return -2;
- }
-
- // lock
- tsk_safeobj_lock(self);
-
- va_start(ap, cond_data2);
- tsk_list_foreach(item, self->entries)
- {
- tsk_fsm_entry_t* entry = (tsk_fsm_entry_t*)item->data;
- if(((entry->from != tsk_fsm_state_any) && (entry->from != tsk_fsm_state_current)) && (entry->from != self->current)){
- continue;
- }
-
- if((entry->action != tsk_fsm_action_any) && (entry->action != action)){
- continue;
- }
-
- // check condition
- if(entry->cond(cond_data1, cond_data2)){
- // For debug information
- if(self->debug){
- TSK_DEBUG_INFO("State machine: %s", entry->desc);
- }
-
- if(entry->to != tsk_fsm_state_any && entry->to != tsk_fsm_state_current){ /* Stay at the current state if destination state is Any or Current */
- self->current = entry->to;
- }
-
- if(entry->exec){
- if((ret_exec = entry->exec(&ap))){
- TSK_DEBUG_INFO("State machine: Exec function failed. Moving to terminal state.");
- }
- }
- else{ /* Nothing to execute */
- ret_exec = 0;
- }
-
- terminates = (ret_exec || (self->current == self->term));
- found = tsk_true;
- break;
- }
- }
- va_end(ap);
-
- // unlock
- tsk_safeobj_unlock(self);
-
- /* Only call the callback function after unlock. */
- if(terminates){
- self->current = self->term;
- if(self->callback_term){
- self->callback_term(self->callback_data);
- }
- }
- if(!found){
- TSK_DEBUG_INFO("State machine: No matching state found.");
- }
-
- return ret_exec;
+ tsk_list_item_t *item;
+ va_list ap;
+ tsk_bool_t found = tsk_false;
+ tsk_bool_t terminates = tsk_false; /* thread-safeness -> DO NOT REMOVE THIS VARIABLE */
+ int ret_exec = 0; /* success */
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(tsk_fsm_terminated(self)) {
+ TSK_DEBUG_WARN("The FSM is in the final state.");
+ return -2;
+ }
+
+ // lock
+ tsk_safeobj_lock(self);
+
+ va_start(ap, cond_data2);
+ tsk_list_foreach(item, self->entries) {
+ tsk_fsm_entry_t* entry = (tsk_fsm_entry_t*)item->data;
+ if(((entry->from != tsk_fsm_state_any) && (entry->from != tsk_fsm_state_current)) && (entry->from != self->current)) {
+ continue;
+ }
+
+ if((entry->action != tsk_fsm_action_any) && (entry->action != action)) {
+ continue;
+ }
+
+ // check condition
+ if(entry->cond(cond_data1, cond_data2)) {
+ // For debug information
+ if(self->debug) {
+ TSK_DEBUG_INFO("State machine: %s", entry->desc);
+ }
+
+ if(entry->to != tsk_fsm_state_any && entry->to != tsk_fsm_state_current) { /* Stay at the current state if destination state is Any or Current */
+ self->current = entry->to;
+ }
+
+ if(entry->exec) {
+ if((ret_exec = entry->exec(&ap))) {
+ TSK_DEBUG_INFO("State machine: Exec function failed. Moving to terminal state.");
+ }
+ }
+ else { /* Nothing to execute */
+ ret_exec = 0;
+ }
+
+ terminates = (ret_exec || (self->current == self->term));
+ found = tsk_true;
+ break;
+ }
+ }
+ va_end(ap);
+
+ // unlock
+ tsk_safeobj_unlock(self);
+
+ /* Only call the callback function after unlock. */
+ if(terminates) {
+ self->current = self->term;
+ if(self->callback_term) {
+ self->callback_term(self->callback_data);
+ }
+ }
+ if(!found) {
+ TSK_DEBUG_INFO("State machine: No matching state found.");
+ }
+
+ return ret_exec;
}
tsk_fsm_state_id tsk_fsm_get_current_state(tsk_fsm_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_fsm_state_any;
- }
- return self->current;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_fsm_state_any;
+ }
+ return self->current;
}
int tsk_fsm_set_current_state(tsk_fsm_t* self, tsk_fsm_state_id new_state)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->current = new_state;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->current = new_state;
+ return 0;
}
tsk_bool_t tsk_fsm_terminated(tsk_fsm_t* self)
{
- if(self){
- return (self->current == self->term);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_true;
- }
+ if(self) {
+ return (self->current == self->term);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_true;
+ }
}
@@ -229,48 +234,47 @@ tsk_bool_t tsk_fsm_terminated(tsk_fsm_t* self)
//
static tsk_object_t* tsk_fsm_ctor(tsk_object_t * self, va_list * app)
{
- tsk_fsm_t *fsm = (tsk_fsm_t*)self;
- if(fsm){
- fsm->current = va_arg(*app, tsk_fsm_state_id);
- fsm->term = va_arg(*app, tsk_fsm_state_id);
+ tsk_fsm_t *fsm = (tsk_fsm_t*)self;
+ if(fsm) {
+ fsm->current = va_arg(*app, tsk_fsm_state_id);
+ fsm->term = va_arg(*app, tsk_fsm_state_id);
- fsm->entries = tsk_list_create();
+ fsm->entries = tsk_list_create();
#if defined(DEBUG) || defined(_DEBUG)
- fsm->debug = 1; /* default value, could be changed at any time */
+ fsm->debug = 1; /* default value, could be changed at any time */
#endif
- tsk_safeobj_init(fsm);
- }
+ tsk_safeobj_init(fsm);
+ }
- return self;
+ return self;
}
static tsk_object_t* tsk_fsm_dtor(tsk_object_t * self)
-{
- tsk_fsm_t *fsm = (tsk_fsm_t*)self;
- if(fsm){
- /* If not in the terminal state ==>do it */
- /*if(fsm->current != fsm->term){
- tsk_safeobj_lock(fsm);
- if(fsm->callback_term){
- fsm->callback_term(fsm->callback_data);
- }
- tsk_safeobj_unlock(fsm);
- }*/
- tsk_safeobj_deinit(fsm);
-
- TSK_OBJECT_SAFE_FREE(fsm->entries);
- }
-
- return self;
+{
+ tsk_fsm_t *fsm = (tsk_fsm_t*)self;
+ if(fsm) {
+ /* If not in the terminal state ==>do it */
+ /*if(fsm->current != fsm->term){
+ tsk_safeobj_lock(fsm);
+ if(fsm->callback_term){
+ fsm->callback_term(fsm->callback_data);
+ }
+ tsk_safeobj_unlock(fsm);
+ }*/
+ tsk_safeobj_deinit(fsm);
+
+ TSK_OBJECT_SAFE_FREE(fsm->entries);
+ }
+
+ return self;
}
-static const tsk_object_def_t tsk_fsm_def_s =
-{
- sizeof(tsk_fsm_t),
- tsk_fsm_ctor,
- tsk_fsm_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_fsm_def_s = {
+ sizeof(tsk_fsm_t),
+ tsk_fsm_ctor,
+ tsk_fsm_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsk_fsm_def_t = &tsk_fsm_def_s;
@@ -279,54 +283,53 @@ const tsk_object_def_t *tsk_fsm_def_t = &tsk_fsm_def_s;
//
static tsk_object_t* tsk_fsm_entry_ctor(tsk_object_t * self, va_list * app)
{
- tsk_fsm_entry_t *fsm_entry = (tsk_fsm_entry_t*)self;
- if(fsm_entry){
- }
+ tsk_fsm_entry_t *fsm_entry = (tsk_fsm_entry_t*)self;
+ if(fsm_entry) {
+ }
- return self;
+ return self;
}
static tsk_object_t* tsk_fsm_entry_dtor(tsk_object_t * self)
-{
- tsk_fsm_entry_t *fsm_entry = (tsk_fsm_entry_t*)self;
- if(fsm_entry){
- /* desc is "const char*" => should not be deleted */
- /* TSK_FREE(fsm_entry->desc); */
- }
-
- return self;
+{
+ tsk_fsm_entry_t *fsm_entry = (tsk_fsm_entry_t*)self;
+ if(fsm_entry) {
+ /* desc is "const char*" => should not be deleted */
+ /* TSK_FREE(fsm_entry->desc); */
+ }
+
+ return self;
}
static int tsk_fsm_entry_cmp(const tsk_object_t *_entry1, const tsk_object_t *_entry2)
{
- const tsk_fsm_entry_t* entry1 = (const tsk_fsm_entry_t*)_entry1;
- const tsk_fsm_entry_t* entry2 = (const tsk_fsm_entry_t*)_entry2;
- if(entry1 && entry2){
- /* Put "Any" states at the bottom (Strong)*/
- if(entry1->from == tsk_fsm_state_any){
- return -20;
- }
- else if(entry2->from == tsk_fsm_state_any){
- return +20;
- }
-
- /* Put "Any" actions at the bottom (Weak)*/
- if(entry1->action == tsk_fsm_action_any){
- return -10;
- }
- else if(entry1->action == tsk_fsm_action_any){
- return +10;
- }
- // put conditions first
- return entry1->cond ? -1 : (entry2->cond ? 1 : 0);
- }
- return 0;
+ const tsk_fsm_entry_t* entry1 = (const tsk_fsm_entry_t*)_entry1;
+ const tsk_fsm_entry_t* entry2 = (const tsk_fsm_entry_t*)_entry2;
+ if(entry1 && entry2) {
+ /* Put "Any" states at the bottom (Strong)*/
+ if(entry1->from == tsk_fsm_state_any) {
+ return -20;
+ }
+ else if(entry2->from == tsk_fsm_state_any) {
+ return +20;
+ }
+
+ /* Put "Any" actions at the bottom (Weak)*/
+ if(entry1->action == tsk_fsm_action_any) {
+ return -10;
+ }
+ else if(entry1->action == tsk_fsm_action_any) {
+ return +10;
+ }
+ // put conditions first
+ return entry1->cond ? -1 : (entry2->cond ? 1 : 0);
+ }
+ return 0;
}
-static const tsk_object_def_t tsk_fsm_entry_def_s =
-{
- sizeof(tsk_fsm_entry_t),
- tsk_fsm_entry_ctor,
- tsk_fsm_entry_dtor,
- tsk_fsm_entry_cmp,
+static const tsk_object_def_t tsk_fsm_entry_def_s = {
+ sizeof(tsk_fsm_entry_t),
+ tsk_fsm_entry_ctor,
+ tsk_fsm_entry_dtor,
+ tsk_fsm_entry_cmp,
};
const tsk_object_def_t *tsk_fsm_entry_def_t = &tsk_fsm_entry_def_s;
diff --git a/tinySAK/src/tsk_fsm.h b/tinySAK/src/tsk_fsm.h
index 1cd754f..1078367 100755
--- a/tinySAK/src/tsk_fsm.h
+++ b/tinySAK/src/tsk_fsm.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -124,40 +124,38 @@ typedef int (*tsk_fsm_onterminated_f)(const void*);
/**@ingroup tsk_fsm_group
* FSM entry.
*/
-typedef struct tsk_fsm_entry_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_fsm_entry_s {
+ TSK_DECLARE_OBJECT;
- tsk_fsm_state_id from;
- tsk_fsm_action_id action;
- tsk_fsm_cond cond;
- tsk_fsm_state_id to;
- tsk_fsm_exec exec;
- const char* desc;
+ tsk_fsm_state_id from;
+ tsk_fsm_action_id action;
+ tsk_fsm_cond cond;
+ tsk_fsm_state_id to;
+ tsk_fsm_exec exec;
+ const char* desc;
}
tsk_fsm_entry_t;
/**@ingroup tsk_fsm_group
-* List of @ref tsk_fsm_entry_t elements.
+* List of @ref tsk_fsm_entry_t elements.
*/
typedef tsk_list_t tsk_fsm_entries_L_t;
/**@ingroup tsk_fsm_group
* FSM.
*/
-typedef struct tsk_fsm_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_fsm_s {
+ TSK_DECLARE_OBJECT;
- unsigned debug:1;
- tsk_fsm_state_id current;
- tsk_fsm_state_id term;
- tsk_fsm_entries_L_t* entries;
+ unsigned debug:1;
+ tsk_fsm_state_id current;
+ tsk_fsm_state_id term;
+ tsk_fsm_entries_L_t* entries;
- tsk_fsm_onterminated_f callback_term;
- const void* callback_data;
+ tsk_fsm_onterminated_f callback_term;
+ const void* callback_data;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tsk_fsm_t;
diff --git a/tinySAK/src/tsk_hmac.c b/tinySAK/src/tsk_hmac.c
index 2d78dc5..b2563df 100755
--- a/tinySAK/src/tsk_hmac.c
+++ b/tinySAK/src/tsk_hmac.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,83 +45,85 @@ int tsk_hmac_xxxcompute(const uint8_t* input, tsk_size_t input_size, const char*
{
#define TSK_MAX_BLOCK_SIZE TSK_SHA1_BLOCK_SIZE
- tsk_size_t i, newkey_size;
-
- tsk_size_t block_size = type == md5 ? TSK_MD5_BLOCK_SIZE : TSK_SHA1_BLOCK_SIZE; // Only SHA-1 and MD5 are supported for now
- tsk_size_t digest_size = type == md5 ? TSK_MD5_DIGEST_SIZE : TSK_SHA1_DIGEST_SIZE;
- char hkey [TSK_MAX_BLOCK_SIZE];
-
- uint8_t ipad [TSK_MAX_BLOCK_SIZE];
- uint8_t opad [TSK_MAX_BLOCK_SIZE];
-
-
- memset(ipad, 0, sizeof(ipad));
- memset(opad, 0, sizeof(ipad));
-
- /*
- * H(K XOR opad, H(K XOR ipad, input))
- */
-
- // Check key len
- if (key_size > block_size){
- if(type == md5){
- TSK_MD5_DIGEST_CALC(key, key_size, (uint8_t*)hkey);
- }
- else if(type == sha1){
- TSK_SHA1_DIGEST_CALC((uint8_t*)key, (unsigned int)key_size, (uint8_t*)hkey);
- }
- else return -3;
-
- newkey_size = digest_size;
- }
- else{
- memcpy(hkey, key, key_size);
- newkey_size = key_size;
- }
-
- memcpy(ipad, hkey, newkey_size);
- memcpy(opad, hkey, newkey_size);
-
- /* [K XOR ipad] and [K XOR opad]*/
- for (i=0; i<block_size; i++){
- ipad[i] ^= 0x36;
- opad[i] ^= 0x5c;
- }
-
-
- {
- tsk_buffer_t *passx; // pass1 or pass2
- int pass1_done = 0;
-
- passx = tsk_buffer_create(ipad, block_size); // pass1
- tsk_buffer_append(passx, input, input_size);
+ tsk_size_t i, newkey_size;
+
+ tsk_size_t block_size = type == md5 ? TSK_MD5_BLOCK_SIZE : TSK_SHA1_BLOCK_SIZE; // Only SHA-1 and MD5 are supported for now
+ tsk_size_t digest_size = type == md5 ? TSK_MD5_DIGEST_SIZE : TSK_SHA1_DIGEST_SIZE;
+ char hkey [TSK_MAX_BLOCK_SIZE];
+
+ uint8_t ipad [TSK_MAX_BLOCK_SIZE];
+ uint8_t opad [TSK_MAX_BLOCK_SIZE];
+
+
+ memset(ipad, 0, sizeof(ipad));
+ memset(opad, 0, sizeof(ipad));
+
+ /*
+ * H(K XOR opad, H(K XOR ipad, input))
+ */
+
+ // Check key len
+ if (key_size > block_size) {
+ if(type == md5) {
+ TSK_MD5_DIGEST_CALC(key, key_size, (uint8_t*)hkey);
+ }
+ else if(type == sha1) {
+ TSK_SHA1_DIGEST_CALC((uint8_t*)key, (unsigned int)key_size, (uint8_t*)hkey);
+ }
+ else {
+ return -3;
+ }
+
+ newkey_size = digest_size;
+ }
+ else {
+ memcpy(hkey, key, key_size);
+ newkey_size = key_size;
+ }
+
+ memcpy(ipad, hkey, newkey_size);
+ memcpy(opad, hkey, newkey_size);
+
+ /* [K XOR ipad] and [K XOR opad]*/
+ for (i=0; i<block_size; i++) {
+ ipad[i] ^= 0x36;
+ opad[i] ^= 0x5c;
+ }
+
+
+ {
+ tsk_buffer_t *passx; // pass1 or pass2
+ int pass1_done = 0;
+
+ passx = tsk_buffer_create(ipad, block_size); // pass1
+ tsk_buffer_append(passx, input, input_size);
digest_compute:
- if(type == md5){
- TSK_MD5_DIGEST_CALC(TSK_BUFFER_TO_U8(passx), (unsigned int)TSK_BUFFER_SIZE(passx), digest);
- }
- else{
- TSK_SHA1_DIGEST_CALC(TSK_BUFFER_TO_U8(passx), (unsigned int)TSK_BUFFER_SIZE(passx), digest);
- }
-
- if(pass1_done){
- TSK_OBJECT_SAFE_FREE(passx);
- goto pass1_and_pass2_done;
- }
- else{
- pass1_done = 1;
- }
-
- tsk_buffer_cleanup(passx);
- tsk_buffer_append(passx, opad, block_size); // pass2
- tsk_buffer_append(passx, digest, digest_size);
-
- goto digest_compute;
- }
+ if(type == md5) {
+ TSK_MD5_DIGEST_CALC(TSK_BUFFER_TO_U8(passx), (unsigned int)TSK_BUFFER_SIZE(passx), digest);
+ }
+ else {
+ TSK_SHA1_DIGEST_CALC(TSK_BUFFER_TO_U8(passx), (unsigned int)TSK_BUFFER_SIZE(passx), digest);
+ }
+
+ if(pass1_done) {
+ TSK_OBJECT_SAFE_FREE(passx);
+ goto pass1_and_pass2_done;
+ }
+ else {
+ pass1_done = 1;
+ }
+
+ tsk_buffer_cleanup(passx);
+ tsk_buffer_append(passx, opad, block_size); // pass2
+ tsk_buffer_append(passx, digest, digest_size);
+
+ goto digest_compute;
+ }
pass1_and_pass2_done:
- return 0;
+ return 0;
}
@@ -133,46 +135,46 @@ pass1_and_pass2_done:
* @date 12/29/2009
*
* @param [in,out] input The input data.
- * @param input_size The size of the input.
- * @param [in,out] key The input key.
- * @param key_size The size of the input key.
+ * @param input_size The size of the input.
+ * @param [in,out] key The input key.
+ * @param key_size The size of the input key.
* @param [out] result Pointer to the result.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int hmac_md5_compute(const uint8_t* input, tsk_size_t input_size, const char* key, tsk_size_t key_size, tsk_md5string_t *result)
{
- tsk_md5digest_t digest;
- int ret;
+ tsk_md5digest_t digest;
+ int ret;
- if((ret = hmac_md5digest_compute(input, input_size, key, key_size, digest))){
- return ret;
- }
- tsk_str_from_hex(digest, TSK_MD5_DIGEST_SIZE, *result);
- (*result)[TSK_MD5_STRING_SIZE] = '\0';
+ if((ret = hmac_md5digest_compute(input, input_size, key, key_size, digest))) {
+ return ret;
+ }
+ tsk_str_from_hex(digest, TSK_MD5_DIGEST_SIZE, *result);
+ (*result)[TSK_MD5_STRING_SIZE] = '\0';
- return 0;
+ return 0;
}
/**@ingroup tsk_hmac_group
*
- * Calculate HMAC-MD5 hash (bytes) as per RFC 2104.
+ * Calculate HMAC-MD5 hash (bytes) as per RFC 2104.
*
* @author Mamadou
* @date 12/29/2009
*
- * @param [in,out] input The input data.
- * @param input_size The Size of the input.
- * @param [in,out] key The input key.
- * @param key_size The size of the input key.
- * @param result Pointer to the result.
+ * @param [in,out] input The input data.
+ * @param input_size The Size of the input.
+ * @param [in,out] key The input key.
+ * @param key_size The size of the input key.
+ * @param result Pointer to the result.
*
* @return Zero if succeed and non-zero error code otherwise.
**/
int hmac_md5digest_compute(const uint8_t* input, tsk_size_t input_size, const char* key, tsk_size_t key_size, tsk_md5digest_t result)
{
- return tsk_hmac_xxxcompute(input, input_size, key, key_size, md5, result);
+ return tsk_hmac_xxxcompute(input, input_size, key, key_size, md5, result);
}
/**@ingroup tsk_hmac_group
@@ -182,9 +184,9 @@ int hmac_md5digest_compute(const uint8_t* input, tsk_size_t input_size, const ch
* @author Mamadou
* @date 12/29/2009
*
- * @param [in,out] input The input data.
- * @param input_size The Size of the input.
- * @param [in,out] key The input key.
+ * @param [in,out] input The input data.
+ * @param input_size The Size of the input.
+ * @param [in,out] key The input key.
* @param key_size The size of the input key.
* @param [out] result Pointer to the result.
*
@@ -192,16 +194,16 @@ int hmac_md5digest_compute(const uint8_t* input, tsk_size_t input_size, const ch
**/
int hmac_sha1_compute(const uint8_t* input, tsk_size_t input_size, const char* key, tsk_size_t key_size, tsk_sha1string_t *result)
{
- tsk_sha1digest_t digest;
- int ret;
+ tsk_sha1digest_t digest;
+ int ret;
- if((ret = hmac_sha1digest_compute(input, input_size, key, key_size, digest))){
- return ret;
- }
- tsk_str_from_hex((uint8_t*)digest, TSK_SHA1_DIGEST_SIZE, (char*)*result);
- (*result)[TSK_SHA1_STRING_SIZE] = '\0';
+ if((ret = hmac_sha1digest_compute(input, input_size, key, key_size, digest))) {
+ return ret;
+ }
+ tsk_str_from_hex((uint8_t*)digest, TSK_SHA1_DIGEST_SIZE, (char*)*result);
+ (*result)[TSK_SHA1_STRING_SIZE] = '\0';
- return 0;
+ return 0;
}
/**@ingroup tsk_hmac_group
@@ -211,16 +213,16 @@ int hmac_sha1_compute(const uint8_t* input, tsk_size_t input_size, const char* k
* @author Mamadou
* @date 12/29/2009
*
- * @param [in,out] input If non-null, the input.
- * @param input_size The size of the input.
- * @param [in,out] key The input key.
+ * @param [in,out] input If non-null, the input.
+ * @param input_size The size of the input.
+ * @param [in,out] key The input key.
* @param key_size The size of the input key.
- * @param result Pointer to the result.
+ * @param result Pointer to the result.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int hmac_sha1digest_compute(const uint8_t* input, tsk_size_t input_size, const char* key, tsk_size_t key_size, tsk_sha1digest_t result)
{
- return tsk_hmac_xxxcompute(input, input_size, key, key_size, sha1, (uint8_t*)result);
+ return tsk_hmac_xxxcompute(input, input_size, key, key_size, sha1, (uint8_t*)result);
}
diff --git a/tinySAK/src/tsk_hmac.h b/tinySAK/src/tsk_hmac.h
index 5bd76b4..c91d7db 100755
--- a/tinySAK/src/tsk_hmac.h
+++ b/tinySAK/src/tsk_hmac.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_list.c b/tinySAK/src/tsk_list.c
index fb59ac7..5726b28 100755
--- a/tinySAK/src/tsk_list.c
+++ b/tinySAK/src/tsk_list.c
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,7 +35,7 @@
*/
static int tsk_list_find_by_item(const tsk_list_item_t* item, const void* _item)
{
- return (item == (const tsk_list_item_t*)_item) ? 0 : -1;
+ return (item == (const tsk_list_item_t*)_item) ? 0 : -1;
}
/**@ingroup tsk_list_group
@@ -45,18 +45,18 @@ static int tsk_list_find_by_item(const tsk_list_item_t* item, const void* _item)
*/
tsk_list_t* tsk_list_create()
{
- return (tsk_list_t*)tsk_object_new(tsk_list_def_t);
+ return (tsk_list_t*)tsk_object_new(tsk_list_def_t);
}
/**@ingroup tsk_list_group
-* Create and initialize an item to be added to a @ref tsk_list_t "linked list".
+* Create and initialize an item to be added to a @ref tsk_list_t "linked list".
* You should not need to call this function by yourself. See @ref _Anchor_TinySAK_Linked_List_Add_Remove "here" for more information on how to add items.<br />
* You <b>MUST</b> use @ref TSK_OBJECT_SAFE_FREE() to safely free the returned @ref _Page_TinySAK_AnsiC_Object_Programming "well-defined" object. <br />
* @return The newly created @ref tsk_list_item_t "item" object.
*/
tsk_list_item_t* tsk_list_item_create()
{
- return (tsk_list_item_t*)tsk_object_new(tsk_list_item_def_t);
+ return (tsk_list_item_t*)tsk_object_new(tsk_list_item_def_t);
}
/**@ingroup tsk_list_group
@@ -68,16 +68,16 @@ tsk_list_item_t* tsk_list_item_create()
*/
int tsk_list_lock(tsk_list_t* list)
{
- if(list){
- if(!list->mutex){
- list->mutex = tsk_mutex_create();
- }
- return tsk_mutex_lock(list->mutex);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(list) {
+ if(!list->mutex) {
+ list->mutex = tsk_mutex_create();
+ }
+ return tsk_mutex_lock(list->mutex);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_list_group
@@ -89,13 +89,13 @@ int tsk_list_lock(tsk_list_t* list)
*/
int tsk_list_unlock(tsk_list_t* list)
{
- if(list && list->mutex){
- return tsk_mutex_unlock(list->mutex);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(list && list->mutex) {
+ return tsk_mutex_unlock(list->mutex);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_list_group
@@ -107,10 +107,10 @@ int tsk_list_unlock(tsk_list_t* list)
*/
tsk_bool_t tsk_list_remove_item(tsk_list_t* list, tsk_list_item_t* item)
{
- if(item){
- return tsk_list_remove_item_by_pred(list, tsk_list_find_by_item, (const void*)item);
- }
- return tsk_false;
+ if(item) {
+ return tsk_list_remove_item_by_pred(list, tsk_list_find_by_item, (const void*)item);
+ }
+ return tsk_false;
}
/**@ingroup tsk_list_group
@@ -122,42 +122,42 @@ tsk_bool_t tsk_list_remove_item(tsk_list_t* list, tsk_list_item_t* item)
*/
tsk_list_item_t* tsk_list_pop_item_by_data(tsk_list_t* list, const tsk_object_t *tskobj)
{
- if(list){
- tsk_list_item_t *prev = tsk_null;
- tsk_list_item_t *curr = prev = list->head;
-
- while(curr){
- if(!tsk_object_cmp(curr->data, tskobj)){
- if(prev == curr){
- /* Found at first position. */
- if(list->head == list->tail){
- /* There was only one item */
- list->head = list->tail = tsk_null;
- }
- else{
- list->head = curr->next;
- }
- }
- else {
- if(curr == list->tail){
- /* Found at last position */
- list->tail = prev;
- list->tail->next = tsk_null;
- }
- else{
- prev->next = curr->next;
- }
- }
-
- return curr;
- }
-
- prev = curr;
- curr = curr->next;
- }
- }
-
- return tsk_null;
+ if(list) {
+ tsk_list_item_t *prev = tsk_null;
+ tsk_list_item_t *curr = prev = list->head;
+
+ while(curr) {
+ if(!tsk_object_cmp(curr->data, tskobj)) {
+ if(prev == curr) {
+ /* Found at first position. */
+ if(list->head == list->tail) {
+ /* There was only one item */
+ list->head = list->tail = tsk_null;
+ }
+ else {
+ list->head = curr->next;
+ }
+ }
+ else {
+ if(curr == list->tail) {
+ /* Found at last position */
+ list->tail = prev;
+ list->tail->next = tsk_null;
+ }
+ else {
+ prev->next = curr->next;
+ }
+ }
+
+ return curr;
+ }
+
+ prev = curr;
+ curr = curr->next;
+ }
+ }
+
+ return tsk_null;
}
/**@ingroup tsk_list_group
@@ -168,12 +168,12 @@ tsk_list_item_t* tsk_list_pop_item_by_data(tsk_list_t* list, const tsk_object_t
*/
tsk_bool_t tsk_list_remove_item_by_data(tsk_list_t* list, const tsk_object_t * tskobj)
{
- tsk_list_item_t* item;
- if((item = tsk_list_pop_item_by_data(list, tskobj))){
- tsk_object_unref(item);
- return tsk_true;
- }
- return tsk_false;
+ tsk_list_item_t* item;
+ if((item = tsk_list_pop_item_by_data(list, tskobj))) {
+ tsk_object_unref(item);
+ return tsk_true;
+ }
+ return tsk_false;
}
/**@ingroup tsk_list_group
@@ -187,42 +187,42 @@ tsk_bool_t tsk_list_remove_item_by_data(tsk_list_t* list, const tsk_object_t * t
*/
tsk_list_item_t* tsk_list_pop_item_by_pred(tsk_list_t* list, tsk_list_func_predicate predicate, const void * data)
{
- if(list){
- tsk_list_item_t *prev = tsk_null;
- tsk_list_item_t *curr = prev = list->head;
-
- while(curr){
- if(!predicate(curr, data)){
- if(prev == curr){
- /* Found at first position. */
- if(list->head == list->tail){
- /* There was only one item */
- list->head = list->tail = tsk_null;
- }
- else{
- list->head = curr->next;
- }
- }
- else {
- if(curr == list->tail){
- /* Found at last position */
- list->tail = prev;
- list->tail->next = tsk_null;
- }
- else{
- prev->next = curr->next;
- }
- }
-
- return curr;
- }
-
- prev = curr;
- curr = curr->next;
- }
- }
-
- return 0;
+ if(list) {
+ tsk_list_item_t *prev = tsk_null;
+ tsk_list_item_t *curr = prev = list->head;
+
+ while(curr) {
+ if(!predicate(curr, data)) {
+ if(prev == curr) {
+ /* Found at first position. */
+ if(list->head == list->tail) {
+ /* There was only one item */
+ list->head = list->tail = tsk_null;
+ }
+ else {
+ list->head = curr->next;
+ }
+ }
+ else {
+ if(curr == list->tail) {
+ /* Found at last position */
+ list->tail = prev;
+ list->tail->next = tsk_null;
+ }
+ else {
+ prev->next = curr->next;
+ }
+ }
+
+ return curr;
+ }
+
+ prev = curr;
+ curr = curr->next;
+ }
+ }
+
+ return 0;
}
/**@ingroup tsk_list_group
@@ -234,12 +234,12 @@ tsk_list_item_t* tsk_list_pop_item_by_pred(tsk_list_t* list, tsk_list_func_predi
*/
tsk_bool_t tsk_list_remove_item_by_pred(tsk_list_t* list, tsk_list_func_predicate predicate, const void * data)
{
- tsk_list_item_t* item;
- if((item = tsk_list_pop_item_by_pred(list, predicate, data))){
- tsk_object_unref(item);
- return tsk_true;
- }
- return tsk_false;
+ tsk_list_item_t* item;
+ if((item = tsk_list_pop_item_by_pred(list, predicate, data))) {
+ tsk_object_unref(item);
+ return tsk_true;
+ }
+ return tsk_false;
}
/**@ingroup tsk_list_group
@@ -248,18 +248,18 @@ tsk_bool_t tsk_list_remove_item_by_pred(tsk_list_t* list, tsk_list_func_predicat
*/
void tsk_list_clear_items(tsk_list_t* list)
{
- if(list){
- tsk_list_item_t* next = tsk_null;
- tsk_list_item_t* curr = list->head;
-
- while(curr){
- next = curr->next;
- tsk_object_unref(curr);
- curr = next;
- }
- list->head = tsk_null;
- list->tail = tsk_null;
- }
+ if(list) {
+ tsk_list_item_t* next = tsk_null;
+ tsk_list_item_t* curr = list->head;
+
+ while(curr) {
+ next = curr->next;
+ tsk_object_unref(curr);
+ curr = next;
+ }
+ list->head = tsk_null;
+ list->tail = tsk_null;
+ }
}
/**@ingroup tsk_list_group
@@ -269,20 +269,20 @@ void tsk_list_clear_items(tsk_list_t* list)
*/
tsk_list_item_t* tsk_list_pop_first_item(tsk_list_t* list)
{
- tsk_list_item_t* item = tsk_null;
- if(list){
- item = list->head;
- if(list->head){
- if(list->head->next){
- list->head = list->head->next;
- }
- else{
- list->head = list->tail = tsk_null;
- }
- }
- }
+ tsk_list_item_t* item = tsk_null;
+ if(list) {
+ item = list->head;
+ if(list->head) {
+ if(list->head->next) {
+ list->head = list->head->next;
+ }
+ else {
+ list->head = list->tail = tsk_null;
+ }
+ }
+ }
- return item;
+ return item;
}
/**@ingroup tsk_list_group
@@ -293,20 +293,20 @@ tsk_list_item_t* tsk_list_pop_first_item(tsk_list_t* list)
*/
void tsk_list_push_item(tsk_list_t* list, tsk_list_item_t** item, tsk_bool_t back)
{
- // do not test
- tsk_bool_t first = !list->head;
-
- if(back && list->tail){
- list->tail->next = *item, list->tail = *item, (*item)->next = tsk_null;
- }
- else {
- (*item)->next = list->head, list->head = *item;
- }
-
- if(first){
- list->tail = list->head = *item, list->tail->next = tsk_null;
- }
- (*item) = tsk_null;
+ // do not test
+ tsk_bool_t first = !list->head;
+
+ if(back && list->tail) {
+ list->tail->next = *item, list->tail = *item, (*item)->next = tsk_null;
+ }
+ else {
+ (*item)->next = list->head, list->head = *item;
+ }
+
+ if(first) {
+ list->tail = list->head = *item, list->tail->next = tsk_null;
+ }
+ (*item) = tsk_null;
}
/**@ingroup tsk_list_group
@@ -318,44 +318,44 @@ void tsk_list_push_item(tsk_list_t* list, tsk_list_item_t** item, tsk_bool_t bac
*/
void tsk_list_push_filtered_item(tsk_list_t* list, tsk_list_item_t** item, tsk_bool_t ascending)
{
- if (list && item && *item) {
- tsk_list_item_t *prev = tsk_null;
- tsk_list_item_t *curr = prev = list->head;
- int diff;
-
- while (curr) {
- diff = tsk_object_cmp((*item), curr);
- if (diff == 0 || (diff </*=*/ 0 && ascending) || (diff >/*=*/0 && !ascending)) {
- int after = (diff == 0); // push_after(match) -> backward compatibility
- int back = (after && (curr == list->tail));
- int front = !back && (curr == list->head);
-
- if (back) {
- tsk_list_push_back_item(list, item);
- }
- else if (front) {
- tsk_list_push_front_item(list, item);
- }
- else {
- if (after) {
- // push_after(match)
- (*item)->next = curr->next;
- curr->next = (*item);
- }
- else {
- // push_before(match)
- (*item)->next = curr;
- prev->next = (*item);
- }
- }
- (*item) = tsk_null;
- return;
- }
- prev = curr;
- curr = curr->next;
- }
- tsk_list_push_back_item(list, item);
- }
+ if (list && item && *item) {
+ tsk_list_item_t *prev = tsk_null;
+ tsk_list_item_t *curr = prev = list->head;
+ int diff;
+
+ while (curr) {
+ diff = tsk_object_cmp((*item), curr);
+ if (diff == 0 || (diff </*=*/ 0 && ascending) || (diff >/*=*/0 && !ascending)) {
+ int after = (diff == 0); // push_after(match) -> backward compatibility
+ int back = (after && (curr == list->tail));
+ int front = !back && (curr == list->head);
+
+ if (back) {
+ tsk_list_push_back_item(list, item);
+ }
+ else if (front) {
+ tsk_list_push_front_item(list, item);
+ }
+ else {
+ if (after) {
+ // push_after(match)
+ (*item)->next = curr->next;
+ curr->next = (*item);
+ }
+ else {
+ // push_before(match)
+ (*item)->next = curr;
+ prev->next = (*item);
+ }
+ }
+ (*item) = tsk_null;
+ return;
+ }
+ prev = curr;
+ curr = curr->next;
+ }
+ tsk_list_push_back_item(list, item);
+ }
}
/**@ingroup tsk_list_group
@@ -367,25 +367,25 @@ void tsk_list_push_filtered_item(tsk_list_t* list, tsk_list_item_t** item, tsk_b
**/
int tsk_list_push_list(tsk_list_t* dest, const tsk_list_t* src, tsk_bool_t back)
{
- const tsk_list_item_t* curr = (src)->head;
- tsk_object_t* copy;
-
- if(!dest || !src){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ const tsk_list_item_t* curr = (src)->head;
+ tsk_object_t* copy;
- while(curr){
- copy = tsk_object_ref(curr->data);
- tsk_list_push_data(dest, (void**)&copy, back);
-
- curr = curr->next;
- }
- return 0;
+ if(!dest || !src) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ while(curr) {
+ copy = tsk_object_ref(curr->data);
+ tsk_list_push_data(dest, (void**)&copy, back);
+
+ curr = curr->next;
+ }
+ return 0;
}
/**@ingroup tsk_list_group
-* Adds a @ref _Page_TinySAK_AnsiC_Object_Programming "well-defined" object to the @a list.
+* Adds a @ref _Page_TinySAK_AnsiC_Object_Programming "well-defined" object to the @a list.
* The reference to the @a object will be stolen(set to @ref tsk_null) instead of incrementing its reference counter.
* @param list The destination @a list.
* @param tskobj The @a object to add.
@@ -395,19 +395,19 @@ int tsk_list_push_list(tsk_list_t* dest, const tsk_list_t* src, tsk_bool_t back)
*/
int tsk_list_push_data(tsk_list_t* list, tsk_object_t** tskobj, tsk_bool_t back)
{
- if(list && tskobj && *tskobj){
- tsk_list_item_t *item = tsk_list_item_create();
- item->data = *tskobj; // stolen
-
- tsk_list_push_item(list, &item, back);
- (*tskobj) = tsk_null;
+ if(list && tskobj && *tskobj) {
+ tsk_list_item_t *item = tsk_list_item_create();
+ item->data = *tskobj; // stolen
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_list_push_item(list, &item, back);
+ (*tskobj) = tsk_null;
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_list_group
@@ -420,19 +420,19 @@ int tsk_list_push_data(tsk_list_t* list, tsk_object_t** tskobj, tsk_bool_t back)
*/
int tsk_list_push_filtered_data(tsk_list_t* list, tsk_object_t** tskobj, tsk_bool_t ascending)
{
- if(list && tskobj && *tskobj){
- tsk_list_item_t *item = tsk_list_item_create();
- item->data = *tskobj;
-
- tsk_list_push_filtered_item(list, &item, ascending);
- (*tskobj) = tsk_null;
+ if(list && tskobj && *tskobj) {
+ tsk_list_item_t *item = tsk_list_item_create();
+ item->data = *tskobj;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tsk_list_push_filtered_item(list, &item, ascending);
+ (*tskobj) = tsk_null;
+
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_list_group
@@ -446,16 +446,16 @@ int tsk_list_push_filtered_data(tsk_list_t* list, tsk_object_t** tskobj, tsk_boo
*/
const tsk_list_item_t* tsk_list_find_item_by_data(const tsk_list_t* list, const tsk_object_t* tskobj)
{
- if(list && tskobj){
- tsk_list_item_t *item;
- tsk_list_foreach(item, list){
- if(!tsk_object_cmp(item->data, tskobj)){
- return item;
- }
- }
- }
-
- return 0;
+ if(list && tskobj) {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, list) {
+ if(!tsk_object_cmp(item->data, tskobj)) {
+ return item;
+ }
+ }
+ }
+
+ return 0;
}
/**@ingroup tsk_list_group
@@ -470,18 +470,18 @@ const tsk_list_item_t* tsk_list_find_item_by_data(const tsk_list_t* list, const
*/
const tsk_list_item_t* tsk_list_find_item_by_pred(const tsk_list_t* list, tsk_list_func_predicate predicate, const void* data)
{
- if(predicate){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, list){
- if(predicate(item, data) == 0){
- return item;
- }
- }
- }
- else{
- TSK_DEBUG_WARN("Cannot use a null predicate function");
- }
- return tsk_null;
+ if(predicate) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, list) {
+ if(predicate(item, data) == 0) {
+ return item;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_WARN("Cannot use a null predicate function");
+ }
+ return tsk_null;
}
/**@ingroup tsk_list_group
@@ -495,47 +495,47 @@ const tsk_list_item_t* tsk_list_find_item_by_pred(const tsk_list_t* list, tsk_li
*/
const tsk_object_t* tsk_list_find_object_by_pred(const tsk_list_t* list, tsk_list_func_predicate predicate, const void* data)
{
- return tsk_list_find_object_by_pred_at_index(list, predicate, data, 0);
+ return tsk_list_find_object_by_pred_at_index(list, predicate, data, 0);
}
const tsk_object_t* tsk_list_find_object_by_data(const tsk_list_t* list, const tsk_object_t* tskobj)
{
- const tsk_list_item_t* item = tsk_list_find_item_by_data(list, tskobj);
- if(item) {
- return (const tsk_object_t*)item->data;
- }
- return tsk_null;
+ const tsk_list_item_t* item = tsk_list_find_item_by_data(list, tskobj);
+ if(item) {
+ return (const tsk_object_t*)item->data;
+ }
+ return tsk_null;
}
/**@ingroup tsk_list_group */
const tsk_object_t* tsk_list_find_object_by_pred_at_index(const tsk_list_t* list, tsk_list_func_predicate predicate, const void* data, tsk_size_t index)
{
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
-
- tsk_list_foreach(item, list){
- if((!predicate || predicate(item, data) == 0) && pos++ >= index){
- return item->data;
- }
- }
-
- return tsk_null;
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+
+ tsk_list_foreach(item, list) {
+ if((!predicate || predicate(item, data) == 0) && pos++ >= index) {
+ return item->data;
+ }
+ }
+
+ return tsk_null;
}
/**@ingroup tsk_list_group */
int tsk_list_find_index_by_pred(const tsk_list_t* list, tsk_list_func_predicate predicate, const void* data)
-{
- if(list && predicate){
- int index = 0;
- const tsk_list_item_t *item;
- tsk_list_foreach(item, list){
- if(predicate(item, data) == 0){
- return index;
- }
- ++index;
- }
- }
- return -1;
+{
+ if(list && predicate) {
+ int index = 0;
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, list) {
+ if(predicate(item, data) == 0) {
+ return index;
+ }
+ ++index;
+ }
+ }
+ return -1;
}
/**@ingroup tsk_list_group
@@ -547,34 +547,34 @@ int tsk_list_find_index_by_pred(const tsk_list_t* list, tsk_list_func_predicate
*/
tsk_size_t tsk_list_count(const tsk_list_t* list, tsk_list_func_predicate predicate, const void* data)
{
- tsk_size_t count = 0;
- if(list){
- const tsk_list_item_t *item;
- tsk_list_foreach(item, list){
- if(!predicate || (predicate(item, data) == 0)){
- ++count;
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
+ tsk_size_t count = 0;
+ if(list) {
+ const tsk_list_item_t *item;
+ tsk_list_foreach(item, list) {
+ if(!predicate || (predicate(item, data) == 0)) {
+ ++count;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
- return count;
+ return count;
}
/**@ingroup tsk_list_group
*/
tsk_list_t* tsk_list_clone(const tsk_list_t* list)
{
- if (list) {
- tsk_list_t*clone = tsk_list_create();
- if (clone) {
- tsk_list_pushback_list(clone, list);
- }
- return clone;
- }
- return tsk_null;
+ if (list) {
+ tsk_list_t*clone = tsk_list_create();
+ if (clone) {
+ tsk_list_pushback_list(clone, list);
+ }
+ return clone;
+ }
+ return tsk_null;
}
@@ -590,41 +590,42 @@ tsk_list_t* tsk_list_clone(const tsk_list_t* list)
//
static tsk_object_t* tsk_list_item_ctor(tsk_object_t * self, va_list * app)
{
- tsk_list_item_t *item = (tsk_list_item_t*)self;
- if(item){
- }
- return self;
+ tsk_list_item_t *item = (tsk_list_item_t*)self;
+ if(item) {
+ }
+ return self;
}
static tsk_object_t* tsk_list_item_dtor(tsk_object_t *self)
{
- tsk_list_item_t *item = (tsk_list_item_t*)self;
- if(item){
- item->data = tsk_object_unref(item->data);
- }
- else{
- TSK_DEBUG_WARN("Cannot free an uninitialized item");
- }
- return item;
+ tsk_list_item_t *item = (tsk_list_item_t*)self;
+ if(item) {
+ item->data = tsk_object_unref(item->data);
+ }
+ else {
+ TSK_DEBUG_WARN("Cannot free an uninitialized item");
+ }
+ return item;
}
static int tsk_list_item_cmp(const tsk_object_t *_item1, const tsk_object_t *_item2)
-{
- const tsk_list_item_t* item1 = (const tsk_list_item_t*)_item1;
- const tsk_list_item_t* item2 = (const tsk_list_item_t*)_item2;
-
- if(item1 && item2){
- return tsk_object_cmp(item1->data, item2->data);
- }
- else return -1;
+{
+ const tsk_list_item_t* item1 = (const tsk_list_item_t*)_item1;
+ const tsk_list_item_t* item2 = (const tsk_list_item_t*)_item2;
+
+ if(item1 && item2) {
+ return tsk_object_cmp(item1->data, item2->data);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsk_list_item_def_s =
-{
- sizeof(tsk_list_item_t),
- tsk_list_item_ctor,
- tsk_list_item_dtor,
- tsk_list_item_cmp,
+static const tsk_object_def_t tsk_list_item_def_s = {
+ sizeof(tsk_list_item_t),
+ tsk_list_item_ctor,
+ tsk_list_item_dtor,
+ tsk_list_item_cmp,
};
const tsk_object_def_t *tsk_list_item_def_t = &tsk_list_item_def_s;
@@ -633,52 +634,51 @@ const tsk_object_def_t *tsk_list_item_def_t = &tsk_list_item_def_s;
//
static tsk_object_t* tsk_list_ctor(tsk_object_t *self, va_list *app)
{
- tsk_list_t *list = (tsk_list_t *)self;
- if(list){
- }
+ tsk_list_t *list = (tsk_list_t *)self;
+ if(list) {
+ }
- return self;
+ return self;
}
static tsk_object_t* tsk_list_dtor(tsk_object_t *self)
-{
- tsk_list_t *list = (tsk_list_t *)self;
- if(list){
+{
+ tsk_list_t *list = (tsk_list_t *)self;
+ if(list) {
#if 0
- /* Not thread-safe */
- tsk_list_item_t* next = tsk_null;
- tsk_list_item_t* curr = list->head;
-
- while(curr){
- next = curr->next;
- /*curr =*/ tsk_object_unref(curr);
- curr = next;
- }
+ /* Not thread-safe */
+ tsk_list_item_t* next = tsk_null;
+ tsk_list_item_t* curr = list->head;
+
+ while(curr) {
+ next = curr->next;
+ /*curr =*/ tsk_object_unref(curr);
+ curr = next;
+ }
#else
- /* Thread-safe method */
- tsk_list_item_t* item;
- while((item = tsk_list_pop_first_item(list))){
- tsk_object_unref(item);
- }
+ /* Thread-safe method */
+ tsk_list_item_t* item;
+ while((item = tsk_list_pop_first_item(list))) {
+ tsk_object_unref(item);
+ }
#endif
- /* destroy the on-demand mutex */
- if(list->mutex){
- tsk_mutex_destroy(&list->mutex);
- }
- }
- else{
- TSK_DEBUG_WARN("Cannot free an uninitialized list");
- }
- return list;
-}
-
-static const tsk_object_def_t tsk_list_def_s =
-{
- sizeof(tsk_list_t),
- tsk_list_ctor,
- tsk_list_dtor,
- tsk_null,
+ /* destroy the on-demand mutex */
+ if(list->mutex) {
+ tsk_mutex_destroy(&list->mutex);
+ }
+ }
+ else {
+ TSK_DEBUG_WARN("Cannot free an uninitialized list");
+ }
+ return list;
+}
+
+static const tsk_object_def_t tsk_list_def_s = {
+ sizeof(tsk_list_t),
+ tsk_list_ctor,
+ tsk_list_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsk_list_def_t = &tsk_list_def_s;
@@ -701,19 +701,19 @@ const tsk_object_def_t *tsk_list_def_t = &tsk_list_def_s;
*
* A linked-list is a @ref _Page_TinySAK_AnsiC_Object_Programming "well defined" object and must contain only @ref _Page_TinySAK_AnsiC_Object_Programming "well defined" objects. <br />
* A linked-list is a @ref tsk_list_t object and contains @ref tsk_list_item_t objects which holds @ref _Anchor_TinySAK_Linked_List_Well_Defined_Object "our well defined object" in its <i>data</i> field. <br />
-*
+*
* <h2>@anchor _Anchor_TinySAK_Linked_List_Well_Defined_Object Our "well-defined" object</h2>
* Our linked-list will hold a "well defined" object defined like this:
*
*@code
// (well-defined object declaration)
-typedef struct student_s
-{
+typedef struct student_s
+{
TSK_DECLARE_OBJECT;
char *id;
char *name;
-}
+}
student_t;
// (constructor)
@@ -736,7 +736,7 @@ static tsk_object_t* student_dtor(tsk_object_t* self)
// (case insensitive comparator)
static int student_icmp(const tsk_object_t *self, const tsk_object_t *object)
-{
+{
const student_t* student1 = (const tsk_object_t*)self;
const student_t* student2 = (const tsk_object_t*)object;
@@ -750,7 +750,7 @@ static int student_icmp(const tsk_object_t *self, const tsk_object_t *object)
// (well-defined object declaration)
static const tsk_object_def_t student_def_s =
{
- sizeof(student_t),
+ sizeof(student_t),
student_ctor,
student_dtor,
student_icmp
@@ -820,7 +820,7 @@ static int pred_find_student_by_id(const tsk_list_item_t *item, const void *id)
* There are two ways to add items to the list: <br />
* First way:
* @code
-* // create the well-defined object
+* // create the well-defined object
* student_t *student = student_create("0", "student-0");
* // push the object at the end of the list
* tsk_list_push_back_data(list, (void**)&student);
@@ -857,7 +857,7 @@ static int pred_find_student_by_id(const tsk_list_item_t *item, const void *id)
* TSK_DEBUG_INFO("id = %s, name = %s", student->id, student->name);
* }
* @endcode
-*
+*
* <h2>@anchor _Anchor_TinySAK_Linked_List_Sort_Items Sort items</h2>
* You can sort the list in ascending or descending order. The default function used for comparison is the one defined in the well-defined object (see @ref _Anchor_TinySAK_Object_Comparator "here" for more information). <br />
* An item is sorted when it's being added to the list. It's not possible to sort items later once they are added. <br />
@@ -873,7 +873,7 @@ static int pred_find_student_by_id(const tsk_list_item_t *item, const void *id)
*
* <h2>@anchor _Anchor_TinySAK_Linked_List_Find_Items Find items</h2>
* @code
-* // find student with same id
+* // find student with same id
* const student_t* _student = tsk_list_find_object_by_data(list, student);// comparision function will be student_icmp() defined above.
* // find an item containing a student with name equal to "student-2"
* const tsk_list_item_t *item = tsk_list_find_item_by_pred(list, pred_find_student_by_name, "student-2");
diff --git a/tinySAK/src/tsk_list.h b/tinySAK/src/tsk_list.h
index bc0d4d4..184e360 100755
--- a/tinySAK/src/tsk_list.h
+++ b/tinySAK/src/tsk_list.h
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -71,30 +71,28 @@ TSK_BEGIN_DECLS
#define TSK_LIST_LAST_DATA(list) (((list) && (list)->tail) ? (list)->tail->data : tsk_null)
/**@ingroup tsk_list_group
-* Item for @ref tsk_list_t "linked list".
+* Item for @ref tsk_list_t "linked list".
*/
-typedef struct tsk_list_item_s
-{
- TSK_DECLARE_OBJECT;
- void* data; /**< Opaque data. <b>Must</b> be a @ref _Page_TinySAK_AnsiC_Object_Programming "well-defined" object. */
- struct tsk_list_item_s* next; /**< Next item. */
+typedef struct tsk_list_item_s {
+ TSK_DECLARE_OBJECT;
+ void* data; /**< Opaque data. <b>Must</b> be a @ref _Page_TinySAK_AnsiC_Object_Programming "well-defined" object. */
+ struct tsk_list_item_s* next; /**< Next item. */
}
tsk_list_item_t;
/**@ingroup tsk_list_group
* A @ref _Page_TinySAK_AnsiC_Linked_List "linked-list".
*/
-typedef struct tsk_list_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_list_item_t* head; /**< The head of the linked list. */
- tsk_list_item_t* tail; /**< The tail of the linked list. */
- tsk_mutex_handle_t* mutex; /**< on-demand mutex. */
+typedef struct tsk_list_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_list_item_t* head; /**< The head of the linked list. */
+ tsk_list_item_t* tail; /**< The tail of the linked list. */
+ tsk_mutex_handle_t* mutex; /**< on-demand mutex. */
}
tsk_list_t;
-/**@ingroup tsk_list_group
+/**@ingroup tsk_list_group
* Function predicate used to match an item. <br />
* For example, see @ref _Anchor_TinySAK_Linked_List_Find_Items "here" for more information on how to use this function to find items.
* @param item The current item to match.
diff --git a/tinySAK/src/tsk_md5.c b/tinySAK/src/tsk_md5.c
index d7b0251..cdbf14a 100755
--- a/tinySAK/src/tsk_md5.c
+++ b/tinySAK/src/tsk_md5.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,7 +35,7 @@
#include <string.h>
/**@defgroup tsk_md5_group MD5 (RFC 1321) utility functions.
- * The code in this file is a modified version of an implementation placed in the public domain by the following persons:
+ * The code in this file is a modified version of an implementation placed in the public domain by the following persons:
* @author Colin Plumb
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*/
@@ -47,7 +47,7 @@ void tsk_byteReverse(uint32_t *buf, unsigned words)
{
uint8_t *p = (uint8_t *)buf;
- do{
+ do {
*buf++ = (uint32_t)((unsigned)p[3] << 8 | p[2]) << 16 |
((unsigned)p[1] << 8 | p[0]);
p += 4;
@@ -84,12 +84,12 @@ void tsk_md5update(tsk_md5context_t *ctx, uint8_t const *buf, tsk_size_t len)
/* Update byte count */
t = ctx->bytes[0];
- if ((ctx->bytes[0] = t + (uint32_t)len) < t)
- ctx->bytes[1]++; /* Carry from low to high */
+ if ((ctx->bytes[0] = t + (uint32_t)len) < t) {
+ ctx->bytes[1]++; /* Carry from low to high */
+ }
t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
- if (t > len)
- {
+ if (t > len) {
memcpy((uint8_t *)ctx->in + 64 - t, buf, len);
return ;
}
@@ -101,8 +101,7 @@ void tsk_md5update(tsk_md5context_t *ctx, uint8_t const *buf, tsk_size_t len)
len -= t;
/* Process data in 64-byte chunks */
- while (len >= 64)
- {
+ while (len >= 64) {
memcpy(ctx->in, buf, 64);
tsk_byteReverse(ctx->in, 16);
tsk_md5transform(ctx->buf, ctx->in);
@@ -115,7 +114,7 @@ void tsk_md5update(tsk_md5context_t *ctx, uint8_t const *buf, tsk_size_t len)
}
/**@ingroup tsk_md5_group
- * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void tsk_md5final(tsk_md5digest_t digest, tsk_md5context_t *ctx)
@@ -129,8 +128,8 @@ void tsk_md5final(tsk_md5digest_t digest, tsk_md5context_t *ctx)
/* Bytes of padding needed to make 56 bytes (-8..55) */
count = 56 - 1 - count;
- if (count < 0)
- { /* Padding forces an extra block */
+ if (count < 0) {
+ /* Padding forces an extra block */
memset(p, 0, count + 8);
tsk_byteReverse(ctx->in, 16);
tsk_md5transform(ctx->buf, ctx->in);
@@ -253,24 +252,26 @@ void tsk_md5transform(uint32_t buf[4], uint32_t const in[TSK_MD5_DIGEST_SIZE])
/**@ingroup tsk_md5_group
*
- * @brief Calculate MD5 HASH for @a input data.
+ * @brief Calculate MD5 HASH for @a input data.
*
- * @param input The input data.
- * @param size The size of the input data.
- * @param result MD5 hash result as Hexadecimal string.
+ * @param input The input data.
+ * @param size The size of the input data.
+ * @param result MD5 hash result as Hexadecimal string.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsk_md5compute(const char* input, tsk_size_t size, tsk_md5string_t *result)
{
- tsk_md5digest_t digest;
+ tsk_md5digest_t digest;
+
+ if(!result | !*result) {
+ return -1;
+ }
+
+ (*result)[TSK_MD5_STRING_SIZE] = '\0';
- if(!result | !*result) return -1;
-
- (*result)[TSK_MD5_STRING_SIZE] = '\0';
-
- TSK_MD5_DIGEST_CALC(input, size, digest);
- tsk_str_from_hex(digest, TSK_MD5_DIGEST_SIZE, *result);
+ TSK_MD5_DIGEST_CALC(input, size, digest);
+ tsk_str_from_hex(digest, TSK_MD5_DIGEST_SIZE, *result);
- return 0;
+ return 0;
}
diff --git a/tinySAK/src/tsk_md5.h b/tinySAK/src/tsk_md5.h
index 87f711d..d94b626 100755
--- a/tinySAK/src/tsk_md5.h
+++ b/tinySAK/src/tsk_md5.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -74,11 +74,10 @@ typedef uint8_t tsk_md5digest_t[TSK_MD5_DIGEST_SIZE]; /**< MD5 digest bytes. */
tsk_md5final((digest), &ctx); \
}
-typedef struct tsk_md5context_s
-{
- uint32_t buf[4];
- uint32_t bytes[2];
- uint32_t in[16];
+typedef struct tsk_md5context_s {
+ uint32_t buf[4];
+ uint32_t bytes[2];
+ uint32_t in[16];
}
tsk_md5context_t;
diff --git a/tinySAK/src/tsk_memory.c b/tinySAK/src/tsk_memory.c
index 9d72fc0..0d5a62c 100755
--- a/tinySAK/src/tsk_memory.c
+++ b/tinySAK/src/tsk_memory.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,24 +47,24 @@
*/
void* tsk_malloc(tsk_size_t size)
{
- void *ret = malloc(size);
- if(!ret){
- TSK_DEBUG_ERROR("Memory allocation failed");
- }
+ void *ret = malloc(size);
+ if(!ret) {
+ TSK_DEBUG_ERROR("Memory allocation failed");
+ }
- return ret;
+ return ret;
}
/**@ingroup tsk_memory_group
* Reallocate memory block.
* In case that ptr is NULL, the function behaves exactly as @a tsk_malloc, assigning a new block of size bytes and returning a pointer to the beginning of it.
-* The function may move the memory block to a new location, in which case the new location is returned. The content of the memory block is preserved up to the lesser of the
+* The function may move the memory block to a new location, in which case the new location is returned. The content of the memory block is preserved up to the lesser of the
* new and old sizes, even if the block is moved. If the new size is larger, the value of the newly allocated portion is indeterminate.
* In case that the size is 0, the memory previously allocated in ptr is deallocated as if a call to free was made, and a NULL pointer is returned.
* @param ptr Pointer to a memory block previously allocated with malloc, calloc or realloc to be reallocated.
* If this is NULL, a new block is allocated and a pointer to it is returned by the function.
* @param size New size for the memory block, in bytes.
-* If it is 0 and ptr points to an existing block of memory, the memory block pointed by ptr is deallocated and a NULL pointer is returned.
+* If it is 0 and ptr points to an existing block of memory, the memory block pointed by ptr is deallocated and a NULL pointer is returned.
* @retval A pointer to the reallocated memory block, which may be either the same as the ptr argument or a new location.
* The type of this pointer is void*, which can be cast to the desired type of data pointer in order to be dereferenceable.
* If the function failed to allocate the requested block of memory, a NULL pointer is returned.
@@ -72,38 +72,38 @@ void* tsk_malloc(tsk_size_t size)
*/
void* tsk_realloc (void* ptr, tsk_size_t size)
{
- void *ret = tsk_null;
-
- if(size) {
- if(ptr){
- if(!(ret = realloc(ptr, size))){
- TSK_DEBUG_ERROR("Memory reallocation failed");
- }
- }
- else{
- if(!(ret = calloc(size, 1))){
- TSK_DEBUG_ERROR("Memory allocation (%u) failed", (unsigned)size);
- }
- }
- }
- else if (ptr) {
- free(ptr);
- }
-
- return ret;
+ void *ret = tsk_null;
+
+ if(size) {
+ if(ptr) {
+ if(!(ret = realloc(ptr, size))) {
+ TSK_DEBUG_ERROR("Memory reallocation failed");
+ }
+ }
+ else {
+ if(!(ret = calloc(size, 1))) {
+ TSK_DEBUG_ERROR("Memory allocation (%u) failed", (unsigned)size);
+ }
+ }
+ }
+ else if (ptr) {
+ free(ptr);
+ }
+
+ return ret;
}
/**@ingroup tsk_memory_group
* Deallocate space in memory.
* @param ptr Pointer to a memory block previously allocated with @a tsk_malloc, @a tsk_calloc or @a tsk_realloc to be deallocated.
-* If a null pointer is passed as argument, no action occurs.
+* If a null pointer is passed as argument, no action occurs.
*/
void tsk_free(void** ptr)
{
- if(ptr && *ptr){
- free(*ptr);
- *ptr = tsk_null;
- }
+ if(ptr && *ptr) {
+ free(*ptr);
+ *ptr = tsk_null;
+ }
}
/**@ingroup tsk_memory_group
@@ -117,60 +117,60 @@ void tsk_free(void** ptr)
*/
void* tsk_calloc(tsk_size_t num, tsk_size_t size)
{
- void* ret = tsk_null;
- if(num && size){
- ret = calloc(num, size);
- if(!ret){
- TSK_DEBUG_ERROR("Memory allocation failed. num=%u and size=%u", (unsigned)num, (unsigned)size);
- }
- }
-
- return ret;
+ void* ret = tsk_null;
+ if(num && size) {
+ ret = calloc(num, size);
+ if(!ret) {
+ TSK_DEBUG_ERROR("Memory allocation failed. num=%u and size=%u", (unsigned)num, (unsigned)size);
+ }
+ }
+
+ return ret;
}
void* tsk_malloc_aligned(tsk_size_t size, tsk_size_t alignment)
{
#if TSK_UNDER_WINDOWS && !TSK_UNDER_WINDOWS_CE && !TSK_UNDER_WINDOWS_RT
- return _aligned_malloc(size, alignment);
+ return _aligned_malloc(size, alignment);
#else
- void* ret = malloc(size + alignment);
+ void* ret = malloc(size + alignment);
if (ret) {
long pad = ((~(long)ret) % alignment) + 1;
ret = ((uint8_t*)ret) + pad; // pad
((uint8_t*)ret)[-1] = (uint8_t)pad; // store the pad for later use
}
- return ret;
+ return ret;
#endif
}
void* tsk_realloc_aligned(void * ptr, tsk_size_t size, tsk_size_t alignment)
{
#if TSK_UNDER_WINDOWS && !TSK_UNDER_WINDOWS_CE && !TSK_UNDER_WINDOWS_RT
- return _aligned_realloc(ptr, size, alignment);
+ return _aligned_realloc(ptr, size, alignment);
#else
- tsk_free_aligned(ptr);
- return tsk_malloc_aligned(size, alignment);
+ tsk_free_aligned(ptr);
+ return tsk_malloc_aligned(size, alignment);
#endif
}
void tsk_free_aligned(void** ptr)
{
- if (ptr && *ptr) {
- void* ptr_ = *ptr;
+ if (ptr && *ptr) {
+ void* ptr_ = *ptr;
#if TSK_UNDER_WINDOWS && !TSK_UNDER_WINDOWS_CE && !TSK_UNDER_WINDOWS_RT
- _aligned_free(ptr_);
+ _aligned_free(ptr_);
#else
- free((((uint8_t*)ptr_) - ((uint8_t*)ptr_)[-1]));
+ free((((uint8_t*)ptr_) - ((uint8_t*)ptr_)[-1]));
#endif
- *ptr = tsk_null;
- }
+ *ptr = tsk_null;
+ }
}
void* tsk_calloc_aligned(tsk_size_t num, tsk_size_t size, tsk_size_t alignment)
{
- void* ptr = tsk_malloc_aligned((size * num), alignment);
- if (ptr) {
- memset(ptr, 0, (size * num));
- }
- return ptr;
+ void* ptr = tsk_malloc_aligned((size * num), alignment);
+ if (ptr) {
+ memset(ptr, 0, (size * num));
+ }
+ return ptr;
}
diff --git a/tinySAK/src/tsk_memory.h b/tinySAK/src/tsk_memory.h
index 2112fae..a260299 100755
--- a/tinySAK/src/tsk_memory.h
+++ b/tinySAK/src/tsk_memory.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_mutex.c b/tinySAK/src/tsk_mutex.c
index d3eb9f8..8bb8d4e 100755
--- a/tinySAK/src/tsk_mutex.c
+++ b/tinySAK/src/tsk_mutex.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,13 +34,13 @@
#if TSK_UNDER_WINDOWS
# include <windows.h>
# include "tsk_errno.h"
- typedef HANDLE MUTEX_T;
+typedef HANDLE MUTEX_T;
# define MUTEX_S void
# define TSK_ERROR_NOT_OWNER ERROR_NOT_OWNER
#else
# include <pthread.h>
# define MUTEX_S pthread_mutex_t
- typedef MUTEX_S* MUTEX_T;
+typedef MUTEX_S* MUTEX_T;
# define TSK_ERROR_NOT_OWNER EPERM
# if !defined(TSK_RECURSIVE_MUTEXATTR)
# if defined(PTHREAD_MUTEX_RECURSIVE)
@@ -64,8 +64,8 @@
* @sa @ref tsk_mutex_destroy() @ref tsk_mutex_create_2()
*/
tsk_mutex_handle_t* tsk_mutex_create()
-{
- return tsk_mutex_create_2(tsk_true);
+{
+ return tsk_mutex_create_2(tsk_true);
}
/**@ingroup tsk_mutex_group
@@ -76,40 +76,40 @@ tsk_mutex_handle_t* tsk_mutex_create()
*/
tsk_mutex_handle_t* tsk_mutex_create_2(tsk_bool_t recursive)
{
- MUTEX_T handle = tsk_null;
-
+ MUTEX_T handle = tsk_null;
+
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- handle = CreateMutexEx(NULL, NULL, 0x00000000, MUTEX_ALL_ACCESS);
+ handle = CreateMutexEx(NULL, NULL, 0x00000000, MUTEX_ALL_ACCESS);
# else
- handle = CreateMutex(NULL, FALSE, NULL);
+ handle = CreateMutex(NULL, FALSE, NULL);
# endif
#else
- int ret;
- pthread_mutexattr_t mta;
-
- if((ret = pthread_mutexattr_init(&mta))){
- TSK_DEBUG_ERROR("pthread_mutexattr_init failed with error code %d", ret);
- return tsk_null;
- }
- if(recursive && (ret = pthread_mutexattr_settype(&mta, TSK_RECURSIVE_MUTEXATTR))){
- TSK_DEBUG_ERROR("pthread_mutexattr_settype failed with error code %d", ret);
- pthread_mutexattr_destroy(&mta);
- return tsk_null;
- }
-
- /* if we are here: all is ok */
- handle = tsk_calloc(1, sizeof(MUTEX_S));
- if(pthread_mutex_init((MUTEX_T)handle, &mta)){
- TSK_FREE(handle);
- }
- pthread_mutexattr_destroy(&mta);
+ int ret;
+ pthread_mutexattr_t mta;
+
+ if((ret = pthread_mutexattr_init(&mta))) {
+ TSK_DEBUG_ERROR("pthread_mutexattr_init failed with error code %d", ret);
+ return tsk_null;
+ }
+ if(recursive && (ret = pthread_mutexattr_settype(&mta, TSK_RECURSIVE_MUTEXATTR))) {
+ TSK_DEBUG_ERROR("pthread_mutexattr_settype failed with error code %d", ret);
+ pthread_mutexattr_destroy(&mta);
+ return tsk_null;
+ }
+
+ /* if we are here: all is ok */
+ handle = tsk_calloc(1, sizeof(MUTEX_S));
+ if(pthread_mutex_init((MUTEX_T)handle, &mta)) {
+ TSK_FREE(handle);
+ }
+ pthread_mutexattr_destroy(&mta);
#endif
-
- if(!handle){
- TSK_DEBUG_ERROR("Failed to create new mutex.");
- }
- return handle;
+
+ if(!handle) {
+ TSK_DEBUG_ERROR("Failed to create new mutex.");
+ }
+ return handle;
}
/**@ingroup tsk_mutex_group
@@ -120,24 +120,23 @@ tsk_mutex_handle_t* tsk_mutex_create_2(tsk_bool_t recursive)
*/
int tsk_mutex_lock(tsk_mutex_handle_t* handle)
{
- int ret = EINVAL;
- if(handle)
- {
+ int ret = EINVAL;
+ if(handle) {
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- if((ret = WaitForSingleObjectEx((MUTEX_T)handle, INFINITE, TRUE)) == WAIT_FAILED)
+ if((ret = WaitForSingleObjectEx((MUTEX_T)handle, INFINITE, TRUE)) == WAIT_FAILED)
# else
- if((ret = WaitForSingleObject((MUTEX_T)handle, INFINITE)) == WAIT_FAILED)
+ if((ret = WaitForSingleObject((MUTEX_T)handle, INFINITE)) == WAIT_FAILED)
#endif
#else
- if((ret = pthread_mutex_lock((MUTEX_T)handle)))
+ if((ret = pthread_mutex_lock((MUTEX_T)handle)))
#endif
- {
- TSK_DEBUG_ERROR("Failed to lock the mutex: %d", ret);
- }
- }
- return ret;
+ {
+ TSK_DEBUG_ERROR("Failed to lock the mutex: %d", ret);
+ }
+ }
+ return ret;
}
/**@ingroup tsk_mutex_group
@@ -148,25 +147,23 @@ int tsk_mutex_lock(tsk_mutex_handle_t* handle)
*/
int tsk_mutex_unlock(tsk_mutex_handle_t* handle)
{
- int ret = EINVAL;
- if(handle)
- {
+ int ret = EINVAL;
+ if(handle) {
#if TSK_UNDER_WINDOWS
- if((ret = ReleaseMutex((MUTEX_T)handle) ? 0 : -1)){
- ret = GetLastError();
+ if((ret = ReleaseMutex((MUTEX_T)handle) ? 0 : -1)) {
+ ret = GetLastError();
#else
- if((ret = pthread_mutex_unlock((MUTEX_T)handle)))
- {
+ if((ret = pthread_mutex_unlock((MUTEX_T)handle))) {
#endif
- if(ret == TSK_ERROR_NOT_OWNER){
- TSK_DEBUG_WARN("The calling thread does not own the mutex: %d", ret);
- }
- else{
- TSK_DEBUG_ERROR("Failed to unlock the mutex: %d", ret);
- }
- }
- }
- return ret;
+ if(ret == TSK_ERROR_NOT_OWNER) {
+ TSK_DEBUG_WARN("The calling thread does not own the mutex: %d", ret);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to unlock the mutex: %d", ret);
+ }
+ }
+ }
+ return ret;
}
/**@ingroup tsk_mutex_group
@@ -176,17 +173,17 @@ int tsk_mutex_unlock(tsk_mutex_handle_t* handle)
*/
void tsk_mutex_destroy(tsk_mutex_handle_t** handle)
{
- if(handle && *handle){
+ if(handle && *handle) {
#if TSK_UNDER_WINDOWS
- CloseHandle((MUTEX_T)*handle);
- *handle = tsk_null;
+ CloseHandle((MUTEX_T)*handle);
+ *handle = tsk_null;
#else
- pthread_mutex_destroy((MUTEX_T)*handle);
- tsk_free(handle);
+ pthread_mutex_destroy((MUTEX_T)*handle);
+ tsk_free(handle);
#endif
- }
- else{
- TSK_DEBUG_WARN("Cannot free an uninitialized mutex");
- }
+ }
+ else {
+ TSK_DEBUG_WARN("Cannot free an uninitialized mutex");
+ }
}
diff --git a/tinySAK/src/tsk_mutex.h b/tinySAK/src/tsk_mutex.h
index c02f7f2..f5c414c 100755
--- a/tinySAK/src/tsk_mutex.h
+++ b/tinySAK/src/tsk_mutex.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_object.c b/tinySAK/src/tsk_object.c
index 30bf1f6..b5769d2 100755
--- a/tinySAK/src/tsk_object.c
+++ b/tinySAK/src/tsk_object.c
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,38 +50,38 @@ static int tsk_objects_count = 0;
*/
tsk_object_t* tsk_object_new(const tsk_object_def_t *objdef, ...)
{
- // Do not check "objdef", let the application die if it's null
- tsk_object_t *newobj = tsk_calloc(1, objdef->size);
- if(newobj){
- (*(const tsk_object_def_t **) newobj) = objdef;
- TSK_OBJECT_HEADER(newobj)->refCount = 1;
- if(objdef->constructor){
- va_list ap;
- tsk_object_t * newobj_ = newobj;// save
- va_start(ap, objdef);
- newobj = objdef->constructor(newobj, &ap); // must return new
- va_end(ap);
-
- if(!newobj){ // null if constructor failed to initialized the object
- if(objdef->destructor){
- objdef->destructor(newobj_);
- }
- tsk_free(&newobj_);
- }
+ // Do not check "objdef", let the application die if it's null
+ tsk_object_t *newobj = tsk_calloc(1, objdef->size);
+ if(newobj) {
+ (*(const tsk_object_def_t **) newobj) = objdef;
+ TSK_OBJECT_HEADER(newobj)->refCount = 1;
+ if(objdef->constructor) {
+ va_list ap;
+ tsk_object_t * newobj_ = newobj;// save
+ va_start(ap, objdef);
+ newobj = objdef->constructor(newobj, &ap); // must return new
+ va_end(ap);
+
+ if(!newobj) { // null if constructor failed to initialized the object
+ if(objdef->destructor) {
+ objdef->destructor(newobj_);
+ }
+ tsk_free(&newobj_);
+ }
#if TSK_DEBUG_OBJECTS
- TSK_DEBUG_INFO("N∞ objects:%d", ++tsk_objects_count);
+ TSK_DEBUG_INFO("N∞ objects:%d", ++tsk_objects_count);
#endif
- }
- else{
- TSK_DEBUG_WARN("No constructor found.");
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new tsk_object.");
- }
+ }
+ else {
+ TSK_DEBUG_WARN("No constructor found.");
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new tsk_object.");
+ }
- return newobj;
+ return newobj;
}
/**@ingroup tsk_object_group
@@ -93,26 +93,26 @@ tsk_object_t* tsk_object_new(const tsk_object_def_t *objdef, ...)
*/
tsk_object_t* tsk_object_new_2(const tsk_object_def_t *objdef, va_list* ap)
{
- tsk_object_t *newobj = tsk_calloc(1, objdef->size);
- if (newobj) {
- (*(const tsk_object_def_t **) newobj) = objdef;
- TSK_OBJECT_HEADER(newobj)->refCount = 1;
- if (objdef->constructor) {
- newobj = objdef->constructor(newobj, ap);
+ tsk_object_t *newobj = tsk_calloc(1, objdef->size);
+ if (newobj) {
+ (*(const tsk_object_def_t **) newobj) = objdef;
+ TSK_OBJECT_HEADER(newobj)->refCount = 1;
+ if (objdef->constructor) {
+ newobj = objdef->constructor(newobj, ap);
#if TSK_DEBUG_OBJECTS
- TSK_DEBUG_INFO("N∞ objects:%d", ++tsk_objects_count);
+ TSK_DEBUG_INFO("N∞ objects:%d", ++tsk_objects_count);
#endif
- }
- else {
- TSK_DEBUG_WARN("No constructor found.");
- }
- }
- else {
- TSK_DEBUG_ERROR("Failed to create new tsk_object.");
- }
+ }
+ else {
+ TSK_DEBUG_WARN("No constructor found.");
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new tsk_object.");
+ }
- return newobj;
+ return newobj;
}
/**@ingroup tsk_object_group
@@ -123,14 +123,14 @@ tsk_object_t* tsk_object_new_2(const tsk_object_def_t *objdef, va_list* ap)
*/
tsk_size_t tsk_object_sizeof(const tsk_object_t *self)
{
- const tsk_object_def_t **objdef = (const tsk_object_def_t **)self;
- if (objdef && *objdef) {
- return (*objdef)->size;
- }
- else {
- TSK_DEBUG_ERROR("NULL object definition.");
- return 0;
- }
+ const tsk_object_def_t **objdef = (const tsk_object_def_t **)self;
+ if (objdef && *objdef) {
+ return (*objdef)->size;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL object definition.");
+ return 0;
+ }
}
/**@ingroup tsk_object_group
@@ -143,16 +143,16 @@ tsk_size_t tsk_object_sizeof(const tsk_object_t *self)
*/
int tsk_object_cmp(const tsk_object_t *object1, const tsk_object_t *object2)
{
- const tsk_object_def_t **objdef = (const tsk_object_def_t **)object1;
+ const tsk_object_def_t **objdef = (const tsk_object_def_t **)object1;
- if (objdef && *objdef && (*objdef)->comparator) {
- return (*objdef)->comparator(object1, object2);
- }
- else {
- int ret;
- tsk_subsat_int32_ptr(object1, object2, &ret);
- return ret;
- }
+ if (objdef && *objdef && (*objdef)->comparator) {
+ return (*objdef)->comparator(object1, object2);
+ }
+ else {
+ int ret;
+ tsk_subsat_int32_ptr(object1, object2, &ret);
+ return ret;
+ }
}
/**@ingroup tsk_object_group
@@ -165,12 +165,12 @@ int tsk_object_cmp(const tsk_object_t *object1, const tsk_object_t *object2)
*/
tsk_object_t* tsk_object_ref(tsk_object_t *self)
{
- tsk_object_header_t* objhdr = TSK_OBJECT_HEADER(self);
- if (objhdr && objhdr->refCount > 0) {
- tsk_atomic_inc(&objhdr->refCount);
- return self;
- }
- return tsk_null;
+ tsk_object_header_t* objhdr = TSK_OBJECT_HEADER(self);
+ if (objhdr && objhdr->refCount > 0) {
+ tsk_atomic_inc(&objhdr->refCount);
+ return self;
+ }
+ return tsk_null;
}
/**@ingroup tsk_object_group
@@ -184,20 +184,20 @@ tsk_object_t* tsk_object_ref(tsk_object_t *self)
*/
tsk_object_t* tsk_object_unref(tsk_object_t *self)
{
- if (self) {
- tsk_object_header_t* objhdr = TSK_OBJECT_HEADER(self);
- if (objhdr->refCount > 0) { // If refCount is == 0 then, nothing should happen.
- tsk_atomic_dec(&objhdr->refCount);
- if (objhdr->refCount == 0) {
- tsk_object_delete(self);
- return tsk_null;
- }
- }
- else {
- return tsk_null;
- }
- }
- return self;
+ if (self) {
+ tsk_object_header_t* objhdr = TSK_OBJECT_HEADER(self);
+ if (objhdr->refCount > 0) { // If refCount is == 0 then, nothing should happen.
+ tsk_atomic_dec(&objhdr->refCount);
+ if (objhdr->refCount == 0) {
+ tsk_object_delete(self);
+ return tsk_null;
+ }
+ }
+ else {
+ return tsk_null;
+ }
+ }
+ return self;
}
/**@ingroup tsk_object_group
@@ -206,7 +206,7 @@ tsk_object_t* tsk_object_unref(tsk_object_t *self)
*/
tsk_size_t tsk_object_get_refcount(tsk_object_t *self)
{
- return self ? TSK_OBJECT_HEADER(self)->refCount : 0;
+ return self ? TSK_OBJECT_HEADER(self)->refCount : 0;
}
/**@ingroup tsk_object_group
@@ -218,26 +218,26 @@ tsk_size_t tsk_object_get_refcount(tsk_object_t *self)
*/
void tsk_object_delete(tsk_object_t *self)
{
- const tsk_object_def_t ** objdef = (const tsk_object_def_t **)self;
- if(self && *objdef){
- if ((*objdef)->destructor) {
- self = (*objdef)->destructor(self);
+ const tsk_object_def_t ** objdef = (const tsk_object_def_t **)self;
+ if(self && *objdef) {
+ if ((*objdef)->destructor) {
+ self = (*objdef)->destructor(self);
#if TSK_DEBUG_OBJECTS
- TSK_DEBUG_INFO("N∞ objects:%d", --tsk_objects_count);
+ TSK_DEBUG_INFO("N∞ objects:%d", --tsk_objects_count);
#endif
- }
- else {
- TSK_DEBUG_WARN("No destructor found.");
- }
- if (self) {
- free(self);
- }
- }
+ }
+ else {
+ TSK_DEBUG_WARN("No destructor found.");
+ }
+ if (self) {
+ free(self);
+ }
+ }
}
/**@page _Page_TinySAK_AnsiC_Object_Programming ANSI-C Object Programming
-*
+*
* - @ref _Anchor_TinySAK_Object_Definition "Object Definition"
* - @ref _Anchor_TinySAK_Object_Constructor "Constructor"
* - @ref _Anchor_TinySAK_Object_Destructor "Destructor"
@@ -297,14 +297,14 @@ tsk_object_def_t;
* Below, an example of how to declare an object definition:<br>
* @code
* //(Object defnition)
- static const tsk_object_def_t person_def_t =
+ static const tsk_object_def_t person_def_t =
{
sizeof(person_t),
person_ctor,
person_dtor,
person_cmp
};
-* @endcode
+* @endcode
* <h2>@anchor _Anchor_TinySAK_Object_Constructor Constructor</h2>
* The constructor is only responsible for the initialization and won’t allocate the object. When passed to the constructor, the object is already allocated.<br>
* Here is an example:<br>
@@ -318,14 +318,14 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
}
return self;
}
-* @endcode
+* @endcode
* <h2>@anchor _Anchor_TinySAK_Object_Destructor Destructor</h2>
* The destructor will free the object’s members and won’t free the object itself (Phase 1). The destructor function must return a pointer to itself to allow the caller to perform the second phase (freeing the object itself).<br>
* Here is an example:<br>
* @code
// (destructor)
static tsk_object_t * person_dtor(tsk_object_t * self)
- {
+ {
person_t *person = (person_t *)self;
if(person){
TSK_FREE(person->name);
@@ -333,7 +333,7 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
}
return self;
}
-* @endcode
+* @endcode
* <h2>@anchor _Anchor_TinySAK_Object_Comparator Comparator</h2>
* The comparator function is used to compare two <i>"well-defined"</i> objects. The objects to compare shall have the same definition (or type). <br>
* Here is an example:<br>
@@ -344,7 +344,7 @@ static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
const person_t *p1 = (const person_t *)_p1;
const person_t *p1 = (const person_t *)_p2;
int ret;
-
+
// do they have the same name?
if((ret = tsk_stricmp(p1->name, p2->name))){
return ret;
@@ -353,7 +353,7 @@ static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
if((ret = tsk_object_cmp(p1->girlfriend, p2->girlfriend))){
return ret;
}
-
+
// they are the same
return 0;
}
@@ -365,7 +365,7 @@ The comparator function is also used by the linked-list to sort <i>"well-defined
* When an object is created (see below) the counter value is initialized to 1; this is automatically done and you have nothing to do. The counter is incremented by 1 when you call @ref tsk_object_ref() and decremented (by 1) when you call @ref tsk_object_unref().<br>
* When the counter value reaches zero then, the object is garbaged (freed).<br>
* Calling @ref tsk_object_delete() will destroy an object regardless the value of the reference counter. You should never call @ref tsk_object_delete() but @ref tsk_object_unref() instead.
-*
+*
* <h2>@anchor _Anchor_TinySAK_Object_Inheritence Inheritence</h2>
* As you may expect, inheritance is not supported in ANSI-C. <br>
* As any C Structure could be casted to a pointer to its first element, inheritance could be achieved like this:<br>
@@ -385,7 +385,7 @@ student_t* s = tsk_null;
// then, cast a "student" as "person" to initialize additional fields
((person_t*)s)->name = tsk_strdup("bob");
* @endcode
-*
+*
* As <b>person_t</b> is a well-defined object, then <b>student_t</b> is also well-defined.<br>
*
* <h2>@anchor _Anchor_TinySAK_Object_Basic_Usage Basic usage</h2>
@@ -407,7 +407,7 @@ static person_t* person_create(const char* name)
}
*
* @endcode
-*
+*
* As the destructor has fixed parameters, there is a common macro to destroy all kind of well-defined objects. <br>
* @ref TSK_OBJECT_SAFE_FREE() macro is used to destroy any well-defined object. <br>
* The object will be freed only if; when decremented by 1 the reference count of the object is equal to zero. In all case (freed or not) the pointer value will be set to NULL to avoid trying to free the object again.<br>
@@ -449,7 +449,7 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
// (destructor)
static tsk_object_t * person_dtor(tsk_object_t * self)
- {
+ {
person_t *person = self;
if(person){
TSK_FREE(person->name);
@@ -464,7 +464,7 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
const person_t *p1 = (const person_t *)_p1;
const person_t *p1 = (const person_t *)_p2;
int ret;
-
+
// do they have the same name?
if((ret = tsk_stricmp(p1->name, p2->name))){
return ret;
@@ -473,7 +473,7 @@ static tsk_object_t* person_ctor(tsk_object_t * self, va_list * app)
if((ret = tsk_object_cmp(p1->girlfriend, p2->girlfriend))){
return ret;
}
-
+
// they are the same
return 0;
}
@@ -498,7 +498,7 @@ bob = tsk_object_unref(bob); // refcount = 1
bob = tsk_object_unref(bob); // refcount = 0 and destroyed
*
* @endcode
-*
+*
* <h2>@anchor _Anchor_TinySAK_Object_Public_Fuctions Public functions </h2>
* - @ref tsk_object_cmp
* - @ref tsk_object_delete
diff --git a/tinySAK/src/tsk_object.h b/tinySAK/src/tsk_object.h
index 51f892a..61789d9 100755
--- a/tinySAK/src/tsk_object.h
+++ b/tinySAK/src/tsk_object.h
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,10 +40,10 @@ typedef void tsk_object_t;
/**@ingroup tsk_object_group
* @def TSK_OBJECT_SAFE_FREE
* Safely free any well-defined object. If the reference count of the object was equal to 1 then this
- * object will be freed otherwise the refrence counter will be decremented.
+ * object will be freed otherwise the refrence counter will be decremented.
* In all case this operation will set the pointer (the object itself) to NULL.<br>
* <b>Very Important</b>: Mutexes, Semaphores and CondVars are not well-defined objects. You should never use this macro to destroy them.
- * @param self The object to free or unref.
+ * @param self The object to free or unref.
**/
#define TSK_OBJECT_SAFE_FREE(self) if((self)) tsk_object_unref((self)), (self) = tsk_null
@@ -86,8 +86,8 @@ typedef void tsk_object_t;
#define TSK_OBJECT_DEF(self) ((const tsk_object_def_t*)self)
/** Object meta-data (definition) */
-typedef struct tsk_object_header_s{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_object_header_s {
+ TSK_DECLARE_OBJECT;
}
tsk_object_header_t;
#define TSK_OBJECT_HEADER(object) ((tsk_object_header_t*)object)
@@ -110,10 +110,10 @@ tsk_object_header_t;
* }
* return self;
* }
-*
+*
* // destructor
* static void* person_destroy(tsk_object_t * self)
-* {
+* {
* person_t *person = self;
* if(person){
* TSK_FREE(person->firstName);
@@ -121,25 +121,25 @@ tsk_object_header_t;
* }
* return self;
* }
-*
+*
* // comparator
* static int person_cmp(const tsk_object_t *object1, const tsk_object_t *object1)
* {
* const person_t *person1 = object1;
* const person_t *person2 = object2;
-*
+*
* return (person1 && person2) ? (person1->id - person2->id) : -1;
* }
*
* // Meta-data (Object defnition)
-* static const tsk_object_def_t person_def_s =
+* static const tsk_object_def_t person_def_s =
* {
* sizeof(person_t),
* person_create,
* person_destroy,
-* person_cmp,
+* person_cmp,
* }person_def_t;
-*
+*
* @endcode
* Now, to create your object:
* @code
@@ -155,16 +155,15 @@ tsk_object_header_t;
* TSK_OBJECT_SAFE_FREE(person); // Will call "person_destroy" function.
* @endcode
*/
-typedef struct tsk_object_def_s
-{
- //! The size of the object.
- tsk_size_t size;
- //! Pointer to the constructor.
- tsk_object_t* (* constructor) (tsk_object_t *, va_list *);
- //! Pointer to the destructor.
- tsk_object_t* (* destructor) (tsk_object_t *);
- //! Pointer to the comparator.
- int (* comparator) (const tsk_object_t *, const tsk_object_t *);
+typedef struct tsk_object_def_s {
+ //! The size of the object.
+ tsk_size_t size;
+ //! Pointer to the constructor.
+ tsk_object_t* (* constructor) (tsk_object_t *, va_list *);
+ //! Pointer to the destructor.
+ tsk_object_t* (* destructor) (tsk_object_t *);
+ //! Pointer to the comparator.
+ int (* comparator) (const tsk_object_t *, const tsk_object_t *);
}
tsk_object_def_t;
diff --git a/tinySAK/src/tsk_options.c b/tinySAK/src/tsk_options.c
index 8ef3358..b3650c2 100755
--- a/tinySAK/src/tsk_options.c
+++ b/tinySAK/src/tsk_options.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,25 +41,25 @@
*/
static int pred_find_option_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data){
- tsk_option_t *option = (tsk_option_t*)item->data;
- return (option->id - *((int*)id));
- }
- return -1;
+ if(item && item->data) {
+ tsk_option_t *option = (tsk_option_t*)item->data;
+ return (option->id - *((int*)id));
+ }
+ return -1;
}
/**@ingroup tsk_options_group
*/
tsk_option_t* tsk_option_create(int id, const char* value)
{
- return (tsk_option_t*)tsk_object_new(TSK_OPTION_VA_ARGS(id, value));
+ return (tsk_option_t*)tsk_object_new(TSK_OPTION_VA_ARGS(id, value));
}
/**@ingroup tsk_options_group
*/
tsk_option_t* tsk_option_create_null()
{
- return tsk_option_create(0, tsk_null);
+ return tsk_option_create(0, tsk_null);
}
@@ -71,12 +71,12 @@ tsk_option_t* tsk_option_create_null()
*/
tsk_bool_t tsk_options_have_option(const tsk_options_L_t *self, int id)
{
- if(self){
- if(tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id)){
- return tsk_true;
- }
- }
- return tsk_false;
+ if(self) {
+ if(tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id)) {
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
/**@ingroup tsk_options_group
@@ -88,36 +88,36 @@ tsk_bool_t tsk_options_have_option(const tsk_options_L_t *self, int id)
*/
int tsk_options_add_option(tsk_options_L_t **self, int id, const char* value)
{
- tsk_option_t *option;
+ tsk_option_t *option;
- if(!self) {
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- if(!*self){
- *self = tsk_list_create();
- }
+ if(!*self) {
+ *self = tsk_list_create();
+ }
- if((option = (tsk_option_t*)tsk_options_get_option_by_id(*self, id))){
- tsk_strupdate(&option->value, value); /* Already exist ==> update the value. */
- }
- else{
- option = tsk_option_create(id, value);
- tsk_list_push_back_data(*self, (void**)&option);
- }
+ if((option = (tsk_option_t*)tsk_options_get_option_by_id(*self, id))) {
+ tsk_strupdate(&option->value, value); /* Already exist ==> update the value. */
+ }
+ else {
+ option = tsk_option_create(id, value);
+ tsk_list_push_back_data(*self, (void**)&option);
+ }
- return 0;
+ return 0;
}
int tsk_options_add_option_2(tsk_options_L_t **self, const tsk_option_t* option)
{
- int ret = -1;
- if(!self || !option || !option){
- return ret;
- }
+ int ret = -1;
+ if(!self || !option || !option) {
+ return ret;
+ }
- ret = tsk_options_add_option(self, option->id, option->value);
- return ret;
+ ret = tsk_options_add_option(self, option->id, option->value);
+ return ret;
}
/**@ingroup tsk_options_group
@@ -128,11 +128,11 @@ int tsk_options_add_option_2(tsk_options_L_t **self, const tsk_option_t* option)
*/
int tsk_options_remove_option(tsk_options_L_t *self, int id)
{
- if(self){
- tsk_list_remove_item_by_pred(self, pred_find_option_by_id, &id);
- return 0;
- }
- return -1;
+ if(self) {
+ tsk_list_remove_item_by_pred(self, pred_find_option_by_id, &id);
+ return 0;
+ }
+ return -1;
}
/**@ingroup tsk_options_group
@@ -143,13 +143,13 @@ int tsk_options_remove_option(tsk_options_L_t *self, int id)
*/
const tsk_option_t *tsk_options_get_option_by_id(const tsk_options_L_t *self, int id)
{
- if(self){
- const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id);
- if(item_const){
- return (const tsk_option_t*)item_const->data;
- }
- }
- return 0;
+ if(self) {
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id);
+ if(item_const) {
+ return (const tsk_option_t*)item_const->data;
+ }
+ }
+ return 0;
}
/**@ingroup tsk_options_group
@@ -160,13 +160,13 @@ const tsk_option_t *tsk_options_get_option_by_id(const tsk_options_L_t *self, in
*/
const char *tsk_options_get_option_value(const tsk_options_L_t *self, int id)
{
- if(self){
- const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id);
- if(item_const && item_const->data){
- return ((const tsk_option_t *)item_const->data)->value;
- }
- }
- return tsk_null;
+ if(self) {
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_option_by_id, &id);
+ if(item_const && item_const->data) {
+ return ((const tsk_option_t *)item_const->data)->value;
+ }
+ }
+ return tsk_null;
}
/**@ingroup tsk_options_group
@@ -177,8 +177,8 @@ const char *tsk_options_get_option_value(const tsk_options_L_t *self, int id)
*/
int tsk_options_get_option_value_as_int(const tsk_options_L_t *self, int id)
{
- const char *value = tsk_options_get_option_value(self, id);
- return value ? atoi(value) : -1;
+ const char *value = tsk_options_get_option_value(self, id);
+ return value ? atoi(value) : -1;
}
@@ -207,36 +207,35 @@ int tsk_options_get_option_value_as_int(const tsk_options_L_t *self, int id)
//
static tsk_object_t* tsk_option_ctor(tsk_object_t * self, va_list * app)
{
- tsk_option_t *option = (tsk_option_t*)self;
- if(option){
- int id = va_arg(*app, int);
- const char* value = va_arg(*app, const char *);
-
- option->id = id;
- if(!tsk_strnullORempty(value)) {
- option->value = tsk_strdup(value);
- }
- }
-
- return self;
+ tsk_option_t *option = (tsk_option_t*)self;
+ if(option) {
+ int id = va_arg(*app, int);
+ const char* value = va_arg(*app, const char *);
+
+ option->id = id;
+ if(!tsk_strnullORempty(value)) {
+ option->value = tsk_strdup(value);
+ }
+ }
+
+ return self;
}
static tsk_object_t* tsk_option_dtor(tsk_object_t * self)
-{
- tsk_option_t *option = (tsk_option_t*)self;
- if(option){
- TSK_FREE(option->value);
- }
+{
+ tsk_option_t *option = (tsk_option_t*)self;
+ if(option) {
+ TSK_FREE(option->value);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsk_option_def_s =
-{
- sizeof(tsk_option_t),
- tsk_option_ctor,
- tsk_option_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_option_def_s = {
+ sizeof(tsk_option_t),
+ tsk_option_ctor,
+ tsk_option_dtor,
+ tsk_null,
};
const tsk_object_def_t* tsk_option_def_t = &tsk_option_def_s;
diff --git a/tinySAK/src/tsk_options.h b/tinySAK/src/tsk_options.h
index 6581b60..ab5da7c 100755
--- a/tinySAK/src/tsk_options.h
+++ b/tinySAK/src/tsk_options.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSK_BEGIN_DECLS
/**@ingroup tsk_options_group
* Parameter.
*/
-typedef struct tsk_option_s
-{
- TSK_DECLARE_OBJECT;
-
- int id;
- char* value;
-
- tsk_bool_t tag;
+typedef struct tsk_option_s {
+ TSK_DECLARE_OBJECT;
+
+ int id;
+ char* value;
+
+ tsk_bool_t tag;
}
tsk_option_t;
diff --git a/tinySAK/src/tsk_params.c b/tinySAK/src/tsk_params.c
index a5756e8..e47d2ec 100755
--- a/tinySAK/src/tsk_params.c
+++ b/tinySAK/src/tsk_params.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,25 +42,25 @@
*/
static int pred_find_param_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data){
- tsk_param_t *param = (tsk_param_t*)item->data;
- return tsk_stricmp(param->name, (const char*)name);
- }
- return -1;
+ if(item && item->data) {
+ tsk_param_t *param = (tsk_param_t*)item->data;
+ return tsk_stricmp(param->name, (const char*)name);
+ }
+ return -1;
}
/**@ingroup tsk_params_group
*/
tsk_param_t* tsk_param_create(const char* name, const char* value)
{
- return (tsk_param_t*)tsk_object_new(TSK_PARAM_VA_ARGS(name, value));
+ return (tsk_param_t*)tsk_object_new(TSK_PARAM_VA_ARGS(name, value));
}
/**@ingroup tsk_params_group
*/
tsk_param_t* tsk_param_create_null()
{
- return tsk_param_create(tsk_null, tsk_null);
+ return tsk_param_create(tsk_null, tsk_null);
}
/**@ingroup tsk_params_group
@@ -71,30 +71,30 @@ tsk_param_t* tsk_param_create_null()
*/
tsk_param_t *tsk_params_parse_param(const char* line, tsk_size_t size)
{
- if(line && size){
- const char* start = line;
- const char* end = (line + size);
- const char* equal = strstr(line, "=");
- tsk_param_t *param = tsk_param_create_null();
-
- if (param && equal && equal<end) {
- if ((param->name = (char*)tsk_calloc((tsk_size_t)((equal - start) + 1), sizeof(const char)))) {
- memcpy(param->name, start, (equal - start));
- }
-
- if ((param->value = (char*)tsk_calloc((tsk_size_t)((end - equal - 1) + 1), sizeof(const char)))) {
- memcpy(param->value, equal + 1, (end - equal - 1));
- }
- }
- else if (param) {
- if ((param->name = (char*)tsk_calloc((tsk_size_t)((end - start) + 1), sizeof(const char)))) {
- memcpy(param->name, start, (end - start));
- }
- }
-
- return param;
- }
- return tsk_null;
+ if(line && size) {
+ const char* start = line;
+ const char* end = (line + size);
+ const char* equal = strstr(line, "=");
+ tsk_param_t *param = tsk_param_create_null();
+
+ if (param && equal && equal<end) {
+ if ((param->name = (char*)tsk_calloc((tsk_size_t)((equal - start) + 1), sizeof(const char)))) {
+ memcpy(param->name, start, (equal - start));
+ }
+
+ if ((param->value = (char*)tsk_calloc((tsk_size_t)((end - equal - 1) + 1), sizeof(const char)))) {
+ memcpy(param->value, equal + 1, (end - equal - 1));
+ }
+ }
+ else if (param) {
+ if ((param->name = (char*)tsk_calloc((tsk_size_t)((end - start) + 1), sizeof(const char)))) {
+ memcpy(param->name, start, (end - start));
+ }
+ }
+
+ return param;
+ }
+ return tsk_null;
}
/**@ingroup tsk_params_group
* Checks if the supplied list of parameters contains a parameter named @a name (case-insensitive).
@@ -104,15 +104,15 @@ tsk_param_t *tsk_params_parse_param(const char* line, tsk_size_t size)
*/
tsk_bool_t tsk_params_have_param(const tsk_params_L_t *self, const char* name)
{
- if(self){
- if(tsk_list_find_item_by_pred(self, pred_find_param_by_name, name)){
- return tsk_true;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return tsk_false;
+ if(self) {
+ if(tsk_list_find_item_by_pred(self, pred_find_param_by_name, name)) {
+ return tsk_true;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return tsk_false;
}
/**@ingroup tsk_params_group
@@ -124,43 +124,43 @@ tsk_bool_t tsk_params_have_param(const tsk_params_L_t *self, const char* name)
*/
int tsk_params_add_param(tsk_params_L_t **self, const char* name, const char* value)
{
- tsk_param_t *param;
-
- if(!self || !name) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!*self){
- *self = tsk_list_create();
- }
-
- if((param = (tsk_param_t*)tsk_params_get_param_by_name(*self, name))){
- tsk_strupdate(&param->value, value); /* Already exist ==> update the value. */
- }
- else{
- param = tsk_param_create(name, value);
- tsk_list_push_back_data(*self, (void**)&param);
- }
-
- return 0;
+ tsk_param_t *param;
+
+ if(!self || !name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!*self) {
+ *self = tsk_list_create();
+ }
+
+ if((param = (tsk_param_t*)tsk_params_get_param_by_name(*self, name))) {
+ tsk_strupdate(&param->value, value); /* Already exist ==> update the value. */
+ }
+ else {
+ param = tsk_param_create(name, value);
+ tsk_list_push_back_data(*self, (void**)&param);
+ }
+
+ return 0;
}
int tsk_params_add_param_2(tsk_params_L_t **self, const tsk_param_t* param)
{
- if(!self || !param || !param){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !param || !param) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tsk_params_add_param(self, param->name, param->value);
+ return tsk_params_add_param(self, param->name, param->value);
}
int tsk_params_add_param_3(tsk_params_L_t **self, const char* name, int64_t value)
{
- tsk_istr_t value_str;
- tsk_itoa(value, &value_str);
- return tsk_params_add_param(self, name, value_str);
+ tsk_istr_t value_str;
+ tsk_itoa(value, &value_str);
+ return tsk_params_add_param(self, name, value_str);
}
/**@ingroup tsk_params_group
@@ -171,14 +171,14 @@ int tsk_params_add_param_3(tsk_params_L_t **self, const char* name, int64_t valu
*/
int tsk_params_remove_param(tsk_params_L_t *self, const char* name)
{
- if(self){
- tsk_list_remove_item_by_pred(self, pred_find_param_by_name, name);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ tsk_list_remove_item_by_pred(self, pred_find_param_by_name, name);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_params_group
@@ -189,16 +189,16 @@ int tsk_params_remove_param(tsk_params_L_t *self, const char* name)
*/
const tsk_param_t *tsk_params_get_param_by_name(const tsk_params_L_t *self, const char* name)
{
- if(self){
- const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_param_by_name, name);
- if(item_const){
- return (const tsk_param_t*)item_const->data;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return tsk_null;
+ if(self) {
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_param_by_name, name);
+ if(item_const) {
+ return (const tsk_param_t*)item_const->data;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return tsk_null;
}
/**@ingroup tsk_params_group
@@ -209,16 +209,16 @@ const tsk_param_t *tsk_params_get_param_by_name(const tsk_params_L_t *self, cons
*/
const char *tsk_params_get_param_value(const tsk_params_L_t *self, const char* name)
{
- if(self && name){
- const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_param_by_name, name);
- if(item_const && item_const->data){
- return ((const tsk_param_t *)item_const->data)->value;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return tsk_null;
+ if(self && name) {
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(self, pred_find_param_by_name, name);
+ if(item_const && item_const->data) {
+ return ((const tsk_param_t *)item_const->data)->value;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return tsk_null;
}
/**@ingroup tsk_params_group
@@ -229,8 +229,8 @@ const char *tsk_params_get_param_value(const tsk_params_L_t *self, const char* n
*/
int tsk_params_get_param_value_as_int(const tsk_params_L_t *self, const char* name)
{
- const char *value = tsk_params_get_param_value(self, name);
- return value ? atoi(value) : -1;
+ const char *value = tsk_params_get_param_value(self, name);
+ return value ? atoi(value) : -1;
}
/**@ingroup tsk_params_group
@@ -241,10 +241,10 @@ int tsk_params_get_param_value_as_int(const tsk_params_L_t *self, const char* na
*/
int tsk_params_param_tostring(const tsk_param_t *param, tsk_buffer_t* output)
{
- if(param){
- return tsk_buffer_append_2(output, param->value?"%s=%s":"%s", param->name, param->value);
- }
- return -1;
+ if(param) {
+ return tsk_buffer_append_2(output, param->value?"%s=%s":"%s", param->name, param->value);
+ }
+ return -1;
}
/**@ingroup tsk_params_group
@@ -256,40 +256,40 @@ int tsk_params_param_tostring(const tsk_param_t *param, tsk_buffer_t* output)
*/
int tsk_params_tostring(const tsk_params_L_t *self, const char separator, tsk_buffer_t* output)
{
- int ret = -1;
-
- if(self){
- tsk_list_item_t *item;
- ret = 0; // for empty lists
- tsk_list_foreach(item, self){
- tsk_param_t* param = (tsk_param_t*)item->data;
- //tsk_params_param_tostring(param, output);
- if(TSK_LIST_IS_FIRST(self, item)){
- if((ret = tsk_buffer_append_2(output, param->value?"%s=%s":"%s", param->name, param->value))){
- goto bail;
- }
- }
- else{
- if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))){
- goto bail;
- }
- }
- }
- }
+ int ret = -1;
+
+ if(self) {
+ tsk_list_item_t *item;
+ ret = 0; // for empty lists
+ tsk_list_foreach(item, self) {
+ tsk_param_t* param = (tsk_param_t*)item->data;
+ //tsk_params_param_tostring(param, output);
+ if(TSK_LIST_IS_FIRST(self, item)) {
+ if((ret = tsk_buffer_append_2(output, param->value?"%s=%s":"%s", param->name, param->value))) {
+ goto bail;
+ }
+ }
+ else {
+ if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))) {
+ goto bail;
+ }
+ }
+ }
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup tsk_params_group
*/
tsk_params_L_t* tsk_params_fromstring(const char* string, const char* separator, tsk_bool_t trim)
{
- tsk_params_L_t* params = tsk_null;
- tsk_param_t* param;
+ tsk_params_L_t* params = tsk_null;
+ tsk_param_t* param;
- int i = 0, index;
- tsk_size_t size = tsk_strlen(string);
+ int i = 0, index;
+ tsk_size_t size = tsk_strlen(string);
#define PUSH_PARAM() \
if(!params){ \
@@ -305,21 +305,21 @@ tsk_params_L_t* tsk_params_fromstring(const char* string, const char* separator,
} \
tsk_list_push_back_data(params, (void**)&param);
- while((index = tsk_strindexOf((string + i), (size - i), separator)) != -1){
- if((param = tsk_params_parse_param((string + i), index))){
- PUSH_PARAM();
- }
- i += (index + 1);
- }
-
- // last one
- if(i<(int)size){
- if((param = tsk_params_parse_param((string + i), (size - i)))){
- PUSH_PARAM();
- }
- }
-
- return params;
+ while((index = tsk_strindexOf((string + i), (size - i), separator)) != -1) {
+ if((param = tsk_params_parse_param((string + i), index))) {
+ PUSH_PARAM();
+ }
+ i += (index + 1);
+ }
+
+ // last one
+ if(i<(int)size) {
+ if((param = tsk_params_parse_param((string + i), (size - i)))) {
+ PUSH_PARAM();
+ }
+ }
+
+ return params;
}
@@ -347,39 +347,38 @@ tsk_params_L_t* tsk_params_fromstring(const char* string, const char* separator,
//
static tsk_object_t* tsk_param_ctor(tsk_object_t* self, va_list * app)
{
- tsk_param_t *param = (tsk_param_t*)self;
- if(param){
- const char* name = va_arg(*app, const char *);
- const char* value = va_arg(*app, const char *);
-
- if(!tsk_strnullORempty(name)) {
- param->name = tsk_strdup(name);
- if(!tsk_strnullORempty(value)) {
- param->value = tsk_strdup(value);
- }
- }
- }
-
- return self;
+ tsk_param_t *param = (tsk_param_t*)self;
+ if(param) {
+ const char* name = va_arg(*app, const char *);
+ const char* value = va_arg(*app, const char *);
+
+ if(!tsk_strnullORempty(name)) {
+ param->name = tsk_strdup(name);
+ if(!tsk_strnullORempty(value)) {
+ param->value = tsk_strdup(value);
+ }
+ }
+ }
+
+ return self;
}
static tsk_object_t* tsk_param_dtor(tsk_object_t* self)
-{
- tsk_param_t *param = (tsk_param_t*)self;
- if(param){
- TSK_FREE(param->name);
- TSK_FREE(param->value);
- }
-
- return self;
+{
+ tsk_param_t *param = (tsk_param_t*)self;
+ if(param) {
+ TSK_FREE(param->name);
+ TSK_FREE(param->value);
+ }
+
+ return self;
}
-static const tsk_object_def_t tsk_param_def_s =
-{
- sizeof(tsk_param_t),
- tsk_param_ctor,
- tsk_param_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_param_def_s = {
+ sizeof(tsk_param_t),
+ tsk_param_ctor,
+ tsk_param_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsk_param_def_t = &tsk_param_def_s;
diff --git a/tinySAK/src/tsk_params.h b/tinySAK/src/tsk_params.h
index 2d903f8..29f04cc 100755
--- a/tinySAK/src/tsk_params.h
+++ b/tinySAK/src/tsk_params.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSK_BEGIN_DECLS
/**@ingroup tsk_params_group
* Parameter.
*/
-typedef struct tsk_param_s
-{
- TSK_DECLARE_OBJECT;
-
- char *name;/**< The name of the parameter. */
- char *value;/**< The value of the parameter. */
-
- tsk_bool_t tag;/**< tag to be used for any use case (e.g. validity of the parameter, whether to ignore the param., ...). Default value: @ref tsk_false.*/
+typedef struct tsk_param_s {
+ TSK_DECLARE_OBJECT;
+
+ char *name;/**< The name of the parameter. */
+ char *value;/**< The value of the parameter. */
+
+ tsk_bool_t tag;/**< tag to be used for any use case (e.g. validity of the parameter, whether to ignore the param., ...). Default value: @ref tsk_false.*/
}
tsk_param_t;
diff --git a/tinySAK/src/tsk_plugin.c b/tinySAK/src/tsk_plugin.c
index c8453a9..25fd8df 100755
--- a/tinySAK/src/tsk_plugin.c
+++ b/tinySAK/src/tsk_plugin.c
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,194 +48,192 @@ static const wchar_t* szFormat = L"%hs";
static int _tsk_plugin_handle_destroy(tsk_plugin_handle_t** self);
static tsk_plugin_symbol_t* _tsk_plugin_handle_get_symbol(tsk_plugin_handle_t* handle, const char* symbol_name);
-typedef struct tsk_plugin_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_plugin_s {
+ TSK_DECLARE_OBJECT;
- tsk_plugin_handle_t* handle;
- int def_count;
- char* path;
+ tsk_plugin_handle_t* handle;
+ int def_count;
+ char* path;
}
tsk_plugin_t;
static tsk_object_t* tsk_plugin_ctor(tsk_object_t * self, va_list * app)
{
- tsk_plugin_t *plugin = (tsk_plugin_t*)self;
- if(plugin){
-
- }
- return self;
+ tsk_plugin_t *plugin = (tsk_plugin_t*)self;
+ if(plugin) {
+
+ }
+ return self;
}
static tsk_object_t* tsk_plugin_dtor(tsk_object_t * self)
-{
- tsk_plugin_t *plugin = (tsk_plugin_t*)self;
- if(plugin){
- TSK_FREE(plugin->path);
- _tsk_plugin_handle_destroy(&plugin->handle);
- }
-
- return self;
-}
-static const tsk_object_def_t tsk_plugin_def_s =
{
- sizeof(tsk_plugin_t),
- tsk_plugin_ctor,
- tsk_plugin_dtor,
- tsk_null,
+ tsk_plugin_t *plugin = (tsk_plugin_t*)self;
+ if(plugin) {
+ TSK_FREE(plugin->path);
+ _tsk_plugin_handle_destroy(&plugin->handle);
+ }
+
+ return self;
+}
+static const tsk_object_def_t tsk_plugin_def_s = {
+ sizeof(tsk_plugin_t),
+ tsk_plugin_ctor,
+ tsk_plugin_dtor,
+ tsk_null,
};
tsk_plugin_t* tsk_plugin_create(const char* path)
{
- tsk_plugin_t* plugin;
- symbol_get_def_count funcptr_get_def_count;
- tsk_plugin_handle_t* handle;
+ tsk_plugin_t* plugin;
+ symbol_get_def_count funcptr_get_def_count;
+ tsk_plugin_handle_t* handle;
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
- swprintf(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
- handle = LoadPackagedLibrary(szPath, 0x00000000);
- TSK_FREE(szPath);
+ wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
+ swprintf(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
+ handle = LoadPackagedLibrary(szPath, 0x00000000);
+ TSK_FREE(szPath);
# else /* Windows desktop/CE */
#if TSK_UNDER_WINDOWS_CE
- wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
- swprintf_s(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
- handle = LoadLibrary(szPath);
- TSK_FREE(szPath);
+ wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
+ swprintf_s(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
+ handle = LoadLibrary(szPath);
+ TSK_FREE(szPath);
#else
- UINT currErrMode = SetErrorMode(SEM_FAILCRITICALERRORS); // save current ErrorMode. GetErrorMode() not supported on XP.
- SetErrorMode(currErrMode | SEM_FAILCRITICALERRORS);
- handle = LoadLibraryA(path);
- SetErrorMode(currErrMode); // restore ErrorMode
+ UINT currErrMode = SetErrorMode(SEM_FAILCRITICALERRORS); // save current ErrorMode. GetErrorMode() not supported on XP.
+ SetErrorMode(currErrMode | SEM_FAILCRITICALERRORS);
+ handle = LoadLibraryA(path);
+ SetErrorMode(currErrMode); // restore ErrorMode
#endif /* !TSK_UNDER_WINDOWS_CE */
# endif /*end-of-else-TSK_UNDER_WINDOWS_RT*/
#else
- handle = dlopen(path, RTLD_NOW);
+ handle = dlopen(path, RTLD_NOW);
#endif
- if(!handle){
- TSK_DEBUG_ERROR("Failed to load library with path=%s", path);
- return tsk_null;
- }
+ if(!handle) {
+ TSK_DEBUG_ERROR("Failed to load library with path=%s", path);
+ return tsk_null;
+ }
- if(!(funcptr_get_def_count = (symbol_get_def_count)_tsk_plugin_handle_get_symbol(handle, TSK_PLUGIN_FUNC_NAME_DEF_COUNT))){
- TSK_DEBUG_ERROR("Cannot find function with name=%s", TSK_PLUGIN_FUNC_NAME_DEF_COUNT);
- _tsk_plugin_handle_destroy(&handle);
- return tsk_null;
- }
+ if(!(funcptr_get_def_count = (symbol_get_def_count)_tsk_plugin_handle_get_symbol(handle, TSK_PLUGIN_FUNC_NAME_DEF_COUNT))) {
+ TSK_DEBUG_ERROR("Cannot find function with name=%s", TSK_PLUGIN_FUNC_NAME_DEF_COUNT);
+ _tsk_plugin_handle_destroy(&handle);
+ return tsk_null;
+ }
- if(!(plugin = (tsk_plugin_t*)tsk_object_new(&tsk_plugin_def_s))){
- TSK_DEBUG_ERROR("Failed to create plugin object");
- _tsk_plugin_handle_destroy(&handle);
- return tsk_null;
- }
+ if(!(plugin = (tsk_plugin_t*)tsk_object_new(&tsk_plugin_def_s))) {
+ TSK_DEBUG_ERROR("Failed to create plugin object");
+ _tsk_plugin_handle_destroy(&handle);
+ return tsk_null;
+ }
- plugin->handle = handle;
- plugin->def_count = funcptr_get_def_count();
- plugin->path = tsk_strdup(path);
+ plugin->handle = handle;
+ plugin->def_count = funcptr_get_def_count();
+ plugin->path = tsk_strdup(path);
- TSK_DEBUG_INFO("Plugin with path=[%s] created with [%d] defs", plugin->path, plugin->def_count);
+ TSK_DEBUG_INFO("Plugin with path=[%s] created with [%d] defs", plugin->path, plugin->def_count);
- return plugin;
+ return plugin;
}
tsk_plugin_def_ptr_const_t tsk_plugin_get_def_2(struct tsk_plugin_s* self, tsk_plugin_def_type_t type, tsk_plugin_def_media_type_t media_type, tsk_size_t index)
{
- tsk_plugin_def_ptr_const_t def_ptr_const;
- symbol_get_def_type_at funcptr_get_def_type_at;
- symbol_get_def_media_type_at funcptr_get_def_media_type_at;
- symbol_get_def_at funcptr_get_def_at;
- int i;
- tsk_size_t _index = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!(funcptr_get_def_type_at = (symbol_get_def_type_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_TYPE_AT))){
- TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_TYPE_AT, self->path);
- return tsk_null;
- }
- if(!(funcptr_get_def_media_type_at = (symbol_get_def_media_type_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_MEDIA_TYPE_AT))){
- TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_MEDIA_TYPE_AT, self->path);
- return tsk_null;
- }
- if(!(funcptr_get_def_at = (symbol_get_def_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_AT))){
- TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_AT, self->path);
- return tsk_null;
- }
-
- for(i = 0; i < self->def_count; ++i){
- if((funcptr_get_def_type_at(i) & type) && (funcptr_get_def_media_type_at(i) & media_type)){
- if((def_ptr_const = funcptr_get_def_at(i))){
- if(_index++ == index){
- return def_ptr_const;
- }
- }
- }
- }
- return tsk_null;
+ tsk_plugin_def_ptr_const_t def_ptr_const;
+ symbol_get_def_type_at funcptr_get_def_type_at;
+ symbol_get_def_media_type_at funcptr_get_def_media_type_at;
+ symbol_get_def_at funcptr_get_def_at;
+ int i;
+ tsk_size_t _index = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!(funcptr_get_def_type_at = (symbol_get_def_type_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_TYPE_AT))) {
+ TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_TYPE_AT, self->path);
+ return tsk_null;
+ }
+ if(!(funcptr_get_def_media_type_at = (symbol_get_def_media_type_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_MEDIA_TYPE_AT))) {
+ TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_MEDIA_TYPE_AT, self->path);
+ return tsk_null;
+ }
+ if(!(funcptr_get_def_at = (symbol_get_def_at)tsk_plugin_get_symbol(self, TSK_PLUGIN_FUNC_NAME_DEF_AT))) {
+ TSK_DEBUG_ERROR("[%s] function not implemented in plugin with path=[%s]", TSK_PLUGIN_FUNC_NAME_DEF_AT, self->path);
+ return tsk_null;
+ }
+
+ for(i = 0; i < self->def_count; ++i) {
+ if((funcptr_get_def_type_at(i) & type) && (funcptr_get_def_media_type_at(i) & media_type)) {
+ if((def_ptr_const = funcptr_get_def_at(i))) {
+ if(_index++ == index) {
+ return def_ptr_const;
+ }
+ }
+ }
+ }
+ return tsk_null;
}
tsk_plugin_def_ptr_const_t tsk_plugin_get_def(tsk_plugin_t* self, tsk_plugin_def_type_t type, tsk_plugin_def_media_type_t media_type)
{
- return tsk_plugin_get_def_2(self, type, media_type, 0);
+ return tsk_plugin_get_def_2(self, type, media_type, 0);
}
tsk_plugin_symbol_t* tsk_plugin_get_symbol(tsk_plugin_t* self, const char* symbol_name)
{
- if(!self || !self->handle || !symbol_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- return _tsk_plugin_handle_get_symbol(self->handle, symbol_name);
+ if(!self || !self->handle || !symbol_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ return _tsk_plugin_handle_get_symbol(self->handle, symbol_name);
}
tsk_bool_t tsk_plugin_file_exist(const char* path)
{
- if (path) {
+ if (path) {
#if TSK_UNDER_WINDOWS_CE
- wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
- DWORD dwAttrib;
- swprintf_s(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
- dwAttrib = GetFileAttributes(szPath);
- TSK_FREE(szPath);
- return ((dwAttrib != INVALID_FILE_ATTRIBUTES) && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY) == 0);
+ wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
+ DWORD dwAttrib;
+ swprintf_s(szPath, tsk_strlen(path) * sizeof(wchar_t), szFormat, path);
+ dwAttrib = GetFileAttributes(szPath);
+ TSK_FREE(szPath);
+ return ((dwAttrib != INVALID_FILE_ATTRIBUTES) && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY) == 0);
#else
- struct stat _stat;
- return (stat(path, &_stat) == 0 && _stat.st_size > 0);
+ struct stat _stat;
+ return (stat(path, &_stat) == 0 && _stat.st_size > 0);
#endif /* TSK_UNDER_WINDOWS_CE */
- }
- return tsk_false;
+ }
+ return tsk_false;
}
static tsk_plugin_symbol_t* _tsk_plugin_handle_get_symbol(tsk_plugin_handle_t* handle, const char* symbol_name)
{
- if(!handle || !symbol_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(!handle || !symbol_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_CE
- return (tsk_plugin_symbol_t*)GetProcAddressA((HMODULE)handle, symbol_name);
+ return (tsk_plugin_symbol_t*)GetProcAddressA((HMODULE)handle, symbol_name);
# else
- return (tsk_plugin_symbol_t*)GetProcAddress((HMODULE)handle, symbol_name);
+ return (tsk_plugin_symbol_t*)GetProcAddress((HMODULE)handle, symbol_name);
# endif
#else
- return (tsk_plugin_symbol_t*)dlsym(handle, symbol_name);
+ return (tsk_plugin_symbol_t*)dlsym(handle, symbol_name);
#endif
}
static int _tsk_plugin_handle_destroy(tsk_plugin_handle_t** handle)
{
- if(handle && *handle){
+ if(handle && *handle) {
#if TSK_UNDER_WINDOWS
- FreeLibrary((HMODULE)*handle);
+ FreeLibrary((HMODULE)*handle);
#else
- dlclose(*handle);
+ dlclose(*handle);
#endif
- *handle = tsk_null;
- }
- return 0;
+ *handle = tsk_null;
+ }
+ return 0;
}
diff --git a/tinySAK/src/tsk_plugin.h b/tinySAK/src/tsk_plugin.h
index 82fcfd6..85f0a00 100755
--- a/tinySAK/src/tsk_plugin.h
+++ b/tinySAK/src/tsk_plugin.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,29 +25,27 @@
TSK_BEGIN_DECLS
-typedef enum tsk_plugin_def_type_e
-{
- tsk_plugin_def_type_none = 0,
- tsk_plugin_def_type_consumer = (1 << 0),
- tsk_plugin_def_type_producer = (1 << 1),
- tsk_plugin_def_type_session = (1 << 2),
- tsk_plugin_def_type_codec = (1 << 3),
- tsk_plugin_def_type_resampler = (1 << 4),
- tsk_plugin_def_type_jb = (1 << 5),
- tsk_plugin_def_type_denoiser = (1 << 6),
- tsk_plugin_def_type_converter = (1 << 7),
- tsk_plugin_def_type_ipsec = (1 << 8),
- tsk_plugin_def_type_all = (~0)
+typedef enum tsk_plugin_def_type_e {
+ tsk_plugin_def_type_none = 0,
+ tsk_plugin_def_type_consumer = (1 << 0),
+ tsk_plugin_def_type_producer = (1 << 1),
+ tsk_plugin_def_type_session = (1 << 2),
+ tsk_plugin_def_type_codec = (1 << 3),
+ tsk_plugin_def_type_resampler = (1 << 4),
+ tsk_plugin_def_type_jb = (1 << 5),
+ tsk_plugin_def_type_denoiser = (1 << 6),
+ tsk_plugin_def_type_converter = (1 << 7),
+ tsk_plugin_def_type_ipsec = (1 << 8),
+ tsk_plugin_def_type_all = (~0)
}
tsk_plugin_def_type_t;
-typedef enum tsk_plugin_def_media_type_e
-{
- tsk_plugin_def_media_type_none = 0,
- tsk_plugin_def_media_type_audio = (1 << 0),
- tsk_plugin_def_media_type_video = (1 << 1),
- tsk_plugin_def_media_type_screencast = (1 << 2),
- tsk_plugin_def_media_type_all = (~0)
+typedef enum tsk_plugin_def_media_type_e {
+ tsk_plugin_def_media_type_none = 0,
+ tsk_plugin_def_media_type_audio = (1 << 0),
+ tsk_plugin_def_media_type_video = (1 << 1),
+ tsk_plugin_def_media_type_screencast = (1 << 2),
+ tsk_plugin_def_media_type_all = (~0)
}
tsk_plugin_def_media_type_t;
diff --git a/tinySAK/src/tsk_ppfcs16.c b/tinySAK/src/tsk_ppfcs16.c
index cc82574..bff369e 100755
--- a/tinySAK/src/tsk_ppfcs16.c
+++ b/tinySAK/src/tsk_ppfcs16.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,40 +33,39 @@
/**@defgroup tsk_ppfcs16_group PPP in HDLC-like Framing (RFC 1662).
*/
-static uint16_t fcstab[256] =
-{
- 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
- 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
- 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
- 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
- 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
- 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
- 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
- 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
- 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
- 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
- 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
- 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
- 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
- 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
- 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
- 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
- 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
- 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
- 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
- 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
- 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
- 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
- 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
- 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
- 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
- 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
- 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
- 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
- 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
- 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
- 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
- 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
+static uint16_t fcstab[256] = {
+ 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
+ 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
+ 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
+ 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
+ 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
+ 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
+ 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
+ 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
+ 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
+ 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
+ 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
+ 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
+ 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
+ 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
+ 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
+ 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
+ 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
+ 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
+ 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
+ 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
+ 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
+ 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
+ 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
+ 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
+ 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
+ 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
+ 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
+ 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
+ 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
+ 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
+ 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
+ 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
};
/**@ingroup tsk_ppfcs16_group
@@ -74,9 +73,9 @@ static uint16_t fcstab[256] =
*/
uint16_t tsk_pppfcs16(register uint16_t fcs, register const uint8_t* cp, register int32_t len)
{
- while (len--){
- fcs = (fcs >> 8) ^ fcstab[(fcs ^ *cp++) & 0xff];
- }
- return (fcs);
+ while (len--) {
+ fcs = (fcs >> 8) ^ fcstab[(fcs ^ *cp++) & 0xff];
+ }
+ return (fcs);
}
diff --git a/tinySAK/src/tsk_ppfcs16.h b/tinySAK/src/tsk_ppfcs16.h
index af340d1..5b52fd2 100755
--- a/tinySAK/src/tsk_ppfcs16.h
+++ b/tinySAK/src/tsk_ppfcs16.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_ppfcs32.c b/tinySAK/src/tsk_ppfcs32.c
index 1bb0eac..79e86c9 100755
--- a/tinySAK/src/tsk_ppfcs32.c
+++ b/tinySAK/src/tsk_ppfcs32.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,72 +33,71 @@
/**@defgroup tsk_ppfcs32_group PPP in HDLC-like Framing (RFC 1662).
*/
-static uint32_t fcstab_32[256] =
-{
- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
- 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
- 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
- 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
- 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
- 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
- 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
- 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
- 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
- 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
- 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
- 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
- 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
- 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
- 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
- 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
- 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
- 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
- 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
- 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
- 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
- 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
- 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
- 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
- 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
- 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
- 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
- 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
- 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
- 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
- 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
- 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
- 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
- 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
- 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
- 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
- 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
- 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
- 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
- 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
- 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
- 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
- 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
- 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
- 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
- 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
- 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
- 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
- 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
- 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
- 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
- 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
- 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
- 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
- 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
- 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
- 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
- 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
- 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
- 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
- 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
- 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+static uint32_t fcstab_32[256] = {
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
+ 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
+ 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
+ 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
+ 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
+ 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
+ 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
+ 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
+ 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
+ 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
+ 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
+ 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
+ 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
+ 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
+ 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
+ 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
+ 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
+ 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
/**@ingroup tsk_ppfcs32_group
@@ -106,11 +105,11 @@ static uint32_t fcstab_32[256] =
*/
uint32_t tsk_pppfcs32(register uint32_t fcs, register const uint8_t* cp, register int32_t len)
{
- int32_t n;
- for(n = 0; n < len; ++n){
- fcs = (fcs >> 8) ^ (fcstab_32[(fcs & 0xff) ^ cp[n]]);
- }
+ int32_t n;
+ for(n = 0; n < len; ++n) {
+ fcs = (fcs >> 8) ^ (fcstab_32[(fcs & 0xff) ^ cp[n]]);
+ }
- return (fcs ^0xffffffff);
+ return (fcs ^0xffffffff);
}
diff --git a/tinySAK/src/tsk_ppfcs32.h b/tinySAK/src/tsk_ppfcs32.h
index f9cff1f..9281110 100755
--- a/tinySAK/src/tsk_ppfcs32.h
+++ b/tinySAK/src/tsk_ppfcs32.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_ragel_state.c b/tinySAK/src/tsk_ragel_state.c
index 840d784..3ec3908 100755
--- a/tinySAK/src/tsk_ragel_state.c
+++ b/tinySAK/src/tsk_ragel_state.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,8 +40,8 @@
*/
void tsk_ragel_state_init(tsk_ragel_state_t *state, const char *data, tsk_size_t size)
{
- state->cs = 0;
- state->tag_start = state->p = data;
- state->eoh = state->eof = state->tag_end = state->pe = state->p + size;
+ state->cs = 0;
+ state->tag_start = state->p = data;
+ state->eoh = state->eof = state->tag_end = state->pe = state->p + size;
}
diff --git a/tinySAK/src/tsk_ragel_state.h b/tinySAK/src/tsk_ragel_state.h
index fb0df85..d80aa99 100755
--- a/tinySAK/src/tsk_ragel_state.h
+++ b/tinySAK/src/tsk_ragel_state.h
@@ -165,16 +165,15 @@ TSK_BEGIN_DECLS
/**@ingroup tsk_ragel_state_group
* Ragel state.
*/
-typedef struct tsk_ragel_state_s
-{
- int cs; /**< Ragel current state. */
- const char *p; /**< Data pointing to the buffer to parse. */
- const char *pe; /**< Data end pointer. */
- const char *eof; /**< End of the file (in our case data) pointer. */
- const char *eoh; /**< End of the headers. */
-
- const char* tag_start; /**< Last tag start position set by ragel machine. */
- const char* tag_end; /**< The end of the ragel tag. */
+typedef struct tsk_ragel_state_s {
+ int cs; /**< Ragel current state. */
+ const char *p; /**< Data pointing to the buffer to parse. */
+ const char *pe; /**< Data end pointer. */
+ const char *eof; /**< End of the file (in our case data) pointer. */
+ const char *eoh; /**< End of the headers. */
+
+ const char* tag_start; /**< Last tag start position set by ragel machine. */
+ const char* tag_end; /**< The end of the ragel tag. */
}
tsk_ragel_state_t;
diff --git a/tinySAK/src/tsk_runnable.c b/tinySAK/src/tsk_runnable.c
index 2b0e3fe..0e80776 100755
--- a/tinySAK/src/tsk_runnable.c
+++ b/tinySAK/src/tsk_runnable.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,22 +46,22 @@ static void* TSK_STDCALL __async_join(void* self);
*/
tsk_runnable_t* tsk_runnable_create()
{
- return tsk_runnable_create_2(TSK_THREAD_PRIORITY_MEDIUM);
+ return tsk_runnable_create_2(TSK_THREAD_PRIORITY_MEDIUM);
}
/**@ingroup tsk_runnable_group
* Creates new Runnable object.
-* @param priority Thread priority. Possible values: TSK_THREAD_PRIORITY_LOW, TSK_THREAD_PRIORITY_MEDIUM, TSK_THREAD_PRIORITY_HIGH or TSK_THREAD_PRIORITY_TIME_CRITICAL
+* @param priority Thread priority. Possible values: TSK_THREAD_PRIORITY_LOW, TSK_THREAD_PRIORITY_MEDIUM, TSK_THREAD_PRIORITY_HIGH or TSK_THREAD_PRIORITY_TIME_CRITICAL
* @retval @ref tsk_runnable_t.
*/
tsk_runnable_t* tsk_runnable_create_2(int32_t priority)
{
- tsk_runnable_t* runnable;
- if((runnable = (tsk_runnable_t*)tsk_object_new(tsk_runnable_def_t))){
- runnable->priority = priority;
- }
- return runnable;
+ tsk_runnable_t* runnable;
+ if((runnable = (tsk_runnable_t*)tsk_object_new(tsk_runnable_def_t))) {
+ runnable->priority = priority;
+ }
+ return runnable;
}
/**@ingroup tsk_runnable_group
@@ -73,21 +73,21 @@ tsk_runnable_t* tsk_runnable_create_2(int32_t priority)
*/
static int tsk_runnable_init(tsk_runnable_t *self, const tsk_object_def_t *objdef)
{
- if(self && objdef){
- if(self->initialized){
- TSK_DEBUG_ERROR("Already initialized");
- return -2;
- }
-
- self->semaphore = tsk_semaphore_create();
- self->objdef = objdef;
- self->objects = tsk_list_create();
+ if(self && objdef) {
+ if(self->initialized) {
+ TSK_DEBUG_ERROR("Already initialized");
+ return -2;
+ }
+
+ self->semaphore = tsk_semaphore_create();
+ self->objdef = objdef;
+ self->objects = tsk_list_create();
- self->initialized = tsk_true;
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
+ self->initialized = tsk_true;
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
}
/**@ingroup tsk_runnable_group
@@ -98,24 +98,24 @@ static int tsk_runnable_init(tsk_runnable_t *self, const tsk_object_def_t *objde
*/
static int tsk_runnable_deinit(tsk_runnable_t *self)
{
- if(self){
- if(!self->initialized){
- return 0; /* Already deinitialized */
- }
- else if(self->running){
- TSK_DEBUG_ERROR("Cannot deinit a runnable object while running.");
- return -3;
- }
+ if(self) {
+ if(!self->initialized) {
+ return 0; /* Already deinitialized */
+ }
+ else if(self->running) {
+ TSK_DEBUG_ERROR("Cannot deinit a runnable object while running.");
+ return -3;
+ }
- tsk_semaphore_destroy(&self->semaphore);
- TSK_OBJECT_SAFE_FREE(self->objects);
+ tsk_semaphore_destroy(&self->semaphore);
+ TSK_OBJECT_SAFE_FREE(self->objects);
- self->initialized = tsk_false;
+ self->initialized = tsk_false;
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
/**@ingroup tsk_runnable_group
@@ -127,66 +127,72 @@ static int tsk_runnable_deinit(tsk_runnable_t *self)
*/
int tsk_runnable_start(tsk_runnable_t *self, const tsk_object_def_t *objdef)
{
- if(self){
- int ret = -1;
- if(self->running) return -2;
- else if(!self->run) return -3;
- else if(tsk_runnable_init(self, objdef)) return -4;
+ if(self) {
+ int ret = -1;
+ if(self->running) {
+ return -2;
+ }
+ else if(!self->run) {
+ return -3;
+ }
+ else if(tsk_runnable_init(self, objdef)) {
+ return -4;
+ }
- /* call run() function in new thread. */
- if((ret = tsk_thread_create(&(self->h_thread[0]), self->run, self))){
- TSK_DEBUG_ERROR("Failed to start new thread.");
- return ret;
- }
- /* set priority now that the thread is created */
- if(tsk_runnable_set_priority(self, self->priority)){
- TSK_DEBUG_ERROR("Failed to set thread priority value to %d", self->priority);
- }
- // Do not set "running" to true here
- // Problem: When you try to stop the thread before it start
- // Will be done by "TSK_RUNNABLE_RUN_BEGIN" which is called into the thread
- //self->running = tsk_true;
+ /* call run() function in new thread. */
+ if((ret = tsk_thread_create(&(self->h_thread[0]), self->run, self))) {
+ TSK_DEBUG_ERROR("Failed to start new thread.");
+ return ret;
+ }
+ /* set priority now that the thread is created */
+ if(tsk_runnable_set_priority(self, self->priority)) {
+ TSK_DEBUG_ERROR("Failed to set thread priority value to %d", self->priority);
+ }
+ // Do not set "running" to true here
+ // Problem: When you try to stop the thread before it start
+ // Will be done by "TSK_RUNNABLE_RUN_BEGIN" which is called into the thread
+ //self->running = tsk_true;
- self->started = tsk_true;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ self->started = tsk_true;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_runnable_group
* To indicate whether the enqueued data is important or not.
* @param self The runnable object
-* @param important @a tsk_true or @a tsk_false. If set to @a tsk_true, the thread will not be joined
+* @param important @a tsk_true or @a tsk_false. If set to @a tsk_true, the thread will not be joined
* until all data in the queue have been consumed.
*/
int tsk_runnable_set_important(tsk_runnable_t *self, tsk_bool_t important)
{
- if(self){
- self->important = important;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ self->important = important;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsk_runnable_group
*/
int tsk_runnable_set_priority(tsk_runnable_t *self, int32_t priority)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->priority = priority;
- if(self->h_thread[0]){
- return tsk_thread_set_priority(self->h_thread[0], priority);
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->priority = priority;
+ if(self->h_thread[0]) {
+ return tsk_thread_set_priority(self->h_thread[0], priority);
+ }
+ return 0;
}
/**@ingroup tsk_runnable_group
@@ -197,78 +203,78 @@ int tsk_runnable_set_priority(tsk_runnable_t *self, int32_t priority)
*/
int tsk_runnable_stop(tsk_runnable_t *self)
{
- int ret = -1;
- if (self) {
- tsk_thread_id_t id_curr_thread;
- if (!self->initialized) {
- if (!self->running) {
- /* already deinitialized */
- return 0;
- }
- else {
- /* should never happen */
- TSK_DEBUG_ERROR("Not initialized.");
- return -2;
- }
- }
- else if (!self->running) {
+ int ret = -1;
+ if (self) {
+ tsk_thread_id_t id_curr_thread;
+ if (!self->initialized) {
+ if (!self->running) {
+ /* already deinitialized */
+ return 0;
+ }
+ else {
+ /* should never happen */
+ TSK_DEBUG_ERROR("Not initialized.");
+ return -2;
+ }
+ }
+ else if (!self->running) {
- if (self->started) {
- tsk_size_t count = 0;
- /* Thread is started but not running ==> Give it time.*/
- while (++count <= 5) {
- tsk_thread_sleep(count * 200);
- if (self->running) {
- goto stop;
- }
- }
- }
- else{
- return 0; /* already stopped */
- }
- return -3;
- }
+ if (self->started) {
+ tsk_size_t count = 0;
+ /* Thread is started but not running ==> Give it time.*/
+ while (++count <= 5) {
+ tsk_thread_sleep(count * 200);
+ if (self->running) {
+ goto stop;
+ }
+ }
+ }
+ else {
+ return 0; /* already stopped */
+ }
+ return -3;
+ }
stop:
- self->running = tsk_false;
- tsk_semaphore_increment(self->semaphore);
- // To avoid deadlock we don't join() the thread if this funcion is called from the "run()" function
- // setting "self::running" to false is enough to exit the thread after the call to "TSK_RUNNABLE_RUN_BEGIN(self)"
- id_curr_thread = tsk_thread_get_id();
- if (tsk_thread_id_equals(&self->id_thread, &id_curr_thread)) {
- tsk_runnable_t* copy = tsk_object_ref(TSK_OBJECT(self)); // "copy" will be null if this function is called in the "dtor()" because "refCount" is already equal to "zero".
- TSK_DEBUG_INFO("tsk_thread_join(%s) called inside the thread(%lu) itself...delaying", copy ? "NOT null" : "null", (unsigned long)id_curr_thread);
- if (!copy || self->h_thread[1]) {
- if (self->h_thread[1]) { // must never happen
- TSK_DEBUG_ERROR("Join already delayed");
- }
- ret = tsk_thread_destroy(&(self->h_thread[0]));
- tsk_object_unref(TSK_OBJECT(copy));
- }
- else {
- ret = tsk_thread_create(&(self->h_thread[1]), __async_join, copy);
- }
- }
- else if ((ret = tsk_thread_join(&(self->h_thread[0])))) {
- self->running = tsk_true;
- TSK_DEBUG_ERROR("Failed to join the thread.");
- return ret;
- }
- tsk_runnable_deinit(self);
+ self->running = tsk_false;
+ tsk_semaphore_increment(self->semaphore);
+ // To avoid deadlock we don't join() the thread if this funcion is called from the "run()" function
+ // setting "self::running" to false is enough to exit the thread after the call to "TSK_RUNNABLE_RUN_BEGIN(self)"
+ id_curr_thread = tsk_thread_get_id();
+ if (tsk_thread_id_equals(&self->id_thread, &id_curr_thread)) {
+ tsk_runnable_t* copy = tsk_object_ref(TSK_OBJECT(self)); // "copy" will be null if this function is called in the "dtor()" because "refCount" is already equal to "zero".
+ TSK_DEBUG_INFO("tsk_thread_join(%s) called inside the thread(%lu) itself...delaying", copy ? "NOT null" : "null", (unsigned long)id_curr_thread);
+ if (!copy || self->h_thread[1]) {
+ if (self->h_thread[1]) { // must never happen
+ TSK_DEBUG_ERROR("Join already delayed");
+ }
+ ret = tsk_thread_destroy(&(self->h_thread[0]));
+ tsk_object_unref(TSK_OBJECT(copy));
+ }
+ else {
+ ret = tsk_thread_create(&(self->h_thread[1]), __async_join, copy);
+ }
+ }
+ else if ((ret = tsk_thread_join(&(self->h_thread[0])))) {
+ self->running = tsk_true;
+ TSK_DEBUG_ERROR("Failed to join the thread.");
+ return ret;
+ }
+ tsk_runnable_deinit(self);
- self->started = tsk_false;
- }
- return ret;
+ self->started = tsk_false;
+ }
+ return ret;
}
static void* TSK_STDCALL __async_join(void* arg)
{
- tsk_runnable_t *self = (tsk_runnable_t *)arg;
- if (self) {
- tsk_thread_join(&self->h_thread[0]);
- return tsk_object_unref(TSK_OBJECT(self));
- }
- return self;
+ tsk_runnable_t *self = (tsk_runnable_t *)arg;
+ if (self) {
+ tsk_thread_join(&self->h_thread[0]);
+ return tsk_object_unref(TSK_OBJECT(self));
+ }
+ return self;
}
//=================================================================================================
@@ -276,33 +282,32 @@ static void* TSK_STDCALL __async_join(void* arg)
//
static tsk_object_t* tsk_runnable_ctor(tsk_object_t * self, va_list * app)
{
- tsk_runnable_t* runnable = (tsk_runnable_t*)self;
- if (runnable) {
-
- }
- return self;
+ tsk_runnable_t* runnable = (tsk_runnable_t*)self;
+ if (runnable) {
+
+ }
+ return self;
}
static tsk_object_t* tsk_runnable_dtor(tsk_object_t * self)
-{
- tsk_runnable_t* runnable = (tsk_runnable_t*)self;
- if (runnable) {
- /* stops runnable object (if running or started) */
- tsk_runnable_stop(runnable); // join(runnable->h_thread[0])
- if (runnable->h_thread[1]) {
- tsk_thread_destroy(&(runnable->h_thread[1])); // must not be join()
- }
- TSK_DEBUG_INFO("*** tsk_runnable_t destroyed ***");
- }
- return self;
+{
+ tsk_runnable_t* runnable = (tsk_runnable_t*)self;
+ if (runnable) {
+ /* stops runnable object (if running or started) */
+ tsk_runnable_stop(runnable); // join(runnable->h_thread[0])
+ if (runnable->h_thread[1]) {
+ tsk_thread_destroy(&(runnable->h_thread[1])); // must not be join()
+ }
+ TSK_DEBUG_INFO("*** tsk_runnable_t destroyed ***");
+ }
+ return self;
}
-static const tsk_object_def_t tsk_runnable_def_s =
-{
- sizeof(tsk_runnable_t),
- tsk_runnable_ctor,
- tsk_runnable_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_runnable_def_s = {
+ sizeof(tsk_runnable_t),
+ tsk_runnable_ctor,
+ tsk_runnable_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsk_runnable_def_t = &tsk_runnable_def_s;
diff --git a/tinySAK/src/tsk_runnable.h b/tinySAK/src/tsk_runnable.h
index 8aa4ed1..b8a6020 100755
--- a/tinySAK/src/tsk_runnable.h
+++ b/tinySAK/src/tsk_runnable.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,29 +50,28 @@ typedef void* (TSK_STDCALL *tsk_runnable_func_run)(void* self);
/**@ingroup tsk_runnable_group
* Runnable.
*/
-typedef struct tsk_runnable_s
-{
- TSK_DECLARE_OBJECT;
-
- const tsk_object_def_t *objdef;
-
- tsk_thread_handle_t* h_thread[2/*0=default,1=delayed*/];
- tsk_runnable_func_run run;
- tsk_thread_id_t id_thread; // no way to get this value from "h_thread" on WINXP
- tsk_semaphore_handle_t *semaphore;
-
- tsk_bool_t running;
- tsk_bool_t started;
- tsk_bool_t initialized;
- /** whether the enqueued data are important or not.
- * if yes, the thread will not be joined until all data in the queue have been consumed.
- * default value: tsk_false
- */
- tsk_bool_t important;
-
- int32_t priority;
-
- tsk_list_t *objects;
+typedef struct tsk_runnable_s {
+ TSK_DECLARE_OBJECT;
+
+ const tsk_object_def_t *objdef;
+
+ tsk_thread_handle_t* h_thread[2/*0=default,1=delayed*/];
+ tsk_runnable_func_run run;
+ tsk_thread_id_t id_thread; // no way to get this value from "h_thread" on WINXP
+ tsk_semaphore_handle_t *semaphore;
+
+ tsk_bool_t running;
+ tsk_bool_t started;
+ tsk_bool_t initialized;
+ /** whether the enqueued data are important or not.
+ * if yes, the thread will not be joined until all data in the queue have been consumed.
+ * default value: tsk_false
+ */
+ tsk_bool_t important;
+
+ int32_t priority;
+
+ tsk_list_t *objects;
}
tsk_runnable_t;
@@ -106,7 +105,7 @@ TINYSAK_GEXTERN const tsk_object_def_t *tsk_runnable_def_t;
if(!TSK_RUNNABLE(self)->running && \
(!TSK_RUNNABLE(self)->important || (TSK_RUNNABLE(self)->important && TSK_LIST_IS_EMPTY(TSK_RUNNABLE(self)->objects)))) \
break;
-
+
#define TSK_RUNNABLE_RUN_END(self) \
} \
@@ -160,12 +159,13 @@ TINYSAK_GEXTERN const tsk_object_def_t *tsk_runnable_def_t;
*/
#define TSK_RUNNABLE_POP_FIRST(self) \
tsk_list_pop_first_item(TSK_RUNNABLE(self)->objects)
-static tsk_list_item_t* TSK_RUNNABLE_POP_FIRST_SAFE(tsk_runnable_t* self){
- tsk_list_item_t* item;
- tsk_list_lock(self->objects);
- item= tsk_list_pop_first_item(self->objects);
- tsk_list_unlock(self->objects);
- return item;
+static tsk_list_item_t* TSK_RUNNABLE_POP_FIRST_SAFE(tsk_runnable_t* self)
+{
+ tsk_list_item_t* item;
+ tsk_list_lock(self->objects);
+ item= tsk_list_pop_first_item(self->objects);
+ tsk_list_unlock(self->objects);
+ return item;
}
TSK_END_DECLS
diff --git a/tinySAK/src/tsk_safeobj.c b/tinySAK/src/tsk_safeobj.c
index fb5f836..85c01de 100755
--- a/tinySAK/src/tsk_safeobj.c
+++ b/tinySAK/src/tsk_safeobj.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_safeobj.h b/tinySAK/src/tsk_safeobj.h
index 6d826b7..5cdf062 100755
--- a/tinySAK/src/tsk_safeobj.h
+++ b/tinySAK/src/tsk_safeobj.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_semaphore.c b/tinySAK/src/tsk_semaphore.c
index ba9149a..1ba85ef 100755
--- a/tinySAK/src/tsk_semaphore.c
+++ b/tinySAK/src/tsk_semaphore.c
@@ -62,8 +62,7 @@ typedef HANDLE SEMAPHORE_T;
# include <fcntl.h> /* O_CREAT */
# include <sys/stat.h> /* S_IRUSR, S_IWUSR*/
-typedef struct named_sem_s
-{
+typedef struct named_sem_s {
sem_t* sem;
char name [NAME_MAX + 1];
} named_sem_t;
@@ -100,7 +99,7 @@ tsk_semaphore_handle_t* tsk_semaphore_create()
tsk_semaphore_handle_t* tsk_semaphore_create_2(int initial_val)
{
SEMAPHORE_T handle = tsk_null;
-
+
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
handle = CreateSemaphoreEx(NULL, initial_val, 0x7FFFFFFF, NULL, 0x00000000, SEMAPHORE_ALL_ACCESS);
@@ -109,101 +108,102 @@ tsk_semaphore_handle_t* tsk_semaphore_create_2(int initial_val)
# endif
#else
handle = tsk_calloc(1, sizeof(SEMAPHORE_S));
-
+
#if TSK_USE_NAMED_SEM
named_sem_t * nsem = (named_sem_t*)handle;
snprintf(nsem->name, (sizeof(nsem->name)/sizeof(nsem->name[0])) - 1, "/sem/%llu/%d.", tsk_time_epoch(), rand() ^ rand());
if ((nsem->sem = sem_open(nsem->name, O_CREAT /*| O_EXCL*/, S_IRUSR | S_IWUSR, initial_val)) == SEM_FAILED) {
#else
- if (sem_init((SEMAPHORE_T)handle, 0, initial_val)) {
+ if (sem_init((SEMAPHORE_T)handle, 0, initial_val)) {
#endif
- TSK_FREE(handle);
- TSK_DEBUG_ERROR("Failed to initialize the new semaphore (errno=%d).", errno);
- }
+ TSK_FREE(handle);
+ TSK_DEBUG_ERROR("Failed to initialize the new semaphore (errno=%d).", errno);
+ }
#endif
- if (!handle) {
- TSK_DEBUG_ERROR("Failed to create new semaphore");
- }
- return handle;
+ if (!handle) {
+ TSK_DEBUG_ERROR("Failed to create new semaphore");
}
-
- /**@ingroup tsk_semaphore_group
- * Increments a semaphore.
- * @param handle The semaphore to increment.
- * @retval Zero if succeed and otherwise the function returns -1 and sets errno to indicate the error.
- * @sa @ref tsk_semaphore_decrement.
- */
- int tsk_semaphore_increment(tsk_semaphore_handle_t* handle)
- {
- int ret = EINVAL;
- if (handle) {
+ return handle;
+}
+
+/**@ingroup tsk_semaphore_group
+ * Increments a semaphore.
+ * @param handle The semaphore to increment.
+ * @retval Zero if succeed and otherwise the function returns -1 and sets errno to indicate the error.
+ * @sa @ref tsk_semaphore_decrement.
+ */
+int tsk_semaphore_increment(tsk_semaphore_handle_t* handle)
+{
+ int ret = EINVAL;
+ if (handle) {
#if TSK_UNDER_WINDOWS
- if((ret = ReleaseSemaphore((SEMAPHORE_T)handle, 1L, NULL) ? 0 : -1))
+ if((ret = ReleaseSemaphore((SEMAPHORE_T)handle, 1L, NULL) ? 0 : -1))
#else
- if((ret = sem_post((SEMAPHORE_T)GET_SEM(handle))))
+ if((ret = sem_post((SEMAPHORE_T)GET_SEM(handle))))
#endif
- {
- TSK_DEBUG_ERROR("sem_post function failed: %d", ret);
- }
+ {
+ TSK_DEBUG_ERROR("sem_post function failed: %d", ret);
}
- return ret;
}
-
- /**@ingroup tsk_semaphore_group
- * Decrements a semaphore.
- * @param handle The semaphore to decrement.
- * @retval Zero if succeed and otherwise the function returns -1 and sets errno to indicate the error.
- * @sa @ref tsk_semaphore_increment.
- */
- int tsk_semaphore_decrement(tsk_semaphore_handle_t* handle)
- {
- int ret = EINVAL;
- if (handle) {
+ return ret;
+}
+
+/**@ingroup tsk_semaphore_group
+ * Decrements a semaphore.
+ * @param handle The semaphore to decrement.
+ * @retval Zero if succeed and otherwise the function returns -1 and sets errno to indicate the error.
+ * @sa @ref tsk_semaphore_increment.
+ */
+int tsk_semaphore_decrement(tsk_semaphore_handle_t* handle)
+{
+ int ret = EINVAL;
+ if (handle) {
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- ret = (WaitForSingleObjectEx((SEMAPHORE_T)handle, INFINITE, TRUE) == WAIT_OBJECT_0) ? 0 : -1;
+ ret = (WaitForSingleObjectEx((SEMAPHORE_T)handle, INFINITE, TRUE) == WAIT_OBJECT_0) ? 0 : -1;
# else
- ret = (WaitForSingleObject((SEMAPHORE_T)handle, INFINITE) == WAIT_OBJECT_0) ? 0 : -1;
+ ret = (WaitForSingleObject((SEMAPHORE_T)handle, INFINITE) == WAIT_OBJECT_0) ? 0 : -1;
#endif
- if (ret) {
- TSK_DEBUG_ERROR("sem_wait function failed: %d", ret);
- }
+ if (ret) {
+ TSK_DEBUG_ERROR("sem_wait function failed: %d", ret);
+ }
#else
- do {
- ret = sem_wait((SEMAPHORE_T)GET_SEM(handle));
- }
- while ( errno == EINTR );
- if(ret) TSK_DEBUG_ERROR("sem_wait function failed: %d", errno);
-#endif
+ do {
+ ret = sem_wait((SEMAPHORE_T)GET_SEM(handle));
}
-
- return ret;
+ while ( errno == EINTR );
+ if(ret) {
+ TSK_DEBUG_ERROR("sem_wait function failed: %d", errno);
+ }
+#endif
}
-
- /**@ingroup tsk_semaphore_group
- * Destroy a semaphore previously created using @ref tsk_semaphore_create.
- * @param handle The semaphore to free.
- * @sa @ref tsk_semaphore_create
- */
- void tsk_semaphore_destroy(tsk_semaphore_handle_t** handle)
- {
- if(handle && *handle)
- {
+
+ return ret;
+}
+
+/**@ingroup tsk_semaphore_group
+ * Destroy a semaphore previously created using @ref tsk_semaphore_create.
+ * @param handle The semaphore to free.
+ * @sa @ref tsk_semaphore_create
+ */
+void tsk_semaphore_destroy(tsk_semaphore_handle_t** handle)
+{
+ if(handle && *handle) {
#if TSK_UNDER_WINDOWS
- CloseHandle((SEMAPHORE_T)*handle);
- *handle = tsk_null;
+ CloseHandle((SEMAPHORE_T)*handle);
+ *handle = tsk_null;
#else
# if TSK_USE_NAMED_SEM
- named_sem_t * nsem = ((named_sem_t*)*handle);
- sem_close(nsem->sem);
+ named_sem_t * nsem = ((named_sem_t*)*handle);
+ sem_close(nsem->sem);
#else
- sem_destroy((SEMAPHORE_T)GET_SEM(*handle));
+ sem_destroy((SEMAPHORE_T)GET_SEM(*handle));
#endif /* TSK_USE_NAMED_SEM */
- tsk_free(handle);
+ tsk_free(handle);
#endif
- }
- else{
- TSK_DEBUG_WARN("Cannot free an uninitialized semaphore object");
- }
}
-
+ else {
+ TSK_DEBUG_WARN("Cannot free an uninitialized semaphore object");
+ }
+}
+
diff --git a/tinySAK/src/tsk_semaphore.h b/tinySAK/src/tsk_semaphore.h
index 205e8c0..50fb729 100755
--- a/tinySAK/src/tsk_semaphore.h
+++ b/tinySAK/src/tsk_semaphore.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_sha1.c b/tinySAK/src/tsk_sha1.c
index 1d972db..3a15b2a 100755
--- a/tinySAK/src/tsk_sha1.c
+++ b/tinySAK/src/tsk_sha1.c
@@ -1,7 +1,7 @@
/*
*
* Based on the RFC 3174
- *
+ *
* Full Copyright Statement
*
* Copyright (C) The Internet Society (2001). All Rights Reserved.
@@ -32,7 +32,7 @@
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
*
- *
+ *
* Description:
* This file implements the Secure Hashing Algorithm 1 as
* defined in FIPS PUB 180-1 published April 17, 1995.
@@ -65,19 +65,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -108,7 +108,7 @@
* when n is the digest size in bits. Therefore, this
* algorithm can serve as a means of providing a
* "fingerprint" for a message.
- *
+ *
*/
/**@ingroup tsk_sha1_group
@@ -132,7 +132,7 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *);
*/
tsk_sha1_errcode_t tsk_sha1reset(tsk_sha1context_t *context)
{
- if (!context){
+ if (!context) {
return shaNull;
}
@@ -165,17 +165,17 @@ tsk_sha1_errcode_t tsk_sha1result( tsk_sha1context_t *context, tsk_sha1digest_t
{
int32_t i;
- if (!context || !Message_Digest){
+ if (!context || !Message_Digest) {
return shaNull;
}
- if (context->Corrupted){
+ if (context->Corrupted) {
return (tsk_sha1_errcode_t)context->Corrupted;
}
- if (!context->Computed){
+ if (!context->Computed) {
SHA1PadMessage(context);
- for(i=0; i<64; ++i){
+ for(i=0; i<64; ++i) {
/* message may be sensitive, clear it out */
context->Message_Block[i] = 0;
}
@@ -185,7 +185,7 @@ tsk_sha1_errcode_t tsk_sha1result( tsk_sha1context_t *context, tsk_sha1digest_t
}
- for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i){
+ for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
Message_Digest[i] = context->Intermediate_Hash[i>>2]
>> 8 * ( 3 - ( i & 0x03 ) );
}
@@ -203,46 +203,44 @@ tsk_sha1_errcode_t tsk_sha1result( tsk_sha1context_t *context, tsk_sha1digest_t
* @retval @ref tsk_sha1_errcode_t code.
*/
tsk_sha1_errcode_t tsk_sha1input(tsk_sha1context_t *context,
- const uint8_t *message_array,
- unsigned length)
+ const uint8_t *message_array,
+ unsigned length)
{
- if (!length){
+ if (!length) {
return shaSuccess;
}
- if (!context || !message_array){
+ if (!context || !message_array) {
return shaNull;
}
- if (context->Computed){
+ if (context->Computed) {
context->Corrupted = shaStateError;
return shaStateError;
}
- if (context->Corrupted){
- return (tsk_sha1_errcode_t)context->Corrupted;
+ if (context->Corrupted) {
+ return (tsk_sha1_errcode_t)context->Corrupted;
}
- while(length-- && !context->Corrupted)
- {
- context->Message_Block[context->Message_Block_Index++] =
- (*message_array & 0xFF);
-
- context->Length_Low += 8;
- if (context->Length_Low == 0){
- context->Length_High++;
- if (context->Length_High == 0)
- {
- /* Message is too long */
- context->Corrupted = 1;
+ while(length-- && !context->Corrupted) {
+ context->Message_Block[context->Message_Block_Index++] =
+ (*message_array & 0xFF);
+
+ context->Length_Low += 8;
+ if (context->Length_Low == 0) {
+ context->Length_High++;
+ if (context->Length_High == 0) {
+ /* Message is too long */
+ context->Corrupted = 1;
+ }
}
- }
- if (context->Message_Block_Index == 64){
- SHA1ProcessMessageBlock(context);
- }
+ if (context->Message_Block_Index == 64) {
+ SHA1ProcessMessageBlock(context);
+ }
- message_array++;
+ message_array++;
}
return shaSuccess;
@@ -258,17 +256,17 @@ tsk_sha1_errcode_t tsk_sha1input(tsk_sha1context_t *context,
*/
void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
{
- /*
- * Many of the variable names in this code, especially the
- * single character names, were used because those were the
- * names used in the publication.
- */
+ /*
+ * Many of the variable names in this code, especially the
+ * single character names, were used because those were the
+ * names used in the publication.
+ */
const uint32_t K[] = { /* Constants defined in SHA-1 */
- 0x5A827999,
- 0x6ED9EBA1,
- 0x8F1BBCDC,
- 0xCA62C1D6
- };
+ 0x5A827999,
+ 0x6ED9EBA1,
+ 0x8F1BBCDC,
+ 0xCA62C1D6
+ };
int32_t t; /* Loop counter */
uint32_t temp; /* Temporary word value */
uint32_t W[80]; /* Word sequence */
@@ -277,15 +275,15 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
/*
* Initialize the first 16 words in the array W
*/
- for(t = 0; t < 16; t++){
+ for(t = 0; t < 16; t++) {
W[t] = context->Message_Block[t * 4] << 24;
W[t] |= context->Message_Block[t * 4 + 1] << 16;
W[t] |= context->Message_Block[t * 4 + 2] << 8;
W[t] |= context->Message_Block[t * 4 + 3];
}
- for(t = 16; t < 80; t++){
- W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+ for(t = 16; t < 80; t++) {
+ W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
}
A = context->Intermediate_Hash[0];
@@ -294,7 +292,7 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
D = context->Intermediate_Hash[3];
E = context->Intermediate_Hash[4];
- for(t = 0; t < 20; t++){
+ for(t = 0; t < 20; t++) {
temp = SHA1CircularShift(5,A) +
((B & C) | ((~B) & D)) + E + W[t] + K[0];
E = D;
@@ -305,7 +303,7 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
A = temp;
}
- for(t = 20; t < 40; t++){
+ for(t = 20; t < 40; t++) {
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
E = D;
D = C;
@@ -314,7 +312,7 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
A = temp;
}
- for(t = 40; t < 60; t++){
+ for(t = 40; t < 60; t++) {
temp = SHA1CircularShift(5,A) +
((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
E = D;
@@ -324,7 +322,7 @@ void SHA1ProcessMessageBlock(tsk_sha1context_t *context)
A = temp;
}
- for(t = 60; t < 80; t++){
+ for(t = 60; t < 80; t++) {
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
E = D;
D = C;
@@ -365,21 +363,21 @@ void SHA1PadMessage(tsk_sha1context_t *context)
* block, process it, and then continue padding into a second
* block.
*/
- if (context->Message_Block_Index > 55){
+ if (context->Message_Block_Index > 55) {
context->Message_Block[context->Message_Block_Index++] = 0x80;
- while(context->Message_Block_Index < 64){
+ while(context->Message_Block_Index < 64) {
context->Message_Block[context->Message_Block_Index++] = 0;
}
SHA1ProcessMessageBlock(context);
- while(context->Message_Block_Index < 56){
+ while(context->Message_Block_Index < 56) {
context->Message_Block[context->Message_Block_Index++] = 0;
}
}
- else{
+ else {
context->Message_Block[context->Message_Block_Index++] = 0x80;
- while(context->Message_Block_Index < 56){
+ while(context->Message_Block_Index < 56) {
context->Message_Block[context->Message_Block_Index++] = 0;
}
}
@@ -405,51 +403,51 @@ void SHA1PadMessage(tsk_sha1context_t *context)
* @param context The sha1 context.
*/
void tsk_sha1final(uint8_t *Message_Digest, tsk_sha1context_t *context)
-{
- int32_t i;
-
- SHA1PadMessage(context);
- for(i = 0; i<64; ++i) {
- context->Message_Block[i] = 0;
- }
- context->Length_Low = 0; /* and clear length */
- context->Length_High = 0;
-
- for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
- Message_Digest[i] = context->Intermediate_Hash[i>>2] >> 8*(3-(i&0x03));
- }
+{
+ int32_t i;
+
+ SHA1PadMessage(context);
+ for(i = 0; i<64; ++i) {
+ context->Message_Block[i] = 0;
+ }
+ context->Length_Low = 0; /* and clear length */
+ context->Length_High = 0;
+
+ for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
+ Message_Digest[i] = context->Intermediate_Hash[i>>2] >> 8*(3-(i&0x03));
+ }
}
/**@ingroup tsk_sha1_group
- * Calculates sha1 digest result (hexadecimal string).
+ * Calculates sha1 digest result (hexadecimal string).
*
- * @param input The input data for which to calculate the SHA-1 hash.
- * @param size The size of the input data.
- * @param result SHA-1 hash result as a hexadecimal string.
+ * @param input The input data for which to calculate the SHA-1 hash.
+ * @param size The size of the input data.
+ * @param result SHA-1 hash result as a hexadecimal string.
*
* @retval @ref tsk_sha1_errcode_t code.
* @sa @ref TSK_SHA1_DIGEST_CALC
**/
tsk_sha1_errcode_t tsk_sha1compute(const char* input, tsk_size_t size, tsk_sha1string_t *result)
{
- tsk_sha1_errcode_t ret;
- tsk_sha1context_t sha;
- uint8_t digest[TSK_SHA1_DIGEST_SIZE];
-
- (*result)[TSK_SHA1_STRING_SIZE] = '\0';
-
- if( (ret = tsk_sha1reset(&sha)) != shaSuccess ){
- return ret;
- }
- else if ( (ret = tsk_sha1input(&sha, (uint8_t*)input, (unsigned int)size)) != shaSuccess ){
- return ret;
- }
- else if( (ret = tsk_sha1result(&sha, digest)) != shaSuccess ){
- return ret;
- }
-
- tsk_str_from_hex(digest, TSK_SHA1_DIGEST_SIZE, (char*)*result);
-
- return shaSuccess;
+ tsk_sha1_errcode_t ret;
+ tsk_sha1context_t sha;
+ uint8_t digest[TSK_SHA1_DIGEST_SIZE];
+
+ (*result)[TSK_SHA1_STRING_SIZE] = '\0';
+
+ if( (ret = tsk_sha1reset(&sha)) != shaSuccess ) {
+ return ret;
+ }
+ else if ( (ret = tsk_sha1input(&sha, (uint8_t*)input, (unsigned int)size)) != shaSuccess ) {
+ return ret;
+ }
+ else if( (ret = tsk_sha1result(&sha, digest)) != shaSuccess ) {
+ return ret;
+ }
+
+ tsk_str_from_hex(digest, TSK_SHA1_DIGEST_SIZE, (char*)*result);
+
+ return shaSuccess;
}
diff --git a/tinySAK/src/tsk_sha1.h b/tinySAK/src/tsk_sha1.h
index ff1e3d3..7c09005 100755
--- a/tinySAK/src/tsk_sha1.h
+++ b/tinySAK/src/tsk_sha1.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,8 +37,7 @@ TSK_BEGIN_DECLS
/**@ingroup tsk_sha1_group
* SHA-1 error codes.
*/
-typedef enum tsk_sha1_errcode_e
-{
+typedef enum tsk_sha1_errcode_e {
shaSuccess = 0, /**< Success */
shaNull, /**< Null pointer parameter */
shaInputTooLong, /**< input data too long */
@@ -90,20 +89,19 @@ typedef uint8_t tsk_sha1digest_t[TSK_SHA1_DIGEST_SIZE]; /**< SHA-1 digest bytes.
* This structure will hold context information for the SHA-1
* hashing SSESSION
*/
-typedef struct tsk_sha1context_s
-{
+typedef struct tsk_sha1context_s {
uint32_t Intermediate_Hash[TSK_SHA1_DIGEST_SIZE/4]; /* Message Digest */
uint32_t Length_Low; /**< Message length in bits */
uint32_t Length_High; /**< Message length in bits */
-
+
int_least16_t Message_Block_Index;/**< Index into message block array */
uint8_t Message_Block[64]; /**< 512-bit message blocks */
int32_t Computed; /**< Is the digest computed? */
int32_t Corrupted; /**< Is the message digest corrupted? */
-}
+}
tsk_sha1context_t;
/*
diff --git a/tinySAK/src/tsk_string.c b/tinySAK/src/tsk_string.c
index 301eed3..2ee5c6d 100755
--- a/tinySAK/src/tsk_string.c
+++ b/tinySAK/src/tsk_string.c
@@ -58,23 +58,23 @@
*/
tsk_string_t* tsk_string_create(const char* str)
{
- return (tsk_string_t*)tsk_object_new(tsk_string_def_t, str);
+ return (tsk_string_t*)tsk_object_new(tsk_string_def_t, str);
}
int tsk_string_pred_icmp(const tsk_list_item_t* item, const void* str)
{
- if (item && str){
- return tsk_stricmp(TSK_STRING_STR(item->data), (const char*)str);
- }
- return -1;
+ if (item && str) {
+ return tsk_stricmp(TSK_STRING_STR(item->data), (const char*)str);
+ }
+ return -1;
}
int tsk_string_pred_cmp(const tsk_list_item_t* item, const void* str)
{
- if (item && str){
- return tsk_strcmp(TSK_STRING_STR(item->data), (const char*)str);
- }
- return -1;
+ if (item && str) {
+ return tsk_strcmp(TSK_STRING_STR(item->data), (const char*)str);
+ }
+ return -1;
}
/**@ingroup tsk_string_group
@@ -84,8 +84,8 @@ int tsk_string_pred_cmp(const tsk_list_item_t* item, const void* str)
*/
char tsk_b10tob16(char c)
{
- static char HEX[] = "0123456789abcdef";
- return HEX[c & 15];
+ static char HEX[] = "0123456789abcdef";
+ return HEX[c & 15];
}
/**@ingroup tsk_string_group
@@ -95,7 +95,7 @@ char tsk_b10tob16(char c)
*/
char tsk_b16tob10(char c)
{
- return isdigit(c) ? c - '0' : tolower(c) - 'a' + 10;
+ return isdigit(c) ? c - '0' : tolower(c) - 'a' + 10;
}
/**@ingroup tsk_string_group
@@ -112,10 +112,10 @@ char tsk_b16tob10(char c)
*/
int tsk_stricmp(const char * str1, const char * str2)
{
- return (str1 && str2) ?
- ((tolower(*str1) == tolower(*str2)) ? stricmp(str1, str2) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
- :
- ((!str1 && !str2) ? 0 : -1);
+ return (str1 && str2) ?
+ ((tolower(*str1) == tolower(*str2)) ? stricmp(str1, str2) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
+ :
+ ((!str1 && !str2) ? 0 : -1);
}
/**@ingroup tsk_string_group
@@ -133,20 +133,20 @@ int tsk_stricmp(const char * str1, const char * str2)
*/
int tsk_strnicmp(const char * str1, const char * str2, tsk_size_t n)
{
- return (str1 && str2 && n) ?
- ((tolower(*str1) == tolower(*str2)) ? strnicmp(str1, str2, n) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
- :
- ((!str1 && !str2) ? 0 : -1);
+ return (str1 && str2 && n) ?
+ ((tolower(*str1) == tolower(*str2)) ? strnicmp(str1, str2, n) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
+ :
+ ((!str1 && !str2) ? 0 : -1);
}
/**@ingroup tsk_string_group
*/
int tsk_strcmp(const char * str1, const char * str2)
{
- return (str1 && str2) ?
- ((*str1 == *str2) ? stricmp(str1, str2) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
- :
- ((!str1 && !str2) ? 0 : -1);
+ return (str1 && str2) ?
+ ((*str1 == *str2) ? stricmp(str1, str2) : (*str1 - *str2)) /* Compare first charaters before doing complete comparison */
+ :
+ ((!str1 && !str2) ? 0 : -1);
}
/**@ingroup tsk_string_group
@@ -164,7 +164,7 @@ int tsk_strcmp(const char * str1, const char * str2)
*/
int tsk_strncmp(const char * str1, const char * str2, tsk_size_t n)
{
- return (str1 && str2) ? ((*str1 != *str2) ? -1 : strncmp(str1, str2, n)) : ((!str1 && !str2) ? 0 : -1);
+ return (str1 && str2) ? ((*str1 != *str2) ? -1 : strncmp(str1, str2, n)) : ((!str1 && !str2) ? 0 : -1);
}
/**@ingroup tsk_string_group
@@ -174,10 +174,10 @@ int tsk_strncmp(const char * str1, const char * str2, tsk_size_t n)
*/
char* tsk_strdup(const char *s1)
{
- if (s1){
- return strdup(s1);
- }
- return tsk_null;
+ if (s1) {
+ return strdup(s1);
+ }
+ return tsk_null;
}
/** Duplicates the first @a n chars of @a s1.
@@ -187,18 +187,18 @@ char* tsk_strdup(const char *s1)
**/
char* tsk_strndup(const char *s1, tsk_size_t n)
{
- char *ret = tsk_null;
+ char *ret = tsk_null;
- if (s1 && n){
- tsk_size_t len = tsk_strlen(s1);
- tsk_size_t nret = (n > len) ? (len) : (n);
+ if (s1 && n) {
+ tsk_size_t len = tsk_strlen(s1);
+ tsk_size_t nret = (n > len) ? (len) : (n);
- if ((ret = (char*)tsk_calloc((nret + 1), sizeof(uint8_t)))){
- memcpy(ret, s1, nret);
- }
- }
+ if ((ret = (char*)tsk_calloc((nret + 1), sizeof(uint8_t)))) {
+ memcpy(ret, s1, nret);
+ }
+ }
- return ret;
+ return ret;
}
/**@ingroup tsk_string_group
@@ -210,7 +210,7 @@ char* tsk_strndup(const char *s1, tsk_size_t n)
*/
tsk_bool_t tsk_strcontains(const char * str, tsk_size_t size, const char * substring)
{
- return (tsk_strindexOf(str, size, substring) >= 0);
+ return (tsk_strindexOf(str, size, substring) >= 0);
}
/**@ingroup tsk_string_group
@@ -223,42 +223,42 @@ tsk_bool_t tsk_strcontains(const char * str, tsk_size_t size, const char * subst
*/
int tsk_strindexOf(const char * str, tsk_size_t size, const char * substring)
{
- if (str && substring){
- const char* sub_start = strstr(str, substring);
- if (sub_start && (sub_start < (str + size))) {
- int ret;
- tsk_subsat_int32_ptr(sub_start, str, &ret);
- return ret;
- }
- }
- return -1;
+ if (str && substring) {
+ const char* sub_start = strstr(str, substring);
+ if (sub_start && (sub_start < (str + size))) {
+ int ret;
+ tsk_subsat_int32_ptr(sub_start, str, &ret);
+ return ret;
+ }
+ }
+ return -1;
}
/**@ingroup tsk_string_group
*/
int tsk_strLastIndexOf(const char * str, tsk_size_t size, const char * substring)
{
- if (str && substring){
- tsk_size_t sub_size = tsk_strlen(substring);
- const char* last_sub_start = tsk_null;
- const char* sub_start = strstr(str, substring);
- const char* end = (str + size);
- while (sub_start && (sub_start < end)) {
- last_sub_start = sub_start;
- if ((sub_start + sub_size) < end){
- sub_start = strstr((sub_start + sub_size), substring);
- }
- else {
- break;
- }
- }
- if (last_sub_start) {
- int ret;
- tsk_subsat_int32_ptr(last_sub_start, str, &ret);
- return ret;
- }
- }
- return -1;
+ if (str && substring) {
+ tsk_size_t sub_size = tsk_strlen(substring);
+ const char* last_sub_start = tsk_null;
+ const char* sub_start = strstr(str, substring);
+ const char* end = (str + size);
+ while (sub_start && (sub_start < end)) {
+ last_sub_start = sub_start;
+ if ((sub_start + sub_size) < end) {
+ sub_start = strstr((sub_start + sub_size), substring);
+ }
+ else {
+ break;
+ }
+ }
+ if (last_sub_start) {
+ int ret;
+ tsk_subsat_int32_ptr(last_sub_start, str, &ret);
+ return ret;
+ }
+ }
+ return -1;
}
/**@ingroup tsk_string_group
@@ -270,49 +270,49 @@ int tsk_strLastIndexOf(const char * str, tsk_size_t size, const char * substring
*/
void tsk_strcat(char** destination, const char* source)
{
- tsk_strncat(destination, source, tsk_strlen(source));
+ tsk_strncat(destination, source, tsk_strlen(source));
}
/**@ingroup tsk_string_group
*/
void tsk_strcat_2(char** destination, const char* format, ...)
{
- char* temp = tsk_null;
- int len;
- va_list ap;
+ char* temp = tsk_null;
+ int len;
+ va_list ap;
- /* initialize variable arguments */
- va_start(ap, format);
- /* compute */
- if ((len = tsk_sprintf_2(&temp, format, &ap))){
- tsk_strncat(destination, temp, len);
- }
- /* reset variable arguments */
- va_end(ap);
- TSK_FREE(temp);
+ /* initialize variable arguments */
+ va_start(ap, format);
+ /* compute */
+ if ((len = tsk_sprintf_2(&temp, format, &ap))) {
+ tsk_strncat(destination, temp, len);
+ }
+ /* reset variable arguments */
+ va_end(ap);
+ TSK_FREE(temp);
}
/**@ingroup tsk_string_group
*/
void tsk_strncat(char** destination, const char* source, tsk_size_t n)
{
- tsk_size_t index = 0;
- tsk_size_t tsk_size_to_cat = (n > tsk_strlen(source)) ? tsk_strlen(source) : n;
+ tsk_size_t index = 0;
+ tsk_size_t tsk_size_to_cat = (n > tsk_strlen(source)) ? tsk_strlen(source) : n;
- if (!source || !n) {
- return;
- }
+ if (!source || !n) {
+ return;
+ }
- if (!*destination) {
- *destination = (char*)tsk_malloc(tsk_size_to_cat + 1);
- strncpy(*destination, source, tsk_size_to_cat + 1);
- }
- else {
- index = tsk_strlen(*destination);
- *destination = (char*)tsk_realloc(*destination, index + tsk_size_to_cat + 1);
- strncpy(((*destination) + index), source, tsk_size_to_cat + 1);
- }
- (*destination)[index + tsk_size_to_cat] = '\0';
+ if (!*destination) {
+ *destination = (char*)tsk_malloc(tsk_size_to_cat + 1);
+ strncpy(*destination, source, tsk_size_to_cat + 1);
+ }
+ else {
+ index = tsk_strlen(*destination);
+ *destination = (char*)tsk_realloc(*destination, index + tsk_size_to_cat + 1);
+ strncpy(((*destination) + index), source, tsk_size_to_cat + 1);
+ }
+ (*destination)[index + tsk_size_to_cat] = '\0';
}
/**@ingroup tsk_string_group
@@ -329,68 +329,68 @@ void tsk_strncat(char** destination, const char* source, tsk_size_t n)
*/
int tsk_sprintf(char** str, const char* format, ...)
{
- int len;
- va_list ap;
+ int len;
+ va_list ap;
- /* initialize variable arguments */
- va_start(ap, format);
- /* compute */
- len = tsk_sprintf_2(str, format, &ap);
- /* reset variable arguments */
- va_end(ap);
+ /* initialize variable arguments */
+ va_start(ap, format);
+ /* compute */
+ len = tsk_sprintf_2(str, format, &ap);
+ /* reset variable arguments */
+ va_end(ap);
- return len;
+ return len;
}
/**@ingroup tsk_string_group
*/
int tsk_sprintf_2(char** str, const char* format, va_list* ap)
{
- int len = 0;
- va_list ap2;
+ int len = 0;
+ va_list ap2;
- /* free previous value */
- if (*str){
- tsk_free((void**)str);
- }
+ /* free previous value */
+ if (*str) {
+ tsk_free((void**)str);
+ }
- /* needed for 64bit platforms where vsnprintf will change the va_list */
- tsk_va_copy(ap2, *ap);
+ /* needed for 64bit platforms where vsnprintf will change the va_list */
+ tsk_va_copy(ap2, *ap);
- /* compute destination len for windows mobile
- */
+ /* compute destination len for windows mobile
+ */
#if defined(_WIN32_WCE)
- {
- int n;
- len = (tsk_strlen(format) * 2);
- *str = (char*)tsk_calloc(1, len+1);
- for(;;){
- if( (n = vsnprintf(*str, len, format, *ap)) >= 0 && (n<len) ){
- len = n;
- goto done;
- }
- else{
- len += 10;
- *str = (char*)tsk_realloc(*str, len+1);
- }
- }
- done:
- (*str)[len] = '\0';
- }
+ {
+ int n;
+ len = (tsk_strlen(format) * 2);
+ *str = (char*)tsk_calloc(1, len+1);
+ for(;;) {
+ if( (n = vsnprintf(*str, len, format, *ap)) >= 0 && (n<len) ) {
+ len = n;
+ goto done;
+ }
+ else {
+ len += 10;
+ *str = (char*)tsk_realloc(*str, len+1);
+ }
+ }
+done:
+ (*str)[len] = '\0';
+ }
#else
- len = vsnprintf(0, 0, format, *ap);
- *str = (char*)tsk_calloc(1, len + 1);
- vsnprintf(*str, len
+ len = vsnprintf(0, 0, format, *ap);
+ *str = (char*)tsk_calloc(1, len + 1);
+ vsnprintf(*str, len
#if !defined(_MSC_VER) || defined(__GNUC__)
- +1
+ +1
#endif
- , format, ap2);
+ , format, ap2);
#endif
- va_end(ap2);
+ va_end(ap2);
- return len;
- }
+ return len;
+}
/**@ingroup tsk_string_group
* Updates the value of @a str.
@@ -399,17 +399,17 @@ int tsk_sprintf_2(char** str, const char* format, va_list* ap)
*/
void tsk_strupdate(char** str, const char* newval)
{
- if (str && *str != newval){ // do nothing if same memory address
- // use realloc() to keep same memory address
- tsk_size_t length = tsk_strlen(newval);
- if (!length) {
- tsk_free((void**)str);
- }
- else if ((*str = (char*)tsk_realloc(*str, length + 1))){
- memcpy(*str, newval, length);
- (*str)[length] = '\0';
- }
- }
+ if (str && *str != newval) { // do nothing if same memory address
+ // use realloc() to keep same memory address
+ tsk_size_t length = tsk_strlen(newval);
+ if (!length) {
+ tsk_free((void**)str);
+ }
+ else if ((*str = (char*)tsk_realloc(*str, length + 1))) {
+ memcpy(*str, newval, length);
+ (*str)[length] = '\0';
+ }
+ }
}
@@ -419,15 +419,17 @@ void tsk_strupdate(char** str, const char* newval)
*/
void tsk_strtrim_left(char **str)
{
- if (str && *str) {
- tsk_size_t count = 0;
- while (isspace(*((*str) + count))) count++;
- if (count) {
- tsk_size_t len = tsk_strlen((*str));
- memmove((*str), (*str) + count, (len - count));
- (*str)[len - count] = '\0';
- }
- }
+ if (str && *str) {
+ tsk_size_t count = 0;
+ while (isspace(*((*str) + count))) {
+ count++;
+ }
+ if (count) {
+ tsk_size_t len = tsk_strlen((*str));
+ memmove((*str), (*str) + count, (len - count));
+ (*str)[len - count] = '\0';
+ }
+ }
}
/**@ingroup tsk_string_group
@@ -436,13 +438,15 @@ void tsk_strtrim_left(char **str)
*/
void tsk_strtrim_right(char **str)
{
- if (str && *str){
- tsk_size_t size;
- if ((size = tsk_strlen(*str))){
- while (isspace(*((*str) + size - 1))) size--;
- *(*str + size) = '\0';
- }
- }
+ if (str && *str) {
+ tsk_size_t size;
+ if ((size = tsk_strlen(*str))) {
+ while (isspace(*((*str) + size - 1))) {
+ size--;
+ }
+ *(*str + size) = '\0';
+ }
+ }
}
/**@ingroup tsk_string_group
* Removes all occurrences of white space characters from the beginning and end of @a str.
@@ -450,10 +454,10 @@ void tsk_strtrim_right(char **str)
*/
void tsk_strtrim(char **str)
{
- // left
- tsk_strtrim_left(str);
- // right
- tsk_strtrim_right(str);
+ // left
+ tsk_strtrim_left(str);
+ // right
+ tsk_strtrim_right(str);
}
/**@ingroup tsk_string_group
@@ -463,7 +467,7 @@ void tsk_strtrim(char **str)
*/
void tsk_strquote(char **str)
{
- tsk_strquote_2(str, '"', '"');
+ tsk_strquote_2(str, '"', '"');
}
/**@ingroup tsk_string_group
@@ -474,12 +478,12 @@ void tsk_strquote(char **str)
*/
void tsk_strquote_2(char **str, char lquote, char rquote)
{
- if (str && *str){
- char *result = tsk_null;
- tsk_sprintf(&result, "%c%s%c", lquote, *str, rquote);
- tsk_free((void**)str);
- *str = result;
- }
+ if (str && *str) {
+ char *result = tsk_null;
+ tsk_sprintf(&result, "%c%s%c", lquote, *str, rquote);
+ tsk_free((void**)str);
+ *str = result;
+ }
}
/**@ingroup tsk_string_group
@@ -489,7 +493,7 @@ void tsk_strquote_2(char **str, char lquote, char rquote)
*/
void tsk_strunquote(char **str)
{
- tsk_strunquote_2(str, '"', '"');
+ tsk_strunquote_2(str, '"', '"');
}
/**@ingroup tsk_string_group
@@ -501,13 +505,13 @@ void tsk_strunquote(char **str)
*/
void tsk_strunquote_2(char **str, char lquote, char rquote)
{
- if (str && *str) {
- tsk_size_t size = tsk_strlen(*str);
- if (size >= 2 && **str == lquote && *((*str) + size - 1) == rquote){
- memmove((*str), (*str) + 1, (size - 2));
- *((*str) + size - 2) = '\0';
- }
- }
+ if (str && *str) {
+ tsk_size_t size = tsk_strlen(*str);
+ if (size >= 2 && **str == lquote && *((*str) + size - 1) == rquote) {
+ memmove((*str), (*str) + 1, (size - 2));
+ *((*str) + size - 2) = '\0';
+ }
+ }
}
/**@ingroup tsk_string_group
@@ -517,36 +521,36 @@ void tsk_strunquote_2(char **str, char lquote, char rquote)
*/
void tsk_itoa(int64_t i, tsk_istr_t *result)
{
- memset(result, 0, sizeof(*result));
- sprintf(*result, "%lld", i);
+ memset(result, 0, sizeof(*result));
+ sprintf(*result, "%lld", i);
}
/**@ingroup tsk_string_group
*/
int64_t tsk_atoll(const char* str)
{
- // FIXME: use HAVE_ATOLL and use macro instead of function
- if (str){
+ // FIXME: use HAVE_ATOLL and use macro instead of function
+ if (str) {
#if defined(_MSC_VER)
- return _atoi64(str);
+ return _atoi64(str);
#elif defined(__GNUC__)
- return atoll(str);
+ return atoll(str);
#else
- return atol(str);
+ return atol(str);
#endif
- }
- return 0;
+ }
+ return 0;
}
/**@ingroup tsk_string_group
*/
long tsk_atox(const char* str)
{
- long ret = 0;
- if (str){
- sscanf(str, "%lx", &ret);
- }
- return ret;
+ long ret = 0;
+ if (str) {
+ sscanf(str, "%lx", &ret);
+ }
+ return ret;
}
/**@ingroup tsk_string_group
@@ -556,8 +560,8 @@ long tsk_atox(const char* str)
**/
void tsk_strrandom(tsk_istr_t *result)
{
- static uint64_t __counter = 1;
- tsk_itoa((tsk_time_now() ^ (rand())) ^ ++__counter, result);
+ static uint64_t __counter = 1;
+ tsk_itoa((tsk_time_now() ^ (rand())) ^ ++__counter, result);
}
/**@ingroup tsk_string_group
@@ -572,13 +576,13 @@ void tsk_strrandom(tsk_istr_t *result)
**/
void tsk_str_from_hex(const uint8_t *hex, tsk_size_t size, char* str)
{
- static const char *TSK_HEXA_VALUES = { "0123456789abcdef" };
- tsk_size_t i;
+ static const char *TSK_HEXA_VALUES = { "0123456789abcdef" };
+ tsk_size_t i;
- for (i = 0; i < size; i++){
- str[2 * i] = TSK_HEXA_VALUES[(*(hex + i) & 0xf0) >> 4];
- str[(2 * i) + 1] = TSK_HEXA_VALUES[(*(hex + i) & 0x0f)];
- }
+ for (i = 0; i < size; i++) {
+ str[2 * i] = TSK_HEXA_VALUES[(*(hex + i) & 0xf0) >> 4];
+ str[(2 * i) + 1] = TSK_HEXA_VALUES[(*(hex + i) & 0x0f)];
+ }
}
/**@ingroup tsk_string_group
@@ -590,8 +594,8 @@ void tsk_str_from_hex(const uint8_t *hex, tsk_size_t size, char* str)
**/
void tsk_str_to_hex(const char *str, tsk_size_t size, uint8_t* hex)
{
- // to avoid SIGBUS error when memory is misaligned do not use sscanf("%2x")
- TSK_DEBUG_FATAL("Not implemented.");
+ // to avoid SIGBUS error when memory is misaligned do not use sscanf("%2x")
+ TSK_DEBUG_FATAL("Not implemented.");
}
@@ -600,36 +604,30 @@ void tsk_str_to_hex(const char *str, tsk_size_t size, uint8_t* hex)
TINYSAK_API std::vector<char> rt_tsk_str_to_native(Platform::String^ str)
{
- if(str != nullptr && !str->IsEmpty())
- {
- int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
- if (len > 0)
- {
- std::vector<char> vec(len + 1);
- if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len)
- {
- return std::move(vec);
- }
- }
- }
- return std::move(std::vector<char>(0));
+ if(str != nullptr && !str->IsEmpty()) {
+ int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
+ if (len > 0) {
+ std::vector<char> vec(len + 1);
+ if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len) {
+ return std::move(vec);
+ }
+ }
+ }
+ return std::move(std::vector<char>(0));
}
TINYSAK_API Platform::String^ rt_tsk_str_to_managed(char const* str)
{
- if(str)
- {
- int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
- if (len > 0)
- {
- std::vector<wchar_t> vec(len);
- if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len)
- {
- return ref new Platform::String(vec.data());
- }
- }
- }
- return nullptr;
+ if(str) {
+ int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
+ if (len > 0) {
+ std::vector<wchar_t> vec(len);
+ if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len) {
+ return ref new Platform::String(vec.data());
+ }
+ }
+ }
+ return nullptr;
}
#endif /* TSK_UNDER_WINDOWS_RT */
@@ -644,42 +642,45 @@ TINYSAK_API Platform::String^ rt_tsk_str_to_managed(char const* str)
//
static tsk_object_t* tsk_string_ctor(tsk_object_t * self, va_list * app)
{
- tsk_string_t *string = (tsk_string_t*)self;
- const char *value = va_arg(*app, const char *);
- if (value){
- string->value = tsk_strdup(value);
- }
- return self;
+ tsk_string_t *string = (tsk_string_t*)self;
+ const char *value = va_arg(*app, const char *);
+ if (value) {
+ string->value = tsk_strdup(value);
+ }
+ return self;
}
static tsk_object_t* tsk_string_dtor(tsk_object_t * self)
{
- tsk_string_t *string = (tsk_string_t*)self;
- if (string){
- TSK_FREE(string->value);
- }
+ tsk_string_t *string = (tsk_string_t*)self;
+ if (string) {
+ TSK_FREE(string->value);
+ }
- return self;
+ return self;
}
static int tsk_string_cmp(const tsk_object_t *_s1, const tsk_object_t *_s2)
{
- const tsk_string_t *s1 = (const tsk_string_t *)_s1;
- const tsk_string_t *s2 = (const tsk_string_t *)_s2;
-
- if (s1 && s2){
- return tsk_stricmp(s1->value, s2->value);
- }
- else if (!s1 && !s2) return 0;
- else return -1;
-}
-
-static const tsk_object_def_t tsk_string_def_s =
-{
- sizeof(tsk_string_t),
- tsk_string_ctor,
- tsk_string_dtor,
- tsk_string_cmp,
+ const tsk_string_t *s1 = (const tsk_string_t *)_s1;
+ const tsk_string_t *s2 = (const tsk_string_t *)_s2;
+
+ if (s1 && s2) {
+ return tsk_stricmp(s1->value, s2->value);
+ }
+ else if (!s1 && !s2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
+}
+
+static const tsk_object_def_t tsk_string_def_s = {
+ sizeof(tsk_string_t),
+ tsk_string_ctor,
+ tsk_string_dtor,
+ tsk_string_cmp,
};
const tsk_object_def_t *tsk_string_def_t = &tsk_string_def_s;
diff --git a/tinySAK/src/tsk_string.h b/tinySAK/src/tsk_string.h
index b941012..e3d7749 100755
--- a/tinySAK/src/tsk_string.h
+++ b/tinySAK/src/tsk_string.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,7 +31,7 @@
/**@ingroup tsk_string_group
* @def TSK_STRING_STR
-* Gets the internal string pointer.
+* Gets the internal string pointer.
*/
TSK_BEGIN_DECLS
@@ -114,11 +114,10 @@ TINYSAK_API void tsk_str_to_hex(const char *str, tsk_size_t size, uint8_t* hex);
/**@ingroup tsk_string_group
* String object.
*/
-typedef struct tsk_string_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_string_s {
+ TSK_DECLARE_OBJECT;
- char *value; /**< The value of the string object. */
+ char *value; /**< The value of the string object. */
}
tsk_string_t;
diff --git a/tinySAK/src/tsk_thread.c b/tinySAK/src/tsk_thread.c
index ff2e2c0..5538d42 100755
--- a/tinySAK/src/tsk_thread.c
+++ b/tinySAK/src/tsk_thread.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,7 +36,7 @@
#endif
#if TSK_UNDER_WINDOWS_RT
# include "../winrt/ThreadEmulation.h"
- using namespace ThreadEmulation;
+using namespace ThreadEmulation;
#endif
#include <string.h>
@@ -49,31 +49,31 @@
void tsk_thread_sleep(uint64_t ms)
{
#if TSK_UNDER_WINDOWS
- Sleep((DWORD)ms);
+ Sleep((DWORD)ms);
#else
- struct timespec interval;
+ struct timespec interval;
- interval.tv_sec = (long)(ms/1000);
- interval.tv_nsec = (long)(ms%1000) * 1000000;
- nanosleep(&interval, 0);
-#endif
+ interval.tv_sec = (long)(ms/1000);
+ interval.tv_nsec = (long)(ms%1000) * 1000000;
+ nanosleep(&interval, 0);
+#endif
}
/**@ingroup tsk_thread_group
* Creates a new thread.
* @param handle Handle id of the newly created thread. The returned handle should be destroyed using @ref tsk_thread_join()
-* @param start The function to be run as the new thread's start routine
-* @param arg An address for the argument for the thread's start routine
+* @param start The function to be run as the new thread's start routine
+* @param arg An address for the argument for the thread's start routine
* @retval If successful, returns zero. Otherwise, an error number is returned to indicate the error
*/
int tsk_thread_create(tsk_thread_handle_t** handle, void *(TSK_STDCALL *start) (void *), void *arg)
{
#if TSK_UNDER_WINDOWS
- *((HANDLE*)handle) = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start, arg, 0, NULL);
- return *((HANDLE*)handle) ? 0 : -1;
+ *((HANDLE*)handle) = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start, arg, 0, NULL);
+ return *((HANDLE*)handle) ? 0 : -1;
#else
- *handle = tsk_calloc(1, sizeof(pthread_t));
- return pthread_create((pthread_t*)*handle, 0, start, arg);
+ *handle = tsk_calloc(1, sizeof(pthread_t));
+ return pthread_create((pthread_t*)*handle, 0, start, arg);
#endif
}
@@ -81,25 +81,25 @@ int tsk_thread_create(tsk_thread_handle_t** handle, void *(TSK_STDCALL *start) (
*/
int tsk_thread_set_priority(tsk_thread_handle_t* handle, int32_t priority)
{
- if(!handle){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!handle) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
#if TSK_UNDER_WINDOWS
- {
- int ret = SetThreadPriority(handle, priority) ? 0 : -1;
+ {
+ int ret = SetThreadPriority(handle, priority) ? 0 : -1;
#if TSK_UNDER_WINDOWS_RT
- // It's not possible to set priority on WP8 when thread is not in suspended state -> do nothing and don't bother us
- if(ret){
- TSK_DEBUG_INFO("SetThreadPriority() failed but nothing to worry about");
- ret = 0;
- }
+ // It's not possible to set priority on WP8 when thread is not in suspended state -> do nothing and don't bother us
+ if(ret) {
+ TSK_DEBUG_INFO("SetThreadPriority() failed but nothing to worry about");
+ ret = 0;
+ }
#endif
- return ret;
- }
+ return ret;
+ }
#else
- struct sched_param sp;
- int ret;
+ struct sched_param sp;
+ int ret;
memset(&sp, 0, sizeof(struct sched_param));
sp.sched_priority = priority;
if ((ret = pthread_setschedparam(*((pthread_t*)handle), SCHED_OTHER, &sp))) {
@@ -115,82 +115,82 @@ int tsk_thread_set_priority(tsk_thread_handle_t* handle, int32_t priority)
int tsk_thread_set_priority_2(int32_t priority)
{
#if TSK_UNDER_WINDOWS
- TSK_DEBUG_ERROR("Not implemented");
- return -1;
+ TSK_DEBUG_ERROR("Not implemented");
+ return -1;
#else
- pthread_t thread = pthread_self();
- return tsk_thread_set_priority(&thread, priority);
+ pthread_t thread = pthread_self();
+ return tsk_thread_set_priority(&thread, priority);
#endif
}
tsk_thread_id_t tsk_thread_get_id()
{
#if TSK_UNDER_WINDOWS
- return GetCurrentThreadId();
+ return GetCurrentThreadId();
#else
- return pthread_self();
+ return pthread_self();
#endif
}
tsk_bool_t tsk_thread_id_equals(tsk_thread_id_t* id_1, tsk_thread_id_t *id_2)
{
- if(!id_1 || !id_2){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
+ if(!id_1 || !id_2) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
#if TSK_UNDER_WINDOWS
- return (*id_1 == *id_2);
+ return (*id_1 == *id_2);
#else
- return (pthread_equal(*id_1, *id_2) != 0);
+ return (pthread_equal(*id_1, *id_2) != 0);
#endif
}
/**@ingroup tsk_thread_group
* Join a thread.
* @param handle Pthread handle to the target thread.
-* @retval If successful, returns zero. Otherwise, an error number is returned to indicate the error.
+* @retval If successful, returns zero. Otherwise, an error number is returned to indicate the error.
*/
int tsk_thread_join(tsk_thread_handle_t** handle)
{
- int ret;
-
- if(!handle){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if(!*handle){
- TSK_DEBUG_WARN("Cannot join NULL handle");
- return 0;
- }
-
+ int ret;
+
+ if(!handle) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if(!*handle) {
+ TSK_DEBUG_WARN("Cannot join NULL handle");
+ return 0;
+ }
+
#if TSK_UNDER_WINDOWS
# if TSK_UNDER_WINDOWS_RT
- ret = (WaitForSingleObjectEx(*((HANDLE*)handle), INFINITE, TRUE) == WAIT_FAILED) ? -1 : 0;
+ ret = (WaitForSingleObjectEx(*((HANDLE*)handle), INFINITE, TRUE) == WAIT_FAILED) ? -1 : 0;
# else
- ret = (WaitForSingleObject(*((HANDLE*)handle), INFINITE) == WAIT_FAILED) ? -1 : 0;
+ ret = (WaitForSingleObject(*((HANDLE*)handle), INFINITE) == WAIT_FAILED) ? -1 : 0;
#endif
- if(ret == 0){
- ret = tsk_thread_destroy(handle);
- }
+ if(ret == 0) {
+ ret = tsk_thread_destroy(handle);
+ }
#else
- if((ret = pthread_join(*((pthread_t*)*handle), 0)) == 0){
- ret = tsk_thread_destroy(handle);
- }
+ if((ret = pthread_join(*((pthread_t*)*handle), 0)) == 0) {
+ ret = tsk_thread_destroy(handle);
+ }
#endif
- return ret;
+ return ret;
}
int tsk_thread_destroy(tsk_thread_handle_t** handle)
{
- if(handle && *handle){
+ if(handle && *handle) {
#if TSK_UNDER_WINDOWS
- CloseHandle(*((HANDLE*)handle));
- *handle = tsk_null;
+ CloseHandle(*((HANDLE*)handle));
+ *handle = tsk_null;
#else
- tsk_free(handle);
+ tsk_free(handle);
#endif
- }
- return 0;
+ }
+ return 0;
}
diff --git a/tinySAK/src/tsk_thread.h b/tinySAK/src/tsk_thread.h
index ebab601..e5d1361 100755
--- a/tinySAK/src/tsk_thread.h
+++ b/tinySAK/src/tsk_thread.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,7 +34,7 @@
typedef void tsk_thread_handle_t;
#if TSK_UNDER_WINDOWS
- typedef unsigned long tsk_thread_id_t;
+typedef unsigned long tsk_thread_id_t;
# define TSK_THREAD_PRIORITY_LOW THREAD_PRIORITY_LOWEST
# define TSK_THREAD_PRIORITY_MEDIUM THREAD_PRIORITY_NORMAL
# define TSK_THREAD_PRIORITY_HIGH THREAD_PRIORITY_HIGHEST
@@ -42,7 +42,7 @@ typedef void tsk_thread_handle_t;
#else
# include <pthread.h>
# include <sched.h>
- typedef pthread_t tsk_thread_id_t;
+typedef pthread_t tsk_thread_id_t;
# define TSK_THREAD_PRIORITY_LOW sched_get_priority_min(SCHED_OTHER)
# define TSK_THREAD_PRIORITY_TIME_CRITICAL sched_get_priority_max(SCHED_OTHER)
# define TSK_THREAD_PRIORITY_MEDIUM ((TSK_THREAD_PRIORITY_TIME_CRITICAL - TSK_THREAD_PRIORITY_LOW) >> 1)
diff --git a/tinySAK/src/tsk_time.c b/tinySAK/src/tsk_time.c
index 0f93df8..5202c29 100755
--- a/tinySAK/src/tsk_time.c
+++ b/tinySAK/src/tsk_time.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,7 +38,7 @@
# include <sys/time.h>
# endif
#elif defined(__SYMBIAN32__)
-# include <_timeval.h>
+# include <_timeval.h>
#else
# include <sys/time.h>
#endif
@@ -63,55 +63,53 @@
#endif
#if TSK_UNDER_WINDOWS_CE
-#endif
+#endif
-struct timezone
-{
- int tz_minuteswest; // minutes W of Greenwich
- int tz_dsttime; // type of dst correction
+struct timezone {
+ int tz_minuteswest; // minutes W of Greenwich
+ int tz_dsttime; // type of dst correction
};
-static int gettimeofday(struct timeval *tv, struct timezone *tz)
-{
- FILETIME ft;
- uint64_t tmpres = 0;
- static int tzflag = 0;
+static int gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ FILETIME ft;
+ uint64_t tmpres = 0;
+ static int tzflag = 0;
- if(tv)
- {
+ if(tv) {
#if TSK_UNDER_WINDOWS_CE
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, &ft);
+ SYSTEMTIME st;
+ GetSystemTime(&st);
+ SystemTimeToFileTime(&st, &ft);
#else
- GetSystemTimeAsFileTime(&ft);
+ GetSystemTimeAsFileTime(&ft);
#endif /* TSK_UNDER_WINDOWS_CE */
- tmpres |= ft.dwHighDateTime;
- tmpres <<= 32;
- tmpres |= ft.dwLowDateTime;
+ tmpres |= ft.dwHighDateTime;
+ tmpres <<= 32;
+ tmpres |= ft.dwLowDateTime;
- /*converting file time to unix epoch*/
- tmpres /= 10; /*convert into microseconds*/
- tmpres -= DELTA_EPOCH_IN_MICROSECS;
- tv->tv_sec = (long)(tmpres / 1000000UL);
- tv->tv_usec = (long)(tmpres % 1000000UL);
- }
+ /*converting file time to unix epoch*/
+ tmpres /= 10; /*convert into microseconds*/
+ tmpres -= DELTA_EPOCH_IN_MICROSECS;
+ tv->tv_sec = (long)(tmpres / 1000000UL);
+ tv->tv_usec = (long)(tmpres % 1000000UL);
+ }
#if !TSK_UNDER_WINDOWS_CE
- if (tz){
- if (!tzflag){
+ if (tz) {
+ if (!tzflag) {
#if !TSK_UNDER_WINDOWS_RT
- _tzset();
+ _tzset();
#endif /* TSK_UNDER_WINDOWS_RT */
- tzflag++;
- }
- tz->tz_minuteswest = _timezone / 60;
- tz->tz_dsttime = _daylight;
- }
+ tzflag++;
+ }
+ tz->tz_minuteswest = _timezone / 60;
+ tz->tz_dsttime = _daylight;
+ }
#endif /* TSK_UNDER_WINDOWS_CE */
- return 0;
+ return 0;
}
#else
@@ -121,7 +119,7 @@ static int gettimeofday(struct timeval *tv, struct timezone *tz)
#endif /* !HAVE_GETTIMEOFDAY */
/**@ingroup tsk_time_group
-* The tsk_gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since EPOCH (00:00:00 UTC on 1 January 1970).
+* The tsk_gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since EPOCH (00:00:00 UTC on 1 January 1970).
* The resolution of the system clock is unspecified.
* @param tv The current time, expressed as seconds and microseconds since EPOCH(00:00:00 UTC on 1 January 1970).
* @param tz The timezone.
@@ -129,16 +127,16 @@ static int gettimeofday(struct timeval *tv, struct timezone *tz)
*/
int tsk_gettimeofday(struct timeval *tv, struct timezone *tz)
{
- return gettimeofday(tv, tz);
+ return gettimeofday(tv, tz);
}
/**@ingroup tsk_time_group
*/
uint64_t tsk_gettimeofday_ms()
{
- struct timeval tv;
- tsk_gettimeofday(&tv, tsk_null);
- return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
+ struct timeval tv;
+ tsk_gettimeofday(&tv, tsk_null);
+ return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
}
/**@ingroup tsk_time_group
@@ -147,11 +145,11 @@ uint64_t tsk_gettimeofday_ms()
*/
uint64_t tsk_time_get_ms(const struct timeval* tv)
{
- if(!tv){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return (((uint64_t)tv->tv_sec)*(uint64_t)1000) + (((uint64_t)tv->tv_usec)/(uint64_t)1000);
+ if(!tv) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return (((uint64_t)tv->tv_sec)*(uint64_t)1000) + (((uint64_t)tv->tv_usec)/(uint64_t)1000);
}
/**@ingroup tsk_time_group
@@ -160,9 +158,9 @@ uint64_t tsk_time_get_ms(const struct timeval* tv)
*/
uint64_t tsk_time_epoch()
{
- struct timeval tv;
- gettimeofday(&tv, (struct timezone *)tsk_null);
- return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
+ struct timeval tv;
+ gettimeofday(&tv, (struct timezone *)tsk_null);
+ return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
}
// /!\ NOT CURRENT TIME
@@ -170,36 +168,36 @@ uint64_t tsk_time_epoch()
uint64_t tsk_time_now()
{
#if TSK_UNDER_WINDOWS
- static int __cpu_count = 0;
- if(__cpu_count == 0){
- SYSTEM_INFO SystemInfo;
+ static int __cpu_count = 0;
+ if(__cpu_count == 0) {
+ SYSTEM_INFO SystemInfo;
# if TSK_UNDER_WINDOWS_RT
- GetNativeSystemInfo(&SystemInfo);
+ GetNativeSystemInfo(&SystemInfo);
# else
- GetSystemInfo(&SystemInfo);
+ GetSystemInfo(&SystemInfo);
# endif
- __cpu_count = SystemInfo.dwNumberOfProcessors;
- }
- if(__cpu_count == 1){
- static LARGE_INTEGER __liFrequency = {0};
- LARGE_INTEGER liPerformanceCount;
- if(!__liFrequency.QuadPart){
- QueryPerformanceFrequency(&__liFrequency);
- }
- QueryPerformanceCounter(&liPerformanceCount);
- return (uint64_t)(((double)liPerformanceCount.QuadPart/(double)__liFrequency.QuadPart)*1000.0);
- }
- else{
+ __cpu_count = SystemInfo.dwNumberOfProcessors;
+ }
+ if(__cpu_count == 1) {
+ static LARGE_INTEGER __liFrequency = {0};
+ LARGE_INTEGER liPerformanceCount;
+ if(!__liFrequency.QuadPart) {
+ QueryPerformanceFrequency(&__liFrequency);
+ }
+ QueryPerformanceCounter(&liPerformanceCount);
+ return (uint64_t)(((double)liPerformanceCount.QuadPart/(double)__liFrequency.QuadPart)*1000.0);
+ }
+ else {
# if TSK_UNDER_WINDOWS_RT
- return tsk_time_epoch();
+ return tsk_time_epoch();
# else
- return timeGetTime();
+ return timeGetTime();
# endif
- }
+ }
#elif HAVE_CLOCK_GETTIME || _POSIX_TIMERS > 0
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- return (((uint64_t)ts.tv_sec)*(uint64_t)1000) + (((uint64_t)ts.tv_nsec)/(uint64_t)1000000);
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return (((uint64_t)ts.tv_sec)*(uint64_t)1000) + (((uint64_t)ts.tv_nsec)/(uint64_t)1000000);
#elif defined(__APPLE__)
static mach_timebase_info_data_t __apple_timebase_info = {0, 0};
if (__apple_timebase_info.denom == 0) {
@@ -207,39 +205,39 @@ uint64_t tsk_time_now()
}
return (uint64_t)((mach_absolute_time() * __apple_timebase_info.numer) / (1e+6 * __apple_timebase_info.denom));
#else
- struct timeval tv;
- gettimeofday(&tv, tsk_null);
- return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
+ struct timeval tv;
+ gettimeofday(&tv, tsk_null);
+ return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
#endif
}
// http://en.wikipedia.org/wiki/Network_Time_Protocol
uint64_t tsk_time_ntp()
{
- struct timeval tv;
- gettimeofday(&tv, (struct timezone *)tsk_null);
- return tsk_time_get_ntp_ms(&tv);
+ struct timeval tv;
+ gettimeofday(&tv, (struct timezone *)tsk_null);
+ return tsk_time_get_ntp_ms(&tv);
}
uint64_t tsk_time_get_ntp_ms(const struct timeval *tv)
{
- static const unsigned long __epoch = 2208988800UL;
- static const double __ntp_scale_frac = 4294967295.0;
+ static const unsigned long __epoch = 2208988800UL;
+ static const double __ntp_scale_frac = 4294967295.0;
- uint64_t tv_ntp;
- uint64_t tv_usecs;
+ uint64_t tv_ntp;
+ uint64_t tv_usecs;
- if(!tv){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!tv) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- tv_ntp = tv->tv_sec + __epoch;
+ tv_ntp = tv->tv_sec + __epoch;
#if 0 // ARM floating point calc issue (__aeabi_d2uiz)
- tv_usecs = (tv->tv_usec * 1e-6) * __ntp_scale_frac;
- return ((tv_ntp << 32) | (uint32_t)tv_usecs);
+ tv_usecs = (tv->tv_usec * 1e-6) * __ntp_scale_frac;
+ return ((tv_ntp << 32) | (uint32_t)tv_usecs);
#else
- tv_usecs = ((uint64_t)tv->tv_usec * (uint64_t)__ntp_scale_frac) / (uint64_t)1000000;
- return ((((uint64_t)tv_ntp) << 32) | (uint32_t)tv_usecs);
+ tv_usecs = ((uint64_t)tv->tv_usec * (uint64_t)__ntp_scale_frac) / (uint64_t)1000000;
+ return ((((uint64_t)tv_ntp) << 32) | (uint32_t)tv_usecs);
#endif
} \ No newline at end of file
diff --git a/tinySAK/src/tsk_time.h b/tinySAK/src/tsk_time.h
index 512d59e..9a1f051 100755
--- a/tinySAK/src/tsk_time.h
+++ b/tinySAK/src/tsk_time.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_timer.c b/tinySAK/src/tsk_timer.c
index f449675..fbdb989 100755
--- a/tinySAK/src/tsk_timer.c
+++ b/tinySAK/src/tsk_timer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,16 +52,15 @@
* @struct tsk_timer_s
* @brief Timer.
**/
-typedef struct tsk_timer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_timer_s {
+ TSK_DECLARE_OBJECT;
- tsk_timer_id_t id; /**< Unique timer identifier. */
- const void *arg; /**< Opaque data to return with the callback function. */
- uint64_t timeout; /**< When the timer will timeout(as EPOCH time). */
- tsk_timer_callback_f callback; /**< The callback function to call after @ref timeout milliseconds. */
+ tsk_timer_id_t id; /**< Unique timer identifier. */
+ const void *arg; /**< Opaque data to return with the callback function. */
+ uint64_t timeout; /**< When the timer will timeout(as EPOCH time). */
+ tsk_timer_callback_f callback; /**< The callback function to call after @ref timeout milliseconds. */
- unsigned canceled:1;
+ unsigned canceled:1;
}
tsk_timer_t;
typedef tsk_list_t tsk_timers_L_t; /**< List of @ref tsk_timer_t elements. */
@@ -71,22 +70,21 @@ typedef tsk_list_t tsk_timers_L_t; /**< List of @ref tsk_timer_t elements. */
*
* @brief Timer manager.
**/
-typedef struct tsk_timer_manager_s
-{
- TSK_DECLARE_RUNNABLE;
+typedef struct tsk_timer_manager_s {
+ TSK_DECLARE_RUNNABLE;
- void* mainThreadId[1];
- tsk_condwait_handle_t *condwait;
- tsk_mutex_handle_t *mutex;
- tsk_semaphore_handle_t *sem;
+ void* mainThreadId[1];
+ tsk_condwait_handle_t *condwait;
+ tsk_mutex_handle_t *mutex;
+ tsk_semaphore_handle_t *sem;
- tsk_timers_L_t *timers;
+ tsk_timers_L_t *timers;
}
tsk_timer_manager_t;
typedef tsk_list_t tsk_timer_manager_L_t; /**< List of @ref tsk_timer_manager_t elements. */
/*== Definitions */
-static void* TSK_STDCALL __tsk_timer_manager_mainthread(void *param);
+static void* TSK_STDCALL __tsk_timer_manager_mainthread(void *param);
static int __tsk_pred_find_timer_by_id(const tsk_list_item_t *item, const void *id);
static void __tsk_timer_manager_raise(tsk_timer_t *timer);
static void* TSK_STDCALL run(void* self);
@@ -95,7 +93,7 @@ static void* TSK_STDCALL run(void* self);
*/
tsk_timer_manager_handle_t* tsk_timer_manager_create()
{
- return tsk_object_new(tsk_timer_manager_def_t);
+ return tsk_object_new(tsk_timer_manager_def_t);
}
/**@ingroup tsk_timer_group
@@ -103,33 +101,33 @@ tsk_timer_manager_handle_t* tsk_timer_manager_create()
*/
int tsk_timer_manager_start(tsk_timer_manager_handle_t *self)
{
- int err = -1;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
-
- TSK_DEBUG_INFO("tsk_timer_manager_start");
-
- if(!manager){
- return -1;
- }
-
- tsk_mutex_lock(manager->mutex);
-
- if(!TSK_RUNNABLE(manager)->running && !TSK_RUNNABLE(manager)->started){
- TSK_RUNNABLE(manager)->run = run;
- if((err = tsk_runnable_start(TSK_RUNNABLE(manager), tsk_timer_def_t))){
- //TSK_OBJECT_SAFE_FREE(manager);
- goto bail;
- }
- }
- else{
- TSK_DEBUG_INFO("Timer manager already running");
- err = 0;
- }
+ int err = -1;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+
+ TSK_DEBUG_INFO("tsk_timer_manager_start");
+
+ if(!manager) {
+ return -1;
+ }
+
+ tsk_mutex_lock(manager->mutex);
+
+ if(!TSK_RUNNABLE(manager)->running && !TSK_RUNNABLE(manager)->started) {
+ TSK_RUNNABLE(manager)->run = run;
+ if((err = tsk_runnable_start(TSK_RUNNABLE(manager), tsk_timer_def_t))) {
+ //TSK_OBJECT_SAFE_FREE(manager);
+ goto bail;
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("Timer manager already running");
+ err = 0;
+ }
bail:
- tsk_mutex_unlock(manager->mutex);
+ tsk_mutex_unlock(manager->mutex);
- return err;
+ return err;
}
#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG)
@@ -137,20 +135,20 @@ bail:
*/
void tsk_timer_manager_debug(tsk_timer_manager_handle_t *self)
{
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
- if(manager){
- //int index = 0;
- tsk_list_item_t *item = tsk_null;
-
- tsk_mutex_lock(manager->mutex);
-
- tsk_list_foreach(item, manager->timers){
- tsk_timer_t* timer = (tsk_timer_t*)item->data;
- TSK_DEBUG_INFO("timer [%llu]- %llu, %llu", timer->id, timer->timeout, tsk_time_now());
- }
-
- tsk_mutex_unlock(manager->mutex);
- }
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+ if(manager) {
+ //int index = 0;
+ tsk_list_item_t *item = tsk_null;
+
+ tsk_mutex_lock(manager->mutex);
+
+ tsk_list_foreach(item, manager->timers) {
+ tsk_timer_t* timer = (tsk_timer_t*)item->data;
+ TSK_DEBUG_INFO("timer [%llu]- %llu, %llu", timer->id, timer->timeout, tsk_time_now());
+ }
+
+ tsk_mutex_unlock(manager->mutex);
+ }
}
#endif
@@ -158,203 +156,203 @@ void tsk_timer_manager_debug(tsk_timer_manager_handle_t *self)
*/
int tsk_timer_manager_stop(tsk_timer_manager_handle_t *self)
{
- int ret = -1;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
-
- if(!manager){
- TSK_DEBUG_ERROR("Invalid paramater");
- return -1;
- }
-
- // all functions called below are thread-safe ==> do not lock
- // "mainthread" uses manager->mutex and runs in a separate thread ==> deadlock
-
- if(TSK_RUNNABLE(manager)->running){
- if((ret = tsk_runnable_stop(TSK_RUNNABLE(manager)))){
- goto bail;
- }
-
- tsk_semaphore_increment(manager->sem);
- tsk_condwait_signal(manager->condwait);
-
- ret = tsk_thread_join(manager->mainThreadId);
- goto bail;
- }
- else{
- ret = 0; /* already running. */
- goto bail;
- }
+ int ret = -1;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid paramater");
+ return -1;
+ }
+
+ // all functions called below are thread-safe ==> do not lock
+ // "mainthread" uses manager->mutex and runs in a separate thread ==> deadlock
+
+ if(TSK_RUNNABLE(manager)->running) {
+ if((ret = tsk_runnable_stop(TSK_RUNNABLE(manager)))) {
+ goto bail;
+ }
+
+ tsk_semaphore_increment(manager->sem);
+ tsk_condwait_signal(manager->condwait);
+
+ ret = tsk_thread_join(manager->mainThreadId);
+ goto bail;
+ }
+ else {
+ ret = 0; /* already running. */
+ goto bail;
+ }
bail:
- tsk_list_clear_items(manager->timers);
- return ret;
+ tsk_list_clear_items(manager->timers);
+ return ret;
}
/**@ingroup tsk_timer_group
*/
tsk_timer_id_t tsk_timer_manager_schedule(tsk_timer_manager_handle_t *self, uint64_t timeout, tsk_timer_callback_f callback, const void *arg)
{
- tsk_timer_id_t timer_id = TSK_INVALID_TIMER_ID;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+ tsk_timer_id_t timer_id = TSK_INVALID_TIMER_ID;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
- if(manager && (TSK_RUNNABLE(manager)->running || TSK_RUNNABLE(manager)->started)){
- tsk_timer_t *timer;
+ if(manager && (TSK_RUNNABLE(manager)->running || TSK_RUNNABLE(manager)->started)) {
+ tsk_timer_t *timer;
- timer = (tsk_timer_t*)TSK_TIMER_CREATE(timeout, callback, arg);
- timer_id = timer->id;
- tsk_mutex_lock(manager->mutex);
- tsk_list_push_ascending_data(manager->timers, ((void**) &timer));
- tsk_mutex_unlock(manager->mutex);
-
- // tsk_timer_manager_debug(self);
+ timer = (tsk_timer_t*)TSK_TIMER_CREATE(timeout, callback, arg);
+ timer_id = timer->id;
+ tsk_mutex_lock(manager->mutex);
+ tsk_list_push_ascending_data(manager->timers, ((void**) &timer));
+ tsk_mutex_unlock(manager->mutex);
- tsk_condwait_signal(manager->condwait);
- tsk_semaphore_increment(manager->sem);
- }
+ // tsk_timer_manager_debug(self);
+
+ tsk_condwait_signal(manager->condwait);
+ tsk_semaphore_increment(manager->sem);
+ }
- return timer_id;
+ return timer_id;
}
/**@ingroup tsk_timer_group
*/
int tsk_timer_manager_cancel(tsk_timer_manager_handle_t *self, tsk_timer_id_t id)
{
- int ret = -1;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
-
- /* Check validity. */
- if(!TSK_TIMER_ID_IS_VALID(id)){ /* Very common. */
- return 0;
- }
-
- if(!TSK_LIST_IS_EMPTY(manager->timers) && TSK_RUNNABLE(manager)->running){
- const tsk_list_item_t *item;
- tsk_mutex_lock(manager->mutex);
- item = tsk_list_find_item_by_pred(manager->timers, __tsk_pred_find_timer_by_id, &id);
- if(item && item->data){
- tsk_timer_t *timer = (tsk_timer_t*)item->data;
- timer->canceled = 1;
- timer->callback = tsk_null;
-
- if(item == manager->timers->head){
- /* The timer we are waiting on ? ==> remove it now. */
- tsk_condwait_signal(manager->condwait);
- }
-
- ret = 0;
- }
- tsk_mutex_unlock(manager->mutex);
- }
- return ret;
+ int ret = -1;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+
+ /* Check validity. */
+ if(!TSK_TIMER_ID_IS_VALID(id)) { /* Very common. */
+ return 0;
+ }
+
+ if(!TSK_LIST_IS_EMPTY(manager->timers) && TSK_RUNNABLE(manager)->running) {
+ const tsk_list_item_t *item;
+ tsk_mutex_lock(manager->mutex);
+ item = tsk_list_find_item_by_pred(manager->timers, __tsk_pred_find_timer_by_id, &id);
+ if(item && item->data) {
+ tsk_timer_t *timer = (tsk_timer_t*)item->data;
+ timer->canceled = 1;
+ timer->callback = tsk_null;
+
+ if(item == manager->timers->head) {
+ /* The timer we are waiting on ? ==> remove it now. */
+ tsk_condwait_signal(manager->condwait);
+ }
+
+ ret = 0;
+ }
+ tsk_mutex_unlock(manager->mutex);
+ }
+ return ret;
}
int tsk_timer_manager_destroy(tsk_timer_manager_handle_t **self)
{
- if(!self || !*self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- TSK_OBJECT_SAFE_FREE(*self);
- return 0;
+ if(!self || !*self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ TSK_OBJECT_SAFE_FREE(*self);
+ return 0;
}
static void* TSK_STDCALL run(void* self)
{
- int ret;
- tsk_list_item_t *curr;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+ int ret;
+ tsk_list_item_t *curr;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
- TSK_RUNNABLE(manager)->running = tsk_true; // VERY IMPORTANT --> needed by the main thread
+ TSK_RUNNABLE(manager)->running = tsk_true; // VERY IMPORTANT --> needed by the main thread
- /* create main thread */
- if((ret = tsk_thread_create(&(manager->mainThreadId[0]), __tsk_timer_manager_mainthread, manager))){
- TSK_DEBUG_FATAL("Failed to create mainthread: %d\n", ret);
- return tsk_null;
- }
+ /* create main thread */
+ if((ret = tsk_thread_create(&(manager->mainThreadId[0]), __tsk_timer_manager_mainthread, manager))) {
+ TSK_DEBUG_FATAL("Failed to create mainthread: %d\n", ret);
+ return tsk_null;
+ }
- TSK_DEBUG_INFO("Timer manager run()::enter");
+ TSK_DEBUG_INFO("Timer manager run()::enter");
- TSK_RUNNABLE_RUN_BEGIN(manager);
+ TSK_RUNNABLE_RUN_BEGIN(manager);
- if((curr = TSK_RUNNABLE_POP_FIRST_SAFE(TSK_RUNNABLE(manager)))){
- tsk_timer_t *timer = (tsk_timer_t *)curr->data;
- if(timer->callback){
- timer->callback(timer->arg, timer->id);
- }
- tsk_object_unref(curr);
- }
+ if((curr = TSK_RUNNABLE_POP_FIRST_SAFE(TSK_RUNNABLE(manager)))) {
+ tsk_timer_t *timer = (tsk_timer_t *)curr->data;
+ if(timer->callback) {
+ timer->callback(timer->arg, timer->id);
+ }
+ tsk_object_unref(curr);
+ }
- TSK_RUNNABLE_RUN_END(manager);
+ TSK_RUNNABLE_RUN_END(manager);
- TSK_DEBUG_INFO("Timer manager run()::exit");
+ TSK_DEBUG_INFO("Timer manager run()::exit");
- return tsk_null;
+ return tsk_null;
}
static int __tsk_pred_find_timer_by_id(const tsk_list_item_t *item, const void *id)
{
- tsk_timer_t *timer;
- if(item && item->data){
- timer = (tsk_timer_t*)item->data;
- return (int)(timer->id - *((tsk_timer_id_t*)id));
- }
- return -1;
+ tsk_timer_t *timer;
+ if(item && item->data) {
+ timer = (tsk_timer_t*)item->data;
+ return (int)(timer->id - *((tsk_timer_id_t*)id));
+ }
+ return -1;
}
static void* TSK_STDCALL __tsk_timer_manager_mainthread(void *param)
{
- int ret;
- tsk_timer_t *curr;
- uint64_t now;
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)param;
+ int ret;
+ tsk_timer_t *curr;
+ uint64_t now;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)param;
- TSK_DEBUG_INFO("TIMER MANAGER -- START");
+ TSK_DEBUG_INFO("TIMER MANAGER -- START");
- while(TSK_RUNNABLE(manager)->running){
- tsk_semaphore_decrement(manager->sem);
+ while(TSK_RUNNABLE(manager)->running) {
+ tsk_semaphore_decrement(manager->sem);
peek_first:
- if(!TSK_RUNNABLE(manager)->running){
- break;
- }
-
- tsk_mutex_lock(manager->mutex);
- curr = TSK_TIMER_GET_FIRST();
- tsk_mutex_unlock(manager->mutex);
-
- if (curr && !curr->canceled) {
- now = tsk_time_now();
- if (now >= curr->timeout) {
- tsk_timer_t *timer = (tsk_timer_t*)tsk_object_ref(curr);
- //TSK_DEBUG_INFO("Timer raise %llu", timer->id);
-
- tsk_mutex_lock(manager->mutex); // must lock() before enqueue()
- TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(manager), timer);
- tsk_list_remove_item_by_data(manager->timers, curr);
- tsk_mutex_unlock(manager->mutex);
- TSK_OBJECT_SAFE_FREE(timer);
- }
- else{
- if((ret = tsk_condwait_timedwait(manager->condwait, (curr->timeout - now)))){
- TSK_DEBUG_ERROR("CONWAIT for timer manager failed [%d]", ret);
- break;
- }
- else{
- goto peek_first;
- }
- }
- }
- else if(curr) {
- tsk_mutex_lock(manager->mutex);
- /* TSK_DEBUG_INFO("Timer canceled %llu", curr->id); */
- tsk_list_remove_item_by_data(manager->timers, curr);
- tsk_mutex_unlock(manager->mutex);
- }
- } /* while() */
-
- TSK_DEBUG_INFO("TIMER MANAGER -- STOP");
-
- return tsk_null;
+ if(!TSK_RUNNABLE(manager)->running) {
+ break;
+ }
+
+ tsk_mutex_lock(manager->mutex);
+ curr = TSK_TIMER_GET_FIRST();
+ tsk_mutex_unlock(manager->mutex);
+
+ if (curr && !curr->canceled) {
+ now = tsk_time_now();
+ if (now >= curr->timeout) {
+ tsk_timer_t *timer = (tsk_timer_t*)tsk_object_ref(curr);
+ //TSK_DEBUG_INFO("Timer raise %llu", timer->id);
+
+ tsk_mutex_lock(manager->mutex); // must lock() before enqueue()
+ TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(manager), timer);
+ tsk_list_remove_item_by_data(manager->timers, curr);
+ tsk_mutex_unlock(manager->mutex);
+ TSK_OBJECT_SAFE_FREE(timer);
+ }
+ else {
+ if((ret = tsk_condwait_timedwait(manager->condwait, (curr->timeout - now)))) {
+ TSK_DEBUG_ERROR("CONWAIT for timer manager failed [%d]", ret);
+ break;
+ }
+ else {
+ goto peek_first;
+ }
+ }
+ }
+ else if(curr) {
+ tsk_mutex_lock(manager->mutex);
+ /* TSK_DEBUG_INFO("Timer canceled %llu", curr->id); */
+ tsk_list_remove_item_by_data(manager->timers, curr);
+ tsk_mutex_unlock(manager->mutex);
+ }
+ } /* while() */
+
+ TSK_DEBUG_INFO("TIMER MANAGER -- STOP");
+
+ return tsk_null;
}
@@ -367,26 +365,26 @@ static tsk_timer_manager_t* __timer_mgr = tsk_null;
tsk_timer_manager_handle_t* tsk_timer_mgr_global_ref()
{
- if(!__timer_mgr){
- __timer_mgr = (tsk_timer_manager_t*)tsk_timer_manager_create();
- }
- else{
- __timer_mgr = (tsk_timer_manager_t*)tsk_object_ref(__timer_mgr);
- }
- return __timer_mgr;
+ if(!__timer_mgr) {
+ __timer_mgr = (tsk_timer_manager_t*)tsk_timer_manager_create();
+ }
+ else {
+ __timer_mgr = (tsk_timer_manager_t*)tsk_object_ref(__timer_mgr);
+ }
+ return __timer_mgr;
}
int tsk_timer_mgr_global_start()
{
int ret = 0;
- if(!__timer_mgr){
- TSK_DEBUG_ERROR("No global Timer manager could be found");
- return -1;
+ if(!__timer_mgr) {
+ TSK_DEBUG_ERROR("No global Timer manager could be found");
+ return -1;
}
- if(!TSK_RUNNABLE(__timer_mgr)->running && !TSK_RUNNABLE(__timer_mgr)->started){
- if((ret = tsk_timer_manager_start(__timer_mgr))){
- return ret;
- }
+ if(!TSK_RUNNABLE(__timer_mgr)->running && !TSK_RUNNABLE(__timer_mgr)->started) {
+ if((ret = tsk_timer_manager_start(__timer_mgr))) {
+ return ret;
+ }
}
tsk_mutex_lock(__timer_mgr->mutex);
tsk_mutex_unlock(__timer_mgr->mutex);
@@ -395,34 +393,34 @@ int tsk_timer_mgr_global_start()
tsk_timer_id_t tsk_timer_mgr_global_schedule(uint64_t timeout, tsk_timer_callback_f callback, const void *arg)
{
- if(!__timer_mgr){
- TSK_DEBUG_ERROR("No global Timer manager could be found");
- return TSK_INVALID_TIMER_ID;
+ if(!__timer_mgr) {
+ TSK_DEBUG_ERROR("No global Timer manager could be found");
+ return TSK_INVALID_TIMER_ID;
}
return tsk_timer_manager_schedule(__timer_mgr, timeout, callback, arg);
}
int tsk_timer_mgr_global_cancel(tsk_timer_id_t id)
{
- if(!__timer_mgr){
- TSK_DEBUG_ERROR("No global Timer manager could be found");
- return -1;
+ if(!__timer_mgr) {
+ TSK_DEBUG_ERROR("No global Timer manager could be found");
+ return -1;
}
return tsk_timer_manager_cancel(__timer_mgr, id);
}
int tsk_timer_mgr_global_unref(tsk_timer_manager_handle_t** mgr_global)
{
- if(!mgr_global || !*mgr_global){
- return 0;
- }
- if((*mgr_global != __timer_mgr)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- __timer_mgr = (tsk_timer_manager_t*)tsk_object_unref(TSK_OBJECT(*mgr_global));
- *mgr_global = tsk_null;
- return 0;
+ if(!mgr_global || !*mgr_global) {
+ return 0;
+ }
+ if((*mgr_global != __timer_mgr)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ __timer_mgr = (tsk_timer_manager_t*)tsk_object_unref(TSK_OBJECT(*mgr_global));
+ *mgr_global = tsk_null;
+ return 0;
}
@@ -436,38 +434,37 @@ int tsk_timer_mgr_global_unref(tsk_timer_manager_handle_t** mgr_global)
//
static tsk_object_t* tsk_timer_manager_ctor(tsk_object_t * self, va_list * app)
{
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
- if(manager){
- manager->timers = tsk_list_create();
- manager->sem = tsk_semaphore_create();
- manager->condwait = tsk_condwait_create();
- manager->mutex = tsk_mutex_create();
- }
- return self;
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+ if(manager) {
+ manager->timers = tsk_list_create();
+ manager->sem = tsk_semaphore_create();
+ manager->condwait = tsk_condwait_create();
+ manager->mutex = tsk_mutex_create();
+ }
+ return self;
}
static tsk_object_t* tsk_timer_manager_dtor(tsk_object_t * self)
-{
- tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
-
- if(manager){
- tsk_timer_manager_stop(manager);
-
- tsk_semaphore_destroy(&manager->sem);
- tsk_condwait_destroy(&manager->condwait);
- tsk_mutex_destroy(&manager->mutex);
- TSK_OBJECT_SAFE_FREE(manager->timers);
- }
-
- return self;
+{
+ tsk_timer_manager_t *manager = (tsk_timer_manager_t*)self;
+
+ if(manager) {
+ tsk_timer_manager_stop(manager);
+
+ tsk_semaphore_destroy(&manager->sem);
+ tsk_condwait_destroy(&manager->condwait);
+ tsk_mutex_destroy(&manager->mutex);
+ TSK_OBJECT_SAFE_FREE(manager->timers);
+ }
+
+ return self;
}
-static const tsk_object_def_t tsk_timer_manager_def_s =
-{
- sizeof(tsk_timer_manager_t),
- tsk_timer_manager_ctor,
- tsk_timer_manager_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_timer_manager_def_s = {
+ sizeof(tsk_timer_manager_t),
+ tsk_timer_manager_ctor,
+ tsk_timer_manager_dtor,
+ tsk_null,
};
const tsk_object_def_t * tsk_timer_manager_def_t = &tsk_timer_manager_def_s;
@@ -481,47 +478,50 @@ const tsk_object_def_t * tsk_timer_manager_def_t = &tsk_timer_manager_def_s;
//
static tsk_object_t* tsk_timer_ctor(tsk_object_t * self, va_list * app)
{
- static volatile tsk_timer_id_t __tsk_unique_timer_id = 0;
- tsk_timer_t *timer = (tsk_timer_t*)self;
- if(timer){
- tsk_atomic_inc(&__tsk_unique_timer_id);
- timer->id = __tsk_unique_timer_id;
- timer->timeout = va_arg(*app, uint64_t);
- timer->callback = va_arg(*app, tsk_timer_callback_f);
- timer->arg = va_arg(*app, const void *);
-
- timer->timeout += tsk_time_now();
- }
- return self;
+ static volatile tsk_timer_id_t __tsk_unique_timer_id = 0;
+ tsk_timer_t *timer = (tsk_timer_t*)self;
+ if(timer) {
+ tsk_atomic_inc(&__tsk_unique_timer_id);
+ timer->id = __tsk_unique_timer_id;
+ timer->timeout = va_arg(*app, uint64_t);
+ timer->callback = va_arg(*app, tsk_timer_callback_f);
+ timer->arg = va_arg(*app, const void *);
+
+ timer->timeout += tsk_time_now();
+ }
+ return self;
}
static tsk_object_t* tsk_timer_dtor(tsk_object_t * self)
-{
- tsk_timer_t *timer = (tsk_timer_t*)self;
- if(timer){
- }
+{
+ tsk_timer_t *timer = (tsk_timer_t*)self;
+ if(timer) {
+ }
- return self;
+ return self;
}
static int tsk_timer_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tsk_timer_t *t1 = (const tsk_timer_t *)obj1;
- const tsk_timer_t *t2 = (const tsk_timer_t *)obj2;
-
- if(t1 && t2){
- return (int)(t1->timeout - t2->timeout);
- }
- else if(!t1 && !t2) return 0;
- else return -1;
+ const tsk_timer_t *t1 = (const tsk_timer_t *)obj1;
+ const tsk_timer_t *t2 = (const tsk_timer_t *)obj2;
+
+ if(t1 && t2) {
+ return (int)(t1->timeout - t2->timeout);
+ }
+ else if(!t1 && !t2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsk_timer_def_s =
-{
- sizeof(tsk_timer_t),
- tsk_timer_ctor,
- tsk_timer_dtor,
- tsk_timer_cmp,
+static const tsk_object_def_t tsk_timer_def_s = {
+ sizeof(tsk_timer_t),
+ tsk_timer_ctor,
+ tsk_timer_dtor,
+ tsk_timer_cmp,
};
const tsk_object_def_t * tsk_timer_def_t = &tsk_timer_def_s;
diff --git a/tinySAK/src/tsk_timer.h b/tinySAK/src/tsk_timer.h
index fe05d98..e79933f 100755
--- a/tinySAK/src/tsk_timer.h
+++ b/tinySAK/src/tsk_timer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_url.c b/tinySAK/src/tsk_url.c
index 8734ab6..cf4417b 100755
--- a/tinySAK/src/tsk_url.c
+++ b/tinySAK/src/tsk_url.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,22 +41,23 @@
* @sa tsk_url_decode
*
*/
-char* tsk_url_encode(const char* url) {
- char *purl = (char*)url, *buf = (char*)tsk_malloc(tsk_strlen(url) * 3 + 1), *pbuf = buf;
- while (*purl) {
- if (isalnum(*purl) || *purl == '-' || *purl == '_' || *purl == '.' || *purl == '~'){
- *pbuf++ = *purl;
- }
- else if (*purl == ' '){
- *pbuf++ = '+';
- }
- else{
- *pbuf++ = '%', *pbuf++ = tsk_b10tob16(*purl >> 4), *pbuf++ = tsk_b10tob16(*purl & 15);
- }
- purl++;
- }
- *pbuf = '\0';
- return buf;
+char* tsk_url_encode(const char* url)
+{
+ char *purl = (char*)url, *buf = (char*)tsk_malloc(tsk_strlen(url) * 3 + 1), *pbuf = buf;
+ while (*purl) {
+ if (isalnum(*purl) || *purl == '-' || *purl == '_' || *purl == '.' || *purl == '~') {
+ *pbuf++ = *purl;
+ }
+ else if (*purl == ' ') {
+ *pbuf++ = '+';
+ }
+ else {
+ *pbuf++ = '%', *pbuf++ = tsk_b10tob16(*purl >> 4), *pbuf++ = tsk_b10tob16(*purl & 15);
+ }
+ purl++;
+ }
+ *pbuf = '\0';
+ return buf;
}
/**@ingroup tsk_url_group
@@ -66,24 +67,25 @@ char* tsk_url_encode(const char* url) {
*
* @sa tsk_url_encode
*/
-char* tsk_url_decode(const char* url) {
- char *purl = (char*)url, *buf = (char*)tsk_malloc(tsk_strlen(url) + 1), *pbuf = buf;
- while (*purl) {
- if (*purl == '%') {
- if (purl[1] && purl[2]) {
- *pbuf++ = tsk_b16tob10(purl[1]) << 4 | tsk_b16tob10(purl[2]);
- purl += 2;
- }
- }
- else if (*purl == '+') {
- *pbuf++ = ' ';
- }
- else {
- *pbuf++ = *purl;
- }
- purl++;
- }
- *pbuf = '\0';
- return buf;
+char* tsk_url_decode(const char* url)
+{
+ char *purl = (char*)url, *buf = (char*)tsk_malloc(tsk_strlen(url) + 1), *pbuf = buf;
+ while (*purl) {
+ if (*purl == '%') {
+ if (purl[1] && purl[2]) {
+ *pbuf++ = tsk_b16tob10(purl[1]) << 4 | tsk_b16tob10(purl[2]);
+ purl += 2;
+ }
+ }
+ else if (*purl == '+') {
+ *pbuf++ = ' ';
+ }
+ else {
+ *pbuf++ = *purl;
+ }
+ purl++;
+ }
+ *pbuf = '\0';
+ return buf;
}
diff --git a/tinySAK/src/tsk_url.h b/tinySAK/src/tsk_url.h
index 7071613..3b88d77 100755
--- a/tinySAK/src/tsk_url.h
+++ b/tinySAK/src/tsk_url.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_uuid.c b/tinySAK/src/tsk_uuid.c
index 61fbe0c..fa5a8f1 100755
--- a/tinySAK/src/tsk_uuid.c
+++ b/tinySAK/src/tsk_uuid.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,49 +44,49 @@
*/
int tsk_uuidgenerate(tsk_uuidstring_t *result)
{
- /* From wikipedia
- * Version 5 UUIDs use a scheme with SHA-1 hashing, otherwise it is the same idea as in version 3.
- * RFC 4122 states that version 5 is preferred over version 3 name based UUIDs.
- * Note that the 160 bit SHA-1 hash is truncated to 128 bits to make the length work out.
- */
- tsk_sha1string_t sha1result;
- tsk_istr_t now;
- unsigned i, k;
- static char HEX[] = "0123456789abcdef";
+ /* From wikipedia
+ * Version 5 UUIDs use a scheme with SHA-1 hashing, otherwise it is the same idea as in version 3.
+ * RFC 4122 states that version 5 is preferred over version 3 name based UUIDs.
+ * Note that the 160 bit SHA-1 hash is truncated to 128 bits to make the length work out.
+ */
+ tsk_sha1string_t sha1result;
+ tsk_istr_t now;
+ unsigned i, k;
+ static char HEX[] = "0123456789abcdef";
- tsk_itoa(tsk_time_now(), &now);
- tsk_sha1compute(now, sizeof(now), &sha1result);
+ tsk_itoa(tsk_time_now(), &now);
+ tsk_sha1compute(now, sizeof(now), &sha1result);
- /* XOR the SHA-1 result with random numbers. */
- for(i=0; i<(TSK_UUID_DIGEST_SIZE*2); i+=4){
+ /* XOR the SHA-1 result with random numbers. */
+ for(i=0; i<(TSK_UUID_DIGEST_SIZE*2); i+=4) {
#if 0
- *((uint32_t*)&sha1result[i]) ^= rand();
+ *((uint32_t*)&sha1result[i]) ^= rand();
#else
- k = rand();
- sha1result[i] ^= k, sha1result[i + 1] ^= k,
- sha1result[i + 2] ^= k, sha1result[i + 3] ^= k;
+ k = rand();
+ sha1result[i] ^= k, sha1result[i + 1] ^= k,
+ sha1result[i + 2] ^= k, sha1result[i + 3] ^= k;
#endif
-
- for(k=0; k<sizeof(uint32_t); k++){
- sha1result[i+k] = HEX[sha1result[i+k] & 0x0F]; /* To hexa. */
- }
- }
- /* f47ac10b-58cc-4372-a567-0e02b2c3d479 */
- memcpy(&(*result)[0], &sha1result[0], 8);
- (*result)[8] = '-';
+ for(k=0; k<sizeof(uint32_t); k++) {
+ sha1result[i+k] = HEX[sha1result[i+k] & 0x0F]; /* To hexa. */
+ }
+ }
+
+ /* f47ac10b-58cc-4372-a567-0e02b2c3d479 */
+ memcpy(&(*result)[0], &sha1result[0], 8);
+ (*result)[8] = '-';
- memcpy(&(*result)[9], &sha1result[8], 4);
- (*result)[13] = '-';
+ memcpy(&(*result)[9], &sha1result[8], 4);
+ (*result)[13] = '-';
- memcpy(&(*result)[14], &sha1result[12], 4);
- (*result)[18] = '-';
+ memcpy(&(*result)[14], &sha1result[12], 4);
+ (*result)[18] = '-';
- memcpy(&(*result)[19], &sha1result[16], 4);
- (*result)[23] = '-';
+ memcpy(&(*result)[19], &sha1result[16], 4);
+ (*result)[23] = '-';
- memcpy(&(*result)[24], &sha1result[20], 12);
- (*result)[36] = '\0';
+ memcpy(&(*result)[24], &sha1result[20], 12);
+ (*result)[36] = '\0';
- return 0;
+ return 0;
}
diff --git a/tinySAK/src/tsk_uuid.h b/tinySAK/src/tsk_uuid.h
index 3ec300e..a196826 100755
--- a/tinySAK/src/tsk_uuid.h
+++ b/tinySAK/src/tsk_uuid.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/src/tsk_xml.c b/tinySAK/src/tsk_xml.c
index 2e581da..40089bb 100755
--- a/tinySAK/src/tsk_xml.c
+++ b/tinySAK/src/tsk_xml.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -80,13 +80,13 @@
*/
void tsk_xml_element_init_set(tsk_xml_element_t** element, const char* name, const char* value, tsk_xml_type_t type)
{
- TSK_XML_ELEMENT_CREATE((*element));
- (*element)->elements = TSK_LIST_CREATE();
- (*element)->attributes = TSK_LIST_CREATE();
- (*element)->namespaces = TSK_LIST_CREATE();
- (*element)->name = tsk_strdup(name);
- (*element)->value = tsk_strdup(value);
- (*element)->type = type;
+ TSK_XML_ELEMENT_CREATE((*element));
+ (*element)->elements = TSK_LIST_CREATE();
+ (*element)->attributes = TSK_LIST_CREATE();
+ (*element)->namespaces = TSK_LIST_CREATE();
+ (*element)->name = tsk_strdup(name);
+ (*element)->value = tsk_strdup(value);
+ (*element)->type = type;
}
/**@ingroup tsk_xml_group
@@ -135,14 +135,17 @@ void tsk_xml_element_init_set(tsk_xml_element_t** element, const char* name, con
*/
xmlNsPtr tsk_xml_get_namespace(xmlDocPtr docPtr, xmlNodePtr node, const char *href)
{
- xmlNs *ns = *xmlGetNsList(docPtr, node);
- while (ns)
- {
- if (tsk_striequals(ns->href, href)) return ns;
- else ns = ns->next;
- }
-
- return 0;
+ xmlNs *ns = *xmlGetNsList(docPtr, node);
+ while (ns) {
+ if (tsk_striequals(ns->href, href)) {
+ return ns;
+ }
+ else {
+ ns = ns->next;
+ }
+ }
+
+ return 0;
}
/**@ingroup tsk_xml_group
@@ -154,29 +157,37 @@ xmlNsPtr tsk_xml_get_namespace(xmlDocPtr docPtr, xmlNodePtr node, const char *hr
*/
xmlNodePtr tsk_xml_find_node(const xmlNodePtr curr, const char* name, tsk_xml_node_find_type_t ftype)
{
- xmlNodePtr node = curr;
-
- while(node)
- {
- switch(ftype)
- {
- case nft_none: return (tsk_striequals(node->name, name))? node : 0;
- case nft_children: node = node->children; break;
- case nft_parent: node = node->parent; break;
- case nft_next: node = node->next; break;
- case nft_prev: node = node->prev; break;
- default: return 0;
- } /* switch */
-
- /* check and return value if match */
- if( node && (!name || tsk_striequals(node->name, name)) )
- //if( node && (name == 0 || !tsk_stricmp((const char*)node->name, name)) )
- {
- return node;
- }
- }
-
- return 0;
+ xmlNodePtr node = curr;
+
+ while(node) {
+ switch(ftype) {
+ case nft_none:
+ return (tsk_striequals(node->name, name))? node : 0;
+ case nft_children:
+ node = node->children;
+ break;
+ case nft_parent:
+ node = node->parent;
+ break;
+ case nft_next:
+ node = node->next;
+ break;
+ case nft_prev:
+ node = node->prev;
+ break;
+ default:
+ return 0;
+ } /* switch */
+
+ /* check and return value if match */
+ if( node && (!name || tsk_striequals(node->name, name)) )
+ //if( node && (name == 0 || !tsk_stricmp((const char*)node->name, name)) )
+ {
+ return node;
+ }
+ }
+
+ return 0;
}
/**@ingroup tsk_xml_group
@@ -185,111 +196,114 @@ xmlNodePtr tsk_xml_find_node(const xmlNodePtr curr, const char* name, tsk_xml_no
*/
xmlNodePtr tsk_xml_select_node(const xmlNodePtr root, ...)
{
- va_list list;
- int step;
- char* root_name = 0;
- xmlNodePtr node = root;
-
- if(!node || !(node->name)) return 0;
-
- /* initialize variable arguments */
- va_start(list, root);
-
- while( node && (step=va_arg(list, tsk_xml_node_select_type_t)) != nst_end)
- {
- switch(step)
- {
- case nst_by_name:
- { /* name */
- const char* qname = va_arg(list, const char*);
- if(tsk_striequals(root->name, qname)){
- node = tsk_xml_find_node(node, 0, nft_children);
- }
- else{
- if(!tsk_striequals(node->name, qname))
- { /* do not match */
- node = tsk_xml_find_node(node, qname, nft_next);
- }
- else
- { /* already match */
- node = node->children;
- }
- }
- break;
- }
-
- case nst_content:
- { /**/
- node = tsk_xml_find_node(node, 0, nft_children);
- break;
- }
-
- case nst_att_value:
- { /* qname, att_name */
- xmlAttrPtr attrPtr = 0;
- int found = 0;
- const char* qname = va_arg(list, const char*);
- const char* att_name = va_arg(list, const char*);
- node = tsk_xml_find_node(node, qname, nft_none);
- while( node && !found )
- {
- attrPtr = node->properties;
- while(attrPtr)
- {
- if(attrPtr->type == XML_ATTRIBUTE_NODE && attrPtr->children)
- {
- if( tsk_striequals(attrPtr->name, att_name) ){
- node = attrPtr->children;
- found = 1;
- }
- }
- attrPtr = attrPtr->next;
- }
- if(!found) node = tsk_xml_find_node(node, 0, nft_next);
- }
- break;
- }
-
- case nst_by_att:
- { /* qname att_name att_value */
- xmlAttrPtr attrPtr = 0;
- int found = 0;
- const char* qname = va_arg(list, const char*);
- const char* att_name = va_arg(list, const char*);
- const char* att_value = va_arg(list, const char*);
- node = tsk_xml_find_node(node, qname, nft_none);
- while( node && !found )
- {
- attrPtr = node->properties;
- while(attrPtr)
- {
- if(attrPtr->type == XML_ATTRIBUTE_NODE && attrPtr->children)
- {
- if( tsk_striequals(attrPtr->name, att_name)
- && ( (attrPtr->children->content && tsk_striequals(attrPtr->children->content, att_value)) || !att_value )
- ){
- found = 1;
- }
- }
- attrPtr = attrPtr->next;
- }
- if(!found) node = tsk_xml_find_node(node, 0, nft_next);
- }
-
- if(found && node) break;
- else return 0;
-
- break;
- }
- default: return 0;
- } /* switch */
-
- /* skip all comments */
- TSK_XML_NODE_SKIP_COMMENTS(node);
-
- } /* while*/
-
- return node;
+ va_list list;
+ int step;
+ char* root_name = 0;
+ xmlNodePtr node = root;
+
+ if(!node || !(node->name)) {
+ return 0;
+ }
+
+ /* initialize variable arguments */
+ va_start(list, root);
+
+ while( node && (step=va_arg(list, tsk_xml_node_select_type_t)) != nst_end) {
+ switch(step) {
+ case nst_by_name: {
+ /* name */
+ const char* qname = va_arg(list, const char*);
+ if(tsk_striequals(root->name, qname)) {
+ node = tsk_xml_find_node(node, 0, nft_children);
+ }
+ else {
+ if(!tsk_striequals(node->name, qname)) {
+ /* do not match */
+ node = tsk_xml_find_node(node, qname, nft_next);
+ }
+ else {
+ /* already match */
+ node = node->children;
+ }
+ }
+ break;
+ }
+
+ case nst_content: {
+ /**/
+ node = tsk_xml_find_node(node, 0, nft_children);
+ break;
+ }
+
+ case nst_att_value: {
+ /* qname, att_name */
+ xmlAttrPtr attrPtr = 0;
+ int found = 0;
+ const char* qname = va_arg(list, const char*);
+ const char* att_name = va_arg(list, const char*);
+ node = tsk_xml_find_node(node, qname, nft_none);
+ while( node && !found ) {
+ attrPtr = node->properties;
+ while(attrPtr) {
+ if(attrPtr->type == XML_ATTRIBUTE_NODE && attrPtr->children) {
+ if( tsk_striequals(attrPtr->name, att_name) ) {
+ node = attrPtr->children;
+ found = 1;
+ }
+ }
+ attrPtr = attrPtr->next;
+ }
+ if(!found) {
+ node = tsk_xml_find_node(node, 0, nft_next);
+ }
+ }
+ break;
+ }
+
+ case nst_by_att: {
+ /* qname att_name att_value */
+ xmlAttrPtr attrPtr = 0;
+ int found = 0;
+ const char* qname = va_arg(list, const char*);
+ const char* att_name = va_arg(list, const char*);
+ const char* att_value = va_arg(list, const char*);
+ node = tsk_xml_find_node(node, qname, nft_none);
+ while( node && !found ) {
+ attrPtr = node->properties;
+ while(attrPtr) {
+ if(attrPtr->type == XML_ATTRIBUTE_NODE && attrPtr->children) {
+ if( tsk_striequals(attrPtr->name, att_name)
+ && ( (attrPtr->children->content && tsk_striequals(attrPtr->children->content, att_value)) || !att_value )
+ ) {
+ found = 1;
+ }
+ }
+ attrPtr = attrPtr->next;
+ }
+ if(!found) {
+ node = tsk_xml_find_node(node, 0, nft_next);
+ }
+ }
+
+ if(found && node) {
+ break;
+ }
+ else {
+ return 0;
+ }
+
+ break;
+ }
+ default:
+ return 0;
+ } /* switch */
+
+ /* skip all comments */
+ TSK_XML_NODE_SKIP_COMMENTS(node);
+
+ } /* while*/
+
+ return node;
}
#endif /* HAVE_LIBXML2_H */
diff --git a/tinySAK/src/tsk_xml.h b/tinySAK/src/tsk_xml.h
index 8af6fa3..aac3c59 100755
--- a/tinySAK/src/tsk_xml.h
+++ b/tinySAK/src/tsk_xml.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,7 +39,7 @@
#define TSK_XML_NODE_IS_TEXTVALUE(node) (node && node->type==XML_TEXT_NODE)
#define TSK_XML_NODE_SAFE_GET_TEXTVALUE(node) (const char*)(TSK_XML_NODE_IS_TEXTVALUE(node)?(node->content):0)
#define TSK_XML_NODE_SKIP_COMMENTS(node) while(node && (node->type==XML_COMMENT_NODE)) node = tsk_xml_find_node(node, 0, nft_next);
-
+
#define TSK_XML_NODE_SELECT_BY_NAME(qname) nst_by_name, qname
#define TSK_XML_NODE_SELECT_BY_ATT(qname, att_name, att_value) nst_by_att, qname, att_name, att_value
@@ -61,77 +61,71 @@
else tsk_strupdate(&result, "");
/** C and XML Schema mapping */
-typedef enum tsk_xml_type_e
-{
- xt_none,
- xt_string, /* xsd:string */
- xt_byte, /* xsd:byte */
- xt_unsignedByte, /* xsd:unsignedByte */
- xt_short, /* xsd:short */
- xt_unsignedShort, /* xsd:unsignedShort */
- xt_int, /* xsd:int */
- xt_unsignedInt, /* xsd:unsignedInt */
- xt_long, /* xsd:long */
- xt_boolean, /* xsd:boolean */
- xt_float, /* xsd:float */
- xt_double /* xsd:double */
+typedef enum tsk_xml_type_e {
+ xt_none,
+ xt_string, /* xsd:string */
+ xt_byte, /* xsd:byte */
+ xt_unsignedByte, /* xsd:unsignedByte */
+ xt_short, /* xsd:short */
+ xt_unsignedShort, /* xsd:unsignedShort */
+ xt_int, /* xsd:int */
+ xt_unsignedInt, /* xsd:unsignedInt */
+ xt_long, /* xsd:long */
+ xt_boolean, /* xsd:boolean */
+ xt_float, /* xsd:float */
+ xt_double /* xsd:double */
}
tsk_xml_type_t;
/** Node finding types */
-typedef enum tsk_xml_node_find_type_s
-{
- nft_none,
- nft_children,
- nft_parent,
- nft_next,
- nft_prev
+typedef enum tsk_xml_node_find_type_s {
+ nft_none,
+ nft_children,
+ nft_parent,
+ nft_next,
+ nft_prev
}
tsk_xml_node_find_type_t;
/** Element selection types */
-typedef enum tsk_xml_node_select_type_s
-{
- nst_by_name,
- nst_by_att,
- nst_att_value,
- nst_content,
- nst_end
+typedef enum tsk_xml_node_select_type_s {
+ nst_by_name,
+ nst_by_att,
+ nst_att_value,
+ nst_content,
+ nst_end
}
tsk_xml_node_select_type_t;
/** XML namespace */
-typedef struct tsk_xml_namespace_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_xml_namespace_s {
+ TSK_DECLARE_OBJECT;
- char* prefix;
- char* value;
+ char* prefix;
+ char* value;
}
tsk_xml_namespace_t;
/** XML attribute */
-typedef struct tsk_xml_attribute_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_xml_attribute_s {
+ TSK_DECLARE_OBJECT;
- char* name;
- void* value;
- tsk_xml_type_t type;
+ char* name;
+ void* value;
+ tsk_xml_type_t type;
}
tsk_xml_attribute_t;
/** XML element */
-typedef struct tsk_xml_element_s
-{
- TSK_DECLARE_OBJECT;
-
- char* name;
- void* value;
- tsk_list_t* elements;
- tsk_list_t* attributes;
- tsk_list_t* namespaces;
- tsk_xml_type_t type;
+typedef struct tsk_xml_element_s {
+ TSK_DECLARE_OBJECT;
+
+ char* name;
+ void* value;
+ tsk_list_t* elements;
+ tsk_list_t* attributes;
+ tsk_list_t* namespaces;
+ tsk_xml_type_t type;
}
tsk_xml_element_t;
diff --git a/tinySAK/test/stdafx.c b/tinySAK/test/stdafx.c
index a98e092..938920a 100755
--- a/tinySAK/test/stdafx.c
+++ b/tinySAK/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/test/stdafx.h b/tinySAK/test/stdafx.h
index 9b3fd7e..3112592 100755
--- a/tinySAK/test/stdafx.h
+++ b/tinySAK/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySAK/test/targetver.h b/tinySAK/test/targetver.h
index c205b20..c868b68 100755
--- a/tinySAK/test/targetver.h
+++ b/tinySAK/test/targetver.h
@@ -3,8 +3,8 @@
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinySAK/test/test.c b/tinySAK/test/test.c
index 0e77cc7..5f40941 100755
--- a/tinySAK/test/test.c
+++ b/tinySAK/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -142,148 +142,147 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- do
- {
- int y, x;
+ do {
+ int y, x;
- for(y = 0; y < 16; ++y){
- printf("{");
- for(x = 0; x < 16; ++x){
- printf("%d, ", (2 * ( y / 8 ) + ( x / 8 )));
- }
- printf("}\n");
- }
+ for(y = 0; y < 16; ++y) {
+ printf("{");
+ for(x = 0; x < 16; ++x) {
+ printf("%d, ", (2 * ( y / 8 ) + ( x / 8 )));
+ }
+ printf("}\n");
+ }
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 Mamadou Diop \n\n");
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 Mamadou Diop \n\n");
#if RUN_TEST_LISTS || RUN_TEST_ALL
- /* linked lists */
- test_basic_list();
- printf("\n\n");
- test_complex_list();
- printf("\n\n");
- test_filtered_list();
- printf("\n\n");
+ /* linked lists */
+ test_basic_list();
+ printf("\n\n");
+ test_complex_list();
+ printf("\n\n");
+ test_filtered_list();
+ printf("\n\n");
#endif
#if RUN_TEST_HEAP || RUN_TEST_ALL
- /* heap */
- test_heap();
- printf("\n\n");
+ /* heap */
+ test_heap();
+ printf("\n\n");
#endif
#if RUN_TEST_STRINGS || RUN_TEST_ALL
- /* strings */
- test_strings();
- printf("\n\n");
+ /* strings */
+ test_strings();
+ printf("\n\n");
#endif
#if RUN_TEST_URL || RUN_TEST_ALL
- /* url */
- test_url();
- printf("\n\n");
+ /* url */
+ test_url();
+ printf("\n\n");
#endif
#if RUN_TEST_THREADS || RUN_TEST_ALL
- /* threads */
- test_threads();
- printf("\n\n");
+ /* threads */
+ test_threads();
+ printf("\n\n");
#endif
#if RUN_TEST_MUTEX || RUN_TEST_ALL
- /* mutex */
- test_mutex();
- printf("\n\n");
+ /* mutex */
+ test_mutex();
+ printf("\n\n");
#endif
#if RUN_TEST_CONDWAIT || RUN_TEST_ALL
- /* condwait */
- test_condwait();
- printf("\n\n");
+ /* condwait */
+ test_condwait();
+ printf("\n\n");
#endif
#if RUN_TEST_SEMAPHORE || RUN_TEST_ALL
- /* semaphore */
- test_semaphore();
- printf("\n\n");
+ /* semaphore */
+ test_semaphore();
+ printf("\n\n");
#endif
#if RUN_TEST_SAFEOBJECT || RUN_TEST_ALL
- /* safe object */
- //test_safeobject();
- printf("\n\n");
+ /* safe object */
+ //test_safeobject();
+ printf("\n\n");
#endif
#if RUN_TEST_OBJECT || RUN_TEST_ALL
- /* object */
- //test_object();
- printf("\n\n");
+ /* object */
+ //test_object();
+ printf("\n\n");
#endif
#if RUN_TEST_PARAMS || RUN_TEST_ALL
- /* parameters */
- test_params();
- printf("\n\n");
+ /* parameters */
+ test_params();
+ printf("\n\n");
#endif
#if RUN_TEST_OPTIONS || RUN_TEST_ALL
- /* options */
- test_options();
- printf("\n\n");
+ /* options */
+ test_options();
+ printf("\n\n");
#endif
#if RUN_TEST_TIMER || RUN_TEST_ALL
- /* timer */
- test_timer();
- printf("\n\n");
+ /* timer */
+ test_timer();
+ printf("\n\n");
#endif
-
+
#if RUN_TEST_RUNNABLE || RUN_TEST_ALL
- /* test runnable. */
- test_runnable();
- printf("\n\n");
+ /* test runnable. */
+ test_runnable();
+ printf("\n\n");
#endif
#if RUN_TEST_BUFFER || RUN_TEST_ALL
- /* test buffer */
- test_buffer();
+ /* test buffer */
+ test_buffer();
#endif
#if RUN_TEST_MD5 || RUN_TEST_ALL
- /* test md5 and hmac_md5 */
- test_md5();
- test_hmac_md5();
+ /* test md5 and hmac_md5 */
+ test_md5();
+ test_hmac_md5();
#endif
#if RUN_TEST_SHA1 || RUN_TEST_ALL
- /* test sha1 and hmac_sha-1 */
- test_sha1();
- test_hmac_sha1();
+ /* test sha1 and hmac_sha-1 */
+ test_sha1();
+ test_hmac_sha1();
#endif
#if RUN_TEST_BASE64 || RUN_TEST_ALL
- /* test base64 encoding/decoding */
- test_base64();
+ /* test base64 encoding/decoding */
+ test_base64();
#endif
#if RUN_TEST_UUID || RUN_TEST_ALL
- /* test fake UUID (version5) */
- test_uuid();
+ /* test fake UUID (version5) */
+ test_uuid();
#endif
#if RUN_TEST_FSM || RUN_TEST_ALL
- /* test FSM */
- test_fsm();
+ /* test FSM */
+ test_fsm();
#endif
- }
- while(LOOP);
+ }
+ while(LOOP);
- getchar();
+ getchar();
- return 0;
+ return 0;
}
diff --git a/tinySAK/test/test_base64.h b/tinySAK/test/test_base64.h
index 0a8ac0b..124f59f 100755
--- a/tinySAK/test/test_base64.h
+++ b/tinySAK/test/test_base64.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,92 +22,90 @@
#ifndef _TEST_BASE64_H_
#define _TEST_BASE64_H_
-struct b64_msg
-{
- const char* ascii;
- const char* base64;
+struct b64_msg {
+ const char* ascii;
+ const char* base64;
};
-struct b64_msg b64_msgs[] =
-{
- { "", "" },
- { "f", "Zg==" },
- { "fo", "Zm8=" },
- { "foo", "Zm9v" },
- { "foob", "Zm9vYg==" },
- { "fooba", "Zm9vYmE=" },
- { "foobar", "Zm9vYmFy" },
- { "Aladdin:open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="},
- { "Doubango Project", "RG91YmFuZ28gUHJvamVjdA=="},
- { "Open Source Doubango Framework", "T3BlbiBTb3VyY2UgRG91YmFuZ28gRnJhbWV3b3Jr"},
- {
- "* Copyright (C) 2009 Mamadou Diop."
- "*"
- "* Contact: Mamadou Diop <diopmamadou(at)doubango.org>"
- "*"
- "* This file is part of Open Source Doubango Framework."
- "*"
- "* DOUBANGO 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 3 of the License, or"
- "* (at your option) any later version."
- "*"
- "* DOUBANGO 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 DOUBANGO."
- ,
- "KiBDb3B5cmlnaHQgKEMpIDIwMDkgTWFtYWRvdSBEaW9wLioqIENvbnRhY3Q6IE1hbW"
- "Fkb3UgRGlvcCA8ZGlvcG1hbWFkb3UoYXQpZG91YmFuZ28ub3JnPioqIFRoaXMgZmls"
- "ZSBpcyBwYXJ0IG9mIE9wZW4gU291cmNlIERvdWJhbmdvIEZyYW1ld29yay4qKiBET1"
- "VCQU5HTyBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBh"
- "bmQvb3IgbW9kaWZ5KiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcm"
- "FsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSogdGhlIEZyZWUgU29mdHdh"
- "cmUgRm91bmRhdGlvbiwgZWl0aGVyIHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3"
- "IqIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uKiogRE9VQkFOR08g"
- "aXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bC"
- "wqIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBs"
- "aWVkIHdhcnJhbnR5IG9mKiBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQS"
- "BQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlKiBHTlUgR2VuZXJhbCBQdWJsaWMg"
- "TGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLioqIFlvdSBzaG91bGQgaGF2ZSByZWNlaX"
- "ZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlKiBhbG9u"
- "ZyB3aXRoIERPVUJBTkdPLg=="
- }
+struct b64_msg b64_msgs[] = {
+ { "", "" },
+ { "f", "Zg==" },
+ { "fo", "Zm8=" },
+ { "foo", "Zm9v" },
+ { "foob", "Zm9vYg==" },
+ { "fooba", "Zm9vYmE=" },
+ { "foobar", "Zm9vYmFy" },
+ { "Aladdin:open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="},
+ { "Doubango Project", "RG91YmFuZ28gUHJvamVjdA=="},
+ { "Open Source Doubango Framework", "T3BlbiBTb3VyY2UgRG91YmFuZ28gRnJhbWV3b3Jr"},
+ {
+ "* Copyright (C) 2009 Mamadou Diop."
+ "*"
+ "* Contact: Mamadou Diop <diopmamadou(at)doubango.org>"
+ "*"
+ "* This file is part of Open Source Doubango Framework."
+ "*"
+ "* DOUBANGO 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 3 of the License, or"
+ "* (at your option) any later version."
+ "*"
+ "* DOUBANGO 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 DOUBANGO."
+ ,
+ "KiBDb3B5cmlnaHQgKEMpIDIwMDkgTWFtYWRvdSBEaW9wLioqIENvbnRhY3Q6IE1hbW"
+ "Fkb3UgRGlvcCA8ZGlvcG1hbWFkb3UoYXQpZG91YmFuZ28ub3JnPioqIFRoaXMgZmls"
+ "ZSBpcyBwYXJ0IG9mIE9wZW4gU291cmNlIERvdWJhbmdvIEZyYW1ld29yay4qKiBET1"
+ "VCQU5HTyBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBh"
+ "bmQvb3IgbW9kaWZ5KiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcm"
+ "FsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSogdGhlIEZyZWUgU29mdHdh"
+ "cmUgRm91bmRhdGlvbiwgZWl0aGVyIHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3"
+ "IqIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uKiogRE9VQkFOR08g"
+ "aXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bC"
+ "wqIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBs"
+ "aWVkIHdhcnJhbnR5IG9mKiBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQS"
+ "BQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlKiBHTlUgR2VuZXJhbCBQdWJsaWMg"
+ "TGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLioqIFlvdSBzaG91bGQgaGF2ZSByZWNlaX"
+ "ZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlKiBhbG9u"
+ "ZyB3aXRoIERPVUJBTkdPLg=="
+ }
};
void test_base64()
{
- size_t i, size;
- char *output_e = 0, *output_d = 0;
-
- for(i=0; i<sizeof(b64_msgs)/sizeof(struct b64_msg); i++){
- /*===========
- * Encoding
- */
- size = tsk_base64_encode((const uint8_t*)b64_msgs[i].ascii, strlen(b64_msgs[i].ascii), &output_e);
- if(tsk_striequals(b64_msgs[i].base64, output_e)){
- TSK_DEBUG_INFO("[BASE64-%d encoding] ==> OK", i);
- }
- else{
- TSK_DEBUG_INFO("[BASE64-%d encoding] ==> NOK", i);
- }
- TSK_FREE(output_e);
+ size_t i, size;
+ char *output_e = 0, *output_d = 0;
+
+ for(i=0; i<sizeof(b64_msgs)/sizeof(struct b64_msg); i++) {
+ /*===========
+ * Encoding
+ */
+ size = tsk_base64_encode((const uint8_t*)b64_msgs[i].ascii, strlen(b64_msgs[i].ascii), &output_e);
+ if(tsk_striequals(b64_msgs[i].base64, output_e)) {
+ TSK_DEBUG_INFO("[BASE64-%d encoding] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[BASE64-%d encoding] ==> NOK", i);
+ }
+ TSK_FREE(output_e);
- /*===========
- * Decoding
- */
- size = tsk_base64_decode((const uint8_t*)b64_msgs[i].base64, strlen(b64_msgs[i].base64), &output_d);
- if(tsk_striequals(b64_msgs[i].ascii, output_d)){
- TSK_DEBUG_INFO("[BASE64-%d decoding] ==> OK", i);
- }
- else{
- TSK_DEBUG_INFO("[BASE64-%d decoding] ==> NOK", i);
- }
- TSK_FREE(output_d);
- }
+ /*===========
+ * Decoding
+ */
+ size = tsk_base64_decode((const uint8_t*)b64_msgs[i].base64, strlen(b64_msgs[i].base64), &output_d);
+ if(tsk_striequals(b64_msgs[i].ascii, output_d)) {
+ TSK_DEBUG_INFO("[BASE64-%d decoding] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[BASE64-%d decoding] ==> NOK", i);
+ }
+ TSK_FREE(output_d);
+ }
}
#endif /* _TEST_BASE64_H_ */
diff --git a/tinySAK/test/test_buffer.h b/tinySAK/test/test_buffer.h
index 8940608..6207d1f 100755
--- a/tinySAK/test/test_buffer.h
+++ b/tinySAK/test/test_buffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,21 +24,21 @@
void test_buffer()
{
- tsk_buffer_t *buffer = tsk_buffer_create_null();
-
- tsk_buffer_append(buffer, "Diop", strlen("Diop"));
- tsk_buffer_append(buffer, " ", strlen(" "));
- tsk_buffer_append(buffer, "Mamadou", strlen("Mamadou"));
- tsk_buffer_append(buffer, "\r\n", strlen("\r\n"));
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
+
+ tsk_buffer_append(buffer, "Diop", strlen("Diop"));
+ tsk_buffer_append(buffer, " ", strlen(" "));
+ tsk_buffer_append(buffer, "Mamadou", strlen("Mamadou"));
+ tsk_buffer_append(buffer, "\r\n", strlen("\r\n"));
- printf("1. Buffer=%s", TSK_BUFFER_TO_STRING(buffer));
+ printf("1. Buffer=%s", TSK_BUFFER_TO_STRING(buffer));
- tsk_buffer_append_2(buffer, "val1=[%s] and val2=[%d]r\n", "value1", 12);
- tsk_buffer_append_2(buffer, "val3=[%s] and val4=[%s]r\n", "458888554778555LL", "1254852");
+ tsk_buffer_append_2(buffer, "val1=[%s] and val2=[%d]r\n", "value1", 12);
+ tsk_buffer_append_2(buffer, "val3=[%s] and val4=[%s]r\n", "458888554778555LL", "1254852");
- printf("2. Buffer=%s", TSK_BUFFER_TO_STRING(buffer));
+ printf("2. Buffer=%s", TSK_BUFFER_TO_STRING(buffer));
- TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(buffer);
}
#endif /* _TEST_BUFFER_H_ */
diff --git a/tinySAK/test/test_condwait.h b/tinySAK/test/test_condwait.h
index a28bf11..1f6f346 100755
--- a/tinySAK/test/test_condwait.h
+++ b/tinySAK/test/test_condwait.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,35 +24,35 @@
void *threadfunc_timed(void *parm)
{
- tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
- int ret = 0;
+ tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
+ int ret = 0;
- ret = tsk_condwait_timedwait(condwait, 10);
- printf("threadfunc_timed/// %d\n", ret);
+ ret = tsk_condwait_timedwait(condwait, 10);
+ printf("threadfunc_timed/// %d\n", ret);
- return 0;
+ return 0;
}
void *threadfunc_infinite(void *parm)
{
- tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
- int ret = 0;
+ tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
+ int ret = 0;
- ret = tsk_condwait_wait(condwait);
- printf("threadfunc_infinite/// %d\n", ret);
+ ret = tsk_condwait_wait(condwait);
+ printf("threadfunc_infinite/// %d\n", ret);
- return 0;
+ return 0;
}
void *threadfunc_onemore(void *parm)
{
- tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
- int ret = 0;
+ tsk_condwait_handle_t *condwait = (tsk_condwait_handle_t *)parm;
+ int ret = 0;
- ret = tsk_condwait_wait(condwait);
- printf("threadfunc_onemore/// %d\n", ret);
+ ret = tsk_condwait_wait(condwait);
+ printf("threadfunc_onemore/// %d\n", ret);
- return 0;
+ return 0;
}
@@ -60,27 +60,27 @@ void *threadfunc_onemore(void *parm)
/* Pthread condwait */
void test_condwait()
{
- tsk_condwait_handle_t *condwait = tsk_condwait_create();
- int ret;
- void* tid[3] = {0,0,0};
+ tsk_condwait_handle_t *condwait = tsk_condwait_create();
+ int ret;
+ void* tid[3] = {0,0,0};
- printf("test_condwait//\n");
+ printf("test_condwait//\n");
- tsk_thread_create(&tid[0], threadfunc_timed, condwait);
- tsk_thread_create(&tid[1], threadfunc_infinite, condwait);
- tsk_thread_create(&tid[2], threadfunc_onemore, condwait);
+ tsk_thread_create(&tid[0], threadfunc_timed, condwait);
+ tsk_thread_create(&tid[1], threadfunc_infinite, condwait);
+ tsk_thread_create(&tid[2], threadfunc_onemore, condwait);
- tsk_condwait_timedwait(condwait, 100); /* give the threads the time to start and 'threadfunc_timed' function to timeout */
+ tsk_condwait_timedwait(condwait, 100); /* give the threads the time to start and 'threadfunc_timed' function to timeout */
- ret = tsk_condwait_signal(condwait); /* Release one */
- ret = tsk_condwait_broadcast(condwait); /* Release all */
+ ret = tsk_condwait_signal(condwait); /* Release one */
+ ret = tsk_condwait_broadcast(condwait); /* Release all */
- tsk_thread_join(&tid[0]);
- tsk_thread_join(&tid[1]);
- tsk_thread_join(&tid[2]);
+ tsk_thread_join(&tid[0]);
+ tsk_thread_join(&tid[1]);
+ tsk_thread_join(&tid[2]);
- tsk_condwait_destroy(&condwait);
+ tsk_condwait_destroy(&condwait);
}
#endif /* _TEST_CONDWAIT_H_ */
diff --git a/tinySAK/test/test_fsm.h b/tinySAK/test/test_fsm.h
index 98cabc3..83d2dd2 100755
--- a/tinySAK/test/test_fsm.h
+++ b/tinySAK/test/test_fsm.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,289 +22,284 @@
#ifndef _TEST_FSM_H_
#define _TEST_FSM_H_
-typedef struct test_fsm_ctx_s
-{
- unsigned unsubscribing:1;
+typedef struct test_fsm_ctx_s {
+ unsigned unsubscribing:1;
}
test_fsm_ctx_t;
/* ======================== actions ======================== */
-typedef enum test_fsm_action_e
-{
- test_fsm_action_send,
- test_fsm_action_1xx,
- test_fsm_action_2xx,
- test_fsm_action_401_407_421_494,
- test_fsm_action_423,
- test_fsm_action_300_to_699,
- test_fsm_action_cancel,
- test_fsm_action_notify,
- test_fsm_action_unsubscribe,
- test_fsm_action_refresh,
- test_fsm_action_transporterror,
- test_fsm_action_error,
+typedef enum test_fsm_action_e {
+ test_fsm_action_send,
+ test_fsm_action_1xx,
+ test_fsm_action_2xx,
+ test_fsm_action_401_407_421_494,
+ test_fsm_action_423,
+ test_fsm_action_300_to_699,
+ test_fsm_action_cancel,
+ test_fsm_action_notify,
+ test_fsm_action_unsubscribe,
+ test_fsm_action_refresh,
+ test_fsm_action_transporterror,
+ test_fsm_action_error,
}
test_fsm_action_t;
/* ======================== execs ======================== */
int test_fsm_exec_Started_2_Trying_X_send(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Trying_X_1xx(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Terminated_X_2xx(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Connected_X_2xx(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Trying_X_401_407_421_494(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Trying_X_423(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Terminated_X_300_to_699(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Terminated_X_cancel(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Trying_2_Trying_X_NOTIFY(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Connected_2_Trying_X_unsubscribe(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Connected_2_Trying_X_refresh(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Connected_2_Connected_X_NOTIFY(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Connected_2_Terminated_X_NOTIFY(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Any_2_Trying_X_hangup(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Any_2_Terminated_X_transportError(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
int test_fsm_exec_Any_2_Terminated_X_Error(va_list *app)
{
- const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
- const void* message = va_arg(*app, const void *);
+ const test_fsm_ctx_t* ctx = va_arg(*app, const test_fsm_ctx_t *);
+ const void* message = va_arg(*app, const void *);
- return 0;
+ return 0;
}
/* ======================== conds ======================== */
int test_fsm_cond_unsubscribing(test_fsm_ctx_t* ctx, void* data)
{
- return ctx->unsubscribing ? 1 : 0;
+ return ctx->unsubscribing ? 1 : 0;
}
int test_fsm_cond_subscribing(test_fsm_ctx_t* ctx, void* data)
{
- return !test_fsm_cond_unsubscribing(ctx, data);
+ return !test_fsm_cond_unsubscribing(ctx, data);
}
int test_fsm_cond_notify_terminated(test_fsm_ctx_t* ctx, void* sipmessage)
{
- return 0;
+ return 0;
}
int test_fsm_cond_notify_not_terminated(test_fsm_ctx_t* ctx, void* sipmessage)
{
- return !test_fsm_cond_notify_terminated(ctx, sipmessage);
+ return !test_fsm_cond_notify_terminated(ctx, sipmessage);
}
-typedef enum test_fsm_state_e
-{
- __nil = 0,
- Started,
- Trying,
- Connected,
- Terminated
+typedef enum test_fsm_state_e {
+ __nil = 0,
+ Started,
+ Trying,
+ Connected,
+ Terminated
}
test_fsm_state_t;
int test_fsm_onterminated(const test_fsm_ctx_t* ctx)
{
- TSK_DEBUG_INFO("FSM in terminal state.");
- return 0;
+ TSK_DEBUG_INFO("FSM in terminal state.");
+ return 0;
}
#define TEST_FSM_ACTIONS_COUNT 5
-test_fsm_action_t test_fsm_tests[TEST_FSM_ACTIONS_COUNT][TEST_FSM_ACTIONS_COUNT] =
-{
- { test_fsm_action_send, test_fsm_action_300_to_699 },
- { test_fsm_action_send, test_fsm_action_401_407_421_494, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_300_to_699},
- { test_fsm_action_send, test_fsm_action_401_407_421_494, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_2xx},
- { test_fsm_action_send, test_fsm_action_2xx, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_2xx},
- { test_fsm_action_send, test_fsm_action_423, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_401_407_421_494},
+test_fsm_action_t test_fsm_tests[TEST_FSM_ACTIONS_COUNT][TEST_FSM_ACTIONS_COUNT] = {
+ { test_fsm_action_send, test_fsm_action_300_to_699 },
+ { test_fsm_action_send, test_fsm_action_401_407_421_494, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_300_to_699},
+ { test_fsm_action_send, test_fsm_action_401_407_421_494, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_2xx},
+ { test_fsm_action_send, test_fsm_action_2xx, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_2xx},
+ { test_fsm_action_send, test_fsm_action_423, test_fsm_action_2xx, test_fsm_action_refresh, test_fsm_action_401_407_421_494},
};
void test_fsm()
{
- size_t i;
-
- for(i=0; i<TEST_FSM_ACTIONS_COUNT; i++)
- {
- size_t j;
- tsk_fsm_t* fsm = tsk_fsm_create(Started, Terminated);
- test_fsm_ctx_t ctx;
- ctx.unsubscribing = 0;
-
- tsk_fsm_set_callback_terminated(fsm, test_fsm_onterminated, &ctx);
-
- tsk_fsm_set(fsm,
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, test_fsm_action_transporterror, Terminated, test_fsm_exec_Any_2_Terminated_X_transportError, "test_fsm_exec_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, test_fsm_action_error, Terminated, test_fsm_exec_Any_2_Terminated_X_Error, "test_fsm_exec_Any_2_Terminated_X_Error"),
- // Any -> (hangup) -> Terminated
- // Any -> (hangup) -> Trying
-
- /*=======================
- * === Started ===
- */
- // Started -> (Send) -> Trying
- TSK_FSM_ADD_ALWAYS(Started, test_fsm_action_send, Trying, test_fsm_exec_Started_2_Trying_X_send, "test_fsm_exec_Started_2_Trying_X_send"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(Started, "test_fsm_exec_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Trying ===
- */
- // Trying -> (1xx) -> Trying
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_1xx, Trying, test_fsm_exec_Trying_2_Trying_X_1xx, "test_fsm_exec_Trying_2_Trying_X_1xx"),
- // Trying -> (2xx) -> Terminated
- TSK_FSM_ADD(Trying, test_fsm_action_2xx, test_fsm_cond_unsubscribing, Terminated, test_fsm_exec_Trying_2_Terminated_X_2xx, "test_fsm_exec_Trying_2_Terminated_X_2xx"),
- // Trying -> (2xx) -> Connected
- TSK_FSM_ADD(Trying, test_fsm_action_2xx, test_fsm_cond_subscribing, Connected, test_fsm_exec_Trying_2_Connected_X_2xx, "test_fsm_exec_Trying_2_Connected_X_2xx"),
- // Trying -> (401/407/421/494) -> Trying
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_401_407_421_494, Trying, test_fsm_exec_Trying_2_Trying_X_401_407_421_494, "test_fsm_exec_Trying_2_Trying_X_401_407_421_494"),
- // Trying -> (423) -> Trying
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_423, Trying, test_fsm_exec_Trying_2_Trying_X_423, "test_fsm_exec_Trying_2_Trying_X_423"),
- // Trying -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_300_to_699, Terminated, test_fsm_exec_Trying_2_Terminated_X_300_to_699, "test_fsm_exec_Trying_2_Terminated_X_300_to_699"),
- // Trying -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_cancel, Terminated, test_fsm_exec_Trying_2_Terminated_X_cancel, "test_fsm_exec_Trying_2_Terminated_X_cancel"),
- // Trying -> (Notify) -> Trying
- TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_notify, Trying, test_fsm_exec_Trying_2_Trying_X_NOTIFY, "test_fsm_exec_Trying_2_Trying_X_NOTIFY"),
- // Trying -> (Any) -> Trying
- TSK_FSM_ADD_ALWAYS_NOTHING(Trying, "test_fsm_exec_Trying_2_Trying_X_any"),
-
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (unsubscribe) -> Trying
- TSK_FSM_ADD_ALWAYS(Connected, test_fsm_action_unsubscribe, Trying, test_fsm_exec_Connected_2_Trying_X_unsubscribe, "test_fsm_exec_Connected_2_Trying_X_unsubscribe"),
- // Connected -> (refresh) -> Trying
- TSK_FSM_ADD_ALWAYS(Connected, test_fsm_action_refresh, Trying, test_fsm_exec_Connected_2_Trying_X_refresh, "test_fsm_exec_Connected_2_Trying_X_refresh"),
- // Connected -> (NOTIFY) -> Connected
- TSK_FSM_ADD(Connected, test_fsm_action_notify, test_fsm_cond_notify_not_terminated, Connected, test_fsm_exec_Connected_2_Connected_X_NOTIFY, "test_fsm_exec_Connected_2_Connected_X_NOTIFY"),
- // Connected -> (NOTIFY) -> Terminated
- TSK_FSM_ADD(Connected, test_fsm_action_notify, test_fsm_cond_notify_terminated, Terminated, test_fsm_exec_Connected_2_Terminated_X_NOTIFY, "test_fsm_exec_Connected_2_Terminated_X_NOTIFY"),
- // Connected -> (Any) -> Connected
- TSK_FSM_ADD_ALWAYS_NOTHING(Connected, "test_fsm_exec_Connected_2_Connected_X_any"),
-
- TSK_FSM_ADD_NULL());
-
-
- for(j=0; j<TEST_FSM_ACTIONS_COUNT; j++){
- tsk_fsm_act(fsm, test_fsm_tests[i][j], &ctx, tsk_null, &ctx, tsk_null /*message*/);
- }
-
- TSK_OBJECT_SAFE_FREE(fsm);
-
- printf("\n\n");
- }
+ size_t i;
+
+ for(i=0; i<TEST_FSM_ACTIONS_COUNT; i++) {
+ size_t j;
+ tsk_fsm_t* fsm = tsk_fsm_create(Started, Terminated);
+ test_fsm_ctx_t ctx;
+ ctx.unsubscribing = 0;
+
+ tsk_fsm_set_callback_terminated(fsm, test_fsm_onterminated, &ctx);
+
+ tsk_fsm_set(fsm,
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, test_fsm_action_transporterror, Terminated, test_fsm_exec_Any_2_Terminated_X_transportError, "test_fsm_exec_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, test_fsm_action_error, Terminated, test_fsm_exec_Any_2_Terminated_X_Error, "test_fsm_exec_Any_2_Terminated_X_Error"),
+ // Any -> (hangup) -> Terminated
+ // Any -> (hangup) -> Trying
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Send) -> Trying
+ TSK_FSM_ADD_ALWAYS(Started, test_fsm_action_send, Trying, test_fsm_exec_Started_2_Trying_X_send, "test_fsm_exec_Started_2_Trying_X_send"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(Started, "test_fsm_exec_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Trying ===
+ */
+ // Trying -> (1xx) -> Trying
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_1xx, Trying, test_fsm_exec_Trying_2_Trying_X_1xx, "test_fsm_exec_Trying_2_Trying_X_1xx"),
+ // Trying -> (2xx) -> Terminated
+ TSK_FSM_ADD(Trying, test_fsm_action_2xx, test_fsm_cond_unsubscribing, Terminated, test_fsm_exec_Trying_2_Terminated_X_2xx, "test_fsm_exec_Trying_2_Terminated_X_2xx"),
+ // Trying -> (2xx) -> Connected
+ TSK_FSM_ADD(Trying, test_fsm_action_2xx, test_fsm_cond_subscribing, Connected, test_fsm_exec_Trying_2_Connected_X_2xx, "test_fsm_exec_Trying_2_Connected_X_2xx"),
+ // Trying -> (401/407/421/494) -> Trying
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_401_407_421_494, Trying, test_fsm_exec_Trying_2_Trying_X_401_407_421_494, "test_fsm_exec_Trying_2_Trying_X_401_407_421_494"),
+ // Trying -> (423) -> Trying
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_423, Trying, test_fsm_exec_Trying_2_Trying_X_423, "test_fsm_exec_Trying_2_Trying_X_423"),
+ // Trying -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_300_to_699, Terminated, test_fsm_exec_Trying_2_Terminated_X_300_to_699, "test_fsm_exec_Trying_2_Terminated_X_300_to_699"),
+ // Trying -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_cancel, Terminated, test_fsm_exec_Trying_2_Terminated_X_cancel, "test_fsm_exec_Trying_2_Terminated_X_cancel"),
+ // Trying -> (Notify) -> Trying
+ TSK_FSM_ADD_ALWAYS(Trying, test_fsm_action_notify, Trying, test_fsm_exec_Trying_2_Trying_X_NOTIFY, "test_fsm_exec_Trying_2_Trying_X_NOTIFY"),
+ // Trying -> (Any) -> Trying
+ TSK_FSM_ADD_ALWAYS_NOTHING(Trying, "test_fsm_exec_Trying_2_Trying_X_any"),
+
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (unsubscribe) -> Trying
+ TSK_FSM_ADD_ALWAYS(Connected, test_fsm_action_unsubscribe, Trying, test_fsm_exec_Connected_2_Trying_X_unsubscribe, "test_fsm_exec_Connected_2_Trying_X_unsubscribe"),
+ // Connected -> (refresh) -> Trying
+ TSK_FSM_ADD_ALWAYS(Connected, test_fsm_action_refresh, Trying, test_fsm_exec_Connected_2_Trying_X_refresh, "test_fsm_exec_Connected_2_Trying_X_refresh"),
+ // Connected -> (NOTIFY) -> Connected
+ TSK_FSM_ADD(Connected, test_fsm_action_notify, test_fsm_cond_notify_not_terminated, Connected, test_fsm_exec_Connected_2_Connected_X_NOTIFY, "test_fsm_exec_Connected_2_Connected_X_NOTIFY"),
+ // Connected -> (NOTIFY) -> Terminated
+ TSK_FSM_ADD(Connected, test_fsm_action_notify, test_fsm_cond_notify_terminated, Terminated, test_fsm_exec_Connected_2_Terminated_X_NOTIFY, "test_fsm_exec_Connected_2_Terminated_X_NOTIFY"),
+ // Connected -> (Any) -> Connected
+ TSK_FSM_ADD_ALWAYS_NOTHING(Connected, "test_fsm_exec_Connected_2_Connected_X_any"),
+
+ TSK_FSM_ADD_NULL());
+
+
+ for(j=0; j<TEST_FSM_ACTIONS_COUNT; j++) {
+ tsk_fsm_act(fsm, test_fsm_tests[i][j], &ctx, tsk_null, &ctx, tsk_null /*message*/);
+ }
+
+ TSK_OBJECT_SAFE_FREE(fsm);
+
+ printf("\n\n");
+ }
}
#endif /* _TEST_FSM_H_ */
diff --git a/tinySAK/test/test_heap.h b/tinySAK/test/test_heap.h
index edae766..b648457 100755
--- a/tinySAK/test/test_heap.h
+++ b/tinySAK/test/test_heap.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -26,52 +26,52 @@
/* test heap*/
void test_heap()
{
- //int i = 0;
- //tsk_heap_t heap;
+ //int i = 0;
+ //tsk_heap_t heap;
- ///* initialize our memory heap */
- //tsk_heap_init(&heap);
+ ///* initialize our memory heap */
+ //tsk_heap_init(&heap);
- ///* heap(1): Ten strings are allocated an all freed when we cleanup the heap */
- //for(i=0; i<10;i++)
- //{
- // char* test = tsk_strdup(&heap, "testing the heap (1)");
- //}
- //tsk_heap_cleanup(&heap);
+ ///* heap(1): Ten strings are allocated an all freed when we cleanup the heap */
+ //for(i=0; i<10;i++)
+ //{
+ // char* test = tsk_strdup(&heap, "testing the heap (1)");
+ //}
+ //tsk_heap_cleanup(&heap);
- ///* heap(2): pop memory from the heap*/
- //{
- // char* test = tsk_strdup(&heap, "testing the heap (2)");
- // tsk_free(&heap, (void**)&test);
+ ///* heap(2): pop memory from the heap*/
+ //{
+// char* test = tsk_strdup(&heap, "testing the heap (2)");
+ // tsk_free(&heap, (void**)&test);
- // test = tsk_calloc(&heap, 10, 1);
- // tsk_free(&heap, (void**)&test);
+ // test = tsk_calloc(&heap, 10, 1);
+ // tsk_free(&heap, (void**)&test);
- // test = tsk_malloc(&heap, 10);
- // tsk_free(&heap, (void**)&test);
+ // test = tsk_malloc(&heap, 10);
+ // tsk_free(&heap, (void**)&test);
- // test = tsk_malloc(&heap, 10);
- // test = tsk_realloc(&heap, test, 100);
- // tsk_free(&heap, (void**)&test);
- //}
- //
- ///* heap(3): pop a NULL pointer */
- //{
- // tsk_free(&heap, 0);
- //}
+ // test = tsk_malloc(&heap, 10);
+ // test = tsk_realloc(&heap, test, 100);
+ // tsk_free(&heap, (void**)&test);
+ //}
+ //
+ ///* heap(3): pop a NULL pointer */
+ //{
+ // tsk_free(&heap, 0);
+ //}
- ///* heap(4): allocate and pop from NULL heap */
- //{
- // char* test = tsk_calloc(0, 10, 1);
- // tsk_free(0, (void**)&test);
+ ///* heap(4): allocate and pop from NULL heap */
+ //{
+ // char* test = tsk_calloc(0, 10, 1);
+ // tsk_free(0, (void**)&test);
- // test = tsk_malloc(0, 10);
- // tsk_free(0, (void**)&test);
+ // test = tsk_malloc(0, 10);
+ // tsk_free(0, (void**)&test);
- // test = tsk_malloc(0, 10);
- // test = tsk_realloc(0, test, 100);
- // tsk_free(0, (void**)&test);
- //}
+ // test = tsk_malloc(0, 10);
+ // test = tsk_realloc(0, test, 100);
+ // tsk_free(0, (void**)&test);
+ //}
}
#endif /* _TEST_HEAP_H_ */
diff --git a/tinySAK/test/test_lists.h b/tinySAK/test/test_lists.h
index c02b2a7..3b6a0f0 100755
--- a/tinySAK/test/test_lists.h
+++ b/tinySAK/test/test_lists.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,248 +24,244 @@
// (well-defined object declaration)
-typedef struct student_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct student_s {
+ TSK_DECLARE_OBJECT;
- char *id;
- char *name;
-}
+ char *id;
+ char *name;
+}
student_t;
// (constructor)
static tsk_object_t* student_ctor(tsk_object_t* self, va_list * app)
{
- student_t* student = (tsk_object_t*)self;
- if(student){
- }
- return self;
+ student_t* student = (tsk_object_t*)self;
+ if(student) {
+ }
+ return self;
}
// (destructor)
static tsk_object_t* student_dtor(tsk_object_t* self)
{
- student_t* student = (tsk_object_t*)self;
- TSK_FREE(student->id);
- TSK_FREE(student->name);
- return self;
+ student_t* student = (tsk_object_t*)self;
+ TSK_FREE(student->id);
+ TSK_FREE(student->name);
+ return self;
}
// (case insensitive comparator)
static int student_icmp(const tsk_object_t *self, const tsk_object_t *object)
-{
- const student_t* student1 = (const tsk_object_t*)self;
- const student_t* student2 = (const tsk_object_t*)object;
+{
+ const student_t* student1 = (const tsk_object_t*)self;
+ const student_t* student2 = (const tsk_object_t*)object;
- if(!student1 || !student2){
- return 0;// must never happen
- }
+ if(!student1 || !student2) {
+ return 0;// must never happen
+ }
- return tsk_stricmp(student1->id, student2->id);
+ return tsk_stricmp(student1->id, student2->id);
}
// (well-defined object declaration)
-static const tsk_object_def_t student_def_s =
-{
- sizeof(student_t),
- student_ctor,
- student_dtor,
- student_icmp
+static const tsk_object_def_t student_def_s = {
+ sizeof(student_t),
+ student_ctor,
+ student_dtor,
+ student_icmp
};
// create a stun object
static student_t* student_create(const char* id, const char* name)
{
- student_t* student;
- if((student = (student_t*)tsk_object_new(&student_def_s))){
- student->id = tsk_strdup(id);
- student->name = tsk_strdup(name);
- }
- return student;
+ student_t* student;
+ if((student = (student_t*)tsk_object_new(&student_def_s))) {
+ student->id = tsk_strdup(id);
+ student->name = tsk_strdup(name);
+ }
+ return student;
}
// predicate function to find a student by name
static int pred_find_student_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data){
- student_t *student = item->data;
- return tsk_striequals(student->name, name);
- }
- return -1;
+ if(item && item->data) {
+ student_t *student = item->data;
+ return tsk_striequals(student->name, name);
+ }
+ return -1;
}
// predicate function to find a student by id
static int pred_find_student_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data){
- student_t *student = item->data;
- return tsk_striequals(student->id, id);
- }
- return -1;
+ if(item && item->data) {
+ student_t *student = item->data;
+ return tsk_striequals(student->id, id);
+ }
+ return -1;
}
/* testing basic linked list */
void test_basic_list()
{
- tsk_list_t *list = tsk_list_create();
- tsk_list_item_t *item = tsk_list_item_create();
-
- /* add items to the list */
- item->data = tsk_string_create("First item");
- tsk_list_push_front_item(list, &item);
+ tsk_list_t *list = tsk_list_create();
+ tsk_list_item_t *item = tsk_list_item_create();
+
+ /* add items to the list */
+ item->data = tsk_string_create("First item");
+ tsk_list_push_front_item(list, &item);
- item = tsk_list_item_create();
- item->data = tsk_string_create("Second item");
- tsk_list_push_back_item(list, &item);
+ item = tsk_list_item_create();
+ item->data = tsk_string_create("Second item");
+ tsk_list_push_back_item(list, &item);
- item = tsk_list_item_create();
- item->data = tsk_string_create("Third item");
- tsk_list_push_front_item(list, &item);
+ item = tsk_list_item_create();
+ item->data = tsk_string_create("Third item");
+ tsk_list_push_front_item(list, &item);
- item = tsk_list_item_create();
- item->data = tsk_string_create("Fourth item");
- tsk_list_push_back_item(list, &item);
+ item = tsk_list_item_create();
+ item->data = tsk_string_create("Fourth item");
+ tsk_list_push_back_item(list, &item);
- /* dump all items */
- tsk_list_foreach(item, list){
- tsk_string_t* item_data = ((tsk_string_t*)item->data);
- printf("test_basic_list/// --> [%s]\n", item_data->value);
- }
+ /* dump all items */
+ tsk_list_foreach(item, list) {
+ tsk_string_t* item_data = ((tsk_string_t*)item->data);
+ printf("test_basic_list/// --> [%s]\n", item_data->value);
+ }
- tsk_list_remove_item(list, list->tail);
- tsk_list_remove_item(list, list->tail);
- tsk_list_remove_item(list, list->tail);
- tsk_list_remove_item(list, list->tail);
+ tsk_list_remove_item(list, list->tail);
+ tsk_list_remove_item(list, list->tail);
+ tsk_list_remove_item(list, list->tail);
+ tsk_list_remove_item(list, list->tail);
- /* delete all items in the list */
- TSK_OBJECT_SAFE_FREE(list);
+ /* delete all items in the list */
+ TSK_OBJECT_SAFE_FREE(list);
}
void test_filtered_list()
{
- tsk_list_t *list = tsk_list_create();
- tsk_list_item_t *item = 0;
+ tsk_list_t *list = tsk_list_create();
+ tsk_list_item_t *item = 0;
- /* add items to the list */
- {
- student_t *student2 = student_create("2", "student2");
- tsk_list_push_ascending_data(list, ((void**) &student2));
- }
- {
- student_t *student6 = student_create("6", "student6");
- tsk_list_push_ascending_data(list, ((void**) &student6));
- }
- {
- student_t *student1 = student_create("1", "student1");
- tsk_list_push_ascending_data(list, ((void**) &student1));
- }
- {
- student_t *student6 = student_create("6", "student6");
- tsk_list_push_ascending_data(list, ((void**) &student6));
- }
- {
- student_t *student6 = student_create("6", "student6");
- tsk_list_push_ascending_data(list, ((void**) &student6));
- }
- {
- student_t *student2 = student_create("2", "student2");
- tsk_list_push_ascending_data(list, ((void**) &student2));
- }
- {
- student_t *student2 = student_create("2", "student2");
- tsk_list_push_ascending_data(list, ((void**) &student2));
- }
- {
- student_t *student5 = student_create("5", "student5");
- tsk_list_push_ascending_data(list, ((void**) &student5));
- }
- {
- student_t *student4 = student_create("4", "student4");
- tsk_list_push_ascending_data(list, ((void**) &student4));
- }
- {
- student_t *student1 = student_create("1", "student1");
- tsk_list_push_ascending_data(list, ((void**) &student1));
- }
- {
- student_t *student1 = student_create("1", "student1");
- tsk_list_push_ascending_data(list, ((void**) &student1));
- }
- {
- student_t *student3 = student_create("3", "student3");
- tsk_list_push_ascending_data(list, ((void**) &student3));
- }
- {
- student_t *student6 = student_create("6", "student6");
- tsk_list_push_ascending_data(list, ((void**) &student6));
- }
- {
- student_t *student1 = student_create("1", "student1");
- tsk_list_push_ascending_data(list, ((void**) &student1));
- }
- {
- student_t *student3 = student_create("3", "student3");
- tsk_list_push_ascending_data(list, ((void**) &student3));
- }
- {
- student_t *student6 = student_create("6", "student6");
- tsk_list_push_ascending_data(list, ((void**) &student6));
- }
+ /* add items to the list */
+ {
+ student_t *student2 = student_create("2", "student2");
+ tsk_list_push_ascending_data(list, ((void**) &student2));
+ }
+ {
+ student_t *student6 = student_create("6", "student6");
+ tsk_list_push_ascending_data(list, ((void**) &student6));
+ }
+ {
+ student_t *student1 = student_create("1", "student1");
+ tsk_list_push_ascending_data(list, ((void**) &student1));
+ }
+ {
+ student_t *student6 = student_create("6", "student6");
+ tsk_list_push_ascending_data(list, ((void**) &student6));
+ }
+ {
+ student_t *student6 = student_create("6", "student6");
+ tsk_list_push_ascending_data(list, ((void**) &student6));
+ }
+ {
+ student_t *student2 = student_create("2", "student2");
+ tsk_list_push_ascending_data(list, ((void**) &student2));
+ }
+ {
+ student_t *student2 = student_create("2", "student2");
+ tsk_list_push_ascending_data(list, ((void**) &student2));
+ }
+ {
+ student_t *student5 = student_create("5", "student5");
+ tsk_list_push_ascending_data(list, ((void**) &student5));
+ }
+ {
+ student_t *student4 = student_create("4", "student4");
+ tsk_list_push_ascending_data(list, ((void**) &student4));
+ }
+ {
+ student_t *student1 = student_create("1", "student1");
+ tsk_list_push_ascending_data(list, ((void**) &student1));
+ }
+ {
+ student_t *student1 = student_create("1", "student1");
+ tsk_list_push_ascending_data(list, ((void**) &student1));
+ }
+ {
+ student_t *student3 = student_create("3", "student3");
+ tsk_list_push_ascending_data(list, ((void**) &student3));
+ }
+ {
+ student_t *student6 = student_create("6", "student6");
+ tsk_list_push_ascending_data(list, ((void**) &student6));
+ }
+ {
+ student_t *student1 = student_create("1", "student1");
+ tsk_list_push_ascending_data(list, ((void**) &student1));
+ }
+ {
+ student_t *student3 = student_create("3", "student3");
+ tsk_list_push_ascending_data(list, ((void**) &student3));
+ }
+ {
+ student_t *student6 = student_create("6", "student6");
+ tsk_list_push_ascending_data(list, ((void**) &student6));
+ }
- /* dump all items */
- tsk_list_foreach(item, list)
- {
- student_t* item_data = item->data;
- TSK_DEBUG_INFO("test_filtered_list/// --> [id=%s and name=%s]", item_data->id, item_data->name);
- }
+ /* dump all items */
+ tsk_list_foreach(item, list) {
+ student_t* item_data = item->data;
+ TSK_DEBUG_INFO("test_filtered_list/// --> [id=%s and name=%s]", item_data->id, item_data->name);
+ }
- /* delete all items in the list */
- TSK_OBJECT_SAFE_FREE(list);
+ /* delete all items in the list */
+ TSK_OBJECT_SAFE_FREE(list);
}
void test_complex_list()
{
- tsk_list_t *list = tsk_list_create();
- tsk_list_item_t *item = 0;
+ tsk_list_t *list = tsk_list_create();
+ tsk_list_item_t *item = 0;
- /* add items to the list */
- {
- student_t *student1 = student_create("1", "student1");
- tsk_list_push_back_data(list, ((void**) &student1));
- }
- {
- student_t *student2 = student_create("2", "student2");
- tsk_list_push_front_data(list, ((void**) &student2));
- }
- {
- student_t *student3 = student_create("3", "student3");
- tsk_list_push_front_data(list, ((void**) &student3));
- }
+ /* add items to the list */
+ {
+ student_t *student1 = student_create("1", "student1");
+ tsk_list_push_back_data(list, ((void**) &student1));
+ }
+ {
+ student_t *student2 = student_create("2", "student2");
+ tsk_list_push_front_data(list, ((void**) &student2));
+ }
+ {
+ student_t *student3 = student_create("3", "student3");
+ tsk_list_push_front_data(list, ((void**) &student3));
+ }
- /* dump all items */
- tsk_list_foreach(item, list)
- {
- student_t* item_data = item->data;
- TSK_DEBUG_INFO("test_complex_list/// --> [id=%s and name=%s]", item_data->id, item_data->name);
- }
+ /* dump all items */
+ tsk_list_foreach(item, list) {
+ student_t* item_data = item->data;
+ TSK_DEBUG_INFO("test_complex_list/// --> [id=%s and name=%s]", item_data->id, item_data->name);
+ }
- /* Find student using tsk_object* */
- {
- student_t *student_to_find = student_create("1", "student1");
- const tsk_list_item_t *item_const = tsk_list_find_item_by_data(list, student_to_find);
- {
- const student_t* item_data_const = item_const->data;
- TSK_DEBUG_INFO("test_complex_list/// using tsk_object --> student with name==\"student1\" and id=\"%s\"", item_data_const->id);
- }
- TSK_OBJECT_SAFE_FREE(student_to_find);
- }
+ /* Find student using tsk_object* */
+ {
+ student_t *student_to_find = student_create("1", "student1");
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_data(list, student_to_find);
+ {
+ const student_t* item_data_const = item_const->data;
+ TSK_DEBUG_INFO("test_complex_list/// using tsk_object --> student with name==\"student1\" and id=\"%s\"", item_data_const->id);
+ }
+ TSK_OBJECT_SAFE_FREE(student_to_find);
+ }
- /* Find student named "student2" using predicate */
- {
- const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(list, pred_find_student_by_name, "student2");
- {
- const student_t* item_data_const = item_const->data;
- TSK_DEBUG_INFO("test_complex_list/// using predicate --> student with name==\"student2\" and id=\"%s\"", item_data_const->id);
- }
- }
+ /* Find student named "student2" using predicate */
+ {
+ const tsk_list_item_t *item_const = tsk_list_find_item_by_pred(list, pred_find_student_by_name, "student2");
+ {
+ const student_t* item_data_const = item_const->data;
+ TSK_DEBUG_INFO("test_complex_list/// using predicate --> student with name==\"student2\" and id=\"%s\"", item_data_const->id);
+ }
+ }
- /* delete all items in the list */
- TSK_OBJECT_SAFE_FREE(list);
+ /* delete all items in the list */
+ TSK_OBJECT_SAFE_FREE(list);
}
#endif /* _TEST_LISTS_H_ */
diff --git a/tinySAK/test/test_md5.h b/tinySAK/test/test_md5.h
index b96621a..d841516 100755
--- a/tinySAK/test/test_md5.h
+++ b/tinySAK/test/test_md5.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,79 +22,69 @@
#ifndef _TEST_MD5_H_
#define _TEST_MD5_H_
-struct md5_result
-{
- const char* msg;
- const char* xres;
+struct md5_result {
+ const char* msg;
+ const char* xres;
};
-struct md5_result msgs_md5[] =
-{
- { "x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11", "f3d129cf0d52088287dee3e6057fa18d" },
- { "", "d41d8cd98f00b204e9800998ecf8427e" },
- { "a", "0cc175b9c0f1b6a831c399e269772661" },
- { "abc", "900150983cd24fb0d6963f7d28e17f72" },
- { "message digest", "f96b697d7cb7938d525a2f31aaf161d0" },
- { "abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b" },
- { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "d174ab98d277d9f5a5611c2c9f419d9f" },
- { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a" },
- { "The quick brown fox jumps over the lazy dog", "9e107d9d372bb6826bd81d3542a419d6" },
- { "The quick brown fox jumps over the lazy dog.", "e4d909c290d0fb1ca068ffaddf22cbd0" },
+struct md5_result msgs_md5[] = {
+ { "x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11", "f3d129cf0d52088287dee3e6057fa18d" },
+ { "", "d41d8cd98f00b204e9800998ecf8427e" },
+ { "a", "0cc175b9c0f1b6a831c399e269772661" },
+ { "abc", "900150983cd24fb0d6963f7d28e17f72" },
+ { "message digest", "f96b697d7cb7938d525a2f31aaf161d0" },
+ { "abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b" },
+ { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "d174ab98d277d9f5a5611c2c9f419d9f" },
+ { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a" },
+ { "The quick brown fox jumps over the lazy dog", "9e107d9d372bb6826bd81d3542a419d6" },
+ { "The quick brown fox jumps over the lazy dog.", "e4d909c290d0fb1ca068ffaddf22cbd0" },
};
void test_md5()
{
- size_t i;
- tsk_md5string_t md5result;
+ size_t i;
+ tsk_md5string_t md5result;
- for(i=0; i< sizeof(msgs_md5)/sizeof(struct md5_result); i++)
- {
- tsk_md5compute(msgs_md5[i].msg, strlen(msgs_md5[i].msg), &md5result);
- if(tsk_striequals(msgs_md5[i].xres, md5result))
- {
- TSK_DEBUG_INFO("[MD5-%d] ==> OK", i);
- }
- else
- {
- TSK_DEBUG_INFO("[MD5-%d] ==> NOK", i);
- }
- }
+ for(i=0; i< sizeof(msgs_md5)/sizeof(struct md5_result); i++) {
+ tsk_md5compute(msgs_md5[i].msg, strlen(msgs_md5[i].msg), &md5result);
+ if(tsk_striequals(msgs_md5[i].xres, md5result)) {
+ TSK_DEBUG_INFO("[MD5-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[MD5-%d] ==> NOK", i);
+ }
+ }
}
-struct hmac_md5_result
-{
- const char* msg;
- const char* key;
- const char* xres;
+struct hmac_md5_result {
+ const char* msg;
+ const char* key;
+ const char* xres;
};
-struct hmac_md5_result msgs_hmac_md5[] =
-{
- { "Hi There", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "9294727a3638bb1c13f48ef8158bfc9d" },
- { "what do ya want for nothing?", "Jefe", "750c783e6ab0b503eaa86e310a5db738" },
- { "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "56be34521d144c88dbb8c733f0e8b3f6" },
- { "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", "697eaf0aca3a3aea3a75164746ffaa79" },
- { "Test With Truncation", "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", "56461ef2342edc00f9bab995690efd4c" },
- { "Test Using Larger Than Block-Size Key - Hash Key First", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd" },
- { "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "6f630fad67cda0ee1fb1f562db3aa53e" },
+struct hmac_md5_result msgs_hmac_md5[] = {
+ { "Hi There", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "9294727a3638bb1c13f48ef8158bfc9d" },
+ { "what do ya want for nothing?", "Jefe", "750c783e6ab0b503eaa86e310a5db738" },
+ { "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "56be34521d144c88dbb8c733f0e8b3f6" },
+ { "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", "697eaf0aca3a3aea3a75164746ffaa79" },
+ { "Test With Truncation", "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", "56461ef2342edc00f9bab995690efd4c" },
+ { "Test Using Larger Than Block-Size Key - Hash Key First", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd" },
+ { "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "6f630fad67cda0ee1fb1f562db3aa53e" },
};
void test_hmac_md5()
{
- size_t i;
- tsk_md5string_t md5result;
+ size_t i;
+ tsk_md5string_t md5result;
- for(i=0; i< sizeof(msgs_hmac_md5)/sizeof(struct hmac_md5_result); i++)
- {
- hmac_md5_compute((const uint8_t*)msgs_hmac_md5[i].msg, strlen(msgs_hmac_md5[i].msg), msgs_hmac_md5[i].key, strlen(msgs_hmac_md5[i].key), &md5result);
- if(tsk_striequals(msgs_hmac_md5[i].xres, md5result))
- {
- TSK_DEBUG_INFO("[HMAC-MD5-%d] ==> OK", i);
- }
- else
- {
- TSK_DEBUG_INFO("[HMAC-MD5-%d] ==> NOK", i);
- }
- }
+ for(i=0; i< sizeof(msgs_hmac_md5)/sizeof(struct hmac_md5_result); i++) {
+ hmac_md5_compute((const uint8_t*)msgs_hmac_md5[i].msg, strlen(msgs_hmac_md5[i].msg), msgs_hmac_md5[i].key, strlen(msgs_hmac_md5[i].key), &md5result);
+ if(tsk_striequals(msgs_hmac_md5[i].xres, md5result)) {
+ TSK_DEBUG_INFO("[HMAC-MD5-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[HMAC-MD5-%d] ==> NOK", i);
+ }
+ }
}
diff --git a/tinySAK/test/test_mutex.h b/tinySAK/test/test_mutex.h
index bc5e701..2200ba2 100755
--- a/tinySAK/test/test_mutex.h
+++ b/tinySAK/test/test_mutex.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,53 +28,53 @@ int mutex_thread_started = 0;
int safe_func(tsk_mutex_handle_t *mutex, const char* caller)
{
- int ret = 0;
+ int ret = 0;
- ret = tsk_mutex_lock(mutex);
- TSK_DEBUG_INFO("threadfunc_mutex/// Start doing job [%s]... %d\n", caller, ret);
- tsk_thread_sleep(5000);
- TSK_DEBUG_INFO("threadfunc_mutex/// Stop doing job [%s]... %d\n", caller, ret);
- ret = tsk_mutex_unlock(mutex);
+ ret = tsk_mutex_lock(mutex);
+ TSK_DEBUG_INFO("threadfunc_mutex/// Start doing job [%s]... %d\n", caller, ret);
+ tsk_thread_sleep(5000);
+ TSK_DEBUG_INFO("threadfunc_mutex/// Stop doing job [%s]... %d\n", caller, ret);
+ ret = tsk_mutex_unlock(mutex);
- return ret;
+ return ret;
}
void *threadfunc_mutex(void *parm)
{
- tsk_mutex_handle_t *mutex = (tsk_mutex_handle_t *)parm;
- safe_func(mutex, "caller1");
+ tsk_mutex_handle_t *mutex = (tsk_mutex_handle_t *)parm;
+ safe_func(mutex, "caller1");
- return 0;
+ return 0;
}
/* Pthread mutex */
void test_mutex()
{
- tsk_mutex_handle_t *mutex = tsk_mutex_create();
- void* tid[1] = {0};
+ tsk_mutex_handle_t *mutex = tsk_mutex_create();
+ void* tid[1] = {0};
+
+ TSK_DEBUG_INFO("test_mutex//\n");
+
+ //tsk_mutex_lock(mutex);
- TSK_DEBUG_INFO("test_mutex//\n");
-
- //tsk_mutex_lock(mutex);
-
- tsk_thread_create(&tid[0], threadfunc_mutex, mutex);
- tsk_thread_sleep(1000);
+ tsk_thread_create(&tid[0], threadfunc_mutex, mutex);
+ tsk_thread_sleep(1000);
- safe_func(mutex, "caller0");
+ safe_func(mutex, "caller0");
- /*while(!mutex_thread_started) tsk_thread_sleep(1000);
+ /*while(!mutex_thread_started) tsk_thread_sleep(1000);
- printf("test_mutex// threadfunc_mutex is locked for 1 second\n");
- tsk_thread_sleep(1000);
+ printf("test_mutex// threadfunc_mutex is locked for 1 second\n");
+ tsk_thread_sleep(1000);
- printf("test_mutex// Now unlock threadfunc_mutex\n");
- tsk_mutex_unlock(mutex);*/
+ printf("test_mutex// Now unlock threadfunc_mutex\n");
+ tsk_mutex_unlock(mutex);*/
- tsk_thread_join(&(tid[0]));
+ tsk_thread_join(&(tid[0]));
- tsk_mutex_destroy(&mutex);
+ tsk_mutex_destroy(&mutex);
}
#endif /* _TEST_MUTEX_H_ */
diff --git a/tinySAK/test/test_object.h b/tinySAK/test/test_object.h
index 8c59b46..dfca90e 100755
--- a/tinySAK/test/test_object.h
+++ b/tinySAK/test/test_object.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,20 +22,18 @@
#if !defined(_TEST_OBJECT_H_) && 0
#define _TEST_OBJECT_H_
-typedef struct person_s
-{
- TSK_DECLARE_OBJECT; // Mandatory
+typedef struct person_s {
+ TSK_DECLARE_OBJECT; // Mandatory
- char* name;
- struct person_s* girlfriend;
+ char* name;
+ struct person_s* girlfriend;
}
person_t;
// (a student is a person)
-typedef struct student_s
-{
- struct person_s* person; // Must be the first element
- char* school;
+typedef struct student_s {
+ struct person_s* person; // Must be the first element
+ char* school;
}
student_t;
@@ -47,65 +45,64 @@ student_t;
// constructor
static tsk_object_t* person_create(tsk_object_t * self, va_list * app)
{
- person_t *person = self;
- if(person){
- person->name = tsk_strdup(va_arg(*app, const char *));
- }
- return self;
- }
+ person_t *person = self;
+ if(person) {
+ person->name = tsk_strdup(va_arg(*app, const char *));
+ }
+ return self;
+}
- // destructor
- static tsk_object_t* person_destroy(tsk_object_t * self)
- {
- person_t *person = self;
- if(person){
- TSK_FREE(person->name);
- tsk_object_unref(person->girlfriend);
- }
- return self; // return
- }
-
- // comparator
- static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
- {
- const person_t *p1 = _p1;
- const person_t *p1 = _p2;
- int ret;
-
- // do they have the same name?
- if((ret = tsk_stricmp(p1->name, p2->name))){
- return ret;
- }
- // do they have the same girlfriend?
- if((ret = tsk_object_cmp(p1->girlfriend, p2->girlfriend))){
- return ret;
- }
-
- // they are the same
- return 0;
- }
+// destructor
+static tsk_object_t* person_destroy(tsk_object_t * self)
+{
+ person_t *person = self;
+ if(person) {
+ TSK_FREE(person->name);
+ tsk_object_unref(person->girlfriend);
+ }
+ return self; // return
+}
+
+// comparator
+static int person_cmp(const tsk_object_t *_p1, const tsk_object_t *_p2)
+{
+ const person_t *p1 = _p1;
+ const person_t *p1 = _p2;
+ int ret;
+
+ // do they have the same name?
+ if((ret = tsk_stricmp(p1->name, p2->name))) {
+ return ret;
+ }
+ // do they have the same girlfriend?
+ if((ret = tsk_object_cmp(p1->girlfriend, p2->girlfriend))) {
+ return ret;
+ }
+
+ // they are the same
+ return 0;
+}
- //(Object defnition)
- static const tsk_object_def_t person_def_t =
- {
- sizeof(person_t),
- person_create,
- person_destroy,
- person_cmp
- };
+//(Object defnition)
+static const tsk_object_def_t person_def_t = {
+ sizeof(person_t),
+ person_create,
+ person_destroy,
+ person_cmp
+};
- // create a person
+// create a person
#define PERSON_CREATE(name) tsk_object_new(&person_def_t, (const char*)name)
/* test object */
void test_object()
{
- // creates a person: will call the constructor
- person_t* bob = PERSON_CREATE("bob");
- // creates bob's girlfriend
- bob->girlfriend = PERSON_CREATE("alice");
- // deletes bob: will delete both bob and bob's girlfriend field by calling their destructors
- TSK_OBJECT_SAFE_FREE(bob);
+ // creates a person: will call the constructor
+ person_t* bob = PERSON_CREATE("bob");
+ // creates bob's girlfriend
+ bob->girlfriend = PERSON_CREATE("alice");
+ // deletes bob: will delete both bob and bob's girlfriend field by calling their destructors
+ TSK_OBJECT_SAFE_FREE(bob);
}
#endif /* _TEST_OBJECT_H_ */
diff --git a/tinySAK/test/test_options.h b/tinySAK/test/test_options.h
index 47c8224..b707c3d 100755
--- a/tinySAK/test/test_options.h
+++ b/tinySAK/test/test_options.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,39 +22,38 @@
#ifndef _TEST_OPTIONS_H_
#define _TEST_OPTIONS_H_
-typedef enum options_e
-{
- o_project,
- o_license,
- o_contact,
- o_version,
- o_date
+typedef enum options_e {
+ o_project,
+ o_license,
+ o_contact,
+ o_version,
+ o_date
}
options_t;
void test_options()
{
- tsk_options_L_t *options = tsk_list_create();
- tsk_bool_t b;
- int i;
- const char* string;
- const tsk_option_t* o;
-
- tsk_options_add_option(&options, o_project, "doubango");
- tsk_options_add_option(&options, o_project, "doubangooo");
- tsk_options_add_option(&options, o_license, "GPLv3");
- tsk_options_add_option(&options, o_contact, "Mamadou Diop <diopmamadou(at)doubango.org>");
- tsk_options_add_option(&options, o_version, "10");
+ tsk_options_L_t *options = tsk_list_create();
+ tsk_bool_t b;
+ int i;
+ const char* string;
+ const tsk_option_t* o;
+
+ tsk_options_add_option(&options, o_project, "doubango");
+ tsk_options_add_option(&options, o_project, "doubangooo");
+ tsk_options_add_option(&options, o_license, "GPLv3");
+ tsk_options_add_option(&options, o_contact, "Mamadou Diop <diopmamadou(at)doubango.org>");
+ tsk_options_add_option(&options, o_version, "10");
+
+ b = tsk_options_have_option(options, o_project);
+ b = tsk_options_have_option(options, o_date);
+ tsk_options_remove_option(options, o_project);
+ b = tsk_options_have_option(options, o_project);
+ i = tsk_options_get_option_value_as_int(options, o_version);
+ string = tsk_options_get_option_value(options, o_version);
+ o = tsk_options_get_option_by_id(options, o_contact);
- b = tsk_options_have_option(options, o_project);
- b = tsk_options_have_option(options, o_date);
- tsk_options_remove_option(options, o_project);
- b = tsk_options_have_option(options, o_project);
- i = tsk_options_get_option_value_as_int(options, o_version);
- string = tsk_options_get_option_value(options, o_version);
- o = tsk_options_get_option_by_id(options, o_contact);
-
- TSK_OBJECT_SAFE_FREE(options);
+ TSK_OBJECT_SAFE_FREE(options);
}
diff --git a/tinySAK/test/test_params.h b/tinySAK/test/test_params.h
index 0bfd958..847bece 100755
--- a/tinySAK/test/test_params.h
+++ b/tinySAK/test/test_params.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,43 +25,43 @@
void test_params()
{
- tsk_buffer_t *buffer = tsk_buffer_create_null();
- tsk_params_L_t *params = tsk_list_create();
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
+ tsk_params_L_t *params = tsk_list_create();
+
+ //
+ //
+ //
+ tsk_param_t *param1 = tsk_params_parse_param("mamadou=diop", strlen("mamadou=diop"));
+ tsk_param_t *param2 = tsk_params_parse_param("project=doubango", strlen("project=doubango"));
+ tsk_param_t *param3 = tsk_params_parse_param("license=gpl", strlen("license=gpl"));
+
+ tsk_list_push_back_data(params, (void**)&param1);
+ tsk_list_push_back_data(params, (void**)&param2);
+ tsk_list_push_back_data(params, (void**)&param3);
- //
- //
- //
- tsk_param_t *param1 = tsk_params_parse_param("mamadou=diop", strlen("mamadou=diop"));
- tsk_param_t *param2 = tsk_params_parse_param("project=doubango", strlen("project=doubango"));
- tsk_param_t *param3 = tsk_params_parse_param("license=gpl", strlen("license=gpl"));
-
- tsk_list_push_back_data(params, (void**)&param1);
- tsk_list_push_back_data(params, (void**)&param2);
- tsk_list_push_back_data(params, (void**)&param3);
+ tsk_params_tostring(params, ',', buffer);
+ TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
- tsk_params_tostring(params, ',', buffer);
- TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
+ tsk_buffer_cleanup(buffer);
+ TSK_OBJECT_SAFE_FREE(params);
- tsk_buffer_cleanup(buffer);
- TSK_OBJECT_SAFE_FREE(params);
+ //
+ //
+ //
+ params = tsk_params_fromstring("octet-align=1; mode-set=0,1,2,3,4,5,6,7; mode-change-period=1; mode-change-capability=2; mode-change-neighbor=0", ';', tsk_true);
+ tsk_params_tostring(params, ';', buffer);
+ TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
+ tsk_buffer_cleanup(buffer);
+ TSK_OBJECT_SAFE_FREE(params);
- //
- //
- //
- params = tsk_params_fromstring("octet-align=1; mode-set=0,1,2,3,4,5,6,7; mode-change-period=1; mode-change-capability=2; mode-change-neighbor=0", ';', tsk_true);
- tsk_params_tostring(params, ';', buffer);
- TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
- tsk_buffer_cleanup(buffer);
- TSK_OBJECT_SAFE_FREE(params);
-
- params = tsk_params_fromstring("QCIF=1;CIF=2;MaxBR=4200", ';', tsk_true);
- tsk_params_tostring(params, ';', buffer);
- TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
- tsk_buffer_cleanup(buffer);
- TSK_OBJECT_SAFE_FREE(params);
+ params = tsk_params_fromstring("QCIF=1;CIF=2;MaxBR=4200", ';', tsk_true);
+ tsk_params_tostring(params, ';', buffer);
+ TSK_DEBUG_INFO("Buffer=[%s]", TSK_BUFFER_TO_STRING(buffer));
+ tsk_buffer_cleanup(buffer);
+ TSK_OBJECT_SAFE_FREE(params);
- TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(buffer);
}
diff --git a/tinySAK/test/test_runnable.h b/tinySAK/test/test_runnable.h
index bb99c28..3395e09 100755
--- a/tinySAK/test/test_runnable.h
+++ b/tinySAK/test/test_runnable.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,105 +22,104 @@
#ifndef _TEST_RUNNABLE_H_
#define _TEST_RUNNABLE_H_
-typedef struct test_runnable_timer_s
-{
- tsk_timer_id_t id;
- uint64_t timeout;
- const char *arg;
+typedef struct test_runnable_timer_s {
+ tsk_timer_id_t id;
+ uint64_t timeout;
+ const char *arg;
}
test_runnable_timer_t;
-test_runnable_timer_t runnable_timers[] =
-{
- {0, 2000, "3"},
- {1, 2500, "4"},
- {2, 500, "1"},
- {3, 1000, "2"},
- {4, 1000, "2"},
- {5, 0, "0"},
- {6, 10000, "6"},
- {7, 3000, "5"},
- {8, 2500, "4"},
+test_runnable_timer_t runnable_timers[] = {
+ {0, 2000, "3"},
+ {1, 2500, "4"},
+ {2, 500, "1"},
+ {3, 1000, "2"},
+ {4, 1000, "2"},
+ {5, 0, "0"},
+ {6, 10000, "6"},
+ {7, 3000, "5"},
+ {8, 2500, "4"},
};
-typedef struct tsk_obj_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsk_obj_s {
+ TSK_DECLARE_OBJECT;
- tsk_timer_id_t timer_id;
+ tsk_timer_id_t timer_id;
}
tsk_obj_t;
-static void* tsk_obj_ctor(void * self, va_list * app){
- tsk_obj_t *obj = self;
- if(obj){
- obj->timer_id = va_arg(*app, tsk_timer_id_t);
- }
- return self;
-}
-static void* tsk_obj_dtor(void * self) {
- return self;
+static void* tsk_obj_ctor(void * self, va_list * app)
+{
+ tsk_obj_t *obj = self;
+ if(obj) {
+ obj->timer_id = va_arg(*app, tsk_timer_id_t);
+ }
+ return self;
}
-static int tsk_obj_cmp(const void *obj1, const void *obj2){
- return 0;
+static void* tsk_obj_dtor(void * self)
+{
+ return self;
}
-static const tsk_object_def_t tsk_obj_def_s =
+static int tsk_obj_cmp(const void *obj1, const void *obj2)
{
- sizeof(tsk_obj_t),
- tsk_obj_ctor,
- tsk_obj_dtor,
- tsk_obj_cmp,
+ return 0;
+}
+static const tsk_object_def_t tsk_obj_def_s = {
+ sizeof(tsk_obj_t),
+ tsk_obj_ctor,
+ tsk_obj_dtor,
+ tsk_obj_cmp,
};
const tsk_object_def_t *tsk_obj_def_t = &tsk_obj_def_s;
void *run(void* self)
{
- int i = 0;
- tsk_list_item_t *curr;
-
- TSK_RUNNABLE_RUN_BEGIN(self);
-
- if(curr = TSK_RUNNABLE_POP_FIRST(self)){
- const tsk_obj_t *obj = (const tsk_obj_t*)curr->data;
- printf("\n\nRunnable event-id===>[%llu]\n\n", obj->timer_id);
- tsk_object_unref(curr);
- }
-
- TSK_RUNNABLE_RUN_END(self);
-
- return 0;
+ int i = 0;
+ tsk_list_item_t *curr;
+
+ TSK_RUNNABLE_RUN_BEGIN(self);
+
+ if(curr = TSK_RUNNABLE_POP_FIRST(self)) {
+ const tsk_obj_t *obj = (const tsk_obj_t*)curr->data;
+ printf("\n\nRunnable event-id===>[%llu]\n\n", obj->timer_id);
+ tsk_object_unref(curr);
+ }
+
+ TSK_RUNNABLE_RUN_END(self);
+
+ return 0;
}
static int test_runnable_timer_callback(const void* arg, tsk_timer_id_t timer_id)
{
- const tsk_runnable_t* runnable = arg;
- if(runnable){
- TSK_RUNNABLE_ENQUEUE(runnable, timer_id);
- return 0;
- }
- return -1;
+ const tsk_runnable_t* runnable = arg;
+ if(runnable) {
+ TSK_RUNNABLE_ENQUEUE(runnable, timer_id);
+ return 0;
+ }
+ return -1;
}
void test_runnable()
{
- size_t i;
- tsk_timer_manager_handle_t *timer_mgr = tsk_timer_manager_create();
- tsk_runnable_t* runnable = tsk_runnable_create();
- runnable->run = run;
- printf("test_runnable//\n");
-
- tsk_timer_manager_start(timer_mgr);
- tsk_runnable_start(runnable, tsk_obj_def_t);
-
- for(i=0; i<sizeof(runnable_timers)/sizeof(test_runnable_timer_t); ++i){
- runnable_timers[i].id = tsk_timer_manager_schedule(timer_mgr, runnable_timers[i].timeout, test_runnable_timer_callback, runnable);
- }
-
- tsk_thread_sleep(4000);
-
- /* Stops and frees both timer manager and runnable object */
- TSK_OBJECT_SAFE_FREE(runnable);
- TSK_OBJECT_SAFE_FREE(timer_mgr);
+ size_t i;
+ tsk_timer_manager_handle_t *timer_mgr = tsk_timer_manager_create();
+ tsk_runnable_t* runnable = tsk_runnable_create();
+ runnable->run = run;
+ printf("test_runnable//\n");
+
+ tsk_timer_manager_start(timer_mgr);
+ tsk_runnable_start(runnable, tsk_obj_def_t);
+
+ for(i=0; i<sizeof(runnable_timers)/sizeof(test_runnable_timer_t); ++i) {
+ runnable_timers[i].id = tsk_timer_manager_schedule(timer_mgr, runnable_timers[i].timeout, test_runnable_timer_callback, runnable);
+ }
+
+ tsk_thread_sleep(4000);
+
+ /* Stops and frees both timer manager and runnable object */
+ TSK_OBJECT_SAFE_FREE(runnable);
+ TSK_OBJECT_SAFE_FREE(timer_mgr);
}
#endif /* _TEST_RUNNABLE_H_ */
diff --git a/tinySAK/test/test_safeobject.h b/tinySAK/test/test_safeobject.h
index 8f78ae4..48181fc 100755
--- a/tinySAK/test/test_safeobject.h
+++ b/tinySAK/test/test_safeobject.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,67 +24,66 @@
int so_mutex_count = 0;
-typedef struct mysafeobj_s
-{
- TSK_DECLARE_SAFEOBJ;
-
- int test1;
- int test2;
+typedef struct mysafeobj_s {
+ TSK_DECLARE_SAFEOBJ;
+
+ int test1;
+ int test2;
}
mysafeobj_t;
void *threadfunc_safeobj1(void *parm)
{
- mysafeobj_t *safeobj = (mysafeobj_t *)parm;
- int ret = 0;
+ mysafeobj_t *safeobj = (mysafeobj_t *)parm;
+ int ret = 0;
- so_mutex_count++;
- ret = tsk_safeobj_lock(safeobj);
- printf("threadfunc_safeobj1/// %d\n", ret);
+ so_mutex_count++;
+ ret = tsk_safeobj_lock(safeobj);
+ printf("threadfunc_safeobj1/// %d\n", ret);
- return 0;
+ return 0;
}
void *threadfunc_safeobj2(void *parm)
{
- mysafeobj_t *safeobj = (mysafeobj_t *)parm;
- int ret = 0;
+ mysafeobj_t *safeobj = (mysafeobj_t *)parm;
+ int ret = 0;
- so_mutex_count++;
- ret = tsk_safeobj_lock(safeobj);
- printf("threadfunc_safeobj2/// %d\n", ret);
+ so_mutex_count++;
+ ret = tsk_safeobj_lock(safeobj);
+ printf("threadfunc_safeobj2/// %d\n", ret);
- return 0;
+ return 0;
}
/* test safeobject */
void test_safeobject()
{
- mysafeobj_t* obj = calloc(1, sizeof(mysafeobj_t));
- void* tid[2] = {0, 0};
- int i;
+ mysafeobj_t* obj = calloc(1, sizeof(mysafeobj_t));
+ void* tid[2] = {0, 0};
+ int i;
+
+ printf("test_safeobject//\n");
- printf("test_safeobject//\n");
+ tsk_safeobj_init(obj);
- tsk_safeobj_init(obj);
+ //assert(!tsk_safeobj_lock(obj));
- //assert(!tsk_safeobj_lock(obj));
+ tsk_thread_create(&tid[0], threadfunc_safeobj1, obj);
+ tsk_thread_create(&tid[1], threadfunc_safeobj2, obj);
- tsk_thread_create(&tid[0], threadfunc_safeobj1, obj);
- tsk_thread_create(&tid[1], threadfunc_safeobj2, obj);
+ /* VERY BAD */
+ while(so_mutex_count<2);
+ for(i=0; i<10000000; i++);
- /* VERY BAD */
- while(so_mutex_count<2);
- for(i=0;i<10000000;i++);
-
- /*assert(!*/tsk_safeobj_unlock(obj)/*)*/;
- /*assert(!*/tsk_safeobj_unlock(obj)/*)*/;
+ /*assert(!*/tsk_safeobj_unlock(obj)/*)*/;
+ /*assert(!*/tsk_safeobj_unlock(obj)/*)*/;
- tsk_thread_join(&tid[0]);
- tsk_thread_join(&tid[1]);
+ tsk_thread_join(&tid[0]);
+ tsk_thread_join(&tid[1]);
- tsk_safeobj_deinit(obj);
- tsk_free((void**)&obj);
+ tsk_safeobj_deinit(obj);
+ tsk_free((void**)&obj);
}
#endif /* _TEST_SAFEOBJ_H_ */
diff --git a/tinySAK/test/test_semaphore.h b/tinySAK/test/test_semaphore.h
index 977dd9f..a2b6ebb 100755
--- a/tinySAK/test/test_semaphore.h
+++ b/tinySAK/test/test_semaphore.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,50 +24,50 @@
void *threadfunc_semaphore1(void *parm)
{
- tsk_semaphore_handle_t *semaphore = (tsk_semaphore_handle_t *)parm;
- int ret = 0;
+ tsk_semaphore_handle_t *semaphore = (tsk_semaphore_handle_t *)parm;
+ int ret = 0;
- printf("threadfunc_semaphore1/// START %d\n", ret);
- ret = tsk_semaphore_decrement(semaphore);
- printf("threadfunc_semaphore1/// STOP %d\n", ret);
+ printf("threadfunc_semaphore1/// START %d\n", ret);
+ ret = tsk_semaphore_decrement(semaphore);
+ printf("threadfunc_semaphore1/// STOP %d\n", ret);
- return 0;
+ return 0;
}
void *threadfunc_semaphore2(void *parm)
{
- tsk_semaphore_handle_t *semaphore = (tsk_semaphore_handle_t *)parm;
- int ret = 0;
+ tsk_semaphore_handle_t *semaphore = (tsk_semaphore_handle_t *)parm;
+ int ret = 0;
- printf("threadfunc_semaphore2/// START %d\n", ret);
- ret = tsk_semaphore_decrement(semaphore);
- printf("threadfunc_semaphore2/// STOP %d\n", ret);
+ printf("threadfunc_semaphore2/// START %d\n", ret);
+ ret = tsk_semaphore_decrement(semaphore);
+ printf("threadfunc_semaphore2/// STOP %d\n", ret);
- return 0;
+ return 0;
}
/* Pthread semaphore */
void test_semaphore()
{
- tsk_semaphore_handle_t *semaphore = tsk_semaphore_create();
- void* tid[2] = {0,0};
+ tsk_semaphore_handle_t *semaphore = tsk_semaphore_create();
+ void* tid[2] = {0,0};
+
+ printf("test_semaphore//\n");
- printf("test_semaphore//\n");
+ tsk_thread_create(&tid[0], threadfunc_semaphore1, semaphore);
+ tsk_thread_create(&tid[1], threadfunc_semaphore2, semaphore);
- tsk_thread_create(&tid[0], threadfunc_semaphore1, semaphore);
- tsk_thread_create(&tid[1], threadfunc_semaphore2, semaphore);
+ tsk_thread_sleep(1000);
- tsk_thread_sleep(1000);
-
- assert(!tsk_semaphore_increment(semaphore));
- assert(!tsk_semaphore_increment(semaphore));
+ assert(!tsk_semaphore_increment(semaphore));
+ assert(!tsk_semaphore_increment(semaphore));
- tsk_thread_sleep(1000);
+ tsk_thread_sleep(1000);
- tsk_thread_join(&tid[0]);
- tsk_thread_join(&tid[1]);
+ tsk_thread_join(&tid[0]);
+ tsk_thread_join(&tid[1]);
- tsk_semaphore_destroy(&semaphore);
+ tsk_semaphore_destroy(&semaphore);
}
#endif /* _TEST_SEMAPHORE_H_ */
diff --git a/tinySAK/test/test_sha1.h b/tinySAK/test/test_sha1.h
index 812e6ab..f5e63b3 100755
--- a/tinySAK/test/test_sha1.h
+++ b/tinySAK/test/test_sha1.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,80 +22,70 @@
#ifndef _TEST_SHA1_H_
#define _TEST_SHA1_H_
-struct sha1_result
-{
- const char* msg;
- const char* xres;
+struct sha1_result {
+ const char* msg;
+ const char* xres;
};
-struct sha1_result msgs[] =
-{
- { "", "da39a3ee5e6b4b0d3255bfef95601890afd80709" },
- { "x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11", "1d29ab734b0c9585240069a6e4e3e91b61da1969" },
- { "The quick brown fox jumps over the lazy dog", "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12" },
- { "The quick brown fox jumps over the lazy cog", "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3" },
+struct sha1_result msgs[] = {
+ { "", "da39a3ee5e6b4b0d3255bfef95601890afd80709" },
+ { "x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11", "1d29ab734b0c9585240069a6e4e3e91b61da1969" },
+ { "The quick brown fox jumps over the lazy dog", "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12" },
+ { "The quick brown fox jumps over the lazy cog", "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3" },
};
void test_sha1()
{
- size_t i;
- tsk_sha1string_t sha1result;
+ size_t i;
+ tsk_sha1string_t sha1result;
- for(i=0; i< sizeof(msgs)/sizeof(struct sha1_result); i++)
- {
- tsk_sha1compute(msgs[i].msg, strlen(msgs[i].msg), &sha1result);
- if(tsk_striequals(msgs[i].xres, sha1result))
- {
- TSK_DEBUG_INFO("[SHA1-%d] ==> OK", i);
- }
- else
- {
- TSK_DEBUG_INFO("[SHA1-%d] ==> NOK", i);
- }
- }
+ for(i=0; i< sizeof(msgs)/sizeof(struct sha1_result); i++) {
+ tsk_sha1compute(msgs[i].msg, strlen(msgs[i].msg), &sha1result);
+ if(tsk_striequals(msgs[i].xres, sha1result)) {
+ TSK_DEBUG_INFO("[SHA1-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[SHA1-%d] ==> NOK", i);
+ }
+ }
}
-struct hmac_sha1_result
-{
- const char* msg;
- const char* key;
- const char* xres;
+struct hmac_sha1_result {
+ const char* msg;
+ const char* key;
+ const char* xres;
};
-struct hmac_sha1_result hmac_sha1_msgs[] =
-{
- { "Hi There", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "b617318655057264e28bc0b6fb378c8ef146be00" },
- { "what do ya want for nothing?", "Jefe", "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79" },
- { "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "125d7342b9ac11cd91a39af48aa17b4f63f175d3" },
- { "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", "4c9007f4026250c6bc8414f9bf50c86c2d7235da" },
- { "Test With Truncation", "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04" },
- { "Test Using Larger Than Block-Size Key - Hash Key First", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "aa4ae5e15272d00e95705637ce8a3b55ed402112" },
- { "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "e8e99d0f45237d786d6bbaa7965c7808bbff1a91" },
+struct hmac_sha1_result hmac_sha1_msgs[] = {
+ { "Hi There", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "b617318655057264e28bc0b6fb378c8ef146be00" },
+ { "what do ya want for nothing?", "Jefe", "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79" },
+ { "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "125d7342b9ac11cd91a39af48aa17b4f63f175d3" },
+ { "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", "4c9007f4026250c6bc8414f9bf50c86c2d7235da" },
+ { "Test With Truncation", "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04" },
+ { "Test Using Larger Than Block-Size Key - Hash Key First", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "aa4ae5e15272d00e95705637ce8a3b55ed402112" },
+ { "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", "e8e99d0f45237d786d6bbaa7965c7808bbff1a91" },
};
void test_hmac_sha1()
{
- size_t i;
- tsk_sha1string_t sha1result;
+ size_t i;
+ tsk_sha1string_t sha1result;
- // const uint8_t* bytes = "\x00\x01\x00\x3c\x21\x12\xa4\x42\x33\x6f\x57\x50\x31\x4f\x4d\x65\x65\x58\x73\x7a\x00\x06\x00\x20\x33\x68\x50\x30\x6f\x53\x7a\x6b\x48\x75\x33\x52\x56\x2f\x4c\x35\x48\x49\x78\x49\x70\x34\x73\x55\x46\x47\x73\x38\x55\x6a\x4b\x57\x00\x08\x00\x14\x21\xee\x75\x15\xc0\x9c\x0a\x90\xf2\xf3\xa5\x3e\x22\x00\x0c\xd3\xd5\xc0\x2c\x82";
- //const uint8_t* bytes = "\x00\x01\x00\x24\x21\x12\xa4\x42\x33\x6f\x57\x50\x31\x4f\x4d\x65\x65\x58\x73\x7a\x00\x06\x00\x20\x33\x68\x50\x30\x6f\x53\x7a\x6b\x48\x75\x33\x52\x56\x2f\x4c\x35\x48\x49\x78\x49\x70\x34\x73\x55\x46\x47\x73\x38\x55\x6a\x4b\x57\x00\x08\x00\x14\x21\xee\x75\x15\xc0\x9c\x0a\x90\xf2\xf3\xa5\x3e\x22\x00\x0c\xd3\xd5\xc0\x2c\x82";
+ // const uint8_t* bytes = "\x00\x01\x00\x3c\x21\x12\xa4\x42\x33\x6f\x57\x50\x31\x4f\x4d\x65\x65\x58\x73\x7a\x00\x06\x00\x20\x33\x68\x50\x30\x6f\x53\x7a\x6b\x48\x75\x33\x52\x56\x2f\x4c\x35\x48\x49\x78\x49\x70\x34\x73\x55\x46\x47\x73\x38\x55\x6a\x4b\x57\x00\x08\x00\x14\x21\xee\x75\x15\xc0\x9c\x0a\x90\xf2\xf3\xa5\x3e\x22\x00\x0c\xd3\xd5\xc0\x2c\x82";
+ //const uint8_t* bytes = "\x00\x01\x00\x24\x21\x12\xa4\x42\x33\x6f\x57\x50\x31\x4f\x4d\x65\x65\x58\x73\x7a\x00\x06\x00\x20\x33\x68\x50\x30\x6f\x53\x7a\x6b\x48\x75\x33\x52\x56\x2f\x4c\x35\x48\x49\x78\x49\x70\x34\x73\x55\x46\x47\x73\x38\x55\x6a\x4b\x57\x00\x08\x00\x14\x21\xee\x75\x15\xc0\x9c\x0a\x90\xf2\xf3\xa5\x3e\x22\x00\x0c\xd3\xd5\xc0\x2c\x82";
- //hmac_sha1_compute(bytes, 56, "tLzlCDl+o9yiWkp3", tsk_strlen("tLzlCDl+o9yiWkp3"), &sha1result);
+ //hmac_sha1_compute(bytes, 56, "tLzlCDl+o9yiWkp3", tsk_strlen("tLzlCDl+o9yiWkp3"), &sha1result);
- for(i=0; i< sizeof(hmac_sha1_msgs)/sizeof(struct hmac_sha1_result); i++)
- {
- hmac_sha1_compute((const uint8_t*)hmac_sha1_msgs[i].msg, strlen(hmac_sha1_msgs[i].msg), hmac_sha1_msgs[i].key, strlen(hmac_sha1_msgs[i].key), &sha1result);
- if(tsk_striequals(hmac_sha1_msgs[i].xres, sha1result))
- {
- TSK_DEBUG_INFO("[SHA1-%d] ==> OK", i);
- }
- else
- {
- TSK_DEBUG_INFO("[SHA1-%d] ==> NOK", i);
- }
- }
+ for(i=0; i< sizeof(hmac_sha1_msgs)/sizeof(struct hmac_sha1_result); i++) {
+ hmac_sha1_compute((const uint8_t*)hmac_sha1_msgs[i].msg, strlen(hmac_sha1_msgs[i].msg), hmac_sha1_msgs[i].key, strlen(hmac_sha1_msgs[i].key), &sha1result);
+ if(tsk_striequals(hmac_sha1_msgs[i].xres, sha1result)) {
+ TSK_DEBUG_INFO("[SHA1-%d] ==> OK", i);
+ }
+ else {
+ TSK_DEBUG_INFO("[SHA1-%d] ==> NOK", i);
+ }
+ }
}
diff --git a/tinySAK/test/test_strings.h b/tinySAK/test/test_strings.h
index 2ba0391..03fe988 100755
--- a/tinySAK/test/test_strings.h
+++ b/tinySAK/test/test_strings.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,51 +25,51 @@
/* test string manipulation */
void test_strings()
{
- char* str = tsk_null;
- int index;
+ char* str = tsk_null;
+ int index;
+
+ /* IndexOf */
+ index = tsk_strindexOf("C:\\test.zip", 5, "\\");
+ index = tsk_strindexOf("C:\\test.zip", tsk_strlen("C:\\test.zip"), "abc");
+ index = tsk_strLastIndexOf("C:\\my dirctory\\test.zip", tsk_strlen("C:\\my dirctory\test.zip"), "\\");
+ index = tsk_strLastIndexOf("C:\\my dirctory\\test.zip", tsk_strlen("C:\\my dirctory\test.zip"), ".");
+
+ /* LastIndexOf */
- /* IndexOf */
- index = tsk_strindexOf("C:\\test.zip", 5, "\\");
- index = tsk_strindexOf("C:\\test.zip", tsk_strlen("C:\\test.zip"), "abc");
- index = tsk_strLastIndexOf("C:\\my dirctory\\test.zip", tsk_strlen("C:\\my dirctory\test.zip"), "\\");
- index = tsk_strLastIndexOf("C:\\my dirctory\\test.zip", tsk_strlen("C:\\my dirctory\test.zip"), ".");
+ /* concatenation */
+ tsk_strcat(&str, " first ");
+ printf("test_strings/// strcat=%s\n", str);
- /* LastIndexOf */
-
- /* concatenation */
- tsk_strcat(&str, " first ");
- printf("test_strings/// strcat=%s\n", str);
+ /* Trim Right */
+ tsk_strtrim_right(&str);
+ printf("test_strings/// trim_right=%s\n", str);
- /* Trim Right */
- tsk_strtrim_right(&str);
- printf("test_strings/// trim_right=%s\n", str);
+ tsk_strcat(&str, "second");
+ printf("test_strings/// strcat=%s\n", str);
- tsk_strcat(&str, "second");
- printf("test_strings/// strcat=%s\n", str);
+ /* Trim Left */
+ tsk_strtrim_left(&str);
+ printf("test_strings/// trim_left=%s\n", str);
- /* Trim Left */
- tsk_strtrim_left(&str);
- printf("test_strings/// trim_left=%s\n", str);
+ tsk_free((void**)&str);
- tsk_free((void**)&str);
-
- /* sprintf */
- tsk_sprintf(&str, " \n\t%s %s\r ", "first", "second");
- printf("test_strings/// strcat=\"%s\"\n", str);
+ /* sprintf */
+ tsk_sprintf(&str, " \n\t%s %s\r ", "first", "second");
+ printf("test_strings/// strcat=\"%s\"\n", str);
- /* Trim Both */
- tsk_strtrim_both(&str);
- printf("test_strings/// trim_both=%s\n", str);
+ /* Trim Both */
+ tsk_strtrim_both(&str);
+ printf("test_strings/// trim_both=%s\n", str);
- /* Quote */
- tsk_strquote(&str);
- printf("test_strings/// quote=%s\n", str);
+ /* Quote */
+ tsk_strquote(&str);
+ printf("test_strings/// quote=%s\n", str);
- /* Unquote */
- tsk_strunquote(&str);
- printf("test_strings/// unquote=%s\n", str);
+ /* Unquote */
+ tsk_strunquote(&str);
+ printf("test_strings/// unquote=%s\n", str);
- tsk_free((void**)&str);
+ tsk_free((void**)&str);
}
#endif /* _TEST_STRINGS_H_ */
diff --git a/tinySAK/test/test_threads.h b/tinySAK/test/test_threads.h
index 5d23a69..354fce7 100755
--- a/tinySAK/test/test_threads.h
+++ b/tinySAK/test/test_threads.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,22 +27,22 @@
void* MyThreadFunction(void *arg)
{
- printf("arg=%d", *((int*)arg));
- return tsk_null;
+ printf("arg=%d", *((int*)arg));
+ return tsk_null;
}
void test_threads()
{
- void* tid[1] = {tsk_null}; // thread id
- int arg = 112; // arg to pass to the function
+ void* tid[1] = {tsk_null}; // thread id
+ int arg = 112; // arg to pass to the function
+
+ printf("test_threads//\n");
- printf("test_threads//\n");
-
- // create the thread
- tsk_thread_create(&tid[0], MyThreadFunction, &arg);
+ // create the thread
+ tsk_thread_create(&tid[0], MyThreadFunction, &arg);
- // join the thread
- tsk_thread_join(&(tid[0]));
+ // join the thread
+ tsk_thread_join(&(tid[0]));
}
#endif /* _TEST_THREADS_H_ */
diff --git a/tinySAK/test/test_timer.h b/tinySAK/test/test_timer.h
index 2b7ab4f..8f28b0c 100755
--- a/tinySAK/test/test_timer.h
+++ b/tinySAK/test/test_timer.h
@@ -2,103 +2,101 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
*/
#ifndef _TEST_TIMER_H_
#define _TEST_TIMER_H_
-typedef struct test_timer_s
-{
- tsk_timer_id_t id;
- uint64_t timeout;
- const char *arg;
+typedef struct test_timer_s {
+ tsk_timer_id_t id;
+ uint64_t timeout;
+ const char *arg;
}
test_timer_t;
-test_timer_t timers[] =
-{
- {0, 2000, "3"},
- {1, 2500, "4"},
- {2, 500, "1"},
- {3, 1000, "2"},
- {4, 1000, "2"},
- {5, 0, "0"},
- {6, 10000, "6"},
- {7, 3000, "5"},
- {8, 2500, "4"},
+test_timer_t timers[] = {
+ {0, 2000, "3"},
+ {1, 2500, "4"},
+ {2, 500, "1"},
+ {3, 1000, "2"},
+ {4, 1000, "2"},
+ {5, 0, "0"},
+ {6, 10000, "6"},
+ {7, 3000, "5"},
+ {8, 2500, "4"},
};
static int test_timer_callback(const void* arg, tsk_timer_id_t timer_id)
{
- // Do quick job
- printf("test_timer - id=%llu and arg=%s//\n", timer_id, arg);
- return 0;
+ // Do quick job
+ printf("test_timer - id=%llu and arg=%s//\n", timer_id, arg);
+ return 0;
}
void test_global_timer()
{
- size_t i;
- tsk_timer_mgr_global_ref();
+ size_t i;
+ tsk_timer_mgr_global_ref();
- // for test: start it two times
- tsk_timer_mgr_global_start();
- tsk_timer_mgr_global_start();
+ // for test: start it two times
+ tsk_timer_mgr_global_start();
+ tsk_timer_mgr_global_start();
- for(i=0; i<sizeof(timers)/sizeof(test_timer_t); ++i){
- timers[i].id = tsk_timer_mgr_global_schedule(timers[i].timeout, test_timer_callback, timers[i].arg);
- }
+ for(i=0; i<sizeof(timers)/sizeof(test_timer_t); ++i) {
+ timers[i].id = tsk_timer_mgr_global_schedule(timers[i].timeout, test_timer_callback, timers[i].arg);
+ }
- tsk_timer_mgr_global_cancel(timers[6].id);
- tsk_timer_mgr_global_cancel(timers[2].id);
+ tsk_timer_mgr_global_cancel(timers[6].id);
+ tsk_timer_mgr_global_cancel(timers[2].id);
- tsk_thread_sleep(4000);
+ tsk_thread_sleep(4000);
- // for test: stop it only one time
- tsk_timer_mgr_global_stop();
- tsk_timer_mgr_global_stop();
+ // for test: stop it only one time
+ tsk_timer_mgr_global_stop();
+ tsk_timer_mgr_global_stop();
- tsk_timer_mgr_global_unref();
+ tsk_timer_mgr_global_unref();
}
void test_single_timer()
{
- size_t i;
- tsk_timer_manager_handle_t *handle = tsk_timer_manager_create();
- printf("test_timer//\n");
-
- tsk_timer_manager_start(handle);
-
- for(i=0; i<sizeof(timers)/sizeof(test_timer_t); ++i){
- timers[i].id = tsk_timer_manager_schedule(handle, timers[i].timeout, test_timer_callback, timers[i].arg);
- }
-
- tsk_timer_manager_cancel(handle, timers[6].id);
- tsk_timer_manager_cancel(handle, timers[2].id);
-
- tsk_thread_sleep(4000);
-
- /* Stops and frees the timer manager */
- TSK_OBJECT_SAFE_FREE(handle);
+ size_t i;
+ tsk_timer_manager_handle_t *handle = tsk_timer_manager_create();
+ printf("test_timer//\n");
+
+ tsk_timer_manager_start(handle);
+
+ for(i=0; i<sizeof(timers)/sizeof(test_timer_t); ++i) {
+ timers[i].id = tsk_timer_manager_schedule(handle, timers[i].timeout, test_timer_callback, timers[i].arg);
+ }
+
+ tsk_timer_manager_cancel(handle, timers[6].id);
+ tsk_timer_manager_cancel(handle, timers[2].id);
+
+ tsk_thread_sleep(4000);
+
+ /* Stops and frees the timer manager */
+ TSK_OBJECT_SAFE_FREE(handle);
}
void test_timer()
{
- //test_single_timer();
- test_global_timer();
+ //test_single_timer();
+ test_global_timer();
}
#endif /* _TEST_TIMER_H_ */
diff --git a/tinySAK/test/test_url.h b/tinySAK/test/test_url.h
index 643cb34..ef41bd4 100755
--- a/tinySAK/test/test_url.h
+++ b/tinySAK/test/test_url.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,19 +25,19 @@
/* url encoding/decoding */
void test_url()
{
- const char *url = "http://xcap.example.org/resource-lists/users/sip:RCSUser@example.org/index/~~/resource-lists/list%5B@name=%22rcs%22%5D";
- char *str1, *str2;
+ const char *url = "http://xcap.example.org/resource-lists/users/sip:RCSUser@example.org/index/~~/resource-lists/list%5B@name=%22rcs%22%5D";
+ char *str1, *str2;
- /*decode url*/
- str1 = tsk_url_decode(url);
- printf("test_url/// decoded url:%s\n", str1);
+ /*decode url*/
+ str1 = tsk_url_decode(url);
+ printf("test_url/// decoded url:%s\n", str1);
- /*encode url*/
- str2 = tsk_url_encode(str1);
- printf("test_url/// encoded url:%s\n", str2);
+ /*encode url*/
+ str2 = tsk_url_encode(str1);
+ printf("test_url/// encoded url:%s\n", str2);
- tsk_free((void**)&str1);
- tsk_free((void**)&str2);
+ tsk_free((void**)&str1);
+ tsk_free((void**)&str2);
}
#endif /* _TEST_URL_H_ */
diff --git a/tinySAK/test/test_uuid.h b/tinySAK/test/test_uuid.h
index 7656b8f..7c54ec2 100755
--- a/tinySAK/test/test_uuid.h
+++ b/tinySAK/test/test_uuid.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,11 +24,11 @@
void test_uuid()
{
- tsk_uuidstring_t uuid;
+ tsk_uuidstring_t uuid;
- tsk_uuidgenerate(&uuid);
+ tsk_uuidgenerate(&uuid);
- TSK_DEBUG_INFO("Generated UUID: %s", uuid);
+ TSK_DEBUG_INFO("Generated UUID: %s", uuid);
}
#endif /* _TEST_UUID_H_ */
diff --git a/tinySAK/winrt/ThreadEmulation.cxx b/tinySAK/winrt/ThreadEmulation.cxx
index f863dc9..91f2294 100755
--- a/tinySAK/winrt/ThreadEmulation.cxx
+++ b/tinySAK/winrt/ThreadEmulation.cxx
@@ -21,335 +21,313 @@ using namespace Windows::System::Threading;
namespace ThreadEmulation
{
- // Stored data for CREATE_SUSPENDED and ResumeThread.
- struct PendingThreadInfo
- {
- LPTHREAD_START_ROUTINE lpStartAddress;
- LPVOID lpParameter;
- HANDLE completionEvent;
- int nPriority;
- };
-
- static map<HANDLE, PendingThreadInfo> pendingThreads;
- static mutex pendingThreadsLock;
-
-
- // Thread local storage.
- typedef vector<void*> ThreadLocalData;
-
- static __declspec(thread) ThreadLocalData* currentThreadData = nullptr;
- static set<ThreadLocalData*> allThreadData;
- static DWORD nextTlsIndex = 0;
- static vector<DWORD> freeTlsIndices;
- static mutex tlsAllocationLock;
-
-
- // Converts a Win32 thread priority to WinRT format.
- static WorkItemPriority GetWorkItemPriority(int nPriority)
- {
- if (nPriority < 0)
- return WorkItemPriority::Low;
- else if (nPriority > 0)
- return WorkItemPriority::High;
- else
- return WorkItemPriority::Normal;
- }
+// Stored data for CREATE_SUSPENDED and ResumeThread.
+struct PendingThreadInfo {
+ LPTHREAD_START_ROUTINE lpStartAddress;
+ LPVOID lpParameter;
+ HANDLE completionEvent;
+ int nPriority;
+};
+static map<HANDLE, PendingThreadInfo> pendingThreads;
+static mutex pendingThreadsLock;
- // Helper shared between CreateThread and ResumeThread.
- static void StartThread(LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, HANDLE completionEvent, int nPriority)
- {
- auto workItemHandler = ref new WorkItemHandler([=](IAsyncAction^)
- {
- // Run the user callback.
- try
- {
- lpStartAddress(lpParameter);
- }
- catch (...) { }
- // Clean up any TLS allocations made by this thread.
- TlsShutdown();
+// Thread local storage.
+typedef vector<void*> ThreadLocalData;
- // Signal that the thread has completed.
- SetEvent(completionEvent);
- CloseHandle(completionEvent);
+static __declspec(thread) ThreadLocalData* currentThreadData = nullptr;
+static set<ThreadLocalData*> allThreadData;
+static DWORD nextTlsIndex = 0;
+static vector<DWORD> freeTlsIndices;
+static mutex tlsAllocationLock;
- }, CallbackContext::Any);
- ThreadPool::RunAsync(workItemHandler, GetWorkItemPriority(nPriority), WorkItemOptions::TimeSliced);
+// Converts a Win32 thread priority to WinRT format.
+static WorkItemPriority GetWorkItemPriority(int nPriority)
+{
+ if (nPriority < 0) {
+ return WorkItemPriority::Low;
+ }
+ else if (nPriority > 0) {
+ return WorkItemPriority::High;
+ }
+ else {
+ return WorkItemPriority::Normal;
}
+}
- _Use_decl_annotations_ HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId)
- {
- // Validate parameters.
- assert(unusedThreadAttributes == nullptr);
- assert(unusedStackSize == 0);
- assert((dwCreationFlags & ~CREATE_SUSPENDED) == 0);
- assert(unusedThreadId == nullptr);
+// Helper shared between CreateThread and ResumeThread.
+static void StartThread(LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, HANDLE completionEvent, int nPriority)
+{
+ auto workItemHandler = ref new WorkItemHandler([=](IAsyncAction^) {
+ // Run the user callback.
+ try {
+ lpStartAddress(lpParameter);
+ }
+ catch (...) { }
- // Create a handle that will be signalled when the thread has completed.
- HANDLE threadHandle = CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
+ // Clean up any TLS allocations made by this thread.
+ TlsShutdown();
- if (!threadHandle)
- return nullptr;
+ // Signal that the thread has completed.
+ SetEvent(completionEvent);
+ CloseHandle(completionEvent);
- // Make a copy of the handle for internal use. This is necessary because
- // the caller is responsible for closing the handle returned by CreateThread,
- // and they may do that before or after the thread has finished running.
- HANDLE completionEvent;
-
- if (!DuplicateHandle(GetCurrentProcess(), threadHandle, GetCurrentProcess(), &completionEvent, 0, false, DUPLICATE_SAME_ACCESS))
- {
- CloseHandle(threadHandle);
- return nullptr;
- }
+ }, CallbackContext::Any);
- try
- {
- if (dwCreationFlags & CREATE_SUSPENDED)
- {
- // Store info about a suspended thread.
- PendingThreadInfo info;
+ ThreadPool::RunAsync(workItemHandler, GetWorkItemPriority(nPriority), WorkItemOptions::TimeSliced);
+}
- info.lpStartAddress = lpStartAddress;
- info.lpParameter = lpParameter;
- info.completionEvent = completionEvent;
- info.nPriority = 0;
- lock_guard<mutex> lock(pendingThreadsLock);
+_Use_decl_annotations_ HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId)
+{
+ // Validate parameters.
+ assert(unusedThreadAttributes == nullptr);
+ assert(unusedStackSize == 0);
+ assert((dwCreationFlags & ~CREATE_SUSPENDED) == 0);
+ assert(unusedThreadId == nullptr);
- pendingThreads[threadHandle] = info;
- }
- else
- {
- // Start the thread immediately.
- StartThread(lpStartAddress, lpParameter, completionEvent, 0);
- }
-
- return threadHandle;
- }
- catch (...)
- {
- // Clean up if thread creation fails.
- CloseHandle(threadHandle);
- CloseHandle(completionEvent);
+ // Create a handle that will be signalled when the thread has completed.
+ HANDLE threadHandle = CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
- return nullptr;
- }
+ if (!threadHandle) {
+ return nullptr;
}
+ // Make a copy of the handle for internal use. This is necessary because
+ // the caller is responsible for closing the handle returned by CreateThread,
+ // and they may do that before or after the thread has finished running.
+ HANDLE completionEvent;
- _Use_decl_annotations_ DWORD WINAPI ResumeThread(HANDLE hThread)
- {
- lock_guard<mutex> lock(pendingThreadsLock);
+ if (!DuplicateHandle(GetCurrentProcess(), threadHandle, GetCurrentProcess(), &completionEvent, 0, false, DUPLICATE_SAME_ACCESS)) {
+ CloseHandle(threadHandle);
+ return nullptr;
+ }
- // Look up the requested thread.
- auto threadInfo = pendingThreads.find(hThread);
+ try {
+ if (dwCreationFlags & CREATE_SUSPENDED) {
+ // Store info about a suspended thread.
+ PendingThreadInfo info;
- if (threadInfo == pendingThreads.end())
- {
- // Can only resume threads while they are in CREATE_SUSPENDED state.
- assert(false);
- return (DWORD)-1;
- }
+ info.lpStartAddress = lpStartAddress;
+ info.lpParameter = lpParameter;
+ info.completionEvent = completionEvent;
+ info.nPriority = 0;
- // Start the thread.
- try
- {
- PendingThreadInfo& info = threadInfo->second;
+ lock_guard<mutex> lock(pendingThreadsLock);
- StartThread(info.lpStartAddress, info.lpParameter, info.completionEvent, info.nPriority);
+ pendingThreads[threadHandle] = info;
}
- catch (...)
- {
- return (DWORD)-1;
+ else {
+ // Start the thread immediately.
+ StartThread(lpStartAddress, lpParameter, completionEvent, 0);
}
- // Remove this thread from the pending list.
- pendingThreads.erase(threadInfo);
+ return threadHandle;
+ }
+ catch (...) {
+ // Clean up if thread creation fails.
+ CloseHandle(threadHandle);
+ CloseHandle(completionEvent);
- return 0;
+ return nullptr;
}
+}
- _Use_decl_annotations_ BOOL WINAPI SetThreadPriority(HANDLE hThread, int nPriority)
- {
- lock_guard<mutex> lock(pendingThreadsLock);
+_Use_decl_annotations_ DWORD WINAPI ResumeThread(HANDLE hThread)
+{
+ lock_guard<mutex> lock(pendingThreadsLock);
- // Look up the requested thread.
- auto threadInfo = pendingThreads.find(hThread);
+ // Look up the requested thread.
+ auto threadInfo = pendingThreads.find(hThread);
- if (threadInfo == pendingThreads.end())
- {
- // Can only set priority on threads while they are in CREATE_SUSPENDED state.
- return false;
- }
+ if (threadInfo == pendingThreads.end()) {
+ // Can only resume threads while they are in CREATE_SUSPENDED state.
+ assert(false);
+ return (DWORD)-1;
+ }
- // Store the new priority.
- threadInfo->second.nPriority = nPriority;
+ // Start the thread.
+ try {
+ PendingThreadInfo& info = threadInfo->second;
- return true;
+ StartThread(info.lpStartAddress, info.lpParameter, info.completionEvent, info.nPriority);
+ }
+ catch (...) {
+ return (DWORD)-1;
}
+ // Remove this thread from the pending list.
+ pendingThreads.erase(threadInfo);
- _Use_decl_annotations_ VOID WINAPI Sleep(DWORD dwMilliseconds)
- {
- static HANDLE singletonEvent = nullptr;
+ return 0;
+}
- HANDLE sleepEvent = singletonEvent;
- // Demand create the event.
- if (!sleepEvent)
- {
- sleepEvent = CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
-
- if (!sleepEvent)
- return;
-
- HANDLE previousEvent = InterlockedCompareExchangePointerRelease(&singletonEvent, sleepEvent, nullptr);
-
- if (previousEvent)
- {
- // Back out if multiple threads try to demand create at the same time.
- CloseHandle(sleepEvent);
- sleepEvent = previousEvent;
- }
- }
+_Use_decl_annotations_ BOOL WINAPI SetThreadPriority(HANDLE hThread, int nPriority)
+{
+ lock_guard<mutex> lock(pendingThreadsLock);
+
+ // Look up the requested thread.
+ auto threadInfo = pendingThreads.find(hThread);
- // Emulate sleep by waiting with timeout on an event that is never signalled.
- WaitForSingleObjectEx(sleepEvent, dwMilliseconds, false);
+ if (threadInfo == pendingThreads.end()) {
+ // Can only set priority on threads while they are in CREATE_SUSPENDED state.
+ return false;
}
+ // Store the new priority.
+ threadInfo->second.nPriority = nPriority;
- DWORD WINAPI TlsAlloc()
- {
- lock_guard<mutex> lock(tlsAllocationLock);
-
- // Can we reuse a previously freed TLS slot?
- if (!freeTlsIndices.empty())
- {
- DWORD result = freeTlsIndices.back();
- freeTlsIndices.pop_back();
- return result;
- }
+ return true;
+}
- // Allocate a new TLS slot.
- return nextTlsIndex++;
- }
+_Use_decl_annotations_ VOID WINAPI Sleep(DWORD dwMilliseconds)
+{
+ static HANDLE singletonEvent = nullptr;
- _Use_decl_annotations_ BOOL WINAPI TlsFree(DWORD dwTlsIndex)
- {
- lock_guard<mutex> lock(tlsAllocationLock);
+ HANDLE sleepEvent = singletonEvent;
- assert(dwTlsIndex < nextTlsIndex);
- assert(find(freeTlsIndices.begin(), freeTlsIndices.end(), dwTlsIndex) == freeTlsIndices.end());
+ // Demand create the event.
+ if (!sleepEvent) {
+ sleepEvent = CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
- // Store this slot for reuse by TlsAlloc.
- try
- {
- freeTlsIndices.push_back(dwTlsIndex);
- }
- catch (...)
- {
- return false;
+ if (!sleepEvent) {
+ return;
}
- // Zero the value for all threads that might be using this now freed slot.
- for each (auto threadData in allThreadData)
- {
- if (threadData->size() > dwTlsIndex)
- {
- threadData->at(dwTlsIndex) = nullptr;
- }
+ HANDLE previousEvent = InterlockedCompareExchangePointerRelease(&singletonEvent, sleepEvent, nullptr);
+
+ if (previousEvent) {
+ // Back out if multiple threads try to demand create at the same time.
+ CloseHandle(sleepEvent);
+ sleepEvent = previousEvent;
}
+ }
+
+ // Emulate sleep by waiting with timeout on an event that is never signalled.
+ WaitForSingleObjectEx(sleepEvent, dwMilliseconds, false);
+}
+
- return true;
+DWORD WINAPI TlsAlloc()
+{
+ lock_guard<mutex> lock(tlsAllocationLock);
+
+ // Can we reuse a previously freed TLS slot?
+ if (!freeTlsIndices.empty()) {
+ DWORD result = freeTlsIndices.back();
+ freeTlsIndices.pop_back();
+ return result;
}
+ // Allocate a new TLS slot.
+ return nextTlsIndex++;
+}
- _Use_decl_annotations_ LPVOID WINAPI TlsGetValue(DWORD dwTlsIndex)
- {
- ThreadLocalData* threadData = currentThreadData;
- if (threadData && threadData->size() > dwTlsIndex)
- {
- // Return the value of an allocated TLS slot.
- return threadData->at(dwTlsIndex);
- }
- else
- {
- // Default value for unallocated slots.
- return nullptr;
+_Use_decl_annotations_ BOOL WINAPI TlsFree(DWORD dwTlsIndex)
+{
+ lock_guard<mutex> lock(tlsAllocationLock);
+
+ assert(dwTlsIndex < nextTlsIndex);
+ assert(find(freeTlsIndices.begin(), freeTlsIndices.end(), dwTlsIndex) == freeTlsIndices.end());
+
+ // Store this slot for reuse by TlsAlloc.
+ try {
+ freeTlsIndices.push_back(dwTlsIndex);
+ }
+ catch (...) {
+ return false;
+ }
+
+ // Zero the value for all threads that might be using this now freed slot.
+ for each (auto threadData in allThreadData) {
+ if (threadData->size() > dwTlsIndex) {
+ threadData->at(dwTlsIndex) = nullptr;
}
}
+ return true;
+}
- _Use_decl_annotations_ BOOL WINAPI TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
- {
- ThreadLocalData* threadData = currentThreadData;
- if (!threadData)
- {
- // First time allocation of TLS data for this thread.
- try
- {
- threadData = new ThreadLocalData(dwTlsIndex + 1, nullptr);
-
- lock_guard<mutex> lock(tlsAllocationLock);
+_Use_decl_annotations_ LPVOID WINAPI TlsGetValue(DWORD dwTlsIndex)
+{
+ ThreadLocalData* threadData = currentThreadData;
+
+ if (threadData && threadData->size() > dwTlsIndex) {
+ // Return the value of an allocated TLS slot.
+ return threadData->at(dwTlsIndex);
+ }
+ else {
+ // Default value for unallocated slots.
+ return nullptr;
+ }
+}
- allThreadData.insert(threadData);
- currentThreadData = threadData;
- }
- catch (...)
- {
- if (threadData)
- delete threadData;
+_Use_decl_annotations_ BOOL WINAPI TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
+{
+ ThreadLocalData* threadData = currentThreadData;
+
+ if (!threadData) {
+ // First time allocation of TLS data for this thread.
+ try {
+ threadData = new ThreadLocalData(dwTlsIndex + 1, nullptr);
+
+ lock_guard<mutex> lock(tlsAllocationLock);
+
+ allThreadData.insert(threadData);
- return false;
+ currentThreadData = threadData;
+ }
+ catch (...) {
+ if (threadData) {
+ delete threadData;
}
+
+ return false;
}
- else if (threadData->size() <= dwTlsIndex)
- {
- // This thread already has a TLS data block, but it must be expanded to fit the specified slot.
- try
- {
- lock_guard<mutex> lock(tlsAllocationLock);
+ }
+ else if (threadData->size() <= dwTlsIndex) {
+ // This thread already has a TLS data block, but it must be expanded to fit the specified slot.
+ try {
+ lock_guard<mutex> lock(tlsAllocationLock);
- threadData->resize(dwTlsIndex + 1, nullptr);
- }
- catch (...)
- {
- return false;
- }
+ threadData->resize(dwTlsIndex + 1, nullptr);
}
+ catch (...) {
+ return false;
+ }
+ }
- // Store the new value for this slot.
- threadData->at(dwTlsIndex) = lpTlsValue;
+ // Store the new value for this slot.
+ threadData->at(dwTlsIndex) = lpTlsValue;
- return true;
- }
+ return true;
+}
- // Called at thread exit to clean up TLS allocations.
- void WINAPI TlsShutdown()
- {
- ThreadLocalData* threadData = currentThreadData;
+// Called at thread exit to clean up TLS allocations.
+void WINAPI TlsShutdown()
+{
+ ThreadLocalData* threadData = currentThreadData;
- if (threadData)
+ if (threadData) {
{
- {
- lock_guard<mutex> lock(tlsAllocationLock);
+ lock_guard<mutex> lock(tlsAllocationLock);
- allThreadData.erase(threadData);
- }
+ allThreadData.erase(threadData);
+ }
- currentThreadData = nullptr;
+ currentThreadData = nullptr;
- delete threadData;
- }
+ delete threadData;
}
+}
} \ No newline at end of file
diff --git a/tinySAK/winrt/ThreadEmulation.h b/tinySAK/winrt/ThreadEmulation.h
index 37deabc..b07bb13 100755
--- a/tinySAK/winrt/ThreadEmulation.h
+++ b/tinySAK/winrt/ThreadEmulation.h
@@ -34,20 +34,20 @@
namespace ThreadEmulation
{
- #ifndef CREATE_SUSPENDED
- #define CREATE_SUSPENDED 0x00000004
- #endif
+#ifndef CREATE_SUSPENDED
+#define CREATE_SUSPENDED 0x00000004
+#endif
- HANDLE WINAPI CreateThread(_In_opt_ LPSECURITY_ATTRIBUTES unusedThreadAttributes, _In_ SIZE_T unusedStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD unusedThreadId);
- DWORD WINAPI ResumeThread(_In_ HANDLE hThread);
- BOOL WINAPI SetThreadPriority(_In_ HANDLE hThread, _In_ int nPriority);
-
- VOID WINAPI Sleep(_In_ DWORD dwMilliseconds);
+HANDLE WINAPI CreateThread(_In_opt_ LPSECURITY_ATTRIBUTES unusedThreadAttributes, _In_ SIZE_T unusedStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD unusedThreadId);
+DWORD WINAPI ResumeThread(_In_ HANDLE hThread);
+BOOL WINAPI SetThreadPriority(_In_ HANDLE hThread, _In_ int nPriority);
- DWORD WINAPI TlsAlloc();
- BOOL WINAPI TlsFree(_In_ DWORD dwTlsIndex);
- LPVOID WINAPI TlsGetValue(_In_ DWORD dwTlsIndex);
- BOOL WINAPI TlsSetValue(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue);
-
- void WINAPI TlsShutdown();
+VOID WINAPI Sleep(_In_ DWORD dwMilliseconds);
+
+DWORD WINAPI TlsAlloc();
+BOOL WINAPI TlsFree(_In_ DWORD dwTlsIndex);
+LPVOID WINAPI TlsGetValue(_In_ DWORD dwTlsIndex);
+BOOL WINAPI TlsSetValue(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue);
+
+void WINAPI TlsShutdown();
}
diff --git a/tinySDP/include/tinysdp.h b/tinySDP/include/tinysdp.h
index 96883de..cc615c4 100755
--- a/tinySDP/include/tinysdp.h
+++ b/tinySDP/include/tinysdp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header.h b/tinySDP/include/tinysdp/headers/tsdp_header.h
index ce669b5..64ba7d4 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -72,38 +72,36 @@ typedef struct tsdp_header_s* (*tsdp_header_clone_f)(const struct tsdp_header_s*
*
* @brief List of all supported headers.
**/
-typedef enum tsdp_header_type_e
-{
- tsdp_htype_A,
- tsdp_htype_B,
- tsdp_htype_C,
- tsdp_htype_Dummy,
- tsdp_htype_E,
- tsdp_htype_I,
- tsdp_htype_K,
- tsdp_htype_M,
- tsdp_htype_O,
- tsdp_htype_P,
- tsdp_htype_R,
- tsdp_htype_S,
- tsdp_htype_T,
- tsdp_htype_U,
- tsdp_htype_V,
- tsdp_htype_Z
+typedef enum tsdp_header_type_e {
+ tsdp_htype_A,
+ tsdp_htype_B,
+ tsdp_htype_C,
+ tsdp_htype_Dummy,
+ tsdp_htype_E,
+ tsdp_htype_I,
+ tsdp_htype_K,
+ tsdp_htype_M,
+ tsdp_htype_O,
+ tsdp_htype_P,
+ tsdp_htype_R,
+ tsdp_htype_S,
+ tsdp_htype_T,
+ tsdp_htype_U,
+ tsdp_htype_V,
+ tsdp_htype_Z
}
tsdp_header_type_t;
/*================================
*/
-typedef struct tsdp_header_s
-{
- TSK_DECLARE_OBJECT;
- tsdp_header_type_t type;
- //! Because all SDP headers shall appear in a fixed order, the rank is used to place each header.
- // Info: RFC 4566 - 5. SDP Specification.
- uint8_t rank;
- tsdp_header_value_tostring_f tostring;
- tsdp_header_clone_f clone;
+typedef struct tsdp_header_s {
+ TSK_DECLARE_OBJECT;
+ tsdp_header_type_t type;
+ //! Because all SDP headers shall appear in a fixed order, the rank is used to place each header.
+ // Info: RFC 4566 - 5. SDP Specification.
+ uint8_t rank;
+ tsdp_header_value_tostring_f tostring;
+ tsdp_header_clone_f clone;
}
tsdp_header_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_A.h b/tinySDP/include/tinysdp/headers/tsdp_header_A.h
index 04aff7f..0ea59bb 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_A.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_A.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_A_H_
#define _TSDP_HEADER_A_H_
@@ -40,22 +40,21 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_A(self) ((tsdp_header_A_t*)(self))
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "a=" header (Attributes).
///
/// @par ABNF : a=attribute
/// attribute = (att-field ":" att-value) / att-field
/// att-field = token
-/// att-value = byte-string
-///
+/// att-value = byte-string
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_A_s
-{
- TSDP_DECLARE_HEADER;
+typedef struct tsdp_header_A_s {
+ TSDP_DECLARE_HEADER;
- char* field;
- char* value;
+ char* field;
+ char* value;
}
tsdp_header_A_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_B.h b/tinySDP/include/tinysdp/headers/tsdp_header_B.h
index 360d3d7..46bbe87 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_B.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_B.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_B_H_
#define _TSDP_HEADER_B_H_
@@ -39,21 +39,20 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_B_VA_ARGS(bwtype, bandwidth) tsdp_header_B_def_t, (const char*)bwtype, (uint32_t)bandwidth
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "b=" header (Bandwidth).
///
/// @par ABNF : b=<bwtype> HCOLON <bandwidth>
-/// bwtype = token
+/// bwtype = token
/// bandwidth = 1*DIGIT
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_B_s
-{
- TSDP_DECLARE_HEADER;
+typedef struct tsdp_header_B_s {
+ TSDP_DECLARE_HEADER;
- char* bwtype;
- uint32_t bandwidth;
+ char* bwtype;
+ uint32_t bandwidth;
}
tsdp_header_B_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_C.h b/tinySDP/include/tinysdp/headers/tsdp_header_C.h
index e5c5399..c11a23c 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_C.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_C.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_C_H_
#define _TSDP_HEADER_C_H_
@@ -38,7 +38,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_C_VA_ARGS(nettype, addrtype, addr) tsdp_header_C_def_t, (const char*)(nettype), (const char*)(addrtype), (const char*)(addr)
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "c=" header (Connection Data).
/// A session description MUST contain either at least one "c=" field in
@@ -46,18 +46,17 @@ TSDP_BEGIN_DECLS
/// It MAY contain a single session-level "c=" field and additional "c="
/// field(s) per media description, in which case the per-media values
/// override the session-level settings for the respective media.
-///
+///
///
///
/// @par ABNF : c= nettype SP addrtype SP connection-address
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_C_s
-{
- TSDP_DECLARE_HEADER;
- char* nettype;
- char* addrtype;
- char* addr;
+typedef struct tsdp_header_C_s {
+ TSDP_DECLARE_HEADER;
+ char* nettype;
+ char* addrtype;
+ char* addr;
}
tsdp_header_C_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h b/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h
index e9ec9b5..4191507 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_DUMMY_VA_ARGS(name, value) tsdp_header_Dummy_def_t, (char)name, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP Dummy header.
///
/// @par ABNF : alpha SP* "=" SP*<: any*
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_Dummy_s
-{
- TSDP_DECLARE_HEADER;
- char name;
- char *value;
+typedef struct tsdp_header_Dummy_s {
+ TSDP_DECLARE_HEADER;
+ char name;
+ char *value;
}
tsdp_header_Dummy_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_E.h b/tinySDP/include/tinysdp/headers/tsdp_header_E.h
index a024b6a..23e1c7a 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_E.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_E.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_E_H_
#define _TSDP_HEADER_E_H_
@@ -38,7 +38,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_E_VA_ARGS(value) tsdp_header_E_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "e=" header (Email Address).
///
@@ -46,13 +46,12 @@ TSDP_BEGIN_DECLS
/// responsible for the conference. This is not necessarily the same
/// person that created the conference announcement.
///
-/// @par ABNF : e= email-address
-///
+/// @par ABNF : e= email-address
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_E_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_E_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_E_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_I.h b/tinySDP/include/tinysdp/headers/tsdp_header_I.h
index 5f5d4fd..875ccfb 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_I.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_I.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_I_H_
#define _TSDP_HEADER_I_H_
@@ -38,17 +38,16 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_I_VA_ARGS(value) tsdp_header_I_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "i=" header (Session Information).
///
-/// @par ABNF : i=text
-///
+/// @par ABNF : i=text
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_I_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_I_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_I_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_K.h b/tinySDP/include/tinysdp/headers/tsdp_header_K.h
index 5ca090f..5709b5d 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_K.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_K.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_K_H_
#define _TSDP_HEADER_K_H_
@@ -38,7 +38,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_K_VA_ARGS(value) tsdp_header_K_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "k=" header (Encryption Key).
///
@@ -48,13 +48,12 @@ TSDP_BEGIN_DECLS
/// base64 = *base64-unit [base64-pad]
/// base64-unit = 4base64-char
/// base64-pad = 2base64-char "==" / 3base64-pad "="
-/// base64-char = ALPHA / DIGIT / "+" / "/"
-///
+/// base64-char = ALPHA / DIGIT / "+" / "/"
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_K_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_K_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_K_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_M.h b/tinySDP/include/tinysdp/headers/tsdp_header_M.h
index fad13b0..212be67 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_M.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_M.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_M_H_
#define _TSDP_HEADER_M_H_
@@ -61,7 +61,7 @@ TINYSDP_API tsdp_fmt_t* tsdp_fmt_create(const char* fmt);
//#define TSDP_HEADER_M_SET_NULL() (int)0x00
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "m=" header (Media Descriptions).
///
@@ -72,44 +72,43 @@ TINYSDP_API tsdp_fmt_t* tsdp_fmt_create(const char* fmt);
/// key-field
/// attribute-fields)
///
-/// media-field = %x6d "=" media SP port ["/" integer] SP proto 1*(SP fmt) CRLF
-/// media = token
+/// media-field = %x6d "=" media SP port ["/" integer] SP proto 1*(SP fmt) CRLF
+/// media = token
/// port = 1*DIGIT
-/// proto = token *("/" token)
-/// fmt = token
-///
+/// proto = token *("/" token)
+/// fmt = token
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_M_s
-{
- TSDP_DECLARE_HEADER;
-
- char* media;
- uint32_t port;
- uint32_t nports; /**< <number of ports> */
- char* proto;
- tsk_fmts_L_t* FMTs;
-
- // Fields below will be set by the message parser.
- tsdp_header_I_t* I;
- tsdp_header_C_t* C;
- tsdp_headers_B_L_t* Bandwidths; // (zero or more bandwidth information lines)
- tsdp_header_K_t* K; // (encryption key)
- tsdp_headers_A_L_t* Attributes; // (zero or more media attribute lines)
+typedef struct tsdp_header_M_s {
+ TSDP_DECLARE_HEADER;
+
+ char* media;
+ uint32_t port;
+ uint32_t nports; /**< <number of ports> */
+ char* proto;
+ tsk_fmts_L_t* FMTs;
+
+ // Fields below will be set by the message parser.
+ tsdp_header_I_t* I;
+ tsdp_header_C_t* C;
+ tsdp_headers_B_L_t* Bandwidths; // (zero or more bandwidth information lines)
+ tsdp_header_K_t* K; // (encryption key)
+ tsdp_headers_A_L_t* Attributes; // (zero or more media attribute lines)
}
tsdp_header_M_t;
typedef enum tsdp_header_M_diff_e {
- tsdp_header_M_diff_none = 0x0000000,
- tsdp_header_M_diff_hold_resume = (0x0000001 << 0),
- tsdp_header_M_diff_index = (0x0000001 << 1),
- tsdp_header_M_diff_codecs = (0x0000001 << 2),
- tsdp_header_M_diff_network_info = (0x0000001 << 3),
- tsdp_header_M_diff_ice_enabled = (0x0000001 << 4),
- tsdp_header_M_diff_ice_restart = (0x0000001 << 5),
- tsdp_header_M_diff_dtls_fingerprint = (0x0000001 << 6),
- tsdp_header_M_diff_sdes_crypto = (0x0000001 << 7),
- tsdp_header_M_diff_media_type = (0x0000001 << 8),
- tsdp_header_M_diff_all = 0xFFFFFFFF
+ tsdp_header_M_diff_none = 0x0000000,
+ tsdp_header_M_diff_hold_resume = (0x0000001 << 0),
+ tsdp_header_M_diff_index = (0x0000001 << 1),
+ tsdp_header_M_diff_codecs = (0x0000001 << 2),
+ tsdp_header_M_diff_network_info = (0x0000001 << 3),
+ tsdp_header_M_diff_ice_enabled = (0x0000001 << 4),
+ tsdp_header_M_diff_ice_restart = (0x0000001 << 5),
+ tsdp_header_M_diff_dtls_fingerprint = (0x0000001 << 6),
+ tsdp_header_M_diff_sdes_crypto = (0x0000001 << 7),
+ tsdp_header_M_diff_media_type = (0x0000001 << 8),
+ tsdp_header_M_diff_all = 0xFFFFFFFF
}
tsdp_header_M_diff_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_O.h b/tinySDP/include/tinysdp/headers/tsdp_header_O.h
index 20a1994..ceda65c 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_O.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_O.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,7 +43,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_O_SESS_VERSION_DEFAULT 678901
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "o=" header (Origin).
/// The "o=" field gives the originator of the session (her username and
@@ -52,56 +52,55 @@ TSDP_BEGIN_DECLS
/// @par ABNF : u=username SP
/// sess-id SP sess-version SP nettype SP addrtype SP unicast-address
///
-/// username = non-ws-string
+/// username = non-ws-string
/// sess-id = 1*DIGIT
/// sess-version = 1*DIGIT
-/// nettype = token
+/// nettype = token
/// addrtype = token
/// unicast-address = FQDN
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_O_s
-{
- TSDP_DECLARE_HEADER;
+typedef struct tsdp_header_O_s {
+ TSDP_DECLARE_HEADER;
- /** <username> is the user's login on the originating host, or it is "-"
- if the originating host does not support the concept of user IDs.
- The <username> MUST NOT contain spaces.*/
- char* username;
- /** <sess-id>, <nettype>, <addrtype>, and <unicast-address> forms a
- globally unique identifier for the session. The method of
- <sess-id> allocation is up to the creating tool, but it has been
- suggested that a Network Time Protocol (NTP) format timestamp be
- used to ensure uniqueness*/
- uint32_t sess_id;
- /** <sess-version> is a version number for this session description. Its
- usage is up to the creating tool, so long as <sess-version> is
- increased when a modification is made to the session data. Again,
- it is RECOMMENDED that an NTP format timestamp is used.*/
- uint32_t sess_version;
- /** <nettype> is a text string giving the type of network. Initially
- "IN" is defined to have the meaning "Internet", but other values
- MAY be registered in the future (see Section 8 of RFC 4566)*/
- char* nettype;
- /**<addrtype> is a text string giving the type of the address that
- follows. Initially "IP4" and "IP6" are defined, but other values
- MAY be registered in the future (see Section 8 of RFC 4566)*/
- char* addrtype;
- /** <unicast-address> is the address of the machine from which the
- session was created. For an address type of IP4, this is either
- the fully qualified domain name of the machine or the dotted-
- decimal representation of the IP version 4 address of the machine.
- For an address type of IP6, this is either the fully qualified
- domain name of the machine or the compressed textual
- representation of the IP version 6 address of the machine. For
- both IP4 and IP6, the fully qualified domain name is the form that
- SHOULD be given unless this is unavailable, in which case the
- globally unique address MAY be substituted. A local IP address
- MUST NOT be used in any context where the SDP description might
- leave the scope in which the address is meaningful (for example, a
- local address MUST NOT be included in an application-level
- referral that might leave the scope)*/
- char* addr;
+ /** <username> is the user's login on the originating host, or it is "-"
+ if the originating host does not support the concept of user IDs.
+ The <username> MUST NOT contain spaces.*/
+ char* username;
+ /** <sess-id>, <nettype>, <addrtype>, and <unicast-address> forms a
+ globally unique identifier for the session. The method of
+ <sess-id> allocation is up to the creating tool, but it has been
+ suggested that a Network Time Protocol (NTP) format timestamp be
+ used to ensure uniqueness*/
+ uint32_t sess_id;
+ /** <sess-version> is a version number for this session description. Its
+ usage is up to the creating tool, so long as <sess-version> is
+ increased when a modification is made to the session data. Again,
+ it is RECOMMENDED that an NTP format timestamp is used.*/
+ uint32_t sess_version;
+ /** <nettype> is a text string giving the type of network. Initially
+ "IN" is defined to have the meaning "Internet", but other values
+ MAY be registered in the future (see Section 8 of RFC 4566)*/
+ char* nettype;
+ /**<addrtype> is a text string giving the type of the address that
+ follows. Initially "IP4" and "IP6" are defined, but other values
+ MAY be registered in the future (see Section 8 of RFC 4566)*/
+ char* addrtype;
+ /** <unicast-address> is the address of the machine from which the
+ session was created. For an address type of IP4, this is either
+ the fully qualified domain name of the machine or the dotted-
+ decimal representation of the IP version 4 address of the machine.
+ For an address type of IP6, this is either the fully qualified
+ domain name of the machine or the compressed textual
+ representation of the IP version 6 address of the machine. For
+ both IP4 and IP6, the fully qualified domain name is the form that
+ SHOULD be given unless this is unavailable, in which case the
+ globally unique address MAY be substituted. A local IP address
+ MUST NOT be used in any context where the SDP description might
+ leave the scope in which the address is meaningful (for example, a
+ local address MUST NOT be included in an application-level
+ referral that might leave the scope)*/
+ char* addr;
}
tsdp_header_O_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_P.h b/tinySDP/include/tinysdp/headers/tsdp_header_P.h
index ca73886..0824bbb 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_P.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_P.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_P_H_
#define _TSDP_HEADER_P_H_
@@ -38,7 +38,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_P_VA_ARGS(value) tsdp_header_P_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "p=" header (Phone Number).
/// The "p=" line specifies contact information for the person
@@ -47,12 +47,11 @@ TSDP_BEGIN_DECLS
///
///
/// @par ABNF : p= phone-number
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_P_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_P_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_P_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_R.h b/tinySDP/include/tinysdp/headers/tsdp_header_R.h
index a5277cc..fb486ec 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_R.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_R.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_R_H_
#define _TSDP_HEADER_R_H_
@@ -40,7 +40,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_R_VA_ARGS() tsdp_header_R_def_t
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "r=" header (Repeat Times).
///
@@ -48,17 +48,16 @@ TSDP_BEGIN_DECLS
///
/// @par ABNF : r= repeat-interval SP typed-time 1*(SP typed-time)
/// repeat-interval = POS-DIGIT *DIGIT [fixed-len-time-unit]
-/// typed-time = 1*DIGIT [fixed-len-time-unit]
-/// 1*DIGIT [fixed-len-time-unit]
+/// typed-time = 1*DIGIT [fixed-len-time-unit]
+/// 1*DIGIT [fixed-len-time-unit]
/// fixed-len-time-unit = "d" / "h" / "m" / "s"
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_R_s
-{
- TSDP_DECLARE_HEADER;
- char* repeat_interval;
- char* typed_time;
- tsk_strings_L_t* typed_times;
+typedef struct tsdp_header_R_s {
+ TSDP_DECLARE_HEADER;
+ char* repeat_interval;
+ char* typed_time;
+ tsk_strings_L_t* typed_times;
}
tsdp_header_R_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_S.h b/tinySDP/include/tinysdp/headers/tsdp_header_S.h
index 4f2316a..a573242 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_S.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_S.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,17 +38,16 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_S_VA_ARGS(value) tsdp_header_S_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "s=" header (Session Name).
///
-/// @par ABNF : s=text
-///
+/// @par ABNF : s=text
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_S_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_S_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_S_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_T.h b/tinySDP/include/tinysdp/headers/tsdp_header_T.h
index 596094d..d4cf158 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_T.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_T.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_T_H_
#define _TSDP_HEADER_T_H_
@@ -40,7 +40,7 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_T_VA_ARGS(start, stop) tsdp_header_T_def_t, (uint64_t)start, (uint64_t)stop
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "t=" header (Timing).
/// The "t=" lines specify the start and stop times for a session.
@@ -53,16 +53,15 @@ TSDP_BEGIN_DECLS
/// sequence.
///
///
-/// @par ABNF : t= start-time SP stop-time *( CRLF repeat-fields )
-///
+/// @par ABNF : t= start-time SP stop-time *( CRLF repeat-fields )
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_T_s
-{
- TSDP_DECLARE_HEADER;
- uint64_t start;
- uint64_t stop;
+typedef struct tsdp_header_T_s {
+ TSDP_DECLARE_HEADER;
+ uint64_t start;
+ uint64_t stop;
- tsdp_headers_R_L_t* repeat_fields;
+ tsdp_headers_R_L_t* repeat_fields;
}
tsdp_header_T_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_U.h b/tinySDP/include/tinysdp/headers/tsdp_header_U.h
index d42a503..fc10b23 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_U.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_U.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,17 +38,16 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_U_VA_ARGS(value) tsdp_header_U_def_t, (const char*)value
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "u=" header (URI).
///
-/// @par ABNF : u=uri
-///
+/// @par ABNF : u=uri
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_U_s
-{
- TSDP_DECLARE_HEADER;
- char* value;
+typedef struct tsdp_header_U_s {
+ TSDP_DECLARE_HEADER;
+ char* value;
}
tsdp_header_U_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_V.h b/tinySDP/include/tinysdp/headers/tsdp_header_V.h
index bf3578a..27639b8 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_V.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_V.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,19 +40,18 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_V_DEFAULT 0
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "v=" header (Protocol Version).
/// The "v=" field gives the version of the Session Description Protocol.
/// This memo (RFC 4566) defines version 0. There is no minor version number.
///
-/// @par ABNF : v=1*DIGIT
-///
+/// @par ABNF : v=1*DIGIT
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_V_s
-{
- TSDP_DECLARE_HEADER;
- int32_t version;
+typedef struct tsdp_header_V_s {
+ TSDP_DECLARE_HEADER;
+ int32_t version;
}
tsdp_header_V_t;
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_Z.h b/tinySDP/include/tinysdp/headers/tsdp_header_Z.h
index e962cc8..2ae5da7 100755
--- a/tinySDP/include/tinysdp/headers/tsdp_header_Z.h
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_Z.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -25,7 +25,7 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
- *
+ *
*/
#ifndef _TSDP_HEADER_Z_H_
#define _TSDP_HEADER_Z_H_
@@ -37,13 +37,12 @@ TSDP_BEGIN_DECLS
#define TSDP_HEADER_Z_VA_ARGS(time, shifted_back, typed_time) tsdp_header_Z_def_t, (uint64_t)time, (tsk_bool_t)shifted_back, (const char*)typed_time
-typedef struct tsdp_zone_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsdp_zone_s {
+ TSK_DECLARE_OBJECT;
- uint64_t time;
- tsk_bool_t shifted_back;
- char* typed_time;
+ uint64_t time;
+ tsk_bool_t shifted_back;
+ char* typed_time;
}
tsdp_zone_t;
typedef tsk_list_t tsdp_zones_L_t;
@@ -52,7 +51,7 @@ TINYSDP_API tsdp_zone_t* tsdp_zone_create(uint64_t time, tsk_bool_t shifted_back
TINYSDP_API tsdp_zone_t* tsdp_zone_create_null();
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @struct
+/// @struct
///
/// @brief SDP "z=" header (Time Zones).
///
@@ -60,14 +59,13 @@ TINYSDP_API tsdp_zone_t* tsdp_zone_create_null();
/// *(SP time SP ["-"] typed-time)
/// time = POS-DIGIT 9*DIGIT
/// typed-time = 1*DIGIT [fixed-len-time-unit]
-/// fixed-len-time-unit = "d" / "h" / "m" / "s"
-///
+/// fixed-len-time-unit = "d" / "h" / "m" / "s"
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsdp_header_Z_s
-{
- TSDP_DECLARE_HEADER;
+typedef struct tsdp_header_Z_s {
+ TSDP_DECLARE_HEADER;
- tsdp_zones_L_t* zones;
+ tsdp_zones_L_t* zones;
}
tsdp_header_Z_t;
diff --git a/tinySDP/include/tinysdp/parsers/tsdp_parser_message.h b/tinySDP/include/tinysdp/parsers/tsdp_parser_message.h
index 811cb86..2e39cdc 100755
--- a/tinySDP/include/tinysdp/parsers/tsdp_parser_message.h
+++ b/tinySDP/include/tinysdp/parsers/tsdp_parser_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySDP/include/tinysdp/tsdp_message.h b/tinySDP/include/tinysdp/tsdp_message.h
index 4d7c226..6707ee1 100755
--- a/tinySDP/include/tinysdp/tsdp_message.h
+++ b/tinySDP/include/tinysdp/tsdp_message.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,12 +33,11 @@
TSDP_BEGIN_DECLS
-typedef struct tsdp_message_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsdp_message_s {
+ TSK_DECLARE_OBJECT;
- //! List of @ref tsdp_header_t elements.
- tsdp_headers_L_t* headers;
+ //! List of @ref tsdp_header_t elements.
+ tsdp_headers_L_t* headers;
}
tsdp_message_t;
@@ -51,19 +50,19 @@ TINYSDP_API int tsdp_message_add_headers(tsdp_message_t *self, ...);
#if defined(__SYMBIAN32__) && 0
static void TSDP_MESSAGE_ADD_HEADER(tsdp_message_t *self, ...)
- {
- va_list ap;
- tsdp_header_t *header;
- const tsk_object_def_t *objdef;
-
- va_start(ap, self);
- objdef = va_arg(ap, const tsk_object_def_t*);
- header = (tsdp_header_t *)tsk_object_new_2(objdef, &ap);
- va_end(ap);
-
- tsdp_message_add_header(self, header);
- tsk_object_unref(header);
- }
+{
+ va_list ap;
+ tsdp_header_t *header;
+ const tsk_object_def_t *objdef;
+
+ va_start(ap, self);
+ objdef = va_arg(ap, const tsk_object_def_t*);
+ header = (tsdp_header_t *)tsk_object_new_2(objdef, &ap);
+ va_end(ap);
+
+ tsdp_message_add_header(self, header);
+ tsk_object_unref(header);
+}
#else
#define TSDP_MESSAGE_ADD_HEADER(self, objdef, ...) \
{ \
diff --git a/tinySDP/include/tinysdp_config.h b/tinySDP/include/tinysdp_config.h
index 23ee4c8..ea8a907 100755
--- a/tinySDP/include/tinysdp_config.h
+++ b/tinySDP/include/tinysdp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -63,13 +63,13 @@
# define TINYSDP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TSDP_BEGIN_DECLS extern "C" {
# define TSDP_END_DECLS }
#else
-# define TSDP_BEGIN_DECLS
+# define TSDP_BEGIN_DECLS
# define TSDP_END_DECLS
#endif
@@ -93,7 +93,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYSDP_CONFIG_H
diff --git a/tinySDP/include/tsdp.h b/tinySDP/include/tsdp.h
index f09e9f4..ba030db 100755
--- a/tinySDP/include/tsdp.h
+++ b/tinySDP/include/tsdp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySDP/src/headers/tsdp_header.c b/tinySDP/src/headers/tsdp_header.c
index f288f85..350da3c 100755
--- a/tinySDP/src/headers/tsdp_header.c
+++ b/tinySDP/src/headers/tsdp_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,105 +35,120 @@
int tsdp_header_rank_cmp(const tsdp_header_t* hdr1, const tsdp_header_t* hdr2)
{
- if(hdr1 && hdr2){
- return (hdr1->rank - hdr2->rank);
- }
- else{
- return -1;
- }
+ if(hdr1 && hdr2) {
+ return (hdr1->rank - hdr2->rank);
+ }
+ else {
+ return -1;
+ }
}
tsdp_header_t* tsdp_header_clone(const tsdp_header_t* self)
{
- if(self){
- return self->clone(self);
- }
- return tsk_null;
+ if(self) {
+ return self->clone(self);
+ }
+ return tsk_null;
}
-/** Gets the name of the SDP header with a type equal to @a type.
- * @param type The @a type of the header for which to retrieve the name.
+/** Gets the name of the SDP header with a type equal to @a type.
+ * @param type The @a type of the header for which to retrieve the name.
*
* @return The name of the header.
**/
char tsdp_header_get_name(tsdp_header_type_t type)
{
- switch(type)
- {
- case tsdp_htype_A: return 'a';
- case tsdp_htype_B: return 'b';
- case tsdp_htype_C: return 'c';
- case tsdp_htype_E: return 'e';
- case tsdp_htype_I: return 'i';
- case tsdp_htype_K: return 'k';
- case tsdp_htype_M: return 'm';
- case tsdp_htype_O: return 'o';
- case tsdp_htype_P: return 'p';
- case tsdp_htype_R: return 'r';
- case tsdp_htype_S: return 's';
- case tsdp_htype_T: return 't';
- case tsdp_htype_U: return 'u';
- case tsdp_htype_V: return 'v';
- case tsdp_htype_Z: return 'z';
-
- default: return '*';
- }
+ switch(type) {
+ case tsdp_htype_A:
+ return 'a';
+ case tsdp_htype_B:
+ return 'b';
+ case tsdp_htype_C:
+ return 'c';
+ case tsdp_htype_E:
+ return 'e';
+ case tsdp_htype_I:
+ return 'i';
+ case tsdp_htype_K:
+ return 'k';
+ case tsdp_htype_M:
+ return 'm';
+ case tsdp_htype_O:
+ return 'o';
+ case tsdp_htype_P:
+ return 'p';
+ case tsdp_htype_R:
+ return 'r';
+ case tsdp_htype_S:
+ return 's';
+ case tsdp_htype_T:
+ return 't';
+ case tsdp_htype_U:
+ return 'u';
+ case tsdp_htype_V:
+ return 'v';
+ case tsdp_htype_Z:
+ return 'z';
+
+ default:
+ return '*';
+ }
}
char tsdp_header_get_nameex(const tsdp_header_t *self)
{
- if(self){
- if(self->type == tsdp_htype_Dummy){
- return ((tsdp_header_Dummy_t*)(self))->name;
- }
- else{
- return tsdp_header_get_name(self->type);
- }
- }
- return '*';
+ if(self) {
+ if(self->type == tsdp_htype_Dummy) {
+ return ((tsdp_header_Dummy_t*)(self))->name;
+ }
+ else {
+ return tsdp_header_get_name(self->type);
+ }
+ }
+ return '*';
}
int tsdp_header_serialize(const tsdp_header_t *self, tsk_buffer_t *output)
{
- static char name;
- int ret = -1;
- if(!self || !output){
- return -1;
- }
-
- /* Name */
- name = tsdp_header_get_nameex(self);
- tsk_buffer_append_2(output, "%c=", name);
-
- /* Value */
- if((ret = self->tostring(self, output))){
- // Abort?
- }
-
- /* CRLF*/
- if(output->size>2){
- if(*(TSK_BUFFER_TO_U8(output)+TSK_BUFFER_SIZE(output)-2) != '\r'
- && *(TSK_BUFFER_TO_U8(output)+TSK_BUFFER_SIZE(output)-1) != '\n'){
- ret = tsk_buffer_append(output, "\r\n", 2);
- }
- }
- else{
- ret = tsk_buffer_append(output, "\r\n", 2);
- }
-
- return ret;
+ static char name;
+ int ret = -1;
+ if(!self || !output) {
+ return -1;
+ }
+
+ /* Name */
+ name = tsdp_header_get_nameex(self);
+ tsk_buffer_append_2(output, "%c=", name);
+
+ /* Value */
+ if((ret = self->tostring(self, output))) {
+ // Abort?
+ }
+
+ /* CRLF*/
+ if(output->size>2) {
+ if(*(TSK_BUFFER_TO_U8(output)+TSK_BUFFER_SIZE(output)-2) != '\r'
+ && *(TSK_BUFFER_TO_U8(output)+TSK_BUFFER_SIZE(output)-1) != '\n') {
+ ret = tsk_buffer_append(output, "\r\n", 2);
+ }
+ }
+ else {
+ ret = tsk_buffer_append(output, "\r\n", 2);
+ }
+
+ return ret;
}
char* tsdp_header_tostring(const tsdp_header_t *self)
{
- tsk_buffer_t* output = tsk_buffer_create_null();
- char* str = tsk_null;
-
- if(!(tsdp_header_serialize(self, output))){
- str = tsk_strndup(TSK_BUFFER_DATA(output), TSK_BUFFER_SIZE(output));
- }
-
- TSK_OBJECT_SAFE_FREE(output);
- return str;
+ tsk_buffer_t* output = tsk_buffer_create_null();
+ char* str = tsk_null;
+
+ if(!(tsdp_header_serialize(self, output))) {
+ str = tsk_strndup(TSK_BUFFER_DATA(output), TSK_BUFFER_SIZE(output));
+ }
+
+ TSK_OBJECT_SAFE_FREE(output);
+ return str;
}
diff --git a/tinySDP/src/headers/tsdp_header_A.c b/tinySDP/src/headers/tsdp_header_A.c
index adf9e7c..1bbacd3 100755
--- a/tinySDP/src/headers/tsdp_header_A.c
+++ b/tinySDP/src/headers/tsdp_header_A.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_A.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,7 +22,7 @@
/**@file tsdp_header_A.c
* @brief SDP "a=" header (Attributes).
- *
+ *
*/
#include "tinysdp/headers/tsdp_header_A.h"
@@ -43,318 +43,328 @@
tsdp_header_A_t* tsdp_header_A_create(const char* field, const char* value)
{
- return tsk_object_new(TSDP_HEADER_A_VA_ARGS(field, value));
+ return tsk_object_new(TSDP_HEADER_A_VA_ARGS(field, value));
}
tsdp_header_A_t* tsdp_header_A_create_null()
{
- return tsdp_header_A_create(tsk_null, tsk_null);
+ return tsdp_header_A_create(tsk_null, tsk_null);
}
int tsdp_header_A_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_A_t *A = (const tsdp_header_A_t *)header;
-
- return tsk_buffer_append_2(output, "%s%s%s",
- A->field,
-
- A->value ? ":" : "",
- A->value ? A->value : ""
- );
- }
+ if(header) {
+ const tsdp_header_A_t *A = (const tsdp_header_A_t *)header;
- return -1;
+ return tsk_buffer_append_2(output, "%s%s%s",
+ A->field,
+
+ A->value ? ":" : "",
+ A->value ? A->value : ""
+ );
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_A_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_A_t *A = (const tsdp_header_A_t *)header;
- return (tsdp_header_t*)tsdp_header_A_create(A->field, A->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_A_t *A = (const tsdp_header_A_t *)header;
+ return (tsdp_header_t*)tsdp_header_A_create(A->field, A->value);
+ }
+ return tsk_null;
}
tsdp_header_A_t *tsdp_header_A_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_A_t *hdr_A = tsdp_header_A_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 93 "./src/headers/tsdp_header_A.c" */
-static const char _tsdp_machine_parser_header_A_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 2
-};
-
-static const char _tsdp_machine_parser_header_A_key_offsets[] = {
- 0, 0, 1, 3, 18, 19, 35, 35,
- 36
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_A_t *hdr_A = tsdp_header_A_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 93 "./src/headers/tsdp_header_A.c" */
+ static const char _tsdp_machine_parser_header_A_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 2
+ };
+
+ static const char _tsdp_machine_parser_header_A_key_offsets[] = {
+ 0, 0, 1, 3, 18, 19, 35, 35,
+ 36
+ };
+
+ static const char _tsdp_machine_parser_header_A_trans_keys[] = {
+ 97, 32, 61, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 13, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 13, 13, 0
+ };
+
+ static const char _tsdp_machine_parser_header_A_single_lengths[] = {
+ 0, 1, 2, 5, 1, 6, 0, 1,
+ 1
+ };
+
+ static const char _tsdp_machine_parser_header_A_range_lengths[] = {
+ 0, 0, 0, 5, 0, 5, 0, 0,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_A_index_offsets[] = {
+ 0, 0, 2, 5, 16, 18, 30, 31,
+ 33
+ };
+
+ static const char _tsdp_machine_parser_header_A_indicies[] = {
+ 0, 1, 0, 2, 1, 2, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 1,
+ 4, 1, 5, 6, 6, 6, 7, 6,
+ 6, 6, 6, 6, 6, 1, 1, 9,
+ 8, 11, 10, 0
+ };
+
+ static const char _tsdp_machine_parser_header_A_trans_targs[] = {
+ 2, 0, 3, 5, 6, 4, 5, 7,
+ 8, 4, 8, 4
+ };
+
+ static const char _tsdp_machine_parser_header_A_trans_actions[] = {
+ 0, 0, 0, 1, 0, 3, 0, 3,
+ 1, 7, 0, 5
+ };
+
+ static const char _tsdp_machine_parser_header_A_eof_actions[] = {
+ 0, 0, 0, 0, 0, 3, 0, 7,
+ 5
+ };
+
+ static const int tsdp_machine_parser_header_A_start = 1;
+ static const int tsdp_machine_parser_header_A_first_final = 5;
+ static const int tsdp_machine_parser_header_A_error = 0;
+
+ static const int tsdp_machine_parser_header_A_en_main = 1;
+
+
+ /* #line 114 "./ragel/tsdp_parser_header_A.rl" */
+
+ /* #line 159 "./src/headers/tsdp_header_A.c" */
+ {
+ cs = tsdp_machine_parser_header_A_start;
+ }
+
+ /* #line 115 "./ragel/tsdp_parser_header_A.rl" */
+ (void)(tsdp_machine_parser_header_A_first_final);
+ (void)(tsdp_machine_parser_header_A_error);
+ (void)(tsdp_machine_parser_header_A_en_main);
+
+ /* #line 169 "./src/headers/tsdp_header_A.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+_resume:
+ _keys = _tsdp_machine_parser_header_A_trans_keys + _tsdp_machine_parser_header_A_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_A_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_A_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
-static const char _tsdp_machine_parser_header_A_trans_keys[] = {
- 97, 32, 61, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 13, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 13, 13, 0
-};
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
-static const char _tsdp_machine_parser_header_A_single_lengths[] = {
- 0, 1, 2, 5, 1, 6, 0, 1,
- 1
-};
+ _klen = _tsdp_machine_parser_header_A_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
-static const char _tsdp_machine_parser_header_A_range_lengths[] = {
- 0, 0, 0, 5, 0, 5, 0, 0,
- 0
-};
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
-static const char _tsdp_machine_parser_header_A_index_offsets[] = {
- 0, 0, 2, 5, 16, 18, 30, 31,
- 33
-};
+_match:
+ _trans = _tsdp_machine_parser_header_A_indicies[_trans];
+ cs = _tsdp_machine_parser_header_A_trans_targs[_trans];
-static const char _tsdp_machine_parser_header_A_indicies[] = {
- 0, 1, 0, 2, 1, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 1,
- 4, 1, 5, 6, 6, 6, 7, 6,
- 6, 6, 6, 6, 6, 1, 1, 9,
- 8, 11, 10, 0
-};
+ if ( _tsdp_machine_parser_header_A_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
-static const char _tsdp_machine_parser_header_A_trans_targs[] = {
- 2, 0, 3, 5, 6, 4, 5, 7,
- 8, 4, 8, 4
-};
+ _acts = _tsdp_machine_parser_header_A_actions + _tsdp_machine_parser_header_A_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_A->field);
+ }
+ break;
+ case 2:
+ /* #line 50 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_A->value);
+ }
+ break;
+ /* #line 261 "./src/headers/tsdp_header_A.c" */
+ }
+ }
-static const char _tsdp_machine_parser_header_A_trans_actions[] = {
- 0, 0, 0, 1, 0, 3, 0, 3,
- 1, 7, 0, 5
-};
+_again:
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_A_actions + _tsdp_machine_parser_header_A_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_A->field);
+ }
+ break;
+ case 2:
+ /* #line 50 "./ragel/tsdp_parser_header_A.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_A->value);
+ }
+ break;
+ /* #line 295 "./src/headers/tsdp_header_A.c" */
+ }
+ }
+ }
-static const char _tsdp_machine_parser_header_A_eof_actions[] = {
- 0, 0, 0, 0, 0, 3, 0, 7,
- 5
-};
+_out: {
+ }
+ }
-static const int tsdp_machine_parser_header_A_start = 1;
-static const int tsdp_machine_parser_header_A_first_final = 5;
-static const int tsdp_machine_parser_header_A_error = 0;
-
-static const int tsdp_machine_parser_header_A_en_main = 1;
-
-
-/* #line 114 "./ragel/tsdp_parser_header_A.rl" */
-
-/* #line 159 "./src/headers/tsdp_header_A.c" */
- {
- cs = tsdp_machine_parser_header_A_start;
- }
-
-/* #line 115 "./ragel/tsdp_parser_header_A.rl" */
- (void)(tsdp_machine_parser_header_A_first_final);
- (void)(tsdp_machine_parser_header_A_error);
- (void)(tsdp_machine_parser_header_A_en_main);
-
-/* #line 169 "./src/headers/tsdp_header_A.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
-_resume:
- _keys = _tsdp_machine_parser_header_A_trans_keys + _tsdp_machine_parser_header_A_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_A_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_A_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_A_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ /* #line 119 "./ragel/tsdp_parser_header_A.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
-_match:
- _trans = _tsdp_machine_parser_header_A_indicies[_trans];
- cs = _tsdp_machine_parser_header_A_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_A_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_A_actions + _tsdp_machine_parser_header_A_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_A.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_A.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_A->field);
- }
- break;
- case 2:
-/* #line 50 "./ragel/tsdp_parser_header_A.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_A->value);
- }
- break;
-/* #line 261 "./src/headers/tsdp_header_A.c" */
- }
- }
+ if( cs <
+ /* #line 307 "./src/headers/tsdp_header_A.c" */
+ 5
+ /* #line 121 "./ragel/tsdp_parser_header_A.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"a=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_A);
+ }
-_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_A_actions + _tsdp_machine_parser_header_A_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_A.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_A.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_A->field);
- }
- break;
- case 2:
-/* #line 50 "./ragel/tsdp_parser_header_A.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_A->value);
- }
- break;
-/* #line 295 "./src/headers/tsdp_header_A.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 119 "./ragel/tsdp_parser_header_A.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 307 "./src/headers/tsdp_header_A.c" */
-5
-/* #line 121 "./ragel/tsdp_parser_header_A.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"a=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_A);
- }
-
- return hdr_A;
+ return hdr_A;
}
int tsdp_header_A_removeAll_by_field(tsdp_headers_A_L_t *attributes, const char* field)
{
- tsk_list_item_t* item;
- const tsdp_header_A_t* A;
+ tsk_list_item_t* item;
+ const tsdp_header_A_t* A;
- if(!attributes || !field){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!attributes || !field) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
again:
- tsk_list_foreach(item, attributes){
- if(!(A = item->data) || TSDP_HEADER(A)->type != tsdp_htype_A){
- continue;
- }
- if(tsk_striequals(field, A->field)){
- tsk_list_remove_item(attributes, item);
- goto again;
- }
+ tsk_list_foreach(item, attributes) {
+ if(!(A = item->data) || TSDP_HEADER(A)->type != tsdp_htype_A) {
+ continue;
+ }
+ if(tsk_striequals(field, A->field)) {
+ tsk_list_remove_item(attributes, item);
+ goto again;
}
+ }
- return 0;
+ return 0;
}
int tsdp_header_A_removeAll_by_fields(tsdp_headers_A_L_t *attributes, const char** fields, tsk_size_t fields_count)
{
- tsk_size_t i;
+ tsk_size_t i;
- if(!attributes || !fields){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!attributes || !fields) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- for(i = 0; i < fields_count; ++i){
- if(!fields[i]){
- continue;
- }
- tsdp_header_A_removeAll_by_field(attributes, fields[i]);
+ for(i = 0; i < fields_count; ++i) {
+ if(!fields[i]) {
+ continue;
}
- return 0;
+ tsdp_header_A_removeAll_by_field(attributes, fields[i]);
+ }
+ return 0;
}
@@ -366,52 +376,50 @@ int tsdp_header_A_removeAll_by_fields(tsdp_headers_A_L_t *attributes, const char
static tsk_object_t* tsdp_header_A_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_A_t *A = self;
- if(A)
- {
- TSDP_HEADER(A)->type = tsdp_htype_A;
- TSDP_HEADER(A)->tostring = tsdp_header_A_tostring;
- TSDP_HEADER(A)->clone = tsdp_header_A_clone;
- TSDP_HEADER(A)->rank = TSDP_HTYPE_A_RANK;
-
- A->field = tsk_strdup(va_arg(*app, const char*));
- A->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new A header.");
- }
- return self;
+ tsdp_header_A_t *A = self;
+ if(A) {
+ TSDP_HEADER(A)->type = tsdp_htype_A;
+ TSDP_HEADER(A)->tostring = tsdp_header_A_tostring;
+ TSDP_HEADER(A)->clone = tsdp_header_A_clone;
+ TSDP_HEADER(A)->rank = TSDP_HTYPE_A_RANK;
+
+ A->field = tsk_strdup(va_arg(*app, const char*));
+ A->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new A header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_A_dtor(tsk_object_t *self)
{
- tsdp_header_A_t *A = self;
- if(A){
- TSK_FREE(A->field);
- TSK_FREE(A->value);
- }
- else{
- TSK_DEBUG_ERROR("Null A header.");
- }
-
- return self;
+ tsdp_header_A_t *A = self;
+ if(A) {
+ TSK_FREE(A->field);
+ TSK_FREE(A->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null A header.");
+ }
+
+ return self;
}
static int tsdp_header_A_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_A_def_s =
-{
- sizeof(tsdp_header_A_t),
- tsdp_header_A_ctor,
- tsdp_header_A_dtor,
- tsdp_header_A_cmp
+static const tsk_object_def_t tsdp_header_A_def_s = {
+ sizeof(tsdp_header_A_t),
+ tsdp_header_A_ctor,
+ tsdp_header_A_dtor,
+ tsdp_header_A_cmp
};
const tsk_object_def_t *tsdp_header_A_def_t = &tsdp_header_A_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_B.c b/tinySDP/src/headers/tsdp_header_B.c
index 28835c1..49450c7 100755
--- a/tinySDP/src/headers/tsdp_header_B.c
+++ b/tinySDP/src/headers/tsdp_header_B.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_B.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tsdp_header_B.c
* @brief SDP "b=" header (Bandwidth).
- *
+ *
*/
#include "tinysdp/headers/tsdp_header_B.h"
@@ -45,259 +45,269 @@
tsdp_header_B_t* tsdp_header_B_create(const char* bwtype, uint32_t bandwidth)
{
- return tsk_object_new(TSDP_HEADER_B_VA_ARGS(bwtype, bandwidth));
+ return tsk_object_new(TSDP_HEADER_B_VA_ARGS(bwtype, bandwidth));
}
tsdp_header_B_t* tsdp_header_B_create_null()
{
- return tsdp_header_B_create(tsk_null, 0);
+ return tsdp_header_B_create(tsk_null, 0);
}
int tsdp_header_B_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_B_t *B = (const tsdp_header_B_t *)header;
-
- return tsk_buffer_append_2(output, "%s:%u",
- B->bwtype,
- B->bandwidth
- );
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_B_t *B = (const tsdp_header_B_t *)header;
+
+ return tsk_buffer_append_2(output, "%s:%u",
+ B->bwtype,
+ B->bandwidth
+ );
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_B_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_B_t *B = (const tsdp_header_B_t *)header;
- return (tsdp_header_t*)tsdp_header_B_create(B->bwtype, B->bandwidth);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_B_t *B = (const tsdp_header_B_t *)header;
+ return (tsdp_header_t*)tsdp_header_B_create(B->bwtype, B->bandwidth);
+ }
+ return tsk_null;
}
tsdp_header_B_t *tsdp_header_B_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_B_t *hdr_B = tsdp_header_B_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 92 "./src/headers/tsdp_header_B.c" */
-static const char _tsdp_machine_parser_header_B_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsdp_machine_parser_header_B_key_offsets[] = {
- 0, 0, 1, 3, 18, 33, 35, 36,
- 39
-};
-
-static const char _tsdp_machine_parser_header_B_trans_keys[] = {
- 98, 32, 61, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 48, 57, 10, 13, 48, 57, 0
-};
-
-static const char _tsdp_machine_parser_header_B_single_lengths[] = {
- 0, 1, 2, 5, 5, 0, 1, 1,
- 0
-};
-
-static const char _tsdp_machine_parser_header_B_range_lengths[] = {
- 0, 0, 0, 5, 5, 1, 0, 1,
- 0
-};
-
-static const char _tsdp_machine_parser_header_B_index_offsets[] = {
- 0, 0, 2, 5, 16, 27, 29, 31,
- 34
-};
-
-static const char _tsdp_machine_parser_header_B_indicies[] = {
- 0, 1, 0, 2, 1, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 1,
- 4, 4, 4, 5, 4, 4, 4, 4,
- 4, 4, 1, 6, 1, 7, 1, 8,
- 9, 1, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_B_trans_targs[] = {
- 2, 0, 3, 4, 4, 5, 7, 8,
- 6, 7
-};
-
-static const char _tsdp_machine_parser_header_B_trans_actions[] = {
- 0, 0, 0, 1, 0, 3, 1, 0,
- 5, 0
-};
-
-static const char _tsdp_machine_parser_header_B_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0
-};
-
-static const int tsdp_machine_parser_header_B_start = 1;
-static const int tsdp_machine_parser_header_B_first_final = 7;
-static const int tsdp_machine_parser_header_B_error = 0;
-
-static const int tsdp_machine_parser_header_B_en_main = 1;
-
-
-/* #line 113 "./ragel/tsdp_parser_header_B.rl" */
- (void)(tsdp_machine_parser_header_B_first_final);
- (void)(tsdp_machine_parser_header_B_error);
- (void)(tsdp_machine_parser_header_B_en_main);
-
-/* #line 160 "./src/headers/tsdp_header_B.c" */
- {
- cs = tsdp_machine_parser_header_B_start;
- }
-
-/* #line 117 "./ragel/tsdp_parser_header_B.rl" */
-
-/* #line 167 "./src/headers/tsdp_header_B.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_B_t *hdr_B = tsdp_header_B_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 92 "./src/headers/tsdp_header_B.c" */
+ static const char _tsdp_machine_parser_header_B_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsdp_machine_parser_header_B_key_offsets[] = {
+ 0, 0, 1, 3, 18, 33, 35, 36,
+ 39
+ };
+
+ static const char _tsdp_machine_parser_header_B_trans_keys[] = {
+ 98, 32, 61, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 48, 57, 10, 13, 48, 57, 0
+ };
+
+ static const char _tsdp_machine_parser_header_B_single_lengths[] = {
+ 0, 1, 2, 5, 5, 0, 1, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_B_range_lengths[] = {
+ 0, 0, 0, 5, 5, 1, 0, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_B_index_offsets[] = {
+ 0, 0, 2, 5, 16, 27, 29, 31,
+ 34
+ };
+
+ static const char _tsdp_machine_parser_header_B_indicies[] = {
+ 0, 1, 0, 2, 1, 2, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 1,
+ 4, 4, 4, 5, 4, 4, 4, 4,
+ 4, 4, 1, 6, 1, 7, 1, 8,
+ 9, 1, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_B_trans_targs[] = {
+ 2, 0, 3, 4, 4, 5, 7, 8,
+ 6, 7
+ };
+
+ static const char _tsdp_machine_parser_header_B_trans_actions[] = {
+ 0, 0, 0, 1, 0, 3, 1, 0,
+ 5, 0
+ };
+
+ static const char _tsdp_machine_parser_header_B_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0
+ };
+
+ static const int tsdp_machine_parser_header_B_start = 1;
+ static const int tsdp_machine_parser_header_B_first_final = 7;
+ static const int tsdp_machine_parser_header_B_error = 0;
+
+ static const int tsdp_machine_parser_header_B_en_main = 1;
+
+
+ /* #line 113 "./ragel/tsdp_parser_header_B.rl" */
+ (void)(tsdp_machine_parser_header_B_first_final);
+ (void)(tsdp_machine_parser_header_B_error);
+ (void)(tsdp_machine_parser_header_B_en_main);
+
+ /* #line 160 "./src/headers/tsdp_header_B.c" */
+ {
+ cs = tsdp_machine_parser_header_B_start;
+ }
+
+ /* #line 117 "./ragel/tsdp_parser_header_B.rl" */
+
+ /* #line 167 "./src/headers/tsdp_header_B.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_B_trans_keys + _tsdp_machine_parser_header_B_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_B_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_B_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_B_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_B_trans_keys + _tsdp_machine_parser_header_B_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_B_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_B_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_B_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsdp_machine_parser_header_B_indicies[_trans];
- cs = _tsdp_machine_parser_header_B_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_B_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_B_actions + _tsdp_machine_parser_header_B_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/tsdp_parser_header_B.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/tsdp_parser_header_B.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_B->bwtype);
- }
- break;
- case 2:
-/* #line 51 "./ragel/tsdp_parser_header_B.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_B->bandwidth);
- }
- break;
-/* #line 259 "./src/headers/tsdp_header_B.c" */
- }
- }
+ _trans = _tsdp_machine_parser_header_B_indicies[_trans];
+ cs = _tsdp_machine_parser_header_B_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_B_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_B_actions + _tsdp_machine_parser_header_B_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/tsdp_parser_header_B.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/tsdp_parser_header_B.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_B->bwtype);
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/tsdp_parser_header_B.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_B->bandwidth);
+ }
+ break;
+ /* #line 259 "./src/headers/tsdp_header_B.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_B_actions + _tsdp_machine_parser_header_B_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 2:
-/* #line 51 "./ragel/tsdp_parser_header_B.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_B->bandwidth);
- }
- break;
-/* #line 281 "./src/headers/tsdp_header_B.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 118 "./ragel/tsdp_parser_header_B.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 293 "./src/headers/tsdp_header_B.c" */
-7
-/* #line 120 "./ragel/tsdp_parser_header_B.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"b=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_B);
- }
-
- return hdr_B;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_B_actions + _tsdp_machine_parser_header_B_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 2:
+ /* #line 51 "./ragel/tsdp_parser_header_B.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_B->bandwidth);
+ }
+ break;
+ /* #line 281 "./src/headers/tsdp_header_B.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 118 "./ragel/tsdp_parser_header_B.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 293 "./src/headers/tsdp_header_B.c" */
+ 7
+ /* #line 120 "./ragel/tsdp_parser_header_B.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"b=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_B);
+ }
+
+ return hdr_B;
}
@@ -312,50 +322,49 @@ _again:
static tsk_object_t* tsdp_header_B_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_B_t *B = self;
- if(B){
- TSDP_HEADER(B)->type = tsdp_htype_B;
- TSDP_HEADER(B)->tostring = tsdp_header_B_tostring;
- TSDP_HEADER(B)->clone = tsdp_header_B_clone;
- TSDP_HEADER(B)->rank = TSDP_HTYPE_B_RANK;
-
- B->bwtype = tsk_strdup(va_arg(*app, const char*));
- B->bandwidth = va_arg(*app, uint32_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new B header.");
- }
- return self;
+ tsdp_header_B_t *B = self;
+ if(B) {
+ TSDP_HEADER(B)->type = tsdp_htype_B;
+ TSDP_HEADER(B)->tostring = tsdp_header_B_tostring;
+ TSDP_HEADER(B)->clone = tsdp_header_B_clone;
+ TSDP_HEADER(B)->rank = TSDP_HTYPE_B_RANK;
+
+ B->bwtype = tsk_strdup(va_arg(*app, const char*));
+ B->bandwidth = va_arg(*app, uint32_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new B header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_B_dtor(tsk_object_t *self)
{
- tsdp_header_B_t *B = self;
- if(B){
- TSK_FREE(B->bwtype);
- }
- else{
- TSK_DEBUG_ERROR("Null B header.");
- }
-
- return self;
+ tsdp_header_B_t *B = self;
+ if(B) {
+ TSK_FREE(B->bwtype);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null B header.");
+ }
+
+ return self;
}
static int tsdp_header_B_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_B_def_s =
-{
- sizeof(tsdp_header_B_t),
- tsdp_header_B_ctor,
- tsdp_header_B_dtor,
- tsdp_header_B_cmp
+static const tsk_object_def_t tsdp_header_B_def_s = {
+ sizeof(tsdp_header_B_t),
+ tsdp_header_B_ctor,
+ tsdp_header_B_dtor,
+ tsdp_header_B_cmp
};
const tsk_object_def_t *tsdp_header_B_def_t = &tsdp_header_B_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_C.c b/tinySDP/src/headers/tsdp_header_C.c
index ddf3f4e..ebb10b3 100755
--- a/tinySDP/src/headers/tsdp_header_C.c
+++ b/tinySDP/src/headers/tsdp_header_C.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_C.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,265 +42,275 @@
tsdp_header_C_t* tsdp_header_c_create(const char* nettype, const char* addrtype, const char* addr)
{
- return tsk_object_new(TSDP_HEADER_C_VA_ARGS(nettype, addrtype, addr));
+ return tsk_object_new(TSDP_HEADER_C_VA_ARGS(nettype, addrtype, addr));
}
tsdp_header_C_t* tsdp_header_c_create_null()
{
- return tsdp_header_c_create(tsk_null, tsk_null, tsk_null);
+ return tsdp_header_c_create(tsk_null, tsk_null, tsk_null);
}
int tsdp_header_C_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_C_t *C = (const tsdp_header_C_t *)header;
-
- return tsk_buffer_append_2(output, "%s %s %s",
- C->nettype,
- C->addrtype,
- C->addr
- );
-
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_C_t *C = (const tsdp_header_C_t *)header;
+
+ return tsk_buffer_append_2(output, "%s %s %s",
+ C->nettype,
+ C->addrtype,
+ C->addr
+ );
+
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_C_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_C_t *C = (const tsdp_header_C_t *)header;
- return (tsdp_header_t*)tsdp_header_c_create(C->nettype, C->addrtype, C->addr);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_C_t *C = (const tsdp_header_C_t *)header;
+ return (tsdp_header_t*)tsdp_header_c_create(C->nettype, C->addrtype, C->addr);
+ }
+ return tsk_null;
}
tsdp_header_C_t *tsdp_header_C_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_C_t *hdr_C = tsdp_header_c_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 92 "./src/headers/tsdp_header_C.c" */
-static const char _tsdp_machine_parser_header_C_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 2, 0, 2, 2, 0, 3
-};
-
-static const char _tsdp_machine_parser_header_C_key_offsets[] = {
- 0, 0, 1, 3, 4, 5, 6, 7,
- 8, 9, 10
-};
-
-static const char _tsdp_machine_parser_header_C_trans_keys[] = {
- 99, 32, 61, 32, 32, 32, 32, 10,
- 13, 13, 0
-};
-
-static const char _tsdp_machine_parser_header_C_single_lengths[] = {
- 0, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_C_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_C_index_offsets[] = {
- 0, 0, 2, 5, 7, 9, 11, 13,
- 15, 17, 19
-};
-
-static const char _tsdp_machine_parser_header_C_trans_targs[] = {
- 2, 0, 2, 3, 0, 3, 4, 5,
- 4, 8, 6, 8, 6, 10, 0, 7,
- 9, 7, 9, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_C_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 3,
- 0, 9, 1, 5, 0, 0, 0, 12,
- 1, 7, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_C_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 12, 7, 0
-};
-
-static const int tsdp_machine_parser_header_C_start = 1;
-static const int tsdp_machine_parser_header_C_first_final = 8;
-static const int tsdp_machine_parser_header_C_error = 0;
-
-static const int tsdp_machine_parser_header_C_en_main = 1;
-
-
-/* #line 117 "./ragel/tsdp_parser_header_C.rl" */
- (void)(tsdp_machine_parser_header_C_first_final);
- (void)(tsdp_machine_parser_header_C_error);
- (void)(tsdp_machine_parser_header_C_en_main);
-
-/* #line 152 "./src/headers/tsdp_header_C.c" */
- {
- cs = tsdp_machine_parser_header_C_start;
- }
-
-/* #line 121 "./ragel/tsdp_parser_header_C.rl" */
-
-/* #line 159 "./src/headers/tsdp_header_C.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_C_t *hdr_C = tsdp_header_c_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 92 "./src/headers/tsdp_header_C.c" */
+ static const char _tsdp_machine_parser_header_C_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 2, 0, 2, 2, 0, 3
+ };
+
+ static const char _tsdp_machine_parser_header_C_key_offsets[] = {
+ 0, 0, 1, 3, 4, 5, 6, 7,
+ 8, 9, 10
+ };
+
+ static const char _tsdp_machine_parser_header_C_trans_keys[] = {
+ 99, 32, 61, 32, 32, 32, 32, 10,
+ 13, 13, 0
+ };
+
+ static const char _tsdp_machine_parser_header_C_single_lengths[] = {
+ 0, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_C_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_C_index_offsets[] = {
+ 0, 0, 2, 5, 7, 9, 11, 13,
+ 15, 17, 19
+ };
+
+ static const char _tsdp_machine_parser_header_C_trans_targs[] = {
+ 2, 0, 2, 3, 0, 3, 4, 5,
+ 4, 8, 6, 8, 6, 10, 0, 7,
+ 9, 7, 9, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_C_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 3,
+ 0, 9, 1, 5, 0, 0, 0, 12,
+ 1, 7, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_C_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 12, 7, 0
+ };
+
+ static const int tsdp_machine_parser_header_C_start = 1;
+ static const int tsdp_machine_parser_header_C_first_final = 8;
+ static const int tsdp_machine_parser_header_C_error = 0;
+
+ static const int tsdp_machine_parser_header_C_en_main = 1;
+
+
+ /* #line 117 "./ragel/tsdp_parser_header_C.rl" */
+ (void)(tsdp_machine_parser_header_C_first_final);
+ (void)(tsdp_machine_parser_header_C_error);
+ (void)(tsdp_machine_parser_header_C_en_main);
+
+ /* #line 152 "./src/headers/tsdp_header_C.c" */
+ {
+ cs = tsdp_machine_parser_header_C_start;
+ }
+
+ /* #line 121 "./ragel/tsdp_parser_header_C.rl" */
+
+ /* #line 159 "./src/headers/tsdp_header_C.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_C_trans_keys + _tsdp_machine_parser_header_C_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_C_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_C_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_C_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_C_trans_keys + _tsdp_machine_parser_header_C_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_C_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_C_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_C_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_C_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_C_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_C_actions + _tsdp_machine_parser_header_C_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_C.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_C.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_C->nettype);
- }
- break;
- case 2:
-/* #line 50 "./ragel/tsdp_parser_header_C.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_C->addrtype);
- }
- break;
- case 3:
-/* #line 54 "./ragel/tsdp_parser_header_C.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_C->addr);
- }
- break;
-/* #line 256 "./src/headers/tsdp_header_C.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_C_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_C_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_C_actions + _tsdp_machine_parser_header_C_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_C->nettype);
+ }
+ break;
+ case 2:
+ /* #line 50 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_C->addrtype);
+ }
+ break;
+ case 3:
+ /* #line 54 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_C->addr);
+ }
+ break;
+ /* #line 256 "./src/headers/tsdp_header_C.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_C_actions + _tsdp_machine_parser_header_C_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_C.rl" */
- {
- tag_start = p;
- }
- break;
- case 3:
-/* #line 54 "./ragel/tsdp_parser_header_C.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_C->addr);
- }
- break;
-/* #line 284 "./src/headers/tsdp_header_C.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 122 "./ragel/tsdp_parser_header_C.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 296 "./src/headers/tsdp_header_C.c" */
-8
-/* #line 124 "./ragel/tsdp_parser_header_C.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"c=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_C);
- }
-
- return hdr_C;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_C_actions + _tsdp_machine_parser_header_C_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 3:
+ /* #line 54 "./ragel/tsdp_parser_header_C.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_C->addr);
+ }
+ break;
+ /* #line 284 "./src/headers/tsdp_header_C.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 122 "./ragel/tsdp_parser_header_C.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 296 "./src/headers/tsdp_header_C.c" */
+ 8
+ /* #line 124 "./ragel/tsdp_parser_header_C.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"c=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_C);
+ }
+
+ return hdr_C;
}
@@ -315,53 +325,52 @@ _again:
static tsk_object_t* tsdp_header_C_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_C_t *C = self;
- if(C){
- TSDP_HEADER(C)->type = tsdp_htype_C;
- TSDP_HEADER(C)->tostring = tsdp_header_C_tostring;
- TSDP_HEADER(C)->clone = tsdp_header_C_clone;
- TSDP_HEADER(C)->rank = TSDP_HTYPE_C_RANK;
-
- C->nettype = tsk_strdup(va_arg(*app, const char*));
- C->addrtype = tsk_strdup(va_arg(*app, const char*));
- C->addr = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new C header.");
- }
- return self;
+ tsdp_header_C_t *C = self;
+ if(C) {
+ TSDP_HEADER(C)->type = tsdp_htype_C;
+ TSDP_HEADER(C)->tostring = tsdp_header_C_tostring;
+ TSDP_HEADER(C)->clone = tsdp_header_C_clone;
+ TSDP_HEADER(C)->rank = TSDP_HTYPE_C_RANK;
+
+ C->nettype = tsk_strdup(va_arg(*app, const char*));
+ C->addrtype = tsk_strdup(va_arg(*app, const char*));
+ C->addr = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new C header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_C_dtor(tsk_object_t *self)
{
- tsdp_header_C_t *C = self;
- if(C){
- TSK_FREE(C->nettype);
- TSK_FREE(C->addrtype);
- TSK_FREE(C->addr);
- }
- else{
- TSK_DEBUG_ERROR("Null PC header.");
- }
-
- return self;
+ tsdp_header_C_t *C = self;
+ if(C) {
+ TSK_FREE(C->nettype);
+ TSK_FREE(C->addrtype);
+ TSK_FREE(C->addr);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null PC header.");
+ }
+
+ return self;
}
static int tsdp_header_C_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_C_def_s =
-{
- sizeof(tsdp_header_C_t),
- tsdp_header_C_ctor,
- tsdp_header_C_dtor,
- tsdp_header_C_cmp
+static const tsk_object_def_t tsdp_header_C_def_s = {
+ sizeof(tsdp_header_C_t),
+ tsdp_header_C_ctor,
+ tsdp_header_C_dtor,
+ tsdp_header_C_cmp
};
const tsk_object_def_t *tsdp_header_C_def_t = &tsdp_header_C_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_Dummy.c b/tinySDP/src/headers/tsdp_header_Dummy.c
index 3aa3461..333d55c 100755
--- a/tinySDP/src/headers/tsdp_header_Dummy.c
+++ b/tinySDP/src/headers/tsdp_header_Dummy.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_Dummy.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,251 +42,260 @@
tsdp_header_Dummy_t* tsdp_header_dummy_create(char name, const char* value)
{
- return tsk_object_new(TSDP_HEADER_DUMMY_VA_ARGS(name, value));
+ return tsk_object_new(TSDP_HEADER_DUMMY_VA_ARGS(name, value));
}
tsdp_header_Dummy_t* tsdp_header_dummy_create_null()
{
- return tsdp_header_dummy_create(0, tsk_null);
+ return tsdp_header_dummy_create(0, tsk_null);
}
int tsdp_header_Dummy_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_Dummy_t *Dummy = (const tsdp_header_Dummy_t *)header;
- if(Dummy->value){
- return tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_Dummy_t *Dummy = (const tsdp_header_Dummy_t *)header;
+ if(Dummy->value) {
+ return tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_Dummy_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_Dummy_t *Dummy = (const tsdp_header_Dummy_t *)header;
- return (tsdp_header_t*)tsdp_header_dummy_create(Dummy->name, Dummy->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_Dummy_t *Dummy = (const tsdp_header_Dummy_t *)header;
+ return (tsdp_header_t*)tsdp_header_dummy_create(Dummy->name, Dummy->value);
+ }
+ return tsk_null;
}
tsdp_header_Dummy_t *tsdp_header_Dummy_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_Dummy_t *hdr_Dummy = tsdp_header_dummy_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 89 "./src/headers/tsdp_header_Dummy.c" */
-static const char _tsdp_machine_parser_header_Dummy_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 2
-};
-
-static const char _tsdp_machine_parser_header_Dummy_key_offsets[] = {
- 0, 0, 4, 6, 8, 9, 11, 12
-};
-
-static const char _tsdp_machine_parser_header_Dummy_trans_keys[] = {
- 65, 90, 97, 122, 32, 61, 32, 61,
- 10, 13, 32, 13, 0
-};
-
-static const char _tsdp_machine_parser_header_Dummy_single_lengths[] = {
- 0, 0, 2, 2, 1, 2, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_Dummy_range_lengths[] = {
- 0, 2, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_Dummy_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 16
-};
-
-static const char _tsdp_machine_parser_header_Dummy_trans_targs[] = {
- 2, 2, 0, 3, 5, 0, 3, 5,
- 0, 7, 0, 4, 5, 6, 4, 6,
- 0, 0
-};
-
-static const char _tsdp_machine_parser_header_Dummy_trans_actions[] = {
- 1, 1, 0, 3, 3, 0, 0, 0,
- 0, 0, 0, 7, 0, 1, 5, 0,
- 0, 0
-};
-
-static const char _tsdp_machine_parser_header_Dummy_eof_actions[] = {
- 0, 0, 0, 0, 0, 7, 5, 0
-};
-
-static const int tsdp_machine_parser_header_Dummy_start = 1;
-static const int tsdp_machine_parser_header_Dummy_first_final = 5;
-static const int tsdp_machine_parser_header_Dummy_error = 0;
-
-static const int tsdp_machine_parser_header_Dummy_en_main = 1;
-
-
-/* #line 107 "./ragel/tsdp_parser_header_Dummy.rl" */
- (void)(tsdp_machine_parser_header_Dummy_first_final);
- (void)(tsdp_machine_parser_header_Dummy_error);
- (void)(tsdp_machine_parser_header_Dummy_en_main);
-
-/* #line 144 "./src/headers/tsdp_header_Dummy.c" */
- {
- cs = tsdp_machine_parser_header_Dummy_start;
- }
-
-/* #line 111 "./ragel/tsdp_parser_header_Dummy.rl" */
-
-/* #line 151 "./src/headers/tsdp_header_Dummy.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_Dummy_t *hdr_Dummy = tsdp_header_dummy_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 89 "./src/headers/tsdp_header_Dummy.c" */
+ static const char _tsdp_machine_parser_header_Dummy_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 2
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_key_offsets[] = {
+ 0, 0, 4, 6, 8, 9, 11, 12
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_trans_keys[] = {
+ 65, 90, 97, 122, 32, 61, 32, 61,
+ 10, 13, 32, 13, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_single_lengths[] = {
+ 0, 0, 2, 2, 1, 2, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_range_lengths[] = {
+ 0, 2, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 16
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_trans_targs[] = {
+ 2, 2, 0, 3, 5, 0, 3, 5,
+ 0, 7, 0, 4, 5, 6, 4, 6,
+ 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_trans_actions[] = {
+ 1, 1, 0, 3, 3, 0, 0, 0,
+ 0, 0, 0, 7, 0, 1, 5, 0,
+ 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Dummy_eof_actions[] = {
+ 0, 0, 0, 0, 0, 7, 5, 0
+ };
+
+ static const int tsdp_machine_parser_header_Dummy_start = 1;
+ static const int tsdp_machine_parser_header_Dummy_first_final = 5;
+ static const int tsdp_machine_parser_header_Dummy_error = 0;
+
+ static const int tsdp_machine_parser_header_Dummy_en_main = 1;
+
+
+ /* #line 107 "./ragel/tsdp_parser_header_Dummy.rl" */
+ (void)(tsdp_machine_parser_header_Dummy_first_final);
+ (void)(tsdp_machine_parser_header_Dummy_error);
+ (void)(tsdp_machine_parser_header_Dummy_en_main);
+
+ /* #line 144 "./src/headers/tsdp_header_Dummy.c" */
+ {
+ cs = tsdp_machine_parser_header_Dummy_start;
+ }
+
+ /* #line 111 "./ragel/tsdp_parser_header_Dummy.rl" */
+
+ /* #line 151 "./src/headers/tsdp_header_Dummy.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_Dummy_trans_keys + _tsdp_machine_parser_header_Dummy_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_Dummy_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_Dummy_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_Dummy_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_Dummy_trans_keys + _tsdp_machine_parser_header_Dummy_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_Dummy_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_Dummy_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_Dummy_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_Dummy_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_Dummy_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_Dummy_actions + _tsdp_machine_parser_header_Dummy_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_Dummy.rl" */
- {
- hdr_Dummy->name = *tag_start;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tsdp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
-/* #line 242 "./src/headers/tsdp_header_Dummy.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_Dummy_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_Dummy_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_Dummy_actions + _tsdp_machine_parser_header_Dummy_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_Dummy.rl" */
+ {
+ hdr_Dummy->name = *tag_start;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tsdp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ /* #line 242 "./src/headers/tsdp_header_Dummy.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_Dummy_actions + _tsdp_machine_parser_header_Dummy_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 2:
-/* #line 49 "./ragel/tsdp_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
-/* #line 270 "./src/headers/tsdp_header_Dummy.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 112 "./ragel/tsdp_parser_header_Dummy.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 282 "./src/headers/tsdp_header_Dummy.c" */
-5
-/* #line 114 "./ragel/tsdp_parser_header_Dummy.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse dummy header.");
- TSK_OBJECT_SAFE_FREE(hdr_Dummy);
- }
-
- return hdr_Dummy;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_Dummy_actions + _tsdp_machine_parser_header_Dummy_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tsdp_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ /* #line 270 "./src/headers/tsdp_header_Dummy.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 112 "./ragel/tsdp_parser_header_Dummy.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 282 "./src/headers/tsdp_header_Dummy.c" */
+ 5
+ /* #line 114 "./ragel/tsdp_parser_header_Dummy.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse dummy header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Dummy);
+ }
+
+ return hdr_Dummy;
}
@@ -301,53 +310,52 @@ _again:
static tsk_object_t* tsdp_header_Dummy_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSDP_HEADER(Dummy)->type = tsdp_htype_Dummy;
- TSDP_HEADER(Dummy)->tostring = tsdp_header_Dummy_tostring;
- TSDP_HEADER(Dummy)->clone = tsdp_header_Dummy_clone;
- TSDP_HEADER(Dummy)->rank = TSDP_HTYPE_DUMMY_RANK;
+ tsdp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSDP_HEADER(Dummy)->type = tsdp_htype_Dummy;
+ TSDP_HEADER(Dummy)->tostring = tsdp_header_Dummy_tostring;
+ TSDP_HEADER(Dummy)->clone = tsdp_header_Dummy_clone;
+ TSDP_HEADER(Dummy)->rank = TSDP_HTYPE_DUMMY_RANK;
#if defined(__GNUC__)
- Dummy->name = va_arg(*app, const int);
+ Dummy->name = va_arg(*app, const int);
#else
- Dummy->name = va_arg(*app, const char);
+ Dummy->name = va_arg(*app, const char);
#endif
- Dummy->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Dummy header.");
- }
- return self;
+ Dummy->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Dummy header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_Dummy_dtor(tsk_object_t *self)
{
- tsdp_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSK_FREE(Dummy->value);
- }
- else{
- TSK_DEBUG_ERROR("Null Dummy header.");
- }
-
- return self;
+ tsdp_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSK_FREE(Dummy->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Dummy header.");
+ }
+
+ return self;
}
static int tsdp_header_Dummy_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_Dummy_def_s =
-{
- sizeof(tsdp_header_Dummy_t),
- tsdp_header_Dummy_ctor,
- tsdp_header_Dummy_dtor,
- tsdp_header_Dummy_cmp
+static const tsk_object_def_t tsdp_header_Dummy_def_s = {
+ sizeof(tsdp_header_Dummy_t),
+ tsdp_header_Dummy_ctor,
+ tsdp_header_Dummy_dtor,
+ tsdp_header_Dummy_cmp
};
const tsk_object_def_t *tsdp_header_Dummy_def_t = &tsdp_header_Dummy_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_E.c b/tinySDP/src/headers/tsdp_header_E.c
index f958ca1..1bf0d6c 100755
--- a/tinySDP/src/headers/tsdp_header_E.c
+++ b/tinySDP/src/headers/tsdp_header_E.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_E.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,241 +43,251 @@
tsdp_header_E_t* tsdp_header_E_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_E_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_E_VA_ARGS(value));
}
tsdp_header_E_t* tsdp_header_E_create_null()
{
- return tsdp_header_E_create(tsk_null);
+ return tsdp_header_E_create(tsk_null);
}
int tsdp_header_E_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_E_t *E = (const tsdp_header_E_t *)header;
- if(E->value){
- tsk_buffer_append(output, E->value, tsk_strlen(E->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_E_t *E = (const tsdp_header_E_t *)header;
+ if(E->value) {
+ tsk_buffer_append(output, E->value, tsk_strlen(E->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_E_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_E_t *E = (const tsdp_header_E_t *)header;
- return (tsdp_header_t*)tsdp_header_E_create(E->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_E_t *E = (const tsdp_header_E_t *)header;
+ return (tsdp_header_t*)tsdp_header_E_create(E->value);
+ }
+ return tsk_null;
}
tsdp_header_E_t *tsdp_header_E_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_E_t *hdr_E = tsdp_header_E_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 89 "./src/headers/tsdp_header_E.c" */
-static const char _tsdp_machine_parser_header_E_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_E_t *hdr_E = tsdp_header_E_create_null();
-static const char _tsdp_machine_parser_header_E_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_E_trans_keys[] = {
- 101, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_E_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 89 "./src/headers/tsdp_header_E.c" */
+ static const char _tsdp_machine_parser_header_E_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_E_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_E_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_E_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_E_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_E_trans_keys[] = {
+ 101, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_E_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_E_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_E_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_E_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_E_start = 1;
-static const int tsdp_machine_parser_header_E_first_final = 4;
-static const int tsdp_machine_parser_header_E_error = 0;
-
-static const int tsdp_machine_parser_header_E_en_main = 1;
-
-
-/* #line 103 "./ragel/tsdp_parser_header_E.rl" */
- (void)(tsdp_machine_parser_header_E_first_final);
- (void)(tsdp_machine_parser_header_E_error);
- (void)(tsdp_machine_parser_header_E_en_main);
-
-/* #line 141 "./src/headers/tsdp_header_E.c" */
- {
- cs = tsdp_machine_parser_header_E_start;
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_E.rl" */
-
-/* #line 148 "./src/headers/tsdp_header_E.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_E_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_E_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_E_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_E_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_E_start = 1;
+ static const int tsdp_machine_parser_header_E_first_final = 4;
+ static const int tsdp_machine_parser_header_E_error = 0;
+
+ static const int tsdp_machine_parser_header_E_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsdp_parser_header_E.rl" */
+ (void)(tsdp_machine_parser_header_E_first_final);
+ (void)(tsdp_machine_parser_header_E_error);
+ (void)(tsdp_machine_parser_header_E_en_main);
+
+ /* #line 141 "./src/headers/tsdp_header_E.c" */
+ {
+ cs = tsdp_machine_parser_header_E_start;
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_E.rl" */
+
+ /* #line 148 "./src/headers/tsdp_header_E.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_E_trans_keys + _tsdp_machine_parser_header_E_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_E_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_E_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_E_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_E_trans_keys + _tsdp_machine_parser_header_E_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_E_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_E_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_E_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_E_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_E_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_E_actions + _tsdp_machine_parser_header_E_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_E.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_E.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_E->value);
- }
- break;
-/* #line 233 "./src/headers/tsdp_header_E.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_E_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_E_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_E_actions + _tsdp_machine_parser_header_E_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_E.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_E.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_E->value);
+ }
+ break;
+ /* #line 233 "./src/headers/tsdp_header_E.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_E_actions + _tsdp_machine_parser_header_E_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_E.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_E.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_E->value);
- }
- break;
-/* #line 261 "./src/headers/tsdp_header_E.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 108 "./ragel/tsdp_parser_header_E.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 273 "./src/headers/tsdp_header_E.c" */
-4
-/* #line 110 "./ragel/tsdp_parser_header_E.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"e=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_E);
- }
-
- return hdr_E;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_E_actions + _tsdp_machine_parser_header_E_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_E.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_E.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_E->value);
+ }
+ break;
+ /* #line 261 "./src/headers/tsdp_header_E.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 108 "./ragel/tsdp_parser_header_E.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 273 "./src/headers/tsdp_header_E.c" */
+ 4
+ /* #line 110 "./ragel/tsdp_parser_header_E.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"e=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_E);
+ }
+
+ return hdr_E;
}
@@ -292,49 +302,48 @@ _again:
static tsk_object_t* tsdp_header_E_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_E_t *E = self;
- if(E){
- TSDP_HEADER(E)->type = tsdp_htype_E;
- TSDP_HEADER(E)->tostring = tsdp_header_E_tostring;
- TSDP_HEADER(E)->clone = tsdp_header_E_clone;
- TSDP_HEADER(E)->rank = TSDP_HTYPE_E_RANK;
-
- E->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new E header.");
- }
- return self;
+ tsdp_header_E_t *E = self;
+ if(E) {
+ TSDP_HEADER(E)->type = tsdp_htype_E;
+ TSDP_HEADER(E)->tostring = tsdp_header_E_tostring;
+ TSDP_HEADER(E)->clone = tsdp_header_E_clone;
+ TSDP_HEADER(E)->rank = TSDP_HTYPE_E_RANK;
+
+ E->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new E header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_E_dtor(tsk_object_t *self)
{
- tsdp_header_E_t *E = self;
- if(E){
- TSK_FREE(E->value);
- }
- else{
- TSK_DEBUG_ERROR("Null E header.");
- }
-
- return self;
+ tsdp_header_E_t *E = self;
+ if(E) {
+ TSK_FREE(E->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null E header.");
+ }
+
+ return self;
}
static int tsdp_header_E_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_E_def_s =
-{
- sizeof(tsdp_header_E_t),
- tsdp_header_E_ctor,
- tsdp_header_E_dtor,
- tsdp_header_E_cmp
+static const tsk_object_def_t tsdp_header_E_def_s = {
+ sizeof(tsdp_header_E_t),
+ tsdp_header_E_ctor,
+ tsdp_header_E_dtor,
+ tsdp_header_E_cmp
};
const tsk_object_def_t *tsdp_header_E_def_t = &tsdp_header_E_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_I.c b/tinySDP/src/headers/tsdp_header_I.c
index 15b204c..4947134 100755
--- a/tinySDP/src/headers/tsdp_header_I.c
+++ b/tinySDP/src/headers/tsdp_header_I.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_I.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,242 +42,251 @@
tsdp_header_I_t* tsdp_header_I_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_I_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_I_VA_ARGS(value));
}
tsdp_header_I_t* tsdp_header_I_create_null()
{
- return tsdp_header_I_create(tsk_null);
+ return tsdp_header_I_create(tsk_null);
}
int tsdp_header_I_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_I_t *I = (const tsdp_header_I_t *)header;
- if(I->value){
- tsk_buffer_append(output, I->value, tsk_strlen(I->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_I_t *I = (const tsdp_header_I_t *)header;
+ if(I->value) {
+ tsk_buffer_append(output, I->value, tsk_strlen(I->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_I_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_I_t *I = (const tsdp_header_I_t *)header;
- return (tsdp_header_t*)tsdp_header_I_create(I->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_I_t *I = (const tsdp_header_I_t *)header;
+ return (tsdp_header_t*)tsdp_header_I_create(I->value);
+ }
+ return tsk_null;
}
tsdp_header_I_t *tsdp_header_I_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_I_t *hdr_I = tsdp_header_I_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 89 "./src/headers/tsdp_header_I.c" */
-static const char _tsdp_machine_parser_header_I_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_I_t *hdr_I = tsdp_header_I_create_null();
-static const char _tsdp_machine_parser_header_I_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_I_trans_keys[] = {
- 105, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_I_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 89 "./src/headers/tsdp_header_I.c" */
+ static const char _tsdp_machine_parser_header_I_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_I_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_I_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_I_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_I_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_I_trans_keys[] = {
+ 105, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_I_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_I_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_I_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_I_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_I_start = 1;
-static const int tsdp_machine_parser_header_I_first_final = 4;
-static const int tsdp_machine_parser_header_I_error = 0;
-
-static const int tsdp_machine_parser_header_I_en_main = 1;
-
-
-/* #line 103 "./ragel/tsdp_parser_header_I.rl" */
- (void)(tsdp_machine_parser_header_I_first_final);
- (void)(tsdp_machine_parser_header_I_error);
- (void)(tsdp_machine_parser_header_I_en_main);
-
-/* #line 141 "./src/headers/tsdp_header_I.c" */
- {
- cs = tsdp_machine_parser_header_I_start;
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_I.rl" */
-
-/* #line 148 "./src/headers/tsdp_header_I.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_I_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_I_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_I_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_I_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_I_start = 1;
+ static const int tsdp_machine_parser_header_I_first_final = 4;
+ static const int tsdp_machine_parser_header_I_error = 0;
+
+ static const int tsdp_machine_parser_header_I_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsdp_parser_header_I.rl" */
+ (void)(tsdp_machine_parser_header_I_first_final);
+ (void)(tsdp_machine_parser_header_I_error);
+ (void)(tsdp_machine_parser_header_I_en_main);
+
+ /* #line 141 "./src/headers/tsdp_header_I.c" */
+ {
+ cs = tsdp_machine_parser_header_I_start;
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_I.rl" */
+
+ /* #line 148 "./src/headers/tsdp_header_I.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_I_trans_keys + _tsdp_machine_parser_header_I_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_I_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_I_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_I_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_I_trans_keys + _tsdp_machine_parser_header_I_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_I_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_I_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_I_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_I_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_I_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_I_actions + _tsdp_machine_parser_header_I_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_I.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_I.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_I->value);
- }
- break;
-/* #line 233 "./src/headers/tsdp_header_I.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_I_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_I_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_I_actions + _tsdp_machine_parser_header_I_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_I.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_I.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_I->value);
+ }
+ break;
+ /* #line 233 "./src/headers/tsdp_header_I.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_I_actions + _tsdp_machine_parser_header_I_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_I.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_I.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_I->value);
- }
- break;
-/* #line 261 "./src/headers/tsdp_header_I.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 108 "./ragel/tsdp_parser_header_I.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 273 "./src/headers/tsdp_header_I.c" */
-4
-/* #line 110 "./ragel/tsdp_parser_header_I.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"i=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_I);
- }
-
- return hdr_I;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_I_actions + _tsdp_machine_parser_header_I_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_I.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_I.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_I->value);
+ }
+ break;
+ /* #line 261 "./src/headers/tsdp_header_I.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 108 "./ragel/tsdp_parser_header_I.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 273 "./src/headers/tsdp_header_I.c" */
+ 4
+ /* #line 110 "./ragel/tsdp_parser_header_I.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"i=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_I);
+ }
+
+ return hdr_I;
}
@@ -292,50 +301,48 @@ _again:
static tsk_object_t* tsdp_header_I_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_I_t *I = self;
- if(I)
- {
- TSDP_HEADER(I)->type = tsdp_htype_I;
- TSDP_HEADER(I)->tostring = tsdp_header_I_tostring;
- TSDP_HEADER(I)->clone = tsdp_header_I_clone;
- TSDP_HEADER(I)->rank = TSDP_HTYPE_I_RANK;
-
- I->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new I header.");
- }
- return self;
+ tsdp_header_I_t *I = self;
+ if(I) {
+ TSDP_HEADER(I)->type = tsdp_htype_I;
+ TSDP_HEADER(I)->tostring = tsdp_header_I_tostring;
+ TSDP_HEADER(I)->clone = tsdp_header_I_clone;
+ TSDP_HEADER(I)->rank = TSDP_HTYPE_I_RANK;
+
+ I->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new I header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_I_dtor(tsk_object_t *self)
{
- tsdp_header_I_t *I = self;
- if(I){
- TSK_FREE(I->value);
- }
- else{
- TSK_DEBUG_ERROR("Null I header.");
- }
-
- return self;
+ tsdp_header_I_t *I = self;
+ if(I) {
+ TSK_FREE(I->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null I header.");
+ }
+
+ return self;
}
static int tsdp_header_I_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_I_def_s =
-{
- sizeof(tsdp_header_I_t),
- tsdp_header_I_ctor,
- tsdp_header_I_dtor,
- tsdp_header_I_cmp
+static const tsk_object_def_t tsdp_header_I_def_s = {
+ sizeof(tsdp_header_I_t),
+ tsdp_header_I_ctor,
+ tsdp_header_I_dtor,
+ tsdp_header_I_cmp
};
const tsk_object_def_t *tsdp_header_I_def_t = &tsdp_header_I_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_K.c b/tinySDP/src/headers/tsdp_header_K.c
index 05d96a5..db38b59 100755
--- a/tinySDP/src/headers/tsdp_header_K.c
+++ b/tinySDP/src/headers/tsdp_header_K.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_K.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,241 +43,251 @@
tsdp_header_K_t* tsdp_header_K_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_K_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_K_VA_ARGS(value));
}
tsdp_header_K_t* tsdp_header_K_create_null()
{
- return tsdp_header_K_create(tsk_null);
+ return tsdp_header_K_create(tsk_null);
}
int tsdp_header_K_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_K_t *K = (const tsdp_header_K_t *)header;
- if(K->value){
- tsk_buffer_append(output, K->value, tsk_strlen(K->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_K_t *K = (const tsdp_header_K_t *)header;
+ if(K->value) {
+ tsk_buffer_append(output, K->value, tsk_strlen(K->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_K_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_K_t *K = (const tsdp_header_K_t *)header;
- return (tsdp_header_t*)tsdp_header_K_create(K->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_K_t *K = (const tsdp_header_K_t *)header;
+ return (tsdp_header_t*)tsdp_header_K_create(K->value);
+ }
+ return tsk_null;
}
tsdp_header_K_t *tsdp_header_K_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_K_t *hdr_K = tsdp_header_K_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 89 "./src/headers/tsdp_header_K.c" */
-static const char _tsdp_machine_parser_header_K_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_K_t *hdr_K = tsdp_header_K_create_null();
-static const char _tsdp_machine_parser_header_K_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_K_trans_keys[] = {
- 107, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_K_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 89 "./src/headers/tsdp_header_K.c" */
+ static const char _tsdp_machine_parser_header_K_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_K_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_K_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_K_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_K_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_K_trans_keys[] = {
+ 107, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_K_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_K_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_K_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_K_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_K_start = 1;
-static const int tsdp_machine_parser_header_K_first_final = 4;
-static const int tsdp_machine_parser_header_K_error = 0;
-
-static const int tsdp_machine_parser_header_K_en_main = 1;
-
-
-/* #line 103 "./ragel/tsdp_parser_header_K.rl" */
- (void)(tsdp_machine_parser_header_K_first_final);
- (void)(tsdp_machine_parser_header_K_error);
- (void)(tsdp_machine_parser_header_K_en_main);
-
-/* #line 141 "./src/headers/tsdp_header_K.c" */
- {
- cs = tsdp_machine_parser_header_K_start;
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_K.rl" */
-
-/* #line 148 "./src/headers/tsdp_header_K.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_K_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_K_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_K_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_K_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_K_start = 1;
+ static const int tsdp_machine_parser_header_K_first_final = 4;
+ static const int tsdp_machine_parser_header_K_error = 0;
+
+ static const int tsdp_machine_parser_header_K_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsdp_parser_header_K.rl" */
+ (void)(tsdp_machine_parser_header_K_first_final);
+ (void)(tsdp_machine_parser_header_K_error);
+ (void)(tsdp_machine_parser_header_K_en_main);
+
+ /* #line 141 "./src/headers/tsdp_header_K.c" */
+ {
+ cs = tsdp_machine_parser_header_K_start;
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_K.rl" */
+
+ /* #line 148 "./src/headers/tsdp_header_K.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_K_trans_keys + _tsdp_machine_parser_header_K_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_K_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_K_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_K_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_K_trans_keys + _tsdp_machine_parser_header_K_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_K_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_K_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_K_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_K_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_K_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_K_actions + _tsdp_machine_parser_header_K_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_K.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_K.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_K->value);
- }
- break;
-/* #line 233 "./src/headers/tsdp_header_K.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_K_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_K_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_K_actions + _tsdp_machine_parser_header_K_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_K.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_K.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_K->value);
+ }
+ break;
+ /* #line 233 "./src/headers/tsdp_header_K.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_K_actions + _tsdp_machine_parser_header_K_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_K.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_K.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_K->value);
- }
- break;
-/* #line 261 "./src/headers/tsdp_header_K.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 108 "./ragel/tsdp_parser_header_K.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 273 "./src/headers/tsdp_header_K.c" */
-4
-/* #line 110 "./ragel/tsdp_parser_header_K.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"k=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_K);
- }
-
- return hdr_K;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_K_actions + _tsdp_machine_parser_header_K_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_K.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_K.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_K->value);
+ }
+ break;
+ /* #line 261 "./src/headers/tsdp_header_K.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 108 "./ragel/tsdp_parser_header_K.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 273 "./src/headers/tsdp_header_K.c" */
+ 4
+ /* #line 110 "./ragel/tsdp_parser_header_K.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"k=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_K);
+ }
+
+ return hdr_K;
}
@@ -292,49 +302,48 @@ _again:
static tsk_object_t* tsdp_header_K_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_K_t *K = self;
- if(K){
- TSDP_HEADER(K)->type = tsdp_htype_K;
- TSDP_HEADER(K)->tostring = tsdp_header_K_tostring;
- TSDP_HEADER(K)->clone = tsdp_header_K_clone;
- TSDP_HEADER(K)->rank = TSDP_HTYPE_P_RANK;
-
- K->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new K header.");
- }
- return self;
+ tsdp_header_K_t *K = self;
+ if(K) {
+ TSDP_HEADER(K)->type = tsdp_htype_K;
+ TSDP_HEADER(K)->tostring = tsdp_header_K_tostring;
+ TSDP_HEADER(K)->clone = tsdp_header_K_clone;
+ TSDP_HEADER(K)->rank = TSDP_HTYPE_P_RANK;
+
+ K->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new K header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_K_dtor(tsk_object_t *self)
{
- tsdp_header_K_t *K = self;
- if(K){
- TSK_FREE(K->value);
- }
- else{
- TSK_DEBUG_ERROR("Null K header.");
- }
-
- return self;
+ tsdp_header_K_t *K = self;
+ if(K) {
+ TSK_FREE(K->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null K header.");
+ }
+
+ return self;
}
static int tsdp_header_K_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_K_def_s =
-{
- sizeof(tsdp_header_K_t),
- tsdp_header_K_ctor,
- tsdp_header_K_dtor,
- tsdp_header_K_cmp
+static const tsk_object_def_t tsdp_header_K_def_s = {
+ sizeof(tsdp_header_K_t),
+ tsdp_header_K_ctor,
+ tsdp_header_K_dtor,
+ tsdp_header_K_cmp
};
const tsk_object_def_t *tsdp_header_K_def_t = &tsdp_header_K_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_M.c b/tinySDP/src/headers/tsdp_header_M.c
index 597839b..130866d 100755
--- a/tinySDP/src/headers/tsdp_header_M.c
+++ b/tinySDP/src/headers/tsdp_header_M.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_M.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tsdp_header_M.c
* @brief SDP "m=" header (Media Descriptions).
- *
+ *
*/
#include "tinysdp/headers/tsdp_header_M.h"
@@ -44,835 +44,835 @@
tsdp_header_M_t* tsdp_header_M_create(const char* media, uint32_t port, const char* proto)
{
- return tsk_object_new(TSDP_HEADER_M_VA_ARGS(media, port, proto));
+ return tsk_object_new(TSDP_HEADER_M_VA_ARGS(media, port, proto));
}
tsdp_header_M_t* tsdp_header_M_create_null()
{
- return tsdp_header_M_create(tsk_null, 0, tsk_null);
+ return tsdp_header_M_create(tsk_null, 0, tsk_null);
}
tsdp_fmt_t* tsdp_fmt_create(const char* fmt)
{
- return tsk_object_new(TSDP_FMT_VA_ARGS(fmt));
+ return tsk_object_new(TSDP_FMT_VA_ARGS(fmt));
}
int tsdp_header_M_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_M_t *M = (const tsdp_header_M_t *)header;
- const tsk_list_item_t* item;
- tsk_istr_t nports;
-
- tsk_itoa(M->nports, &nports);
-
- /* IMPORTANT: Keep the order.
-
- m= (media name and transport address)
- i=* (media title)
- c=* (connection information -- optional if included at
- session level)
- b=* (zero or more bandwidth information lines)
- k=* (encryption key)
- a=* (zero or more media attribute lines)
- */
- tsk_buffer_append_2(output, "%s %u%s%s %s",
- M->media,
- M->port,
-
- M->nports ? "/" : "",
- M->nports ? nports : "",
-
- M->proto
- );
- // FMTs
- tsk_list_foreach(item, M->FMTs){
- tsk_buffer_append_2(output, " %s", TSDP_FMT_STR(item->data));
- }
- tsk_buffer_append(output, "\r\n", 2); // close the "m=" line.
- // i=* (media title)
- if(M->I){
- tsdp_header_serialize(TSDP_HEADER(M->I), output);
- }
- // c=* (connection information -- optional if included at session level)
- if(M->C){
- tsdp_header_serialize(TSDP_HEADER(M->C), output);
- }
- // b=* (zero or more bandwidth information lines)
- if(M->Bandwidths){
- tsk_list_foreach(item, M->Bandwidths){
- tsdp_header_serialize(TSDP_HEADER(item->data), output);
- }
- }
- // k=* (encryption key)
- if(M->K){
- tsdp_header_serialize(TSDP_HEADER(M->K), output);
- }
- // a=* (zero or more media attribute lines)
- if(M->Attributes){
- tsk_list_foreach(item, M->Attributes){
- tsdp_header_serialize(TSDP_HEADER(item->data), output);
- }
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_M_t *M = (const tsdp_header_M_t *)header;
+ const tsk_list_item_t* item;
+ tsk_istr_t nports;
+
+ tsk_itoa(M->nports, &nports);
+
+ /* IMPORTANT: Keep the order.
+
+ m= (media name and transport address)
+ i=* (media title)
+ c=* (connection information -- optional if included at
+ session level)
+ b=* (zero or more bandwidth information lines)
+ k=* (encryption key)
+ a=* (zero or more media attribute lines)
+ */
+ tsk_buffer_append_2(output, "%s %u%s%s %s",
+ M->media,
+ M->port,
+
+ M->nports ? "/" : "",
+ M->nports ? nports : "",
+
+ M->proto
+ );
+ // FMTs
+ tsk_list_foreach(item, M->FMTs) {
+ tsk_buffer_append_2(output, " %s", TSDP_FMT_STR(item->data));
+ }
+ tsk_buffer_append(output, "\r\n", 2); // close the "m=" line.
+ // i=* (media title)
+ if(M->I) {
+ tsdp_header_serialize(TSDP_HEADER(M->I), output);
+ }
+ // c=* (connection information -- optional if included at session level)
+ if(M->C) {
+ tsdp_header_serialize(TSDP_HEADER(M->C), output);
+ }
+ // b=* (zero or more bandwidth information lines)
+ if(M->Bandwidths) {
+ tsk_list_foreach(item, M->Bandwidths) {
+ tsdp_header_serialize(TSDP_HEADER(item->data), output);
+ }
+ }
+ // k=* (encryption key)
+ if(M->K) {
+ tsdp_header_serialize(TSDP_HEADER(M->K), output);
+ }
+ // a=* (zero or more media attribute lines)
+ if(M->Attributes) {
+ tsk_list_foreach(item, M->Attributes) {
+ tsdp_header_serialize(TSDP_HEADER(item->data), output);
+ }
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_M_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_M_t *M = (const tsdp_header_M_t *)header;
- tsdp_header_M_t* clone;
- const tsk_list_item_t* item;
-
- if((clone = tsdp_header_M_create(M->media, M->port, M->proto))){
- clone->nports = M->nports;
-
- // Formats
- tsk_list_foreach(item, M->FMTs){
- tsk_string_t* string = tsk_string_create(TSK_STRING_STR(item->data));
- tsk_list_push_back_data(clone->FMTs, (void**)&string);
- }
-
- // I
- clone->I = (tsdp_header_I_t*) (M->I ? TSDP_HEADER(M->I)->clone(TSDP_HEADER(M->I)) : tsk_null);
- // C
- clone->C = (tsdp_header_C_t*) (M->C ? TSDP_HEADER(M->C)->clone(TSDP_HEADER(M->C)) : tsk_null);
- // Bandwidths
- tsk_list_foreach(item, M->Bandwidths){
- tsdp_header_t* B;
- if(!clone->Bandwidths){
- clone->Bandwidths = tsk_list_create();
- }
- B = ((tsdp_header_t*)item->data)->clone((tsdp_header_t*)item->data);
- tsk_list_push_back_data(clone->Bandwidths, (void**)&B);
- }
- // K
- clone->K = (tsdp_header_K_t*) (M->K ? TSDP_HEADER(M->K)->clone(TSDP_HEADER(M->K)) : tsk_null);
- // Attributes
- tsk_list_foreach(item, M->Attributes){
- tsdp_header_t* A;
- if(!clone->Attributes){
- clone->Attributes = tsk_list_create();
- }
- A = ((tsdp_header_t*)item->data)->clone((tsdp_header_t*)item->data);
- tsk_list_push_back_data(clone->Attributes, (void**)&A);
- }
- }
-
- return TSDP_HEADER(clone);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_M_t *M = (const tsdp_header_M_t *)header;
+ tsdp_header_M_t* clone;
+ const tsk_list_item_t* item;
+
+ if((clone = tsdp_header_M_create(M->media, M->port, M->proto))) {
+ clone->nports = M->nports;
+
+ // Formats
+ tsk_list_foreach(item, M->FMTs) {
+ tsk_string_t* string = tsk_string_create(TSK_STRING_STR(item->data));
+ tsk_list_push_back_data(clone->FMTs, (void**)&string);
+ }
+
+ // I
+ clone->I = (tsdp_header_I_t*) (M->I ? TSDP_HEADER(M->I)->clone(TSDP_HEADER(M->I)) : tsk_null);
+ // C
+ clone->C = (tsdp_header_C_t*) (M->C ? TSDP_HEADER(M->C)->clone(TSDP_HEADER(M->C)) : tsk_null);
+ // Bandwidths
+ tsk_list_foreach(item, M->Bandwidths) {
+ tsdp_header_t* B;
+ if(!clone->Bandwidths) {
+ clone->Bandwidths = tsk_list_create();
+ }
+ B = ((tsdp_header_t*)item->data)->clone((tsdp_header_t*)item->data);
+ tsk_list_push_back_data(clone->Bandwidths, (void**)&B);
+ }
+ // K
+ clone->K = (tsdp_header_K_t*) (M->K ? TSDP_HEADER(M->K)->clone(TSDP_HEADER(M->K)) : tsk_null);
+ // Attributes
+ tsk_list_foreach(item, M->Attributes) {
+ tsdp_header_t* A;
+ if(!clone->Attributes) {
+ clone->Attributes = tsk_list_create();
+ }
+ A = ((tsdp_header_t*)item->data)->clone((tsdp_header_t*)item->data);
+ tsk_list_push_back_data(clone->Attributes, (void**)&A);
+ }
+ }
+
+ return TSDP_HEADER(clone);
+ }
+ return tsk_null;
}
tsdp_header_M_t *tsdp_header_M_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_M_t *hdr_M = tsdp_header_M_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 184 "./src/headers/tsdp_header_M.c" */
-static const char _tsdp_machine_parser_header_M_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4
-};
-
-static const char _tsdp_machine_parser_header_M_key_offsets[] = {
- 0, 0, 1, 3, 18, 33, 35, 39,
- 53, 54, 68, 70, 73, 88, 88, 103
-};
-
-static const char _tsdp_machine_parser_header_M_trans_keys[] = {
- 109, 32, 61, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 48, 57, 32, 47, 48, 57, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 48, 57, 32, 48,
- 57, 13, 32, 33, 37, 39, 47, 126,
- 42, 43, 45, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 13,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 0
-};
-
-static const char _tsdp_machine_parser_header_M_single_lengths[] = {
- 0, 1, 2, 5, 5, 0, 2, 4,
- 1, 4, 0, 1, 7, 0, 5, 6
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_M_t *hdr_M = tsdp_header_M_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 184 "./src/headers/tsdp_header_M.c" */
+ static const char _tsdp_machine_parser_header_M_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4
+ };
+
+ static const char _tsdp_machine_parser_header_M_key_offsets[] = {
+ 0, 0, 1, 3, 18, 33, 35, 39,
+ 53, 54, 68, 70, 73, 88, 88, 103
+ };
+
+ static const char _tsdp_machine_parser_header_M_trans_keys[] = {
+ 109, 32, 61, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 48, 57, 32, 47, 48, 57, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 48, 57, 32, 48,
+ 57, 13, 32, 33, 37, 39, 47, 126,
+ 42, 43, 45, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 13,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _tsdp_machine_parser_header_M_single_lengths[] = {
+ 0, 1, 2, 5, 5, 0, 2, 4,
+ 1, 4, 0, 1, 7, 0, 5, 6
+ };
+
+ static const char _tsdp_machine_parser_header_M_range_lengths[] = {
+ 0, 0, 0, 5, 5, 1, 1, 5,
+ 0, 5, 1, 1, 4, 0, 5, 5
+ };
+
+ static const char _tsdp_machine_parser_header_M_index_offsets[] = {
+ 0, 0, 2, 5, 16, 27, 29, 33,
+ 43, 45, 55, 57, 60, 72, 73, 84
+ };
+
+ static const char _tsdp_machine_parser_header_M_indicies[] = {
+ 0, 1, 0, 2, 1, 2, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 1,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 1, 6, 1, 7, 8, 9,
+ 1, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 1, 11, 1, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 1, 13,
+ 1, 7, 14, 1, 15, 16, 12, 12,
+ 12, 17, 12, 12, 12, 12, 12, 1,
+ 1, 18, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 1, 20, 21, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_M_trans_targs[] = {
+ 2, 0, 3, 4, 5, 4, 6, 7,
+ 10, 6, 12, 13, 12, 11, 11, 8,
+ 14, 9, 8, 15, 8, 14, 15
+ };
+
+ static const char _tsdp_machine_parser_header_M_trans_actions[] = {
+ 0, 0, 0, 1, 3, 0, 1, 5,
+ 5, 0, 1, 0, 0, 1, 0, 7,
+ 7, 0, 0, 1, 9, 9, 0
+ };
+
+ static const char _tsdp_machine_parser_header_M_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 0, 9
+ };
+
+ static const int tsdp_machine_parser_header_M_start = 1;
+ static const int tsdp_machine_parser_header_M_first_final = 12;
+ static const int tsdp_machine_parser_header_M_error = 0;
+
+ static const int tsdp_machine_parser_header_M_en_main = 1;
+
+
+ /* #line 220 "./ragel/tsdp_parser_header_M.rl" */
+ (void)(tsdp_machine_parser_header_M_first_final);
+ (void)(tsdp_machine_parser_header_M_error);
+ (void)(tsdp_machine_parser_header_M_en_main);
+
+ /* #line 273 "./src/headers/tsdp_header_M.c" */
+ {
+ cs = tsdp_machine_parser_header_M_start;
+ }
+
+ /* #line 224 "./ragel/tsdp_parser_header_M.rl" */
+
+ /* #line 280 "./src/headers/tsdp_header_M.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+_resume:
+ _keys = _tsdp_machine_parser_header_M_trans_keys + _tsdp_machine_parser_header_M_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_M_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_M_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
-static const char _tsdp_machine_parser_header_M_range_lengths[] = {
- 0, 0, 0, 5, 5, 1, 1, 5,
- 0, 5, 1, 1, 4, 0, 5, 5
-};
+ _klen = _tsdp_machine_parser_header_M_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
-static const char _tsdp_machine_parser_header_M_index_offsets[] = {
- 0, 0, 2, 5, 16, 27, 29, 33,
- 43, 45, 55, 57, 60, 72, 73, 84
-};
+_match:
+ _trans = _tsdp_machine_parser_header_M_indicies[_trans];
+ cs = _tsdp_machine_parser_header_M_trans_targs[_trans];
-static const char _tsdp_machine_parser_header_M_indicies[] = {
- 0, 1, 0, 2, 1, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 1,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 1, 6, 1, 7, 8, 9,
- 1, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 1, 11, 1, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 1, 13,
- 1, 7, 14, 1, 15, 16, 12, 12,
- 12, 17, 12, 12, 12, 12, 12, 1,
- 1, 18, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 1, 20, 21, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 1,
- 0
-};
+ if ( _tsdp_machine_parser_header_M_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
-static const char _tsdp_machine_parser_header_M_trans_targs[] = {
- 2, 0, 3, 4, 5, 4, 6, 7,
- 10, 6, 12, 13, 12, 11, 11, 8,
- 14, 9, 8, 15, 8, 14, 15
-};
+ _acts = _tsdp_machine_parser_header_M_actions + _tsdp_machine_parser_header_M_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_M->media);
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_M->port);
+ }
+ break;
+ case 3:
+ /* #line 59 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_M->proto);
+ }
+ break;
+ case 4:
+ /* #line 63 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_M->FMTs);
+ }
+ break;
+ /* #line 384 "./src/headers/tsdp_header_M.c" */
+ }
+ }
-static const char _tsdp_machine_parser_header_M_trans_actions[] = {
- 0, 0, 0, 1, 3, 0, 1, 5,
- 5, 0, 1, 0, 0, 1, 0, 7,
- 7, 0, 0, 1, 9, 9, 0
-};
+_again:
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_M_actions + _tsdp_machine_parser_header_M_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 3:
+ /* #line 59 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_M->proto);
+ }
+ break;
+ case 4:
+ /* #line 63 "./ragel/tsdp_parser_header_M.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_M->FMTs);
+ }
+ break;
+ /* #line 412 "./src/headers/tsdp_header_M.c" */
+ }
+ }
+ }
-static const char _tsdp_machine_parser_header_M_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 0, 0, 9
-};
+_out: {
+ }
+ }
-static const int tsdp_machine_parser_header_M_start = 1;
-static const int tsdp_machine_parser_header_M_first_final = 12;
-static const int tsdp_machine_parser_header_M_error = 0;
-
-static const int tsdp_machine_parser_header_M_en_main = 1;
-
-
-/* #line 220 "./ragel/tsdp_parser_header_M.rl" */
- (void)(tsdp_machine_parser_header_M_first_final);
- (void)(tsdp_machine_parser_header_M_error);
- (void)(tsdp_machine_parser_header_M_en_main);
-
-/* #line 273 "./src/headers/tsdp_header_M.c" */
- {
- cs = tsdp_machine_parser_header_M_start;
- }
-
-/* #line 224 "./ragel/tsdp_parser_header_M.rl" */
-
-/* #line 280 "./src/headers/tsdp_header_M.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
-_resume:
- _keys = _tsdp_machine_parser_header_M_trans_keys + _tsdp_machine_parser_header_M_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_M_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_M_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_M_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ /* #line 225 "./ragel/tsdp_parser_header_M.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
-_match:
- _trans = _tsdp_machine_parser_header_M_indicies[_trans];
- cs = _tsdp_machine_parser_header_M_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_M_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_M_actions + _tsdp_machine_parser_header_M_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/tsdp_parser_header_M.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_M->media);
- }
- break;
- case 2:
-/* #line 51 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_M->port);
- }
- break;
- case 3:
-/* #line 59 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_M->proto);
- }
- break;
- case 4:
-/* #line 63 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_M->FMTs);
- }
- break;
-/* #line 384 "./src/headers/tsdp_header_M.c" */
- }
- }
+ if( cs <
+ /* #line 424 "./src/headers/tsdp_header_M.c" */
+ 12
+ /* #line 227 "./ragel/tsdp_parser_header_M.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"m=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_M);
+ }
-_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_M_actions + _tsdp_machine_parser_header_M_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 3:
-/* #line 59 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_M->proto);
- }
- break;
- case 4:
-/* #line 63 "./ragel/tsdp_parser_header_M.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_M->FMTs);
- }
- break;
-/* #line 412 "./src/headers/tsdp_header_M.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 225 "./ragel/tsdp_parser_header_M.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 424 "./src/headers/tsdp_header_M.c" */
-12
-/* #line 227 "./ragel/tsdp_parser_header_M.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"m=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_M);
- }
-
- return hdr_M;
+ return hdr_M;
}
// for A headers, use "tsdp_header_A_removeAll_by_field()"
int tsdp_header_M_remove(tsdp_header_M_t* self, tsdp_header_type_t type)
{
- switch(type){
- case tsdp_htype_I:
- {
- TSK_OBJECT_SAFE_FREE(self->I);
- break;
- }
- case tsdp_htype_C:
- {
- TSK_OBJECT_SAFE_FREE(self->C);
- break;
- }
- case tsdp_htype_B:
- {
- if(self->Bandwidths){
- tsk_list_clear_items(self->Bandwidths);
- }
- break;
- }
- case tsdp_htype_K:
- {
- TSK_OBJECT_SAFE_FREE(self->K);
- break;
- }
- }
- return 0;
+ switch(type) {
+ case tsdp_htype_I: {
+ TSK_OBJECT_SAFE_FREE(self->I);
+ break;
+ }
+ case tsdp_htype_C: {
+ TSK_OBJECT_SAFE_FREE(self->C);
+ break;
+ }
+ case tsdp_htype_B: {
+ if(self->Bandwidths) {
+ tsk_list_clear_items(self->Bandwidths);
+ }
+ break;
+ }
+ case tsdp_htype_K: {
+ TSK_OBJECT_SAFE_FREE(self->K);
+ break;
+ }
+ }
+ return 0;
}
int tsdp_header_M_add(tsdp_header_M_t* self, const tsdp_header_t* header)
{
- if(!self || !header){
- return -1;
- }
-
- switch(header->type){
- case tsdp_htype_I:
- {
- TSK_OBJECT_SAFE_FREE(self->I);
- self->I = tsk_object_ref((void*)header);
- break;
- }
- case tsdp_htype_C:
- {
- TSK_OBJECT_SAFE_FREE(self->C);
- self->C = tsk_object_ref((void*)header);
- break;
- }
- case tsdp_htype_B:
- {
- tsdp_header_t* B = tsk_object_ref((void*)header);
- if(!self->Bandwidths){
- self->Bandwidths = tsk_list_create();
- }
- tsk_list_push_back_data(self->Bandwidths, (void**)&B);
- break;
- }
- case tsdp_htype_K:
- {
- TSK_OBJECT_SAFE_FREE(self->K);
- self->K = tsk_object_ref((void*)header);
- break;
- }
- case tsdp_htype_A:
- {
- tsdp_header_t* A = tsk_object_ref((void*)header);
- if(!self->Attributes){
- self->Attributes = tsk_list_create();
- }
- tsk_list_push_back_data(self->Attributes, (void**)&A);
- break;
- }
- }
-
- return 0;
+ if(!self || !header) {
+ return -1;
+ }
+
+ switch(header->type) {
+ case tsdp_htype_I: {
+ TSK_OBJECT_SAFE_FREE(self->I);
+ self->I = tsk_object_ref((void*)header);
+ break;
+ }
+ case tsdp_htype_C: {
+ TSK_OBJECT_SAFE_FREE(self->C);
+ self->C = tsk_object_ref((void*)header);
+ break;
+ }
+ case tsdp_htype_B: {
+ tsdp_header_t* B = tsk_object_ref((void*)header);
+ if(!self->Bandwidths) {
+ self->Bandwidths = tsk_list_create();
+ }
+ tsk_list_push_back_data(self->Bandwidths, (void**)&B);
+ break;
+ }
+ case tsdp_htype_K: {
+ TSK_OBJECT_SAFE_FREE(self->K);
+ self->K = tsk_object_ref((void*)header);
+ break;
+ }
+ case tsdp_htype_A: {
+ tsdp_header_t* A = tsk_object_ref((void*)header);
+ if(!self->Attributes) {
+ self->Attributes = tsk_list_create();
+ }
+ tsk_list_push_back_data(self->Attributes, (void**)&A);
+ break;
+ }
+ }
+
+ return 0;
}
int tsdp_header_M_add_headers(tsdp_header_M_t* self, ...)
{
- const tsk_object_def_t* objdef;
- tsdp_header_t *header;
- tsdp_fmt_t* fmt;
- va_list ap;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if(objdef == tsdp_fmt_def_t){
- if((fmt = tsk_object_new_2(objdef, &ap))){
- tsk_list_push_back_data(self->FMTs, (void**)&fmt);
- }
- }
- else{
- if((header = tsk_object_new_2(objdef, &ap))){
- tsdp_header_M_add(self, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- }
- va_end(ap);
-
- return 0;
+ const tsk_object_def_t* objdef;
+ tsdp_header_t *header;
+ tsdp_fmt_t* fmt;
+ va_list ap;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if(objdef == tsdp_fmt_def_t) {
+ if((fmt = tsk_object_new_2(objdef, &ap))) {
+ tsk_list_push_back_data(self->FMTs, (void**)&fmt);
+ }
+ }
+ else {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ tsdp_header_M_add(self, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
int tsdp_header_M_add_headers_2(tsdp_header_M_t* self, const tsdp_headers_L_t* headers)
{
- const tsk_list_item_t* item;
+ const tsk_list_item_t* item;
- if(!self || !headers){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !headers) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_list_foreach(item, headers){
- tsdp_header_M_add(self, item->data);
- }
+ tsk_list_foreach(item, headers) {
+ tsdp_header_M_add(self, item->data);
+ }
- return 0;
+ return 0;
}
int tsdp_header_M_add_fmt(tsdp_header_M_t* self, const char* fmt)
{
- tsdp_fmt_t* _fmt;
- if(!self || tsk_strnullORempty(fmt)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((_fmt = tsdp_fmt_create(fmt))){
- tsk_list_push_back_data(self->FMTs, (void**)&_fmt);
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create fmt object");
- return -2;
- }
+ tsdp_fmt_t* _fmt;
+ if(!self || tsk_strnullORempty(fmt)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((_fmt = tsdp_fmt_create(fmt))) {
+ tsk_list_push_back_data(self->FMTs, (void**)&_fmt);
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create fmt object");
+ return -2;
+ }
}
int tsdp_header_M_remove_fmt(tsdp_header_M_t* self, const char* fmt)
{
- const tsk_list_item_t* itemM;
- const tsdp_fmt_t* _fmt;
- char* fmt_plus_space = tsk_null;
- tsk_size_t fmt_plus_space_len;
- if(!self || tsk_strnullORempty(fmt)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_sprintf(&fmt_plus_space, "%s ", fmt);
- if((fmt_plus_space_len = tsk_strlen(fmt_plus_space))){
- tsk_list_foreach(itemM, self->FMTs){
- if(!(_fmt = (const tsdp_fmt_t*)itemM->data)){
- continue;
- }
- if(tsk_striequals(_fmt->value, fmt)){
- // remove all A headers using this attribute
- const tsdp_header_A_t* A;
- const tsk_list_item_t* itemA;
+ const tsk_list_item_t* itemM;
+ const tsdp_fmt_t* _fmt;
+ char* fmt_plus_space = tsk_null;
+ tsk_size_t fmt_plus_space_len;
+ if(!self || tsk_strnullORempty(fmt)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_sprintf(&fmt_plus_space, "%s ", fmt);
+ if((fmt_plus_space_len = tsk_strlen(fmt_plus_space))) {
+ tsk_list_foreach(itemM, self->FMTs) {
+ if(!(_fmt = (const tsdp_fmt_t*)itemM->data)) {
+ continue;
+ }
+ if(tsk_striequals(_fmt->value, fmt)) {
+ // remove all A headers using this attribute
+ const tsdp_header_A_t* A;
+ const tsk_list_item_t* itemA;
removeAttributes:
- tsk_list_foreach(itemA, self->Attributes){
- if(!(A = (const tsdp_header_A_t*)itemA->data)){
- continue;
- }
- if(tsk_strindexOf(A->value, fmt_plus_space_len, fmt_plus_space) == 0){
- // Guard to be sure we know what to remove. For example:
- // tsdp_header_M_remove_fmt(self, 0) would remove both
- // a=rtpmap:0 PCMU/8000/1
- // a=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:Gi8s25tDKDnd/xORJ/ZtRWWC1drVbax5Ve4ftCWd
- // and cause issue 115: https://code.google.com/p/webrtc2sip/issues/detail?id=115
- if(!tsk_striequals(A->field, "crypto")){
- tsk_list_remove_item(self->Attributes, (tsk_list_item_t*)itemA);
- goto removeAttributes;
- }
- }
- }
- tsk_list_remove_item(self->FMTs, (tsk_list_item_t*)itemM);
- break;
- }
- }
- }
- TSK_FREE(fmt_plus_space);
- return 0;
+ tsk_list_foreach(itemA, self->Attributes) {
+ if(!(A = (const tsdp_header_A_t*)itemA->data)) {
+ continue;
+ }
+ if(tsk_strindexOf(A->value, fmt_plus_space_len, fmt_plus_space) == 0) {
+ // Guard to be sure we know what to remove. For example:
+ // tsdp_header_M_remove_fmt(self, 0) would remove both
+ // a=rtpmap:0 PCMU/8000/1
+ // a=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:Gi8s25tDKDnd/xORJ/ZtRWWC1drVbax5Ve4ftCWd
+ // and cause issue 115: https://code.google.com/p/webrtc2sip/issues/detail?id=115
+ if(!tsk_striequals(A->field, "crypto")) {
+ tsk_list_remove_item(self->Attributes, (tsk_list_item_t*)itemA);
+ goto removeAttributes;
+ }
+ }
+ }
+ tsk_list_remove_item(self->FMTs, (tsk_list_item_t*)itemM);
+ break;
+ }
+ }
+ }
+ TSK_FREE(fmt_plus_space);
+ return 0;
}
tsk_bool_t tsdp_header_M_have_fmt(const tsdp_header_M_t* self, const char* fmt)
{
- if(self && !tsk_strnullORempty(fmt)){
- const tsk_list_item_t* item;
- const tsdp_fmt_t* _fmt;
- tsk_list_foreach(item, self->FMTs){
- if(!(_fmt = (const tsdp_fmt_t*)item->data)){
- continue;
- }
- if(tsk_striequals(_fmt->value, fmt)){
- return tsk_true;
- }
- }
- }
-
- return tsk_false;
+ if(self && !tsk_strnullORempty(fmt)) {
+ const tsk_list_item_t* item;
+ const tsdp_fmt_t* _fmt;
+ tsk_list_foreach(item, self->FMTs) {
+ if(!(_fmt = (const tsdp_fmt_t*)item->data)) {
+ continue;
+ }
+ if(tsk_striequals(_fmt->value, fmt)) {
+ return tsk_true;
+ }
+ }
+ }
+
+ return tsk_false;
}
const tsdp_header_A_t* tsdp_header_M_findA_at(const tsdp_header_M_t* self, const char* field, tsk_size_t index)
{
- const tsk_list_item_t *item;
- tsk_size_t pos = 0;
- const tsdp_header_A_t* A;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsk_list_foreach(item, self->Attributes){
- if(!(A = item->data)){
- continue;
- }
-
- if(tsk_strequals(A->field, field)){
- if(pos++ >= index){
- return A;
- }
- }
- }
-
- return tsk_null;
+ const tsk_list_item_t *item;
+ tsk_size_t pos = 0;
+ const tsdp_header_A_t* A;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsk_list_foreach(item, self->Attributes) {
+ if(!(A = item->data)) {
+ continue;
+ }
+
+ if(tsk_strequals(A->field, field)) {
+ if(pos++ >= index) {
+ return A;
+ }
+ }
+ }
+
+ return tsk_null;
}
const tsdp_header_A_t* tsdp_header_M_findA(const tsdp_header_M_t* self, const char* field)
{
- return tsdp_header_M_findA_at(self, field, 0);
+ return tsdp_header_M_findA_at(self, field, 0);
}
char* tsdp_header_M_getAValue(const tsdp_header_M_t* self, const char* field, const char* fmt)
{
- char *value = tsk_null; /* e.g. AMR-WB/16000 */
- tsk_size_t i = 0, fmt_len, A_len;
- int indexof;
- const tsdp_header_A_t* A;
-
- fmt_len = tsk_strlen(fmt);
- if(!self || !fmt_len || fmt_len > 3/*'0-255' or '*'*/){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- /* find "a=rtpmap" */
- while((A = tsdp_header_M_findA_at(self, field, i++))){
- /* A->value would be: "98 AMR-WB/16000" */
- if((A_len = tsk_strlen(A->value)) < (fmt_len + 1/*space*/)){
- continue;
- }
- if((indexof = tsk_strindexOf(A->value, A_len, fmt)) == 0 && (A->value[fmt_len] == ' ')){
- value = tsk_strndup(&A->value[fmt_len+1], (A_len-(fmt_len+1)));
- break;
- }
- }
- return value;
+ char *value = tsk_null; /* e.g. AMR-WB/16000 */
+ tsk_size_t i = 0, fmt_len, A_len;
+ int indexof;
+ const tsdp_header_A_t* A;
+
+ fmt_len = tsk_strlen(fmt);
+ if(!self || !fmt_len || fmt_len > 3/*'0-255' or '*'*/) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ /* find "a=rtpmap" */
+ while((A = tsdp_header_M_findA_at(self, field, i++))) {
+ /* A->value would be: "98 AMR-WB/16000" */
+ if((A_len = tsk_strlen(A->value)) < (fmt_len + 1/*space*/)) {
+ continue;
+ }
+ if((indexof = tsk_strindexOf(A->value, A_len, fmt)) == 0 && (A->value[fmt_len] == ' ')) {
+ value = tsk_strndup(&A->value[fmt_len+1], (A_len-(fmt_len+1)));
+ break;
+ }
+ }
+ return value;
}
/* as per 3GPP TS 34.610 */
int tsdp_header_M_hold(tsdp_header_M_t* self, tsk_bool_t local)
{
- const tsdp_header_A_t* a;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((a = tsdp_header_M_findA(self, local ? "recvonly" : "sendonly"))){
- // an "inactive" SDP attribute if the stream was previously set to "recvonly" media stream
- tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "inactive" : "recvonly");
- }
- else if((a = tsdp_header_M_findA(self, "sendrecv"))){
- // a "sendonly" SDP attribute if the stream was previously set to "sendrecv" media stream
- tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "sendonly" : "recvonly");
- }
- else{
- // default value is sendrecv. hold on default --> sendonly
- if(!(a = tsdp_header_M_findA(self, local ? "sendonly" : "recvonly")) && !(a = tsdp_header_M_findA(self, "inactive"))){
- tsdp_header_A_t* newA;
- if((newA = tsdp_header_A_create(local ? "sendonly" : "recvonly", tsk_null))){
- tsdp_header_M_add(self, TSDP_HEADER_CONST(newA));
- TSK_OBJECT_SAFE_FREE(newA);
- }
- }
- }
- return 0;
+ const tsdp_header_A_t* a;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((a = tsdp_header_M_findA(self, local ? "recvonly" : "sendonly"))) {
+ // an "inactive" SDP attribute if the stream was previously set to "recvonly" media stream
+ tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "inactive" : "recvonly");
+ }
+ else if((a = tsdp_header_M_findA(self, "sendrecv"))) {
+ // a "sendonly" SDP attribute if the stream was previously set to "sendrecv" media stream
+ tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "sendonly" : "recvonly");
+ }
+ else {
+ // default value is sendrecv. hold on default --> sendonly
+ if(!(a = tsdp_header_M_findA(self, local ? "sendonly" : "recvonly")) && !(a = tsdp_header_M_findA(self, "inactive"))) {
+ tsdp_header_A_t* newA;
+ if((newA = tsdp_header_A_create(local ? "sendonly" : "recvonly", tsk_null))) {
+ tsdp_header_M_add(self, TSDP_HEADER_CONST(newA));
+ TSK_OBJECT_SAFE_FREE(newA);
+ }
+ }
+ }
+ return 0;
}
/* as per 3GPP TS 34.610 */
int tsdp_header_M_set_holdresume_att(tsdp_header_M_t* self, tsk_bool_t lo_held, tsk_bool_t ro_held)
{
- const tsdp_header_A_t* A;
- static const char* hold_resume_atts[2][2] =
- {
- {"sendrecv", "recvonly"},
- {"sendonly", "inactive"},
- };
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((A = tsdp_header_M_findA(self, "sendrecv")) || (A = tsdp_header_M_findA(self, "sendonly")) || (A = tsdp_header_M_findA(self, "recvonly")) || (A = tsdp_header_M_findA(self, "inactive"))){
- tsk_strupdate(&(TSDP_HEADER_A(A)->field), hold_resume_atts[lo_held & 1][ro_held & 1]);
- }
- else{
- tsdp_header_A_t* newA;
- if((newA = tsdp_header_A_create(hold_resume_atts[lo_held & 1][ro_held & 1], tsk_null))){
- tsdp_header_M_add(self, TSDP_HEADER_CONST(newA));
- TSK_OBJECT_SAFE_FREE(newA);
- }
- }
-
- return 0;
+ const tsdp_header_A_t* A;
+ static const char* hold_resume_atts[2][2] = {
+ {"sendrecv", "recvonly"},
+ {"sendonly", "inactive"},
+ };
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((A = tsdp_header_M_findA(self, "sendrecv")) || (A = tsdp_header_M_findA(self, "sendonly")) || (A = tsdp_header_M_findA(self, "recvonly")) || (A = tsdp_header_M_findA(self, "inactive"))) {
+ tsk_strupdate(&(TSDP_HEADER_A(A)->field), hold_resume_atts[lo_held & 1][ro_held & 1]);
+ }
+ else {
+ tsdp_header_A_t* newA;
+ if((newA = tsdp_header_A_create(hold_resume_atts[lo_held & 1][ro_held & 1], tsk_null))) {
+ tsdp_header_M_add(self, TSDP_HEADER_CONST(newA));
+ TSK_OBJECT_SAFE_FREE(newA);
+ }
+ }
+
+ return 0;
}
const char* tsdp_header_M_get_holdresume_att(const tsdp_header_M_t* self)
{
- static const char* hold_resume_atts[4] = {"sendrecv"/*first because most likely to be present*/, "recvonly", "sendonly", "inactive"};
- static tsk_size_t hold_resume_atts_count = sizeof(hold_resume_atts)/sizeof(hold_resume_atts[0]);
- tsk_size_t i;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return hold_resume_atts[0];
- }
- for(i = 0; i < hold_resume_atts_count; ++i){
- if(tsdp_header_M_findA(self, hold_resume_atts[i])){
- return hold_resume_atts[i];
- }
- }
- return hold_resume_atts[0];
+ static const char* hold_resume_atts[4] = {"sendrecv"/*first because most likely to be present*/, "recvonly", "sendonly", "inactive"};
+ static tsk_size_t hold_resume_atts_count = sizeof(hold_resume_atts)/sizeof(hold_resume_atts[0]);
+ tsk_size_t i;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return hold_resume_atts[0];
+ }
+ for(i = 0; i < hold_resume_atts_count; ++i) {
+ if(tsdp_header_M_findA(self, hold_resume_atts[i])) {
+ return hold_resume_atts[i];
+ }
+ }
+ return hold_resume_atts[0];
}
tsk_bool_t tsdp_header_M_is_held(const tsdp_header_M_t* self, tsk_bool_t local)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- /* both cases */
- if(tsdp_header_M_findA(self, "inactive")){
- return tsk_true;
- }
-
- if(local){
- return tsdp_header_M_findA(self, "recvonly") ? tsk_true : tsk_false;
- }
- else{
- return tsdp_header_M_findA(self, "sendonly") ? tsk_true : tsk_false;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ /* both cases */
+ if(tsdp_header_M_findA(self, "inactive")) {
+ return tsk_true;
+ }
+
+ if(local) {
+ return tsdp_header_M_findA(self, "recvonly") ? tsk_true : tsk_false;
+ }
+ else {
+ return tsdp_header_M_findA(self, "sendonly") ? tsk_true : tsk_false;
+ }
}
/* as per 3GPP TS 34.610 */
int tsdp_header_M_resume(tsdp_header_M_t* self, tsk_bool_t local)
{
- const tsdp_header_A_t* a;
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((a = tsdp_header_M_findA(self, "inactive"))){
- // a "recvonly" SDP attribute if the stream was previously an inactive media stream
- tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "recvonly" : "sendonly");
- }
- else if((a = tsdp_header_M_findA(self, local ? "sendonly" : "recvonly"))){
- // a "sendrecv" SDP attribute if the stream was previously a sendonly media stream, or the attribute may be omitted, since sendrecv is the default
- tsk_strupdate(&(TSDP_HEADER_A(a)->field), "sendrecv");
- }
- return 0;
+ const tsdp_header_A_t* a;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((a = tsdp_header_M_findA(self, "inactive"))) {
+ // a "recvonly" SDP attribute if the stream was previously an inactive media stream
+ tsk_strupdate(&(TSDP_HEADER_A(a)->field), local ? "recvonly" : "sendonly");
+ }
+ else if((a = tsdp_header_M_findA(self, local ? "sendonly" : "recvonly"))) {
+ // a "sendrecv" SDP attribute if the stream was previously a sendonly media stream, or the attribute may be omitted, since sendrecv is the default
+ tsk_strupdate(&(TSDP_HEADER_A(a)->field), "sendrecv");
+ }
+ return 0;
}
tsk_bool_t tsdp_header_M_is_ice_enabled(const tsdp_header_M_t* self)
{
- if (self) {
- const tsdp_header_A_t *A;
- tsk_bool_t have_ufrag = tsk_false, have_pwd = tsk_false, have_candidates = tsk_false;
-
- if ((A = tsdp_header_M_findA(self, "ice-ufrag"))) {
- have_ufrag = tsk_true;
- }
- if ((A = tsdp_header_M_findA(self, "ice-pwd"))) {
- have_pwd = tsk_true;
- }
- have_candidates = (tsdp_header_M_findA_at(self, "candidate", 0) != tsk_null);
- return have_ufrag && have_pwd && have_candidates;
- }
- return tsk_false;
+ if (self) {
+ const tsdp_header_A_t *A;
+ tsk_bool_t have_ufrag = tsk_false, have_pwd = tsk_false, have_candidates = tsk_false;
+
+ if ((A = tsdp_header_M_findA(self, "ice-ufrag"))) {
+ have_ufrag = tsk_true;
+ }
+ if ((A = tsdp_header_M_findA(self, "ice-pwd"))) {
+ have_pwd = tsk_true;
+ }
+ have_candidates = (tsdp_header_M_findA_at(self, "candidate", 0) != tsk_null);
+ return have_ufrag && have_pwd && have_candidates;
+ }
+ return tsk_false;
}
tsk_bool_t tsdp_header_M_is_ice_restart(const tsdp_header_M_t* self)
{
- // https://tools.ietf.org/html/rfc5245#section-9.1.1.1
- if (self) {
- return (self->C && self->C->addr && tsk_striequals("0.0.0.0", self->C->addr));
- }
- return tsk_false;
+ // https://tools.ietf.org/html/rfc5245#section-9.1.1.1
+ if (self) {
+ return (self->C && self->C->addr && tsk_striequals("0.0.0.0", self->C->addr));
+ }
+ return tsk_false;
}
int tsdp_header_M_diff(const tsdp_header_M_t* M_old, const tsdp_header_M_t* M_new, tsdp_header_M_diff_t* _diff)
{
- tsdp_header_M_diff_t diff = tsdp_header_M_diff_none;
- const tsdp_header_A_t *A0, *A1;
- int ret = 0;
- tsk_size_t index;
- if (!M_old || !_diff) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if (!M_new || !tsk_striequals(M_new->media, M_old->media)) {
- // media lines must be at the same index
- // (M1 == null) means media lines are not at the same index or new one have been added/removed
- diff |= tsdp_header_M_diff_index;
- }
-
- // hold/resume
- if (M_new && !tsk_striequals(tsdp_header_M_get_holdresume_att(M_old), tsdp_header_M_get_holdresume_att(M_new))) {
- diff |= tsdp_header_M_diff_hold_resume;
- }
-
- // dtls fingerprint
- A0 = tsdp_header_M_findA_at(M_old, "fingerprint", 0);
- A1 = M_new ? tsdp_header_M_findA_at(M_new, "fingerprint", 0) : tsk_null;
- if (A0 && A1 && !tsk_striequals(A0->value, A1->value)) {
- diff |= tsdp_header_M_diff_dtls_fingerprint;
- }
-
- // sdes cryptos
- index = 0;
- do {
- A0 = tsdp_header_M_findA_at(M_old, "crypto", index);
- A1 = M_new ? tsdp_header_M_findA_at(M_new, "crypto", index) : tsk_null;
+ tsdp_header_M_diff_t diff = tsdp_header_M_diff_none;
+ const tsdp_header_A_t *A0, *A1;
+ int ret = 0;
+ tsk_size_t index;
+ if (!M_old || !_diff) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if (!M_new || !tsk_striequals(M_new->media, M_old->media)) {
+ // media lines must be at the same index
+ // (M1 == null) means media lines are not at the same index or new one have been added/removed
+ diff |= tsdp_header_M_diff_index;
+ }
+
+ // hold/resume
+ if (M_new && !tsk_striequals(tsdp_header_M_get_holdresume_att(M_old), tsdp_header_M_get_holdresume_att(M_new))) {
+ diff |= tsdp_header_M_diff_hold_resume;
+ }
+
+ // dtls fingerprint
+ A0 = tsdp_header_M_findA_at(M_old, "fingerprint", 0);
+ A1 = M_new ? tsdp_header_M_findA_at(M_new, "fingerprint", 0) : tsk_null;
+ if (A0 && A1 && !tsk_striequals(A0->value, A1->value)) {
+ diff |= tsdp_header_M_diff_dtls_fingerprint;
+ }
+
+ // sdes cryptos
+ index = 0;
+ do {
+ A0 = tsdp_header_M_findA_at(M_old, "crypto", index);
+ A1 = M_new ? tsdp_header_M_findA_at(M_new, "crypto", index) : tsk_null;
if (A0 && A1) {
if (!tsk_striequals(A0->value, A1->value)) {
diff |= tsdp_header_M_diff_sdes_crypto;
@@ -881,99 +881,99 @@ int tsdp_header_M_diff(const tsdp_header_M_t* M_old, const tsdp_header_M_t* M_ne
else if (index == 0 && (A0 || A1)) { // (A1 && !AO) means "more" crypto lines, otherwise "less". In all cases if the first matched we're ok
diff |= tsdp_header_M_diff_sdes_crypto;
}
- ++index;
- } while ((A0 && A1) && ((diff & tsdp_header_M_diff_sdes_crypto) != tsdp_header_M_diff_sdes_crypto));
-
- // media lines
- if ((diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) {
- char* M0ProtoF = tsk_null; // old proto with "F" at the end, do nothing if we transit from AVP to AVPF because it means nego. succeeded
- tsk_strcat_2(&M0ProtoF, "%sF", M_old->proto);
- if (
- // (M1 == null) means media lines are not at the same index or new one have been added/removed
- (!M_new)
- // same media (e.g. audio)
- || !tsk_striequals(M_new->media, M_old->media)
- // same protos (e.g. SRTP)
- || !(tsk_striequals(M_new->proto, M_old->proto) || tsk_striequals(M_new->proto, M0ProtoF)))
- {
- diff |= tsdp_header_M_diff_index;
- }
- TSK_FREE(M0ProtoF);
- }
-
- // codecs
- if (M_new && (diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) { // make sure it's same media at same index
- if (tsk_list_count_all(M_old->FMTs) == tsk_list_count_all(M_new->FMTs)) {
- if ((diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) { // make sure it's same media at same index
- const tsk_list_item_t* codec_item0;
- const tsdp_fmt_t* codec_fmt1;
- tsk_size_t codec_index0 = 0;
- tsk_list_foreach(codec_item0, M_old->FMTs) {
- codec_fmt1 = (const tsdp_fmt_t*)tsk_list_find_object_by_pred_at_index(M_new->FMTs, tsk_null, tsk_null, codec_index0++);
- if (!codec_fmt1 || !tsk_striequals(codec_fmt1->value, ((const tsdp_fmt_t*)codec_item0->data)->value)) {
- diff |= tsdp_header_M_diff_codecs;
- break;
- }
- }
- }
- }
- else {
- diff |= tsdp_header_M_diff_codecs;
- }
- }
-
- // network ports
- if ((M_new ? M_new->port : 0) != (M_old->port)) {
- diff |= tsdp_header_M_diff_network_info;
- }
-
- if (M_new) {
- if ((diff & tsdp_header_M_diff_network_info) != tsdp_header_M_diff_network_info) {
- // Connection informations must be both "null" or "not-null"
- if (!((M_old->C && M_new->C) || (!M_old->C && !M_new->C))) {
- diff |= tsdp_header_M_diff_network_info;
- }
- else if (M_old->C) {
- if (!tsk_strequals(M_new->C->addr, M_old->C->addr) || !tsk_strequals(M_new->C->nettype, M_old->C->nettype) || !tsk_strequals(M_new->C->addrtype, M_old->C->addrtype)) {
- diff |= tsdp_header_M_diff_network_info;
- }
- }
- }
- }
-
- // media type
- if (M_new) {
- if (!tsk_striequals(M_new->media, M_old->media)) {
- diff |= tsdp_header_M_diff_media_type;
- }
- else {
- if (tsk_striequals(M_new->media, "audio") || tsk_striequals(M_new->media, "video")) {
- const char *content0, *content1;
- // check if it's BFCP audio/video session
- // content attribute described in http://tools.ietf.org/html/rfc4796
- A0 = tsdp_header_M_findA(M_old, "content");
- A1 = tsdp_header_M_findA(M_new, "content");
- content0 = A0 ? A0->value : "main";
- content1 = A1 ? A1->value : "main";
- if (!tsk_striequals(content0, content1)) {
- diff |= tsdp_header_M_diff_media_type;
- }
- }
- }
- }
-
- // ice
- if (M_new) {
- if (tsdp_header_M_is_ice_enabled(M_new)) {
- diff |= tsdp_header_M_diff_ice_enabled;
- }
- if (tsdp_header_M_is_ice_restart(M_new)) {
- diff |= tsdp_header_M_diff_ice_restart;
- }
- }
-
- *_diff = diff;
- return ret;
+ ++index;
+ }
+ while ((A0 && A1) && ((diff & tsdp_header_M_diff_sdes_crypto) != tsdp_header_M_diff_sdes_crypto));
+
+ // media lines
+ if ((diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) {
+ char* M0ProtoF = tsk_null; // old proto with "F" at the end, do nothing if we transit from AVP to AVPF because it means nego. succeeded
+ tsk_strcat_2(&M0ProtoF, "%sF", M_old->proto);
+ if (
+ // (M1 == null) means media lines are not at the same index or new one have been added/removed
+ (!M_new)
+ // same media (e.g. audio)
+ || !tsk_striequals(M_new->media, M_old->media)
+ // same protos (e.g. SRTP)
+ || !(tsk_striequals(M_new->proto, M_old->proto) || tsk_striequals(M_new->proto, M0ProtoF))) {
+ diff |= tsdp_header_M_diff_index;
+ }
+ TSK_FREE(M0ProtoF);
+ }
+
+ // codecs
+ if (M_new && (diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) { // make sure it's same media at same index
+ if (tsk_list_count_all(M_old->FMTs) == tsk_list_count_all(M_new->FMTs)) {
+ if ((diff & tsdp_header_M_diff_index) != tsdp_header_M_diff_index) { // make sure it's same media at same index
+ const tsk_list_item_t* codec_item0;
+ const tsdp_fmt_t* codec_fmt1;
+ tsk_size_t codec_index0 = 0;
+ tsk_list_foreach(codec_item0, M_old->FMTs) {
+ codec_fmt1 = (const tsdp_fmt_t*)tsk_list_find_object_by_pred_at_index(M_new->FMTs, tsk_null, tsk_null, codec_index0++);
+ if (!codec_fmt1 || !tsk_striequals(codec_fmt1->value, ((const tsdp_fmt_t*)codec_item0->data)->value)) {
+ diff |= tsdp_header_M_diff_codecs;
+ break;
+ }
+ }
+ }
+ }
+ else {
+ diff |= tsdp_header_M_diff_codecs;
+ }
+ }
+
+ // network ports
+ if ((M_new ? M_new->port : 0) != (M_old->port)) {
+ diff |= tsdp_header_M_diff_network_info;
+ }
+
+ if (M_new) {
+ if ((diff & tsdp_header_M_diff_network_info) != tsdp_header_M_diff_network_info) {
+ // Connection informations must be both "null" or "not-null"
+ if (!((M_old->C && M_new->C) || (!M_old->C && !M_new->C))) {
+ diff |= tsdp_header_M_diff_network_info;
+ }
+ else if (M_old->C) {
+ if (!tsk_strequals(M_new->C->addr, M_old->C->addr) || !tsk_strequals(M_new->C->nettype, M_old->C->nettype) || !tsk_strequals(M_new->C->addrtype, M_old->C->addrtype)) {
+ diff |= tsdp_header_M_diff_network_info;
+ }
+ }
+ }
+ }
+
+ // media type
+ if (M_new) {
+ if (!tsk_striequals(M_new->media, M_old->media)) {
+ diff |= tsdp_header_M_diff_media_type;
+ }
+ else {
+ if (tsk_striequals(M_new->media, "audio") || tsk_striequals(M_new->media, "video")) {
+ const char *content0, *content1;
+ // check if it's BFCP audio/video session
+ // content attribute described in http://tools.ietf.org/html/rfc4796
+ A0 = tsdp_header_M_findA(M_old, "content");
+ A1 = tsdp_header_M_findA(M_new, "content");
+ content0 = A0 ? A0->value : "main";
+ content1 = A1 ? A1->value : "main";
+ if (!tsk_striequals(content0, content1)) {
+ diff |= tsdp_header_M_diff_media_type;
+ }
+ }
+ }
+ }
+
+ // ice
+ if (M_new) {
+ if (tsdp_header_M_is_ice_enabled(M_new)) {
+ diff |= tsdp_header_M_diff_ice_enabled;
+ }
+ if (tsdp_header_M_is_ice_restart(M_new)) {
+ diff |= tsdp_header_M_diff_ice_restart;
+ }
+ }
+
+ *_diff = diff;
+ return ret;
}
//
@@ -1026,61 +1026,60 @@ int tsdp_header_M_diff(const tsdp_header_M_t* M_old, const tsdp_header_M_t* M_ne
static tsk_object_t* tsdp_header_M_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_M_t *M = self;
- if(M){
- TSDP_HEADER(M)->type = tsdp_htype_M;
- TSDP_HEADER(M)->tostring = tsdp_header_M_tostring;
- TSDP_HEADER(M)->clone = tsdp_header_M_clone;
- TSDP_HEADER(M)->rank = TSDP_HTYPE_M_RANK;
-
- M->FMTs = tsk_list_create(); // Because there is at least one fmt.
-
- M->media = tsk_strdup(va_arg(*app, const char*));
- M->port = va_arg(*app, uint32_t);
- M->proto = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new M header.");
- }
- return self;
+ tsdp_header_M_t *M = self;
+ if(M) {
+ TSDP_HEADER(M)->type = tsdp_htype_M;
+ TSDP_HEADER(M)->tostring = tsdp_header_M_tostring;
+ TSDP_HEADER(M)->clone = tsdp_header_M_clone;
+ TSDP_HEADER(M)->rank = TSDP_HTYPE_M_RANK;
+
+ M->FMTs = tsk_list_create(); // Because there is at least one fmt.
+
+ M->media = tsk_strdup(va_arg(*app, const char*));
+ M->port = va_arg(*app, uint32_t);
+ M->proto = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new M header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_M_dtor(tsk_object_t *self)
{
- tsdp_header_M_t *M = self;
- if(M){
- TSK_FREE(M->media);
- TSK_FREE(M->proto);
- TSK_OBJECT_SAFE_FREE(M->FMTs);
-
- TSK_OBJECT_SAFE_FREE(M->I);
- TSK_OBJECT_SAFE_FREE(M->C);
- TSK_OBJECT_SAFE_FREE(M->Bandwidths);
- TSK_OBJECT_SAFE_FREE(M->K);
- TSK_OBJECT_SAFE_FREE(M->Attributes);
- }
- else{
- TSK_DEBUG_ERROR("Null M header.");
- }
-
- return self;
+ tsdp_header_M_t *M = self;
+ if(M) {
+ TSK_FREE(M->media);
+ TSK_FREE(M->proto);
+ TSK_OBJECT_SAFE_FREE(M->FMTs);
+
+ TSK_OBJECT_SAFE_FREE(M->I);
+ TSK_OBJECT_SAFE_FREE(M->C);
+ TSK_OBJECT_SAFE_FREE(M->Bandwidths);
+ TSK_OBJECT_SAFE_FREE(M->K);
+ TSK_OBJECT_SAFE_FREE(M->Attributes);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null M header.");
+ }
+
+ return self;
}
static int tsdp_header_M_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_M_def_s =
-{
- sizeof(tsdp_header_M_t),
- tsdp_header_M_ctor,
- tsdp_header_M_dtor,
- tsdp_header_M_cmp
+static const tsk_object_def_t tsdp_header_M_def_s = {
+ sizeof(tsdp_header_M_t),
+ tsdp_header_M_ctor,
+ tsdp_header_M_dtor,
+ tsdp_header_M_cmp
};
const tsk_object_def_t *tsdp_header_M_def_t = &tsdp_header_M_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_O.c b/tinySDP/src/headers/tsdp_header_O.c
index b9c4fcc..ab085bc 100755
--- a/tinySDP/src/headers/tsdp_header_O.c
+++ b/tinySDP/src/headers/tsdp_header_O.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_O.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,305 +43,315 @@
tsdp_header_O_t* tsdp_header_O_create(const char* username, uint32_t sess_id, uint32_t sess_version, const char* nettype, const char* addrtype, const char* addr)
{
- return tsk_object_new(TSDP_HEADER_O_VA_ARGS(username, sess_id, sess_version, nettype, addrtype, addr));
+ return tsk_object_new(TSDP_HEADER_O_VA_ARGS(username, sess_id, sess_version, nettype, addrtype, addr));
}
tsdp_header_O_t* tsdp_header_O_create_null()
{
- return tsdp_header_O_create(tsk_null, 0, 0, tsk_null, tsk_null, tsk_null);
+ return tsdp_header_O_create(tsk_null, 0, 0, tsk_null, tsk_null, tsk_null);
}
tsdp_header_O_t* tsdp_header_O_create_default(const char* username, const char* nettype, const char* addrtype, const char* addr)
{
- return tsdp_header_O_create(username, TSDP_HEADER_O_SESS_ID_DEFAULT, TSDP_HEADER_O_SESS_VERSION_DEFAULT, nettype, addrtype, addr);
+ return tsdp_header_O_create(username, TSDP_HEADER_O_SESS_ID_DEFAULT, TSDP_HEADER_O_SESS_VERSION_DEFAULT, nettype, addrtype, addr);
}
int tsdp_header_O_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_O_t *O = (const tsdp_header_O_t *)header;
-
- // o=alice 2890844526 2890844526 IN IP4 host.atlanta.example.com
- return tsk_buffer_append_2(output, "%s %u %u %s %s %s",
- O->username,
- O->sess_id,
- O->sess_version,
- O->nettype,
- O->addrtype,
- O->addr
- );
-
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_O_t *O = (const tsdp_header_O_t *)header;
+
+ // o=alice 2890844526 2890844526 IN IP4 host.atlanta.example.com
+ return tsk_buffer_append_2(output, "%s %u %u %s %s %s",
+ O->username,
+ O->sess_id,
+ O->sess_version,
+ O->nettype,
+ O->addrtype,
+ O->addr
+ );
+
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_O_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_O_t *O = (const tsdp_header_O_t *)header;
- return (tsdp_header_t*)tsdp_header_O_create(O->username, O->sess_id, O->sess_version, O->nettype, O->addrtype, O->addr);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_O_t *O = (const tsdp_header_O_t *)header;
+ return (tsdp_header_t*)tsdp_header_O_create(O->username, O->sess_id, O->sess_version, O->nettype, O->addrtype, O->addr);
+ }
+ return tsk_null;
}
tsdp_header_O_t *tsdp_header_O_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_O_t *hdr_O = tsdp_header_O_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 103 "./src/headers/tsdp_header_O.c" */
-static const char _tsdp_machine_parser_header_O_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 0, 4, 2, 0, 5, 2, 0, 6
-
-};
-
-static const char _tsdp_machine_parser_header_O_key_offsets[] = {
- 0, 0, 1, 3, 4, 5, 7, 10,
- 12, 15, 16, 17, 18, 19, 20, 21,
- 22
-};
-
-static const char _tsdp_machine_parser_header_O_trans_keys[] = {
- 111, 32, 61, 32, 32, 48, 57, 32,
- 48, 57, 48, 57, 32, 48, 57, 32,
- 32, 32, 32, 10, 13, 13, 0
-};
-
-static const char _tsdp_machine_parser_header_O_single_lengths[] = {
- 0, 1, 2, 1, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 0
-};
-
-static const char _tsdp_machine_parser_header_O_range_lengths[] = {
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
-
-static const char _tsdp_machine_parser_header_O_index_offsets[] = {
- 0, 0, 2, 5, 7, 9, 11, 14,
- 16, 19, 21, 23, 25, 27, 29, 31,
- 33
-};
-
-static const char _tsdp_machine_parser_header_O_trans_targs[] = {
- 2, 0, 2, 3, 0, 3, 4, 5,
- 4, 6, 0, 7, 6, 0, 8, 0,
- 9, 8, 0, 11, 10, 11, 10, 14,
- 12, 14, 12, 16, 0, 13, 15, 13,
- 15, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_O_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 3,
- 0, 1, 0, 5, 0, 0, 1, 0,
- 7, 0, 0, 15, 1, 9, 0, 18,
- 1, 11, 0, 0, 0, 21, 1, 13,
- 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_O_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 21, 13,
- 0
-};
-
-static const int tsdp_machine_parser_header_O_start = 1;
-static const int tsdp_machine_parser_header_O_first_final = 14;
-static const int tsdp_machine_parser_header_O_error = 0;
-
-static const int tsdp_machine_parser_header_O_en_main = 1;
-
-
-/* #line 143 "./ragel/tsdp_parser_header_O.rl" */
- (void)(tsdp_machine_parser_header_O_first_final);
- (void)(tsdp_machine_parser_header_O_error);
- (void)(tsdp_machine_parser_header_O_en_main);
-
-/* #line 175 "./src/headers/tsdp_header_O.c" */
- {
- cs = tsdp_machine_parser_header_O_start;
- }
-
-/* #line 147 "./ragel/tsdp_parser_header_O.rl" */
-
-/* #line 182 "./src/headers/tsdp_header_O.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_O_t *hdr_O = tsdp_header_O_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 103 "./src/headers/tsdp_header_O.c" */
+ static const char _tsdp_machine_parser_header_O_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 0, 4, 2, 0, 5, 2, 0, 6
+
+ };
+
+ static const char _tsdp_machine_parser_header_O_key_offsets[] = {
+ 0, 0, 1, 3, 4, 5, 7, 10,
+ 12, 15, 16, 17, 18, 19, 20, 21,
+ 22
+ };
+
+ static const char _tsdp_machine_parser_header_O_trans_keys[] = {
+ 111, 32, 61, 32, 32, 48, 57, 32,
+ 48, 57, 48, 57, 32, 48, 57, 32,
+ 32, 32, 32, 10, 13, 13, 0
+ };
+
+ static const char _tsdp_machine_parser_header_O_single_lengths[] = {
+ 0, 1, 2, 1, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_O_range_lengths[] = {
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_O_index_offsets[] = {
+ 0, 0, 2, 5, 7, 9, 11, 14,
+ 16, 19, 21, 23, 25, 27, 29, 31,
+ 33
+ };
+
+ static const char _tsdp_machine_parser_header_O_trans_targs[] = {
+ 2, 0, 2, 3, 0, 3, 4, 5,
+ 4, 6, 0, 7, 6, 0, 8, 0,
+ 9, 8, 0, 11, 10, 11, 10, 14,
+ 12, 14, 12, 16, 0, 13, 15, 13,
+ 15, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_O_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 3,
+ 0, 1, 0, 5, 0, 0, 1, 0,
+ 7, 0, 0, 15, 1, 9, 0, 18,
+ 1, 11, 0, 0, 0, 21, 1, 13,
+ 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_O_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 21, 13,
+ 0
+ };
+
+ static const int tsdp_machine_parser_header_O_start = 1;
+ static const int tsdp_machine_parser_header_O_first_final = 14;
+ static const int tsdp_machine_parser_header_O_error = 0;
+
+ static const int tsdp_machine_parser_header_O_en_main = 1;
+
+
+ /* #line 143 "./ragel/tsdp_parser_header_O.rl" */
+ (void)(tsdp_machine_parser_header_O_first_final);
+ (void)(tsdp_machine_parser_header_O_error);
+ (void)(tsdp_machine_parser_header_O_en_main);
+
+ /* #line 175 "./src/headers/tsdp_header_O.c" */
+ {
+ cs = tsdp_machine_parser_header_O_start;
+ }
+
+ /* #line 147 "./ragel/tsdp_parser_header_O.rl" */
+
+ /* #line 182 "./src/headers/tsdp_header_O.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_O_trans_keys + _tsdp_machine_parser_header_O_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_O_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_O_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_O_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_O_trans_keys + _tsdp_machine_parser_header_O_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_O_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_O_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_O_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_O_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_O_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_O_actions + _tsdp_machine_parser_header_O_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_O.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_O->username);
- }
- break;
- case 2:
-/* #line 49 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_O->sess_id);
- }
- break;
- case 3:
-/* #line 53 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_O->sess_version);
- }
- break;
- case 4:
-/* #line 57 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_O->nettype);
- }
- break;
- case 5:
-/* #line 61 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_O->addrtype);
- }
- break;
- case 6:
-/* #line 65 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_O->addr);
- }
- break;
-/* #line 297 "./src/headers/tsdp_header_O.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_O_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_O_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_O_actions + _tsdp_machine_parser_header_O_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_O->username);
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_O->sess_id);
+ }
+ break;
+ case 3:
+ /* #line 53 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_O->sess_version);
+ }
+ break;
+ case 4:
+ /* #line 57 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_O->nettype);
+ }
+ break;
+ case 5:
+ /* #line 61 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_O->addrtype);
+ }
+ break;
+ case 6:
+ /* #line 65 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_O->addr);
+ }
+ break;
+ /* #line 297 "./src/headers/tsdp_header_O.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_O_actions + _tsdp_machine_parser_header_O_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_O.rl" */
- {
- tag_start = p;
- }
- break;
- case 6:
-/* #line 65 "./ragel/tsdp_parser_header_O.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_O->addr);
- }
- break;
-/* #line 325 "./src/headers/tsdp_header_O.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 148 "./ragel/tsdp_parser_header_O.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 337 "./src/headers/tsdp_header_O.c" */
-14
-/* #line 150 "./ragel/tsdp_parser_header_O.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"o=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_O);
- }
-
- return hdr_O;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_O_actions + _tsdp_machine_parser_header_O_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 6:
+ /* #line 65 "./ragel/tsdp_parser_header_O.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_O->addr);
+ }
+ break;
+ /* #line 325 "./src/headers/tsdp_header_O.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 148 "./ragel/tsdp_parser_header_O.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 337 "./src/headers/tsdp_header_O.c" */
+ 14
+ /* #line 150 "./ragel/tsdp_parser_header_O.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"o=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_O);
+ }
+
+ return hdr_O;
}
@@ -356,57 +366,56 @@ _again:
static tsk_object_t* tsdp_header_O_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_O_t *O = self;
- if(O){
- TSDP_HEADER(O)->type = tsdp_htype_O;
- TSDP_HEADER(O)->tostring = tsdp_header_O_tostring;
- TSDP_HEADER(O)->clone = tsdp_header_O_clone;
- TSDP_HEADER(O)->rank = TSDP_HTYPE_O_RANK;
-
- O->username = tsk_strdup(va_arg(*app, const char*));
- O->sess_id = va_arg(*app, uint32_t);
- O->sess_version = va_arg(*app, uint32_t);
- O->nettype = tsk_strdup(va_arg(*app, const char*));
- O->addrtype = tsk_strdup(va_arg(*app, const char*));
- O->addr = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new O header.");
- }
- return self;
+ tsdp_header_O_t *O = self;
+ if(O) {
+ TSDP_HEADER(O)->type = tsdp_htype_O;
+ TSDP_HEADER(O)->tostring = tsdp_header_O_tostring;
+ TSDP_HEADER(O)->clone = tsdp_header_O_clone;
+ TSDP_HEADER(O)->rank = TSDP_HTYPE_O_RANK;
+
+ O->username = tsk_strdup(va_arg(*app, const char*));
+ O->sess_id = va_arg(*app, uint32_t);
+ O->sess_version = va_arg(*app, uint32_t);
+ O->nettype = tsk_strdup(va_arg(*app, const char*));
+ O->addrtype = tsk_strdup(va_arg(*app, const char*));
+ O->addr = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new O header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_O_dtor(tsk_object_t *self)
{
- tsdp_header_O_t *O = self;
- if(O){
- TSK_FREE(O->username);
- TSK_FREE(O->nettype);
- TSK_FREE(O->addrtype);
- TSK_FREE(O->addr);
- }
- else{
- TSK_DEBUG_ERROR("Null O header.");
- }
-
- return self;
+ tsdp_header_O_t *O = self;
+ if(O) {
+ TSK_FREE(O->username);
+ TSK_FREE(O->nettype);
+ TSK_FREE(O->addrtype);
+ TSK_FREE(O->addr);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null O header.");
+ }
+
+ return self;
}
static int tsdp_header_O_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_O_def_s =
-{
- sizeof(tsdp_header_O_t),
- tsdp_header_O_ctor,
- tsdp_header_O_dtor,
- tsdp_header_O_cmp
+static const tsk_object_def_t tsdp_header_O_def_s = {
+ sizeof(tsdp_header_O_t),
+ tsdp_header_O_ctor,
+ tsdp_header_O_dtor,
+ tsdp_header_O_cmp
};
const tsk_object_def_t *tsdp_header_O_def_t = &tsdp_header_O_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_P.c b/tinySDP/src/headers/tsdp_header_P.c
index aa3f6ba..d250e8c 100755
--- a/tinySDP/src/headers/tsdp_header_P.c
+++ b/tinySDP/src/headers/tsdp_header_P.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_P.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,241 +42,251 @@
tsdp_header_P_t* tsdp_header_P_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_P_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_P_VA_ARGS(value));
}
tsdp_header_P_t* tsdp_header_P_create_null()
{
- return tsdp_header_P_create(tsk_null);
+ return tsdp_header_P_create(tsk_null);
}
int tsdp_header_P_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_P_t *P = (const tsdp_header_P_t *)header;
- if(P->value){
- tsk_buffer_append(output, P->value, tsk_strlen(P->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_P_t *P = (const tsdp_header_P_t *)header;
+ if(P->value) {
+ tsk_buffer_append(output, P->value, tsk_strlen(P->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_P_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_P_t *P = (const tsdp_header_P_t *)header;
- return (tsdp_header_t*)tsdp_header_P_create(P->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_P_t *P = (const tsdp_header_P_t *)header;
+ return (tsdp_header_t*)tsdp_header_P_create(P->value);
+ }
+ return tsk_null;
}
tsdp_header_P_t *tsdp_header_P_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_P_t *hdr_P = tsdp_header_P_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 88 "./src/headers/tsdp_header_P.c" */
-static const char _tsdp_machine_parser_header_P_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_P_t *hdr_P = tsdp_header_P_create_null();
-static const char _tsdp_machine_parser_header_P_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_P_trans_keys[] = {
- 112, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_P_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 88 "./src/headers/tsdp_header_P.c" */
+ static const char _tsdp_machine_parser_header_P_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_P_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_P_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_P_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_P_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_P_trans_keys[] = {
+ 112, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_P_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_P_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_P_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_P_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_P_start = 1;
-static const int tsdp_machine_parser_header_P_first_final = 4;
-static const int tsdp_machine_parser_header_P_error = 0;
-
-static const int tsdp_machine_parser_header_P_en_main = 1;
-
-
-/* #line 102 "./ragel/tsdp_parser_header_P.rl" */
- (void)(tsdp_machine_parser_header_P_first_final);
- (void)(tsdp_machine_parser_header_P_error);
- (void)(tsdp_machine_parser_header_P_en_main);
-
-/* #line 140 "./src/headers/tsdp_header_P.c" */
- {
- cs = tsdp_machine_parser_header_P_start;
- }
-
-/* #line 106 "./ragel/tsdp_parser_header_P.rl" */
-
-/* #line 147 "./src/headers/tsdp_header_P.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_P_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_P_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_P_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_P_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_P_start = 1;
+ static const int tsdp_machine_parser_header_P_first_final = 4;
+ static const int tsdp_machine_parser_header_P_error = 0;
+
+ static const int tsdp_machine_parser_header_P_en_main = 1;
+
+
+ /* #line 102 "./ragel/tsdp_parser_header_P.rl" */
+ (void)(tsdp_machine_parser_header_P_first_final);
+ (void)(tsdp_machine_parser_header_P_error);
+ (void)(tsdp_machine_parser_header_P_en_main);
+
+ /* #line 140 "./src/headers/tsdp_header_P.c" */
+ {
+ cs = tsdp_machine_parser_header_P_start;
+ }
+
+ /* #line 106 "./ragel/tsdp_parser_header_P.rl" */
+
+ /* #line 147 "./src/headers/tsdp_header_P.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_P_trans_keys + _tsdp_machine_parser_header_P_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_P_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_P_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_P_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_P_trans_keys + _tsdp_machine_parser_header_P_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_P_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_P_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_P_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_P_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_P_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_P_actions + _tsdp_machine_parser_header_P_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_P.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_P.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_P->value);
- }
- break;
-/* #line 232 "./src/headers/tsdp_header_P.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_P_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_P_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_P_actions + _tsdp_machine_parser_header_P_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_P.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_P.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_P->value);
+ }
+ break;
+ /* #line 232 "./src/headers/tsdp_header_P.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_P_actions + _tsdp_machine_parser_header_P_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 42 "./ragel/tsdp_parser_header_P.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 46 "./ragel/tsdp_parser_header_P.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_P->value);
- }
- break;
-/* #line 260 "./src/headers/tsdp_header_P.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_P.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 272 "./src/headers/tsdp_header_P.c" */
-4
-/* #line 109 "./ragel/tsdp_parser_header_P.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"p=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_P);
- }
-
- return hdr_P;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_P_actions + _tsdp_machine_parser_header_P_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 42 "./ragel/tsdp_parser_header_P.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 46 "./ragel/tsdp_parser_header_P.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_P->value);
+ }
+ break;
+ /* #line 260 "./src/headers/tsdp_header_P.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_P.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 272 "./src/headers/tsdp_header_P.c" */
+ 4
+ /* #line 109 "./ragel/tsdp_parser_header_P.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"p=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_P);
+ }
+
+ return hdr_P;
}
@@ -291,49 +301,48 @@ _again:
static tsk_object_t* tsdp_header_P_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_P_t *P = self;
- if(P){
- TSDP_HEADER(P)->type = tsdp_htype_P;
- TSDP_HEADER(P)->tostring = tsdp_header_P_tostring;
- TSDP_HEADER(P)->clone = tsdp_header_P_clone;
- TSDP_HEADER(P)->rank = TSDP_HTYPE_P_RANK;
-
- P->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P header.");
- }
- return self;
+ tsdp_header_P_t *P = self;
+ if(P) {
+ TSDP_HEADER(P)->type = tsdp_htype_P;
+ TSDP_HEADER(P)->tostring = tsdp_header_P_tostring;
+ TSDP_HEADER(P)->clone = tsdp_header_P_clone;
+ TSDP_HEADER(P)->rank = TSDP_HTYPE_P_RANK;
+
+ P->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_P_dtor(tsk_object_t *self)
{
- tsdp_header_P_t *P = self;
- if(P){
- TSK_FREE(P->value);
- }
- else{
- TSK_DEBUG_ERROR("Null P header.");
- }
-
- return self;
+ tsdp_header_P_t *P = self;
+ if(P) {
+ TSK_FREE(P->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P header.");
+ }
+
+ return self;
}
static int tsdp_header_P_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_P_def_s =
-{
- sizeof(tsdp_header_P_t),
- tsdp_header_P_ctor,
- tsdp_header_P_dtor,
- tsdp_header_P_cmp
+static const tsk_object_def_t tsdp_header_P_def_s = {
+ sizeof(tsdp_header_P_t),
+ tsdp_header_P_ctor,
+ tsdp_header_P_dtor,
+ tsdp_header_P_cmp
};
const tsk_object_def_t *tsdp_header_P_def_t = &tsdp_header_P_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_R.c b/tinySDP/src/headers/tsdp_header_R.c
index 848a35a..244b4ba 100755
--- a/tinySDP/src/headers/tsdp_header_R.c
+++ b/tinySDP/src/headers/tsdp_header_R.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_R.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tsdp_header_R.c
* @brief SDP "r=" header (Repeat Times).
- *
+ *
*/
#include "tinysdp/headers/tsdp_header_R.h"
@@ -44,294 +44,304 @@
tsdp_header_R_t* tsdp_header_R_create()
{
- return tsk_object_new(TSDP_HEADER_R_VA_ARGS());
+ return tsk_object_new(TSDP_HEADER_R_VA_ARGS());
}
tsdp_header_R_t* tsdp_header_R_create_null()
{
- return tsdp_header_R_create();
+ return tsdp_header_R_create();
}
int tsdp_header_R_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_R_t *R = (const tsdp_header_R_t *)header;
- const tsk_list_item_t* item;
-
- // r=7d 1h 0 25h
- tsk_buffer_append_2(output, "%s %s",
- R->repeat_interval,
- R->typed_time
- );
- tsk_list_foreach(item, R->typed_times){
- tsk_string_t* string = item->data;
- tsk_buffer_append_2(output, " %s", TSK_STRING_STR(string));
- }
-
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_R_t *R = (const tsdp_header_R_t *)header;
+ const tsk_list_item_t* item;
+
+ // r=7d 1h 0 25h
+ tsk_buffer_append_2(output, "%s %s",
+ R->repeat_interval,
+ R->typed_time
+ );
+ tsk_list_foreach(item, R->typed_times) {
+ tsk_string_t* string = item->data;
+ tsk_buffer_append_2(output, " %s", TSK_STRING_STR(string));
+ }
+
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_R_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_R_t *R = (const tsdp_header_R_t *)header;
- tsdp_header_R_t* clone;
- const tsk_list_item_t* item;
-
- if((clone = tsdp_header_R_create_null())){
- clone->repeat_interval = tsk_strdup(R->repeat_interval);
- clone->typed_time = tsk_strdup(R->typed_time);
-
- if(R->typed_times){
- clone->typed_times = tsk_list_create();
- }
-
- tsk_list_foreach(item, R->typed_times){
- tsk_string_t* string = tsk_string_create(TSK_STRING_STR(item->data));
- tsk_list_push_back_data(clone->typed_times, (void**)&string);
- }
- }
- return TSDP_HEADER(clone);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_R_t *R = (const tsdp_header_R_t *)header;
+ tsdp_header_R_t* clone;
+ const tsk_list_item_t* item;
+
+ if((clone = tsdp_header_R_create_null())) {
+ clone->repeat_interval = tsk_strdup(R->repeat_interval);
+ clone->typed_time = tsk_strdup(R->typed_time);
+
+ if(R->typed_times) {
+ clone->typed_times = tsk_list_create();
+ }
+
+ tsk_list_foreach(item, R->typed_times) {
+ tsk_string_t* string = tsk_string_create(TSK_STRING_STR(item->data));
+ tsk_list_push_back_data(clone->typed_times, (void**)&string);
+ }
+ }
+ return TSDP_HEADER(clone);
+ }
+ return tsk_null;
}
tsdp_header_R_t *tsdp_header_R_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_R_t *hdr_R = tsdp_header_R_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 115 "./src/headers/tsdp_header_R.c" */
-static const char _tsdp_machine_parser_header_R_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsdp_machine_parser_header_R_key_offsets[] = {
- 0, 0, 1, 3, 6, 13, 15, 22,
- 24, 25, 26, 27, 35, 35
-};
-
-static const char _tsdp_machine_parser_header_R_trans_keys[] = {
- 114, 32, 61, 32, 48, 57, 32, 100,
- 104, 109, 115, 48, 57, 48, 57, 32,
- 100, 104, 109, 115, 48, 57, 48, 57,
- 10, 32, 32, 13, 32, 100, 104, 109,
- 115, 48, 57, 13, 32, 0
-};
-
-static const char _tsdp_machine_parser_header_R_single_lengths[] = {
- 0, 1, 2, 1, 5, 0, 5, 0,
- 1, 1, 1, 6, 0, 2
-};
-
-static const char _tsdp_machine_parser_header_R_range_lengths[] = {
- 0, 0, 0, 1, 1, 1, 1, 1,
- 0, 0, 0, 1, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_R_index_offsets[] = {
- 0, 0, 2, 5, 8, 15, 17, 24,
- 26, 28, 30, 32, 40, 41
-};
-
-static const char _tsdp_machine_parser_header_R_indicies[] = {
- 0, 1, 0, 2, 1, 2, 3, 1,
- 4, 6, 6, 6, 6, 5, 1, 7,
- 1, 8, 10, 10, 10, 10, 9, 1,
- 11, 1, 12, 1, 8, 1, 4, 1,
- 13, 8, 15, 15, 15, 15, 14, 1,
- 1, 13, 8, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_R_trans_targs[] = {
- 2, 0, 3, 4, 5, 4, 10, 6,
- 7, 6, 9, 11, 12, 8, 11, 13
-};
-
-static const char _tsdp_machine_parser_header_R_trans_actions[] = {
- 0, 0, 0, 1, 3, 0, 0, 1,
- 5, 0, 0, 1, 0, 5, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_R_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 0, 5
-};
-
-static const int tsdp_machine_parser_header_R_start = 1;
-static const int tsdp_machine_parser_header_R_first_final = 11;
-static const int tsdp_machine_parser_header_R_error = 0;
-
-static const int tsdp_machine_parser_header_R_en_main = 1;
-
-
-/* #line 143 "./ragel/tsdp_parser_header_R.rl" */
- (void)(tsdp_machine_parser_header_R_first_final);
- (void)(tsdp_machine_parser_header_R_error);
- (void)(tsdp_machine_parser_header_R_en_main);
-
-/* #line 184 "./src/headers/tsdp_header_R.c" */
- {
- cs = tsdp_machine_parser_header_R_start;
- }
-
-/* #line 147 "./ragel/tsdp_parser_header_R.rl" */
-
-/* #line 191 "./src/headers/tsdp_header_R.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_R_t *hdr_R = tsdp_header_R_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 115 "./src/headers/tsdp_header_R.c" */
+ static const char _tsdp_machine_parser_header_R_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsdp_machine_parser_header_R_key_offsets[] = {
+ 0, 0, 1, 3, 6, 13, 15, 22,
+ 24, 25, 26, 27, 35, 35
+ };
+
+ static const char _tsdp_machine_parser_header_R_trans_keys[] = {
+ 114, 32, 61, 32, 48, 57, 32, 100,
+ 104, 109, 115, 48, 57, 48, 57, 32,
+ 100, 104, 109, 115, 48, 57, 48, 57,
+ 10, 32, 32, 13, 32, 100, 104, 109,
+ 115, 48, 57, 13, 32, 0
+ };
+
+ static const char _tsdp_machine_parser_header_R_single_lengths[] = {
+ 0, 1, 2, 1, 5, 0, 5, 0,
+ 1, 1, 1, 6, 0, 2
+ };
+
+ static const char _tsdp_machine_parser_header_R_range_lengths[] = {
+ 0, 0, 0, 1, 1, 1, 1, 1,
+ 0, 0, 0, 1, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_R_index_offsets[] = {
+ 0, 0, 2, 5, 8, 15, 17, 24,
+ 26, 28, 30, 32, 40, 41
+ };
+
+ static const char _tsdp_machine_parser_header_R_indicies[] = {
+ 0, 1, 0, 2, 1, 2, 3, 1,
+ 4, 6, 6, 6, 6, 5, 1, 7,
+ 1, 8, 10, 10, 10, 10, 9, 1,
+ 11, 1, 12, 1, 8, 1, 4, 1,
+ 13, 8, 15, 15, 15, 15, 14, 1,
+ 1, 13, 8, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_R_trans_targs[] = {
+ 2, 0, 3, 4, 5, 4, 10, 6,
+ 7, 6, 9, 11, 12, 8, 11, 13
+ };
+
+ static const char _tsdp_machine_parser_header_R_trans_actions[] = {
+ 0, 0, 0, 1, 3, 0, 0, 1,
+ 5, 0, 0, 1, 0, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_R_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 0, 5
+ };
+
+ static const int tsdp_machine_parser_header_R_start = 1;
+ static const int tsdp_machine_parser_header_R_first_final = 11;
+ static const int tsdp_machine_parser_header_R_error = 0;
+
+ static const int tsdp_machine_parser_header_R_en_main = 1;
+
+
+ /* #line 143 "./ragel/tsdp_parser_header_R.rl" */
+ (void)(tsdp_machine_parser_header_R_first_final);
+ (void)(tsdp_machine_parser_header_R_error);
+ (void)(tsdp_machine_parser_header_R_en_main);
+
+ /* #line 184 "./src/headers/tsdp_header_R.c" */
+ {
+ cs = tsdp_machine_parser_header_R_start;
+ }
+
+ /* #line 147 "./ragel/tsdp_parser_header_R.rl" */
+
+ /* #line 191 "./src/headers/tsdp_header_R.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_R_trans_keys + _tsdp_machine_parser_header_R_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_R_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_R_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_R_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_R_trans_keys + _tsdp_machine_parser_header_R_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_R_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_R_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_R_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsdp_machine_parser_header_R_indicies[_trans];
- cs = _tsdp_machine_parser_header_R_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_R_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_R_actions + _tsdp_machine_parser_header_R_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/tsdp_parser_header_R.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/tsdp_parser_header_R.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_R->repeat_interval);
- }
- break;
- case 2:
-/* #line 51 "./ragel/tsdp_parser_header_R.rl" */
- {
- if(!hdr_R->typed_time){
- TSK_PARSER_SET_STRING(hdr_R->typed_time);
- }
- else{
- TSK_PARSER_ADD_STRING(hdr_R->typed_times);
- }
- }
- break;
-/* #line 288 "./src/headers/tsdp_header_R.c" */
- }
- }
+ _trans = _tsdp_machine_parser_header_R_indicies[_trans];
+ cs = _tsdp_machine_parser_header_R_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_R_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_R_actions + _tsdp_machine_parser_header_R_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/tsdp_parser_header_R.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/tsdp_parser_header_R.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_R->repeat_interval);
+ }
+ break;
+ case 2:
+ /* #line 51 "./ragel/tsdp_parser_header_R.rl" */
+ {
+ if(!hdr_R->typed_time) {
+ TSK_PARSER_SET_STRING(hdr_R->typed_time);
+ }
+ else {
+ TSK_PARSER_ADD_STRING(hdr_R->typed_times);
+ }
+ }
+ break;
+ /* #line 288 "./src/headers/tsdp_header_R.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_R_actions + _tsdp_machine_parser_header_R_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 2:
-/* #line 51 "./ragel/tsdp_parser_header_R.rl" */
- {
- if(!hdr_R->typed_time){
- TSK_PARSER_SET_STRING(hdr_R->typed_time);
- }
- else{
- TSK_PARSER_ADD_STRING(hdr_R->typed_times);
- }
- }
- break;
-/* #line 315 "./src/headers/tsdp_header_R.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 148 "./ragel/tsdp_parser_header_R.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 327 "./src/headers/tsdp_header_R.c" */
-11
-/* #line 150 "./ragel/tsdp_parser_header_R.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"r=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_R);
- }
-
- return hdr_R;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_R_actions + _tsdp_machine_parser_header_R_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 2:
+ /* #line 51 "./ragel/tsdp_parser_header_R.rl" */
+ {
+ if(!hdr_R->typed_time) {
+ TSK_PARSER_SET_STRING(hdr_R->typed_time);
+ }
+ else {
+ TSK_PARSER_ADD_STRING(hdr_R->typed_times);
+ }
+ }
+ break;
+ /* #line 315 "./src/headers/tsdp_header_R.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 148 "./ragel/tsdp_parser_header_R.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 327 "./src/headers/tsdp_header_R.c" */
+ 11
+ /* #line 150 "./ragel/tsdp_parser_header_R.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"r=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_R);
+ }
+
+ return hdr_R;
}
@@ -346,49 +356,48 @@ _again:
static tsk_object_t* tsdp_header_R_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_R_t *R = self;
- if(R){
- TSDP_HEADER(R)->type = tsdp_htype_R;
- TSDP_HEADER(R)->tostring = tsdp_header_R_tostring;
- TSDP_HEADER(R)->clone = tsdp_header_R_clone;
- TSDP_HEADER(R)->rank = TSDP_HTYPE_R_RANK;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new E header.");
- }
- return self;
+ tsdp_header_R_t *R = self;
+ if(R) {
+ TSDP_HEADER(R)->type = tsdp_htype_R;
+ TSDP_HEADER(R)->tostring = tsdp_header_R_tostring;
+ TSDP_HEADER(R)->clone = tsdp_header_R_clone;
+ TSDP_HEADER(R)->rank = TSDP_HTYPE_R_RANK;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new E header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_R_dtor(tsk_object_t *self)
{
- tsdp_header_R_t *R = self;
- if(R){
- TSK_FREE(R->repeat_interval);
- TSK_FREE(R->typed_time);
- TSK_OBJECT_SAFE_FREE(R->typed_times);
- }
- else{
- TSK_DEBUG_ERROR("Null R header.");
- }
-
- return self;
+ tsdp_header_R_t *R = self;
+ if(R) {
+ TSK_FREE(R->repeat_interval);
+ TSK_FREE(R->typed_time);
+ TSK_OBJECT_SAFE_FREE(R->typed_times);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null R header.");
+ }
+
+ return self;
}
static int tsdp_header_R_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_R_def_s =
-{
- sizeof(tsdp_header_R_t),
- tsdp_header_R_ctor,
- tsdp_header_R_dtor,
- tsdp_header_R_cmp
+static const tsk_object_def_t tsdp_header_R_def_s = {
+ sizeof(tsdp_header_R_t),
+ tsdp_header_R_ctor,
+ tsdp_header_R_dtor,
+ tsdp_header_R_cmp
};
const tsk_object_def_t *tsdp_header_R_def_t = &tsdp_header_R_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_S.c b/tinySDP/src/headers/tsdp_header_S.c
index a9e28eb..8f89884 100755
--- a/tinySDP/src/headers/tsdp_header_S.c
+++ b/tinySDP/src/headers/tsdp_header_S.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_S.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,240 +41,249 @@
tsdp_header_S_t* tsdp_header_S_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_S_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_S_VA_ARGS(value));
}
tsdp_header_S_t* tsdp_header_S_create_null()
{
- return tsdp_header_S_create(tsk_null);
+ return tsdp_header_S_create(tsk_null);
}
int tsdp_header_S_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_S_t *S = (const tsdp_header_S_t *)header;
- if(S->value){
- tsk_buffer_append(output, S->value, tsk_strlen(S->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_S_t *S = (const tsdp_header_S_t *)header;
+ if(S->value) {
+ tsk_buffer_append(output, S->value, tsk_strlen(S->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_S_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_S_t *S = (const tsdp_header_S_t *)header;
- return (tsdp_header_t*)tsdp_header_S_create(S->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_S_t *S = (const tsdp_header_S_t *)header;
+ return (tsdp_header_t*)tsdp_header_S_create(S->value);
+ }
+ return tsk_null;
}
tsdp_header_S_t *tsdp_header_S_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_S_t *hdr_S = tsdp_header_S_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 87 "./src/headers/tsdp_header_S.c" */
-static const char _tsdp_machine_parser_header_S_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_S_t *hdr_S = tsdp_header_S_create_null();
-static const char _tsdp_machine_parser_header_S_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_S_trans_keys[] = {
- 115, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_S_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 87 "./src/headers/tsdp_header_S.c" */
+ static const char _tsdp_machine_parser_header_S_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_S_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_S_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_S_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_S_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_S_trans_keys[] = {
+ 115, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_S_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_S_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_S_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_S_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_S_start = 1;
-static const int tsdp_machine_parser_header_S_first_final = 4;
-static const int tsdp_machine_parser_header_S_error = 0;
-
-static const int tsdp_machine_parser_header_S_en_main = 1;
-
-
-/* #line 101 "./ragel/tsdp_parser_header_S.rl" */
- (void)(tsdp_machine_parser_header_S_first_final);
- (void)(tsdp_machine_parser_header_S_error);
- (void)(tsdp_machine_parser_header_S_en_main);
-
-/* #line 139 "./src/headers/tsdp_header_S.c" */
- {
- cs = tsdp_machine_parser_header_S_start;
- }
-
-/* #line 105 "./ragel/tsdp_parser_header_S.rl" */
-
-/* #line 146 "./src/headers/tsdp_header_S.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_S_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_S_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_S_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_S_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_S_start = 1;
+ static const int tsdp_machine_parser_header_S_first_final = 4;
+ static const int tsdp_machine_parser_header_S_error = 0;
+
+ static const int tsdp_machine_parser_header_S_en_main = 1;
+
+
+ /* #line 101 "./ragel/tsdp_parser_header_S.rl" */
+ (void)(tsdp_machine_parser_header_S_first_final);
+ (void)(tsdp_machine_parser_header_S_error);
+ (void)(tsdp_machine_parser_header_S_en_main);
+
+ /* #line 139 "./src/headers/tsdp_header_S.c" */
+ {
+ cs = tsdp_machine_parser_header_S_start;
+ }
+
+ /* #line 105 "./ragel/tsdp_parser_header_S.rl" */
+
+ /* #line 146 "./src/headers/tsdp_header_S.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_S_trans_keys + _tsdp_machine_parser_header_S_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_S_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_S_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_S_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_S_trans_keys + _tsdp_machine_parser_header_S_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_S_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_S_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_S_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_S_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_S_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_S_actions + _tsdp_machine_parser_header_S_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_S.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_S.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_S->value);
- }
- break;
-/* #line 231 "./src/headers/tsdp_header_S.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_S_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_S_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_S_actions + _tsdp_machine_parser_header_S_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_S.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_S.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_S->value);
+ }
+ break;
+ /* #line 231 "./src/headers/tsdp_header_S.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_S_actions + _tsdp_machine_parser_header_S_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_S.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_S.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_S->value);
- }
- break;
-/* #line 259 "./src/headers/tsdp_header_S.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 106 "./ragel/tsdp_parser_header_S.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 271 "./src/headers/tsdp_header_S.c" */
-4
-/* #line 108 "./ragel/tsdp_parser_header_S.rl" */
- ){
- TSK_OBJECT_SAFE_FREE(hdr_S);
- }
-
- return hdr_S;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_S_actions + _tsdp_machine_parser_header_S_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_S.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_S.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_S->value);
+ }
+ break;
+ /* #line 259 "./src/headers/tsdp_header_S.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 106 "./ragel/tsdp_parser_header_S.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 271 "./src/headers/tsdp_header_S.c" */
+ 4
+ /* #line 108 "./ragel/tsdp_parser_header_S.rl" */
+ ) {
+ TSK_OBJECT_SAFE_FREE(hdr_S);
+ }
+
+ return hdr_S;
}
@@ -289,49 +298,48 @@ _again:
static tsk_object_t* tsdp_header_S_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_S_t *S = self;
- if(S){
- TSDP_HEADER(S)->type = tsdp_htype_S;
- TSDP_HEADER(S)->tostring = tsdp_header_S_tostring;
- TSDP_HEADER(S)->clone = tsdp_header_S_clone;
- TSDP_HEADER(S)->rank = TSDP_HTYPE_S_RANK;
-
- S->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new S header.");
- }
- return self;
+ tsdp_header_S_t *S = self;
+ if(S) {
+ TSDP_HEADER(S)->type = tsdp_htype_S;
+ TSDP_HEADER(S)->tostring = tsdp_header_S_tostring;
+ TSDP_HEADER(S)->clone = tsdp_header_S_clone;
+ TSDP_HEADER(S)->rank = TSDP_HTYPE_S_RANK;
+
+ S->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new S header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_S_dtor(tsk_object_t *self)
{
- tsdp_header_S_t *S = self;
- if(S){
- TSK_FREE(S->value);
- }
- else{
- TSK_DEBUG_ERROR("Null S header.");
- }
-
- return self;
+ tsdp_header_S_t *S = self;
+ if(S) {
+ TSK_FREE(S->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null S header.");
+ }
+
+ return self;
}
static int tsdp_header_S_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_S_def_s =
-{
- sizeof(tsdp_header_S_t),
- tsdp_header_S_ctor,
- tsdp_header_S_dtor,
- tsdp_header_S_cmp
+static const tsk_object_def_t tsdp_header_S_def_s = {
+ sizeof(tsdp_header_S_t),
+ tsdp_header_S_ctor,
+ tsdp_header_S_dtor,
+ tsdp_header_S_cmp
};
const tsk_object_def_t *tsdp_header_S_def_t = &tsdp_header_S_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_T.c b/tinySDP/src/headers/tsdp_header_T.c
index edcb909..4f2388a 100755
--- a/tinySDP/src/headers/tsdp_header_T.c
+++ b/tinySDP/src/headers/tsdp_header_T.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_T.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,285 +41,293 @@
tsdp_header_T_t* tsdp_header_T_create(uint64_t start, uint64_t stop)
{
- return tsk_object_new(TSDP_HEADER_T_VA_ARGS(start, stop));
+ return tsk_object_new(TSDP_HEADER_T_VA_ARGS(start, stop));
}
tsdp_header_T_t* tsdp_header_T_create_null()
{
- return tsdp_header_T_create(0, 0);
+ return tsdp_header_T_create(0, 0);
}
int tsdp_header_T_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_T_t *T = (const tsdp_header_T_t *)header;
- const tsk_list_item_t *item;
-
- //"t=3034423619 3042462419\r\n"
- //"r=7d 1h 0 25h\r\n"
- // IMPORTANT: Do not append the last CRLF (because we only print the header value).
- tsk_buffer_append_2(output, "%llu %llu",
- T->start,
- T->stop
- );
-
- tsk_list_foreach(item, T->repeat_fields)
- {
- if(TSK_LIST_IS_FIRST(T->repeat_fields, item)){
- tsk_buffer_append(output, "\r\n", 2);
- }
- tsk_buffer_append_2(output, "%c=", tsdp_header_get_nameex(TSDP_HEADER(item->data)));
- TSDP_HEADER(item->data)->tostring(TSDP_HEADER(item->data), output);
- //tsdp_header_tostring(TSDP_HEADER(item->data), output);
-
- if(!TSK_LIST_IS_LAST(T->repeat_fields, item)){
- tsk_buffer_append(output, "\r\n", 2);
- }
- }
-
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_T_t *T = (const tsdp_header_T_t *)header;
+ const tsk_list_item_t *item;
+
+ //"t=3034423619 3042462419\r\n"
+ //"r=7d 1h 0 25h\r\n"
+ // IMPORTANT: Do not append the last CRLF (because we only print the header value).
+ tsk_buffer_append_2(output, "%llu %llu",
+ T->start,
+ T->stop
+ );
+
+ tsk_list_foreach(item, T->repeat_fields) {
+ if(TSK_LIST_IS_FIRST(T->repeat_fields, item)) {
+ tsk_buffer_append(output, "\r\n", 2);
+ }
+ tsk_buffer_append_2(output, "%c=", tsdp_header_get_nameex(TSDP_HEADER(item->data)));
+ TSDP_HEADER(item->data)->tostring(TSDP_HEADER(item->data), output);
+ //tsdp_header_tostring(TSDP_HEADER(item->data), output);
+
+ if(!TSK_LIST_IS_LAST(T->repeat_fields, item)) {
+ tsk_buffer_append(output, "\r\n", 2);
+ }
+ }
+
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_T_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_T_t *T = (const tsdp_header_T_t *)header;
- tsdp_header_T_t* clone;
- const tsk_list_item_t *item;
-
- if((clone = tsdp_header_T_create(T->start, T->stop))){
-
- if(T->repeat_fields){
- clone->repeat_fields = tsk_list_create();
- }
-
- tsk_list_foreach(item, T->repeat_fields){
- const tsdp_header_t* curr = item->data;
- tsdp_header_t* hdr_clone = curr->clone(curr);
- tsk_list_push_back_data(clone->repeat_fields, (void**)&hdr_clone);
- }
- }
- return TSDP_HEADER(clone);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_T_t *T = (const tsdp_header_T_t *)header;
+ tsdp_header_T_t* clone;
+ const tsk_list_item_t *item;
+
+ if((clone = tsdp_header_T_create(T->start, T->stop))) {
+
+ if(T->repeat_fields) {
+ clone->repeat_fields = tsk_list_create();
+ }
+
+ tsk_list_foreach(item, T->repeat_fields) {
+ const tsdp_header_t* curr = item->data;
+ tsdp_header_t* hdr_clone = curr->clone(curr);
+ tsk_list_push_back_data(clone->repeat_fields, (void**)&hdr_clone);
+ }
+ }
+ return TSDP_HEADER(clone);
+ }
+ return tsk_null;
}
tsdp_header_T_t *tsdp_header_T_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_T_t *hdr_T = tsdp_header_T_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 124 "./src/headers/tsdp_header_T.c" */
-static const char _tsdp_machine_parser_header_T_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsdp_machine_parser_header_T_key_offsets[] = {
- 0, 0, 1, 3, 6, 9, 11, 12,
- 15
-};
-
-static const char _tsdp_machine_parser_header_T_trans_keys[] = {
- 116, 32, 61, 32, 48, 57, 32, 48,
- 57, 48, 57, 10, 13, 48, 57, 0
-};
-
-static const char _tsdp_machine_parser_header_T_single_lengths[] = {
- 0, 1, 2, 1, 1, 0, 1, 1,
- 0
-};
-
-static const char _tsdp_machine_parser_header_T_range_lengths[] = {
- 0, 0, 0, 1, 1, 1, 0, 1,
- 0
-};
-
-static const char _tsdp_machine_parser_header_T_index_offsets[] = {
- 0, 0, 2, 5, 8, 11, 13, 15,
- 18
-};
-
-static const char _tsdp_machine_parser_header_T_trans_targs[] = {
- 2, 0, 2, 3, 0, 3, 4, 0,
- 5, 4, 0, 7, 0, 8, 0, 6,
- 7, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_T_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 3, 0, 0, 1, 0, 0, 0, 5,
- 0, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_T_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0
-};
-
-static const int tsdp_machine_parser_header_T_start = 1;
-static const int tsdp_machine_parser_header_T_first_final = 7;
-static const int tsdp_machine_parser_header_T_error = 0;
-
-static const int tsdp_machine_parser_header_T_en_main = 1;
-
-
-/* #line 156 "./ragel/tsdp_parser_header_T.rl" */
- (void)(tsdp_machine_parser_header_T_first_final);
- (void)(tsdp_machine_parser_header_T_error);
- (void)(tsdp_machine_parser_header_T_en_main);
-
-/* #line 183 "./src/headers/tsdp_header_T.c" */
- {
- cs = tsdp_machine_parser_header_T_start;
- }
-
-/* #line 160 "./ragel/tsdp_parser_header_T.rl" */
-
-/* #line 190 "./src/headers/tsdp_header_T.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_T_t *hdr_T = tsdp_header_T_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 124 "./src/headers/tsdp_header_T.c" */
+ static const char _tsdp_machine_parser_header_T_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsdp_machine_parser_header_T_key_offsets[] = {
+ 0, 0, 1, 3, 6, 9, 11, 12,
+ 15
+ };
+
+ static const char _tsdp_machine_parser_header_T_trans_keys[] = {
+ 116, 32, 61, 32, 48, 57, 32, 48,
+ 57, 48, 57, 10, 13, 48, 57, 0
+ };
+
+ static const char _tsdp_machine_parser_header_T_single_lengths[] = {
+ 0, 1, 2, 1, 1, 0, 1, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_T_range_lengths[] = {
+ 0, 0, 0, 1, 1, 1, 0, 1,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_T_index_offsets[] = {
+ 0, 0, 2, 5, 8, 11, 13, 15,
+ 18
+ };
+
+ static const char _tsdp_machine_parser_header_T_trans_targs[] = {
+ 2, 0, 2, 3, 0, 3, 4, 0,
+ 5, 4, 0, 7, 0, 8, 0, 6,
+ 7, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_T_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 3, 0, 0, 1, 0, 0, 0, 5,
+ 0, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_T_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0
+ };
+
+ static const int tsdp_machine_parser_header_T_start = 1;
+ static const int tsdp_machine_parser_header_T_first_final = 7;
+ static const int tsdp_machine_parser_header_T_error = 0;
+
+ static const int tsdp_machine_parser_header_T_en_main = 1;
+
+
+ /* #line 156 "./ragel/tsdp_parser_header_T.rl" */
+ (void)(tsdp_machine_parser_header_T_first_final);
+ (void)(tsdp_machine_parser_header_T_error);
+ (void)(tsdp_machine_parser_header_T_en_main);
+
+ /* #line 183 "./src/headers/tsdp_header_T.c" */
+ {
+ cs = tsdp_machine_parser_header_T_start;
+ }
+
+ /* #line 160 "./ragel/tsdp_parser_header_T.rl" */
+
+ /* #line 190 "./src/headers/tsdp_header_T.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_T_trans_keys + _tsdp_machine_parser_header_T_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_T_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_T_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_T_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_T_trans_keys + _tsdp_machine_parser_header_T_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_T_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_T_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_T_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_T_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_T_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_T_actions + _tsdp_machine_parser_header_T_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_T.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_T.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_T->start, uint64_t, atoi64);
- }
- break;
- case 2:
-/* #line 49 "./ragel/tsdp_parser_header_T.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_T->stop, uint64_t, atoi64);
- }
- break;
-/* #line 281 "./src/headers/tsdp_header_T.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_T_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_T_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_T_actions + _tsdp_machine_parser_header_T_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_T.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_T.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_T->start, uint64_t, atoi64);
+ }
+ break;
+ case 2:
+ /* #line 49 "./ragel/tsdp_parser_header_T.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_T->stop, uint64_t, atoi64);
+ }
+ break;
+ /* #line 281 "./src/headers/tsdp_header_T.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_T_actions + _tsdp_machine_parser_header_T_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 2:
-/* #line 49 "./ragel/tsdp_parser_header_T.rl" */
- {
- TSK_PARSER_SET_INTEGER_EX(hdr_T->stop, uint64_t, atoi64);
- }
- break;
-/* #line 303 "./src/headers/tsdp_header_T.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 161 "./ragel/tsdp_parser_header_T.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 315 "./src/headers/tsdp_header_T.c" */
-7
-/* #line 163 "./ragel/tsdp_parser_header_T.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"t=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_T);
- }
-
- return hdr_T;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_T_actions + _tsdp_machine_parser_header_T_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 2:
+ /* #line 49 "./ragel/tsdp_parser_header_T.rl" */
+ {
+ TSK_PARSER_SET_INTEGER_EX(hdr_T->stop, uint64_t, atoi64);
+ }
+ break;
+ /* #line 303 "./src/headers/tsdp_header_T.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 161 "./ragel/tsdp_parser_header_T.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 315 "./src/headers/tsdp_header_T.c" */
+ 7
+ /* #line 163 "./ragel/tsdp_parser_header_T.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"t=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_T);
+ }
+
+ return hdr_T;
}
@@ -334,47 +342,46 @@ _again:
static tsk_object_t* tsdp_header_T_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_T_t *T = self;
- if(T){
- TSDP_HEADER(T)->type = tsdp_htype_T;
- TSDP_HEADER(T)->tostring = tsdp_header_T_tostring;
- TSDP_HEADER(T)->clone = tsdp_header_T_clone;
- TSDP_HEADER(T)->rank = TSDP_HTYPE_T_RANK;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new U header.");
- }
- return self;
+ tsdp_header_T_t *T = self;
+ if(T) {
+ TSDP_HEADER(T)->type = tsdp_htype_T;
+ TSDP_HEADER(T)->tostring = tsdp_header_T_tostring;
+ TSDP_HEADER(T)->clone = tsdp_header_T_clone;
+ TSDP_HEADER(T)->rank = TSDP_HTYPE_T_RANK;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new U header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_T_dtor(tsk_object_t *self)
{
- tsdp_header_T_t *T = self;
- if(T){
- TSK_OBJECT_SAFE_FREE(T->repeat_fields);
- }
- else{
- TSK_DEBUG_ERROR("Null U header.");
- }
-
- return self;
+ tsdp_header_T_t *T = self;
+ if(T) {
+ TSK_OBJECT_SAFE_FREE(T->repeat_fields);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null U header.");
+ }
+
+ return self;
}
static int tsdp_header_T_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_T_def_s =
-{
- sizeof(tsdp_header_T_t),
- tsdp_header_T_ctor,
- tsdp_header_T_dtor,
- tsdp_header_T_cmp
+static const tsk_object_def_t tsdp_header_T_def_s = {
+ sizeof(tsdp_header_T_t),
+ tsdp_header_T_ctor,
+ tsdp_header_T_dtor,
+ tsdp_header_T_cmp
};
const tsk_object_def_t *tsdp_header_T_def_t = &tsdp_header_T_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_U.c b/tinySDP/src/headers/tsdp_header_U.c
index 81906db..2060580 100755
--- a/tinySDP/src/headers/tsdp_header_U.c
+++ b/tinySDP/src/headers/tsdp_header_U.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_U.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,242 +42,251 @@
tsdp_header_U_t* tsdp_header_U_create(const char* value)
{
- return tsk_object_new(TSDP_HEADER_U_VA_ARGS(value));
+ return tsk_object_new(TSDP_HEADER_U_VA_ARGS(value));
}
tsdp_header_U_t* tsdp_header_U_create_null()
{
- return tsdp_header_U_create(tsk_null);
+ return tsdp_header_U_create(tsk_null);
}
int tsdp_header_U_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_U_t *U = (const tsdp_header_U_t *)header;
- if(U->value){
- tsk_buffer_append(output, U->value, tsk_strlen(U->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_U_t *U = (const tsdp_header_U_t *)header;
+ if(U->value) {
+ tsk_buffer_append(output, U->value, tsk_strlen(U->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_U_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_U_t *U = (const tsdp_header_U_t *)header;
- return (tsdp_header_t*)tsdp_header_U_create(U->value);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_U_t *U = (const tsdp_header_U_t *)header;
+ return (tsdp_header_t*)tsdp_header_U_create(U->value);
+ }
+ return tsk_null;
}
tsdp_header_U_t *tsdp_header_U_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_U_t *hdr_U = tsdp_header_U_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 89 "./src/headers/tsdp_header_U.c" */
-static const char _tsdp_machine_parser_header_U_actions[] = {
- 0, 1, 0, 1, 1, 2, 0, 1
-
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_U_t *hdr_U = tsdp_header_U_create_null();
-static const char _tsdp_machine_parser_header_U_key_offsets[] = {
- 0, 0, 1, 3, 4, 6, 7
-};
+ const char *tag_start = tsk_null;
-static const char _tsdp_machine_parser_header_U_trans_keys[] = {
- 117, 32, 61, 10, 13, 32, 13, 0
-};
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-static const char _tsdp_machine_parser_header_U_single_lengths[] = {
- 0, 1, 2, 1, 2, 1, 0
-};
+ /* #line 89 "./src/headers/tsdp_header_U.c" */
+ static const char _tsdp_machine_parser_header_U_actions[] = {
+ 0, 1, 0, 1, 1, 2, 0, 1
-static const char _tsdp_machine_parser_header_U_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0
-};
+ };
-static const char _tsdp_machine_parser_header_U_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 12
-};
+ static const char _tsdp_machine_parser_header_U_key_offsets[] = {
+ 0, 0, 1, 3, 4, 6, 7
+ };
-static const char _tsdp_machine_parser_header_U_trans_targs[] = {
- 2, 0, 2, 4, 0, 6, 0, 3,
- 4, 5, 3, 5, 0, 0
-};
+ static const char _tsdp_machine_parser_header_U_trans_keys[] = {
+ 117, 32, 61, 10, 13, 32, 13, 0
+ };
-static const char _tsdp_machine_parser_header_U_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 1, 3, 0, 0, 0
-};
+ static const char _tsdp_machine_parser_header_U_single_lengths[] = {
+ 0, 1, 2, 1, 2, 1, 0
+ };
-static const char _tsdp_machine_parser_header_U_eof_actions[] = {
- 0, 0, 0, 0, 5, 3, 0
-};
+ static const char _tsdp_machine_parser_header_U_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0
+ };
-static const int tsdp_machine_parser_header_U_start = 1;
-static const int tsdp_machine_parser_header_U_first_final = 4;
-static const int tsdp_machine_parser_header_U_error = 0;
-
-static const int tsdp_machine_parser_header_U_en_main = 1;
-
-
-/* #line 103 "./ragel/tsdp_parser_header_U.rl" */
- (void)(tsdp_machine_parser_header_U_first_final);
- (void)(tsdp_machine_parser_header_U_error);
- (void)(tsdp_machine_parser_header_U_en_main);
-
-/* #line 141 "./src/headers/tsdp_header_U.c" */
- {
- cs = tsdp_machine_parser_header_U_start;
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_U.rl" */
-
-/* #line 148 "./src/headers/tsdp_header_U.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ static const char _tsdp_machine_parser_header_U_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 12
+ };
+
+ static const char _tsdp_machine_parser_header_U_trans_targs[] = {
+ 2, 0, 2, 4, 0, 6, 0, 3,
+ 4, 5, 3, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_U_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 1, 3, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_U_eof_actions[] = {
+ 0, 0, 0, 0, 5, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_U_start = 1;
+ static const int tsdp_machine_parser_header_U_first_final = 4;
+ static const int tsdp_machine_parser_header_U_error = 0;
+
+ static const int tsdp_machine_parser_header_U_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsdp_parser_header_U.rl" */
+ (void)(tsdp_machine_parser_header_U_first_final);
+ (void)(tsdp_machine_parser_header_U_error);
+ (void)(tsdp_machine_parser_header_U_en_main);
+
+ /* #line 141 "./src/headers/tsdp_header_U.c" */
+ {
+ cs = tsdp_machine_parser_header_U_start;
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_U.rl" */
+
+ /* #line 148 "./src/headers/tsdp_header_U.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_U_trans_keys + _tsdp_machine_parser_header_U_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_U_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_U_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_U_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_U_trans_keys + _tsdp_machine_parser_header_U_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_U_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_U_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_U_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_U_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_U_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_U_actions + _tsdp_machine_parser_header_U_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_U.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_U.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_U->value);
- }
- break;
-/* #line 233 "./src/headers/tsdp_header_U.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_U_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_U_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_U_actions + _tsdp_machine_parser_header_U_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_U.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_U.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_U->value);
+ }
+ break;
+ /* #line 233 "./src/headers/tsdp_header_U.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_U_actions + _tsdp_machine_parser_header_U_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_U.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_U.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_U->value);
- }
- break;
-/* #line 261 "./src/headers/tsdp_header_U.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 108 "./ragel/tsdp_parser_header_U.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 273 "./src/headers/tsdp_header_U.c" */
-4
-/* #line 110 "./ragel/tsdp_parser_header_U.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"u=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_U);
- }
-
- return hdr_U;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_U_actions + _tsdp_machine_parser_header_U_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_U.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_U.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_U->value);
+ }
+ break;
+ /* #line 261 "./src/headers/tsdp_header_U.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 108 "./ragel/tsdp_parser_header_U.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 273 "./src/headers/tsdp_header_U.c" */
+ 4
+ /* #line 110 "./ragel/tsdp_parser_header_U.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"u=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_U);
+ }
+
+ return hdr_U;
}
@@ -292,50 +301,48 @@ _again:
static tsk_object_t* tsdp_header_U_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_U_t *U = self;
- if(U)
- {
- TSDP_HEADER(U)->type = tsdp_htype_U;
- TSDP_HEADER(U)->tostring = tsdp_header_U_tostring;
- TSDP_HEADER(U)->clone = tsdp_header_U_clone;
- TSDP_HEADER(U)->rank = TSDP_HTYPE_U_RANK;
-
- U->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new U header.");
- }
- return self;
+ tsdp_header_U_t *U = self;
+ if(U) {
+ TSDP_HEADER(U)->type = tsdp_htype_U;
+ TSDP_HEADER(U)->tostring = tsdp_header_U_tostring;
+ TSDP_HEADER(U)->clone = tsdp_header_U_clone;
+ TSDP_HEADER(U)->rank = TSDP_HTYPE_U_RANK;
+
+ U->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new U header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_U_dtor(tsk_object_t *self)
{
- tsdp_header_U_t *U = self;
- if(U){
- TSK_FREE(U->value);
- }
- else{
- TSK_DEBUG_ERROR("Null U header.");
- }
-
- return self;
+ tsdp_header_U_t *U = self;
+ if(U) {
+ TSK_FREE(U->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null U header.");
+ }
+
+ return self;
}
static int tsdp_header_U_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_U_def_s =
-{
- sizeof(tsdp_header_U_t),
- tsdp_header_U_ctor,
- tsdp_header_U_dtor,
- tsdp_header_U_cmp
+static const tsk_object_def_t tsdp_header_U_def_s = {
+ sizeof(tsdp_header_U_t),
+ tsdp_header_U_ctor,
+ tsdp_header_U_dtor,
+ tsdp_header_U_cmp
};
const tsk_object_def_t *tsdp_header_U_def_t = &tsdp_header_U_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_V.c b/tinySDP/src/headers/tsdp_header_V.c
index e0a5181..8a5d627 100755
--- a/tinySDP/src/headers/tsdp_header_V.c
+++ b/tinySDP/src/headers/tsdp_header_V.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_V.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,236 +41,245 @@
tsdp_header_V_t* tsdp_header_V_create(int32_t version)
{
- return tsk_object_new(TSDP_HEADER_V_VA_ARGS(version));
+ return tsk_object_new(TSDP_HEADER_V_VA_ARGS(version));
}
tsdp_header_V_t* tsdp_header_V_create_null()
{
- return tsdp_header_V_create(TSDP_HEADER_V_DEFAULT);
+ return tsdp_header_V_create(TSDP_HEADER_V_DEFAULT);
}
int tsdp_header_V_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header)
- {
- const tsdp_header_V_t *V = (const tsdp_header_V_t *)header;
- if(V->version >=0){
- tsk_buffer_append_2(output, "%d", V->version);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_V_t *V = (const tsdp_header_V_t *)header;
+ if(V->version >=0) {
+ tsk_buffer_append_2(output, "%d", V->version);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsdp_header_t* tsdp_header_V_clone(const tsdp_header_t* header)
{
- if(header){
- const tsdp_header_V_t *V = (const tsdp_header_V_t *)header;
- return (tsdp_header_t*)tsdp_header_V_create(V->version);
- }
- return tsk_null;
+ if(header) {
+ const tsdp_header_V_t *V = (const tsdp_header_V_t *)header;
+ return (tsdp_header_t*)tsdp_header_V_create(V->version);
+ }
+ return tsk_null;
}
tsdp_header_V_t *tsdp_header_V_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_V_t *hdr_V = tsdp_header_V_create_null();
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 88 "./src/headers/tsdp_header_V.c" */
-static const char _tsdp_machine_parser_header_V_actions[] = {
- 0, 1, 0, 1, 1
-};
-
-static const char _tsdp_machine_parser_header_V_key_offsets[] = {
- 0, 0, 1, 3, 6, 7, 10
-};
-
-static const char _tsdp_machine_parser_header_V_trans_keys[] = {
- 118, 32, 61, 32, 48, 57, 10, 13,
- 48, 57, 0
-};
-
-static const char _tsdp_machine_parser_header_V_single_lengths[] = {
- 0, 1, 2, 1, 1, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_V_range_lengths[] = {
- 0, 0, 0, 1, 0, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_V_index_offsets[] = {
- 0, 0, 2, 5, 8, 10, 13
-};
-
-static const char _tsdp_machine_parser_header_V_trans_targs[] = {
- 2, 0, 2, 3, 0, 3, 5, 0,
- 6, 0, 4, 5, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_V_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 3, 0, 0, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_V_eof_actions[] = {
- 0, 0, 0, 0, 0, 3, 0
-};
-
-static const int tsdp_machine_parser_header_V_start = 1;
-static const int tsdp_machine_parser_header_V_first_final = 5;
-static const int tsdp_machine_parser_header_V_error = 0;
-
-static const int tsdp_machine_parser_header_V_en_main = 1;
-
-
-/* #line 102 "./ragel/tsdp_parser_header_V.rl" */
- (void)(tsdp_machine_parser_header_V_first_final);
- (void)(tsdp_machine_parser_header_V_error);
- (void)(tsdp_machine_parser_header_V_en_main);
-
-/* #line 140 "./src/headers/tsdp_header_V.c" */
- {
- cs = tsdp_machine_parser_header_V_start;
- }
-
-/* #line 106 "./ragel/tsdp_parser_header_V.rl" */
-
-/* #line 147 "./src/headers/tsdp_header_V.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_V_t *hdr_V = tsdp_header_V_create_null();
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 88 "./src/headers/tsdp_header_V.c" */
+ static const char _tsdp_machine_parser_header_V_actions[] = {
+ 0, 1, 0, 1, 1
+ };
+
+ static const char _tsdp_machine_parser_header_V_key_offsets[] = {
+ 0, 0, 1, 3, 6, 7, 10
+ };
+
+ static const char _tsdp_machine_parser_header_V_trans_keys[] = {
+ 118, 32, 61, 32, 48, 57, 10, 13,
+ 48, 57, 0
+ };
+
+ static const char _tsdp_machine_parser_header_V_single_lengths[] = {
+ 0, 1, 2, 1, 1, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_V_range_lengths[] = {
+ 0, 0, 0, 1, 0, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_V_index_offsets[] = {
+ 0, 0, 2, 5, 8, 10, 13
+ };
+
+ static const char _tsdp_machine_parser_header_V_trans_targs[] = {
+ 2, 0, 2, 3, 0, 3, 5, 0,
+ 6, 0, 4, 5, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_V_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 3, 0, 0, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_V_eof_actions[] = {
+ 0, 0, 0, 0, 0, 3, 0
+ };
+
+ static const int tsdp_machine_parser_header_V_start = 1;
+ static const int tsdp_machine_parser_header_V_first_final = 5;
+ static const int tsdp_machine_parser_header_V_error = 0;
+
+ static const int tsdp_machine_parser_header_V_en_main = 1;
+
+
+ /* #line 102 "./ragel/tsdp_parser_header_V.rl" */
+ (void)(tsdp_machine_parser_header_V_first_final);
+ (void)(tsdp_machine_parser_header_V_error);
+ (void)(tsdp_machine_parser_header_V_en_main);
+
+ /* #line 140 "./src/headers/tsdp_header_V.c" */
+ {
+ cs = tsdp_machine_parser_header_V_start;
+ }
+
+ /* #line 106 "./ragel/tsdp_parser_header_V.rl" */
+
+ /* #line 147 "./src/headers/tsdp_header_V.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_V_trans_keys + _tsdp_machine_parser_header_V_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_V_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_V_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_V_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_V_trans_keys + _tsdp_machine_parser_header_V_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_V_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_V_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_V_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_parser_header_V_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_V_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_V_actions + _tsdp_machine_parser_header_V_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 41 "./ragel/tsdp_parser_header_V.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_V.rl" */
- {
- TSK_PARSER_SET_INT(hdr_V->version);
- }
- break;
-/* #line 232 "./src/headers/tsdp_header_V.c" */
- }
- }
+ cs = _tsdp_machine_parser_header_V_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_V_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_V_actions + _tsdp_machine_parser_header_V_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 41 "./ragel/tsdp_parser_header_V.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_V.rl" */
+ {
+ TSK_PARSER_SET_INT(hdr_V->version);
+ }
+ break;
+ /* #line 232 "./src/headers/tsdp_header_V.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_V_actions + _tsdp_machine_parser_header_V_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 45 "./ragel/tsdp_parser_header_V.rl" */
- {
- TSK_PARSER_SET_INT(hdr_V->version);
- }
- break;
-/* #line 254 "./src/headers/tsdp_header_V.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 107 "./ragel/tsdp_parser_header_V.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if( cs <
-/* #line 266 "./src/headers/tsdp_header_V.c" */
-5
-/* #line 109 "./ragel/tsdp_parser_header_V.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"v=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_V);
- }
-
- return hdr_V;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_V_actions + _tsdp_machine_parser_header_V_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 45 "./ragel/tsdp_parser_header_V.rl" */
+ {
+ TSK_PARSER_SET_INT(hdr_V->version);
+ }
+ break;
+ /* #line 254 "./src/headers/tsdp_header_V.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 107 "./ragel/tsdp_parser_header_V.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if( cs <
+ /* #line 266 "./src/headers/tsdp_header_V.c" */
+ 5
+ /* #line 109 "./ragel/tsdp_parser_header_V.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"v=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_V);
+ }
+
+ return hdr_V;
}
@@ -285,48 +294,47 @@ _again:
static tsk_object_t* tsdp_header_V_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_V_t *V = self;
- if(V){
- TSDP_HEADER(V)->type = tsdp_htype_V;
- TSDP_HEADER(V)->tostring = tsdp_header_V_tostring;
- TSDP_HEADER(V)->clone = tsdp_header_V_clone;
- TSDP_HEADER(V)->rank = TSDP_HTYPE_V_RANK;
-
- V->version = va_arg(*app, int32_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new V header.");
- }
- return self;
+ tsdp_header_V_t *V = self;
+ if(V) {
+ TSDP_HEADER(V)->type = tsdp_htype_V;
+ TSDP_HEADER(V)->tostring = tsdp_header_V_tostring;
+ TSDP_HEADER(V)->clone = tsdp_header_V_clone;
+ TSDP_HEADER(V)->rank = TSDP_HTYPE_V_RANK;
+
+ V->version = va_arg(*app, int32_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new V header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_V_dtor(tsk_object_t *self)
{
- tsdp_header_V_t *V = self;
- if(V){
- }
- else{
- TSK_DEBUG_ERROR("Null V header.");
- }
-
- return self;
+ tsdp_header_V_t *V = self;
+ if(V) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null V header.");
+ }
+
+ return self;
}
static int tsdp_header_V_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_V_def_s =
-{
- sizeof(tsdp_header_V_t),
- tsdp_header_V_ctor,
- tsdp_header_V_dtor,
- tsdp_header_V_cmp
+static const tsk_object_def_t tsdp_header_V_def_s = {
+ sizeof(tsdp_header_V_t),
+ tsdp_header_V_ctor,
+ tsdp_header_V_dtor,
+ tsdp_header_V_cmp
};
const tsk_object_def_t *tsdp_header_V_def_t = &tsdp_header_V_def_s;
diff --git a/tinySDP/src/headers/tsdp_header_Z.c b/tinySDP/src/headers/tsdp_header_Z.c
index d00453e..9f12136 100755
--- a/tinySDP/src/headers/tsdp_header_Z.c
+++ b/tinySDP/src/headers/tsdp_header_Z.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_header_Z.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,332 +43,342 @@
tsdp_header_Z_t* tsdp_header_Z_create(uint64_t time, tsk_bool_t shifted_back, const char* typed_time)
{
- return tsk_object_new(TSDP_HEADER_Z_VA_ARGS(time, shifted_back, typed_time));
+ return tsk_object_new(TSDP_HEADER_Z_VA_ARGS(time, shifted_back, typed_time));
}
tsdp_header_Z_t* tsdp_header_Z_create_null()
{
- return tsdp_header_Z_create(0L, tsk_false, tsk_null);
+ return tsdp_header_Z_create(0L, tsk_false, tsk_null);
}
-tsdp_zone_t* tsdp_zone_create(uint64_t time, tsk_bool_t shifted_back, const char* typed_time)
+tsdp_zone_t* tsdp_zone_create(uint64_t time, tsk_bool_t shifted_back, const char* typed_time)
{
- return tsk_object_new(tsdp_zone_def_t, time, shifted_back, typed_time);
+ return tsk_object_new(tsdp_zone_def_t, time, shifted_back, typed_time);
}
tsdp_zone_t* tsdp_zone_create_null()
{
- return tsdp_zone_create(0L, tsk_false, tsk_null);
+ return tsdp_zone_create(0L, tsk_false, tsk_null);
}
int tsdp_header_Z_tostring(const tsdp_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsdp_header_Z_t *Z = (const tsdp_header_Z_t *)header;
- const tsk_list_item_t *item;
- const tsdp_zone_t* zone;
-
- tsk_list_foreach(item, Z->zones){
- zone = (const tsdp_zone_t*)item->data;
- // time SP ["-"] typed-time
- tsk_buffer_append_2(output, "%s%llu %s%s",
- TSK_LIST_IS_FIRST(Z->zones, item) ? "" : " ",
- zone->time,
- zone->shifted_back ? "-" : "",
- zone->typed_time
- );
- }
- }
-
- return -1;
+ if(header) {
+ const tsdp_header_Z_t *Z = (const tsdp_header_Z_t *)header;
+ const tsk_list_item_t *item;
+ const tsdp_zone_t* zone;
+
+ tsk_list_foreach(item, Z->zones) {
+ zone = (const tsdp_zone_t*)item->data;
+ // time SP ["-"] typed-time
+ tsk_buffer_append_2(output, "%s%llu %s%s",
+ TSK_LIST_IS_FIRST(Z->zones, item) ? "" : " ",
+ zone->time,
+ zone->shifted_back ? "-" : "",
+ zone->typed_time
+ );
+ }
+ }
+
+ return -1;
}
tsdp_header_Z_t *tsdp_header_Z_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsdp_header_Z_t *hdr_Z = tsdp_header_Z_create_null();
- tsdp_zone_t* zone = tsk_null;
-
- const char *tag_start = tsk_null;
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
-
-/* #line 101 "./src/headers/tsdp_header_Z.c" */
-static const char _tsdp_machine_parser_header_Z_actions[] = {
- 0, 1, 0, 1, 3, 1, 4, 2,
- 1, 0, 2, 4, 2, 2, 5, 0,
- 3, 4, 2, 1
-};
-
-static const char _tsdp_machine_parser_header_Z_key_offsets[] = {
- 0, 0, 1, 3, 5, 8, 11, 13,
- 14, 16, 19, 22, 24, 32, 32, 40,
- 42
-};
-
-static const char _tsdp_machine_parser_header_Z_trans_keys[] = {
- 122, 32, 61, 48, 57, 32, 48, 57,
- 45, 48, 57, 48, 57, 10, 48, 57,
- 32, 48, 57, 45, 48, 57, 48, 57,
- 13, 32, 100, 104, 109, 115, 48, 57,
- 13, 32, 100, 104, 109, 115, 48, 57,
- 13, 32, 13, 32, 0
-};
-
-static const char _tsdp_machine_parser_header_Z_single_lengths[] = {
- 0, 1, 2, 0, 1, 1, 0, 1,
- 0, 1, 1, 0, 6, 0, 6, 2,
- 2
-};
-
-static const char _tsdp_machine_parser_header_Z_range_lengths[] = {
- 0, 0, 0, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 0
-};
-
-static const char _tsdp_machine_parser_header_Z_index_offsets[] = {
- 0, 0, 2, 5, 7, 10, 13, 15,
- 17, 19, 22, 25, 27, 35, 36, 44,
- 47
-};
-
-static const char _tsdp_machine_parser_header_Z_indicies[] = {
- 0, 1, 0, 2, 1, 3, 1, 4,
- 5, 1, 6, 7, 1, 8, 1, 9,
- 1, 10, 1, 11, 12, 1, 13, 14,
- 1, 15, 1, 16, 17, 19, 19, 19,
- 19, 18, 1, 1, 20, 21, 23, 23,
- 23, 23, 22, 1, 20, 21, 1, 16,
- 17, 1, 0
-};
-
-static const char _tsdp_machine_parser_header_Z_trans_targs[] = {
- 2, 0, 3, 4, 5, 4, 6, 12,
- 12, 13, 9, 10, 9, 11, 14, 14,
- 7, 8, 12, 16, 7, 8, 14, 15
-};
-
-static const char _tsdp_machine_parser_header_Z_trans_actions[] = {
- 0, 0, 0, 7, 3, 0, 0, 1,
- 13, 0, 1, 3, 0, 0, 1, 13,
- 16, 16, 0, 0, 10, 5, 0, 0
-};
-
-static const char _tsdp_machine_parser_header_Z_eof_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 16, 0, 10, 10,
- 16
-};
-
-static const int tsdp_machine_parser_header_Z_start = 1;
-static const int tsdp_machine_parser_header_Z_first_final = 12;
-static const int tsdp_machine_parser_header_Z_error = 0;
-
-static const int tsdp_machine_parser_header_Z_en_main = 1;
-
-
-/* #line 147 "./ragel/tsdp_parser_header_Z.rl" */
- (void)(tsdp_machine_parser_header_Z_first_final);
- (void)(tsdp_machine_parser_header_Z_error);
- (void)(tsdp_machine_parser_header_Z_en_main);
-
-/* #line 181 "./src/headers/tsdp_header_Z.c" */
- {
- cs = tsdp_machine_parser_header_Z_start;
- }
-
-/* #line 151 "./ragel/tsdp_parser_header_Z.rl" */
-
-/* #line 188 "./src/headers/tsdp_header_Z.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsdp_header_Z_t *hdr_Z = tsdp_header_Z_create_null();
+ tsdp_zone_t* zone = tsk_null;
+
+ const char *tag_start = tsk_null;
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+
+ /* #line 101 "./src/headers/tsdp_header_Z.c" */
+ static const char _tsdp_machine_parser_header_Z_actions[] = {
+ 0, 1, 0, 1, 3, 1, 4, 2,
+ 1, 0, 2, 4, 2, 2, 5, 0,
+ 3, 4, 2, 1
+ };
+
+ static const char _tsdp_machine_parser_header_Z_key_offsets[] = {
+ 0, 0, 1, 3, 5, 8, 11, 13,
+ 14, 16, 19, 22, 24, 32, 32, 40,
+ 42
+ };
+
+ static const char _tsdp_machine_parser_header_Z_trans_keys[] = {
+ 122, 32, 61, 48, 57, 32, 48, 57,
+ 45, 48, 57, 48, 57, 10, 48, 57,
+ 32, 48, 57, 45, 48, 57, 48, 57,
+ 13, 32, 100, 104, 109, 115, 48, 57,
+ 13, 32, 100, 104, 109, 115, 48, 57,
+ 13, 32, 13, 32, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Z_single_lengths[] = {
+ 0, 1, 2, 0, 1, 1, 0, 1,
+ 0, 1, 1, 0, 6, 0, 6, 2,
+ 2
+ };
+
+ static const char _tsdp_machine_parser_header_Z_range_lengths[] = {
+ 0, 0, 0, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 0, 1, 0,
+ 0
+ };
+
+ static const char _tsdp_machine_parser_header_Z_index_offsets[] = {
+ 0, 0, 2, 5, 7, 10, 13, 15,
+ 17, 19, 22, 25, 27, 35, 36, 44,
+ 47
+ };
+
+ static const char _tsdp_machine_parser_header_Z_indicies[] = {
+ 0, 1, 0, 2, 1, 3, 1, 4,
+ 5, 1, 6, 7, 1, 8, 1, 9,
+ 1, 10, 1, 11, 12, 1, 13, 14,
+ 1, 15, 1, 16, 17, 19, 19, 19,
+ 19, 18, 1, 1, 20, 21, 23, 23,
+ 23, 23, 22, 1, 20, 21, 1, 16,
+ 17, 1, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Z_trans_targs[] = {
+ 2, 0, 3, 4, 5, 4, 6, 12,
+ 12, 13, 9, 10, 9, 11, 14, 14,
+ 7, 8, 12, 16, 7, 8, 14, 15
+ };
+
+ static const char _tsdp_machine_parser_header_Z_trans_actions[] = {
+ 0, 0, 0, 7, 3, 0, 0, 1,
+ 13, 0, 1, 3, 0, 0, 1, 13,
+ 16, 16, 0, 0, 10, 5, 0, 0
+ };
+
+ static const char _tsdp_machine_parser_header_Z_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 0, 10, 10,
+ 16
+ };
+
+ static const int tsdp_machine_parser_header_Z_start = 1;
+ static const int tsdp_machine_parser_header_Z_first_final = 12;
+ static const int tsdp_machine_parser_header_Z_error = 0;
+
+ static const int tsdp_machine_parser_header_Z_en_main = 1;
+
+
+ /* #line 147 "./ragel/tsdp_parser_header_Z.rl" */
+ (void)(tsdp_machine_parser_header_Z_first_final);
+ (void)(tsdp_machine_parser_header_Z_error);
+ (void)(tsdp_machine_parser_header_Z_en_main);
+
+ /* #line 181 "./src/headers/tsdp_header_Z.c" */
+ {
+ cs = tsdp_machine_parser_header_Z_start;
+ }
+
+ /* #line 151 "./ragel/tsdp_parser_header_Z.rl" */
+
+ /* #line 188 "./src/headers/tsdp_header_Z.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_parser_header_Z_trans_keys + _tsdp_machine_parser_header_Z_key_offsets[cs];
- _trans = _tsdp_machine_parser_header_Z_index_offsets[cs];
-
- _klen = _tsdp_machine_parser_header_Z_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_parser_header_Z_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_parser_header_Z_trans_keys + _tsdp_machine_parser_header_Z_key_offsets[cs];
+ _trans = _tsdp_machine_parser_header_Z_index_offsets[cs];
+
+ _klen = _tsdp_machine_parser_header_Z_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_parser_header_Z_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsdp_machine_parser_header_Z_indicies[_trans];
- cs = _tsdp_machine_parser_header_Z_trans_targs[_trans];
-
- if ( _tsdp_machine_parser_header_Z_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_parser_header_Z_actions + _tsdp_machine_parser_header_Z_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 43 "./ragel/tsdp_parser_header_Z.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 47 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(!zone){
- zone = tsdp_zone_create_null();
- }
- }
- break;
- case 2:
-/* #line 53 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- tsk_list_push_back_data(hdr_Z->zones,(void**)&zone);
- }
- }
- break;
- case 3:
-/* #line 59 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- TSK_PARSER_SET_INTEGER_EX(zone->time, uint64_t, atoi64);
- }
- }
- break;
- case 4:
-/* #line 65 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- TSK_PARSER_SET_STRING(zone->typed_time);
- }
- }
- break;
- case 5:
-/* #line 71 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- zone->shifted_back = tsk_true;
- }
- }
- break;
-/* #line 308 "./src/headers/tsdp_header_Z.c" */
- }
- }
+ _trans = _tsdp_machine_parser_header_Z_indicies[_trans];
+ cs = _tsdp_machine_parser_header_Z_trans_targs[_trans];
+
+ if ( _tsdp_machine_parser_header_Z_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_parser_header_Z_actions + _tsdp_machine_parser_header_Z_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 43 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 47 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(!zone) {
+ zone = tsdp_zone_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 53 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ tsk_list_push_back_data(hdr_Z->zones,(void**)&zone);
+ }
+ }
+ break;
+ case 3:
+ /* #line 59 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ TSK_PARSER_SET_INTEGER_EX(zone->time, uint64_t, atoi64);
+ }
+ }
+ break;
+ case 4:
+ /* #line 65 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ TSK_PARSER_SET_STRING(zone->typed_time);
+ }
+ }
+ break;
+ case 5:
+ /* #line 71 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ zone->shifted_back = tsk_true;
+ }
+ }
+ break;
+ /* #line 308 "./src/headers/tsdp_header_Z.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _tsdp_machine_parser_header_Z_actions + _tsdp_machine_parser_header_Z_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 1:
-/* #line 47 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(!zone){
- zone = tsdp_zone_create_null();
- }
- }
- break;
- case 2:
-/* #line 53 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- tsk_list_push_back_data(hdr_Z->zones,(void**)&zone);
- }
- }
- break;
- case 4:
-/* #line 65 "./ragel/tsdp_parser_header_Z.rl" */
- {
- if(zone){
- TSK_PARSER_SET_STRING(zone->typed_time);
- }
- }
- break;
-/* #line 348 "./src/headers/tsdp_header_Z.c" */
- }
- }
- }
-
- _out: {}
- }
-
-/* #line 152 "./ragel/tsdp_parser_header_Z.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- if(zone){
- TSK_OBJECT_SAFE_FREE(zone);
- }
-
- if( cs <
-/* #line 364 "./src/headers/tsdp_header_Z.c" */
-12
-/* #line 158 "./ragel/tsdp_parser_header_Z.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse \"z=\" header.");
- TSK_OBJECT_SAFE_FREE(hdr_Z);
- }
-
- return hdr_Z;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ const char *__acts = _tsdp_machine_parser_header_Z_actions + _tsdp_machine_parser_header_Z_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 1:
+ /* #line 47 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(!zone) {
+ zone = tsdp_zone_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 53 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ tsk_list_push_back_data(hdr_Z->zones,(void**)&zone);
+ }
+ }
+ break;
+ case 4:
+ /* #line 65 "./ragel/tsdp_parser_header_Z.rl" */
+ {
+ if(zone) {
+ TSK_PARSER_SET_STRING(zone->typed_time);
+ }
+ }
+ break;
+ /* #line 348 "./src/headers/tsdp_header_Z.c" */
+ }
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 152 "./ragel/tsdp_parser_header_Z.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ if(zone) {
+ TSK_OBJECT_SAFE_FREE(zone);
+ }
+
+ if( cs <
+ /* #line 364 "./src/headers/tsdp_header_Z.c" */
+ 12
+ /* #line 158 "./ragel/tsdp_parser_header_Z.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse \"z=\" header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Z);
+ }
+
+ return hdr_Z;
}
@@ -383,59 +393,58 @@ _again:
static tsk_object_t* tsdp_header_Z_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_header_Z_t *Z = self;
- if(Z){
- TSDP_HEADER(Z)->type = tsdp_htype_Z;
- TSDP_HEADER(Z)->tostring = tsdp_header_Z_tostring;
- TSDP_HEADER(Z)->rank = TSDP_HTYPE_Z_RANK;
-
- if((Z->zones = tsk_list_create())){
- uint64_t time = va_arg(*app, uint64_t);
- unsigned shifted_back = va_arg(*app, unsigned);
- const char* typed_time = va_arg(*app, const char*);
-
- if(typed_time){
- tsdp_zone_t *zone;
- if((zone = tsdp_zone_create(time, shifted_back, typed_time))){
- tsk_list_push_back_data(Z->zones,(void**)&zone);
- }
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Z header.");
- }
- return self;
+ tsdp_header_Z_t *Z = self;
+ if(Z) {
+ TSDP_HEADER(Z)->type = tsdp_htype_Z;
+ TSDP_HEADER(Z)->tostring = tsdp_header_Z_tostring;
+ TSDP_HEADER(Z)->rank = TSDP_HTYPE_Z_RANK;
+
+ if((Z->zones = tsk_list_create())) {
+ uint64_t time = va_arg(*app, uint64_t);
+ unsigned shifted_back = va_arg(*app, unsigned);
+ const char* typed_time = va_arg(*app, const char*);
+
+ if(typed_time) {
+ tsdp_zone_t *zone;
+ if((zone = tsdp_zone_create(time, shifted_back, typed_time))) {
+ tsk_list_push_back_data(Z->zones,(void**)&zone);
+ }
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Z header.");
+ }
+ return self;
}
static tsk_object_t* tsdp_header_Z_dtor(tsk_object_t *self)
{
- tsdp_header_Z_t *Z = self;
- if(Z){
- TSK_OBJECT_SAFE_FREE(Z->zones);
- }
- else{
- TSK_DEBUG_ERROR("Null Z header.");
- }
-
- return self;
+ tsdp_header_Z_t *Z = self;
+ if(Z) {
+ TSK_OBJECT_SAFE_FREE(Z->zones);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Z header.");
+ }
+
+ return self;
}
static int tsdp_header_Z_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- return tsdp_header_rank_cmp(obj1, obj2);
- }
- else{
- return -1;
- }
+ if(obj1 && obj2) {
+ return tsdp_header_rank_cmp(obj1, obj2);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tsdp_header_Z_def_s =
-{
- sizeof(tsdp_header_Z_t),
- tsdp_header_Z_ctor,
- tsdp_header_Z_dtor,
- tsdp_header_Z_cmp
+static const tsk_object_def_t tsdp_header_Z_def_s = {
+ sizeof(tsdp_header_Z_t),
+ tsdp_header_Z_ctor,
+ tsdp_header_Z_dtor,
+ tsdp_header_Z_cmp
};
const tsk_object_def_t *tsdp_header_Z_def_t = &tsdp_header_Z_def_s;
@@ -449,37 +458,36 @@ const tsk_object_def_t *tsdp_header_Z_def_t = &tsdp_header_Z_def_s;
static tsk_object_t* tsdp_zone_ctor(tsk_object_t *self, va_list * app)
{
- tsdp_zone_t *zone = self;
- if(zone){
- zone->time = va_arg(*app, uint64_t);
- zone->shifted_back = va_arg(*app, tsk_bool_t);
- zone->typed_time = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new zone object.");
- }
- return self;
+ tsdp_zone_t *zone = self;
+ if(zone) {
+ zone->time = va_arg(*app, uint64_t);
+ zone->shifted_back = va_arg(*app, tsk_bool_t);
+ zone->typed_time = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new zone object.");
+ }
+ return self;
}
static tsk_object_t* tsdp_zone_dtor(tsk_object_t *self)
{
- tsdp_zone_t *zone = self;
- if(zone){
- TSK_FREE(zone->typed_time);
- }
- else{
- TSK_DEBUG_ERROR("Null zone object.");
- }
-
- return self;
+ tsdp_zone_t *zone = self;
+ if(zone) {
+ TSK_FREE(zone->typed_time);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null zone object.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsdp_zone_def_s =
-{
- sizeof(tsdp_zone_t),
- tsdp_zone_ctor,
- tsdp_zone_dtor,
- tsk_null
+static const tsk_object_def_t tsdp_zone_def_s = {
+ sizeof(tsdp_zone_t),
+ tsdp_zone_ctor,
+ tsdp_zone_dtor,
+ tsk_null
};
const tsk_object_def_t *tsdp_zone_def_t = &tsdp_zone_def_s;
diff --git a/tinySDP/src/parsers/tsdp_parser_message.c b/tinySDP/src/parsers/tsdp_parser_message.c
index b2f45fd..8148aa4 100755
--- a/tinySDP/src/parsers/tsdp_parser_message.c
+++ b/tinySDP/src/parsers/tsdp_parser_message.c
@@ -2,19 +2,19 @@
/* #line 1 "./ragel/tsdp_parser_message.rl" */
/*
* Copyright (C) 2010-2015 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,93 +52,93 @@ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
/* #line 54 "./src/parsers/tsdp_parser_message.c" */
static const char _tsdp_machine_message_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16
};
static const char _tsdp_machine_message_key_offsets[] = {
- 0, 0, 2, 3, 4, 6, 7, 9,
- 10, 12, 13, 15, 16, 18, 19, 21,
- 22, 24, 25, 27, 28, 30, 31, 33,
- 34, 36, 37, 39, 40, 42, 43, 45,
- 46, 48, 49
+ 0, 0, 2, 3, 4, 6, 7, 9,
+ 10, 12, 13, 15, 16, 18, 19, 21,
+ 22, 24, 25, 27, 28, 30, 31, 33,
+ 34, 36, 37, 39, 40, 42, 43, 45,
+ 46, 48, 49
};
static const char _tsdp_machine_message_trans_keys[] = {
- 32, 61, 13, 10, 32, 61, 13, 32,
- 61, 13, 32, 61, 13, 32, 61, 13,
- 32, 61, 13, 32, 61, 13, 32, 61,
- 13, 32, 61, 13, 32, 61, 13, 32,
- 61, 13, 32, 61, 13, 32, 61, 13,
- 32, 61, 13, 32, 61, 13, 32, 61,
- 13, 65, 66, 67, 69, 73, 75, 77,
- 79, 80, 82, 83, 84, 85, 86, 90,
- 97, 98, 99, 101, 105, 107, 109, 111,
- 112, 114, 115, 116, 117, 118, 122, 68,
- 89, 100, 121, 0
+ 32, 61, 13, 10, 32, 61, 13, 32,
+ 61, 13, 32, 61, 13, 32, 61, 13,
+ 32, 61, 13, 32, 61, 13, 32, 61,
+ 13, 32, 61, 13, 32, 61, 13, 32,
+ 61, 13, 32, 61, 13, 32, 61, 13,
+ 32, 61, 13, 32, 61, 13, 32, 61,
+ 13, 65, 66, 67, 69, 73, 75, 77,
+ 79, 80, 82, 83, 84, 85, 86, 90,
+ 97, 98, 99, 101, 105, 107, 109, 111,
+ 112, 114, 115, 116, 117, 118, 122, 68,
+ 89, 100, 121, 0
};
static const char _tsdp_machine_message_single_lengths[] = {
- 0, 2, 1, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 30
+ 0, 2, 1, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 30
};
static const char _tsdp_machine_message_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 2
};
static const char _tsdp_machine_message_index_offsets[] = {
- 0, 0, 3, 5, 7, 10, 12, 15,
- 17, 20, 22, 25, 27, 30, 32, 35,
- 37, 40, 42, 45, 47, 50, 52, 55,
- 57, 60, 62, 65, 67, 70, 72, 75,
- 77, 80, 82
+ 0, 0, 3, 5, 7, 10, 12, 15,
+ 17, 20, 22, 25, 27, 30, 32, 35,
+ 37, 40, 42, 45, 47, 50, 52, 55,
+ 57, 60, 62, 65, 67, 70, 72, 75,
+ 77, 80, 82
};
static const char _tsdp_machine_message_trans_targs[] = {
- 1, 2, 0, 3, 2, 34, 0, 4,
- 5, 0, 3, 5, 6, 7, 0, 3,
- 7, 8, 9, 0, 3, 9, 10, 11,
- 0, 3, 11, 12, 13, 0, 3, 13,
- 14, 15, 0, 3, 15, 16, 17, 0,
- 3, 17, 18, 19, 0, 3, 19, 20,
- 21, 0, 3, 21, 22, 23, 0, 3,
- 23, 24, 25, 0, 3, 25, 26, 27,
- 0, 3, 27, 28, 29, 0, 3, 29,
- 30, 31, 0, 3, 31, 32, 33, 0,
- 3, 33, 1, 4, 6, 10, 12, 14,
- 16, 18, 20, 22, 24, 26, 28, 30,
- 32, 1, 4, 6, 10, 12, 14, 16,
- 18, 20, 22, 24, 26, 28, 30, 32,
- 8, 8, 0, 0
+ 1, 2, 0, 3, 2, 34, 0, 4,
+ 5, 0, 3, 5, 6, 7, 0, 3,
+ 7, 8, 9, 0, 3, 9, 10, 11,
+ 0, 3, 11, 12, 13, 0, 3, 13,
+ 14, 15, 0, 3, 15, 16, 17, 0,
+ 3, 17, 18, 19, 0, 3, 19, 20,
+ 21, 0, 3, 21, 22, 23, 0, 3,
+ 23, 24, 25, 0, 3, 25, 26, 27,
+ 0, 3, 27, 28, 29, 0, 3, 29,
+ 30, 31, 0, 3, 31, 32, 33, 0,
+ 3, 33, 1, 4, 6, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30,
+ 32, 1, 4, 6, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32,
+ 8, 8, 0, 0
};
static const char _tsdp_machine_message_trans_actions[] = {
- 0, 0, 0, 3, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 0, 0, 7,
- 0, 0, 0, 0, 9, 0, 0, 0,
- 0, 11, 0, 0, 0, 0, 13, 0,
- 0, 0, 0, 15, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 19, 0, 0,
- 0, 0, 21, 0, 0, 0, 0, 23,
- 0, 0, 0, 0, 25, 0, 0, 0,
- 0, 27, 0, 0, 0, 0, 29, 0,
- 0, 0, 0, 31, 0, 0, 0, 0,
- 33, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 0, 0
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 0, 0, 7,
+ 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 11, 0, 0, 0, 0, 13, 0,
+ 0, 0, 0, 15, 0, 0, 0, 0,
+ 17, 0, 0, 0, 0, 19, 0, 0,
+ 0, 0, 21, 0, 0, 0, 0, 23,
+ 0, 0, 0, 0, 25, 0, 0, 0,
+ 0, 27, 0, 0, 0, 0, 29, 0,
+ 0, 0, 0, 31, 0, 0, 0, 0,
+ 33, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0
};
static const int tsdp_machine_message_start = 34;
@@ -153,325 +153,335 @@ TSK_RAGEL_DISABLE_WARNINGS_END()
tsdp_message_t* tsdp_message_parse(const void *input, tsk_size_t size)
{
- tsdp_message_t* sdp_msg = tsk_null;
- const char* tag_start = tsk_null;
- tsdp_header_t *header = tsk_null;
- tsdp_header_T_t *hdr_T = tsk_null;
- tsdp_header_M_t *hdr_M = tsk_null;
-
- /* Ragel variables */
- int cs = 0;
- const char* p = input;
- const char* pe = p + size;
- const char* eof = tsk_null;
-
- (void)(eof);
-
- if(!input || !size){
- TSK_DEBUG_ERROR("Null or empty buffer.");
- goto bail;
- }
-
- if(!(sdp_msg = tsdp_message_create())){
- goto bail;
- }
-
- TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
- /* Ragel init */
-
-/* #line 183 "./src/parsers/tsdp_parser_message.c" */
- {
- cs = tsdp_machine_message_start;
- }
-
-/* #line 273 "./ragel/tsdp_parser_message.rl" */
-
- /* Ragel execute */
-
-/* #line 192 "./src/parsers/tsdp_parser_message.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ tsdp_message_t* sdp_msg = tsk_null;
+ const char* tag_start = tsk_null;
+ tsdp_header_t *header = tsk_null;
+ tsdp_header_T_t *hdr_T = tsk_null;
+ tsdp_header_M_t *hdr_M = tsk_null;
+
+ /* Ragel variables */
+ int cs = 0;
+ const char* p = input;
+ const char* pe = p + size;
+ const char* eof = tsk_null;
+
+ (void)(eof);
+
+ if(!input || !size) {
+ TSK_DEBUG_ERROR("Null or empty buffer.");
+ goto bail;
+ }
+
+ if(!(sdp_msg = tsdp_message_create())) {
+ goto bail;
+ }
+
+ TSK_RAGEL_DISABLE_WARNINGS_BEGIN()
+ /* Ragel init */
+
+ /* #line 183 "./src/parsers/tsdp_parser_message.c" */
+ {
+ cs = tsdp_machine_message_start;
+ }
+
+ /* #line 273 "./ragel/tsdp_parser_message.rl" */
+
+ /* Ragel execute */
+
+ /* #line 192 "./src/parsers/tsdp_parser_message.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsdp_machine_message_trans_keys + _tsdp_machine_message_key_offsets[cs];
- _trans = _tsdp_machine_message_index_offsets[cs];
-
- _klen = _tsdp_machine_message_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsdp_machine_message_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsdp_machine_message_trans_keys + _tsdp_machine_message_key_offsets[cs];
+ _trans = _tsdp_machine_message_index_offsets[cs];
+
+ _klen = _tsdp_machine_message_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsdp_machine_message_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsdp_machine_message_trans_targs[_trans];
-
- if ( _tsdp_machine_message_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsdp_machine_message_actions + _tsdp_machine_message_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 52 "./ragel/tsdp_parser_message.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 59 "./ragel/tsdp_parser_message.rl" */
- {
- if(hdr_M){
- if(!hdr_M->Attributes){
- hdr_M->Attributes = tsk_list_create();
- }
- if((header = (tsdp_header_t*)tsdp_header_A_parse(tag_start, (p - tag_start)))){
- tsk_list_push_back_data(hdr_M->Attributes, (void**)&header);
- }
- }
- else if((header = (tsdp_header_t*)tsdp_header_A_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 2:
-/* #line 74 "./ragel/tsdp_parser_message.rl" */
- {
- if(hdr_M){
- if(!hdr_M->Bandwidths){
- hdr_M->Bandwidths = tsk_list_create();
- }
- if((header = (tsdp_header_t*)tsdp_header_B_parse(tag_start, (p - tag_start)))){
- tsk_list_push_back_data(hdr_M->Bandwidths, (void**)&header);
- }
- }
- else if((header = (tsdp_header_t*)tsdp_header_B_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 3:
-/* #line 89 "./ragel/tsdp_parser_message.rl" */
- {
- if(hdr_M && !hdr_M->C){
- hdr_M->C = tsdp_header_C_parse(tag_start, (p - tag_start));
- }
- else if((header = (tsdp_header_t*)tsdp_header_C_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 4:
-/* #line 99 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_Dummy_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 5:
-/* #line 106 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_E_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 6:
-/* #line 113 "./ragel/tsdp_parser_message.rl" */
- {
- if(hdr_M && !hdr_M->I){
- hdr_M->I = tsdp_header_I_parse(tag_start, (p - tag_start));
- }
- else if((header = (tsdp_header_t*)tsdp_header_I_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 7:
-/* #line 123 "./ragel/tsdp_parser_message.rl" */
- {
- if(hdr_M && !hdr_M->K){
- hdr_M->K = tsdp_header_K_parse(tag_start, (p - tag_start));
- }
- else if((header = (tsdp_header_t*)tsdp_header_K_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 8:
-/* #line 133 "./ragel/tsdp_parser_message.rl" */
- {
- if((hdr_M = tsdp_header_M_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, TSDP_HEADER(hdr_M));
- hdr_M = tsk_object_unref(hdr_M);
- }
- }
- break;
- case 9:
-/* #line 140 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_O_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 10:
-/* #line 147 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_P_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 11:
-/* #line 154 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_R_parse(tag_start, (p - tag_start)))){
- if(hdr_T){
- if(!hdr_T->repeat_fields){
- hdr_T->repeat_fields = tsk_list_create();
- }
- tsk_list_push_back_data(hdr_T->repeat_fields, (void**)&header);
- }
- else{
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- }
- break;
- case 12:
-/* #line 169 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_S_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 13:
-/* #line 176 "./ragel/tsdp_parser_message.rl" */
- {
- if((hdr_T = tsdp_header_T_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, TSDP_HEADER(hdr_T));
- hdr_T = tsk_object_unref(hdr_T);
- }
- }
- break;
- case 14:
-/* #line 183 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_U_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 15:
-/* #line 190 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_V_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
- case 16:
-/* #line 197 "./ragel/tsdp_parser_message.rl" */
- {
- if((header = (tsdp_header_t*)tsdp_header_Z_parse(tag_start, (p - tag_start)))){
- tsdp_message_add_header(sdp_msg, header);
- tsk_object_unref(header);
- }
- }
- break;
-/* #line 448 "./src/parsers/tsdp_parser_message.c" */
- }
- }
+ cs = _tsdp_machine_message_trans_targs[_trans];
+
+ if ( _tsdp_machine_message_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsdp_machine_message_actions + _tsdp_machine_message_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 52 "./ragel/tsdp_parser_message.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 59 "./ragel/tsdp_parser_message.rl" */
+ {
+ if(hdr_M) {
+ if(!hdr_M->Attributes) {
+ hdr_M->Attributes = tsk_list_create();
+ }
+ if((header = (tsdp_header_t*)tsdp_header_A_parse(tag_start, (p - tag_start)))) {
+ tsk_list_push_back_data(hdr_M->Attributes, (void**)&header);
+ }
+ }
+ else if((header = (tsdp_header_t*)tsdp_header_A_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 2:
+ /* #line 74 "./ragel/tsdp_parser_message.rl" */
+ {
+ if(hdr_M) {
+ if(!hdr_M->Bandwidths) {
+ hdr_M->Bandwidths = tsk_list_create();
+ }
+ if((header = (tsdp_header_t*)tsdp_header_B_parse(tag_start, (p - tag_start)))) {
+ tsk_list_push_back_data(hdr_M->Bandwidths, (void**)&header);
+ }
+ }
+ else if((header = (tsdp_header_t*)tsdp_header_B_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 3:
+ /* #line 89 "./ragel/tsdp_parser_message.rl" */
+ {
+ if(hdr_M && !hdr_M->C) {
+ hdr_M->C = tsdp_header_C_parse(tag_start, (p - tag_start));
+ }
+ else if((header = (tsdp_header_t*)tsdp_header_C_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 4:
+ /* #line 99 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_Dummy_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 5:
+ /* #line 106 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_E_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 6:
+ /* #line 113 "./ragel/tsdp_parser_message.rl" */
+ {
+ if(hdr_M && !hdr_M->I) {
+ hdr_M->I = tsdp_header_I_parse(tag_start, (p - tag_start));
+ }
+ else if((header = (tsdp_header_t*)tsdp_header_I_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 7:
+ /* #line 123 "./ragel/tsdp_parser_message.rl" */
+ {
+ if(hdr_M && !hdr_M->K) {
+ hdr_M->K = tsdp_header_K_parse(tag_start, (p - tag_start));
+ }
+ else if((header = (tsdp_header_t*)tsdp_header_K_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 8:
+ /* #line 133 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((hdr_M = tsdp_header_M_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, TSDP_HEADER(hdr_M));
+ hdr_M = tsk_object_unref(hdr_M);
+ }
+ }
+ break;
+ case 9:
+ /* #line 140 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_O_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 10:
+ /* #line 147 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_P_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 11:
+ /* #line 154 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_R_parse(tag_start, (p - tag_start)))) {
+ if(hdr_T) {
+ if(!hdr_T->repeat_fields) {
+ hdr_T->repeat_fields = tsk_list_create();
+ }
+ tsk_list_push_back_data(hdr_T->repeat_fields, (void**)&header);
+ }
+ else {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ }
+ break;
+ case 12:
+ /* #line 169 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_S_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 13:
+ /* #line 176 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((hdr_T = tsdp_header_T_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, TSDP_HEADER(hdr_T));
+ hdr_T = tsk_object_unref(hdr_T);
+ }
+ }
+ break;
+ case 14:
+ /* #line 183 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_U_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 15:
+ /* #line 190 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_V_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ case 16:
+ /* #line 197 "./ragel/tsdp_parser_message.rl" */
+ {
+ if((header = (tsdp_header_t*)tsdp_header_Z_parse(tag_start, (p - tag_start)))) {
+ tsdp_message_add_header(sdp_msg, header);
+ tsk_object_unref(header);
+ }
+ }
+ break;
+ /* #line 448 "./src/parsers/tsdp_parser_message.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 276 "./ragel/tsdp_parser_message.rl" */
- TSK_RAGEL_DISABLE_WARNINGS_END()
-
- /* Check result */
- if( cs <
-/* #line 466 "./src/parsers/tsdp_parser_message.c" */
-34
-/* #line 279 "./ragel/tsdp_parser_message.rl" */
- )
- {
- TSK_DEBUG_ERROR("Failed to parse SDP message.");
- TSK_OBJECT_SAFE_FREE(sdp_msg);
- goto bail;
- }
-
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 276 "./ragel/tsdp_parser_message.rl" */
+ TSK_RAGEL_DISABLE_WARNINGS_END()
+
+ /* Check result */
+ if( cs <
+ /* #line 466 "./src/parsers/tsdp_parser_message.c" */
+ 34
+ /* #line 279 "./ragel/tsdp_parser_message.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SDP message.");
+ TSK_OBJECT_SAFE_FREE(sdp_msg);
+ goto bail;
+ }
+
bail:
- return sdp_msg;
+ return sdp_msg;
}
diff --git a/tinySDP/src/tsdp.c b/tinySDP/src/tsdp.c
index 48b05e6..2c54908 100755
--- a/tinySDP/src/tsdp.c
+++ b/tinySDP/src/tsdp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,135 +34,148 @@
extern int __pred_find_media_by_name(const tsk_list_item_t *item, const void *name);
-typedef struct tsdp_ctx_s
-{
- TSK_DECLARE_OBJECT;
-
- tsdp_message_t* local;
- tsdp_message_t* remote;
- tsdp_message_t* negotiated;
+typedef struct tsdp_ctx_s {
+ TSK_DECLARE_OBJECT;
+
+ tsdp_message_t* local;
+ tsdp_message_t* remote;
+ tsdp_message_t* negotiated;
}
tsdp_ctx_t;
const tsdp_message_t* tsdp_ctx_local_get_sdp(const tsdp_ctx_handle_t* self)
{
- const tsdp_ctx_t* ctx = self;
-
- if(ctx){
- return ctx->local;
- }
- else return tsk_null;
+ const tsdp_ctx_t* ctx = self;
+
+ if(ctx) {
+ return ctx->local;
+ }
+ else {
+ return tsk_null;
+ }
}
int tsdp_ctx_local_create_sdp(tsdp_ctx_handle_t* self, const tsdp_message_t* local)
{
- tsdp_ctx_t* ctx = self;
- tsdp_message_t* newsdp;
-
- if(!ctx || !local){
- return -1;
- }
-
- // set new local sdp
- if((newsdp = tsdp_message_clone(local))){
- TSK_OBJECT_SAFE_FREE(ctx->local);
- ctx->local = newsdp;
- return 0;
- }
- else return -2;
+ tsdp_ctx_t* ctx = self;
+ tsdp_message_t* newsdp;
+
+ if(!ctx || !local) {
+ return -1;
+ }
+
+ // set new local sdp
+ if((newsdp = tsdp_message_clone(local))) {
+ TSK_OBJECT_SAFE_FREE(ctx->local);
+ ctx->local = newsdp;
+ return 0;
+ }
+ else {
+ return -2;
+ }
}
int tsdp_ctx_local_create_sdp_2(tsdp_ctx_handle_t* self, const char* sdp, tsk_size_t size)
{
- tsdp_ctx_t* ctx = self;
- tsdp_message_t* newsdp;
-
- if(!ctx || !sdp || !size){
- return -1;
- }
-
- if((newsdp = tsdp_message_parse(sdp, size))){
- TSK_OBJECT_SAFE_FREE(ctx->local);
- ctx->local = newsdp;
- return 0;
- }
- else return -2;
+ tsdp_ctx_t* ctx = self;
+ tsdp_message_t* newsdp;
+
+ if(!ctx || !sdp || !size) {
+ return -1;
+ }
+
+ if((newsdp = tsdp_message_parse(sdp, size))) {
+ TSK_OBJECT_SAFE_FREE(ctx->local);
+ ctx->local = newsdp;
+ return 0;
+ }
+ else {
+ return -2;
+ }
}
int tsdp_ctx_local_add_headers(tsdp_ctx_handle_t* self, ...)
{
- tsdp_ctx_t* ctx = self;
- const tsk_object_def_t* objdef;
- tsdp_header_t *header;
- va_list ap;
-
- if(!ctx || !ctx->local){
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if((header = tsk_object_new_2(objdef, &ap))){
- tsdp_message_add_header(ctx->local, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- va_end(ap);
-
- return 0;
+ tsdp_ctx_t* ctx = self;
+ const tsk_object_def_t* objdef;
+ tsdp_header_t *header;
+ va_list ap;
+
+ if(!ctx || !ctx->local) {
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ tsdp_message_add_header(ctx->local, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
int tsdp_ctx_local_add_media(tsdp_ctx_handle_t* self, const tsdp_header_M_t* media)
{
- tsdp_ctx_t* ctx = self;
-
- if(!ctx || !media){
- return -1;
- }
-
- if(ctx->local){
- return tsdp_message_add_header(ctx->local, TSDP_HEADER(media));
- }
- else return -2;
+ tsdp_ctx_t* ctx = self;
+
+ if(!ctx || !media) {
+ return -1;
+ }
+
+ if(ctx->local) {
+ return tsdp_message_add_header(ctx->local, TSDP_HEADER(media));
+ }
+ else {
+ return -2;
+ }
}
int tsdp_ctx_local_add_media_2(tsdp_ctx_handle_t* self, const char* media, uint32_t port, const char* proto, ...)
{
- tsdp_ctx_t* ctx = self;
- va_list ap;
-
- if(!ctx || !media || !proto){
- return -1;
- }
-
- if(ctx->local){
- int ret;
- va_start(ap, proto);
- ret = tsdp_message_add_media_2(ctx->local, media, port, proto, &ap);
- va_end(ap);
- return ret;
- }
- else return -2;
+ tsdp_ctx_t* ctx = self;
+ va_list ap;
+
+ if(!ctx || !media || !proto) {
+ return -1;
+ }
+
+ if(ctx->local) {
+ int ret;
+ va_start(ap, proto);
+ ret = tsdp_message_add_media_2(ctx->local, media, port, proto, &ap);
+ va_end(ap);
+ return ret;
+ }
+ else {
+ return -2;
+ }
}
const tsdp_message_t* tsdp_ctx_remote_get_sdp(const tsdp_ctx_handle_t* self)
{
- const tsdp_ctx_t* ctx = self;
-
- if(ctx){
- return ctx->remote;
- }
- else return tsk_null;
+ const tsdp_ctx_t* ctx = self;
+
+ if(ctx) {
+ return ctx->remote;
+ }
+ else {
+ return tsk_null;
+ }
}
const tsdp_message_t* tsdp_ctx_negotiated_get_sdp(const tsdp_ctx_handle_t* self)
{
- const tsdp_ctx_t* ctx = self;
-
- if(ctx){
- return ctx->negotiated;
- }
- else return tsk_null;
+ const tsdp_ctx_t* ctx = self;
+
+ if(ctx) {
+ return ctx->negotiated;
+ }
+ else {
+ return tsk_null;
+ }
}
@@ -184,28 +197,27 @@ const tsdp_message_t* tsdp_ctx_negotiated_get_sdp(const tsdp_ctx_handle_t* self)
//
static void* tsdp_ctx_create(void * self, va_list * app)
{
- tsdp_ctx_t *ctx = self;
- if(ctx){
- }
- return self;
+ tsdp_ctx_t *ctx = self;
+ if(ctx) {
+ }
+ return self;
}
static void* tsdp_ctx_destroy(void * self)
-{
- tsdp_ctx_t *ctx = self;
- if(ctx){
- TSK_OBJECT_SAFE_FREE(ctx->local);
- TSK_OBJECT_SAFE_FREE(ctx->remote);
- TSK_OBJECT_SAFE_FREE(ctx->negotiated);
- }
- return self;
+{
+ tsdp_ctx_t *ctx = self;
+ if(ctx) {
+ TSK_OBJECT_SAFE_FREE(ctx->local);
+ TSK_OBJECT_SAFE_FREE(ctx->remote);
+ TSK_OBJECT_SAFE_FREE(ctx->negotiated);
+ }
+ return self;
}
-static const tsk_object_def_t tsdp_ctx_def_s =
-{
- sizeof(tsdp_ctx_t),
- tsdp_ctx_create,
- tsdp_ctx_destroy,
- tsk_null,
+static const tsk_object_def_t tsdp_ctx_def_s = {
+ sizeof(tsdp_ctx_t),
+ tsdp_ctx_create,
+ tsdp_ctx_destroy,
+ tsk_null,
};
const tsk_object_def_t *tsdp_ctx_def_t = &tsdp_ctx_def_s;
diff --git a/tinySDP/src/tsdp_message.c b/tinySDP/src/tsdp_message.c
index 7be242f..d69767d 100755
--- a/tinySDP/src/tsdp_message.c
+++ b/tinySDP/src/tsdp_message.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,328 +40,328 @@
/*== Predicate function to find tsdp_header_t object by type. */
static int __pred_find_header_by_type(const tsk_list_item_t *item, const void *tsdp_htype)
{
- if(item && item->data){
- tsdp_header_t *header = item->data;
- tsdp_header_type_t htype = *((tsdp_header_type_t*)tsdp_htype);
- return (header->type - htype);
- }
- return -1;
+ if(item && item->data) {
+ tsdp_header_t *header = item->data;
+ tsdp_header_type_t htype = *((tsdp_header_type_t*)tsdp_htype);
+ return (header->type - htype);
+ }
+ return -1;
}
/*== Predicate function to find tsdp_header_t object by name. */
static int __pred_find_header_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data && name){
- tsdp_header_t *header = item->data;
- return tsdp_header_get_nameex(header) - *((const char*)name);
- }
- return -1;
+ if(item && item->data && name) {
+ tsdp_header_t *header = item->data;
+ return tsdp_header_get_nameex(header) - *((const char*)name);
+ }
+ return -1;
}
/*== Predicate function to find media object by name. */
static int __pred_find_media_by_name(const tsk_list_item_t *item, const void *name)
{
- if(item && item->data && name){
- tsdp_header_t *header = item->data;
- if(header->type == tsdp_htype_M){
- return tsk_stricmp(((tsdp_header_M_t*)header)->media, (const char*)name);
- }
- }
- return -1;
+ if(item && item->data && name) {
+ tsdp_header_t *header = item->data;
+ if(header->type == tsdp_htype_M) {
+ return tsk_stricmp(((tsdp_header_M_t*)header)->media, (const char*)name);
+ }
+ }
+ return -1;
}
tsdp_message_t* tsdp_message_create()
{
- return tsk_object_new(tsdp_message_def_t);
+ return tsk_object_new(tsdp_message_def_t);
}
/*== Add headers/fmt to the media line */
int __add_headers(tsdp_header_M_t* m, va_list *ap)
{
- const tsk_object_def_t* objdef;
- tsdp_header_t *header;
- tsdp_fmt_t* fmt;
-
- if(!m){
- return -1;
- }
-
- while((objdef = va_arg(*ap, const tsk_object_def_t*))){
- if(objdef == tsdp_fmt_def_t){
- if((fmt = tsk_object_new_2(objdef, ap))){
- tsk_list_push_back_data(m->FMTs, (void**)&fmt);
- }
- }
- else{
- if((header = tsk_object_new_2(objdef, ap))){
- tsdp_header_M_add(m, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- }
- return 0;
+ const tsk_object_def_t* objdef;
+ tsdp_header_t *header;
+ tsdp_fmt_t* fmt;
+
+ if(!m) {
+ return -1;
+ }
+
+ while((objdef = va_arg(*ap, const tsk_object_def_t*))) {
+ if(objdef == tsdp_fmt_def_t) {
+ if((fmt = tsk_object_new_2(objdef, ap))) {
+ tsk_list_push_back_data(m->FMTs, (void**)&fmt);
+ }
+ }
+ else {
+ if((header = tsk_object_new_2(objdef, ap))) {
+ tsdp_header_M_add(m, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ }
+ return 0;
}
int tsdp_message_add_header(tsdp_message_t *self, const tsdp_header_t *hdr)
{
- if(self && hdr){
- tsdp_header_t *header = tsk_object_ref((void*)hdr);
- tsk_list_push_ascending_data(self->headers, (void**)&header); // Very important: Headers MUST appear in a fixed order (see ranks def).
+ if(self && hdr) {
+ tsdp_header_t *header = tsk_object_ref((void*)hdr);
+ tsk_list_push_ascending_data(self->headers, (void**)&header); // Very important: Headers MUST appear in a fixed order (see ranks def).
- return 0;
- }
- return -1;
+ return 0;
+ }
+ return -1;
}
int tsdp_message_add_headers(tsdp_message_t *self, ...)
{
- const tsk_object_def_t* objdef;
- tsdp_header_t *header;
- va_list ap;
-
- if(!self){
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if((header = tsk_object_new_2(objdef, &ap))){
- tsdp_message_add_header(self, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- va_end(ap);
-
- return 0;
+ const tsk_object_def_t* objdef;
+ tsdp_header_t *header;
+ va_list ap;
+
+ if(!self) {
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ tsdp_message_add_header(self, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
const tsdp_header_t *tsdp_message_get_headerAt(const tsdp_message_t *self, tsdp_header_type_t type, tsk_size_t index)
{
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
- const tsdp_header_t *hdr;
-
- if(!self || !self->headers){
- return tsk_null;
- }
-
- tsk_list_foreach(item, self->headers){
- hdr = item->data;
- if(hdr->type == type){
- if(pos++ >= index){
- return hdr;
- }
- }
- }
-
- return tsk_null;
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+ const tsdp_header_t *hdr;
+
+ if(!self || !self->headers) {
+ return tsk_null;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ hdr = item->data;
+ if(hdr->type == type) {
+ if(pos++ >= index) {
+ return hdr;
+ }
+ }
+ }
+
+ return tsk_null;
}
const tsdp_header_t *tsdp_message_get_header(const tsdp_message_t *self, tsdp_header_type_t type)
{
- return tsdp_message_get_headerAt(self, type, 0);
+ return tsdp_message_get_headerAt(self, type, 0);
}
const tsdp_header_A_t* tsdp_message_get_headerA_at(const tsdp_message_t* self, const char* field, tsk_size_t index)
{
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
- const tsdp_header_t *hdr;
- const tsdp_header_A_t *hdrA;
-
- if(!self || !self->headers){
- return tsk_null;
- }
-
- tsk_list_foreach(item, self->headers){
- hdr = item->data;
- if((hdr->type == tsdp_htype_A) && (hdrA = (const tsdp_header_A_t *)hdr) && (tsk_striequals(hdrA->field, field))){
- if(pos++ >= index){
- return hdrA;
- }
- }
- }
-
- return tsk_null;
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+ const tsdp_header_t *hdr;
+ const tsdp_header_A_t *hdrA;
+
+ if(!self || !self->headers) {
+ return tsk_null;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ hdr = item->data;
+ if((hdr->type == tsdp_htype_A) && (hdrA = (const tsdp_header_A_t *)hdr) && (tsk_striequals(hdrA->field, field))) {
+ if(pos++ >= index) {
+ return hdrA;
+ }
+ }
+ }
+
+ return tsk_null;
}
const tsdp_header_A_t* tsdp_message_get_headerA(const tsdp_message_t* self, const char* field)
{
- return tsdp_message_get_headerA_at(self, field, 0);
+ return tsdp_message_get_headerA_at(self, field, 0);
}
const tsdp_header_t *tsdp_message_get_headerByName(const tsdp_message_t *self, char name)
{
- if(self){
- return tsk_list_find_object_by_pred(self->headers, __pred_find_header_by_name, &name);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(self) {
+ return tsk_list_find_object_by_pred(self->headers, __pred_find_header_by_name, &name);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
}
int tsdp_message_get_sess_version(const tsdp_message_t *self, uint32_t *version)
{
- const tsdp_header_O_t* O;
- if (!self || !version) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(self, tsdp_htype_O))) {
- *version = O->sess_version;
- return 0;
- }
- return -2;
+ const tsdp_header_O_t* O;
+ if (!self || !version) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if ((O = (const tsdp_header_O_t*)tsdp_message_get_header(self, tsdp_htype_O))) {
+ *version = O->sess_version;
+ return 0;
+ }
+ return -2;
}
int tsdp_message_serialize(const tsdp_message_t *self, tsk_buffer_t *output)
{
- const tsk_list_item_t* item;
-
- if(!self || !output){
- return -1;
- }
-
- tsk_list_foreach(item, self->headers){
- if(tsdp_header_serialize(TSDP_HEADER(item->data), output)){
- // Abort?
- }
- }
-
- return 0;
+ const tsk_list_item_t* item;
+
+ if(!self || !output) {
+ return -1;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ if(tsdp_header_serialize(TSDP_HEADER(item->data), output)) {
+ // Abort?
+ }
+ }
+
+ return 0;
}
char* tsdp_message_tostring(const tsdp_message_t *self)
{
- tsk_buffer_t* output = tsk_buffer_create_null();
- char* ret = tsk_null;
+ tsk_buffer_t* output = tsk_buffer_create_null();
+ char* ret = tsk_null;
- if(!tsdp_message_serialize(self, output)){
- ret = tsk_strndup(TSK_BUFFER_DATA(output), TSK_BUFFER_SIZE(output));
- }
+ if(!tsdp_message_serialize(self, output)) {
+ ret = tsk_strndup(TSK_BUFFER_DATA(output), TSK_BUFFER_SIZE(output));
+ }
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
tsdp_message_t* tsdp_message_create_empty(const char* addr, tsk_bool_t ipv6, uint32_t version)
{
- tsdp_message_t* ret = 0;
-
- if(!(ret = tsdp_message_create())){
- return tsk_null;
- }
-
- /* RFC 3264 - 5 Generating the Initial Offer
- The numeric value of the session id and version in the o line MUST be
- representable with a 64 bit signed integer. The initial value of the version MUST be less than
- (2**62)-1, to avoid rollovers.
- */
- TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_V_VA_ARGS(0));
- TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_O_VA_ARGS(
- TSDP_LINE_O_USERNAME_DEFAULT,
- TSDP_LINE_O_SESSION_ID_DEFAULT,
- version,
- "IN",
- ipv6 ? "IP6" : "IP4",
- addr));
-
- /* RFC 3264 - 5 Generating the Initial Offer
- The SDP "s=" line conveys the subject of the session, which is
- reasonably defined for multicast, but ill defined for unicast. For
- unicast sessions, it is RECOMMENDED that it consist of a single space
- character (0x20) or a dash (-).
-
- Unfortunately, SDP does not allow the "s=" line to be empty.
- */
- TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_S_VA_ARGS(TSDP_LINE_S_VALUE_DEFAULT));
-
- /* RFC 3264 - 5 Generating the Initial Offer
- The SDP "t=" line conveys the time of the session. Generally,
- streams for unicast sessions are created and destroyed through
- external signaling means, such as SIP. In that case, the "t=" line
- SHOULD have a value of "0 0".
- */
- TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_T_VA_ARGS(0, 0));
-
- return ret;
+ tsdp_message_t* ret = 0;
+
+ if(!(ret = tsdp_message_create())) {
+ return tsk_null;
+ }
+
+ /* RFC 3264 - 5 Generating the Initial Offer
+ The numeric value of the session id and version in the o line MUST be
+ representable with a 64 bit signed integer. The initial value of the version MUST be less than
+ (2**62)-1, to avoid rollovers.
+ */
+ TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_V_VA_ARGS(0));
+ TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_O_VA_ARGS(
+ TSDP_LINE_O_USERNAME_DEFAULT,
+ TSDP_LINE_O_SESSION_ID_DEFAULT,
+ version,
+ "IN",
+ ipv6 ? "IP6" : "IP4",
+ addr));
+
+ /* RFC 3264 - 5 Generating the Initial Offer
+ The SDP "s=" line conveys the subject of the session, which is
+ reasonably defined for multicast, but ill defined for unicast. For
+ unicast sessions, it is RECOMMENDED that it consist of a single space
+ character (0x20) or a dash (-).
+
+ Unfortunately, SDP does not allow the "s=" line to be empty.
+ */
+ TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_S_VA_ARGS(TSDP_LINE_S_VALUE_DEFAULT));
+
+ /* RFC 3264 - 5 Generating the Initial Offer
+ The SDP "t=" line conveys the time of the session. Generally,
+ streams for unicast sessions are created and destroyed through
+ external signaling means, such as SIP. In that case, the "t=" line
+ SHOULD have a value of "0 0".
+ */
+ TSDP_MESSAGE_ADD_HEADER(ret, TSDP_HEADER_T_VA_ARGS(0, 0));
+
+ return ret;
}
tsdp_message_t* tsdp_message_clone(const tsdp_message_t *self)
{
- tsdp_message_t* clone = tsk_null;
- tsk_list_item_t* item;
- tsdp_header_t* header;
+ tsdp_message_t* clone = tsk_null;
+ tsk_list_item_t* item;
+ tsdp_header_t* header;
- if(!self){
- goto bail;
- }
+ if(!self) {
+ goto bail;
+ }
- if((clone = tsdp_message_create())){
- tsk_list_foreach(item, self->headers){
- if((header = tsdp_header_clone(TSDP_HEADER(item->data)))){
- tsk_list_push_back_data(clone->headers, (void**)&header);
- }
- }
- }
+ if((clone = tsdp_message_create())) {
+ tsk_list_foreach(item, self->headers) {
+ if((header = tsdp_header_clone(TSDP_HEADER(item->data)))) {
+ tsk_list_push_back_data(clone->headers, (void**)&header);
+ }
+ }
+ }
bail:
- return clone;
+ return clone;
}
int tsdp_message_add_media(tsdp_message_t *self, const char* media, uint32_t port, const char* proto, ...)
{
- va_list ap;
- int ret;
-
- va_start(ap, proto);
- ret = tsdp_message_add_media_2(self, media, port, proto, &ap);
- va_end(ap);
-
- return ret;
+ va_list ap;
+ int ret;
+
+ va_start(ap, proto);
+ ret = tsdp_message_add_media_2(self, media, port, proto, &ap);
+ va_end(ap);
+
+ return ret;
}
int tsdp_message_add_media_2(tsdp_message_t *self, const char* media, uint32_t port, const char* proto, va_list *ap)
{
- int ret = -1;
- tsdp_header_M_t* m;
-
- if(!self){
- return -1;
- }
-
- if((m = tsdp_header_M_create(media, port, proto))){
- __add_headers(m, ap);
-
- ret = tsdp_message_add_header(self, TSDP_HEADER(m));
- TSK_OBJECT_SAFE_FREE(m);
- }
-
- return ret;
+ int ret = -1;
+ tsdp_header_M_t* m;
+
+ if(!self) {
+ return -1;
+ }
+
+ if((m = tsdp_header_M_create(media, port, proto))) {
+ __add_headers(m, ap);
+
+ ret = tsdp_message_add_header(self, TSDP_HEADER(m));
+ TSK_OBJECT_SAFE_FREE(m);
+ }
+
+ return ret;
}
int tsdp_message_remove_media(tsdp_message_t *self, const char* media)
{
- if(!self || !media){
- return 0;
- }
+ if(!self || !media) {
+ return 0;
+ }
- tsk_list_remove_item_by_pred(self->headers, __pred_find_media_by_name, media);
- return 0;
+ tsk_list_remove_item_by_pred(self->headers, __pred_find_media_by_name, media);
+ return 0;
}
const tsdp_header_M_t* tsdp_message_find_media(const tsdp_message_t *self, const char* media)
{
- if(self && media){
- const tsk_list_item_t* item;
- if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))){
- return TSDP_HEADER_M(item->data);
- }
- }
- return tsk_null;
+ if(self && media) {
+ const tsk_list_item_t* item;
+ if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))) {
+ return TSDP_HEADER_M(item->data);
+ }
+ }
+ return tsk_null;
}
@@ -369,95 +369,95 @@ const tsdp_header_M_t* tsdp_message_find_media(const tsdp_message_t *self, const
/* ================= 3GPP TS 34.610 :: Communication HOLD (HOLD) using IP Multimedia (IM) Core ================*/
int tsdp_message_hold(tsdp_message_t* self, const char* media)
{
- tsdp_header_M_t* M;
- const tsk_list_item_t* item;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // 3GPP TS 34.610-900 - 4.5.2.1 Actions at the invoking UE
- if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))){
- M = TSDP_HEADER_M(item->data);
- tsdp_header_M_hold(M, tsk_true);
- }
-
- return 0;
+ tsdp_header_M_t* M;
+ const tsk_list_item_t* item;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // 3GPP TS 34.610-900 - 4.5.2.1 Actions at the invoking UE
+ if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))) {
+ M = TSDP_HEADER_M(item->data);
+ tsdp_header_M_hold(M, tsk_true);
+ }
+
+ return 0;
}
int tsdp_message_resume(tsdp_message_t* self, const char* media)
{
- tsdp_header_M_t* M;
- const tsk_list_item_t* item;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- // 3GPP TS 34.610-900 - 4.5.2.1 Actions at the invoking UE
- if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))){
- M = TSDP_HEADER_M(item->data);
- tsdp_header_M_resume(M, tsk_true);
- }
-
- return 0;
+ tsdp_header_M_t* M;
+ const tsk_list_item_t* item;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ // 3GPP TS 34.610-900 - 4.5.2.1 Actions at the invoking UE
+ if((item = tsk_list_find_item_by_pred(self->headers, __pred_find_media_by_name, media))) {
+ M = TSDP_HEADER_M(item->data);
+ tsdp_header_M_resume(M, tsk_true);
+ }
+
+ return 0;
}
tsk_bool_t tsdp_message_is_ice_enabled(const tsdp_message_t *self, tsk_size_t media_index)
{
- if (self) {
- const tsdp_header_A_t *A;
- const tsdp_header_M_t *M;
- tsk_bool_t have_ufrag = tsk_false, have_pwd = tsk_false, have_candidates = tsk_false;
- tsk_size_t index0 = 0;
-
- // session level attributes
- if ((A = tsdp_message_get_headerA(self, "ice-ufrag"))) {
- have_ufrag = tsk_true;
- }
- if ((A = tsdp_message_get_headerA(self, "ice-pwd"))) {
- have_pwd = tsk_true;
- }
- while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self, tsdp_htype_M, index0))) {
- if (index0 == media_index) {
- if ((A = tsdp_header_M_findA(M, "ice-ufrag"))) {
- have_ufrag = tsk_true;
- }
- if ((A = tsdp_header_M_findA(M, "ice-pwd"))) {
- have_pwd = tsk_true;
- }
- have_candidates = (tsdp_header_M_findA_at(M, "candidate", 0) != tsk_null);
- return have_ufrag && have_pwd && have_candidates;
- }
- ++index0;
- }
- }
- return tsk_false;
+ if (self) {
+ const tsdp_header_A_t *A;
+ const tsdp_header_M_t *M;
+ tsk_bool_t have_ufrag = tsk_false, have_pwd = tsk_false, have_candidates = tsk_false;
+ tsk_size_t index0 = 0;
+
+ // session level attributes
+ if ((A = tsdp_message_get_headerA(self, "ice-ufrag"))) {
+ have_ufrag = tsk_true;
+ }
+ if ((A = tsdp_message_get_headerA(self, "ice-pwd"))) {
+ have_pwd = tsk_true;
+ }
+ while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self, tsdp_htype_M, index0))) {
+ if (index0 == media_index) {
+ if ((A = tsdp_header_M_findA(M, "ice-ufrag"))) {
+ have_ufrag = tsk_true;
+ }
+ if ((A = tsdp_header_M_findA(M, "ice-pwd"))) {
+ have_pwd = tsk_true;
+ }
+ have_candidates = (tsdp_header_M_findA_at(M, "candidate", 0) != tsk_null);
+ return have_ufrag && have_pwd && have_candidates;
+ }
+ ++index0;
+ }
+ }
+ return tsk_false;
}
tsk_bool_t tsdp_message_is_ice_restart(const tsdp_message_t *self, tsk_size_t media_index)
{
- // https://tools.ietf.org/html/rfc5245#section-9.1.1.1
- if (self) {
- const tsdp_header_C_t *C;
- const tsdp_header_M_t *M;
- tsk_size_t index0 = 0;
-
- // Session level
- if ((C = (const tsdp_header_C_t*)tsdp_message_get_header(self, tsdp_htype_C)) && C->addr){
- if (tsk_striequals("0.0.0.0", C->addr)) {
- return tsk_true;
- }
- }
- // Media level
- while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self, tsdp_htype_M, index0))) {
- if (index0 == media_index) {
- return (M->C && M->C->addr && tsk_striequals("0.0.0.0", M->C->addr));
- }
- ++index0;
- }
- }
- return tsk_false;
+ // https://tools.ietf.org/html/rfc5245#section-9.1.1.1
+ if (self) {
+ const tsdp_header_C_t *C;
+ const tsdp_header_M_t *M;
+ tsk_size_t index0 = 0;
+
+ // Session level
+ if ((C = (const tsdp_header_C_t*)tsdp_message_get_header(self, tsdp_htype_C)) && C->addr) {
+ if (tsk_striequals("0.0.0.0", C->addr)) {
+ return tsk_true;
+ }
+ }
+ // Media level
+ while ((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(self, tsdp_htype_M, index0))) {
+ if (index0 == media_index) {
+ return (M->C && M->C->addr && tsk_striequals("0.0.0.0", M->C->addr));
+ }
+ ++index0;
+ }
+ }
+ return tsk_false;
}
@@ -477,27 +477,26 @@ tsk_bool_t tsdp_message_is_ice_restart(const tsdp_message_t *self, tsk_size_t me
//
static void* tsdp_message_ctor(void * self, va_list * app)
{
- tsdp_message_t *message = self;
- if(message){
- message->headers = tsk_list_create();
- }
- return self;
+ tsdp_message_t *message = self;
+ if(message) {
+ message->headers = tsk_list_create();
+ }
+ return self;
}
static void* tsdp_message_dtor(void * self)
-{
- tsdp_message_t *message = self;
- if(message){
- TSK_OBJECT_SAFE_FREE(message->headers);
- }
- return self;
+{
+ tsdp_message_t *message = self;
+ if(message) {
+ TSK_OBJECT_SAFE_FREE(message->headers);
+ }
+ return self;
}
-static const tsk_object_def_t tsdp_message_def_s =
-{
- sizeof(tsdp_message_t),
- tsdp_message_ctor,
- tsdp_message_dtor,
- tsk_null,
+static const tsk_object_def_t tsdp_message_def_s = {
+ sizeof(tsdp_message_t),
+ tsdp_message_ctor,
+ tsdp_message_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsdp_message_def_t = &tsdp_message_def_s;
diff --git a/tinySDP/test/stdafx.c b/tinySDP/test/stdafx.c
index 4cc45f4..835556c 100755
--- a/tinySDP/test/stdafx.c
+++ b/tinySDP/test/stdafx.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySDP/test/stdafx.h b/tinySDP/test/stdafx.h
index baaf88a..d3c80ec 100755
--- a/tinySDP/test/stdafx.h
+++ b/tinySDP/test/stdafx.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySDP/test/targetver.h b/tinySDP/test/targetver.h
index 722ae77..c1df665 100755
--- a/tinySDP/test/targetver.h
+++ b/tinySDP/test/targetver.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,8 +22,8 @@
#ifndef TSDP_TEST_TARGETVER_H
#define TSDP_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinySDP/test/test.c b/tinySDP/test/test.c
index 75ea2e1..6cdca41 100755
--- a/tinySDP/test/test.c
+++ b/tinySDP/test/test.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,22 +49,22 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- do
- {
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
-
+ do {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
+
#if RUN_TEST_ALL || RUN_TEST_PARSER
- test_parser();
+ test_parser();
#endif
#if RUN_TEST_ALL || RUN_TEST_SOA
- test_soa();
+ test_soa();
#endif
#if RUN_TEST_ALL || RUN_TEST_RFC5939
- test_rfc5939();
+ test_rfc5939();
#endif
- } while(RUN_TEST_LOOP);
+ }
+ while(RUN_TEST_LOOP);
}
diff --git a/tinySDP/test/test_parser.h b/tinySDP/test/test_parser.h
index e53677a..5f4a219 100755
--- a/tinySDP/test/test_parser.h
+++ b/tinySDP/test/test_parser.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -60,7 +60,7 @@
"a=rtpmap:31 H261/90000\r\n" \
"a=rtpmap:32 MPV/90000\r\n" \
"a=recvonly\r\n"
-
+
#define SDP_MSG2 \
"v=0\r\n"
@@ -96,191 +96,191 @@ void test_M();
void test_parser()
{
- tsdp_message_t *message = tsk_null;
- char* str;
-
- //test_caps();
- //test_holdresume();
- //test_M();
-
- //
- // deserialize/serialize the message
- //
- if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))){
-
- /* serialize the message */
- if((str = tsdp_message_tostring(message))){
- TSK_DEBUG_INFO("SDP Message=\n%s", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(message);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse SDP message.");
- }
-
- //
- // create empty message
- //
- if((message = tsdp_message_create_empty("127.0.0.1", tsk_false, 1))){
-
- /* add media */
- tsdp_message_add_media(message, "audio", 8956, "RTP/AVP",
- TSDP_HEADER_I_VA_ARGS("this is the information line"),
-
- // pcmu
- TSDP_FMT_VA_ARGS("0"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "0 pcmu/8000"),
- TSDP_HEADER_A_VA_ARGS("3gpp_sync_info", "No Sync"),
-
- // pcma
- TSDP_FMT_VA_ARGS("8"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "8 pcma/8000"),
-
- // telephone event
- TSDP_FMT_VA_ARGS("101"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "101 telephone-event/8000"),
- TSDP_HEADER_A_VA_ARGS("fmtp", "101 0-11"),
-
-
- // common values
- TSDP_HEADER_A_VA_ARGS("sendrecv", tsk_null),
- TSDP_HEADER_A_VA_ARGS("ptime", "20"),
-
- tsk_null);
-
- //tsdp_message_remove_media(message, "video");
- //tsdp_message_remove_media(message, "audio");
-
- /* serialize the message */
- if((str = tsdp_message_tostring(message))){
- TSK_DEBUG_INFO("\n\nEmpty SDP Message=\n%s", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(message);
- }
+ tsdp_message_t *message = tsk_null;
+ char* str;
+
+ //test_caps();
+ //test_holdresume();
+ //test_M();
+
+ //
+ // deserialize/serialize the message
+ //
+ if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))) {
+
+ /* serialize the message */
+ if((str = tsdp_message_tostring(message))) {
+ TSK_DEBUG_INFO("SDP Message=\n%s", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse SDP message.");
+ }
+
+ //
+ // create empty message
+ //
+ if((message = tsdp_message_create_empty("127.0.0.1", tsk_false, 1))) {
+
+ /* add media */
+ tsdp_message_add_media(message, "audio", 8956, "RTP/AVP",
+ TSDP_HEADER_I_VA_ARGS("this is the information line"),
+
+ // pcmu
+ TSDP_FMT_VA_ARGS("0"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "0 pcmu/8000"),
+ TSDP_HEADER_A_VA_ARGS("3gpp_sync_info", "No Sync"),
+
+ // pcma
+ TSDP_FMT_VA_ARGS("8"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "8 pcma/8000"),
+
+ // telephone event
+ TSDP_FMT_VA_ARGS("101"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "101 telephone-event/8000"),
+ TSDP_HEADER_A_VA_ARGS("fmtp", "101 0-11"),
+
+
+ // common values
+ TSDP_HEADER_A_VA_ARGS("sendrecv", tsk_null),
+ TSDP_HEADER_A_VA_ARGS("ptime", "20"),
+
+ tsk_null);
+
+ //tsdp_message_remove_media(message, "video");
+ //tsdp_message_remove_media(message, "audio");
+
+ /* serialize the message */
+ if((str = tsdp_message_tostring(message))) {
+ TSK_DEBUG_INFO("\n\nEmpty SDP Message=\n%s", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
}
void test_caps()
{
- tsdp_message_t *message = tsk_null;
- char* str;
-
- if((message = tsdp_message_create_empty("100.3.6.6", tsk_false, 1))){
-
- tsdp_message_add_headers(message,
- TSDP_HEADER_C_VA_ARGS("IN", "IP4", "192.0.2.4"),
- TSDP_HEADER_E_VA_ARGS("j.doe@example.com (Jane Doe)"),
- TSDP_HEADER_P_VA_ARGS("+44 (123)456789"),
-
- tsk_null);
-
- /* add (audio) media */
- tsdp_message_add_media(message, "audio", 0, "RTP/AVP",
- TSDP_HEADER_I_VA_ARGS("this is the (audio)information line"),
-
- // PCMU
- TSDP_FMT_VA_ARGS("0"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "0 PCMU/8000"),
-
- // 1016
- TSDP_FMT_VA_ARGS("1"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "1 1016/8000"),
-
- // GSM
- TSDP_FMT_VA_ARGS("3"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "3 GSM/8000"),
-
- tsk_null);
-
- /* add (video) media */
- tsdp_message_add_media(message, "video", 0, "RTP/AVP",
- TSDP_HEADER_I_VA_ARGS("this is the (video)information line"),
-
- // H261
- TSDP_FMT_VA_ARGS("31"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "31 H261/90000"),
-
- // H263
- TSDP_FMT_VA_ARGS("34"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "34 H263/90000"),
-
- tsk_null);
-
- /* serialize the message */
- if((str = tsdp_message_tostring(message))){
- TSK_DEBUG_INFO("\n\nCapabilities SDP Message=\n%s", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(message);
- }
+ tsdp_message_t *message = tsk_null;
+ char* str;
+
+ if((message = tsdp_message_create_empty("100.3.6.6", tsk_false, 1))) {
+
+ tsdp_message_add_headers(message,
+ TSDP_HEADER_C_VA_ARGS("IN", "IP4", "192.0.2.4"),
+ TSDP_HEADER_E_VA_ARGS("j.doe@example.com (Jane Doe)"),
+ TSDP_HEADER_P_VA_ARGS("+44 (123)456789"),
+
+ tsk_null);
+
+ /* add (audio) media */
+ tsdp_message_add_media(message, "audio", 0, "RTP/AVP",
+ TSDP_HEADER_I_VA_ARGS("this is the (audio)information line"),
+
+ // PCMU
+ TSDP_FMT_VA_ARGS("0"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "0 PCMU/8000"),
+
+ // 1016
+ TSDP_FMT_VA_ARGS("1"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "1 1016/8000"),
+
+ // GSM
+ TSDP_FMT_VA_ARGS("3"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "3 GSM/8000"),
+
+ tsk_null);
+
+ /* add (video) media */
+ tsdp_message_add_media(message, "video", 0, "RTP/AVP",
+ TSDP_HEADER_I_VA_ARGS("this is the (video)information line"),
+
+ // H261
+ TSDP_FMT_VA_ARGS("31"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "31 H261/90000"),
+
+ // H263
+ TSDP_FMT_VA_ARGS("34"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "34 H263/90000"),
+
+ tsk_null);
+
+ /* serialize the message */
+ if((str = tsdp_message_tostring(message))) {
+ TSK_DEBUG_INFO("\n\nCapabilities SDP Message=\n%s", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
}
void test_holdresume()
{
- tsdp_message_t *message = tsk_null;
- char* str;
-
- if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))){
-
- // hold audio
- tsdp_message_hold(message, "audio");
- tsdp_message_hold(message, "audio");
- tsdp_message_hold(message, "video");
- tsdp_message_resume(message, "video");
-
- /* serialize the message */
- if((str = tsdp_message_tostring(message))){
- TSK_DEBUG_INFO("SDP Message=\n%s", str);
- TSK_FREE(str);
- }
-
- TSK_OBJECT_SAFE_FREE(message);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse SDP message.");
- }
+ tsdp_message_t *message = tsk_null;
+ char* str;
+
+ if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))) {
+
+ // hold audio
+ tsdp_message_hold(message, "audio");
+ tsdp_message_hold(message, "audio");
+ tsdp_message_hold(message, "video");
+ tsdp_message_resume(message, "video");
+
+ /* serialize the message */
+ if((str = tsdp_message_tostring(message))) {
+ TSK_DEBUG_INFO("SDP Message=\n%s", str);
+ TSK_FREE(str);
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse SDP message.");
+ }
}
void test_M()
{
- char* rtpmap, *fmtp;
- const tsk_list_item_t* item;
- const tsdp_header_M_t* M;
-
- tsdp_message_t *message = tsk_null;
-
- if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))){
-
- tsk_list_foreach(item, message->headers){
- if(!(item->data) || (TSDP_HEADER(item->data)->type != tsdp_htype_M)){
- continue;
- }
- M = (const tsdp_header_M_t*)(item->data);
-
- /* get rtpmap */
- if((rtpmap = tsdp_header_M_get_rtpmap(M, "98"))){
- TSK_DEBUG_INFO("RTPMAP=%s", rtpmap);
- TSK_FREE(rtpmap);
- }
-
- /* get fmtp */
- if((fmtp = tsdp_header_M_get_fmtp(M, "98"))){
- TSK_DEBUG_INFO("FMTP=%s", fmtp);
- TSK_FREE(fmtp);
- }
- }
-
- TSK_OBJECT_SAFE_FREE(message);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse SDP message.");
- }
-
+ char* rtpmap, *fmtp;
+ const tsk_list_item_t* item;
+ const tsdp_header_M_t* M;
+
+ tsdp_message_t *message = tsk_null;
+
+ if((message = tsdp_message_parse(SDP_MSG_TO_TEST, strlen(SDP_MSG_TO_TEST)))) {
+
+ tsk_list_foreach(item, message->headers) {
+ if(!(item->data) || (TSDP_HEADER(item->data)->type != tsdp_htype_M)) {
+ continue;
+ }
+ M = (const tsdp_header_M_t*)(item->data);
+
+ /* get rtpmap */
+ if((rtpmap = tsdp_header_M_get_rtpmap(M, "98"))) {
+ TSK_DEBUG_INFO("RTPMAP=%s", rtpmap);
+ TSK_FREE(rtpmap);
+ }
+
+ /* get fmtp */
+ if((fmtp = tsdp_header_M_get_fmtp(M, "98"))) {
+ TSK_DEBUG_INFO("FMTP=%s", fmtp);
+ TSK_FREE(fmtp);
+ }
+ }
+
+ TSK_OBJECT_SAFE_FREE(message);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse SDP message.");
+ }
+
}
#endif /* _TEST_SDPPARSER_H */
diff --git a/tinySDP/test/test_soa.h b/tinySDP/test/test_soa.h
index e0dc150..1e24d20 100755
--- a/tinySDP/test/test_soa.h
+++ b/tinySDP/test/test_soa.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,68 +34,68 @@
void test_create_sdp()
{
- tsdp_ctx_handle_t* ctx = TSDP_CTX_CREATE();
- const tsdp_message_t* sdp;
- char* str;
-
- // Create local SDP from string
- tsdp_ctx_local_create_sdp_2(ctx, SDP, strlen(SDP));
- if((sdp = tsdp_ctx_local_get_sdp(ctx))){
- if((str = tsdp_message_tostring(sdp))){
- TSK_DEBUG_INFO("Local SDP (2)=\n%s", str);
- TSK_FREE(str);
- }
- }
-
- // Create local SDP from object
- tsdp_ctx_local_create_sdp(ctx, sdp);
- if((sdp = tsdp_ctx_local_get_sdp(ctx))){
- if((str = tsdp_message_tostring(sdp))){
- TSK_DEBUG_INFO("Local SDP (1)=\n%s", str);
- TSK_FREE(str);
- }
- }
-
- // Add media to the local sdp
- tsdp_ctx_local_add_media_2(ctx, "audio", 0, "RTP/AVP",
- TSDP_HEADER_I_VA_ARGS("this is the (audio)information line"),
-
- // PCMU
- TSDP_FMT_VA_ARGS("0"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "0 PCMU/8000"),
-
- // 1016
- TSDP_FMT_VA_ARGS("1"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "1 1016/8000"),
-
- // GSM
- TSDP_FMT_VA_ARGS("3"),
- TSDP_HEADER_A_VA_ARGS("rtpmap", "3 GSM/8000"),
-
- tsk_null);
- if((str = tsdp_message_tostring(sdp))){
- TSK_DEBUG_INFO("Local SDP (audio)=\n%s", str);
- TSK_FREE(str);
- }
-
- // Add headers to the local sdp
- tsdp_ctx_local_add_headers(ctx,
- TSDP_HEADER_E_VA_ARGS("j.doe@example.com (Jane Doe)"),
- TSDP_HEADER_P_VA_ARGS("+44 (123)456789"),
-
- tsk_null);
- if((str = tsdp_message_tostring(sdp))){
- TSK_DEBUG_INFO("Local SDP (headers)=\n%s", str);
- TSK_FREE(str);
- }
-
-
- TSK_OBJECT_SAFE_FREE(ctx);
+ tsdp_ctx_handle_t* ctx = TSDP_CTX_CREATE();
+ const tsdp_message_t* sdp;
+ char* str;
+
+ // Create local SDP from string
+ tsdp_ctx_local_create_sdp_2(ctx, SDP, strlen(SDP));
+ if((sdp = tsdp_ctx_local_get_sdp(ctx))) {
+ if((str = tsdp_message_tostring(sdp))) {
+ TSK_DEBUG_INFO("Local SDP (2)=\n%s", str);
+ TSK_FREE(str);
+ }
+ }
+
+ // Create local SDP from object
+ tsdp_ctx_local_create_sdp(ctx, sdp);
+ if((sdp = tsdp_ctx_local_get_sdp(ctx))) {
+ if((str = tsdp_message_tostring(sdp))) {
+ TSK_DEBUG_INFO("Local SDP (1)=\n%s", str);
+ TSK_FREE(str);
+ }
+ }
+
+ // Add media to the local sdp
+ tsdp_ctx_local_add_media_2(ctx, "audio", 0, "RTP/AVP",
+ TSDP_HEADER_I_VA_ARGS("this is the (audio)information line"),
+
+ // PCMU
+ TSDP_FMT_VA_ARGS("0"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "0 PCMU/8000"),
+
+ // 1016
+ TSDP_FMT_VA_ARGS("1"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "1 1016/8000"),
+
+ // GSM
+ TSDP_FMT_VA_ARGS("3"),
+ TSDP_HEADER_A_VA_ARGS("rtpmap", "3 GSM/8000"),
+
+ tsk_null);
+ if((str = tsdp_message_tostring(sdp))) {
+ TSK_DEBUG_INFO("Local SDP (audio)=\n%s", str);
+ TSK_FREE(str);
+ }
+
+ // Add headers to the local sdp
+ tsdp_ctx_local_add_headers(ctx,
+ TSDP_HEADER_E_VA_ARGS("j.doe@example.com (Jane Doe)"),
+ TSDP_HEADER_P_VA_ARGS("+44 (123)456789"),
+
+ tsk_null);
+ if((str = tsdp_message_tostring(sdp))) {
+ TSK_DEBUG_INFO("Local SDP (headers)=\n%s", str);
+ TSK_FREE(str);
+ }
+
+
+ TSK_OBJECT_SAFE_FREE(ctx);
}
void test_soa()
{
- test_create_sdp();
+ test_create_sdp();
}
diff --git a/tinySIGCOMP/src/adler32.c b/tinySIGCOMP/src/adler32.c
index f7844d1..fe31833 100755
--- a/tinySIGCOMP/src/adler32.c
+++ b/tinySIGCOMP/src/adler32.c
@@ -56,9 +56,9 @@
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
- uLong adler;
- const Bytef *buf;
- uInt len;
+uLong adler;
+const Bytef *buf;
+uInt len;
{
unsigned long sum2;
unsigned n;
@@ -70,17 +70,20 @@ uLong ZEXPORT adler32(adler, buf, len)
/* in case user likes doing a byte at a time, keep it fast */
if (len == 1) {
adler += buf[0];
- if (adler >= BASE)
+ if (adler >= BASE) {
adler -= BASE;
+ }
sum2 += adler;
- if (sum2 >= BASE)
+ if (sum2 >= BASE) {
sum2 -= BASE;
+ }
return adler | (sum2 << 16);
}
/* initial Adler-32 value (deferred check for len == 1 speed) */
- if (buf == Z_NULL)
+ if (buf == Z_NULL) {
return 1L;
+ }
/* in case short lengths are provided, keep it somewhat fast */
if (len < 16) {
@@ -88,8 +91,9 @@ uLong ZEXPORT adler32(adler, buf, len)
adler += *buf++;
sum2 += adler;
}
- if (adler >= BASE)
+ if (adler >= BASE) {
adler -= BASE;
+ }
MOD4(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
@@ -101,7 +105,8 @@ uLong ZEXPORT adler32(adler, buf, len)
do {
DO16(buf); /* 16 sums unrolled */
buf += 16;
- } while (--n);
+ }
+ while (--n);
MOD(adler);
MOD(sum2);
}
@@ -127,9 +132,9 @@ uLong ZEXPORT adler32(adler, buf, len)
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
- uLong adler1;
- uLong adler2;
- z_off_t len2;
+uLong adler1;
+uLong adler2;
+z_off_t len2;
{
unsigned long sum1;
unsigned long sum2;
@@ -142,10 +147,18 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
- if (sum2 > BASE) sum2 -= BASE;
+ if (sum1 > BASE) {
+ sum1 -= BASE;
+ }
+ if (sum1 > BASE) {
+ sum1 -= BASE;
+ }
+ if (sum2 > (BASE << 1)) {
+ sum2 -= (BASE << 1);
+ }
+ if (sum2 > BASE) {
+ sum2 -= BASE;
+ }
return sum1 | (sum2 << 16);
}
#endif // HAS_ZLIB
diff --git a/tinySIGCOMP/src/compress.c b/tinySIGCOMP/src/compress.c
index ca01fbf..6a4e955 100755
--- a/tinySIGCOMP/src/compress.c
+++ b/tinySIGCOMP/src/compress.c
@@ -21,11 +21,11 @@
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
- int level;
+Bytef *dest;
+uLongf *destLen;
+const Bytef *source;
+uLong sourceLen;
+int level;
{
z_stream stream;
int err;
@@ -34,18 +34,24 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
- if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+ if ((uLong)stream.avail_in != sourceLen) {
+ return Z_BUF_ERROR;
+ }
#endif
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
- if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+ if ((uLong)stream.avail_out != *destLen) {
+ return Z_BUF_ERROR;
+ }
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit(&stream, level);
- if (err != Z_OK) return err;
+ if (err != Z_OK) {
+ return err;
+ }
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
@@ -61,10 +67,10 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
+Bytef *dest;
+uLongf *destLen;
+const Bytef *source;
+uLong sourceLen;
{
return compress2(dest, destLen, source, sourceLen, Z_BEST_SPEED);
}
@@ -74,7 +80,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
- uLong sourceLen;
+uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
}
diff --git a/tinySIGCOMP/src/deflate.c b/tinySIGCOMP/src/deflate.c
index a3c208e..feffb39 100755
--- a/tinySIGCOMP/src/deflate.c
+++ b/tinySIGCOMP/src/deflate.c
@@ -53,7 +53,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
+ " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -86,8 +86,8 @@ local void flush_pending OF((z_streamp strm));
local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
#ifndef FASTEST
#ifdef ASMV
- void match_init OF((void)); /* asm code initialization */
- uInt longest_match OF((deflate_state *s, IPos cur_match));
+void match_init OF((void)); /* asm code initialization */
+uInt longest_match OF((deflate_state *s, IPos cur_match));
#else
local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
@@ -122,32 +122,34 @@ local void check_match OF((deflate_state *s, IPos start, IPos match,
* found for specific files.
*/
typedef struct config_s {
- ush good_length; /* reduce lazy search above this match length */
- ush max_lazy; /* do not perform lazy search above this match length */
- ush nice_length; /* quit search above this match length */
- ush max_chain;
- compress_func func;
+ ush good_length; /* reduce lazy search above this match length */
+ ush max_lazy; /* do not perform lazy search above this match length */
+ ush nice_length; /* quit search above this match length */
+ ush max_chain;
+ compress_func func;
} config;
#ifdef FASTEST
local const config configuration_table[2] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */
+ /* good lazy nice chain */
+ /* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+ /* 1 */ {4, 4, 8, 4, deflate_fast}
+}; /* max speed, no lazy matches */
#else
local const config configuration_table[10] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
-/* 2 */ {4, 5, 16, 8, deflate_fast},
-/* 3 */ {4, 6, 32, 32, deflate_fast},
-
-/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
-/* 5 */ {8, 16, 32, 32, deflate_slow},
-/* 6 */ {8, 16, 128, 128, deflate_slow},
-/* 7 */ {8, 32, 128, 256, deflate_slow},
-/* 8 */ {32, 128, 258, 1024, deflate_slow},
-/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
+ /* good lazy nice chain */
+ /* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+ /* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
+ /* 2 */ {4, 5, 16, 8, deflate_fast},
+ /* 3 */ {4, 6, 32, 32, deflate_fast},
+
+ /* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
+ /* 5 */ {8, 16, 32, 32, deflate_slow},
+ /* 6 */ {8, 16, 128, 128, deflate_slow},
+ /* 7 */ {8, 32, 128, 256, deflate_slow},
+ /* 8 */ {32, 128, 258, 1024, deflate_slow},
+ /* 9 */ {32, 258, 258, 4096, deflate_slow}
+}; /* max compression */
#endif
/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
@@ -159,7 +161,9 @@ local const config configuration_table[10] = {
/* result of memcmp for equal strings */
#ifndef NO_DUMMY_DECL
-struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+struct static_tree_desc_s {
+ int dummy;
+}; /* for buggy compilers */
#endif
/* ===========================================================================
@@ -203,10 +207,10 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
/* ========================================================================= */
int ZEXPORT deflateInit_(strm, level, version, stream_size)
- z_streamp strm;
- int level;
- const char *version;
- int stream_size;
+z_streamp strm;
+int level;
+const char *version;
+int stream_size;
{
return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
Z_DEFAULT_STRATEGY, version, stream_size);
@@ -215,15 +219,15 @@ int ZEXPORT deflateInit_(strm, level, version, stream_size)
/* ========================================================================= */
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
- version, stream_size)
- z_streamp strm;
- int level;
- int method;
- int windowBits;
- int memLevel;
- int strategy;
- const char *version;
- int stream_size;
+ version, stream_size)
+z_streamp strm;
+int level;
+int method;
+int windowBits;
+int memLevel;
+int strategy;
+const char *version;
+int stream_size;
{
deflate_state *s;
int wrap = 1;
@@ -235,22 +239,30 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
*/
if (version == Z_NULL || version[0] != my_version[0] ||
- stream_size != sizeof(z_stream)) {
+ stream_size != sizeof(z_stream)) {
return Z_VERSION_ERROR;
}
- if (strm == Z_NULL) return Z_STREAM_ERROR;
+ if (strm == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
strm->msg = Z_NULL;
if (strm->zalloc == (alloc_func)0) {
strm->zalloc = zcalloc;
strm->opaque = (voidpf)0;
}
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+ if (strm->zfree == (free_func)0) {
+ strm->zfree = zcfree;
+ }
#ifdef FASTEST
- if (level != 0) level = 1;
+ if (level != 0) {
+ level = 1;
+ }
#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
+ if (level == Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
#endif
if (windowBits < 0) { /* suppress zlib wrapper */
@@ -264,13 +276,17 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
}
#endif
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
- windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
- strategy < 0 || strategy > Z_FIXED) {
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_FIXED) {
return Z_STREAM_ERROR;
}
- if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
+ if (windowBits == 8) {
+ windowBits = 9; /* until 256-byte window bug fixed */
+ }
s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
- if (s == Z_NULL) return Z_MEM_ERROR;
+ if (s == Z_NULL) {
+ return Z_MEM_ERROR;
+ }
strm->state = (struct internal_state FAR *)s;
s->strm = strm;
@@ -296,7 +312,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
- s->pending_buf == Z_NULL) {
+ s->pending_buf == Z_NULL) {
s->status = FINISH_STATE;
strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
deflateEnd (strm);
@@ -314,9 +330,9 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
/* ========================================================================= */
int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
- z_streamp strm;
- const Bytef *dictionary;
- uInt dictLength;
+z_streamp strm;
+const Bytef *dictionary;
+uInt dictLength;
{
deflate_state *s;
uInt length = dictLength;
@@ -324,15 +340,19 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
IPos hash_head = 0;
if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
- strm->state->wrap == 2 ||
- (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
+ strm->state->wrap == 2 ||
+ (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) {
return Z_STREAM_ERROR;
+ }
s = strm->state;
- if (s->wrap)
+ if (s->wrap) {
strm->adler = adler32(strm->adler, dictionary, dictLength);
+ }
- if (length < MIN_MATCH) return Z_OK;
+ if (length < MIN_MATCH) {
+ return Z_OK;
+ }
if (length > MAX_DIST(s)) {
length = MAX_DIST(s);
dictionary += dictLength - length; /* use the tail of the dictionary */
@@ -350,18 +370,20 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
for (n = 0; n <= length - MIN_MATCH; n++) {
INSERT_STRING(s, n, hash_head);
}
- if (hash_head) hash_head = 0; /* to make compiler happy */
+ if (hash_head) {
+ hash_head = 0; /* to make compiler happy */
+ }
return Z_OK;
}
/* ========================================================================= */
int ZEXPORT deflateReset (strm)
- z_streamp strm;
+z_streamp strm;
{
deflate_state *s;
if (strm == Z_NULL || strm->state == Z_NULL ||
- strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
+ strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
return Z_STREAM_ERROR;
}
@@ -392,22 +414,28 @@ int ZEXPORT deflateReset (strm)
/* ========================================================================= */
int ZEXPORT deflateSetHeader (strm, head)
- z_streamp strm;
- gz_headerp head;
+z_streamp strm;
+gz_headerp head;
{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- if (strm->state->wrap != 2) return Z_STREAM_ERROR;
+ if (strm == Z_NULL || strm->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
+ if (strm->state->wrap != 2) {
+ return Z_STREAM_ERROR;
+ }
strm->state->gzhead = head;
return Z_OK;
}
/* ========================================================================= */
int ZEXPORT deflatePrime (strm, bits, value)
- z_streamp strm;
- int bits;
- int value;
+z_streamp strm;
+int bits;
+int value;
{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (strm == Z_NULL || strm->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
strm->state->bi_valid = bits;
strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
return Z_OK;
@@ -415,21 +443,27 @@ int ZEXPORT deflatePrime (strm, bits, value)
/* ========================================================================= */
int ZEXPORT deflateParams(strm, level, strategy)
- z_streamp strm;
- int level;
- int strategy;
+z_streamp strm;
+int level;
+int strategy;
{
deflate_state *s;
compress_func func;
int err = Z_OK;
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (strm == Z_NULL || strm->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
s = strm->state;
#ifdef FASTEST
- if (level != 0) level = 1;
+ if (level != 0) {
+ level = 1;
+ }
#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
+ if (level == Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
#endif
if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
return Z_STREAM_ERROR;
@@ -453,15 +487,17 @@ int ZEXPORT deflateParams(strm, level, strategy)
/* ========================================================================= */
int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
- z_streamp strm;
- int good_length;
- int max_lazy;
- int nice_length;
- int max_chain;
+z_streamp strm;
+int good_length;
+int max_lazy;
+int nice_length;
+int max_chain;
{
deflate_state *s;
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (strm == Z_NULL || strm->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
s = strm->state;
s->good_match = good_length;
s->max_lazy_match = max_lazy;
@@ -488,8 +524,8 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
* seem onerous for output buffer allocation.
*/
uLong ZEXPORT deflateBound(strm, sourceLen)
- z_streamp strm;
- uLong sourceLen;
+z_streamp strm;
+uLong sourceLen;
{
deflate_state *s;
uLong destLen;
@@ -499,13 +535,15 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
/* if can't get parameters, return conservative bound */
- if (strm == Z_NULL || strm->state == Z_NULL)
+ if (strm == Z_NULL || strm->state == Z_NULL) {
return destLen;
+ }
/* if not default parameters, return conservative bound */
s = strm->state;
- if (s->w_bits != 15 || s->hash_bits != 8 + 7)
+ if (s->w_bits != 15 || s->hash_bits != 8 + 7) {
return destLen;
+ }
/* default settings: return tight bound for that case */
return compressBound(sourceLen);
@@ -517,8 +555,8 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
* pending_buf.
*/
local void putShortMSB (s, b)
- deflate_state *s;
- uInt b;
+deflate_state *s;
+uInt b;
{
put_byte(s, (Byte)(b >> 8));
put_byte(s, (Byte)(b & 0xff));
@@ -531,12 +569,16 @@ local void putShortMSB (s, b)
* (See also read_buf()).
*/
local void flush_pending(strm)
- z_streamp strm;
+z_streamp strm;
{
unsigned len = strm->state->pending;
- if (len > strm->avail_out) len = strm->avail_out;
- if (len == 0) return;
+ if (len > strm->avail_out) {
+ len = strm->avail_out;
+ }
+ if (len == 0) {
+ return;
+ }
zmemcpy(strm->next_out, strm->state->pending_out, len);
strm->next_out += len;
@@ -551,24 +593,26 @@ local void flush_pending(strm)
/* ========================================================================= */
int ZEXPORT deflate (strm, flush)
- z_streamp strm;
- int flush;
+z_streamp strm;
+int flush;
{
int old_flush; /* value of flush param for previous deflate call */
deflate_state *s;
if (strm == Z_NULL || strm->state == Z_NULL ||
- flush > Z_FINISH || flush < 0) {
+ flush > Z_FINISH || flush < 0) {
return Z_STREAM_ERROR;
}
s = strm->state;
if (strm->next_out == Z_NULL ||
- (strm->next_in == Z_NULL && strm->avail_in != 0) ||
- (s->status == FINISH_STATE && flush != Z_FINISH)) {
+ (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+ (s->status == FINISH_STATE && flush != Z_FINISH)) {
ERR_RETURN(strm, Z_STREAM_ERROR);
}
- if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+ if (strm->avail_out == 0) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
s->strm = strm; /* just in case */
old_flush = s->last_flush;
@@ -589,25 +633,25 @@ int ZEXPORT deflate (strm, flush)
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
+ (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+ 4 : 0));
put_byte(s, OS_CODE);
s->status = BUSY_STATE;
}
else {
put_byte(s, (s->gzhead->text ? 1 : 0) +
- (s->gzhead->hcrc ? 2 : 0) +
- (s->gzhead->extra == Z_NULL ? 0 : 4) +
- (s->gzhead->name == Z_NULL ? 0 : 8) +
- (s->gzhead->comment == Z_NULL ? 0 : 16)
+ (s->gzhead->hcrc ? 2 : 0) +
+ (s->gzhead->extra == Z_NULL ? 0 : 4) +
+ (s->gzhead->name == Z_NULL ? 0 : 8) +
+ (s->gzhead->comment == Z_NULL ? 0 : 16)
);
put_byte(s, (Byte)(s->gzhead->time & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
+ (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+ 4 : 0));
put_byte(s, s->gzhead->os & 0xff);
if (s->gzhead->extra != NULL) {
put_byte(s, s->gzhead->extra_len & 0xff);
@@ -626,16 +670,22 @@ int ZEXPORT deflate (strm, flush)
uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
uInt level_flags;
- if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
+ if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) {
level_flags = 0;
- else if (s->level < 6)
+ }
+ else if (s->level < 6) {
level_flags = 1;
- else if (s->level == 6)
+ }
+ else if (s->level == 6) {
level_flags = 2;
- else
+ }
+ else {
level_flags = 3;
+ }
header |= (level_flags << 6);
- if (s->strstart != 0) header |= PRESET_DICT;
+ if (s->strstart != 0) {
+ header |= PRESET_DICT;
+ }
header += 31 - (header % 31);
s->status = BUSY_STATE;
@@ -661,8 +711,9 @@ int ZEXPORT deflate (strm, flush)
s->pending - beg);
flush_pending(strm);
beg = s->pending;
- if (s->pending == s->pending_buf_size)
+ if (s->pending == s->pending_buf_size) {
break;
+ }
}
put_byte(s, s->gzhead->extra[s->gzindex]);
s->gzindex++;
@@ -675,8 +726,9 @@ int ZEXPORT deflate (strm, flush)
s->status = NAME_STATE;
}
}
- else
+ else {
s->status = NAME_STATE;
+ }
}
if (s->status == NAME_STATE) {
if (s->gzhead->name != NULL) {
@@ -697,7 +749,8 @@ int ZEXPORT deflate (strm, flush)
}
val = s->gzhead->name[s->gzindex++];
put_byte(s, val);
- } while (val != 0);
+ }
+ while (val != 0);
if (s->gzhead->hcrc && s->pending > beg)
strm->adler = crc32(strm->adler, s->pending_buf + beg,
s->pending - beg);
@@ -706,8 +759,9 @@ int ZEXPORT deflate (strm, flush)
s->status = COMMENT_STATE;
}
}
- else
+ else {
s->status = COMMENT_STATE;
+ }
}
if (s->status == COMMENT_STATE) {
if (s->gzhead->comment != NULL) {
@@ -728,20 +782,24 @@ int ZEXPORT deflate (strm, flush)
}
val = s->gzhead->comment[s->gzindex++];
put_byte(s, val);
- } while (val != 0);
+ }
+ while (val != 0);
if (s->gzhead->hcrc && s->pending > beg)
strm->adler = crc32(strm->adler, s->pending_buf + beg,
s->pending - beg);
- if (val == 0)
+ if (val == 0) {
s->status = HCRC_STATE;
+ }
}
- else
+ else {
s->status = HCRC_STATE;
+ }
}
if (s->status == HCRC_STATE) {
if (s->gzhead->hcrc) {
- if (s->pending + 2 > s->pending_buf_size)
+ if (s->pending + 2 > s->pending_buf_size) {
flush_pending(strm);
+ }
if (s->pending + 2 <= s->pending_buf_size) {
put_byte(s, (Byte)(strm->adler & 0xff));
put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
@@ -749,8 +807,9 @@ int ZEXPORT deflate (strm, flush)
s->status = BUSY_STATE;
}
}
- else
+ else {
s->status = BUSY_STATE;
+ }
}
#endif
@@ -768,12 +827,13 @@ int ZEXPORT deflate (strm, flush)
return Z_OK;
}
- /* Make sure there is something to do and avoid duplicate consecutive
- * flushes. For repeated and useless calls with Z_FINISH, we keep
- * returning Z_STREAM_END instead of Z_BUF_ERROR.
- */
- } else if (strm->avail_in == 0 && flush <= old_flush &&
- flush != Z_FINISH) {
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUF_ERROR.
+ */
+ }
+ else if (strm->avail_in == 0 && flush <= old_flush &&
+ flush != Z_FINISH) {
ERR_RETURN(strm, Z_BUF_ERROR);
}
@@ -785,7 +845,7 @@ int ZEXPORT deflate (strm, flush)
/* Start a new block or continue the current one.
*/
if (strm->avail_in != 0 || s->lookahead != 0 ||
- (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+ (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
block_state bstate;
bstate = (*(configuration_table[s->level].func))(s, flush);
@@ -809,7 +869,8 @@ int ZEXPORT deflate (strm, flush)
if (bstate == block_done) {
if (flush == Z_PARTIAL_FLUSH) {
_tr_align(s);
- } else { /* FULL_FLUSH or SYNC_FLUSH */
+ }
+ else { /* FULL_FLUSH or SYNC_FLUSH */
_tr_stored_block(s, (char*)0, 0L, 0);
/* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync().
@@ -820,15 +881,19 @@ int ZEXPORT deflate (strm, flush)
}
flush_pending(strm);
if (strm->avail_out == 0) {
- s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
- return Z_OK;
+ s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
}
}
}
Assert(strm->avail_out > 0, "bug2");
- if (flush != Z_FINISH) return Z_OK;
- if (s->wrap <= 0) return Z_STREAM_END;
+ if (flush != Z_FINISH) {
+ return Z_OK;
+ }
+ if (s->wrap <= 0) {
+ return Z_STREAM_END;
+ }
/* Write the trailer */
#ifdef GZIP
@@ -852,27 +917,31 @@ int ZEXPORT deflate (strm, flush)
/* If avail_out is zero, the application will call deflate again
* to flush the rest.
*/
- if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
+ if (s->wrap > 0) {
+ s->wrap = -s->wrap; /* write the trailer only once! */
+ }
return s->pending != 0 ? Z_OK : Z_STREAM_END;
}
/* ========================================================================= */
int ZEXPORT deflateEnd (strm)
- z_streamp strm;
+z_streamp strm;
{
int status;
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (strm == Z_NULL || strm->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
status = strm->state->status;
if (status != INIT_STATE &&
- status != EXTRA_STATE &&
- status != NAME_STATE &&
- status != COMMENT_STATE &&
- status != HCRC_STATE &&
- status != BUSY_STATE &&
- status != FINISH_STATE) {
- return Z_STREAM_ERROR;
+ status != EXTRA_STATE &&
+ status != NAME_STATE &&
+ status != COMMENT_STATE &&
+ status != HCRC_STATE &&
+ status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
}
/* Deallocate in reverse order of allocations: */
@@ -893,8 +962,8 @@ int ZEXPORT deflateEnd (strm)
* doesn't have enough memory anyway to duplicate compression states).
*/
int ZEXPORT deflateCopy (dest, source)
- z_streamp dest;
- z_streamp source;
+z_streamp dest;
+z_streamp source;
{
#ifdef MAXSEG_64K
return Z_STREAM_ERROR;
@@ -913,7 +982,9 @@ int ZEXPORT deflateCopy (dest, source)
zmemcpy(dest, source, sizeof(z_stream));
ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
- if (ds == Z_NULL) return Z_MEM_ERROR;
+ if (ds == Z_NULL) {
+ return Z_MEM_ERROR;
+ }
dest->state = (struct internal_state FAR *) ds;
zmemcpy(ds, ss, sizeof(deflate_state));
ds->strm = dest;
@@ -925,7 +996,7 @@ int ZEXPORT deflateCopy (dest, source)
ds->pending_buf = (uchf *) overlay;
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
- ds->pending_buf == Z_NULL) {
+ ds->pending_buf == Z_NULL) {
deflateEnd (dest);
return Z_MEM_ERROR;
}
@@ -955,14 +1026,18 @@ int ZEXPORT deflateCopy (dest, source)
* (See also flush_pending()).
*/
local int read_buf(strm, buf, size)
- z_streamp strm;
- Bytef *buf;
- unsigned size;
+z_streamp strm;
+Bytef *buf;
+unsigned size;
{
unsigned len = strm->avail_in;
- if (len > size) len = size;
- if (len == 0) return 0;
+ if (len > size) {
+ len = size;
+ }
+ if (len == 0) {
+ return 0;
+ }
strm->avail_in -= len;
@@ -985,7 +1060,7 @@ local int read_buf(strm, buf, size)
* Initialize the "longest match" routines for a new zlib stream
*/
local void lm_init (s)
- deflate_state *s;
+deflate_state *s;
{
s->window_size = (ulg)2L*s->w_size;
@@ -1026,8 +1101,8 @@ local void lm_init (s)
* match.S. The code will be functionally equivalent.
*/
local uInt longest_match(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
+deflate_state *s;
+IPos cur_match; /* current match */
{
unsigned chain_length = s->max_chain_length;/* max hash chain length */
register Bytef *scan = s->window + s->strstart; /* current string */
@@ -1036,7 +1111,7 @@ local uInt longest_match(s, cur_match)
int best_len = s->prev_length; /* best match length so far */
int nice_match = s->nice_match; /* stop if match long enough */
IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
- s->strstart - (IPos)MAX_DIST(s) : NIL;
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
/* Stop when cur_match becomes <= limit. To simplify the code,
* we prevent matches with the string of window index 0.
*/
@@ -1068,7 +1143,9 @@ local uInt longest_match(s, cur_match)
/* Do not look for matches beyond the end of the input. This is necessary
* to make deflate deterministic.
*/
- if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+ if ((uInt)nice_match > s->lookahead) {
+ nice_match = s->lookahead;
+ }
Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
@@ -1089,7 +1166,9 @@ local uInt longest_match(s, cur_match)
* UNALIGNED_OK if your compiler uses a different size.
*/
if (*(ushf*)(match+best_len-1) != scan_end ||
- *(ushf*)match != scan_start) continue;
+ *(ushf*)match != scan_start) {
+ continue;
+ }
/* It is not necessary to compare scan[2] and match[2] since they are
* always equal when the other bytes match, given that the hash keys
@@ -1103,16 +1182,19 @@ local uInt longest_match(s, cur_match)
Assert(scan[2] == match[2], "scan[2]?");
scan++, match++;
do {
- } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- scan < strend);
+ }
+ while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
/* The funny "do {}" generates better code on most compilers */
/* Here, scan <= window+strstart+257 */
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
- if (*scan == *match) scan++;
+ if (*scan == *match) {
+ scan++;
+ }
len = (MAX_MATCH - 1) - (int)(strend-scan);
scan = strend - (MAX_MATCH-1);
@@ -1120,9 +1202,11 @@ local uInt longest_match(s, cur_match)
#else /* UNALIGNED_OK */
if (match[best_len] != scan_end ||
- match[best_len-1] != scan_end1 ||
- *match != *scan ||
- *++match != scan[1]) continue;
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) {
+ continue;
+ }
/* The check at best_len-1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
@@ -1137,11 +1221,12 @@ local uInt longest_match(s, cur_match)
* the 256th check will be made at strstart+258.
*/
do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
+ }
+ while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
@@ -1153,7 +1238,9 @@ local uInt longest_match(s, cur_match)
if (len > best_len) {
s->match_start = cur_match;
best_len = len;
- if (len >= nice_match) break;
+ if (len >= nice_match) {
+ break;
+ }
#ifdef UNALIGNED_OK
scan_end = *(ushf*)(scan+best_len-1);
#else
@@ -1161,10 +1248,13 @@ local uInt longest_match(s, cur_match)
scan_end = scan[best_len];
#endif
}
- } while ((cur_match = prev[cur_match & wmask]) > limit
- && --chain_length != 0);
+ }
+ while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
- if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ if ((uInt)best_len <= s->lookahead) {
+ return (uInt)best_len;
+ }
return s->lookahead;
}
#endif /* ASMV */
@@ -1174,8 +1264,8 @@ local uInt longest_match(s, cur_match)
* Optimized version for level == 1 or strategy == Z_RLE only
*/
local uInt longest_match_fast(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
+deflate_state *s;
+IPos cur_match; /* current match */
{
register Bytef *scan = s->window + s->strstart; /* current string */
register Bytef *match; /* matched string */
@@ -1195,7 +1285,9 @@ local uInt longest_match_fast(s, cur_match)
/* Return failure if the match length is less than 2:
*/
- if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+ if (match[0] != scan[0] || match[1] != scan[1]) {
+ return MIN_MATCH-1;
+ }
/* The check at best_len-1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
@@ -1210,17 +1302,20 @@ local uInt longest_match_fast(s, cur_match)
* the 256th check will be made at strstart+258.
*/
do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
+ }
+ while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
len = MAX_MATCH - (int)(strend - scan);
- if (len < MIN_MATCH) return MIN_MATCH - 1;
+ if (len < MIN_MATCH) {
+ return MIN_MATCH - 1;
+ }
s->match_start = cur_match;
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
@@ -1231,9 +1326,9 @@ local uInt longest_match_fast(s, cur_match)
* Check that the match at match_start is indeed a match.
*/
local void check_match(s, start, match, length)
- deflate_state *s;
- IPos start, match;
- int length;
+deflate_state *s;
+IPos start, match;
+int length;
{
/* check that the match is indeed a match */
if (zmemcmp(s->window + match,
@@ -1242,12 +1337,16 @@ local void check_match(s, start, match, length)
start, match, length);
do {
fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
- } while (--length != 0);
+ }
+ while (--length != 0);
z_error("invalid match");
}
if (z_verbose > 1) {
fprintf(stderr,"\\[%d,%d]", start-match, length);
- do { putc(s->window[start++], stderr); } while (--length != 0);
+ do {
+ putc(s->window[start++], stderr);
+ }
+ while (--length != 0);
}
}
#else
@@ -1265,7 +1364,7 @@ local void check_match(s, start, match, length)
* option -- not supported here).
*/
local void fill_window(s)
- deflate_state *s;
+deflate_state *s;
{
register unsigned n, m;
register Posf *p;
@@ -1280,7 +1379,8 @@ local void fill_window(s)
if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
more = wsize;
- } else if (more == (unsigned)(-1)) {
+ }
+ else if (more == (unsigned)(-1)) {
/* Very unlikely, but possible on 16 bit machine if
* strstart == 0 && lookahead == 1 (input done a byte at time)
*/
@@ -1310,7 +1410,8 @@ local void fill_window(s)
do {
m = *--p;
*p = (Pos)(m >= wsize ? m-wsize : NIL);
- } while (--n);
+ }
+ while (--n);
n = wsize;
#ifndef FASTEST
@@ -1321,11 +1422,14 @@ local void fill_window(s)
/* If n is not on any hash chain, prev[n] is garbage but
* its value will never be used.
*/
- } while (--n);
+ }
+ while (--n);
#endif
more += wsize;
}
- if (s->strm->avail_in == 0) return;
+ if (s->strm->avail_in == 0) {
+ return;
+ }
/* If there was no sliding:
* strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
@@ -1355,7 +1459,8 @@ local void fill_window(s)
* but this is not important since only literal bytes will be emitted.
*/
- } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+ }
+ while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
}
/* ===========================================================================
@@ -1389,8 +1494,8 @@ local void fill_window(s)
* window to pending_buf.
*/
local block_state deflate_stored(s, flush)
- deflate_state *s;
- int flush;
+deflate_state *s;
+int flush;
{
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
* to pending_buf_size, and each stored block has a 5 byte header:
@@ -1411,9 +1516,13 @@ local block_state deflate_stored(s, flush)
s->block_start >= (long)s->w_size, "slide too late");
fill_window(s);
- if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+ if (s->lookahead == 0 && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
- if (s->lookahead == 0) break; /* flush the current block */
+ if (s->lookahead == 0) {
+ break; /* flush the current block */
+ }
}
Assert(s->block_start >= 0L, "block gone");
@@ -1447,8 +1556,8 @@ local block_state deflate_stored(s, flush)
* matches. It is used only for the fast compression options.
*/
local block_state deflate_fast(s, flush)
- deflate_state *s;
- int flush;
+deflate_state *s;
+int flush;
{
IPos hash_head = NIL; /* head of the hash chain */
int bflush; /* set if current block must be flushed */
@@ -1464,7 +1573,9 @@ local block_state deflate_fast(s, flush)
if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
return need_more;
}
- if (s->lookahead == 0) break; /* flush the current block */
+ if (s->lookahead == 0) {
+ break; /* flush the current block */
+ }
}
/* Insert the string window[strstart .. strstart+2] in the
@@ -1484,13 +1595,14 @@ local block_state deflate_fast(s, flush)
*/
#ifdef FASTEST
if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
- (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
+ (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
s->match_length = longest_match_fast (s, hash_head);
}
#else
if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
+ }
+ else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
s->match_length = longest_match_fast (s, hash_head);
}
#endif
@@ -1509,7 +1621,7 @@ local block_state deflate_fast(s, flush)
*/
#ifndef FASTEST
if (s->match_length <= s->max_insert_length &&
- s->lookahead >= MIN_MATCH) {
+ s->lookahead >= MIN_MATCH) {
s->match_length--; /* string at strstart already in table */
do {
s->strstart++;
@@ -1517,9 +1629,11 @@ local block_state deflate_fast(s, flush)
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
* always MIN_MATCH bytes ahead.
*/
- } while (--s->match_length != 0);
+ }
+ while (--s->match_length != 0);
s->strstart++;
- } else
+ }
+ else
#endif
{
s->strstart += s->match_length;
@@ -1533,14 +1647,17 @@ local block_state deflate_fast(s, flush)
* matter since it will be recomputed at next deflate call.
*/
}
- } else {
+ }
+ else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
_tr_tally_lit (s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
}
- if (bflush) FLUSH_BLOCK(s, 0);
+ if (bflush) {
+ FLUSH_BLOCK(s, 0);
+ }
}
FLUSH_BLOCK(s, flush == Z_FINISH);
return flush == Z_FINISH ? finish_done : block_done;
@@ -1553,8 +1670,8 @@ local block_state deflate_fast(s, flush)
* no better match at the next window position.
*/
local block_state deflate_slow(s, flush)
- deflate_state *s;
- int flush;
+deflate_state *s;
+int flush;
{
IPos hash_head = NIL; /* head of hash chain */
int bflush; /* set if current block must be flushed */
@@ -1571,7 +1688,9 @@ local block_state deflate_slow(s, flush)
if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
return need_more;
}
- if (s->lookahead == 0) break; /* flush the current block */
+ if (s->lookahead == 0) {
+ break; /* flush the current block */
+ }
}
/* Insert the string window[strstart .. strstart+2] in the
@@ -1587,24 +1706,25 @@ local block_state deflate_slow(s, flush)
s->match_length = MIN_MATCH-1;
if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
- s->strstart - hash_head <= MAX_DIST(s)) {
+ s->strstart - hash_head <= MAX_DIST(s)) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
+ }
+ else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
s->match_length = longest_match_fast (s, hash_head);
}
/* longest_match() or longest_match_fast() sets match_start */
if (s->match_length <= 5 && (s->strategy == Z_FILTERED
#if TOO_FAR <= 32767
- || (s->match_length == MIN_MATCH &&
- s->strstart - s->match_start > TOO_FAR)
+ || (s->match_length == MIN_MATCH &&
+ s->strstart - s->match_start > TOO_FAR)
#endif
- )) {
+ )) {
/* If prev_match is also MIN_MATCH, match_start is garbage
* but we will ignore the current match anyway.
@@ -1635,14 +1755,18 @@ local block_state deflate_slow(s, flush)
if (++s->strstart <= max_insert) {
INSERT_STRING(s, s->strstart, hash_head);
}
- } while (--s->prev_length != 0);
+ }
+ while (--s->prev_length != 0);
s->match_available = 0;
s->match_length = MIN_MATCH-1;
s->strstart++;
- if (bflush) FLUSH_BLOCK(s, 0);
+ if (bflush) {
+ FLUSH_BLOCK(s, 0);
+ }
- } else if (s->match_available) {
+ }
+ else if (s->match_available) {
/* If there was no match at the previous position, output a
* single literal. If there was a match but the current match
* is longer, truncate the previous match to a single literal.
@@ -1654,8 +1778,11 @@ local block_state deflate_slow(s, flush)
}
s->strstart++;
s->lookahead--;
- if (s->strm->avail_out == 0) return need_more;
- } else {
+ if (s->strm->avail_out == 0) {
+ return need_more;
+ }
+ }
+ else {
/* There is no previous match to compare with, wait for
* the next step to decide.
*/
@@ -1682,8 +1809,8 @@ local block_state deflate_slow(s, flush)
* deflate switches away from Z_RLE.)
*/
local block_state deflate_rle(s, flush)
- deflate_state *s;
- int flush;
+deflate_state *s;
+int flush;
{
int bflush; /* set if current block must be flushed */
uInt run; /* length of run */
@@ -1701,7 +1828,9 @@ local block_state deflate_rle(s, flush)
if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
return need_more;
}
- if (s->lookahead == 0) break; /* flush the current block */
+ if (s->lookahead == 0) {
+ break; /* flush the current block */
+ }
}
/* See how many times the previous byte repeats */
@@ -1711,9 +1840,11 @@ local block_state deflate_rle(s, flush)
scan = s->window + s->strstart - 1;
prev = *scan++;
do {
- if (*scan++ != prev)
+ if (*scan++ != prev) {
break;
- } while (++run < max);
+ }
+ }
+ while (++run < max);
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
@@ -1722,14 +1853,17 @@ local block_state deflate_rle(s, flush)
_tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
s->lookahead -= run;
s->strstart += run;
- } else {
+ }
+ else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
_tr_tally_lit (s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
}
- if (bflush) FLUSH_BLOCK(s, 0);
+ if (bflush) {
+ FLUSH_BLOCK(s, 0);
+ }
}
FLUSH_BLOCK(s, flush == Z_FINISH);
return flush == Z_FINISH ? finish_done : block_done;
diff --git a/tinySIGCOMP/src/deflate.h b/tinySIGCOMP/src/deflate.h
index a4fbdfb..f79a2cf 100755
--- a/tinySIGCOMP/src/deflate.h
+++ b/tinySIGCOMP/src/deflate.h
@@ -105,7 +105,7 @@ typedef struct internal_state {
Byte method; /* STORED (for zip only) or DEFLATED */
int last_flush; /* value of flush param for previous deflate call */
- /* used by deflate.c: */
+ /* used by deflate.c: */
uInt w_size; /* LZ77 window size (32K by default) */
uInt w_bits; /* log2(w_size) (8..16) */
@@ -188,7 +188,7 @@ typedef struct internal_state {
int nice_match; /* Stop searching when current match exceeds this */
- /* used by trees.c: */
+ /* used by trees.c: */
/* Didn't use ct_data typedef below to supress compiler warning */
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
@@ -279,7 +279,7 @@ typedef struct internal_state {
* distances are limited to MAX_DIST instead of WSIZE.
*/
- /* in trees.c */
+/* in trees.c */
void _tr_init OF((deflate_state *s));
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
@@ -299,11 +299,11 @@ void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
- extern uch _length_code[];
- extern uch _dist_code[];
+extern uch _length_code[];
+extern uch _dist_code[];
#else
- extern const uch _length_code[];
- extern const uch _dist_code[];
+extern const uch _length_code[];
+extern const uch _dist_code[];
#endif
# define _tr_tally_lit(s, c, flush) \
@@ -330,6 +330,6 @@ void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
#endif
#endif /* DEFLATE_H */
-
+
#endif // HAS_ZLIB
diff --git a/tinySIGCOMP/src/tcomp.c b/tinySIGCOMP/src/tcomp.c
index cfb2b50..bf4939c 100755
--- a/tinySIGCOMP/src/tcomp.c
+++ b/tinySIGCOMP/src/tcomp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,36 +37,36 @@
* support for 3GPP IMS and OMA networks.
* This API is designed to efficiently work on embedded systems whith limited memory and low computing power.
*
-* As many operators have begun to commercially deploy IMS, the relevance of using SigComp to lower bandwidth usage will come quickly.
-* In my own opinion I think that most operators (especially those using RCS) will question how to reduce SIP signaling (registration, billing, presence, messaging …)
-* bandwidth usage (who will pay bits?).
-* These questions will especially concern using SIP (or all other text-based protocols) in wireless handsets as part of 2.5G, 3G and 4G cellular networks.
+* As many operators have begun to commercially deploy IMS, the relevance of using SigComp to lower bandwidth usage will come quickly.
+* In my own opinion I think that most operators (especially those using RCS) will question how to reduce SIP signaling (registration, billing, presence, messaging …)
+* bandwidth usage (who will pay bits?).
+* These questions will especially concern using SIP (or all other text-based protocols) in wireless handsets as part of 2.5G, 3G and 4G cellular networks.
*
* SigComp stands for Signaling Compression and has been defined in <a href="http://www.ietf.org/rfc/rfc3320.txt">RFC 3320</a> by the Internet Engineering Task Force (IETF) ROHC working group.
* <br> <br>
*
* @image html SigComp_Architecture.png "SigComp Architecture"
*
-* Many application protocols used for multimedia communications are text-based and engineered for bandwidth rich links. As a result the messages have not been optimized in
-* terms of size. For example, typical IMS/SIP messages range from a few hundred bytes up to two thousand bytes or more. For this reason, SigComp is mandatory for
-* 3GPP IMS netwoks and <a href="http://en.wikipedia.org/wiki/Push_to_Talk_over_Cellular">PoC systems</a>.
+* Many application protocols used for multimedia communications are text-based and engineered for bandwidth rich links. As a result the messages have not been optimized in
+* terms of size. For example, typical IMS/SIP messages range from a few hundred bytes up to two thousand bytes or more. For this reason, SigComp is mandatory for
+* 3GPP IMS netwoks and <a href="http://en.wikipedia.org/wiki/Push_to_Talk_over_Cellular">PoC systems</a>.
*
-* SigComp could also be useful for RCS (Rich Communication Suite) networks because of the size of the SIP packets (more than three thousand bytes for presence publication).
+* SigComp could also be useful for RCS (Rich Communication Suite) networks because of the size of the SIP packets (more than three thousand bytes for presence publication).
* Using SigComp in IMS/RCS context will reduce the round-trip over slow radio links.
*
* @par Supported OS
*
-* - Windows XX/Vista (Visual Studio 2005/2008 or Mingw32)
-* - Windows Mobile 5 and later (Visual Studio 2005/2008 or Mingw32ce/cegcc toolchain)
+* - Windows XX/Vista (Visual Studio 2005/2008 or Mingw32)
+* - Windows Mobile 5 and later (Visual Studio 2005/2008 or Mingw32ce/cegcc toolchain)
* - Symbian S60 (Carbide.c++ v2.0 with S60_3rd_FP2_SDK_v1.1)
* - Google Android
* - Mac OS X, iPhone (Xcode)
-* - All Linux, FreeBSD, ... (GCC 4.x)
+* - All Linux, FreeBSD, ... (GCC 4.x)
*
*
* @par FEATURES
*
-* The goal of this project is to provide a SigComp framework which:
+* The goal of this project is to provide a SigComp framework which:
*
* - Could be used as an external API or Framework
* - Highly portable (Coded in ANSI-C without any external dependencies)
@@ -116,19 +116,19 @@
*
* Compartment Identifier: Used in SIP messages (sigomp-id) and tinySigComp to allocate/deallocate memory associated
* to a compartment.
-* @code
+* @code
* #define COMPARTMENT_ID "urn:uuid:2e5fdc76-00be-4314-8202-1116fa82a475"
* @endcode
*
* Preparation:
* @code
* #define MAX_BUFFER_SIZE 0xFFFF
-*
+*
* int i = 0;
* tsk_size_t outLen = 0;
* tcomp_result_t *result = 0;
-* char outputBuffer[MAX_BUFFER_SIZE];
-*
+* char outputBuffer[MAX_BUFFER_SIZE];
+*
* tcomp_manager_handle_t *manager = 0;
* // Create SigComp manager
@@ -151,13 +151,13 @@
* Compress one or several messages using the code below:
* @code
* // Compress the SIP message
-* outLen = tcomp_manager_compress(manager,
+* outLen = tcomp_manager_compress(manager,
* COMPARTMENT_ID, strlen(COMPARTMENT_ID), // Compartment
* "REGISTER ...", strlen("REGISTER ..."), // Sip message to compress and it's size
* outputBuffer, sizeof(outputBuffer), // The ouptut buffer and it's size
* FALSE // Indicates whether to compress as stream (SCTP, TCP...) message or not
* );
-*
+*
* if(outLen){
* // send SigComp message over UDP connection
* sendto(sock, outputBuffer, outLen , 0, (SOCKADDR *)address, sizeof(address));
diff --git a/tinySIGCOMP/src/tcomp.h b/tinySIGCOMP/src/tcomp.h
index a49a9de..cd2208c 100755
--- a/tinySIGCOMP/src/tcomp.h
+++ b/tinySIGCOMP/src/tcomp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_buffer.c b/tinySIGCOMP/src/tcomp_buffer.c
index b7bfd4d..06883ff 100755
--- a/tinySIGCOMP/src/tcomp_buffer.c
+++ b/tinySIGCOMP/src/tcomp_buffer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,41 +32,40 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
-#include <string.h>
+#include <string.h>
/** SigComp buffer.
*/
-typedef struct tcomp_buffer_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_size_t size; /**< The size of the buffer */
- uint8_t* lpbuffer; /**< Pointer to the buffer */
- tsk_size_t index_bytes; /**< Bytes (8bit size) cursor */
- tsk_size_t index_bits; /**< Bits (1-bit size) cursor */
- unsigned owner:1; /**< Indicates whether we are the owner of the buffer or not (external buffer) */
- uint8_t P_BIT; /**< P-BIT controller. */
+typedef struct tcomp_buffer_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_size_t size; /**< The size of the buffer */
+ uint8_t* lpbuffer; /**< Pointer to the buffer */
+ tsk_size_t index_bytes; /**< Bytes (8bit size) cursor */
+ tsk_size_t index_bits; /**< Bits (1-bit size) cursor */
+ unsigned owner:1; /**< Indicates whether we are the owner of the buffer or not (external buffer) */
+ uint8_t P_BIT; /**< P-BIT controller. */
}
tcomp_buffer_t;
tcomp_buffer_handle_t* tcomp_buffer_create(const void* data, tsk_size_t len)
{
- tcomp_buffer_t* buffer;
- if((buffer = tsk_object_new(tcomp_buffer_def_t))){
- buffer->owner = tsk_true;
- // The P-bit controls the order in which bits are passed from the dispatcher to the INPUT instructions.
- buffer->P_BIT = TCOMP_P_BIT_MSB_TO_LSB;
- if(data && len){
- tcomp_buffer_appendBuff(buffer, data, len);
- }
- }
- return buffer;
+ tcomp_buffer_t* buffer;
+ if((buffer = tsk_object_new(tcomp_buffer_def_t))) {
+ buffer->owner = tsk_true;
+ // The P-bit controls the order in which bits are passed from the dispatcher to the INPUT instructions.
+ buffer->P_BIT = TCOMP_P_BIT_MSB_TO_LSB;
+ if(data && len) {
+ tcomp_buffer_appendBuff(buffer, data, len);
+ }
+ }
+ return buffer;
}
tcomp_buffer_handle_t* tcomp_buffer_create_null()
{
- return tcomp_buffer_create(tsk_null, 0);
+ return tcomp_buffer_create(tsk_null, 0);
}
/**Compares two sigomp buffers.
@@ -76,11 +75,11 @@ tcomp_buffer_handle_t* tcomp_buffer_create_null()
*/
tsk_bool_t tcomp_buffer_equals(const tcomp_buffer_handle_t* handle1, const tcomp_buffer_handle_t* handle2)
{
- if( tcomp_buffer_getSize(handle1) == tcomp_buffer_getSize(handle2) ){
- return tcomp_buffer_startsWith(handle1, handle2);
- }
+ if( tcomp_buffer_getSize(handle1) == tcomp_buffer_getSize(handle2) ) {
+ return tcomp_buffer_startsWith(handle1, handle2);
+ }
- return tsk_false;
+ return tsk_false;
}
@@ -91,20 +90,20 @@ tsk_bool_t tcomp_buffer_equals(const tcomp_buffer_handle_t* handle1, const tcomp
*/
tsk_bool_t tcomp_buffer_startsWith(const tcomp_buffer_handle_t* handle1, const tcomp_buffer_handle_t* handle2) /*const*/
{
- tsk_size_t i;
- tcomp_buffer_t* buffer1 = (tcomp_buffer_t*)handle1;
- tcomp_buffer_t* buffer2 = (tcomp_buffer_t*)handle2;
-
- if(buffer1->size < buffer2->size){
- return tsk_false;
- }
-
- for(i = 0; i< buffer2->size; i++){
- if(buffer1->lpbuffer[i] != buffer2->lpbuffer[i]){
- return tsk_false;
- }
- }
- return tsk_true;
+ tsk_size_t i;
+ tcomp_buffer_t* buffer1 = (tcomp_buffer_t*)handle1;
+ tcomp_buffer_t* buffer2 = (tcomp_buffer_t*)handle2;
+
+ if(buffer1->size < buffer2->size) {
+ return tsk_false;
+ }
+
+ for(i = 0; i< buffer2->size; i++) {
+ if(buffer1->lpbuffer[i] != buffer2->lpbuffer[i]) {
+ return tsk_false;
+ }
+ }
+ return tsk_true;
}
/**Gets a readonly pointer to the internal buffer.
@@ -114,14 +113,14 @@ tsk_bool_t tcomp_buffer_startsWith(const tcomp_buffer_handle_t* handle1, const t
*/
const uint8_t* tcomp_buffer_getReadOnlyBufferAtPos(const tcomp_buffer_handle_t* handle, tsk_size_t position)/*const*/
{
- if(handle){
- return (((tcomp_buffer_t*)handle)->lpbuffer + position);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_null;
+ if(handle) {
+ return (((tcomp_buffer_t*)handle)->lpbuffer + position);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_null;
}
/**Gets a read/write pointer to the internal buffer.
@@ -131,18 +130,18 @@ const uint8_t* tcomp_buffer_getReadOnlyBufferAtPos(const tcomp_buffer_handle_t*
*/
uint8_t* tcomp_buffer_getBufferAtPos(const tcomp_buffer_handle_t* handle, tsk_size_t position)
{
- if(handle){
- if(position && ((tcomp_buffer_t*)handle)->size <= position){
- TSK_DEBUG_ERROR("%u <= %u", ((tcomp_buffer_t*)handle)->size, position);
- return tsk_null;
- }
- return (((tcomp_buffer_t*)handle)->lpbuffer + position);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_null;
+ if(handle) {
+ if(position && ((tcomp_buffer_t*)handle)->size <= position) {
+ TSK_DEBUG_ERROR("%u <= %u", ((tcomp_buffer_t*)handle)->size, position);
+ return tsk_null;
+ }
+ return (((tcomp_buffer_t*)handle)->lpbuffer + position);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_null;
}
@@ -151,14 +150,14 @@ uint8_t* tcomp_buffer_getBufferAtPos(const tcomp_buffer_handle_t* handle, tsk_si
*/
tsk_size_t tcomp_buffer_getSize(const tcomp_buffer_handle_t* handle) /*const*/
{
- if(handle){
- return ((tcomp_buffer_t*)handle)->size;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return 0;
+ if(handle) {
+ return ((tcomp_buffer_t*)handle)->size;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return 0;
}
/**Gets the remainning bits.
@@ -166,16 +165,16 @@ tsk_size_t tcomp_buffer_getSize(const tcomp_buffer_handle_t* handle) /*const*/
*/
tsk_size_t tcomp_buffer_getRemainingBits(const tcomp_buffer_handle_t* handle) /*const*/
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- tsk_ssize_t result = ((buffer->size * 8) - ((buffer->index_bytes * 8) + buffer->index_bits));
- return (result < 0) ? 0: result;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return 0;
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ tsk_ssize_t result = ((buffer->size * 8) - ((buffer->index_bytes * 8) + buffer->index_bits));
+ return (result < 0) ? 0: result;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return 0;
}
/**Reads @a size bytes.
@@ -185,24 +184,24 @@ tsk_size_t tcomp_buffer_getRemainingBits(const tcomp_buffer_handle_t* handle) /*
*/
uint8_t* tcomp_buffer_readBytes(tcomp_buffer_handle_t* handle, tsk_size_t length)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- tsk_size_t old_index;
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ tsk_size_t old_index;
- if((buffer->index_bytes + length) > (buffer->size)) {
- return tsk_null;
- }
+ if((buffer->index_bytes + length) > (buffer->size)) {
+ return tsk_null;
+ }
- old_index = buffer->index_bytes;
- buffer->index_bytes += length;
+ old_index = buffer->index_bytes;
+ buffer->index_bytes += length;
- return tcomp_buffer_getBufferAtPos(handle, old_index);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ return tcomp_buffer_getBufferAtPos(handle, old_index);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
- return tsk_null;
+ return tsk_null;
}
/**Reads the internal buffer from LSB to MSB as per RFC 3320 subclause 8.2.
@@ -212,35 +211,35 @@ uint8_t* tcomp_buffer_readBytes(tcomp_buffer_handle_t* handle, tsk_size_t length
*/
uint32_t tcomp_buffer_readLsbToMsb(tcomp_buffer_handle_t* handle, tsk_size_t length)
{
- // UDV Memory is always MSB first
- // MSB <-- LSB
- // FIXME: use mask
- if(handle)
- {
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- uint8_t pos = 0;
- char* end;
- uint32_t result_val = 0;
- char result_str[16]; memset(result_str, 0, 16);
- while(pos < length){
- result_str[pos++] = (buffer->lpbuffer[buffer->index_bytes]
- &(1 << (buffer->index_bits))) ? '1' : '0';
- if(++buffer->index_bits == 8){
- buffer->index_bytes++;
- buffer->index_bits = 0;
- }
- }
-
- end = (result_str+length);
- result_val = (uint32_t)strtol(result_str, &end, 2);
-
- return result_val;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return 0;
+ // UDV Memory is always MSB first
+ // MSB <-- LSB
+ // FIXME: use mask
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ uint8_t pos = 0;
+ char* end;
+ uint32_t result_val = 0;
+ char result_str[16];
+ memset(result_str, 0, 16);
+ while(pos < length) {
+ result_str[pos++] = (buffer->lpbuffer[buffer->index_bytes]
+ &(1 << (buffer->index_bits))) ? '1' : '0';
+ if(++buffer->index_bits == 8) {
+ buffer->index_bytes++;
+ buffer->index_bits = 0;
+ }
+ }
+
+ end = (result_str+length);
+ result_val = (uint32_t)strtol(result_str, &end, 2);
+
+ return result_val;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return 0;
}
/**Reads the internal buffer from MSB to LSB as per RFC 3320 subclause 8.2.
@@ -250,35 +249,36 @@ uint32_t tcomp_buffer_readLsbToMsb(tcomp_buffer_handle_t* handle, tsk_size_t len
*/
uint32_t tcomp_buffer_readMsbToLsb(tcomp_buffer_handle_t* handle, tsk_size_t length)
{
- // UDV Memory is always MSB first
- // MSB --> LSB
- // FIXME: use mask
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- uint8_t pos = 0;
- char* end;
- uint32_t result_val = 0;
- char result_str[16]; memset(result_str, 0, 16);
-
- while(pos < length){
- result_str[pos++] = (buffer->lpbuffer[buffer->index_bytes]
- &(128 >> (buffer->index_bits))) ? '1' : '0';
- if(++buffer->index_bits == 8){
- buffer->index_bytes++;
- buffer->index_bits = 0;
- }
- }
-
- end = (result_str + length);
- result_val = (uint32_t)strtol(result_str, &end, 2);
-
- return result_val;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return 0;
+ // UDV Memory is always MSB first
+ // MSB --> LSB
+ // FIXME: use mask
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ uint8_t pos = 0;
+ char* end;
+ uint32_t result_val = 0;
+ char result_str[16];
+ memset(result_str, 0, 16);
+
+ while(pos < length) {
+ result_str[pos++] = (buffer->lpbuffer[buffer->index_bytes]
+ &(128 >> (buffer->index_bits))) ? '1' : '0';
+ if(++buffer->index_bits == 8) {
+ buffer->index_bytes++;
+ buffer->index_bits = 0;
+ }
+ }
+
+ end = (result_str + length);
+ result_val = (uint32_t)strtol(result_str, &end, 2);
+
+ return result_val;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return 0;
}
/**Discards bits as per RFC 3320 subclause 8.2.
@@ -286,16 +286,16 @@ uint32_t tcomp_buffer_readMsbToLsb(tcomp_buffer_handle_t* handle, tsk_size_t len
*/
void tcomp_buffer_discardBits(tcomp_buffer_handle_t* handle)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- if(buffer->index_bits){
- buffer->index_bits=0;
- buffer->index_bytes++;
- }
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ if(buffer->index_bits) {
+ buffer->index_bits=0;
+ buffer->index_bytes++;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
/**Discards last bytes as per RFC 3320 subclause 8.2.
@@ -304,18 +304,18 @@ void tcomp_buffer_discardBits(tcomp_buffer_handle_t* handle)
*/
void tcomp_buffer_discardLastBytes(tcomp_buffer_handle_t* handle, uint32_t count)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- if(buffer->size > count){
- buffer->size -= count;
- }
- else{
- tcomp_buffer_freeBuff(handle);
- }
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ if(buffer->size > count) {
+ buffer->size -= count;
+ }
+ else {
+ tcomp_buffer_freeBuff(handle);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
/**Allocs the internal buffer.
@@ -324,25 +324,25 @@ void tcomp_buffer_discardLastBytes(tcomp_buffer_handle_t* handle, uint32_t count
*/
void tcomp_buffer_allocBuff(tcomp_buffer_handle_t* handle, tsk_size_t size)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- if(!buffer->owner){
- TSK_DEBUG_ERROR("The SigComp is not the owner of the internal buffer to alloc.");
- return;
- }
- if(!size){
- TSK_DEBUG_WARN("Cannot allocate zero bytes.");
- return;
- }
- buffer->index_bits = buffer->index_bytes = 0;
- buffer->size = 0;
- if((buffer->lpbuffer = tsk_realloc(buffer->lpbuffer, size))){
- buffer->size = size;
- }
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ if(!buffer->owner) {
+ TSK_DEBUG_ERROR("The SigComp is not the owner of the internal buffer to alloc.");
+ return;
+ }
+ if(!size) {
+ TSK_DEBUG_WARN("Cannot allocate zero bytes.");
+ return;
+ }
+ buffer->index_bits = buffer->index_bytes = 0;
+ buffer->size = 0;
+ if((buffer->lpbuffer = tsk_realloc(buffer->lpbuffer, size))) {
+ buffer->size = size;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
/**Adds a buffer as a reference (not owned).
@@ -352,22 +352,22 @@ void tcomp_buffer_allocBuff(tcomp_buffer_handle_t* handle, tsk_size_t size)
*/
void tcomp_buffer_referenceBuff(tcomp_buffer_handle_t* handle, uint8_t* externalBuff, tsk_size_t size)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- if(buffer->size && buffer->owner){
- TSK_DEBUG_ERROR("The SigComp handle already hold an internal buffer.");
- return;
- }
-
- buffer->size = size;
- buffer->lpbuffer = externalBuff;
- buffer->index_bytes = 0;
- buffer->index_bits = 0;
- buffer->owner = 0;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ if(buffer->size && buffer->owner) {
+ TSK_DEBUG_ERROR("The SigComp handle already hold an internal buffer.");
+ return;
+ }
+
+ buffer->size = size;
+ buffer->lpbuffer = externalBuff;
+ buffer->index_bytes = 0;
+ buffer->index_bits = 0;
+ buffer->owner = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
/**Appends data to our internal buffer.
@@ -378,39 +378,39 @@ void tcomp_buffer_referenceBuff(tcomp_buffer_handle_t* handle, uint8_t* external
*/
tsk_bool_t tcomp_buffer_appendBuff(tcomp_buffer_handle_t* handle, const void* data, tsk_size_t size)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- tsk_size_t oldSize = buffer->size;
- tsk_size_t newSize = (oldSize + size);
- {
- // realloc buffer
- if(!buffer->size){
- buffer->lpbuffer = (uint8_t*)tsk_calloc(1, newSize);
- }
- else{
- buffer->lpbuffer = (uint8_t*)tsk_realloc(buffer->lpbuffer, newSize);
- }
- }
-
- if(!buffer->lpbuffer){
- return tsk_false;
- }
-
- if(data){
- memcpy((buffer->lpbuffer+oldSize), data, size);
- }
- else{
- memset((buffer->lpbuffer+oldSize), 0, size);
- }
-
- buffer->size = newSize;
- return tsk_true;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_false;
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ tsk_size_t oldSize = buffer->size;
+ tsk_size_t newSize = (oldSize + size);
+ {
+ // realloc buffer
+ if(!buffer->size) {
+ buffer->lpbuffer = (uint8_t*)tsk_calloc(1, newSize);
+ }
+ else {
+ buffer->lpbuffer = (uint8_t*)tsk_realloc(buffer->lpbuffer, newSize);
+ }
+ }
+
+ if(!buffer->lpbuffer) {
+ return tsk_false;
+ }
+
+ if(data) {
+ memcpy((buffer->lpbuffer+oldSize), data, size);
+ }
+ else {
+ memset((buffer->lpbuffer+oldSize), 0, size);
+ }
+
+ buffer->size = newSize;
+ return tsk_true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_false;
}
/**Removes @a size bytes from the internal buffer.
@@ -421,34 +421,36 @@ tsk_bool_t tcomp_buffer_appendBuff(tcomp_buffer_handle_t* handle, const void* da
*/
tsk_bool_t tcomp_buffer_removeBuff(tcomp_buffer_handle_t* handle, tsk_size_t pos, tsk_size_t size)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- tsk_size_t oldSize, newSize;
-
- if(((pos + size) > buffer->size)) size = (buffer->size - pos);
- memcpy((buffer->lpbuffer + pos), (buffer->lpbuffer + pos + size), (buffer->size - (pos + size)));
-
- oldSize = buffer->size;
- newSize = (oldSize - size);
- {
- if(!(buffer->size)){
- buffer->lpbuffer = (uint8_t*)tsk_calloc(1, newSize);
- }
- else{
- buffer->lpbuffer = (uint8_t*)tsk_realloc(buffer->lpbuffer, newSize);
- }
- }
- if(buffer->lpbuffer){
- buffer->size = newSize;
- return tsk_true;
- }
- return tsk_false;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_false;
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ tsk_size_t oldSize, newSize;
+
+ if(((pos + size) > buffer->size)) {
+ size = (buffer->size - pos);
+ }
+ memcpy((buffer->lpbuffer + pos), (buffer->lpbuffer + pos + size), (buffer->size - (pos + size)));
+
+ oldSize = buffer->size;
+ newSize = (oldSize - size);
+ {
+ if(!(buffer->size)) {
+ buffer->lpbuffer = (uint8_t*)tsk_calloc(1, newSize);
+ }
+ else {
+ buffer->lpbuffer = (uint8_t*)tsk_realloc(buffer->lpbuffer, newSize);
+ }
+ }
+ if(buffer->lpbuffer) {
+ buffer->size = newSize;
+ return tsk_true;
+ }
+ return tsk_false;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_false;
}
/**Free the internal buffer.
@@ -456,16 +458,16 @@ tsk_bool_t tcomp_buffer_removeBuff(tcomp_buffer_handle_t* handle, tsk_size_t pos
*/
void tcomp_buffer_freeBuff(tcomp_buffer_handle_t* handle)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- if(buffer->lpbuffer && buffer->size && buffer->owner) {
- tsk_free((void**)&(buffer->lpbuffer));
- }
- buffer->size = buffer->index_bytes = buffer->index_bits = 0;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ if(buffer->lpbuffer && buffer->size && buffer->owner) {
+ tsk_free((void**)&(buffer->lpbuffer));
+ }
+ buffer->size = buffer->index_bytes = buffer->index_bits = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
/**Gets the bytes cursor position.
@@ -474,14 +476,14 @@ void tcomp_buffer_freeBuff(tcomp_buffer_handle_t* handle)
*/
tsk_size_t* tcomp_buffer_getIndexBytes(const tcomp_buffer_handle_t* handle)
{
- if(handle){
- return &(((tcomp_buffer_t*)handle)->index_bytes);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return 0;
+ if(handle) {
+ return &(((tcomp_buffer_t*)handle)->index_bytes);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return 0;
}
/**Gets the bits cursor position.
@@ -490,14 +492,14 @@ tsk_size_t* tcomp_buffer_getIndexBytes(const tcomp_buffer_handle_t* handle)
*/
tsk_size_t* tcomp_buffer_getIndexBits(const tcomp_buffer_handle_t* handle)
{
- if(handle){
- return &(((tcomp_buffer_t*)handle)->index_bits);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_null;
+ if(handle) {
+ return &(((tcomp_buffer_t*)handle)->index_bits);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_null;
}
/**Gets the P-bit controller value.
@@ -509,45 +511,44 @@ tsk_size_t* tcomp_buffer_getIndexBits(const tcomp_buffer_handle_t* handle)
*/
uint8_t* tcomp_buffer_getP_BIT(const tcomp_buffer_handle_t* handle)
{
- if(handle){
- return &(((tcomp_buffer_t*)handle)->P_BIT);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
-
- return tsk_null;
+ if(handle) {
+ return &(((tcomp_buffer_t*)handle)->P_BIT);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
+
+ return tsk_null;
}
/**Creates a random HASH number.
*/
uint64_t tcomp_buffer_createHash(const void *data, tsk_size_t len)
{
- if(!data || !len){
- TSK_DEBUG_ERROR("Null data.");
- return 0;
- }
- {
+ if(!data || !len) {
+ TSK_DEBUG_ERROR("Null data.");
+ return 0;
+ }
+ {
#define PRIME_1 500237
#define PRIME_2 700241
- uint64_t hash = 0;
- uint8_t* strid = (uint8_t*)data;
-
- /* Generate Hash code from id */
- {
- uint64_t b = PRIME_1, a = PRIME_2;
- tsk_size_t i;
- for(i = 0; i < len; strid++, i++)
- {
- hash = hash * a + (*strid);
- a = a * b;
- }
- }
- return hash;
+ uint64_t hash = 0;
+ uint8_t* strid = (uint8_t*)data;
+
+ /* Generate Hash code from id */
+ {
+ uint64_t b = PRIME_1, a = PRIME_2;
+ tsk_size_t i;
+ for(i = 0; i < len; strid++, i++) {
+ hash = hash * a + (*strid);
+ a = a * b;
+ }
+ }
+ return hash;
#undef PRIME_1
#undef PRIME_2
- }
+ }
}
/**Prints the internal buffer.
@@ -558,43 +559,45 @@ void tcomp_buffer_nprint(const tcomp_buffer_handle_t* handle, tsk_ssize_t size)
{
#if defined(_DEBUG) || defined(DEBUG)
- if(handle){
- tsk_size_t i, tsk_size_to_print;
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
- tsk_size_to_print = (size<0) ? buffer->size : size;
-
- if( !tsk_size_to_print || !buffer->lpbuffer) return;
-
- for(i = 0; i < tsk_size_to_print; i+=2){
- char s[10];
- uint32_t value;
- memset(s, 0, 10);
-
- if((i+1) == tsk_size_to_print){
- // last 2-byte lay in 1byte
- value = buffer->lpbuffer[i];
+ if(handle) {
+ tsk_size_t i, tsk_size_to_print;
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+ tsk_size_to_print = (size<0) ? buffer->size : size;
+
+ if( !tsk_size_to_print || !buffer->lpbuffer) {
+ return;
+ }
+
+ for(i = 0; i < tsk_size_to_print; i+=2) {
+ char s[10];
+ uint32_t value;
+ memset(s, 0, 10);
+
+ if((i+1) == tsk_size_to_print) {
+ // last 2-byte lay in 1byte
+ value = buffer->lpbuffer[i];
#if 0
- sprintf_s(s, 10, i?"%0.2x":"0x%0.2x", value);
+ sprintf_s(s, 10, i?"%0.2x":"0x%0.2x", value);
#else
- sprintf(s, i ? "%0.2x" : "0x%0.2x", value);
+ sprintf(s, i ? "%0.2x" : "0x%0.2x", value);
#endif
- }
- else{
- uint8_t *b_ptr = tcomp_buffer_getBufferAtPos(handle, i);
- value = TSK_BINARY_GET_2BYTES(b_ptr);
+ }
+ else {
+ uint8_t *b_ptr = tcomp_buffer_getBufferAtPos(handle, i);
+ value = TSK_BINARY_GET_2BYTES(b_ptr);
#if 0
- sprintf_s(s, 10, i?"%0.4x":"0x%0.4x", value);
+ sprintf_s(s, 10, i?"%0.4x":"0x%0.4x", value);
#else
- sprintf(s, i?"%0.4x":"0x%0.4x", value);
+ sprintf(s, i?"%0.4x":"0x%0.4x", value);
#endif
- }
- printf("%s ", s);
- }
- printf("\n");
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ }
+ printf("%s ", s);
+ }
+ printf("\n");
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
#endif
}
@@ -603,18 +606,18 @@ void tcomp_buffer_nprint(const tcomp_buffer_handle_t* handle, tsk_ssize_t size)
*/
void tcomp_buffer_reset(tcomp_buffer_handle_t* handle)
{
- if(handle){
- tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
-
- buffer->index_bytes = 0;
- buffer->index_bits = 0;
- if(buffer->lpbuffer){
- memset(buffer->lpbuffer, 0, buffer->size);
- }
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle");
- }
+ if(handle) {
+ tcomp_buffer_t* buffer = (tcomp_buffer_t*)handle;
+
+ buffer->index_bytes = 0;
+ buffer->index_bits = 0;
+ if(buffer->lpbuffer) {
+ memset(buffer->lpbuffer, 0, buffer->size);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle");
+ }
}
@@ -631,31 +634,30 @@ void tcomp_buffer_reset(tcomp_buffer_handle_t* handle)
//
static tsk_object_t* tcomp_buffer_ctor(tsk_object_t *self, va_list * app)
{
- tcomp_buffer_t* buffer = self;
- if(buffer){
- }
- return self;
+ tcomp_buffer_t* buffer = self;
+ if(buffer) {
+ }
+ return self;
}
static tsk_object_t* tcomp_buffer_dtor(tsk_object_t *self)
{
- tcomp_buffer_t* buffer = self;
- if(buffer){
- tcomp_buffer_freeBuff(buffer);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp handle.");
- }
-
- return self;
+ tcomp_buffer_t* buffer = self;
+ if(buffer) {
+ tcomp_buffer_freeBuff(buffer);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp handle.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_buffer_def_s =
-{
- sizeof(tcomp_buffer_t),
- tcomp_buffer_ctor,
- tcomp_buffer_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_buffer_def_s = {
+ sizeof(tcomp_buffer_t),
+ tcomp_buffer_ctor,
+ tcomp_buffer_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_buffer_def_t = &tcomp_buffer_def_s;
diff --git a/tinySIGCOMP/src/tcomp_buffer.h b/tinySIGCOMP/src/tcomp_buffer.h
index d89b691..9b41125 100755
--- a/tinySIGCOMP/src/tcomp_buffer.h
+++ b/tinySIGCOMP/src/tcomp_buffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_compartment.c b/tinySIGCOMP/src/tcomp_compartment.c
index 5d774a2..28378a9 100755
--- a/tinySIGCOMP/src/tcomp_compartment.c
+++ b/tinySIGCOMP/src/tcomp_compartment.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,226 +40,226 @@ static void _tcomp_compartment_freeState(tcomp_compartment_t *compartment, tcomp
tcomp_compartment_t* tcomp_compartment_create(uint64_t id, uint32_t sigCompParameters, tsk_bool_t useOnlyACKedStates)
{
- tcomp_compartment_t *compartment;
- if((compartment = tsk_object_new(tcomp_compartment_def_t))){
-
-
- /*
- +---+---+---+---+---+---+---+---+
- | cpb | dms | sms |
- +---+---+---+---+---+---+---+---+
- | SigComp_version |
- +---+---+---+---+---+---+---+---+
- */
-
- // I always assume that remote params are equal to local params
-
- /* Identifier */
- compartment->identifier = id;
-
- /* Remote parameters */
- compartment->remote_parameters = tcomp_params_create();
- tcomp_params_setParameters(compartment->remote_parameters, sigCompParameters);
-
- /* Local parameters */
- compartment->local_parameters = tcomp_params_create();
- tcomp_params_setParameters(compartment->local_parameters, sigCompParameters);
-
- /* Total size */
- compartment->total_memory_size = compartment->total_memory_left = compartment->local_parameters->smsValue;
-
- /* Empty list. */
- compartment->nacks = tsk_list_create();
-
- /* Empty list. */
- compartment->local_states = tsk_list_create();
-
- /* Whether to use only ACKed states */
- compartment->useOnlyACKedStates = useOnlyACKedStates;
- }
- else{
- TSK_DEBUG_ERROR("Null Compartment");
- }
-
- return compartment;
+ tcomp_compartment_t *compartment;
+ if((compartment = tsk_object_new(tcomp_compartment_def_t))) {
+
+
+ /*
+ +---+---+---+---+---+---+---+---+
+ | cpb | dms | sms |
+ +---+---+---+---+---+---+---+---+
+ | SigComp_version |
+ +---+---+---+---+---+---+---+---+
+ */
+
+ // I always assume that remote params are equal to local params
+
+ /* Identifier */
+ compartment->identifier = id;
+
+ /* Remote parameters */
+ compartment->remote_parameters = tcomp_params_create();
+ tcomp_params_setParameters(compartment->remote_parameters, sigCompParameters);
+
+ /* Local parameters */
+ compartment->local_parameters = tcomp_params_create();
+ tcomp_params_setParameters(compartment->local_parameters, sigCompParameters);
+
+ /* Total size */
+ compartment->total_memory_size = compartment->total_memory_left = compartment->local_parameters->smsValue;
+
+ /* Empty list. */
+ compartment->nacks = tsk_list_create();
+
+ /* Empty list. */
+ compartment->local_states = tsk_list_create();
+
+ /* Whether to use only ACKed states */
+ compartment->useOnlyACKedStates = useOnlyACKedStates;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Compartment");
+ }
+
+ return compartment;
}
int tcomp_compartment_setUseOnlyACKedStates(tcomp_compartment_t* self, tsk_bool_t useOnlyACKedStates)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->useOnlyACKedStates = useOnlyACKedStates;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->useOnlyACKedStates = useOnlyACKedStates;
+ return 0;
}
/**Sets remote parameters
*/
void tcomp_compartment_setRemoteParams(tcomp_compartment_t *compartment, tcomp_params_t *lpParams)
{
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
-
- /* CPB||DMS||SMS [1-BYTE] */
- if(tcomp_params_hasCpbDmsSms(lpParams)){
- tcomp_params_setCpbCode(compartment->remote_parameters, lpParams->cpbCode);
- tcomp_params_setDmsCode(compartment->remote_parameters, lpParams->dmsCode);
- tcomp_params_setSmsCode(compartment->remote_parameters, lpParams->smsCode);
- }
-
- /* SigComp version */
- if(lpParams->SigComp_version){
- compartment->remote_parameters->SigComp_version = lpParams->SigComp_version;
- }
-
- /*
- * Returned states
- * FIXME: check states about quota
- * FIXME: not tic tac
- * FIXME: what about returned feedback?
- */
- if(lpParams->returnedStates && tcomp_buffer_getSize(lpParams->returnedStates)){
- TSK_OBJECT_SAFE_FREE(compartment->remote_parameters->returnedStates);
- /* swap */
- compartment->remote_parameters->returnedStates = lpParams->returnedStates;
- lpParams->returnedStates = 0;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+
+ /* CPB||DMS||SMS [1-BYTE] */
+ if(tcomp_params_hasCpbDmsSms(lpParams)) {
+ tcomp_params_setCpbCode(compartment->remote_parameters, lpParams->cpbCode);
+ tcomp_params_setDmsCode(compartment->remote_parameters, lpParams->dmsCode);
+ tcomp_params_setSmsCode(compartment->remote_parameters, lpParams->smsCode);
+ }
+
+ /* SigComp version */
+ if(lpParams->SigComp_version) {
+ compartment->remote_parameters->SigComp_version = lpParams->SigComp_version;
+ }
+
+ /*
+ * Returned states
+ * FIXME: check states about quota
+ * FIXME: not tic tac
+ * FIXME: what about returned feedback?
+ */
+ if(lpParams->returnedStates && tcomp_buffer_getSize(lpParams->returnedStates)) {
+ TSK_OBJECT_SAFE_FREE(compartment->remote_parameters->returnedStates);
+ /* swap */
+ compartment->remote_parameters->returnedStates = lpParams->returnedStates;
+ lpParams->returnedStates = 0;
+ }
}
/**Sets requested feedback
*/
void tcomp_compartment_setReqFeedback(tcomp_compartment_t *compartment, tcomp_buffer_handle_t *feedback)
{
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
- tsk_safeobj_lock(compartment);
+ tsk_safeobj_lock(compartment);
- /* Delete old */
- TSK_OBJECT_SAFE_FREE(compartment->lpReqFeedback);
+ /* Delete old */
+ TSK_OBJECT_SAFE_FREE(compartment->lpReqFeedback);
- compartment->lpReqFeedback = tcomp_buffer_create(tcomp_buffer_getBuffer(feedback), tcomp_buffer_getSize(feedback));
+ compartment->lpReqFeedback = tcomp_buffer_create(tcomp_buffer_getBuffer(feedback), tcomp_buffer_getSize(feedback));
- tsk_safeobj_unlock(compartment);
+ tsk_safeobj_unlock(compartment);
}
/**Sets returned feedback
*/
void tcomp_compartment_setRetFeedback(tcomp_compartment_t *compartment, tcomp_buffer_handle_t *feedback)
{
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
-
- tsk_safeobj_lock(compartment);
-
- // Delete old
- TSK_OBJECT_SAFE_FREE(compartment->lpRetFeedback);
-
- compartment->lpRetFeedback = tcomp_buffer_create(tcomp_buffer_getBuffer(feedback), tcomp_buffer_getSize(feedback));
-
- /*
- * ACK STATE ==> Returned feedback contains the partial state-id.
- */
- if(compartment->compressorData/* && !compartment->compressorData_isStream*/){
- tcomp_buffer_handle_t *stateid = tcomp_buffer_create(tcomp_buffer_getBufferAtPos(feedback, 1), tcomp_buffer_getSize(feedback)-1);
- compartment->ackGhost(compartment->compressorData, stateid);
- TSK_OBJECT_SAFE_FREE(stateid);
- }
-
- tsk_safeobj_unlock(compartment);
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
+
+ tsk_safeobj_lock(compartment);
+
+ // Delete old
+ TSK_OBJECT_SAFE_FREE(compartment->lpRetFeedback);
+
+ compartment->lpRetFeedback = tcomp_buffer_create(tcomp_buffer_getBuffer(feedback), tcomp_buffer_getSize(feedback));
+
+ /*
+ * ACK STATE ==> Returned feedback contains the partial state-id.
+ */
+ if(compartment->compressorData/* && !compartment->compressorData_isStream*/) {
+ tcomp_buffer_handle_t *stateid = tcomp_buffer_create(tcomp_buffer_getBufferAtPos(feedback, 1), tcomp_buffer_getSize(feedback)-1);
+ compartment->ackGhost(compartment->compressorData, stateid);
+ TSK_OBJECT_SAFE_FREE(stateid);
+ }
+
+ tsk_safeobj_unlock(compartment);
}
/**Clears are compartment from the history.
*/
void tcomp_compartment_clearStates(tcomp_compartment_t *compartment)
{
- if(!compartment){
- TSK_DEBUG_ERROR("NULL sigcomp compartment.");
- return;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("NULL sigcomp compartment.");
+ return;
+ }
- tsk_safeobj_lock(compartment);
+ tsk_safeobj_lock(compartment);
- tsk_list_clear_items(compartment->local_states);
- compartment->total_memory_left = compartment->total_memory_size;
+ tsk_list_clear_items(compartment->local_states);
+ compartment->total_memory_left = compartment->total_memory_size;
- tsk_safeobj_unlock(compartment);
+ tsk_safeobj_unlock(compartment);
}
/**Removes a state from the compartment by priority.
*/
void tcomp_compartment_freeStateByPriority(tcomp_compartment_t *compartment)
{
- tcomp_state_t *lpState;
- tsk_list_item_t *item;
-
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
-
- tsk_safeobj_lock(compartment);
-
- lpState = 0;
- item = 0;
-
- /*
- * The order in which the existing state items are freed is determined by the state_retention_priority, which is set when the
- * state items are created. The state_retention_priority of 65535 is reserved for locally available states; these states must always be
- * freed first. Apart from this special case, states with the lowest state_retention_priority are always freed first. In the event of
- * a tie, then the state item created first in the compartment is also the first to be freed.
- */
- tsk_list_foreach(item, compartment->local_states){
- tcomp_state_t *curr = item->data;
-
- if(!curr){
- continue;
- }
-
- /* Local state ? */
- if(curr->retention_priority == 65535){
- lpState = curr;
- break;
- }
-
- /* Lower priority? */
- if(!lpState || curr->retention_priority < lpState->retention_priority){
- lpState = curr;
- continue;
- }
- }
-
- if(lpState){
- compartment->total_memory_left += TCOMP_GET_STATE_SIZE(lpState);
- tsk_list_remove_item_by_data(compartment->local_states, lpState);
- }
-
- tsk_safeobj_unlock(compartment);
+ tcomp_state_t *lpState;
+ tsk_list_item_t *item;
+
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
+
+ tsk_safeobj_lock(compartment);
+
+ lpState = 0;
+ item = 0;
+
+ /*
+ * The order in which the existing state items are freed is determined by the state_retention_priority, which is set when the
+ * state items are created. The state_retention_priority of 65535 is reserved for locally available states; these states must always be
+ * freed first. Apart from this special case, states with the lowest state_retention_priority are always freed first. In the event of
+ * a tie, then the state item created first in the compartment is also the first to be freed.
+ */
+ tsk_list_foreach(item, compartment->local_states) {
+ tcomp_state_t *curr = item->data;
+
+ if(!curr) {
+ continue;
+ }
+
+ /* Local state ? */
+ if(curr->retention_priority == 65535) {
+ lpState = curr;
+ break;
+ }
+
+ /* Lower priority? */
+ if(!lpState || curr->retention_priority < lpState->retention_priority) {
+ lpState = curr;
+ continue;
+ }
+ }
+
+ if(lpState) {
+ compartment->total_memory_left += TCOMP_GET_STATE_SIZE(lpState);
+ tsk_list_remove_item_by_data(compartment->local_states, lpState);
+ }
+
+ tsk_safeobj_unlock(compartment);
}
/**Removes a state from the compartment.
*/
static void _tcomp_compartment_freeState(tcomp_compartment_t *compartment, tcomp_state_t **lpState)
{
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
- tsk_safeobj_lock(compartment);
+ tsk_safeobj_lock(compartment);
- compartment->total_memory_left += TCOMP_GET_STATE_SIZE(*lpState);
- tsk_list_remove_item_by_data(compartment->local_states, *lpState);
- *lpState = tsk_null;
+ compartment->total_memory_left += TCOMP_GET_STATE_SIZE(*lpState);
+ tsk_list_remove_item_by_data(compartment->local_states, *lpState);
+ *lpState = tsk_null;
- tsk_safeobj_unlock(compartment);
+ tsk_safeobj_unlock(compartment);
}
/**Remove states
@@ -267,211 +267,211 @@ static void _tcomp_compartment_freeState(tcomp_compartment_t *compartment, tcomp
*/
void tcomp_compartment_freeStates(tcomp_compartment_t *compartment, tcomp_tempstate_to_free_t **tempStates, uint8_t size)
{
- uint8_t i;
- tcomp_state_t *lpState;
- tsk_list_item_t *item;
-
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
-
- if(!tempStates || !size){
- return;
- }
-
- lpState = tsk_null;
- item = tsk_null;
-
- for (i = 0; i < size; i++){
- /* lock */
- tsk_safeobj_lock(compartment);
-
- tsk_list_foreach(item, compartment->local_states){
- tcomp_state_t *curr = item->data;
-
- /* Compare current state with provided partial state */
- if(tcomp_buffer_startsWith(curr->identifier, tempStates[i]->identifier)){
- /*
- * If more than one state item in the compartment matches the partial state identifier,
- * then the state free request is ignored.
- */
- TSK_DEBUG_INFO("Request to free state with usage_count=%d", curr->usage_count);
- if(tcomp_state_dec_usage_count(curr) == 0){
- if(lpState){
- lpState = tsk_null;
- break;
- }
- else{
- lpState = curr;
- }
- }
- }
- }
-
- /* unlock */
- tsk_safeobj_unlock(compartment);
-
- if(lpState){
- _tcomp_compartment_freeState(compartment, &lpState);
- }
- }
+ uint8_t i;
+ tcomp_state_t *lpState;
+ tsk_list_item_t *item;
+
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
+
+ if(!tempStates || !size) {
+ return;
+ }
+
+ lpState = tsk_null;
+ item = tsk_null;
+
+ for (i = 0; i < size; i++) {
+ /* lock */
+ tsk_safeobj_lock(compartment);
+
+ tsk_list_foreach(item, compartment->local_states) {
+ tcomp_state_t *curr = item->data;
+
+ /* Compare current state with provided partial state */
+ if(tcomp_buffer_startsWith(curr->identifier, tempStates[i]->identifier)) {
+ /*
+ * If more than one state item in the compartment matches the partial state identifier,
+ * then the state free request is ignored.
+ */
+ TSK_DEBUG_INFO("Request to free state with usage_count=%d", curr->usage_count);
+ if(tcomp_state_dec_usage_count(curr) == 0) {
+ if(lpState) {
+ lpState = tsk_null;
+ break;
+ }
+ else {
+ lpState = curr;
+ }
+ }
+ }
+ }
+
+ /* unlock */
+ tsk_safeobj_unlock(compartment);
+
+ if(lpState) {
+ _tcomp_compartment_freeState(compartment, &lpState);
+ }
+ }
}
/**Adds a state to the compartment.
*/
void tcomp_compartment_addState(tcomp_compartment_t *compartment, tcomp_state_t **lpState)
{
- tsk_list_item_t *item;
- int32_t usage_count = 0;
- const tcomp_buffer_handle_t *identifier;
- if(!compartment || !lpState || !*lpState){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
-
- tsk_safeobj_lock(compartment);
-
- tcomp_state_makeValid(*lpState);
- identifier = (*lpState)->identifier;
-
- // check if the state exist
- tsk_list_foreach(item, compartment->local_states){
- if(tcomp_buffer_startsWith(((tcomp_state_t*)item->data)->identifier, (*lpState)->identifier)){
- *lpState = ((tcomp_state_t*)item->data); // override
- usage_count = tcomp_state_inc_usage_count(*lpState);
- break;
- }
- }
-
- if(usage_count == 0){ // alread exist?
- compartment->total_memory_left -= TCOMP_GET_STATE_SIZE(*lpState);
- usage_count = tcomp_state_inc_usage_count(*lpState);
- tsk_list_push_back_data(compartment->local_states, ((void**) lpState));
- }
-
- TSK_DEBUG_INFO("SigComp - Add new state with usage_count=%d and id=", usage_count);
- tcomp_buffer_print(identifier);
-
- *lpState = tsk_null;
-
- tsk_safeobj_unlock(compartment);
+ tsk_list_item_t *item;
+ int32_t usage_count = 0;
+ const tcomp_buffer_handle_t *identifier;
+ if(!compartment || !lpState || !*lpState) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
+
+ tsk_safeobj_lock(compartment);
+
+ tcomp_state_makeValid(*lpState);
+ identifier = (*lpState)->identifier;
+
+ // check if the state exist
+ tsk_list_foreach(item, compartment->local_states) {
+ if(tcomp_buffer_startsWith(((tcomp_state_t*)item->data)->identifier, (*lpState)->identifier)) {
+ *lpState = ((tcomp_state_t*)item->data); // override
+ usage_count = tcomp_state_inc_usage_count(*lpState);
+ break;
+ }
+ }
+
+ if(usage_count == 0) { // alread exist?
+ compartment->total_memory_left -= TCOMP_GET_STATE_SIZE(*lpState);
+ usage_count = tcomp_state_inc_usage_count(*lpState);
+ tsk_list_push_back_data(compartment->local_states, ((void**) lpState));
+ }
+
+ TSK_DEBUG_INFO("SigComp - Add new state with usage_count=%d and id=", usage_count);
+ tcomp_buffer_print(identifier);
+
+ *lpState = tsk_null;
+
+ tsk_safeobj_unlock(compartment);
}
/**Finds a state.
*/
uint32_t tcomp_compartment_findState(tcomp_compartment_t *compartment, const tcomp_buffer_handle_t *partial_identifier, tcomp_state_t **lpState)
{
- uint32_t count = 0;
- tsk_list_item_t *item;
-
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_safeobj_lock(compartment);
-
- tsk_list_foreach(item, compartment->local_states){
- tcomp_state_t *curr = item->data;
-
- if(tcomp_buffer_startsWith(curr->identifier, partial_identifier)){
- *lpState = curr; // override
- count++;
- }
- }
-
- tsk_safeobj_unlock(compartment);
-
- return count;
+ uint32_t count = 0;
+ tsk_list_item_t *item;
+
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_safeobj_lock(compartment);
+
+ tsk_list_foreach(item, compartment->local_states) {
+ tcomp_state_t *curr = item->data;
+
+ if(tcomp_buffer_startsWith(curr->identifier, partial_identifier)) {
+ *lpState = curr; // override
+ count++;
+ }
+ }
+
+ tsk_safeobj_unlock(compartment);
+
+ return count;
}
/**Removes a Ghost state.
*/
void tcomp_compartment_freeGhostState(tcomp_compartment_t *compartment)
{
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
- tsk_safeobj_lock(compartment);
+ tsk_safeobj_lock(compartment);
- if(compartment->compressorData){
- compartment->freeGhostState(compartment->compressorData);
- }
- else{
- TSK_DEBUG_WARN("No compression data to free.");
- }
+ if(compartment->compressorData) {
+ compartment->freeGhostState(compartment->compressorData);
+ }
+ else {
+ TSK_DEBUG_WARN("No compression data to free.");
+ }
- tsk_safeobj_unlock(compartment);
+ tsk_safeobj_unlock(compartment);
}
/**Adds a NACK to the compartment.
*/
void tcomp_compartment_addNack(tcomp_compartment_t *compartment, const uint8_t nackId[TSK_SHA1_DIGEST_SIZE])
{
- tcomp_buffer_handle_t *id;
+ tcomp_buffer_handle_t *id;
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return;
- }
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return;
+ }
#if 0
- {
- int i;
- TSK_DEBUG_INFO("Save NACK with id:");
- for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i){
- printf("%x ", nackId[i]);
- }
- printf("\n");
- }
+ {
+ int i;
+ TSK_DEBUG_INFO("Save NACK with id:");
+ for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
+ printf("%x ", nackId[i]);
+ }
+ printf("\n");
+ }
#endif
- tsk_safeobj_lock(compartment);
+ tsk_safeobj_lock(compartment);
- if(compartment->nacks_history_count >= NACK_MAX_HISTORY_SIZE){
- tsk_list_remove_last_item(compartment->nacks);
- compartment->nacks_history_count--;
- }
+ if(compartment->nacks_history_count >= NACK_MAX_HISTORY_SIZE) {
+ tsk_list_remove_last_item(compartment->nacks);
+ compartment->nacks_history_count--;
+ }
- id = tcomp_buffer_create(nackId, TSK_SHA1_DIGEST_SIZE);
- tsk_list_push_back_data(compartment->nacks, ((void**) &id));
- compartment->nacks_history_count++;
+ id = tcomp_buffer_create(nackId, TSK_SHA1_DIGEST_SIZE);
+ tsk_list_push_back_data(compartment->nacks, ((void**) &id));
+ compartment->nacks_history_count++;
- tsk_safeobj_unlock(compartment);
+ tsk_safeobj_unlock(compartment);
}
/**Checks if the NACK exist.
*/
tsk_bool_t tcomp_compartment_hasNack(tcomp_compartment_t *compartment, const tcomp_buffer_handle_t *nackId)
{
- tsk_bool_t ret = tsk_false;
- tsk_list_item_t *item;
-
- if(!compartment){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_false;
- }
-
- tsk_safeobj_lock(compartment);
-
- item = tsk_null;
-
- tsk_list_foreach(item, compartment->nacks){
- tcomp_buffer_handle_t *curr = item->data;
-
- if(tcomp_buffer_equals(curr, nackId)){
- TSK_DEBUG_INFO("SigComp - Nack found.");
- ret = tsk_true;
- break;
- }
- }
-
- tsk_safeobj_unlock(compartment);
-
- return ret;
+ tsk_bool_t ret = tsk_false;
+ tsk_list_item_t *item;
+
+ if(!compartment) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_false;
+ }
+
+ tsk_safeobj_lock(compartment);
+
+ item = tsk_null;
+
+ tsk_list_foreach(item, compartment->nacks) {
+ tcomp_buffer_handle_t *curr = item->data;
+
+ if(tcomp_buffer_equals(curr, nackId)) {
+ TSK_DEBUG_INFO("SigComp - Nack found.");
+ ret = tsk_true;
+ break;
+ }
+ }
+
+ tsk_safeobj_unlock(compartment);
+
+ return ret;
}
@@ -489,64 +489,63 @@ tsk_bool_t tcomp_compartment_hasNack(tcomp_compartment_t *compartment, const tco
static tsk_object_t* tcomp_compartment_ctor(tsk_object_t* self, va_list * app)
{
- tcomp_compartment_t *compartment = self;
- if(compartment){
- /* Initialize safeobject */
- tsk_safeobj_init(compartment);
- }
+ tcomp_compartment_t *compartment = self;
+ if(compartment) {
+ /* Initialize safeobject */
+ tsk_safeobj_init(compartment);
+ }
- return self;
+ return self;
}
static tsk_object_t* tcomp_compartment_dtor(tsk_object_t* self)
{
- tcomp_compartment_t *compartment = self;
- if(compartment){
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(compartment);
-
- /* Delete feedbacks */
- TSK_OBJECT_SAFE_FREE(compartment->lpReqFeedback);
- TSK_OBJECT_SAFE_FREE(compartment->lpRetFeedback);
-
- /* Delete Nacks */
- TSK_OBJECT_SAFE_FREE(compartment->nacks);
-
- /* Delete Compressor data */
- TSK_OBJECT_SAFE_FREE(compartment->compressorData);
- compartment->ackGhost = tsk_null;
- compartment->freeGhostState = tsk_null;
-
- /* Delete params */
- TSK_OBJECT_SAFE_FREE(compartment->local_parameters);
- TSK_OBJECT_SAFE_FREE(compartment->remote_parameters);
-
- /* Delete NACKS */
- TSK_OBJECT_SAFE_FREE(compartment->nacks);
-
- /* Delete local states */
- TSK_OBJECT_SAFE_FREE(compartment->local_states);
- }
- else{
- TSK_DEBUG_ERROR("Null Compartment");
- }
-
- return self;
+ tcomp_compartment_t *compartment = self;
+ if(compartment) {
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(compartment);
+
+ /* Delete feedbacks */
+ TSK_OBJECT_SAFE_FREE(compartment->lpReqFeedback);
+ TSK_OBJECT_SAFE_FREE(compartment->lpRetFeedback);
+
+ /* Delete Nacks */
+ TSK_OBJECT_SAFE_FREE(compartment->nacks);
+
+ /* Delete Compressor data */
+ TSK_OBJECT_SAFE_FREE(compartment->compressorData);
+ compartment->ackGhost = tsk_null;
+ compartment->freeGhostState = tsk_null;
+
+ /* Delete params */
+ TSK_OBJECT_SAFE_FREE(compartment->local_parameters);
+ TSK_OBJECT_SAFE_FREE(compartment->remote_parameters);
+
+ /* Delete NACKS */
+ TSK_OBJECT_SAFE_FREE(compartment->nacks);
+
+ /* Delete local states */
+ TSK_OBJECT_SAFE_FREE(compartment->local_states);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Compartment");
+ }
+
+ return self;
}
static int tcomp_compartment_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tcomp_compartment_t *compartment1 = obj1;
- const tcomp_compartment_t *compartment2 = obj2;
- int64_t res = (compartment1->identifier - compartment2->identifier);
- return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
+ const tcomp_compartment_t *compartment1 = obj1;
+ const tcomp_compartment_t *compartment2 = obj2;
+ int64_t res = (compartment1->identifier - compartment2->identifier);
+ return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
}
-static const tsk_object_def_t tsk_compartment_def_s =
-{
- sizeof(tcomp_compartment_t),
- tcomp_compartment_ctor,
- tcomp_compartment_dtor,
- tcomp_compartment_cmp
+static const tsk_object_def_t tsk_compartment_def_s = {
+ sizeof(tcomp_compartment_t),
+ tcomp_compartment_ctor,
+ tcomp_compartment_dtor,
+ tcomp_compartment_cmp
};
const tsk_object_def_t *tcomp_compartment_def_t = &tsk_compartment_def_s;
diff --git a/tinySIGCOMP/src/tcomp_compartment.h b/tinySIGCOMP/src/tcomp_compartment.h
index f15ee82..82e50fc 100755
--- a/tinySIGCOMP/src/tcomp_compartment.h
+++ b/tinySIGCOMP/src/tcomp_compartment.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,32 +43,31 @@
TCOMP_BEGIN_DECLS
-typedef struct tcomp_compartment_s
-{
- TSK_DECLARE_OBJECT;
-
- /*
- * An identifier (in a locally chosen format) that uniquely references a compartment.
- */
- uint64_t identifier;
+typedef struct tcomp_compartment_s {
+ TSK_DECLARE_OBJECT;
+
+ /*
+ * An identifier (in a locally chosen format) that uniquely references a compartment.
+ */
+ uint64_t identifier;
- tcomp_states_L_t *local_states;
- tcomp_params_t *remote_parameters;
- tcomp_params_t *local_parameters;
- uint32_t total_memory_size;
- uint32_t total_memory_left;
+ tcomp_states_L_t *local_states;
+ tcomp_params_t *remote_parameters;
+ tcomp_params_t *local_parameters;
+ uint32_t total_memory_size;
+ uint32_t total_memory_left;
- tcomp_buffer_handle_t *lpReqFeedback;
- tcomp_buffer_handle_t *lpRetFeedback;
+ tcomp_buffer_handle_t *lpReqFeedback;
+ tcomp_buffer_handle_t *lpRetFeedback;
- TCOMP_DECLARE_COMPRESSORDATA;
+ TCOMP_DECLARE_COMPRESSORDATA;
- tcomp_buffers_L_t* nacks;
- uint8_t nacks_history_count;
+ tcomp_buffers_L_t* nacks;
+ uint8_t nacks_history_count;
- tsk_bool_t useOnlyACKedStates;
+ tsk_bool_t useOnlyACKedStates;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_compartment_t;
diff --git a/tinySIGCOMP/src/tcomp_compressor.h b/tinySIGCOMP/src/tcomp_compressor.h
index 6d71401..6b3ebba 100755
--- a/tinySIGCOMP/src/tcomp_compressor.h
+++ b/tinySIGCOMP/src/tcomp_compressor.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_compressor_deflate.c b/tinySIGCOMP/src/tcomp_compressor_deflate.c
index fcce528..e01ebaf 100755
--- a/tinySIGCOMP/src/tcomp_compressor_deflate.c
+++ b/tinySIGCOMP/src/tcomp_compressor_deflate.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,181 +38,180 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
///
-/// @brief Compress SIgComp message using deflate algorithm.
+/// @brief Compress SIgComp message using deflate algorithm.
///
-/// @param [in,out] lpCompartment If non-null, the pointer to a compartment.
-/// @param [in,out] input_ptr If non-null, the input pointer.
-/// @param input_size Size of the input.
-/// @param [in,out] output_ptr If non-null, the output pointer.
-/// @param [in,out] output_size If non-null, size of the output.
-/// @param stream The stream.
+/// @param [in,out] lpCompartment If non-null, the pointer to a compartment.
+/// @param [in,out] input_ptr If non-null, the input pointer.
+/// @param input_size Size of the input.
+/// @param [in,out] output_ptr If non-null, the output pointer.
+/// @param [in,out] output_size If non-null, size of the output.
+/// @param stream The stream.
///
-/// @return .
+/// @return .
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t tcomp_compressor_deflate_compress(tcomp_compartment_t *lpCompartment, const void *input_ptr, tsk_size_t input_size, void *output_ptr, tsk_size_t *output_size, tsk_bool_t stream)
{
#define GET_OUTPUT_BUFFER_AT(position) (((uint8_t*)output_ptr) + position)
- tsk_bool_t result = tsk_true;
- int stateChanged, stateful, windowBits, zret;
- tcomp_deflatedata_t *deflatedata = 0;
- tsk_size_t pointer = 0, state_len_index = 0, compressedDataLen;
- uint8_t smsCode, *header;
-
- tsk_safeobj_lock(lpCompartment);
-
- /* Compression Data */
- if(!lpCompartment->compressorData){
- lpCompartment->compressorData = tcomp_deflatedata_create(stream, lpCompartment->useOnlyACKedStates);
- if(!lpCompartment->compressorData){
- TSK_DEBUG_ERROR("Failed to create deflate compressor data.");
- result = tsk_false;
- goto bail;
- }
- else{
- lpCompartment->ackGhost = tcomp_deflatedata_ackGhost;
- lpCompartment->freeGhostState = tcomp_deflatedata_freeGhostState;
- lpCompartment->compressorData_isStream = stream;
- }
- }
-
- deflatedata = lpCompartment->compressorData;
-
- /* State memory size code */
- smsCode = TCOMP_MIN(lpCompartment->remote_parameters->smsCode, lpCompartment->remote_parameters->dmsCode);
- if(lpCompartment->useOnlyACKedStates){
- stateful = (deflatedata->ghostState && tcomp_deflatedata_isStateful(deflatedata));
- }
- else{
- stateful = !!deflatedata->ghostState;
- }
-
- /*
- * Init zLIB
- */
- windowBits = ( smsCode - (stream ? 2 : 1) ) + 10;
- windowBits = TSK_CLAMP(8, windowBits, 15); /* Because of zlib limitation (windowsize MUST be between 8 and 15) */
- if(windowBits != deflatedata->zWindowBits){
- /* Window size changed */
- tcomp_deflatedata_freeGhostState(deflatedata);
- tcomp_deflatedata_zSetWindowBits(deflatedata, windowBits);
-
- if( !(result = tcomp_deflatedata_zReset(deflatedata)) ) {
- goto bail;
- }
- }
- else if(!deflatedata->ghostState){
- /* No ghost --> reset zlib */
- deflatedata->ghost_copy_offset = 0;
- if( !(result = tcomp_deflatedata_zReset(deflatedata)) ) {
- goto bail;
- }
- }
-
- stateful &= !!deflatedata->ghostState;
-
- /*
- * SigComp headers
- */
- header = GET_OUTPUT_BUFFER_AT(pointer++);
-
-
- /* SigComp Header */
- if(lpCompartment->lpReqFeedback && tcomp_buffer_getSize(lpCompartment->lpReqFeedback)){
- /* Return the requested feedback */
- *header = 0xfc; /* T=1 */
- memcpy(GET_OUTPUT_BUFFER_AT(pointer), tcomp_buffer_getBuffer(lpCompartment->lpReqFeedback), tcomp_buffer_getSize(lpCompartment->lpReqFeedback));
- pointer += tcomp_buffer_getSize(lpCompartment->lpReqFeedback);
- }
- else{
- *header = 0xf8;
- }
-
- /*
- * Stateless or stateful?
- */
- if(stateful){
- TSK_DEBUG_INFO("SigComp - Compressing message with state id = ");
- tcomp_buffer_print(deflatedata->ghostState->identifier);
- memcpy(GET_OUTPUT_BUFFER_AT(pointer), tcomp_buffer_getBuffer(deflatedata->ghostState->identifier), TCOMP_PARTIAL_ID_LEN_VALUE);
-
- pointer += TCOMP_PARTIAL_ID_LEN_VALUE;
- *header |= TCOMP_PARTIAL_ID_LEN_CODE;
- }
- else{
- uint32_t codeLen = DEFLATE_BYTECODE_LEN;
- /* first byte for codelen */
- *GET_OUTPUT_BUFFER_AT(pointer++) = ((codeLen>>4)& 0x00ff);
- /* last 4 bits for codelen */
- *GET_OUTPUT_BUFFER_AT(pointer) = ((codeLen & 0x000f)<<4);
- /* first and last 4 bits for destination */
- *GET_OUTPUT_BUFFER_AT(pointer++) |= DEFLATE_BYTECODE_DESTINATION_CODE;
-
- /*
- * Upload UDVM bytecode
- */
- memcpy(GET_OUTPUT_BUFFER_AT(pointer), (const uint8_t*)DEFLATEDATA_DEFLATE_BYTECODE, codeLen);
- pointer += codeLen;
-
- //////////////////////////////////////////////////
- // FIXME: check for overflow and >=320
- //
- // [DMS]+[Req. Fed. Loc.]+[state_len]+[cpb||dms||sms]+[Sigcomp_version]+[states]
- //*output_buffer.getBuffer(pointer++) = 0x04; //reserved=0, Q=1, S=0, I=0
- //*output_buffer.getBuffer(pointer++) = (this->req_feedback_item++); //requested feedback item
-
- state_len_index = pointer;
- *GET_OUTPUT_BUFFER_AT(pointer) = 0x00, pointer += 4; /* [hash_len]+[state_len] */
- *GET_OUTPUT_BUFFER_AT(pointer++) = (tcomp_params_getParameters(lpCompartment->local_parameters)>>8); // [cpb||dms||sms]
- *GET_OUTPUT_BUFFER_AT(pointer++) = (tcomp_params_getParameters(lpCompartment->local_parameters)&0x00ff); // [Sigcomp_version]
+ tsk_bool_t result = tsk_true;
+ int stateChanged, stateful, windowBits, zret;
+ tcomp_deflatedata_t *deflatedata = 0;
+ tsk_size_t pointer = 0, state_len_index = 0, compressedDataLen;
+ uint8_t smsCode, *header;
+
+ tsk_safeobj_lock(lpCompartment);
+
+ /* Compression Data */
+ if(!lpCompartment->compressorData) {
+ lpCompartment->compressorData = tcomp_deflatedata_create(stream, lpCompartment->useOnlyACKedStates);
+ if(!lpCompartment->compressorData) {
+ TSK_DEBUG_ERROR("Failed to create deflate compressor data.");
+ result = tsk_false;
+ goto bail;
+ }
+ else {
+ lpCompartment->ackGhost = tcomp_deflatedata_ackGhost;
+ lpCompartment->freeGhostState = tcomp_deflatedata_freeGhostState;
+ lpCompartment->compressorData_isStream = stream;
+ }
+ }
+
+ deflatedata = lpCompartment->compressorData;
+
+ /* State memory size code */
+ smsCode = TCOMP_MIN(lpCompartment->remote_parameters->smsCode, lpCompartment->remote_parameters->dmsCode);
+ if(lpCompartment->useOnlyACKedStates) {
+ stateful = (deflatedata->ghostState && tcomp_deflatedata_isStateful(deflatedata));
+ }
+ else {
+ stateful = !!deflatedata->ghostState;
+ }
+
+ /*
+ * Init zLIB
+ */
+ windowBits = ( smsCode - (stream ? 2 : 1) ) + 10;
+ windowBits = TSK_CLAMP(8, windowBits, 15); /* Because of zlib limitation (windowsize MUST be between 8 and 15) */
+ if(windowBits != deflatedata->zWindowBits) {
+ /* Window size changed */
+ tcomp_deflatedata_freeGhostState(deflatedata);
+ tcomp_deflatedata_zSetWindowBits(deflatedata, windowBits);
+
+ if( !(result = tcomp_deflatedata_zReset(deflatedata)) ) {
+ goto bail;
+ }
+ }
+ else if(!deflatedata->ghostState) {
+ /* No ghost --> reset zlib */
+ deflatedata->ghost_copy_offset = 0;
+ if( !(result = tcomp_deflatedata_zReset(deflatedata)) ) {
+ goto bail;
+ }
+ }
+
+ stateful &= !!deflatedata->ghostState;
+
+ /*
+ * SigComp headers
+ */
+ header = GET_OUTPUT_BUFFER_AT(pointer++);
+
+
+ /* SigComp Header */
+ if(lpCompartment->lpReqFeedback && tcomp_buffer_getSize(lpCompartment->lpReqFeedback)) {
+ /* Return the requested feedback */
+ *header = 0xfc; /* T=1 */
+ memcpy(GET_OUTPUT_BUFFER_AT(pointer), tcomp_buffer_getBuffer(lpCompartment->lpReqFeedback), tcomp_buffer_getSize(lpCompartment->lpReqFeedback));
+ pointer += tcomp_buffer_getSize(lpCompartment->lpReqFeedback);
+ }
+ else {
+ *header = 0xf8;
+ }
+
+ /*
+ * Stateless or stateful?
+ */
+ if(stateful) {
+ TSK_DEBUG_INFO("SigComp - Compressing message with state id = ");
+ tcomp_buffer_print(deflatedata->ghostState->identifier);
+ memcpy(GET_OUTPUT_BUFFER_AT(pointer), tcomp_buffer_getBuffer(deflatedata->ghostState->identifier), TCOMP_PARTIAL_ID_LEN_VALUE);
+
+ pointer += TCOMP_PARTIAL_ID_LEN_VALUE;
+ *header |= TCOMP_PARTIAL_ID_LEN_CODE;
+ }
+ else {
+ uint32_t codeLen = DEFLATE_BYTECODE_LEN;
+ /* first byte for codelen */
+ *GET_OUTPUT_BUFFER_AT(pointer++) = ((codeLen>>4)& 0x00ff);
+ /* last 4 bits for codelen */
+ *GET_OUTPUT_BUFFER_AT(pointer) = ((codeLen & 0x000f)<<4);
+ /* first and last 4 bits for destination */
+ *GET_OUTPUT_BUFFER_AT(pointer++) |= DEFLATE_BYTECODE_DESTINATION_CODE;
+
+ /*
+ * Upload UDVM bytecode
+ */
+ memcpy(GET_OUTPUT_BUFFER_AT(pointer), (const uint8_t*)DEFLATEDATA_DEFLATE_BYTECODE, codeLen);
+ pointer += codeLen;
+
+ //////////////////////////////////////////////////
+ // FIXME: check for overflow and >=320
+ //
+ // [DMS]+[Req. Fed. Loc.]+[state_len]+[cpb||dms||sms]+[Sigcomp_version]+[states]
+ //*output_buffer.getBuffer(pointer++) = 0x04; //reserved=0, Q=1, S=0, I=0
+ //*output_buffer.getBuffer(pointer++) = (this->req_feedback_item++); //requested feedback item
+
+ state_len_index = pointer;
+ *GET_OUTPUT_BUFFER_AT(pointer) = 0x00, pointer += 4; /* [hash_len]+[state_len] */
+ *GET_OUTPUT_BUFFER_AT(pointer++) = (tcomp_params_getParameters(lpCompartment->local_parameters)>>8); // [cpb||dms||sms]
+ *GET_OUTPUT_BUFFER_AT(pointer++) = (tcomp_params_getParameters(lpCompartment->local_parameters)&0x00ff); // [Sigcomp_version]
#if USE_DICTS_FOR_COMPRESSION
- *output_buffer.getBuffer(pointer++) = 0x00; // First dict byte // FIXME
- *output_buffer.getBuffer(pointer++) = DEFLATE_FIXME_DICT; // FIXME: also change ghost
+ *output_buffer.getBuffer(pointer++) = 0x00; // First dict byte // FIXME
+ *output_buffer.getBuffer(pointer++) = DEFLATE_FIXME_DICT; // FIXME: also change ghost
#endif
- }
-
- /*
- * Compress data using ZLIB
- */
- compressedDataLen = (*output_size - pointer);
- zret = tcomp_deflatedata_zCompress(deflatedata, input_ptr, input_size, GET_OUTPUT_BUFFER_AT(pointer), &compressedDataLen, &stateChanged);
- if(!zret){
- result = tsk_false;
- goto bail;
- }
- pointer += compressedDataLen;
- *output_size = (pointer);
-
- /*
- * Update state length
- */
- if(!stateful){
- uint32_t state_len = ( (1<<(deflatedata->zWindowBits)) + DEFLATE_UDVM_CIRCULAR_START_INDEX - 64 );
- uint32_t hash_len = (state_len + 8);
-
- // FIXME: 131072 could not go in 2-bytes
- *GET_OUTPUT_BUFFER_AT(state_len_index) = (hash_len >> 8);
- *GET_OUTPUT_BUFFER_AT(state_len_index+1) = (hash_len & 0x00ff);
- *GET_OUTPUT_BUFFER_AT(state_len_index+2) = (state_len >> 8);
- *GET_OUTPUT_BUFFER_AT(state_len_index+3) = (state_len & 0x00ff);
-
- /* First time or synchronize failure (NACK reason=STATE_NOT_FOUND) */
- if(!deflatedata->ghostState){
- tcomp_deflatedata_createGhost(deflatedata, state_len, lpCompartment->local_parameters);
- }
- }
- if(!lpCompartment->useOnlyACKedStates || (lpCompartment->useOnlyACKedStates && stateChanged))
- {
- tcomp_deflatedata_updateGhost(deflatedata, (const uint8_t*)input_ptr, input_size);
- }
-
- //output_buffer.print(2000);
-
+ }
+
+ /*
+ * Compress data using ZLIB
+ */
+ compressedDataLen = (*output_size - pointer);
+ zret = tcomp_deflatedata_zCompress(deflatedata, input_ptr, input_size, GET_OUTPUT_BUFFER_AT(pointer), &compressedDataLen, &stateChanged);
+ if(!zret) {
+ result = tsk_false;
+ goto bail;
+ }
+ pointer += compressedDataLen;
+ *output_size = (pointer);
+
+ /*
+ * Update state length
+ */
+ if(!stateful) {
+ uint32_t state_len = ( (1<<(deflatedata->zWindowBits)) + DEFLATE_UDVM_CIRCULAR_START_INDEX - 64 );
+ uint32_t hash_len = (state_len + 8);
+
+ // FIXME: 131072 could not go in 2-bytes
+ *GET_OUTPUT_BUFFER_AT(state_len_index) = (hash_len >> 8);
+ *GET_OUTPUT_BUFFER_AT(state_len_index+1) = (hash_len & 0x00ff);
+ *GET_OUTPUT_BUFFER_AT(state_len_index+2) = (state_len >> 8);
+ *GET_OUTPUT_BUFFER_AT(state_len_index+3) = (state_len & 0x00ff);
+
+ /* First time or synchronize failure (NACK reason=STATE_NOT_FOUND) */
+ if(!deflatedata->ghostState) {
+ tcomp_deflatedata_createGhost(deflatedata, state_len, lpCompartment->local_parameters);
+ }
+ }
+ if(!lpCompartment->useOnlyACKedStates || (lpCompartment->useOnlyACKedStates && stateChanged)) {
+ tcomp_deflatedata_updateGhost(deflatedata, (const uint8_t*)input_ptr, input_size);
+ }
+
+ //output_buffer.print(2000);
+
bail:
- tsk_safeobj_unlock(lpCompartment);
+ tsk_safeobj_unlock(lpCompartment);
- return result;
+ return result;
#undef GET_OUTPUT_BUFFER_AT
}
diff --git a/tinySIGCOMP/src/tcomp_compressor_deflate.h b/tinySIGCOMP/src/tcomp_compressor_deflate.h
index 81216ad..92fe474 100755
--- a/tinySIGCOMP/src/tcomp_compressor_deflate.h
+++ b/tinySIGCOMP/src/tcomp_compressor_deflate.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_compressor_dummy.c b/tinySIGCOMP/src/tcomp_compressor_dummy.c
index 34d062d..f5efdf6 100755
--- a/tinySIGCOMP/src/tcomp_compressor_dummy.c
+++ b/tinySIGCOMP/src/tcomp_compressor_dummy.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,62 +43,62 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @brief Dummy compressor as per RFC 4896 subclause 11. This function is used to create uncompressed sigcomp message.
-/// Used if none match.
+/// Used if none match.
///
-/// @param [in,out] lpCompartment The compartment to use.
-/// @param [in,out] input_ptr The input buffer containing the message to compress.
-/// @param input_size The size of the input buffer.
-/// @param [in,out] output_ptr The output buffer where to copy the compressed message.
+/// @param [in,out] lpCompartment The compartment to use.
+/// @param [in,out] input_ptr The input buffer containing the message to compress.
+/// @param input_size The size of the input buffer.
+/// @param [in,out] output_ptr The output buffer where to copy the compressed message.
/// @param [in,out] output_size The size of the output buffer.
-/// @param stream Indicates whether it's a stream buffer or not.
+/// @param stream Indicates whether it's a stream buffer or not.
///
-/// @return 1 if succedd and 0 otherwise.
+/// @return 1 if succedd and 0 otherwise.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t tcomp_compressor_dummy_compress(tcomp_compartment_t *lpCompartment, const void *input_ptr, tsk_size_t input_size, void *output_ptr, tsk_size_t *output_size, tsk_bool_t stream)
{
- tcomp_buffer_handle_t *output_buffer = tcomp_buffer_create_null();
- tsk_size_t pointer = 0;
- uint8_t *header;
- uint32_t codeLen;
-
- tcomp_buffer_referenceBuff(output_buffer, (uint8_t*)output_ptr, *output_size);
- header = tcomp_buffer_getBufferAtPos(output_buffer, pointer++);
-
- /* SigComp Header */
- if(lpCompartment->lpReqFeedback && tcomp_buffer_getSize(lpCompartment->lpReqFeedback)){
- /* Return the requested feedback */
- *header = 0xfc; /* T=1 */
- memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), tcomp_buffer_getBuffer(lpCompartment->lpReqFeedback), tcomp_buffer_getSize(lpCompartment->lpReqFeedback));
- pointer += tcomp_buffer_getSize(lpCompartment->lpReqFeedback);
- }
- else{
- *header = 0xf8;
- }
-
- codeLen = UNCOMPRESSED_BYTECODE_LENGTH;
- /* first byte for codelen */
- *tcomp_buffer_getBufferAtPos(output_buffer, pointer++) = ((codeLen>>4)& 0x00ff);
-
- /* last 4 bits for codelen */
- *tcomp_buffer_getBufferAtPos(output_buffer, pointer) = ((codeLen & 0x000f)<<4);
-
- /* first and last 4 bits for destination */
- *tcomp_buffer_getBufferAtPos(output_buffer, pointer++) |= UNCOMPRESSED_BYTECODE_DESTINATION_CODE;
-
- /*
- * Upload UDVM bytecode
- */
- memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), (uint8_t*)DUMMYCOMPRESSOR_UNCOMPRESSED_BYTECODE, codeLen);
- pointer += codeLen;
-
- /*
- * Copy data uncompressed
- */
- memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), input_ptr, input_size);
- pointer += input_size;
- *output_size = (pointer);
-
- TSK_OBJECT_SAFE_FREE(output_buffer);
-
- return tsk_true;
+ tcomp_buffer_handle_t *output_buffer = tcomp_buffer_create_null();
+ tsk_size_t pointer = 0;
+ uint8_t *header;
+ uint32_t codeLen;
+
+ tcomp_buffer_referenceBuff(output_buffer, (uint8_t*)output_ptr, *output_size);
+ header = tcomp_buffer_getBufferAtPos(output_buffer, pointer++);
+
+ /* SigComp Header */
+ if(lpCompartment->lpReqFeedback && tcomp_buffer_getSize(lpCompartment->lpReqFeedback)) {
+ /* Return the requested feedback */
+ *header = 0xfc; /* T=1 */
+ memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), tcomp_buffer_getBuffer(lpCompartment->lpReqFeedback), tcomp_buffer_getSize(lpCompartment->lpReqFeedback));
+ pointer += tcomp_buffer_getSize(lpCompartment->lpReqFeedback);
+ }
+ else {
+ *header = 0xf8;
+ }
+
+ codeLen = UNCOMPRESSED_BYTECODE_LENGTH;
+ /* first byte for codelen */
+ *tcomp_buffer_getBufferAtPos(output_buffer, pointer++) = ((codeLen>>4)& 0x00ff);
+
+ /* last 4 bits for codelen */
+ *tcomp_buffer_getBufferAtPos(output_buffer, pointer) = ((codeLen & 0x000f)<<4);
+
+ /* first and last 4 bits for destination */
+ *tcomp_buffer_getBufferAtPos(output_buffer, pointer++) |= UNCOMPRESSED_BYTECODE_DESTINATION_CODE;
+
+ /*
+ * Upload UDVM bytecode
+ */
+ memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), (uint8_t*)DUMMYCOMPRESSOR_UNCOMPRESSED_BYTECODE, codeLen);
+ pointer += codeLen;
+
+ /*
+ * Copy data uncompressed
+ */
+ memcpy(tcomp_buffer_getBufferAtPos(output_buffer, pointer), input_ptr, input_size);
+ pointer += input_size;
+ *output_size = (pointer);
+
+ TSK_OBJECT_SAFE_FREE(output_buffer);
+
+ return tsk_true;
}
diff --git a/tinySIGCOMP/src/tcomp_compressor_dummy.h b/tinySIGCOMP/src/tcomp_compressor_dummy.h
index 50c7c88..937131e 100755
--- a/tinySIGCOMP/src/tcomp_compressor_dummy.h
+++ b/tinySIGCOMP/src/tcomp_compressor_dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_compressordata.c b/tinySIGCOMP/src/tcomp_compressordata.c
index 1d8fe54..8c0494b 100755
--- a/tinySIGCOMP/src/tcomp_compressordata.c
+++ b/tinySIGCOMP/src/tcomp_compressordata.c
@@ -2,19 +2,19 @@
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-//*
+//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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 3 of the License, or
//* (at your option) any later version.
-//*
+//*
//* DOUBANGO 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 DOUBANGO.
//*
@@ -84,7 +84,7 @@
// {
// /* Initialize safeobject */
// tsk_safeobj_init(compdata);
-//
+//
// compdata->isStream = va_arg(*app, int);
// }
//
@@ -105,7 +105,7 @@
// return self;
//}
//
-//static const tsk_object_def_t tsk_compressordata_def_s =
+//static const tsk_object_def_t tsk_compressordata_def_s =
//{
// sizeof(tcomp_compressordata_t),
// tcomp_compressordata_create,
diff --git a/tinySIGCOMP/src/tcomp_compressordata.h b/tinySIGCOMP/src/tcomp_compressordata.h
index 917fa5e..f23dfd0 100755
--- a/tinySIGCOMP/src/tcomp_compressordata.h
+++ b/tinySIGCOMP/src/tcomp_compressordata.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_compressordisp.c b/tinySIGCOMP/src/tcomp_compressordisp.c
index 13ab5fd..da7bcc4 100755
--- a/tinySIGCOMP/src/tcomp_compressordisp.c
+++ b/tinySIGCOMP/src/tcomp_compressordisp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,138 +46,138 @@
*/
tcomp_compressordisp_t* tcomp_compressordisp_create(const tcomp_statehandler_t* statehandler)
{
- return tsk_object_new(tcomp_compressordisp_def_t, statehandler);
+ return tsk_object_new(tcomp_compressordisp_def_t, statehandler);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// Compress a message.
///
-/// @param [in,out] dispatcher The compressor dispatcher.
-/// @param compartmentId The compartment to use to compress the message.
-/// @param [in,out] input_ptr The message to compress.
-/// @param input_size The size of the input buffer.
-/// @param [in,out] output_ptr The output buffer to copy the compressed data.
-/// @param [in,out] output_size The size of the output buffer.
-/// @param stream Indicates whether it's a stream buffer or not.
+/// @param [in,out] dispatcher The compressor dispatcher.
+/// @param compartmentId The compartment to use to compress the message.
+/// @param [in,out] input_ptr The message to compress.
+/// @param input_size The size of the input buffer.
+/// @param [in,out] output_ptr The output buffer to copy the compressed data.
+/// @param [in,out] output_size The size of the output buffer.
+/// @param stream Indicates whether it's a stream buffer or not.
///
-/// @return @a tsk_true if succeed and @a tsk_false otherwize.
+/// @return @a tsk_true if succeed and @a tsk_false otherwize.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t tcomp_compressordisp_compress(tcomp_compressordisp_t *dispatcher, uint64_t compartmentId, const void *input_ptr, tsk_size_t input_size, void *output_ptr, tsk_size_t *output_size, tsk_bool_t stream)
{
- tsk_bool_t ret = tsk_true;
- int i = 0;
-
- /* For each compartment id create/retrieve one compressor instance */
- tcomp_compartment_t *lpCompartment = tcomp_statehandler_getCompartment(dispatcher->stateHandler, compartmentId);
-
- if(!lpCompartment){
- TSK_DEBUG_ERROR("You must provide a valid compartment to perform compression.");
- return tsk_false;
- }
-
-
- /*
- * Performs compression.
- */
- tsk_safeobj_lock(dispatcher);
-
- for( i = 0; (i < TCOMP_MAX_COMPRESSORS && dispatcher->compressors[i]); i++ ){
- if((ret = dispatcher->compressors[i](lpCompartment, input_ptr, input_size, output_ptr, output_size, stream))) {
- break;
- }
- }
-
- tsk_safeobj_unlock(dispatcher);
-
-
- /*
- * STREAM case. FIXME:Because I'm a lazy man I only support 0xFF00 case
- */
- if(stream){
- uint8_t* escapedBuffer;
- tsk_size_t i, j;
- tsk_size_t escapedBufferSize = (*output_size + 2); /* 2 = strlen(0xffff) */
-
- for(i = 0; i < *output_size ; i++) {
- escapedBufferSize += ((uint8_t*)output_ptr)[i] == 0xff ? 1 : 0;
- }
- escapedBuffer = (uint8_t*)tsk_calloc(escapedBufferSize, sizeof(uint8_t));
-
- for(i = 0, j = 0; i < *output_size; i++, j++){
- escapedBuffer[j] = ((uint8_t*)output_ptr)[i];
- if(escapedBuffer[j] == 0xff) {
- escapedBuffer[++j] = 0x00;
- }
- }
-
- /* End stream */
- escapedBuffer[escapedBufferSize-1] = escapedBuffer[escapedBufferSize-2] = 0xff;
- memcpy(output_ptr, escapedBuffer, escapedBufferSize);
-
- *output_size = escapedBufferSize; /* Update size */
- TSK_FREE(escapedBuffer); /* free */
- }
-
- /*
- * NACK
- */
- if(ret && TCOMP_NACK_SUPPORTED){
- /* store nack for later retrieval in case of errors */
- uint8_t nackId[TSK_SHA1_DIGEST_SIZE];
- tsk_sha1context_t sha;
-
- tsk_sha1reset(&sha);
- tsk_sha1input(&sha, (const uint8_t*)output_ptr, *output_size);
- tsk_sha1result(&sha, (uint8_t*)nackId);
- tcomp_compartment_addNack(lpCompartment, nackId);
- }
-
- return ret;
+ tsk_bool_t ret = tsk_true;
+ int i = 0;
+
+ /* For each compartment id create/retrieve one compressor instance */
+ tcomp_compartment_t *lpCompartment = tcomp_statehandler_getCompartment(dispatcher->stateHandler, compartmentId);
+
+ if(!lpCompartment) {
+ TSK_DEBUG_ERROR("You must provide a valid compartment to perform compression.");
+ return tsk_false;
+ }
+
+
+ /*
+ * Performs compression.
+ */
+ tsk_safeobj_lock(dispatcher);
+
+ for( i = 0; (i < TCOMP_MAX_COMPRESSORS && dispatcher->compressors[i]); i++ ) {
+ if((ret = dispatcher->compressors[i](lpCompartment, input_ptr, input_size, output_ptr, output_size, stream))) {
+ break;
+ }
+ }
+
+ tsk_safeobj_unlock(dispatcher);
+
+
+ /*
+ * STREAM case. FIXME:Because I'm a lazy man I only support 0xFF00 case
+ */
+ if(stream) {
+ uint8_t* escapedBuffer;
+ tsk_size_t i, j;
+ tsk_size_t escapedBufferSize = (*output_size + 2); /* 2 = strlen(0xffff) */
+
+ for(i = 0; i < *output_size ; i++) {
+ escapedBufferSize += ((uint8_t*)output_ptr)[i] == 0xff ? 1 : 0;
+ }
+ escapedBuffer = (uint8_t*)tsk_calloc(escapedBufferSize, sizeof(uint8_t));
+
+ for(i = 0, j = 0; i < *output_size; i++, j++) {
+ escapedBuffer[j] = ((uint8_t*)output_ptr)[i];
+ if(escapedBuffer[j] == 0xff) {
+ escapedBuffer[++j] = 0x00;
+ }
+ }
+
+ /* End stream */
+ escapedBuffer[escapedBufferSize-1] = escapedBuffer[escapedBufferSize-2] = 0xff;
+ memcpy(output_ptr, escapedBuffer, escapedBufferSize);
+
+ *output_size = escapedBufferSize; /* Update size */
+ TSK_FREE(escapedBuffer); /* free */
+ }
+
+ /*
+ * NACK
+ */
+ if(ret && TCOMP_NACK_SUPPORTED) {
+ /* store nack for later retrieval in case of errors */
+ uint8_t nackId[TSK_SHA1_DIGEST_SIZE];
+ tsk_sha1context_t sha;
+
+ tsk_sha1reset(&sha);
+ tsk_sha1input(&sha, (const uint8_t*)output_ptr, *output_size);
+ tsk_sha1result(&sha, (uint8_t*)nackId);
+ tcomp_compartment_addNack(lpCompartment, nackId);
+ }
+
+ return ret;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// Adds new compressor the list of the compressors.
+/// Adds new compressor the list of the compressors.
///
///
-/// @param [in,out] dispatcher The compressor dispatcher.
-/// @param compressor A function pointer to the new compressor.
+/// @param [in,out] dispatcher The compressor dispatcher.
+/// @param compressor A function pointer to the new compressor.
////////////////////////////////////////////////////////////////////////////////////////////////////
int tcomp_compressordisp_addCompressor(tcomp_compressordisp_t *dispatcher, tcomp_compressor_compress_f compressor)
{
- tsk_size_t i;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for(i = 0; i < TCOMP_MAX_COMPRESSORS; i++){
- if(!dispatcher->compressors[i]){
- dispatcher->compressors[i] = compressor;
- return 0;
- }
- }
- return -2;
+ tsk_size_t i;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for(i = 0; i < TCOMP_MAX_COMPRESSORS; i++) {
+ if(!dispatcher->compressors[i]) {
+ dispatcher->compressors[i] = compressor;
+ return 0;
+ }
+ }
+ return -2;
}
/** Removes a compressor
*/
int tcomp_compressordisp_removeCompressor(tcomp_compressordisp_t *dispatcher, tcomp_compressor_compress_f compressor)
{
- tsk_size_t i;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- for(i = 0; i < TCOMP_MAX_COMPRESSORS; i++){
- if(dispatcher->compressors[i] == compressor){
- dispatcher->compressors[i] = tsk_null;
- return 0;
- }
- }
- return -2;
+ tsk_size_t i;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ for(i = 0; i < TCOMP_MAX_COMPRESSORS; i++) {
+ if(dispatcher->compressors[i] == compressor) {
+ dispatcher->compressors[i] = tsk_null;
+ return 0;
+ }
+ }
+ return -2;
}
@@ -192,46 +192,45 @@ int tcomp_compressordisp_removeCompressor(tcomp_compressordisp_t *dispatcher, tc
//
static tsk_object_t* tcomp_compressordisp_ctor(tsk_object_t * self, va_list * app)
{
- tcomp_compressordisp_t *compressordisp = self;
- if(compressordisp){
- int i = 0;
- compressordisp->stateHandler = va_arg(*app, const tcomp_statehandler_t*);
-
- compressordisp->compressors[0] = tcomp_compressor_deflate_compress; /* If you don't want deflate compressor then remove this line. */
- compressordisp->compressors[1] = tcomp_compressor_dummy_compress; /* RFC 4896 [11. Uncompressed Bytecode]. */
-
- /* Initialize safeobject */
- tsk_safeobj_init(compressordisp);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new compressor dispatcher.");
- }
-
- return self;
+ tcomp_compressordisp_t *compressordisp = self;
+ if(compressordisp) {
+ int i = 0;
+ compressordisp->stateHandler = va_arg(*app, const tcomp_statehandler_t*);
+
+ compressordisp->compressors[0] = tcomp_compressor_deflate_compress; /* If you don't want deflate compressor then remove this line. */
+ compressordisp->compressors[1] = tcomp_compressor_dummy_compress; /* RFC 4896 [11. Uncompressed Bytecode]. */
+
+ /* Initialize safeobject */
+ tsk_safeobj_init(compressordisp);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new compressor dispatcher.");
+ }
+
+ return self;
}
static tsk_object_t* tcomp_compressordisp_dtor(tsk_object_t *self)
{
- tcomp_compressordisp_t *compressordisp = self;
- if(compressordisp){
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(compressordisp);
-
- memset(compressordisp->compressors, 0 , sizeof(compressordisp->compressors));
- compressordisp->stateHandler = tsk_null; // not owner
- }
- else{
- TSK_DEBUG_ERROR("Null dispatcher.");
- }
-
- return self;
+ tcomp_compressordisp_t *compressordisp = self;
+ if(compressordisp) {
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(compressordisp);
+
+ memset(compressordisp->compressors, 0 , sizeof(compressordisp->compressors));
+ compressordisp->stateHandler = tsk_null; // not owner
+ }
+ else {
+ TSK_DEBUG_ERROR("Null dispatcher.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_compressordisp_def_s =
-{
- sizeof(tcomp_compressordisp_t),
- tcomp_compressordisp_ctor,
- tcomp_compressordisp_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_compressordisp_def_s = {
+ sizeof(tcomp_compressordisp_t),
+ tcomp_compressordisp_ctor,
+ tcomp_compressordisp_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_compressordisp_def_t = &tcomp_compressordisp_def_s;
diff --git a/tinySIGCOMP/src/tcomp_compressordisp.h b/tinySIGCOMP/src/tcomp_compressordisp.h
index 17146f5..d52cbbd 100755
--- a/tinySIGCOMP/src/tcomp_compressordisp.h
+++ b/tinySIGCOMP/src/tcomp_compressordisp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,14 +49,13 @@ TCOMP_BEGIN_DECLS
/**Compressor dispatcher.
*/
-typedef struct tcomp_compressordisp_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_compressordisp_s {
+ TSK_DECLARE_OBJECT;
- tcomp_compressor_compress_f compressors[TCOMP_MAX_COMPRESSORS];
- const tcomp_statehandler_t* stateHandler;
+ tcomp_compressor_compress_f compressors[TCOMP_MAX_COMPRESSORS];
+ const tcomp_statehandler_t* stateHandler;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_compressordisp_t;
diff --git a/tinySIGCOMP/src/tcomp_decompressordisp.c b/tinySIGCOMP/src/tcomp_decompressordisp.c
index fbf6192..a1c17f8 100755
--- a/tinySIGCOMP/src/tcomp_decompressordisp.c
+++ b/tinySIGCOMP/src/tcomp_decompressordisp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,282 +44,286 @@
*/
static int pred_find_streambuffer_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data)
- {
- tcomp_stream_buffer_t *streambuffer = item->data;
- int64_t res = (streambuffer->id - *((int64_t*)id));
- return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
- }
- return -1;
+ if(item && item->data) {
+ tcomp_stream_buffer_t *streambuffer = item->data;
+ int64_t res = (streambuffer->id - *((int64_t*)id));
+ return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
+ }
+ return -1;
}
tcomp_stream_buffer_t* tcomp_stream_buffer_create(uint64_t id)
{
- return tsk_object_new(tcomp_stream_buffer_def_t, id);
+ return tsk_object_new(tcomp_stream_buffer_def_t, id);
}
tcomp_decompressordisp_t* tcomp_decompressordisp_create(const tcomp_statehandler_t* statehandler)
{
- return tsk_object_new(tcomp_decompressordisp_def_t, statehandler);
+ return tsk_object_new(tcomp_decompressordisp_def_t, statehandler);
}
/**Decompress a message.
*/
tsk_bool_t tcomp_decompressordisp_decompress(tcomp_decompressordisp_t *dispatcher, const void* input_ptr, tsk_size_t input_size, tcomp_result_t *lpResult)
{
- tsk_bool_t ret = tsk_true;
- uint64_t streamId = 0;
- const tsk_list_item_t *item_const;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_false;
- }
-
- /*
- * Check if transport type changed.
- */
- if(lpResult->isStreamBased){
- if(!dispatcher->streamBuffers){
- dispatcher->streamBuffers = tsk_list_create();
- }
-
- streamId = lpResult->streamId;
- ret = tcomp_decompressordisp_appendStream(dispatcher, input_ptr, input_size, streamId);
- if(!ret){
- TSK_DEBUG_ERROR("Failed to append new stream buffer.");
- return 0;
- }
- }
-
- if(lpResult->isStreamBased){
- tsk_size_t size = 0;
- uint32_t discard_count = 0;
- tcomp_stream_buffer_t *lpBuffer;
-
- item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
- if(!item_const || !(lpBuffer = item_const->data)){
- TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
- return 0;
- }
-
- if(ret && tcomp_decompressordisp_getNextStreamMsg(dispatcher, streamId, &discard_count, &size)){
- ret &= tcomp_decompressordisp_internalDecompress(dispatcher, tcomp_buffer_getBuffer(lpBuffer->buffer), size, &lpResult);
-
- /* remove buffer and discard */
- tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
- ret &= tcomp_buffer_removeBuff(lpBuffer->buffer, 0, size);
- }
- if(discard_count){
- tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
- }
- if(size){
- //ret&= lpBuffer->removeBuff(0, (size));
- }
- }
- else{
- ret &= tcomp_decompressordisp_internalDecompress(dispatcher, input_ptr, input_size, &lpResult);
- }
-
- return ret;
+ tsk_bool_t ret = tsk_true;
+ uint64_t streamId = 0;
+ const tsk_list_item_t *item_const;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_false;
+ }
+
+ /*
+ * Check if transport type changed.
+ */
+ if(lpResult->isStreamBased) {
+ if(!dispatcher->streamBuffers) {
+ dispatcher->streamBuffers = tsk_list_create();
+ }
+
+ streamId = lpResult->streamId;
+ ret = tcomp_decompressordisp_appendStream(dispatcher, input_ptr, input_size, streamId);
+ if(!ret) {
+ TSK_DEBUG_ERROR("Failed to append new stream buffer.");
+ return 0;
+ }
+ }
+
+ if(lpResult->isStreamBased) {
+ tsk_size_t size = 0;
+ uint32_t discard_count = 0;
+ tcomp_stream_buffer_t *lpBuffer;
+
+ item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
+ if(!item_const || !(lpBuffer = item_const->data)) {
+ TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
+ return 0;
+ }
+
+ if(ret && tcomp_decompressordisp_getNextStreamMsg(dispatcher, streamId, &discard_count, &size)) {
+ ret &= tcomp_decompressordisp_internalDecompress(dispatcher, tcomp_buffer_getBuffer(lpBuffer->buffer), size, &lpResult);
+
+ /* remove buffer and discard */
+ tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
+ ret &= tcomp_buffer_removeBuff(lpBuffer->buffer, 0, size);
+ }
+ if(discard_count) {
+ tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
+ }
+ if(size) {
+ //ret&= lpBuffer->removeBuff(0, (size));
+ }
+ }
+ else {
+ ret &= tcomp_decompressordisp_internalDecompress(dispatcher, input_ptr, input_size, &lpResult);
+ }
+
+ return ret;
}
/**Gets the next message from the queue.
*/
tsk_bool_t tcomp_decompressordisp_getNextMessage(tcomp_decompressordisp_t *dispatcher, tcomp_result_t *lpResult)
{
- tsk_bool_t ret = tsk_true;
- tsk_size_t size=0;
- uint32_t discard_count = 0;
- uint64_t streamId;
- tcomp_stream_buffer_t *lpBuffer;
- const tsk_list_item_t *item_const;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_false;
- }
-
- streamId = lpResult->streamId;
-
- item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
- if(!item_const || !(lpBuffer = item_const->data)){
- TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
- return tsk_false;
- }
-
- if(ret && tcomp_decompressordisp_getNextStreamMsg(dispatcher, streamId, &discard_count, &size)){
- ret &= tcomp_decompressordisp_internalDecompress(dispatcher, tcomp_buffer_getBuffer(lpBuffer->buffer), size, &lpResult);
-
- /* remove buffer and discard */
- tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
- ret &= tcomp_buffer_removeBuff(lpBuffer->buffer, 0, size);
- }
- else {
- ret = tsk_false; /* Is it right? */
- }
-
- if(discard_count){
- tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
- }
- return ret;
+ tsk_bool_t ret = tsk_true;
+ tsk_size_t size=0;
+ uint32_t discard_count = 0;
+ uint64_t streamId;
+ tcomp_stream_buffer_t *lpBuffer;
+ const tsk_list_item_t *item_const;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_false;
+ }
+
+ streamId = lpResult->streamId;
+
+ item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
+ if(!item_const || !(lpBuffer = item_const->data)) {
+ TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
+ return tsk_false;
+ }
+
+ if(ret && tcomp_decompressordisp_getNextStreamMsg(dispatcher, streamId, &discard_count, &size)) {
+ ret &= tcomp_decompressordisp_internalDecompress(dispatcher, tcomp_buffer_getBuffer(lpBuffer->buffer), size, &lpResult);
+
+ /* remove buffer and discard */
+ tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
+ ret &= tcomp_buffer_removeBuff(lpBuffer->buffer, 0, size);
+ }
+ else {
+ ret = tsk_false; /* Is it right? */
+ }
+
+ if(discard_count) {
+ tcomp_buffer_discardLastBytes(lpBuffer->buffer, discard_count);
+ }
+ return ret;
}
/**Decompress a message.
*/
tsk_bool_t tcomp_decompressordisp_internalDecompress(tcomp_decompressordisp_t *dispatcher, const void* input_ptr, const tsk_size_t input_size, tcomp_result_t **lpResult)
{
- tcomp_message_t *sigCompMessage = tsk_null;
- tcomp_udvm_t *sigCompUDVM = tsk_null;
- tsk_bool_t ret = tsk_false;
- int32_t nack_code = NACK_NONE;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter.");
- goto bail;
- }
-
- sigCompMessage = tcomp_message_create(input_ptr, input_size, (*lpResult)->isStreamBased, &nack_code);
- if(!sigCompMessage || !sigCompMessage->isOK){
- TSK_DEBUG_ERROR("Failed to create new sigcomp message");
- if(nack_code != NACK_NONE && ((*lpResult)->isNack = TCOMP_NACK_SUPPORTED(dispatcher))){
- tcomp_nackinfo_write_3((*lpResult)->nack_info,
- nack_code,
- input_ptr, input_size);
- }
- goto bail;
- }
- else if(sigCompMessage->isNack && TCOMP_NACK_SUPPORTED(dispatcher)){
- /* Remote party send us a NACK --> handle it */
- tcomp_statehandler_handleNack((tcomp_statehandler_t*)dispatcher->stateHandler, (const tcomp_nackinfo_t*)sigCompMessage->nack_info);
- (*lpResult)->isNack = tsk_true;
-
- goto bail;
- }
-
- /* Create new UDVM entity for each SigComp message */
- sigCompUDVM = tcomp_udvm_create(sigCompMessage, (tcomp_statehandler_t*)dispatcher->stateHandler, *lpResult);
-
- /* Decompress message */
- ret = tcomp_udvm_decompress(sigCompUDVM);
-
- /* decompression failed --> returns nack if supported */
- if(!ret){
- /* Decompression failed --> return NACK message to the application layer */
- (*lpResult)->isNack = TCOMP_NACK_SUPPORTED(dispatcher);
- }
-
+ tcomp_message_t *sigCompMessage = tsk_null;
+ tcomp_udvm_t *sigCompUDVM = tsk_null;
+ tsk_bool_t ret = tsk_false;
+ int32_t nack_code = NACK_NONE;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ goto bail;
+ }
+
+ sigCompMessage = tcomp_message_create(input_ptr, input_size, (*lpResult)->isStreamBased, &nack_code);
+ if(!sigCompMessage || !sigCompMessage->isOK) {
+ TSK_DEBUG_ERROR("Failed to create new sigcomp message");
+ if(nack_code != NACK_NONE && ((*lpResult)->isNack = TCOMP_NACK_SUPPORTED(dispatcher))) {
+ tcomp_nackinfo_write_3((*lpResult)->nack_info,
+ nack_code,
+ input_ptr, input_size);
+ }
+ goto bail;
+ }
+ else if(sigCompMessage->isNack && TCOMP_NACK_SUPPORTED(dispatcher)) {
+ /* Remote party send us a NACK --> handle it */
+ tcomp_statehandler_handleNack((tcomp_statehandler_t*)dispatcher->stateHandler, (const tcomp_nackinfo_t*)sigCompMessage->nack_info);
+ (*lpResult)->isNack = tsk_true;
+
+ goto bail;
+ }
+
+ /* Create new UDVM entity for each SigComp message */
+ sigCompUDVM = tcomp_udvm_create(sigCompMessage, (tcomp_statehandler_t*)dispatcher->stateHandler, *lpResult);
+
+ /* Decompress message */
+ ret = tcomp_udvm_decompress(sigCompUDVM);
+
+ /* decompression failed --> returns nack if supported */
+ if(!ret) {
+ /* Decompression failed --> return NACK message to the application layer */
+ (*lpResult)->isNack = TCOMP_NACK_SUPPORTED(dispatcher);
+ }
+
bail:
- /* Delete Message */
- TSK_OBJECT_SAFE_FREE(sigCompMessage);
+ /* Delete Message */
+ TSK_OBJECT_SAFE_FREE(sigCompMessage);
- /* Delete UDVM entity */
- TSK_OBJECT_SAFE_FREE(sigCompUDVM);
+ /* Delete UDVM entity */
+ TSK_OBJECT_SAFE_FREE(sigCompUDVM);
- return ret;
+ return ret;
}
/**Appends stream buffer.
*/
tsk_bool_t tcomp_decompressordisp_appendStream(tcomp_decompressordisp_t *dispatcher, const void* input_ptr, tsk_size_t input_size, uint64_t streamId)
{
- tcomp_stream_buffer_t* lpBuffer = tsk_null;
- const tsk_list_item_t *item_const;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_false;
- }
-
- item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
- if(!item_const || !(lpBuffer = item_const->data)){
- /* First time we get this stream ID */
- tcomp_buffer_handle_t *newbuf = tcomp_stream_buffer_create(streamId);
- if(newbuf){
- lpBuffer = newbuf;
- lpBuffer->buffer = tcomp_buffer_create_null();
- tsk_list_push_back_data(dispatcher->streamBuffers, ((void**) &newbuf));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new stream buffer.");
- return tsk_false;
- }
- }
-
- /* Check if buffer is too large */
- if(lpBuffer->buffer && (tcomp_buffer_getSize(lpBuffer->buffer) + input_size) > TCOMP_MAX_STREAM_BUFFER_SIZE){
- tcomp_buffer_freeBuff(lpBuffer->buffer);
- return tsk_false;
- }
-
- /* append new buffer */
- if(!tcomp_buffer_appendBuff(lpBuffer->buffer, input_ptr, input_size)){
- TSK_DEBUG_ERROR("Failed to append new buffer.");
- tcomp_buffer_freeBuff(lpBuffer->buffer);
- return tsk_false;
- }
-
- return tsk_true;
+ tcomp_stream_buffer_t* lpBuffer = tsk_null;
+ const tsk_list_item_t *item_const;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_false;
+ }
+
+ item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
+ if(!item_const || !(lpBuffer = item_const->data)) {
+ /* First time we get this stream ID */
+ tcomp_buffer_handle_t *newbuf = tcomp_stream_buffer_create(streamId);
+ if(newbuf) {
+ lpBuffer = newbuf;
+ lpBuffer->buffer = tcomp_buffer_create_null();
+ tsk_list_push_back_data(dispatcher->streamBuffers, ((void**) &newbuf));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new stream buffer.");
+ return tsk_false;
+ }
+ }
+
+ /* Check if buffer is too large */
+ if(lpBuffer->buffer && (tcomp_buffer_getSize(lpBuffer->buffer) + input_size) > TCOMP_MAX_STREAM_BUFFER_SIZE) {
+ tcomp_buffer_freeBuff(lpBuffer->buffer);
+ return tsk_false;
+ }
+
+ /* append new buffer */
+ if(!tcomp_buffer_appendBuff(lpBuffer->buffer, input_ptr, input_size)) {
+ TSK_DEBUG_ERROR("Failed to append new buffer.");
+ tcomp_buffer_freeBuff(lpBuffer->buffer);
+ return tsk_false;
+ }
+
+ return tsk_true;
}
/**Gets the next message from the queue.
*/
tsk_bool_t tcomp_decompressordisp_getNextStreamMsg(tcomp_decompressordisp_t *dispatcher, uint64_t streamId, uint32_t *discard_count, tsk_size_t *size)
{
- tcomp_stream_buffer_t *lpBuffer;
- const tsk_list_item_t *item_const;
-
- uint8_t quote_count = 0;
- uint8_t* start;
- uint8_t* end;
-
- if(!dispatcher){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_false;
- }
-
- /*
- * RFC 3320 - 4.2.1. Decompressor Dispatcher Strategies [strategie 1]
- */
- item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
- if(!item_const || !(lpBuffer = item_const->data)){
- TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
- return tsk_false;
- }
-
- *size = 0;
- *discard_count = 0;
-
- quote_count = 0;
- start = tcomp_buffer_getBuffer(lpBuffer->buffer);
- end = (start + tcomp_buffer_getSize(lpBuffer->buffer));
-
- while(start<end){
- if(*start==0xff){
- start++;
- if(*start==0xff)
- { /* end message */
- if(*size) return tsk_true;
- else /* message is empty --> delete this empty message(length=2) */
- {
- start--;
- memcpy(start, (start+2), (end-start));
- (*discard_count)+=2;
- end-=2;
- continue;
- }
- }
-
- quote_count = *start;
- memcpy((start), (start+1), (end-start));
- end--;
- (*discard_count)++;
- start+=(quote_count);
- (*size)+=(1+quote_count);
- }else { start++; (*size)++; }
- }
-
- return tsk_false;
+ tcomp_stream_buffer_t *lpBuffer;
+ const tsk_list_item_t *item_const;
+
+ uint8_t quote_count = 0;
+ uint8_t* start;
+ uint8_t* end;
+
+ if(!dispatcher) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_false;
+ }
+
+ /*
+ * RFC 3320 - 4.2.1. Decompressor Dispatcher Strategies [strategie 1]
+ */
+ item_const = tsk_list_find_item_by_pred(dispatcher->streamBuffers, pred_find_streambuffer_by_id, &streamId);
+ if(!item_const || !(lpBuffer = item_const->data)) {
+ TSK_DEBUG_ERROR("Failed to find stream buffer by id %llu.", streamId);
+ return tsk_false;
+ }
+
+ *size = 0;
+ *discard_count = 0;
+
+ quote_count = 0;
+ start = tcomp_buffer_getBuffer(lpBuffer->buffer);
+ end = (start + tcomp_buffer_getSize(lpBuffer->buffer));
+
+ while(start<end) {
+ if(*start==0xff) {
+ start++;
+ if(*start==0xff) {
+ /* end message */
+ if(*size) {
+ return tsk_true;
+ }
+ else { /* message is empty --> delete this empty message(length=2) */
+ start--;
+ memcpy(start, (start+2), (end-start));
+ (*discard_count)+=2;
+ end-=2;
+ continue;
+ }
+ }
+
+ quote_count = *start;
+ memcpy((start), (start+1), (end-start));
+ end--;
+ (*discard_count)++;
+ start+=(quote_count);
+ (*size)+=(1+quote_count);
+ }
+ else {
+ start++;
+ (*size)++;
+ }
+ }
+
+ return tsk_false;
}
@@ -336,42 +340,41 @@ tsk_bool_t tcomp_decompressordisp_getNextStreamMsg(tcomp_decompressordisp_t *dis
//
static tsk_object_t* tcomp_decompressordisp_ctor(tsk_object_t* self, va_list * app)
{
- tcomp_decompressordisp_t *decompressordisp = self;
- if(decompressordisp){
- decompressordisp->stateHandler = va_arg(*app, const tcomp_statehandler_t*);
-
- /* Initialize safeobject */
- tsk_safeobj_init(decompressordisp);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new decompressor dispatcher.");
- }
-
- return self;
+ tcomp_decompressordisp_t *decompressordisp = self;
+ if(decompressordisp) {
+ decompressordisp->stateHandler = va_arg(*app, const tcomp_statehandler_t*);
+
+ /* Initialize safeobject */
+ tsk_safeobj_init(decompressordisp);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new decompressor dispatcher.");
+ }
+
+ return self;
}
static tsk_object_t* tcomp_decompressordisp_dtor(tsk_object_t *self)
{
- tcomp_decompressordisp_t *decompressordisp = self;
- if(decompressordisp){
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(decompressordisp);
-
- TSK_OBJECT_SAFE_FREE(decompressordisp->streamBuffers);
- }
- else{
- TSK_DEBUG_ERROR("Null dispatcher.");
- }
-
- return self;
+ tcomp_decompressordisp_t *decompressordisp = self;
+ if(decompressordisp) {
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(decompressordisp);
+
+ TSK_OBJECT_SAFE_FREE(decompressordisp->streamBuffers);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null dispatcher.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_decompressordisp_def_s =
-{
- sizeof(tcomp_decompressordisp_t),
- tcomp_decompressordisp_ctor,
- tcomp_decompressordisp_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_decompressordisp_def_s = {
+ sizeof(tcomp_decompressordisp_t),
+ tcomp_decompressordisp_ctor,
+ tcomp_decompressordisp_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_decompressordisp_def_t = &tcomp_decompressordisp_def_s;
@@ -384,35 +387,34 @@ const tsk_object_def_t *tcomp_decompressordisp_def_t = &tcomp_decompressordisp_d
static tsk_object_t* tcomp_stream_buffer_ctor(tsk_object_t* self, va_list * app)
{
- tcomp_stream_buffer_t *stream_buffer = self;
- if(stream_buffer){
- stream_buffer->id = va_arg(*app, uint64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new stream buffer.");
- }
-
- return self;
+ tcomp_stream_buffer_t *stream_buffer = self;
+ if(stream_buffer) {
+ stream_buffer->id = va_arg(*app, uint64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new stream buffer.");
+ }
+
+ return self;
}
static tsk_object_t* tcomp_stream_buffer_dtor(tsk_object_t* self)
{
- tcomp_stream_buffer_t *stream_buffer = self;
- if(stream_buffer){
- TSK_OBJECT_SAFE_FREE(stream_buffer->buffer);
- }
- else{
- TSK_DEBUG_ERROR("Null stream buffer.");
- }
-
- return self;
+ tcomp_stream_buffer_t *stream_buffer = self;
+ if(stream_buffer) {
+ TSK_OBJECT_SAFE_FREE(stream_buffer->buffer);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null stream buffer.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_stream_buffer_def_s =
-{
- sizeof(tcomp_stream_buffer_t),
- tcomp_stream_buffer_ctor,
- tcomp_stream_buffer_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_stream_buffer_def_s = {
+ sizeof(tcomp_stream_buffer_t),
+ tcomp_stream_buffer_ctor,
+ tcomp_stream_buffer_dtor,
+ tsk_null
};
const tsk_object_def_t* tcomp_stream_buffer_def_t = &tcomp_stream_buffer_def_s;
diff --git a/tinySIGCOMP/src/tcomp_decompressordisp.h b/tinySIGCOMP/src/tcomp_decompressordisp.h
index 79bb635..9916a62 100755
--- a/tinySIGCOMP/src/tcomp_decompressordisp.h
+++ b/tinySIGCOMP/src/tcomp_decompressordisp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,25 +42,23 @@
TCOMP_BEGIN_DECLS
-typedef struct tcomp_stream_buffer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_stream_buffer_s {
+ TSK_DECLARE_OBJECT;
- uint64_t id; /**< Buffer identifier */
- tcomp_buffer_handle_t *buffer; /**< Buffer handle */
+ uint64_t id; /**< Buffer identifier */
+ tcomp_buffer_handle_t *buffer; /**< Buffer handle */
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_stream_buffer_t;
-typedef struct tcomp_decompressordisp_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_decompressordisp_s {
+ TSK_DECLARE_OBJECT;
- const tcomp_statehandler_t* stateHandler;
- tcomp_stream_buffer_L_t *streamBuffers;
+ const tcomp_statehandler_t* stateHandler;
+ tcomp_stream_buffer_L_t *streamBuffers;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_decompressordisp_t;
diff --git a/tinySIGCOMP/src/tcomp_deflatedata.c b/tinySIGCOMP/src/tcomp_deflatedata.c
index 12a8fdd..02ea2d9 100755
--- a/tinySIGCOMP/src/tcomp_deflatedata.c
+++ b/tinySIGCOMP/src/tcomp_deflatedata.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,36 +33,36 @@
tcomp_deflatedata_t* tcomp_deflatedata_create_2(tsk_bool_t isStream, int z_level, int z_windowBits)
{
- tcomp_deflatedata_t *deflatedata;
- if((deflatedata = tsk_object_new(tcomp_deflatedata_def_t))){
- deflatedata->isStream = isStream;
- deflatedata->zLevel = z_level;
- deflatedata->zWindowBits = z_windowBits;
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp defalte data.");
- }
-
- return deflatedata;
+ tcomp_deflatedata_t *deflatedata;
+ if((deflatedata = tsk_object_new(tcomp_deflatedata_def_t))) {
+ deflatedata->isStream = isStream;
+ deflatedata->zLevel = z_level;
+ deflatedata->zWindowBits = z_windowBits;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp defalte data.");
+ }
+
+ return deflatedata;
}
tcomp_deflatedata_t* tcomp_deflatedata_create(tsk_bool_t isStream, tsk_bool_t useOnlyACKedStates)
{
- tcomp_deflatedata_t* deflatedata;
- if((deflatedata = tcomp_deflatedata_create_2(isStream, Z_BEST_COMPRESSION, Z_DEFAULT_WINDOW_BITS))){
- deflatedata->useOnlyACKedStates = useOnlyACKedStates;
- }
- return deflatedata;
+ tcomp_deflatedata_t* deflatedata;
+ if((deflatedata = tcomp_deflatedata_create_2(isStream, Z_BEST_COMPRESSION, Z_DEFAULT_WINDOW_BITS))) {
+ deflatedata->useOnlyACKedStates = useOnlyACKedStates;
+ }
+ return deflatedata;
}
tsk_bool_t tcomp_deflatedata_isStateful(tcomp_deflatedata_t *deflatedata)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return tsk_false;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return tsk_false;
+ }
- return deflatedata->stream_acked.stateful;
+ return deflatedata->stream_acked.stateful;
}
@@ -78,38 +78,37 @@ tsk_bool_t tcomp_deflatedata_isStateful(tcomp_deflatedata_t *deflatedata)
static void* tcomp_deflatedata_ctor(void * self, va_list * app)
{
- tcomp_deflatedata_t *deflatedata = self;
- if(deflatedata){
- /* Initialize safeobject */
- tsk_safeobj_init(deflatedata);
- }
+ tcomp_deflatedata_t *deflatedata = self;
+ if(deflatedata) {
+ /* Initialize safeobject */
+ tsk_safeobj_init(deflatedata);
+ }
- return self;
+ return self;
}
static void* tcomp_deflatedata_dtor(void *self)
{
- tcomp_deflatedata_t *deflatedata = self;
- if(deflatedata){
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(deflatedata);
-
- TSK_OBJECT_SAFE_FREE(deflatedata->ghostState);
-
- tcomp_deflatedata_zUnInit(deflatedata);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp defalte data.");
- }
-
- return self;
+ tcomp_deflatedata_t *deflatedata = self;
+ if(deflatedata) {
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(deflatedata);
+
+ TSK_OBJECT_SAFE_FREE(deflatedata->ghostState);
+
+ tcomp_deflatedata_zUnInit(deflatedata);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp defalte data.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsk_deflatedata_def_s =
-{
- sizeof(tcomp_deflatedata_t),
- tcomp_deflatedata_ctor,
- tcomp_deflatedata_dtor,
- tsk_null,
+static const tsk_object_def_t tsk_deflatedata_def_s = {
+ sizeof(tcomp_deflatedata_t),
+ tcomp_deflatedata_ctor,
+ tcomp_deflatedata_dtor,
+ tsk_null,
};
const tsk_object_def_t *tcomp_deflatedata_def_t = &tsk_deflatedata_def_s;
diff --git a/tinySIGCOMP/src/tcomp_deflatedata.ghost.c b/tinySIGCOMP/src/tcomp_deflatedata.ghost.c
index bfcb927..2446b6e 100755
--- a/tinySIGCOMP/src/tcomp_deflatedata.ghost.c
+++ b/tinySIGCOMP/src/tcomp_deflatedata.ghost.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -77,26 +77,25 @@ I suppose we would like to compress this message "libsigcomp":
#define GHOST_BYTECODE1_SIZE (GHOST_VERSION_INDEX + 1)
-static const char* DeflateData_deflate_bytecode1_ghost =
-{
- "\xff\xff" // Circular buffer Size (CBS)
- "\xff\xff" // State Memory Size (DMS)
- "\x00\x05" // See 'libsigcomp/asm/deflate.asm'
- "\xff\xff" // (CBS + strlen(input))
-
- "\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x09\x00\x00"
- "\x00\x0a\x00\x01\x00\x0b\x00\x01\x00\x0d\x00\x01\x00\x0f\x00\x01\x00\x11\x00\x02\x00\x13\x00\x02\x00\x17\x00\x02\x00\x1b"
- "\x00\x02\x00\x1f\x00\x03\x00\x23\x00\x03\x00\x2b\x00\x03\x00\x33\x00\x03\x00\x3b\x00\x04\x00\x43\x00\x04\x00\x53\x00\x04"
- "\x00\x63\x00\x04\x00\x73\x00\x05\x00\x83\x00\x05\x00\xa3\x00\x05\x00\xc3\x00\x05\x00\xe3\x00\x00\x01\x02\x00\x00\x00\x01"
- "\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x01\x00\x05\x00\x01\x00\x07\x00\x02\x00\x09\x00\x02\x00\x0d\x00\x03"
- "\x00\x11\x00\x03\x00\x19\x00\x04\x00\x21\x00\x04\x00\x31\x00\x05\x00\x41\x00\x05\x00\x61\x00\x06\x00\x81\x00\x06\x00\xc1"
- "\x00\x07\x01\x01\x00\x07\x01\x81\x00\x08\x02\x01\x00\x08\x03\x01\x00\x09\x04\x01\x00\x09\x06\x01\x00\x0a\x08\x01\x00\x0a"
- "\x0c\x01\x00\x0b\x10\x01\x00\x0b\x18\x01\x00\x0c\x20\x01\x00\x0c\x30\x01\x00\x0d\x40\x01\x00\x0d\x60\x01"
-
- "\xff\xff" // HASH_LEN
- "\xff\xff" // SMS
- "\xff" // [CPB+DMS+SMS]
- "\xff" // SigComp Version
+static const char* DeflateData_deflate_bytecode1_ghost = {
+ "\xff\xff" // Circular buffer Size (CBS)
+ "\xff\xff" // State Memory Size (DMS)
+ "\x00\x05" // See 'libsigcomp/asm/deflate.asm'
+ "\xff\xff" // (CBS + strlen(input))
+
+ "\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x09\x00\x00"
+ "\x00\x0a\x00\x01\x00\x0b\x00\x01\x00\x0d\x00\x01\x00\x0f\x00\x01\x00\x11\x00\x02\x00\x13\x00\x02\x00\x17\x00\x02\x00\x1b"
+ "\x00\x02\x00\x1f\x00\x03\x00\x23\x00\x03\x00\x2b\x00\x03\x00\x33\x00\x03\x00\x3b\x00\x04\x00\x43\x00\x04\x00\x53\x00\x04"
+ "\x00\x63\x00\x04\x00\x73\x00\x05\x00\x83\x00\x05\x00\xa3\x00\x05\x00\xc3\x00\x05\x00\xe3\x00\x00\x01\x02\x00\x00\x00\x01"
+ "\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x01\x00\x05\x00\x01\x00\x07\x00\x02\x00\x09\x00\x02\x00\x0d\x00\x03"
+ "\x00\x11\x00\x03\x00\x19\x00\x04\x00\x21\x00\x04\x00\x31\x00\x05\x00\x41\x00\x05\x00\x61\x00\x06\x00\x81\x00\x06\x00\xc1"
+ "\x00\x07\x01\x01\x00\x07\x01\x81\x00\x08\x02\x01\x00\x08\x03\x01\x00\x09\x04\x01\x00\x09\x06\x01\x00\x0a\x08\x01\x00\x0a"
+ "\x0c\x01\x00\x0b\x10\x01\x00\x0b\x18\x01\x00\x0c\x20\x01\x00\x0c\x30\x01\x00\x0d\x40\x01\x00\x0d\x60\x01"
+
+ "\xff\xff" // HASH_LEN
+ "\xff\xff" // SMS
+ "\xff" // [CPB+DMS+SMS]
+ "\xff" // SigComp Version
};
@@ -109,36 +108,36 @@ static const char* DeflateData_deflate_bytecode1_ghost =
*/
void tcomp_deflatedata_createGhost(tcomp_deflatedata_t *deflatedata, uint32_t state_length, tcomp_params_t *params)
{
- uint8_t *ghostvalue_ptr = 0;
+ uint8_t *ghostvalue_ptr = 0;
#define GHOSTVALUE_AT(position) (ghostvalue_ptr + position)
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return;
- }
-
- if(deflatedata->ghostState){
- TSK_DEBUG_ERROR("The defalte data already have a ghost state. This MUST never happen.");
- return;
- }
-
- tsk_safeobj_lock(deflatedata);
-
- deflatedata->ghostState = tcomp_state_create(state_length, GHOST_STATE_ADDRESS, GHOST_STATE_INSTRUCTION, GHOST_STATE_MIN_ACCESS_LEN, GHOST_STATE_RETENTION_PRIORITY);
- tcomp_buffer_allocBuff(deflatedata->ghostState->value, state_length);
- ghostvalue_ptr = tcomp_buffer_getBuffer(deflatedata->ghostState->value);
-
- memcpy(ghostvalue_ptr, DeflateData_deflate_bytecode1_ghost, GHOST_BYTECODE1_SIZE);
-
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_START_INDEX), DEFLATE_UDVM_CIRCULAR_START_INDEX );
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_DMS_INDEX), state_length+GHOST_STATE_ADDRESS );
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_END_INDEX), (DEFLATE_UDVM_CIRCULAR_START_INDEX + 0/*input_size*/) );
- // ......
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_HASH_LEN_INDEX), (state_length+8) );
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_SMS_INDEX), state_length );
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CPB_DMS_SMS_INDEX), tcomp_params_getParameters(params) ); // [cpb+dms+sms]+[version]
-
- // ------------------------------------------------------------
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return;
+ }
+
+ if(deflatedata->ghostState) {
+ TSK_DEBUG_ERROR("The defalte data already have a ghost state. This MUST never happen.");
+ return;
+ }
+
+ tsk_safeobj_lock(deflatedata);
+
+ deflatedata->ghostState = tcomp_state_create(state_length, GHOST_STATE_ADDRESS, GHOST_STATE_INSTRUCTION, GHOST_STATE_MIN_ACCESS_LEN, GHOST_STATE_RETENTION_PRIORITY);
+ tcomp_buffer_allocBuff(deflatedata->ghostState->value, state_length);
+ ghostvalue_ptr = tcomp_buffer_getBuffer(deflatedata->ghostState->value);
+
+ memcpy(ghostvalue_ptr, DeflateData_deflate_bytecode1_ghost, GHOST_BYTECODE1_SIZE);
+
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_START_INDEX), DEFLATE_UDVM_CIRCULAR_START_INDEX );
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_DMS_INDEX), state_length+GHOST_STATE_ADDRESS );
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_END_INDEX), (DEFLATE_UDVM_CIRCULAR_START_INDEX + 0/*input_size*/) );
+ // ......
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_HASH_LEN_INDEX), (state_length+8) );
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_SMS_INDEX), state_length );
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CPB_DMS_SMS_INDEX), tcomp_params_getParameters(params) ); // [cpb+dms+sms]+[version]
+
+ // ------------------------------------------------------------
#define GHOST_DICT_CODE_INDEX (GHOST_BYTECODE1_SIZE)
#define GHOST_DICT_WORDS_INDEX (GHOST_DICT_CODE_INDEX + 2)
@@ -148,23 +147,25 @@ void tcomp_deflatedata_createGhost(tcomp_deflatedata_t *deflatedata, uint32_t st
# define GHOST_FIXME2_INDEX (GHOST_DICT_WORDS_INDEX + 0)
#endif
#define GHOST_DEFLATE_BYTECODE_INDEX (GHOST_FIXME2_INDEX + 4)
-#define GHOST_INPUT_INDEX (GHOST_DEFLATE_BYTECODE_INDEX + DEFLATE_BYTECODE_LEN)
+#define GHOST_INPUT_INDEX (GHOST_DEFLATE_BYTECODE_INDEX + DEFLATE_BYTECODE_LEN)
#if USE_DICTS_FOR_COMPRESSION
- BINARY_SET_2BYTES( ghostState->getStateValue()->getBuffer(GHOST_DICT_CODE_INDEX), DEFLATE_FIXME_DICT );
- if( DEFLATE_FIXME_DICT == DEFLATE_NO_DICT ){
- // Nothing to append
- }else{
- if(DEFLATE_FIXME_DICT == DEFLATE_SIP_DICT_ONLY){
- ::memmove( ghostState->getStateValue()->getBuffer(GHOST_DICT_WORDS_INDEX), RFC3485_DICTIONARY_SIP_IDENTIFIER, 4 );
- }else{
- assert(1==0);
- }
- }
+ BINARY_SET_2BYTES( ghostState->getStateValue()->getBuffer(GHOST_DICT_CODE_INDEX), DEFLATE_FIXME_DICT );
+ if( DEFLATE_FIXME_DICT == DEFLATE_NO_DICT ) {
+ // Nothing to append
+ }
+ else {
+ if(DEFLATE_FIXME_DICT == DEFLATE_SIP_DICT_ONLY) {
+ ::memmove( ghostState->getStateValue()->getBuffer(GHOST_DICT_WORDS_INDEX), RFC3485_DICTIONARY_SIP_IDENTIFIER, 4 );
+ }
+ else {
+ assert(1==0);
+ }
+ }
#endif
- memcpy( GHOSTVALUE_AT(GHOST_DEFLATE_BYTECODE_INDEX), (const char*)DEFLATEDATA_DEFLATE_BYTECODE, DEFLATE_BYTECODE_LEN );
+ memcpy( GHOSTVALUE_AT(GHOST_DEFLATE_BYTECODE_INDEX), (const char*)DEFLATEDATA_DEFLATE_BYTECODE, DEFLATE_BYTECODE_LEN );
- tsk_safeobj_unlock(deflatedata);
+ tsk_safeobj_unlock(deflatedata);
#undef GHOSTVALUE_AT
}
@@ -173,78 +174,78 @@ void tcomp_deflatedata_createGhost(tcomp_deflatedata_t *deflatedata, uint32_t st
*/
void tcomp_deflatedata_ackGhost(tcomp_compressordata_t *data, const tcomp_buffer_handle_t *stateid)
{
- tcomp_deflatedata_t *deflatedata = data;
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return;
- }
-
- tsk_safeobj_lock(deflatedata);
-
- if(deflatedata->ghostState){
- /* Update ghost */
- if(tcomp_buffer_startsWith(deflatedata->ghostState->identifier, stateid)){
- /* END() + COPY() */
- tcomp_deflateStream_end(&(deflatedata->stream_acked));
- tcomp_deflateStream_copy(&(deflatedata->stream_acked), &(deflatedata->stream_1));
- deflatedata->stream_acked.stateful = 1;
- deflatedata->stream_acked.dataWaitingAck = 0;
- TSK_DEBUG_INFO("SigComp - ACKed State id=");
- tcomp_buffer_print(stateid);
- }
- }
-
- tsk_safeobj_unlock(deflatedata);
+ tcomp_deflatedata_t *deflatedata = data;
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return;
+ }
+
+ tsk_safeobj_lock(deflatedata);
+
+ if(deflatedata->ghostState) {
+ /* Update ghost */
+ if(tcomp_buffer_startsWith(deflatedata->ghostState->identifier, stateid)) {
+ /* END() + COPY() */
+ tcomp_deflateStream_end(&(deflatedata->stream_acked));
+ tcomp_deflateStream_copy(&(deflatedata->stream_acked), &(deflatedata->stream_1));
+ deflatedata->stream_acked.stateful = 1;
+ deflatedata->stream_acked.dataWaitingAck = 0;
+ TSK_DEBUG_INFO("SigComp - ACKed State id=");
+ tcomp_buffer_print(stateid);
+ }
+ }
+
+ tsk_safeobj_unlock(deflatedata);
}
/**Updates a Ghost state.
*/
void tcomp_deflatedata_updateGhost(tcomp_deflatedata_t *deflatedata, const uint8_t *input_ptr, tsk_size_t input_size)
{
- uint32_t i;
- uint8_t *ghostvalue_ptr = 0;
+ uint32_t i;
+ uint8_t *ghostvalue_ptr = 0;
#define GHOSTVALUE_AT(position) (ghostvalue_ptr + position)
-
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return;
- }
- if(!deflatedata->ghostState){
- TSK_DEBUG_ERROR("NULL ghost state.");
- return;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return;
+ }
- tsk_safeobj_lock(deflatedata);
+ if(!deflatedata->ghostState) {
+ TSK_DEBUG_ERROR("NULL ghost state.");
+ return;
+ }
- ghostvalue_ptr = tcomp_buffer_getBuffer(deflatedata->ghostState->value);
+ tsk_safeobj_lock(deflatedata);
+
+ ghostvalue_ptr = tcomp_buffer_getBuffer(deflatedata->ghostState->value);
#define ZBUFF_LEN (0x0001 << deflatedata->zWindowBits)
- for(i = 0; i < input_size; i++){
+ for(i = 0; i < input_size; i++) {
#if 0
- *GHOSTVALUE_AT(GHOST_INPUT_INDEX + ghost_copy_offset) = 0x00;
+ *GHOSTVALUE_AT(GHOST_INPUT_INDEX + ghost_copy_offset) = 0x00;
#else
- *GHOSTVALUE_AT(GHOST_INPUT_INDEX + deflatedata->ghost_copy_offset) = input_ptr[i];
+ *GHOSTVALUE_AT(GHOST_INPUT_INDEX + deflatedata->ghost_copy_offset) = input_ptr[i];
#endif
- deflatedata->ghost_copy_offset = (deflatedata->ghost_copy_offset + 1) % ZBUFF_LEN;
- }
-
- /* Update Circular Buffer Index */
- TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_END_INDEX), (DEFLATE_UDVM_CIRCULAR_START_INDEX + deflatedata->ghost_copy_offset) );
-
- /* Compute State Identifier (20 bytes) */
- tcomp_state_makeValid(deflatedata->ghostState);
- // new state identifer not acked yet
- if(deflatedata->useOnlyACKedStates){
- deflatedata->stream_acked.stateful = 0;
- deflatedata->stream_acked.dataWaitingAck = 1;
- }
-
- TSK_DEBUG_INFO("SigComp - Making Ghost state valid with id = ");
- tcomp_buffer_print(deflatedata->ghostState->identifier);
-
- tsk_safeobj_unlock(deflatedata);
+ deflatedata->ghost_copy_offset = (deflatedata->ghost_copy_offset + 1) % ZBUFF_LEN;
+ }
+
+ /* Update Circular Buffer Index */
+ TSK_BINARY_SET_2BYTES( GHOSTVALUE_AT(GHOST_CB_END_INDEX), (DEFLATE_UDVM_CIRCULAR_START_INDEX + deflatedata->ghost_copy_offset) );
+
+ /* Compute State Identifier (20 bytes) */
+ tcomp_state_makeValid(deflatedata->ghostState);
+ // new state identifer not acked yet
+ if(deflatedata->useOnlyACKedStates) {
+ deflatedata->stream_acked.stateful = 0;
+ deflatedata->stream_acked.dataWaitingAck = 1;
+ }
+
+ TSK_DEBUG_INFO("SigComp - Making Ghost state valid with id = ");
+ tcomp_buffer_print(deflatedata->ghostState->identifier);
+
+ tsk_safeobj_unlock(deflatedata);
#undef GHOSTVALUE_AT
}
@@ -252,21 +253,21 @@ void tcomp_deflatedata_updateGhost(tcomp_deflatedata_t *deflatedata, const uint8
uint32_t* tcomp_deflatedata_getGhostCopyOffset(tcomp_deflatedata_t *deflatedata)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return 0;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return 0;
+ }
- return &(deflatedata->ghost_copy_offset);
+ return &(deflatedata->ghost_copy_offset);
}
void tcomp_deflatedata_freeGhostState(tcomp_compressordata_t *data)
{
- tcomp_deflatedata_t *deflatedata = data;
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return;
- }
+ tcomp_deflatedata_t *deflatedata = data;
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return;
+ }
- TSK_OBJECT_SAFE_FREE(deflatedata->ghostState);
+ TSK_OBJECT_SAFE_FREE(deflatedata->ghostState);
}
diff --git a/tinySIGCOMP/src/tcomp_deflatedata.h b/tinySIGCOMP/src/tcomp_deflatedata.h
index d266572..87d2f06 100755
--- a/tinySIGCOMP/src/tcomp_deflatedata.h
+++ b/tinySIGCOMP/src/tcomp_deflatedata.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -116,11 +116,10 @@ TCOMP_BEGIN_DECLS
#endif /* USE_DICTS_FOR_COMPRESSION */
-typedef struct tcomp_deflateStream_s
-{
- z_stream zs;
- unsigned dataWaitingAck:1;
- unsigned stateful:1;
+typedef struct tcomp_deflateStream_s {
+ z_stream zs;
+ unsigned dataWaitingAck:1;
+ unsigned stateful:1;
}
tcomp_deflateStream_t;
@@ -128,25 +127,24 @@ tsk_bool_t tcomp_deflateStream_end(tcomp_deflateStream_t *stream);
tsk_bool_t tcomp_deflateStream_copy(tcomp_deflateStream_t *stream, tcomp_deflateStream_t *source);
-typedef struct tcomp_deflatedata_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_deflatedata_s {
+ TSK_DECLARE_OBJECT;
+
+ tcomp_deflateStream_t stream_1;
+ tcomp_deflateStream_t stream_acked;
+ int zLevel;
+ int zWindowBits;
+
+ tsk_bool_t isInitialized;
- tcomp_deflateStream_t stream_1;
- tcomp_deflateStream_t stream_acked;
- int zLevel;
- int zWindowBits;
-
- tsk_bool_t isInitialized;
-
- uint32_t ghost_copy_offset;
- tcomp_state_t *ghostState;
+ uint32_t ghost_copy_offset;
+ tcomp_state_t *ghostState;
- tsk_bool_t isStream;
+ tsk_bool_t isStream;
- tsk_bool_t useOnlyACKedStates;
+ tsk_bool_t useOnlyACKedStates;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_deflatedata_t;
diff --git a/tinySIGCOMP/src/tcomp_deflatedata.zlib.c b/tinySIGCOMP/src/tcomp_deflatedata.zlib.c
index 6d8c628..1219c15 100755
--- a/tinySIGCOMP/src/tcomp_deflatedata.zlib.c
+++ b/tinySIGCOMP/src/tcomp_deflatedata.zlib.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,185 +33,183 @@
tsk_bool_t tcomp_deflateStream_end(tcomp_deflateStream_t *stream)
{
- if(!stream){
- TSK_DEBUG_ERROR("NULL defalte stream.");
- return tsk_false;
- }
+ if(!stream) {
+ TSK_DEBUG_ERROR("NULL defalte stream.");
+ return tsk_false;
+ }
- return deflateEnd(&(stream->zs));
+ return deflateEnd(&(stream->zs));
}
tsk_bool_t tcomp_deflateStream_copy(tcomp_deflateStream_t *stream, tcomp_deflateStream_t *source)
{
- if(!stream){
- TSK_DEBUG_ERROR("NULL defalte stream.");
- return tsk_false;
- }
+ if(!stream) {
+ TSK_DEBUG_ERROR("NULL defalte stream.");
+ return tsk_false;
+ }
- return deflateCopy(&(stream->zs), &(source->zs));
+ return deflateCopy(&(stream->zs), &(source->zs));
}
tsk_bool_t tcomp_deflatedata_zInit(tcomp_deflatedata_t *deflatedata)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return tsk_false;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return tsk_false;
+ }
- /* Already initialized? */
- if(deflatedata->isInitialized) {
- return tsk_true;
- }
+ /* Already initialized? */
+ if(deflatedata->isInitialized) {
+ return tsk_true;
+ }
- /* allocate deflate state */
+ /* allocate deflate state */
deflatedata->stream_1.zs.zalloc = deflatedata->stream_acked.zs.zalloc = Z_NULL;
deflatedata->stream_1.zs.zfree = deflatedata->stream_acked.zs.zfree = Z_NULL;
deflatedata->stream_1.zs.opaque = deflatedata->stream_acked.zs.opaque = Z_NULL;
#ifndef __SYMBIAN32__
- deflatedata->stream_1.zs.data_type = deflatedata->stream_acked.zs.data_type = Z_TEXT;
+ deflatedata->stream_1.zs.data_type = deflatedata->stream_acked.zs.data_type = Z_TEXT;
#endif
//bool ret = (deflateInit(&this->zStream, this->zLevel) == Z_OK);
- if( deflateInit2(&deflatedata->stream_1.zs, deflatedata->zLevel, Z_DEFLATED, -deflatedata->zWindowBits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK
- || deflateInit2(&deflatedata->stream_acked.zs, deflatedata->zLevel, Z_DEFLATED, -deflatedata->zWindowBits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK )
- {
- return tsk_false;
- }
+ if( deflateInit2(&deflatedata->stream_1.zs, deflatedata->zLevel, Z_DEFLATED, -deflatedata->zWindowBits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK
+ || deflateInit2(&deflatedata->stream_acked.zs, deflatedata->zLevel, Z_DEFLATED, -deflatedata->zWindowBits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK ) {
+ return tsk_false;
+ }
#if USE_DICTS_FOR_COMPRESSION
- if( deflateSetDictionary(this->stream_1.zs, (const Bytef*)RFC3485_DICTIONARY_SIP_VALUE, RFC3485_DICTIONARY_SIP_VALUE_LENGTH) != Z_OK
- || deflateSetDictionary(this->stream_acked.zs, (const Bytef*)RFC3485_DICTIONARY_SIP_VALUE, RFC3485_DICTIONARY_SIP_VALUE_LENGTH) != Z_OK )
- {
- return false;
- }
+ if( deflateSetDictionary(this->stream_1.zs, (const Bytef*)RFC3485_DICTIONARY_SIP_VALUE, RFC3485_DICTIONARY_SIP_VALUE_LENGTH) != Z_OK
+ || deflateSetDictionary(this->stream_acked.zs, (const Bytef*)RFC3485_DICTIONARY_SIP_VALUE, RFC3485_DICTIONARY_SIP_VALUE_LENGTH) != Z_OK ) {
+ return false;
+ }
#endif
- deflatedata->stream_1.stateful = deflatedata->stream_acked.stateful = 0;
- deflatedata->stream_1.dataWaitingAck = deflatedata->stream_acked.dataWaitingAck = 0;
- deflatedata->isInitialized = tsk_true;
+ deflatedata->stream_1.stateful = deflatedata->stream_acked.stateful = 0;
+ deflatedata->stream_1.dataWaitingAck = deflatedata->stream_acked.dataWaitingAck = 0;
+ deflatedata->isInitialized = tsk_true;
- return tsk_true;
+ return tsk_true;
}
tsk_bool_t tcomp_deflatedata_zUnInit(tcomp_deflatedata_t *deflatedata)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return tsk_false;
- }
-
- if(deflatedata->isInitialized){
- deflatedata->isInitialized = tsk_false;
-
- deflatedata->stream_1.dataWaitingAck = deflatedata->stream_acked.dataWaitingAck = 0;
- deflatedata->stream_1.stateful = deflatedata->stream_acked.stateful = 0;
-
- return (tcomp_deflateStream_end(&deflatedata->stream_1) != Z_STREAM_ERROR) && (tcomp_deflateStream_end(&deflatedata->stream_acked) != Z_STREAM_ERROR);
- }
- return tsk_true;
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return tsk_false;
+ }
+
+ if(deflatedata->isInitialized) {
+ deflatedata->isInitialized = tsk_false;
+
+ deflatedata->stream_1.dataWaitingAck = deflatedata->stream_acked.dataWaitingAck = 0;
+ deflatedata->stream_1.stateful = deflatedata->stream_acked.stateful = 0;
+
+ return (tcomp_deflateStream_end(&deflatedata->stream_1) != Z_STREAM_ERROR) && (tcomp_deflateStream_end(&deflatedata->stream_acked) != Z_STREAM_ERROR);
+ }
+ return tsk_true;
}
tsk_bool_t tcomp_deflatedata_zReset(tcomp_deflatedata_t *deflatedata)
{
- tsk_bool_t ret;
+ tsk_bool_t ret;
+
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("NULL defalte data.");
+ return tsk_false;
+ }
- if(!deflatedata){
- TSK_DEBUG_ERROR("NULL defalte data.");
- return tsk_false;
- }
+ ret = deflatedata->isInitialized ? tcomp_deflatedata_zUnInit(deflatedata) : tsk_true;
+ ret &= tcomp_deflatedata_zInit(deflatedata);
- ret = deflatedata->isInitialized ? tcomp_deflatedata_zUnInit(deflatedata) : tsk_true;
- ret &= tcomp_deflatedata_zInit(deflatedata);
-
- return ret;
+ return ret;
}
tsk_bool_t tcomp_deflatedata_zCompress(tcomp_deflatedata_t *deflatedata, const void* in, tsk_size_t inLen, void* out, tsk_size_t* outLen, tsk_bool_t *stateChanged)
{
- int ret = tsk_false;
-/*
- Two streams [1] and [2]
-
- * ZINIT/ZUNINIT/ZRESET
- XXX([1])
- XXX([2])
-
- * COMPRESSION
- [1]->END()
- [1]<-COPY-[2]
- [1]->COMPRESS()
-
- * ACK
- [2]->END()
- [2]<-COPY-[1]
- updateGhost([1])
-*/
- if(!deflatedata){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- tsk_safeobj_lock(deflatedata);
-
- /* Initialized? */
- if(!deflatedata->isInitialized){
- if(!tcomp_deflatedata_zInit(deflatedata)){
- TSK_DEBUG_ERROR("Failed to initialize zlib resources..");
- tsk_safeobj_unlock(deflatedata);
- return tsk_false;
- }
- }
-
- if(deflatedata->useOnlyACKedStates){
- if(!deflatedata->stream_acked.dataWaitingAck){
- deflatedata->stream_acked.dataWaitingAck = 1;
- *stateChanged = tsk_true;
- }
- else{
- *stateChanged = tsk_false;
- }
-
- /* END() + COPY() ==> use acked state */
- tcomp_deflateStream_end(&(deflatedata->stream_1));
- tcomp_deflateStream_copy(&(deflatedata->stream_1), &(deflatedata->stream_acked));
- }
- else{
- *stateChanged = tsk_true;
- }
-
- // IN
- deflatedata->stream_1.zs.next_in = (Bytef*)in;
+ int ret = tsk_false;
+ /*
+ Two streams [1] and [2]
+
+ * ZINIT/ZUNINIT/ZRESET
+ XXX([1])
+ XXX([2])
+
+ * COMPRESSION
+ [1]->END()
+ [1]<-COPY-[2]
+ [1]->COMPRESS()
+
+ * ACK
+ [2]->END()
+ [2]<-COPY-[1]
+ updateGhost([1])
+ */
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ tsk_safeobj_lock(deflatedata);
+
+ /* Initialized? */
+ if(!deflatedata->isInitialized) {
+ if(!tcomp_deflatedata_zInit(deflatedata)) {
+ TSK_DEBUG_ERROR("Failed to initialize zlib resources..");
+ tsk_safeobj_unlock(deflatedata);
+ return tsk_false;
+ }
+ }
+
+ if(deflatedata->useOnlyACKedStates) {
+ if(!deflatedata->stream_acked.dataWaitingAck) {
+ deflatedata->stream_acked.dataWaitingAck = 1;
+ *stateChanged = tsk_true;
+ }
+ else {
+ *stateChanged = tsk_false;
+ }
+
+ /* END() + COPY() ==> use acked state */
+ tcomp_deflateStream_end(&(deflatedata->stream_1));
+ tcomp_deflateStream_copy(&(deflatedata->stream_1), &(deflatedata->stream_acked));
+ }
+ else {
+ *stateChanged = tsk_true;
+ }
+
+ // IN
+ deflatedata->stream_1.zs.next_in = (Bytef*)in;
deflatedata->stream_1.zs.avail_in = (uInt)inLen;
-
- // OUT
- deflatedata->stream_1.zs.next_out = (Bytef*)out;
+
+ // OUT
+ deflatedata->stream_1.zs.next_out = (Bytef*)out;
deflatedata->stream_1.zs.avail_out = (uInt)*outLen;
-
- ret = deflate(&(deflatedata->stream_1.zs), Z_SYNC_FLUSH);
-
- *outLen -= deflatedata->stream_1.zs.avail_out;
-
- tsk_safeobj_unlock(deflatedata);
-
- return (ret == Z_OK);
+
+ ret = deflate(&(deflatedata->stream_1.zs), Z_SYNC_FLUSH);
+
+ *outLen -= deflatedata->stream_1.zs.avail_out;
+
+ tsk_safeobj_unlock(deflatedata);
+
+ return (ret == Z_OK);
}
int tcomp_deflatedata_zGetWindowBits(tcomp_deflatedata_t *deflatedata)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- return deflatedata->zWindowBits;
+ return deflatedata->zWindowBits;
}
void tcomp_deflatedata_zSetWindowBits(tcomp_deflatedata_t *deflatedata, int windowSize)
{
- if(!deflatedata){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
+ if(!deflatedata) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
- deflatedata->zWindowBits = windowSize;
+ deflatedata->zWindowBits = windowSize;
}
diff --git a/tinySIGCOMP/src/tcomp_dicts.c b/tinySIGCOMP/src/tcomp_dicts.c
index b5e11ca..9242d2b 100755
--- a/tinySIGCOMP/src/tcomp_dicts.c
+++ b/tinySIGCOMP/src/tcomp_dicts.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,58 +39,58 @@
*/
tcomp_dictionary_t* tcomp_dicts_create_presence_dict()
{
- static const char *pres_dict_data = RFC5112_DICTIONARY_PRESENCE_VALUE;
- static tcomp_dictionary_t * pres_dict = tsk_null;
+ static const char *pres_dict_data = RFC5112_DICTIONARY_PRESENCE_VALUE;
+ static tcomp_dictionary_t * pres_dict = tsk_null;
- if(!pres_dict){
- pres_dict = tcomp_state_create(
- RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH,
- RFC5112_DICTIONARY_PRESENCE_STATE_ADDRESS,
- RFC5112_DICTIONARY_PRESENCE_STATE_INSTRUCTION,
- RFC5112_DICTIONARY_PRESENCE_MINIMUM_ACCESS_LENGTH,
- 65535);
+ if(!pres_dict) {
+ pres_dict = tcomp_state_create(
+ RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH,
+ RFC5112_DICTIONARY_PRESENCE_STATE_ADDRESS,
+ RFC5112_DICTIONARY_PRESENCE_STATE_INSTRUCTION,
+ RFC5112_DICTIONARY_PRESENCE_MINIMUM_ACCESS_LENGTH,
+ 65535);
- if(pres_dict){
- tcomp_buffer_referenceBuff(pres_dict->value, (uint8_t*)pres_dict_data, RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH);
- tcomp_state_makeValid(pres_dict);
- TSK_DEBUG_INFO("SigComp - Presence dict State id=");
- tcomp_buffer_print(pres_dict->identifier);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create Presence dictionary.");
- }
- }
+ if(pres_dict) {
+ tcomp_buffer_referenceBuff(pres_dict->value, (uint8_t*)pres_dict_data, RFC5112_DICTIONARY_PRESENCE_VALUE_LENGTH);
+ tcomp_state_makeValid(pres_dict);
+ TSK_DEBUG_INFO("SigComp - Presence dict State id=");
+ tcomp_buffer_print(pres_dict->identifier);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create Presence dictionary.");
+ }
+ }
- return tsk_object_ref(pres_dict);
+ return tsk_object_ref(pres_dict);
}
/**The Session Initiation Protocol (SIP) and Session Description Protocol (SDP) Static Dictionary for Signaling Compression as per RFC 3485.
*/
tcomp_dictionary_t* tcomp_dicts_create_sip_dict()
{
-
- static const char *sip_dict_data = RFC3485_DICTIONARY_SIP_VALUE;
- static tcomp_dictionary_t *sip_dict = tsk_null;
- if(!sip_dict){
- sip_dict = tcomp_state_create(
- RFC3485_DICTIONARY_SIP_VALUE_LENGTH,
- RFC3485_DICTIONARY_SIP_STATE_ADDRESS,
- RFC3485_DICTIONARY_SIP_STATE_INSTRUCTION,
- RFC3485_DICTIONARY_SIP_MINIMUM_ACCESS_LENGTH,
- 65535);
-
- if(sip_dict){
- tcomp_buffer_referenceBuff(sip_dict->value, (uint8_t*)sip_dict_data, RFC3485_DICTIONARY_SIP_VALUE_LENGTH);
- tcomp_state_makeValid(sip_dict);
- TSK_DEBUG_INFO("SigComp - SIP dict State id=");
- tcomp_buffer_print(sip_dict->identifier);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP/SDP dictionary.");
- }
- }
+ static const char *sip_dict_data = RFC3485_DICTIONARY_SIP_VALUE;
+ static tcomp_dictionary_t *sip_dict = tsk_null;
+
+ if(!sip_dict) {
+ sip_dict = tcomp_state_create(
+ RFC3485_DICTIONARY_SIP_VALUE_LENGTH,
+ RFC3485_DICTIONARY_SIP_STATE_ADDRESS,
+ RFC3485_DICTIONARY_SIP_STATE_INSTRUCTION,
+ RFC3485_DICTIONARY_SIP_MINIMUM_ACCESS_LENGTH,
+ 65535);
+
+ if(sip_dict) {
+ tcomp_buffer_referenceBuff(sip_dict->value, (uint8_t*)sip_dict_data, RFC3485_DICTIONARY_SIP_VALUE_LENGTH);
+ tcomp_state_makeValid(sip_dict);
+ TSK_DEBUG_INFO("SigComp - SIP dict State id=");
+ tcomp_buffer_print(sip_dict->identifier);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP/SDP dictionary.");
+ }
+ }
- return tsk_object_ref(sip_dict);
+ return tsk_object_ref(sip_dict);
}
diff --git a/tinySIGCOMP/src/tcomp_dicts.h b/tinySIGCOMP/src/tcomp_dicts.h
index dab3d88..472261c 100755
--- a/tinySIGCOMP/src/tcomp_dicts.h
+++ b/tinySIGCOMP/src/tcomp_dicts.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_headers_index.h b/tinySIGCOMP/src/tcomp_headers_index.h
index 0402deb..2067465 100755
--- a/tinySIGCOMP/src/tcomp_headers_index.h
+++ b/tinySIGCOMP/src/tcomp_headers_index.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,7 +65,7 @@
| byte_copy_right | 66 - 67
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| input_bit_order | 68 - 69
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| stack_location | 70 - 71
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
diff --git a/tinySIGCOMP/src/tcomp_instructions.h b/tinySIGCOMP/src/tcomp_instructions.h
index ae2c5b4..c2b6e29 100755
--- a/tinySIGCOMP/src/tcomp_instructions.h
+++ b/tinySIGCOMP/src/tcomp_instructions.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -71,51 +71,49 @@
#define TCOMP_UDVM_INST__OUTPUT 34 //1 + output_length
#define TCOMP_UDVM_INST__END_MESSAGE 35 //1 + state_length
-typedef struct tcomp_inst_desc_s
-{
- int32_t code;
- const char* desc;
+typedef struct tcomp_inst_desc_s {
+ int32_t code;
+ const char* desc;
}
tcomp_inst_desc_t;
-static const tcomp_inst_desc_t TCOMP_INST_DESCRIPTIONS[] =
-{
- { TCOMP_UDVM_INST__DECOMPRESSION_FAILURE, "DECOMPRESSION_FAILURE"},
- { TCOMP_UDVM_INST__AND, "AND"},
- { TCOMP_UDVM_INST__OR, "OR"},
- { TCOMP_UDVM_INST__NOT, "NOT"},
- { TCOMP_UDVM_INST__LSHIFT, "LSHIFT"},
- { TCOMP_UDVM_INST__RSHIFT, "RSHIFT"},
- { TCOMP_UDVM_INST__ADD, "ADD"},
- { TCOMP_UDVM_INST__SUBTRACT, "SUBTRACT"},
- { TCOMP_UDVM_INST__MULTIPLY, "MULTIPLY"},
- { TCOMP_UDVM_INST__DIVIDE, "DIVIDE"},
- { TCOMP_UDVM_INST__REMAINDER, "REMAINDER"},
- { TCOMP_UDVM_INST__SORT_ASCENDING, "SORT-ASCENDING"},
- { TCOMP_UDVM_INST__SORT_DESCENDING, "SORT-DESCENDING"},
- { TCOMP_UDVM_INST__SHA_1, "SHA-1"},
- { TCOMP_UDVM_INST__LOAD, "LOAD"},
- { TCOMP_UDVM_INST__MULTILOAD, "MULTILOAD"},
- { TCOMP_UDVM_INST__PUSH, "PUSH"},
- { TCOMP_UDVM_INST__POP, "POP"},
- { TCOMP_UDVM_INST__COPY, "COPY"},
- { TCOMP_UDVM_INST__COPY_LITERAL, "COPY-LITERAL"},
- { TCOMP_UDVM_INST__COPY_OFFSET, "COPY-OFFSET"},
- { TCOMP_UDVM_INST__MEMSET, "MEMSET"},
- { TCOMP_UDVM_INST__JUMP, "JUMP"},
- { TCOMP_UDVM_INST__COMPARE, "COMPARE"},
- { TCOMP_UDVM_INST__CALL, "CALL"},
- { TCOMP_UDVM_INST__RETURN, "RETURN"},
- { TCOMP_UDVM_INST__SWITCH, "SWITCH"},
- { TCOMP_UDVM_INST__CRC, "CRC"},
- { TCOMP_UDVM_INST__INPUT_BYTES, "INPUT-BYTES"},
- { TCOMP_UDVM_INST__INPUT_BITS, "INPUT-BITS"},
- { TCOMP_UDVM_INST__INPUT_HUFFMAN, "INPUT-HUFFMAN"},
- { TCOMP_UDVM_INST__STATE_ACCESS, "STATE-ACCESS"},
- { TCOMP_UDVM_INST__STATE_CREATE, "STATE-CREATE"},
- { TCOMP_UDVM_INST__STATE_FREE, "STATE-FREE"},
- { TCOMP_UDVM_INST__OUTPUT, "OUTPUT"},
- { TCOMP_UDVM_INST__END_MESSAGE, "END-MESSAGE"},
+static const tcomp_inst_desc_t TCOMP_INST_DESCRIPTIONS[] = {
+ { TCOMP_UDVM_INST__DECOMPRESSION_FAILURE, "DECOMPRESSION_FAILURE"},
+ { TCOMP_UDVM_INST__AND, "AND"},
+ { TCOMP_UDVM_INST__OR, "OR"},
+ { TCOMP_UDVM_INST__NOT, "NOT"},
+ { TCOMP_UDVM_INST__LSHIFT, "LSHIFT"},
+ { TCOMP_UDVM_INST__RSHIFT, "RSHIFT"},
+ { TCOMP_UDVM_INST__ADD, "ADD"},
+ { TCOMP_UDVM_INST__SUBTRACT, "SUBTRACT"},
+ { TCOMP_UDVM_INST__MULTIPLY, "MULTIPLY"},
+ { TCOMP_UDVM_INST__DIVIDE, "DIVIDE"},
+ { TCOMP_UDVM_INST__REMAINDER, "REMAINDER"},
+ { TCOMP_UDVM_INST__SORT_ASCENDING, "SORT-ASCENDING"},
+ { TCOMP_UDVM_INST__SORT_DESCENDING, "SORT-DESCENDING"},
+ { TCOMP_UDVM_INST__SHA_1, "SHA-1"},
+ { TCOMP_UDVM_INST__LOAD, "LOAD"},
+ { TCOMP_UDVM_INST__MULTILOAD, "MULTILOAD"},
+ { TCOMP_UDVM_INST__PUSH, "PUSH"},
+ { TCOMP_UDVM_INST__POP, "POP"},
+ { TCOMP_UDVM_INST__COPY, "COPY"},
+ { TCOMP_UDVM_INST__COPY_LITERAL, "COPY-LITERAL"},
+ { TCOMP_UDVM_INST__COPY_OFFSET, "COPY-OFFSET"},
+ { TCOMP_UDVM_INST__MEMSET, "MEMSET"},
+ { TCOMP_UDVM_INST__JUMP, "JUMP"},
+ { TCOMP_UDVM_INST__COMPARE, "COMPARE"},
+ { TCOMP_UDVM_INST__CALL, "CALL"},
+ { TCOMP_UDVM_INST__RETURN, "RETURN"},
+ { TCOMP_UDVM_INST__SWITCH, "SWITCH"},
+ { TCOMP_UDVM_INST__CRC, "CRC"},
+ { TCOMP_UDVM_INST__INPUT_BYTES, "INPUT-BYTES"},
+ { TCOMP_UDVM_INST__INPUT_BITS, "INPUT-BITS"},
+ { TCOMP_UDVM_INST__INPUT_HUFFMAN, "INPUT-HUFFMAN"},
+ { TCOMP_UDVM_INST__STATE_ACCESS, "STATE-ACCESS"},
+ { TCOMP_UDVM_INST__STATE_CREATE, "STATE-CREATE"},
+ { TCOMP_UDVM_INST__STATE_FREE, "STATE-FREE"},
+ { TCOMP_UDVM_INST__OUTPUT, "OUTPUT"},
+ { TCOMP_UDVM_INST__END_MESSAGE, "END-MESSAGE"},
};
#endif /* TCOMP_INSTRUCTIONS_H */
diff --git a/tinySIGCOMP/src/tcomp_manager.c b/tinySIGCOMP/src/tcomp_manager.c
index 0818439..f741bf4 100755
--- a/tinySIGCOMP/src/tcomp_manager.c
+++ b/tinySIGCOMP/src/tcomp_manager.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,15 +46,14 @@
/**SigComp manager.
*/
-typedef struct tcomp_manager_s
-{
- TSK_DECLARE_OBJECT;
-
- tcomp_compressordisp_t *dispatcher_compressor;
- tcomp_decompressordisp_t *dispatcher_decompressor;
- tcomp_statehandler_t *stateHandler;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tcomp_manager_s {
+ TSK_DECLARE_OBJECT;
+
+ tcomp_compressordisp_t *dispatcher_compressor;
+ tcomp_decompressordisp_t *dispatcher_decompressor;
+ tcomp_statehandler_t *stateHandler;
+
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_manager_t;
@@ -63,120 +62,119 @@ tcomp_manager_t;
*/
tcomp_manager_handle_t* tcomp_manager_create()
{
- return tsk_object_new(tcomp_manager_def_t);
+ return tsk_object_new(tcomp_manager_def_t);
}
/** Defines whether the compressor must only use ACKed states (should be false)
*/
int tcomp_manager_setUseOnlyACKedStates(tcomp_manager_handle_t* self, tsk_bool_t useOnlyACKedStates)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return tcomp_statehandler_setUseOnlyACKedStates(((tcomp_manager_t*)self)->stateHandler, useOnlyACKedStates);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return tcomp_statehandler_setUseOnlyACKedStates(((tcomp_manager_t*)self)->stateHandler, useOnlyACKedStates);
}
/**@ingroup tcomp_manager_group
*/
tsk_size_t tcomp_manager_compress(tcomp_manager_handle_t *handle, const void* compartmentId, tsk_size_t compartmentIdSize, const void* input_ptr, tsk_size_t input_size, void* output_ptr, tsk_size_t output_size, tsk_bool_t stream)
{
- tcomp_manager_t *manager = handle;
- tsk_size_t ret_size = output_size;
-
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(tcomp_compressordisp_compress(manager->dispatcher_compressor, tcomp_buffer_createHash(compartmentId, compartmentIdSize),
- input_ptr, input_size, output_ptr, &ret_size, stream))
- {
- return ret_size;
- }
-
- return 0;
+ tcomp_manager_t *manager = handle;
+ tsk_size_t ret_size = output_size;
+
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(tcomp_compressordisp_compress(manager->dispatcher_compressor, tcomp_buffer_createHash(compartmentId, compartmentIdSize),
+ input_ptr, input_size, output_ptr, &ret_size, stream)) {
+ return ret_size;
+ }
+
+ return 0;
}
/**@ingroup tcomp_manager_group
*/
tsk_size_t tcomp_manager_decompress(tcomp_manager_handle_t *handle, const void* input_ptr, tsk_size_t input_size, tcomp_result_t *lpResult)
{
- tcomp_manager_t *manager = handle;
-
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!lpResult || !lpResult->output_buffer){
- TSK_DEBUG_ERROR("You MUST initialize the sigcomp result and set a valid output buffer.");
- return 0;
- }
-
- /* Reset previous values */
- tcomp_result_reset(lpResult);
-
- if(tcomp_decompressordisp_decompress(manager->dispatcher_decompressor, input_ptr, input_size, lpResult)){
- return *tcomp_buffer_getIndexBytes(lpResult->output_buffer);
- }
-
- return 0;
+ tcomp_manager_t *manager = handle;
+
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!lpResult || !lpResult->output_buffer) {
+ TSK_DEBUG_ERROR("You MUST initialize the sigcomp result and set a valid output buffer.");
+ return 0;
+ }
+
+ /* Reset previous values */
+ tcomp_result_reset(lpResult);
+
+ if(tcomp_decompressordisp_decompress(manager->dispatcher_decompressor, input_ptr, input_size, lpResult)) {
+ return *tcomp_buffer_getIndexBytes(lpResult->output_buffer);
+ }
+
+ return 0;
}
/**@ingroup tcomp_manager_group
*/
tsk_size_t tcomp_manager_getNextStreamMessage(tcomp_manager_handle_t *handle, tcomp_result_t *lpResult)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- if(!lpResult || !tcomp_buffer_getSize(lpResult->output_buffer)){
- TSK_DEBUG_ERROR("Invalid result.");
- return 0;
- }
-
- if(!lpResult->isStreamBased){
- TSK_DEBUG_ERROR("You MUST provide stream buffer.");
- return 0;
- }
-
- _tcomp_result_reset(lpResult, tsk_false, tsk_false);
-
- if(tcomp_decompressordisp_getNextMessage(manager->dispatcher_decompressor, lpResult)){
- return *tcomp_buffer_getIndexBytes(lpResult->output_buffer);
- }
-
- return 0;
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ if(!lpResult || !tcomp_buffer_getSize(lpResult->output_buffer)) {
+ TSK_DEBUG_ERROR("Invalid result.");
+ return 0;
+ }
+
+ if(!lpResult->isStreamBased) {
+ TSK_DEBUG_ERROR("You MUST provide stream buffer.");
+ return 0;
+ }
+
+ _tcomp_result_reset(lpResult, tsk_false, tsk_false);
+
+ if(tcomp_decompressordisp_getNextMessage(manager->dispatcher_decompressor, lpResult)) {
+ return *tcomp_buffer_getIndexBytes(lpResult->output_buffer);
+ }
+
+ return 0;
}
/**@ingroup tcomp_manager_group
*/
void tcomp_manager_provideCompartmentId(tcomp_manager_handle_t *handle, tcomp_result_t *lpResult)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
- tcomp_statehandler_handleResult(manager->stateHandler, &lpResult);
+ tcomp_statehandler_handleResult(manager->stateHandler, &lpResult);
}
/**@ingroup tcomp_manager_group
*/
void tcomp_manager_closeCompartment(tcomp_manager_handle_t *handle, const void *compartmentId, tsk_size_t compartmentIdSize)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
- tcomp_statehandler_deleteCompartment(manager->stateHandler, tcomp_buffer_createHash(compartmentId, compartmentIdSize));
+ tcomp_statehandler_deleteCompartment(manager->stateHandler, tcomp_buffer_createHash(compartmentId, compartmentIdSize));
}
/**@ingroup tcomp_manager_group
@@ -187,13 +185,13 @@ void tcomp_manager_closeCompartment(tcomp_manager_handle_t *handle, const void *
*/
int tcomp_manager_setDecompression_Memory_Size(tcomp_manager_handle_t *handle, uint32_t dms)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- return tcomp_params_setDmsValue(manager->stateHandler->sigcomp_parameters, (dms > MAX_DMS ? MAX_DMS : dms));
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ return tcomp_params_setDmsValue(manager->stateHandler->sigcomp_parameters, (dms > MAX_DMS ? MAX_DMS : dms));
}
/**@ingroup tcomp_manager_group
@@ -203,14 +201,14 @@ int tcomp_manager_setDecompression_Memory_Size(tcomp_manager_handle_t *handle, u
*/
uint32_t tcomp_manager_getDecompression_Memory_Size(tcomp_manager_handle_t *handle)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return (manager->stateHandler && manager->stateHandler->sigcomp_parameters)
- ? manager->stateHandler->sigcomp_parameters->dmsValue
- : 0;
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return (manager->stateHandler && manager->stateHandler->sigcomp_parameters)
+ ? manager->stateHandler->sigcomp_parameters->dmsValue
+ : 0;
}
/**@ingroup tcomp_manager_group
@@ -221,13 +219,13 @@ uint32_t tcomp_manager_getDecompression_Memory_Size(tcomp_manager_handle_t *hand
*/
int tcomp_manager_setState_Memory_Size(tcomp_manager_handle_t *handle, uint32_t sms)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_params_setSmsValue(manager->stateHandler->sigcomp_parameters, (sms > MAX_SMS ? MAX_SMS : sms));
+ return tcomp_params_setSmsValue(manager->stateHandler->sigcomp_parameters, (sms > MAX_SMS ? MAX_SMS : sms));
}
/**@ingroup tcomp_manager_group
@@ -238,13 +236,13 @@ int tcomp_manager_setState_Memory_Size(tcomp_manager_handle_t *handle, uint32_t
*/
int tcomp_manager_setCycles_Per_Bit(tcomp_manager_handle_t *handle, uint8_t cpb)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_params_setCpbValue(manager->stateHandler->sigcomp_parameters, (cpb > MAX_CPB ? MAX_CPB : cpb));
+ return tcomp_params_setCpbValue(manager->stateHandler->sigcomp_parameters, (cpb > MAX_CPB ? MAX_CPB : cpb));
}
/**@ingroup tcomp_manager_group
@@ -255,14 +253,14 @@ int tcomp_manager_setCycles_Per_Bit(tcomp_manager_handle_t *handle, uint8_t cpb)
*/
int tcomp_manager_setSigComp_Version(tcomp_manager_handle_t *handle, uint8_t version)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- manager->stateHandler->sigcomp_parameters->SigComp_version = version;
- return 0;
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ manager->stateHandler->sigcomp_parameters->SigComp_version = version;
+ return 0;
}
/**@ingroup tcomp_manager_group
@@ -273,13 +271,13 @@ int tcomp_manager_setSigComp_Version(tcomp_manager_handle_t *handle, uint8_t ver
*/
int tcomp_manager_addCompressor(tcomp_manager_handle_t *handle, tcomp_compressor_compress_f compressor)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_compressordisp_addCompressor(manager->dispatcher_compressor, compressor);
+ return tcomp_compressordisp_addCompressor(manager->dispatcher_compressor, compressor);
}
/**@ingroup tcomp_manager_group
@@ -290,13 +288,13 @@ int tcomp_manager_addCompressor(tcomp_manager_handle_t *handle, tcomp_compressor
*/
int tcomp_manager_removeCompressor(tcomp_manager_handle_t *handle, tcomp_compressor_compress_f compressor)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_compressordisp_removeCompressor(manager->dispatcher_compressor, compressor);
+ return tcomp_compressordisp_removeCompressor(manager->dispatcher_compressor, compressor);
}
/**@ingroup tcomp_manager_group
@@ -306,13 +304,13 @@ int tcomp_manager_removeCompressor(tcomp_manager_handle_t *handle, tcomp_compres
*/
int tcomp_manager_addSipSdpDictionary(tcomp_manager_handle_t *handle)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_statehandler_addSipSdpDictionary(manager->stateHandler);
+ return tcomp_statehandler_addSipSdpDictionary(manager->stateHandler);
}
/**@ingroup tcomp_manager_group
@@ -322,13 +320,13 @@ int tcomp_manager_addSipSdpDictionary(tcomp_manager_handle_t *handle)
*/
int tcomp_manager_addPresenceDictionary(tcomp_manager_handle_t *handle)
{
- tcomp_manager_t *manager = handle;
- if(!manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ tcomp_manager_t *manager = handle;
+ if(!manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- return tcomp_statehandler_addPresenceDictionary(manager->stateHandler);
+ return tcomp_statehandler_addPresenceDictionary(manager->stateHandler);
}
@@ -347,46 +345,44 @@ int tcomp_manager_addPresenceDictionary(tcomp_manager_handle_t *handle)
static void* tcomp_manager_ctor(void * self, va_list * app)
{
- tcomp_manager_t *manager = self;
- if(manager)
- {
- manager->stateHandler = tcomp_statehandler_create();
- manager->dispatcher_compressor = tcomp_compressordisp_create(manager->stateHandler);
- manager->dispatcher_decompressor = tcomp_decompressordisp_create(manager->stateHandler);
-
- /* Initialize safeobject */
- tsk_safeobj_init(manager);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new manager.");
- }
-
- return self;
+ tcomp_manager_t *manager = self;
+ if(manager) {
+ manager->stateHandler = tcomp_statehandler_create();
+ manager->dispatcher_compressor = tcomp_compressordisp_create(manager->stateHandler);
+ manager->dispatcher_decompressor = tcomp_decompressordisp_create(manager->stateHandler);
+
+ /* Initialize safeobject */
+ tsk_safeobj_init(manager);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new manager.");
+ }
+
+ return self;
}
static void* tcomp_manager_dtor(void *self)
{
- tcomp_manager_t *manager = self;
- if(manager){
- TSK_OBJECT_SAFE_FREE(manager->stateHandler);
- TSK_OBJECT_SAFE_FREE(manager->dispatcher_compressor);
- TSK_OBJECT_SAFE_FREE(manager->dispatcher_decompressor);
-
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(manager);
- }
- else{
- TSK_DEBUG_ERROR("Null manager.");
- }
-
- return self;
+ tcomp_manager_t *manager = self;
+ if(manager) {
+ TSK_OBJECT_SAFE_FREE(manager->stateHandler);
+ TSK_OBJECT_SAFE_FREE(manager->dispatcher_compressor);
+ TSK_OBJECT_SAFE_FREE(manager->dispatcher_decompressor);
+
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(manager);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null manager.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_manager_def_s =
-{
- sizeof(tcomp_manager_t),
- tcomp_manager_ctor,
- tcomp_manager_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_manager_def_s = {
+ sizeof(tcomp_manager_t),
+ tcomp_manager_ctor,
+ tcomp_manager_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_manager_def_t = &tcomp_manager_def_s;
diff --git a/tinySIGCOMP/src/tcomp_manager.h b/tinySIGCOMP/src/tcomp_manager.h
index 477c438..01e31ca 100755
--- a/tinySIGCOMP/src/tcomp_manager.h
+++ b/tinySIGCOMP/src/tcomp_manager.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,7 +48,7 @@ TINYSIGCOMP_API int tcomp_manager_setUseOnlyACKedStates(tcomp_manager_handle_t*
//
TINYSIGCOMP_API tsk_size_t tcomp_manager_compress(tcomp_manager_handle_t *handle, const void* compartmentId, tsk_size_t compartmentIdSize, const void* input_ptr, tsk_size_t input_size, void* output_ptr, tsk_size_t output_size, tsk_bool_t stream);
#define tcomp_manager_compressUDP(handle, compartmentId, compartmentIdSize, input_ptr, input_size, output_ptr, output_size) tcomp_manager_compress((tcomp_manager_handle_t *)handle, (const void*) compartmentId, (tsk_size_t) compartmentIdSize, (const void*) input_ptr, (tsk_size_t) input_size, (void*) output_ptr, (tsk_size_t) output_size, tsk_false)
-#define tcomp_manager_compressTCP(handle, compartmentId, compartmentIdSize, input_ptr, input_size, output_ptr, output_size) tcomp_manager_compress((tcomp_manager_handle_t *)handle, (const void*) compartmentId, (tsk_size_t) compartmentIdSize, (const void*) input_ptr, (tsk_size_t) input_size, (void*) output_ptr, (tsk_size_t) output_size, tsk_true)
+#define tcomp_manager_compressTCP(handle, compartmentId, compartmentIdSize, input_ptr, input_size, output_ptr, output_size) tcomp_manager_compress((tcomp_manager_handle_t *)handle, (const void*) compartmentId, (tsk_size_t) compartmentIdSize, (const void*) input_ptr, (tsk_size_t) input_size, (void*) output_ptr, (tsk_size_t) output_size, tsk_true)
#define tcomp_manager_compressSCTP compressTCP
TINYSIGCOMP_API tsk_size_t tcomp_manager_decompress(tcomp_manager_handle_t *handle, const void* input_ptr, tsk_size_t input_size, tcomp_result_t *lpResult);
diff --git a/tinySIGCOMP/src/tcomp_message.c b/tinySIGCOMP/src/tcomp_message.c
index 6cecb79..2048c3f 100755
--- a/tinySIGCOMP/src/tcomp_message.c
+++ b/tinySIGCOMP/src/tcomp_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -54,109 +54,108 @@ static void initStateful(tcomp_message_t *message, uint8_t** start_ptr, uint8_t*
static void initStateless(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end_ptr, int32_t *nack_code);
static void initNack(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end_ptr, int32_t* nack_code);
-/*
+/*
Creates new SigComp message.
*/
tcomp_message_t* tcomp_message_create(const void* input_ptr, tsk_size_t input_size, tsk_bool_t stream, int32_t* nack_code)
{
- tcomp_message_t *message;
-
- if(!nack_code){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(!input_ptr){
- TSK_DEBUG_ERROR("Invalid parameter");
- *nack_code = NACK_INTERNAL_ERROR;
- return tsk_null;
- }
-
- if(input_size < MIN_LEN){
- TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
- *nack_code = NACK_MESSAGE_TOO_SHORT;
- return tsk_null;
- }
-
- if((message = tsk_object_new(tcomp_message_def_t))){
- uint8_t *dummy_ptr, *end_ptr;
- uint8_t state_len;
-
- message->startPtr = input_ptr;
- message->stateId = tcomp_buffer_create_null();
- message->remaining_sigcomp_buffer = tcomp_buffer_create_null();
- message->uploaded_UDVM_buffer = tcomp_buffer_create_null();
- message->ret_feedback_buffer= tcomp_buffer_create_null();
-
- message->isNack = 0;
- dummy_ptr = ((uint8_t*)input_ptr);
- end_ptr = (dummy_ptr + input_size);
-
- //
- message->totalSize = input_size;
- message->stream_based = stream;
- message->bytecodes_destination = 0;
-
- /* Get sigcomp header */
- message->headerSigComp = *dummy_ptr;
- dummy_ptr++;
-
- /* Check message validity --> magic code (11111)? */
- message->isOK = HEADER_IS_VALID(message);
- if(!message->isOK){
- TSK_DEBUG_ERROR("SigComp Message not valid (magic code mismatch)");
- *nack_code = NACK_INTERNAL_ERROR;
- goto bail;
- }
-
- /* Feedback item */
- if((HEADER_GET_T(message)!=0)){
- initFeedbackItem(message, &dummy_ptr);
- if(!message->isOK){
- goto bail;
- }
- }
-
- /*
- * If the len field is non-zero, then the SigComp message contains a state identifier
- * to access a state item at the receiving endpoint.
- */
- state_len = HEADER_GET_STATE_LENGTH( HEADER_GET_LEN(message) );
- if(state_len){
- initStateId(message, &dummy_ptr, state_len);
- initStateful(message, &dummy_ptr, end_ptr);
- TSK_DEBUG_INFO("SigComp - Decompressing stateful message with state id =");
- tcomp_buffer_print(message->stateId);
- }
- else
- {
- if( !*dummy_ptr && !(*(dummy_ptr+1)&0xf0) ){
- // "code_len" field of zero --> it's a nack
- initNack(message, &dummy_ptr, end_ptr, nack_code);
- }
- else{
- initStateless(message, &dummy_ptr, end_ptr, nack_code);
- }
- }
-
- /*
- * The fields (RFC 3320 section 7) except for the "remaining SigComp message" are referred to
- * as the "SigComp header" (note that this may include the uploaded UDVM bytecode).
- */
- if(message->isOK){
- message->header_size = ( message->totalSize - tcomp_buffer_getSize(message->remaining_sigcomp_buffer));
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new SigComp message");
- }
+ tcomp_message_t *message;
+
+ if(!nack_code) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(!input_ptr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ *nack_code = NACK_INTERNAL_ERROR;
+ return tsk_null;
+ }
+
+ if(input_size < MIN_LEN) {
+ TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
+ *nack_code = NACK_MESSAGE_TOO_SHORT;
+ return tsk_null;
+ }
+
+ if((message = tsk_object_new(tcomp_message_def_t))) {
+ uint8_t *dummy_ptr, *end_ptr;
+ uint8_t state_len;
+
+ message->startPtr = input_ptr;
+ message->stateId = tcomp_buffer_create_null();
+ message->remaining_sigcomp_buffer = tcomp_buffer_create_null();
+ message->uploaded_UDVM_buffer = tcomp_buffer_create_null();
+ message->ret_feedback_buffer= tcomp_buffer_create_null();
+
+ message->isNack = 0;
+ dummy_ptr = ((uint8_t*)input_ptr);
+ end_ptr = (dummy_ptr + input_size);
+
+ //
+ message->totalSize = input_size;
+ message->stream_based = stream;
+ message->bytecodes_destination = 0;
+
+ /* Get sigcomp header */
+ message->headerSigComp = *dummy_ptr;
+ dummy_ptr++;
+
+ /* Check message validity --> magic code (11111)? */
+ message->isOK = HEADER_IS_VALID(message);
+ if(!message->isOK) {
+ TSK_DEBUG_ERROR("SigComp Message not valid (magic code mismatch)");
+ *nack_code = NACK_INTERNAL_ERROR;
+ goto bail;
+ }
+
+ /* Feedback item */
+ if((HEADER_GET_T(message)!=0)) {
+ initFeedbackItem(message, &dummy_ptr);
+ if(!message->isOK) {
+ goto bail;
+ }
+ }
+
+ /*
+ * If the len field is non-zero, then the SigComp message contains a state identifier
+ * to access a state item at the receiving endpoint.
+ */
+ state_len = HEADER_GET_STATE_LENGTH( HEADER_GET_LEN(message) );
+ if(state_len) {
+ initStateId(message, &dummy_ptr, state_len);
+ initStateful(message, &dummy_ptr, end_ptr);
+ TSK_DEBUG_INFO("SigComp - Decompressing stateful message with state id =");
+ tcomp_buffer_print(message->stateId);
+ }
+ else {
+ if( !*dummy_ptr && !(*(dummy_ptr+1)&0xf0) ) {
+ // "code_len" field of zero --> it's a nack
+ initNack(message, &dummy_ptr, end_ptr, nack_code);
+ }
+ else {
+ initStateless(message, &dummy_ptr, end_ptr, nack_code);
+ }
+ }
+
+ /*
+ * The fields (RFC 3320 section 7) except for the "remaining SigComp message" are referred to
+ * as the "SigComp header" (note that this may include the uploaded UDVM bytecode).
+ */
+ if(message->isOK) {
+ message->header_size = ( message->totalSize - tcomp_buffer_getSize(message->remaining_sigcomp_buffer));
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SigComp message");
+ }
bail:
- if(message && !message->isOK){
- TSK_OBJECT_SAFE_FREE(message);
- }
+ if(message && !message->isOK) {
+ TSK_OBJECT_SAFE_FREE(message);
+ }
- return message;
+ return message;
}
/*
@@ -164,24 +163,24 @@ Iniatizes the feedback item field.
*/
static void initFeedbackItem(tcomp_message_t *message, uint8_t** start_ptr)
{
- /*
+ /*
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
- +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
- | 0 | returned_feedback_field | | 1 | returned_feedback_length |
- +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
+ +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
+ | 0 | returned_feedback_field | | 1 | returned_feedback_length |
+ +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| |
: returned_feedback_field :
| |
+---+---+---+---+---+---+---+---+
- */
- if((**start_ptr) <= 128){
- tcomp_buffer_referenceBuff(message->ret_feedback_buffer, *start_ptr, 1);
- (void)(*start_ptr++);
- }
- else{
- tcomp_buffer_referenceBuff(message->ret_feedback_buffer, *start_ptr, 1+(**start_ptr&0x7f));
- *start_ptr += tcomp_buffer_getSize(message->ret_feedback_buffer);
- }
+ */
+ if((**start_ptr) <= 128) {
+ tcomp_buffer_referenceBuff(message->ret_feedback_buffer, *start_ptr, 1);
+ (void)(*start_ptr++);
+ }
+ else {
+ tcomp_buffer_referenceBuff(message->ret_feedback_buffer, *start_ptr, 1+(**start_ptr&0x7f));
+ *start_ptr += tcomp_buffer_getSize(message->ret_feedback_buffer);
+ }
}
/*
@@ -189,8 +188,8 @@ Initializes the state identifier field.
*/
static void initStateId(tcomp_message_t *message, uint8_t** start_ptr, uint8_t state_len)
{
- tcomp_buffer_referenceBuff(message->stateId, *start_ptr, state_len);
- *start_ptr += state_len;
+ tcomp_buffer_referenceBuff(message->stateId, *start_ptr, state_len);
+ *start_ptr += state_len;
}
/*
@@ -198,94 +197,97 @@ Initializes a stateful SigComp message.
*/
static void initStateful(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end_ptr)
{
- /*
- +---+---+---+---+---+---+---+---+
- | |
- : partial state identifier :
- | |
- +---+---+---+---+---+---+---+---+
- | |
- : remaining SigComp message :
- | |
- +---+---+---+---+---+---+---+---+
- */
- message->isOK &= (*start_ptr<=end_ptr);
- if(message->isOK){
- tcomp_buffer_referenceBuff(message->remaining_sigcomp_buffer, *start_ptr,
- ((end_ptr-*start_ptr)));
- }
+ /*
+ +---+---+---+---+---+---+---+---+
+ | |
+ : partial state identifier :
+ | |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : remaining SigComp message :
+ | |
+ +---+---+---+---+---+---+---+---+
+ */
+ message->isOK &= (*start_ptr<=end_ptr);
+ if(message->isOK) {
+ tcomp_buffer_referenceBuff(message->remaining_sigcomp_buffer, *start_ptr,
+ ((end_ptr-*start_ptr)));
+ }
}
-
+
/*
Initializes a stateless SigComp message.
*/
static void initStateless(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end_ptr, int32_t *nack_code)
{
- int has_bytecode = (HEADER_GET_LEN(message) == 0); // No state ==> message contains udvm bytecode
- message->isOK &= has_bytecode;
- if(!message->isOK) return;
-
- /*
- +---+---+---+---+---+---+---+---+
- | code_len |
- +---+---+---+---+---+---+---+---+
- | code_len | destination |
- +---+---+---+---+---+---+---+---+
- | |
- : uploaded UDVM bytecode :
- | |
- +---+---+---+---+---+---+---+---+
- | |
- : remaining SigComp message :
- | |
- +---+---+---+---+---+---+---+---+
- */
- {
- uint32_t code_len1, bytecodes_len;
- uint8_t code_len2, destination, *bytecodes_uploaded_udvm, *remaining_SigComp_message;
-
- uint8_t* dummy_ptr = ((uint8_t*)*start_ptr);
-
- /* Code_len --> 12bits [8+4] */
- code_len1 = *dummy_ptr; dummy_ptr++; /* skip first code_len 8bits */
- code_len2 = (*dummy_ptr) & 0xf0; /* code_len 4 remaining bits */
- destination = (*dummy_ptr) & 0x0f; /* 4bits after code_len */
- dummy_ptr++; /* skip code_len 4bits + destination 4bits ==> 1-byte */
-
- /* Get bytecodes length (12bits) */
- bytecodes_len = ( (code_len1<<4)|(code_len2>>4) );
-
- /* Starting memory address (code destination address). In UDVM. */
- message->bytecodes_destination = HEADER_GET_DEST_VALUE(destination);
- if((message->bytecodes_destination < 128) || (message->bytecodes_destination > 1024)){
- TSK_DEBUG_ERROR("INVALID_CODE_LOCATION");
- *nack_code = NACK_INVALID_CODE_LOCATION;
- message->isOK = 0;
- return;
- }
-
- /* Uploaded UDVM pointer */
- bytecodes_uploaded_udvm = dummy_ptr; /* SigComp header, feedback_item, code_len and destination have been skipped */
-
- /* Skip uploaded udvm */
- dummy_ptr += bytecodes_len;
-
- /* remaining SigComp message */
- remaining_SigComp_message = dummy_ptr;
-
- /* check that remaining sigcomp message is valide */
- if( !(message->isOK &= (remaining_SigComp_message <= end_ptr )) ){
- TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
- *nack_code = NACK_MESSAGE_TOO_SHORT;
- return;
- }
-
- //
- // Setting buffers
- //
- tcomp_buffer_referenceBuff(message->uploaded_UDVM_buffer, bytecodes_uploaded_udvm, bytecodes_len);
- tcomp_buffer_referenceBuff(message->remaining_sigcomp_buffer, remaining_SigComp_message, ((end_ptr-remaining_SigComp_message)));
- }
+ int has_bytecode = (HEADER_GET_LEN(message) == 0); // No state ==> message contains udvm bytecode
+ message->isOK &= has_bytecode;
+ if(!message->isOK) {
+ return;
+ }
+
+ /*
+ +---+---+---+---+---+---+---+---+
+ | code_len |
+ +---+---+---+---+---+---+---+---+
+ | code_len | destination |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : uploaded UDVM bytecode :
+ | |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : remaining SigComp message :
+ | |
+ +---+---+---+---+---+---+---+---+
+ */
+ {
+ uint32_t code_len1, bytecodes_len;
+ uint8_t code_len2, destination, *bytecodes_uploaded_udvm, *remaining_SigComp_message;
+
+ uint8_t* dummy_ptr = ((uint8_t*)*start_ptr);
+
+ /* Code_len --> 12bits [8+4] */
+ code_len1 = *dummy_ptr;
+ dummy_ptr++; /* skip first code_len 8bits */
+ code_len2 = (*dummy_ptr) & 0xf0; /* code_len 4 remaining bits */
+ destination = (*dummy_ptr) & 0x0f; /* 4bits after code_len */
+ dummy_ptr++; /* skip code_len 4bits + destination 4bits ==> 1-byte */
+
+ /* Get bytecodes length (12bits) */
+ bytecodes_len = ( (code_len1<<4)|(code_len2>>4) );
+
+ /* Starting memory address (code destination address). In UDVM. */
+ message->bytecodes_destination = HEADER_GET_DEST_VALUE(destination);
+ if((message->bytecodes_destination < 128) || (message->bytecodes_destination > 1024)) {
+ TSK_DEBUG_ERROR("INVALID_CODE_LOCATION");
+ *nack_code = NACK_INVALID_CODE_LOCATION;
+ message->isOK = 0;
+ return;
+ }
+
+ /* Uploaded UDVM pointer */
+ bytecodes_uploaded_udvm = dummy_ptr; /* SigComp header, feedback_item, code_len and destination have been skipped */
+
+ /* Skip uploaded udvm */
+ dummy_ptr += bytecodes_len;
+
+ /* remaining SigComp message */
+ remaining_SigComp_message = dummy_ptr;
+
+ /* check that remaining sigcomp message is valide */
+ if( !(message->isOK &= (remaining_SigComp_message <= end_ptr )) ) {
+ TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
+ *nack_code = NACK_MESSAGE_TOO_SHORT;
+ return;
+ }
+
+ //
+ // Setting buffers
+ //
+ tcomp_buffer_referenceBuff(message->uploaded_UDVM_buffer, bytecodes_uploaded_udvm, bytecodes_len);
+ tcomp_buffer_referenceBuff(message->remaining_sigcomp_buffer, remaining_SigComp_message, ((end_ptr-remaining_SigComp_message)));
+ }
}
/*
@@ -293,55 +295,57 @@ Initializes a NACK message as per RFC 4077.
*/
static void initNack(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end_ptr, int32_t* nack_code)
{
- /*
- +---+---+---+---+---+---+---+---+
- | code_len = 0 |
- +---+---+---+---+---+---+---+---+
- | code_len = 0 | version = 1 |
- +---+---+---+---+---+---+---+---+
- | Reason Code |
- +---+---+---+---+---+---+---+---+
- | OPCODE of failed instruction |
- +---+---+---+---+---+---+---+---+
- | PC of failed instruction |
- | |
- +---+---+---+---+---+---+---+---+
- | |
- : SHA-1 Hash of failed message :
- | |
- +---+---+---+---+---+---+---+---+
- | |
- : Error Details :
- | |
- +---+---+---+---+---+---+---+---+*/
-
- uint8_t* dummy_ptr;
- message->isNack = 1;
- if( (end_ptr - *start_ptr)<25 ){
- *nack_code = NACK_MESSAGE_TOO_SHORT;
- TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
- message->isOK = 0;
- return;
- }
-
- dummy_ptr = ((uint8_t*)*start_ptr);
- dummy_ptr++; /* skip first code_len byte */
- if(!(message->isOK = (*dummy_ptr++ == NACK_VERSION))) {
- return;
- }
-
- if(!message->nack_info){
- message->nack_info = tcomp_nackinfo_create();
- }
-
- message->nack_info->reasonCode = *dummy_ptr++;
- message->nack_info->opcode = *dummy_ptr++;
- message->nack_info->pc = TSK_BINARY_GET_2BYTES(dummy_ptr); dummy_ptr+=2;
- memcpy(message->nack_info->sha1, dummy_ptr, TSK_SHA1_DIGEST_SIZE); dummy_ptr += TSK_SHA1_DIGEST_SIZE;
- if(dummy_ptr < end_ptr){
- /* Has error details */
- tcomp_buffer_appendBuff(message->nack_info->details, dummy_ptr, (end_ptr-dummy_ptr));
- }
+ /*
+ +---+---+---+---+---+---+---+---+
+ | code_len = 0 |
+ +---+---+---+---+---+---+---+---+
+ | code_len = 0 | version = 1 |
+ +---+---+---+---+---+---+---+---+
+ | Reason Code |
+ +---+---+---+---+---+---+---+---+
+ | OPCODE of failed instruction |
+ +---+---+---+---+---+---+---+---+
+ | PC of failed instruction |
+ | |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : SHA-1 Hash of failed message :
+ | |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : Error Details :
+ | |
+ +---+---+---+---+---+---+---+---+*/
+
+ uint8_t* dummy_ptr;
+ message->isNack = 1;
+ if( (end_ptr - *start_ptr)<25 ) {
+ *nack_code = NACK_MESSAGE_TOO_SHORT;
+ TSK_DEBUG_ERROR("MESSAGE_TOO_SHORT");
+ message->isOK = 0;
+ return;
+ }
+
+ dummy_ptr = ((uint8_t*)*start_ptr);
+ dummy_ptr++; /* skip first code_len byte */
+ if(!(message->isOK = (*dummy_ptr++ == NACK_VERSION))) {
+ return;
+ }
+
+ if(!message->nack_info) {
+ message->nack_info = tcomp_nackinfo_create();
+ }
+
+ message->nack_info->reasonCode = *dummy_ptr++;
+ message->nack_info->opcode = *dummy_ptr++;
+ message->nack_info->pc = TSK_BINARY_GET_2BYTES(dummy_ptr);
+ dummy_ptr+=2;
+ memcpy(message->nack_info->sha1, dummy_ptr, TSK_SHA1_DIGEST_SIZE);
+ dummy_ptr += TSK_SHA1_DIGEST_SIZE;
+ if(dummy_ptr < end_ptr) {
+ /* Has error details */
+ tcomp_buffer_appendBuff(message->nack_info->details, dummy_ptr, (end_ptr-dummy_ptr));
+ }
}
@@ -354,37 +358,36 @@ static void initNack(tcomp_message_t *message, uint8_t** start_ptr, uint8_t* end
static tsk_object_t* tcomp_message_ctor(tsk_object_t *self, va_list * app)
{
- tcomp_message_t *message = self;
+ tcomp_message_t *message = self;
- if(message){
- }
+ if(message) {
+ }
- return self;
+ return self;
}
static tsk_object_t* tcomp_message_dtor(tsk_object_t *self)
{
- tcomp_message_t *message = self;
-
- if(message){
- TSK_OBJECT_SAFE_FREE(message->stateId);
- TSK_OBJECT_SAFE_FREE(message->remaining_sigcomp_buffer);
- TSK_OBJECT_SAFE_FREE(message->uploaded_UDVM_buffer);
- TSK_OBJECT_SAFE_FREE(message->ret_feedback_buffer);
- TSK_OBJECT_SAFE_FREE(message->nack_info);
- }
- else{
- TSK_DEBUG_WARN("NULL SigComp message.");
- }
-
- return self;
+ tcomp_message_t *message = self;
+
+ if(message) {
+ TSK_OBJECT_SAFE_FREE(message->stateId);
+ TSK_OBJECT_SAFE_FREE(message->remaining_sigcomp_buffer);
+ TSK_OBJECT_SAFE_FREE(message->uploaded_UDVM_buffer);
+ TSK_OBJECT_SAFE_FREE(message->ret_feedback_buffer);
+ TSK_OBJECT_SAFE_FREE(message->nack_info);
+ }
+ else {
+ TSK_DEBUG_WARN("NULL SigComp message.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_message_def_s =
-{
- sizeof(tcomp_message_t),
- tcomp_message_ctor,
- tcomp_message_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_message_def_s = {
+ sizeof(tcomp_message_t),
+ tcomp_message_ctor,
+ tcomp_message_dtor,
+ tsk_null
};
const tsk_object_def_t* tcomp_message_def_t = &tcomp_message_def_s;
diff --git a/tinySIGCOMP/src/tcomp_message.h b/tinySIGCOMP/src/tcomp_message.h
index 9d5b41d..70c56d3 100755
--- a/tinySIGCOMP/src/tcomp_message.h
+++ b/tinySIGCOMP/src/tcomp_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,27 +41,26 @@ TCOMP_BEGIN_DECLS
/**
* SigComp Message Format as per RFC 3320 subclause 7.
*/
-typedef struct tcomp_message_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_message_s {
+ TSK_DECLARE_OBJECT;
+
+ uint8_t headerSigComp; /**< SigComp header */
+
+ unsigned isOK:1; /**< Message validity. */
+ unsigned isNack:1; /**< If it's a NACK message. */
+ unsigned stream_based:1; /**< If it's stream message (e.g. TCP) */
+ const uint8_t* startPtr; /**< Message pointer. */
+ tsk_size_t totalSize; /**< The total message size. */
+ tsk_size_t header_size; /**< The size of the message header */
+
+ tcomp_buffer_handle_t* stateId; /**< */
- uint8_t headerSigComp; /**< SigComp header */
+ uint32_t bytecodes_destination; /**< */
+ tcomp_buffer_handle_t* remaining_sigcomp_buffer; /**< */
+ tcomp_buffer_handle_t* uploaded_UDVM_buffer; /**< */
+ tcomp_buffer_handle_t* ret_feedback_buffer; /**< */
- unsigned isOK:1; /**< Message validity. */
- unsigned isNack:1; /**< If it's a NACK message. */
- unsigned stream_based:1; /**< If it's stream message (e.g. TCP) */
- const uint8_t* startPtr; /**< Message pointer. */
- tsk_size_t totalSize; /**< The total message size. */
- tsk_size_t header_size; /**< The size of the message header */
-
- tcomp_buffer_handle_t* stateId; /**< */
-
- uint32_t bytecodes_destination; /**< */
- tcomp_buffer_handle_t* remaining_sigcomp_buffer; /**< */
- tcomp_buffer_handle_t* uploaded_UDVM_buffer; /**< */
- tcomp_buffer_handle_t* ret_feedback_buffer; /**< */
-
- tcomp_nackinfo_t* nack_info; /**< */
+ tcomp_nackinfo_t* nack_info; /**< */
}
tcomp_message_t;
diff --git a/tinySIGCOMP/src/tcomp_nack_codes.h b/tinySIGCOMP/src/tcomp_nack_codes.h
index 76eb33f..20fa12e 100755
--- a/tinySIGCOMP/src/tcomp_nack_codes.h
+++ b/tinySIGCOMP/src/tcomp_nack_codes.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -95,41 +95,39 @@
#define NACK_FRAMING_ERROR 25
-typedef struct tcomp_nack_desc_s
-{
- int32_t code;
- const char* desc;
+typedef struct tcomp_nack_desc_s {
+ int32_t code;
+ const char* desc;
}
tcomp_nack_desc_t;
-static const tcomp_nack_desc_t TCOMP_NACK_DESCRIPTIONS[] =
-{
- { NACK_NONE, "NONE" },
- { NACK_STATE_NOT_FOUND, "STATE_NOT_FOUND" },
- { NACK_CYCLES_EXHAUSTED, "CYCLES_EXHAUSTED" },
- { NACK_USER_REQUESTED, "USER_REQUESTED" },
- { NACK_SEGFAULT, "SEGFAULT" },
- { NACK_TOO_MANY_STATE_REQUESTS, "TOO_MANY_STATE_REQUESTS" },
- { NACK_INVALID_STATE_ID_LENGTH, "INVALID_STATE_ID_LENGTH" },
- { NACK_INVALID_STATE_PRIORITY, "INVALID_STATE_PRIORITY" },
- { NACK_OUTPUT_OVERFLOW, "OUTPUT_OVERFLOW" },
- { NACK_STACK_UNDERFLOW, "STACK_UNDERFLOW" },
- { NACK_BAD_INPUT_BITORDER, "BAD_INPUT_BITORDER" },
- { NACK_DIV_BY_ZERO, "DIV_BY_ZERO" },
- { NACK_SWITCH_VALUE_TOO_HIGH, "SWITCH_VALUE_TOO_HIGH" },
- { NACK_TOO_MANY_BITS_REQUESTED, "TOO_MANY_BITS_REQUESTED" },
- { NACK_INVALID_OPERAND, "INVALID_OPERAND" },
- { NACK_HUFFMAN_NO_MATCH, "HUFFMAN_NO_MATCH" },
- { NACK_MESSAGE_TOO_SHORT, "MESSAGE_TOO_SHORT" },
- { NACK_INVALID_CODE_LOCATION, "INVALID_CODE_LOCATION" },
- { NACK_BYTECODES_TOO_LARGE, "BYTECODES_TOO_LARGE" },
- { NACK_INVALID_OPCODE, "INVALID_OPCODE" },
- { NACK_INVALID_STATE_PROBE, "INVALID_STATE_PROBE" },
- { NACK_ID_NOT_UNIQUE, "ID_NOT_UNIQUE" },
- { NACK_MULTILOAD_OVERWRITTEN, "MULTILOAD_OVERWRITTEN" },
- { NACK_STATE_TOO_SHORT, "STATE_TOO_SHORT" },
- { NACK_INTERNAL_ERROR, "INTERNAL_ERROR" },
- { NACK_FRAMING_ERROR, "FRAMING_ERROR" }
+static const tcomp_nack_desc_t TCOMP_NACK_DESCRIPTIONS[] = {
+ { NACK_NONE, "NONE" },
+ { NACK_STATE_NOT_FOUND, "STATE_NOT_FOUND" },
+ { NACK_CYCLES_EXHAUSTED, "CYCLES_EXHAUSTED" },
+ { NACK_USER_REQUESTED, "USER_REQUESTED" },
+ { NACK_SEGFAULT, "SEGFAULT" },
+ { NACK_TOO_MANY_STATE_REQUESTS, "TOO_MANY_STATE_REQUESTS" },
+ { NACK_INVALID_STATE_ID_LENGTH, "INVALID_STATE_ID_LENGTH" },
+ { NACK_INVALID_STATE_PRIORITY, "INVALID_STATE_PRIORITY" },
+ { NACK_OUTPUT_OVERFLOW, "OUTPUT_OVERFLOW" },
+ { NACK_STACK_UNDERFLOW, "STACK_UNDERFLOW" },
+ { NACK_BAD_INPUT_BITORDER, "BAD_INPUT_BITORDER" },
+ { NACK_DIV_BY_ZERO, "DIV_BY_ZERO" },
+ { NACK_SWITCH_VALUE_TOO_HIGH, "SWITCH_VALUE_TOO_HIGH" },
+ { NACK_TOO_MANY_BITS_REQUESTED, "TOO_MANY_BITS_REQUESTED" },
+ { NACK_INVALID_OPERAND, "INVALID_OPERAND" },
+ { NACK_HUFFMAN_NO_MATCH, "HUFFMAN_NO_MATCH" },
+ { NACK_MESSAGE_TOO_SHORT, "MESSAGE_TOO_SHORT" },
+ { NACK_INVALID_CODE_LOCATION, "INVALID_CODE_LOCATION" },
+ { NACK_BYTECODES_TOO_LARGE, "BYTECODES_TOO_LARGE" },
+ { NACK_INVALID_OPCODE, "INVALID_OPCODE" },
+ { NACK_INVALID_STATE_PROBE, "INVALID_STATE_PROBE" },
+ { NACK_ID_NOT_UNIQUE, "ID_NOT_UNIQUE" },
+ { NACK_MULTILOAD_OVERWRITTEN, "MULTILOAD_OVERWRITTEN" },
+ { NACK_STATE_TOO_SHORT, "STATE_TOO_SHORT" },
+ { NACK_INTERNAL_ERROR, "INTERNAL_ERROR" },
+ { NACK_FRAMING_ERROR, "FRAMING_ERROR" }
};
#endif /* TCOMP_NACKCODES_H */
diff --git a/tinySIGCOMP/src/tcomp_nackinfo.c b/tinySIGCOMP/src/tcomp_nackinfo.c
index fb7b58c..64515df 100755
--- a/tinySIGCOMP/src/tcomp_nackinfo.c
+++ b/tinySIGCOMP/src/tcomp_nackinfo.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,139 +49,139 @@ field is set to 0.
/** Creates new NACK object */
tcomp_nackinfo_t* tcomp_nackinfo_create()
{
- tcomp_nackinfo_t *nackinfo;
- if((nackinfo = tsk_object_new(tcomp_nackinfo_def_t))){
- nackinfo->version = NACK_VERSION;
- nackinfo->details = tcomp_buffer_create_null();
- }
- return nackinfo;
+ tcomp_nackinfo_t *nackinfo;
+ if((nackinfo = tsk_object_new(tcomp_nackinfo_def_t))) {
+ nackinfo->version = NACK_VERSION;
+ nackinfo->details = tcomp_buffer_create_null();
+ }
+ return nackinfo;
}
-int tcomp_nackinfo_write(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- uint8_t opCode,
- int16_t memory_address_of_instruction,
- const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize,
- tcomp_buffer_handle_t* lpDetails,
- uint16_t udvm_size,
- uint8_t cpbValue)
+int tcomp_nackinfo_write(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ uint8_t opCode,
+ int16_t memory_address_of_instruction,
+ const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize,
+ tcomp_buffer_handle_t* lpDetails,
+ uint16_t udvm_size,
+ uint8_t cpbValue)
{
- tsk_sha1context_t sha;
- uint8_t *nackbuffer_ptr;
-
- if(!buffer || !sigCompMessagePtr || !sigCompMessageSize){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tcomp_buffer_allocBuff(buffer, INDEX_NACK_SHA1 + TSK_SHA1_DIGEST_SIZE);
- if(!(nackbuffer_ptr = tcomp_buffer_getBuffer(buffer))){
- TSK_DEBUG_ERROR("NACK buffer is null");
- return -2;
- }
-
- nackbuffer_ptr[INDEX_NACK_HEADER] = 0xf8;
- nackbuffer_ptr[INDEX_NACK_VERSION] = NACK_VERSION;
- nackbuffer_ptr[INDEX_NACK_REASON_CODE] = reasonCode;
- nackbuffer_ptr[INDEX_NACK_OPCODE] = opCode;
- nackbuffer_ptr[INDEX_NACK_PC] = (memory_address_of_instruction >> 8);
- nackbuffer_ptr[INDEX_NACK_PC + 1] = (memory_address_of_instruction & 0x00ff);
-
- // SHA-1(message) computation
- tsk_sha1reset(&sha);
- tsk_sha1input(&sha, sigCompMessagePtr, sigCompMessageSize);
- tsk_sha1result(&sha, &nackbuffer_ptr[INDEX_NACK_SHA1]);
-
+ tsk_sha1context_t sha;
+ uint8_t *nackbuffer_ptr;
+
+ if(!buffer || !sigCompMessagePtr || !sigCompMessageSize) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tcomp_buffer_allocBuff(buffer, INDEX_NACK_SHA1 + TSK_SHA1_DIGEST_SIZE);
+ if(!(nackbuffer_ptr = tcomp_buffer_getBuffer(buffer))) {
+ TSK_DEBUG_ERROR("NACK buffer is null");
+ return -2;
+ }
+
+ nackbuffer_ptr[INDEX_NACK_HEADER] = 0xf8;
+ nackbuffer_ptr[INDEX_NACK_VERSION] = NACK_VERSION;
+ nackbuffer_ptr[INDEX_NACK_REASON_CODE] = reasonCode;
+ nackbuffer_ptr[INDEX_NACK_OPCODE] = opCode;
+ nackbuffer_ptr[INDEX_NACK_PC] = (memory_address_of_instruction >> 8);
+ nackbuffer_ptr[INDEX_NACK_PC + 1] = (memory_address_of_instruction & 0x00ff);
+
+ // SHA-1(message) computation
+ tsk_sha1reset(&sha);
+ tsk_sha1input(&sha, sigCompMessagePtr, sigCompMessageSize);
+ tsk_sha1result(&sha, &nackbuffer_ptr[INDEX_NACK_SHA1]);
+
#if 0
- {
- int i;
- TSK_DEBUG_INFO("Create NACK with id:");
- for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i){
- printf("%x ", nackbuffer_ptr[INDEX_NACK_SHA1 + i]);
- }
- printf("\n");
- }
+ {
+ int i;
+ TSK_DEBUG_INFO("Create NACK with id:");
+ for(i = 0; i < TSK_SHA1_DIGEST_SIZE; ++i) {
+ printf("%x ", nackbuffer_ptr[INDEX_NACK_SHA1 + i]);
+ }
+ printf("\n");
+ }
#endif
- // Details
- if(lpDetails && tcomp_buffer_getSize(lpDetails)){
- tcomp_buffer_appendBuff(buffer, tcomp_buffer_getBuffer(lpDetails), tcomp_buffer_getSize(lpDetails));
- }
- else if(reasonCode == NACK_BYTECODES_TOO_LARGE){
- tcomp_buffer_appendBuff(buffer, &udvm_size, 2);
- }
- else if(reasonCode == NACK_CYCLES_EXHAUSTED){
- tcomp_buffer_appendBuff(buffer, &cpbValue, 1);
- }
+ // Details
+ if(lpDetails && tcomp_buffer_getSize(lpDetails)) {
+ tcomp_buffer_appendBuff(buffer, tcomp_buffer_getBuffer(lpDetails), tcomp_buffer_getSize(lpDetails));
+ }
+ else if(reasonCode == NACK_BYTECODES_TOO_LARGE) {
+ tcomp_buffer_appendBuff(buffer, &udvm_size, 2);
+ }
+ else if(reasonCode == NACK_CYCLES_EXHAUSTED) {
+ tcomp_buffer_appendBuff(buffer, &cpbValue, 1);
+ }
- return 0;
+ return 0;
}
-int tcomp_nackinfo_write_2(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- uint8_t opCode,
- int16_t memory_address_of_instruction,
- const tcomp_message_t* sigCompMessage,
- tcomp_buffer_handle_t* lpDetails,
- uint16_t udvm_size,
- uint8_t cpbValue)
+int tcomp_nackinfo_write_2(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ uint8_t opCode,
+ int16_t memory_address_of_instruction,
+ const tcomp_message_t* sigCompMessage,
+ tcomp_buffer_handle_t* lpDetails,
+ uint16_t udvm_size,
+ uint8_t cpbValue)
{
- return tcomp_nackinfo_write(buffer,
- reasonCode,
- opCode,
- memory_address_of_instruction,
- sigCompMessage->startPtr, sigCompMessage->totalSize,
- lpDetails,
- udvm_size,
- cpbValue);
+ return tcomp_nackinfo_write(buffer,
+ reasonCode,
+ opCode,
+ memory_address_of_instruction,
+ sigCompMessage->startPtr, sigCompMessage->totalSize,
+ lpDetails,
+ udvm_size,
+ cpbValue);
}
-int tcomp_nackinfo_write_3(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize)
+int tcomp_nackinfo_write_3(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize)
{
- return tcomp_nackinfo_write(buffer,
- reasonCode,
- OPCODE_UNKNOWN,
- PC_UNKNOWN,
- sigCompMessagePtr, sigCompMessageSize,
- tsk_null,
- 0,
- 0);
+ return tcomp_nackinfo_write(buffer,
+ reasonCode,
+ OPCODE_UNKNOWN,
+ PC_UNKNOWN,
+ sigCompMessagePtr, sigCompMessageSize,
+ tsk_null,
+ 0,
+ 0);
}
-int tcomp_nackinfo_write_4(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- const tcomp_message_t* sigCompMessage)
+int tcomp_nackinfo_write_4(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ const tcomp_message_t* sigCompMessage)
{
- return tcomp_nackinfo_write_2(buffer,
- reasonCode,
- OPCODE_UNKNOWN,
- PC_UNKNOWN,
- sigCompMessage,
- tsk_null,
- 0,
- 0);
+ return tcomp_nackinfo_write_2(buffer,
+ reasonCode,
+ OPCODE_UNKNOWN,
+ PC_UNKNOWN,
+ sigCompMessage,
+ tsk_null,
+ 0,
+ 0);
}
const char* tcomp_nackinfo_get_description(const tcomp_buffer_handle_t* buffer)
{
- uint8_t reasonCode;
- if(!buffer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- if(tcomp_buffer_getSize(buffer) < 3){
- TSK_DEBUG_ERROR("Too short");
- return tsk_null;
- }
- reasonCode = *((const uint8_t*)tcomp_buffer_getBufferAtPos(buffer, 3));
- if(reasonCode >= (sizeof(TCOMP_NACK_DESCRIPTIONS)/sizeof(TCOMP_NACK_DESCRIPTIONS[0]))){
- TSK_DEBUG_ERROR("%d not valid as reasonCode", (int32_t)reasonCode);
- return tsk_null;
- }
- return TCOMP_NACK_DESCRIPTIONS[reasonCode].desc;
+ uint8_t reasonCode;
+ if(!buffer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ if(tcomp_buffer_getSize(buffer) < 3) {
+ TSK_DEBUG_ERROR("Too short");
+ return tsk_null;
+ }
+ reasonCode = *((const uint8_t*)tcomp_buffer_getBufferAtPos(buffer, 3));
+ if(reasonCode >= (sizeof(TCOMP_NACK_DESCRIPTIONS)/sizeof(TCOMP_NACK_DESCRIPTIONS[0]))) {
+ TSK_DEBUG_ERROR("%d not valid as reasonCode", (int32_t)reasonCode);
+ return tsk_null;
+ }
+ return TCOMP_NACK_DESCRIPTIONS[reasonCode].desc;
}
//========================================================
@@ -195,10 +195,10 @@ const char* tcomp_nackinfo_get_description(const tcomp_buffer_handle_t* buffer)
*/
static tsk_object_t* tcomp_nackinfo_ctor(tsk_object_t *self, va_list* app)
{
- tcomp_nackinfo_t *nackinfo = self;
- if(nackinfo){
- }
- return self;
+ tcomp_nackinfo_t *nackinfo = self;
+ if(nackinfo) {
+ }
+ return self;
}
/*
@@ -208,20 +208,19 @@ static tsk_object_t* tcomp_nackinfo_ctor(tsk_object_t *self, va_list* app)
*/
static tsk_object_t* tcomp_nackinfo_dtor(tsk_object_t* self)
{
- tcomp_nackinfo_t *nackinfo = self;
- if(nackinfo){
- TSK_OBJECT_SAFE_FREE(nackinfo->details);
- }
- return self;
+ tcomp_nackinfo_t *nackinfo = self;
+ if(nackinfo) {
+ TSK_OBJECT_SAFE_FREE(nackinfo->details);
+ }
+ return self;
}
-static const tsk_object_def_t tcomp_nackinfo_def_s =
-{
- sizeof(tcomp_nackinfo_t),
- tcomp_nackinfo_ctor,
- tcomp_nackinfo_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_nackinfo_def_s = {
+ sizeof(tcomp_nackinfo_t),
+ tcomp_nackinfo_ctor,
+ tcomp_nackinfo_dtor,
+ tsk_null
};
const tsk_object_def_t* tcomp_nackinfo_def_t = &tcomp_nackinfo_def_s;
diff --git a/tinySIGCOMP/src/tcomp_nackinfo.h b/tinySIGCOMP/src/tcomp_nackinfo.h
index 5a1e427..e7dd0e7 100755
--- a/tinySIGCOMP/src/tcomp_nackinfo.h
+++ b/tinySIGCOMP/src/tcomp_nackinfo.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,42 +65,41 @@ struct tcomp_message_s;
/**NACK info as per rfc 4077 subclause 3.1.
* You MUST use @ref tcomp_nackinfo_create() to create new nackinfo object.
*/
-typedef struct tcomp_nackinfo_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_nackinfo_s {
+ TSK_DECLARE_OBJECT;
- uint8_t version; /**< Gives the version of the NACK mechanism being employed. */
- uint8_t reasonCode; /**< The Reason Code is a one-byte value that indicates the nature of the decompression failure. */
- uint8_t opcode; /**< The "OPCODE of failed instruction" is a one-byte field that includes the opcode to which the PC was pointing when the failure occurred */
- uint32_t pc; /**< "PC of failed instruction" is a two-byte field containing the value of the program counter when failure occurred (i.e., the memory address of the failed UDVM instruction) */
- uint8_t sha1[TSK_SHA1_DIGEST_SIZE]; /**<"SHA-1 Hash of failed message" contains the full 20-byte SHA-1 hash of the SigComp message that could not be decompressed */
- tcomp_buffer_handle_t *details; /**< "Error Details" provides additional information that might be useful in correcting the problem that caused decompression failure.*/
+ uint8_t version; /**< Gives the version of the NACK mechanism being employed. */
+ uint8_t reasonCode; /**< The Reason Code is a one-byte value that indicates the nature of the decompression failure. */
+ uint8_t opcode; /**< The "OPCODE of failed instruction" is a one-byte field that includes the opcode to which the PC was pointing when the failure occurred */
+ uint32_t pc; /**< "PC of failed instruction" is a two-byte field containing the value of the program counter when failure occurred (i.e., the memory address of the failed UDVM instruction) */
+ uint8_t sha1[TSK_SHA1_DIGEST_SIZE]; /**<"SHA-1 Hash of failed message" contains the full 20-byte SHA-1 hash of the SigComp message that could not be decompressed */
+ tcomp_buffer_handle_t *details; /**< "Error Details" provides additional information that might be useful in correcting the problem that caused decompression failure.*/
}
tcomp_nackinfo_t;
tcomp_nackinfo_t* tcomp_nackinfo_create();
-int tcomp_nackinfo_write(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- uint8_t opCode,
- int16_t memory_address_of_instruction,
- const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize,
- tcomp_buffer_handle_t* lpDetails,
- uint16_t udvm_size,
- uint8_t cpbValue);
-int tcomp_nackinfo_write_2(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- uint8_t opCode,
- int16_t memory_address_of_instruction,
- const struct tcomp_message_s* sigCompMessage,
- tcomp_buffer_handle_t* lpDetails,
- uint16_t udvm_size,
- uint8_t cpbValue);
-int tcomp_nackinfo_write_3(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize);
-int tcomp_nackinfo_write_4(tcomp_buffer_handle_t* buffer,
- uint8_t reasonCode,
- const struct tcomp_message_s* sigCompMessage);
+int tcomp_nackinfo_write(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ uint8_t opCode,
+ int16_t memory_address_of_instruction,
+ const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize,
+ tcomp_buffer_handle_t* lpDetails,
+ uint16_t udvm_size,
+ uint8_t cpbValue);
+int tcomp_nackinfo_write_2(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ uint8_t opCode,
+ int16_t memory_address_of_instruction,
+ const struct tcomp_message_s* sigCompMessage,
+ tcomp_buffer_handle_t* lpDetails,
+ uint16_t udvm_size,
+ uint8_t cpbValue);
+int tcomp_nackinfo_write_3(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ const void* sigCompMessagePtr, tsk_size_t sigCompMessageSize);
+int tcomp_nackinfo_write_4(tcomp_buffer_handle_t* buffer,
+ uint8_t reasonCode,
+ const struct tcomp_message_s* sigCompMessage);
TINYSIGCOMP_API const char* tcomp_nackinfo_get_description(const tcomp_buffer_handle_t* buffer);
diff --git a/tinySIGCOMP/src/tcomp_operands.h b/tinySIGCOMP/src/tcomp_operands.h
index 985391a..2798642 100755
--- a/tinySIGCOMP/src/tcomp_operands.h
+++ b/tinySIGCOMP/src/tcomp_operands.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_params.c b/tinySIGCOMP/src/tcomp_params.c
index c7d7c54..ac79414 100755
--- a/tinySIGCOMP/src/tcomp_params.c
+++ b/tinySIGCOMP/src/tcomp_params.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,7 +34,7 @@
tcomp_params_t* tcomp_params_create()
{
- return tsk_object_new(tcomp_params_def_t);
+ return tsk_object_new(tcomp_params_def_t);
}
/**
@@ -44,14 +44,14 @@ tcomp_params_t* tcomp_params_create()
*/
tsk_bool_t tcomp_params_hasCpbDmsSms(tcomp_params_t* params)
{
- if(params){
- return (params->cpbCode || params->dmsCode || params->smsCode) ? tsk_true : tsk_false;
- }
- else{
- TSK_DEBUG_WARN("Invalid parameter.");
- }
-
- return tsk_false;
+ if(params) {
+ return (params->cpbCode || params->dmsCode || params->smsCode) ? tsk_true : tsk_false;
+ }
+ else {
+ TSK_DEBUG_WARN("Invalid parameter.");
+ }
+
+ return tsk_false;
}
/**
@@ -62,13 +62,13 @@ tsk_bool_t tcomp_params_hasCpbDmsSms(tcomp_params_t* params)
*/
void tcomp_params_setCpbCode(tcomp_params_t* params, uint8_t cpbCode)
{
- if(params){
- params->cpbCode = cpbCode;
- params->cpbValue = sigcomp_encoding_cpb[cpbCode];
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(params) {
+ params->cpbCode = cpbCode;
+ params->cpbValue = sigcomp_encoding_cpb[cpbCode];
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
}
/**
@@ -79,22 +79,21 @@ void tcomp_params_setCpbCode(tcomp_params_t* params, uint8_t cpbCode)
*/
int tcomp_params_setCpbValue(tcomp_params_t* params, uint8_t cpbValue)
{
- if(params)
- {
- uint8_t code;
- for(code=0; code<4; code++){
- if( cpbValue <= sigcomp_encoding_cpb[code]){
- params->cpbCode = code;
- break;
- }
- }
- params->cpbValue = cpbValue;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
+ if(params) {
+ uint8_t code;
+ for(code=0; code<4; code++) {
+ if( cpbValue <= sigcomp_encoding_cpb[code]) {
+ params->cpbCode = code;
+ break;
+ }
+ }
+ params->cpbValue = cpbValue;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
}
/**
@@ -105,13 +104,13 @@ int tcomp_params_setCpbValue(tcomp_params_t* params, uint8_t cpbValue)
*/
void tcomp_params_setDmsCode(tcomp_params_t* params, uint8_t dmsCode)
{
- if(params){
- params->dmsCode = dmsCode;
- params->dmsValue = sigcomp_encoding_dms[dmsCode];
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(params) {
+ params->dmsCode = dmsCode;
+ params->dmsValue = sigcomp_encoding_dms[dmsCode];
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
}
/**
@@ -122,21 +121,21 @@ void tcomp_params_setDmsCode(tcomp_params_t* params, uint8_t dmsCode)
*/
int tcomp_params_setDmsValue(tcomp_params_t* params, uint32_t dmsValue)
{
- if(params){
- uint8_t code;
- for(code=1; code<8; code++){
- if(dmsValue <= sigcomp_encoding_dms[code]){
- params->dmsCode = code;
- break;
- }
- }
- params->dmsValue = dmsValue;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
+ if(params) {
+ uint8_t code;
+ for(code=1; code<8; code++) {
+ if(dmsValue <= sigcomp_encoding_dms[code]) {
+ params->dmsCode = code;
+ break;
+ }
+ }
+ params->dmsValue = dmsValue;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
}
/**
@@ -147,13 +146,13 @@ int tcomp_params_setDmsValue(tcomp_params_t* params, uint32_t dmsValue)
*/
void tcomp_params_setSmsCode(tcomp_params_t* params, uint8_t smsCode)
{
- if(params){
- params->smsCode = smsCode;
- params->smsValue = sigcomp_encoding_sms[smsCode];
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(params) {
+ params->smsCode = smsCode;
+ params->smsValue = sigcomp_encoding_sms[smsCode];
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
}
/**
@@ -164,21 +163,21 @@ void tcomp_params_setSmsCode(tcomp_params_t* params, uint8_t smsCode)
*/
int tcomp_params_setSmsValue(tcomp_params_t* params, uint32_t smsValue)
{
- if(params){
- uint8_t code;
- for(code = 0; code < 8; code++){
- if(smsValue <= sigcomp_encoding_sms[code]){
- params->smsCode = code;
- break;
- }
- }
- params->smsValue = smsValue;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
+ if(params) {
+ uint8_t code;
+ for(code = 0; code < 8; code++) {
+ if(smsValue <= sigcomp_encoding_sms[code]) {
+ params->smsCode = code;
+ break;
+ }
+ }
+ params->smsValue = smsValue;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
}
/**
@@ -189,23 +188,23 @@ int tcomp_params_setSmsValue(tcomp_params_t* params, uint32_t smsValue)
*/
uint32_t tcomp_params_getParameters(tcomp_params_t* params)
{
- if(params){
- /*
- +---+---+---+---+---+---+---+---+
- | cpb | dms | sms |
- +---+---+---+---+---+---+---+---+
- | SigComp_version |
- +---+---+---+---+---+---+---+---+
- */
- uint32_t result = ((params->cpbCode<<6)|(params->dmsCode<<3)|params->smsCode);
- result <<=8;
- return (result | params->SigComp_version);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(params) {
+ /*
+ +---+---+---+---+---+---+---+---+
+ | cpb | dms | sms |
+ +---+---+---+---+---+---+---+---+
+ | SigComp_version |
+ +---+---+---+---+---+---+---+---+
+ */
+ uint32_t result = ((params->cpbCode<<6)|(params->dmsCode<<3)|params->smsCode);
+ result <<=8;
+ return (result | params->SigComp_version);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
- return 0;
+ return 0;
}
/**
@@ -216,22 +215,22 @@ uint32_t tcomp_params_getParameters(tcomp_params_t* params)
*/
void tcomp_params_setParameters(tcomp_params_t* params, uint32_t sigCompParameters)
{
- if(params){
- /*
- +---+---+---+---+---+---+---+---+
- | cpb | dms | sms |
- +---+---+---+---+---+---+---+---+
- | SigComp_version |
- +---+---+---+---+---+---+---+---+
- */
- tcomp_params_setCpbCode( params, (sigCompParameters>>14) );
- tcomp_params_setDmsCode( params, ((sigCompParameters>>11) & 0x07) );
- tcomp_params_setSmsCode( params, ((sigCompParameters>>8) & 0x07) );
- params->SigComp_version = ( (sigCompParameters & 0x00ff) );
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(params) {
+ /*
+ +---+---+---+---+---+---+---+---+
+ | cpb | dms | sms |
+ +---+---+---+---+---+---+---+---+
+ | SigComp_version |
+ +---+---+---+---+---+---+---+---+
+ */
+ tcomp_params_setCpbCode( params, (sigCompParameters>>14) );
+ tcomp_params_setDmsCode( params, ((sigCompParameters>>11) & 0x07) );
+ tcomp_params_setSmsCode( params, ((sigCompParameters>>8) & 0x07) );
+ params->SigComp_version = ( (sigCompParameters & 0x00ff) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
}
/**
@@ -240,15 +239,15 @@ void tcomp_params_setParameters(tcomp_params_t* params, uint32_t sigCompParamete
*/
void tcomp_params_reset(tcomp_params_t* params)
{
- if(params){
- params->cpbCode = params->dmsCode = params->smsCode = params->SigComp_version = 0;
- params->cpbValue = params->dmsValue = params->smsValue = 0;
-
- tsk_list_clear_items(params->returnedStates);
- }
- else{
- TSK_DEBUG_WARN("Invalid parameter.");
- }
+ if(params) {
+ params->cpbCode = params->dmsCode = params->smsCode = params->SigComp_version = 0;
+ params->cpbValue = params->dmsValue = params->smsValue = 0;
+
+ tsk_list_clear_items(params->returnedStates);
+ }
+ else {
+ TSK_DEBUG_WARN("Invalid parameter.");
+ }
}
@@ -263,35 +262,34 @@ void tcomp_params_reset(tcomp_params_t* params)
//
static tsk_object_t* tcomp_params_ctor(tsk_object_t *self, va_list * app)
{
- tcomp_params_t *params = self;
- if(params){
- //tcomp_params_reset(params);
- params->returnedStates = tsk_list_create();
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new sigcomp params.");
- }
-
- return self;
+ tcomp_params_t *params = self;
+ if(params) {
+ //tcomp_params_reset(params);
+ params->returnedStates = tsk_list_create();
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new sigcomp params.");
+ }
+
+ return self;
}
static tsk_object_t* tcomp_params_dtor(tsk_object_t *self)
{
- tcomp_params_t *params = self;
- if(params){
- TSK_OBJECT_SAFE_FREE(params->returnedStates);
- }
- else{
- TSK_DEBUG_WARN("NULL sigcomp parameters.");
- }
+ tcomp_params_t *params = self;
+ if(params) {
+ TSK_OBJECT_SAFE_FREE(params->returnedStates);
+ }
+ else {
+ TSK_DEBUG_WARN("NULL sigcomp parameters.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tcomp_params_def_s =
-{
- sizeof(tcomp_params_t),
- tcomp_params_ctor,
- tcomp_params_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_params_def_s = {
+ sizeof(tcomp_params_t),
+ tcomp_params_ctor,
+ tcomp_params_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_params_def_t = &tcomp_params_def_s;
diff --git a/tinySIGCOMP/src/tcomp_params.h b/tinySIGCOMP/src/tcomp_params.h
index 85d96dc..031af2d 100755
--- a/tinySIGCOMP/src/tcomp_params.h
+++ b/tinySIGCOMP/src/tcomp_params.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,27 +41,26 @@
TCOMP_BEGIN_DECLS
-typedef struct tcomp_params_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_params_s {
+ TSK_DECLARE_OBJECT;
- uint8_t cpbCode; /**< 'Cycles Per Bit' binary code. You MUST use @ref tcomp_params_setCpbCode to set this value. */
- uint8_t dmsCode; /**< 'Decompression Memory' Size binary code. You MUST use @ref tcomp_params_setDmsCode to set this value. */
- uint8_t smsCode; /**< 'State Memory Size' binary code. You MUST use @ref tcomp_params_setSmsCode to set this value. */
+ uint8_t cpbCode; /**< 'Cycles Per Bit' binary code. You MUST use @ref tcomp_params_setCpbCode to set this value. */
+ uint8_t dmsCode; /**< 'Decompression Memory' Size binary code. You MUST use @ref tcomp_params_setDmsCode to set this value. */
+ uint8_t smsCode; /**< 'State Memory Size' binary code. You MUST use @ref tcomp_params_setSmsCode to set this value. */
- uint8_t cpbValue; /**< 'Cycles Per Bit' value. You MUST use @ref tcomp_params_setCpbValue to set this value. */
- uint32_t dmsValue; /**< 'Decompression Memory Size' value. You MUST use @ref tcomp_params_setDmsValue to set this value. */
- uint32_t smsValue; /**< 'State Memory Size' value You MUST use @ref tcomp_params_setSmsValue to set this value. */
+ uint8_t cpbValue; /**< 'Cycles Per Bit' value. You MUST use @ref tcomp_params_setCpbValue to set this value. */
+ uint32_t dmsValue; /**< 'Decompression Memory Size' value. You MUST use @ref tcomp_params_setDmsValue to set this value. */
+ uint32_t smsValue; /**< 'State Memory Size' value You MUST use @ref tcomp_params_setSmsValue to set this value. */
- uint8_t SigComp_version; /**< SigComp version. */
- tcomp_buffers_L_t* returnedStates; /**< List of the returned states. */
+ uint8_t SigComp_version; /**< SigComp version. */
+ tcomp_buffers_L_t* returnedStates; /**< List of the returned states. */
}
tcomp_params_t;
tcomp_params_t* tcomp_params_create();
tsk_bool_t tcomp_params_hasCpbDmsSms(tcomp_params_t*);
-
+
void tcomp_params_setCpbCode(tcomp_params_t*, uint8_t _cpbCode);
int tcomp_params_setCpbValue(tcomp_params_t*, uint8_t _cpbValue);
diff --git a/tinySIGCOMP/src/tcomp_reqfeed.c b/tinySIGCOMP/src/tcomp_reqfeed.c
index 0969c04..a186620 100755
--- a/tinySIGCOMP/src/tcomp_reqfeed.c
+++ b/tinySIGCOMP/src/tcomp_reqfeed.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,7 +37,7 @@
*/
tcomp_reqfeed_t* tcomp_reqfeed_create()
{
- return tsk_object_new(tcomp_reqfeed_def_t);
+ return tsk_object_new(tcomp_reqfeed_def_t);
}
/**
@@ -46,15 +46,15 @@ tcomp_reqfeed_t* tcomp_reqfeed_create()
*/
void tcomp_reqfeed_reset(tcomp_reqfeed_t* feedback)
{
- if(feedback){
- tcomp_buffer_freeBuff(feedback->item);
- tcomp_buffer_reset(feedback->item);
-
- feedback->Q = feedback->S = feedback->I = 0;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
+ if(feedback) {
+ tcomp_buffer_freeBuff(feedback->item);
+ tcomp_buffer_reset(feedback->item);
+
+ feedback->Q = feedback->S = feedback->I = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
}
@@ -65,33 +65,32 @@ void tcomp_reqfeed_reset(tcomp_reqfeed_t* feedback)
//
static void* tcomp_reqfeed_ctor(void * self, va_list * app)
{
- tcomp_reqfeed_t *feedback = self;
- if(feedback){
- feedback->item = tcomp_buffer_create_null();
- }
- else{
- TSK_DEBUG_WARN("NULL feedback");
- }
+ tcomp_reqfeed_t *feedback = self;
+ if(feedback) {
+ feedback->item = tcomp_buffer_create_null();
+ }
+ else {
+ TSK_DEBUG_WARN("NULL feedback");
+ }
- return self;
+ return self;
}
static void* tcomp_reqfeed_dtor(void* self)
{
- tcomp_reqfeed_t *feedback = self;
- if(feedback){
- TSK_OBJECT_SAFE_FREE(feedback->item);
- }
- else{
- TSK_DEBUG_WARN("NULL feedback");
- }
- return self;
+ tcomp_reqfeed_t *feedback = self;
+ if(feedback) {
+ TSK_OBJECT_SAFE_FREE(feedback->item);
+ }
+ else {
+ TSK_DEBUG_WARN("NULL feedback");
+ }
+ return self;
}
-static const tsk_object_def_t tcomp_reqfeed_def_s =
-{
- sizeof(tcomp_reqfeed_t),
- tcomp_reqfeed_ctor,
- tcomp_reqfeed_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_reqfeed_def_s = {
+ sizeof(tcomp_reqfeed_t),
+ tcomp_reqfeed_ctor,
+ tcomp_reqfeed_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_reqfeed_def_t = &tcomp_reqfeed_def_s;
diff --git a/tinySIGCOMP/src/tcomp_reqfeed.h b/tinySIGCOMP/src/tcomp_reqfeed.h
index a3f9089..6821f85 100755
--- a/tinySIGCOMP/src/tcomp_reqfeed.h
+++ b/tinySIGCOMP/src/tcomp_reqfeed.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,18 +49,17 @@ TCOMP_BEGIN_DECLS
/** SigComp Requested feedback item as per RFC 3320 subclause 9.4.9.
*/
-typedef struct tcomp_reqfeed_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_reqfeed_s {
+ TSK_DECLARE_OBJECT;
- unsigned Q:1; /**< The Q-bit indicates whether a requested feedback item is present or not.*/
- unsigned S:1; /**< The compressor sets the S-bit to 1 if it does not wish (or no longer
+ unsigned Q:1; /**< The Q-bit indicates whether a requested feedback item is present or not.*/
+ unsigned S:1; /**< The compressor sets the S-bit to 1 if it does not wish (or no longer
wishes) to save state information at the receiving endpoint and also
does not wish to access state information that it has previously saved.*/
- unsigned I:1; /**< Similarly the compressor sets the I-bit to 1 if it does not wish (or
+ unsigned I:1; /**< Similarly the compressor sets the I-bit to 1 if it does not wish (or
no longer wishes) to access any of the locally available state items
offered by the receiving endpoint.*/
- tcomp_buffer_handle_t *item; /**< The requested item feedback data */
+ tcomp_buffer_handle_t *item; /**< The requested item feedback data */
}
tcomp_reqfeed_t;
diff --git a/tinySIGCOMP/src/tcomp_result.c b/tinySIGCOMP/src/tcomp_result.c
index 457ba65..111a9dc 100755
--- a/tinySIGCOMP/src/tcomp_result.c
+++ b/tinySIGCOMP/src/tcomp_result.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,141 +35,141 @@
*/
tcomp_result_t* tcomp_result_create()
{
- return tsk_object_new(tcomp_result_def_t);
+ return tsk_object_new(tcomp_result_def_t);
}
tcomp_tempstate_to_free_t* tcomp_tempstate_to_free_create()
{
- return tsk_object_new(tcomp_tempstate_to_free_def_t);
+ return tsk_object_new(tcomp_tempstate_to_free_def_t);
}
/**Resets the result.
*/
void _tcomp_result_reset(tcomp_result_t *result, tsk_bool_t isDestructor, tsk_bool_t isResetOutput)
{
- if(result){
- uint8_t i;
- for(i = 0; i < result->statesToCreateIndex; i++){
- TSK_OBJECT_SAFE_FREE(result->statesToCreate[i]);
- }
-
- for(i = 0; i < result->statesToFreeIndex; i++){
- TSK_OBJECT_SAFE_FREE(result->statesToFree[i]);
- }
-
- if(!isDestructor){
- result->statesToCreateIndex = 0;
- result->statesToFreeIndex = 0;
- result->consumed_cycles = 0;
-
- tcomp_params_reset(result->remote_parameters);
-
- if(isResetOutput){
- tcomp_buffer_reset(result->output_buffer);
- }
-
- tcomp_reqfeed_reset(result->req_feedback);
- tcomp_buffer_freeBuff(result->ret_feedback);
-
- result->isNack = 0;
- tcomp_buffer_freeBuff(result->nack_info);
- }
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
+ if(result) {
+ uint8_t i;
+ for(i = 0; i < result->statesToCreateIndex; i++) {
+ TSK_OBJECT_SAFE_FREE(result->statesToCreate[i]);
+ }
+
+ for(i = 0; i < result->statesToFreeIndex; i++) {
+ TSK_OBJECT_SAFE_FREE(result->statesToFree[i]);
+ }
+
+ if(!isDestructor) {
+ result->statesToCreateIndex = 0;
+ result->statesToFreeIndex = 0;
+ result->consumed_cycles = 0;
+
+ tcomp_params_reset(result->remote_parameters);
+
+ if(isResetOutput) {
+ tcomp_buffer_reset(result->output_buffer);
+ }
+
+ tcomp_reqfeed_reset(result->req_feedback);
+ tcomp_buffer_freeBuff(result->ret_feedback);
+
+ result->isNack = 0;
+ tcomp_buffer_freeBuff(result->nack_info);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
}
/**Sets the output buffer.
*/
void tcomp_result_setOutputBuffer(tcomp_result_t *result, void *output_ptr, tsk_size_t output_size, tsk_bool_t isStream, uint64_t streamId)
{
- if(result){
- tcomp_buffer_referenceBuff(result->output_buffer, (uint8_t*)output_ptr, output_size);
- result->isStreamBased = isStream;
- result->streamId = streamId;
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
+ if(result) {
+ tcomp_buffer_referenceBuff(result->output_buffer, (uint8_t*)output_ptr, output_size);
+ result->isStreamBased = isStream;
+ result->streamId = streamId;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
}
/**Sets the compartment identifier.
*/
void tcomp_result_setCompartmentId(tcomp_result_t *result, const void *id, tsk_size_t len)
{
- if(result){
- result->compartmentId = tcomp_buffer_createHash(id, len);
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
+ if(result) {
+ result->compartmentId = tcomp_buffer_createHash(id, len);
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
}
/**Adds temporary state.
*/
void tcomp_result_addTempStateToCreate(tcomp_result_t *result, tcomp_state_t* lpState)
{
- if(result){
- /*
- * Note that there is a maximum limit of four state creation requests per instance of the UDVM.
- */
- if(result->statesToCreateIndex >= MAX_TEMP_SATES) {
- TSK_DEBUG_ERROR("Maximum limit for %d state creation requests reached", MAX_TEMP_SATES);
- return;
- }
-
- // Add state
- result->statesToCreate[result->statesToCreateIndex++] = lpState;
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
+ if(result) {
+ /*
+ * Note that there is a maximum limit of four state creation requests per instance of the UDVM.
+ */
+ if(result->statesToCreateIndex >= MAX_TEMP_SATES) {
+ TSK_DEBUG_ERROR("Maximum limit for %d state creation requests reached", MAX_TEMP_SATES);
+ return;
+ }
+
+ // Add state
+ result->statesToCreate[result->statesToCreateIndex++] = lpState;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
}
/**Gets the number of temporary state (to be created).
*/
uint8_t tcomp_result_getTempStatesToCreateSize(const tcomp_result_t *result)
{
- if(result){
- return result->statesToCreateIndex;
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
- return 0;
+ if(result) {
+ return result->statesToCreateIndex;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
+ return 0;
}
/**Adds temporary state (to be freed).
*/
void tcomp_result_addTempStateToFree(tcomp_result_t *result, tcomp_tempstate_to_free_t* lpDesc)
{
- if(result){
- /*
- * Decompression failure MUST occur if more than four state free
- * requests are made before the END-MESSAGE instruction is encountered.
- */
- if(result->statesToFreeIndex >= MAX_TEMP_SATES) {
- return;
- }
- result->statesToFree[result->statesToFreeIndex++] = lpDesc;
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
+ if(result) {
+ /*
+ * Decompression failure MUST occur if more than four state free
+ * requests are made before the END-MESSAGE instruction is encountered.
+ */
+ if(result->statesToFreeIndex >= MAX_TEMP_SATES) {
+ return;
+ }
+ result->statesToFree[result->statesToFreeIndex++] = lpDesc;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
}
/**Gets the number of temporary state (to be be freed).
*/
uint8_t tcomp_result_getTempStatesToFreeSize(const tcomp_result_t *result)
{
- if(result){
- return result->statesToFreeIndex;
- }
- else{
- TSK_DEBUG_ERROR("NULL SigComp result.");
- }
- return 0;
+ if(result) {
+ return result->statesToFreeIndex;
+ }
+ else {
+ TSK_DEBUG_ERROR("NULL SigComp result.");
+ }
+ return 0;
}
@@ -182,51 +182,50 @@ uint8_t tcomp_result_getTempStatesToFreeSize(const tcomp_result_t *result)
static tsk_object_t* tcomp_result_ctor(tsk_object_t *self, va_list * app)
{
- tcomp_result_t* result = self;
+ tcomp_result_t* result = self;
- if(result){
- result->output_buffer = tcomp_buffer_create_null();
- result->ret_feedback = tcomp_buffer_create_null();
- result->nack_info = tcomp_buffer_create_null();
+ if(result) {
+ result->output_buffer = tcomp_buffer_create_null();
+ result->ret_feedback = tcomp_buffer_create_null();
+ result->nack_info = tcomp_buffer_create_null();
- result->remote_parameters = tcomp_params_create();
+ result->remote_parameters = tcomp_params_create();
- result->req_feedback = tcomp_reqfeed_create();
- }
- else{
- TSK_DEBUG_ERROR("Null result object");
- }
+ result->req_feedback = tcomp_reqfeed_create();
+ }
+ else {
+ TSK_DEBUG_ERROR("Null result object");
+ }
- return self;
+ return self;
}
static tsk_object_t* tcomp_result_dtor(tsk_object_t * self)
{
- tcomp_result_t* result = self;
+ tcomp_result_t* result = self;
- if(result){
- _tcomp_result_reset(result, tsk_true, tsk_true);
- TSK_OBJECT_SAFE_FREE(result->output_buffer);
- TSK_OBJECT_SAFE_FREE(result->ret_feedback);
- TSK_OBJECT_SAFE_FREE(result->nack_info);
+ if(result) {
+ _tcomp_result_reset(result, tsk_true, tsk_true);
+ TSK_OBJECT_SAFE_FREE(result->output_buffer);
+ TSK_OBJECT_SAFE_FREE(result->ret_feedback);
+ TSK_OBJECT_SAFE_FREE(result->nack_info);
- TSK_OBJECT_SAFE_FREE(result->remote_parameters);
+ TSK_OBJECT_SAFE_FREE(result->remote_parameters);
- TSK_OBJECT_SAFE_FREE(result->req_feedback);
- }
- else{
- TSK_DEBUG_ERROR("Null result object");
- }
+ TSK_OBJECT_SAFE_FREE(result->req_feedback);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null result object");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tcomp_result_def_s =
-{
- sizeof(tcomp_result_t),
- tcomp_result_ctor,
- tcomp_result_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_result_def_s = {
+ sizeof(tcomp_result_t),
+ tcomp_result_ctor,
+ tcomp_result_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_result_def_t = &tcomp_result_def_s;
@@ -237,37 +236,36 @@ const tsk_object_def_t *tcomp_result_def_t = &tcomp_result_def_s;
static tsk_object_t* tcomp_tempstate_to_free_ctor(tsk_object_t* self, va_list * app)
{
- tcomp_tempstate_to_free_t* tempstate_to_free = self;
+ tcomp_tempstate_to_free_t* tempstate_to_free = self;
- if(tempstate_to_free){
- tempstate_to_free->identifier = tcomp_buffer_create_null();
- }
- else{
- TSK_DEBUG_ERROR("Null object");
- }
+ if(tempstate_to_free) {
+ tempstate_to_free->identifier = tcomp_buffer_create_null();
+ }
+ else {
+ TSK_DEBUG_ERROR("Null object");
+ }
- return self;
+ return self;
}
static tsk_object_t* tcomp_tempstate_to_free_dtor(tsk_object_t* self)
{
- tcomp_tempstate_to_free_t* tempstate_to_free = self;
+ tcomp_tempstate_to_free_t* tempstate_to_free = self;
- if(tempstate_to_free){
- TSK_OBJECT_SAFE_FREE(tempstate_to_free->identifier);
- }
- else{
- TSK_DEBUG_ERROR("Null object");
- }
+ if(tempstate_to_free) {
+ TSK_OBJECT_SAFE_FREE(tempstate_to_free->identifier);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null object");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tcomp_tempstate_to_free_def_s =
-{
- sizeof(tcomp_tempstate_to_free_t),
- tcomp_tempstate_to_free_ctor,
- tcomp_tempstate_to_free_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_tempstate_to_free_def_s = {
+ sizeof(tcomp_tempstate_to_free_t),
+ tcomp_tempstate_to_free_ctor,
+ tcomp_tempstate_to_free_dtor,
+ tsk_null
};
const tsk_object_def_t* tcomp_tempstate_to_free_def_t = &tcomp_tempstate_to_free_def_s;
diff --git a/tinySIGCOMP/src/tcomp_result.h b/tinySIGCOMP/src/tcomp_result.h
index 3a44249..6e3b770 100755
--- a/tinySIGCOMP/src/tcomp_result.h
+++ b/tinySIGCOMP/src/tcomp_result.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,15 +43,14 @@ TCOMP_BEGIN_DECLS
#define MAX_TEMP_SATES 4
-typedef struct tcomp_tempstate_to_free_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_tempstate_to_free_s {
+ TSK_DECLARE_OBJECT;
- // Operands
- uint32_t partial_identifier_start;
- uint32_t partial_identifier_length;
- // identifier
- tcomp_buffer_handle_t *identifier;
+ // Operands
+ uint32_t partial_identifier_start;
+ uint32_t partial_identifier_length;
+ // identifier
+ tcomp_buffer_handle_t *identifier;
}
tcomp_tempstate_to_free_t;
@@ -59,29 +58,28 @@ TINYSIGCOMP_GEXTERN const tsk_object_def_t *tcomp_tempstate_to_free_def_t;
/**SigComp decompression result.
*/
-typedef struct tcomp_result_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tcomp_result_s {
+ TSK_DECLARE_OBJECT;
- uint64_t compartmentId;
- tcomp_state_t* statesToCreate[MAX_TEMP_SATES];
- uint8_t statesToCreateIndex;
+ uint64_t compartmentId;
+ tcomp_state_t* statesToCreate[MAX_TEMP_SATES];
+ uint8_t statesToCreateIndex;
- tcomp_tempstate_to_free_t* statesToFree[MAX_TEMP_SATES];
- uint8_t statesToFreeIndex;
+ tcomp_tempstate_to_free_t* statesToFree[MAX_TEMP_SATES];
+ uint8_t statesToFreeIndex;
- uint64_t streamId;
- unsigned isStreamBased:1;
- tcomp_buffer_handle_t *output_buffer;
+ uint64_t streamId;
+ unsigned isStreamBased:1;
+ tcomp_buffer_handle_t *output_buffer;
- tcomp_reqfeed_t *req_feedback;
- tcomp_params_t *remote_parameters;
- tcomp_buffer_handle_t *ret_feedback;
+ tcomp_reqfeed_t *req_feedback;
+ tcomp_params_t *remote_parameters;
+ tcomp_buffer_handle_t *ret_feedback;
- unsigned isNack:1;
- tcomp_buffer_handle_t *nack_info;
+ unsigned isNack:1;
+ tcomp_buffer_handle_t *nack_info;
- uint64_t consumed_cycles;
+ uint64_t consumed_cycles;
}
tcomp_result_t;
diff --git a/tinySIGCOMP/src/tcomp_rfc3485_dictionary_sip.h b/tinySIGCOMP/src/tcomp_rfc3485_dictionary_sip.h
index e1fdbc1..427e2c3 100755
--- a/tinySIGCOMP/src/tcomp_rfc3485_dictionary_sip.h
+++ b/tinySIGCOMP/src/tcomp_rfc3485_dictionary_sip.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_rfc5049_sip.h b/tinySIGCOMP/src/tcomp_rfc5049_sip.h
index 581e837..8c930e4 100755
--- a/tinySIGCOMP/src/tcomp_rfc5049_sip.h
+++ b/tinySIGCOMP/src/tcomp_rfc5049_sip.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,6 +49,6 @@ Applying Signaling Compression (SigComp)
// 4.5. locally available state (LAS) for SIP/SigComp
// Minimum LAS for SIP/SigComp: the SIP/SDP static dictionary as defined
- //in [RFC3485].
+//in [RFC3485].
#endif /* _TINYSIGCOMPP_RFC5049_H_ */
diff --git a/tinySIGCOMP/src/tcomp_rfc5112_dictionary_presence.h b/tinySIGCOMP/src/tcomp_rfc5112_dictionary_presence.h
index b4ee068..71328c0 100755
--- a/tinySIGCOMP/src/tcomp_rfc5112_dictionary_presence.h
+++ b/tinySIGCOMP/src/tcomp_rfc5112_dictionary_presence.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_state.c b/tinySIGCOMP/src/tcomp_state.c
index af9be22..0ec49ce 100755
--- a/tinySIGCOMP/src/tcomp_state.c
+++ b/tinySIGCOMP/src/tcomp_state.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,21 +36,21 @@
*/
tcomp_state_t* tcomp_state_create(uint32_t length, uint32_t address, uint32_t instruction, uint32_t minimum_access_length, uint32_t retention_priority)
{
- tcomp_state_t *state;
- if((state = tsk_object_new(tcomp_state_def_t))){
- state->length = length;
- state->address = address;
- state->instruction = instruction;
- state->minimum_access_length = minimum_access_length;
- state->retention_priority = retention_priority;
-
- state->value = tcomp_buffer_create_null();
- state->identifier = tcomp_buffer_create_null();
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new state.");
- }
- return state;
+ tcomp_state_t *state;
+ if((state = tsk_object_new(tcomp_state_def_t))) {
+ state->length = length;
+ state->address = address;
+ state->instruction = instruction;
+ state->minimum_access_length = minimum_access_length;
+ state->retention_priority = retention_priority;
+
+ state->value = tcomp_buffer_create_null();
+ state->identifier = tcomp_buffer_create_null();
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new state.");
+ }
+ return state;
}
/** Compares two sigomp states.
@@ -60,12 +60,15 @@ tcomp_state_t* tcomp_state_create(uint32_t length, uint32_t address, uint32_t in
*/
int tcomp_state_equals(const tcomp_state_t *state1, const tcomp_state_t *state2)
{
- if(state1 && state2)
- {
- return tcomp_buffer_equals(state1->identifier, state2->identifier);
- }
- else if(!state1 && !state2) return 1;
- else return 0;
+ if(state1 && state2) {
+ return tcomp_buffer_equals(state1->identifier, state2->identifier);
+ }
+ else if(!state1 && !state2) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
/**Computes the state identifier by calculating a 20-byte SHA-1 hash [RFC-3174] over the
@@ -75,74 +78,73 @@ int tcomp_state_equals(const tcomp_state_t *state1, const tcomp_state_t *state2)
*/
void tcomp_state_makeValid(tcomp_state_t* state)
{
- tsk_sha1context_t sha;
-
- if(!state){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
-
- /* Lock */
- tsk_safeobj_lock(state);
-
- tcomp_buffer_allocBuff(state->identifier, TSK_SHA1_DIGEST_SIZE);
-
- /*=============
- * Calculates a 20-byte SHA-1 hash [RFC-3174] over the byte string formed by concatenating the state_length, state_address,
- * state_instruction, minimum_access_length and state_value (in the order given). This is the state_identifier.
- */
- {
- uint8_t i;
- int32_t err = tsk_sha1reset(&sha);
- uint8_t firstPart[8];
-
+ tsk_sha1context_t sha;
+
+ if(!state) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+
+ /* Lock */
+ tsk_safeobj_lock(state);
+
+ tcomp_buffer_allocBuff(state->identifier, TSK_SHA1_DIGEST_SIZE);
+
+ /*=============
+ * Calculates a 20-byte SHA-1 hash [RFC-3174] over the byte string formed by concatenating the state_length, state_address,
+ * state_instruction, minimum_access_length and state_value (in the order given). This is the state_identifier.
+ */
+ {
+ uint8_t i;
+ int32_t err = tsk_sha1reset(&sha);
+ uint8_t firstPart[8];
+
#ifdef __SYMBIAN32__
- uint32_t values[4];
- values[0] = state->length,
- values[1] = state->address,
- values[2] = state->instruction,
- values[3] = state->minimum_access_length;
-
+ uint32_t values[4];
+ values[0] = state->length,
+ values[1] = state->address,
+ values[2] = state->instruction,
+ values[3] = state->minimum_access_length;
+
+#else
+ uint32_t values[4] = { state->length, state->address, state->instruction, state->minimum_access_length };
+#endif
+
+ for(i=0; i<4; i++) {
+#if 0 /*BIG_ENDIAN*/// Do not change this (it's for my own tests)
+ firstPart[i] = (values[i] & 0xff);
+ firstPart[i+1] = (values[i] >> 8);
#else
- uint32_t values[4] = { state->length, state->address, state->instruction, state->minimum_access_length };
+ firstPart[2*i] = (values[i] >> 8);
+ firstPart[2*i+1] = (values[i]& 0xff);
#endif
-
- for(i=0; i<4; i++)
- {
- #if 0 /*BIG_ENDIAN*/// Do not change this (it's for my own tests)
- firstPart[i] = (values[i] & 0xff);
- firstPart[i+1] = (values[i] >> 8);
- #else
- firstPart[2*i] = (values[i] >> 8);
- firstPart[2*i+1] = (values[i]& 0xff);
- #endif
- }
-
- tsk_sha1input(&sha, firstPart, 8);
- tsk_sha1input(&sha, tcomp_buffer_getBuffer(state->value), tcomp_buffer_getSize(state->value));
- err = tsk_sha1result(&sha, (uint8_t*)tcomp_buffer_getBuffer(state->identifier));
- }
-
- /* unlock */
- tsk_safeobj_unlock(state);
+ }
+
+ tsk_sha1input(&sha, firstPart, 8);
+ tsk_sha1input(&sha, tcomp_buffer_getBuffer(state->value), tcomp_buffer_getSize(state->value));
+ err = tsk_sha1result(&sha, (uint8_t*)tcomp_buffer_getBuffer(state->identifier));
+ }
+
+ /* unlock */
+ tsk_safeobj_unlock(state);
}
int32_t tcomp_state_inc_usage_count(tcomp_state_t* self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return ++self->usage_count;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return ++self->usage_count;
}
int32_t tcomp_state_dec_usage_count(tcomp_state_t* self)
{
- if(!self || self->usage_count <= 0){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
- return --self->usage_count;
+ if(!self || self->usage_count <= 0) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+ return --self->usage_count;
}
@@ -152,56 +154,59 @@ int32_t tcomp_state_dec_usage_count(tcomp_state_t* self)
//
static tsk_object_t* tcomp_state_ctor(tsk_object_t * self, va_list * app)
{
- tcomp_state_t *state = self;
- if(state){
- /* Initialize safeobject */
- tsk_safeobj_init(state);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new state.");
- }
- return state;
+ tcomp_state_t *state = self;
+ if(state) {
+ /* Initialize safeobject */
+ tsk_safeobj_init(state);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new state.");
+ }
+ return state;
}
static tsk_object_t* tcomp_state_dtor(tsk_object_t *self)
{
- tcomp_state_t *state = self;
- if(state){
- TSK_DEBUG_INFO("==SigComp - Free state with id=");
- tcomp_buffer_print(state->identifier);
-
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(state);
-
- TSK_OBJECT_SAFE_FREE(state->identifier);
- TSK_OBJECT_SAFE_FREE(state->value);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp state.");
- }
-
- return self;
+ tcomp_state_t *state = self;
+ if(state) {
+ TSK_DEBUG_INFO("==SigComp - Free state with id=");
+ tcomp_buffer_print(state->identifier);
+
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(state);
+
+ TSK_OBJECT_SAFE_FREE(state->identifier);
+ TSK_OBJECT_SAFE_FREE(state->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp state.");
+ }
+
+ return self;
}
static int tcomp_state_cmp(const void *obj1, const void *obj2)
{
- const tcomp_state_t *state1 = obj1;
- const tcomp_state_t *state2 = obj2;
-
- if(state1 && state2){
- return tcomp_buffer_equals(state1->identifier, state2->identifier) ? 0 : -1;
- }
- else if(!state1 && !state2) return 0;
- else return -1;
+ const tcomp_state_t *state1 = obj1;
+ const tcomp_state_t *state2 = obj2;
+
+ if(state1 && state2) {
+ return tcomp_buffer_equals(state1->identifier, state2->identifier) ? 0 : -1;
+ }
+ else if(!state1 && !state2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t tcomp_state_def_s =
-{
- sizeof(tcomp_state_t),
- tcomp_state_ctor,
- tcomp_state_dtor,
- tcomp_state_cmp
+static const tsk_object_def_t tcomp_state_def_s = {
+ sizeof(tcomp_state_t),
+ tcomp_state_ctor,
+ tcomp_state_dtor,
+ tcomp_state_cmp
};
const tsk_object_def_t *tcomp_state_def_t = &tcomp_state_def_s;
diff --git a/tinySIGCOMP/src/tcomp_state.h b/tinySIGCOMP/src/tcomp_state.h
index 1e7ef70..342e38b 100755
--- a/tinySIGCOMP/src/tcomp_state.h
+++ b/tinySIGCOMP/src/tcomp_state.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,22 +47,21 @@ TCOMP_BEGIN_DECLS
/**SigComp state.
*/
-typedef struct tcomp_state_s
-{
- TSK_DECLARE_OBJECT;
-
- tcomp_buffer_handle_t *value; /**< State's value. */
- tcomp_buffer_handle_t *identifier; /**< State's identifier. */
-
- uint32_t length; /**< State's length. */
- uint32_t address; /**< State's address. */
- uint32_t instruction; /**< State's instruction. */
- uint32_t minimum_access_length; /**< State's minimum access length. */
- uint32_t retention_priority; /**< State's retention priority. */
-
- int32_t usage_count; /**< State's usage count (to avoid duplication). */
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tcomp_state_s {
+ TSK_DECLARE_OBJECT;
+
+ tcomp_buffer_handle_t *value; /**< State's value. */
+ tcomp_buffer_handle_t *identifier; /**< State's identifier. */
+
+ uint32_t length; /**< State's length. */
+ uint32_t address; /**< State's address. */
+ uint32_t instruction; /**< State's instruction. */
+ uint32_t minimum_access_length; /**< State's minimum access length. */
+ uint32_t retention_priority; /**< State's retention priority. */
+
+ int32_t usage_count; /**< State's usage count (to avoid duplication). */
+
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_state_t;
diff --git a/tinySIGCOMP/src/tcomp_statehandler.c b/tinySIGCOMP/src/tcomp_statehandler.c
index 596fdf9..51dbd9a 100755
--- a/tinySIGCOMP/src/tcomp_statehandler.c
+++ b/tinySIGCOMP/src/tcomp_statehandler.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,7 +23,7 @@
/**@file tcomp_statehandler.c
* @brief SigComp state handler.
* Entity responsible for accessing and storing state information once permission is granted by the application.
- *
+ *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
*
@@ -38,381 +38,375 @@
static int pred_find_compartment_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data){
- tcomp_compartment_t *compartment = item->data;
- int64_t res = (compartment->identifier - *((int64_t*)id));
- return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
- }
- return -1;
+ if(item && item->data) {
+ tcomp_compartment_t *compartment = item->data;
+ int64_t res = (compartment->identifier - *((int64_t*)id));
+ return res > 0 ? (int)1 : (res < 0 ? (int)-1 : (int)0);
+ }
+ return -1;
}
/**Creates new SigComp state handler.
*/
tcomp_statehandler_t* tcomp_statehandler_create()
{
- tcomp_statehandler_t* statehandler;
- if((statehandler = tsk_object_new(tcomp_statehandler_def_t))){
- /* RFC 3320 - 3.3. SigComp Parameters */
- statehandler->sigcomp_parameters = tcomp_params_create();
- tcomp_params_setDmsValue(statehandler->sigcomp_parameters, SIP_RFC5049_DECOMPRESSION_MEMORY_SIZE);
- tcomp_params_setSmsValue(statehandler->sigcomp_parameters, SIP_RFC5049_STATE_MEMORY_SIZE);
- tcomp_params_setCpbValue(statehandler->sigcomp_parameters, SIP_RFC5049_CYCLES_PER_BIT);
-
- if(!(statehandler->dictionaries = tsk_list_create())){
- TSK_OBJECT_SAFE_FREE(statehandler);
- goto bail;
- }
- if(!(statehandler->compartments = tsk_list_create())){
- TSK_OBJECT_SAFE_FREE(statehandler);
- goto bail;
- }
- statehandler->sigcomp_parameters->SigComp_version = SIP_RFC5049_SIGCOMP_VERSION;
+ tcomp_statehandler_t* statehandler;
+ if((statehandler = tsk_object_new(tcomp_statehandler_def_t))) {
+ /* RFC 3320 - 3.3. SigComp Parameters */
+ statehandler->sigcomp_parameters = tcomp_params_create();
+ tcomp_params_setDmsValue(statehandler->sigcomp_parameters, SIP_RFC5049_DECOMPRESSION_MEMORY_SIZE);
+ tcomp_params_setSmsValue(statehandler->sigcomp_parameters, SIP_RFC5049_STATE_MEMORY_SIZE);
+ tcomp_params_setCpbValue(statehandler->sigcomp_parameters, SIP_RFC5049_CYCLES_PER_BIT);
+
+ if(!(statehandler->dictionaries = tsk_list_create())) {
+ TSK_OBJECT_SAFE_FREE(statehandler);
+ goto bail;
+ }
+ if(!(statehandler->compartments = tsk_list_create())) {
+ TSK_OBJECT_SAFE_FREE(statehandler);
+ goto bail;
+ }
+ statehandler->sigcomp_parameters->SigComp_version = SIP_RFC5049_SIGCOMP_VERSION;
#if TCOMP_USE_ONLY_ACKED_STATES
- statehandler->useOnlyACKedStates = tsk_true;
+ statehandler->useOnlyACKedStates = tsk_true;
#endif
- }
+ }
bail:
- return statehandler;
+ return statehandler;
}
int tcomp_statehandler_setUseOnlyACKedStates(tcomp_statehandler_t* self, tsk_bool_t useOnlyACKedStates)
{
- tsk_list_item_t* item;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->useOnlyACKedStates = useOnlyACKedStates;
-
- tsk_safeobj_lock(self);
- tsk_list_foreach(item, self->compartments){
- tcomp_compartment_setUseOnlyACKedStates((tcomp_compartment_t*)item->data, self->useOnlyACKedStates);
- }
- tsk_safeobj_unlock(self);
-
- return 0;
+ tsk_list_item_t* item;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->useOnlyACKedStates = useOnlyACKedStates;
+
+ tsk_safeobj_lock(self);
+ tsk_list_foreach(item, self->compartments) {
+ tcomp_compartment_setUseOnlyACKedStates((tcomp_compartment_t*)item->data, self->useOnlyACKedStates);
+ }
+ tsk_safeobj_unlock(self);
+
+ return 0;
}
tcomp_compartment_t *tcomp_statehandler_getCompartment(const tcomp_statehandler_t *statehandler, uint64_t id)
{
- tcomp_compartment_t *result = tsk_null;
- tcomp_compartment_t* newcomp = tsk_null;
- const tsk_list_item_t *item_const;
+ tcomp_compartment_t *result = tsk_null;
+ tcomp_compartment_t* newcomp = tsk_null;
+ const tsk_list_item_t *item_const;
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
- tsk_safeobj_lock(statehandler);
+ tsk_safeobj_lock(statehandler);
- item_const = tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id);
- if(!item_const || !(result = item_const->data)){
- newcomp = tcomp_compartment_create(id, tcomp_params_getParameters(statehandler->sigcomp_parameters), statehandler->useOnlyACKedStates);
- result = newcomp;
- tsk_list_push_back_data(statehandler->compartments, ((void**) &newcomp));
- }
+ item_const = tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id);
+ if(!item_const || !(result = item_const->data)) {
+ newcomp = tcomp_compartment_create(id, tcomp_params_getParameters(statehandler->sigcomp_parameters), statehandler->useOnlyACKedStates);
+ result = newcomp;
+ tsk_list_push_back_data(statehandler->compartments, ((void**) &newcomp));
+ }
- tsk_safeobj_unlock(statehandler);
+ tsk_safeobj_unlock(statehandler);
- return result;
+ return result;
}
void tcomp_statehandler_deleteCompartment(tcomp_statehandler_t *statehandler, uint64_t id)
{
- tcomp_compartment_t *compartment;
- const tsk_list_item_t *item_const;
+ tcomp_compartment_t *compartment;
+ const tsk_list_item_t *item_const;
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
- tsk_safeobj_lock(statehandler);
+ tsk_safeobj_lock(statehandler);
- item_const = tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id);
- if(item_const && (compartment = item_const->data)){
- TSK_DEBUG_INFO("SigComp - Delete compartment %lld", id);
- tsk_list_remove_item_by_data(statehandler->compartments, compartment);
- }
+ item_const = tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id);
+ if(item_const && (compartment = item_const->data)) {
+ TSK_DEBUG_INFO("SigComp - Delete compartment %lld", id);
+ tsk_list_remove_item_by_data(statehandler->compartments, compartment);
+ }
- tsk_safeobj_unlock(statehandler);
+ tsk_safeobj_unlock(statehandler);
}
tsk_bool_t tcomp_statehandler_compartmentExist(tcomp_statehandler_t *statehandler, uint64_t id)
{
- tsk_bool_t exist;
+ tsk_bool_t exist;
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
- tsk_safeobj_lock(statehandler);
- exist = (tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id) ? 1 : 0);
- tsk_safeobj_unlock(statehandler);
+ tsk_safeobj_lock(statehandler);
+ exist = (tsk_list_find_item_by_pred(statehandler->compartments, pred_find_compartment_by_id, &id) ? 1 : 0);
+ tsk_safeobj_unlock(statehandler);
- return exist;
+ return exist;
}
uint32_t tcomp_statehandler_findState(tcomp_statehandler_t *statehandler, const tcomp_buffer_handle_t *partial_identifier, tcomp_state_t** lpState)
{
- uint32_t count = 0;
- tsk_list_item_t *item;
-
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- tsk_safeobj_lock(statehandler);
-
- //
- // Compartments
- //
- tsk_list_foreach(item, statehandler->compartments){
- tcomp_compartment_t *compartment = item->data;
- count += tcomp_compartment_findState(compartment, partial_identifier, lpState);
- }
-
- if(count){
- goto bail;
- }
-
- //
- // Dictionaries
- //
- tsk_list_foreach(item, statehandler->dictionaries){
- tcomp_dictionary_t *dictionary = item->data;
- if(tcomp_buffer_startsWith(dictionary->identifier, partial_identifier)){
- *lpState = dictionary;
- count++;
- }
- }
+ uint32_t count = 0;
+ tsk_list_item_t *item;
+
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ tsk_safeobj_lock(statehandler);
+
+ //
+ // Compartments
+ //
+ tsk_list_foreach(item, statehandler->compartments) {
+ tcomp_compartment_t *compartment = item->data;
+ count += tcomp_compartment_findState(compartment, partial_identifier, lpState);
+ }
+
+ if(count) {
+ goto bail;
+ }
+
+ //
+ // Dictionaries
+ //
+ tsk_list_foreach(item, statehandler->dictionaries) {
+ tcomp_dictionary_t *dictionary = item->data;
+ if(tcomp_buffer_startsWith(dictionary->identifier, partial_identifier)) {
+ *lpState = dictionary;
+ count++;
+ }
+ }
bail:
- tsk_safeobj_unlock(statehandler);
+ tsk_safeobj_unlock(statehandler);
- return count;
+ return count;
}
void tcomp_statehandler_handleResult(tcomp_statehandler_t *statehandler, tcomp_result_t **lpResult)
{
- tcomp_compartment_t *lpCompartment;
- uint32_t compartment_total_size;
- uint8_t i;
-
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return;
- }
-
- /*== Do not lock --> all functions are thread-safe. */
- //tsk_safeobj_lock(statehandler);
-
- /*
- * The compressor does not wish (or no longer wishes) to save state information?
- */
- if((*lpResult)->ret_feedback && (*lpResult)->req_feedback->S){
- if(tcomp_statehandler_compartmentExist(statehandler, (*lpResult)->compartmentId)){
- tcomp_statehandler_deleteCompartment(statehandler, (*lpResult)->compartmentId);
- }
- return;
- }
-
- /*
- * Find corresponding compartment (only if !S)
- */
- if((lpCompartment = tcomp_statehandler_getCompartment(statehandler, (*lpResult)->compartmentId))){
- compartment_total_size = lpCompartment->total_memory_size;
- }
- else{
- goto bail;
- }
+ tcomp_compartment_t *lpCompartment;
+ uint32_t compartment_total_size;
+ uint8_t i;
+
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return;
+ }
+
+ /*== Do not lock --> all functions are thread-safe. */
+ //tsk_safeobj_lock(statehandler);
+
+ /*
+ * The compressor does not wish (or no longer wishes) to save state information?
+ */
+ if((*lpResult)->ret_feedback && (*lpResult)->req_feedback->S) {
+ if(tcomp_statehandler_compartmentExist(statehandler, (*lpResult)->compartmentId)) {
+ tcomp_statehandler_deleteCompartment(statehandler, (*lpResult)->compartmentId);
+ }
+ return;
+ }
+
+ /*
+ * Find corresponding compartment (only if !S)
+ */
+ if((lpCompartment = tcomp_statehandler_getCompartment(statehandler, (*lpResult)->compartmentId))) {
+ compartment_total_size = lpCompartment->total_memory_size;
+ }
+ else {
+ goto bail;
+ }
//compartment_create_states:
- /*
- * Request state creation now we have the corresponding compartement.
- */
- if(tcomp_result_getTempStatesToCreateSize(*lpResult)){
- uint8_t count;
- /* Check compartment allocated size*/
- if(!compartment_total_size){
- goto compartment_free_states;
- }
-
- count = tcomp_result_getTempStatesToCreateSize(*lpResult);
-
- // FIXME: lock
- for (i = 0; i < count; i++)
- {
- tcomp_state_t **lpState = &((*lpResult)->statesToCreate[i]);
- if(!lpState || !*lpState){
- continue;
- }
-
- /*
- * If the state creation request needs more state memory than the
- * total state_memory_size for the compartment, the state handler
- * deletes all but the first (state_memory_size - 64) bytes from the state_value.
- */
- if(TCOMP_GET_STATE_SIZE(*lpState) > compartment_total_size){
- tsk_size_t oldSize, newSize;
- tcomp_compartment_clearStates(lpCompartment);
- oldSize = tcomp_buffer_getSize((*lpState)->value);
- newSize = (compartment_total_size - 64);
- tcomp_buffer_removeBuff((*lpState)->value, newSize, (oldSize-newSize));
- (*lpState)->length = newSize;
-
- tcomp_compartment_addState(lpCompartment, lpState);
- }
-
- /*
- * If the state creation request exceeds the state memory allocated
- * to the compartment, sufficient items of state created by the same
- * compartment are freed until enough memory is available to
- * accommodate the new state.
- */
- else{
- while(lpCompartment->total_memory_left < TCOMP_GET_STATE_SIZE(*lpState)){
- tcomp_compartment_freeStateByPriority(lpCompartment);
- }
- tcomp_compartment_addState(lpCompartment, lpState);
- }
- }
- }
+ /*
+ * Request state creation now we have the corresponding compartement.
+ */
+ if(tcomp_result_getTempStatesToCreateSize(*lpResult)) {
+ uint8_t count;
+ /* Check compartment allocated size*/
+ if(!compartment_total_size) {
+ goto compartment_free_states;
+ }
+
+ count = tcomp_result_getTempStatesToCreateSize(*lpResult);
+
+ // FIXME: lock
+ for (i = 0; i < count; i++) {
+ tcomp_state_t **lpState = &((*lpResult)->statesToCreate[i]);
+ if(!lpState || !*lpState) {
+ continue;
+ }
+
+ /*
+ * If the state creation request needs more state memory than the
+ * total state_memory_size for the compartment, the state handler
+ * deletes all but the first (state_memory_size - 64) bytes from the state_value.
+ */
+ if(TCOMP_GET_STATE_SIZE(*lpState) > compartment_total_size) {
+ tsk_size_t oldSize, newSize;
+ tcomp_compartment_clearStates(lpCompartment);
+ oldSize = tcomp_buffer_getSize((*lpState)->value);
+ newSize = (compartment_total_size - 64);
+ tcomp_buffer_removeBuff((*lpState)->value, newSize, (oldSize-newSize));
+ (*lpState)->length = newSize;
+
+ tcomp_compartment_addState(lpCompartment, lpState);
+ }
+
+ /*
+ * If the state creation request exceeds the state memory allocated
+ * to the compartment, sufficient items of state created by the same
+ * compartment are freed until enough memory is available to
+ * accommodate the new state.
+ */
+ else {
+ while(lpCompartment->total_memory_left < TCOMP_GET_STATE_SIZE(*lpState)) {
+ tcomp_compartment_freeStateByPriority(lpCompartment);
+ }
+ tcomp_compartment_addState(lpCompartment, lpState);
+ }
+ }
+ }
compartment_free_states:
- /*
- * Request state free now we have the correponding comprtement
- */
- if(tcomp_result_getTempStatesToFreeSize((const tcomp_result_t*)*lpResult)){
- tcomp_compartment_freeStates(lpCompartment, (*lpResult)->statesToFree, tcomp_result_getTempStatesToFreeSize((const tcomp_result_t*)*lpResult));
- }
+ /*
+ * Request state free now we have the correponding comprtement
+ */
+ if(tcomp_result_getTempStatesToFreeSize((const tcomp_result_t*)*lpResult)) {
+ tcomp_compartment_freeStates(lpCompartment, (*lpResult)->statesToFree, tcomp_result_getTempStatesToFreeSize((const tcomp_result_t*)*lpResult));
+ }
//compartment_remote_params:
- /*
- * Set remote -compressor- parameters.
- */
- tcomp_compartment_setRemoteParams(lpCompartment, (*lpResult)->remote_parameters);
+ /*
+ * Set remote -compressor- parameters.
+ */
+ tcomp_compartment_setRemoteParams(lpCompartment, (*lpResult)->remote_parameters);
//feedbacks:
- /*
- * Set both Returned and Requested feedbacks.
- */
-
- if(tcomp_buffer_getSize((*lpResult)->req_feedback->item)){
- tcomp_compartment_setReqFeedback(lpCompartment, (*lpResult)->req_feedback->item);
- }
- if(tcomp_buffer_getSize((*lpResult)->ret_feedback)){
- tcomp_compartment_setRetFeedback(lpCompartment, (*lpResult)->ret_feedback);
- }
-
-bail: ;
- //--tsk_safeobj_unlock(lpCompartment);
- //--tsk_safeobj_unlock(statehandler);
+ /*
+ * Set both Returned and Requested feedbacks.
+ */
+
+ if(tcomp_buffer_getSize((*lpResult)->req_feedback->item)) {
+ tcomp_compartment_setReqFeedback(lpCompartment, (*lpResult)->req_feedback->item);
+ }
+ if(tcomp_buffer_getSize((*lpResult)->ret_feedback)) {
+ tcomp_compartment_setRetFeedback(lpCompartment, (*lpResult)->ret_feedback);
+ }
+
+bail:
+ ;
+ //--tsk_safeobj_unlock(lpCompartment);
+ //--tsk_safeobj_unlock(statehandler);
}
tsk_bool_t tcomp_statehandler_handleNack(tcomp_statehandler_t *statehandler, const tcomp_nackinfo_t * nackinfo)
{
- tcomp_buffer_handle_t* sha_id;
- tsk_list_item_t *item;
- tsk_bool_t found = tsk_false;
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- if(!(sha_id = tcomp_buffer_create_null())){
- TSK_DEBUG_ERROR("Failed to create buffer handle");
- return tsk_false;
- }
-
- tcomp_buffer_referenceBuff(sha_id, ((tcomp_nackinfo_t*)nackinfo)->sha1, TSK_SHA1_DIGEST_SIZE);
-
- tsk_list_foreach(item, statehandler->compartments)
- {
- tcomp_compartment_t* lpCompartement = item->data;
- if(tcomp_compartment_hasNack(lpCompartement, sha_id))
- {
- // this compartment is responsible for this nack
- switch(nackinfo->reasonCode)
- {
- case NACK_STATE_NOT_FOUND:
- {
- // Next commented because in this version remote state ids are never saved.
- // Only the ghost has information on last partial state id to use --> reset the ghost
- //SigCompState* lpState = NULL;
- //lpCompartement->findState(&nack_info->details, &lpState);
- //if(lpState)
- //{
- // lpCompartement->freeState(lpState);
- //}
- tcomp_compartment_freeGhostState(lpCompartement);
- }
- break;
-
- default:
- {
- tcomp_compartment_freeGhostState(lpCompartement);
- tcomp_compartment_clearStates(lpCompartement);
- }
- break;
- }
- TSK_DEBUG_INFO("Compartment has NACK :)");
- tcomp_buffer_print(sha_id);
- found = tsk_true;
- }
- }
-
- if(!found)
- {
- TSK_DEBUG_ERROR("Compartments do not have NACK with id=");
- tcomp_buffer_print(sha_id);
- }
-
- TSK_OBJECT_SAFE_FREE(sha_id);
-
- return found;
+ tcomp_buffer_handle_t* sha_id;
+ tsk_list_item_t *item;
+ tsk_bool_t found = tsk_false;
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ if(!(sha_id = tcomp_buffer_create_null())) {
+ TSK_DEBUG_ERROR("Failed to create buffer handle");
+ return tsk_false;
+ }
+
+ tcomp_buffer_referenceBuff(sha_id, ((tcomp_nackinfo_t*)nackinfo)->sha1, TSK_SHA1_DIGEST_SIZE);
+
+ tsk_list_foreach(item, statehandler->compartments) {
+ tcomp_compartment_t* lpCompartement = item->data;
+ if(tcomp_compartment_hasNack(lpCompartement, sha_id)) {
+ // this compartment is responsible for this nack
+ switch(nackinfo->reasonCode) {
+ case NACK_STATE_NOT_FOUND: {
+ // Next commented because in this version remote state ids are never saved.
+ // Only the ghost has information on last partial state id to use --> reset the ghost
+ //SigCompState* lpState = NULL;
+ //lpCompartement->findState(&nack_info->details, &lpState);
+ //if(lpState)
+ //{
+ // lpCompartement->freeState(lpState);
+ //}
+ tcomp_compartment_freeGhostState(lpCompartement);
+ }
+ break;
+
+ default: {
+ tcomp_compartment_freeGhostState(lpCompartement);
+ tcomp_compartment_clearStates(lpCompartement);
+ }
+ break;
+ }
+ TSK_DEBUG_INFO("Compartment has NACK :)");
+ tcomp_buffer_print(sha_id);
+ found = tsk_true;
+ }
+ }
+
+ if(!found) {
+ TSK_DEBUG_ERROR("Compartments do not have NACK with id=");
+ tcomp_buffer_print(sha_id);
+ }
+
+ TSK_OBJECT_SAFE_FREE(sha_id);
+
+ return found;
}
int tcomp_statehandler_addSipSdpDictionary(tcomp_statehandler_t *statehandler)
{
- if(!statehandler){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(statehandler);
-
- if(!statehandler->hasSipSdpDictionary){
- tcomp_dictionary_t* sip_dict = tcomp_dicts_create_sip_dict();
- tsk_list_push_back_data(statehandler->dictionaries, ((void**) &sip_dict));
- statehandler->hasSipSdpDictionary = 1;
- }
-
- tsk_safeobj_unlock(statehandler);
- return 0;
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(statehandler);
+
+ if(!statehandler->hasSipSdpDictionary) {
+ tcomp_dictionary_t* sip_dict = tcomp_dicts_create_sip_dict();
+ tsk_list_push_back_data(statehandler->dictionaries, ((void**) &sip_dict));
+ statehandler->hasSipSdpDictionary = 1;
+ }
+
+ tsk_safeobj_unlock(statehandler);
+ return 0;
}
int tcomp_statehandler_addPresenceDictionary(tcomp_statehandler_t *statehandler)
{
- if(!statehandler){
- TSK_DEBUG_ERROR("NULL SigComp state handler.");
- return -1;
- }
+ if(!statehandler) {
+ TSK_DEBUG_ERROR("NULL SigComp state handler.");
+ return -1;
+ }
- tsk_safeobj_lock(statehandler);
+ tsk_safeobj_lock(statehandler);
- if(!statehandler->hasPresenceDictionary){
- tcomp_dictionary_t* pres_dict = tcomp_dicts_create_presence_dict();
- tsk_list_push_back_data(statehandler->dictionaries, ((void**) &pres_dict));
- statehandler->hasPresenceDictionary = 1;
- }
+ if(!statehandler->hasPresenceDictionary) {
+ tcomp_dictionary_t* pres_dict = tcomp_dicts_create_presence_dict();
+ tsk_list_push_back_data(statehandler->dictionaries, ((void**) &pres_dict));
+ statehandler->hasPresenceDictionary = 1;
+ }
- tsk_safeobj_unlock(statehandler);
- return 0;
+ tsk_safeobj_unlock(statehandler);
+ return 0;
}
@@ -427,42 +421,41 @@ int tcomp_statehandler_addPresenceDictionary(tcomp_statehandler_t *statehandler)
static tsk_object_t* tcomp_statehandler_ctor(tsk_object_t * self, va_list * app)
{
- tcomp_statehandler_t *statehandler = self;
- if(statehandler){
- /* Initialize safeobject */
- tsk_safeobj_init(statehandler);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp state handler.");
- }
-
- return self;
+ tcomp_statehandler_t *statehandler = self;
+ if(statehandler) {
+ /* Initialize safeobject */
+ tsk_safeobj_init(statehandler);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp state handler.");
+ }
+
+ return self;
}
static void* tcomp_statehandler_dtor(tsk_object_t *self)
{
- tcomp_statehandler_t *statehandler = self;
- if(statehandler){
- /* Deinitialize safeobject */
- tsk_safeobj_deinit(statehandler);
+ tcomp_statehandler_t *statehandler = self;
+ if(statehandler) {
+ /* Deinitialize safeobject */
+ tsk_safeobj_deinit(statehandler);
- TSK_OBJECT_SAFE_FREE(statehandler->sigcomp_parameters);
+ TSK_OBJECT_SAFE_FREE(statehandler->sigcomp_parameters);
- TSK_OBJECT_SAFE_FREE(statehandler->dictionaries);
- TSK_OBJECT_SAFE_FREE(statehandler->compartments);
- }
- else{
- TSK_DEBUG_ERROR("Null SigComp state handler.");
- }
+ TSK_OBJECT_SAFE_FREE(statehandler->dictionaries);
+ TSK_OBJECT_SAFE_FREE(statehandler->compartments);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SigComp state handler.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsk_statehandler_def_s =
-{
- sizeof(tcomp_statehandler_t),
- tcomp_statehandler_ctor,
- tcomp_statehandler_dtor,
- tsk_null
+static const tsk_object_def_t tsk_statehandler_def_s = {
+ sizeof(tcomp_statehandler_t),
+ tcomp_statehandler_ctor,
+ tcomp_statehandler_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_statehandler_def_t = &tsk_statehandler_def_s;
diff --git a/tinySIGCOMP/src/tcomp_statehandler.h b/tinySIGCOMP/src/tcomp_statehandler.h
index 23dd494..f5427b4 100755
--- a/tinySIGCOMP/src/tcomp_statehandler.h
+++ b/tinySIGCOMP/src/tcomp_statehandler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,19 +47,18 @@ TCOMP_BEGIN_DECLS
/**State handler.
*/
-typedef struct tcomp_statehandler_s
-{
- TSK_DECLARE_OBJECT;
-
- tcomp_compartments_L_t *compartments;
- tcomp_params_t *sigcomp_parameters;
-
- tcomp_dictionaries_L_t *dictionaries;
- tsk_bool_t hasSipSdpDictionary;
- tsk_bool_t hasPresenceDictionary;
- tsk_bool_t useOnlyACKedStates;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tcomp_statehandler_s {
+ TSK_DECLARE_OBJECT;
+
+ tcomp_compartments_L_t *compartments;
+ tcomp_params_t *sigcomp_parameters;
+
+ tcomp_dictionaries_L_t *dictionaries;
+ tsk_bool_t hasSipSdpDictionary;
+ tsk_bool_t hasPresenceDictionary;
+ tsk_bool_t useOnlyACKedStates;
+
+ TSK_DECLARE_SAFEOBJ;
}
tcomp_statehandler_t;
diff --git a/tinySIGCOMP/src/tcomp_types.h b/tinySIGCOMP/src/tcomp_types.h
index 0cb48c9..dcc50c9 100755
--- a/tinySIGCOMP/src/tcomp_types.h
+++ b/tinySIGCOMP/src/tcomp_types.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/src/tcomp_udvm.bytecopy.c b/tinySIGCOMP/src/tcomp_udvm.bytecopy.c
index 246b25c..edc1c56 100755
--- a/tinySIGCOMP/src/tcomp_udvm.bytecopy.c
+++ b/tinySIGCOMP/src/tcomp_udvm.bytecopy.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,37 +40,35 @@ From UDVM to UDVM
*/
tsk_bool_t tcomp_udvm_bytecopy_self(tcomp_udvm_t *udvm, uint32_t *destination, uint32_t source, uint32_t tsk_size_tocopy)
{
- uint32_t byte_copy_left, byte_copy_right;
- uint8_t* destination_ptr;
-
- //if (*destination == TCOMP_UDVM_GET_SIZE() || source == TCOMP_UDVM_GET_SIZE())
- if (*destination >= TCOMP_UDVM_GET_SIZE() || source >= TCOMP_UDVM_GET_SIZE())
- {
- /* SEGFAULT */
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
-
- /*
- * The string of bytes is copied in ascending order of memory address,
- * respecting the bounds set by byte_copy_left and byte_copy_right.
- */
- byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
- byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
-
- // string of bytes is copied one byte at a time
- while((tsk_size_tocopy--))
- {
- if(!(destination_ptr = TCOMP_UDVM_GET_BUFFER_AT((*destination)++))){
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- *destination_ptr = *TCOMP_UDVM_GET_BUFFER_AT(source++);
- *destination = (*destination == byte_copy_right)? byte_copy_left : *destination;
- source = (source == byte_copy_right)? byte_copy_left : source;
- }
-
- return tsk_true;
+ uint32_t byte_copy_left, byte_copy_right;
+ uint8_t* destination_ptr;
+
+ //if (*destination == TCOMP_UDVM_GET_SIZE() || source == TCOMP_UDVM_GET_SIZE())
+ if (*destination >= TCOMP_UDVM_GET_SIZE() || source >= TCOMP_UDVM_GET_SIZE()) {
+ /* SEGFAULT */
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+
+ /*
+ * The string of bytes is copied in ascending order of memory address,
+ * respecting the bounds set by byte_copy_left and byte_copy_right.
+ */
+ byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
+ byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
+
+ // string of bytes is copied one byte at a time
+ while((tsk_size_tocopy--)) {
+ if(!(destination_ptr = TCOMP_UDVM_GET_BUFFER_AT((*destination)++))) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ *destination_ptr = *TCOMP_UDVM_GET_BUFFER_AT(source++);
+ *destination = (*destination == byte_copy_right)? byte_copy_left : *destination;
+ source = (source == byte_copy_right)? byte_copy_left : source;
+ }
+
+ return tsk_true;
}
/**RFC3320-Setction_8.4. Byte copying
@@ -78,35 +76,33 @@ From EXTERNAL to UDVM
*/
tsk_bool_t tcomp_udvm_bytecopy_to(tcomp_udvm_t *udvm, uint32_t destination, const uint8_t* source, uint32_t tsk_size_tocopy)
{
- uint32_t byte_copy_left, byte_copy_right;
- uint8_t* destination_ptr;
-
- if(destination == TCOMP_UDVM_GET_SIZE())
- {
- /* SEGFAULT */
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
-
- /*
- * The string of bytes is copied in ascending order of memory address,
- * respecting the bounds set by byte_copy_left and byte_copy_right.
- */
- byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
- byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
-
- // string of bytes is copied one byte at a time
- while((tsk_size_tocopy--))
- {
- if(!(destination_ptr = TCOMP_UDVM_GET_BUFFER_AT(destination++))){
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- *destination_ptr = *(source++);
- destination = (destination == byte_copy_right)? byte_copy_left : destination;
- }
-
- return tsk_true;
+ uint32_t byte_copy_left, byte_copy_right;
+ uint8_t* destination_ptr;
+
+ if(destination == TCOMP_UDVM_GET_SIZE()) {
+ /* SEGFAULT */
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+
+ /*
+ * The string of bytes is copied in ascending order of memory address,
+ * respecting the bounds set by byte_copy_left and byte_copy_right.
+ */
+ byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
+ byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
+
+ // string of bytes is copied one byte at a time
+ while((tsk_size_tocopy--)) {
+ if(!(destination_ptr = TCOMP_UDVM_GET_BUFFER_AT(destination++))) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ *destination_ptr = *(source++);
+ destination = (destination == byte_copy_right)? byte_copy_left : destination;
+ }
+
+ return tsk_true;
}
/**RFC3320-Setction_8.4. Byte copying
@@ -114,32 +110,32 @@ From UDVM to EXTERNAL
*/
tsk_bool_t tcomp_udvm_bytecopy_from(tcomp_udvm_t *udvm, uint8_t* destination, uint32_t source, uint32_t tsk_size_tocopy)
{
- uint32_t byte_copy_left, byte_copy_right;
- uint8_t* source_ptr;
-
- if(source >= TCOMP_UDVM_GET_SIZE()){
- TSK_DEBUG_ERROR("SEGFAULT");
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
-
- /*
- * The string of bytes is copied in ascending order of memory address,
- * respecting the bounds set by byte_copy_left and byte_copy_right.
- */
- byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
- byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
-
-
- // string of bytes is copied one byte at a time
- while((tsk_size_tocopy--)){
- if(!(source_ptr = TCOMP_UDVM_GET_BUFFER_AT(source++))){
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- *(destination++) = *source_ptr;
- source = (source == byte_copy_right)? byte_copy_left : source;
- }
-
- return tsk_true;
+ uint32_t byte_copy_left, byte_copy_right;
+ uint8_t* source_ptr;
+
+ if(source >= TCOMP_UDVM_GET_SIZE()) {
+ TSK_DEBUG_ERROR("SEGFAULT");
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+
+ /*
+ * The string of bytes is copied in ascending order of memory address,
+ * respecting the bounds set by byte_copy_left and byte_copy_right.
+ */
+ byte_copy_left = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX);
+ byte_copy_right = TCOMP_UDVM_GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX);
+
+
+ // string of bytes is copied one byte at a time
+ while((tsk_size_tocopy--)) {
+ if(!(source_ptr = TCOMP_UDVM_GET_BUFFER_AT(source++))) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ *(destination++) = *source_ptr;
+ source = (source == byte_copy_right)? byte_copy_left : source;
+ }
+
+ return tsk_true;
}
diff --git a/tinySIGCOMP/src/tcomp_udvm.c b/tinySIGCOMP/src/tcomp_udvm.c
index 6a7607f..728d974 100755
--- a/tinySIGCOMP/src/tcomp_udvm.c
+++ b/tinySIGCOMP/src/tcomp_udvm.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop
* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,469 +33,429 @@
tcomp_udvm_t* tcomp_udvm_create(tcomp_message_t* _sigCompMessage, tcomp_statehandler_t* stateHandler, tcomp_result_t* lpResult)
{
- tcomp_udvm_t *udvm;
- if((udvm = tsk_object_new(tcomp_udvm_def_t))){
- /* RFC 3320 - 7. SigComp Message Format */
- udvm->sigCompMessage = tsk_object_ref(_sigCompMessage);
- udvm->stateHandler = tsk_object_ref(stateHandler);
- udvm->lpResult = tsk_object_ref(lpResult);
-
- udvm->isOK = tsk_true;
- udvm->maximum_UDVM_cycles = 0; /* RFC 3320 subclause 8.6 */
- udvm->consumed_cycles = 0;
- udvm->memory = tcomp_buffer_create_null();
-
- /* Alloc UDVM memory */
- if(udvm->sigCompMessage->stream_based){
- /*
- * If the transport is stream-based however, then a fixed-size input buffer is required to accommodate the stream, independently of the
- * size of each SigComp message. So, for simplicity, the UDVM memory size is set to (decompression_memory_size / 2).
- */
-
- tcomp_buffer_allocBuff(udvm->memory, udvm->stateHandler->sigcomp_parameters->dmsValue/2);
- }
- else{
- /*
- * If the transport is message-based then sufficient memory must be available
- * to buffer the entire SigComp message before it is passed to the UDVM. So if the message is n bytes long, then the UDVM memory size is set
- * to (decompression_memory_size - n), up to a maximum of 65536 bytes.
- */
- tcomp_buffer_allocBuff(udvm->memory, (udvm->stateHandler->sigcomp_parameters->dmsValue-udvm->sigCompMessage->totalSize));
- }
-
- /*
- * Has feedback with my state id?
- */
- if(tcomp_buffer_getSize(udvm->sigCompMessage->ret_feedback_buffer)){
- tsk_size_t size = tcomp_buffer_getSize(udvm->sigCompMessage->ret_feedback_buffer);
- tcomp_buffer_allocBuff(udvm->lpResult->ret_feedback, size);
- memcpy(tcomp_buffer_getBuffer(udvm->lpResult->ret_feedback), tcomp_buffer_getBuffer(udvm->sigCompMessage->ret_feedback_buffer), size);
- }
-
- /*
- * Has state?
- */
- if(tcomp_buffer_getSize(udvm->sigCompMessage->stateId)){
- /* Find the provided state */
- tcomp_state_t* lpState = NULL;
- uint32_t match_count = tcomp_statehandler_findState(udvm->stateHandler, udvm->sigCompMessage->stateId, &lpState);
- if( (match_count != 1 || !lpState)
- || (lpState->minimum_access_length > tcomp_buffer_getSize(udvm->sigCompMessage->stateId))
- || ((tsk_size_t)(lpState->address + lpState->length) > TCOMP_UDVM_GET_SIZE()) )
- {
- TSK_DEBUG_ERROR("NACK_STATE_NOT_FOUND for id = ");
- tcomp_buffer_print(udvm->sigCompMessage->stateId);
- tcomp_udvm_createNackInfo(udvm, NACK_STATE_NOT_FOUND, udvm->sigCompMessage->stateId, 0);
- udvm->isOK = tsk_false;
- goto bail;
- }
- /*
- * Copy bytecodes to UDVM memory
- */
- if( (tsk_size_t)(lpState->address + lpState->length) >= TCOMP_UDVM_GET_SIZE() ){
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- udvm->isOK = tsk_false;
- goto bail;
- }
- memcpy( TCOMP_UDVM_GET_BUFFER_AT(lpState->address),
- tcomp_buffer_getBuffer(lpState->value),
- tcomp_buffer_getSize(lpState->value) );
-
- //RFC 3320 - 7.2. Accessing Stored State (Useful values)
- TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_PARTIAL_STATE_ID_LENGTH_INDEX, tcomp_buffer_getSize(udvm->sigCompMessage->stateId));
- TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_STATE_LENGTH_INDEX, tcomp_buffer_getSize(lpState->value));
-
- udvm->executionPointer = lpState->instruction;
- }
- else // DON'T HAVE STATE
- {
- /*
- * Copy bytecodes to UDVM memory
- */
- tsk_size_t bytecodes_destination = udvm->sigCompMessage->bytecodes_destination;
- if( (bytecodes_destination + tcomp_buffer_getSize(udvm->sigCompMessage->uploaded_UDVM_buffer)) >= TCOMP_UDVM_GET_SIZE() ){
- tcomp_udvm_createNackInfo2(udvm, NACK_BYTECODES_TOO_LARGE);
- udvm->isOK = tsk_false;
- goto bail;
- }
- memcpy( TCOMP_UDVM_GET_BUFFER_AT(bytecodes_destination),
- tcomp_buffer_getBuffer(udvm->sigCompMessage->uploaded_UDVM_buffer),
- tcomp_buffer_getSize(udvm->sigCompMessage->uploaded_UDVM_buffer));
-
- // Set pointer indicating execution index
- udvm->executionPointer = bytecodes_destination;
- }
-
- /* RFC 3320-Section_8.6. UDVM Cycles
- *
- * the maximum number of UDVM cycles available for processing an n-byte SigComp message is given by the formula
- * maximum_UDVM_cycles = (8 * n + 1000) * cycles_per_bit
- */
- udvm->maximum_UDVM_cycles = ( (8 * udvm->sigCompMessage->header_size + 1000) * udvm->stateHandler->sigcomp_parameters->cpbValue );
-
- //
- // RFC 3320 - 7.2. Useful values
- //
- TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_UDVM_MEMORY_SIZE_INDEX, TCOMP_UDVM_GET_SIZE());
- TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_CYCLES_PER_BIT_INDEX, udvm->stateHandler->sigcomp_parameters->cpbValue);
- TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_SIGCOMP_VERSION_INDEX, udvm->stateHandler->sigcomp_parameters->SigComp_version);
- memset(TCOMP_UDVM_GET_BUFFER_AT(TCOMP_UDVM_HEADER_RESERVED_INDEX), 0, TCOMP_UDVM_HEADER_RESERVED_SIZE);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new udvm machine.");
- }
+ tcomp_udvm_t *udvm;
+ if((udvm = tsk_object_new(tcomp_udvm_def_t))) {
+ /* RFC 3320 - 7. SigComp Message Format */
+ udvm->sigCompMessage = tsk_object_ref(_sigCompMessage);
+ udvm->stateHandler = tsk_object_ref(stateHandler);
+ udvm->lpResult = tsk_object_ref(lpResult);
+
+ udvm->isOK = tsk_true;
+ udvm->maximum_UDVM_cycles = 0; /* RFC 3320 subclause 8.6 */
+ udvm->consumed_cycles = 0;
+ udvm->memory = tcomp_buffer_create_null();
+
+ /* Alloc UDVM memory */
+ if(udvm->sigCompMessage->stream_based) {
+ /*
+ * If the transport is stream-based however, then a fixed-size input buffer is required to accommodate the stream, independently of the
+ * size of each SigComp message. So, for simplicity, the UDVM memory size is set to (decompression_memory_size / 2).
+ */
+
+ tcomp_buffer_allocBuff(udvm->memory, udvm->stateHandler->sigcomp_parameters->dmsValue/2);
+ }
+ else {
+ /*
+ * If the transport is message-based then sufficient memory must be available
+ * to buffer the entire SigComp message before it is passed to the UDVM. So if the message is n bytes long, then the UDVM memory size is set
+ * to (decompression_memory_size - n), up to a maximum of 65536 bytes.
+ */
+ tcomp_buffer_allocBuff(udvm->memory, (udvm->stateHandler->sigcomp_parameters->dmsValue-udvm->sigCompMessage->totalSize));
+ }
+
+ /*
+ * Has feedback with my state id?
+ */
+ if(tcomp_buffer_getSize(udvm->sigCompMessage->ret_feedback_buffer)) {
+ tsk_size_t size = tcomp_buffer_getSize(udvm->sigCompMessage->ret_feedback_buffer);
+ tcomp_buffer_allocBuff(udvm->lpResult->ret_feedback, size);
+ memcpy(tcomp_buffer_getBuffer(udvm->lpResult->ret_feedback), tcomp_buffer_getBuffer(udvm->sigCompMessage->ret_feedback_buffer), size);
+ }
+
+ /*
+ * Has state?
+ */
+ if(tcomp_buffer_getSize(udvm->sigCompMessage->stateId)) {
+ /* Find the provided state */
+ tcomp_state_t* lpState = NULL;
+ uint32_t match_count = tcomp_statehandler_findState(udvm->stateHandler, udvm->sigCompMessage->stateId, &lpState);
+ if( (match_count != 1 || !lpState)
+ || (lpState->minimum_access_length > tcomp_buffer_getSize(udvm->sigCompMessage->stateId))
+ || ((tsk_size_t)(lpState->address + lpState->length) > TCOMP_UDVM_GET_SIZE()) ) {
+ TSK_DEBUG_ERROR("NACK_STATE_NOT_FOUND for id = ");
+ tcomp_buffer_print(udvm->sigCompMessage->stateId);
+ tcomp_udvm_createNackInfo(udvm, NACK_STATE_NOT_FOUND, udvm->sigCompMessage->stateId, 0);
+ udvm->isOK = tsk_false;
+ goto bail;
+ }
+ /*
+ * Copy bytecodes to UDVM memory
+ */
+ if( (tsk_size_t)(lpState->address + lpState->length) >= TCOMP_UDVM_GET_SIZE() ) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ udvm->isOK = tsk_false;
+ goto bail;
+ }
+ memcpy( TCOMP_UDVM_GET_BUFFER_AT(lpState->address),
+ tcomp_buffer_getBuffer(lpState->value),
+ tcomp_buffer_getSize(lpState->value) );
+
+ //RFC 3320 - 7.2. Accessing Stored State (Useful values)
+ TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_PARTIAL_STATE_ID_LENGTH_INDEX, tcomp_buffer_getSize(udvm->sigCompMessage->stateId));
+ TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_STATE_LENGTH_INDEX, tcomp_buffer_getSize(lpState->value));
+
+ udvm->executionPointer = lpState->instruction;
+ }
+ else { // DON'T HAVE STATE
+ /*
+ * Copy bytecodes to UDVM memory
+ */
+ tsk_size_t bytecodes_destination = udvm->sigCompMessage->bytecodes_destination;
+ if( (bytecodes_destination + tcomp_buffer_getSize(udvm->sigCompMessage->uploaded_UDVM_buffer)) >= TCOMP_UDVM_GET_SIZE() ) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_BYTECODES_TOO_LARGE);
+ udvm->isOK = tsk_false;
+ goto bail;
+ }
+ memcpy( TCOMP_UDVM_GET_BUFFER_AT(bytecodes_destination),
+ tcomp_buffer_getBuffer(udvm->sigCompMessage->uploaded_UDVM_buffer),
+ tcomp_buffer_getSize(udvm->sigCompMessage->uploaded_UDVM_buffer));
+
+ // Set pointer indicating execution index
+ udvm->executionPointer = bytecodes_destination;
+ }
+
+ /* RFC 3320-Section_8.6. UDVM Cycles
+ *
+ * the maximum number of UDVM cycles available for processing an n-byte SigComp message is given by the formula
+ * maximum_UDVM_cycles = (8 * n + 1000) * cycles_per_bit
+ */
+ udvm->maximum_UDVM_cycles = ( (8 * udvm->sigCompMessage->header_size + 1000) * udvm->stateHandler->sigcomp_parameters->cpbValue );
+
+ //
+ // RFC 3320 - 7.2. Useful values
+ //
+ TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_UDVM_MEMORY_SIZE_INDEX, TCOMP_UDVM_GET_SIZE());
+ TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_CYCLES_PER_BIT_INDEX, udvm->stateHandler->sigcomp_parameters->cpbValue);
+ TCOMP_UDVM_SET_2BYTES_VAL(TCOMP_UDVM_HEADER_SIGCOMP_VERSION_INDEX, udvm->stateHandler->sigcomp_parameters->SigComp_version);
+ memset(TCOMP_UDVM_GET_BUFFER_AT(TCOMP_UDVM_HEADER_RESERVED_INDEX), 0, TCOMP_UDVM_HEADER_RESERVED_SIZE);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new udvm machine.");
+ }
bail:
- return udvm;
+ return udvm;
}
/**Executes the bytecode.
*/
static tsk_bool_t tcomp_udvm_runByteCode(tcomp_udvm_t *udvm)
{
- uint32_t operand_1, operand_2, operand_3, operand_4, operand_5, operand_6, operand_7;
- tsk_bool_t excution_failed = tsk_false, end_message = tsk_false;
- if(!udvm->isOK) {
- TSK_DEBUG_ERROR("Cannot run()/execute() invalid bytecode");
- return tsk_false;
- }
-
- // LOOP - EXCUTE all bytecode
- while( !excution_failed && !end_message )
- {
- uint8_t udvm_instruction = * (TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer));
- udvm->last_memory_address_of_instruction = udvm->executionPointer;
- udvm->executionPointer++; /* Skip the 1-byte [INSTRUCTION]. */
-
- switch(udvm_instruction)
- {
- case TCOMP_UDVM_INST__DECOMPRESSION_FAILURE:
- {
- TCOMP_UDVM_EXEC_INST__DECOMPRESSION_FAILURE(udvm);
- excution_failed = tsk_true;
- break;
- }
-
- case TCOMP_UDVM_INST__AND:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__AND(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__OR:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__OR(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__NOT:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__NOT(udvm, operand_1);
- break;
- }
-
- case TCOMP_UDVM_INST__LSHIFT:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__LSHIFT(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__RSHIFT:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__RSHIFT(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__ADD:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__ADD(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__SUBTRACT:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__SUBTRACT(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__MULTIPLY:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__MULTIPLY(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__DIVIDE:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__DIVIDE(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__REMAINDER:
- {
- operand_1 = tcomp_udvm_opget_reference_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__REMAINDER(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__SORT_ASCENDING:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__SORT_ASCENDING(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__SORT_DESCENDING:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__SORT_DESCENDING(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__SHA_1:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__SHA_1(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__LOAD:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__LOAD(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__MULTILOAD:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_literal_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__MULTILOAD(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__PUSH:
- {
- excution_failed = !TCOMP_UDVM_EXEC_INST__PUSH2(udvm);
- break;
- }
-
- case TCOMP_UDVM_INST__POP:
- {
- excution_failed = !TCOMP_UDVM_EXEC_INST__POP2(udvm);
- break;
- }
-
- case TCOMP_UDVM_INST__COPY:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__COPY(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__COPY_LITERAL:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_reference_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__COPY_LITERAL(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__COPY_OFFSET:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_reference_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__COPY_OFFSET(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__MEMSET:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- operand_4 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__MEMSET(udvm, operand_1, operand_2, operand_3, operand_4);
- break;
- }
-
- case TCOMP_UDVM_INST__JUMP:
- {
- excution_failed = !TCOMP_UDVM_EXEC_INST__JUMP2(udvm);
- break;
- }
-
- case TCOMP_UDVM_INST__COMPARE:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- operand_4 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- operand_5 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- excution_failed = !TCOMP_UDVM_EXEC_INST__COMPARE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5);
- break;
- }
-
- case TCOMP_UDVM_INST__CALL:
- {
- operand_1 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- excution_failed = !TCOMP_UDVM_EXEC_INST__CALL(udvm, operand_1);
- break;
- }
-
- case TCOMP_UDVM_INST__RETURN:
- {
- excution_failed = !TCOMP_UDVM_EXEC_INST__RETURN(udvm);
- break;
- }
-
- case TCOMP_UDVM_INST__SWITCH:
- {
- operand_1 = tcomp_udvm_opget_literal_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__SWITCH(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__CRC:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- operand_4 = tcomp_udvm_opget_reference_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__CRC(udvm, operand_1, operand_2, operand_3, operand_4);
- break;
- }
-
- case TCOMP_UDVM_INST__INPUT_BYTES:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_BYTES(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__INPUT_BITS:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_BITS(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__INPUT_HUFFMAN:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- operand_3 = tcomp_udvm_opget_literal_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_HUFFMAN(udvm, operand_1, operand_2, operand_3);
- break;
- }
-
- case TCOMP_UDVM_INST__STATE_ACCESS:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- operand_4 = tcomp_udvm_opget_multitype_param(udvm);
- operand_5 = tcomp_udvm_opget_multitype_param(udvm);
- operand_6 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_ACCESS(udvm, operand_1, operand_2, operand_3, operand_4, operand_5, operand_6);
- break;
- }
-
- case TCOMP_UDVM_INST__STATE_CREATE:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- operand_4 = tcomp_udvm_opget_multitype_param(udvm);
- operand_5 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_CREATE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5);
- break;
- }
-
- case TCOMP_UDVM_INST__STATE_FREE:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_FREE(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__OUTPUT:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__OUTPUT(udvm, operand_1, operand_2);
- break;
- }
-
- case TCOMP_UDVM_INST__END_MESSAGE:
- {
- operand_1 = tcomp_udvm_opget_multitype_param(udvm);
- operand_2 = tcomp_udvm_opget_multitype_param(udvm);
- operand_3 = tcomp_udvm_opget_multitype_param(udvm);
- operand_4 = tcomp_udvm_opget_multitype_param(udvm);
- operand_5 = tcomp_udvm_opget_multitype_param(udvm);
- operand_6 = tcomp_udvm_opget_multitype_param(udvm);
- operand_7 = tcomp_udvm_opget_multitype_param(udvm);
- excution_failed = !TCOMP_UDVM_EXEC_INST__END_MESSAGE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5, operand_6, operand_7);
- end_message = 1;
- break;
- }
-
- default:
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPCODE);
- goto bail;
- }
-
- if(excution_failed){
- TSK_DEBUG_ERROR("Execution failed for instruction = %s", TCOMP_INST_DESCRIPTIONS[udvm_instruction].desc);
- }
- //TCOMP_UDVM_DEBUG_PRINT(200);
- }
+ uint32_t operand_1, operand_2, operand_3, operand_4, operand_5, operand_6, operand_7;
+ tsk_bool_t excution_failed = tsk_false, end_message = tsk_false;
+ if(!udvm->isOK) {
+ TSK_DEBUG_ERROR("Cannot run()/execute() invalid bytecode");
+ return tsk_false;
+ }
+
+ // LOOP - EXCUTE all bytecode
+ while( !excution_failed && !end_message ) {
+ uint8_t udvm_instruction = * (TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer));
+ udvm->last_memory_address_of_instruction = udvm->executionPointer;
+ udvm->executionPointer++; /* Skip the 1-byte [INSTRUCTION]. */
+
+ switch(udvm_instruction) {
+ case TCOMP_UDVM_INST__DECOMPRESSION_FAILURE: {
+ TCOMP_UDVM_EXEC_INST__DECOMPRESSION_FAILURE(udvm);
+ excution_failed = tsk_true;
+ break;
+ }
+
+ case TCOMP_UDVM_INST__AND: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__AND(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__OR: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__OR(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__NOT: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__NOT(udvm, operand_1);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__LSHIFT: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__LSHIFT(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__RSHIFT: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__RSHIFT(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__ADD: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__ADD(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__SUBTRACT: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__SUBTRACT(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__MULTIPLY: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__MULTIPLY(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__DIVIDE: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__DIVIDE(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__REMAINDER: {
+ operand_1 = tcomp_udvm_opget_reference_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__REMAINDER(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__SORT_ASCENDING: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__SORT_ASCENDING(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__SORT_DESCENDING: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__SORT_DESCENDING(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__SHA_1: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__SHA_1(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__LOAD: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__LOAD(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__MULTILOAD: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_literal_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__MULTILOAD(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__PUSH: {
+ excution_failed = !TCOMP_UDVM_EXEC_INST__PUSH2(udvm);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__POP: {
+ excution_failed = !TCOMP_UDVM_EXEC_INST__POP2(udvm);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__COPY: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__COPY(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__COPY_LITERAL: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_reference_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__COPY_LITERAL(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__COPY_OFFSET: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_reference_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__COPY_OFFSET(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__MEMSET: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_4 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__MEMSET(udvm, operand_1, operand_2, operand_3, operand_4);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__JUMP: {
+ excution_failed = !TCOMP_UDVM_EXEC_INST__JUMP2(udvm);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__COMPARE: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ operand_4 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ operand_5 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__COMPARE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__CALL: {
+ operand_1 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__CALL(udvm, operand_1);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__RETURN: {
+ excution_failed = !TCOMP_UDVM_EXEC_INST__RETURN(udvm);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__SWITCH: {
+ operand_1 = tcomp_udvm_opget_literal_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__SWITCH(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__CRC: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_4 = tcomp_udvm_opget_reference_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__CRC(udvm, operand_1, operand_2, operand_3, operand_4);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__INPUT_BYTES: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_BYTES(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__INPUT_BITS: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_BITS(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__INPUT_HUFFMAN: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ operand_3 = tcomp_udvm_opget_literal_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__INPUT_HUFFMAN(udvm, operand_1, operand_2, operand_3);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__STATE_ACCESS: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_4 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_5 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_6 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_ACCESS(udvm, operand_1, operand_2, operand_3, operand_4, operand_5, operand_6);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__STATE_CREATE: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_4 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_5 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_CREATE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__STATE_FREE: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__STATE_FREE(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__OUTPUT: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__OUTPUT(udvm, operand_1, operand_2);
+ break;
+ }
+
+ case TCOMP_UDVM_INST__END_MESSAGE: {
+ operand_1 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_2 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_3 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_4 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_5 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_6 = tcomp_udvm_opget_multitype_param(udvm);
+ operand_7 = tcomp_udvm_opget_multitype_param(udvm);
+ excution_failed = !TCOMP_UDVM_EXEC_INST__END_MESSAGE(udvm, operand_1, operand_2, operand_3, operand_4, operand_5, operand_6, operand_7);
+ end_message = 1;
+ break;
+ }
+
+ default:
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPCODE);
+ goto bail;
+ }
+
+ if(excution_failed) {
+ TSK_DEBUG_ERROR("Execution failed for instruction = %s", TCOMP_INST_DESCRIPTIONS[udvm_instruction].desc);
+ }
+ //TCOMP_UDVM_DEBUG_PRINT(200);
+ }
bail:
- udvm->lpResult->consumed_cycles = udvm->consumed_cycles;
- return (!excution_failed);
+ udvm->lpResult->consumed_cycles = udvm->consumed_cycles;
+ return (!excution_failed);
}
/**Decompress the bytecode.
*/
tsk_bool_t tcomp_udvm_decompress(tcomp_udvm_t *udvm)
{
- return tcomp_udvm_runByteCode(udvm);
+ return tcomp_udvm_runByteCode(udvm);
}
@@ -522,36 +482,35 @@ tsk_bool_t tcomp_udvm_decompress(tcomp_udvm_t *udvm)
//
static tsk_object_t* tcomp_udvm_ctor(tsk_object_t * self, va_list * app)
{
- tcomp_udvm_t *udvm = self;
- if(udvm){
+ tcomp_udvm_t *udvm = self;
+ if(udvm) {
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tcomp_udvm_dtor(tsk_object_t *self)
{
- tcomp_udvm_t *udvm = self;
- if(udvm){
- TSK_OBJECT_SAFE_FREE(udvm->memory);
- TSK_OBJECT_SAFE_FREE(udvm->sigCompMessage);
- TSK_OBJECT_SAFE_FREE(udvm->stateHandler);
- TSK_OBJECT_SAFE_FREE(udvm->lpResult);
-
- TSK_FREE(udvm->tmp_buff.ptr);
- }
- else{
- TSK_DEBUG_ERROR("Null udvm machine.");
- }
-
- return self;
+ tcomp_udvm_t *udvm = self;
+ if(udvm) {
+ TSK_OBJECT_SAFE_FREE(udvm->memory);
+ TSK_OBJECT_SAFE_FREE(udvm->sigCompMessage);
+ TSK_OBJECT_SAFE_FREE(udvm->stateHandler);
+ TSK_OBJECT_SAFE_FREE(udvm->lpResult);
+
+ TSK_FREE(udvm->tmp_buff.ptr);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null udvm machine.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tcomp_udvm_def_s =
-{
- sizeof(tcomp_udvm_t),
- tcomp_udvm_ctor,
- tcomp_udvm_dtor,
- tsk_null
+static const tsk_object_def_t tcomp_udvm_def_s = {
+ sizeof(tcomp_udvm_t),
+ tcomp_udvm_ctor,
+ tcomp_udvm_dtor,
+ tsk_null
};
const tsk_object_def_t *tcomp_udvm_def_t = &tcomp_udvm_def_s;
diff --git a/tinySIGCOMP/src/tcomp_udvm.h b/tinySIGCOMP/src/tcomp_udvm.h
index cea9616..736d777 100755
--- a/tinySIGCOMP/src/tcomp_udvm.h
+++ b/tinySIGCOMP/src/tcomp_udvm.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,28 +59,27 @@ TCOMP_BEGIN_DECLS
#define TCOMP_UDVM_GET_BUFFER() tcomp_buffer_getBuffer(udvm->memory)
#define TCOMP_UDVM_GET_BUFFER_AT(position) tcomp_buffer_getBufferAtPos(udvm->memory, position)
-typedef struct tcomp_udvm_s
-{
- TSK_DECLARE_OBJECT;
-
- unsigned isOK:1;
- tcomp_message_t *sigCompMessage;
- tcomp_statehandler_t *stateHandler;
- tcomp_result_t *lpResult;
-
- uint64_t maximum_UDVM_cycles; // RFC3320-Section_8.6
- uint64_t consumed_cycles;
-
- tcomp_buffer_handle_t *memory;
- //header_udvm_memory memoryHeader; // RFC3320-Section_7.2 - // Default constructor will initial values (sip default)
-
- uint32_t executionPointer;
- uint32_t last_memory_address_of_instruction;
-
- struct{
- void* ptr;
- tsk_size_t size;
- } tmp_buff;
+typedef struct tcomp_udvm_s {
+ TSK_DECLARE_OBJECT;
+
+ unsigned isOK:1;
+ tcomp_message_t *sigCompMessage;
+ tcomp_statehandler_t *stateHandler;
+ tcomp_result_t *lpResult;
+
+ uint64_t maximum_UDVM_cycles; // RFC3320-Section_8.6
+ uint64_t consumed_cycles;
+
+ tcomp_buffer_handle_t *memory;
+ //header_udvm_memory memoryHeader; // RFC3320-Section_7.2 - // Default constructor will initial values (sip default)
+
+ uint32_t executionPointer;
+ uint32_t last_memory_address_of_instruction;
+
+ struct {
+ void* ptr;
+ tsk_size_t size;
+ } tmp_buff;
}
tcomp_udvm_t;
@@ -107,8 +106,8 @@ tsk_bool_t tcomp_udvm_bytecopy_from(tcomp_udvm_t *udvm, uint8_t* destination, ui
* State Management
*/
int tcomp_udvm_byteCopy_TempStates(tcomp_udvm_t *udvm);
-int tcomp_udvm_createTempState(tcomp_udvm_t *udvm, uint32_t state_length, uint32_t state_address, uint32_t state_instruction,
- uint32_t minimum_access_length, uint32_t state_retention_priority, int end_msg);
+int tcomp_udvm_createTempState(tcomp_udvm_t *udvm, uint32_t state_length, uint32_t state_address, uint32_t state_instruction,
+ uint32_t minimum_access_length, uint32_t state_retention_priority, int end_msg);
/*
* Nack creation
diff --git a/tinySIGCOMP/src/tcomp_udvm.instructions.c b/tinySIGCOMP/src/tcomp_udvm.instructions.c
index 64b20b5..61724ee 100755
--- a/tinySIGCOMP/src/tcomp_udvm.instructions.c
+++ b/tinySIGCOMP/src/tcomp_udvm.instructions.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -68,7 +68,7 @@
return tsk_false; \
}\
TCOMP_UDVM_SET_2BYTES_VAL(position, value);\
-
+
#define GET_2BYTES_VAL(position, ret_val) \
if(((position) + 1) >= TCOMP_UDVM_GET_SIZE()) \
{ \
@@ -82,31 +82,30 @@
/**
This structure is used to keep index-value pairs after sorting.
*/
-typedef struct IndexValuePair_s
-{
- uint16_t index;
- uint16_t value;
+typedef struct IndexValuePair_s {
+ uint16_t index;
+ uint16_t value;
}
IndexValuePair_t;
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// @brief Predicate to sort integers in ascending order.
+/// @brief Predicate to sort integers in ascending order.
///
-/// @param [in,out] a First integer.
-/// @param [in,out] b Second integer.
+/// @param [in,out] a First integer.
+/// @param [in,out] b Second integer.
///
-/// @retval Zero if @a a == @a b; negative if @a a < @a b and positive otherwise..
+/// @retval Zero if @a a == @a b; negative if @a a < @a b and positive otherwise..
////////////////////////////////////////////////////////////////////////////////////////////////////
static int SortAscendingPredicate(const void *a, const void *b)
{
- const IndexValuePair_t *el1 = a;
- const IndexValuePair_t *el2 = b;
-
- /* If values are equal the original ordering of the integers must be preserved
- * ==> We cannot use normal comparaison because the ANSI C implementation of qsort could swap values even if they are equal.
- */
- return (el2->value == el1->value) ? (el1->index - el2->index) : (el1->value - el2->value);
+ const IndexValuePair_t *el1 = a;
+ const IndexValuePair_t *el2 = b;
+
+ /* If values are equal the original ordering of the integers must be preserved
+ * ==> We cannot use normal comparaison because the ANSI C implementation of qsort could swap values even if they are equal.
+ */
+ return (el2->value == el1->value) ? (el1->index - el2->index) : (el1->value - el2->value);
}
/**
@@ -115,21 +114,21 @@ static int SortAscendingPredicate(const void *a, const void *b)
////////////////////////////////////////////////////////////////////////////////////////////////////
///
-/// @brief Predicate to sort integers in descending order.
-/// @param [in,out] a First integer.
-/// @param [in,out] b Second integer.
+/// @brief Predicate to sort integers in descending order.
+/// @param [in,out] a First integer.
+/// @param [in,out] b Second integer.
///
/// @retval Zero if @a a == @a b; negative if @a a > @a b and positive otherwise.
////////////////////////////////////////////////////////////////////////////////////////////////////
static int SortDescendingPredicate(const void *a, const void *b)
{
- const IndexValuePair_t *el1 = a;
- const IndexValuePair_t *el2 = b;
+ const IndexValuePair_t *el1 = a;
+ const IndexValuePair_t *el2 = b;
- /* If values are equal the original ordering of the integers must be preserved.
- * ==> We cannot use normal comparaison because the ANSI C implementation of qsort could swap values even if they are equal.
- */
- return (el2->value == el1->value) ? (el1->index - el2->index) : (el2->value - el1->value);
+ /* If values are equal the original ordering of the integers must be preserved.
+ * ==> We cannot use normal comparaison because the ANSI C implementation of qsort could swap values even if they are equal.
+ */
+ return (el2->value == el1->value) ? (el1->index - el2->index) : (el2->value - el1->value);
};
@@ -142,15 +141,15 @@ static int SortDescendingPredicate(const void *a, const void *b)
/// cannot successfully decompress the message (e.g., by using the CRC instruction).
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__DECOMPRESSION_FAILURE(tcomp_udvm_t *udvm)
{
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_USER_REQUESTED].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_USER_REQUESTED);
- return tsk_false;
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_USER_REQUESTED].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_USER_REQUESTED);
+ return tsk_false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -158,26 +157,26 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__DECOMPRESSION_FAILURE(tcomp_udvm_t *udvm)
///
/// @brief AND ($operand_1, %operand_2)
/// Reference: RFC3320 Section 9.1.1
-/// Formula: [operand_1 := operand_1 & operand_2].
+/// Formula: [operand_1 := operand_1 & operand_2].
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
-/// @param operand_2 The second operand.
+/// this operand is overwritten with the result.
+/// @param operand_2 The second operand.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__AND(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
+
+ CONSUME_CYCLES(1);
- CONSUME_CYCLES(1);
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL( operand_1, (_2bytes & operand_2) );
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL( operand_1, (_2bytes & operand_2) );
-
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -185,26 +184,26 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__AND(tcomp_udvm_t *udvm, uint32_t operand_1, uin
///
/// @brief OR ($operand_1, %operand_2)
/// Reference: RFC3320 Section 9.1.1
-/// Formula: [operand_1 := operand_1 | operand_2].
+/// Formula: [operand_1 := operand_1 | operand_2].
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
-/// @param operand_2 The second operand.
+/// this operand is overwritten with the result.
+/// @param operand_2 The second operand.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__OR(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL( operand_1, (_2bytes | operand_2) );
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL( operand_1, (_2bytes | operand_2) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -214,23 +213,23 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__OR(tcomp_udvm_t *udvm, uint32_t operand_1, uint
/// Reference: RFC3320 Section 9.1.1<br>
/// Formula: [operand_1 := ~operand_1]. <br>
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
+/// this operand is overwritten with the result.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__NOT(tcomp_udvm_t *udvm, uint32_t operand_1)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL( operand_1, ~( _2bytes ) );
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL( operand_1, ~( _2bytes ) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -240,27 +239,27 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__NOT(tcomp_udvm_t *udvm, uint32_t operand_1)
/// Reference: RFC3320 Section 9.1.1<br>
/// Formula: [LSHIFT (m, n) := m * 2^n (modulo 2^16)]. <br>
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
-/// @param operand_2 2-byte value encoded by the operand.
+/// this operand is overwritten with the result.
+/// @param operand_2 2-byte value encoded by the operand.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__LSHIFT(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- // (m * 2^n) == (m<<n)
- // (2^16) === 65536
+ // (m * 2^n) == (m<<n)
+ // (2^16) === 65536
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL( operand_1, (_2bytes << operand_2) );
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL( operand_1, (_2bytes << operand_2) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -270,25 +269,25 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__LSHIFT(tcomp_udvm_t *udvm, uint32_t operand_1,
/// Reference: RFC3320 Section 9.1.1<br>
/// Formula: [RSHIFT (m, n) := floor(m / 2^n)]. <br>
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-// this operand is overwritten with the result.
-/// @param operand_2 2-byte value encoded by the operand.
+// this operand is overwritten with the result.
+/// @param operand_2 2-byte value encoded by the operand.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__RSHIFT(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
+
+ CONSUME_CYCLES(1);
- CONSUME_CYCLES(1);
-
- // floor(m / 2^n) == (m>>n)
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes >> operand_2) );
+ // floor(m / 2^n) == (m>>n)
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes >> operand_2) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -299,23 +298,23 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__RSHIFT(tcomp_udvm_t *udvm, uint32_t operand_1,
/// Formula: [ADD (m, n) := m + n (modulo 2^16)]<br>
///
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
-/// @param operand_2 2-byte value encoded by the operand.
+/// this operand is overwritten with the result.
+/// @param operand_2 2-byte value encoded by the operand.
///
/// @retval True if succeed, otherwise return false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__ADD(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
+
+ CONSUME_CYCLES(1);
- CONSUME_CYCLES(1);
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes + operand_2) );
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes + operand_2) );
-
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -325,7 +324,7 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__ADD(tcomp_udvm_t *udvm, uint32_t operand_1, uin
/// Reference: RFC3320 Section 9.1.2<br>
/// Formula: [SUBTRACT (m, n) := m - n (modulo 2^16)]<br>
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
/// this operand is overwritten with the result.
/// @param operand_2 2-byte value encoded by the operand.
@@ -334,14 +333,14 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__ADD(tcomp_udvm_t *udvm, uint32_t operand_1, uin
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__SUBTRACT(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes - operand_2) );
-
- return tsk_true;
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes - operand_2) );
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -351,23 +350,23 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__SUBTRACT(tcomp_udvm_t *udvm, uint32_t operand_1
/// Reference: RFC3320 Section 9.1.2<br>
/// Formula: [MULTIPLY (m, n) := m * n (modulo 2^16)]<br>
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
-/// @param operand_2 2-byte value encoded by the operand.
+/// this operand is overwritten with the result.
+/// @param operand_2 2-byte value encoded by the operand.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__MULTIPLY(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
+
+ CONSUME_CYCLES(1);
- CONSUME_CYCLES(1);
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes * operand_2) );
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes * operand_2) );
-
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -378,29 +377,29 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__MULTIPLY(tcomp_udvm_t *udvm, uint32_t operand_1
/// Formula: [DIVIDE (m, n) := floor(m / n)]<br>
///
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
/// this operand is overwritten with the result.
-/// @param operand_2 2-byte value encoded by the operand. Decompression failure occurs if this operand is zero.
+/// @param operand_2 2-byte value encoded by the operand. Decompression failure occurs if this operand is zero.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__DIVIDE(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
+ uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- if(!operand_2){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_DIV_BY_ZERO].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_DIV_BY_ZERO);
- return tsk_false;
- }
+ if(!operand_2) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_DIV_BY_ZERO].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_DIV_BY_ZERO);
+ return tsk_false;
+ }
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes / operand_2) );
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes / operand_2) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -411,28 +410,28 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__DIVIDE(tcomp_udvm_t *udvm, uint32_t operand_1,
/// Formula: [REMAINDER (m, n) := m - n * floor(m / n)]<br>
///
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param operand_1 2-byte value encoded by the operand. After the operation is complete, the 2-byte word at the memory address specified by
-/// this operand is overwritten with the result.
+/// this operand is overwritten with the result.
/// @param operand_2 2-byte value encoded by the operand. Decompression failure occurs if this operand is zero.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__REMAINDER(tcomp_udvm_t *udvm, uint32_t operand_1, uint32_t operand_2)
{
- uint16_t _2bytes;
- CONSUME_CYCLES(1);
+ uint16_t _2bytes;
+ CONSUME_CYCLES(1);
- if(!operand_2){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_DIV_BY_ZERO].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_DIV_BY_ZERO);
- return tsk_false;
- }
+ if(!operand_2) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_DIV_BY_ZERO].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_DIV_BY_ZERO);
+ return tsk_false;
+ }
- GET_2BYTES_VAL(operand_1, _2bytes);
- SET_2BYTES_VAL(operand_1, (_2bytes % operand_2) );
+ GET_2BYTES_VAL(operand_1, _2bytes);
+ SET_2BYTES_VAL(operand_1, (_2bytes % operand_2) );
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -443,66 +442,71 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__REMAINDER(tcomp_udvm_t *udvm, uint32_t operand_
///
/// This instruction sort lists of 2-byte words in ascending order.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param start The starting memory address of the block of data to be sorted.
-/// @param n Number of lists.
-/// @param k Lists length (2-byte words).
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param start The starting memory address of the block of data to be sorted.
+/// @param n Number of lists.
+/// @param k Lists length (2-byte words).
///
/// @retval True if succeed, otherwise return false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__SORT_ASCENDING(tcomp_udvm_t *udvm, uint32_t start, uint32_t n, uint32_t k)
{
- tsk_bool_t segfault = tsk_false;
- uint16_t* list_temp = tsk_null;
- IndexValuePair_t *list1_values = tsk_null;
- uint32_t list_index, list_el;
- uint32_t j, pos;
-
- CONSUME_CYCLES(( 1 + k *(CEILLINGLOG2(k) + n) )); /* 1 + k * (ceiling(log2(k)) + n) */
-
- if(TCOMP_UDVM_GET_SIZE() <= (tsk_size_t)(start+(n*k*2)) ){
- segfault = tsk_true;
- goto __SEGFAULT;
- };
-
- //
- // Create FirstList with key-value pairs
- //
- list1_values = (IndexValuePair_t*)tsk_calloc(k, sizeof(IndexValuePair_t));
- if(!list1_values) { segfault = tsk_true; goto __SEGFAULT; };
- for(j=0, pos=0; pos<k; j+=2,pos++){
- list1_values[pos].index = pos;
- GET_2BYTES_VAL((start+j), list1_values[pos].value);
- }
-
- /*
- * Sort Fisrt List Values
- */
- qsort(list1_values, k, sizeof(IndexValuePair_t), SortAscendingPredicate);
-
- /* Sort all lists */
- list_temp = tsk_calloc(k, sizeof(uint32_t));
- if(!list1_values) { segfault = tsk_true; goto __SEGFAULT; };
- for(list_index = 0; list_index < n; list_index++){
- uint16_t* list_start = (uint16_t*)TCOMP_UDVM_GET_BUFFER_AT( start + (list_index*k*2) );
- memcpy(list_temp, list_start, k*2);
- for(list_el=0; list_el<k; list_el++){
- list_start[(list_el)] = list_temp[ list1_values[list_el].index ];
- }
- }
+ tsk_bool_t segfault = tsk_false;
+ uint16_t* list_temp = tsk_null;
+ IndexValuePair_t *list1_values = tsk_null;
+ uint32_t list_index, list_el;
+ uint32_t j, pos;
+
+ CONSUME_CYCLES(( 1 + k *(CEILLINGLOG2(k) + n) )); /* 1 + k * (ceiling(log2(k)) + n) */
+
+ if(TCOMP_UDVM_GET_SIZE() <= (tsk_size_t)(start+(n*k*2)) ) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+
+ //
+ // Create FirstList with key-value pairs
+ //
+ list1_values = (IndexValuePair_t*)tsk_calloc(k, sizeof(IndexValuePair_t));
+ if(!list1_values) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+ for(j=0, pos=0; pos<k; j+=2,pos++) {
+ list1_values[pos].index = pos;
+ GET_2BYTES_VAL((start+j), list1_values[pos].value);
+ }
+
+ /*
+ * Sort Fisrt List Values
+ */
+ qsort(list1_values, k, sizeof(IndexValuePair_t), SortAscendingPredicate);
+
+ /* Sort all lists */
+ list_temp = tsk_calloc(k, sizeof(uint32_t));
+ if(!list1_values) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+ for(list_index = 0; list_index < n; list_index++) {
+ uint16_t* list_start = (uint16_t*)TCOMP_UDVM_GET_BUFFER_AT( start + (list_index*k*2) );
+ memcpy(list_temp, list_start, k*2);
+ for(list_el=0; list_el<k; list_el++) {
+ list_start[(list_el)] = list_temp[ list1_values[list_el].index ];
+ }
+ }
__SEGFAULT:
- TSK_FREE(list_temp);
- TSK_FREE(list1_values);
-
- if(segfault)
- {
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
+ TSK_FREE(list_temp);
+ TSK_FREE(list1_values);
+
+ if(segfault) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -513,61 +517,70 @@ __SEGFAULT:
///
/// This instruction sort lists of 2-byte words in descending order.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param start The starting memory address of the block of data to be sorted.
-/// @param n Number of lists.
-/// @param k Lists length (2-byte words).
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param start The starting memory address of the block of data to be sorted.
+/// @param n Number of lists.
+/// @param k Lists length (2-byte words).
///
/// @retval True if succeed, otherwise return false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__SORT_DESCENDING(tcomp_udvm_t *udvm, uint32_t start, uint32_t n, uint32_t k)
{
- tsk_bool_t segfault = tsk_false;
- uint16_t* list_temp = tsk_null;
- IndexValuePair_t *list1_values = tsk_null;
- uint32_t list_index, list_el;
- uint32_t j, pos;
-
- CONSUME_CYCLES(( 1 + k *(CEILLINGLOG2(k) + n) )); // 1 + k * (ceiling(log2(k)) + n)
-
- if(TCOMP_UDVM_GET_SIZE() <= (tsk_size_t)(start+(n*k*2)) ){ segfault = tsk_true; goto __SEGFAULT; };
-
- //
- // Create FirstList with key-value pairs.
- //
- list1_values = (IndexValuePair_t*)tsk_calloc(k, sizeof(IndexValuePair_t));
- if(!list1_values) { segfault = tsk_true; goto __SEGFAULT; };
- for(j=0, pos=0; pos<k; j+=2,pos++){
- list1_values[pos].index = pos;
- GET_2BYTES_VAL((start+j), list1_values[pos].value);
- }
-
- // Sort Fisrt List Values.
- qsort(list1_values, k, sizeof(IndexValuePair_t), SortDescendingPredicate);
-
-
- // Sort all lists
- list_temp = tsk_calloc(k, sizeof(uint16_t));
- if(!list1_values) { segfault = tsk_true; goto __SEGFAULT; };
- for(list_index = 0; list_index < n; list_index++){
- uint16_t* list_start = (uint16_t*)TCOMP_UDVM_GET_BUFFER_AT(start + (list_index*k*2));
- memcpy(list_temp, list_start, k*2);
- for(list_el=0; list_el<k; list_el++){
- list_start[(list_el)] = list_temp[ list1_values[list_el].index ];
- }
- }
+ tsk_bool_t segfault = tsk_false;
+ uint16_t* list_temp = tsk_null;
+ IndexValuePair_t *list1_values = tsk_null;
+ uint32_t list_index, list_el;
+ uint32_t j, pos;
+
+ CONSUME_CYCLES(( 1 + k *(CEILLINGLOG2(k) + n) )); // 1 + k * (ceiling(log2(k)) + n)
+
+ if(TCOMP_UDVM_GET_SIZE() <= (tsk_size_t)(start+(n*k*2)) ) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+
+ //
+ // Create FirstList with key-value pairs.
+ //
+ list1_values = (IndexValuePair_t*)tsk_calloc(k, sizeof(IndexValuePair_t));
+ if(!list1_values) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+ for(j=0, pos=0; pos<k; j+=2,pos++) {
+ list1_values[pos].index = pos;
+ GET_2BYTES_VAL((start+j), list1_values[pos].value);
+ }
+
+ // Sort Fisrt List Values.
+ qsort(list1_values, k, sizeof(IndexValuePair_t), SortDescendingPredicate);
+
+
+ // Sort all lists
+ list_temp = tsk_calloc(k, sizeof(uint16_t));
+ if(!list1_values) {
+ segfault = tsk_true;
+ goto __SEGFAULT;
+ };
+ for(list_index = 0; list_index < n; list_index++) {
+ uint16_t* list_start = (uint16_t*)TCOMP_UDVM_GET_BUFFER_AT(start + (list_index*k*2));
+ memcpy(list_temp, list_start, k*2);
+ for(list_el=0; list_el<k; list_el++) {
+ list_start[(list_el)] = list_temp[ list1_values[list_el].index ];
+ }
+ }
__SEGFAULT:
- TSK_FREE(list_temp);
- TSK_FREE(list1_values);
+ TSK_FREE(list_temp);
+ TSK_FREE(list1_values);
- if(segfault){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
+ if(segfault) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -577,7 +590,7 @@ __SEGFAULT:
/// Reference: RFC3320 Section 9.1.4<br>
/// This instruction calculates a 20-byte SHA-1 hash [RFC-3174] over the specified area of UDVM memory.
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param position The starting memory address.
/// @param length The length of the byte string over which the SHA-1 hash is calculated.
/// @param destination The starting address to which the resulting 20-byte hash will be copied.
@@ -586,56 +599,56 @@ __SEGFAULT:
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__SHA_1(tcomp_udvm_t *udvm, uint32_t position, uint32_t length, uint32_t destination)
{
- tsk_bool_t ok = tsk_false;
- tsk_sha1context_t sha;
- int32_t err;
- uint8_t Message_Digest[TSK_SHA1_DIGEST_SIZE];
-
- // only check length
- // (destination + length) could be > sizeof(udvm_memory) as copying is done byte by byte and could wrap
- if(!length){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- goto bail;
- }
-
- CONSUME_CYCLES(1 + length);
-
- // The SHA-1 instruction calculates a 20-byte SHA-1 hash [RFC-3174] over the specified area of UDVM memory
- if(udvm->tmp_buff.size < length){
- if(!(udvm->tmp_buff.ptr = tsk_realloc(udvm->tmp_buff.ptr, length))){
- udvm->tmp_buff.size = 0;
- goto bail;
- }
- udvm->tmp_buff.size = length;
- }
-
- if(!(ok = tcomp_udvm_bytecopy_from(udvm, udvm->tmp_buff.ptr, position, length))){
- goto bail;
- }
-
- // Compute SHA-1
- if(!(ok = ((err = tsk_sha1reset(&sha)) == 0))){
- TSK_DEBUG_ERROR("%s: %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, err);
- tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
- goto bail;
- }
- if(!(ok = ((err = tsk_sha1input(&sha, udvm->tmp_buff.ptr, length)) == 0))){
- TSK_DEBUG_ERROR("%s : %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, err);
- tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
- goto bail;
- }
- if(!(ok = ((err = tsk_sha1result(&sha, (uint8_t*)Message_Digest)) == 0))){
- TSK_DEBUG_ERROR("%s : %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, ok);
- tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
- goto bail;
- }
-
- //Copy sha1 result to udvm memory
- ok &= tcomp_udvm_bytecopy_to(udvm, destination, Message_Digest, TSK_SHA1_DIGEST_SIZE);
+ tsk_bool_t ok = tsk_false;
+ tsk_sha1context_t sha;
+ int32_t err;
+ uint8_t Message_Digest[TSK_SHA1_DIGEST_SIZE];
+
+ // only check length
+ // (destination + length) could be > sizeof(udvm_memory) as copying is done byte by byte and could wrap
+ if(!length) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ goto bail;
+ }
+
+ CONSUME_CYCLES(1 + length);
+
+ // The SHA-1 instruction calculates a 20-byte SHA-1 hash [RFC-3174] over the specified area of UDVM memory
+ if(udvm->tmp_buff.size < length) {
+ if(!(udvm->tmp_buff.ptr = tsk_realloc(udvm->tmp_buff.ptr, length))) {
+ udvm->tmp_buff.size = 0;
+ goto bail;
+ }
+ udvm->tmp_buff.size = length;
+ }
+
+ if(!(ok = tcomp_udvm_bytecopy_from(udvm, udvm->tmp_buff.ptr, position, length))) {
+ goto bail;
+ }
+
+ // Compute SHA-1
+ if(!(ok = ((err = tsk_sha1reset(&sha)) == 0))) {
+ TSK_DEBUG_ERROR("%s: %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, err);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
+ goto bail;
+ }
+ if(!(ok = ((err = tsk_sha1input(&sha, udvm->tmp_buff.ptr, length)) == 0))) {
+ TSK_DEBUG_ERROR("%s : %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, err);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
+ goto bail;
+ }
+ if(!(ok = ((err = tsk_sha1result(&sha, (uint8_t*)Message_Digest)) == 0))) {
+ TSK_DEBUG_ERROR("%s : %d", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc, ok);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
+ goto bail;
+ }
+
+ //Copy sha1 result to udvm memory
+ ok &= tcomp_udvm_bytecopy_to(udvm, destination, Message_Digest, TSK_SHA1_DIGEST_SIZE);
bail:
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -646,25 +659,25 @@ bail:
/// This instruction sets a 2-byte word to a certain specified value
/// As usual, MSBs are stored before LSBs in the UDVM memory.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param address Specifies the starting address of a 2-byte word.
-/// @param value Specifies the value to be loaded into this word.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param address Specifies the starting address of a 2-byte word.
+/// @param value Specifies the value to be loaded into this word.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__LOAD(tcomp_udvm_t *udvm, uint32_t address, uint32_t value)
{
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- if( address >= TCOMP_UDVM_GET_SIZE() ){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
+ if( address >= TCOMP_UDVM_GET_SIZE() ) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
- SET_2BYTES_VAL(address, value);
+ SET_2BYTES_VAL(address, value);
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -676,21 +689,21 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__LOAD(tcomp_udvm_t *udvm, uint32_t address, uint
/// value_0 through to value_n-1 specify the values to load into these words (in the same order as
/// they appear in the instruction).
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param address Starting address of the contiguous 2-byte words.
-/// @param n Number of 2-bytes values to load.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param address Starting address of the contiguous 2-byte words.
+/// @param n Number of 2-bytes values to load.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__MULTILOAD(tcomp_udvm_t *udvm, uint32_t address, uint32_t n)
{
- uint32_t index, _address;
- uint32_t overlap_start = udvm->last_memory_address_of_instruction;
- #define overlap_end udvm->executionPointer
- uint32_t write_start = address;
- uint32_t write_end = (address + (n << 1));
+ uint32_t index, _address;
+ uint32_t overlap_start = udvm->last_memory_address_of_instruction;
+#define overlap_end udvm->executionPointer
+ uint32_t write_start = address;
+ uint32_t write_end = (address + (n << 1));
- CONSUME_CYCLES(1 + n);
+ CONSUME_CYCLES(1 + n);
#define CHECK_MULTILOAD_OVERWRITTEN(__start, __address, __end) \
if(( (__start) <= (__address) && (__address) <= (__end) ) || ( (__start) <= ((__address) + 1) && ((__address) + 1) <= (__end) )){ \
@@ -699,18 +712,18 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__MULTILOAD(tcomp_udvm_t *udvm, uint32_t address,
return tsk_false; \
}
- // tcomp_udvm_opget_multitype_param() will move the execPtr => make the test before the for loop
- CHECK_MULTILOAD_OVERWRITTEN(overlap_start, address, overlap_end);
- CHECK_MULTILOAD_OVERWRITTEN(write_start, udvm->executionPointer, write_end);
-
- for(index = 0, _address = address; index < n; index++ , _address += 2){
- uint32_t value_n = tcomp_udvm_opget_multitype_param(udvm);
- CHECK_MULTILOAD_OVERWRITTEN(overlap_start, _address, overlap_end);
- CHECK_MULTILOAD_OVERWRITTEN(write_start, udvm->executionPointer, write_end);
- SET_2BYTES_VAL(_address, value_n);
- }
+ // tcomp_udvm_opget_multitype_param() will move the execPtr => make the test before the for loop
+ CHECK_MULTILOAD_OVERWRITTEN(overlap_start, address, overlap_end);
+ CHECK_MULTILOAD_OVERWRITTEN(write_start, udvm->executionPointer, write_end);
+
+ for(index = 0, _address = address; index < n; index++ , _address += 2) {
+ uint32_t value_n = tcomp_udvm_opget_multitype_param(udvm);
+ CHECK_MULTILOAD_OVERWRITTEN(overlap_start, _address, overlap_end);
+ CHECK_MULTILOAD_OVERWRITTEN(write_start, udvm->executionPointer, write_end);
+ SET_2BYTES_VAL(_address, value_n);
+ }
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -718,41 +731,41 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__MULTILOAD(tcomp_udvm_t *udvm, uint32_t address,
///
/// @brief <i>PUSH (%value)</i><br><br>
/// Reference: RFC3320 Section 9.2.3<br>
-/// This instruction pushes the value specified by its operand on the stack..
+/// This instruction pushes the value specified by its operand on the stack..
///
/// @date 11/27/2009
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param value 2-byte word to push.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param value 2-byte word to push.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__PUSH(tcomp_udvm_t *udvm, int16_t value)
{
- tsk_bool_t callback = (value>=0);
- uint32_t stack_location, stack_fill;
- if(!callback){
- value = tcomp_udvm_opget_multitype_param(udvm);
- }
+ tsk_bool_t callback = (value>=0);
+ uint32_t stack_location, stack_fill;
+ if(!callback) {
+ value = tcomp_udvm_opget_multitype_param(udvm);
+ }
- CONSUME_CYCLES(callback ? 0 : 1);
+ CONSUME_CYCLES(callback ? 0 : 1);
-
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_STACK_LOCATION_INDEX, stack_location);
- GET_2BYTES_VAL(stack_location, stack_fill);
- /*
- * copying the value to stack[stack_fill]
- * stack[n] = stack_location+2*n+2
- */
- SET_2BYTES_VAL((stack_location+(2*stack_fill)+2), value);
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_STACK_LOCATION_INDEX, stack_location);
+ GET_2BYTES_VAL(stack_location, stack_fill);
- /* increasing stack_fill by 1*/
- SET_2BYTES_VAL(stack_location, (stack_fill+1));
+ /*
+ * copying the value to stack[stack_fill]
+ * stack[n] = stack_location+2*n+2
+ */
+ SET_2BYTES_VAL((stack_location+(2*stack_fill)+2), value);
- return tsk_true;
+ /* increasing stack_fill by 1*/
+ SET_2BYTES_VAL(stack_location, (stack_fill+1));
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -760,57 +773,57 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__PUSH(tcomp_udvm_t *udvm, int16_t value)
///
/// @brief <i>POP (%address)</i><br><br>
/// Reference: RFC3320 Section 9.2.3<br>
-/// This instruction pops a value from the stack and then copies the value to the specified memory address..
+/// This instruction pops a value from the stack and then copies the value to the specified memory address..
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param [in,out] value 2-byte word to pop from the stack.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] value 2-byte word to pop from the stack.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__POP(tcomp_udvm_t *udvm, uint32_t* value)
{
- uint32_t address;
- uint32_t stack_location, stack_fill, _value = 0;
-
- tsk_bool_t callback = (value != 0);
-
- CONSUME_CYCLES(callback?0:1);
-
- address = callback ? 0 : tcomp_udvm_opget_multitype_param(udvm);
-
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_STACK_LOCATION_INDEX, stack_location);
- GET_2BYTES_VAL(stack_location, stack_fill);
-
- /*
- * Decompression failure occurs if stack_fill is
- * zero at the commencement of a popping operation. POP and RETURN pop
- * values from the stack.
- */
- if(stack_fill == 0){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- _value = 0;
- goto end;
- }
-
- /*
- * "Popping" a value from the stack is an abbreviation for decreasing
- * stack_fill by 1, and then using the value stored in stack[stack_fill].
- */
- --stack_fill;
- SET_2BYTES_VAL(stack_location, stack_fill);
- /* stack[n] = stack_location+2*n+2 */
- GET_2BYTES_VAL((stack_location + (2*stack_fill) + 2), _value);
+ uint32_t address;
+ uint32_t stack_location, stack_fill, _value = 0;
+
+ tsk_bool_t callback = (value != 0);
+
+ CONSUME_CYCLES(callback?0:1);
+
+ address = callback ? 0 : tcomp_udvm_opget_multitype_param(udvm);
+
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_STACK_LOCATION_INDEX, stack_location);
+ GET_2BYTES_VAL(stack_location, stack_fill);
+
+ /*
+ * Decompression failure occurs if stack_fill is
+ * zero at the commencement of a popping operation. POP and RETURN pop
+ * values from the stack.
+ */
+ if(stack_fill == 0) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ _value = 0;
+ goto end;
+ }
+
+ /*
+ * "Popping" a value from the stack is an abbreviation for decreasing
+ * stack_fill by 1, and then using the value stored in stack[stack_fill].
+ */
+ --stack_fill;
+ SET_2BYTES_VAL(stack_location, stack_fill);
+ /* stack[n] = stack_location+2*n+2 */
+ GET_2BYTES_VAL((stack_location + (2*stack_fill) + 2), _value);
end:
- if(callback){
- *value = _value;
- }
- else{
- SET_2BYTES_VAL(address, _value);
- }
-
- return tsk_true;
+ if(callback) {
+ *value = _value;
+ }
+ else {
+ SET_2BYTES_VAL(address, _value);
+ }
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -820,32 +833,32 @@ end:
/// Reference: RFC3320 Section 9.2.4<br>
/// This instruction is used to copy a string of bytes from one part of the UDVM memory to another.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param position Specifies the memory address of the first byte in the string to be copied.
-/// @param length Specifies the number of bytes to be copied.
-/// @param destination Gives the address to which the first byte in the string will be copied.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param position Specifies the memory address of the first byte in the string to be copied.
+/// @param length Specifies the number of bytes to be copied.
+/// @param destination Gives the address to which the first byte in the string will be copied.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY(tcomp_udvm_t *udvm, uint32_t position, uint32_t length, uint32_t destination)
{
- tsk_bool_t ok = tsk_true;
-
- CONSUME_CYCLES(1+length);
-
- if( (position + length) > (int32_t)TCOMP_UDVM_GET_SIZE() || (destination + length) > (int32_t)TCOMP_UDVM_GET_SIZE() ){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
+ tsk_bool_t ok = tsk_true;
+
+ CONSUME_CYCLES(1+length);
+
+ if( (position + length) > (int32_t)TCOMP_UDVM_GET_SIZE() || (destination + length) > (int32_t)TCOMP_UDVM_GET_SIZE() ) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
- /*
- * The COPY instruction is used to copy a string of bytes from one part
- * of the UDVM memory to another.
- */
- ok &= tcomp_udvm_bytecopy_self(udvm, &destination, position, length);
+ /*
+ * The COPY instruction is used to copy a string of bytes from one part
+ * of the UDVM memory to another.
+ */
+ ok &= tcomp_udvm_bytecopy_self(udvm, &destination, position, length);
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -855,30 +868,30 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY(tcomp_udvm_t *udvm, uint32_t position, uin
/// Reference: RFC3320 Section 9.2.5<br>
/// The COPY-LITERAL instruction behaves as a COPY instruction except
/// that after copying is completed, the value of the destination operand
-/// is replaced by the address to which the next byte of data would be copied..
+/// is replaced by the address to which the next byte of data would be copied..
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param position Specifies the memory address of the first byte in the string to be copied.
-/// @param length Specifies the number of bytes to be copied.
-/// @param destination Gives the address to which the first byte in the string will be copied.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param position Specifies the memory address of the first byte in the string to be copied.
+/// @param length Specifies the number of bytes to be copied.
+/// @param destination Gives the address to which the first byte in the string will be copied.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY_LITERAL(tcomp_udvm_t *udvm, uint32_t position, uint32_t length, uint32_t destination)
{
- tsk_bool_t ok;
- uint32_t destination_index;
-
- CONSUME_CYCLES(1+length);
-
- GET_2BYTES_VAL(destination, destination_index);
- ok = tcomp_udvm_bytecopy_self(udvm, &destination_index, position, length);
- if(ok){
- /* set next byte */
- SET_2BYTES_VAL(destination, destination_index);
- }
-
- return ok;
+ tsk_bool_t ok;
+ uint32_t destination_index;
+
+ CONSUME_CYCLES(1+length);
+
+ GET_2BYTES_VAL(destination, destination_index);
+ ok = tcomp_udvm_bytecopy_self(udvm, &destination_index, position, length);
+ if(ok) {
+ /* set next byte */
+ SET_2BYTES_VAL(destination, destination_index);
+ }
+
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -887,90 +900,90 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY_LITERAL(tcomp_udvm_t *udvm, uint32_t posit
/// @brief <i>COPY-OFFSET(%offset, %length, $destination)</i><br><br>
/// Reference: RFC3320 Section 9.2.6<br>
/// This instruction behaves as a COPY-LITERAL instruction
-/// except that an offset operand is given instead of a position operand..
+/// except that an offset operand is given instead of a position operand..
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param offset The offset value.
-/// @param length Specifies the number of bytes to be copied.
-/// @param destination Gives the address to which the first byte in the string will be copied.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param offset The offset value.
+/// @param length Specifies the number of bytes to be copied.
+/// @param destination Gives the address to which the first byte in the string will be copied.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY_OFFSET(tcomp_udvm_t *udvm, uint32_t offset, uint32_t length, uint32_t destination)
{
- uint32_t DEST, LEFT, RIGTH;
- int32_t position = -1;
- uint32_t destination_index;
-
- int32_t D, T;
- int32_t O;
-
- CONSUME_CYCLES(1+length);
-
- GET_2BYTES_VAL(destination, DEST);
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX, LEFT);
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX, RIGTH);
-
- /*
- DEST: ses
- D: distance between LEFT and DEST
- O: offset
- T: total size between LEFT and RIGTH
-
- [*****
- case 1:
- -----LEFT--------DEST------------RIGTH----
- <-----D---->
- <--O->
- <---------------T------------>
- ****]
- [*****
- case 2:
- -----LEFT--------DEST------------RIGTH----
- <-----D---->
- <--------O-------->
- <---------------T------------>
- ****]
- [*****
- case 3:
- -------DEST-----LEFT-------------RIGTH----
- ****]
- */
- D = (DEST - LEFT);
- T = (RIGTH - LEFT);
- O = offset;
-
- if( D>=0 && O<=D ){
- /* case 1: easy case */
- position = (DEST-O);
- }
- else if( D>=0 && O>D ){
- /* case 2: */
- double PAD = (D + ((ceil(((double)O-(double)D)/(double)T))*T))-O;
- position = LEFT+(int32_t)PAD;
- }
- else if( D<0 ){
- /* case 3: */
- position = DEST-O;
- }
-
- /* Check position */
- if(position<0){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
-
- /* EXEC_INST__COPY_LITERAL */
- GET_2BYTES_VAL(destination, destination_index);
- if(tcomp_udvm_bytecopy_self(udvm, &destination_index, position, length) == tsk_true){
- SET_2BYTES_VAL(destination, destination_index);
- }
- else{
- return tsk_false;
- }
-
- return tsk_true;
+ uint32_t DEST, LEFT, RIGTH;
+ int32_t position = -1;
+ uint32_t destination_index;
+
+ int32_t D, T;
+ int32_t O;
+
+ CONSUME_CYCLES(1+length);
+
+ GET_2BYTES_VAL(destination, DEST);
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_LEFT_INDEX, LEFT);
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_BYTE_COPY_RIGHT_INDEX, RIGTH);
+
+ /*
+ DEST: ses
+ D: distance between LEFT and DEST
+ O: offset
+ T: total size between LEFT and RIGTH
+
+ [*****
+ case 1:
+ -----LEFT--------DEST------------RIGTH----
+ <-----D---->
+ <--O->
+ <---------------T------------>
+ ****]
+ [*****
+ case 2:
+ -----LEFT--------DEST------------RIGTH----
+ <-----D---->
+ <--------O-------->
+ <---------------T------------>
+ ****]
+ [*****
+ case 3:
+ -------DEST-----LEFT-------------RIGTH----
+ ****]
+ */
+ D = (DEST - LEFT);
+ T = (RIGTH - LEFT);
+ O = offset;
+
+ if( D>=0 && O<=D ) {
+ /* case 1: easy case */
+ position = (DEST-O);
+ }
+ else if( D>=0 && O>D ) {
+ /* case 2: */
+ double PAD = (D + ((ceil(((double)O-(double)D)/(double)T))*T))-O;
+ position = LEFT+(int32_t)PAD;
+ }
+ else if( D<0 ) {
+ /* case 3: */
+ position = DEST-O;
+ }
+
+ /* Check position */
+ if(position<0) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+
+ /* EXEC_INST__COPY_LITERAL */
+ GET_2BYTES_VAL(destination, destination_index);
+ if(tcomp_udvm_bytecopy_self(udvm, &destination_index, position, length) == tsk_true) {
+ SET_2BYTES_VAL(destination, destination_index);
+ }
+ else {
+ return tsk_false;
+ }
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -984,46 +997,46 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__COPY_OFFSET(tcomp_udvm_t *udvm, uint32_t offset
/// @date 11/27/2009
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param address The destination address.
-/// @param length The number of 1-byte values to set.
-/// @param start_value The starting value.
-/// @param offset The offset used for computation.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param address The destination address.
+/// @param length The number of 1-byte values to set.
+/// @param start_value The starting value.
+/// @param offset The offset used for computation.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__MEMSET(tcomp_udvm_t *udvm, uint32_t address, uint32_t length, uint32_t start_value, uint32_t offset)
{
- uint8_t* seqs_temp;
- uint32_t n;
- tsk_bool_t ok;
-
- CONSUME_CYCLES(1+length);
-
- /*
- * The values Seq[0] to Seq[length - 1] inclusive are each interpreted
- * as a single byte, and then concatenated to form a byte string where
- * the first byte has value Seq[0], the second byte has value Seq[1] and
- * so on up to the last byte which has value Seq[length - 1].
- */
- seqs_temp = tsk_calloc(length, sizeof(uint8_t));
- if(!seqs_temp){
- return tsk_false;
- }
-
- for(n=0; n < length; n++){
- seqs_temp[n] = (start_value + n * offset)%256;
- }
- /*
- * The string is then byte copied into the UDVM memory beginning at the
- * memory address specified as an operand to the MEMSET instruction,
- * obeying the rules of Section 8.4.
- */
- ok = tcomp_udvm_bytecopy_to(udvm, address, seqs_temp, length);
-
- TSK_FREE(seqs_temp);
-
- return ok;
+ uint8_t* seqs_temp;
+ uint32_t n;
+ tsk_bool_t ok;
+
+ CONSUME_CYCLES(1+length);
+
+ /*
+ * The values Seq[0] to Seq[length - 1] inclusive are each interpreted
+ * as a single byte, and then concatenated to form a byte string where
+ * the first byte has value Seq[0], the second byte has value Seq[1] and
+ * so on up to the last byte which has value Seq[length - 1].
+ */
+ seqs_temp = tsk_calloc(length, sizeof(uint8_t));
+ if(!seqs_temp) {
+ return tsk_false;
+ }
+
+ for(n=0; n < length; n++) {
+ seqs_temp[n] = (start_value + n * offset)%256;
+ }
+ /*
+ * The string is then byte copied into the UDVM memory beginning at the
+ * memory address specified as an operand to the MEMSET instruction,
+ * obeying the rules of Section 8.4.
+ */
+ ok = tcomp_udvm_bytecopy_to(udvm, address, seqs_temp, length);
+
+ TSK_FREE(seqs_temp);
+
+ return ok;
}
/**
@@ -1032,27 +1045,27 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__MEMSET(tcomp_udvm_t *udvm, uint32_t address, ui
* This instruction moves program execution to the specified memory address.
* Decompression failure occurs if the value of the address operand lies
* beyond the overall UDVM memory size.
-* @param [in,out] udvm The udvm state machine entity.
+* @param [in,out] udvm The udvm state machine entity.
* @param address defines the address to jump to
* @retval 1 if succeed, otherwise returns 0
*/
tsk_bool_t TCOMP_UDVM_EXEC_INST__JUMP(tcomp_udvm_t *udvm, int16_t address)
{
- int callback = (address >=0 );
- CONSUME_CYCLES(callback?0:1);
+ int callback = (address >=0 );
+ CONSUME_CYCLES(callback?0:1);
- if(!callback){
- address = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- }
-
- if(address > (int32_t)TCOMP_UDVM_GET_SIZE()){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- udvm->executionPointer = address;
+ if(!callback) {
+ address = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ }
+
+ if(address > (int32_t)TCOMP_UDVM_GET_SIZE()) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ udvm->executionPointer = address;
- return tsk_true;
+ return tsk_true;
}
@@ -1060,45 +1073,45 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__JUMP(tcomp_udvm_t *udvm, int16_t address)
*
* @brief <i>COMPARE(%value_1, %value_2, \@address_1, \@address_2, \@address_3)</i><br><br>
* Reference: RFC3320 Section 9.3.2<br>
- *
+ *
* This instruction compares two operands and then jumps to one of three specified
* memory addresses depending on the result.<br>
* if(value_1 < value_2) --> address_1<br>
* elif(value_1 = value_2) --> address_2<br>
- * elif(value_1 > value_2) --> address_3. <br>
+ * elif(value_1 > value_2) --> address_3. <br>
*
*
- * @param [in,out] udvm The udvm state machine entity.
- * @param value_1 The first value to compare.
- * @param value_2 The second value to compare.
- * @param address_1 The address to jump to if (value_1 < value_2).
- * @param address_2 The address to jump to if (value_1 = value_2).
- * @param address_3 address to jump to if (value_1 > value_2).
+ * @param [in,out] udvm The udvm state machine entity.
+ * @param value_1 The first value to compare.
+ * @param value_2 The second value to compare.
+ * @param address_1 The address to jump to if (value_1 < value_2).
+ * @param address_2 The address to jump to if (value_1 = value_2).
+ * @param address_3 address to jump to if (value_1 > value_2).
* @retval 1 if succeed, otherwise returns 0.
**/
tsk_bool_t TCOMP_UDVM_EXEC_INST__COMPARE(tcomp_udvm_t *udvm, uint32_t value_1, uint32_t value_2, uint32_t address_1, uint32_t address_2, uint32_t address_3)
{
- tsk_bool_t ok = 1;
+ tsk_bool_t ok = 1;
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- if(value_1 < value_2){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_1);
- goto end;
- }
+ if(value_1 < value_2) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_1);
+ goto end;
+ }
- if(value_1 == value_2){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_2);
- goto end;
- }
+ if(value_1 == value_2) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_2);
+ goto end;
+ }
- if(value_1 > value_2){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_3);
- goto end;
- }
+ if(value_1 > value_2) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address_3);
+ goto end;
+ }
end:
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1106,21 +1119,21 @@ end:
///
/// @brief <i>CALL(\@address)</i><br><br>
/// Reference: RFC3320 Section 9.3.3<br>
-/// This instruction finds the memory address of the instruction immediately following
-/// the CALL instruction and pushes this 2-byte value on the stack, ready for later retrieval.
-/// It then continues instruction execution at the memory address specified by the address operand..
+/// This instruction finds the memory address of the instruction immediately following
+/// the CALL instruction and pushes this 2-byte value on the stack, ready for later retrieval.
+/// It then continues instruction execution at the memory address specified by the address operand..
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param address The next address.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param address The next address.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__CALL(tcomp_udvm_t *udvm, uint32_t address)
{
- CONSUME_CYCLES(1);
+ CONSUME_CYCLES(1);
- return TCOMP_UDVM_EXEC_INST__PUSH(udvm, udvm->executionPointer)
- && TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
+ return TCOMP_UDVM_EXEC_INST__PUSH(udvm, udvm->executionPointer)
+ && TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1128,25 +1141,25 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__CALL(tcomp_udvm_t *udvm, uint32_t address)
///
/// @brief <i>RETURN</i><br><br>
/// Reference: RFC3320 Section 9.3.3<br>
-/// This instruction pops a value from the stack and then continues instruction
-/// execution at the memory address just popped..
+/// This instruction pops a value from the stack and then continues instruction
+/// execution at the memory address just popped..
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
///
-/// @retval True if succeed, otherwise return false .
+/// @retval True if succeed, otherwise return false .
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__RETURN(tcomp_udvm_t *udvm)
{
- uint32_t value = 0;
- tsk_bool_t ok = tsk_true;
+ uint32_t value = 0;
+ tsk_bool_t ok = tsk_true;
- CONSUME_CYCLES(1);
-
- if( (ok = TCOMP_UDVM_EXEC_INST__POP(udvm, &value)) ){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, value);
- }
+ CONSUME_CYCLES(1);
+
+ if( (ok = TCOMP_UDVM_EXEC_INST__POP(udvm, &value)) ) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, value);
+ }
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1156,40 +1169,40 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__RETURN(tcomp_udvm_t *udvm)
/// Reference: RFC3320 Section 9.3.4<br>
/// This instruction performs a conditional jump based on the value of one of its operands.
/// Decompression failure occurs if j specifies a value of n or more, or
-/// if the address lies beyond the overall UDVM memory size..
+/// if the address lies beyond the overall UDVM memory size..
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param n The number of possibilities.
-/// @param j The possibility.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param n The number of possibilities.
+/// @param j The possibility.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__SWITCH(tcomp_udvm_t *udvm, uint32_t n, uint32_t j)
{
- uint32_t next = 0;
- tsk_bool_t ok = tsk_true;
+ uint32_t next = 0;
+ tsk_bool_t ok = tsk_true;
- CONSUME_CYCLES(1+n);
+ CONSUME_CYCLES(1+n);
- /* Decompression failure occurs if j specifies a value of n or more. */
- if(j >= n){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SWITCH_VALUE_TOO_HIGH].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SWITCH_VALUE_TOO_HIGH);
- ok = tsk_false;
- goto end;
- }
+ /* Decompression failure occurs if j specifies a value of n or more. */
+ if(j >= n) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SWITCH_VALUE_TOO_HIGH].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SWITCH_VALUE_TOO_HIGH);
+ ok = tsk_false;
+ goto end;
+ }
- do{
- next = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
- }
- while(j--);
+ do {
+ next = tcomp_udvm_opget_address_param(udvm, udvm->last_memory_address_of_instruction);
+ }
+ while(j--);
end:
- if(ok){
- ok = TCOMP_UDVM_EXEC_INST__JUMP(udvm, next);
- }
+ if(ok) {
+ ok = TCOMP_UDVM_EXEC_INST__JUMP(udvm, next);
+ }
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1198,9 +1211,9 @@ end:
/// @brief <i>CRC(%value, %position, %length, \@address)</i><br><br>
/// Reference: RFC3320 Section 9.3.5<br>
/// This instruction verifies a string of bytes using a 2-byte CRC.
-/// The CRC value is computed exactly as defined for the 16-bit FCS calculation in [RFC-1662]..
+/// The CRC value is computed exactly as defined for the 16-bit FCS calculation in [RFC-1662]..
///
-/// @param [in,out] udvm The udvm state machine entity.
+/// @param [in,out] udvm The udvm state machine entity.
/// @param value Contains the expected integer value of the 2-byte CRC.
/// @param position Defines the position of the string of bytes over which the CRC is evaluated.
/// @param length Defines the length of the string of bytes over which the CRC is evaluated.
@@ -1210,42 +1223,42 @@ end:
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__CRC(tcomp_udvm_t *udvm, uint32_t value, uint32_t position, uint32_t length, uint32_t address)
{
- uint32_t crc_value;
-
- CONSUME_CYCLES(1 + length);
-
- if(udvm->tmp_buff.size < length){
- if(!(udvm->tmp_buff.ptr = tsk_realloc(udvm->tmp_buff.ptr, length))){
- udvm->tmp_buff.size = 0;
- tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc);
- return tsk_false;
- }
- udvm->tmp_buff.size = length;
- }
-
- /* copy data */
- if(!tcomp_udvm_bytecopy_from(udvm, udvm->tmp_buff.ptr, position, length)){
- return tsk_false;
- }
-
- /*
- * The CRC value is computed exactly as defined for the 16-bit FCS
- * calculation in [RFC-1662]
- */
- crc_value = tsk_pppfcs16(TSK_PPPINITFCS16, udvm->tmp_buff.ptr, length);
-
- /*
- * If the calculated CRC matches the expected value then the UDVM
- * continues instruction execution at the following instruction.
- * Otherwise the UDVM jumps to the memory address specified by the
- * address operand.
- */
- if(value != crc_value){
- TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
- }
-
- return tsk_true;
+ uint32_t crc_value;
+
+ CONSUME_CYCLES(1 + length);
+
+ if(udvm->tmp_buff.size < length) {
+ if(!(udvm->tmp_buff.ptr = tsk_realloc(udvm->tmp_buff.ptr, length))) {
+ udvm->tmp_buff.size = 0;
+ tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc);
+ return tsk_false;
+ }
+ udvm->tmp_buff.size = length;
+ }
+
+ /* copy data */
+ if(!tcomp_udvm_bytecopy_from(udvm, udvm->tmp_buff.ptr, position, length)) {
+ return tsk_false;
+ }
+
+ /*
+ * The CRC value is computed exactly as defined for the 16-bit FCS
+ * calculation in [RFC-1662]
+ */
+ crc_value = tsk_pppfcs16(TSK_PPPINITFCS16, udvm->tmp_buff.ptr, length);
+
+ /*
+ * If the calculated CRC matches the expected value then the UDVM
+ * continues instruction execution at the following instruction.
+ * Otherwise the UDVM jumps to the memory address specified by the
+ * address operand.
+ */
+ if(value != crc_value) {
+ TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
+ }
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1253,51 +1266,51 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__CRC(tcomp_udvm_t *udvm, uint32_t value, uint32_
///
/// @brief <i>INPUT-BYTES (%length, %destination, \@address)</i><br><br>
/// Reference: RFC3320 Section 9.4.2<br>
-/// This instruction requests a certain number of bytes of compressed data from the decompressor dispatcher.
+/// This instruction requests a certain number of bytes of compressed data from the decompressor dispatcher.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param length Indicates the requested number of bytes of compressed data.
-/// @param destination Specifies the starting memory address to which they should be copied.
-/// @param address Defines the address to jump to if the instruction requests data that lies beyond the end of the SigComp message.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param length Indicates the requested number of bytes of compressed data.
+/// @param destination Specifies the starting memory address to which they should be copied.
+/// @param address Defines the address to jump to if the instruction requests data that lies beyond the end of the SigComp message.
///
/// @retval True if succeed, otherwise return false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__INPUT_BYTES(tcomp_udvm_t *udvm, uint32_t length, uint32_t destination, uint32_t address)
{
- tsk_bool_t ok = tsk_true;
- const uint8_t* compressedDataAddress;
- uint8_t* destinationAddress;
-
- CONSUME_CYCLES(1+length);
-
- /*
- * If the INPUT-BYTES is encountered after an INPUT-BITS or an INPUT-
- * HUFFMAN instruction has been used, and the dispatcher currently holds
- * a fraction of a byte, then the fraction MUST be discarded before any
- * data is passed to the UDVM. The first byte to be passed is the byte
- * immediately following the discarded data.
- */
- tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
-
- compressedDataAddress = tcomp_buffer_readBytes(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
- destinationAddress = TCOMP_UDVM_GET_BUFFER_AT(destination);
- if(compressedDataAddress){
- ok &= tcomp_udvm_bytecopy_to(udvm, destination, compressedDataAddress, length);
- if(ok){
- /* FIXME: (8 * n + 1000) * cycles_per_bit */
- udvm->maximum_UDVM_cycles += ((8 * length /*+ 1000*/) * udvm->stateHandler->sigcomp_parameters->cpbValue);
- }
- }
- else{
- /*
- * If the instruction requests data that lies beyond the end of the
- * SigComp message, no data is returned. Instead the UDVM moves program
- * execution to the address specified by the address operand.
- */
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
- }
-
- return ok;
+ tsk_bool_t ok = tsk_true;
+ const uint8_t* compressedDataAddress;
+ uint8_t* destinationAddress;
+
+ CONSUME_CYCLES(1+length);
+
+ /*
+ * If the INPUT-BYTES is encountered after an INPUT-BITS or an INPUT-
+ * HUFFMAN instruction has been used, and the dispatcher currently holds
+ * a fraction of a byte, then the fraction MUST be discarded before any
+ * data is passed to the UDVM. The first byte to be passed is the byte
+ * immediately following the discarded data.
+ */
+ tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
+
+ compressedDataAddress = tcomp_buffer_readBytes(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
+ destinationAddress = TCOMP_UDVM_GET_BUFFER_AT(destination);
+ if(compressedDataAddress) {
+ ok &= tcomp_udvm_bytecopy_to(udvm, destination, compressedDataAddress, length);
+ if(ok) {
+ /* FIXME: (8 * n + 1000) * cycles_per_bit */
+ udvm->maximum_UDVM_cycles += ((8 * length /*+ 1000*/) * udvm->stateHandler->sigcomp_parameters->cpbValue);
+ }
+ }
+ else {
+ /*
+ * If the instruction requests data that lies beyond the end of the
+ * SigComp message, no data is returned. Instead the UDVM moves program
+ * execution to the address specified by the address operand.
+ */
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
+ }
+
+ return ok;
}
/**
@@ -1308,7 +1321,7 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__INPUT_BYTES(tcomp_udvm_t *udvm, uint32_t length
* compressed data from the decompressor dispatcher.
*
*
- * @param [in,out] udvm The udvm state machine entity.
+ * @param [in,out] udvm The udvm state machine entity.
* @param length The length operand indicates the requested number of bits.
Decompression failure occurs if this operand does not lie between 0
and 16 inclusive.
@@ -1317,109 +1330,109 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__INPUT_BYTES(tcomp_udvm_t *udvm, uint32_t length
interpreted as a 2-byte integer ranging from 0 to 2^length - 1, as
explained in Section 8.2.
- * @param address The address of the destination.
+ * @param address The address of the destination.
*
- * @retval 1 if succeed, otherwise returns 0.
+ * @retval 1 if succeed, otherwise returns 0.
**/
tsk_bool_t TCOMP_UDVM_EXEC_INST__INPUT_BITS(tcomp_udvm_t *udvm, uint32_t length, uint32_t destination, uint32_t address)
{
- tsk_bool_t ok = tsk_true;
- uint32_t input_bit_order, reserved;
- uint8_t F_BIT, P_BIT;
- uint8_t* old_P_BIT;
-
- /*
- The input_bit_order register contains the following three flags:
- 0 7 8 15
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | reserved |F|H|P| 68 - 69
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- CONSUME_CYCLES(1);
-
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_INPUT_BIT_ORDER_INDEX, input_bit_order);
- reserved = (input_bit_order & 0xf8);
- /*
- * Decompression failure occurs if an INPUT-BITS or an INPUT-HUFFMAN
- * instruction is encountered and the input_bit_order register does not
- * lie between 0 and 7 inclusive.
- */
- if(reserved){
- /* MUST BE ZEROS --> Only 3bits --> [0-7] */
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_BAD_INPUT_BITORDER].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_BAD_INPUT_BITORDER);
- return tsk_false;
- }
-
- /* F and P BITS */
- F_BIT = (input_bit_order & 0x0004) ? 1 : 0;
- P_BIT = (input_bit_order & 0x0001);
-
- /*
- * Decompression failure occurs if this operand (length) does not lie between 0
- * and 16 inclusive.
- */
- if(/*length<0 ||*/ length>16){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_OPERAND].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
- return tsk_false;
- }
-
- /*
- * P:The P-bit controls the order in which bits are passed from the
- * dispatcher to the INPUT instructions
- * P=0 --> MSB_TO_LSB
- * P=1 --> LSB_TO_MSB
- */
- old_P_BIT = tcomp_buffer_getP_BIT(udvm->sigCompMessage->remaining_sigcomp_buffer);
- if(*old_P_BIT != P_BIT){
- /*
- * If the P-bit has changed since the last INPUT instruction, any fraction of a
- * byte still held by the dispatcher MUST be discarded (even if the
- * INPUT instruction requests zero bits)
- */
- tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
- *old_P_BIT = P_BIT;
- }
-
- /*
- * If the instruction requests data that lies beyond the end of the
- * SigComp message, no data is returned. Instead the UDVM moves program
- * execution to the address specified by the address operand.
- */
- if( (length) > tcomp_buffer_getRemainingBits(udvm->sigCompMessage->remaining_sigcomp_buffer) ){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
- goto end;
- }
-
- /*
- * If the F-bit is set to 0, the INPUT-BITS instruction interprets the
- * received bits as arriving MSBs first, and if it is set to 1, it interprets the bits as arriving LSBs first.
- * F=0 --> MSB_TO_LSB
- * F=1 --> LSB_TO_MSB
- */
- if(P_BIT == TCOMP_P_BIT_MSB_TO_LSB){
- /* MSB_TO_LSB */
- uint32_t value = tcomp_buffer_readMsbToLsb(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
- if(F_BIT == F_BIT_LSB_TO_MSB){
- value = (TSK_BINARY_REVERSE_2BYTE(value)>>(16-length));
- }
- SET_2BYTES_VAL(destination, value);
- }
- else{
- /* LSB_TO_MSB */
- uint32_t value = tcomp_buffer_readLsbToMsb(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
- if(F_BIT == F_BIT_LSB_TO_MSB) {
- value = (TSK_BINARY_REVERSE_2BYTE(value)>>(16-length));
- }
- SET_2BYTES_VAL(destination, value);
- }
+ tsk_bool_t ok = tsk_true;
+ uint32_t input_bit_order, reserved;
+ uint8_t F_BIT, P_BIT;
+ uint8_t* old_P_BIT;
+
+ /*
+ The input_bit_order register contains the following three flags:
+ 0 7 8 15
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | reserved |F|H|P| 68 - 69
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ CONSUME_CYCLES(1);
+
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_INPUT_BIT_ORDER_INDEX, input_bit_order);
+ reserved = (input_bit_order & 0xf8);
+ /*
+ * Decompression failure occurs if an INPUT-BITS or an INPUT-HUFFMAN
+ * instruction is encountered and the input_bit_order register does not
+ * lie between 0 and 7 inclusive.
+ */
+ if(reserved) {
+ /* MUST BE ZEROS --> Only 3bits --> [0-7] */
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_BAD_INPUT_BITORDER].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_BAD_INPUT_BITORDER);
+ return tsk_false;
+ }
+
+ /* F and P BITS */
+ F_BIT = (input_bit_order & 0x0004) ? 1 : 0;
+ P_BIT = (input_bit_order & 0x0001);
+
+ /*
+ * Decompression failure occurs if this operand (length) does not lie between 0
+ * and 16 inclusive.
+ */
+ if(/*length<0 ||*/ length>16) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_OPERAND].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
+ return tsk_false;
+ }
+
+ /*
+ * P:The P-bit controls the order in which bits are passed from the
+ * dispatcher to the INPUT instructions
+ * P=0 --> MSB_TO_LSB
+ * P=1 --> LSB_TO_MSB
+ */
+ old_P_BIT = tcomp_buffer_getP_BIT(udvm->sigCompMessage->remaining_sigcomp_buffer);
+ if(*old_P_BIT != P_BIT) {
+ /*
+ * If the P-bit has changed since the last INPUT instruction, any fraction of a
+ * byte still held by the dispatcher MUST be discarded (even if the
+ * INPUT instruction requests zero bits)
+ */
+ tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
+ *old_P_BIT = P_BIT;
+ }
+
+ /*
+ * If the instruction requests data that lies beyond the end of the
+ * SigComp message, no data is returned. Instead the UDVM moves program
+ * execution to the address specified by the address operand.
+ */
+ if( (length) > tcomp_buffer_getRemainingBits(udvm->sigCompMessage->remaining_sigcomp_buffer) ) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
+ goto end;
+ }
+
+ /*
+ * If the F-bit is set to 0, the INPUT-BITS instruction interprets the
+ * received bits as arriving MSBs first, and if it is set to 1, it interprets the bits as arriving LSBs first.
+ * F=0 --> MSB_TO_LSB
+ * F=1 --> LSB_TO_MSB
+ */
+ if(P_BIT == TCOMP_P_BIT_MSB_TO_LSB) {
+ /* MSB_TO_LSB */
+ uint32_t value = tcomp_buffer_readMsbToLsb(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
+ if(F_BIT == F_BIT_LSB_TO_MSB) {
+ value = (TSK_BINARY_REVERSE_2BYTE(value)>>(16-length));
+ }
+ SET_2BYTES_VAL(destination, value);
+ }
+ else {
+ /* LSB_TO_MSB */
+ uint32_t value = tcomp_buffer_readLsbToMsb(udvm->sigCompMessage->remaining_sigcomp_buffer, length);
+ if(F_BIT == F_BIT_LSB_TO_MSB) {
+ value = (TSK_BINARY_REVERSE_2BYTE(value)>>(16-length));
+ }
+ SET_2BYTES_VAL(destination, value);
+ }
end:
-
- udvm->maximum_UDVM_cycles += (length * udvm->stateHandler->sigcomp_parameters->cpbValue);
- return ok;
+
+ udvm->maximum_UDVM_cycles += (length * udvm->stateHandler->sigcomp_parameters->cpbValue);
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1427,170 +1440,170 @@ end:
///
/// @brief <i>INPUT-HUFFMAN(%destination, \@address, \#n, %bits_1, %lower_bound_1, %upper_bound_1, %uncompressed_1, ... , %bits_n, %lower_bound_n, %upper_bound_n, %uncompressed_n)</i><br><br>
/// Reference: RFC3320 Section 9.4.4<br>
-///
+///
/// This instruction requests a variable number of bits of compressed data from the decompressor dispatcher. The instruction
/// initially requests a small number of bits and compares the result against a certain criterion; if the criterion is not met, then
-/// additional bits are requested until the criterion is achieved.
+/// additional bits are requested until the criterion is achieved.
///
-/// @param [in,out] udvm The udvm state machine entity.
-/// @param destination The udvm destination address.
-/// @param address Address to jump to if data is requested that lies beyond the end of the SigComp message.
-/// @param n Additional sets of operands count.
+/// @param [in,out] udvm The udvm state machine entity.
+/// @param destination The udvm destination address.
+/// @param address Address to jump to if data is requested that lies beyond the end of the SigComp message.
+/// @param n Additional sets of operands count.
///
-/// @retval True if succeed, otherwise return false.
+/// @retval True if succeed, otherwise return false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__INPUT_HUFFMAN(tcomp_udvm_t *udvm, uint32_t destination, uint32_t address, uint32_t n)
{
- /*
- The input_bit_order register contains the following three flags:
- 0 7 8 15
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | reserved |F|H|P| 68 - 69
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- tsk_bool_t ok = tsk_true;
- uint32_t input_bit_order, reserved;
- uint8_t H_BIT, P_BIT, *old_P_BIT;
-
- uint32_t bits_j, lower_bound_j, upper_bound_j, uncompressed_j;
- uint32_t bits_total = 0, k = 0, H, J;
- tsk_bool_t criterion_ok = tsk_false;
-
- CONSUME_CYCLES(1+n);
-
- /*Note that if n = 0 then the INPUT-HUFFMAN instruction is ignored and
- program execution resumes at the following instruction.*/
- if(n == 0){
- //goto end;
- return ok;
- }
-
- GET_2BYTES_VAL(TCOMP_UDVM_HEADER_INPUT_BIT_ORDER_INDEX, input_bit_order);
- reserved = (input_bit_order & 0xf8);
- /*
- * Decompression failure occurs if an INPUT-BITS or an INPUT-HUFFMAN
- * instruction is encountered and the input_bit_order register does not
- * lie between 0 and 7 inclusive.
- */
- if(reserved){
- /* MUST BE ZEROS --> Only 3bits --> [0-7] */
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_BAD_INPUT_BITORDER].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_BAD_INPUT_BITORDER);
- return tsk_false;
- }
-
- /* H and P */
- H_BIT = (input_bit_order & 0x0002)?1:0;
- P_BIT = (input_bit_order & 0x0001);
-
- /*
- * P:The P-bit controls the order in which bits are passed from the
- * dispatcher to the INPUT instructions
- * P=0 --> MSB_TO_LSB
- * P=1 --> LSB_TO_MSB
- */
- old_P_BIT = tcomp_buffer_getP_BIT(udvm->sigCompMessage->remaining_sigcomp_buffer);
- if( *old_P_BIT != P_BIT ){
- /*
- * If the P-bit has changed since the last INPUT instruction, any fraction of a
- * byte still held by the dispatcher MUST be discarded (even if the
- * INPUT instruction requests zero bits)
- */
- tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
- *old_P_BIT = P_BIT;
- }
-
- /*
- * HUFFMAN COMPUTATION
- */
-
- /* 1. Set j := 1 and set H := 0. */
- for(J = 1, H = 0; J<=n; J++){
- /*
- * Request bits_j compressed bits. Interpret the returned bits as an
- * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2.
- */
- bits_j = tcomp_udvm_opget_multitype_param(udvm);
- lower_bound_j = tcomp_udvm_opget_multitype_param(udvm);
- upper_bound_j = tcomp_udvm_opget_multitype_param(udvm);
- uncompressed_j = tcomp_udvm_opget_multitype_param(udvm);
- bits_total += bits_j;
-
- /*Decompression failure occurs if (bits_1 + ... + bits_n) > 16.*/
- if(bits_total > 16){
- ok = tsk_false;
- // FIXME: DECOMPRESSION failure TOO_MANY_BITS_REQUESTED
- goto end;
- }
-
- if(criterion_ok){
- continue;
- }
+ /*
+ The input_bit_order register contains the following three flags:
+ 0 7 8 15
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | reserved |F|H|P| 68 - 69
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ tsk_bool_t ok = tsk_true;
+ uint32_t input_bit_order, reserved;
+ uint8_t H_BIT, P_BIT, *old_P_BIT;
+
+ uint32_t bits_j, lower_bound_j, upper_bound_j, uncompressed_j;
+ uint32_t bits_total = 0, k = 0, H, J;
+ tsk_bool_t criterion_ok = tsk_false;
+
+ CONSUME_CYCLES(1+n);
+
+ /*Note that if n = 0 then the INPUT-HUFFMAN instruction is ignored and
+ program execution resumes at the following instruction.*/
+ if(n == 0) {
+ //goto end;
+ return ok;
+ }
+
+ GET_2BYTES_VAL(TCOMP_UDVM_HEADER_INPUT_BIT_ORDER_INDEX, input_bit_order);
+ reserved = (input_bit_order & 0xf8);
+ /*
+ * Decompression failure occurs if an INPUT-BITS or an INPUT-HUFFMAN
+ * instruction is encountered and the input_bit_order register does not
+ * lie between 0 and 7 inclusive.
+ */
+ if(reserved) {
+ /* MUST BE ZEROS --> Only 3bits --> [0-7] */
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_BAD_INPUT_BITORDER].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_BAD_INPUT_BITORDER);
+ return tsk_false;
+ }
+
+ /* H and P */
+ H_BIT = (input_bit_order & 0x0002)?1:0;
+ P_BIT = (input_bit_order & 0x0001);
+
+ /*
+ * P:The P-bit controls the order in which bits are passed from the
+ * dispatcher to the INPUT instructions
+ * P=0 --> MSB_TO_LSB
+ * P=1 --> LSB_TO_MSB
+ */
+ old_P_BIT = tcomp_buffer_getP_BIT(udvm->sigCompMessage->remaining_sigcomp_buffer);
+ if( *old_P_BIT != P_BIT ) {
+ /*
+ * If the P-bit has changed since the last INPUT instruction, any fraction of a
+ * byte still held by the dispatcher MUST be discarded (even if the
+ * INPUT instruction requests zero bits)
+ */
+ tcomp_buffer_discardBits(udvm->sigCompMessage->remaining_sigcomp_buffer);
+ *old_P_BIT = P_BIT;
+ }
+
+ /*
+ * HUFFMAN COMPUTATION
+ */
+
+ /* 1. Set j := 1 and set H := 0. */
+ for(J = 1, H = 0; J<=n; J++) {
+ /*
+ * Request bits_j compressed bits. Interpret the returned bits as an
+ * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2.
+ */
+ bits_j = tcomp_udvm_opget_multitype_param(udvm);
+ lower_bound_j = tcomp_udvm_opget_multitype_param(udvm);
+ upper_bound_j = tcomp_udvm_opget_multitype_param(udvm);
+ uncompressed_j = tcomp_udvm_opget_multitype_param(udvm);
+ bits_total += bits_j;
+
+ /*Decompression failure occurs if (bits_1 + ... + bits_n) > 16.*/
+ if(bits_total > 16) {
+ ok = tsk_false;
+ // FIXME: DECOMPRESSION failure TOO_MANY_BITS_REQUESTED
+ goto end;
+ }
+
+ if(criterion_ok) {
+ continue;
+ }
//==step_4:
- /*
- * 4.If data is requested that lies beyond the end of the SigComp
- * message, terminate the INPUT-HUFFMAN instruction and move program
- * execution to the memory address specified by the address operand.
- */
- if( (bits_j) > tcomp_buffer_getRemainingBits(udvm->sigCompMessage->remaining_sigcomp_buffer) ){
- ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
- goto end;
- }
+ /*
+ * 4.If data is requested that lies beyond the end of the SigComp
+ * message, terminate the INPUT-HUFFMAN instruction and move program
+ * execution to the memory address specified by the address operand.
+ */
+ if( (bits_j) > tcomp_buffer_getRemainingBits(udvm->sigCompMessage->remaining_sigcomp_buffer) ) {
+ ok &= TCOMP_UDVM_EXEC_INST__JUMP(udvm, address);
+ goto end;
+ }
//==step_2:
- /*
- * 2. Request bits_j compressed bits. Interpret the returned bits as an
- * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2.
- */
- if(P_BIT == TCOMP_P_BIT_MSB_TO_LSB){
- k = tcomp_buffer_readMsbToLsb(udvm->sigCompMessage->remaining_sigcomp_buffer, bits_j);
- if(H_BIT == H_BIT_LSB_TO_MSB) {
- k = (TSK_BINARY_REVERSE_2BYTE(k)>>(16-bits_j));
- }
- }
- else{
- k = tcomp_buffer_readLsbToMsb(udvm->sigCompMessage->remaining_sigcomp_buffer, bits_j);
- if(H_BIT == H_BIT_LSB_TO_MSB){
- k = (TSK_BINARY_REVERSE_2BYTE(k)>>(16-bits_j));
- }
- }
+ /*
+ * 2. Request bits_j compressed bits. Interpret the returned bits as an
+ * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2.
+ */
+ if(P_BIT == TCOMP_P_BIT_MSB_TO_LSB) {
+ k = tcomp_buffer_readMsbToLsb(udvm->sigCompMessage->remaining_sigcomp_buffer, bits_j);
+ if(H_BIT == H_BIT_LSB_TO_MSB) {
+ k = (TSK_BINARY_REVERSE_2BYTE(k)>>(16-bits_j));
+ }
+ }
+ else {
+ k = tcomp_buffer_readLsbToMsb(udvm->sigCompMessage->remaining_sigcomp_buffer, bits_j);
+ if(H_BIT == H_BIT_LSB_TO_MSB) {
+ k = (TSK_BINARY_REVERSE_2BYTE(k)>>(16-bits_j));
+ }
+ }
//==step_3:
- /* 3. Set H := H * 2^bits_j + k */
- H = H * (uint32_t)pow(2.0, bits_j) + k;
+ /* 3. Set H := H * 2^bits_j + k */
+ H = H * (uint32_t)pow(2.0, bits_j) + k;
//==step_5:
- /*
- * 5. If (H < lower_bound_j) or (H > upper_bound_j) then set j := j + 1.
- * Then go back to Step 2, unless j > n in which case decompression
- * failure occurs.
- */
- if( (H < lower_bound_j) || (H > upper_bound_j) ){
- continue;
- //goto step_2;
- }
- else{
- /*
- * Copy (H + uncompressed_j - lower_bound_j) modulo 2^16 to the
- * memory address specified by the destination operand.
- */
- H = (H + uncompressed_j - lower_bound_j) % 65536;
- criterion_ok = 1;
- }
- }
-
- if(!criterion_ok){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_HUFFMAN_NO_MATCH].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_HUFFMAN_NO_MATCH);
- ok = tsk_false;
- goto end;
- }
- else if(ok){
- SET_2BYTES_VAL(destination, H);
- udvm->maximum_UDVM_cycles += (bits_total * udvm->stateHandler->sigcomp_parameters->cpbValue);
- }
+ /*
+ * 5. If (H < lower_bound_j) or (H > upper_bound_j) then set j := j + 1.
+ * Then go back to Step 2, unless j > n in which case decompression
+ * failure occurs.
+ */
+ if( (H < lower_bound_j) || (H > upper_bound_j) ) {
+ continue;
+ //goto step_2;
+ }
+ else {
+ /*
+ * Copy (H + uncompressed_j - lower_bound_j) modulo 2^16 to the
+ * memory address specified by the destination operand.
+ */
+ H = (H + uncompressed_j - lower_bound_j) % 65536;
+ criterion_ok = 1;
+ }
+ }
+
+ if(!criterion_ok) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_HUFFMAN_NO_MATCH].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_HUFFMAN_NO_MATCH);
+ ok = tsk_false;
+ goto end;
+ }
+ else if(ok) {
+ SET_2BYTES_VAL(destination, H);
+ udvm->maximum_UDVM_cycles += (bits_total * udvm->stateHandler->sigcomp_parameters->cpbValue);
+ }
end:
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1598,119 +1611,119 @@ end:
///
/// @brief <i>STATE-ACCESS(%partial_identifier_start, %partial_identifier_length, %state_begin, %state_length, %state_address, %state_instruction)</i><br><br>
/// Reference: RFC3320 Section 9.4.5<br>
-/// This instruction retrieves some previously stored state information..
+/// This instruction retrieves some previously stored state information..
-/// @param [in,out] udvm If non-null, the udvm.
-/// @param partial_identifier_start Specifies the location of the partial state identifier used to retrieve the state information.
-/// @param partial_identifier_length Specifies the length of the partial state identifier used to retrieve the state information.
-/// @param state_begin Defines the starting byte to copy from the state_value contained in the returned item of state.
-/// @param state_length Defines the number of bytes to copy from the state_value contained in the returned item of state.
-/// @param state_address Contains a UDVM memory address.
-/// @param state_instruction Next instruction to jump to.
+/// @param [in,out] udvm If non-null, the udvm.
+/// @param partial_identifier_start Specifies the location of the partial state identifier used to retrieve the state information.
+/// @param partial_identifier_length Specifies the length of the partial state identifier used to retrieve the state information.
+/// @param state_begin Defines the starting byte to copy from the state_value contained in the returned item of state.
+/// @param state_length Defines the number of bytes to copy from the state_value contained in the returned item of state.
+/// @param state_address Contains a UDVM memory address.
+/// @param state_instruction Next instruction to jump to.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__STATE_ACCESS(tcomp_udvm_t *udvm, uint32_t partial_identifier_start, uint32_t partial_identifier_length, uint32_t state_begin, uint32_t state_length, uint32_t state_address, uint32_t state_instruction)
{
- tcomp_state_t* lpState = NULL;
- tcomp_buffer_handle_t* partial_id;
- uint32_t match_count;
-
- /*
- * Decompression failure occurs if partial_identifier_length does not
- * lie between 6 and 20 inclusive.
- */
- if(partial_identifier_length<6 || partial_identifier_length>20){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_ID_LENGTH].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
- return tsk_false;
- }
- /*
- * decompression failure will always occur if the state_length operand
- * is set to 0 but the state_begin operand is non-zero.
- */
- if(!state_length && state_begin){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_PROBE].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_PROBE);
- return tsk_false;
- }
-
- /*
- * Find matching state
- */
- partial_id = tcomp_buffer_create_null();
- tcomp_buffer_referenceBuff(partial_id, TCOMP_UDVM_GET_BUFFER_AT(partial_identifier_start), partial_identifier_length);
- match_count = tcomp_statehandler_findState(udvm->stateHandler, partial_id, &lpState);
-
- /*
- * Decompression failure occurs if no state item matching the partial state identifier can be found, if
- * more than one state item matches the partial identifier.
- */
- if(!lpState || match_count != 1){
- int32_t nack_code = (match_count > 1) ? NACK_ID_NOT_UNIQUE : NACK_STATE_NOT_FOUND;
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[nack_code].desc);
- tcomp_udvm_createNackInfo3(udvm, nack_code, partial_id);
- TSK_OBJECT_SAFE_FREE(partial_id);
- return tsk_false;
- }
- else if(partial_identifier_length < lpState->minimum_access_length){
- /*
- * Decompression failure occurs if partial_identifier_length is less than the minimum_access_length of
- * the matched state item.
- */
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_STATE_NOT_FOUND].desc);
- tcomp_udvm_createNackInfo3(udvm, NACK_STATE_NOT_FOUND, partial_id);
- TSK_OBJECT_SAFE_FREE(partial_id);
- return tsk_false;
- }
- TSK_OBJECT_SAFE_FREE(partial_id);
-
- /*
- * If any of the operands state_address, state_instruction or
- * state_length is set to 0 then its value is taken from the returned
- * item of state instead.
- */
- if(!state_address) {
- state_address = lpState->address;
- }
- if(!state_instruction) {
- state_instruction = lpState->instruction;
- }
- if(!state_length) {
- state_length = lpState->length;
- }
-
- CONSUME_CYCLES(1+state_length);
-
- /* Decompression failure occurs if bytes are copied from beyond the end of the state_value. */
- if((tsk_size_t)(state_begin + state_length) > tcomp_buffer_getSize(lpState->value)){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_STATE_TOO_SHORT].desc);
- tcomp_udvm_createNackInfo3(udvm, NACK_STATE_TOO_SHORT, partial_id);
- return tsk_false;
- }
-
- /*
- * The state_address operand contains a UDVM memory address. The
- * requested portion of the state_value is byte copied to this memory
- * address using the rules of Section 8.4.
- */
- if(tcomp_udvm_bytecopy_to(udvm, state_address, tcomp_buffer_getBufferAtPos(lpState->value, state_begin), state_length) != tsk_true){
- return tsk_false;
- }
-
- /*
- * Program execution then resumes at the memory address specified by
- * state_instruction, unless this address is 0 in which case program
- * execution resumes at the next instruction following the STATE-ACCESS
- * instruction.
- */
- if(state_instruction){
- if(!TCOMP_UDVM_EXEC_INST__JUMP(udvm, state_instruction)){
- return tsk_false;
- }
- }
-
- return tsk_true;
+ tcomp_state_t* lpState = NULL;
+ tcomp_buffer_handle_t* partial_id;
+ uint32_t match_count;
+
+ /*
+ * Decompression failure occurs if partial_identifier_length does not
+ * lie between 6 and 20 inclusive.
+ */
+ if(partial_identifier_length<6 || partial_identifier_length>20) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_ID_LENGTH].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
+ return tsk_false;
+ }
+ /*
+ * decompression failure will always occur if the state_length operand
+ * is set to 0 but the state_begin operand is non-zero.
+ */
+ if(!state_length && state_begin) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_PROBE].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_PROBE);
+ return tsk_false;
+ }
+
+ /*
+ * Find matching state
+ */
+ partial_id = tcomp_buffer_create_null();
+ tcomp_buffer_referenceBuff(partial_id, TCOMP_UDVM_GET_BUFFER_AT(partial_identifier_start), partial_identifier_length);
+ match_count = tcomp_statehandler_findState(udvm->stateHandler, partial_id, &lpState);
+
+ /*
+ * Decompression failure occurs if no state item matching the partial state identifier can be found, if
+ * more than one state item matches the partial identifier.
+ */
+ if(!lpState || match_count != 1) {
+ int32_t nack_code = (match_count > 1) ? NACK_ID_NOT_UNIQUE : NACK_STATE_NOT_FOUND;
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[nack_code].desc);
+ tcomp_udvm_createNackInfo3(udvm, nack_code, partial_id);
+ TSK_OBJECT_SAFE_FREE(partial_id);
+ return tsk_false;
+ }
+ else if(partial_identifier_length < lpState->minimum_access_length) {
+ /*
+ * Decompression failure occurs if partial_identifier_length is less than the minimum_access_length of
+ * the matched state item.
+ */
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_STATE_NOT_FOUND].desc);
+ tcomp_udvm_createNackInfo3(udvm, NACK_STATE_NOT_FOUND, partial_id);
+ TSK_OBJECT_SAFE_FREE(partial_id);
+ return tsk_false;
+ }
+ TSK_OBJECT_SAFE_FREE(partial_id);
+
+ /*
+ * If any of the operands state_address, state_instruction or
+ * state_length is set to 0 then its value is taken from the returned
+ * item of state instead.
+ */
+ if(!state_address) {
+ state_address = lpState->address;
+ }
+ if(!state_instruction) {
+ state_instruction = lpState->instruction;
+ }
+ if(!state_length) {
+ state_length = lpState->length;
+ }
+
+ CONSUME_CYCLES(1+state_length);
+
+ /* Decompression failure occurs if bytes are copied from beyond the end of the state_value. */
+ if((tsk_size_t)(state_begin + state_length) > tcomp_buffer_getSize(lpState->value)) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_STATE_TOO_SHORT].desc);
+ tcomp_udvm_createNackInfo3(udvm, NACK_STATE_TOO_SHORT, partial_id);
+ return tsk_false;
+ }
+
+ /*
+ * The state_address operand contains a UDVM memory address. The
+ * requested portion of the state_value is byte copied to this memory
+ * address using the rules of Section 8.4.
+ */
+ if(tcomp_udvm_bytecopy_to(udvm, state_address, tcomp_buffer_getBufferAtPos(lpState->value, state_begin), state_length) != tsk_true) {
+ return tsk_false;
+ }
+
+ /*
+ * Program execution then resumes at the memory address specified by
+ * state_instruction, unless this address is 0 in which case program
+ * execution resumes at the next instruction following the STATE-ACCESS
+ * instruction.
+ */
+ if(state_instruction) {
+ if(!TCOMP_UDVM_EXEC_INST__JUMP(udvm, state_instruction)) {
+ return tsk_false;
+ }
+ }
+
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1718,30 +1731,30 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__STATE_ACCESS(tcomp_udvm_t *udvm, uint32_t parti
///
/// @brief <i>STATE-CREATE (%state_length, %state_address, %state_instruction, %minimum_access_length, %state_retention_priority)</i><br><br>
/// Reference: RFC3320 Section 9.4.6<br>
-/// This instruction requests the creation of a state item at the receiving endpoint..
+/// This instruction requests the creation of a state item at the receiving endpoint..
-/// @param [in,out] udvm If non-null, the udvm.
-/// @param state_length Defines the length of the state to create.
-/// @param state_address Defines the udvm address of the state to create.
-/// @param state_instruction Defines the state instruction.
-/// @param minimum_access_length Defines the minimun access length.
-/// @param state_retention_priority Defines the state retenion priority.
+/// @param [in,out] udvm If non-null, the udvm.
+/// @param state_length Defines the length of the state to create.
+/// @param state_address Defines the udvm address of the state to create.
+/// @param state_instruction Defines the state instruction.
+/// @param minimum_access_length Defines the minimun access length.
+/// @param state_retention_priority Defines the state retenion priority.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__STATE_CREATE(tcomp_udvm_t *udvm, uint32_t state_length, uint32_t state_address, uint32_t state_instruction, uint32_t minimum_access_length, uint32_t state_retention_priority)
{
- CONSUME_CYCLES(1 + state_length);
-
- /*
- * Create temporary state?
- */
- if(!tcomp_udvm_createTempState(udvm, state_length, state_address, state_instruction,
- minimum_access_length, state_retention_priority, 0)){
- return tsk_false;
- }
+ CONSUME_CYCLES(1 + state_length);
+
+ /*
+ * Create temporary state?
+ */
+ if(!tcomp_udvm_createTempState(udvm, state_length, state_address, state_instruction,
+ minimum_access_length, state_retention_priority, 0)) {
+ return tsk_false;
+ }
- return tsk_true;
+ return tsk_true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1749,86 +1762,86 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__STATE_CREATE(tcomp_udvm_t *udvm, uint32_t state
///
/// @brief <i>STATE-FREE(%partial_identifier_start, %partial_identifier_length)</i><br><br>
/// Reference: RFC3320 Section 9.4.7<br>
-/// This instruction informs the receiving endpoint that the sender no longer wishes to use a particular state item..
+/// This instruction informs the receiving endpoint that the sender no longer wishes to use a particular state item..
-/// @param [in,out] udvm If non-null, the udvm.
-/// @param partial_identifier_start Defines the first byte address of partial start identifier.
-/// @param partial_identifier_length Defines the partial identifier length.
+/// @param [in,out] udvm If non-null, the udvm.
+/// @param partial_identifier_start Defines the first byte address of partial start identifier.
+/// @param partial_identifier_length Defines the partial identifier length.
///
-/// @retval True if succeed, otherwise return false .
+/// @retval True if succeed, otherwise return false .
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__STATE_FREE(tcomp_udvm_t *udvm, uint32_t partial_identifier_start, uint32_t partial_identifier_length)
{
- tcomp_tempstate_to_free_t *lpDesc;
-
- CONSUME_CYCLES(1);
-
- /*
- * Decompression failure MUST occur if more than four state free
- * requests are made before the END-MESSAGE instruction is encountered.
- */
- if(tcomp_result_getTempStatesToFreeSize(udvm->lpResult) >=4){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_TOO_MANY_STATE_REQUESTS].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_TOO_MANY_STATE_REQUESTS);
- return tsk_false;
- }
-
- /*
- * Decompression failure also occurs if partial_identifier_length does
- * not lie between 6 and 20 inclusive.
- */
- if(partial_identifier_length<6 || partial_identifier_length>20){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_ID_LENGTH].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
- return tsk_false;
- }
-
- lpDesc = tcomp_tempstate_to_free_create();
- lpDesc->partial_identifier_length = partial_identifier_length;
- lpDesc->partial_identifier_start = partial_identifier_start;
- tcomp_result_addTempStateToFree(udvm->lpResult, lpDesc);
-
- /*** Do not ByteCopy data, wait for END_MESSAGE --> see RFC 3320 subclause 9.4.9 **/
-
- return tsk_true;
+ tcomp_tempstate_to_free_t *lpDesc;
+
+ CONSUME_CYCLES(1);
+
+ /*
+ * Decompression failure MUST occur if more than four state free
+ * requests are made before the END-MESSAGE instruction is encountered.
+ */
+ if(tcomp_result_getTempStatesToFreeSize(udvm->lpResult) >=4) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_TOO_MANY_STATE_REQUESTS].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_TOO_MANY_STATE_REQUESTS);
+ return tsk_false;
+ }
+
+ /*
+ * Decompression failure also occurs if partial_identifier_length does
+ * not lie between 6 and 20 inclusive.
+ */
+ if(partial_identifier_length<6 || partial_identifier_length>20) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INVALID_STATE_ID_LENGTH].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
+ return tsk_false;
+ }
+
+ lpDesc = tcomp_tempstate_to_free_create();
+ lpDesc->partial_identifier_length = partial_identifier_length;
+ lpDesc->partial_identifier_start = partial_identifier_start;
+ tcomp_result_addTempStateToFree(udvm->lpResult, lpDesc);
+
+ /*** Do not ByteCopy data, wait for END_MESSAGE --> see RFC 3320 subclause 9.4.9 **/
+
+ return tsk_true;
}
/**
* @brief <i>OUTPUT (%output_start, %output_length)</i><br><br>
* Reference: RFC3320 Section 9.4.8<br>
* This instruction provides successfully decompressed data to the dispatcher.
-* @param [in,out] udvm The udvm state machine entity.
+* @param [in,out] udvm The udvm state machine entity.
* @param output_start defines the starting memory address of the byte string to be provided to the dispatcher
* @param output_length defines the length of the byte string to be provided to the dispatcher
* @retval 1 if succeed, otherwise returns 0
*/
tsk_bool_t TCOMP_UDVM_EXEC_INST__OUTPUT(tcomp_udvm_t *udvm, uint32_t output_start, uint32_t output_length)
{
- tsk_bool_t ok;
- tsk_size_t *outputbuffer_size;
-
- CONSUME_CYCLES(1+output_length);
-
- outputbuffer_size = tcomp_buffer_getIndexBytes(udvm->lpResult->output_buffer);
- if( (*outputbuffer_size + output_length) > 65536 ){
- /*
- * Decompression failure occurs if the cumulative number of bytes
- * provided to the dispatcher exceeds 65536 bytes.
- */
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_OUTPUT_OVERFLOW].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_OUTPUT_OVERFLOW);
- return tsk_false;
- }
-
- // FIXME: do it once?
- if((ok = tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBufferAtPos(udvm->lpResult->output_buffer, *outputbuffer_size), output_start, output_length))){
- *outputbuffer_size += output_length;
- }
+ tsk_bool_t ok;
+ tsk_size_t *outputbuffer_size;
+
+ CONSUME_CYCLES(1+output_length);
+
+ outputbuffer_size = tcomp_buffer_getIndexBytes(udvm->lpResult->output_buffer);
+ if( (*outputbuffer_size + output_length) > 65536 ) {
+ /*
+ * Decompression failure occurs if the cumulative number of bytes
+ * provided to the dispatcher exceeds 65536 bytes.
+ */
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_OUTPUT_OVERFLOW].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_OUTPUT_OVERFLOW);
+ return tsk_false;
+ }
+
+ // FIXME: do it once?
+ if((ok = tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBufferAtPos(udvm->lpResult->output_buffer, *outputbuffer_size), output_start, output_length))) {
+ *outputbuffer_size += output_length;
+ }
#if DEBUG || _DEBUG
- //tcomp_buffer_nprint(udvm->lpResult->output_buffer, *outputbuffer_size);
+ //tcomp_buffer_nprint(udvm->lpResult->output_buffer, *outputbuffer_size);
#endif
- return ok;
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1840,171 +1853,171 @@ tsk_bool_t TCOMP_UDVM_EXEC_INST__OUTPUT(tcomp_udvm_t *udvm, uint32_t output_star
/// handler together with any supplied feedback data.
///
/// @param [in,out] udvm Defines the requested feedback location.
-/// @param requested_feedback_location The requested feedback location.
+/// @param requested_feedback_location The requested feedback location.
/// @param returned_parameters_location Defines the returned parameters location which contains remote party capabilities.
/// @param state_length Length of the state to create.
/// @param state_address UDVM memory address of the state to create.
/// @param state_instruction Defines the state instruction.
/// @param minimum_access_length Defines the state's minimum access length.
-/// @param state_retention_priority Determines the order in which state will be deleted when the compartment exceeds its allocated state memory.
+/// @param state_retention_priority Determines the order in which state will be deleted when the compartment exceeds its allocated state memory.
///
-/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
+/// @retval @a tsk_true if succeed, otherwise returns @a tsk_false.
////////////////////////////////////////////////////////////////////////////////////////////////////
tsk_bool_t TCOMP_UDVM_EXEC_INST__END_MESSAGE(tcomp_udvm_t *udvm, uint32_t requested_feedback_location, uint32_t returned_parameters_location, uint32_t state_length, uint32_t state_address, uint32_t state_instruction, uint32_t minimum_access_length, uint32_t state_retention_priority)
{
- tsk_size_t udvm_size;
-
- CONSUME_CYCLES(1+state_length);
-
- udvm_size = TCOMP_UDVM_GET_SIZE();
-
- /*
- * Create temporary state provided by END_MESSAGE?
- */
- if(!tcomp_udvm_createTempState(udvm, state_length, state_address, state_instruction, minimum_access_length, state_retention_priority, 1)){
- return tsk_false;
- }
-
- /*
- * Byte copy all waiting STATE-FREE/STATE-CREATE/END-MESSAGE states
- */
- if(!tcomp_udvm_byteCopy_TempStates(udvm)){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
- return tsk_false;
- }
-
- /*
- * Feedback has been requested?
- */
- if(requested_feedback_location){
- uint8_t r_f_l;
- if(requested_feedback_location >= udvm_size){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- /*
- 0 1 2 3 4 5 6 7
- +---+---+---+---+---+---+---+---+
- | reserved | Q | S | I | requested_feedback_location
- +---+---+---+---+---+---+---+---+
- | |
- : requested feedback item : if Q = 1
- | |
- +---+---+---+---+---+---+---+---+
- */
- r_f_l = *TCOMP_UDVM_GET_BUFFER_AT(requested_feedback_location);
- udvm->lpResult->req_feedback->I = (r_f_l & 0x01);
- udvm->lpResult->req_feedback->S = (r_f_l & 0x02) ? 1 : 0;
- udvm->lpResult->req_feedback->Q = (r_f_l & 0x04) ? 1 : 0;
-
- requested_feedback_location++; /* skip 1-byte header */
- if(udvm->lpResult->req_feedback->Q){
- /* we have a requested feedback item */
- uint8_t r_f_i = *TCOMP_UDVM_GET_BUFFER_AT(requested_feedback_location);
- uint8_t length = 1; /* [1-128] */
- if(r_f_i & 0x80){
- /* case 2 */
- length += (r_f_i & 0x7f); /* seven last bits */
- }
-
- if(requested_feedback_location >= TCOMP_UDVM_GET_SIZE()){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- /* copy from udvm */
- // FIXME: use realloc
- tcomp_buffer_freeBuff(udvm->lpResult->req_feedback->item);
- tcomp_buffer_allocBuff(udvm->lpResult->req_feedback->item, length);
- if(!tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(udvm->lpResult->req_feedback->item), requested_feedback_location, length)){
- return tsk_false;
- }
- }
- }
-
- //
- // SigComp parameters have been returned?
- //
- if(returned_parameters_location){
- uint8_t r_p_l, SigComp_version;
- uint32_t index;
- tcomp_buffer_handle_t *partial_id;
-
- /*
- 0 1 2 3 4 5 6 7
- +---+---+---+---+---+---+---+---+
- | cpb | dms | sms | returned_parameters_location
- +---+---+---+---+---+---+---+---+
- | SigComp_version |
- +---+---+---+---+---+---+---+---+
- | length_of_partial_state_ID_1 |
- +---+---+---+---+---+---+---+---+
- | |
- : partial_state_identifier_1 :
- | |
- +---+---+---+---+---+---+---+---+
- : :
- +---+---+---+---+---+---+---+---+
- | length_of_partial_state_ID_n |
- +---+---+---+---+---+---+---+---+
- | |
- : partial_state_identifier_n :
- | |
- +---+---+---+---+---+---+---+---+
- */
-
- if(returned_parameters_location >= udvm_size){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
-
- /* cpb+dms+sms */
- r_p_l = *TCOMP_UDVM_GET_BUFFER_AT(returned_parameters_location);
- returned_parameters_location++;
- if(r_p_l){
- tcomp_params_setCpbCode(udvm->lpResult->remote_parameters, ((r_p_l & 0xc0)>>6));
- tcomp_params_setDmsCode(udvm->lpResult->remote_parameters, ((r_p_l & 0x38)>>3));
- tcomp_params_setSmsCode(udvm->lpResult->remote_parameters, (r_p_l & 0x07));
- }
- /* sigcomp version */
- SigComp_version = *TCOMP_UDVM_GET_BUFFER_AT(returned_parameters_location);
- returned_parameters_location++;
- if(SigComp_version){
- udvm->lpResult->remote_parameters->SigComp_version = SigComp_version;
- }
- /* state items */
- for(index = returned_parameters_location; index <(udvm_size-1); ){
- uint8_t length, *length_ptr = TCOMP_UDVM_GET_BUFFER_AT(index);
- if(!length_ptr){
- return tsk_false;
- }
- length = *length_ptr; // 1-byte
- if(length<6 || length>20){
- break;
- }
- index++;
- if((index+length) >= (uint32_t)udvm_size){
- TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
- tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
- return tsk_false;
- }
- partial_id = tcomp_buffer_create_null();
- tcomp_buffer_allocBuff(partial_id, length);
- if(!tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(partial_id), index, length)){
- return tsk_false;
- }
- if(!udvm->lpResult->remote_parameters->returnedStates){
- udvm->lpResult->remote_parameters->returnedStates = tsk_list_create();
- }
- tsk_list_push_back_data(udvm->lpResult->remote_parameters->returnedStates, (void**)&partial_id);
- index += length;
- }
- }
-
- return tsk_true;
+ tsk_size_t udvm_size;
+
+ CONSUME_CYCLES(1+state_length);
+
+ udvm_size = TCOMP_UDVM_GET_SIZE();
+
+ /*
+ * Create temporary state provided by END_MESSAGE?
+ */
+ if(!tcomp_udvm_createTempState(udvm, state_length, state_address, state_instruction, minimum_access_length, state_retention_priority, 1)) {
+ return tsk_false;
+ }
+
+ /*
+ * Byte copy all waiting STATE-FREE/STATE-CREATE/END-MESSAGE states
+ */
+ if(!tcomp_udvm_byteCopy_TempStates(udvm)) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_INTERNAL_ERROR].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INTERNAL_ERROR);
+ return tsk_false;
+ }
+
+ /*
+ * Feedback has been requested?
+ */
+ if(requested_feedback_location) {
+ uint8_t r_f_l;
+ if(requested_feedback_location >= udvm_size) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ /*
+ 0 1 2 3 4 5 6 7
+ +---+---+---+---+---+---+---+---+
+ | reserved | Q | S | I | requested_feedback_location
+ +---+---+---+---+---+---+---+---+
+ | |
+ : requested feedback item : if Q = 1
+ | |
+ +---+---+---+---+---+---+---+---+
+ */
+ r_f_l = *TCOMP_UDVM_GET_BUFFER_AT(requested_feedback_location);
+ udvm->lpResult->req_feedback->I = (r_f_l & 0x01);
+ udvm->lpResult->req_feedback->S = (r_f_l & 0x02) ? 1 : 0;
+ udvm->lpResult->req_feedback->Q = (r_f_l & 0x04) ? 1 : 0;
+
+ requested_feedback_location++; /* skip 1-byte header */
+ if(udvm->lpResult->req_feedback->Q) {
+ /* we have a requested feedback item */
+ uint8_t r_f_i = *TCOMP_UDVM_GET_BUFFER_AT(requested_feedback_location);
+ uint8_t length = 1; /* [1-128] */
+ if(r_f_i & 0x80) {
+ /* case 2 */
+ length += (r_f_i & 0x7f); /* seven last bits */
+ }
+
+ if(requested_feedback_location >= TCOMP_UDVM_GET_SIZE()) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ /* copy from udvm */
+ // FIXME: use realloc
+ tcomp_buffer_freeBuff(udvm->lpResult->req_feedback->item);
+ tcomp_buffer_allocBuff(udvm->lpResult->req_feedback->item, length);
+ if(!tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(udvm->lpResult->req_feedback->item), requested_feedback_location, length)) {
+ return tsk_false;
+ }
+ }
+ }
+
+ //
+ // SigComp parameters have been returned?
+ //
+ if(returned_parameters_location) {
+ uint8_t r_p_l, SigComp_version;
+ uint32_t index;
+ tcomp_buffer_handle_t *partial_id;
+
+ /*
+ 0 1 2 3 4 5 6 7
+ +---+---+---+---+---+---+---+---+
+ | cpb | dms | sms | returned_parameters_location
+ +---+---+---+---+---+---+---+---+
+ | SigComp_version |
+ +---+---+---+---+---+---+---+---+
+ | length_of_partial_state_ID_1 |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : partial_state_identifier_1 :
+ | |
+ +---+---+---+---+---+---+---+---+
+ : :
+ +---+---+---+---+---+---+---+---+
+ | length_of_partial_state_ID_n |
+ +---+---+---+---+---+---+---+---+
+ | |
+ : partial_state_identifier_n :
+ | |
+ +---+---+---+---+---+---+---+---+
+ */
+
+ if(returned_parameters_location >= udvm_size) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+
+ /* cpb+dms+sms */
+ r_p_l = *TCOMP_UDVM_GET_BUFFER_AT(returned_parameters_location);
+ returned_parameters_location++;
+ if(r_p_l) {
+ tcomp_params_setCpbCode(udvm->lpResult->remote_parameters, ((r_p_l & 0xc0)>>6));
+ tcomp_params_setDmsCode(udvm->lpResult->remote_parameters, ((r_p_l & 0x38)>>3));
+ tcomp_params_setSmsCode(udvm->lpResult->remote_parameters, (r_p_l & 0x07));
+ }
+ /* sigcomp version */
+ SigComp_version = *TCOMP_UDVM_GET_BUFFER_AT(returned_parameters_location);
+ returned_parameters_location++;
+ if(SigComp_version) {
+ udvm->lpResult->remote_parameters->SigComp_version = SigComp_version;
+ }
+ /* state items */
+ for(index = returned_parameters_location; index <(udvm_size-1); ) {
+ uint8_t length, *length_ptr = TCOMP_UDVM_GET_BUFFER_AT(index);
+ if(!length_ptr) {
+ return tsk_false;
+ }
+ length = *length_ptr; // 1-byte
+ if(length<6 || length>20) {
+ break;
+ }
+ index++;
+ if((index+length) >= (uint32_t)udvm_size) {
+ TSK_DEBUG_ERROR("%s", TCOMP_NACK_DESCRIPTIONS[NACK_SEGFAULT].desc);
+ tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
+ return tsk_false;
+ }
+ partial_id = tcomp_buffer_create_null();
+ tcomp_buffer_allocBuff(partial_id, length);
+ if(!tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(partial_id), index, length)) {
+ return tsk_false;
+ }
+ if(!udvm->lpResult->remote_parameters->returnedStates) {
+ udvm->lpResult->remote_parameters->returnedStates = tsk_list_create();
+ }
+ tsk_list_push_back_data(udvm->lpResult->remote_parameters->returnedStates, (void**)&partial_id);
+ index += length;
+ }
+ }
+
+ return tsk_true;
}
diff --git a/tinySIGCOMP/src/tcomp_udvm.nack.c b/tinySIGCOMP/src/tcomp_udvm.nack.c
index a195a41..53a9d49 100755
--- a/tinySIGCOMP/src/tcomp_udvm.nack.c
+++ b/tinySIGCOMP/src/tcomp_udvm.nack.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop
* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,28 +29,27 @@
int tcomp_udvm_createNackInfo(tcomp_udvm_t *udvm, uint8_t reasonCode, tcomp_buffer_handle_t* lpDetails, int16_t memory_address_of_instruction)
{
- uint32_t mem_add_instruction;
- int ret;
-
- if(!udvm){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ uint32_t mem_add_instruction;
+ int ret;
+
+ if(!udvm) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tcomp_buffer_allocBuff(udvm->lpResult->nack_info, INDEX_NACK_SHA1 + TSK_SHA1_DIGEST_SIZE);
+ mem_add_instruction = (memory_address_of_instruction >=0) ? memory_address_of_instruction : udvm->last_memory_address_of_instruction;
- tcomp_buffer_allocBuff(udvm->lpResult->nack_info, INDEX_NACK_SHA1 + TSK_SHA1_DIGEST_SIZE);
- mem_add_instruction = (memory_address_of_instruction >=0) ? memory_address_of_instruction : udvm->last_memory_address_of_instruction;
+ if((ret = tcomp_nackinfo_write_2(udvm->lpResult->nack_info,
+ reasonCode,
+ *TCOMP_UDVM_GET_BUFFER_AT(mem_add_instruction),
+ mem_add_instruction,
+ udvm->sigCompMessage,
+ lpDetails,
+ TCOMP_UDVM_GET_SIZE(),
+ udvm->stateHandler->sigcomp_parameters->cpbValue)) == 0) {
+ udvm->lpResult->isNack = 1;
+ }
- if((ret = tcomp_nackinfo_write_2(udvm->lpResult->nack_info,
- reasonCode,
- *TCOMP_UDVM_GET_BUFFER_AT(mem_add_instruction),
- mem_add_instruction,
- udvm->sigCompMessage,
- lpDetails,
- TCOMP_UDVM_GET_SIZE(),
- udvm->stateHandler->sigcomp_parameters->cpbValue)) == 0)
- {
- udvm->lpResult->isNack = 1;
- }
-
- return ret;
+ return ret;
} \ No newline at end of file
diff --git a/tinySIGCOMP/src/tcomp_udvm.operands.c b/tinySIGCOMP/src/tcomp_udvm.operands.c
index 4d15d8c..7f3afba 100755
--- a/tinySIGCOMP/src/tcomp_udvm.operands.c
+++ b/tinySIGCOMP/src/tcomp_udvm.operands.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,41 +44,36 @@ literal (#)<br>
*/
uint32_t tcomp_udvm_opget_literal_param(tcomp_udvm_t *udvm)
{
- uint32_t result = 0;
- const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
-
- switch( *memory_ptr & 0xc0) // 2 first bits
- {
- case 0x00: // 0nnnnnnn N 0 - 127
- case 0x40: // 0nnnnnnn N 0 - 127
- {
- result = *(memory_ptr);
- udvm->executionPointer++;
- }
- break;
-
- case 0x80: // 10nnnnnn nnnnnnnn N 0 - 16383
- {
- result = TSK_BINARY_GET_2BYTES(memory_ptr)&0x3fff; // All except 2 first bits
- udvm->executionPointer+=2;
- }
- break;
-
- case 0xc0: // 11000000 nnnnnnnn nnnnnnnn N 0 - 65535
- {
- result = TSK_BINARY_GET_2BYTES((memory_ptr+1));
- udvm->executionPointer+=3;
- }
- break;
-
- default:
- {
- TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
- }
- break;
- }
- return result;
+ uint32_t result = 0;
+ const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
+
+ switch( *memory_ptr & 0xc0) { // 2 first bits
+ case 0x00: // 0nnnnnnn N 0 - 127
+ case 0x40: { // 0nnnnnnn N 0 - 127
+ result = *(memory_ptr);
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 0x80: { // 10nnnnnn nnnnnnnn N 0 - 16383
+ result = TSK_BINARY_GET_2BYTES(memory_ptr)&0x3fff; // All except 2 first bits
+ udvm->executionPointer+=2;
+ }
+ break;
+
+ case 0xc0: { // 11000000 nnnnnnnn nnnnnnnn N 0 - 65535
+ result = TSK_BINARY_GET_2BYTES((memory_ptr+1));
+ udvm->executionPointer+=3;
+ }
+ break;
+
+ default: {
+ TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
+ }
+ break;
+ }
+ return result;
}
/**
@@ -92,45 +87,40 @@ reference ($)<br>
*/
uint32_t tcomp_udvm_opget_reference_param(tcomp_udvm_t *udvm)
{
- const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
- uint32_t result = 0;
-
- switch( *memory_ptr & 0xc0) // 2 first bits
- {
- case 0x00: // 0nnnnnnn memory[2 * N] 0 - 65535
- case 0x40: // 0nnnnnnn memory[2 * N] 0 - 65535
- {
- uint8_t N = (*(memory_ptr) & 0x7f); // no effect first bit is already nil
- result = 2*N;
- udvm->executionPointer++;
- }
- break;
-
- case 0x80: // 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535
- {
- uint32_t N = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x3fff);
- result = 2*N;
- udvm->executionPointer+=2;
- }
- break;
-
- case 0xc0: // 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535
- {
- uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr+1);
- result = N;
- udvm->executionPointer+=3;
- }
- break;
-
- default:
- {
- TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
- }
- break;
- }
-
- return result;
+ const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
+ uint32_t result = 0;
+
+ switch( *memory_ptr & 0xc0) { // 2 first bits
+ case 0x00: // 0nnnnnnn memory[2 * N] 0 - 65535
+ case 0x40: { // 0nnnnnnn memory[2 * N] 0 - 65535
+ uint8_t N = (*(memory_ptr) & 0x7f); // no effect first bit is already nil
+ result = 2*N;
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 0x80: { // 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535
+ uint32_t N = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x3fff);
+ result = 2*N;
+ udvm->executionPointer+=2;
+ }
+ break;
+
+ case 0xc0: { // 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535
+ uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr+1);
+ result = N;
+ udvm->executionPointer+=3;
+ }
+ break;
+
+ default: {
+ TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
+ }
+ break;
+ }
+
+ return result;
}
/**
@@ -151,96 +141,84 @@ multitype(%)<br>
*/
uint32_t tcomp_udvm_opget_multitype_param(tcomp_udvm_t *udvm)
{
- const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
- int8_t index = operand_multitype_indexes[*memory_ptr];
- uint32_t result = 0;
-
- switch(index)
- {
- case 1: // 00nnnnnn N 0 - 63
- {
- result = *(memory_ptr);
- udvm->executionPointer++;
- }
- break;
-
- case 2: // 01nnnnnn memory[2 * N] 0 - 65535
- {
- uint8_t N = (*(memory_ptr) & 0x3f);
- result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(2*N) );
- udvm->executionPointer++;
- }
- break;
-
- case 3: // 1000011n 2 ^ (N + 6) 64 , 128
- {
- uint8_t N = (*(memory_ptr) & 0x01);
- result = (uint32_t)pow( (double)2, (N + 6) );
- udvm->executionPointer++;
- }
- break;
-
- case 4: // 10001nnn 2 ^ (N + 8) 256 , ... , 32768
- {
- uint8_t N = (*(memory_ptr) & 0x07);
- result = (uint32_t)pow( (double)2, (N + 8) );
- udvm->executionPointer++;
- }
- break;
-
- case 5: // 111nnnnn N + 65504 65504 - 65535
- {
- result = ((*(memory_ptr) & 0x1f) + 65504 );
- udvm->executionPointer++;
- }
- break;
-
- case 6: // 1001nnnn nnnnnnnn N + 61440 61440 - 65535
- {
- result = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x0fff) + 61440;
- udvm->executionPointer+=2;
- }
- break;
-
- case 7: // 101nnnnn nnnnnnnn N 0 - 8191
- {
- result = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x1fff);
- udvm->executionPointer+=2;
- }
- break;
-
- case 8: // 110nnnnn nnnnnnnn memory[N] 0 - 65535
- {
- uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr) & 0x1fff;
- result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(N) );
- udvm->executionPointer+=2;
- }
- break;
-
- case 9: // 10000000 nnnnnnnn nnnnnnnn N 0 - 65535
- {
- result = TSK_BINARY_GET_2BYTES(memory_ptr+1);
- udvm->executionPointer+=3;
- }
- break;
-
- case 10: // 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535
- {
- uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr+1);
- result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(N) );
- udvm->executionPointer+=3;
- }
- break;
-
- default: // -1
- {
- TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
- }
- break;
- }
-
- return result;
+ const uint8_t* memory_ptr = TCOMP_UDVM_GET_BUFFER_AT(udvm->executionPointer);
+ int8_t index = operand_multitype_indexes[*memory_ptr];
+ uint32_t result = 0;
+
+ switch(index) {
+ case 1: { // 00nnnnnn N 0 - 63
+ result = *(memory_ptr);
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 2: { // 01nnnnnn memory[2 * N] 0 - 65535
+ uint8_t N = (*(memory_ptr) & 0x3f);
+ result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(2*N) );
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 3: { // 1000011n 2 ^ (N + 6) 64 , 128
+ uint8_t N = (*(memory_ptr) & 0x01);
+ result = (uint32_t)pow( (double)2, (N + 6) );
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 4: { // 10001nnn 2 ^ (N + 8) 256 , ... , 32768
+ uint8_t N = (*(memory_ptr) & 0x07);
+ result = (uint32_t)pow( (double)2, (N + 8) );
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 5: { // 111nnnnn N + 65504 65504 - 65535
+ result = ((*(memory_ptr) & 0x1f) + 65504 );
+ udvm->executionPointer++;
+ }
+ break;
+
+ case 6: { // 1001nnnn nnnnnnnn N + 61440 61440 - 65535
+ result = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x0fff) + 61440;
+ udvm->executionPointer+=2;
+ }
+ break;
+
+ case 7: { // 101nnnnn nnnnnnnn N 0 - 8191
+ result = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x1fff);
+ udvm->executionPointer+=2;
+ }
+ break;
+
+ case 8: { // 110nnnnn nnnnnnnn memory[N] 0 - 65535
+ uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr) & 0x1fff;
+ result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(N) );
+ udvm->executionPointer+=2;
+ }
+ break;
+
+ case 9: { // 10000000 nnnnnnnn nnnnnnnn N 0 - 65535
+ result = TSK_BINARY_GET_2BYTES(memory_ptr+1);
+ udvm->executionPointer+=3;
+ }
+ break;
+
+ case 10: { // 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535
+ uint32_t N = TSK_BINARY_GET_2BYTES(memory_ptr+1);
+ result = TSK_BINARY_GET_2BYTES( TCOMP_UDVM_GET_BUFFER_AT(N) );
+ udvm->executionPointer+=3;
+ }
+ break;
+
+ default: { // -1
+ TSK_DEBUG_ERROR("Invalide opcode: %u", *memory_ptr);
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_OPERAND);
+ }
+ break;
+ }
+
+ return result;
}
/**
@@ -255,7 +233,7 @@ calculated as follows:
*/
uint32_t tcomp_udvm_opget_address_param(tcomp_udvm_t *udvm, uint32_t memory_address_of_instruction)
{
- uint32_t D = tcomp_udvm_opget_multitype_param(udvm);
- // (2^16) => 65536;
- return ( (memory_address_of_instruction + D)%65536 );
+ uint32_t D = tcomp_udvm_opget_multitype_param(udvm);
+ // (2^16) => 65536;
+ return ( (memory_address_of_instruction + D)%65536 );
}
diff --git a/tinySIGCOMP/src/tcomp_udvm.statemanagment.c b/tinySIGCOMP/src/tcomp_udvm.statemanagment.c
index 2644c54..daeca8c 100755
--- a/tinySIGCOMP/src/tcomp_udvm.statemanagment.c
+++ b/tinySIGCOMP/src/tcomp_udvm.statemanagment.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,103 +32,99 @@
int tcomp_udvm_byteCopy_TempStates(tcomp_udvm_t *udvm)
{
- int ok = 1;
- uint8_t i;
- uint8_t tocreate_size = tcomp_result_getTempStatesToCreateSize(udvm->lpResult);
- uint8_t tofree_size = tcomp_result_getTempStatesToFreeSize(udvm->lpResult);
-
-
- /*
- * State Create
- */
- for(i = 0; i < tocreate_size && ok; i++)
- {
- /*
- * The UDVM byte copies a string of state_length bytes from the UDVM
- * memory beginning at state_address (obeying the rules of Section 8.4).
- * This is the state_value.
- */
- tcomp_state_t* lpState = udvm->lpResult->statesToCreate[i];
- if(lpState->length){
- tcomp_buffer_allocBuff(lpState->value, lpState->length);
- }
+ int ok = 1;
+ uint8_t i;
+ uint8_t tocreate_size = tcomp_result_getTempStatesToCreateSize(udvm->lpResult);
+ uint8_t tofree_size = tcomp_result_getTempStatesToFreeSize(udvm->lpResult);
+
+
+ /*
+ * State Create
+ */
+ for(i = 0; i < tocreate_size && ok; i++) {
+ /*
+ * The UDVM byte copies a string of state_length bytes from the UDVM
+ * memory beginning at state_address (obeying the rules of Section 8.4).
+ * This is the state_value.
+ */
+ tcomp_state_t* lpState = udvm->lpResult->statesToCreate[i];
+ if(lpState->length) {
+ tcomp_buffer_allocBuff(lpState->value, lpState->length);
+ }
+
+ ok &= tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(lpState->value), lpState->address, lpState->length);
+ }
- ok &= tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(lpState->value), lpState->address, lpState->length);
- }
-
- /*
- * State Free
- */
- for(i = 0; i<tofree_size && ok; i++){
- tcomp_tempstate_to_free_t *lpDesc = udvm->lpResult->statesToFree[i];
- tcomp_buffer_allocBuff(lpDesc->identifier, lpDesc->partial_identifier_length);
- ok &= tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(lpDesc->identifier), lpDesc->partial_identifier_start, lpDesc->partial_identifier_length);
- }
- return ok;
+ /*
+ * State Free
+ */
+ for(i = 0; i<tofree_size && ok; i++) {
+ tcomp_tempstate_to_free_t *lpDesc = udvm->lpResult->statesToFree[i];
+ tcomp_buffer_allocBuff(lpDesc->identifier, lpDesc->partial_identifier_length);
+ ok &= tcomp_udvm_bytecopy_from(udvm, tcomp_buffer_getBuffer(lpDesc->identifier), lpDesc->partial_identifier_start, lpDesc->partial_identifier_length);
+ }
+ return ok;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @brief Creates temporary state.
///
-/// @param [in,out] udvm If non-null, the udvm.
-/// @param state_length Length of the state.
-/// @param state_address The state address.
-/// @param state_instruction The state instruction.
-/// @param minimum_access_length Length of the minimum access.
-/// @param state_retention_priority The state retention priority.
-/// @param end_msg Message describing the end.
+/// @param [in,out] udvm If non-null, the udvm.
+/// @param state_length Length of the state.
+/// @param state_address The state address.
+/// @param state_instruction The state instruction.
+/// @param minimum_access_length Length of the minimum access.
+/// @param state_retention_priority The state retention priority.
+/// @param end_msg Message describing the end.
///
/// @return 1 if succeed an zero otherwise.
////////////////////////////////////////////////////////////////////////////////////////////////////
-int tcomp_udvm_createTempState(tcomp_udvm_t *udvm, uint32_t state_length, uint32_t state_address, uint32_t state_instruction,
- uint32_t minimum_access_length, uint32_t state_retention_priority, int end_msg)
+int tcomp_udvm_createTempState(tcomp_udvm_t *udvm, uint32_t state_length, uint32_t state_address, uint32_t state_instruction,
+ uint32_t minimum_access_length, uint32_t state_retention_priority, int end_msg)
{
- /*
- * If the specified minimum_access_length does not lie between 6 and 20 inclusive, or if
- * the state_retention_priority is 65535 then the END-MESSAGE
- * instruction fails to make a state creation request of its own
- * (however decompression failure does not occur and the state creation
- * requests made by the STATE-CREATE instruction are still valid).
- */
- int is_ok = ( (6<=minimum_access_length && minimum_access_length<=20) && state_retention_priority!=65535 );
+ /*
+ * If the specified minimum_access_length does not lie between 6 and 20 inclusive, or if
+ * the state_retention_priority is 65535 then the END-MESSAGE
+ * instruction fails to make a state creation request of its own
+ * (however decompression failure does not occur and the state creation
+ * requests made by the STATE-CREATE instruction are still valid).
+ */
+ int is_ok = ( (6<=minimum_access_length && minimum_access_length<=20) && state_retention_priority!=65535 );
- // if not ok and not END_MESSAGE --> decompression failure MUST occurs
- if(!is_ok)
- {
- if(end_msg) return 1;
+ // if not ok and not END_MESSAGE --> decompression failure MUST occurs
+ if(!is_ok) {
+ if(end_msg) {
+ return 1;
+ }
- if(state_retention_priority == 65535)
- {
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_PRIORITY);
- }
- else
- {
- tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
- }
- return 0;
- }
+ if(state_retention_priority == 65535) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_PRIORITY);
+ }
+ else {
+ tcomp_udvm_createNackInfo2(udvm, NACK_INVALID_STATE_ID_LENGTH);
+ }
+ return 0;
+ }
- /*
- * decompression failure occurs if the END-MESSAGE instruction makes a state creation request and four
- * instances of the STATE-CREATE instruction have already been encountered.
- */
- if(tcomp_result_getTempStatesToCreateSize(udvm->lpResult) >= MAX_TEMP_SATES)
- {
- tcomp_udvm_createNackInfo2(udvm, NACK_TOO_MANY_STATE_REQUESTS);
- return 0;
- }
+ /*
+ * decompression failure occurs if the END-MESSAGE instruction makes a state creation request and four
+ * instances of the STATE-CREATE instruction have already been encountered.
+ */
+ if(tcomp_result_getTempStatesToCreateSize(udvm->lpResult) >= MAX_TEMP_SATES) {
+ tcomp_udvm_createNackInfo2(udvm, NACK_TOO_MANY_STATE_REQUESTS);
+ return 0;
+ }
- /*
- * Is there a state to create?
- */
- if(is_ok)
- {
- // no byte copy ()
- tcomp_state_t *lpState = tcomp_state_create(state_length, state_address, state_instruction, minimum_access_length, state_retention_priority);
- tcomp_result_addTempStateToCreate(udvm->lpResult, lpState);
- }
+ /*
+ * Is there a state to create?
+ */
+ if(is_ok) {
+ // no byte copy ()
+ tcomp_state_t *lpState = tcomp_state_create(state_length, state_address, state_instruction, minimum_access_length, state_retention_priority);
+ tcomp_result_addTempStateToCreate(udvm->lpResult, lpState);
+ }
- return 1;
+ return 1;
}
diff --git a/tinySIGCOMP/src/tinysigcomp_config.h b/tinySIGCOMP/src/tinysigcomp_config.h
index 833b7b2..63fd963 100755
--- a/tinySIGCOMP/src/tinysigcomp_config.h
+++ b/tinySIGCOMP/src/tinysigcomp_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,13 +46,13 @@
# define TINYSIGCOMP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TCOMP_BEGIN_DECLS extern "C" {
# define TCOMP_END_DECLS }
#else
-# define TCOMP_BEGIN_DECLS
+# define TCOMP_BEGIN_DECLS
# define TCOMP_END_DECLS
#endif
@@ -93,13 +93,13 @@
#elif defined(__GNUC__) && !defined(__APPLE__)
# define TCOMP_INLINE __inline
#else
-# define TCOMP_INLINE
+# define TCOMP_INLINE
#endif
#include <stdint.h>
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYSIGCOMP_CONFIG_H
diff --git a/tinySIGCOMP/src/trees.c b/tinySIGCOMP/src/trees.c
index fe8eda7..201b01d 100755
--- a/tinySIGCOMP/src/trees.c
+++ b/tinySIGCOMP/src/trees.c
@@ -60,16 +60,16 @@
/* repeat a zero length 11-138 times (7 bits of repeat count) */
local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
- = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
local const int extra_dbits[D_CODES] /* extra bits for each distance code */
- = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
- = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
local const uch bl_order[BL_CODES]
- = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+ = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
/* The lengths of the bit length codes are sent in order of decreasing
* probability, to avoid transmitting the lengths for unused bit length codes.
*/
@@ -166,7 +166,7 @@ local void gen_trees_header OF((void));
#ifndef DEBUG
# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
- /* Send a code of the given tree. c and tree must not have side effects */
+/* Send a code of the given tree. c and tree must not have side effects */
#else /* DEBUG */
# define send_code(s, c, tree) \
@@ -191,9 +191,9 @@ local void gen_trees_header OF((void));
local void send_bits OF((deflate_state *s, int value, int length));
local void send_bits(s, value, length)
- deflate_state *s;
- int value; /* value to send */
- int length; /* number of bits */
+deflate_state *s;
+int value; /* value to send */
+int length; /* number of bits */
{
Tracevv((stderr," l %2d v %4x ", length, value));
Assert(length > 0 && length <= 15, "invalid length");
@@ -208,7 +208,8 @@ local void send_bits(s, value, length)
put_short(s, s->bi_buf);
s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
s->bi_valid += length - Buf_size;
- } else {
+ }
+ else {
s->bi_buf |= value << s->bi_valid;
s->bi_valid += length;
}
@@ -248,7 +249,9 @@ local void tr_static_init()
ush bl_count[MAX_BITS+1];
/* number of codes at each bit length for an optimal tree */
- if (static_init_done) return;
+ if (static_init_done) {
+ return;
+ }
/* For some embedded targets, global variables are not initialized: */
static_l_desc.static_tree = static_ltree;
@@ -291,12 +294,22 @@ local void tr_static_init()
Assert (dist == 256, "tr_static_init: 256+dist != 512");
/* Construct the codes of the static literal tree */
- for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+ for (bits = 0; bits <= MAX_BITS; bits++) {
+ bl_count[bits] = 0;
+ }
n = 0;
- while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
- while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
- while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
- while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+ while (n <= 143) {
+ static_ltree[n++].Len = 8, bl_count[8]++;
+ }
+ while (n <= 255) {
+ static_ltree[n++].Len = 9, bl_count[9]++;
+ }
+ while (n <= 279) {
+ static_ltree[n++].Len = 7, bl_count[7]++;
+ }
+ while (n <= 287) {
+ static_ltree[n++].Len = 8, bl_count[8]++;
+ }
/* Codes 286 and 287 do not exist, but we must include them in the
* tree construction to get a canonical Huffman tree (longest code
* all ones)
@@ -381,7 +394,7 @@ void gen_trees_header()
* Initialize the tree data structures for a new zlib stream.
*/
void _tr_init(s)
- deflate_state *s;
+deflate_state *s;
{
tr_static_init();
@@ -410,14 +423,20 @@ void _tr_init(s)
* Initialize a new block.
*/
local void init_block(s)
- deflate_state *s;
+deflate_state *s;
{
int n; /* iterates over tree elements */
/* Initialize the trees. */
- for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
- for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
- for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+ for (n = 0; n < L_CODES; n++) {
+ s->dyn_ltree[n].Freq = 0;
+ }
+ for (n = 0; n < D_CODES; n++) {
+ s->dyn_dtree[n].Freq = 0;
+ }
+ for (n = 0; n < BL_CODES; n++) {
+ s->bl_tree[n].Freq = 0;
+ }
s->dyn_ltree[END_BLOCK].Freq = 1;
s->opt_len = s->static_len = 0L;
@@ -454,23 +473,26 @@ local void init_block(s)
* two sons).
*/
local void pqdownheap(s, tree, k)
- deflate_state *s;
- ct_data *tree; /* the tree to restore */
- int k; /* node to move down */
+deflate_state *s;
+ct_data *tree; /* the tree to restore */
+int k; /* node to move down */
{
int v = s->heap[k];
int j = k << 1; /* left son of k */
while (j <= s->heap_len) {
/* Set j to the smallest of the two sons: */
if (j < s->heap_len &&
- smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
j++;
}
/* Exit if v is smaller than both sons */
- if (smaller(tree, v, s->heap[j], s->depth)) break;
+ if (smaller(tree, v, s->heap[j], s->depth)) {
+ break;
+ }
/* Exchange v with the smallest son */
- s->heap[k] = s->heap[j]; k = j;
+ s->heap[k] = s->heap[j];
+ k = j;
/* And continue down the tree, setting j to the left son of k */
j <<= 1;
@@ -489,8 +511,8 @@ local void pqdownheap(s, tree, k)
* not null.
*/
local void gen_bitlen(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
+deflate_state *s;
+tree_desc *desc; /* the tree descriptor */
{
ct_data *tree = desc->dyn_tree;
int max_code = desc->max_code;
@@ -505,7 +527,9 @@ local void gen_bitlen(s, desc)
ush f; /* frequency */
int overflow = 0; /* number of elements with bit length too large */
- for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+ for (bits = 0; bits <= MAX_BITS; bits++) {
+ s->bl_count[bits] = 0;
+ }
/* In a first pass, compute the optimal bit lengths (which may
* overflow in the case of the bit length tree).
@@ -515,20 +539,30 @@ local void gen_bitlen(s, desc)
for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
- if (bits > max_length) bits = max_length, overflow++;
+ if (bits > max_length) {
+ bits = max_length, overflow++;
+ }
tree[n].Len = (ush)bits;
/* We overwrite tree[n].Dad which is no longer needed */
- if (n > max_code) continue; /* not a leaf node */
+ if (n > max_code) {
+ continue; /* not a leaf node */
+ }
s->bl_count[bits]++;
xbits = 0;
- if (n >= base) xbits = extra[n-base];
+ if (n >= base) {
+ xbits = extra[n-base];
+ }
f = tree[n].Freq;
s->opt_len += (ulg)f * (bits + xbits);
- if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+ if (stree) {
+ s->static_len += (ulg)f * (stree[n].Len + xbits);
+ }
+ }
+ if (overflow == 0) {
+ return;
}
- if (overflow == 0) return;
Trace((stderr,"\nbit length overflow\n"));
/* This happens for example on obj2 and pic of the Calgary corpus */
@@ -536,7 +570,9 @@ local void gen_bitlen(s, desc)
/* Find the first bit length which could increase: */
do {
bits = max_length-1;
- while (s->bl_count[bits] == 0) bits--;
+ while (s->bl_count[bits] == 0) {
+ bits--;
+ }
s->bl_count[bits]--; /* move one leaf down the tree */
s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
s->bl_count[max_length]--;
@@ -544,7 +580,8 @@ local void gen_bitlen(s, desc)
* but this does not affect bl_count[max_length]
*/
overflow -= 2;
- } while (overflow > 0);
+ }
+ while (overflow > 0);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
@@ -555,7 +592,9 @@ local void gen_bitlen(s, desc)
n = s->bl_count[bits];
while (n != 0) {
m = s->heap[--h];
- if (m > max_code) continue;
+ if (m > max_code) {
+ continue;
+ }
if ((unsigned) tree[m].Len != (unsigned) bits) {
Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
s->opt_len += ((long)bits - (long)tree[m].Len)
@@ -576,9 +615,9 @@ local void gen_bitlen(s, desc)
* zero code length.
*/
local void gen_codes (tree, max_code, bl_count)
- ct_data *tree; /* the tree to decorate */
- int max_code; /* largest code with non zero frequency */
- ushf *bl_count; /* number of codes at each bit length */
+ct_data *tree; /* the tree to decorate */
+int max_code; /* largest code with non zero frequency */
+ushf *bl_count; /* number of codes at each bit length */
{
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
ush code = 0; /* running code value */
@@ -600,12 +639,14 @@ local void gen_codes (tree, max_code, bl_count)
for (n = 0; n <= max_code; n++) {
int len = tree[n].Len;
- if (len == 0) continue;
+ if (len == 0) {
+ continue;
+ }
/* Now reverse the bits */
tree[n].Code = bi_reverse(next_code[len]++, len);
Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
- n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
}
}
@@ -618,8 +659,8 @@ local void gen_codes (tree, max_code, bl_count)
* also updated if stree is not null. The field max_code is set.
*/
local void build_tree(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
+deflate_state *s;
+tree_desc *desc; /* the tree descriptor */
{
ct_data *tree = desc->dyn_tree;
const ct_data *stree = desc->stat_desc->static_tree;
@@ -638,7 +679,8 @@ local void build_tree(s, desc)
if (tree[n].Freq != 0) {
s->heap[++(s->heap_len)] = max_code = n;
s->depth[n] = 0;
- } else {
+ }
+ else {
tree[n].Len = 0;
}
}
@@ -652,7 +694,10 @@ local void build_tree(s, desc)
node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
tree[node].Freq = 1;
s->depth[node] = 0;
- s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+ s->opt_len--;
+ if (stree) {
+ s->static_len -= stree[node].Len;
+ }
/* node is 0 or 1 so it does not have extra bits */
}
desc->max_code = max_code;
@@ -660,7 +705,9 @@ local void build_tree(s, desc)
/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
* establish sub-heaps of increasing lengths:
*/
- for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+ for (n = s->heap_len/2; n >= 1; n--) {
+ pqdownheap(s, tree, n);
+ }
/* Construct the Huffman tree by repeatedly combining the least two
* frequent nodes.
@@ -688,7 +735,8 @@ local void build_tree(s, desc)
s->heap[SMALLEST] = node++;
pqdownheap(s, tree, SMALLEST);
- } while (s->heap_len >= 2);
+ }
+ while (s->heap_len >= 2);
s->heap[--(s->heap_max)] = s->heap[SMALLEST];
@@ -706,9 +754,9 @@ local void build_tree(s, desc)
* in the bit length tree.
*/
local void scan_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
+deflate_state *s;
+ct_data *tree; /* the tree to be scanned */
+int max_code; /* and its largest code of non zero frequency */
{
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
@@ -718,29 +766,41 @@ local void scan_tree (s, tree, max_code)
int max_count = 7; /* max repeat count */
int min_count = 4; /* min repeat count */
- if (nextlen == 0) max_count = 138, min_count = 3;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ }
tree[max_code+1].Len = (ush)0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
+ curlen = nextlen;
+ nextlen = tree[n+1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
- } else if (count < min_count) {
+ }
+ else if (count < min_count) {
s->bl_tree[curlen].Freq += count;
- } else if (curlen != 0) {
- if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+ }
+ else if (curlen != 0) {
+ if (curlen != prevlen) {
+ s->bl_tree[curlen].Freq++;
+ }
s->bl_tree[REP_3_6].Freq++;
- } else if (count <= 10) {
+ }
+ else if (count <= 10) {
s->bl_tree[REPZ_3_10].Freq++;
- } else {
+ }
+ else {
s->bl_tree[REPZ_11_138].Freq++;
}
- count = 0; prevlen = curlen;
+ count = 0;
+ prevlen = curlen;
if (nextlen == 0) {
max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
+ }
+ else if (curlen == nextlen) {
max_count = 6, min_count = 3;
- } else {
+ }
+ else {
max_count = 7, min_count = 4;
}
}
@@ -751,9 +811,9 @@ local void scan_tree (s, tree, max_code)
* bl_tree.
*/
local void send_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
+deflate_state *s;
+ct_data *tree; /* the tree to be scanned */
+int max_code; /* and its largest code of non zero frequency */
{
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
@@ -764,34 +824,51 @@ local void send_tree (s, tree, max_code)
int min_count = 4; /* min repeat count */
/* tree[max_code+1].Len = -1; */ /* guard already set */
- if (nextlen == 0) max_count = 138, min_count = 3;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ }
for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
+ curlen = nextlen;
+ nextlen = tree[n+1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
- } else if (count < min_count) {
- do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+ }
+ else if (count < min_count) {
+ do {
+ send_code(s, curlen, s->bl_tree);
+ }
+ while (--count != 0);
- } else if (curlen != 0) {
+ }
+ else if (curlen != 0) {
if (curlen != prevlen) {
- send_code(s, curlen, s->bl_tree); count--;
+ send_code(s, curlen, s->bl_tree);
+ count--;
}
Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+ send_code(s, REP_3_6, s->bl_tree);
+ send_bits(s, count-3, 2);
- } else if (count <= 10) {
- send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+ }
+ else if (count <= 10) {
+ send_code(s, REPZ_3_10, s->bl_tree);
+ send_bits(s, count-3, 3);
- } else {
- send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
}
- count = 0; prevlen = curlen;
+ else {
+ send_code(s, REPZ_11_138, s->bl_tree);
+ send_bits(s, count-11, 7);
+ }
+ count = 0;
+ prevlen = curlen;
if (nextlen == 0) {
max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
+ }
+ else if (curlen == nextlen) {
max_count = 6, min_count = 3;
- } else {
+ }
+ else {
max_count = 7, min_count = 4;
}
}
@@ -802,7 +879,7 @@ local void send_tree (s, tree, max_code)
* bl_order of the last bit length code to send.
*/
local int build_bl_tree(s)
- deflate_state *s;
+deflate_state *s;
{
int max_blindex; /* index of last bit length code of non zero freq */
@@ -821,7 +898,9 @@ local int build_bl_tree(s)
* 3 but the actual value used is 4.)
*/
for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
- if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+ if (s->bl_tree[bl_order[max_blindex]].Len != 0) {
+ break;
+ }
}
/* Update opt_len to include the bit length tree and counts */
s->opt_len += 3*(max_blindex+1) + 5+5+4;
@@ -837,8 +916,8 @@ local int build_bl_tree(s)
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
*/
local void send_all_trees(s, lcodes, dcodes, blcodes)
- deflate_state *s;
- int lcodes, dcodes, blcodes; /* number of codes for each tree */
+deflate_state *s;
+int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
int rank; /* index in bl_order */
@@ -866,10 +945,10 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
* Send a stored block
*/
void _tr_stored_block(s, buf, stored_len, eof)
- deflate_state *s;
- charf *buf; /* input block */
- ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
+deflate_state *s;
+charf *buf; /* input block */
+ulg stored_len; /* length of input block */
+int eof; /* true if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
#ifdef DEBUG
@@ -891,7 +970,7 @@ void _tr_stored_block(s, buf, stored_len, eof)
* on one bit only.
*/
void _tr_align(s)
- deflate_state *s;
+deflate_state *s;
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
@@ -920,10 +999,10 @@ void _tr_align(s)
* trees or store, and output the encoded block to the zip file.
*/
void _tr_flush_block(s, buf, stored_len, eof)
- deflate_state *s;
- charf *buf; /* input block, or NULL if too old */
- ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
+deflate_state *s;
+charf *buf; /* input block, or NULL if too old */
+ulg stored_len; /* length of input block */
+int eof; /* true if this is the last block for a file */
{
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
@@ -932,8 +1011,9 @@ void _tr_flush_block(s, buf, stored_len, eof)
if (s->level > 0) {
/* Check if the file is binary or text */
- if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
+ if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) {
set_data_type(s);
+ }
/* Construct the literal and distance trees */
build_tree(s, (tree_desc *)(&(s->l_desc)));
@@ -960,9 +1040,12 @@ void _tr_flush_block(s, buf, stored_len, eof)
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
s->last_lit));
- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+ if (static_lenb <= opt_lenb) {
+ opt_lenb = static_lenb;
+ }
- } else {
+ }
+ else {
Assert(buf != (char*)0, "lost buf");
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
}
@@ -971,7 +1054,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
if (buf != (char*)0) { /* force stored block */
#else
if (stored_len+4 <= opt_lenb && buf != (char*)0) {
- /* 4: two words for the lengths */
+ /* 4: two words for the lengths */
#endif
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
* Otherwise we can't have processed more than WSIZE input bytes since
@@ -982,16 +1065,19 @@ void _tr_flush_block(s, buf, stored_len, eof)
_tr_stored_block(s, buf, stored_len, eof);
#ifdef FORCE_STATIC
- } else if (static_lenb >= 0) { /* force static trees */
+ }
+ else if (static_lenb >= 0) { /* force static trees */
#else
- } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
+ }
+ else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
#endif
send_bits(s, (STATIC_TREES<<1)+eof, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
#endif
- } else {
+ }
+ else {
send_bits(s, (DYN_TREES<<1)+eof, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
@@ -1013,7 +1099,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- s->compressed_len-7*eof));
+ s->compressed_len-7*eof));
}
/* ===========================================================================
@@ -1021,16 +1107,17 @@ void _tr_flush_block(s, buf, stored_len, eof)
* the current block must be flushed.
*/
int _tr_tally (s, dist, lc)
- deflate_state *s;
- unsigned dist; /* distance of matched string */
- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+deflate_state *s;
+unsigned dist; /* distance of matched string */
+unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
s->d_buf[s->last_lit] = (ush)dist;
s->l_buf[s->last_lit++] = (uch)lc;
if (dist == 0) {
/* lc is the unmatched char */
s->dyn_ltree[lc].Freq++;
- } else {
+ }
+ else {
s->matches++;
/* Here, lc is the match length - MIN_MATCH */
dist--; /* dist = match distance - 1 */
@@ -1051,13 +1138,15 @@ int _tr_tally (s, dist, lc)
int dcode;
for (dcode = 0; dcode < D_CODES; dcode++) {
out_length += (ulg)s->dyn_dtree[dcode].Freq *
- (5L+extra_dbits[dcode]);
+ (5L+extra_dbits[dcode]);
}
out_length >>= 3;
Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
- s->last_lit, in_length, out_length,
- 100L - out_length*100L/in_length));
- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+ s->last_lit, in_length, out_length,
+ 100L - out_length*100L/in_length));
+ if (s->matches < s->last_lit/2 && out_length < in_length/2) {
+ return 1;
+ }
}
#endif
return (s->last_lit == s->lit_bufsize-1);
@@ -1071,9 +1160,9 @@ int _tr_tally (s, dist, lc)
* Send the block data compressed using the given Huffman trees
*/
local void compress_block(s, ltree, dtree)
- deflate_state *s;
- ct_data *ltree; /* literal tree */
- ct_data *dtree; /* distance tree */
+deflate_state *s;
+ct_data *ltree; /* literal tree */
+ct_data *dtree; /* distance tree */
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
@@ -1082,37 +1171,39 @@ local void compress_block(s, ltree, dtree)
int extra; /* number of extra bits to send */
if (s->last_lit != 0) do {
- dist = s->d_buf[lx];
- lc = s->l_buf[lx++];
- if (dist == 0) {
- send_code(s, lc, ltree); /* send a literal byte */
- Tracecv(isgraph(lc), (stderr," '%c' ", lc));
- } else {
- /* Here, lc is the match length - MIN_MATCH */
- code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
- extra = extra_lbits[code];
- if (extra != 0) {
- lc -= base_length[code];
- send_bits(s, lc, extra); /* send the extra length bits */
- }
- dist--; /* dist is now the match distance - 1 */
- code = d_code(dist);
- Assert (code < D_CODES, "bad d_code");
-
- send_code(s, code, dtree); /* send the distance code */
- extra = extra_dbits[code];
- if (extra != 0) {
- dist -= base_dist[code];
- send_bits(s, dist, extra); /* send the extra distance bits */
+ dist = s->d_buf[lx];
+ lc = s->l_buf[lx++];
+ if (dist == 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ Tracecv(isgraph(lc), (stderr," '%c' ", lc));
}
- } /* literal or match pair ? */
+ else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+ "pendingBuf overflow");
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- "pendingBuf overflow");
-
- } while (lx < s->last_lit);
+ }
+ while (lx < s->last_lit);
send_code(s, END_BLOCK, ltree);
s->last_eob_len = ltree[END_BLOCK].Len;
@@ -1125,17 +1216,19 @@ local void compress_block(s, ltree, dtree)
* IN assertion: the fields Freq of dyn_ltree are set.
*/
local void set_data_type(s)
- deflate_state *s;
+deflate_state *s;
{
int n;
for (n = 0; n < 9; n++)
- if (s->dyn_ltree[n].Freq != 0)
+ if (s->dyn_ltree[n].Freq != 0) {
break;
+ }
if (n == 9)
for (n = 14; n < 32; n++)
- if (s->dyn_ltree[n].Freq != 0)
+ if (s->dyn_ltree[n].Freq != 0) {
break;
+ }
s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
}
@@ -1145,14 +1238,15 @@ local void set_data_type(s)
* IN assertion: 1 <= len <= 15
*/
local unsigned bi_reverse(code, len)
- unsigned code; /* the value to invert */
- int len; /* its bit length */
+unsigned code; /* the value to invert */
+int len; /* its bit length */
{
register unsigned res = 0;
do {
res |= code & 1;
code >>= 1, res <<= 1;
- } while (--len > 0);
+ }
+ while (--len > 0);
return res >> 1;
}
@@ -1160,13 +1254,14 @@ local unsigned bi_reverse(code, len)
* Flush the bit buffer, keeping at most 7 bits in it.
*/
local void bi_flush(s)
- deflate_state *s;
+deflate_state *s;
{
if (s->bi_valid == 16) {
put_short(s, s->bi_buf);
s->bi_buf = 0;
s->bi_valid = 0;
- } else if (s->bi_valid >= 8) {
+ }
+ else if (s->bi_valid >= 8) {
put_byte(s, (Byte)s->bi_buf);
s->bi_buf >>= 8;
s->bi_valid -= 8;
@@ -1177,11 +1272,12 @@ local void bi_flush(s)
* Flush the bit buffer and align the output on a byte boundary
*/
local void bi_windup(s)
- deflate_state *s;
+deflate_state *s;
{
if (s->bi_valid > 8) {
put_short(s, s->bi_buf);
- } else if (s->bi_valid > 0) {
+ }
+ else if (s->bi_valid > 0) {
put_byte(s, (Byte)s->bi_buf);
}
s->bi_buf = 0;
@@ -1196,10 +1292,10 @@ local void bi_windup(s)
* one's complement if requested.
*/
local void copy_block(s, buf, len, header)
- deflate_state *s;
- charf *buf; /* the input data */
- unsigned len; /* its length */
- int header; /* true if block header must be written */
+deflate_state *s;
+charf *buf; /* the input data */
+unsigned len; /* its length */
+int header; /* true if block header must be written */
{
bi_windup(s); /* align on byte boundary */
s->last_eob_len = 8; /* enough lookahead for inflate */
diff --git a/tinySIGCOMP/src/trees.h b/tinySIGCOMP/src/trees.h
index f8ce546..4a28457 100755
--- a/tinySIGCOMP/src/trees.h
+++ b/tinySIGCOMP/src/trees.h
@@ -2,129 +2,129 @@
/* header created automatically with -DGEN_TREES_H */
local const ct_data static_ltree[L_CODES+2] = {
-{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
-{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
-{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
-{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
-{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
-{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
-{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
-{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
-{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
-{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
-{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
-{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
-{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
-{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
-{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
-{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
-{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
-{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
-{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
-{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
-{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
-{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
-{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
-{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
-{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
-{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
-{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
-{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
-{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
-{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
-{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
-{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
-{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
-{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
-{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
-{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
-{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
-{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
-{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
-{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
-{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
-{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
-{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
-{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
-{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
-{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
-{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
-{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
-{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
-{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
-{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
-{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
-{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
-{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
-{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
-{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
-{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
-{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+ {{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+ {{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+ {{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+ {{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+ {{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+ {{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+ {{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+ {{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+ {{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+ {{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+ {{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+ {{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+ {{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+ {{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+ {{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+ {{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+ {{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+ {{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+ {{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+ {{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+ {{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+ {{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+ {{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+ {{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+ {{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+ {{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+ {{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+ {{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+ {{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+ {{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+ {{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+ {{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+ {{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+ {{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+ {{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+ {{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+ {{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+ {{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+ {{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+ {{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+ {{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+ {{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+ {{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+ {{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+ {{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+ {{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+ {{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+ {{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+ {{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+ {{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+ {{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+ {{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+ {{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+ {{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+ {{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+ {{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+ {{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+ {{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
};
local const ct_data static_dtree[D_CODES] = {
-{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
-{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
-{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
-{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
-{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
-{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+ {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+ {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+ {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+ {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+ {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+ {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
};
const uch _dist_code[DIST_CODE_LEN] = {
- 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
-10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
-18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+ 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
};
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
-13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
-19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+ 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+ 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+ 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
};
local const int base_length[LENGTH_CODES] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
-64, 80, 96, 112, 128, 160, 192, 224, 0
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+ 64, 80, 96, 112, 128, 160, 192, 224, 0
};
local const int base_dist[D_CODES] = {
0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
- 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
- 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
};
#endif // HAS_ZLIB
diff --git a/tinySIGCOMP/src/zconf.h b/tinySIGCOMP/src/zconf.h
index 789f0ed..d2f765f 100755
--- a/tinySIGCOMP/src/zconf.h
+++ b/tinySIGCOMP/src/zconf.h
@@ -164,7 +164,7 @@
for small objects.
*/
- /* Type declarations */
+/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
@@ -182,7 +182,7 @@
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
+/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
@@ -191,7 +191,7 @@
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
+/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
@@ -202,9 +202,9 @@
#endif
#if defined(WINDOWS) || defined(WIN32) || defined(__SYMBIAN32__)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
+/* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
@@ -214,17 +214,17 @@
# endif
# endif
# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
+/* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+/* No need for _export, use ZLIB.DEF instead. */
+/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
@@ -267,10 +267,10 @@ typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
- typedef Byte FAR Bytef;
+typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
@@ -278,13 +278,13 @@ typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
+typedef void const *voidpc;
+typedef void FAR *voidpf;
+typedef void *voidp;
#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
+typedef Byte const *voidpc;
+typedef Byte FAR *voidpf;
+typedef Byte *voidp;
#endif
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
diff --git a/tinySIGCOMP/src/zlib.h b/tinySIGCOMP/src/zlib.h
index 33ed30f..c68bf08 100755
--- a/tinySIGCOMP/src/zlib.h
+++ b/tinySIGCOMP/src/zlib.h
@@ -158,7 +158,7 @@ typedef gz_header FAR *gz_headerp;
a single step).
*/
- /* constants */
+/* constants */
#define Z_NO_FLUSH 0
#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
@@ -208,7 +208,7 @@ typedef gz_header FAR *gz_headerp;
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
- /* basic functions */
+/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
@@ -471,7 +471,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
static string (which must not be deallocated).
*/
- /* Advanced functions */
+/* Advanced functions */
/*
The following functions are needed only in some special applications.
@@ -537,8 +537,8 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
@@ -668,7 +668,7 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
*/
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
+ gz_headerp head));
/*
deflateSetHeader() provides gzip header information for when a gzip
stream is requested by deflateInit2(). deflateSetHeader() may be called
@@ -735,8 +735,8 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
*/
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate,
@@ -814,7 +814,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
*/
ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
+ gz_headerp head));
/*
inflateGetHeader() requests that gzip header information be stored in the
provided gz_header structure. inflateGetHeader() may be called after
@@ -997,7 +997,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
*/
- /* utility functions */
+/* utility functions */
/*
The following utility functions are implemented on top of the
@@ -1250,7 +1250,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
file that is being written concurrently.
*/
- /* checksum functions */
+/* checksum functions */
/*
These functions are not related to compression but are exported
@@ -1275,7 +1275,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
*/
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
+ z_off_t len2));
/*
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
@@ -1310,7 +1310,7 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
*/
- /* various hacks, don't look :) */
+/* various hacks, don't look :) */
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
@@ -1326,9 +1326,9 @@ ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
@@ -1344,7 +1344,9 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
+struct internal_state {
+ int dummy;
+}; /* hack for buggy compilers */
#endif
ZEXTERN const char * ZEXPORT zError OF((int));
diff --git a/tinySIGCOMP/src/zutil.c b/tinySIGCOMP/src/zutil.c
index dab7e2f..49b430e 100755
--- a/tinySIGCOMP/src/zutil.c
+++ b/tinySIGCOMP/src/zutil.c
@@ -9,20 +9,23 @@
#include "zutil.h"
#ifndef NO_DUMMY_DECL
-struct internal_state {int dummy;}; /* for buggy compilers */
+struct internal_state {
+ int dummy;
+}; /* for buggy compilers */
#endif
const char * const z_errmsg[10] = {
-"need dictionary", /* Z_NEED_DICT 2 */
-"stream end", /* Z_STREAM_END 1 */
-"", /* Z_OK 0 */
-"file error", /* Z_ERRNO (-1) */
-"stream error", /* Z_STREAM_ERROR (-2) */
-"data error", /* Z_DATA_ERROR (-3) */
-"insufficient memory", /* Z_MEM_ERROR (-4) */
-"buffer error", /* Z_BUF_ERROR (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
+ "need dictionary", /* Z_NEED_DICT 2 */
+ "stream end", /* Z_STREAM_END 1 */
+ "", /* Z_OK 0 */
+ "file error", /* Z_ERRNO (-1) */
+ "stream error", /* Z_STREAM_ERROR (-2) */
+ "data error", /* Z_DATA_ERROR (-3) */
+ "insufficient memory", /* Z_MEM_ERROR (-4) */
+ "buffer error", /* Z_BUF_ERROR (-5) */
+ "incompatible version",/* Z_VERSION_ERROR (-6) */
+ ""
+};
const char * ZEXPORT zlibVersion()
@@ -36,28 +39,52 @@ uLong ZEXPORT zlibCompileFlags()
flags = 0;
switch (sizeof(uInt)) {
- case 2: break;
- case 4: flags += 1; break;
- case 8: flags += 2; break;
- default: flags += 3;
+ case 2:
+ break;
+ case 4:
+ flags += 1;
+ break;
+ case 8:
+ flags += 2;
+ break;
+ default:
+ flags += 3;
}
switch (sizeof(uLong)) {
- case 2: break;
- case 4: flags += 1 << 2; break;
- case 8: flags += 2 << 2; break;
- default: flags += 3 << 2;
+ case 2:
+ break;
+ case 4:
+ flags += 1 << 2;
+ break;
+ case 8:
+ flags += 2 << 2;
+ break;
+ default:
+ flags += 3 << 2;
}
switch (sizeof(voidpf)) {
- case 2: break;
- case 4: flags += 1 << 4; break;
- case 8: flags += 2 << 4; break;
- default: flags += 3 << 4;
+ case 2:
+ break;
+ case 4:
+ flags += 1 << 4;
+ break;
+ case 8:
+ flags += 2 << 4;
+ break;
+ default:
+ flags += 3 << 4;
}
switch (sizeof(z_off_t)) {
- case 2: break;
- case 4: flags += 1 << 6; break;
- case 8: flags += 2 << 6; break;
- default: flags += 3 << 6;
+ case 2:
+ break;
+ case 4:
+ flags += 1 << 6;
+ break;
+ case 8:
+ flags += 2 << 6;
+ break;
+ default:
+ flags += 3 << 6;
}
#ifdef DEBUG
flags += 1 << 8;
@@ -88,25 +115,25 @@ uLong ZEXPORT zlibCompileFlags()
#endif
#ifdef STDC
# ifdef NO_vsnprintf
- flags += 1L << 25;
+ flags += 1L << 25;
# ifdef HAS_vsprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# else
# ifdef HAS_vsnprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# endif
#else
- flags += 1L << 24;
+ flags += 1L << 24;
# ifdef NO_snprintf
- flags += 1L << 25;
+ flags += 1L << 25;
# ifdef HAS_sprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# else
# ifdef HAS_snprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# endif
#endif
@@ -121,7 +148,7 @@ uLong ZEXPORT zlibCompileFlags()
int z_verbose = verbose;
void z_error (m)
- char *m;
+char *m;
{
fprintf(stderr, "%s\n", m);
exit(1);
@@ -132,53 +159,61 @@ void z_error (m)
* uncompress()
*/
const char * ZEXPORT zError(err)
- int err;
+int err;
{
return ERR_MSG(err);
}
#if defined(_WIN32_WCE)
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used.
- */
- int errno = 0;
+/* The Microsoft C Run-Time Library for Windows CE doesn't have
+ * errno. We define it as a global variable to simplify porting.
+ * Its value is always 0 and should not be used.
+ */
+int errno = 0;
#endif
#ifndef HAVE_MEMCPY
void zmemcpy(dest, source, len)
- Bytef* dest;
- const Bytef* source;
- uInt len;
+Bytef* dest;
+const Bytef* source;
+uInt len;
{
- if (len == 0) return;
+ if (len == 0) {
+ return;
+ }
do {
*dest++ = *source++; /* ??? to be unrolled */
- } while (--len != 0);
+ }
+ while (--len != 0);
}
int zmemcmp(s1, s2, len)
- const Bytef* s1;
- const Bytef* s2;
- uInt len;
+const Bytef* s1;
+const Bytef* s2;
+uInt len;
{
uInt j;
for (j = 0; j < len; j++) {
- if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ if (s1[j] != s2[j]) {
+ return 2*(s1[j] > s2[j])-1;
+ }
}
return 0;
}
void zmemzero(dest, len)
- Bytef* dest;
- uInt len;
+Bytef* dest;
+uInt len;
{
- if (len == 0) return;
+ if (len == 0) {
+ return;
+ }
do {
*dest++ = 0; /* ??? to be unrolled */
- } while (--len != 0);
+ }
+ while (--len != 0);
}
#endif
@@ -224,11 +259,16 @@ voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
*/
if (bsize < 65520L) {
buf = farmalloc(bsize);
- if (*(ush*)&buf != 0) return buf;
- } else {
+ if (*(ush*)&buf != 0) {
+ return buf;
+ }
+ }
+ else {
buf = farmalloc(bsize + 16L);
}
- if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ if (buf == NULL || next_ptr >= MAX_PTR) {
+ return NULL;
+ }
table[next_ptr].org_ptr = buf;
/* Normalize the pointer to seg:0 */
@@ -247,7 +287,9 @@ void zcfree (voidpf opaque, voidpf ptr)
}
/* Find the original pointer */
for (n = 0; n < next_ptr; n++) {
- if (ptr != table[n].new_ptr) continue;
+ if (ptr != table[n].new_ptr) {
+ continue;
+ }
farfree(table[n].org_ptr);
while (++n < next_ptr) {
@@ -275,13 +317,17 @@ void zcfree (voidpf opaque, voidpf ptr)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{
- if (opaque) opaque = 0; /* to make compiler happy */
+ if (opaque) {
+ opaque = 0; /* to make compiler happy */
+ }
return _halloc((long)items, size);
}
void zcfree (voidpf opaque, voidpf ptr)
{
- if (opaque) opaque = 0; /* to make compiler happy */
+ if (opaque) {
+ opaque = 0; /* to make compiler happy */
+ }
_hfree(ptr);
}
@@ -299,21 +345,25 @@ extern void free OF((voidpf ptr));
#endif
voidpf zcalloc (opaque, items, size)
- voidpf opaque;
- unsigned items;
- unsigned size;
+voidpf opaque;
+unsigned items;
+unsigned size;
{
- if (opaque) items += size - size; /* make compiler happy */
+ if (opaque) {
+ items += size - size; /* make compiler happy */
+ }
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
- (voidpf)calloc(items, size);
+ (voidpf)calloc(items, size);
}
void zcfree (opaque, ptr)
- voidpf opaque;
- voidpf ptr;
+voidpf opaque;
+voidpf ptr;
{
free(ptr);
- if (opaque) return; /* make compiler happy */
+ if (opaque) {
+ return; /* make compiler happy */
+ }
}
#endif /* MY_ZCALLOC */
diff --git a/tinySIGCOMP/src/zutil.h b/tinySIGCOMP/src/zutil.h
index 3761182..f6990b9 100755
--- a/tinySIGCOMP/src/zutil.h
+++ b/tinySIGCOMP/src/zutil.h
@@ -26,14 +26,14 @@
#endif
#ifdef NO_ERRNO_H
# ifdef _WIN32_WCE
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used. We rename it to
- * avoid conflict with other libraries that use the same workaround.
- */
+/* The Microsoft C Run-Time Library for Windows CE doesn't have
+ * errno. We define it as a global variable to simplify porting.
+ * Its value is always 0 and should not be used. We rename it to
+ * avoid conflict with other libraries that use the same workaround.
+ */
# define errno z_errno
# endif
- extern int errno;
+extern int errno;
#else
# ifndef _WIN32_WCE
# include <errno.h>
@@ -60,7 +60,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
return (strm->msg = (char*)ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
- /* common constants */
+/* common constants */
#ifndef DEF_WBITS
# define DEF_WBITS MAX_WBITS
@@ -85,15 +85,15 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
- /* target dependencies */
+/* target dependencies */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__)
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
+/* Allow compilation with ANSI keywords only enabled */
+void _Cdecl farfree( void *block );
+void *_Cdecl farmalloc( unsigned long nbytes );
# else
# include <alloc.h>
# endif
@@ -119,7 +119,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef OS2
# define OS_CODE 0x06
# ifdef M_I86
- #include <malloc.h>
+#include <malloc.h>
# endif
#endif
@@ -156,7 +156,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
- typedef int ptrdiff_t;
+typedef int ptrdiff_t;
# define _PTRDIFF_T_DEFINED
# endif
# else
@@ -164,7 +164,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
- /* common defaults */
+/* common defaults */
#ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */
@@ -174,7 +174,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define F_OPEN(name, mode) fopen((name), (mode))
#endif
- /* functions */
+/* functions */
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
# ifndef HAVE_VSNPRINTF
@@ -188,15 +188,15 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+ but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
# define NO_vsnprintf
# endif
# ifdef WIN32
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# define vsnprintf _vsnprintf
# endif
@@ -213,10 +213,10 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define NO_MEMCPY
#endif
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
- * You may have to use the same strategy for Borland C (untested).
- * The __SC__ check is for Symantec.
- */
+/* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
# define NO_MEMCPY
#endif
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
@@ -233,16 +233,16 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
- extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- extern void zmemzero OF((Bytef* dest, uInt len));
+extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+extern void zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
- extern int z_verbose;
- extern void z_error OF((char *m));
+extern int z_verbose;
+extern void z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
diff --git a/tinySIGCOMP/test/rfc4465_torture_tests.h b/tinySIGCOMP/test/rfc4465_torture_tests.h
index 11d9437..891611a 100755
--- a/tinySIGCOMP/test/rfc4465_torture_tests.h
+++ b/tinySIGCOMP/test/rfc4465_torture_tests.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -21,16 +21,18 @@
#ifndef _RFC4465_TORTURE_TESTS_H_
#define _RFC4465_TORTURE_TESTS_H_
-typedef struct rfc4465_struct_torture_test
-{
- const char* section_name;
- const char* bytecode;
- size_t bytecode_size;
- struct{ tsk_size_t size; const char* ptr; } xoutput; // Excepted output
- signed xcycles; // Excepted cycles
- int stream;
- int xfail;
- const char* comp_id;
+typedef struct rfc4465_struct_torture_test {
+ const char* section_name;
+ const char* bytecode;
+ size_t bytecode_size;
+ struct {
+ tsk_size_t size;
+ const char* ptr;
+ } xoutput; // Excepted output
+ signed xcycles; // Excepted cycles
+ int stream;
+ int xfail;
+ const char* comp_id;
}
struct_torture_test, *lpstruct_torture_test;
@@ -66,7 +68,7 @@ struct_torture_test, *lpstruct_torture_test;
*/
#define RFC4465_A_1_4__SHA1 \
"\xf8\x08\x71\x0d\xa0\xc3\x03\xa0\x44\x22\xa0\x44\x14\x0d\xa0\xc6\x38\xa0\x44\x22\xa0\x44\x14\x0e\x86\xa0\xfe\x0e\xa0\x42\xa0\xff\x0d\xa0\xfe\x8e\xa0\x44\x22\xa0\x44\x14\x0e\x86\xa0\xff\x0e\xa0\x42\xa1\x07\x0d\xa0\xff\xa2\x80\xa0\xff\x22\xa0\xff\x14\x23\x00\x00\x00\x00\x00\x00\x00\x61\x62\x63\x61\x62\x63\x64\x62\x63\x64\x65\x63\x64\x65\x66\x64\x65\x66\x67\x65\x66\x67\x68\x66\x67\x68\x69\x67\x68\x69\x6a\x68\x69\x6a\x6b\x69\x6a\x6b\x6c\x6a\x6b\x6c\x6d\x6b\x6c\x6d\x6e\x6c\x6d\x6e\x6f\x6d\x6e\x6f\x70\x6e\x6f\x70\x71\x61\x30\x31\x32\x33\x34\x35\x36\x37"
-
+
/*************************************************************
*** A.1.5. LOAD and MULTILOAD
@@ -86,21 +88,21 @@ struct_torture_test, *lpstruct_torture_test;
*/
#define RFC4465_A_1_6__COPY \
"\xf8\x03\x91\x0e\x20\x8e\x0e\x86\x86\x0e\xa0\x42\x87\x12\x20\x87\x21\x0e\x86\x80\x41\x00\x12\x86\xa0\x55\xa0\x41\x22\x20\xa0\x77\x0e\x86\x20\x0e\xa0\x42\x30\x15\x20\x04\xa0\x41\x01\x12\x20\x04\x30\x22\x30\x04\x12\x30\x04\x2e\x22\x20\x02\x23"
-
+
/*************************************************************
*** A.1.7. COPY-LITERAL and COPY-OFFSET
*/
#define RFC4465_A_1_7__COPY_LITERAL_and_COPY_OFFSET \
"\xf8\x06\x11\x0e\x20\x80\x41\x00\x0e\x86\x86\x0e\xa0\x42\x87\x0e\xa0\x44\x21\x13\x20\x87\x22\x22\x86\x08\x0e\xa0\x44\xa0\x9c\x13\x20\x02\x22\x22\xa0\x9c\x02\x0e\x86\xa0\x48\x0e\xa0\x42\xa0\x52\x0e\xa0\x44\xa0\x52\x15\xa0\x48\x0a\xa0\x41\x01\x14\x02\x06\x22\x0e\xa0\x46\x06\x14\x63\x04\x22\x22\x61\x0a\x0e\xa0\x44\xa0\x50\x14\x04\x04\x22\x22\xa0\x44\x02\x14\x05\x04\x22\x22\xa0\x44\x02\x22\x60\x0a\x23"
-
+
/*************************************************************
*** A.1.8. MEMSET
*/
#define RFC4465_A_1_8__MEMSET \
"\xf8\x01\x81\x0e\x86\x87\x0e\xa0\x42\xa0\x81\x15\x86\xa0\x81\x00\x01\x15\xa0\x81\x0f\x86\x0f\x22\x87\x10\x23"
-
+
/*************************************************************
*** A.1.9. CRC
@@ -111,7 +113,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_9__CRC_2 \
"\xf8\x01\x81\x15\xa0\x46\x18\x01\x01\x15\xa0\x5e\x14\x87\x01\x1c\x02\xa0\x44\x13\x1b\x62\xa0\x46\x2c\x0e\x23"\
"\xab\xcb"
-
+
/*************************************************************
*** A.1.10. INPUT-BITS
@@ -119,7 +121,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_10__INPUT_BITS \
"\xf8\x01\x51\x1d\x62\xa0\x46\x14\x22\xa0\x46\x02\x06\x22\x01\x0a\x22\x07\x06\x22\x01\x16\xee\x23"\
"\x93\x2e\xac\x71"
-
+
/*************************************************************
*** A.1.11. INPUT-HUFFMAN
@@ -127,7 +129,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_11__INPUT_HUFFMAN \
"\xf8\x01\xd1\x1e\xa0\x46\x1c\x02\x62\x00\x62\x62\x62\x00\xff\x00\x22\xa0\x46\x02\x06\x22\x01\x0a\x22\x07\x06\x22\x01\x16\xe6\x23"\
"\x93\x2e\xac\x71\x66\xd8\x6f"
-
+
/*************************************************************
@@ -136,21 +138,21 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_12__INPUT_BYTES \
"\xf8\x02\x71\x0e\x86\xa0\x48\x0e\xa0\x42\xa0\x4c\x1d\x62\xa0\x46\x1d\x22\xa0\x46\x02\x06\x22\x02\x0a\x22\x07\x1c\x62\xa0\x48\x0e\x22\xa0\x48\x62\x06\x22\x01\x16\xe5\x23"\
"\x93\x2e\xac\x71\x66\xd8\x6f\xb1\x59\x2b\xdc\x9a\x97\x34\xd8\x47\xa7\x33\x87\x4e\x1b\xcb\xcd\x51\xb5\xdc\x96\x59\x9d\x6a"
-
+
/*************************************************************
*** A.1.13. Stack Manipulation
*/
#define RFC4465_A_1_13__Stack_Manipulation \
"\xf8\x14\x11\x0e\xa0\x46\x86\x10\x02\x10\x60\x10\xa0\x42\x22\x86\x08\x11\x86\x11\x63\x11\xa0\x46\x22\x86\x08\x16\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xa0\x46\x20\x0e\xa0\x48\xa1\x40\x07\x24\x88\x18\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xa0\x46\xa1\x7f\x0e\xa1\x7f\x1a\x0f\xa1\xb0\x03\x01\x80\xc0\x01\x8f\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23"
-
+
/*************************************************************
*** A.1.14. Program Flow
*/
#define RFC4465_A_1_14__Program_Flow \
"\xf8\x03\xf1\x0e\xa0\x44\x04\x0e\x86\xa0\x92\x07\x20\xa0\x90\x22\xa0\x43\x01\x16\x60\x06\x21\x01\x0e\x86\xa0\x84\x07\x20\xa0\xa1\x22\xa0\x43\x01\x17\x61\x06\x60\xf1\x06\x07\x22\x01\x0e\x86\xa0\x84\x07\x20\xa0\xb6\x22\xa0\x43\x01\x1a\x04\x62\x08\x60\x9f\xdc\xf1\x23"
-
+
/*************************************************************
*** A.1.15. State Creation_1
@@ -158,7 +160,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_1 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x01"
-
+
/*************************************************************
*** A.1.15. State Creation_2
@@ -166,7 +168,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_2 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x02"
-
+
/*************************************************************
*** A.1.15. State Creation_3
@@ -174,7 +176,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_3 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x03"
-
+
/*************************************************************
*** A.1.15. State Creation_4
@@ -182,7 +184,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_4 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x04\x05"
-
+
/*************************************************************
*** A.1.15. State Creation_5
@@ -190,7 +192,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_5 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x04\x15"
-
+
/*************************************************************
*** A.1.15. State Creation_6
@@ -198,7 +200,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_6 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x04\x06"
-
+
/*************************************************************
*** A.1.15. State Creation_7
@@ -206,7 +208,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_7 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x09"
-
+
/*************************************************************
*** A.1.15. State Creation_8
@@ -214,7 +216,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_8 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x1e\x06"
-
+
/*************************************************************
*** A.1.15. State Creation_9
@@ -222,7 +224,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_9 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x1e\x07"
-
+
/*************************************************************
*** A.1.15. State Creation_10
@@ -230,7 +232,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_15__State_Creation_10 \
"\xf8\x09\x41\x1c\x01\xa0\x45\xff\x04\x22\x0b\x17\x62\x8f\x0d\x06\x06\x20\x0a\xa1\x0a\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x0c\x06\x06\x20\x0a\x88\x00\x14\x00\x04\x22\x01\x17\x62\x8f\x16\x06\x06\x1c\x01\xa0\x47\x9f\xd2\x21\xa0\x48\x63\x12\xa0\xe3\x63\xa0\x48\x04\x22\x01\x17\x62\x8f\x0a\x06\x06\x21\xa0\xe3\x06\x04\x22\x01\x17\x62\x8f\x0e\x06\x06\x23\x00\x00\x0a\x88\x00\x14\x00\x23\x00\x00\x00\x00\x00\x00\x00\x43\x7a\xe8\x0a\x0f\xdc\x1e\x6a\x87\xc1\xb6\x2a\x76\x76\xb9\x73\x31\x8c\x0e\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xcc\x3f\xee\x79\xbc\xfc\x8f\xd1\x08\x65\xe8\x03\x52\xee\x29\x77\x17\xdf\x57"\
"\x1e\14"
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS Set up bytecode}
@@ -238,7 +240,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS__SETUP \
"\xf8\x19\x01\x23\x00\x00\x10\x89\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\xa2\x0c\x04\x23\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74"\
""
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS_1
@@ -246,7 +248,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS_1 \
"\xf8\x19\x41\x1c\x01\xa0\x45\xff\x17\x62\x01\x06\x0d\x1c\x1f\x89\x14\x00\x00\x00\x89\x1f\x89\x14\x0c\x04\xa0\x46\x00\x22\xa0\x46\x04\x16\xa1\x46\x17\x62\x03\x06\x10\x1b\x1f\x87\x14\x00\x00\x00\x00\x16\xa1\x36\x1f\x89\x13\x06\x04\xa0\x46\x00\x16\xa1\x2b\x1f\x89\x14\x0c\x05\xa0\x46\x00\x16\xa1\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\xf8\xbc\x3e\x20\x93\xb5\xab\xe1\xf1\x70\x13\x42\x4c\xe7\xfe\x05\xe0\x69\x39"\
"\x00"
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS_2
@@ -254,7 +256,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS_2 \
"\xf8\x19\x41\x1c\x01\xa0\x45\xff\x17\x62\x01\x06\x0d\x1c\x1f\x89\x14\x00\x00\x00\x89\x1f\x89\x14\x0c\x04\xa0\x46\x00\x22\xa0\x46\x04\x16\xa1\x46\x17\x62\x03\x06\x10\x1b\x1f\x87\x14\x00\x00\x00\x00\x16\xa1\x36\x1f\x89\x13\x06\x04\xa0\x46\x00\x16\xa1\x2b\x1f\x89\x14\x0c\x05\xa0\x46\x00\x16\xa1\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\xf8\xbc\x3e\x20\x93\xb5\xab\xe1\xf1\x70\x13\x42\x4c\xe7\xfe\x05\xe0\x69\x39"\
"\x01"
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS_3
@@ -262,7 +264,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS_3 \
"\xf8\x19\x41\x1c\x01\xa0\x45\xff\x17\x62\x01\x06\x0d\x1c\x1f\x89\x14\x00\x00\x00\x89\x1f\x89\x14\x0c\x04\xa0\x46\x00\x22\xa0\x46\x04\x16\xa1\x46\x17\x62\x03\x06\x10\x1b\x1f\x87\x14\x00\x00\x00\x00\x16\xa1\x36\x1f\x89\x13\x06\x04\xa0\x46\x00\x16\xa1\x2b\x1f\x89\x14\x0c\x05\xa0\x46\x00\x16\xa1\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\xf8\xbc\x3e\x20\x93\xb5\xab\xe1\xf1\x70\x13\x42\x4c\xe7\xfe\x05\xe0\x69\x39"\
"\x02"
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS_4
@@ -270,7 +272,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS_4 \
"\xf8\x19\x41\x1c\x01\xa0\x45\xff\x17\x62\x01\x06\x0d\x1c\x1f\x89\x14\x00\x00\x00\x89\x1f\x89\x14\x0c\x04\xa0\x46\x00\x22\xa0\x46\x04\x16\xa1\x46\x17\x62\x03\x06\x10\x1b\x1f\x87\x14\x00\x00\x00\x00\x16\xa1\x36\x1f\x89\x13\x06\x04\xa0\x46\x00\x16\xa1\x2b\x1f\x89\x14\x0c\x05\xa0\x46\x00\x16\xa1\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\xf8\xbc\x3e\x20\x93\xb5\xab\xe1\xf1\x70\x13\x42\x4c\xe7\xfe\x05\xe0\x69\x39"\
"\x03"
-
+
/*************************************************************
*** A.1.16. STATE-ACCESS_5
@@ -278,11 +280,11 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_1_16__STATE_ACCESS_5 \
"\xf8\x19\x41\x1c\x01\xa0\x45\xff\x17\x62\x01\x06\x0d\x1c\x1f\x89\x14\x00\x00\x00\x89\x1f\x89\x14\x0c\x04\xa0\x46\x00\x22\xa0\x46\x04\x16\xa1\x46\x17\x62\x03\x06\x10\x1b\x1f\x87\x14\x00\x00\x00\x00\x16\xa1\x36\x1f\x89\x13\x06\x04\xa0\x46\x00\x16\xa1\x2b\x1f\x89\x14\x0c\x05\xa0\x46\x00\x16\xa1\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\xf8\xbc\x3e\x20\x93\xb5\xab\xe1\xf1\x70\x13\x42\x4c\xe7\xfe\x05\xe0\x69\x39"\
"\x04"
-
+
/*************************************************************
*** A.2.1. Useful Values_1 (NOT from rfc4465)
-*/
+*/
#define RFC4465_A_2_1__Useful_Values_1 \
"\xf8\x05\xa1\x0e\x86\x20\x0e\xa0\x42\x21\x17\x42\x02\xf8\x06\xf8\x17\x43\x00\xf2\x06\x0c\x17\x44\x00\xec"\
"\x3f\xec\x17\x44\xa3\xc0\xe6\x07\xe6\x1c\x01\xa0\x47\x9f\xdf\x06\x23\x40\x07\x23\x01\x12\x20\x01\x63\x1c"\
@@ -295,7 +297,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_1__Useful_Values_2 \
"\xf9\x46\x84\x75\x55\xd9\x2d"\
"\x00\x00"
-
+
/*************************************************************
*** A.2.1. Useful Values_3 (NOT from rfc4465)
@@ -303,7 +305,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_1__Useful_Values_3 \
"\xf9\x46\x84\x75\x55\xd9\x2d"\
"\x00\x01"
-
+
/*************************************************************
*** A.2.1. Useful Values_4
@@ -311,7 +313,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_1__Useful_Values_4 \
"\xf9\x46\x84\x75\x55\xd9\x2d"\
"x01\x00"
-
+
/*************************************************************
*** A.2.2. Cycles Checking
@@ -319,7 +321,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_2__Cycles_Checking \
"\xf8\x01\xa1\x0f\x86\x04\x20\x29\x00\x22\x12\xa0\x44\x02\x60\x14\x02\xa0\x64\x23\x22\xa0\x44\x02\x06\x22\x01\x16\xef"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -327,7 +329,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_1 \
"\xf8"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -335,7 +337,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_2 \
"\xf8\x00"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -343,7 +345,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_3 \
"\xf8\x00\xe1\x06\x00\x11\x22\x00\x02\x23\x00\x00\x00\x00\x00\x00\x01"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -351,7 +353,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_4 \
"\xf8\x00\xf1\x06\x00\x11\x22\x00\x02\x23\x00\x00\x00\x00\x00\x00\x01"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -359,7 +361,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_5 \
"\xf8\x00\xe0\x06\x00\x11\x22\x00\x02\x23\x00\x00\x00\x00\x00\x00\x01"\
""
-
+
/*************************************************************
*** A.2.3. Message-based Transport
@@ -367,7 +369,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_3_Message_based_Transport_6 \
"\xf8\x00\xee\x06\x00\x11\x22\x00\x02\x23\x00\x00\x00\x00\x00\x00\x01"\
""
-
+
/*************************************************************
*** A.2.4. Stream-based Transport_1 (Outputs 2 messages. This why "RFC4465_A_2_4_Stream_based_Transport_2" is missing)
@@ -375,7 +377,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_4_Stream_based_Transport_1\
"\xff\xff\xf8\x01\x71\x08\x00\x02\x22\x00\x02\x22\xa0\x92\x05\x23\x00\x00\x00\x00\x00\x00\x00\xff\x00\xff\x03\xff\xff\xff\xff\xff\xff\xff\xf8\x01\x7e\x08\x00\x02\x22\x00\x02\x22\xa3\xd2\x05\x23\x00\x00\x00\x00\x00\x00\x00\xff\x04\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"\
""
-
+
/*************************************************************
*** A.2.4. Stream-based Transport_3
@@ -383,7 +385,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_4_Stream_based_Transport_3\
"\xf8\xff\xff"\
""
-
+
/*************************************************************
*** A.2.4. Stream-based Transport_4
@@ -391,7 +393,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_4_Stream_based_Transport_4\
"\xf8\x00\xff\xff"\
""
-
+
/*************************************************************
*** A.2.4. Stream-based Transport_5
@@ -399,7 +401,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_4_Stream_based_Transport_5\
"\xf8\x01\x81\x08\x00\x02\x22\x00\x02\x22\xa0\x92\x05\x23\xff\xff\x00\x00\x00\x00\x00\x00\x00\xff\x00\xff\x03\xff\xff\xff"\
""
-
+
/*************************************************************
*** A.2.4. Stream-based Transport_6
@@ -407,7 +409,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_4_Stream_based_Transport_6\
"\xf8\x01\x70\x08\x00\x02\x22\x00\x02\x22\xa0\x92\x05\x23\xff\xff\x00\x00\x00\x00\x00\x00\x00\xff\x04\xff\xff\xff\xff"\
""
-
+
/*************************************************************
@@ -416,7 +418,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_5__Input_Past_the_End_of_a_Message_1\
"\xf8\x03\x21\x0e\x86\xa0\x46\x0e\xa0\x42\xa0\x4d\x1d\x09\xa0\x46\x0a\x1c\x07\xa0\x46\x06\x00\x1d\x07\xa0\x46\xff\x1c\x02\xa0\x46\xfa\x22\xa0\x46\x02\x1d\x10\xa0\x46\x06\x00\x1d\x08\xa0\x46\xff\x22\xa0\x47\x01\x23"\
"\xff\xfa\x00\x68\x69\x21"
-
+
/*************************************************************
*** A.2.5. Input Past the End of a Message_2
@@ -424,7 +426,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_2_5__Input_Past_the_End_of_a_Message_2\
"\xf8\x03\x21\x0e\x86\xa0\x46\x0e\xa0\x42\xa0\x4d\x1d\x09\xa0\x46\x0a\x1c\x07\xa0\x46\x06\x00\x1d\x07\xa0\x46\xff\x1c\x02\xa0\x46\xfa\x22\xa0\x46\x02\x1d\x10\xa0\x46\x06\x00\x1d\x08\xa0\x46\xff\x22\xa0\x47\x01\x23"\
"\xff\xfa\x00\x68\x69"
-
+
/*************************************************************
@@ -433,7 +435,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_1__SigComp_Feedback_Mechanism_1\
"\xf8\x05\x03\x1c\x01\xa0\x41\xa0\x55\x17\x60\x01\x07\x0e\xa0\x4f\x0e\xa0\x42\xa4\x7f\x16\x0e\x0e\xa0\x42\xa4\xff\x15\xa0\x44\xa0\x7f\x01\x01\x0e\xa0\xc3\xa8\x01\x0e\xa0\xc5\xa6\x00\x0e\xa0\xcc\xac\x00\x0e\xa0\xd9\xb4\x00\x0e\xa0\xee\xb5\x00\x15\xa0\xc6\x06\x00\x01\x15\xa0\xcd\x0c\x00\x01\x15\xa0\xda\x14\x00\x01\x23\xa0\x42\xa0\xc3"\
"\x00"
-
+
/*************************************************************
*** A.3.1. SigComp Feedback Mechanism_2
@@ -441,7 +443,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_1__SigComp_Feedback_Mechanism_2\
"\xf8\x05\x03\x1c\x01\xa0\x41\xa0\x55\x17\x60\x01\x07\x0e\xa0\x4f\x0e\xa0\x42\xa4\x7f\x16\x0e\x0e\xa0\x42\xa4\xff\x15\xa0\x44\xa0\x7f\x01\x01\x0e\xa0\xc3\xa8\x01\x0e\xa0\xc5\xa6\x00\x0e\xa0\xcc\xac\x00\x0e\xa0\xd9\xb4\x00\x0e\xa0\xee\xb5\x00\x15\xa0\xc6\x06\x00\x01\x15\xa0\xcd\x0c\x00\x01\x15\xa0\xda\x14\x00\x01\x23\xa0\x42\xa0\xc3"\
"\x01"
-
+
/*************************************************************
*** A.3.2. State Memory Management_1
@@ -449,7 +451,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_1\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x00"
-
+
/*************************************************************
*** A.3.2. State Memory Management_2
@@ -457,7 +459,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_2\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x01"
-
+
/*************************************************************
*** A.3.2. State Memory Management_3
@@ -465,7 +467,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_3\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x02"
-
+
/*************************************************************
*** A.3.2. State Memory Management_4
@@ -473,7 +475,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_4\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x03"
-
+
/*************************************************************
*** A.3.2. State Memory Management_5
@@ -481,7 +483,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_5\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x04"
-
+
/*************************************************************
*** A.3.2. State Memory Management_6
@@ -489,7 +491,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_6\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x05"
-
+
/*************************************************************
*** A.3.2. State Memory Management_7
@@ -497,7 +499,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_2__State_Memory_Management_7\
"\xf8\x1b\xa1\x0f\x86\x02\x89\xa2\x04\x1c\x01\xa0\x47\xf9\x17\x63\x05\x08\xa0\x68\xa0\x70\x17\x63\x03\x07\x34\xa0\x56\x08\x23\x06\x06\x23\xa2\x04\x0e\xa0\x44\x63\x06\x23\x06\x12\x62\x02\xa0\x4a\x17\x62\x63\x08\xa0\x58\x9f\xd2\x0e\xa0\x48\x65\x08\x24\x88\x20\x64\x89\x00\x06\x65\x06\x22\x02\x16\xe3\x1f\xa2\x16\x06\x00\x00\x00\x00\x1f\xa2\x1c\x06\x00\x00\x00\x00\x1f\xa2\x22\x06\x00\x00\x00\x00\x1f\xa2\x2e\x06\x00\x00\x00\x00\x16\x1e\x1f\xa2\x28\x06\x00\x00\x00\x00\x16\x14\x20\x8b\x89\x00\x06\x00\x16\x0c\x1f\xa2\x34\x06\x00\x00\x00\x00\x16\x02\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x65\x73\x74\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x02\x00\x01\x00\x00\x8e\xea\x4b\x43\xa7\x87\xf9\x01\x0e\xef\x56\x7b\x23\x9a\x34\x6b\x15\xa6\xb4\x0f\xc0\xe4\x4d\x2c\xd4\xa2\x21\x47\xe6\x0a\xef\xf2\xbc\x0f\xb6\xaf"\
"\x06"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_1
@@ -505,7 +507,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_1\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x00"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_2
@@ -513,7 +515,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_2\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x01"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_3
@@ -521,7 +523,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_3\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x02"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_4
@@ -529,7 +531,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_4\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x03"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_5
@@ -537,7 +539,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_5\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x04"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_6
@@ -545,7 +547,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_6\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x05"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_7
@@ -553,7 +555,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_7\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x06"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_8
@@ -561,7 +563,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_8\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x07"
-
+
/*************************************************************
*** A.3.3. Multiple Compartments_9
@@ -569,7 +571,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_3__Multiple_Compartments_9\
"\xf8\x1b\x11\x0f\x86\x02\x89\xa2\x07\x1c\x01\xa0\x45\xf9\x17\x62\x03\x0d\x3d\x06\x17\x62\x05\x37\x86\xa0\x68\x06\x22\x89\x20\xa1\xc0\x62\x00\x06\x00\x06\x22\x03\x20\xa1\xc0\x62\x00\x06\x00\x07\x22\xa2\x02\x0a\x22\x03\x06\x22\xa2\x03\x20\xa1\xc0\x62\x00\x06\x00\x20\xa1\xc0\xa2\x06\x00\x06\x62\x16\x2b\x20\xa7\xc0\x20\x00\x06\x00\x16\x22\x1f\xa2\x13\x06\x00\x00\x00\x00\x1f\xa2\x19\x06\x00\x00\x00\x00\x1f\xa2\x25\x06\x00\x00\x00\x00\x1f\xa2\x2b\x06\x00\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x17\x62\x07\x06\x10\x1a\x1f\xa2\x07\x06\x00\x00\x00\x00\x16\xea\x1f\xa2\x0d\x06\x00\x00\x00\x00\x16\xe0\x1f\xa2\x1f\x06\x00\x00\x00\x00\x16\x9f\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\xac\xa6\x0b\x8e\xb2\x83\x9d\xbf\xaf\xc6\x3d\xd2\x34\xc5\xd9\x1d\x53\x61\xbd\xd6\xba\x2a\xc6\x5a\x47\xc2\x18\x14\xee\x07\xc2\x75\x94\x1d\xd7\xa1\x48\x87\x9c\x8d\xe9\x0e"\
"\x08"
-
+
/*************************************************************
*** A.3.4. Accessing RFC 3485 State
@@ -577,7 +579,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_4__Accessing_RFC_3485_State\
"\xf8\x03\xa1\x1f\xa0\xa6\x14\xac\xfe\x01\x20\x00\x1f\xa0\xa6\x06\xac\xff\x01\x21\x00\x1f\xa0\xa6\x0c\xad\x00\x01\x22\x00\x22\x20\x03\x23\x00\x00\x00\x00\x00\x00\x00\xfb\xe5\x07\xdf\xe5\xe6\xaa\x5a\xf2\xab\xb9\x14\xce\xaa\x05\xf9\x9c\xe6\x1b\xa5"\
""
-
+
/*************************************************************
*** A.3.5. Bytecode State Creation_1
@@ -585,7 +587,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_5__Bytecode_State_Creation_1\
"\xf8\x04\x61\x12\xa0\xbe\x08\x1e\x20\x08\x1e\x21\x06\x0a\x0e\x23\xbe\x03\x12\xa0\xbe\x08\xa0\x50\x20\x08\xa0\x50\xa0\x53\x14\x0a\x20\x08\xa0\x50\xa0\x53\x0c\x0a\x16\x06\x00\x4f\x4b\x31\x1c\x01\xa0\xb3\xfc\x22\xa0\xa8\x03\x23\x00\x00\x0d\xa0\xa8\xa0\xab\x06\x0a\x4f\x4b\x32\x22\xa0\x50\x03\x23\x02"\
""
-
+
/*************************************************************
*** A.3.5. Bytecode State Creation_2
@@ -593,7 +595,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_5__Bytecode_State_Creation_2\
"\xf9\x05\xb8\x8c\xe7\x2c\x91\x03"\
""
-
+
/*************************************************************
*** A.3.5. Bytecode State Creation_3
@@ -601,7 +603,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_5__Bytecode_State_Creation_3\
"\xfb\x24\x63\xcd\xff\x5c\xf8\xc7\x6d\xf6\xa2\x89\xff"\
""
-
+
/*************************************************************
*** A.3.5. Bytecode State Creation_4
@@ -609,7 +611,7 @@ struct_torture_test, *lpstruct_torture_test;
#define RFC4465_A_3_5__Bytecode_State_Creation_4\
"\xf9\x5b\x4b\x43\xd5\x67\x83"\
""
-
+
/*************************************************************
*** A.3.5. Bytecode State Creation_5
diff --git a/tinySIGCOMP/test/stdafx.c b/tinySIGCOMP/test/stdafx.c
index c303ba3..b773e42 100755
--- a/tinySIGCOMP/test/stdafx.c
+++ b/tinySIGCOMP/test/stdafx.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/test/stdafx.h b/tinySIGCOMP/test/stdafx.h
index 0ad4eea..c3468b1 100755
--- a/tinySIGCOMP/test/stdafx.h
+++ b/tinySIGCOMP/test/stdafx.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/test/targetver.h b/tinySIGCOMP/test/targetver.h
index 4631d99..936c7e0 100755
--- a/tinySIGCOMP/test/targetver.h
+++ b/tinySIGCOMP/test/targetver.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -23,8 +23,8 @@
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinySIGCOMP/test/test.c b/tinySIGCOMP/test/test.c
index b18c325..f4bf971 100755
--- a/tinySIGCOMP/test/test.c
+++ b/tinySIGCOMP/test/test.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,18 +44,18 @@ int main()
#endif
{
#if TEST_TORTURES
- test_tortures();
+ test_tortures();
#endif
#if TEST_MANAGER
- test_manager();
+ test_manager();
#endif
#if TEST_OSC
- test_osc();
+ test_osc();
#endif
-
- getchar();
- return 0;
+ getchar();
+
+ return 0;
}
diff --git a/tinySIGCOMP/test/test_manager.h b/tinySIGCOMP/test/test_manager.h
index bfcdfea..bd2f287 100755
--- a/tinySIGCOMP/test/test_manager.h
+++ b/tinySIGCOMP/test/test_manager.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,12 +32,11 @@
#define USE_ONLY_ACKED_STATES tsk_false // Should be false unless you know what you're doing
-typedef struct sigcomp_test_s
-{
- const char* description;
- const char* msg;
- tsk_bool_t is_client;
- tsk_bool_t tobe_lost;
+typedef struct sigcomp_test_s {
+ const char* description;
+ const char* msg;
+ tsk_bool_t is_client;
+ tsk_bool_t tobe_lost;
}
sigcomp_test_t;
@@ -46,233 +45,231 @@ sigcomp_test_t;
#define TOBE_LOST_YES tsk_true
#define TOBE_LOST_NO tsk_false
-static const sigcomp_test_t SIGCOMP_TESTS_CALL[]=
-{
- {
- "REGISTER (client -> server)",
- "REGISTER sip:doubango.org SIP/2.0\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357158829;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "From: <sip:001@doubango.org>;tag=357151115\r\n"
- "To: <sip:001@doubango.org>\r\n"
- "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b>;expires=3600;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Call-ID: 0473e8ff-2cd6-fada-70ab-ce8c9523db8c\r\n"
- "CSeq: 5493 REGISTER\r\n"
- "Content-Length: 0\r\n"
- "Max-Forwards: 70\r\n"
- "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
- "Privacy: none\r\n"
- "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
- "User-Agent: IM-client/OMA1.0 Boghe/v2.0.121.757\r\n"
- "P-Preferred-Identity: <sip:001@doubango.org>\r\n"
- "Supported: path\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- },
- {
- "200 REGISTER (server -> client)",
- "SIP/2.0 200 OK\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357158829;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "Contact: <sip:001@192.168.0.11:54027;transport=udp;sigcomp-id=\"urn:uuid:7556d001-9ca7-41a3-80b0-5b7725a91cc4\">;expires=2761;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Contact: <sip:001@192.168.0.11:50417;transport=udp;sigcomp-id=\"urn:uuid:6a8b493e-7dd8-45fb-b104-085723cbfb7b\">;expires=3025;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Contact: <sip:001@192.168.0.11:50464;transport=udp;sigcomp-id=\"urn:uuid:c5534343-0fb1-41a8-b4bc-612f04913d2a\">;expires=3409;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Contact: <sip:001@192.168.0.11:64547;transport=udp;sigcomp-id=\"urn:uuid:40ce6b6c-90b3-487d-8768-ae180a8153b1\">;expires=3487;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\">;expires=3600;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "To: <sip:001@doubango.org>;tag=4345c04e\r\n"
- "From: <sip:001@doubango.org>;tag=357151115\r\n"
- "Call-ID: 0473e8ff-2cd6-fada-70ab-ce8c9523db8c\r\n"
- "CSeq: 5493 REGISTER\r\n"
- "Content-Length: 0\r\n"
- "\r\n",
- IS_CLIENT_NO,
- TOBE_LOST_NO
- },
- {
- "INVITE (client -> server)",
- "INVITE sip:13131313@sip2sip.info SIP/2.0\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "From: <sip:001@doubango.org>;tag=357203612\r\n"
- "To: <sip:13131313@sip2sip.info>\r\n"
- "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b>;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"\r\n"
- "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
- "CSeq: 14727 INVITE\r\n"
- "Content-Type: application/sdp\r\n"
- "Content-Length: 989\r\n"
- "Max-Forwards: 70\r\n"
- "Accept-Contact: *;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"\r\n"
- "P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel\r\n"
- "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
- "Privacy: none\r\n"
- "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
- "User-Agent: IM-client/OMA1.0 Boghe/v2.0.121.757\r\n"
- "Supported: 100rel\r\n"
- "\r\n"
- "v=0\r\n"
- "o=doubango 1983 678901 IN IP4 192.168.0.11\r\n"
- "s=-\r\n"
- "c=IN IP4 192.168.0.11\r\n"
- "t=0 0\r\n"
- "m=audio 64550 RTP/SAVPF 0 8 97 101\r\n"
- "c=IN IP4 192.168.0.11\r\n"
- "a=ptime:20\r\n"
- "a=silenceSupp:off - - - -\r\n"
- "a=rtpmap:0 PCMU/8000/1\r\n"
- "a=rtpmap:8 PCMA/8000/1\r\n"
- "a=rtpmap:97 SPEEX/8000/1\r\n"
- "a=rtpmap:101 telephone-event/8000/1\r\n"
- "a=fmtp:101 0-16\r\n"
- "a=sendrecv\r\n"
- "a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:JaJaTgwhqSd2A7yQ842YPXASomulb95aX/Wa96T7\r\n"
- "a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:T3yTUA2dVXTr6v0jb+E1TR3Btj4xP3mPeaAtQbeC\r\n"
- "a=rtcp-mux\r\n"
- "a=ssrc:3301897658 cname:ldjWoB60jbyQlR6e\r\n"
- "a=ssrc:3301897658 mslabel:6994f7d1-6ce9-4fbd-acfd-84e5131ca2e2\r\n"
- "a=ssrc:3301897658 label:Doubango\r\n"
- "a=ice-ufrag:zNevtNKAGk6h7gJ\r\n"
- "a=ice-pwd:YaOV3FlWUkBmifZ87SP51\r\n"
- "a=mid:audio\r\n"
- "a=candidate:CuNeg0Keh 1 udp 2130706431 192.168.0.11 64550 typ host\r\n"
- "a=candidate:CuNeg0Keh 2 udp 2130706430 192.168.0.11 64551 typ host\r\n"
- "a=candidate:srflxCuNe 1 udp 1694498815 88.179.39.5 64550 typ srflx\r\n"
- "a=candidate:srflxCuNe 2 udp 1694498814 88.179.39.5 64551 typ srflx\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- },
- {
- "100 TRYING (server -> client)",
- "SIP/2.0 100 Trying\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "To: <sip:13131313@sip2sip.info>\r\n"
- "From: <sip:001@doubango.org>;tag=357203612\r\n"
- "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
- "CSeq: 14727 INVITE\r\n"
- "Content-Length: 0\r\n"
- "\r\n",
- IS_CLIENT_NO,
- TOBE_LOST_NO
- },
- {
- "488 Not acceptable (server -> client)",
- "SIP/2.0 488 Not acceptable here\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "To: <sip:13131313@sip2sip.info>;tag=as6edf9ce2\r\n"
- "From: <sip:001@doubango.org>;tag=357203612\r\n"
- "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
- "CSeq: 14727 INVITE\r\n"
- "Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH\r\n"
- "Server: Asterisk PBX\r\n"
- "Supported: replaces, timer\r\n"
- "Content-Length: 0\r\n"
- "\r\n",
- IS_CLIENT_NO,
- TOBE_LOST_NO
- },
- {
- "ACK (client -> server)",
- "ACK sip:13131313@sip2sip.info SIP/2.0\r\n"
- "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
- "From: <sip:001@doubango.org>;tag=357203612\r\n"
- "To: <sip:13131313@sip2sip.info>;tag=as6edf9ce2\r\n"
- "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
- "CSeq: 14727 ACK\r\n"
- "Content-Length: 0\r\n"
- "Max-Forwards: 70\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- }
+static const sigcomp_test_t SIGCOMP_TESTS_CALL[]= {
+ {
+ "REGISTER (client -> server)",
+ "REGISTER sip:doubango.org SIP/2.0\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357158829;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "From: <sip:001@doubango.org>;tag=357151115\r\n"
+ "To: <sip:001@doubango.org>\r\n"
+ "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b>;expires=3600;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Call-ID: 0473e8ff-2cd6-fada-70ab-ce8c9523db8c\r\n"
+ "CSeq: 5493 REGISTER\r\n"
+ "Content-Length: 0\r\n"
+ "Max-Forwards: 70\r\n"
+ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
+ "Privacy: none\r\n"
+ "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
+ "User-Agent: IM-client/OMA1.0 Boghe/v2.0.121.757\r\n"
+ "P-Preferred-Identity: <sip:001@doubango.org>\r\n"
+ "Supported: path\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ },
+ {
+ "200 REGISTER (server -> client)",
+ "SIP/2.0 200 OK\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357158829;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "Contact: <sip:001@192.168.0.11:54027;transport=udp;sigcomp-id=\"urn:uuid:7556d001-9ca7-41a3-80b0-5b7725a91cc4\">;expires=2761;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Contact: <sip:001@192.168.0.11:50417;transport=udp;sigcomp-id=\"urn:uuid:6a8b493e-7dd8-45fb-b104-085723cbfb7b\">;expires=3025;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Contact: <sip:001@192.168.0.11:50464;transport=udp;sigcomp-id=\"urn:uuid:c5534343-0fb1-41a8-b4bc-612f04913d2a\">;expires=3409;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Contact: <sip:001@192.168.0.11:64547;transport=udp;sigcomp-id=\"urn:uuid:40ce6b6c-90b3-487d-8768-ae180a8153b1\">;expires=3487;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\">;expires=3600;language=\"en,fr\";+g.oma.sip-im;+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "To: <sip:001@doubango.org>;tag=4345c04e\r\n"
+ "From: <sip:001@doubango.org>;tag=357151115\r\n"
+ "Call-ID: 0473e8ff-2cd6-fada-70ab-ce8c9523db8c\r\n"
+ "CSeq: 5493 REGISTER\r\n"
+ "Content-Length: 0\r\n"
+ "\r\n",
+ IS_CLIENT_NO,
+ TOBE_LOST_NO
+ },
+ {
+ "INVITE (client -> server)",
+ "INVITE sip:13131313@sip2sip.info SIP/2.0\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "From: <sip:001@doubango.org>;tag=357203612\r\n"
+ "To: <sip:13131313@sip2sip.info>\r\n"
+ "Contact: <sip:001@192.168.0.11:64549;transport=udp;sigcomp-id=urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b>;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"\r\n"
+ "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
+ "CSeq: 14727 INVITE\r\n"
+ "Content-Type: application/sdp\r\n"
+ "Content-Length: 989\r\n"
+ "Max-Forwards: 70\r\n"
+ "Accept-Contact: *;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"\r\n"
+ "P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel\r\n"
+ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
+ "Privacy: none\r\n"
+ "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
+ "User-Agent: IM-client/OMA1.0 Boghe/v2.0.121.757\r\n"
+ "Supported: 100rel\r\n"
+ "\r\n"
+ "v=0\r\n"
+ "o=doubango 1983 678901 IN IP4 192.168.0.11\r\n"
+ "s=-\r\n"
+ "c=IN IP4 192.168.0.11\r\n"
+ "t=0 0\r\n"
+ "m=audio 64550 RTP/SAVPF 0 8 97 101\r\n"
+ "c=IN IP4 192.168.0.11\r\n"
+ "a=ptime:20\r\n"
+ "a=silenceSupp:off - - - -\r\n"
+ "a=rtpmap:0 PCMU/8000/1\r\n"
+ "a=rtpmap:8 PCMA/8000/1\r\n"
+ "a=rtpmap:97 SPEEX/8000/1\r\n"
+ "a=rtpmap:101 telephone-event/8000/1\r\n"
+ "a=fmtp:101 0-16\r\n"
+ "a=sendrecv\r\n"
+ "a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:JaJaTgwhqSd2A7yQ842YPXASomulb95aX/Wa96T7\r\n"
+ "a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:T3yTUA2dVXTr6v0jb+E1TR3Btj4xP3mPeaAtQbeC\r\n"
+ "a=rtcp-mux\r\n"
+ "a=ssrc:3301897658 cname:ldjWoB60jbyQlR6e\r\n"
+ "a=ssrc:3301897658 mslabel:6994f7d1-6ce9-4fbd-acfd-84e5131ca2e2\r\n"
+ "a=ssrc:3301897658 label:Doubango\r\n"
+ "a=ice-ufrag:zNevtNKAGk6h7gJ\r\n"
+ "a=ice-pwd:YaOV3FlWUkBmifZ87SP51\r\n"
+ "a=mid:audio\r\n"
+ "a=candidate:CuNeg0Keh 1 udp 2130706431 192.168.0.11 64550 typ host\r\n"
+ "a=candidate:CuNeg0Keh 2 udp 2130706430 192.168.0.11 64551 typ host\r\n"
+ "a=candidate:srflxCuNe 1 udp 1694498815 88.179.39.5 64550 typ srflx\r\n"
+ "a=candidate:srflxCuNe 2 udp 1694498814 88.179.39.5 64551 typ srflx\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ },
+ {
+ "100 TRYING (server -> client)",
+ "SIP/2.0 100 Trying\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "To: <sip:13131313@sip2sip.info>\r\n"
+ "From: <sip:001@doubango.org>;tag=357203612\r\n"
+ "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
+ "CSeq: 14727 INVITE\r\n"
+ "Content-Length: 0\r\n"
+ "\r\n",
+ IS_CLIENT_NO,
+ TOBE_LOST_NO
+ },
+ {
+ "488 Not acceptable (server -> client)",
+ "SIP/2.0 488 Not acceptable here\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport=64549;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "To: <sip:13131313@sip2sip.info>;tag=as6edf9ce2\r\n"
+ "From: <sip:001@doubango.org>;tag=357203612\r\n"
+ "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
+ "CSeq: 14727 INVITE\r\n"
+ "Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH\r\n"
+ "Server: Asterisk PBX\r\n"
+ "Supported: replaces, timer\r\n"
+ "Content-Length: 0\r\n"
+ "\r\n",
+ IS_CLIENT_NO,
+ TOBE_LOST_NO
+ },
+ {
+ "ACK (client -> server)",
+ "ACK sip:13131313@sip2sip.info SIP/2.0\r\n"
+ "Via: SIP/2.0/UDP 192.168.0.11:64549;branch=z9hG4bK357179240;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:d343a50a-2961-4a25-93d8-4e0677b68e6b\"\r\n"
+ "From: <sip:001@doubango.org>;tag=357203612\r\n"
+ "To: <sip:13131313@sip2sip.info>;tag=as6edf9ce2\r\n"
+ "Call-ID: da91debf-0033-dd9e-9c8d-e9018f825c8f\r\n"
+ "CSeq: 14727 ACK\r\n"
+ "Content-Length: 0\r\n"
+ "Max-Forwards: 70\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ }
};
-static const sigcomp_test_t SIGCOMP_TESTS_SUBSCRIBE[]=
-{
- {
- "REGISTER (client -> server)",
- "REGISTER sip:test.3gpp.com SIP/2.0\r\n"
- "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403432184;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
- "From: <sip:johndoe@test.3gpp.com>;tag=1403421024\r\n"
- "To: <sip:johndoe@test.3gpp.com>\r\n"
- "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;expires=600000;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Call-ID: afac1d20-b998-2720-6407-7bbbc77ace9b\r\n"
- "CSeq: 27335 REGISTER\r\n"
- "Content-Length: 0\r\n"
- "Max-Forwards: 70\r\n"
- "Authorization: Digest username=\"johndoe@test.3gpp.com\",realm=\"test.3gpp.com\",nonce=\"\",uri=\"sip:test.3gpp.com\",response=\"\"\r\n"
- "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
- "Privacy: none\r\n"
- "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
- "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
- "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
- "Supported: path\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- },
- {
- "200 REGISTER (server -> client)",
- "SIP/2.0 200 OK\r\n"
- "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403432184;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
- "From: <sip:johndoe@test.3gpp.com>;tag=1403421024\r\n"
- "To: <sip:johndoe@test.3gpp.com>;tag=T91612B6\r\n"
- "Call-ID: afac1d20-b998-2720-6407-7bbbc77ace9b\r\n"
- "CSeq: 27335 REGISTER\r\n"
- "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;q=0.500;expires = 600000;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
- "Content-Length: 0\r\n"
- "Date: Fri, 25 Jan 2013 09:20:31 GMT\r\n"
- "P-Associated-URI: <sip:johndoe@test.3gpp.com>\r\n"
- "Server: Agilent_IMS-SIP_Server/4.11.0.0\r\n"
- "\r\n",
- IS_CLIENT_NO,
- TOBE_LOST_NO
- },
- {
- "SUBSCRIBE-1 (client -> server)",
- "SUBSCRIBE sip:johndoe@test.3gpp.com SIP/2.0\r\n"
- "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403431204;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
- "From: <sip:johndoe@test.3gpp.com>;tag=1403442750\r\n"
- "To: <sip:johndoe@test.3gpp.com>\r\n"
- "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;+g.oma.sip-im;language=\"en,fr\"\r\n"
- "Call-ID: 8c1a2260-c6e7-d415-2492-88493471d6fd\r\n"
- "CSeq: 24466 SUBSCRIBE\r\n"
- "Expires: 600000\r\n"
- "Content-Length: 0\r\n"
- "Max-Forwards: 70\r\n"
- "Event: reg\r\n"
- "Accept: application/reginfo+xml\r\n"
- "Allow-Events: refer, presence, presence.winfo, xcap-diff, conference\r\n"
- "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
- "Privacy: none\r\n"
- "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
- "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
- "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- },
- {
- "SUBSCRIBE-2 (client -> server)",
- "SUBSCRIBE sip:johndoe@test.3gpp.com SIP/2.0\r\n"
- "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403422374;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
- "From: <sip:johndoe@test.3gpp.com>;tag=1403431575\r\n"
- "To: <sip:johndoe@test.3gpp.com>\r\n"
- "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;+g.oma.sip-im;language=\"en,fr\"\r\n"
- "Call-ID: 05952487-8f39-ddbd-ebac-72a3f33eaf8d\r\n"
- "CSeq: 32393 SUBSCRIBE\r\n"
- "Expires: 600000\r\n"
- "Content-Length: 0\r\n"
- "Max-Forwards: 70\r\n"
- "Event: message-summary\r\n"
- "Accept: application/simple-message-summary\r\n"
- "Allow-Events: refer, presence, presence.winfo, xcap-diff, conference\r\n"
- "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
- "Privacy: none\r\n"
- "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
- "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
- "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
- "\r\n",
- IS_CLIENT_YES,
- TOBE_LOST_NO
- },
+static const sigcomp_test_t SIGCOMP_TESTS_SUBSCRIBE[]= {
+ {
+ "REGISTER (client -> server)",
+ "REGISTER sip:test.3gpp.com SIP/2.0\r\n"
+ "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403432184;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
+ "From: <sip:johndoe@test.3gpp.com>;tag=1403421024\r\n"
+ "To: <sip:johndoe@test.3gpp.com>\r\n"
+ "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;expires=600000;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Call-ID: afac1d20-b998-2720-6407-7bbbc77ace9b\r\n"
+ "CSeq: 27335 REGISTER\r\n"
+ "Content-Length: 0\r\n"
+ "Max-Forwards: 70\r\n"
+ "Authorization: Digest username=\"johndoe@test.3gpp.com\",realm=\"test.3gpp.com\",nonce=\"\",uri=\"sip:test.3gpp.com\",response=\"\"\r\n"
+ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
+ "Privacy: none\r\n"
+ "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
+ "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
+ "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
+ "Supported: path\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ },
+ {
+ "200 REGISTER (server -> client)",
+ "SIP/2.0 200 OK\r\n"
+ "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403432184;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
+ "From: <sip:johndoe@test.3gpp.com>;tag=1403421024\r\n"
+ "To: <sip:johndoe@test.3gpp.com>;tag=T91612B6\r\n"
+ "Call-ID: afac1d20-b998-2720-6407-7bbbc77ace9b\r\n"
+ "CSeq: 27335 REGISTER\r\n"
+ "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;q=0.500;expires = 600000;+g.oma.sip-im;language=\"en,fr\";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs\";+g.3gpp.cs-voice\r\n"
+ "Content-Length: 0\r\n"
+ "Date: Fri, 25 Jan 2013 09:20:31 GMT\r\n"
+ "P-Associated-URI: <sip:johndoe@test.3gpp.com>\r\n"
+ "Server: Agilent_IMS-SIP_Server/4.11.0.0\r\n"
+ "\r\n",
+ IS_CLIENT_NO,
+ TOBE_LOST_NO
+ },
+ {
+ "SUBSCRIBE-1 (client -> server)",
+ "SUBSCRIBE sip:johndoe@test.3gpp.com SIP/2.0\r\n"
+ "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403431204;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
+ "From: <sip:johndoe@test.3gpp.com>;tag=1403442750\r\n"
+ "To: <sip:johndoe@test.3gpp.com>\r\n"
+ "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;+g.oma.sip-im;language=\"en,fr\"\r\n"
+ "Call-ID: 8c1a2260-c6e7-d415-2492-88493471d6fd\r\n"
+ "CSeq: 24466 SUBSCRIBE\r\n"
+ "Expires: 600000\r\n"
+ "Content-Length: 0\r\n"
+ "Max-Forwards: 70\r\n"
+ "Event: reg\r\n"
+ "Accept: application/reginfo+xml\r\n"
+ "Allow-Events: refer, presence, presence.winfo, xcap-diff, conference\r\n"
+ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
+ "Privacy: none\r\n"
+ "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
+ "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
+ "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ },
+ {
+ "SUBSCRIBE-2 (client -> server)",
+ "SUBSCRIBE sip:johndoe@test.3gpp.com SIP/2.0\r\n"
+ "Via: SIP/2.0/TCP 156.141.115.182:62493;branch=z9hG4bK1403422374;rport;comp=sigcomp;sigcomp-id=\"urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4\"\r\n"
+ "From: <sip:johndoe@test.3gpp.com>;tag=1403431575\r\n"
+ "To: <sip:johndoe@test.3gpp.com>\r\n"
+ "Contact: <sip:johndoe@156.141.115.182:62493;transport=tcp;sigcomp-id=urn:uuid:41147e2b-d2b9-47c1-a698-c732f6f036f4>;+g.oma.sip-im;language=\"en,fr\"\r\n"
+ "Call-ID: 05952487-8f39-ddbd-ebac-72a3f33eaf8d\r\n"
+ "CSeq: 32393 SUBSCRIBE\r\n"
+ "Expires: 600000\r\n"
+ "Content-Length: 0\r\n"
+ "Max-Forwards: 70\r\n"
+ "Event: message-summary\r\n"
+ "Accept: application/simple-message-summary\r\n"
+ "Allow-Events: refer, presence, presence.winfo, xcap-diff, conference\r\n"
+ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n"
+ "Privacy: none\r\n"
+ "P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000\r\n"
+ "User-Agent: IM-client/OMA1.0 Boghe/v2.0.132.808\r\n"
+ "P-Preferred-Identity: <sip:johndoe@test.3gpp.com>\r\n"
+ "\r\n",
+ IS_CLIENT_YES,
+ TOBE_LOST_NO
+ },
};
@@ -280,123 +277,118 @@ static const sigcomp_test_t SIGCOMP_TESTS_SUBSCRIBE[]=
static int handle_nack(tcomp_result_t *nack, tcomp_manager_handle_t* manager)
{
- if(nack->isNack){
- tsk_size_t nack_info_size;
- if(nack->nack_info && (nack_info_size = tcomp_buffer_getSize(nack->nack_info))){
- char buff[MAX_BUFFER_SIZE];
- tcomp_result_t* result = tcomp_result_create();
- tcomp_result_setOutputBuffer(result, buff, sizeof(buff), IS_STREAM, STREAM_ID);
- tcomp_manager_decompress(manager, tcomp_buffer_getBuffer(nack->nack_info), nack_info_size, result);
- TSK_OBJECT_SAFE_FREE(result);
- return 0;
- }
- }
- return -1;
+ if(nack->isNack) {
+ tsk_size_t nack_info_size;
+ if(nack->nack_info && (nack_info_size = tcomp_buffer_getSize(nack->nack_info))) {
+ char buff[MAX_BUFFER_SIZE];
+ tcomp_result_t* result = tcomp_result_create();
+ tcomp_result_setOutputBuffer(result, buff, sizeof(buff), IS_STREAM, STREAM_ID);
+ tcomp_manager_decompress(manager, tcomp_buffer_getBuffer(nack->nack_info), nack_info_size, result);
+ TSK_OBJECT_SAFE_FREE(result);
+ return 0;
+ }
+ }
+ return -1;
}
static int test_manager()
{
- size_t i, j;
- size_t outLen;
- const sigcomp_test_t* test;
+ size_t i, j;
+ size_t outLen;
+ const sigcomp_test_t* test;
+
+ tcomp_manager_handle_t *client = tsk_null, *server = tsk_null;
+ tcomp_result_t *result_client = tsk_null, *result_server = tsk_null;
+
+ /* temporary buffers --> will hold compression/decompression results */
+ char buff_client[MAX_BUFFER_SIZE];
+ char buff_server[MAX_BUFFER_SIZE];
+
+ /* Managers */
+ client = tcomp_manager_create();
+ server = tcomp_manager_create();
- tcomp_manager_handle_t *client = tsk_null, *server = tsk_null;
- tcomp_result_t *result_client = tsk_null, *result_server = tsk_null;
+ /* Add SIP/Presence dictionnaries */
+ tcomp_manager_addSipSdpDictionary(client);
+ tcomp_manager_addPresenceDictionary(client);
+ tcomp_manager_addSipSdpDictionary(server);
+ tcomp_manager_addPresenceDictionary(server);
- /* temporary buffers --> will hold compression/decompression results */
- char buff_client[MAX_BUFFER_SIZE];
- char buff_server[MAX_BUFFER_SIZE];
-
- /* Managers */
- client = tcomp_manager_create();
- server = tcomp_manager_create();
+ /* Results --> it is recomanded to use one result struct for each manager */
+ result_client = tcomp_result_create();
+ result_server = tcomp_result_create();
- /* Add SIP/Presence dictionnaries */
- tcomp_manager_addSipSdpDictionary(client);
- tcomp_manager_addPresenceDictionary(client);
- tcomp_manager_addSipSdpDictionary(server);
- tcomp_manager_addPresenceDictionary(server);
-
- /* Results --> it is recomanded to use one result struct for each manager */
- result_client = tcomp_result_create();
- result_server = tcomp_result_create();
+ /* Sets compartment Ids */
+ tcomp_result_setCompartmentId(result_client, COMPARTMENT_ID_CLIENT, strlen(COMPARTMENT_ID_CLIENT));
+ tcomp_result_setCompartmentId(result_server, COMPARTMENT_ID_SERVER, strlen(COMPARTMENT_ID_SERVER));
- /* Sets compartment Ids */
- tcomp_result_setCompartmentId(result_client, COMPARTMENT_ID_CLIENT, strlen(COMPARTMENT_ID_CLIENT));
- tcomp_result_setCompartmentId(result_server, COMPARTMENT_ID_SERVER, strlen(COMPARTMENT_ID_SERVER));
+ /* Set DMS and SMS */
+ tcomp_manager_setDecompression_Memory_Size(client, SIGCOMP_DMS);
+ tcomp_manager_setDecompression_Memory_Size(server, SIGCOMP_DMS);
+ tcomp_manager_setCycles_Per_Bit(client, SIGCOMP_CPB);
+ tcomp_manager_setCycles_Per_Bit(server, SIGCOMP_CPB);
+ tcomp_manager_setState_Memory_Size(client, SIGCOMP_SMS);
+ tcomp_manager_setState_Memory_Size(server, SIGCOMP_SMS);
- /* Set DMS and SMS */
- tcomp_manager_setDecompression_Memory_Size(client, SIGCOMP_DMS);
- tcomp_manager_setDecompression_Memory_Size(server, SIGCOMP_DMS);
- tcomp_manager_setCycles_Per_Bit(client, SIGCOMP_CPB);
- tcomp_manager_setCycles_Per_Bit(server, SIGCOMP_CPB);
- tcomp_manager_setState_Memory_Size(client, SIGCOMP_SMS);
- tcomp_manager_setState_Memory_Size(server, SIGCOMP_SMS);
+ /* Set wehther to use only ACKed states (should be false) */
+ tcomp_manager_setUseOnlyACKedStates(client, USE_ONLY_ACKED_STATES);
+ tcomp_manager_setUseOnlyACKedStates(server, USE_ONLY_ACKED_STATES);
- /* Set wehther to use only ACKed states (should be false) */
- tcomp_manager_setUseOnlyACKedStates(client, USE_ONLY_ACKED_STATES);
- tcomp_manager_setUseOnlyACKedStates(server, USE_ONLY_ACKED_STATES);
+ tcomp_result_setOutputBuffer(result_client, buff_client, sizeof(buff_client), IS_STREAM, STREAM_ID);
+ tcomp_result_setOutputBuffer(result_server, buff_server, sizeof(buff_server), IS_STREAM, STREAM_ID);
- tcomp_result_setOutputBuffer(result_client, buff_client, sizeof(buff_client), IS_STREAM, STREAM_ID);
- tcomp_result_setOutputBuffer(result_server, buff_server, sizeof(buff_server), IS_STREAM, STREAM_ID);
-
- for(j = 0; j < SIGCOMP_LOOP_COUNT; ++j)
- {
- for(i = 0; i < sizeof(SIGCOMP_TESTS)/sizeof(SIGCOMP_TESTS[0]); ++i)
- {
- test = &SIGCOMP_TESTS[i];
+ for(j = 0; j < SIGCOMP_LOOP_COUNT; ++j) {
+ for(i = 0; i < sizeof(SIGCOMP_TESTS)/sizeof(SIGCOMP_TESTS[0]); ++i) {
+ test = &SIGCOMP_TESTS[i];
- // compress
- outLen = tcomp_manager_compress(
- test->is_client ? client : server,
- test->is_client ? COMPARTMENT_ID_CLIENT : COMPARTMENT_ID_SERVER,
- tsk_strlen((test->is_client ? COMPARTMENT_ID_CLIENT : COMPARTMENT_ID_SERVER)),
- test->msg,
- tsk_strlen(test->msg),
- test->is_client ? buff_client : buff_server,
- test->is_client ? sizeof(buff_client) : sizeof(buff_server),
- IS_STREAM);
- if(!outLen)
- {
- TSK_DEBUG_ERROR("Failed to compress %s message", test->description);
- goto bail;
- }
- TSK_DEBUG_INFO("==%s compression ratio = %f%%==", test->description, ((float)tsk_strlen(test->msg) / (float)outLen) * 100.f);
+ // compress
+ outLen = tcomp_manager_compress(
+ test->is_client ? client : server,
+ test->is_client ? COMPARTMENT_ID_CLIENT : COMPARTMENT_ID_SERVER,
+ tsk_strlen((test->is_client ? COMPARTMENT_ID_CLIENT : COMPARTMENT_ID_SERVER)),
+ test->msg,
+ tsk_strlen(test->msg),
+ test->is_client ? buff_client : buff_server,
+ test->is_client ? sizeof(buff_client) : sizeof(buff_server),
+ IS_STREAM);
+ if(!outLen) {
+ TSK_DEBUG_ERROR("Failed to compress %s message", test->description);
+ goto bail;
+ }
+ TSK_DEBUG_INFO("==%s compression ratio = %f%%==", test->description, ((float)tsk_strlen(test->msg) / (float)outLen) * 100.f);
- // decompress
- if(!test->tobe_lost)
- {
- tsk_bool_t server_decompress = test->is_client; // decompress using server manager if compressed using client mgr
- memset(server_decompress ? buff_server : buff_client, '\0', server_decompress ? sizeof(buff_server) : sizeof(buff_client));
- outLen = tcomp_manager_decompress(server_decompress ? server : client, server_decompress ? buff_client : buff_server, outLen, server_decompress ? result_server : result_client);
- if(!outLen)
- {
- TSK_DEBUG_ERROR("Failed to decompress %s message", test->description);
- // pass NACK to remote peer (sendto())
- if(handle_nack(server_decompress ? result_server : result_client, server_decompress ? client : server) != 0){
- goto bail;
- }
- }
- tcomp_manager_provideCompartmentId(server_decompress ? server : client, server_decompress ? result_server : result_client); // save states
- TSK_DEBUG_INFO("Decompressed message:\n%s = %s", test->description, server_decompress ? buff_server : buff_client);
- }
- }// for (i < count(SIGCOMP_TESTS))
- } // for (j < SIGCOMP_LOOP_COUNT)
+ // decompress
+ if(!test->tobe_lost) {
+ tsk_bool_t server_decompress = test->is_client; // decompress using server manager if compressed using client mgr
+ memset(server_decompress ? buff_server : buff_client, '\0', server_decompress ? sizeof(buff_server) : sizeof(buff_client));
+ outLen = tcomp_manager_decompress(server_decompress ? server : client, server_decompress ? buff_client : buff_server, outLen, server_decompress ? result_server : result_client);
+ if(!outLen) {
+ TSK_DEBUG_ERROR("Failed to decompress %s message", test->description);
+ // pass NACK to remote peer (sendto())
+ if(handle_nack(server_decompress ? result_server : result_client, server_decompress ? client : server) != 0) {
+ goto bail;
+ }
+ }
+ tcomp_manager_provideCompartmentId(server_decompress ? server : client, server_decompress ? result_server : result_client); // save states
+ TSK_DEBUG_INFO("Decompressed message:\n%s = %s", test->description, server_decompress ? buff_server : buff_client);
+ }
+ }// for (i < count(SIGCOMP_TESTS))
+ } // for (j < SIGCOMP_LOOP_COUNT)
bail:
- // Close compartments
- tcomp_manager_closeCompartment(client, COMPARTMENT_ID_CLIENT, tsk_strlen(COMPARTMENT_ID_CLIENT));
- tcomp_manager_closeCompartment(server, COMPARTMENT_ID_SERVER, tsk_strlen(COMPARTMENT_ID_SERVER));
+ // Close compartments
+ tcomp_manager_closeCompartment(client, COMPARTMENT_ID_CLIENT, tsk_strlen(COMPARTMENT_ID_CLIENT));
+ tcomp_manager_closeCompartment(server, COMPARTMENT_ID_SERVER, tsk_strlen(COMPARTMENT_ID_SERVER));
- // Delete Results
- TSK_OBJECT_SAFE_FREE(result_client);
- TSK_OBJECT_SAFE_FREE(result_server);
+ // Delete Results
+ TSK_OBJECT_SAFE_FREE(result_client);
+ TSK_OBJECT_SAFE_FREE(result_server);
- // Delete managers
- TSK_OBJECT_SAFE_FREE(client);
- TSK_OBJECT_SAFE_FREE(server);
+ // Delete managers
+ TSK_OBJECT_SAFE_FREE(client);
+ TSK_OBJECT_SAFE_FREE(server);
- return 0;
+ return 0;
}
#endif /* TEST_TINYSIGCOMP_MANAGER_H */
diff --git a/tinySIGCOMP/test/test_osc.h b/tinySIGCOMP/test/test_osc.h
index d63ba5b..e4a3416 100755
--- a/tinySIGCOMP/test/test_osc.h
+++ b/tinySIGCOMP/test/test_osc.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIGCOMP/test/test_tortures.h b/tinySIGCOMP/test/test_tortures.h
index c1222b6..3e04bbe 100755
--- a/tinySIGCOMP/test/test_tortures.h
+++ b/tinySIGCOMP/test/test_tortures.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2009 Mamadou Diop.
* Copyright (C) 2012 Doubango Telecom <http://doubango.org>.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,983 +47,998 @@
#include <assert.h>
-struct_torture_test tests[] =
-{
- { //*** 0***
- "A.1.1. Bit Manipulation",
- RFC4465_A_1_1__Bit_Manipulation,
- 170,
- {8, "\x01\x50\x00\x00\xfe\xbf\x00\x00"},
- 22,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- { //*** 1***
- "A.1.2(.1) Arithmetic",
- RFC4465_A_1_2__Arithmetic_1,
- 174,
- {8, "\x00\x00\x00\x00\x00\x00\x00\x04"},
- 25,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- { //*** 2***
- "A.1.2(.2) Arithmetic",
- RFC4465_A_1_2__Arithmetic_2,
- 174,
- {11, "DIV_BY_ZERO"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- { //*** 3***
- "A.1.2(.3) Arithmetic",
- RFC4465_A_1_2__Arithmetic_3,
- 174,
- {11, "DIV_BY_ZERO"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //*** 4***
- "A.1.3. Sorting",
- RFC4465_A_1_3__Sorting,
- 223,
- {45, "\x46\x6f\x72\x64\x2c\x20\x79\x6f\x75\x27\x72\x65\x20\x74\x75\x72\x6e\x69\x6e\x67"
- "\x20\x69\x6e\x74\x6f\x20\x61\x20\x70\x65\x6e\x67\x75\x69\x6e\x2e\x20\x53\x74\x6f"
- "\x70\x20\x69\x74\x2e"},
- 371,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //*** 5**
- "A.1.4. SHA-1",
- RFC4465_A_1_4__SHA1,
- 138,
- {40, "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d"
- "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1"
- "\x12\xff\x34\x7b\x4f\x27\xd6\x9e\x1f\x32\x8e\x6f\x4b\x55\x73\xe3\x66\x6e\x12\x2f"
- "\x4f\x46\x04\x52\xeb\xb5\x63\x93\x4f\x46\x04\x52\xeb\xb5\x63\x93\x4f\x46\x04\x52"},
- 17176,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //*** 6**
- "A.1.5.(1) LOAD and MULTILOAD",
- RFC4465_A_1_5__LOAD_and_MULTILOAD_1,
- 58,
- {16, "\x00\x84\x00\x84\x00\x86\x00\x86\x00\x2a\x00\x80\x00\x2a\x00\x2a"},
- 36,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //*** 7**
- "A.1.5.(2) LOAD and MULTILOAD",
- RFC4465_A_1_5__LOAD_and_MULTILOAD_2,
- 58,
- {21, "MULTILOAD_OVERWRITTEN"},
- 36,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //*** 8**
- "A.1.5.(3) LOAD and MULTILOAD",
- RFC4465_A_1_5__LOAD_and_MULTILOAD_3,
- 58,
- {21, "MULTILOAD_OVERWRITTEN"},
- 36,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 9**
- "A.1.6. COPY",
- RFC4465_A_1_6__COPY,
- 60,
- {125, "\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40"
- "\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x41\x41\x41\x41\x41\x41\x41\x41"
- "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
- "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
- "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
- "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x55\x41"
- "\x42\x43\x44\x43\x44"},
- 365,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 10**
- "A.1.7. COPY-LITERAL and COPY-OFFSET",
- RFC4465_A_1_7__COPY_LITERAL_and_COPY_OFFSET,
- 100,
- {34, "\x41\x41\x41\x41\x00\x61\x41\x41\x41\x41\x49\x4a\x41\x42\x43\x44\x49\x4a\x41\x42"
- "\x00\x4a\x00\x4e\x47\x48\x48\x45\x46\x47\x47\x48\x45\x46"},
- 216,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 11**
- "A.1.8. MEMSET",
- RFC4465_A_1_8__MEMSET,
- 27,
- {16, "\x80\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9\xb8\xc7\xd6\xe5\xf4\x03\x12"},
- 166,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 12**
- "A.1.9.(1) CRC",
- RFC4465_A_1_9__CRC_1,
- 29,
- {0, ""},
- 95,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 13**
- "A.1.9.(2) CRC",
- RFC4465_A_1_9__CRC_2,
- 29,
- {14, "USER_REQUESTED"},
- 95,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 14**
- "A.1.10. INPUT-BITS",
- RFC4465_A_1_10__INPUT_BITS,
- 28,
- {16, "\x00\x00\x00\x02\x00\x02\x00\x13\x00\x00\x00\x03\x00\x1a\x00\x38"},
- 66,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 15**
- "A.1.11. INPUT-HUFFMAN",
- RFC4465_A_1_11__INPUT_HUFFMAN,
- 39,
- {16, "\x00\x00\x00\x03\x00\x08\x04\xd7\x00\x02\x00\x03\x03\x99\x30\xfe"},
- 84,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 16**
- "A.1.12. INPUT-BYTES",
- RFC4465_A_1_12__INPUT_BYTES,
- 72,
- {39, "\x00\x00\x93\x2e\x00\x01\xb1\x66\xd8\x6f\xb1\x00\x1a\x2b\x00\x03\x9a\x97\x34\xd8"
- "\x00\x07\x00\x01\x33\x87\x4e\x00\x08\xdc\x96\x51\xb5\xdc\x96\x00\x59\x9d\x6a"},
- 130,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 17**
- "A.1.13. Stack Manipulation",
- RFC4465_A_1_13__Stack_Manipulation,
- 324,
- {16, "\x00\x03\x00\x02\x00\x01\x00\x42\x00\x42\x00\x00\x00\x01\x00\x01"},
- 40,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 18**
- "A.1.14. Program Flow",
- RFC4465_A_1_14__Program_Flow,
- 66,
- {20, "\x00\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x07\x07\x07\x08\x08\x08\x09\x09"},
- 131,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 19**
- "A.1.15.(1) State Creation",
- RFC4465_A_1_15__State_Creation_1,
- 152,
- {0, ""},
- 23,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 20 (requires previsous test)**
- "A.1.15.(2) State Creation",
- RFC4465_A_1_15__State_Creation_2,
- 152,
- {0, ""},
- 14,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 21 (requires previsous test)**
- "A.1.15.(3) State Creation",
- RFC4465_A_1_15__State_Creation_3,
- 152,
- {0, ""},
- 24,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 22 (requires previsous test)**
- "A.1.15.(4) State Creation", // FAIL
- RFC4465_A_1_15__State_Creation_4,
- 153,
- {23, "INVALID_STATE_ID_LENGTH"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 23 (requires previsous test)**
- "A.1.15.(5) State Creation", // FAIL
- RFC4465_A_1_15__State_Creation_5,
- 153,
- {23, "INVALID_STATE_ID_LENGTH"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 24 (requires previsous test)**
- "A.1.15.(6) State Creation",
- RFC4465_A_1_15__State_Creation_6,
- 153,
- {0, ""},
- 23,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 25 (requires previsous test)**
- "A.1.15.(7) State Creation",
- RFC4465_A_1_15__State_Creation_7,
- 152,
- {0, ""},
- 34,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 26 (requires previsous test)**
- "A.1.15.(8) State Creation",
- RFC4465_A_1_15__State_Creation_8,
- 153,
- {0, ""},
- 46,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 27 (requires previsous test)**
- "A.1.15.(9) State Creation",
- RFC4465_A_1_15__State_Creation_9,
- 153,
- {0, ""},
- 47,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
+struct_torture_test tests[] = {
+ {
+ //*** 0***
+ "A.1.1. Bit Manipulation",
+ RFC4465_A_1_1__Bit_Manipulation,
+ 170,
+ {8, "\x01\x50\x00\x00\xfe\xbf\x00\x00"},
+ 22,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 1***
+ "A.1.2(.1) Arithmetic",
+ RFC4465_A_1_2__Arithmetic_1,
+ 174,
+ {8, "\x00\x00\x00\x00\x00\x00\x00\x04"},
+ 25,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 2***
+ "A.1.2(.2) Arithmetic",
+ RFC4465_A_1_2__Arithmetic_2,
+ 174,
+ {11, "DIV_BY_ZERO"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 3***
+ "A.1.2(.3) Arithmetic",
+ RFC4465_A_1_2__Arithmetic_3,
+ 174,
+ {11, "DIV_BY_ZERO"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 4***
+ "A.1.3. Sorting",
+ RFC4465_A_1_3__Sorting,
+ 223,
+ {
+ 45, "\x46\x6f\x72\x64\x2c\x20\x79\x6f\x75\x27\x72\x65\x20\x74\x75\x72\x6e\x69\x6e\x67"
+ "\x20\x69\x6e\x74\x6f\x20\x61\x20\x70\x65\x6e\x67\x75\x69\x6e\x2e\x20\x53\x74\x6f"
+ "\x70\x20\x69\x74\x2e"
+ },
+ 371,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 5**
+ "A.1.4. SHA-1",
+ RFC4465_A_1_4__SHA1,
+ 138,
+ {
+ 40, "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d"
+ "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1"
+ "\x12\xff\x34\x7b\x4f\x27\xd6\x9e\x1f\x32\x8e\x6f\x4b\x55\x73\xe3\x66\x6e\x12\x2f"
+ "\x4f\x46\x04\x52\xeb\xb5\x63\x93\x4f\x46\x04\x52\xeb\xb5\x63\x93\x4f\x46\x04\x52"
+ },
+ 17176,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 6**
+ "A.1.5.(1) LOAD and MULTILOAD",
+ RFC4465_A_1_5__LOAD_and_MULTILOAD_1,
+ 58,
+ {16, "\x00\x84\x00\x84\x00\x86\x00\x86\x00\x2a\x00\x80\x00\x2a\x00\x2a"},
+ 36,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 7**
+ "A.1.5.(2) LOAD and MULTILOAD",
+ RFC4465_A_1_5__LOAD_and_MULTILOAD_2,
+ 58,
+ {21, "MULTILOAD_OVERWRITTEN"},
+ 36,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //*** 8**
+ "A.1.5.(3) LOAD and MULTILOAD",
+ RFC4465_A_1_5__LOAD_and_MULTILOAD_3,
+ 58,
+ {21, "MULTILOAD_OVERWRITTEN"},
+ 36,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 9**
+ "A.1.6. COPY",
+ RFC4465_A_1_6__COPY,
+ 60,
+ {
+ 125, "\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40"
+ "\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x41\x41\x41\x41\x41\x41\x41\x41"
+ "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
+ "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
+ "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
+ "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x55\x41"
+ "\x42\x43\x44\x43\x44"
+ },
+ 365,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 10**
+ "A.1.7. COPY-LITERAL and COPY-OFFSET",
+ RFC4465_A_1_7__COPY_LITERAL_and_COPY_OFFSET,
+ 100,
+ {
+ 34, "\x41\x41\x41\x41\x00\x61\x41\x41\x41\x41\x49\x4a\x41\x42\x43\x44\x49\x4a\x41\x42"
+ "\x00\x4a\x00\x4e\x47\x48\x48\x45\x46\x47\x47\x48\x45\x46"
+ },
+ 216,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 11**
+ "A.1.8. MEMSET",
+ RFC4465_A_1_8__MEMSET,
+ 27,
+ {16, "\x80\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9\xb8\xc7\xd6\xe5\xf4\x03\x12"},
+ 166,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 12**
+ "A.1.9.(1) CRC",
+ RFC4465_A_1_9__CRC_1,
+ 29,
+ {0, ""},
+ 95,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 13**
+ "A.1.9.(2) CRC",
+ RFC4465_A_1_9__CRC_2,
+ 29,
+ {14, "USER_REQUESTED"},
+ 95,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 14**
+ "A.1.10. INPUT-BITS",
+ RFC4465_A_1_10__INPUT_BITS,
+ 28,
+ {16, "\x00\x00\x00\x02\x00\x02\x00\x13\x00\x00\x00\x03\x00\x1a\x00\x38"},
+ 66,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 15**
+ "A.1.11. INPUT-HUFFMAN",
+ RFC4465_A_1_11__INPUT_HUFFMAN,
+ 39,
+ {16, "\x00\x00\x00\x03\x00\x08\x04\xd7\x00\x02\x00\x03\x03\x99\x30\xfe"},
+ 84,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 16**
+ "A.1.12. INPUT-BYTES",
+ RFC4465_A_1_12__INPUT_BYTES,
+ 72,
+ {
+ 39, "\x00\x00\x93\x2e\x00\x01\xb1\x66\xd8\x6f\xb1\x00\x1a\x2b\x00\x03\x9a\x97\x34\xd8"
+ "\x00\x07\x00\x01\x33\x87\x4e\x00\x08\xdc\x96\x51\xb5\xdc\x96\x00\x59\x9d\x6a"
+ },
+ 130,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 17**
+ "A.1.13. Stack Manipulation",
+ RFC4465_A_1_13__Stack_Manipulation,
+ 324,
+ {16, "\x00\x03\x00\x02\x00\x01\x00\x42\x00\x42\x00\x00\x00\x01\x00\x01"},
+ 40,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 18**
+ "A.1.14. Program Flow",
+ RFC4465_A_1_14__Program_Flow,
+ 66,
+ {20, "\x00\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x07\x07\x07\x08\x08\x08\x09\x09"},
+ 131,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 19**
+ "A.1.15.(1) State Creation",
+ RFC4465_A_1_15__State_Creation_1,
+ 152,
+ {0, ""},
+ 23,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 20 (requires previsous test)**
+ "A.1.15.(2) State Creation",
+ RFC4465_A_1_15__State_Creation_2,
+ 152,
+ {0, ""},
+ 14,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 21 (requires previsous test)**
+ "A.1.15.(3) State Creation",
+ RFC4465_A_1_15__State_Creation_3,
+ 152,
+ {0, ""},
+ 24,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 22 (requires previsous test)**
+ "A.1.15.(4) State Creation", // FAIL
+ RFC4465_A_1_15__State_Creation_4,
+ 153,
+ {23, "INVALID_STATE_ID_LENGTH"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 23 (requires previsous test)**
+ "A.1.15.(5) State Creation", // FAIL
+ RFC4465_A_1_15__State_Creation_5,
+ 153,
+ {23, "INVALID_STATE_ID_LENGTH"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 24 (requires previsous test)**
+ "A.1.15.(6) State Creation",
+ RFC4465_A_1_15__State_Creation_6,
+ 153,
+ {0, ""},
+ 23,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 25 (requires previsous test)**
+ "A.1.15.(7) State Creation",
+ RFC4465_A_1_15__State_Creation_7,
+ 152,
+ {0, ""},
+ 34,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 26 (requires previsous test)**
+ "A.1.15.(8) State Creation",
+ RFC4465_A_1_15__State_Creation_8,
+ 153,
+ {0, ""},
+ 46,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 27 (requires previsous test)**
+ "A.1.15.(9) State Creation",
+ RFC4465_A_1_15__State_Creation_9,
+ 153,
+ {0, ""},
+ 47,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
#if 0 // FIXME: http://code.google.com/p/doubango/issues/detail?id=181
- ,
- {
- //** 23 (requires previsous test)**
- "A.1.15.(10) State Creation",
- RFC4465_A_1_15__State_Creation_10,
- 153,
- {0, ""},
- 60,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
+ ,
+ {
+ //** 23 (requires previsous test)**
+ "A.1.15.(10) State Creation",
+ RFC4465_A_1_15__State_Creation_10,
+ 153,
+ {0, ""},
+ 60,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
#endif
- ,
- {
- //** 28**
- "A.1.16.(0) STATE-ACCESS {Set up bytecode}",
- RFC4465_A_1_16__STATE_ACCESS__SETUP,
- 403,
- {0, ""},
- 17,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 29 (requires previous test)**
- "A.1.16.(1) STATE-ACCESS",
- RFC4465_A_1_16__STATE_ACCESS_1,
- 408,
- {4, "\x74\x65\x73\x74"},
- 26,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 30 (requires previous test)**
- "A.1.16.(2) STATE-ACCESS",
- RFC4465_A_1_16__STATE_ACCESS_2,
- 408,
- {4, "\x74\x65\x73\x74"},
- 15,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 31 (requires previous test)**
- "A.1.16.(3) STATE-ACCESS",
- RFC4465_A_1_16__STATE_ACCESS_3,
- 408,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 32 (requires previous test)**
- "A.1.16.(4) STATE-ACCESS",
- RFC4465_A_1_16__STATE_ACCESS_4,
- 408,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 33 (requires previous test)**
- "A.1.16.(5) STATE-ACCESS",
- RFC4465_A_1_16__STATE_ACCESS_5,
- 408,
- {15, "STATE_TOO_SHORT"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 34**
- "A.2.1.(1) Useful Values",
- RFC4465_A_2_1__Useful_Values_1,
- 93,
- {0, ""},
- 966,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 35 (Requires previous test)**
- "A.2.1.(2) Useful Values",
- RFC4465_A_2_1__Useful_Values_2,
- 9,
- {0, ""},
- (1072 << 4),
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 36 (Requires previous test)**
- "A.2.1.(3) Useful Values",
- RFC4465_A_2_1__Useful_Values_3,
- 9,
- {16, "CYCLES_EXHAUSTED"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 37 (Requires previous test)**
- "A.2.1.(4) Useful Values",
- RFC4465_A_2_1__Useful_Values_4,
- 9,
- {8, "SEGFAULT"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 38**
- "A.2.2. Cycles Checking",
- RFC4465_A_2_2__Cycles_Checking,
- 29,
- {16, "CYCLES_EXHAUSTED"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 39**
- "A.2.3.(1) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_1,
- 1,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 40**
- "A.2.3.(2) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_2,
- 2,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 41**
- "A.2.3.(3) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_3,
- 17,
- {25, "decompression_memory_size"},
- 5,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 42**
- "A.2.3.(4) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_4,
- 17,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 43**
- "A.2.3.(5) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_5,
- 17,
- {21, "INVALID_CODE_LOCATION"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 44**
- "A.2.3.(6) Message-based Transport",
- RFC4465_A_2_3_Message_based_Transport_6,
- 17,
- {25, "decompression_memory_size"},
- 5,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 45**
- "A.2.4.(1&2) Stream-based Transport",
- RFC4465_A_2_4_Stream_based_Transport_1,
- 67,
- {25, "decompression_memory_size"},
- 11,
- IS_STREAM_YES,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 46**
- "A.2.4.(3) Stream-based Transport",
- RFC4465_A_2_4_Stream_based_Transport_3,
- 3,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 47**
- "A.2.4.(4) Stream-based Transport",
- RFC4465_A_2_4_Stream_based_Transport_4,
- 4,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 48**
- "A.2.4.(5) Stream-based Transport",
- RFC4465_A_2_4_Stream_based_Transport_5,
- 30,
- {17, "MESSAGE_TOO_SHORT"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 49**
- "A.2.4.(5.1) Stream-based Transport (cleanup)",
- "\xff\xff",
- 2,
- {14, "INTERNAL_ERROR"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 50**
- "A.2.4.(6) Stream-based Transport",
- RFC4465_A_2_4_Stream_based_Transport_6,
- 29,
- {21, "INVALID_CODE_LOCATION"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 51**
- "A.2.4.(6.1) Stream-based Transport (cleanup)",
- "\xff\xff",
- 2,
- {14, "INTERNAL_ERROR"},
- 0,
- IS_STREAM_YES,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 52**
- "A.2.5.(1) Input Past the End of a Message",
- RFC4465_A_2_5__Input_Past_the_End_of_a_Message_1,
- 59,
- {3, "\x68\x69\x21"},
- 23,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 53**
- "A.2.5.(2) Input Past the End of a Message",
- RFC4465_A_2_5__Input_Past_the_End_of_a_Message_2,
- 58,
- {14, "USER_REQUESTED"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 54**
- "A.3.1.(1) SigComp Feedback Mechanism",
- RFC4465_A_3_1__SigComp_Feedback_Mechanism_1,
- 84,
- {0, ""},
- 52,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 55**
- "A.3.1.(2) SigComp Feedback Mechanism",
- RFC4465_A_3_1__SigComp_Feedback_Mechanism_2,
- 84,
- {0, ""},
- 179,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 56 (SMS MUST be 2048)**
- "A.3.2.(1) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_1,
- 446,
- {0, ""},
- 811,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 57 (Requires previous test)**
- "A.3.2.(2) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_2,
- 446,
- {0, ""},
- 2603,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 58 (Requires previous test)**
- "A.3.2.(3) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_3,
- 446,
- {0, ""},
- 811,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 59 (Requires previous test)**
- "A.3.2.(4) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_4,
- 446,
- {0, ""},
- 1805,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 60 (Requires previous test)**
- "A.3.2.(5) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_5,
- 446,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID
- }
- ,
- {
- //** 61 (Requires previous test)**
- "A.3.2.(6) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_6,
- 446,
- {0, ""},
- 2057,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 62 (Requires previous test)**
- "A.3.2.(7) State Memory Management",
- RFC4465_A_3_2__State_Memory_Management_7,
- 446,
- {0, ""},
- 1993,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 63**
- "A.3.3.(1) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_1,
- 437,
- {0, ""},
- 1809,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_0
- }
- ,
- {
- //** 64 (requires previsous test)**
- "A.3.3.(2) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_2,
- 437,
- {0, ""},
- 1809,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_1
- }
- ,
- {
- //** 65 (requires previsous test)**
- "A.3.3.(3) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_3,
- 437,
- {0, ""},
- 1809,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_2
- }
- ,
- {
- //** 66 (requires previsous test)**
- "A.3.3.(4) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_4,
- 437,
- {0, ""},
- 1993,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_0
- }
- ,
- {
- //** 67 (requires previsous test)**
- "A.3.3.(5) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_5,
- 437,
- {0, ""},
- 1994,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_1
- }
- ,
- {
- //** 68 (requires previsous test)**
- "A.3.3.(6) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_6,
- 437,
- {0, ""},
- 1804,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID_2
- }
- ,
- {
- //** 69 (requires previsous test)**
- "A.3.3.(7) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_7,
- 437,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID_0
- }
- ,
- {
- //** 70 (requires previsous test)**
- "A.3.3.(8) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_8,
- 437,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID_1
- }
- ,
- {
- //** 71 (requires previsous test)**
- "A.3.3.(9) Multiple Compartments",
- RFC4465_A_3_3__Multiple_Compartments_9,
- 437,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- COMPARTMENT_ID_2
- }
- ,
- {
- //** 72**
- "A.3.4. Accessing RFC 3485 State",
- RFC4465_A_3_4__Accessing_RFC_3485_State,
- 61,
- {3, "\x53\x49\x50"},
- 11,
- IS_STREAM_NO,
- XFAIL_NO,
- COMPARTMENT_ID
- }
- ,
- {
- //** 73**
- "A.3.5.(1) Bytecode State Creation",
- RFC4465_A_3_5__Bytecode_State_Creation_1,
- 74,
- {2, "\x4f\x4b"},
- 66,
- IS_STREAM_NO,
- XFAIL_NO,
- "Comp-id:A.3.5. Bytecode State Creation"
- }
- ,
- {
- //** 74**
- "A.3.5.(2) Bytecode State Creation",
- RFC4465_A_3_5__Bytecode_State_Creation_2,
- 8,
- {3, "\x4f\x4b\x31"},
- 7,
- IS_STREAM_NO,
- XFAIL_NO,
- "Comp-id:A.3.5. Bytecode State Creation"
- }
- ,
- {
- //** 75**
- "A.3.5.(3) Bytecode State Creation",
- RFC4465_A_3_5__Bytecode_State_Creation_3,
- 13,
- {3, "\x4f\x4b\x32"},
- 5,
- IS_STREAM_NO,
- XFAIL_NO,
- "Comp-id:A.3.5. Bytecode State Creation"
- }
- ,
- {
- //** 76**
- "A.3.5.(4) Bytecode State Creation",
- RFC4465_A_3_5__Bytecode_State_Creation_4,
- 7,
- {3, "\x00\x00\x32"},
- 5,
- IS_STREAM_NO,
- XFAIL_NO,
- "Comp-id:A.3.5. Bytecode State Creation"
- }
- ,
- {
- //** 77**
- "A.3.5.(5) Bytecode State Creation",
- RFC4465_A_3_5__Bytecode_State_Creation_5,
- 7,
- {15, "STATE_NOT_FOUND"},
- 0,
- IS_STREAM_NO,
- XFAIL_YES,
- "Comp-id:A.3.5. Bytecode State Creation"
- }
+ ,
+ {
+ //** 28**
+ "A.1.16.(0) STATE-ACCESS {Set up bytecode}",
+ RFC4465_A_1_16__STATE_ACCESS__SETUP,
+ 403,
+ {0, ""},
+ 17,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 29 (requires previous test)**
+ "A.1.16.(1) STATE-ACCESS",
+ RFC4465_A_1_16__STATE_ACCESS_1,
+ 408,
+ {4, "\x74\x65\x73\x74"},
+ 26,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 30 (requires previous test)**
+ "A.1.16.(2) STATE-ACCESS",
+ RFC4465_A_1_16__STATE_ACCESS_2,
+ 408,
+ {4, "\x74\x65\x73\x74"},
+ 15,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 31 (requires previous test)**
+ "A.1.16.(3) STATE-ACCESS",
+ RFC4465_A_1_16__STATE_ACCESS_3,
+ 408,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 32 (requires previous test)**
+ "A.1.16.(4) STATE-ACCESS",
+ RFC4465_A_1_16__STATE_ACCESS_4,
+ 408,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 33 (requires previous test)**
+ "A.1.16.(5) STATE-ACCESS",
+ RFC4465_A_1_16__STATE_ACCESS_5,
+ 408,
+ {15, "STATE_TOO_SHORT"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 34**
+ "A.2.1.(1) Useful Values",
+ RFC4465_A_2_1__Useful_Values_1,
+ 93,
+ {0, ""},
+ 966,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 35 (Requires previous test)**
+ "A.2.1.(2) Useful Values",
+ RFC4465_A_2_1__Useful_Values_2,
+ 9,
+ {0, ""},
+ (1072 << 4),
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 36 (Requires previous test)**
+ "A.2.1.(3) Useful Values",
+ RFC4465_A_2_1__Useful_Values_3,
+ 9,
+ {16, "CYCLES_EXHAUSTED"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 37 (Requires previous test)**
+ "A.2.1.(4) Useful Values",
+ RFC4465_A_2_1__Useful_Values_4,
+ 9,
+ {8, "SEGFAULT"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 38**
+ "A.2.2. Cycles Checking",
+ RFC4465_A_2_2__Cycles_Checking,
+ 29,
+ {16, "CYCLES_EXHAUSTED"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 39**
+ "A.2.3.(1) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_1,
+ 1,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 40**
+ "A.2.3.(2) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_2,
+ 2,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 41**
+ "A.2.3.(3) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_3,
+ 17,
+ {25, "decompression_memory_size"},
+ 5,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 42**
+ "A.2.3.(4) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_4,
+ 17,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 43**
+ "A.2.3.(5) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_5,
+ 17,
+ {21, "INVALID_CODE_LOCATION"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 44**
+ "A.2.3.(6) Message-based Transport",
+ RFC4465_A_2_3_Message_based_Transport_6,
+ 17,
+ {25, "decompression_memory_size"},
+ 5,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 45**
+ "A.2.4.(1&2) Stream-based Transport",
+ RFC4465_A_2_4_Stream_based_Transport_1,
+ 67,
+ {25, "decompression_memory_size"},
+ 11,
+ IS_STREAM_YES,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 46**
+ "A.2.4.(3) Stream-based Transport",
+ RFC4465_A_2_4_Stream_based_Transport_3,
+ 3,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 47**
+ "A.2.4.(4) Stream-based Transport",
+ RFC4465_A_2_4_Stream_based_Transport_4,
+ 4,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 48**
+ "A.2.4.(5) Stream-based Transport",
+ RFC4465_A_2_4_Stream_based_Transport_5,
+ 30,
+ {17, "MESSAGE_TOO_SHORT"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 49**
+ "A.2.4.(5.1) Stream-based Transport (cleanup)",
+ "\xff\xff",
+ 2,
+ {14, "INTERNAL_ERROR"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 50**
+ "A.2.4.(6) Stream-based Transport",
+ RFC4465_A_2_4_Stream_based_Transport_6,
+ 29,
+ {21, "INVALID_CODE_LOCATION"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 51**
+ "A.2.4.(6.1) Stream-based Transport (cleanup)",
+ "\xff\xff",
+ 2,
+ {14, "INTERNAL_ERROR"},
+ 0,
+ IS_STREAM_YES,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 52**
+ "A.2.5.(1) Input Past the End of a Message",
+ RFC4465_A_2_5__Input_Past_the_End_of_a_Message_1,
+ 59,
+ {3, "\x68\x69\x21"},
+ 23,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 53**
+ "A.2.5.(2) Input Past the End of a Message",
+ RFC4465_A_2_5__Input_Past_the_End_of_a_Message_2,
+ 58,
+ {14, "USER_REQUESTED"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 54**
+ "A.3.1.(1) SigComp Feedback Mechanism",
+ RFC4465_A_3_1__SigComp_Feedback_Mechanism_1,
+ 84,
+ {0, ""},
+ 52,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 55**
+ "A.3.1.(2) SigComp Feedback Mechanism",
+ RFC4465_A_3_1__SigComp_Feedback_Mechanism_2,
+ 84,
+ {0, ""},
+ 179,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 56 (SMS MUST be 2048)**
+ "A.3.2.(1) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_1,
+ 446,
+ {0, ""},
+ 811,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 57 (Requires previous test)**
+ "A.3.2.(2) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_2,
+ 446,
+ {0, ""},
+ 2603,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 58 (Requires previous test)**
+ "A.3.2.(3) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_3,
+ 446,
+ {0, ""},
+ 811,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 59 (Requires previous test)**
+ "A.3.2.(4) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_4,
+ 446,
+ {0, ""},
+ 1805,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 60 (Requires previous test)**
+ "A.3.2.(5) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_5,
+ 446,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 61 (Requires previous test)**
+ "A.3.2.(6) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_6,
+ 446,
+ {0, ""},
+ 2057,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 62 (Requires previous test)**
+ "A.3.2.(7) State Memory Management",
+ RFC4465_A_3_2__State_Memory_Management_7,
+ 446,
+ {0, ""},
+ 1993,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 63**
+ "A.3.3.(1) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_1,
+ 437,
+ {0, ""},
+ 1809,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_0
+ }
+ ,
+ {
+ //** 64 (requires previsous test)**
+ "A.3.3.(2) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_2,
+ 437,
+ {0, ""},
+ 1809,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_1
+ }
+ ,
+ {
+ //** 65 (requires previsous test)**
+ "A.3.3.(3) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_3,
+ 437,
+ {0, ""},
+ 1809,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_2
+ }
+ ,
+ {
+ //** 66 (requires previsous test)**
+ "A.3.3.(4) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_4,
+ 437,
+ {0, ""},
+ 1993,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_0
+ }
+ ,
+ {
+ //** 67 (requires previsous test)**
+ "A.3.3.(5) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_5,
+ 437,
+ {0, ""},
+ 1994,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_1
+ }
+ ,
+ {
+ //** 68 (requires previsous test)**
+ "A.3.3.(6) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_6,
+ 437,
+ {0, ""},
+ 1804,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID_2
+ }
+ ,
+ {
+ //** 69 (requires previsous test)**
+ "A.3.3.(7) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_7,
+ 437,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID_0
+ }
+ ,
+ {
+ //** 70 (requires previsous test)**
+ "A.3.3.(8) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_8,
+ 437,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID_1
+ }
+ ,
+ {
+ //** 71 (requires previsous test)**
+ "A.3.3.(9) Multiple Compartments",
+ RFC4465_A_3_3__Multiple_Compartments_9,
+ 437,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ COMPARTMENT_ID_2
+ }
+ ,
+ {
+ //** 72**
+ "A.3.4. Accessing RFC 3485 State",
+ RFC4465_A_3_4__Accessing_RFC_3485_State,
+ 61,
+ {3, "\x53\x49\x50"},
+ 11,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ COMPARTMENT_ID
+ }
+ ,
+ {
+ //** 73**
+ "A.3.5.(1) Bytecode State Creation",
+ RFC4465_A_3_5__Bytecode_State_Creation_1,
+ 74,
+ {2, "\x4f\x4b"},
+ 66,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ "Comp-id:A.3.5. Bytecode State Creation"
+ }
+ ,
+ {
+ //** 74**
+ "A.3.5.(2) Bytecode State Creation",
+ RFC4465_A_3_5__Bytecode_State_Creation_2,
+ 8,
+ {3, "\x4f\x4b\x31"},
+ 7,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ "Comp-id:A.3.5. Bytecode State Creation"
+ }
+ ,
+ {
+ //** 75**
+ "A.3.5.(3) Bytecode State Creation",
+ RFC4465_A_3_5__Bytecode_State_Creation_3,
+ 13,
+ {3, "\x4f\x4b\x32"},
+ 5,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ "Comp-id:A.3.5. Bytecode State Creation"
+ }
+ ,
+ {
+ //** 76**
+ "A.3.5.(4) Bytecode State Creation",
+ RFC4465_A_3_5__Bytecode_State_Creation_4,
+ 7,
+ {3, "\x00\x00\x32"},
+ 5,
+ IS_STREAM_NO,
+ XFAIL_NO,
+ "Comp-id:A.3.5. Bytecode State Creation"
+ }
+ ,
+ {
+ //** 77**
+ "A.3.5.(5) Bytecode State Creation",
+ RFC4465_A_3_5__Bytecode_State_Creation_5,
+ 7,
+ {15, "STATE_NOT_FOUND"},
+ 0,
+ IS_STREAM_NO,
+ XFAIL_YES,
+ "Comp-id:A.3.5. Bytecode State Creation"
+ }
};
-int startsWith(const char* buffer1, size_t size1, const char* buffer2, size_t size2)
+int startsWith(const char* buffer1, size_t size1, const char* buffer2, size_t size2)
{
- size_t i;
+ size_t i;
- if(!size2) return 1;
- if(size1 < size2) return 0;
+ if(!size2) {
+ return 1;
+ }
+ if(size1 < size2) {
+ return 0;
+ }
- for(i = 0; i< size2; i++)
- {
- if(buffer1[i] != buffer2[i])
- {
- return 0;
- }
- }
- return 1;
+ for(i = 0; i< size2; i++) {
+ if(buffer1[i] != buffer2[i]) {
+ return 0;
+ }
+ }
+ return 1;
}
static const int16_t wordForEndianess = 0x4321;
@@ -1031,116 +1046,116 @@ static tsk_bool_t isBigEndian;
static TCOMP_INLINE uint16_t HostToNetworkShort(uint16_t x)
{
- return isBigEndian ? (x) : ((((uint16_t)(x) & 0xff00) >> 8) |
- (((uint16_t)(x) & 0x00ff) << 8));
+ return isBigEndian ? (x) : ((((uint16_t)(x) & 0xff00) >> 8) |
+ (((uint16_t)(x) & 0x00ff) << 8));
}
static void checkResult(const struct_torture_test* test, const tcomp_result_t *result, const void* output_ptr, tsk_size_t output_size)
{
- tsk_bool_t ok_cycles = (result->consumed_cycles == test->xcycles);
- tsk_bool_t ok_output = tsk_true;
+ tsk_bool_t ok_cycles = (result->consumed_cycles == test->xcycles);
+ tsk_bool_t ok_output = tsk_true;
- if(tsk_striequals(test->xoutput.ptr, "decompression_memory_size")){
- printf("xoutput (decompression_memory_size): %s\n", (HostToNetworkShort(DMS) == *((uint16_t*)output_ptr)) ? "YES" : "NO");
- }
- else{
- ok_output = startsWith(output_ptr, output_size, test->xoutput.ptr, test->xoutput.size);
- printf("xoutput: %s\n", ok_output ? "YES" : "NO");
- }
- printf("xcycles: %s\n", ok_cycles ? "YES" : "NO");
- if(!ok_cycles || !ok_output){
- assert(test->xfail && result->isNack); // failure must be expected and NACK have to be present
- assert(tsk_strequals(test->xoutput.ptr, tcomp_nackinfo_get_description(result->nack_info))); // returned NACK and expected one must be equal
- }
+ if(tsk_striequals(test->xoutput.ptr, "decompression_memory_size")) {
+ printf("xoutput (decompression_memory_size): %s\n", (HostToNetworkShort(DMS) == *((uint16_t*)output_ptr)) ? "YES" : "NO");
+ }
+ else {
+ ok_output = startsWith(output_ptr, output_size, test->xoutput.ptr, test->xoutput.size);
+ printf("xoutput: %s\n", ok_output ? "YES" : "NO");
+ }
+ printf("xcycles: %s\n", ok_cycles ? "YES" : "NO");
+ if(!ok_cycles || !ok_output) {
+ assert(test->xfail && result->isNack); // failure must be expected and NACK have to be present
+ assert(tsk_strequals(test->xoutput.ptr, tcomp_nackinfo_get_description(result->nack_info))); // returned NACK and expected one must be equal
+ }
}
static int test_tortures()
{
- size_t i, start, end;
- size_t res_size = 0;
- char buffer[OUTPUT_BUFFER_SIZE];
+ size_t i, start, end;
+ size_t res_size = 0;
+ char buffer[OUTPUT_BUFFER_SIZE];
#if RUN_TEST_LOOP
- for(;;)
+ for(;;)
#endif
- {
- tcomp_manager_handle_t *manager = tcomp_manager_create();
- tcomp_result_t *result = tcomp_result_create();
+ {
+ tcomp_manager_handle_t *manager = tcomp_manager_create();
+ tcomp_result_t *result = tcomp_result_create();
- isBigEndian = ((*(int8_t *)&wordForEndianess) != 0x21);
+ isBigEndian = ((*(int8_t *)&wordForEndianess) != 0x21);
- /* Add SIP dictionary. */
- tcomp_manager_addSipSdpDictionary(manager);
+ /* Add SIP dictionary. */
+ tcomp_manager_addSipSdpDictionary(manager);
- /* Add Presence dictionary. */
- tcomp_manager_addPresenceDictionary(manager);
+ /* Add Presence dictionary. */
+ tcomp_manager_addPresenceDictionary(manager);
- /* Set decompression size. */
- tcomp_manager_setDecompression_Memory_Size(manager, DMS);
- /* Set state memory size. */
- tcomp_manager_setState_Memory_Size(manager, SMS);
- /* Set Cycles Per Bit */
- tcomp_manager_setCycles_Per_Bit(manager, CPB);
+ /* Set decompression size. */
+ tcomp_manager_setDecompression_Memory_Size(manager, DMS);
+ /* Set state memory size. */
+ tcomp_manager_setState_Memory_Size(manager, SMS);
+ /* Set Cycles Per Bit */
+ tcomp_manager_setCycles_Per_Bit(manager, CPB);
#if RUN_TEST_ALL
- start = 0, end = sizeof(tests)/sizeof(tests[0]);
+ start = 0, end = sizeof(tests)/sizeof(tests[0]);
#else
- start = RUN_TEST_NO, end = RUN_TEST_NO + 1;
+ start = RUN_TEST_NO, end = RUN_TEST_NO + 1;
#endif
- for(i = start; i<end; i++){
- printf("=== Testing %s ===\n\n", tests[i].section_name);
+ for(i = start; i<end; i++) {
+ printf("=== Testing %s ===\n\n", tests[i].section_name);
- if(tests[i].stream){
- tcomp_result_setOutputTCPBuffer(result, buffer, OUTPUT_BUFFER_SIZE, STREAM_ID);
- }
- else{
- tcomp_result_setOutputUDPBuffer(result, buffer, OUTPUT_BUFFER_SIZE);
- }
+ if(tests[i].stream) {
+ tcomp_result_setOutputTCPBuffer(result, buffer, OUTPUT_BUFFER_SIZE, STREAM_ID);
+ }
+ else {
+ tcomp_result_setOutputUDPBuffer(result, buffer, OUTPUT_BUFFER_SIZE);
+ }
- /* Performs decompression */
- res_size = tcomp_manager_decompress(manager, tests[i].bytecode, tests[i].bytecode_size, result);
- if(result->isNack){
- printf("\n==WE GOT A NACK\n\n");
- //sendto(tcomp_buffer_getBuffer(result->nack_info), tcomp_buffer_getSize(result->nack_info));
- }
- else{
- tcomp_result_setCompartmentId(result, tests[i].comp_id, strlen(tests[i].comp_id));
- tcomp_manager_provideCompartmentId(manager, result);
- }
+ /* Performs decompression */
+ res_size = tcomp_manager_decompress(manager, tests[i].bytecode, tests[i].bytecode_size, result);
+ if(result->isNack) {
+ printf("\n==WE GOT A NACK\n\n");
+ //sendto(tcomp_buffer_getBuffer(result->nack_info), tcomp_buffer_getSize(result->nack_info));
+ }
+ else {
+ tcomp_result_setCompartmentId(result, tests[i].comp_id, strlen(tests[i].comp_id));
+ tcomp_manager_provideCompartmentId(manager, result);
+ }
- /* Checks result */
- checkResult(&tests[i], result, buffer, sizeof(buffer));
+ /* Checks result */
+ checkResult(&tests[i], result, buffer, sizeof(buffer));
- /* Get sub-sequent stream messages */
- if(tests[i].stream && (res_size || result->isNack)){
- uint64_t consumed_cycles = result->consumed_cycles; // save "consumed_cycles" (shared by all sub-sequent messages)
- for(;;){
- res_size = tcomp_manager_getNextStreamMessage(manager, result);
- if(!res_size && !result->isNack){
- break;
- }
- else if(res_size){
- tcomp_result_setCompartmentId(result, tests[i].comp_id, strlen(tests[i].comp_id));
- tcomp_manager_provideCompartmentId(manager, result);
- }
- else{
- printf("\n==WE GOT A NACK\n\n");
- //sendto(tcomp_buffer_getBuffer(result->nack_info), tcomp_buffer_getSize(result->nack_info));
- }
- result->consumed_cycles = consumed_cycles; // restore cycles just for checking. Had been cleared by "tcomp_manager_getNextStreamMessage()"
- checkResult(&tests[i], result, buffer, sizeof(buffer));
- }
- }
- }
+ /* Get sub-sequent stream messages */
+ if(tests[i].stream && (res_size || result->isNack)) {
+ uint64_t consumed_cycles = result->consumed_cycles; // save "consumed_cycles" (shared by all sub-sequent messages)
+ for(;;) {
+ res_size = tcomp_manager_getNextStreamMessage(manager, result);
+ if(!res_size && !result->isNack) {
+ break;
+ }
+ else if(res_size) {
+ tcomp_result_setCompartmentId(result, tests[i].comp_id, strlen(tests[i].comp_id));
+ tcomp_manager_provideCompartmentId(manager, result);
+ }
+ else {
+ printf("\n==WE GOT A NACK\n\n");
+ //sendto(tcomp_buffer_getBuffer(result->nack_info), tcomp_buffer_getSize(result->nack_info));
+ }
+ result->consumed_cycles = consumed_cycles; // restore cycles just for checking. Had been cleared by "tcomp_manager_getNextStreamMessage()"
+ checkResult(&tests[i], result, buffer, sizeof(buffer));
+ }
+ }
+ }
- /* Free previously allocated resources. */
- TSK_OBJECT_SAFE_FREE(result);
- TSK_OBJECT_SAFE_FREE(manager);
+ /* Free previously allocated resources. */
+ TSK_OBJECT_SAFE_FREE(result);
+ TSK_OBJECT_SAFE_FREE(manager);
- }/* LOOP */
+ }/* LOOP */
- return 0;
+ return 0;
}
#endif /* TEST_TINYSIGCOMP_TORTURES_H */
diff --git a/tinySIP/include/tinysip.h b/tinySIP/include/tinysip.h
index bf666dc..c20ca41 100755
--- a/tinySIP/include/tinysip.h
+++ b/tinySIP/include/tinysip.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/api/tsip_api_common.h b/tinySIP/include/tinysip/api/tsip_api_common.h
index 1f91f66..64bc885 100755
--- a/tinySIP/include/tinysip/api/tsip_api_common.h
+++ b/tinySIP/include/tinysip/api/tsip_api_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/api/tsip_api_info.h b/tinySIP/include/tinysip/api/tsip_api_info.h
index 5c7f08e..edbacf8 100755
--- a/tinySIP/include/tinysip/api/tsip_api_info.h
+++ b/tinySIP/include/tinysip/api/tsip_api_info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,18 +39,16 @@ TSIP_BEGIN_DECLS
#define TSIP_INFO_EVENT(self) ((tsip_info_event_t*)(self))
//@rinyWRAP
-typedef enum tsip_info_event_type_e
-{
- tsip_i_info,
- tsip_ao_info,
+typedef enum tsip_info_event_type_e {
+ tsip_i_info,
+ tsip_ao_info,
}
tsip_info_event_type_t;
-typedef struct tsip_info_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_info_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_info_event_type_t type;
+ tsip_info_event_type_t type;
}
tsip_info_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_invite.h b/tinySIP/include/tinysip/api/tsip_api_invite.h
index 7fa5b01..b71eb5f 100755
--- a/tinySIP/include/tinysip/api/tsip_api_invite.h
+++ b/tinySIP/include/tinysip/api/tsip_api_invite.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,60 +41,58 @@ TSIP_BEGIN_DECLS
#define TSIP_INVITE_EVENT(self) ((tsip_invite_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_invite_event_type_e
-{
- // ============================
- // Sip Events
- //
- tsip_i_newcall,
-
- //! in-dialog requests/reponses
- tsip_i_request,
- tsip_ao_request,
-
- /* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
- tsip_o_ect_trying,
- tsip_o_ect_accepted,
- tsip_o_ect_completed,
- tsip_o_ect_failed,
- tsip_o_ect_notify,
- tsip_i_ect_requested,
- tsip_i_ect_newcall,
- tsip_i_ect_completed,
- tsip_i_ect_failed,
- tsip_i_ect_notify,
-
- // ============================
- // Media Events
- //
-
- tsip_m_early_media,
- tsip_m_updating, // Trying to update from Audio -> Video for example
- tsip_m_updated, // succeed to update
-
- /* 3GPP TS 24.610: Communication Hold */
- tsip_m_local_hold_ok,
- tsip_m_local_hold_nok,
- tsip_m_local_resume_ok,
- tsip_m_local_resume_nok,
- tsip_m_remote_hold,
- tsip_m_remote_resume,
+typedef enum tsip_invite_event_type_e {
+ // ============================
+ // Sip Events
+ //
+ tsip_i_newcall,
+
+ //! in-dialog requests/reponses
+ tsip_i_request,
+ tsip_ao_request,
+
+ /* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
+ tsip_o_ect_trying,
+ tsip_o_ect_accepted,
+ tsip_o_ect_completed,
+ tsip_o_ect_failed,
+ tsip_o_ect_notify,
+ tsip_i_ect_requested,
+ tsip_i_ect_newcall,
+ tsip_i_ect_completed,
+ tsip_i_ect_failed,
+ tsip_i_ect_notify,
+
+ // ============================
+ // Media Events
+ //
+
+ tsip_m_early_media,
+ tsip_m_updating, // Trying to update from Audio -> Video for example
+ tsip_m_updated, // succeed to update
+
+ /* 3GPP TS 24.610: Communication Hold */
+ tsip_m_local_hold_ok,
+ tsip_m_local_hold_nok,
+ tsip_m_local_resume_ok,
+ tsip_m_local_resume_nok,
+ tsip_m_remote_hold,
+ tsip_m_remote_resume,
}
tsip_invite_event_type_t;
-typedef struct tsip_invite_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_invite_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_invite_event_type_t type;
+ tsip_invite_event_type_t type;
- struct{
- unsigned toto:1;
- } av;
+ struct {
+ unsigned toto:1;
+ } av;
- /*struct{
- char* dir;
- } msrp;*/
+ /*struct{
+ char* dir;
+ } msrp;*/
}
tsip_invite_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_message.h b/tinySIP/include/tinysip/api/tsip_api_message.h
index e52c914..6ace613 100755
--- a/tinySIP/include/tinysip/api/tsip_api_message.h
+++ b/tinySIP/include/tinysip/api/tsip_api_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,18 +39,16 @@ TSIP_BEGIN_DECLS
#define TSIP_MESSAGE_EVENT(self) ((tsip_message_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_message_event_type_e
-{
- tsip_i_message,
- tsip_ao_message,
+typedef enum tsip_message_event_type_e {
+ tsip_i_message,
+ tsip_ao_message,
}
tsip_message_event_type_t;
-typedef struct tsip_message_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_message_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_message_event_type_t type;
+ tsip_message_event_type_t type;
}
tsip_message_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_options.h b/tinySIP/include/tinysip/api/tsip_api_options.h
index 1f62211..47ef00a 100755
--- a/tinySIP/include/tinysip/api/tsip_api_options.h
+++ b/tinySIP/include/tinysip/api/tsip_api_options.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,20 +39,18 @@ TSIP_BEGIN_DECLS
#define TSIP_OPTIONS_EVENT(self) ((tsip_options_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_options_event_type_e
-{
- tsip_i_options,
- tsip_ao_options,
+typedef enum tsip_options_event_type_e {
+ tsip_i_options,
+ tsip_ao_options,
}
tsip_options_event_type_t;
/**< Event from SIP OPTIONS dialog */
-typedef struct tsip_options_event_e
-{
- TSIP_DECLARE_EVENT;
-
- //! the type of the event
- tsip_options_event_type_t type;
+typedef struct tsip_options_event_e {
+ TSIP_DECLARE_EVENT;
+
+ //! the type of the event
+ tsip_options_event_type_t type;
}
tsip_options_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_publish.h b/tinySIP/include/tinysip/api/tsip_api_publish.h
index c37f239..73449e9 100755
--- a/tinySIP/include/tinysip/api/tsip_api_publish.h
+++ b/tinySIP/include/tinysip/api/tsip_api_publish.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,21 +39,19 @@ TSIP_BEGIN_DECLS
#define TSIP_PUBLISH_EVENT(self) ((tsip_publish_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_publish_event_type_e
-{
- tsip_i_publish,
- tsip_ao_publish,
-
- tsip_i_unpublish,
- tsip_ao_unpublish
+typedef enum tsip_publish_event_type_e {
+ tsip_i_publish,
+ tsip_ao_publish,
+
+ tsip_i_unpublish,
+ tsip_ao_unpublish
}
tsip_publish_event_type_t;
-typedef struct tsip_publish_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_publish_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_publish_event_type_t type;
+ tsip_publish_event_type_t type;
}
tsip_publish_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_register.h b/tinySIP/include/tinysip/api/tsip_api_register.h
index d116006..73d51b4 100755
--- a/tinySIP/include/tinysip/api/tsip_api_register.h
+++ b/tinySIP/include/tinysip/api/tsip_api_register.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,23 +39,21 @@ TSIP_BEGIN_DECLS
#define TSIP_REGISTER_EVENT(self) ((tsip_register_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_register_event_type_e
-{
- tsip_i_newreg,
+typedef enum tsip_register_event_type_e {
+ tsip_i_newreg,
- tsip_i_register, // refresh
- tsip_ao_register,
+ tsip_i_register, // refresh
+ tsip_ao_register,
- tsip_i_unregister,
- tsip_ao_unregister,
+ tsip_i_unregister,
+ tsip_ao_unregister,
}
tsip_register_event_type_t;
-typedef struct tsip_register_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_register_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_register_event_type_t type;
+ tsip_register_event_type_t type;
}
tsip_register_event_t;
diff --git a/tinySIP/include/tinysip/api/tsip_api_subscribe.h b/tinySIP/include/tinysip/api/tsip_api_subscribe.h
index da7f8c9..a7b1b21 100755
--- a/tinySIP/include/tinysip/api/tsip_api_subscribe.h
+++ b/tinySIP/include/tinysip/api/tsip_api_subscribe.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,24 +39,22 @@ TSIP_BEGIN_DECLS
#define TSIP_SUBSCRIBE_EVENT(self) ((tsip_subscribe_event_t*)(self))
//@tinyWRAP
-typedef enum tsip_subscribe_event_type_e
-{
- tsip_i_subscribe,
- tsip_ao_subscribe,
-
- tsip_i_unsubscribe,
- tsip_ao_unsubscribe,
-
- tsip_i_notify,
- tsip_ao_notify
+typedef enum tsip_subscribe_event_type_e {
+ tsip_i_subscribe,
+ tsip_ao_subscribe,
+
+ tsip_i_unsubscribe,
+ tsip_ao_unsubscribe,
+
+ tsip_i_notify,
+ tsip_ao_notify
}
tsip_subscribe_event_type_t;
-typedef struct tsip_subscribe_event_e
-{
- TSIP_DECLARE_EVENT;
+typedef struct tsip_subscribe_event_e {
+ TSIP_DECLARE_EVENT;
- tsip_subscribe_event_type_t type;
+ tsip_subscribe_event_type_t type;
}
tsip_subscribe_event_t;
diff --git a/tinySIP/include/tinysip/authentication/tsip_challenge.h b/tinySIP/include/tinysip/authentication/tsip_challenge.h
index 38f7690..7de2659 100755
--- a/tinySIP/include/tinysip/authentication/tsip_challenge.h
+++ b/tinySIP/include/tinysip/authentication/tsip_challenge.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,29 +48,28 @@
TSIP_BEGIN_DECLS
-typedef struct tsip_challenge_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_challenge_s {
+ TSK_DECLARE_OBJECT;
- const tsip_stack_handle_t *stack;
+ const tsip_stack_handle_t *stack;
- tsk_bool_t isproxy;
+ tsk_bool_t isproxy;
- char* username;
- char* scheme;
- char* realm;
- char* nonce;
- char* opaque;
- char* algorithm;
- const char* qop;
+ char* username;
+ char* scheme;
+ char* realm;
+ char* nonce;
+ char* opaque;
+ char* algorithm;
+ const char* qop;
- char* ha1_hexstr;
+ char* ha1_hexstr;
- AKA_CK_T ck;
- AKA_IK_T ik;
+ AKA_CK_T ck;
+ AKA_IK_T ik;
- tsk_md5string_t cnonce;
- unsigned nc;
+ tsk_md5string_t cnonce;
+ unsigned nc;
}
tsip_challenge_t;
diff --git a/tinySIP/include/tinysip/authentication/tsip_milenage.h b/tinySIP/include/tinysip/authentication/tsip_milenage.h
index dbf72de..6f4aea7 100755
--- a/tinySIP/include/tinysip/authentication/tsip_milenage.h
+++ b/tinySIP/include/tinysip/authentication/tsip_milenage.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,7 +42,7 @@
*
* This has been coded for clarity, not necessarily for efficiency.
*
- * The functions f2, f3, f4 and f5 share the same inputs and have
+ * The functions f2, f3, f4 and f5 share the same inputs and have
* been coded together as a single function. f1, f1* and f5* are
* all coded separately.
*
@@ -59,7 +59,7 @@
#include "tinysip_config.h"
/**@def AKA_AK_SIZE
- * a 48-bit anonymity key that is the output of either of the functions f5 and f5*.
+ * a 48-bit anonymity key that is the output of either of the functions f5 and f5*.
* Defined in 3GPP TS 35.206 subclause 2.3.
*/
@@ -97,7 +97,7 @@ typedef uint8_t AKA_IK_T[AKA_IK_SIZE + 1];
typedef uint8_t AKA_K_T[AKA_K_SIZE + 1];
/**@def AKA_MAC_A_SIZE
- * a 64-bit network authentication code that is the output of the function f1.
+ * a 64-bit network authentication code that is the output of the function f1.
* Defined in 3GPP TS 35.206 subclause 2.3.
*/
#define AKA_MAC_A_SIZE 8
@@ -137,7 +137,7 @@ typedef uint8_t AKA_RAND_T[AKA_RAND_SIZE + 1];
*/
#define AKA_RES_SIZE 8
typedef uint8_t AKA_RES_T[AKA_RES_SIZE + 1];
-
+
/**@def AKA_SQN_SIZE
* a 48-bit sequence number that is an input to either of the functions f1 and f1*. (For f1* this input is more precisely called SQNMS.)
* Defined in 3GPP TS 35.206 subclause 2.3.
@@ -175,7 +175,7 @@ void f1 ( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
uint8_t mac_a[8] );
void f2345 ( uint8_t k[16], uint8_t rand[16],
uint8_t res[8], uint8_t ck[16], uint8_t ik[16], uint8_t ak[6] );
-void f1star( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
+void f1star( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
uint8_t mac_s[8] );
void f5star( uint8_t k[16], uint8_t rand[16],
uint8_t ak[6] );
diff --git a/tinySIP/include/tinysip/authentication/tsip_rijndael.h b/tinySIP/include/tinysip/authentication/tsip_rijndael.h
index 18efe3a..acf6b6d 100755
--- a/tinySIP/include/tinysip/authentication/tsip_rijndael.h
+++ b/tinySIP/include/tinysip/authentication/tsip_rijndael.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog.h b/tinySIP/include/tinysip/dialogs/tsip_dialog.h
index e6280b9..e9e8c0c 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -61,7 +61,7 @@ TSIP_BEGIN_DECLS
// TX MUST be in seconds
#define TSIP_DIALOG_TIMER_SCHEDULE(name, TX) \
- self->timer##TX.id = tsk_timer_mgr_global_schedule(self->timer##TX.timeout, TSK_TIMER_CALLBACK_F(tsip_dialog_##name##_timer_callback), self)
+ self->timer##TX.id = tsk_timer_mgr_global_schedule(self->timer##TX.timeout, TSK_TIMER_CALLBACK_F(tsip_dialog_##name##_timer_callback), self)
#define TSIP_DIALOG_SIGNAL(self, code, phrase) \
tsip_event_signal(tsip_event_dialog, TSIP_DIALOG(self)->ss, code, phrase)
@@ -79,38 +79,35 @@ TSIP_BEGIN_DECLS
typedef uint64_t tsip_dialog_id_t;
-typedef enum tsip_dialog_state_e
-{
- tsip_initial,
- tsip_early,
- tsip_established,
- tsip_terminated
+typedef enum tsip_dialog_state_e {
+ tsip_initial,
+ tsip_early,
+ tsip_established,
+ tsip_terminated
}
tsip_dialog_state_t;
-typedef enum tsip_dialog_type_e
-{
- tsip_dialog_unknown,
- tsip_dialog_INVITE,
- tsip_dialog_MESSAGE,
- tsip_dialog_INFO,
- tsip_dialog_OPTIONS,
- tsip_dialog_PUBLISH,
- tsip_dialog_REGISTER,
- tsip_dialog_SUBSCRIBE,
+typedef enum tsip_dialog_type_e {
+ tsip_dialog_unknown,
+ tsip_dialog_INVITE,
+ tsip_dialog_MESSAGE,
+ tsip_dialog_INFO,
+ tsip_dialog_OPTIONS,
+ tsip_dialog_PUBLISH,
+ tsip_dialog_REGISTER,
+ tsip_dialog_SUBSCRIBE,
}
tsip_dialog_type_t;
-typedef enum tsip_dialog_event_type_e
-{
- tsip_dialog_i_msg,
- tsip_dialog_o_msg,
- tsip_dialog_transac_ok,
- tsip_dialog_canceled,
- tsip_dialog_terminated,
- tsip_dialog_timedout,
- tsip_dialog_error,
- tsip_dialog_transport_error,
+typedef enum tsip_dialog_event_type_e {
+ tsip_dialog_i_msg,
+ tsip_dialog_o_msg,
+ tsip_dialog_transac_ok,
+ tsip_dialog_canceled,
+ tsip_dialog_terminated,
+ tsip_dialog_timedout,
+ tsip_dialog_error,
+ tsip_dialog_transport_error,
}
tsip_dialog_event_type_t;
@@ -119,53 +116,52 @@ typedef int (*tsip_dialog_event_callback_f)(const void *arg, tsip_dialog_event_t
/*================================
*/
-typedef struct tsip_dialog_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_dialog_type_t type;
- tsip_dialog_id_t id;
-
- tsk_fsm_t* fsm;
-
- tsip_ssession_t* ss;
- tsip_action_t* curr_action;
-
- tsip_dialog_state_t state;
-
- tsk_bool_t initialized;
- tsk_bool_t running;
-
- tnet_fd_t connected_fd;
-
- struct{
- char* phrase;
- short code;
- tsip_message_t* message;
- } last_error;
-
- char* tag_local;
- tsip_uri_t* uri_local;
- char* tag_remote;
- tsip_uri_t* uri_remote;
-
- tsip_uri_t* uri_remote_target;
- struct sockaddr_storage remote_addr; // Only valid for Dgram
-
- uint32_t cseq_value;
- char* cseq_method;
-
- int64_t expires; /* in milliseconds */
-
- char* callid;
-
- tsip_header_Record_Routes_L_t *record_routes;
-
- tsip_challenges_L_t *challenges;
-
- tsip_dialog_event_callback_f callback;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tsip_dialog_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_dialog_type_t type;
+ tsip_dialog_id_t id;
+
+ tsk_fsm_t* fsm;
+
+ tsip_ssession_t* ss;
+ tsip_action_t* curr_action;
+
+ tsip_dialog_state_t state;
+
+ tsk_bool_t initialized;
+ tsk_bool_t running;
+
+ tnet_fd_t connected_fd;
+
+ struct {
+ char* phrase;
+ short code;
+ tsip_message_t* message;
+ } last_error;
+
+ char* tag_local;
+ tsip_uri_t* uri_local;
+ char* tag_remote;
+ tsip_uri_t* uri_remote;
+
+ tsip_uri_t* uri_remote_target;
+ struct sockaddr_storage remote_addr; // Only valid for Dgram
+
+ uint32_t cseq_value;
+ char* cseq_method;
+
+ int64_t expires; /* in milliseconds */
+
+ char* callid;
+
+ tsip_header_Record_Routes_L_t *record_routes;
+
+ tsip_challenges_L_t *challenges;
+
+ tsip_dialog_event_callback_f callback;
+
+ TSK_DECLARE_SAFEOBJ;
}
tsip_dialog_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_info.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_info.h
index 94fe6ad..1c54442 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_info.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ struct tsip_message_s;
#define TSIP_DIALOG_INFO(self) ((tsip_dialog_info_t*)(self))
-typedef struct tsip_dialog_info
-{
- TSIP_DECLARE_DIALOG;
- /**< Last incoming message. */
- struct tsip_message_s* last_iMessage;
+typedef struct tsip_dialog_info {
+ TSIP_DECLARE_DIALOG;
+ /**< Last incoming message. */
+ struct tsip_message_s* last_iMessage;
}
tsip_dialog_info_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h
index 1496ca7..15494ad 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,75 +40,73 @@
#define TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT 16000
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_accept = tsip_atype_accept,
- _fsm_action_reject = tsip_atype_hangup,
- _fsm_action_dtmf_send = tsip_atype_dtmf_send,
- _fsm_action_msrp_send_msg = tsip_atype_lmessage,
- _fsm_action_oINVITE = tsip_atype_invite,
- _fsm_action_oCANCEL = tsip_atype_cancel,
- _fsm_action_oHold = tsip_atype_hold,
- _fsm_action_oResume = tsip_atype_resume,
- _fsm_action_oECT = tsip_atype_ect,
- _fsm_action_iECT_ACCEPT = tsip_atype_ect_accept,
- _fsm_action_iECT_REJECT = tsip_atype_ect_reject,
- _fsm_action_iECT_lNOTIFY = tsip_atype_ect_lnotify,
- _fsm_action_oINFO = tsip_atype_info_send,
- _fsm_action_oBYE = tsip_atype_hangup,
- _fsm_action_oShutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_iINVITE = 0xFF,
- _fsm_action_oUPDATE,
- _fsm_action_iUPDATE,
- _fsm_action_iCANCEL,
- _fsm_action_iPRACK,
- _fsm_action_oPRACK,
- _fsm_action_iACK,
- _fsm_action_oACK,
- _fsm_action_iOPTIONS,
- _fsm_action_oOPTIONS,
- _fsm_action_iBYE,
- _fsm_action_iREFER,
- _fsm_action_iINFO,
- _fsm_action_iNOTIFY,
-
- _fsm_action_timer100rel,
- _fsm_action_timerRefresh,
- _fsm_action_timerRSVP,
-
- _fsm_action_i1xx,
- _fsm_action_i2xx,
- _fsm_action_i300_to_i699,
- _fsm_action_i401_i407,
- _fsm_action_i422,
-
- _fsm_action_shutdown_timedout, /* Any -> Terminated */
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_accept = tsip_atype_accept,
+ _fsm_action_reject = tsip_atype_hangup,
+ _fsm_action_dtmf_send = tsip_atype_dtmf_send,
+ _fsm_action_msrp_send_msg = tsip_atype_lmessage,
+ _fsm_action_oINVITE = tsip_atype_invite,
+ _fsm_action_oCANCEL = tsip_atype_cancel,
+ _fsm_action_oHold = tsip_atype_hold,
+ _fsm_action_oResume = tsip_atype_resume,
+ _fsm_action_oECT = tsip_atype_ect,
+ _fsm_action_iECT_ACCEPT = tsip_atype_ect_accept,
+ _fsm_action_iECT_REJECT = tsip_atype_ect_reject,
+ _fsm_action_iECT_lNOTIFY = tsip_atype_ect_lnotify,
+ _fsm_action_oINFO = tsip_atype_info_send,
+ _fsm_action_oBYE = tsip_atype_hangup,
+ _fsm_action_oShutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_iINVITE = 0xFF,
+ _fsm_action_oUPDATE,
+ _fsm_action_iUPDATE,
+ _fsm_action_iCANCEL,
+ _fsm_action_iPRACK,
+ _fsm_action_oPRACK,
+ _fsm_action_iACK,
+ _fsm_action_oACK,
+ _fsm_action_iOPTIONS,
+ _fsm_action_oOPTIONS,
+ _fsm_action_iBYE,
+ _fsm_action_iREFER,
+ _fsm_action_iINFO,
+ _fsm_action_iNOTIFY,
+
+ _fsm_action_timer100rel,
+ _fsm_action_timerRefresh,
+ _fsm_action_timerRSVP,
+
+ _fsm_action_i1xx,
+ _fsm_action_i2xx,
+ _fsm_action_i300_to_i699,
+ _fsm_action_i401_i407,
+ _fsm_action_i422,
+
+ _fsm_action_shutdown_timedout, /* Any -> Terminated */
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Outgoing,
- _fsm_state_Incoming,
- _fsm_state_Trying,
- _fsm_state_Ringing,
- _fsm_state_Cancelling,
- _fsm_state_InProgress,
-
- _fsm_state_Holding,
- _fsm_state_Resuming,
-
- _fsm_state_oECTing,
- _fsm_state_iECTing,
- _fsm_state_iECTreq,
-
- _fsm_state_Connected,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Outgoing,
+ _fsm_state_Incoming,
+ _fsm_state_Trying,
+ _fsm_state_Ringing,
+ _fsm_state_Cancelling,
+ _fsm_state_InProgress,
+
+ _fsm_state_Holding,
+ _fsm_state_Resuming,
+
+ _fsm_state_oECTing,
+ _fsm_state_iECTing,
+ _fsm_state_iECTreq,
+
+ _fsm_state_Connected,
+ _fsm_state_Terminated
}
_fsm_state_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.h
index b3bbfea..0a90e4d 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_invite.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,80 +40,79 @@ TSIP_BEGIN_DECLS
#define TSIP_DIALOG_INVITE(self) ((tsip_dialog_invite_t*)(self))
-typedef struct tsip_dialog_invite
-{
- TSIP_DECLARE_DIALOG;
-
- tsk_bool_t support_update; /**< Indicates whether the remote party support UPDATE */
- tsk_bool_t is_client;
- tsk_bool_t is_transf;
- tsk_bool_t refersub;
- tsk_bool_t use_rtcp;
- tsk_bool_t use_rtcpmux;
+typedef struct tsip_dialog_invite {
+ TSIP_DECLARE_DIALOG;
+
+ tsk_bool_t support_update; /**< Indicates whether the remote party support UPDATE */
+ tsk_bool_t is_client;
+ tsk_bool_t is_transf;
+ tsk_bool_t refersub;
+ tsk_bool_t use_rtcp;
+ tsk_bool_t use_rtcpmux;
tsk_bool_t is_initial_iack_pending; // we're waiting for the initial incoming ACK (for the 200 OK) to ensure the session
tsk_bool_t is_cancelling; // whether we're cancelling the outgoing INVITE
- uint32_t rseq;
- uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
- uint64_t last_out_fastupdate_time;
-
- tsip_timer_t timershutdown;
- tsip_timer_t timer100rel;
-
- tsip_response_t* last_o1xxrel;
- tsip_request_t* last_iInvite;
- tsip_request_t* last_oInvite;
- tsip_request_t* last_iRefer;
- tmedia_session_mgr_t* msession_mgr; /**< Media session Manager */
-
- struct tsip_ssession_s* ss_transf;
-
- /* ICE */
- struct{
- tmedia_type_t media_type;
- tsk_bool_t is_jingle;
- tsk_bool_t start_smgr;
- struct tnet_ice_ctx_s *ctx_audio;
- struct tnet_ice_ctx_s *ctx_video;
- tsk_fsm_action_id last_action_id;
- tsip_action_t* last_action;
- tsip_message_t* last_message;
- int32_t last_sdp_ro_ver;
- } ice;
-
- /* Session Timers */
- struct{
- tsip_timer_t timer;
- char* refresher;
- uint64_t minse;
- tsk_bool_t is_refresher;
- } stimers;
- /* QoS (Preconditions) */
- struct{
- tsip_timer_t timer;
- enum tmedia_qos_stype_e type;
- enum tmedia_qos_strength_e strength;
- } qos;
- /* Hold/Resume */
- struct{
- unsigned remote:1;
- unsigned local:1;
- } hold;
-
- struct{
- unsigned _100rel:1;
- unsigned precondition:1;
- unsigned timer:1;
- unsigned norefersub:1;
- unsigned ice:1;
- } supported;
-
- struct{
- unsigned _100rel:1;
- unsigned precondition:1;
- unsigned timer:1;
- unsigned norefersub;
- unsigned ice:1;
- } required;
+ uint32_t rseq;
+ uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
+ uint64_t last_out_fastupdate_time;
+
+ tsip_timer_t timershutdown;
+ tsip_timer_t timer100rel;
+
+ tsip_response_t* last_o1xxrel;
+ tsip_request_t* last_iInvite;
+ tsip_request_t* last_oInvite;
+ tsip_request_t* last_iRefer;
+ tmedia_session_mgr_t* msession_mgr; /**< Media session Manager */
+
+ struct tsip_ssession_s* ss_transf;
+
+ /* ICE */
+ struct {
+ tmedia_type_t media_type;
+ tsk_bool_t is_jingle;
+ tsk_bool_t start_smgr;
+ struct tnet_ice_ctx_s *ctx_audio;
+ struct tnet_ice_ctx_s *ctx_video;
+ tsk_fsm_action_id last_action_id;
+ tsip_action_t* last_action;
+ tsip_message_t* last_message;
+ int32_t last_sdp_ro_ver;
+ } ice;
+
+ /* Session Timers */
+ struct {
+ tsip_timer_t timer;
+ char* refresher;
+ uint64_t minse;
+ tsk_bool_t is_refresher;
+ } stimers;
+ /* QoS (Preconditions) */
+ struct {
+ tsip_timer_t timer;
+ enum tmedia_qos_stype_e type;
+ enum tmedia_qos_strength_e strength;
+ } qos;
+ /* Hold/Resume */
+ struct {
+ unsigned remote:1;
+ unsigned local:1;
+ } hold;
+
+ struct {
+ unsigned _100rel:1;
+ unsigned precondition:1;
+ unsigned timer:1;
+ unsigned norefersub:1;
+ unsigned ice:1;
+ } supported;
+
+ struct {
+ unsigned _100rel:1;
+ unsigned precondition:1;
+ unsigned timer:1;
+ unsigned norefersub;
+ unsigned ice:1;
+ } required;
}
tsip_dialog_invite_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_layer.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_layer.h
index 3539361..0a73a3b 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_layer.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_layer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,21 +41,20 @@
TSIP_BEGIN_DECLS
-typedef struct tsip_dialog_layer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_dialog_layer_s {
+ TSK_DECLARE_OBJECT;
- const tsip_stack_t *stack;
+ const tsip_stack_t *stack;
- tsip_dialogs_L_t *dialogs;
+ tsip_dialogs_L_t *dialogs;
- struct{
- tsk_bool_t inprogress;
- tsk_bool_t phase2; /* whether unregistering? */
- tsk_condwait_handle_t* condwait;
- } shutdown;
+ struct {
+ tsk_bool_t inprogress;
+ tsk_bool_t phase2; /* whether unregistering? */
+ tsk_condwait_handle_t* condwait;
+ } shutdown;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tsip_dialog_layer_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_message.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_message.h
index 904af54..77bc5cb 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_message.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ struct tsip_message_s;
#define TSIP_DIALOG_MESSAGE(self) ((tsip_dialog_message_t*)(self))
-typedef struct tsip_dialog_message
-{
- TSIP_DECLARE_DIALOG;
- /**< Last incoming or outgoing message. */
- struct tsip_message_s* request;
+typedef struct tsip_dialog_message {
+ TSIP_DECLARE_DIALOG;
+ /**< Last incoming or outgoing message. */
+ struct tsip_message_s* request;
}
tsip_dialog_message_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_options.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_options.h
index e092a32..db8837c 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_options.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_options.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,11 +37,10 @@ TSIP_BEGIN_DECLS
#define TSIP_DIALOG_OPTIONS(self) ((tsip_dialog_options_t*)(self))
-typedef struct tsip_dialog_options
-{
- TSIP_DECLARE_DIALOG;
- /**< Last incoming message. */
- struct tsip_message_s* last_iMessage;
+typedef struct tsip_dialog_options {
+ TSIP_DECLARE_DIALOG;
+ /**< Last incoming message. */
+ struct tsip_message_s* last_iMessage;
}
tsip_dialog_options_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_publish.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_publish.h
index b4ef37b..6919508 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_publish.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_publish.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,15 +37,14 @@ TSIP_BEGIN_DECLS
#define TSIP_DIALOG_PUBLISH(self) ((tsip_dialog_publish_t*)(self))
-typedef struct tsip_dialog_publish
-{
- TSIP_DECLARE_DIALOG;
-
- tsip_timer_t timerrefresh;
- tsip_timer_t timershutdown;
+typedef struct tsip_dialog_publish {
+ TSIP_DECLARE_DIALOG;
+
+ tsip_timer_t timerrefresh;
+ tsip_timer_t timershutdown;
- tsk_bool_t unpublishing;
- char* etag;
+ tsk_bool_t unpublishing;
+ char* etag;
}
tsip_dialog_publish_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_register.common.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_register.common.h
index 94e4897..e99df2b 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_register.common.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_register.common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,37 +31,35 @@
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_accept = tsip_atype_accept,
- _fsm_action_reject = tsip_atype_hangup,
- _fsm_action_hangup = tsip_atype_hangup,
- _fsm_action_oREGISTER = tsip_atype_register,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
+typedef enum _fsm_action_e {
+ _fsm_action_accept = tsip_atype_accept,
+ _fsm_action_reject = tsip_atype_hangup,
+ _fsm_action_hangup = tsip_atype_hangup,
+ _fsm_action_oREGISTER = tsip_atype_register,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
- _fsm_action_1xx = 0xFF,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_423,
- _fsm_action_300_to_699,
+ _fsm_action_1xx = 0xFF,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_423,
+ _fsm_action_300_to_699,
- _fsm_action_iREGISTER,
+ _fsm_action_iREGISTER,
- _fsm_action_shutdown_timedout, /* Any -> Terminated */
- _fsm_action_error,
+ _fsm_action_shutdown_timedout, /* Any -> Terminated */
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_InProgress, // Outgoing (Client)
- _fsm_state_Incoming, // Incoming (Server)
- _fsm_state_Connected,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_InProgress, // Outgoing (Client)
+ _fsm_state_Incoming, // Incoming (Server)
+ _fsm_state_Connected,
+ _fsm_state_Terminated
}
_fsm_state_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_register.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_register.h
index d2acf1a..bfb72ed 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_register.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_register.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,17 +38,16 @@ TSIP_BEGIN_DECLS
#define TSIP_DIALOG_REGISTER(self) ((tsip_dialog_register_t*)(self))
/**< SIP REGISTER dialog */
-typedef struct tsip_dialog_register
-{
- TSIP_DECLARE_DIALOG;
+typedef struct tsip_dialog_register {
+ TSIP_DECLARE_DIALOG;
- tsip_timer_t timerrefresh;
- tsip_timer_t timershutdown;
+ tsip_timer_t timerrefresh;
+ tsip_timer_t timershutdown;
- tsip_request_t* last_iRegister;
+ tsip_request_t* last_iRegister;
- tsk_bool_t unregistering;
- tsk_bool_t is_server;
+ tsk_bool_t unregistering;
+ tsk_bool_t is_server;
}
tsip_dialog_register_t;
diff --git a/tinySIP/include/tinysip/dialogs/tsip_dialog_subscribe.h b/tinySIP/include/tinysip/dialogs/tsip_dialog_subscribe.h
index c7db35b..4e66b33 100755
--- a/tinySIP/include/tinysip/dialogs/tsip_dialog_subscribe.h
+++ b/tinySIP/include/tinysip/dialogs/tsip_dialog_subscribe.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,14 +37,13 @@ TSIP_BEGIN_DECLS
#define TSIP_DIALOG_SUBSCRIBE(self) ((tsip_dialog_subscribe_t*)(self))
-typedef struct tsip_dialog_subscribe
-{
- TSIP_DECLARE_DIALOG;
-
- tsip_timer_t timerrefresh;
- tsip_timer_t timershutdown;
+typedef struct tsip_dialog_subscribe {
+ TSIP_DECLARE_DIALOG;
+
+ tsip_timer_t timerrefresh;
+ tsip_timer_t timershutdown;
- tsk_bool_t unsubscribing;
+ tsk_bool_t unsubscribing;
}
tsip_dialog_subscribe_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header.h b/tinySIP/include/tinysip/headers/tsip_header.h
index b611140..9237cf7 100755
--- a/tinySIP/include/tinysip/headers/tsip_header.h
+++ b/tinySIP/include/tinysip/headers/tsip_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,113 +59,111 @@ typedef char* (*tsip_header_get_special_param_value_f)(const struct tsip_header_
*
* @brief List of all supported headers.
**/
-typedef enum tsip_header_type_e
-{
- tsip_htype_Accept,
- tsip_htype_Accept_Contact,
- tsip_htype_Accept_Encoding,
- tsip_htype_Accept_Language,
- tsip_htype_Accept_Resource_Priority,
- tsip_htype_Alert_Info,
- tsip_htype_Allow,
- tsip_htype_Allow_Events,
- tsip_htype_Authentication_Info,
- tsip_htype_Authorization,
- tsip_htype_Call_ID,
- tsip_htype_Call_Info,
- tsip_htype_Contact,
- tsip_htype_Content_Disposition,
- tsip_htype_Content_Encoding,
- tsip_htype_Content_Language,
- tsip_htype_Content_Length,
- tsip_htype_Content_Type,
- tsip_htype_CSeq,
- tsip_htype_Date,
- tsip_htype_Dummy,
- tsip_htype_Error_Info,
- tsip_htype_Event,
- tsip_htype_Expires,
- tsip_htype_From,
- tsip_htype_History_Info,
- tsip_htype_Identity,
- tsip_htype_Identity_Info,
- tsip_htype_In_Reply_To,
- tsip_htype_Join,
- tsip_htype_Max_Forwards,
- tsip_htype_MIME_Version,
- tsip_htype_Min_Expires,
- tsip_htype_Min_SE,
- tsip_htype_Organization,
- tsip_htype_Path,
- tsip_htype_Priority,
- tsip_htype_Privacy,
- tsip_htype_Proxy_Authenticate,
- tsip_htype_Proxy_Authorization,
- tsip_htype_Proxy_Require,
- tsip_htype_RAck,
- tsip_htype_Reason,
- tsip_htype_Record_Route,
- tsip_htype_Refer_Sub,
- tsip_htype_Refer_To,
- tsip_htype_Referred_By,
- tsip_htype_Reject_Contact,
- tsip_htype_Replaces,
- tsip_htype_Reply_To,
- tsip_htype_Request_Disposition,
- tsip_htype_Require,
- tsip_htype_Resource_Priority,
- tsip_htype_Retry_After,
- tsip_htype_Route,
- tsip_htype_RSeq,
- tsip_htype_Security_Client,
- tsip_htype_Security_Server,
- tsip_htype_Security_Verify,
- tsip_htype_Server,
- tsip_htype_Service_Route,
- tsip_htype_Session_Expires,
- tsip_htype_SIP_ETag,
- tsip_htype_SIP_If_Match,
- tsip_htype_Subject,
- tsip_htype_Subscription_State,
- tsip_htype_Supported,
- tsip_htype_Target_Dialog,
- tsip_htype_Timestamp,
- tsip_htype_To,
- tsip_htype_Unsupported,
- tsip_htype_User_Agent,
- tsip_htype_Via,
- tsip_htype_Warning,
- tsip_htype_WWW_Authenticate,
- tsip_htype_P_Access_Network_Info,
- tsip_htype_P_Answer_State,
- tsip_htype_P_Asserted_Identity,
- tsip_htype_P_Associated_URI,
- tsip_htype_P_Called_Party_ID,
- tsip_htype_P_Charging_Function_Addresses,
- tsip_htype_P_Charging_Vector,
- tsip_htype_P_DCS_Billing_Info,
- tsip_htype_P_DCS_LAES,
- tsip_htype_P_DCS_OSPS,
- tsip_htype_P_DCS_Redirect,
- tsip_htype_P_DCS_Trace_Party_ID,
- tsip_htype_P_Early_Media,
- tsip_htype_P_Media_Authorization,
- tsip_htype_P_Preferred_Identity,
- tsip_htype_P_Profile_Key,
- tsip_htype_P_User_Database,
- tsip_htype_P_Visited_Network_ID
+typedef enum tsip_header_type_e {
+ tsip_htype_Accept,
+ tsip_htype_Accept_Contact,
+ tsip_htype_Accept_Encoding,
+ tsip_htype_Accept_Language,
+ tsip_htype_Accept_Resource_Priority,
+ tsip_htype_Alert_Info,
+ tsip_htype_Allow,
+ tsip_htype_Allow_Events,
+ tsip_htype_Authentication_Info,
+ tsip_htype_Authorization,
+ tsip_htype_Call_ID,
+ tsip_htype_Call_Info,
+ tsip_htype_Contact,
+ tsip_htype_Content_Disposition,
+ tsip_htype_Content_Encoding,
+ tsip_htype_Content_Language,
+ tsip_htype_Content_Length,
+ tsip_htype_Content_Type,
+ tsip_htype_CSeq,
+ tsip_htype_Date,
+ tsip_htype_Dummy,
+ tsip_htype_Error_Info,
+ tsip_htype_Event,
+ tsip_htype_Expires,
+ tsip_htype_From,
+ tsip_htype_History_Info,
+ tsip_htype_Identity,
+ tsip_htype_Identity_Info,
+ tsip_htype_In_Reply_To,
+ tsip_htype_Join,
+ tsip_htype_Max_Forwards,
+ tsip_htype_MIME_Version,
+ tsip_htype_Min_Expires,
+ tsip_htype_Min_SE,
+ tsip_htype_Organization,
+ tsip_htype_Path,
+ tsip_htype_Priority,
+ tsip_htype_Privacy,
+ tsip_htype_Proxy_Authenticate,
+ tsip_htype_Proxy_Authorization,
+ tsip_htype_Proxy_Require,
+ tsip_htype_RAck,
+ tsip_htype_Reason,
+ tsip_htype_Record_Route,
+ tsip_htype_Refer_Sub,
+ tsip_htype_Refer_To,
+ tsip_htype_Referred_By,
+ tsip_htype_Reject_Contact,
+ tsip_htype_Replaces,
+ tsip_htype_Reply_To,
+ tsip_htype_Request_Disposition,
+ tsip_htype_Require,
+ tsip_htype_Resource_Priority,
+ tsip_htype_Retry_After,
+ tsip_htype_Route,
+ tsip_htype_RSeq,
+ tsip_htype_Security_Client,
+ tsip_htype_Security_Server,
+ tsip_htype_Security_Verify,
+ tsip_htype_Server,
+ tsip_htype_Service_Route,
+ tsip_htype_Session_Expires,
+ tsip_htype_SIP_ETag,
+ tsip_htype_SIP_If_Match,
+ tsip_htype_Subject,
+ tsip_htype_Subscription_State,
+ tsip_htype_Supported,
+ tsip_htype_Target_Dialog,
+ tsip_htype_Timestamp,
+ tsip_htype_To,
+ tsip_htype_Unsupported,
+ tsip_htype_User_Agent,
+ tsip_htype_Via,
+ tsip_htype_Warning,
+ tsip_htype_WWW_Authenticate,
+ tsip_htype_P_Access_Network_Info,
+ tsip_htype_P_Answer_State,
+ tsip_htype_P_Asserted_Identity,
+ tsip_htype_P_Associated_URI,
+ tsip_htype_P_Called_Party_ID,
+ tsip_htype_P_Charging_Function_Addresses,
+ tsip_htype_P_Charging_Vector,
+ tsip_htype_P_DCS_Billing_Info,
+ tsip_htype_P_DCS_LAES,
+ tsip_htype_P_DCS_OSPS,
+ tsip_htype_P_DCS_Redirect,
+ tsip_htype_P_DCS_Trace_Party_ID,
+ tsip_htype_P_Early_Media,
+ tsip_htype_P_Media_Authorization,
+ tsip_htype_P_Preferred_Identity,
+ tsip_htype_P_Profile_Key,
+ tsip_htype_P_User_Database,
+ tsip_htype_P_Visited_Network_ID
}
tsip_header_type_t;
/*================================
*/
-typedef struct tsip_header_s
-{
- TSK_DECLARE_OBJECT;
- tsip_header_type_t type;
- tsip_header_value_serialize_f serialize;
- tsip_header_get_special_param_value_f get_special_param_value;
- tsk_params_L_t *params;
+typedef struct tsip_header_s {
+ TSK_DECLARE_OBJECT;
+ tsip_header_type_t type;
+ tsip_header_value_serialize_f serialize;
+ tsip_header_get_special_param_value_f get_special_param_value;
+ tsk_params_L_t *params;
}
tsip_header_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Accept_Contact.h b/tinySIP/include/tinysip/headers/tsip_header_Accept_Contact.h
index 19aaa1b..f053afe 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Accept_Contact.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Accept_Contact.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,11 +42,10 @@ TSIP_BEGIN_DECLS
/// @date 12/3/2009
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Accept_Contact_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Accept_Contact_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Accept_Contact_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Accept_Encoding.h b/tinySIP/include/tinysip/headers/tsip_header_Accept_Encoding.h
index efff6cd..937718a 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Accept_Encoding.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Accept_Encoding.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,11 +42,10 @@ TSIP_BEGIN_DECLS
/// @date 12/3/2009
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Accept_Encoding_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Accept_Encoding_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Accept_Encoding_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Accept_Language.h b/tinySIP/include/tinysip/headers/tsip_header_Accept_Language.h
index fcb631b..db8843f 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Accept_Language.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Accept_Language.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,11 +42,10 @@ TSIP_BEGIN_DECLS
/// @date 12/3/2009
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Accept_Language_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Accept_Language_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Accept_Language_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Accept_Resource_Priority.h b/tinySIP/include/tinysip/headers/tsip_header_Accept_Resource_Priority.h
index 09143a5..d1464b8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Accept_Resource_Priority.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Accept_Resource_Priority.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,11 +42,10 @@ TSIP_BEGIN_DECLS
/// @date 12/3/2009
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Accept_Resource_Priority_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Accept_Resource_Priority_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Accept_Resource_Priority_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Alert_Info.h b/tinySIP/include/tinysip/headers/tsip_header_Alert_Info.h
index 77a26be..dca2613 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Alert_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Alert_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Alert-Info' as per RFC 3261 subclause .
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Alert_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Alert_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Alert_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Allow.h b/tinySIP/include/tinysip/headers/tsip_header_Allow.h
index a43b9ba..f6a0832 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Allow.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Allow.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,13 +43,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Allow'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Allow_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Allow_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *methods;
+ tsk_strings_L_t *methods;
}
tsip_header_Allow_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Allow_Events.h b/tinySIP/include/tinysip/headers/tsip_header_Allow_Events.h
index d97b6b3..6f7c942 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Allow_Events.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Allow_Events.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,13 +41,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Allow-Events'.
///
/// @par ABNF : Allow-Events = ( "Allow-Events" / "u" ) HCOLON event-type *(COMMA event-type)
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Allow_Events_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Allow_Events_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *events;
+ tsk_strings_L_t *events;
}
tsip_header_Allow_Events_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Authentication_Info.h b/tinySIP/include/tinysip/headers/tsip_header_Authentication_Info.h
index 0736dbc..02a7e08 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Authentication_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Authentication_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,11 +41,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Authentication-Info'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Authentication_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Authentication_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Authentication_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Authorization.h b/tinySIP/include/tinysip/headers/tsip_header_Authorization.h
index 910fdc5..ad71883 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Authorization.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Authorization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,32 +55,31 @@ TSIP_BEGIN_DECLS
/// dresponse = "response" EQUAL request-digest
/// request-digest = LDQUOT 32LHEX RDQUOT
/// auth-request-uri = not-defined
-///
+///
/// auth-param = auth-param-name EQUAL ( token / quoted-string )
/// auth-param-name = token
-///
+///
/// other-response = auth-scheme LWS auth-param *(COMMA auth-param)
/// auth-scheme = token
/// auts = "auts" EQUAL auts-param
/// auts-param = LDQUOT auts-value RDQUOT
/// auts-value = [base64 encoding of AUTS]
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Authorization_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Authorization_s {
+ TSIP_DECLARE_HEADER;
- char* scheme;
- char* username;
- char* realm;
- char* nonce;
- char* uri;
- char* response;
- char* algorithm;
- char* cnonce;
- char* opaque;
- char* qop;
- char* nc;
+ char* scheme;
+ char* username;
+ char* realm;
+ char* nonce;
+ char* uri;
+ char* response;
+ char* algorithm;
+ char* cnonce;
+ char* opaque;
+ char* qop;
+ char* nc;
}
tsip_header_Authorization_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_CSeq.h b/tinySIP/include/tinysip/headers/tsip_header_CSeq.h
index 98cd864..a225823 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_CSeq.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_CSeq.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,15 +47,14 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'CSeq'.
///
/// @par ABNF: CSeq = "CSeq" HCOLON 1*DIGIT LWS Method
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_CSeq_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_CSeq_s {
+ TSIP_DECLARE_HEADER;
- char *method;
- uint32_t seq;
- tsip_request_type_t type;
+ char *method;
+ uint32_t seq;
+ tsip_request_type_t type;
}
tsip_header_CSeq_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h b/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h
index 41a7f73..a0830b3 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,14 +44,13 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Call-ID'.
///
/// @par ABNF: Call-ID / i
-/// callid = word [ "@" word ]
+/// callid = word [ "@" word ]
/// Call-ID = ( "Call-ID" / "i" ) HCOLON callid
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Call_ID_s
-{
- TSIP_DECLARE_HEADER;
- char *value;
+typedef struct tsip_header_Call_ID_s {
+ TSIP_DECLARE_HEADER;
+ char *value;
}
tsip_header_Call_ID_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Call_Info.h b/tinySIP/include/tinysip/headers/tsip_header_Call_Info.h
index 72f0d1a..d15a00d 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Call_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Call_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Call-Info'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Call_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Call_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Call_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Contact.h b/tinySIP/include/tinysip/headers/tsip_header_Contact.h
index 7fb200e..1d1900b 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Contact.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Contact.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,15 +65,14 @@ TSIP_BEGIN_DECLS
/// c-p-instance = "+sip.instance" EQUAL LDQUOT "<" instance-val ">" RDQUOT
/// instance-val = *uric
/// contact-extension = generic-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Contact_s
-{
- TSIP_DECLARE_HEADER;
-
- char *display_name;
- tsip_uri_t *uri;
- int64_t expires;
+typedef struct tsip_header_Contact_s {
+ TSIP_DECLARE_HEADER;
+
+ char *display_name;
+ tsip_uri_t *uri;
+ int64_t expires;
}
tsip_header_Contact_t;
typedef tsk_list_t tsip_header_Contacts_L_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Content_Disposition.h b/tinySIP/include/tinysip/headers/tsip_header_Content_Disposition.h
index 3ec3cef..6395c4b 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Content_Disposition.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Content_Disposition.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Content-Disposition'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Content_Disposition_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Content_Disposition_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Content_Disposition_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Content_Encoding.h b/tinySIP/include/tinysip/headers/tsip_header_Content_Encoding.h
index 995abbb..d76828d 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Content_Encoding.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Content_Encoding.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Content-Encoding'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Content_Encoding_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Content_Encoding_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Content_Encoding_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Content_Language.h b/tinySIP/include/tinysip/headers/tsip_header_Content_Language.h
index 86899b1..85c3c66 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Content_Language.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Content_Language.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,11 +38,10 @@
/// @brief SIP header 'Content-Language'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Content_Language_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Content_Language_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Content_Language_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Content_Length.h b/tinySIP/include/tinysip/headers/tsip_header_Content_Length.h
index 7f2ec61..9c4dca5 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Content_Length.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Content_Length.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,13 +43,12 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: Content-Length / l
/// Content-Length = ( "Content-Length" / "l" ) HCOLON 1*DIGIT
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Content_Length_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Content_Length_s {
+ TSIP_DECLARE_HEADER;
- uint32_t length;
+ uint32_t length;
}
tsip_header_Content_Length_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Content_Type.h b/tinySIP/include/tinysip/headers/tsip_header_Content_Type.h
index 48c32b6..2557e08 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Content_Type.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Content_Type.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,13 +55,12 @@ TSIP_BEGIN_DECLS
/// m-parameter = m-attribute EQUAL m-value
/// m-attribute = token
/// m-value = token / quoted-string
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Content_Type_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Content_Type_s {
+ TSIP_DECLARE_HEADER;
- char* type;
+ char* type;
}
tsip_header_Content_Type_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Date.h b/tinySIP/include/tinysip/headers/tsip_header_Date.h
index f16ee7a..a4a3063 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Date.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Date.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,21 +48,20 @@ TSIP_BEGIN_DECLS
/// time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
/// wkday = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
/// month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Date_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Date_s {
+ TSIP_DECLARE_HEADER;
- char *wkday;
- char *month;
- int8_t day;
- int16_t year;
- struct{
- int8_t h;
- int8_t m;
- int8_t s;
- } time;
+ char *wkday;
+ char *month;
+ int8_t day;
+ int16_t year;
+ struct {
+ int8_t h;
+ int8_t m;
+ int8_t s;
+ } time;
}
tsip_header_Date_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Dummy.h b/tinySIP/include/tinysip/headers/tsip_header_Dummy.h
index f1c5bb1..d54ba13 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Dummy.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Dummy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,14 +42,13 @@ TSIP_BEGIN_DECLS
/// @brief SIP Dummy header.
///
/// @par ABNF : token SP* HCOLON SP*<: any*
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Dummy_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Dummy_s {
+ TSIP_DECLARE_HEADER;
- char *name;
- char *value;
+ char *name;
+ char *value;
}
tsip_header_Dummy_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Error_Info.h b/tinySIP/include/tinysip/headers/tsip_header_Error_Info.h
index 53dc98f..55cd9ff 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Error_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Error_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Error-Info'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Error_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Error_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Error_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Event.h b/tinySIP/include/tinysip/headers/tsip_header_Event.h
index 35eb8ea..97e6158 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Event.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Event.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,13 +50,12 @@ TSIP_BEGIN_DECLS
/// event-param = generic-param / ( "id" EQUAL token ) / call-ident / from-tag / to-tag / with-sessd
/// call-ident = "call-id" EQUAL ( token / DQUOTE callid DQUOTE )
/// with-sessd = "include-session-description"
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Event_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Event_s {
+ TSIP_DECLARE_HEADER;
- char *package;
+ char *package;
}
tsip_header_Event_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Expires.h b/tinySIP/include/tinysip/headers/tsip_header_Expires.h
index 2242b9f..ee9491d 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Expires.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,13 +45,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Expires'.
///
/// @par ABNF: Expires = "Expires" HCOLON delta-seconds
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Expires_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Expires_s {
+ TSIP_DECLARE_HEADER;
- int64_t delta_seconds;
+ int64_t delta_seconds;
}
tsip_header_Expires_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_From.h b/tinySIP/include/tinysip/headers/tsip_header_From.h
index a799efd..8144fcb 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_From.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_From.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,15 +46,14 @@ TSIP_BEGIN_DECLS
/// from-spec = ( name-addr / addr-spec ) *( SEMI from-param )
/// from-param = tag-param / generic-param
/// tag-param = "tag" EQUAL token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_From_s
-{
- TSIP_DECLARE_HEADER;
-
- char *display_name;
- tsip_uri_t *uri;
- char *tag;
+typedef struct tsip_header_From_s {
+ TSIP_DECLARE_HEADER;
+
+ char *display_name;
+ tsip_uri_t *uri;
+ char *tag;
}
tsip_header_From_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_History_Info.h b/tinySIP/include/tinysip/headers/tsip_header_History_Info.h
index 6638f14..c900310 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_History_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_History_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,11 +42,10 @@ TSIP_BEGIN_DECLS
/// @date 12/3/2009
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_History_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_History_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_History_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Identity.h b/tinySIP/include/tinysip/headers/tsip_header_Identity.h
index 8382d39..6ecdf45 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Identity.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Identity.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Identity' .
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Identity_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Identity_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Identity_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Identity_Info.h b/tinySIP/include/tinysip/headers/tsip_header_Identity_Info.h
index 1aa790b..fb57ad4 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Identity_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Identity_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Identity-Info'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Identity_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Identity_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Identity_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_In_Reply_To.h b/tinySIP/include/tinysip/headers/tsip_header_In_Reply_To.h
index 90477c6..b405d30 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_In_Reply_To.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_In_Reply_To.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'In-Reply-To'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_In_Reply_To_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_In_Reply_To_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_In_Reply_To_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Join.h b/tinySIP/include/tinysip/headers/tsip_header_Join.h
index ef4c042..25361f1 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Join.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Join.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Join'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Join_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Join_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Join_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_MIME_Version.h b/tinySIP/include/tinysip/headers/tsip_header_MIME_Version.h
index 439f98c..a756165 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_MIME_Version.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_MIME_Version.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'MIME-Version'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_MIME_Version_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_MIME_Version_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_MIME_Version_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Max_Forwards.h b/tinySIP/include/tinysip/headers/tsip_header_Max_Forwards.h
index 17d9856..606e4b4 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Max_Forwards.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Max_Forwards.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,13 +46,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Max-Forwards'.
///
/// @par ABNF: Max-Forwards = "Max-Forwards" HCOLON 1*DIGIT
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Max_Forwards_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Max_Forwards_s {
+ TSIP_DECLARE_HEADER;
- int32_t value;
+ int32_t value;
}
tsip_header_Max_Forwards_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Min_Expires.h b/tinySIP/include/tinysip/headers/tsip_header_Min_Expires.h
index 042a190..4f60359 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Min_Expires.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Min_Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,13 +45,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Min-Expires' as per RFC 3261.
///
/// @par ABNF: Min-Expires = "Min-Expires" HCOLON delta-seconds
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Min_Expires_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Min_Expires_s {
+ TSIP_DECLARE_HEADER;
- int32_t value;
+ int32_t value;
}
tsip_header_Min_Expires_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Min_SE.h b/tinySIP/include/tinysip/headers/tsip_header_Min_SE.h
index de05338..ee5a48e 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Min_SE.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Min_SE.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,14 +44,13 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Min-SE'.
///
/// @par ABNF : Min-SE = "Min-SE" HCOLON delta-seconds *(SEMI generic-param)
-///
-///
+///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Min_SE_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Min_SE_s {
+ TSIP_DECLARE_HEADER;
- int64_t delta_seconds;
+ int64_t delta_seconds;
}
tsip_header_Min_SE_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Organization.h b/tinySIP/include/tinysip/headers/tsip_header_Organization.h
index 8351afb..96f58b8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Organization.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Organization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Organization'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Organization_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Organization_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Organization_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Access_Network_Info.h b/tinySIP/include/tinysip/headers/tsip_header_P_Access_Network_Info.h
index 9508424..09fa888 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Access_Network_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Access_Network_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,13 +48,12 @@ TSIP_BEGIN_DECLS
/// extension-access-info = gen-value
/// cgi-3gpp = "cgi-3gpp" EQUAL (token / quoted-string)
/// utran-cell-id-3gpp = "utran-cell-id-3gpp" EQUAL (token / quoted-string)
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Access_Network_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Access_Network_Info_s {
+ TSIP_DECLARE_HEADER;
- char *value;
+ char *value;
}
tsip_header_P_Access_Network_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Answer_State.h b/tinySIP/include/tinysip/headers/tsip_header_P_Answer_State.h
index e378ef7..78fdbc0 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Answer_State.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Answer_State.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Answer-State'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Answer_State_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Answer_State_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Answer_State_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Asserted_Identity.h b/tinySIP/include/tinysip/headers/tsip_header_P_Asserted_Identity.h
index 3e2118a..33f2daf 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Asserted_Identity.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Asserted_Identity.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSIP_BEGIN_DECLS
/// @par ABNF: P-Asserted-Identity = PAssertedID
/// PAssertedID = "P-Asserted-Identity" HCOLON PAssertedID-value *(COMMA PAssertedID-value)
/// PAssertedID-value = name-addr / addr-spec
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Asserted_Identity_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Asserted_Identity_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_P_Asserted_Identity_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Associated_URI.h b/tinySIP/include/tinysip/headers/tsip_header_P_Associated_URI.h
index 8c28f41..0e63ef8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Associated_URI.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Associated_URI.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,14 +46,13 @@ TSIP_BEGIN_DECLS
/// @par ABNF: P-Associated-URI = "P-Associated-URI" HCOLON p-aso-uri-spec *(COMMA p-aso-uri-spec)
/// p-aso-uri-spec = name-addr *( SEMI ai-param )
/// ai-param = generic-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Associated_URI_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Associated_URI_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_P_Associated_URI_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Called_Party_ID.h b/tinySIP/include/tinysip/headers/tsip_header_P_Called_Party_ID.h
index 324b61a..a4485f3 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Called_Party_ID.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Called_Party_ID.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Called-Party-ID'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Called_Party_ID_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Called_Party_ID_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Called_Party_ID_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Function_Addresses.h b/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Function_Addresses.h
index 82e5e71..e5319c8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Function_Addresses.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Function_Addresses.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,13 +44,12 @@ TSIP_BEGIN_DECLS
/// charge-addr-params = ccf / ecf / generic-param
/// ccf = "ccf" EQUAL gen-value
/// ecf = "ecf" EQUAL gen-value
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Charging_Function_Addresses_s
-{
- TSIP_DECLARE_HEADER;
- char* ccf;
- char* ecf;
+typedef struct tsip_header_P_Charging_Function_Addresses_s {
+ TSIP_DECLARE_HEADER;
+ char* ccf;
+ char* ecf;
}
tsip_header_P_Charging_Function_Addresses_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Vector.h b/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Vector.h
index 45ba24d..cdb69f4 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Vector.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Charging_Vector.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Charging-Vector'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Charging_Vector_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Charging_Vector_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Charging_Vector_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Billing_Info.h b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Billing_Info.h
index ca518b9..b195833 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Billing_Info.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Billing_Info.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-DCS-Billing-Info'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_DCS_Billing_Info_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_DCS_Billing_Info_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_DCS_Billing_Info_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_LAES.h b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_LAES.h
index ed2ce31..37bfd21 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_LAES.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_LAES.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-DCS-_LAES'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_DCS_LAES_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_DCS_LAES_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_DCS_LAES_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_OSPS.h b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_OSPS.h
index 1d98390..11f7e42 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_OSPS.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_OSPS.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-DCS-OSPS'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_DCS_OSPS_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_DCS_OSPS_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_DCS_OSPS_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Redirect.h b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Redirect.h
index 103e396..4873bfb 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Redirect.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Redirect.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-DCS-Redirect'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_DCS_Redirect_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_DCS_Redirect_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_DCS_Redirect_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Trace_Party_ID.h b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Trace_Party_ID.h
index 3a11086..226b527 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Trace_Party_ID.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_DCS_Trace_Party_ID.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-DCS-Trace-Party-ID'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_DCS_Trace_Party_ID_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_DCS_Trace_Party_ID_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_DCS_Trace_Party_ID_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Early_Media.h b/tinySIP/include/tinysip/headers/tsip_header_P_Early_Media.h
index 54890f0..71e05d9 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Early_Media.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Early_Media.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Early-Media'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Early_Media_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Early_Media_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Early_Media_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Media_Authorization.h b/tinySIP/include/tinysip/headers/tsip_header_P_Media_Authorization.h
index c161c34..5024a3a 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Media_Authorization.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Media_Authorization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Media-Authorization'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Media_Authorization_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Media_Authorization_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Media_Authorization_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Preferred_Identity.h b/tinySIP/include/tinysip/headers/tsip_header_P_Preferred_Identity.h
index 9272932..e89d60e 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Preferred_Identity.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Preferred_Identity.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: PPreferredID = "P-Preferred-Identity" HCOLON PPreferredID-value *(COMMA PPreferredID-value)
/// PPreferredID-value = name-addr / addr-spec
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Preferred_Identity_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Preferred_Identity_s {
+ TSIP_DECLARE_HEADER;
- tsip_uri_t *uri;
- char *display_name;
+ tsip_uri_t *uri;
+ char *display_name;
}
tsip_header_P_Preferred_Identity_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Profile_Key.h b/tinySIP/include/tinysip/headers/tsip_header_P_Profile_Key.h
index 0f33a2a..e024afe 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Profile_Key.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Profile_Key.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Profile-Key'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Profile_Key_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Profile_Key_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Profile_Key_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_User_Database.h b/tinySIP/include/tinysip/headers/tsip_header_P_User_Database.h
index 75915b5..c6154ad 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_User_Database.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_User_Database.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-User-Database'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_User_Database_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_User_Database_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_User_Database_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_P_Visited_Network_ID.h b/tinySIP/include/tinysip/headers/tsip_header_P_Visited_Network_ID.h
index 121783f..6144da0 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_P_Visited_Network_ID.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_P_Visited_Network_ID.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'P-Visited-Network-ID'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_P_Visited_Network_ID_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_P_Visited_Network_ID_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_P_Visited_Network_ID_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Path.h b/tinySIP/include/tinysip/headers/tsip_header_Path.h
index d0fa6ed..f943b2a 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Path.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Path.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,14 +46,13 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF : Path = "Path" HCOLON path-value *(COMMA path-value)
/// path-value = name-addr *( SEMI rr-param )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Path_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Path_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_Path_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Priority.h b/tinySIP/include/tinysip/headers/tsip_header_Priority.h
index eb1cbbf..bbcf2d9 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Priority.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Priority.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Priority'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Priority_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Priority_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Priority_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Privacy.h b/tinySIP/include/tinysip/headers/tsip_header_Privacy.h
index 421e18f..a054cbd 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Privacy.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Privacy.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,13 +43,12 @@ TSIP_BEGIN_DECLS
/// @par ABNF: Privacy = Privacy-hdr
/// Privacy-hdr = "Privacy" HCOLON priv-value *(";" priv-value)
/// priv-value = "header" / "session" / "user" / "none" / "critical" / "id" / "history" / token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Privacy_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Privacy_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *values;
+ tsk_strings_L_t *values;
}
tsip_header_Privacy_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authenticate.h b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authenticate.h
index 01c4681..be82015 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authenticate.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authenticate.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,20 +51,19 @@ TSIP_BEGIN_DECLS
/// stale = "stale" EQUAL ( "true" / "false" )
/// qop-options = "qop" EQUAL LDQUOT qop-value *("," qop-value) RDQUOT
/// qop-value = "auth" / "auth-int" / token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Proxy_Authenticate_s
-{
- TSIP_DECLARE_HEADER;
-
- char* scheme;
- char* realm;
- char* domain;
- char* nonce;
- char* opaque;
- tsk_bool_t stale;
- char* algorithm;
- char* qop;
+typedef struct tsip_header_Proxy_Authenticate_s {
+ TSIP_DECLARE_HEADER;
+
+ char* scheme;
+ char* realm;
+ char* domain;
+ char* nonce;
+ char* opaque;
+ tsk_bool_t stale;
+ char* algorithm;
+ char* qop;
}
tsip_header_Proxy_Authenticate_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authorization.h b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authorization.h
index 6eb7136..5ed9366 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authorization.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Authorization.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,32 +55,31 @@ TSIP_BEGIN_DECLS
/// dresponse = "response" EQUAL request-digest
/// request-digest = LDQUOT 32LHEX RDQUOT
/// auth-request-uri = not-defined
-///
+///
/// auth-param = auth-param-name EQUAL ( token / quoted-string )
/// auth-param-name = token
-///
+///
/// other-response = auth-scheme LWS auth-param *(COMMA auth-param)
/// auth-scheme = token
/// auts = "auts" EQUAL auts-param
/// auts-param = LDQUOT auts-value RDQUOT
/// auts-value = [base64 encoding of AUTS]
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Proxy_Authorization_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Proxy_Authorization_s {
+ TSIP_DECLARE_HEADER;
- char* scheme;
- char* username;
- char* realm;
- char* nonce;
- char* uri;
- char* response;
- char* algorithm;
- char* cnonce;
- char* opaque;
- char* qop;
- char* nc;
+ char* scheme;
+ char* username;
+ char* realm;
+ char* nonce;
+ char* uri;
+ char* response;
+ char* algorithm;
+ char* cnonce;
+ char* opaque;
+ char* qop;
+ char* nc;
}
tsip_header_Proxy_Authorization_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Require.h b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Require.h
index 63f74e4..96cafe8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Proxy_Require.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Proxy_Require.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,13 +43,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Proxy-Proxy_Require'.
///
/// @par ABNF: Proxy_Require = "Proxy_Require" HCOLON option-tag *(COMMA option-tag)
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Proxy_Require_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Proxy_Require_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *options;
+ tsk_strings_L_t *options;
}
tsip_header_Proxy_Require_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_RAck.h b/tinySIP/include/tinysip/headers/tsip_header_RAck.h
index 6a2bc13..55605e0 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_RAck.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_RAck.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,15 +42,14 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'RAck' as per RFC 3262.
///
/// @par ABNF : "RAck" HCOLON response-num LWS CSeq-num LWS Method
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_RAck_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_RAck_s {
+ TSIP_DECLARE_HEADER;
- uint32_t seq;
- uint32_t cseq;
- char* method;
+ uint32_t seq;
+ uint32_t cseq;
+ char* method;
}
tsip_header_RAck_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_RSeq.h b/tinySIP/include/tinysip/headers/tsip_header_RSeq.h
index 1b87ddd..6310dca 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_RSeq.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_RSeq.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,12 +45,11 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'RSeq' as per RFC 3262.
///
/// @par ABNF: "RSeq" HCOLON response-num
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_RSeq_s
-{
- TSIP_DECLARE_HEADER;
- uint32_t seq;
+typedef struct tsip_header_RSeq_s {
+ TSIP_DECLARE_HEADER;
+ uint32_t seq;
}
tsip_header_RSeq_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Reason.h b/tinySIP/include/tinysip/headers/tsip_header_Reason.h
index eb13b51..ba19369 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Reason.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Reason.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Reason'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Reason_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Reason_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Reason_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Record_Route.h b/tinySIP/include/tinysip/headers/tsip_header_Record_Route.h
index 7e8e187..1eeada6 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Record_Route.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Record_Route.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,14 +47,13 @@ TSIP_BEGIN_DECLS
/// @par ABNF : Record-Route = "Record-Route" HCOLON rec-route *(COMMA rec-route)
/// rec-route = name-addr *( SEMI rr-param )
/// rr-param = generic-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Record_Route_s
-{
- TSIP_DECLARE_HEADER;
-
- char* display_name;
- tsip_uri_t *uri;
+typedef struct tsip_header_Record_Route_s {
+ TSIP_DECLARE_HEADER;
+
+ char* display_name;
+ tsip_uri_t *uri;
}
tsip_header_Record_Route_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Refer_Sub.h b/tinySIP/include/tinysip/headers/tsip_header_Refer_Sub.h
index d436430..81db755 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Refer_Sub.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Refer_Sub.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,13 +44,12 @@ TSIP_BEGIN_DECLS
/// @par ABNF : Refer-Sub = "Refer-Sub" HCOLON refer-sub-value *(SEMI exten)
/// refer-sub-value = "true" / "false"
/// exten = generic-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Refer_Sub_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Refer_Sub_s {
+ TSIP_DECLARE_HEADER;
- tsk_bool_t sub;
+ tsk_bool_t sub;
}
tsip_header_Refer_Sub_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Refer_To.h b/tinySIP/include/tinysip/headers/tsip_header_Refer_To.h
index f68ecd9..240a38b 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Refer_To.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Refer_To.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: Refer-To = ( "Refer-To" / "r" ) HCOLON ( name-addr / addr-spec ) *(SEMI refer-param)
/// refer-param = generic-param / feature-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Refer_To_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Refer_To_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_Refer_To_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Referred_By.h b/tinySIP/include/tinysip/headers/tsip_header_Referred_By.h
index 5870512..55c6e18 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Referred_By.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Referred_By.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,16 +44,15 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Referred-By'.
///
/// @par ABNF: Referred-By = ( "Referred-By" / "b" ) HCOLON referrer-uri *( SEMI (referredby-id-param / generic-param) )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Referred_By_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Referred_By_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
- char* cid;
+ char* cid;
}
tsip_header_Referred_By_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Reject_Contact.h b/tinySIP/include/tinysip/headers/tsip_header_Reject_Contact.h
index 01bcf4f..4dbec22 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Reject_Contact.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Reject_Contact.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Reject-Contact'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Reject_Contact_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Reject_Contact_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Reject_Contact_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Replaces.h b/tinySIP/include/tinysip/headers/tsip_header_Replaces.h
index 5889dd0..5c9a1cd 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Replaces.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Replaces.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Replaces'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Replaces_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Replaces_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Replaces_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Reply_To.h b/tinySIP/include/tinysip/headers/tsip_header_Reply_To.h
index e5b97f1..3bb1601 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Reply_To.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Reply_To.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,11 +39,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Reply_To'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Reply_To_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Reply_To_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Reply_To_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Request_Disposition.h b/tinySIP/include/tinysip/headers/tsip_header_Request_Disposition.h
index 50d8615..ceb48e6 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Request_Disposition.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Request_Disposition.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Request-Disposition'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Request_Disposition_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Request_Disposition_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Request_Disposition_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Require.h b/tinySIP/include/tinysip/headers/tsip_header_Require.h
index 01de563..8c1768e 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Require.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Require.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,13 +43,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Require'.
///
/// @par ABNF: Require = "Require" HCOLON option-tag *(COMMA option-tag)
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Require_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Require_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *options;
+ tsk_strings_L_t *options;
}
tsip_header_Require_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Resource_Priority.h b/tinySIP/include/tinysip/headers/tsip_header_Resource_Priority.h
index 24e83df..305466a 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Resource_Priority.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Resource_Priority.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Resource-Priority'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Resource_Priority_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Resource_Priority_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Resource_Priority_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Retry_After.h b/tinySIP/include/tinysip/headers/tsip_header_Retry_After.h
index 4761b5c..92b2266 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Retry_After.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Retry_After.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Retry-After'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Retry_After_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Retry_After_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Retry_After_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Route.h b/tinySIP/include/tinysip/headers/tsip_header_Route.h
index 28e3c80..3e3e246 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Route.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Route.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,14 +46,13 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF : Route = "Route" HCOLON route-param *(COMMA route-param)
/// route-param = name-addr *( SEMI rr-param )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Route_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Route_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_Route_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_SIP_ETag.h b/tinySIP/include/tinysip/headers/tsip_header_SIP_ETag.h
index cf6ba6f..feee266 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_SIP_ETag.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_SIP_ETag.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,14 +42,13 @@ TSIP_BEGIN_DECLS
* @struct tsip_header_SIP_ETag_s
*
* SIP header 'SIP-ETag' as per RFC 3903.
- * @par ABNF
+ * @par ABNF
* SIP-ETag = "SIP-ETag" HCOLON entity-tag
- * entity-tag = token
+ * entity-tag = token
**/
-typedef struct tsip_header_SIP_ETag_s
-{
- TSIP_DECLARE_HEADER;
- char *value;
+typedef struct tsip_header_SIP_ETag_s {
+ TSIP_DECLARE_HEADER;
+ char *value;
}
tsip_header_SIP_ETag_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_SIP_If_Match.h b/tinySIP/include/tinysip/headers/tsip_header_SIP_If_Match.h
index f918df4..25aee82 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_SIP_If_Match.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_SIP_If_Match.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,14 +43,13 @@ TSIP_BEGIN_DECLS
* @struct tsip_header_SIP_If_Match_s
*
* SIP header 'SIP-If-Match' as per RFC 3903.
- * @par ABNF
+ * @par ABNF
* SIP-If-Match = "SIP-If-Match" HCOLON entity-tag
- * entity-tag = token
+ * entity-tag = token
**/
-typedef struct tsip_header_SIP_If_Match_s
-{
- TSIP_DECLARE_HEADER;
- char *value;
+typedef struct tsip_header_SIP_If_Match_s {
+ TSIP_DECLARE_HEADER;
+ char *value;
}
tsip_header_SIP_If_Match_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Security_Client.h b/tinySIP/include/tinysip/headers/tsip_header_Security_Client.h
index d453832..431901a 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Security_Client.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Security_Client.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -66,33 +66,32 @@ TSIP_BEGIN_DECLS
/// port1 = "port1" EQUAL port
/// port2 = "port2" EQUAL port
/// port = 1*DIGIT
-///
-///
+///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Security_Client_s
-{
- TSIP_DECLARE_HEADER;
-
- //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
- char* mech;
- //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
- char* alg;
- //! protocol (e.g. "ah" / "esp")
- char* prot;
- //! mode (e.g. "trans" / "tun")
- char* mod;
- //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
- char* ealg;
- //! client port
- tnet_port_t port_c;
- //! server port
- tnet_port_t port_s;
- //! client spi
- uint32_t spi_c;
- //! server spi
- uint32_t spi_s;
- //! preference
- double q;
+typedef struct tsip_header_Security_Client_s {
+ TSIP_DECLARE_HEADER;
+
+ //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
+ char* mech;
+ //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
+ char* alg;
+ //! protocol (e.g. "ah" / "esp")
+ char* prot;
+ //! mode (e.g. "trans" / "tun")
+ char* mod;
+ //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
+ char* ealg;
+ //! client port
+ tnet_port_t port_c;
+ //! server port
+ tnet_port_t port_s;
+ //! client spi
+ uint32_t spi_c;
+ //! server spi
+ uint32_t spi_s;
+ //! preference
+ double q;
}
tsip_header_Security_Client_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Security_Server.h b/tinySIP/include/tinysip/headers/tsip_header_Security_Server.h
index eb66c43..8cd87ec 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Security_Server.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Security_Server.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -66,33 +66,32 @@ TSIP_BEGIN_DECLS
/// port1 = "port1" EQUAL port
/// port2 = "port2" EQUAL port
/// port = 1*DIGIT
-///
-///
+///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Security_Server_s
-{
- TSIP_DECLARE_HEADER;
-
- //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
- char* mech;
- //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
- char* alg;
- //! protocol (e.g. "ah" / "esp")
- char* prot;
- //! mode (e.g. "trans" / "tun")
- char* mod;
- //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
- char* ealg;
- //! client port
- tnet_port_t port_c;
- //! server port
- tnet_port_t port_s;
- //! client spi
- uint32_t spi_c;
- //! server spi
- uint32_t spi_s;
- //! preference
- double q;
+typedef struct tsip_header_Security_Server_s {
+ TSIP_DECLARE_HEADER;
+
+ //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
+ char* mech;
+ //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
+ char* alg;
+ //! protocol (e.g. "ah" / "esp")
+ char* prot;
+ //! mode (e.g. "trans" / "tun")
+ char* mod;
+ //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
+ char* ealg;
+ //! client port
+ tnet_port_t port_c;
+ //! server port
+ tnet_port_t port_s;
+ //! client spi
+ uint32_t spi_c;
+ //! server spi
+ uint32_t spi_s;
+ //! preference
+ double q;
}
tsip_header_Security_Server_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Security_Verify.h b/tinySIP/include/tinysip/headers/tsip_header_Security_Verify.h
index a9e59aa..98cd971 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Security_Verify.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Security_Verify.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,33 +65,32 @@ TSIP_BEGIN_DECLS
/// port1 = "port1" EQUAL port
/// port2 = "port2" EQUAL port
/// port = 1*DIGIT
-///
-///
+///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Security_Verify_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Security_Verify_s {
+ TSIP_DECLARE_HEADER;
- //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
- char* mech;
- //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
- char* alg;
- //! protocol (e.g. "ah" / "esp")
- char* prot;
- //! mode (e.g. "trans" / "tun")
- char* mod;
- //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
- char* ealg;
- //! client port
- tnet_port_t port_c;
- //! server port
- tnet_port_t port_s;
- //! client spi
- uint32_t spi_c;
- //! server spi
- uint32_t spi_s;
- //! preference
- double q;
+ //! sec-mechanism (e.g. "digest" / "tls" / "ipsec-3gpp")
+ char* mech;
+ //! algorithm (e.g. "hmac-md5-96" / "hmac-sha-1-96")
+ char* alg;
+ //! protocol (e.g. "ah" / "esp")
+ char* prot;
+ //! mode (e.g. "trans" / "tun")
+ char* mod;
+ //! encrypt-algorithm (e.g. "des-ede3-cbc" / "null")
+ char* ealg;
+ //! client port
+ tnet_port_t port_c;
+ //! server port
+ tnet_port_t port_s;
+ //! client spi
+ uint32_t spi_c;
+ //! server spi
+ uint32_t spi_s;
+ //! preference
+ double q;
}
tsip_header_Security_Verify_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Server.h b/tinySIP/include/tinysip/headers/tsip_header_Server.h
index 1bdb3e5..5c3f3b9 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Server.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Server.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,12 +47,11 @@ TSIP_BEGIN_DECLS
/// server-val = product / comment
/// product = token [SLASH product-version]
/// product-version = token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Server_s
-{
- TSIP_DECLARE_HEADER;
- char* value;
+typedef struct tsip_header_Server_s {
+ TSIP_DECLARE_HEADER;
+ char* value;
}
tsip_header_Server_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h b/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h
index 307d644..328a9fd 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,13 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: Service-Route = "Service-Route" HCOLON sr-value *(COMMA sr-value)
/// sr-value = name-addr *( SEMI rr-param )
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Service_Route_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Service_Route_s {
+ TSIP_DECLARE_HEADER;
- char *display_name;
- tsip_uri_t *uri;
+ char *display_name;
+ tsip_uri_t *uri;
}
tsip_header_Service_Route_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Session_Expires.h b/tinySIP/include/tinysip/headers/tsip_header_Session_Expires.h
index 386d652..4b71d9b 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Session_Expires.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Session_Expires.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,15 +45,14 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: Session-Expires = ( "Session-Expires" / "x" ) HCOLON delta-seconds *( SEMI (se-params )
/// se-params = refresher-param / generic-param
-/// refresher-param = "refresher" EQUAL ("uas" / "uac")
-///
+/// refresher-param = "refresher" EQUAL ("uas" / "uac")
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Session_Expires_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Session_Expires_s {
+ TSIP_DECLARE_HEADER;
- int64_t delta_seconds;
- tsk_bool_t refresher_uas;
+ int64_t delta_seconds;
+ tsk_bool_t refresher_uas;
}
tsip_header_Session_Expires_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Subject.h b/tinySIP/include/tinysip/headers/tsip_header_Subject.h
index 69cbfec..ea195fa 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Subject.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Subject.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Subject'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Subject_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Subject_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Subject_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Subscription_State.h b/tinySIP/include/tinysip/headers/tsip_header_Subscription_State.h
index 5e4f90c..716a98c 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Subscription_State.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Subscription_State.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,16 +46,15 @@ TSIP_BEGIN_DECLS
/// subexp-params = ("reason" EQUAL event-reason-value) / ("expires" EQUAL delta-seconds) / ("retry-after" EQUAL delta-seconds) / generic-param
/// event-reason-value = "deactivated" / "probation" / "rejected" / "timeout" / "giveup" / "noresource" / event-reason-extension
/// event-reason-extension = token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Subscription_State_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Subscription_State_s {
+ TSIP_DECLARE_HEADER;
- char* state;
- char* reason;
- int32_t expires;
- int32_t retry_after;
+ char* state;
+ char* reason;
+ int32_t expires;
+ int32_t retry_after;
}
tsip_header_Subscription_State_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Supported.h b/tinySIP/include/tinysip/headers/tsip_header_Supported.h
index 6b0ecd4..c1d8c4f 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Supported.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Supported.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,13 +44,12 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: Supported / k
/// Supported = ( "Supported" / "k" ) HCOLON [option-tag *(COMMA option-tag)]
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Supported_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Supported_s {
+ TSIP_DECLARE_HEADER;
- tsk_strings_L_t *options;
+ tsk_strings_L_t *options;
}
tsip_header_Supported_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Target_Dialog.h b/tinySIP/include/tinysip/headers/tsip_header_Target_Dialog.h
index 185fdf9..d4c77b6 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Target_Dialog.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Target_Dialog.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Target-Dialog'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Target_Dialog_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Target_Dialog_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Target_Dialog_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Timestamp.h b/tinySIP/include/tinysip/headers/tsip_header_Timestamp.h
index 6492824..3b61b85 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Timestamp.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Timestamp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Timestamp'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Timestamp_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Timestamp_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Timestamp_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_To.h b/tinySIP/include/tinysip/headers/tsip_header_To.h
index 92970f1..09a68ce 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_To.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_To.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,15 +45,14 @@ TSIP_BEGIN_DECLS
///
/// @par ABNF: To = To = ( "To" / "t" ) HCOLON ( name-addr / addr-spec ) *( SEMI to-param )
/// to-param = tag-param / generic-param
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_To_s
-{
- TSIP_DECLARE_HEADER;
-
- char *display_name;
- tsip_uri_t *uri;
- char *tag;
+typedef struct tsip_header_To_s {
+ TSIP_DECLARE_HEADER;
+
+ char *display_name;
+ tsip_uri_t *uri;
+ char *tag;
}
tsip_header_To_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Unsupported.h b/tinySIP/include/tinysip/headers/tsip_header_Unsupported.h
index d58f8d4..57740e9 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Unsupported.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Unsupported.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,11 +40,10 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Unsupported'.
///
/// @par ABNF
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Unsupported_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Unsupported_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Unsupported_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_User_Agent.h b/tinySIP/include/tinysip/headers/tsip_header_User_Agent.h
index a69c454..e8eaece 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_User_Agent.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_User_Agent.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,12 +43,11 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'User-Agent'.
///
/// @par ABNF : User-Agent = "User-Agent" HCOLON server-val *(LWS server-val)
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_User_Agent_s
-{
- TSIP_DECLARE_HEADER;
- char *value;
+typedef struct tsip_header_User_Agent_s {
+ TSIP_DECLARE_HEADER;
+ char *value;
}
tsip_header_User_Agent_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Via.h b/tinySIP/include/tinysip/headers/tsip_header_Via.h
index dca22a7..5bd76d8 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Via.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Via.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -72,23 +72,22 @@ TSIP_BEGIN_DECLS
/// @author Mamadou
/// @date 12/5/2009
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Via_s
-{
- TSIP_DECLARE_HEADER;
-
- char *branch;
- char *host;
- uint16_t port;
- char *comp;
- char *sigcomp_id;
- char *received;
- char *maddr;
- char *proto_name;
- char *proto_version;
- char *transport;
-
- int32_t rport;
- int32_t ttl;
+typedef struct tsip_header_Via_s {
+ TSIP_DECLARE_HEADER;
+
+ char *branch;
+ char *host;
+ uint16_t port;
+ char *comp;
+ char *sigcomp_id;
+ char *received;
+ char *maddr;
+ char *proto_name;
+ char *proto_version;
+ char *transport;
+
+ int32_t rport;
+ int32_t ttl;
}
tsip_header_Via_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_WWW_Authenticate.h b/tinySIP/include/tinysip/headers/tsip_header_WWW_Authenticate.h
index 5de99d9..0381b2d 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_WWW_Authenticate.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_WWW_Authenticate.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,20 +52,19 @@ TSIP_BEGIN_DECLS
/// stale = "stale" EQUAL ( "true" / "false" )
/// qop-options = "qop" EQUAL LDQUOT qop-value *("," qop-value) RDQUOT
/// qop-value = "auth" / "auth-int" / token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_WWW_Authenticate_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_WWW_Authenticate_s {
+ TSIP_DECLARE_HEADER;
- char* scheme;
- char* realm;
- char* domain;
- char* nonce;
- char* opaque;
- tsk_bool_t stale;
- char* algorithm;
- char* qop;
+ char* scheme;
+ char* realm;
+ char* domain;
+ char* nonce;
+ char* opaque;
+ tsk_bool_t stale;
+ char* algorithm;
+ char* qop;
}
tsip_header_WWW_Authenticate_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_Warning.h b/tinySIP/include/tinysip/headers/tsip_header_Warning.h
index 6c16112..8c143ef 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_Warning.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_Warning.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,15 +46,14 @@ TSIP_BEGIN_DECLS
/// warn-agent = hostport / pseudonym
/// warn-text = quoted-string
/// pseudonym = token
-///
+///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Warning_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Warning_s {
+ TSIP_DECLARE_HEADER;
- int32_t code;
- char* agent;
- char* text;
+ int32_t code;
+ char* agent;
+ char* text;
}
tsip_header_Warning_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_header_accept.h b/tinySIP/include/tinysip/headers/tsip_header_accept.h
index 1742051..012b345 100755
--- a/tinySIP/include/tinysip/headers/tsip_header_accept.h
+++ b/tinySIP/include/tinysip/headers/tsip_header_accept.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,13 +41,12 @@ TSIP_BEGIN_DECLS
/// @brief SIP header 'Accept' as per RFC 3261 subclause 20.1.
///
/// @par ABNF = Accept = "Accept" HCOLON [ accept-range *(COMMA accept-range) ] ; example: ;
-/// Accept: application/dialog-info+xml
+/// Accept: application/dialog-info+xml
/// accept-range = media-range *(SEMI accept-param)
-/// media-range = ( "*'/*" / ( m-type SLASH "*" ) / ( m-type SLASH m-subtype ) ) *( SEMI m-parameter )
+/// media-range = ( "*'/*" / ( m-type SLASH "*" ) / ( m-type SLASH m-subtype ) ) *( SEMI m-parameter )
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_header_Accept_s
-{
- TSIP_DECLARE_HEADER;
+typedef struct tsip_header_Accept_s {
+ TSIP_DECLARE_HEADER;
}
tsip_header_Accept_t;
diff --git a/tinySIP/include/tinysip/headers/tsip_headers.h b/tinySIP/include/tinysip/headers/tsip_headers.h
index b520cc4..2b60546 100755
--- a/tinySIP/include/tinysip/headers/tsip_headers.h
+++ b/tinySIP/include/tinysip/headers/tsip_headers.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,7 +47,7 @@
#include "tinysip/headers/tsip_header_Min_Expires.h"
#include "tinysip/headers/tsip_header_Min_SE.h"
#include "tinysip/headers/tsip_header_Path.h"
-#include "tinysip/headers/tsip_header_P_Access_Network_Info.h"
+#include "tinysip/headers/tsip_header_P_Access_Network_Info.h"
#include "tinysip/headers/tsip_header_P_Asserted_Identity.h"
#include "tinysip/headers/tsip_header_P_Associated_URI.h"
#include "tinysip/headers/tsip_header_P_Charging_Function_Addresses.h"
diff --git a/tinySIP/include/tinysip/parsers/tsip_parser_header.h b/tinySIP/include/tinysip/parsers/tsip_parser_header.h
index da673a4..1fb082b 100755
--- a/tinySIP/include/tinysip/parsers/tsip_parser_header.h
+++ b/tinySIP/include/tinysip/parsers/tsip_parser_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/parsers/tsip_parser_message.h b/tinySIP/include/tinysip/parsers/tsip_parser_message.h
index bf1091d..eabaa91 100755
--- a/tinySIP/include/tinysip/parsers/tsip_parser_message.h
+++ b/tinySIP/include/tinysip/parsers/tsip_parser_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/parsers/tsip_parser_uri.h b/tinySIP/include/tinysip/parsers/tsip_parser_uri.h
index 84537f5..39b4b39 100755
--- a/tinySIP/include/tinysip/parsers/tsip_parser_uri.h
+++ b/tinySIP/include/tinysip/parsers/tsip_parser_uri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/sigcomp/tsip_sigcomp.h b/tinySIP/include/tinysip/sigcomp/tsip_sigcomp.h
index 6ccb461..d20b480 100755
--- a/tinySIP/include/tinysip/sigcomp/tsip_sigcomp.h
+++ b/tinySIP/include/tinysip/sigcomp/tsip_sigcomp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac.h b/tinySIP/include/tinysip/transactions/tsip_transac.h
index 3a896a0..772788d 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -67,15 +67,14 @@ TSIP_BEGIN_DECLS
#define TRANSAC_TIMER_CANCEL(TX) \
tsk_timer_mgr_global_cancel(self->timer##TX.id)
-typedef enum tsip_transac_event_type_e
-{
- tsip_transac_incoming_msg,
- tsip_transac_outgoing_msg,
- tsip_transac_canceled,
- tsip_transac_terminated,
- tsip_transac_timedout,
- tsip_transac_error,
- tsip_transac_transport_error
+typedef enum tsip_transac_event_type_e {
+ tsip_transac_incoming_msg,
+ tsip_transac_outgoing_msg,
+ tsip_transac_canceled,
+ tsip_transac_terminated,
+ tsip_transac_timedout,
+ tsip_transac_error,
+ tsip_transac_transport_error
}
tsip_transac_event_type_t;
@@ -93,66 +92,62 @@ tsip_transac_event_t;
typedef int (*tsip_transac_event_callback_f)(const void *arg, tsip_transac_event_type_t type, const tsip_message_t *msg);
#define TSIP_TRANSAC_EVENT_CALLBACK_F(callback) ((tsip_transac_event_callback_f)(callback))
-typedef enum tsip_transac_type_e
-{
- tsip_transac_type_ict, /**< Invite Client Transaction. */
- tsip_transac_type_ist, /**< Invite Server Transaction. */
- tsip_transac_type_nict, /**< Non-Invite Client Transaction. */
- tsip_transac_type_nist, /**< Non-Invite Server Transaction. */
+typedef enum tsip_transac_type_e {
+ tsip_transac_type_ict, /**< Invite Client Transaction. */
+ tsip_transac_type_ist, /**< Invite Server Transaction. */
+ tsip_transac_type_nict, /**< Non-Invite Client Transaction. */
+ tsip_transac_type_nist, /**< Non-Invite Server Transaction. */
}
tsip_transac_type_t;
-typedef enum tsip_transac_dst_type_e
-{
- tsip_transac_dst_type_dialog,
- tsip_transac_dst_type_net
+typedef enum tsip_transac_dst_type_e {
+ tsip_transac_dst_type_dialog,
+ tsip_transac_dst_type_net
}
tsip_transac_dst_type_t;
-typedef struct tsip_transac_dst_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_transac_dst_s {
+ TSK_DECLARE_OBJECT;
- tsip_transac_dst_type_t type;
- struct tsip_stack_s* stack;
+ tsip_transac_dst_type_t type;
+ struct tsip_stack_s* stack;
- union{
- struct{
- tsip_dialog_t *dlg;
- }dialog;
+ union {
+ struct {
+ tsip_dialog_t *dlg;
+ } dialog;
- //struct{
- //}net;
- };
+ //struct{
+ //}net;
+ };
}
tsip_transac_dst_t;
#define TSIP_TRANSAC_DST(self) ((tsip_transac_dst_t*)(self))
#define TSIP_DECLARE_TRANSAC_DST tsip_transac_dst_t __transac__
-typedef struct tsip_transac_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_transac_type_t type;
-
- struct tsip_transac_dst_s* dst;
- tsk_fsm_t *fsm;
-
- tsk_bool_t reliable;
- tsk_bool_t running;
- tsk_bool_t initialized;
-
- char *branch;
-
- int32_t cseq_value;
- char* cseq_method;
-
- char* callid;
-
- tsip_transac_event_callback_f callback;
+typedef struct tsip_transac_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_transac_type_t type;
+
+ struct tsip_transac_dst_s* dst;
+ tsk_fsm_t *fsm;
+
+ tsk_bool_t reliable;
+ tsk_bool_t running;
+ tsk_bool_t initialized;
+
+ char *branch;
+
+ int32_t cseq_value;
+ char* cseq_method;
+
+ char* callid;
+
+ tsip_transac_event_callback_f callback;
}
tsip_transac_t;
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac_ict.h b/tinySIP/include/tinysip/transactions/tsip_transac_ict.h
index a34a413..f8cfb1d 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac_ict.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac_ict.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,16 +39,15 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSAC_ICT(self) ((tsip_transac_ict_t*)(self))
-typedef struct tsip_transac_ict
-{
- TSIP_DECLARE_TRANSAC;
-
- tsip_request_t* request;
+typedef struct tsip_transac_ict {
+ TSIP_DECLARE_TRANSAC;
+
+ tsip_request_t* request;
- tsip_timer_t timerA;
- tsip_timer_t timerB;
- tsip_timer_t timerD;
- tsip_timer_t timerM;
+ tsip_timer_t timerA;
+ tsip_timer_t timerB;
+ tsip_timer_t timerD;
+ tsip_timer_t timerM;
}
tsip_transac_ict_t;
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac_ist.h b/tinySIP/include/tinysip/transactions/tsip_transac_ist.h
index 82abdbe..6acd08f 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac_ist.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac_ist.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSAC_IST(self) ((tsip_transac_ist_t*)(self))
-typedef struct tsip_transac_ist
-{
- TSIP_DECLARE_TRANSAC;
+typedef struct tsip_transac_ist {
+ TSIP_DECLARE_TRANSAC;
- tsip_response_t* lastResponse;
- tsk_bool_t acked;
+ tsip_response_t* lastResponse;
+ tsk_bool_t acked;
- tsip_timer_t timerH;
- tsip_timer_t timerI;
- tsip_timer_t timerG;
- tsip_timer_t timerL;
- tsip_timer_t timerX;
+ tsip_timer_t timerH;
+ tsip_timer_t timerI;
+ tsip_timer_t timerG;
+ tsip_timer_t timerL;
+ tsip_timer_t timerX;
}
tsip_transac_ist_t;
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac_layer.h b/tinySIP/include/tinysip/transactions/tsip_transac_layer.h
index acc532c..b24bb84 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac_layer.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac_layer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,15 +40,14 @@
TSIP_BEGIN_DECLS
-typedef struct tsip_transac_layer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_transac_layer_s {
+ TSK_DECLARE_OBJECT;
- const struct tsip_stack_s *stack;
+ const struct tsip_stack_s *stack;
- tsip_transacs_L_t *transactions;
+ tsip_transacs_L_t *transactions;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tsip_transac_layer_t;
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac_nict.h b/tinySIP/include/tinysip/transactions/tsip_transac_nict.h
index 4052bd0..2734393 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac_nict.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac_nict.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,14 +39,13 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSAC_NICT(self) ((tsip_transac_nict_t*)(self))
-typedef struct tsip_transac_nict
-{
- TSIP_DECLARE_TRANSAC;
+typedef struct tsip_transac_nict {
+ TSIP_DECLARE_TRANSAC;
- tsip_request_t* request;
- tsip_timer_t timerE;
- tsip_timer_t timerF;
- tsip_timer_t timerK;
+ tsip_request_t* request;
+ tsip_timer_t timerE;
+ tsip_timer_t timerF;
+ tsip_timer_t timerK;
}
tsip_transac_nict_t;
diff --git a/tinySIP/include/tinysip/transactions/tsip_transac_nist.h b/tinySIP/include/tinysip/transactions/tsip_transac_nist.h
index f2234a1..8b4479e 100755
--- a/tinySIP/include/tinysip/transactions/tsip_transac_nist.h
+++ b/tinySIP/include/tinysip/transactions/tsip_transac_nist.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,12 +39,11 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSAC_NIST(self) ((tsip_transac_nist_t*)(self))
-typedef struct tsip_transac_nist
-{
- TSIP_DECLARE_TRANSAC;
+typedef struct tsip_transac_nist {
+ TSIP_DECLARE_TRANSAC;
- tsip_response_t* lastResponse;
- tsip_timer_t timerJ;
+ tsip_response_t* lastResponse;
+ tsip_timer_t timerJ;
}
tsip_transac_nist_t;
diff --git a/tinySIP/include/tinysip/transports/tsip_transport.h b/tinySIP/include/tinysip/transports/tsip_transport.h
index 44ffd16..d354ece 100755
--- a/tinySIP/include/tinysip/transports/tsip_transport.h
+++ b/tinySIP/include/tinysip/transports/tsip_transport.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,83 +46,80 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSPORT(self) ((tsip_transport_t*)(self))
enum {
- TSIP_TRANSPORT_IDX_UDP,
- TSIP_TRANSPORT_IDX_DTLS,
- TSIP_TRANSPORT_IDX_TCP,
- TSIP_TRANSPORT_IDX_TLS,
- TSIP_TRANSPORT_IDX_WS,
- TSIP_TRANSPORT_IDX_WSS,
-
- TSIP_TRANSPORT_IDX_MAX
+ TSIP_TRANSPORT_IDX_UDP,
+ TSIP_TRANSPORT_IDX_DTLS,
+ TSIP_TRANSPORT_IDX_TCP,
+ TSIP_TRANSPORT_IDX_TLS,
+ TSIP_TRANSPORT_IDX_WS,
+ TSIP_TRANSPORT_IDX_WSS,
+
+ TSIP_TRANSPORT_IDX_MAX
};
-typedef struct tsip_transport_idx_xs
-{
- int idx;
- const char* name;
- enum tnet_socket_type_e type;
-}
+typedef struct tsip_transport_idx_xs {
+ int idx;
+ const char* name;
+ enum tnet_socket_type_e type;
+}
tsip_transport_idx_xt;
const tsip_transport_idx_xt* tsip_transport_get_by_name(const char* name);
int tsip_transport_get_idx_by_name(const char* name);
enum tnet_socket_type_e tsip_transport_get_type_by_name(const char* name);
-typedef struct tsip_transport_stream_peer_s
-{
- TSK_DECLARE_OBJECT;
-
- tnet_fd_t local_fd; // not owner: do not close
- enum tnet_socket_type_e type;
- tsk_bool_t connected;
- uint64_t time_latest_activity; // in milliseconds
- uint64_t time_added; // in milliseconds
- tsk_bool_t got_valid_sip_msg; // whether we got at least one valid SIP message on this peer
-
- tsk_buffer_t *rcv_buff_stream;
- tsk_buffer_t *snd_buff_stream;
-
- // list of dialogs managed by this peer
- tsk_strings_L_t *dialogs_cids;
-
- // temp buffers used to send/recv websocket data before (un)masking
- struct{
- void* rcv_buffer;
- uint64_t rcv_buffer_size;
- void* snd_buffer;
- uint64_t snd_buffer_size;
- tsk_bool_t handshaking_done;
- } ws;
-
- tnet_ip_t remote_ip;
- tnet_port_t remote_port;
+typedef struct tsip_transport_stream_peer_s {
+ TSK_DECLARE_OBJECT;
+
+ tnet_fd_t local_fd; // not owner: do not close
+ enum tnet_socket_type_e type;
+ tsk_bool_t connected;
+ uint64_t time_latest_activity; // in milliseconds
+ uint64_t time_added; // in milliseconds
+ tsk_bool_t got_valid_sip_msg; // whether we got at least one valid SIP message on this peer
+
+ tsk_buffer_t *rcv_buff_stream;
+ tsk_buffer_t *snd_buff_stream;
+
+ // list of dialogs managed by this peer
+ tsk_strings_L_t *dialogs_cids;
+
+ // temp buffers used to send/recv websocket data before (un)masking
+ struct {
+ void* rcv_buffer;
+ uint64_t rcv_buffer_size;
+ void* snd_buffer;
+ uint64_t snd_buffer_size;
+ tsk_bool_t handshaking_done;
+ } ws;
+
+ tnet_ip_t remote_ip;
+ tnet_port_t remote_port;
}
tsip_transport_stream_peer_t;
TINYSIP_GEXTERN const tsk_object_def_t *tsip_transport_stream_peer_def_t;
typedef tsk_list_t tsip_transport_stream_peers_L_t;
-typedef struct tsip_transport_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_transport_s {
+ TSK_DECLARE_OBJECT;
- tsk_bool_t initialized;
+ tsk_bool_t initialized;
- int32_t idx;
+ int32_t idx;
- const struct tsip_stack_s *stack;
+ const struct tsip_stack_s *stack;
- tnet_socket_type_t type;
- struct sockaddr_storage pcscf_addr;
- tnet_fd_t connectedFD;
- tnet_transport_handle_t *net_transport;
+ tnet_socket_type_t type;
+ struct sockaddr_storage pcscf_addr;
+ tnet_fd_t connectedFD;
+ tnet_transport_handle_t *net_transport;
- const char *scheme;
- const char *protocol;
- const char *via_protocol;
- const char *service; /**< NAPTR service name */
+ const char *scheme;
+ const char *protocol;
+ const char *via_protocol;
+ const char *service; /**< NAPTR service name */
- tsip_transport_stream_peers_L_t* stream_peers;
- int32_t stream_peers_count;
+ tsip_transport_stream_peers_L_t* stream_peers;
+ int32_t stream_peers_count;
}
tsip_transport_t;
diff --git a/tinySIP/include/tinysip/transports/tsip_transport_ipsec.h b/tinySIP/include/tinysip/transports/tsip_transport_ipsec.h
index d67c3ad..38382d5 100755
--- a/tinySIP/include/tinysip/transports/tsip_transport_ipsec.h
+++ b/tinySIP/include/tinysip/transports/tsip_transport_ipsec.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,31 +42,29 @@ TSIP_BEGIN_DECLS
#define TSIP_TRANSPORT_IPSEC(self) ((tsip_transport_ipsec_t*)(self))
-typedef struct tsip_ipsec_association_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_ipsec_association_s {
+ TSK_DECLARE_OBJECT;
- const tsip_transport_t* transport;
+ const tsip_transport_t* transport;
- tipsec_ctx_t* ctx;
-
- tnet_socket_t *socket_uc;
- tnet_socket_t *socket_us;
+ tipsec_ctx_t* ctx;
- tnet_ip_t ip_remote;
- tnet_ip_t ip_local;
- tnet_port_t port_local;
+ tnet_socket_t *socket_uc;
+ tnet_socket_t *socket_us;
+
+ tnet_ip_t ip_remote;
+ tnet_ip_t ip_local;
+ tnet_port_t port_local;
}
tsip_ipsec_association_t;
-typedef struct tsip_transport_ipsec_s
-{
- TSIP_DECLARE_TRANSPORT;
-
- tsip_header_Security_Verifies_L_t* secVerifies;
+typedef struct tsip_transport_ipsec_s {
+ TSIP_DECLARE_TRANSPORT;
+
+ tsip_header_Security_Verifies_L_t* secVerifies;
- tsip_ipsec_association_t* asso_active;
- tsip_ipsec_association_t* asso_temporary;
+ tsip_ipsec_association_t* asso_active;
+ tsip_ipsec_association_t* asso_temporary;
}
tsip_transport_ipsec_t;
diff --git a/tinySIP/include/tinysip/transports/tsip_transport_layer.h b/tinySIP/include/tinysip/transports/tsip_transport_layer.h
index 35c4380..2b07c28 100755
--- a/tinySIP/include/tinysip/transports/tsip_transport_layer.h
+++ b/tinySIP/include/tinysip/transports/tsip_transport_layer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,14 +38,13 @@
TSIP_BEGIN_DECLS
-typedef struct tsip_transport_layer_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_transport_layer_s {
+ TSK_DECLARE_OBJECT;
- const tsip_stack_t *stack;
+ const tsip_stack_t *stack;
- tsk_bool_t running;
- tsip_transports_L_t *transports;
+ tsk_bool_t running;
+ tsip_transports_L_t *transports;
}
tsip_transport_layer_t;
diff --git a/tinySIP/include/tinysip/transports/tsip_transport_tls.h b/tinySIP/include/tinysip/transports/tsip_transport_tls.h
index 106a562..89b057b 100755
--- a/tinySIP/include/tinysip/transports/tsip_transport_tls.h
+++ b/tinySIP/include/tinysip/transports/tsip_transport_tls.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/include/tinysip/tsip_action.h b/tinySIP/include/tinysip/tsip_action.h
index 868421a..15f30a1 100755
--- a/tinySIP/include/tinysip/tsip_action.h
+++ b/tinySIP/include/tinysip/tsip_action.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,80 +41,78 @@
TSIP_BEGIN_DECLS
-typedef uint64_t tsip_action_id_t;
+typedef uint64_t tsip_action_id_t;
#define TSIP_ACTION_INVALID_ID 0
#define TSIP_ACTION_INVALID_HANDLE tsk_null
/** List of all supported actions */
-typedef enum tsip_action_type_e
-{
- //! Used as configuration action
- tsip_atype_config,
- tsip_atype_dtmf_send,
-
- /* === REGISTER == */
- tsip_atype_register, /**< Sends SIP REGISTER request */
- //! Unregister by sending SIP REGISTER request with expires value equals to zero
+typedef enum tsip_action_type_e {
+ //! Used as configuration action
+ tsip_atype_config,
+ tsip_atype_dtmf_send,
+
+ /* === REGISTER == */
+ tsip_atype_register, /**< Sends SIP REGISTER request */
+ //! Unregister by sending SIP REGISTER request with expires value equals to zero
#define tsip_atype_unregister tsip_atype_hangup
-
- /* === SUBSCRIBE === */
- tsip_atype_subscribe, /**< Sends SIP SUBSCRIBE request */
- //! Unsubsribe by sending SIP SUBSCRIBE request with expires value equals to zero
+
+ /* === SUBSCRIBE === */
+ tsip_atype_subscribe, /**< Sends SIP SUBSCRIBE request */
+ //! Unsubsribe by sending SIP SUBSCRIBE request with expires value equals to zero
#define tsip_atype_unsubscribe tsip_atype_hangup
- /* === MESSAGE === */
- tsip_atype_message_send, /**< Sends SIP MESSAGE request */
+ /* === MESSAGE === */
+ tsip_atype_message_send, /**< Sends SIP MESSAGE request */
- /* === INFO === */
- tsip_atype_info_send, /**< Sends SIP INFO request */
+ /* === INFO === */
+ tsip_atype_info_send, /**< Sends SIP INFO request */
- /* === PUBLISH === */
- tsip_atype_publish, /**< Sends SIP PUBLISH request */
- //! Unpublish by sending SIP PUBLISH request with expires value equals to zero
+ /* === PUBLISH === */
+ tsip_atype_publish, /**< Sends SIP PUBLISH request */
+ //! Unpublish by sending SIP PUBLISH request with expires value equals to zero
#define tsip_atype_unpublish tsip_atype_hangup
-
- /* === OPTIONS === */
- tsip_atype_options_send, /**< Sends SIP OPTIONS request */
-
- /* === INVITE === */
- tsip_atype_invite, /**< Sends SIP INVITE/reINVITE request */
- tsip_atype_hold, /**< Puts the session on hold state */
- tsip_atype_resume, /**< Resumes a previously held session */
- tsip_atype_ect, /**< Transfer the call */
- tsip_atype_ect_accept, /**< Accept call transfer request */
- tsip_atype_ect_reject, /**< Reject call transfer request */
- tsip_atype_ect_lnotify, /**< Intra-Dialog notify. Never called by the end-user */
- tsip_atype_lmessage, /**< Large message (MSRP). The session must be connected */
+
+ /* === OPTIONS === */
+ tsip_atype_options_send, /**< Sends SIP OPTIONS request */
+
+ /* === INVITE === */
+ tsip_atype_invite, /**< Sends SIP INVITE/reINVITE request */
+ tsip_atype_hold, /**< Puts the session on hold state */
+ tsip_atype_resume, /**< Resumes a previously held session */
+ tsip_atype_ect, /**< Transfer the call */
+ tsip_atype_ect_accept, /**< Accept call transfer request */
+ tsip_atype_ect_reject, /**< Reject call transfer request */
+ tsip_atype_ect_lnotify, /**< Intra-Dialog notify. Never called by the end-user */
+ tsip_atype_lmessage, /**< Large message (MSRP). The session must be connected */
#define tsip_atype_bye tsip_atype_hangup
- /* === common === */
- //! Accept incoming call (INVITE) or message (SIP MESSAGE)
- tsip_atype_accept,
- //! Reject incoming call (INVITE) or message (SIP MESSAGE)
+ /* === common === */
+ //! Accept incoming call (INVITE) or message (SIP MESSAGE)
+ tsip_atype_accept,
+ //! Reject incoming call (INVITE) or message (SIP MESSAGE)
#define tsip_atype_reject tsip_atype_hangup
- //! Cancel an outgoing request
- tsip_atype_cancel,
- //! Hangup any SIP dialog (BYE, unREGISTER, unSUBSCRIBE ...). If the dialog is in early state, then it will be canceled.
- tsip_atype_hangup,
- //! Shutdown a SIP dialog. Should only be called by the stack.
- tsip_atype_shutdown,
- //! Signal transport error. Should only be called by the stack.
- tsip_atype_transport_error,
+ //! Cancel an outgoing request
+ tsip_atype_cancel,
+ //! Hangup any SIP dialog (BYE, unREGISTER, unSUBSCRIBE ...). If the dialog is in early state, then it will be canceled.
+ tsip_atype_hangup,
+ //! Shutdown a SIP dialog. Should only be called by the stack.
+ tsip_atype_shutdown,
+ //! Signal transport error. Should only be called by the stack.
+ tsip_atype_transport_error,
}
tsip_action_type_t;
/* internal enum used to pass parameters from the application layer to the stack */
-typedef enum tsip_action_param_type_e
-{
- aptype_null = 0,
-
- aptype_header,
- aptype_config,
- aptype_payload,
- aptype_resp_line,
- aptype_media_type,
- aptype_media,
+typedef enum tsip_action_param_type_e {
+ aptype_null = 0,
+
+ aptype_header,
+ aptype_config,
+ aptype_payload,
+ aptype_resp_line,
+ aptype_media_type,
+ aptype_media,
}
tsip_action_param_type_t;
@@ -127,32 +125,31 @@ tsip_action_param_type_t;
#define TSIP_ACTION_SET_NULL() aptype_null
/* private action object. public api should use tsip_action_handle_t. */
-typedef struct tsip_action_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_action_type_t type;
- tsk_params_L_t *headers;
- tsk_buffer_t* payload;
-
- struct{
- short code;
- char* phrase;
- } line_resp;
-
- struct{
- tmedia_type_t type;
- tmedia_params_L_t *params;
- } media;
-
- struct{
- int volume; // useless (manager will always use "10")
- int event;
- } dtmf;
-
- struct{
- char* to;
- } ect;
+typedef struct tsip_action_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_action_type_t type;
+ tsk_params_L_t *headers;
+ tsk_buffer_t* payload;
+
+ struct {
+ short code;
+ char* phrase;
+ } line_resp;
+
+ struct {
+ tmedia_type_t type;
+ tmedia_params_L_t *params;
+ } media;
+
+ struct {
+ int volume; // useless (manager will always use "10")
+ int event;
+ } dtmf;
+
+ struct {
+ char* to;
+ } ect;
}
tsip_action_t;
diff --git a/tinySIP/include/tinysip/tsip_event.h b/tinySIP/include/tinysip/tsip_event.h
index 91e8f4e..1cb347e 100755
--- a/tinySIP/include/tinysip/tsip_event.h
+++ b/tinySIP/include/tinysip/tsip_event.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,18 +38,17 @@ TSIP_BEGIN_DECLS
#define TSIP_EVENT(self) ((tsip_event_t*)(self))
-typedef enum tsip_event_type_e
-{
- tsip_event_invite,
- tsip_event_message,
- tsip_event_info,
- tsip_event_options,
- tsip_event_publish,
- tsip_event_register,
- tsip_event_subscribe,
-
- tsip_event_dialog,
- tsip_event_stack,
+typedef enum tsip_event_type_e {
+ tsip_event_invite,
+ tsip_event_message,
+ tsip_event_info,
+ tsip_event_options,
+ tsip_event_publish,
+ tsip_event_register,
+ tsip_event_subscribe,
+
+ tsip_event_dialog,
+ tsip_event_stack,
}
tsip_event_type_t;
@@ -81,20 +80,19 @@ tsip_event_type_t;
#define tsip_event_code_stack_disconnected 956
-typedef struct tsip_event_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_event_s {
+ TSK_DECLARE_OBJECT;
- tsip_ssession_handle_t* ss;
+ tsip_ssession_handle_t* ss;
- short code;
- char *phrase;
+ short code;
+ char *phrase;
- tsip_event_type_t type;
- struct tsip_message_s *sipmessage;
+ tsip_event_type_t type;
+ struct tsip_message_s *sipmessage;
- //! copy of stack user data (needed by sessionless events)
- const void* userdata;
+ //! copy of stack user data (needed by sessionless events)
+ const void* userdata;
}
tsip_event_t;
#define TSIP_DECLARE_EVENT tsip_event_t __sipevent__
diff --git a/tinySIP/include/tinysip/tsip_message.h b/tinySIP/include/tinysip/tsip_message.h
index d0442ea..16ad164 100755
--- a/tinySIP/include/tinysip/tsip_message.h
+++ b/tinySIP/include/tinysip/tsip_message.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -57,8 +57,8 @@ TSIP_BEGIN_DECLS
///**
// * @struct tsip_request_line_t
// *
-// * @brief Defines SIP request header line.
-// * ABNF: Request-Line = Method SP Request-URI SP SIP-Version CRLF
+// * @brief Defines SIP request header line.
+// * ABNF: Request-Line = Method SP Request-URI SP SIP-Version CRLF
// * Ref: RFC 3261 subclause 7.1.
// * @sa tsip_status_line_t.
// *
@@ -77,9 +77,9 @@ TSIP_BEGIN_DECLS
///**
// * @struct tsip_status_line_t
// *
-// * @brief Defines SIP response status line.
-// * ABNF: Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
-// * Ref: RFC 3261 subclause 7.2.
+// * @brief Defines SIP response status line.
+// * ABNF: Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
+// * Ref: RFC 3261 subclause 7.2.
// * @sa tsip_request_line_t.
// *
// * @author Mamadou
@@ -96,60 +96,59 @@ TSIP_BEGIN_DECLS
* @struct tsip_message_t
*
* @brief Represents a SIP message. A SIP message is either a request from a client to a server,
- * or a response from a server to a client. See RFC 3261 suc-bclause 7.
+ * or a response from a server to a client. See RFC 3261 suc-bclause 7.
* You must call @ref tsip_message_create to create a sip message and TSK_OBJECT_SAFE_FREE to free the message.
*
* @author Mamadou
* @date 12/2/2009
**/
-typedef struct tsip_message_s
-{
- TSK_DECLARE_OBJECT;
-
- char *sip_version; /**< The SIP version. Only 'SIP/2.0' is supported. */
- tsip_message_type_t type; /**< The type of this SIP message. */
-
- /* Request Line */
- union{
- struct{
- char *method; /**< SIP method name. e.g REGISTER, ACK or INVITE.*/
- tsip_uri_t *uri; /**< The Request-URI is a SIP or SIPS URI as described in Section 19.1 or a general URI (RFC 2396 [5]). It indicates
+typedef struct tsip_message_s {
+ TSK_DECLARE_OBJECT;
+
+ char *sip_version; /**< The SIP version. Only 'SIP/2.0' is supported. */
+ tsip_message_type_t type; /**< The type of this SIP message. */
+
+ /* Request Line */
+ union {
+ struct {
+ char *method; /**< SIP method name. e.g REGISTER, ACK or INVITE.*/
+ tsip_uri_t *uri; /**< The Request-URI is a SIP or SIPS URI as described in Section 19.1 or a general URI (RFC 2396 [5]). It indicates
the user or service to which this request is being addressed. The Request-URI MUST NOT contain unescaped spaces or control
characters and MUST NOT be enclosed in "<>". */
- tsip_request_type_t request_type;
- } request;
- struct{
- short status_code; /**< 3-digit integer result code that indicates the outcome of an attempt to understand and satisfy a request. */
- char *reason_phrase; /**< Textual description related to the status code. */
- } response;
- } line;
-
-
- /*== MOST COMMON HEADERS. */
- tsip_header_Via_t *firstVia; /**< First Via header. */
- tsip_header_From_t *From;
- tsip_header_To_t *To;
- tsip_header_Contact_t *Contact;
- tsip_header_Call_ID_t *Call_ID;
- tsip_header_CSeq_t *CSeq;
- tsip_header_Expires_t *Expires;
-
- tsip_header_Content_Type_t *Content_Type;
- tsip_header_Content_Length_t *Content_Length;
- tsk_buffer_t *Content;
-
- /*== OTHER HEADERS*/
- tsip_headers_L_t *headers;
-
- /*== to hack the message */
- char* sigcomp_id;
- tnet_fd_t local_fd;
- struct sockaddr_storage remote_addr; // Only valid for Dgram
- tsk_bool_t update;
- enum tnet_socket_type_e src_net_type;
- enum tnet_socket_type_e dst_net_type;
- char* dst_address;
- tnet_port_t dst_port;
+ tsip_request_type_t request_type;
+ } request;
+ struct {
+ short status_code; /**< 3-digit integer result code that indicates the outcome of an attempt to understand and satisfy a request. */
+ char *reason_phrase; /**< Textual description related to the status code. */
+ } response;
+ } line;
+
+
+ /*== MOST COMMON HEADERS. */
+ tsip_header_Via_t *firstVia; /**< First Via header. */
+ tsip_header_From_t *From;
+ tsip_header_To_t *To;
+ tsip_header_Contact_t *Contact;
+ tsip_header_Call_ID_t *Call_ID;
+ tsip_header_CSeq_t *CSeq;
+ tsip_header_Expires_t *Expires;
+
+ tsip_header_Content_Type_t *Content_Type;
+ tsip_header_Content_Length_t *Content_Length;
+ tsk_buffer_t *Content;
+
+ /*== OTHER HEADERS*/
+ tsip_headers_L_t *headers;
+
+ /*== to hack the message */
+ char* sigcomp_id;
+ tnet_fd_t local_fd;
+ struct sockaddr_storage remote_addr; // Only valid for Dgram
+ tsk_bool_t update;
+ enum tnet_socket_type_e src_net_type;
+ enum tnet_socket_type_e dst_net_type;
+ char* dst_address;
+ tnet_port_t dst_port;
}
tsip_message_t;
@@ -163,19 +162,19 @@ TINYSIP_API int tsip_message_add_content(tsip_message_t *self, const char* conte
#if defined(__SYMBIAN32__) && 0
static void TSIP_MESSAGE_ADD_HEADER(tsip_message_t *self, ...)
- {
- va_list ap;
- tsip_header_t *header;
- const tsk_object_def_t *objdef;
-
- va_start(ap, self);
- objdef = va_arg(ap, const tsk_object_def_t*);
- header = (tsip_header_t *)tsk_object_new_2(objdef, &ap);
- va_end(ap);
-
- tsip_message_add_header(self, header);
- tsk_object_unref(header);
- }
+{
+ va_list ap;
+ tsip_header_t *header;
+ const tsk_object_def_t *objdef;
+
+ va_start(ap, self);
+ objdef = va_arg(ap, const tsk_object_def_t*);
+ header = (tsip_header_t *)tsk_object_new_2(objdef, &ap);
+ va_end(ap);
+
+ tsip_message_add_header(self, header);
+ tsk_object_unref(header);
+}
#else
#define TSIP_MESSAGE_ADD_HEADER(self, objdef, ...) \
{ \
diff --git a/tinySIP/include/tinysip/tsip_message_common.h b/tinySIP/include/tinysip/tsip_message_common.h
index c04131c..b5a64bd 100755
--- a/tinySIP/include/tinysip/tsip_message_common.h
+++ b/tinySIP/include/tinysip/tsip_message_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -103,35 +103,33 @@ TSIP_BEGIN_DECLS
#define TSIP_RESPONSE_IS_23456(self) (TSIP_MESSAGE_IS_RESPONSE((self)) && 200<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= 699)
#define TSIP_RESPONSE_IS_3456(self) (TSIP_MESSAGE_IS_RESPONSE((self)) && 300<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= 699)
-/** Defines the message type (Request or Response).
+/** Defines the message type (Request or Response).
**/
-typedef enum tsip_message_type_e
-{
- tsip_unknown,
- tsip_request,
- tsip_response
+typedef enum tsip_message_type_e {
+ tsip_unknown,
+ tsip_request,
+ tsip_response
}
tsip_message_type_t;
// SWIG
-typedef enum tsip_request_type_e
-{
- tsip_NONE = 0,
-
- tsip_ACK,
- tsip_BYE,
- tsip_CANCEL,
- tsip_INVITE,
- tsip_OPTIONS,
- tsip_REGISTER,
- tsip_SUBSCRIBE,
- tsip_NOTIFY,
- tsip_REFER,
- tsip_INFO,
- tsip_UPDATE,
- tsip_MESSAGE,
- tsip_PUBLISH,
- tsip_PRACK
+typedef enum tsip_request_type_e {
+ tsip_NONE = 0,
+
+ tsip_ACK,
+ tsip_BYE,
+ tsip_CANCEL,
+ tsip_INVITE,
+ tsip_OPTIONS,
+ tsip_REGISTER,
+ tsip_SUBSCRIBE,
+ tsip_NOTIFY,
+ tsip_REFER,
+ tsip_INFO,
+ tsip_UPDATE,
+ tsip_MESSAGE,
+ tsip_PUBLISH,
+ tsip_PRACK
}
tsip_request_type_t;
diff --git a/tinySIP/include/tinysip/tsip_ssession.h b/tinySIP/include/tinysip/tsip_ssession.h
index 9049a96..b144363 100755
--- a/tinySIP/include/tinysip/tsip_ssession.h
+++ b/tinySIP/include/tinysip/tsip_ssession.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,7 +46,7 @@ TSIP_BEGIN_DECLS
struct tsip_message_s;
struct tsip_action_s;
-typedef uint64_t tsip_ssession_id_t;
+typedef uint64_t tsip_ssession_id_t;
#define TSIP_SSESSION_INVALID_ID 0
#define TSIP_SSESSION_INVALID_HANDLE tsk_null
@@ -59,26 +59,25 @@ typedef uint64_t tsip_ssession_id_t;
#define TSIP_SSESSION(self) ((tsip_ssession_t*)(self))
-typedef enum tsip_ssession_param_type_e
-{
- sstype_null = 0,
-
- sstype_header,
- sstype_caps,
- sstype_userdata,
- sstype_to_str,
- sstype_from_str,
- sstype_to_obj,
- sstype_from_obj,
- sstype_nocontact,
- sstype_expires,
- sstype_silent_hangup,
- sstype_sigcomp_id,
- sstype_auth_ha1,
- sstype_auth_impi,
- sstype_parent_id,
- sstype_ws_src,
- sstype_media
+typedef enum tsip_ssession_param_type_e {
+ sstype_null = 0,
+
+ sstype_header,
+ sstype_caps,
+ sstype_userdata,
+ sstype_to_str,
+ sstype_from_str,
+ sstype_to_obj,
+ sstype_from_obj,
+ sstype_nocontact,
+ sstype_expires,
+ sstype_silent_hangup,
+ sstype_sigcomp_id,
+ sstype_auth_ha1,
+ sstype_auth_impi,
+ sstype_parent_id,
+ sstype_ws_src,
+ sstype_media
}
tsip_ssession_param_type_t;
@@ -105,42 +104,41 @@ tsip_ssession_param_type_t;
#define TSIP_SSESSION_SET_MEDIA(...) sstype_media, ##__VA_ARGS__
#define TSIP_SSESSION_SET_NULL() sstype_null
-typedef enum tsip_msession_param_type_e
-{
- mstype_null = 0,
+typedef enum tsip_msession_param_type_e {
+ mstype_null = 0,
- mstype_set_profile,
- mstype_set_srtp_mode,
- mstype_set_avpf_mode,
+ mstype_set_profile,
+ mstype_set_srtp_mode,
+ mstype_set_avpf_mode,
- mstype_set_100rel,
- mstype_set_rtcp,
- mstype_set_rtcpmux,
- mstype_set_ice,
- mstype_set_ice_stun,
- mstype_set_ice_turn,
- mstype_set_stun_server,
- mstype_set_stun_cred,
+ mstype_set_100rel,
+ mstype_set_rtcp,
+ mstype_set_rtcpmux,
+ mstype_set_ice,
+ mstype_set_ice_stun,
+ mstype_set_ice_turn,
+ mstype_set_stun_server,
+ mstype_set_stun_cred,
- mstype_set_video_fps,
- mstype_set_video_bw_up,
- mstype_set_video_bw_down,
- mstype_set_video_prefsize,
+ mstype_set_video_fps,
+ mstype_set_video_bw_up,
+ mstype_set_video_bw_down,
+ mstype_set_video_prefsize,
- mstype_set_qos,
- mstype_unset_qos,
+ mstype_set_qos,
+ mstype_unset_qos,
- mstype_set_timers,
- mstype_unset_timers,
+ mstype_set_timers,
+ mstype_unset_timers,
- mstype_set_codecs,
+ mstype_set_codecs,
- mstype_set_bypass_encoding,
- mstype_set_bypass_decoding,
+ mstype_set_bypass_encoding,
+ mstype_set_bypass_decoding,
- mstype_set_rtp_ssrc,
+ mstype_set_rtp_ssrc,
- mstype_set_msrp_cb
+ mstype_set_msrp_cb
}
tsip_msession_param_type_t;
@@ -175,100 +173,99 @@ tsip_msession_param_type_t;
#define TSIP_MSESSION_SET_NULL() mstype_null
-typedef struct tsip_ssession_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_ssession_id_t id;
- tsip_ssession_id_t id_parent; //for call transfer
- unsigned owner:1;
-
- const struct tsip_stack_s* stack;
- const void* userdata;
-
- //=======
- // SIP
- //=======
- tsk_params_L_t *caps;
- tsk_params_L_t *headers;
-
- unsigned no_contact:1;
- struct tsip_uri_s* from;
- struct tsip_uri_s* to;
- int64_t expires;
- tsk_bool_t silent_hangup;
- char* sigcomp_id;
- char* auth_ha1;
- char* auth_impi;
-
- //=======
- // WebSocket
- //=======
- struct{
- // used when the stack is running in webrtc2sip mode to store the 'origin' (a.k.a 'src')
- struct{
- char* host;
- tsk_istr_t port;
- char* proto;
- } src;
- } ws;
-
- //=======
- // Media
- //=======
- struct{
- tmedia_type_t type;
- tmedia_profile_t profile;
- tmedia_srtp_mode_t srtp_mode;
- tmedia_mode_t avpf_mode;
- tmedia_codec_id_t codecs;
- tsk_bool_t bypass_encoding;
- tsk_bool_t bypass_decoding;
-
- /* Video */
- int32_t video_fps;
- int32_t video_bw_up;
- int32_t video_bw_down;
- tmedia_pref_video_size_t video_pref_size;
-
- /* RTP*/
- struct{
- struct{
- uint32_t audio;
- uint32_t video;
- }ssrc;
- } rtp;
-
- /* Session timers */
- struct{
- char* refresher;
- unsigned timeout;
- } timers;
- /* QoS */
- struct{
- tmedia_qos_stype_t type;
- tmedia_qos_strength_t strength;
- } qos;
- /* MSRP */
- struct{
- tmedia_session_msrp_cb_f callback;
- } msrp;
- /* STUN */
- struct{
- char* username;
- char* password;
- char* hostname;
- uint16_t port;
- } stun;
-
- /* Features */
- unsigned enable_100rel:1;
- unsigned enable_ice:1;
- unsigned enable_icestun:1;
- unsigned enable_iceturn:1;
- unsigned enable_rtcp:1;
- unsigned enable_rtcpmux:1;
- } media;
+typedef struct tsip_ssession_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_ssession_id_t id;
+ tsip_ssession_id_t id_parent; //for call transfer
+ unsigned owner:1;
+
+ const struct tsip_stack_s* stack;
+ const void* userdata;
+
+ //=======
+ // SIP
+ //=======
+ tsk_params_L_t *caps;
+ tsk_params_L_t *headers;
+
+ unsigned no_contact:1;
+ struct tsip_uri_s* from;
+ struct tsip_uri_s* to;
+ int64_t expires;
+ tsk_bool_t silent_hangup;
+ char* sigcomp_id;
+ char* auth_ha1;
+ char* auth_impi;
+
+ //=======
+ // WebSocket
+ //=======
+ struct {
+ // used when the stack is running in webrtc2sip mode to store the 'origin' (a.k.a 'src')
+ struct {
+ char* host;
+ tsk_istr_t port;
+ char* proto;
+ } src;
+ } ws;
+
+ //=======
+ // Media
+ //=======
+ struct {
+ tmedia_type_t type;
+ tmedia_profile_t profile;
+ tmedia_srtp_mode_t srtp_mode;
+ tmedia_mode_t avpf_mode;
+ tmedia_codec_id_t codecs;
+ tsk_bool_t bypass_encoding;
+ tsk_bool_t bypass_decoding;
+
+ /* Video */
+ int32_t video_fps;
+ int32_t video_bw_up;
+ int32_t video_bw_down;
+ tmedia_pref_video_size_t video_pref_size;
+
+ /* RTP*/
+ struct {
+ struct {
+ uint32_t audio;
+ uint32_t video;
+ } ssrc;
+ } rtp;
+
+ /* Session timers */
+ struct {
+ char* refresher;
+ unsigned timeout;
+ } timers;
+ /* QoS */
+ struct {
+ tmedia_qos_stype_t type;
+ tmedia_qos_strength_t strength;
+ } qos;
+ /* MSRP */
+ struct {
+ tmedia_session_msrp_cb_f callback;
+ } msrp;
+ /* STUN */
+ struct {
+ char* username;
+ char* password;
+ char* hostname;
+ uint16_t port;
+ } stun;
+
+ /* Features */
+ unsigned enable_100rel:1;
+ unsigned enable_ice:1;
+ unsigned enable_icestun:1;
+ unsigned enable_iceturn:1;
+ unsigned enable_rtcp:1;
+ unsigned enable_rtcpmux:1;
+ } media;
}
tsip_ssession_t;
diff --git a/tinySIP/include/tinysip/tsip_timers.h b/tinySIP/include/tinysip/tsip_timers.h
index 52fddc5..5d63b07 100755
--- a/tinySIP/include/tinysip/tsip_timers.h
+++ b/tinySIP/include/tinysip/tsip_timers.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,31 +55,29 @@ TSIP_BEGIN_DECLS
//extern const char *timerL;
//extern const char *timerM;
-typedef struct tsip_timer_s
-{
- tsk_timer_id_t id;
- uint64_t timeout;
+typedef struct tsip_timer_s {
+ tsk_timer_id_t id;
+ uint64_t timeout;
}
tsip_timer_t;
-typedef struct tsip_timers_s
-{
- uint32_t T1;
- uint32_t T2;
- uint32_t T4;
- uint32_t A;
- uint32_t B;
- uint32_t C;
- uint32_t D;
- uint32_t E;
- uint32_t F;
- uint32_t G;
- uint32_t H;
- uint32_t I;
- uint32_t J;
- uint32_t K;
- uint32_t L;
- uint32_t M;
+typedef struct tsip_timers_s {
+ uint32_t T1;
+ uint32_t T2;
+ uint32_t T4;
+ uint32_t A;
+ uint32_t B;
+ uint32_t C;
+ uint32_t D;
+ uint32_t E;
+ uint32_t F;
+ uint32_t G;
+ uint32_t H;
+ uint32_t I;
+ uint32_t J;
+ uint32_t K;
+ uint32_t L;
+ uint32_t M;
}
tsip_timers_t;
diff --git a/tinySIP/include/tinysip/tsip_uri.h b/tinySIP/include/tinysip/tsip_uri.h
index b0daf6b..f30414d 100755
--- a/tinySIP/include/tinysip/tsip_uri.h
+++ b/tinySIP/include/tinysip/tsip_uri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,21 +40,19 @@ TSIP_BEGIN_DECLS
#define TSIP_URI_IS_SECURE(uri) ((uri && uri->type==uri_sips) ? tsk_true : tsk_false)
-typedef enum tsip_uri_type_e
-{
- uri_unknown,
- uri_sip,
- uri_sips,
- uri_tel
+typedef enum tsip_uri_type_e {
+ uri_unknown,
+ uri_sip,
+ uri_sips,
+ uri_tel
}
tsip_uri_type_t;
-typedef enum tsip_host_type_e
-{
- host_unknown,
- host_hostname,
- host_ipv4,
- host_ipv6
+typedef enum tsip_host_type_e {
+ host_unknown,
+ host_hostname,
+ host_ipv4,
+ host_ipv6
}
tsip_host_type_t;
@@ -63,20 +61,19 @@ tsip_host_type_t;
/// @brief SIP/SIPS/TEL URI.
///
////////////////////////////////////////////////////////////////////////////////////////////////////
-typedef struct tsip_uri_s
-{
- TSK_DECLARE_OBJECT;
-
- tsip_uri_type_t type;
- char *scheme;
- char *host; /**< Host name. Hostname or IPv4address or IPv6address. */
- tsip_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
- uint16_t port;
- char *user_name;
- char *password;
- char *display_name;
-
- tsk_params_L_t *params; /**< list of @ref tsk_param_t elements containing all parameters. */
+typedef struct tsip_uri_s {
+ TSK_DECLARE_OBJECT;
+
+ tsip_uri_type_t type;
+ char *scheme;
+ char *host; /**< Host name. Hostname or IPv4address or IPv6address. */
+ tsip_host_type_t host_type; /**< IPv4 or IPv6 or domain name. */
+ uint16_t port;
+ char *user_name;
+ char *password;
+ char *display_name;
+
+ tsk_params_L_t *params; /**< list of @ref tsk_param_t elements containing all parameters. */
}
tsip_uri_t;
diff --git a/tinySIP/include/tinysip_config.h b/tinySIP/include/tinysip_config.h
index 2f95cde..0c23c45 100755
--- a/tinySIP/include/tinysip_config.h
+++ b/tinySIP/include/tinysip_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -61,7 +61,7 @@
# define TSIP_BEGIN_DECLS extern "C" {
# define TSIP_END_DECLS }
#else
-# define TSIP_BEGIN_DECLS
+# define TSIP_BEGIN_DECLS
# define TSIP_END_DECLS
#endif
@@ -90,7 +90,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYSIP_CONFIG_H
diff --git a/tinySIP/include/tsip.h b/tinySIP/include/tsip.h
index 0a1d79b..30eb50a 100755
--- a/tinySIP/include/tsip.h
+++ b/tinySIP/include/tsip.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -58,65 +58,63 @@ typedef uint8_t amf_t[2];
typedef uint8_t operator_id_t[16];
// @tinyWRAP
-typedef enum tsip_stack_mode_e
-{
- tsip_stack_mode_ua,
- tsip_stack_mode_p2p,
- tsip_stack_mode_webrtc2sip,
- tsip_stack_mode_mcu
+typedef enum tsip_stack_mode_e {
+ tsip_stack_mode_ua,
+ tsip_stack_mode_p2p,
+ tsip_stack_mode_webrtc2sip,
+ tsip_stack_mode_mcu
}
tsip_stack_mode_t;
#define TSIP_STACK_MODE_IS_SERVER(stack) ((stack)->network.mode == tsip_stack_mode_webrtc2sip || (stack)->network.mode == tsip_stack_mode_mcu)
#define TSIP_STACK_MODE_IS_CLIENT(stack) (!TSIP_STACK_MODE_IS_SERVER((stack)))
-typedef enum tsip_stack_param_type_e
-{
- tsip_pname_null = 0,
-
- /* === Identity === */
- tsip_pname_display_name,
- tsip_pname_impu,
- tsip_pname_preferred_id,
- tsip_pname_impi,
- tsip_pname_password,
-
- /* === SigComp === */
- tsip_pname_sigcomp,
- tsip_pname_sigcomp_add_compartment,
- tsip_pname_sigcomp_remove_compartment,
-
- /* === Network === */
- tsip_pname_realm,
- tsip_pname_local_ip,
- tsip_pname_local_port,
- tsip_pname_aor,
- tsip_pname_discovery_naptr,
- tsip_pname_discovery_dhcp,
- tsip_pname_proxy_cscf,
- tsip_pname_dnsserver,
- tsip_pname_max_fds,
- tsip_pname_mode,
-
-
- /* === Security === */
- tsip_pname_early_ims,
- tsip_pname_secagree_ipsec,
- tsip_pname_secagree_tls,
- tsip_pname_amf,
- tsip_pname_operator_id,
- tsip_pname_tls_certs,
- tsip_pname_ipsec_params,
-
- /* === Dummy Headers === */
- tsip_pname_header,
-
- /* Nat Traversal */
- tsip_pname_stun_enabled,
- tsip_pname_stun_server,
- tsip_pname_stun_cred,
-
- /* === User Data === */
- tsip_pname_userdata,
+typedef enum tsip_stack_param_type_e {
+ tsip_pname_null = 0,
+
+ /* === Identity === */
+ tsip_pname_display_name,
+ tsip_pname_impu,
+ tsip_pname_preferred_id,
+ tsip_pname_impi,
+ tsip_pname_password,
+
+ /* === SigComp === */
+ tsip_pname_sigcomp,
+ tsip_pname_sigcomp_add_compartment,
+ tsip_pname_sigcomp_remove_compartment,
+
+ /* === Network === */
+ tsip_pname_realm,
+ tsip_pname_local_ip,
+ tsip_pname_local_port,
+ tsip_pname_aor,
+ tsip_pname_discovery_naptr,
+ tsip_pname_discovery_dhcp,
+ tsip_pname_proxy_cscf,
+ tsip_pname_dnsserver,
+ tsip_pname_max_fds,
+ tsip_pname_mode,
+
+
+ /* === Security === */
+ tsip_pname_early_ims,
+ tsip_pname_secagree_ipsec,
+ tsip_pname_secagree_tls,
+ tsip_pname_amf,
+ tsip_pname_operator_id,
+ tsip_pname_tls_certs,
+ tsip_pname_ipsec_params,
+
+ /* === Dummy Headers === */
+ tsip_pname_header,
+
+ /* Nat Traversal */
+ tsip_pname_stun_enabled,
+ tsip_pname_stun_server,
+ tsip_pname_stun_cred,
+
+ /* === User Data === */
+ tsip_pname_userdata,
}
tsip_stack_param_type_t;
@@ -132,7 +130,7 @@ tsip_stack_param_type_t;
* Sets the user's display name. Used in SIP 'From' and 'To' headers.
* @param NAME_STR The user's display name.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_DISPLAY_NAME("john doe"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -142,7 +140,7 @@ tsip_stack_param_type_t;
* Sets the user's IMPU (IMS Public Identity).
* @param URI_STR A valid SIP/SIPS/tel URI string.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_IMPU("sip:johndoe@open-ims.test"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -152,7 +150,7 @@ tsip_stack_param_type_t;
* Sets the user's Preferred Identity. Used to populate the P-Preferred-Identity header.
* @param URI_STR A valid SIP/SIPS/tel URI string.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_PREFERRED_IDENTITY("sip:johndoe@open-ims.test"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -162,7 +160,7 @@ tsip_stack_param_type_t;
* Sets the user's IMPI (IMS Private Identity).
* @param IMPI_STR Any string.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_IMPI("johndoe@open-ims.test"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -172,7 +170,7 @@ tsip_stack_param_type_t;
* Sets the user's password.
* @param PASSORD_STR Any string.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_PASSWORD("mysecret"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -195,7 +193,7 @@ tsip_stack_param_type_t;
* @param CPB_UINT Cycles Per Bit. Default value is 64.
* @param PRES_DICT_BOOL Indicates whether to enable Presence dictionary (RFC 5112) or not. Default value is @a tsk_false.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_SIGCOMP(8192, 8192, 64, tsk_true),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -209,7 +207,7 @@ tsip_stack_param_type_t;
* @sa @ref TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT()
*
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_NEW_SIGCOMP_COMPARTMENT("urn:uuid:0C67446E-F1A1-11D9-94D3-000A95A0E128"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -223,7 +221,7 @@ tsip_stack_param_type_t;
* @sa @ref TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT()
*
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT("urn:uuid:0C67446E-F1A1-11D9-94D3-000A95A0E128"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -238,7 +236,7 @@ tsip_stack_param_type_t;
* Sets the domain name.
* @param URI_STR A valid SIP/SIPS URI string.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_REALM("sip:open-ims.test"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -248,7 +246,7 @@ tsip_stack_param_type_t;
* Sets the user's local IP address.
* @param IP_STR IPv4/IPv6 IP address or FQDN.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_LOCAL_IP("fe80::"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -260,7 +258,7 @@ tsip_stack_param_type_t;
* Sets the user's local Port to bind to.
* @param PORT_UINT Port number. Should be between 0x0400 and 0xFFFF.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_LOCAL_PORT(5060),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -275,7 +273,7 @@ tsip_stack_param_type_t;
* @param PORT_UINT Port number. Should be between 0x0400 and 0xFFFF.
* Will be ignored if equals to zero.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_AOR("fe80::", 1234),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -289,7 +287,7 @@ tsip_stack_param_type_t;
* is missing, then this option will be enabled by default.
* @param ENABLED_BOOL @a tsk_true (1) or @a tsk_false (0).
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_DISCOVERY_NAPTR(tsk_true),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -302,7 +300,7 @@ tsip_stack_param_type_t;
* to use will depend on the Proxy-CSCF address type.
* @param ENABLED_BOOL @a tsk_true (1) or @a tsk_false (0).
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_DISCOVERY_DHCP(tsk_false),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -311,14 +309,14 @@ tsip_stack_param_type_t;
*/
/**@ingroup tsip_stack_group
* @def TSIP_STACK_SET_PROXY_CSCF
-* Configures the Proxy-CSCF.
+* Configures the Proxy-CSCF.
* @param FQDN_STR The IP address (v4/v6) or FQDN of the Proxy-CSCF.
* @param PORT_UINT The port.
* @param TRANSPORT_STR The transport type. Should be: @a "udp" or @a "tcp" or @a "tls" or @a "sctp". Default is @a "udp".
-* @param IP_VERSION_STR The IP version to use. Should be: @a "ipv4" or @a "ipv6" or @a "ipv46". This parameter is useful when
+* @param IP_VERSION_STR The IP version to use. Should be: @a "ipv4" or @a "ipv6" or @a "ipv46". This parameter is useful when
* @a FQDN_STR parameter is a domain name. default is @a "ipv4".
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_PROXY_CSCF("pcscf-doubango.org", 4060, "tcp", "ipv6"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -331,7 +329,7 @@ tsip_stack_param_type_t;
* @param IP_STR The IP address or FQDN of the DNS server to add.
* @code
// Add two new DNS servers (IPv6 and IPv4)
-int ret = tsip_stack_set(stack,
+int ret = tsip_stack_set(stack,
TSIP_STACK_SET_DNS_SERVER("192.16.16.9"),
TSIP_STACK_SET_DNS_SERVER("fe::"),
TSIP_STACK_SET_NULL());
@@ -341,7 +339,7 @@ int ret = tsip_stack_set(stack,
* @def TSIP_STACK_SET_MODE_SERVER
* Configure the stack to be used as server. Cannot be changed later.
* @code
-int ret = tsip_stack_set(stack,
+int ret = tsip_stack_set(stack,
TSIP_STACK_SET_MODE_SERVER(),
TSIP_STACK_SET_NULL());
* @endcode
@@ -363,20 +361,20 @@ int ret = tsip_stack_set(stack,
/* === Security === */
/**@ingroup tsip_stack_group
* @def TSIP_STACK_SET_EARLY_IMS
-* Whether to enable 3GPP Early-IMS Security as per 3GPP TS 33.978.
+* Whether to enable 3GPP Early-IMS Security as per 3GPP TS 33.978.
* @param ENABLED_BOOL @a tsk_true (1) or @a tsk_false (0).
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_EARLY_IMS(tsk_false),
* TSIP_STACK_SET_NULL());
* @endcode
*/
/**@ingroup tsip_stack_group
* @def TSIP_STACK_SET_SECAGREE_IPSEC
-* Whether to enable IPSec security agreement as per IETF RFC 3329.
+* Whether to enable IPSec security agreement as per IETF RFC 3329.
* @param ENABLED_BOOL @a tsk_true (1) or @a tsk_false (0).
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_SECAGREE_IPSEC(tsk_true),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -385,10 +383,10 @@ int ret = tsip_stack_set(stack,
*/
/**@ingroup tsip_stack_group
* @def TSIP_STACK_SET_SECAGREE_TLS
-* Whether to enable TLS security agreement as per IETF RFC 3329.
+* Whether to enable TLS security agreement as per IETF RFC 3329.
* @param ENABLED_BOOL @a tsk_true (1) or @a tsk_false (0).
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_SECAGREE_TLS(tsk_true),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -400,7 +398,7 @@ int ret = tsip_stack_set(stack,
* Sets AMF (Authentication Management Field) value to use for IMS-AKA authentication.
* @param AMF_UINT16 16-bit value.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_IMS_AKA_AMF(0x3FB6),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -413,7 +411,7 @@ int ret = tsip_stack_set(stack,
* @param OPID_HEX_STR 128-bit value as hex-string. If the length of the value supplied by the user is less than 128 bits,
* then it will be padded with zeros.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("0x5FABC9"), // Will be padded with zeros
* TSIP_STACK_SET_NULL());
* @endcode
@@ -428,7 +426,7 @@ int ret = tsip_stack_set(stack,
* @param MODE_STR Mode. Should be: @a "tun" or @a "trans". Default is @a "trans".
* @param PROTOCOL_STR Protocol. Should be @a "ah" or @a "esp" or @a "ah/esp". Default is @a "esp".
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_SECAGREE_IPSEC(tsk_true),
TSIP_STACK_SET_IPSEC_PARAMS("hmac-md5-96", "des-ede3-cbc", "trans", "esp"),
* TSIP_STACK_SET_NULL());
@@ -443,7 +441,7 @@ int ret = tsip_stack_set(stack,
* @param PUB_FILE_STR Public cert. file.
* @param PRIV_FILE_STR Private cert. file.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_TLS_CERTS("C:\\tls\\ca.pki-crt.pem", "C:\\tls\\pub-crt.pem", "C:\\tls\\priv-key.pem"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -467,7 +465,7 @@ int ret = tsip_stack_set(stack,
* @param NAME_STR The name of the header to add or update.
* @param VALUE_STR The value of the header to add or update.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
* TSIP_STACK_SET_HEADER("Allow", "INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER"),
* TSIP_STACK_SET_NULL());
@@ -480,7 +478,7 @@ int ret = tsip_stack_set(stack,
* Removes a stack-level header.
* @param NAME_STR The name of the header to remove.
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_UNSET_HEADER("User-Agent"),
* TSIP_STACK_UNSET_HEADER("Allow"),
* TSIP_STACK_UNSET_HEADER("My_Header"),
@@ -499,7 +497,7 @@ int ret = tsip_stack_set(stack,
* @param IP_STR The IPv4/IPv6 address for FQDN of the STUN2/TURN address.
* @param PORT_UINT The server port (default is 3478 for both TCP and UDP, and 5349 for TLS)
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_STUN_SERVER("numb.viagenie.ca", 3478),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -512,7 +510,7 @@ int ret = tsip_stack_set(stack,
* @param USR_STR The login.
* @param PASSORD_STR The password
* @code
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_STUN_CRED("bob@open-ims.test", "mysecret"),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -530,7 +528,7 @@ int ret = tsip_stack_set(stack,
* @param DATA_PTR Pointer to the user data.
* @code
* const void* context;
-* int ret = tsip_stack_set(stack,
+* int ret = tsip_stack_set(stack,
* TSIP_STACK_SET_USERDATA(context),
* TSIP_STACK_SET_NULL());
* @endcode
@@ -541,131 +539,130 @@ int ret = tsip_stack_set(stack,
/* 3GPP IMS/LTE stack (for internal use). only tsip_stack_handle_t should be visible. */
-typedef struct tsip_stack_s
-{
- TSK_DECLARE_RUNNABLE;
- TSK_DECLARE_SAFEOBJ;
-
- tsk_timer_manager_handle_t* timer_mgr_global;
- tsk_bool_t started;
- tsip_stack_callback_f callback;
-
- /* === Identity === */
- struct{
- char* display_name;
- tsip_uri_t *impu;
- tsip_uri_t *preferred;
- char *impi;
- char *password;
- } identity;
-
- /* === SigComp === */
- struct{
- tsip_sigcomp_handle_t* handle;
-
- unsigned dms;
- unsigned sms;
- unsigned cpb;
- tsk_bool_t sip_dict;
- tsk_bool_t pres_dict;
- } sigcomp;
-
- /* === Network === */
- struct{
- tsip_stack_mode_t mode;
-
- char *local_ip[TSIP_TRANSPORT_IDX_MAX];
- tnet_port_t local_port[TSIP_TRANSPORT_IDX_MAX];
+typedef struct tsip_stack_s {
+ TSK_DECLARE_RUNNABLE;
+ TSK_DECLARE_SAFEOBJ;
+
+ tsk_timer_manager_handle_t* timer_mgr_global;
+ tsk_bool_t started;
+ tsip_stack_callback_f callback;
+
+ /* === Identity === */
+ struct {
+ char* display_name;
+ tsip_uri_t *impu;
+ tsip_uri_t *preferred;
+ char *impi;
+ char *password;
+ } identity;
+
+ /* === SigComp === */
+ struct {
+ tsip_sigcomp_handle_t* handle;
+
+ unsigned dms;
+ unsigned sms;
+ unsigned cpb;
+ tsk_bool_t sip_dict;
+ tsk_bool_t pres_dict;
+ } sigcomp;
+
+ /* === Network === */
+ struct {
+ tsip_stack_mode_t mode;
+
+ char *local_ip[TSIP_TRANSPORT_IDX_MAX];
+ tnet_port_t local_port[TSIP_TRANSPORT_IDX_MAX];
tsk_bool_t local_ip_is_set_by_user[TSIP_TRANSPORT_IDX_MAX]; // whether the address (ip and port) is set by the user or retrieved
- char *proxy_cscf[TSIP_TRANSPORT_IDX_MAX];
- tnet_port_t proxy_cscf_port[TSIP_TRANSPORT_IDX_MAX];
- tnet_socket_type_t proxy_cscf_type[TSIP_TRANSPORT_IDX_MAX];
- tnet_socket_type_t transport_types[TSIP_TRANSPORT_IDX_MAX];
- int32_t transport_idx_default;
-
- tsip_uri_t *realm;
-
- //! IP adddress and port to use as AOR (user-defined)
- struct{
- char* ip[TSIP_TRANSPORT_IDX_MAX];
- tnet_port_t port[TSIP_TRANSPORT_IDX_MAX];
- } aor;
-
- tsk_bool_t discovery_naptr;
- tsk_bool_t discovery_dhcp;
-
- tsk_size_t max_fds;
- } network;
-
- /* === Security === */
- struct{
- char* secagree_mech;
- tsk_bool_t earlyIMS;
- operator_id_t operator_id;
- amf_t amf;
-
- /* IPSec */
- struct{
- char* alg;
- char* ealg;
- char* mode;
- char* protocol;
- } ipsec;
- tsk_bool_t enable_secagree_ipsec;
-
- /* TLS */
- struct {
- char* ca;
- char* pbk;
- char* pvk;
- tsk_bool_t verify;
- }tls;
- tsk_bool_t enable_secagree_tls;
- } security;
-
-
-
-
-
-
-
-
- tsip_uris_L_t* paths;
- tsip_uris_L_t* service_routes;
- tsip_uris_L_t* associated_uris;
-
- /* DNS context */
- tnet_dns_ctx_t *dns_ctx;
-
- /* NAT Traversal context */
- struct {
- // STUN
- struct{
- char* ip;
- tnet_port_t port;
- char* login;
- char* pwd;
- tsk_bool_t enabled;
- } stun;
- struct tnet_nat_ctx_s* ctx;
- } natt;
-
- /* DHCP context */
-
- /* QoS */
-
- /* Internals. */
- //tsk_timer_manager_handle_t* timer_mgr;
- tsip_timers_t timers;
- tsip_ssessions_L_t *ssessions;
- tsk_params_L_t *headers;
- const void* userdata;
-
- /* Layers */
- struct tsip_dialog_layer_s *layer_dialog;
- struct tsip_transac_layer_s *layer_transac;
- struct tsip_transport_layer_s *layer_transport;
+ char *proxy_cscf[TSIP_TRANSPORT_IDX_MAX];
+ tnet_port_t proxy_cscf_port[TSIP_TRANSPORT_IDX_MAX];
+ tnet_socket_type_t proxy_cscf_type[TSIP_TRANSPORT_IDX_MAX];
+ tnet_socket_type_t transport_types[TSIP_TRANSPORT_IDX_MAX];
+ int32_t transport_idx_default;
+
+ tsip_uri_t *realm;
+
+ //! IP adddress and port to use as AOR (user-defined)
+ struct {
+ char* ip[TSIP_TRANSPORT_IDX_MAX];
+ tnet_port_t port[TSIP_TRANSPORT_IDX_MAX];
+ } aor;
+
+ tsk_bool_t discovery_naptr;
+ tsk_bool_t discovery_dhcp;
+
+ tsk_size_t max_fds;
+ } network;
+
+ /* === Security === */
+ struct {
+ char* secagree_mech;
+ tsk_bool_t earlyIMS;
+ operator_id_t operator_id;
+ amf_t amf;
+
+ /* IPSec */
+ struct {
+ char* alg;
+ char* ealg;
+ char* mode;
+ char* protocol;
+ } ipsec;
+ tsk_bool_t enable_secagree_ipsec;
+
+ /* TLS */
+ struct {
+ char* ca;
+ char* pbk;
+ char* pvk;
+ tsk_bool_t verify;
+ } tls;
+ tsk_bool_t enable_secagree_tls;
+ } security;
+
+
+
+
+
+
+
+
+ tsip_uris_L_t* paths;
+ tsip_uris_L_t* service_routes;
+ tsip_uris_L_t* associated_uris;
+
+ /* DNS context */
+ tnet_dns_ctx_t *dns_ctx;
+
+ /* NAT Traversal context */
+ struct {
+ // STUN
+ struct {
+ char* ip;
+ tnet_port_t port;
+ char* login;
+ char* pwd;
+ tsk_bool_t enabled;
+ } stun;
+ struct tnet_nat_ctx_s* ctx;
+ } natt;
+
+ /* DHCP context */
+
+ /* QoS */
+
+ /* Internals. */
+ //tsk_timer_manager_handle_t* timer_mgr;
+ tsip_timers_t timers;
+ tsip_ssessions_L_t *ssessions;
+ tsk_params_L_t *headers;
+ const void* userdata;
+
+ /* Layers */
+ struct tsip_dialog_layer_s *layer_dialog;
+ struct tsip_transac_layer_s *layer_transac;
+ struct tsip_transport_layer_s *layer_transport;
}
tsip_stack_t;
diff --git a/tinySIP/src/api/tsip_api_common.c b/tinySIP/src/api/tsip_api_common.c
index 4261fd5..a325385 100755
--- a/tinySIP/src/api/tsip_api_common.c
+++ b/tinySIP/src/api/tsip_api_common.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,96 +39,96 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
/* Local functions */
int _tsip_api_common_any(const tsip_ssession_handle_t *ss, tsip_action_type_t type, va_list* app);
-/* internal function used to execute any user action
+/* internal function used to execute any user action
* can only handle session with dialogs */
int _tsip_api_common_any(const tsip_ssession_handle_t *ss, tsip_action_type_t type, va_list* app)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- /* execute action */
- if((action = _tsip_action_create(type, app))){
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ /* execute action */
+ if((action = _tsip_action_create(type, app))) {
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ return ret;
}
/**@ingroup tsip_action_group
* Rejects an incoming request.
* @param ss The SIP Session managing the dialog on which the request has been received.
-* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
+* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
* MUST always ends with @ref TSIP_ACTION_SET_NULL().
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsip_api_common_reject(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_reject, &ap))){
- TSK_DEBUG_ERROR("Reject() failed.");
- }
- va_end(ap);
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_reject, &ap))) {
+ TSK_DEBUG_ERROR("Reject() failed.");
+ }
+ va_end(ap);
- return ret;
+ return ret;
}
/**@ingroup tsip_action_group
* Hangs up a session.
* @param ss The SIP Session to hang-up. Will send an unREGISTER or unSUBSCRIBE or unPUBLISH or
-* BYE etc depending on the type of the SIP dialog managed by the session.
-* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
+* BYE etc depending on the type of the SIP dialog managed by the session.
+* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
* MUST always ends with @ref TSIP_ACTION_SET_NULL().
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsip_api_common_hangup(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_hangup, &ap))){
- TSK_DEBUG_ERROR("Hang-up() failed.");
- }
- va_end(ap);
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_hangup, &ap))) {
+ TSK_DEBUG_ERROR("Hang-up() failed.");
+ }
+ va_end(ap);
- return ret;
+ return ret;
}
/**@ingroup tsip_action_group
* Accepts an incoming request.
* @param ss The SIP Session managing the dialog on which the request has been received.
-* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
+* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
* MUST always ends with @ref TSIP_ACTION_SET_NULL().
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsip_api_common_accept(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_accept, &ap))){
- TSK_DEBUG_ERROR("Accept() failed.");
- }
- va_end(ap);
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_accept, &ap))) {
+ TSK_DEBUG_ERROR("Accept() failed.");
+ }
+ va_end(ap);
- return ret;
+ return ret;
}
diff --git a/tinySIP/src/api/tsip_api_info.c b/tinySIP/src/api/tsip_api_info.c
index ec20b8b..37265da 100755
--- a/tinySIP/src/api/tsip_api_info.c
+++ b/tinySIP/src/api/tsip_api_info.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,47 +43,47 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
int tsip_info_event_signal(tsip_info_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_info_event_t* sipevent = TSIP_INFO_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_info);
+ tsip_info_event_t* sipevent = TSIP_INFO_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_info);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_info_send_info(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- /* action */
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_info_send, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_INFO, ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ /* action */
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_info_send, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_INFO, ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
@@ -103,32 +103,31 @@ int tsip_api_info_send_info(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_info_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_info_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_info_event_type_t);
- }
- return self;
+ tsip_info_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_info_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_info_event_dtor(tsk_object_t * self)
-{
- tsip_info_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_info_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_info_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_info_event_def_s =
-{
- sizeof(tsip_info_event_t),
- tsip_info_event_ctor,
- tsip_info_event_dtor,
- tsip_info_event_cmp,
+static const tsk_object_def_t tsip_info_event_def_s = {
+ sizeof(tsip_info_event_t),
+ tsip_info_event_ctor,
+ tsip_info_event_dtor,
+ tsip_info_event_cmp,
};
const tsk_object_def_t *tsip_info_event_def_t = &tsip_info_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_invite.c b/tinySIP/src/api/tsip_api_invite.c
index 530eb67..9cdaa9f 100755
--- a/tinySIP/src/api/tsip_api_invite.c
+++ b/tinySIP/src/api/tsip_api_invite.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,274 +45,274 @@ extern int _tsip_api_common_any(const tsip_ssession_handle_t *ss, tsip_action_ty
int tsip_invite_event_signal(tsip_invite_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_invite_event_t* sipevent = TSIP_INVITE_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_invite);
+ tsip_invite_event_t* sipevent = TSIP_INVITE_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_invite);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_invite_send_invite(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, type);
- if((action = _tsip_action_create(tsip_atype_invite, &ap))){
- tsk_bool_t new_dialog = tsk_false;
- /* Media type */
- action->media.type = type;
-
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_INVITE, ss);
- new_dialog = tsk_true;
- }
- if(!(ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action))){
- if(new_dialog){ // otherwise we are trying to refresh the media type and the type will be updated if 200 OK
- TSIP_SSESSION(_ss)->media.type = type; // Update Session Media Type
- }
- }
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, type);
+ if((action = _tsip_action_create(tsip_atype_invite, &ap))) {
+ tsk_bool_t new_dialog = tsk_false;
+ /* Media type */
+ action->media.type = type;
+
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_INVITE, ss);
+ new_dialog = tsk_true;
+ }
+ if(!(ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action))) {
+ if(new_dialog) { // otherwise we are trying to refresh the media type and the type will be updated if 200 OK
+ TSIP_SSESSION(_ss)->media.type = type; // Update Session Media Type
+ }
+ }
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_info(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
- va_list ap;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, ss);
- /* execute action */
- if((action = _tsip_action_create(tsip_atype_info_send, &ap))){
- /* Perform action */
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ /* execute action */
+ if((action = _tsip_action_create(tsip_atype_info_send, &ap))) {
+ /* Perform action */
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_hold(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
- va_list ap;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, type);
- /* execute action */
- if((action = _tsip_action_create(tsip_atype_hold, &ap))){
- /* Media type */
- action->media.type = type;
- /* Perform action */
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, type);
+ /* execute action */
+ if((action = _tsip_action_create(tsip_atype_hold, &ap))) {
+ /* Media type */
+ action->media.type = type;
+ /* Perform action */
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_resume(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
- va_list ap;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, type);
- /* execute action */
- if((action = _tsip_action_create(tsip_atype_resume, &ap))){
- /* Media type */
- action->media.type = type;
- /* Perform action */
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, type);
+ /* execute action */
+ if((action = _tsip_action_create(tsip_atype_resume, &ap))) {
+ /* Media type */
+ action->media.type = type;
+ /* Perform action */
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_large_message(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
-
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_lmessage, &ap))){
- TSK_DEBUG_ERROR("Failed to send MSRP message");
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ va_list ap;
+
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_lmessage, &ap))) {
+ TSK_DEBUG_ERROR("Failed to send MSRP message");
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_ect(const tsip_ssession_handle_t *ss, const char* toUri, ...)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
- va_list ap;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack || !toUri){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, toUri);
- /* execute action */
- if((action = _tsip_action_create(tsip_atype_ect, &ap))){
- /* Refer-To */
- action->ect.to = tsk_strdup(toUri);
- /* Perform action */
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack || !toUri) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, toUri);
+ /* execute action */
+ if((action = _tsip_action_create(tsip_atype_ect, &ap))) {
+ /* Refer-To */
+ action->ect.to = tsk_strdup(toUri);
+ /* Perform action */
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_ect_accept(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
-
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_ect_accept, &ap))){
- TSK_DEBUG_ERROR("Failed to accept incoming ECT");
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ va_list ap;
+
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_ect_accept, &ap))) {
+ TSK_DEBUG_ERROR("Failed to accept incoming ECT");
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_ect_reject(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
-
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_ect_reject, &ap))){
- TSK_DEBUG_ERROR("Failed to reject incoming ECT");
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ va_list ap;
+
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_ect_reject, &ap))) {
+ TSK_DEBUG_ERROR("Failed to reject incoming ECT");
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_dtmf(const tsip_ssession_handle_t *ss, int event, ...)
{
- int ret = -1;
- tsip_action_t* action;
- const tsip_ssession_t* _ss;
- va_list ap;
-
- /* Checks for validity */
- if(!(_ss = ss) || !_ss->stack || (event <0 || event>15)){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, event);
- /* execute action */
- if((action = _tsip_action_create(tsip_atype_dtmf_send, &ap))){
- /* Event */
- action->dtmf.event = event;
- /* Perform action */
- ret = tsip_ssession_handle(_ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ int ret = -1;
+ tsip_action_t* action;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+
+ /* Checks for validity */
+ if(!(_ss = ss) || !_ss->stack || (event <0 || event>15)) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, event);
+ /* execute action */
+ if((action = _tsip_action_create(tsip_atype_dtmf_send, &ap))) {
+ /* Event */
+ action->dtmf.event = event;
+ /* Perform action */
+ ret = tsip_ssession_handle(_ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_invite_send_bye(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_bye, &ap))){
- TSK_DEBUG_ERROR("Bye() failed.");
- }
- va_end(ap);
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_bye, &ap))) {
+ TSK_DEBUG_ERROR("Bye() failed.");
+ }
+ va_end(ap);
- return ret;
+ return ret;
}
@@ -332,32 +332,31 @@ int tsip_api_invite_send_bye(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_invite_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_invite_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_invite_event_type_t);
- }
- return self;
+ tsip_invite_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_invite_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_invite_event_dtor(tsk_object_t * self)
-{
- tsip_invite_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_invite_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_invite_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_invite_event_def_s =
-{
- sizeof(tsip_invite_event_t),
- tsip_invite_event_ctor,
- tsip_invite_event_dtor,
- tsip_invite_event_cmp,
+static const tsk_object_def_t tsip_invite_event_def_s = {
+ sizeof(tsip_invite_event_t),
+ tsip_invite_event_ctor,
+ tsip_invite_event_dtor,
+ tsip_invite_event_cmp,
};
const tsk_object_def_t *tsip_invite_event_def_t = &tsip_invite_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_message.c b/tinySIP/src/api/tsip_api_message.c
index 232e9c6..1c65e50 100755
--- a/tinySIP/src/api/tsip_api_message.c
+++ b/tinySIP/src/api/tsip_api_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,47 +43,47 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
int tsip_message_event_signal(tsip_message_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_message_event_t* sipevent = TSIP_MESSAGE_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_message);
+ tsip_message_event_t* sipevent = TSIP_MESSAGE_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_message);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_message_send_message(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- /* action */
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_message_send, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_MESSAGE, ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ /* action */
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_message_send, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_MESSAGE, ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
@@ -103,32 +103,31 @@ int tsip_api_message_send_message(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_message_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_message_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_message_event_type_t);
- }
- return self;
+ tsip_message_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_message_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_message_event_dtor(tsk_object_t * self)
-{
- tsip_message_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_message_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_message_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_message_event_def_s =
-{
- sizeof(tsip_message_event_t),
- tsip_message_event_ctor,
- tsip_message_event_dtor,
- tsip_message_event_cmp,
+static const tsk_object_def_t tsip_message_event_def_s = {
+ sizeof(tsip_message_event_t),
+ tsip_message_event_ctor,
+ tsip_message_event_dtor,
+ tsip_message_event_cmp,
};
const tsk_object_def_t *tsip_message_event_def_t = &tsip_message_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_options.c b/tinySIP/src/api/tsip_api_options.c
index df87a4d..029f763 100755
--- a/tinySIP/src/api/tsip_api_options.c
+++ b/tinySIP/src/api/tsip_api_options.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,46 +43,46 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
int tsip_options_event_signal(tsip_options_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_options_event_t* sipevent = TSIP_OPTIONS_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_options);
+ tsip_options_event_t* sipevent = TSIP_OPTIONS_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_options);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_options_send_options(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_options_send, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_OPTIONS, ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_options_send, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_OPTIONS, ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
@@ -102,32 +102,31 @@ int tsip_api_options_send_options(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_options_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_options_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_options_event_type_t);
- }
- return self;
+ tsip_options_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_options_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_options_event_dtor(tsk_object_t * self)
-{
- tsip_options_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_options_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_options_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_options_event_def_s =
-{
- sizeof(tsip_options_event_t),
- tsip_options_event_ctor,
- tsip_options_event_dtor,
- tsip_options_event_cmp,
+static const tsk_object_def_t tsip_options_event_def_s = {
+ sizeof(tsip_options_event_t),
+ tsip_options_event_ctor,
+ tsip_options_event_dtor,
+ tsip_options_event_cmp,
};
const tsk_object_def_t *tsip_options_event_def_t = &tsip_options_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_publish.c b/tinySIP/src/api/tsip_api_publish.c
index 916ed6f..86fd60f 100755
--- a/tinySIP/src/api/tsip_api_publish.c
+++ b/tinySIP/src/api/tsip_api_publish.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,74 +43,74 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
int tsip_publish_event_signal(tsip_publish_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_publish_event_t* sipevent = TSIP_PUBLISH_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_publish);
+ tsip_publish_event_t* sipevent = TSIP_PUBLISH_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_publish);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_publish_send_publish(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_publish, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_PUBLISH, ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_publish, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_PUBLISH, ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_publish_send_unpublish(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack is running */
- if(!TSK_RUNNABLE(_ss->stack)->running){
- TSK_DEBUG_ERROR("Stack not running.");
- return -2;
- }
-
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_unpublish, &ap))){
- ret = tsip_ssession_handle(ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return 0;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack is running */
+ if(!TSK_RUNNABLE(_ss->stack)->running) {
+ TSK_DEBUG_ERROR("Stack not running.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_unpublish, &ap))) {
+ ret = tsip_ssession_handle(ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return 0;
}
@@ -128,32 +128,31 @@ int tsip_api_publish_send_unpublish(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_publish_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_publish_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_publish_event_type_t);
- }
- return self;
+ tsip_publish_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_publish_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_publish_event_dtor(tsk_object_t * self)
-{
- tsip_publish_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_publish_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_publish_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_publish_event_def_s =
-{
- sizeof(tsip_publish_event_t),
- tsip_publish_event_ctor,
- tsip_publish_event_dtor,
- tsip_publish_event_cmp,
+static const tsk_object_def_t tsip_publish_event_def_s = {
+ sizeof(tsip_publish_event_t),
+ tsip_publish_event_ctor,
+ tsip_publish_event_dtor,
+ tsip_publish_event_cmp,
};
const tsk_object_def_t *tsip_publish_event_def_t = &tsip_publish_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_register.c b/tinySIP/src/api/tsip_api_register.c
index 4d61632..5b5c579 100755
--- a/tinySIP/src/api/tsip_api_register.c
+++ b/tinySIP/src/api/tsip_api_register.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,78 +47,78 @@ extern int _tsip_api_common_any(const tsip_ssession_handle_t *ss, tsip_action_ty
/* internal function used to signal evant from REGISTER dialog to user app */
int tsip_register_event_signal(tsip_register_event_type_t type, tsip_ssession_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_register_event_t* sipevent = TSIP_REGISTER_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_register);
+ tsip_register_event_t* sipevent = TSIP_REGISTER_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_register);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(ss->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(ss->stack), sipevent);
- return 0;
+ return 0;
}
/**@ingroup tsip_action_group
* Sends SIP REGISTER request. If the session is already established, the same dialog will
* be used (refresh).
* @param ss The SIP Session managing the REGISTER dialog.
-* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
+* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
* MUST always ends with @ref TSIP_ACTION_SET_NULL().
* @retval Zero if succeed and non-zero error code otherwise.
* @sa @ref tsip_api_register_send_unregister
*/
int tsip_api_register_send_register(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- /* performs action */
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_register, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, _ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_REGISTER, _ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- TSK_OBJECT_SAFE_FREE(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ /* performs action */
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_register, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, _ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_REGISTER, _ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ TSK_OBJECT_SAFE_FREE(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
/**@ingroup tsip_action_group
* Sends SIP unREGISTER request (expires=0). The session should be already established.
* @param ss The SIP Session managing the REGISTER dialog.
-* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
+* @param ... Any TSIP_ACTION_SET_*() macros. e.g. @ref TSIP_ACTION_SET_HEADER().
* MUST always ends with @ref TSIP_ACTION_SET_NULL().
* @retval Zero if succeed and non-zero error code otherwise.
* @sa @ref tsip_api_register_send_register
*/
int tsip_api_register_send_unregister(const tsip_ssession_handle_t *ss, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- va_start(ap, ss);
- if((ret = _tsip_api_common_any(ss, tsip_atype_unregister, &ap))){
- TSK_DEBUG_ERROR("unREGISTER() failed.");
- }
- va_end(ap);
+ va_start(ap, ss);
+ if((ret = _tsip_api_common_any(ss, tsip_atype_unregister, &ap))) {
+ TSK_DEBUG_ERROR("unREGISTER() failed.");
+ }
+ va_end(ap);
- return ret;
+ return ret;
}
@@ -135,32 +135,31 @@ int tsip_api_register_send_unregister(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_register_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_register_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_register_event_type_t);
- }
- return self;
+ tsip_register_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_register_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_register_event_dtor(tsk_object_t * self)
-{
- tsip_register_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_register_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_register_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_register_event_def_s =
-{
- sizeof(tsip_register_event_t),
- tsip_register_event_ctor,
- tsip_register_event_dtor,
- tsip_register_event_cmp,
+static const tsk_object_def_t tsip_register_event_def_s = {
+ sizeof(tsip_register_event_t),
+ tsip_register_event_ctor,
+ tsip_register_event_dtor,
+ tsip_register_event_cmp,
};
const tsk_object_def_t *tsip_register_event_def_t = &tsip_register_event_def_s;
diff --git a/tinySIP/src/api/tsip_api_subscribe.c b/tinySIP/src/api/tsip_api_subscribe.c
index 867b258..c0f8c43 100755
--- a/tinySIP/src/api/tsip_api_subscribe.c
+++ b/tinySIP/src/api/tsip_api_subscribe.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,74 +44,74 @@ extern tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
int tsip_subscribe_event_signal(tsip_subscribe_event_type_t type, tsip_ssession_t* ss, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
- tsip_subscribe_event_t* sipevent = TSIP_SUBSCRIBE_EVENT_CREATE(type);
- tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_subscribe);
+ tsip_subscribe_event_t* sipevent = TSIP_SUBSCRIBE_EVENT_CREATE(type);
+ tsip_event_init(TSIP_EVENT(sipevent), ss, status_code, phrase, sipmessage, tsip_event_subscribe);
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(TSIP_SSESSION(ss)->stack), sipevent);
- return 0;
+ return 0;
}
int tsip_api_subscribe_send_subscribe(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- tsip_dialog_t* dialog;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack has been started */
- if(!TSK_RUNNABLE(_ss->stack)->started){
- TSK_DEBUG_ERROR("Stack not started.");
- return -2;
- }
-
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_subscribe, &ap))){
- if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))){
- dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_SUBSCRIBE, ss);
- }
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
-
- tsk_object_unref(dialog);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return ret;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ tsip_dialog_t* dialog;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack has been started */
+ if(!TSK_RUNNABLE(_ss->stack)->started) {
+ TSK_DEBUG_ERROR("Stack not started.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_subscribe, &ap))) {
+ if(!(dialog = tsip_dialog_layer_find_by_ss(_ss->stack->layer_dialog, ss))) {
+ dialog = tsip_dialog_layer_new(_ss->stack->layer_dialog, tsip_dialog_SUBSCRIBE, ss);
+ }
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+
+ tsk_object_unref(dialog);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return ret;
}
int tsip_api_subscribe_send_unsubscribe(const tsip_ssession_handle_t *ss, ...)
{
- const tsip_ssession_t* _ss;
- va_list ap;
- tsip_action_t* action;
- int ret = -1;
-
- if(!(_ss = ss) || !_ss->stack){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return ret;
- }
-
- /* Checks if the stack is running */
- if(!TSK_RUNNABLE(_ss->stack)->running){
- TSK_DEBUG_ERROR("Stack not running.");
- return -2;
- }
-
- va_start(ap, ss);
- if((action = _tsip_action_create(tsip_atype_unsubscribe, &ap))){
- ret = tsip_ssession_handle(ss, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- va_end(ap);
-
- return 0;
+ const tsip_ssession_t* _ss;
+ va_list ap;
+ tsip_action_t* action;
+ int ret = -1;
+
+ if(!(_ss = ss) || !_ss->stack) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return ret;
+ }
+
+ /* Checks if the stack is running */
+ if(!TSK_RUNNABLE(_ss->stack)->running) {
+ TSK_DEBUG_ERROR("Stack not running.");
+ return -2;
+ }
+
+ va_start(ap, ss);
+ if((action = _tsip_action_create(tsip_atype_unsubscribe, &ap))) {
+ ret = tsip_ssession_handle(ss, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ va_end(ap);
+
+ return 0;
}
@@ -129,32 +129,31 @@ int tsip_api_subscribe_send_unsubscribe(const tsip_ssession_handle_t *ss, ...)
//
static tsk_object_t* tsip_subscribe_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_subscribe_event_t *sipevent = self;
- if(sipevent){
- sipevent->type = va_arg(*app, tsip_subscribe_event_type_t);
- }
- return self;
+ tsip_subscribe_event_t *sipevent = self;
+ if(sipevent) {
+ sipevent->type = va_arg(*app, tsip_subscribe_event_type_t);
+ }
+ return self;
}
static tsk_object_t* tsip_subscribe_event_dtor(tsk_object_t * self)
-{
- tsip_subscribe_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(TSIP_EVENT(sipevent));
- }
- return self;
+{
+ tsip_subscribe_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(TSIP_EVENT(sipevent));
+ }
+ return self;
}
static int tsip_subscribe_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_subscribe_event_def_s =
-{
- sizeof(tsip_subscribe_event_t),
- tsip_subscribe_event_ctor,
- tsip_subscribe_event_dtor,
- tsip_subscribe_event_cmp,
+static const tsk_object_def_t tsip_subscribe_event_def_s = {
+ sizeof(tsip_subscribe_event_t),
+ tsip_subscribe_event_ctor,
+ tsip_subscribe_event_dtor,
+ tsip_subscribe_event_cmp,
};
const tsk_object_def_t *tsip_subscribe_event_def_t = &tsip_subscribe_event_def_s;
diff --git a/tinySIP/src/authentication/tsip_challenge.c b/tinySIP/src/authentication/tsip_challenge.c
index bfe39ee..023c4bf 100755
--- a/tinySIP/src/authentication/tsip_challenge.c
+++ b/tinySIP/src/authentication/tsip_challenge.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,33 +52,32 @@
/** Creates new challenge object. */
tsip_challenge_t* tsip_challenge_create(tsip_stack_t* stack, tsk_bool_t isproxy, const char* scheme, const char* realm, const char* nonce, const char* opaque, const char* algorithm, const char* qop)
{
- return tsk_object_new(tsip_challenge_def_t, stack, isproxy,scheme, realm, nonce, opaque, algorithm, qop);
+ return tsk_object_new(tsip_challenge_def_t, stack, isproxy,scheme, realm, nonce, opaque, algorithm, qop);
}
/** Creates new challenge object (with default values). */
tsip_challenge_t* tsip_challenge_create_null(tsip_stack_t* stack)
{
- return tsip_challenge_create(stack, tsk_false, tsk_null, tsk_null, tsk_null, tsk_null, tsk_null, tsk_null);
+ return tsip_challenge_create(stack, tsk_false, tsk_null, tsk_null, tsk_null, tsk_null, tsk_null, tsk_null);
}
int tsip_challenge_reset_cnonce(tsip_challenge_t *self)
{
- if(self){
- if(self->qop) /* client nonce is only used if qop=auth, auth-int or both */
- {
+ if(self) {
+ if(self->qop) { /* client nonce is only used if qop=auth, auth-int or both */
#if 0
- memcpy(self->cnonce, "ecb1d3f6931803ce7ae68099cb946594", 32);
+ memcpy(self->cnonce, "ecb1d3f6931803ce7ae68099cb946594", 32);
#else
- tsk_istr_t istr;
-
- tsk_strrandom(&istr);
- tsk_md5compute(istr, tsk_strlen(istr), &self->cnonce);
+ tsk_istr_t istr;
+
+ tsk_strrandom(&istr);
+ tsk_md5compute(istr, tsk_strlen(istr), &self->cnonce);
#endif
- self->nc = 1;
- }
- }
- return -1;
+ self->nc = 1;
+ }
+ }
+ return -1;
}
//3GPP TS 35.205/6/7/8/9 and RFC 3310
@@ -87,132 +86,132 @@ int tsip_challenge_get_akares(tsip_challenge_t *self, char const *password, char
#define SQN_XOR_AK() (AUTN + 0)
#define SERVER_DATA() (nonce + AKA_RAND_SIZE + AKA_AUTN_SIZE)
- // § ==> XOR
- // || ==> append
-
- AKA_RES_T akares;
-
- int ret = -1;
- tsk_size_t n;
- char *nonce = tsk_null;
-
- AKA_XXX_DECLARE(RAND);
- AKA_XXX_DECLARE(AK);
- AKA_XXX_DECLARE(AMF);
- AKA_XXX_DECLARE(CK);
- AKA_XXX_DECLARE(IK);
- AKA_XXX_DECLARE(K);
- AKA_XXX_DECLARE(SQN);
- AKA_XXX_DECLARE(MAC_A);
- AKA_XXX_DECLARE(AUTN);
-
- AKA_XXX_BZERO(RAND);
- AKA_XXX_BZERO(AK);
- AKA_XXX_BZERO(AMF);
- AKA_XXX_BZERO(CK);
- AKA_XXX_BZERO(IK);
- AKA_XXX_BZERO(K);
- AKA_XXX_BZERO(SQN);
- AKA_XXX_BZERO(MAC_A);
- AKA_XXX_BZERO(AUTN);
-
- /* RFC 3310 subclause 3.2: nonce = base64(RAND || AUTN || SERV_DATA) */
- n = tsk_base64_decode((const uint8_t*)self->nonce, tsk_strlen(self->nonce), &nonce);
- if(n > TSK_MD5_STRING_SIZE){
- TSK_DEBUG_ERROR("The IMS CORE returned an invalid nonce.");
- goto bail;
- }
- if(n < AKA_RAND_SIZE + AKA_AUTN_SIZE){
- TSK_DEBUG_ERROR("The nonce returned by the IMS CORE is too short to contain both [RAND] and [AUTHN]");
- goto bail;
- }
- else{
- /* Get RAND and AUTN */
- memcpy(RAND, nonce, AKA_RAND_SIZE);
- memcpy(AUTN, (nonce + AKA_RAND_SIZE), AKA_AUTN_SIZE);
- }
-
- /* Secret key */
- memcpy(K, password, (tsk_strlen(password) > AKA_K_SIZE ? AKA_K_SIZE : tsk_strlen(password)));
-
- /* 3GPP TS 35.205: AUTN = SQN[§AK] || AMF || MAC-A */
- memcpy(AMF, (AUTN + AKA_SQN_SIZE), AKA_AMF_SIZE);
- memcpy(MAC_A, (AUTN + AKA_SQN_SIZE + AKA_AMF_SIZE), AKA_MAC_A_SIZE);
-
- /* compute OP */
- ComputeOP(TSIP_CHALLENGE_STACK(self)->security.operator_id);
-
- /* Checks that we hold the same AMF */
- for(n=0; n<AKA_AMF_SIZE; n++){
- if(AMF[n] != TSIP_CHALLENGE_STACK(self)->security.amf[n]){
- TSK_DEBUG_ERROR("IMS-AKA error: AMF <> XAMF");
- goto bail;
- }
- }
-
- /* Calculate CK, IK and AK */
- f2345(K, RAND, akares, CK, IK, AK);
-
- /* Calculate SQN from SQN_XOR_AK */
- for(n=0; n<AKA_SQN_SIZE; n++){
- SQN[n] = (uint8_t) (SQN_XOR_AK()[n] ^ AK[n]);
- }
-
- /* Calculate XMAC_A */
- {
- AKA_MAC_A_T XMAC_A;
- memset(XMAC_A, '\0', sizeof(XMAC_A));
-
- f1(K, RAND, SQN, AMF, XMAC_A);
- if(!tsk_strnequals(MAC_A, XMAC_A, AKA_MAC_A_SIZE)){
- TSK_DEBUG_ERROR("IMS-AKA error: XMAC_A [%s] <> MAC_A[%s]", XMAC_A, MAC_A);
- goto bail;
- }
- }
-
- /* RFC 4169 subclause 3
- The HTTP Digest password is derived from base64 encoded PRF(RES || IK||CK, "http-digest-akav2-password")
- or
- PRF(XRES||IK||CK, "http-digest-akav2-password") instead of (RES) or (XRES) respectively.
- Where PRF ==> HMAC_MD5 function.
- */
- if(TSIP_CHALLENGE_IS_AKAv2(self)){
- uint8_t res_ik_ck[AKA_RES_SIZE + AKA_IK_SIZE + AKA_CK_SIZE];
- tsk_md5digest_t md5_digest;
-
- memcpy(res_ik_ck, akares, AKA_RES_SIZE);
- memcpy((res_ik_ck + AKA_RES_SIZE), IK, AKA_IK_SIZE);
- memcpy((res_ik_ck + AKA_RES_SIZE + AKA_IK_SIZE), CK, AKA_CK_SIZE);
-
- if((ret = hmac_md5digest_compute((const uint8_t*)"http-digest-akav2-password", 26, (const char*)res_ik_ck, sizeof(res_ik_ck), md5_digest))){/* PRF(RES||IK||CK, ...) */
- TSK_DEBUG_ERROR("hmac_md5digest_compute() failed. AKAv2 response will be invalid.");
-
- ret = -3;
- goto bail;
- }
- else{/* b64(PRF(...)) */
- if(!tsk_base64_encode(md5_digest, sizeof(md5_digest), result)){
- TSK_DEBUG_ERROR("tsk_base64_encode() failed. AKAv2 response will be invalid.");
-
- ret = -4;
- goto bail;
- }
- }
- }
- else{
- *result = tsk_calloc(1, AKA_RES_SIZE + 1);
- memcpy(*result, akares, AKA_RES_SIZE);
-
- ret = 0;
- }
-
- /* Copy CK and IK */
- memcpy(self->ck, CK, AKA_CK_SIZE);
- memcpy(self->ik, IK, AKA_IK_SIZE);
+ // § ==> XOR
+ // || ==> append
+
+ AKA_RES_T akares;
+
+ int ret = -1;
+ tsk_size_t n;
+ char *nonce = tsk_null;
+
+ AKA_XXX_DECLARE(RAND);
+ AKA_XXX_DECLARE(AK);
+ AKA_XXX_DECLARE(AMF);
+ AKA_XXX_DECLARE(CK);
+ AKA_XXX_DECLARE(IK);
+ AKA_XXX_DECLARE(K);
+ AKA_XXX_DECLARE(SQN);
+ AKA_XXX_DECLARE(MAC_A);
+ AKA_XXX_DECLARE(AUTN);
+
+ AKA_XXX_BZERO(RAND);
+ AKA_XXX_BZERO(AK);
+ AKA_XXX_BZERO(AMF);
+ AKA_XXX_BZERO(CK);
+ AKA_XXX_BZERO(IK);
+ AKA_XXX_BZERO(K);
+ AKA_XXX_BZERO(SQN);
+ AKA_XXX_BZERO(MAC_A);
+ AKA_XXX_BZERO(AUTN);
+
+ /* RFC 3310 subclause 3.2: nonce = base64(RAND || AUTN || SERV_DATA) */
+ n = tsk_base64_decode((const uint8_t*)self->nonce, tsk_strlen(self->nonce), &nonce);
+ if(n > TSK_MD5_STRING_SIZE) {
+ TSK_DEBUG_ERROR("The IMS CORE returned an invalid nonce.");
+ goto bail;
+ }
+ if(n < AKA_RAND_SIZE + AKA_AUTN_SIZE) {
+ TSK_DEBUG_ERROR("The nonce returned by the IMS CORE is too short to contain both [RAND] and [AUTHN]");
+ goto bail;
+ }
+ else {
+ /* Get RAND and AUTN */
+ memcpy(RAND, nonce, AKA_RAND_SIZE);
+ memcpy(AUTN, (nonce + AKA_RAND_SIZE), AKA_AUTN_SIZE);
+ }
+
+ /* Secret key */
+ memcpy(K, password, (tsk_strlen(password) > AKA_K_SIZE ? AKA_K_SIZE : tsk_strlen(password)));
+
+ /* 3GPP TS 35.205: AUTN = SQN[§AK] || AMF || MAC-A */
+ memcpy(AMF, (AUTN + AKA_SQN_SIZE), AKA_AMF_SIZE);
+ memcpy(MAC_A, (AUTN + AKA_SQN_SIZE + AKA_AMF_SIZE), AKA_MAC_A_SIZE);
+
+ /* compute OP */
+ ComputeOP(TSIP_CHALLENGE_STACK(self)->security.operator_id);
+
+ /* Checks that we hold the same AMF */
+ for(n=0; n<AKA_AMF_SIZE; n++) {
+ if(AMF[n] != TSIP_CHALLENGE_STACK(self)->security.amf[n]) {
+ TSK_DEBUG_ERROR("IMS-AKA error: AMF <> XAMF");
+ goto bail;
+ }
+ }
+
+ /* Calculate CK, IK and AK */
+ f2345(K, RAND, akares, CK, IK, AK);
+
+ /* Calculate SQN from SQN_XOR_AK */
+ for(n=0; n<AKA_SQN_SIZE; n++) {
+ SQN[n] = (uint8_t) (SQN_XOR_AK()[n] ^ AK[n]);
+ }
+
+ /* Calculate XMAC_A */
+ {
+ AKA_MAC_A_T XMAC_A;
+ memset(XMAC_A, '\0', sizeof(XMAC_A));
+
+ f1(K, RAND, SQN, AMF, XMAC_A);
+ if(!tsk_strnequals(MAC_A, XMAC_A, AKA_MAC_A_SIZE)) {
+ TSK_DEBUG_ERROR("IMS-AKA error: XMAC_A [%s] <> MAC_A[%s]", XMAC_A, MAC_A);
+ goto bail;
+ }
+ }
+
+ /* RFC 4169 subclause 3
+ The HTTP Digest password is derived from base64 encoded PRF(RES || IK||CK, "http-digest-akav2-password")
+ or
+ PRF(XRES||IK||CK, "http-digest-akav2-password") instead of (RES) or (XRES) respectively.
+ Where PRF ==> HMAC_MD5 function.
+ */
+ if(TSIP_CHALLENGE_IS_AKAv2(self)) {
+ uint8_t res_ik_ck[AKA_RES_SIZE + AKA_IK_SIZE + AKA_CK_SIZE];
+ tsk_md5digest_t md5_digest;
+
+ memcpy(res_ik_ck, akares, AKA_RES_SIZE);
+ memcpy((res_ik_ck + AKA_RES_SIZE), IK, AKA_IK_SIZE);
+ memcpy((res_ik_ck + AKA_RES_SIZE + AKA_IK_SIZE), CK, AKA_CK_SIZE);
+
+ if((ret = hmac_md5digest_compute((const uint8_t*)"http-digest-akav2-password", 26, (const char*)res_ik_ck, sizeof(res_ik_ck), md5_digest))) { /* PRF(RES||IK||CK, ...) */
+ TSK_DEBUG_ERROR("hmac_md5digest_compute() failed. AKAv2 response will be invalid.");
+
+ ret = -3;
+ goto bail;
+ }
+ else { /* b64(PRF(...)) */
+ if(!tsk_base64_encode(md5_digest, sizeof(md5_digest), result)) {
+ TSK_DEBUG_ERROR("tsk_base64_encode() failed. AKAv2 response will be invalid.");
+
+ ret = -4;
+ goto bail;
+ }
+ }
+ }
+ else {
+ *result = tsk_calloc(1, AKA_RES_SIZE + 1);
+ memcpy(*result, akares, AKA_RES_SIZE);
+
+ ret = 0;
+ }
+
+ /* Copy CK and IK */
+ memcpy(self->ck, CK, AKA_CK_SIZE);
+ memcpy(self->ik, IK, AKA_IK_SIZE);
bail:
- TSK_FREE(nonce);
- return ret;
+ TSK_FREE(nonce);
+ return ret;
#undef SQN_XOR_AK
#undef SERVER_DATA
@@ -220,124 +219,124 @@ bail:
int tsip_challenge_get_response(tsip_challenge_t *self, const char* method, const char* uristring, const tsk_buffer_t* entity_body, tsk_md5string_t* response)
{
- if(TSIP_CHALLENGE_IS_DIGEST(self) && self->stack){
- tsk_md5string_t ha1, ha2;
- nonce_count_t nc;
-
- /* ===
- Calculate HA1 = MD5(A1) = M5(username:realm:secret)
- In case of AKAv1-MD5 and AKAv2-MD5 the secret must be computed as per RFC 3310 + 3GPP TS 206/7/8/9.
- The resulting AKA RES parameter is treated as a "password"/"secret" when calculating the response directive of RFC 2617.
- */
- if(TSIP_CHALLENGE_IS_AKAv1(self) || TSIP_CHALLENGE_IS_AKAv2(self)){
- char* akaresult = tsk_null;
- tsip_challenge_get_akares(self, TSIP_CHALLENGE_STACK(self)->identity.password, &akaresult);
- if(thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, akaresult, &ha1)){
- // return -1;
- }
- TSK_FREE(akaresult);
- }
- else{
- if(!tsk_strnullORempty(self->ha1_hexstr)){
- // use HA1 provide be the user (e.g. webrtc2sip server will need this to authenticate INVITEs when acting as b2bua)
- memset(ha1, 0, sizeof(tsk_md5string_t));
- memcpy(ha1, self->ha1_hexstr, (TSK_MD5_DIGEST_SIZE << 1));
- }
- else{
- thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, TSIP_CHALLENGE_STACK(self)->identity.password, &ha1);
- }
- }
-
- /* ===
- HA2
- */
- thttp_auth_digest_HA2(method,
- uristring,
- entity_body,
- self->qop,
- &ha2);
-
- /* RESPONSE */
- if(self->nc){
- THTTP_NCOUNT_2_STRING(self->nc, nc);
- }
- thttp_auth_digest_response((const tsk_md5string_t *)&ha1,
- self->nonce,
- nc,
- self->cnonce,
- self->qop,
- (const tsk_md5string_t *)&ha2,
- response);
-
- if(self->qop){
- self->nc++;
- }
-
- return 0;
- }
- return -1;
+ if(TSIP_CHALLENGE_IS_DIGEST(self) && self->stack) {
+ tsk_md5string_t ha1, ha2;
+ nonce_count_t nc;
+
+ /* ===
+ Calculate HA1 = MD5(A1) = M5(username:realm:secret)
+ In case of AKAv1-MD5 and AKAv2-MD5 the secret must be computed as per RFC 3310 + 3GPP TS 206/7/8/9.
+ The resulting AKA RES parameter is treated as a "password"/"secret" when calculating the response directive of RFC 2617.
+ */
+ if(TSIP_CHALLENGE_IS_AKAv1(self) || TSIP_CHALLENGE_IS_AKAv2(self)) {
+ char* akaresult = tsk_null;
+ tsip_challenge_get_akares(self, TSIP_CHALLENGE_STACK(self)->identity.password, &akaresult);
+ if(thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, akaresult, &ha1)) {
+ // return -1;
+ }
+ TSK_FREE(akaresult);
+ }
+ else {
+ if(!tsk_strnullORempty(self->ha1_hexstr)) {
+ // use HA1 provide be the user (e.g. webrtc2sip server will need this to authenticate INVITEs when acting as b2bua)
+ memset(ha1, 0, sizeof(tsk_md5string_t));
+ memcpy(ha1, self->ha1_hexstr, (TSK_MD5_DIGEST_SIZE << 1));
+ }
+ else {
+ thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, TSIP_CHALLENGE_STACK(self)->identity.password, &ha1);
+ }
+ }
+
+ /* ===
+ HA2
+ */
+ thttp_auth_digest_HA2(method,
+ uristring,
+ entity_body,
+ self->qop,
+ &ha2);
+
+ /* RESPONSE */
+ if(self->nc) {
+ THTTP_NCOUNT_2_STRING(self->nc, nc);
+ }
+ thttp_auth_digest_response((const tsk_md5string_t *)&ha1,
+ self->nonce,
+ nc,
+ self->cnonce,
+ self->qop,
+ (const tsk_md5string_t *)&ha2,
+ response);
+
+ if(self->qop) {
+ self->nc++;
+ }
+
+ return 0;
+ }
+ return -1;
}
int tsip_challenge_update(tsip_challenge_t *self, const char* scheme, const char* realm, const char* nonce, const char* opaque, const char* algorithm, const char* qop)
{
- if(self){
- int noncechanged = !tsk_striequals(self->nonce, nonce);
-
- tsk_strupdate(&self->scheme, scheme);
- tsk_strupdate(&self->realm, realm);
- tsk_strupdate(&self->nonce, nonce);
- tsk_strupdate(&self->opaque, opaque);
- tsk_strupdate(&self->algorithm, algorithm);
- if(qop){
- self->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
- (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
- }
-
- if(noncechanged && self->qop){
- tsip_challenge_reset_cnonce(self);
- }
- return 0;
- }
- return -1;
+ if(self) {
+ int noncechanged = !tsk_striequals(self->nonce, nonce);
+
+ tsk_strupdate(&self->scheme, scheme);
+ tsk_strupdate(&self->realm, realm);
+ tsk_strupdate(&self->nonce, nonce);
+ tsk_strupdate(&self->opaque, opaque);
+ tsk_strupdate(&self->algorithm, algorithm);
+ if(qop) {
+ self->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
+ (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
+ }
+
+ if(noncechanged && self->qop) {
+ tsip_challenge_reset_cnonce(self);
+ }
+ return 0;
+ }
+ return -1;
}
int tsip_challenge_set_cred(tsip_challenge_t *self, const char* username, const char* ha1_hexstr)
{
- if(!self || tsk_strlen(ha1_hexstr) != (TSK_MD5_DIGEST_SIZE << 1)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsk_strupdate(&self->username, username);
- tsk_strupdate(&self->ha1_hexstr, ha1_hexstr);
- return 0;
+ if(!self || tsk_strlen(ha1_hexstr) != (TSK_MD5_DIGEST_SIZE << 1)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsk_strupdate(&self->username, username);
+ tsk_strupdate(&self->ha1_hexstr, ha1_hexstr);
+ return 0;
}
tsip_header_t *tsip_challenge_create_header_authorization(tsip_challenge_t *self, const tsip_request_t *request)
{
- tsk_md5string_t response;
- nonce_count_t nc;
- char *uristring = tsk_null;
- tsip_header_t *header = tsk_null;
-
- if(!self || !self->stack || !request){
- goto bail;
- }
-
- if(!(uristring = tsip_uri_tostring(request->line.request.uri, tsk_true, tsk_false))){
- TSK_DEBUG_ERROR("Failed to parse URI: %s", uristring);
- goto bail;
- }
-
- /* We compute the nc here because @ref tsip_challenge_get_response function will increment it's value. */
- if(self->nc){
- THTTP_NCOUNT_2_STRING(self->nc, nc);
- }
-
- /* entity_body ==> request-content */
- if(tsip_challenge_get_response(self, request->line.request.method, uristring, request->Content, &response)){
- goto bail;
- }
-
+ tsk_md5string_t response;
+ nonce_count_t nc;
+ char *uristring = tsk_null;
+ tsip_header_t *header = tsk_null;
+
+ if(!self || !self->stack || !request) {
+ goto bail;
+ }
+
+ if(!(uristring = tsip_uri_tostring(request->line.request.uri, tsk_true, tsk_false))) {
+ TSK_DEBUG_ERROR("Failed to parse URI: %s", uristring);
+ goto bail;
+ }
+
+ /* We compute the nc here because @ref tsip_challenge_get_response function will increment it's value. */
+ if(self->nc) {
+ THTTP_NCOUNT_2_STRING(self->nc, nc);
+ }
+
+ /* entity_body ==> request-content */
+ if(tsip_challenge_get_response(self, request->line.request.method, uristring, request->Content, &response)) {
+ goto bail;
+ }
+
#define TSIP_AUTH_COPY_VALUES(hdr) \
hdr->username = tsk_strdup(TSIP_CHALLENGE_USERNAME(self)); \
@@ -351,40 +350,40 @@ tsip_header_t *tsip_challenge_create_header_authorization(tsip_challenge_t *self
hdr->uri = tsk_strdup(uristring); \
hdr->nc = self->nc? tsk_strdup(nc) : 0; \
hdr->response = tsk_strdup(response); \
-
- if(self->isproxy){
- tsip_header_Proxy_Authorization_t *proxy_auth = tsip_header_Proxy_Authorization_create();
- TSIP_AUTH_COPY_VALUES(proxy_auth);
- header = TSIP_HEADER(proxy_auth);
- }
- else{
- tsip_header_Authorization_t *auth = tsip_header_Authorization_create();
- TSIP_AUTH_COPY_VALUES(auth);
- header = TSIP_HEADER(auth);
- }
+
+ if(self->isproxy) {
+ tsip_header_Proxy_Authorization_t *proxy_auth = tsip_header_Proxy_Authorization_create();
+ TSIP_AUTH_COPY_VALUES(proxy_auth);
+ header = TSIP_HEADER(proxy_auth);
+ }
+ else {
+ tsip_header_Authorization_t *auth = tsip_header_Authorization_create();
+ TSIP_AUTH_COPY_VALUES(auth);
+ header = TSIP_HEADER(auth);
+ }
bail:
- TSK_FREE(uristring);
+ TSK_FREE(uristring);
- return header;
+ return header;
#undef TSIP_AUTH_COPY_VALUES
}
tsip_header_t *tsip_challenge_create_empty_header_authorization(const char* username, const char* realm, const char* uristring)
{
- tsip_header_Authorization_t *header = tsip_header_Authorization_create();
-
- if(header){
- header->scheme = tsk_strdup("Digest");
- header->username = tsk_strdup(username);
- header->realm = tsk_strdup(realm);
- header->nonce = tsk_strdup("");
- header->response = tsk_strdup("");
- header->uri = tsk_strdup(uristring);
- }
-
- return TSIP_HEADER(header);
+ tsip_header_Authorization_t *header = tsip_header_Authorization_create();
+
+ if(header) {
+ header->scheme = tsk_strdup("Digest");
+ header->username = tsk_strdup(username);
+ header->realm = tsk_strdup(realm);
+ header->nonce = tsk_strdup("");
+ header->response = tsk_strdup("");
+ header->uri = tsk_strdup(uristring);
+ }
+
+ return TSIP_HEADER(header);
}
@@ -419,59 +418,60 @@ tsip_header_t *tsip_challenge_create_empty_header_authorization(const char* user
*/
static tsk_object_t* tsip_challenge_ctor(tsk_object_t *self, va_list * app)
{
- tsip_challenge_t *challenge = self;
- if(challenge){
- const char* qop;
-
- challenge->stack = va_arg(*app, const tsip_stack_handle_t *);
- challenge->isproxy = va_arg(*app, tsk_bool_t);
- challenge->username = tsk_strdup(((const struct tsip_stack_s*)challenge->stack)->identity.impi);
- challenge->scheme = tsk_strdup(va_arg(*app, const char*));
- challenge->realm = tsk_strdup(va_arg(*app, const char*));
- challenge->nonce = tsk_strdup(va_arg(*app, const char*));
- challenge->opaque = tsk_strdup(va_arg(*app, const char*));
- challenge->algorithm = tsk_strdup(va_arg(*app, const char*));
- qop = va_arg(*app, const char*);
- if(qop){
- challenge->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
- (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
- }
-
- if(challenge->qop){
- tsip_challenge_reset_cnonce(challenge);
- }
- }
- else TSK_DEBUG_ERROR("Failed to create new sip challenge object.");
-
- return self;
+ tsip_challenge_t *challenge = self;
+ if(challenge) {
+ const char* qop;
+
+ challenge->stack = va_arg(*app, const tsip_stack_handle_t *);
+ challenge->isproxy = va_arg(*app, tsk_bool_t);
+ challenge->username = tsk_strdup(((const struct tsip_stack_s*)challenge->stack)->identity.impi);
+ challenge->scheme = tsk_strdup(va_arg(*app, const char*));
+ challenge->realm = tsk_strdup(va_arg(*app, const char*));
+ challenge->nonce = tsk_strdup(va_arg(*app, const char*));
+ challenge->opaque = tsk_strdup(va_arg(*app, const char*));
+ challenge->algorithm = tsk_strdup(va_arg(*app, const char*));
+ qop = va_arg(*app, const char*);
+ if(qop) {
+ challenge->qop = tsk_strcontains(qop, tsk_strlen(qop), "auth-int") ? "auth-int" :
+ (tsk_strcontains(qop, tsk_strlen(qop), "auth") ? "auth" : tsk_null);
+ }
+
+ if(challenge->qop) {
+ tsip_challenge_reset_cnonce(challenge);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new sip challenge object.");
+ }
+
+ return self;
}
/**@ingroup tsip_challenge_group
*/
static tsk_object_t* tsip_challenge_dtor(tsk_object_t *self)
{
- tsip_challenge_t *challenge = self;
- if(challenge){
- TSK_FREE(challenge->username);
- TSK_FREE(challenge->scheme);
- TSK_FREE(challenge->realm);
- TSK_FREE(challenge->nonce);
- TSK_FREE(challenge->opaque);
- TSK_FREE(challenge->algorithm);
- TSK_FREE(challenge->ha1_hexstr);
- }
- else{
- TSK_DEBUG_ERROR("Null SIP challenge object.");
- }
-
- return self;
+ tsip_challenge_t *challenge = self;
+ if(challenge) {
+ TSK_FREE(challenge->username);
+ TSK_FREE(challenge->scheme);
+ TSK_FREE(challenge->realm);
+ TSK_FREE(challenge->nonce);
+ TSK_FREE(challenge->opaque);
+ TSK_FREE(challenge->algorithm);
+ TSK_FREE(challenge->ha1_hexstr);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SIP challenge object.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_challenge_def_s =
-{
- sizeof(tsip_challenge_t),
- tsip_challenge_ctor,
- tsip_challenge_dtor,
- tsk_null
+static const tsk_object_def_t tsip_challenge_def_s = {
+ sizeof(tsip_challenge_t),
+ tsip_challenge_ctor,
+ tsip_challenge_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_challenge_def_t = &tsip_challenge_def_s;
diff --git a/tinySIP/src/authentication/tsip_milenage.c b/tinySIP/src/authentication/tsip_milenage.c
index 3fd19e2..0c95e4a 100755
--- a/tinySIP/src/authentication/tsip_milenage.c
+++ b/tinySIP/src/authentication/tsip_milenage.c
@@ -2,19 +2,19 @@
* Partial Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,7 +42,7 @@
*
* This has been coded for clarity, not necessarily for efficiency.
*
-* The functions f2, f3, f4 and f5 share the same inputs and have
+* The functions f2, f3, f4 and f5 share the same inputs and have
* been coded together as a single function. f1, f1* and f5* are
* all coded separately.
*
@@ -60,7 +60,8 @@
// 0xff, 0x14, 0xc1, 0xf4, 0x5f, 0x88, 0x73, 0x7d};
/*------- Insert your value of OP here -------*/
uint8_t OP[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
/*-------------------------------------------------------------------
* Algorithm f1
@@ -72,58 +73,58 @@ uint8_t OP[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
*
*-----------------------------------------------------------------*/
-void f1 ( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
- uint8_t mac_a[8] )
+void f1 ( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
+ uint8_t mac_a[8] )
{
- uint8_t op_c[16];
- uint8_t temp[16];
- uint8_t in1[16];
- uint8_t out1[16];
- uint8_t rijndaelInput[16];
- uint8_t i;
+ uint8_t op_c[16];
+ uint8_t temp[16];
+ uint8_t in1[16];
+ uint8_t out1[16];
+ uint8_t rijndaelInput[16];
+ uint8_t i;
- RijndaelKeySchedule( k );
+ RijndaelKeySchedule( k );
- ComputeOPc( op_c );
+ ComputeOPc( op_c );
- for (i=0; i<16; i++){
- rijndaelInput[i] = rand[i] ^ op_c[i];
- }
- RijndaelEncrypt( rijndaelInput, temp );
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] = rand[i] ^ op_c[i];
+ }
+ RijndaelEncrypt( rijndaelInput, temp );
- for (i=0; i<6; i++){
- in1[i] = sqn[i];
- in1[i+8] = sqn[i];
- }
+ for (i=0; i<6; i++) {
+ in1[i] = sqn[i];
+ in1[i+8] = sqn[i];
+ }
- for (i=0; i<2; i++){
- in1[i+6] = amf[i];
- in1[i+14] = amf[i];
- }
+ for (i=0; i<2; i++) {
+ in1[i+6] = amf[i];
+ in1[i+14] = amf[i];
+ }
- /* XOR op_c and in1, rotate by r1=64, and XOR *
- * on the constant c1 (which is all zeroes) */
+ /* XOR op_c and in1, rotate by r1=64, and XOR *
+ * on the constant c1 (which is all zeroes) */
- for (i=0; i<16; i++){
- rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i];
- }
+ for (i=0; i<16; i++) {
+ rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i];
+ }
- /* XOR on the value temp computed before */
+ /* XOR on the value temp computed before */
- for (i=0; i<16; i++){
- rijndaelInput[i] ^= temp[i];
- }
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] ^= temp[i];
+ }
- RijndaelEncrypt( rijndaelInput, out1 );
- for (i=0; i<16; i++){
- out1[i] ^= op_c[i];
- }
+ RijndaelEncrypt( rijndaelInput, out1 );
+ for (i=0; i<16; i++) {
+ out1[i] ^= op_c[i];
+ }
- for (i=0; i<8; i++){
- mac_a[i] = out1[i];
- }
+ for (i=0; i<8; i++) {
+ mac_a[i] = out1[i];
+ }
- return;
+ return;
} /* end of function f1 */
@@ -138,81 +139,81 @@ void f1 ( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
*-----------------------------------------------------------------*/
void f2345 ( uint8_t k[16], uint8_t rand[16],
- uint8_t res[8], uint8_t ck[16], uint8_t ik[16], uint8_t ak[6] )
+ uint8_t res[8], uint8_t ck[16], uint8_t ik[16], uint8_t ak[6] )
{
- uint8_t op_c[16];
- uint8_t temp[16];
- uint8_t out[16];
- uint8_t rijndaelInput[16];
- uint8_t i;
-
- RijndaelKeySchedule( k );
-
- ComputeOPc( op_c );
-
- for (i=0; i<16; i++){
- rijndaelInput[i] = rand[i] ^ op_c[i];
- }
- RijndaelEncrypt( rijndaelInput, temp );
-
- /* To obtain output block OUT2: XOR OPc and TEMP, *
- * rotate by r2=0, and XOR on the constant c2 (which *
- * is all zeroes except that the last bit is 1). */
-
- for (i=0; i<16; i++){
- rijndaelInput[i] = temp[i] ^ op_c[i];
- }
- rijndaelInput[15] ^= 1;
-
- RijndaelEncrypt( rijndaelInput, out );
- for (i=0; i<16; i++){
- out[i] ^= op_c[i];
- }
-
- for (i=0; i<8; i++){
- res[i] = out[i+8];
- }
- for (i=0; i<6; i++){
- ak[i] = out[i];
- }
-
- /* To obtain output block OUT3: XOR OPc and TEMP, *
- * rotate by r3=32, and XOR on the constant c3 (which *
- * is all zeroes except that the next to last bit is 1). */
-
- for (i=0; i<16; i++){
- rijndaelInput[(i+12) % 16] = temp[i] ^ op_c[i];
- }
- rijndaelInput[15] ^= 2;
-
- RijndaelEncrypt( rijndaelInput, out );
- for (i=0; i<16; i++){
- out[i] ^= op_c[i];
- }
-
- for (i=0; i<16; i++){
- ck[i] = out[i];
- }
-
- /* To obtain output block OUT4: XOR OPc and TEMP, *
- * rotate by r4=64, and XOR on the constant c4 (which *
- * is all zeroes except that the 2nd from last bit is 1). */
-
- for (i=0; i<16; i++){
- rijndaelInput[(i+8) % 16] = temp[i] ^ op_c[i];
- }
- rijndaelInput[15] ^= 4;
-
- RijndaelEncrypt( rijndaelInput, out );
- for (i=0; i<16; i++){
- out[i] ^= op_c[i];
- }
-
- for (i=0; i<16; i++){
- ik[i] = out[i];
- }
-
- return;
+ uint8_t op_c[16];
+ uint8_t temp[16];
+ uint8_t out[16];
+ uint8_t rijndaelInput[16];
+ uint8_t i;
+
+ RijndaelKeySchedule( k );
+
+ ComputeOPc( op_c );
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] = rand[i] ^ op_c[i];
+ }
+ RijndaelEncrypt( rijndaelInput, temp );
+
+ /* To obtain output block OUT2: XOR OPc and TEMP, *
+ * rotate by r2=0, and XOR on the constant c2 (which *
+ * is all zeroes except that the last bit is 1). */
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] = temp[i] ^ op_c[i];
+ }
+ rijndaelInput[15] ^= 1;
+
+ RijndaelEncrypt( rijndaelInput, out );
+ for (i=0; i<16; i++) {
+ out[i] ^= op_c[i];
+ }
+
+ for (i=0; i<8; i++) {
+ res[i] = out[i+8];
+ }
+ for (i=0; i<6; i++) {
+ ak[i] = out[i];
+ }
+
+ /* To obtain output block OUT3: XOR OPc and TEMP, *
+ * rotate by r3=32, and XOR on the constant c3 (which *
+ * is all zeroes except that the next to last bit is 1). */
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[(i+12) % 16] = temp[i] ^ op_c[i];
+ }
+ rijndaelInput[15] ^= 2;
+
+ RijndaelEncrypt( rijndaelInput, out );
+ for (i=0; i<16; i++) {
+ out[i] ^= op_c[i];
+ }
+
+ for (i=0; i<16; i++) {
+ ck[i] = out[i];
+ }
+
+ /* To obtain output block OUT4: XOR OPc and TEMP, *
+ * rotate by r4=64, and XOR on the constant c4 (which *
+ * is all zeroes except that the 2nd from last bit is 1). */
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[(i+8) % 16] = temp[i] ^ op_c[i];
+ }
+ rijndaelInput[15] ^= 4;
+
+ RijndaelEncrypt( rijndaelInput, out );
+ for (i=0; i<16; i++) {
+ out[i] ^= op_c[i];
+ }
+
+ for (i=0; i<16; i++) {
+ ik[i] = out[i];
+ }
+
+ return;
} /* end of function f2345 */
@@ -226,57 +227,57 @@ void f2345 ( uint8_t k[16], uint8_t rand[16],
*
*-----------------------------------------------------------------*/
-void f1star( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
- uint8_t mac_s[8] )
+void f1star( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
+ uint8_t mac_s[8] )
{
- uint8_t op_c[16];
- uint8_t temp[16];
- uint8_t in1[16];
- uint8_t out1[16];
- uint8_t rijndaelInput[16];
- uint8_t i;
-
- RijndaelKeySchedule( k );
-
- ComputeOPc( op_c );
-
- for (i=0; i<16; i++){
- rijndaelInput[i] = rand[i] ^ op_c[i];
- }
- RijndaelEncrypt( rijndaelInput, temp );
-
- for (i=0; i<6; i++){
- in1[i] = sqn[i];
- in1[i+8] = sqn[i];
- }
- for (i=0; i<2; i++){
- in1[i+6] = amf[i];
- in1[i+14] = amf[i];
- }
-
- /* XOR op_c and in1, rotate by r1=64, and XOR *
- * on the constant c1 (which is all zeroes) */
-
- for (i=0; i<16; i++){
- rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i];
- }
-
- /* XOR on the value temp computed before */
-
- for (i=0; i<16; i++){
- rijndaelInput[i] ^= temp[i];
- }
-
- RijndaelEncrypt( rijndaelInput, out1 );
- for (i=0; i<16; i++){
- out1[i] ^= op_c[i];
- }
-
- for (i=0; i<8; i++){
- mac_s[i] = out1[i+8];
- }
-
- return;
+ uint8_t op_c[16];
+ uint8_t temp[16];
+ uint8_t in1[16];
+ uint8_t out1[16];
+ uint8_t rijndaelInput[16];
+ uint8_t i;
+
+ RijndaelKeySchedule( k );
+
+ ComputeOPc( op_c );
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] = rand[i] ^ op_c[i];
+ }
+ RijndaelEncrypt( rijndaelInput, temp );
+
+ for (i=0; i<6; i++) {
+ in1[i] = sqn[i];
+ in1[i+8] = sqn[i];
+ }
+ for (i=0; i<2; i++) {
+ in1[i+6] = amf[i];
+ in1[i+14] = amf[i];
+ }
+
+ /* XOR op_c and in1, rotate by r1=64, and XOR *
+ * on the constant c1 (which is all zeroes) */
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i];
+ }
+
+ /* XOR on the value temp computed before */
+
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] ^= temp[i];
+ }
+
+ RijndaelEncrypt( rijndaelInput, out1 );
+ for (i=0; i<16; i++) {
+ out1[i] ^= op_c[i];
+ }
+
+ for (i=0; i<8; i++) {
+ mac_s[i] = out1[i+8];
+ }
+
+ return;
} /* end of function f1star */
@@ -290,38 +291,42 @@ void f1star( uint8_t k[16], uint8_t rand[16], uint8_t sqn[6], uint8_t amf[2],
*-----------------------------------------------------------------*/
void f5star( uint8_t k[16], uint8_t rand[16],
- uint8_t ak[6] )
+ uint8_t ak[6] )
{
- uint8_t op_c[16];
- uint8_t temp[16];
- uint8_t out[16];
- uint8_t rijndaelInput[16];
- uint8_t i;
+ uint8_t op_c[16];
+ uint8_t temp[16];
+ uint8_t out[16];
+ uint8_t rijndaelInput[16];
+ uint8_t i;
- RijndaelKeySchedule( k );
+ RijndaelKeySchedule( k );
- ComputeOPc( op_c );
+ ComputeOPc( op_c );
- for (i=0; i<16; i++)
- rijndaelInput[i] = rand[i] ^ op_c[i];
- RijndaelEncrypt( rijndaelInput, temp );
+ for (i=0; i<16; i++) {
+ rijndaelInput[i] = rand[i] ^ op_c[i];
+ }
+ RijndaelEncrypt( rijndaelInput, temp );
- /* To obtain output block OUT5: XOR OPc and TEMP, *
- * rotate by r5=96, and XOR on the constant c5 (which *
- * is all zeroes except that the 3rd from last bit is 1). */
+ /* To obtain output block OUT5: XOR OPc and TEMP, *
+ * rotate by r5=96, and XOR on the constant c5 (which *
+ * is all zeroes except that the 3rd from last bit is 1). */
- for (i=0; i<16; i++)
- rijndaelInput[(i+4) % 16] = temp[i] ^ op_c[i];
- rijndaelInput[15] ^= 8;
+ for (i=0; i<16; i++) {
+ rijndaelInput[(i+4) % 16] = temp[i] ^ op_c[i];
+ }
+ rijndaelInput[15] ^= 8;
- RijndaelEncrypt( rijndaelInput, out );
- for (i=0; i<16; i++)
- out[i] ^= op_c[i];
+ RijndaelEncrypt( rijndaelInput, out );
+ for (i=0; i<16; i++) {
+ out[i] ^= op_c[i];
+ }
- for (i=0; i<6; i++)
- ak[i] = out[i];
+ for (i=0; i<6; i++) {
+ ak[i] = out[i];
+ }
- return;
+ return;
} /* end of function f5star */
@@ -332,19 +337,20 @@ already been performed.
void ComputeOPc( uint8_t op_c[16] )
{
- uint8_t i;
+ uint8_t i;
- RijndaelEncrypt( OP, op_c );
- for (i=0; i<16; i++){
- op_c[i] ^= OP[i];
- }
+ RijndaelEncrypt( OP, op_c );
+ for (i=0; i<16; i++) {
+ op_c[i] ^= OP[i];
+ }
- return;
+ return;
} /* end of function ComputeOPc */
-void ComputeOP( uint8_t op[16] ){
- int i;
- for(i=0;i<16;i++){
- OP[i]=op[i];
- }
+void ComputeOP( uint8_t op[16] )
+{
+ int i;
+ for(i=0; i<16; i++) {
+ OP[i]=op[i];
+ }
}
diff --git a/tinySIP/src/authentication/tsip_rijndael.c b/tinySIP/src/authentication/tsip_rijndael.c
index ddcd89f..c0cddff 100755
--- a/tinySIP/src/authentication/tsip_rijndael.c
+++ b/tinySIP/src/authentication/tsip_rijndael.c
@@ -2,19 +2,19 @@
* Partial Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -79,316 +79,316 @@
#elif defined(__GNUC__) && !defined(__APPLE__)
# define __INLINE __inline
#else
-# define __INLINE
+# define __INLINE
#endif
-__INLINE uint32_t byte_swap(uint32_t x){
+__INLINE uint32_t byte_swap(uint32_t x)
+{
return rot1(x) & 0x00ff00ff | rot3(x) & 0xff00ff00;
}
-__INLINE uint32_t u32_in(const uint8_t x[]){
- if(tnet_is_BE()){
- return byte_swap(*(uint32_t*)x);
- }
- else{
- return (*(uint32_t*)(x));
- }
+__INLINE uint32_t u32_in(const uint8_t x[])
+{
+ if(tnet_is_BE()) {
+ return byte_swap(*(uint32_t*)x);
+ }
+ else {
+ return (*(uint32_t*)(x));
+ }
}
-__INLINE void u32_out(uint8_t x[], const uint32_t v){
- if(tnet_is_BE()){
- *(uint32_t*)x = byte_swap(v);
- }
- else{
- (*(uint32_t*)(x) = v);
- }
+__INLINE void u32_out(uint8_t x[], const uint32_t v)
+{
+ if(tnet_is_BE()) {
+ *(uint32_t*)x = byte_swap(v);
+ }
+ else {
+ (*(uint32_t*)(x) = v);
+ }
}
/*--------------- The lookup tables ----------------------------*/
-static uint32_t rnd_con[10] =
-{
- 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36
+static uint32_t rnd_con[10] = {
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36
};
-static uint32_t ft_tab[4][256] =
-{
- {
- 0xA56363C6,0x847C7CF8,0x997777EE,0x8D7B7BF6,0x0DF2F2FF,0xBD6B6BD6,0xB16F6FDE,0x54C5C591,
- 0x50303060,0x03010102,0xA96767CE,0x7D2B2B56,0x19FEFEE7,0x62D7D7B5,0xE6ABAB4D,0x9A7676EC,
- 0x45CACA8F,0x9D82821F,0x40C9C989,0x877D7DFA,0x15FAFAEF,0xEB5959B2,0xC947478E,0x0BF0F0FB,
- 0xECADAD41,0x67D4D4B3,0xFDA2A25F,0xEAAFAF45,0xBF9C9C23,0xF7A4A453,0x967272E4,0x5BC0C09B,
- 0xC2B7B775,0x1CFDFDE1,0xAE93933D,0x6A26264C,0x5A36366C,0x413F3F7E,0x02F7F7F5,0x4FCCCC83,
- 0x5C343468,0xF4A5A551,0x34E5E5D1,0x08F1F1F9,0x937171E2,0x73D8D8AB,0x53313162,0x3F15152A,
- 0x0C040408,0x52C7C795,0x65232346,0x5EC3C39D,0x28181830,0xA1969637,0x0F05050A,0xB59A9A2F,
- 0x0907070E,0x36121224,0x9B80801B,0x3DE2E2DF,0x26EBEBCD,0x6927274E,0xCDB2B27F,0x9F7575EA,
- 0x1B090912,0x9E83831D,0x742C2C58,0x2E1A1A34,0x2D1B1B36,0xB26E6EDC,0xEE5A5AB4,0xFBA0A05B,
- 0xF65252A4,0x4D3B3B76,0x61D6D6B7,0xCEB3B37D,0x7B292952,0x3EE3E3DD,0x712F2F5E,0x97848413,
- 0xF55353A6,0x68D1D1B9,0000000000,0x2CEDEDC1,0x60202040,0x1FFCFCE3,0xC8B1B179,0xED5B5BB6,
- 0xBE6A6AD4,0x46CBCB8D,0xD9BEBE67,0x4B393972,0xDE4A4A94,0xD44C4C98,0xE85858B0,0x4ACFCF85,
- 0x6BD0D0BB,0x2AEFEFC5,0xE5AAAA4F,0x16FBFBED,0xC5434386,0xD74D4D9A,0x55333366,0x94858511,
- 0xCF45458A,0x10F9F9E9,0x06020204,0x817F7FFE,0xF05050A0,0x443C3C78,0xBA9F9F25,0xE3A8A84B,
- 0xF35151A2,0xFEA3A35D,0xC0404080,0x8A8F8F05,0xAD92923F,0xBC9D9D21,0x48383870,0x04F5F5F1,
- 0xDFBCBC63,0xC1B6B677,0x75DADAAF,0x63212142,0x30101020,0x1AFFFFE5,0x0EF3F3FD,0x6DD2D2BF,
- 0x4CCDCD81,0x140C0C18,0x35131326,0x2FECECC3,0xE15F5FBE,0xA2979735,0xCC444488,0x3917172E,
- 0x57C4C493,0xF2A7A755,0x827E7EFC,0x473D3D7A,0xAC6464C8,0xE75D5DBA,0x2B191932,0x957373E6,
- 0xA06060C0,0x98818119,0xD14F4F9E,0x7FDCDCA3,0x66222244,0x7E2A2A54,0xAB90903B,0x8388880B,
- 0xCA46468C,0x29EEEEC7,0xD3B8B86B,0x3C141428,0x79DEDEA7,0xE25E5EBC,0x1D0B0B16,0x76DBDBAD,
- 0x3BE0E0DB,0x56323264,0x4E3A3A74,0x1E0A0A14,0xDB494992,0x0A06060C,0x6C242448,0xE45C5CB8,
- 0x5DC2C29F,0x6ED3D3BD,0xEFACAC43,0xA66262C4,0xA8919139,0xA4959531,0x37E4E4D3,0x8B7979F2,
- 0x32E7E7D5,0x43C8C88B,0x5937376E,0xB76D6DDA,0x8C8D8D01,0x64D5D5B1,0xD24E4E9C,0xE0A9A949,
- 0xB46C6CD8,0xFA5656AC,0x07F4F4F3,0x25EAEACF,0xAF6565CA,0x8E7A7AF4,0xE9AEAE47,0x18080810,
- 0xD5BABA6F,0x887878F0,0x6F25254A,0x722E2E5C,0x241C1C38,0xF1A6A657,0xC7B4B473,0x51C6C697,
- 0x23E8E8CB,0x7CDDDDA1,0x9C7474E8,0x211F1F3E,0xDD4B4B96,0xDCBDBD61,0x868B8B0D,0x858A8A0F,
- 0x907070E0,0x423E3E7C,0xC4B5B571,0xAA6666CC,0xD8484890,0x05030306,0x01F6F6F7,0x120E0E1C,
- 0xA36161C2,0x5F35356A,0xF95757AE,0xD0B9B969,0x91868617,0x58C1C199,0x271D1D3A,0xB99E9E27,
- 0x38E1E1D9,0x13F8F8EB,0xB398982B,0x33111122,0xBB6969D2,0x70D9D9A9,0x898E8E07,0xA7949433,
- 0xB69B9B2D,0x221E1E3C,0x92878715,0x20E9E9C9,0x49CECE87,0xFF5555AA,0x78282850,0x7ADFDFA5,
- 0x8F8C8C03,0xF8A1A159,0x80898909,0x170D0D1A,0xDABFBF65,0x31E6E6D7,0xC6424284,0xB86868D0,
- 0xC3414182,0xB0999929,0x772D2D5A,0x110F0F1E,0xCBB0B07B,0xFC5454A8,0xD6BBBB6D,0x3A16162C
- },
- {
- 0x6363C6A5,0x7C7CF884,0x7777EE99,0x7B7BF68D,0xF2F2FF0D,0x6B6BD6BD,0x6F6FDEB1,0xC5C59154,
- 0x30306050,0x01010203,0x6767CEA9,0x2B2B567D,0xFEFEE719,0xD7D7B562,0xABAB4DE6,0x7676EC9A,
- 0xCACA8F45,0x82821F9D,0xC9C98940,0x7D7DFA87,0xFAFAEF15,0x5959B2EB,0x47478EC9,0xF0F0FB0B,
- 0xADAD41EC,0xD4D4B367,0xA2A25FFD,0xAFAF45EA,0x9C9C23BF,0xA4A453F7,0x7272E496,0xC0C09B5B,
- 0xB7B775C2,0xFDFDE11C,0x93933DAE,0x26264C6A,0x36366C5A,0x3F3F7E41,0xF7F7F502,0xCCCC834F,
- 0x3434685C,0xA5A551F4,0xE5E5D134,0xF1F1F908,0x7171E293,0xD8D8AB73,0x31316253,0x15152A3F,
- 0x0404080C,0xC7C79552,0x23234665,0xC3C39D5E,0x18183028,0x969637A1,0x05050A0F,0x9A9A2FB5,
- 0x07070E09,0x12122436,0x80801B9B,0xE2E2DF3D,0xEBEBCD26,0x27274E69,0xB2B27FCD,0x7575EA9F,
- 0x0909121B,0x83831D9E,0x2C2C5874,0x1A1A342E,0x1B1B362D,0x6E6EDCB2,0x5A5AB4EE,0xA0A05BFB,
- 0x5252A4F6,0x3B3B764D,0xD6D6B761,0xB3B37DCE,0x2929527B,0xE3E3DD3E,0x2F2F5E71,0x84841397,
- 0x5353A6F5,0xD1D1B968,0000000000,0xEDEDC12C,0x20204060,0xFCFCE31F,0xB1B179C8,0x5B5BB6ED,
- 0x6A6AD4BE,0xCBCB8D46,0xBEBE67D9,0x3939724B,0x4A4A94DE,0x4C4C98D4,0x5858B0E8,0xCFCF854A,
- 0xD0D0BB6B,0xEFEFC52A,0xAAAA4FE5,0xFBFBED16,0x434386C5,0x4D4D9AD7,0x33336655,0x85851194,
- 0x45458ACF,0xF9F9E910,0x02020406,0x7F7FFE81,0x5050A0F0,0x3C3C7844,0x9F9F25BA,0xA8A84BE3,
- 0x5151A2F3,0xA3A35DFE,0x404080C0,0x8F8F058A,0x92923FAD,0x9D9D21BC,0x38387048,0xF5F5F104,
- 0xBCBC63DF,0xB6B677C1,0xDADAAF75,0x21214263,0x10102030,0xFFFFE51A,0xF3F3FD0E,0xD2D2BF6D,
- 0xCDCD814C,0x0C0C1814,0x13132635,0xECECC32F,0x5F5FBEE1,0x979735A2,0x444488CC,0x17172E39,
- 0xC4C49357,0xA7A755F2,0x7E7EFC82,0x3D3D7A47,0x6464C8AC,0x5D5DBAE7,0x1919322B,0x7373E695,
- 0x6060C0A0,0x81811998,0x4F4F9ED1,0xDCDCA37F,0x22224466,0x2A2A547E,0x90903BAB,0x88880B83,
- 0x46468CCA,0xEEEEC729,0xB8B86BD3,0x1414283C,0xDEDEA779,0x5E5EBCE2,0x0B0B161D,0xDBDBAD76,
- 0xE0E0DB3B,0x32326456,0x3A3A744E,0x0A0A141E,0x494992DB,0x06060C0A,0x2424486C,0x5C5CB8E4,
- 0xC2C29F5D,0xD3D3BD6E,0xACAC43EF,0x6262C4A6,0x919139A8,0x959531A4,0xE4E4D337,0x7979F28B,
- 0xE7E7D532,0xC8C88B43,0x37376E59,0x6D6DDAB7,0x8D8D018C,0xD5D5B164,0x4E4E9CD2,0xA9A949E0,
- 0x6C6CD8B4,0x5656ACFA,0xF4F4F307,0xEAEACF25,0x6565CAAF,0x7A7AF48E,0xAEAE47E9,0x08081018,
- 0xBABA6FD5,0x7878F088,0x25254A6F,0x2E2E5C72,0x1C1C3824,0xA6A657F1,0xB4B473C7,0xC6C69751,
- 0xE8E8CB23,0xDDDDA17C,0x7474E89C,0x1F1F3E21,0x4B4B96DD,0xBDBD61DC,0x8B8B0D86,0x8A8A0F85,
- 0x7070E090,0x3E3E7C42,0xB5B571C4,0x6666CCAA,0x484890D8,0x03030605,0xF6F6F701,0x0E0E1C12,
- 0x6161C2A3,0x35356A5F,0x5757AEF9,0xB9B969D0,0x86861791,0xC1C19958,0x1D1D3A27,0x9E9E27B9,
- 0xE1E1D938,0xF8F8EB13,0x98982BB3,0x11112233,0x6969D2BB,0xD9D9A970,0x8E8E0789,0x949433A7,
- 0x9B9B2DB6,0x1E1E3C22,0x87871592,0xE9E9C920,0xCECE8749,0x5555AAFF,0x28285078,0xDFDFA57A,
- 0x8C8C038F,0xA1A159F8,0x89890980,0x0D0D1A17,0xBFBF65DA,0xE6E6D731,0x424284C6,0x6868D0B8,
- 0x414182C3,0x999929B0,0x2D2D5A77,0x0F0F1E11,0xB0B07BCB,0x5454A8FC,0xBBBB6DD6,0x16162C3A
- },
- {
- 0x63C6A563,0x7CF8847C,0x77EE9977,0x7BF68D7B,0xF2FF0DF2,0x6BD6BD6B,0x6FDEB16F,0xC59154C5,
- 0x30605030,0x01020301,0x67CEA967,0x2B567D2B,0xFEE719FE,0xD7B562D7,0xAB4DE6AB,0x76EC9A76,
- 0xCA8F45CA,0x821F9D82,0xC98940C9,0x7DFA877D,0xFAEF15FA,0x59B2EB59,0x478EC947,0xF0FB0BF0,
- 0xAD41ECAD,0xD4B367D4,0xA25FFDA2,0xAF45EAAF,0x9C23BF9C,0xA453F7A4,0x72E49672,0xC09B5BC0,
- 0xB775C2B7,0xFDE11CFD,0x933DAE93,0x264C6A26,0x366C5A36,0x3F7E413F,0xF7F502F7,0xCC834FCC,
- 0x34685C34,0xA551F4A5,0xE5D134E5,0xF1F908F1,0x71E29371,0xD8AB73D8,0x31625331,0x152A3F15,
- 0x04080C04,0xC79552C7,0x23466523,0xC39D5EC3,0x18302818,0x9637A196,0x050A0F05,0x9A2FB59A,
- 0x070E0907,0x12243612,0x801B9B80,0xE2DF3DE2,0xEBCD26EB,0x274E6927,0xB27FCDB2,0x75EA9F75,
- 0x09121B09,0x831D9E83,0x2C58742C,0x1A342E1A,0x1B362D1B,0x6EDCB26E,0x5AB4EE5A,0xA05BFBA0,
- 0x52A4F652,0x3B764D3B,0xD6B761D6,0xB37DCEB3,0x29527B29,0xE3DD3EE3,0x2F5E712F,0x84139784,
- 0x53A6F553,0xD1B968D1,0000000000,0xEDC12CED,0x20406020,0xFCE31FFC,0xB179C8B1,0x5BB6ED5B,
- 0x6AD4BE6A,0xCB8D46CB,0xBE67D9BE,0x39724B39,0x4A94DE4A,0x4C98D44C,0x58B0E858,0xCF854ACF,
- 0xD0BB6BD0,0xEFC52AEF,0xAA4FE5AA,0xFBED16FB,0x4386C543,0x4D9AD74D,0x33665533,0x85119485,
- 0x458ACF45,0xF9E910F9,0x02040602,0x7FFE817F,0x50A0F050,0x3C78443C,0x9F25BA9F,0xA84BE3A8,
- 0x51A2F351,0xA35DFEA3,0x4080C040,0x8F058A8F,0x923FAD92,0x9D21BC9D,0x38704838,0xF5F104F5,
- 0xBC63DFBC,0xB677C1B6,0xDAAF75DA,0x21426321,0x10203010,0xFFE51AFF,0xF3FD0EF3,0xD2BF6DD2,
- 0xCD814CCD,0x0C18140C,0x13263513,0xECC32FEC,0x5FBEE15F,0x9735A297,0x4488CC44,0x172E3917,
- 0xC49357C4,0xA755F2A7,0x7EFC827E,0x3D7A473D,0x64C8AC64,0x5DBAE75D,0x19322B19,0x73E69573,
- 0x60C0A060,0x81199881,0x4F9ED14F,0xDCA37FDC,0x22446622,0x2A547E2A,0x903BAB90,0x880B8388,
- 0x468CCA46,0xEEC729EE,0xB86BD3B8,0x14283C14,0xDEA779DE,0x5EBCE25E,0x0B161D0B,0xDBAD76DB,
- 0xE0DB3BE0,0x32645632,0x3A744E3A,0x0A141E0A,0x4992DB49,0x060C0A06,0x24486C24,0x5CB8E45C,
- 0xC29F5DC2,0xD3BD6ED3,0xAC43EFAC,0x62C4A662,0x9139A891,0x9531A495,0xE4D337E4,0x79F28B79,
- 0xE7D532E7,0xC88B43C8,0x376E5937,0x6DDAB76D,0x8D018C8D,0xD5B164D5,0x4E9CD24E,0xA949E0A9,
- 0x6CD8B46C,0x56ACFA56,0xF4F307F4,0xEACF25EA,0x65CAAF65,0x7AF48E7A,0xAE47E9AE,0x08101808,
- 0xBA6FD5BA,0x78F08878,0x254A6F25,0x2E5C722E,0x1C38241C,0xA657F1A6,0xB473C7B4,0xC69751C6,
- 0xE8CB23E8,0xDDA17CDD,0x74E89C74,0x1F3E211F,0x4B96DD4B,0xBD61DCBD,0x8B0D868B,0x8A0F858A,
- 0x70E09070,0x3E7C423E,0xB571C4B5,0x66CCAA66,0x4890D848,0x03060503,0xF6F701F6,0x0E1C120E,
- 0x61C2A361,0x356A5F35,0x57AEF957,0xB969D0B9,0x86179186,0xC19958C1,0x1D3A271D,0x9E27B99E,
- 0xE1D938E1,0xF8EB13F8,0x982BB398,0x11223311,0x69D2BB69,0xD9A970D9,0x8E07898E,0x9433A794,
- 0x9B2DB69B,0x1E3C221E,0x87159287,0xE9C920E9,0xCE8749CE,0x55AAFF55,0x28507828,0xDFA57ADF,
- 0x8C038F8C,0xA159F8A1,0x89098089,0x0D1A170D,0xBF65DABF,0xE6D731E6,0x4284C642,0x68D0B868,
- 0x4182C341,0x9929B099,0x2D5A772D,0x0F1E110F,0xB07BCBB0,0x54A8FC54,0xBB6DD6BB,0x162C3A16
- },
- {
- 0xC6A56363,0xF8847C7C,0xEE997777,0xF68D7B7B,0xFF0DF2F2,0xD6BD6B6B,0xDEB16F6F,0x9154C5C5,
- 0x60503030,0x02030101,0xCEA96767,0x567D2B2B,0xE719FEFE,0xB562D7D7,0x4DE6ABAB,0xEC9A7676,
- 0x8F45CACA,0x1F9D8282,0x8940C9C9,0xFA877D7D,0xEF15FAFA,0xB2EB5959,0x8EC94747,0xFB0BF0F0,
- 0x41ECADAD,0xB367D4D4,0x5FFDA2A2,0x45EAAFAF,0x23BF9C9C,0x53F7A4A4,0xE4967272,0x9B5BC0C0,
- 0x75C2B7B7,0xE11CFDFD,0x3DAE9393,0x4C6A2626,0x6C5A3636,0x7E413F3F,0xF502F7F7,0x834FCCCC,
- 0x685C3434,0x51F4A5A5,0xD134E5E5,0xF908F1F1,0xE2937171,0xAB73D8D8,0x62533131,0x2A3F1515,
- 0x080C0404,0x9552C7C7,0x46652323,0x9D5EC3C3,0x30281818,0x37A19696,0x0A0F0505,0x2FB59A9A,
- 0x0E090707,0x24361212,0x1B9B8080,0xDF3DE2E2,0xCD26EBEB,0x4E692727,0x7FCDB2B2,0xEA9F7575,
- 0x121B0909,0x1D9E8383,0x58742C2C,0x342E1A1A,0x362D1B1B,0xDCB26E6E,0xB4EE5A5A,0x5BFBA0A0,
- 0xA4F65252,0x764D3B3B,0xB761D6D6,0x7DCEB3B3,0x527B2929,0xDD3EE3E3,0x5E712F2F,0x13978484,
- 0xA6F55353,0xB968D1D1,0000000000,0xC12CEDED,0x40602020,0xE31FFCFC,0x79C8B1B1,0xB6ED5B5B,
- 0xD4BE6A6A,0x8D46CBCB,0x67D9BEBE,0x724B3939,0x94DE4A4A,0x98D44C4C,0xB0E85858,0x854ACFCF,
- 0xBB6BD0D0,0xC52AEFEF,0x4FE5AAAA,0xED16FBFB,0x86C54343,0x9AD74D4D,0x66553333,0x11948585,
- 0x8ACF4545,0xE910F9F9,0x04060202,0xFE817F7F,0xA0F05050,0x78443C3C,0x25BA9F9F,0x4BE3A8A8,
- 0xA2F35151,0x5DFEA3A3,0x80C04040,0x058A8F8F,0x3FAD9292,0x21BC9D9D,0x70483838,0xF104F5F5,
- 0x63DFBCBC,0x77C1B6B6,0xAF75DADA,0x42632121,0x20301010,0xE51AFFFF,0xFD0EF3F3,0xBF6DD2D2,
- 0x814CCDCD,0x18140C0C,0x26351313,0xC32FECEC,0xBEE15F5F,0x35A29797,0x88CC4444,0x2E391717,
- 0x9357C4C4,0x55F2A7A7,0xFC827E7E,0x7A473D3D,0xC8AC6464,0xBAE75D5D,0x322B1919,0xE6957373,
- 0xC0A06060,0x19988181,0x9ED14F4F,0xA37FDCDC,0x44662222,0x547E2A2A,0x3BAB9090,0x0B838888,
- 0x8CCA4646,0xC729EEEE,0x6BD3B8B8,0x283C1414,0xA779DEDE,0xBCE25E5E,0x161D0B0B,0xAD76DBDB,
- 0xDB3BE0E0,0x64563232,0x744E3A3A,0x141E0A0A,0x92DB4949,0x0C0A0606,0x486C2424,0xB8E45C5C,
- 0x9F5DC2C2,0xBD6ED3D3,0x43EFACAC,0xC4A66262,0x39A89191,0x31A49595,0xD337E4E4,0xF28B7979,
- 0xD532E7E7,0x8B43C8C8,0x6E593737,0xDAB76D6D,0x018C8D8D,0xB164D5D5,0x9CD24E4E,0x49E0A9A9,
- 0xD8B46C6C,0xACFA5656,0xF307F4F4,0xCF25EAEA,0xCAAF6565,0xF48E7A7A,0x47E9AEAE,0x10180808,
- 0x6FD5BABA,0xF0887878,0x4A6F2525,0x5C722E2E,0x38241C1C,0x57F1A6A6,0x73C7B4B4,0x9751C6C6,
- 0xCB23E8E8,0xA17CDDDD,0xE89C7474,0x3E211F1F,0x96DD4B4B,0x61DCBDBD,0x0D868B8B,0x0F858A8A,
- 0xE0907070,0x7C423E3E,0x71C4B5B5,0xCCAA6666,0x90D84848,0x06050303,0xF701F6F6,0x1C120E0E,
- 0xC2A36161,0x6A5F3535,0xAEF95757,0x69D0B9B9,0x17918686,0x9958C1C1,0x3A271D1D,0x27B99E9E,
- 0xD938E1E1,0xEB13F8F8,0x2BB39898,0x22331111,0xD2BB6969,0xA970D9D9,0x07898E8E,0x33A79494,
- 0x2DB69B9B,0x3C221E1E,0x15928787,0xC920E9E9,0x8749CECE,0xAAFF5555,0x50782828,0xA57ADFDF,
- 0x038F8C8C,0x59F8A1A1,0x09808989,0x1A170D0D,0x65DABFBF,0xD731E6E6,0x84C64242,0xD0B86868,
- 0x82C34141,0x29B09999,0x5A772D2D,0x1E110F0F,0x7BCBB0B0,0xA8FC5454,0x6DD6BBBB,0x2C3A1616
- }
+static uint32_t ft_tab[4][256] = {
+ {
+ 0xA56363C6,0x847C7CF8,0x997777EE,0x8D7B7BF6,0x0DF2F2FF,0xBD6B6BD6,0xB16F6FDE,0x54C5C591,
+ 0x50303060,0x03010102,0xA96767CE,0x7D2B2B56,0x19FEFEE7,0x62D7D7B5,0xE6ABAB4D,0x9A7676EC,
+ 0x45CACA8F,0x9D82821F,0x40C9C989,0x877D7DFA,0x15FAFAEF,0xEB5959B2,0xC947478E,0x0BF0F0FB,
+ 0xECADAD41,0x67D4D4B3,0xFDA2A25F,0xEAAFAF45,0xBF9C9C23,0xF7A4A453,0x967272E4,0x5BC0C09B,
+ 0xC2B7B775,0x1CFDFDE1,0xAE93933D,0x6A26264C,0x5A36366C,0x413F3F7E,0x02F7F7F5,0x4FCCCC83,
+ 0x5C343468,0xF4A5A551,0x34E5E5D1,0x08F1F1F9,0x937171E2,0x73D8D8AB,0x53313162,0x3F15152A,
+ 0x0C040408,0x52C7C795,0x65232346,0x5EC3C39D,0x28181830,0xA1969637,0x0F05050A,0xB59A9A2F,
+ 0x0907070E,0x36121224,0x9B80801B,0x3DE2E2DF,0x26EBEBCD,0x6927274E,0xCDB2B27F,0x9F7575EA,
+ 0x1B090912,0x9E83831D,0x742C2C58,0x2E1A1A34,0x2D1B1B36,0xB26E6EDC,0xEE5A5AB4,0xFBA0A05B,
+ 0xF65252A4,0x4D3B3B76,0x61D6D6B7,0xCEB3B37D,0x7B292952,0x3EE3E3DD,0x712F2F5E,0x97848413,
+ 0xF55353A6,0x68D1D1B9,0000000000,0x2CEDEDC1,0x60202040,0x1FFCFCE3,0xC8B1B179,0xED5B5BB6,
+ 0xBE6A6AD4,0x46CBCB8D,0xD9BEBE67,0x4B393972,0xDE4A4A94,0xD44C4C98,0xE85858B0,0x4ACFCF85,
+ 0x6BD0D0BB,0x2AEFEFC5,0xE5AAAA4F,0x16FBFBED,0xC5434386,0xD74D4D9A,0x55333366,0x94858511,
+ 0xCF45458A,0x10F9F9E9,0x06020204,0x817F7FFE,0xF05050A0,0x443C3C78,0xBA9F9F25,0xE3A8A84B,
+ 0xF35151A2,0xFEA3A35D,0xC0404080,0x8A8F8F05,0xAD92923F,0xBC9D9D21,0x48383870,0x04F5F5F1,
+ 0xDFBCBC63,0xC1B6B677,0x75DADAAF,0x63212142,0x30101020,0x1AFFFFE5,0x0EF3F3FD,0x6DD2D2BF,
+ 0x4CCDCD81,0x140C0C18,0x35131326,0x2FECECC3,0xE15F5FBE,0xA2979735,0xCC444488,0x3917172E,
+ 0x57C4C493,0xF2A7A755,0x827E7EFC,0x473D3D7A,0xAC6464C8,0xE75D5DBA,0x2B191932,0x957373E6,
+ 0xA06060C0,0x98818119,0xD14F4F9E,0x7FDCDCA3,0x66222244,0x7E2A2A54,0xAB90903B,0x8388880B,
+ 0xCA46468C,0x29EEEEC7,0xD3B8B86B,0x3C141428,0x79DEDEA7,0xE25E5EBC,0x1D0B0B16,0x76DBDBAD,
+ 0x3BE0E0DB,0x56323264,0x4E3A3A74,0x1E0A0A14,0xDB494992,0x0A06060C,0x6C242448,0xE45C5CB8,
+ 0x5DC2C29F,0x6ED3D3BD,0xEFACAC43,0xA66262C4,0xA8919139,0xA4959531,0x37E4E4D3,0x8B7979F2,
+ 0x32E7E7D5,0x43C8C88B,0x5937376E,0xB76D6DDA,0x8C8D8D01,0x64D5D5B1,0xD24E4E9C,0xE0A9A949,
+ 0xB46C6CD8,0xFA5656AC,0x07F4F4F3,0x25EAEACF,0xAF6565CA,0x8E7A7AF4,0xE9AEAE47,0x18080810,
+ 0xD5BABA6F,0x887878F0,0x6F25254A,0x722E2E5C,0x241C1C38,0xF1A6A657,0xC7B4B473,0x51C6C697,
+ 0x23E8E8CB,0x7CDDDDA1,0x9C7474E8,0x211F1F3E,0xDD4B4B96,0xDCBDBD61,0x868B8B0D,0x858A8A0F,
+ 0x907070E0,0x423E3E7C,0xC4B5B571,0xAA6666CC,0xD8484890,0x05030306,0x01F6F6F7,0x120E0E1C,
+ 0xA36161C2,0x5F35356A,0xF95757AE,0xD0B9B969,0x91868617,0x58C1C199,0x271D1D3A,0xB99E9E27,
+ 0x38E1E1D9,0x13F8F8EB,0xB398982B,0x33111122,0xBB6969D2,0x70D9D9A9,0x898E8E07,0xA7949433,
+ 0xB69B9B2D,0x221E1E3C,0x92878715,0x20E9E9C9,0x49CECE87,0xFF5555AA,0x78282850,0x7ADFDFA5,
+ 0x8F8C8C03,0xF8A1A159,0x80898909,0x170D0D1A,0xDABFBF65,0x31E6E6D7,0xC6424284,0xB86868D0,
+ 0xC3414182,0xB0999929,0x772D2D5A,0x110F0F1E,0xCBB0B07B,0xFC5454A8,0xD6BBBB6D,0x3A16162C
+ },
+ {
+ 0x6363C6A5,0x7C7CF884,0x7777EE99,0x7B7BF68D,0xF2F2FF0D,0x6B6BD6BD,0x6F6FDEB1,0xC5C59154,
+ 0x30306050,0x01010203,0x6767CEA9,0x2B2B567D,0xFEFEE719,0xD7D7B562,0xABAB4DE6,0x7676EC9A,
+ 0xCACA8F45,0x82821F9D,0xC9C98940,0x7D7DFA87,0xFAFAEF15,0x5959B2EB,0x47478EC9,0xF0F0FB0B,
+ 0xADAD41EC,0xD4D4B367,0xA2A25FFD,0xAFAF45EA,0x9C9C23BF,0xA4A453F7,0x7272E496,0xC0C09B5B,
+ 0xB7B775C2,0xFDFDE11C,0x93933DAE,0x26264C6A,0x36366C5A,0x3F3F7E41,0xF7F7F502,0xCCCC834F,
+ 0x3434685C,0xA5A551F4,0xE5E5D134,0xF1F1F908,0x7171E293,0xD8D8AB73,0x31316253,0x15152A3F,
+ 0x0404080C,0xC7C79552,0x23234665,0xC3C39D5E,0x18183028,0x969637A1,0x05050A0F,0x9A9A2FB5,
+ 0x07070E09,0x12122436,0x80801B9B,0xE2E2DF3D,0xEBEBCD26,0x27274E69,0xB2B27FCD,0x7575EA9F,
+ 0x0909121B,0x83831D9E,0x2C2C5874,0x1A1A342E,0x1B1B362D,0x6E6EDCB2,0x5A5AB4EE,0xA0A05BFB,
+ 0x5252A4F6,0x3B3B764D,0xD6D6B761,0xB3B37DCE,0x2929527B,0xE3E3DD3E,0x2F2F5E71,0x84841397,
+ 0x5353A6F5,0xD1D1B968,0000000000,0xEDEDC12C,0x20204060,0xFCFCE31F,0xB1B179C8,0x5B5BB6ED,
+ 0x6A6AD4BE,0xCBCB8D46,0xBEBE67D9,0x3939724B,0x4A4A94DE,0x4C4C98D4,0x5858B0E8,0xCFCF854A,
+ 0xD0D0BB6B,0xEFEFC52A,0xAAAA4FE5,0xFBFBED16,0x434386C5,0x4D4D9AD7,0x33336655,0x85851194,
+ 0x45458ACF,0xF9F9E910,0x02020406,0x7F7FFE81,0x5050A0F0,0x3C3C7844,0x9F9F25BA,0xA8A84BE3,
+ 0x5151A2F3,0xA3A35DFE,0x404080C0,0x8F8F058A,0x92923FAD,0x9D9D21BC,0x38387048,0xF5F5F104,
+ 0xBCBC63DF,0xB6B677C1,0xDADAAF75,0x21214263,0x10102030,0xFFFFE51A,0xF3F3FD0E,0xD2D2BF6D,
+ 0xCDCD814C,0x0C0C1814,0x13132635,0xECECC32F,0x5F5FBEE1,0x979735A2,0x444488CC,0x17172E39,
+ 0xC4C49357,0xA7A755F2,0x7E7EFC82,0x3D3D7A47,0x6464C8AC,0x5D5DBAE7,0x1919322B,0x7373E695,
+ 0x6060C0A0,0x81811998,0x4F4F9ED1,0xDCDCA37F,0x22224466,0x2A2A547E,0x90903BAB,0x88880B83,
+ 0x46468CCA,0xEEEEC729,0xB8B86BD3,0x1414283C,0xDEDEA779,0x5E5EBCE2,0x0B0B161D,0xDBDBAD76,
+ 0xE0E0DB3B,0x32326456,0x3A3A744E,0x0A0A141E,0x494992DB,0x06060C0A,0x2424486C,0x5C5CB8E4,
+ 0xC2C29F5D,0xD3D3BD6E,0xACAC43EF,0x6262C4A6,0x919139A8,0x959531A4,0xE4E4D337,0x7979F28B,
+ 0xE7E7D532,0xC8C88B43,0x37376E59,0x6D6DDAB7,0x8D8D018C,0xD5D5B164,0x4E4E9CD2,0xA9A949E0,
+ 0x6C6CD8B4,0x5656ACFA,0xF4F4F307,0xEAEACF25,0x6565CAAF,0x7A7AF48E,0xAEAE47E9,0x08081018,
+ 0xBABA6FD5,0x7878F088,0x25254A6F,0x2E2E5C72,0x1C1C3824,0xA6A657F1,0xB4B473C7,0xC6C69751,
+ 0xE8E8CB23,0xDDDDA17C,0x7474E89C,0x1F1F3E21,0x4B4B96DD,0xBDBD61DC,0x8B8B0D86,0x8A8A0F85,
+ 0x7070E090,0x3E3E7C42,0xB5B571C4,0x6666CCAA,0x484890D8,0x03030605,0xF6F6F701,0x0E0E1C12,
+ 0x6161C2A3,0x35356A5F,0x5757AEF9,0xB9B969D0,0x86861791,0xC1C19958,0x1D1D3A27,0x9E9E27B9,
+ 0xE1E1D938,0xF8F8EB13,0x98982BB3,0x11112233,0x6969D2BB,0xD9D9A970,0x8E8E0789,0x949433A7,
+ 0x9B9B2DB6,0x1E1E3C22,0x87871592,0xE9E9C920,0xCECE8749,0x5555AAFF,0x28285078,0xDFDFA57A,
+ 0x8C8C038F,0xA1A159F8,0x89890980,0x0D0D1A17,0xBFBF65DA,0xE6E6D731,0x424284C6,0x6868D0B8,
+ 0x414182C3,0x999929B0,0x2D2D5A77,0x0F0F1E11,0xB0B07BCB,0x5454A8FC,0xBBBB6DD6,0x16162C3A
+ },
+ {
+ 0x63C6A563,0x7CF8847C,0x77EE9977,0x7BF68D7B,0xF2FF0DF2,0x6BD6BD6B,0x6FDEB16F,0xC59154C5,
+ 0x30605030,0x01020301,0x67CEA967,0x2B567D2B,0xFEE719FE,0xD7B562D7,0xAB4DE6AB,0x76EC9A76,
+ 0xCA8F45CA,0x821F9D82,0xC98940C9,0x7DFA877D,0xFAEF15FA,0x59B2EB59,0x478EC947,0xF0FB0BF0,
+ 0xAD41ECAD,0xD4B367D4,0xA25FFDA2,0xAF45EAAF,0x9C23BF9C,0xA453F7A4,0x72E49672,0xC09B5BC0,
+ 0xB775C2B7,0xFDE11CFD,0x933DAE93,0x264C6A26,0x366C5A36,0x3F7E413F,0xF7F502F7,0xCC834FCC,
+ 0x34685C34,0xA551F4A5,0xE5D134E5,0xF1F908F1,0x71E29371,0xD8AB73D8,0x31625331,0x152A3F15,
+ 0x04080C04,0xC79552C7,0x23466523,0xC39D5EC3,0x18302818,0x9637A196,0x050A0F05,0x9A2FB59A,
+ 0x070E0907,0x12243612,0x801B9B80,0xE2DF3DE2,0xEBCD26EB,0x274E6927,0xB27FCDB2,0x75EA9F75,
+ 0x09121B09,0x831D9E83,0x2C58742C,0x1A342E1A,0x1B362D1B,0x6EDCB26E,0x5AB4EE5A,0xA05BFBA0,
+ 0x52A4F652,0x3B764D3B,0xD6B761D6,0xB37DCEB3,0x29527B29,0xE3DD3EE3,0x2F5E712F,0x84139784,
+ 0x53A6F553,0xD1B968D1,0000000000,0xEDC12CED,0x20406020,0xFCE31FFC,0xB179C8B1,0x5BB6ED5B,
+ 0x6AD4BE6A,0xCB8D46CB,0xBE67D9BE,0x39724B39,0x4A94DE4A,0x4C98D44C,0x58B0E858,0xCF854ACF,
+ 0xD0BB6BD0,0xEFC52AEF,0xAA4FE5AA,0xFBED16FB,0x4386C543,0x4D9AD74D,0x33665533,0x85119485,
+ 0x458ACF45,0xF9E910F9,0x02040602,0x7FFE817F,0x50A0F050,0x3C78443C,0x9F25BA9F,0xA84BE3A8,
+ 0x51A2F351,0xA35DFEA3,0x4080C040,0x8F058A8F,0x923FAD92,0x9D21BC9D,0x38704838,0xF5F104F5,
+ 0xBC63DFBC,0xB677C1B6,0xDAAF75DA,0x21426321,0x10203010,0xFFE51AFF,0xF3FD0EF3,0xD2BF6DD2,
+ 0xCD814CCD,0x0C18140C,0x13263513,0xECC32FEC,0x5FBEE15F,0x9735A297,0x4488CC44,0x172E3917,
+ 0xC49357C4,0xA755F2A7,0x7EFC827E,0x3D7A473D,0x64C8AC64,0x5DBAE75D,0x19322B19,0x73E69573,
+ 0x60C0A060,0x81199881,0x4F9ED14F,0xDCA37FDC,0x22446622,0x2A547E2A,0x903BAB90,0x880B8388,
+ 0x468CCA46,0xEEC729EE,0xB86BD3B8,0x14283C14,0xDEA779DE,0x5EBCE25E,0x0B161D0B,0xDBAD76DB,
+ 0xE0DB3BE0,0x32645632,0x3A744E3A,0x0A141E0A,0x4992DB49,0x060C0A06,0x24486C24,0x5CB8E45C,
+ 0xC29F5DC2,0xD3BD6ED3,0xAC43EFAC,0x62C4A662,0x9139A891,0x9531A495,0xE4D337E4,0x79F28B79,
+ 0xE7D532E7,0xC88B43C8,0x376E5937,0x6DDAB76D,0x8D018C8D,0xD5B164D5,0x4E9CD24E,0xA949E0A9,
+ 0x6CD8B46C,0x56ACFA56,0xF4F307F4,0xEACF25EA,0x65CAAF65,0x7AF48E7A,0xAE47E9AE,0x08101808,
+ 0xBA6FD5BA,0x78F08878,0x254A6F25,0x2E5C722E,0x1C38241C,0xA657F1A6,0xB473C7B4,0xC69751C6,
+ 0xE8CB23E8,0xDDA17CDD,0x74E89C74,0x1F3E211F,0x4B96DD4B,0xBD61DCBD,0x8B0D868B,0x8A0F858A,
+ 0x70E09070,0x3E7C423E,0xB571C4B5,0x66CCAA66,0x4890D848,0x03060503,0xF6F701F6,0x0E1C120E,
+ 0x61C2A361,0x356A5F35,0x57AEF957,0xB969D0B9,0x86179186,0xC19958C1,0x1D3A271D,0x9E27B99E,
+ 0xE1D938E1,0xF8EB13F8,0x982BB398,0x11223311,0x69D2BB69,0xD9A970D9,0x8E07898E,0x9433A794,
+ 0x9B2DB69B,0x1E3C221E,0x87159287,0xE9C920E9,0xCE8749CE,0x55AAFF55,0x28507828,0xDFA57ADF,
+ 0x8C038F8C,0xA159F8A1,0x89098089,0x0D1A170D,0xBF65DABF,0xE6D731E6,0x4284C642,0x68D0B868,
+ 0x4182C341,0x9929B099,0x2D5A772D,0x0F1E110F,0xB07BCBB0,0x54A8FC54,0xBB6DD6BB,0x162C3A16
+ },
+ {
+ 0xC6A56363,0xF8847C7C,0xEE997777,0xF68D7B7B,0xFF0DF2F2,0xD6BD6B6B,0xDEB16F6F,0x9154C5C5,
+ 0x60503030,0x02030101,0xCEA96767,0x567D2B2B,0xE719FEFE,0xB562D7D7,0x4DE6ABAB,0xEC9A7676,
+ 0x8F45CACA,0x1F9D8282,0x8940C9C9,0xFA877D7D,0xEF15FAFA,0xB2EB5959,0x8EC94747,0xFB0BF0F0,
+ 0x41ECADAD,0xB367D4D4,0x5FFDA2A2,0x45EAAFAF,0x23BF9C9C,0x53F7A4A4,0xE4967272,0x9B5BC0C0,
+ 0x75C2B7B7,0xE11CFDFD,0x3DAE9393,0x4C6A2626,0x6C5A3636,0x7E413F3F,0xF502F7F7,0x834FCCCC,
+ 0x685C3434,0x51F4A5A5,0xD134E5E5,0xF908F1F1,0xE2937171,0xAB73D8D8,0x62533131,0x2A3F1515,
+ 0x080C0404,0x9552C7C7,0x46652323,0x9D5EC3C3,0x30281818,0x37A19696,0x0A0F0505,0x2FB59A9A,
+ 0x0E090707,0x24361212,0x1B9B8080,0xDF3DE2E2,0xCD26EBEB,0x4E692727,0x7FCDB2B2,0xEA9F7575,
+ 0x121B0909,0x1D9E8383,0x58742C2C,0x342E1A1A,0x362D1B1B,0xDCB26E6E,0xB4EE5A5A,0x5BFBA0A0,
+ 0xA4F65252,0x764D3B3B,0xB761D6D6,0x7DCEB3B3,0x527B2929,0xDD3EE3E3,0x5E712F2F,0x13978484,
+ 0xA6F55353,0xB968D1D1,0000000000,0xC12CEDED,0x40602020,0xE31FFCFC,0x79C8B1B1,0xB6ED5B5B,
+ 0xD4BE6A6A,0x8D46CBCB,0x67D9BEBE,0x724B3939,0x94DE4A4A,0x98D44C4C,0xB0E85858,0x854ACFCF,
+ 0xBB6BD0D0,0xC52AEFEF,0x4FE5AAAA,0xED16FBFB,0x86C54343,0x9AD74D4D,0x66553333,0x11948585,
+ 0x8ACF4545,0xE910F9F9,0x04060202,0xFE817F7F,0xA0F05050,0x78443C3C,0x25BA9F9F,0x4BE3A8A8,
+ 0xA2F35151,0x5DFEA3A3,0x80C04040,0x058A8F8F,0x3FAD9292,0x21BC9D9D,0x70483838,0xF104F5F5,
+ 0x63DFBCBC,0x77C1B6B6,0xAF75DADA,0x42632121,0x20301010,0xE51AFFFF,0xFD0EF3F3,0xBF6DD2D2,
+ 0x814CCDCD,0x18140C0C,0x26351313,0xC32FECEC,0xBEE15F5F,0x35A29797,0x88CC4444,0x2E391717,
+ 0x9357C4C4,0x55F2A7A7,0xFC827E7E,0x7A473D3D,0xC8AC6464,0xBAE75D5D,0x322B1919,0xE6957373,
+ 0xC0A06060,0x19988181,0x9ED14F4F,0xA37FDCDC,0x44662222,0x547E2A2A,0x3BAB9090,0x0B838888,
+ 0x8CCA4646,0xC729EEEE,0x6BD3B8B8,0x283C1414,0xA779DEDE,0xBCE25E5E,0x161D0B0B,0xAD76DBDB,
+ 0xDB3BE0E0,0x64563232,0x744E3A3A,0x141E0A0A,0x92DB4949,0x0C0A0606,0x486C2424,0xB8E45C5C,
+ 0x9F5DC2C2,0xBD6ED3D3,0x43EFACAC,0xC4A66262,0x39A89191,0x31A49595,0xD337E4E4,0xF28B7979,
+ 0xD532E7E7,0x8B43C8C8,0x6E593737,0xDAB76D6D,0x018C8D8D,0xB164D5D5,0x9CD24E4E,0x49E0A9A9,
+ 0xD8B46C6C,0xACFA5656,0xF307F4F4,0xCF25EAEA,0xCAAF6565,0xF48E7A7A,0x47E9AEAE,0x10180808,
+ 0x6FD5BABA,0xF0887878,0x4A6F2525,0x5C722E2E,0x38241C1C,0x57F1A6A6,0x73C7B4B4,0x9751C6C6,
+ 0xCB23E8E8,0xA17CDDDD,0xE89C7474,0x3E211F1F,0x96DD4B4B,0x61DCBDBD,0x0D868B8B,0x0F858A8A,
+ 0xE0907070,0x7C423E3E,0x71C4B5B5,0xCCAA6666,0x90D84848,0x06050303,0xF701F6F6,0x1C120E0E,
+ 0xC2A36161,0x6A5F3535,0xAEF95757,0x69D0B9B9,0x17918686,0x9958C1C1,0x3A271D1D,0x27B99E9E,
+ 0xD938E1E1,0xEB13F8F8,0x2BB39898,0x22331111,0xD2BB6969,0xA970D9D9,0x07898E8E,0x33A79494,
+ 0x2DB69B9B,0x3C221E1E,0x15928787,0xC920E9E9,0x8749CECE,0xAAFF5555,0x50782828,0xA57ADFDF,
+ 0x038F8C8C,0x59F8A1A1,0x09808989,0x1A170D0D,0x65DABFBF,0xD731E6E6,0x84C64242,0xD0B86868,
+ 0x82C34141,0x29B09999,0x5A772D2D,0x1E110F0F,0x7BCBB0B0,0xA8FC5454,0x6DD6BBBB,0x2C3A1616
+ }
};
-static uint32_t fl_tab[4][256] =
-{
- {
- 0x00000063,0x0000007C,0x00000077,0x0000007B,0x000000F2,0x0000006B,0x0000006F,0x000000C5,
- 0x00000030,0x00000001,0x00000067,0x0000002B,0x000000FE,0x000000D7,0x000000AB,0x00000076,
- 0x000000CA,0x00000082,0x000000C9,0x0000007D,0x000000FA,0x00000059,0x00000047,0x000000F0,
- 0x000000AD,0x000000D4,0x000000A2,0x000000AF,0x0000009C,0x000000A4,0x00000072,0x000000C0,
- 0x000000B7,0x000000FD,0x00000093,0x00000026,0x00000036,0x0000003F,0x000000F7,0x000000CC,
- 0x00000034,0x000000A5,0x000000E5,0x000000F1,0x00000071,0x000000D8,0x00000031,0x00000015,
- 0x00000004,0x000000C7,0x00000023,0x000000C3,0x00000018,0x00000096,0x00000005,0x0000009A,
- 0x00000007,0x00000012,0x00000080,0x000000E2,0x000000EB,0x00000027,0x000000B2,0x00000075,
- 0x00000009,0x00000083,0x0000002C,0x0000001A,0x0000001B,0x0000006E,0x0000005A,0x000000A0,
- 0x00000052,0x0000003B,0x000000D6,0x000000B3,0x00000029,0x000000E3,0x0000002F,0x00000084,
- 0x00000053,0x000000D1,0x00000000,0x000000ED,0x00000020,0x000000FC,0x000000B1,0x0000005B,
- 0x0000006A,0x000000CB,0x000000BE,0x00000039,0x0000004A,0x0000004C,0x00000058,0x000000CF,
- 0x000000D0,0x000000EF,0x000000AA,0x000000FB,0x00000043,0x0000004D,0x00000033,0x00000085,
- 0x00000045,0x000000F9,0x00000002,0x0000007F,0x00000050,0x0000003C,0x0000009F,0x000000A8,
- 0x00000051,0x000000A3,0x00000040,0x0000008F,0x00000092,0x0000009D,0x00000038,0x000000F5,
- 0x000000BC,0x000000B6,0x000000DA,0x00000021,0x00000010,0x000000FF,0x000000F3,0x000000D2,
- 0x000000CD,0x0000000C,0x00000013,0x000000EC,0x0000005F,0x00000097,0x00000044,0x00000017,
- 0x000000C4,0x000000A7,0x0000007E,0x0000003D,0x00000064,0x0000005D,0x00000019,0x00000073,
- 0x00000060,0x00000081,0x0000004F,0x000000DC,0x00000022,0x0000002A,0x00000090,0x00000088,
- 0x00000046,0x000000EE,0x000000B8,0x00000014,0x000000DE,0x0000005E,0x0000000B,0x000000DB,
- 0x000000E0,0x00000032,0x0000003A,0x0000000A,0x00000049,0x00000006,0x00000024,0x0000005C,
- 0x000000C2,0x000000D3,0x000000AC,0x00000062,0x00000091,0x00000095,0x000000E4,0x00000079,
- 0x000000E7,0x000000C8,0x00000037,0x0000006D,0x0000008D,0x000000D5,0x0000004E,0x000000A9,
- 0x0000006C,0x00000056,0x000000F4,0x000000EA,0x00000065,0x0000007A,0x000000AE,0x00000008,
- 0x000000BA,0x00000078,0x00000025,0x0000002E,0x0000001C,0x000000A6,0x000000B4,0x000000C6,
- 0x000000E8,0x000000DD,0x00000074,0x0000001F,0x0000004B,0x000000BD,0x0000008B,0x0000008A,
- 0x00000070,0x0000003E,0x000000B5,0x00000066,0x00000048,0x00000003,0x000000F6,0x0000000E,
- 0x00000061,0x00000035,0x00000057,0x000000B9,0x00000086,0x000000C1,0x0000001D,0x0000009E,
- 0x000000E1,0x000000F8,0x00000098,0x00000011,0x00000069,0x000000D9,0x0000008E,0x00000094,
- 0x0000009B,0x0000001E,0x00000087,0x000000E9,0x000000CE,0x00000055,0x00000028,0x000000DF,
- 0x0000008C,0x000000A1,0x00000089,0x0000000D,0x000000BF,0x000000E6,0x00000042,0x00000068,
- 0x00000041,0x00000099,0x0000002D,0x0000000F,0x000000B0,0x00000054,0x000000BB,0x00000016
- },
- {
- 0x00006300,0x00007C00,0x00007700,0x00007B00,0x0000F200,0x00006B00,0x00006F00,0x0000C500,
- 0x00003000,0x00000100,0x00006700,0x00002B00,0x0000FE00,0x0000D700,0x0000AB00,0x00007600,
- 0x0000CA00,0x00008200,0x0000C900,0x00007D00,0x0000FA00,0x00005900,0x00004700,0x0000F000,
- 0x0000AD00,0x0000D400,0x0000A200,0x0000AF00,0x00009C00,0x0000A400,0x00007200,0x0000C000,
- 0x0000B700,0x0000FD00,0x00009300,0x00002600,0x00003600,0x00003F00,0x0000F700,0x0000CC00,
- 0x00003400,0x0000A500,0x0000E500,0x0000F100,0x00007100,0x0000D800,0x00003100,0x00001500,
- 0x00000400,0x0000C700,0x00002300,0x0000C300,0x00001800,0x00009600,0x00000500,0x00009A00,
- 0x00000700,0x00001200,0x00008000,0x0000E200,0x0000EB00,0x00002700,0x0000B200,0x00007500,
- 0x00000900,0x00008300,0x00002C00,0x00001A00,0x00001B00,0x00006E00,0x00005A00,0x0000A000,
- 0x00005200,0x00003B00,0x0000D600,0x0000B300,0x00002900,0x0000E300,0x00002F00,0x00008400,
- 0x00005300,0x0000D100,0000000000,0x0000ED00,0x00002000,0x0000FC00,0x0000B100,0x00005B00,
- 0x00006A00,0x0000CB00,0x0000BE00,0x00003900,0x00004A00,0x00004C00,0x00005800,0x0000CF00,
- 0x0000D000,0x0000EF00,0x0000AA00,0x0000FB00,0x00004300,0x00004D00,0x00003300,0x00008500,
- 0x00004500,0x0000F900,0x00000200,0x00007F00,0x00005000,0x00003C00,0x00009F00,0x0000A800,
- 0x00005100,0x0000A300,0x00004000,0x00008F00,0x00009200,0x00009D00,0x00003800,0x0000F500,
- 0x0000BC00,0x0000B600,0x0000DA00,0x00002100,0x00001000,0x0000FF00,0x0000F300,0x0000D200,
- 0x0000CD00,0x00000C00,0x00001300,0x0000EC00,0x00005F00,0x00009700,0x00004400,0x00001700,
- 0x0000C400,0x0000A700,0x00007E00,0x00003D00,0x00006400,0x00005D00,0x00001900,0x00007300,
- 0x00006000,0x00008100,0x00004F00,0x0000DC00,0x00002200,0x00002A00,0x00009000,0x00008800,
- 0x00004600,0x0000EE00,0x0000B800,0x00001400,0x0000DE00,0x00005E00,0x00000B00,0x0000DB00,
- 0x0000E000,0x00003200,0x00003A00,0x00000A00,0x00004900,0x00000600,0x00002400,0x00005C00,
- 0x0000C200,0x0000D300,0x0000AC00,0x00006200,0x00009100,0x00009500,0x0000E400,0x00007900,
- 0x0000E700,0x0000C800,0x00003700,0x00006D00,0x00008D00,0x0000D500,0x00004E00,0x0000A900,
- 0x00006C00,0x00005600,0x0000F400,0x0000EA00,0x00006500,0x00007A00,0x0000AE00,0x00000800,
- 0x0000BA00,0x00007800,0x00002500,0x00002E00,0x00001C00,0x0000A600,0x0000B400,0x0000C600,
- 0x0000E800,0x0000DD00,0x00007400,0x00001F00,0x00004B00,0x0000BD00,0x00008B00,0x00008A00,
- 0x00007000,0x00003E00,0x0000B500,0x00006600,0x00004800,0x00000300,0x0000F600,0x00000E00,
- 0x00006100,0x00003500,0x00005700,0x0000B900,0x00008600,0x0000C100,0x00001D00,0x00009E00,
- 0x0000E100,0x0000F800,0x00009800,0x00001100,0x00006900,0x0000D900,0x00008E00,0x00009400,
- 0x00009B00,0x00001E00,0x00008700,0x0000E900,0x0000CE00,0x00005500,0x00002800,0x0000DF00,
- 0x00008C00,0x0000A100,0x00008900,0x00000D00,0x0000BF00,0x0000E600,0x00004200,0x00006800,
- 0x00004100,0x00009900,0x00002D00,0x00000F00,0x0000B000,0x00005400,0x0000BB00,0x00001600
- },
- {
- 0x00630000,0x007C0000,0x00770000,0x007B0000,0x00F20000,0x006B0000,0x006F0000,0x00C50000,
- 0x00300000,0x00010000,0x00670000,0x002B0000,0x00FE0000,0x00D70000,0x00AB0000,0x00760000,
- 0x00CA0000,0x00820000,0x00C90000,0x007D0000,0x00FA0000,0x00590000,0x00470000,0x00F00000,
- 0x00AD0000,0x00D40000,0x00A20000,0x00AF0000,0x009C0000,0x00A40000,0x00720000,0x00C00000,
- 0x00B70000,0x00FD0000,0x00930000,0x00260000,0x00360000,0x003F0000,0x00F70000,0x00CC0000,
- 0x00340000,0x00A50000,0x00E50000,0x00F10000,0x00710000,0x00D80000,0x00310000,0x00150000,
- 0x00040000,0x00C70000,0x00230000,0x00C30000,0x00180000,0x00960000,0x00050000,0x009A0000,
- 0x00070000,0x00120000,0x00800000,0x00E20000,0x00EB0000,0x00270000,0x00B20000,0x00750000,
- 0x00090000,0x00830000,0x002C0000,0x001A0000,0x001B0000,0x006E0000,0x005A0000,0x00A00000,
- 0x00520000,0x003B0000,0x00D60000,0x00B30000,0x00290000,0x00E30000,0x002F0000,0x00840000,
- 0x00530000,0x00D10000,0000000000,0x00ED0000,0x00200000,0x00FC0000,0x00B10000,0x005B0000,
- 0x006A0000,0x00CB0000,0x00BE0000,0x00390000,0x004A0000,0x004C0000,0x00580000,0x00CF0000,
- 0x00D00000,0x00EF0000,0x00AA0000,0x00FB0000,0x00430000,0x004D0000,0x00330000,0x00850000,
- 0x00450000,0x00F90000,0x00020000,0x007F0000,0x00500000,0x003C0000,0x009F0000,0x00A80000,
- 0x00510000,0x00A30000,0x00400000,0x008F0000,0x00920000,0x009D0000,0x00380000,0x00F50000,
- 0x00BC0000,0x00B60000,0x00DA0000,0x00210000,0x00100000,0x00FF0000,0x00F30000,0x00D20000,
- 0x00CD0000,0x000C0000,0x00130000,0x00EC0000,0x005F0000,0x00970000,0x00440000,0x00170000,
- 0x00C40000,0x00A70000,0x007E0000,0x003D0000,0x00640000,0x005D0000,0x00190000,0x00730000,
- 0x00600000,0x00810000,0x004F0000,0x00DC0000,0x00220000,0x002A0000,0x00900000,0x00880000,
- 0x00460000,0x00EE0000,0x00B80000,0x00140000,0x00DE0000,0x005E0000,0x000B0000,0x00DB0000,
- 0x00E00000,0x00320000,0x003A0000,0x000A0000,0x00490000,0x00060000,0x00240000,0x005C0000,
- 0x00C20000,0x00D30000,0x00AC0000,0x00620000,0x00910000,0x00950000,0x00E40000,0x00790000,
- 0x00E70000,0x00C80000,0x00370000,0x006D0000,0x008D0000,0x00D50000,0x004E0000,0x00A90000,
- 0x006C0000,0x00560000,0x00F40000,0x00EA0000,0x00650000,0x007A0000,0x00AE0000,0x00080000,
- 0x00BA0000,0x00780000,0x00250000,0x002E0000,0x001C0000,0x00A60000,0x00B40000,0x00C60000,
- 0x00E80000,0x00DD0000,0x00740000,0x001F0000,0x004B0000,0x00BD0000,0x008B0000,0x008A0000,
- 0x00700000,0x003E0000,0x00B50000,0x00660000,0x00480000,0x00030000,0x00F60000,0x000E0000,
- 0x00610000,0x00350000,0x00570000,0x00B90000,0x00860000,0x00C10000,0x001D0000,0x009E0000,
- 0x00E10000,0x00F80000,0x00980000,0x00110000,0x00690000,0x00D90000,0x008E0000,0x00940000,
- 0x009B0000,0x001E0000,0x00870000,0x00E90000,0x00CE0000,0x00550000,0x00280000,0x00DF0000,
- 0x008C0000,0x00A10000,0x00890000,0x000D0000,0x00BF0000,0x00E60000,0x00420000,0x00680000,
- 0x00410000,0x00990000,0x002D0000,0x000F0000,0x00B00000,0x00540000,0x00BB0000,0x00160000
- },
- {
- 0x63000000,0x7C000000,0x77000000,0x7B000000,0xF2000000,0x6B000000,0x6F000000,0xC5000000,
- 0x30000000,0x01000000,0x67000000,0x2B000000,0xFE000000,0xD7000000,0xAB000000,0x76000000,
- 0xCA000000,0x82000000,0xC9000000,0x7D000000,0xFA000000,0x59000000,0x47000000,0xF0000000,
- 0xAD000000,0xD4000000,0xA2000000,0xAF000000,0x9C000000,0xA4000000,0x72000000,0xC0000000,
- 0xB7000000,0xFD000000,0x93000000,0x26000000,0x36000000,0x3F000000,0xF7000000,0xCC000000,
- 0x34000000,0xA5000000,0xE5000000,0xF1000000,0x71000000,0xD8000000,0x31000000,0x15000000,
- 0x04000000,0xC7000000,0x23000000,0xC3000000,0x18000000,0x96000000,0x05000000,0x9A000000,
- 0x07000000,0x12000000,0x80000000,0xE2000000,0xEB000000,0x27000000,0xB2000000,0x75000000,
- 0x09000000,0x83000000,0x2C000000,0x1A000000,0x1B000000,0x6E000000,0x5A000000,0xA0000000,
- 0x52000000,0x3B000000,0xD6000000,0xB3000000,0x29000000,0xE3000000,0x2F000000,0x84000000,
- 0x53000000,0xD1000000,0000000000,0xED000000,0x20000000,0xFC000000,0xB1000000,0x5B000000,
- 0x6A000000,0xCB000000,0xBE000000,0x39000000,0x4A000000,0x4C000000,0x58000000,0xCF000000,
- 0xD0000000,0xEF000000,0xAA000000,0xFB000000,0x43000000,0x4D000000,0x33000000,0x85000000,
- 0x45000000,0xF9000000,0x02000000,0x7F000000,0x50000000,0x3C000000,0x9F000000,0xA8000000,
- 0x51000000,0xA3000000,0x40000000,0x8F000000,0x92000000,0x9D000000,0x38000000,0xF5000000,
- 0xBC000000,0xB6000000,0xDA000000,0x21000000,0x10000000,0xFF000000,0xF3000000,0xD2000000,
- 0xCD000000,0x0C000000,0x13000000,0xEC000000,0x5F000000,0x97000000,0x44000000,0x17000000,
- 0xC4000000,0xA7000000,0x7E000000,0x3D000000,0x64000000,0x5D000000,0x19000000,0x73000000,
- 0x60000000,0x81000000,0x4F000000,0xDC000000,0x22000000,0x2A000000,0x90000000,0x88000000,
- 0x46000000,0xEE000000,0xB8000000,0x14000000,0xDE000000,0x5E000000,0x0B000000,0xDB000000,
- 0xE0000000,0x32000000,0x3A000000,0x0A000000,0x49000000,0x06000000,0x24000000,0x5C000000,
- 0xC2000000,0xD3000000,0xAC000000,0x62000000,0x91000000,0x95000000,0xE4000000,0x79000000,
- 0xE7000000,0xC8000000,0x37000000,0x6D000000,0x8D000000,0xD5000000,0x4E000000,0xA9000000,
- 0x6C000000,0x56000000,0xF4000000,0xEA000000,0x65000000,0x7A000000,0xAE000000,0x08000000,
- 0xBA000000,0x78000000,0x25000000,0x2E000000,0x1C000000,0xA6000000,0xB4000000,0xC6000000,
- 0xE8000000,0xDD000000,0x74000000,0x1F000000,0x4B000000,0xBD000000,0x8B000000,0x8A000000,
- 0x70000000,0x3E000000,0xB5000000,0x66000000,0x48000000,0x03000000,0xF6000000,0x0E000000,
- 0x61000000,0x35000000,0x57000000,0xB9000000,0x86000000,0xC1000000,0x1D000000,0x9E000000,
- 0xE1000000,0xF8000000,0x98000000,0x11000000,0x69000000,0xD9000000,0x8E000000,0x94000000,
- 0x9B000000,0x1E000000,0x87000000,0xE9000000,0xCE000000,0x55000000,0x28000000,0xDF000000,
- 0x8C000000,0xA1000000,0x89000000,0x0D000000,0xBF000000,0xE6000000,0x42000000,0x68000000,
- 0x41000000,0x99000000,0x2D000000,0x0F000000,0xB0000000,0x54000000,0xBB000000,0x16000000
- }
+static uint32_t fl_tab[4][256] = {
+ {
+ 0x00000063,0x0000007C,0x00000077,0x0000007B,0x000000F2,0x0000006B,0x0000006F,0x000000C5,
+ 0x00000030,0x00000001,0x00000067,0x0000002B,0x000000FE,0x000000D7,0x000000AB,0x00000076,
+ 0x000000CA,0x00000082,0x000000C9,0x0000007D,0x000000FA,0x00000059,0x00000047,0x000000F0,
+ 0x000000AD,0x000000D4,0x000000A2,0x000000AF,0x0000009C,0x000000A4,0x00000072,0x000000C0,
+ 0x000000B7,0x000000FD,0x00000093,0x00000026,0x00000036,0x0000003F,0x000000F7,0x000000CC,
+ 0x00000034,0x000000A5,0x000000E5,0x000000F1,0x00000071,0x000000D8,0x00000031,0x00000015,
+ 0x00000004,0x000000C7,0x00000023,0x000000C3,0x00000018,0x00000096,0x00000005,0x0000009A,
+ 0x00000007,0x00000012,0x00000080,0x000000E2,0x000000EB,0x00000027,0x000000B2,0x00000075,
+ 0x00000009,0x00000083,0x0000002C,0x0000001A,0x0000001B,0x0000006E,0x0000005A,0x000000A0,
+ 0x00000052,0x0000003B,0x000000D6,0x000000B3,0x00000029,0x000000E3,0x0000002F,0x00000084,
+ 0x00000053,0x000000D1,0x00000000,0x000000ED,0x00000020,0x000000FC,0x000000B1,0x0000005B,
+ 0x0000006A,0x000000CB,0x000000BE,0x00000039,0x0000004A,0x0000004C,0x00000058,0x000000CF,
+ 0x000000D0,0x000000EF,0x000000AA,0x000000FB,0x00000043,0x0000004D,0x00000033,0x00000085,
+ 0x00000045,0x000000F9,0x00000002,0x0000007F,0x00000050,0x0000003C,0x0000009F,0x000000A8,
+ 0x00000051,0x000000A3,0x00000040,0x0000008F,0x00000092,0x0000009D,0x00000038,0x000000F5,
+ 0x000000BC,0x000000B6,0x000000DA,0x00000021,0x00000010,0x000000FF,0x000000F3,0x000000D2,
+ 0x000000CD,0x0000000C,0x00000013,0x000000EC,0x0000005F,0x00000097,0x00000044,0x00000017,
+ 0x000000C4,0x000000A7,0x0000007E,0x0000003D,0x00000064,0x0000005D,0x00000019,0x00000073,
+ 0x00000060,0x00000081,0x0000004F,0x000000DC,0x00000022,0x0000002A,0x00000090,0x00000088,
+ 0x00000046,0x000000EE,0x000000B8,0x00000014,0x000000DE,0x0000005E,0x0000000B,0x000000DB,
+ 0x000000E0,0x00000032,0x0000003A,0x0000000A,0x00000049,0x00000006,0x00000024,0x0000005C,
+ 0x000000C2,0x000000D3,0x000000AC,0x00000062,0x00000091,0x00000095,0x000000E4,0x00000079,
+ 0x000000E7,0x000000C8,0x00000037,0x0000006D,0x0000008D,0x000000D5,0x0000004E,0x000000A9,
+ 0x0000006C,0x00000056,0x000000F4,0x000000EA,0x00000065,0x0000007A,0x000000AE,0x00000008,
+ 0x000000BA,0x00000078,0x00000025,0x0000002E,0x0000001C,0x000000A6,0x000000B4,0x000000C6,
+ 0x000000E8,0x000000DD,0x00000074,0x0000001F,0x0000004B,0x000000BD,0x0000008B,0x0000008A,
+ 0x00000070,0x0000003E,0x000000B5,0x00000066,0x00000048,0x00000003,0x000000F6,0x0000000E,
+ 0x00000061,0x00000035,0x00000057,0x000000B9,0x00000086,0x000000C1,0x0000001D,0x0000009E,
+ 0x000000E1,0x000000F8,0x00000098,0x00000011,0x00000069,0x000000D9,0x0000008E,0x00000094,
+ 0x0000009B,0x0000001E,0x00000087,0x000000E9,0x000000CE,0x00000055,0x00000028,0x000000DF,
+ 0x0000008C,0x000000A1,0x00000089,0x0000000D,0x000000BF,0x000000E6,0x00000042,0x00000068,
+ 0x00000041,0x00000099,0x0000002D,0x0000000F,0x000000B0,0x00000054,0x000000BB,0x00000016
+ },
+ {
+ 0x00006300,0x00007C00,0x00007700,0x00007B00,0x0000F200,0x00006B00,0x00006F00,0x0000C500,
+ 0x00003000,0x00000100,0x00006700,0x00002B00,0x0000FE00,0x0000D700,0x0000AB00,0x00007600,
+ 0x0000CA00,0x00008200,0x0000C900,0x00007D00,0x0000FA00,0x00005900,0x00004700,0x0000F000,
+ 0x0000AD00,0x0000D400,0x0000A200,0x0000AF00,0x00009C00,0x0000A400,0x00007200,0x0000C000,
+ 0x0000B700,0x0000FD00,0x00009300,0x00002600,0x00003600,0x00003F00,0x0000F700,0x0000CC00,
+ 0x00003400,0x0000A500,0x0000E500,0x0000F100,0x00007100,0x0000D800,0x00003100,0x00001500,
+ 0x00000400,0x0000C700,0x00002300,0x0000C300,0x00001800,0x00009600,0x00000500,0x00009A00,
+ 0x00000700,0x00001200,0x00008000,0x0000E200,0x0000EB00,0x00002700,0x0000B200,0x00007500,
+ 0x00000900,0x00008300,0x00002C00,0x00001A00,0x00001B00,0x00006E00,0x00005A00,0x0000A000,
+ 0x00005200,0x00003B00,0x0000D600,0x0000B300,0x00002900,0x0000E300,0x00002F00,0x00008400,
+ 0x00005300,0x0000D100,0000000000,0x0000ED00,0x00002000,0x0000FC00,0x0000B100,0x00005B00,
+ 0x00006A00,0x0000CB00,0x0000BE00,0x00003900,0x00004A00,0x00004C00,0x00005800,0x0000CF00,
+ 0x0000D000,0x0000EF00,0x0000AA00,0x0000FB00,0x00004300,0x00004D00,0x00003300,0x00008500,
+ 0x00004500,0x0000F900,0x00000200,0x00007F00,0x00005000,0x00003C00,0x00009F00,0x0000A800,
+ 0x00005100,0x0000A300,0x00004000,0x00008F00,0x00009200,0x00009D00,0x00003800,0x0000F500,
+ 0x0000BC00,0x0000B600,0x0000DA00,0x00002100,0x00001000,0x0000FF00,0x0000F300,0x0000D200,
+ 0x0000CD00,0x00000C00,0x00001300,0x0000EC00,0x00005F00,0x00009700,0x00004400,0x00001700,
+ 0x0000C400,0x0000A700,0x00007E00,0x00003D00,0x00006400,0x00005D00,0x00001900,0x00007300,
+ 0x00006000,0x00008100,0x00004F00,0x0000DC00,0x00002200,0x00002A00,0x00009000,0x00008800,
+ 0x00004600,0x0000EE00,0x0000B800,0x00001400,0x0000DE00,0x00005E00,0x00000B00,0x0000DB00,
+ 0x0000E000,0x00003200,0x00003A00,0x00000A00,0x00004900,0x00000600,0x00002400,0x00005C00,
+ 0x0000C200,0x0000D300,0x0000AC00,0x00006200,0x00009100,0x00009500,0x0000E400,0x00007900,
+ 0x0000E700,0x0000C800,0x00003700,0x00006D00,0x00008D00,0x0000D500,0x00004E00,0x0000A900,
+ 0x00006C00,0x00005600,0x0000F400,0x0000EA00,0x00006500,0x00007A00,0x0000AE00,0x00000800,
+ 0x0000BA00,0x00007800,0x00002500,0x00002E00,0x00001C00,0x0000A600,0x0000B400,0x0000C600,
+ 0x0000E800,0x0000DD00,0x00007400,0x00001F00,0x00004B00,0x0000BD00,0x00008B00,0x00008A00,
+ 0x00007000,0x00003E00,0x0000B500,0x00006600,0x00004800,0x00000300,0x0000F600,0x00000E00,
+ 0x00006100,0x00003500,0x00005700,0x0000B900,0x00008600,0x0000C100,0x00001D00,0x00009E00,
+ 0x0000E100,0x0000F800,0x00009800,0x00001100,0x00006900,0x0000D900,0x00008E00,0x00009400,
+ 0x00009B00,0x00001E00,0x00008700,0x0000E900,0x0000CE00,0x00005500,0x00002800,0x0000DF00,
+ 0x00008C00,0x0000A100,0x00008900,0x00000D00,0x0000BF00,0x0000E600,0x00004200,0x00006800,
+ 0x00004100,0x00009900,0x00002D00,0x00000F00,0x0000B000,0x00005400,0x0000BB00,0x00001600
+ },
+ {
+ 0x00630000,0x007C0000,0x00770000,0x007B0000,0x00F20000,0x006B0000,0x006F0000,0x00C50000,
+ 0x00300000,0x00010000,0x00670000,0x002B0000,0x00FE0000,0x00D70000,0x00AB0000,0x00760000,
+ 0x00CA0000,0x00820000,0x00C90000,0x007D0000,0x00FA0000,0x00590000,0x00470000,0x00F00000,
+ 0x00AD0000,0x00D40000,0x00A20000,0x00AF0000,0x009C0000,0x00A40000,0x00720000,0x00C00000,
+ 0x00B70000,0x00FD0000,0x00930000,0x00260000,0x00360000,0x003F0000,0x00F70000,0x00CC0000,
+ 0x00340000,0x00A50000,0x00E50000,0x00F10000,0x00710000,0x00D80000,0x00310000,0x00150000,
+ 0x00040000,0x00C70000,0x00230000,0x00C30000,0x00180000,0x00960000,0x00050000,0x009A0000,
+ 0x00070000,0x00120000,0x00800000,0x00E20000,0x00EB0000,0x00270000,0x00B20000,0x00750000,
+ 0x00090000,0x00830000,0x002C0000,0x001A0000,0x001B0000,0x006E0000,0x005A0000,0x00A00000,
+ 0x00520000,0x003B0000,0x00D60000,0x00B30000,0x00290000,0x00E30000,0x002F0000,0x00840000,
+ 0x00530000,0x00D10000,0000000000,0x00ED0000,0x00200000,0x00FC0000,0x00B10000,0x005B0000,
+ 0x006A0000,0x00CB0000,0x00BE0000,0x00390000,0x004A0000,0x004C0000,0x00580000,0x00CF0000,
+ 0x00D00000,0x00EF0000,0x00AA0000,0x00FB0000,0x00430000,0x004D0000,0x00330000,0x00850000,
+ 0x00450000,0x00F90000,0x00020000,0x007F0000,0x00500000,0x003C0000,0x009F0000,0x00A80000,
+ 0x00510000,0x00A30000,0x00400000,0x008F0000,0x00920000,0x009D0000,0x00380000,0x00F50000,
+ 0x00BC0000,0x00B60000,0x00DA0000,0x00210000,0x00100000,0x00FF0000,0x00F30000,0x00D20000,
+ 0x00CD0000,0x000C0000,0x00130000,0x00EC0000,0x005F0000,0x00970000,0x00440000,0x00170000,
+ 0x00C40000,0x00A70000,0x007E0000,0x003D0000,0x00640000,0x005D0000,0x00190000,0x00730000,
+ 0x00600000,0x00810000,0x004F0000,0x00DC0000,0x00220000,0x002A0000,0x00900000,0x00880000,
+ 0x00460000,0x00EE0000,0x00B80000,0x00140000,0x00DE0000,0x005E0000,0x000B0000,0x00DB0000,
+ 0x00E00000,0x00320000,0x003A0000,0x000A0000,0x00490000,0x00060000,0x00240000,0x005C0000,
+ 0x00C20000,0x00D30000,0x00AC0000,0x00620000,0x00910000,0x00950000,0x00E40000,0x00790000,
+ 0x00E70000,0x00C80000,0x00370000,0x006D0000,0x008D0000,0x00D50000,0x004E0000,0x00A90000,
+ 0x006C0000,0x00560000,0x00F40000,0x00EA0000,0x00650000,0x007A0000,0x00AE0000,0x00080000,
+ 0x00BA0000,0x00780000,0x00250000,0x002E0000,0x001C0000,0x00A60000,0x00B40000,0x00C60000,
+ 0x00E80000,0x00DD0000,0x00740000,0x001F0000,0x004B0000,0x00BD0000,0x008B0000,0x008A0000,
+ 0x00700000,0x003E0000,0x00B50000,0x00660000,0x00480000,0x00030000,0x00F60000,0x000E0000,
+ 0x00610000,0x00350000,0x00570000,0x00B90000,0x00860000,0x00C10000,0x001D0000,0x009E0000,
+ 0x00E10000,0x00F80000,0x00980000,0x00110000,0x00690000,0x00D90000,0x008E0000,0x00940000,
+ 0x009B0000,0x001E0000,0x00870000,0x00E90000,0x00CE0000,0x00550000,0x00280000,0x00DF0000,
+ 0x008C0000,0x00A10000,0x00890000,0x000D0000,0x00BF0000,0x00E60000,0x00420000,0x00680000,
+ 0x00410000,0x00990000,0x002D0000,0x000F0000,0x00B00000,0x00540000,0x00BB0000,0x00160000
+ },
+ {
+ 0x63000000,0x7C000000,0x77000000,0x7B000000,0xF2000000,0x6B000000,0x6F000000,0xC5000000,
+ 0x30000000,0x01000000,0x67000000,0x2B000000,0xFE000000,0xD7000000,0xAB000000,0x76000000,
+ 0xCA000000,0x82000000,0xC9000000,0x7D000000,0xFA000000,0x59000000,0x47000000,0xF0000000,
+ 0xAD000000,0xD4000000,0xA2000000,0xAF000000,0x9C000000,0xA4000000,0x72000000,0xC0000000,
+ 0xB7000000,0xFD000000,0x93000000,0x26000000,0x36000000,0x3F000000,0xF7000000,0xCC000000,
+ 0x34000000,0xA5000000,0xE5000000,0xF1000000,0x71000000,0xD8000000,0x31000000,0x15000000,
+ 0x04000000,0xC7000000,0x23000000,0xC3000000,0x18000000,0x96000000,0x05000000,0x9A000000,
+ 0x07000000,0x12000000,0x80000000,0xE2000000,0xEB000000,0x27000000,0xB2000000,0x75000000,
+ 0x09000000,0x83000000,0x2C000000,0x1A000000,0x1B000000,0x6E000000,0x5A000000,0xA0000000,
+ 0x52000000,0x3B000000,0xD6000000,0xB3000000,0x29000000,0xE3000000,0x2F000000,0x84000000,
+ 0x53000000,0xD1000000,0000000000,0xED000000,0x20000000,0xFC000000,0xB1000000,0x5B000000,
+ 0x6A000000,0xCB000000,0xBE000000,0x39000000,0x4A000000,0x4C000000,0x58000000,0xCF000000,
+ 0xD0000000,0xEF000000,0xAA000000,0xFB000000,0x43000000,0x4D000000,0x33000000,0x85000000,
+ 0x45000000,0xF9000000,0x02000000,0x7F000000,0x50000000,0x3C000000,0x9F000000,0xA8000000,
+ 0x51000000,0xA3000000,0x40000000,0x8F000000,0x92000000,0x9D000000,0x38000000,0xF5000000,
+ 0xBC000000,0xB6000000,0xDA000000,0x21000000,0x10000000,0xFF000000,0xF3000000,0xD2000000,
+ 0xCD000000,0x0C000000,0x13000000,0xEC000000,0x5F000000,0x97000000,0x44000000,0x17000000,
+ 0xC4000000,0xA7000000,0x7E000000,0x3D000000,0x64000000,0x5D000000,0x19000000,0x73000000,
+ 0x60000000,0x81000000,0x4F000000,0xDC000000,0x22000000,0x2A000000,0x90000000,0x88000000,
+ 0x46000000,0xEE000000,0xB8000000,0x14000000,0xDE000000,0x5E000000,0x0B000000,0xDB000000,
+ 0xE0000000,0x32000000,0x3A000000,0x0A000000,0x49000000,0x06000000,0x24000000,0x5C000000,
+ 0xC2000000,0xD3000000,0xAC000000,0x62000000,0x91000000,0x95000000,0xE4000000,0x79000000,
+ 0xE7000000,0xC8000000,0x37000000,0x6D000000,0x8D000000,0xD5000000,0x4E000000,0xA9000000,
+ 0x6C000000,0x56000000,0xF4000000,0xEA000000,0x65000000,0x7A000000,0xAE000000,0x08000000,
+ 0xBA000000,0x78000000,0x25000000,0x2E000000,0x1C000000,0xA6000000,0xB4000000,0xC6000000,
+ 0xE8000000,0xDD000000,0x74000000,0x1F000000,0x4B000000,0xBD000000,0x8B000000,0x8A000000,
+ 0x70000000,0x3E000000,0xB5000000,0x66000000,0x48000000,0x03000000,0xF6000000,0x0E000000,
+ 0x61000000,0x35000000,0x57000000,0xB9000000,0x86000000,0xC1000000,0x1D000000,0x9E000000,
+ 0xE1000000,0xF8000000,0x98000000,0x11000000,0x69000000,0xD9000000,0x8E000000,0x94000000,
+ 0x9B000000,0x1E000000,0x87000000,0xE9000000,0xCE000000,0x55000000,0x28000000,0xDF000000,
+ 0x8C000000,0xA1000000,0x89000000,0x0D000000,0xBF000000,0xE6000000,0x42000000,0x68000000,
+ 0x41000000,0x99000000,0x2D000000,0x0F000000,0xB0000000,0x54000000,0xBB000000,0x16000000
+ }
};
/*----------------- The workspace ------------------------------*/
@@ -432,16 +432,15 @@ void RijndaelKeySchedule(uint8_t key[16])
{
uint32_t t;
uint32_t *ek=Ekey, /* pointer to the expanded key */
- *rc=rnd_con; /* pointer to the round constant */
+ *rc=rnd_con; /* pointer to the round constant */
Ekey[0] = u32_in(key );
Ekey[1] = u32_in(key + 4);
Ekey[2] = u32_in(key + 8);
Ekey[3] = u32_in(key + 12);
- while(ek < Ekey + 40)
- {
- t = rot3(ek[3]);
+ while(ek < Ekey + 40) {
+ t = rot3(ek[3]);
ek[4] = ek[0] ^ ls_box(t) ^ *rc++;
ek[5] = ek[1] ^ ek[4];
ek[6] = ek[2] ^ ek[5];
@@ -463,18 +462,18 @@ void RijndaelEncrypt(uint8_t in[16], uint8_t out[16])
b0[2] = u32_in(in + 8) ^ *kp++;
b0[3] = u32_in(in + 12) ^ *kp++;
- f_round(b1, b0, kp);
+ f_round(b1, b0, kp);
f_round(b0, b1, kp);
- f_round(b1, b0, kp);
+ f_round(b1, b0, kp);
f_round(b0, b1, kp);
- f_round(b1, b0, kp);
+ f_round(b1, b0, kp);
f_round(b0, b1, kp);
- f_round(b1, b0, kp);
+ f_round(b1, b0, kp);
f_round(b0, b1, kp);
- f_round(b1, b0, kp);
+ f_round(b1, b0, kp);
- u32_out(out, lf_rnd(b1, 0) ^ kp[0]);
+ u32_out(out, lf_rnd(b1, 0) ^ kp[0]);
u32_out(out + 4, lf_rnd(b1, 1) ^ kp[1]);
- u32_out(out + 8, lf_rnd(b1, 2) ^ kp[2]);
+ u32_out(out + 8, lf_rnd(b1, 2) ^ kp[2]);
u32_out(out + 12, lf_rnd(b1, 3) ^ kp[3]);
}
diff --git a/tinySIP/src/dialogs/tsip_dialog.c b/tinySIP/src/dialogs/tsip_dialog.c
index 13dcdf4..3f23f0e 100755
--- a/tinySIP/src/dialogs/tsip_dialog.c
+++ b/tinySIP/src/dialogs/tsip_dialog.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -87,363 +87,361 @@ extern tsip_uri_t* tsip_stack_get_contacturi(const tsip_stack_t *self, const cha
tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* method)
{
- tsip_request_t *request = tsk_null;
- tsip_uri_t *to_uri, *from_uri, *request_uri;
- const char *call_id;
- int copy_routes_start = -1; /* NONE */
- const tsk_list_item_t* item;
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- The Call-ID of the request MUST be set to the Call-ID of the dialog.
- */
- call_id = self->callid;
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- Requests within a dialog MUST contain strictly monotonically
- increasing and contiguous CSeq sequence numbers (increasing-by-one)
- in each direction (excepting ACK and CANCEL of course, whose numbers
- equal the requests being acknowledged or cancelled). Therefore, if
- the local sequence number is not empty, the value of the local
- sequence number MUST be incremented by one, and this value MUST be
- placed into the CSeq header field.
- */
- /*if(!tsk_striequals(method, "ACK") && !tsk_striequals(method, "CANCEL"))
- {
- TSIP_DIALOG(self)->cseq_value +=1;
- }
- ===> See send method (cseq will be incremented before sending the request)
- */
-
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- The URI in the To field of the request MUST be set to the remote URI
- from the dialog state. The tag in the To header field of the request
- MUST be set to the remote tag of the dialog ID. The From URI of the
- request MUST be set to the local URI from the dialog state. The tag
- in the From header field of the request MUST be set to the local tag
- of the dialog ID. If the value of the remote or local tags is null,
- the tag parameter MUST be omitted from the To or From header fields,
- respectively.
- */
- to_uri = tsk_object_ref((void*)self->uri_remote);
- from_uri = tsk_object_ref((void*)self->uri_local);
-
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- If the route set is empty, the UAC MUST place the remote target URI
- into the Request-URI. The UAC MUST NOT add a Route header field to
- the request.
- */
- if(TSK_LIST_IS_EMPTY(self->record_routes)){
- request_uri = tsk_object_ref((void*)self->uri_remote_target);
- }
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- If the route set is not empty, and the first URI in the route set
- contains the lr parameter (see Section 19.1.1), the UAC MUST place
- the remote target URI into the Request-URI and MUST include a Route
- header field containing the route set values in order, including all
- parameters.
-
- If the route set is not empty, and its first URI does not contain the
- lr parameter, the UAC MUST place the first URI from the route set
- into the Request-URI, stripping any parameters that are not allowed
- in a Request-URI. The UAC MUST add a Route header field containing
- the remainder of the route set values in order, including all
- parameters. The UAC MUST then place the remote target URI into the
- Route header field as the last value.
-
- For example, if the remote target is sip:user@remoteua and the route
- set contains:
-
- <sip:proxy1>,<sip:proxy2>,<sip:proxy3;lr>,<sip:proxy4>
- */
- else{
- const tsip_uri_t *first_route = ((tsip_header_Record_Route_t*)TSK_LIST_FIRST_DATA(self->record_routes))->uri;
- if(tsk_params_have_param(first_route->params, "lr")){
- request_uri = tsk_object_ref(self->uri_remote_target);
- copy_routes_start = 0; /* Copy all */
- }
- else{
- request_uri = tsk_object_ref((void*)first_route);
- copy_routes_start = 1; /* Copy starting at index 1. */
- }
- }
-
- /*=====================================================================
- */
- request = tsip_request_new(method, request_uri, from_uri, to_uri, call_id, self->cseq_value);
- request->To->tag = tsk_strdup(self->tag_remote);
- request->From->tag = tsk_strdup(self->tag_local);
- request->update = tsk_true; /* Now signal that the message should be updated by the transport layer (Contact, SigComp, IPSec, ...) */
-
-
- /*
- RFC 3261 - 12.2.1.1 Generating the Request
-
- A UAC SHOULD include a Contact header field in any target refresh
- requests within a dialog, and unless there is a need to change it,
- the URI SHOULD be the same as used in previous requests within the
- dialog. If the "secure" flag is true, that URI MUST be a SIPS URI.
- As discussed in Section 12.2.2, a Contact header field in a target
- refresh request updates the remote target URI. This allows a UA to
- provide a new contact address, should its address change during the
- duration of the dialog.
- */
- switch(request->line.request.request_type){
- case tsip_MESSAGE:
- case tsip_PUBLISH:
- case tsip_BYE:
- {
- if(request->line.request.request_type == tsip_PUBLISH) {
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_EXPIRES_VA_ARGS(TSK_TIME_MS_2_S(self->expires)));
- }
- /* add caps in Accept-Contact headers */
- tsk_list_foreach(item, self->ss->caps) {
- const tsk_param_t* param = TSK_PARAM(item->data);
- char* value = tsk_null;
- tsk_sprintf(&value, "*;%s%s%s",
- param->name,
- param->value ? "=" : "",
- param->value ? param->value : "");
- if(value) {
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS("Accept-Contact", value));
- TSK_FREE(value);
- }
- }
- break;
- }
-
- default:
- {
- char* contact = tsk_null;
- tsip_header_Contacts_L_t *hdr_contacts;
-
- if(request->line.request.request_type == tsip_OPTIONS ||
- request->line.request.request_type == tsip_PUBLISH ||
- request->line.request.request_type == tsip_REGISTER){
- /**** with expires */
- tsk_sprintf(&contact, "m: <%s:%s@%s:%d>;expires=%d\r\n",
- "sip",
- from_uri->user_name,
- "127.0.0.1",
- 5060,
-
- TSK_TIME_MS_2_S(self->expires));
- }
- else{
- /**** without expires */
- if(request->line.request.request_type == tsip_SUBSCRIBE){
- /* RFC 3265 - 3.1.1. Subscription Duration
- An "expires" parameter on the "Contact" header has no semantics for SUBSCRIBE and is explicitly
- not equivalent to an "Expires" header in a SUBSCRIBE request or response.
- */
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_EXPIRES_VA_ARGS(TSK_TIME_MS_2_S(self->expires)));
- }
- tsk_sprintf(&contact, "m: <%s:%s@%s:%d%s%s%s%s%s%s%s%s%s>\r\n",
- "sip",
- from_uri->user_name,
- "127.0.0.1",
- 5060,
-
- self->ss->ws.src.host ? ";" : "",
- self->ss->ws.src.host ? "ws-src-ip=" : "",
- self->ss->ws.src.host ? self->ss->ws.src.host : "",
- self->ss->ws.src.port[0] ? ";" : "",
- self->ss->ws.src.port[0] ? "ws-src-port=" : "",
- self->ss->ws.src.port[0] ? self->ss->ws.src.port : "",
- self->ss->ws.src.proto ? ";" : "",
- self->ss->ws.src.proto ? "ws-src-proto=" : "",
- self->ss->ws.src.proto ? self->ss->ws.src.proto : ""
- );
- }
- hdr_contacts = tsip_header_Contact_parse(contact, tsk_strlen(contact));
- if(!TSK_LIST_IS_EMPTY(hdr_contacts)){
- request->Contact = tsk_object_ref(hdr_contacts->head->data);
- }
- TSK_OBJECT_SAFE_FREE(hdr_contacts);
- TSK_FREE(contact);
-
- /* Add capabilities as per RFC 3840 */
- if(request->Contact) {
- tsk_list_foreach(item, self->ss->caps){
- tsk_params_add_param(&TSIP_HEADER(request->Contact)->params, TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value);
- }
- }
-
- break;
- }
- }
-
- /* Update authorizations */
- if(self->state == tsip_initial && TSK_LIST_IS_EMPTY(self->challenges)){
- /* 3GPP TS 33.978 6.2.3.1 Procedures at the UE
- On sending a REGISTER request in order to indicate support for early IMS security procedures, the UE shall not
- include an Authorization header field and not include header fields or header field values as required by RFC3329.
- */
- if(TSIP_REQUEST_IS_REGISTER(request) && !TSIP_DIALOG_GET_STACK(self)->security.earlyIMS){
- /* 3GPP TS 24.229 - 5.1.1.2.2 Initial registration using IMS AKA
- On sending a REGISTER request, the UE shall populate the header fields as follows:
- a) an Authorization header field, with:
- - the "username" header field parameter, set to the value of the private user identity;
- - the "realm" header field parameter, set to the domain name of the home network;
- - the "uri" header field parameter, set to the SIP URI of the domain name of the home network;
- - the "nonce" header field parameter, set to an empty value; and
- - the "response" header field parameter, set to an empty value;
- */
- const char* realm = TSIP_DIALOG_GET_STACK(self)->network.realm ? TSIP_DIALOG_GET_STACK(self)->network.realm->host : "(null)";
- char* request_uri = tsip_uri_tostring(request->line.request.uri, tsk_false, tsk_false);
- tsip_header_t* auth_hdr = tsip_challenge_create_empty_header_authorization(TSIP_DIALOG_GET_STACK(self)->identity.impi, realm, request_uri);
- tsip_message_add_header(request, auth_hdr);
- tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
- TSK_FREE(request_uri);
- }
- }
- else if(!TSK_LIST_IS_EMPTY(self->challenges)){
- tsip_challenge_t *challenge;
- tsip_header_t* auth_hdr;
- tsk_list_foreach(item, self->challenges){
- challenge = item->data;
- auth_hdr = tsip_challenge_create_header_authorization(challenge, request);
- if(auth_hdr){
- tsip_message_add_header(request, auth_hdr);
- tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
- }
- }
- }
-
- /* Update CSeq */
- /* RFC 3261 - 13.2.2.4 2xx Responses
- Generating ACK: The sequence number of the CSeq header field MUST be
- the same as the INVITE being acknowledged, but the CSeq method MUST
- be ACK. The ACK MUST contain the same credentials as the INVITE. If
- the 2xx contains an offer (based on the rules above), the ACK MUST
- carry an answer in its body.
- ==> CSeq number will be added/updated by the caller of this function,
- credentials were added above.
- */
- if(!TSIP_REQUEST_IS_ACK(request) && !TSIP_REQUEST_IS_CANCEL(request)){
- request->CSeq->seq = ++(TSIP_DIALOG(self)->cseq_value);
- }
-
- /* Route generation
- * ==> http://betelco.blogspot.com/2008/11/proxy-and-service-route-discovery-in.html
- * The dialog Routes have been copied above.
-
- 3GPP TS 24.229 - 5.1.2A.1 UE-originating case
-
- The UE shall build a proper preloaded Route header field value for all new dialogs and standalone transactions. The UE
- shall build a list of Route header field values made out of the following, in this order:
- a) the P-CSCF URI containing the IP address or the FQDN learnt through the P-CSCF discovery procedures; and
- b) the P-CSCF port based on the security mechanism in use:
-
- - if IMS AKA or SIP digest with TLS is in use as a security mechanism, the protected server port learnt during
- the registration procedure;
- - if SIP digest without TLS, NASS-IMS bundled authentciation or GPRS-IMS-Bundled authentication is in
- use as a security mechanism, the unprotected server port used during the registration procedure;
- c) and the values received in the Service-Route header field saved from the 200 (OK) response to the last
- registration or re-registration of the public user identity with associated contact address.
- */
- if(!TSIP_REQUEST_IS_REGISTER(request))
- { // According to the above link ==> Initial/Re/De registration do not have routes.
- if(copy_routes_start != -1)
- { /* The dialog already have routes ==> copy them. */
- if(self->state == tsip_early || self->state == tsip_established){
- int32_t index = -1;
- tsk_list_foreach(item, self->record_routes){
- tsip_header_Record_Route_t *record_Route = ((tsip_header_Record_Route_t*)item->data);
- const tsip_uri_t* uri = record_Route->uri;
- tsip_header_Route_t *route = tsk_null;
- if(++index < copy_routes_start || !uri){
- continue;
- }
-
- if((route = tsip_header_Route_create(uri))){
- // copy parameters: see http://code.google.com/p/imsdroid/issues/detail?id=52
- if(!TSK_LIST_IS_EMPTY(TSIP_HEADER_PARAMS(record_Route))){
- if(!TSIP_HEADER_PARAMS(route)){
- TSIP_HEADER_PARAMS(route) = tsk_list_create();
- }
- tsk_list_pushback_list(TSIP_HEADER_PARAMS(route), TSIP_HEADER_PARAMS(record_Route));
- }
-
- tsip_message_add_header(request, TSIP_HEADER(route));
- TSK_OBJECT_SAFE_FREE(route);
- }
- }
- }
- }
- else
- { /* No routes associated to this dialog. */
- if(self->state == tsip_initial || self->state == tsip_early){
- /* GPP TS 24.229 section 5.1.2A [Generic procedures applicable to all methods excluding the REGISTER method]:
- The UE shall build a proper preloaded Route header field value for all new dialogs and standalone transactions. The UE
- shall build a list of Route header field values made out of the following, in this order:
- a) the P-CSCF URI containing the IP address or the FQDN learnt through the P-CSCF discovery procedures; and
- b) the P-CSCF port based on the security mechanism in use:
- - if IMS AKA or SIP digest with TLS is in use as a security mechanism, the protected server port learnt during
- the registration procedure;
- - if SIP digest without TLS, NASS-IMS bundled authentciation or GPRS-IMS-Bundled authentication is in
- use as a security mechanism, the unprotected server port used during the registration procedure;
- c) and the values received in the Service-Route header field saved from the 200 (OK) response to the last
- registration or re-registration of the public user identity with associated contact address.
- */
+ tsip_request_t *request = tsk_null;
+ tsip_uri_t *to_uri, *from_uri, *request_uri;
+ const char *call_id;
+ int copy_routes_start = -1; /* NONE */
+ const tsk_list_item_t* item;
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ The Call-ID of the request MUST be set to the Call-ID of the dialog.
+ */
+ call_id = self->callid;
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ Requests within a dialog MUST contain strictly monotonically
+ increasing and contiguous CSeq sequence numbers (increasing-by-one)
+ in each direction (excepting ACK and CANCEL of course, whose numbers
+ equal the requests being acknowledged or cancelled). Therefore, if
+ the local sequence number is not empty, the value of the local
+ sequence number MUST be incremented by one, and this value MUST be
+ placed into the CSeq header field.
+ */
+ /*if(!tsk_striequals(method, "ACK") && !tsk_striequals(method, "CANCEL"))
+ {
+ TSIP_DIALOG(self)->cseq_value +=1;
+ }
+ ===> See send method (cseq will be incremented before sending the request)
+ */
+
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ The URI in the To field of the request MUST be set to the remote URI
+ from the dialog state. The tag in the To header field of the request
+ MUST be set to the remote tag of the dialog ID. The From URI of the
+ request MUST be set to the local URI from the dialog state. The tag
+ in the From header field of the request MUST be set to the local tag
+ of the dialog ID. If the value of the remote or local tags is null,
+ the tag parameter MUST be omitted from the To or From header fields,
+ respectively.
+ */
+ to_uri = tsk_object_ref((void*)self->uri_remote);
+ from_uri = tsk_object_ref((void*)self->uri_local);
+
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ If the route set is empty, the UAC MUST place the remote target URI
+ into the Request-URI. The UAC MUST NOT add a Route header field to
+ the request.
+ */
+ if(TSK_LIST_IS_EMPTY(self->record_routes)) {
+ request_uri = tsk_object_ref((void*)self->uri_remote_target);
+ }
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ If the route set is not empty, and the first URI in the route set
+ contains the lr parameter (see Section 19.1.1), the UAC MUST place
+ the remote target URI into the Request-URI and MUST include a Route
+ header field containing the route set values in order, including all
+ parameters.
+
+ If the route set is not empty, and its first URI does not contain the
+ lr parameter, the UAC MUST place the first URI from the route set
+ into the Request-URI, stripping any parameters that are not allowed
+ in a Request-URI. The UAC MUST add a Route header field containing
+ the remainder of the route set values in order, including all
+ parameters. The UAC MUST then place the remote target URI into the
+ Route header field as the last value.
+
+ For example, if the remote target is sip:user@remoteua and the route
+ set contains:
+
+ <sip:proxy1>,<sip:proxy2>,<sip:proxy3;lr>,<sip:proxy4>
+ */
+ else {
+ const tsip_uri_t *first_route = ((tsip_header_Record_Route_t*)TSK_LIST_FIRST_DATA(self->record_routes))->uri;
+ if(tsk_params_have_param(first_route->params, "lr")) {
+ request_uri = tsk_object_ref(self->uri_remote_target);
+ copy_routes_start = 0; /* Copy all */
+ }
+ else {
+ request_uri = tsk_object_ref((void*)first_route);
+ copy_routes_start = 1; /* Copy starting at index 1. */
+ }
+ }
+
+ /*=====================================================================
+ */
+ request = tsip_request_new(method, request_uri, from_uri, to_uri, call_id, self->cseq_value);
+ request->To->tag = tsk_strdup(self->tag_remote);
+ request->From->tag = tsk_strdup(self->tag_local);
+ request->update = tsk_true; /* Now signal that the message should be updated by the transport layer (Contact, SigComp, IPSec, ...) */
+
+
+ /*
+ RFC 3261 - 12.2.1.1 Generating the Request
+
+ A UAC SHOULD include a Contact header field in any target refresh
+ requests within a dialog, and unless there is a need to change it,
+ the URI SHOULD be the same as used in previous requests within the
+ dialog. If the "secure" flag is true, that URI MUST be a SIPS URI.
+ As discussed in Section 12.2.2, a Contact header field in a target
+ refresh request updates the remote target URI. This allows a UA to
+ provide a new contact address, should its address change during the
+ duration of the dialog.
+ */
+ switch(request->line.request.request_type) {
+ case tsip_MESSAGE:
+ case tsip_PUBLISH:
+ case tsip_BYE: {
+ if(request->line.request.request_type == tsip_PUBLISH) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_EXPIRES_VA_ARGS(TSK_TIME_MS_2_S(self->expires)));
+ }
+ /* add caps in Accept-Contact headers */
+ tsk_list_foreach(item, self->ss->caps) {
+ const tsk_param_t* param = TSK_PARAM(item->data);
+ char* value = tsk_null;
+ tsk_sprintf(&value, "*;%s%s%s",
+ param->name,
+ param->value ? "=" : "",
+ param->value ? param->value : "");
+ if(value) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS("Accept-Contact", value));
+ TSK_FREE(value);
+ }
+ }
+ break;
+ }
+
+ default: {
+ char* contact = tsk_null;
+ tsip_header_Contacts_L_t *hdr_contacts;
+
+ if(request->line.request.request_type == tsip_OPTIONS ||
+ request->line.request.request_type == tsip_PUBLISH ||
+ request->line.request.request_type == tsip_REGISTER) {
+ /**** with expires */
+ tsk_sprintf(&contact, "m: <%s:%s@%s:%d>;expires=%d\r\n",
+ "sip",
+ from_uri->user_name,
+ "127.0.0.1",
+ 5060,
+
+ TSK_TIME_MS_2_S(self->expires));
+ }
+ else {
+ /**** without expires */
+ if(request->line.request.request_type == tsip_SUBSCRIBE) {
+ /* RFC 3265 - 3.1.1. Subscription Duration
+ An "expires" parameter on the "Contact" header has no semantics for SUBSCRIBE and is explicitly
+ not equivalent to an "Expires" header in a SUBSCRIBE request or response.
+ */
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_EXPIRES_VA_ARGS(TSK_TIME_MS_2_S(self->expires)));
+ }
+ tsk_sprintf(&contact, "m: <%s:%s@%s:%d%s%s%s%s%s%s%s%s%s>\r\n",
+ "sip",
+ from_uri->user_name,
+ "127.0.0.1",
+ 5060,
+
+ self->ss->ws.src.host ? ";" : "",
+ self->ss->ws.src.host ? "ws-src-ip=" : "",
+ self->ss->ws.src.host ? self->ss->ws.src.host : "",
+ self->ss->ws.src.port[0] ? ";" : "",
+ self->ss->ws.src.port[0] ? "ws-src-port=" : "",
+ self->ss->ws.src.port[0] ? self->ss->ws.src.port : "",
+ self->ss->ws.src.proto ? ";" : "",
+ self->ss->ws.src.proto ? "ws-src-proto=" : "",
+ self->ss->ws.src.proto ? self->ss->ws.src.proto : ""
+ );
+ }
+ hdr_contacts = tsip_header_Contact_parse(contact, tsk_strlen(contact));
+ if(!TSK_LIST_IS_EMPTY(hdr_contacts)) {
+ request->Contact = tsk_object_ref(hdr_contacts->head->data);
+ }
+ TSK_OBJECT_SAFE_FREE(hdr_contacts);
+ TSK_FREE(contact);
+
+ /* Add capabilities as per RFC 3840 */
+ if(request->Contact) {
+ tsk_list_foreach(item, self->ss->caps) {
+ tsk_params_add_param(&TSIP_HEADER(request->Contact)->params, TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value);
+ }
+ }
+
+ break;
+ }
+ }
+
+ /* Update authorizations */
+ if(self->state == tsip_initial && TSK_LIST_IS_EMPTY(self->challenges)) {
+ /* 3GPP TS 33.978 6.2.3.1 Procedures at the UE
+ On sending a REGISTER request in order to indicate support for early IMS security procedures, the UE shall not
+ include an Authorization header field and not include header fields or header field values as required by RFC3329.
+ */
+ if(TSIP_REQUEST_IS_REGISTER(request) && !TSIP_DIALOG_GET_STACK(self)->security.earlyIMS) {
+ /* 3GPP TS 24.229 - 5.1.1.2.2 Initial registration using IMS AKA
+ On sending a REGISTER request, the UE shall populate the header fields as follows:
+ a) an Authorization header field, with:
+ - the "username" header field parameter, set to the value of the private user identity;
+ - the "realm" header field parameter, set to the domain name of the home network;
+ - the "uri" header field parameter, set to the SIP URI of the domain name of the home network;
+ - the "nonce" header field parameter, set to an empty value; and
+ - the "response" header field parameter, set to an empty value;
+ */
+ const char* realm = TSIP_DIALOG_GET_STACK(self)->network.realm ? TSIP_DIALOG_GET_STACK(self)->network.realm->host : "(null)";
+ char* request_uri = tsip_uri_tostring(request->line.request.uri, tsk_false, tsk_false);
+ tsip_header_t* auth_hdr = tsip_challenge_create_empty_header_authorization(TSIP_DIALOG_GET_STACK(self)->identity.impi, realm, request_uri);
+ tsip_message_add_header(request, auth_hdr);
+ tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
+ TSK_FREE(request_uri);
+ }
+ }
+ else if(!TSK_LIST_IS_EMPTY(self->challenges)) {
+ tsip_challenge_t *challenge;
+ tsip_header_t* auth_hdr;
+ tsk_list_foreach(item, self->challenges) {
+ challenge = item->data;
+ auth_hdr = tsip_challenge_create_header_authorization(challenge, request);
+ if(auth_hdr) {
+ tsip_message_add_header(request, auth_hdr);
+ tsk_object_unref(auth_hdr), auth_hdr = tsk_null;
+ }
+ }
+ }
+
+ /* Update CSeq */
+ /* RFC 3261 - 13.2.2.4 2xx Responses
+ Generating ACK: The sequence number of the CSeq header field MUST be
+ the same as the INVITE being acknowledged, but the CSeq method MUST
+ be ACK. The ACK MUST contain the same credentials as the INVITE. If
+ the 2xx contains an offer (based on the rules above), the ACK MUST
+ carry an answer in its body.
+ ==> CSeq number will be added/updated by the caller of this function,
+ credentials were added above.
+ */
+ if(!TSIP_REQUEST_IS_ACK(request) && !TSIP_REQUEST_IS_CANCEL(request)) {
+ request->CSeq->seq = ++(TSIP_DIALOG(self)->cseq_value);
+ }
+
+ /* Route generation
+ * ==> http://betelco.blogspot.com/2008/11/proxy-and-service-route-discovery-in.html
+ * The dialog Routes have been copied above.
+
+ 3GPP TS 24.229 - 5.1.2A.1 UE-originating case
+
+ The UE shall build a proper preloaded Route header field value for all new dialogs and standalone transactions. The UE
+ shall build a list of Route header field values made out of the following, in this order:
+ a) the P-CSCF URI containing the IP address or the FQDN learnt through the P-CSCF discovery procedures; and
+ b) the P-CSCF port based on the security mechanism in use:
+
+ - if IMS AKA or SIP digest with TLS is in use as a security mechanism, the protected server port learnt during
+ the registration procedure;
+ - if SIP digest without TLS, NASS-IMS bundled authentciation or GPRS-IMS-Bundled authentication is in
+ use as a security mechanism, the unprotected server port used during the registration procedure;
+ c) and the values received in the Service-Route header field saved from the 200 (OK) response to the last
+ registration or re-registration of the public user identity with associated contact address.
+ */
+ if(!TSIP_REQUEST_IS_REGISTER(request)) {
+ // According to the above link ==> Initial/Re/De registration do not have routes.
+ if(copy_routes_start != -1) {
+ /* The dialog already have routes ==> copy them. */
+ if(self->state == tsip_early || self->state == tsip_established) {
+ int32_t index = -1;
+ tsk_list_foreach(item, self->record_routes) {
+ tsip_header_Record_Route_t *record_Route = ((tsip_header_Record_Route_t*)item->data);
+ const tsip_uri_t* uri = record_Route->uri;
+ tsip_header_Route_t *route = tsk_null;
+ if(++index < copy_routes_start || !uri) {
+ continue;
+ }
+
+ if((route = tsip_header_Route_create(uri))) {
+ // copy parameters: see http://code.google.com/p/imsdroid/issues/detail?id=52
+ if(!TSK_LIST_IS_EMPTY(TSIP_HEADER_PARAMS(record_Route))) {
+ if(!TSIP_HEADER_PARAMS(route)) {
+ TSIP_HEADER_PARAMS(route) = tsk_list_create();
+ }
+ tsk_list_pushback_list(TSIP_HEADER_PARAMS(route), TSIP_HEADER_PARAMS(record_Route));
+ }
+
+ tsip_message_add_header(request, TSIP_HEADER(route));
+ TSK_OBJECT_SAFE_FREE(route);
+ }
+ }
+ }
+ }
+ else {
+ /* No routes associated to this dialog. */
+ if(self->state == tsip_initial || self->state == tsip_early) {
+ /* GPP TS 24.229 section 5.1.2A [Generic procedures applicable to all methods excluding the REGISTER method]:
+ The UE shall build a proper preloaded Route header field value for all new dialogs and standalone transactions. The UE
+ shall build a list of Route header field values made out of the following, in this order:
+ a) the P-CSCF URI containing the IP address or the FQDN learnt through the P-CSCF discovery procedures; and
+ b) the P-CSCF port based on the security mechanism in use:
+ - if IMS AKA or SIP digest with TLS is in use as a security mechanism, the protected server port learnt during
+ the registration procedure;
+ - if SIP digest without TLS, NASS-IMS bundled authentciation or GPRS-IMS-Bundled authentication is in
+ use as a security mechanism, the unprotected server port used during the registration procedure;
+ c) and the values received in the Service-Route header field saved from the 200 (OK) response to the last
+ registration or re-registration of the public user identity with associated contact address.
+ */
#if _DEBUG && defined(SDS_HACK)/* FIXME: remove this */
- /* Ericsson SDS hack (INVITE with Proxy-CSCF as First route fail) */
+ /* Ericsson SDS hack (INVITE with Proxy-CSCF as First route fail) */
#elif 0
- tsip_uri_t *uri = tsip_stack_get_pcscf_uri(TSIP_DIALOG_GET_STACK(self), tsk_true);
- // Proxy-CSCF as first route
- if(uri){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_ROUTE_VA_ARGS(uri));
- TSK_OBJECT_SAFE_FREE(uri);
- }
+ tsip_uri_t *uri = tsip_stack_get_pcscf_uri(TSIP_DIALOG_GET_STACK(self), tsk_true);
+ // Proxy-CSCF as first route
+ if(uri) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_ROUTE_VA_ARGS(uri));
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
#endif
- // Service routes
- tsk_list_foreach(item, TSIP_DIALOG_GET_STACK(self)->service_routes){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_ROUTE_VA_ARGS(item->data));
- }
- }
- }
- }
-
- /* Add headers associated to the session */
- tsip_dialog_add_session_headers(self, request);
-
- /* Add headers associated to the dialog's stack */
- TSIP_DIALOG_ADD_HEADERS(self->ss->stack->headers);
-
- /* Add common headers */
- tsip_dialog_add_common_headers(self, request);
-
- /* SigComp */
- if(self->ss->sigcomp_id){
- /* should be added in this field instead of 'Contact' or 'Via' headers
- * it's up to the transport layer to copy it to these headers */
- request->sigcomp_id = tsk_strdup(self->ss->sigcomp_id);
- }
-
- /* Remote Address: Used if "Server mode" otherwise Proxy-CSCF will be used */
- request->remote_addr = self->remote_addr;
- /* Connected FD */
- if(request->local_fd <= 0) {
- request->local_fd = self->connected_fd;
- }
-
- TSK_OBJECT_SAFE_FREE(request_uri);
- TSK_OBJECT_SAFE_FREE(from_uri);
- TSK_OBJECT_SAFE_FREE(to_uri);
-
- return request;
+ // Service routes
+ tsk_list_foreach(item, TSIP_DIALOG_GET_STACK(self)->service_routes) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_ROUTE_VA_ARGS(item->data));
+ }
+ }
+ }
+ }
+
+ /* Add headers associated to the session */
+ tsip_dialog_add_session_headers(self, request);
+
+ /* Add headers associated to the dialog's stack */
+ TSIP_DIALOG_ADD_HEADERS(self->ss->stack->headers);
+
+ /* Add common headers */
+ tsip_dialog_add_common_headers(self, request);
+
+ /* SigComp */
+ if(self->ss->sigcomp_id) {
+ /* should be added in this field instead of 'Contact' or 'Via' headers
+ * it's up to the transport layer to copy it to these headers */
+ request->sigcomp_id = tsk_strdup(self->ss->sigcomp_id);
+ }
+
+ /* Remote Address: Used if "Server mode" otherwise Proxy-CSCF will be used */
+ request->remote_addr = self->remote_addr;
+ /* Connected FD */
+ if(request->local_fd <= 0) {
+ request->local_fd = self->connected_fd;
+ }
+
+ TSK_OBJECT_SAFE_FREE(request_uri);
+ TSK_OBJECT_SAFE_FREE(from_uri);
+ TSK_OBJECT_SAFE_FREE(to_uri);
+
+ return request;
}
@@ -452,156 +450,155 @@ tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* m
* @param self The parent dialog. All callback events will be notified to this dialog.
* @param request The request to send.
*
- * @return Zero if succeed and no-zero error code otherwise.
+ * @return Zero if succeed and no-zero error code otherwise.
**/
int tsip_dialog_request_send(const tsip_dialog_t *self, tsip_request_t* request)
{
- int ret = -1;
-
- if(self && TSIP_DIALOG_GET_STACK(self)){
- const tsip_transac_layer_t *layer = TSIP_DIALOG_GET_STACK(self)->layer_transac;
- if(layer){
- /* Create new transaction. The new transaction will be added to the transaction layer.
- The transaction has all information to create the right transaction type (NICT or ICT).
- As this is an outgoing request ==> It shall be a client transaction (NICT or ICT).
- For server transactions creation see @ref tsip_dialog_response_send.
- */
- static const tsk_bool_t isCT = tsk_true;
- tsip_transac_t* transac;
- tsip_transac_dst_t* dst;
-
-
- if(TSIP_STACK_MODE_IS_CLIENT(TSIP_DIALOG_GET_STACK(self))){
- const tsip_transport_t* transport = tsip_transport_layer_find_by_idx(TSIP_DIALOG_GET_STACK(self)->layer_transport, TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default);
- if(!transport){
- TSK_DEBUG_ERROR("Failed to find a valid default transport [%d]", TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default);
- }
- else{
- request->dst_net_type = transport->type;
- }
- }
- dst = tsip_transac_dst_dialog_create(TSIP_DIALOG(self));
- transac = tsip_transac_layer_new(
- layer,
- isCT,
- request,
- dst
- );
- TSK_OBJECT_SAFE_FREE(dst);
-
- /* Set the transaction's dialog. All events comming from the transaction (timeouts, errors ...) will be signaled to this dialog */
- if(transac){
- switch(transac->type)
- {
- case tsip_transac_type_ict:
- case tsip_transac_type_nict:
- {
- /* Start the newly create IC/NIC transaction */
- ret = tsip_transac_start(transac, request);
- break;
- }
- default: break;
- }
- TSK_OBJECT_SAFE_FREE(transac);
- }
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self && TSIP_DIALOG_GET_STACK(self)) {
+ const tsip_transac_layer_t *layer = TSIP_DIALOG_GET_STACK(self)->layer_transac;
+ if(layer) {
+ /* Create new transaction. The new transaction will be added to the transaction layer.
+ The transaction has all information to create the right transaction type (NICT or ICT).
+ As this is an outgoing request ==> It shall be a client transaction (NICT or ICT).
+ For server transactions creation see @ref tsip_dialog_response_send.
+ */
+ static const tsk_bool_t isCT = tsk_true;
+ tsip_transac_t* transac;
+ tsip_transac_dst_t* dst;
+
+
+ if(TSIP_STACK_MODE_IS_CLIENT(TSIP_DIALOG_GET_STACK(self))) {
+ const tsip_transport_t* transport = tsip_transport_layer_find_by_idx(TSIP_DIALOG_GET_STACK(self)->layer_transport, TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default);
+ if(!transport) {
+ TSK_DEBUG_ERROR("Failed to find a valid default transport [%d]", TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default);
+ }
+ else {
+ request->dst_net_type = transport->type;
+ }
+ }
+ dst = tsip_transac_dst_dialog_create(TSIP_DIALOG(self));
+ transac = tsip_transac_layer_new(
+ layer,
+ isCT,
+ request,
+ dst
+ );
+ TSK_OBJECT_SAFE_FREE(dst);
+
+ /* Set the transaction's dialog. All events comming from the transaction (timeouts, errors ...) will be signaled to this dialog */
+ if(transac) {
+ switch(transac->type) {
+ case tsip_transac_type_ict:
+ case tsip_transac_type_nict: {
+ /* Start the newly create IC/NIC transaction */
+ ret = tsip_transac_start(transac, request);
+ break;
+ }
+ default:
+ break;
+ }
+ TSK_OBJECT_SAFE_FREE(transac);
+ }
+ }
+ }
+ return ret;
}
tsip_response_t *tsip_dialog_response_new(tsip_dialog_t *self, short status, const char* phrase, const tsip_request_t* request)
{
- /* Reponse is created as per RFC 3261 subclause 8.2.6 and (headers+tags) are copied
- * as per subclause 8.2.6.2.
- */
- tsip_response_t* response;
- if((response = tsip_response_new(status, phrase, request))){
- switch(request->line.request.request_type){
- case tsip_MESSAGE:
- case tsip_PUBLISH:
- break;
- default:
- /* Is there a To tag? */
- if(response->To && !response->To->tag){
- response->To->tag = tsk_strdup(self->tag_local);
- }
- /* Contact Header (for 101-299 reponses) */
- if(self->uri_local && TSIP_RESPONSE_CODE(response) >= 101 && TSIP_RESPONSE_CODE(response) <= 299){
- char* contact = tsk_null;
- tsip_header_Contacts_L_t *hdr_contacts;
-
- tsk_sprintf(&contact, "m: <%s:%s@%s:%d>\r\n", "sip", self->uri_local->user_name, "127.0.0.1", 5060);
- hdr_contacts = tsip_header_Contact_parse(contact, tsk_strlen(contact));
- if(!TSK_LIST_IS_EMPTY(hdr_contacts)){
- response->Contact = tsk_object_ref(hdr_contacts->head->data);
- response->update = tsk_true; /* Now signal that the message should be updated by the transport layer (Contact header) */
- }
- TSK_OBJECT_SAFE_FREE(hdr_contacts);
- TSK_FREE(contact);
- }
- break;
- }
-
- /* SigComp */
- if(self->ss->sigcomp_id){
- /* should be added in this field instead of 'Contact' or 'Via' headers
- * it's up to the transport layer to copy it to these headers */
- response->sigcomp_id = tsk_strdup(self->ss->sigcomp_id);
- }
- /* Connected FD */
- if(response->local_fd <= 0) {
- response->local_fd = self->connected_fd;
- }
- /* Remote Addr: used to send requests if "Server Mode" otherwise Proxy-CSCF address will be used */
- self->remote_addr = request->remote_addr;
- }
- return response;
+ /* Reponse is created as per RFC 3261 subclause 8.2.6 and (headers+tags) are copied
+ * as per subclause 8.2.6.2.
+ */
+ tsip_response_t* response;
+ if((response = tsip_response_new(status, phrase, request))) {
+ switch(request->line.request.request_type) {
+ case tsip_MESSAGE:
+ case tsip_PUBLISH:
+ break;
+ default:
+ /* Is there a To tag? */
+ if(response->To && !response->To->tag) {
+ response->To->tag = tsk_strdup(self->tag_local);
+ }
+ /* Contact Header (for 101-299 reponses) */
+ if(self->uri_local && TSIP_RESPONSE_CODE(response) >= 101 && TSIP_RESPONSE_CODE(response) <= 299) {
+ char* contact = tsk_null;
+ tsip_header_Contacts_L_t *hdr_contacts;
+
+ tsk_sprintf(&contact, "m: <%s:%s@%s:%d>\r\n", "sip", self->uri_local->user_name, "127.0.0.1", 5060);
+ hdr_contacts = tsip_header_Contact_parse(contact, tsk_strlen(contact));
+ if(!TSK_LIST_IS_EMPTY(hdr_contacts)) {
+ response->Contact = tsk_object_ref(hdr_contacts->head->data);
+ response->update = tsk_true; /* Now signal that the message should be updated by the transport layer (Contact header) */
+ }
+ TSK_OBJECT_SAFE_FREE(hdr_contacts);
+ TSK_FREE(contact);
+ }
+ break;
+ }
+
+ /* SigComp */
+ if(self->ss->sigcomp_id) {
+ /* should be added in this field instead of 'Contact' or 'Via' headers
+ * it's up to the transport layer to copy it to these headers */
+ response->sigcomp_id = tsk_strdup(self->ss->sigcomp_id);
+ }
+ /* Connected FD */
+ if(response->local_fd <= 0) {
+ response->local_fd = self->connected_fd;
+ }
+ /* Remote Addr: used to send requests if "Server Mode" otherwise Proxy-CSCF address will be used */
+ self->remote_addr = request->remote_addr;
+ }
+ return response;
}
int tsip_dialog_response_send(const tsip_dialog_t *self, tsip_response_t* response)
{
- int ret = -1;
-
- if(self && TSIP_DIALOG_GET_STACK(self)){
- const tsip_transac_layer_t *layer = TSIP_DIALOG_GET_STACK(self)->layer_transac;
- if(layer){
- /* As this is a response ...then use the associate server transaction */
- tsip_transac_t *transac = tsip_transac_layer_find_server(layer, response);
- if(transac){
- ret = transac->callback(transac, tsip_transac_outgoing_msg, response);
- tsk_object_unref(transac);
- }
- else{
- TSK_DEBUG_ERROR("Failed to find associated server transaction.");
- // Send "408 Request Timeout" (should be done by the transaction layer)?
- }
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
- return ret;
+ int ret = -1;
+
+ if(self && TSIP_DIALOG_GET_STACK(self)) {
+ const tsip_transac_layer_t *layer = TSIP_DIALOG_GET_STACK(self)->layer_transac;
+ if(layer) {
+ /* As this is a response ...then use the associate server transaction */
+ tsip_transac_t *transac = tsip_transac_layer_find_server(layer, response);
+ if(transac) {
+ ret = transac->callback(transac, tsip_transac_outgoing_msg, response);
+ tsk_object_unref(transac);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to find associated server transaction.");
+ // Send "408 Request Timeout" (should be done by the transaction layer)?
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+ return ret;
}
int tsip_dialog_apply_action(tsip_message_t* message, const tsip_action_t* action)
{
- const tsk_list_item_t* item;
-
- if(!message || !action){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* SIP headers */
- tsk_list_foreach(item, action->headers){
- TSIP_MESSAGE_ADD_HEADER(message, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- /* Payload */
- if(action->payload){
- tsip_message_add_content(message, tsk_null, TSK_BUFFER_DATA(action->payload), TSK_BUFFER_SIZE(action->payload));
- }
-
- return 0;
+ const tsk_list_item_t* item;
+
+ if(!message || !action) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* SIP headers */
+ tsk_list_foreach(item, action->headers) {
+ TSIP_MESSAGE_ADD_HEADER(message, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ /* Payload */
+ if(action->payload) {
+ tsip_message_add_content(message, tsk_null, TSK_BUFFER_DATA(action->payload), TSK_BUFFER_SIZE(action->payload));
+ }
+
+ return 0;
}
/**
@@ -612,72 +609,69 @@ int tsip_dialog_apply_action(tsip_message_t* message, const tsip_action_t* actio
* @param [in,out] self The calling dialog.
* @param [in,out] response The SIP/IMS response containing the new delay (expires, subscription-state ...).
*
- * @return Zero if succeed and no-zero error code otherwise.
+ * @return Zero if succeed and no-zero error code otherwise.
**/
int64_t tsip_dialog_get_newdelay(tsip_dialog_t *self, const tsip_message_t* message)
{
- int64_t expires = self->expires;
- int64_t newdelay = expires; /* default value */
- const tsip_header_t* hdr;
- tsk_size_t i;
-
- /*== NOTIFY with subscription-state header with expires parameter.
- */
- if(TSIP_REQUEST_IS_NOTIFY(message)){
- const tsip_header_Subscription_State_t *hdr_state;
- if((hdr_state = (const tsip_header_Subscription_State_t*)tsip_message_get_header(message, tsip_htype_Subscription_State))){
- if(hdr_state->expires >0){
- expires = TSK_TIME_S_2_MS(hdr_state->expires);
- goto compute;
- }
- }
- }
-
- /*== Expires header.
- */
- if((hdr = tsip_message_get_header(message, tsip_htype_Expires))){
- expires = TSK_TIME_S_2_MS(((const tsip_header_Expires_t*)hdr)->delta_seconds);
- goto compute;
- }
-
- /*== Contact header.
- */
- for(i=0; (hdr = tsip_message_get_headerAt(message, tsip_htype_Contact, i)); i++){
- const tsip_header_Contact_t* contact = (const tsip_header_Contact_t*)hdr;
- if(contact && contact->uri)
- {
- const char* transport = tsk_params_get_param_value(contact->uri->params, "transport");
- tsip_uri_t* contactUri = tsip_stack_get_contacturi(TSIP_DIALOG_GET_STACK(self), transport ? transport : "udp");
- if(contactUri)
- {
- if(tsk_strequals(contact->uri->user_name, contactUri->user_name)
- && tsk_strequals(contact->uri->host, contactUri->host)
- && contact->uri->port == contactUri->port)
- {
- if(contact->expires>=0){ /* No expires parameter ==> -1*/
- expires = TSK_TIME_S_2_MS(contact->expires);
-
- TSK_OBJECT_SAFE_FREE(contactUri);
- goto compute;
- }
- }
- TSK_OBJECT_SAFE_FREE(contactUri);
- }
- }
- }
-
- /*
- * 3GPP TS 24.229 -
- *
- * The UE shall reregister the public user identity either 600 seconds before the expiration time if the initial
- * registration was for greater than 1200 seconds, or when half of the time has expired if the initial registration
- * was for 1200 seconds or less.
- */
+ int64_t expires = self->expires;
+ int64_t newdelay = expires; /* default value */
+ const tsip_header_t* hdr;
+ tsk_size_t i;
+
+ /*== NOTIFY with subscription-state header with expires parameter.
+ */
+ if(TSIP_REQUEST_IS_NOTIFY(message)) {
+ const tsip_header_Subscription_State_t *hdr_state;
+ if((hdr_state = (const tsip_header_Subscription_State_t*)tsip_message_get_header(message, tsip_htype_Subscription_State))) {
+ if(hdr_state->expires >0) {
+ expires = TSK_TIME_S_2_MS(hdr_state->expires);
+ goto compute;
+ }
+ }
+ }
+
+ /*== Expires header.
+ */
+ if((hdr = tsip_message_get_header(message, tsip_htype_Expires))) {
+ expires = TSK_TIME_S_2_MS(((const tsip_header_Expires_t*)hdr)->delta_seconds);
+ goto compute;
+ }
+
+ /*== Contact header.
+ */
+ for(i=0; (hdr = tsip_message_get_headerAt(message, tsip_htype_Contact, i)); i++) {
+ const tsip_header_Contact_t* contact = (const tsip_header_Contact_t*)hdr;
+ if(contact && contact->uri) {
+ const char* transport = tsk_params_get_param_value(contact->uri->params, "transport");
+ tsip_uri_t* contactUri = tsip_stack_get_contacturi(TSIP_DIALOG_GET_STACK(self), transport ? transport : "udp");
+ if(contactUri) {
+ if(tsk_strequals(contact->uri->user_name, contactUri->user_name)
+ && tsk_strequals(contact->uri->host, contactUri->host)
+ && contact->uri->port == contactUri->port) {
+ if(contact->expires>=0) { /* No expires parameter ==> -1*/
+ expires = TSK_TIME_S_2_MS(contact->expires);
+
+ TSK_OBJECT_SAFE_FREE(contactUri);
+ goto compute;
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(contactUri);
+ }
+ }
+ }
+
+ /*
+ * 3GPP TS 24.229 -
+ *
+ * The UE shall reregister the public user identity either 600 seconds before the expiration time if the initial
+ * registration was for greater than 1200 seconds, or when half of the time has expired if the initial registration
+ * was for 1200 seconds or less.
+ */
compute:
- expires = TSK_TIME_MS_2_S(expires);
- newdelay = (expires > 1200) ? (expires - 600) : (expires/2);
+ expires = TSK_TIME_MS_2_S(expires);
+ newdelay = (expires > 1200) ? (expires - 600) : (expires/2);
- return TSK_TIME_S_2_MS(newdelay);
+ return TSK_TIME_S_2_MS(newdelay);
}
/**
@@ -690,488 +684,482 @@ compute:
* - ...
*
* @param [in,out] self The calling dialog.
- * @param [in,out] response The SIP/IMS response from which to get the new information.
+ * @param [in,out] response The SIP/IMS response from which to get the new information.
*
- * @return Zero if succeed and no-zero error code otherwise.
+ * @return Zero if succeed and no-zero error code otherwise.
**/
int tsip_dialog_update(tsip_dialog_t *self, const tsip_response_t* response)
{
- if(self && TSIP_MESSAGE_IS_RESPONSE(response) && response->To){
- short code = TSIP_RESPONSE_CODE(response);
- const char *tag = response->To->tag;
-
- /*
- * 1xx (!100) or 2xx
- */
- /*
- * 401 or 407 or 421 or 494
- */
- if(code == 401 || code == 407 || code == 421 || code == 494)
- {
- tsk_bool_t acceptNewVector;
-
- /* 3GPP IMS - Each authentication vector is used only once.
- * ==> Re-registration/De-registration ==> Allow 401/407 challenge.
- */
- acceptNewVector = (TSIP_RESPONSE_IS_TO_REGISTER(response) && self->state == tsip_established);
- return tsip_dialog_update_challenges(self, response, acceptNewVector);
- }
- else if(100 < code && code < 300)
- {
- tsip_dialog_state_t state = self->state;
-
- /* 1xx */
- if(code <= 199){
- if(tsk_strnullORempty(response->To->tag)){
- TSK_DEBUG_WARN("Invalid tag parameter");
- return 0;
- }
- state = tsip_early;
- }
- /* 2xx */
- else{
- state = tsip_established;
- }
-
- /* Remote target */
- {
- /* RFC 3261 12.2.1.2 Processing the Responses
- When a UAC receives a 2xx response to a target refresh request, it
- MUST replace the dialog's remote target URI with the URI from the
- Contact header field in that response, if present.
-
- FIXME: Because PRACK/UPDATE sent before the session is established MUST have
- the rigth target URI to be delivered to the UAS ==> Do not not check that we are connected
- */
- if(!TSIP_RESPONSE_IS_TO_REGISTER(response) && response->Contact && response->Contact->uri){
- TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
- self->uri_remote_target = tsip_uri_clone(response->Contact->uri, tsk_true, tsk_false);
- }
- }
-
- /* Route sets */
- {
- tsk_size_t index;
- const tsip_header_Record_Route_t *recordRoute;
- tsip_header_Record_Route_t *route;
-
- TSK_OBJECT_SAFE_FREE(self->record_routes);
-
- for(index = 0; (recordRoute = (const tsip_header_Record_Route_t *)tsip_message_get_headerAt(response, tsip_htype_Record_Route, index)); index++){
- if(!self->record_routes){
- self->record_routes = tsk_list_create();
- }
- if((route = tsk_object_ref((void*)recordRoute))){
- tsk_list_push_front_data(self->record_routes, (void**)&route); /* Copy reversed. */
- }
- }
- }
-
-
- /* cseq + tags + ... */
- if(self->state == tsip_established && tsk_striequals(self->tag_remote, tag)){
- return 0;
- }
- else{
- if(!TSIP_RESPONSE_IS_TO_REGISTER(response) && !TSIP_RESPONSE_IS_TO_PUBLISH(response)){ /* REGISTER and PUBLISH don't establish dialog */
- tsk_strupdate(&self->tag_remote, tag);
- }
+ if(self && TSIP_MESSAGE_IS_RESPONSE(response) && response->To) {
+ short code = TSIP_RESPONSE_CODE(response);
+ const char *tag = response->To->tag;
+
+ /*
+ * 1xx (!100) or 2xx
+ */
+ /*
+ * 401 or 407 or 421 or 494
+ */
+ if(code == 401 || code == 407 || code == 421 || code == 494) {
+ tsk_bool_t acceptNewVector;
+
+ /* 3GPP IMS - Each authentication vector is used only once.
+ * ==> Re-registration/De-registration ==> Allow 401/407 challenge.
+ */
+ acceptNewVector = (TSIP_RESPONSE_IS_TO_REGISTER(response) && self->state == tsip_established);
+ return tsip_dialog_update_challenges(self, response, acceptNewVector);
+ }
+ else if(100 < code && code < 300) {
+ tsip_dialog_state_t state = self->state;
+
+ /* 1xx */
+ if(code <= 199) {
+ if(tsk_strnullORempty(response->To->tag)) {
+ TSK_DEBUG_WARN("Invalid tag parameter");
+ return 0;
+ }
+ state = tsip_early;
+ }
+ /* 2xx */
+ else {
+ state = tsip_established;
+ }
+
+ /* Remote target */
+ {
+ /* RFC 3261 12.2.1.2 Processing the Responses
+ When a UAC receives a 2xx response to a target refresh request, it
+ MUST replace the dialog's remote target URI with the URI from the
+ Contact header field in that response, if present.
+
+ FIXME: Because PRACK/UPDATE sent before the session is established MUST have
+ the rigth target URI to be delivered to the UAS ==> Do not not check that we are connected
+ */
+ if(!TSIP_RESPONSE_IS_TO_REGISTER(response) && response->Contact && response->Contact->uri) {
+ TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
+ self->uri_remote_target = tsip_uri_clone(response->Contact->uri, tsk_true, tsk_false);
+ }
+ }
+
+ /* Route sets */
+ {
+ tsk_size_t index;
+ const tsip_header_Record_Route_t *recordRoute;
+ tsip_header_Record_Route_t *route;
+
+ TSK_OBJECT_SAFE_FREE(self->record_routes);
+
+ for(index = 0; (recordRoute = (const tsip_header_Record_Route_t *)tsip_message_get_headerAt(response, tsip_htype_Record_Route, index)); index++) {
+ if(!self->record_routes) {
+ self->record_routes = tsk_list_create();
+ }
+ if((route = tsk_object_ref((void*)recordRoute))) {
+ tsk_list_push_front_data(self->record_routes, (void**)&route); /* Copy reversed. */
+ }
+ }
+ }
+
+
+ /* cseq + tags + ... */
+ if(self->state == tsip_established && tsk_striequals(self->tag_remote, tag)) {
+ return 0;
+ }
+ else {
+ if(!TSIP_RESPONSE_IS_TO_REGISTER(response) && !TSIP_RESPONSE_IS_TO_PUBLISH(response)) { /* REGISTER and PUBLISH don't establish dialog */
+ tsk_strupdate(&self->tag_remote, tag);
+ }
#if 0 // PRACK and BYE will have same CSeq value ==> Let CSeq value to be incremented by "tsip_dialog_request_new()"
- self->cseq_value = response->CSeq ? response->CSeq->seq : self->cseq_value;
+ self->cseq_value = response->CSeq ? response->CSeq->seq : self->cseq_value;
#endif
- }
+ }
- self->state = state;
- return 0;
- }
- }
- return 0;
+ self->state = state;
+ return 0;
+ }
+ }
+ return 0;
}
int tsip_dialog_update_2(tsip_dialog_t *self, const tsip_request_t* invite)
{
- if(!self || !invite){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* Remote target */
- if(invite->Contact && invite->Contact->uri){
- TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
- self->uri_remote_target = tsip_uri_clone(invite->Contact->uri, tsk_true, tsk_false);
- }
-
- /* cseq + tags + remote-uri */
- tsk_strupdate(&self->tag_remote, invite->From?invite->From->tag:"doubango");
- /* self->cseq_value = invite->CSeq ? invite->CSeq->seq : self->cseq_value; */
- if(invite->From && invite->From->uri){
- TSK_OBJECT_SAFE_FREE(self->uri_remote);
- self->uri_remote = tsk_object_ref(invite->From->uri);
- }
-
- /* Route sets */
- {
- tsk_size_t index;
- const tsip_header_Record_Route_t *recordRoute;
- tsip_header_Record_Route_t* route;
-
- TSK_OBJECT_SAFE_FREE(self->record_routes);
-
- for(index = 0; (recordRoute = (const tsip_header_Record_Route_t *)tsip_message_get_headerAt(invite, tsip_htype_Record_Route, index)); index++){
- if(!self->record_routes){
- self->record_routes = tsk_list_create();
- }
- if((route = tsk_object_ref((void*)recordRoute))){
- tsk_list_push_back_data(self->record_routes, (void**)&route); /* Copy non-reversed. */
- }
- }
- }
-
- self->state = tsip_established;
-
- return 0;
+ if(!self || !invite) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* Remote target */
+ if(invite->Contact && invite->Contact->uri) {
+ TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
+ self->uri_remote_target = tsip_uri_clone(invite->Contact->uri, tsk_true, tsk_false);
+ }
+
+ /* cseq + tags + remote-uri */
+ tsk_strupdate(&self->tag_remote, invite->From?invite->From->tag:"doubango");
+ /* self->cseq_value = invite->CSeq ? invite->CSeq->seq : self->cseq_value; */
+ if(invite->From && invite->From->uri) {
+ TSK_OBJECT_SAFE_FREE(self->uri_remote);
+ self->uri_remote = tsk_object_ref(invite->From->uri);
+ }
+
+ /* Route sets */
+ {
+ tsk_size_t index;
+ const tsip_header_Record_Route_t *recordRoute;
+ tsip_header_Record_Route_t* route;
+
+ TSK_OBJECT_SAFE_FREE(self->record_routes);
+
+ for(index = 0; (recordRoute = (const tsip_header_Record_Route_t *)tsip_message_get_headerAt(invite, tsip_htype_Record_Route, index)); index++) {
+ if(!self->record_routes) {
+ self->record_routes = tsk_list_create();
+ }
+ if((route = tsk_object_ref((void*)recordRoute))) {
+ tsk_list_push_back_data(self->record_routes, (void**)&route); /* Copy non-reversed. */
+ }
+ }
+ }
+
+ self->state = tsip_established;
+
+ return 0;
}
int tsip_dialog_getCKIK(tsip_dialog_t *self, AKA_CK_T *ck, AKA_IK_T *ik)
{
- tsk_list_item_t *item;
- tsip_challenge_t *challenge;
-
- if(!self){
- return -1;
- }
-
- tsk_list_foreach(item, self->challenges)
- {
- if((challenge = item->data)){
- memcpy(*ck, challenge->ck, AKA_CK_SIZE);
- memcpy(*ik, challenge->ik, AKA_IK_SIZE);
- return 0;
- }
- }
- TSK_DEBUG_ERROR("No challenge found. Fail to set IK and CK.");
- return -2;
+ tsk_list_item_t *item;
+ tsip_challenge_t *challenge;
+
+ if(!self) {
+ return -1;
+ }
+
+ tsk_list_foreach(item, self->challenges) {
+ if((challenge = item->data)) {
+ memcpy(*ck, challenge->ck, AKA_CK_SIZE);
+ memcpy(*ik, challenge->ik, AKA_IK_SIZE);
+ return 0;
+ }
+ }
+ TSK_DEBUG_ERROR("No challenge found. Fail to set IK and CK.");
+ return -2;
}
int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response, int acceptNewVector)
{
- int ret = -1;
- tsk_size_t i;
-
- tsk_list_item_t *item;
-
- tsip_challenge_t *challenge;
-
- const tsip_header_WWW_Authenticate_t *WWW_Authenticate;
- const tsip_header_Proxy_Authenticate_t *Proxy_Authenticate;
-
- /* RFC 2617 - HTTP Digest Session
-
- * (A) The client response to a WWW-Authenticate challenge for a protection
- space starts an authentication session with that protection space.
- The authentication session lasts until the client receives another
- WWW-Authenticate challenge from any server in the protection space.
-
- (B) The server may return a 401 response with a new nonce value, causing the client
- to retry the request; by specifying stale=TRUE with this response,
- the server tells the client to retry with the new nonce, but without
- prompting for a new username and password.
- */
- /* RFC 2617 - 1.2 Access Authentication Framework
- The realm directive (case-insensitive) is required for all authentication schemes that issue a challenge.
- */
-
- /* FIXME: As we perform the same task ==> Use only one loop.
- */
-
- for(i =0; (WWW_Authenticate = (const tsip_header_WWW_Authenticate_t*)tsip_message_get_headerAt(response, tsip_htype_WWW_Authenticate, i)); i++){
- tsk_bool_t isnew = tsk_true;
-
- tsk_list_foreach(item, self->challenges){
- challenge = item->data;
- if(challenge->isproxy) continue;
-
- if(tsk_striequals(challenge->realm, WWW_Authenticate->realm) && (WWW_Authenticate->stale || acceptNewVector)){
- /*== (B) ==*/
- if((ret = tsip_challenge_update(challenge,
- WWW_Authenticate->scheme,
- WWW_Authenticate->realm,
- WWW_Authenticate->nonce,
- WWW_Authenticate->opaque,
- WWW_Authenticate->algorithm,
- WWW_Authenticate->qop)))
- {
- return ret;
- }
- else{
- isnew = tsk_false;
- continue;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to handle new challenge");
- return -1;
- }
- }
-
- if(isnew){
- if((challenge = tsip_challenge_create(TSIP_DIALOG_GET_STACK(self),
- tsk_false,
- WWW_Authenticate->scheme,
- WWW_Authenticate->realm,
- WWW_Authenticate->nonce,
- WWW_Authenticate->opaque,
- WWW_Authenticate->algorithm,
- WWW_Authenticate->qop)))
- {
- if(TSIP_DIALOG_GET_SS(self)->auth_ha1 && TSIP_DIALOG_GET_SS(self)->auth_impi){
- tsip_challenge_set_cred(challenge, TSIP_DIALOG_GET_SS(self)->auth_impi, TSIP_DIALOG_GET_SS(self)->auth_ha1);
- }
- tsk_list_push_back_data(self->challenges, (void**)&challenge);
- }
- else{
- TSK_DEBUG_ERROR("Failed to handle new challenge");
- return -1;
- }
- }
- }
-
- for(i=0; (Proxy_Authenticate = (const tsip_header_Proxy_Authenticate_t*)tsip_message_get_headerAt(response, tsip_htype_Proxy_Authenticate, i)); i++){
- tsk_bool_t isnew = tsk_true;
-
- tsk_list_foreach(item, self->challenges){
- challenge = item->data;
- if(!challenge->isproxy){
- continue;
- }
-
- if(tsk_striequals(challenge->realm, Proxy_Authenticate->realm) && (Proxy_Authenticate->stale || acceptNewVector)){
- /*== (B) ==*/
- if((ret = tsip_challenge_update(challenge,
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm,
- Proxy_Authenticate->nonce,
- Proxy_Authenticate->opaque,
- Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop)))
- {
- return ret;
- }
- else{
- isnew = tsk_false;
- continue;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to handle new challenge");
- return -1;
- }
- }
-
- if(isnew){
- if((challenge = tsip_challenge_create(TSIP_DIALOG_GET_STACK(self),
- tsk_true,
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm,
- Proxy_Authenticate->nonce,
- Proxy_Authenticate->opaque,
- Proxy_Authenticate->algorithm,
- Proxy_Authenticate->qop)))
- {
- if(TSIP_DIALOG_GET_SS(self)->auth_ha1 && TSIP_DIALOG_GET_SS(self)->auth_impi){
- tsip_challenge_set_cred(challenge, TSIP_DIALOG_GET_SS(self)->auth_impi, TSIP_DIALOG_GET_SS(self)->auth_ha1);
- }
- tsk_list_push_back_data(self->challenges, (void**)&challenge);
- }
- else{
- TSK_DEBUG_ERROR("Failed to handle new challenge");
- return -1;
- }
- }
- }
- return 0;
+ int ret = -1;
+ tsk_size_t i;
+
+ tsk_list_item_t *item;
+
+ tsip_challenge_t *challenge;
+
+ const tsip_header_WWW_Authenticate_t *WWW_Authenticate;
+ const tsip_header_Proxy_Authenticate_t *Proxy_Authenticate;
+
+ /* RFC 2617 - HTTP Digest Session
+
+ * (A) The client response to a WWW-Authenticate challenge for a protection
+ space starts an authentication session with that protection space.
+ The authentication session lasts until the client receives another
+ WWW-Authenticate challenge from any server in the protection space.
+
+ (B) The server may return a 401 response with a new nonce value, causing the client
+ to retry the request; by specifying stale=TRUE with this response,
+ the server tells the client to retry with the new nonce, but without
+ prompting for a new username and password.
+ */
+ /* RFC 2617 - 1.2 Access Authentication Framework
+ The realm directive (case-insensitive) is required for all authentication schemes that issue a challenge.
+ */
+
+ /* FIXME: As we perform the same task ==> Use only one loop.
+ */
+
+ for(i =0; (WWW_Authenticate = (const tsip_header_WWW_Authenticate_t*)tsip_message_get_headerAt(response, tsip_htype_WWW_Authenticate, i)); i++) {
+ tsk_bool_t isnew = tsk_true;
+
+ tsk_list_foreach(item, self->challenges) {
+ challenge = item->data;
+ if(challenge->isproxy) {
+ continue;
+ }
+
+ if(tsk_striequals(challenge->realm, WWW_Authenticate->realm) && (WWW_Authenticate->stale || acceptNewVector)) {
+ /*== (B) ==*/
+ if((ret = tsip_challenge_update(challenge,
+ WWW_Authenticate->scheme,
+ WWW_Authenticate->realm,
+ WWW_Authenticate->nonce,
+ WWW_Authenticate->opaque,
+ WWW_Authenticate->algorithm,
+ WWW_Authenticate->qop))) {
+ return ret;
+ }
+ else {
+ isnew = tsk_false;
+ continue;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to handle new challenge");
+ return -1;
+ }
+ }
+
+ if(isnew) {
+ if((challenge = tsip_challenge_create(TSIP_DIALOG_GET_STACK(self),
+ tsk_false,
+ WWW_Authenticate->scheme,
+ WWW_Authenticate->realm,
+ WWW_Authenticate->nonce,
+ WWW_Authenticate->opaque,
+ WWW_Authenticate->algorithm,
+ WWW_Authenticate->qop))) {
+ if(TSIP_DIALOG_GET_SS(self)->auth_ha1 && TSIP_DIALOG_GET_SS(self)->auth_impi) {
+ tsip_challenge_set_cred(challenge, TSIP_DIALOG_GET_SS(self)->auth_impi, TSIP_DIALOG_GET_SS(self)->auth_ha1);
+ }
+ tsk_list_push_back_data(self->challenges, (void**)&challenge);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to handle new challenge");
+ return -1;
+ }
+ }
+ }
+
+ for(i=0; (Proxy_Authenticate = (const tsip_header_Proxy_Authenticate_t*)tsip_message_get_headerAt(response, tsip_htype_Proxy_Authenticate, i)); i++) {
+ tsk_bool_t isnew = tsk_true;
+
+ tsk_list_foreach(item, self->challenges) {
+ challenge = item->data;
+ if(!challenge->isproxy) {
+ continue;
+ }
+
+ if(tsk_striequals(challenge->realm, Proxy_Authenticate->realm) && (Proxy_Authenticate->stale || acceptNewVector)) {
+ /*== (B) ==*/
+ if((ret = tsip_challenge_update(challenge,
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm,
+ Proxy_Authenticate->nonce,
+ Proxy_Authenticate->opaque,
+ Proxy_Authenticate->algorithm,
+ Proxy_Authenticate->qop))) {
+ return ret;
+ }
+ else {
+ isnew = tsk_false;
+ continue;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to handle new challenge");
+ return -1;
+ }
+ }
+
+ if(isnew) {
+ if((challenge = tsip_challenge_create(TSIP_DIALOG_GET_STACK(self),
+ tsk_true,
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm,
+ Proxy_Authenticate->nonce,
+ Proxy_Authenticate->opaque,
+ Proxy_Authenticate->algorithm,
+ Proxy_Authenticate->qop))) {
+ if(TSIP_DIALOG_GET_SS(self)->auth_ha1 && TSIP_DIALOG_GET_SS(self)->auth_impi) {
+ tsip_challenge_set_cred(challenge, TSIP_DIALOG_GET_SS(self)->auth_impi, TSIP_DIALOG_GET_SS(self)->auth_ha1);
+ }
+ tsk_list_push_back_data(self->challenges, (void**)&challenge);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to handle new challenge");
+ return -1;
+ }
+ }
+ }
+ return 0;
}
int tsip_dialog_add_session_headers(const tsip_dialog_t *self, tsip_request_t* request)
{
- if(!self || !request){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || !request) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- TSIP_DIALOG_ADD_HEADERS(self->ss->headers);
- return 0;
+ TSIP_DIALOG_ADD_HEADERS(self->ss->headers);
+ return 0;
}
int tsip_dialog_add_common_headers(const tsip_dialog_t *self, tsip_request_t* request)
{
- tsk_bool_t earlyIMS = tsk_false;
- const tsip_uri_t* preferred_identity = tsk_null;
- const char* netinfo = tsk_null;
-
- if(!self || !request){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- earlyIMS = TSIP_DIALOG_GET_STACK(self)->security.earlyIMS;
- preferred_identity = TSIP_DIALOG_GET_STACK(self)->identity.preferred;
-
- //
- // P-Preferred-Identity
- //
- if(preferred_identity && TSIP_STACK_MODE_IS_CLIENT(TSIP_DIALOG_GET_STACK(self))){
- /* 3GPP TS 33.978 6.2.3.1 Procedures at the UE
- The UE shall use the temporary public user identity (IMSI-derived IMPU, cf. section 6.1.2) only in registration
- messages (i.e. initial registration, re-registration or de-registration), but not in any other type of SIP requests.
- */
- switch(request->line.request.request_type){
- case tsip_BYE:
- case tsip_INVITE:
- case tsip_OPTIONS:
- case tsip_SUBSCRIBE:
- case tsip_NOTIFY:
- case tsip_REFER:
- case tsip_MESSAGE:
- case tsip_PUBLISH:
- case tsip_REGISTER:
- {
- if(!earlyIMS || (earlyIMS && TSIP_REQUEST_IS_REGISTER(request))){
- TSIP_MESSAGE_ADD_HEADER(request,
- TSIP_HEADER_P_PREFERRED_IDENTITY_VA_ARGS(preferred_identity)
- );
- }
- break;
- }
- default:break;
- }
- }
-
- //
- // P-Access-Network-Info
- //
- if(netinfo)
- {
- switch(request->line.request.request_type){
- case tsip_BYE:
- case tsip_INVITE:
- case tsip_OPTIONS:
- case tsip_REGISTER:
- case tsip_SUBSCRIBE:
- case tsip_NOTIFY:
- case tsip_PRACK:
- case tsip_INFO:
- case tsip_UPDATE:
- case tsip_REFER:
- case tsip_MESSAGE:
- case tsip_PUBLISH:
- {
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_P_ACCESS_NETWORK_INFO_VA_ARGS(netinfo));
- break;
- }
- default: break;
- }
- }
-
- return 0;
+ tsk_bool_t earlyIMS = tsk_false;
+ const tsip_uri_t* preferred_identity = tsk_null;
+ const char* netinfo = tsk_null;
+
+ if(!self || !request) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ earlyIMS = TSIP_DIALOG_GET_STACK(self)->security.earlyIMS;
+ preferred_identity = TSIP_DIALOG_GET_STACK(self)->identity.preferred;
+
+ //
+ // P-Preferred-Identity
+ //
+ if(preferred_identity && TSIP_STACK_MODE_IS_CLIENT(TSIP_DIALOG_GET_STACK(self))) {
+ /* 3GPP TS 33.978 6.2.3.1 Procedures at the UE
+ The UE shall use the temporary public user identity (IMSI-derived IMPU, cf. section 6.1.2) only in registration
+ messages (i.e. initial registration, re-registration or de-registration), but not in any other type of SIP requests.
+ */
+ switch(request->line.request.request_type) {
+ case tsip_BYE:
+ case tsip_INVITE:
+ case tsip_OPTIONS:
+ case tsip_SUBSCRIBE:
+ case tsip_NOTIFY:
+ case tsip_REFER:
+ case tsip_MESSAGE:
+ case tsip_PUBLISH:
+ case tsip_REGISTER: {
+ if(!earlyIMS || (earlyIMS && TSIP_REQUEST_IS_REGISTER(request))) {
+ TSIP_MESSAGE_ADD_HEADER(request,
+ TSIP_HEADER_P_PREFERRED_IDENTITY_VA_ARGS(preferred_identity)
+ );
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ //
+ // P-Access-Network-Info
+ //
+ if(netinfo) {
+ switch(request->line.request.request_type) {
+ case tsip_BYE:
+ case tsip_INVITE:
+ case tsip_OPTIONS:
+ case tsip_REGISTER:
+ case tsip_SUBSCRIBE:
+ case tsip_NOTIFY:
+ case tsip_PRACK:
+ case tsip_INFO:
+ case tsip_UPDATE:
+ case tsip_REFER:
+ case tsip_MESSAGE:
+ case tsip_PUBLISH: {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_P_ACCESS_NETWORK_INFO_VA_ARGS(netinfo));
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ return 0;
}
int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, const char* call_id, tsip_ssession_t* ss, tsk_fsm_state_id curr, tsk_fsm_state_id term)
{
- static tsip_dialog_id_t unique_id = 0;
- if(self){
- if(self->initialized){
- TSK_DEBUG_WARN("Dialog already initialized.");
- return -2;
- }
-
- self->state = tsip_initial;
- self->type = type;
- self->id = ++unique_id;
- self->connected_fd = TNET_INVALID_FD;
- if(!self->record_routes){
- self->record_routes = tsk_list_create();
- }
- if(!self->challenges){
- self->challenges = tsk_list_create();
- }
-
- /* Sets some defalt values */
- self->expires = TSIP_SSESSION_EXPIRES_DEFAULT;
-
- if(call_id){
- /* "server-side" session */
- tsk_strupdate(&self->callid, call_id);
- }
- else{
- tsk_uuidstring_t uuid; /* Call-id is a random UUID */
- tsip_header_Call_ID_random(&uuid);
- tsk_strupdate(&self->callid, uuid);
- }
-
- /* ref SIP session */
- self->ss = tsk_object_ref(ss);
-
- /* Local tag */{
- tsk_istr_t tag;
- tsk_strrandom(&tag);
- tsk_strupdate(&self->tag_local, tag);
- }
-
- /* CSeq */
- self->cseq_value = (rand() + 1);
-
- /* FSM */
- self->fsm = tsk_fsm_create(curr, term);
-
- /*=== SIP Session ===*/
- if(self->ss != TSIP_SSESSION_INVALID_HANDLE){
-
- /* Expires */
- self->expires = ss->expires;
-
- /* From */
- self->uri_local = tsk_object_ref(call_id/* "server-side" */ ? ss->to : ss->from);
-
- /* To */
- if(ss->to){
- self->uri_remote = tsk_object_ref(ss->to);
- self->uri_remote_target = tsk_object_ref(ss->to); /* Request-URI. */
- }
- else{
- self->uri_remote = tsk_object_ref(ss->from);
- self->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->network.realm);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid SIP Session id.");
- }
-
- tsk_safeobj_init(self);
-
- self->initialized = tsk_true;
- return 0;
- }
- return -1;
+ static tsip_dialog_id_t unique_id = 0;
+ if(self) {
+ if(self->initialized) {
+ TSK_DEBUG_WARN("Dialog already initialized.");
+ return -2;
+ }
+
+ self->state = tsip_initial;
+ self->type = type;
+ self->id = ++unique_id;
+ self->connected_fd = TNET_INVALID_FD;
+ if(!self->record_routes) {
+ self->record_routes = tsk_list_create();
+ }
+ if(!self->challenges) {
+ self->challenges = tsk_list_create();
+ }
+
+ /* Sets some defalt values */
+ self->expires = TSIP_SSESSION_EXPIRES_DEFAULT;
+
+ if(call_id) {
+ /* "server-side" session */
+ tsk_strupdate(&self->callid, call_id);
+ }
+ else {
+ tsk_uuidstring_t uuid; /* Call-id is a random UUID */
+ tsip_header_Call_ID_random(&uuid);
+ tsk_strupdate(&self->callid, uuid);
+ }
+
+ /* ref SIP session */
+ self->ss = tsk_object_ref(ss);
+
+ /* Local tag */{
+ tsk_istr_t tag;
+ tsk_strrandom(&tag);
+ tsk_strupdate(&self->tag_local, tag);
+ }
+
+ /* CSeq */
+ self->cseq_value = (rand() + 1);
+
+ /* FSM */
+ self->fsm = tsk_fsm_create(curr, term);
+
+ /*=== SIP Session ===*/
+ if(self->ss != TSIP_SSESSION_INVALID_HANDLE) {
+
+ /* Expires */
+ self->expires = ss->expires;
+
+ /* From */
+ self->uri_local = tsk_object_ref(call_id/* "server-side" */ ? ss->to : ss->from);
+
+ /* To */
+ if(ss->to) {
+ self->uri_remote = tsk_object_ref(ss->to);
+ self->uri_remote_target = tsk_object_ref(ss->to); /* Request-URI. */
+ }
+ else {
+ self->uri_remote = tsk_object_ref(ss->from);
+ self->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->network.realm);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid SIP Session id.");
+ }
+
+ tsk_safeobj_init(self);
+
+ self->initialized = tsk_true;
+ return 0;
+ }
+ return -1;
}
int tsip_dialog_fsm_act(tsip_dialog_t* self, tsk_fsm_action_id action_id, const tsip_message_t* message, const tsip_action_handle_t* action)
{
- int ret;
- tsip_dialog_t* copy;
- if(!self || !self->fsm){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
-
- tsk_safeobj_lock(self);
- copy = tsk_object_ref(self); /* keep a copy because tsk_fsm_act() could destroy the dialog */
- ret = tsip_dialog_set_curr_action(copy, action);
- ret = tsk_fsm_act(copy->fsm, action_id, copy, message, copy, message, action);
- tsk_safeobj_unlock(copy);
- tsk_object_unref(copy);
-
- return ret;
+ int ret;
+ tsip_dialog_t* copy;
+ if(!self || !self->fsm) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
+ copy = tsk_object_ref(self); /* keep a copy because tsk_fsm_act() could destroy the dialog */
+ ret = tsip_dialog_set_curr_action(copy, action);
+ ret = tsk_fsm_act(copy->fsm, action_id, copy, message, copy, message, action);
+ tsk_safeobj_unlock(copy);
+ tsk_object_unref(copy);
+
+ return ret;
}
/*
@@ -1179,176 +1167,175 @@ This function is used to know if we need to keep the same action handle after re
*/
tsk_bool_t tsip_dialog_keep_action(const tsip_dialog_t* self, const tsip_response_t *response)
{
- if(self && response){
- const short code = TSIP_RESPONSE_CODE(response);
- return
- TSIP_RESPONSE_IS_1XX(response) ||
- (code == 401 || code == 407 || code == 421 || code == 494) ||
- (code == 422 || code == 423);
- }
- return tsk_false;
+ if(self && response) {
+ const short code = TSIP_RESPONSE_CODE(response);
+ return
+ TSIP_RESPONSE_IS_1XX(response) ||
+ (code == 401 || code == 407 || code == 421 || code == 494) ||
+ (code == 422 || code == 423);
+ }
+ return tsk_false;
}
int tsip_dialog_set_connected_fd(tsip_dialog_t* self, tnet_fd_t fd)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- self->connected_fd = fd;
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ self->connected_fd = fd;
+ return 0;
}
int tsip_dialog_set_curr_action(tsip_dialog_t* self, const tsip_action_t* action)
{
- tsip_action_t* new_action;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
-
- new_action = tsk_object_ref((void*)action);
- TSK_OBJECT_SAFE_FREE(self->curr_action);
- self->curr_action = new_action;
- return 0;
+ tsip_action_t* new_action;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+
+ new_action = tsk_object_ref((void*)action);
+ TSK_OBJECT_SAFE_FREE(self->curr_action);
+ self->curr_action = new_action;
+ return 0;
}
int tsip_dialog_set_lasterror_2(tsip_dialog_t* self, const char* phrase, short code, const tsip_message_t *message)
{
- if(!self || tsk_strnullORempty(phrase)){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
-
- tsk_strupdate(&self->last_error.phrase, phrase);
- self->last_error.code = code;
- TSK_OBJECT_SAFE_FREE(self->last_error.message);
- if(message){
- self->last_error.message = (tsip_message_t*)tsk_object_ref((void*)message);
- }
- return 0;
+ if(!self || tsk_strnullORempty(phrase)) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+
+ tsk_strupdate(&self->last_error.phrase, phrase);
+ self->last_error.code = code;
+ TSK_OBJECT_SAFE_FREE(self->last_error.message);
+ if(message) {
+ self->last_error.message = (tsip_message_t*)tsk_object_ref((void*)message);
+ }
+ return 0;
}
int tsip_dialog_set_lasterror(tsip_dialog_t* self, const char* phrase, short code)
{
- return tsip_dialog_set_lasterror_2(self, phrase, code, tsk_null);
+ return tsip_dialog_set_lasterror_2(self, phrase, code, tsk_null);
}
int tsip_dialog_get_lasterror(const tsip_dialog_t* self, short *code, const char** phrase, const tsip_message_t **message)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return -1;
- }
-
- if(code){
- *code = self->last_error.code;
- }
- if(phrase){
- *phrase = self->last_error.phrase;
- }
-
- if(message){
- *message = self->last_error.message;
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return -1;
+ }
+
+ if(code) {
+ *code = self->last_error.code;
+ }
+ if(phrase) {
+ *phrase = self->last_error.phrase;
+ }
+
+ if(message) {
+ *message = self->last_error.message;
+ }
+
+ return 0;
}
int tsip_dialog_hangup(tsip_dialog_t *self, const tsip_action_t* action)
{
- if(self){
- // CANCEL should only be sent for INVITE dialog
- if(self->type != tsip_dialog_INVITE || self->state == tsip_established){
- return tsip_dialog_fsm_act(self, tsip_atype_hangup, tsk_null, action);
- }
- else{
- return tsip_dialog_fsm_act(self, tsip_atype_cancel, tsk_null, action);
- }
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self) {
+ // CANCEL should only be sent for INVITE dialog
+ if(self->type != tsip_dialog_INVITE || self->state == tsip_established) {
+ return tsip_dialog_fsm_act(self, tsip_atype_hangup, tsk_null, action);
+ }
+ else {
+ return tsip_dialog_fsm_act(self, tsip_atype_cancel, tsk_null, action);
+ }
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_dialog_shutdown(tsip_dialog_t *self, const tsip_action_t* action)
{
- if(self){
- return tsip_dialog_fsm_act(self, tsip_atype_shutdown, tsk_null, action);
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self) {
+ return tsip_dialog_fsm_act(self, tsip_atype_shutdown, tsk_null, action);
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_dialog_signal_transport_error(tsip_dialog_t *self)
{
- if(self){
- return tsip_dialog_fsm_act(self, tsip_atype_transport_error, tsk_null, tsk_null);
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self) {
+ return tsip_dialog_fsm_act(self, tsip_atype_transport_error, tsk_null, tsk_null);
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_dialog_remove(const tsip_dialog_t* self)
{
- return tsip_dialog_layer_remove(TSIP_DIALOG_GET_STACK(self)->layer_dialog, TSIP_DIALOG(self));
+ return tsip_dialog_layer_remove(TSIP_DIALOG_GET_STACK(self)->layer_dialog, TSIP_DIALOG(self));
}
int tsip_dialog_cmp(const tsip_dialog_t *d1, const tsip_dialog_t *d2)
{
- if(d1 && d2){
- if(
- tsk_strequals(d1->callid, d2->callid)
- && (tsk_strequals(d1->tag_local, d2->tag_local))
- && (tsk_strequals(d1->tag_remote, d2->tag_remote))
- )
- {
- return 0;
- }
- }
- return -1;
+ if(d1 && d2) {
+ if(
+ tsk_strequals(d1->callid, d2->callid)
+ && (tsk_strequals(d1->tag_local, d2->tag_local))
+ && (tsk_strequals(d1->tag_remote, d2->tag_remote))
+ ) {
+ return 0;
+ }
+ }
+ return -1;
}
int tsip_dialog_deinit(tsip_dialog_t *self)
{
- if(self){
- if(!self->initialized){
- TSK_DEBUG_WARN("Dialog not initialized.");
- return -2;
- }
-
- /* Cancel all transactions associated to this dialog (do it here before the dialog becomes unsafe) */
- tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, self);
-
- /* Remove the dialog from the Stream peers */
- tsip_dialog_layer_remove_callid_from_stream_peers(TSIP_DIALOG_GET_STACK(self)->layer_dialog, self->callid);
-
- TSK_OBJECT_SAFE_FREE(self->ss);
- TSK_OBJECT_SAFE_FREE(self->curr_action);
-
- TSK_OBJECT_SAFE_FREE(self->uri_local);
- TSK_FREE(self->tag_local);
- TSK_OBJECT_SAFE_FREE(self->uri_remote);
- TSK_FREE(self->tag_remote);
-
- TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
-
- TSK_FREE(self->cseq_method);
- TSK_FREE(self->callid);
-
- TSK_FREE(self->last_error.phrase);
- TSK_OBJECT_SAFE_FREE(self->last_error.message);
-
- TSK_OBJECT_SAFE_FREE(self->record_routes);
- TSK_OBJECT_SAFE_FREE(self->challenges);
-
- TSK_OBJECT_SAFE_FREE(self->fsm);
-
- tsk_safeobj_deinit(self);
-
- self->initialized = 0;
-
- return 0;
- }
- return -1;
+ if(self) {
+ if(!self->initialized) {
+ TSK_DEBUG_WARN("Dialog not initialized.");
+ return -2;
+ }
+
+ /* Cancel all transactions associated to this dialog (do it here before the dialog becomes unsafe) */
+ tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, self);
+
+ /* Remove the dialog from the Stream peers */
+ tsip_dialog_layer_remove_callid_from_stream_peers(TSIP_DIALOG_GET_STACK(self)->layer_dialog, self->callid);
+
+ TSK_OBJECT_SAFE_FREE(self->ss);
+ TSK_OBJECT_SAFE_FREE(self->curr_action);
+
+ TSK_OBJECT_SAFE_FREE(self->uri_local);
+ TSK_FREE(self->tag_local);
+ TSK_OBJECT_SAFE_FREE(self->uri_remote);
+ TSK_FREE(self->tag_remote);
+
+ TSK_OBJECT_SAFE_FREE(self->uri_remote_target);
+
+ TSK_FREE(self->cseq_method);
+ TSK_FREE(self->callid);
+
+ TSK_FREE(self->last_error.phrase);
+ TSK_OBJECT_SAFE_FREE(self->last_error.message);
+
+ TSK_OBJECT_SAFE_FREE(self->record_routes);
+ TSK_OBJECT_SAFE_FREE(self->challenges);
+
+ TSK_OBJECT_SAFE_FREE(self->fsm);
+
+ tsk_safeobj_deinit(self);
+
+ self->initialized = 0;
+
+ return 0;
+ }
+ return -1;
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_info.c b/tinySIP/src/dialogs/tsip_dialog_info.c
index 0ff2536..aa8bc6d 100755
--- a/tinySIP/src/dialogs/tsip_dialog_info.c
+++ b/tinySIP/src/dialogs/tsip_dialog_info.c
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,156 +65,149 @@ static int tsip_dialog_info_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_sendINFO = tsip_atype_info_send,
- _fsm_action_accept = tsip_atype_accept,
- _fsm_action_reject = tsip_atype_reject,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_receiveINFO = 0xFF,
- _fsm_action_1xx,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_300_to_699,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_sendINFO = tsip_atype_info_send,
+ _fsm_action_accept = tsip_atype_accept,
+ _fsm_action_reject = tsip_atype_reject,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_receiveINFO = 0xFF,
+ _fsm_action_1xx,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_300_to_699,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Sending,
- _fsm_state_Receiving,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Sending,
+ _fsm_state_Receiving,
+ _fsm_state_Terminated
}
_fsm_state_t;
static int tsip_dialog_info_event_callback(const tsip_dialog_info_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg)
- {
- if(TSIP_MESSAGE_IS_RESPONSE(msg))
- {
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, tsk_null);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, tsk_null);
- }
- else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, tsk_null);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, tsk_null);
- }
- else{ /* Should never happen */
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, tsk_null);
- }
- }
- else if (TSIP_REQUEST_IS_INFO(msg)){ /* have been checked by dialog layer...but */
- // REQUEST ==> Incoming INFO
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveINFO, msg, tsk_null);
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, tsk_null);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, tsk_null);
+ }
+ else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, tsk_null);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, tsk_null);
+ }
+ else { /* Should never happen */
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, tsk_null);
+ }
+ }
+ else if (TSIP_REQUEST_IS_INFO(msg)) { /* have been checked by dialog layer...but */
+ // REQUEST ==> Incoming INFO
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveINFO, msg, tsk_null);
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
tsip_dialog_info_t* tsip_dialog_info_create(const tsip_ssession_handle_t* ss)
{
- return tsk_object_new(tsip_dialog_info_def_t, ss);
+ return tsk_object_new(tsip_dialog_info_def_t, ss);
}
int tsip_dialog_info_init(tsip_dialog_info_t *self)
{
- //const tsk_param_t* param;
-
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (send) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendINFO, _fsm_state_Sending, tsip_dialog_info_Started_2_Sending_X_sendINFO, "tsip_dialog_info_Started_2_Sending_X_sendINFO"),
- // Started -> (receive) -> Receiving
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveINFO, _fsm_state_Receiving, tsip_dialog_info_Started_2_Receiving_X_recvINFO, "tsip_dialog_info_Started_2_Receiving_X_recvINFO"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_info_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Sending ===
- */
- // Sending -> (1xx) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_info_Sending_2_Sending_X_1xx, "tsip_dialog_info_Sending_2_Sending_X_1xx"),
- // Sending -> (2xx) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_2xx, "tsip_dialog_info_Sending_2_Terminated_X_2xx"),
- // Sending -> (401/407/421/494) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_info_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_info_Sending_2_Sending_X_401_407_421_494"),
- // Sending -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_300_to_699, "tsip_dialog_info_Sending_2_Terminated_X_300_to_699"),
- // Sending -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_cancel, "tsip_dialog_info_Sending_2_Terminated_X_cancel"),
- // Sending -> (shutdown) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_info_Sending_2_Terminated_X_shutdown"),
- // Sending -> (Any) -> Sending
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_info_Sending_2_Sending_X_any"),
-
- /*=======================
- * === Receiving ===
- */
- // Receiving -> (accept) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_info_Receiving_2_Terminated_X_accept, "tsip_dialog_info_Receiving_2_Terminated_X_accept"),
- // Receiving -> (rejected) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_info_Receiving_2_Terminated_X_reject, "tsip_dialog_info_Receiving_2_Terminated_X_reject"),
- // Receiving -> (Any) -> Receiving
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_info_Receiving_2_Receiving_X_any"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_info_Any_2_Terminated_X_transportError, "tsip_dialog_info_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_info_Any_2_Terminated_X_Error, "tsip_dialog_info_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_info_event_callback);
-
- return 0;
+ //const tsk_param_t* param;
+
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (send) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendINFO, _fsm_state_Sending, tsip_dialog_info_Started_2_Sending_X_sendINFO, "tsip_dialog_info_Started_2_Sending_X_sendINFO"),
+ // Started -> (receive) -> Receiving
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveINFO, _fsm_state_Receiving, tsip_dialog_info_Started_2_Receiving_X_recvINFO, "tsip_dialog_info_Started_2_Receiving_X_recvINFO"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_info_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Sending ===
+ */
+ // Sending -> (1xx) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_info_Sending_2_Sending_X_1xx, "tsip_dialog_info_Sending_2_Sending_X_1xx"),
+ // Sending -> (2xx) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_2xx, "tsip_dialog_info_Sending_2_Terminated_X_2xx"),
+ // Sending -> (401/407/421/494) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_info_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_info_Sending_2_Sending_X_401_407_421_494"),
+ // Sending -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_300_to_699, "tsip_dialog_info_Sending_2_Terminated_X_300_to_699"),
+ // Sending -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_info_Sending_2_Terminated_X_cancel, "tsip_dialog_info_Sending_2_Terminated_X_cancel"),
+ // Sending -> (shutdown) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_info_Sending_2_Terminated_X_shutdown"),
+ // Sending -> (Any) -> Sending
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_info_Sending_2_Sending_X_any"),
+
+ /*=======================
+ * === Receiving ===
+ */
+ // Receiving -> (accept) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_info_Receiving_2_Terminated_X_accept, "tsip_dialog_info_Receiving_2_Terminated_X_accept"),
+ // Receiving -> (rejected) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_info_Receiving_2_Terminated_X_reject, "tsip_dialog_info_Receiving_2_Terminated_X_reject"),
+ // Receiving -> (Any) -> Receiving
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_info_Receiving_2_Receiving_X_any"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_info_Any_2_Terminated_X_transportError, "tsip_dialog_info_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_info_Any_2_Terminated_X_Error, "tsip_dialog_info_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_info_event_callback);
+
+ return 0;
}
@@ -227,219 +220,219 @@ int tsip_dialog_info_init(tsip_dialog_info_t *self)
*/
int tsip_dialog_info_Started_2_Sending_X_sendINFO(va_list *app)
{
- tsip_dialog_info_t *self;
- const tsip_action_t* action;
+ tsip_dialog_info_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_info_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_info_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- return send_INFO(self);
+ return send_INFO(self);
}
/* Started -> (recvINFO) -> Receiving
*/
int tsip_dialog_info_Started_2_Receiving_X_recvINFO(va_list *app)
{
- tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
-
- /* Alert the user. */
- TSIP_DIALOG_INFO_SIGNAL(self, tsip_i_info,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
-
- /* Update last incoming INFO */
- TSK_OBJECT_SAFE_FREE(self->last_iMessage);
- self->last_iMessage = tsk_object_ref((void*)request);
-
- return 0;
+ tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+
+ /* Alert the user. */
+ TSIP_DIALOG_INFO_SIGNAL(self, tsip_i_info,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+
+ /* Update last incoming INFO */
+ TSK_OBJECT_SAFE_FREE(self->last_iMessage);
+ self->last_iMessage = tsk_object_ref((void*)request);
+
+ return 0;
}
/* Sending -> (1xx) -> Sending
*/
int tsip_dialog_info_Sending_2_Sending_X_1xx(va_list *app)
{
- /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+ /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
- return 0;
+ return 0;
}
/* Sending -> (2xx) -> Sending
*/
int tsip_dialog_info_Sending_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Reset curr action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+ /* Reset curr action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
- return 0;
+ return 0;
}
/* Sending -> (401/407/421/494) -> Sending
*/
int tsip_dialog_info_Sending_2_Sending_X_401_407_421_494(va_list *app)
{
- tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- // Alert the user
- TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- return send_INFO(self);
+ tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ // Alert the user
+ TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return ret;
+ }
+
+ return send_INFO(self);
}
/* Sending -> (300 to 699) -> Terminated
*/
int tsip_dialog_info_Sending_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
- /* Alert the user. */
- TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_INFO_SIGNAL(self, tsip_ao_info,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Sending -> (cancel) -> Terminated
*/
int tsip_dialog_info_Sending_2_Terminated_X_cancel(va_list *app)
{
- tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
- /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
+ tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);
+ /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "INFO cancelled");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "INFO cancelled");
- return 0;
+ return 0;
}
/* Receiving -> (accept) -> Terminated
*/
int tsip_dialog_info_Receiving_2_Terminated_X_accept(va_list *app)
{
- tsip_dialog_info_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_info_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->last_iMessage){
- TSK_DEBUG_ERROR("There is non INFO to accept()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 200 OK */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->last_iMessage))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_info_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_info_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->last_iMessage) {
+ TSK_DEBUG_ERROR("There is non INFO to accept()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 200 OK */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->last_iMessage))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Receiving -> (reject) -> Terminated
*/
int tsip_dialog_info_Receiving_2_Terminated_X_reject(va_list *app)
{
- tsip_dialog_info_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_info_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->last_iMessage){
- TSK_DEBUG_ERROR("There is non INFO to reject()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 486 Rejected */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->last_iMessage))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_info_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_info_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->last_iMessage) {
+ TSK_DEBUG_ERROR("There is non INFO to reject()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 486 Rejected */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->last_iMessage))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_info_Any_2_Terminated_X_transportError(va_list *app)
{
- /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
/* Any -> (error) -> Terminated
*/
int tsip_dialog_info_Any_2_Terminated_X_Error(va_list *app)
{
- /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_info_t *self = va_arg(*app, tsip_dialog_info_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -448,39 +441,39 @@ int tsip_dialog_info_Any_2_Terminated_X_Error(va_list *app)
int send_INFO(tsip_dialog_info_t *self)
{
- tsip_request_t* request = tsk_null;
- int ret = -1;
+ tsip_request_t* request = tsk_null;
+ int ret = -1;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))){
- return -2;
- }
+ if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))) {
+ return -2;
+ }
- /* apply action params to the request */
- if(TSIP_DIALOG(self)->curr_action){
- tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
- }
+ /* apply action params to the request */
+ if(TSIP_DIALOG(self)->curr_action) {
+ tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
+ }
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- TSK_OBJECT_SAFE_FREE(request);
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ TSK_OBJECT_SAFE_FREE(request);
- return ret;
+ return ret;
}
int tsip_dialog_info_OnTerminated(tsip_dialog_info_t *self)
{
- TSK_DEBUG_INFO("=== INFO Dialog terminated ===");
+ TSK_DEBUG_INFO("=== INFO Dialog terminated ===");
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -509,48 +502,47 @@ int tsip_dialog_info_OnTerminated(tsip_dialog_info_t *self)
//
static tsk_object_t* tsip_dialog_info_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_info_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ tsip_dialog_info_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_INFO, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_INFO, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
- /* FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_info_OnTerminated), (const void*)dialog);
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_info_OnTerminated), (const void*)dialog);
- /* Initialize the class itself */
- tsip_dialog_info_init(self);
- }
- return self;
+ /* Initialize the class itself */
+ tsip_dialog_info_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_info_dtor(tsk_object_t * self)
-{
- tsip_dialog_info_t *dialog = self;
- if(dialog){
- /* DeInitialize base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
-
- /* DeInitialize self */
- TSK_OBJECT_SAFE_FREE(dialog->last_iMessage);
-
- TSK_DEBUG_INFO("*** INFO Dialog destroyed ***");
- }
- return self;
+{
+ tsip_dialog_info_t *dialog = self;
+ if(dialog) {
+ /* DeInitialize base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
+
+ /* DeInitialize self */
+ TSK_OBJECT_SAFE_FREE(dialog->last_iMessage);
+
+ TSK_DEBUG_INFO("*** INFO Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_info_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_info_def_s =
-{
- sizeof(tsip_dialog_info_t),
- tsip_dialog_info_ctor,
- tsip_dialog_info_dtor,
- tsip_dialog_info_cmp,
+static const tsk_object_def_t tsip_dialog_info_def_s = {
+ sizeof(tsip_dialog_info_t),
+ tsip_dialog_info_ctor,
+ tsip_dialog_info_dtor,
+ tsip_dialog_info_cmp,
};
const tsk_object_def_t *tsip_dialog_info_def_t = &tsip_dialog_info_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.c b/tinySIP/src/dialogs/tsip_dialog_invite.c
index ed7b3d5..73bbb2d 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -70,7 +70,7 @@
// 3GPP TS 26.114 (MMTel): Media handling and interaction
// 3GPP TS 24.173 (MMTel): Supplementary Services
//
-/* ======================== MMTel Supplementary Services ========================
+/* ======================== MMTel Supplementary Services ========================
3GPP TS 24.607 : Originating Identification Presentation
3GPP TS 24.608 : Terminating Identification Presentation
3GPP TS 24.607 : Originating Identification Restriction
@@ -78,14 +78,14 @@
3GPP TS 24.604 : Communication Diversion Unconditional
3GPP TS 24.604 : Communication Diversion on not Logged
-3GPP TS 24.604 : Communication Diversion on Busy
+3GPP TS 24.604 : Communication Diversion on Busy
3GPP TS 24.604 : Communication Diversion on not Reachable
3GPP TS 24.604 : Communication Diversion on No Reply
3GPP TS 24.611 : Barring of All Incoming Calls
3GPP TS 24.611 : Barring of All Outgoing Calls
3GPP TS 24.611 : Barring of Outgoing International Calls
3GPP TS 24.611 : Barring of Incoming Calls - When Roaming
-3GPP TS 24.610 : Communication Hold
+3GPP TS 24.610 : Communication Hold
3GPP TS 24.606 : Message Waiting Indication
3GPP TS 24.615 : Communication Waiting
3GPP TS 24.605 : Ad-Hoc Multi Party Conference
@@ -150,23 +150,23 @@ static int x9999_Any_2_Any_X_Error(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_resp2INVITE(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_INVITE(message);
+ return TSIP_RESPONSE_IS_TO_INVITE(message);
}
static tsk_bool_t _fsm_cond_is_resp2UPDATE(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_UPDATE(message);
+ return TSIP_RESPONSE_IS_TO_UPDATE(message);
}
static tsk_bool_t _fsm_cond_is_resp2BYE(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_BYE(message);
+ return TSIP_RESPONSE_IS_TO_BYE(message);
}
static tsk_bool_t _fsm_cond_is_resp2PRACK(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_PRACK(message);
+ return TSIP_RESPONSE_IS_TO_PRACK(message);
}
static tsk_bool_t _fsm_cond_is_resp2INFO(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_INFO(message);
+ return TSIP_RESPONSE_IS_TO_INFO(message);
}
/* ======================== actions ======================== */
@@ -192,352 +192,348 @@ extern int tsip_dialog_invite_qos_init(tsip_dialog_invite_t *self);
int tsip_dialog_invite_event_callback(const tsip_dialog_invite_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg){
- if(TSIP_MESSAGE_IS_RESPONSE(msg)){ /* Response */
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){ // 100-199
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){ // 200-299
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i2xx, msg, action);
- }
- else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407){ // 401,407
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i401_i407, msg, action);
- }
- else if(TSIP_RESPONSE_CODE(msg) == 422){ // 422
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i422, msg, action);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){ // 300-699
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i300_to_i699, msg, action);
- }
- else; // Ignore
- }
- else{ /* Request */
- if(TSIP_REQUEST_IS_INVITE(msg)){ // INVITE
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iINVITE, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_UPDATE(msg)){ // UPDATE
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iUPDATE, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_PRACK(msg)){ // PRACK
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iPRACK, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_ACK(msg)){ // ACK
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iACK, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_OPTIONS(msg)){ // OPTIONS
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iOPTIONS, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_BYE(msg)){ // BYE
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iBYE, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_CANCEL(msg)){ // CANCEL
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iCANCEL, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_INFO(msg)){ // INFO
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iINFO, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_NOTIFY(msg)){ // NOTIFY
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iNOTIFY, msg, tsk_null);
- }
- else if(TSIP_REQUEST_IS_REFER(msg)){ // REFER
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iREFER, msg, tsk_null);
- }
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oCANCEL, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_timedout:
- {
- // Do nothing if request type is "INFO"
- if(!TSIP_MESSAGE_IS_REQUEST(msg) || !TSIP_REQUEST_IS_INFO(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- }
- break;
- }
- case tsip_dialog_terminated:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) { /* Response */
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) { // 100-199
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) { // 200-299
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407) { // 401,407
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i401_i407, msg, action);
+ }
+ else if(TSIP_RESPONSE_CODE(msg) == 422) { // 422
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i422, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) { // 300-699
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_i300_to_i699, msg, action);
+ }
+ else; // Ignore
+ }
+ else { /* Request */
+ if(TSIP_REQUEST_IS_INVITE(msg)) { // INVITE
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iINVITE, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_UPDATE(msg)) { // UPDATE
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iUPDATE, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_PRACK(msg)) { // PRACK
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iPRACK, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_ACK(msg)) { // ACK
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iACK, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_OPTIONS(msg)) { // OPTIONS
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iOPTIONS, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_BYE(msg)) { // BYE
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iBYE, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_CANCEL(msg)) { // CANCEL
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iCANCEL, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_INFO(msg)) { // INFO
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iINFO, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_NOTIFY(msg)) { // NOTIFY
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iNOTIFY, msg, tsk_null);
+ }
+ else if(TSIP_REQUEST_IS_REFER(msg)) { // REFER
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iREFER, msg, tsk_null);
+ }
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oCANCEL, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_timedout: {
+ // Do nothing if request type is "INFO"
+ if(!TSIP_MESSAGE_IS_REQUEST(msg) || !TSIP_REQUEST_IS_INFO(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ }
+ break;
+ }
+ case tsip_dialog_terminated:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
/**Timer manager callback.
*
- * @param self The owner of the signaled timer.
+ * @param self The owner of the signaled timer.
* @param timer_id The identifier of the signaled timer.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_invite_timer_callback(const tsip_dialog_invite_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self){
- if(timer_id == self->stimers.timer.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timerRefresh, tsk_null, tsk_null);
- }
- else if(timer_id == self->timer100rel.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timer100rel, tsk_null, tsk_null);
- }
- else if(timer_id == self->qos.timer.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timerRSVP, tsk_null, tsk_null);
- }
- else if(timer_id == self->timershutdown.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self) {
+ if(timer_id == self->stimers.timer.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timerRefresh, tsk_null, tsk_null);
+ }
+ else if(timer_id == self->timer100rel.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timer100rel, tsk_null, tsk_null);
+ }
+ else if(timer_id == self->qos.timer.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_timerRSVP, tsk_null, tsk_null);
+ }
+ else if(timer_id == self->timershutdown.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
+ }
+ }
+ return ret;
}
tsip_dialog_invite_t* tsip_dialog_invite_create(const tsip_ssession_handle_t* ss, const char* call_id)
{
- return tsk_object_new(tsip_dialog_invite_def_t, ss, call_id);
+ return tsk_object_new(tsip_dialog_invite_def_t, ss, call_id);
}
int tsip_dialog_invite_init(tsip_dialog_invite_t *self)
{
- /* special cases (fsm) should be tried first */
-
- /* ICE */
- tsip_dialog_invite_ice_init(self);
- /* Client-Side dialog */
- tsip_dialog_invite_client_init(self);
- /* Server-Side dialog */
- tsip_dialog_invite_server_init(self);
- /* 3GPP TS 24.610: Communication Hold */
- tsip_dialog_invite_hold_init(self);
- /* 3GPP TS 24.629: Explicit Communication Transfer (ECT) using IP Multimedia (IM) Core Network (CN) subsystem */
- tsip_dialog_invite_ect_init(self);
- /* RFC 4028: Session Timers */
- tsip_dialog_invite_stimers_init(self);
- /* RFC 3312: Integration of Resource Management and Session Initiation Protocol (SIP) */
- tsip_dialog_invite_qos_init(self);
-
- /* Initialize the state machine (all other cases) */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_invite_Started_2_Started_X_any"),
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (Send DTMF) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_dtmf_send, _fsm_state_Connected, x0000_Connected_2_Connected_X_oDTMF, "x0000_Connected_2_Connected_X_oDTMF"),
- // Connected -> (Send MSRP message) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_msrp_send_msg, _fsm_state_Connected, x0000_Connected_2_Connected_X_oLMessage, "x0000_Connected_2_Connected_X_oLMessage"),
- // Connected -> (iACK) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iACK, _fsm_state_Connected, x0000_Connected_2_Connected_X_iACK, "x0000_Connected_2_Connected_X_iACK"),
- // Connected -> (iINVITE) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iINVITE, _fsm_state_Connected, x0000_Connected_2_Connected_X_iINVITEorUPDATE, "x0000_Connected_2_Connected_X_iINVITE"),
- // Connected -> (iUPDATE) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iUPDATE, _fsm_state_Connected, x0000_Connected_2_Connected_X_iINVITEorUPDATE, "x0000_Connected_2_Connected_X_iUPDATE"),
- // Connected -> (send reINVITE) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oINVITE, _fsm_state_Connected, x0000_Connected_2_Connected_X_oINVITE, "x0000_Connected_2_Connected_X_oINVITE"),
-
- /*=======================
- * === BYE/SHUTDOWN ===
- */
- // Any -> (oBYE) -> Trying
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oBYE, _fsm_state_Trying, x0000_Any_2_Trying_X_oBYE, "x0000_Any_2_Trying_X_oBYE"),
- // Any -> (iBYE) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iBYE, _fsm_state_Terminated, x0000_Any_2_Terminated_X_iBYE, "x0000_Any_2_Terminated_X_iBYE"),
- // Any -> (i401/407 BYE) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2BYE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
- // Any -> (i3xx-i6xx BYE) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i300_to_i699, _fsm_cond_is_resp2BYE, _fsm_state_Terminated, tsk_null, "x0000_Any_2_Terminated_X_i3xxTOi6xxBYE"),
- // Any -> (i2xxx BYE) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2BYE, _fsm_state_Terminated, tsk_null, "x0000_Any_2_Terminated_X_i2xxBYE"),
- // Any -> (Shutdown) -> Trying
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oShutdown, _fsm_state_Trying, x0000_Any_2_Trying_X_shutdown, "x0000_Any_2_Trying_X_shutdown"),
- // Any -> (shutdown timedout) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_invite_shutdown_timedout"),
-
-
- /*=======================
- * === Any ===
- */
- // Any -> (i1xx) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_i1xx, tsk_fsm_state_any, x0000_Any_2_Any_X_i1xx, "x0000_Any_2_Any_X_i1xx"),
- // Any -> (oINFO) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oINFO, tsk_fsm_state_any, x0000_Any_2_Any_X_oINFO, "x0000_Any_2_Any_X_oINFO"),
- // Any -> (iINFO) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iINFO, tsk_fsm_state_any, x0000_Any_2_Any_X_iINFO, "x0000_Any_2_Any_X_iINFO"),
- // Any -> (i401/407)
- //
- // Any -> (iPRACK) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iPRACK, tsk_fsm_state_any, x0000_Any_2_Any_X_iPRACK, "x0000_Any_2_Any_X_iPRACK"),
- // Any -> (iOPTIONS) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iOPTIONS, tsk_fsm_state_any, x0000_Any_2_Any_X_iOPTIONS, "x0000_Any_2_Any_X_iOPTIONS"),
- // Any -> (i2xx INVITE) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2INVITE, tsk_fsm_state_any, x0000_Any_2_Any_X_i2xxINVITEorUPDATE, "x0000_Any_2_Any_X_i2xxINVITE"),
- // Any -> (i2xx UPDATE) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2UPDATE, tsk_fsm_state_any, x0000_Any_2_Any_X_i2xxINVITEorUPDATE, "x0000_Any_2_Any_X_i2xxUPDATE"),
- // Any -> (i401/407 INVITE) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2INVITE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
- // Any -> (i401/407 UPDATE) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2UPDATE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
- // Any -> (i2xx PRACK) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2PRACK, tsk_fsm_state_any, tsk_null, "x0000_Any_2_Any_X_i2xxPRACK"),
- // Any -> (i2xx INFO) -> Any
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2INFO, tsk_fsm_state_any, tsk_null, "x0000_Any_2_Any_X_i2xxINFO"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, x9998_Any_2_Terminated_X_transportError, "x9998_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, x9999_Any_2_Any_X_Error, "x9999_Any_2_Any_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- /* Sets callback function */
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_invite_event_callback);
-
- /* Timers */
- self->timer100rel.id = TSK_INVALID_TIMER_ID;
- self->stimers.timer.id = TSK_INVALID_TIMER_ID;
- self->timershutdown.id = TSK_INVALID_TIMER_ID;
- self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
-
- return 0;
+ /* special cases (fsm) should be tried first */
+
+ /* ICE */
+ tsip_dialog_invite_ice_init(self);
+ /* Client-Side dialog */
+ tsip_dialog_invite_client_init(self);
+ /* Server-Side dialog */
+ tsip_dialog_invite_server_init(self);
+ /* 3GPP TS 24.610: Communication Hold */
+ tsip_dialog_invite_hold_init(self);
+ /* 3GPP TS 24.629: Explicit Communication Transfer (ECT) using IP Multimedia (IM) Core Network (CN) subsystem */
+ tsip_dialog_invite_ect_init(self);
+ /* RFC 4028: Session Timers */
+ tsip_dialog_invite_stimers_init(self);
+ /* RFC 3312: Integration of Resource Management and Session Initiation Protocol (SIP) */
+ tsip_dialog_invite_qos_init(self);
+
+ /* Initialize the state machine (all other cases) */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_invite_Started_2_Started_X_any"),
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (Send DTMF) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_dtmf_send, _fsm_state_Connected, x0000_Connected_2_Connected_X_oDTMF, "x0000_Connected_2_Connected_X_oDTMF"),
+ // Connected -> (Send MSRP message) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_msrp_send_msg, _fsm_state_Connected, x0000_Connected_2_Connected_X_oLMessage, "x0000_Connected_2_Connected_X_oLMessage"),
+ // Connected -> (iACK) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iACK, _fsm_state_Connected, x0000_Connected_2_Connected_X_iACK, "x0000_Connected_2_Connected_X_iACK"),
+ // Connected -> (iINVITE) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iINVITE, _fsm_state_Connected, x0000_Connected_2_Connected_X_iINVITEorUPDATE, "x0000_Connected_2_Connected_X_iINVITE"),
+ // Connected -> (iUPDATE) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iUPDATE, _fsm_state_Connected, x0000_Connected_2_Connected_X_iINVITEorUPDATE, "x0000_Connected_2_Connected_X_iUPDATE"),
+ // Connected -> (send reINVITE) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oINVITE, _fsm_state_Connected, x0000_Connected_2_Connected_X_oINVITE, "x0000_Connected_2_Connected_X_oINVITE"),
+
+ /*=======================
+ * === BYE/SHUTDOWN ===
+ */
+ // Any -> (oBYE) -> Trying
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oBYE, _fsm_state_Trying, x0000_Any_2_Trying_X_oBYE, "x0000_Any_2_Trying_X_oBYE"),
+ // Any -> (iBYE) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iBYE, _fsm_state_Terminated, x0000_Any_2_Terminated_X_iBYE, "x0000_Any_2_Terminated_X_iBYE"),
+ // Any -> (i401/407 BYE) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2BYE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
+ // Any -> (i3xx-i6xx BYE) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i300_to_i699, _fsm_cond_is_resp2BYE, _fsm_state_Terminated, tsk_null, "x0000_Any_2_Terminated_X_i3xxTOi6xxBYE"),
+ // Any -> (i2xxx BYE) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2BYE, _fsm_state_Terminated, tsk_null, "x0000_Any_2_Terminated_X_i2xxBYE"),
+ // Any -> (Shutdown) -> Trying
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oShutdown, _fsm_state_Trying, x0000_Any_2_Trying_X_shutdown, "x0000_Any_2_Trying_X_shutdown"),
+ // Any -> (shutdown timedout) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_invite_shutdown_timedout"),
+
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (i1xx) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_i1xx, tsk_fsm_state_any, x0000_Any_2_Any_X_i1xx, "x0000_Any_2_Any_X_i1xx"),
+ // Any -> (oINFO) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_oINFO, tsk_fsm_state_any, x0000_Any_2_Any_X_oINFO, "x0000_Any_2_Any_X_oINFO"),
+ // Any -> (iINFO) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iINFO, tsk_fsm_state_any, x0000_Any_2_Any_X_iINFO, "x0000_Any_2_Any_X_iINFO"),
+ // Any -> (i401/407)
+ //
+ // Any -> (iPRACK) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iPRACK, tsk_fsm_state_any, x0000_Any_2_Any_X_iPRACK, "x0000_Any_2_Any_X_iPRACK"),
+ // Any -> (iOPTIONS) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_iOPTIONS, tsk_fsm_state_any, x0000_Any_2_Any_X_iOPTIONS, "x0000_Any_2_Any_X_iOPTIONS"),
+ // Any -> (i2xx INVITE) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2INVITE, tsk_fsm_state_any, x0000_Any_2_Any_X_i2xxINVITEorUPDATE, "x0000_Any_2_Any_X_i2xxINVITE"),
+ // Any -> (i2xx UPDATE) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2UPDATE, tsk_fsm_state_any, x0000_Any_2_Any_X_i2xxINVITEorUPDATE, "x0000_Any_2_Any_X_i2xxUPDATE"),
+ // Any -> (i401/407 INVITE) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2INVITE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
+ // Any -> (i401/407 UPDATE) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i401_i407, _fsm_cond_is_resp2UPDATE, tsk_fsm_state_any, x0000_Any_2_Any_X_i401_407_Challenge, "x0000_Any_2_Any_X_i401_407_Challenge"),
+ // Any -> (i2xx PRACK) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2PRACK, tsk_fsm_state_any, tsk_null, "x0000_Any_2_Any_X_i2xxPRACK"),
+ // Any -> (i2xx INFO) -> Any
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_i2xx, _fsm_cond_is_resp2INFO, tsk_fsm_state_any, tsk_null, "x0000_Any_2_Any_X_i2xxINFO"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, x9998_Any_2_Terminated_X_transportError, "x9998_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, x9999_Any_2_Any_X_Error, "x9999_Any_2_Any_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Sets callback function */
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_invite_event_callback);
+
+ /* Timers */
+ self->timer100rel.id = TSK_INVALID_TIMER_ID;
+ self->stimers.timer.id = TSK_INVALID_TIMER_ID;
+ self->timershutdown.id = TSK_INVALID_TIMER_ID;
+ self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
+
+ return 0;
}
// start sending
int tsip_dialog_invite_start(tsip_dialog_invite_t *self)
{
- int ret = -1;
- if(self && !TSIP_DIALOG(self)->running){
- if(!(ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oINVITE, tsk_null, tsk_null))){
- TSIP_DIALOG(self)->running = tsk_true;
- }
- }
- return ret;
+ int ret = -1;
+ if(self && !TSIP_DIALOG(self)->running) {
+ if(!(ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oINVITE, tsk_null, tsk_null))) {
+ TSIP_DIALOG(self)->running = tsk_true;
+ }
+ }
+ return ret;
}
int tsip_dialog_invite_process_ro(tsip_dialog_invite_t *self, const tsip_message_t* message)
{
- tsdp_message_t* sdp_ro = tsk_null;
- tmedia_type_t old_media_type;
- tmedia_type_t new_media_type;
- tsk_bool_t media_session_was_null;
- int ret = 0;
- tmedia_ro_type_t ro_type = tmedia_ro_type_none;
-
- if(!self || !message){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
+ tsdp_message_t* sdp_ro = tsk_null;
+ tmedia_type_t old_media_type;
+ tmedia_type_t new_media_type;
+ tsk_bool_t media_session_was_null;
+ int ret = 0;
+ tmedia_ro_type_t ro_type = tmedia_ro_type_none;
+
+ if(!self || !message) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
if (self->is_cancelling) {
TSK_DEBUG_INFO("Cancelling the INVITE...ignore the incoming SDP");
return 0;
}
- /* Parse SDP content */
- if(TSIP_MESSAGE_HAS_CONTENT(message)){
- if(tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))){
- if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))){
- TSK_DEBUG_ERROR("Failed to parse remote sdp message:\n [%s]", (const char*)TSIP_MESSAGE_CONTENT_DATA(message));
- return -2;
- }
- // ICE processing
- if(self->supported.ice){
- tsip_dialog_invite_ice_process_ro(self, sdp_ro, TSIP_MESSAGE_IS_REQUEST(message));
- }
- }
- else{
- TSK_DEBUG_ERROR("[%s] content-type is not supportted", TSIP_MESSAGE_CONTENT_TYPE(message));
- return -3;
- }
- }
- else{
- if(TSIP_DIALOG(self)->state == tsip_initial && TSIP_REQUEST_IS_INVITE(message)){ /* Bodiless initial INVITE */
- TSIP_DIALOG_GET_SS(self)->media.type = tmedia_defaults_get_media_type(); // Default media for initial INVITE to send with the first reliable answer
- }
- else{
- return 0;
- }
- }
-
- ro_type = (TSIP_REQUEST_IS_INVITE(message) || TSIP_REQUEST_IS_UPDATE(message)) // ACK/PRACK can only contain a response if the initial INVITE was bodiless
- ? tmedia_ro_type_offer
- :(TSIP_RESPONSE_IS_1XX(message) ? tmedia_ro_type_provisional : tmedia_ro_type_answer);
- media_session_was_null = (self->msession_mgr == tsk_null);
- old_media_type = TSIP_DIALOG_GET_SS(self)->media.type;
- new_media_type = sdp_ro ? tmedia_type_from_sdp(sdp_ro) : old_media_type;
-
- /* Create session Manager if not already done */
- if(!self->msession_mgr){
- int32_t transport_idx = TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default;
- TSIP_DIALOG_GET_SS(self)->media.type = new_media_type;
- self->msession_mgr = tmedia_session_mgr_create(TSIP_DIALOG_GET_SS(self)->media.type, TSIP_DIALOG_GET_STACK(self)->network.local_ip[transport_idx],
- TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]), (sdp_ro == tsk_null));
- if(TSIP_DIALOG_GET_STACK(self)->natt.ctx){
- tmedia_session_mgr_set_natt_ctx(self->msession_mgr, TSIP_DIALOG_GET_STACK(self)->natt.ctx, TSIP_DIALOG_GET_STACK(self)->network.aor.ip[transport_idx]);
- }
- ret = tmedia_session_mgr_set_ice_ctx(self->msession_mgr, self->ice.ctx_audio, self->ice.ctx_video);
- }
-
- if(sdp_ro){
- if (tmedia_session_mgr_is_new_ro(self->msession_mgr, sdp_ro)) {
- ret = tsip_dialog_invite_msession_configure(self);
- }
- if((ret = tmedia_session_mgr_set_ro(self->msession_mgr, sdp_ro, ro_type))){
- TSK_DEBUG_ERROR("Failed to set remote offer");
- goto bail;
- }
- }
-
- // is media update?
- // (old_media_type == new_media_type) means the new session are rejected. This is way we match the CSeq
- if(!media_session_was_null && (old_media_type != new_media_type || (TSIP_MESSAGE_IS_RESPONSE(message) && self->cseq_out_media_update == message->CSeq->seq)) && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)){
- // at this point the media session manager has been succeffuly started and all is ok
- TSIP_DIALOG_GET_SS(self)->media.type = new_media_type;
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_updated,
- TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
- }
-
- /* start session manager */
- if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)){
- /* Set MSRP Callback */
- if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp){
- tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
- }
- /* starts session manager*/
- ret = tsip_dialog_invite_msession_start(self);
-
- if(ret == 0 && TSIP_DIALOG(self)->state == tsip_early){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_early_media,
- TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
- }
- }
-
+ /* Parse SDP content */
+ if(TSIP_MESSAGE_HAS_CONTENT(message)) {
+ if(tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))) {
+ if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))) {
+ TSK_DEBUG_ERROR("Failed to parse remote sdp message:\n [%s]", (const char*)TSIP_MESSAGE_CONTENT_DATA(message));
+ return -2;
+ }
+ // ICE processing
+ if(self->supported.ice) {
+ tsip_dialog_invite_ice_process_ro(self, sdp_ro, TSIP_MESSAGE_IS_REQUEST(message));
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("[%s] content-type is not supportted", TSIP_MESSAGE_CONTENT_TYPE(message));
+ return -3;
+ }
+ }
+ else {
+ if(TSIP_DIALOG(self)->state == tsip_initial && TSIP_REQUEST_IS_INVITE(message)) { /* Bodiless initial INVITE */
+ TSIP_DIALOG_GET_SS(self)->media.type = tmedia_defaults_get_media_type(); // Default media for initial INVITE to send with the first reliable answer
+ }
+ else {
+ return 0;
+ }
+ }
+
+ ro_type = (TSIP_REQUEST_IS_INVITE(message) || TSIP_REQUEST_IS_UPDATE(message)) // ACK/PRACK can only contain a response if the initial INVITE was bodiless
+ ? tmedia_ro_type_offer
+ :(TSIP_RESPONSE_IS_1XX(message) ? tmedia_ro_type_provisional : tmedia_ro_type_answer);
+ media_session_was_null = (self->msession_mgr == tsk_null);
+ old_media_type = TSIP_DIALOG_GET_SS(self)->media.type;
+ new_media_type = sdp_ro ? tmedia_type_from_sdp(sdp_ro) : old_media_type;
+
+ /* Create session Manager if not already done */
+ if(!self->msession_mgr) {
+ int32_t transport_idx = TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default;
+ TSIP_DIALOG_GET_SS(self)->media.type = new_media_type;
+ self->msession_mgr = tmedia_session_mgr_create(TSIP_DIALOG_GET_SS(self)->media.type, TSIP_DIALOG_GET_STACK(self)->network.local_ip[transport_idx],
+ TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]), (sdp_ro == tsk_null));
+ if(TSIP_DIALOG_GET_STACK(self)->natt.ctx) {
+ tmedia_session_mgr_set_natt_ctx(self->msession_mgr, TSIP_DIALOG_GET_STACK(self)->natt.ctx, TSIP_DIALOG_GET_STACK(self)->network.aor.ip[transport_idx]);
+ }
+ ret = tmedia_session_mgr_set_ice_ctx(self->msession_mgr, self->ice.ctx_audio, self->ice.ctx_video);
+ }
+
+ if(sdp_ro) {
+ if (tmedia_session_mgr_is_new_ro(self->msession_mgr, sdp_ro)) {
+ ret = tsip_dialog_invite_msession_configure(self);
+ }
+ if((ret = tmedia_session_mgr_set_ro(self->msession_mgr, sdp_ro, ro_type))) {
+ TSK_DEBUG_ERROR("Failed to set remote offer");
+ goto bail;
+ }
+ }
+
+ // is media update?
+ // (old_media_type == new_media_type) means the new session are rejected. This is way we match the CSeq
+ if(!media_session_was_null && (old_media_type != new_media_type || (TSIP_MESSAGE_IS_RESPONSE(message) && self->cseq_out_media_update == message->CSeq->seq)) && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)) {
+ // at this point the media session manager has been succeffuly started and all is ok
+ TSIP_DIALOG_GET_SS(self)->media.type = new_media_type;
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_updated,
+ TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
+ }
+
+ /* start session manager */
+ if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)) {
+ /* Set MSRP Callback */
+ if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp) {
+ tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
+ }
+ /* starts session manager*/
+ ret = tsip_dialog_invite_msession_start(self);
+
+ if(ret == 0 && TSIP_DIALOG(self)->state == tsip_early) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_early_media,
+ TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
+ }
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(sdp_ro);
+ TSK_OBJECT_SAFE_FREE(sdp_ro);
- return ret;
+ return ret;
}
@@ -547,520 +543,520 @@ bail:
int x0000_Connected_2_Connected_X_oDTMF(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(action){
- ret = tmedia_session_mgr_send_dtmf(self->msession_mgr, action->dtmf.event);
- }
- else{
- TSK_DEBUG_ERROR("Invalid action");
- }
-
- return 0; /* always */
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(action) {
+ ret = tmedia_session_mgr_send_dtmf(self->msession_mgr, action->dtmf.event);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid action");
+ }
+
+ return 0; /* always */
}
int x0000_Connected_2_Connected_X_oLMessage(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(action && action->payload){
- ret = tmedia_session_mgr_send_message(self->msession_mgr, action->payload->data, action->payload->size,
- action->media.params);
- }
- else{
- TSK_DEBUG_ERROR("Invalid action");
- }
-
- return 0;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(action && action->payload) {
+ ret = tmedia_session_mgr_send_message(self->msession_mgr, action->payload->data, action->payload->size,
+ action->media.params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid action");
+ }
+
+ return 0;
}
/* Connected -> (iACK) -> Connected */
int x0000_Connected_2_Connected_X_iACK(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rACK = va_arg(*app, const tsip_request_t *);
- int ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rACK = va_arg(*app, const tsip_request_t *);
+ int ret;
+
+ // Nothing to do (in future will be used to ensure the session)
- // Nothing to do (in future will be used to ensure the session)
-
/* No longer waiting for the initial ACK */
self->is_initial_iack_pending = tsk_false;
-
- /* Process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, rACK))){
- /* Send error */
- return ret;
- }
-
- /* Starts media session if not already done */
- if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)){
- ret = tsip_dialog_invite_msession_start(self);
- }
-
- // starts ICE timers now that both parties receive the "candidates"
- if(tsip_dialog_invite_ice_is_enabled(self)){
- tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
- }
-
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request", rACK);
-
- return 0;
+
+ /* Process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, rACK))) {
+ /* Send error */
+ return ret;
+ }
+
+ /* Starts media session if not already done */
+ if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)) {
+ ret = tsip_dialog_invite_msession_start(self);
+ }
+
+ // starts ICE timers now that both parties receive the "candidates"
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
+ }
+
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request", rACK);
+
+ return 0;
}
/* Connected -> (iINVITE or iUPDATE) -> Connected */
int x0000_Connected_2_Connected_X_iINVITEorUPDATE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rINVITEorUPDATE = va_arg(*app, const tsip_request_t *);
-
- int ret = 0;
- tsk_bool_t bodiless_invite;
- tmedia_type_t old_media_type = self->msession_mgr ? self->msession_mgr->type : tmedia_none;
- tmedia_type_t new_media_type;
- tsk_bool_t force_sdp;
-
- /* process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, rINVITEorUPDATE))){
- /* Send error */
- return ret;
- }
-
- // force SDP in 200 OK even if the request has the same SDP version
- force_sdp = TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE);
-
- // get new media_type after processing the remote offer
- new_media_type = self->msession_mgr ? self->msession_mgr->type : tmedia_none;
-
- /** response to bodiless iINVITE always contains SDP as explained below
- RFC3261 - 14.1 UAC Behavior
- The same offer-answer model that applies to session descriptions in
- INVITEs (Section 13.2.1) applies to re-INVITEs. As a result, a UAC
- that wants to add a media stream, for example, will create a new
- offer that contains this media stream, and send that in an INVITE
- request to its peer. It is important to note that the full
- description of the session, not just the change, is sent. This
- supports stateless session processing in various elements, and
- supports failover and recovery capabilities. Of course, a UAC MAY
- send a re-INVITE with no session description, in which case the first
- reliable non-failure response to the re-INVITE will contain the offer
- (in this specification, that is a 2xx response).
- */
- bodiless_invite = !TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE) && TSIP_REQUEST_IS_INVITE(rINVITEorUPDATE);
-
- /* session timers (must be before sending response) */
- if(self->stimers.timer.timeout){
- tsip_dialog_invite_stimers_handle(self, rINVITEorUPDATE);
- }
-
- /* hold/resume */
- tsip_dialog_invite_hold_handle(self, rINVITEorUPDATE);
-
- // send the response
- ret = send_RESPONSE(self, rINVITEorUPDATE, 200, "OK",
- (self->msession_mgr && (force_sdp || bodiless_invite || self->msession_mgr->ro_changed || self->msession_mgr->state_changed || (old_media_type != new_media_type))));
-
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", rINVITEorUPDATE);
-
- return ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rINVITEorUPDATE = va_arg(*app, const tsip_request_t *);
+
+ int ret = 0;
+ tsk_bool_t bodiless_invite;
+ tmedia_type_t old_media_type = self->msession_mgr ? self->msession_mgr->type : tmedia_none;
+ tmedia_type_t new_media_type;
+ tsk_bool_t force_sdp;
+
+ /* process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, rINVITEorUPDATE))) {
+ /* Send error */
+ return ret;
+ }
+
+ // force SDP in 200 OK even if the request has the same SDP version
+ force_sdp = TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE);
+
+ // get new media_type after processing the remote offer
+ new_media_type = self->msession_mgr ? self->msession_mgr->type : tmedia_none;
+
+ /** response to bodiless iINVITE always contains SDP as explained below
+ RFC3261 - 14.1 UAC Behavior
+ The same offer-answer model that applies to session descriptions in
+ INVITEs (Section 13.2.1) applies to re-INVITEs. As a result, a UAC
+ that wants to add a media stream, for example, will create a new
+ offer that contains this media stream, and send that in an INVITE
+ request to its peer. It is important to note that the full
+ description of the session, not just the change, is sent. This
+ supports stateless session processing in various elements, and
+ supports failover and recovery capabilities. Of course, a UAC MAY
+ send a re-INVITE with no session description, in which case the first
+ reliable non-failure response to the re-INVITE will contain the offer
+ (in this specification, that is a 2xx response).
+ */
+ bodiless_invite = !TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE) && TSIP_REQUEST_IS_INVITE(rINVITEorUPDATE);
+
+ /* session timers (must be before sending response) */
+ if(self->stimers.timer.timeout) {
+ tsip_dialog_invite_stimers_handle(self, rINVITEorUPDATE);
+ }
+
+ /* hold/resume */
+ tsip_dialog_invite_hold_handle(self, rINVITEorUPDATE);
+
+ // send the response
+ ret = send_RESPONSE(self, rINVITEorUPDATE, 200, "OK",
+ (self->msession_mgr && (force_sdp || bodiless_invite || self->msession_mgr->ro_changed || self->msession_mgr->state_changed || (old_media_type != new_media_type))));
+
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", rINVITEorUPDATE);
+
+ return ret;
}
/* Connected -> (send reINVITE) -> Connected */
static int x0000_Connected_2_Connected_X_oINVITE(va_list *app)
{
- int ret;
- tsk_bool_t mediaType_changed;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- /* Get Media type from the action */
- mediaType_changed = (TSIP_DIALOG_GET_SS(self)->media.type != action->media.type && action->media.type != tmedia_none);
- if (mediaType_changed){
- if (self->msession_mgr) {
- ret = tmedia_session_mgr_set_media_type(self->msession_mgr, action->media.type);
- }
- self->cseq_out_media_update = TSIP_DIALOG(self)->cseq_value + 1;
- }
-
- /* Appy media params received from the user */
- if(!TSK_LIST_IS_EMPTY(action->media.params)){
- ret = tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
- }
-
- /* send the request */
- ret = send_INVITE(self, mediaType_changed);
-
- /* alert the user */
- if(mediaType_changed){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_updating,
- tsip_event_code_dialog_request_outgoing, "Updating media type", self->last_oInvite);
- }
-
- return ret;
+ int ret;
+ tsk_bool_t mediaType_changed;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ /* Get Media type from the action */
+ mediaType_changed = (TSIP_DIALOG_GET_SS(self)->media.type != action->media.type && action->media.type != tmedia_none);
+ if (mediaType_changed) {
+ if (self->msession_mgr) {
+ ret = tmedia_session_mgr_set_media_type(self->msession_mgr, action->media.type);
+ }
+ self->cseq_out_media_update = TSIP_DIALOG(self)->cseq_value + 1;
+ }
+
+ /* Appy media params received from the user */
+ if(!TSK_LIST_IS_EMPTY(action->media.params)) {
+ ret = tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
+ }
+
+ /* send the request */
+ ret = send_INVITE(self, mediaType_changed);
+
+ /* alert the user */
+ if(mediaType_changed) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_updating,
+ tsip_event_code_dialog_request_outgoing, "Updating media type", self->last_oInvite);
+ }
+
+ return ret;
}
/* Any -> (iPRACK) -> Any */
int x0000_Any_2_Any_X_iPRACK(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rPRACK = va_arg(*app, const tsip_request_t *);
-
- const tsip_header_RAck_t* RAck;
-
- if((RAck = (const tsip_header_RAck_t*)tsip_message_get_header(rPRACK, tsip_htype_RAck))){
- if((RAck->seq == self->rseq) &&
- (tsk_striequals(RAck->method, self->last_o1xxrel->CSeq->method)) &&
- (RAck->cseq == self->last_o1xxrel->CSeq->seq)){
-
- ++self->rseq;
- return send_RESPONSE(self, rPRACK, 200, "OK", tsk_false);
- }
- }
-
- /* Send 488 */
- return send_ERROR(self, rPRACK, 488, "Failed to match PRACK request", "SIP; cause=488; text=\"Failed to match PRACK request\"");
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rPRACK = va_arg(*app, const tsip_request_t *);
+
+ const tsip_header_RAck_t* RAck;
+
+ if((RAck = (const tsip_header_RAck_t*)tsip_message_get_header(rPRACK, tsip_htype_RAck))) {
+ if((RAck->seq == self->rseq) &&
+ (tsk_striequals(RAck->method, self->last_o1xxrel->CSeq->method)) &&
+ (RAck->cseq == self->last_o1xxrel->CSeq->seq)) {
+
+ ++self->rseq;
+ return send_RESPONSE(self, rPRACK, 200, "OK", tsk_false);
+ }
+ }
+
+ /* Send 488 */
+ return send_ERROR(self, rPRACK, 488, "Failed to match PRACK request", "SIP; cause=488; text=\"Failed to match PRACK request\"");
}
/* Any -> (iOPTIONS) -> Any */
int x0000_Any_2_Any_X_iOPTIONS(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rOPTIONS = va_arg(*app, const tsip_request_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rOPTIONS = va_arg(*app, const tsip_request_t *);
- /* Alert user */
+ /* Alert user */
- /* Send 2xx */
- send_RESPONSE(self, rOPTIONS, 200, "OK", tsk_false);
+ /* Send 2xx */
+ send_RESPONSE(self, rOPTIONS, 200, "OK", tsk_false);
- return 0;
+ return 0;
}
/* Any --> (i401/407 INVITE or UPDATE) --> Any */
int x0000_Any_2_Any_X_i401_407_Challenge(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- /* Alert the user. */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- if(TSIP_RESPONSE_IS_TO_INVITE(response) || TSIP_RESPONSE_IS_TO_UPDATE(response)){
- return send_INVITEorUPDATE(self, TSIP_RESPONSE_IS_TO_INVITE(response), tsk_false);
- }
- else if(TSIP_RESPONSE_IS_TO_BYE(response)){
- return send_BYE(self);
- }
- else{
- TSK_DEBUG_ERROR("Unexpected code called");
- return 0;
- }
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ /* Alert the user. */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return ret;
+ }
+
+ if(TSIP_RESPONSE_IS_TO_INVITE(response) || TSIP_RESPONSE_IS_TO_UPDATE(response)) {
+ return send_INVITEorUPDATE(self, TSIP_RESPONSE_IS_TO_INVITE(response), tsk_false);
+ }
+ else if(TSIP_RESPONSE_IS_TO_BYE(response)) {
+ return send_BYE(self);
+ }
+ else {
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return 0;
+ }
}
/* Any --> (i2xx INVITE or i2xx UPDATE) --> Any */
int x0000_Any_2_Any_X_i2xxINVITEorUPDATE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *r2xx = va_arg(*app, const tsip_response_t *);
- int ret = 0;
-
- /* Update the dialog state */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), r2xx))){
- return ret;
- }
-
- /* session timers */
- if(self->stimers.timer.timeout){
- tsip_dialog_invite_stimers_handle(self, r2xx);
- }
-
- /* Process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, r2xx))){
- send_BYE(self);
- return ret;
- }
-
- /* send ACK */
- if(TSIP_RESPONSE_IS_TO_INVITE(r2xx)){
- ret = send_ACK(self, r2xx);
- }
-
- // starts ICE timers now that both parties received the "candidates"
- if(tsip_dialog_invite_ice_is_enabled(self)){
- tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
- }
-
- return ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *r2xx = va_arg(*app, const tsip_response_t *);
+ int ret = 0;
+
+ /* Update the dialog state */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), r2xx))) {
+ return ret;
+ }
+
+ /* session timers */
+ if(self->stimers.timer.timeout) {
+ tsip_dialog_invite_stimers_handle(self, r2xx);
+ }
+
+ /* Process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, r2xx))) {
+ send_BYE(self);
+ return ret;
+ }
+
+ /* send ACK */
+ if(TSIP_RESPONSE_IS_TO_INVITE(r2xx)) {
+ ret = send_ACK(self, r2xx);
+ }
+
+ // starts ICE timers now that both parties received the "candidates"
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
+ }
+
+ return ret;
}
/* Any -> (oBYE) -> Trying */
int x0000_Any_2_Trying_X_oBYE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- int ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ int ret;
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- /* send BYE */
- if((ret = send_BYE(self)) == 0){
+ /* send BYE */
+ if((ret = send_BYE(self)) == 0) {
#if !TSIP_UNDER_APPLE // FIXME: hangs up on iOS (RTP transport runnable join never exits)
- // stop session manager
- if(self->msession_mgr && self->msession_mgr->started){
- tmedia_session_mgr_stop(self->msession_mgr);
- }
+ // stop session manager
+ if(self->msession_mgr && self->msession_mgr->started) {
+ tmedia_session_mgr_stop(self->msession_mgr);
+ }
#endif
- }
- return ret;
+ }
+ return ret;
}
/* Any -> (iBYE) -> Terminated */
int x0000_Any_2_Terminated_X_iBYE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rBYE = va_arg(*app, const tsip_request_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rBYE = va_arg(*app, const tsip_request_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Terminated", tsip_event_code_dialog_terminated);
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Terminated", tsip_event_code_dialog_terminated);
- /* send 200 OK */
- return send_RESPONSE(self, rBYE, 200, "OK", tsk_false);
+ /* send 200 OK */
+ return send_RESPONSE(self, rBYE, 200, "OK", tsk_false);
}
/* Any -> Shutdown -> Terminated */
int x0000_Any_2_Trying_X_shutdown(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
-
- /* schedule shutdow timeout */
- TSIP_DIALOG_INVITE_TIMER_SCHEDULE(shutdown);
-
- /* alert user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
-
- if(TSIP_DIALOG(self)->state == tsip_established){
- return send_BYE(self);
- }
- else if(TSIP_DIALOG(self)->state == tsip_early){
- return send_CANCEL(self);
- }
-
- return 0;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+
+ /* schedule shutdow timeout */
+ TSIP_DIALOG_INVITE_TIMER_SCHEDULE(shutdown);
+
+ /* alert user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+
+ if(TSIP_DIALOG(self)->state == tsip_established) {
+ return send_BYE(self);
+ }
+ else if(TSIP_DIALOG(self)->state == tsip_early) {
+ return send_CANCEL(self);
+ }
+
+ return 0;
}
/* Any -> (i1xx) -> Any */
int x0000_Any_2_Any_X_i1xx(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *r1xx = va_arg(*app, const tsip_response_t *);
- int ret = 0;
-
- /* Update the dialog state */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), r1xx))){
- return ret;
- }
-
- /* RFC 3262 - 4 UAC Behavior
- If a provisional response is received for an initial request, and
- that response contains a Require header field containing the option
- tag 100rel, the response is to be sent reliably. If the response is
- a 100 (Trying) (as opposed to 101 to 199), this option tag MUST be
- ignored, and the procedures below MUST NOT be used.
-
- Assuming the response is to be transmitted reliably, the UAC MUST
- create a new request with method PRACK. This request is sent within
- the dialog associated with the provisional response (indeed, the
- provisional response may have created the dialog). PRACK requests
- MAY contain bodies, which are interpreted according to their type and
- disposition.
-
- Note that the PRACK is like any other non-INVITE request within a
- dialog. In particular, a UAC SHOULD NOT retransmit the PRACK request
- when it receives a retransmission of the provisional response being
- acknowledged, although doing so does not create a protocol error.
-
- Additional information: We should only process the SDP from reliable responses (require:100rel)
- but there was many problem with some clients sending SDP with this tag: tiscali, DTAG, samsung, ...
- */
- if((TSIP_RESPONSE_CODE(r1xx) >= 101 && TSIP_RESPONSE_CODE(r1xx) <=199)){
- /* Process Remote offer */
- if(TSIP_MESSAGE_HAS_CONTENT(r1xx) && (ret = tsip_dialog_invite_process_ro(self, r1xx))){
- /* Send Error */
- return ret;
- }
- // don't send PRACK if 100rel is only inside "supported" header
- if(tsip_message_required(r1xx, "100rel") && (ret = send_PRACK(self, r1xx))){
- return ret;
- }
- }
-
- /* QoS Reservation */
- if((self->qos.timer.id == TSK_INVALID_TIMER_ID) && tsip_message_required(r1xx, "precondition") && !tmedia_session_mgr_canresume(self->msession_mgr)){
- tsip_dialog_invite_qos_timer_schedule(self);
- }
-
- /* alert the user */
- ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
- TSIP_RESPONSE_CODE(r1xx), TSIP_RESPONSE_PHRASE(r1xx), r1xx);
- if(self->is_transf){
- ret = tsip_dialog_invite_notify_parent(self, r1xx);
- }
-
- return ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *r1xx = va_arg(*app, const tsip_response_t *);
+ int ret = 0;
+
+ /* Update the dialog state */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), r1xx))) {
+ return ret;
+ }
+
+ /* RFC 3262 - 4 UAC Behavior
+ If a provisional response is received for an initial request, and
+ that response contains a Require header field containing the option
+ tag 100rel, the response is to be sent reliably. If the response is
+ a 100 (Trying) (as opposed to 101 to 199), this option tag MUST be
+ ignored, and the procedures below MUST NOT be used.
+
+ Assuming the response is to be transmitted reliably, the UAC MUST
+ create a new request with method PRACK. This request is sent within
+ the dialog associated with the provisional response (indeed, the
+ provisional response may have created the dialog). PRACK requests
+ MAY contain bodies, which are interpreted according to their type and
+ disposition.
+
+ Note that the PRACK is like any other non-INVITE request within a
+ dialog. In particular, a UAC SHOULD NOT retransmit the PRACK request
+ when it receives a retransmission of the provisional response being
+ acknowledged, although doing so does not create a protocol error.
+
+ Additional information: We should only process the SDP from reliable responses (require:100rel)
+ but there was many problem with some clients sending SDP with this tag: tiscali, DTAG, samsung, ...
+ */
+ if((TSIP_RESPONSE_CODE(r1xx) >= 101 && TSIP_RESPONSE_CODE(r1xx) <=199)) {
+ /* Process Remote offer */
+ if(TSIP_MESSAGE_HAS_CONTENT(r1xx) && (ret = tsip_dialog_invite_process_ro(self, r1xx))) {
+ /* Send Error */
+ return ret;
+ }
+ // don't send PRACK if 100rel is only inside "supported" header
+ if(tsip_message_required(r1xx, "100rel") && (ret = send_PRACK(self, r1xx))) {
+ return ret;
+ }
+ }
+
+ /* QoS Reservation */
+ if((self->qos.timer.id == TSK_INVALID_TIMER_ID) && tsip_message_required(r1xx, "precondition") && !tmedia_session_mgr_canresume(self->msession_mgr)) {
+ tsip_dialog_invite_qos_timer_schedule(self);
+ }
+
+ /* alert the user */
+ ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
+ TSIP_RESPONSE_CODE(r1xx), TSIP_RESPONSE_PHRASE(r1xx), r1xx);
+ if(self->is_transf) {
+ ret = tsip_dialog_invite_notify_parent(self, r1xx);
+ }
+
+ return ret;
}
/* Any -> (oINFO) -> Any */
int x0000_Any_2_Any_X_oINFO(va_list *app)
{
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
- tsip_request_t* rINFO;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if((rINFO = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))){
- int ret;
- if(action){
- ret = tsip_dialog_apply_action(TSIP_MESSAGE(rINFO), action);
- }
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), rINFO);
- TSK_OBJECT_SAFE_FREE(rINFO);
- return ret;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new INFO request");
- return -1;
- }
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+ tsip_request_t* rINFO;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if((rINFO = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))) {
+ int ret;
+ if(action) {
+ ret = tsip_dialog_apply_action(TSIP_MESSAGE(rINFO), action);
+ }
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), rINFO);
+ TSK_OBJECT_SAFE_FREE(rINFO);
+ return ret;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new INFO request");
+ return -1;
+ }
}
int x0000_Any_2_Any_X_iINFO(va_list *app)
{
- tsip_dialog_invite_t * self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t* rINFO = (tsip_request_t*)va_arg(*app, const tsip_message_t *);
- int ret = -1;
-
- if (rINFO){
- ret = send_RESPONSE(self, rINFO, 200, "Ok", tsk_false);
- {
- // int tmedia_session_mgr_recv_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
- if (self->msession_mgr && TSIP_MESSAGE_HAS_CONTENT(rINFO)){
- if (tsk_striequals("application/media_control+xml", TSIP_MESSAGE_CONTENT_TYPE(rINFO))){ /* rfc5168: XML Schema for Media Control */
- static uint32_t __ssrc_media_fake = 0;
- static tmedia_type_t __tmedia_type_video = tmedia_video; // TODO: add bfcpvideo?
- const char* content_ptr = (const char*)TSIP_MESSAGE_CONTENT_DATA(rINFO);
- tsk_size_t content_size = (tsk_size_t)TSIP_MESSAGE_CONTENT_DATA_LENGTH(rINFO);
- tsk_bool_t is_fir = tsk_false;
- uint64_t sessionId = 0;
+ tsip_dialog_invite_t * self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t* rINFO = (tsip_request_t*)va_arg(*app, const tsip_message_t *);
+ int ret = -1;
+
+ if (rINFO) {
+ ret = send_RESPONSE(self, rINFO, 200, "Ok", tsk_false);
+ {
+ // int tmedia_session_mgr_recv_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
+ if (self->msession_mgr && TSIP_MESSAGE_HAS_CONTENT(rINFO)) {
+ if (tsk_striequals("application/media_control+xml", TSIP_MESSAGE_CONTENT_TYPE(rINFO))) { /* rfc5168: XML Schema for Media Control */
+ static uint32_t __ssrc_media_fake = 0;
+ static tmedia_type_t __tmedia_type_video = tmedia_video; // TODO: add bfcpvideo?
+ const char* content_ptr = (const char*)TSIP_MESSAGE_CONTENT_DATA(rINFO);
+ tsk_size_t content_size = (tsk_size_t)TSIP_MESSAGE_CONTENT_DATA_LENGTH(rINFO);
+ tsk_bool_t is_fir = tsk_false;
+ uint64_t sessionId = 0;
#if HAVE_LIBXML2
- {
- xmlDoc *pDoc;
- xmlNode *pRootElement;
- xmlXPathContext *pPathCtx;
- xmlXPathObject *pPathObj;
- static const xmlChar* __xpath_expr_picture_fast_update = (const xmlChar*)"/media_control/vc_primitive/to_encoder/picture_fast_update";
- static const xmlChar* __xpath_expr_stream_id = (const xmlChar*)"/media_control/vc_primitive/stream_id";
-
- if (!(pDoc = xmlParseDoc(content_ptr))) {
- TSK_DEBUG_ERROR("Failed to parse XML content [%s]", content_ptr);
- return 0;
- }
- if (!(pRootElement = xmlDocGetRootElement(pDoc))) {
- TSK_DEBUG_ERROR("Failed to get root element from XML content [%s]", content_ptr);
- xmlFreeDoc(pDoc);
- return 0;
- }
- if (!(pPathCtx = xmlXPathNewContext(pDoc))) {
- TSK_DEBUG_ERROR("Failed to create path context from XML content [%s]", content_ptr);
- xmlFreeDoc(pDoc);
- return 0;
- }
- // picture_fast_update
- if (!(pPathObj = xmlXPathEvalExpression(__xpath_expr_picture_fast_update, pPathCtx))) {
- TSK_DEBUG_ERROR("Error: unable to evaluate xpath expression: %s", __xpath_expr_picture_fast_update);
- xmlXPathFreeContext(pPathCtx);
- xmlFreeDoc(pDoc);
- return 0;
- }
- is_fir = (pPathObj->type == XPATH_NODESET && pPathObj->nodesetval->nodeNr > 0);
- xmlXPathFreeObject(pPathObj);
- // stream_id
- if (!(pPathObj = xmlXPathEvalExpression(__xpath_expr_stream_id, pPathCtx))) {
- TSK_DEBUG_ERROR("Error: unable to evaluate xpath expression: %s", __xpath_expr_stream_id);
- xmlXPathFreeContext(pPathCtx);
- xmlFreeDoc(pDoc);
- }
- else if (pPathObj->type == XPATH_NODESET && pPathObj->nodesetval->nodeNr > 0 && pPathObj->nodesetval->nodeTab[0]->children && pPathObj->nodesetval->nodeTab[0]->children->content) {
- sessionId = tsk_atoi64((const char*)pPathObj->nodesetval->nodeTab[0]->children->content);
- }
- xmlXPathFreeObject(pPathObj);
-
- xmlXPathFreeContext(pPathCtx);
- xmlFreeDoc(pDoc);
- }
+ {
+ xmlDoc *pDoc;
+ xmlNode *pRootElement;
+ xmlXPathContext *pPathCtx;
+ xmlXPathObject *pPathObj;
+ static const xmlChar* __xpath_expr_picture_fast_update = (const xmlChar*)"/media_control/vc_primitive/to_encoder/picture_fast_update";
+ static const xmlChar* __xpath_expr_stream_id = (const xmlChar*)"/media_control/vc_primitive/stream_id";
+
+ if (!(pDoc = xmlParseDoc(content_ptr))) {
+ TSK_DEBUG_ERROR("Failed to parse XML content [%s]", content_ptr);
+ return 0;
+ }
+ if (!(pRootElement = xmlDocGetRootElement(pDoc))) {
+ TSK_DEBUG_ERROR("Failed to get root element from XML content [%s]", content_ptr);
+ xmlFreeDoc(pDoc);
+ return 0;
+ }
+ if (!(pPathCtx = xmlXPathNewContext(pDoc))) {
+ TSK_DEBUG_ERROR("Failed to create path context from XML content [%s]", content_ptr);
+ xmlFreeDoc(pDoc);
+ return 0;
+ }
+ // picture_fast_update
+ if (!(pPathObj = xmlXPathEvalExpression(__xpath_expr_picture_fast_update, pPathCtx))) {
+ TSK_DEBUG_ERROR("Error: unable to evaluate xpath expression: %s", __xpath_expr_picture_fast_update);
+ xmlXPathFreeContext(pPathCtx);
+ xmlFreeDoc(pDoc);
+ return 0;
+ }
+ is_fir = (pPathObj->type == XPATH_NODESET && pPathObj->nodesetval->nodeNr > 0);
+ xmlXPathFreeObject(pPathObj);
+ // stream_id
+ if (!(pPathObj = xmlXPathEvalExpression(__xpath_expr_stream_id, pPathCtx))) {
+ TSK_DEBUG_ERROR("Error: unable to evaluate xpath expression: %s", __xpath_expr_stream_id);
+ xmlXPathFreeContext(pPathCtx);
+ xmlFreeDoc(pDoc);
+ }
+ else if (pPathObj->type == XPATH_NODESET && pPathObj->nodesetval->nodeNr > 0 && pPathObj->nodesetval->nodeTab[0]->children && pPathObj->nodesetval->nodeTab[0]->children->content) {
+ sessionId = tsk_atoi64((const char*)pPathObj->nodesetval->nodeTab[0]->children->content);
+ }
+ xmlXPathFreeObject(pPathObj);
+
+ xmlXPathFreeContext(pPathCtx);
+ xmlFreeDoc(pDoc);
+ }
#else
- is_fir = (tsk_strcontains(content_ptr, content_size, "to_encoder") && tsk_strcontains(content_ptr, content_size, "picture_fast_update"));
+ is_fir = (tsk_strcontains(content_ptr, content_size, "to_encoder") && tsk_strcontains(content_ptr, content_size, "picture_fast_update"));
#endif
- if (is_fir) {
- TSK_DEBUG_INFO("Incoming SIP INFO(picture_fast_update)");
- ret = sessionId
- ? tmedia_session_mgr_recv_rtcp_event_2(self->msession_mgr, tmedia_rtcp_event_type_fir, sessionId)
- : tmedia_session_mgr_recv_rtcp_event(self->msession_mgr, __tmedia_type_video, tmedia_rtcp_event_type_fir, __ssrc_media_fake);
- }
- else {
- TSK_DEBUG_INFO("Incoming SIP INFO(unknown)");
- }
- }
- }
- }
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request", rINFO);
- }
-
- return ret;
+ if (is_fir) {
+ TSK_DEBUG_INFO("Incoming SIP INFO(picture_fast_update)");
+ ret = sessionId
+ ? tmedia_session_mgr_recv_rtcp_event_2(self->msession_mgr, tmedia_rtcp_event_type_fir, sessionId)
+ : tmedia_session_mgr_recv_rtcp_event(self->msession_mgr, __tmedia_type_video, tmedia_rtcp_event_type_fir, __ssrc_media_fake);
+ }
+ else {
+ TSK_DEBUG_INFO("Incoming SIP INFO(unknown)");
+ }
+ }
+ }
+ }
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request", rINFO);
+ }
+
+ return ret;
}
int x9998_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Transport error", tsip_event_code_dialog_terminated);
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Transport error", tsip_event_code_dialog_terminated);
- return 0;
+ return 0;
}
int x9999_Any_2_Any_X_Error(va_list *app)
{
- return 0;
+ return 0;
}
@@ -1070,768 +1066,769 @@ int x9999_Any_2_Any_X_Error(va_list *app)
int tsip_dialog_invite_msession_configure(tsip_dialog_invite_t *self)
{
- tmedia_srtp_mode_t srtp_mode;
- tmedia_mode_t avpf_mode;
- tsk_bool_t is_rtcweb_enabled;
- tsk_bool_t is_webrtc2sip_mode_enabled;
-
- if(!self || !self->msession_mgr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- is_webrtc2sip_mode_enabled = (TSIP_DIALOG_GET_STACK(self)->network.mode == tsip_stack_mode_webrtc2sip);
- is_rtcweb_enabled = (((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.profile == tmedia_profile_rtcweb);
- srtp_mode = is_rtcweb_enabled ? tmedia_srtp_mode_mandatory : ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.srtp_mode;
- avpf_mode = is_rtcweb_enabled ? tmedia_mode_mandatory : ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.avpf_mode;
-
- // set callback functions
- tmedia_session_mgr_set_onerror_cbfn(self->msession_mgr, self, tsip_dialog_invite_msession_onerror_cb);
- tmedia_session_mgr_set_rfc5168_cbfn(self->msession_mgr, self, tsip_dialog_invite_msession_rfc5168_cb);
-
- // set params
- return tmedia_session_mgr_set(self->msession_mgr,
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "srtp-mode", srtp_mode),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "avpf-mode", avpf_mode),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "webrtc2sip-mode-enabled", is_webrtc2sip_mode_enabled), // hack the media stack
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcp-enabled", self->use_rtcp),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcpmux-enabled", self->use_rtcpmux),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "codecs-supported", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.codecs),
-
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "bypass-encoding", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.bypass_encoding),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "bypass-decoding", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.bypass_decoding),
-
- TMEDIA_SESSION_SET_INT32(tmedia_audio, "rtp-ssrc", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.rtp.ssrc.audio),
- TMEDIA_SESSION_SET_INT32(tmedia_video, "rtp-ssrc", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.rtp.ssrc.video),
-
- TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-ca", TSIP_DIALOG_GET_STACK(self)->security.tls.ca),
- TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-pbk", TSIP_DIALOG_GET_STACK(self)->security.tls.pbk),
- TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-pvk", TSIP_DIALOG_GET_STACK(self)->security.tls.pvk),
- TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "dtls-cert-verify", TSIP_DIALOG_GET_STACK(self)->security.tls.verify),
-
- TMEDIA_SESSION_SET_INT32(tmedia_video, "fps", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_fps),
- TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-upload", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_up),
- TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-download", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_down),
- TMEDIA_SESSION_SET_INT32(tmedia_video, "pref-size", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_pref_size),
-
- tsk_null);
+ tmedia_srtp_mode_t srtp_mode;
+ tmedia_mode_t avpf_mode;
+ tsk_bool_t is_rtcweb_enabled;
+ tsk_bool_t is_webrtc2sip_mode_enabled;
+
+ if(!self || !self->msession_mgr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ is_webrtc2sip_mode_enabled = (TSIP_DIALOG_GET_STACK(self)->network.mode == tsip_stack_mode_webrtc2sip);
+ is_rtcweb_enabled = (((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.profile == tmedia_profile_rtcweb);
+ srtp_mode = is_rtcweb_enabled ? tmedia_srtp_mode_mandatory : ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.srtp_mode;
+ avpf_mode = is_rtcweb_enabled ? tmedia_mode_mandatory : ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.avpf_mode;
+
+ // set callback functions
+ tmedia_session_mgr_set_onerror_cbfn(self->msession_mgr, self, tsip_dialog_invite_msession_onerror_cb);
+ tmedia_session_mgr_set_rfc5168_cbfn(self->msession_mgr, self, tsip_dialog_invite_msession_rfc5168_cb);
+
+ // set params
+ return tmedia_session_mgr_set(self->msession_mgr,
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "srtp-mode", srtp_mode),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "avpf-mode", avpf_mode),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "webrtc2sip-mode-enabled", is_webrtc2sip_mode_enabled), // hack the media stack
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcp-enabled", self->use_rtcp),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcpmux-enabled", self->use_rtcpmux),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "codecs-supported", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.codecs),
+
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "bypass-encoding", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.bypass_encoding),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "bypass-decoding", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.bypass_decoding),
+
+ TMEDIA_SESSION_SET_INT32(tmedia_audio, "rtp-ssrc", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.rtp.ssrc.audio),
+ TMEDIA_SESSION_SET_INT32(tmedia_video, "rtp-ssrc", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.rtp.ssrc.video),
+
+ TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-ca", TSIP_DIALOG_GET_STACK(self)->security.tls.ca),
+ TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-pbk", TSIP_DIALOG_GET_STACK(self)->security.tls.pbk),
+ TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-pvk", TSIP_DIALOG_GET_STACK(self)->security.tls.pvk),
+ TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "dtls-cert-verify", TSIP_DIALOG_GET_STACK(self)->security.tls.verify),
+
+ TMEDIA_SESSION_SET_INT32(tmedia_video, "fps", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_fps),
+ TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-upload", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_up),
+ TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-download", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_down),
+ TMEDIA_SESSION_SET_INT32(tmedia_video, "pref-size", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_pref_size),
+
+ tsk_null);
}
int tsip_dialog_invite_msession_start(tsip_dialog_invite_t *self)
{
- if(!self || !self->msession_mgr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(tsip_dialog_invite_ice_is_enabled(self) && !tsip_dialog_invite_ice_is_connected(self)){
- if(self->msession_mgr->type != self->ice.media_type){
- TSK_DEBUG_INFO("Media session type(%d)<>ICE media type(%d)", self->msession_mgr->type, self->ice.media_type);
- // make sure to use the right media types
- tsip_dialog_invite_ice_set_media_type(self, self->msession_mgr->type);
- }
- self->ice.start_smgr = tsk_true;
- }
- else{
- self->ice.start_smgr = tsk_false;
- return tmedia_session_mgr_start(self->msession_mgr);
- }
- return 0;
+ if(!self || !self->msession_mgr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(tsip_dialog_invite_ice_is_enabled(self) && !tsip_dialog_invite_ice_is_connected(self)) {
+ if(self->msession_mgr->type != self->ice.media_type) {
+ TSK_DEBUG_INFO("Media session type(%d)<>ICE media type(%d)", self->msession_mgr->type, self->ice.media_type);
+ // make sure to use the right media types
+ tsip_dialog_invite_ice_set_media_type(self, self->msession_mgr->type);
+ }
+ self->ice.start_smgr = tsk_true;
+ }
+ else {
+ self->ice.start_smgr = tsk_false;
+ return tmedia_session_mgr_start(self->msession_mgr);
+ }
+ return 0;
}
// send INVITE/UPDATE request
int send_INVITEorUPDATE(tsip_dialog_invite_t *self, tsk_bool_t is_INVITE, tsk_bool_t force_sdp)
{
- int ret = -1;
- tsip_request_t *request = tsk_null;
- tsk_bool_t bodiless = tsk_false;
+ int ret = -1;
+ tsip_request_t *request = tsk_null;
+ tsk_bool_t bodiless = tsk_false;
#if BODILESS_INVITE
- if(TSIP_DIALOG(self)->state == tsip_initial){
- bodiless = tsk_true;
- }
+ if(TSIP_DIALOG(self)->state == tsip_initial) {
+ bodiless = tsk_true;
+ }
#endif
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if((request = tsip_dialog_request_new(TSIP_DIALOG(self), is_INVITE ? "INVITE" : "UPDATE"))){
- /* apply action params to the request (will add a content if the action contains one) */
- if(TSIP_DIALOG(self)->curr_action){
- tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
- }
-
- if(!bodiless){
- /* add our payload if current action does not have one */
- if((force_sdp || is_INVITE) || ((self->msession_mgr && self->msession_mgr->state_changed) || (TSIP_DIALOG(self)->state == tsip_initial))){
- if(!TSIP_DIALOG(self)->curr_action || !TSIP_DIALOG(self)->curr_action->payload){
- const tsdp_message_t* sdp_lo;
- char* sdp;
- if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))){
- tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
- if(tsip_dialog_invite_ice_is_enabled(self)){
- ret = tsip_dialog_invite_ice_process_lo(self, sdp_lo);
- }
- TSK_FREE(sdp);
- }
- }
- }
- }
-
- /* Session timers */
- if(self->stimers.timer.timeout){
- if(self->required.timer){
- tsip_message_add_headers(request,
- TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, !self->stimers.is_refresher),
- TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
- tsk_null
- );
- }
- else if(self->supported.timer){
- tsip_message_add_headers(request,
- TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, !self->stimers.is_refresher),
- TSIP_HEADER_SUPPORTED_VA_ARGS("timer"),
- tsk_null
- );
- }
-
- }
-
- if(self->stimers.minse){
- tsip_message_add_headers(request,
- TSIP_HEADER_MIN_SE_VA_ARGS(self->stimers.minse),
- tsk_null
- );
- }
-
- /* 100rel */
- if(self->required._100rel){
- tsip_message_add_headers(request,
- TSIP_HEADER_REQUIRE_VA_ARGS("100rel"),
- tsk_null
- );
- }
- else if(self->supported._100rel){
- tsip_message_add_headers(request,
- TSIP_HEADER_SUPPORTED_VA_ARGS("100rel"),
- tsk_null
- );
- }
-
- /* QoS */
- if(self->required.precondition){
- tsip_message_add_headers(request,
- TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
- tsk_null
- );
- }
- else if(self->supported.precondition){
- tsip_message_add_headers(request,
- TSIP_HEADER_SUPPORTED_VA_ARGS("precondition"),
- tsk_null
- );
- }
-
-
- /* Always added headers */
- // Explicit Communication Transfer (3GPP TS 24.629)
- /*tsip_message_add_headers(request,
- TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub,replaces"),
- tsk_null
- );*/
-
- /* send the request */
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- if(ret == 0){
- /* update last INVITE */
- TSK_OBJECT_SAFE_FREE(self->last_oInvite);
- self->last_oInvite = request;
- }
- else{
- TSK_OBJECT_SAFE_FREE(request);
- }
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if((request = tsip_dialog_request_new(TSIP_DIALOG(self), is_INVITE ? "INVITE" : "UPDATE"))) {
+ /* apply action params to the request (will add a content if the action contains one) */
+ if(TSIP_DIALOG(self)->curr_action) {
+ tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
+ }
+
+ if(!bodiless) {
+ /* add our payload if current action does not have one */
+ if((force_sdp || is_INVITE) || ((self->msession_mgr && self->msession_mgr->state_changed) || (TSIP_DIALOG(self)->state == tsip_initial))) {
+ if(!TSIP_DIALOG(self)->curr_action || !TSIP_DIALOG(self)->curr_action->payload) {
+ const tsdp_message_t* sdp_lo;
+ char* sdp;
+ if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))) {
+ tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ ret = tsip_dialog_invite_ice_process_lo(self, sdp_lo);
+ }
+ TSK_FREE(sdp);
+ }
+ }
+ }
+ }
+
+ /* Session timers */
+ if(self->stimers.timer.timeout) {
+ if(self->required.timer) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, !self->stimers.is_refresher),
+ TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
+ tsk_null
+ );
+ }
+ else if(self->supported.timer) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, !self->stimers.is_refresher),
+ TSIP_HEADER_SUPPORTED_VA_ARGS("timer"),
+ tsk_null
+ );
+ }
+
+ }
+
+ if(self->stimers.minse) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_MIN_SE_VA_ARGS(self->stimers.minse),
+ tsk_null
+ );
+ }
+
+ /* 100rel */
+ if(self->required._100rel) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_REQUIRE_VA_ARGS("100rel"),
+ tsk_null
+ );
+ }
+ else if(self->supported._100rel) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("100rel"),
+ tsk_null
+ );
+ }
+
+ /* QoS */
+ if(self->required.precondition) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
+ tsk_null
+ );
+ }
+ else if(self->supported.precondition) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("precondition"),
+ tsk_null
+ );
+ }
+
+
+ /* Always added headers */
+ // Explicit Communication Transfer (3GPP TS 24.629)
+ /*tsip_message_add_headers(request,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub,replaces"),
+ tsk_null
+ );*/
+
+ /* send the request */
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ if(ret == 0) {
+ /* update last INVITE */
+ TSK_OBJECT_SAFE_FREE(self->last_oInvite);
+ self->last_oInvite = request;
+ }
+ else {
+ TSK_OBJECT_SAFE_FREE(request);
+ }
+ }
bail:
- return ret;
+ return ret;
}
// Send PRACK
int send_PRACK(tsip_dialog_invite_t *self, const tsip_response_t* r1xx)
{
- // "Require: 100rel\r\n" should be checked by the caller of this function
- int ret = -1;
- tsip_request_t *request = tsk_null;
- const tsip_header_RSeq_t* RSeq;
-
- if(!self || !r1xx || !r1xx->CSeq){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
-
- /* RFC 3262 - 4 UAC Behavior
- The UAC MUST maintain a sequence number that indicates the most recently
- received in-order reliable provisional response for the initial request.
- */
- if((RSeq = (const tsip_header_RSeq_t*)tsip_message_get_header(r1xx, tsip_htype_RSeq))){
-
- /* RFC 3262 - 4 UAC Behavior
- If the UAC receives another reliable provisional
- response to the same request, and its RSeq value is not one higher
- than the value of the sequence number, that response MUST NOT be
- acknowledged with a PRACK, and MUST NOT be processed further by the
- UAC. An implementation MAY discard the response, or MAY cache the
- response in the hopes of receiving the missing responses.
- */
- if(self->rseq && (RSeq->seq <= self->rseq)){
- TSK_DEBUG_WARN("1xx.RSeq value is not one higher than lastINVITE.RSeq.");
- ret = 0; /* Not error */
- goto bail;
- }
- self->rseq = RSeq->seq;
- }
-
- /* RFC 3262 - 4 UAC Behavior
- Assuming the response is to be transmitted reliably, the UAC MUST
- create a new request with method PRACK.
- */
- if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "PRACK"))){
- goto bail;
- }
-
- /* RFC 3262 - 7.2 RAck
- The first number is the value from the RSeq header in the provisional
- response that is being acknowledged. The next number, and the
- method, are copied from the CSeq in the response that is being
- acknowledged. The method name in the RAck header is case sensitive.
- */
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_RACK_VA_ARGS(self->rseq, r1xx->CSeq->seq, r1xx->CSeq->method));
- //TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS("Test", "value"));
-
- /* Initial INVITE was a bodiless request and 100rel is supported (I'm Alice)
- 1. Alice sends an initial INVITE without offer
- 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
- 3. Alice's answer is sent in the PRACK response
- */
- if(self->is_client && (self->last_oInvite && !TSIP_MESSAGE_HAS_CONTENT(self->last_oInvite))){
- const tsdp_message_t* sdp_lo;
- char* sdp;
- if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))){
- tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
- TSK_FREE(sdp);
- }
- }
-
- // Send request
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
-
+ // "Require: 100rel\r\n" should be checked by the caller of this function
+ int ret = -1;
+ tsip_request_t *request = tsk_null;
+ const tsip_header_RSeq_t* RSeq;
+
+ if(!self || !r1xx || !r1xx->CSeq) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+
+ /* RFC 3262 - 4 UAC Behavior
+ The UAC MUST maintain a sequence number that indicates the most recently
+ received in-order reliable provisional response for the initial request.
+ */
+ if((RSeq = (const tsip_header_RSeq_t*)tsip_message_get_header(r1xx, tsip_htype_RSeq))) {
+
+ /* RFC 3262 - 4 UAC Behavior
+ If the UAC receives another reliable provisional
+ response to the same request, and its RSeq value is not one higher
+ than the value of the sequence number, that response MUST NOT be
+ acknowledged with a PRACK, and MUST NOT be processed further by the
+ UAC. An implementation MAY discard the response, or MAY cache the
+ response in the hopes of receiving the missing responses.
+ */
+ if(self->rseq && (RSeq->seq <= self->rseq)) {
+ TSK_DEBUG_WARN("1xx.RSeq value is not one higher than lastINVITE.RSeq.");
+ ret = 0; /* Not error */
+ goto bail;
+ }
+ self->rseq = RSeq->seq;
+ }
+
+ /* RFC 3262 - 4 UAC Behavior
+ Assuming the response is to be transmitted reliably, the UAC MUST
+ create a new request with method PRACK.
+ */
+ if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "PRACK"))) {
+ goto bail;
+ }
+
+ /* RFC 3262 - 7.2 RAck
+ The first number is the value from the RSeq header in the provisional
+ response that is being acknowledged. The next number, and the
+ method, are copied from the CSeq in the response that is being
+ acknowledged. The method name in the RAck header is case sensitive.
+ */
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_RACK_VA_ARGS(self->rseq, r1xx->CSeq->seq, r1xx->CSeq->method));
+ //TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS("Test", "value"));
+
+ /* Initial INVITE was a bodiless request and 100rel is supported (I'm Alice)
+ 1. Alice sends an initial INVITE without offer
+ 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
+ 3. Alice's answer is sent in the PRACK response
+ */
+ if(self->is_client && (self->last_oInvite && !TSIP_MESSAGE_HAS_CONTENT(self->last_oInvite))) {
+ const tsdp_message_t* sdp_lo;
+ char* sdp;
+ if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))) {
+ tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
+ TSK_FREE(sdp);
+ }
+ }
+
+ // Send request
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+
bail:
- TSK_OBJECT_SAFE_FREE(request);
- return ret;
+ TSK_OBJECT_SAFE_FREE(request);
+ return ret;
}
// Send CANCEL
int send_CANCEL(tsip_dialog_invite_t *self)
{
- int ret = -1;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
- /* RFC 3261 - 9 Canceling a Request
- If the request being cancelled contains a Route header field, the
- CANCEL request MUST include that Route header field's values.
- ==> up to tsip_dialog_request_new()
- */
-
- /* RFC 3261 - 9 Canceling a Request
- Once the CANCEL is constructed, the client SHOULD check whether it
- has received any response (provisional or final) for the request
- being cancelled (herein referred to as the "original request").
-
- If no provisional response has been received, the CANCEL request MUST
- NOT be sent; rather, the client MUST wait for the arrival of a
- provisional response before sending the request.
- ==> up to the caller to check that we are not in the initial state and the FSM
- is in Trying state.
- */
-
- /* RFC 3261 - 9 Canceling a Request
- The following procedures are used to construct a CANCEL request. The
- Request-URI, Call-ID, To, the numeric part of CSeq, and From header
- fields in the CANCEL request MUST be identical to those in the
- request being cancelled, including tags. A CANCEL constructed by a
- client MUST have only a single Via header field value matching the
- top Via value in the request being cancelled. Using the same values
- for these header fields allows the CANCEL to be matched with the
- request it cancels (Section 9.2 indicates how such matching occurs).
- However, the method part of the CSeq header field MUST have a value
- of CANCEL. This allows it to be identified and processed as a
- transaction in its own right (See Section 17)
- */
- if(self->last_oInvite){
- /* to avoid concurrent access, take a reference to the request */
- tsip_request_t* last_oInvite = tsk_object_ref(self->last_oInvite);
- tsip_request_t* cancel;
-
- if((cancel = tsip_request_create("CANCEL", last_oInvite->line.request.uri))){
- const tsk_list_item_t* item;
- const tsip_header_t* header;
-
- tsip_message_add_headers(cancel,
- TSIP_HEADER_CSEQ_VA_ARGS(last_oInvite->CSeq->seq, "CANCEL"),
- TSIP_HEADER_MAX_FORWARDS_VA_ARGS(TSIP_HEADER_MAX_FORWARDS_DEFAULT),
- TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
- tsk_null);
-
- cancel->Call_ID = tsk_object_ref(last_oInvite->Call_ID);
- cancel->To = tsk_object_ref(last_oInvite->To);
- cancel->From = tsk_object_ref(last_oInvite->From);
- cancel->firstVia = tsk_object_ref(last_oInvite->firstVia);
- cancel->sigcomp_id = tsk_strdup(TSIP_DIALOG_GET_SS(self)->sigcomp_id);
-
- // Copy Authorizations, Routes and Proxy-Auth
- tsk_list_foreach(item, last_oInvite->headers){
- if(!(header = TSIP_HEADER(item->data))){
- continue;
- }
-
- switch(header->type){
- case tsip_htype_Route:
- case tsip_htype_Proxy_Authorization:
- case tsip_htype_Authorization:
- header = tsk_object_ref((void*)header);
- if(!cancel->headers){
- cancel->headers = tsk_list_create();
- }
- tsk_list_push_back_data(cancel->headers, (void**)&header);
- break;
- default: break;
- }
- }
-
- ret = tsip_dialog_add_session_headers(TSIP_DIALOG(self), cancel);
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), cancel);
- TSK_OBJECT_SAFE_FREE(cancel);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create CANCEL request");
- ret = -2;
- }
-
- TSK_OBJECT_SAFE_FREE(last_oInvite);
- return ret;
- }
- else{
- TSK_DEBUG_WARN("There is no INVITE request to cancel");
- return 0;
- }
+ int ret = -1;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+ /* RFC 3261 - 9 Canceling a Request
+ If the request being cancelled contains a Route header field, the
+ CANCEL request MUST include that Route header field's values.
+ ==> up to tsip_dialog_request_new()
+ */
+
+ /* RFC 3261 - 9 Canceling a Request
+ Once the CANCEL is constructed, the client SHOULD check whether it
+ has received any response (provisional or final) for the request
+ being cancelled (herein referred to as the "original request").
+
+ If no provisional response has been received, the CANCEL request MUST
+ NOT be sent; rather, the client MUST wait for the arrival of a
+ provisional response before sending the request.
+ ==> up to the caller to check that we are not in the initial state and the FSM
+ is in Trying state.
+ */
+
+ /* RFC 3261 - 9 Canceling a Request
+ The following procedures are used to construct a CANCEL request. The
+ Request-URI, Call-ID, To, the numeric part of CSeq, and From header
+ fields in the CANCEL request MUST be identical to those in the
+ request being cancelled, including tags. A CANCEL constructed by a
+ client MUST have only a single Via header field value matching the
+ top Via value in the request being cancelled. Using the same values
+ for these header fields allows the CANCEL to be matched with the
+ request it cancels (Section 9.2 indicates how such matching occurs).
+ However, the method part of the CSeq header field MUST have a value
+ of CANCEL. This allows it to be identified and processed as a
+ transaction in its own right (See Section 17)
+ */
+ if(self->last_oInvite) {
+ /* to avoid concurrent access, take a reference to the request */
+ tsip_request_t* last_oInvite = tsk_object_ref(self->last_oInvite);
+ tsip_request_t* cancel;
+
+ if((cancel = tsip_request_create("CANCEL", last_oInvite->line.request.uri))) {
+ const tsk_list_item_t* item;
+ const tsip_header_t* header;
+
+ tsip_message_add_headers(cancel,
+ TSIP_HEADER_CSEQ_VA_ARGS(last_oInvite->CSeq->seq, "CANCEL"),
+ TSIP_HEADER_MAX_FORWARDS_VA_ARGS(TSIP_HEADER_MAX_FORWARDS_DEFAULT),
+ TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
+ tsk_null);
+
+ cancel->Call_ID = tsk_object_ref(last_oInvite->Call_ID);
+ cancel->To = tsk_object_ref(last_oInvite->To);
+ cancel->From = tsk_object_ref(last_oInvite->From);
+ cancel->firstVia = tsk_object_ref(last_oInvite->firstVia);
+ cancel->sigcomp_id = tsk_strdup(TSIP_DIALOG_GET_SS(self)->sigcomp_id);
+
+ // Copy Authorizations, Routes and Proxy-Auth
+ tsk_list_foreach(item, last_oInvite->headers) {
+ if(!(header = TSIP_HEADER(item->data))) {
+ continue;
+ }
+
+ switch(header->type) {
+ case tsip_htype_Route:
+ case tsip_htype_Proxy_Authorization:
+ case tsip_htype_Authorization:
+ header = tsk_object_ref((void*)header);
+ if(!cancel->headers) {
+ cancel->headers = tsk_list_create();
+ }
+ tsk_list_push_back_data(cancel->headers, (void**)&header);
+ break;
+ default:
+ break;
+ }
+ }
+
+ ret = tsip_dialog_add_session_headers(TSIP_DIALOG(self), cancel);
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), cancel);
+ TSK_OBJECT_SAFE_FREE(cancel);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create CANCEL request");
+ ret = -2;
+ }
+
+ TSK_OBJECT_SAFE_FREE(last_oInvite);
+ return ret;
+ }
+ else {
+ TSK_DEBUG_WARN("There is no INVITE request to cancel");
+ return 0;
+ }
bail:
- return ret;
+ return ret;
}
int tsip_dialog_invite_notify_parent(tsip_dialog_invite_t *self, const tsip_response_t* response)
{
- int ret = -1;
- tsip_dialog_t* dlg_parent = tsip_dialog_layer_find_by_ssid(TSIP_DIALOG_GET_STACK(self)->layer_dialog, TSIP_DIALOG_GET_SS(self)->id_parent);
- if(dlg_parent){
- tsip_action_t* action = tsip_action_create(tsip_atype_ect_lnotify,
- TSIP_ACTION_SET_NULL());
- if(action){
- ret = tsip_dialog_fsm_act(dlg_parent, action->type, response, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create action object");
- }
- TSK_OBJECT_SAFE_FREE(dlg_parent);
- }
- else{
- TSK_DEBUG_ERROR("Failed to find parent with id = %llu", TSIP_DIALOG_GET_SS(self)->id_parent);
- }
- return ret;
+ int ret = -1;
+ tsip_dialog_t* dlg_parent = tsip_dialog_layer_find_by_ssid(TSIP_DIALOG_GET_STACK(self)->layer_dialog, TSIP_DIALOG_GET_SS(self)->id_parent);
+ if(dlg_parent) {
+ tsip_action_t* action = tsip_action_create(tsip_atype_ect_lnotify,
+ TSIP_ACTION_SET_NULL());
+ if(action) {
+ ret = tsip_dialog_fsm_act(dlg_parent, action->type, response, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create action object");
+ }
+ TSK_OBJECT_SAFE_FREE(dlg_parent);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to find parent with id = %llu", TSIP_DIALOG_GET_SS(self)->id_parent);
+ }
+ return ret;
}
// Send BYE
int send_BYE(tsip_dialog_invite_t *self)
{
- int ret = -1;
- tsip_request_t *bye = tsk_null;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
- /* RFC 3261 - 15.1.1 UAC Behavior
- A BYE request is constructed as would any other request within a
- dialog, as described in Section 12.
-
- Once the BYE is constructed, the UAC core creates a new non-INVITE
- client transaction, and passes it the BYE request. The UAC MUST
- consider the session terminated (and therefore stop sending or
- listening for media) as soon as the BYE request is passed to the
- client transaction. If the response for the BYE is a 481
- (Call/Transaction Does Not Exist) or a 408 (Request Timeout) or no
-
- response at all is received for the BYE (that is, a timeout is
- returned by the client transaction), the UAC MUST consider the
- session and the dialog terminated.
- */
- if((bye = tsip_dialog_request_new(TSIP_DIALOG(self), "BYE"))){
- if(TSIP_DIALOG(self)->curr_action){
- tsip_dialog_apply_action(bye, TSIP_DIALOG(self)->curr_action);
- }
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), bye);
- TSK_OBJECT_SAFE_FREE(bye);
- }
+ int ret = -1;
+ tsip_request_t *bye = tsk_null;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+ /* RFC 3261 - 15.1.1 UAC Behavior
+ A BYE request is constructed as would any other request within a
+ dialog, as described in Section 12.
+
+ Once the BYE is constructed, the UAC core creates a new non-INVITE
+ client transaction, and passes it the BYE request. The UAC MUST
+ consider the session terminated (and therefore stop sending or
+ listening for media) as soon as the BYE request is passed to the
+ client transaction. If the response for the BYE is a 481
+ (Call/Transaction Does Not Exist) or a 408 (Request Timeout) or no
+
+ response at all is received for the BYE (that is, a timeout is
+ returned by the client transaction), the UAC MUST consider the
+ session and the dialog terminated.
+ */
+ if((bye = tsip_dialog_request_new(TSIP_DIALOG(self), "BYE"))) {
+ if(TSIP_DIALOG(self)->curr_action) {
+ tsip_dialog_apply_action(bye, TSIP_DIALOG(self)->curr_action);
+ }
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), bye);
+ TSK_OBJECT_SAFE_FREE(bye);
+ }
bail:
- return ret;
+ return ret;
}
// Send INFO
int send_INFO(tsip_dialog_invite_t *self, const char* content_type, const void* content_ptr, tsk_size_t content_size)
{
- int ret = -1;
- tsip_request_t *info = tsk_null;
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
- if ((info = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))) {
- if (TSIP_DIALOG(self)->curr_action) {
- ret = tsip_dialog_apply_action(info, TSIP_DIALOG(self)->curr_action);
- if (ret) {
- goto bail;
- }
- }
- if (content_type && content_ptr && content_size) {
- ret = tsip_message_add_content(info, content_type, content_ptr, content_size);
- if (ret) {
- goto bail;
- }
- }
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), info);
- if (ret) {
- goto bail;
- }
- }
+ int ret = -1;
+ tsip_request_t *info = tsk_null;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+ if ((info = tsip_dialog_request_new(TSIP_DIALOG(self), "INFO"))) {
+ if (TSIP_DIALOG(self)->curr_action) {
+ ret = tsip_dialog_apply_action(info, TSIP_DIALOG(self)->curr_action);
+ if (ret) {
+ goto bail;
+ }
+ }
+ if (content_type && content_ptr && content_size) {
+ ret = tsip_message_add_content(info, content_type, content_ptr, content_size);
+ if (ret) {
+ goto bail;
+ }
+ }
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), info);
+ if (ret) {
+ goto bail;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(info);
- return ret;
+ TSK_OBJECT_SAFE_FREE(info);
+ return ret;
}
// Send ACK
int send_ACK(tsip_dialog_invite_t *self, const tsip_response_t* r2xxINVITE)
{
- int ret = -1;
- tsip_request_t *request = tsk_null;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "ACK"))){
-
- /* The initial INVITE sent by us was a bodiless request and we don't support 100rel (We are Alice)
- 1. Alice sends initial INVITE without offer
- 2. Bob's offer is sent in the 2xx INVITE response
- 3. Alice's answer is sent in the ACK request
- */
- if(self->is_client && (self->last_oInvite && !TSIP_MESSAGE_HAS_CONTENT(self->last_oInvite))){
- const tsdp_message_t* sdp_lo;
- char* sdp;
- if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))){
- tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
- TSK_FREE(sdp);
- }
-
- // Start media session if not done
- if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)){
- /* Set MSRP Callback */
- if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp){
- tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
- }
- // starts session manager
- ret = tsip_dialog_invite_msession_start(self);
- }
- }
-
- /* RFC 3261 - 13.2.2.4 2xx Responses
- The UAC core MUST generate an ACK request for each 2xx received from
- the transaction layer. The header fields of the ACK are constructed
- in the same way as for any request sent within a dialog (see Section
- 12) with the exception of the CSeq and the header fields related to
- authentication. The sequence number of the CSeq header field MUST be
- the same as the INVITE being acknowledged, but the CSeq method MUST
- be ACK. The ACK MUST contain the same credentials as the INVITE. If
- the 2xx contains an offer (based on the rules above), the ACK MUST
- carry an answer in its body. If the offer in the 2xx response is not
- acceptable, the UAC core MUST generate a valid answer in the ACK and
- then send a BYE immediately.
- ==> Credentials will be added by tsip_dialog_request_new() because they are
- associated to the dialog itself.
- ==> It's up to us to add/update the CSeq number.
- ==> ACK requests sent here will create new client transactions, which means that
- they will have there own branches. This is not the case for ACK requests sent from
- the transaction layer.
- */
- request->CSeq->seq = r2xxINVITE->CSeq->seq; /* As the 2xx has the same CSeq than the INVITE */
-
- /* RFC 3261 - 13.2.2.4 2xx Responses
- Once the ACK has been constructed, the procedures of [4] are used to
- determine the destination address, port and transport. However, the
- request is passed to the transport layer directly for transmission,
- rather than a client transaction. This is because the UAC core
- handles retransmissions of the ACK, not the transaction layer. The
- ACK MUST be passed to the client transport every time a
- retransmission of the 2xx final response that triggered the ACK
- arrives.
- */
- if(TSIP_DIALOG_GET_STACK(self)->layer_transport){
- ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, request);
- }
- else{
- ret = -1;
- TSK_DEBUG_ERROR("Not Transport layer associated to this stack");
- }
- TSK_OBJECT_SAFE_FREE(request);
- }
+ int ret = -1;
+ tsip_request_t *request = tsk_null;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "ACK"))) {
+
+ /* The initial INVITE sent by us was a bodiless request and we don't support 100rel (We are Alice)
+ 1. Alice sends initial INVITE without offer
+ 2. Bob's offer is sent in the 2xx INVITE response
+ 3. Alice's answer is sent in the ACK request
+ */
+ if(self->is_client && (self->last_oInvite && !TSIP_MESSAGE_HAS_CONTENT(self->last_oInvite))) {
+ const tsdp_message_t* sdp_lo;
+ char* sdp;
+ if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))) {
+ tsip_message_add_content(request, "application/sdp", sdp, tsk_strlen(sdp));
+ TSK_FREE(sdp);
+ }
+
+ // Start media session if not done
+ if(!self->msession_mgr->started && (self->msession_mgr->sdp.lo && self->msession_mgr->sdp.ro)) {
+ /* Set MSRP Callback */
+ if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp) {
+ tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
+ }
+ // starts session manager
+ ret = tsip_dialog_invite_msession_start(self);
+ }
+ }
+
+ /* RFC 3261 - 13.2.2.4 2xx Responses
+ The UAC core MUST generate an ACK request for each 2xx received from
+ the transaction layer. The header fields of the ACK are constructed
+ in the same way as for any request sent within a dialog (see Section
+ 12) with the exception of the CSeq and the header fields related to
+ authentication. The sequence number of the CSeq header field MUST be
+ the same as the INVITE being acknowledged, but the CSeq method MUST
+ be ACK. The ACK MUST contain the same credentials as the INVITE. If
+ the 2xx contains an offer (based on the rules above), the ACK MUST
+ carry an answer in its body. If the offer in the 2xx response is not
+ acceptable, the UAC core MUST generate a valid answer in the ACK and
+ then send a BYE immediately.
+ ==> Credentials will be added by tsip_dialog_request_new() because they are
+ associated to the dialog itself.
+ ==> It's up to us to add/update the CSeq number.
+ ==> ACK requests sent here will create new client transactions, which means that
+ they will have there own branches. This is not the case for ACK requests sent from
+ the transaction layer.
+ */
+ request->CSeq->seq = r2xxINVITE->CSeq->seq; /* As the 2xx has the same CSeq than the INVITE */
+
+ /* RFC 3261 - 13.2.2.4 2xx Responses
+ Once the ACK has been constructed, the procedures of [4] are used to
+ determine the destination address, port and transport. However, the
+ request is passed to the transport layer directly for transmission,
+ rather than a client transaction. This is because the UAC core
+ handles retransmissions of the ACK, not the transaction layer. The
+ ACK MUST be passed to the client transport every time a
+ retransmission of the 2xx final response that triggered the ACK
+ arrives.
+ */
+ if(TSIP_DIALOG_GET_STACK(self)->layer_transport) {
+ ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, request);
+ }
+ else {
+ ret = -1;
+ TSK_DEBUG_ERROR("Not Transport layer associated to this stack");
+ }
+ TSK_OBJECT_SAFE_FREE(request);
+ }
bail:
- return ret;
+ return ret;
}
// Send any response
int send_RESPONSE(tsip_dialog_invite_t *self, const tsip_request_t* request, short code, const char* phrase, tsk_bool_t force_sdp)
{
- tsip_response_t *response;
- int ret = -1;
-
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))){
- if(TSIP_REQUEST_IS_INVITE(request) || TSIP_REQUEST_IS_UPDATE(request)){
- /* Session timers (for 2xx to INVITE or UPDATE) */
- if(self->required.timer){
- tsip_message_add_headers(response,
- TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
- TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, tsk_striequals(self->stimers.refresher, "uas")),
- tsk_null
- );
- }
- else if(self->supported.timer){
- tsip_message_add_headers(response,
- TSIP_HEADER_SUPPORTED_VA_ARGS("timer"),
- TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, tsk_striequals(self->stimers.refresher, "uas")),
- tsk_null
- );
- }
- if(self->stimers.minse){
- tsip_message_add_headers(response,
- TSIP_HEADER_MIN_SE_VA_ARGS(self->stimers.minse),
- tsk_null
- );
- }
- if(code == 422){
- tsip_message_add_headers(response,
- TSIP_HEADER_DUMMY_VA_ARGS("Reason", "SIP; cause=422; text=\"Session Interval Too Small\""),
- tsk_null
- );
- }
-
- /* 180 Ringing */
- /* 183 Session in Progress */
- if(code == 180 || code == 183){
- if(self->required._100rel){
- if(self->rseq == 0){
- self->rseq = TSK_ABS((rand() ^ rand()) + 1);
- }
- tsip_message_add_headers(response,
- TSIP_HEADER_REQUIRE_VA_ARGS("100rel"),
- TSIP_HEADER_RSEQ_VA_ARGS(self->rseq),
- tsk_null
- );
- TSK_OBJECT_SAFE_FREE(self->last_o1xxrel);
- self->last_o1xxrel = tsk_object_ref(response);
-
- /* No-Initial reliable 1xx will use tsip_dialog_response_send() instead of this function
- * ==> can reseset timeout value and make initial schedule */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
- self->timer100rel.timeout = tsip_timers_getA();
- TSIP_DIALOG_INVITE_TIMER_SCHEDULE(100rel);
- }
- }
-
- /* Precondition */
- if(code == 180 || code == 183){
- if(self->required.precondition){
- tsip_message_add_headers(response,
- TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
- tsk_null
- );
- }
- }
-
-
- /* SDP content */
- if(self->msession_mgr && force_sdp){
- const tsdp_message_t* sdp_lo;
- char* sdp = tsk_null;
- if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))){
- ret = tsip_message_add_content(response, "application/sdp", sdp, tsk_strlen(sdp));
- if(tsip_dialog_invite_ice_is_enabled(self)){
- ret = tsip_dialog_invite_ice_process_lo(self, sdp_lo);
- }
- }
- TSK_FREE(sdp);
- }
-
- /* Add Allow header */
- tsip_message_add_headers(response,
- TSIP_HEADER_DUMMY_VA_ARGS("Allow", TSIP_HEADER_ALLOW_DEFAULT),
- tsk_null
- );
- }
- else if(TSIP_REQUEST_IS_REFER(request)){
- if(self->required.norefersub){
- tsip_message_add_headers(response,
- TSIP_HEADER_REQUIRE_VA_ARGS("norefersub"),
- tsk_null
- );
- }
- if(self->supported.norefersub){
- tsip_message_add_headers(response,
- TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub"),
- tsk_null
- );
- }
- }
-
-
- ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- return ret;
+ tsip_response_t *response;
+ int ret = -1;
+
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))) {
+ if(TSIP_REQUEST_IS_INVITE(request) || TSIP_REQUEST_IS_UPDATE(request)) {
+ /* Session timers (for 2xx to INVITE or UPDATE) */
+ if(self->required.timer) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
+ TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, tsk_striequals(self->stimers.refresher, "uas")),
+ tsk_null
+ );
+ }
+ else if(self->supported.timer) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("timer"),
+ TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, tsk_striequals(self->stimers.refresher, "uas")),
+ tsk_null
+ );
+ }
+ if(self->stimers.minse) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_MIN_SE_VA_ARGS(self->stimers.minse),
+ tsk_null
+ );
+ }
+ if(code == 422) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_DUMMY_VA_ARGS("Reason", "SIP; cause=422; text=\"Session Interval Too Small\""),
+ tsk_null
+ );
+ }
+
+ /* 180 Ringing */
+ /* 183 Session in Progress */
+ if(code == 180 || code == 183) {
+ if(self->required._100rel) {
+ if(self->rseq == 0) {
+ self->rseq = TSK_ABS((rand() ^ rand()) + 1);
+ }
+ tsip_message_add_headers(response,
+ TSIP_HEADER_REQUIRE_VA_ARGS("100rel"),
+ TSIP_HEADER_RSEQ_VA_ARGS(self->rseq),
+ tsk_null
+ );
+ TSK_OBJECT_SAFE_FREE(self->last_o1xxrel);
+ self->last_o1xxrel = tsk_object_ref(response);
+
+ /* No-Initial reliable 1xx will use tsip_dialog_response_send() instead of this function
+ * ==> can reseset timeout value and make initial schedule */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
+ self->timer100rel.timeout = tsip_timers_getA();
+ TSIP_DIALOG_INVITE_TIMER_SCHEDULE(100rel);
+ }
+ }
+
+ /* Precondition */
+ if(code == 180 || code == 183) {
+ if(self->required.precondition) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
+ tsk_null
+ );
+ }
+ }
+
+
+ /* SDP content */
+ if(self->msession_mgr && force_sdp) {
+ const tsdp_message_t* sdp_lo;
+ char* sdp = tsk_null;
+ if((sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr)) && (sdp = tsdp_message_tostring(sdp_lo))) {
+ ret = tsip_message_add_content(response, "application/sdp", sdp, tsk_strlen(sdp));
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ ret = tsip_dialog_invite_ice_process_lo(self, sdp_lo);
+ }
+ }
+ TSK_FREE(sdp);
+ }
+
+ /* Add Allow header */
+ tsip_message_add_headers(response,
+ TSIP_HEADER_DUMMY_VA_ARGS("Allow", TSIP_HEADER_ALLOW_DEFAULT),
+ tsk_null
+ );
+ }
+ else if(TSIP_REQUEST_IS_REFER(request)) {
+ if(self->required.norefersub) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_REQUIRE_VA_ARGS("norefersub"),
+ tsk_null
+ );
+ }
+ if(self->supported.norefersub) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub"),
+ tsk_null
+ );
+ }
+ }
+
+
+ ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ return ret;
}
// Send error response
int send_ERROR(tsip_dialog_invite_t* self, const tsip_request_t* request, short code, const char* phrase, const char* reason)
{
- tsip_response_t *response;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))){
- tsip_message_add_headers(response,
- TSIP_HEADER_DUMMY_VA_ARGS("Reason", reason),
- tsk_null
- );
-
- tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new message");
- }
- return 0;
+ tsip_response_t *response;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))) {
+ tsip_message_add_headers(response,
+ TSIP_HEADER_DUMMY_VA_ARGS("Reason", reason),
+ tsk_null
+ );
+
+ tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new message");
+ }
+ return 0;
}
// FSM callback to signal that the dialog is in the terminated state
int tsip_dialog_invite_OnTerminated(tsip_dialog_invite_t *self)
{
- TSK_DEBUG_INFO("=== INVITE Dialog terminated ===");
-
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed )
- worth nothing to do it here in order to cancel in-dialog request (such as INFO, REFER...)
- */
- tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
-
- /* stop session manager */
- if(self->msession_mgr && self->msession_mgr->started){
- tmedia_session_mgr_stop(self->msession_mgr);
- }
- // because of C# and Java garbage collectors, the ICE context could
- // be destroyed (then stoppped) very late
- if(self->ice.ctx_audio){
- tnet_ice_ctx_stop(self->ice.ctx_audio);
- }
- if(self->ice.ctx_video){
- tnet_ice_ctx_stop(self->ice.ctx_video);
- }
-
- /* alert the user */
- TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Call Terminated",
- TSIP_DIALOG(self)->last_error.message);
-
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ TSK_DEBUG_INFO("=== INVITE Dialog terminated ===");
+
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed )
+ worth nothing to do it here in order to cancel in-dialog request (such as INFO, REFER...)
+ */
+ tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+
+ /* stop session manager */
+ if(self->msession_mgr && self->msession_mgr->started) {
+ tmedia_session_mgr_stop(self->msession_mgr);
+ }
+ // because of C# and Java garbage collectors, the ICE context could
+ // be destroyed (then stoppped) very late
+ if(self->ice.ctx_audio) {
+ tnet_ice_ctx_stop(self->ice.ctx_audio);
+ }
+ if(self->ice.ctx_video) {
+ tnet_ice_ctx_stop(self->ice.ctx_video);
+ }
+
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Call Terminated",
+ TSIP_DIALOG(self)->last_error.message);
+
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
// callback function called when media session error occures asynchronously
static int tsip_dialog_invite_msession_onerror_cb(const void* usrdata, const struct tmedia_session_s* session, const char* reason, tsk_bool_t is_fatal)
{
- tsip_dialog_t *self = (tsip_dialog_t*)usrdata;
-
- if(self && is_fatal){
- char* str = tsk_null;
- tsip_action_t* action;
- tsk_sprintf(&str, "SIP; cause=488; text=\"%s\"", (reason ? reason : "Internal error"));
- action = tsip_action_create(tsip_atype_hangup,
- TSIP_ACTION_SET_HEADER("Reason", str),
- TSIP_ACTION_SET_NULL());
- TSK_FREE(str);
-
- tsip_dialog_hangup(self, action);
- TSK_OBJECT_SAFE_FREE(action);
- }
-
- return 0;
+ tsip_dialog_t *self = (tsip_dialog_t*)usrdata;
+
+ if(self && is_fatal) {
+ char* str = tsk_null;
+ tsip_action_t* action;
+ tsk_sprintf(&str, "SIP; cause=488; text=\"%s\"", (reason ? reason : "Internal error"));
+ action = tsip_action_create(tsip_atype_hangup,
+ TSIP_ACTION_SET_HEADER("Reason", str),
+ TSIP_ACTION_SET_NULL());
+ TSK_FREE(str);
+
+ tsip_dialog_hangup(self, action);
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+
+ return 0;
}
// callback function called when media session events (related to rfc5168) occures asynchronously
static int tsip_dialog_invite_msession_rfc5168_cb(const void* usrdata, const struct tmedia_session_s* session, const char* reason, enum tmedia_session_rfc5168_cmd_e command)
{
- tsip_dialog_invite_t *self = (tsip_dialog_invite_t*)usrdata;
-
- if (self) {
- if (command == tmedia_session_rfc5168_cmd_picture_fast_update) {
- uint64_t now = tsk_time_now();
- if ((now - self->last_out_fastupdate_time) > TSIP_INFO_FASTUPDATE_OUT_INTERVAL_MIN) {
- char* content_ptr = tsk_null;
- static const char* __content_type = "application/media_control+xml";
- static const void* __content_format =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"
- " <media_control>\r\n"
- " <vc_primitive>\r\n"
- " <to_encoder>\r\n"
- " <picture_fast_update>\r\n"
- " </picture_fast_update>\r\n"
- " </to_encoder>\r\n"
- " <stream_id>%llu</stream_id>\r\n"
- " </vc_primitive>\r\n"
- " </media_control>\r\n";
- TSK_DEBUG_INFO("Media session is asking the sigaling layer to send SIP INFO('picture_fast_update')");
- tsk_sprintf(&content_ptr, __content_format, session->id);
- self->last_out_fastupdate_time = now;
- return send_INFO(self, __content_type, content_ptr, tsk_strlen(content_ptr));
- }
- else {
- /* if too close don't update "last_fir_time" to "now" to be sure interval will increase */
- TSK_DEBUG_INFO("Outgoing SIP INFO ('picture_fast_update') requested but delay too close");
- }
- }
- }
- return 0;
+ tsip_dialog_invite_t *self = (tsip_dialog_invite_t*)usrdata;
+
+ if (self) {
+ if (command == tmedia_session_rfc5168_cmd_picture_fast_update) {
+ uint64_t now = tsk_time_now();
+ if ((now - self->last_out_fastupdate_time) > TSIP_INFO_FASTUPDATE_OUT_INTERVAL_MIN) {
+ char* content_ptr = tsk_null;
+ static const char* __content_type = "application/media_control+xml";
+ static const void* __content_format =
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"
+ " <media_control>\r\n"
+ " <vc_primitive>\r\n"
+ " <to_encoder>\r\n"
+ " <picture_fast_update>\r\n"
+ " </picture_fast_update>\r\n"
+ " </to_encoder>\r\n"
+ " <stream_id>%llu</stream_id>\r\n"
+ " </vc_primitive>\r\n"
+ " </media_control>\r\n";
+ TSK_DEBUG_INFO("Media session is asking the sigaling layer to send SIP INFO('picture_fast_update')");
+ tsk_sprintf(&content_ptr, __content_format, session->id);
+ self->last_out_fastupdate_time = now;
+ return send_INFO(self, __content_type, content_ptr, tsk_strlen(content_ptr));
+ }
+ else {
+ /* if too close don't update "last_fir_time" to "now" to be sure interval will increase */
+ TSK_DEBUG_INFO("Outgoing SIP INFO ('picture_fast_update') requested but delay too close");
+ }
+ }
+ }
+ return 0;
}
@@ -1857,86 +1854,85 @@ static int tsip_dialog_invite_msession_rfc5168_cb(const void* usrdata, const str
//
static tsk_object_t* tsip_dialog_invite_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_invite_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- const char* call_id = va_arg(*app, const char *);
-
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_INVITE, call_id, ss, _fsm_state_Started, _fsm_state_Terminated);
-
- /* FSM */
- TSIP_DIALOG_GET_FSM(dialog)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(dialog), TSK_FSM_ONTERMINATED_F(tsip_dialog_invite_OnTerminated), (const void*)dialog);
-
- /* default values */
- dialog->supported._100rel = ((tsip_ssession_t*)ss)->media.enable_100rel;
- dialog->supported.norefersub = tsk_true;
- dialog->required.ice = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
- dialog->supported.ice = (dialog->required.ice || ((tsip_ssession_t*)ss)->media.enable_ice);
+ tsip_dialog_invite_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ const char* call_id = va_arg(*app, const char *);
+
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_INVITE, call_id, ss, _fsm_state_Started, _fsm_state_Terminated);
+
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(dialog)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(dialog), TSK_FSM_ONTERMINATED_F(tsip_dialog_invite_OnTerminated), (const void*)dialog);
+
+ /* default values */
+ dialog->supported._100rel = ((tsip_ssession_t*)ss)->media.enable_100rel;
+ dialog->supported.norefersub = tsk_true;
+ dialog->required.ice = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
+ dialog->supported.ice = (dialog->required.ice || ((tsip_ssession_t*)ss)->media.enable_ice);
#if 0 /* This was a patch for chrome but no longer needed when using version 23.0.1271.64 or later */
- dialog->ice.is_jingle = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
+ dialog->ice.is_jingle = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
#else
- dialog->ice.is_jingle = tsk_false;
+ dialog->ice.is_jingle = tsk_false;
#endif
- dialog->ice.last_sdp_ro_ver = -1;
- dialog->use_rtcp = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcp;
- dialog->use_rtcpmux = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcpmux;
-
- dialog->ice.last_action_id = tsk_fsm_state_none;
- dialog->refersub = tsk_true;
- // ... do the same for preconditions, replaces, ....
-
- /* Initialize the class itself */
- tsip_dialog_invite_init(self);
- }
- return self;
+ dialog->ice.last_sdp_ro_ver = -1;
+ dialog->use_rtcp = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcp;
+ dialog->use_rtcpmux = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcpmux;
+
+ dialog->ice.last_action_id = tsk_fsm_state_none;
+ dialog->refersub = tsk_true;
+ // ... do the same for preconditions, replaces, ....
+
+ /* Initialize the class itself */
+ tsip_dialog_invite_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_invite_dtor(tsk_object_t * _self)
-{
- tsip_dialog_invite_t *self = _self;
- if(self){
- // Cancel all timers
- tsip_dialog_invite_stimers_cancel(self);
- tsip_dialog_invite_qos_timer_cancel(self);
- TSIP_DIALOG_TIMER_CANCEL(shutdown);
- TSIP_DIALOG_TIMER_CANCEL(100rel);
-
- // DeInitialize base class
- tsip_dialog_deinit(TSIP_DIALOG(self));
-
- // DeInitialize self
- TSK_OBJECT_SAFE_FREE(self->ss_transf);
- TSK_OBJECT_SAFE_FREE(self->msession_mgr);
-
- TSK_OBJECT_SAFE_FREE(self->last_oInvite);
- TSK_OBJECT_SAFE_FREE(self->last_iInvite);
- TSK_OBJECT_SAFE_FREE(self->last_o1xxrel);
- TSK_OBJECT_SAFE_FREE(self->last_iRefer);
- TSK_FREE(self->stimers.refresher);
-
- TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio);
- TSK_OBJECT_SAFE_FREE(self->ice.ctx_video);
- TSK_OBJECT_SAFE_FREE(self->ice.last_action);
- TSK_OBJECT_SAFE_FREE(self->ice.last_message);
- //...
-
- TSK_DEBUG_INFO("*** INVITE Dialog destroyed ***");
- }
- return self;
+{
+ tsip_dialog_invite_t *self = _self;
+ if(self) {
+ // Cancel all timers
+ tsip_dialog_invite_stimers_cancel(self);
+ tsip_dialog_invite_qos_timer_cancel(self);
+ TSIP_DIALOG_TIMER_CANCEL(shutdown);
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
+
+ // DeInitialize base class
+ tsip_dialog_deinit(TSIP_DIALOG(self));
+
+ // DeInitialize self
+ TSK_OBJECT_SAFE_FREE(self->ss_transf);
+ TSK_OBJECT_SAFE_FREE(self->msession_mgr);
+
+ TSK_OBJECT_SAFE_FREE(self->last_oInvite);
+ TSK_OBJECT_SAFE_FREE(self->last_iInvite);
+ TSK_OBJECT_SAFE_FREE(self->last_o1xxrel);
+ TSK_OBJECT_SAFE_FREE(self->last_iRefer);
+ TSK_FREE(self->stimers.refresher);
+
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_audio);
+ TSK_OBJECT_SAFE_FREE(self->ice.ctx_video);
+ TSK_OBJECT_SAFE_FREE(self->ice.last_action);
+ TSK_OBJECT_SAFE_FREE(self->ice.last_message);
+ //...
+
+ TSK_DEBUG_INFO("*** INVITE Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_invite_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_invite_def_s =
-{
- sizeof(tsip_dialog_invite_t),
- tsip_dialog_invite_ctor,
- tsip_dialog_invite_dtor,
- tsip_dialog_invite_cmp,
+static const tsk_object_def_t tsip_dialog_invite_def_s = {
+ sizeof(tsip_dialog_invite_t),
+ tsip_dialog_invite_ctor,
+ tsip_dialog_invite_dtor,
+ tsip_dialog_invite_cmp,
};
const tsk_object_def_t *tsip_dialog_invite_def_t = &tsip_dialog_invite_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.client.c b/tinySIP/src/dialogs/tsip_dialog_invite.client.c
index c1be3c5..a831755 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.client.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.client.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -68,45 +68,45 @@ static int c0000_Cancelling_2_Terminated_X_i300_to_699(va_list *app); /* 487 INV
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_resp2INVITE(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_INVITE(message);
+ return TSIP_RESPONSE_IS_TO_INVITE(message);
}
static tsk_bool_t _fsm_cond_is_resp2CANCEL(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_CANCEL(message);
+ return TSIP_RESPONSE_IS_TO_CANCEL(message);
}
/* Init FSM */
int tsip_dialog_invite_client_init(tsip_dialog_invite_t *self)
{
- return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (send INVITE) -> Outgoing
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_oINVITE, _fsm_state_Outgoing, c0000_Started_2_Outgoing_X_oINVITE, "c0000_Started_2_Outgoing_X_oINVITE"),
-
- /*=======================
- * === Outgoing ===
- */
- // Outgoing -> (i2xx INVITE) -> Connected
- TSK_FSM_ADD(_fsm_state_Outgoing, _fsm_action_i2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Connected, c0000_Outgoing_2_Connected_X_i2xxINVITE, "c0000_Outgoing_2_Connected_X_i2xxINVITE"),
- // Outgoing -> (iINVITE ) -> Outgoing
- TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_iINVITE, _fsm_state_Outgoing, c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE, "c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE"),
- // Outgoing -> (iUPDATE) -> Outgoing
- TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_iUPDATE, _fsm_state_Outgoing, c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE, "c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE"),
- // Outgoing -> (oCANCEL) -> Cancelling
- TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_oCANCEL, _fsm_state_Cancelling, c0000_Outgoing_2_Cancelling_X_oCANCEL, "c0000_Outgoing_2_Cancelling_X_oCANCEL"),
- // Cancelling -> (any response to cancel CANCEL) -> Cancelling
- TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i300_to_i699, _fsm_cond_is_resp2CANCEL, _fsm_state_Terminated, tsk_null, "c0000_Cancelling_2_Terminated_X_i300_to_699"),
- TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i2xx, _fsm_cond_is_resp2CANCEL, _fsm_state_Cancelling, tsk_null, "c0000_Cancelling_2_Cancelling_X_i2xx"),
- // Cancelling -> (i300-699 INVITE) -> Terminated
- TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITE, _fsm_state_Terminated, c0000_Cancelling_2_Terminated_X_i300_to_699, "c0000_Cancelling_2_Terminated_X_i300_to_699"),
- // Outgoing -> (300-699 INVITE) -> Terminated
- TSK_FSM_ADD(_fsm_state_Outgoing, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITE, _fsm_state_Terminated, c0000_Outgoing_2_Terminated_X_i300_to_i699INVITE, "c0000_Outgoing_2_Terminated_X_i300_to_i699INVITE"),
-
- TSK_FSM_ADD_NULL());
+ return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (send INVITE) -> Outgoing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_oINVITE, _fsm_state_Outgoing, c0000_Started_2_Outgoing_X_oINVITE, "c0000_Started_2_Outgoing_X_oINVITE"),
+
+ /*=======================
+ * === Outgoing ===
+ */
+ // Outgoing -> (i2xx INVITE) -> Connected
+ TSK_FSM_ADD(_fsm_state_Outgoing, _fsm_action_i2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Connected, c0000_Outgoing_2_Connected_X_i2xxINVITE, "c0000_Outgoing_2_Connected_X_i2xxINVITE"),
+ // Outgoing -> (iINVITE ) -> Outgoing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_iINVITE, _fsm_state_Outgoing, c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE, "c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE"),
+ // Outgoing -> (iUPDATE) -> Outgoing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_iUPDATE, _fsm_state_Outgoing, c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE, "c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE"),
+ // Outgoing -> (oCANCEL) -> Cancelling
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Outgoing, _fsm_action_oCANCEL, _fsm_state_Cancelling, c0000_Outgoing_2_Cancelling_X_oCANCEL, "c0000_Outgoing_2_Cancelling_X_oCANCEL"),
+ // Cancelling -> (any response to cancel CANCEL) -> Cancelling
+ TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i300_to_i699, _fsm_cond_is_resp2CANCEL, _fsm_state_Terminated, tsk_null, "c0000_Cancelling_2_Terminated_X_i300_to_699"),
+ TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i2xx, _fsm_cond_is_resp2CANCEL, _fsm_state_Cancelling, tsk_null, "c0000_Cancelling_2_Cancelling_X_i2xx"),
+ // Cancelling -> (i300-699 INVITE) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Cancelling, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITE, _fsm_state_Terminated, c0000_Cancelling_2_Terminated_X_i300_to_699, "c0000_Cancelling_2_Terminated_X_i300_to_699"),
+ // Outgoing -> (300-699 INVITE) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Outgoing, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITE, _fsm_state_Terminated, c0000_Outgoing_2_Terminated_X_i300_to_i699INVITE, "c0000_Outgoing_2_Terminated_X_i300_to_i699INVITE"),
+
+ TSK_FSM_ADD_NULL());
}
//--------------------------------------------------------
@@ -117,215 +117,215 @@ int tsip_dialog_invite_client_init(tsip_dialog_invite_t *self)
*/
int c0000_Started_2_Outgoing_X_oINVITE(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- /* This is the first FSM transaction when you try to make an audio/video/msrp call */
- if(!self->msession_mgr){
- int32_t transport_idx = TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default;
- self->msession_mgr = tmedia_session_mgr_create(action ? action->media.type : tmedia_all,
- TSIP_DIALOG_GET_STACK(self)->network.local_ip[transport_idx], TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]), tsk_true);
- if(TSIP_DIALOG_GET_STACK(self)->natt.ctx){
- ret = tmedia_session_mgr_set_natt_ctx(self->msession_mgr, TSIP_DIALOG_GET_STACK(self)->natt.ctx, TSIP_DIALOG_GET_STACK(self)->network.aor.ip[transport_idx]);
- }
-
- ret = tmedia_session_mgr_set_ice_ctx(self->msession_mgr, self->ice.ctx_audio, self->ice.ctx_video);
- ret = tsip_dialog_invite_msession_configure(self);
- }
-
- /* We are the client */
- self->is_client = tsk_true;
- /* Whether it's a client dialog for call transfer */
- self->is_transf = (TSIP_DIALOG_GET_SS(self)->id_parent != TSIP_SSESSION_INVALID_ID);
-
- /* Get Media type from the action */
- TSIP_DIALOG_GET_SS(self)->media.type = action->media.type;
- /* Appy media params received from the user */
- if(!TSK_LIST_IS_EMPTY(action->media.params)){
- tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
- }
-
- /* RFC 4028 - 7.1. Generating an Initial Session Refresh Request
-
- A UAC MAY include a Session-Expires header field in an initial
- session refresh request if it wants a session timer applied to the
- session. The value of this header field indicates the session
- interval desired by the UAC. If a Min-SE header is included in the
- initial session refresh request, the value of the Session-Expires
- MUST be greater than or equal to the value in Min-SE.
-
- The UAC MAY include the refresher parameter with value 'uac' if it
- wants to perform the refreshes. However, it is RECOMMENDED that the
- parameter be omitted so that it can be selected by the negotiation
- mechanisms described below.
- */
- if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout){
- self->stimers.timer.timeout = TSIP_DIALOG_GET_SS(self)->media.timers.timeout;
- tsk_strupdate(&self->stimers.refresher, TSIP_DIALOG_GET_SS(self)->media.timers.refresher);
- self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uac");
- self->supported.timer = tsk_true;
- }
-
- /* QoS
- * One Voice Profile - 5.4.1 SIP Precondition Considerations
- * The UE shall use the Supported header, and not the Require header, to indicate the support of precondition in
- * accordance with Section 5.1.3.1 of 3GPP TS 24.229.
- */
- self->qos.type = TSIP_DIALOG_GET_SS(self)->media.qos.type;
- self->qos.strength = TSIP_DIALOG_GET_SS(self)->media.qos.strength;
- tmedia_session_mgr_set_qos(self->msession_mgr, self->qos.type, self->qos.strength);
- self->supported.precondition = (self->qos.strength == tmedia_qos_strength_optional);
- self->required.precondition = (self->qos.strength == tmedia_qos_strength_mandatory);
-
- /* send the request */
- ret = send_INVITE(self, tsk_false);
-
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
-
- return ret;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ /* This is the first FSM transaction when you try to make an audio/video/msrp call */
+ if(!self->msession_mgr) {
+ int32_t transport_idx = TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default;
+ self->msession_mgr = tmedia_session_mgr_create(action ? action->media.type : tmedia_all,
+ TSIP_DIALOG_GET_STACK(self)->network.local_ip[transport_idx], TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]), tsk_true);
+ if(TSIP_DIALOG_GET_STACK(self)->natt.ctx) {
+ ret = tmedia_session_mgr_set_natt_ctx(self->msession_mgr, TSIP_DIALOG_GET_STACK(self)->natt.ctx, TSIP_DIALOG_GET_STACK(self)->network.aor.ip[transport_idx]);
+ }
+
+ ret = tmedia_session_mgr_set_ice_ctx(self->msession_mgr, self->ice.ctx_audio, self->ice.ctx_video);
+ ret = tsip_dialog_invite_msession_configure(self);
+ }
+
+ /* We are the client */
+ self->is_client = tsk_true;
+ /* Whether it's a client dialog for call transfer */
+ self->is_transf = (TSIP_DIALOG_GET_SS(self)->id_parent != TSIP_SSESSION_INVALID_ID);
+
+ /* Get Media type from the action */
+ TSIP_DIALOG_GET_SS(self)->media.type = action->media.type;
+ /* Appy media params received from the user */
+ if(!TSK_LIST_IS_EMPTY(action->media.params)) {
+ tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
+ }
+
+ /* RFC 4028 - 7.1. Generating an Initial Session Refresh Request
+
+ A UAC MAY include a Session-Expires header field in an initial
+ session refresh request if it wants a session timer applied to the
+ session. The value of this header field indicates the session
+ interval desired by the UAC. If a Min-SE header is included in the
+ initial session refresh request, the value of the Session-Expires
+ MUST be greater than or equal to the value in Min-SE.
+
+ The UAC MAY include the refresher parameter with value 'uac' if it
+ wants to perform the refreshes. However, it is RECOMMENDED that the
+ parameter be omitted so that it can be selected by the negotiation
+ mechanisms described below.
+ */
+ if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout) {
+ self->stimers.timer.timeout = TSIP_DIALOG_GET_SS(self)->media.timers.timeout;
+ tsk_strupdate(&self->stimers.refresher, TSIP_DIALOG_GET_SS(self)->media.timers.refresher);
+ self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uac");
+ self->supported.timer = tsk_true;
+ }
+
+ /* QoS
+ * One Voice Profile - 5.4.1 SIP Precondition Considerations
+ * The UE shall use the Supported header, and not the Require header, to indicate the support of precondition in
+ * accordance with Section 5.1.3.1 of 3GPP TS 24.229.
+ */
+ self->qos.type = TSIP_DIALOG_GET_SS(self)->media.qos.type;
+ self->qos.strength = TSIP_DIALOG_GET_SS(self)->media.qos.strength;
+ tmedia_session_mgr_set_qos(self->msession_mgr, self->qos.type, self->qos.strength);
+ self->supported.precondition = (self->qos.strength == tmedia_qos_strength_optional);
+ self->required.precondition = (self->qos.strength == tmedia_qos_strength_mandatory);
+
+ /* send the request */
+ ret = send_INVITE(self, tsk_false);
+
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+
+ return ret;
}
/* Outgoing -> (i2xx INVITE) -> Connected
*/
int c0000_Outgoing_2_Connected_X_i2xxINVITE(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *r2xxINVITE = va_arg(*app, const tsip_response_t *);
- /* const tsip_action_t* action = */ va_arg(*app, const tsip_action_t *);
-
- /* Update the dialog state */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), r2xxINVITE))){
- return ret;
- }
-
- /* Process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, r2xxINVITE))){
- send_BYE(self);
- return ret;
- }
- else{
- /* send ACK */
- ret = send_ACK(self, r2xxINVITE);
- }
-
- /* Determine whether the remote party support UPDATE */
- self->support_update = tsip_message_allowed(r2xxINVITE, "UPDATE");
-
- /* Session Timers */
- if(self->stimers.timer.timeout){
- tsip_dialog_invite_stimers_handle(self, r2xxINVITE);
- }
-
- // starts ICE timers now that both parties received the "candidates"
- if(tsip_dialog_invite_ice_is_enabled(self)){
- tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
- }
-
- /* Alert the user (session) */
- ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
- TSIP_RESPONSE_CODE(r2xxINVITE), TSIP_RESPONSE_PHRASE(r2xxINVITE), r2xxINVITE);
- /* Alert the user (dialog) */
- ret = TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
-
- if(self->is_transf){
- ret = tsip_dialog_invite_notify_parent(self, r2xxINVITE);
- self->is_transf = tsk_false;//final response -> no longer need to notify the parent
- }
-
- /* MSRP File Transfer */
- /*if(TSIP_DIALOG(self)->curr_action && ((TSIP_DIALOG(self)->curr_action->media.type & tmedia_msrp) == tmedia_msrp)){
- // FIXME
- tmedia_session_mgr_send_file(self->msession_mgr, "C:\\avatar.png",
- TMEDIA_SESSION_SET_NULL());
- }*/
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *r2xxINVITE = va_arg(*app, const tsip_response_t *);
+ /* const tsip_action_t* action = */ va_arg(*app, const tsip_action_t *);
+
+ /* Update the dialog state */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), r2xxINVITE))) {
+ return ret;
+ }
+
+ /* Process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, r2xxINVITE))) {
+ send_BYE(self);
+ return ret;
+ }
+ else {
+ /* send ACK */
+ ret = send_ACK(self, r2xxINVITE);
+ }
+
+ /* Determine whether the remote party support UPDATE */
+ self->support_update = tsip_message_allowed(r2xxINVITE, "UPDATE");
+
+ /* Session Timers */
+ if(self->stimers.timer.timeout) {
+ tsip_dialog_invite_stimers_handle(self, r2xxINVITE);
+ }
+
+ // starts ICE timers now that both parties received the "candidates"
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
+ }
+
+ /* Alert the user (session) */
+ ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
+ TSIP_RESPONSE_CODE(r2xxINVITE), TSIP_RESPONSE_PHRASE(r2xxINVITE), r2xxINVITE);
+ /* Alert the user (dialog) */
+ ret = TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+
+ if(self->is_transf) {
+ ret = tsip_dialog_invite_notify_parent(self, r2xxINVITE);
+ self->is_transf = tsk_false;//final response -> no longer need to notify the parent
+ }
+
+ /* MSRP File Transfer */
+ /*if(TSIP_DIALOG(self)->curr_action && ((TSIP_DIALOG(self)->curr_action->media.type & tmedia_msrp) == tmedia_msrp)){
+ // FIXME
+ tmedia_session_mgr_send_file(self->msession_mgr, "C:\\avatar.png",
+ TMEDIA_SESSION_SET_NULL());
+ }*/
+
+ return ret;
}
/* Outgoing -> (iINVITE or iINVITE) -> Outgoing
*/
int c0000_Outgoing_2_Outgoing_X_iINVITEorUPDATE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_request_t *rINVITEorUPDATE = va_arg(*app, const tsip_request_t *);
- tsk_bool_t force_sdp;
- int ret = 0;
-
- /* process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, rINVITEorUPDATE))){
- /* Send error */
- return ret;
- }
-
- /* Send 200 OK */
- // force SDP in 200 OK even if the request has the same SDP version
- force_sdp = TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE);
- ret = send_RESPONSE(self, rINVITEorUPDATE, 200, "OK",
- (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
-
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", rINVITEorUPDATE);
-
-
- return ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_request_t *rINVITEorUPDATE = va_arg(*app, const tsip_request_t *);
+ tsk_bool_t force_sdp;
+ int ret = 0;
+
+ /* process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, rINVITEorUPDATE))) {
+ /* Send error */
+ return ret;
+ }
+
+ /* Send 200 OK */
+ // force SDP in 200 OK even if the request has the same SDP version
+ force_sdp = TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE);
+ ret = send_RESPONSE(self, rINVITEorUPDATE, 200, "OK",
+ (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
+
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", rINVITEorUPDATE);
+
+
+ return ret;
}
/* Outgoing -> (i300-i699 INVITE) -> Terminated
*/
int c0000_Outgoing_2_Terminated_X_i300_to_i699INVITE(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* set last error (or info) */
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self),
- TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
-
- /* alert the user */
- ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- if(self->is_transf){
- ret = tsip_dialog_invite_notify_parent(self, response);
- self->is_transf = tsk_false;//final response -> no longer need to notify the parent
- }
-
- return ret;
+ int ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self),
+ TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+
+ /* alert the user */
+ ret = TSIP_DIALOG_INVITE_SIGNAL(self, tsip_ao_request,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ if(self->is_transf) {
+ ret = tsip_dialog_invite_notify_parent(self, response);
+ self->is_transf = tsk_false;//final response -> no longer need to notify the parent
+ }
+
+ return ret;
}
/* Outgoing -> (oCANCEL ) -> Cancelling
*/
int c0000_Outgoing_2_Cancelling_X_oCANCEL(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
self->is_cancelling = tsk_true;
-
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- return send_CANCEL(self);
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+
+ return send_CANCEL(self);
}
int c0000_Cancelling_2_Terminated_X_i300_to_699(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Request cancelled", TSIP_RESPONSE_CODE(response));
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Request cancelled", TSIP_RESPONSE_CODE(response));
- return 0;
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.ect.c b/tinySIP/src/dialogs/tsip_dialog_invite.ect.c
index 8c21dd2..ec61f81 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.ect.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.ect.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -73,71 +73,71 @@ static int x0400_iECTing_2_Connected_X_23456fNOTIFY(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_resp2REFER(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_REFER(message);
+ return TSIP_RESPONSE_IS_TO_REFER(message);
}
static tsk_bool_t _fsm_cond_is_1xxNOTIFY(tsip_dialog_invite_t* self, tsip_request_t* notify)
{
- short code = get_SipFragResponseCode(notify);
- return (code >= 100 && code <= 199);
+ short code = get_SipFragResponseCode(notify);
+ return (code >= 100 && code <= 199);
}
static tsk_bool_t _fsm_cond_is_23456NOTIFY(tsip_dialog_invite_t* self, tsip_request_t* notify)
{
- short code = get_SipFragResponseCode(notify);
- return (code >= 200 && code <= 699);
+ short code = get_SipFragResponseCode(notify);
+ return (code >= 200 && code <= 699);
}
static tsk_bool_t _fsm_cond_is_fREFER(tsip_dialog_invite_t* self, tsip_request_t* refer)
{
- const tsip_header_Refer_To_t* Refer_To = (const tsip_header_Refer_To_t*)tsip_message_get_header(refer, tsip_htype_Refer_To);
- return (!Refer_To || !Refer_To->uri);
+ const tsip_header_Refer_To_t* Refer_To = (const tsip_header_Refer_To_t*)tsip_message_get_header(refer, tsip_htype_Refer_To);
+ return (!Refer_To || !Refer_To->uri);
}
static tsk_bool_t _fsm_cond_is_1xxfNOTIFY(tsip_dialog_invite_t* self, tsip_response_t* response)
{
- short code = TSIP_RESPONSE_CODE(response);
- return (code >= 100 && code <= 199);
+ short code = TSIP_RESPONSE_CODE(response);
+ return (code >= 100 && code <= 199);
}
static tsk_bool_t _fsm_cond_is_23456fNOTIFY(tsip_dialog_invite_t* self, tsip_response_t* response)
{
- short code = TSIP_RESPONSE_CODE(response);
- return (code >= 200 && code <= 699);
+ short code = TSIP_RESPONSE_CODE(response);
+ return (code >= 200 && code <= 699);
}
int tsip_dialog_invite_ect_init(tsip_dialog_invite_t *self)
{
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Outgoing Transfer ===
- */
- // Connected -> (oREFER) -> oECTing
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oECT, _fsm_state_oECTing, x0400_Connected_2_oECTing_X_oECT, "x0400_Connected_2_oECTing_X_oECT"),
- // oECTing -> (i2xx REFER) -> oECTing
- TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_i2xx, _fsm_cond_is_resp2REFER, _fsm_state_oECTing, x0400_oECTing_2_oECTing_X_i2xx, "x0400_oECTing_2_oECTing_X_i2xx"),
- // oECTing -> (i300-699 REFER) -> Connected
- TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_i300_to_i699, _fsm_cond_is_resp2REFER, _fsm_state_Connected, x0400_oECTing_2_Connected_X_i3456, "x0400_ECTing_2_Connected_X_i36"),
- // oECTing -> (iNotify 1xx sipfrag) -> oECTing
- TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_iNOTIFY, _fsm_cond_is_1xxNOTIFY, _fsm_state_oECTing, x0400_oECTing_2_oECTing_X_iNOTIFY, "x0400_oECTing_2_oECTing_X_iNOTIFY"),
- // oECTing -> (iNotify 23456 sipfrag) -> Connected
- TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_iNOTIFY, _fsm_cond_is_23456NOTIFY, _fsm_state_Connected, x0400_oECTing_2_Connected_X_iNOTIFY, "x0400_oECTing_2_Connected_X_iNOTIFY"),
-
- /*=======================
- * === Incoming Transfer ===
- */
- // Connected -> (iREFER invalid) -> Connected
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREFER, _fsm_cond_is_fREFER, _fsm_state_Connected, x0400_Connected_2_Connected_X_fREFER, "x0400_Connected_2_Connected_X_fREFER"),
- // Connected -> (iREFER) -> iECTreq
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iREFER, _fsm_state_iECTreq, x0400_Connected_2_iECTreq_X_iREFER, "x0400_Connected_2_iECTreq_X_iREFER"),
- // iECTreq -> (reject) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_iECTreq, _fsm_action_iECT_REJECT, _fsm_state_Connected, x0400_iECTreq_2_Connected_X_reject, "x0400_iECTreq_2_Connected_X_reject"),
- // iECTreq -> (accept) -> iECTing
- TSK_FSM_ADD_ALWAYS(_fsm_state_iECTreq, _fsm_action_iECT_ACCEPT, _fsm_state_iECTing, x0400_iECTreq_2_iECTing_X_accept, "x0400_iECTreq_2_iECTing_X_accept"),
- // iECTing -> (1xx lnotify) -> iECTing
- TSK_FSM_ADD(_fsm_state_iECTing, _fsm_action_iECT_lNOTIFY, _fsm_cond_is_1xxfNOTIFY, _fsm_state_iECTing, x0400_iECTing_2_iECTing_X_1xxfNOTIFY, "x0400_iECTing_2_iECTing_X_1xxfNOTIFY"),
- // iECTing -> (23456 lnotify) -> Connected
- TSK_FSM_ADD(_fsm_state_iECTing, _fsm_action_iECT_lNOTIFY, _fsm_cond_is_23456fNOTIFY, _fsm_state_Connected, x0400_iECTing_2_Connected_X_23456fNOTIFY, "x0400_iECTing_2_Connected_X_23456fNOTIFY"),
-
- TSK_FSM_ADD_NULL());
-
- return 0;
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Outgoing Transfer ===
+ */
+ // Connected -> (oREFER) -> oECTing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oECT, _fsm_state_oECTing, x0400_Connected_2_oECTing_X_oECT, "x0400_Connected_2_oECTing_X_oECT"),
+ // oECTing -> (i2xx REFER) -> oECTing
+ TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_i2xx, _fsm_cond_is_resp2REFER, _fsm_state_oECTing, x0400_oECTing_2_oECTing_X_i2xx, "x0400_oECTing_2_oECTing_X_i2xx"),
+ // oECTing -> (i300-699 REFER) -> Connected
+ TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_i300_to_i699, _fsm_cond_is_resp2REFER, _fsm_state_Connected, x0400_oECTing_2_Connected_X_i3456, "x0400_ECTing_2_Connected_X_i36"),
+ // oECTing -> (iNotify 1xx sipfrag) -> oECTing
+ TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_iNOTIFY, _fsm_cond_is_1xxNOTIFY, _fsm_state_oECTing, x0400_oECTing_2_oECTing_X_iNOTIFY, "x0400_oECTing_2_oECTing_X_iNOTIFY"),
+ // oECTing -> (iNotify 23456 sipfrag) -> Connected
+ TSK_FSM_ADD(_fsm_state_oECTing, _fsm_action_iNOTIFY, _fsm_cond_is_23456NOTIFY, _fsm_state_Connected, x0400_oECTing_2_Connected_X_iNOTIFY, "x0400_oECTing_2_Connected_X_iNOTIFY"),
+
+ /*=======================
+ * === Incoming Transfer ===
+ */
+ // Connected -> (iREFER invalid) -> Connected
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREFER, _fsm_cond_is_fREFER, _fsm_state_Connected, x0400_Connected_2_Connected_X_fREFER, "x0400_Connected_2_Connected_X_fREFER"),
+ // Connected -> (iREFER) -> iECTreq
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_iREFER, _fsm_state_iECTreq, x0400_Connected_2_iECTreq_X_iREFER, "x0400_Connected_2_iECTreq_X_iREFER"),
+ // iECTreq -> (reject) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_iECTreq, _fsm_action_iECT_REJECT, _fsm_state_Connected, x0400_iECTreq_2_Connected_X_reject, "x0400_iECTreq_2_Connected_X_reject"),
+ // iECTreq -> (accept) -> iECTing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_iECTreq, _fsm_action_iECT_ACCEPT, _fsm_state_iECTing, x0400_iECTreq_2_iECTing_X_accept, "x0400_iECTreq_2_iECTing_X_accept"),
+ // iECTing -> (1xx lnotify) -> iECTing
+ TSK_FSM_ADD(_fsm_state_iECTing, _fsm_action_iECT_lNOTIFY, _fsm_cond_is_1xxfNOTIFY, _fsm_state_iECTing, x0400_iECTing_2_iECTing_X_1xxfNOTIFY, "x0400_iECTing_2_iECTing_X_1xxfNOTIFY"),
+ // iECTing -> (23456 lnotify) -> Connected
+ TSK_FSM_ADD(_fsm_state_iECTing, _fsm_action_iECT_lNOTIFY, _fsm_cond_is_23456fNOTIFY, _fsm_state_Connected, x0400_iECTing_2_Connected_X_23456fNOTIFY, "x0400_iECTing_2_Connected_X_23456fNOTIFY"),
+
+ TSK_FSM_ADD_NULL());
+
+ return 0;
}
@@ -148,235 +148,235 @@ int tsip_dialog_invite_ect_init(tsip_dialog_invite_t *self)
// Connected -> (oREFER) -> oECTing
static int x0400_Connected_2_oECTing_X_oECT(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- ret = send_REFER(self, action->ect.to);
+ ret = send_REFER(self, action->ect.to);
- if(ret == 0){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_trying,
- tsip_event_code_dialog_request_sent, "Call Transfer Initiated", tsk_null);
- }
- else; //Must never happen
+ if(ret == 0) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_trying,
+ tsip_event_code_dialog_request_sent, "Call Transfer Initiated", tsk_null);
+ }
+ else; //Must never happen
- return ret;
+ return ret;
}
// ECTing -> (i2xx REFER) -> oECTing
static int x0400_oECTing_2_oECTing_X_i2xx(va_list *app)
{
- tsip_dialog_invite_t *self;
- const tsip_response_t* response;
- const tsip_header_Refer_Sub_t* Refer_Sub;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- response = va_arg(*app, const tsip_message_t *);
- Refer_Sub = (const tsip_header_Refer_Sub_t*)tsip_message_get_header(response, tsip_htype_Refer_Sub);
- if(Refer_Sub){
- self->refersub = Refer_Sub->sub;
- }
- if(tsip_message_required(response, "norefersub")){
- self->required.norefersub = tsk_true;
- }
-
- return TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_accepted,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ tsip_dialog_invite_t *self;
+ const tsip_response_t* response;
+ const tsip_header_Refer_Sub_t* Refer_Sub;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ response = va_arg(*app, const tsip_message_t *);
+ Refer_Sub = (const tsip_header_Refer_Sub_t*)tsip_message_get_header(response, tsip_htype_Refer_Sub);
+ if(Refer_Sub) {
+ self->refersub = Refer_Sub->sub;
+ }
+ if(tsip_message_required(response, "norefersub")) {
+ self->required.norefersub = tsk_true;
+ }
+
+ return TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_accepted,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
}
// oECTing -> (i300-699 REFER) -> Connected
static int x0400_oECTing_2_Connected_X_i3456(va_list *app)
{
- tsip_dialog_invite_t *self;
- const tsip_response_t* response;
+ tsip_dialog_invite_t *self;
+ const tsip_response_t* response;
- self = va_arg(*app, tsip_dialog_invite_t *);
- response = va_arg(*app, const tsip_message_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ response = va_arg(*app, const tsip_message_t *);
- return TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_failed,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ return TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_failed,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
}
// oECTing -> (iNotify 1xx sipfrag) -> oECTing
static int x0400_oECTing_2_oECTing_X_iNOTIFY(va_list *app)
{
- int ret = 0;
- tsip_dialog_invite_t *self;
- const tsip_request_t* notify;
- tsip_response_t *sipfrag = tsk_null;
+ int ret = 0;
+ tsip_dialog_invite_t *self;
+ const tsip_request_t* notify;
+ tsip_response_t *sipfrag = tsk_null;
- self = va_arg(*app, tsip_dialog_invite_t *);
- notify = va_arg(*app, const tsip_message_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ notify = va_arg(*app, const tsip_message_t *);
- sipfrag = get_SipFragMessage(notify);
- if(sipfrag){
- send_RESPONSE(self, notify, 200, "Ok", tsk_false);
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify,
- TSIP_RESPONSE_CODE(sipfrag), TSIP_RESPONSE_PHRASE(sipfrag), notify);
- }
+ sipfrag = get_SipFragMessage(notify);
+ if(sipfrag) {
+ send_RESPONSE(self, notify, 200, "Ok", tsk_false);
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify,
+ TSIP_RESPONSE_CODE(sipfrag), TSIP_RESPONSE_PHRASE(sipfrag), notify);
+ }
- TSK_OBJECT_SAFE_FREE(sipfrag);
+ TSK_OBJECT_SAFE_FREE(sipfrag);
- return ret;
+ return ret;
}
// oECTing -> (iNotify 23456 sipfrag) -> Connected
static int x0400_oECTing_2_Connected_X_iNOTIFY(va_list *app)
{
- int ret = 0;
- tsip_dialog_invite_t *self;
- const tsip_request_t* notify;
- tsip_response_t *sipfrag = tsk_null;
+ int ret = 0;
+ tsip_dialog_invite_t *self;
+ const tsip_request_t* notify;
+ tsip_response_t *sipfrag = tsk_null;
- self = va_arg(*app, tsip_dialog_invite_t *);
- notify = va_arg(*app, const tsip_message_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ notify = va_arg(*app, const tsip_message_t *);
- sipfrag = get_SipFragMessage(notify);
- if(sipfrag){
- send_RESPONSE(self, notify, 200, "Ok", tsk_false);
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify,
- TSIP_RESPONSE_CODE(sipfrag), TSIP_RESPONSE_PHRASE(sipfrag), notify);
- }
+ sipfrag = get_SipFragMessage(notify);
+ if(sipfrag) {
+ send_RESPONSE(self, notify, 200, "Ok", tsk_false);
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify,
+ TSIP_RESPONSE_CODE(sipfrag), TSIP_RESPONSE_PHRASE(sipfrag), notify);
+ }
- TSK_OBJECT_SAFE_FREE(sipfrag);
+ TSK_OBJECT_SAFE_FREE(sipfrag);
- return ret;
+ return ret;
}
// Connected -> (iREFER) -> iECTreq
static int x0400_Connected_2_iECTreq_X_iREFER(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_request_t* refer;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- refer = va_arg(*app, const tsip_message_t *);
-
- TSK_OBJECT_SAFE_FREE(self->last_iRefer);
- self->last_iRefer = tsk_object_ref((tsk_object_t*)refer);
-
- ret = send_RESPONSE(self, self->last_iRefer, 100, "Asking for Transfer", tsk_false);
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_requested,
- tsip_event_code_dialog_request_incoming, "Incoming Request", self->last_iRefer);
-
- return ret;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_request_t* refer;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ refer = va_arg(*app, const tsip_message_t *);
+
+ TSK_OBJECT_SAFE_FREE(self->last_iRefer);
+ self->last_iRefer = tsk_object_ref((tsk_object_t*)refer);
+
+ ret = send_RESPONSE(self, self->last_iRefer, 100, "Asking for Transfer", tsk_false);
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_requested,
+ tsip_event_code_dialog_request_incoming, "Incoming Request", self->last_iRefer);
+
+ return ret;
}
// iECTreq -> (reject) -> Connected
static int x0400_iECTreq_2_Connected_X_reject(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
- short code;
- const char* phrase;
- char* reason = tsk_null;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- // Send Reject
- code = action->line_resp.code>=300 ? action->line_resp.code : 603;
- phrase = action->line_resp.phrase ? action->line_resp.phrase : "Decline Transfer";
- tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
- ret = send_ERROR(self, self->last_iRefer, code, phrase, reason);
- TSK_FREE(reason);
-
- return ret;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+ short code;
+ const char* phrase;
+ char* reason = tsk_null;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ // Send Reject
+ code = action->line_resp.code>=300 ? action->line_resp.code : 603;
+ phrase = action->line_resp.phrase ? action->line_resp.phrase : "Decline Transfer";
+ tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
+ ret = send_ERROR(self, self->last_iRefer, code, phrase, reason);
+ TSK_FREE(reason);
+
+ return ret;
}
// iECTreq -> (accept) -> iECTing
static int x0400_iECTreq_2_iECTing_X_accept(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_header_Refer_To_t* Refer_To;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- // Send 200 OK
- ret = send_RESPONSE(self, self->last_iRefer, 200, "Transfering", tsk_false);
- Refer_To = (const tsip_header_Refer_To_t*)tsip_message_get_header(self->last_iRefer, tsip_htype_Refer_To); // Not null: already checked
- // Make call to the referToUri
- TSK_OBJECT_SAFE_FREE(self->ss_transf);
- self->ss_transf = tsip_ssession_create(TSIP_DIALOG_GET_STACK(self),
- TSIP_SSESSION_SET_PARENT_ID(TSIP_DIALOG_GET_SS(self)->id),
- TSIP_SSESSION_SET_NULL());
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_header_Refer_To_t* Refer_To;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ // Send 200 OK
+ ret = send_RESPONSE(self, self->last_iRefer, 200, "Transfering", tsk_false);
+ Refer_To = (const tsip_header_Refer_To_t*)tsip_message_get_header(self->last_iRefer, tsip_htype_Refer_To); // Not null: already checked
+ // Make call to the referToUri
+ TSK_OBJECT_SAFE_FREE(self->ss_transf);
+ self->ss_transf = tsip_ssession_create(TSIP_DIALOG_GET_STACK(self),
+ TSIP_SSESSION_SET_PARENT_ID(TSIP_DIALOG_GET_SS(self)->id),
+ TSIP_SSESSION_SET_NULL());
#if TSIP_UNDER_WINDOWS // because of DirectShow Attach()
- self->ss_transf->media.type = tmedia_audio;
+ self->ss_transf->media.type = tmedia_audio;
#else
- self->ss_transf->media.type = self->msession_mgr ? self->msession_mgr->type : tmedia_defaults_get_media_type();
+ self->ss_transf->media.type = self->msession_mgr ? self->msession_mgr->type : tmedia_defaults_get_media_type();
#endif
- self->ss_transf->owner = tsk_false;// not owned by the end-user -> will be destroyed as soon as the dialog dtor is called
-
- if(ret == 0){
- ret = tsip_invite_event_signal(tsip_i_ect_newcall, self->ss_transf,
- tsip_event_code_dialog_request_outgoing, "ECTing", self->last_iRefer);
- }
-
- ret = tsip_ssession_set(self->ss_transf,
- TSIP_SSESSION_SET_TO_OBJ(Refer_To->uri),
- TSIP_SSESSION_SET_NULL());
- ret = tsip_api_invite_send_invite(self->ss_transf, self->ss_transf->media.type,
- TSIP_ACTION_SET_NULL());
-
- return ret;
+ self->ss_transf->owner = tsk_false;// not owned by the end-user -> will be destroyed as soon as the dialog dtor is called
+
+ if(ret == 0) {
+ ret = tsip_invite_event_signal(tsip_i_ect_newcall, self->ss_transf,
+ tsip_event_code_dialog_request_outgoing, "ECTing", self->last_iRefer);
+ }
+
+ ret = tsip_ssession_set(self->ss_transf,
+ TSIP_SSESSION_SET_TO_OBJ(Refer_To->uri),
+ TSIP_SSESSION_SET_NULL());
+ ret = tsip_api_invite_send_invite(self->ss_transf, self->ss_transf->media.type,
+ TSIP_ACTION_SET_NULL());
+
+ return ret;
}
// iECTing -> (1xx lnotify) -> iECTing
static int x0400_iECTing_2_iECTing_X_1xxfNOTIFY(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_response_t* response;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_response_t* response;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ response = va_arg(*app, const tsip_message_t *);
- self = va_arg(*app, tsip_dialog_invite_t *);
- response = va_arg(*app, const tsip_message_t *);
-
- // send NOTIFY (event if norefersub enabled) and alert user
- ret = send_NOTIFY(self, TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
+ // send NOTIFY (event if norefersub enabled) and alert user
+ ret = send_NOTIFY(self, TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
- return ret;
+ return ret;
}
// iECTing -> (23456 lnotify) -> Connected
static int x0400_iECTing_2_Connected_X_23456fNOTIFY(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_response_t* response;
- short code;
-
- self = va_arg(*app, tsip_dialog_invite_t *);
- response = va_arg(*app, const tsip_message_t *);
- code = TSIP_RESPONSE_CODE(response);
-
- // send NOTIFY (event if norefersub enabled) and alert user
- ret = send_NOTIFY(self, code, TSIP_RESPONSE_PHRASE(response));
-
- if(code >= 200 && code <= 299){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_completed,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), self->last_iRefer);
- // hang up the call
- ret = send_BYE(self);
- }
- else{
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_failed,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), self->last_iRefer);
- }
-
- return ret;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_response_t* response;
+ short code;
+
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ response = va_arg(*app, const tsip_message_t *);
+ code = TSIP_RESPONSE_CODE(response);
+
+ // send NOTIFY (event if norefersub enabled) and alert user
+ ret = send_NOTIFY(self, code, TSIP_RESPONSE_PHRASE(response));
+
+ if(code >= 200 && code <= 299) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_completed,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), self->last_iRefer);
+ // hang up the call
+ ret = send_BYE(self);
+ }
+ else {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_ect_failed,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), self->last_iRefer);
+ }
+
+ return ret;
}
@@ -387,101 +387,101 @@ static int x0400_iECTing_2_Connected_X_23456fNOTIFY(va_list *app)
static int send_NOTIFY(tsip_dialog_invite_t *self, short code, const char* phrase)
{
- tsip_request_t *notify = tsk_null;
- int ret = -1;
-
- if((notify = tsip_dialog_request_new(TSIP_DIALOG(self), "NOTIFY"))){
- char* sipfrag = tsk_null;
- tsk_sprintf(&sipfrag, "%s %hi %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT, code, phrase);
- ret = tsip_message_add_content(notify, "message/sipfrag", sipfrag, tsk_strlen(sipfrag));
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), notify);
- if(ret == 0){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify, code, phrase, notify);
- }
- TSK_FREE(sipfrag);
- TSK_OBJECT_SAFE_FREE(notify);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create request");
- }
- return ret;
+ tsip_request_t *notify = tsk_null;
+ int ret = -1;
+
+ if((notify = tsip_dialog_request_new(TSIP_DIALOG(self), "NOTIFY"))) {
+ char* sipfrag = tsk_null;
+ tsk_sprintf(&sipfrag, "%s %hi %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT, code, phrase);
+ ret = tsip_message_add_content(notify, "message/sipfrag", sipfrag, tsk_strlen(sipfrag));
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), notify);
+ if(ret == 0) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_notify, code, phrase, notify);
+ }
+ TSK_FREE(sipfrag);
+ TSK_OBJECT_SAFE_FREE(notify);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create request");
+ }
+ return ret;
}
static int send_REFER(tsip_dialog_invite_t *self, const char* to)
{
- int ret = 0;
- tsip_request_t *refer = tsk_null;
- tsip_uri_t* toUri = tsk_null;
-
- if(!self || !to){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!(toUri = tsip_uri_parse(to, tsk_strlen(to)))){
- TSK_DEBUG_ERROR("Failed to parse %s", to);
- return -1;
- }
- else{
- // tsk_params_add_param(&toUri->params, "method", "INVITE");
- }
-
- if((refer = tsip_dialog_request_new(TSIP_DIALOG(self), "REFER"))){
- tsk_istr_t cid;
- tsk_strrandom(&cid);
- /* Add headers */
- tsip_message_add_headers(refer,
- TSIP_HEADER_REFER_TO_VA_ARGS(toUri),
- TSIP_HEADER_REFERRED_BY_VA_ARGS(TSIP_DIALOG_GET_STACK(self)->identity.impu, cid),
- TSIP_HEADER_REFER_SUB_VA_ARGS(self->refersub),
- tsk_null);
- if(self->supported.norefersub){
- tsip_message_add_headers(refer,
- TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub"),
- tsk_null);
- }
-
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), refer);
- TSK_OBJECT_SAFE_FREE(refer);
- }
-
- TSK_OBJECT_SAFE_FREE(toUri);
- return ret;
+ int ret = 0;
+ tsip_request_t *refer = tsk_null;
+ tsip_uri_t* toUri = tsk_null;
+
+ if(!self || !to) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!(toUri = tsip_uri_parse(to, tsk_strlen(to)))) {
+ TSK_DEBUG_ERROR("Failed to parse %s", to);
+ return -1;
+ }
+ else {
+ // tsk_params_add_param(&toUri->params, "method", "INVITE");
+ }
+
+ if((refer = tsip_dialog_request_new(TSIP_DIALOG(self), "REFER"))) {
+ tsk_istr_t cid;
+ tsk_strrandom(&cid);
+ /* Add headers */
+ tsip_message_add_headers(refer,
+ TSIP_HEADER_REFER_TO_VA_ARGS(toUri),
+ TSIP_HEADER_REFERRED_BY_VA_ARGS(TSIP_DIALOG_GET_STACK(self)->identity.impu, cid),
+ TSIP_HEADER_REFER_SUB_VA_ARGS(self->refersub),
+ tsk_null);
+ if(self->supported.norefersub) {
+ tsip_message_add_headers(refer,
+ TSIP_HEADER_SUPPORTED_VA_ARGS("norefersub"),
+ tsk_null);
+ }
+
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), refer);
+ TSK_OBJECT_SAFE_FREE(refer);
+ }
+
+ TSK_OBJECT_SAFE_FREE(toUri);
+ return ret;
}
static tsip_response_t * get_SipFragMessage(const tsip_request_t* notify)
{
- tsip_response_t *sipfrag = tsk_null;
- if(TSIP_MESSAGE_HAS_CONTENT(notify) && tsk_striequals(notify->Content_Type->type, "message/sipfrag")){
- tsk_ragel_state_t state;
- tsk_bool_t ret;
- char* content = tsk_null;
-
- // sipfrag is a "tsip_message_t" with an extra \r\n
- content = tsk_strndup(notify->Content->data, notify->Content->size);
- if(tsk_strLastIndexOf(content, tsk_strlen(content), "\r\n") != tsk_strlen(content) - 2){//Hack for XXX buggy client
- tsk_strcat(&content, "\r\n");
- }
- tsk_strcat(&content, "\r\n");
-
- tsk_ragel_state_init(&state, content, tsk_strlen(content));
- ret = tsip_message_parse(&state, &sipfrag, tsk_false);
- TSK_FREE(content);
- if(ret && TSIP_MESSAGE_IS_RESPONSE(sipfrag)){
- return sipfrag;
- }
- TSK_OBJECT_SAFE_FREE(sipfrag);
- }
- return sipfrag;
+ tsip_response_t *sipfrag = tsk_null;
+ if(TSIP_MESSAGE_HAS_CONTENT(notify) && tsk_striequals(notify->Content_Type->type, "message/sipfrag")) {
+ tsk_ragel_state_t state;
+ tsk_bool_t ret;
+ char* content = tsk_null;
+
+ // sipfrag is a "tsip_message_t" with an extra \r\n
+ content = tsk_strndup(notify->Content->data, notify->Content->size);
+ if(tsk_strLastIndexOf(content, tsk_strlen(content), "\r\n") != tsk_strlen(content) - 2) { //Hack for XXX buggy client
+ tsk_strcat(&content, "\r\n");
+ }
+ tsk_strcat(&content, "\r\n");
+
+ tsk_ragel_state_init(&state, content, tsk_strlen(content));
+ ret = tsip_message_parse(&state, &sipfrag, tsk_false);
+ TSK_FREE(content);
+ if(ret && TSIP_MESSAGE_IS_RESPONSE(sipfrag)) {
+ return sipfrag;
+ }
+ TSK_OBJECT_SAFE_FREE(sipfrag);
+ }
+ return sipfrag;
}
static short get_SipFragResponseCode(const tsip_request_t* notify)
{
- tsip_response_t *sipfrag = get_SipFragMessage(notify);
- short code = 0;
- if(sipfrag){
- code = TSIP_RESPONSE_CODE(sipfrag);
- TSK_OBJECT_SAFE_FREE(sipfrag);
- }
- return code;
+ tsip_response_t *sipfrag = get_SipFragMessage(notify);
+ short code = 0;
+ if(sipfrag) {
+ code = TSIP_RESPONSE_CODE(sipfrag);
+ TSK_OBJECT_SAFE_FREE(sipfrag);
+ }
+ return code;
} \ No newline at end of file
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.hold.c b/tinySIP/src/dialogs/tsip_dialog_invite.hold.c
index 7845bab..e0558fc 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.hold.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.hold.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,7 +22,7 @@
/**@file tsip_dialog_invite.hold.c
* @brief Communication Hold (3GPP TS 24.610)
- * The Communication Hold supplementary service enables a user to suspend the reception of media stream(s) of an established IP multimedia session,
+ * The Communication Hold supplementary service enables a user to suspend the reception of media stream(s) of an established IP multimedia session,
* and resume the media stream(s) at a later time.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
@@ -46,7 +46,7 @@ static int x0150_Any_2_Any_X_i422(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_resp2INVITEorUPDATE(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return (TSIP_RESPONSE_IS_TO_INVITE(message) || TSIP_RESPONSE_IS_TO_UPDATE(message));
+ return (TSIP_RESPONSE_IS_TO_INVITE(message) || TSIP_RESPONSE_IS_TO_UPDATE(message));
}
/* ======================== external functions ======================== */
@@ -56,31 +56,31 @@ extern int send_ACK(tsip_dialog_invite_t *self, const tsip_response_t* r2xxINVIT
int tsip_dialog_invite_hold_init(tsip_dialog_invite_t *self)
{
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Hold ===
- */
- // Connected -> (send HOLD) -> Holding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oHold, _fsm_state_Holding, x0100_Connected_2_Holding_X_oHold, "x0100_Connected_2_Holding_X_oHold"),
- // Holding -> (i2xx) -> Connected
- TSK_FSM_ADD(_fsm_state_Holding, _fsm_action_i2xx, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0101_Holding_2_Connected_X_ixxx, "x0101_Holding_2_Connected_X_ixxx"),
- // Holding -> (i300-699) -> Connected
- TSK_FSM_ADD(_fsm_state_Holding, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0101_Holding_2_Connected_X_ixxx, "x0101_Holding_2_Connected_X_ixxx"),
-
- /*=======================
- * === Resume ===
- */
- // Connected -> (send RESUME) -> Resuming
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oResume, _fsm_state_Resuming, x0102_Connected_2_Resuming_X_oResume, "x0102_Connected_2_Resuming_X_oResume"),
- // Resuming -> (i2xx) -> Connected
- TSK_FSM_ADD(_fsm_state_Resuming, _fsm_action_i2xx, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0103_Resuming_2_Connected_X_ixxx, "x0103_Resuming_2_Connected_X_ixxx"),
- // Resuming -> (i300-699) -> Connected
- TSK_FSM_ADD(_fsm_state_Resuming, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0103_Resuming_2_Connected_X_ixxx, "x0103_Resuming_2_Connected_X_ixxx"),
-
- TSK_FSM_ADD_NULL());
-
- return 0;
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Hold ===
+ */
+ // Connected -> (send HOLD) -> Holding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oHold, _fsm_state_Holding, x0100_Connected_2_Holding_X_oHold, "x0100_Connected_2_Holding_X_oHold"),
+ // Holding -> (i2xx) -> Connected
+ TSK_FSM_ADD(_fsm_state_Holding, _fsm_action_i2xx, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0101_Holding_2_Connected_X_ixxx, "x0101_Holding_2_Connected_X_ixxx"),
+ // Holding -> (i300-699) -> Connected
+ TSK_FSM_ADD(_fsm_state_Holding, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0101_Holding_2_Connected_X_ixxx, "x0101_Holding_2_Connected_X_ixxx"),
+
+ /*=======================
+ * === Resume ===
+ */
+ // Connected -> (send RESUME) -> Resuming
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oResume, _fsm_state_Resuming, x0102_Connected_2_Resuming_X_oResume, "x0102_Connected_2_Resuming_X_oResume"),
+ // Resuming -> (i2xx) -> Connected
+ TSK_FSM_ADD(_fsm_state_Resuming, _fsm_action_i2xx, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0103_Resuming_2_Connected_X_ixxx, "x0103_Resuming_2_Connected_X_ixxx"),
+ // Resuming -> (i300-699) -> Connected
+ TSK_FSM_ADD(_fsm_state_Resuming, _fsm_action_i300_to_i699, _fsm_cond_is_resp2INVITEorUPDATE, _fsm_state_Connected, x0103_Resuming_2_Connected_X_ixxx, "x0103_Resuming_2_Connected_X_ixxx"),
+
+ TSK_FSM_ADD_NULL());
+
+ return 0;
}
@@ -92,159 +92,159 @@ int tsip_dialog_invite_hold_init(tsip_dialog_invite_t *self)
// Connected -> (send HOLD) -> Holding
int x0100_Connected_2_Holding_X_oHold(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- if(!self->msession_mgr){
- TSK_DEBUG_WARN("Media Session manager is Null");
- return 0;
- }
+ if(!self->msession_mgr) {
+ TSK_DEBUG_WARN("Media Session manager is Null");
+ return 0;
+ }
- /* put on hold */
- ret = tmedia_session_mgr_hold(self->msession_mgr, action->media.type);
+ /* put on hold */
+ ret = tmedia_session_mgr_hold(self->msession_mgr, action->media.type);
- /* send the request */
- if((ret = send_INVITE(self, tsk_false))){
- // FIXME: signal error without breaking the state machine
- }
+ /* send the request */
+ if((ret = send_INVITE(self, tsk_false))) {
+ // FIXME: signal error without breaking the state machine
+ }
- return 0;
+ return 0;
}
// Holding -> (ixxx) -> Connected
int x0101_Holding_2_Connected_X_ixxx(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t* response = va_arg(*app, const tsip_response_t *);
-
- /* reset current action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
-
- /* Process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, response))){
- /* Send error */
- return ret;
- }
- else if(TSIP_RESPONSE_IS_TO_INVITE(response)){
- /* send ACK */
- ret = send_ACK(self, response);
- }
-
- /* alert the user */
- if(TSIP_RESPONSE_IS_2XX(response)){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_hold_ok,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- self->hold.local = tsk_true;
- }
- else{
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_hold_nok,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- self->hold.local = tsk_false;
- }
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t* response = va_arg(*app, const tsip_response_t *);
+
+ /* reset current action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+
+ /* Process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, response))) {
+ /* Send error */
+ return ret;
+ }
+ else if(TSIP_RESPONSE_IS_TO_INVITE(response)) {
+ /* send ACK */
+ ret = send_ACK(self, response);
+ }
+
+ /* alert the user */
+ if(TSIP_RESPONSE_IS_2XX(response)) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_hold_ok,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ self->hold.local = tsk_true;
+ }
+ else {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_hold_nok,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ self->hold.local = tsk_false;
+ }
+
+ return ret;
}
// Connected -> (send RESUME) -> Resuming
int x0102_Connected_2_Resuming_X_oResume(va_list *app)
{
- int ret;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
+ int ret;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- if(!self->msession_mgr){
- TSK_DEBUG_WARN("Media Session manager is Null");
- return 0;
- }
+ if(!self->msession_mgr) {
+ TSK_DEBUG_WARN("Media Session manager is Null");
+ return 0;
+ }
- /* Resume both */
- ret = tmedia_session_mgr_resume(self->msession_mgr, action->media.type, tsk_true);
- ret = tmedia_session_mgr_resume(self->msession_mgr, action->media.type, tsk_false);
+ /* Resume both */
+ ret = tmedia_session_mgr_resume(self->msession_mgr, action->media.type, tsk_true);
+ ret = tmedia_session_mgr_resume(self->msession_mgr, action->media.type, tsk_false);
- /* send the request */
- if((ret = send_INVITE(self, tsk_false))){
- // FIXME: signal error without breaking the state machine
- }
+ /* send the request */
+ if((ret = send_INVITE(self, tsk_false))) {
+ // FIXME: signal error without breaking the state machine
+ }
- return 0;
+ return 0;
}
// Resuming -> (ixxx) -> Connected
int x0103_Resuming_2_Connected_X_ixxx(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t* response = va_arg(*app, const tsip_response_t *);
-
- /* reset current action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
-
- /* Process remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, response))){
- /* Send error */
- return ret;
- }
- else if(TSIP_RESPONSE_IS_TO_INVITE(response)){
- /* send ACK */
- ret = send_ACK(self, response);
- }
-
- /* alert the user */
- if(TSIP_RESPONSE_IS_2XX(response)){
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_resume_ok,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- self->hold.local = tsk_false;
- }
- else{
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_resume_nok,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- self->hold.local = tsk_true;
- }
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t* response = va_arg(*app, const tsip_response_t *);
+
+ /* reset current action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+
+ /* Process remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, response))) {
+ /* Send error */
+ return ret;
+ }
+ else if(TSIP_RESPONSE_IS_TO_INVITE(response)) {
+ /* send ACK */
+ ret = send_ACK(self, response);
+ }
+
+ /* alert the user */
+ if(TSIP_RESPONSE_IS_2XX(response)) {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_resume_ok,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ self->hold.local = tsk_false;
+ }
+ else {
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_m_local_resume_nok,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ self->hold.local = tsk_true;
+ }
+
+ return ret;
}
/* handle requests/responses (MUST be called after set_ro()) */
int tsip_dialog_invite_hold_handle(tsip_dialog_invite_t* self, const tsip_request_t* rINVITEorUPDATE)
{
- tsk_bool_t remote_hold, bodiless_invite;
- int ret = 0;
-
- if(!self || !rINVITEorUPDATE || !self->msession_mgr){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- remote_hold = tmedia_session_mgr_is_held(self->msession_mgr, self->msession_mgr->type, tsk_false);
-
- // resume the call if we receive bodiless INVITE
- bodiless_invite = !TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE) && TSIP_REQUEST_IS_INVITE(rINVITEorUPDATE);
- if(bodiless_invite && remote_hold){
- // resume remote
- if((ret = tmedia_session_mgr_resume(self->msession_mgr, self->msession_mgr->type, tsk_false)) == 0){
- remote_hold = tsk_false;
- }
- }
-
- if(ret == 0 && (remote_hold != self->hold.remote)){
- self->hold.remote = remote_hold;
- TSIP_DIALOG_INVITE_SIGNAL(self, self->hold.remote ? tsip_m_remote_hold : tsip_m_remote_resume,
- tsip_event_code_dialog_request_incoming, "Hold/Resume state changed", rINVITEorUPDATE);
- }
-
- return ret;
+ tsk_bool_t remote_hold, bodiless_invite;
+ int ret = 0;
+
+ if(!self || !rINVITEorUPDATE || !self->msession_mgr) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ remote_hold = tmedia_session_mgr_is_held(self->msession_mgr, self->msession_mgr->type, tsk_false);
+
+ // resume the call if we receive bodiless INVITE
+ bodiless_invite = !TSIP_MESSAGE_HAS_CONTENT(rINVITEorUPDATE) && TSIP_REQUEST_IS_INVITE(rINVITEorUPDATE);
+ if(bodiless_invite && remote_hold) {
+ // resume remote
+ if((ret = tmedia_session_mgr_resume(self->msession_mgr, self->msession_mgr->type, tsk_false)) == 0) {
+ remote_hold = tsk_false;
+ }
+ }
+
+ if(ret == 0 && (remote_hold != self->hold.remote)) {
+ self->hold.remote = remote_hold;
+ TSIP_DIALOG_INVITE_SIGNAL(self, self->hold.remote ? tsip_m_remote_hold : tsip_m_remote_resume,
+ tsip_event_code_dialog_request_incoming, "Hold/Resume state changed", rINVITEorUPDATE);
+ }
+
+ return ret;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.ice.c b/tinySIP/src/dialogs/tsip_dialog_invite.ice.c
index 823e548..c68d8cd 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.ice.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.ice.c
@@ -48,7 +48,7 @@ tsip_dialog_invite_ice_set_silent_mode_ctx((_self), tsk_true); \
tsip_dialog_invite_ice_cancel_ctx((_self)); /* "cancelled" event will not be sent and we're sure that cancel operation will be done when the function exit */ \
tsip_dialog_invite_ice_set_sync_mode_ctx((_self), tsk_false); \
tsip_dialog_invite_ice_set_silent_mode_ctx((_self), tsk_false); \
-
+
/* ======================== transitions ======================== */
// Use "Current" instead of "Any" to avoid priority reordering
static int x0500_Current_2_Current_X_oINVITE(va_list *app);
@@ -57,46 +57,46 @@ static int x0500_Current_2_Current_X_iINVITE(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_get_local_candidates(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- if(self->supported.ice){
+ if(self->supported.ice) {
tsk_bool_t use_ice = tsk_false;
// "action->media.type" will be defined for locally initiated media update
tmedia_type_t new_media = TSIP_DIALOG(self)->curr_action ? TSIP_DIALOG(self)->curr_action->media.type : tmedia_none;
-
- if(message && TSIP_MESSAGE_HAS_CONTENT(message) && tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))){
+
+ if(message && TSIP_MESSAGE_HAS_CONTENT(message) && tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))) {
// If this code is called this means that we are the "answerer"
// only gets the candidates if ICE is enabled and the remote peer supports ICE
tsdp_message_t* sdp_ro;
const tsdp_header_M_t* M;
int index;
- if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))){
+ if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))) {
TSK_DEBUG_ERROR("Failed to parse remote sdp message");
return tsk_false;
}
-
+
index = 0;
- while((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp_ro, tsdp_htype_M, index++))){
- if(!tsdp_header_M_findA(M, "candidate")){
+ while((M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(sdp_ro, tsdp_htype_M, index++))) {
+ if(!tsdp_header_M_findA(M, "candidate")) {
use_ice = tsk_false; // do not use ICE if at least on media is ICE-less (e.g. MSRP)
break;
}
use_ice = tsk_true; // only use ICE if there is a least one media line
}
-
+
new_media = tmedia_type_from_sdp(sdp_ro);
-
+
TSK_OBJECT_SAFE_FREE(sdp_ro);
}
- else if(!message){
+ else if(!message) {
// we are the "offerer" -> use ICE only for audio or video medias (ignore ice for MSRP)
use_ice = (new_media & tmedia_audio) || (new_media & tmedia_video);
}
-
- if(use_ice){
- if(!self->ice.ctx_audio && !self->ice.ctx_video){ // First time
+
+ if(use_ice) {
+ if(!self->ice.ctx_audio && !self->ice.ctx_video) { // First time
return tsk_true;
}
- else{
- if(self->ice.media_type != new_media){
+ else {
+ if(self->ice.media_type != new_media) {
return tsk_true;
}
return !tsip_dialog_invite_ice_got_local_candidates(self);
@@ -113,17 +113,17 @@ int tsip_dialog_invite_ice_init(tsip_dialog_invite_t *self)
TSK_FSM_ADD(tsk_fsm_state_current, _fsm_action_oINVITE, _fsm_cond_get_local_candidates, tsk_fsm_state_current, x0500_Current_2_Current_X_oINVITE, "x0500_Current_2_Current_X_oINVITE"),
// Current -> (iINVITE) -> Current
TSK_FSM_ADD(tsk_fsm_state_current, _fsm_action_iINVITE, _fsm_cond_get_local_candidates, tsk_fsm_state_current, x0500_Current_2_Current_X_iINVITE, "x0500_Current_2_Current_X_iINVITE")
- );
-
+ );
+
return 0;
}
int tsip_dialog_invite_ice_timers_set(tsip_dialog_invite_t *self, int64_t timeout)
{
- if(/*tnet_ice_ctx_is_active*/(self->ice.ctx_audio)){
+ if(/*tnet_ice_ctx_is_active*/(self->ice.ctx_audio)) {
tnet_ice_ctx_set_concheck_timeout(self->ice.ctx_audio, timeout);
}
- if(/*tnet_ice_ctx_is_active*/(self->ice.ctx_video)){
+ if(/*tnet_ice_ctx_is_active*/(self->ice.ctx_video)) {
tnet_ice_ctx_set_concheck_timeout(self->ice.ctx_video, timeout);
}
return 0;
@@ -133,14 +133,14 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
{
int32_t transport_idx;
int ret = 0;
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
transport_idx = TSIP_DIALOG_GET_STACK(self)->network.transport_idx_default;
if (!self->ice.ctx_audio && (media_type & tmedia_audio)) {
self->ice.ctx_audio = tnet_ice_ctx_create(self->ice.is_jingle, TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]),
- self->use_rtcp, tsk_false, tsip_dialog_invite_ice_audio_callback, self);
+ self->use_rtcp, tsk_false, tsip_dialog_invite_ice_audio_callback, self);
if (!self->ice.ctx_audio) {
TSK_DEBUG_ERROR("Failed to create ICE audio context");
return -2;
@@ -149,14 +149,14 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
ret = tnet_ice_ctx_set_stun(self->ice.ctx_audio, TSIP_DIALOG_GET_SS(self)->media.stun.hostname, TSIP_DIALOG_GET_SS(self)->media.stun.port, kStunSoftware, TSIP_DIALOG_GET_SS(self)->media.stun.username, TSIP_DIALOG_GET_SS(self)->media.stun.password);
#else
ret = tnet_ice_ctx_add_server(
- self->ice.ctx_audio,
- "udp", // "tcp", "tls", "ws", "wss"...
- TSIP_DIALOG_GET_SS(self)->media.stun.hostname,
- TSIP_DIALOG_GET_SS(self)->media.stun.port,
- TSIP_DIALOG_GET_SS(self)->media.enable_iceturn,
- TSIP_DIALOG_GET_SS(self)->media.enable_icestun,
- TSIP_DIALOG_GET_SS(self)->media.stun.username,
- TSIP_DIALOG_GET_SS(self)->media.stun.password);
+ self->ice.ctx_audio,
+ "udp", // "tcp", "tls", "ws", "wss"...
+ TSIP_DIALOG_GET_SS(self)->media.stun.hostname,
+ TSIP_DIALOG_GET_SS(self)->media.stun.port,
+ TSIP_DIALOG_GET_SS(self)->media.enable_iceturn,
+ TSIP_DIALOG_GET_SS(self)->media.enable_icestun,
+ TSIP_DIALOG_GET_SS(self)->media.stun.username,
+ TSIP_DIALOG_GET_SS(self)->media.stun.password);
#endif
ret = tnet_ice_ctx_set_turn_enabled(self->ice.ctx_audio, TSIP_DIALOG_GET_SS(self)->media.enable_iceturn);
ret = tnet_ice_ctx_set_stun_enabled(self->ice.ctx_audio, TSIP_DIALOG_GET_SS(self)->media.enable_icestun);
@@ -164,7 +164,7 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
}
if (!self->ice.ctx_video && (media_type & tmedia_video)) {
self->ice.ctx_video = tnet_ice_ctx_create(self->ice.is_jingle, TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type[transport_idx]),
- self->use_rtcp, tsk_true, tsip_dialog_invite_ice_video_callback, self);
+ self->use_rtcp, tsk_true, tsip_dialog_invite_ice_video_callback, self);
if (!self->ice.ctx_video) {
TSK_DEBUG_ERROR("Failed to create ICE video context");
return -2;
@@ -173,50 +173,50 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
ret = tnet_ice_ctx_set_stun(self->ice.ctx_video, TSIP_DIALOG_GET_SS(self)->media.stun.hostname, TSIP_DIALOG_GET_SS(self)->media.stun.port, kStunSoftware, TSIP_DIALOG_GET_SS(self)->media.stun.username, TSIP_DIALOG_GET_SS(self)->media.stun.password);
#else
ret = tnet_ice_ctx_add_server(
- self->ice.ctx_video,
- "udp", // "tcp", "tls", "ws", "wss"...
- TSIP_DIALOG_GET_SS(self)->media.stun.hostname,
- TSIP_DIALOG_GET_SS(self)->media.stun.port,
- TSIP_DIALOG_GET_SS(self)->media.enable_iceturn,
- TSIP_DIALOG_GET_SS(self)->media.enable_icestun,
- TSIP_DIALOG_GET_SS(self)->media.stun.username,
- TSIP_DIALOG_GET_SS(self)->media.stun.password);
+ self->ice.ctx_video,
+ "udp", // "tcp", "tls", "ws", "wss"...
+ TSIP_DIALOG_GET_SS(self)->media.stun.hostname,
+ TSIP_DIALOG_GET_SS(self)->media.stun.port,
+ TSIP_DIALOG_GET_SS(self)->media.enable_iceturn,
+ TSIP_DIALOG_GET_SS(self)->media.enable_icestun,
+ TSIP_DIALOG_GET_SS(self)->media.stun.username,
+ TSIP_DIALOG_GET_SS(self)->media.stun.password);
#endif
ret = tnet_ice_ctx_set_turn_enabled(self->ice.ctx_video, TSIP_DIALOG_GET_SS(self)->media.enable_iceturn);
ret = tnet_ice_ctx_set_stun_enabled(self->ice.ctx_video, TSIP_DIALOG_GET_SS(self)->media.enable_icestun);
ret = tnet_ice_ctx_set_rtcpmux(self->ice.ctx_video, self->use_rtcpmux);
}
-
+
// set media type
ret = tsip_dialog_invite_ice_set_media_type(self, media_type);
-
+
// update session manager with the right ICE contexts
if (self->msession_mgr) {
ret = tmedia_session_mgr_set_ice_ctx(self->msession_mgr, self->ice.ctx_audio, self->ice.ctx_video);
}
-
+
return ret;
}
int tsip_dialog_invite_ice_set_media_type(tsip_dialog_invite_t * self, tmedia_type_t _media_type)
{
- if(self){
+ if(self) {
tmedia_type_t av_media_type = (_media_type & tmedia_audiovideo); // filter to keep audio and video only
// "none" comparison is used to exclude the "first call"
- if(self->ice.media_type != tmedia_none && self->ice.media_type != av_media_type){
+ if(self->ice.media_type != tmedia_none && self->ice.media_type != av_media_type) {
// cancels contexts associated to old medias
- if(self->ice.ctx_audio && !(av_media_type & tmedia_audio)){
+ if(self->ice.ctx_audio && !(av_media_type & tmedia_audio)) {
tnet_ice_ctx_cancel(self->ice.ctx_audio);
}
- if(self->ice.ctx_video && !(av_media_type & tmedia_video)){
+ if(self->ice.ctx_video && !(av_media_type & tmedia_video)) {
tnet_ice_ctx_cancel(self->ice.ctx_video);
}
// cancels contexts associated to new medias (e.g. session "remove" then "add")
// cancel() on newly created contexts don't have any effect
- if(self->ice.ctx_audio && (!(av_media_type & tmedia_audio) && (self->ice.media_type & tmedia_audio))){
+ if(self->ice.ctx_audio && (!(av_media_type & tmedia_audio) && (self->ice.media_type & tmedia_audio))) {
//tnet_ice_ctx_cancel(self->ice.ctx_audio);
}
- if(self->ice.ctx_video && (!(av_media_type & tmedia_video) && (self->ice.media_type & tmedia_video))){
+ if(self->ice.ctx_video && (!(av_media_type & tmedia_video) && (self->ice.media_type & tmedia_video))) {
//tnet_ice_ctx_cancel(self->ice.ctx_video);
}
}
@@ -228,14 +228,14 @@ int tsip_dialog_invite_ice_set_media_type(tsip_dialog_invite_t * self, tmedia_ty
static int tsip_dialog_invite_ice_start_ctx(tsip_dialog_invite_t * self)
{
int ret = 0;
- if(self){
- if((self->ice.media_type & tmedia_audio)){
- if(self->ice.ctx_audio && (ret = tnet_ice_ctx_start(self->ice.ctx_audio)) != 0){
+ if(self) {
+ if((self->ice.media_type & tmedia_audio)) {
+ if(self->ice.ctx_audio && (ret = tnet_ice_ctx_start(self->ice.ctx_audio)) != 0) {
return ret;
}
}
- if((self->ice.media_type & tmedia_video)){
- if(self->ice.ctx_video && (ret = tnet_ice_ctx_start(self->ice.ctx_video)) != 0){
+ if((self->ice.media_type & tmedia_video)) {
+ if(self->ice.ctx_video && (ret = tnet_ice_ctx_start(self->ice.ctx_video)) != 0) {
return ret;
}
}
@@ -246,14 +246,14 @@ static int tsip_dialog_invite_ice_start_ctx(tsip_dialog_invite_t * self)
static int tsip_dialog_invite_ice_cancel_ctx(tsip_dialog_invite_t * self)
{
int ret = 0;
- if(self){
- if((self->ice.media_type & tmedia_audio)){
- if(self->ice.ctx_audio && (ret = tnet_ice_ctx_cancel(self->ice.ctx_audio)) != 0){
+ if(self) {
+ if((self->ice.media_type & tmedia_audio)) {
+ if(self->ice.ctx_audio && (ret = tnet_ice_ctx_cancel(self->ice.ctx_audio)) != 0) {
return ret;
}
}
- if((self->ice.media_type & tmedia_video)){
- if(self->ice.ctx_video && (ret = tnet_ice_ctx_cancel(self->ice.ctx_video)) != 0){
+ if((self->ice.media_type & tmedia_video)) {
+ if(self->ice.ctx_video && (ret = tnet_ice_ctx_cancel(self->ice.ctx_video)) != 0) {
return ret;
}
}
@@ -264,14 +264,14 @@ static int tsip_dialog_invite_ice_cancel_ctx(tsip_dialog_invite_t * self)
static int tsip_dialog_invite_ice_set_sync_mode_ctx(tsip_dialog_invite_t * self, tsk_bool_t sync_mode)
{
int ret = 0;
- if(self){
- if((self->ice.media_type & tmedia_audio)){
- if(self->ice.ctx_audio && (ret = tnet_ice_ctx_set_sync_mode(self->ice.ctx_audio, sync_mode)) != 0){
+ if(self) {
+ if((self->ice.media_type & tmedia_audio)) {
+ if(self->ice.ctx_audio && (ret = tnet_ice_ctx_set_sync_mode(self->ice.ctx_audio, sync_mode)) != 0) {
return ret;
}
}
- if((self->ice.media_type & tmedia_video)){
- if(self->ice.ctx_video && (ret = tnet_ice_ctx_set_sync_mode(self->ice.ctx_video, sync_mode)) != 0){
+ if((self->ice.media_type & tmedia_video)) {
+ if(self->ice.ctx_video && (ret = tnet_ice_ctx_set_sync_mode(self->ice.ctx_video, sync_mode)) != 0) {
return ret;
}
}
@@ -282,14 +282,14 @@ static int tsip_dialog_invite_ice_set_sync_mode_ctx(tsip_dialog_invite_t * self,
static int tsip_dialog_invite_ice_set_silent_mode_ctx(tsip_dialog_invite_t * self, tsk_bool_t silent_mode)
{
int ret = 0;
- if(self){
- if((self->ice.media_type & tmedia_audio)){
- if(self->ice.ctx_audio && (ret = tnet_ice_ctx_set_silent_mode(self->ice.ctx_audio, silent_mode)) != 0){
+ if(self) {
+ if((self->ice.media_type & tmedia_audio)) {
+ if(self->ice.ctx_audio && (ret = tnet_ice_ctx_set_silent_mode(self->ice.ctx_audio, silent_mode)) != 0) {
return ret;
}
}
- if((self->ice.media_type & tmedia_video)){
- if(self->ice.ctx_video && (ret = tnet_ice_ctx_set_silent_mode(self->ice.ctx_video, silent_mode)) != 0){
+ if((self->ice.media_type & tmedia_video)) {
+ if(self->ice.ctx_video && (ret = tnet_ice_ctx_set_silent_mode(self->ice.ctx_video, silent_mode)) != 0) {
return ret;
}
}
@@ -299,7 +299,7 @@ static int tsip_dialog_invite_ice_set_silent_mode_ctx(tsip_dialog_invite_t * sel
tsk_bool_t tsip_dialog_invite_ice_is_enabled(const tsip_dialog_invite_t * self)
{
- if(self){
+ if(self) {
return (self->supported.ice && (tnet_ice_ctx_is_active(self->ice.ctx_audio) || tnet_ice_ctx_is_active(self->ice.ctx_video)));
}
return tsk_false;
@@ -307,37 +307,37 @@ tsk_bool_t tsip_dialog_invite_ice_is_enabled(const tsip_dialog_invite_t * self)
tsk_bool_t tsip_dialog_invite_ice_is_connected(const tsip_dialog_invite_t * self)
{
- if(self){
+ if(self) {
return (!tnet_ice_ctx_is_active(self->ice.ctx_audio) || tnet_ice_ctx_is_connected(self->ice.ctx_audio))
- && (!tnet_ice_ctx_is_active(self->ice.ctx_video) || tnet_ice_ctx_is_connected(self->ice.ctx_video));
+ && (!tnet_ice_ctx_is_active(self->ice.ctx_video) || tnet_ice_ctx_is_connected(self->ice.ctx_video));
}
return tsk_false;
}
tsk_bool_t tsip_dialog_invite_ice_got_local_candidates(const tsip_dialog_invite_t * self)
{
- if(self){
+ if(self) {
return (!tnet_ice_ctx_is_active(self->ice.ctx_audio) || tnet_ice_ctx_got_local_candidates(self->ice.ctx_audio))
- && (!tnet_ice_ctx_is_active(self->ice.ctx_video) || tnet_ice_ctx_got_local_candidates(self->ice.ctx_video));
+ && (!tnet_ice_ctx_is_active(self->ice.ctx_video) || tnet_ice_ctx_got_local_candidates(self->ice.ctx_video));
}
return tsk_false;
}
int tsip_dialog_invite_ice_save_action(tsip_dialog_invite_t * self, tsk_fsm_action_id action_id, const tsip_action_t* action, const tsip_message_t* message)
{
- if(!self){
+ if(!self) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// There are good reasons to ref() the action and message before safe_free()
// /!\ do not change
-
+
self->ice.last_action_id = action_id;
action = tsk_object_ref((tsk_object_t*)action);
TSK_OBJECT_SAFE_FREE(self->ice.last_action);
self->ice.last_action = (tsip_action_t*)action;
-
+
message = tsk_object_ref((tsk_object_t*)message);
TSK_OBJECT_SAFE_FREE(self->ice.last_message);
self->ice.last_message = (tsip_message_t*)message;
@@ -349,30 +349,30 @@ int tsip_dialog_invite_ice_process_lo(tsip_dialog_invite_t * self, const tsdp_me
const tsdp_header_M_t* M;
const tsdp_header_A_t *A;
int ret = 0, i;
-
- if(!self || !sdp_lo){
+
+ if(!self || !sdp_lo) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
+
// cancels all ICE contexts without candidates
// this happens if codecs negotiations mismatch for one media out of two or three
- for(i = 0; i < 2; ++i){
+ for(i = 0; i < 2; ++i) {
struct tnet_ice_ctx_s *ctx = i == 0 ? self->ice.ctx_audio : self->ice.ctx_video;
const char* media = i == 0 ? "audio" : "video";
- if(tnet_ice_ctx_is_active(ctx)){
+ if(tnet_ice_ctx_is_active(ctx)) {
tsk_bool_t cancel = tsk_true;
- if((M = tsdp_message_find_media(sdp_lo, media))){
- if((A = tsdp_header_M_findA(M, "candidate"))){
+ if((M = tsdp_message_find_media(sdp_lo, media))) {
+ if((A = tsdp_header_M_findA(M, "candidate"))) {
cancel = tsk_false;
}
}
- if(cancel){
+ if(cancel) {
ret = tnet_ice_ctx_cancel(ctx);
}
}
}
-
+
return ret;
}
@@ -387,57 +387,57 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
const char* sess_pwd = tsk_null;
int ret = 0, i;
struct tnet_ice_ctx_s *ctx;
-
- if(!self || !sdp_ro){
+
+ if(!self || !sdp_ro) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
- if(!self->ice.ctx_audio && !self->ice.ctx_video){
+ if(!self->ice.ctx_audio && !self->ice.ctx_video) {
return 0;
}
-
+
// make sure this is different SDP
- if((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp_ro, tsdp_htype_O))){
- if(self->ice.last_sdp_ro_ver == (int32_t)O->sess_version){
+ if((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp_ro, tsdp_htype_O))) {
+ if(self->ice.last_sdp_ro_ver == (int32_t)O->sess_version) {
TSK_DEBUG_INFO("ICE: ignore processing SDP RO because version haven't changed");
return 0;
}
self->ice.last_sdp_ro_ver = (int32_t)O->sess_version;
}
-
+
// session level attributes
-
- if((A = tsdp_message_get_headerA(sdp_ro, "ice-ufrag"))){
+
+ if((A = tsdp_message_get_headerA(sdp_ro, "ice-ufrag"))) {
sess_ufrag = A->value;
}
- if((A = tsdp_message_get_headerA(sdp_ro, "ice-pwd"))){
+ if((A = tsdp_message_get_headerA(sdp_ro, "ice-pwd"))) {
sess_pwd = A->value;
}
-
+
#if 0 // Use RTCWeb Profile (tmedia_profile_rtcweb)
{
const tsdp_header_S_t *S;
- if((S = (const tsdp_header_S_t *)tsdp_message_get_header(sdp_ro, tsdp_htype_S)) && S->value){
+ if((S = (const tsdp_header_S_t *)tsdp_message_get_header(sdp_ro, tsdp_htype_S)) && S->value) {
self->ice.is_jingle = tsk_strcontains(S->value, tsk_strlen(S->value), "webrtc");
}
}
#endif
-
- for(i = 0; i < 2; ++i){
- if((M = tsdp_message_find_media(sdp_ro, i==0 ? "audio": "video"))){
+
+ for(i = 0; i < 2; ++i) {
+ if((M = tsdp_message_find_media(sdp_ro, i==0 ? "audio": "video"))) {
const char *ufrag = sess_ufrag, *pwd = sess_pwd;
tsk_bool_t remote_use_rtcpmux = (tsdp_header_M_findA(M, "rtcp-mux") != tsk_null);
ctx = (i==0 ? self->ice.ctx_audio : self->ice.ctx_video);
ice_remote_candidates = tsk_null;
index = 0;
- if((A = tsdp_header_M_findA(M, "ice-ufrag"))){
+ if((A = tsdp_header_M_findA(M, "ice-ufrag"))) {
ufrag = A->value;
}
- if((A = tsdp_header_M_findA(M, "ice-pwd"))){
+ if((A = tsdp_header_M_findA(M, "ice-pwd"))) {
pwd = A->value;
}
-
- while((A = tsdp_header_M_findA_at(M, "candidate", index++))){
+
+ while((A = tsdp_header_M_findA_at(M, "candidate", index++))) {
tsk_strcat_2(&ice_remote_candidates, "%s\r\n", A->value);
}
// ICE processing will be automatically stopped if the remote candidates are not valid
@@ -446,7 +446,7 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
TSK_SAFE_FREE(ice_remote_candidates);
}
}
-
+
return ret;
}
@@ -465,35 +465,35 @@ static int x0500_Current_2_Current_X_oINVITE(va_list *app)
const tsip_message_t *message;
tmedia_type_t media_type;
static const tsk_bool_t __force_restart_is_yes = tsk_true;
-
+
self = va_arg(*app, tsip_dialog_invite_t *);
message = va_arg(*app, const tsip_message_t *);
action = va_arg(*app, const tsip_action_t *);
-
+
media_type = (action && action->media.type != tmedia_none) ? action->media.type : TSIP_DIALOG_GET_SS(self)->media.type;
self->is_client = tsk_true;
tsip_dialog_invite_ice_save_action(self, _fsm_action_oINVITE, action, message);
-
+
// Cancel without notifying ("silent mode") and perform the operation right now ("sync mode")
tsip_dialog_invite_ice_cancel_silent_and_sync_ctx(self);
-
+
// create ICE context
- if((ret = tsip_dialog_invite_ice_create_ctx(self, media_type))){
+ if((ret = tsip_dialog_invite_ice_create_ctx(self, media_type))) {
TSK_DEBUG_ERROR("tsip_dialog_invite_ice_create_ctx() failed");
return ret;
}
-
+
// For now disable ICE timers until we receive the 2xx
ret = tsip_dialog_invite_ice_timers_set(self, -1);
-
+
// Start ICE
ret = tsip_dialog_invite_ice_start_ctx(self);
-
+
// alert the user only if we are in initial state which means that it's not media update
- if(TSIP_DIALOG(self)->state == tsip_initial){
+ if(TSIP_DIALOG(self)->state == tsip_initial) {
TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
}
-
+
return ret;
}
@@ -504,45 +504,45 @@ static int x0500_Current_2_Current_X_iINVITE(va_list *app)
tsip_dialog_invite_t *self;
const tsip_action_t* action;
const tsip_message_t *message;
-
+
self = va_arg(*app, tsip_dialog_invite_t *);
message = va_arg(*app, const tsip_message_t *);
action = va_arg(*app, const tsip_action_t *);
-
+
self->is_client = tsk_false;
ret = tsip_dialog_invite_ice_save_action(self, _fsm_action_iINVITE, action, message);
-
+
// Cancel without notifying ("silent mode") and perform the operation right now ("sync mode")
tsip_dialog_invite_ice_cancel_silent_and_sync_ctx(self);
-
+
// set remote candidates
- if(TSIP_MESSAGE_HAS_CONTENT(message)){
- if(tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))){
+ if(TSIP_MESSAGE_HAS_CONTENT(message)) {
+ if(tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))) {
tsdp_message_t* sdp_ro;
- if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))){
+ if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))) {
TSK_DEBUG_ERROR("Failed to parse remote sdp message");
return -2;
}
// create ICE context
- if((ret = tsip_dialog_invite_ice_create_ctx(self, tmedia_type_from_sdp(sdp_ro)))){
+ if((ret = tsip_dialog_invite_ice_create_ctx(self, tmedia_type_from_sdp(sdp_ro)))) {
TSK_DEBUG_ERROR("tsip_dialog_invite_ice_create_ctx() failed");
return ret;
}
ret = tsip_dialog_invite_ice_process_ro(self, sdp_ro, tsk_true);
TSK_OBJECT_SAFE_FREE(sdp_ro);
}
- else{
+ else {
TSK_DEBUG_ERROR("[%s] content-type is not supportted", TSIP_MESSAGE_CONTENT_TYPE(message));
return -3;
}
}
-
+
// For now disable ICE timers until we send the 2xx and receive the ACK
ret = tsip_dialog_invite_ice_timers_set(self, -1);
-
+
// Start ICE
ret = tsip_dialog_invite_ice_start_ctx(self);
-
+
return ret;
}
@@ -557,52 +557,50 @@ static int tsip_dialog_invite_ice_callback(const tnet_ice_event_t *e)
{
int ret = 0;
tsip_dialog_invite_t *dialog;
-
+
TSK_DEBUG_INFO("ICE callback: %s", e->phrase);
-
+
dialog = tsk_object_ref(TSK_OBJECT(e->userdata));
-
+
// Do not lock: caller is thread safe
-
- switch(e->type){
- case tnet_ice_event_type_gathering_completed:
- case tnet_ice_event_type_conncheck_succeed:
- case tnet_ice_event_type_conncheck_failed:
- case tnet_ice_event_type_cancelled:
- {
- if(dialog->ice.last_action_id != tsk_fsm_state_none){
- if(tsip_dialog_invite_ice_got_local_candidates(dialog)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(dialog), dialog->ice.last_action_id, dialog->ice.last_message, dialog->ice.last_action);
- dialog->ice.last_action_id = tsk_fsm_state_none;
- }
- }
- if(dialog->ice.start_smgr){
- ret = tsip_dialog_invite_msession_start(dialog);
- }
- break;
- }
- // fatal errors which discard ICE process
- case tnet_ice_event_type_gathering_host_candidates_failed:
- case tnet_ice_event_type_gathering_reflexive_candidates_failed:
- case tnet_ice_event_type_gathering_relay_candidates_failed:
- {
- if (dialog->ice.last_action_id != tsk_fsm_state_none) {
+
+ switch(e->type) {
+ case tnet_ice_event_type_gathering_completed:
+ case tnet_ice_event_type_conncheck_succeed:
+ case tnet_ice_event_type_conncheck_failed:
+ case tnet_ice_event_type_cancelled: {
+ if(dialog->ice.last_action_id != tsk_fsm_state_none) {
+ if(tsip_dialog_invite_ice_got_local_candidates(dialog)) {
ret = tsip_dialog_fsm_act(TSIP_DIALOG(dialog), dialog->ice.last_action_id, dialog->ice.last_message, dialog->ice.last_action);
dialog->ice.last_action_id = tsk_fsm_state_none;
}
- break;
}
- // TURN session disconnected while we're in call
- case tnet_ice_event_type_turn_connection_broken:
- {
- ret = tsip_dialog_fsm_act_2(TSIP_DIALOG(dialog), _fsm_action_oBYE);
- break;
+ if(dialog->ice.start_smgr) {
+ ret = tsip_dialog_invite_msession_start(dialog);
}
- default: break;
+ break;
}
-
+ // fatal errors which discard ICE process
+ case tnet_ice_event_type_gathering_host_candidates_failed:
+ case tnet_ice_event_type_gathering_reflexive_candidates_failed:
+ case tnet_ice_event_type_gathering_relay_candidates_failed: {
+ if (dialog->ice.last_action_id != tsk_fsm_state_none) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(dialog), dialog->ice.last_action_id, dialog->ice.last_message, dialog->ice.last_action);
+ dialog->ice.last_action_id = tsk_fsm_state_none;
+ }
+ break;
+ }
+ // TURN session disconnected while we're in call
+ case tnet_ice_event_type_turn_connection_broken: {
+ ret = tsip_dialog_fsm_act_2(TSIP_DIALOG(dialog), _fsm_action_oBYE);
+ break;
+ }
+ default:
+ break;
+ }
+
TSK_OBJECT_SAFE_FREE(dialog);
-
+
return ret;
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.qos.c b/tinySIP/src/dialogs/tsip_dialog_invite.qos.c
index 8cc7a2a..4edf0f3 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.qos.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.qos.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,15 +46,15 @@ static int x0300_Any_2_Any_X_timerRSVP(va_list *app);
/* Init FSM */
int tsip_dialog_invite_qos_init(tsip_dialog_invite_t *self)
{
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ // Any -> (timerRSVP) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_timerRSVP, tsk_fsm_state_any, x0300_Any_2_Any_X_timerRSVP, "x0300_Any_2_Any_X_timerRSVP"),
- // Any -> (timerRSVP) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_timerRSVP, tsk_fsm_state_any, x0300_Any_2_Any_X_timerRSVP, "x0300_Any_2_Any_X_timerRSVP"),
-
- TSK_FSM_ADD_NULL());
+ TSK_FSM_ADD_NULL());
- return 0;
+ return 0;
}
//--------------------------------------------------------
@@ -64,8 +64,8 @@ int tsip_dialog_invite_qos_init(tsip_dialog_invite_t *self)
// Any -> (tiner RSVP) -> Any
int x0300_Any_2_Any_X_timerRSVP(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- return send_UPDATE(self, tsk_true);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ return send_UPDATE(self, tsk_true);
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -78,15 +78,15 @@ int x0300_Any_2_Any_X_timerRSVP(va_list *app)
/* cancel the timer */
int tsip_dialog_invite_qos_timer_cancel(tsip_dialog_invite_t* self)
{
- return tsk_timer_mgr_global_cancel(self->qos.timer.id);
+ return tsk_timer_mgr_global_cancel(self->qos.timer.id);
}
/* schedule the timer */
int tsip_dialog_invite_qos_timer_schedule(tsip_dialog_invite_t* self)
{
- /* To emulate bandwidth reservation (Because RSVP protocol is not supported) */
- self->qos.timer.id = tsk_timer_mgr_global_schedule(TSIP_DIALOG_INVITE_QOS_RES_TIMEOUT, TSK_TIMER_CALLBACK_F(tsip_dialog_invite_timer_callback), self);
+ /* To emulate bandwidth reservation (Because RSVP protocol is not supported) */
+ self->qos.timer.id = tsk_timer_mgr_global_schedule(TSIP_DIALOG_INVITE_QOS_RES_TIMEOUT, TSK_TIMER_CALLBACK_F(tsip_dialog_invite_timer_callback), self);
- return 0;
+ return 0;
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.server.c b/tinySIP/src/dialogs/tsip_dialog_invite.server.c
index 2a7a37c..9082ca2 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.server.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.server.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -78,145 +78,145 @@ static int s0000_Any_2_Any_X_timer100rel(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_bad_extension(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- const tsip_header_Require_t* requireHdr;
- const tsk_list_item_t* item;
- tsk_size_t i, j;
-
- /* Check if we support all extensions */
- for(i = 0; (requireHdr = (const tsip_header_Require_t*)tsip_message_get_headerAt(message, tsip_htype_Require, i)); i++){
- tsk_bool_t bad_extension = tsk_false;
- const tsk_string_t* option = tsk_null;
- tsk_list_foreach(item, requireHdr->options){
- option = item->data;
- bad_extension = tsk_true;
- for(j = 0; option && j<sizeof(supported_options)/sizeof(const char*); j++){
- if(tsk_striequals(option->value, supported_options[j])){
- bad_extension = tsk_false;
- break;
- }
- }
- if(bad_extension){
- break;
- }
- }
- if(bad_extension && option){
- send_UNSUPPORTED(self, message, option->value);
- return tsk_true;
- }
- }
-
-
- return tsk_false;
+ const tsip_header_Require_t* requireHdr;
+ const tsk_list_item_t* item;
+ tsk_size_t i, j;
+
+ /* Check if we support all extensions */
+ for(i = 0; (requireHdr = (const tsip_header_Require_t*)tsip_message_get_headerAt(message, tsip_htype_Require, i)); i++) {
+ tsk_bool_t bad_extension = tsk_false;
+ const tsk_string_t* option = tsk_null;
+ tsk_list_foreach(item, requireHdr->options) {
+ option = item->data;
+ bad_extension = tsk_true;
+ for(j = 0; option && j<sizeof(supported_options)/sizeof(const char*); j++) {
+ if(tsk_striequals(option->value, supported_options[j])) {
+ bad_extension = tsk_false;
+ break;
+ }
+ }
+ if(bad_extension) {
+ break;
+ }
+ }
+ if(bad_extension && option) {
+ send_UNSUPPORTED(self, message, option->value);
+ return tsk_true;
+ }
+ }
+
+
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_bad_content(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- int ret;
- const tsdp_message_t* sdp_lo;
- tsk_bool_t bodiless_INVITE = (TSIP_DIALOG(self)->state == tsip_initial && !TSIP_MESSAGE_HAS_CONTENT(message)); // Initial Bodiless INVITE
-
- /* Check remote offer */
- if((ret = tsip_dialog_invite_process_ro(self, message))){
- ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return tsk_true;
- }
- /* generate local offer and check it's validity */
- if(self->msession_mgr && (sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr))){
- /* check that we have at least one valid session (Only if no bodiless initial INVITE) */
- if(!bodiless_INVITE && !tmedia_session_mgr_has_active_session(self->msession_mgr)){
- ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"No common codecs\"");
- return tsk_true;
- }
- // media type could change if there are zombies (medias with port equal to zero)
- TSIP_DIALOG_GET_SS(self)->media.type = self->msession_mgr->type;
- }
- else{
- ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return tsk_true;
- }
-
- return tsk_false;
+ int ret;
+ const tsdp_message_t* sdp_lo;
+ tsk_bool_t bodiless_INVITE = (TSIP_DIALOG(self)->state == tsip_initial && !TSIP_MESSAGE_HAS_CONTENT(message)); // Initial Bodiless INVITE
+
+ /* Check remote offer */
+ if((ret = tsip_dialog_invite_process_ro(self, message))) {
+ ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return tsk_true;
+ }
+ /* generate local offer and check it's validity */
+ if(self->msession_mgr && (sdp_lo = tmedia_session_mgr_get_lo(self->msession_mgr))) {
+ /* check that we have at least one valid session (Only if no bodiless initial INVITE) */
+ if(!bodiless_INVITE && !tmedia_session_mgr_has_active_session(self->msession_mgr)) {
+ ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"No common codecs\"");
+ return tsk_true;
+ }
+ // media type could change if there are zombies (medias with port equal to zero)
+ TSIP_DIALOG_GET_SS(self)->media.type = self->msession_mgr->type;
+ }
+ else {
+ ret = send_ERROR(self, message, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return tsk_true;
+ }
+
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_toosmall(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout && (tsip_message_supported(message, "timer") || tsip_message_required(message, "timer"))){
- const tsip_header_Session_Expires_t* Session_Expires;
- if((Session_Expires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))){
- if(Session_Expires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE){
- self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
- send_RESPONSE(self, message, 422, "Session Interval Too Small", tsk_false);
- return tsk_true;
- }
- else{
- const tsip_header_Min_SE_t* Min_SE;
- self->stimers.timer.timeout = Session_Expires->delta_seconds;
- tsk_strupdate(&self->stimers.refresher, Session_Expires->refresher_uas ? "uas" : "uac");
- self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
- if((Min_SE = (const tsip_header_Min_SE_t*)tsip_message_get_header(message, tsip_htype_Min_SE))){
- self->stimers.minse = Min_SE->delta_seconds;
- }
- }
- }
- }
- return tsk_false;
+ if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout && (tsip_message_supported(message, "timer") || tsip_message_required(message, "timer"))) {
+ const tsip_header_Session_Expires_t* Session_Expires;
+ if((Session_Expires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))) {
+ if(Session_Expires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE) {
+ self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
+ send_RESPONSE(self, message, 422, "Session Interval Too Small", tsk_false);
+ return tsk_true;
+ }
+ else {
+ const tsip_header_Min_SE_t* Min_SE;
+ self->stimers.timer.timeout = Session_Expires->delta_seconds;
+ tsk_strupdate(&self->stimers.refresher, Session_Expires->refresher_uas ? "uas" : "uac");
+ self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
+ if((Min_SE = (const tsip_header_Min_SE_t*)tsip_message_get_header(message, tsip_htype_Min_SE))) {
+ self->stimers.minse = Min_SE->delta_seconds;
+ }
+ }
+ }
+ }
+ return tsk_false;
}
// 100rel && (QoS or ICE)
static tsk_bool_t _fsm_cond_use_early_media(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- if((tsip_message_supported(message, "100rel") && self->supported._100rel) || tsip_message_required(message, "100rel")){
- if((tsip_message_supported(message, "precondition") && self->supported.precondition) || tsip_message_required(message, "precondition")){
- return tsk_true;
- }
- }
+ if((tsip_message_supported(message, "100rel") && self->supported._100rel) || tsip_message_required(message, "100rel")) {
+ if((tsip_message_supported(message, "precondition") && self->supported.precondition) || tsip_message_required(message, "precondition")) {
+ return tsk_true;
+ }
+ }
#if 0
- if(tsip_dialog_invite_ice_is_enabled(self)){
- return tsk_true;
- }
+ if(tsip_dialog_invite_ice_is_enabled(self)) {
+ return tsk_true;
+ }
#endif
- return tsk_false;
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_prack_match(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- const tsip_header_RAck_t* RAck;
-
- if(!self->last_o1xxrel){
- return tsk_false;
- }
-
- if((RAck = (const tsip_header_RAck_t*)tsip_message_get_header(message, tsip_htype_RAck))){
- if((RAck->seq == self->rseq) &&
- (tsk_striequals(RAck->method, self->last_o1xxrel->CSeq->method)) &&
- (RAck->cseq == self->last_o1xxrel->CSeq->seq)){
- self->rseq++;
- return tsk_true;
- }
- else{
- TSK_DEBUG_WARN("Failed to match PRACK request");
- }
- }
-
- return tsk_false;
+ const tsip_header_RAck_t* RAck;
+
+ if(!self->last_o1xxrel) {
+ return tsk_false;
+ }
+
+ if((RAck = (const tsip_header_RAck_t*)tsip_message_get_header(message, tsip_htype_RAck))) {
+ if((RAck->seq == self->rseq) &&
+ (tsk_striequals(RAck->method, self->last_o1xxrel->CSeq->method)) &&
+ (RAck->cseq == self->last_o1xxrel->CSeq->seq)) {
+ self->rseq++;
+ return tsk_true;
+ }
+ else {
+ TSK_DEBUG_WARN("Failed to match PRACK request");
+ }
+ }
+
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_negociates_preconditions(tsip_dialog_invite_t* self, tsip_message_t* rPRACK)
{
- //tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition")
- if(tsip_message_required(self->last_iInvite, "precondition") || (self->msession_mgr && self->msession_mgr->qos.strength == tmedia_qos_strength_mandatory)){
- return tsk_true;
- }
- return tsk_false;
+ //tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition")
+ if(tsip_message_required(self->last_iInvite, "precondition") || (self->msession_mgr && self->msession_mgr->qos.strength == tmedia_qos_strength_mandatory)) {
+ return tsk_true;
+ }
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_cannotresume(tsip_dialog_invite_t* self, tsip_message_t* rUPDATE)
{
- if(!tsip_dialog_invite_process_ro(self, rUPDATE)){
- return !tmedia_session_mgr_canresume(self->msession_mgr);
- }
- else{
- return tsk_false;
- }
+ if(!tsip_dialog_invite_process_ro(self, rUPDATE)) {
+ return !tmedia_session_mgr_canresume(self->msession_mgr);
+ }
+ else {
+ return tsk_false;
+ }
}
static tsk_bool_t _fsm_cond_initial_iack_pending(tsip_dialog_invite_t* self, tsip_message_t* rACK)
@@ -229,64 +229,64 @@ static tsk_bool_t _fsm_cond_initial_iack_pending(tsip_dialog_invite_t* self, tsi
/* Init FSM */
int tsip_dialog_invite_server_init(tsip_dialog_invite_t *self)
{
- return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Bad Extendion) -> Terminated
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_bad_extension, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iINVITE, "s0000_Started_2_Terminated_X_iINVITE"),
- // Started -> (Bad content) -> Terminated
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_bad_content, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iINVITE, "s0000_Started_2_Terminated_X_iINVITE"),
- // Started -> (Session Interval Too Small) -> Started
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_toosmall, _fsm_state_Started, s0000_Started_2_Started_X_iINVITE, "s0000_Started_2_Started_X_iINVITE"),
- // Started -> (100rel && (QoS or ICE)) -> InProgress
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_use_early_media, _fsm_state_InProgress, s0000_Started_2_InProgress_X_iINVITE, "s0000_Started_2_InProgress_X_iINVITE"),
- // Started -> (non-100rel and non-QoS, referred to as "basic") -> Ringing
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_iINVITE, _fsm_state_Ringing, s0000_Started_2_Ringing_X_iINVITE, "s0000_Started_2_Ringing_X_iINVITE"),
-
-
- /*=======================
- * === InProgress ===
- */
- // InProgress ->(iPRACK with QoS) -> InProgress
- TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iPRACK, _fsm_cond_negociates_preconditions, _fsm_state_InProgress, s0000_InProgress_2_InProgress_X_iPRACK, "s0000_InProgress_2_InProgress_X_iPRACK"),
- // InProgress ->(iPRACK without QoS) -> Ringing
- TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iPRACK, _fsm_cond_prack_match, _fsm_state_Ringing, s0000_InProgress_2_Ringing_X_iPRACK, "s0000_InProgress_2_Ringing_X_iPRACK"),
- // InProgress ->(iUPDATE but cannot resume) -> InProgress
- TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iUPDATE, _fsm_cond_cannotresume, _fsm_state_InProgress, s0000_InProgress_2_InProgress_X_iUPDATE, "s0000_InProgress_2_InProgress_X_iUPDATE"),
- // InProgress ->(iUPDATE can resume) -> Ringing
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_iUPDATE, _fsm_state_Ringing, s0000_InProgress_2_Ringing_X_iUPDATE, "s0000_InProgress_2_Ringing_X_iUPDATE"),
- // InProgress ->(iCANCEL) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_iCANCEL, _fsm_state_Terminated, s0000_Inprogress_2_Terminated_X_iCANCEL, "s0000_Inprogress_2_Terminated_X_iCANCEL"),
-
-
- /*=======================
- * === Ringing ===
- */
- // Ringing -> (iPRACK) -> Ringing
- TSK_FSM_ADD(_fsm_state_Ringing, _fsm_action_iPRACK, _fsm_cond_prack_match, _fsm_state_Ringing, s0000_Ringing_2_Ringing_X_iPRACK, "s0000_Ringing_2_Ringing_X_iPRACK"),
- // Ringing -> (oAccept) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_accept, _fsm_state_Connected, s0000_Ringing_2_Connected_X_Accept, "s0000_Ringing_2_Connected_X_Accept"),
- // Ringing -> (oReject) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_reject, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_Reject, "s0000_Ringing_2_Terminated_X_Reject"),
- // Ringing ->(iCANCEL) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_iCANCEL, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_iCANCEL, "s0000_Ringing_2_Terminated_X_iCANCEL"),
-
- /*=======================
- * === FRESH CONNECTED ===
- */
- // Fresh Connected [ACK is pending] ->(iCANCEL) -> Terminated
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iCANCEL, _fsm_cond_initial_iack_pending, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_iCANCEL, "s0000_FreshConnected_2_Terminated_X_iCANCEL"),
-
- /*=======================
- * === ANY ===
- */
- // Any ->(timer100rel) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_timer100rel, tsk_fsm_state_any, s0000_Any_2_Any_X_timer100rel, "s0000_Any_2_Any_X_timer100rel"),
-
-
- TSK_FSM_ADD_NULL());
+ return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Bad Extendion) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_bad_extension, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iINVITE, "s0000_Started_2_Terminated_X_iINVITE"),
+ // Started -> (Bad content) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_bad_content, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iINVITE, "s0000_Started_2_Terminated_X_iINVITE"),
+ // Started -> (Session Interval Too Small) -> Started
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_toosmall, _fsm_state_Started, s0000_Started_2_Started_X_iINVITE, "s0000_Started_2_Started_X_iINVITE"),
+ // Started -> (100rel && (QoS or ICE)) -> InProgress
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iINVITE, _fsm_cond_use_early_media, _fsm_state_InProgress, s0000_Started_2_InProgress_X_iINVITE, "s0000_Started_2_InProgress_X_iINVITE"),
+ // Started -> (non-100rel and non-QoS, referred to as "basic") -> Ringing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_iINVITE, _fsm_state_Ringing, s0000_Started_2_Ringing_X_iINVITE, "s0000_Started_2_Ringing_X_iINVITE"),
+
+
+ /*=======================
+ * === InProgress ===
+ */
+ // InProgress ->(iPRACK with QoS) -> InProgress
+ TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iPRACK, _fsm_cond_negociates_preconditions, _fsm_state_InProgress, s0000_InProgress_2_InProgress_X_iPRACK, "s0000_InProgress_2_InProgress_X_iPRACK"),
+ // InProgress ->(iPRACK without QoS) -> Ringing
+ TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iPRACK, _fsm_cond_prack_match, _fsm_state_Ringing, s0000_InProgress_2_Ringing_X_iPRACK, "s0000_InProgress_2_Ringing_X_iPRACK"),
+ // InProgress ->(iUPDATE but cannot resume) -> InProgress
+ TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_iUPDATE, _fsm_cond_cannotresume, _fsm_state_InProgress, s0000_InProgress_2_InProgress_X_iUPDATE, "s0000_InProgress_2_InProgress_X_iUPDATE"),
+ // InProgress ->(iUPDATE can resume) -> Ringing
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_iUPDATE, _fsm_state_Ringing, s0000_InProgress_2_Ringing_X_iUPDATE, "s0000_InProgress_2_Ringing_X_iUPDATE"),
+ // InProgress ->(iCANCEL) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_iCANCEL, _fsm_state_Terminated, s0000_Inprogress_2_Terminated_X_iCANCEL, "s0000_Inprogress_2_Terminated_X_iCANCEL"),
+
+
+ /*=======================
+ * === Ringing ===
+ */
+ // Ringing -> (iPRACK) -> Ringing
+ TSK_FSM_ADD(_fsm_state_Ringing, _fsm_action_iPRACK, _fsm_cond_prack_match, _fsm_state_Ringing, s0000_Ringing_2_Ringing_X_iPRACK, "s0000_Ringing_2_Ringing_X_iPRACK"),
+ // Ringing -> (oAccept) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_accept, _fsm_state_Connected, s0000_Ringing_2_Connected_X_Accept, "s0000_Ringing_2_Connected_X_Accept"),
+ // Ringing -> (oReject) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_reject, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_Reject, "s0000_Ringing_2_Terminated_X_Reject"),
+ // Ringing ->(iCANCEL) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Ringing, _fsm_action_iCANCEL, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_iCANCEL, "s0000_Ringing_2_Terminated_X_iCANCEL"),
+
+ /*=======================
+ * === FRESH CONNECTED ===
+ */
+ // Fresh Connected [ACK is pending] ->(iCANCEL) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iCANCEL, _fsm_cond_initial_iack_pending, _fsm_state_Terminated, s0000_Ringing_2_Terminated_X_iCANCEL, "s0000_FreshConnected_2_Terminated_X_iCANCEL"),
+
+ /*=======================
+ * === ANY ===
+ */
+ // Any ->(timer100rel) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_timer100rel, tsk_fsm_state_any, s0000_Any_2_Any_X_timer100rel, "s0000_Any_2_Any_X_timer100rel"),
+
+
+ TSK_FSM_ADD_NULL());
}
//--------------------------------------------------------
@@ -297,467 +297,467 @@ int tsip_dialog_invite_server_init(tsip_dialog_invite_t *self)
/* Started -> (Failure) -> Terminated */
int s0000_Started_2_Terminated_X_iINVITE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- /* tsip_request_t *request = va_arg(*app, tsip_request_t *); */
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ /* tsip_request_t *request = va_arg(*app, tsip_request_t *); */
- /* We are not the client */
- self->is_client = tsk_false;
+ /* We are not the client */
+ self->is_client = tsk_false;
- return 0;
+ return 0;
}
/* Started -> (Too Small) -> Started */
int s0000_Started_2_Started_X_iINVITE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- /* We are not the client */
- self->is_client = tsk_false;
+ /* We are not the client */
+ self->is_client = tsk_false;
- return 0;
+ return 0;
}
/* Started -> (non-100rel and non-QoS, referred to as "basic") -> Ringing */
int s0000_Started_2_Ringing_X_iINVITE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
- const tsip_header_Session_Expires_t* hdr_SessionExpires;
-
- /* we are not the client */
- self->is_client = tsk_false;
-
- /* update last INVITE */
- TSK_OBJECT_SAFE_FREE(self->last_iInvite);
- self->last_iInvite = tsk_object_ref(request);
-
- // add "require:100rel" tag if the incoming INVITE contains "100rel" tag in "supported" header
- if(self->last_iInvite && (tsip_message_supported(self->last_iInvite, "100rel") || tsip_message_required(self->last_iInvite, "100rel")) && self->supported._100rel){
- self->required._100rel = tsk_true;
- }
-
- // add "require:timer" tag if incoming INVITE contains "timer" tag in "supported" header and session timers is enabled
- if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout){
- if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(request, tsip_htype_Session_Expires))){
- // "hdr_SessionExpires->delta_seconds" smallnest already checked
- self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
- tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
- self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
- self->required.timer = tsk_true;
- }
- }
-
- /* update state */
- tsip_dialog_update_2(TSIP_DIALOG(self), request);
-
- /* send Ringing */
- /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
- send_RESPONSE(self, request, 180, "Ringing", tsk_false);
- }
-
- /* alert the user (session) */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
- tsip_event_code_dialog_request_incoming, "Incoming Call", request);
-
- return 0;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ const tsip_header_Session_Expires_t* hdr_SessionExpires;
+
+ /* we are not the client */
+ self->is_client = tsk_false;
+
+ /* update last INVITE */
+ TSK_OBJECT_SAFE_FREE(self->last_iInvite);
+ self->last_iInvite = tsk_object_ref(request);
+
+ // add "require:100rel" tag if the incoming INVITE contains "100rel" tag in "supported" header
+ if(self->last_iInvite && (tsip_message_supported(self->last_iInvite, "100rel") || tsip_message_required(self->last_iInvite, "100rel")) && self->supported._100rel) {
+ self->required._100rel = tsk_true;
+ }
+
+ // add "require:timer" tag if incoming INVITE contains "timer" tag in "supported" header and session timers is enabled
+ if(TSIP_DIALOG_GET_SS(self)->media.timers.timeout) {
+ if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(request, tsip_htype_Session_Expires))) {
+ // "hdr_SessionExpires->delta_seconds" smallnest already checked
+ self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
+ tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
+ self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
+ self->required.timer = tsk_true;
+ }
+ }
+
+ /* update state */
+ tsip_dialog_update_2(TSIP_DIALOG(self), request);
+
+ /* send Ringing */
+ /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
+ send_RESPONSE(self, request, 180, "Ringing", tsk_false);
+ }
+
+ /* alert the user (session) */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
+ tsip_event_code_dialog_request_incoming, "Incoming Call", request);
+
+ return 0;
}
/* Started -> (QoS (preconditions)) -> InProgress */
int s0000_Started_2_InProgress_X_iINVITE(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
-
- /* We are not the client */
- self->is_client = tsk_false;
-
- /* update last INVITE */
- TSK_OBJECT_SAFE_FREE(self->last_iInvite);
- self->last_iInvite = tsk_object_ref(request);
-
- /* Update state */
- tsip_dialog_update_2(TSIP_DIALOG(self), request);
-
- /* Send In Progress
- RFC 3262 - 3 UAS Behavior
-
- The provisional response to be sent reliably is constructed by the
- UAS core according to the procedures of Section 8.2.6 of RFC 3261.
- In addition, it MUST contain a Require header field containing the
- option tag 100rel, and MUST include an RSeq header field. The value
- of the header field for the first reliable provisional response in a
- transaction MUST be between 1 and 2**31 - 1.
- */
- self->rseq = (rand() ^ rand()) % (0x00000001 << 31);
- self->required._100rel = tsk_true;
- self->required.precondition = (tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition"));
- send_RESPONSE(self, request, 183, "Session in Progress", tsk_true);
-
- return 0;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+
+ /* We are not the client */
+ self->is_client = tsk_false;
+
+ /* update last INVITE */
+ TSK_OBJECT_SAFE_FREE(self->last_iInvite);
+ self->last_iInvite = tsk_object_ref(request);
+
+ /* Update state */
+ tsip_dialog_update_2(TSIP_DIALOG(self), request);
+
+ /* Send In Progress
+ RFC 3262 - 3 UAS Behavior
+
+ The provisional response to be sent reliably is constructed by the
+ UAS core according to the procedures of Section 8.2.6 of RFC 3261.
+ In addition, it MUST contain a Require header field containing the
+ option tag 100rel, and MUST include an RSeq header field. The value
+ of the header field for the first reliable provisional response in a
+ transaction MUST be between 1 and 2**31 - 1.
+ */
+ self->rseq = (rand() ^ rand()) % (0x00000001 << 31);
+ self->required._100rel = tsk_true;
+ self->required.precondition = (tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition"));
+ send_RESPONSE(self, request, 183, "Session in Progress", tsk_true);
+
+ return 0;
}
/* InProgress ->(iPRACK with QoS) -> InProgress */
int s0000_InProgress_2_InProgress_X_iPRACK(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
-
- /* Cancel 100rel timer */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
-
- /* In all cases: Send 2xx PRACK */
- if(!(ret = send_RESPONSE(self, request, 200, "OK", tsk_false))){
- ++self->rseq;
- }
-
- /*
- 1. Alice sends an initial INVITE without offer
- 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
- 3. Alice's answer is sent in the PRACK response
- */
- if(!self->msession_mgr->sdp.ro){
- if(TSIP_MESSAGE_HAS_CONTENT(request)){
- if((ret = tsip_dialog_invite_process_ro(self, request))){
- /* Send Error and break the FSM */
- ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return -4;
- }
- }
- else{
- /* 488 INVITE */
- ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Offer expected in the PRACK\"");
- return -3;
- }
- }
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+
+ /* Cancel 100rel timer */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
+
+ /* In all cases: Send 2xx PRACK */
+ if(!(ret = send_RESPONSE(self, request, 200, "OK", tsk_false))) {
+ ++self->rseq;
+ }
+
+ /*
+ 1. Alice sends an initial INVITE without offer
+ 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
+ 3. Alice's answer is sent in the PRACK response
+ */
+ if(!self->msession_mgr->sdp.ro) {
+ if(TSIP_MESSAGE_HAS_CONTENT(request)) {
+ if((ret = tsip_dialog_invite_process_ro(self, request))) {
+ /* Send Error and break the FSM */
+ ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return -4;
+ }
+ }
+ else {
+ /* 488 INVITE */
+ ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Offer expected in the PRACK\"");
+ return -3;
+ }
+ }
+
+ return ret;
}
/* InProgress ->(iPRACK without QoS) -> Ringing */
int s0000_InProgress_2_Ringing_X_iPRACK(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
-
- /* Cancel 100rel timer */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
-
- /* In all cases: Send 2xx PRACK */
- if(!(ret = send_RESPONSE(self, request, 200, "OK", tsk_false))){
- ++self->rseq;
- }
-
- /*
- 1. Alice sends an initial INVITE without offer
- 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
- 3. Alice's answer is sent in the PRACK response
- */
- if(self->msession_mgr && !self->msession_mgr->sdp.ro){
- if(TSIP_MESSAGE_HAS_CONTENT(request)){
- if((ret = tsip_dialog_invite_process_ro(self, request))){
- /* Send Error and break the FSM */
- ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return -4;
- }
- }
- else{
- /* 488 INVITE */
- ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Offer expected in the PRACK\"");
- return -3;
- }
- }
-
- /* Send Ringing */
- /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
- ret = send_RESPONSE(self, self->last_iInvite, 180, "Ringing", tsk_false);
- }
-
- /* Alert the user (session) */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
- tsip_event_code_dialog_request_incoming, "Incoming Call", request);
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+
+ /* Cancel 100rel timer */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
+
+ /* In all cases: Send 2xx PRACK */
+ if(!(ret = send_RESPONSE(self, request, 200, "OK", tsk_false))) {
+ ++self->rseq;
+ }
+
+ /*
+ 1. Alice sends an initial INVITE without offer
+ 2. Bob's answer is sent in the first reliable provisional response, in this case it's a 1xx INVITE response
+ 3. Alice's answer is sent in the PRACK response
+ */
+ if(self->msession_mgr && !self->msession_mgr->sdp.ro) {
+ if(TSIP_MESSAGE_HAS_CONTENT(request)) {
+ if((ret = tsip_dialog_invite_process_ro(self, request))) {
+ /* Send Error and break the FSM */
+ ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return -4;
+ }
+ }
+ else {
+ /* 488 INVITE */
+ ret = send_ERROR(self, self->last_iInvite, 488, "Not Acceptable", "SIP; cause=488; text=\"Offer expected in the PRACK\"");
+ return -3;
+ }
+ }
+
+ /* Send Ringing */
+ /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
+ ret = send_RESPONSE(self, self->last_iInvite, 180, "Ringing", tsk_false);
+ }
+
+ /* Alert the user (session) */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
+ tsip_event_code_dialog_request_incoming, "Incoming Call", request);
+
+ return ret;
}
/* InProgress ->(iUPDATE but cannot resume) -> InProgress */
int s0000_InProgress_2_InProgress_X_iUPDATE(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
-
- if((ret = tsip_dialog_invite_process_ro(self, request))){
- /* Send Error and break the FSM */
- ret = send_ERROR(self, request, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return -4;
- }
- else{
- // force SDP in 200 OK even if the request has the same SDP version
- tsk_bool_t force_sdp = TSIP_MESSAGE_HAS_CONTENT(request);
- ret = send_RESPONSE(self, request, 200, "OK",
- (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
- }
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+
+ if((ret = tsip_dialog_invite_process_ro(self, request))) {
+ /* Send Error and break the FSM */
+ ret = send_ERROR(self, request, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return -4;
+ }
+ else {
+ // force SDP in 200 OK even if the request has the same SDP version
+ tsk_bool_t force_sdp = TSIP_MESSAGE_HAS_CONTENT(request);
+ ret = send_RESPONSE(self, request, 200, "OK",
+ (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
+ }
+
+ return ret;
}
/* InProgress ->(iUPDATE can resume) -> Ringing */
int s0000_InProgress_2_Ringing_X_iUPDATE(va_list *app)
{
- int ret;
-
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
- tsk_bool_t force_sdp;
-
- if((ret = tsip_dialog_invite_process_ro(self, request))){
- /* Send Error and break the FSM */
- ret = send_ERROR(self, request, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
- return -4;
- }
-
- /* Send 200 UPDATE */
- // force SDP in 200 OK even if the request has the same SDP version
- force_sdp = TSIP_MESSAGE_HAS_CONTENT(request);
- ret = send_RESPONSE(self, request, 200, "OK",
- (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
-
- /* Send Ringing */
- /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
- ret = send_RESPONSE(self, self->last_iInvite, 180, "Ringing", tsk_false);
- }
-
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
- tsip_event_code_dialog_request_incoming, "Incoming Call", request);
-
- return ret;
+ int ret;
+
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ tsk_bool_t force_sdp;
+
+ if((ret = tsip_dialog_invite_process_ro(self, request))) {
+ /* Send Error and break the FSM */
+ ret = send_ERROR(self, request, 488, "Not Acceptable", "SIP; cause=488; text=\"Bad content\"");
+ return -4;
+ }
+
+ /* Send 200 UPDATE */
+ // force SDP in 200 OK even if the request has the same SDP version
+ force_sdp = TSIP_MESSAGE_HAS_CONTENT(request);
+ ret = send_RESPONSE(self, request, 200, "OK",
+ (self->msession_mgr && (force_sdp || self->msession_mgr->ro_changed || self->msession_mgr->state_changed)));
+
+ /* Send Ringing */
+ /*if(TSIP_DIALOG_GET_STACK(self)->network.mode != tsip_stack_mode_webrtc2sip)*/{
+ ret = send_RESPONSE(self, self->last_iInvite, 180, "Ringing", tsk_false);
+ }
+
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_newcall,
+ tsip_event_code_dialog_request_incoming, "Incoming Call", request);
+
+ return ret;
}
/* InProgress ->(iCANCEL) -> Terminated */
int s0000_Inprogress_2_Terminated_X_iCANCEL(va_list *app)
{
- tsip_response_t* response;
- int ret = -1;
+ tsip_response_t* response;
+ int ret = -1;
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
- /* Send 2xx for the CANCEL (Direct to Transport layer beacause CANCEL is a special case) */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))){
- ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, response);
- TSK_OBJECT_SAFE_FREE(response);
- }
+ /* Send 2xx for the CANCEL (Direct to Transport layer beacause CANCEL is a special case) */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))) {
+ ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
- /* Send Request Cancelled */
- ret = send_ERROR(self, self->last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");
+ /* Send Request Cancelled */
+ ret = send_ERROR(self, self->last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Cancelled", tsip_event_code_dialog_terminated);
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Cancelled", tsip_event_code_dialog_terminated);
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
- return ret;
+ return ret;
}
/* Ringing -> (iPRACK) -> Ringing */
int s0000_Ringing_2_Ringing_X_iPRACK(va_list *app)
{
- int ret;
+ int ret;
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
- if(!self->last_iInvite){
- /* silently ignore */
- return 0;
- }
+ if(!self->last_iInvite) {
+ /* silently ignore */
+ return 0;
+ }
- /* Cancel 100rel timer */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
+ /* Cancel 100rel timer */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
- /* Send 2xx PRACK */
- ret = send_RESPONSE(self, request, 200, "OK", tsk_false);
+ /* Send 2xx PRACK */
+ ret = send_RESPONSE(self, request, 200, "OK", tsk_false);
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
- return ret;
+ return ret;
}
/* Ringing -> (oAccept) -> Connected */
int s0000_Ringing_2_Connected_X_Accept(va_list *app)
{
- int ret;
+ int ret;
+
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
+ tsk_bool_t mediaType_changed;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
- tsk_bool_t mediaType_changed;
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ /* Determine whether the remote party support UPDATE */
+ self->support_update = tsip_message_allowed(self->last_iInvite, "UPDATE");
- /* Determine whether the remote party support UPDATE */
- self->support_update = tsip_message_allowed(self->last_iInvite, "UPDATE");
+ /* Get Media type from the action */
+ mediaType_changed = (TSIP_DIALOG_GET_SS(self)->media.type != action->media.type && action->media.type != tmedia_none);
+ if(self->msession_mgr && mediaType_changed) {
+ ret = tmedia_session_mgr_set_media_type(self->msession_mgr, action->media.type);
+ }
- /* Get Media type from the action */
- mediaType_changed = (TSIP_DIALOG_GET_SS(self)->media.type != action->media.type && action->media.type != tmedia_none);
- if(self->msession_mgr && mediaType_changed){
- ret = tmedia_session_mgr_set_media_type(self->msession_mgr, action->media.type);
- }
+ /* Appy media params received from the user */
+ if(!TSK_LIST_IS_EMPTY(action->media.params)) {
+ ret = tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
+ }
- /* Appy media params received from the user */
- if(!TSK_LIST_IS_EMPTY(action->media.params)){
- ret = tmedia_session_mgr_set_3(self->msession_mgr, action->media.params);
- }
+ /* set MSRP callback */
+ if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp) {
+ ret = tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
+ }
- /* set MSRP callback */
- if((self->msession_mgr->type & tmedia_msrp) == tmedia_msrp){
- ret = tmedia_session_mgr_set_msrp_cb(self->msession_mgr, TSIP_DIALOG_GET_SS(self)->userdata, TSIP_DIALOG_GET_SS(self)->media.msrp.callback);
- }
+ /* Cancel 100rel timer */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
- /* Cancel 100rel timer */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
+ /* send 2xx OK */
+ ret = send_RESPONSE(self, self->last_iInvite, 200, "OK", tsk_true);
- /* send 2xx OK */
- ret = send_RESPONSE(self, self->last_iInvite, 200, "OK", tsk_true);
-
/* say we're waiting for the incoming ACK */
self->is_initial_iack_pending = tsk_true;
- /* do not start the session until we get the ACK message
- * http://code.google.com/p/doubango/issues/detail?id=157
- */
+ /* do not start the session until we get the ACK message
+ * http://code.google.com/p/doubango/issues/detail?id=157
+ */
/* do not start the session until we get at least one remote SDP
* https://code.google.com/p/doubango/issues/detail?id=438
*/
- // FIXME: (chrome) <-RTCWeb Breaker-> (chrome) do not work if media session is not started on i200
- // http://code.google.com/p/webrtc2sip/issues/detail?id=45
- if(/*TSIP_DIALOG_GET_STACK(self)->network.mode == tsip_stack_mode_webrtc2sip*/ TSIP_MESSAGE_HAS_CONTENT(self->last_iInvite)){
- ret = tsip_dialog_invite_msession_start(self);
- }
-
- /* Session Timers */
- if(self->stimers.timer.timeout){
- if(self->stimers.is_refresher){
- /* RFC 4028 - 9. UAS Behavior
- It is RECOMMENDED that this refresh be sent oncehalf the session interval has elapsed.
- Additional procedures for this refresh are described in Section 10.
- */
- tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000)/2);
- }
- else{
- tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000));
- }
- }
-
- /* alert the user (dialog) */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
-
- return ret;
+ // FIXME: (chrome) <-RTCWeb Breaker-> (chrome) do not work if media session is not started on i200
+ // http://code.google.com/p/webrtc2sip/issues/detail?id=45
+ if(/*TSIP_DIALOG_GET_STACK(self)->network.mode == tsip_stack_mode_webrtc2sip*/ TSIP_MESSAGE_HAS_CONTENT(self->last_iInvite)) {
+ ret = tsip_dialog_invite_msession_start(self);
+ }
+
+ /* Session Timers */
+ if(self->stimers.timer.timeout) {
+ if(self->stimers.is_refresher) {
+ /* RFC 4028 - 9. UAS Behavior
+ It is RECOMMENDED that this refresh be sent oncehalf the session interval has elapsed.
+ Additional procedures for this refresh are described in Section 10.
+ */
+ tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000)/2);
+ }
+ else {
+ tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000));
+ }
+ }
+
+ /* alert the user (dialog) */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+
+ return ret;
}
/* Ringing -> (oReject) -> Terminated */
int s0000_Ringing_2_Terminated_X_Reject(va_list *app)
{
- int ret;
- short code;
- const char* phrase;
- char* reason = tsk_null;
+ int ret;
+ short code;
+ const char* phrase;
+ char* reason = tsk_null;
- tsip_dialog_invite_t *self;
- const tsip_action_t* action;
+ tsip_dialog_invite_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_invite_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_invite_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- /* Cancel 100rel timer */
- TSIP_DIALOG_TIMER_CANCEL(100rel);
+ /* Cancel 100rel timer */
+ TSIP_DIALOG_TIMER_CANCEL(100rel);
- /* Send Reject */
- code = action->line_resp.code>=300 ? action->line_resp.code : 603;
- phrase = action->line_resp.phrase ? action->line_resp.phrase : "Decline";
- tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
- ret = send_ERROR(self, self->last_iInvite, code, phrase, reason);
- TSK_FREE(reason);
+ /* Send Reject */
+ code = action->line_resp.code>=300 ? action->line_resp.code : 603;
+ phrase = action->line_resp.phrase ? action->line_resp.phrase : "Decline";
+ tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
+ ret = send_ERROR(self, self->last_iInvite, code, phrase, reason);
+ TSK_FREE(reason);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Terminated", tsip_event_code_dialog_terminated);
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Terminated", tsip_event_code_dialog_terminated);
- return ret;
+ return ret;
}
/* Ringing ->(iCANCEL) -> Terminated */
int s0000_Ringing_2_Terminated_X_iCANCEL(va_list *app)
{
- int ret;
- tsip_response_t* response;
+ int ret;
+ tsip_response_t* response;
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
- if(!self->last_iInvite){
- /* silently ignore */
- return 0;
- }
+ if(!self->last_iInvite) {
+ /* silently ignore */
+ return 0;
+ }
- /* Send 2xx for the CANCEL (Direct to Transport layer beacause CANCEL is a special case) */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))){
- ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, response);
- TSK_OBJECT_SAFE_FREE(response);
- }
+ /* Send 2xx for the CANCEL (Direct to Transport layer beacause CANCEL is a special case) */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))) {
+ ret = tsip_transport_layer_send(TSIP_DIALOG_GET_STACK(self)->layer_transport, tsk_null, response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
- /* Send Request Cancelled */
- ret = send_ERROR(self, self->last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");
+ /* Send Request Cancelled */
+ ret = send_ERROR(self, self->last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Cancelled", tsip_event_code_dialog_terminated);
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Call Cancelled", tsip_event_code_dialog_terminated);
- /* alert the user */
- TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+ /* alert the user */
+ TSIP_DIALOG_INVITE_SIGNAL(self, tsip_i_request,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
- return ret;
+ return ret;
}
/* Any ->(timer 100rel) -> Any */
int s0000_Any_2_Any_X_timer100rel(va_list *app)
{
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
-
- int ret;
-
- if(!self->last_o1xxrel){
- /* silently ignore */
- return 0;
- }
-
- /* resync timer */
- if((self->timer100rel.timeout *= 2) >= (64 * tsip_timers_getA())){
- TSK_DEBUG_ERROR("Sending reliable 1xx failed");
- return -2;
- }
-
- /* resend reliable 1xx */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), self->last_o1xxrel))){
- return ret;
- }
- else{
- /* schedule timer */
- TSIP_DIALOG_INVITE_TIMER_SCHEDULE(100rel);
- }
-
- return ret;
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+
+ int ret;
+
+ if(!self->last_o1xxrel) {
+ /* silently ignore */
+ return 0;
+ }
+
+ /* resync timer */
+ if((self->timer100rel.timeout *= 2) >= (64 * tsip_timers_getA())) {
+ TSK_DEBUG_ERROR("Sending reliable 1xx failed");
+ return -2;
+ }
+
+ /* resend reliable 1xx */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), self->last_o1xxrel))) {
+ return ret;
+ }
+ else {
+ /* schedule timer */
+ TSIP_DIALOG_INVITE_TIMER_SCHEDULE(100rel);
+ }
+
+ return ret;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -766,25 +766,25 @@ int s0000_Any_2_Any_X_timer100rel(va_list *app)
int send_UNSUPPORTED(tsip_dialog_invite_t* self, const tsip_request_t* request, const char* option)
{
- tsip_response_t *response;
-
- if(!self || !option){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 420, "Bad Extension", request))){
- // Add UnSupported header
- tsip_message_add_headers(response,
- TSIP_HEADER_DUMMY_VA_ARGS("Unsupported", option),
- TSIP_HEADER_DUMMY_VA_ARGS("Reason", "SIP; cause=420; text=\"Bad Extension\""),
- tsk_null
- );
-
- tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- return 0;
+ tsip_response_t *response;
+
+ if(!self || !option) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 420, "Bad Extension", request))) {
+ // Add UnSupported header
+ tsip_message_add_headers(response,
+ TSIP_HEADER_DUMMY_VA_ARGS("Unsupported", option),
+ TSIP_HEADER_DUMMY_VA_ARGS("Reason", "SIP; cause=420; text=\"Bad Extension\""),
+ tsk_null
+ );
+
+ tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ return 0;
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_invite.timers.c b/tinySIP/src/dialogs/tsip_dialog_invite.timers.c
index a8b279c..00743f2 100755
--- a/tinySIP/src/dialogs/tsip_dialog_invite.timers.c
+++ b/tinySIP/src/dialogs/tsip_dialog_invite.timers.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -54,29 +54,29 @@ static int x0250_Any_2_Any_X_i422(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_refresher(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return self->stimers.is_refresher;
+ return self->stimers.is_refresher;
}
static tsk_bool_t _fsm_cond_is_not_refresher(tsip_dialog_invite_t* self, tsip_message_t* message)
{
- return !_fsm_cond_is_refresher(self, message);
+ return !_fsm_cond_is_refresher(self, message);
}
/* Init FSM */
int tsip_dialog_invite_stimers_init(tsip_dialog_invite_t *self)
{
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
- // Connected -> (timerRefresh && isRefresher) -> Connected
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_timerRefresh, _fsm_cond_is_refresher, _fsm_state_Connected, x0200_Connected_2_Connected_X_timerRefresh, "x0200_Connected_2_Connected_X_timerRefresh"),
- // Connected -> (timerRefresh && !isRefresher) -> Trying (because we will send BYE)
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_timerRefresh, _fsm_cond_is_not_refresher, _fsm_state_Trying, x0201_Connected_2_Trying_X_timerRefresh, "x0201_Connected_2_Trying_X_timerRefresh"),
- // Any -> (i422) -> Any
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_i422, tsk_fsm_state_any, x0250_Any_2_Any_X_i422, "x0250_Any_2_Any_X_i422"),
+ // Connected -> (timerRefresh && isRefresher) -> Connected
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_timerRefresh, _fsm_cond_is_refresher, _fsm_state_Connected, x0200_Connected_2_Connected_X_timerRefresh, "x0200_Connected_2_Connected_X_timerRefresh"),
+ // Connected -> (timerRefresh && !isRefresher) -> Trying (because we will send BYE)
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_timerRefresh, _fsm_cond_is_not_refresher, _fsm_state_Trying, x0201_Connected_2_Trying_X_timerRefresh, "x0201_Connected_2_Trying_X_timerRefresh"),
+ // Any -> (i422) -> Any
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_i422, tsk_fsm_state_any, x0250_Any_2_Any_X_i422, "x0250_Any_2_Any_X_i422"),
- TSK_FSM_ADD_NULL());
+ TSK_FSM_ADD_NULL());
- return 0;
+ return 0;
}
@@ -86,80 +86,80 @@ int tsip_dialog_invite_stimers_init(tsip_dialog_invite_t *self)
int x0200_Connected_2_Connected_X_timerRefresh(va_list *app)
{
- /* We are the refresher and the session timedout
- ==> Refresh the session
- */
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- int ret;
-
- /* RFC 4028 - 7.4. Generating Subsequent Session Refresh Requests
-
- A re-INVITE generated to refresh the session is a normal re-INVITE,
- and an UPDATE generated to refresh a session is a normal UPDATE. If
- a UAC knows that its peer supports the UPDATE method, it is
- RECOMMENDED that UPDATE be used instead of a re-INVITE. A UA can
- make this determination if it has seen an Allow header field from its
- peer with the value 'UPDATE', or through a mid-dialog OPTIONS
- request. It is RECOMMENDED that the UPDATE request not contain an
- offer [4], but a re-INVITE SHOULD contain one, even if the details of
- the session have not changed
- */
- /* 2xx will be handled by tsip_dialog_invite_stimers_handle() */
- ret = send_INVITEorUPDATE(self, !self->support_update, tsk_false);
-
- return ret;
+ /* We are the refresher and the session timedout
+ ==> Refresh the session
+ */
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ int ret;
+
+ /* RFC 4028 - 7.4. Generating Subsequent Session Refresh Requests
+
+ A re-INVITE generated to refresh the session is a normal re-INVITE,
+ and an UPDATE generated to refresh a session is a normal UPDATE. If
+ a UAC knows that its peer supports the UPDATE method, it is
+ RECOMMENDED that UPDATE be used instead of a re-INVITE. A UA can
+ make this determination if it has seen an Allow header field from its
+ peer with the value 'UPDATE', or through a mid-dialog OPTIONS
+ request. It is RECOMMENDED that the UPDATE request not contain an
+ offer [4], but a re-INVITE SHOULD contain one, even if the details of
+ the session have not changed
+ */
+ /* 2xx will be handled by tsip_dialog_invite_stimers_handle() */
+ ret = send_INVITEorUPDATE(self, !self->support_update, tsk_false);
+
+ return ret;
}
int x0201_Connected_2_Trying_X_timerRefresh(va_list *app)
{
- /* We are not the refresher and the session timedout
- ==> send BYE
- */
- tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
- int ret;
-
- /* send BYE */
- ret = send_BYE(self);
-
- /* alert the user that the session timedout */
-
- return ret;
+ /* We are not the refresher and the session timedout
+ ==> send BYE
+ */
+ tsip_dialog_invite_t *self = va_arg(*app, tsip_dialog_invite_t *);
+ int ret;
+
+ /* send BYE */
+ ret = send_BYE(self);
+
+ /* alert the user that the session timedout */
+
+ return ret;
}
// Any -> (i422) -> Any
int x0250_Any_2_Any_X_i422(va_list *app)
{
- tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
- const tsip_response_t* r422 = va_arg(*app, const tsip_response_t *);
-
- const tsip_header_Min_SE_t* Min_SE;
-
- /* RFC 4825 - 3. Overview of Operation
- If the Session-Expires interval is too low for a proxy (i.e., lower
- than the value of Min-SE that the proxy would wish to assert), the
- proxy rejects the request with a 422 response. That response
- contains a Min-SE header field identifying the minimum session
- interval it is willing to support. The UAC will try again, this time
- including the Min-SE header field in the request. The header field
- contains the largest Min-SE header field it observed in all 422
- responses previously received. This way, the minimum timer meets the
- constraints of all proxies along the path.
-
- RFC 4825 - 6. 422 Response Code Definition
- The 422 response MUST contain a Min-SE header field with the minimum timer for that server.
- */
-
- if((Min_SE = (const tsip_header_Min_SE_t* )tsip_message_get_header(r422, tsip_htype_Min_SE))){
- self->stimers.minse = Min_SE->delta_seconds;
- self->stimers.timer.timeout = Min_SE->delta_seconds;
- }
- else{
- TSK_DEBUG_ERROR("Invalid response (422 need Min-SE header)");
- return 0; /* Do not end the dialog */
- }
-
- /* send again the INVITE */
- return send_INVITE(self, tsk_false);
+ tsip_dialog_invite_t* self = va_arg(*app, tsip_dialog_invite_t *);
+ const tsip_response_t* r422 = va_arg(*app, const tsip_response_t *);
+
+ const tsip_header_Min_SE_t* Min_SE;
+
+ /* RFC 4825 - 3. Overview of Operation
+ If the Session-Expires interval is too low for a proxy (i.e., lower
+ than the value of Min-SE that the proxy would wish to assert), the
+ proxy rejects the request with a 422 response. That response
+ contains a Min-SE header field identifying the minimum session
+ interval it is willing to support. The UAC will try again, this time
+ including the Min-SE header field in the request. The header field
+ contains the largest Min-SE header field it observed in all 422
+ responses previously received. This way, the minimum timer meets the
+ constraints of all proxies along the path.
+
+ RFC 4825 - 6. 422 Response Code Definition
+ The 422 response MUST contain a Min-SE header field with the minimum timer for that server.
+ */
+
+ if((Min_SE = (const tsip_header_Min_SE_t* )tsip_message_get_header(r422, tsip_htype_Min_SE))) {
+ self->stimers.minse = Min_SE->delta_seconds;
+ self->stimers.timer.timeout = Min_SE->delta_seconds;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid response (422 need Min-SE header)");
+ return 0; /* Do not end the dialog */
+ }
+
+ /* send again the INVITE */
+ return send_INVITE(self, tsk_false);
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -173,130 +173,130 @@ int x0250_Any_2_Any_X_i422(va_list *app)
/* cancel the timer */
int tsip_dialog_invite_stimers_cancel(tsip_dialog_invite_t* self)
{
- return tsk_timer_mgr_global_cancel(self->stimers.timer.id);
+ return tsk_timer_mgr_global_cancel(self->stimers.timer.id);
}
/* schedule the timer */
int tsip_dialog_invite_stimers_schedule(tsip_dialog_invite_t* self, uint64_t timeout)
{
- /* Used in SIP requests ==> do not change the value
- self->stimers.timer.timeout = timeout;
- */
- self->stimers.timer.id = tsk_timer_mgr_global_schedule(timeout, TSK_TIMER_CALLBACK_F(tsip_dialog_invite_timer_callback), self);
+ /* Used in SIP requests ==> do not change the value
+ self->stimers.timer.timeout = timeout;
+ */
+ self->stimers.timer.id = tsk_timer_mgr_global_schedule(timeout, TSK_TIMER_CALLBACK_F(tsip_dialog_invite_timer_callback), self);
- return 0;
+ return 0;
}
/* handle requests/responses */
int tsip_dialog_invite_stimers_handle(tsip_dialog_invite_t* self, const tsip_message_t* message)
{
- /* It's up to the caller to check that (self->stimers.timer.timeout is >0)
- and message is INVITE or UPDATE or 2xxINVITE or 2xxUPDATE
- */
-
- int ret = 0;
- const tsip_header_Session_Expires_t* hdr_SessionExpires;
-
- if(!self || !message){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- if(!self->stimers.timer.timeout){
- /* guard for stupide callers */
- return 0;
- }
- /* reUPDATE or reINVITE */
- if(TSIP_MESSAGE_IS_REQUEST(message) && (TSIP_REQUEST_IS_UPDATE(message) || TSIP_REQUEST_IS_INVITE(message))){
- if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))){
- if(hdr_SessionExpires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE){
- self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
- ret = send_RESPONSE(self, message, 422, "Session Interval Too Small");
- }
- else{
- self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
- tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
- self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
- }
- }
- }
- /* 2xx */
- else if(TSIP_MESSAGE_IS_RESPONSE(message) && (TSIP_RESPONSE_IS_TO_INVITE(message) || TSIP_RESPONSE_IS_TO_UPDATE(message))){
- if(!TSIP_RESPONSE_IS_2XX(message)){
- /* guard for stupide callers */
- return 0;
- }
- /* Process the response only if it includes "Require: timer"
-
- RFC 4028 - 7.2. Processing a 2xx Response
- When a 2xx response to a session refresh request arrives, it may or
- may not contain a Require header field with the value 'timer'. If it
- does, the UAC MUST look for the Session-Expires header field to
- process the response.
-
- If there was a Require header field in the response with the value
- 'timer', the Session-Expires header field will always be present.
- UACs MUST be prepared to receive a Session-Expires header field in a
- response, even if none were present in the request. The 'refresher'
- parameter will be present in the Session-Expires header field,
- indicating who will perform the refreshes. The UAC MUST set the
- identity of the refresher to the value of this parameter. If the
- parameter contains the value 'uac', the UAC will perform them.
- */
- if(tsip_message_required(message, "timer")){
- if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))){
- if(hdr_SessionExpires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE){
- self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
- ret = send_RESPONSE(self, message, 422, "Interval Too short");
- }
- else{
- self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
- tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
- self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uac");
- self->supported.timer = (self->stimers.timer.timeout != 0);
- self->required.timer = self->supported.timer;
- }
- }
- else{
- self->stimers.timer.timeout = 0; /* turned-off */
- self->supported.timer = tsk_false;
- self->required.timer = tsk_false;
- ret = send_RESPONSE(self, message, 481, "Session-Expires header is missing");
- return 0;
- }
- }
- else{
- /*
- RFC 4028 - 7.2. Processing a 2xx Response
- If the 2xx response did not contain a Session-Expires header field,
- there is no session expiration. In this case, no refreshes need to
- be sent. A 2xx without a Session-Expires can come for both initial
- and subsequent session refresh requests. This means that the session
- timer can be 'turned-off' in mid dialog by receiving a response
- without a Session-Expires header field.
- */
- self->stimers.timer.timeout = 0; /* turned-off */
- self->supported.timer = tsk_false;
- self->required.timer = tsk_false;
- }
- }
-
- /* Cancel timeout */
- tsip_dialog_invite_stimers_cancel(self);
-
- /* schedule timer */
- if(self->stimers.timer.timeout){
- if(self->stimers.is_refresher){
- /* RFC 4028 - 9. UAS Behavior
- It is RECOMMENDED that this refresh be sent oncehalf the session interval has elapsed.
- Additional procedures for this refresh are described in Section 10.
- */
- tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000)/2);
- }
- else{
- tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000));
- }
- }
-
- return ret;
+ /* It's up to the caller to check that (self->stimers.timer.timeout is >0)
+ and message is INVITE or UPDATE or 2xxINVITE or 2xxUPDATE
+ */
+
+ int ret = 0;
+ const tsip_header_Session_Expires_t* hdr_SessionExpires;
+
+ if(!self || !message) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ if(!self->stimers.timer.timeout) {
+ /* guard for stupide callers */
+ return 0;
+ }
+ /* reUPDATE or reINVITE */
+ if(TSIP_MESSAGE_IS_REQUEST(message) && (TSIP_REQUEST_IS_UPDATE(message) || TSIP_REQUEST_IS_INVITE(message))) {
+ if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))) {
+ if(hdr_SessionExpires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE) {
+ self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
+ ret = send_RESPONSE(self, message, 422, "Session Interval Too Small");
+ }
+ else {
+ self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
+ tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
+ self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
+ }
+ }
+ }
+ /* 2xx */
+ else if(TSIP_MESSAGE_IS_RESPONSE(message) && (TSIP_RESPONSE_IS_TO_INVITE(message) || TSIP_RESPONSE_IS_TO_UPDATE(message))) {
+ if(!TSIP_RESPONSE_IS_2XX(message)) {
+ /* guard for stupide callers */
+ return 0;
+ }
+ /* Process the response only if it includes "Require: timer"
+
+ RFC 4028 - 7.2. Processing a 2xx Response
+ When a 2xx response to a session refresh request arrives, it may or
+ may not contain a Require header field with the value 'timer'. If it
+ does, the UAC MUST look for the Session-Expires header field to
+ process the response.
+
+ If there was a Require header field in the response with the value
+ 'timer', the Session-Expires header field will always be present.
+ UACs MUST be prepared to receive a Session-Expires header field in a
+ response, even if none were present in the request. The 'refresher'
+ parameter will be present in the Session-Expires header field,
+ indicating who will perform the refreshes. The UAC MUST set the
+ identity of the refresher to the value of this parameter. If the
+ parameter contains the value 'uac', the UAC will perform them.
+ */
+ if(tsip_message_required(message, "timer")) {
+ if((hdr_SessionExpires = (const tsip_header_Session_Expires_t*)tsip_message_get_header(message, tsip_htype_Session_Expires))) {
+ if(hdr_SessionExpires->delta_seconds < TSIP_SESSION_EXPIRES_MIN_VALUE) {
+ self->stimers.minse = TSIP_SESSION_EXPIRES_MIN_VALUE;
+ ret = send_RESPONSE(self, message, 422, "Interval Too short");
+ }
+ else {
+ self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
+ tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
+ self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uac");
+ self->supported.timer = (self->stimers.timer.timeout != 0);
+ self->required.timer = self->supported.timer;
+ }
+ }
+ else {
+ self->stimers.timer.timeout = 0; /* turned-off */
+ self->supported.timer = tsk_false;
+ self->required.timer = tsk_false;
+ ret = send_RESPONSE(self, message, 481, "Session-Expires header is missing");
+ return 0;
+ }
+ }
+ else {
+ /*
+ RFC 4028 - 7.2. Processing a 2xx Response
+ If the 2xx response did not contain a Session-Expires header field,
+ there is no session expiration. In this case, no refreshes need to
+ be sent. A 2xx without a Session-Expires can come for both initial
+ and subsequent session refresh requests. This means that the session
+ timer can be 'turned-off' in mid dialog by receiving a response
+ without a Session-Expires header field.
+ */
+ self->stimers.timer.timeout = 0; /* turned-off */
+ self->supported.timer = tsk_false;
+ self->required.timer = tsk_false;
+ }
+ }
+
+ /* Cancel timeout */
+ tsip_dialog_invite_stimers_cancel(self);
+
+ /* schedule timer */
+ if(self->stimers.timer.timeout) {
+ if(self->stimers.is_refresher) {
+ /* RFC 4028 - 9. UAS Behavior
+ It is RECOMMENDED that this refresh be sent oncehalf the session interval has elapsed.
+ Additional procedures for this refresh are described in Section 10.
+ */
+ tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000)/2);
+ }
+ else {
+ tsip_dialog_invite_stimers_schedule(self, (self->stimers.timer.timeout*1000));
+ }
+ }
+
+ return ret;
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_layer.c b/tinySIP/src/dialogs/tsip_dialog_layer.c
index 9a33fd3..f91dd33 100755
--- a/tinySIP/src/dialogs/tsip_dialog_layer.c
+++ b/tinySIP/src/dialogs/tsip_dialog_layer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,281 +47,281 @@ extern tsip_ssession_handle_t *tsip_ssession_create_2(const tsip_stack_t* stack,
/*== Predicate function to find dialog by type */
static int pred_find_dialog_by_type(const tsk_list_item_t *item, const void *type)
{
- if(item && item->data){
- tsip_dialog_t *dialog = item->data;
- return (dialog->type - *((tsip_dialog_type_t*)type));
- }
- return -1;
+ if(item && item->data) {
+ tsip_dialog_t *dialog = item->data;
+ return (dialog->type - *((tsip_dialog_type_t*)type));
+ }
+ return -1;
}
/*== Predicate function to find dialog by not type */
static int pred_find_dialog_by_not_type(const tsk_list_item_t *item, const void *type)
{
- if(item && item->data){
- tsip_dialog_t *dialog = item->data;
- if(dialog->type != *((tsip_dialog_type_t*)type)){
- return 0;
- }
- }
- return -1;
+ if(item && item->data) {
+ tsip_dialog_t *dialog = item->data;
+ if(dialog->type != *((tsip_dialog_type_t*)type)) {
+ return 0;
+ }
+ }
+ return -1;
}
/*== Predicate function to find dialog by callid */
static int pred_find_dialog_by_callid(const tsk_list_item_t *item, const void *callid)
{
- if(item && item->data && callid){
- return tsk_strcmp(((tsip_dialog_t*)item->data)->callid, ((const char*)callid));
- }
- return -1;
+ if(item && item->data && callid) {
+ return tsk_strcmp(((tsip_dialog_t*)item->data)->callid, ((const char*)callid));
+ }
+ return -1;
}
tsip_dialog_layer_t* tsip_dialog_layer_create(tsip_stack_t* stack)
{
- return tsk_object_new(tsip_dialog_layer_def_t, stack);
+ return tsk_object_new(tsip_dialog_layer_def_t, stack);
}
// it's up to the caller to release the returned object
tsip_dialog_t* tsip_dialog_layer_find_by_ss(tsip_dialog_layer_t *self, const tsip_ssession_handle_t *ss)
{
- return tsip_dialog_layer_find_by_ssid(self, tsip_ssession_get_id(ss));
+ return tsip_dialog_layer_find_by_ssid(self, tsip_ssession_get_id(ss));
}
// it's up to the caller to release the returned object
tsip_dialog_t* tsip_dialog_layer_find_by_ssid(tsip_dialog_layer_t *self, tsip_ssession_id_t ssid)
{
- tsip_dialog_t *ret = 0;
- tsip_dialog_t *dialog;
- tsk_list_item_t *item;
+ tsip_dialog_t *ret = 0;
+ tsip_dialog_t *dialog;
+ tsk_list_item_t *item;
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
- tsk_list_foreach(item, self->dialogs){
- dialog = item->data;
- if(tsip_ssession_get_id(dialog->ss) == ssid){
- ret = dialog;
- break;
- }
- }
+ tsk_list_foreach(item, self->dialogs) {
+ dialog = item->data;
+ if(tsip_ssession_get_id(dialog->ss) == ssid) {
+ ret = dialog;
+ break;
+ }
+ }
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return tsk_object_ref(ret);
+ return tsk_object_ref(ret);
}
// it's up to the caller to release the returned object
tsip_dialog_t* tsip_dialog_layer_find_by_callid(tsip_dialog_layer_t *self, const char* callid)
{
- if(!self || !callid){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
- else{
- tsip_dialog_t *dialog = tsk_null;
- tsk_list_item_t *item;
- //--tsk_safeobj_lock(self);
- tsk_list_foreach(item, self->dialogs){
- if(tsk_striequals(TSIP_DIALOG(item->data)->callid, callid)){
- dialog = tsk_object_ref(item->data);
- break;
- }
- }
- //--tsk_safeobj_unlock(self);
- return dialog;
- }
+ if(!self || !callid) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+ else {
+ tsip_dialog_t *dialog = tsk_null;
+ tsk_list_item_t *item;
+ //--tsk_safeobj_lock(self);
+ tsk_list_foreach(item, self->dialogs) {
+ if(tsk_striequals(TSIP_DIALOG(item->data)->callid, callid)) {
+ dialog = tsk_object_ref(item->data);
+ break;
+ }
+ }
+ //--tsk_safeobj_unlock(self);
+ return dialog;
+ }
}
tsk_bool_t tsip_dialog_layer_have_dialog_with_callid(const tsip_dialog_layer_t *self, const char* callid)
{
- tsk_bool_t found = tsk_false;
- if(self){
- tsk_safeobj_lock(self);
- if(tsk_list_find_item_by_pred(self->dialogs, pred_find_dialog_by_callid, callid) != tsk_null){
- found = tsk_true;
- }
- tsk_safeobj_unlock(self);
- }
- return found;
+ tsk_bool_t found = tsk_false;
+ if(self) {
+ tsk_safeobj_lock(self);
+ if(tsk_list_find_item_by_pred(self->dialogs, pred_find_dialog_by_callid, callid) != tsk_null) {
+ found = tsk_true;
+ }
+ tsk_safeobj_unlock(self);
+ }
+ return found;
}
// it's up to the caller to release the returned object
tsip_dialog_t* tsip_dialog_layer_find(const tsip_dialog_layer_t *self, const char* callid, const char* to_tag, const char* from_tag, tsip_request_type_t type, tsk_bool_t *cid_matched)
{
- tsip_dialog_t *ret = tsk_null;
- tsip_dialog_t *dialog;
- tsk_list_item_t *item;
-
- *cid_matched = tsk_false;
-
- tsk_safeobj_lock(self);
-
- tsk_list_foreach(item, self->dialogs){
- dialog = item->data;
- if(tsk_strequals(dialog->callid, callid)){
- tsk_bool_t is_cancel = (type == tsip_CANCEL); // Incoming CANCEL
- tsk_bool_t is_register = (type == tsip_REGISTER); // Incoming REGISTER
- tsk_bool_t is_notify = (type == tsip_NOTIFY); // Incoming NOTIFY
- *cid_matched = tsk_true;
- /* CANCEL Request will have the same local tag than the INVITE request
- the remote tag could be null if the CANCEL request is received immediately after a 100 Trying
- */
- if((is_cancel || tsk_strequals(dialog->tag_local, from_tag)) && (!dialog->tag_remote || tsk_strequals(dialog->tag_remote, to_tag))){
- ret = tsk_object_ref(dialog);
- break;
- }
- /* REGISTER is dialogless which means that each reREGISTER or unREGISTER will have empty to tag */
- if(is_register /* Do not check tags */){
- ret = tsk_object_ref(dialog);
- break;
- }
- /* NOTIFY could arrive before the 200 SUBSCRIBE => This is why we don't try to match both tags
-
- RFC 3265 - 3.1.4.4. Confirmation of Subscription Creation
- Due to the potential for both out-of-order messages and forking, the
- subscriber MUST be prepared to receive NOTIFY messages before the
- SUBSCRIBE transaction has completed.
- */
- if(is_notify /* Do not check tags */){
- ret = tsk_object_ref(dialog);
- break;
- }
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ tsip_dialog_t *ret = tsk_null;
+ tsip_dialog_t *dialog;
+ tsk_list_item_t *item;
+
+ *cid_matched = tsk_false;
+
+ tsk_safeobj_lock(self);
+
+ tsk_list_foreach(item, self->dialogs) {
+ dialog = item->data;
+ if(tsk_strequals(dialog->callid, callid)) {
+ tsk_bool_t is_cancel = (type == tsip_CANCEL); // Incoming CANCEL
+ tsk_bool_t is_register = (type == tsip_REGISTER); // Incoming REGISTER
+ tsk_bool_t is_notify = (type == tsip_NOTIFY); // Incoming NOTIFY
+ *cid_matched = tsk_true;
+ /* CANCEL Request will have the same local tag than the INVITE request
+ the remote tag could be null if the CANCEL request is received immediately after a 100 Trying
+ */
+ if((is_cancel || tsk_strequals(dialog->tag_local, from_tag)) && (!dialog->tag_remote || tsk_strequals(dialog->tag_remote, to_tag))) {
+ ret = tsk_object_ref(dialog);
+ break;
+ }
+ /* REGISTER is dialogless which means that each reREGISTER or unREGISTER will have empty to tag */
+ if(is_register /* Do not check tags */) {
+ ret = tsk_object_ref(dialog);
+ break;
+ }
+ /* NOTIFY could arrive before the 200 SUBSCRIBE => This is why we don't try to match both tags
+
+ RFC 3265 - 3.1.4.4. Confirmation of Subscription Creation
+ Due to the potential for both out-of-order messages and forking, the
+ subscriber MUST be prepared to receive NOTIFY messages before the
+ SUBSCRIBE transaction has completed.
+ */
+ if(is_notify /* Do not check tags */) {
+ ret = tsk_object_ref(dialog);
+ break;
+ }
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
tsk_size_t tsip_dialog_layer_count_active_calls(tsip_dialog_layer_t *self)
{
- tsk_size_t count = 0;
+ tsk_size_t count = 0;
- tsip_dialog_t *dialog;
- tsk_list_item_t *item;
+ tsip_dialog_t *dialog;
+ tsk_list_item_t *item;
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
- tsk_list_foreach(item, self->dialogs) {
- if ((dialog = item->data) && dialog->type == tsip_dialog_INVITE && dialog->state != tsip_initial && dialog->state != tsip_terminated) {
- ++count;
- }
- }
+ tsk_list_foreach(item, self->dialogs) {
+ if ((dialog = item->data) && dialog->type == tsip_dialog_INVITE && dialog->state != tsip_initial && dialog->state != tsip_terminated) {
+ ++count;
+ }
+ }
- tsk_safeobj_unlock(self);
+ tsk_safeobj_unlock(self);
- return count;
+ return count;
}
/** Hangup all dialogs starting by non-REGISTER */
int tsip_dialog_layer_shutdownAll(tsip_dialog_layer_t *self)
{
- if(self){
- tsk_bool_t wait = tsk_false;
- tsk_list_item_t *item;
- tsip_dialog_t *dialog;
- tsip_dialog_type_t regtype = tsip_dialog_REGISTER;
-
- if(!self->shutdown.inprogress){
- self->shutdown.inprogress = tsk_true;
- if (!self->shutdown.condwait) {
- self->shutdown.condwait = tsk_condwait_create();
- }
- }
-
- tsk_safeobj_lock(self);
- if(tsk_list_count(self->dialogs, pred_find_dialog_by_not_type, &regtype)){
- /* There are non-register dialogs ==> phase-1 */
- goto phase1;
- }
- else if(tsk_list_count(self->dialogs, pred_find_dialog_by_type, &regtype)){
- /* There are one or more register dialogs ==> phase-2 */
- goto phase2;
- }
- else{
- tsk_safeobj_unlock(self);
- goto done;
- }
+ if(self) {
+ tsk_bool_t wait = tsk_false;
+ tsk_list_item_t *item;
+ tsip_dialog_t *dialog;
+ tsip_dialog_type_t regtype = tsip_dialog_REGISTER;
+
+ if(!self->shutdown.inprogress) {
+ self->shutdown.inprogress = tsk_true;
+ if (!self->shutdown.condwait) {
+ self->shutdown.condwait = tsk_condwait_create();
+ }
+ }
+
+ tsk_safeobj_lock(self);
+ if(tsk_list_count(self->dialogs, pred_find_dialog_by_not_type, &regtype)) {
+ /* There are non-register dialogs ==> phase-1 */
+ goto phase1;
+ }
+ else if(tsk_list_count(self->dialogs, pred_find_dialog_by_type, &regtype)) {
+ /* There are one or more register dialogs ==> phase-2 */
+ goto phase2;
+ }
+ else {
+ tsk_safeobj_unlock(self);
+ goto done;
+ }
phase1:
- /* Phase 1 - shutdown all except register and silent_hangup */
- TSK_DEBUG_INFO("== Shutting down - Phase-1 started ==");
+ /* Phase 1 - shutdown all except register and silent_hangup */
+ TSK_DEBUG_INFO("== Shutting down - Phase-1 started ==");
phase1_loop:
- tsk_list_foreach(item, self->dialogs){
- dialog = item->data;
- if(dialog->type != tsip_dialog_REGISTER && !dialog->ss->silent_hangup){
- item = tsk_object_ref(item);
- if(!tsip_dialog_shutdown(dialog, tsk_null)){
- wait = tsk_true;
- }
-
- // if "tsip_dialog_shutdown()" remove the dialog, then
- // "self->dialogs" will be unsafe
- if(!(item = tsk_object_unref(item))){
- goto phase1_loop;
- }
- }
- }
- tsk_safeobj_unlock(self);
-
- /* wait until phase-1 is completed */
- if(wait){
- tsk_condwait_timedwait(self->shutdown.condwait, TSIP_DIALOG_SHUTDOWN_TIMEOUT);
- }
-
- /* lock and goto phase2 */
- tsk_safeobj_lock(self);
- wait = tsk_false;
- goto phase2;
+ tsk_list_foreach(item, self->dialogs) {
+ dialog = item->data;
+ if(dialog->type != tsip_dialog_REGISTER && !dialog->ss->silent_hangup) {
+ item = tsk_object_ref(item);
+ if(!tsip_dialog_shutdown(dialog, tsk_null)) {
+ wait = tsk_true;
+ }
+
+ // if "tsip_dialog_shutdown()" remove the dialog, then
+ // "self->dialogs" will be unsafe
+ if(!(item = tsk_object_unref(item))) {
+ goto phase1_loop;
+ }
+ }
+ }
+ tsk_safeobj_unlock(self);
+
+ /* wait until phase-1 is completed */
+ if(wait) {
+ tsk_condwait_timedwait(self->shutdown.condwait, TSIP_DIALOG_SHUTDOWN_TIMEOUT);
+ }
+
+ /* lock and goto phase2 */
+ tsk_safeobj_lock(self);
+ wait = tsk_false;
+ goto phase2;
phase2:
- /* Phase 2 - unregister */
- TSK_DEBUG_INFO("== Shutting down - Phase-2 started ==");
- self->shutdown.phase2 = tsk_true;
+ /* Phase 2 - unregister */
+ TSK_DEBUG_INFO("== Shutting down - Phase-2 started ==");
+ self->shutdown.phase2 = tsk_true;
phase2_loop:
- tsk_list_foreach(item, self->dialogs){
- dialog = item->data;
- if(dialog->type == tsip_dialog_REGISTER){
- item = tsk_object_ref(item);
- if(!tsip_dialog_shutdown(dialog, tsk_null)){
- wait = tsk_true;
- }
- // if "tsip_dialog_shutdown()" remove the dialog, then
- // "self->dialogs" will be unsafe
- if(!(item = tsk_object_unref(item))){
- goto phase2_loop;
- }
- }
- }
- tsk_safeobj_unlock(self);
-
- /* wait until phase-2 is completed */
- if(wait){
- tsk_condwait_timedwait(self->shutdown.condwait, TSIP_DIALOG_SHUTDOWN_TIMEOUT);
- }
-
-
- /* Phase 3 - silenthangup (dialogs will be terminated immediately) */
- TSK_DEBUG_INFO("== Shutting down - Phase-3 ==");
+ tsk_list_foreach(item, self->dialogs) {
+ dialog = item->data;
+ if(dialog->type == tsip_dialog_REGISTER) {
+ item = tsk_object_ref(item);
+ if(!tsip_dialog_shutdown(dialog, tsk_null)) {
+ wait = tsk_true;
+ }
+ // if "tsip_dialog_shutdown()" remove the dialog, then
+ // "self->dialogs" will be unsafe
+ if(!(item = tsk_object_unref(item))) {
+ goto phase2_loop;
+ }
+ }
+ }
+ tsk_safeobj_unlock(self);
+
+ /* wait until phase-2 is completed */
+ if(wait) {
+ tsk_condwait_timedwait(self->shutdown.condwait, TSIP_DIALOG_SHUTDOWN_TIMEOUT);
+ }
+
+
+ /* Phase 3 - silenthangup (dialogs will be terminated immediately) */
+ TSK_DEBUG_INFO("== Shutting down - Phase-3 ==");
phase3_loop:
- tsk_list_foreach(item, self->dialogs){
- dialog = item->data;
- if(dialog->ss->silent_hangup){
- item = tsk_object_ref(item);
- tsip_dialog_shutdown(dialog, tsk_null);
-
- // if "tsip_dialog_shutdown()" remove the dialog, then
- // "self->dialogs" will became unsafe while looping
- if(!(item = tsk_object_unref(item))){
- goto phase3_loop;
- }
- }
- }
+ tsk_list_foreach(item, self->dialogs) {
+ dialog = item->data;
+ if(dialog->ss->silent_hangup) {
+ item = tsk_object_ref(item);
+ tsip_dialog_shutdown(dialog, tsk_null);
+
+ // if "tsip_dialog_shutdown()" remove the dialog, then
+ // "self->dialogs" will became unsafe while looping
+ if(!(item = tsk_object_unref(item))) {
+ goto phase3_loop;
+ }
+ }
+ }
done:
- TSK_DEBUG_INFO("== Shutting down - Terminated ==");
- return 0;
- }
- return -1;
+ TSK_DEBUG_INFO("== Shutting down - Terminated ==");
+ return 0;
+ }
+ return -1;
}
static void* TSK_STDCALL _tsip_dialog_signal_transport_error_async(void* dialog)
@@ -332,396 +332,387 @@ static void* TSK_STDCALL _tsip_dialog_signal_transport_error_async(void* dialog)
int tsip_dialog_layer_signal_stack_disconnected(tsip_dialog_layer_t *self)
{
- tsk_list_item_t *item;
+ tsk_list_item_t *item;
// use copy for lock-free code and faster code. also fix issue 172 (https://code.google.com/p/idoubs/issues/detail?id=172)
tsip_dialogs_L_t *dialogs_copy;
tsip_dialog_t *dialog;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
if (!(dialogs_copy = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create list");
- return -1;
+ return -1;
}
- tsk_safeobj_lock(self);
+ tsk_safeobj_lock(self);
tsk_list_pushback_list(dialogs_copy, self->dialogs);
tsk_safeobj_unlock(self);
-
- tsk_list_foreach(item, dialogs_copy){
- if((dialog = TSIP_DIALOG(item->data))){
+
+ tsk_list_foreach(item, dialogs_copy) {
+ if((dialog = TSIP_DIALOG(item->data))) {
tsip_dialog_signal_transport_error(dialog);
}
}
TSK_OBJECT_SAFE_FREE(dialogs_copy);
- return 0;
+ return 0;
}
int tsip_dialog_layer_signal_peer_disconnected(tsip_dialog_layer_t *self, const struct tsip_transport_stream_peer_s* peer)
{
- tsip_dialog_t *dialog;
- const tsk_list_item_t *item;
-
- if(!self || !peer){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
+ tsip_dialog_t *dialog;
+ const tsk_list_item_t *item;
+
+ if(!self || !peer) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
//!\ must not lock the entire layer
- // tsk_safeobj_lock(self);
+ // tsk_safeobj_lock(self);
- tsk_list_lock(peer->dialogs_cids);
- tsk_list_foreach(item, peer->dialogs_cids){
- if((dialog = tsip_dialog_layer_find_by_callid(self, TSK_STRING_STR(item->data)))){
- tsip_dialog_signal_transport_error(dialog);
- TSK_OBJECT_SAFE_FREE(dialog);
- }
- else{
- // To avoid this WARN, you should call tsip_dialog_layer_have_dialog_with_callid() before adding a callid to a peer
- TSK_DEBUG_WARN("Stream peer holds call-id='%s' but the dialog layer doesn't know it", TSK_STRING_STR(item->data));
- }
- }
- tsk_list_unlock(peer->dialogs_cids);
+ tsk_list_lock(peer->dialogs_cids);
+ tsk_list_foreach(item, peer->dialogs_cids) {
+ if((dialog = tsip_dialog_layer_find_by_callid(self, TSK_STRING_STR(item->data)))) {
+ tsip_dialog_signal_transport_error(dialog);
+ TSK_OBJECT_SAFE_FREE(dialog);
+ }
+ else {
+ // To avoid this WARN, you should call tsip_dialog_layer_have_dialog_with_callid() before adding a callid to a peer
+ TSK_DEBUG_WARN("Stream peer holds call-id='%s' but the dialog layer doesn't know it", TSK_STRING_STR(item->data));
+ }
+ }
+ tsk_list_unlock(peer->dialogs_cids);
- // tsk_safeobj_unlock(self);
+ // tsk_safeobj_unlock(self);
- return 0;
+ return 0;
}
int tsip_dialog_layer_remove_callid_from_stream_peers(tsip_dialog_layer_t *self, const char* callid)
{
- if(self){
- return tsip_transport_layer_remove_callid_from_stream_peers(self->stack->layer_transport, callid);
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self) {
+ return tsip_transport_layer_remove_callid_from_stream_peers(self->stack->layer_transport, callid);
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
/* the caller of this function must unref() the returned object */
tsip_dialog_t* tsip_dialog_layer_new(tsip_dialog_layer_t *self, tsip_dialog_type_t type, const tsip_ssession_t *ss)
{
- tsip_dialog_t* ret = tsk_null;
- tsip_dialog_t* dialog;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- switch(type){
- case tsip_dialog_INVITE:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_invite_create(ss, tsk_null))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_MESSAGE:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_message_create(ss))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_INFO:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_info_create(ss))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_OPTIONS:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_options_create(ss))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_PUBLISH:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_publish_create(ss))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_REGISTER:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_register_create(ss, tsk_null))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
- case tsip_dialog_SUBSCRIBE:
- {
- if((dialog = (tsip_dialog_t*)tsip_dialog_subscribe_create(ss))){
- ret = tsk_object_ref(dialog);
- tsk_list_push_back_data(self->dialogs, (void**)&dialog);
- }
- break;
- }
-
- default:
- {
- TSK_DEBUG_ERROR("Dialog type not supported.");
- break;
- }
- }
+ tsip_dialog_t* ret = tsk_null;
+ tsip_dialog_t* dialog;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ switch(type) {
+ case tsip_dialog_INVITE: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_invite_create(ss, tsk_null))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_MESSAGE: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_message_create(ss))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_INFO: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_info_create(ss))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_OPTIONS: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_options_create(ss))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_PUBLISH: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_publish_create(ss))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_REGISTER: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_register_create(ss, tsk_null))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+ case tsip_dialog_SUBSCRIBE: {
+ if((dialog = (tsip_dialog_t*)tsip_dialog_subscribe_create(ss))) {
+ ret = tsk_object_ref(dialog);
+ tsk_list_push_back_data(self->dialogs, (void**)&dialog);
+ }
+ break;
+ }
+
+ default: {
+ TSK_DEBUG_ERROR("Dialog type not supported.");
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tsip_dialog_layer_remove(tsip_dialog_layer_t *self, const tsip_dialog_t *dialog)
{
- if(dialog && self){
- tsip_dialog_type_t regtype = tsip_dialog_REGISTER;
- tsk_safeobj_lock(self);
-
- /* remove the dialog */
- tsk_list_remove_item_by_data(self->dialogs, dialog);
-
- /* whether shutting down? */
- if(self->shutdown.inprogress){
- if(self->shutdown.phase2){ /* Phase 2 (all non-REGISTER and silent dialogs have been removed) */
- if(tsk_list_count(self->dialogs, pred_find_dialog_by_type, &regtype) == 0){
- /* alert only if there is not REGISTER dialog (ignore silents) */
- TSK_DEBUG_INFO("== Shutting down - Phase-2 completed ==");
- tsk_condwait_broadcast(self->shutdown.condwait);
- }
- }
- else{ /* Phase 1 */
- if(tsk_list_count(self->dialogs, pred_find_dialog_by_not_type, &regtype) == 0){
- /* alert only if all dialogs except REGISTER have been removed */
- TSK_DEBUG_INFO("== Shutting down - Phase-1 completed ==");
- tsk_condwait_broadcast(self->shutdown.condwait);
- }
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return 0;
- }
-
- return -1;
+ if(dialog && self) {
+ tsip_dialog_type_t regtype = tsip_dialog_REGISTER;
+ tsk_safeobj_lock(self);
+
+ /* remove the dialog */
+ tsk_list_remove_item_by_data(self->dialogs, dialog);
+
+ /* whether shutting down? */
+ if(self->shutdown.inprogress) {
+ if(self->shutdown.phase2) { /* Phase 2 (all non-REGISTER and silent dialogs have been removed) */
+ if(tsk_list_count(self->dialogs, pred_find_dialog_by_type, &regtype) == 0) {
+ /* alert only if there is not REGISTER dialog (ignore silents) */
+ TSK_DEBUG_INFO("== Shutting down - Phase-2 completed ==");
+ tsk_condwait_broadcast(self->shutdown.condwait);
+ }
+ }
+ else { /* Phase 1 */
+ if(tsk_list_count(self->dialogs, pred_find_dialog_by_not_type, &regtype) == 0) {
+ /* alert only if all dialogs except REGISTER have been removed */
+ TSK_DEBUG_INFO("== Shutting down - Phase-1 completed ==");
+ tsk_condwait_broadcast(self->shutdown.condwait);
+ }
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return 0;
+ }
+
+ return -1;
}
// this function is only called if no transaction match
// for responses, the transaction will always match
int tsip_dialog_layer_handle_incoming_msg(const tsip_dialog_layer_t *self, tsip_message_t* message)
{
- int ret = -1;
- tsk_bool_t cid_matched;
- tsip_dialog_t* dialog;
- tsip_transac_t* transac = tsk_null;
- const tsip_transac_layer_t *layer_transac = self->stack->layer_transac;
-
- if(!layer_transac){
- goto bail;
- }
-
- //tsk_safeobj_lock(self);
- dialog = tsip_dialog_layer_find(self, message->Call_ID->value,
- TSIP_MESSAGE_IS_RESPONSE(message) ? message->To->tag : message->From->tag,
- TSIP_MESSAGE_IS_RESPONSE(message) ? message->From->tag : message->To->tag,
- TSIP_MESSAGE_IS_REQUEST(message) ? TSIP_MESSAGE_AS_REQUEST(message)->line.request.request_type : tsip_NONE,
- &cid_matched);
- //tsk_safeobj_unlock(self);
-
- if(dialog){
- if(TSIP_REQUEST_IS_CANCEL(message) || TSIP_REQUEST_IS_ACK(message)){
- ret = dialog->callback(dialog, tsip_dialog_i_msg, message);
- tsk_object_unref(dialog);
- goto bail;
- }
- else{
- static tsk_bool_t isCT = tsk_false;
- tsip_transac_dst_t* dst = tsip_transac_dst_dialog_create(dialog);
- transac = tsip_transac_layer_new(
- layer_transac,
- isCT,
- message,
- dst
- );
- TSK_OBJECT_SAFE_FREE(dst);
- TSK_OBJECT_SAFE_FREE(dialog);
- }
- }
- else{
- /* MediaProxyMode : forward all non-INVITE messages */
- if(self->stack->network.mode == tsip_stack_mode_webrtc2sip){
- tsk_bool_t b2bua;
-
- if(TSIP_MESSAGE_IS_REQUEST(message)){
- // requests received over TCP/TLS/UDP must contain "ws-src-ip" and "ws-src-port" parameters
- if(!TNET_SOCKET_TYPE_IS_WS(message->src_net_type) && !TNET_SOCKET_TYPE_IS_WSS(message->src_net_type)){
- const char* ws_src_ip = tsk_params_get_param_value(message->line.request.uri->params, "ws-src-ip");
- const tnet_port_t ws_src_port = (tnet_port_t)tsk_params_get_param_value_as_int(message->line.request.uri->params, "ws-src-port");
- if(!tsip_transport_layer_have_stream_peer_with_remote_ip(self->stack->layer_transport, ws_src_ip, ws_src_port)){
- if(!TSIP_REQUEST_IS_ACK(message)){ // ACK do not expect response
+ int ret = -1;
+ tsk_bool_t cid_matched;
+ tsip_dialog_t* dialog;
+ tsip_transac_t* transac = tsk_null;
+ const tsip_transac_layer_t *layer_transac = self->stack->layer_transac;
+
+ if(!layer_transac) {
+ goto bail;
+ }
+
+ //tsk_safeobj_lock(self);
+ dialog = tsip_dialog_layer_find(self, message->Call_ID->value,
+ TSIP_MESSAGE_IS_RESPONSE(message) ? message->To->tag : message->From->tag,
+ TSIP_MESSAGE_IS_RESPONSE(message) ? message->From->tag : message->To->tag,
+ TSIP_MESSAGE_IS_REQUEST(message) ? TSIP_MESSAGE_AS_REQUEST(message)->line.request.request_type : tsip_NONE,
+ &cid_matched);
+ //tsk_safeobj_unlock(self);
+
+ if(dialog) {
+ if(TSIP_REQUEST_IS_CANCEL(message) || TSIP_REQUEST_IS_ACK(message)) {
+ ret = dialog->callback(dialog, tsip_dialog_i_msg, message);
+ tsk_object_unref(dialog);
+ goto bail;
+ }
+ else {
+ static tsk_bool_t isCT = tsk_false;
+ tsip_transac_dst_t* dst = tsip_transac_dst_dialog_create(dialog);
+ transac = tsip_transac_layer_new(
+ layer_transac,
+ isCT,
+ message,
+ dst
+ );
+ TSK_OBJECT_SAFE_FREE(dst);
+ TSK_OBJECT_SAFE_FREE(dialog);
+ }
+ }
+ else {
+ /* MediaProxyMode : forward all non-INVITE messages */
+ if(self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
+ tsk_bool_t b2bua;
+
+ if(TSIP_MESSAGE_IS_REQUEST(message)) {
+ // requests received over TCP/TLS/UDP must contain "ws-src-ip" and "ws-src-port" parameters
+ if(!TNET_SOCKET_TYPE_IS_WS(message->src_net_type) && !TNET_SOCKET_TYPE_IS_WSS(message->src_net_type)) {
+ const char* ws_src_ip = tsk_params_get_param_value(message->line.request.uri->params, "ws-src-ip");
+ const tnet_port_t ws_src_port = (tnet_port_t)tsk_params_get_param_value_as_int(message->line.request.uri->params, "ws-src-port");
+ if(!tsip_transport_layer_have_stream_peer_with_remote_ip(self->stack->layer_transport, ws_src_ip, ws_src_port)) {
+ if(!TSIP_REQUEST_IS_ACK(message)) { // ACK do not expect response
#if 0 // code commented because when using mjserver, rejecting the forked INVITE terminate all dialogs: have to check if it's conform to RFC 3261 or not
- tsip_response_t* response = tsip_response_new(488, "WebSocket Peer not connected", message);
- ret = tsip_transport_layer_send(self->stack->layer_transport, "no-branch", response);
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
+ tsip_response_t* response = tsip_response_new(488, "WebSocket Peer not connected", message);
+ ret = tsip_transport_layer_send(self->stack->layer_transport, "no-branch", response);
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
#else
- TSK_DEBUG_INFO("Request for peer at %s:%d cannot be delivered", ws_src_ip, ws_src_port);
+ TSK_DEBUG_INFO("Request for peer at %s:%d cannot be delivered", ws_src_ip, ws_src_port);
#endif
- }
- return 0;
- }
- }
- }
-
- // "rtcweb-breaker" parameter will be in the Contact header for outgoing request and in the request-uri for incoming requests
- b2bua = TSIP_REQUEST_IS_INVITE(message) && message->Contact && message->Contact->uri &&
- (tsk_striequals(tsk_params_get_param_value(message->Contact->uri->params, "rtcweb-breaker"), "yes")
- || tsk_striequals(tsk_params_get_param_value(message->line.request.uri->params, "rtcweb-breaker"), "yes"));
-
- if(!b2bua){
- // forward the message
- static tsk_bool_t isCT = tsk_true;
- tsip_transac_dst_t* dst;
- tsip_transac_t* transac;
-
- TSIP_MESSAGE(message)->update = tsk_true; // update AoR and Via
- if((dst = tsip_transac_dst_net_create(TSIP_STACK(self->stack)))){
- if((transac = tsip_transac_layer_new(self->stack->layer_transac, isCT, message, dst))){
- ret = tsip_transac_start(transac, message);
- TSK_OBJECT_SAFE_FREE(transac);
- }
- TSK_OBJECT_SAFE_FREE(dst);
- }
- return ret;
- }
- }
-
- if(TSIP_MESSAGE_IS_REQUEST(message)){
- tsip_ssession_t* ss = tsk_null;
- tsip_dialog_t* newdialog = tsk_null;
-
- switch(message->line.request.request_type){
- case tsip_MESSAGE:
- { /* Server incoming MESSAGE */
- if((ss = tsip_ssession_create_2(self->stack, message))){
- newdialog = (tsip_dialog_t*)tsip_dialog_message_create(ss);
- }
- break;
- }
- case tsip_INFO:
- { /* Server incoming INFO */
- if((ss = tsip_ssession_create_2(self->stack, message))){
- newdialog = (tsip_dialog_t*)tsip_dialog_info_create(ss);
- }
- break;
- }
- case tsip_OPTIONS:
- { /* Server incoming OPTIONS */
- if((ss = tsip_ssession_create_2(self->stack, message))){
- newdialog = (tsip_dialog_t*)tsip_dialog_options_create(ss);
- }
- break;
- }
-
- case tsip_REGISTER:
- { /* incoming REGISTER */
- if((ss = tsip_ssession_create_2(self->stack, message))){
- newdialog = (tsip_dialog_t*)tsip_dialog_register_create(ss, message->Call_ID ? message->Call_ID->value : tsk_null);
- }
- break;
- }
-
- case tsip_INVITE:
- { /* incoming INVITE */
- if((ss = tsip_ssession_create_2(self->stack, message))){
- newdialog = (tsip_dialog_t*)tsip_dialog_invite_create(ss, message->Call_ID ? message->Call_ID->value : tsk_null);
- }
- break;
- }
-
- default:
- {
- break;
- }
- }//switch
-
- // for new dialog, create a new transac and start it later
- if(newdialog){
- static const tsk_bool_t isCT = tsk_false;
- tsip_transac_dst_t* dst = tsip_transac_dst_dialog_create(newdialog);
- transac = tsip_transac_layer_new(
- layer_transac,
- isCT,
- message,
- dst
- );
- if(message->local_fd > 0 && TNET_SOCKET_TYPE_IS_STREAM(message->src_net_type)) {
- tsip_dialog_set_connected_fd(newdialog, message->local_fd);
- }
- tsk_list_push_back_data(self->dialogs, (void**)&newdialog); /* add new dialog to the layer */
- TSK_OBJECT_SAFE_FREE(dst);
- }
-
- /* The dialog will become the owner of the SIP session
- * => when destoyed => SIP session will be destroyed, unless the user-end takes ownership() */
- TSK_OBJECT_SAFE_FREE(ss);
- }
- }
-
- if(transac){
- ret = tsip_transac_start(transac, message);
- tsk_object_unref(transac);
- }
- /* - No transaction match for the SIP request
- - ACK do not expect any response (http://code.google.com/p/imsdroid/issues/detail?id=420)
- */
- else if(TSIP_MESSAGE_IS_REQUEST(message) && !TSIP_REQUEST_IS_ACK(message)){
- const tsip_transport_layer_t *layer;
- tsip_response_t* response = tsk_null;
- if(!dialog && cid_matched){
- dialog = tsip_dialog_layer_find_by_callid((tsip_dialog_layer_t *)self, message->Call_ID->value);
- }
-
- if((layer = self->stack->layer_transport)){
- if(cid_matched){ /* We are receiving our own message. */
- response = tsip_response_new(482, "Loop Detected (Check your iFCs)", message);
- if(response && !response->To->tag){/* Early dialog? */
- response->To->tag = tsk_strdup("doubango");
- }
- }
- else{
- switch(message->line.request.request_type){
- case tsip_OPTIONS: // Hacked to work on Tiscali IMS networks
- case tsip_INFO:
- response = tsip_response_new(405, "Method Not Allowed", message);
- break;
- default:
- response = tsip_response_new(481, "Dialog/Transaction Does Not Exist", message);
- break;
- }
- }
- if(response){
- if(dialog && TSIP_DIALOG_GET_SS(dialog)){
- tsk_strupdate(&response->sigcomp_id, TSIP_DIALOG_GET_SS(dialog)->sigcomp_id);
- }
- ret = tsip_transport_layer_send(layer, response->firstVia ? response->firstVia->branch : "no-branch", response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- }
-
- TSK_OBJECT_SAFE_FREE(dialog);
- }
-
+ }
+ return 0;
+ }
+ }
+ }
+
+ // "rtcweb-breaker" parameter will be in the Contact header for outgoing request and in the request-uri for incoming requests
+ b2bua = TSIP_REQUEST_IS_INVITE(message) && message->Contact && message->Contact->uri &&
+ (tsk_striequals(tsk_params_get_param_value(message->Contact->uri->params, "rtcweb-breaker"), "yes")
+ || tsk_striequals(tsk_params_get_param_value(message->line.request.uri->params, "rtcweb-breaker"), "yes"));
+
+ if(!b2bua) {
+ // forward the message
+ static tsk_bool_t isCT = tsk_true;
+ tsip_transac_dst_t* dst;
+ tsip_transac_t* transac;
+
+ TSIP_MESSAGE(message)->update = tsk_true; // update AoR and Via
+ if((dst = tsip_transac_dst_net_create(TSIP_STACK(self->stack)))) {
+ if((transac = tsip_transac_layer_new(self->stack->layer_transac, isCT, message, dst))) {
+ ret = tsip_transac_start(transac, message);
+ TSK_OBJECT_SAFE_FREE(transac);
+ }
+ TSK_OBJECT_SAFE_FREE(dst);
+ }
+ return ret;
+ }
+ }
+
+ if(TSIP_MESSAGE_IS_REQUEST(message)) {
+ tsip_ssession_t* ss = tsk_null;
+ tsip_dialog_t* newdialog = tsk_null;
+
+ switch(message->line.request.request_type) {
+ case tsip_MESSAGE: {
+ /* Server incoming MESSAGE */
+ if((ss = tsip_ssession_create_2(self->stack, message))) {
+ newdialog = (tsip_dialog_t*)tsip_dialog_message_create(ss);
+ }
+ break;
+ }
+ case tsip_INFO: {
+ /* Server incoming INFO */
+ if((ss = tsip_ssession_create_2(self->stack, message))) {
+ newdialog = (tsip_dialog_t*)tsip_dialog_info_create(ss);
+ }
+ break;
+ }
+ case tsip_OPTIONS: {
+ /* Server incoming OPTIONS */
+ if((ss = tsip_ssession_create_2(self->stack, message))) {
+ newdialog = (tsip_dialog_t*)tsip_dialog_options_create(ss);
+ }
+ break;
+ }
+
+ case tsip_REGISTER: {
+ /* incoming REGISTER */
+ if((ss = tsip_ssession_create_2(self->stack, message))) {
+ newdialog = (tsip_dialog_t*)tsip_dialog_register_create(ss, message->Call_ID ? message->Call_ID->value : tsk_null);
+ }
+ break;
+ }
+
+ case tsip_INVITE: {
+ /* incoming INVITE */
+ if((ss = tsip_ssession_create_2(self->stack, message))) {
+ newdialog = (tsip_dialog_t*)tsip_dialog_invite_create(ss, message->Call_ID ? message->Call_ID->value : tsk_null);
+ }
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }//switch
+
+ // for new dialog, create a new transac and start it later
+ if(newdialog) {
+ static const tsk_bool_t isCT = tsk_false;
+ tsip_transac_dst_t* dst = tsip_transac_dst_dialog_create(newdialog);
+ transac = tsip_transac_layer_new(
+ layer_transac,
+ isCT,
+ message,
+ dst
+ );
+ if(message->local_fd > 0 && TNET_SOCKET_TYPE_IS_STREAM(message->src_net_type)) {
+ tsip_dialog_set_connected_fd(newdialog, message->local_fd);
+ }
+ tsk_list_push_back_data(self->dialogs, (void**)&newdialog); /* add new dialog to the layer */
+ TSK_OBJECT_SAFE_FREE(dst);
+ }
+
+ /* The dialog will become the owner of the SIP session
+ * => when destoyed => SIP session will be destroyed, unless the user-end takes ownership() */
+ TSK_OBJECT_SAFE_FREE(ss);
+ }
+ }
+
+ if(transac) {
+ ret = tsip_transac_start(transac, message);
+ tsk_object_unref(transac);
+ }
+ /* - No transaction match for the SIP request
+ - ACK do not expect any response (http://code.google.com/p/imsdroid/issues/detail?id=420)
+ */
+ else if(TSIP_MESSAGE_IS_REQUEST(message) && !TSIP_REQUEST_IS_ACK(message)) {
+ const tsip_transport_layer_t *layer;
+ tsip_response_t* response = tsk_null;
+ if(!dialog && cid_matched) {
+ dialog = tsip_dialog_layer_find_by_callid((tsip_dialog_layer_t *)self, message->Call_ID->value);
+ }
+
+ if((layer = self->stack->layer_transport)) {
+ if(cid_matched) { /* We are receiving our own message. */
+ response = tsip_response_new(482, "Loop Detected (Check your iFCs)", message);
+ if(response && !response->To->tag) { /* Early dialog? */
+ response->To->tag = tsk_strdup("doubango");
+ }
+ }
+ else {
+ switch(message->line.request.request_type) {
+ case tsip_OPTIONS: // Hacked to work on Tiscali IMS networks
+ case tsip_INFO:
+ response = tsip_response_new(405, "Method Not Allowed", message);
+ break;
+ default:
+ response = tsip_response_new(481, "Dialog/Transaction Does Not Exist", message);
+ break;
+ }
+ }
+ if(response) {
+ if(dialog && TSIP_DIALOG_GET_SS(dialog)) {
+ tsk_strupdate(&response->sigcomp_id, TSIP_DIALOG_GET_SS(dialog)->sigcomp_id);
+ }
+ ret = tsip_transport_layer_send(layer, response->firstVia ? response->firstVia->branch : "no-branch", response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ }
+
+ TSK_OBJECT_SAFE_FREE(dialog);
+ }
+
bail:
- return ret;
+ return ret;
}
@@ -733,44 +724,43 @@ bail:
//
static tsk_object_t* tsip_dialog_layer_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_layer_t *layer = self;
- if(layer){
- layer->stack = va_arg(*app, const tsip_stack_t *);
- layer->dialogs = tsk_list_create();
-
- tsk_safeobj_init(layer);
- }
- return self;
+ tsip_dialog_layer_t *layer = self;
+ if(layer) {
+ layer->stack = va_arg(*app, const tsip_stack_t *);
+ layer->dialogs = tsk_list_create();
+
+ tsk_safeobj_init(layer);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_layer_dtor(tsk_object_t * self)
-{
- tsip_dialog_layer_t *layer = self;
- if(layer){
- TSK_OBJECT_SAFE_FREE(layer->dialogs);
+{
+ tsip_dialog_layer_t *layer = self;
+ if(layer) {
+ TSK_OBJECT_SAFE_FREE(layer->dialogs);
- /* condwait */
- if(layer->shutdown.condwait){
- tsk_condwait_destroy(&layer->shutdown.condwait);
- }
+ /* condwait */
+ if(layer->shutdown.condwait) {
+ tsk_condwait_destroy(&layer->shutdown.condwait);
+ }
- tsk_safeobj_deinit(layer);
+ tsk_safeobj_deinit(layer);
- TSK_DEBUG_INFO("*** Dialog Layer destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** Dialog Layer destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_layer_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_dialog_layer_def_s =
-{
- sizeof(tsip_dialog_layer_t),
- tsip_dialog_layer_ctor,
- tsip_dialog_layer_dtor,
- tsip_dialog_layer_cmp,
+static const tsk_object_def_t tsip_dialog_layer_def_s = {
+ sizeof(tsip_dialog_layer_t),
+ tsip_dialog_layer_ctor,
+ tsip_dialog_layer_dtor,
+ tsip_dialog_layer_cmp,
};
const tsk_object_def_t *tsip_dialog_layer_def_t = &tsip_dialog_layer_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_message.c b/tinySIP/src/dialogs/tsip_dialog_message.c
index 9619eda..d3d4ad3 100755
--- a/tinySIP/src/dialogs/tsip_dialog_message.c
+++ b/tinySIP/src/dialogs/tsip_dialog_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -65,155 +65,150 @@ static int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_sendMESSAGE = tsip_atype_message_send,
- _fsm_action_accept = tsip_atype_accept,
- _fsm_action_reject = tsip_atype_reject,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_receiveMESSAGE = 0xFF,
- _fsm_action_1xx,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_300_to_699,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_sendMESSAGE = tsip_atype_message_send,
+ _fsm_action_accept = tsip_atype_accept,
+ _fsm_action_reject = tsip_atype_reject,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_receiveMESSAGE = 0xFF,
+ _fsm_action_1xx,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_300_to_699,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Sending,
- _fsm_state_Receiving,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Sending,
+ _fsm_state_Receiving,
+ _fsm_state_Terminated
}
_fsm_state_t;
static int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg){
- if(TSIP_MESSAGE_IS_RESPONSE(msg)){
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
- }
- else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, action);
- }
- else{ /* Should never happen */
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
- }
- }
- else if (TSIP_REQUEST_IS_MESSAGE(msg)){ /* have been checked by dialog layer...but */
- // REQUEST ==> Incoming MESSAGE
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveMESSAGE, msg, tsk_null);
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, action);
+ }
+ else { /* Should never happen */
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
+ }
+ }
+ else if (TSIP_REQUEST_IS_MESSAGE(msg)) { /* have been checked by dialog layer...but */
+ // REQUEST ==> Incoming MESSAGE
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveMESSAGE, msg, tsk_null);
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
tsip_dialog_message_t* tsip_dialog_message_create(const tsip_ssession_handle_t* ss)
{
- return tsk_object_new(tsip_dialog_message_def_t, ss);
+ return tsk_object_new(tsip_dialog_message_def_t, ss);
}
int tsip_dialog_message_init(tsip_dialog_message_t *self)
{
- //const tsk_param_t* param;
-
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (send) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendMESSAGE, _fsm_state_Sending, tsip_dialog_message_Started_2_Sending_X_sendMESSAGE, "tsip_dialog_message_Started_2_Sending_X_sendMESSAGE"),
- // Started -> (receive) -> Receiving
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveMESSAGE, _fsm_state_Receiving, tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE, "tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_message_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Sending ===
- */
- // Sending -> (1xx) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_1xx, "tsip_dialog_message_Sending_2_Sending_X_1xx"),
- // Sending -> (2xx) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_2xx, "tsip_dialog_message_Sending_2_Terminated_X_2xx"),
- // Sending -> (401/407/421/494) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_message_Sending_2_Sending_X_401_407_421_494"),
- // Sending -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_300_to_699, "tsip_dialog_message_Sending_2_Terminated_X_300_to_699"),
- // Sending -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_cancel, "tsip_dialog_message_Sending_2_Terminated_X_cancel"),
- // Sending -> (shutdown) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_message_Sending_2_Terminated_X_shutdown"),
- // Sending -> (Any) -> Sending
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_message_Sending_2_Sending_X_any"),
-
- /*=======================
- * === Receiving ===
- */
- // Receiving -> (accept) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_accept, "tsip_dialog_message_Receiving_2_Terminated_X_accept"),
- // Receiving -> (rejected) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_reject, "tsip_dialog_message_Receiving_2_Terminated_X_reject"),
- // Receiving -> (Any) -> Receiving
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_message_Receiving_2_Receiving_X_any"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_transportError, "tsip_dialog_message_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_Error, "tsip_dialog_message_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_message_event_callback);
-
- return 0;
+ //const tsk_param_t* param;
+
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (send) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendMESSAGE, _fsm_state_Sending, tsip_dialog_message_Started_2_Sending_X_sendMESSAGE, "tsip_dialog_message_Started_2_Sending_X_sendMESSAGE"),
+ // Started -> (receive) -> Receiving
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveMESSAGE, _fsm_state_Receiving, tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE, "tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_message_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Sending ===
+ */
+ // Sending -> (1xx) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_1xx, "tsip_dialog_message_Sending_2_Sending_X_1xx"),
+ // Sending -> (2xx) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_2xx, "tsip_dialog_message_Sending_2_Terminated_X_2xx"),
+ // Sending -> (401/407/421/494) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_message_Sending_2_Sending_X_401_407_421_494"),
+ // Sending -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_300_to_699, "tsip_dialog_message_Sending_2_Terminated_X_300_to_699"),
+ // Sending -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_cancel, "tsip_dialog_message_Sending_2_Terminated_X_cancel"),
+ // Sending -> (shutdown) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_message_Sending_2_Terminated_X_shutdown"),
+ // Sending -> (Any) -> Sending
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_message_Sending_2_Sending_X_any"),
+
+ /*=======================
+ * === Receiving ===
+ */
+ // Receiving -> (accept) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_accept, "tsip_dialog_message_Receiving_2_Terminated_X_accept"),
+ // Receiving -> (rejected) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_reject, "tsip_dialog_message_Receiving_2_Terminated_X_reject"),
+ // Receiving -> (Any) -> Receiving
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_message_Receiving_2_Receiving_X_any"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_transportError, "tsip_dialog_message_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_Error, "tsip_dialog_message_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_message_event_callback);
+
+ return 0;
}
@@ -226,216 +221,216 @@ int tsip_dialog_message_init(tsip_dialog_message_t *self)
*/
int tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(va_list *app)
{
- tsip_dialog_message_t *self;
+ tsip_dialog_message_t *self;
- self = va_arg(*app, tsip_dialog_message_t *);
+ self = va_arg(*app, tsip_dialog_message_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- return send_MESSAGE(self);
+ return send_MESSAGE(self);
}
/* Started -> (recvMESSAGE) -> Receiving
*/
int tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(va_list *app)
{
- tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
-
- /* Alert the user. */
- TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_i_message,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
-
- /* Update last incoming MESSAGE */
- TSK_OBJECT_SAFE_FREE(self->request);
- self->request = tsk_object_ref((void*)request);
-
- return 0;
+ tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+
+ /* Alert the user. */
+ TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_i_message,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+
+ /* Update last incoming MESSAGE */
+ TSK_OBJECT_SAFE_FREE(self->request);
+ self->request = tsk_object_ref((void*)request);
+
+ return 0;
}
/* Sending -> (1xx) -> Sending
*/
int tsip_dialog_message_Sending_2_Sending_X_1xx(va_list *app)
{
- /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+ /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
- return 0;
+ return 0;
}
/* Sending -> (2xx) -> Sending
*/
int tsip_dialog_message_Sending_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Reset curr action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+ /* Reset curr action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
- return 0;
+ return 0;
}
/* Sending -> (401/407/421/494) -> Sending
*/
int tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(va_list *app)
{
- tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- // Alert the user
- TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- return send_MESSAGE(self);
+ tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ // Alert the user
+ TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return ret;
+ }
+
+ return send_MESSAGE(self);
}
/* Sending -> (300 to 699) -> Terminated
*/
int tsip_dialog_message_Sending_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
- /* Alert the user. */
- TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Sending -> (cancel) -> Terminated
*/
int tsip_dialog_message_Sending_2_Terminated_X_cancel(va_list *app)
{
- tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
- /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
+ tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
+ /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "MESSAGE cancelled");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "MESSAGE cancelled");
- return 0;
+ return 0;
}
/* Receiving -> (accept) -> Terminated
*/
int tsip_dialog_message_Receiving_2_Terminated_X_accept(va_list *app)
{
- tsip_dialog_message_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_message_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->request){
- TSK_DEBUG_ERROR("There is non MESSAGE to accept()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 200 OK */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->request))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_message_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_message_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->request) {
+ TSK_DEBUG_ERROR("There is non MESSAGE to accept()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 200 OK */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->request))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Receiving -> (reject) -> Terminated
*/
int tsip_dialog_message_Receiving_2_Terminated_X_reject(va_list *app)
{
- tsip_dialog_message_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_message_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->request){
- TSK_DEBUG_ERROR("There is non MESSAGE to reject()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 486 Rejected */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->request))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_message_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_message_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->request) {
+ TSK_DEBUG_ERROR("There is non MESSAGE to reject()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 486 Rejected */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->request))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_message_Any_2_Terminated_X_transportError(va_list *app)
{
- /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
/* Any -> (error) -> Terminated
*/
int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app)
{
- /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -444,39 +439,39 @@ int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app)
int send_MESSAGE(tsip_dialog_message_t *self)
{
- tsip_request_t* request = tsk_null;
- int ret = -1;
+ tsip_request_t* request = tsk_null;
+ int ret = -1;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "MESSAGE"))){
- return -2;
- }
+ if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "MESSAGE"))) {
+ return -2;
+ }
- /* apply action params to the request */
- if(TSIP_DIALOG(self)->curr_action){
- tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
- }
+ /* apply action params to the request */
+ if(TSIP_DIALOG(self)->curr_action) {
+ tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
+ }
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- TSK_OBJECT_SAFE_FREE(request);
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ TSK_OBJECT_SAFE_FREE(request);
- return ret;
+ return ret;
}
int tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self)
{
- TSK_DEBUG_INFO("=== MESSAGE Dialog terminated ===");
+ TSK_DEBUG_INFO("=== MESSAGE Dialog terminated ===");
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -505,48 +500,47 @@ int tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self)
//
static tsk_object_t* tsip_dialog_message_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_message_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ tsip_dialog_message_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_MESSAGE, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_MESSAGE, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
- /* FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_message_OnTerminated), (const void*)dialog);
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_message_OnTerminated), (const void*)dialog);
- /* Initialize the class itself */
- tsip_dialog_message_init(self);
- }
- return self;
+ /* Initialize the class itself */
+ tsip_dialog_message_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_message_dtor(tsk_object_t * self)
-{
- tsip_dialog_message_t *dialog = self;
- if(dialog){
- /* DeInitialize base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
-
- /* DeInitialize self */
- TSK_OBJECT_SAFE_FREE(dialog->request);
-
- TSK_DEBUG_INFO("*** MESSAGE Dialog destroyed ***");
- }
- return self;
+{
+ tsip_dialog_message_t *dialog = self;
+ if(dialog) {
+ /* DeInitialize base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
+
+ /* DeInitialize self */
+ TSK_OBJECT_SAFE_FREE(dialog->request);
+
+ TSK_DEBUG_INFO("*** MESSAGE Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_message_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_message_def_s =
-{
- sizeof(tsip_dialog_message_t),
- tsip_dialog_message_ctor,
- tsip_dialog_message_dtor,
- tsip_dialog_message_cmp,
+static const tsk_object_def_t tsip_dialog_message_def_s = {
+ sizeof(tsip_dialog_message_t),
+ tsip_dialog_message_ctor,
+ tsip_dialog_message_dtor,
+ tsip_dialog_message_cmp,
};
const tsk_object_def_t *tsip_dialog_message_def_t = &tsip_dialog_message_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_options.c b/tinySIP/src/dialogs/tsip_dialog_options.c
index 135be69..b0a5dbc 100755
--- a/tinySIP/src/dialogs/tsip_dialog_options.c
+++ b/tinySIP/src/dialogs/tsip_dialog_options.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -66,153 +66,148 @@ static int tsip_dialog_options_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_sendOPTIONS = tsip_atype_options_send,
- _fsm_action_accept = tsip_atype_accept,
- _fsm_action_reject = tsip_atype_reject,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_receiveOPTIONS = 0xFF,
- _fsm_action_1xx,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_300_to_699,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_sendOPTIONS = tsip_atype_options_send,
+ _fsm_action_accept = tsip_atype_accept,
+ _fsm_action_reject = tsip_atype_reject,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_receiveOPTIONS = 0xFF,
+ _fsm_action_1xx,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_300_to_699,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Sending,
- _fsm_state_Receiving,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Sending,
+ _fsm_state_Receiving,
+ _fsm_state_Terminated
}
_fsm_state_t;
int tsip_dialog_options_event_callback(const tsip_dialog_options_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg){
- if(TSIP_MESSAGE_IS_RESPONSE(msg)){
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
- }
- else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, action);
- }
- else{ /* should never happen */
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
- }
- }
- else if (TSIP_REQUEST_IS_OPTIONS(msg)){ /* have been checked by dialog layer...but */
- // REQUEST ==> Incoming OPTIONS
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveOPTIONS, msg, tsk_null);
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_CODE(msg) == 401 || TSIP_RESPONSE_CODE(msg) == 407 || TSIP_RESPONSE_CODE(msg) == 421 || TSIP_RESPONSE_CODE(msg) == 494) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_300_to_699, msg, action);
+ }
+ else { /* should never happen */
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
+ }
+ }
+ else if (TSIP_REQUEST_IS_OPTIONS(msg)) { /* have been checked by dialog layer...but */
+ // REQUEST ==> Incoming OPTIONS
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_receiveOPTIONS, msg, tsk_null);
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
tsip_dialog_options_t* tsip_dialog_options_create(const tsip_ssession_handle_t* ss)
{
- return tsk_object_new(tsip_dialog_options_def_t, ss);
+ return tsk_object_new(tsip_dialog_options_def_t, ss);
}
int tsip_dialog_options_init(tsip_dialog_options_t *self)
{
- //const tsk_param_t* param;
-
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (send) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendOPTIONS, _fsm_state_Sending, tsip_dialog_options_Started_2_Sending_X_sendOPTIONS, "tsip_dialog_options_Started_2_Sending_X_sendOPTIONS"),
- // Started -> (receive) -> Receiving
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveOPTIONS, _fsm_state_Receiving, tsip_dialog_options_Started_2_Receiving_X_recvOPTIONS, "tsip_dialog_options_Started_2_Receiving_X_recvOPTIONS"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_options_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Sending ===
- */
- // Sending -> (1xx) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_options_Sending_2_Sending_X_1xx, "tsip_dialog_options_Sending_2_Sending_X_1xx"),
- // Sending -> (2xx) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_2xx, "tsip_dialog_options_Sending_2_Terminated_X_2xx"),
- // Sending -> (401/407/421/494) -> Sending
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_options_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_options_Sending_2_Sending_X_401_407_421_494"),
- // Sending -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_300_to_699, "tsip_dialog_options_Sending_2_Terminated_X_300_to_699"),
- // Sending -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_cancel, "tsip_dialog_options_Sending_2_Terminated_X_cancel"),
- // Sending -> (Any) -> Sending
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_options_Sending_2_Sending_X_any"),
-
- /*=======================
- * === Receiving ===
- */
- // Receiving -> (accept) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_options_Receiving_2_Terminated_X_accept, "tsip_dialog_options_Receiving_2_Terminated_X_accept"),
- // Receiving -> (rejected) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_options_Receiving_2_Terminated_X_reject, "tsip_dialog_options_Receiving_2_Terminated_X_reject"),
- // Receiving -> (Any) -> Receiving
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_options_Receiving_2_Receiving_X_any"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_options_Any_2_Terminated_X_transportError, "tsip_dialog_options_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_options_Any_2_Terminated_X_Error, "tsip_dialog_options_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_options_event_callback);
-
- return 0;
+ //const tsk_param_t* param;
+
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (send) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendOPTIONS, _fsm_state_Sending, tsip_dialog_options_Started_2_Sending_X_sendOPTIONS, "tsip_dialog_options_Started_2_Sending_X_sendOPTIONS"),
+ // Started -> (receive) -> Receiving
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveOPTIONS, _fsm_state_Receiving, tsip_dialog_options_Started_2_Receiving_X_recvOPTIONS, "tsip_dialog_options_Started_2_Receiving_X_recvOPTIONS"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_options_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Sending ===
+ */
+ // Sending -> (1xx) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_options_Sending_2_Sending_X_1xx, "tsip_dialog_options_Sending_2_Sending_X_1xx"),
+ // Sending -> (2xx) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_2xx, "tsip_dialog_options_Sending_2_Terminated_X_2xx"),
+ // Sending -> (401/407/421/494) -> Sending
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_options_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_options_Sending_2_Sending_X_401_407_421_494"),
+ // Sending -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_300_to_699, "tsip_dialog_options_Sending_2_Terminated_X_300_to_699"),
+ // Sending -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_options_Sending_2_Terminated_X_cancel, "tsip_dialog_options_Sending_2_Terminated_X_cancel"),
+ // Sending -> (Any) -> Sending
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_options_Sending_2_Sending_X_any"),
+
+ /*=======================
+ * === Receiving ===
+ */
+ // Receiving -> (accept) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_options_Receiving_2_Terminated_X_accept, "tsip_dialog_options_Receiving_2_Terminated_X_accept"),
+ // Receiving -> (rejected) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_options_Receiving_2_Terminated_X_reject, "tsip_dialog_options_Receiving_2_Terminated_X_reject"),
+ // Receiving -> (Any) -> Receiving
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_options_Receiving_2_Receiving_X_any"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_options_Any_2_Terminated_X_transportError, "tsip_dialog_options_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_options_Any_2_Terminated_X_Error, "tsip_dialog_options_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_options_event_callback);
+
+ return 0;
}
@@ -225,217 +220,217 @@ int tsip_dialog_options_init(tsip_dialog_options_t *self)
*/
int tsip_dialog_options_Started_2_Sending_X_sendOPTIONS(va_list *app)
{
- tsip_dialog_options_t *self;
+ tsip_dialog_options_t *self;
- self = va_arg(*app, tsip_dialog_options_t *);
+ self = va_arg(*app, tsip_dialog_options_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
- return send_OPTIONS(self);
+ return send_OPTIONS(self);
}
/* Started -> (recvOPTIONS) -> Receiving
*/
int tsip_dialog_options_Started_2_Receiving_X_recvOPTIONS(va_list *app)
{
- tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- /* Update last incoming MESSAGE */
- TSK_OBJECT_SAFE_FREE(self->last_iMessage);
- self->last_iMessage = tsk_object_ref((void*)request);
+ /* Update last incoming MESSAGE */
+ TSK_OBJECT_SAFE_FREE(self->last_iMessage);
+ self->last_iMessage = tsk_object_ref((void*)request);
- /* Alert the user. */
- TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_i_options,
- tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
+ /* Alert the user. */
+ TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_i_options,
+ tsip_event_code_dialog_request_incoming, "Incoming Request.", request);
- return 0;
+ return 0;
}
/* Sending -> (1xx) -> Sending
*/
int tsip_dialog_options_Sending_2_Sending_X_1xx(va_list *app)
{
- /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+ /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
- return 0;
+ return 0;
}
/* Sending -> (2xx) -> Sending
*/
int tsip_dialog_options_Sending_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Reset curr action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+ /* Reset curr action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
- return 0;
+ return 0;
}
/* Sending -> (401/407/421/494) -> Sending
*/
int tsip_dialog_options_Sending_2_Sending_X_401_407_421_494(va_list *app)
{
- tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- /* Alert the user. */
- TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- return send_OPTIONS(self);
+ tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ /* Alert the user. */
+ TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return ret;
+ }
+
+ return send_OPTIONS(self);
}
/* Sending -> (300 to 699) -> Terminated
*/
int tsip_dialog_options_Sending_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_OPTIONS_SIGNAL(self, tsip_ao_options,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Sending -> (cancel) -> Terminated
*/
int tsip_dialog_options_Sending_2_Terminated_X_cancel(va_list *app)
{
- int ret;
+ int ret;
- tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
- /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
+ tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);
+ /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "OPTIONS cancelled");
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "OPTIONS cancelled");
- return ret;
+ return ret;
}
/* Receiving -> (accept) -> Terminated
*/
int tsip_dialog_options_Receiving_2_Terminated_X_accept(va_list *app)
{
- tsip_dialog_options_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_options_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->last_iMessage){
- TSK_DEBUG_ERROR("There is non OPTIONS to accept()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 200 OK */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->last_iMessage))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_options_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_options_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->last_iMessage) {
+ TSK_DEBUG_ERROR("There is non OPTIONS to accept()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 200 OK */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", self->last_iMessage))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Receiving -> (reject) -> Terminated
*/
int tsip_dialog_options_Receiving_2_Terminated_X_reject(va_list *app)
{
- tsip_dialog_options_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_options_t *);
- va_arg(*app, tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- if(!self->last_iMessage){
- TSK_DEBUG_ERROR("There is non OPTIONS to reject()");
- /* Not an error ...but do not update current action */
- }
- else{
- tsip_response_t *response;
- int ret;
-
- /* curr_action is only used for outgoing requests */
- /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
-
- /* send 486 Rejected */
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->last_iMessage))){
- tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
- if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))){
- TSK_DEBUG_ERROR("Failed to send SIP response.");
- TSK_OBJECT_SAFE_FREE(response);
- return ret;
- }
- TSK_OBJECT_SAFE_FREE(response);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create SIP response.");
- return -1;
- }
- }
-
- return 0;
+ tsip_dialog_options_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_options_t *);
+ va_arg(*app, tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ if(!self->last_iMessage) {
+ TSK_DEBUG_ERROR("There is non OPTIONS to reject()");
+ /* Not an error ...but do not update current action */
+ }
+ else {
+ tsip_response_t *response;
+ int ret;
+
+ /* curr_action is only used for outgoing requests */
+ /* tsip_dialog_set_curr_action(TSIP_DIALOG(self), action); */
+
+ /* send 486 Rejected */
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 486, "Rejected", self->last_iMessage))) {
+ tsip_dialog_apply_action(response, action); /* apply action params to "this" response */
+ if((ret = tsip_dialog_response_send(TSIP_DIALOG(self), response))) {
+ TSK_DEBUG_ERROR("Failed to send SIP response.");
+ TSK_OBJECT_SAFE_FREE(response);
+ return ret;
+ }
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create SIP response.");
+ return -1;
+ }
+ }
+
+ return 0;
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_options_Any_2_Terminated_X_transportError(va_list *app)
{
- /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
/* Any -> (error) -> Terminated
*/
int tsip_dialog_options_Any_2_Terminated_X_Error(va_list *app)
{
- /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ /*tsip_dialog_options_t *self = va_arg(*app, tsip_dialog_options_t *);*/
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- return 0;
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -444,64 +439,64 @@ int tsip_dialog_options_Any_2_Terminated_X_Error(va_list *app)
int send_OPTIONS(tsip_dialog_options_t *self)
{
- tsip_request_t* request = tsk_null;
- int ret = -1;
-
- if(!self){
- return -1;
- }
-
- if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "OPTIONS"))){
- return -2;
- }
-
- /* action parameters and payload*/
- if(TSIP_DIALOG(self)->curr_action){
- const tsk_list_item_t* item;
- tsk_list_foreach(item, TSIP_DIALOG(self)->curr_action->headers){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- if(TSIP_DIALOG(self)->curr_action->payload){
- tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(TSIP_DIALOG(self)->curr_action->payload), TSK_BUFFER_SIZE(TSIP_DIALOG(self)->curr_action->payload));
- }
- }
-
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- TSK_OBJECT_SAFE_FREE(request);
-
- return ret;
+ tsip_request_t* request = tsk_null;
+ int ret = -1;
+
+ if(!self) {
+ return -1;
+ }
+
+ if(!(request = tsip_dialog_request_new(TSIP_DIALOG(self), "OPTIONS"))) {
+ return -2;
+ }
+
+ /* action parameters and payload*/
+ if(TSIP_DIALOG(self)->curr_action) {
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, TSIP_DIALOG(self)->curr_action->headers) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ if(TSIP_DIALOG(self)->curr_action->payload) {
+ tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(TSIP_DIALOG(self)->curr_action->payload), TSK_BUFFER_SIZE(TSIP_DIALOG(self)->curr_action->payload));
+ }
+ }
+
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ TSK_OBJECT_SAFE_FREE(request);
+
+ return ret;
}
int send_response(tsip_dialog_options_t *self, short status, const char* phrase, const tsip_request_t *request)
{
- tsip_response_t *response;
- int ret = -1;
-
- response = tsip_dialog_response_new(TSIP_DIALOG(self), status, phrase, request);
- if(response){
- if(response->To && !response->To->tag){
- tsk_istr_t tag;
- tsk_strrandom(&tag);
- response->To->tag = tsk_strdup(tag);
- }
- ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
-
- return ret;
+ tsip_response_t *response;
+ int ret = -1;
+
+ response = tsip_dialog_response_new(TSIP_DIALOG(self), status, phrase, request);
+ if(response) {
+ if(response->To && !response->To->tag) {
+ tsk_istr_t tag;
+ tsk_strrandom(&tag);
+ response->To->tag = tsk_strdup(tag);
+ }
+ ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+
+ return ret;
}
int tsip_dialog_options_OnTerminated(tsip_dialog_options_t *self)
{
- TSK_DEBUG_INFO("=== OPTIONS Dialog terminated ===");
+ TSK_DEBUG_INFO("=== OPTIONS Dialog terminated ===");
- /* alert user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
+ /* alert user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -530,49 +525,48 @@ int tsip_dialog_options_OnTerminated(tsip_dialog_options_t *self)
//
static tsk_object_t* tsip_dialog_options_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_options_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ tsip_dialog_options_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_OPTIONS, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_OPTIONS, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
- /* FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_options_OnTerminated), (const void*)dialog);
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_options_OnTerminated), (const void*)dialog);
- /* Initialize the class itself */
- tsip_dialog_options_init(self);
- }
- return self;
+ /* Initialize the class itself */
+ tsip_dialog_options_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_options_dtor(tsk_object_t * self)
-{
- tsip_dialog_options_t *dialog = self;
- if(dialog){
+{
+ tsip_dialog_options_t *dialog = self;
+ if(dialog) {
- /* DeInitialize base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
+ /* DeInitialize base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
- /* DeInitialize self */
- TSK_OBJECT_SAFE_FREE(dialog->last_iMessage);
+ /* DeInitialize self */
+ TSK_OBJECT_SAFE_FREE(dialog->last_iMessage);
- TSK_DEBUG_INFO("*** OPTIONS Dialog destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** OPTIONS Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_options_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_options_def_s =
-{
- sizeof(tsip_dialog_options_t),
- tsip_dialog_options_ctor,
- tsip_dialog_options_dtor,
- tsip_dialog_options_cmp,
+static const tsk_object_def_t tsip_dialog_options_def_s = {
+ sizeof(tsip_dialog_options_t),
+ tsip_dialog_options_ctor,
+ tsip_dialog_options_dtor,
+ tsip_dialog_options_cmp,
};
const tsk_object_def_t *tsip_dialog_options_def_t = &tsip_dialog_options_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_publish.client.c b/tinySIP/src/dialogs/tsip_dialog_publish.client.c
index aa22737..3534119 100755
--- a/tinySIP/src/dialogs/tsip_dialog_publish.client.c
+++ b/tinySIP/src/dialogs/tsip_dialog_publish.client.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -71,51 +71,49 @@ static int tsip_dialog_publish_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_unpublishing(tsip_dialog_publish_t* dialog, tsip_message_t* message)
{
- return dialog->unpublishing;
+ return dialog->unpublishing;
}
static tsk_bool_t _fsm_cond_publishing(tsip_dialog_publish_t* dialog, tsip_message_t* message)
{
- return !_fsm_cond_unpublishing(dialog, message);
+ return !_fsm_cond_unpublishing(dialog, message);
}
static tsk_bool_t _fsm_cond_silent_hangup(tsip_dialog_publish_t* dialog, tsip_message_t* message)
{
- return TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return TSIP_DIALOG(dialog)->ss->silent_hangup;
}
static tsk_bool_t _fsm_cond_not_silent_hangup(tsip_dialog_publish_t* dialog, tsip_message_t* message)
{
- return !TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return !TSIP_DIALOG(dialog)->ss->silent_hangup;
}
#define _fsm_cond_silent_shutdown _fsm_cond_silent_hangup
#define _fsm_cond_not_silent_shutdown _fsm_cond_not_silent_hangup
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_publish = tsip_atype_publish,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_hangup = tsip_atype_unpublish,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_1xx = 0xFF,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_423,
- _fsm_action_300_to_699,
- _fsm_action_shutdown_timedout, /* Any -> Terminated */
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_publish = tsip_atype_publish,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_hangup = tsip_atype_unpublish,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_1xx = 0xFF,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_423,
+ _fsm_action_300_to_699,
+ _fsm_action_shutdown_timedout, /* Any -> Terminated */
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Trying,
- _fsm_state_Connected,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Trying,
+ _fsm_state_Connected,
+ _fsm_state_Terminated
}
_fsm_state_t;
@@ -124,182 +122,178 @@ _fsm_state_t;
* Callback function called to alert the dialog for new events from the transaction/transport layers.
*
* @param [in,out] self A reference to the dialog.
- * @param type The event type.
- * @param [in,out] msg The incoming SIP/IMS message.
+ * @param type The event type.
+ * @param [in,out] msg The incoming SIP/IMS message.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_publish_event_callback(const tsip_dialog_publish_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)){
- //
- // RESPONSE
- //
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,423)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
- }
- else{
- // Alert User
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
- /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
- }
- }
- else{
- //
- // REQUEST
- //
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ //
+ // RESPONSE
+ //
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,423)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
+ }
+ else {
+ // Alert User
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
+ /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
+ }
+ }
+ else {
+ //
+ // REQUEST
+ //
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
/**
* Timer manager callback.
*
- * @param [in,out] self The owner of the signaled timer.
+ * @param [in,out] self The owner of the signaled timer.
* @param timer_id The identifier of the signaled timer.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_publish_timer_callback(const tsip_dialog_publish_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self)
- {
- if(timer_id == self->timerrefresh.id){
- tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_publish, tsk_null, tsk_null);
- ret = 0;
- }
- else if(timer_id == self->timershutdown.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, tsk_null, tsk_null);
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self) {
+ if(timer_id == self->timerrefresh.id) {
+ tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_publish, tsk_null, tsk_null);
+ ret = 0;
+ }
+ else if(timer_id == self->timershutdown.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, tsk_null, tsk_null);
+ }
+ }
+ return ret;
}
tsip_dialog_publish_t* tsip_dialog_publish_create(const tsip_ssession_handle_t* ss)
{
- return tsk_object_new(tsip_dialog_publish_def_t, ss);
+ return tsk_object_new(tsip_dialog_publish_def_t, ss);
}
/**
* Initializes the dialog.
*
- * @param [in,out] self The dialog to initialize.
+ * @param [in,out] self The dialog to initialize.
**/
int tsip_dialog_publish_init(tsip_dialog_publish_t *self)
-{
- /* Initialize the State Machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (PUBLISH) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_publish, _fsm_state_Trying, tsip_dialog_publish_Started_2_Trying_X_publish, "tsip_dialog_publish_Started_2_Trying_X_publish"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_publish_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Trying ===
- */
- // Trying -> (1xx) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_1xx, "tsip_dialog_publish_Trying_2_Trying_X_1xx"),
- // Trying -> (2xx) -> Terminated
- TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_unpublishing, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_2xx, "tsip_dialog_publish_Trying_2_Terminated_X_2xx"),
- // Trying -> (2xx) -> Connected
- TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_publishing, _fsm_state_Connected, tsip_dialog_publish_Trying_2_Connected_X_2xx, "tsip_dialog_publish_Trying_2_Connected_X_2xx"),
- // Trying -> (401/407/421/494) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_401_407_421_494, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_401_407_421_494, "tsip_dialog_publish_Trying_2_Trying_X_401_407_421_494"),
- // Trying -> (423) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_423, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_423, "tsip_dialog_publish_Trying_2_Trying_X_423"),
- // Trying -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_300_to_699, "tsip_dialog_publish_Trying_2_Terminated_X_300_to_699"),
- // Trying -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_cancel, "tsip_dialog_publish_Trying_2_Terminated_X_cancel"),
- // Trying -> (hangup) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Trying_2_Terminated_X_hangup"),
- // Trying -> (shutdown) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Trying_2_Terminated_X_shutdown"),
- // Trying -> (Any) -> Trying
- // TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Trying, "tsip_dialog_publish_Trying_2_Trying_X_any"),
-
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (PUBLISH) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_publish, _fsm_state_Trying, tsip_dialog_publish_Connected_2_Trying_X_publish, "tsip_dialog_publish_Connected_2_Trying_X_publish"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_publish_Any_2_Terminated_X_transportError, "tsip_dialog_publish_Any_2_Terminated_X_transportError"),
- // Any -> (error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_publish_Any_2_Terminated_X_Error, "tsip_dialog_publish_Any_2_Terminated_X_Error"),
- // Any -> (hangup) -> Trying
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_Trying, tsip_dialog_publish_Any_2_Trying_X_hangup, "tsip_dialog_publish_Any_2_Trying_X_hangup"),
- // Any -> (silenthangup) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Any_2_Trying_X_silenthangup"),
- // Any -> (shutdown) -> Trying
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_Trying, tsip_dialog_publish_Any_2_Trying_X_shutdown, "tsip_dialog_publish_Any_2_Trying_X_shutdown"),
- // Any -> (silentshutdown) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_publishe_Any_2_Trying_X_silentshutdown"),
- // Any -> (shutdown timedout) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_shutdown_timedout"),
-
- TSK_FSM_ADD_NULL());
-
- /* Sets callback function */
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_publish_event_callback);
-
- /* Timers */
- self->timerrefresh.id = TSK_INVALID_TIMER_ID;
- self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
- self->timershutdown.id = TSK_INVALID_TIMER_ID;
- self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
-
- return 0;
+{
+ /* Initialize the State Machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (PUBLISH) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_publish, _fsm_state_Trying, tsip_dialog_publish_Started_2_Trying_X_publish, "tsip_dialog_publish_Started_2_Trying_X_publish"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_publish_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Trying ===
+ */
+ // Trying -> (1xx) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_1xx, "tsip_dialog_publish_Trying_2_Trying_X_1xx"),
+ // Trying -> (2xx) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_unpublishing, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_2xx, "tsip_dialog_publish_Trying_2_Terminated_X_2xx"),
+ // Trying -> (2xx) -> Connected
+ TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_publishing, _fsm_state_Connected, tsip_dialog_publish_Trying_2_Connected_X_2xx, "tsip_dialog_publish_Trying_2_Connected_X_2xx"),
+ // Trying -> (401/407/421/494) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_401_407_421_494, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_401_407_421_494, "tsip_dialog_publish_Trying_2_Trying_X_401_407_421_494"),
+ // Trying -> (423) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_423, _fsm_state_Trying, tsip_dialog_publish_Trying_2_Trying_X_423, "tsip_dialog_publish_Trying_2_Trying_X_423"),
+ // Trying -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_300_to_699, "tsip_dialog_publish_Trying_2_Terminated_X_300_to_699"),
+ // Trying -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_publish_Trying_2_Terminated_X_cancel, "tsip_dialog_publish_Trying_2_Terminated_X_cancel"),
+ // Trying -> (hangup) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Trying_2_Terminated_X_hangup"),
+ // Trying -> (shutdown) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Trying_2_Terminated_X_shutdown"),
+ // Trying -> (Any) -> Trying
+ // TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Trying, "tsip_dialog_publish_Trying_2_Trying_X_any"),
+
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (PUBLISH) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_publish, _fsm_state_Trying, tsip_dialog_publish_Connected_2_Trying_X_publish, "tsip_dialog_publish_Connected_2_Trying_X_publish"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_publish_Any_2_Terminated_X_transportError, "tsip_dialog_publish_Any_2_Terminated_X_transportError"),
+ // Any -> (error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_publish_Any_2_Terminated_X_Error, "tsip_dialog_publish_Any_2_Terminated_X_Error"),
+ // Any -> (hangup) -> Trying
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_Trying, tsip_dialog_publish_Any_2_Trying_X_hangup, "tsip_dialog_publish_Any_2_Trying_X_hangup"),
+ // Any -> (silenthangup) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_Any_2_Trying_X_silenthangup"),
+ // Any -> (shutdown) -> Trying
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_Trying, tsip_dialog_publish_Any_2_Trying_X_shutdown, "tsip_dialog_publish_Any_2_Trying_X_shutdown"),
+ // Any -> (silentshutdown) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_publishe_Any_2_Trying_X_silentshutdown"),
+ // Any -> (shutdown timedout) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_publish_shutdown_timedout"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Sets callback function */
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_publish_event_callback);
+
+ /* Timers */
+ self->timerrefresh.id = TSK_INVALID_TIMER_ID;
+ self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
+ self->timershutdown.id = TSK_INVALID_TIMER_ID;
+ self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
+
+ return 0;
}
//--------------------------------------------------------
@@ -311,246 +305,246 @@ int tsip_dialog_publish_init(tsip_dialog_publish_t *self)
*/
int tsip_dialog_publish_Started_2_Trying_X_publish(va_list *app)
{
- tsip_dialog_publish_t *self;
+ tsip_dialog_publish_t *self;
- self = va_arg(*app, tsip_dialog_publish_t *);
+ self = va_arg(*app, tsip_dialog_publish_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
- return send_PUBLISH(self);
+ return send_PUBLISH(self);
}
/* Trying -> (1xx) -> Trying
*/
int tsip_dialog_publish_Trying_2_Trying_X_1xx(va_list *app)
{
- /*tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+ /*tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
- return 0;
+ return 0;
}
/* Trying -> (2xx) -> Terminated
*/
int tsip_dialog_publish_Trying_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Trying -> (2xx) -> Connected
*/
int tsip_dialog_publish_Trying_2_Connected_X_2xx(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
-
- /* RFC 3903 - 4.1. Identification of Published Event State
- For each successful PUBLISH request, the ESC will generate and assign
- an entity-tag and return it in the SIP-ETag header field of the 2xx
- response.
- */
- const tsip_header_SIP_ETag_t *SIP_ETag;
- if((SIP_ETag = (const tsip_header_SIP_ETag_t*)tsip_message_get_header(response, tsip_htype_SIP_ETag))){
- tsk_strupdate(&self->etag, SIP_ETag->value);
- }
-
- /* Alert the user (session)*/
- TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Alert the user (dialog)*/
- if(first_time_to_connect){ /* PUBLISH not dialog oriented ...but */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
- }
-
- /* Update the dialog state */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- return ret;
- }
-
- /* Reset current action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
-
- /* Request timeout for dialog refresh (re-publish). */
- self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
- TSIP_DIALOG_PUBLISH_TIMER_SCHEDULE(refresh);
-
- return 0;
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
+
+ /* RFC 3903 - 4.1. Identification of Published Event State
+ For each successful PUBLISH request, the ESC will generate and assign
+ an entity-tag and return it in the SIP-ETag header field of the 2xx
+ response.
+ */
+ const tsip_header_SIP_ETag_t *SIP_ETag;
+ if((SIP_ETag = (const tsip_header_SIP_ETag_t*)tsip_message_get_header(response, tsip_htype_SIP_ETag))) {
+ tsk_strupdate(&self->etag, SIP_ETag->value);
+ }
+
+ /* Alert the user (session)*/
+ TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user (dialog)*/
+ if(first_time_to_connect) { /* PUBLISH not dialog oriented ...but */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+ }
+
+ /* Update the dialog state */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ return ret;
+ }
+
+ /* Reset current action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+
+ /* Request timeout for dialog refresh (re-publish). */
+ self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
+ TSIP_DIALOG_PUBLISH_TIMER_SCHEDULE(refresh);
+
+ return 0;
}
/* Trying -> (401/407/421/494) -> Trying
*/
int tsip_dialog_publish_Trying_2_Trying_X_401_407_421_494(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- /* Alert the user. */
- TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- return send_PUBLISH(self);
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ /* Alert the user. */
+ TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return ret;
+ }
+
+ return send_PUBLISH(self);
}
/* Trying -> (423) -> Trying
*/
int tsip_dialog_publish_Trying_2_Trying_X_423(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- tsip_header_Min_Expires_t *hdr;
-
- /*
- RFC 3261 - 10.2.8 Error Responses
-
- If a UA receives a 423 (Interval Too Brief) response, it MAY retry
- the registration after making the expiration interval of all contact
- addresses in the PUBLISH request equal to or greater than the
- expiration interval within the Min-Expires header field of the 423
- (Interval Too Brief) response.
- */
- hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(response, tsip_htype_Min_Expires);
- if(hdr){
- TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
- send_PUBLISH(self);
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_message_error, "Received invalid SIP response");
-
- return -1;
- }
-
- return 0;
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ tsip_header_Min_Expires_t *hdr;
+
+ /*
+ RFC 3261 - 10.2.8 Error Responses
+
+ If a UA receives a 423 (Interval Too Brief) response, it MAY retry
+ the registration after making the expiration interval of all contact
+ addresses in the PUBLISH request equal to or greater than the
+ expiration interval within the Min-Expires header field of the 423
+ (Interval Too Brief) response.
+ */
+ hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(response, tsip_htype_Min_Expires);
+ if(hdr) {
+ TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
+ send_PUBLISH(self);
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_message_error, "Received invalid SIP response");
+
+ return -1;
+ }
+
+ return 0;
}
/* Trying -> (300 to 699) -> Terminated
*/
int tsip_dialog_publish_Trying_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response));
- /* Alert the user. */
- TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Trying -> (cancel) -> Terminated
*/
int tsip_dialog_publish_Trying_2_Terminated_X_cancel(va_list *app)
{
- int ret;
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
+ int ret;
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Subscription cancelled");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Subscription cancelled");
- return ret;
+ return ret;
}
/* Connected -> (PUBLISH) -> Trying
*/
int tsip_dialog_publish_Connected_2_Trying_X_publish(va_list *app)
{
- tsip_dialog_publish_t *self;
+ tsip_dialog_publish_t *self;
- self = va_arg(*app, tsip_dialog_publish_t *);
+ self = va_arg(*app, tsip_dialog_publish_t *);
- return send_PUBLISH(self);
+ return send_PUBLISH(self);
}
/* Connected -> (hangup) -> Trying
*/
int tsip_dialog_publish_Any_2_Trying_X_hangup(va_list *app)
{
- tsip_dialog_publish_t *self;
+ tsip_dialog_publish_t *self;
+
+ self = va_arg(*app, tsip_dialog_publish_t *);
- self = va_arg(*app, tsip_dialog_publish_t *);
-
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- self->unpublishing = tsk_true;
- return send_PUBLISH(self);
+ self->unpublishing = tsk_true;
+ return send_PUBLISH(self);
}
/* Any -> (shutdown) -> Trying
*/
int tsip_dialog_publish_Any_2_Trying_X_shutdown(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- /* schedule shutdow timeout */
- TSIP_DIALOG_PUBLISH_TIMER_SCHEDULE(shutdown);
+ /* schedule shutdow timeout */
+ TSIP_DIALOG_PUBLISH_TIMER_SCHEDULE(shutdown);
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- self->unpublishing = tsk_true;
- return send_PUBLISH(self);
+ self->unpublishing = tsk_true;
+ return send_PUBLISH(self);
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_publish_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- /* Alert the user. */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
+ /* Alert the user. */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
- return 0;
+ return 0;
}
/* Any -> (Error) -> Terminated
*/
int tsip_dialog_publish_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* Alert the user. */
- if(response){
- TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
- }
-
- return 0;
+ tsip_dialog_publish_t *self = va_arg(*app, tsip_dialog_publish_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* Alert the user. */
+ if(response) {
+ TSIP_DIALOG_PUBLISH_SIGNAL(self, self->unpublishing ? tsip_ao_unpublish : tsip_ao_publish,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
+ }
+
+ return 0;
}
@@ -561,59 +555,59 @@ int tsip_dialog_publish_Any_2_Terminated_X_Error(va_list *app)
/**
- * Sends a PUBLISH request.
+ * Sends a PUBLISH request.
**/
int send_PUBLISH(tsip_dialog_publish_t *self)
{
- tsip_request_t *request = tsk_null;
- int ret = -1;
- const tsip_action_t* action;
-
- if(!self){
- return -1;
- }
-
- // action
- action = TSIP_DIALOG(self)->curr_action;
-
- if(self->unpublishing){
- TSIP_DIALOG(self)->expires = 0;
- }
-
- /* RFC 3903 - 4.1. Identification of Published Event State
- The presence of a body and the SIP-If-Match header field determine
- the specific SSESSION that the request is performing, as described in Table 1.
- +-----------+-------+---------------+---------------+
- | SSESSION | Body? | SIP-If-Match? | Expires Value |
- +-----------+-------+---------------+---------------+
- | Initial | yes | no | > 0 |
- | Refresh | no | yes | > 0 |
- | Modify | yes | yes | > 0 |
- | Remove | no | yes | 0 |
- +-----------+-------+---------------+---------------+
- Table 1: Publication ssessions
- */
- if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "PUBLISH"))){
- /*Etag. If initial then etag is null. */
- if(self->etag){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SIP_IF_MATCH_VA_ARGS(self->etag));
- }
- /*Body*/
- if(action && action->payload && !self->unpublishing){
- const tsk_list_item_t* item;
- tsk_list_foreach(item, action->headers){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- if(action->payload){
- tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(action->payload), TSK_BUFFER_SIZE(action->payload));
- }
- }
-
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- TSK_OBJECT_SAFE_FREE(request);
- }
-
- return ret;
+ tsip_request_t *request = tsk_null;
+ int ret = -1;
+ const tsip_action_t* action;
+
+ if(!self) {
+ return -1;
+ }
+
+ // action
+ action = TSIP_DIALOG(self)->curr_action;
+
+ if(self->unpublishing) {
+ TSIP_DIALOG(self)->expires = 0;
+ }
+
+ /* RFC 3903 - 4.1. Identification of Published Event State
+ The presence of a body and the SIP-If-Match header field determine
+ the specific SSESSION that the request is performing, as described in Table 1.
+ +-----------+-------+---------------+---------------+
+ | SSESSION | Body? | SIP-If-Match? | Expires Value |
+ +-----------+-------+---------------+---------------+
+ | Initial | yes | no | > 0 |
+ | Refresh | no | yes | > 0 |
+ | Modify | yes | yes | > 0 |
+ | Remove | no | yes | 0 |
+ +-----------+-------+---------------+---------------+
+ Table 1: Publication ssessions
+ */
+ if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "PUBLISH"))) {
+ /*Etag. If initial then etag is null. */
+ if(self->etag) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SIP_IF_MATCH_VA_ARGS(self->etag));
+ }
+ /*Body*/
+ if(action && action->payload && !self->unpublishing) {
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, action->headers) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ if(action->payload) {
+ tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(action->payload), TSK_BUFFER_SIZE(action->payload));
+ }
+ }
+
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ TSK_OBJECT_SAFE_FREE(request);
+ }
+
+ return ret;
}
/**
@@ -623,14 +617,14 @@ int send_PUBLISH(tsip_dialog_publish_t *self)
**/
int tsip_dialog_publish_OnTerminated(tsip_dialog_publish_t *self)
{
- TSK_DEBUG_INFO("=== PUBLISH Dialog terminated ===");
+ TSK_DEBUG_INFO("=== PUBLISH Dialog terminated ===");
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated");
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -650,52 +644,51 @@ int tsip_dialog_publish_OnTerminated(tsip_dialog_publish_t *self)
//
static tsk_object_t* tsip_dialog_publish_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_publish_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ tsip_dialog_publish_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- /* init base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_PUBLISH, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
+ /* init base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_PUBLISH, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
- /* FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_publish_OnTerminated), (const void*)dialog);
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_publish_OnTerminated), (const void*)dialog);
- /* init the class itself */
- tsip_dialog_publish_init(self);
- }
- return self;
+ /* init the class itself */
+ tsip_dialog_publish_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_publish_dtor(tsk_object_t * _self)
-{
- tsip_dialog_publish_t *self = _self;
- if(self){
- TSK_DEBUG_INFO("*** PUBLISH Dialog destroyed ***");
-
- /* Cancel all timers */
- TSIP_DIALOG_TIMER_CANCEL(refresh);
- TSIP_DIALOG_TIMER_CANCEL(shutdown);
-
- /* deinit base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
-
- /* deinit self*/
- TSK_FREE(self->etag);
- }
- return self;
+{
+ tsip_dialog_publish_t *self = _self;
+ if(self) {
+ TSK_DEBUG_INFO("*** PUBLISH Dialog destroyed ***");
+
+ /* Cancel all timers */
+ TSIP_DIALOG_TIMER_CANCEL(refresh);
+ TSIP_DIALOG_TIMER_CANCEL(shutdown);
+
+ /* deinit base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
+
+ /* deinit self*/
+ TSK_FREE(self->etag);
+ }
+ return self;
}
static int tsip_dialog_publish_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_publish_def_s =
-{
- sizeof(tsip_dialog_publish_t),
- tsip_dialog_publish_ctor,
- tsip_dialog_publish_dtor,
- tsip_dialog_publish_cmp,
+static const tsk_object_def_t tsip_dialog_publish_def_s = {
+ sizeof(tsip_dialog_publish_t),
+ tsip_dialog_publish_ctor,
+ tsip_dialog_publish_dtor,
+ tsip_dialog_publish_cmp,
};
const tsk_object_def_t *tsip_dialog_publish_def_t = &tsip_dialog_publish_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_register.c b/tinySIP/src/dialogs/tsip_dialog_register.c
index a1c1424..7a20cad 100755
--- a/tinySIP/src/dialogs/tsip_dialog_register.c
+++ b/tinySIP/src/dialogs/tsip_dialog_register.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -52,11 +52,11 @@ static int tsip_dialog_register_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_silent_hangup(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- return TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return TSIP_DIALOG(dialog)->ss->silent_hangup;
}
static tsk_bool_t _fsm_cond_not_silent_hangup(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- return !TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return !TSIP_DIALOG(dialog)->ss->silent_hangup;
}
@@ -72,148 +72,146 @@ extern int tsip_dialog_register_server_init(tsip_dialog_register_t *self);
* @brief Callback function called to alert the dialog for new events from the transaction/transport layers.
*
* @param [in,out] self A reference to the dialog.
- * @param type The event type.
- * @param [in,out] msg The incoming SIP/IMS message.
+ * @param type The event type.
+ * @param [in,out] msg The incoming SIP/IMS message.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_register_event_callback(const tsip_dialog_register_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type){
- case tsip_dialog_i_msg:
- {
- if(msg){
- if(TSIP_MESSAGE_IS_RESPONSE(msg)){
- //
- // RESPONSE
- //
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,423)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
- }
- else{
- // Alert User
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
- /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
- }
- }
- else{
- //
- // REQUEST
- //
- if(TSIP_REQUEST_IS_REGISTER(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iREGISTER, msg, tsk_null);
- }
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ //
+ // RESPONSE
+ //
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,423)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
+ }
+ else {
+ // Alert User
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
+ /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
+ }
+ }
+ else {
+ //
+ // REQUEST
+ //
+ if(TSIP_REQUEST_IS_REGISTER(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_iREGISTER, msg, tsk_null);
+ }
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
/**Timer manager callback.
*
- * @param self The owner of the signaled timer.
+ * @param self The owner of the signaled timer.
* @param timer_id The identifier of the signaled timer.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_register_timer_callback(const tsip_dialog_register_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self){
- if(timer_id == self->timerrefresh.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oREGISTER, tsk_null, tsk_null);
- }
- else if(timer_id == self->timershutdown.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self) {
+ if(timer_id == self->timerrefresh.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_oREGISTER, tsk_null, tsk_null);
+ }
+ else if(timer_id == self->timershutdown.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
+ }
+ }
+ return ret;
}
/** Create SIP REGISTER dialog. */
tsip_dialog_register_t* tsip_dialog_register_create(const tsip_ssession_handle_t* ss, const char* call_id)
{
- return tsk_object_new(tsip_dialog_register_def_t, ss, call_id);
+ return tsk_object_new(tsip_dialog_register_def_t, ss, call_id);
}
/** Initializes the dialog.
*
- * @param [in,out] self The dialog to initialize.
+ * @param [in,out] self The dialog to initialize.
**/
int tsip_dialog_register_init(tsip_dialog_register_t *self)
{
- // Initialize client side
- tsip_dialog_register_client_init(self);
- // initialize server side
- tsip_dialog_register_server_init(self);
-
- /* Initialize common side */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Any ===
- */
- // Any -> (hangup) -> InProgress
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_InProgress, tsip_dialog_register_Any_2_InProgress_X_hangup, "tsip_dialog_register_Any_2_InProgress_X_hangup"),
- // Any -> (silenthangup) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_Any_2_InProgress_X_silenthangup"),
- // Any -> (shutdown) -> InProgress
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_InProgress, tsip_dialog_register_Any_2_InProgress_X_shutdown, "tsip_dialog_register_Any_2_InProgress_X_shutdown"),
- // Any -> (silentshutdown) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_Any_2_InProgress_X_silentshutdown"),
- // Any -> (shutdown timedout) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_shutdown_timedout"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_register_Any_2_Terminated_X_transportError, "tsip_dialog_register_Any_2_Terminated_X_transportError"),
- // Any -> (error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_register_Any_2_Terminated_X_Error, "tsip_dialog_register_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- /* Sets callback function */
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_register_event_callback);
-
- /* Timers */
- self->timerrefresh.id = TSK_INVALID_TIMER_ID;
- self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
- self->timershutdown.id = TSK_INVALID_TIMER_ID;
- self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
-
- return 0;
+ // Initialize client side
+ tsip_dialog_register_client_init(self);
+ // initialize server side
+ tsip_dialog_register_server_init(self);
+
+ /* Initialize common side */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (hangup) -> InProgress
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_InProgress, tsip_dialog_register_Any_2_InProgress_X_hangup, "tsip_dialog_register_Any_2_InProgress_X_hangup"),
+ // Any -> (silenthangup) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_Any_2_InProgress_X_silenthangup"),
+ // Any -> (shutdown) -> InProgress
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_InProgress, tsip_dialog_register_Any_2_InProgress_X_shutdown, "tsip_dialog_register_Any_2_InProgress_X_shutdown"),
+ // Any -> (silentshutdown) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_Any_2_InProgress_X_silentshutdown"),
+ // Any -> (shutdown timedout) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_shutdown_timedout"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_register_Any_2_Terminated_X_transportError, "tsip_dialog_register_Any_2_Terminated_X_transportError"),
+ // Any -> (error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_register_Any_2_Terminated_X_Error, "tsip_dialog_register_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Sets callback function */
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_register_event_callback);
+
+ /* Timers */
+ self->timerrefresh.id = TSK_INVALID_TIMER_ID;
+ self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
+ self->timershutdown.id = TSK_INVALID_TIMER_ID;
+ self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
+
+ return 0;
}
@@ -223,66 +221,66 @@ int tsip_dialog_register_init(tsip_dialog_register_t *self)
*/
int tsip_dialog_register_Any_2_InProgress_X_hangup(va_list *app)
{
- tsip_dialog_register_t *self;
+ tsip_dialog_register_t *self;
- self = va_arg(*app, tsip_dialog_register_t *);
+ self = va_arg(*app, tsip_dialog_register_t *);
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- self->unregistering = tsk_true;
- return tsip_dialog_register_send_REGISTER(self, tsk_true);
+ self->unregistering = tsk_true;
+ return tsip_dialog_register_send_REGISTER(self, tsk_true);
}
/* Any -> (shutdown) -> InProgress
*/
int tsip_dialog_register_Any_2_InProgress_X_shutdown(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
-
- /* schedule shutdow timeout */
- TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(shutdown);
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- /* alert user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* schedule shutdow timeout */
+ TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(shutdown);
- self->unregistering = tsk_true;
- return tsip_dialog_register_send_REGISTER(self, tsk_true);
+ /* alert user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+
+ self->unregistering = tsk_true;
+ return tsip_dialog_register_send_REGISTER(self, tsk_true);
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_register_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- /* Alert the user. */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
+ /* Alert the user. */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
- return 0;
+ return 0;
}
/* Any -> (error) -> Terminated
*/
int tsip_dialog_register_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* save last error */
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
-
- /* Alert the user. */
- if(response){
- TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
- }
-
- return 0;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* save last error */
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+
+ /* Alert the user. */
+ if(response) {
+ TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
+ }
+
+ return 0;
}
@@ -293,107 +291,107 @@ int tsip_dialog_register_Any_2_Terminated_X_Error(va_list *app)
/**
*
- * Sends a REGISTER request.
+ * Sends a REGISTER request.
*
* @param [in,out] self The caller.
* @param [in] initial Indicates whether it's an initial (new CSeq) REGISTER or not.
* Initial REGISTER request will creates new IPSec temporary SAs.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_register_send_REGISTER(tsip_dialog_register_t *self, tsk_bool_t initial)
{
- tsip_request_t *request;
- int ret = -1;
-
- /* whether we are unregistering */
- if(self->unregistering){
- TSIP_DIALOG(self)->expires = 0;
- }
-
- /* creates REGISTER request */
- if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "REGISTER"))){
- /* == RCS phase 2
- */
- /*if(TSIP_DIALOG_GET_STACK(self)->enable_gsmarcs){
- TSIP_HEADER_ADD_PARAM(request->Contact, "+g.oma.sip-im.large-message", 0);
- TSIP_HEADER_ADD_PARAM(request->Contact, "audio", 0);
- TSIP_HEADER_ADD_PARAM(request->Contact, "video", 0);
- TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.cs-voice", 0);
- TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.icsi-ref", TSIP_ICSI_QUOTED_MMTEL_PSVOICE);
- }*/
-
- ///* mobility */
- //if(TSIP_DIALOG_GET_STACK(self)->mobility){
- // TSIP_HEADER_ADD_PARAM(request->Contact, "mobility", TSIP_DIALOG_GET_STACK(self)->mobility);
- //}
-
- ///* deviceID - FIXME: find reference. */
- //if(TSIP_DIALOG_GET_STACK(self)->device_id){
- // TSIP_HEADER_ADD_PARAM(request->Contact, "+deviceID", TSIP_DIALOG_GET_STACK(self)->device_id);
- //}
-
- ///* GSMA Image Sharing */
- //if(TSIP_DIALOG_GET_STACK(self)->enable_gsmais){
- // TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.app_ref", TSIP_IARI_QUOTED_GSMAIS);
- //}
-
- ///* 3GPP TS 24.341 subclause 5.3.2.2 */
- //if(TSIP_DIALOG_GET_STACK(self)->enable_3gppsms){
- // TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.smsip", 0);
- //}
-
- /* 3GPP TS 24.229 - 5.1.1.2 Initial registration */
- if(TSIP_DIALOG(self)->state ==tsip_initial){
- /*
- g) the Supported header field containing the option-tag "path", and
- 1) if GRUU is supported, the option-tag "gruu"; and
- 2) if multiple registrations is supported, the option-tag "outbound".
- */
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SUPPORTED_VA_ARGS("path"));
- //if(1==2/* gruu*/){
- //}
- //else if(2 == 3 /* multiple registrations */){
- //}
- }
-
- /* action parameters and payload */
- if(TSIP_DIALOG(self)->curr_action){
- const tsk_list_item_t* item;
- tsk_list_foreach(item, TSIP_DIALOG(self)->curr_action->headers){
- TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
- }
- if(TSIP_DIALOG(self)->curr_action->payload){
- tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(TSIP_DIALOG(self)->curr_action->payload), TSK_BUFFER_SIZE(TSIP_DIALOG(self)->curr_action->payload));
- }
- }
-
- /* Create temorary SAs if initial register. */
- if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech){
- if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")){
- if(initial){
- tsip_transport_createTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
- }
- else{
- AKA_CK_T ck;
- AKA_IK_T ik;
- tsip_dialog_getCKIK(TSIP_DIALOG(self), &ck, &ik);
- tsip_transport_startSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport, (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
- }
- }
- }
-
- if(!(ret = tsip_dialog_request_send(TSIP_DIALOG(self), request))){
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_sent, "(un)REGISTER request successfully sent.");
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
- }
-
- TSK_OBJECT_SAFE_FREE(request);
- }
-
- return ret;
+ tsip_request_t *request;
+ int ret = -1;
+
+ /* whether we are unregistering */
+ if(self->unregistering) {
+ TSIP_DIALOG(self)->expires = 0;
+ }
+
+ /* creates REGISTER request */
+ if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "REGISTER"))) {
+ /* == RCS phase 2
+ */
+ /*if(TSIP_DIALOG_GET_STACK(self)->enable_gsmarcs){
+ TSIP_HEADER_ADD_PARAM(request->Contact, "+g.oma.sip-im.large-message", 0);
+ TSIP_HEADER_ADD_PARAM(request->Contact, "audio", 0);
+ TSIP_HEADER_ADD_PARAM(request->Contact, "video", 0);
+ TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.cs-voice", 0);
+ TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.icsi-ref", TSIP_ICSI_QUOTED_MMTEL_PSVOICE);
+ }*/
+
+ ///* mobility */
+ //if(TSIP_DIALOG_GET_STACK(self)->mobility){
+ // TSIP_HEADER_ADD_PARAM(request->Contact, "mobility", TSIP_DIALOG_GET_STACK(self)->mobility);
+ //}
+
+ ///* deviceID - FIXME: find reference. */
+ //if(TSIP_DIALOG_GET_STACK(self)->device_id){
+ // TSIP_HEADER_ADD_PARAM(request->Contact, "+deviceID", TSIP_DIALOG_GET_STACK(self)->device_id);
+ //}
+
+ ///* GSMA Image Sharing */
+ //if(TSIP_DIALOG_GET_STACK(self)->enable_gsmais){
+ // TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.app_ref", TSIP_IARI_QUOTED_GSMAIS);
+ //}
+
+ ///* 3GPP TS 24.341 subclause 5.3.2.2 */
+ //if(TSIP_DIALOG_GET_STACK(self)->enable_3gppsms){
+ // TSIP_HEADER_ADD_PARAM(request->Contact, "+g.3gpp.smsip", 0);
+ //}
+
+ /* 3GPP TS 24.229 - 5.1.1.2 Initial registration */
+ if(TSIP_DIALOG(self)->state ==tsip_initial) {
+ /*
+ g) the Supported header field containing the option-tag "path", and
+ 1) if GRUU is supported, the option-tag "gruu"; and
+ 2) if multiple registrations is supported, the option-tag "outbound".
+ */
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SUPPORTED_VA_ARGS("path"));
+ //if(1==2/* gruu*/){
+ //}
+ //else if(2 == 3 /* multiple registrations */){
+ //}
+ }
+
+ /* action parameters and payload */
+ if(TSIP_DIALOG(self)->curr_action) {
+ const tsk_list_item_t* item;
+ tsk_list_foreach(item, TSIP_DIALOG(self)->curr_action->headers) {
+ TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS(TSK_PARAM(item->data)->name, TSK_PARAM(item->data)->value));
+ }
+ if(TSIP_DIALOG(self)->curr_action->payload) {
+ tsip_message_add_content(request, tsk_null, TSK_BUFFER_DATA(TSIP_DIALOG(self)->curr_action->payload), TSK_BUFFER_SIZE(TSIP_DIALOG(self)->curr_action->payload));
+ }
+ }
+
+ /* Create temorary SAs if initial register. */
+ if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech) {
+ if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")) {
+ if(initial) {
+ tsip_transport_createTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
+ }
+ else {
+ AKA_CK_T ck;
+ AKA_IK_T ik;
+ tsip_dialog_getCKIK(TSIP_DIALOG(self), &ck, &ik);
+ tsip_transport_startSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport, (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
+ }
+ }
+ }
+
+ if(!(ret = tsip_dialog_request_send(TSIP_DIALOG(self), request))) {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_sent, "(un)REGISTER request successfully sent.");
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(request);
+ }
+
+ return ret;
}
@@ -401,19 +399,19 @@ int tsip_dialog_register_send_REGISTER(tsip_dialog_register_t *self, tsk_bool_t
// Send any response
int tsip_dialog_register_send_RESPONSE(tsip_dialog_register_t *self, const tsip_request_t* request, short code, const char* phrase)
{
- tsip_response_t *response;
- int ret = -1;
-
- if(!self || !request){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 1;
- }
-
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))){
- ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- return ret;
+ tsip_response_t *response;
+ int ret = -1;
+
+ if(!self || !request) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 1;
+ }
+
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))) {
+ ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ return ret;
}
@@ -427,23 +425,23 @@ int tsip_dialog_register_send_RESPONSE(tsip_dialog_register_t *self, const tsip_
**/
int tsip_dialog_register_OnTerminated(tsip_dialog_register_t *self)
{
- TSK_DEBUG_INFO("=== REGISTER Dialog terminated ===");
-
- /* Cleanup IPSec SAs */
- if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech && tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")){
- tsip_transport_cleanupSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
- }
- /* Reset values to avoid issues when the session is reused */
- self->unregistering = tsk_false;
- TSK_OBJECT_SAFE_FREE(self->last_iRegister);
-
- /* Alert the user */
- TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated",
- TSIP_DIALOG(self)->last_error.message);
-
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ TSK_DEBUG_INFO("=== REGISTER Dialog terminated ===");
+
+ /* Cleanup IPSec SAs */
+ if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech && tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")) {
+ tsip_transport_cleanupSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
+ }
+ /* Reset values to avoid issues when the session is reused */
+ self->unregistering = tsk_false;
+ TSK_OBJECT_SAFE_FREE(self->last_iRegister);
+
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated",
+ TSIP_DIALOG(self)->last_error.message);
+
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -454,54 +452,53 @@ int tsip_dialog_register_OnTerminated(tsip_dialog_register_t *self)
//
static tsk_object_t* tsip_dialog_register_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_register_t *dialog = self;
- if(dialog){
- tsip_ssession_t *ss = va_arg(*app, tsip_ssession_t *);
- const char* call_id = va_arg(*app, const char *);
-
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_REGISTER, call_id, ss, _fsm_state_Started, _fsm_state_Terminated);
-
- /* create FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_register_OnTerminated), (const void*)dialog);
-
- /* Initialize the class itself */
- tsip_dialog_register_init(self);
- }
- return self;
+ tsip_dialog_register_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_t *ss = va_arg(*app, tsip_ssession_t *);
+ const char* call_id = va_arg(*app, const char *);
+
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_REGISTER, call_id, ss, _fsm_state_Started, _fsm_state_Terminated);
+
+ /* create FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_register_OnTerminated), (const void*)dialog);
+
+ /* Initialize the class itself */
+ tsip_dialog_register_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_register_dtor(tsk_object_t * _self)
-{
- tsip_dialog_register_t *self = _self;
- if(self){
+{
+ tsip_dialog_register_t *self = _self;
+ if(self) {
- /* Cancel all timers */
- TSIP_DIALOG_TIMER_CANCEL(refresh);
- TSIP_DIALOG_TIMER_CANCEL(shutdown);
+ /* Cancel all timers */
+ TSIP_DIALOG_TIMER_CANCEL(refresh);
+ TSIP_DIALOG_TIMER_CANCEL(shutdown);
- /* DeInitialize base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
+ /* DeInitialize base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
- // Delete resources
- TSK_OBJECT_SAFE_FREE(self->last_iRegister);
+ // Delete resources
+ TSK_OBJECT_SAFE_FREE(self->last_iRegister);
- TSK_DEBUG_INFO("*** REGISTER Dialog destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** REGISTER Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_register_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_register_def_s =
-{
- sizeof(tsip_dialog_register_t),
- tsip_dialog_register_ctor,
- tsip_dialog_register_dtor,
- tsip_dialog_register_cmp,
+static const tsk_object_def_t tsip_dialog_register_def_s = {
+ sizeof(tsip_dialog_register_t),
+ tsip_dialog_register_ctor,
+ tsip_dialog_register_dtor,
+ tsip_dialog_register_cmp,
};
const tsk_object_def_t *tsip_dialog_register_def_t = &tsip_dialog_register_def_s;
diff --git a/tinySIP/src/dialogs/tsip_dialog_register.client.c b/tinySIP/src/dialogs/tsip_dialog_register.client.c
index fa5e99b..17fe334 100755
--- a/tinySIP/src/dialogs/tsip_dialog_register.client.c
+++ b/tinySIP/src/dialogs/tsip_dialog_register.client.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -59,67 +59,67 @@ static int tsip_dialog_register_Connected_2_InProgress_X_oRegister(va_list *app)
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_client_unregistering(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- return !dialog->is_server && dialog->unregistering;
+ return !dialog->is_server && dialog->unregistering;
}
static tsk_bool_t _fsm_cond_client_registering(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- return !_fsm_cond_client_unregistering(dialog, message);
+ return !_fsm_cond_client_unregistering(dialog, message);
}
/** Initializes the dialog.
*
- * @param [in,out] self The dialog to initialize.
+ * @param [in,out] self The dialog to initialize.
**/
int tsip_dialog_register_client_init(tsip_dialog_register_t *self)
{
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (REGISTER) -> InProgress
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_oREGISTER, _fsm_state_InProgress, tsip_dialog_register_Started_2_InProgress_X_oRegister, "tsip_dialog_register_Started_2_InProgress_X_oRegister"),
- // Started -> (Any) -> Started
- //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_register_Started_2_Started_X_any"),
-
-
- /*=======================
- * === InProgress ===
- */
- // InProgress -> (1xx) -> InProgress
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_1xx, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_1xx, "tsip_dialog_register_InProgress_2_InProgress_X_1xx"),
- // InProgress -> (2xx) -> Terminated
- TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_2xx, _fsm_cond_client_unregistering, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_2xx, "tsip_dialog_register_InProgress_2_Terminated_X_2xx"),
- // InProgress -> (2xx) -> Connected
- TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_2xx, _fsm_cond_client_registering, _fsm_state_Connected, tsip_dialog_register_InProgress_2_Connected_X_2xx, "tsip_dialog_register_InProgress_2_Connected_X_2xx"),
- // InProgress -> (401/407/421/494) -> InProgress
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_401_407_421_494, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_401_407_421_494, "tsip_dialog_register_InProgress_2_InProgress_X_401_407_421_494"),
- // InProgress -> (423) -> InProgress
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_423, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_423, "tsip_dialog_register_InProgress_2_InProgress_X_423"),
- // InProgress -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_300_to_699, "tsip_dialog_register_InProgress_2_Terminated_X_300_to_699"),
- // InProgress -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_cancel, "tsip_dialog_register_InProgress_2_Terminated_X_cancel"),
- // InProgress -> (hangup) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_InProgress_2_Terminated_X_hangup"),
- // InProgress -> (shutdown) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_InProgress_2_Terminated_X_shutdown"),
- // InProgress -> (Any) -> InProgress
- //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_InProgress, "tsip_dialog_register_InProgress_2_InProgress_X_any"),
-
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (register) -> InProgress [refresh case]
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oREGISTER, _fsm_state_InProgress, tsip_dialog_register_Connected_2_InProgress_X_oRegister, "tsip_dialog_register_Connected_2_InProgress_X_oRegister"),
-
-
- TSK_FSM_ADD_NULL());
-
- return 0;
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (REGISTER) -> InProgress
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_oREGISTER, _fsm_state_InProgress, tsip_dialog_register_Started_2_InProgress_X_oRegister, "tsip_dialog_register_Started_2_InProgress_X_oRegister"),
+ // Started -> (Any) -> Started
+ //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_register_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === InProgress ===
+ */
+ // InProgress -> (1xx) -> InProgress
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_1xx, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_1xx, "tsip_dialog_register_InProgress_2_InProgress_X_1xx"),
+ // InProgress -> (2xx) -> Terminated
+ TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_2xx, _fsm_cond_client_unregistering, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_2xx, "tsip_dialog_register_InProgress_2_Terminated_X_2xx"),
+ // InProgress -> (2xx) -> Connected
+ TSK_FSM_ADD(_fsm_state_InProgress, _fsm_action_2xx, _fsm_cond_client_registering, _fsm_state_Connected, tsip_dialog_register_InProgress_2_Connected_X_2xx, "tsip_dialog_register_InProgress_2_Connected_X_2xx"),
+ // InProgress -> (401/407/421/494) -> InProgress
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_401_407_421_494, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_401_407_421_494, "tsip_dialog_register_InProgress_2_InProgress_X_401_407_421_494"),
+ // InProgress -> (423) -> InProgress
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_423, _fsm_state_InProgress, tsip_dialog_register_InProgress_2_InProgress_X_423, "tsip_dialog_register_InProgress_2_InProgress_X_423"),
+ // InProgress -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_300_to_699, "tsip_dialog_register_InProgress_2_Terminated_X_300_to_699"),
+ // InProgress -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_register_InProgress_2_Terminated_X_cancel, "tsip_dialog_register_InProgress_2_Terminated_X_cancel"),
+ // InProgress -> (hangup) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_InProgress_2_Terminated_X_hangup"),
+ // InProgress -> (shutdown) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_InProgress, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_register_InProgress_2_Terminated_X_shutdown"),
+ // InProgress -> (Any) -> InProgress
+ //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_InProgress, "tsip_dialog_register_InProgress_2_InProgress_X_any"),
+
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (register) -> InProgress [refresh case]
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_oREGISTER, _fsm_state_InProgress, tsip_dialog_register_Connected_2_InProgress_X_oRegister, "tsip_dialog_register_Connected_2_InProgress_X_oRegister"),
+
+
+ TSK_FSM_ADD_NULL());
+
+ return 0;
}
//--------------------------------------------------------
@@ -130,30 +130,30 @@ int tsip_dialog_register_client_init(tsip_dialog_register_t *self)
*/
int tsip_dialog_register_Started_2_InProgress_X_oRegister(va_list *app)
{
- tsip_dialog_register_t *self;
+ tsip_dialog_register_t *self;
- self = va_arg(*app, tsip_dialog_register_t *);
+ self = va_arg(*app, tsip_dialog_register_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
- return tsip_dialog_register_send_REGISTER(self, tsk_true);
+ return tsip_dialog_register_send_REGISTER(self, tsk_true);
}
/* InProgress -> (1xx) -> InProgress
*/
int tsip_dialog_register_InProgress_2_InProgress_X_1xx(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user (session) */
- TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_register,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user (session) */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_register,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return tsip_dialog_update(TSIP_DIALOG(self), response);
+ return tsip_dialog_update(TSIP_DIALOG(self), response);
}
/* InProgress -> (2xx) -> Connected
@@ -161,248 +161,248 @@ int tsip_dialog_register_InProgress_2_InProgress_X_1xx(va_list *app)
//#include "tsk_thread.h"
int tsip_dialog_register_InProgress_2_Connected_X_2xx(va_list *app)
{
- int ret;
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
-
- /* - Set P-associated-uriS
- * - Update service-routes
- * - Update Pats
- */
- {
- tsk_size_t index;
- const tsip_header_Path_t *hdr_Path;
- const tsip_header_Service_Route_t *hdr_Service_Route;
- const tsip_header_P_Associated_URI_t *hdr_P_Associated_URI_t;
- tsip_uri_t *uri;
-
- /* To avoid memory leaks ==> delete all concerned objects (it worth nothing) */
- TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->associated_uris);
- TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->service_routes);
- TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->paths);
-
- /* Associated URIs */
- for(index = 0; (hdr_P_Associated_URI_t = (const tsip_header_P_Associated_URI_t*)tsip_message_get_headerAt(response, tsip_htype_P_Associated_URI, index)); index++){
- if(!TSIP_DIALOG_GET_STACK(self)->associated_uris){
- TSIP_DIALOG_GET_STACK(self)->associated_uris = tsk_list_create();
- }
- uri = tsk_object_ref(hdr_P_Associated_URI_t->uri);
- tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->associated_uris, (void**)&uri);
- }
-
- /* Service-Route (3GPP TS 24.229)
- store the list of service route values contained in the Service-Route header field and bind the list to the contact
- address used in registration, in order to build a proper preloaded Route header field value for new dialogs and
- standalone transactions when using the respective contact address.
- */
- for(index = 0; (hdr_Service_Route = (const tsip_header_Service_Route_t*)tsip_message_get_headerAt(response, tsip_htype_Service_Route, index)); index++){
- if(!TSIP_DIALOG_GET_STACK(self)->service_routes){
- TSIP_DIALOG_GET_STACK(self)->service_routes = tsk_list_create();
- }
- uri = tsk_object_ref(hdr_Service_Route->uri);
- tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->service_routes, (void**)&uri);
- }
-
- /* Paths */
- for(index = 0; (hdr_Path = (const tsip_header_Path_t*)tsip_message_get_headerAt(response, tsip_htype_Path, index)); index++){
- if(TSIP_DIALOG_GET_STACK(self)->paths == 0){
- TSIP_DIALOG_GET_STACK(self)->paths = tsk_list_create();
- }
- uri = tsk_object_ref(hdr_Path->uri);
- tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->paths, (void**)&uri);
- }
- }
-
- /* 3GPP TS 24.229 - 5.1.1.2 Initial registration */
- if(first_time_to_connect){
- tsk_bool_t barred = tsk_true;
- const tsk_list_item_t *item;
- const tsip_uri_t *uri;
- const tsip_uri_t *uri_first = 0;
-
- /*
- b) store as the default public user identity the first URI on the list of URIs present in the P-Associated-URI header
- field and bind it to the respective contact address of the UE and the associated set of security associations or TLS
- session;
- NOTE 4: When using the respective contact address and associated set of security associations or TLS session, the
- UE can utilize additional URIs contained in the P-Associated-URI header field and bound it to the
- respective contact address of the UE and the associated set of security associations or TLS session, e.g. for
- application purposes.
- c) treat the identity under registration as a barred public user identity, if it is not included in the P-Associated-URI
- header field;
- */
- tsk_list_foreach(item, TSIP_DIALOG_GET_STACK(self)->associated_uris){
- uri = item->data;
- if(item == TSIP_DIALOG_GET_STACK(self)->associated_uris->head){
- uri_first = item->data;
- }
- if(!tsk_object_cmp(TSIP_DIALOG_GET_STACK(self)->identity.preferred, uri)){
- barred = 0;
- break;
- }
- }
-
- if(barred && uri_first){
- TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->identity.preferred);
- TSIP_DIALOG_GET_STACK(self)->identity.preferred = tsk_object_ref((void*)uri_first);
- }
- }
-
- /* Update the dialog state */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- return ret;
- }
-
- /* Reset current action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
-
- /* Request timeout for dialog refresh (re-registration). */
- self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
- TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(refresh);
-
- /* Alert the user (session) */
- TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_register,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Alert the user (dialog) */
- if(first_time_to_connect){
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
- }
-
- return ret;
+ int ret;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
+
+ /* - Set P-associated-uriS
+ * - Update service-routes
+ * - Update Pats
+ */
+ {
+ tsk_size_t index;
+ const tsip_header_Path_t *hdr_Path;
+ const tsip_header_Service_Route_t *hdr_Service_Route;
+ const tsip_header_P_Associated_URI_t *hdr_P_Associated_URI_t;
+ tsip_uri_t *uri;
+
+ /* To avoid memory leaks ==> delete all concerned objects (it worth nothing) */
+ TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->associated_uris);
+ TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->service_routes);
+ TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->paths);
+
+ /* Associated URIs */
+ for(index = 0; (hdr_P_Associated_URI_t = (const tsip_header_P_Associated_URI_t*)tsip_message_get_headerAt(response, tsip_htype_P_Associated_URI, index)); index++) {
+ if(!TSIP_DIALOG_GET_STACK(self)->associated_uris) {
+ TSIP_DIALOG_GET_STACK(self)->associated_uris = tsk_list_create();
+ }
+ uri = tsk_object_ref(hdr_P_Associated_URI_t->uri);
+ tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->associated_uris, (void**)&uri);
+ }
+
+ /* Service-Route (3GPP TS 24.229)
+ store the list of service route values contained in the Service-Route header field and bind the list to the contact
+ address used in registration, in order to build a proper preloaded Route header field value for new dialogs and
+ standalone transactions when using the respective contact address.
+ */
+ for(index = 0; (hdr_Service_Route = (const tsip_header_Service_Route_t*)tsip_message_get_headerAt(response, tsip_htype_Service_Route, index)); index++) {
+ if(!TSIP_DIALOG_GET_STACK(self)->service_routes) {
+ TSIP_DIALOG_GET_STACK(self)->service_routes = tsk_list_create();
+ }
+ uri = tsk_object_ref(hdr_Service_Route->uri);
+ tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->service_routes, (void**)&uri);
+ }
+
+ /* Paths */
+ for(index = 0; (hdr_Path = (const tsip_header_Path_t*)tsip_message_get_headerAt(response, tsip_htype_Path, index)); index++) {
+ if(TSIP_DIALOG_GET_STACK(self)->paths == 0) {
+ TSIP_DIALOG_GET_STACK(self)->paths = tsk_list_create();
+ }
+ uri = tsk_object_ref(hdr_Path->uri);
+ tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->paths, (void**)&uri);
+ }
+ }
+
+ /* 3GPP TS 24.229 - 5.1.1.2 Initial registration */
+ if(first_time_to_connect) {
+ tsk_bool_t barred = tsk_true;
+ const tsk_list_item_t *item;
+ const tsip_uri_t *uri;
+ const tsip_uri_t *uri_first = 0;
+
+ /*
+ b) store as the default public user identity the first URI on the list of URIs present in the P-Associated-URI header
+ field and bind it to the respective contact address of the UE and the associated set of security associations or TLS
+ session;
+ NOTE 4: When using the respective contact address and associated set of security associations or TLS session, the
+ UE can utilize additional URIs contained in the P-Associated-URI header field and bound it to the
+ respective contact address of the UE and the associated set of security associations or TLS session, e.g. for
+ application purposes.
+ c) treat the identity under registration as a barred public user identity, if it is not included in the P-Associated-URI
+ header field;
+ */
+ tsk_list_foreach(item, TSIP_DIALOG_GET_STACK(self)->associated_uris) {
+ uri = item->data;
+ if(item == TSIP_DIALOG_GET_STACK(self)->associated_uris->head) {
+ uri_first = item->data;
+ }
+ if(!tsk_object_cmp(TSIP_DIALOG_GET_STACK(self)->identity.preferred, uri)) {
+ barred = 0;
+ break;
+ }
+ }
+
+ if(barred && uri_first) {
+ TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->identity.preferred);
+ TSIP_DIALOG_GET_STACK(self)->identity.preferred = tsk_object_ref((void*)uri_first);
+ }
+ }
+
+ /* Update the dialog state */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ return ret;
+ }
+
+ /* Reset current action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+
+ /* Request timeout for dialog refresh (re-registration). */
+ self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
+ TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(refresh);
+
+ /* Alert the user (session) */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_register,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user (dialog) */
+ if(first_time_to_connect) {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+ }
+
+ return ret;
}
/* InProgress -> (2xx) -> Terminated
*/
int tsip_dialog_register_InProgress_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* save last error */
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+ /* save last error */
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
- /* Alert the user */
- TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_unregister,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_unregister,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* InProgress --> (401/407/421/494) --> InProgress
*/
int tsip_dialog_register_InProgress_2_InProgress_X_401_407_421_494(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- /* Alert the user. */
- TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- /* set last error (or info) */
- tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Authentication failed", TSIP_RESPONSE_CODE(response));
-
- return ret;
- }
-
- /* Ensure IPSec SAs */
- if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech && tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")){
- tsip_transport_ensureTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport, response, TSIP_DIALOG(self)->expires);
- }
-
- return tsip_dialog_register_send_REGISTER(self, tsk_false);
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ /* Alert the user. */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ /* set last error (or info) */
+ tsip_dialog_set_lasterror(TSIP_DIALOG(self), "Authentication failed", TSIP_RESPONSE_CODE(response));
+
+ return ret;
+ }
+
+ /* Ensure IPSec SAs */
+ if(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech && tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")) {
+ tsip_transport_ensureTempSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport, response, TSIP_DIALOG(self)->expires);
+ }
+
+ return tsip_dialog_register_send_REGISTER(self, tsk_false);
}
/* InProgress -> (423) -> InProgress
*/
int tsip_dialog_register_InProgress_2_InProgress_X_423(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- tsip_header_Min_Expires_t *hdr;
- int ret = 0;
-
- /*
- RFC 3261 - 10.2.8 Error Responses
-
- If a UA receives a 423 (Interval Too Brief) response, it MAY retry
- the registration after making the expiration interval of all contact
- addresses in the REGISTER request equal to or greater than the
- expiration interval within the Min-Expires header field of the 423
- (Interval Too Brief) response.
- */
- hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(message, tsip_htype_Min_Expires);
- if(hdr){
- TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
-
- if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")){
- tsip_transport_cleanupSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
- ret = tsip_dialog_register_send_REGISTER(self, tsk_true);
- }
- else{
- ret = tsip_dialog_register_send_REGISTER(self, tsk_false);
- }
- }
- else{
- TSK_DEBUG_ERROR("Missing header: Min_Expires");
- ret = -1;
- }
-
- return ret;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ tsip_header_Min_Expires_t *hdr;
+ int ret = 0;
+
+ /*
+ RFC 3261 - 10.2.8 Error Responses
+
+ If a UA receives a 423 (Interval Too Brief) response, it MAY retry
+ the registration after making the expiration interval of all contact
+ addresses in the REGISTER request equal to or greater than the
+ expiration interval within the Min-Expires header field of the 423
+ (Interval Too Brief) response.
+ */
+ hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(message, tsip_htype_Min_Expires);
+ if(hdr) {
+ TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
+
+ if(tsk_striequals(TSIP_DIALOG_GET_STACK(self)->security.secagree_mech, "ipsec-3gpp")) {
+ tsip_transport_cleanupSAs(TSIP_DIALOG_GET_STACK(self)->layer_transport);
+ ret = tsip_dialog_register_send_REGISTER(self, tsk_true);
+ }
+ else {
+ ret = tsip_dialog_register_send_REGISTER(self, tsk_false);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Missing header: Min_Expires");
+ ret = -1;
+ }
+
+ return ret;
}
/* InProgress -> (300-699) -> Terminated
*/
int tsip_dialog_register_InProgress_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* save last error */
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
-
- /* Alert the user. */
- TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return 0;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* save last error */
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+
+ /* Alert the user. */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+
+ return 0;
}
/* InProgress -> (cancel) -> Terminated
*/
int tsip_dialog_register_InProgress_2_Terminated_X_cancel(va_list *app)
{
- int ret;
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
+ int ret;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ /* const tsip_message_t *message = va_arg(*app, const tsip_message_t *); */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Registration cancelled");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Registration cancelled");
- return ret;
+ return ret;
}
/* Connected -> (REGISTER) -> InProgress
*/
int tsip_dialog_register_Connected_2_InProgress_X_oRegister(va_list *app)
{
- tsip_dialog_register_t *self;
+ tsip_dialog_register_t *self;
- self = va_arg(*app, tsip_dialog_register_t *);
+ self = va_arg(*app, tsip_dialog_register_t *);
- return tsip_dialog_register_send_REGISTER(self, tsk_true);
+ return tsip_dialog_register_send_REGISTER(self, tsk_true);
}
diff --git a/tinySIP/src/dialogs/tsip_dialog_register.server.c b/tinySIP/src/dialogs/tsip_dialog_register.server.c
index de912ff..3317bce 100755
--- a/tinySIP/src/dialogs/tsip_dialog_register.server.c
+++ b/tinySIP/src/dialogs/tsip_dialog_register.server.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishd by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,68 +39,68 @@ static int s0000_Connected_2_Terminated_X_iREGISTER(va_list *app);
static tsk_bool_t _fsm_cond_not_served_here(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
#if 0 // FIXME: Have to disabled only when in proxy mode
- if(message && TSIP_REQUEST_IS_REGISTER(message)){
- if(tsk_object_cmp(TSIP_DIALOG_GET_STACK(dialog)->network.realm, message->line.request.uri) != 0){
- tsip_dialog_register_send_RESPONSE(dialog, TSIP_MESSAGE_AS_REQUEST(message), 404, "Domain not served here");
- return tsk_true;
- }
- }
+ if(message && TSIP_REQUEST_IS_REGISTER(message)) {
+ if(tsk_object_cmp(TSIP_DIALOG_GET_STACK(dialog)->network.realm, message->line.request.uri) != 0) {
+ tsip_dialog_register_send_RESPONSE(dialog, TSIP_MESSAGE_AS_REQUEST(message), 404, "Domain not served here");
+ return tsk_true;
+ }
+ }
#endif
- return tsk_false;
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_server_unregistering(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- if(message && dialog->is_server){
- int64_t expires = tsip_message_getExpires(message);
- dialog->unregistering = (expires == 0);
- return dialog->unregistering;
- }
- return tsk_false;
+ if(message && dialog->is_server) {
+ int64_t expires = tsip_message_getExpires(message);
+ dialog->unregistering = (expires == 0);
+ return dialog->unregistering;
+ }
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_server_registering(tsip_dialog_register_t* dialog, tsip_message_t* message)
{
- return !_fsm_cond_server_unregistering(dialog, message);
+ return !_fsm_cond_server_unregistering(dialog, message);
}
int tsip_dialog_register_server_init(tsip_dialog_register_t *self)
{
- return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Domain Not Served here) -> Terminated
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iREGISTER, _fsm_cond_not_served_here, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iREGISTER, "s0000_Started_2_Terminated_X_iREGISTER"),
- // Started -> (All is OK and we are not unRegistering) -> Trying
- TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Incoming, s0000_Started_2_Incoming_X_iREGISTER, "s0000_Started_2_Incoming_X_iREGISTER"),
-
- /*=======================
- * === Incoming ===
- */
- // Incoming -> (Accept) -> Connected
- TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_accept, _fsm_state_Connected, s0000_Incoming_2_Connected_X_Accept, "s0000_Incoming_2_Connected_X_Accept"),
- // Incoming -> (iRegister) -> Incoming
- TSK_FSM_ADD(_fsm_state_Incoming, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Incoming, tsk_null, "s0000_Incoming_2_Incoming_X_iREGISTER"),
- // Incoming -> (iRegister, expires=0) -> Terminated
- TSK_FSM_ADD(_fsm_state_Incoming, _fsm_action_iREGISTER, _fsm_cond_server_unregistering, _fsm_state_Terminated, tsk_null, "s0000_Incoming_2_Terminated_X_iREGISTER"),
- // Incoming -> (Reject) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_reject, _fsm_state_Terminated, s0000_Incoming_2_Terminated_X_Terminates, "s0000_Incoming_2_Terminated_X_Terminates"),
- // Incoming -> (Hangup) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_hangup, _fsm_state_Terminated, s0000_Incoming_2_Terminated_X_Terminates, "s0000_Incoming_2_Terminated_X_Terminates"),
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (Register) -> Connected
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Connected, s0000_Connected_2_Connected_X_iREGISTER, "s0000_Connected_2_Connected_X_iREGISTER"),
- // Connected -> (UnRegister) -> Terminated
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREGISTER, _fsm_cond_server_unregistering, _fsm_state_Terminated, s0000_Connected_2_Terminated_X_iREGISTER, "s0000_Connected_2_Terminated_X_iREGISTER"),
- // Connected -> (TimedOut) -> Terminated
- // Connected -> (Refresh OK) -> Connected
- // Connected -> (Refresh NOK) -> Terminated
-
- TSK_FSM_ADD_NULL());
+ return tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Domain Not Served here) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iREGISTER, _fsm_cond_not_served_here, _fsm_state_Terminated, s0000_Started_2_Terminated_X_iREGISTER, "s0000_Started_2_Terminated_X_iREGISTER"),
+ // Started -> (All is OK and we are not unRegistering) -> Trying
+ TSK_FSM_ADD(_fsm_state_Started, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Incoming, s0000_Started_2_Incoming_X_iREGISTER, "s0000_Started_2_Incoming_X_iREGISTER"),
+
+ /*=======================
+ * === Incoming ===
+ */
+ // Incoming -> (Accept) -> Connected
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_accept, _fsm_state_Connected, s0000_Incoming_2_Connected_X_Accept, "s0000_Incoming_2_Connected_X_Accept"),
+ // Incoming -> (iRegister) -> Incoming
+ TSK_FSM_ADD(_fsm_state_Incoming, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Incoming, tsk_null, "s0000_Incoming_2_Incoming_X_iREGISTER"),
+ // Incoming -> (iRegister, expires=0) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Incoming, _fsm_action_iREGISTER, _fsm_cond_server_unregistering, _fsm_state_Terminated, tsk_null, "s0000_Incoming_2_Terminated_X_iREGISTER"),
+ // Incoming -> (Reject) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_reject, _fsm_state_Terminated, s0000_Incoming_2_Terminated_X_Terminates, "s0000_Incoming_2_Terminated_X_Terminates"),
+ // Incoming -> (Hangup) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Incoming, _fsm_action_hangup, _fsm_state_Terminated, s0000_Incoming_2_Terminated_X_Terminates, "s0000_Incoming_2_Terminated_X_Terminates"),
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (Register) -> Connected
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREGISTER, _fsm_cond_server_registering, _fsm_state_Connected, s0000_Connected_2_Connected_X_iREGISTER, "s0000_Connected_2_Connected_X_iREGISTER"),
+ // Connected -> (UnRegister) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_iREGISTER, _fsm_cond_server_unregistering, _fsm_state_Terminated, s0000_Connected_2_Terminated_X_iREGISTER, "s0000_Connected_2_Terminated_X_iREGISTER"),
+ // Connected -> (TimedOut) -> Terminated
+ // Connected -> (Refresh OK) -> Connected
+ // Connected -> (Refresh NOK) -> Terminated
+
+ TSK_FSM_ADD_NULL());
}
@@ -113,125 +113,125 @@ int tsip_dialog_register_server_init(tsip_dialog_register_t *self)
*/
int s0000_Started_2_Terminated_X_iREGISTER(va_list *app)
{
- return 0;
- /*tsip_dialog_register_t *self;
- const tsip_action_t* action;
+ return 0;
+ /*tsip_dialog_register_t *self;
+ const tsip_action_t* action;
- self = va_arg(*app, tsip_dialog_register_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
+ self = va_arg(*app, tsip_dialog_register_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
- TSIP_DIALOG(self)->running = tsk_true;
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), action);
+ TSIP_DIALOG(self)->running = tsk_true;
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), action);
- // alert the user
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+ // alert the user
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
- return send_REGISTER(self, tsk_true);*/
+ return send_REGISTER(self, tsk_true);*/
}
/* Started -> (All is OK and we are Registering) -> Incoming
*/
int s0000_Started_2_Incoming_X_iREGISTER(va_list *app)
{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
- // set as server side dialog
- TSIP_DIALOG_REGISTER(self)->is_server = tsk_true;
+ // set as server side dialog
+ TSIP_DIALOG_REGISTER(self)->is_server = tsk_true;
- /* update last REGISTER */
- TSK_OBJECT_SAFE_FREE(self->last_iRegister);
- self->last_iRegister = tsk_object_ref(request);
+ /* update last REGISTER */
+ TSK_OBJECT_SAFE_FREE(self->last_iRegister);
+ self->last_iRegister = tsk_object_ref(request);
- /* alert the user (session) */
- TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_i_newreg,
- tsip_event_code_dialog_request_incoming, "Incoming New Register", request);
+ /* alert the user (session) */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_i_newreg,
+ tsip_event_code_dialog_request_incoming, "Incoming New Register", request);
- return 0;
+ return 0;
}
/* Incoming -> (Accept) -> Connected
*/
int s0000_Incoming_2_Connected_X_Accept(va_list *app)
{
- int ret;
+ int ret;
- tsip_dialog_register_t *self;
+ tsip_dialog_register_t *self;
- self = va_arg(*app, tsip_dialog_register_t *);
+ self = va_arg(*app, tsip_dialog_register_t *);
- /* send 2xx OK */
- if((ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK"))){
- return ret;
- }
+ /* send 2xx OK */
+ if((ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK"))) {
+ return ret;
+ }
- /* alert the user (dialog) */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+ /* alert the user (dialog) */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
- return ret;
+ return ret;
}
/* Incoming -> (Reject) -> Terminated
*/
int s0000_Incoming_2_Terminated_X_Terminates(va_list *app)
{
- int ret;
- short code;
- const char* phrase;
- char* reason = tsk_null;
-
- tsip_dialog_register_t *self;
- const tsip_action_t* action;
-
- self = va_arg(*app, tsip_dialog_register_t *);
- va_arg(*app, const tsip_message_t *);
- action = va_arg(*app, const tsip_action_t *);
-
- /* Send Reject */
- code = action->line_resp.code>=300 ? action->line_resp.code : 600;
- phrase = action->line_resp.phrase ? action->line_resp.phrase : "Not Supported";
- tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
- ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, code, phrase);
- TSK_FREE(reason);
-
- return ret;
+ int ret;
+ short code;
+ const char* phrase;
+ char* reason = tsk_null;
+
+ tsip_dialog_register_t *self;
+ const tsip_action_t* action;
+
+ self = va_arg(*app, tsip_dialog_register_t *);
+ va_arg(*app, const tsip_message_t *);
+ action = va_arg(*app, const tsip_action_t *);
+
+ /* Send Reject */
+ code = action->line_resp.code>=300 ? action->line_resp.code : 600;
+ phrase = action->line_resp.phrase ? action->line_resp.phrase : "Not Supported";
+ tsk_sprintf(&reason, "SIP; cause=%hi; text=\"%s\"", code, phrase);
+ ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, code, phrase);
+ TSK_FREE(reason);
+
+ return ret;
}
/* Connected -> (register) -> Connected
*/
static int s0000_Connected_2_Connected_X_iREGISTER(va_list *app)
-{
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+{
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- TSK_OBJECT_SAFE_FREE(self->last_iRegister);
- self->last_iRegister = tsk_object_ref((tsk_object_t*)request);
+ TSK_OBJECT_SAFE_FREE(self->last_iRegister);
+ self->last_iRegister = tsk_object_ref((tsk_object_t*)request);
- /* send 2xx OK */
- return tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK");
+ /* send 2xx OK */
+ return tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK");
}
/* Connected -> (Unregister) -> Terminated
*/
int s0000_Connected_2_Terminated_X_iREGISTER(va_list *app)
{
- int ret;
- tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
- tsip_request_t *request = va_arg(*app, tsip_request_t *);
+ int ret;
+ tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
+ tsip_request_t *request = va_arg(*app, tsip_request_t *);
- /* update last REGISTER */
- TSK_OBJECT_SAFE_FREE(self->last_iRegister);
- self->last_iRegister = tsk_object_ref(request);
+ /* update last REGISTER */
+ TSK_OBJECT_SAFE_FREE(self->last_iRegister);
+ self->last_iRegister = tsk_object_ref(request);
- /* send 2xx OK */
- if((ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK"))){
- return ret;
- }
+ /* send 2xx OK */
+ if((ret = tsip_dialog_register_send_RESPONSE(self, self->last_iRegister, 200, "OK"))) {
+ return ret;
+ }
- /* alert the user (session) */
- TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_i_unregister,
- tsip_event_code_dialog_request_incoming, "Incoming Request", request);
+ /* alert the user (session) */
+ TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_i_unregister,
+ tsip_event_code_dialog_request_incoming, "Incoming Request", request);
- return 0;
+ return 0;
} \ No newline at end of file
diff --git a/tinySIP/src/dialogs/tsip_dialog_subscribe.client.c b/tinySIP/src/dialogs/tsip_dialog_subscribe.client.c
index 28f34e4..89877de 100755
--- a/tinySIP/src/dialogs/tsip_dialog_subscribe.client.c
+++ b/tinySIP/src/dialogs/tsip_dialog_subscribe.client.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -77,66 +77,63 @@ static int tsip_dialog_subscribe_Any_2_Terminated_X_Error(va_list *app);
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_unsubscribing(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- return dialog->unsubscribing;
+ return dialog->unsubscribing;
}
static tsk_bool_t _fsm_cond_subscribing(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- return !_fsm_cond_unsubscribing(dialog, message);
+ return !_fsm_cond_unsubscribing(dialog, message);
}
static tsk_bool_t _fsm_cond_notify_terminated(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- const tsip_header_Subscription_State_t *hdr_state;
- if((hdr_state = (const tsip_header_Subscription_State_t*)tsip_message_get_header(message, tsip_htype_Subscription_State)))
- {
- return tsk_striequals(hdr_state->state, "terminated") &&
- (hdr_state->expires < 0 || tsk_striequals(hdr_state->reason, "rejected") || tsk_striequals(hdr_state->reason, "noresource"));
- }
- return tsk_false;
+ const tsip_header_Subscription_State_t *hdr_state;
+ if((hdr_state = (const tsip_header_Subscription_State_t*)tsip_message_get_header(message, tsip_htype_Subscription_State))) {
+ return tsk_striequals(hdr_state->state, "terminated") &&
+ (hdr_state->expires < 0 || tsk_striequals(hdr_state->reason, "rejected") || tsk_striequals(hdr_state->reason, "noresource"));
+ }
+ return tsk_false;
}
static tsk_bool_t _fsm_cond_notify_not_terminated(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- return !_fsm_cond_notify_terminated(dialog, message);
+ return !_fsm_cond_notify_terminated(dialog, message);
}
static tsk_bool_t _fsm_cond_silent_hangup(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- return TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return TSIP_DIALOG(dialog)->ss->silent_hangup;
}
static tsk_bool_t _fsm_cond_not_silent_hangup(tsip_dialog_subscribe_t* dialog, tsip_message_t* message)
{
- return !TSIP_DIALOG(dialog)->ss->silent_hangup;
+ return !TSIP_DIALOG(dialog)->ss->silent_hangup;
}
#define _fsm_cond_silent_shutdown _fsm_cond_silent_hangup
#define _fsm_cond_not_silent_shutdown _fsm_cond_not_silent_hangup
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_subscribe = tsip_atype_subscribe,
- _fsm_action_hangup = tsip_atype_hangup,
- _fsm_action_cancel = tsip_atype_cancel,
- _fsm_action_shutdown = tsip_atype_shutdown,
- _fsm_action_transporterror = tsip_atype_transport_error,
-
- _fsm_action_1xx = 0xFF,
- _fsm_action_2xx,
- _fsm_action_401_407_421_494,
- _fsm_action_423,
- _fsm_action_300_to_699,
- _fsm_action_shutdown_timedout, /* Any -> Terminated */
- _fsm_action_notify,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_subscribe = tsip_atype_subscribe,
+ _fsm_action_hangup = tsip_atype_hangup,
+ _fsm_action_cancel = tsip_atype_cancel,
+ _fsm_action_shutdown = tsip_atype_shutdown,
+ _fsm_action_transporterror = tsip_atype_transport_error,
+
+ _fsm_action_1xx = 0xFF,
+ _fsm_action_2xx,
+ _fsm_action_401_407_421_494,
+ _fsm_action_423,
+ _fsm_action_300_to_699,
+ _fsm_action_shutdown_timedout, /* Any -> Terminated */
+ _fsm_action_notify,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Trying,
- _fsm_state_Connected,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Trying,
+ _fsm_state_Connected,
+ _fsm_state_Terminated
}
_fsm_state_t;
@@ -144,188 +141,184 @@ _fsm_state_t;
* Callback function called to alert the dialog for new events from the transaction/transport layers.
*
* @param [in,out] self A reference to the dialog.
- * @param type The event type.
- * @param [in,out] msg The incoming SIP/IMS message.
+ * @param type The event type.
+ * @param [in,out] msg The incoming SIP/IMS message.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_subscribe_event_callback(const tsip_dialog_subscribe_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_dialog_i_msg:
- {
- if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)){
- //
- // RESPONSE
- //
- const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
- }
- else if(TSIP_RESPONSE_IS(msg,423)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
- }
- else{
- // Alert User
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
- /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
- }
- }
- else{
- //
- // REQUEST
- //
- if(TSIP_REQUEST_IS_NOTIFY(msg)){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_notify, msg, tsk_null);
- }
- }
- break;
- }
-
- case tsip_dialog_canceled:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
- break;
- }
-
- case tsip_dialog_terminated:
- case tsip_dialog_timedout:
- case tsip_dialog_error:
- case tsip_dialog_transport_error:
- {
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
- break;
- }
-
- default: break;
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_dialog_i_msg: {
+ if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ //
+ // RESPONSE
+ //
+ const tsip_action_t* action = tsip_dialog_keep_action(TSIP_DIALOG(self), msg) ? TSIP_DIALOG(self)->curr_action : tsk_null;
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_1xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_2xx, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,401) || TSIP_RESPONSE_IS(msg,407) || TSIP_RESPONSE_IS(msg,421) || TSIP_RESPONSE_IS(msg,494)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_401_407_421_494, msg, action);
+ }
+ else if(TSIP_RESPONSE_IS(msg,423)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_423, msg, action);
+ }
+ else {
+ // Alert User
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_error, msg, action);
+ /* TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg)); */
+ }
+ }
+ else {
+ //
+ // REQUEST
+ //
+ if(TSIP_REQUEST_IS_NOTIFY(msg)) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_notify, msg, tsk_null);
+ }
+ }
+ break;
+ }
+
+ case tsip_dialog_canceled: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_cancel, msg, tsk_null);
+ break;
+ }
+
+ case tsip_dialog_terminated:
+ case tsip_dialog_timedout:
+ case tsip_dialog_error:
+ case tsip_dialog_transport_error: {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_transporterror, msg, tsk_null);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
/** Timer manager callback.
*
- * @param [in,out] self The owner of the signaled timer.
+ * @param [in,out] self The owner of the signaled timer.
* @param timer_id The identifier of the signaled timer.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_dialog_subscribe_timer_callback(const tsip_dialog_subscribe_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
+ int ret = -1;
- if(self)
- {
- if(timer_id == self->timerrefresh.id){
- tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_subscribe, tsk_null, tsk_null);
- ret = 0;
- }
- else if(timer_id == self->timershutdown.id){
- ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
- }
- }
- return ret;
+ if(self) {
+ if(timer_id == self->timerrefresh.id) {
+ tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_subscribe, tsk_null, tsk_null);
+ ret = 0;
+ }
+ else if(timer_id == self->timershutdown.id) {
+ ret = tsip_dialog_fsm_act(TSIP_DIALOG(self), _fsm_action_shutdown_timedout, tsk_null, tsk_null);
+ }
+ }
+ return ret;
}
tsip_dialog_subscribe_t* tsip_dialog_subscribe_create(const tsip_ssession_handle_t* ss)
{
- return tsk_object_new(tsip_dialog_subscribe_def_t, ss);
+ return tsk_object_new(tsip_dialog_subscribe_def_t, ss);
}
/** Initializes the dialog.
*
- * @param [in,out] self The dialog to initialize.
+ * @param [in,out] self The dialog to initialize.
**/
int tsip_dialog_subscribe_init(tsip_dialog_subscribe_t *self)
-{
- /* Initialize the State Machine. */
- tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Send) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_subscribe, _fsm_state_Trying, tsip_dialog_subscribe_Started_2_Trying_X_subscribe, "tsip_dialog_subscribe_Started_2_Trying_X_subscribe"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_subscribe_Started_2_Started_X_any"),
-
-
- /*=======================
- * === Trying ===
- */
- // Trying -> (1xx) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_1xx, "tsip_dialog_subscribe_Trying_2_Trying_X_1xx"),
- // Trying -> (2xx) -> Terminated
- TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_unsubscribing, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_2xx, "tsip_dialog_subscribe_Trying_2_Terminated_X_2xx"),
- // Trying -> (2xx) -> Connected
- TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_subscribing, _fsm_state_Connected, tsip_dialog_subscribe_Trying_2_Connected_X_2xx, "tsip_dialog_subscribe_Trying_2_Connected_X_2xx"),
- // Trying -> (401/407/421/494) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_401_407_421_494, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494, "tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494"),
- // Trying -> (423) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_423, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_423, "tsip_dialog_subscribe_Trying_2_Trying_X_423"),
- // Trying -> (300_to_699) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699, "tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699"),
- // Trying -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_cancel, "tsip_dialog_subscribe_Trying_2_Terminated_X_cancel"),
- // Trying -> (Notify) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_notify, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY, "tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY"),
- // Trying -> (hangup) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Trying_2_Terminated_X_hangup"),
- // Trying -> (shutdown) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Trying_2_Terminated_X_shutdown"),
- // Trying -> (Any) -> Trying
- //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Trying, "tsip_dialog_subscribe_Trying_2_Trying_X_any"),
-
-
- /*=======================
- * === Connected ===
- */
- // Connected -> (SUBSCRIBE) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_subscribe, _fsm_state_Trying, tsip_dialog_subscribe_Connected_2_Trying_X_subscribe, "tsip_dialog_subscribe_Connected_2_Trying_X_subscribe"),
- // Connected -> (NOTIFY) -> Connected
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_notify, _fsm_cond_notify_not_terminated, _fsm_state_Connected, tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY, "tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY"),
- // Connected -> (NOTIFY) -> Terminated
- TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_notify, _fsm_cond_notify_terminated, _fsm_state_Terminated, tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY, "tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (hangup) -> Trying
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_Trying, tsip_dialog_subscribe_Any_2_Trying_X_hangup, "tsip_dialog_subscribe_Any_2_Trying_X_hangup"),
- // Any -> (silenthangup) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Any_2_Trying_X_silenthangup"),
- // Any -> (shutdown) -> Trying
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_Trying, tsip_dialog_subscribe_Any_2_Trying_X_shutdown, "tsip_dialog_subscribe_Any_2_Trying_X_shutdown"),
- // Any -> (silentshutdown) -> Terminated
- TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Any_2_Trying_X_silentshutdown"),
- // Any -> (shutdown timedout) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_shutdown_timedout"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_subscribe_Any_2_Terminated_X_transportError, "tsip_dialog_subscribe_Any_2_Terminated_X_transportError"),
- // Any -> (error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_subscribe_Any_2_Terminated_X_Error, "tsip_dialog_subscribe_Any_2_Terminated_X_Error"),
-
- TSK_FSM_ADD_NULL());
-
- /* Sets callback function */
- TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_subscribe_event_callback);
-
- /* Timers */
- self->timerrefresh.id = TSK_INVALID_TIMER_ID;
- self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
- self->timershutdown.id = TSK_INVALID_TIMER_ID;
- self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
-
- return 0;
+{
+ /* Initialize the State Machine. */
+ tsk_fsm_set(TSIP_DIALOG_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Send) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_subscribe, _fsm_state_Trying, tsip_dialog_subscribe_Started_2_Trying_X_subscribe, "tsip_dialog_subscribe_Started_2_Trying_X_subscribe"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_subscribe_Started_2_Started_X_any"),
+
+
+ /*=======================
+ * === Trying ===
+ */
+ // Trying -> (1xx) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_1xx, "tsip_dialog_subscribe_Trying_2_Trying_X_1xx"),
+ // Trying -> (2xx) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_unsubscribing, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_2xx, "tsip_dialog_subscribe_Trying_2_Terminated_X_2xx"),
+ // Trying -> (2xx) -> Connected
+ TSK_FSM_ADD(_fsm_state_Trying, _fsm_action_2xx, _fsm_cond_subscribing, _fsm_state_Connected, tsip_dialog_subscribe_Trying_2_Connected_X_2xx, "tsip_dialog_subscribe_Trying_2_Connected_X_2xx"),
+ // Trying -> (401/407/421/494) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_401_407_421_494, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494, "tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494"),
+ // Trying -> (423) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_423, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_423, "tsip_dialog_subscribe_Trying_2_Trying_X_423"),
+ // Trying -> (300_to_699) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699, "tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699"),
+ // Trying -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_subscribe_Trying_2_Terminated_X_cancel, "tsip_dialog_subscribe_Trying_2_Terminated_X_cancel"),
+ // Trying -> (Notify) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_notify, _fsm_state_Trying, tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY, "tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY"),
+ // Trying -> (hangup) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Trying_2_Terminated_X_hangup"),
+ // Trying -> (shutdown) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Trying_2_Terminated_X_shutdown"),
+ // Trying -> (Any) -> Trying
+ //TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Trying, "tsip_dialog_subscribe_Trying_2_Trying_X_any"),
+
+
+ /*=======================
+ * === Connected ===
+ */
+ // Connected -> (SUBSCRIBE) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Connected, _fsm_action_subscribe, _fsm_state_Trying, tsip_dialog_subscribe_Connected_2_Trying_X_subscribe, "tsip_dialog_subscribe_Connected_2_Trying_X_subscribe"),
+ // Connected -> (NOTIFY) -> Connected
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_notify, _fsm_cond_notify_not_terminated, _fsm_state_Connected, tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY, "tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY"),
+ // Connected -> (NOTIFY) -> Terminated
+ TSK_FSM_ADD(_fsm_state_Connected, _fsm_action_notify, _fsm_cond_notify_terminated, _fsm_state_Terminated, tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY, "tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (hangup) -> Trying
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_not_silent_hangup, _fsm_state_Trying, tsip_dialog_subscribe_Any_2_Trying_X_hangup, "tsip_dialog_subscribe_Any_2_Trying_X_hangup"),
+ // Any -> (silenthangup) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_hangup, _fsm_cond_silent_hangup, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Any_2_Trying_X_silenthangup"),
+ // Any -> (shutdown) -> Trying
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_not_silent_shutdown, _fsm_state_Trying, tsip_dialog_subscribe_Any_2_Trying_X_shutdown, "tsip_dialog_subscribe_Any_2_Trying_X_shutdown"),
+ // Any -> (silentshutdown) -> Terminated
+ TSK_FSM_ADD(tsk_fsm_state_any, _fsm_action_shutdown, _fsm_cond_silent_shutdown, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_Any_2_Trying_X_silentshutdown"),
+ // Any -> (shutdown timedout) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_shutdown_timedout, _fsm_state_Terminated, tsk_null, "tsip_dialog_subscribe_shutdown_timedout"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_subscribe_Any_2_Terminated_X_transportError, "tsip_dialog_subscribe_Any_2_Terminated_X_transportError"),
+ // Any -> (error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_subscribe_Any_2_Terminated_X_Error, "tsip_dialog_subscribe_Any_2_Terminated_X_Error"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Sets callback function */
+ TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK_F(tsip_dialog_subscribe_event_callback);
+
+ /* Timers */
+ self->timerrefresh.id = TSK_INVALID_TIMER_ID;
+ self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
+ self->timershutdown.id = TSK_INVALID_TIMER_ID;
+ self->timershutdown.timeout = TSIP_DIALOG_SHUTDOWN_TIMEOUT;
+
+ return 0;
}
@@ -337,282 +330,282 @@ int tsip_dialog_subscribe_init(tsip_dialog_subscribe_t *self)
*/
int tsip_dialog_subscribe_Started_2_Trying_X_subscribe(va_list *app)
{
- tsip_dialog_subscribe_t *self;
+ tsip_dialog_subscribe_t *self;
- self = va_arg(*app, tsip_dialog_subscribe_t *);
+ self = va_arg(*app, tsip_dialog_subscribe_t *);
- TSIP_DIALOG(self)->running = tsk_true;
+ TSIP_DIALOG(self)->running = tsk_true;
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connecting, "Dialog connecting");
- return send_SUBSCRIBE(self);
+ return send_SUBSCRIBE(self);
}
/* Trying -> (1xx) -> Trying
*/
int tsip_dialog_subscribe_Trying_2_Trying_X_1xx(va_list *app)
{
- /*tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+ /*tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
- return 0;
+ return 0;
}
/* Trying -> (2xx) -> Terminated
*/
int tsip_dialog_subscribe_Trying_2_Terminated_X_2xx(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* Alert the user. */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user. */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Trying -> (2xx) -> Connected
*/
int tsip_dialog_subscribe_Trying_2_Connected_X_2xx(va_list *app)
{
- int ret;
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
+ tsk_bool_t first_time_to_connect = (TSIP_DIALOG(self)->state == tsip_initial);
- /* Update the dialog state. */
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- return ret;
- }
+ /* Update the dialog state. */
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ return ret;
+ }
- /* Alert the user(session) */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- /* Alert the user(dialog) */
- if(first_time_to_connect){
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
- }
+ /* Alert the user(session) */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* Alert the user(dialog) */
+ if(first_time_to_connect) {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_connected, "Dialog connected");
+ }
- /* Reset current action */
- tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
+ /* Reset current action */
+ tsip_dialog_set_curr_action(TSIP_DIALOG(self), tsk_null);
- /* Request timeout for dialog refresh (re-subscribtion). */
- self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
- TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(refresh);
+ /* Request timeout for dialog refresh (re-subscribtion). */
+ self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), response);
+ TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(refresh);
- return 0;
+ return 0;
}
/* Trying -> (401/407/421/494) -> Trying
*/
int tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494(va_list *app)
{
- int ret;
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))) {
+ /* Alert the user. */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- if((ret = tsip_dialog_update(TSIP_DIALOG(self), response))){
- /* Alert the user. */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
-
- return ret;
- }
-
- return send_SUBSCRIBE(self);
+ return ret;
+ }
+
+ return send_SUBSCRIBE(self);
}
/* Trying -> (423) -> Trying
*/
int tsip_dialog_subscribe_Trying_2_Trying_X_423(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- tsip_header_Min_Expires_t *hdr;
+ tsip_header_Min_Expires_t *hdr;
- /*
- RFC 3261 - 10.2.8 Error Responses
+ /*
+ RFC 3261 - 10.2.8 Error Responses
- If a UA receives a 423 (Interval Too Brief) response, it MAY retry
- the registration after making the expiration interval of all contact
- addresses in the SUBSCRIBE request equal to or greater than the
- expiration interval within the Min-Expires header field of the 423
- (Interval Too Brief) response.
- */
- hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(response, tsip_htype_Min_Expires);
- if(hdr){
- TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
- send_SUBSCRIBE(self);
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_message_error, "Received invalid SIP response.");
+ If a UA receives a 423 (Interval Too Brief) response, it MAY retry
+ the registration after making the expiration interval of all contact
+ addresses in the SUBSCRIBE request equal to or greater than the
+ expiration interval within the Min-Expires header field of the 423
+ (Interval Too Brief) response.
+ */
+ hdr = (tsip_header_Min_Expires_t*)tsip_message_get_header(response, tsip_htype_Min_Expires);
+ if(hdr) {
+ TSIP_DIALOG(self)->expires = TSK_TIME_S_2_MS(hdr->value);
+ send_SUBSCRIBE(self);
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_message_error, "Received invalid SIP response.");
- return -1;
- }
+ return -1;
+ }
- return 0;
+ return 0;
}
/* Trying -> (300-699) -> Terminated
*/
int tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* save last error */
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+ /* save last error */
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
- /* alert the user */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ /* alert the user */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- return 0;
+ return 0;
}
/* Trying -> (cancel) -> Terminated
*/
int tsip_dialog_subscribe_Trying_2_Terminated_X_cancel(va_list *app)
{
- int ret;
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- /* const tsip_response_t *response = va_arg(*app, const tsip_response_t *); */
+ int ret;
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ /* const tsip_response_t *response = va_arg(*app, const tsip_response_t *); */
- /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
- ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
+ /* Cancel all transactions associated to this dialog (will also be done when the dialog is destroyed (worth nothing)) */
+ ret = tsip_transac_layer_cancel_by_dialog(TSIP_DIALOG_GET_STACK(self)->layer_transac, TSIP_DIALOG(self));
- /* RFC 3261 - 9.1 Client Behavior
- A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
- */
+ /* RFC 3261 - 9.1 Client Behavior
+ A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.
+ */
- /* alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Subscription cancelled");
+ /* alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_request_cancelled, "Subscription cancelled");
- return ret;
+ return ret;
}
/* Trying -> (NOTIFY) -> Trying
*/
int tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY(va_list *app)
{
- int ret;
-
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ int ret;
+
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- ret = send_200NOTIFY(self, request);
- ret = process_i_notify(self, request);
-
- return ret;
+ ret = send_200NOTIFY(self, request);
+ ret = process_i_notify(self, request);
+
+ return ret;
}
/* Connected -> (SUBSCRIBE) -> Trying
*/
int tsip_dialog_subscribe_Connected_2_Trying_X_subscribe(va_list *app)
{
- tsip_dialog_subscribe_t *self;
+ tsip_dialog_subscribe_t *self;
- self = va_arg(*app, tsip_dialog_subscribe_t *);
+ self = va_arg(*app, tsip_dialog_subscribe_t *);
- return send_SUBSCRIBE(self);
+ return send_SUBSCRIBE(self);
}
/* Connected -> (NOTIFY) -> Connected
*/
int tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- int ret;
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ int ret;
- ret = send_200NOTIFY(self, request);
- ret = process_i_notify(self, request);
+ ret = send_200NOTIFY(self, request);
+ ret = process_i_notify(self, request);
- return ret;
+ return ret;
}
/* Connected -> (NOTIFY) -> Terminated
*/
int tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- /* Alert the user */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
- tsip_event_code_dialog_request_incoming, "Incoming NOTIFY.", request);
+ /* Alert the user */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
+ tsip_event_code_dialog_request_incoming, "Incoming NOTIFY.", request);
- return send_200NOTIFY(self, request);
+ return send_200NOTIFY(self, request);
}
/* Any -> (hangup) -> Trying
*/
int tsip_dialog_subscribe_Any_2_Trying_X_hangup(va_list *app)
{
- tsip_dialog_subscribe_t *self;
+ tsip_dialog_subscribe_t *self;
- self = va_arg(*app, tsip_dialog_subscribe_t *);
+ self = va_arg(*app, tsip_dialog_subscribe_t *);
- /* Alert the user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- self->unsubscribing = tsk_true;
- return send_SUBSCRIBE(self);
+ self->unsubscribing = tsk_true;
+ return send_SUBSCRIBE(self);
}
/* Any -> (shutdown) -> Trying
*/
int tsip_dialog_subscribe_Any_2_Trying_X_shutdown(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- /* schedule shutdow timeout */
- TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(shutdown);
+ /* schedule shutdow timeout */
+ TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(shutdown);
- /* alert user */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
+ /* alert user */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_terminating, "Terminating dialog");
- self->unsubscribing = tsk_true;
- return send_SUBSCRIBE(self);
+ self->unsubscribing = tsk_true;
+ return send_SUBSCRIBE(self);
}
/* Any -> (transport error) -> Terminated
*/
int tsip_dialog_subscribe_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- /* const tsip_response_t *response = va_arg(*app, const tsip_response_t *); */
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ /* const tsip_response_t *response = va_arg(*app, const tsip_response_t *); */
- /* Alert the user. */
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
+ /* Alert the user. */
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_transport_error, "Transport error.");
- return 0;
+ return 0;
}
/* Any -> (error) -> Terminated
*/
int tsip_dialog_subscribe_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- // save last error
- tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
+ // save last error
+ tsip_dialog_set_lasterror_2(TSIP_DIALOG(self), TSIP_RESPONSE_PHRASE(response), TSIP_RESPONSE_CODE(response), response);
- /* Alert user */
- if(response){
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
- TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
- }
- else{
- TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
- }
+ /* Alert user */
+ if(response) {
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
+ TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
+ }
+ else {
+ TSIP_DIALOG_SIGNAL(self, tsip_event_code_dialog_global_error, "Global error.");
+ }
- return 0;
+ return 0;
}
@@ -621,63 +614,63 @@ int tsip_dialog_subscribe_Any_2_Terminated_X_Error(va_list *app)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/**
- * Sends a SUBSCRIBE request.
+ * Sends a SUBSCRIBE request.
*
* @param [in,out] self The caller.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int send_SUBSCRIBE(tsip_dialog_subscribe_t *self)
{
- tsip_request_t *request;
- int ret = -1;
-
- if(self->unsubscribing){
- TSIP_DIALOG(self)->expires = 0;
- }
+ tsip_request_t *request;
+ int ret = -1;
+
+ if(self->unsubscribing) {
+ TSIP_DIALOG(self)->expires = 0;
+ }
- if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "SUBSCRIBE"))){
- /* apply action params to the request */
- if(TSIP_DIALOG(self)->curr_action){
- tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
- }
- /* send the request */
- ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
- TSK_OBJECT_SAFE_FREE(request);
- }
+ if((request = tsip_dialog_request_new(TSIP_DIALOG(self), "SUBSCRIBE"))) {
+ /* apply action params to the request */
+ if(TSIP_DIALOG(self)->curr_action) {
+ tsip_dialog_apply_action(request, TSIP_DIALOG(self)->curr_action);
+ }
+ /* send the request */
+ ret = tsip_dialog_request_send(TSIP_DIALOG(self), request);
+ TSK_OBJECT_SAFE_FREE(request);
+ }
- return ret;
+ return ret;
}
int send_200NOTIFY(tsip_dialog_subscribe_t *self, const tsip_request_t* request)
{
- tsip_response_t *response;
- int ret = -1;
+ tsip_response_t *response;
+ int ret = -1;
- if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))){
- ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
- TSK_OBJECT_SAFE_FREE(response);
- }
- return ret;
+ if((response = tsip_dialog_response_new(TSIP_DIALOG(self), 200, "OK", request))) {
+ ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ return ret;
}
// process incoming notify: refresh delay and alert the user
int process_i_notify(tsip_dialog_subscribe_t *self, const tsip_request_t* notify)
{
- if(!self || !notify){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- /* Request timeout for dialog refresh (re-registration). */
- self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), notify);
- TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(refresh);
-
- /* Alert the user */
- TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
- tsip_event_code_dialog_request_incoming, "Incoming NOTIFY.", notify);
-
- return 0;
+ if(!self || !notify) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ /* Request timeout for dialog refresh (re-registration). */
+ self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), notify);
+ TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(refresh);
+
+ /* Alert the user */
+ TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
+ tsip_event_code_dialog_request_incoming, "Incoming NOTIFY.", notify);
+
+ return 0;
}
/**
@@ -687,15 +680,15 @@ int process_i_notify(tsip_dialog_subscribe_t *self, const tsip_request_t* notify
**/
int tsip_dialog_subscribe_OnTerminated(tsip_dialog_subscribe_t *self)
{
- TSK_DEBUG_INFO("=== SUBSCRIBE Dialog terminated ===");
+ TSK_DEBUG_INFO("=== SUBSCRIBE Dialog terminated ===");
- /* Alert the user */
- TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
- TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated",
- TSIP_DIALOG(self)->last_error.message);
+ /* Alert the user */
+ TSIP_DIALOG_SIGNAL_2(self, tsip_event_code_dialog_terminated,
+ TSIP_DIALOG(self)->last_error.phrase ? TSIP_DIALOG(self)->last_error.phrase : "Dialog terminated",
+ TSIP_DIALOG(self)->last_error.message);
- /* Remove from the dialog layer. */
- return tsip_dialog_remove(TSIP_DIALOG(self));
+ /* Remove from the dialog layer. */
+ return tsip_dialog_remove(TSIP_DIALOG(self));
}
@@ -716,49 +709,48 @@ int tsip_dialog_subscribe_OnTerminated(tsip_dialog_subscribe_t *self)
//
static tsk_object_t* tsip_dialog_subscribe_ctor(tsk_object_t * self, va_list * app)
{
- tsip_dialog_subscribe_t *dialog = self;
- if(dialog){
- tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
+ tsip_dialog_subscribe_t *dialog = self;
+ if(dialog) {
+ tsip_ssession_handle_t *ss = va_arg(*app, tsip_ssession_handle_t *);
- /* Initialize base class */
- tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_SUBSCRIBE, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
+ /* Initialize base class */
+ tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_SUBSCRIBE, tsk_null, ss, _fsm_state_Started, _fsm_state_Terminated);
- /* FSM */
- TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_subscribe_OnTerminated), (const void*)dialog);
+ /* FSM */
+ TSIP_DIALOG_GET_FSM(self)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_DIALOG_GET_FSM(self), TSK_FSM_ONTERMINATED_F(tsip_dialog_subscribe_OnTerminated), (const void*)dialog);
- /* Initialize the class itself */
- tsip_dialog_subscribe_init(self);
- }
- return self;
+ /* Initialize the class itself */
+ tsip_dialog_subscribe_init(self);
+ }
+ return self;
}
static tsk_object_t* tsip_dialog_subscribe_dtor(tsk_object_t * _self)
-{
- tsip_dialog_subscribe_t *self = _self;
- if(self){
- /* Cancel all timers */
- TSIP_DIALOG_TIMER_CANCEL(refresh);
- TSIP_DIALOG_TIMER_CANCEL(shutdown);
+{
+ tsip_dialog_subscribe_t *self = _self;
+ if(self) {
+ /* Cancel all timers */
+ TSIP_DIALOG_TIMER_CANCEL(refresh);
+ TSIP_DIALOG_TIMER_CANCEL(shutdown);
- /* DeInitialize base class (will cancel all transactions) */
- tsip_dialog_deinit(TSIP_DIALOG(self));
+ /* DeInitialize base class (will cancel all transactions) */
+ tsip_dialog_deinit(TSIP_DIALOG(self));
- TSK_DEBUG_INFO("*** SUBSCRIBE Dialog destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** SUBSCRIBE Dialog destroyed ***");
+ }
+ return self;
}
static int tsip_dialog_subscribe_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return tsip_dialog_cmp(obj1, obj2);
+ return tsip_dialog_cmp(obj1, obj2);
}
-static const tsk_object_def_t tsip_dialog_subscribe_def_s =
-{
- sizeof(tsip_dialog_subscribe_t),
- tsip_dialog_subscribe_ctor,
- tsip_dialog_subscribe_dtor,
- tsip_dialog_subscribe_cmp,
+static const tsk_object_def_t tsip_dialog_subscribe_def_s = {
+ sizeof(tsip_dialog_subscribe_t),
+ tsip_dialog_subscribe_ctor,
+ tsip_dialog_subscribe_dtor,
+ tsip_dialog_subscribe_cmp,
};
const tsk_object_def_t *tsip_dialog_subscribe_def_t = &tsip_dialog_subscribe_def_s;
diff --git a/tinySIP/src/headers/tsip_header.c b/tinySIP/src/headers/tsip_header.c
index 4360281..c42426a 100755
--- a/tinySIP/src/headers/tsip_header.c
+++ b/tinySIP/src/headers/tsip_header.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -34,7 +34,7 @@
#include "tsk_debug.h"
-/* Compact headers: http://www.cs.columbia.edu/sip/compact.html
+/* Compact headers: http://www.cs.columbia.edu/sip/compact.html
Abbreviation Header defined by origin (mnemonic)
a Accept-Contact draft-ietf-sip-callerprefs --
b Referred-By -refer- "by"
@@ -50,10 +50,10 @@ m Contact RFC 3261 "moved"
n Identity-Info
o Event -event- "occurance"
r Refer-To -refer-
-s Subject RFC 3261
+s Subject RFC 3261
t To RFC 3261
u Allow-Events -events- "understand"
-v Via RFC 3261
+v Via RFC 3261
y Identity
*/
@@ -101,237 +101,325 @@ y Identity
# define _Identity "Identity"
#endif
-/** Gets the name of the SIP header with a type equal to @a type.
- * @param type The @a type of the header for which to retrieve the name.
+/** Gets the name of the SIP header with a type equal to @a type.
+ * @param type The @a type of the header for which to retrieve the name.
*
* @return The name of the header.
**/
const char *tsip_header_get_name(tsip_header_type_t type)
{
- switch(type)
- {
- case tsip_htype_Accept: return "Accept";
- case tsip_htype_Accept_Contact: return _Accept_Contact;
- case tsip_htype_Accept_Encoding: return "Accept-Encoding";
- case tsip_htype_Accept_Language: return "Accept-Language";
- case tsip_htype_Accept_Resource_Priority: return "Accept-Resource-Priority";
- case tsip_htype_Alert_Info: return "Alert-Info";
- case tsip_htype_Allow: return "Allow";
- case tsip_htype_Allow_Events: return _Allow_Events;
- case tsip_htype_Authentication_Info: return "Authentication-Info";
- case tsip_htype_Authorization: return "Authorization";
- case tsip_htype_Call_ID: return _Call_ID;
- case tsip_htype_Call_Info: return "Call-Info";
- case tsip_htype_Contact: return _Contact;
- case tsip_htype_Content_Disposition: return "Content-Disposition";
- case tsip_htype_Content_Encoding: return _Content_Encoding;
- case tsip_htype_Content_Language: return "Content-Language";
- case tsip_htype_Content_Length: return _Content_Length;
- case tsip_htype_Content_Type: return _Content_Type;
- case tsip_htype_CSeq: return "CSeq";
- case tsip_htype_Date: return "Date";
- case tsip_htype_Error_Info: return "Error-Info";
- case tsip_htype_Event: return _Event;
- case tsip_htype_Expires: return "Expires";
- case tsip_htype_From: return _From;
- case tsip_htype_History_Info: return "History-Info";
- case tsip_htype_Identity: return _Identity;
- case tsip_htype_Identity_Info: return _Identity_Info;
- case tsip_htype_In_Reply_To: return "In-Reply-To";
- case tsip_htype_Join: return "Join";
- case tsip_htype_Max_Forwards: return "Max-Forwards";
- case tsip_htype_MIME_Version: return "MIME-Version";
- case tsip_htype_Min_Expires: return "Min-Expires";
- case tsip_htype_Min_SE: return "Min-SE";
- case tsip_htype_Organization: return "Organization";
- case tsip_htype_Path: return "Path";
- case tsip_htype_Priority: return "Priority";
- case tsip_htype_Privacy: return "Privacy";
- case tsip_htype_Proxy_Authenticate: return "Proxy-Authenticate";
- case tsip_htype_Proxy_Authorization: return "Proxy-Authorization";
- case tsip_htype_Proxy_Require: return "Proxy-Require";
- case tsip_htype_RAck: return "RAck";
- case tsip_htype_Reason: return "Reason";
- case tsip_htype_Record_Route: return "Record-Route";
- case tsip_htype_Refer_Sub: return "Refer-Sub";
- case tsip_htype_Refer_To: return _Refer_To;
- case tsip_htype_Referred_By: return _Referred_By;
- case tsip_htype_Reject_Contact: return _Reject_Contact;
- case tsip_htype_Replaces: return "Replaces";
- case tsip_htype_Reply_To: return "Reply-To";
- case tsip_htype_Request_Disposition: return _Request_Disposition;
- case tsip_htype_Require: return "Require";
- case tsip_htype_Resource_Priority: return "Resource-Priority";
- case tsip_htype_Retry_After: return "Retry-After";
- case tsip_htype_Route: return "Route";
- case tsip_htype_RSeq: return "RSeq";
- case tsip_htype_Security_Client: return "Security-Client";
- case tsip_htype_Security_Server: return "Security-Server";
- case tsip_htype_Security_Verify: return "Security-Verify";
- case tsip_htype_Server: return "Server";
- case tsip_htype_Service_Route: return "Service-Route";
- case tsip_htype_Session_Expires: return _Session_Expires;
- case tsip_htype_SIP_ETag: return "SIP-ETag";
- case tsip_htype_SIP_If_Match: return "SIP-If-Match";
- case tsip_htype_Subject: return _Subject;
- case tsip_htype_Subscription_State: return "Subscription-State";
- case tsip_htype_Supported: return _Supported;
- case tsip_htype_Target_Dialog: return "Target-Dialog";
- case tsip_htype_Timestamp: return "Timestamp";
- case tsip_htype_To: return _To;
- case tsip_htype_Unsupported: return "Unsupported";
- case tsip_htype_User_Agent: return "User-Agent";
- case tsip_htype_Via: return _Via;
- case tsip_htype_Warning: return "Warning";
- case tsip_htype_WWW_Authenticate: return "WWW-Authenticate";
- case tsip_htype_P_Access_Network_Info: return "P-Access-Network-Info";
- case tsip_htype_P_Answer_State: return "P-Answer-State";
- case tsip_htype_P_Asserted_Identity: return "P-Asserted-Identity";
- case tsip_htype_P_Associated_URI: return "P-Associated-URI";
- case tsip_htype_P_Called_Party_ID: return "P-Called-Party-ID";
- case tsip_htype_P_Charging_Function_Addresses: return "P-Charging-Function-Addresses";
- case tsip_htype_P_Charging_Vector: return "P-Charging-Vector";
- case tsip_htype_P_DCS_Billing_Info: return "P-DCS-Billing-Info";
- case tsip_htype_P_DCS_LAES: return "P-DCS-LAES";
- case tsip_htype_P_DCS_OSPS: return "P-DCS-OSPS";
- case tsip_htype_P_DCS_Redirect: return "P-DCS-Redirect";
- case tsip_htype_P_DCS_Trace_Party_ID: return "P-DCS-Trace-Party-ID";
- case tsip_htype_P_Early_Media: return "P-Early-Media";
- case tsip_htype_P_Media_Authorization: return "P-Media-Authorization";
- case tsip_htype_P_Preferred_Identity: return "P-Preferred-Identity";
- case tsip_htype_P_Profile_Key: return "P-Profile-Key";
- case tsip_htype_P_User_Database: return "P-User-Database";
- case tsip_htype_P_Visited_Network_ID: return "P-Visited-Network-ID";
+ switch(type) {
+ case tsip_htype_Accept:
+ return "Accept";
+ case tsip_htype_Accept_Contact:
+ return _Accept_Contact;
+ case tsip_htype_Accept_Encoding:
+ return "Accept-Encoding";
+ case tsip_htype_Accept_Language:
+ return "Accept-Language";
+ case tsip_htype_Accept_Resource_Priority:
+ return "Accept-Resource-Priority";
+ case tsip_htype_Alert_Info:
+ return "Alert-Info";
+ case tsip_htype_Allow:
+ return "Allow";
+ case tsip_htype_Allow_Events:
+ return _Allow_Events;
+ case tsip_htype_Authentication_Info:
+ return "Authentication-Info";
+ case tsip_htype_Authorization:
+ return "Authorization";
+ case tsip_htype_Call_ID:
+ return _Call_ID;
+ case tsip_htype_Call_Info:
+ return "Call-Info";
+ case tsip_htype_Contact:
+ return _Contact;
+ case tsip_htype_Content_Disposition:
+ return "Content-Disposition";
+ case tsip_htype_Content_Encoding:
+ return _Content_Encoding;
+ case tsip_htype_Content_Language:
+ return "Content-Language";
+ case tsip_htype_Content_Length:
+ return _Content_Length;
+ case tsip_htype_Content_Type:
+ return _Content_Type;
+ case tsip_htype_CSeq:
+ return "CSeq";
+ case tsip_htype_Date:
+ return "Date";
+ case tsip_htype_Error_Info:
+ return "Error-Info";
+ case tsip_htype_Event:
+ return _Event;
+ case tsip_htype_Expires:
+ return "Expires";
+ case tsip_htype_From:
+ return _From;
+ case tsip_htype_History_Info:
+ return "History-Info";
+ case tsip_htype_Identity:
+ return _Identity;
+ case tsip_htype_Identity_Info:
+ return _Identity_Info;
+ case tsip_htype_In_Reply_To:
+ return "In-Reply-To";
+ case tsip_htype_Join:
+ return "Join";
+ case tsip_htype_Max_Forwards:
+ return "Max-Forwards";
+ case tsip_htype_MIME_Version:
+ return "MIME-Version";
+ case tsip_htype_Min_Expires:
+ return "Min-Expires";
+ case tsip_htype_Min_SE:
+ return "Min-SE";
+ case tsip_htype_Organization:
+ return "Organization";
+ case tsip_htype_Path:
+ return "Path";
+ case tsip_htype_Priority:
+ return "Priority";
+ case tsip_htype_Privacy:
+ return "Privacy";
+ case tsip_htype_Proxy_Authenticate:
+ return "Proxy-Authenticate";
+ case tsip_htype_Proxy_Authorization:
+ return "Proxy-Authorization";
+ case tsip_htype_Proxy_Require:
+ return "Proxy-Require";
+ case tsip_htype_RAck:
+ return "RAck";
+ case tsip_htype_Reason:
+ return "Reason";
+ case tsip_htype_Record_Route:
+ return "Record-Route";
+ case tsip_htype_Refer_Sub:
+ return "Refer-Sub";
+ case tsip_htype_Refer_To:
+ return _Refer_To;
+ case tsip_htype_Referred_By:
+ return _Referred_By;
+ case tsip_htype_Reject_Contact:
+ return _Reject_Contact;
+ case tsip_htype_Replaces:
+ return "Replaces";
+ case tsip_htype_Reply_To:
+ return "Reply-To";
+ case tsip_htype_Request_Disposition:
+ return _Request_Disposition;
+ case tsip_htype_Require:
+ return "Require";
+ case tsip_htype_Resource_Priority:
+ return "Resource-Priority";
+ case tsip_htype_Retry_After:
+ return "Retry-After";
+ case tsip_htype_Route:
+ return "Route";
+ case tsip_htype_RSeq:
+ return "RSeq";
+ case tsip_htype_Security_Client:
+ return "Security-Client";
+ case tsip_htype_Security_Server:
+ return "Security-Server";
+ case tsip_htype_Security_Verify:
+ return "Security-Verify";
+ case tsip_htype_Server:
+ return "Server";
+ case tsip_htype_Service_Route:
+ return "Service-Route";
+ case tsip_htype_Session_Expires:
+ return _Session_Expires;
+ case tsip_htype_SIP_ETag:
+ return "SIP-ETag";
+ case tsip_htype_SIP_If_Match:
+ return "SIP-If-Match";
+ case tsip_htype_Subject:
+ return _Subject;
+ case tsip_htype_Subscription_State:
+ return "Subscription-State";
+ case tsip_htype_Supported:
+ return _Supported;
+ case tsip_htype_Target_Dialog:
+ return "Target-Dialog";
+ case tsip_htype_Timestamp:
+ return "Timestamp";
+ case tsip_htype_To:
+ return _To;
+ case tsip_htype_Unsupported:
+ return "Unsupported";
+ case tsip_htype_User_Agent:
+ return "User-Agent";
+ case tsip_htype_Via:
+ return _Via;
+ case tsip_htype_Warning:
+ return "Warning";
+ case tsip_htype_WWW_Authenticate:
+ return "WWW-Authenticate";
+ case tsip_htype_P_Access_Network_Info:
+ return "P-Access-Network-Info";
+ case tsip_htype_P_Answer_State:
+ return "P-Answer-State";
+ case tsip_htype_P_Asserted_Identity:
+ return "P-Asserted-Identity";
+ case tsip_htype_P_Associated_URI:
+ return "P-Associated-URI";
+ case tsip_htype_P_Called_Party_ID:
+ return "P-Called-Party-ID";
+ case tsip_htype_P_Charging_Function_Addresses:
+ return "P-Charging-Function-Addresses";
+ case tsip_htype_P_Charging_Vector:
+ return "P-Charging-Vector";
+ case tsip_htype_P_DCS_Billing_Info:
+ return "P-DCS-Billing-Info";
+ case tsip_htype_P_DCS_LAES:
+ return "P-DCS-LAES";
+ case tsip_htype_P_DCS_OSPS:
+ return "P-DCS-OSPS";
+ case tsip_htype_P_DCS_Redirect:
+ return "P-DCS-Redirect";
+ case tsip_htype_P_DCS_Trace_Party_ID:
+ return "P-DCS-Trace-Party-ID";
+ case tsip_htype_P_Early_Media:
+ return "P-Early-Media";
+ case tsip_htype_P_Media_Authorization:
+ return "P-Media-Authorization";
+ case tsip_htype_P_Preferred_Identity:
+ return "P-Preferred-Identity";
+ case tsip_htype_P_Profile_Key:
+ return "P-Profile-Key";
+ case tsip_htype_P_User_Database:
+ return "P-User-Database";
+ case tsip_htype_P_Visited_Network_ID:
+ return "P-Visited-Network-ID";
- default: return "unknown-header";
- }
+ default:
+ return "unknown-header";
+ }
}
const char *tsip_header_get_name_2(const tsip_header_t *self)
{
- if(self){
- if(self->type == tsip_htype_Dummy){
- return ((tsip_header_Dummy_t*)self)->name;
- }
- else{
- return tsip_header_get_name(self->type);
- }
- }
- return "unknown-header";
+ if(self) {
+ if(self->type == tsip_htype_Dummy) {
+ return ((tsip_header_Dummy_t*)self)->name;
+ }
+ else {
+ return tsip_header_get_name(self->type);
+ }
+ }
+ return "unknown-header";
}
char tsip_header_get_param_separator(const tsip_header_t *self)
{
- if(self)
- {
- switch(self->type)
- {
- case tsip_htype_Authorization:
- case tsip_htype_Proxy_Authorization:
- case tsip_htype_Proxy_Authenticate:
- case tsip_htype_WWW_Authenticate:
- {
- return ',';
- }
+ if(self) {
+ switch(self->type) {
+ case tsip_htype_Authorization:
+ case tsip_htype_Proxy_Authorization:
+ case tsip_htype_Proxy_Authenticate:
+ case tsip_htype_WWW_Authenticate: {
+ return ',';
+ }
- default:
- {
- return ';';
- }
- }
- }
- return 0;
+ default: {
+ return ';';
+ }
+ }
+ }
+ return 0;
}
int tsip_header_serialize(const tsip_header_t *self, tsk_buffer_t *output)
{
- int ret = -1;
- static const char* hname;
- static char separator;
+ int ret = -1;
+ static const char* hname;
+ static char separator;
- if(self && TSIP_HEADER(self)->serialize){
- tsk_list_item_t *item;
-
- hname = tsip_header_get_name_2(self);
- ret = 0; // for empty lists
+ if(self && TSIP_HEADER(self)->serialize) {
+ tsk_list_item_t *item;
- /* Header name */
- tsk_buffer_append_2(output, "%s: ", hname);
+ hname = tsip_header_get_name_2(self);
+ ret = 0; // for empty lists
- /* Header value (likes calling tsip_header_value_serialize() ) */
- if((ret = TSIP_HEADER(self)->serialize(self, output))){
- // CHECK all headers return value!
- //return ret;
- }
+ /* Header name */
+ tsk_buffer_append_2(output, "%s: ", hname);
- /* Parameters */
- tsk_list_foreach(item, self->params){
- tsk_param_t* param = item->data;
- separator = tsip_header_get_param_separator(self);
- if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))){
- return ret;
- }
- }
+ /* Header value (likes calling tsip_header_value_serialize() ) */
+ if((ret = TSIP_HEADER(self)->serialize(self, output))) {
+ // CHECK all headers return value!
+ //return ret;
+ }
- /* CRLF */
- tsk_buffer_append(output, "\r\n", 2);
- }
- return ret;
+ /* Parameters */
+ tsk_list_foreach(item, self->params) {
+ tsk_param_t* param = item->data;
+ separator = tsip_header_get_param_separator(self);
+ if((ret = tsk_buffer_append_2(output, param->value?"%c%s=%s":"%c%s", separator, param->name, param->value))) {
+ return ret;
+ }
+ }
+
+ /* CRLF */
+ tsk_buffer_append(output, "\r\n", 2);
+ }
+ return ret;
}
char* tsip_header_tostring(const tsip_header_t *self)
{
- tsk_buffer_t *output;
- char* ret = tsk_null;
- if(self && (output = tsk_buffer_create_null())){
- if(!tsip_header_serialize(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
- return ret;
+ tsk_buffer_t *output;
+ char* ret = tsk_null;
+ if(self && (output = tsk_buffer_create_null())) {
+ if(!tsip_header_serialize(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
+ return ret;
}
int tsip_header_value_serialize(const tsip_header_t *self, tsk_buffer_t *output)
{
- if(self && output){
- return TSIP_HEADER(self)->serialize(self, output);
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self && output) {
+ return TSIP_HEADER(self)->serialize(self, output);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
char* tsip_header_value_tostring(const tsip_header_t *self)
{
- tsk_buffer_t *output;
- char* ret = tsk_null;
- if(self && (output = tsk_buffer_create_null())){
- if(!tsip_header_value_serialize(self, output)){
- ret = tsk_strndup(output->data, output->size);
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
- return ret;
+ tsk_buffer_t *output;
+ char* ret = tsk_null;
+ if(self && (output = tsk_buffer_create_null())) {
+ if(!tsip_header_value_serialize(self, output)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
+ return ret;
}
char* tsip_header_get_param_value(const tsip_header_t *self, const char* pname)
{
- const tsk_param_t* _param;
- char* value = tsk_null;
+ const tsk_param_t* _param;
+ char* value = tsk_null;
+
+ if(!self || !pname) {
+ return tsk_null;
+ }
+
+ if(self->get_special_param_value && (value = self->get_special_param_value(self, pname))) {
+ return value;
+ }
- if(!self || !pname){
- return tsk_null;
- }
+ if((_param = tsk_params_get_param_by_name(self->params, pname))) {
+ return tsk_strdup(_param->value);
+ }
- if(self->get_special_param_value && (value = self->get_special_param_value(self, pname))){
- return value;
- }
-
- if((_param = tsk_params_get_param_by_name(self->params, pname))){
- return tsk_strdup(_param->value);
- }
-
- return tsk_null;
+ return tsk_null;
}
diff --git a/tinySIP/src/headers/tsip_header_Allow.c b/tinySIP/src/headers/tsip_header_Allow.c
index db0930b..7ed0f68 100755
--- a/tinySIP/src/headers/tsip_header_Allow.c
+++ b/tinySIP/src/headers/tsip_header_Allow.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,274 +47,285 @@
tsip_header_Allow_t* tsip_header_Allow_create()
{
- return tsk_object_new(tsip_header_Allow_def_t);
+ return tsk_object_new(tsip_header_Allow_def_t);
}
int tsip_header_Allow_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Allow_t *Allow = (const tsip_header_Allow_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Allow->methods){
- str = item->data;
- if(item == Allow->methods->head){
- tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- tsk_buffer_append_2(output, ",%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Allow_t *Allow = (const tsip_header_Allow_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Allow->methods) {
+ str = item->data;
+ if(item == Allow->methods->head) {
+ tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ tsk_buffer_append_2(output, ",%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Allow_t *tsip_header_Allow_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Allow_t *hdr_allow = tsip_header_Allow_create();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 89 "./src/headers/tsip_header_Allow.c" */
-static const char _tsip_machine_parser_header_Allow_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Allow_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 13,
- 30, 31, 47, 51, 52, 54, 57, 74,
- 75, 77, 93
-};
-
-static const char _tsip_machine_parser_header_Allow_trans_keys[] = {
- 65, 97, 76, 108, 76, 108, 79, 111,
- 87, 119, 9, 32, 58, 9, 13, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 13, 32, 33, 37, 39, 44, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 10, 9, 32, 9, 32,
- 44, 9, 13, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 3, 7,
- 1, 8, 4, 1, 2, 3, 7, 1,
- 2, 6, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 19,
- 32, 34, 47, 52, 54, 57, 61, 74,
- 76, 79, 91
-};
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Allow_t *hdr_allow = tsip_header_Allow_create();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 89 "./src/headers/tsip_header_Allow.c" */
+ static const char _tsip_machine_parser_header_Allow_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Allow_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 13,
+ 30, 31, 47, 51, 52, 54, 57, 74,
+ 75, 77, 93
+ };
+
+ static const char _tsip_machine_parser_header_Allow_trans_keys[] = {
+ 65, 97, 76, 108, 76, 108, 79, 111,
+ 87, 119, 9, 32, 58, 9, 13, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 13, 32, 33, 37, 39, 44, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 10, 9, 32, 9, 32,
+ 44, 9, 13, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 3, 7,
+ 1, 8, 4, 1, 2, 3, 7, 1,
+ 2, 6, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 19,
+ 32, 34, 47, 52, 54, 57, 61, 74,
+ 76, 79, 91
+ };
+
+ static const char _tsip_machine_parser_header_Allow_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 5,
+ 5, 6, 1, 6, 7, 6, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 1,
+ 9, 1, 10, 11, 10, 12, 12, 12,
+ 13, 12, 12, 12, 12, 12, 1, 14,
+ 15, 14, 16, 1, 17, 1, 18, 18,
+ 1, 18, 18, 16, 1, 16, 19, 16,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 1, 20, 1, 21, 21, 1, 21,
+ 21, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 18, 10, 8, 9, 14, 10, 11,
+ 14, 12, 13, 15, 16, 17
+ };
+
+ static const char _tsip_machine_parser_header_Allow_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 5, 3, 3, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Allow_start = 1;
+ static const int tsip_machine_parser_header_Allow_first_final = 18;
+ static const int tsip_machine_parser_header_Allow_error = 0;
+
+ static const int tsip_machine_parser_header_Allow_en_main = 1;
-static const char _tsip_machine_parser_header_Allow_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 5,
- 5, 6, 1, 6, 7, 6, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 1,
- 9, 1, 10, 11, 10, 12, 12, 12,
- 13, 12, 12, 12, 12, 12, 1, 14,
- 15, 14, 16, 1, 17, 1, 18, 18,
- 1, 18, 18, 16, 1, 16, 19, 16,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 1, 20, 1, 21, 21, 1, 21,
- 21, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 18, 10, 8, 9, 14, 10, 11,
- 14, 12, 13, 15, 16, 17
-};
-static const char _tsip_machine_parser_header_Allow_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 5, 3, 3, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Allow_start = 1;
-static const int tsip_machine_parser_header_Allow_first_final = 18;
-static const int tsip_machine_parser_header_Allow_error = 0;
-
-static const int tsip_machine_parser_header_Allow_en_main = 1;
-
-
(void)(tsip_machine_parser_header_Allow_first_final);
-/* #line 109 "./ragel/tsip_parser_header_Allow.rl" */
- (void)(eof);
- (void)(void)(tsip_machine_parser_header_Allow_first_final);
- (void)(void)(tsip_machine_parser_header_Allow_error);
- (void)(void)(tsip_machine_parser_header_Allow_en_main);
-
-/* #line 173 "./src/headers/tsip_header_Allow.c" */
- {
- cs = tsip_machine_parser_header_Allow_start;
- }
-
-/* #line 114 "./ragel/tsip_parser_header_Allow.rl" */
-
-/* #line 180 "./src/headers/tsip_header_Allow.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 109 "./ragel/tsip_parser_header_Allow.rl" */
+ (void)(eof);
+ (void)(void)(tsip_machine_parser_header_Allow_first_final);
+ (void)(void)(tsip_machine_parser_header_Allow_error);
+ (void)(void)(tsip_machine_parser_header_Allow_en_main);
+
+ /* #line 173 "./src/headers/tsip_header_Allow.c" */
+ {
+ cs = tsip_machine_parser_header_Allow_start;
+ }
+
+ /* #line 114 "./ragel/tsip_parser_header_Allow.rl" */
+
+ /* #line 180 "./src/headers/tsip_header_Allow.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Allow_trans_keys + _tsip_machine_parser_header_Allow_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Allow_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Allow_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Allow_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Allow_trans_keys + _tsip_machine_parser_header_Allow_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Allow_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Allow_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Allow_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Allow_indicies[_trans];
- cs = _tsip_machine_parser_header_Allow_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Allow_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Allow_actions + _tsip_machine_parser_header_Allow_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Allow.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Allow.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_allow->methods);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Allow.rl" */
- {
- }
- break;
-/* #line 271 "./src/headers/tsip_header_Allow.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Allow_indicies[_trans];
+ cs = _tsip_machine_parser_header_Allow_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Allow_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Allow_actions + _tsip_machine_parser_header_Allow_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Allow.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Allow.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_allow->methods);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Allow.rl" */
+ {
+ }
+ break;
+ /* #line 271 "./src/headers/tsip_header_Allow.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 115 "./ragel/tsip_parser_header_Allow.rl" */
-
- if( cs <
-/* #line 287 "./src/headers/tsip_header_Allow.c" */
-18
-/* #line 116 "./ragel/tsip_parser_header_Allow.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Allow' header.");
- TSK_OBJECT_SAFE_FREE(hdr_allow);
- }
-
- return hdr_allow;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 115 "./ragel/tsip_parser_header_Allow.rl" */
+
+ if( cs <
+ /* #line 287 "./src/headers/tsip_header_Allow.c" */
+ 18
+ /* #line 116 "./ragel/tsip_parser_header_Allow.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Allow' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_allow);
+ }
+
+ return hdr_allow;
}
tsk_bool_t tsip_header_Allow_allows(const tsip_header_Allow_t* self, const char* method)
{
- const tsk_list_item_t* item;
- const tsk_string_t* string;
-
- if(!self || !method){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_list_foreach(item, self->methods){
- if(!(string = item->data)){
- continue;
- }
- if(tsk_striequals(string->value, method)){
- return tsk_true;
- }
- }
- return tsk_false;
+ const tsk_list_item_t* item;
+ const tsk_string_t* string;
+
+ if(!self || !method) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_list_foreach(item, self->methods) {
+ if(!(string = item->data)) {
+ continue;
+ }
+ if(tsk_striequals(string->value, method)) {
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
@@ -327,39 +338,40 @@ tsk_bool_t tsip_header_Allow_allows(const tsip_header_Allow_t* self, const char*
static tsk_object_t* tsip_header_Allow_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Allow_t *Allow = self;
- if(Allow){
- /*const char* methods = va_arg(*app, const char *);
- if(methods && !tsk_strempty(methods))
- {
- Allow->methods = tsip_header_Allow_parse(methods, tsk_strlen(methods));
- }*/
- TSIP_HEADER(Allow)->type = tsip_htype_Allow;
- TSIP_HEADER(Allow)->serialize = tsip_header_Allow_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Allow header.");
- }
- return self;
+ tsip_header_Allow_t *Allow = self;
+ if(Allow) {
+ /*const char* methods = va_arg(*app, const char *);
+ if(methods && !tsk_strempty(methods))
+ {
+ Allow->methods = tsip_header_Allow_parse(methods, tsk_strlen(methods));
+ }*/
+ TSIP_HEADER(Allow)->type = tsip_htype_Allow;
+ TSIP_HEADER(Allow)->serialize = tsip_header_Allow_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Allow header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Allow_dtor(tsk_object_t *self)
{
- tsip_header_Allow_t *Allow = self;
- if(Allow){
- TSK_OBJECT_SAFE_FREE(Allow->methods);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Allow));
- }
- else TSK_DEBUG_ERROR("Null Allow header.");
-
- return self;
+ tsip_header_Allow_t *Allow = self;
+ if(Allow) {
+ TSK_OBJECT_SAFE_FREE(Allow->methods);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Allow));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Allow header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Allow_def_s =
-{
- sizeof(tsip_header_Allow_t),
- tsip_header_Allow_ctor,
- tsip_header_Allow_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Allow_def_s = {
+ sizeof(tsip_header_Allow_t),
+ tsip_header_Allow_ctor,
+ tsip_header_Allow_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Allow_def_t = &tsip_header_Allow_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Allow_Events.c b/tinySIP/src/headers/tsip_header_Allow_Events.c
index e86a9c4..f925414 100755
--- a/tinySIP/src/headers/tsip_header_Allow_Events.c
+++ b/tinySIP/src/headers/tsip_header_Allow_Events.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,261 +48,272 @@
tsip_header_Allow_Events_t* tsip_header_Allow_Events_create()
{
- return tsk_object_new(tsip_header_Allow_Events_def_t);
+ return tsk_object_new(tsip_header_Allow_Events_def_t);
}
int tsip_header_Allow_Events_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Allow_Events_t *Allow_Events = (const tsip_header_Allow_Events_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Allow_Events->events){
- str = item->data;
- if(item == Allow_Events->events->head){
- tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- tsk_buffer_append_2(output, ",%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Allow_Events_t *Allow_Events = (const tsip_header_Allow_Events_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Allow_Events->events) {
+ str = item->data;
+ if(item == Allow_Events->events->head) {
+ tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ tsk_buffer_append_2(output, ",%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Allow_Events_t *tsip_header_Allow_Events_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Allow_Events_t *hdr_allow_events = tsip_header_Allow_Events_create();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 90 "./src/headers/tsip_header_Allow_Events.c" */
-static const char _tsip_machine_parser_header_Allow_events_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Allow_events_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 13,
- 15, 17, 19, 21, 23, 25, 28, 44,
- 45, 47, 62, 79, 83, 84, 86, 89,
- 90, 103
-};
-
-static const char _tsip_machine_parser_header_Allow_events_trans_keys[] = {
- 65, 85, 97, 117, 76, 108, 76, 108,
- 79, 111, 87, 119, 45, 69, 101, 86,
- 118, 69, 101, 78, 110, 84, 116, 83,
- 115, 9, 32, 58, 9, 13, 32, 33,
- 37, 39, 45, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 45, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 46, 126, 42,
- 45, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 10, 9, 32, 9, 32,
- 44, 10, 33, 37, 39, 45, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_events_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 3, 8, 1,
- 2, 7, 9, 4, 1, 2, 3, 1,
- 5, 0
-};
-
-static const char _tsip_machine_parser_header_Allow_events_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 0,
- 0, 4, 4, 0, 0, 0, 0, 0,
- 4, 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Allow_events_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 19,
- 22, 25, 28, 31, 34, 37, 41, 54,
- 56, 59, 71, 85, 90, 92, 95, 99,
- 101, 111
-};
-
-static const char _tsip_machine_parser_header_Allow_events_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 1, 8, 8, 1, 9, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 2, 2, 1, 2, 2, 13,
- 1, 13, 14, 13, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 1, 16, 1,
- 17, 17, 1, 17, 17, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 1, 18,
- 19, 18, 20, 20, 20, 21, 22, 20,
- 20, 20, 20, 20, 1, 23, 24, 23,
- 13, 1, 25, 1, 26, 26, 1, 26,
- 26, 13, 1, 27, 1, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 1, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_Allow_events_trans_targs[] = {
- 2, 0, 13, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 14, 15, 18,
- 16, 17, 19, 23, 18, 14, 24, 19,
- 20, 21, 22, 25
-};
-
-static const char _tsip_machine_parser_header_Allow_events_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 3, 3, 0, 3, 0, 0,
- 0, 0, 0, 5
-};
-
-static const int tsip_machine_parser_header_Allow_events_start = 1;
-static const int tsip_machine_parser_header_Allow_events_first_final = 25;
-static const int tsip_machine_parser_header_Allow_events_error = 0;
-
-static const int tsip_machine_parser_header_Allow_events_en_main = 1;
-
-
-/* #line 111 "./ragel/tsip_parser_header_Allow_Events.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Allow_events_first_final);
- (void)(tsip_machine_parser_header_Allow_events_error);
- (void)(tsip_machine_parser_header_Allow_events_en_main);
-
-/* #line 184 "./src/headers/tsip_header_Allow_Events.c" */
- {
- cs = tsip_machine_parser_header_Allow_events_start;
- }
-
-/* #line 116 "./ragel/tsip_parser_header_Allow_Events.rl" */
-
-/* #line 191 "./src/headers/tsip_header_Allow_Events.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Allow_Events_t *hdr_allow_events = tsip_header_Allow_Events_create();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 90 "./src/headers/tsip_header_Allow_Events.c" */
+ static const char _tsip_machine_parser_header_Allow_events_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 13,
+ 15, 17, 19, 21, 23, 25, 28, 44,
+ 45, 47, 62, 79, 83, 84, 86, 89,
+ 90, 103
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_trans_keys[] = {
+ 65, 85, 97, 117, 76, 108, 76, 108,
+ 79, 111, 87, 119, 45, 69, 101, 86,
+ 118, 69, 101, 78, 110, 84, 116, 83,
+ 115, 9, 32, 58, 9, 13, 32, 33,
+ 37, 39, 45, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 45, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 46, 126, 42,
+ 45, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 10, 9, 32, 9, 32,
+ 44, 10, 33, 37, 39, 45, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 3, 8, 1,
+ 2, 7, 9, 4, 1, 2, 3, 1,
+ 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 4, 0,
+ 0, 4, 4, 0, 0, 0, 0, 0,
+ 4, 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Allow_events_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 19,
+ 22, 25, 28, 31, 34, 37, 41, 54,
+ 56, 59, 71, 85, 90, 92, 95, 99,
+ 101, 111
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 1, 8, 8, 1, 9, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 2, 2, 1, 2, 2, 13,
+ 1, 13, 14, 13, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 1, 16, 1,
+ 17, 17, 1, 17, 17, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 1, 18,
+ 19, 18, 20, 20, 20, 21, 22, 20,
+ 20, 20, 20, 20, 1, 23, 24, 23,
+ 13, 1, 25, 1, 26, 26, 1, 26,
+ 26, 13, 1, 27, 1, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 1, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_trans_targs[] = {
+ 2, 0, 13, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 14, 15, 18,
+ 16, 17, 19, 23, 18, 14, 24, 19,
+ 20, 21, 22, 25
+ };
+
+ static const char _tsip_machine_parser_header_Allow_events_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 3, 3, 0, 3, 0, 0,
+ 0, 0, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Allow_events_start = 1;
+ static const int tsip_machine_parser_header_Allow_events_first_final = 25;
+ static const int tsip_machine_parser_header_Allow_events_error = 0;
+
+ static const int tsip_machine_parser_header_Allow_events_en_main = 1;
+
+
+ /* #line 111 "./ragel/tsip_parser_header_Allow_Events.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Allow_events_first_final);
+ (void)(tsip_machine_parser_header_Allow_events_error);
+ (void)(tsip_machine_parser_header_Allow_events_en_main);
+
+ /* #line 184 "./src/headers/tsip_header_Allow_Events.c" */
+ {
+ cs = tsip_machine_parser_header_Allow_events_start;
+ }
+
+ /* #line 116 "./ragel/tsip_parser_header_Allow_Events.rl" */
+
+ /* #line 191 "./src/headers/tsip_header_Allow_Events.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Allow_events_trans_keys + _tsip_machine_parser_header_Allow_events_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Allow_events_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Allow_events_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Allow_events_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Allow_events_trans_keys + _tsip_machine_parser_header_Allow_events_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Allow_events_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Allow_events_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Allow_events_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Allow_events_indicies[_trans];
- cs = _tsip_machine_parser_header_Allow_events_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Allow_events_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Allow_events_actions + _tsip_machine_parser_header_Allow_events_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_Allow_Events.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Allow_Events.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_allow_events->events);
- }
- break;
- case 2:
-/* #line 57 "./ragel/tsip_parser_header_Allow_Events.rl" */
- {
- }
- break;
-/* #line 282 "./src/headers/tsip_header_Allow_Events.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Allow_events_indicies[_trans];
+ cs = _tsip_machine_parser_header_Allow_events_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Allow_events_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Allow_events_actions + _tsip_machine_parser_header_Allow_events_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_Allow_Events.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Allow_Events.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_allow_events->events);
+ }
+ break;
+ case 2:
+ /* #line 57 "./ragel/tsip_parser_header_Allow_Events.rl" */
+ {
+ }
+ break;
+ /* #line 282 "./src/headers/tsip_header_Allow_Events.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 117 "./ragel/tsip_parser_header_Allow_Events.rl" */
-
- if( cs <
-/* #line 298 "./src/headers/tsip_header_Allow_Events.c" */
-25
-/* #line 118 "./ragel/tsip_parser_header_Allow_Events.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Allow-Events' header.");
- TSK_OBJECT_SAFE_FREE(hdr_allow_events);
- }
-
- return hdr_allow_events;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 117 "./ragel/tsip_parser_header_Allow_Events.rl" */
+
+ if( cs <
+ /* #line 298 "./src/headers/tsip_header_Allow_Events.c" */
+ 25
+ /* #line 118 "./ragel/tsip_parser_header_Allow_Events.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Allow-Events' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_allow_events);
+ }
+
+ return hdr_allow_events;
}
@@ -317,36 +328,35 @@ _again:
static tsk_object_t* tsip_header_Allow_Events_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Allow_Events_t *Allow_events = self;
- if(Allow_events){
- TSIP_HEADER(Allow_events)->type = tsip_htype_Allow_Events;
- TSIP_HEADER(Allow_events)->serialize = tsip_header_Allow_Events_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Allow-Events header.");
- }
- return self;
+ tsip_header_Allow_Events_t *Allow_events = self;
+ if(Allow_events) {
+ TSIP_HEADER(Allow_events)->type = tsip_htype_Allow_Events;
+ TSIP_HEADER(Allow_events)->serialize = tsip_header_Allow_Events_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Allow-Events header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Allow_Events_dtor(tsk_object_t *self)
{
- tsip_header_Allow_Events_t *Allow_events = self;
- if(Allow_events){
- TSK_OBJECT_SAFE_FREE(Allow_events->events);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Allow_events));
- }
- else{
- TSK_DEBUG_ERROR("Null Allow-Events header.");
- }
-
- return self;
+ tsip_header_Allow_Events_t *Allow_events = self;
+ if(Allow_events) {
+ TSK_OBJECT_SAFE_FREE(Allow_events->events);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Allow_events));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Allow-Events header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Allow_Events_def_s =
-{
- sizeof(tsip_header_Allow_Events_t),
- tsip_header_Allow_Events_ctor,
- tsip_header_Allow_Events_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Allow_Events_def_s = {
+ sizeof(tsip_header_Allow_Events_t),
+ tsip_header_Allow_Events_ctor,
+ tsip_header_Allow_Events_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Allow_Events_def_t = &tsip_header_Allow_Events_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Authorization.c b/tinySIP/src/headers/tsip_header_Authorization.c
index 92c9fdc..f29e752 100755
--- a/tinySIP/src/headers/tsip_header_Authorization.c
+++ b/tinySIP/src/headers/tsip_header_Authorization.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,85 +41,85 @@
tsip_header_Authorization_t* tsip_header_Authorization_create()
{
- return tsk_object_new(tsip_header_Authorization_def_t);
+ return tsk_object_new(tsip_header_Authorization_def_t);
}
int tsip_header_Authorization_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Authorization_t *Authorization = (const tsip_header_Authorization_t *)header;
- if(Authorization && Authorization->scheme){
- return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- Authorization->scheme,
-
- Authorization->username ? "username=\"" : "",
- Authorization->username ? Authorization->username : "",
- Authorization->username ? "\"" : "",
-
- Authorization->realm ? ",realm=\"" : "",
- Authorization->realm ? Authorization->realm : "",
- Authorization->realm ? "\"" : "",
-
- Authorization->nonce ? ",nonce=\"" : "",
- Authorization->nonce ? Authorization->nonce : "",
- Authorization->nonce ? "\"" : "",
-
- Authorization->uri ? ",uri=\"" : "",
- Authorization->uri ? Authorization->uri : "",
- Authorization->uri ? "\"" : "",
-
- Authorization->response ? ",response=\"" : "",
- Authorization->response ? Authorization->response : "",
- Authorization->response ? "\"" : "",
-
- Authorization->algorithm ? ",algorithm=" : "",
- Authorization->algorithm ? Authorization->algorithm : "",
-
- Authorization->cnonce ? ",cnonce=\"" : "",
- Authorization->cnonce ? Authorization->cnonce : "",
- Authorization->cnonce ? "\"" : "",
-
- Authorization->opaque ? ",opaque=\"" : "",
- Authorization->opaque ? Authorization->opaque : "",
- Authorization->opaque ? "\"" : "",
-
- Authorization->qop ? ",qop=" : "",
- Authorization->qop ? Authorization->qop : "",
-
- Authorization->nc ? ",nc=" : "",
- Authorization->nc ? Authorization->nc : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tsip_header_Authorization_t *Authorization = (const tsip_header_Authorization_t *)header;
+ if(Authorization && Authorization->scheme) {
+ return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ Authorization->scheme,
+
+ Authorization->username ? "username=\"" : "",
+ Authorization->username ? Authorization->username : "",
+ Authorization->username ? "\"" : "",
+
+ Authorization->realm ? ",realm=\"" : "",
+ Authorization->realm ? Authorization->realm : "",
+ Authorization->realm ? "\"" : "",
+
+ Authorization->nonce ? ",nonce=\"" : "",
+ Authorization->nonce ? Authorization->nonce : "",
+ Authorization->nonce ? "\"" : "",
+
+ Authorization->uri ? ",uri=\"" : "",
+ Authorization->uri ? Authorization->uri : "",
+ Authorization->uri ? "\"" : "",
+
+ Authorization->response ? ",response=\"" : "",
+ Authorization->response ? Authorization->response : "",
+ Authorization->response ? "\"" : "",
+
+ Authorization->algorithm ? ",algorithm=" : "",
+ Authorization->algorithm ? Authorization->algorithm : "",
+
+ Authorization->cnonce ? ",cnonce=\"" : "",
+ Authorization->cnonce ? Authorization->cnonce : "",
+ Authorization->cnonce ? "\"" : "",
+
+ Authorization->opaque ? ",opaque=\"" : "",
+ Authorization->opaque ? Authorization->opaque : "",
+ Authorization->opaque ? "\"" : "",
+
+ Authorization->qop ? ",qop=" : "",
+ Authorization->qop ? Authorization->qop : "",
+
+ Authorization->nc ? ",nc=" : "",
+ Authorization->nc ? Authorization->nc : ""
+ );
+ }
+ }
+ return -1;
}
tsip_header_Authorization_t *tsip_header_Authorization_parse(const char *data, tsk_size_t size)
{
- tsip_header_Authorization_t *hdr_sip = 0;
- thttp_header_Authorization_t* hdr_http;
-
- if((hdr_http = thttp_header_Authorization_parse(data, size))){
- hdr_sip = tsip_header_Authorization_create();
-
- hdr_sip->scheme = tsk_strdup(hdr_http->scheme);
- hdr_sip->username = tsk_strdup(hdr_http->username);
- hdr_sip->realm = tsk_strdup(hdr_http->realm);
- hdr_sip->nonce = tsk_strdup(hdr_http->nonce);
- hdr_sip->uri = tsk_strdup(hdr_http->uri);
- hdr_sip->response = tsk_strdup(hdr_http->response);
- hdr_sip->algorithm = tsk_strdup(hdr_http->algorithm);
- hdr_sip->cnonce = tsk_strdup(hdr_http->cnonce);
- hdr_sip->opaque = tsk_strdup(hdr_http->opaque);
- hdr_sip->qop = tsk_strdup(hdr_http->qop);
- hdr_sip->nc = tsk_strdup(hdr_http->nc);
-
- TSIP_HEADER(hdr_sip)->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
-
- TSK_OBJECT_SAFE_FREE(hdr_http);
- }
-
- return hdr_sip;
+ tsip_header_Authorization_t *hdr_sip = 0;
+ thttp_header_Authorization_t* hdr_http;
+
+ if((hdr_http = thttp_header_Authorization_parse(data, size))) {
+ hdr_sip = tsip_header_Authorization_create();
+
+ hdr_sip->scheme = tsk_strdup(hdr_http->scheme);
+ hdr_sip->username = tsk_strdup(hdr_http->username);
+ hdr_sip->realm = tsk_strdup(hdr_http->realm);
+ hdr_sip->nonce = tsk_strdup(hdr_http->nonce);
+ hdr_sip->uri = tsk_strdup(hdr_http->uri);
+ hdr_sip->response = tsk_strdup(hdr_http->response);
+ hdr_sip->algorithm = tsk_strdup(hdr_http->algorithm);
+ hdr_sip->cnonce = tsk_strdup(hdr_http->cnonce);
+ hdr_sip->opaque = tsk_strdup(hdr_http->opaque);
+ hdr_sip->qop = tsk_strdup(hdr_http->qop);
+ hdr_sip->nc = tsk_strdup(hdr_http->nc);
+
+ TSIP_HEADER(hdr_sip)->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
+
+ TSK_OBJECT_SAFE_FREE(hdr_http);
+ }
+
+ return hdr_sip;
}
@@ -134,47 +134,48 @@ tsip_header_Authorization_t *tsip_header_Authorization_parse(const char *data, t
*/
static tsk_object_t* tsip_header_Authorization_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Authorization_t *Authorization = self;
- if(Authorization){
- TSIP_HEADER(Authorization)->type = tsip_htype_Authorization;
- TSIP_HEADER(Authorization)->serialize = tsip_header_Authorization_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Authorization header.");
- }
- return self;
+ tsip_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ TSIP_HEADER(Authorization)->type = tsip_htype_Authorization;
+ TSIP_HEADER(Authorization)->serialize = tsip_header_Authorization_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Authorization header.");
+ }
+ return self;
}
/**@ingroup tsip_header_Authorization_group
*/
static tsk_object_t* tsip_header_Authorization_dtor(tsk_object_t *self)
{
- tsip_header_Authorization_t *Authorization = self;
- if(Authorization){
- TSK_FREE(Authorization->scheme);
- TSK_FREE(Authorization->username);
- TSK_FREE(Authorization->realm);
- TSK_FREE(Authorization->nonce);
- TSK_FREE(Authorization->uri);
- TSK_FREE(Authorization->response);
- TSK_FREE(Authorization->algorithm);
- TSK_FREE(Authorization->cnonce);
- TSK_FREE(Authorization->opaque);
- TSK_FREE(Authorization->qop);
- TSK_FREE(Authorization->nc);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Authorization));
- }
- else TSK_DEBUG_ERROR("Null Authorization header.");
-
- return self;
+ tsip_header_Authorization_t *Authorization = self;
+ if(Authorization) {
+ TSK_FREE(Authorization->scheme);
+ TSK_FREE(Authorization->username);
+ TSK_FREE(Authorization->realm);
+ TSK_FREE(Authorization->nonce);
+ TSK_FREE(Authorization->uri);
+ TSK_FREE(Authorization->response);
+ TSK_FREE(Authorization->algorithm);
+ TSK_FREE(Authorization->cnonce);
+ TSK_FREE(Authorization->opaque);
+ TSK_FREE(Authorization->qop);
+ TSK_FREE(Authorization->nc);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Authorization));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Authorization header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Authorization_def_s =
-{
- sizeof(tsip_header_Authorization_t),
- tsip_header_Authorization_ctor,
- tsip_header_Authorization_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Authorization_def_s = {
+ sizeof(tsip_header_Authorization_t),
+ tsip_header_Authorization_ctor,
+ tsip_header_Authorization_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Authorization_def_t = &tsip_header_Authorization_def_s;
diff --git a/tinySIP/src/headers/tsip_header_CSeq.c b/tinySIP/src/headers/tsip_header_CSeq.c
index ca168ea..eaec8f9 100755
--- a/tinySIP/src/headers/tsip_header_CSeq.c
+++ b/tinySIP/src/headers/tsip_header_CSeq.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,243 +48,254 @@ extern tsip_request_type_t tsip_request_get_type(const char* method);
tsip_header_CSeq_t* tsip_header_CSeq_create(int32_t seq, const char*method)
{
- return tsk_object_new(TSIP_HEADER_CSEQ_VA_ARGS(seq, method));
+ return tsk_object_new(TSIP_HEADER_CSEQ_VA_ARGS(seq, method));
}
int tsip_header_CSeq_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_CSeq_t *CSeq = (const tsip_header_CSeq_t *)header;
- return tsk_buffer_append_2(output, "%u %s", CSeq->seq, CSeq->method);
- }
- return -1;
+ if(header) {
+ const tsip_header_CSeq_t *CSeq = (const tsip_header_CSeq_t *)header;
+ return tsk_buffer_append_2(output, "%u %s", CSeq->seq, CSeq->method);
+ }
+ return -1;
}
tsip_header_CSeq_t *tsip_header_CSeq_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_CSeq_t *hdr_cseq = tsip_header_CSeq_create(TSIP_HEADER_CSEQ_NONE, tsk_null);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 75 "./src/headers/tsip_header_CSeq.c" */
-static const char _tsip_machine_parser_header_CSeq_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const char _tsip_machine_parser_header_CSeq_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 16,
- 17, 19, 23, 28, 45, 46, 48, 64,
- 79, 80
-};
-
-static const char _tsip_machine_parser_header_CSeq_trans_keys[] = {
- 67, 99, 83, 115, 69, 101, 81, 113,
- 9, 32, 58, 9, 13, 32, 48, 57,
- 10, 9, 32, 9, 32, 48, 57, 9,
- 13, 32, 48, 57, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 32, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 0
-};
-
-static const char _tsip_machine_parser_header_CSeq_single_lengths[] = {
- 0, 2, 2, 2, 2, 3, 3, 1,
- 2, 2, 3, 7, 1, 2, 6, 5,
- 1, 0
-};
-
-static const char _tsip_machine_parser_header_CSeq_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 1, 1, 5, 0, 0, 5, 5,
- 0, 0
-};
-
-static const char _tsip_machine_parser_header_CSeq_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 16, 21,
- 23, 26, 30, 35, 48, 50, 53, 65,
- 76, 78
-};
-
-static const char _tsip_machine_parser_header_CSeq_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 4, 4, 5, 1,
- 5, 6, 5, 7, 1, 8, 1, 9,
- 9, 1, 9, 9, 7, 1, 10, 11,
- 10, 12, 1, 13, 14, 13, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 1,
- 16, 1, 17, 17, 1, 17, 17, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 1, 18, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 1, 20, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_CSeq_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 10,
- 8, 9, 11, 12, 10, 11, 12, 15,
- 13, 14, 16, 15, 17
-};
-
-static const char _tsip_machine_parser_header_CSeq_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 5, 5, 0, 0, 0, 1,
- 0, 0, 3, 0, 7
-};
-
-static const int tsip_machine_parser_header_CSeq_start = 1;
-static const int tsip_machine_parser_header_CSeq_first_final = 17;
-static const int tsip_machine_parser_header_CSeq_error = 0;
-
-static const int tsip_machine_parser_header_CSeq_en_main = 1;
-
-
-/* #line 96 "./ragel/tsip_parser_header_CSeq.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_CSeq_first_final);
- (void)(tsip_machine_parser_header_CSeq_error);
- (void)(tsip_machine_parser_header_CSeq_en_main);
-
-/* #line 157 "./src/headers/tsip_header_CSeq.c" */
- {
- cs = tsip_machine_parser_header_CSeq_start;
- }
-
-/* #line 101 "./ragel/tsip_parser_header_CSeq.rl" */
-
-/* #line 164 "./src/headers/tsip_header_CSeq.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_CSeq_t *hdr_cseq = tsip_header_CSeq_create(TSIP_HEADER_CSEQ_NONE, tsk_null);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 75 "./src/headers/tsip_header_CSeq.c" */
+ static const char _tsip_machine_parser_header_CSeq_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 16,
+ 17, 19, 23, 28, 45, 46, 48, 64,
+ 79, 80
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_trans_keys[] = {
+ 67, 99, 83, 115, 69, 101, 81, 113,
+ 9, 32, 58, 9, 13, 32, 48, 57,
+ 10, 9, 32, 9, 32, 48, 57, 9,
+ 13, 32, 48, 57, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 32, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_single_lengths[] = {
+ 0, 2, 2, 2, 2, 3, 3, 1,
+ 2, 2, 3, 7, 1, 2, 6, 5,
+ 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 1, 1, 5, 0, 0, 5, 5,
+ 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 16, 21,
+ 23, 26, 30, 35, 48, 50, 53, 65,
+ 76, 78
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 4, 4, 5, 1,
+ 5, 6, 5, 7, 1, 8, 1, 9,
+ 9, 1, 9, 9, 7, 1, 10, 11,
+ 10, 12, 1, 13, 14, 13, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 1,
+ 16, 1, 17, 17, 1, 17, 17, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15,
+ 1, 18, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 1, 20, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 10,
+ 8, 9, 11, 12, 10, 11, 12, 15,
+ 13, 14, 16, 15, 17
+ };
+
+ static const char _tsip_machine_parser_header_CSeq_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 5, 5, 0, 0, 0, 1,
+ 0, 0, 3, 0, 7
+ };
+
+ static const int tsip_machine_parser_header_CSeq_start = 1;
+ static const int tsip_machine_parser_header_CSeq_first_final = 17;
+ static const int tsip_machine_parser_header_CSeq_error = 0;
+
+ static const int tsip_machine_parser_header_CSeq_en_main = 1;
+
+
+ /* #line 96 "./ragel/tsip_parser_header_CSeq.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_CSeq_first_final);
+ (void)(tsip_machine_parser_header_CSeq_error);
+ (void)(tsip_machine_parser_header_CSeq_en_main);
+
+ /* #line 157 "./src/headers/tsip_header_CSeq.c" */
+ {
+ cs = tsip_machine_parser_header_CSeq_start;
+ }
+
+ /* #line 101 "./ragel/tsip_parser_header_CSeq.rl" */
+
+ /* #line 164 "./src/headers/tsip_header_CSeq.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_CSeq_trans_keys + _tsip_machine_parser_header_CSeq_key_offsets[cs];
- _trans = _tsip_machine_parser_header_CSeq_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_CSeq_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_CSeq_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_CSeq_trans_keys + _tsip_machine_parser_header_CSeq_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_CSeq_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_CSeq_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_CSeq_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_CSeq_indicies[_trans];
- cs = _tsip_machine_parser_header_CSeq_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_CSeq_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_CSeq_actions + _tsip_machine_parser_header_CSeq_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_CSeq.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_CSeq.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_cseq->method);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_CSeq.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_cseq->seq);
- }
- break;
- case 3:
-/* #line 60 "./ragel/tsip_parser_header_CSeq.rl" */
- {
- }
- break;
-/* #line 261 "./src/headers/tsip_header_CSeq.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_CSeq_indicies[_trans];
+ cs = _tsip_machine_parser_header_CSeq_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_CSeq_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_CSeq_actions + _tsip_machine_parser_header_CSeq_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_CSeq.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_CSeq.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_cseq->method);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_CSeq.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_cseq->seq);
+ }
+ break;
+ case 3:
+ /* #line 60 "./ragel/tsip_parser_header_CSeq.rl" */
+ {
+ }
+ break;
+ /* #line 261 "./src/headers/tsip_header_CSeq.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 102 "./ragel/tsip_parser_header_CSeq.rl" */
-
- if( cs <
-/* #line 277 "./src/headers/tsip_header_CSeq.c" */
-17
-/* #line 103 "./ragel/tsip_parser_header_CSeq.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'CSeq' header.");
- TSK_OBJECT_SAFE_FREE(hdr_cseq);
- }
- else {
- hdr_cseq->type = tsip_request_get_type(hdr_cseq->method);
- }
-
- return hdr_cseq;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 102 "./ragel/tsip_parser_header_CSeq.rl" */
+
+ if( cs <
+ /* #line 277 "./src/headers/tsip_header_CSeq.c" */
+ 17
+ /* #line 103 "./ragel/tsip_parser_header_CSeq.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'CSeq' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_cseq);
+ }
+ else {
+ hdr_cseq->type = tsip_request_get_type(hdr_cseq->method);
+ }
+
+ return hdr_cseq;
}
@@ -299,46 +310,45 @@ _again:
static tsk_object_t* tsip_header_CSeq_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_CSeq_t *CSeq = self;
- if(CSeq){
- TSIP_HEADER(CSeq)->type = tsip_htype_CSeq;
- TSIP_HEADER(CSeq)->serialize = tsip_header_CSeq_serialize;
- CSeq->seq = va_arg(*app, uint32_t);
- CSeq->method = tsk_strdup(va_arg(*app, const char*));
-
- if(!tsk_strnullORempty(CSeq->method)){
- CSeq->type = tsip_request_get_type(CSeq->method);
- }
- else{
- CSeq->type = tsip_NONE;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new CSeq header.");
- }
- return self;
+ tsip_header_CSeq_t *CSeq = self;
+ if(CSeq) {
+ TSIP_HEADER(CSeq)->type = tsip_htype_CSeq;
+ TSIP_HEADER(CSeq)->serialize = tsip_header_CSeq_serialize;
+ CSeq->seq = va_arg(*app, uint32_t);
+ CSeq->method = tsk_strdup(va_arg(*app, const char*));
+
+ if(!tsk_strnullORempty(CSeq->method)) {
+ CSeq->type = tsip_request_get_type(CSeq->method);
+ }
+ else {
+ CSeq->type = tsip_NONE;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new CSeq header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_CSeq_dtor(tsk_object_t *self)
{
- tsip_header_CSeq_t *CSeq = self;
- if(CSeq){
- TSK_FREE(CSeq->method);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(CSeq));
- }
- else{
- TSK_DEBUG_ERROR("Null CSeq header.");
- }
-
- return self;
+ tsip_header_CSeq_t *CSeq = self;
+ if(CSeq) {
+ TSK_FREE(CSeq->method);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(CSeq));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null CSeq header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_CSeq_def_s =
-{
- sizeof(tsip_header_CSeq_t),
- tsip_header_CSeq_ctor,
- tsip_header_CSeq_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_CSeq_def_s = {
+ sizeof(tsip_header_CSeq_t),
+ tsip_header_CSeq_ctor,
+ tsip_header_CSeq_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_CSeq_def_t = &tsip_header_CSeq_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Call_ID.c b/tinySIP/src/headers/tsip_header_Call_ID.c
index 3920b53..7f400de 100755
--- a/tinySIP/src/headers/tsip_header_Call_ID.c
+++ b/tinySIP/src/headers/tsip_header_Call_ID.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,245 +51,256 @@
tsip_header_Call_ID_t* tsip_header_Call_ID_create(const char* call_id)
{
- return tsk_object_new(TSIP_HEADER_CALL_ID_VA_ARGS(call_id));
+ return tsk_object_new(TSIP_HEADER_CALL_ID_VA_ARGS(call_id));
}
int tsip_header_Call_ID_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Call_ID_t *Call_ID = (const tsip_header_Call_ID_t *)header;
- if(Call_ID->value){
- return tsk_buffer_append(output, Call_ID->value, tsk_strlen(Call_ID->value));
- }
- }
- return -1;
+ if(header) {
+ const tsip_header_Call_ID_t *Call_ID = (const tsip_header_Call_ID_t *)header;
+ if(Call_ID->value) {
+ return tsk_buffer_append(output, Call_ID->value, tsk_strlen(Call_ID->value));
+ }
+ }
+ return -1;
}
int tsip_header_Call_ID_random(tsk_uuidstring_t *result)
{
- return tsk_uuidgenerate(result);
+ return tsk_uuidgenerate(result);
}
tsip_header_Call_ID_t *tsip_header_Call_ID_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Call_ID_t *hdr_call_id = tsip_header_Call_ID_create(0);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 85 "./src/headers/tsip_header_Call_ID.c" */
-static const char _tsip_machine_parser_header_Call_ID_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Call_ID_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 11, 13,
- 15, 18, 37, 38, 40, 58, 74, 75,
- 91, 108
-};
-
-static const char _tsip_machine_parser_header_Call_ID_trans_keys[] = {
- 67, 73, 99, 105, 65, 97, 76, 108,
- 76, 108, 45, 73, 105, 68, 100, 9,
- 32, 58, 9, 13, 32, 37, 60, 33,
- 34, 39, 43, 45, 58, 62, 63, 65,
- 93, 95, 123, 125, 126, 10, 9, 32,
- 9, 32, 37, 60, 33, 34, 39, 43,
- 45, 58, 62, 63, 65, 93, 95, 123,
- 125, 126, 13, 37, 60, 64, 33, 34,
- 39, 43, 45, 58, 62, 93, 95, 123,
- 125, 126, 10, 37, 60, 33, 34, 39,
- 43, 45, 58, 62, 63, 65, 93, 95,
- 123, 125, 126, 13, 37, 60, 33, 34,
- 39, 43, 45, 58, 62, 63, 65, 93,
- 95, 123, 125, 126, 0
-};
-
-static const char _tsip_machine_parser_header_Call_ID_single_lengths[] = {
- 0, 4, 2, 2, 2, 1, 2, 2,
- 3, 5, 1, 2, 4, 4, 1, 2,
- 3, 0
-};
-
-static const char _tsip_machine_parser_header_Call_ID_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 0, 0, 7, 6, 0, 7,
- 7, 0
-};
-
-static const char _tsip_machine_parser_header_Call_ID_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 16, 19,
- 22, 26, 39, 41, 44, 56, 67, 69,
- 79, 90
-};
-
-static const char _tsip_machine_parser_header_Call_ID_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 1,
- 7, 7, 1, 2, 2, 1, 2, 2,
- 8, 1, 8, 9, 8, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 1, 11,
- 1, 12, 12, 1, 12, 12, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 1,
- 13, 14, 14, 15, 14, 14, 14, 14,
- 14, 14, 1, 16, 1, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 1, 13,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Call_ID_trans_targs[] = {
- 2, 0, 8, 3, 4, 5, 6, 7,
- 9, 10, 13, 11, 12, 14, 13, 15,
- 17, 16
-};
-
-static const char _tsip_machine_parser_header_Call_ID_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 3, 0, 0,
- 5, 0
-};
-
-static const int tsip_machine_parser_header_Call_ID_start = 1;
-static const int tsip_machine_parser_header_Call_ID_first_final = 17;
-static const int tsip_machine_parser_header_Call_ID_error = 0;
-
-static const int tsip_machine_parser_header_Call_ID_en_main = 1;
-
-
-/* #line 103 "./ragel/tsip_parser_header_Call_ID.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Call_ID_first_final);
- (void)(tsip_machine_parser_header_Call_ID_error);
- (void)(tsip_machine_parser_header_Call_ID_en_main);
-
-/* #line 171 "./src/headers/tsip_header_Call_ID.c" */
- {
- cs = tsip_machine_parser_header_Call_ID_start;
- }
-
-/* #line 108 "./ragel/tsip_parser_header_Call_ID.rl" */
-
-/* #line 178 "./src/headers/tsip_header_Call_ID.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Call_ID_t *hdr_call_id = tsip_header_Call_ID_create(0);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 85 "./src/headers/tsip_header_Call_ID.c" */
+ static const char _tsip_machine_parser_header_Call_ID_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 11, 13,
+ 15, 18, 37, 38, 40, 58, 74, 75,
+ 91, 108
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_trans_keys[] = {
+ 67, 73, 99, 105, 65, 97, 76, 108,
+ 76, 108, 45, 73, 105, 68, 100, 9,
+ 32, 58, 9, 13, 32, 37, 60, 33,
+ 34, 39, 43, 45, 58, 62, 63, 65,
+ 93, 95, 123, 125, 126, 10, 9, 32,
+ 9, 32, 37, 60, 33, 34, 39, 43,
+ 45, 58, 62, 63, 65, 93, 95, 123,
+ 125, 126, 13, 37, 60, 64, 33, 34,
+ 39, 43, 45, 58, 62, 93, 95, 123,
+ 125, 126, 10, 37, 60, 33, 34, 39,
+ 43, 45, 58, 62, 63, 65, 93, 95,
+ 123, 125, 126, 13, 37, 60, 33, 34,
+ 39, 43, 45, 58, 62, 63, 65, 93,
+ 95, 123, 125, 126, 0
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_single_lengths[] = {
+ 0, 4, 2, 2, 2, 1, 2, 2,
+ 3, 5, 1, 2, 4, 4, 1, 2,
+ 3, 0
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 0, 0, 7, 6, 0, 7,
+ 7, 0
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 16, 19,
+ 22, 26, 39, 41, 44, 56, 67, 69,
+ 79, 90
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 1,
+ 7, 7, 1, 2, 2, 1, 2, 2,
+ 8, 1, 8, 9, 8, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 1, 11,
+ 1, 12, 12, 1, 12, 12, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 1,
+ 13, 14, 14, 15, 14, 14, 14, 14,
+ 14, 14, 1, 16, 1, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 1, 13,
+ 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_trans_targs[] = {
+ 2, 0, 8, 3, 4, 5, 6, 7,
+ 9, 10, 13, 11, 12, 14, 13, 15,
+ 17, 16
+ };
+
+ static const char _tsip_machine_parser_header_Call_ID_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 3, 0, 0,
+ 5, 0
+ };
+
+ static const int tsip_machine_parser_header_Call_ID_start = 1;
+ static const int tsip_machine_parser_header_Call_ID_first_final = 17;
+ static const int tsip_machine_parser_header_Call_ID_error = 0;
+
+ static const int tsip_machine_parser_header_Call_ID_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsip_parser_header_Call_ID.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Call_ID_first_final);
+ (void)(tsip_machine_parser_header_Call_ID_error);
+ (void)(tsip_machine_parser_header_Call_ID_en_main);
+
+ /* #line 171 "./src/headers/tsip_header_Call_ID.c" */
+ {
+ cs = tsip_machine_parser_header_Call_ID_start;
+ }
+
+ /* #line 108 "./ragel/tsip_parser_header_Call_ID.rl" */
+
+ /* #line 178 "./src/headers/tsip_header_Call_ID.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Call_ID_trans_keys + _tsip_machine_parser_header_Call_ID_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Call_ID_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Call_ID_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Call_ID_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Call_ID_trans_keys + _tsip_machine_parser_header_Call_ID_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Call_ID_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Call_ID_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Call_ID_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Call_ID_indicies[_trans];
- cs = _tsip_machine_parser_header_Call_ID_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Call_ID_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Call_ID_actions + _tsip_machine_parser_header_Call_ID_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Call_ID.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Call_ID.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_call_id->value);
- }
- break;
- case 2:
-/* #line 59 "./ragel/tsip_parser_header_Call_ID.rl" */
- {
- }
- break;
-/* #line 269 "./src/headers/tsip_header_Call_ID.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Call_ID_indicies[_trans];
+ cs = _tsip_machine_parser_header_Call_ID_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Call_ID_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Call_ID_actions + _tsip_machine_parser_header_Call_ID_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Call_ID.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Call_ID.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_call_id->value);
+ }
+ break;
+ case 2:
+ /* #line 59 "./ragel/tsip_parser_header_Call_ID.rl" */
+ {
+ }
+ break;
+ /* #line 269 "./src/headers/tsip_header_Call_ID.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 109 "./ragel/tsip_parser_header_Call_ID.rl" */
-
- if( cs <
-/* #line 285 "./src/headers/tsip_header_Call_ID.c" */
-17
-/* #line 110 "./ragel/tsip_parser_header_Call_ID.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Call-ID' header.");
- TSK_OBJECT_SAFE_FREE(hdr_call_id);
- }
-
- return hdr_call_id;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 109 "./ragel/tsip_parser_header_Call_ID.rl" */
+
+ if( cs <
+ /* #line 285 "./src/headers/tsip_header_Call_ID.c" */
+ 17
+ /* #line 110 "./ragel/tsip_parser_header_Call_ID.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Call-ID' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_call_id);
+ }
+
+ return hdr_call_id;
}
@@ -304,37 +315,36 @@ _again:
static tsk_object_t* tsip_header_Call_ID_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Call_ID_t *Call_ID = self;
- if(Call_ID){
- Call_ID->value = tsk_strdup(va_arg(*app, const char *));
- TSIP_HEADER(Call_ID)->type = tsip_htype_Call_ID;
- TSIP_HEADER(Call_ID)->serialize = tsip_header_Call_ID_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Call-ID header.");
- }
- return self;
+ tsip_header_Call_ID_t *Call_ID = self;
+ if(Call_ID) {
+ Call_ID->value = tsk_strdup(va_arg(*app, const char *));
+ TSIP_HEADER(Call_ID)->type = tsip_htype_Call_ID;
+ TSIP_HEADER(Call_ID)->serialize = tsip_header_Call_ID_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Call-ID header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Call_ID_dtor(tsk_object_t *self)
{
- tsip_header_Call_ID_t *Call_ID = self;
- if(Call_ID){
- TSK_FREE(Call_ID->value);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Call_ID));
- }
- else{
- TSK_DEBUG_ERROR("Null Call-ID header.");
- }
-
- return self;
+ tsip_header_Call_ID_t *Call_ID = self;
+ if(Call_ID) {
+ TSK_FREE(Call_ID->value);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Call_ID));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Call-ID header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Call_ID_def_s =
-{
- sizeof(tsip_header_Call_ID_t),
- tsip_header_Call_ID_ctor,
- tsip_header_Call_ID_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Call_ID_def_s = {
+ sizeof(tsip_header_Call_ID_t),
+ tsip_header_Call_ID_ctor,
+ tsip_header_Call_ID_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Call_ID_def_t = &tsip_header_Call_ID_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Contact.c b/tinySIP/src/headers/tsip_header_Contact.c
index e7abd80..6bc0e89 100755
--- a/tinySIP/src/headers/tsip_header_Contact.c
+++ b/tinySIP/src/headers/tsip_header_Contact.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,566 +48,577 @@
tsip_header_Contact_t* tsip_header_Contact_create()
{
- return tsk_object_new(tsip_header_Contact_def_t);
+ return tsk_object_new(tsip_header_Contact_def_t);
}
int tsip_header_Contact_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Contact_t *Contact = (const tsip_header_Contact_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Contact->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- /* Expires */
- if(Contact->expires >=0){
- tsk_buffer_append_2(output, ";expires=%lld", Contact->expires);
- }
-
- return ret;
- }
-
- return -1;
-}
-
-
-tsip_header_Contacts_L_t *tsip_header_Contact_parse(const char *data, tsk_size_t size)
-{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Contacts_L_t *hdr_contacts = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Contact_t *curr_contact = 0;
-
-
-/* #line 90 "./src/headers/tsip_header_Contact.c" */
-static const char _tsip_machine_parser_header_Contact_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 2, 1, 0, 2, 3, 6, 2,
- 4, 6, 2, 5, 6
-};
-
-static const short _tsip_machine_parser_header_Contact_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 14,
- 16, 19, 40, 41, 43, 64, 65, 67,
- 71, 74, 75, 79, 91, 94, 94, 95,
- 100, 105, 106, 108, 112, 133, 134, 136,
- 157, 158, 160, 163, 180, 198, 202, 203,
- 205, 213, 214, 216, 220, 226, 246, 265,
- 270, 270, 275, 294, 295, 297, 315, 333,
- 339, 340, 342, 347, 366, 367, 369, 388,
- 389, 391, 394, 402, 403, 405, 410, 416,
- 433, 440, 448, 456, 464, 466, 473, 482,
- 484, 487, 489, 492, 494, 497, 500, 501,
- 504, 505, 508, 509, 518, 527, 535, 543,
- 551, 559, 561, 567, 576, 585, 594, 596,
- 599, 602, 603, 604, 624, 644, 664, 684,
- 704, 724, 742, 748, 749, 751, 756, 775,
- 776, 778, 797, 804, 821, 839, 843
-};
-
-static const char _tsip_machine_parser_header_Contact_trans_keys[] = {
- 67, 77, 99, 109, 79, 111, 78, 110,
- 84, 116, 65, 97, 67, 99, 84, 116,
- 9, 32, 58, 9, 13, 32, 33, 34,
- 37, 39, 42, 43, 60, 126, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 42, 43, 60, 126, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 10, 9, 32, 9, 32, 42, 60, 9,
- 13, 32, 10, 65, 90, 97, 122, 9,
- 32, 43, 58, 45, 46, 48, 57, 65,
- 90, 97, 122, 9, 32, 58, 62, 9,
- 13, 32, 44, 59, 9, 13, 32, 44,
- 59, 10, 9, 32, 9, 32, 44, 59,
- 9, 13, 32, 33, 34, 37, 39, 60,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 60,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 10, 9, 32,
- 9, 32, 60, 9, 13, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 60, 10, 9, 32, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 60, 0, 9, 11, 12,
- 14, 127, 9, 13, 32, 33, 37, 39,
- 42, 43, 58, 126, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 37, 39, 58, 60, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 58, 60, 9, 13,
- 32, 44, 59, 9, 13, 32, 33, 37,
- 39, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 61, 10, 9, 32, 9, 32,
- 44, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 32, 34, 13, 34, 92, 127, 0, 8,
- 10, 31, 10, 9, 32, 9, 13, 32,
- 44, 59, 0, 9, 11, 12, 14, 127,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 58, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 58, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 48,
- 57, 46, 48, 57, 48, 57, 93, 48,
- 57, 93, 48, 57, 93, 46, 48, 57,
- 46, 46, 48, 57, 46, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 46,
- 48, 57, 46, 58, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 88, 120, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 61, 80, 112, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 73, 105, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 61, 82, 114, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 69, 101, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 61, 83, 115, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 10, 9, 32, 9,
- 32, 44, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 48, 57, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 60, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 60, 0
-};
-
-static const char _tsip_machine_parser_header_Contact_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 2, 2,
- 3, 11, 1, 2, 11, 1, 2, 4,
- 3, 1, 0, 4, 3, 0, 1, 5,
- 5, 1, 2, 4, 9, 1, 2, 9,
- 1, 2, 3, 7, 8, 4, 1, 2,
- 4, 1, 2, 4, 0, 10, 9, 5,
- 0, 5, 9, 1, 2, 8, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 5, 0, 9,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 2, 2, 2,
- 2, 2, 0, 3, 3, 3, 0, 1,
- 1, 1, 1, 12, 12, 12, 12, 12,
- 12, 10, 6, 1, 2, 5, 9, 1,
- 2, 9, 5, 7, 8, 4, 0
-};
+ if(header) {
+ const tsip_header_Contact_t *Contact = (const tsip_header_Contact_t *)header;
+ int ret = 0;
-static const char _tsip_machine_parser_header_Contact_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 0, 0, 2, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 0, 0, 6,
- 0, 0, 0, 5, 5, 0, 0, 0,
- 2, 0, 0, 0, 3, 5, 5, 0,
- 0, 0, 5, 0, 0, 5, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 3, 4,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 1,
- 0, 1, 0, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 3, 3, 1, 1,
- 1, 0, 0, 4, 4, 4, 4, 4,
- 4, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 1, 5, 5, 0, 0
-};
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Contact->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
-static const short _tsip_machine_parser_header_Contact_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 20,
- 23, 27, 44, 46, 49, 66, 68, 71,
- 76, 80, 82, 85, 94, 98, 99, 101,
- 107, 113, 115, 118, 123, 139, 141, 144,
- 160, 162, 165, 169, 182, 196, 201, 203,
- 206, 213, 215, 218, 223, 227, 243, 258,
- 264, 265, 271, 286, 288, 291, 305, 320,
- 327, 329, 332, 338, 353, 355, 358, 373,
- 375, 378, 382, 389, 391, 394, 400, 404,
- 418, 423, 429, 435, 441, 444, 449, 456,
- 458, 461, 463, 466, 468, 471, 474, 476,
- 479, 481, 484, 486, 493, 500, 506, 512,
- 518, 524, 527, 531, 538, 545, 552, 554,
- 557, 560, 562, 564, 581, 598, 615, 632,
- 649, 666, 681, 688, 690, 693, 699, 714,
- 716, 719, 734, 741, 754, 768, 773
-};
+ /* Expires */
+ if(Contact->expires >=0) {
+ tsk_buffer_append_2(output, ";expires=%lld", Contact->expires);
+ }
-static const unsigned char _tsip_machine_parser_header_Contact_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 2, 2, 1, 2,
- 2, 8, 1, 9, 10, 9, 11, 12,
- 11, 11, 13, 11, 14, 11, 11, 11,
- 15, 11, 15, 1, 16, 1, 17, 17,
- 1, 18, 19, 18, 11, 12, 11, 11,
- 13, 11, 14, 11, 11, 11, 15, 11,
- 15, 1, 20, 1, 21, 21, 1, 21,
- 21, 22, 23, 1, 22, 24, 22, 1,
- 25, 1, 26, 26, 1, 27, 27, 28,
- 29, 28, 28, 28, 28, 1, 27, 27,
- 29, 1, 30, 31, 30, 32, 33, 32,
- 34, 35, 1, 36, 37, 36, 38, 35,
- 1, 39, 1, 40, 40, 1, 40, 40,
- 38, 35, 1, 41, 42, 41, 11, 12,
- 11, 11, 14, 11, 11, 11, 11, 15,
- 11, 15, 1, 43, 1, 44, 44, 1,
- 45, 46, 45, 11, 12, 11, 11, 14,
- 11, 11, 11, 11, 15, 11, 15, 1,
- 47, 1, 48, 48, 1, 48, 48, 23,
- 1, 49, 50, 49, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 1, 52, 53,
- 52, 51, 51, 51, 54, 51, 51, 51,
- 51, 51, 51, 1, 55, 56, 55, 23,
- 1, 57, 1, 49, 49, 1, 59, 60,
- 61, 1, 1, 1, 58, 62, 1, 58,
- 58, 1, 52, 53, 52, 54, 1, 58,
- 58, 58, 1, 63, 50, 63, 51, 51,
- 51, 51, 64, 65, 51, 64, 64, 64,
- 51, 64, 1, 66, 53, 66, 51, 51,
- 51, 65, 54, 51, 51, 51, 51, 51,
- 51, 1, 67, 56, 67, 65, 23, 1,
- 68, 69, 70, 69, 71, 72, 68, 35,
- 73, 35, 74, 74, 74, 75, 75, 74,
- 74, 74, 74, 74, 74, 1, 76, 1,
- 77, 77, 1, 77, 77, 74, 74, 74,
- 75, 75, 74, 74, 74, 74, 74, 74,
- 1, 78, 79, 78, 80, 80, 80, 81,
- 82, 83, 80, 80, 80, 80, 80, 1,
- 84, 85, 84, 38, 35, 83, 1, 86,
- 1, 87, 87, 1, 87, 87, 38, 35,
- 83, 1, 83, 88, 83, 89, 90, 89,
- 89, 91, 89, 89, 89, 89, 89, 89,
- 1, 92, 1, 93, 93, 1, 93, 94,
- 93, 89, 90, 89, 89, 91, 89, 89,
- 89, 89, 89, 89, 1, 95, 1, 96,
- 96, 1, 96, 96, 90, 1, 97, 98,
- 99, 1, 1, 1, 90, 100, 1, 90,
- 90, 1, 101, 79, 101, 81, 82, 1,
- 90, 90, 90, 1, 101, 79, 101, 89,
- 89, 89, 81, 82, 89, 89, 89, 89,
- 89, 1, 103, 102, 102, 102, 1, 105,
- 98, 104, 104, 104, 1, 105, 98, 106,
- 106, 106, 1, 105, 98, 107, 107, 107,
- 1, 105, 98, 1, 109, 108, 102, 102,
- 1, 110, 105, 98, 111, 104, 104, 1,
- 112, 1, 113, 114, 1, 115, 1, 116,
- 117, 1, 118, 1, 98, 119, 1, 98,
- 120, 1, 98, 1, 116, 121, 1, 116,
- 1, 113, 122, 1, 113, 1, 110, 105,
- 98, 123, 106, 106, 1, 110, 105, 98,
- 107, 107, 107, 1, 125, 98, 124, 124,
- 124, 1, 127, 98, 126, 126, 126, 1,
- 127, 98, 128, 128, 128, 1, 127, 98,
- 129, 129, 129, 1, 127, 98, 1, 130,
- 124, 124, 1, 110, 127, 98, 131, 126,
- 126, 1, 110, 127, 98, 132, 128, 128,
- 1, 110, 127, 98, 129, 129, 129, 1,
- 133, 1, 110, 134, 1, 110, 135, 1,
- 110, 1, 109, 1, 78, 79, 78, 80,
- 80, 80, 81, 82, 83, 136, 136, 80,
- 80, 80, 80, 80, 1, 78, 79, 78,
- 80, 80, 80, 81, 82, 83, 137, 137,
- 80, 80, 80, 80, 80, 1, 78, 79,
- 78, 80, 80, 80, 81, 82, 83, 138,
- 138, 80, 80, 80, 80, 80, 1, 78,
- 79, 78, 80, 80, 80, 81, 82, 83,
- 139, 139, 80, 80, 80, 80, 80, 1,
- 78, 79, 78, 80, 80, 80, 81, 82,
- 83, 140, 140, 80, 80, 80, 80, 80,
- 1, 78, 79, 78, 80, 80, 80, 81,
- 82, 83, 141, 141, 80, 80, 80, 80,
- 80, 1, 142, 79, 142, 80, 80, 80,
- 81, 82, 143, 80, 80, 80, 80, 80,
- 1, 144, 145, 144, 38, 35, 143, 1,
- 146, 1, 147, 147, 1, 147, 147, 38,
- 35, 143, 1, 143, 148, 143, 89, 90,
- 89, 89, 91, 89, 89, 89, 149, 89,
- 89, 1, 150, 1, 151, 151, 1, 151,
- 94, 151, 89, 90, 89, 89, 91, 89,
- 89, 89, 149, 89, 89, 1, 152, 153,
- 152, 154, 156, 155, 1, 157, 24, 157,
- 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 1, 158, 24, 158, 51, 51, 51,
- 54, 51, 51, 51, 51, 51, 51, 1,
- 159, 24, 159, 23, 1, 1, 0
-};
+ return ret;
+ }
-static const char _tsip_machine_parser_header_Contact_trans_targs[] = {
- 2, 0, 8, 3, 4, 5, 6, 7,
- 9, 9, 10, 35, 40, 123, 18, 45,
- 11, 12, 12, 13, 14, 15, 16, 18,
- 17, 126, 19, 20, 19, 21, 22, 23,
- 24, 17, 28, 50, 24, 25, 28, 26,
- 27, 28, 29, 30, 31, 31, 32, 33,
- 34, 36, 38, 35, 37, 32, 18, 37,
- 32, 39, 40, 41, 43, 44, 42, 46,
- 45, 48, 47, 47, 49, 24, 17, 28,
- 50, 51, 54, 107, 52, 53, 55, 17,
- 54, 28, 50, 59, 55, 56, 57, 58,
- 60, 71, 66, 72, 61, 62, 63, 64,
- 65, 67, 69, 70, 68, 24, 73, 106,
- 74, 77, 75, 76, 78, 93, 79, 91,
- 80, 81, 89, 82, 83, 87, 84, 85,
- 86, 88, 90, 92, 94, 102, 95, 98,
- 96, 97, 99, 100, 101, 103, 104, 105,
- 108, 109, 110, 111, 112, 113, 114, 118,
- 114, 115, 116, 117, 119, 122, 120, 121,
- 24, 17, 28, 122, 50, 124, 125, 125
-};
+ return -1;
+}
-static const char _tsip_machine_parser_header_Contact_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 17, 17, 17, 3, 17,
- 0, 0, 3, 3, 0, 0, 0, 0,
- 0, 15, 1, 0, 0, 0, 0, 7,
- 13, 13, 13, 0, 0, 0, 0, 0,
- 0, 3, 3, 0, 0, 3, 3, 0,
- 0, 0, 0, 0, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 20, 20, 20,
- 7, 0, 1, 1, 0, 0, 26, 26,
- 0, 26, 11, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 26, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 26, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 23, 23, 23, 0, 9, 0, 5, 0
-};
-static const int tsip_machine_parser_header_Contact_start = 1;
-static const int tsip_machine_parser_header_Contact_first_final = 126;
-static const int tsip_machine_parser_header_Contact_error = 0;
-
-static const int tsip_machine_parser_header_Contact_en_main = 1;
-
-
-/* #line 151 "./ragel/tsip_parser_header_Contact.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Contact_first_final);
- (void)(tsip_machine_parser_header_Contact_error);
- (void)(tsip_machine_parser_header_Contact_en_main);
-
-/* #line 442 "./src/headers/tsip_header_Contact.c" */
- {
- cs = tsip_machine_parser_header_Contact_start;
- }
-
-/* #line 156 "./ragel/tsip_parser_header_Contact.rl" */
-
-/* #line 449 "./src/headers/tsip_header_Contact.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+tsip_header_Contacts_L_t *tsip_header_Contact_parse(const char *data, tsk_size_t size)
+{
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Contacts_L_t *hdr_contacts = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Contact_t *curr_contact = 0;
+
+
+ /* #line 90 "./src/headers/tsip_header_Contact.c" */
+ static const char _tsip_machine_parser_header_Contact_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 2, 1, 0, 2, 3, 6, 2,
+ 4, 6, 2, 5, 6
+ };
+
+ static const short _tsip_machine_parser_header_Contact_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 14,
+ 16, 19, 40, 41, 43, 64, 65, 67,
+ 71, 74, 75, 79, 91, 94, 94, 95,
+ 100, 105, 106, 108, 112, 133, 134, 136,
+ 157, 158, 160, 163, 180, 198, 202, 203,
+ 205, 213, 214, 216, 220, 226, 246, 265,
+ 270, 270, 275, 294, 295, 297, 315, 333,
+ 339, 340, 342, 347, 366, 367, 369, 388,
+ 389, 391, 394, 402, 403, 405, 410, 416,
+ 433, 440, 448, 456, 464, 466, 473, 482,
+ 484, 487, 489, 492, 494, 497, 500, 501,
+ 504, 505, 508, 509, 518, 527, 535, 543,
+ 551, 559, 561, 567, 576, 585, 594, 596,
+ 599, 602, 603, 604, 624, 644, 664, 684,
+ 704, 724, 742, 748, 749, 751, 756, 775,
+ 776, 778, 797, 804, 821, 839, 843
+ };
+
+ static const char _tsip_machine_parser_header_Contact_trans_keys[] = {
+ 67, 77, 99, 109, 79, 111, 78, 110,
+ 84, 116, 65, 97, 67, 99, 84, 116,
+ 9, 32, 58, 9, 13, 32, 33, 34,
+ 37, 39, 42, 43, 60, 126, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 42, 43, 60, 126, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 10, 9, 32, 9, 32, 42, 60, 9,
+ 13, 32, 10, 65, 90, 97, 122, 9,
+ 32, 43, 58, 45, 46, 48, 57, 65,
+ 90, 97, 122, 9, 32, 58, 62, 9,
+ 13, 32, 44, 59, 9, 13, 32, 44,
+ 59, 10, 9, 32, 9, 32, 44, 59,
+ 9, 13, 32, 33, 34, 37, 39, 60,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 60,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 10, 9, 32,
+ 9, 32, 60, 9, 13, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 60, 10, 9, 32, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 60, 0, 9, 11, 12,
+ 14, 127, 9, 13, 32, 33, 37, 39,
+ 42, 43, 58, 126, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 37, 39, 58, 60, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 58, 60, 9, 13,
+ 32, 44, 59, 9, 13, 32, 33, 37,
+ 39, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 61, 10, 9, 32, 9, 32,
+ 44, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 32, 34, 13, 34, 92, 127, 0, 8,
+ 10, 31, 10, 9, 32, 9, 13, 32,
+ 44, 59, 0, 9, 11, 12, 14, 127,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 58, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 58, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 48,
+ 57, 46, 48, 57, 48, 57, 93, 48,
+ 57, 93, 48, 57, 93, 46, 48, 57,
+ 46, 46, 48, 57, 46, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 46,
+ 48, 57, 46, 58, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 88, 120, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 61, 80, 112, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 73, 105, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 61, 82, 114, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 69, 101, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 61, 83, 115, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 10, 9, 32, 9,
+ 32, 44, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 48, 57, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 60, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 60, 0
+ };
+
+ static const char _tsip_machine_parser_header_Contact_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 2, 2,
+ 3, 11, 1, 2, 11, 1, 2, 4,
+ 3, 1, 0, 4, 3, 0, 1, 5,
+ 5, 1, 2, 4, 9, 1, 2, 9,
+ 1, 2, 3, 7, 8, 4, 1, 2,
+ 4, 1, 2, 4, 0, 10, 9, 5,
+ 0, 5, 9, 1, 2, 8, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 5, 0, 9,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 2, 2, 2,
+ 2, 2, 0, 3, 3, 3, 0, 1,
+ 1, 1, 1, 12, 12, 12, 12, 12,
+ 12, 10, 6, 1, 2, 5, 9, 1,
+ 2, 9, 5, 7, 8, 4, 0
+ };
+
+ static const char _tsip_machine_parser_header_Contact_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 0, 0, 2, 4, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6, 0, 0, 6,
+ 0, 0, 0, 5, 5, 0, 0, 0,
+ 2, 0, 0, 0, 3, 5, 5, 0,
+ 0, 0, 5, 0, 0, 5, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 3, 4,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 1, 0, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 1, 1,
+ 1, 0, 0, 4, 4, 4, 4, 4,
+ 4, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 1, 5, 5, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Contact_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 20,
+ 23, 27, 44, 46, 49, 66, 68, 71,
+ 76, 80, 82, 85, 94, 98, 99, 101,
+ 107, 113, 115, 118, 123, 139, 141, 144,
+ 160, 162, 165, 169, 182, 196, 201, 203,
+ 206, 213, 215, 218, 223, 227, 243, 258,
+ 264, 265, 271, 286, 288, 291, 305, 320,
+ 327, 329, 332, 338, 353, 355, 358, 373,
+ 375, 378, 382, 389, 391, 394, 400, 404,
+ 418, 423, 429, 435, 441, 444, 449, 456,
+ 458, 461, 463, 466, 468, 471, 474, 476,
+ 479, 481, 484, 486, 493, 500, 506, 512,
+ 518, 524, 527, 531, 538, 545, 552, 554,
+ 557, 560, 562, 564, 581, 598, 615, 632,
+ 649, 666, 681, 688, 690, 693, 699, 714,
+ 716, 719, 734, 741, 754, 768, 773
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Contact_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 2, 2, 1, 2,
+ 2, 8, 1, 9, 10, 9, 11, 12,
+ 11, 11, 13, 11, 14, 11, 11, 11,
+ 15, 11, 15, 1, 16, 1, 17, 17,
+ 1, 18, 19, 18, 11, 12, 11, 11,
+ 13, 11, 14, 11, 11, 11, 15, 11,
+ 15, 1, 20, 1, 21, 21, 1, 21,
+ 21, 22, 23, 1, 22, 24, 22, 1,
+ 25, 1, 26, 26, 1, 27, 27, 28,
+ 29, 28, 28, 28, 28, 1, 27, 27,
+ 29, 1, 30, 31, 30, 32, 33, 32,
+ 34, 35, 1, 36, 37, 36, 38, 35,
+ 1, 39, 1, 40, 40, 1, 40, 40,
+ 38, 35, 1, 41, 42, 41, 11, 12,
+ 11, 11, 14, 11, 11, 11, 11, 15,
+ 11, 15, 1, 43, 1, 44, 44, 1,
+ 45, 46, 45, 11, 12, 11, 11, 14,
+ 11, 11, 11, 11, 15, 11, 15, 1,
+ 47, 1, 48, 48, 1, 48, 48, 23,
+ 1, 49, 50, 49, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 1, 52, 53,
+ 52, 51, 51, 51, 54, 51, 51, 51,
+ 51, 51, 51, 1, 55, 56, 55, 23,
+ 1, 57, 1, 49, 49, 1, 59, 60,
+ 61, 1, 1, 1, 58, 62, 1, 58,
+ 58, 1, 52, 53, 52, 54, 1, 58,
+ 58, 58, 1, 63, 50, 63, 51, 51,
+ 51, 51, 64, 65, 51, 64, 64, 64,
+ 51, 64, 1, 66, 53, 66, 51, 51,
+ 51, 65, 54, 51, 51, 51, 51, 51,
+ 51, 1, 67, 56, 67, 65, 23, 1,
+ 68, 69, 70, 69, 71, 72, 68, 35,
+ 73, 35, 74, 74, 74, 75, 75, 74,
+ 74, 74, 74, 74, 74, 1, 76, 1,
+ 77, 77, 1, 77, 77, 74, 74, 74,
+ 75, 75, 74, 74, 74, 74, 74, 74,
+ 1, 78, 79, 78, 80, 80, 80, 81,
+ 82, 83, 80, 80, 80, 80, 80, 1,
+ 84, 85, 84, 38, 35, 83, 1, 86,
+ 1, 87, 87, 1, 87, 87, 38, 35,
+ 83, 1, 83, 88, 83, 89, 90, 89,
+ 89, 91, 89, 89, 89, 89, 89, 89,
+ 1, 92, 1, 93, 93, 1, 93, 94,
+ 93, 89, 90, 89, 89, 91, 89, 89,
+ 89, 89, 89, 89, 1, 95, 1, 96,
+ 96, 1, 96, 96, 90, 1, 97, 98,
+ 99, 1, 1, 1, 90, 100, 1, 90,
+ 90, 1, 101, 79, 101, 81, 82, 1,
+ 90, 90, 90, 1, 101, 79, 101, 89,
+ 89, 89, 81, 82, 89, 89, 89, 89,
+ 89, 1, 103, 102, 102, 102, 1, 105,
+ 98, 104, 104, 104, 1, 105, 98, 106,
+ 106, 106, 1, 105, 98, 107, 107, 107,
+ 1, 105, 98, 1, 109, 108, 102, 102,
+ 1, 110, 105, 98, 111, 104, 104, 1,
+ 112, 1, 113, 114, 1, 115, 1, 116,
+ 117, 1, 118, 1, 98, 119, 1, 98,
+ 120, 1, 98, 1, 116, 121, 1, 116,
+ 1, 113, 122, 1, 113, 1, 110, 105,
+ 98, 123, 106, 106, 1, 110, 105, 98,
+ 107, 107, 107, 1, 125, 98, 124, 124,
+ 124, 1, 127, 98, 126, 126, 126, 1,
+ 127, 98, 128, 128, 128, 1, 127, 98,
+ 129, 129, 129, 1, 127, 98, 1, 130,
+ 124, 124, 1, 110, 127, 98, 131, 126,
+ 126, 1, 110, 127, 98, 132, 128, 128,
+ 1, 110, 127, 98, 129, 129, 129, 1,
+ 133, 1, 110, 134, 1, 110, 135, 1,
+ 110, 1, 109, 1, 78, 79, 78, 80,
+ 80, 80, 81, 82, 83, 136, 136, 80,
+ 80, 80, 80, 80, 1, 78, 79, 78,
+ 80, 80, 80, 81, 82, 83, 137, 137,
+ 80, 80, 80, 80, 80, 1, 78, 79,
+ 78, 80, 80, 80, 81, 82, 83, 138,
+ 138, 80, 80, 80, 80, 80, 1, 78,
+ 79, 78, 80, 80, 80, 81, 82, 83,
+ 139, 139, 80, 80, 80, 80, 80, 1,
+ 78, 79, 78, 80, 80, 80, 81, 82,
+ 83, 140, 140, 80, 80, 80, 80, 80,
+ 1, 78, 79, 78, 80, 80, 80, 81,
+ 82, 83, 141, 141, 80, 80, 80, 80,
+ 80, 1, 142, 79, 142, 80, 80, 80,
+ 81, 82, 143, 80, 80, 80, 80, 80,
+ 1, 144, 145, 144, 38, 35, 143, 1,
+ 146, 1, 147, 147, 1, 147, 147, 38,
+ 35, 143, 1, 143, 148, 143, 89, 90,
+ 89, 89, 91, 89, 89, 89, 149, 89,
+ 89, 1, 150, 1, 151, 151, 1, 151,
+ 94, 151, 89, 90, 89, 89, 91, 89,
+ 89, 89, 149, 89, 89, 1, 152, 153,
+ 152, 154, 156, 155, 1, 157, 24, 157,
+ 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 1, 158, 24, 158, 51, 51, 51,
+ 54, 51, 51, 51, 51, 51, 51, 1,
+ 159, 24, 159, 23, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Contact_trans_targs[] = {
+ 2, 0, 8, 3, 4, 5, 6, 7,
+ 9, 9, 10, 35, 40, 123, 18, 45,
+ 11, 12, 12, 13, 14, 15, 16, 18,
+ 17, 126, 19, 20, 19, 21, 22, 23,
+ 24, 17, 28, 50, 24, 25, 28, 26,
+ 27, 28, 29, 30, 31, 31, 32, 33,
+ 34, 36, 38, 35, 37, 32, 18, 37,
+ 32, 39, 40, 41, 43, 44, 42, 46,
+ 45, 48, 47, 47, 49, 24, 17, 28,
+ 50, 51, 54, 107, 52, 53, 55, 17,
+ 54, 28, 50, 59, 55, 56, 57, 58,
+ 60, 71, 66, 72, 61, 62, 63, 64,
+ 65, 67, 69, 70, 68, 24, 73, 106,
+ 74, 77, 75, 76, 78, 93, 79, 91,
+ 80, 81, 89, 82, 83, 87, 84, 85,
+ 86, 88, 90, 92, 94, 102, 95, 98,
+ 96, 97, 99, 100, 101, 103, 104, 105,
+ 108, 109, 110, 111, 112, 113, 114, 118,
+ 114, 115, 116, 117, 119, 122, 120, 121,
+ 24, 17, 28, 122, 50, 124, 125, 125
+ };
+
+ static const char _tsip_machine_parser_header_Contact_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 3, 17, 17, 17, 3, 17,
+ 0, 0, 3, 3, 0, 0, 0, 0,
+ 0, 15, 1, 0, 0, 0, 0, 7,
+ 13, 13, 13, 0, 0, 0, 0, 0,
+ 0, 3, 3, 0, 0, 3, 3, 0,
+ 0, 0, 0, 0, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 20, 20, 20,
+ 7, 0, 1, 1, 0, 0, 26, 26,
+ 0, 26, 11, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 26, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 26, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 23, 23, 23, 0, 9, 0, 5, 0
+ };
+
+ static const int tsip_machine_parser_header_Contact_start = 1;
+ static const int tsip_machine_parser_header_Contact_first_final = 126;
+ static const int tsip_machine_parser_header_Contact_error = 0;
+
+ static const int tsip_machine_parser_header_Contact_en_main = 1;
+
+
+ /* #line 151 "./ragel/tsip_parser_header_Contact.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Contact_first_final);
+ (void)(tsip_machine_parser_header_Contact_error);
+ (void)(tsip_machine_parser_header_Contact_en_main);
+
+ /* #line 442 "./src/headers/tsip_header_Contact.c" */
+ {
+ cs = tsip_machine_parser_header_Contact_start;
+ }
+
+ /* #line 156 "./ragel/tsip_parser_header_Contact.rl" */
+
+ /* #line 449 "./src/headers/tsip_header_Contact.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Contact_trans_keys + _tsip_machine_parser_header_Contact_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Contact_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Contact_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Contact_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Contact_trans_keys + _tsip_machine_parser_header_Contact_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Contact_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Contact_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Contact_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Contact_indicies[_trans];
- cs = _tsip_machine_parser_header_Contact_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Contact_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Contact_actions + _tsip_machine_parser_header_Contact_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Contact.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(!curr_contact){
- curr_contact = tsip_header_Contact_create();
- }
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(curr_contact){
- TSK_PARSER_SET_STRING(curr_contact->display_name);
- tsk_strunquote(&curr_contact->display_name);
- }
- }
- break;
- case 3:
-/* #line 65 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(curr_contact && !curr_contact->uri){
- int len = (int)(p - tag_start);
- if((curr_contact->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_contact->display_name){
- curr_contact->uri->display_name = tsk_strdup(curr_contact->display_name);
- }
- }
- }
- break;
- case 4:
-/* #line 74 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(curr_contact){
- TSK_PARSER_SET_INTEGER(curr_contact->expires);
- }
- }
- break;
- case 5:
-/* #line 80 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(curr_contact){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_contact));
- }
- }
- break;
- case 6:
-/* #line 86 "./ragel/tsip_parser_header_Contact.rl" */
- {
- if(curr_contact){
- tsk_list_push_back_data(hdr_contacts, ((void**) &curr_contact));
- }
- }
- break;
- case 7:
-/* #line 92 "./ragel/tsip_parser_header_Contact.rl" */
- {
- }
- break;
-/* #line 586 "./src/headers/tsip_header_Contact.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Contact_indicies[_trans];
+ cs = _tsip_machine_parser_header_Contact_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Contact_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Contact_actions + _tsip_machine_parser_header_Contact_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(!curr_contact) {
+ curr_contact = tsip_header_Contact_create();
+ }
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(curr_contact) {
+ TSK_PARSER_SET_STRING(curr_contact->display_name);
+ tsk_strunquote(&curr_contact->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 65 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(curr_contact && !curr_contact->uri) {
+ int len = (int)(p - tag_start);
+ if((curr_contact->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_contact->display_name) {
+ curr_contact->uri->display_name = tsk_strdup(curr_contact->display_name);
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 74 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(curr_contact) {
+ TSK_PARSER_SET_INTEGER(curr_contact->expires);
+ }
+ }
+ break;
+ case 5:
+ /* #line 80 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(curr_contact) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_contact));
+ }
+ }
+ break;
+ case 6:
+ /* #line 86 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ if(curr_contact) {
+ tsk_list_push_back_data(hdr_contacts, ((void**) &curr_contact));
+ }
+ }
+ break;
+ case 7:
+ /* #line 92 "./ragel/tsip_parser_header_Contact.rl" */
+ {
+ }
+ break;
+ /* #line 586 "./src/headers/tsip_header_Contact.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 157 "./ragel/tsip_parser_header_Contact.rl" */
-
- if( cs <
-/* #line 602 "./src/headers/tsip_header_Contact.c" */
-126
-/* #line 158 "./ragel/tsip_parser_header_Contact.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Contact' header.");
- TSK_OBJECT_SAFE_FREE(curr_contact);
- TSK_OBJECT_SAFE_FREE(hdr_contacts);
- }
-
- return hdr_contacts;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 157 "./ragel/tsip_parser_header_Contact.rl" */
+
+ if( cs <
+ /* #line 602 "./src/headers/tsip_header_Contact.c" */
+ 126
+ /* #line 158 "./ragel/tsip_parser_header_Contact.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Contact' header.");
+ TSK_OBJECT_SAFE_FREE(curr_contact);
+ TSK_OBJECT_SAFE_FREE(hdr_contacts);
+ }
+
+ return hdr_contacts;
}
@@ -619,40 +630,39 @@ _again:
static tsk_object_t* tsip_header_Contact_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Contact_t *Contact = self;
- if(Contact){
- TSIP_HEADER(Contact)->type = tsip_htype_Contact;
- TSIP_HEADER(Contact)->serialize = tsip_header_Contact_serialize;
- Contact->expires = -1;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Contact header.");
- }
- return self;
+ tsip_header_Contact_t *Contact = self;
+ if(Contact) {
+ TSIP_HEADER(Contact)->type = tsip_htype_Contact;
+ TSIP_HEADER(Contact)->serialize = tsip_header_Contact_serialize;
+ Contact->expires = -1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Contact header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Contact_dtor(tsk_object_t *self)
{
- tsip_header_Contact_t *Contact = self;
- if(Contact){
- TSK_FREE(Contact->display_name);
- TSK_OBJECT_SAFE_FREE(Contact->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Contact));
- }
- else{
- TSK_DEBUG_ERROR("Null Contact header.");
- }
-
- return self;
+ tsip_header_Contact_t *Contact = self;
+ if(Contact) {
+ TSK_FREE(Contact->display_name);
+ TSK_OBJECT_SAFE_FREE(Contact->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Contact));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Contact header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Contact_def_s =
-{
- sizeof(tsip_header_Contact_t),
- tsip_header_Contact_ctor,
- tsip_header_Contact_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Contact_def_s = {
+ sizeof(tsip_header_Contact_t),
+ tsip_header_Contact_ctor,
+ tsip_header_Contact_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Contact_def_t = &tsip_header_Contact_def_s;
@@ -692,7 +702,7 @@ const tsk_object_def_t *tsip_header_Contact_def_t = &tsip_header_Contact_def_s;
// return self;
//}
//
-//static const tsk_object_def_t tsip_contact_def_s =
+//static const tsk_object_def_t tsip_contact_def_s =
//{
// sizeof(tsip_contact_t),
// tsip_contact_ctor,
diff --git a/tinySIP/src/headers/tsip_header_Content_Length.c b/tinySIP/src/headers/tsip_header_Content_Length.c
index d209be8..4f3fd88 100755
--- a/tinySIP/src/headers/tsip_header_Content_Length.c
+++ b/tinySIP/src/headers/tsip_header_Content_Length.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,234 +46,245 @@
tsip_header_Content_Length_t* tsip_header_Content_Length_create(uint32_t length)
{
- return tsk_object_new(TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(length));
+ return tsk_object_new(TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(length));
}
tsip_header_Content_Length_t* tsip_header_Content_Length_create_null()
{
- return tsip_header_Content_Length_create(0);
+ return tsip_header_Content_Length_create(0);
}
int tsip_header_Content_Length_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Content_Length_t *Content_Length = (const tsip_header_Content_Length_t *)header;
- return tsk_buffer_append_2(output, "%u", Content_Length->length);
- }
+ if(header) {
+ const tsip_header_Content_Length_t *Content_Length = (const tsip_header_Content_Length_t *)header;
+ return tsk_buffer_append_2(output, "%u", Content_Length->length);
+ }
- return -1;
+ return -1;
}
tsip_header_Content_Length_t *tsip_header_Content_Length_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Content_Length_t *hdr_clength = tsip_header_Content_Length_create(0);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 79 "./src/headers/tsip_header_Content_Length.c" */
-static const char _tsip_machine_parser_header_Content_Length_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Content_Length_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 14,
- 16, 17, 19, 21, 23, 25, 27, 29,
- 32, 37, 38, 40, 44, 47, 48
-};
-
-static const char _tsip_machine_parser_header_Content_Length_trans_keys[] = {
- 67, 76, 99, 108, 79, 111, 78, 110,
- 84, 116, 69, 101, 78, 110, 84, 116,
- 45, 76, 108, 69, 101, 78, 110, 71,
- 103, 84, 116, 72, 104, 9, 32, 58,
- 9, 13, 32, 48, 57, 10, 9, 32,
- 9, 32, 48, 57, 13, 48, 57, 10,
- 0
-};
-
-static const char _tsip_machine_parser_header_Content_Length_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 3,
- 3, 1, 2, 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Content_Length_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 1, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Content_Length_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 20,
- 23, 25, 28, 31, 34, 37, 40, 43,
- 47, 52, 54, 57, 61, 64, 66
-};
-
-static const char _tsip_machine_parser_header_Content_Length_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 2, 2, 1, 2, 2, 15, 1, 15,
- 16, 15, 17, 1, 18, 1, 19, 19,
- 1, 19, 19, 17, 1, 20, 21, 1,
- 22, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Content_Length_trans_targs[] = {
- 2, 0, 15, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 16,
- 17, 20, 18, 19, 21, 20, 22
-};
-
-static const char _tsip_machine_parser_header_Content_Length_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_Content_Length_start = 1;
-static const int tsip_machine_parser_header_Content_Length_first_final = 22;
-static const int tsip_machine_parser_header_Content_Length_error = 0;
-
-static const int tsip_machine_parser_header_Content_Length_en_main = 1;
-
-
-/* #line 96 "./ragel/tsip_parser_header_Content_Length.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Content_Length_first_final);
- (void)(tsip_machine_parser_header_Content_Length_error);
- (void)(tsip_machine_parser_header_Content_Length_en_main);
-
-/* #line 155 "./src/headers/tsip_header_Content_Length.c" */
- {
- cs = tsip_machine_parser_header_Content_Length_start;
- }
-
-/* #line 101 "./ragel/tsip_parser_header_Content_Length.rl" */
-
-/* #line 162 "./src/headers/tsip_header_Content_Length.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Content_Length_t *hdr_clength = tsip_header_Content_Length_create(0);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 79 "./src/headers/tsip_header_Content_Length.c" */
+ static const char _tsip_machine_parser_header_Content_Length_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 14,
+ 16, 17, 19, 21, 23, 25, 27, 29,
+ 32, 37, 38, 40, 44, 47, 48
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_trans_keys[] = {
+ 67, 76, 99, 108, 79, 111, 78, 110,
+ 84, 116, 69, 101, 78, 110, 84, 116,
+ 45, 76, 108, 69, 101, 78, 110, 71,
+ 103, 84, 116, 72, 104, 9, 32, 58,
+ 9, 13, 32, 48, 57, 10, 9, 32,
+ 9, 32, 48, 57, 13, 48, 57, 10,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 3,
+ 3, 1, 2, 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 1, 1, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 20,
+ 23, 25, 28, 31, 34, 37, 40, 43,
+ 47, 52, 54, 57, 61, 64, 66
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 2, 2, 1, 2, 2, 15, 1, 15,
+ 16, 15, 17, 1, 18, 1, 19, 19,
+ 1, 19, 19, 17, 1, 20, 21, 1,
+ 22, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_trans_targs[] = {
+ 2, 0, 15, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 16,
+ 17, 20, 18, 19, 21, 20, 22
+ };
+
+ static const char _tsip_machine_parser_header_Content_Length_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Content_Length_start = 1;
+ static const int tsip_machine_parser_header_Content_Length_first_final = 22;
+ static const int tsip_machine_parser_header_Content_Length_error = 0;
+
+ static const int tsip_machine_parser_header_Content_Length_en_main = 1;
+
+
+ /* #line 96 "./ragel/tsip_parser_header_Content_Length.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Content_Length_first_final);
+ (void)(tsip_machine_parser_header_Content_Length_error);
+ (void)(tsip_machine_parser_header_Content_Length_en_main);
+
+ /* #line 155 "./src/headers/tsip_header_Content_Length.c" */
+ {
+ cs = tsip_machine_parser_header_Content_Length_start;
+ }
+
+ /* #line 101 "./ragel/tsip_parser_header_Content_Length.rl" */
+
+ /* #line 162 "./src/headers/tsip_header_Content_Length.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Content_Length_trans_keys + _tsip_machine_parser_header_Content_Length_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Content_Length_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Content_Length_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Content_Length_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Content_Length_trans_keys + _tsip_machine_parser_header_Content_Length_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Content_Length_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Content_Length_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Content_Length_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Content_Length_indicies[_trans];
- cs = _tsip_machine_parser_header_Content_Length_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Content_Length_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Content_Length_actions + _tsip_machine_parser_header_Content_Length_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 46 "./ragel/tsip_parser_header_Content_Length.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 50 "./ragel/tsip_parser_header_Content_Length.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_clength->length);
- }
- break;
- case 2:
-/* #line 54 "./ragel/tsip_parser_header_Content_Length.rl" */
- {
- }
- break;
-/* #line 253 "./src/headers/tsip_header_Content_Length.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Content_Length_indicies[_trans];
+ cs = _tsip_machine_parser_header_Content_Length_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Content_Length_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Content_Length_actions + _tsip_machine_parser_header_Content_Length_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 46 "./ragel/tsip_parser_header_Content_Length.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 50 "./ragel/tsip_parser_header_Content_Length.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_clength->length);
+ }
+ break;
+ case 2:
+ /* #line 54 "./ragel/tsip_parser_header_Content_Length.rl" */
+ {
+ }
+ break;
+ /* #line 253 "./src/headers/tsip_header_Content_Length.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 102 "./ragel/tsip_parser_header_Content_Length.rl" */
-
- if( cs <
-/* #line 269 "./src/headers/tsip_header_Content_Length.c" */
-22
-/* #line 103 "./ragel/tsip_parser_header_Content_Length.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Content-Length' header.");
- TSK_OBJECT_SAFE_FREE(hdr_clength);
- }
-
- return hdr_clength;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 102 "./ragel/tsip_parser_header_Content_Length.rl" */
+
+ if( cs <
+ /* #line 269 "./src/headers/tsip_header_Content_Length.c" */
+ 22
+ /* #line 103 "./ragel/tsip_parser_header_Content_Length.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Content-Length' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_clength);
+ }
+
+ return hdr_clength;
}
@@ -288,38 +299,37 @@ _again:
static tsk_object_t* tsip_header_Content_Length_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Content_Length_t *Content_Length = self;
- if(Content_Length){
- Content_Length->length = va_arg(*app, uint32_t);
-
- TSIP_HEADER(Content_Length)->type = tsip_htype_Content_Length;
- TSIP_HEADER(Content_Length)->serialize = tsip_header_Content_Length_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Content_Length header.");
- }
- return self;
+ tsip_header_Content_Length_t *Content_Length = self;
+ if(Content_Length) {
+ Content_Length->length = va_arg(*app, uint32_t);
+
+ TSIP_HEADER(Content_Length)->type = tsip_htype_Content_Length;
+ TSIP_HEADER(Content_Length)->serialize = tsip_header_Content_Length_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Content_Length header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Content_Length_dtor(tsk_object_t *self)
{
- tsip_header_Content_Length_t *Content_Length = self;
- if(Content_Length){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Content_Length));
- }
- else{
- TSK_DEBUG_ERROR("Null Content_Length header.");
- }
-
- return self;
+ tsip_header_Content_Length_t *Content_Length = self;
+ if(Content_Length) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Content_Length));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Content_Length header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Content_Length_def_s =
-{
- sizeof(tsip_header_Content_Length_t),
- tsip_header_Content_Length_ctor,
- tsip_header_Content_Length_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Content_Length_def_s = {
+ sizeof(tsip_header_Content_Length_t),
+ tsip_header_Content_Length_ctor,
+ tsip_header_Content_Length_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Content_Length_def_t = &tsip_header_Content_Length_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Content_Type.c b/tinySIP/src/headers/tsip_header_Content_Type.c
index 2dda910..faaff9b 100755
--- a/tinySIP/src/headers/tsip_header_Content_Type.c
+++ b/tinySIP/src/headers/tsip_header_Content_Type.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,332 +47,343 @@
tsip_header_Content_Type_t* tsip_header_Content_Type_create(const char* type)
{
- return tsk_object_new(TSIP_HEADER_CONTENT_TYPE_VA_ARGS(type));
+ return tsk_object_new(TSIP_HEADER_CONTENT_TYPE_VA_ARGS(type));
}
tsip_header_Content_Type_t* tsip_header_Content_Type_create_null()
{
- return tsip_header_Content_Type_create(tsk_null);
+ return tsip_header_Content_Type_create(tsk_null);
}
int tsip_header_Content_Type_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Content_Type_t *Content_Type = (const tsip_header_Content_Type_t *)header;
- if(Content_Type->type){
- return tsk_buffer_append(output, Content_Type->type, tsk_strlen(Content_Type->type));
- }
- else{
- return -2;
- }
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Content_Type_t *Content_Type = (const tsip_header_Content_Type_t *)header;
+ if(Content_Type->type) {
+ return tsk_buffer_append(output, Content_Type->type, tsk_strlen(Content_Type->type));
+ }
+ else {
+ return -2;
+ }
+ }
+
+ return -1;
}
tsip_header_Content_Type_t *tsip_header_Content_Type_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Content_Type_t *hdr_ctype = tsip_header_Content_Type_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 85 "./src/headers/tsip_header_Content_Type.c" */
-static const char _tsip_machine_parser_header_Content_Type_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const short _tsip_machine_parser_header_Content_Type_key_offsets[] = {
- 0, 0, 2, 7, 10, 27, 28, 30,
- 46, 62, 66, 67, 69, 72, 89, 90,
- 92, 108, 126, 130, 131, 133, 136, 153,
- 154, 156, 172, 190, 194, 195, 197, 200,
- 218, 219, 221, 239, 240, 242, 245, 253,
- 254, 256, 260, 261, 267, 285, 287, 289,
- 291, 293, 295, 296, 298, 300, 302, 304
-};
-
-static const char _tsip_machine_parser_header_Content_Type_trans_keys[] = {
- 67, 99, 9, 32, 58, 79, 111, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 47, 126, 42, 43,
- 45, 57, 65, 90, 95, 122, 9, 13,
- 32, 47, 10, 9, 32, 9, 32, 47,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 10, 9, 32, 9, 32, 59,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 61, 10, 9, 32, 9, 32, 61,
- 9, 13, 32, 33, 34, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 34, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 59, 10, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 78, 110, 84,
- 116, 69, 101, 78, 110, 84, 116, 45,
- 84, 116, 89, 121, 80, 112, 69, 101,
- 0
-};
-
-static const char _tsip_machine_parser_header_Content_Type_single_lengths[] = {
- 0, 2, 5, 3, 7, 1, 2, 6,
- 8, 4, 1, 2, 3, 7, 1, 2,
- 6, 8, 4, 1, 2, 3, 7, 1,
- 2, 6, 8, 4, 1, 2, 3, 8,
- 1, 2, 8, 1, 2, 3, 4, 1,
- 2, 4, 1, 0, 8, 2, 2, 2,
- 2, 2, 1, 2, 2, 2, 2, 0
-};
-
-static const char _tsip_machine_parser_header_Content_Type_range_lengths[] = {
- 0, 0, 0, 0, 5, 0, 0, 5,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 5, 0, 0, 0, 0, 5, 0,
- 0, 5, 5, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 0, 0, 2, 0,
- 0, 0, 0, 3, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Content_Type_index_offsets[] = {
- 0, 0, 3, 9, 13, 26, 28, 31,
- 43, 56, 61, 63, 66, 70, 83, 85,
- 88, 100, 114, 119, 121, 124, 128, 141,
- 143, 146, 158, 172, 177, 179, 182, 186,
- 200, 202, 205, 219, 221, 224, 228, 235,
- 237, 240, 245, 247, 251, 265, 268, 271,
- 274, 277, 280, 282, 285, 288, 291, 294
-};
-
-static const char _tsip_machine_parser_header_Content_Type_indicies[] = {
- 0, 0, 1, 2, 2, 3, 4, 4,
- 1, 2, 2, 3, 1, 3, 5, 3,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 1, 7, 1, 8, 8, 1, 8,
- 8, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 1, 9, 10, 9, 11, 11,
- 11, 12, 11, 11, 11, 11, 11, 1,
- 9, 10, 9, 12, 1, 13, 1, 14,
- 14, 1, 14, 14, 12, 1, 12, 15,
- 12, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 1, 17, 1, 18, 18, 1,
- 18, 18, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 1, 19, 20, 19, 16,
- 16, 16, 21, 16, 16, 16, 16, 16,
- 16, 1, 22, 23, 22, 24, 1, 25,
- 1, 26, 26, 1, 26, 26, 24, 1,
- 24, 27, 24, 28, 28, 28, 28, 28,
- 28, 28, 28, 28, 1, 29, 1, 30,
- 30, 1, 30, 30, 28, 28, 28, 28,
- 28, 28, 28, 28, 28, 1, 31, 32,
- 31, 33, 33, 33, 34, 33, 33, 33,
- 33, 33, 33, 1, 31, 32, 31, 34,
- 1, 35, 1, 36, 36, 1, 36, 36,
- 34, 1, 34, 37, 34, 38, 39, 38,
- 38, 38, 38, 38, 38, 38, 38, 1,
- 40, 1, 41, 41, 1, 41, 42, 41,
- 38, 39, 38, 38, 38, 38, 38, 38,
- 38, 38, 1, 43, 1, 44, 44, 1,
- 44, 44, 39, 1, 45, 46, 47, 1,
- 1, 1, 39, 48, 1, 39, 39, 1,
- 49, 50, 49, 51, 1, 52, 1, 39,
- 39, 39, 1, 49, 50, 49, 38, 38,
- 38, 51, 38, 38, 38, 38, 38, 38,
- 1, 53, 53, 1, 54, 54, 1, 55,
- 55, 1, 56, 56, 1, 57, 57, 1,
- 58, 1, 59, 59, 1, 60, 60, 1,
- 61, 61, 1, 2, 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Content_Type_trans_targs[] = {
- 2, 0, 3, 4, 45, 5, 8, 6,
- 7, 9, 10, 8, 13, 11, 12, 14,
- 17, 15, 16, 18, 42, 22, 18, 19,
- 22, 20, 21, 23, 26, 24, 25, 27,
- 28, 26, 31, 29, 30, 32, 44, 38,
- 33, 34, 35, 36, 37, 39, 41, 43,
- 40, 18, 42, 22, 55, 46, 47, 48,
- 49, 50, 51, 52, 53, 54
-};
-
-static const char _tsip_machine_parser_header_Content_Type_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 3, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Content_Type_start = 1;
-static const int tsip_machine_parser_header_Content_Type_first_final = 55;
-static const int tsip_machine_parser_header_Content_Type_error = 0;
-
-static const int tsip_machine_parser_header_Content_Type_en_main = 1;
-
-
-/* #line 119 "./ragel/tsip_parser_header_Content_Type.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Content_Type_first_final);
- (void)(tsip_machine_parser_header_Content_Type_error);
- (void)(tsip_machine_parser_header_Content_Type_en_main);
-
-/* #line 248 "./src/headers/tsip_header_Content_Type.c" */
- {
- cs = tsip_machine_parser_header_Content_Type_start;
- }
-
-/* #line 124 "./ragel/tsip_parser_header_Content_Type.rl" */
-
-/* #line 255 "./src/headers/tsip_header_Content_Type.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Content_Type_t *hdr_ctype = tsip_header_Content_Type_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 85 "./src/headers/tsip_header_Content_Type.c" */
+ static const char _tsip_machine_parser_header_Content_Type_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const short _tsip_machine_parser_header_Content_Type_key_offsets[] = {
+ 0, 0, 2, 7, 10, 27, 28, 30,
+ 46, 62, 66, 67, 69, 72, 89, 90,
+ 92, 108, 126, 130, 131, 133, 136, 153,
+ 154, 156, 172, 190, 194, 195, 197, 200,
+ 218, 219, 221, 239, 240, 242, 245, 253,
+ 254, 256, 260, 261, 267, 285, 287, 289,
+ 291, 293, 295, 296, 298, 300, 302, 304
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_trans_keys[] = {
+ 67, 99, 9, 32, 58, 79, 111, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 47, 126, 42, 43,
+ 45, 57, 65, 90, 95, 122, 9, 13,
+ 32, 47, 10, 9, 32, 9, 32, 47,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 10, 9, 32, 9, 32, 59,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 61, 10, 9, 32, 9, 32, 61,
+ 9, 13, 32, 33, 34, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 34, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 59, 10, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 78, 110, 84,
+ 116, 69, 101, 78, 110, 84, 116, 45,
+ 84, 116, 89, 121, 80, 112, 69, 101,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_single_lengths[] = {
+ 0, 2, 5, 3, 7, 1, 2, 6,
+ 8, 4, 1, 2, 3, 7, 1, 2,
+ 6, 8, 4, 1, 2, 3, 7, 1,
+ 2, 6, 8, 4, 1, 2, 3, 8,
+ 1, 2, 8, 1, 2, 3, 4, 1,
+ 2, 4, 1, 0, 8, 2, 2, 2,
+ 2, 2, 1, 2, 2, 2, 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_range_lengths[] = {
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 5, 0, 0, 0, 0, 5, 0,
+ 0, 5, 5, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 0, 0, 2, 0,
+ 0, 0, 0, 3, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Content_Type_index_offsets[] = {
+ 0, 0, 3, 9, 13, 26, 28, 31,
+ 43, 56, 61, 63, 66, 70, 83, 85,
+ 88, 100, 114, 119, 121, 124, 128, 141,
+ 143, 146, 158, 172, 177, 179, 182, 186,
+ 200, 202, 205, 219, 221, 224, 228, 235,
+ 237, 240, 245, 247, 251, 265, 268, 271,
+ 274, 277, 280, 282, 285, 288, 291, 294
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_indicies[] = {
+ 0, 0, 1, 2, 2, 3, 4, 4,
+ 1, 2, 2, 3, 1, 3, 5, 3,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 1, 7, 1, 8, 8, 1, 8,
+ 8, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 1, 9, 10, 9, 11, 11,
+ 11, 12, 11, 11, 11, 11, 11, 1,
+ 9, 10, 9, 12, 1, 13, 1, 14,
+ 14, 1, 14, 14, 12, 1, 12, 15,
+ 12, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 1, 17, 1, 18, 18, 1,
+ 18, 18, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 1, 19, 20, 19, 16,
+ 16, 16, 21, 16, 16, 16, 16, 16,
+ 16, 1, 22, 23, 22, 24, 1, 25,
+ 1, 26, 26, 1, 26, 26, 24, 1,
+ 24, 27, 24, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 1, 29, 1, 30,
+ 30, 1, 30, 30, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 1, 31, 32,
+ 31, 33, 33, 33, 34, 33, 33, 33,
+ 33, 33, 33, 1, 31, 32, 31, 34,
+ 1, 35, 1, 36, 36, 1, 36, 36,
+ 34, 1, 34, 37, 34, 38, 39, 38,
+ 38, 38, 38, 38, 38, 38, 38, 1,
+ 40, 1, 41, 41, 1, 41, 42, 41,
+ 38, 39, 38, 38, 38, 38, 38, 38,
+ 38, 38, 1, 43, 1, 44, 44, 1,
+ 44, 44, 39, 1, 45, 46, 47, 1,
+ 1, 1, 39, 48, 1, 39, 39, 1,
+ 49, 50, 49, 51, 1, 52, 1, 39,
+ 39, 39, 1, 49, 50, 49, 38, 38,
+ 38, 51, 38, 38, 38, 38, 38, 38,
+ 1, 53, 53, 1, 54, 54, 1, 55,
+ 55, 1, 56, 56, 1, 57, 57, 1,
+ 58, 1, 59, 59, 1, 60, 60, 1,
+ 61, 61, 1, 2, 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_trans_targs[] = {
+ 2, 0, 3, 4, 45, 5, 8, 6,
+ 7, 9, 10, 8, 13, 11, 12, 14,
+ 17, 15, 16, 18, 42, 22, 18, 19,
+ 22, 20, 21, 23, 26, 24, 25, 27,
+ 28, 26, 31, 29, 30, 32, 44, 38,
+ 33, 34, 35, 36, 37, 39, 41, 43,
+ 40, 18, 42, 22, 55, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54
+ };
+
+ static const char _tsip_machine_parser_header_Content_Type_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3, 3, 3, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Content_Type_start = 1;
+ static const int tsip_machine_parser_header_Content_Type_first_final = 55;
+ static const int tsip_machine_parser_header_Content_Type_error = 0;
+
+ static const int tsip_machine_parser_header_Content_Type_en_main = 1;
+
+
+ /* #line 119 "./ragel/tsip_parser_header_Content_Type.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Content_Type_first_final);
+ (void)(tsip_machine_parser_header_Content_Type_error);
+ (void)(tsip_machine_parser_header_Content_Type_en_main);
+
+ /* #line 248 "./src/headers/tsip_header_Content_Type.c" */
+ {
+ cs = tsip_machine_parser_header_Content_Type_start;
+ }
+
+ /* #line 124 "./ragel/tsip_parser_header_Content_Type.rl" */
+
+ /* #line 255 "./src/headers/tsip_header_Content_Type.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Content_Type_trans_keys + _tsip_machine_parser_header_Content_Type_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Content_Type_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Content_Type_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Content_Type_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Content_Type_trans_keys + _tsip_machine_parser_header_Content_Type_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Content_Type_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Content_Type_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Content_Type_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Content_Type_indicies[_trans];
- cs = _tsip_machine_parser_header_Content_Type_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Content_Type_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Content_Type_actions + _tsip_machine_parser_header_Content_Type_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Content_Type.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Content_Type.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ctype->type);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Content_Type.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_ctype));
- }
- break;
- case 3:
-/* #line 60 "./ragel/tsip_parser_header_Content_Type.rl" */
- {
- }
- break;
-/* #line 352 "./src/headers/tsip_header_Content_Type.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Content_Type_indicies[_trans];
+ cs = _tsip_machine_parser_header_Content_Type_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Content_Type_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Content_Type_actions + _tsip_machine_parser_header_Content_Type_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Content_Type.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Content_Type.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ctype->type);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Content_Type.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_ctype));
+ }
+ break;
+ case 3:
+ /* #line 60 "./ragel/tsip_parser_header_Content_Type.rl" */
+ {
+ }
+ break;
+ /* #line 352 "./src/headers/tsip_header_Content_Type.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 125 "./ragel/tsip_parser_header_Content_Type.rl" */
-
- if( cs <
-/* #line 368 "./src/headers/tsip_header_Content_Type.c" */
-55
-/* #line 126 "./ragel/tsip_parser_header_Content_Type.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP 'Content-Type' header.");
- TSK_OBJECT_SAFE_FREE(hdr_ctype);
- }
-
- return hdr_ctype;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 125 "./ragel/tsip_parser_header_Content_Type.rl" */
+
+ if( cs <
+ /* #line 368 "./src/headers/tsip_header_Content_Type.c" */
+ 55
+ /* #line 126 "./ragel/tsip_parser_header_Content_Type.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP 'Content-Type' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ctype);
+ }
+
+ return hdr_ctype;
}
@@ -387,39 +398,38 @@ _again:
static tsk_object_t* tsip_header_Content_Type_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- TSIP_HEADER(Content_Type)->type = tsip_htype_Content_Type;
- TSIP_HEADER(Content_Type)->serialize = tsip_header_Content_Type_serialize;
-
- Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
- }
- return self;
+ tsip_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ TSIP_HEADER(Content_Type)->type = tsip_htype_Content_Type;
+ TSIP_HEADER(Content_Type)->serialize = tsip_header_Content_Type_serialize;
+
+ Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Content_Type header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Content_Type_dtor(tsk_object_t *self)
{
- tsip_header_Content_Type_t *Content_Type = self;
- if(Content_Type){
- TSK_FREE(Content_Type->type);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Content_Type));
- }
- else{
- TSK_DEBUG_ERROR("Null Content_Type header.");
- }
-
- return self;
+ tsip_header_Content_Type_t *Content_Type = self;
+ if(Content_Type) {
+ TSK_FREE(Content_Type->type);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Content_Type));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Content_Type header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Content_Type_def_s =
-{
- sizeof(tsip_header_Content_Type_t),
- tsip_header_Content_Type_ctor,
- tsip_header_Content_Type_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Content_Type_def_s = {
+ sizeof(tsip_header_Content_Type_t),
+ tsip_header_Content_Type_ctor,
+ tsip_header_Content_Type_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Content_Type_def_t = &tsip_header_Content_Type_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Date.c b/tinySIP/src/headers/tsip_header_Date.c
index f457c30..747e3bb 100755
--- a/tinySIP/src/headers/tsip_header_Date.c
+++ b/tinySIP/src/headers/tsip_header_Date.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,346 +49,357 @@
tsip_header_Date_t* tsip_header_Date_create(const char* wkday, const char* month, int8_t day, int16_t year, int8_t h, int8_t m, int8_t s)
{
- return tsk_object_new(TSIP_HEADER_DATE_VA_ARGS(wkday, month, day, year, h, m, s));
+ return tsk_object_new(TSIP_HEADER_DATE_VA_ARGS(wkday, month, day, year, h, m, s));
}
tsip_header_Date_t* tsip_header_Date_create_null()
{
- return tsip_header_Date_create(tsk_null, tsk_null, -1, -1, -1, -1, -1);
+ return tsip_header_Date_create(tsk_null, tsk_null, -1, -1, -1, -1, -1);
}
int tsip_header_Date_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- /* Date: Wed, 28 Apr 2010 23:42:50 GMT */
- if(header){
- const tsip_header_Date_t *Date = (const tsip_header_Date_t *)header;
- if(Date->month){
- tsk_buffer_append_2(output, "%s, %d %s %d %d:%d:%d GMT",
- Date->wkday, Date->day, Date->month, Date->year, Date->time.h, Date->time.m, Date->time.s);
- }
- return 0;
- }
-
- return -1;
+ /* Date: Wed, 28 Apr 2010 23:42:50 GMT */
+ if(header) {
+ const tsip_header_Date_t *Date = (const tsip_header_Date_t *)header;
+ if(Date->month) {
+ tsk_buffer_append_2(output, "%s, %d %s %d %d:%d:%d GMT",
+ Date->wkday, Date->day, Date->month, Date->year, Date->time.h, Date->time.m, Date->time.s);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Date_t *tsip_header_Date_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Date_t *hdr_Date = tsip_header_Date_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 87 "./src/headers/tsip_header_Date.c" */
-static const char _tsip_machine_parser_header_Date_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8
-};
-
-static const unsigned char _tsip_machine_parser_header_Date_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 24,
- 25, 27, 39, 41, 43, 44, 45, 47,
- 49, 50, 66, 70, 72, 73, 75, 77,
- 79, 81, 82, 84, 86, 87, 89, 91,
- 92, 94, 96, 97, 99, 101, 103, 104,
- 105, 107, 109, 111, 113, 115, 119, 121,
- 125, 127, 131, 133, 135, 137, 139, 141,
- 143, 145, 147, 151, 153, 157, 159, 161,
- 163, 165
-};
-
-static const char _tsip_machine_parser_header_Date_trans_keys[] = {
- 68, 100, 65, 97, 84, 116, 69, 101,
- 9, 32, 58, 9, 13, 32, 70, 77,
- 83, 84, 87, 102, 109, 115, 116, 119,
- 10, 9, 32, 9, 32, 70, 77, 83,
- 84, 87, 102, 109, 115, 116, 119, 82,
- 114, 73, 105, 44, 32, 48, 57, 48,
- 57, 32, 65, 68, 70, 74, 77, 78,
- 79, 83, 97, 100, 102, 106, 109, 110,
- 111, 115, 80, 85, 112, 117, 82, 114,
- 32, 48, 57, 48, 57, 48, 57, 48,
- 57, 32, 48, 57, 48, 57, 58, 48,
- 57, 48, 57, 58, 48, 57, 48, 57,
- 32, 71, 103, 77, 109, 84, 116, 13,
- 10, 71, 103, 69, 101, 67, 99, 69,
- 101, 66, 98, 65, 85, 97, 117, 78,
- 110, 76, 78, 108, 110, 65, 97, 82,
- 89, 114, 121, 79, 111, 86, 118, 67,
- 99, 84, 116, 69, 101, 80, 112, 79,
- 111, 78, 110, 65, 85, 97, 117, 84,
- 116, 72, 85, 104, 117, 85, 117, 69,
- 101, 69, 101, 68, 100, 0
-};
-
-static const char _tsip_machine_parser_header_Date_single_lengths[] = {
- 0, 2, 2, 2, 2, 3, 13, 1,
- 2, 12, 2, 2, 1, 1, 0, 0,
- 1, 16, 4, 2, 1, 0, 0, 0,
- 0, 1, 0, 0, 1, 0, 0, 1,
- 0, 0, 1, 2, 2, 2, 1, 1,
- 2, 2, 2, 2, 2, 4, 2, 4,
- 2, 4, 2, 2, 2, 2, 2, 2,
- 2, 2, 4, 2, 4, 2, 2, 2,
- 2, 0
-};
-
-static const char _tsip_machine_parser_header_Date_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 1, 0,
- 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
-};
-
-static const short _tsip_machine_parser_header_Date_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 16, 30,
- 32, 35, 48, 51, 54, 56, 58, 60,
- 62, 64, 81, 86, 89, 91, 93, 95,
- 97, 99, 101, 103, 105, 107, 109, 111,
- 113, 115, 117, 119, 122, 125, 128, 130,
- 132, 135, 138, 141, 144, 147, 152, 155,
- 160, 163, 168, 171, 174, 177, 180, 183,
- 186, 189, 192, 197, 200, 205, 208, 211,
- 214, 217
-};
-
-static const char _tsip_machine_parser_header_Date_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 4, 4, 5, 1,
- 5, 6, 5, 7, 8, 9, 10, 11,
- 7, 8, 9, 10, 11, 1, 12, 1,
- 13, 13, 1, 13, 13, 7, 8, 9,
- 10, 11, 7, 8, 9, 10, 11, 1,
- 14, 14, 1, 15, 15, 1, 16, 1,
- 17, 1, 18, 1, 19, 1, 20, 1,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 1, 29, 30, 29, 30, 1, 31, 31,
- 1, 32, 1, 33, 1, 34, 1, 35,
- 1, 36, 1, 37, 1, 38, 1, 39,
- 1, 40, 1, 41, 1, 42, 1, 43,
- 1, 44, 1, 45, 1, 46, 1, 47,
- 47, 1, 48, 48, 1, 49, 49, 1,
- 50, 1, 51, 1, 31, 31, 1, 52,
- 52, 1, 31, 31, 1, 53, 53, 1,
- 31, 31, 1, 54, 55, 54, 55, 1,
- 31, 31, 1, 31, 31, 31, 31, 1,
- 56, 56, 1, 31, 31, 31, 31, 1,
- 57, 57, 1, 31, 31, 1, 58, 58,
- 1, 31, 31, 1, 59, 59, 1, 31,
- 31, 1, 60, 60, 1, 15, 15, 1,
- 61, 60, 61, 60, 1, 15, 15, 1,
- 62, 63, 62, 63, 1, 15, 15, 1,
- 15, 15, 1, 64, 64, 1, 15, 15,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Date_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 10,
- 56, 58, 60, 63, 8, 9, 11, 12,
- 13, 14, 15, 16, 17, 18, 41, 43,
- 45, 48, 50, 52, 54, 19, 40, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 65, 42, 44, 46, 47,
- 49, 51, 53, 55, 57, 59, 61, 62,
- 64
-};
-
-static const char _tsip_machine_parser_header_Date_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 0, 0, 0, 0,
- 3, 0, 1, 0, 5, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 0, 0,
- 7, 1, 0, 0, 0, 9, 1, 0,
- 11, 1, 0, 13, 1, 0, 15, 0,
- 0, 0, 0, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
-
-static const int tsip_machine_parser_header_Date_start = 1;
-static const int tsip_machine_parser_header_Date_first_final = 65;
-static const int tsip_machine_parser_header_Date_error = 0;
-
-static const int tsip_machine_parser_header_Date_en_main = 1;
-
-
-/* #line 134 "./ragel/tsip_parser_header_Date.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Date_first_final);
- (void)(tsip_machine_parser_header_Date_error);
- (void)(tsip_machine_parser_header_Date_en_main);
-
-/* #line 234 "./src/headers/tsip_header_Date.c" */
- {
- cs = tsip_machine_parser_header_Date_start;
- }
-
-/* #line 139 "./ragel/tsip_parser_header_Date.rl" */
-
-/* #line 241 "./src/headers/tsip_header_Date.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Date_t *hdr_Date = tsip_header_Date_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 87 "./src/headers/tsip_header_Date.c" */
+ static const char _tsip_machine_parser_header_Date_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Date_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 24,
+ 25, 27, 39, 41, 43, 44, 45, 47,
+ 49, 50, 66, 70, 72, 73, 75, 77,
+ 79, 81, 82, 84, 86, 87, 89, 91,
+ 92, 94, 96, 97, 99, 101, 103, 104,
+ 105, 107, 109, 111, 113, 115, 119, 121,
+ 125, 127, 131, 133, 135, 137, 139, 141,
+ 143, 145, 147, 151, 153, 157, 159, 161,
+ 163, 165
+ };
+
+ static const char _tsip_machine_parser_header_Date_trans_keys[] = {
+ 68, 100, 65, 97, 84, 116, 69, 101,
+ 9, 32, 58, 9, 13, 32, 70, 77,
+ 83, 84, 87, 102, 109, 115, 116, 119,
+ 10, 9, 32, 9, 32, 70, 77, 83,
+ 84, 87, 102, 109, 115, 116, 119, 82,
+ 114, 73, 105, 44, 32, 48, 57, 48,
+ 57, 32, 65, 68, 70, 74, 77, 78,
+ 79, 83, 97, 100, 102, 106, 109, 110,
+ 111, 115, 80, 85, 112, 117, 82, 114,
+ 32, 48, 57, 48, 57, 48, 57, 48,
+ 57, 32, 48, 57, 48, 57, 58, 48,
+ 57, 48, 57, 58, 48, 57, 48, 57,
+ 32, 71, 103, 77, 109, 84, 116, 13,
+ 10, 71, 103, 69, 101, 67, 99, 69,
+ 101, 66, 98, 65, 85, 97, 117, 78,
+ 110, 76, 78, 108, 110, 65, 97, 82,
+ 89, 114, 121, 79, 111, 86, 118, 67,
+ 99, 84, 116, 69, 101, 80, 112, 79,
+ 111, 78, 110, 65, 85, 97, 117, 84,
+ 116, 72, 85, 104, 117, 85, 117, 69,
+ 101, 69, 101, 68, 100, 0
+ };
+
+ static const char _tsip_machine_parser_header_Date_single_lengths[] = {
+ 0, 2, 2, 2, 2, 3, 13, 1,
+ 2, 12, 2, 2, 1, 1, 0, 0,
+ 1, 16, 4, 2, 1, 0, 0, 0,
+ 0, 1, 0, 0, 1, 0, 0, 1,
+ 0, 0, 1, 2, 2, 2, 1, 1,
+ 2, 2, 2, 2, 2, 4, 2, 4,
+ 2, 4, 2, 2, 2, 2, 2, 2,
+ 2, 2, 4, 2, 4, 2, 2, 2,
+ 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_Date_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 0, 1, 1, 0, 1, 1, 0,
+ 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Date_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 16, 30,
+ 32, 35, 48, 51, 54, 56, 58, 60,
+ 62, 64, 81, 86, 89, 91, 93, 95,
+ 97, 99, 101, 103, 105, 107, 109, 111,
+ 113, 115, 117, 119, 122, 125, 128, 130,
+ 132, 135, 138, 141, 144, 147, 152, 155,
+ 160, 163, 168, 171, 174, 177, 180, 183,
+ 186, 189, 192, 197, 200, 205, 208, 211,
+ 214, 217
+ };
+
+ static const char _tsip_machine_parser_header_Date_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 4, 4, 5, 1,
+ 5, 6, 5, 7, 8, 9, 10, 11,
+ 7, 8, 9, 10, 11, 1, 12, 1,
+ 13, 13, 1, 13, 13, 7, 8, 9,
+ 10, 11, 7, 8, 9, 10, 11, 1,
+ 14, 14, 1, 15, 15, 1, 16, 1,
+ 17, 1, 18, 1, 19, 1, 20, 1,
+ 21, 22, 23, 24, 25, 26, 27, 28,
+ 21, 22, 23, 24, 25, 26, 27, 28,
+ 1, 29, 30, 29, 30, 1, 31, 31,
+ 1, 32, 1, 33, 1, 34, 1, 35,
+ 1, 36, 1, 37, 1, 38, 1, 39,
+ 1, 40, 1, 41, 1, 42, 1, 43,
+ 1, 44, 1, 45, 1, 46, 1, 47,
+ 47, 1, 48, 48, 1, 49, 49, 1,
+ 50, 1, 51, 1, 31, 31, 1, 52,
+ 52, 1, 31, 31, 1, 53, 53, 1,
+ 31, 31, 1, 54, 55, 54, 55, 1,
+ 31, 31, 1, 31, 31, 31, 31, 1,
+ 56, 56, 1, 31, 31, 31, 31, 1,
+ 57, 57, 1, 31, 31, 1, 58, 58,
+ 1, 31, 31, 1, 59, 59, 1, 31,
+ 31, 1, 60, 60, 1, 15, 15, 1,
+ 61, 60, 61, 60, 1, 15, 15, 1,
+ 62, 63, 62, 63, 1, 15, 15, 1,
+ 15, 15, 1, 64, 64, 1, 15, 15,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Date_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 10,
+ 56, 58, 60, 63, 8, 9, 11, 12,
+ 13, 14, 15, 16, 17, 18, 41, 43,
+ 45, 48, 50, 52, 54, 19, 40, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 65, 42, 44, 46, 47,
+ 49, 51, 53, 55, 57, 59, 61, 62,
+ 64
+ };
+
+ static const char _tsip_machine_parser_header_Date_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0,
+ 3, 0, 1, 0, 5, 1, 1, 1,
+ 1, 1, 1, 1, 1, 0, 0, 0,
+ 7, 1, 0, 0, 0, 9, 1, 0,
+ 11, 1, 0, 13, 1, 0, 15, 0,
+ 0, 0, 0, 17, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
+
+ static const int tsip_machine_parser_header_Date_start = 1;
+ static const int tsip_machine_parser_header_Date_first_final = 65;
+ static const int tsip_machine_parser_header_Date_error = 0;
+
+ static const int tsip_machine_parser_header_Date_en_main = 1;
+
+
+ /* #line 134 "./ragel/tsip_parser_header_Date.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Date_first_final);
+ (void)(tsip_machine_parser_header_Date_error);
+ (void)(tsip_machine_parser_header_Date_en_main);
+
+ /* #line 234 "./src/headers/tsip_header_Date.c" */
+ {
+ cs = tsip_machine_parser_header_Date_start;
+ }
+
+ /* #line 139 "./ragel/tsip_parser_header_Date.rl" */
+
+ /* #line 241 "./src/headers/tsip_header_Date.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Date_trans_keys + _tsip_machine_parser_header_Date_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Date_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Date_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Date_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Date_trans_keys + _tsip_machine_parser_header_Date_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Date_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Date_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Date_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Date_indicies[_trans];
- cs = _tsip_machine_parser_header_Date_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Date_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Date_actions + _tsip_machine_parser_header_Date_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Date.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Date->wkday);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Date->day);
- }
- break;
- case 3:
-/* #line 62 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Date->month);
- }
- break;
- case 4:
-/* #line 66 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Date->year);
- }
- break;
- case 5:
-/* #line 70 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Date->time.h);
- }
- break;
- case 6:
-/* #line 74 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Date->time.m);
- }
- break;
- case 7:
-/* #line 78 "./ragel/tsip_parser_header_Date.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Date->time.s);
- }
- break;
- case 8:
-/* #line 82 "./ragel/tsip_parser_header_Date.rl" */
- {
- }
- break;
-/* #line 368 "./src/headers/tsip_header_Date.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Date_indicies[_trans];
+ cs = _tsip_machine_parser_header_Date_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Date_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Date_actions + _tsip_machine_parser_header_Date_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Date->wkday);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Date->day);
+ }
+ break;
+ case 3:
+ /* #line 62 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Date->month);
+ }
+ break;
+ case 4:
+ /* #line 66 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Date->year);
+ }
+ break;
+ case 5:
+ /* #line 70 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Date->time.h);
+ }
+ break;
+ case 6:
+ /* #line 74 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Date->time.m);
+ }
+ break;
+ case 7:
+ /* #line 78 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Date->time.s);
+ }
+ break;
+ case 8:
+ /* #line 82 "./ragel/tsip_parser_header_Date.rl" */
+ {
+ }
+ break;
+ /* #line 368 "./src/headers/tsip_header_Date.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 140 "./ragel/tsip_parser_header_Date.rl" */
-
- if( cs <
-/* #line 384 "./src/headers/tsip_header_Date.c" */
-65
-/* #line 141 "./ragel/tsip_parser_header_Date.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Date' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Date);
- }
-
- return hdr_Date;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 140 "./ragel/tsip_parser_header_Date.rl" */
+
+ if( cs <
+ /* #line 384 "./src/headers/tsip_header_Date.c" */
+ 65
+ /* #line 141 "./ragel/tsip_parser_header_Date.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Date' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Date);
+ }
+
+ return hdr_Date;
}
@@ -403,64 +414,63 @@ _again:
static tsk_object_t* tsip_header_Date_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Date_t *Date = self;
- if(Date){
- const char* wkday;
- const char* month;
- TSIP_HEADER(Date)->type = tsip_htype_Date;
- TSIP_HEADER(Date)->serialize = tsip_header_Date_serialize;
- Date->day = Date->time.h = Date->time.m = Date->time.s = -1;
- Date->year = -1;
+ tsip_header_Date_t *Date = self;
+ if(Date) {
+ const char* wkday;
+ const char* month;
+ TSIP_HEADER(Date)->type = tsip_htype_Date;
+ TSIP_HEADER(Date)->serialize = tsip_header_Date_serialize;
+ Date->day = Date->time.h = Date->time.m = Date->time.s = -1;
+ Date->year = -1;
- if((wkday = va_arg(*app, const char*))){
- month = va_arg(*app, const char*);
+ if((wkday = va_arg(*app, const char*))) {
+ month = va_arg(*app, const char*);
- Date->wkday = tsk_strdup(wkday);
- Date->month = tsk_strdup(month);
+ Date->wkday = tsk_strdup(wkday);
+ Date->month = tsk_strdup(month);
#if defined __GNUC__
- Date->day = (int8_t)va_arg(*app, int);
- Date->year = (int16_t)va_arg(*app, int);
- Date->time.h = (int8_t)va_arg(*app, int);
- Date->time.m = (int8_t)va_arg(*app, int);
- Date->time.s = (int8_t)va_arg(*app, int);
+ Date->day = (int8_t)va_arg(*app, int);
+ Date->year = (int16_t)va_arg(*app, int);
+ Date->time.h = (int8_t)va_arg(*app, int);
+ Date->time.m = (int8_t)va_arg(*app, int);
+ Date->time.s = (int8_t)va_arg(*app, int);
#else
- Date->day = va_arg(*app, int8_t);
- Date->year = va_arg(*app, int16_t);
- Date->time.h = va_arg(*app, int8_t);
- Date->time.m = va_arg(*app, int8_t);
- Date->time.s = va_arg(*app, int8_t);
+ Date->day = va_arg(*app, int8_t);
+ Date->year = va_arg(*app, int16_t);
+ Date->time.h = va_arg(*app, int8_t);
+ Date->time.m = va_arg(*app, int8_t);
+ Date->time.s = va_arg(*app, int8_t);
#endif
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Date header.");
- }
- return self;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Date header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Date_dtor(tsk_object_t *self)
{
- tsip_header_Date_t *Date = self;
- if(Date){
- TSK_FREE(Date->wkday);
- TSK_FREE(Date->month);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Date));
- }
- else{
- TSK_DEBUG_ERROR("Null Date header.");
- }
-
- return self;
+ tsip_header_Date_t *Date = self;
+ if(Date) {
+ TSK_FREE(Date->wkday);
+ TSK_FREE(Date->month);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Date));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Date header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Date_def_s =
-{
- sizeof(tsip_header_Date_t),
- tsip_header_Date_ctor,
- tsip_header_Date_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Date_def_s = {
+ sizeof(tsip_header_Date_t),
+ tsip_header_Date_ctor,
+ tsip_header_Date_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Date_def_t = &tsip_header_Date_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Dummy.c b/tinySIP/src/headers/tsip_header_Dummy.c
index 9c5dd18..7febe24 100755
--- a/tinySIP/src/headers/tsip_header_Dummy.c
+++ b/tinySIP/src/headers/tsip_header_Dummy.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,234 +49,245 @@
tsip_header_Dummy_t* tsip_header_Dummy_create(const char* name, const char* value)
{
- return tsk_object_new(TSIP_HEADER_DUMMY_VA_ARGS(name, value));
+ return tsk_object_new(TSIP_HEADER_DUMMY_VA_ARGS(name, value));
}
tsip_header_Dummy_t* tsip_header_Dummy_create_null()
{
- return tsip_header_Dummy_create(tsk_null, tsk_null);
+ return tsip_header_Dummy_create(tsk_null, tsk_null);
}
int tsip_header_Dummy_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Dummy_t *Dummy = (const tsip_header_Dummy_t *)header;
- if(Dummy->value){
- tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Dummy_t *Dummy = (const tsip_header_Dummy_t *)header;
+ if(Dummy->value) {
+ tsk_buffer_append(output, Dummy->value, tsk_strlen(Dummy->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Dummy_t *tsip_header_Dummy_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Dummy_t *hdr_Dummy = tsip_header_Dummy_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 85 "./src/headers/tsip_header_Dummy.c" */
-static const char _tsip_machine_parser_header_Dummy_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 2, 0, 2
-};
-
-static const char _tsip_machine_parser_header_Dummy_key_offsets[] = {
- 0, 0, 14, 31, 34, 37, 38, 39,
- 40, 42, 45
-};
-
-static const char _tsip_machine_parser_header_Dummy_trans_keys[] = {
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 13, 32, 0
-};
-
-static const char _tsip_machine_parser_header_Dummy_single_lengths[] = {
- 0, 4, 7, 3, 3, 1, 1, 1,
- 2, 3, 0
-};
-
-static const char _tsip_machine_parser_header_Dummy_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Dummy_index_offsets[] = {
- 0, 0, 10, 23, 27, 31, 33, 35,
- 37, 40, 44
-};
-
-static const char _tsip_machine_parser_header_Dummy_indicies[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 2, 3, 3, 3, 4,
- 3, 3, 3, 3, 3, 3, 1, 5,
- 5, 6, 1, 6, 8, 6, 7, 10,
- 9, 11, 1, 12, 1, 13, 13, 1,
- 13, 14, 13, 7, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Dummy_trans_targs[] = {
- 2, 0, 3, 2, 4, 3, 4, 5,
- 7, 5, 6, 10, 8, 9, 6
-};
-
-static const char _tsip_machine_parser_header_Dummy_trans_actions[] = {
- 1, 0, 3, 0, 3, 0, 0, 1,
- 0, 0, 5, 7, 0, 0, 9
-};
-
-static const int tsip_machine_parser_header_Dummy_start = 1;
-static const int tsip_machine_parser_header_Dummy_first_final = 10;
-static const int tsip_machine_parser_header_Dummy_error = 0;
-
-static const int tsip_machine_parser_header_Dummy_en_main = 1;
-
-
-/* #line 106 "./ragel/tsip_parser_header_Dummy.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Dummy_first_final);
- (void)(tsip_machine_parser_header_Dummy_error);
- (void)(tsip_machine_parser_header_Dummy_en_main);
-
-/* #line 152 "./src/headers/tsip_header_Dummy.c" */
- {
- cs = tsip_machine_parser_header_Dummy_start;
- }
-
-/* #line 111 "./ragel/tsip_parser_header_Dummy.rl" */
-
-/* #line 159 "./src/headers/tsip_header_Dummy.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Dummy_t *hdr_Dummy = tsip_header_Dummy_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 85 "./src/headers/tsip_header_Dummy.c" */
+ static const char _tsip_machine_parser_header_Dummy_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 2, 0, 2
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_key_offsets[] = {
+ 0, 0, 14, 31, 34, 37, 38, 39,
+ 40, 42, 45
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_trans_keys[] = {
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 13, 32, 0
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_single_lengths[] = {
+ 0, 4, 7, 3, 3, 1, 1, 1,
+ 2, 3, 0
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_range_lengths[] = {
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_index_offsets[] = {
+ 0, 0, 10, 23, 27, 31, 33, 35,
+ 37, 40, 44
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_indicies[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 2, 2, 3, 3, 3, 4,
+ 3, 3, 3, 3, 3, 3, 1, 5,
+ 5, 6, 1, 6, 8, 6, 7, 10,
+ 9, 11, 1, 12, 1, 13, 13, 1,
+ 13, 14, 13, 7, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_trans_targs[] = {
+ 2, 0, 3, 2, 4, 3, 4, 5,
+ 7, 5, 6, 10, 8, 9, 6
+ };
+
+ static const char _tsip_machine_parser_header_Dummy_trans_actions[] = {
+ 1, 0, 3, 0, 3, 0, 0, 1,
+ 0, 0, 5, 7, 0, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_Dummy_start = 1;
+ static const int tsip_machine_parser_header_Dummy_first_final = 10;
+ static const int tsip_machine_parser_header_Dummy_error = 0;
+
+ static const int tsip_machine_parser_header_Dummy_en_main = 1;
+
+
+ /* #line 106 "./ragel/tsip_parser_header_Dummy.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Dummy_first_final);
+ (void)(tsip_machine_parser_header_Dummy_error);
+ (void)(tsip_machine_parser_header_Dummy_en_main);
+
+ /* #line 152 "./src/headers/tsip_header_Dummy.c" */
+ {
+ cs = tsip_machine_parser_header_Dummy_start;
+ }
+
+ /* #line 111 "./ragel/tsip_parser_header_Dummy.rl" */
+
+ /* #line 159 "./src/headers/tsip_header_Dummy.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Dummy_trans_keys + _tsip_machine_parser_header_Dummy_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Dummy_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Dummy_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Dummy_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Dummy_trans_keys + _tsip_machine_parser_header_Dummy_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Dummy_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Dummy_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Dummy_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Dummy_indicies[_trans];
- cs = _tsip_machine_parser_header_Dummy_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Dummy_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Dummy_actions + _tsip_machine_parser_header_Dummy_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Dummy.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->name);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Dummy.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Dummy->value);
- }
- break;
- case 3:
-/* #line 62 "./ragel/tsip_parser_header_Dummy.rl" */
- {
- }
- break;
-/* #line 256 "./src/headers/tsip_header_Dummy.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Dummy_indicies[_trans];
+ cs = _tsip_machine_parser_header_Dummy_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Dummy_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Dummy_actions + _tsip_machine_parser_header_Dummy_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Dummy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->name);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Dummy.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Dummy->value);
+ }
+ break;
+ case 3:
+ /* #line 62 "./ragel/tsip_parser_header_Dummy.rl" */
+ {
+ }
+ break;
+ /* #line 256 "./src/headers/tsip_header_Dummy.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 112 "./ragel/tsip_parser_header_Dummy.rl" */
-
- if( cs <
-/* #line 272 "./src/headers/tsip_header_Dummy.c" */
-10
-/* #line 113 "./ragel/tsip_parser_header_Dummy.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Dummy' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Dummy);
- }
-
- return hdr_Dummy;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 112 "./ragel/tsip_parser_header_Dummy.rl" */
+
+ if( cs <
+ /* #line 272 "./src/headers/tsip_header_Dummy.c" */
+ 10
+ /* #line 113 "./ragel/tsip_parser_header_Dummy.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Dummy' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Dummy);
+ }
+
+ return hdr_Dummy;
}
@@ -291,41 +302,40 @@ _again:
static tsk_object_t* tsip_header_Dummy_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSIP_HEADER(Dummy)->type = tsip_htype_Dummy;
- TSIP_HEADER(Dummy)->serialize = tsip_header_Dummy_serialize;
-
- Dummy->name = tsk_strdup(va_arg(*app, const char*));
- Dummy->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Dummy header.");
- }
- return self;
+ tsip_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSIP_HEADER(Dummy)->type = tsip_htype_Dummy;
+ TSIP_HEADER(Dummy)->serialize = tsip_header_Dummy_serialize;
+
+ Dummy->name = tsk_strdup(va_arg(*app, const char*));
+ Dummy->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Dummy header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Dummy_dtor(tsk_object_t *self)
{
- tsip_header_Dummy_t *Dummy = self;
- if(Dummy){
- TSK_FREE(Dummy->name);
- TSK_FREE(Dummy->value);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Dummy));
- }
- else{
- TSK_DEBUG_ERROR("Null Dummy header.");
- }
-
- return self;
+ tsip_header_Dummy_t *Dummy = self;
+ if(Dummy) {
+ TSK_FREE(Dummy->name);
+ TSK_FREE(Dummy->value);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Dummy));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Dummy header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Dummy_def_s =
-{
- sizeof(tsip_header_Dummy_t),
- tsip_header_Dummy_ctor,
- tsip_header_Dummy_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Dummy_def_s = {
+ sizeof(tsip_header_Dummy_t),
+ tsip_header_Dummy_ctor,
+ tsip_header_Dummy_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Dummy_def_t = &tsip_header_Dummy_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Event.c b/tinySIP/src/headers/tsip_header_Event.c
index 8268fa5..cc1f5fc 100755
--- a/tinySIP/src/headers/tsip_header_Event.c
+++ b/tinySIP/src/headers/tsip_header_Event.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,367 +50,378 @@
tsip_header_Event_t* tsip_header_Event_create(const char* package)
{
- return tsk_object_new(TSIP_HEADER_EVENT_VA_ARGS(package));
+ return tsk_object_new(TSIP_HEADER_EVENT_VA_ARGS(package));
}
int tsip_header_Event_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Event_t *Event = (const tsip_header_Event_t *)header;
- if(Event->package){
- return tsk_buffer_append(output, Event->package, tsk_strlen(Event->package));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Event_t *Event = (const tsip_header_Event_t *)header;
+ if(Event->package) {
+ return tsk_buffer_append(output, Event->package, tsk_strlen(Event->package));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Event_t *tsip_header_Event_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Event_t *hdr_event = tsip_header_Event_create(tsk_null);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 81 "./src/headers/tsip_header_Event.c" */
-static const char _tsip_machine_parser_header_Event_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const short _tsip_machine_parser_header_Event_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 15,
- 31, 32, 34, 49, 67, 71, 72, 74,
- 77, 94, 95, 97, 113, 132, 137, 138,
- 140, 144, 163, 164, 166, 185, 186, 188,
- 191, 199, 200, 202, 206, 207, 213, 231,
- 238, 246, 254, 262, 264, 271, 280, 282,
- 285, 287, 290, 292, 295, 298, 299, 302,
- 303, 306, 307, 316, 325, 333, 341, 349,
- 357, 359, 365, 374, 383, 392, 394, 397,
- 400, 401, 402, 415
-};
-
-static const char _tsip_machine_parser_header_Event_trans_keys[] = {
- 69, 79, 101, 111, 86, 118, 69, 101,
- 78, 110, 84, 116, 9, 32, 58, 9,
- 13, 32, 33, 37, 39, 45, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 45,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 45,
- 46, 59, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 59, 10,
- 9, 32, 9, 32, 59, 9, 13, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 61, 10, 9, 32, 9, 32, 59, 61,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 34, 13,
- 34, 92, 127, 0, 8, 10, 31, 10,
- 9, 32, 9, 13, 32, 59, 10, 0,
- 9, 11, 12, 14, 127, 9, 13, 32,
- 33, 37, 39, 59, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 58,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 58, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 48, 57, 46, 48, 57, 48, 57, 46,
- 48, 57, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 46, 48, 57, 46, 46,
- 48, 57, 46, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 48, 57, 46, 48, 57, 46, 48, 57,
- 46, 58, 33, 37, 39, 45, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 0
-};
-
-static const char _tsip_machine_parser_header_Event_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 3, 8,
- 1, 2, 7, 10, 4, 1, 2, 3,
- 7, 1, 2, 6, 9, 5, 1, 2,
- 4, 9, 1, 2, 9, 1, 2, 3,
- 4, 1, 2, 4, 1, 0, 8, 1,
- 2, 2, 2, 2, 1, 3, 0, 1,
- 0, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 2, 2, 2, 2,
- 2, 0, 3, 3, 3, 0, 1, 1,
- 1, 1, 5, 0
-};
-
-static const char _tsip_machine_parser_header_Event_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 4,
- 0, 0, 4, 4, 0, 0, 0, 0,
- 5, 0, 0, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 2, 0, 0, 0, 0, 3, 5, 3,
- 3, 3, 3, 0, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 1, 0, 3, 3, 3, 3, 3, 3,
- 0, 3, 3, 3, 3, 1, 1, 1,
- 0, 0, 4, 0
-};
-
-static const short _tsip_machine_parser_header_Event_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 21,
- 34, 36, 39, 51, 66, 71, 73, 76,
- 80, 93, 95, 98, 110, 125, 131, 133,
- 136, 141, 156, 158, 161, 176, 178, 181,
- 185, 192, 194, 197, 202, 204, 208, 222,
- 227, 233, 239, 245, 248, 253, 260, 262,
- 265, 267, 270, 272, 275, 278, 280, 283,
- 285, 288, 290, 297, 304, 310, 316, 322,
- 328, 331, 335, 342, 349, 356, 358, 361,
- 364, 366, 368, 378
-};
-
-static const char _tsip_machine_parser_header_Event_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 2, 2,
- 1, 2, 2, 6, 1, 6, 7, 6,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 1, 9, 1, 10, 10, 1, 10,
- 10, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 1, 11, 12, 11, 13, 13,
- 13, 13, 14, 15, 13, 13, 13, 13,
- 13, 1, 16, 17, 16, 18, 1, 19,
- 1, 20, 20, 1, 20, 20, 18, 1,
- 18, 21, 18, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 1, 23, 1, 24,
- 24, 1, 24, 24, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 1, 25, 26,
- 25, 27, 27, 27, 28, 29, 27, 27,
- 27, 27, 27, 27, 1, 30, 31, 30,
- 18, 29, 1, 32, 1, 33, 33, 1,
- 33, 33, 18, 29, 1, 29, 34, 29,
- 35, 36, 35, 35, 37, 35, 35, 35,
- 35, 35, 35, 1, 38, 1, 39, 39,
- 1, 39, 40, 39, 35, 36, 35, 35,
- 37, 35, 35, 35, 35, 35, 35, 1,
- 41, 1, 42, 42, 1, 42, 42, 36,
- 1, 43, 44, 45, 1, 1, 1, 36,
- 46, 1, 36, 36, 1, 47, 26, 47,
- 28, 1, 48, 1, 36, 36, 36, 1,
- 47, 26, 47, 35, 35, 35, 28, 35,
- 35, 35, 35, 35, 35, 1, 50, 49,
- 49, 49, 1, 52, 44, 51, 51, 51,
- 1, 52, 44, 53, 53, 53, 1, 52,
- 44, 54, 54, 54, 1, 52, 44, 1,
- 56, 55, 49, 49, 1, 57, 52, 44,
- 58, 51, 51, 1, 59, 1, 60, 61,
- 1, 62, 1, 63, 64, 1, 65, 1,
- 44, 66, 1, 44, 67, 1, 44, 1,
- 63, 68, 1, 63, 1, 60, 69, 1,
- 60, 1, 57, 52, 44, 70, 53, 53,
- 1, 57, 52, 44, 54, 54, 54, 1,
- 72, 44, 71, 71, 71, 1, 74, 44,
- 73, 73, 73, 1, 74, 44, 75, 75,
- 75, 1, 74, 44, 76, 76, 76, 1,
- 74, 44, 1, 77, 71, 71, 1, 57,
- 74, 44, 78, 73, 73, 1, 57, 74,
- 44, 79, 75, 75, 1, 57, 74, 44,
- 76, 76, 76, 1, 80, 1, 57, 81,
- 1, 57, 82, 1, 57, 1, 56, 1,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Event_trans_targs[] = {
- 2, 0, 6, 3, 4, 5, 7, 8,
- 11, 9, 10, 12, 36, 11, 74, 16,
- 12, 13, 16, 14, 15, 17, 20, 18,
- 19, 21, 36, 20, 16, 25, 21, 22,
- 23, 24, 26, 38, 32, 39, 27, 28,
- 29, 30, 31, 33, 35, 37, 34, 12,
- 75, 40, 73, 41, 44, 42, 43, 45,
- 60, 46, 58, 47, 48, 56, 49, 50,
- 54, 51, 52, 53, 55, 57, 59, 61,
- 69, 62, 65, 63, 64, 66, 67, 68,
- 70, 71, 72
-};
-
-static const char _tsip_machine_parser_header_Event_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 3, 3, 0, 0, 3,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 5, 5, 0, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Event_start = 1;
-static const int tsip_machine_parser_header_Event_first_final = 75;
-static const int tsip_machine_parser_header_Event_error = 0;
-
-static const int tsip_machine_parser_header_Event_en_main = 1;
-
-
-/* #line 107 "./ragel/tsip_parser_header_Event.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Event_first_final);
- (void)(tsip_machine_parser_header_Event_error);
- (void)(tsip_machine_parser_header_Event_en_main);
-
-/* #line 286 "./src/headers/tsip_header_Event.c" */
- {
- cs = tsip_machine_parser_header_Event_start;
- }
-
-/* #line 112 "./ragel/tsip_parser_header_Event.rl" */
-
-/* #line 293 "./src/headers/tsip_header_Event.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Event_t *hdr_event = tsip_header_Event_create(tsk_null);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 81 "./src/headers/tsip_header_Event.c" */
+ static const char _tsip_machine_parser_header_Event_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const short _tsip_machine_parser_header_Event_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 15,
+ 31, 32, 34, 49, 67, 71, 72, 74,
+ 77, 94, 95, 97, 113, 132, 137, 138,
+ 140, 144, 163, 164, 166, 185, 186, 188,
+ 191, 199, 200, 202, 206, 207, 213, 231,
+ 238, 246, 254, 262, 264, 271, 280, 282,
+ 285, 287, 290, 292, 295, 298, 299, 302,
+ 303, 306, 307, 316, 325, 333, 341, 349,
+ 357, 359, 365, 374, 383, 392, 394, 397,
+ 400, 401, 402, 415
+ };
+
+ static const char _tsip_machine_parser_header_Event_trans_keys[] = {
+ 69, 79, 101, 111, 86, 118, 69, 101,
+ 78, 110, 84, 116, 9, 32, 58, 9,
+ 13, 32, 33, 37, 39, 45, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 45,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 45,
+ 46, 59, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 59, 10,
+ 9, 32, 9, 32, 59, 9, 13, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 61, 10, 9, 32, 9, 32, 59, 61,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 34, 13,
+ 34, 92, 127, 0, 8, 10, 31, 10,
+ 9, 32, 9, 13, 32, 59, 10, 0,
+ 9, 11, 12, 14, 127, 9, 13, 32,
+ 33, 37, 39, 59, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 58,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 58, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 48, 57, 46, 48, 57, 48, 57, 46,
+ 48, 57, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 46, 48, 57, 46, 46,
+ 48, 57, 46, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 48, 57, 46, 48, 57, 46, 48, 57,
+ 46, 58, 33, 37, 39, 45, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _tsip_machine_parser_header_Event_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 3, 8,
+ 1, 2, 7, 10, 4, 1, 2, 3,
+ 7, 1, 2, 6, 9, 5, 1, 2,
+ 4, 9, 1, 2, 9, 1, 2, 3,
+ 4, 1, 2, 4, 1, 0, 8, 1,
+ 2, 2, 2, 2, 1, 3, 0, 1,
+ 0, 1, 0, 1, 1, 1, 1, 1,
+ 1, 1, 3, 3, 2, 2, 2, 2,
+ 2, 0, 3, 3, 3, 0, 1, 1,
+ 1, 1, 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Event_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 4,
+ 0, 0, 4, 4, 0, 0, 0, 0,
+ 5, 0, 0, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 2, 0, 0, 0, 0, 3, 5, 3,
+ 3, 3, 3, 0, 3, 3, 1, 1,
+ 1, 1, 1, 1, 1, 0, 1, 0,
+ 1, 0, 3, 3, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 1, 1, 1,
+ 0, 0, 4, 0
+ };
+
+ static const short _tsip_machine_parser_header_Event_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 21,
+ 34, 36, 39, 51, 66, 71, 73, 76,
+ 80, 93, 95, 98, 110, 125, 131, 133,
+ 136, 141, 156, 158, 161, 176, 178, 181,
+ 185, 192, 194, 197, 202, 204, 208, 222,
+ 227, 233, 239, 245, 248, 253, 260, 262,
+ 265, 267, 270, 272, 275, 278, 280, 283,
+ 285, 288, 290, 297, 304, 310, 316, 322,
+ 328, 331, 335, 342, 349, 356, 358, 361,
+ 364, 366, 368, 378
+ };
+
+ static const char _tsip_machine_parser_header_Event_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 2, 2,
+ 1, 2, 2, 6, 1, 6, 7, 6,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 1, 9, 1, 10, 10, 1, 10,
+ 10, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 1, 11, 12, 11, 13, 13,
+ 13, 13, 14, 15, 13, 13, 13, 13,
+ 13, 1, 16, 17, 16, 18, 1, 19,
+ 1, 20, 20, 1, 20, 20, 18, 1,
+ 18, 21, 18, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 1, 23, 1, 24,
+ 24, 1, 24, 24, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 1, 25, 26,
+ 25, 27, 27, 27, 28, 29, 27, 27,
+ 27, 27, 27, 27, 1, 30, 31, 30,
+ 18, 29, 1, 32, 1, 33, 33, 1,
+ 33, 33, 18, 29, 1, 29, 34, 29,
+ 35, 36, 35, 35, 37, 35, 35, 35,
+ 35, 35, 35, 1, 38, 1, 39, 39,
+ 1, 39, 40, 39, 35, 36, 35, 35,
+ 37, 35, 35, 35, 35, 35, 35, 1,
+ 41, 1, 42, 42, 1, 42, 42, 36,
+ 1, 43, 44, 45, 1, 1, 1, 36,
+ 46, 1, 36, 36, 1, 47, 26, 47,
+ 28, 1, 48, 1, 36, 36, 36, 1,
+ 47, 26, 47, 35, 35, 35, 28, 35,
+ 35, 35, 35, 35, 35, 1, 50, 49,
+ 49, 49, 1, 52, 44, 51, 51, 51,
+ 1, 52, 44, 53, 53, 53, 1, 52,
+ 44, 54, 54, 54, 1, 52, 44, 1,
+ 56, 55, 49, 49, 1, 57, 52, 44,
+ 58, 51, 51, 1, 59, 1, 60, 61,
+ 1, 62, 1, 63, 64, 1, 65, 1,
+ 44, 66, 1, 44, 67, 1, 44, 1,
+ 63, 68, 1, 63, 1, 60, 69, 1,
+ 60, 1, 57, 52, 44, 70, 53, 53,
+ 1, 57, 52, 44, 54, 54, 54, 1,
+ 72, 44, 71, 71, 71, 1, 74, 44,
+ 73, 73, 73, 1, 74, 44, 75, 75,
+ 75, 1, 74, 44, 76, 76, 76, 1,
+ 74, 44, 1, 77, 71, 71, 1, 57,
+ 74, 44, 78, 73, 73, 1, 57, 74,
+ 44, 79, 75, 75, 1, 57, 74, 44,
+ 76, 76, 76, 1, 80, 1, 57, 81,
+ 1, 57, 82, 1, 57, 1, 56, 1,
+ 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Event_trans_targs[] = {
+ 2, 0, 6, 3, 4, 5, 7, 8,
+ 11, 9, 10, 12, 36, 11, 74, 16,
+ 12, 13, 16, 14, 15, 17, 20, 18,
+ 19, 21, 36, 20, 16, 25, 21, 22,
+ 23, 24, 26, 38, 32, 39, 27, 28,
+ 29, 30, 31, 33, 35, 37, 34, 12,
+ 75, 40, 73, 41, 44, 42, 43, 45,
+ 60, 46, 58, 47, 48, 56, 49, 50,
+ 54, 51, 52, 53, 55, 57, 59, 61,
+ 69, 62, 65, 63, 64, 66, 67, 68,
+ 70, 71, 72
+ };
+
+ static const char _tsip_machine_parser_header_Event_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 3, 3, 0, 0, 3,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 5, 5, 0, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Event_start = 1;
+ static const int tsip_machine_parser_header_Event_first_final = 75;
+ static const int tsip_machine_parser_header_Event_error = 0;
+
+ static const int tsip_machine_parser_header_Event_en_main = 1;
+
+
+ /* #line 107 "./ragel/tsip_parser_header_Event.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Event_first_final);
+ (void)(tsip_machine_parser_header_Event_error);
+ (void)(tsip_machine_parser_header_Event_en_main);
+
+ /* #line 286 "./src/headers/tsip_header_Event.c" */
+ {
+ cs = tsip_machine_parser_header_Event_start;
+ }
+
+ /* #line 112 "./ragel/tsip_parser_header_Event.rl" */
+
+ /* #line 293 "./src/headers/tsip_header_Event.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Event_trans_keys + _tsip_machine_parser_header_Event_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Event_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Event_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Event_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Event_trans_keys + _tsip_machine_parser_header_Event_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Event_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Event_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Event_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Event_indicies[_trans];
- cs = _tsip_machine_parser_header_Event_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Event_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Event_actions + _tsip_machine_parser_header_Event_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Event.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Event.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_event->package);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Event.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_event));
- }
- break;
- case 3:
-/* #line 62 "./ragel/tsip_parser_header_Event.rl" */
- {
- }
- break;
-/* #line 390 "./src/headers/tsip_header_Event.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Event_indicies[_trans];
+ cs = _tsip_machine_parser_header_Event_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Event_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Event_actions + _tsip_machine_parser_header_Event_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Event.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Event.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_event->package);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Event.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_event));
+ }
+ break;
+ case 3:
+ /* #line 62 "./ragel/tsip_parser_header_Event.rl" */
+ {
+ }
+ break;
+ /* #line 390 "./src/headers/tsip_header_Event.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 113 "./ragel/tsip_parser_header_Event.rl" */
-
- if( cs <
-/* #line 406 "./src/headers/tsip_header_Event.c" */
-75
-/* #line 114 "./ragel/tsip_parser_header_Event.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Event' header.");
- TSK_OBJECT_SAFE_FREE(hdr_event);
- }
-
- return hdr_event;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 113 "./ragel/tsip_parser_header_Event.rl" */
+
+ if( cs <
+ /* #line 406 "./src/headers/tsip_header_Event.c" */
+ 75
+ /* #line 114 "./ragel/tsip_parser_header_Event.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Event' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_event);
+ }
+
+ return hdr_event;
}
@@ -425,38 +436,37 @@ _again:
static tsk_object_t* tsip_header_Event_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Event_t *Event = self;
- if(Event){
- TSIP_HEADER(Event)->type = tsip_htype_Event;
- TSIP_HEADER(Event)->serialize = tsip_header_Event_serialize;
- Event->package = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Event header.");
- }
- return self;
+ tsip_header_Event_t *Event = self;
+ if(Event) {
+ TSIP_HEADER(Event)->type = tsip_htype_Event;
+ TSIP_HEADER(Event)->serialize = tsip_header_Event_serialize;
+ Event->package = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Event header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Event_dtor(tsk_object_t *self)
{
- tsip_header_Event_t *Event = self;
- if(Event){
- TSK_FREE(Event->package);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Event));
- }
- else{
- TSK_DEBUG_ERROR("Null Event header.");
- }
-
- return self;
+ tsip_header_Event_t *Event = self;
+ if(Event) {
+ TSK_FREE(Event->package);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Event));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Event header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Event_def_s =
-{
- sizeof(tsip_header_Event_t),
- tsip_header_Event_ctor,
- tsip_header_Event_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Event_def_s = {
+ sizeof(tsip_header_Event_t),
+ tsip_header_Event_ctor,
+ tsip_header_Event_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Event_def_t = &tsip_header_Event_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Expires.c b/tinySIP/src/headers/tsip_header_Expires.c
index 8516b74..90a55f0 100755
--- a/tinySIP/src/headers/tsip_header_Expires.c
+++ b/tinySIP/src/headers/tsip_header_Expires.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,221 +47,232 @@
tsip_header_Expires_t* tsip_header_Expires_create(int64_t delta_seconds)
{
- return tsk_object_new(TSIP_HEADER_EXPIRES_VA_ARGS(delta_seconds));
+ return tsk_object_new(TSIP_HEADER_EXPIRES_VA_ARGS(delta_seconds));
}
int tsip_header_Expires_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Expires_t *Expires = (const tsip_header_Expires_t *)header;
- if(Expires->delta_seconds >=0){
- return tsk_buffer_append_2(output, "%lld", Expires->delta_seconds);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Expires_t *Expires = (const tsip_header_Expires_t *)header;
+ if(Expires->delta_seconds >=0) {
+ return tsk_buffer_append_2(output, "%lld", Expires->delta_seconds);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Expires_t *tsip_header_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Expires_t *hdr_expires = tsip_header_Expires_create(TSIP_HEADER_EXPIRES_NONE);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 78 "./src/headers/tsip_header_Expires.c" */
-static const char _tsip_machine_parser_header_Expires_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Expires_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 17, 22, 23, 25, 29, 32, 33
-};
-
-static const char _tsip_machine_parser_header_Expires_trans_keys[] = {
- 69, 101, 88, 120, 80, 112, 73, 105,
- 82, 114, 69, 101, 83, 115, 9, 32,
- 58, 9, 13, 32, 48, 57, 10, 9,
- 32, 9, 32, 48, 57, 13, 48, 57,
- 10, 0
-};
-
-static const char _tsip_machine_parser_header_Expires_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 1, 2, 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 1, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Expires_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 25, 30, 32, 35, 39, 42, 44
-};
-
-static const char _tsip_machine_parser_header_Expires_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 7, 7, 8,
- 1, 8, 9, 8, 10, 1, 11, 1,
- 12, 12, 1, 12, 12, 10, 1, 13,
- 14, 1, 15, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Expires_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 13, 11, 12, 14, 13, 15
-};
-
-static const char _tsip_machine_parser_header_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_Expires_start = 1;
-static const int tsip_machine_parser_header_Expires_first_final = 15;
-static const int tsip_machine_parser_header_Expires_error = 0;
-
-static const int tsip_machine_parser_header_Expires_en_main = 1;
-
-
-/* #line 95 "./ragel/tsip_parser_header_Expires.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Expires_first_final);
- (void)(tsip_machine_parser_header_Expires_error);
- (void)(tsip_machine_parser_header_Expires_en_main);
-
-/* #line 143 "./src/headers/tsip_header_Expires.c" */
- {
- cs = tsip_machine_parser_header_Expires_start;
- }
-
-/* #line 100 "./ragel/tsip_parser_header_Expires.rl" */
-
-/* #line 150 "./src/headers/tsip_header_Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Expires_t *hdr_expires = tsip_header_Expires_create(TSIP_HEADER_EXPIRES_NONE);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 78 "./src/headers/tsip_header_Expires.c" */
+ static const char _tsip_machine_parser_header_Expires_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Expires_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 17, 22, 23, 25, 29, 32, 33
+ };
+
+ static const char _tsip_machine_parser_header_Expires_trans_keys[] = {
+ 69, 101, 88, 120, 80, 112, 73, 105,
+ 82, 114, 69, 101, 83, 115, 9, 32,
+ 58, 9, 13, 32, 48, 57, 10, 9,
+ 32, 9, 32, 48, 57, 13, 48, 57,
+ 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_Expires_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 1, 2, 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 1, 1, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Expires_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 25, 30, 32, 35, 39, 42, 44
+ };
+
+ static const char _tsip_machine_parser_header_Expires_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 7, 7, 8,
+ 1, 8, 9, 8, 10, 1, 11, 1,
+ 12, 12, 1, 12, 12, 10, 1, 13,
+ 14, 1, 15, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Expires_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 13, 11, 12, 14, 13, 15
+ };
+
+ static const char _tsip_machine_parser_header_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Expires_start = 1;
+ static const int tsip_machine_parser_header_Expires_first_final = 15;
+ static const int tsip_machine_parser_header_Expires_error = 0;
+
+ static const int tsip_machine_parser_header_Expires_en_main = 1;
+
+
+ /* #line 95 "./ragel/tsip_parser_header_Expires.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Expires_first_final);
+ (void)(tsip_machine_parser_header_Expires_error);
+ (void)(tsip_machine_parser_header_Expires_en_main);
+
+ /* #line 143 "./src/headers/tsip_header_Expires.c" */
+ {
+ cs = tsip_machine_parser_header_Expires_start;
+ }
+
+ /* #line 100 "./ragel/tsip_parser_header_Expires.rl" */
+
+ /* #line 150 "./src/headers/tsip_header_Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Expires_trans_keys + _tsip_machine_parser_header_Expires_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Expires_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Expires_trans_keys + _tsip_machine_parser_header_Expires_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Expires_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Expires_indicies[_trans];
- cs = _tsip_machine_parser_header_Expires_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Expires_actions + _tsip_machine_parser_header_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_expires->delta_seconds);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Expires.rl" */
- {
- }
- break;
-/* #line 241 "./src/headers/tsip_header_Expires.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Expires_indicies[_trans];
+ cs = _tsip_machine_parser_header_Expires_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Expires_actions + _tsip_machine_parser_header_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_expires->delta_seconds);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Expires.rl" */
+ {
+ }
+ break;
+ /* #line 241 "./src/headers/tsip_header_Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 101 "./ragel/tsip_parser_header_Expires.rl" */
-
- if( cs <
-/* #line 257 "./src/headers/tsip_header_Expires.c" */
-15
-/* #line 102 "./ragel/tsip_parser_header_Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_expires);
- }
-
- return hdr_expires;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 101 "./ragel/tsip_parser_header_Expires.rl" */
+
+ if( cs <
+ /* #line 257 "./src/headers/tsip_header_Expires.c" */
+ 15
+ /* #line 102 "./ragel/tsip_parser_header_Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_expires);
+ }
+
+ return hdr_expires;
}
@@ -276,37 +287,36 @@ _again:
static tsk_object_t* tsip_header_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Expires_t *Expires = self;
- if(Expires){
- TSIP_HEADER(Expires)->type = tsip_htype_Expires;
- TSIP_HEADER(Expires)->serialize = tsip_header_Expires_serialize;
- Expires->delta_seconds = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Expires header.");
- }
- return self;
+ tsip_header_Expires_t *Expires = self;
+ if(Expires) {
+ TSIP_HEADER(Expires)->type = tsip_htype_Expires;
+ TSIP_HEADER(Expires)->serialize = tsip_header_Expires_serialize;
+ Expires->delta_seconds = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Expires header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Expires_dtor(tsk_object_t *self)
{
- tsip_header_Expires_t *Expires = self;
- if(Expires){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Expires));
- }
- else{
- TSK_DEBUG_ERROR("Null Expires header.");
- }
-
- return self;
+ tsip_header_Expires_t *Expires = self;
+ if(Expires) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Expires));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Expires_def_s =
-{
- sizeof(tsip_header_Expires_t),
- tsip_header_Expires_ctor,
- tsip_header_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Expires_def_s = {
+ sizeof(tsip_header_Expires_t),
+ tsip_header_Expires_ctor,
+ tsip_header_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Expires_def_t = &tsip_header_Expires_def_s;
diff --git a/tinySIP/src/headers/tsip_header_From.c b/tinySIP/src/headers/tsip_header_From.c
index 1877356..b83014e 100755
--- a/tinySIP/src/headers/tsip_header_From.c
+++ b/tinySIP/src/headers/tsip_header_From.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,478 +48,489 @@
tsip_header_From_t* tsip_header_From_create(const char* display_name, const tsip_uri_t* uri, const char* tag)
{
- return tsk_object_new(TSIP_HEADER_FROM_VA_ARGS(display_name, uri, tag));
+ return tsk_object_new(TSIP_HEADER_FROM_VA_ARGS(display_name, uri, tag));
}
int tsip_header_From_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- int ret = -1;
- if(header){
- const tsip_header_From_t *From = (const tsip_header_From_t *)header;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(From->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- if(From->tag){
- ret = tsk_buffer_append_2(output, ";tag=%s", From->tag);
- }
- }
- return ret;
+ int ret = -1;
+ if(header) {
+ const tsip_header_From_t *From = (const tsip_header_From_t *)header;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(From->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ if(From->tag) {
+ ret = tsk_buffer_append_2(output, ";tag=%s", From->tag);
+ }
+ }
+ return ret;
}
tsip_header_From_t *tsip_header_From_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_From_t *hdr_from = tsip_header_From_create(tsk_null, tsk_null, tsk_null);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 83 "./src/headers/tsip_header_From.c" */
-static const char _tsip_machine_parser_header_From_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5
-};
-
-static const short _tsip_machine_parser_header_From_key_offsets[] = {
- 0, 0, 2, 7, 10, 31, 32, 34,
- 55, 56, 58, 61, 65, 77, 80, 80,
- 81, 85, 89, 90, 92, 95, 114, 115,
- 117, 135, 154, 159, 160, 162, 166, 185,
- 186, 188, 207, 208, 210, 213, 221, 222,
- 224, 228, 229, 235, 253, 260, 268, 276,
- 284, 286, 293, 302, 304, 307, 309, 312,
- 314, 317, 320, 321, 324, 325, 328, 329,
- 338, 347, 355, 363, 371, 379, 381, 387,
- 396, 405, 414, 416, 419, 422, 423, 424,
- 445, 466, 485, 490, 491, 493, 497, 516,
- 517, 519, 538, 556, 573, 591, 595, 596,
- 598, 606, 607, 609, 613, 619, 639, 658,
- 663, 663, 667, 669, 671
-};
-
-static const char _tsip_machine_parser_header_From_trans_keys[] = {
- 70, 102, 9, 32, 58, 82, 114, 9,
- 32, 58, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 32, 60, 65, 90, 97,
- 122, 9, 32, 43, 58, 45, 46, 48,
- 57, 65, 90, 97, 122, 9, 32, 58,
- 62, 9, 13, 32, 59, 9, 13, 32,
- 59, 10, 9, 32, 9, 32, 59, 9,
- 13, 32, 33, 37, 39, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 33,
- 37, 39, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 61, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 59, 61, 10,
- 9, 32, 9, 32, 59, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 34, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 59, 10, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 58, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 58, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 48, 57, 46, 48, 57,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 46, 48, 57, 46, 46, 48, 57,
- 46, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 46, 48, 57, 46, 58,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 60, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 60, 10, 9, 32, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 9,
- 32, 9, 13, 32, 60, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 42, 43, 58, 126, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 37, 39, 58, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 58, 60, 9,
- 13, 32, 59, 79, 111, 77, 109, 0
-};
-
-static const char _tsip_machine_parser_header_From_single_lengths[] = {
- 0, 2, 5, 3, 9, 1, 2, 9,
- 1, 2, 3, 0, 4, 3, 0, 1,
- 4, 4, 1, 2, 3, 9, 1, 2,
- 8, 9, 5, 1, 2, 4, 9, 1,
- 2, 9, 1, 2, 3, 4, 1, 2,
- 4, 1, 0, 8, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 3,
- 3, 2, 2, 2, 2, 2, 0, 3,
- 3, 3, 0, 1, 1, 1, 1, 11,
- 11, 9, 5, 1, 2, 4, 9, 1,
- 2, 9, 8, 7, 8, 4, 1, 2,
- 4, 1, 2, 4, 0, 10, 9, 5,
- 0, 4, 2, 2, 0
-};
-
-static const char _tsip_machine_parser_header_From_range_lengths[] = {
- 0, 0, 0, 0, 6, 0, 0, 6,
- 0, 0, 0, 2, 4, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 0, 0,
- 5, 5, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 0, 0,
- 0, 0, 3, 5, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 5,
- 5, 5, 0, 0, 0, 0, 5, 0,
- 0, 5, 5, 5, 5, 0, 0, 0,
- 2, 0, 0, 0, 3, 5, 5, 0,
- 0, 0, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_From_index_offsets[] = {
- 0, 0, 3, 9, 13, 29, 31, 34,
- 50, 52, 55, 59, 62, 71, 75, 76,
- 78, 83, 88, 90, 93, 97, 112, 114,
- 117, 131, 146, 152, 154, 157, 162, 177,
- 179, 182, 197, 199, 202, 206, 213, 215,
- 218, 223, 225, 229, 243, 248, 254, 260,
- 266, 269, 274, 281, 283, 286, 288, 291,
- 293, 296, 299, 301, 304, 306, 309, 311,
- 318, 325, 331, 337, 343, 349, 352, 356,
- 363, 370, 377, 379, 382, 385, 387, 389,
- 406, 423, 438, 444, 446, 449, 454, 469,
- 471, 474, 489, 503, 516, 530, 535, 537,
- 540, 547, 549, 552, 557, 561, 577, 592,
- 598, 599, 604, 607, 610
-};
-
-static const unsigned char _tsip_machine_parser_header_From_indicies[] = {
- 0, 0, 1, 2, 2, 3, 4, 4,
- 1, 2, 2, 3, 1, 3, 5, 3,
- 6, 7, 6, 6, 8, 6, 6, 6,
- 6, 9, 6, 9, 1, 10, 1, 11,
- 11, 1, 11, 12, 11, 6, 7, 6,
- 6, 8, 6, 6, 6, 6, 9, 6,
- 9, 1, 13, 1, 14, 14, 1, 14,
- 14, 8, 1, 15, 15, 1, 16, 16,
- 17, 18, 17, 17, 17, 17, 1, 16,
- 16, 18, 1, 19, 20, 19, 21, 22,
- 21, 23, 1, 21, 24, 21, 23, 1,
- 25, 1, 26, 26, 1, 26, 26, 23,
- 1, 23, 27, 23, 28, 28, 28, 29,
- 29, 28, 28, 28, 28, 28, 28, 1,
- 30, 1, 31, 31, 1, 31, 31, 28,
- 28, 28, 29, 29, 28, 28, 28, 28,
- 28, 28, 1, 32, 33, 32, 34, 34,
- 34, 35, 36, 34, 34, 34, 34, 34,
- 34, 1, 37, 38, 37, 23, 36, 1,
- 39, 1, 40, 40, 1, 40, 40, 23,
- 36, 1, 36, 41, 36, 42, 43, 42,
- 42, 44, 42, 42, 42, 42, 42, 42,
- 1, 45, 1, 46, 46, 1, 46, 47,
- 46, 42, 43, 42, 42, 44, 42, 42,
- 42, 42, 42, 42, 1, 48, 1, 49,
- 49, 1, 49, 49, 43, 1, 50, 51,
- 52, 1, 1, 1, 43, 53, 1, 43,
- 43, 1, 54, 33, 54, 35, 1, 55,
- 1, 43, 43, 43, 1, 54, 33, 54,
- 42, 42, 42, 35, 42, 42, 42, 42,
- 42, 42, 1, 57, 56, 56, 56, 1,
- 59, 51, 58, 58, 58, 1, 59, 51,
- 60, 60, 60, 1, 59, 51, 61, 61,
- 61, 1, 59, 51, 1, 63, 62, 56,
- 56, 1, 64, 59, 51, 65, 58, 58,
- 1, 66, 1, 67, 68, 1, 69, 1,
- 70, 71, 1, 72, 1, 51, 73, 1,
- 51, 74, 1, 51, 1, 70, 75, 1,
- 70, 1, 67, 76, 1, 67, 1, 64,
- 59, 51, 77, 60, 60, 1, 64, 59,
- 51, 61, 61, 61, 1, 79, 51, 78,
- 78, 78, 1, 81, 51, 80, 80, 80,
- 1, 81, 51, 82, 82, 82, 1, 81,
- 51, 83, 83, 83, 1, 81, 51, 1,
- 84, 78, 78, 1, 64, 81, 51, 85,
- 80, 80, 1, 64, 81, 51, 86, 82,
- 82, 1, 64, 81, 51, 83, 83, 83,
- 1, 87, 1, 64, 88, 1, 64, 89,
- 1, 64, 1, 63, 1, 32, 33, 32,
- 34, 34, 34, 35, 36, 90, 90, 34,
- 34, 34, 34, 34, 34, 1, 32, 33,
- 32, 34, 34, 34, 35, 36, 91, 91,
- 34, 34, 34, 34, 34, 34, 1, 92,
- 33, 92, 34, 34, 34, 35, 93, 34,
- 34, 34, 34, 34, 34, 1, 94, 95,
- 94, 23, 93, 1, 96, 1, 97, 97,
- 1, 97, 97, 23, 93, 1, 93, 98,
- 93, 99, 43, 99, 99, 44, 99, 99,
- 99, 99, 99, 99, 1, 100, 1, 101,
- 101, 1, 101, 47, 101, 99, 43, 99,
- 99, 44, 99, 99, 99, 99, 99, 99,
- 1, 102, 103, 102, 104, 104, 104, 105,
- 104, 104, 104, 104, 104, 104, 1, 106,
- 107, 106, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 1, 109, 110, 109, 108,
- 108, 108, 111, 108, 108, 108, 108, 108,
- 108, 1, 112, 12, 112, 8, 1, 113,
- 1, 106, 106, 1, 115, 116, 117, 1,
- 1, 1, 114, 118, 1, 114, 114, 1,
- 109, 110, 109, 111, 1, 114, 114, 114,
- 1, 119, 107, 119, 108, 108, 108, 108,
- 120, 121, 108, 120, 120, 120, 108, 120,
- 1, 122, 110, 122, 108, 108, 108, 121,
- 111, 108, 108, 108, 108, 108, 108, 1,
- 123, 12, 123, 121, 8, 1, 124, 125,
- 126, 125, 127, 124, 128, 128, 1, 2,
- 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_From_trans_targs[] = {
- 2, 0, 3, 4, 106, 5, 91, 96,
- 11, 101, 6, 7, 8, 9, 10, 12,
- 13, 12, 14, 15, 16, 17, 41, 21,
- 18, 19, 20, 22, 25, 79, 23, 24,
- 26, 41, 25, 21, 30, 26, 27, 28,
- 29, 31, 43, 37, 44, 32, 33, 34,
- 35, 36, 38, 40, 42, 39, 17, 108,
- 45, 78, 46, 49, 47, 48, 50, 65,
- 51, 63, 52, 53, 61, 54, 55, 59,
- 56, 57, 58, 60, 62, 64, 66, 74,
- 67, 70, 68, 69, 71, 72, 73, 75,
- 76, 77, 80, 81, 82, 86, 82, 83,
- 84, 85, 87, 90, 88, 89, 17, 41,
- 90, 21, 92, 94, 91, 93, 8, 11,
- 93, 95, 96, 97, 99, 100, 98, 102,
- 101, 104, 103, 103, 105, 17, 41, 21,
- 107
-};
-
-static const char _tsip_machine_parser_header_From_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 1, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 3, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 0, 0,
- 9, 9, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 9, 11,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 9, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 7, 7,
- 0, 7, 0, 0, 0, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 3, 3, 3,
- 0
-};
-
-static const int tsip_machine_parser_header_From_start = 1;
-static const int tsip_machine_parser_header_From_first_final = 108;
-static const int tsip_machine_parser_header_From_error = 0;
-
-static const int tsip_machine_parser_header_From_en_main = 1;
-
-
-/* #line 125 "./ragel/tsip_parser_header_From.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_From_first_final);
- (void)(tsip_machine_parser_header_From_error);
- (void)(tsip_machine_parser_header_From_en_main);
-
-/* #line 377 "./src/headers/tsip_header_From.c" */
- {
- cs = tsip_machine_parser_header_From_start;
- }
-
-/* #line 130 "./ragel/tsip_parser_header_From.rl" */
-
-/* #line 384 "./src/headers/tsip_header_From.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_From_t *hdr_from = tsip_header_From_create(tsk_null, tsk_null, tsk_null);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 83 "./src/headers/tsip_header_From.c" */
+ static const char _tsip_machine_parser_header_From_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5
+ };
+
+ static const short _tsip_machine_parser_header_From_key_offsets[] = {
+ 0, 0, 2, 7, 10, 31, 32, 34,
+ 55, 56, 58, 61, 65, 77, 80, 80,
+ 81, 85, 89, 90, 92, 95, 114, 115,
+ 117, 135, 154, 159, 160, 162, 166, 185,
+ 186, 188, 207, 208, 210, 213, 221, 222,
+ 224, 228, 229, 235, 253, 260, 268, 276,
+ 284, 286, 293, 302, 304, 307, 309, 312,
+ 314, 317, 320, 321, 324, 325, 328, 329,
+ 338, 347, 355, 363, 371, 379, 381, 387,
+ 396, 405, 414, 416, 419, 422, 423, 424,
+ 445, 466, 485, 490, 491, 493, 497, 516,
+ 517, 519, 538, 556, 573, 591, 595, 596,
+ 598, 606, 607, 609, 613, 619, 639, 658,
+ 663, 663, 667, 669, 671
+ };
+
+ static const char _tsip_machine_parser_header_From_trans_keys[] = {
+ 70, 102, 9, 32, 58, 82, 114, 9,
+ 32, 58, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 32, 60, 65, 90, 97,
+ 122, 9, 32, 43, 58, 45, 46, 48,
+ 57, 65, 90, 97, 122, 9, 32, 58,
+ 62, 9, 13, 32, 59, 9, 13, 32,
+ 59, 10, 9, 32, 9, 32, 59, 9,
+ 13, 32, 33, 37, 39, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 33,
+ 37, 39, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 61, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 59, 61, 10,
+ 9, 32, 9, 32, 59, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 34, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 59, 10, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 58, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 48, 57, 46, 48, 57,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 46, 48, 57, 46, 46, 48, 57,
+ 46, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 46, 48, 57, 46, 58,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 60, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 60, 10, 9, 32, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 9,
+ 32, 9, 13, 32, 60, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 42, 43, 58, 126, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 37, 39, 58, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 58, 60, 9,
+ 13, 32, 59, 79, 111, 77, 109, 0
+ };
+
+ static const char _tsip_machine_parser_header_From_single_lengths[] = {
+ 0, 2, 5, 3, 9, 1, 2, 9,
+ 1, 2, 3, 0, 4, 3, 0, 1,
+ 4, 4, 1, 2, 3, 9, 1, 2,
+ 8, 9, 5, 1, 2, 4, 9, 1,
+ 2, 9, 1, 2, 3, 4, 1, 2,
+ 4, 1, 0, 8, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 3,
+ 3, 2, 2, 2, 2, 2, 0, 3,
+ 3, 3, 0, 1, 1, 1, 1, 11,
+ 11, 9, 5, 1, 2, 4, 9, 1,
+ 2, 9, 8, 7, 8, 4, 1, 2,
+ 4, 1, 2, 4, 0, 10, 9, 5,
+ 0, 4, 2, 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_From_range_lengths[] = {
+ 0, 0, 0, 0, 6, 0, 0, 6,
+ 0, 0, 0, 2, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 0, 0,
+ 5, 5, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 0, 0,
+ 0, 0, 3, 5, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 5,
+ 5, 5, 0, 0, 0, 0, 5, 0,
+ 0, 5, 5, 5, 5, 0, 0, 0,
+ 2, 0, 0, 0, 3, 5, 5, 0,
+ 0, 0, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_From_index_offsets[] = {
+ 0, 0, 3, 9, 13, 29, 31, 34,
+ 50, 52, 55, 59, 62, 71, 75, 76,
+ 78, 83, 88, 90, 93, 97, 112, 114,
+ 117, 131, 146, 152, 154, 157, 162, 177,
+ 179, 182, 197, 199, 202, 206, 213, 215,
+ 218, 223, 225, 229, 243, 248, 254, 260,
+ 266, 269, 274, 281, 283, 286, 288, 291,
+ 293, 296, 299, 301, 304, 306, 309, 311,
+ 318, 325, 331, 337, 343, 349, 352, 356,
+ 363, 370, 377, 379, 382, 385, 387, 389,
+ 406, 423, 438, 444, 446, 449, 454, 469,
+ 471, 474, 489, 503, 516, 530, 535, 537,
+ 540, 547, 549, 552, 557, 561, 577, 592,
+ 598, 599, 604, 607, 610
+ };
+
+ static const unsigned char _tsip_machine_parser_header_From_indicies[] = {
+ 0, 0, 1, 2, 2, 3, 4, 4,
+ 1, 2, 2, 3, 1, 3, 5, 3,
+ 6, 7, 6, 6, 8, 6, 6, 6,
+ 6, 9, 6, 9, 1, 10, 1, 11,
+ 11, 1, 11, 12, 11, 6, 7, 6,
+ 6, 8, 6, 6, 6, 6, 9, 6,
+ 9, 1, 13, 1, 14, 14, 1, 14,
+ 14, 8, 1, 15, 15, 1, 16, 16,
+ 17, 18, 17, 17, 17, 17, 1, 16,
+ 16, 18, 1, 19, 20, 19, 21, 22,
+ 21, 23, 1, 21, 24, 21, 23, 1,
+ 25, 1, 26, 26, 1, 26, 26, 23,
+ 1, 23, 27, 23, 28, 28, 28, 29,
+ 29, 28, 28, 28, 28, 28, 28, 1,
+ 30, 1, 31, 31, 1, 31, 31, 28,
+ 28, 28, 29, 29, 28, 28, 28, 28,
+ 28, 28, 1, 32, 33, 32, 34, 34,
+ 34, 35, 36, 34, 34, 34, 34, 34,
+ 34, 1, 37, 38, 37, 23, 36, 1,
+ 39, 1, 40, 40, 1, 40, 40, 23,
+ 36, 1, 36, 41, 36, 42, 43, 42,
+ 42, 44, 42, 42, 42, 42, 42, 42,
+ 1, 45, 1, 46, 46, 1, 46, 47,
+ 46, 42, 43, 42, 42, 44, 42, 42,
+ 42, 42, 42, 42, 1, 48, 1, 49,
+ 49, 1, 49, 49, 43, 1, 50, 51,
+ 52, 1, 1, 1, 43, 53, 1, 43,
+ 43, 1, 54, 33, 54, 35, 1, 55,
+ 1, 43, 43, 43, 1, 54, 33, 54,
+ 42, 42, 42, 35, 42, 42, 42, 42,
+ 42, 42, 1, 57, 56, 56, 56, 1,
+ 59, 51, 58, 58, 58, 1, 59, 51,
+ 60, 60, 60, 1, 59, 51, 61, 61,
+ 61, 1, 59, 51, 1, 63, 62, 56,
+ 56, 1, 64, 59, 51, 65, 58, 58,
+ 1, 66, 1, 67, 68, 1, 69, 1,
+ 70, 71, 1, 72, 1, 51, 73, 1,
+ 51, 74, 1, 51, 1, 70, 75, 1,
+ 70, 1, 67, 76, 1, 67, 1, 64,
+ 59, 51, 77, 60, 60, 1, 64, 59,
+ 51, 61, 61, 61, 1, 79, 51, 78,
+ 78, 78, 1, 81, 51, 80, 80, 80,
+ 1, 81, 51, 82, 82, 82, 1, 81,
+ 51, 83, 83, 83, 1, 81, 51, 1,
+ 84, 78, 78, 1, 64, 81, 51, 85,
+ 80, 80, 1, 64, 81, 51, 86, 82,
+ 82, 1, 64, 81, 51, 83, 83, 83,
+ 1, 87, 1, 64, 88, 1, 64, 89,
+ 1, 64, 1, 63, 1, 32, 33, 32,
+ 34, 34, 34, 35, 36, 90, 90, 34,
+ 34, 34, 34, 34, 34, 1, 32, 33,
+ 32, 34, 34, 34, 35, 36, 91, 91,
+ 34, 34, 34, 34, 34, 34, 1, 92,
+ 33, 92, 34, 34, 34, 35, 93, 34,
+ 34, 34, 34, 34, 34, 1, 94, 95,
+ 94, 23, 93, 1, 96, 1, 97, 97,
+ 1, 97, 97, 23, 93, 1, 93, 98,
+ 93, 99, 43, 99, 99, 44, 99, 99,
+ 99, 99, 99, 99, 1, 100, 1, 101,
+ 101, 1, 101, 47, 101, 99, 43, 99,
+ 99, 44, 99, 99, 99, 99, 99, 99,
+ 1, 102, 103, 102, 104, 104, 104, 105,
+ 104, 104, 104, 104, 104, 104, 1, 106,
+ 107, 106, 108, 108, 108, 108, 108, 108,
+ 108, 108, 108, 1, 109, 110, 109, 108,
+ 108, 108, 111, 108, 108, 108, 108, 108,
+ 108, 1, 112, 12, 112, 8, 1, 113,
+ 1, 106, 106, 1, 115, 116, 117, 1,
+ 1, 1, 114, 118, 1, 114, 114, 1,
+ 109, 110, 109, 111, 1, 114, 114, 114,
+ 1, 119, 107, 119, 108, 108, 108, 108,
+ 120, 121, 108, 120, 120, 120, 108, 120,
+ 1, 122, 110, 122, 108, 108, 108, 121,
+ 111, 108, 108, 108, 108, 108, 108, 1,
+ 123, 12, 123, 121, 8, 1, 124, 125,
+ 126, 125, 127, 124, 128, 128, 1, 2,
+ 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_From_trans_targs[] = {
+ 2, 0, 3, 4, 106, 5, 91, 96,
+ 11, 101, 6, 7, 8, 9, 10, 12,
+ 13, 12, 14, 15, 16, 17, 41, 21,
+ 18, 19, 20, 22, 25, 79, 23, 24,
+ 26, 41, 25, 21, 30, 26, 27, 28,
+ 29, 31, 43, 37, 44, 32, 33, 34,
+ 35, 36, 38, 40, 42, 39, 17, 108,
+ 45, 78, 46, 49, 47, 48, 50, 65,
+ 51, 63, 52, 53, 61, 54, 55, 59,
+ 56, 57, 58, 60, 62, 64, 66, 74,
+ 67, 70, 68, 69, 71, 72, 73, 75,
+ 76, 77, 80, 81, 82, 86, 82, 83,
+ 84, 85, 87, 90, 88, 89, 17, 41,
+ 90, 21, 92, 94, 91, 93, 8, 11,
+ 93, 95, 96, 97, 99, 100, 98, 102,
+ 101, 104, 103, 103, 105, 17, 41, 21,
+ 107
+ };
+
+ static const char _tsip_machine_parser_header_From_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 0, 1, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0,
+ 9, 9, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 11,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 7, 7,
+ 0, 7, 0, 0, 0, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 3, 3, 3,
+ 0
+ };
+
+ static const int tsip_machine_parser_header_From_start = 1;
+ static const int tsip_machine_parser_header_From_first_final = 108;
+ static const int tsip_machine_parser_header_From_error = 0;
+
+ static const int tsip_machine_parser_header_From_en_main = 1;
+
+
+ /* #line 125 "./ragel/tsip_parser_header_From.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_From_first_final);
+ (void)(tsip_machine_parser_header_From_error);
+ (void)(tsip_machine_parser_header_From_en_main);
+
+ /* #line 377 "./src/headers/tsip_header_From.c" */
+ {
+ cs = tsip_machine_parser_header_From_start;
+ }
+
+ /* #line 130 "./ragel/tsip_parser_header_From.rl" */
+
+ /* #line 384 "./src/headers/tsip_header_From.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_From_trans_keys + _tsip_machine_parser_header_From_key_offsets[cs];
- _trans = _tsip_machine_parser_header_From_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_From_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_From_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_From_trans_keys + _tsip_machine_parser_header_From_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_From_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_From_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_From_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_From_indicies[_trans];
- cs = _tsip_machine_parser_header_From_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_From_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_From_actions + _tsip_machine_parser_header_From_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_From.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_From.rl" */
- {
- int len = (int)(p - tag_start);
- if(hdr_from && !hdr_from->uri){
- if((hdr_from->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_from->display_name){
- hdr_from->uri->display_name = tsk_strdup(hdr_from->display_name);
- }
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_From.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_from->display_name);
- tsk_strunquote(&hdr_from->display_name);
- }
- break;
- case 3:
-/* #line 66 "./ragel/tsip_parser_header_From.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_from->tag);
- }
- break;
- case 4:
-/* #line 70 "./ragel/tsip_parser_header_From.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_from));
- }
- break;
- case 5:
-/* #line 74 "./ragel/tsip_parser_header_From.rl" */
- {
- }
- break;
-/* #line 499 "./src/headers/tsip_header_From.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_From_indicies[_trans];
+ cs = _tsip_machine_parser_header_From_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_From_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_From_actions + _tsip_machine_parser_header_From_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_From.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_From.rl" */
+ {
+ int len = (int)(p - tag_start);
+ if(hdr_from && !hdr_from->uri) {
+ if((hdr_from->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_from->display_name) {
+ hdr_from->uri->display_name = tsk_strdup(hdr_from->display_name);
+ }
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_From.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_from->display_name);
+ tsk_strunquote(&hdr_from->display_name);
+ }
+ break;
+ case 3:
+ /* #line 66 "./ragel/tsip_parser_header_From.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_from->tag);
+ }
+ break;
+ case 4:
+ /* #line 70 "./ragel/tsip_parser_header_From.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_from));
+ }
+ break;
+ case 5:
+ /* #line 74 "./ragel/tsip_parser_header_From.rl" */
+ {
+ }
+ break;
+ /* #line 499 "./src/headers/tsip_header_From.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 131 "./ragel/tsip_parser_header_From.rl" */
-
- if( cs <
-/* #line 515 "./src/headers/tsip_header_From.c" */
-108
-/* #line 132 "./ragel/tsip_parser_header_From.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'From' header.");
- TSK_OBJECT_SAFE_FREE(hdr_from);
- }
-
- return hdr_from;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 131 "./ragel/tsip_parser_header_From.rl" */
+
+ if( cs <
+ /* #line 515 "./src/headers/tsip_header_From.c" */
+ 108
+ /* #line 132 "./ragel/tsip_parser_header_From.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'From' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_from);
+ }
+
+ return hdr_from;
}
@@ -534,48 +545,49 @@ _again:
static tsk_object_t* tsip_header_From_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_From_t *From = self;
- if(From){
- const char* display_name = va_arg(*app, const char *);
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
- const char* tag = va_arg(*app, const char *);
-
- From->display_name = tsk_strdup(display_name);
- if(uri) From->uri = tsk_object_ref((void *)uri);
- From->tag = tsk_strdup(tag);
-
- TSIP_HEADER(From)->type = tsip_htype_From;
- TSIP_HEADER(From)->serialize = tsip_header_From_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new From header.");
- }
- return self;
+ tsip_header_From_t *From = self;
+ if(From) {
+ const char* display_name = va_arg(*app, const char *);
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
+ const char* tag = va_arg(*app, const char *);
+
+ From->display_name = tsk_strdup(display_name);
+ if(uri) {
+ From->uri = tsk_object_ref((void *)uri);
+ }
+ From->tag = tsk_strdup(tag);
+
+ TSIP_HEADER(From)->type = tsip_htype_From;
+ TSIP_HEADER(From)->serialize = tsip_header_From_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new From header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_From_dtor(tsk_object_t *self)
{
- tsip_header_From_t *From = self;
- if(From){
- TSK_FREE(From->display_name);
- TSK_FREE(From->tag);
-
- TSK_OBJECT_SAFE_FREE(From->uri);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(From));
- }
- else{
- TSK_DEBUG_ERROR("Null From header.");
- }
-
- return self;
+ tsip_header_From_t *From = self;
+ if(From) {
+ TSK_FREE(From->display_name);
+ TSK_FREE(From->tag);
+
+ TSK_OBJECT_SAFE_FREE(From->uri);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(From));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null From header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_From_def_s =
-{
- sizeof(tsip_header_From_t),
- tsip_header_From_ctor,
- tsip_header_From_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_From_def_s = {
+ sizeof(tsip_header_From_t),
+ tsip_header_From_ctor,
+ tsip_header_From_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_From_def_t = &tsip_header_From_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Max_Forwards.c b/tinySIP/src/headers/tsip_header_Max_Forwards.c
index c4e47f0..8f26d6e 100755
--- a/tinySIP/src/headers/tsip_header_Max_Forwards.c
+++ b/tinySIP/src/headers/tsip_header_Max_Forwards.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,230 +48,241 @@
tsip_header_Max_Forwards_t* tsip_header_Max_Forwards_create(int32_t max)
{
- return tsk_object_new(TSIP_HEADER_MAX_FORWARDS_VA_ARGS(max));
+ return tsk_object_new(TSIP_HEADER_MAX_FORWARDS_VA_ARGS(max));
}
int tsip_header_Max_Forwards_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Max_Forwards_t *Max_Forwards = (const tsip_header_Max_Forwards_t *)header;
- if(Max_Forwards->value >= 0){
- return tsk_buffer_append_2(output, "%d", Max_Forwards->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Max_Forwards_t *Max_Forwards = (const tsip_header_Max_Forwards_t *)header;
+ if(Max_Forwards->value >= 0) {
+ return tsk_buffer_append_2(output, "%d", Max_Forwards->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Max_Forwards_t *tsip_header_Max_Forwards_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Max_Forwards_t *hdr_maxf = tsip_header_Max_Forwards_create(TSIP_HEADER_MAX_FORWARDS_NONE);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 79 "./src/headers/tsip_header_Max_Forwards.c" */
-static const char _tsip_machine_parser_header_Max_Forwards_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 26, 31,
- 32, 34, 38, 41, 42
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_trans_keys[] = {
- 77, 109, 65, 97, 88, 120, 45, 70,
- 102, 79, 111, 82, 114, 87, 119, 65,
- 97, 82, 114, 68, 100, 83, 115, 9,
- 32, 58, 9, 13, 32, 48, 57, 10,
- 9, 32, 9, 32, 48, 57, 13, 48,
- 57, 10, 0
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 3, 3, 1,
- 2, 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 1, 1, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 39, 44,
- 46, 49, 53, 56, 58
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 12, 12, 13, 1, 13,
- 14, 13, 15, 1, 16, 1, 17, 17,
- 1, 17, 17, 15, 1, 18, 19, 1,
- 20, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 18,
- 16, 17, 19, 18, 20
-};
-
-static const char _tsip_machine_parser_header_Max_Forwards_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_Max_Forwards_start = 1;
-static const int tsip_machine_parser_header_Max_Forwards_first_final = 20;
-static const int tsip_machine_parser_header_Max_Forwards_error = 0;
-
-static const int tsip_machine_parser_header_Max_Forwards_en_main = 1;
-
-
-/* #line 96 "./ragel/tsip_parser_header_Max_Forwards.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Max_Forwards_first_final);
- (void)(tsip_machine_parser_header_Max_Forwards_error);
- (void)(tsip_machine_parser_header_Max_Forwards_en_main);
-
-/* #line 153 "./src/headers/tsip_header_Max_Forwards.c" */
- {
- cs = tsip_machine_parser_header_Max_Forwards_start;
- }
-
-/* #line 101 "./ragel/tsip_parser_header_Max_Forwards.rl" */
-
-/* #line 160 "./src/headers/tsip_header_Max_Forwards.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Max_Forwards_t *hdr_maxf = tsip_header_Max_Forwards_create(TSIP_HEADER_MAX_FORWARDS_NONE);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 79 "./src/headers/tsip_header_Max_Forwards.c" */
+ static const char _tsip_machine_parser_header_Max_Forwards_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 26, 31,
+ 32, 34, 38, 41, 42
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_trans_keys[] = {
+ 77, 109, 65, 97, 88, 120, 45, 70,
+ 102, 79, 111, 82, 114, 87, 119, 65,
+ 97, 82, 114, 68, 100, 83, 115, 9,
+ 32, 58, 9, 13, 32, 48, 57, 10,
+ 9, 32, 9, 32, 48, 57, 13, 48,
+ 57, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 3, 3, 1,
+ 2, 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 1, 1, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 39, 44,
+ 46, 49, 53, 56, 58
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 12, 12, 13, 1, 13,
+ 14, 13, 15, 1, 16, 1, 17, 17,
+ 1, 17, 17, 15, 1, 18, 19, 1,
+ 20, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 18,
+ 16, 17, 19, 18, 20
+ };
+
+ static const char _tsip_machine_parser_header_Max_Forwards_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Max_Forwards_start = 1;
+ static const int tsip_machine_parser_header_Max_Forwards_first_final = 20;
+ static const int tsip_machine_parser_header_Max_Forwards_error = 0;
+
+ static const int tsip_machine_parser_header_Max_Forwards_en_main = 1;
+
+
+ /* #line 96 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Max_Forwards_first_final);
+ (void)(tsip_machine_parser_header_Max_Forwards_error);
+ (void)(tsip_machine_parser_header_Max_Forwards_en_main);
+
+ /* #line 153 "./src/headers/tsip_header_Max_Forwards.c" */
+ {
+ cs = tsip_machine_parser_header_Max_Forwards_start;
+ }
+
+ /* #line 101 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+
+ /* #line 160 "./src/headers/tsip_header_Max_Forwards.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Max_Forwards_trans_keys + _tsip_machine_parser_header_Max_Forwards_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Max_Forwards_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Max_Forwards_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Max_Forwards_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Max_Forwards_trans_keys + _tsip_machine_parser_header_Max_Forwards_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Max_Forwards_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Max_Forwards_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Max_Forwards_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Max_Forwards_indicies[_trans];
- cs = _tsip_machine_parser_header_Max_Forwards_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Max_Forwards_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Max_Forwards_actions + _tsip_machine_parser_header_Max_Forwards_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Max_Forwards.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Max_Forwards.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_maxf->value);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Max_Forwards.rl" */
- {
- }
- break;
-/* #line 251 "./src/headers/tsip_header_Max_Forwards.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Max_Forwards_indicies[_trans];
+ cs = _tsip_machine_parser_header_Max_Forwards_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Max_Forwards_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Max_Forwards_actions + _tsip_machine_parser_header_Max_Forwards_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_maxf->value);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+ {
+ }
+ break;
+ /* #line 251 "./src/headers/tsip_header_Max_Forwards.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 102 "./ragel/tsip_parser_header_Max_Forwards.rl" */
-
- if( cs <
-/* #line 267 "./src/headers/tsip_header_Max_Forwards.c" */
-20
-/* #line 103 "./ragel/tsip_parser_header_Max_Forwards.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Max-Forward' header.");
- TSK_OBJECT_SAFE_FREE(hdr_maxf);
- }
-
- return hdr_maxf;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 102 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+
+ if( cs <
+ /* #line 267 "./src/headers/tsip_header_Max_Forwards.c" */
+ 20
+ /* #line 103 "./ragel/tsip_parser_header_Max_Forwards.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Max-Forward' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_maxf);
+ }
+
+ return hdr_maxf;
}
@@ -286,36 +297,35 @@ _again:
static tsk_object_t* tsip_header_Max_Forwards_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Max_Forwards_t *Max_Forwards = self;
- if(Max_Forwards){
- TSIP_HEADER(Max_Forwards)->type = tsip_htype_Max_Forwards;
- TSIP_HEADER(Max_Forwards)->serialize = tsip_header_Max_Forwards_serialize;
- Max_Forwards->value = va_arg(*app, int32_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Max_Forwards header.");
- }
- return self;
+ tsip_header_Max_Forwards_t *Max_Forwards = self;
+ if(Max_Forwards) {
+ TSIP_HEADER(Max_Forwards)->type = tsip_htype_Max_Forwards;
+ TSIP_HEADER(Max_Forwards)->serialize = tsip_header_Max_Forwards_serialize;
+ Max_Forwards->value = va_arg(*app, int32_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Max_Forwards header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Max_Forwards_dtor(tsk_object_t *self)
{
- tsip_header_Max_Forwards_t *Max_Forwards = self;
- if(Max_Forwards){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Max_Forwards));
- }
- else{
- TSK_DEBUG_ERROR("Null Max_Forwards header.");
- }
-
- return self;
+ tsip_header_Max_Forwards_t *Max_Forwards = self;
+ if(Max_Forwards) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Max_Forwards));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Max_Forwards header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Max_Forwards_def_s =
-{
- sizeof(tsip_header_Max_Forwards_t),
- tsip_header_Max_Forwards_ctor,
- tsip_header_Max_Forwards_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Max_Forwards_def_s = {
+ sizeof(tsip_header_Max_Forwards_t),
+ tsip_header_Max_Forwards_ctor,
+ tsip_header_Max_Forwards_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Max_Forwards_def_t = &tsip_header_Max_Forwards_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Min_Expires.c b/tinySIP/src/headers/tsip_header_Min_Expires.c
index 70dfed9..770c214 100755
--- a/tinySIP/src/headers/tsip_header_Min_Expires.c
+++ b/tinySIP/src/headers/tsip_header_Min_Expires.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,235 +47,246 @@
tsip_header_Min_Expires_t* tsip_header_Min_Expires_create(int32_t value)
{
- return tsk_object_new(TSIP_HEADER_MIN_EXPIRES_VA_ARGS(value));
+ return tsk_object_new(TSIP_HEADER_MIN_EXPIRES_VA_ARGS(value));
}
tsip_header_Min_Expires_t* tsip_header_Min_Expires_create_null()
{
- return tsip_header_Min_Expires_create(TSIP_HEADER_MIN_EXPIRES_NONE);
+ return tsip_header_Min_Expires_create(TSIP_HEADER_MIN_EXPIRES_NONE);
}
int tsip_header_Min_Expires_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Min_Expires_t *Min_Expires = (const tsip_header_Min_Expires_t *)header;
- if(Min_Expires->value >=0){
- return tsk_buffer_append_2(output, "%d", Min_Expires->value);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Min_Expires_t *Min_Expires = (const tsip_header_Min_Expires_t *)header;
+ if(Min_Expires->value >=0) {
+ return tsk_buffer_append_2(output, "%d", Min_Expires->value);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Min_Expires_t *tsip_header_Min_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Min_Expires_t *hdr_minE = tsip_header_Min_Expires_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 83 "./src/headers/tsip_header_Min_Expires.c" */
-static const char _tsip_machine_parser_header_Min_Expires_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 17, 19, 21, 24, 29, 30,
- 32, 36, 39, 40
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_trans_keys[] = {
- 77, 109, 73, 105, 78, 110, 45, 69,
- 101, 88, 120, 80, 112, 73, 105, 82,
- 114, 69, 101, 83, 115, 9, 32, 58,
- 9, 13, 32, 48, 57, 10, 9, 32,
- 9, 32, 48, 57, 13, 48, 57, 10,
- 0
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 3, 3, 1, 2,
- 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 1, 1, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 26, 29, 32, 36, 41, 43,
- 46, 50, 53, 55
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 11, 11, 12, 1, 12, 13, 12, 14,
- 1, 15, 1, 16, 16, 1, 16, 16,
- 14, 1, 17, 18, 1, 19, 1, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 17, 15,
- 16, 18, 17, 19
-};
-
-static const char _tsip_machine_parser_header_Min_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_Min_Expires_start = 1;
-static const int tsip_machine_parser_header_Min_Expires_first_final = 19;
-static const int tsip_machine_parser_header_Min_Expires_error = 0;
-
-static const int tsip_machine_parser_header_Min_Expires_en_main = 1;
-
-
-/* #line 100 "./ragel/tsip_parser_header_Min_Expires.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Min_Expires_first_final);
- (void)(tsip_machine_parser_header_Min_Expires_error);
- (void)(tsip_machine_parser_header_Min_Expires_en_main);
-
-/* #line 157 "./src/headers/tsip_header_Min_Expires.c" */
- {
- cs = tsip_machine_parser_header_Min_Expires_start;
- }
-
-/* #line 105 "./ragel/tsip_parser_header_Min_Expires.rl" */
-
-/* #line 164 "./src/headers/tsip_header_Min_Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Min_Expires_t *hdr_minE = tsip_header_Min_Expires_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 83 "./src/headers/tsip_header_Min_Expires.c" */
+ static const char _tsip_machine_parser_header_Min_Expires_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 17, 19, 21, 24, 29, 30,
+ 32, 36, 39, 40
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_trans_keys[] = {
+ 77, 109, 73, 105, 78, 110, 45, 69,
+ 101, 88, 120, 80, 112, 73, 105, 82,
+ 114, 69, 101, 83, 115, 9, 32, 58,
+ 9, 13, 32, 48, 57, 10, 9, 32,
+ 9, 32, 48, 57, 13, 48, 57, 10,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 3, 3, 1, 2,
+ 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 1, 1, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 26, 29, 32, 36, 41, 43,
+ 46, 50, 53, 55
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 11, 11, 12, 1, 12, 13, 12, 14,
+ 1, 15, 1, 16, 16, 1, 16, 16,
+ 14, 1, 17, 18, 1, 19, 1, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 17, 15,
+ 16, 18, 17, 19
+ };
+
+ static const char _tsip_machine_parser_header_Min_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Min_Expires_start = 1;
+ static const int tsip_machine_parser_header_Min_Expires_first_final = 19;
+ static const int tsip_machine_parser_header_Min_Expires_error = 0;
+
+ static const int tsip_machine_parser_header_Min_Expires_en_main = 1;
+
+
+ /* #line 100 "./ragel/tsip_parser_header_Min_Expires.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Min_Expires_first_final);
+ (void)(tsip_machine_parser_header_Min_Expires_error);
+ (void)(tsip_machine_parser_header_Min_Expires_en_main);
+
+ /* #line 157 "./src/headers/tsip_header_Min_Expires.c" */
+ {
+ cs = tsip_machine_parser_header_Min_Expires_start;
+ }
+
+ /* #line 105 "./ragel/tsip_parser_header_Min_Expires.rl" */
+
+ /* #line 164 "./src/headers/tsip_header_Min_Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Min_Expires_trans_keys + _tsip_machine_parser_header_Min_Expires_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Min_Expires_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Min_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Min_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Min_Expires_trans_keys + _tsip_machine_parser_header_Min_Expires_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Min_Expires_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Min_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Min_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Min_Expires_indicies[_trans];
- cs = _tsip_machine_parser_header_Min_Expires_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Min_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Min_Expires_actions + _tsip_machine_parser_header_Min_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Min_Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Min_Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_minE->value);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Min_Expires.rl" */
- {
- }
- break;
-/* #line 255 "./src/headers/tsip_header_Min_Expires.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Min_Expires_indicies[_trans];
+ cs = _tsip_machine_parser_header_Min_Expires_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Min_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Min_Expires_actions + _tsip_machine_parser_header_Min_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Min_Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Min_Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_minE->value);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Min_Expires.rl" */
+ {
+ }
+ break;
+ /* #line 255 "./src/headers/tsip_header_Min_Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 106 "./ragel/tsip_parser_header_Min_Expires.rl" */
-
- if( cs <
-/* #line 271 "./src/headers/tsip_header_Min_Expires.c" */
-19
-/* #line 107 "./ragel/tsip_parser_header_Min_Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Min-Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_minE);
- }
-
- return hdr_minE;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 106 "./ragel/tsip_parser_header_Min_Expires.rl" */
+
+ if( cs <
+ /* #line 271 "./src/headers/tsip_header_Min_Expires.c" */
+ 19
+ /* #line 107 "./ragel/tsip_parser_header_Min_Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Min-Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_minE);
+ }
+
+ return hdr_minE;
}
@@ -290,37 +301,35 @@ _again:
static tsk_object_t* tsip_header_Min_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Min_Expires_t *Min_Expires = self;
- if(Min_Expires){
- TSIP_HEADER(Min_Expires)->type = tsip_htype_Min_Expires;
- TSIP_HEADER(Min_Expires)->serialize = tsip_header_Min_Expires_serialize;
- Min_Expires->value = va_arg(*app, int32_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Min_Expires header.");
- }
- return self;
+ tsip_header_Min_Expires_t *Min_Expires = self;
+ if(Min_Expires) {
+ TSIP_HEADER(Min_Expires)->type = tsip_htype_Min_Expires;
+ TSIP_HEADER(Min_Expires)->serialize = tsip_header_Min_Expires_serialize;
+ Min_Expires->value = va_arg(*app, int32_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Min_Expires header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Min_Expires_dtor(tsk_object_t *self)
{
- tsip_header_Min_Expires_t *Min_Expires = self;
- if(Min_Expires)
- {
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Min_Expires));
- }
- else{
- TSK_DEBUG_ERROR("Null Min_Expires header.");
- }
-
- return self;
+ tsip_header_Min_Expires_t *Min_Expires = self;
+ if(Min_Expires) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Min_Expires));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Min_Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Min_Expires_def_s =
-{
- sizeof(tsip_header_Min_Expires_t),
- tsip_header_Min_Expires_ctor,
- tsip_header_Min_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Min_Expires_def_s = {
+ sizeof(tsip_header_Min_Expires_t),
+ tsip_header_Min_Expires_ctor,
+ tsip_header_Min_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Min_Expires_def_t = &tsip_header_Min_Expires_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Min_SE.c b/tinySIP/src/headers/tsip_header_Min_SE.c
index 7d2dd66..e85b8b6 100755
--- a/tinySIP/src/headers/tsip_header_Min_SE.c
+++ b/tinySIP/src/headers/tsip_header_Min_SE.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,357 +48,368 @@
tsip_header_Min_SE_t* tsip_header_Min_SE_create(int64_t delta_seconds)
{
- return tsk_object_new(TSIP_HEADER_MIN_SE_VA_ARGS(delta_seconds));
+ return tsk_object_new(TSIP_HEADER_MIN_SE_VA_ARGS(delta_seconds));
}
int tsip_header_Min_SE_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Min_SE_t *MinSE = (const tsip_header_Min_SE_t *)header;
- if(MinSE->delta_seconds >=0){
- return tsk_buffer_append_2(output, "%lld", MinSE->delta_seconds);
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Min_SE_t *MinSE = (const tsip_header_Min_SE_t *)header;
+ if(MinSE->delta_seconds >=0) {
+ return tsk_buffer_append_2(output, "%lld", MinSE->delta_seconds);
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Min_SE_t *tsip_header_Min_SE_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Min_SE_t *hdr_minse = tsip_header_Min_SE_create(TSIP_SESSION_EXPIRES_MIN_VALUE);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 79 "./src/headers/tsip_header_Min_SE.c" */
-static const char _tsip_machine_parser_header_Min_SE_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3
-};
-
-static const short _tsip_machine_parser_header_Min_SE_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 14, 19, 20, 22, 26, 32, 36, 37,
- 39, 42, 59, 60, 62, 78, 97, 102,
- 103, 105, 109, 128, 129, 131, 150, 151,
- 153, 156, 164, 165, 167, 171, 172, 178,
- 196, 203, 211, 219, 227, 229, 236, 245,
- 247, 250, 252, 255, 257, 260, 263, 264,
- 267, 268, 271, 272, 281, 290, 298, 306,
- 314, 322, 324, 330, 339, 348, 357, 359,
- 362, 365, 366, 367
-};
-
-static const char _tsip_machine_parser_header_Min_SE_trans_keys[] = {
- 77, 109, 73, 105, 78, 110, 45, 83,
- 115, 69, 101, 9, 32, 58, 9, 13,
- 32, 48, 57, 10, 9, 32, 9, 32,
- 48, 57, 9, 13, 32, 59, 48, 57,
- 9, 13, 32, 59, 10, 9, 32, 9,
- 32, 59, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 61, 10, 9,
- 32, 9, 32, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 59, 10, 0, 9, 11, 12,
- 14, 127, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 58, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 58, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 46, 48, 57, 46, 46, 48, 57, 46,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 46, 48, 57, 46, 58, 0
-};
-
-static const char _tsip_machine_parser_header_Min_SE_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 3,
- 3, 1, 2, 2, 4, 4, 1, 2,
- 3, 7, 1, 2, 6, 9, 5, 1,
- 2, 4, 9, 1, 2, 9, 1, 2,
- 3, 4, 1, 2, 4, 1, 0, 8,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 2, 2, 2,
- 2, 2, 0, 3, 3, 3, 0, 1,
- 1, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Min_SE_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 1, 0, 0, 0,
- 0, 5, 0, 0, 5, 5, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 2, 0, 0, 0, 0, 3, 5,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 1,
- 0, 1, 0, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 3, 3, 1, 1,
- 1, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Min_SE_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 21, 26, 28, 31, 35, 41, 46, 48,
- 51, 55, 68, 70, 73, 85, 100, 106,
- 108, 111, 116, 131, 133, 136, 151, 153,
- 156, 160, 167, 169, 172, 177, 179, 183,
- 197, 202, 208, 214, 220, 223, 228, 235,
- 237, 240, 242, 245, 247, 250, 253, 255,
- 258, 260, 263, 265, 272, 279, 285, 291,
- 297, 303, 306, 310, 317, 324, 331, 333,
- 336, 339, 341, 343
-};
-
-static const char _tsip_machine_parser_header_Min_SE_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 6, 6, 7, 1, 7, 8, 7,
- 9, 1, 10, 1, 11, 11, 1, 11,
- 11, 9, 1, 12, 13, 12, 15, 14,
- 1, 16, 17, 16, 18, 1, 19, 1,
- 20, 20, 1, 20, 20, 18, 1, 18,
- 21, 18, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 1, 23, 1, 24, 24,
- 1, 24, 24, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 1, 25, 26, 25,
- 27, 27, 27, 28, 29, 27, 27, 27,
- 27, 27, 27, 1, 30, 31, 30, 18,
- 29, 1, 32, 1, 33, 33, 1, 33,
- 33, 18, 29, 1, 29, 34, 29, 35,
- 36, 35, 35, 37, 35, 35, 35, 35,
- 35, 35, 1, 38, 1, 39, 39, 1,
- 39, 40, 39, 35, 36, 35, 35, 37,
- 35, 35, 35, 35, 35, 35, 1, 41,
- 1, 42, 42, 1, 42, 42, 36, 1,
- 43, 44, 45, 1, 1, 1, 36, 46,
- 1, 36, 36, 1, 47, 26, 47, 28,
- 1, 48, 1, 36, 36, 36, 1, 47,
- 26, 47, 35, 35, 35, 28, 35, 35,
- 35, 35, 35, 35, 1, 50, 49, 49,
- 49, 1, 52, 44, 51, 51, 51, 1,
- 52, 44, 53, 53, 53, 1, 52, 44,
- 54, 54, 54, 1, 52, 44, 1, 56,
- 55, 49, 49, 1, 57, 52, 44, 58,
- 51, 51, 1, 59, 1, 60, 61, 1,
- 62, 1, 63, 64, 1, 65, 1, 44,
- 66, 1, 44, 67, 1, 44, 1, 63,
- 68, 1, 63, 1, 60, 69, 1, 60,
- 1, 57, 52, 44, 70, 53, 53, 1,
- 57, 52, 44, 54, 54, 54, 1, 72,
- 44, 71, 71, 71, 1, 74, 44, 73,
- 73, 73, 1, 74, 44, 75, 75, 75,
- 1, 74, 44, 76, 76, 76, 1, 74,
- 44, 1, 77, 71, 71, 1, 57, 74,
- 44, 78, 73, 73, 1, 57, 74, 44,
- 79, 75, 75, 1, 57, 74, 44, 76,
- 76, 76, 1, 80, 1, 57, 81, 1,
- 57, 82, 1, 57, 1, 56, 1, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_Min_SE_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 12, 10, 11, 13, 37, 12, 17,
- 13, 14, 17, 15, 16, 18, 21, 19,
- 20, 22, 37, 21, 17, 26, 22, 23,
- 24, 25, 27, 39, 33, 40, 28, 29,
- 30, 31, 32, 34, 36, 38, 35, 13,
- 75, 41, 74, 42, 45, 43, 44, 46,
- 61, 47, 59, 48, 49, 57, 50, 51,
- 55, 52, 53, 54, 56, 58, 60, 62,
- 70, 63, 66, 64, 65, 67, 68, 69,
- 71, 72, 73
-};
-
-static const char _tsip_machine_parser_header_Min_SE_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 3, 3, 0, 3,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 5, 5, 0, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Min_SE_start = 1;
-static const int tsip_machine_parser_header_Min_SE_first_final = 75;
-static const int tsip_machine_parser_header_Min_SE_error = 0;
-
-static const int tsip_machine_parser_header_Min_SE_en_main = 1;
-
-
-/* #line 100 "./ragel/tsip_parser_header_Min_SE.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Min_SE_first_final);
- (void)(tsip_machine_parser_header_Min_SE_error);
- (void)(tsip_machine_parser_header_Min_SE_en_main);
-
-/* #line 274 "./src/headers/tsip_header_Min_SE.c" */
- {
- cs = tsip_machine_parser_header_Min_SE_start;
- }
-
-/* #line 105 "./ragel/tsip_parser_header_Min_SE.rl" */
-
-/* #line 281 "./src/headers/tsip_header_Min_SE.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Min_SE_t *hdr_minse = tsip_header_Min_SE_create(TSIP_SESSION_EXPIRES_MIN_VALUE);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 79 "./src/headers/tsip_header_Min_SE.c" */
+ static const char _tsip_machine_parser_header_Min_SE_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3
+ };
+
+ static const short _tsip_machine_parser_header_Min_SE_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 14, 19, 20, 22, 26, 32, 36, 37,
+ 39, 42, 59, 60, 62, 78, 97, 102,
+ 103, 105, 109, 128, 129, 131, 150, 151,
+ 153, 156, 164, 165, 167, 171, 172, 178,
+ 196, 203, 211, 219, 227, 229, 236, 245,
+ 247, 250, 252, 255, 257, 260, 263, 264,
+ 267, 268, 271, 272, 281, 290, 298, 306,
+ 314, 322, 324, 330, 339, 348, 357, 359,
+ 362, 365, 366, 367
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_trans_keys[] = {
+ 77, 109, 73, 105, 78, 110, 45, 83,
+ 115, 69, 101, 9, 32, 58, 9, 13,
+ 32, 48, 57, 10, 9, 32, 9, 32,
+ 48, 57, 9, 13, 32, 59, 48, 57,
+ 9, 13, 32, 59, 10, 9, 32, 9,
+ 32, 59, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 61, 10, 9,
+ 32, 9, 32, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 59, 10, 0, 9, 11, 12,
+ 14, 127, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 58, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 58, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 46, 48, 57, 46, 46, 48, 57, 46,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 46, 48, 57, 46, 58, 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 3,
+ 3, 1, 2, 2, 4, 4, 1, 2,
+ 3, 7, 1, 2, 6, 9, 5, 1,
+ 2, 4, 9, 1, 2, 9, 1, 2,
+ 3, 4, 1, 2, 4, 1, 0, 8,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 2, 2, 2,
+ 2, 2, 0, 3, 3, 3, 0, 1,
+ 1, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 5, 0, 0, 5, 5, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 2, 0, 0, 0, 0, 3, 5,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 1, 0, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 1, 1,
+ 1, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Min_SE_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 21, 26, 28, 31, 35, 41, 46, 48,
+ 51, 55, 68, 70, 73, 85, 100, 106,
+ 108, 111, 116, 131, 133, 136, 151, 153,
+ 156, 160, 167, 169, 172, 177, 179, 183,
+ 197, 202, 208, 214, 220, 223, 228, 235,
+ 237, 240, 242, 245, 247, 250, 253, 255,
+ 258, 260, 263, 265, 272, 279, 285, 291,
+ 297, 303, 306, 310, 317, 324, 331, 333,
+ 336, 339, 341, 343
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 6, 6, 7, 1, 7, 8, 7,
+ 9, 1, 10, 1, 11, 11, 1, 11,
+ 11, 9, 1, 12, 13, 12, 15, 14,
+ 1, 16, 17, 16, 18, 1, 19, 1,
+ 20, 20, 1, 20, 20, 18, 1, 18,
+ 21, 18, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 1, 23, 1, 24, 24,
+ 1, 24, 24, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 1, 25, 26, 25,
+ 27, 27, 27, 28, 29, 27, 27, 27,
+ 27, 27, 27, 1, 30, 31, 30, 18,
+ 29, 1, 32, 1, 33, 33, 1, 33,
+ 33, 18, 29, 1, 29, 34, 29, 35,
+ 36, 35, 35, 37, 35, 35, 35, 35,
+ 35, 35, 1, 38, 1, 39, 39, 1,
+ 39, 40, 39, 35, 36, 35, 35, 37,
+ 35, 35, 35, 35, 35, 35, 1, 41,
+ 1, 42, 42, 1, 42, 42, 36, 1,
+ 43, 44, 45, 1, 1, 1, 36, 46,
+ 1, 36, 36, 1, 47, 26, 47, 28,
+ 1, 48, 1, 36, 36, 36, 1, 47,
+ 26, 47, 35, 35, 35, 28, 35, 35,
+ 35, 35, 35, 35, 1, 50, 49, 49,
+ 49, 1, 52, 44, 51, 51, 51, 1,
+ 52, 44, 53, 53, 53, 1, 52, 44,
+ 54, 54, 54, 1, 52, 44, 1, 56,
+ 55, 49, 49, 1, 57, 52, 44, 58,
+ 51, 51, 1, 59, 1, 60, 61, 1,
+ 62, 1, 63, 64, 1, 65, 1, 44,
+ 66, 1, 44, 67, 1, 44, 1, 63,
+ 68, 1, 63, 1, 60, 69, 1, 60,
+ 1, 57, 52, 44, 70, 53, 53, 1,
+ 57, 52, 44, 54, 54, 54, 1, 72,
+ 44, 71, 71, 71, 1, 74, 44, 73,
+ 73, 73, 1, 74, 44, 75, 75, 75,
+ 1, 74, 44, 76, 76, 76, 1, 74,
+ 44, 1, 77, 71, 71, 1, 57, 74,
+ 44, 78, 73, 73, 1, 57, 74, 44,
+ 79, 75, 75, 1, 57, 74, 44, 76,
+ 76, 76, 1, 80, 1, 57, 81, 1,
+ 57, 82, 1, 57, 1, 56, 1, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 12, 10, 11, 13, 37, 12, 17,
+ 13, 14, 17, 15, 16, 18, 21, 19,
+ 20, 22, 37, 21, 17, 26, 22, 23,
+ 24, 25, 27, 39, 33, 40, 28, 29,
+ 30, 31, 32, 34, 36, 38, 35, 13,
+ 75, 41, 74, 42, 45, 43, 44, 46,
+ 61, 47, 59, 48, 49, 57, 50, 51,
+ 55, 52, 53, 54, 56, 58, 60, 62,
+ 70, 63, 66, 64, 65, 67, 68, 69,
+ 71, 72, 73
+ };
+
+ static const char _tsip_machine_parser_header_Min_SE_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 3, 3, 0, 3,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 5, 5, 0, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Min_SE_start = 1;
+ static const int tsip_machine_parser_header_Min_SE_first_final = 75;
+ static const int tsip_machine_parser_header_Min_SE_error = 0;
+
+ static const int tsip_machine_parser_header_Min_SE_en_main = 1;
+
+
+ /* #line 100 "./ragel/tsip_parser_header_Min_SE.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Min_SE_first_final);
+ (void)(tsip_machine_parser_header_Min_SE_error);
+ (void)(tsip_machine_parser_header_Min_SE_en_main);
+
+ /* #line 274 "./src/headers/tsip_header_Min_SE.c" */
+ {
+ cs = tsip_machine_parser_header_Min_SE_start;
+ }
+
+ /* #line 105 "./ragel/tsip_parser_header_Min_SE.rl" */
+
+ /* #line 281 "./src/headers/tsip_header_Min_SE.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Min_SE_trans_keys + _tsip_machine_parser_header_Min_SE_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Min_SE_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Min_SE_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Min_SE_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Min_SE_trans_keys + _tsip_machine_parser_header_Min_SE_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Min_SE_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Min_SE_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Min_SE_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Min_SE_indicies[_trans];
- cs = _tsip_machine_parser_header_Min_SE_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Min_SE_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Min_SE_actions + _tsip_machine_parser_header_Min_SE_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_Min_SE.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Min_SE.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_minse->delta_seconds);
- }
- break;
- case 2:
-/* #line 57 "./ragel/tsip_parser_header_Min_SE.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_minse));
- }
- break;
- case 3:
-/* #line 61 "./ragel/tsip_parser_header_Min_SE.rl" */
- {
- }
- break;
-/* #line 378 "./src/headers/tsip_header_Min_SE.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Min_SE_indicies[_trans];
+ cs = _tsip_machine_parser_header_Min_SE_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Min_SE_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Min_SE_actions + _tsip_machine_parser_header_Min_SE_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_Min_SE.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Min_SE.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_minse->delta_seconds);
+ }
+ break;
+ case 2:
+ /* #line 57 "./ragel/tsip_parser_header_Min_SE.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_minse));
+ }
+ break;
+ case 3:
+ /* #line 61 "./ragel/tsip_parser_header_Min_SE.rl" */
+ {
+ }
+ break;
+ /* #line 378 "./src/headers/tsip_header_Min_SE.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 106 "./ragel/tsip_parser_header_Min_SE.rl" */
-
- if( cs <
-/* #line 394 "./src/headers/tsip_header_Min_SE.c" */
-75
-/* #line 107 "./ragel/tsip_parser_header_Min_SE.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Min-SE' header.");
- TSK_OBJECT_SAFE_FREE(hdr_minse);
- }
-
- return hdr_minse;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 106 "./ragel/tsip_parser_header_Min_SE.rl" */
+
+ if( cs <
+ /* #line 394 "./src/headers/tsip_header_Min_SE.c" */
+ 75
+ /* #line 107 "./ragel/tsip_parser_header_Min_SE.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Min-SE' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_minse);
+ }
+
+ return hdr_minse;
}
@@ -413,37 +424,36 @@ _again:
static tsk_object_t* tsip_header_Min_SE_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Min_SE_t *MinSE = self;
- if(MinSE){
- TSIP_HEADER(MinSE)->type = tsip_htype_Min_SE;
- TSIP_HEADER(MinSE)->serialize = tsip_header_Min_SE_serialize;
- MinSE->delta_seconds = va_arg(*app, int64_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new MinSE header.");
- }
- return self;
+ tsip_header_Min_SE_t *MinSE = self;
+ if(MinSE) {
+ TSIP_HEADER(MinSE)->type = tsip_htype_Min_SE;
+ TSIP_HEADER(MinSE)->serialize = tsip_header_Min_SE_serialize;
+ MinSE->delta_seconds = va_arg(*app, int64_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new MinSE header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Min_SE_dtor(tsk_object_t *self)
{
- tsip_header_Min_SE_t *MinSE = self;
- if(MinSE){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(MinSE));
- }
- else{
- TSK_DEBUG_ERROR("Null MinSE header.");
- }
-
- return self;
+ tsip_header_Min_SE_t *MinSE = self;
+ if(MinSE) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(MinSE));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null MinSE header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Min_SE_def_s =
-{
- sizeof(tsip_header_Min_SE_t),
- tsip_header_Min_SE_ctor,
- tsip_header_Min_SE_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Min_SE_def_s = {
+ sizeof(tsip_header_Min_SE_t),
+ tsip_header_Min_SE_ctor,
+ tsip_header_Min_SE_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Min_SE_def_t = &tsip_header_Min_SE_def_s;
diff --git a/tinySIP/src/headers/tsip_header_P_Access_Network_Info.c b/tinySIP/src/headers/tsip_header_P_Access_Network_Info.c
index 54e95c7..da49346 100755
--- a/tinySIP/src/headers/tsip_header_P_Access_Network_Info.c
+++ b/tinySIP/src/headers/tsip_header_P_Access_Network_Info.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -58,244 +58,255 @@
tsip_header_P_Access_Network_Info_t* tsip_header_P_Access_Network_Info_create(const char* value)
{
- return tsk_object_new(TSIP_HEADER_P_ACCESS_NETWORK_INFO_VA_ARGS(value));
+ return tsk_object_new(TSIP_HEADER_P_ACCESS_NETWORK_INFO_VA_ARGS(value));
}
tsip_header_P_Access_Network_Info_t* tsip_header_P_Access_Network_Info_create_null()
{
- return tsip_header_P_Access_Network_Info_create(tsk_null);
+ return tsip_header_P_Access_Network_Info_create(tsk_null);
}
int tsip_header_P_Access_Network_Info_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = (const tsip_header_P_Access_Network_Info_t *)header;
- if(P_Access_Network_Info->value){
- tsk_buffer_append(output, P_Access_Network_Info->value, tsk_strlen(P_Access_Network_Info->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = (const tsip_header_P_Access_Network_Info_t *)header;
+ if(P_Access_Network_Info->value) {
+ tsk_buffer_append(output, P_Access_Network_Info->value, tsk_strlen(P_Access_Network_Info->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_P_Access_Network_Info_t *tsip_header_P_Access_Network_Info_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_P_Access_Network_Info_t *hdr_ani = tsip_header_P_Access_Network_Info_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 94 "./src/headers/tsip_header_P_Access_Network_Info.c" */
-static const char _tsip_machine_parser_header_P_Access_Network_Info_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 1
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_key_offsets[] = {
- 0, 0, 2, 3, 5, 7, 9, 11,
- 13, 15, 16, 18, 20, 22, 24, 26,
- 28, 30, 31, 33, 35, 37, 39, 42,
- 45, 46, 47
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_keys[] = {
- 80, 112, 45, 65, 97, 67, 99, 67,
- 99, 69, 101, 83, 115, 83, 115, 45,
- 78, 110, 69, 101, 84, 116, 87, 119,
- 79, 111, 82, 114, 75, 107, 45, 73,
- 105, 78, 110, 70, 102, 79, 111, 9,
- 32, 58, 9, 13, 32, 13, 10, 0
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_single_lengths[] = {
- 0, 2, 1, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 3, 3,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_index_offsets[] = {
- 0, 0, 3, 5, 8, 11, 14, 17,
- 20, 23, 25, 28, 31, 34, 37, 40,
- 43, 46, 48, 51, 54, 57, 60, 64,
- 68, 70, 72
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_indicies[] = {
- 0, 0, 1, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 1,
- 18, 18, 1, 19, 19, 1, 20, 20,
- 1, 21, 21, 1, 21, 21, 22, 1,
- 24, 25, 24, 23, 27, 26, 28, 1,
- 1, 0
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 23, 25, 24, 25, 26
-};
-
-static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 7, 0, 3, 5
-};
-
-static const int tsip_machine_parser_header_P_Access_Network_Info_start = 1;
-static const int tsip_machine_parser_header_P_Access_Network_Info_first_final = 26;
-static const int tsip_machine_parser_header_P_Access_Network_Info_error = 0;
-
-static const int tsip_machine_parser_header_P_Access_Network_Info_en_main = 1;
-
-
-/* #line 111 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_P_Access_Network_Info_first_final);
- (void)(tsip_machine_parser_header_P_Access_Network_Info_error);
- (void)(tsip_machine_parser_header_P_Access_Network_Info_en_main);
-
-/* #line 177 "./src/headers/tsip_header_P_Access_Network_Info.c" */
- {
- cs = tsip_machine_parser_header_P_Access_Network_Info_start;
- }
-
-/* #line 116 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
-
-/* #line 184 "./src/headers/tsip_header_P_Access_Network_Info.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_P_Access_Network_Info_t *hdr_ani = tsip_header_P_Access_Network_Info_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 94 "./src/headers/tsip_header_P_Access_Network_Info.c" */
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 1
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_key_offsets[] = {
+ 0, 0, 2, 3, 5, 7, 9, 11,
+ 13, 15, 16, 18, 20, 22, 24, 26,
+ 28, 30, 31, 33, 35, 37, 39, 42,
+ 45, 46, 47
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_keys[] = {
+ 80, 112, 45, 65, 97, 67, 99, 67,
+ 99, 69, 101, 83, 115, 83, 115, 45,
+ 78, 110, 69, 101, 84, 116, 87, 119,
+ 79, 111, 82, 114, 75, 107, 45, 73,
+ 105, 78, 110, 70, 102, 79, 111, 9,
+ 32, 58, 9, 13, 32, 13, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_single_lengths[] = {
+ 0, 2, 1, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 3, 3,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_index_offsets[] = {
+ 0, 0, 3, 5, 8, 11, 14, 17,
+ 20, 23, 25, 28, 31, 34, 37, 40,
+ 43, 46, 48, 51, 54, 57, 60, 64,
+ 68, 70, 72
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_indicies[] = {
+ 0, 0, 1, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 1,
+ 18, 18, 1, 19, 19, 1, 20, 20,
+ 1, 21, 21, 1, 21, 21, 22, 1,
+ 24, 25, 24, 23, 27, 26, 28, 1,
+ 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 23, 25, 24, 25, 26
+ };
+
+ static const char _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 7, 0, 3, 5
+ };
+
+ static const int tsip_machine_parser_header_P_Access_Network_Info_start = 1;
+ static const int tsip_machine_parser_header_P_Access_Network_Info_first_final = 26;
+ static const int tsip_machine_parser_header_P_Access_Network_Info_error = 0;
+
+ static const int tsip_machine_parser_header_P_Access_Network_Info_en_main = 1;
+
+
+ /* #line 111 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_P_Access_Network_Info_first_final);
+ (void)(tsip_machine_parser_header_P_Access_Network_Info_error);
+ (void)(tsip_machine_parser_header_P_Access_Network_Info_en_main);
+
+ /* #line 177 "./src/headers/tsip_header_P_Access_Network_Info.c" */
+ {
+ cs = tsip_machine_parser_header_P_Access_Network_Info_start;
+ }
+
+ /* #line 116 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+
+ /* #line 184 "./src/headers/tsip_header_P_Access_Network_Info.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_P_Access_Network_Info_trans_keys + _tsip_machine_parser_header_P_Access_Network_Info_key_offsets[cs];
- _trans = _tsip_machine_parser_header_P_Access_Network_Info_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_P_Access_Network_Info_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_P_Access_Network_Info_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_P_Access_Network_Info_trans_keys + _tsip_machine_parser_header_P_Access_Network_Info_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_P_Access_Network_Info_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_P_Access_Network_Info_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_P_Access_Network_Info_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_P_Access_Network_Info_indicies[_trans];
- cs = _tsip_machine_parser_header_P_Access_Network_Info_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_P_Access_Network_Info_actions + _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 58 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 62 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ani->value);
- }
- break;
- case 2:
-/* #line 66 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
- {
- }
- break;
-/* #line 275 "./src/headers/tsip_header_P_Access_Network_Info.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_P_Access_Network_Info_indicies[_trans];
+ cs = _tsip_machine_parser_header_P_Access_Network_Info_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_P_Access_Network_Info_actions + _tsip_machine_parser_header_P_Access_Network_Info_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 58 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 62 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ani->value);
+ }
+ break;
+ case 2:
+ /* #line 66 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+ {
+ }
+ break;
+ /* #line 275 "./src/headers/tsip_header_P_Access_Network_Info.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 117 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
-
- if( cs <
-/* #line 291 "./src/headers/tsip_header_P_Access_Network_Info.c" */
-26
-/* #line 118 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'P-Access-Network-Info' header.");
- TSK_OBJECT_SAFE_FREE(hdr_ani);
- }
-
- return hdr_ani;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 117 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+
+ if( cs <
+ /* #line 291 "./src/headers/tsip_header_P_Access_Network_Info.c" */
+ 26
+ /* #line 118 "./ragel/tsip_parser_header_P_Access_Network_Info.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'P-Access-Network-Info' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ani);
+ }
+
+ return hdr_ani;
}
@@ -310,36 +321,35 @@ _again:
static tsk_object_t* tsip_header_P_Access_Network_Info_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = self;
- if(P_Access_Network_Info){
- P_Access_Network_Info->value = tsk_strdup(va_arg(*app, const char *));
- TSIP_HEADER(P_Access_Network_Info)->type = tsip_htype_P_Access_Network_Info;
- TSIP_HEADER(P_Access_Network_Info)->serialize = tsip_header_P_Access_Network_Info_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P_Access_Network_Info header.");
- }
- return self;
+ tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = self;
+ if(P_Access_Network_Info) {
+ P_Access_Network_Info->value = tsk_strdup(va_arg(*app, const char *));
+ TSIP_HEADER(P_Access_Network_Info)->type = tsip_htype_P_Access_Network_Info;
+ TSIP_HEADER(P_Access_Network_Info)->serialize = tsip_header_P_Access_Network_Info_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P_Access_Network_Info header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_P_Access_Network_Info_dtor(tsk_object_t *self)
{
- tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = self;
- if(P_Access_Network_Info){
- TSK_FREE(P_Access_Network_Info->value);
- }
- else{
- TSK_DEBUG_ERROR("Null P_Access_Network_Info header.");
- }
-
- return self;
+ tsip_header_P_Access_Network_Info_t *P_Access_Network_Info = self;
+ if(P_Access_Network_Info) {
+ TSK_FREE(P_Access_Network_Info->value);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P_Access_Network_Info header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_P_Access_Network_Info_def_s =
-{
- sizeof(tsip_header_P_Access_Network_Info_t),
- tsip_header_P_Access_Network_Info_ctor,
- tsip_header_P_Access_Network_Info_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_P_Access_Network_Info_def_s = {
+ sizeof(tsip_header_P_Access_Network_Info_t),
+ tsip_header_P_Access_Network_Info_ctor,
+ tsip_header_P_Access_Network_Info_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_P_Access_Network_Info_def_t = &tsip_header_P_Access_Network_Info_def_s;
diff --git a/tinySIP/src/headers/tsip_header_P_Asserted_Identity.c b/tinySIP/src/headers/tsip_header_P_Asserted_Identity.c
index e7fbf57..258442c 100755
--- a/tinySIP/src/headers/tsip_header_P_Asserted_Identity.c
+++ b/tinySIP/src/headers/tsip_header_P_Asserted_Identity.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,1332 +50,1343 @@
tsip_header_P_Asserted_Identity_t* tsip_header_P_Asserted_Identity_create()
{
- return tsk_object_new(tsip_header_P_Asserted_Identity_def_t);
+ return tsk_object_new(tsip_header_P_Asserted_Identity_def_t);
}
int tsip_header_P_Asserted_Identity_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = (const tsip_header_P_Asserted_Identity_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(P_Asserted_Identity->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- return ret;
- }
+ if(header) {
+ const tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = (const tsip_header_P_Asserted_Identity_t *)header;
+ int ret = 0;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(P_Asserted_Identity->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+
+ return ret;
+ }
- return -1;
+ return -1;
}
tsip_header_P_Asserted_Identities_L_t *tsip_header_P_Asserted_Identity_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_P_Asserted_Identities_L_t *hdr_p_asserted_identities = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_P_Asserted_Identity_t *curr_p_asserted_identity = 0;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_P_Asserted_Identities_L_t *hdr_p_asserted_identities = tsk_list_create();
-
-/* #line 86 "./src/headers/tsip_header_P_Asserted_Identity.c" */
-static const char _tsip_machine_parser_header_P_Asserted_Identity_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 2, 1, 0,
- 2, 3, 4, 3, 1, 3, 4, 3,
- 2, 3, 4, 3, 3, 4, 1, 3,
- 3, 4, 2
-};
+ const char *tag_start = tsk_null;
+ tsip_header_P_Asserted_Identity_t *curr_p_asserted_identity = 0;
-static const short _tsip_machine_parser_header_P_Asserted_Identity_key_offsets[] = {
- 0, 0, 2, 3, 5, 7, 9, 11,
- 13, 15, 17, 19, 20, 22, 24, 26,
- 28, 30, 32, 34, 36, 39, 60, 61,
- 63, 84, 85, 87, 90, 94, 106, 109,
- 109, 110, 114, 115, 136, 137, 139, 160,
- 177, 195, 199, 200, 202, 210, 211, 213,
- 217, 223, 243, 262, 267, 267, 271, 289,
- 305, 322, 327, 335, 348, 353, 357, 362,
- 381, 398, 416, 422, 431, 441, 447, 472,
- 494, 517, 526, 537, 562, 585, 594, 599,
- 623, 644, 666, 674, 684, 708, 730, 750,
- 769, 774, 774, 778, 798, 814, 831, 836,
- 844, 857, 862, 866, 871, 892, 909, 927,
- 933, 942, 952, 958, 983, 1005, 1028, 1037,
- 1048, 1074, 1098, 1108, 1118, 1143, 1165, 1188,
- 1197, 1223, 1247, 1253, 1257, 1275, 1284, 1308,
- 1329, 1351, 1359, 1383, 1405, 1413, 1426, 1431,
- 1435, 1440, 1459, 1476, 1494, 1500, 1509, 1513,
- 1533, 1549, 1566, 1571, 1580, 1585, 1609, 1630,
- 1652, 1660, 1670, 1694, 1716, 1736, 1754, 1764,
- 1770, 1795, 1817, 1840, 1849, 1860, 1885, 1908,
- 1914, 1916, 1919, 1923, 1928, 1929, 1934, 1953,
- 1970, 1988, 1994, 2003, 2017, 2023, 2028, 2038,
- 2044, 2069, 2091, 2114, 2123, 2134, 2159, 2182,
- 2192, 2217, 2238, 2259, 2278, 2285, 2290, 2301,
- 2326, 2352, 2376, 2385, 2390, 2414, 2435, 2457,
- 2465, 2475, 2500, 2523, 2532, 2541, 2565, 2586,
- 2608, 2616, 2641, 2664, 2673, 2697, 2717, 2737,
- 2755, 2761, 2765, 2775, 2799, 2824, 2847
-};
-static const char _tsip_machine_parser_header_P_Asserted_Identity_trans_keys[] = {
- 80, 112, 45, 65, 97, 83, 115, 83,
- 115, 69, 101, 82, 114, 84, 116, 69,
- 101, 68, 100, 45, 73, 105, 68, 100,
- 69, 101, 78, 110, 84, 116, 73, 105,
- 84, 116, 89, 121, 9, 32, 58, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 10, 9, 32, 9,
- 32, 60, 65, 90, 97, 122, 9, 32,
- 43, 58, 45, 46, 48, 57, 65, 90,
- 97, 122, 9, 32, 58, 62, 9, 13,
- 32, 44, 10, 9, 13, 32, 33, 34,
- 37, 39, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 60,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 60, 10,
- 9, 32, 13, 34, 92, 127, 0, 8,
- 10, 31, 10, 9, 32, 9, 13, 32,
- 60, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 42, 43, 58,
- 126, 45, 46, 48, 57, 65, 90, 95,
- 96, 97, 122, 9, 13, 32, 33, 37,
- 39, 58, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 58, 60, 9, 13, 32, 44, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 60, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 44, 60, 9,
- 13, 32, 44, 65, 90, 97, 122, 9,
- 13, 32, 44, 58, 43, 46, 48, 57,
- 65, 90, 97, 122, 9, 13, 32, 44,
- 58, 9, 13, 32, 44, 9, 13, 32,
- 44, 62, 9, 13, 32, 33, 34, 37,
- 39, 44, 60, 62, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 62, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 60, 62, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 60, 62, 9, 13,
- 32, 44, 62, 65, 90, 97, 122, 9,
- 13, 32, 34, 44, 62, 92, 127, 0,
- 31, 9, 13, 32, 44, 60, 62, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 62, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 62, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 62,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 62, 0, 8, 11, 127, 9, 13,
- 32, 34, 44, 60, 62, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 42, 44, 62, 92, 126, 127, 0, 31,
- 43, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 60, 62, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 44, 92, 127,
- 0, 31, 9, 13, 32, 44, 60, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 44, 0, 8,
- 11, 127, 9, 13, 32, 34, 44, 60,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 42, 44, 92, 126, 127,
- 0, 31, 43, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 42, 43, 58, 126, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 37, 39, 58, 60, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 58, 60, 9, 13,
- 32, 44, 9, 13, 32, 33, 34, 37,
- 39, 44, 60, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 37, 39, 44, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 60, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 60, 9, 13, 32, 44,
- 65, 90, 97, 122, 9, 13, 32, 44,
- 58, 43, 46, 48, 57, 65, 90, 97,
- 122, 9, 13, 32, 44, 58, 9, 13,
- 32, 44, 9, 13, 32, 44, 62, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 62, 126, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 62, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 60, 62, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 60, 62, 9, 13, 32,
- 44, 62, 65, 90, 97, 122, 9, 13,
- 32, 34, 44, 62, 92, 127, 0, 31,
- 9, 13, 32, 44, 60, 62, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 62,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 62,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 62, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 62, 0, 8, 11, 127, 9, 13, 32,
- 34, 44, 60, 62, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 42,
- 44, 58, 62, 92, 126, 127, 0, 31,
- 43, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 58, 60, 62, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 62,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 62, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 62,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 62,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 62, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 62, 0, 8, 11, 127, 9, 13, 32,
- 33, 34, 37, 39, 42, 44, 58, 62,
- 92, 126, 127, 0, 31, 43, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 58,
- 60, 62, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 58, 60, 9, 13, 32,
- 44, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 0, 8, 11, 127, 9,
- 13, 32, 33, 34, 37, 39, 42, 44,
- 92, 126, 127, 0, 31, 43, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 65, 90, 97, 122, 9, 13, 32,
- 44, 58, 43, 46, 48, 57, 65, 90,
- 97, 122, 9, 13, 32, 44, 58, 9,
- 13, 32, 44, 9, 13, 32, 44, 62,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 60, 62, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 62, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 60, 62, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 60, 62, 9, 13, 32, 44,
- 62, 65, 90, 97, 122, 9, 13, 32,
- 44, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 126, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 37, 39, 44, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 60, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 60, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 44,
- 60, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 0, 8, 11, 127, 9, 13, 32, 34,
- 44, 60, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 42, 44, 92,
- 126, 127, 0, 31, 43, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 42, 44, 58, 126, 43, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 37, 39, 44, 58,
- 60, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 44, 62,
- 92, 127, 0, 31, 9, 13, 32, 44,
- 60, 62, 9, 13, 32, 33, 34, 37,
- 39, 44, 60, 62, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 96, 97, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 62, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 62, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 62, 0, 8, 11,
- 127, 9, 13, 32, 34, 44, 60, 62,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 42, 44, 62, 92, 126,
- 127, 0, 31, 43, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 62, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 58,
- 60, 62, 10, 62, 9, 32, 62, 9,
- 32, 60, 62, 62, 65, 90, 97, 122,
- 62, 9, 13, 32, 44, 62, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 62,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 62, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 60, 62, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 60, 62, 9, 13, 32, 44, 62, 65,
- 90, 97, 122, 9, 13, 32, 44, 58,
- 62, 43, 46, 48, 57, 65, 90, 97,
- 122, 9, 13, 32, 44, 58, 62, 9,
- 13, 32, 44, 62, 9, 13, 32, 34,
- 44, 62, 92, 127, 0, 31, 9, 13,
- 32, 44, 60, 62, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 62, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 62, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 60, 62, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 44, 62, 0,
- 8, 11, 127, 9, 13, 32, 34, 44,
- 60, 62, 92, 127, 0, 31, 9, 13,
- 32, 33, 34, 37, 39, 42, 44, 62,
- 92, 126, 127, 0, 31, 43, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 62, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 44, 62, 92, 127, 0, 31,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 60, 62, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 62, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 37, 39, 42, 44, 58, 62,
- 126, 43, 46, 48, 57, 65, 90, 95,
- 96, 97, 122, 9, 13, 32, 33, 37,
- 39, 44, 58, 60, 62, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 58, 60, 62, 9, 13, 32,
- 44, 62, 9, 13, 32, 34, 44, 60,
- 62, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 62, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 34, 37, 39, 42, 44, 58,
- 62, 92, 126, 127, 0, 31, 43, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 58, 60, 62, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 44, 60, 9, 13,
- 32, 33, 34, 37, 39, 44, 60, 92,
- 126, 127, 0, 31, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 34, 37, 39, 44, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 60, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 0, 8, 11,
- 127, 9, 13, 32, 34, 44, 60, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 42, 44, 58, 92, 126, 127,
- 0, 31, 43, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 58, 60, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 44,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 44, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 44, 60, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 0, 8, 11, 127,
- 9, 13, 32, 33, 34, 37, 39, 42,
- 44, 58, 92, 126, 127, 0, 31, 43,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 58, 60, 92, 126, 127, 0, 31,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 34, 44, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 126, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 37, 39, 42, 44, 58, 126, 43,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 58, 60, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 58,
- 60, 9, 13, 32, 44, 9, 13, 32,
- 34, 44, 60, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 34, 37, 39, 42, 44,
- 58, 92, 126, 127, 0, 31, 43, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 58, 60, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 0
-};
+ /* #line 86 "./src/headers/tsip_header_P_Asserted_Identity.c" */
+ static const char _tsip_machine_parser_header_P_Asserted_Identity_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 2, 1, 0,
+ 2, 3, 4, 3, 1, 3, 4, 3,
+ 2, 3, 4, 3, 3, 4, 1, 3,
+ 3, 4, 2
+ };
-static const char _tsip_machine_parser_header_P_Asserted_Identity_single_lengths[] = {
- 0, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 3, 9, 1, 2,
- 9, 1, 2, 3, 0, 4, 3, 0,
- 1, 4, 1, 9, 1, 2, 9, 7,
- 8, 4, 1, 2, 4, 1, 2, 4,
- 0, 10, 9, 5, 0, 4, 10, 8,
- 9, 5, 4, 5, 5, 4, 5, 11,
- 9, 10, 6, 5, 8, 6, 13, 12,
- 13, 5, 9, 13, 13, 7, 5, 12,
- 11, 12, 4, 8, 12, 12, 10, 9,
- 5, 0, 4, 10, 8, 9, 5, 4,
- 5, 5, 4, 5, 11, 9, 10, 6,
- 5, 8, 6, 13, 12, 13, 5, 9,
- 14, 14, 8, 8, 13, 12, 13, 5,
- 14, 14, 6, 4, 10, 7, 12, 11,
- 12, 4, 12, 12, 4, 5, 5, 4,
- 5, 11, 9, 10, 6, 5, 4, 10,
- 8, 9, 5, 7, 5, 12, 11, 12,
- 4, 8, 12, 12, 10, 10, 8, 6,
- 13, 12, 13, 5, 9, 13, 13, 6,
- 2, 3, 4, 1, 1, 5, 11, 9,
- 10, 6, 5, 6, 6, 5, 8, 6,
- 13, 12, 13, 5, 9, 13, 13, 8,
- 13, 11, 11, 11, 7, 5, 9, 13,
- 14, 14, 7, 5, 12, 11, 12, 4,
- 8, 13, 13, 7, 7, 12, 11, 12,
- 4, 13, 13, 7, 12, 10, 10, 10,
- 6, 4, 8, 12, 13, 13, 0
-};
+ static const short _tsip_machine_parser_header_P_Asserted_Identity_key_offsets[] = {
+ 0, 0, 2, 3, 5, 7, 9, 11,
+ 13, 15, 17, 19, 20, 22, 24, 26,
+ 28, 30, 32, 34, 36, 39, 60, 61,
+ 63, 84, 85, 87, 90, 94, 106, 109,
+ 109, 110, 114, 115, 136, 137, 139, 160,
+ 177, 195, 199, 200, 202, 210, 211, 213,
+ 217, 223, 243, 262, 267, 267, 271, 289,
+ 305, 322, 327, 335, 348, 353, 357, 362,
+ 381, 398, 416, 422, 431, 441, 447, 472,
+ 494, 517, 526, 537, 562, 585, 594, 599,
+ 623, 644, 666, 674, 684, 708, 730, 750,
+ 769, 774, 774, 778, 798, 814, 831, 836,
+ 844, 857, 862, 866, 871, 892, 909, 927,
+ 933, 942, 952, 958, 983, 1005, 1028, 1037,
+ 1048, 1074, 1098, 1108, 1118, 1143, 1165, 1188,
+ 1197, 1223, 1247, 1253, 1257, 1275, 1284, 1308,
+ 1329, 1351, 1359, 1383, 1405, 1413, 1426, 1431,
+ 1435, 1440, 1459, 1476, 1494, 1500, 1509, 1513,
+ 1533, 1549, 1566, 1571, 1580, 1585, 1609, 1630,
+ 1652, 1660, 1670, 1694, 1716, 1736, 1754, 1764,
+ 1770, 1795, 1817, 1840, 1849, 1860, 1885, 1908,
+ 1914, 1916, 1919, 1923, 1928, 1929, 1934, 1953,
+ 1970, 1988, 1994, 2003, 2017, 2023, 2028, 2038,
+ 2044, 2069, 2091, 2114, 2123, 2134, 2159, 2182,
+ 2192, 2217, 2238, 2259, 2278, 2285, 2290, 2301,
+ 2326, 2352, 2376, 2385, 2390, 2414, 2435, 2457,
+ 2465, 2475, 2500, 2523, 2532, 2541, 2565, 2586,
+ 2608, 2616, 2641, 2664, 2673, 2697, 2717, 2737,
+ 2755, 2761, 2765, 2775, 2799, 2824, 2847
+ };
-static const char _tsip_machine_parser_header_P_Asserted_Identity_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 6, 0, 0,
- 6, 0, 0, 0, 2, 4, 0, 0,
- 0, 0, 0, 6, 0, 0, 6, 5,
- 5, 0, 0, 0, 2, 0, 0, 0,
- 3, 5, 5, 0, 0, 0, 4, 4,
- 4, 0, 2, 4, 0, 0, 0, 4,
- 4, 4, 0, 2, 1, 0, 6, 5,
- 5, 2, 1, 6, 5, 1, 0, 6,
- 5, 5, 2, 1, 6, 5, 5, 5,
- 0, 0, 0, 5, 4, 4, 0, 2,
- 4, 0, 0, 0, 5, 4, 4, 0,
- 2, 1, 0, 6, 5, 5, 2, 1,
- 6, 5, 1, 1, 6, 5, 5, 2,
- 6, 5, 0, 0, 4, 1, 6, 5,
- 5, 2, 6, 5, 2, 4, 0, 0,
- 0, 4, 4, 4, 0, 2, 0, 5,
- 4, 4, 0, 1, 0, 6, 5, 5,
- 2, 1, 6, 5, 5, 4, 1, 0,
- 6, 5, 5, 2, 1, 6, 5, 0,
- 0, 0, 0, 2, 0, 0, 4, 4,
- 4, 0, 2, 4, 0, 0, 1, 0,
- 6, 5, 5, 2, 1, 6, 5, 1,
- 6, 5, 5, 4, 0, 0, 1, 6,
- 6, 5, 1, 0, 6, 5, 5, 2,
- 1, 6, 5, 1, 1, 6, 5, 5,
- 2, 6, 5, 1, 6, 5, 5, 4,
- 0, 0, 1, 6, 6, 5, 0
-};
+ static const char _tsip_machine_parser_header_P_Asserted_Identity_trans_keys[] = {
+ 80, 112, 45, 65, 97, 83, 115, 83,
+ 115, 69, 101, 82, 114, 84, 116, 69,
+ 101, 68, 100, 45, 73, 105, 68, 100,
+ 69, 101, 78, 110, 84, 116, 73, 105,
+ 84, 116, 89, 121, 9, 32, 58, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 10, 9, 32, 9,
+ 32, 60, 65, 90, 97, 122, 9, 32,
+ 43, 58, 45, 46, 48, 57, 65, 90,
+ 97, 122, 9, 32, 58, 62, 9, 13,
+ 32, 44, 10, 9, 13, 32, 33, 34,
+ 37, 39, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 60,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 60, 10,
+ 9, 32, 13, 34, 92, 127, 0, 8,
+ 10, 31, 10, 9, 32, 9, 13, 32,
+ 60, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 42, 43, 58,
+ 126, 45, 46, 48, 57, 65, 90, 95,
+ 96, 97, 122, 9, 13, 32, 33, 37,
+ 39, 58, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 58, 60, 9, 13, 32, 44, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 60, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 44, 60, 9,
+ 13, 32, 44, 65, 90, 97, 122, 9,
+ 13, 32, 44, 58, 43, 46, 48, 57,
+ 65, 90, 97, 122, 9, 13, 32, 44,
+ 58, 9, 13, 32, 44, 9, 13, 32,
+ 44, 62, 9, 13, 32, 33, 34, 37,
+ 39, 44, 60, 62, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 62, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 60, 62, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 60, 62, 9, 13,
+ 32, 44, 62, 65, 90, 97, 122, 9,
+ 13, 32, 34, 44, 62, 92, 127, 0,
+ 31, 9, 13, 32, 44, 60, 62, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 62, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 62, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 62,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 62, 0, 8, 11, 127, 9, 13,
+ 32, 34, 44, 60, 62, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 42, 44, 62, 92, 126, 127, 0, 31,
+ 43, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 60, 62, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 44, 92, 127,
+ 0, 31, 9, 13, 32, 44, 60, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 44, 0, 8,
+ 11, 127, 9, 13, 32, 34, 44, 60,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 42, 44, 92, 126, 127,
+ 0, 31, 43, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 42, 43, 58, 126, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 37, 39, 58, 60, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 58, 60, 9, 13,
+ 32, 44, 9, 13, 32, 33, 34, 37,
+ 39, 44, 60, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 37, 39, 44, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 60, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 60, 9, 13, 32, 44,
+ 65, 90, 97, 122, 9, 13, 32, 44,
+ 58, 43, 46, 48, 57, 65, 90, 97,
+ 122, 9, 13, 32, 44, 58, 9, 13,
+ 32, 44, 9, 13, 32, 44, 62, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 62, 126, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 62, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 60, 62, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 60, 62, 9, 13, 32,
+ 44, 62, 65, 90, 97, 122, 9, 13,
+ 32, 34, 44, 62, 92, 127, 0, 31,
+ 9, 13, 32, 44, 60, 62, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 62,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 62,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 62, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 62, 0, 8, 11, 127, 9, 13, 32,
+ 34, 44, 60, 62, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 42,
+ 44, 58, 62, 92, 126, 127, 0, 31,
+ 43, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 58, 60, 62, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 62,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 62, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 62,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 62,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 62, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 62, 0, 8, 11, 127, 9, 13, 32,
+ 33, 34, 37, 39, 42, 44, 58, 62,
+ 92, 126, 127, 0, 31, 43, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 58,
+ 60, 62, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 58, 60, 9, 13, 32,
+ 44, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 0, 8, 11, 127, 9,
+ 13, 32, 33, 34, 37, 39, 42, 44,
+ 92, 126, 127, 0, 31, 43, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 65, 90, 97, 122, 9, 13, 32,
+ 44, 58, 43, 46, 48, 57, 65, 90,
+ 97, 122, 9, 13, 32, 44, 58, 9,
+ 13, 32, 44, 9, 13, 32, 44, 62,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 60, 62, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 62, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 60, 62, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 60, 62, 9, 13, 32, 44,
+ 62, 65, 90, 97, 122, 9, 13, 32,
+ 44, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 126, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 37, 39, 44, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 60, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 60, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 44,
+ 60, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 0, 8, 11, 127, 9, 13, 32, 34,
+ 44, 60, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 42, 44, 92,
+ 126, 127, 0, 31, 43, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 42, 44, 58, 126, 43, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 37, 39, 44, 58,
+ 60, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 44, 62,
+ 92, 127, 0, 31, 9, 13, 32, 44,
+ 60, 62, 9, 13, 32, 33, 34, 37,
+ 39, 44, 60, 62, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 96, 97, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 62, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 62, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 62, 0, 8, 11,
+ 127, 9, 13, 32, 34, 44, 60, 62,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 42, 44, 62, 92, 126,
+ 127, 0, 31, 43, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 62, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 58,
+ 60, 62, 10, 62, 9, 32, 62, 9,
+ 32, 60, 62, 62, 65, 90, 97, 122,
+ 62, 9, 13, 32, 44, 62, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 62,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 62, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 60, 62, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 60, 62, 9, 13, 32, 44, 62, 65,
+ 90, 97, 122, 9, 13, 32, 44, 58,
+ 62, 43, 46, 48, 57, 65, 90, 97,
+ 122, 9, 13, 32, 44, 58, 62, 9,
+ 13, 32, 44, 62, 9, 13, 32, 34,
+ 44, 62, 92, 127, 0, 31, 9, 13,
+ 32, 44, 60, 62, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 62, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 62, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 60, 62, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 44, 62, 0,
+ 8, 11, 127, 9, 13, 32, 34, 44,
+ 60, 62, 92, 127, 0, 31, 9, 13,
+ 32, 33, 34, 37, 39, 42, 44, 62,
+ 92, 126, 127, 0, 31, 43, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 62, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 44, 62, 92, 127, 0, 31,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 60, 62, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 62, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 37, 39, 42, 44, 58, 62,
+ 126, 43, 46, 48, 57, 65, 90, 95,
+ 96, 97, 122, 9, 13, 32, 33, 37,
+ 39, 44, 58, 60, 62, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 58, 60, 62, 9, 13, 32,
+ 44, 62, 9, 13, 32, 34, 44, 60,
+ 62, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 62, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 34, 37, 39, 42, 44, 58,
+ 62, 92, 126, 127, 0, 31, 43, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 58, 60, 62, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 44, 60, 9, 13,
+ 32, 33, 34, 37, 39, 44, 60, 92,
+ 126, 127, 0, 31, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 34, 37, 39, 44, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 60, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 0, 8, 11,
+ 127, 9, 13, 32, 34, 44, 60, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 42, 44, 58, 92, 126, 127,
+ 0, 31, 43, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 58, 60, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 44,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 44, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 44, 60, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 0, 8, 11, 127,
+ 9, 13, 32, 33, 34, 37, 39, 42,
+ 44, 58, 92, 126, 127, 0, 31, 43,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 58, 60, 92, 126, 127, 0, 31,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 34, 44, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 126, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 37, 39, 42, 44, 58, 126, 43,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 58, 60, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 58,
+ 60, 9, 13, 32, 44, 9, 13, 32,
+ 34, 44, 60, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 34, 37, 39, 42, 44,
+ 58, 92, 126, 127, 0, 31, 43, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 58, 60, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 0
+ };
-static const short _tsip_machine_parser_header_P_Asserted_Identity_index_offsets[] = {
- 0, 0, 3, 5, 8, 11, 14, 17,
- 20, 23, 26, 29, 31, 34, 37, 40,
- 43, 46, 49, 52, 55, 59, 75, 77,
- 80, 96, 98, 101, 105, 108, 117, 121,
- 122, 124, 129, 131, 147, 149, 152, 168,
- 181, 195, 200, 202, 205, 212, 214, 217,
- 222, 226, 242, 257, 263, 264, 269, 284,
- 297, 311, 317, 324, 334, 340, 345, 351,
- 367, 381, 396, 403, 411, 421, 428, 448,
- 466, 485, 493, 504, 524, 543, 552, 558,
- 577, 594, 612, 619, 629, 648, 666, 682,
- 697, 703, 704, 709, 725, 738, 752, 758,
- 765, 775, 781, 786, 792, 809, 823, 838,
- 845, 853, 863, 870, 890, 908, 927, 935,
- 946, 967, 987, 997, 1007, 1027, 1045, 1064,
- 1072, 1093, 1113, 1120, 1125, 1140, 1149, 1168,
- 1185, 1203, 1210, 1229, 1247, 1254, 1264, 1270,
- 1275, 1281, 1297, 1311, 1326, 1333, 1341, 1346,
- 1362, 1375, 1389, 1395, 1404, 1410, 1429, 1446,
- 1464, 1471, 1481, 1500, 1518, 1534, 1549, 1559,
- 1566, 1586, 1604, 1623, 1631, 1642, 1662, 1681,
- 1688, 1691, 1695, 1700, 1704, 1706, 1712, 1728,
- 1742, 1757, 1764, 1772, 1783, 1790, 1796, 1806,
- 1813, 1833, 1851, 1870, 1878, 1889, 1909, 1928,
- 1938, 1958, 1975, 1992, 2008, 2016, 2022, 2033,
- 2053, 2074, 2094, 2103, 2109, 2128, 2145, 2163,
- 2170, 2180, 2200, 2219, 2228, 2237, 2256, 2273,
- 2291, 2298, 2318, 2337, 2346, 2365, 2381, 2397,
- 2412, 2419, 2424, 2434, 2453, 2473, 2492
-};
+ static const char _tsip_machine_parser_header_P_Asserted_Identity_single_lengths[] = {
+ 0, 2, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 3, 9, 1, 2,
+ 9, 1, 2, 3, 0, 4, 3, 0,
+ 1, 4, 1, 9, 1, 2, 9, 7,
+ 8, 4, 1, 2, 4, 1, 2, 4,
+ 0, 10, 9, 5, 0, 4, 10, 8,
+ 9, 5, 4, 5, 5, 4, 5, 11,
+ 9, 10, 6, 5, 8, 6, 13, 12,
+ 13, 5, 9, 13, 13, 7, 5, 12,
+ 11, 12, 4, 8, 12, 12, 10, 9,
+ 5, 0, 4, 10, 8, 9, 5, 4,
+ 5, 5, 4, 5, 11, 9, 10, 6,
+ 5, 8, 6, 13, 12, 13, 5, 9,
+ 14, 14, 8, 8, 13, 12, 13, 5,
+ 14, 14, 6, 4, 10, 7, 12, 11,
+ 12, 4, 12, 12, 4, 5, 5, 4,
+ 5, 11, 9, 10, 6, 5, 4, 10,
+ 8, 9, 5, 7, 5, 12, 11, 12,
+ 4, 8, 12, 12, 10, 10, 8, 6,
+ 13, 12, 13, 5, 9, 13, 13, 6,
+ 2, 3, 4, 1, 1, 5, 11, 9,
+ 10, 6, 5, 6, 6, 5, 8, 6,
+ 13, 12, 13, 5, 9, 13, 13, 8,
+ 13, 11, 11, 11, 7, 5, 9, 13,
+ 14, 14, 7, 5, 12, 11, 12, 4,
+ 8, 13, 13, 7, 7, 12, 11, 12,
+ 4, 13, 13, 7, 12, 10, 10, 10,
+ 6, 4, 8, 12, 13, 13, 0
+ };
-static const unsigned char _tsip_machine_parser_header_P_Asserted_Identity_trans_targs[] = {
- 2, 2, 0, 3, 0, 4, 4, 0,
- 5, 5, 0, 6, 6, 0, 7, 7,
- 0, 8, 8, 0, 9, 9, 0, 10,
- 10, 0, 11, 11, 0, 12, 0, 13,
- 13, 0, 14, 14, 0, 15, 15, 0,
- 16, 16, 0, 17, 17, 0, 18, 18,
- 0, 19, 19, 0, 20, 20, 0, 20,
- 20, 21, 0, 21, 22, 21, 39, 44,
- 39, 39, 28, 39, 39, 39, 39, 86,
- 39, 86, 0, 23, 0, 24, 24, 0,
- 24, 25, 24, 39, 44, 39, 39, 28,
- 39, 39, 39, 39, 86, 39, 86, 0,
- 26, 0, 27, 27, 0, 27, 27, 28,
- 0, 29, 29, 0, 30, 30, 29, 31,
- 29, 29, 29, 29, 0, 30, 30, 31,
- 0, 32, 33, 32, 33, 34, 33, 35,
- 0, 230, 0, 35, 36, 35, 39, 44,
- 39, 39, 28, 39, 39, 39, 39, 49,
- 39, 49, 0, 37, 0, 38, 38, 0,
- 38, 25, 38, 39, 44, 39, 39, 28,
- 39, 39, 39, 39, 49, 39, 49, 0,
- 40, 42, 40, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 0, 41, 25, 41,
- 39, 39, 39, 28, 39, 39, 39, 39,
- 39, 39, 0, 41, 25, 41, 28, 0,
- 43, 0, 40, 40, 0, 45, 47, 48,
- 0, 0, 0, 44, 46, 0, 44, 44,
- 0, 41, 25, 41, 28, 0, 44, 44,
- 44, 0, 50, 42, 50, 39, 39, 39,
- 39, 49, 52, 39, 49, 49, 49, 39,
- 49, 0, 51, 25, 51, 39, 39, 39,
- 52, 28, 39, 39, 39, 39, 39, 39,
- 0, 51, 25, 51, 52, 28, 0, 53,
- 53, 34, 53, 54, 53, 54, 34, 54,
- 55, 77, 55, 55, 54, 58, 55, 55,
- 55, 55, 55, 53, 56, 34, 56, 55,
- 55, 55, 54, 55, 55, 55, 55, 55,
- 53, 57, 34, 57, 55, 55, 55, 54,
- 58, 55, 55, 55, 55, 55, 53, 57,
- 34, 57, 54, 58, 53, 53, 34, 53,
- 54, 59, 59, 53, 60, 34, 60, 54,
- 61, 59, 59, 59, 59, 53, 60, 34,
- 60, 54, 61, 53, 62, 34, 62, 63,
- 62, 62, 34, 62, 63, 53, 62, 63,
- 34, 63, 64, 68, 64, 64, 63, 67,
- 53, 64, 64, 64, 64, 64, 62, 65,
- 34, 65, 64, 64, 64, 63, 53, 64,
- 64, 64, 64, 64, 62, 66, 34, 66,
- 64, 64, 64, 63, 67, 53, 64, 64,
- 64, 64, 64, 62, 66, 34, 66, 63,
- 67, 53, 62, 62, 34, 62, 63, 53,
- 62, 62, 62, 68, 34, 68, 69, 70,
- 53, 73, 62, 62, 68, 66, 34, 66,
- 63, 67, 53, 62, 63, 34, 63, 71,
- 74, 71, 71, 70, 67, 53, 73, 71,
- 62, 62, 71, 71, 75, 71, 75, 68,
- 72, 34, 72, 71, 69, 71, 71, 70,
- 53, 73, 71, 62, 62, 71, 71, 71,
- 71, 68, 66, 34, 66, 71, 69, 71,
- 71, 70, 67, 53, 73, 71, 62, 62,
- 71, 71, 71, 71, 68, 68, 34, 68,
- 70, 53, 68, 68, 62, 66, 34, 66,
- 69, 70, 67, 53, 73, 62, 62, 68,
- 76, 34, 76, 71, 69, 71, 71, 71,
- 70, 53, 73, 71, 62, 62, 75, 75,
- 75, 71, 75, 68, 51, 34, 51, 71,
- 69, 71, 71, 70, 28, 53, 73, 71,
- 62, 62, 71, 71, 71, 71, 68, 77,
- 34, 77, 78, 79, 82, 53, 53, 77,
- 57, 34, 57, 54, 58, 53, 54, 34,
- 54, 80, 83, 80, 80, 79, 58, 82,
- 80, 53, 53, 80, 80, 84, 80, 84,
- 77, 81, 34, 81, 80, 78, 80, 80,
- 79, 82, 80, 53, 53, 80, 80, 80,
- 80, 77, 57, 34, 57, 80, 78, 80,
- 80, 79, 58, 82, 80, 53, 53, 80,
- 80, 80, 80, 77, 77, 34, 77, 79,
- 77, 77, 53, 57, 34, 57, 78, 79,
- 58, 82, 53, 53, 77, 85, 34, 85,
- 80, 78, 80, 80, 80, 79, 82, 80,
- 53, 53, 84, 84, 84, 80, 84, 77,
- 51, 34, 51, 80, 78, 80, 80, 79,
- 28, 82, 80, 53, 53, 80, 80, 80,
- 80, 77, 87, 42, 87, 39, 39, 39,
- 39, 86, 89, 39, 86, 86, 86, 39,
- 86, 0, 88, 25, 88, 39, 39, 39,
- 89, 28, 39, 39, 39, 39, 39, 39,
- 0, 88, 25, 88, 89, 28, 0, 90,
- 90, 34, 90, 91, 90, 91, 34, 91,
- 92, 202, 92, 92, 91, 95, 92, 92,
- 92, 222, 92, 222, 90, 93, 34, 93,
- 92, 92, 92, 91, 92, 92, 92, 92,
- 92, 90, 94, 34, 94, 92, 92, 92,
- 91, 95, 92, 92, 92, 92, 92, 90,
- 94, 34, 94, 91, 95, 90, 90, 34,
- 90, 91, 96, 96, 90, 97, 34, 97,
- 91, 98, 96, 96, 96, 96, 90, 97,
- 34, 97, 91, 98, 90, 99, 34, 99,
- 100, 99, 99, 34, 99, 100, 90, 99,
- 100, 34, 100, 101, 105, 101, 101, 100,
- 104, 90, 101, 101, 101, 194, 101, 194,
- 99, 102, 34, 102, 101, 101, 101, 100,
- 90, 101, 101, 101, 101, 101, 99, 103,
- 34, 103, 101, 101, 101, 100, 104, 90,
- 101, 101, 101, 101, 101, 99, 103, 34,
- 103, 100, 104, 90, 99, 99, 34, 99,
- 100, 90, 99, 99, 99, 105, 34, 105,
- 106, 107, 90, 110, 99, 99, 105, 103,
- 34, 103, 100, 104, 90, 99, 100, 34,
- 100, 108, 111, 108, 108, 107, 104, 90,
- 110, 108, 99, 99, 108, 108, 112, 108,
- 112, 105, 109, 34, 109, 108, 106, 108,
- 108, 107, 90, 110, 108, 99, 99, 108,
- 108, 108, 108, 105, 103, 34, 103, 108,
- 106, 108, 108, 107, 104, 90, 110, 108,
- 99, 99, 108, 108, 108, 108, 105, 105,
- 34, 105, 107, 90, 105, 105, 99, 103,
- 34, 103, 106, 107, 104, 90, 110, 99,
- 99, 105, 113, 34, 113, 108, 106, 108,
- 108, 108, 107, 114, 90, 110, 108, 99,
- 99, 112, 112, 112, 108, 112, 105, 51,
- 34, 51, 108, 106, 108, 108, 107, 114,
- 28, 90, 110, 108, 99, 99, 108, 108,
- 108, 108, 105, 115, 34, 115, 106, 199,
- 90, 119, 99, 99, 115, 115, 34, 115,
- 106, 116, 90, 119, 99, 99, 115, 100,
- 34, 100, 117, 111, 117, 117, 116, 104,
- 90, 119, 117, 99, 99, 117, 117, 120,
- 117, 120, 115, 118, 34, 118, 117, 106,
- 117, 117, 116, 90, 119, 117, 99, 99,
- 117, 117, 117, 117, 115, 103, 34, 103,
- 117, 106, 117, 117, 116, 104, 90, 119,
- 117, 99, 99, 117, 117, 117, 117, 115,
- 115, 34, 115, 116, 90, 115, 115, 99,
- 121, 34, 121, 117, 106, 117, 117, 117,
- 116, 191, 90, 119, 117, 99, 99, 120,
- 120, 120, 117, 120, 115, 122, 34, 122,
- 117, 106, 117, 117, 116, 191, 132, 90,
- 119, 117, 99, 99, 117, 117, 117, 117,
- 115, 122, 34, 122, 54, 123, 132, 53,
- 53, 34, 53, 124, 53, 124, 34, 124,
- 55, 125, 55, 55, 54, 58, 55, 55,
- 55, 55, 55, 53, 125, 34, 125, 78,
- 126, 129, 53, 53, 125, 54, 34, 54,
- 127, 83, 127, 127, 126, 58, 129, 127,
- 53, 53, 127, 127, 130, 127, 130, 125,
- 128, 34, 128, 127, 78, 127, 127, 126,
- 129, 127, 53, 53, 127, 127, 127, 127,
- 125, 57, 34, 57, 127, 78, 127, 127,
- 126, 58, 129, 127, 53, 53, 127, 127,
- 127, 127, 125, 125, 34, 125, 126, 125,
- 125, 53, 131, 34, 131, 127, 78, 127,
- 127, 127, 126, 129, 127, 53, 53, 130,
- 130, 130, 127, 130, 125, 122, 34, 122,
- 127, 78, 127, 127, 126, 132, 129, 127,
- 53, 53, 127, 127, 127, 127, 125, 53,
- 34, 53, 54, 133, 133, 53, 134, 34,
- 134, 54, 135, 133, 133, 133, 133, 53,
- 134, 34, 134, 54, 135, 53, 136, 34,
- 136, 137, 136, 136, 34, 136, 137, 142,
- 136, 137, 34, 137, 138, 158, 138, 138,
- 137, 141, 142, 138, 138, 138, 138, 138,
- 136, 139, 34, 139, 138, 138, 138, 137,
- 142, 138, 138, 138, 138, 138, 136, 140,
- 34, 140, 138, 138, 138, 137, 141, 142,
- 138, 138, 138, 138, 138, 136, 140, 34,
- 140, 137, 141, 142, 136, 136, 34, 136,
- 137, 142, 136, 136, 136, 142, 34, 142,
- 143, 53, 143, 34, 143, 144, 147, 144,
- 144, 54, 132, 144, 144, 144, 156, 144,
- 156, 53, 145, 34, 145, 144, 144, 144,
- 54, 144, 144, 144, 144, 144, 53, 146,
- 34, 146, 144, 144, 144, 54, 132, 144,
- 144, 144, 144, 144, 53, 146, 34, 146,
- 54, 132, 53, 147, 34, 147, 148, 149,
- 152, 53, 53, 147, 146, 34, 146, 54,
- 132, 53, 54, 34, 54, 150, 153, 150,
- 150, 149, 58, 152, 150, 53, 53, 150,
- 150, 154, 150, 154, 147, 151, 34, 151,
- 150, 148, 150, 150, 149, 152, 150, 53,
- 53, 150, 150, 150, 150, 147, 57, 34,
- 57, 150, 148, 150, 150, 149, 58, 152,
- 150, 53, 53, 150, 150, 150, 150, 147,
- 147, 34, 147, 149, 147, 147, 53, 146,
- 34, 146, 78, 79, 132, 82, 53, 53,
- 77, 155, 34, 155, 150, 148, 150, 150,
- 150, 149, 152, 150, 53, 53, 154, 154,
- 154, 150, 154, 147, 51, 34, 51, 150,
- 148, 150, 150, 149, 28, 152, 150, 53,
- 53, 150, 150, 150, 150, 147, 157, 34,
- 157, 144, 144, 144, 144, 54, 123, 144,
- 156, 156, 156, 144, 156, 53, 122, 34,
- 122, 144, 144, 144, 54, 123, 132, 144,
- 144, 144, 144, 144, 53, 158, 34, 158,
- 159, 160, 142, 163, 136, 136, 158, 140,
- 34, 140, 137, 141, 142, 136, 137, 34,
- 137, 161, 164, 161, 161, 160, 141, 142,
- 163, 161, 136, 136, 161, 161, 165, 161,
- 165, 158, 162, 34, 162, 161, 159, 161,
- 161, 160, 142, 163, 161, 136, 136, 161,
- 161, 161, 161, 158, 140, 34, 140, 161,
- 159, 161, 161, 160, 141, 142, 163, 161,
- 136, 136, 161, 161, 161, 161, 158, 158,
- 34, 158, 160, 142, 158, 158, 136, 140,
- 34, 140, 159, 160, 141, 142, 163, 136,
- 136, 158, 166, 34, 166, 161, 159, 161,
- 161, 161, 160, 142, 163, 161, 136, 136,
- 165, 165, 165, 161, 165, 158, 167, 34,
- 167, 161, 159, 161, 161, 160, 171, 142,
- 163, 161, 136, 136, 161, 161, 161, 161,
- 158, 167, 168, 167, 172, 171, 33, 32,
- 169, 33, 32, 170, 170, 33, 32, 170,
- 170, 171, 33, 32, 33, 32, 32, 32,
- 142, 173, 173, 34, 173, 174, 142, 173,
- 174, 34, 174, 175, 182, 175, 175, 174,
- 178, 142, 175, 175, 175, 175, 175, 173,
- 176, 34, 176, 175, 175, 175, 174, 142,
- 175, 175, 175, 175, 175, 173, 177, 34,
- 177, 175, 175, 175, 174, 178, 142, 175,
- 175, 175, 175, 175, 173, 177, 34, 177,
- 174, 178, 142, 173, 173, 34, 173, 174,
- 142, 179, 179, 173, 180, 34, 180, 174,
- 181, 142, 179, 179, 179, 179, 173, 180,
- 34, 180, 174, 181, 142, 173, 136, 34,
- 136, 137, 33, 136, 182, 34, 182, 183,
- 184, 33, 187, 173, 173, 182, 177, 34,
- 177, 174, 178, 142, 173, 174, 34, 174,
- 185, 188, 185, 185, 184, 178, 33, 187,
- 185, 173, 173, 185, 185, 189, 185, 189,
- 182, 186, 34, 186, 185, 183, 185, 185,
- 184, 33, 187, 185, 173, 173, 185, 185,
- 185, 185, 182, 177, 34, 177, 185, 183,
- 185, 185, 184, 178, 33, 187, 185, 173,
- 173, 185, 185, 185, 185, 182, 182, 34,
- 182, 184, 33, 182, 182, 173, 177, 34,
- 177, 183, 184, 178, 33, 187, 173, 173,
- 182, 190, 34, 190, 185, 183, 185, 185,
- 185, 184, 33, 187, 185, 173, 173, 189,
- 189, 189, 185, 189, 182, 167, 34, 167,
- 185, 183, 185, 185, 184, 171, 33, 187,
- 185, 173, 173, 185, 185, 185, 185, 182,
- 115, 34, 115, 106, 192, 90, 119, 99,
- 99, 115, 193, 34, 193, 117, 198, 117,
- 117, 116, 104, 90, 119, 117, 99, 99,
- 117, 117, 120, 117, 120, 115, 193, 34,
- 193, 101, 115, 101, 101, 100, 104, 90,
- 101, 101, 101, 194, 101, 194, 99, 195,
- 34, 195, 101, 101, 101, 101, 100, 197,
- 90, 101, 194, 194, 194, 101, 194, 99,
- 196, 34, 196, 101, 101, 101, 100, 197,
- 104, 90, 101, 101, 101, 101, 101, 99,
- 196, 34, 196, 100, 197, 104, 90, 99,
- 99, 34, 99, 193, 90, 99, 103, 34,
- 103, 106, 116, 104, 90, 119, 99, 99,
- 115, 193, 34, 193, 117, 198, 117, 117,
- 116, 104, 90, 119, 117, 99, 99, 117,
- 117, 200, 117, 200, 115, 201, 34, 201,
- 117, 106, 117, 117, 117, 116, 191, 90,
- 119, 117, 99, 99, 200, 200, 200, 117,
- 200, 115, 51, 34, 51, 117, 106, 117,
- 117, 116, 191, 28, 90, 119, 117, 99,
- 99, 117, 117, 117, 117, 115, 202, 34,
- 202, 203, 204, 207, 90, 90, 202, 94,
- 34, 94, 91, 95, 90, 91, 34, 91,
- 205, 208, 205, 205, 204, 95, 207, 205,
- 90, 90, 205, 205, 209, 205, 209, 202,
- 206, 34, 206, 205, 203, 205, 205, 204,
- 207, 205, 90, 90, 205, 205, 205, 205,
- 202, 94, 34, 94, 205, 203, 205, 205,
- 204, 95, 207, 205, 90, 90, 205, 205,
- 205, 205, 202, 202, 34, 202, 204, 202,
- 202, 90, 94, 34, 94, 203, 204, 95,
- 207, 90, 90, 202, 210, 34, 210, 205,
- 203, 205, 205, 205, 204, 211, 207, 205,
- 90, 90, 209, 209, 209, 205, 209, 202,
- 51, 34, 51, 205, 203, 205, 205, 204,
- 211, 28, 207, 205, 90, 90, 205, 205,
- 205, 205, 202, 212, 34, 212, 203, 227,
- 216, 90, 90, 212, 212, 34, 212, 203,
- 213, 216, 90, 90, 212, 91, 34, 91,
- 214, 208, 214, 214, 213, 95, 216, 214,
- 90, 90, 214, 214, 217, 214, 217, 212,
- 215, 34, 215, 214, 203, 214, 214, 213,
- 216, 214, 90, 90, 214, 214, 214, 214,
- 212, 94, 34, 94, 214, 203, 214, 214,
- 213, 95, 216, 214, 90, 90, 214, 214,
- 214, 214, 212, 212, 34, 212, 213, 212,
- 212, 90, 218, 34, 218, 214, 203, 214,
- 214, 214, 213, 219, 216, 214, 90, 90,
- 217, 217, 217, 214, 217, 212, 122, 34,
- 122, 214, 203, 214, 214, 213, 219, 132,
- 216, 214, 90, 90, 214, 214, 214, 214,
- 212, 212, 34, 212, 203, 220, 216, 90,
- 90, 212, 221, 34, 221, 214, 226, 214,
- 214, 213, 95, 216, 214, 90, 90, 214,
- 214, 217, 214, 217, 212, 221, 34, 221,
- 92, 212, 92, 92, 91, 95, 92, 92,
- 92, 222, 92, 222, 90, 223, 34, 223,
- 92, 92, 92, 92, 91, 225, 92, 222,
- 222, 222, 92, 222, 90, 224, 34, 224,
- 92, 92, 92, 91, 225, 95, 92, 92,
- 92, 92, 92, 90, 224, 34, 224, 91,
- 225, 95, 90, 90, 34, 90, 221, 90,
- 94, 34, 94, 203, 213, 95, 216, 90,
- 90, 212, 221, 34, 221, 214, 226, 214,
- 214, 213, 95, 216, 214, 90, 90, 214,
- 214, 228, 214, 228, 212, 229, 34, 229,
- 214, 203, 214, 214, 214, 213, 219, 216,
- 214, 90, 90, 228, 228, 228, 214, 228,
- 212, 51, 34, 51, 214, 203, 214, 214,
- 213, 219, 28, 216, 214, 90, 90, 214,
- 214, 214, 214, 212, 0, 0
-};
+ static const char _tsip_machine_parser_header_P_Asserted_Identity_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 6, 0, 0,
+ 6, 0, 0, 0, 2, 4, 0, 0,
+ 0, 0, 0, 6, 0, 0, 6, 5,
+ 5, 0, 0, 0, 2, 0, 0, 0,
+ 3, 5, 5, 0, 0, 0, 4, 4,
+ 4, 0, 2, 4, 0, 0, 0, 4,
+ 4, 4, 0, 2, 1, 0, 6, 5,
+ 5, 2, 1, 6, 5, 1, 0, 6,
+ 5, 5, 2, 1, 6, 5, 5, 5,
+ 0, 0, 0, 5, 4, 4, 0, 2,
+ 4, 0, 0, 0, 5, 4, 4, 0,
+ 2, 1, 0, 6, 5, 5, 2, 1,
+ 6, 5, 1, 1, 6, 5, 5, 2,
+ 6, 5, 0, 0, 4, 1, 6, 5,
+ 5, 2, 6, 5, 2, 4, 0, 0,
+ 0, 4, 4, 4, 0, 2, 0, 5,
+ 4, 4, 0, 1, 0, 6, 5, 5,
+ 2, 1, 6, 5, 5, 4, 1, 0,
+ 6, 5, 5, 2, 1, 6, 5, 0,
+ 0, 0, 0, 2, 0, 0, 4, 4,
+ 4, 0, 2, 4, 0, 0, 1, 0,
+ 6, 5, 5, 2, 1, 6, 5, 1,
+ 6, 5, 5, 4, 0, 0, 1, 6,
+ 6, 5, 1, 0, 6, 5, 5, 2,
+ 1, 6, 5, 1, 1, 6, 5, 5,
+ 2, 6, 5, 1, 6, 5, 5, 4,
+ 0, 0, 1, 6, 6, 5, 0
+ };
-static const char _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 3, 3, 13, 13,
- 13, 13, 3, 13, 13, 13, 13, 13,
- 13, 13, 0, 0, 0, 0, 0, 0,
- 3, 3, 3, 13, 13, 13, 13, 3,
- 13, 13, 13, 13, 13, 13, 13, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7, 0, 9, 9, 9, 9,
- 0, 11, 0, 3, 3, 3, 13, 13,
- 13, 13, 3, 13, 13, 13, 13, 13,
- 13, 13, 0, 0, 0, 0, 0, 0,
- 3, 3, 3, 13, 13, 13, 13, 3,
- 13, 13, 13, 13, 13, 13, 13, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 0, 0, 0, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 19, 16, 19,
- 13, 13, 13, 13, 16, 3, 13, 13,
- 13, 13, 13, 0, 16, 16, 16, 0,
- 0, 0, 16, 0, 0, 0, 0, 0,
- 0, 23, 16, 23, 0, 0, 0, 16,
- 5, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 0, 0, 16, 16, 16,
- 16, 1, 1, 0, 16, 16, 16, 16,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 16, 0, 0, 16, 16, 16, 16,
- 0, 16, 16, 16, 16, 7, 0, 19,
- 16, 19, 13, 13, 13, 13, 16, 3,
- 7, 13, 13, 13, 13, 13, 0, 16,
- 16, 16, 0, 0, 0, 16, 7, 0,
- 0, 0, 0, 0, 0, 23, 16, 23,
- 0, 0, 0, 16, 5, 7, 0, 0,
- 0, 0, 0, 0, 16, 16, 16, 16,
- 0, 7, 0, 16, 16, 16, 16, 7,
- 1, 1, 0, 16, 16, 16, 0, 16,
- 7, 0, 0, 0, 0, 23, 16, 23,
- 16, 5, 7, 0, 19, 16, 19, 13,
- 13, 13, 13, 16, 3, 7, 0, 13,
- 0, 0, 13, 13, 13, 13, 13, 0,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 23, 16, 23, 0, 0, 0,
- 0, 16, 5, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 16, 16, 16,
- 16, 7, 0, 0, 0, 23, 16, 23,
- 0, 16, 5, 7, 0, 0, 0, 0,
- 16, 16, 16, 0, 0, 0, 0, 0,
- 16, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 16, 5, 0,
- 0, 0, 0, 16, 5, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 0, 16, 0, 0, 0, 0,
- 23, 16, 23, 16, 5, 0, 19, 16,
- 19, 13, 13, 13, 13, 16, 3, 0,
- 13, 0, 0, 13, 13, 13, 13, 13,
- 0, 16, 16, 16, 0, 0, 0, 0,
- 16, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 23, 16, 23, 0, 0, 0,
- 0, 16, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 16, 16, 16, 16,
- 0, 0, 0, 23, 16, 23, 0, 16,
- 5, 0, 0, 0, 0, 16, 16, 16,
- 0, 0, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 16, 5, 0, 0, 0, 0, 16,
- 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 27, 16, 27,
- 13, 13, 13, 13, 16, 3, 13, 13,
- 13, 13, 13, 13, 0, 16, 16, 16,
- 0, 0, 0, 16, 0, 0, 0, 0,
- 0, 0, 31, 16, 31, 0, 0, 0,
- 16, 5, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 0, 16, 16,
- 16, 16, 1, 1, 0, 16, 16, 16,
- 16, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 0, 0, 16, 16, 16,
- 16, 0, 16, 16, 16, 16, 7, 0,
- 27, 16, 27, 13, 13, 13, 13, 16,
- 3, 7, 13, 13, 13, 13, 13, 13,
- 0, 16, 16, 16, 0, 0, 0, 16,
- 7, 0, 0, 0, 0, 0, 0, 31,
- 16, 31, 0, 0, 0, 16, 5, 7,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 16, 0, 7, 0, 16, 16, 16,
- 16, 7, 1, 1, 0, 16, 16, 16,
- 0, 16, 7, 0, 0, 0, 0, 31,
- 16, 31, 16, 5, 7, 0, 27, 16,
- 27, 13, 13, 13, 13, 16, 3, 7,
- 0, 13, 0, 0, 13, 13, 13, 13,
- 13, 0, 16, 16, 16, 0, 0, 0,
- 0, 16, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 31, 16, 31, 0,
- 0, 0, 0, 16, 5, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 7, 0, 0, 0, 31,
- 16, 31, 0, 16, 5, 7, 0, 0,
- 0, 0, 16, 16, 16, 0, 0, 0,
- 0, 0, 16, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 16, 5, 0, 0, 0, 0, 16, 0,
- 5, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 0, 16,
- 7, 0, 0, 0, 0, 16, 16, 16,
- 0, 16, 7, 0, 0, 0, 0, 27,
- 16, 27, 13, 13, 13, 13, 16, 3,
- 7, 0, 13, 0, 0, 13, 13, 13,
- 13, 13, 0, 16, 16, 16, 0, 0,
- 0, 0, 16, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 16, 31,
- 0, 0, 0, 0, 16, 5, 7, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 7, 0, 0, 0,
- 16, 16, 16, 0, 0, 0, 0, 0,
- 16, 0, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 23, 16, 23,
- 0, 0, 0, 0, 16, 0, 5, 7,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 16, 16, 16, 16, 0, 0, 0,
- 16, 16, 16, 16, 0, 19, 16, 19,
- 13, 13, 13, 13, 16, 3, 13, 13,
- 13, 13, 13, 0, 16, 16, 16, 0,
- 16, 0, 0, 0, 0, 19, 16, 19,
- 13, 13, 13, 13, 16, 3, 0, 13,
- 0, 0, 13, 13, 13, 13, 13, 0,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 23, 16, 23, 0, 0, 0, 0,
- 16, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 16, 0,
- 0, 0, 16, 16, 16, 0, 0, 0,
- 0, 0, 16, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 23, 16, 23,
- 0, 0, 0, 0, 16, 5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 1, 1, 0, 16, 16,
- 16, 16, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 0, 16, 16,
- 16, 16, 0, 16, 16, 16, 16, 7,
- 0, 19, 16, 19, 13, 13, 13, 13,
- 16, 3, 7, 13, 13, 13, 13, 13,
- 0, 16, 16, 16, 0, 0, 0, 16,
- 7, 0, 0, 0, 0, 0, 0, 23,
- 16, 23, 0, 0, 0, 16, 5, 7,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 16, 0, 7, 0, 16, 16, 16,
- 16, 7, 1, 1, 0, 16, 16, 16,
- 16, 0, 19, 16, 19, 13, 13, 13,
- 13, 16, 3, 13, 13, 13, 13, 13,
- 13, 0, 16, 16, 16, 0, 0, 0,
- 16, 0, 0, 0, 0, 0, 0, 23,
- 16, 23, 0, 0, 0, 16, 5, 0,
- 0, 0, 0, 0, 0, 16, 16, 16,
- 16, 0, 0, 16, 16, 16, 0, 16,
- 0, 0, 0, 0, 23, 16, 23, 16,
- 5, 0, 19, 16, 19, 13, 13, 13,
- 13, 16, 3, 0, 13, 0, 0, 13,
- 13, 13, 13, 13, 0, 16, 16, 16,
- 0, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 23, 16,
- 23, 0, 0, 0, 0, 16, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 0, 0, 23,
- 16, 23, 0, 16, 5, 0, 0, 0,
- 0, 16, 16, 16, 0, 0, 0, 0,
- 0, 16, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 16, 5, 0,
- 0, 0, 0, 16, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 0, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 0, 23, 16,
- 23, 0, 0, 0, 16, 0, 5, 0,
- 0, 0, 0, 0, 0, 16, 16, 16,
- 0, 16, 7, 0, 0, 0, 0, 23,
- 16, 23, 16, 5, 7, 0, 19, 16,
- 19, 13, 13, 13, 13, 16, 3, 7,
- 0, 13, 0, 0, 13, 13, 13, 13,
- 13, 0, 16, 16, 16, 0, 0, 0,
- 0, 16, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 23, 16, 23, 0,
- 0, 0, 0, 16, 5, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 7, 0, 0, 0, 23,
- 16, 23, 0, 16, 5, 7, 0, 0,
- 0, 0, 16, 16, 16, 0, 0, 0,
- 0, 0, 16, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 16,
- 5, 0, 0, 0, 0, 16, 5, 7,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 7, 0, 0, 0, 7, 0, 0,
- 0, 0, 7, 0, 7, 1, 1, 0,
- 7, 0, 16, 16, 16, 16, 7, 0,
- 19, 16, 19, 13, 13, 13, 13, 16,
- 3, 7, 13, 13, 13, 13, 13, 0,
- 16, 16, 16, 0, 0, 0, 16, 7,
- 0, 0, 0, 0, 0, 0, 23, 16,
- 23, 0, 0, 0, 16, 5, 7, 0,
- 0, 0, 0, 0, 0, 16, 16, 16,
- 16, 0, 7, 0, 16, 16, 16, 16,
- 7, 1, 1, 0, 16, 16, 16, 16,
- 0, 7, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 0, 7, 0, 16, 16,
- 16, 16, 7, 0, 16, 16, 16, 0,
- 16, 7, 0, 0, 0, 0, 23, 16,
- 23, 16, 5, 7, 0, 19, 16, 19,
- 13, 13, 13, 13, 16, 3, 7, 0,
- 13, 0, 0, 13, 13, 13, 13, 13,
- 0, 16, 16, 16, 0, 0, 0, 0,
- 16, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 23, 16, 23, 0, 0,
- 0, 0, 16, 5, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 16, 7, 0, 0, 0, 23, 16,
- 23, 0, 16, 5, 7, 0, 0, 0,
- 0, 16, 16, 16, 0, 0, 0, 0,
- 0, 16, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 16, 5,
- 0, 0, 0, 0, 16, 5, 7, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 0, 16, 7, 0, 0,
- 0, 0, 27, 16, 27, 13, 13, 13,
- 13, 16, 3, 7, 0, 13, 0, 0,
- 13, 13, 13, 13, 13, 0, 27, 16,
- 27, 13, 13, 13, 13, 16, 3, 7,
- 13, 13, 13, 13, 13, 13, 0, 16,
- 16, 16, 0, 0, 0, 0, 16, 0,
- 7, 0, 0, 0, 0, 0, 0, 0,
- 31, 16, 31, 0, 0, 0, 16, 0,
- 5, 7, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 0, 0, 7, 0,
- 16, 16, 16, 16, 7, 0, 31, 16,
- 31, 0, 16, 5, 7, 0, 0, 0,
- 0, 27, 16, 27, 13, 13, 13, 13,
- 16, 3, 7, 0, 13, 0, 0, 13,
- 13, 13, 13, 13, 0, 16, 16, 16,
- 0, 0, 0, 0, 0, 16, 0, 7,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 16, 5, 0, 0, 0,
- 0, 16, 0, 5, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 16, 16,
- 16, 0, 16, 0, 0, 0, 0, 31,
- 16, 31, 16, 5, 0, 27, 16, 27,
- 13, 13, 13, 13, 16, 3, 0, 13,
- 0, 0, 13, 13, 13, 13, 13, 0,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 31, 16, 31, 0, 0, 0, 0,
- 16, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 16, 0,
- 0, 0, 31, 16, 31, 0, 16, 5,
- 0, 0, 0, 0, 16, 16, 16, 0,
- 0, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 16, 5, 0, 0, 0, 0, 16,
- 0, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 0, 16,
- 0, 0, 0, 0, 16, 16, 16, 0,
- 16, 0, 0, 0, 0, 27, 16, 27,
- 13, 13, 13, 13, 16, 3, 0, 13,
- 0, 0, 13, 13, 13, 13, 13, 0,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 31, 16, 31, 0, 0, 0, 0,
- 16, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 16, 0,
- 0, 0, 16, 16, 16, 0, 0, 0,
- 0, 0, 16, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 23, 16,
- 23, 0, 0, 0, 0, 16, 0, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 16, 16, 16, 0, 16, 0, 0,
- 0, 0, 27, 16, 27, 13, 13, 13,
- 13, 16, 3, 0, 13, 0, 0, 13,
- 13, 13, 13, 13, 0, 27, 16, 27,
- 13, 13, 13, 13, 16, 3, 13, 13,
- 13, 13, 13, 13, 0, 16, 16, 16,
- 0, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 16, 31,
- 0, 0, 0, 16, 0, 5, 0, 0,
- 0, 0, 0, 0, 16, 16, 16, 16,
- 0, 0, 0, 16, 16, 16, 16, 0,
- 31, 16, 31, 0, 16, 5, 0, 0,
- 0, 0, 27, 16, 27, 13, 13, 13,
- 13, 16, 3, 0, 13, 0, 0, 13,
- 13, 13, 13, 13, 0, 16, 16, 16,
- 0, 0, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 16, 5, 0, 0, 0, 0,
- 16, 0, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
+ static const short _tsip_machine_parser_header_P_Asserted_Identity_index_offsets[] = {
+ 0, 0, 3, 5, 8, 11, 14, 17,
+ 20, 23, 26, 29, 31, 34, 37, 40,
+ 43, 46, 49, 52, 55, 59, 75, 77,
+ 80, 96, 98, 101, 105, 108, 117, 121,
+ 122, 124, 129, 131, 147, 149, 152, 168,
+ 181, 195, 200, 202, 205, 212, 214, 217,
+ 222, 226, 242, 257, 263, 264, 269, 284,
+ 297, 311, 317, 324, 334, 340, 345, 351,
+ 367, 381, 396, 403, 411, 421, 428, 448,
+ 466, 485, 493, 504, 524, 543, 552, 558,
+ 577, 594, 612, 619, 629, 648, 666, 682,
+ 697, 703, 704, 709, 725, 738, 752, 758,
+ 765, 775, 781, 786, 792, 809, 823, 838,
+ 845, 853, 863, 870, 890, 908, 927, 935,
+ 946, 967, 987, 997, 1007, 1027, 1045, 1064,
+ 1072, 1093, 1113, 1120, 1125, 1140, 1149, 1168,
+ 1185, 1203, 1210, 1229, 1247, 1254, 1264, 1270,
+ 1275, 1281, 1297, 1311, 1326, 1333, 1341, 1346,
+ 1362, 1375, 1389, 1395, 1404, 1410, 1429, 1446,
+ 1464, 1471, 1481, 1500, 1518, 1534, 1549, 1559,
+ 1566, 1586, 1604, 1623, 1631, 1642, 1662, 1681,
+ 1688, 1691, 1695, 1700, 1704, 1706, 1712, 1728,
+ 1742, 1757, 1764, 1772, 1783, 1790, 1796, 1806,
+ 1813, 1833, 1851, 1870, 1878, 1889, 1909, 1928,
+ 1938, 1958, 1975, 1992, 2008, 2016, 2022, 2033,
+ 2053, 2074, 2094, 2103, 2109, 2128, 2145, 2163,
+ 2170, 2180, 2200, 2219, 2228, 2237, 2256, 2273,
+ 2291, 2298, 2318, 2337, 2346, 2365, 2381, 2397,
+ 2412, 2419, 2424, 2434, 2453, 2473, 2492
+ };
+
+ static const unsigned char _tsip_machine_parser_header_P_Asserted_Identity_trans_targs[] = {
+ 2, 2, 0, 3, 0, 4, 4, 0,
+ 5, 5, 0, 6, 6, 0, 7, 7,
+ 0, 8, 8, 0, 9, 9, 0, 10,
+ 10, 0, 11, 11, 0, 12, 0, 13,
+ 13, 0, 14, 14, 0, 15, 15, 0,
+ 16, 16, 0, 17, 17, 0, 18, 18,
+ 0, 19, 19, 0, 20, 20, 0, 20,
+ 20, 21, 0, 21, 22, 21, 39, 44,
+ 39, 39, 28, 39, 39, 39, 39, 86,
+ 39, 86, 0, 23, 0, 24, 24, 0,
+ 24, 25, 24, 39, 44, 39, 39, 28,
+ 39, 39, 39, 39, 86, 39, 86, 0,
+ 26, 0, 27, 27, 0, 27, 27, 28,
+ 0, 29, 29, 0, 30, 30, 29, 31,
+ 29, 29, 29, 29, 0, 30, 30, 31,
+ 0, 32, 33, 32, 33, 34, 33, 35,
+ 0, 230, 0, 35, 36, 35, 39, 44,
+ 39, 39, 28, 39, 39, 39, 39, 49,
+ 39, 49, 0, 37, 0, 38, 38, 0,
+ 38, 25, 38, 39, 44, 39, 39, 28,
+ 39, 39, 39, 39, 49, 39, 49, 0,
+ 40, 42, 40, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 0, 41, 25, 41,
+ 39, 39, 39, 28, 39, 39, 39, 39,
+ 39, 39, 0, 41, 25, 41, 28, 0,
+ 43, 0, 40, 40, 0, 45, 47, 48,
+ 0, 0, 0, 44, 46, 0, 44, 44,
+ 0, 41, 25, 41, 28, 0, 44, 44,
+ 44, 0, 50, 42, 50, 39, 39, 39,
+ 39, 49, 52, 39, 49, 49, 49, 39,
+ 49, 0, 51, 25, 51, 39, 39, 39,
+ 52, 28, 39, 39, 39, 39, 39, 39,
+ 0, 51, 25, 51, 52, 28, 0, 53,
+ 53, 34, 53, 54, 53, 54, 34, 54,
+ 55, 77, 55, 55, 54, 58, 55, 55,
+ 55, 55, 55, 53, 56, 34, 56, 55,
+ 55, 55, 54, 55, 55, 55, 55, 55,
+ 53, 57, 34, 57, 55, 55, 55, 54,
+ 58, 55, 55, 55, 55, 55, 53, 57,
+ 34, 57, 54, 58, 53, 53, 34, 53,
+ 54, 59, 59, 53, 60, 34, 60, 54,
+ 61, 59, 59, 59, 59, 53, 60, 34,
+ 60, 54, 61, 53, 62, 34, 62, 63,
+ 62, 62, 34, 62, 63, 53, 62, 63,
+ 34, 63, 64, 68, 64, 64, 63, 67,
+ 53, 64, 64, 64, 64, 64, 62, 65,
+ 34, 65, 64, 64, 64, 63, 53, 64,
+ 64, 64, 64, 64, 62, 66, 34, 66,
+ 64, 64, 64, 63, 67, 53, 64, 64,
+ 64, 64, 64, 62, 66, 34, 66, 63,
+ 67, 53, 62, 62, 34, 62, 63, 53,
+ 62, 62, 62, 68, 34, 68, 69, 70,
+ 53, 73, 62, 62, 68, 66, 34, 66,
+ 63, 67, 53, 62, 63, 34, 63, 71,
+ 74, 71, 71, 70, 67, 53, 73, 71,
+ 62, 62, 71, 71, 75, 71, 75, 68,
+ 72, 34, 72, 71, 69, 71, 71, 70,
+ 53, 73, 71, 62, 62, 71, 71, 71,
+ 71, 68, 66, 34, 66, 71, 69, 71,
+ 71, 70, 67, 53, 73, 71, 62, 62,
+ 71, 71, 71, 71, 68, 68, 34, 68,
+ 70, 53, 68, 68, 62, 66, 34, 66,
+ 69, 70, 67, 53, 73, 62, 62, 68,
+ 76, 34, 76, 71, 69, 71, 71, 71,
+ 70, 53, 73, 71, 62, 62, 75, 75,
+ 75, 71, 75, 68, 51, 34, 51, 71,
+ 69, 71, 71, 70, 28, 53, 73, 71,
+ 62, 62, 71, 71, 71, 71, 68, 77,
+ 34, 77, 78, 79, 82, 53, 53, 77,
+ 57, 34, 57, 54, 58, 53, 54, 34,
+ 54, 80, 83, 80, 80, 79, 58, 82,
+ 80, 53, 53, 80, 80, 84, 80, 84,
+ 77, 81, 34, 81, 80, 78, 80, 80,
+ 79, 82, 80, 53, 53, 80, 80, 80,
+ 80, 77, 57, 34, 57, 80, 78, 80,
+ 80, 79, 58, 82, 80, 53, 53, 80,
+ 80, 80, 80, 77, 77, 34, 77, 79,
+ 77, 77, 53, 57, 34, 57, 78, 79,
+ 58, 82, 53, 53, 77, 85, 34, 85,
+ 80, 78, 80, 80, 80, 79, 82, 80,
+ 53, 53, 84, 84, 84, 80, 84, 77,
+ 51, 34, 51, 80, 78, 80, 80, 79,
+ 28, 82, 80, 53, 53, 80, 80, 80,
+ 80, 77, 87, 42, 87, 39, 39, 39,
+ 39, 86, 89, 39, 86, 86, 86, 39,
+ 86, 0, 88, 25, 88, 39, 39, 39,
+ 89, 28, 39, 39, 39, 39, 39, 39,
+ 0, 88, 25, 88, 89, 28, 0, 90,
+ 90, 34, 90, 91, 90, 91, 34, 91,
+ 92, 202, 92, 92, 91, 95, 92, 92,
+ 92, 222, 92, 222, 90, 93, 34, 93,
+ 92, 92, 92, 91, 92, 92, 92, 92,
+ 92, 90, 94, 34, 94, 92, 92, 92,
+ 91, 95, 92, 92, 92, 92, 92, 90,
+ 94, 34, 94, 91, 95, 90, 90, 34,
+ 90, 91, 96, 96, 90, 97, 34, 97,
+ 91, 98, 96, 96, 96, 96, 90, 97,
+ 34, 97, 91, 98, 90, 99, 34, 99,
+ 100, 99, 99, 34, 99, 100, 90, 99,
+ 100, 34, 100, 101, 105, 101, 101, 100,
+ 104, 90, 101, 101, 101, 194, 101, 194,
+ 99, 102, 34, 102, 101, 101, 101, 100,
+ 90, 101, 101, 101, 101, 101, 99, 103,
+ 34, 103, 101, 101, 101, 100, 104, 90,
+ 101, 101, 101, 101, 101, 99, 103, 34,
+ 103, 100, 104, 90, 99, 99, 34, 99,
+ 100, 90, 99, 99, 99, 105, 34, 105,
+ 106, 107, 90, 110, 99, 99, 105, 103,
+ 34, 103, 100, 104, 90, 99, 100, 34,
+ 100, 108, 111, 108, 108, 107, 104, 90,
+ 110, 108, 99, 99, 108, 108, 112, 108,
+ 112, 105, 109, 34, 109, 108, 106, 108,
+ 108, 107, 90, 110, 108, 99, 99, 108,
+ 108, 108, 108, 105, 103, 34, 103, 108,
+ 106, 108, 108, 107, 104, 90, 110, 108,
+ 99, 99, 108, 108, 108, 108, 105, 105,
+ 34, 105, 107, 90, 105, 105, 99, 103,
+ 34, 103, 106, 107, 104, 90, 110, 99,
+ 99, 105, 113, 34, 113, 108, 106, 108,
+ 108, 108, 107, 114, 90, 110, 108, 99,
+ 99, 112, 112, 112, 108, 112, 105, 51,
+ 34, 51, 108, 106, 108, 108, 107, 114,
+ 28, 90, 110, 108, 99, 99, 108, 108,
+ 108, 108, 105, 115, 34, 115, 106, 199,
+ 90, 119, 99, 99, 115, 115, 34, 115,
+ 106, 116, 90, 119, 99, 99, 115, 100,
+ 34, 100, 117, 111, 117, 117, 116, 104,
+ 90, 119, 117, 99, 99, 117, 117, 120,
+ 117, 120, 115, 118, 34, 118, 117, 106,
+ 117, 117, 116, 90, 119, 117, 99, 99,
+ 117, 117, 117, 117, 115, 103, 34, 103,
+ 117, 106, 117, 117, 116, 104, 90, 119,
+ 117, 99, 99, 117, 117, 117, 117, 115,
+ 115, 34, 115, 116, 90, 115, 115, 99,
+ 121, 34, 121, 117, 106, 117, 117, 117,
+ 116, 191, 90, 119, 117, 99, 99, 120,
+ 120, 120, 117, 120, 115, 122, 34, 122,
+ 117, 106, 117, 117, 116, 191, 132, 90,
+ 119, 117, 99, 99, 117, 117, 117, 117,
+ 115, 122, 34, 122, 54, 123, 132, 53,
+ 53, 34, 53, 124, 53, 124, 34, 124,
+ 55, 125, 55, 55, 54, 58, 55, 55,
+ 55, 55, 55, 53, 125, 34, 125, 78,
+ 126, 129, 53, 53, 125, 54, 34, 54,
+ 127, 83, 127, 127, 126, 58, 129, 127,
+ 53, 53, 127, 127, 130, 127, 130, 125,
+ 128, 34, 128, 127, 78, 127, 127, 126,
+ 129, 127, 53, 53, 127, 127, 127, 127,
+ 125, 57, 34, 57, 127, 78, 127, 127,
+ 126, 58, 129, 127, 53, 53, 127, 127,
+ 127, 127, 125, 125, 34, 125, 126, 125,
+ 125, 53, 131, 34, 131, 127, 78, 127,
+ 127, 127, 126, 129, 127, 53, 53, 130,
+ 130, 130, 127, 130, 125, 122, 34, 122,
+ 127, 78, 127, 127, 126, 132, 129, 127,
+ 53, 53, 127, 127, 127, 127, 125, 53,
+ 34, 53, 54, 133, 133, 53, 134, 34,
+ 134, 54, 135, 133, 133, 133, 133, 53,
+ 134, 34, 134, 54, 135, 53, 136, 34,
+ 136, 137, 136, 136, 34, 136, 137, 142,
+ 136, 137, 34, 137, 138, 158, 138, 138,
+ 137, 141, 142, 138, 138, 138, 138, 138,
+ 136, 139, 34, 139, 138, 138, 138, 137,
+ 142, 138, 138, 138, 138, 138, 136, 140,
+ 34, 140, 138, 138, 138, 137, 141, 142,
+ 138, 138, 138, 138, 138, 136, 140, 34,
+ 140, 137, 141, 142, 136, 136, 34, 136,
+ 137, 142, 136, 136, 136, 142, 34, 142,
+ 143, 53, 143, 34, 143, 144, 147, 144,
+ 144, 54, 132, 144, 144, 144, 156, 144,
+ 156, 53, 145, 34, 145, 144, 144, 144,
+ 54, 144, 144, 144, 144, 144, 53, 146,
+ 34, 146, 144, 144, 144, 54, 132, 144,
+ 144, 144, 144, 144, 53, 146, 34, 146,
+ 54, 132, 53, 147, 34, 147, 148, 149,
+ 152, 53, 53, 147, 146, 34, 146, 54,
+ 132, 53, 54, 34, 54, 150, 153, 150,
+ 150, 149, 58, 152, 150, 53, 53, 150,
+ 150, 154, 150, 154, 147, 151, 34, 151,
+ 150, 148, 150, 150, 149, 152, 150, 53,
+ 53, 150, 150, 150, 150, 147, 57, 34,
+ 57, 150, 148, 150, 150, 149, 58, 152,
+ 150, 53, 53, 150, 150, 150, 150, 147,
+ 147, 34, 147, 149, 147, 147, 53, 146,
+ 34, 146, 78, 79, 132, 82, 53, 53,
+ 77, 155, 34, 155, 150, 148, 150, 150,
+ 150, 149, 152, 150, 53, 53, 154, 154,
+ 154, 150, 154, 147, 51, 34, 51, 150,
+ 148, 150, 150, 149, 28, 152, 150, 53,
+ 53, 150, 150, 150, 150, 147, 157, 34,
+ 157, 144, 144, 144, 144, 54, 123, 144,
+ 156, 156, 156, 144, 156, 53, 122, 34,
+ 122, 144, 144, 144, 54, 123, 132, 144,
+ 144, 144, 144, 144, 53, 158, 34, 158,
+ 159, 160, 142, 163, 136, 136, 158, 140,
+ 34, 140, 137, 141, 142, 136, 137, 34,
+ 137, 161, 164, 161, 161, 160, 141, 142,
+ 163, 161, 136, 136, 161, 161, 165, 161,
+ 165, 158, 162, 34, 162, 161, 159, 161,
+ 161, 160, 142, 163, 161, 136, 136, 161,
+ 161, 161, 161, 158, 140, 34, 140, 161,
+ 159, 161, 161, 160, 141, 142, 163, 161,
+ 136, 136, 161, 161, 161, 161, 158, 158,
+ 34, 158, 160, 142, 158, 158, 136, 140,
+ 34, 140, 159, 160, 141, 142, 163, 136,
+ 136, 158, 166, 34, 166, 161, 159, 161,
+ 161, 161, 160, 142, 163, 161, 136, 136,
+ 165, 165, 165, 161, 165, 158, 167, 34,
+ 167, 161, 159, 161, 161, 160, 171, 142,
+ 163, 161, 136, 136, 161, 161, 161, 161,
+ 158, 167, 168, 167, 172, 171, 33, 32,
+ 169, 33, 32, 170, 170, 33, 32, 170,
+ 170, 171, 33, 32, 33, 32, 32, 32,
+ 142, 173, 173, 34, 173, 174, 142, 173,
+ 174, 34, 174, 175, 182, 175, 175, 174,
+ 178, 142, 175, 175, 175, 175, 175, 173,
+ 176, 34, 176, 175, 175, 175, 174, 142,
+ 175, 175, 175, 175, 175, 173, 177, 34,
+ 177, 175, 175, 175, 174, 178, 142, 175,
+ 175, 175, 175, 175, 173, 177, 34, 177,
+ 174, 178, 142, 173, 173, 34, 173, 174,
+ 142, 179, 179, 173, 180, 34, 180, 174,
+ 181, 142, 179, 179, 179, 179, 173, 180,
+ 34, 180, 174, 181, 142, 173, 136, 34,
+ 136, 137, 33, 136, 182, 34, 182, 183,
+ 184, 33, 187, 173, 173, 182, 177, 34,
+ 177, 174, 178, 142, 173, 174, 34, 174,
+ 185, 188, 185, 185, 184, 178, 33, 187,
+ 185, 173, 173, 185, 185, 189, 185, 189,
+ 182, 186, 34, 186, 185, 183, 185, 185,
+ 184, 33, 187, 185, 173, 173, 185, 185,
+ 185, 185, 182, 177, 34, 177, 185, 183,
+ 185, 185, 184, 178, 33, 187, 185, 173,
+ 173, 185, 185, 185, 185, 182, 182, 34,
+ 182, 184, 33, 182, 182, 173, 177, 34,
+ 177, 183, 184, 178, 33, 187, 173, 173,
+ 182, 190, 34, 190, 185, 183, 185, 185,
+ 185, 184, 33, 187, 185, 173, 173, 189,
+ 189, 189, 185, 189, 182, 167, 34, 167,
+ 185, 183, 185, 185, 184, 171, 33, 187,
+ 185, 173, 173, 185, 185, 185, 185, 182,
+ 115, 34, 115, 106, 192, 90, 119, 99,
+ 99, 115, 193, 34, 193, 117, 198, 117,
+ 117, 116, 104, 90, 119, 117, 99, 99,
+ 117, 117, 120, 117, 120, 115, 193, 34,
+ 193, 101, 115, 101, 101, 100, 104, 90,
+ 101, 101, 101, 194, 101, 194, 99, 195,
+ 34, 195, 101, 101, 101, 101, 100, 197,
+ 90, 101, 194, 194, 194, 101, 194, 99,
+ 196, 34, 196, 101, 101, 101, 100, 197,
+ 104, 90, 101, 101, 101, 101, 101, 99,
+ 196, 34, 196, 100, 197, 104, 90, 99,
+ 99, 34, 99, 193, 90, 99, 103, 34,
+ 103, 106, 116, 104, 90, 119, 99, 99,
+ 115, 193, 34, 193, 117, 198, 117, 117,
+ 116, 104, 90, 119, 117, 99, 99, 117,
+ 117, 200, 117, 200, 115, 201, 34, 201,
+ 117, 106, 117, 117, 117, 116, 191, 90,
+ 119, 117, 99, 99, 200, 200, 200, 117,
+ 200, 115, 51, 34, 51, 117, 106, 117,
+ 117, 116, 191, 28, 90, 119, 117, 99,
+ 99, 117, 117, 117, 117, 115, 202, 34,
+ 202, 203, 204, 207, 90, 90, 202, 94,
+ 34, 94, 91, 95, 90, 91, 34, 91,
+ 205, 208, 205, 205, 204, 95, 207, 205,
+ 90, 90, 205, 205, 209, 205, 209, 202,
+ 206, 34, 206, 205, 203, 205, 205, 204,
+ 207, 205, 90, 90, 205, 205, 205, 205,
+ 202, 94, 34, 94, 205, 203, 205, 205,
+ 204, 95, 207, 205, 90, 90, 205, 205,
+ 205, 205, 202, 202, 34, 202, 204, 202,
+ 202, 90, 94, 34, 94, 203, 204, 95,
+ 207, 90, 90, 202, 210, 34, 210, 205,
+ 203, 205, 205, 205, 204, 211, 207, 205,
+ 90, 90, 209, 209, 209, 205, 209, 202,
+ 51, 34, 51, 205, 203, 205, 205, 204,
+ 211, 28, 207, 205, 90, 90, 205, 205,
+ 205, 205, 202, 212, 34, 212, 203, 227,
+ 216, 90, 90, 212, 212, 34, 212, 203,
+ 213, 216, 90, 90, 212, 91, 34, 91,
+ 214, 208, 214, 214, 213, 95, 216, 214,
+ 90, 90, 214, 214, 217, 214, 217, 212,
+ 215, 34, 215, 214, 203, 214, 214, 213,
+ 216, 214, 90, 90, 214, 214, 214, 214,
+ 212, 94, 34, 94, 214, 203, 214, 214,
+ 213, 95, 216, 214, 90, 90, 214, 214,
+ 214, 214, 212, 212, 34, 212, 213, 212,
+ 212, 90, 218, 34, 218, 214, 203, 214,
+ 214, 214, 213, 219, 216, 214, 90, 90,
+ 217, 217, 217, 214, 217, 212, 122, 34,
+ 122, 214, 203, 214, 214, 213, 219, 132,
+ 216, 214, 90, 90, 214, 214, 214, 214,
+ 212, 212, 34, 212, 203, 220, 216, 90,
+ 90, 212, 221, 34, 221, 214, 226, 214,
+ 214, 213, 95, 216, 214, 90, 90, 214,
+ 214, 217, 214, 217, 212, 221, 34, 221,
+ 92, 212, 92, 92, 91, 95, 92, 92,
+ 92, 222, 92, 222, 90, 223, 34, 223,
+ 92, 92, 92, 92, 91, 225, 92, 222,
+ 222, 222, 92, 222, 90, 224, 34, 224,
+ 92, 92, 92, 91, 225, 95, 92, 92,
+ 92, 92, 92, 90, 224, 34, 224, 91,
+ 225, 95, 90, 90, 34, 90, 221, 90,
+ 94, 34, 94, 203, 213, 95, 216, 90,
+ 90, 212, 221, 34, 221, 214, 226, 214,
+ 214, 213, 95, 216, 214, 90, 90, 214,
+ 214, 228, 214, 228, 212, 229, 34, 229,
+ 214, 203, 214, 214, 214, 213, 219, 216,
+ 214, 90, 90, 228, 228, 228, 214, 228,
+ 212, 51, 34, 51, 214, 203, 214, 214,
+ 213, 219, 28, 216, 214, 90, 90, 214,
+ 214, 214, 214, 212, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3, 3, 3, 13, 13,
+ 13, 13, 3, 13, 13, 13, 13, 13,
+ 13, 13, 0, 0, 0, 0, 0, 0,
+ 3, 3, 3, 13, 13, 13, 13, 3,
+ 13, 13, 13, 13, 13, 13, 13, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 7, 0, 9, 9, 9, 9,
+ 0, 11, 0, 3, 3, 3, 13, 13,
+ 13, 13, 3, 13, 13, 13, 13, 13,
+ 13, 13, 0, 0, 0, 0, 0, 0,
+ 3, 3, 3, 13, 13, 13, 13, 3,
+ 13, 13, 13, 13, 13, 13, 13, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 0, 0, 0, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 19, 16, 19,
+ 13, 13, 13, 13, 16, 3, 13, 13,
+ 13, 13, 13, 0, 16, 16, 16, 0,
+ 0, 0, 16, 0, 0, 0, 0, 0,
+ 0, 23, 16, 23, 0, 0, 0, 16,
+ 5, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 0, 0, 16, 16, 16,
+ 16, 1, 1, 0, 16, 16, 16, 16,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 16, 0, 0, 16, 16, 16, 16,
+ 0, 16, 16, 16, 16, 7, 0, 19,
+ 16, 19, 13, 13, 13, 13, 16, 3,
+ 7, 13, 13, 13, 13, 13, 0, 16,
+ 16, 16, 0, 0, 0, 16, 7, 0,
+ 0, 0, 0, 0, 0, 23, 16, 23,
+ 0, 0, 0, 16, 5, 7, 0, 0,
+ 0, 0, 0, 0, 16, 16, 16, 16,
+ 0, 7, 0, 16, 16, 16, 16, 7,
+ 1, 1, 0, 16, 16, 16, 0, 16,
+ 7, 0, 0, 0, 0, 23, 16, 23,
+ 16, 5, 7, 0, 19, 16, 19, 13,
+ 13, 13, 13, 16, 3, 7, 0, 13,
+ 0, 0, 13, 13, 13, 13, 13, 0,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 23, 16, 23, 0, 0, 0,
+ 0, 16, 5, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16, 16, 16,
+ 16, 7, 0, 0, 0, 23, 16, 23,
+ 0, 16, 5, 7, 0, 0, 0, 0,
+ 16, 16, 16, 0, 0, 0, 0, 0,
+ 16, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 16, 5, 0,
+ 0, 0, 0, 16, 5, 7, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 0, 16, 0, 0, 0, 0,
+ 23, 16, 23, 16, 5, 0, 19, 16,
+ 19, 13, 13, 13, 13, 16, 3, 0,
+ 13, 0, 0, 13, 13, 13, 13, 13,
+ 0, 16, 16, 16, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 23, 16, 23, 0, 0, 0,
+ 0, 16, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 16, 16, 16,
+ 0, 0, 0, 23, 16, 23, 0, 16,
+ 5, 0, 0, 0, 0, 16, 16, 16,
+ 0, 0, 0, 0, 0, 16, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 16, 5, 0, 0, 0, 0, 16,
+ 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 27, 16, 27,
+ 13, 13, 13, 13, 16, 3, 13, 13,
+ 13, 13, 13, 13, 0, 16, 16, 16,
+ 0, 0, 0, 16, 0, 0, 0, 0,
+ 0, 0, 31, 16, 31, 0, 0, 0,
+ 16, 5, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 0, 16, 16,
+ 16, 16, 1, 1, 0, 16, 16, 16,
+ 16, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 0, 0, 16, 16, 16,
+ 16, 0, 16, 16, 16, 16, 7, 0,
+ 27, 16, 27, 13, 13, 13, 13, 16,
+ 3, 7, 13, 13, 13, 13, 13, 13,
+ 0, 16, 16, 16, 0, 0, 0, 16,
+ 7, 0, 0, 0, 0, 0, 0, 31,
+ 16, 31, 0, 0, 0, 16, 5, 7,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 16, 0, 7, 0, 16, 16, 16,
+ 16, 7, 1, 1, 0, 16, 16, 16,
+ 0, 16, 7, 0, 0, 0, 0, 31,
+ 16, 31, 16, 5, 7, 0, 27, 16,
+ 27, 13, 13, 13, 13, 16, 3, 7,
+ 0, 13, 0, 0, 13, 13, 13, 13,
+ 13, 0, 16, 16, 16, 0, 0, 0,
+ 0, 16, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 31, 16, 31, 0,
+ 0, 0, 0, 16, 5, 7, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 7, 0, 0, 0, 31,
+ 16, 31, 0, 16, 5, 7, 0, 0,
+ 0, 0, 16, 16, 16, 0, 0, 0,
+ 0, 0, 16, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 16, 5, 0, 0, 0, 0, 16, 0,
+ 5, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 16, 16, 0, 16,
+ 7, 0, 0, 0, 0, 16, 16, 16,
+ 0, 16, 7, 0, 0, 0, 0, 27,
+ 16, 27, 13, 13, 13, 13, 16, 3,
+ 7, 0, 13, 0, 0, 13, 13, 13,
+ 13, 13, 0, 16, 16, 16, 0, 0,
+ 0, 0, 16, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 31, 16, 31,
+ 0, 0, 0, 0, 16, 5, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 7, 0, 0, 0,
+ 16, 16, 16, 0, 0, 0, 0, 0,
+ 16, 0, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 23, 16, 23,
+ 0, 0, 0, 0, 16, 0, 5, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 16, 16, 16, 0, 0, 0,
+ 16, 16, 16, 16, 0, 19, 16, 19,
+ 13, 13, 13, 13, 16, 3, 13, 13,
+ 13, 13, 13, 0, 16, 16, 16, 0,
+ 16, 0, 0, 0, 0, 19, 16, 19,
+ 13, 13, 13, 13, 16, 3, 0, 13,
+ 0, 0, 13, 13, 13, 13, 13, 0,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 23, 16, 23, 0, 0, 0, 0,
+ 16, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 16, 16, 16, 0,
+ 0, 0, 16, 16, 16, 0, 0, 0,
+ 0, 0, 16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 23, 16, 23,
+ 0, 0, 0, 0, 16, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 1, 1, 0, 16, 16,
+ 16, 16, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 0, 16, 16,
+ 16, 16, 0, 16, 16, 16, 16, 7,
+ 0, 19, 16, 19, 13, 13, 13, 13,
+ 16, 3, 7, 13, 13, 13, 13, 13,
+ 0, 16, 16, 16, 0, 0, 0, 16,
+ 7, 0, 0, 0, 0, 0, 0, 23,
+ 16, 23, 0, 0, 0, 16, 5, 7,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 16, 0, 7, 0, 16, 16, 16,
+ 16, 7, 1, 1, 0, 16, 16, 16,
+ 16, 0, 19, 16, 19, 13, 13, 13,
+ 13, 16, 3, 13, 13, 13, 13, 13,
+ 13, 0, 16, 16, 16, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 23,
+ 16, 23, 0, 0, 0, 16, 5, 0,
+ 0, 0, 0, 0, 0, 16, 16, 16,
+ 16, 0, 0, 16, 16, 16, 0, 16,
+ 0, 0, 0, 0, 23, 16, 23, 16,
+ 5, 0, 19, 16, 19, 13, 13, 13,
+ 13, 16, 3, 0, 13, 0, 0, 13,
+ 13, 13, 13, 13, 0, 16, 16, 16,
+ 0, 0, 0, 0, 16, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 23, 16,
+ 23, 0, 0, 0, 0, 16, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 0, 0, 23,
+ 16, 23, 0, 16, 5, 0, 0, 0,
+ 0, 16, 16, 16, 0, 0, 0, 0,
+ 0, 16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 16, 5, 0,
+ 0, 0, 0, 16, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 0, 0, 0, 0, 16, 0, 0,
+ 0, 0, 0, 0, 0, 0, 23, 16,
+ 23, 0, 0, 0, 16, 0, 5, 0,
+ 0, 0, 0, 0, 0, 16, 16, 16,
+ 0, 16, 7, 0, 0, 0, 0, 23,
+ 16, 23, 16, 5, 7, 0, 19, 16,
+ 19, 13, 13, 13, 13, 16, 3, 7,
+ 0, 13, 0, 0, 13, 13, 13, 13,
+ 13, 0, 16, 16, 16, 0, 0, 0,
+ 0, 16, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 23, 16, 23, 0,
+ 0, 0, 0, 16, 5, 7, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 7, 0, 0, 0, 23,
+ 16, 23, 0, 16, 5, 7, 0, 0,
+ 0, 0, 16, 16, 16, 0, 0, 0,
+ 0, 0, 16, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 16,
+ 5, 0, 0, 0, 0, 16, 5, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 0,
+ 0, 7, 0, 0, 0, 7, 0, 0,
+ 0, 0, 7, 0, 7, 1, 1, 0,
+ 7, 0, 16, 16, 16, 16, 7, 0,
+ 19, 16, 19, 13, 13, 13, 13, 16,
+ 3, 7, 13, 13, 13, 13, 13, 0,
+ 16, 16, 16, 0, 0, 0, 16, 7,
+ 0, 0, 0, 0, 0, 0, 23, 16,
+ 23, 0, 0, 0, 16, 5, 7, 0,
+ 0, 0, 0, 0, 0, 16, 16, 16,
+ 16, 0, 7, 0, 16, 16, 16, 16,
+ 7, 1, 1, 0, 16, 16, 16, 16,
+ 0, 7, 0, 0, 0, 0, 0, 16,
+ 16, 16, 16, 0, 7, 0, 16, 16,
+ 16, 16, 7, 0, 16, 16, 16, 0,
+ 16, 7, 0, 0, 0, 0, 23, 16,
+ 23, 16, 5, 7, 0, 19, 16, 19,
+ 13, 13, 13, 13, 16, 3, 7, 0,
+ 13, 0, 0, 13, 13, 13, 13, 13,
+ 0, 16, 16, 16, 0, 0, 0, 0,
+ 16, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 23, 16, 23, 0, 0,
+ 0, 0, 16, 5, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 16, 7, 0, 0, 0, 23, 16,
+ 23, 0, 16, 5, 7, 0, 0, 0,
+ 0, 16, 16, 16, 0, 0, 0, 0,
+ 0, 16, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 16, 5,
+ 0, 0, 0, 0, 16, 5, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 0, 16, 7, 0, 0,
+ 0, 0, 27, 16, 27, 13, 13, 13,
+ 13, 16, 3, 7, 0, 13, 0, 0,
+ 13, 13, 13, 13, 13, 0, 27, 16,
+ 27, 13, 13, 13, 13, 16, 3, 7,
+ 13, 13, 13, 13, 13, 13, 0, 16,
+ 16, 16, 0, 0, 0, 0, 16, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0,
+ 31, 16, 31, 0, 0, 0, 16, 0,
+ 5, 7, 0, 0, 0, 0, 0, 0,
+ 16, 16, 16, 16, 0, 0, 7, 0,
+ 16, 16, 16, 16, 7, 0, 31, 16,
+ 31, 0, 16, 5, 7, 0, 0, 0,
+ 0, 27, 16, 27, 13, 13, 13, 13,
+ 16, 3, 7, 0, 13, 0, 0, 13,
+ 13, 13, 13, 13, 0, 16, 16, 16,
+ 0, 0, 0, 0, 0, 16, 0, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 16, 5, 0, 0, 0,
+ 0, 16, 0, 5, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 16,
+ 16, 0, 16, 0, 0, 0, 0, 31,
+ 16, 31, 16, 5, 0, 27, 16, 27,
+ 13, 13, 13, 13, 16, 3, 0, 13,
+ 0, 0, 13, 13, 13, 13, 13, 0,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 31, 16, 31, 0, 0, 0, 0,
+ 16, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 16, 16, 16, 0,
+ 0, 0, 31, 16, 31, 0, 16, 5,
+ 0, 0, 0, 0, 16, 16, 16, 0,
+ 0, 0, 0, 0, 16, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 16, 5, 0, 0, 0, 0, 16,
+ 0, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 16, 16, 0, 16,
+ 0, 0, 0, 0, 16, 16, 16, 0,
+ 16, 0, 0, 0, 0, 27, 16, 27,
+ 13, 13, 13, 13, 16, 3, 0, 13,
+ 0, 0, 13, 13, 13, 13, 13, 0,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 31, 16, 31, 0, 0, 0, 0,
+ 16, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 16, 16, 16, 0,
+ 0, 0, 16, 16, 16, 0, 0, 0,
+ 0, 0, 16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 23, 16,
+ 23, 0, 0, 0, 0, 16, 0, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 16, 16, 0, 16, 0, 0,
+ 0, 0, 27, 16, 27, 13, 13, 13,
+ 13, 16, 3, 0, 13, 0, 0, 13,
+ 13, 13, 13, 13, 0, 27, 16, 27,
+ 13, 13, 13, 13, 16, 3, 13, 13,
+ 13, 13, 13, 13, 0, 16, 16, 16,
+ 0, 0, 0, 0, 16, 0, 0, 0,
+ 0, 0, 0, 0, 0, 31, 16, 31,
+ 0, 0, 0, 16, 0, 5, 0, 0,
+ 0, 0, 0, 0, 16, 16, 16, 16,
+ 0, 0, 0, 16, 16, 16, 16, 0,
+ 31, 16, 31, 0, 16, 5, 0, 0,
+ 0, 0, 27, 16, 27, 13, 13, 13,
+ 13, 16, 3, 0, 13, 0, 0, 13,
+ 13, 13, 13, 13, 0, 16, 16, 16,
+ 0, 0, 0, 0, 0, 16, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 16, 5, 0, 0, 0, 0,
+ 16, 0, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
-static const int tsip_machine_parser_header_P_Asserted_Identity_start = 1;
-static const int tsip_machine_parser_header_P_Asserted_Identity_first_final = 230;
-static const int tsip_machine_parser_header_P_Asserted_Identity_error = 0;
+ static const int tsip_machine_parser_header_P_Asserted_Identity_start = 1;
+ static const int tsip_machine_parser_header_P_Asserted_Identity_first_final = 230;
+ static const int tsip_machine_parser_header_P_Asserted_Identity_error = 0;
-static const int tsip_machine_parser_header_P_Asserted_Identity_en_main = 1;
+ static const int tsip_machine_parser_header_P_Asserted_Identity_en_main = 1;
-/* #line 136 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_P_Asserted_Identity_first_final);
- (void)(tsip_machine_parser_header_P_Asserted_Identity_error);
- (void)(tsip_machine_parser_header_P_Asserted_Identity_en_main);
-
-/* #line 1225 "./src/headers/tsip_header_P_Asserted_Identity.c" */
- {
- cs = tsip_machine_parser_header_P_Asserted_Identity_start;
- }
+ /* #line 136 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_P_Asserted_Identity_first_final);
+ (void)(tsip_machine_parser_header_P_Asserted_Identity_error);
+ (void)(tsip_machine_parser_header_P_Asserted_Identity_en_main);
-/* #line 141 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
-
-/* #line 1232 "./src/headers/tsip_header_P_Asserted_Identity.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
+ /* #line 1225 "./src/headers/tsip_header_P_Asserted_Identity.c" */
+ {
+ cs = tsip_machine_parser_header_P_Asserted_Identity_start;
+ }
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 141 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+
+ /* #line 1232 "./src/headers/tsip_header_P_Asserted_Identity.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_P_Asserted_Identity_trans_keys + _tsip_machine_parser_header_P_Asserted_Identity_key_offsets[cs];
- _trans = _tsip_machine_parser_header_P_Asserted_Identity_index_offsets[cs];
+ _keys = _tsip_machine_parser_header_P_Asserted_Identity_trans_keys + _tsip_machine_parser_header_P_Asserted_Identity_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_P_Asserted_Identity_index_offsets[cs];
- _klen = _tsip_machine_parser_header_P_Asserted_Identity_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_header_P_Asserted_Identity_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _tsip_machine_parser_header_P_Asserted_Identity_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_header_P_Asserted_Identity_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- cs = _tsip_machine_parser_header_P_Asserted_Identity_trans_targs[_trans];
+ cs = _tsip_machine_parser_header_P_Asserted_Identity_trans_targs[_trans];
- if ( _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _tsip_machine_parser_header_P_Asserted_Identity_actions + _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- if(!curr_p_asserted_identity){
- curr_p_asserted_identity = tsip_header_P_Asserted_Identity_create();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- if(curr_p_asserted_identity){
- TSK_PARSER_SET_STRING(curr_p_asserted_identity->display_name);
- tsk_strunquote(&curr_p_asserted_identity->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- if(curr_p_asserted_identity && !curr_p_asserted_identity->uri){
- int len = (int)(p - tag_start);
- if(curr_p_asserted_identity && !curr_p_asserted_identity->uri){
- if((curr_p_asserted_identity->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_p_asserted_identity->display_name){
- curr_p_asserted_identity->uri->display_name = tsk_strdup(curr_p_asserted_identity->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- if(curr_p_asserted_identity){
- tsk_list_push_back_data(hdr_p_asserted_identities, ((void**) &curr_p_asserted_identity));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- {
- }
- break;
-/* #line 1354 "./src/headers/tsip_header_P_Asserted_Identity.c" */
- }
- }
+ _acts = _tsip_machine_parser_header_P_Asserted_Identity_actions + _tsip_machine_parser_header_P_Asserted_Identity_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ if(!curr_p_asserted_identity) {
+ curr_p_asserted_identity = tsip_header_P_Asserted_Identity_create();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ if(curr_p_asserted_identity) {
+ TSK_PARSER_SET_STRING(curr_p_asserted_identity->display_name);
+ tsk_strunquote(&curr_p_asserted_identity->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ if(curr_p_asserted_identity && !curr_p_asserted_identity->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_p_asserted_identity && !curr_p_asserted_identity->uri) {
+ if((curr_p_asserted_identity->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_p_asserted_identity->display_name) {
+ curr_p_asserted_identity->uri->display_name = tsk_strdup(curr_p_asserted_identity->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ if(curr_p_asserted_identity) {
+ tsk_list_push_back_data(hdr_p_asserted_identities, ((void**) &curr_p_asserted_identity));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ {
+ }
+ break;
+ /* #line 1354 "./src/headers/tsip_header_P_Asserted_Identity.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 142 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
-/* #line 142 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
-
- if( cs <
-/* #line 1370 "./src/headers/tsip_header_P_Asserted_Identity.c" */
-230
-/* #line 143 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'P-Asserted-Identity' header.");
- TSK_OBJECT_SAFE_FREE(curr_p_asserted_identity);
- TSK_OBJECT_SAFE_FREE(hdr_p_asserted_identities);
- }
-
- return hdr_p_asserted_identities;
+ if( cs <
+ /* #line 1370 "./src/headers/tsip_header_P_Asserted_Identity.c" */
+ 230
+ /* #line 143 "./ragel/tsip_parser_header_P_Asserted_Identity.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'P-Asserted-Identity' header.");
+ TSK_OBJECT_SAFE_FREE(curr_p_asserted_identity);
+ TSK_OBJECT_SAFE_FREE(hdr_p_asserted_identities);
+ }
+
+ return hdr_p_asserted_identities;
}
@@ -1390,40 +1401,39 @@ _again:
*/
static tsk_object_t* tsip_header_P_Asserted_Identity_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = self;
- if(P_Asserted_Identity){
- TSIP_HEADER(P_Asserted_Identity)->type = tsip_htype_P_Asserted_Identity;
- TSIP_HEADER(P_Asserted_Identity)->serialize = tsip_header_P_Asserted_Identity_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P_Asserted_Identity header.");
- }
- return self;
+ tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = self;
+ if(P_Asserted_Identity) {
+ TSIP_HEADER(P_Asserted_Identity)->type = tsip_htype_P_Asserted_Identity;
+ TSIP_HEADER(P_Asserted_Identity)->serialize = tsip_header_P_Asserted_Identity_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P_Asserted_Identity header.");
+ }
+ return self;
}
/**@ingroup tsip_header_P_Asserted_Identity_group
*/
static tsk_object_t* tsip_header_P_Asserted_Identity_dtor(tsk_object_t *self)
{
- tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = self;
- if(P_Asserted_Identity){
- TSK_FREE(P_Asserted_Identity->display_name);
- TSK_OBJECT_SAFE_FREE(P_Asserted_Identity->uri);
+ tsip_header_P_Asserted_Identity_t *P_Asserted_Identity = self;
+ if(P_Asserted_Identity) {
+ TSK_FREE(P_Asserted_Identity->display_name);
+ TSK_OBJECT_SAFE_FREE(P_Asserted_Identity->uri);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Asserted_Identity));
- }
- else{
- TSK_DEBUG_ERROR("Null P_Asserted_Identity header.");
- }
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Asserted_Identity));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P_Asserted_Identity header.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsip_header_P_Asserted_Identity_def_s =
-{
- sizeof(tsip_header_P_Asserted_Identity_t),
- tsip_header_P_Asserted_Identity_ctor,
- tsip_header_P_Asserted_Identity_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_P_Asserted_Identity_def_s = {
+ sizeof(tsip_header_P_Asserted_Identity_t),
+ tsip_header_P_Asserted_Identity_ctor,
+ tsip_header_P_Asserted_Identity_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_P_Asserted_Identity_def_t = &tsip_header_P_Asserted_Identity_def_s;
diff --git a/tinySIP/src/headers/tsip_header_P_Associated_URI.c b/tinySIP/src/headers/tsip_header_P_Associated_URI.c
index 54c5e19..d708349 100755
--- a/tinySIP/src/headers/tsip_header_P_Associated_URI.c
+++ b/tinySIP/src/headers/tsip_header_P_Associated_URI.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,460 +50,471 @@
tsip_header_P_Associated_URI_t* tsip_header_P_Associated_URI_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_P_ASSOCIATED_URI_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_P_ASSOCIATED_URI_VA_ARGS(uri));
}
tsip_header_P_Associated_URI_t* tsip_header_P_Associated_URI_create_null()
{
- return tsip_header_P_Associated_URI_create(tsk_null);
+ return tsip_header_P_Associated_URI_create(tsk_null);
}
int tsip_header_P_Associated_URI_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_P_Associated_URI_t *P_Associated_URI = (const tsip_header_P_Associated_URI_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(P_Associated_URI->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- return ret;
- }
-
- return -1;
-}
+ if(header) {
+ const tsip_header_P_Associated_URI_t *P_Associated_URI = (const tsip_header_P_Associated_URI_t *)header;
+ int ret = 0;
-tsip_header_P_Associated_URIs_L_t *tsip_header_P_Associated_URI_parse(const char *data, tsk_size_t size)
-{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_P_Associated_URIs_L_t *hdr_p_associated_uris = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_P_Associated_URI_t *curr_p_associated_uri = tsk_null;
-
-
-/* #line 91 "./src/headers/tsip_header_P_Associated_URI.c" */
-static const char _tsip_machine_parser_header_P_Associated_URI_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 1, 0, 2, 4, 5
-};
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(P_Associated_URI->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
-static const short _tsip_machine_parser_header_P_Associated_URI_key_offsets[] = {
- 0, 0, 2, 3, 5, 7, 9, 11,
- 13, 15, 17, 19, 21, 23, 24, 26,
- 28, 30, 33, 52, 53, 55, 74, 75,
- 77, 80, 84, 96, 99, 99, 100, 105,
- 106, 123, 124, 126, 142, 160, 166, 167,
- 169, 174, 193, 194, 196, 215, 216, 218,
- 221, 229, 230, 232, 237, 242, 243, 245,
- 249, 255, 272, 279, 287, 295, 303, 305,
- 312, 321, 323, 326, 328, 331, 333, 336,
- 339, 340, 343, 344, 347, 348, 357, 366,
- 374, 382, 390, 398, 400, 406, 415, 424,
- 433, 435, 438, 441, 442, 443, 460, 478,
- 482, 483, 485, 493, 494, 496, 500, 506
-};
-
-static const char _tsip_machine_parser_header_P_Associated_URI_trans_keys[] = {
- 80, 112, 45, 65, 97, 83, 115, 83,
- 115, 79, 111, 67, 99, 73, 105, 65,
- 97, 84, 116, 69, 101, 68, 100, 45,
- 85, 117, 82, 114, 73, 105, 9, 32,
- 58, 9, 13, 32, 33, 34, 37, 39,
- 60, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 60,
- 65, 90, 97, 122, 9, 32, 43, 58,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 9, 32, 58, 62, 9, 13, 32, 44,
- 59, 10, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 61, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 59, 61, 10, 9,
- 32, 9, 32, 44, 59, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 34, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 44, 59, 9, 13, 32,
- 44, 59, 10, 9, 32, 9, 32, 44,
- 59, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 44, 59, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 60, 10, 9, 32, 13, 34, 92,
- 127, 0, 8, 10, 31, 10, 9, 32,
- 9, 13, 32, 60, 0, 9, 11, 12,
- 14, 127, 0
-};
+ return ret;
+ }
-static const char _tsip_machine_parser_header_P_Associated_URI_single_lengths[] = {
- 0, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 2,
- 2, 3, 9, 1, 2, 9, 1, 2,
- 3, 0, 4, 3, 0, 1, 5, 1,
- 7, 1, 2, 6, 10, 6, 1, 2,
- 5, 9, 1, 2, 9, 1, 2, 3,
- 4, 1, 2, 5, 5, 1, 2, 4,
- 0, 9, 1, 2, 2, 2, 2, 1,
- 3, 0, 1, 0, 1, 0, 1, 1,
- 1, 1, 1, 1, 1, 3, 3, 2,
- 2, 2, 2, 2, 0, 3, 3, 3,
- 0, 1, 1, 1, 1, 7, 8, 4,
- 1, 2, 4, 1, 2, 4, 0, 0
-};
-
-static const char _tsip_machine_parser_header_P_Associated_URI_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 2, 4, 0, 0, 0, 0, 0,
- 5, 0, 0, 5, 4, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0,
- 3, 4, 3, 3, 3, 3, 0, 3,
- 3, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 0, 1, 0, 3, 3, 3,
- 3, 3, 3, 0, 3, 3, 3, 3,
- 1, 1, 1, 0, 0, 5, 5, 0,
- 0, 0, 2, 0, 0, 0, 3, 0
-};
-
-static const short _tsip_machine_parser_header_P_Associated_URI_index_offsets[] = {
- 0, 0, 3, 5, 8, 11, 14, 17,
- 20, 23, 26, 29, 32, 35, 37, 40,
- 43, 46, 50, 65, 67, 70, 85, 87,
- 90, 94, 97, 106, 110, 111, 113, 119,
- 121, 134, 136, 139, 151, 166, 173, 175,
- 178, 184, 199, 201, 204, 219, 221, 224,
- 228, 235, 237, 240, 246, 252, 254, 257,
- 262, 266, 280, 285, 291, 297, 303, 306,
- 311, 318, 320, 323, 325, 328, 330, 333,
- 336, 338, 341, 343, 346, 348, 355, 362,
- 368, 374, 380, 386, 389, 393, 400, 407,
- 414, 416, 419, 422, 424, 426, 439, 453,
- 458, 460, 463, 470, 472, 475, 480, 484
-};
-
-static const char _tsip_machine_parser_header_P_Associated_URI_indicies[] = {
- 0, 0, 1, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 1, 14, 14, 1,
- 15, 15, 1, 16, 16, 1, 16, 16,
- 17, 1, 18, 19, 18, 20, 21, 20,
- 20, 22, 20, 20, 20, 20, 20, 20,
- 1, 23, 1, 24, 24, 1, 25, 26,
- 25, 20, 21, 20, 20, 22, 20, 20,
- 20, 20, 20, 20, 1, 27, 1, 28,
- 28, 1, 28, 28, 29, 1, 30, 30,
- 1, 31, 31, 32, 33, 32, 32, 32,
- 32, 1, 31, 31, 33, 1, 34, 35,
- 34, 36, 37, 36, 38, 39, 1, 40,
- 1, 39, 41, 39, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 1, 43, 1,
- 44, 44, 1, 44, 44, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 1, 45,
- 46, 45, 47, 47, 47, 48, 49, 50,
- 47, 47, 47, 47, 47, 1, 51, 52,
- 51, 17, 39, 50, 1, 53, 1, 54,
- 54, 1, 54, 54, 17, 39, 50, 1,
- 50, 55, 50, 56, 57, 56, 56, 58,
- 56, 56, 56, 56, 56, 56, 1, 59,
- 1, 60, 60, 1, 60, 61, 60, 56,
- 57, 56, 56, 58, 56, 56, 56, 56,
- 56, 56, 1, 62, 1, 63, 63, 1,
- 63, 63, 57, 1, 64, 65, 66, 1,
- 1, 1, 57, 67, 1, 57, 57, 1,
- 68, 46, 68, 48, 49, 1, 69, 70,
- 69, 17, 39, 1, 71, 1, 72, 72,
- 1, 72, 72, 17, 39, 1, 57, 57,
- 57, 1, 68, 46, 68, 56, 56, 56,
- 48, 49, 56, 56, 56, 56, 56, 1,
- 74, 73, 73, 73, 1, 76, 65, 75,
- 75, 75, 1, 76, 65, 77, 77, 77,
- 1, 76, 65, 78, 78, 78, 1, 76,
- 65, 1, 80, 79, 73, 73, 1, 81,
- 76, 65, 82, 75, 75, 1, 83, 1,
- 84, 85, 1, 86, 1, 87, 88, 1,
- 89, 1, 65, 90, 1, 65, 91, 1,
- 65, 1, 87, 92, 1, 87, 1, 84,
- 93, 1, 84, 1, 81, 76, 65, 94,
- 77, 77, 1, 81, 76, 65, 78, 78,
- 78, 1, 96, 65, 95, 95, 95, 1,
- 98, 65, 97, 97, 97, 1, 98, 65,
- 99, 99, 99, 1, 98, 65, 100, 100,
- 100, 1, 98, 65, 1, 101, 95, 95,
- 1, 81, 98, 65, 102, 97, 97, 1,
- 81, 98, 65, 103, 99, 99, 1, 81,
- 98, 65, 100, 100, 100, 1, 104, 1,
- 81, 105, 1, 81, 106, 1, 81, 1,
- 80, 1, 107, 108, 107, 109, 109, 109,
- 109, 109, 109, 109, 109, 109, 1, 110,
- 111, 110, 109, 109, 109, 112, 109, 109,
- 109, 109, 109, 109, 1, 113, 114, 113,
- 29, 1, 115, 1, 107, 107, 1, 117,
- 118, 119, 1, 1, 1, 116, 120, 1,
- 116, 116, 1, 110, 111, 110, 112, 1,
- 116, 116, 116, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_P_Associated_URI_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 18, 19, 93, 98, 25, 20,
- 21, 21, 22, 23, 24, 25, 26, 27,
- 26, 28, 29, 30, 30, 31, 18, 32,
- 103, 33, 36, 34, 35, 37, 31, 36,
- 18, 32, 41, 37, 38, 39, 40, 42,
- 57, 48, 58, 43, 44, 45, 46, 47,
- 49, 51, 56, 50, 52, 52, 53, 54,
- 55, 59, 92, 60, 63, 61, 62, 64,
- 79, 65, 77, 66, 67, 75, 68, 69,
- 73, 70, 71, 72, 74, 76, 78, 80,
- 88, 81, 84, 82, 83, 85, 86, 87,
- 89, 90, 91, 94, 96, 93, 95, 22,
- 25, 95, 22, 97, 98, 99, 101, 102,
- 100
-};
-
-static const char _tsip_machine_parser_header_P_Associated_URI_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 15, 15, 3, 0,
- 0, 3, 3, 0, 0, 0, 1, 0,
- 0, 0, 0, 7, 11, 11, 11, 0,
- 13, 0, 1, 0, 0, 18, 18, 0,
- 18, 9, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 18, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
+ return -1;
+}
-static const int tsip_machine_parser_header_P_Associated_URI_start = 1;
-static const int tsip_machine_parser_header_P_Associated_URI_first_final = 103;
-static const int tsip_machine_parser_header_P_Associated_URI_error = 0;
-
-static const int tsip_machine_parser_header_P_Associated_URI_en_main = 1;
-
-
-/* #line 147 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_P_Associated_URI_first_final);
- (void)(tsip_machine_parser_header_P_Associated_URI_error);
- (void)(tsip_machine_parser_header_P_Associated_URI_en_main);
-
-/* #line 344 "./src/headers/tsip_header_P_Associated_URI.c" */
- {
- cs = tsip_machine_parser_header_P_Associated_URI_start;
- }
-
-/* #line 152 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
-
-/* #line 351 "./src/headers/tsip_header_P_Associated_URI.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+tsip_header_P_Associated_URIs_L_t *tsip_header_P_Associated_URI_parse(const char *data, tsk_size_t size)
+{
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_P_Associated_URIs_L_t *hdr_p_associated_uris = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_P_Associated_URI_t *curr_p_associated_uri = tsk_null;
+
+
+ /* #line 91 "./src/headers/tsip_header_P_Associated_URI.c" */
+ static const char _tsip_machine_parser_header_P_Associated_URI_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 1, 0, 2, 4, 5
+ };
+
+ static const short _tsip_machine_parser_header_P_Associated_URI_key_offsets[] = {
+ 0, 0, 2, 3, 5, 7, 9, 11,
+ 13, 15, 17, 19, 21, 23, 24, 26,
+ 28, 30, 33, 52, 53, 55, 74, 75,
+ 77, 80, 84, 96, 99, 99, 100, 105,
+ 106, 123, 124, 126, 142, 160, 166, 167,
+ 169, 174, 193, 194, 196, 215, 216, 218,
+ 221, 229, 230, 232, 237, 242, 243, 245,
+ 249, 255, 272, 279, 287, 295, 303, 305,
+ 312, 321, 323, 326, 328, 331, 333, 336,
+ 339, 340, 343, 344, 347, 348, 357, 366,
+ 374, 382, 390, 398, 400, 406, 415, 424,
+ 433, 435, 438, 441, 442, 443, 460, 478,
+ 482, 483, 485, 493, 494, 496, 500, 506
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_trans_keys[] = {
+ 80, 112, 45, 65, 97, 83, 115, 83,
+ 115, 79, 111, 67, 99, 73, 105, 65,
+ 97, 84, 116, 69, 101, 68, 100, 45,
+ 85, 117, 82, 114, 73, 105, 9, 32,
+ 58, 9, 13, 32, 33, 34, 37, 39,
+ 60, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 60,
+ 65, 90, 97, 122, 9, 32, 43, 58,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 9, 32, 58, 62, 9, 13, 32, 44,
+ 59, 10, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 61, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 59, 61, 10, 9,
+ 32, 9, 32, 44, 59, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 34, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 44, 59, 9, 13, 32,
+ 44, 59, 10, 9, 32, 9, 32, 44,
+ 59, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 44, 59, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 60, 10, 9, 32, 13, 34, 92,
+ 127, 0, 8, 10, 31, 10, 9, 32,
+ 9, 13, 32, 60, 0, 9, 11, 12,
+ 14, 127, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_single_lengths[] = {
+ 0, 2, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 2, 2,
+ 2, 3, 9, 1, 2, 9, 1, 2,
+ 3, 0, 4, 3, 0, 1, 5, 1,
+ 7, 1, 2, 6, 10, 6, 1, 2,
+ 5, 9, 1, 2, 9, 1, 2, 3,
+ 4, 1, 2, 5, 5, 1, 2, 4,
+ 0, 9, 1, 2, 2, 2, 2, 1,
+ 3, 0, 1, 0, 1, 0, 1, 1,
+ 1, 1, 1, 1, 1, 3, 3, 2,
+ 2, 2, 2, 2, 0, 3, 3, 3,
+ 0, 1, 1, 1, 1, 7, 8, 4,
+ 1, 2, 4, 1, 2, 4, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 2, 4, 0, 0, 0, 0, 0,
+ 5, 0, 0, 5, 4, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 4, 3, 3, 3, 3, 0, 3,
+ 3, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 0, 1, 0, 3, 3, 3,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 1, 1, 1, 0, 0, 5, 5, 0,
+ 0, 0, 2, 0, 0, 0, 3, 0
+ };
+
+ static const short _tsip_machine_parser_header_P_Associated_URI_index_offsets[] = {
+ 0, 0, 3, 5, 8, 11, 14, 17,
+ 20, 23, 26, 29, 32, 35, 37, 40,
+ 43, 46, 50, 65, 67, 70, 85, 87,
+ 90, 94, 97, 106, 110, 111, 113, 119,
+ 121, 134, 136, 139, 151, 166, 173, 175,
+ 178, 184, 199, 201, 204, 219, 221, 224,
+ 228, 235, 237, 240, 246, 252, 254, 257,
+ 262, 266, 280, 285, 291, 297, 303, 306,
+ 311, 318, 320, 323, 325, 328, 330, 333,
+ 336, 338, 341, 343, 346, 348, 355, 362,
+ 368, 374, 380, 386, 389, 393, 400, 407,
+ 414, 416, 419, 422, 424, 426, 439, 453,
+ 458, 460, 463, 470, 472, 475, 480, 484
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_indicies[] = {
+ 0, 0, 1, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 1, 14, 14, 1,
+ 15, 15, 1, 16, 16, 1, 16, 16,
+ 17, 1, 18, 19, 18, 20, 21, 20,
+ 20, 22, 20, 20, 20, 20, 20, 20,
+ 1, 23, 1, 24, 24, 1, 25, 26,
+ 25, 20, 21, 20, 20, 22, 20, 20,
+ 20, 20, 20, 20, 1, 27, 1, 28,
+ 28, 1, 28, 28, 29, 1, 30, 30,
+ 1, 31, 31, 32, 33, 32, 32, 32,
+ 32, 1, 31, 31, 33, 1, 34, 35,
+ 34, 36, 37, 36, 38, 39, 1, 40,
+ 1, 39, 41, 39, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 1, 43, 1,
+ 44, 44, 1, 44, 44, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 1, 45,
+ 46, 45, 47, 47, 47, 48, 49, 50,
+ 47, 47, 47, 47, 47, 1, 51, 52,
+ 51, 17, 39, 50, 1, 53, 1, 54,
+ 54, 1, 54, 54, 17, 39, 50, 1,
+ 50, 55, 50, 56, 57, 56, 56, 58,
+ 56, 56, 56, 56, 56, 56, 1, 59,
+ 1, 60, 60, 1, 60, 61, 60, 56,
+ 57, 56, 56, 58, 56, 56, 56, 56,
+ 56, 56, 1, 62, 1, 63, 63, 1,
+ 63, 63, 57, 1, 64, 65, 66, 1,
+ 1, 1, 57, 67, 1, 57, 57, 1,
+ 68, 46, 68, 48, 49, 1, 69, 70,
+ 69, 17, 39, 1, 71, 1, 72, 72,
+ 1, 72, 72, 17, 39, 1, 57, 57,
+ 57, 1, 68, 46, 68, 56, 56, 56,
+ 48, 49, 56, 56, 56, 56, 56, 1,
+ 74, 73, 73, 73, 1, 76, 65, 75,
+ 75, 75, 1, 76, 65, 77, 77, 77,
+ 1, 76, 65, 78, 78, 78, 1, 76,
+ 65, 1, 80, 79, 73, 73, 1, 81,
+ 76, 65, 82, 75, 75, 1, 83, 1,
+ 84, 85, 1, 86, 1, 87, 88, 1,
+ 89, 1, 65, 90, 1, 65, 91, 1,
+ 65, 1, 87, 92, 1, 87, 1, 84,
+ 93, 1, 84, 1, 81, 76, 65, 94,
+ 77, 77, 1, 81, 76, 65, 78, 78,
+ 78, 1, 96, 65, 95, 95, 95, 1,
+ 98, 65, 97, 97, 97, 1, 98, 65,
+ 99, 99, 99, 1, 98, 65, 100, 100,
+ 100, 1, 98, 65, 1, 101, 95, 95,
+ 1, 81, 98, 65, 102, 97, 97, 1,
+ 81, 98, 65, 103, 99, 99, 1, 81,
+ 98, 65, 100, 100, 100, 1, 104, 1,
+ 81, 105, 1, 81, 106, 1, 81, 1,
+ 80, 1, 107, 108, 107, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 1, 110,
+ 111, 110, 109, 109, 109, 112, 109, 109,
+ 109, 109, 109, 109, 1, 113, 114, 113,
+ 29, 1, 115, 1, 107, 107, 1, 117,
+ 118, 119, 1, 1, 1, 116, 120, 1,
+ 116, 116, 1, 110, 111, 110, 112, 1,
+ 116, 116, 116, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 18, 19, 93, 98, 25, 20,
+ 21, 21, 22, 23, 24, 25, 26, 27,
+ 26, 28, 29, 30, 30, 31, 18, 32,
+ 103, 33, 36, 34, 35, 37, 31, 36,
+ 18, 32, 41, 37, 38, 39, 40, 42,
+ 57, 48, 58, 43, 44, 45, 46, 47,
+ 49, 51, 56, 50, 52, 52, 53, 54,
+ 55, 59, 92, 60, 63, 61, 62, 64,
+ 79, 65, 77, 66, 67, 75, 68, 69,
+ 73, 70, 71, 72, 74, 76, 78, 80,
+ 88, 81, 84, 82, 83, 85, 86, 87,
+ 89, 90, 91, 94, 96, 93, 95, 22,
+ 25, 95, 22, 97, 98, 99, 101, 102,
+ 100
+ };
+
+ static const char _tsip_machine_parser_header_P_Associated_URI_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 3, 15, 15, 3, 0,
+ 0, 3, 3, 0, 0, 0, 1, 0,
+ 0, 0, 0, 7, 11, 11, 11, 0,
+ 13, 0, 1, 0, 0, 18, 18, 0,
+ 18, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 18, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 0,
+ 0
+ };
+
+ static const int tsip_machine_parser_header_P_Associated_URI_start = 1;
+ static const int tsip_machine_parser_header_P_Associated_URI_first_final = 103;
+ static const int tsip_machine_parser_header_P_Associated_URI_error = 0;
+
+ static const int tsip_machine_parser_header_P_Associated_URI_en_main = 1;
+
+
+ /* #line 147 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_P_Associated_URI_first_final);
+ (void)(tsip_machine_parser_header_P_Associated_URI_error);
+ (void)(tsip_machine_parser_header_P_Associated_URI_en_main);
+
+ /* #line 344 "./src/headers/tsip_header_P_Associated_URI.c" */
+ {
+ cs = tsip_machine_parser_header_P_Associated_URI_start;
+ }
+
+ /* #line 152 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+
+ /* #line 351 "./src/headers/tsip_header_P_Associated_URI.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_P_Associated_URI_trans_keys + _tsip_machine_parser_header_P_Associated_URI_key_offsets[cs];
- _trans = _tsip_machine_parser_header_P_Associated_URI_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_P_Associated_URI_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_P_Associated_URI_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_P_Associated_URI_trans_keys + _tsip_machine_parser_header_P_Associated_URI_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_P_Associated_URI_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_P_Associated_URI_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_P_Associated_URI_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_P_Associated_URI_indicies[_trans];
- cs = _tsip_machine_parser_header_P_Associated_URI_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_P_Associated_URI_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_P_Associated_URI_actions + _tsip_machine_parser_header_P_Associated_URI_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- if(!curr_p_associated_uri){
- curr_p_associated_uri = tsip_header_P_Associated_URI_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- if(curr_p_associated_uri){
- TSK_PARSER_SET_STRING(curr_p_associated_uri->display_name);
- tsk_strunquote(&curr_p_associated_uri->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- if(curr_p_associated_uri && !curr_p_associated_uri->uri){
- int len = (int)(p - tag_start);
- if(curr_p_associated_uri && !curr_p_associated_uri->uri){
- if((curr_p_associated_uri->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_p_associated_uri->display_name){
- curr_p_associated_uri->uri->display_name = tsk_strdup(curr_p_associated_uri->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- if(curr_p_associated_uri){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_p_associated_uri));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- if(curr_p_associated_uri){
- tsk_list_push_back_data(hdr_p_associated_uris, ((void**) &curr_p_associated_uri));
- }
- }
- break;
- case 6:
-/* #line 91 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- {
- }
- break;
-/* #line 482 "./src/headers/tsip_header_P_Associated_URI.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_P_Associated_URI_indicies[_trans];
+ cs = _tsip_machine_parser_header_P_Associated_URI_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_P_Associated_URI_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_P_Associated_URI_actions + _tsip_machine_parser_header_P_Associated_URI_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ if(!curr_p_associated_uri) {
+ curr_p_associated_uri = tsip_header_P_Associated_URI_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ if(curr_p_associated_uri) {
+ TSK_PARSER_SET_STRING(curr_p_associated_uri->display_name);
+ tsk_strunquote(&curr_p_associated_uri->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ if(curr_p_associated_uri && !curr_p_associated_uri->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_p_associated_uri && !curr_p_associated_uri->uri) {
+ if((curr_p_associated_uri->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_p_associated_uri->display_name) {
+ curr_p_associated_uri->uri->display_name = tsk_strdup(curr_p_associated_uri->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ if(curr_p_associated_uri) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_p_associated_uri));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ if(curr_p_associated_uri) {
+ tsk_list_push_back_data(hdr_p_associated_uris, ((void**) &curr_p_associated_uri));
+ }
+ }
+ break;
+ case 6:
+ /* #line 91 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ {
+ }
+ break;
+ /* #line 482 "./src/headers/tsip_header_P_Associated_URI.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 153 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
-
- if( cs <
-/* #line 498 "./src/headers/tsip_header_P_Associated_URI.c" */
-103
-/* #line 154 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'P-Associated-URI' header.");
- TSK_OBJECT_SAFE_FREE(curr_p_associated_uri);
- TSK_OBJECT_SAFE_FREE(hdr_p_associated_uris);
- }
-
- return hdr_p_associated_uris;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 153 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+
+ if( cs <
+ /* #line 498 "./src/headers/tsip_header_P_Associated_URI.c" */
+ 103
+ /* #line 154 "./ragel/tsip_parser_header_P_Associated_URI.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'P-Associated-URI' header.");
+ TSK_OBJECT_SAFE_FREE(curr_p_associated_uri);
+ TSK_OBJECT_SAFE_FREE(hdr_p_associated_uris);
+ }
+
+ return hdr_p_associated_uris;
}
@@ -516,43 +527,42 @@ _again:
static tsk_object_t* tsip_header_P_Associated_URI_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_P_Associated_URI_t *P_Associated_URI = self;
- if(P_Associated_URI){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(P_Associated_URI)->type = tsip_htype_P_Associated_URI;
- TSIP_HEADER(P_Associated_URI)->serialize = tsip_header_P_Associated_URI_serialize;
- if(uri){
- P_Associated_URI->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P_Associated_URI header.");
- }
- return self;
+ tsip_header_P_Associated_URI_t *P_Associated_URI = self;
+ if(P_Associated_URI) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(P_Associated_URI)->type = tsip_htype_P_Associated_URI;
+ TSIP_HEADER(P_Associated_URI)->serialize = tsip_header_P_Associated_URI_serialize;
+ if(uri) {
+ P_Associated_URI->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P_Associated_URI header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_P_Associated_URI_dtor(tsk_object_t *self)
{
- tsip_header_P_Associated_URI_t *P_Associated_URI = self;
- if(P_Associated_URI){
- TSK_FREE(P_Associated_URI->display_name);
- TSK_OBJECT_SAFE_FREE(P_Associated_URI->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Associated_URI));
- }
- else{
- TSK_DEBUG_ERROR("Null P_Associated_URI header.");
- }
-
- return self;
+ tsip_header_P_Associated_URI_t *P_Associated_URI = self;
+ if(P_Associated_URI) {
+ TSK_FREE(P_Associated_URI->display_name);
+ TSK_OBJECT_SAFE_FREE(P_Associated_URI->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Associated_URI));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P_Associated_URI header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_P_Associated_URI_def_s =
-{
- sizeof(tsip_header_P_Associated_URI_t),
- tsip_header_P_Associated_URI_ctor,
- tsip_header_P_Associated_URI_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_P_Associated_URI_def_s = {
+ sizeof(tsip_header_P_Associated_URI_t),
+ tsip_header_P_Associated_URI_ctor,
+ tsip_header_P_Associated_URI_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_P_Associated_URI_def_t = &tsip_header_P_Associated_URI_def_s;
diff --git a/tinySIP/src/headers/tsip_header_P_Charging_Function_Addresses.c b/tinySIP/src/headers/tsip_header_P_Charging_Function_Addresses.c
index 6cd979a..88cfe89 100755
--- a/tinySIP/src/headers/tsip_header_P_Charging_Function_Addresses.c
+++ b/tinySIP/src/headers/tsip_header_P_Charging_Function_Addresses.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,655 +51,666 @@
tsip_header_P_Charging_Function_Addresses_t* tsip_header_P_Charging_Function_Addresses_create()
{
- return tsk_object_new(tsip_header_P_Charging_Function_Addresses_def_t);
+ return tsk_object_new(tsip_header_P_Charging_Function_Addresses_def_t);
}
int tsip_header_P_Charging_Function_Addresses_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = (const tsip_header_P_Charging_Function_Addresses_t *)header;
- return tsk_buffer_append_2(output, "%s%s%s%s%s",
- P_Charging_Function_Addresses->ecf ? "ecf=" : "",
- P_Charging_Function_Addresses->ecf ? P_Charging_Function_Addresses->ecf : "",
+ if(header) {
+ const tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = (const tsip_header_P_Charging_Function_Addresses_t *)header;
+ return tsk_buffer_append_2(output, "%s%s%s%s%s",
+ P_Charging_Function_Addresses->ecf ? "ecf=" : "",
+ P_Charging_Function_Addresses->ecf ? P_Charging_Function_Addresses->ecf : "",
- (P_Charging_Function_Addresses->ecf && P_Charging_Function_Addresses->ccf) ? ";" : "",
+ (P_Charging_Function_Addresses->ecf && P_Charging_Function_Addresses->ccf) ? ";" : "",
- P_Charging_Function_Addresses->ccf ? "ccf=" : "",
- P_Charging_Function_Addresses->ccf ? P_Charging_Function_Addresses->ccf : ""
- );
- }
+ P_Charging_Function_Addresses->ccf ? "ccf=" : "",
+ P_Charging_Function_Addresses->ccf ? P_Charging_Function_Addresses->ccf : ""
+ );
+ }
- return -1;
+ return -1;
}
tsip_header_P_Charging_Function_Addressess_L_t *tsip_header_P_Charging_Function_Addresses_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_P_Charging_Function_Addressess_L_t *hdr_p_charging_function_addressess = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_P_Charging_Function_Addresses_t *curr_p_charging_function_addresses = 0;
-
-
-/* #line 88 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
-static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_actions[] = {
- 0, 1, 6, 2, 1, 0, 2, 4,
- 5, 3, 2, 4, 5, 3, 3, 4,
- 5
-};
-
-static const short _tsip_machine_parser_header_P_Charging_Function_Addresses_key_offsets[] = {
- 0, 0, 2, 3, 5, 7, 9, 11,
- 13, 15, 17, 19, 20, 22, 24, 26,
- 28, 30, 32, 34, 36, 37, 39, 41,
- 43, 45, 47, 49, 51, 53, 55, 58,
- 79, 80, 82, 102, 121, 126, 127, 129,
- 133, 152, 153, 155, 174, 175, 177, 180,
- 188, 189, 191, 195, 199, 200, 202, 205,
- 206, 212, 230, 237, 245, 253, 261, 263,
- 270, 279, 281, 284, 286, 289, 291, 294,
- 297, 298, 301, 302, 305, 306, 315, 324,
- 332, 340, 348, 356, 358, 364, 373, 382,
- 391, 393, 396, 399, 400, 401, 422, 443,
- 462, 467, 468, 470, 474, 493, 494, 496,
- 515, 516, 518, 521, 529, 530, 532, 536,
- 542, 560, 567, 575, 583, 591, 593, 600,
- 609, 611, 614, 616, 619, 621, 624, 627,
- 628, 631, 632, 635, 636, 645, 654, 662,
- 670, 678, 686, 688, 694, 703, 712, 721,
- 723, 726, 729, 730, 731, 752, 773, 792,
- 797, 798, 800, 804, 823, 824, 826, 845,
- 846, 848, 851, 859, 860, 862, 866, 872,
- 890, 897, 905, 913, 921, 923, 930, 939,
- 941, 944, 946, 949, 951, 954, 957, 958,
- 961, 962, 965, 966, 975, 984, 992, 1000,
- 1008, 1016, 1018, 1024, 1033, 1042, 1051, 1053,
- 1056, 1059, 1060, 1061
-};
-
-static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_keys[] = {
- 80, 112, 45, 67, 99, 72, 104, 65,
- 97, 82, 114, 71, 103, 73, 105, 78,
- 110, 71, 103, 45, 70, 102, 85, 117,
- 78, 110, 67, 99, 84, 116, 73, 105,
- 79, 111, 78, 110, 45, 65, 97, 68,
- 100, 68, 100, 82, 114, 69, 101, 83,
- 115, 83, 115, 69, 101, 83, 115, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 67, 69, 99, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 67,
- 69, 99, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 61, 10, 9,
- 32, 9, 32, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 59, 9, 13, 32, 59, 10,
- 9, 32, 9, 32, 59, 10, 0, 9,
- 11, 12, 14, 127, 9, 13, 32, 33,
- 37, 39, 59, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 58, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 58,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 48, 57, 46, 48,
- 57, 48, 57, 93, 48, 57, 93, 48,
- 57, 93, 46, 48, 57, 46, 46, 48,
- 57, 46, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 46, 48, 57, 46,
- 58, 9, 13, 32, 33, 37, 39, 59,
- 61, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 70, 102,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 61, 10, 9, 32, 9, 32,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 34, 13, 34, 92, 127, 0, 8, 10,
- 31, 10, 9, 32, 9, 13, 32, 59,
- 0, 9, 11, 12, 14, 127, 9, 13,
- 32, 33, 37, 39, 59, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 59, 61, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 70, 102, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 59, 61, 10, 9, 32,
- 9, 32, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 32, 34, 13, 34, 92, 127, 0,
- 8, 10, 31, 10, 9, 32, 9, 13,
- 32, 59, 0, 9, 11, 12, 14, 127,
- 9, 13, 32, 33, 37, 39, 59, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 58, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 58, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 48, 57, 46, 48, 57,
- 48, 57, 46, 48, 57, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 46, 48,
- 57, 46, 46, 48, 57, 46, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 48, 57, 46, 48, 57,
- 46, 48, 57, 46, 58, 0
-};
-
-static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_single_lengths[] = {
- 0, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 3, 11,
- 1, 2, 10, 9, 5, 1, 2, 4,
- 9, 1, 2, 9, 1, 2, 3, 4,
- 1, 2, 4, 4, 1, 2, 3, 1,
- 0, 8, 1, 2, 2, 2, 2, 1,
- 3, 0, 1, 0, 1, 0, 1, 1,
- 1, 1, 1, 1, 1, 3, 3, 2,
- 2, 2, 2, 2, 0, 3, 3, 3,
- 0, 1, 1, 1, 1, 11, 11, 9,
- 5, 1, 2, 4, 9, 1, 2, 9,
- 1, 2, 3, 4, 1, 2, 4, 0,
- 8, 1, 2, 2, 2, 2, 1, 3,
- 0, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 11, 11, 9, 5,
- 1, 2, 4, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 4, 0, 8,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 2, 2, 2,
- 2, 2, 0, 3, 3, 3, 0, 1,
- 1, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 0, 5, 5, 0, 0, 0, 0,
- 5, 0, 0, 5, 0, 0, 0, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 5, 3, 3, 3, 3, 0, 3,
- 3, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 0, 1, 0, 3, 3, 3,
- 3, 3, 3, 0, 3, 3, 3, 3,
- 1, 1, 1, 0, 0, 5, 5, 5,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 0, 0, 0, 2, 0, 0, 0, 3,
- 5, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 5, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 3, 5,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 1,
- 0, 1, 0, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 3, 3, 1, 1,
- 1, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_P_Charging_Function_Addresses_index_offsets[] = {
- 0, 0, 3, 5, 8, 11, 14, 17,
- 20, 23, 26, 29, 31, 34, 37, 40,
- 43, 46, 49, 52, 55, 57, 60, 63,
- 66, 69, 72, 75, 78, 81, 84, 88,
- 105, 107, 110, 126, 141, 147, 149, 152,
- 157, 172, 174, 177, 192, 194, 197, 201,
- 208, 210, 213, 218, 223, 225, 228, 232,
- 234, 238, 252, 257, 263, 269, 275, 278,
- 283, 290, 292, 295, 297, 300, 302, 305,
- 308, 310, 313, 315, 318, 320, 327, 334,
- 340, 346, 352, 358, 361, 365, 372, 379,
- 386, 388, 391, 394, 396, 398, 415, 432,
- 447, 453, 455, 458, 463, 478, 480, 483,
- 498, 500, 503, 507, 514, 516, 519, 524,
- 528, 542, 547, 553, 559, 565, 568, 573,
- 580, 582, 585, 587, 590, 592, 595, 598,
- 600, 603, 605, 608, 610, 617, 624, 630,
- 636, 642, 648, 651, 655, 662, 669, 676,
- 678, 681, 684, 686, 688, 705, 722, 737,
- 743, 745, 748, 753, 768, 770, 773, 788,
- 790, 793, 797, 804, 806, 809, 814, 818,
- 832, 837, 843, 849, 855, 858, 863, 870,
- 872, 875, 877, 880, 882, 885, 888, 890,
- 893, 895, 898, 900, 907, 914, 920, 926,
- 932, 938, 941, 945, 952, 959, 966, 968,
- 971, 974, 976, 978
-};
-
-static const unsigned char _tsip_machine_parser_header_P_Charging_Function_Addresses_indicies[] = {
- 0, 0, 1, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 1, 12,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 20,
- 1, 21, 21, 1, 22, 22, 1, 23,
- 23, 1, 24, 24, 1, 25, 25, 1,
- 26, 26, 1, 27, 27, 1, 28, 28,
- 1, 29, 29, 1, 29, 29, 30, 1,
- 30, 31, 30, 32, 32, 32, 33, 34,
- 33, 34, 32, 32, 32, 32, 32, 32,
- 1, 35, 1, 36, 36, 1, 36, 36,
- 32, 32, 32, 33, 34, 33, 34, 32,
- 32, 32, 32, 32, 32, 1, 37, 38,
- 37, 39, 39, 39, 40, 41, 39, 39,
- 39, 39, 39, 39, 1, 42, 43, 42,
- 30, 41, 1, 44, 1, 45, 45, 1,
- 45, 45, 30, 41, 1, 41, 46, 41,
- 47, 48, 47, 47, 49, 47, 47, 47,
- 47, 47, 47, 1, 50, 1, 51, 51,
- 1, 51, 52, 51, 47, 48, 47, 47,
- 49, 47, 47, 47, 47, 47, 47, 1,
- 53, 1, 54, 54, 1, 54, 54, 48,
- 1, 55, 56, 57, 1, 1, 1, 48,
- 58, 1, 48, 48, 1, 59, 38, 59,
- 40, 1, 60, 61, 60, 30, 1, 62,
- 1, 63, 63, 1, 63, 63, 30, 1,
- 64, 1, 48, 48, 48, 1, 59, 38,
- 59, 47, 47, 47, 40, 47, 47, 47,
- 47, 47, 47, 1, 66, 65, 65, 65,
- 1, 68, 56, 67, 67, 67, 1, 68,
- 56, 69, 69, 69, 1, 68, 56, 70,
- 70, 70, 1, 68, 56, 1, 72, 71,
- 65, 65, 1, 73, 68, 56, 74, 67,
- 67, 1, 75, 1, 76, 77, 1, 78,
- 1, 79, 80, 1, 81, 1, 56, 82,
- 1, 56, 83, 1, 56, 1, 79, 84,
- 1, 79, 1, 76, 85, 1, 76, 1,
- 73, 68, 56, 86, 69, 69, 1, 73,
- 68, 56, 70, 70, 70, 1, 88, 56,
- 87, 87, 87, 1, 90, 56, 89, 89,
- 89, 1, 90, 56, 91, 91, 91, 1,
- 90, 56, 92, 92, 92, 1, 90, 56,
- 1, 93, 87, 87, 1, 73, 90, 56,
- 94, 89, 89, 1, 73, 90, 56, 95,
- 91, 91, 1, 73, 90, 56, 92, 92,
- 92, 1, 96, 1, 73, 97, 1, 73,
- 98, 1, 73, 1, 72, 1, 37, 38,
- 37, 39, 39, 39, 40, 41, 99, 99,
- 39, 39, 39, 39, 39, 39, 1, 37,
- 38, 37, 39, 39, 39, 40, 41, 100,
- 100, 39, 39, 39, 39, 39, 39, 1,
- 101, 38, 101, 39, 39, 39, 40, 102,
- 39, 39, 39, 39, 39, 39, 1, 103,
- 104, 103, 30, 102, 1, 105, 1, 106,
- 106, 1, 106, 106, 30, 102, 1, 102,
- 107, 102, 108, 109, 108, 108, 110, 108,
- 108, 108, 108, 108, 108, 1, 111, 1,
- 112, 112, 1, 112, 113, 112, 108, 109,
- 108, 108, 110, 108, 108, 108, 108, 108,
- 108, 1, 114, 1, 115, 115, 1, 115,
- 115, 109, 1, 116, 117, 118, 1, 1,
- 1, 109, 119, 1, 109, 109, 1, 120,
- 121, 120, 122, 1, 109, 109, 109, 1,
- 120, 121, 120, 108, 108, 108, 122, 108,
- 108, 108, 108, 108, 108, 1, 124, 123,
- 123, 123, 1, 126, 117, 125, 125, 125,
- 1, 126, 117, 127, 127, 127, 1, 126,
- 117, 128, 128, 128, 1, 126, 117, 1,
- 130, 129, 123, 123, 1, 131, 126, 117,
- 132, 125, 125, 1, 133, 1, 134, 135,
- 1, 136, 1, 137, 138, 1, 139, 1,
- 117, 140, 1, 117, 141, 1, 117, 1,
- 137, 142, 1, 137, 1, 134, 143, 1,
- 134, 1, 131, 126, 117, 144, 127, 127,
- 1, 131, 126, 117, 128, 128, 128, 1,
- 146, 117, 145, 145, 145, 1, 148, 117,
- 147, 147, 147, 1, 148, 117, 149, 149,
- 149, 1, 148, 117, 150, 150, 150, 1,
- 148, 117, 1, 151, 145, 145, 1, 131,
- 148, 117, 152, 147, 147, 1, 131, 148,
- 117, 153, 149, 149, 1, 131, 148, 117,
- 150, 150, 150, 1, 154, 1, 131, 155,
- 1, 131, 156, 1, 131, 1, 130, 1,
- 37, 38, 37, 39, 39, 39, 40, 41,
- 157, 157, 39, 39, 39, 39, 39, 39,
- 1, 37, 38, 37, 39, 39, 39, 40,
- 41, 158, 158, 39, 39, 39, 39, 39,
- 39, 1, 159, 38, 159, 39, 39, 39,
- 40, 160, 39, 39, 39, 39, 39, 39,
- 1, 161, 162, 161, 30, 160, 1, 163,
- 1, 164, 164, 1, 164, 164, 30, 160,
- 1, 160, 165, 160, 166, 167, 166, 166,
- 168, 166, 166, 166, 166, 166, 166, 1,
- 169, 1, 170, 170, 1, 170, 171, 170,
- 166, 167, 166, 166, 168, 166, 166, 166,
- 166, 166, 166, 1, 172, 1, 173, 173,
- 1, 173, 173, 167, 1, 174, 175, 176,
- 1, 1, 1, 167, 177, 1, 167, 167,
- 1, 178, 179, 178, 180, 1, 167, 167,
- 167, 1, 178, 179, 178, 166, 166, 166,
- 180, 166, 166, 166, 166, 166, 166, 1,
- 182, 181, 181, 181, 1, 184, 175, 183,
- 183, 183, 1, 184, 175, 185, 185, 185,
- 1, 184, 175, 186, 186, 186, 1, 184,
- 175, 1, 188, 187, 181, 181, 1, 189,
- 184, 175, 190, 183, 183, 1, 191, 1,
- 192, 193, 1, 194, 1, 195, 196, 1,
- 197, 1, 175, 198, 1, 175, 199, 1,
- 175, 1, 195, 200, 1, 195, 1, 192,
- 201, 1, 192, 1, 189, 184, 175, 202,
- 185, 185, 1, 189, 184, 175, 186, 186,
- 186, 1, 204, 175, 203, 203, 203, 1,
- 206, 175, 205, 205, 205, 1, 206, 175,
- 207, 207, 207, 1, 206, 175, 208, 208,
- 208, 1, 206, 175, 1, 209, 203, 203,
- 1, 189, 206, 175, 210, 205, 205, 1,
- 189, 206, 175, 211, 207, 207, 1, 189,
- 206, 175, 208, 208, 208, 1, 212, 1,
- 189, 213, 1, 189, 214, 1, 189, 1,
- 188, 1, 1, 0
-};
-
-static const unsigned char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 35, 93, 148, 33, 34, 36, 55, 35,
- 31, 40, 36, 37, 38, 39, 41, 57,
- 47, 58, 42, 43, 44, 45, 46, 48,
- 50, 56, 49, 51, 51, 52, 53, 54,
- 203, 59, 92, 60, 63, 61, 62, 64,
- 79, 65, 77, 66, 67, 75, 68, 69,
- 73, 70, 71, 72, 74, 76, 78, 80,
- 88, 81, 84, 82, 83, 85, 86, 87,
- 89, 90, 91, 94, 95, 96, 100, 96,
- 97, 98, 99, 101, 112, 107, 113, 102,
- 103, 104, 105, 106, 108, 110, 111, 109,
- 51, 55, 31, 114, 147, 115, 118, 116,
- 117, 119, 134, 120, 132, 121, 122, 130,
- 123, 124, 128, 125, 126, 127, 129, 131,
- 133, 135, 143, 136, 139, 137, 138, 140,
- 141, 142, 144, 145, 146, 149, 150, 151,
- 155, 151, 152, 153, 154, 156, 167, 162,
- 168, 157, 158, 159, 160, 161, 163, 165,
- 166, 164, 51, 55, 31, 169, 202, 170,
- 173, 171, 172, 174, 189, 175, 187, 176,
- 177, 185, 178, 179, 183, 180, 181, 182,
- 184, 186, 188, 190, 198, 191, 194, 192,
- 193, 195, 196, 197, 199, 200, 201
-};
-
-static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 3, 3, 0, 0, 6, 6, 0,
- 6, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 6, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 6, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 9, 9, 9, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 6,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 13, 13, 13, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_P_Charging_Function_Addresses_start = 1;
-static const int tsip_machine_parser_header_P_Charging_Function_Addresses_first_final = 203;
-static const int tsip_machine_parser_header_P_Charging_Function_Addresses_error = 0;
-
-static const int tsip_machine_parser_header_P_Charging_Function_Addresses_en_main = 1;
-
-
-/* #line 135 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_first_final);
- (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_error);
- (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_en_main);
-
-/* #line 546 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
- {
- cs = tsip_machine_parser_header_P_Charging_Function_Addresses_start;
- }
-
-/* #line 140 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
-
-/* #line 553 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_P_Charging_Function_Addressess_L_t *hdr_p_charging_function_addressess = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_P_Charging_Function_Addresses_t *curr_p_charging_function_addresses = 0;
+
+
+ /* #line 88 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
+ static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_actions[] = {
+ 0, 1, 6, 2, 1, 0, 2, 4,
+ 5, 3, 2, 4, 5, 3, 3, 4,
+ 5
+ };
+
+ static const short _tsip_machine_parser_header_P_Charging_Function_Addresses_key_offsets[] = {
+ 0, 0, 2, 3, 5, 7, 9, 11,
+ 13, 15, 17, 19, 20, 22, 24, 26,
+ 28, 30, 32, 34, 36, 37, 39, 41,
+ 43, 45, 47, 49, 51, 53, 55, 58,
+ 79, 80, 82, 102, 121, 126, 127, 129,
+ 133, 152, 153, 155, 174, 175, 177, 180,
+ 188, 189, 191, 195, 199, 200, 202, 205,
+ 206, 212, 230, 237, 245, 253, 261, 263,
+ 270, 279, 281, 284, 286, 289, 291, 294,
+ 297, 298, 301, 302, 305, 306, 315, 324,
+ 332, 340, 348, 356, 358, 364, 373, 382,
+ 391, 393, 396, 399, 400, 401, 422, 443,
+ 462, 467, 468, 470, 474, 493, 494, 496,
+ 515, 516, 518, 521, 529, 530, 532, 536,
+ 542, 560, 567, 575, 583, 591, 593, 600,
+ 609, 611, 614, 616, 619, 621, 624, 627,
+ 628, 631, 632, 635, 636, 645, 654, 662,
+ 670, 678, 686, 688, 694, 703, 712, 721,
+ 723, 726, 729, 730, 731, 752, 773, 792,
+ 797, 798, 800, 804, 823, 824, 826, 845,
+ 846, 848, 851, 859, 860, 862, 866, 872,
+ 890, 897, 905, 913, 921, 923, 930, 939,
+ 941, 944, 946, 949, 951, 954, 957, 958,
+ 961, 962, 965, 966, 975, 984, 992, 1000,
+ 1008, 1016, 1018, 1024, 1033, 1042, 1051, 1053,
+ 1056, 1059, 1060, 1061
+ };
+
+ static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_keys[] = {
+ 80, 112, 45, 67, 99, 72, 104, 65,
+ 97, 82, 114, 71, 103, 73, 105, 78,
+ 110, 71, 103, 45, 70, 102, 85, 117,
+ 78, 110, 67, 99, 84, 116, 73, 105,
+ 79, 111, 78, 110, 45, 65, 97, 68,
+ 100, 68, 100, 82, 114, 69, 101, 83,
+ 115, 83, 115, 69, 101, 83, 115, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 67, 69, 99, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 67,
+ 69, 99, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 61, 10, 9,
+ 32, 9, 32, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 59, 9, 13, 32, 59, 10,
+ 9, 32, 9, 32, 59, 10, 0, 9,
+ 11, 12, 14, 127, 9, 13, 32, 33,
+ 37, 39, 59, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 58, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 58,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 48, 57, 46, 48,
+ 57, 48, 57, 93, 48, 57, 93, 48,
+ 57, 93, 46, 48, 57, 46, 46, 48,
+ 57, 46, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 46, 48, 57, 46,
+ 58, 9, 13, 32, 33, 37, 39, 59,
+ 61, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 70, 102,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 61, 10, 9, 32, 9, 32,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 34, 13, 34, 92, 127, 0, 8, 10,
+ 31, 10, 9, 32, 9, 13, 32, 59,
+ 0, 9, 11, 12, 14, 127, 9, 13,
+ 32, 33, 37, 39, 59, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 59, 61, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 70, 102, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 59, 61, 10, 9, 32,
+ 9, 32, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 32, 34, 13, 34, 92, 127, 0,
+ 8, 10, 31, 10, 9, 32, 9, 13,
+ 32, 59, 0, 9, 11, 12, 14, 127,
+ 9, 13, 32, 33, 37, 39, 59, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 58, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 58, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 48, 57, 46, 48, 57,
+ 48, 57, 46, 48, 57, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 46, 48,
+ 57, 46, 46, 48, 57, 46, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 48, 57, 46, 48, 57,
+ 46, 48, 57, 46, 58, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_single_lengths[] = {
+ 0, 2, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 3, 11,
+ 1, 2, 10, 9, 5, 1, 2, 4,
+ 9, 1, 2, 9, 1, 2, 3, 4,
+ 1, 2, 4, 4, 1, 2, 3, 1,
+ 0, 8, 1, 2, 2, 2, 2, 1,
+ 3, 0, 1, 0, 1, 0, 1, 1,
+ 1, 1, 1, 1, 1, 3, 3, 2,
+ 2, 2, 2, 2, 0, 3, 3, 3,
+ 0, 1, 1, 1, 1, 11, 11, 9,
+ 5, 1, 2, 4, 9, 1, 2, 9,
+ 1, 2, 3, 4, 1, 2, 4, 0,
+ 8, 1, 2, 2, 2, 2, 1, 3,
+ 0, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 11, 11, 9, 5,
+ 1, 2, 4, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 4, 0, 8,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 2, 2, 2,
+ 2, 2, 0, 3, 3, 3, 0, 1,
+ 1, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 0, 5, 5, 0, 0, 0, 0,
+ 5, 0, 0, 5, 0, 0, 0, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 5, 3, 3, 3, 3, 0, 3,
+ 3, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 0, 1, 0, 3, 3, 3,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 1, 1, 1, 0, 0, 5, 5, 5,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 0, 0, 0, 2, 0, 0, 0, 3,
+ 5, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 5, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 3, 5,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 1, 0, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 1, 1,
+ 1, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_P_Charging_Function_Addresses_index_offsets[] = {
+ 0, 0, 3, 5, 8, 11, 14, 17,
+ 20, 23, 26, 29, 31, 34, 37, 40,
+ 43, 46, 49, 52, 55, 57, 60, 63,
+ 66, 69, 72, 75, 78, 81, 84, 88,
+ 105, 107, 110, 126, 141, 147, 149, 152,
+ 157, 172, 174, 177, 192, 194, 197, 201,
+ 208, 210, 213, 218, 223, 225, 228, 232,
+ 234, 238, 252, 257, 263, 269, 275, 278,
+ 283, 290, 292, 295, 297, 300, 302, 305,
+ 308, 310, 313, 315, 318, 320, 327, 334,
+ 340, 346, 352, 358, 361, 365, 372, 379,
+ 386, 388, 391, 394, 396, 398, 415, 432,
+ 447, 453, 455, 458, 463, 478, 480, 483,
+ 498, 500, 503, 507, 514, 516, 519, 524,
+ 528, 542, 547, 553, 559, 565, 568, 573,
+ 580, 582, 585, 587, 590, 592, 595, 598,
+ 600, 603, 605, 608, 610, 617, 624, 630,
+ 636, 642, 648, 651, 655, 662, 669, 676,
+ 678, 681, 684, 686, 688, 705, 722, 737,
+ 743, 745, 748, 753, 768, 770, 773, 788,
+ 790, 793, 797, 804, 806, 809, 814, 818,
+ 832, 837, 843, 849, 855, 858, 863, 870,
+ 872, 875, 877, 880, 882, 885, 888, 890,
+ 893, 895, 898, 900, 907, 914, 920, 926,
+ 932, 938, 941, 945, 952, 959, 966, 968,
+ 971, 974, 976, 978
+ };
+
+ static const unsigned char _tsip_machine_parser_header_P_Charging_Function_Addresses_indicies[] = {
+ 0, 0, 1, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 1, 12,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 20,
+ 1, 21, 21, 1, 22, 22, 1, 23,
+ 23, 1, 24, 24, 1, 25, 25, 1,
+ 26, 26, 1, 27, 27, 1, 28, 28,
+ 1, 29, 29, 1, 29, 29, 30, 1,
+ 30, 31, 30, 32, 32, 32, 33, 34,
+ 33, 34, 32, 32, 32, 32, 32, 32,
+ 1, 35, 1, 36, 36, 1, 36, 36,
+ 32, 32, 32, 33, 34, 33, 34, 32,
+ 32, 32, 32, 32, 32, 1, 37, 38,
+ 37, 39, 39, 39, 40, 41, 39, 39,
+ 39, 39, 39, 39, 1, 42, 43, 42,
+ 30, 41, 1, 44, 1, 45, 45, 1,
+ 45, 45, 30, 41, 1, 41, 46, 41,
+ 47, 48, 47, 47, 49, 47, 47, 47,
+ 47, 47, 47, 1, 50, 1, 51, 51,
+ 1, 51, 52, 51, 47, 48, 47, 47,
+ 49, 47, 47, 47, 47, 47, 47, 1,
+ 53, 1, 54, 54, 1, 54, 54, 48,
+ 1, 55, 56, 57, 1, 1, 1, 48,
+ 58, 1, 48, 48, 1, 59, 38, 59,
+ 40, 1, 60, 61, 60, 30, 1, 62,
+ 1, 63, 63, 1, 63, 63, 30, 1,
+ 64, 1, 48, 48, 48, 1, 59, 38,
+ 59, 47, 47, 47, 40, 47, 47, 47,
+ 47, 47, 47, 1, 66, 65, 65, 65,
+ 1, 68, 56, 67, 67, 67, 1, 68,
+ 56, 69, 69, 69, 1, 68, 56, 70,
+ 70, 70, 1, 68, 56, 1, 72, 71,
+ 65, 65, 1, 73, 68, 56, 74, 67,
+ 67, 1, 75, 1, 76, 77, 1, 78,
+ 1, 79, 80, 1, 81, 1, 56, 82,
+ 1, 56, 83, 1, 56, 1, 79, 84,
+ 1, 79, 1, 76, 85, 1, 76, 1,
+ 73, 68, 56, 86, 69, 69, 1, 73,
+ 68, 56, 70, 70, 70, 1, 88, 56,
+ 87, 87, 87, 1, 90, 56, 89, 89,
+ 89, 1, 90, 56, 91, 91, 91, 1,
+ 90, 56, 92, 92, 92, 1, 90, 56,
+ 1, 93, 87, 87, 1, 73, 90, 56,
+ 94, 89, 89, 1, 73, 90, 56, 95,
+ 91, 91, 1, 73, 90, 56, 92, 92,
+ 92, 1, 96, 1, 73, 97, 1, 73,
+ 98, 1, 73, 1, 72, 1, 37, 38,
+ 37, 39, 39, 39, 40, 41, 99, 99,
+ 39, 39, 39, 39, 39, 39, 1, 37,
+ 38, 37, 39, 39, 39, 40, 41, 100,
+ 100, 39, 39, 39, 39, 39, 39, 1,
+ 101, 38, 101, 39, 39, 39, 40, 102,
+ 39, 39, 39, 39, 39, 39, 1, 103,
+ 104, 103, 30, 102, 1, 105, 1, 106,
+ 106, 1, 106, 106, 30, 102, 1, 102,
+ 107, 102, 108, 109, 108, 108, 110, 108,
+ 108, 108, 108, 108, 108, 1, 111, 1,
+ 112, 112, 1, 112, 113, 112, 108, 109,
+ 108, 108, 110, 108, 108, 108, 108, 108,
+ 108, 1, 114, 1, 115, 115, 1, 115,
+ 115, 109, 1, 116, 117, 118, 1, 1,
+ 1, 109, 119, 1, 109, 109, 1, 120,
+ 121, 120, 122, 1, 109, 109, 109, 1,
+ 120, 121, 120, 108, 108, 108, 122, 108,
+ 108, 108, 108, 108, 108, 1, 124, 123,
+ 123, 123, 1, 126, 117, 125, 125, 125,
+ 1, 126, 117, 127, 127, 127, 1, 126,
+ 117, 128, 128, 128, 1, 126, 117, 1,
+ 130, 129, 123, 123, 1, 131, 126, 117,
+ 132, 125, 125, 1, 133, 1, 134, 135,
+ 1, 136, 1, 137, 138, 1, 139, 1,
+ 117, 140, 1, 117, 141, 1, 117, 1,
+ 137, 142, 1, 137, 1, 134, 143, 1,
+ 134, 1, 131, 126, 117, 144, 127, 127,
+ 1, 131, 126, 117, 128, 128, 128, 1,
+ 146, 117, 145, 145, 145, 1, 148, 117,
+ 147, 147, 147, 1, 148, 117, 149, 149,
+ 149, 1, 148, 117, 150, 150, 150, 1,
+ 148, 117, 1, 151, 145, 145, 1, 131,
+ 148, 117, 152, 147, 147, 1, 131, 148,
+ 117, 153, 149, 149, 1, 131, 148, 117,
+ 150, 150, 150, 1, 154, 1, 131, 155,
+ 1, 131, 156, 1, 131, 1, 130, 1,
+ 37, 38, 37, 39, 39, 39, 40, 41,
+ 157, 157, 39, 39, 39, 39, 39, 39,
+ 1, 37, 38, 37, 39, 39, 39, 40,
+ 41, 158, 158, 39, 39, 39, 39, 39,
+ 39, 1, 159, 38, 159, 39, 39, 39,
+ 40, 160, 39, 39, 39, 39, 39, 39,
+ 1, 161, 162, 161, 30, 160, 1, 163,
+ 1, 164, 164, 1, 164, 164, 30, 160,
+ 1, 160, 165, 160, 166, 167, 166, 166,
+ 168, 166, 166, 166, 166, 166, 166, 1,
+ 169, 1, 170, 170, 1, 170, 171, 170,
+ 166, 167, 166, 166, 168, 166, 166, 166,
+ 166, 166, 166, 1, 172, 1, 173, 173,
+ 1, 173, 173, 167, 1, 174, 175, 176,
+ 1, 1, 1, 167, 177, 1, 167, 167,
+ 1, 178, 179, 178, 180, 1, 167, 167,
+ 167, 1, 178, 179, 178, 166, 166, 166,
+ 180, 166, 166, 166, 166, 166, 166, 1,
+ 182, 181, 181, 181, 1, 184, 175, 183,
+ 183, 183, 1, 184, 175, 185, 185, 185,
+ 1, 184, 175, 186, 186, 186, 1, 184,
+ 175, 1, 188, 187, 181, 181, 1, 189,
+ 184, 175, 190, 183, 183, 1, 191, 1,
+ 192, 193, 1, 194, 1, 195, 196, 1,
+ 197, 1, 175, 198, 1, 175, 199, 1,
+ 175, 1, 195, 200, 1, 195, 1, 192,
+ 201, 1, 192, 1, 189, 184, 175, 202,
+ 185, 185, 1, 189, 184, 175, 186, 186,
+ 186, 1, 204, 175, 203, 203, 203, 1,
+ 206, 175, 205, 205, 205, 1, 206, 175,
+ 207, 207, 207, 1, 206, 175, 208, 208,
+ 208, 1, 206, 175, 1, 209, 203, 203,
+ 1, 189, 206, 175, 210, 205, 205, 1,
+ 189, 206, 175, 211, 207, 207, 1, 189,
+ 206, 175, 208, 208, 208, 1, 212, 1,
+ 189, 213, 1, 189, 214, 1, 189, 1,
+ 188, 1, 1, 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 35, 93, 148, 33, 34, 36, 55, 35,
+ 31, 40, 36, 37, 38, 39, 41, 57,
+ 47, 58, 42, 43, 44, 45, 46, 48,
+ 50, 56, 49, 51, 51, 52, 53, 54,
+ 203, 59, 92, 60, 63, 61, 62, 64,
+ 79, 65, 77, 66, 67, 75, 68, 69,
+ 73, 70, 71, 72, 74, 76, 78, 80,
+ 88, 81, 84, 82, 83, 85, 86, 87,
+ 89, 90, 91, 94, 95, 96, 100, 96,
+ 97, 98, 99, 101, 112, 107, 113, 102,
+ 103, 104, 105, 106, 108, 110, 111, 109,
+ 51, 55, 31, 114, 147, 115, 118, 116,
+ 117, 119, 134, 120, 132, 121, 122, 130,
+ 123, 124, 128, 125, 126, 127, 129, 131,
+ 133, 135, 143, 136, 139, 137, 138, 140,
+ 141, 142, 144, 145, 146, 149, 150, 151,
+ 155, 151, 152, 153, 154, 156, 167, 162,
+ 168, 157, 158, 159, 160, 161, 163, 165,
+ 166, 164, 51, 55, 31, 169, 202, 170,
+ 173, 171, 172, 174, 189, 175, 187, 176,
+ 177, 185, 178, 179, 183, 180, 181, 182,
+ 184, 186, 188, 190, 198, 191, 194, 192,
+ 193, 195, 196, 197, 199, 200, 201
+ };
+
+ static const char _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 3, 3, 0, 0, 6, 6, 0,
+ 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 6, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 6, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 13, 13, 13, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_P_Charging_Function_Addresses_start = 1;
+ static const int tsip_machine_parser_header_P_Charging_Function_Addresses_first_final = 203;
+ static const int tsip_machine_parser_header_P_Charging_Function_Addresses_error = 0;
+
+ static const int tsip_machine_parser_header_P_Charging_Function_Addresses_en_main = 1;
+
+
+ /* #line 135 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_first_final);
+ (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_error);
+ (void)(tsip_machine_parser_header_P_Charging_Function_Addresses_en_main);
+
+ /* #line 546 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
+ {
+ cs = tsip_machine_parser_header_P_Charging_Function_Addresses_start;
+ }
+
+ /* #line 140 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+
+ /* #line 553 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_keys + _tsip_machine_parser_header_P_Charging_Function_Addresses_key_offsets[cs];
- _trans = _tsip_machine_parser_header_P_Charging_Function_Addresses_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_P_Charging_Function_Addresses_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_P_Charging_Function_Addresses_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_keys + _tsip_machine_parser_header_P_Charging_Function_Addresses_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_P_Charging_Function_Addresses_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_P_Charging_Function_Addresses_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_P_Charging_Function_Addresses_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_P_Charging_Function_Addresses_indicies[_trans];
- cs = _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_P_Charging_Function_Addresses_actions + _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- if(!curr_p_charging_function_addresses){
- curr_p_charging_function_addresses = tsip_header_P_Charging_Function_Addresses_create();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- if(!curr_p_charging_function_addresses->ccf){
- TSK_PARSER_SET_STRING(curr_p_charging_function_addresses->ccf);
- }
- }
- break;
- case 3:
-/* #line 67 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- if(!curr_p_charging_function_addresses->ecf){
- TSK_PARSER_SET_STRING(curr_p_charging_function_addresses->ecf);
- }
- }
- break;
- case 4:
-/* #line 73 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- if(curr_p_charging_function_addresses){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_p_charging_function_addresses));
- }
- }
- break;
- case 5:
-/* #line 79 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- if(curr_p_charging_function_addresses){
- tsk_list_push_back_data(hdr_p_charging_function_addressess, ((void**) &curr_p_charging_function_addresses));
- }
- }
- break;
- case 6:
-/* #line 85 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- {
- }
- break;
-/* #line 678 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_P_Charging_Function_Addresses_indicies[_trans];
+ cs = _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_P_Charging_Function_Addresses_actions + _tsip_machine_parser_header_P_Charging_Function_Addresses_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ if(!curr_p_charging_function_addresses) {
+ curr_p_charging_function_addresses = tsip_header_P_Charging_Function_Addresses_create();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ if(!curr_p_charging_function_addresses->ccf) {
+ TSK_PARSER_SET_STRING(curr_p_charging_function_addresses->ccf);
+ }
+ }
+ break;
+ case 3:
+ /* #line 67 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ if(!curr_p_charging_function_addresses->ecf) {
+ TSK_PARSER_SET_STRING(curr_p_charging_function_addresses->ecf);
+ }
+ }
+ break;
+ case 4:
+ /* #line 73 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ if(curr_p_charging_function_addresses) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_p_charging_function_addresses));
+ }
+ }
+ break;
+ case 5:
+ /* #line 79 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ if(curr_p_charging_function_addresses) {
+ tsk_list_push_back_data(hdr_p_charging_function_addressess, ((void**) &curr_p_charging_function_addresses));
+ }
+ }
+ break;
+ case 6:
+ /* #line 85 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ {
+ }
+ break;
+ /* #line 678 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 141 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
-
- if( cs <
-/* #line 694 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
-203
-/* #line 142 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'P-Charging-Function-Addresses' header.");
- TSK_OBJECT_SAFE_FREE(curr_p_charging_function_addresses);
- TSK_OBJECT_SAFE_FREE(hdr_p_charging_function_addressess);
- }
-
- return hdr_p_charging_function_addressess;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 141 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+
+ if( cs <
+ /* #line 694 "./src/headers/tsip_header_P_Charging_Function_Addresses.c" */
+ 203
+ /* #line 142 "./ragel/tsip_parser_header_P_Charging_Function_Addresses.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'P-Charging-Function-Addresses' header.");
+ TSK_OBJECT_SAFE_FREE(curr_p_charging_function_addresses);
+ TSK_OBJECT_SAFE_FREE(hdr_p_charging_function_addressess);
+ }
+
+ return hdr_p_charging_function_addressess;
}
@@ -712,38 +723,37 @@ _again:
static tsk_object_t* tsip_header_P_Charging_Function_Addresses_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = self;
- if(P_Charging_Function_Addresses){
- TSIP_HEADER(P_Charging_Function_Addresses)->type = tsip_htype_P_Charging_Function_Addresses;
- TSIP_HEADER(P_Charging_Function_Addresses)->serialize = tsip_header_P_Charging_Function_Addresses_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P_Charging_Function_Addresses header.");
- }
- return self;
+ tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = self;
+ if(P_Charging_Function_Addresses) {
+ TSIP_HEADER(P_Charging_Function_Addresses)->type = tsip_htype_P_Charging_Function_Addresses;
+ TSIP_HEADER(P_Charging_Function_Addresses)->serialize = tsip_header_P_Charging_Function_Addresses_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P_Charging_Function_Addresses header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_P_Charging_Function_Addresses_dtor(tsk_object_t *self)
{
- tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = self;
- if(P_Charging_Function_Addresses){
- TSK_FREE(P_Charging_Function_Addresses->ecf);
- TSK_FREE(P_Charging_Function_Addresses->ccf);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Charging_Function_Addresses));
- }
- else{
- TSK_DEBUG_ERROR("Null P_Charging_Function_Addresses header.");
- }
-
- return self;
+ tsip_header_P_Charging_Function_Addresses_t *P_Charging_Function_Addresses = self;
+ if(P_Charging_Function_Addresses) {
+ TSK_FREE(P_Charging_Function_Addresses->ecf);
+ TSK_FREE(P_Charging_Function_Addresses->ccf);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(P_Charging_Function_Addresses));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P_Charging_Function_Addresses header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_P_Charging_Function_Addresses_def_s =
-{
- sizeof(tsip_header_P_Charging_Function_Addresses_t),
- tsip_header_P_Charging_Function_Addresses_ctor,
- tsip_header_P_Charging_Function_Addresses_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_P_Charging_Function_Addresses_def_s = {
+ sizeof(tsip_header_P_Charging_Function_Addresses_t),
+ tsip_header_P_Charging_Function_Addresses_ctor,
+ tsip_header_P_Charging_Function_Addresses_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_P_Charging_Function_Addresses_def_t = &tsip_header_P_Charging_Function_Addresses_def_s;
diff --git a/tinySIP/src/headers/tsip_header_P_Preferred_Identity.c b/tinySIP/src/headers/tsip_header_P_Preferred_Identity.c
index 334cfe6..58a0aa2 100755
--- a/tinySIP/src/headers/tsip_header_P_Preferred_Identity.c
+++ b/tinySIP/src/headers/tsip_header_P_Preferred_Identity.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,564 +56,575 @@
tsip_header_P_Preferred_Identity_t* tsip_header_P_Preferred_Identity_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_P_PREFERRED_IDENTITY_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_P_PREFERRED_IDENTITY_VA_ARGS(uri));
}
tsip_header_P_Preferred_Identity_t* tsip_header_P_Preferred_Identity_create_null()
{
- return tsip_header_P_Preferred_Identity_create(tsk_null);
+ return tsip_header_P_Preferred_Identity_create(tsk_null);
}
int tsip_header_Preferred_Identity_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- int ret;
- const tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = (const tsip_header_P_Preferred_Identity_t *)header;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(P_Preferred_Identity->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- return ret;
- }
- return -1;
+ if(header) {
+ int ret;
+ const tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = (const tsip_header_P_Preferred_Identity_t *)header;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(P_Preferred_Identity->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ return ret;
+ }
+ return -1;
}
tsip_header_P_Preferred_Identity_t *tsip_header_P_Preferred_Identity_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_P_Preferred_Identity_t *hdr_pi = tsip_header_P_Preferred_Identity_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 94 "./src/headers/tsip_header_P_Preferred_Identity.c" */
-static const char _tsip_machine_parser_header_P_Preferred_Identity_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 2, 1, 2, 2, 2, 1
-};
-
-static const short _tsip_machine_parser_header_P_Preferred_Identity_key_offsets[] = {
- 0, 0, 2, 3, 5, 7, 9, 11,
- 13, 15, 17, 19, 21, 22, 24, 26,
- 28, 30, 32, 34, 36, 38, 41, 62,
- 63, 65, 86, 87, 89, 92, 96, 108,
- 111, 111, 112, 116, 117, 138, 139, 141,
- 162, 179, 197, 201, 202, 204, 212, 213,
- 215, 219, 225, 237, 240, 240, 244, 264,
- 280, 297, 302, 310, 323, 328, 332, 337,
- 358, 375, 393, 399, 408, 418, 424, 449,
- 471, 494, 503, 514, 523, 528, 552, 573,
- 595, 603, 613, 625, 628, 628, 632, 652,
- 668, 685, 690, 698, 711, 716, 720, 725,
- 746, 763, 781, 787, 796, 806, 812, 837,
- 859, 882, 891, 902, 911, 916, 940, 961,
- 983, 991, 1001
-};
-
-static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_keys[] = {
- 80, 112, 45, 80, 112, 82, 114, 69,
- 101, 70, 102, 69, 101, 82, 114, 82,
- 114, 69, 101, 68, 100, 45, 73, 105,
- 68, 100, 69, 101, 78, 110, 84, 116,
- 73, 105, 84, 116, 89, 121, 9, 32,
- 58, 9, 13, 32, 33, 34, 37, 39,
- 60, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 10, 9,
- 32, 9, 13, 32, 33, 34, 37, 39,
- 60, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 10, 9,
- 32, 9, 32, 60, 65, 90, 97, 122,
- 9, 32, 43, 58, 45, 46, 48, 57,
- 65, 90, 97, 122, 9, 32, 58, 62,
- 9, 13, 32, 44, 10, 9, 13, 32,
- 33, 34, 37, 39, 60, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 60, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 60, 10, 9, 32, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 60, 0, 9, 11, 12, 14,
- 127, 9, 32, 43, 58, 45, 46, 48,
- 57, 65, 90, 97, 122, 9, 32, 58,
- 9, 13, 32, 44, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 126, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 60,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 60, 9, 13,
- 32, 44, 65, 90, 97, 122, 9, 13,
- 32, 44, 58, 43, 46, 48, 57, 65,
- 90, 97, 122, 9, 13, 32, 44, 58,
- 9, 13, 32, 44, 9, 13, 32, 44,
- 62, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 62, 126, 42, 46, 48, 57,
- 65, 90, 95, 96, 97, 122, 9, 13,
- 32, 33, 37, 39, 44, 62, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 60, 62,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 60, 62, 9,
- 13, 32, 44, 62, 65, 90, 97, 122,
- 9, 13, 32, 34, 44, 62, 92, 127,
- 0, 31, 9, 13, 32, 44, 60, 62,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 60, 62, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 62, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 44, 60,
- 62, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 62, 0, 8, 11, 127, 9,
- 13, 32, 34, 44, 60, 62, 92, 127,
- 0, 31, 9, 13, 32, 34, 44, 92,
- 127, 0, 31, 9, 13, 32, 44, 60,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 60, 92, 126, 127, 0, 31, 42, 46,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 92, 126, 127, 0, 31, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 0,
- 8, 11, 127, 9, 13, 32, 34, 44,
- 60, 92, 127, 0, 31, 9, 32, 43,
- 58, 45, 46, 48, 57, 65, 90, 97,
- 122, 9, 32, 58, 9, 13, 32, 44,
- 9, 13, 32, 33, 34, 37, 39, 44,
- 60, 126, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 60, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 60, 9, 13, 32, 44, 65, 90,
- 97, 122, 9, 13, 32, 44, 58, 43,
- 46, 48, 57, 65, 90, 97, 122, 9,
- 13, 32, 44, 58, 9, 13, 32, 44,
- 9, 13, 32, 44, 62, 9, 13, 32,
- 33, 34, 37, 39, 44, 60, 62, 126,
- 42, 46, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 37, 39,
- 44, 62, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 60, 62, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 60, 62, 9, 13, 32, 44, 62,
- 65, 90, 97, 122, 9, 13, 32, 34,
- 44, 62, 92, 127, 0, 31, 9, 13,
- 32, 44, 60, 62, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 62, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 34, 37, 39, 44, 62, 92, 126,
- 127, 0, 31, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 44, 60, 62, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 44, 62, 0,
- 8, 11, 127, 9, 13, 32, 34, 44,
- 60, 62, 92, 127, 0, 31, 9, 13,
- 32, 34, 44, 92, 127, 0, 31, 9,
- 13, 32, 44, 60, 9, 13, 32, 33,
- 34, 37, 39, 44, 60, 92, 126, 127,
- 0, 31, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 34, 37, 39, 44, 92, 126, 127, 0,
- 31, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 44, 60, 92, 126, 127, 0, 31, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 0, 8, 11, 127, 9,
- 13, 32, 34, 44, 60, 92, 127, 0,
- 31, 0
-};
-
-static const char _tsip_machine_parser_header_P_Preferred_Identity_single_lengths[] = {
- 0, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 3, 9, 1,
- 2, 9, 1, 2, 3, 0, 4, 3,
- 0, 1, 4, 1, 9, 1, 2, 9,
- 7, 8, 4, 1, 2, 4, 1, 2,
- 4, 0, 4, 3, 0, 4, 10, 8,
- 9, 5, 4, 5, 5, 4, 5, 11,
- 9, 10, 6, 5, 8, 6, 13, 12,
- 13, 5, 9, 7, 5, 12, 11, 12,
- 4, 8, 4, 3, 0, 4, 10, 8,
- 9, 5, 4, 5, 5, 4, 5, 11,
- 9, 10, 6, 5, 8, 6, 13, 12,
- 13, 5, 9, 7, 5, 12, 11, 12,
- 4, 8, 0
-};
-
-static const char _tsip_machine_parser_header_P_Preferred_Identity_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 6, 0,
- 0, 6, 0, 0, 0, 2, 4, 0,
- 0, 0, 0, 0, 6, 0, 0, 6,
- 5, 5, 0, 0, 0, 2, 0, 0,
- 0, 3, 4, 0, 0, 0, 5, 4,
- 4, 0, 2, 4, 0, 0, 0, 5,
- 4, 4, 0, 2, 1, 0, 6, 5,
- 5, 2, 1, 1, 0, 6, 5, 5,
- 2, 1, 4, 0, 0, 0, 5, 4,
- 4, 0, 2, 4, 0, 0, 0, 5,
- 4, 4, 0, 2, 1, 0, 6, 5,
- 5, 2, 1, 1, 0, 6, 5, 5,
- 2, 1, 0
-};
-
-static const short _tsip_machine_parser_header_P_Preferred_Identity_index_offsets[] = {
- 0, 0, 3, 5, 8, 11, 14, 17,
- 20, 23, 26, 29, 32, 34, 37, 40,
- 43, 46, 49, 52, 55, 58, 62, 78,
- 80, 83, 99, 101, 104, 108, 111, 120,
- 124, 125, 127, 132, 134, 150, 152, 155,
- 171, 184, 198, 203, 205, 208, 215, 217,
- 220, 225, 229, 238, 242, 243, 248, 264,
- 277, 291, 297, 304, 314, 320, 325, 331,
- 348, 362, 377, 384, 392, 402, 409, 429,
- 447, 466, 474, 485, 494, 500, 519, 536,
- 554, 561, 571, 580, 584, 585, 590, 606,
- 619, 633, 639, 646, 656, 662, 667, 673,
- 690, 704, 719, 726, 734, 744, 751, 771,
- 789, 808, 816, 827, 836, 842, 861, 878,
- 896, 903, 913
-};
-
-static const unsigned char _tsip_machine_parser_header_P_Preferred_Identity_indicies[] = {
- 0, 0, 1, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 15, 15, 1, 16, 16, 1, 17, 17,
- 1, 18, 18, 1, 19, 19, 1, 20,
- 20, 1, 20, 20, 21, 1, 21, 22,
- 21, 23, 24, 23, 23, 25, 23, 23,
- 23, 23, 26, 23, 26, 1, 27, 1,
- 28, 28, 1, 28, 29, 28, 23, 24,
- 23, 23, 25, 23, 23, 23, 23, 26,
- 23, 26, 1, 30, 1, 31, 31, 1,
- 31, 31, 25, 1, 32, 32, 1, 33,
- 33, 34, 35, 34, 34, 34, 34, 1,
- 33, 33, 35, 1, 36, 37, 36, 38,
- 39, 38, 40, 1, 41, 1, 40, 42,
- 40, 23, 24, 23, 23, 25, 23, 23,
- 23, 23, 43, 23, 43, 1, 44, 1,
- 45, 45, 1, 45, 29, 45, 23, 24,
- 23, 23, 25, 23, 23, 23, 23, 43,
- 23, 43, 1, 46, 47, 46, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 1,
- 49, 50, 49, 48, 48, 48, 51, 48,
- 48, 48, 48, 48, 48, 1, 52, 29,
- 52, 25, 1, 53, 1, 46, 46, 1,
- 55, 56, 57, 1, 1, 1, 54, 58,
- 1, 54, 54, 1, 49, 50, 49, 51,
- 1, 54, 54, 54, 1, 59, 59, 60,
- 61, 60, 60, 60, 60, 1, 59, 59,
- 61, 1, 62, 63, 64, 63, 65, 62,
- 65, 64, 65, 66, 67, 66, 66, 65,
- 68, 66, 66, 66, 69, 66, 69, 62,
- 70, 64, 70, 71, 71, 71, 65, 71,
- 71, 71, 71, 71, 62, 72, 64, 72,
- 71, 71, 71, 65, 73, 71, 71, 71,
- 71, 71, 62, 74, 64, 74, 65, 68,
- 62, 63, 64, 63, 65, 75, 75, 62,
- 76, 64, 76, 65, 78, 77, 77, 77,
- 77, 62, 76, 64, 76, 65, 78, 62,
- 80, 64, 80, 81, 79, 80, 64, 80,
- 81, 63, 79, 81, 64, 81, 82, 83,
- 82, 82, 81, 84, 63, 82, 82, 82,
- 85, 82, 85, 79, 86, 64, 86, 87,
- 87, 87, 81, 63, 87, 87, 87, 87,
- 87, 79, 88, 64, 88, 87, 87, 87,
- 81, 89, 63, 87, 87, 87, 87, 87,
- 79, 90, 64, 90, 81, 84, 63, 79,
- 80, 64, 80, 81, 63, 85, 85, 79,
- 92, 64, 92, 93, 94, 63, 95, 79,
- 79, 91, 88, 64, 88, 81, 89, 63,
- 79, 81, 64, 81, 96, 97, 96, 96,
- 94, 84, 63, 95, 96, 79, 79, 96,
- 96, 83, 96, 83, 91, 98, 64, 98,
- 99, 93, 99, 99, 94, 63, 95, 99,
- 79, 79, 99, 99, 99, 99, 91, 88,
- 64, 88, 99, 93, 99, 99, 94, 89,
- 63, 95, 99, 79, 79, 99, 99, 99,
- 99, 91, 92, 64, 92, 94, 63, 91,
- 91, 79, 88, 64, 88, 93, 94, 89,
- 63, 95, 79, 79, 91, 101, 64, 101,
- 102, 103, 104, 62, 62, 100, 72, 64,
- 72, 65, 73, 62, 65, 64, 65, 105,
- 106, 105, 105, 103, 68, 104, 105, 62,
- 62, 105, 105, 67, 105, 67, 100, 107,
- 64, 107, 108, 102, 108, 108, 103, 104,
- 108, 62, 62, 108, 108, 108, 108, 100,
- 72, 64, 72, 108, 102, 108, 108, 103,
- 73, 104, 108, 62, 62, 108, 108, 108,
- 108, 100, 101, 64, 101, 103, 100, 100,
- 62, 72, 64, 72, 102, 103, 73, 104,
- 62, 62, 100, 109, 109, 110, 111, 110,
- 110, 110, 110, 1, 109, 109, 111, 1,
- 112, 113, 64, 113, 114, 112, 114, 64,
- 114, 115, 116, 115, 115, 114, 117, 115,
- 115, 115, 118, 115, 118, 112, 119, 64,
- 119, 120, 120, 120, 114, 120, 120, 120,
- 120, 120, 112, 121, 64, 121, 120, 120,
- 120, 114, 122, 120, 120, 120, 120, 120,
- 112, 123, 64, 123, 114, 117, 112, 113,
- 64, 113, 114, 124, 124, 112, 125, 64,
- 125, 114, 127, 126, 126, 126, 126, 112,
- 125, 64, 125, 114, 127, 112, 129, 64,
- 129, 130, 128, 129, 64, 129, 130, 113,
- 128, 130, 64, 130, 131, 132, 131, 131,
- 130, 133, 113, 131, 131, 131, 134, 131,
- 134, 128, 135, 64, 135, 136, 136, 136,
- 130, 113, 136, 136, 136, 136, 136, 128,
- 137, 64, 137, 136, 136, 136, 130, 138,
- 113, 136, 136, 136, 136, 136, 128, 139,
- 64, 139, 130, 133, 113, 128, 129, 64,
- 129, 130, 113, 134, 134, 128, 141, 64,
- 141, 142, 143, 113, 144, 128, 128, 140,
- 137, 64, 137, 130, 138, 113, 128, 130,
- 64, 130, 145, 146, 145, 145, 143, 133,
- 113, 144, 145, 128, 128, 145, 145, 132,
- 145, 132, 140, 147, 64, 147, 148, 142,
- 148, 148, 143, 113, 144, 148, 128, 128,
- 148, 148, 148, 148, 140, 137, 64, 137,
- 148, 142, 148, 148, 143, 138, 113, 144,
- 148, 128, 128, 148, 148, 148, 148, 140,
- 141, 64, 141, 143, 113, 140, 140, 128,
- 137, 64, 137, 142, 143, 138, 113, 144,
- 128, 128, 140, 150, 64, 150, 151, 152,
- 153, 112, 112, 149, 121, 64, 121, 114,
- 122, 112, 114, 64, 114, 154, 155, 154,
- 154, 152, 117, 153, 154, 112, 112, 154,
- 154, 116, 154, 116, 149, 156, 64, 156,
- 157, 151, 157, 157, 152, 153, 157, 112,
- 112, 157, 157, 157, 157, 149, 121, 64,
- 121, 157, 151, 157, 157, 152, 122, 153,
- 157, 112, 112, 157, 157, 157, 157, 149,
- 150, 64, 150, 152, 149, 149, 112, 121,
- 64, 121, 151, 152, 122, 153, 112, 112,
- 149, 1, 0
-};
-
-static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 40,
- 45, 29, 82, 24, 25, 26, 27, 28,
- 30, 31, 30, 32, 33, 34, 34, 35,
- 36, 114, 37, 50, 38, 39, 41, 43,
- 40, 42, 26, 29, 42, 44, 45, 46,
- 48, 49, 47, 51, 50, 52, 53, 53,
- 35, 54, 55, 75, 58, 53, 56, 55,
- 57, 58, 57, 59, 60, 59, 61, 62,
- 62, 63, 64, 68, 67, 62, 65, 64,
- 66, 67, 66, 68, 68, 69, 70, 73,
- 71, 74, 72, 71, 75, 75, 76, 77,
- 80, 78, 81, 79, 78, 83, 82, 84,
- 85, 85, 86, 87, 107, 90, 85, 88,
- 87, 89, 90, 89, 91, 92, 91, 93,
- 94, 94, 95, 96, 100, 99, 94, 97,
- 96, 98, 99, 98, 100, 100, 101, 102,
- 105, 103, 106, 104, 103, 107, 107, 108,
- 109, 112, 110, 113, 111, 110
-};
-
-static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 1, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 3, 0, 0,
- 0, 7, 0, 1, 0, 0, 0, 0,
- 0, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 3,
- 3, 3, 1, 1, 0, 1, 3, 0,
- 12, 5, 3, 1, 3, 0, 0, 0,
- 3, 3, 1, 1, 0, 1, 3, 0,
- 12, 5, 3, 0, 3, 0, 3, 0,
- 1, 1, 3, 0, 0, 3, 0, 3,
- 0, 1, 1, 3, 0, 0, 0, 0,
- 0, 3, 3, 1, 1, 0, 1, 3,
- 0, 9, 5, 3, 1, 3, 0, 0,
- 0, 3, 3, 1, 1, 0, 1, 3,
- 0, 9, 5, 3, 0, 3, 0, 3,
- 0, 1, 1, 3, 0, 0, 3, 0,
- 3, 0, 1, 1, 3, 0
-};
-
-static const int tsip_machine_parser_header_P_Preferred_Identity_start = 1;
-static const int tsip_machine_parser_header_P_Preferred_Identity_first_final = 114;
-static const int tsip_machine_parser_header_P_Preferred_Identity_error = 0;
-
-static const int tsip_machine_parser_header_P_Preferred_Identity_en_main = 1;
-
-
-/* #line 133 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_P_Preferred_Identity_first_final);
- (void)(tsip_machine_parser_header_P_Preferred_Identity_error);
- (void)(tsip_machine_parser_header_P_Preferred_Identity_en_main);
-
-/* #line 478 "./src/headers/tsip_header_P_Preferred_Identity.c" */
- {
- cs = tsip_machine_parser_header_P_Preferred_Identity_start;
- }
-
-/* #line 138 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
-
-/* #line 485 "./src/headers/tsip_header_P_Preferred_Identity.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_P_Preferred_Identity_t *hdr_pi = tsip_header_P_Preferred_Identity_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 94 "./src/headers/tsip_header_P_Preferred_Identity.c" */
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 2, 1, 2, 2, 2, 1
+ };
+
+ static const short _tsip_machine_parser_header_P_Preferred_Identity_key_offsets[] = {
+ 0, 0, 2, 3, 5, 7, 9, 11,
+ 13, 15, 17, 19, 21, 22, 24, 26,
+ 28, 30, 32, 34, 36, 38, 41, 62,
+ 63, 65, 86, 87, 89, 92, 96, 108,
+ 111, 111, 112, 116, 117, 138, 139, 141,
+ 162, 179, 197, 201, 202, 204, 212, 213,
+ 215, 219, 225, 237, 240, 240, 244, 264,
+ 280, 297, 302, 310, 323, 328, 332, 337,
+ 358, 375, 393, 399, 408, 418, 424, 449,
+ 471, 494, 503, 514, 523, 528, 552, 573,
+ 595, 603, 613, 625, 628, 628, 632, 652,
+ 668, 685, 690, 698, 711, 716, 720, 725,
+ 746, 763, 781, 787, 796, 806, 812, 837,
+ 859, 882, 891, 902, 911, 916, 940, 961,
+ 983, 991, 1001
+ };
+
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_keys[] = {
+ 80, 112, 45, 80, 112, 82, 114, 69,
+ 101, 70, 102, 69, 101, 82, 114, 82,
+ 114, 69, 101, 68, 100, 45, 73, 105,
+ 68, 100, 69, 101, 78, 110, 84, 116,
+ 73, 105, 84, 116, 89, 121, 9, 32,
+ 58, 9, 13, 32, 33, 34, 37, 39,
+ 60, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 10, 9,
+ 32, 9, 13, 32, 33, 34, 37, 39,
+ 60, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 10, 9,
+ 32, 9, 32, 60, 65, 90, 97, 122,
+ 9, 32, 43, 58, 45, 46, 48, 57,
+ 65, 90, 97, 122, 9, 32, 58, 62,
+ 9, 13, 32, 44, 10, 9, 13, 32,
+ 33, 34, 37, 39, 60, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 60, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 60, 10, 9, 32, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 60, 0, 9, 11, 12, 14,
+ 127, 9, 32, 43, 58, 45, 46, 48,
+ 57, 65, 90, 97, 122, 9, 32, 58,
+ 9, 13, 32, 44, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 126, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 60,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 60, 9, 13,
+ 32, 44, 65, 90, 97, 122, 9, 13,
+ 32, 44, 58, 43, 46, 48, 57, 65,
+ 90, 97, 122, 9, 13, 32, 44, 58,
+ 9, 13, 32, 44, 9, 13, 32, 44,
+ 62, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 62, 126, 42, 46, 48, 57,
+ 65, 90, 95, 96, 97, 122, 9, 13,
+ 32, 33, 37, 39, 44, 62, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 60, 62,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 60, 62, 9,
+ 13, 32, 44, 62, 65, 90, 97, 122,
+ 9, 13, 32, 34, 44, 62, 92, 127,
+ 0, 31, 9, 13, 32, 44, 60, 62,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 60, 62, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 62, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 44, 60,
+ 62, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 62, 0, 8, 11, 127, 9,
+ 13, 32, 34, 44, 60, 62, 92, 127,
+ 0, 31, 9, 13, 32, 34, 44, 92,
+ 127, 0, 31, 9, 13, 32, 44, 60,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 60, 92, 126, 127, 0, 31, 42, 46,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 92, 126, 127, 0, 31, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 0,
+ 8, 11, 127, 9, 13, 32, 34, 44,
+ 60, 92, 127, 0, 31, 9, 32, 43,
+ 58, 45, 46, 48, 57, 65, 90, 97,
+ 122, 9, 32, 58, 9, 13, 32, 44,
+ 9, 13, 32, 33, 34, 37, 39, 44,
+ 60, 126, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 60, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 60, 9, 13, 32, 44, 65, 90,
+ 97, 122, 9, 13, 32, 44, 58, 43,
+ 46, 48, 57, 65, 90, 97, 122, 9,
+ 13, 32, 44, 58, 9, 13, 32, 44,
+ 9, 13, 32, 44, 62, 9, 13, 32,
+ 33, 34, 37, 39, 44, 60, 62, 126,
+ 42, 46, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 37, 39,
+ 44, 62, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 60, 62, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 60, 62, 9, 13, 32, 44, 62,
+ 65, 90, 97, 122, 9, 13, 32, 34,
+ 44, 62, 92, 127, 0, 31, 9, 13,
+ 32, 44, 60, 62, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 62, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 34, 37, 39, 44, 62, 92, 126,
+ 127, 0, 31, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 44, 60, 62, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 44, 62, 0,
+ 8, 11, 127, 9, 13, 32, 34, 44,
+ 60, 62, 92, 127, 0, 31, 9, 13,
+ 32, 34, 44, 92, 127, 0, 31, 9,
+ 13, 32, 44, 60, 9, 13, 32, 33,
+ 34, 37, 39, 44, 60, 92, 126, 127,
+ 0, 31, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 34, 37, 39, 44, 92, 126, 127, 0,
+ 31, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 44, 60, 92, 126, 127, 0, 31, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 0, 8, 11, 127, 9,
+ 13, 32, 34, 44, 60, 92, 127, 0,
+ 31, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_single_lengths[] = {
+ 0, 2, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 3, 9, 1,
+ 2, 9, 1, 2, 3, 0, 4, 3,
+ 0, 1, 4, 1, 9, 1, 2, 9,
+ 7, 8, 4, 1, 2, 4, 1, 2,
+ 4, 0, 4, 3, 0, 4, 10, 8,
+ 9, 5, 4, 5, 5, 4, 5, 11,
+ 9, 10, 6, 5, 8, 6, 13, 12,
+ 13, 5, 9, 7, 5, 12, 11, 12,
+ 4, 8, 4, 3, 0, 4, 10, 8,
+ 9, 5, 4, 5, 5, 4, 5, 11,
+ 9, 10, 6, 5, 8, 6, 13, 12,
+ 13, 5, 9, 7, 5, 12, 11, 12,
+ 4, 8, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 0,
+ 0, 6, 0, 0, 0, 2, 4, 0,
+ 0, 0, 0, 0, 6, 0, 0, 6,
+ 5, 5, 0, 0, 0, 2, 0, 0,
+ 0, 3, 4, 0, 0, 0, 5, 4,
+ 4, 0, 2, 4, 0, 0, 0, 5,
+ 4, 4, 0, 2, 1, 0, 6, 5,
+ 5, 2, 1, 1, 0, 6, 5, 5,
+ 2, 1, 4, 0, 0, 0, 5, 4,
+ 4, 0, 2, 4, 0, 0, 0, 5,
+ 4, 4, 0, 2, 1, 0, 6, 5,
+ 5, 2, 1, 1, 0, 6, 5, 5,
+ 2, 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_P_Preferred_Identity_index_offsets[] = {
+ 0, 0, 3, 5, 8, 11, 14, 17,
+ 20, 23, 26, 29, 32, 34, 37, 40,
+ 43, 46, 49, 52, 55, 58, 62, 78,
+ 80, 83, 99, 101, 104, 108, 111, 120,
+ 124, 125, 127, 132, 134, 150, 152, 155,
+ 171, 184, 198, 203, 205, 208, 215, 217,
+ 220, 225, 229, 238, 242, 243, 248, 264,
+ 277, 291, 297, 304, 314, 320, 325, 331,
+ 348, 362, 377, 384, 392, 402, 409, 429,
+ 447, 466, 474, 485, 494, 500, 519, 536,
+ 554, 561, 571, 580, 584, 585, 590, 606,
+ 619, 633, 639, 646, 656, 662, 667, 673,
+ 690, 704, 719, 726, 734, 744, 751, 771,
+ 789, 808, 816, 827, 836, 842, 861, 878,
+ 896, 903, 913
+ };
+
+ static const unsigned char _tsip_machine_parser_header_P_Preferred_Identity_indicies[] = {
+ 0, 0, 1, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 15, 15, 1, 16, 16, 1, 17, 17,
+ 1, 18, 18, 1, 19, 19, 1, 20,
+ 20, 1, 20, 20, 21, 1, 21, 22,
+ 21, 23, 24, 23, 23, 25, 23, 23,
+ 23, 23, 26, 23, 26, 1, 27, 1,
+ 28, 28, 1, 28, 29, 28, 23, 24,
+ 23, 23, 25, 23, 23, 23, 23, 26,
+ 23, 26, 1, 30, 1, 31, 31, 1,
+ 31, 31, 25, 1, 32, 32, 1, 33,
+ 33, 34, 35, 34, 34, 34, 34, 1,
+ 33, 33, 35, 1, 36, 37, 36, 38,
+ 39, 38, 40, 1, 41, 1, 40, 42,
+ 40, 23, 24, 23, 23, 25, 23, 23,
+ 23, 23, 43, 23, 43, 1, 44, 1,
+ 45, 45, 1, 45, 29, 45, 23, 24,
+ 23, 23, 25, 23, 23, 23, 23, 43,
+ 23, 43, 1, 46, 47, 46, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 1,
+ 49, 50, 49, 48, 48, 48, 51, 48,
+ 48, 48, 48, 48, 48, 1, 52, 29,
+ 52, 25, 1, 53, 1, 46, 46, 1,
+ 55, 56, 57, 1, 1, 1, 54, 58,
+ 1, 54, 54, 1, 49, 50, 49, 51,
+ 1, 54, 54, 54, 1, 59, 59, 60,
+ 61, 60, 60, 60, 60, 1, 59, 59,
+ 61, 1, 62, 63, 64, 63, 65, 62,
+ 65, 64, 65, 66, 67, 66, 66, 65,
+ 68, 66, 66, 66, 69, 66, 69, 62,
+ 70, 64, 70, 71, 71, 71, 65, 71,
+ 71, 71, 71, 71, 62, 72, 64, 72,
+ 71, 71, 71, 65, 73, 71, 71, 71,
+ 71, 71, 62, 74, 64, 74, 65, 68,
+ 62, 63, 64, 63, 65, 75, 75, 62,
+ 76, 64, 76, 65, 78, 77, 77, 77,
+ 77, 62, 76, 64, 76, 65, 78, 62,
+ 80, 64, 80, 81, 79, 80, 64, 80,
+ 81, 63, 79, 81, 64, 81, 82, 83,
+ 82, 82, 81, 84, 63, 82, 82, 82,
+ 85, 82, 85, 79, 86, 64, 86, 87,
+ 87, 87, 81, 63, 87, 87, 87, 87,
+ 87, 79, 88, 64, 88, 87, 87, 87,
+ 81, 89, 63, 87, 87, 87, 87, 87,
+ 79, 90, 64, 90, 81, 84, 63, 79,
+ 80, 64, 80, 81, 63, 85, 85, 79,
+ 92, 64, 92, 93, 94, 63, 95, 79,
+ 79, 91, 88, 64, 88, 81, 89, 63,
+ 79, 81, 64, 81, 96, 97, 96, 96,
+ 94, 84, 63, 95, 96, 79, 79, 96,
+ 96, 83, 96, 83, 91, 98, 64, 98,
+ 99, 93, 99, 99, 94, 63, 95, 99,
+ 79, 79, 99, 99, 99, 99, 91, 88,
+ 64, 88, 99, 93, 99, 99, 94, 89,
+ 63, 95, 99, 79, 79, 99, 99, 99,
+ 99, 91, 92, 64, 92, 94, 63, 91,
+ 91, 79, 88, 64, 88, 93, 94, 89,
+ 63, 95, 79, 79, 91, 101, 64, 101,
+ 102, 103, 104, 62, 62, 100, 72, 64,
+ 72, 65, 73, 62, 65, 64, 65, 105,
+ 106, 105, 105, 103, 68, 104, 105, 62,
+ 62, 105, 105, 67, 105, 67, 100, 107,
+ 64, 107, 108, 102, 108, 108, 103, 104,
+ 108, 62, 62, 108, 108, 108, 108, 100,
+ 72, 64, 72, 108, 102, 108, 108, 103,
+ 73, 104, 108, 62, 62, 108, 108, 108,
+ 108, 100, 101, 64, 101, 103, 100, 100,
+ 62, 72, 64, 72, 102, 103, 73, 104,
+ 62, 62, 100, 109, 109, 110, 111, 110,
+ 110, 110, 110, 1, 109, 109, 111, 1,
+ 112, 113, 64, 113, 114, 112, 114, 64,
+ 114, 115, 116, 115, 115, 114, 117, 115,
+ 115, 115, 118, 115, 118, 112, 119, 64,
+ 119, 120, 120, 120, 114, 120, 120, 120,
+ 120, 120, 112, 121, 64, 121, 120, 120,
+ 120, 114, 122, 120, 120, 120, 120, 120,
+ 112, 123, 64, 123, 114, 117, 112, 113,
+ 64, 113, 114, 124, 124, 112, 125, 64,
+ 125, 114, 127, 126, 126, 126, 126, 112,
+ 125, 64, 125, 114, 127, 112, 129, 64,
+ 129, 130, 128, 129, 64, 129, 130, 113,
+ 128, 130, 64, 130, 131, 132, 131, 131,
+ 130, 133, 113, 131, 131, 131, 134, 131,
+ 134, 128, 135, 64, 135, 136, 136, 136,
+ 130, 113, 136, 136, 136, 136, 136, 128,
+ 137, 64, 137, 136, 136, 136, 130, 138,
+ 113, 136, 136, 136, 136, 136, 128, 139,
+ 64, 139, 130, 133, 113, 128, 129, 64,
+ 129, 130, 113, 134, 134, 128, 141, 64,
+ 141, 142, 143, 113, 144, 128, 128, 140,
+ 137, 64, 137, 130, 138, 113, 128, 130,
+ 64, 130, 145, 146, 145, 145, 143, 133,
+ 113, 144, 145, 128, 128, 145, 145, 132,
+ 145, 132, 140, 147, 64, 147, 148, 142,
+ 148, 148, 143, 113, 144, 148, 128, 128,
+ 148, 148, 148, 148, 140, 137, 64, 137,
+ 148, 142, 148, 148, 143, 138, 113, 144,
+ 148, 128, 128, 148, 148, 148, 148, 140,
+ 141, 64, 141, 143, 113, 140, 140, 128,
+ 137, 64, 137, 142, 143, 138, 113, 144,
+ 128, 128, 140, 150, 64, 150, 151, 152,
+ 153, 112, 112, 149, 121, 64, 121, 114,
+ 122, 112, 114, 64, 114, 154, 155, 154,
+ 154, 152, 117, 153, 154, 112, 112, 154,
+ 154, 116, 154, 116, 149, 156, 64, 156,
+ 157, 151, 157, 157, 152, 153, 157, 112,
+ 112, 157, 157, 157, 157, 149, 121, 64,
+ 121, 157, 151, 157, 157, 152, 122, 153,
+ 157, 112, 112, 157, 157, 157, 157, 149,
+ 150, 64, 150, 152, 149, 149, 112, 121,
+ 64, 121, 151, 152, 122, 153, 112, 112,
+ 149, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 40,
+ 45, 29, 82, 24, 25, 26, 27, 28,
+ 30, 31, 30, 32, 33, 34, 34, 35,
+ 36, 114, 37, 50, 38, 39, 41, 43,
+ 40, 42, 26, 29, 42, 44, 45, 46,
+ 48, 49, 47, 51, 50, 52, 53, 53,
+ 35, 54, 55, 75, 58, 53, 56, 55,
+ 57, 58, 57, 59, 60, 59, 61, 62,
+ 62, 63, 64, 68, 67, 62, 65, 64,
+ 66, 67, 66, 68, 68, 69, 70, 73,
+ 71, 74, 72, 71, 75, 75, 76, 77,
+ 80, 78, 81, 79, 78, 83, 82, 84,
+ 85, 85, 86, 87, 107, 90, 85, 88,
+ 87, 89, 90, 89, 91, 92, 91, 93,
+ 94, 94, 95, 96, 100, 99, 94, 97,
+ 96, 98, 99, 98, 100, 100, 101, 102,
+ 105, 103, 106, 104, 103, 107, 107, 108,
+ 109, 112, 110, 113, 111, 110
+ };
+
+ static const char _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 1, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 3, 0, 0,
+ 0, 7, 0, 1, 0, 0, 0, 0,
+ 0, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3,
+ 3, 3, 1, 1, 0, 1, 3, 0,
+ 12, 5, 3, 1, 3, 0, 0, 0,
+ 3, 3, 1, 1, 0, 1, 3, 0,
+ 12, 5, 3, 0, 3, 0, 3, 0,
+ 1, 1, 3, 0, 0, 3, 0, 3,
+ 0, 1, 1, 3, 0, 0, 0, 0,
+ 0, 3, 3, 1, 1, 0, 1, 3,
+ 0, 9, 5, 3, 1, 3, 0, 0,
+ 0, 3, 3, 1, 1, 0, 1, 3,
+ 0, 9, 5, 3, 0, 3, 0, 3,
+ 0, 1, 1, 3, 0, 0, 3, 0,
+ 3, 0, 1, 1, 3, 0
+ };
+
+ static const int tsip_machine_parser_header_P_Preferred_Identity_start = 1;
+ static const int tsip_machine_parser_header_P_Preferred_Identity_first_final = 114;
+ static const int tsip_machine_parser_header_P_Preferred_Identity_error = 0;
+
+ static const int tsip_machine_parser_header_P_Preferred_Identity_en_main = 1;
+
+
+ /* #line 133 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_P_Preferred_Identity_first_final);
+ (void)(tsip_machine_parser_header_P_Preferred_Identity_error);
+ (void)(tsip_machine_parser_header_P_Preferred_Identity_en_main);
+
+ /* #line 478 "./src/headers/tsip_header_P_Preferred_Identity.c" */
+ {
+ cs = tsip_machine_parser_header_P_Preferred_Identity_start;
+ }
+
+ /* #line 138 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+
+ /* #line 485 "./src/headers/tsip_header_P_Preferred_Identity.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_P_Preferred_Identity_trans_keys + _tsip_machine_parser_header_P_Preferred_Identity_key_offsets[cs];
- _trans = _tsip_machine_parser_header_P_Preferred_Identity_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_P_Preferred_Identity_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_P_Preferred_Identity_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_P_Preferred_Identity_trans_keys + _tsip_machine_parser_header_P_Preferred_Identity_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_P_Preferred_Identity_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_P_Preferred_Identity_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_P_Preferred_Identity_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_P_Preferred_Identity_indicies[_trans];
- cs = _tsip_machine_parser_header_P_Preferred_Identity_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_P_Preferred_Identity_actions + _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 56 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 60 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- {
- if(!hdr_pi->uri) /* Only one URI */{
- int len = (int)(p - tag_start);
- if(hdr_pi && !hdr_pi->uri){
- if((hdr_pi->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_pi->display_name){
- hdr_pi->uri->display_name = tsk_strdup(hdr_pi->display_name);
- }
- }
- }
- }
- break;
- case 2:
-/* #line 71 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- {
- if(!hdr_pi->display_name){
- TSK_PARSER_SET_STRING(hdr_pi->display_name);
- tsk_strunquote(&hdr_pi->display_name);
- }
-
- }
- break;
- case 3:
-/* #line 79 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- {
- }
- break;
-/* #line 593 "./src/headers/tsip_header_P_Preferred_Identity.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_P_Preferred_Identity_indicies[_trans];
+ cs = _tsip_machine_parser_header_P_Preferred_Identity_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_P_Preferred_Identity_actions + _tsip_machine_parser_header_P_Preferred_Identity_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 56 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 60 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ {
+ if(!hdr_pi->uri) { /* Only one URI */
+ int len = (int)(p - tag_start);
+ if(hdr_pi && !hdr_pi->uri) {
+ if((hdr_pi->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_pi->display_name) {
+ hdr_pi->uri->display_name = tsk_strdup(hdr_pi->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 2:
+ /* #line 71 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ {
+ if(!hdr_pi->display_name) {
+ TSK_PARSER_SET_STRING(hdr_pi->display_name);
+ tsk_strunquote(&hdr_pi->display_name);
+ }
+
+ }
+ break;
+ case 3:
+ /* #line 79 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ {
+ }
+ break;
+ /* #line 593 "./src/headers/tsip_header_P_Preferred_Identity.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 139 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
-
- if( cs <
-/* #line 609 "./src/headers/tsip_header_P_Preferred_Identity.c" */
-114
-/* #line 140 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'P-Preferred-Identity' header.");
- TSK_OBJECT_SAFE_FREE(hdr_pi);
- }
-
- return hdr_pi;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 139 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+
+ if( cs <
+ /* #line 609 "./src/headers/tsip_header_P_Preferred_Identity.c" */
+ 114
+ /* #line 140 "./ragel/tsip_parser_header_P_Preferred_Identity.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'P-Preferred-Identity' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_pi);
+ }
+
+ return hdr_pi;
}
@@ -628,42 +639,41 @@ _again:
static tsk_object_t* tsip_header_P_Preferred_Identity_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = self;
- if(P_Preferred_Identity){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(P_Preferred_Identity)->type = tsip_htype_P_Preferred_Identity;
- TSIP_HEADER(P_Preferred_Identity)->serialize = tsip_header_Preferred_Identity_serialize;
-
- if(uri){
- P_Preferred_Identity->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new P_Preferred_Identity header.");
- }
- return self;
+ tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = self;
+ if(P_Preferred_Identity) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(P_Preferred_Identity)->type = tsip_htype_P_Preferred_Identity;
+ TSIP_HEADER(P_Preferred_Identity)->serialize = tsip_header_Preferred_Identity_serialize;
+
+ if(uri) {
+ P_Preferred_Identity->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new P_Preferred_Identity header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_P_Preferred_Identity_dtor(tsk_object_t *self)
{
- tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = self;
- if(P_Preferred_Identity){
- TSK_FREE(P_Preferred_Identity->display_name);
- TSK_OBJECT_SAFE_FREE(P_Preferred_Identity->uri);
- }
- else{
- TSK_DEBUG_ERROR("Null P_Preferred_Identity header.");
- }
-
- return self;
+ tsip_header_P_Preferred_Identity_t *P_Preferred_Identity = self;
+ if(P_Preferred_Identity) {
+ TSK_FREE(P_Preferred_Identity->display_name);
+ TSK_OBJECT_SAFE_FREE(P_Preferred_Identity->uri);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null P_Preferred_Identity header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_P_Preferred_Identity_def_s =
-{
- sizeof(tsip_header_P_Preferred_Identity_t),
- tsip_header_P_Preferred_Identity_ctor,
- tsip_header_P_Preferred_Identity_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_P_Preferred_Identity_def_s = {
+ sizeof(tsip_header_P_Preferred_Identity_t),
+ tsip_header_P_Preferred_Identity_ctor,
+ tsip_header_P_Preferred_Identity_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_P_Preferred_Identity_def_t = &tsip_header_P_Preferred_Identity_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Path.c b/tinySIP/src/headers/tsip_header_Path.c
index e8cca53..bd20798 100755
--- a/tinySIP/src/headers/tsip_header_Path.c
+++ b/tinySIP/src/headers/tsip_header_Path.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,444 +51,455 @@
tsip_header_Path_t* tsip_header_Path_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_PATH_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_PATH_VA_ARGS(uri));
}
tsip_header_Path_t* tsip_header_Path_create_null()
{
- return tsip_header_Path_create(tsk_null);
+ return tsip_header_Path_create(tsk_null);
}
int tsip_header_Path_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Path_t *Path = (const tsip_header_Path_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Path->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- return ret;
- }
-
- return -1;
-}
+ if(header) {
+ const tsip_header_Path_t *Path = (const tsip_header_Path_t *)header;
+ int ret = 0;
-tsip_header_Paths_L_t *tsip_header_Path_parse(const char *data, tsk_size_t size)
-{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Paths_L_t *hdr_paths = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Path_t *curr_path = tsk_null;
-
-
-/* #line 92 "./src/headers/tsip_header_Path.c" */
-static const char _tsip_machine_parser_header_Path_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 1, 0, 2, 4, 5
-};
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Path->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
-static const short _tsip_machine_parser_header_Path_key_offsets[] = {
- 0, 0, 1, 2, 3, 4, 7, 26,
- 27, 29, 48, 49, 51, 54, 58, 70,
- 73, 73, 74, 79, 80, 97, 98, 100,
- 116, 134, 140, 141, 143, 148, 167, 168,
- 170, 189, 190, 192, 195, 203, 204, 206,
- 211, 216, 217, 219, 223, 229, 246, 253,
- 261, 269, 277, 279, 286, 295, 297, 300,
- 302, 305, 307, 310, 313, 314, 317, 318,
- 321, 322, 331, 340, 348, 356, 364, 372,
- 374, 380, 389, 398, 407, 409, 412, 415,
- 416, 417, 434, 452, 456, 457, 459, 467,
- 468, 470, 474, 480
-};
-
-static const char _tsip_machine_parser_header_Path_trans_keys[] = {
- 80, 97, 116, 104, 9, 32, 58, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 60, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 32, 60, 65, 90,
- 97, 122, 9, 32, 43, 58, 45, 46,
- 48, 57, 65, 90, 97, 122, 9, 32,
- 58, 62, 9, 13, 32, 44, 59, 10,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 10, 9, 32, 9,
- 32, 44, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 32, 34, 13, 34, 92, 127, 0,
- 8, 10, 31, 10, 9, 32, 9, 13,
- 32, 44, 59, 9, 13, 32, 44, 59,
- 10, 9, 32, 9, 32, 44, 59, 0,
- 9, 11, 12, 14, 127, 9, 13, 32,
- 33, 37, 39, 44, 59, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 58, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 58,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 48, 57, 46, 48,
- 57, 48, 57, 93, 48, 57, 93, 48,
- 57, 93, 46, 48, 57, 46, 46, 48,
- 57, 46, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 46, 48, 57, 46,
- 58, 9, 13, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 60, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 60,
- 10, 9, 32, 13, 34, 92, 127, 0,
- 8, 10, 31, 10, 9, 32, 9, 13,
- 32, 60, 0, 9, 11, 12, 14, 127,
- 0
-};
+ return ret;
+ }
-static const char _tsip_machine_parser_header_Path_single_lengths[] = {
- 0, 1, 1, 1, 1, 3, 9, 1,
- 2, 9, 1, 2, 3, 0, 4, 3,
- 0, 1, 5, 1, 7, 1, 2, 6,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 1, 2, 3, 4, 1, 2, 5,
- 5, 1, 2, 4, 0, 9, 1, 2,
- 2, 2, 2, 1, 3, 0, 1, 0,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 3, 3, 2, 2, 2, 2, 2,
- 0, 3, 3, 3, 0, 1, 1, 1,
- 1, 7, 8, 4, 1, 2, 4, 1,
- 2, 4, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Path_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 4, 0,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 3, 4, 3, 3,
- 3, 3, 0, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 0, 1, 0, 1,
- 0, 3, 3, 3, 3, 3, 3, 0,
- 3, 3, 3, 3, 1, 1, 1, 0,
- 0, 5, 5, 0, 0, 0, 2, 0,
- 0, 0, 3, 0
-};
-
-static const short _tsip_machine_parser_header_Path_index_offsets[] = {
- 0, 0, 2, 4, 6, 8, 12, 27,
- 29, 32, 47, 49, 52, 56, 59, 68,
- 72, 73, 75, 81, 83, 96, 98, 101,
- 113, 128, 135, 137, 140, 146, 161, 163,
- 166, 181, 183, 186, 190, 197, 199, 202,
- 208, 214, 216, 219, 224, 228, 242, 247,
- 253, 259, 265, 268, 273, 280, 282, 285,
- 287, 290, 292, 295, 298, 300, 303, 305,
- 308, 310, 317, 324, 330, 336, 342, 348,
- 351, 355, 362, 369, 376, 378, 381, 384,
- 386, 388, 401, 415, 420, 422, 425, 432,
- 434, 437, 442, 446
-};
-
-static const char _tsip_machine_parser_header_Path_indicies[] = {
- 0, 1, 2, 1, 3, 1, 4, 1,
- 4, 4, 5, 1, 6, 7, 6, 8,
- 9, 8, 8, 10, 8, 8, 8, 8,
- 8, 8, 1, 11, 1, 12, 12, 1,
- 13, 14, 13, 8, 9, 8, 8, 10,
- 8, 8, 8, 8, 8, 8, 1, 15,
- 1, 16, 16, 1, 16, 16, 17, 1,
- 18, 18, 1, 19, 19, 20, 21, 20,
- 20, 20, 20, 1, 19, 19, 21, 1,
- 22, 23, 22, 24, 25, 24, 26, 27,
- 1, 28, 1, 27, 29, 27, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 1,
- 31, 1, 32, 32, 1, 32, 32, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 1, 33, 34, 33, 35, 35, 35, 36,
- 37, 38, 35, 35, 35, 35, 35, 1,
- 39, 40, 39, 5, 27, 38, 1, 41,
- 1, 42, 42, 1, 42, 42, 5, 27,
- 38, 1, 38, 43, 38, 44, 45, 44,
- 44, 46, 44, 44, 44, 44, 44, 44,
- 1, 47, 1, 48, 48, 1, 48, 49,
- 48, 44, 45, 44, 44, 46, 44, 44,
- 44, 44, 44, 44, 1, 50, 1, 51,
- 51, 1, 51, 51, 45, 1, 52, 53,
- 54, 1, 1, 1, 45, 55, 1, 45,
- 45, 1, 56, 34, 56, 36, 37, 1,
- 57, 58, 57, 5, 27, 1, 59, 1,
- 60, 60, 1, 60, 60, 5, 27, 1,
- 45, 45, 45, 1, 56, 34, 56, 44,
- 44, 44, 36, 37, 44, 44, 44, 44,
- 44, 1, 62, 61, 61, 61, 1, 64,
- 53, 63, 63, 63, 1, 64, 53, 65,
- 65, 65, 1, 64, 53, 66, 66, 66,
- 1, 64, 53, 1, 68, 67, 61, 61,
- 1, 69, 64, 53, 70, 63, 63, 1,
- 71, 1, 72, 73, 1, 74, 1, 75,
- 76, 1, 77, 1, 53, 78, 1, 53,
- 79, 1, 53, 1, 75, 80, 1, 75,
- 1, 72, 81, 1, 72, 1, 69, 64,
- 53, 82, 65, 65, 1, 69, 64, 53,
- 66, 66, 66, 1, 84, 53, 83, 83,
- 83, 1, 86, 53, 85, 85, 85, 1,
- 86, 53, 87, 87, 87, 1, 86, 53,
- 88, 88, 88, 1, 86, 53, 1, 89,
- 83, 83, 1, 69, 86, 53, 90, 85,
- 85, 1, 69, 86, 53, 91, 87, 87,
- 1, 69, 86, 53, 88, 88, 88, 1,
- 92, 1, 69, 93, 1, 69, 94, 1,
- 69, 1, 68, 1, 95, 96, 95, 97,
- 97, 97, 97, 97, 97, 97, 97, 97,
- 1, 98, 99, 98, 97, 97, 97, 100,
- 97, 97, 97, 97, 97, 97, 1, 101,
- 102, 101, 17, 1, 103, 1, 95, 95,
- 1, 105, 106, 107, 1, 1, 1, 104,
- 108, 1, 104, 104, 1, 98, 99, 98,
- 100, 1, 104, 104, 104, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Path_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 6, 7,
- 81, 86, 13, 8, 9, 9, 10, 11,
- 12, 13, 14, 15, 14, 16, 17, 18,
- 18, 19, 6, 20, 91, 21, 24, 22,
- 23, 25, 19, 24, 6, 20, 29, 25,
- 26, 27, 28, 30, 45, 36, 46, 31,
- 32, 33, 34, 35, 37, 39, 44, 38,
- 40, 40, 41, 42, 43, 47, 80, 48,
- 51, 49, 50, 52, 67, 53, 65, 54,
- 55, 63, 56, 57, 61, 58, 59, 60,
- 62, 64, 66, 68, 76, 69, 72, 70,
- 71, 73, 74, 75, 77, 78, 79, 82,
- 84, 81, 83, 10, 13, 83, 10, 85,
- 86, 87, 89, 90, 88
-};
-
-static const char _tsip_machine_parser_header_Path_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 3, 3,
- 15, 15, 3, 0, 0, 3, 3, 0,
- 0, 0, 1, 0, 0, 0, 0, 7,
- 11, 11, 11, 0, 13, 0, 1, 0,
- 0, 18, 18, 0, 18, 9, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 18, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 0, 0
-};
+ return -1;
+}
-static const int tsip_machine_parser_header_Path_start = 1;
-static const int tsip_machine_parser_header_Path_first_final = 91;
-static const int tsip_machine_parser_header_Path_error = 0;
-
-static const int tsip_machine_parser_header_Path_en_main = 1;
-
-
-/* #line 149 "./ragel/tsip_parser_header_Path.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Path_first_final);
- (void)(tsip_machine_parser_header_Path_error);
- (void)(tsip_machine_parser_header_Path_en_main);
-
-/* #line 329 "./src/headers/tsip_header_Path.c" */
- {
- cs = tsip_machine_parser_header_Path_start;
- }
-
-/* #line 154 "./ragel/tsip_parser_header_Path.rl" */
-
-/* #line 336 "./src/headers/tsip_header_Path.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+tsip_header_Paths_L_t *tsip_header_Path_parse(const char *data, tsk_size_t size)
+{
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Paths_L_t *hdr_paths = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Path_t *curr_path = tsk_null;
+
+
+ /* #line 92 "./src/headers/tsip_header_Path.c" */
+ static const char _tsip_machine_parser_header_Path_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 1, 0, 2, 4, 5
+ };
+
+ static const short _tsip_machine_parser_header_Path_key_offsets[] = {
+ 0, 0, 1, 2, 3, 4, 7, 26,
+ 27, 29, 48, 49, 51, 54, 58, 70,
+ 73, 73, 74, 79, 80, 97, 98, 100,
+ 116, 134, 140, 141, 143, 148, 167, 168,
+ 170, 189, 190, 192, 195, 203, 204, 206,
+ 211, 216, 217, 219, 223, 229, 246, 253,
+ 261, 269, 277, 279, 286, 295, 297, 300,
+ 302, 305, 307, 310, 313, 314, 317, 318,
+ 321, 322, 331, 340, 348, 356, 364, 372,
+ 374, 380, 389, 398, 407, 409, 412, 415,
+ 416, 417, 434, 452, 456, 457, 459, 467,
+ 468, 470, 474, 480
+ };
+
+ static const char _tsip_machine_parser_header_Path_trans_keys[] = {
+ 80, 97, 116, 104, 9, 32, 58, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 60, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 32, 60, 65, 90,
+ 97, 122, 9, 32, 43, 58, 45, 46,
+ 48, 57, 65, 90, 97, 122, 9, 32,
+ 58, 62, 9, 13, 32, 44, 59, 10,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 10, 9, 32, 9,
+ 32, 44, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 32, 34, 13, 34, 92, 127, 0,
+ 8, 10, 31, 10, 9, 32, 9, 13,
+ 32, 44, 59, 9, 13, 32, 44, 59,
+ 10, 9, 32, 9, 32, 44, 59, 0,
+ 9, 11, 12, 14, 127, 9, 13, 32,
+ 33, 37, 39, 44, 59, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 58, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 58,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 48, 57, 46, 48,
+ 57, 48, 57, 93, 48, 57, 93, 48,
+ 57, 93, 46, 48, 57, 46, 46, 48,
+ 57, 46, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 46, 48, 57, 46,
+ 58, 9, 13, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 60, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 60,
+ 10, 9, 32, 13, 34, 92, 127, 0,
+ 8, 10, 31, 10, 9, 32, 9, 13,
+ 32, 60, 0, 9, 11, 12, 14, 127,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Path_single_lengths[] = {
+ 0, 1, 1, 1, 1, 3, 9, 1,
+ 2, 9, 1, 2, 3, 0, 4, 3,
+ 0, 1, 5, 1, 7, 1, 2, 6,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 1, 2, 3, 4, 1, 2, 5,
+ 5, 1, 2, 4, 0, 9, 1, 2,
+ 2, 2, 2, 1, 3, 0, 1, 0,
+ 1, 0, 1, 1, 1, 1, 1, 1,
+ 1, 3, 3, 2, 2, 2, 2, 2,
+ 0, 3, 3, 3, 0, 1, 1, 1,
+ 1, 7, 8, 4, 1, 2, 4, 1,
+ 2, 4, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Path_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 4, 0,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 3, 4, 3, 3,
+ 3, 3, 0, 3, 3, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 0, 1,
+ 0, 3, 3, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 1, 1, 1, 0,
+ 0, 5, 5, 0, 0, 0, 2, 0,
+ 0, 0, 3, 0
+ };
+
+ static const short _tsip_machine_parser_header_Path_index_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 12, 27,
+ 29, 32, 47, 49, 52, 56, 59, 68,
+ 72, 73, 75, 81, 83, 96, 98, 101,
+ 113, 128, 135, 137, 140, 146, 161, 163,
+ 166, 181, 183, 186, 190, 197, 199, 202,
+ 208, 214, 216, 219, 224, 228, 242, 247,
+ 253, 259, 265, 268, 273, 280, 282, 285,
+ 287, 290, 292, 295, 298, 300, 303, 305,
+ 308, 310, 317, 324, 330, 336, 342, 348,
+ 351, 355, 362, 369, 376, 378, 381, 384,
+ 386, 388, 401, 415, 420, 422, 425, 432,
+ 434, 437, 442, 446
+ };
+
+ static const char _tsip_machine_parser_header_Path_indicies[] = {
+ 0, 1, 2, 1, 3, 1, 4, 1,
+ 4, 4, 5, 1, 6, 7, 6, 8,
+ 9, 8, 8, 10, 8, 8, 8, 8,
+ 8, 8, 1, 11, 1, 12, 12, 1,
+ 13, 14, 13, 8, 9, 8, 8, 10,
+ 8, 8, 8, 8, 8, 8, 1, 15,
+ 1, 16, 16, 1, 16, 16, 17, 1,
+ 18, 18, 1, 19, 19, 20, 21, 20,
+ 20, 20, 20, 1, 19, 19, 21, 1,
+ 22, 23, 22, 24, 25, 24, 26, 27,
+ 1, 28, 1, 27, 29, 27, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 1,
+ 31, 1, 32, 32, 1, 32, 32, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 1, 33, 34, 33, 35, 35, 35, 36,
+ 37, 38, 35, 35, 35, 35, 35, 1,
+ 39, 40, 39, 5, 27, 38, 1, 41,
+ 1, 42, 42, 1, 42, 42, 5, 27,
+ 38, 1, 38, 43, 38, 44, 45, 44,
+ 44, 46, 44, 44, 44, 44, 44, 44,
+ 1, 47, 1, 48, 48, 1, 48, 49,
+ 48, 44, 45, 44, 44, 46, 44, 44,
+ 44, 44, 44, 44, 1, 50, 1, 51,
+ 51, 1, 51, 51, 45, 1, 52, 53,
+ 54, 1, 1, 1, 45, 55, 1, 45,
+ 45, 1, 56, 34, 56, 36, 37, 1,
+ 57, 58, 57, 5, 27, 1, 59, 1,
+ 60, 60, 1, 60, 60, 5, 27, 1,
+ 45, 45, 45, 1, 56, 34, 56, 44,
+ 44, 44, 36, 37, 44, 44, 44, 44,
+ 44, 1, 62, 61, 61, 61, 1, 64,
+ 53, 63, 63, 63, 1, 64, 53, 65,
+ 65, 65, 1, 64, 53, 66, 66, 66,
+ 1, 64, 53, 1, 68, 67, 61, 61,
+ 1, 69, 64, 53, 70, 63, 63, 1,
+ 71, 1, 72, 73, 1, 74, 1, 75,
+ 76, 1, 77, 1, 53, 78, 1, 53,
+ 79, 1, 53, 1, 75, 80, 1, 75,
+ 1, 72, 81, 1, 72, 1, 69, 64,
+ 53, 82, 65, 65, 1, 69, 64, 53,
+ 66, 66, 66, 1, 84, 53, 83, 83,
+ 83, 1, 86, 53, 85, 85, 85, 1,
+ 86, 53, 87, 87, 87, 1, 86, 53,
+ 88, 88, 88, 1, 86, 53, 1, 89,
+ 83, 83, 1, 69, 86, 53, 90, 85,
+ 85, 1, 69, 86, 53, 91, 87, 87,
+ 1, 69, 86, 53, 88, 88, 88, 1,
+ 92, 1, 69, 93, 1, 69, 94, 1,
+ 69, 1, 68, 1, 95, 96, 95, 97,
+ 97, 97, 97, 97, 97, 97, 97, 97,
+ 1, 98, 99, 98, 97, 97, 97, 100,
+ 97, 97, 97, 97, 97, 97, 1, 101,
+ 102, 101, 17, 1, 103, 1, 95, 95,
+ 1, 105, 106, 107, 1, 1, 1, 104,
+ 108, 1, 104, 104, 1, 98, 99, 98,
+ 100, 1, 104, 104, 104, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Path_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 6, 7,
+ 81, 86, 13, 8, 9, 9, 10, 11,
+ 12, 13, 14, 15, 14, 16, 17, 18,
+ 18, 19, 6, 20, 91, 21, 24, 22,
+ 23, 25, 19, 24, 6, 20, 29, 25,
+ 26, 27, 28, 30, 45, 36, 46, 31,
+ 32, 33, 34, 35, 37, 39, 44, 38,
+ 40, 40, 41, 42, 43, 47, 80, 48,
+ 51, 49, 50, 52, 67, 53, 65, 54,
+ 55, 63, 56, 57, 61, 58, 59, 60,
+ 62, 64, 66, 68, 76, 69, 72, 70,
+ 71, 73, 74, 75, 77, 78, 79, 82,
+ 84, 81, 83, 10, 13, 83, 10, 85,
+ 86, 87, 89, 90, 88
+ };
+
+ static const char _tsip_machine_parser_header_Path_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 3, 3,
+ 15, 15, 3, 0, 0, 3, 3, 0,
+ 0, 0, 1, 0, 0, 0, 0, 7,
+ 11, 11, 11, 0, 13, 0, 1, 0,
+ 0, 18, 18, 0, 18, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 18, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Path_start = 1;
+ static const int tsip_machine_parser_header_Path_first_final = 91;
+ static const int tsip_machine_parser_header_Path_error = 0;
+
+ static const int tsip_machine_parser_header_Path_en_main = 1;
+
+
+ /* #line 149 "./ragel/tsip_parser_header_Path.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Path_first_final);
+ (void)(tsip_machine_parser_header_Path_error);
+ (void)(tsip_machine_parser_header_Path_en_main);
+
+ /* #line 329 "./src/headers/tsip_header_Path.c" */
+ {
+ cs = tsip_machine_parser_header_Path_start;
+ }
+
+ /* #line 154 "./ragel/tsip_parser_header_Path.rl" */
+
+ /* #line 336 "./src/headers/tsip_header_Path.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Path_trans_keys + _tsip_machine_parser_header_Path_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Path_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Path_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Path_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Path_trans_keys + _tsip_machine_parser_header_Path_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Path_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Path_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Path_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Path_indicies[_trans];
- cs = _tsip_machine_parser_header_Path_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Path_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Path_actions + _tsip_machine_parser_header_Path_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Path.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Path.rl" */
- {
- if(!curr_path){
- curr_path = tsip_header_Path_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Path.rl" */
- {
- if(curr_path){
- TSK_PARSER_SET_STRING(curr_path->display_name);
- tsk_strunquote(&curr_path->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_Path.rl" */
- {
- if(curr_path && !curr_path->uri){
- int len = (int)(p - tag_start);
- if(curr_path && !curr_path->uri){
- if((curr_path->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_path->display_name){
- curr_path->uri->display_name = tsk_strdup(curr_path->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_Path.rl" */
- {
- if(curr_path){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_Path.rl" */
- {
- if(curr_path){
- tsk_list_push_back_data(hdr_paths, ((void**) &curr_path));
- }
- }
- break;
- case 6:
-/* #line 91 "./ragel/tsip_parser_header_Path.rl" */
- {
- }
- break;
-/* #line 467 "./src/headers/tsip_header_Path.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Path_indicies[_trans];
+ cs = _tsip_machine_parser_header_Path_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Path_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Path_actions + _tsip_machine_parser_header_Path_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ if(!curr_path) {
+ curr_path = tsip_header_Path_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ if(curr_path) {
+ TSK_PARSER_SET_STRING(curr_path->display_name);
+ tsk_strunquote(&curr_path->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ if(curr_path && !curr_path->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_path && !curr_path->uri) {
+ if((curr_path->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_path->display_name) {
+ curr_path->uri->display_name = tsk_strdup(curr_path->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ if(curr_path) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ if(curr_path) {
+ tsk_list_push_back_data(hdr_paths, ((void**) &curr_path));
+ }
+ }
+ break;
+ case 6:
+ /* #line 91 "./ragel/tsip_parser_header_Path.rl" */
+ {
+ }
+ break;
+ /* #line 467 "./src/headers/tsip_header_Path.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 155 "./ragel/tsip_parser_header_Path.rl" */
-
- if( cs <
-/* #line 483 "./src/headers/tsip_header_Path.c" */
-91
-/* #line 156 "./ragel/tsip_parser_header_Path.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Path' header.");
- TSK_OBJECT_SAFE_FREE(curr_path);
- TSK_OBJECT_SAFE_FREE(hdr_paths);
- }
-
- return hdr_paths;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 155 "./ragel/tsip_parser_header_Path.rl" */
+
+ if( cs <
+ /* #line 483 "./src/headers/tsip_header_Path.c" */
+ 91
+ /* #line 156 "./ragel/tsip_parser_header_Path.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Path' header.");
+ TSK_OBJECT_SAFE_FREE(curr_path);
+ TSK_OBJECT_SAFE_FREE(hdr_paths);
+ }
+
+ return hdr_paths;
}
@@ -501,43 +512,42 @@ _again:
static tsk_object_t* tsip_header_Path_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Path_t *Path = self;
- if(Path){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(Path)->type = tsip_htype_Path;
- TSIP_HEADER(Path)->serialize = tsip_header_Path_serialize;
- if(uri){
- Path->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Path header.");
- }
- return self;
+ tsip_header_Path_t *Path = self;
+ if(Path) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(Path)->type = tsip_htype_Path;
+ TSIP_HEADER(Path)->serialize = tsip_header_Path_serialize;
+ if(uri) {
+ Path->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Path header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Path_dtor(tsk_object_t *self)
{
- tsip_header_Path_t *Path = self;
- if(Path){
- TSK_FREE(Path->display_name);
- TSK_OBJECT_SAFE_FREE(Path->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Path));
- }
- else{
- TSK_DEBUG_ERROR("Null Path header.");
- }
-
- return self;
+ tsip_header_Path_t *Path = self;
+ if(Path) {
+ TSK_FREE(Path->display_name);
+ TSK_OBJECT_SAFE_FREE(Path->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Path));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Path header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Path_def_s =
-{
- sizeof(tsip_header_Path_t),
- tsip_header_Path_ctor,
- tsip_header_Path_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Path_def_s = {
+ sizeof(tsip_header_Path_t),
+ tsip_header_Path_ctor,
+ tsip_header_Path_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Path_def_t = &tsip_header_Path_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Privacy.c b/tinySIP/src/headers/tsip_header_Privacy.c
index 905b28c..a2d7241 100755
--- a/tinySIP/src/headers/tsip_header_Privacy.c
+++ b/tinySIP/src/headers/tsip_header_Privacy.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,11 +28,11 @@
* Header field where proxy ACK BYE CAN INV OPT REG
* ___________________________________________________________
* Privacy amrd o o o o o o
- *
+ *
* Header field SUB NOT PRK IFO UPD MSG
* ___________________________________________________________
* Privacy o o o o o o
- *
+ *
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
@@ -57,390 +57,401 @@
tsip_header_Privacy_t* tsip_header_Privacy_create()
{
- return tsk_object_new(tsip_header_Privacy_def_t);
+ return tsk_object_new(tsip_header_Privacy_def_t);
}
int tsip_header_Privacy_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Privacy_t *Privacy = (const tsip_header_Privacy_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Privacy->values){
- str = item->data;
- if(item == Privacy->values->head){
- ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- ret = tsk_buffer_append_2(output, ";%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Privacy_t *Privacy = (const tsip_header_Privacy_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Privacy->values) {
+ str = item->data;
+ if(item == Privacy->values->head) {
+ ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ ret = tsk_buffer_append_2(output, ";%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Privacy_t *tsip_header_Privacy_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Privacy_t *hdr_privacy = tsip_header_Privacy_create();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 100 "./src/headers/tsip_header_Privacy.c" */
-static const char _tsip_machine_parser_header_Privacy_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const short _tsip_machine_parser_header_Privacy_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 17, 46, 47, 49, 77, 93, 94,
- 120, 138, 156, 174, 192, 210, 228, 246,
- 248, 268, 286, 304, 322, 340, 358, 376,
- 394, 412, 430, 448, 466, 484, 502, 520,
- 538, 556, 574, 592, 610, 628
-};
-
-static const char _tsip_machine_parser_header_Privacy_trans_keys[] = {
- 80, 112, 82, 114, 73, 105, 86, 118,
- 65, 97, 67, 99, 89, 121, 9, 32,
- 58, 9, 13, 32, 33, 37, 39, 67,
- 72, 73, 78, 83, 85, 99, 104, 105,
- 110, 115, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 67, 72,
- 73, 78, 83, 85, 99, 104, 105, 110,
- 115, 117, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 13, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 33, 37,
- 39, 67, 72, 73, 78, 83, 85, 99,
- 104, 105, 110, 115, 117, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 59, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 13, 33, 37, 39,
- 59, 76, 108, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 59,
- 13, 33, 37, 39, 59, 69, 73, 101,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 13, 33,
- 37, 39, 59, 68, 100, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 59, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 89, 121, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 59, 68, 100, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 59, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 13, 33, 37, 39,
- 59, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 59, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 13, 33, 37, 39, 59, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 13, 33, 37, 39, 59, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 0
-};
-
-static const char _tsip_machine_parser_header_Privacy_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 3, 19, 1, 2, 18, 6, 1, 16,
- 8, 8, 8, 8, 8, 8, 8, 2,
- 10, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 0
-};
-
-static const char _tsip_machine_parser_header_Privacy_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 5, 0, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 0
-};
-
-static const short _tsip_machine_parser_header_Privacy_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 25, 50, 52, 55, 79, 91, 93,
- 115, 129, 143, 157, 171, 185, 199, 213,
- 216, 232, 246, 260, 274, 288, 302, 316,
- 330, 344, 358, 372, 386, 400, 414, 428,
- 442, 456, 470, 484, 498, 512
-};
-
-static const char _tsip_machine_parser_header_Privacy_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 7, 7, 8,
- 1, 8, 9, 8, 10, 10, 10, 11,
- 12, 13, 14, 15, 16, 11, 12, 13,
- 14, 15, 16, 10, 10, 10, 10, 10,
- 10, 1, 17, 1, 18, 18, 1, 18,
- 18, 10, 10, 10, 11, 12, 13, 14,
- 15, 16, 11, 12, 13, 14, 15, 16,
- 10, 10, 10, 10, 10, 10, 1, 19,
- 20, 20, 20, 21, 20, 20, 20, 20,
- 20, 20, 1, 22, 1, 10, 10, 10,
- 11, 12, 13, 14, 15, 16, 11, 12,
- 13, 14, 15, 16, 10, 10, 10, 10,
- 10, 10, 1, 19, 20, 20, 20, 21,
- 23, 23, 20, 20, 20, 20, 20, 20,
- 1, 19, 20, 20, 20, 21, 24, 24,
- 20, 20, 20, 20, 20, 20, 1, 19,
- 20, 20, 20, 21, 25, 25, 20, 20,
- 20, 20, 20, 20, 1, 19, 20, 20,
- 20, 21, 26, 26, 20, 20, 20, 20,
- 20, 20, 1, 19, 20, 20, 20, 21,
- 27, 27, 20, 20, 20, 20, 20, 20,
- 1, 19, 20, 20, 20, 21, 28, 28,
- 20, 20, 20, 20, 20, 20, 1, 19,
- 20, 20, 20, 21, 29, 29, 20, 20,
- 20, 20, 20, 20, 1, 19, 21, 1,
- 19, 20, 20, 20, 21, 30, 31, 30,
- 31, 20, 20, 20, 20, 20, 20, 1,
- 19, 20, 20, 20, 21, 32, 32, 20,
- 20, 20, 20, 20, 20, 1, 19, 20,
- 20, 20, 21, 33, 33, 20, 20, 20,
- 20, 20, 20, 1, 19, 20, 20, 20,
- 21, 34, 34, 20, 20, 20, 20, 20,
- 20, 1, 19, 20, 20, 20, 21, 29,
- 29, 20, 20, 20, 20, 20, 20, 1,
- 19, 20, 20, 20, 21, 35, 35, 20,
- 20, 20, 20, 20, 20, 1, 19, 20,
- 20, 20, 21, 36, 36, 20, 20, 20,
- 20, 20, 20, 1, 19, 20, 20, 20,
- 21, 37, 37, 20, 20, 20, 20, 20,
- 20, 1, 19, 20, 20, 20, 21, 38,
- 38, 20, 20, 20, 20, 20, 20, 1,
- 19, 20, 20, 20, 21, 29, 29, 20,
- 20, 20, 20, 20, 20, 1, 19, 20,
- 20, 20, 21, 29, 29, 20, 20, 20,
- 20, 20, 20, 1, 19, 20, 20, 20,
- 21, 39, 39, 20, 20, 20, 20, 20,
- 20, 1, 19, 20, 20, 20, 21, 40,
- 40, 20, 20, 20, 20, 20, 20, 1,
- 19, 20, 20, 20, 21, 29, 29, 20,
- 20, 20, 20, 20, 20, 1, 19, 20,
- 20, 20, 21, 41, 41, 20, 20, 20,
- 20, 20, 20, 1, 19, 20, 20, 20,
- 21, 42, 42, 20, 20, 20, 20, 20,
- 20, 1, 19, 20, 20, 20, 21, 43,
- 43, 20, 20, 20, 20, 20, 20, 1,
- 19, 20, 20, 20, 21, 44, 44, 20,
- 20, 20, 20, 20, 20, 1, 19, 20,
- 20, 20, 21, 45, 45, 20, 20, 20,
- 20, 20, 20, 1, 19, 20, 20, 20,
- 21, 29, 29, 20, 20, 20, 20, 20,
- 20, 1, 19, 20, 20, 20, 21, 33,
- 33, 20, 20, 20, 20, 20, 20, 1,
- 1, 0
-};
-
-static const char _tsip_machine_parser_header_Privacy_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 13, 16, 24, 34, 35, 38,
- 44, 11, 12, 14, 13, 15, 45, 17,
- 18, 19, 20, 21, 22, 23, 25, 29,
- 26, 27, 28, 30, 31, 32, 33, 36,
- 37, 39, 40, 41, 42, 43
-};
-
-static const char _tsip_machine_parser_header_Privacy_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 3, 0, 3, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Privacy_start = 1;
-static const int tsip_machine_parser_header_Privacy_first_final = 45;
-static const int tsip_machine_parser_header_Privacy_error = 0;
-
-static const int tsip_machine_parser_header_Privacy_en_main = 1;
-
-
-/* #line 118 "./ragel/tsip_parser_header_Privacy.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Privacy_first_final);
- (void)(tsip_machine_parser_header_Privacy_error);
- (void)(tsip_machine_parser_header_Privacy_en_main);
-
-/* #line 322 "./src/headers/tsip_header_Privacy.c" */
- {
- cs = tsip_machine_parser_header_Privacy_start;
- }
-
-/* #line 123 "./ragel/tsip_parser_header_Privacy.rl" */
-
-/* #line 329 "./src/headers/tsip_header_Privacy.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Privacy_t *hdr_privacy = tsip_header_Privacy_create();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 100 "./src/headers/tsip_header_Privacy.c" */
+ static const char _tsip_machine_parser_header_Privacy_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const short _tsip_machine_parser_header_Privacy_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 17, 46, 47, 49, 77, 93, 94,
+ 120, 138, 156, 174, 192, 210, 228, 246,
+ 248, 268, 286, 304, 322, 340, 358, 376,
+ 394, 412, 430, 448, 466, 484, 502, 520,
+ 538, 556, 574, 592, 610, 628
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_trans_keys[] = {
+ 80, 112, 82, 114, 73, 105, 86, 118,
+ 65, 97, 67, 99, 89, 121, 9, 32,
+ 58, 9, 13, 32, 33, 37, 39, 67,
+ 72, 73, 78, 83, 85, 99, 104, 105,
+ 110, 115, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 67, 72,
+ 73, 78, 83, 85, 99, 104, 105, 110,
+ 115, 117, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 13, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 33, 37,
+ 39, 67, 72, 73, 78, 83, 85, 99,
+ 104, 105, 110, 115, 117, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 59, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 13, 33, 37, 39,
+ 59, 76, 108, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 59,
+ 13, 33, 37, 39, 59, 69, 73, 101,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 13, 33,
+ 37, 39, 59, 68, 100, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 59, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 89, 121, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 59, 68, 100, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 59, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 13, 33, 37, 39,
+ 59, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 59, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 13, 33, 37, 39, 59, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 13, 33, 37, 39, 59, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 0
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 3, 19, 1, 2, 18, 6, 1, 16,
+ 8, 8, 8, 8, 8, 8, 8, 2,
+ 10, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 0
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 5, 0, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0
+ };
+
+ static const short _tsip_machine_parser_header_Privacy_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 25, 50, 52, 55, 79, 91, 93,
+ 115, 129, 143, 157, 171, 185, 199, 213,
+ 216, 232, 246, 260, 274, 288, 302, 316,
+ 330, 344, 358, 372, 386, 400, 414, 428,
+ 442, 456, 470, 484, 498, 512
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 7, 7, 8,
+ 1, 8, 9, 8, 10, 10, 10, 11,
+ 12, 13, 14, 15, 16, 11, 12, 13,
+ 14, 15, 16, 10, 10, 10, 10, 10,
+ 10, 1, 17, 1, 18, 18, 1, 18,
+ 18, 10, 10, 10, 11, 12, 13, 14,
+ 15, 16, 11, 12, 13, 14, 15, 16,
+ 10, 10, 10, 10, 10, 10, 1, 19,
+ 20, 20, 20, 21, 20, 20, 20, 20,
+ 20, 20, 1, 22, 1, 10, 10, 10,
+ 11, 12, 13, 14, 15, 16, 11, 12,
+ 13, 14, 15, 16, 10, 10, 10, 10,
+ 10, 10, 1, 19, 20, 20, 20, 21,
+ 23, 23, 20, 20, 20, 20, 20, 20,
+ 1, 19, 20, 20, 20, 21, 24, 24,
+ 20, 20, 20, 20, 20, 20, 1, 19,
+ 20, 20, 20, 21, 25, 25, 20, 20,
+ 20, 20, 20, 20, 1, 19, 20, 20,
+ 20, 21, 26, 26, 20, 20, 20, 20,
+ 20, 20, 1, 19, 20, 20, 20, 21,
+ 27, 27, 20, 20, 20, 20, 20, 20,
+ 1, 19, 20, 20, 20, 21, 28, 28,
+ 20, 20, 20, 20, 20, 20, 1, 19,
+ 20, 20, 20, 21, 29, 29, 20, 20,
+ 20, 20, 20, 20, 1, 19, 21, 1,
+ 19, 20, 20, 20, 21, 30, 31, 30,
+ 31, 20, 20, 20, 20, 20, 20, 1,
+ 19, 20, 20, 20, 21, 32, 32, 20,
+ 20, 20, 20, 20, 20, 1, 19, 20,
+ 20, 20, 21, 33, 33, 20, 20, 20,
+ 20, 20, 20, 1, 19, 20, 20, 20,
+ 21, 34, 34, 20, 20, 20, 20, 20,
+ 20, 1, 19, 20, 20, 20, 21, 29,
+ 29, 20, 20, 20, 20, 20, 20, 1,
+ 19, 20, 20, 20, 21, 35, 35, 20,
+ 20, 20, 20, 20, 20, 1, 19, 20,
+ 20, 20, 21, 36, 36, 20, 20, 20,
+ 20, 20, 20, 1, 19, 20, 20, 20,
+ 21, 37, 37, 20, 20, 20, 20, 20,
+ 20, 1, 19, 20, 20, 20, 21, 38,
+ 38, 20, 20, 20, 20, 20, 20, 1,
+ 19, 20, 20, 20, 21, 29, 29, 20,
+ 20, 20, 20, 20, 20, 1, 19, 20,
+ 20, 20, 21, 29, 29, 20, 20, 20,
+ 20, 20, 20, 1, 19, 20, 20, 20,
+ 21, 39, 39, 20, 20, 20, 20, 20,
+ 20, 1, 19, 20, 20, 20, 21, 40,
+ 40, 20, 20, 20, 20, 20, 20, 1,
+ 19, 20, 20, 20, 21, 29, 29, 20,
+ 20, 20, 20, 20, 20, 1, 19, 20,
+ 20, 20, 21, 41, 41, 20, 20, 20,
+ 20, 20, 20, 1, 19, 20, 20, 20,
+ 21, 42, 42, 20, 20, 20, 20, 20,
+ 20, 1, 19, 20, 20, 20, 21, 43,
+ 43, 20, 20, 20, 20, 20, 20, 1,
+ 19, 20, 20, 20, 21, 44, 44, 20,
+ 20, 20, 20, 20, 20, 1, 19, 20,
+ 20, 20, 21, 45, 45, 20, 20, 20,
+ 20, 20, 20, 1, 19, 20, 20, 20,
+ 21, 29, 29, 20, 20, 20, 20, 20,
+ 20, 1, 19, 20, 20, 20, 21, 33,
+ 33, 20, 20, 20, 20, 20, 20, 1,
+ 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 13, 16, 24, 34, 35, 38,
+ 44, 11, 12, 14, 13, 15, 45, 17,
+ 18, 19, 20, 21, 22, 23, 25, 29,
+ 26, 27, 28, 30, 31, 32, 33, 36,
+ 37, 39, 40, 41, 42, 43
+ };
+
+ static const char _tsip_machine_parser_header_Privacy_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 3, 0, 3, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Privacy_start = 1;
+ static const int tsip_machine_parser_header_Privacy_first_final = 45;
+ static const int tsip_machine_parser_header_Privacy_error = 0;
+
+ static const int tsip_machine_parser_header_Privacy_en_main = 1;
+
+
+ /* #line 118 "./ragel/tsip_parser_header_Privacy.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Privacy_first_final);
+ (void)(tsip_machine_parser_header_Privacy_error);
+ (void)(tsip_machine_parser_header_Privacy_en_main);
+
+ /* #line 322 "./src/headers/tsip_header_Privacy.c" */
+ {
+ cs = tsip_machine_parser_header_Privacy_start;
+ }
+
+ /* #line 123 "./ragel/tsip_parser_header_Privacy.rl" */
+
+ /* #line 329 "./src/headers/tsip_header_Privacy.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Privacy_trans_keys + _tsip_machine_parser_header_Privacy_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Privacy_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Privacy_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Privacy_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Privacy_trans_keys + _tsip_machine_parser_header_Privacy_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Privacy_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Privacy_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Privacy_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Privacy_indicies[_trans];
- cs = _tsip_machine_parser_header_Privacy_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Privacy_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Privacy_actions + _tsip_machine_parser_header_Privacy_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 58 "./ragel/tsip_parser_header_Privacy.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 62 "./ragel/tsip_parser_header_Privacy.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_privacy->values);
- }
- break;
- case 2:
-/* #line 66 "./ragel/tsip_parser_header_Privacy.rl" */
- {
- }
- break;
-/* #line 420 "./src/headers/tsip_header_Privacy.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Privacy_indicies[_trans];
+ cs = _tsip_machine_parser_header_Privacy_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Privacy_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Privacy_actions + _tsip_machine_parser_header_Privacy_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 58 "./ragel/tsip_parser_header_Privacy.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 62 "./ragel/tsip_parser_header_Privacy.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_privacy->values);
+ }
+ break;
+ case 2:
+ /* #line 66 "./ragel/tsip_parser_header_Privacy.rl" */
+ {
+ }
+ break;
+ /* #line 420 "./src/headers/tsip_header_Privacy.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 124 "./ragel/tsip_parser_header_Privacy.rl" */
-
- if( cs <
-/* #line 436 "./src/headers/tsip_header_Privacy.c" */
-45
-/* #line 125 "./ragel/tsip_parser_header_Privacy.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Privacy' header.");
- TSK_OBJECT_SAFE_FREE(hdr_privacy);
- }
-
- return hdr_privacy;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 124 "./ragel/tsip_parser_header_Privacy.rl" */
+
+ if( cs <
+ /* #line 436 "./src/headers/tsip_header_Privacy.c" */
+ 45
+ /* #line 125 "./ragel/tsip_parser_header_Privacy.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Privacy' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_privacy);
+ }
+
+ return hdr_privacy;
}
@@ -455,35 +466,34 @@ _again:
static tsk_object_t* tsip_header_Privacy_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Privacy_t *Privacy = self;
- if(Privacy){
- TSIP_HEADER(Privacy)->type = tsip_htype_Privacy;
- TSIP_HEADER(Privacy)->serialize = tsip_header_Privacy_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Privacy header.");
- }
- return self;
+ tsip_header_Privacy_t *Privacy = self;
+ if(Privacy) {
+ TSIP_HEADER(Privacy)->type = tsip_htype_Privacy;
+ TSIP_HEADER(Privacy)->serialize = tsip_header_Privacy_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Privacy header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Privacy_dtor(tsk_object_t *self)
{
- tsip_header_Privacy_t *Privacy = self;
- if(Privacy){
- TSK_OBJECT_SAFE_FREE(Privacy->values);
- }
- else{
- TSK_DEBUG_ERROR("Null Privacy header.");
- }
-
- return self;
+ tsip_header_Privacy_t *Privacy = self;
+ if(Privacy) {
+ TSK_OBJECT_SAFE_FREE(Privacy->values);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Privacy header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Privacy_def_s =
-{
- sizeof(tsip_header_Privacy_t),
- tsip_header_Privacy_ctor,
- tsip_header_Privacy_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Privacy_def_s = {
+ sizeof(tsip_header_Privacy_t),
+ tsip_header_Privacy_ctor,
+ tsip_header_Privacy_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Privacy_def_t = &tsip_header_Privacy_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Proxy_Authenticate.c b/tinySIP/src/headers/tsip_header_Proxy_Authenticate.c
index 952882a..ffa76d9 100755
--- a/tinySIP/src/headers/tsip_header_Proxy_Authenticate.c
+++ b/tinySIP/src/headers/tsip_header_Proxy_Authenticate.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,69 +41,69 @@
tsip_header_Proxy_Authenticate_t* tsip_header_Proxy_Authenticate_create()
{
- return tsk_object_new(tsip_header_Proxy_Authenticate_def_t);
+ return tsk_object_new(tsip_header_Proxy_Authenticate_def_t);
}
int tsip_header_Proxy_Authenticate_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = (const tsip_header_Proxy_Authenticate_t*)header;
- if(Proxy_Authenticate && Proxy_Authenticate->scheme){
- return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
- Proxy_Authenticate->scheme,
- Proxy_Authenticate->realm ? Proxy_Authenticate->realm : "",
-
- Proxy_Authenticate->domain ? ",domain=\"" : "",
- Proxy_Authenticate->domain ? Proxy_Authenticate->domain : "",
- Proxy_Authenticate->domain ? "\"" : "",
-
-
- Proxy_Authenticate->qop ? ",qop=\"" : "",
- Proxy_Authenticate->qop ? Proxy_Authenticate->qop : "",
- Proxy_Authenticate->qop ? "\"" : "",
-
-
- Proxy_Authenticate->nonce ? ",nonce=\"" : "",
- Proxy_Authenticate->nonce ? Proxy_Authenticate->nonce : "",
- Proxy_Authenticate->nonce ? "\"" : "",
-
- Proxy_Authenticate->opaque ? ",opaque=\"" : "",
- Proxy_Authenticate->opaque ? Proxy_Authenticate->opaque : "",
- Proxy_Authenticate->opaque ? "\"" : "",
-
- Proxy_Authenticate->stale ? "TRUE" : "FALSE",
-
- Proxy_Authenticate->algorithm ? ",algorithm=" : "",
- Proxy_Authenticate->algorithm ? Proxy_Authenticate->algorithm : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = (const tsip_header_Proxy_Authenticate_t*)header;
+ if(Proxy_Authenticate && Proxy_Authenticate->scheme) {
+ return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
+ Proxy_Authenticate->scheme,
+ Proxy_Authenticate->realm ? Proxy_Authenticate->realm : "",
+
+ Proxy_Authenticate->domain ? ",domain=\"" : "",
+ Proxy_Authenticate->domain ? Proxy_Authenticate->domain : "",
+ Proxy_Authenticate->domain ? "\"" : "",
+
+
+ Proxy_Authenticate->qop ? ",qop=\"" : "",
+ Proxy_Authenticate->qop ? Proxy_Authenticate->qop : "",
+ Proxy_Authenticate->qop ? "\"" : "",
+
+
+ Proxy_Authenticate->nonce ? ",nonce=\"" : "",
+ Proxy_Authenticate->nonce ? Proxy_Authenticate->nonce : "",
+ Proxy_Authenticate->nonce ? "\"" : "",
+
+ Proxy_Authenticate->opaque ? ",opaque=\"" : "",
+ Proxy_Authenticate->opaque ? Proxy_Authenticate->opaque : "",
+ Proxy_Authenticate->opaque ? "\"" : "",
+
+ Proxy_Authenticate->stale ? "TRUE" : "FALSE",
+
+ Proxy_Authenticate->algorithm ? ",algorithm=" : "",
+ Proxy_Authenticate->algorithm ? Proxy_Authenticate->algorithm : ""
+ );
+ }
+ }
+ return -1;
}
tsip_header_Proxy_Authenticate_t *tsip_header_Proxy_Authenticate_parse(const char *data, tsk_size_t size)
{
- tsip_header_Proxy_Authenticate_t *sip_hdr = 0;
- thttp_header_Proxy_Authenticate_t* http_hdr;
-
- if((http_hdr = thttp_header_Proxy_Authenticate_parse(data, size))){
- sip_hdr = tsip_header_Proxy_Authenticate_create();
-
- sip_hdr->scheme = tsk_strdup(http_hdr->scheme);
- sip_hdr->realm = tsk_strdup(http_hdr->realm);
- sip_hdr->domain = tsk_strdup(http_hdr->domain);
- sip_hdr->nonce = tsk_strdup(http_hdr->nonce);
- sip_hdr->opaque = tsk_strdup(http_hdr->opaque);
- sip_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
- sip_hdr->qop = tsk_strdup(http_hdr->qop);
- sip_hdr->stale = http_hdr->stale;
-
- TSIP_HEADER(sip_hdr)->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
-
- TSK_OBJECT_SAFE_FREE(http_hdr);
- }
-
- return sip_hdr;
+ tsip_header_Proxy_Authenticate_t *sip_hdr = 0;
+ thttp_header_Proxy_Authenticate_t* http_hdr;
+
+ if((http_hdr = thttp_header_Proxy_Authenticate_parse(data, size))) {
+ sip_hdr = tsip_header_Proxy_Authenticate_create();
+
+ sip_hdr->scheme = tsk_strdup(http_hdr->scheme);
+ sip_hdr->realm = tsk_strdup(http_hdr->realm);
+ sip_hdr->domain = tsk_strdup(http_hdr->domain);
+ sip_hdr->nonce = tsk_strdup(http_hdr->nonce);
+ sip_hdr->opaque = tsk_strdup(http_hdr->opaque);
+ sip_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
+ sip_hdr->qop = tsk_strdup(http_hdr->qop);
+ sip_hdr->stale = http_hdr->stale;
+
+ TSIP_HEADER(sip_hdr)->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
+
+ TSK_OBJECT_SAFE_FREE(http_hdr);
+ }
+
+ return sip_hdr;
}
@@ -117,45 +117,44 @@ tsip_header_Proxy_Authenticate_t *tsip_header_Proxy_Authenticate_parse(const cha
*/
static tsk_object_t* tsip_header_Proxy_Authenticate_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = self;
- if(Proxy_Authenticate){
- TSIP_HEADER(Proxy_Authenticate)->type = tsip_htype_Proxy_Authenticate;
- TSIP_HEADER(Proxy_Authenticate)->serialize = tsip_header_Proxy_Authenticate_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Proxy_Authenticate header.");
- }
- return self;
+ tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = self;
+ if(Proxy_Authenticate) {
+ TSIP_HEADER(Proxy_Authenticate)->type = tsip_htype_Proxy_Authenticate;
+ TSIP_HEADER(Proxy_Authenticate)->serialize = tsip_header_Proxy_Authenticate_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Proxy_Authenticate header.");
+ }
+ return self;
}
/**@ingroup tsip_header_Proxy_Authenticate_group
*/
static tsk_object_t* tsip_header_Proxy_Authenticate_dtor(tsk_object_t *self)
{
- tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = self;
- if(Proxy_Authenticate){
- TSK_FREE(Proxy_Authenticate->scheme);
- TSK_FREE(Proxy_Authenticate->realm);
- TSK_FREE(Proxy_Authenticate->domain);
- TSK_FREE(Proxy_Authenticate->nonce);
- TSK_FREE(Proxy_Authenticate->opaque);
- TSK_FREE(Proxy_Authenticate->algorithm);
- TSK_FREE(Proxy_Authenticate->qop);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Proxy_Authenticate));
- }
- else{
- TSK_DEBUG_ERROR("Null Proxy_Authenticate header.");
- }
-
- return self;
+ tsip_header_Proxy_Authenticate_t *Proxy_Authenticate = self;
+ if(Proxy_Authenticate) {
+ TSK_FREE(Proxy_Authenticate->scheme);
+ TSK_FREE(Proxy_Authenticate->realm);
+ TSK_FREE(Proxy_Authenticate->domain);
+ TSK_FREE(Proxy_Authenticate->nonce);
+ TSK_FREE(Proxy_Authenticate->opaque);
+ TSK_FREE(Proxy_Authenticate->algorithm);
+ TSK_FREE(Proxy_Authenticate->qop);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Proxy_Authenticate));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Proxy_Authenticate header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Proxy_Authenticate_def_s =
-{
- sizeof(tsip_header_Proxy_Authenticate_t),
- tsip_header_Proxy_Authenticate_ctor,
- tsip_header_Proxy_Authenticate_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Proxy_Authenticate_def_s = {
+ sizeof(tsip_header_Proxy_Authenticate_t),
+ tsip_header_Proxy_Authenticate_ctor,
+ tsip_header_Proxy_Authenticate_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Proxy_Authenticate_def_t = &tsip_header_Proxy_Authenticate_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Proxy_Authorization.c b/tinySIP/src/headers/tsip_header_Proxy_Authorization.c
index dac8a97..dc0cc09 100755
--- a/tinySIP/src/headers/tsip_header_Proxy_Authorization.c
+++ b/tinySIP/src/headers/tsip_header_Proxy_Authorization.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,85 +41,85 @@
tsip_header_Proxy_Authorization_t* tsip_header_Proxy_Authorization_create()
{
- return tsk_object_new(tsip_header_Proxy_Authorization_def_t);
+ return tsk_object_new(tsip_header_Proxy_Authorization_def_t);
}
int tsip_header_Proxy_Authorization_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Proxy_Authorization_t *Proxy_Authorization = (const tsip_header_Proxy_Authorization_t *)header;
- if(Proxy_Authorization && Proxy_Authorization->scheme){
- return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- Proxy_Authorization->scheme,
-
- Proxy_Authorization->username ? "username=\"" : "",
- Proxy_Authorization->username ? Proxy_Authorization->username : "",
- Proxy_Authorization->username ? "\"" : "",
-
- Proxy_Authorization->realm ? ",realm=\"" : "",
- Proxy_Authorization->realm ? Proxy_Authorization->realm : "",
- Proxy_Authorization->realm ? "\"" : "",
-
- Proxy_Authorization->nonce ? ",nonce=\"" : "",
- Proxy_Authorization->nonce ? Proxy_Authorization->nonce : "",
- Proxy_Authorization->nonce ? "\"" : "",
-
- Proxy_Authorization->uri ? ",uri=\"" : "",
- Proxy_Authorization->uri ? Proxy_Authorization->uri : "",
- Proxy_Authorization->uri ? "\"" : "",
-
- Proxy_Authorization->response ? ",response=\"" : "",
- Proxy_Authorization->response ? Proxy_Authorization->response : "",
- Proxy_Authorization->response ? "\"" : "",
-
- Proxy_Authorization->algorithm ? ",algorithm=" : "",
- Proxy_Authorization->algorithm ? Proxy_Authorization->algorithm : "",
-
- Proxy_Authorization->cnonce ? ",cnonce=\"" : "",
- Proxy_Authorization->cnonce ? Proxy_Authorization->cnonce : "",
- Proxy_Authorization->cnonce ? "\"" : "",
-
- Proxy_Authorization->opaque ? ",opaque=\"" : "",
- Proxy_Authorization->opaque ? Proxy_Authorization->opaque : "",
- Proxy_Authorization->opaque ? "\"" : "",
-
- Proxy_Authorization->qop ? ",qop=" : "",
- Proxy_Authorization->qop ? Proxy_Authorization->qop : "",
-
- Proxy_Authorization->nc ? ",nc=" : "",
- Proxy_Authorization->nc ? Proxy_Authorization->nc : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tsip_header_Proxy_Authorization_t *Proxy_Authorization = (const tsip_header_Proxy_Authorization_t *)header;
+ if(Proxy_Authorization && Proxy_Authorization->scheme) {
+ return tsk_buffer_append_2(output, "%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ Proxy_Authorization->scheme,
+
+ Proxy_Authorization->username ? "username=\"" : "",
+ Proxy_Authorization->username ? Proxy_Authorization->username : "",
+ Proxy_Authorization->username ? "\"" : "",
+
+ Proxy_Authorization->realm ? ",realm=\"" : "",
+ Proxy_Authorization->realm ? Proxy_Authorization->realm : "",
+ Proxy_Authorization->realm ? "\"" : "",
+
+ Proxy_Authorization->nonce ? ",nonce=\"" : "",
+ Proxy_Authorization->nonce ? Proxy_Authorization->nonce : "",
+ Proxy_Authorization->nonce ? "\"" : "",
+
+ Proxy_Authorization->uri ? ",uri=\"" : "",
+ Proxy_Authorization->uri ? Proxy_Authorization->uri : "",
+ Proxy_Authorization->uri ? "\"" : "",
+
+ Proxy_Authorization->response ? ",response=\"" : "",
+ Proxy_Authorization->response ? Proxy_Authorization->response : "",
+ Proxy_Authorization->response ? "\"" : "",
+
+ Proxy_Authorization->algorithm ? ",algorithm=" : "",
+ Proxy_Authorization->algorithm ? Proxy_Authorization->algorithm : "",
+
+ Proxy_Authorization->cnonce ? ",cnonce=\"" : "",
+ Proxy_Authorization->cnonce ? Proxy_Authorization->cnonce : "",
+ Proxy_Authorization->cnonce ? "\"" : "",
+
+ Proxy_Authorization->opaque ? ",opaque=\"" : "",
+ Proxy_Authorization->opaque ? Proxy_Authorization->opaque : "",
+ Proxy_Authorization->opaque ? "\"" : "",
+
+ Proxy_Authorization->qop ? ",qop=" : "",
+ Proxy_Authorization->qop ? Proxy_Authorization->qop : "",
+
+ Proxy_Authorization->nc ? ",nc=" : "",
+ Proxy_Authorization->nc ? Proxy_Authorization->nc : ""
+ );
+ }
+ }
+ return -1;
}
tsip_header_Proxy_Authorization_t *tsip_header_Proxy_Authorization_parse(const char *data, tsk_size_t size)
{
- tsip_header_Proxy_Authorization_t *hdr_sip = 0;
- thttp_header_Proxy_Authorization_t* hdr_http;
-
- if((hdr_http = thttp_header_Proxy_Authorization_parse(data, size))){
- hdr_sip = tsip_header_Proxy_Authorization_create();
-
- hdr_sip->scheme = tsk_strdup(hdr_http->scheme);
- hdr_sip->username = tsk_strdup(hdr_http->username);
- hdr_sip->realm = tsk_strdup(hdr_http->realm);
- hdr_sip->nonce = tsk_strdup(hdr_http->nonce);
- hdr_sip->uri = tsk_strdup(hdr_http->uri);
- hdr_sip->response = tsk_strdup(hdr_http->response);
- hdr_sip->algorithm = tsk_strdup(hdr_http->algorithm);
- hdr_sip->cnonce = tsk_strdup(hdr_http->cnonce);
- hdr_sip->opaque = tsk_strdup(hdr_http->opaque);
- hdr_sip->qop = tsk_strdup(hdr_http->qop);
- hdr_sip->nc = tsk_strdup(hdr_http->nc);
-
- TSIP_HEADER(hdr_sip)->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
-
- TSK_OBJECT_SAFE_FREE(hdr_http);
- }
-
- return hdr_sip;
+ tsip_header_Proxy_Authorization_t *hdr_sip = 0;
+ thttp_header_Proxy_Authorization_t* hdr_http;
+
+ if((hdr_http = thttp_header_Proxy_Authorization_parse(data, size))) {
+ hdr_sip = tsip_header_Proxy_Authorization_create();
+
+ hdr_sip->scheme = tsk_strdup(hdr_http->scheme);
+ hdr_sip->username = tsk_strdup(hdr_http->username);
+ hdr_sip->realm = tsk_strdup(hdr_http->realm);
+ hdr_sip->nonce = tsk_strdup(hdr_http->nonce);
+ hdr_sip->uri = tsk_strdup(hdr_http->uri);
+ hdr_sip->response = tsk_strdup(hdr_http->response);
+ hdr_sip->algorithm = tsk_strdup(hdr_http->algorithm);
+ hdr_sip->cnonce = tsk_strdup(hdr_http->cnonce);
+ hdr_sip->opaque = tsk_strdup(hdr_http->opaque);
+ hdr_sip->qop = tsk_strdup(hdr_http->qop);
+ hdr_sip->nc = tsk_strdup(hdr_http->nc);
+
+ TSIP_HEADER(hdr_sip)->params = tsk_object_ref(THTTP_HEADER(hdr_http)->params);
+
+ TSK_OBJECT_SAFE_FREE(hdr_http);
+ }
+
+ return hdr_sip;
}
@@ -136,47 +136,48 @@ tsip_header_Proxy_Authorization_t *tsip_header_Proxy_Authorization_parse(const c
*/
static tsk_object_t* tsip_header_Proxy_Authorization_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Proxy_Authorization_t *Proxy_Authorization = self;
- if(Proxy_Authorization){
- TSIP_HEADER(Proxy_Authorization)->type = tsip_htype_Proxy_Authorization;
- TSIP_HEADER(Proxy_Authorization)->serialize = tsip_header_Proxy_Authorization_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Proxy_Authorization header.");
- }
- return self;
+ tsip_header_Proxy_Authorization_t *Proxy_Authorization = self;
+ if(Proxy_Authorization) {
+ TSIP_HEADER(Proxy_Authorization)->type = tsip_htype_Proxy_Authorization;
+ TSIP_HEADER(Proxy_Authorization)->serialize = tsip_header_Proxy_Authorization_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Proxy_Authorization header.");
+ }
+ return self;
}
/**@ingroup tsip_header_Proxy_Authorization_group
*/
static tsk_object_t* tsip_header_Proxy_Authorization_dtor(tsk_object_t *self)
{
- tsip_header_Proxy_Authorization_t *Proxy_Authorization = self;
- if(Proxy_Authorization){
- TSK_FREE(Proxy_Authorization->scheme);
- TSK_FREE(Proxy_Authorization->username);
- TSK_FREE(Proxy_Authorization->realm);
- TSK_FREE(Proxy_Authorization->nonce);
- TSK_FREE(Proxy_Authorization->uri);
- TSK_FREE(Proxy_Authorization->response);
- TSK_FREE(Proxy_Authorization->algorithm);
- TSK_FREE(Proxy_Authorization->cnonce);
- TSK_FREE(Proxy_Authorization->opaque);
- TSK_FREE(Proxy_Authorization->qop);
- TSK_FREE(Proxy_Authorization->nc);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Proxy_Authorization));
- }
- else TSK_DEBUG_ERROR("Null Proxy_Authorization header.");
-
- return self;
+ tsip_header_Proxy_Authorization_t *Proxy_Authorization = self;
+ if(Proxy_Authorization) {
+ TSK_FREE(Proxy_Authorization->scheme);
+ TSK_FREE(Proxy_Authorization->username);
+ TSK_FREE(Proxy_Authorization->realm);
+ TSK_FREE(Proxy_Authorization->nonce);
+ TSK_FREE(Proxy_Authorization->uri);
+ TSK_FREE(Proxy_Authorization->response);
+ TSK_FREE(Proxy_Authorization->algorithm);
+ TSK_FREE(Proxy_Authorization->cnonce);
+ TSK_FREE(Proxy_Authorization->opaque);
+ TSK_FREE(Proxy_Authorization->qop);
+ TSK_FREE(Proxy_Authorization->nc);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Proxy_Authorization));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Proxy_Authorization header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Proxy_Authorization_def_s =
-{
- sizeof(tsip_header_Proxy_Authorization_t),
- tsip_header_Proxy_Authorization_ctor,
- tsip_header_Proxy_Authorization_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Proxy_Authorization_def_s = {
+ sizeof(tsip_header_Proxy_Authorization_t),
+ tsip_header_Proxy_Authorization_ctor,
+ tsip_header_Proxy_Authorization_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Proxy_Authorization_def_t = &tsip_header_Proxy_Authorization_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Proxy_Require.c b/tinySIP/src/headers/tsip_header_Proxy_Require.c
index a0d69f4..61184bf 100755
--- a/tinySIP/src/headers/tsip_header_Proxy_Require.c
+++ b/tinySIP/src/headers/tsip_header_Proxy_Require.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,263 +50,274 @@
tsip_header_Proxy_Require_t* tsip_header_Proxy_Require_create(const char* option)
{
- return tsk_object_new(TSIP_HEADER_PROXY_REQUIRE_VA_ARGS(option));
+ return tsk_object_new(TSIP_HEADER_PROXY_REQUIRE_VA_ARGS(option));
}
tsip_header_Proxy_Require_t* tsip_header_Proxy_Require_create_null()
{
- return tsip_header_Proxy_Require_create(tsk_null);
+ return tsip_header_Proxy_Require_create(tsk_null);
}
int tsip_header_Proxy_Require_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Proxy_Require_t *Proxy_Require = (const tsip_header_Proxy_Require_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Proxy_Require->options){
- str = item->data;
- if(item == Proxy_Require->options->head){
- ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- ret = tsk_buffer_append_2(output, ",%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Proxy_Require_t *Proxy_Require = (const tsip_header_Proxy_Require_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Proxy_Require->options) {
+ str = item->data;
+ if(item == Proxy_Require->options->head) {
+ ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ ret = tsk_buffer_append_2(output, ",%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Proxy_Require_t *tsip_header_Proxy_Require_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Proxy_Require_t *hdr_proxyrequire = tsip_header_Proxy_Require_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 97 "./src/headers/tsip_header_Proxy_Require.c" */
-static const char _tsip_machine_parser_header_Proxy_Require_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 11,
- 13, 15, 17, 19, 21, 23, 25, 28,
- 45, 46, 48, 64, 80, 84, 85, 87,
- 90, 91
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_trans_keys[] = {
- 80, 112, 82, 114, 79, 111, 88, 120,
- 89, 121, 45, 82, 114, 69, 101, 81,
- 113, 85, 117, 73, 105, 82, 114, 69,
- 101, 9, 32, 58, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 32, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 44, 10, 9, 32, 9,
- 32, 44, 10, 0
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 2, 2, 3, 7,
- 1, 2, 6, 8, 4, 1, 2, 3,
- 1, 0
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 0, 5, 4, 0, 0, 0, 0,
- 0, 0
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 17,
- 20, 23, 26, 29, 32, 35, 38, 42,
- 55, 57, 60, 72, 85, 90, 92, 95,
- 99, 101
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 13, 13,
- 14, 1, 14, 15, 14, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 1, 17,
- 1, 18, 18, 1, 18, 18, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 1,
- 19, 20, 19, 21, 21, 21, 22, 21,
- 21, 21, 21, 21, 1, 23, 24, 23,
- 14, 1, 25, 1, 26, 26, 1, 26,
- 26, 14, 1, 27, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 19, 17, 18, 20, 24, 19, 15, 20,
- 21, 22, 23, 25
-};
-
-static const char _tsip_machine_parser_header_Proxy_Require_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 3, 3, 0, 3, 0,
- 0, 0, 0, 5
-};
-
-static const int tsip_machine_parser_header_Proxy_Require_start = 1;
-static const int tsip_machine_parser_header_Proxy_Require_first_final = 25;
-static const int tsip_machine_parser_header_Proxy_Require_error = 0;
-
-static const int tsip_machine_parser_header_Proxy_Require_en_main = 1;
-
-
-/* #line 114 "./ragel/tsip_parser_header_Proxy_Require.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Proxy_Require_first_final);
- (void)(tsip_machine_parser_header_Proxy_Require_error);
- (void)(tsip_machine_parser_header_Proxy_Require_en_main);
-
-/* #line 188 "./src/headers/tsip_header_Proxy_Require.c" */
- {
- cs = tsip_machine_parser_header_Proxy_Require_start;
- }
-
-/* #line 119 "./ragel/tsip_parser_header_Proxy_Require.rl" */
-
-/* #line 195 "./src/headers/tsip_header_Proxy_Require.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Proxy_Require_t *hdr_proxyrequire = tsip_header_Proxy_Require_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 97 "./src/headers/tsip_header_Proxy_Require.c" */
+ static const char _tsip_machine_parser_header_Proxy_Require_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 11,
+ 13, 15, 17, 19, 21, 23, 25, 28,
+ 45, 46, 48, 64, 80, 84, 85, 87,
+ 90, 91
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_trans_keys[] = {
+ 80, 112, 82, 114, 79, 111, 88, 120,
+ 89, 121, 45, 82, 114, 69, 101, 81,
+ 113, 85, 117, 73, 105, 82, 114, 69,
+ 101, 9, 32, 58, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 32, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 44, 10, 9, 32, 9,
+ 32, 44, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 2, 2, 2, 2, 3, 7,
+ 1, 2, 6, 8, 4, 1, 2, 3,
+ 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 0, 5, 4, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 17,
+ 20, 23, 26, 29, 32, 35, 38, 42,
+ 55, 57, 60, 72, 85, 90, 92, 95,
+ 99, 101
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 13, 13,
+ 14, 1, 14, 15, 14, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 1, 17,
+ 1, 18, 18, 1, 18, 18, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 1,
+ 19, 20, 19, 21, 21, 21, 22, 21,
+ 21, 21, 21, 21, 1, 23, 24, 23,
+ 14, 1, 25, 1, 26, 26, 1, 26,
+ 26, 14, 1, 27, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 19, 17, 18, 20, 24, 19, 15, 20,
+ 21, 22, 23, 25
+ };
+
+ static const char _tsip_machine_parser_header_Proxy_Require_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 3, 3, 0, 3, 0,
+ 0, 0, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Proxy_Require_start = 1;
+ static const int tsip_machine_parser_header_Proxy_Require_first_final = 25;
+ static const int tsip_machine_parser_header_Proxy_Require_error = 0;
+
+ static const int tsip_machine_parser_header_Proxy_Require_en_main = 1;
+
+
+ /* #line 114 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Proxy_Require_first_final);
+ (void)(tsip_machine_parser_header_Proxy_Require_error);
+ (void)(tsip_machine_parser_header_Proxy_Require_en_main);
+
+ /* #line 188 "./src/headers/tsip_header_Proxy_Require.c" */
+ {
+ cs = tsip_machine_parser_header_Proxy_Require_start;
+ }
+
+ /* #line 119 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+
+ /* #line 195 "./src/headers/tsip_header_Proxy_Require.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Proxy_Require_trans_keys + _tsip_machine_parser_header_Proxy_Require_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Proxy_Require_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Proxy_Require_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Proxy_Require_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Proxy_Require_trans_keys + _tsip_machine_parser_header_Proxy_Require_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Proxy_Require_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Proxy_Require_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Proxy_Require_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Proxy_Require_indicies[_trans];
- cs = _tsip_machine_parser_header_Proxy_Require_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Proxy_Require_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Proxy_Require_actions + _tsip_machine_parser_header_Proxy_Require_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Proxy_Require.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Proxy_Require.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_proxyrequire->options);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Proxy_Require.rl" */
- {
- }
- break;
-/* #line 286 "./src/headers/tsip_header_Proxy_Require.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Proxy_Require_indicies[_trans];
+ cs = _tsip_machine_parser_header_Proxy_Require_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Proxy_Require_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Proxy_Require_actions + _tsip_machine_parser_header_Proxy_Require_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_proxyrequire->options);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+ {
+ }
+ break;
+ /* #line 286 "./src/headers/tsip_header_Proxy_Require.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 120 "./ragel/tsip_parser_header_Proxy_Require.rl" */
-
- if( cs <
-/* #line 302 "./src/headers/tsip_header_Proxy_Require.c" */
-25
-/* #line 121 "./ragel/tsip_parser_header_Proxy_Require.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Privacy' header.");
- TSK_OBJECT_SAFE_FREE(hdr_proxyrequire);
- }
-
- return hdr_proxyrequire;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 120 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+
+ if( cs <
+ /* #line 302 "./src/headers/tsip_header_Proxy_Require.c" */
+ 25
+ /* #line 121 "./ragel/tsip_parser_header_Proxy_Require.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Privacy' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_proxyrequire);
+ }
+
+ return hdr_proxyrequire;
}
@@ -321,44 +332,43 @@ _again:
static tsk_object_t* tsip_header_Proxy_Require_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Proxy_Require_t *Proxy_Require = self;
- if(Proxy_Require){
- const char* option;
-
- TSIP_HEADER(Proxy_Require)->type = tsip_htype_Proxy_Require;
- TSIP_HEADER(Proxy_Require)->serialize = tsip_header_Proxy_Require_serialize;
-
- if((option = va_arg(*app, const char*))){
- tsk_string_t* string = tsk_string_create(option);
- Proxy_Require->options = tsk_list_create();
-
- tsk_list_push_back_data(Proxy_Require->options, ((void**) &string));
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Proxy_Require header.");
- }
- return self;
+ tsip_header_Proxy_Require_t *Proxy_Require = self;
+ if(Proxy_Require) {
+ const char* option;
+
+ TSIP_HEADER(Proxy_Require)->type = tsip_htype_Proxy_Require;
+ TSIP_HEADER(Proxy_Require)->serialize = tsip_header_Proxy_Require_serialize;
+
+ if((option = va_arg(*app, const char*))) {
+ tsk_string_t* string = tsk_string_create(option);
+ Proxy_Require->options = tsk_list_create();
+
+ tsk_list_push_back_data(Proxy_Require->options, ((void**) &string));
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Proxy_Require header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Proxy_Require_dtor(tsk_object_t *self)
{
- tsip_header_Proxy_Require_t *Proxy_Require = self;
- if(Proxy_Require){
- TSK_OBJECT_SAFE_FREE(Proxy_Require->options);
- }
- else{
- TSK_DEBUG_ERROR("Null Proxy_Require header.");
- }
-
- return self;
+ tsip_header_Proxy_Require_t *Proxy_Require = self;
+ if(Proxy_Require) {
+ TSK_OBJECT_SAFE_FREE(Proxy_Require->options);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Proxy_Require header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Proxy_Require_def_s =
-{
- sizeof(tsip_header_Proxy_Require_t),
- tsip_header_Proxy_Require_ctor,
- tsip_header_Proxy_Require_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Proxy_Require_def_s = {
+ sizeof(tsip_header_Proxy_Require_t),
+ tsip_header_Proxy_Require_ctor,
+ tsip_header_Proxy_Require_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Proxy_Require_def_t = &tsip_header_Proxy_Require_def_s;
diff --git a/tinySIP/src/headers/tsip_header_RAck.c b/tinySIP/src/headers/tsip_header_RAck.c
index 4040c8c..3c8dd08 100755
--- a/tinySIP/src/headers/tsip_header_RAck.c
+++ b/tinySIP/src/headers/tsip_header_RAck.c
@@ -6,19 +6,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,258 +49,269 @@
tsip_header_RAck_t* tsip_header_RAck_create(uint32_t seq, uint32_t cseq, const char* method)
{
- return tsk_object_new(TSIP_HEADER_RACK_VA_ARGS(seq, cseq, method));
+ return tsk_object_new(TSIP_HEADER_RACK_VA_ARGS(seq, cseq, method));
}
tsip_header_RAck_t* tsip_header_RAck_create_null()
{
- return tsip_header_RAck_create(0, 0, tsk_null);
+ return tsip_header_RAck_create(0, 0, tsk_null);
}
int tsip_header_RAck_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_RAck_t *RAck = (const tsip_header_RAck_t *)header;
- return tsk_buffer_append_2(output, "%u %u %s", RAck->seq, RAck->cseq, RAck->method);
- }
- return -1;
+ if(header) {
+ const tsip_header_RAck_t *RAck = (const tsip_header_RAck_t *)header;
+ return tsk_buffer_append_2(output, "%u %u %s", RAck->seq, RAck->cseq, RAck->method);
+ }
+ return -1;
}
tsip_header_RAck_t *tsip_header_RAck_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_RAck_t *hdr_rack = tsip_header_RAck_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 81 "./src/headers/tsip_header_RAck.c" */
-static const char _tsip_machine_parser_header_RAck_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4
-};
-
-static const char _tsip_machine_parser_header_RAck_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 16,
- 17, 19, 23, 28, 33, 34, 36, 40,
- 45, 62, 63, 65, 81, 96, 97
-};
-
-static const char _tsip_machine_parser_header_RAck_trans_keys[] = {
- 82, 114, 65, 97, 67, 99, 75, 107,
- 9, 32, 58, 9, 13, 32, 48, 57,
- 10, 9, 32, 9, 32, 48, 57, 9,
- 13, 32, 48, 57, 9, 13, 32, 48,
- 57, 10, 9, 32, 9, 32, 48, 57,
- 9, 13, 32, 48, 57, 9, 13, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 13, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 0
-};
-
-static const char _tsip_machine_parser_header_RAck_single_lengths[] = {
- 0, 2, 2, 2, 2, 3, 3, 1,
- 2, 2, 3, 3, 1, 2, 2, 3,
- 7, 1, 2, 6, 5, 1, 0
-};
-
-static const char _tsip_machine_parser_header_RAck_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 1, 1, 1, 0, 0, 1, 1,
- 5, 0, 0, 5, 5, 0, 0
-};
-
-static const char _tsip_machine_parser_header_RAck_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 16, 21,
- 23, 26, 30, 35, 40, 42, 45, 49,
- 54, 67, 69, 72, 84, 95, 97
-};
-
-static const char _tsip_machine_parser_header_RAck_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 4, 4, 5, 1,
- 5, 6, 5, 7, 1, 8, 1, 9,
- 9, 1, 9, 9, 7, 1, 10, 11,
- 10, 12, 1, 13, 14, 13, 15, 1,
- 16, 1, 17, 17, 1, 17, 17, 15,
- 1, 18, 19, 18, 20, 1, 21, 22,
- 21, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 1, 24, 1, 25, 25, 1,
- 25, 25, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 1, 26, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 1, 28,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_RAck_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 10,
- 8, 9, 11, 12, 10, 11, 12, 15,
- 13, 14, 16, 17, 15, 16, 17, 20,
- 18, 19, 21, 20, 22
-};
-
-static const char _tsip_machine_parser_header_RAck_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 3, 3, 0, 0, 0, 1,
- 0, 0, 5, 5, 0, 0, 0, 1,
- 0, 0, 7, 0, 9
-};
-
-static const int tsip_machine_parser_header_RAck_start = 1;
-static const int tsip_machine_parser_header_RAck_first_final = 22;
-static const int tsip_machine_parser_header_RAck_error = 0;
-
-static const int tsip_machine_parser_header_RAck_en_main = 1;
-
-
-/* #line 106 "./ragel/tsip_parser_header_RAck.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_RAck_first_final);
- (void)(tsip_machine_parser_header_RAck_error);
- (void)(tsip_machine_parser_header_RAck_en_main);
-
-/* #line 170 "./src/headers/tsip_header_RAck.c" */
- {
- cs = tsip_machine_parser_header_RAck_start;
- }
-
-/* #line 111 "./ragel/tsip_parser_header_RAck.rl" */
-
-/* #line 177 "./src/headers/tsip_header_RAck.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_RAck_t *hdr_rack = tsip_header_RAck_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 81 "./src/headers/tsip_header_RAck.c" */
+ static const char _tsip_machine_parser_header_RAck_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4
+ };
+
+ static const char _tsip_machine_parser_header_RAck_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 16,
+ 17, 19, 23, 28, 33, 34, 36, 40,
+ 45, 62, 63, 65, 81, 96, 97
+ };
+
+ static const char _tsip_machine_parser_header_RAck_trans_keys[] = {
+ 82, 114, 65, 97, 67, 99, 75, 107,
+ 9, 32, 58, 9, 13, 32, 48, 57,
+ 10, 9, 32, 9, 32, 48, 57, 9,
+ 13, 32, 48, 57, 9, 13, 32, 48,
+ 57, 10, 9, 32, 9, 32, 48, 57,
+ 9, 13, 32, 48, 57, 9, 13, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 13, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_RAck_single_lengths[] = {
+ 0, 2, 2, 2, 2, 3, 3, 1,
+ 2, 2, 3, 3, 1, 2, 2, 3,
+ 7, 1, 2, 6, 5, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_RAck_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 1, 1, 1, 0, 0, 1, 1,
+ 5, 0, 0, 5, 5, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_RAck_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 16, 21,
+ 23, 26, 30, 35, 40, 42, 45, 49,
+ 54, 67, 69, 72, 84, 95, 97
+ };
+
+ static const char _tsip_machine_parser_header_RAck_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 4, 4, 5, 1,
+ 5, 6, 5, 7, 1, 8, 1, 9,
+ 9, 1, 9, 9, 7, 1, 10, 11,
+ 10, 12, 1, 13, 14, 13, 15, 1,
+ 16, 1, 17, 17, 1, 17, 17, 15,
+ 1, 18, 19, 18, 20, 1, 21, 22,
+ 21, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 1, 24, 1, 25, 25, 1,
+ 25, 25, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 1, 26, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 1, 28,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_RAck_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 10,
+ 8, 9, 11, 12, 10, 11, 12, 15,
+ 13, 14, 16, 17, 15, 16, 17, 20,
+ 18, 19, 21, 20, 22
+ };
+
+ static const char _tsip_machine_parser_header_RAck_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 3, 3, 0, 0, 0, 1,
+ 0, 0, 5, 5, 0, 0, 0, 1,
+ 0, 0, 7, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_RAck_start = 1;
+ static const int tsip_machine_parser_header_RAck_first_final = 22;
+ static const int tsip_machine_parser_header_RAck_error = 0;
+
+ static const int tsip_machine_parser_header_RAck_en_main = 1;
+
+
+ /* #line 106 "./ragel/tsip_parser_header_RAck.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_RAck_first_final);
+ (void)(tsip_machine_parser_header_RAck_error);
+ (void)(tsip_machine_parser_header_RAck_en_main);
+
+ /* #line 170 "./src/headers/tsip_header_RAck.c" */
+ {
+ cs = tsip_machine_parser_header_RAck_start;
+ }
+
+ /* #line 111 "./ragel/tsip_parser_header_RAck.rl" */
+
+ /* #line 177 "./src/headers/tsip_header_RAck.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_RAck_trans_keys + _tsip_machine_parser_header_RAck_key_offsets[cs];
- _trans = _tsip_machine_parser_header_RAck_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_RAck_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_RAck_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_RAck_trans_keys + _tsip_machine_parser_header_RAck_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_RAck_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_RAck_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_RAck_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_RAck_indicies[_trans];
- cs = _tsip_machine_parser_header_RAck_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_RAck_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_RAck_actions + _tsip_machine_parser_header_RAck_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_RAck.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_RAck.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_rack->seq);
- }
- break;
- case 2:
-/* #line 57 "./ragel/tsip_parser_header_RAck.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_rack->cseq);
- }
- break;
- case 3:
-/* #line 61 "./ragel/tsip_parser_header_RAck.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_rack->method);
- }
- break;
- case 4:
-/* #line 65 "./ragel/tsip_parser_header_RAck.rl" */
- {
- }
- break;
-/* #line 280 "./src/headers/tsip_header_RAck.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_RAck_indicies[_trans];
+ cs = _tsip_machine_parser_header_RAck_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_RAck_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_RAck_actions + _tsip_machine_parser_header_RAck_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_RAck.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_RAck.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_rack->seq);
+ }
+ break;
+ case 2:
+ /* #line 57 "./ragel/tsip_parser_header_RAck.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_rack->cseq);
+ }
+ break;
+ case 3:
+ /* #line 61 "./ragel/tsip_parser_header_RAck.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_rack->method);
+ }
+ break;
+ case 4:
+ /* #line 65 "./ragel/tsip_parser_header_RAck.rl" */
+ {
+ }
+ break;
+ /* #line 280 "./src/headers/tsip_header_RAck.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 112 "./ragel/tsip_parser_header_RAck.rl" */
-
- if( cs <
-/* #line 296 "./src/headers/tsip_header_RAck.c" */
-22
-/* #line 113 "./ragel/tsip_parser_header_RAck.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'RAck' header.");
- TSK_OBJECT_SAFE_FREE(hdr_rack);
- }
-
- return hdr_rack;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 112 "./ragel/tsip_parser_header_RAck.rl" */
+
+ if( cs <
+ /* #line 296 "./src/headers/tsip_header_RAck.c" */
+ 22
+ /* #line 113 "./ragel/tsip_parser_header_RAck.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'RAck' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_rack);
+ }
+
+ return hdr_rack;
}
@@ -315,41 +326,40 @@ _again:
static tsk_object_t* tsip_header_RAck_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_RAck_t *RAck = self;
- if(RAck){
- TSIP_HEADER(RAck)->type = tsip_htype_RAck;
- TSIP_HEADER(RAck)->serialize = tsip_header_RAck_serialize;
- RAck->seq = va_arg(*app, uint32_t);
- RAck->cseq = va_arg(*app, uint32_t);
- RAck->method = tsk_strdup( va_arg(*app, const char*) );
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new RAck header.");
- }
- return self;
+ tsip_header_RAck_t *RAck = self;
+ if(RAck) {
+ TSIP_HEADER(RAck)->type = tsip_htype_RAck;
+ TSIP_HEADER(RAck)->serialize = tsip_header_RAck_serialize;
+ RAck->seq = va_arg(*app, uint32_t);
+ RAck->cseq = va_arg(*app, uint32_t);
+ RAck->method = tsk_strdup( va_arg(*app, const char*) );
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new RAck header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_RAck_dtor(tsk_object_t *self)
{
- tsip_header_RAck_t *RAck = self;
- if(RAck){
- TSK_FREE(RAck->method);
+ tsip_header_RAck_t *RAck = self;
+ if(RAck) {
+ TSK_FREE(RAck->method);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(RAck));
- }
- else{
- TSK_DEBUG_ERROR("Null RAck header.");
- }
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(RAck));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null RAck header.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsip_header_RAck_def_s =
-{
- sizeof(tsip_header_RAck_t),
- tsip_header_RAck_ctor,
- tsip_header_RAck_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_RAck_def_s = {
+ sizeof(tsip_header_RAck_t),
+ tsip_header_RAck_ctor,
+ tsip_header_RAck_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_RAck_def_t = &tsip_header_RAck_def_s;
diff --git a/tinySIP/src/headers/tsip_header_RSeq.c b/tinySIP/src/headers/tsip_header_RSeq.c
index 0e419b4..d909b14 100755
--- a/tinySIP/src/headers/tsip_header_RSeq.c
+++ b/tinySIP/src/headers/tsip_header_RSeq.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,220 +49,231 @@
tsip_header_RSeq_t* tsip_header_RSeq_create(uint32_t seq)
{
- return tsk_object_new(TSIP_HEADER_RSEQ_VA_ARGS(seq));
+ return tsk_object_new(TSIP_HEADER_RSEQ_VA_ARGS(seq));
}
tsip_header_RSeq_t* tsip_header_RSeq_create_null()
{
- return tsip_header_RSeq_create(0);
+ return tsip_header_RSeq_create(0);
}
int tsip_header_RSeq_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_RSeq_t *RSeq = (const tsip_header_RSeq_t *)header;
- return tsk_buffer_append_2(output, "%u", RSeq->seq);
- }
- return -1;
+ if(header) {
+ const tsip_header_RSeq_t *RSeq = (const tsip_header_RSeq_t *)header;
+ return tsk_buffer_append_2(output, "%u", RSeq->seq);
+ }
+ return -1;
}
tsip_header_RSeq_t *tsip_header_RSeq_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_RSeq_t *hdr_rseq = tsip_header_RSeq_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 81 "./src/headers/tsip_header_RSeq.c" */
-static const char _tsip_machine_parser_header_RSeq_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_RSeq_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 11, 16,
- 17, 19, 23, 26, 27
-};
-
-static const char _tsip_machine_parser_header_RSeq_trans_keys[] = {
- 82, 114, 83, 115, 69, 101, 81, 113,
- 9, 32, 58, 9, 13, 32, 48, 57,
- 10, 9, 32, 9, 32, 48, 57, 13,
- 48, 57, 10, 0
-};
-
-static const char _tsip_machine_parser_header_RSeq_single_lengths[] = {
- 0, 2, 2, 2, 2, 3, 3, 1,
- 2, 2, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_RSeq_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 1, 1, 0, 0
-};
-
-static const char _tsip_machine_parser_header_RSeq_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 16, 21,
- 23, 26, 30, 33, 35
-};
-
-static const char _tsip_machine_parser_header_RSeq_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 4, 4, 5, 1,
- 5, 6, 5, 7, 1, 8, 1, 9,
- 9, 1, 9, 9, 7, 1, 10, 11,
- 1, 12, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_RSeq_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 10,
- 8, 9, 11, 10, 12
-};
-
-static const char _tsip_machine_parser_header_RSeq_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_RSeq_start = 1;
-static const int tsip_machine_parser_header_RSeq_first_final = 12;
-static const int tsip_machine_parser_header_RSeq_error = 0;
-
-static const int tsip_machine_parser_header_RSeq_en_main = 1;
-
-
-/* #line 98 "./ragel/tsip_parser_header_RSeq.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_RSeq_first_final);
- (void)(tsip_machine_parser_header_RSeq_error);
- (void)(tsip_machine_parser_header_RSeq_en_main);
-
-/* #line 144 "./src/headers/tsip_header_RSeq.c" */
- {
- cs = tsip_machine_parser_header_RSeq_start;
- }
-
-/* #line 103 "./ragel/tsip_parser_header_RSeq.rl" */
-
-/* #line 151 "./src/headers/tsip_header_RSeq.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_RSeq_t *hdr_rseq = tsip_header_RSeq_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 81 "./src/headers/tsip_header_RSeq.c" */
+ static const char _tsip_machine_parser_header_RSeq_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 11, 16,
+ 17, 19, 23, 26, 27
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_trans_keys[] = {
+ 82, 114, 83, 115, 69, 101, 81, 113,
+ 9, 32, 58, 9, 13, 32, 48, 57,
+ 10, 9, 32, 9, 32, 48, 57, 13,
+ 48, 57, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_single_lengths[] = {
+ 0, 2, 2, 2, 2, 3, 3, 1,
+ 2, 2, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 1, 1, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 16, 21,
+ 23, 26, 30, 33, 35
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 4, 4, 5, 1,
+ 5, 6, 5, 7, 1, 8, 1, 9,
+ 9, 1, 9, 9, 7, 1, 10, 11,
+ 1, 12, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 10,
+ 8, 9, 11, 10, 12
+ };
+
+ static const char _tsip_machine_parser_header_RSeq_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_RSeq_start = 1;
+ static const int tsip_machine_parser_header_RSeq_first_final = 12;
+ static const int tsip_machine_parser_header_RSeq_error = 0;
+
+ static const int tsip_machine_parser_header_RSeq_en_main = 1;
+
+
+ /* #line 98 "./ragel/tsip_parser_header_RSeq.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_RSeq_first_final);
+ (void)(tsip_machine_parser_header_RSeq_error);
+ (void)(tsip_machine_parser_header_RSeq_en_main);
+
+ /* #line 144 "./src/headers/tsip_header_RSeq.c" */
+ {
+ cs = tsip_machine_parser_header_RSeq_start;
+ }
+
+ /* #line 103 "./ragel/tsip_parser_header_RSeq.rl" */
+
+ /* #line 151 "./src/headers/tsip_header_RSeq.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_RSeq_trans_keys + _tsip_machine_parser_header_RSeq_key_offsets[cs];
- _trans = _tsip_machine_parser_header_RSeq_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_RSeq_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_RSeq_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_RSeq_trans_keys + _tsip_machine_parser_header_RSeq_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_RSeq_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_RSeq_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_RSeq_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_RSeq_indicies[_trans];
- cs = _tsip_machine_parser_header_RSeq_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_RSeq_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_RSeq_actions + _tsip_machine_parser_header_RSeq_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_RSeq.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_RSeq.rl" */
- {
- TSK_PARSER_SET_UINT(hdr_rseq->seq);
- }
- break;
- case 2:
-/* #line 57 "./ragel/tsip_parser_header_RSeq.rl" */
- {
- }
- break;
-/* #line 242 "./src/headers/tsip_header_RSeq.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_RSeq_indicies[_trans];
+ cs = _tsip_machine_parser_header_RSeq_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_RSeq_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_RSeq_actions + _tsip_machine_parser_header_RSeq_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_RSeq.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_RSeq.rl" */
+ {
+ TSK_PARSER_SET_UINT(hdr_rseq->seq);
+ }
+ break;
+ case 2:
+ /* #line 57 "./ragel/tsip_parser_header_RSeq.rl" */
+ {
+ }
+ break;
+ /* #line 242 "./src/headers/tsip_header_RSeq.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 104 "./ragel/tsip_parser_header_RSeq.rl" */
-
- if( cs <
-/* #line 258 "./src/headers/tsip_header_RSeq.c" */
-12
-/* #line 105 "./ragel/tsip_parser_header_RSeq.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'RSeq' header.");
- TSK_OBJECT_SAFE_FREE(hdr_rseq);
- }
-
- return hdr_rseq;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 104 "./ragel/tsip_parser_header_RSeq.rl" */
+
+ if( cs <
+ /* #line 258 "./src/headers/tsip_header_RSeq.c" */
+ 12
+ /* #line 105 "./ragel/tsip_parser_header_RSeq.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'RSeq' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_rseq);
+ }
+
+ return hdr_rseq;
}
@@ -277,37 +288,36 @@ _again:
static tsk_object_t* tsip_header_RSeq_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_RSeq_t *RSeq = self;
- if(RSeq){
- TSIP_HEADER(RSeq)->type = tsip_htype_RSeq;
- TSIP_HEADER(RSeq)->serialize = tsip_header_RSeq_serialize;
- RSeq->seq = va_arg(*app, uint32_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new RSeq header.");
- }
- return self;
+ tsip_header_RSeq_t *RSeq = self;
+ if(RSeq) {
+ TSIP_HEADER(RSeq)->type = tsip_htype_RSeq;
+ TSIP_HEADER(RSeq)->serialize = tsip_header_RSeq_serialize;
+ RSeq->seq = va_arg(*app, uint32_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new RSeq header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_RSeq_dtor(tsk_object_t *self)
{
- tsip_header_RSeq_t *RSeq = self;
- if(RSeq){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(RSeq));
- }
- else{
- TSK_DEBUG_ERROR("Null RSeq header.");
- }
-
- return self;
+ tsip_header_RSeq_t *RSeq = self;
+ if(RSeq) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(RSeq));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null RSeq header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_RSeq_def_s =
-{
- sizeof(tsip_header_RSeq_t),
- tsip_header_RSeq_ctor,
- tsip_header_RSeq_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_RSeq_def_s = {
+ sizeof(tsip_header_RSeq_t),
+ tsip_header_RSeq_ctor,
+ tsip_header_RSeq_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_RSeq_def_t = &tsip_header_RSeq_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Record_Route.c b/tinySIP/src/headers/tsip_header_Record_Route.c
index 08e610f..b75f809 100755
--- a/tinySIP/src/headers/tsip_header_Record_Route.c
+++ b/tinySIP/src/headers/tsip_header_Record_Route.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,454 +51,465 @@
tsip_header_Record_Route_t* tsip_header_Record_Route_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_RECORD_ROUTE_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_RECORD_ROUTE_VA_ARGS(uri));
}
tsip_header_Record_Route_t* tsip_header_Record_Route_create_null()
{
- return tsip_header_Record_Route_create(tsk_null);
+ return tsip_header_Record_Route_create(tsk_null);
}
int tsip_header_Record_Route_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- int ret;
- const tsip_header_Record_Route_t *Record_Route = (const tsip_header_Record_Route_t *)header;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Record_Route->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- return ret;
- }
- return -1;
+ if(header) {
+ int ret;
+ const tsip_header_Record_Route_t *Record_Route = (const tsip_header_Record_Route_t *)header;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Record_Route->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ return ret;
+ }
+ return -1;
}
- tsip_header_Record_Routes_L_t* tsip_header_Record_Route_parse(const char *data, tsk_size_t size)
+tsip_header_Record_Routes_L_t* tsip_header_Record_Route_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Record_Routes_L_t *hdr_record_routes = tsk_list_create();
- tsip_header_Record_Route_t *curr_route = tsk_null;
-
- const char *tag_start = tsk_null;
-
-
-/* #line 90 "./src/headers/tsip_header_Record_Route.c" */
-static const char _tsip_machine_parser_header_Record_Route_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 1, 0, 2, 4, 5
-};
-
-static const short _tsip_machine_parser_header_Record_Route_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 13, 15, 17, 19, 21, 23, 26, 45,
- 46, 48, 67, 68, 70, 73, 77, 89,
- 92, 92, 93, 98, 99, 116, 117, 119,
- 135, 153, 159, 160, 162, 167, 186, 187,
- 189, 208, 209, 211, 214, 222, 223, 225,
- 230, 235, 236, 238, 242, 248, 265, 272,
- 280, 288, 296, 298, 305, 314, 316, 319,
- 321, 324, 326, 329, 332, 333, 336, 337,
- 340, 341, 350, 359, 367, 375, 383, 391,
- 393, 399, 408, 417, 426, 428, 431, 434,
- 435, 436, 453, 471, 475, 476, 478, 486,
- 487, 489, 493, 499
-};
-
-static const char _tsip_machine_parser_header_Record_Route_trans_keys[] = {
- 82, 114, 69, 101, 67, 99, 79, 111,
- 82, 114, 68, 100, 45, 82, 114, 79,
- 111, 85, 117, 84, 116, 69, 101, 9,
- 32, 58, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 60,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 60, 65, 90, 97, 122, 9, 32, 43,
- 58, 45, 46, 48, 57, 65, 90, 97,
- 122, 9, 32, 58, 62, 9, 13, 32,
- 44, 59, 10, 9, 13, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 59, 61, 10,
- 9, 32, 9, 32, 44, 59, 61, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 32, 34, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 9,
- 32, 9, 13, 32, 44, 59, 9, 13,
- 32, 44, 59, 10, 9, 32, 9, 32,
- 44, 59, 0, 9, 11, 12, 14, 127,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 58, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 58, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 48,
- 57, 46, 48, 57, 48, 57, 93, 48,
- 57, 93, 48, 57, 93, 46, 48, 57,
- 46, 46, 48, 57, 46, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 46,
- 48, 57, 46, 58, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 60, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 60, 10, 9, 32, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 9,
- 32, 9, 13, 32, 60, 0, 9, 11,
- 12, 14, 127, 0
-};
-
-static const char _tsip_machine_parser_header_Record_Route_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 1,
- 2, 2, 2, 2, 2, 3, 9, 1,
- 2, 9, 1, 2, 3, 0, 4, 3,
- 0, 1, 5, 1, 7, 1, 2, 6,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 1, 2, 3, 4, 1, 2, 5,
- 5, 1, 2, 4, 0, 9, 1, 2,
- 2, 2, 2, 1, 3, 0, 1, 0,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 3, 3, 2, 2, 2, 2, 2,
- 0, 3, 3, 3, 0, 1, 1, 1,
- 1, 7, 8, 4, 1, 2, 4, 1,
- 2, 4, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Record_Route_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 4, 0,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 3, 4, 3, 3,
- 3, 3, 0, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 0, 1, 0, 1,
- 0, 3, 3, 3, 3, 3, 3, 0,
- 3, 3, 3, 3, 1, 1, 1, 0,
- 0, 5, 5, 0, 0, 0, 2, 0,
- 0, 0, 3, 0
-};
-
-static const short _tsip_machine_parser_header_Record_Route_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 20, 23, 26, 29, 32, 35, 39, 54,
- 56, 59, 74, 76, 79, 83, 86, 95,
- 99, 100, 102, 108, 110, 123, 125, 128,
- 140, 155, 162, 164, 167, 173, 188, 190,
- 193, 208, 210, 213, 217, 224, 226, 229,
- 235, 241, 243, 246, 251, 255, 269, 274,
- 280, 286, 292, 295, 300, 307, 309, 312,
- 314, 317, 319, 322, 325, 327, 330, 332,
- 335, 337, 344, 351, 357, 363, 369, 375,
- 378, 382, 389, 396, 403, 405, 408, 411,
- 413, 415, 428, 442, 447, 449, 452, 459,
- 461, 464, 469, 473
-};
-
-static const char _tsip_machine_parser_header_Record_Route_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 12, 12, 13, 1, 14,
- 15, 14, 16, 17, 16, 16, 18, 16,
- 16, 16, 16, 16, 16, 1, 19, 1,
- 20, 20, 1, 21, 22, 21, 16, 17,
- 16, 16, 18, 16, 16, 16, 16, 16,
- 16, 1, 23, 1, 24, 24, 1, 24,
- 24, 25, 1, 26, 26, 1, 27, 27,
- 28, 29, 28, 28, 28, 28, 1, 27,
- 27, 29, 1, 30, 31, 30, 32, 33,
- 32, 34, 35, 1, 36, 1, 35, 37,
- 35, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 1, 39, 1, 40, 40, 1,
- 40, 40, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 1, 41, 42, 41, 43,
- 43, 43, 44, 45, 46, 43, 43, 43,
- 43, 43, 1, 47, 48, 47, 13, 35,
- 46, 1, 49, 1, 50, 50, 1, 50,
- 50, 13, 35, 46, 1, 46, 51, 46,
- 52, 53, 52, 52, 54, 52, 52, 52,
- 52, 52, 52, 1, 55, 1, 56, 56,
- 1, 56, 57, 56, 52, 53, 52, 52,
- 54, 52, 52, 52, 52, 52, 52, 1,
- 58, 1, 59, 59, 1, 59, 59, 53,
- 1, 60, 61, 62, 1, 1, 1, 53,
- 63, 1, 53, 53, 1, 64, 42, 64,
- 44, 45, 1, 65, 66, 65, 13, 35,
- 1, 67, 1, 68, 68, 1, 68, 68,
- 13, 35, 1, 53, 53, 53, 1, 64,
- 42, 64, 52, 52, 52, 44, 45, 52,
- 52, 52, 52, 52, 1, 70, 69, 69,
- 69, 1, 72, 61, 71, 71, 71, 1,
- 72, 61, 73, 73, 73, 1, 72, 61,
- 74, 74, 74, 1, 72, 61, 1, 76,
- 75, 69, 69, 1, 77, 72, 61, 78,
- 71, 71, 1, 79, 1, 80, 81, 1,
- 82, 1, 83, 84, 1, 85, 1, 61,
- 86, 1, 61, 87, 1, 61, 1, 83,
- 88, 1, 83, 1, 80, 89, 1, 80,
- 1, 77, 72, 61, 90, 73, 73, 1,
- 77, 72, 61, 74, 74, 74, 1, 92,
- 61, 91, 91, 91, 1, 94, 61, 93,
- 93, 93, 1, 94, 61, 95, 95, 95,
- 1, 94, 61, 96, 96, 96, 1, 94,
- 61, 1, 97, 91, 91, 1, 77, 94,
- 61, 98, 93, 93, 1, 77, 94, 61,
- 99, 95, 95, 1, 77, 94, 61, 96,
- 96, 96, 1, 100, 1, 77, 101, 1,
- 77, 102, 1, 77, 1, 76, 1, 103,
- 104, 103, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 1, 106, 107, 106, 105,
- 105, 105, 108, 105, 105, 105, 105, 105,
- 105, 1, 109, 110, 109, 25, 1, 111,
- 1, 103, 103, 1, 113, 114, 115, 1,
- 1, 1, 112, 116, 1, 112, 112, 1,
- 106, 107, 106, 108, 1, 112, 112, 112,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Record_Route_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 14, 15,
- 89, 94, 21, 16, 17, 17, 18, 19,
- 20, 21, 22, 23, 22, 24, 25, 26,
- 26, 27, 14, 28, 99, 29, 32, 30,
- 31, 33, 27, 32, 14, 28, 37, 33,
- 34, 35, 36, 38, 53, 44, 54, 39,
- 40, 41, 42, 43, 45, 47, 52, 46,
- 48, 48, 49, 50, 51, 55, 88, 56,
- 59, 57, 58, 60, 75, 61, 73, 62,
- 63, 71, 64, 65, 69, 66, 67, 68,
- 70, 72, 74, 76, 84, 77, 80, 78,
- 79, 81, 82, 83, 85, 86, 87, 90,
- 92, 89, 91, 18, 21, 91, 18, 93,
- 94, 95, 97, 98, 96
-};
-
-static const char _tsip_machine_parser_header_Record_Route_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3, 3,
- 15, 15, 3, 0, 0, 3, 3, 0,
- 0, 0, 1, 0, 0, 0, 0, 7,
- 11, 11, 11, 0, 13, 0, 1, 0,
- 0, 18, 18, 0, 18, 9, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 18, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Record_Route_start = 1;
-static const int tsip_machine_parser_header_Record_Route_first_final = 99;
-static const int tsip_machine_parser_header_Record_Route_error = 0;
-
-static const int tsip_machine_parser_header_Record_Route_en_main = 1;
-
-
-/* #line 145 "./ragel/tsip_parser_header_Record_Route.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Record_Route_first_final);
- (void)(tsip_machine_parser_header_Record_Route_error);
- (void)(tsip_machine_parser_header_Record_Route_en_main);
-
-/* #line 339 "./src/headers/tsip_header_Record_Route.c" */
- {
- cs = tsip_machine_parser_header_Record_Route_start;
- }
-
-/* #line 150 "./ragel/tsip_parser_header_Record_Route.rl" */
-
-/* #line 346 "./src/headers/tsip_header_Record_Route.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Record_Routes_L_t *hdr_record_routes = tsk_list_create();
+ tsip_header_Record_Route_t *curr_route = tsk_null;
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 90 "./src/headers/tsip_header_Record_Route.c" */
+ static const char _tsip_machine_parser_header_Record_Route_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 1, 0, 2, 4, 5
+ };
+
+ static const short _tsip_machine_parser_header_Record_Route_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 13, 15, 17, 19, 21, 23, 26, 45,
+ 46, 48, 67, 68, 70, 73, 77, 89,
+ 92, 92, 93, 98, 99, 116, 117, 119,
+ 135, 153, 159, 160, 162, 167, 186, 187,
+ 189, 208, 209, 211, 214, 222, 223, 225,
+ 230, 235, 236, 238, 242, 248, 265, 272,
+ 280, 288, 296, 298, 305, 314, 316, 319,
+ 321, 324, 326, 329, 332, 333, 336, 337,
+ 340, 341, 350, 359, 367, 375, 383, 391,
+ 393, 399, 408, 417, 426, 428, 431, 434,
+ 435, 436, 453, 471, 475, 476, 478, 486,
+ 487, 489, 493, 499
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_trans_keys[] = {
+ 82, 114, 69, 101, 67, 99, 79, 111,
+ 82, 114, 68, 100, 45, 82, 114, 79,
+ 111, 85, 117, 84, 116, 69, 101, 9,
+ 32, 58, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 60,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 60, 65, 90, 97, 122, 9, 32, 43,
+ 58, 45, 46, 48, 57, 65, 90, 97,
+ 122, 9, 32, 58, 62, 9, 13, 32,
+ 44, 59, 10, 9, 13, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 59, 61, 10,
+ 9, 32, 9, 32, 44, 59, 61, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 32, 34, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 9,
+ 32, 9, 13, 32, 44, 59, 9, 13,
+ 32, 44, 59, 10, 9, 32, 9, 32,
+ 44, 59, 0, 9, 11, 12, 14, 127,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 58, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 58, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 48,
+ 57, 46, 48, 57, 48, 57, 93, 48,
+ 57, 93, 48, 57, 93, 46, 48, 57,
+ 46, 46, 48, 57, 46, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 46,
+ 48, 57, 46, 58, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 60, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 60, 10, 9, 32, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 9,
+ 32, 9, 13, 32, 60, 0, 9, 11,
+ 12, 14, 127, 0
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 1,
+ 2, 2, 2, 2, 2, 3, 9, 1,
+ 2, 9, 1, 2, 3, 0, 4, 3,
+ 0, 1, 5, 1, 7, 1, 2, 6,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 1, 2, 3, 4, 1, 2, 5,
+ 5, 1, 2, 4, 0, 9, 1, 2,
+ 2, 2, 2, 1, 3, 0, 1, 0,
+ 1, 0, 1, 1, 1, 1, 1, 1,
+ 1, 3, 3, 2, 2, 2, 2, 2,
+ 0, 3, 3, 3, 0, 1, 1, 1,
+ 1, 7, 8, 4, 1, 2, 4, 1,
+ 2, 4, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 4, 0,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 3, 4, 3, 3,
+ 3, 3, 0, 3, 3, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 0, 1,
+ 0, 3, 3, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 1, 1, 1, 0,
+ 0, 5, 5, 0, 0, 0, 2, 0,
+ 0, 0, 3, 0
+ };
+
+ static const short _tsip_machine_parser_header_Record_Route_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 20, 23, 26, 29, 32, 35, 39, 54,
+ 56, 59, 74, 76, 79, 83, 86, 95,
+ 99, 100, 102, 108, 110, 123, 125, 128,
+ 140, 155, 162, 164, 167, 173, 188, 190,
+ 193, 208, 210, 213, 217, 224, 226, 229,
+ 235, 241, 243, 246, 251, 255, 269, 274,
+ 280, 286, 292, 295, 300, 307, 309, 312,
+ 314, 317, 319, 322, 325, 327, 330, 332,
+ 335, 337, 344, 351, 357, 363, 369, 375,
+ 378, 382, 389, 396, 403, 405, 408, 411,
+ 413, 415, 428, 442, 447, 449, 452, 459,
+ 461, 464, 469, 473
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 12, 12, 13, 1, 14,
+ 15, 14, 16, 17, 16, 16, 18, 16,
+ 16, 16, 16, 16, 16, 1, 19, 1,
+ 20, 20, 1, 21, 22, 21, 16, 17,
+ 16, 16, 18, 16, 16, 16, 16, 16,
+ 16, 1, 23, 1, 24, 24, 1, 24,
+ 24, 25, 1, 26, 26, 1, 27, 27,
+ 28, 29, 28, 28, 28, 28, 1, 27,
+ 27, 29, 1, 30, 31, 30, 32, 33,
+ 32, 34, 35, 1, 36, 1, 35, 37,
+ 35, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 1, 39, 1, 40, 40, 1,
+ 40, 40, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 1, 41, 42, 41, 43,
+ 43, 43, 44, 45, 46, 43, 43, 43,
+ 43, 43, 1, 47, 48, 47, 13, 35,
+ 46, 1, 49, 1, 50, 50, 1, 50,
+ 50, 13, 35, 46, 1, 46, 51, 46,
+ 52, 53, 52, 52, 54, 52, 52, 52,
+ 52, 52, 52, 1, 55, 1, 56, 56,
+ 1, 56, 57, 56, 52, 53, 52, 52,
+ 54, 52, 52, 52, 52, 52, 52, 1,
+ 58, 1, 59, 59, 1, 59, 59, 53,
+ 1, 60, 61, 62, 1, 1, 1, 53,
+ 63, 1, 53, 53, 1, 64, 42, 64,
+ 44, 45, 1, 65, 66, 65, 13, 35,
+ 1, 67, 1, 68, 68, 1, 68, 68,
+ 13, 35, 1, 53, 53, 53, 1, 64,
+ 42, 64, 52, 52, 52, 44, 45, 52,
+ 52, 52, 52, 52, 1, 70, 69, 69,
+ 69, 1, 72, 61, 71, 71, 71, 1,
+ 72, 61, 73, 73, 73, 1, 72, 61,
+ 74, 74, 74, 1, 72, 61, 1, 76,
+ 75, 69, 69, 1, 77, 72, 61, 78,
+ 71, 71, 1, 79, 1, 80, 81, 1,
+ 82, 1, 83, 84, 1, 85, 1, 61,
+ 86, 1, 61, 87, 1, 61, 1, 83,
+ 88, 1, 83, 1, 80, 89, 1, 80,
+ 1, 77, 72, 61, 90, 73, 73, 1,
+ 77, 72, 61, 74, 74, 74, 1, 92,
+ 61, 91, 91, 91, 1, 94, 61, 93,
+ 93, 93, 1, 94, 61, 95, 95, 95,
+ 1, 94, 61, 96, 96, 96, 1, 94,
+ 61, 1, 97, 91, 91, 1, 77, 94,
+ 61, 98, 93, 93, 1, 77, 94, 61,
+ 99, 95, 95, 1, 77, 94, 61, 96,
+ 96, 96, 1, 100, 1, 77, 101, 1,
+ 77, 102, 1, 77, 1, 76, 1, 103,
+ 104, 103, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 1, 106, 107, 106, 105,
+ 105, 105, 108, 105, 105, 105, 105, 105,
+ 105, 1, 109, 110, 109, 25, 1, 111,
+ 1, 103, 103, 1, 113, 114, 115, 1,
+ 1, 1, 112, 116, 1, 112, 112, 1,
+ 106, 107, 106, 108, 1, 112, 112, 112,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 14, 15,
+ 89, 94, 21, 16, 17, 17, 18, 19,
+ 20, 21, 22, 23, 22, 24, 25, 26,
+ 26, 27, 14, 28, 99, 29, 32, 30,
+ 31, 33, 27, 32, 14, 28, 37, 33,
+ 34, 35, 36, 38, 53, 44, 54, 39,
+ 40, 41, 42, 43, 45, 47, 52, 46,
+ 48, 48, 49, 50, 51, 55, 88, 56,
+ 59, 57, 58, 60, 75, 61, 73, 62,
+ 63, 71, 64, 65, 69, 66, 67, 68,
+ 70, 72, 74, 76, 84, 77, 80, 78,
+ 79, 81, 82, 83, 85, 86, 87, 90,
+ 92, 89, 91, 18, 21, 91, 18, 93,
+ 94, 95, 97, 98, 96
+ };
+
+ static const char _tsip_machine_parser_header_Record_Route_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 3,
+ 15, 15, 3, 0, 0, 3, 3, 0,
+ 0, 0, 1, 0, 0, 0, 0, 7,
+ 11, 11, 11, 0, 13, 0, 1, 0,
+ 0, 18, 18, 0, 18, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 18, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Record_Route_start = 1;
+ static const int tsip_machine_parser_header_Record_Route_first_final = 99;
+ static const int tsip_machine_parser_header_Record_Route_error = 0;
+
+ static const int tsip_machine_parser_header_Record_Route_en_main = 1;
+
+
+ /* #line 145 "./ragel/tsip_parser_header_Record_Route.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Record_Route_first_final);
+ (void)(tsip_machine_parser_header_Record_Route_error);
+ (void)(tsip_machine_parser_header_Record_Route_en_main);
+
+ /* #line 339 "./src/headers/tsip_header_Record_Route.c" */
+ {
+ cs = tsip_machine_parser_header_Record_Route_start;
+ }
+
+ /* #line 150 "./ragel/tsip_parser_header_Record_Route.rl" */
+
+ /* #line 346 "./src/headers/tsip_header_Record_Route.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Record_Route_trans_keys + _tsip_machine_parser_header_Record_Route_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Record_Route_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Record_Route_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Record_Route_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Record_Route_trans_keys + _tsip_machine_parser_header_Record_Route_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Record_Route_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Record_Route_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Record_Route_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Record_Route_indicies[_trans];
- cs = _tsip_machine_parser_header_Record_Route_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Record_Route_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Record_Route_actions + _tsip_machine_parser_header_Record_Route_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- if(!curr_route){
- curr_route = tsip_header_Record_Route_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- if(curr_route){
- TSK_PARSER_SET_STRING(curr_route->display_name);
- tsk_strunquote(&curr_route->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- if(curr_route && !curr_route->uri){
- int len = (int)(p - tag_start);
- if(curr_route && !curr_route->uri){
- if((curr_route->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_route->display_name){
- curr_route->uri->display_name = tsk_strdup(curr_route->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- if(curr_route){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- if(curr_route){
- tsk_list_push_back_data(hdr_record_routes, ((void**) &curr_route));
- }
- }
- break;
- case 6:
-/* #line 91 "./ragel/tsip_parser_header_Record_Route.rl" */
- {
- }
- break;
-/* #line 477 "./src/headers/tsip_header_Record_Route.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Record_Route_indicies[_trans];
+ cs = _tsip_machine_parser_header_Record_Route_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Record_Route_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Record_Route_actions + _tsip_machine_parser_header_Record_Route_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ if(!curr_route) {
+ curr_route = tsip_header_Record_Route_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ if(curr_route) {
+ TSK_PARSER_SET_STRING(curr_route->display_name);
+ tsk_strunquote(&curr_route->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ if(curr_route && !curr_route->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_route && !curr_route->uri) {
+ if((curr_route->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_route->display_name) {
+ curr_route->uri->display_name = tsk_strdup(curr_route->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ if(curr_route) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ if(curr_route) {
+ tsk_list_push_back_data(hdr_record_routes, ((void**) &curr_route));
+ }
+ }
+ break;
+ case 6:
+ /* #line 91 "./ragel/tsip_parser_header_Record_Route.rl" */
+ {
+ }
+ break;
+ /* #line 477 "./src/headers/tsip_header_Record_Route.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 151 "./ragel/tsip_parser_header_Record_Route.rl" */
-
- if( cs <
-/* #line 493 "./src/headers/tsip_header_Record_Route.c" */
-99
-/* #line 152 "./ragel/tsip_parser_header_Record_Route.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Record-Route' header.");
- TSK_OBJECT_SAFE_FREE(curr_route);
- TSK_OBJECT_SAFE_FREE(hdr_record_routes);
- }
-
- return hdr_record_routes;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 151 "./ragel/tsip_parser_header_Record_Route.rl" */
+
+ if( cs <
+ /* #line 493 "./src/headers/tsip_header_Record_Route.c" */
+ 99
+ /* #line 152 "./ragel/tsip_parser_header_Record_Route.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Record-Route' header.");
+ TSK_OBJECT_SAFE_FREE(curr_route);
+ TSK_OBJECT_SAFE_FREE(hdr_record_routes);
+ }
+
+ return hdr_record_routes;
}
@@ -513,42 +524,41 @@ _again:
static tsk_object_t* tsip_header_Record_Route_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Record_Route_t *Record_Route = self;
- if(Record_Route){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
-
- if(uri){
- Record_Route->uri = tsk_object_ref((void*)uri);
- }
- TSIP_HEADER(Record_Route)->type = tsip_htype_Record_Route;
- TSIP_HEADER(Record_Route)->serialize = tsip_header_Record_Route_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Record_Route header.");
- }
- return self;
+ tsip_header_Record_Route_t *Record_Route = self;
+ if(Record_Route) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
+
+ if(uri) {
+ Record_Route->uri = tsk_object_ref((void*)uri);
+ }
+ TSIP_HEADER(Record_Route)->type = tsip_htype_Record_Route;
+ TSIP_HEADER(Record_Route)->serialize = tsip_header_Record_Route_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Record_Route header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Record_Route_dtor(tsk_object_t *self)
{
- tsip_header_Record_Route_t *Record_Route = self;
- if(Record_Route){
- TSK_FREE(Record_Route->display_name);
- TSK_OBJECT_SAFE_FREE(Record_Route->uri);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Record_Route));
- }
- else{
- TSK_DEBUG_ERROR("Null Record_Route header.");
- }
-
- return self;
+ tsip_header_Record_Route_t *Record_Route = self;
+ if(Record_Route) {
+ TSK_FREE(Record_Route->display_name);
+ TSK_OBJECT_SAFE_FREE(Record_Route->uri);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Record_Route));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Record_Route header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Record_Route_def_s =
-{
- sizeof(tsip_header_Record_Route_t),
- tsip_header_Record_Route_ctor,
- tsip_header_Record_Route_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Record_Route_def_s = {
+ sizeof(tsip_header_Record_Route_t),
+ tsip_header_Record_Route_ctor,
+ tsip_header_Record_Route_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Record_Route_def_t = &tsip_header_Record_Route_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Refer_Sub.c b/tinySIP/src/headers/tsip_header_Refer_Sub.c
index 10628c3..aa59ff6 100755
--- a/tinySIP/src/headers/tsip_header_Refer_Sub.c
+++ b/tinySIP/src/headers/tsip_header_Refer_Sub.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,380 +48,391 @@
tsip_header_Refer_Sub_t* tsip_header_Refer_Sub_create(tsk_bool_t sub)
{
- return tsk_object_new(TSIP_HEADER_REFER_SUB_VA_ARGS(sub));
+ return tsk_object_new(TSIP_HEADER_REFER_SUB_VA_ARGS(sub));
}
tsip_header_Refer_Sub_t* tsip_header_Refer_Sub_create_null()
{
- return tsip_header_Refer_Sub_create(tsk_true);
+ return tsip_header_Refer_Sub_create(tsk_true);
}
int tsip_header_Refer_Sub_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Refer_Sub_t *Refer_Sub = (const tsip_header_Refer_Sub_t *)header;
- return tsk_buffer_append(output, Refer_Sub->sub ? "true" : "false", Refer_Sub->sub ? 4 : 5);
- }
+ if(header) {
+ const tsip_header_Refer_Sub_t *Refer_Sub = (const tsip_header_Refer_Sub_t *)header;
+ return tsk_buffer_append(output, Refer_Sub->sub ? "true" : "false", Refer_Sub->sub ? 4 : 5);
+ }
- return -1;
+ return -1;
}
tsip_header_Refer_Sub_t *tsip_header_Refer_Sub_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Refer_Sub_t *hdr_rsub = tsip_header_Refer_Sub_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 81 "./src/headers/tsip_header_Refer_Sub.c" */
-static const char _tsip_machine_parser_header_Refer_Sub_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4
-};
-
-static const short _tsip_machine_parser_header_Refer_Sub_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 11,
- 13, 15, 17, 20, 27, 28, 30, 36,
- 38, 40, 42, 44, 48, 52, 53, 55,
- 58, 75, 76, 78, 94, 113, 118, 119,
- 121, 125, 144, 145, 147, 166, 167, 169,
- 172, 180, 181, 183, 187, 188, 194, 212,
- 219, 227, 235, 243, 245, 252, 261, 263,
- 266, 268, 271, 273, 276, 279, 280, 283,
- 284, 287, 288, 297, 306, 314, 322, 330,
- 338, 340, 346, 355, 364, 373, 375, 378,
- 381, 382, 383, 385, 387, 389, 393
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_trans_keys[] = {
- 82, 114, 69, 101, 70, 102, 69, 101,
- 82, 114, 45, 83, 115, 85, 117, 66,
- 98, 9, 32, 58, 9, 13, 32, 70,
- 84, 102, 116, 10, 9, 32, 9, 32,
- 70, 84, 102, 116, 65, 97, 76, 108,
- 83, 115, 69, 101, 9, 13, 32, 59,
- 9, 13, 32, 59, 10, 9, 32, 9,
- 32, 59, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 61, 10, 9,
- 32, 9, 32, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 59, 10, 0, 9, 11, 12,
- 14, 127, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 58, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 58, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 46, 48, 57, 46, 46, 48, 57, 46,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 46, 48, 57, 46, 58, 82,
- 114, 85, 117, 69, 101, 9, 13, 32,
- 59, 0
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 1, 2,
- 2, 2, 3, 7, 1, 2, 6, 2,
- 2, 2, 2, 4, 4, 1, 2, 3,
- 7, 1, 2, 6, 9, 5, 1, 2,
- 4, 9, 1, 2, 9, 1, 2, 3,
- 4, 1, 2, 4, 1, 0, 8, 1,
- 2, 2, 2, 2, 1, 3, 0, 1,
- 0, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 2, 2, 2, 2,
- 2, 0, 3, 3, 3, 0, 1, 1,
- 1, 1, 2, 2, 2, 4, 0
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 0, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 5, 0, 0, 0,
- 2, 0, 0, 0, 0, 3, 5, 3,
- 3, 3, 3, 0, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 1, 0, 3, 3, 3, 3, 3, 3,
- 0, 3, 3, 3, 3, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Refer_Sub_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 17,
- 20, 23, 26, 30, 38, 40, 43, 50,
- 53, 56, 59, 62, 67, 72, 74, 77,
- 81, 94, 96, 99, 111, 126, 132, 134,
- 137, 142, 157, 159, 162, 177, 179, 182,
- 186, 193, 195, 198, 203, 205, 209, 223,
- 228, 234, 240, 246, 249, 254, 261, 263,
- 266, 268, 271, 273, 276, 279, 281, 284,
- 286, 289, 291, 298, 305, 311, 317, 323,
- 329, 332, 336, 343, 350, 357, 359, 362,
- 365, 367, 369, 372, 375, 378, 383
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 9, 9, 10, 1, 10, 11,
- 10, 12, 13, 12, 13, 1, 14, 1,
- 15, 15, 1, 15, 15, 12, 13, 12,
- 13, 1, 16, 16, 1, 17, 17, 1,
- 18, 18, 1, 19, 19, 1, 20, 21,
- 20, 22, 1, 23, 24, 23, 25, 1,
- 26, 1, 27, 27, 1, 27, 27, 25,
- 1, 25, 28, 25, 29, 29, 29, 29,
- 29, 29, 29, 29, 29, 1, 30, 1,
- 31, 31, 1, 31, 31, 29, 29, 29,
- 29, 29, 29, 29, 29, 29, 1, 32,
- 33, 32, 34, 34, 34, 35, 36, 34,
- 34, 34, 34, 34, 34, 1, 37, 38,
- 37, 25, 36, 1, 39, 1, 40, 40,
- 1, 40, 40, 25, 36, 1, 36, 41,
- 36, 42, 43, 42, 42, 44, 42, 42,
- 42, 42, 42, 42, 1, 45, 1, 46,
- 46, 1, 46, 47, 46, 42, 43, 42,
- 42, 44, 42, 42, 42, 42, 42, 42,
- 1, 48, 1, 49, 49, 1, 49, 49,
- 43, 1, 50, 51, 52, 1, 1, 1,
- 43, 53, 1, 43, 43, 1, 54, 33,
- 54, 35, 1, 55, 1, 43, 43, 43,
- 1, 54, 33, 54, 42, 42, 42, 35,
- 42, 42, 42, 42, 42, 42, 1, 57,
- 56, 56, 56, 1, 59, 51, 58, 58,
- 58, 1, 59, 51, 60, 60, 60, 1,
- 59, 51, 61, 61, 61, 1, 59, 51,
- 1, 63, 62, 56, 56, 1, 64, 59,
- 51, 65, 58, 58, 1, 66, 1, 67,
- 68, 1, 69, 1, 70, 71, 1, 72,
- 1, 51, 73, 1, 51, 74, 1, 51,
- 1, 70, 75, 1, 70, 1, 67, 76,
- 1, 67, 1, 64, 59, 51, 77, 60,
- 60, 1, 64, 59, 51, 61, 61, 61,
- 1, 79, 51, 78, 78, 78, 1, 81,
- 51, 80, 80, 80, 1, 81, 51, 82,
- 82, 82, 1, 81, 51, 83, 83, 83,
- 1, 81, 51, 1, 84, 78, 78, 1,
- 64, 81, 51, 85, 80, 80, 1, 64,
- 81, 51, 86, 82, 82, 1, 64, 81,
- 51, 83, 83, 83, 1, 87, 1, 64,
- 88, 1, 64, 89, 1, 64, 1, 63,
- 1, 90, 90, 1, 91, 91, 1, 92,
- 92, 1, 93, 94, 93, 95, 1, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 15, 82, 13, 14,
- 16, 17, 18, 19, 20, 44, 24, 20,
- 21, 24, 22, 23, 25, 28, 26, 27,
- 29, 44, 28, 24, 33, 29, 30, 31,
- 32, 34, 46, 40, 47, 35, 36, 37,
- 38, 39, 41, 43, 45, 42, 20, 86,
- 48, 81, 49, 52, 50, 51, 53, 68,
- 54, 66, 55, 56, 64, 57, 58, 62,
- 59, 60, 61, 63, 65, 67, 69, 77,
- 70, 73, 71, 72, 74, 75, 76, 78,
- 79, 80, 83, 84, 85, 20, 44, 24
-};
-
-static const char _tsip_machine_parser_header_Refer_Sub_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 7, 7, 0, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 9,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3, 3, 3
-};
-
-static const int tsip_machine_parser_header_Refer_Sub_start = 1;
-static const int tsip_machine_parser_header_Refer_Sub_first_final = 86;
-static const int tsip_machine_parser_header_Refer_Sub_error = 0;
-
-static const int tsip_machine_parser_header_Refer_Sub_en_main = 1;
-
-
-/* #line 106 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Refer_Sub_first_final);
- (void)(tsip_machine_parser_header_Refer_Sub_error);
- (void)(tsip_machine_parser_header_Refer_Sub_en_main);
-
-/* #line 291 "./src/headers/tsip_header_Refer_Sub.c" */
- {
- cs = tsip_machine_parser_header_Refer_Sub_start;
- }
-
-/* #line 111 "./ragel/tsip_parser_header_Refer_Sub.rl" */
-
-/* #line 298 "./src/headers/tsip_header_Refer_Sub.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Refer_Sub_t *hdr_rsub = tsip_header_Refer_Sub_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 81 "./src/headers/tsip_header_Refer_Sub.c" */
+ static const char _tsip_machine_parser_header_Refer_Sub_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4
+ };
+
+ static const short _tsip_machine_parser_header_Refer_Sub_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 11,
+ 13, 15, 17, 20, 27, 28, 30, 36,
+ 38, 40, 42, 44, 48, 52, 53, 55,
+ 58, 75, 76, 78, 94, 113, 118, 119,
+ 121, 125, 144, 145, 147, 166, 167, 169,
+ 172, 180, 181, 183, 187, 188, 194, 212,
+ 219, 227, 235, 243, 245, 252, 261, 263,
+ 266, 268, 271, 273, 276, 279, 280, 283,
+ 284, 287, 288, 297, 306, 314, 322, 330,
+ 338, 340, 346, 355, 364, 373, 375, 378,
+ 381, 382, 383, 385, 387, 389, 393
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_trans_keys[] = {
+ 82, 114, 69, 101, 70, 102, 69, 101,
+ 82, 114, 45, 83, 115, 85, 117, 66,
+ 98, 9, 32, 58, 9, 13, 32, 70,
+ 84, 102, 116, 10, 9, 32, 9, 32,
+ 70, 84, 102, 116, 65, 97, 76, 108,
+ 83, 115, 69, 101, 9, 13, 32, 59,
+ 9, 13, 32, 59, 10, 9, 32, 9,
+ 32, 59, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 61, 10, 9,
+ 32, 9, 32, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 59, 10, 0, 9, 11, 12,
+ 14, 127, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 58, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 58, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 46, 48, 57, 46, 46, 48, 57, 46,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 46, 48, 57, 46, 58, 82,
+ 114, 85, 117, 69, 101, 9, 13, 32,
+ 59, 0
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 1, 2,
+ 2, 2, 3, 7, 1, 2, 6, 2,
+ 2, 2, 2, 4, 4, 1, 2, 3,
+ 7, 1, 2, 6, 9, 5, 1, 2,
+ 4, 9, 1, 2, 9, 1, 2, 3,
+ 4, 1, 2, 4, 1, 0, 8, 1,
+ 2, 2, 2, 2, 1, 3, 0, 1,
+ 0, 1, 0, 1, 1, 1, 1, 1,
+ 1, 1, 3, 3, 2, 2, 2, 2,
+ 2, 0, 3, 3, 3, 0, 1, 1,
+ 1, 1, 2, 2, 2, 4, 0
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 0, 0, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 5, 0, 0, 0,
+ 2, 0, 0, 0, 0, 3, 5, 3,
+ 3, 3, 3, 0, 3, 3, 1, 1,
+ 1, 1, 1, 1, 1, 0, 1, 0,
+ 1, 0, 3, 3, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Refer_Sub_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 17,
+ 20, 23, 26, 30, 38, 40, 43, 50,
+ 53, 56, 59, 62, 67, 72, 74, 77,
+ 81, 94, 96, 99, 111, 126, 132, 134,
+ 137, 142, 157, 159, 162, 177, 179, 182,
+ 186, 193, 195, 198, 203, 205, 209, 223,
+ 228, 234, 240, 246, 249, 254, 261, 263,
+ 266, 268, 271, 273, 276, 279, 281, 284,
+ 286, 289, 291, 298, 305, 311, 317, 323,
+ 329, 332, 336, 343, 350, 357, 359, 362,
+ 365, 367, 369, 372, 375, 378, 383
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 9, 9, 10, 1, 10, 11,
+ 10, 12, 13, 12, 13, 1, 14, 1,
+ 15, 15, 1, 15, 15, 12, 13, 12,
+ 13, 1, 16, 16, 1, 17, 17, 1,
+ 18, 18, 1, 19, 19, 1, 20, 21,
+ 20, 22, 1, 23, 24, 23, 25, 1,
+ 26, 1, 27, 27, 1, 27, 27, 25,
+ 1, 25, 28, 25, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 1, 30, 1,
+ 31, 31, 1, 31, 31, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 1, 32,
+ 33, 32, 34, 34, 34, 35, 36, 34,
+ 34, 34, 34, 34, 34, 1, 37, 38,
+ 37, 25, 36, 1, 39, 1, 40, 40,
+ 1, 40, 40, 25, 36, 1, 36, 41,
+ 36, 42, 43, 42, 42, 44, 42, 42,
+ 42, 42, 42, 42, 1, 45, 1, 46,
+ 46, 1, 46, 47, 46, 42, 43, 42,
+ 42, 44, 42, 42, 42, 42, 42, 42,
+ 1, 48, 1, 49, 49, 1, 49, 49,
+ 43, 1, 50, 51, 52, 1, 1, 1,
+ 43, 53, 1, 43, 43, 1, 54, 33,
+ 54, 35, 1, 55, 1, 43, 43, 43,
+ 1, 54, 33, 54, 42, 42, 42, 35,
+ 42, 42, 42, 42, 42, 42, 1, 57,
+ 56, 56, 56, 1, 59, 51, 58, 58,
+ 58, 1, 59, 51, 60, 60, 60, 1,
+ 59, 51, 61, 61, 61, 1, 59, 51,
+ 1, 63, 62, 56, 56, 1, 64, 59,
+ 51, 65, 58, 58, 1, 66, 1, 67,
+ 68, 1, 69, 1, 70, 71, 1, 72,
+ 1, 51, 73, 1, 51, 74, 1, 51,
+ 1, 70, 75, 1, 70, 1, 67, 76,
+ 1, 67, 1, 64, 59, 51, 77, 60,
+ 60, 1, 64, 59, 51, 61, 61, 61,
+ 1, 79, 51, 78, 78, 78, 1, 81,
+ 51, 80, 80, 80, 1, 81, 51, 82,
+ 82, 82, 1, 81, 51, 83, 83, 83,
+ 1, 81, 51, 1, 84, 78, 78, 1,
+ 64, 81, 51, 85, 80, 80, 1, 64,
+ 81, 51, 86, 82, 82, 1, 64, 81,
+ 51, 83, 83, 83, 1, 87, 1, 64,
+ 88, 1, 64, 89, 1, 64, 1, 63,
+ 1, 90, 90, 1, 91, 91, 1, 92,
+ 92, 1, 93, 94, 93, 95, 1, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 15, 82, 13, 14,
+ 16, 17, 18, 19, 20, 44, 24, 20,
+ 21, 24, 22, 23, 25, 28, 26, 27,
+ 29, 44, 28, 24, 33, 29, 30, 31,
+ 32, 34, 46, 40, 47, 35, 36, 37,
+ 38, 39, 41, 43, 45, 42, 20, 86,
+ 48, 81, 49, 52, 50, 51, 53, 68,
+ 54, 66, 55, 56, 64, 57, 58, 62,
+ 59, 60, 61, 63, 65, 67, 69, 77,
+ 70, 73, 71, 72, 74, 75, 76, 78,
+ 79, 80, 83, 84, 85, 20, 44, 24
+ };
+
+ static const char _tsip_machine_parser_header_Refer_Sub_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 7, 7, 0, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 3, 3
+ };
+
+ static const int tsip_machine_parser_header_Refer_Sub_start = 1;
+ static const int tsip_machine_parser_header_Refer_Sub_first_final = 86;
+ static const int tsip_machine_parser_header_Refer_Sub_error = 0;
+
+ static const int tsip_machine_parser_header_Refer_Sub_en_main = 1;
+
+
+ /* #line 106 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Refer_Sub_first_final);
+ (void)(tsip_machine_parser_header_Refer_Sub_error);
+ (void)(tsip_machine_parser_header_Refer_Sub_en_main);
+
+ /* #line 291 "./src/headers/tsip_header_Refer_Sub.c" */
+ {
+ cs = tsip_machine_parser_header_Refer_Sub_start;
+ }
+
+ /* #line 111 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+
+ /* #line 298 "./src/headers/tsip_header_Refer_Sub.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Refer_Sub_trans_keys + _tsip_machine_parser_header_Refer_Sub_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Refer_Sub_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Refer_Sub_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Refer_Sub_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Refer_Sub_trans_keys + _tsip_machine_parser_header_Refer_Sub_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Refer_Sub_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Refer_Sub_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Refer_Sub_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Refer_Sub_indicies[_trans];
- cs = _tsip_machine_parser_header_Refer_Sub_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Refer_Sub_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Refer_Sub_actions + _tsip_machine_parser_header_Refer_Sub_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- {
- hdr_rsub->sub = tsk_true;
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- {
- hdr_rsub->sub = tsk_false;
- }
- break;
- case 3:
-/* #line 59 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_rsub));
- }
- break;
- case 4:
-/* #line 63 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- {
- }
- break;
-/* #line 401 "./src/headers/tsip_header_Refer_Sub.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Refer_Sub_indicies[_trans];
+ cs = _tsip_machine_parser_header_Refer_Sub_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Refer_Sub_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Refer_Sub_actions + _tsip_machine_parser_header_Refer_Sub_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ {
+ hdr_rsub->sub = tsk_true;
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ {
+ hdr_rsub->sub = tsk_false;
+ }
+ break;
+ case 3:
+ /* #line 59 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_rsub));
+ }
+ break;
+ case 4:
+ /* #line 63 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ {
+ }
+ break;
+ /* #line 401 "./src/headers/tsip_header_Refer_Sub.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 112 "./ragel/tsip_parser_header_Refer_Sub.rl" */
-
- if( cs <
-/* #line 417 "./src/headers/tsip_header_Refer_Sub.c" */
-86
-/* #line 113 "./ragel/tsip_parser_header_Refer_Sub.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Refer-Sub' header.");
- TSK_OBJECT_SAFE_FREE(hdr_rsub);
- }
-
- return hdr_rsub;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 112 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+
+ if( cs <
+ /* #line 417 "./src/headers/tsip_header_Refer_Sub.c" */
+ 86
+ /* #line 113 "./ragel/tsip_parser_header_Refer_Sub.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Refer-Sub' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_rsub);
+ }
+
+ return hdr_rsub;
}
@@ -436,36 +447,35 @@ _again:
static tsk_object_t* tsip_header_Refer_Sub_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Refer_Sub_t *Refer_Sub = self;
- if(Refer_Sub){
- TSIP_HEADER(Refer_Sub)->type = tsip_htype_Refer_Sub;
- TSIP_HEADER(Refer_Sub)->serialize = tsip_header_Refer_Sub_serialize;
- Refer_Sub->sub = va_arg(*app, tsk_bool_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Refer_Sub header.");
- }
- return self;
+ tsip_header_Refer_Sub_t *Refer_Sub = self;
+ if(Refer_Sub) {
+ TSIP_HEADER(Refer_Sub)->type = tsip_htype_Refer_Sub;
+ TSIP_HEADER(Refer_Sub)->serialize = tsip_header_Refer_Sub_serialize;
+ Refer_Sub->sub = va_arg(*app, tsk_bool_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Refer_Sub header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Refer_Sub_dtor(tsk_object_t *self)
{
- tsip_header_Refer_Sub_t *Refer_Sub = self;
- if(Refer_Sub){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Refer_Sub));
- }
- else{
- TSK_DEBUG_ERROR("Null Refer_Sub header.");
- }
-
- return self;
+ tsip_header_Refer_Sub_t *Refer_Sub = self;
+ if(Refer_Sub) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Refer_Sub));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Refer_Sub header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Refer_Sub_def_s =
-{
- sizeof(tsip_header_Refer_Sub_t),
- tsip_header_Refer_Sub_ctor,
- tsip_header_Refer_Sub_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Refer_Sub_def_s = {
+ sizeof(tsip_header_Refer_Sub_t),
+ tsip_header_Refer_Sub_ctor,
+ tsip_header_Refer_Sub_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Refer_Sub_def_t = &tsip_header_Refer_Sub_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Refer_To.c b/tinySIP/src/headers/tsip_header_Refer_To.c
index 1e3d259..58ffe9c 100755
--- a/tinySIP/src/headers/tsip_header_Refer_To.c
+++ b/tinySIP/src/headers/tsip_header_Refer_To.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,737 +49,748 @@
tsip_header_Refer_To_t* tsip_header_Refer_To_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_REFER_TO_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_REFER_TO_VA_ARGS(uri));
}
tsip_header_Refer_To_t* tsip_header_Refer_To_create_null()
{
- return tsip_header_Refer_To_create(tsk_null);
+ return tsip_header_Refer_To_create(tsk_null);
}
int tsip_header_Refer_To_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- int ret;
- const tsip_header_Refer_To_t *Refer_To = (const tsip_header_Refer_To_t *)header;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Refer_To->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- return ret;
- }
- return -1;
+ if(header) {
+ int ret;
+ const tsip_header_Refer_To_t *Refer_To = (const tsip_header_Refer_To_t *)header;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Refer_To->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ return ret;
+ }
+ return -1;
}
tsip_header_Refer_To_t *tsip_header_Refer_To_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Refer_To_t *r_to = tsip_header_Refer_To_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 87 "./src/headers/tsip_header_Refer_To.c" */
-static const char _tsip_machine_parser_header_Refer_To_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 2, 1, 3
-};
-
-static const short _tsip_machine_parser_header_Refer_To_key_offsets[] = {
- 0, 0, 2, 7, 10, 31, 32, 34,
- 55, 56, 58, 61, 65, 77, 80, 80,
- 81, 85, 86, 103, 104, 106, 122, 141,
- 146, 147, 149, 153, 172, 173, 175, 194,
- 195, 197, 200, 208, 209, 211, 215, 219,
- 220, 222, 225, 231, 249, 256, 264, 272,
- 280, 282, 289, 298, 300, 303, 305, 308,
- 310, 313, 316, 317, 320, 321, 324, 325,
- 334, 343, 351, 359, 367, 375, 377, 383,
- 392, 401, 410, 412, 415, 418, 419, 420,
- 437, 455, 459, 460, 462, 470, 471, 473,
- 477, 483, 495, 498, 498, 502, 520, 539,
- 544, 564, 582, 591, 595, 618, 642, 652,
- 676, 699, 707, 716, 732, 749, 766, 783,
- 794, 810, 828, 839, 851, 862, 874, 885,
- 897, 909, 919, 931, 941, 953, 963, 981,
- 999, 1016, 1033, 1050, 1067, 1078, 1093, 1111,
- 1129, 1147, 1158, 1170, 1182, 1192, 1202, 1213,
- 1225, 1237, 1249, 1255, 1266, 1279, 1285, 1292,
- 1298, 1305, 1311, 1318, 1325, 1330, 1337, 1342,
- 1349, 1354, 1367, 1380, 1392, 1404, 1416, 1428,
- 1434, 1444, 1457, 1470, 1483, 1489, 1496, 1503,
- 1508, 1513, 1515, 1517, 1519, 1520, 1522, 1524
-};
-
-static const char _tsip_machine_parser_header_Refer_To_trans_keys[] = {
- 82, 114, 9, 32, 58, 69, 101, 9,
- 32, 58, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 32, 60, 65, 90, 97,
- 122, 9, 32, 43, 58, 45, 46, 48,
- 57, 65, 90, 97, 122, 9, 32, 58,
- 62, 9, 13, 32, 59, 10, 9, 13,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 59, 9,
- 13, 32, 59, 10, 9, 32, 9, 32,
- 59, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 59, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 58, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 58, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 48,
- 57, 46, 48, 57, 48, 57, 93, 48,
- 57, 93, 48, 57, 93, 46, 48, 57,
- 46, 46, 48, 57, 46, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 46,
- 48, 57, 46, 58, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 60, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 60, 10, 9, 32, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 9,
- 32, 9, 13, 32, 60, 0, 9, 11,
- 12, 14, 127, 9, 32, 43, 58, 45,
- 46, 48, 57, 65, 90, 97, 122, 9,
- 32, 58, 9, 13, 32, 59, 9, 13,
- 32, 33, 37, 39, 59, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 59, 61,
- 9, 13, 32, 33, 34, 37, 39, 59,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 34, 59, 92, 127, 0, 31, 9,
- 13, 32, 59, 9, 13, 32, 33, 34,
- 37, 39, 59, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 34, 37,
- 39, 59, 61, 92, 126, 127, 0, 31,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 59, 61,
- 92, 127, 0, 31, 9, 13, 32, 33,
- 34, 37, 39, 59, 91, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 34, 37, 39, 59, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 59, 0,
- 8, 11, 127, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 58, 59, 92, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 58, 59, 92, 93, 127,
- 0, 31, 9, 13, 32, 34, 58, 59,
- 92, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 46, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 59, 92,
- 127, 0, 31, 48, 57, 9, 13, 32,
- 34, 59, 92, 93, 127, 0, 31, 48,
- 57, 9, 13, 32, 34, 59, 92, 93,
- 127, 0, 31, 48, 57, 9, 13, 32,
- 34, 59, 92, 93, 127, 0, 31, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 9, 13, 32,
- 34, 46, 59, 92, 127, 0, 31, 48,
- 57, 9, 13, 32, 34, 46, 59, 92,
- 127, 0, 31, 9, 13, 32, 34, 46,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 46, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 58,
- 59, 92, 93, 127, 0, 31, 9, 13,
- 32, 34, 59, 92, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 46, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 46, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 46, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 46, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 9, 13, 32, 34, 58, 59, 92, 127,
- 0, 31, 9, 13, 32, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 58, 59, 93, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 58, 59, 93, 9,
- 13, 32, 58, 59, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 46, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 59, 48, 57, 9, 13, 32,
- 46, 59, 48, 57, 9, 13, 32, 59,
- 48, 57, 9, 13, 32, 46, 59, 48,
- 57, 9, 13, 32, 59, 48, 57, 9,
- 13, 32, 59, 93, 48, 57, 9, 13,
- 32, 59, 93, 48, 57, 9, 13, 32,
- 59, 93, 9, 13, 32, 46, 59, 48,
- 57, 9, 13, 32, 46, 59, 9, 13,
- 32, 46, 59, 48, 57, 9, 13, 32,
- 46, 59, 9, 13, 32, 46, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 46, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 9, 13, 32, 59, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 46,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 46, 58, 59, 93,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 46, 58, 59, 93, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 59, 48,
- 57, 9, 13, 32, 46, 59, 48, 57,
- 9, 13, 32, 46, 59, 48, 57, 9,
- 13, 32, 46, 59, 9, 13, 32, 58,
- 59, 70, 102, 69, 101, 82, 114, 45,
- 84, 116, 79, 111, 0
-};
-
-static const char _tsip_machine_parser_header_Refer_To_single_lengths[] = {
- 0, 2, 5, 3, 9, 1, 2, 9,
- 1, 2, 3, 0, 4, 3, 0, 1,
- 4, 1, 7, 1, 2, 6, 9, 5,
- 1, 2, 4, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 4, 4, 1,
- 2, 3, 0, 8, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 3,
- 3, 2, 2, 2, 2, 2, 0, 3,
- 3, 3, 0, 1, 1, 1, 1, 7,
- 8, 4, 1, 2, 4, 1, 2, 4,
- 0, 4, 3, 0, 4, 8, 9, 5,
- 10, 8, 7, 4, 11, 12, 8, 12,
- 11, 4, 7, 8, 9, 9, 9, 9,
- 8, 10, 7, 8, 7, 8, 7, 8,
- 8, 8, 8, 8, 8, 8, 10, 10,
- 9, 9, 9, 9, 9, 7, 10, 10,
- 10, 7, 8, 8, 8, 8, 5, 6,
- 6, 6, 6, 5, 7, 4, 5, 4,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 7, 7, 6, 6, 6, 6, 6,
- 4, 7, 7, 7, 4, 5, 5, 5,
- 5, 2, 2, 2, 1, 2, 2, 0
-};
-
-static const char _tsip_machine_parser_header_Refer_To_range_lengths[] = {
- 0, 0, 0, 0, 6, 0, 0, 6,
- 0, 0, 0, 2, 4, 0, 0, 0,
- 0, 0, 5, 0, 0, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 3, 5, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 5,
- 5, 0, 0, 0, 2, 0, 0, 0,
- 3, 4, 0, 0, 0, 5, 5, 0,
- 5, 5, 1, 0, 6, 6, 1, 6,
- 6, 2, 1, 4, 4, 4, 4, 1,
- 4, 4, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 1, 2, 1, 4, 4,
- 4, 4, 4, 4, 1, 4, 4, 4,
- 4, 2, 2, 2, 1, 1, 3, 3,
- 3, 3, 0, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 0, 1, 0, 1,
- 0, 3, 3, 3, 3, 3, 3, 0,
- 3, 3, 3, 3, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Refer_To_index_offsets[] = {
- 0, 0, 3, 9, 13, 29, 31, 34,
- 50, 52, 55, 59, 62, 71, 75, 76,
- 78, 83, 85, 98, 100, 103, 115, 130,
- 136, 138, 141, 146, 161, 163, 166, 181,
- 183, 186, 190, 197, 199, 202, 207, 212,
- 214, 217, 221, 225, 239, 244, 250, 256,
- 262, 265, 270, 277, 279, 282, 284, 287,
- 289, 292, 295, 297, 300, 302, 305, 307,
- 314, 321, 327, 333, 339, 345, 348, 352,
- 359, 366, 373, 375, 378, 381, 383, 385,
- 398, 412, 417, 419, 422, 429, 431, 434,
- 439, 443, 452, 456, 457, 462, 476, 491,
- 497, 513, 527, 536, 541, 559, 578, 588,
- 607, 625, 632, 641, 654, 668, 682, 696,
- 707, 720, 735, 745, 756, 766, 777, 787,
- 798, 809, 819, 830, 840, 851, 861, 876,
- 891, 905, 919, 933, 947, 958, 970, 985,
- 1000, 1015, 1025, 1036, 1047, 1057, 1067, 1076,
- 1086, 1096, 1106, 1113, 1122, 1133, 1139, 1146,
- 1152, 1159, 1165, 1172, 1179, 1185, 1192, 1198,
- 1205, 1211, 1222, 1233, 1243, 1253, 1263, 1273,
- 1280, 1288, 1299, 1310, 1321, 1327, 1334, 1341,
- 1347, 1353, 1356, 1359, 1362, 1364, 1367, 1370
-};
-
-static const unsigned char _tsip_machine_parser_header_Refer_To_indicies[] = {
- 0, 0, 1, 2, 2, 3, 4, 4,
- 1, 2, 2, 3, 1, 3, 5, 3,
- 6, 7, 6, 6, 8, 6, 6, 6,
- 6, 9, 6, 9, 1, 10, 1, 11,
- 11, 1, 11, 12, 11, 6, 7, 6,
- 6, 8, 6, 6, 6, 6, 9, 6,
- 9, 1, 13, 1, 14, 14, 1, 14,
- 14, 8, 1, 15, 15, 1, 16, 16,
- 17, 18, 17, 17, 17, 17, 1, 16,
- 16, 18, 1, 19, 20, 19, 21, 22,
- 21, 23, 1, 24, 1, 23, 25, 23,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 1, 27, 1, 28, 28, 1, 28,
- 28, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 1, 29, 30, 29, 31, 31,
- 31, 32, 33, 31, 31, 31, 31, 31,
- 31, 1, 34, 35, 34, 23, 33, 1,
- 36, 1, 37, 37, 1, 37, 37, 23,
- 33, 1, 33, 38, 33, 39, 40, 39,
- 39, 41, 39, 39, 39, 39, 39, 39,
- 1, 42, 1, 43, 43, 1, 43, 44,
- 43, 39, 40, 39, 39, 41, 39, 39,
- 39, 39, 39, 39, 1, 45, 1, 46,
- 46, 1, 46, 46, 40, 1, 47, 48,
- 49, 1, 1, 1, 40, 50, 1, 40,
- 40, 1, 51, 30, 51, 32, 1, 52,
- 53, 52, 23, 1, 54, 1, 55, 55,
- 1, 55, 55, 23, 1, 40, 40, 40,
- 1, 51, 30, 51, 39, 39, 39, 32,
- 39, 39, 39, 39, 39, 39, 1, 57,
- 56, 56, 56, 1, 59, 48, 58, 58,
- 58, 1, 59, 48, 60, 60, 60, 1,
- 59, 48, 61, 61, 61, 1, 59, 48,
- 1, 63, 62, 56, 56, 1, 64, 59,
- 48, 65, 58, 58, 1, 66, 1, 67,
- 68, 1, 69, 1, 70, 71, 1, 72,
- 1, 48, 73, 1, 48, 74, 1, 48,
- 1, 70, 75, 1, 70, 1, 67, 76,
- 1, 67, 1, 64, 59, 48, 77, 60,
- 60, 1, 64, 59, 48, 61, 61, 61,
- 1, 79, 48, 78, 78, 78, 1, 81,
- 48, 80, 80, 80, 1, 81, 48, 82,
- 82, 82, 1, 81, 48, 83, 83, 83,
- 1, 81, 48, 1, 84, 78, 78, 1,
- 64, 81, 48, 85, 80, 80, 1, 64,
- 81, 48, 86, 82, 82, 1, 64, 81,
- 48, 83, 83, 83, 1, 87, 1, 64,
- 88, 1, 64, 89, 1, 64, 1, 63,
- 1, 90, 91, 90, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 1, 93, 94,
- 93, 92, 92, 92, 95, 92, 92, 92,
- 92, 92, 92, 1, 96, 12, 96, 8,
- 1, 97, 1, 90, 90, 1, 99, 100,
- 101, 1, 1, 1, 98, 102, 1, 98,
- 98, 1, 93, 94, 93, 95, 1, 98,
- 98, 98, 1, 103, 103, 104, 105, 104,
- 104, 104, 104, 1, 103, 103, 105, 1,
- 106, 107, 108, 107, 109, 106, 109, 108,
- 109, 110, 110, 110, 109, 110, 110, 110,
- 110, 110, 110, 106, 111, 112, 111, 113,
- 113, 113, 114, 115, 113, 113, 113, 113,
- 113, 113, 106, 116, 108, 116, 109, 115,
- 106, 117, 108, 117, 118, 119, 118, 118,
- 109, 120, 118, 118, 118, 118, 118, 118,
- 106, 121, 112, 121, 118, 118, 118, 114,
- 118, 118, 118, 118, 118, 118, 106, 122,
- 108, 122, 123, 124, 125, 106, 106, 119,
- 121, 112, 121, 114, 106, 124, 108, 124,
- 126, 123, 126, 126, 124, 125, 126, 106,
- 106, 126, 126, 126, 126, 126, 119, 127,
- 112, 127, 128, 123, 128, 128, 129, 130,
- 125, 128, 106, 106, 128, 128, 128, 128,
- 128, 119, 131, 108, 131, 123, 124, 130,
- 125, 106, 106, 119, 132, 108, 132, 133,
- 134, 133, 133, 124, 135, 125, 133, 106,
- 106, 133, 133, 133, 133, 133, 119, 136,
- 112, 136, 133, 123, 133, 133, 129, 125,
- 133, 106, 106, 133, 133, 133, 133, 133,
- 119, 122, 108, 122, 124, 119, 119, 106,
- 136, 112, 136, 123, 129, 125, 106, 106,
- 119, 122, 108, 122, 123, 138, 124, 125,
- 106, 106, 137, 137, 137, 119, 122, 108,
- 122, 123, 140, 124, 125, 134, 106, 106,
- 139, 139, 139, 119, 122, 108, 122, 123,
- 140, 124, 125, 134, 106, 106, 141, 141,
- 141, 119, 122, 108, 122, 123, 140, 124,
- 125, 134, 106, 106, 142, 142, 142, 119,
- 122, 108, 122, 123, 140, 124, 125, 134,
- 106, 106, 119, 122, 108, 122, 123, 144,
- 124, 125, 106, 106, 143, 137, 137, 119,
- 122, 108, 122, 123, 145, 140, 124, 125,
- 134, 106, 106, 146, 139, 139, 119, 122,
- 108, 122, 123, 124, 125, 106, 106, 147,
- 119, 122, 108, 122, 123, 148, 124, 125,
- 106, 106, 149, 119, 122, 108, 122, 123,
- 124, 125, 106, 106, 150, 119, 122, 108,
- 122, 123, 151, 124, 125, 106, 106, 152,
- 119, 122, 108, 122, 123, 124, 125, 106,
- 106, 153, 119, 122, 108, 122, 123, 124,
- 125, 134, 106, 106, 154, 119, 122, 108,
- 122, 123, 124, 125, 134, 106, 106, 155,
- 119, 122, 108, 122, 123, 124, 125, 134,
- 106, 106, 119, 122, 108, 122, 123, 151,
- 124, 125, 106, 106, 156, 119, 122, 108,
- 122, 123, 151, 124, 125, 106, 106, 119,
- 122, 108, 122, 123, 148, 124, 125, 106,
- 106, 157, 119, 122, 108, 122, 123, 148,
- 124, 125, 106, 106, 119, 122, 108, 122,
- 123, 145, 140, 124, 125, 134, 106, 106,
- 158, 141, 141, 119, 122, 108, 122, 123,
- 145, 140, 124, 125, 134, 106, 106, 142,
- 142, 142, 119, 122, 108, 122, 123, 160,
- 124, 125, 134, 106, 106, 159, 159, 159,
- 119, 122, 108, 122, 123, 162, 124, 125,
- 134, 106, 106, 161, 161, 161, 119, 122,
- 108, 122, 123, 162, 124, 125, 134, 106,
- 106, 163, 163, 163, 119, 122, 108, 122,
- 123, 162, 124, 125, 134, 106, 106, 164,
- 164, 164, 119, 122, 108, 122, 123, 162,
- 124, 125, 134, 106, 106, 119, 122, 108,
- 122, 123, 124, 125, 106, 106, 165, 159,
- 159, 119, 122, 108, 122, 123, 145, 162,
- 124, 125, 134, 106, 106, 166, 161, 161,
- 119, 122, 108, 122, 123, 145, 162, 124,
- 125, 134, 106, 106, 167, 163, 163, 119,
- 122, 108, 122, 123, 145, 162, 124, 125,
- 134, 106, 106, 164, 164, 164, 119, 122,
- 108, 122, 123, 124, 125, 106, 106, 168,
- 119, 122, 108, 122, 123, 145, 124, 125,
- 106, 106, 169, 119, 122, 108, 122, 123,
- 145, 124, 125, 106, 106, 170, 119, 122,
- 108, 122, 123, 145, 124, 125, 106, 106,
- 119, 122, 108, 122, 123, 144, 124, 125,
- 106, 106, 119, 107, 108, 107, 172, 109,
- 171, 171, 171, 106, 107, 108, 107, 174,
- 109, 123, 173, 173, 173, 106, 107, 108,
- 107, 174, 109, 123, 175, 175, 175, 106,
- 107, 108, 107, 174, 109, 123, 176, 176,
- 176, 106, 107, 108, 107, 174, 109, 123,
- 106, 107, 108, 107, 178, 109, 177, 171,
- 171, 106, 107, 108, 107, 179, 174, 109,
- 123, 180, 173, 173, 106, 107, 108, 107,
- 109, 181, 106, 107, 108, 107, 182, 109,
- 183, 106, 107, 108, 107, 109, 184, 106,
- 107, 108, 107, 185, 109, 186, 106, 107,
- 108, 107, 109, 187, 106, 107, 108, 107,
- 109, 123, 188, 106, 107, 108, 107, 109,
- 123, 189, 106, 107, 108, 107, 109, 123,
- 106, 107, 108, 107, 185, 109, 190, 106,
- 107, 108, 107, 185, 109, 106, 107, 108,
- 107, 182, 109, 191, 106, 107, 108, 107,
- 182, 109, 106, 107, 108, 107, 179, 174,
- 109, 123, 192, 175, 175, 106, 107, 108,
- 107, 179, 174, 109, 123, 176, 176, 176,
- 106, 107, 108, 107, 194, 109, 123, 193,
- 193, 193, 106, 107, 108, 107, 196, 109,
- 123, 195, 195, 195, 106, 107, 108, 107,
- 196, 109, 123, 197, 197, 197, 106, 107,
- 108, 107, 196, 109, 123, 198, 198, 198,
- 106, 107, 108, 107, 196, 109, 123, 106,
- 107, 108, 107, 109, 199, 193, 193, 106,
- 107, 108, 107, 179, 196, 109, 123, 200,
- 195, 195, 106, 107, 108, 107, 179, 196,
- 109, 123, 201, 197, 197, 106, 107, 108,
- 107, 179, 196, 109, 123, 198, 198, 198,
- 106, 107, 108, 107, 109, 202, 106, 107,
- 108, 107, 179, 109, 203, 106, 107, 108,
- 107, 179, 109, 204, 106, 107, 108, 107,
- 179, 109, 106, 107, 108, 107, 178, 109,
- 106, 205, 205, 1, 206, 206, 1, 207,
- 207, 1, 208, 1, 209, 209, 1, 2,
- 2, 1, 1, 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Refer_To_trans_targs[] = {
- 2, 0, 3, 4, 177, 5, 79, 84,
- 11, 89, 6, 7, 8, 9, 10, 12,
- 13, 12, 14, 15, 16, 16, 17, 18,
- 183, 19, 22, 20, 21, 23, 17, 22,
- 18, 27, 23, 24, 25, 26, 28, 43,
- 34, 44, 29, 30, 31, 32, 33, 35,
- 37, 42, 36, 38, 38, 39, 40, 41,
- 45, 78, 46, 49, 47, 48, 50, 65,
- 51, 63, 52, 53, 61, 54, 55, 59,
- 56, 57, 58, 60, 62, 64, 66, 74,
- 67, 70, 68, 69, 71, 72, 73, 75,
- 76, 77, 80, 82, 79, 81, 8, 11,
- 81, 83, 84, 85, 87, 88, 86, 90,
- 89, 91, 92, 92, 17, 93, 94, 95,
- 17, 94, 93, 96, 95, 96, 97, 98,
- 142, 92, 98, 99, 100, 105, 101, 102,
- 101, 100, 103, 102, 103, 104, 106, 107,
- 98, 108, 141, 109, 112, 110, 111, 113,
- 128, 114, 126, 115, 116, 124, 117, 118,
- 122, 119, 120, 121, 123, 125, 127, 129,
- 137, 130, 133, 131, 132, 134, 135, 136,
- 138, 139, 140, 143, 176, 144, 147, 145,
- 146, 148, 163, 149, 161, 150, 151, 159,
- 152, 153, 157, 154, 155, 156, 158, 160,
- 162, 164, 172, 165, 168, 166, 167, 169,
- 170, 171, 173, 174, 175, 178, 179, 180,
- 181, 182
-};
-
-static const char _tsip_machine_parser_header_Refer_To_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 1, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 3, 0, 0, 0,
- 9, 0, 1, 0, 0, 7, 7, 0,
- 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 3, 3, 1, 11,
- 11, 0, 11, 0, 3, 3, 0, 0,
- 0, 11, 3, 0, 3, 0, 1, 11,
- 0, 11, 0, 3, 3, 0, 0, 0,
- 11, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
-};
-
-static const int tsip_machine_parser_header_Refer_To_start = 1;
-static const int tsip_machine_parser_header_Refer_To_first_final = 183;
-static const int tsip_machine_parser_header_Refer_To_error = 0;
-
-static const int tsip_machine_parser_header_Refer_To_en_main = 1;
-
-
-/* #line 128 "./ragel/tsip_parser_header_Refer_To.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Refer_To_first_final);
- (void)(tsip_machine_parser_header_Refer_To_error);
- (void)(tsip_machine_parser_header_Refer_To_en_main);
-
-/* #line 639 "./src/headers/tsip_header_Refer_To.c" */
- {
- cs = tsip_machine_parser_header_Refer_To_start;
- }
-
-/* #line 133 "./ragel/tsip_parser_header_Refer_To.rl" */
-
-/* #line 646 "./src/headers/tsip_header_Refer_To.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Refer_To_t *r_to = tsip_header_Refer_To_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 87 "./src/headers/tsip_header_Refer_To.c" */
+ static const char _tsip_machine_parser_header_Refer_To_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 2, 1, 3
+ };
+
+ static const short _tsip_machine_parser_header_Refer_To_key_offsets[] = {
+ 0, 0, 2, 7, 10, 31, 32, 34,
+ 55, 56, 58, 61, 65, 77, 80, 80,
+ 81, 85, 86, 103, 104, 106, 122, 141,
+ 146, 147, 149, 153, 172, 173, 175, 194,
+ 195, 197, 200, 208, 209, 211, 215, 219,
+ 220, 222, 225, 231, 249, 256, 264, 272,
+ 280, 282, 289, 298, 300, 303, 305, 308,
+ 310, 313, 316, 317, 320, 321, 324, 325,
+ 334, 343, 351, 359, 367, 375, 377, 383,
+ 392, 401, 410, 412, 415, 418, 419, 420,
+ 437, 455, 459, 460, 462, 470, 471, 473,
+ 477, 483, 495, 498, 498, 502, 520, 539,
+ 544, 564, 582, 591, 595, 618, 642, 652,
+ 676, 699, 707, 716, 732, 749, 766, 783,
+ 794, 810, 828, 839, 851, 862, 874, 885,
+ 897, 909, 919, 931, 941, 953, 963, 981,
+ 999, 1016, 1033, 1050, 1067, 1078, 1093, 1111,
+ 1129, 1147, 1158, 1170, 1182, 1192, 1202, 1213,
+ 1225, 1237, 1249, 1255, 1266, 1279, 1285, 1292,
+ 1298, 1305, 1311, 1318, 1325, 1330, 1337, 1342,
+ 1349, 1354, 1367, 1380, 1392, 1404, 1416, 1428,
+ 1434, 1444, 1457, 1470, 1483, 1489, 1496, 1503,
+ 1508, 1513, 1515, 1517, 1519, 1520, 1522, 1524
+ };
+
+ static const char _tsip_machine_parser_header_Refer_To_trans_keys[] = {
+ 82, 114, 9, 32, 58, 69, 101, 9,
+ 32, 58, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 32, 60, 65, 90, 97,
+ 122, 9, 32, 43, 58, 45, 46, 48,
+ 57, 65, 90, 97, 122, 9, 32, 58,
+ 62, 9, 13, 32, 59, 10, 9, 13,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 59, 9,
+ 13, 32, 59, 10, 9, 32, 9, 32,
+ 59, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 59, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 58, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 58, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 48,
+ 57, 46, 48, 57, 48, 57, 93, 48,
+ 57, 93, 48, 57, 93, 46, 48, 57,
+ 46, 46, 48, 57, 46, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 46,
+ 48, 57, 46, 58, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 60, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 60, 10, 9, 32, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 9,
+ 32, 9, 13, 32, 60, 0, 9, 11,
+ 12, 14, 127, 9, 32, 43, 58, 45,
+ 46, 48, 57, 65, 90, 97, 122, 9,
+ 32, 58, 9, 13, 32, 59, 9, 13,
+ 32, 33, 37, 39, 59, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 59, 61,
+ 9, 13, 32, 33, 34, 37, 39, 59,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 34, 59, 92, 127, 0, 31, 9,
+ 13, 32, 59, 9, 13, 32, 33, 34,
+ 37, 39, 59, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 34, 37,
+ 39, 59, 61, 92, 126, 127, 0, 31,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 59, 61,
+ 92, 127, 0, 31, 9, 13, 32, 33,
+ 34, 37, 39, 59, 91, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 34, 37, 39, 59, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 59, 0,
+ 8, 11, 127, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 58, 59, 92, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 58, 59, 92, 93, 127,
+ 0, 31, 9, 13, 32, 34, 58, 59,
+ 92, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 46, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 59, 92,
+ 127, 0, 31, 48, 57, 9, 13, 32,
+ 34, 59, 92, 93, 127, 0, 31, 48,
+ 57, 9, 13, 32, 34, 59, 92, 93,
+ 127, 0, 31, 48, 57, 9, 13, 32,
+ 34, 59, 92, 93, 127, 0, 31, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 9, 13, 32,
+ 34, 46, 59, 92, 127, 0, 31, 48,
+ 57, 9, 13, 32, 34, 46, 59, 92,
+ 127, 0, 31, 9, 13, 32, 34, 46,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 46, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 58,
+ 59, 92, 93, 127, 0, 31, 9, 13,
+ 32, 34, 59, 92, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 46, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 46, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 46, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 46, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 9, 13, 32, 34, 58, 59, 92, 127,
+ 0, 31, 9, 13, 32, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 58, 59, 93, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 58, 59, 93, 9,
+ 13, 32, 58, 59, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 46, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 59, 48, 57, 9, 13, 32,
+ 46, 59, 48, 57, 9, 13, 32, 59,
+ 48, 57, 9, 13, 32, 46, 59, 48,
+ 57, 9, 13, 32, 59, 48, 57, 9,
+ 13, 32, 59, 93, 48, 57, 9, 13,
+ 32, 59, 93, 48, 57, 9, 13, 32,
+ 59, 93, 9, 13, 32, 46, 59, 48,
+ 57, 9, 13, 32, 46, 59, 9, 13,
+ 32, 46, 59, 48, 57, 9, 13, 32,
+ 46, 59, 9, 13, 32, 46, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 46, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 9, 13, 32, 59, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 46,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 46, 58, 59, 93,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 46, 58, 59, 93, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 59, 48,
+ 57, 9, 13, 32, 46, 59, 48, 57,
+ 9, 13, 32, 46, 59, 48, 57, 9,
+ 13, 32, 46, 59, 9, 13, 32, 58,
+ 59, 70, 102, 69, 101, 82, 114, 45,
+ 84, 116, 79, 111, 0
+ };
+
+ static const char _tsip_machine_parser_header_Refer_To_single_lengths[] = {
+ 0, 2, 5, 3, 9, 1, 2, 9,
+ 1, 2, 3, 0, 4, 3, 0, 1,
+ 4, 1, 7, 1, 2, 6, 9, 5,
+ 1, 2, 4, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 4, 4, 1,
+ 2, 3, 0, 8, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 3,
+ 3, 2, 2, 2, 2, 2, 0, 3,
+ 3, 3, 0, 1, 1, 1, 1, 7,
+ 8, 4, 1, 2, 4, 1, 2, 4,
+ 0, 4, 3, 0, 4, 8, 9, 5,
+ 10, 8, 7, 4, 11, 12, 8, 12,
+ 11, 4, 7, 8, 9, 9, 9, 9,
+ 8, 10, 7, 8, 7, 8, 7, 8,
+ 8, 8, 8, 8, 8, 8, 10, 10,
+ 9, 9, 9, 9, 9, 7, 10, 10,
+ 10, 7, 8, 8, 8, 8, 5, 6,
+ 6, 6, 6, 5, 7, 4, 5, 4,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 7, 7, 6, 6, 6, 6, 6,
+ 4, 7, 7, 7, 4, 5, 5, 5,
+ 5, 2, 2, 2, 1, 2, 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_Refer_To_range_lengths[] = {
+ 0, 0, 0, 0, 6, 0, 0, 6,
+ 0, 0, 0, 2, 4, 0, 0, 0,
+ 0, 0, 5, 0, 0, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 3, 5, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 5,
+ 5, 0, 0, 0, 2, 0, 0, 0,
+ 3, 4, 0, 0, 0, 5, 5, 0,
+ 5, 5, 1, 0, 6, 6, 1, 6,
+ 6, 2, 1, 4, 4, 4, 4, 1,
+ 4, 4, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 1, 2, 1, 4, 4,
+ 4, 4, 4, 4, 1, 4, 4, 4,
+ 4, 2, 2, 2, 1, 1, 3, 3,
+ 3, 3, 0, 3, 3, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 0, 1,
+ 0, 3, 3, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 1, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Refer_To_index_offsets[] = {
+ 0, 0, 3, 9, 13, 29, 31, 34,
+ 50, 52, 55, 59, 62, 71, 75, 76,
+ 78, 83, 85, 98, 100, 103, 115, 130,
+ 136, 138, 141, 146, 161, 163, 166, 181,
+ 183, 186, 190, 197, 199, 202, 207, 212,
+ 214, 217, 221, 225, 239, 244, 250, 256,
+ 262, 265, 270, 277, 279, 282, 284, 287,
+ 289, 292, 295, 297, 300, 302, 305, 307,
+ 314, 321, 327, 333, 339, 345, 348, 352,
+ 359, 366, 373, 375, 378, 381, 383, 385,
+ 398, 412, 417, 419, 422, 429, 431, 434,
+ 439, 443, 452, 456, 457, 462, 476, 491,
+ 497, 513, 527, 536, 541, 559, 578, 588,
+ 607, 625, 632, 641, 654, 668, 682, 696,
+ 707, 720, 735, 745, 756, 766, 777, 787,
+ 798, 809, 819, 830, 840, 851, 861, 876,
+ 891, 905, 919, 933, 947, 958, 970, 985,
+ 1000, 1015, 1025, 1036, 1047, 1057, 1067, 1076,
+ 1086, 1096, 1106, 1113, 1122, 1133, 1139, 1146,
+ 1152, 1159, 1165, 1172, 1179, 1185, 1192, 1198,
+ 1205, 1211, 1222, 1233, 1243, 1253, 1263, 1273,
+ 1280, 1288, 1299, 1310, 1321, 1327, 1334, 1341,
+ 1347, 1353, 1356, 1359, 1362, 1364, 1367, 1370
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Refer_To_indicies[] = {
+ 0, 0, 1, 2, 2, 3, 4, 4,
+ 1, 2, 2, 3, 1, 3, 5, 3,
+ 6, 7, 6, 6, 8, 6, 6, 6,
+ 6, 9, 6, 9, 1, 10, 1, 11,
+ 11, 1, 11, 12, 11, 6, 7, 6,
+ 6, 8, 6, 6, 6, 6, 9, 6,
+ 9, 1, 13, 1, 14, 14, 1, 14,
+ 14, 8, 1, 15, 15, 1, 16, 16,
+ 17, 18, 17, 17, 17, 17, 1, 16,
+ 16, 18, 1, 19, 20, 19, 21, 22,
+ 21, 23, 1, 24, 1, 23, 25, 23,
+ 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 1, 27, 1, 28, 28, 1, 28,
+ 28, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 1, 29, 30, 29, 31, 31,
+ 31, 32, 33, 31, 31, 31, 31, 31,
+ 31, 1, 34, 35, 34, 23, 33, 1,
+ 36, 1, 37, 37, 1, 37, 37, 23,
+ 33, 1, 33, 38, 33, 39, 40, 39,
+ 39, 41, 39, 39, 39, 39, 39, 39,
+ 1, 42, 1, 43, 43, 1, 43, 44,
+ 43, 39, 40, 39, 39, 41, 39, 39,
+ 39, 39, 39, 39, 1, 45, 1, 46,
+ 46, 1, 46, 46, 40, 1, 47, 48,
+ 49, 1, 1, 1, 40, 50, 1, 40,
+ 40, 1, 51, 30, 51, 32, 1, 52,
+ 53, 52, 23, 1, 54, 1, 55, 55,
+ 1, 55, 55, 23, 1, 40, 40, 40,
+ 1, 51, 30, 51, 39, 39, 39, 32,
+ 39, 39, 39, 39, 39, 39, 1, 57,
+ 56, 56, 56, 1, 59, 48, 58, 58,
+ 58, 1, 59, 48, 60, 60, 60, 1,
+ 59, 48, 61, 61, 61, 1, 59, 48,
+ 1, 63, 62, 56, 56, 1, 64, 59,
+ 48, 65, 58, 58, 1, 66, 1, 67,
+ 68, 1, 69, 1, 70, 71, 1, 72,
+ 1, 48, 73, 1, 48, 74, 1, 48,
+ 1, 70, 75, 1, 70, 1, 67, 76,
+ 1, 67, 1, 64, 59, 48, 77, 60,
+ 60, 1, 64, 59, 48, 61, 61, 61,
+ 1, 79, 48, 78, 78, 78, 1, 81,
+ 48, 80, 80, 80, 1, 81, 48, 82,
+ 82, 82, 1, 81, 48, 83, 83, 83,
+ 1, 81, 48, 1, 84, 78, 78, 1,
+ 64, 81, 48, 85, 80, 80, 1, 64,
+ 81, 48, 86, 82, 82, 1, 64, 81,
+ 48, 83, 83, 83, 1, 87, 1, 64,
+ 88, 1, 64, 89, 1, 64, 1, 63,
+ 1, 90, 91, 90, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 1, 93, 94,
+ 93, 92, 92, 92, 95, 92, 92, 92,
+ 92, 92, 92, 1, 96, 12, 96, 8,
+ 1, 97, 1, 90, 90, 1, 99, 100,
+ 101, 1, 1, 1, 98, 102, 1, 98,
+ 98, 1, 93, 94, 93, 95, 1, 98,
+ 98, 98, 1, 103, 103, 104, 105, 104,
+ 104, 104, 104, 1, 103, 103, 105, 1,
+ 106, 107, 108, 107, 109, 106, 109, 108,
+ 109, 110, 110, 110, 109, 110, 110, 110,
+ 110, 110, 110, 106, 111, 112, 111, 113,
+ 113, 113, 114, 115, 113, 113, 113, 113,
+ 113, 113, 106, 116, 108, 116, 109, 115,
+ 106, 117, 108, 117, 118, 119, 118, 118,
+ 109, 120, 118, 118, 118, 118, 118, 118,
+ 106, 121, 112, 121, 118, 118, 118, 114,
+ 118, 118, 118, 118, 118, 118, 106, 122,
+ 108, 122, 123, 124, 125, 106, 106, 119,
+ 121, 112, 121, 114, 106, 124, 108, 124,
+ 126, 123, 126, 126, 124, 125, 126, 106,
+ 106, 126, 126, 126, 126, 126, 119, 127,
+ 112, 127, 128, 123, 128, 128, 129, 130,
+ 125, 128, 106, 106, 128, 128, 128, 128,
+ 128, 119, 131, 108, 131, 123, 124, 130,
+ 125, 106, 106, 119, 132, 108, 132, 133,
+ 134, 133, 133, 124, 135, 125, 133, 106,
+ 106, 133, 133, 133, 133, 133, 119, 136,
+ 112, 136, 133, 123, 133, 133, 129, 125,
+ 133, 106, 106, 133, 133, 133, 133, 133,
+ 119, 122, 108, 122, 124, 119, 119, 106,
+ 136, 112, 136, 123, 129, 125, 106, 106,
+ 119, 122, 108, 122, 123, 138, 124, 125,
+ 106, 106, 137, 137, 137, 119, 122, 108,
+ 122, 123, 140, 124, 125, 134, 106, 106,
+ 139, 139, 139, 119, 122, 108, 122, 123,
+ 140, 124, 125, 134, 106, 106, 141, 141,
+ 141, 119, 122, 108, 122, 123, 140, 124,
+ 125, 134, 106, 106, 142, 142, 142, 119,
+ 122, 108, 122, 123, 140, 124, 125, 134,
+ 106, 106, 119, 122, 108, 122, 123, 144,
+ 124, 125, 106, 106, 143, 137, 137, 119,
+ 122, 108, 122, 123, 145, 140, 124, 125,
+ 134, 106, 106, 146, 139, 139, 119, 122,
+ 108, 122, 123, 124, 125, 106, 106, 147,
+ 119, 122, 108, 122, 123, 148, 124, 125,
+ 106, 106, 149, 119, 122, 108, 122, 123,
+ 124, 125, 106, 106, 150, 119, 122, 108,
+ 122, 123, 151, 124, 125, 106, 106, 152,
+ 119, 122, 108, 122, 123, 124, 125, 106,
+ 106, 153, 119, 122, 108, 122, 123, 124,
+ 125, 134, 106, 106, 154, 119, 122, 108,
+ 122, 123, 124, 125, 134, 106, 106, 155,
+ 119, 122, 108, 122, 123, 124, 125, 134,
+ 106, 106, 119, 122, 108, 122, 123, 151,
+ 124, 125, 106, 106, 156, 119, 122, 108,
+ 122, 123, 151, 124, 125, 106, 106, 119,
+ 122, 108, 122, 123, 148, 124, 125, 106,
+ 106, 157, 119, 122, 108, 122, 123, 148,
+ 124, 125, 106, 106, 119, 122, 108, 122,
+ 123, 145, 140, 124, 125, 134, 106, 106,
+ 158, 141, 141, 119, 122, 108, 122, 123,
+ 145, 140, 124, 125, 134, 106, 106, 142,
+ 142, 142, 119, 122, 108, 122, 123, 160,
+ 124, 125, 134, 106, 106, 159, 159, 159,
+ 119, 122, 108, 122, 123, 162, 124, 125,
+ 134, 106, 106, 161, 161, 161, 119, 122,
+ 108, 122, 123, 162, 124, 125, 134, 106,
+ 106, 163, 163, 163, 119, 122, 108, 122,
+ 123, 162, 124, 125, 134, 106, 106, 164,
+ 164, 164, 119, 122, 108, 122, 123, 162,
+ 124, 125, 134, 106, 106, 119, 122, 108,
+ 122, 123, 124, 125, 106, 106, 165, 159,
+ 159, 119, 122, 108, 122, 123, 145, 162,
+ 124, 125, 134, 106, 106, 166, 161, 161,
+ 119, 122, 108, 122, 123, 145, 162, 124,
+ 125, 134, 106, 106, 167, 163, 163, 119,
+ 122, 108, 122, 123, 145, 162, 124, 125,
+ 134, 106, 106, 164, 164, 164, 119, 122,
+ 108, 122, 123, 124, 125, 106, 106, 168,
+ 119, 122, 108, 122, 123, 145, 124, 125,
+ 106, 106, 169, 119, 122, 108, 122, 123,
+ 145, 124, 125, 106, 106, 170, 119, 122,
+ 108, 122, 123, 145, 124, 125, 106, 106,
+ 119, 122, 108, 122, 123, 144, 124, 125,
+ 106, 106, 119, 107, 108, 107, 172, 109,
+ 171, 171, 171, 106, 107, 108, 107, 174,
+ 109, 123, 173, 173, 173, 106, 107, 108,
+ 107, 174, 109, 123, 175, 175, 175, 106,
+ 107, 108, 107, 174, 109, 123, 176, 176,
+ 176, 106, 107, 108, 107, 174, 109, 123,
+ 106, 107, 108, 107, 178, 109, 177, 171,
+ 171, 106, 107, 108, 107, 179, 174, 109,
+ 123, 180, 173, 173, 106, 107, 108, 107,
+ 109, 181, 106, 107, 108, 107, 182, 109,
+ 183, 106, 107, 108, 107, 109, 184, 106,
+ 107, 108, 107, 185, 109, 186, 106, 107,
+ 108, 107, 109, 187, 106, 107, 108, 107,
+ 109, 123, 188, 106, 107, 108, 107, 109,
+ 123, 189, 106, 107, 108, 107, 109, 123,
+ 106, 107, 108, 107, 185, 109, 190, 106,
+ 107, 108, 107, 185, 109, 106, 107, 108,
+ 107, 182, 109, 191, 106, 107, 108, 107,
+ 182, 109, 106, 107, 108, 107, 179, 174,
+ 109, 123, 192, 175, 175, 106, 107, 108,
+ 107, 179, 174, 109, 123, 176, 176, 176,
+ 106, 107, 108, 107, 194, 109, 123, 193,
+ 193, 193, 106, 107, 108, 107, 196, 109,
+ 123, 195, 195, 195, 106, 107, 108, 107,
+ 196, 109, 123, 197, 197, 197, 106, 107,
+ 108, 107, 196, 109, 123, 198, 198, 198,
+ 106, 107, 108, 107, 196, 109, 123, 106,
+ 107, 108, 107, 109, 199, 193, 193, 106,
+ 107, 108, 107, 179, 196, 109, 123, 200,
+ 195, 195, 106, 107, 108, 107, 179, 196,
+ 109, 123, 201, 197, 197, 106, 107, 108,
+ 107, 179, 196, 109, 123, 198, 198, 198,
+ 106, 107, 108, 107, 109, 202, 106, 107,
+ 108, 107, 179, 109, 203, 106, 107, 108,
+ 107, 179, 109, 204, 106, 107, 108, 107,
+ 179, 109, 106, 107, 108, 107, 178, 109,
+ 106, 205, 205, 1, 206, 206, 1, 207,
+ 207, 1, 208, 1, 209, 209, 1, 2,
+ 2, 1, 1, 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Refer_To_trans_targs[] = {
+ 2, 0, 3, 4, 177, 5, 79, 84,
+ 11, 89, 6, 7, 8, 9, 10, 12,
+ 13, 12, 14, 15, 16, 16, 17, 18,
+ 183, 19, 22, 20, 21, 23, 17, 22,
+ 18, 27, 23, 24, 25, 26, 28, 43,
+ 34, 44, 29, 30, 31, 32, 33, 35,
+ 37, 42, 36, 38, 38, 39, 40, 41,
+ 45, 78, 46, 49, 47, 48, 50, 65,
+ 51, 63, 52, 53, 61, 54, 55, 59,
+ 56, 57, 58, 60, 62, 64, 66, 74,
+ 67, 70, 68, 69, 71, 72, 73, 75,
+ 76, 77, 80, 82, 79, 81, 8, 11,
+ 81, 83, 84, 85, 87, 88, 86, 90,
+ 89, 91, 92, 92, 17, 93, 94, 95,
+ 17, 94, 93, 96, 95, 96, 97, 98,
+ 142, 92, 98, 99, 100, 105, 101, 102,
+ 101, 100, 103, 102, 103, 104, 106, 107,
+ 98, 108, 141, 109, 112, 110, 111, 113,
+ 128, 114, 126, 115, 116, 124, 117, 118,
+ 122, 119, 120, 121, 123, 125, 127, 129,
+ 137, 130, 133, 131, 132, 134, 135, 136,
+ 138, 139, 140, 143, 176, 144, 147, 145,
+ 146, 148, 163, 149, 161, 150, 151, 159,
+ 152, 153, 157, 154, 155, 156, 158, 160,
+ 162, 164, 172, 165, 168, 166, 167, 169,
+ 170, 171, 173, 174, 175, 178, 179, 180,
+ 181, 182
+ };
+
+ static const char _tsip_machine_parser_header_Refer_To_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 0, 1, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 3, 0, 0, 0,
+ 9, 0, 1, 0, 0, 7, 7, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3, 3, 3, 1, 11,
+ 11, 0, 11, 0, 3, 3, 0, 0,
+ 0, 11, 3, 0, 3, 0, 1, 11,
+ 0, 11, 0, 3, 3, 0, 0, 0,
+ 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Refer_To_start = 1;
+ static const int tsip_machine_parser_header_Refer_To_first_final = 183;
+ static const int tsip_machine_parser_header_Refer_To_error = 0;
+
+ static const int tsip_machine_parser_header_Refer_To_en_main = 1;
+
+
+ /* #line 128 "./ragel/tsip_parser_header_Refer_To.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Refer_To_first_final);
+ (void)(tsip_machine_parser_header_Refer_To_error);
+ (void)(tsip_machine_parser_header_Refer_To_en_main);
+
+ /* #line 639 "./src/headers/tsip_header_Refer_To.c" */
+ {
+ cs = tsip_machine_parser_header_Refer_To_start;
+ }
+
+ /* #line 133 "./ragel/tsip_parser_header_Refer_To.rl" */
+
+ /* #line 646 "./src/headers/tsip_header_Refer_To.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Refer_To_trans_keys + _tsip_machine_parser_header_Refer_To_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Refer_To_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Refer_To_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Refer_To_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Refer_To_trans_keys + _tsip_machine_parser_header_Refer_To_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Refer_To_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Refer_To_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Refer_To_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Refer_To_indicies[_trans];
- cs = _tsip_machine_parser_header_Refer_To_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Refer_To_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Refer_To_actions + _tsip_machine_parser_header_Refer_To_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_Refer_To.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Refer_To.rl" */
- {
- if(!r_to->uri) /* Only one URI */{
- int len = (int)(p - tag_start);
- if(r_to && !r_to->uri){
- if((r_to->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && r_to->display_name){
- r_to->uri->display_name = tsk_strdup(r_to->display_name);
- }
- }
- }
- }
- break;
- case 2:
-/* #line 64 "./ragel/tsip_parser_header_Refer_To.rl" */
- {
- if(!r_to->display_name){
- TSK_PARSER_SET_STRING(r_to->display_name);
- tsk_strunquote(&r_to->display_name);
- }
- }
- break;
- case 3:
-/* #line 71 "./ragel/tsip_parser_header_Refer_To.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(r_to));
- }
- break;
- case 4:
-/* #line 75 "./ragel/tsip_parser_header_Refer_To.rl" */
- {
- }
- break;
-/* #line 759 "./src/headers/tsip_header_Refer_To.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Refer_To_indicies[_trans];
+ cs = _tsip_machine_parser_header_Refer_To_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Refer_To_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Refer_To_actions + _tsip_machine_parser_header_Refer_To_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_Refer_To.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Refer_To.rl" */
+ {
+ if(!r_to->uri) { /* Only one URI */
+ int len = (int)(p - tag_start);
+ if(r_to && !r_to->uri) {
+ if((r_to->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && r_to->display_name) {
+ r_to->uri->display_name = tsk_strdup(r_to->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 2:
+ /* #line 64 "./ragel/tsip_parser_header_Refer_To.rl" */
+ {
+ if(!r_to->display_name) {
+ TSK_PARSER_SET_STRING(r_to->display_name);
+ tsk_strunquote(&r_to->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 71 "./ragel/tsip_parser_header_Refer_To.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(r_to));
+ }
+ break;
+ case 4:
+ /* #line 75 "./ragel/tsip_parser_header_Refer_To.rl" */
+ {
+ }
+ break;
+ /* #line 759 "./src/headers/tsip_header_Refer_To.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 134 "./ragel/tsip_parser_header_Refer_To.rl" */
-
- if( cs <
-/* #line 775 "./src/headers/tsip_header_Refer_To.c" */
-183
-/* #line 135 "./ragel/tsip_parser_header_Refer_To.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Refer-To' header.");
- TSK_OBJECT_SAFE_FREE(r_to);
- }
-
- return r_to;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 134 "./ragel/tsip_parser_header_Refer_To.rl" */
+
+ if( cs <
+ /* #line 775 "./src/headers/tsip_header_Refer_To.c" */
+ 183
+ /* #line 135 "./ragel/tsip_parser_header_Refer_To.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Refer-To' header.");
+ TSK_OBJECT_SAFE_FREE(r_to);
+ }
+
+ return r_to;
}
@@ -794,44 +805,43 @@ _again:
static tsk_object_t* tsip_header_Refer_To_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Refer_To_t *Refer_To = self;
- if(Refer_To){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(Refer_To)->type = tsip_htype_Refer_To;
- TSIP_HEADER(Refer_To)->serialize = tsip_header_Refer_To_serialize;
-
- if(uri){
- Refer_To->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Refer_To header.");
- }
- return self;
+ tsip_header_Refer_To_t *Refer_To = self;
+ if(Refer_To) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(Refer_To)->type = tsip_htype_Refer_To;
+ TSIP_HEADER(Refer_To)->serialize = tsip_header_Refer_To_serialize;
+
+ if(uri) {
+ Refer_To->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Refer_To header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Refer_To_dtor(tsk_object_t *self)
{
- tsip_header_Refer_To_t *Refer_To = self;
- if(Refer_To){
- TSK_FREE(Refer_To->display_name);
- TSK_OBJECT_SAFE_FREE(Refer_To->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Refer_To));
- }
- else{
- TSK_DEBUG_ERROR("Null Refer_To header.");
- }
-
- return self;
+ tsip_header_Refer_To_t *Refer_To = self;
+ if(Refer_To) {
+ TSK_FREE(Refer_To->display_name);
+ TSK_OBJECT_SAFE_FREE(Refer_To->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Refer_To));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Refer_To header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Refer_To_def_s =
-{
- sizeof(tsip_header_Refer_To_t),
- tsip_header_Refer_To_ctor,
- tsip_header_Refer_To_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Refer_To_def_s = {
+ sizeof(tsip_header_Refer_To_t),
+ tsip_header_Refer_To_ctor,
+ tsip_header_Refer_To_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Refer_To_def_t = &tsip_header_Refer_To_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Referred_By.c b/tinySIP/src/headers/tsip_header_Referred_By.c
index 47fae1d..4592f2a 100755
--- a/tinySIP/src/headers/tsip_header_Referred_By.c
+++ b/tinySIP/src/headers/tsip_header_Referred_By.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,1270 +49,1281 @@
tsip_header_Referred_By_t* tsip_header_Referred_By_create(const tsip_uri_t* uri, const char* cid)
{
- return tsk_object_new(TSIP_HEADER_REFERRED_BY_VA_ARGS(uri, cid));
+ return tsk_object_new(TSIP_HEADER_REFERRED_BY_VA_ARGS(uri, cid));
}
tsip_header_Referred_By_t* tsip_header_Referred_By_create_null()
{
- return tsip_header_Referred_By_create(tsk_null, tsk_null);
+ return tsip_header_Referred_By_create(tsk_null, tsk_null);
}
int tsip_header_Referred_By_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- int ret;
- const tsip_header_Referred_By_t *Referred_By = (const tsip_header_Referred_By_t *)header;
+ if(header) {
+ int ret;
+ const tsip_header_Referred_By_t *Referred_By = (const tsip_header_Referred_By_t *)header;
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Referred_By->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- /* cid */
- if(Referred_By->cid && (ret = tsk_buffer_append_2(output, ";cid=%s", Referred_By->cid))){
- return ret;
- }
- return ret;
- }
- return -1;
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Referred_By->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ /* cid */
+ if(Referred_By->cid && (ret = tsk_buffer_append_2(output, ";cid=%s", Referred_By->cid))) {
+ return ret;
+ }
+ return ret;
+ }
+ return -1;
}
tsip_header_Referred_By_t *tsip_header_Referred_By_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Referred_By_t *r_by = tsip_header_Referred_By_create_null();
-
- const char *tag_start = tsk_null;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Referred_By_t *r_by = tsip_header_Referred_By_create_null();
-
-/* #line 91 "./src/headers/tsip_header_Referred_By.c" */
-static const char _tsip_machine_parser_header_Referred_By_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 2, 1, 0,
- 2, 1, 3, 2, 1, 4, 2, 3,
- 4, 3, 1, 3, 4
-};
+ const char *tag_start = tsk_null;
-static const short _tsip_machine_parser_header_Referred_By_key_offsets[] = {
- 0, 0, 4, 7, 28, 29, 31, 52,
- 53, 55, 58, 62, 74, 77, 77, 78,
- 82, 83, 102, 103, 105, 123, 142, 147,
- 148, 150, 154, 173, 174, 176, 195, 196,
- 198, 201, 209, 210, 212, 216, 220, 221,
- 223, 226, 232, 250, 257, 265, 273, 281,
- 283, 290, 299, 301, 304, 306, 309, 311,
- 314, 317, 318, 321, 322, 325, 326, 335,
- 344, 352, 360, 368, 376, 378, 384, 393,
- 402, 411, 413, 416, 419, 420, 421, 442,
- 463, 482, 487, 488, 490, 494, 513, 514,
- 516, 535, 536, 538, 541, 562, 585, 609,
- 631, 635, 639, 660, 684, 708, 731, 755,
- 779, 802, 817, 833, 849, 865, 875, 890,
- 907, 917, 928, 938, 949, 959, 970, 981,
- 990, 998, 1009, 1018, 1029, 1038, 1055, 1072,
- 1088, 1104, 1120, 1136, 1146, 1160, 1177, 1194,
- 1211, 1221, 1232, 1243, 1252, 1261, 1278, 1296,
- 1300, 1301, 1303, 1311, 1312, 1314, 1318, 1324,
- 1336, 1339, 1339, 1343, 1363, 1382, 1387, 1407,
- 1425, 1434, 1438, 1463, 1487, 1497, 1521, 1544,
- 1552, 1561, 1577, 1594, 1611, 1628, 1639, 1655,
- 1673, 1684, 1696, 1707, 1719, 1730, 1742, 1754,
- 1764, 1776, 1786, 1798, 1808, 1826, 1844, 1861,
- 1878, 1895, 1912, 1923, 1938, 1956, 1974, 1992,
- 2003, 2015, 2027, 2037, 2047, 2073, 2099, 2123,
- 2133, 2157, 2179, 2203, 2225, 2250, 2273, 2277,
- 2281, 2303, 2328, 2353, 2377, 2402, 2427, 2451,
- 2467, 2484, 2501, 2518, 2529, 2545, 2563, 2574,
- 2586, 2597, 2609, 2620, 2632, 2644, 2654, 2663,
- 2675, 2685, 2697, 2707, 2725, 2743, 2760, 2777,
- 2794, 2811, 2822, 2837, 2855, 2873, 2891, 2902,
- 2914, 2926, 2936, 2946, 2957, 2969, 2981, 2993,
- 2999, 3010, 3023, 3029, 3036, 3042, 3049, 3055,
- 3062, 3069, 3074, 3081, 3086, 3093, 3098, 3111,
- 3124, 3136, 3148, 3160, 3172, 3178, 3188, 3201,
- 3214, 3227, 3233, 3240, 3247, 3252, 3257, 3278,
- 3299, 3318, 3323, 3343, 3345, 3347, 3349, 3351,
- 3353, 3355, 3357, 3358, 3360, 3362
-};
-static const char _tsip_machine_parser_header_Referred_By_trans_keys[] = {
- 66, 82, 98, 114, 9, 32, 58, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 10, 9, 32, 9,
- 32, 60, 65, 90, 97, 122, 9, 32,
- 43, 58, 45, 46, 48, 57, 65, 90,
- 97, 122, 9, 32, 58, 62, 9, 13,
- 32, 59, 10, 9, 13, 32, 33, 37,
- 39, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 33, 37, 39, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 61, 10, 9, 32, 9, 32,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 34, 13, 34, 92, 127, 0, 8, 10,
- 31, 10, 9, 32, 9, 13, 32, 59,
- 9, 13, 32, 59, 10, 9, 32, 9,
- 32, 59, 0, 9, 11, 12, 14, 127,
- 9, 13, 32, 33, 37, 39, 59, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 58, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 48, 57, 65, 70, 97,
- 102, 58, 93, 58, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 48, 57, 46, 48, 57,
- 48, 57, 46, 48, 57, 48, 57, 93,
- 48, 57, 93, 48, 57, 93, 46, 48,
- 57, 46, 46, 48, 57, 46, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 48, 57, 46, 48, 57,
- 46, 48, 57, 46, 58, 9, 13, 32,
- 33, 37, 39, 59, 61, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 61, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 59, 61, 10,
- 9, 32, 9, 32, 59, 61, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 34, 13, 33, 34,
- 37, 39, 45, 92, 126, 127, 0, 8,
- 10, 31, 42, 43, 48, 57, 65, 90,
- 95, 122, 13, 33, 34, 37, 39, 45,
- 46, 64, 92, 126, 127, 0, 8, 10,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 122, 13, 33, 34, 37, 39, 45, 91,
- 92, 126, 127, 0, 8, 10, 31, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 13, 33, 34, 37, 39, 45, 46,
- 92, 126, 127, 0, 8, 10, 31, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 59, 9, 13, 32, 59, 13,
- 33, 34, 37, 39, 45, 92, 126, 127,
- 0, 8, 10, 31, 42, 43, 48, 57,
- 65, 90, 95, 122, 13, 33, 34, 37,
- 39, 45, 46, 92, 126, 127, 0, 8,
- 10, 31, 42, 43, 48, 57, 65, 90,
- 95, 96, 97, 122, 13, 33, 34, 37,
- 39, 45, 46, 92, 126, 127, 0, 8,
- 10, 31, 42, 43, 48, 57, 65, 90,
- 95, 96, 97, 122, 13, 33, 34, 37,
- 39, 45, 92, 126, 127, 0, 8, 10,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 13, 33, 34, 37, 39,
- 45, 46, 92, 126, 127, 0, 8, 10,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 13, 33, 34, 37, 39,
- 45, 46, 92, 126, 127, 0, 8, 10,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 13, 33, 34, 37, 39,
- 45, 92, 126, 127, 0, 8, 10, 31,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 13, 34, 58, 92, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 58, 92, 93, 127, 0,
- 8, 10, 31, 13, 34, 58, 92, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 127, 0, 8, 10, 31, 48, 57, 13,
- 34, 92, 93, 127, 0, 8, 10, 31,
- 48, 57, 13, 34, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 92,
- 93, 127, 0, 8, 10, 31, 13, 34,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 92, 127, 0, 8, 10, 31, 48,
- 57, 13, 34, 46, 92, 127, 0, 8,
- 10, 31, 13, 34, 46, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 13, 34,
- 46, 58, 92, 93, 127, 0, 8, 10,
- 31, 48, 57, 65, 70, 97, 102, 13,
- 34, 46, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 58, 92, 93, 127, 0, 8,
- 10, 31, 13, 34, 92, 127, 0, 8,
- 10, 31, 48, 57, 65, 70, 97, 102,
- 13, 34, 46, 58, 92, 93, 127, 0,
- 8, 10, 31, 48, 57, 65, 70, 97,
- 102, 13, 34, 46, 58, 92, 93, 127,
- 0, 8, 10, 31, 48, 57, 65, 70,
- 97, 102, 13, 34, 46, 58, 92, 93,
- 127, 0, 8, 10, 31, 48, 57, 65,
- 70, 97, 102, 13, 34, 92, 127, 0,
- 8, 10, 31, 48, 57, 13, 34, 46,
- 92, 127, 0, 8, 10, 31, 48, 57,
- 13, 34, 46, 92, 127, 0, 8, 10,
- 31, 48, 57, 13, 34, 46, 92, 127,
- 0, 8, 10, 31, 13, 34, 58, 92,
- 127, 0, 8, 10, 31, 9, 13, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 60, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 60, 10, 9, 32, 13,
- 34, 92, 127, 0, 8, 10, 31, 10,
- 9, 32, 9, 13, 32, 60, 0, 9,
- 11, 12, 14, 127, 9, 32, 43, 58,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 9, 32, 58, 9, 13, 32, 59, 9,
- 13, 32, 33, 37, 39, 59, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 59, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 34, 59, 92, 127,
- 0, 31, 9, 13, 32, 59, 9, 13,
- 32, 33, 34, 37, 39, 59, 67, 92,
- 99, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 59, 61,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 59, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 59, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 59, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 59, 0, 8, 11, 127,
- 9, 13, 32, 34, 59, 92, 127, 0,
- 31, 9, 13, 32, 34, 58, 59, 92,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 58, 59, 92, 93, 127, 0, 31, 9,
- 13, 32, 34, 58, 59, 92, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 46, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 59, 92, 127,
- 0, 31, 48, 57, 9, 13, 32, 34,
- 46, 59, 92, 127, 0, 31, 48, 57,
- 9, 13, 32, 34, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 59, 92,
- 93, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 59, 92, 93, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 59, 92,
- 93, 127, 0, 31, 9, 13, 32, 34,
- 46, 59, 92, 127, 0, 31, 48, 57,
- 9, 13, 32, 34, 46, 59, 92, 127,
- 0, 31, 9, 13, 32, 34, 46, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 9, 13, 32, 34, 46, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 46, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 58, 59, 92, 93,
- 127, 0, 31, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 46, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 46, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 46, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 9, 13, 32,
- 34, 58, 59, 92, 127, 0, 31, 9,
- 13, 32, 33, 34, 37, 39, 59, 61,
- 73, 92, 105, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 59, 61, 68, 92, 100, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 59, 61, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 59,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 59, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 45, 59, 92, 126,
- 127, 0, 31, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 45, 46, 59, 64, 92, 126,
- 127, 0, 31, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 45, 59, 92, 126, 127, 0,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 45, 59, 91, 92, 126, 127, 0, 31,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 34, 37,
- 39, 45, 46, 59, 92, 126, 127, 0,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 9, 13, 32,
- 59, 9, 13, 32, 33, 34, 37, 39,
- 45, 59, 92, 126, 127, 0, 31, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 45, 46,
- 59, 92, 126, 127, 0, 31, 42, 43,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 34, 37, 39, 45,
- 46, 59, 92, 126, 127, 0, 31, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 45, 59, 92, 126, 127, 0, 31, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 45, 46, 59, 92, 126, 127, 0, 31,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 34, 37,
- 39, 45, 46, 59, 92, 126, 127, 0,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 9, 13, 32, 33, 34,
- 37, 39, 45, 59, 92, 126, 127, 0,
- 31, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 9, 13, 32, 34, 58,
- 59, 92, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 58, 59, 92, 93, 127, 0,
- 31, 9, 13, 32, 34, 58, 59, 92,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 46, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 59, 92,
- 127, 0, 31, 48, 57, 9, 13, 32,
- 34, 46, 59, 92, 127, 0, 31, 48,
- 57, 9, 13, 32, 34, 59, 92, 127,
- 0, 31, 48, 57, 9, 13, 32, 34,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 9, 13, 32, 34, 59, 92, 93, 127,
- 0, 31, 48, 57, 9, 13, 32, 34,
- 59, 92, 93, 127, 0, 31, 9, 13,
- 32, 34, 59, 92, 127, 0, 31, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 9, 13, 32,
- 34, 46, 59, 92, 127, 0, 31, 48,
- 57, 9, 13, 32, 34, 46, 59, 92,
- 127, 0, 31, 9, 13, 32, 34, 46,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 46, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 58,
- 59, 92, 93, 127, 0, 31, 9, 13,
- 32, 34, 59, 92, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 46, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 46, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 46, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 46, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 9, 13, 32, 34, 58, 59, 92, 127,
- 0, 31, 9, 13, 32, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 58, 59, 93, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 58, 59, 93, 9,
- 13, 32, 58, 59, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 46, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 59, 48, 57, 9, 13, 32,
- 46, 59, 48, 57, 9, 13, 32, 59,
- 48, 57, 9, 13, 32, 46, 59, 48,
- 57, 9, 13, 32, 59, 48, 57, 9,
- 13, 32, 59, 93, 48, 57, 9, 13,
- 32, 59, 93, 48, 57, 9, 13, 32,
- 59, 93, 9, 13, 32, 46, 59, 48,
- 57, 9, 13, 32, 46, 59, 9, 13,
- 32, 46, 59, 48, 57, 9, 13, 32,
- 46, 59, 9, 13, 32, 46, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 46, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 58,
- 59, 93, 9, 13, 32, 59, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 46,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 46, 58, 59, 93,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 46, 58, 59, 93, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 59, 48,
- 57, 9, 13, 32, 46, 59, 48, 57,
- 9, 13, 32, 46, 59, 48, 57, 9,
- 13, 32, 46, 59, 9, 13, 32, 58,
- 59, 9, 13, 32, 33, 37, 39, 59,
- 61, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 68, 100,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 59, 91, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 69,
- 101, 70, 102, 69, 101, 82, 114, 82,
- 114, 69, 101, 68, 100, 45, 66, 98,
- 89, 121, 0
-};
+ /* #line 91 "./src/headers/tsip_header_Referred_By.c" */
+ static const char _tsip_machine_parser_header_Referred_By_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 2, 1, 0,
+ 2, 1, 3, 2, 1, 4, 2, 3,
+ 4, 3, 1, 3, 4
+ };
-static const char _tsip_machine_parser_header_Referred_By_single_lengths[] = {
- 0, 4, 3, 9, 1, 2, 9, 1,
- 2, 3, 0, 4, 3, 0, 1, 4,
- 1, 9, 1, 2, 8, 9, 5, 1,
- 2, 4, 9, 1, 2, 9, 1, 2,
- 3, 4, 1, 2, 4, 4, 1, 2,
- 3, 0, 8, 1, 2, 2, 2, 2,
- 1, 3, 0, 1, 0, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 3, 3,
- 2, 2, 2, 2, 2, 0, 3, 3,
- 3, 0, 1, 1, 1, 1, 11, 11,
- 9, 5, 1, 2, 4, 9, 1, 2,
- 9, 1, 2, 3, 9, 11, 10, 10,
- 4, 4, 9, 10, 10, 9, 10, 10,
- 9, 5, 6, 6, 6, 6, 5, 7,
- 4, 5, 4, 5, 4, 5, 5, 5,
- 4, 5, 5, 5, 5, 7, 7, 6,
- 6, 6, 6, 6, 4, 7, 7, 7,
- 4, 5, 5, 5, 5, 7, 8, 4,
- 1, 2, 4, 1, 2, 4, 0, 4,
- 3, 0, 4, 10, 9, 5, 10, 8,
- 7, 4, 13, 12, 8, 12, 11, 4,
- 7, 8, 9, 9, 9, 9, 8, 10,
- 7, 8, 7, 8, 7, 8, 8, 8,
- 8, 8, 8, 8, 10, 10, 9, 9,
- 9, 9, 9, 7, 10, 10, 10, 7,
- 8, 8, 8, 8, 14, 14, 12, 8,
- 12, 12, 14, 12, 13, 13, 4, 4,
- 12, 13, 13, 12, 13, 13, 12, 8,
- 9, 9, 9, 9, 8, 10, 7, 8,
- 7, 8, 7, 8, 8, 8, 7, 8,
- 8, 8, 8, 10, 10, 9, 9, 9,
- 9, 9, 7, 10, 10, 10, 7, 8,
- 8, 8, 8, 5, 6, 6, 6, 6,
- 5, 7, 4, 5, 4, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 7, 7,
- 6, 6, 6, 6, 6, 4, 7, 7,
- 7, 4, 5, 5, 5, 5, 11, 11,
- 9, 5, 10, 2, 2, 2, 2, 2,
- 2, 2, 1, 2, 2, 0
-};
+ static const short _tsip_machine_parser_header_Referred_By_key_offsets[] = {
+ 0, 0, 4, 7, 28, 29, 31, 52,
+ 53, 55, 58, 62, 74, 77, 77, 78,
+ 82, 83, 102, 103, 105, 123, 142, 147,
+ 148, 150, 154, 173, 174, 176, 195, 196,
+ 198, 201, 209, 210, 212, 216, 220, 221,
+ 223, 226, 232, 250, 257, 265, 273, 281,
+ 283, 290, 299, 301, 304, 306, 309, 311,
+ 314, 317, 318, 321, 322, 325, 326, 335,
+ 344, 352, 360, 368, 376, 378, 384, 393,
+ 402, 411, 413, 416, 419, 420, 421, 442,
+ 463, 482, 487, 488, 490, 494, 513, 514,
+ 516, 535, 536, 538, 541, 562, 585, 609,
+ 631, 635, 639, 660, 684, 708, 731, 755,
+ 779, 802, 817, 833, 849, 865, 875, 890,
+ 907, 917, 928, 938, 949, 959, 970, 981,
+ 990, 998, 1009, 1018, 1029, 1038, 1055, 1072,
+ 1088, 1104, 1120, 1136, 1146, 1160, 1177, 1194,
+ 1211, 1221, 1232, 1243, 1252, 1261, 1278, 1296,
+ 1300, 1301, 1303, 1311, 1312, 1314, 1318, 1324,
+ 1336, 1339, 1339, 1343, 1363, 1382, 1387, 1407,
+ 1425, 1434, 1438, 1463, 1487, 1497, 1521, 1544,
+ 1552, 1561, 1577, 1594, 1611, 1628, 1639, 1655,
+ 1673, 1684, 1696, 1707, 1719, 1730, 1742, 1754,
+ 1764, 1776, 1786, 1798, 1808, 1826, 1844, 1861,
+ 1878, 1895, 1912, 1923, 1938, 1956, 1974, 1992,
+ 2003, 2015, 2027, 2037, 2047, 2073, 2099, 2123,
+ 2133, 2157, 2179, 2203, 2225, 2250, 2273, 2277,
+ 2281, 2303, 2328, 2353, 2377, 2402, 2427, 2451,
+ 2467, 2484, 2501, 2518, 2529, 2545, 2563, 2574,
+ 2586, 2597, 2609, 2620, 2632, 2644, 2654, 2663,
+ 2675, 2685, 2697, 2707, 2725, 2743, 2760, 2777,
+ 2794, 2811, 2822, 2837, 2855, 2873, 2891, 2902,
+ 2914, 2926, 2936, 2946, 2957, 2969, 2981, 2993,
+ 2999, 3010, 3023, 3029, 3036, 3042, 3049, 3055,
+ 3062, 3069, 3074, 3081, 3086, 3093, 3098, 3111,
+ 3124, 3136, 3148, 3160, 3172, 3178, 3188, 3201,
+ 3214, 3227, 3233, 3240, 3247, 3252, 3257, 3278,
+ 3299, 3318, 3323, 3343, 3345, 3347, 3349, 3351,
+ 3353, 3355, 3357, 3358, 3360, 3362
+ };
-static const char _tsip_machine_parser_header_Referred_By_range_lengths[] = {
- 0, 0, 0, 6, 0, 0, 6, 0,
- 0, 0, 2, 4, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 5, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 3, 5, 3, 3, 3, 3, 0,
- 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 0, 1, 0, 3, 3,
- 3, 3, 3, 3, 0, 3, 3, 3,
- 3, 1, 1, 1, 0, 0, 5, 5,
- 5, 0, 0, 0, 0, 5, 0, 0,
- 5, 0, 0, 0, 6, 6, 7, 6,
- 0, 0, 6, 7, 7, 7, 7, 7,
- 7, 5, 5, 5, 5, 2, 5, 5,
- 3, 3, 3, 3, 3, 3, 3, 2,
- 2, 3, 2, 3, 2, 5, 5, 5,
- 5, 5, 5, 2, 5, 5, 5, 5,
- 3, 3, 3, 2, 2, 5, 5, 0,
- 0, 0, 2, 0, 0, 0, 3, 4,
- 0, 0, 0, 5, 5, 0, 5, 5,
- 1, 0, 6, 6, 1, 6, 6, 2,
- 1, 4, 4, 4, 4, 1, 4, 4,
- 2, 2, 2, 2, 2, 2, 2, 1,
- 2, 1, 2, 1, 4, 4, 4, 4,
- 4, 4, 1, 4, 4, 4, 4, 2,
- 2, 2, 1, 1, 6, 6, 6, 1,
- 6, 5, 5, 5, 6, 5, 0, 0,
- 5, 6, 6, 6, 6, 6, 6, 4,
- 4, 4, 4, 1, 4, 4, 2, 2,
- 2, 2, 2, 2, 2, 1, 1, 2,
- 1, 2, 1, 4, 4, 4, 4, 4,
- 4, 1, 4, 4, 4, 4, 2, 2,
- 2, 1, 1, 3, 3, 3, 3, 0,
- 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 0, 1, 0, 3, 3,
- 3, 3, 3, 3, 0, 3, 3, 3,
- 3, 1, 1, 1, 0, 0, 5, 5,
- 5, 0, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
+ static const char _tsip_machine_parser_header_Referred_By_trans_keys[] = {
+ 66, 82, 98, 114, 9, 32, 58, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 10, 9, 32, 9,
+ 32, 60, 65, 90, 97, 122, 9, 32,
+ 43, 58, 45, 46, 48, 57, 65, 90,
+ 97, 122, 9, 32, 58, 62, 9, 13,
+ 32, 59, 10, 9, 13, 32, 33, 37,
+ 39, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 33, 37, 39, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 61, 10, 9, 32, 9, 32,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 34, 13, 34, 92, 127, 0, 8, 10,
+ 31, 10, 9, 32, 9, 13, 32, 59,
+ 9, 13, 32, 59, 10, 9, 32, 9,
+ 32, 59, 0, 9, 11, 12, 14, 127,
+ 9, 13, 32, 33, 37, 39, 59, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 58, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 58, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 48, 57, 46, 48, 57,
+ 48, 57, 46, 48, 57, 48, 57, 93,
+ 48, 57, 93, 48, 57, 93, 46, 48,
+ 57, 46, 46, 48, 57, 46, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 48, 57, 46, 48, 57,
+ 46, 48, 57, 46, 58, 9, 13, 32,
+ 33, 37, 39, 59, 61, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 61, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 59, 61, 10,
+ 9, 32, 9, 32, 59, 61, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 34, 13, 33, 34,
+ 37, 39, 45, 92, 126, 127, 0, 8,
+ 10, 31, 42, 43, 48, 57, 65, 90,
+ 95, 122, 13, 33, 34, 37, 39, 45,
+ 46, 64, 92, 126, 127, 0, 8, 10,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 122, 13, 33, 34, 37, 39, 45, 91,
+ 92, 126, 127, 0, 8, 10, 31, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 13, 33, 34, 37, 39, 45, 46,
+ 92, 126, 127, 0, 8, 10, 31, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 59, 9, 13, 32, 59, 13,
+ 33, 34, 37, 39, 45, 92, 126, 127,
+ 0, 8, 10, 31, 42, 43, 48, 57,
+ 65, 90, 95, 122, 13, 33, 34, 37,
+ 39, 45, 46, 92, 126, 127, 0, 8,
+ 10, 31, 42, 43, 48, 57, 65, 90,
+ 95, 96, 97, 122, 13, 33, 34, 37,
+ 39, 45, 46, 92, 126, 127, 0, 8,
+ 10, 31, 42, 43, 48, 57, 65, 90,
+ 95, 96, 97, 122, 13, 33, 34, 37,
+ 39, 45, 92, 126, 127, 0, 8, 10,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 13, 33, 34, 37, 39,
+ 45, 46, 92, 126, 127, 0, 8, 10,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 13, 33, 34, 37, 39,
+ 45, 46, 92, 126, 127, 0, 8, 10,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 13, 33, 34, 37, 39,
+ 45, 92, 126, 127, 0, 8, 10, 31,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 13, 34, 58, 92, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 58, 92, 93, 127, 0,
+ 8, 10, 31, 13, 34, 58, 92, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 127, 0, 8, 10, 31, 48, 57, 13,
+ 34, 92, 93, 127, 0, 8, 10, 31,
+ 48, 57, 13, 34, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 92,
+ 93, 127, 0, 8, 10, 31, 13, 34,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 92, 127, 0, 8, 10, 31, 48,
+ 57, 13, 34, 46, 92, 127, 0, 8,
+ 10, 31, 13, 34, 46, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 13, 34,
+ 46, 58, 92, 93, 127, 0, 8, 10,
+ 31, 48, 57, 65, 70, 97, 102, 13,
+ 34, 46, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 58, 92, 93, 127, 0, 8,
+ 10, 31, 13, 34, 92, 127, 0, 8,
+ 10, 31, 48, 57, 65, 70, 97, 102,
+ 13, 34, 46, 58, 92, 93, 127, 0,
+ 8, 10, 31, 48, 57, 65, 70, 97,
+ 102, 13, 34, 46, 58, 92, 93, 127,
+ 0, 8, 10, 31, 48, 57, 65, 70,
+ 97, 102, 13, 34, 46, 58, 92, 93,
+ 127, 0, 8, 10, 31, 48, 57, 65,
+ 70, 97, 102, 13, 34, 92, 127, 0,
+ 8, 10, 31, 48, 57, 13, 34, 46,
+ 92, 127, 0, 8, 10, 31, 48, 57,
+ 13, 34, 46, 92, 127, 0, 8, 10,
+ 31, 48, 57, 13, 34, 46, 92, 127,
+ 0, 8, 10, 31, 13, 34, 58, 92,
+ 127, 0, 8, 10, 31, 9, 13, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 60, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 60, 10, 9, 32, 13,
+ 34, 92, 127, 0, 8, 10, 31, 10,
+ 9, 32, 9, 13, 32, 60, 0, 9,
+ 11, 12, 14, 127, 9, 32, 43, 58,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 9, 32, 58, 9, 13, 32, 59, 9,
+ 13, 32, 33, 37, 39, 59, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 59, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 34, 59, 92, 127,
+ 0, 31, 9, 13, 32, 59, 9, 13,
+ 32, 33, 34, 37, 39, 59, 67, 92,
+ 99, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 59, 61,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 59, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 59, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 59, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 59, 0, 8, 11, 127,
+ 9, 13, 32, 34, 59, 92, 127, 0,
+ 31, 9, 13, 32, 34, 58, 59, 92,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 58, 59, 92, 93, 127, 0, 31, 9,
+ 13, 32, 34, 58, 59, 92, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 46, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 59, 92, 127,
+ 0, 31, 48, 57, 9, 13, 32, 34,
+ 46, 59, 92, 127, 0, 31, 48, 57,
+ 9, 13, 32, 34, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 59, 92,
+ 93, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 59, 92, 93, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 59, 92,
+ 93, 127, 0, 31, 9, 13, 32, 34,
+ 46, 59, 92, 127, 0, 31, 48, 57,
+ 9, 13, 32, 34, 46, 59, 92, 127,
+ 0, 31, 9, 13, 32, 34, 46, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 9, 13, 32, 34, 46, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 46, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 58, 59, 92, 93,
+ 127, 0, 31, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 46, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 46, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 46, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 9, 13, 32,
+ 34, 58, 59, 92, 127, 0, 31, 9,
+ 13, 32, 33, 34, 37, 39, 59, 61,
+ 73, 92, 105, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 59, 61, 68, 92, 100, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 59, 61, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 59,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 59, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 45, 59, 92, 126,
+ 127, 0, 31, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 45, 46, 59, 64, 92, 126,
+ 127, 0, 31, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 45, 59, 92, 126, 127, 0,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 45, 59, 91, 92, 126, 127, 0, 31,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 34, 37,
+ 39, 45, 46, 59, 92, 126, 127, 0,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 9, 13, 32,
+ 59, 9, 13, 32, 33, 34, 37, 39,
+ 45, 59, 92, 126, 127, 0, 31, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 45, 46,
+ 59, 92, 126, 127, 0, 31, 42, 43,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 34, 37, 39, 45,
+ 46, 59, 92, 126, 127, 0, 31, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 45, 59, 92, 126, 127, 0, 31, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 45, 46, 59, 92, 126, 127, 0, 31,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 34, 37,
+ 39, 45, 46, 59, 92, 126, 127, 0,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 9, 13, 32, 33, 34,
+ 37, 39, 45, 59, 92, 126, 127, 0,
+ 31, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 9, 13, 32, 34, 58,
+ 59, 92, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 58, 59, 92, 93, 127, 0,
+ 31, 9, 13, 32, 34, 58, 59, 92,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 46, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 59, 92,
+ 127, 0, 31, 48, 57, 9, 13, 32,
+ 34, 46, 59, 92, 127, 0, 31, 48,
+ 57, 9, 13, 32, 34, 59, 92, 127,
+ 0, 31, 48, 57, 9, 13, 32, 34,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 9, 13, 32, 34, 59, 92, 93, 127,
+ 0, 31, 48, 57, 9, 13, 32, 34,
+ 59, 92, 93, 127, 0, 31, 9, 13,
+ 32, 34, 59, 92, 127, 0, 31, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 9, 13, 32,
+ 34, 46, 59, 92, 127, 0, 31, 48,
+ 57, 9, 13, 32, 34, 46, 59, 92,
+ 127, 0, 31, 9, 13, 32, 34, 46,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 46, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 58,
+ 59, 92, 93, 127, 0, 31, 9, 13,
+ 32, 34, 59, 92, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 46, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 46, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 46, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 46, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 9, 13, 32, 34, 58, 59, 92, 127,
+ 0, 31, 9, 13, 32, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 58, 59, 93, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 58, 59, 93, 9,
+ 13, 32, 58, 59, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 46, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 59, 48, 57, 9, 13, 32,
+ 46, 59, 48, 57, 9, 13, 32, 59,
+ 48, 57, 9, 13, 32, 46, 59, 48,
+ 57, 9, 13, 32, 59, 48, 57, 9,
+ 13, 32, 59, 93, 48, 57, 9, 13,
+ 32, 59, 93, 48, 57, 9, 13, 32,
+ 59, 93, 9, 13, 32, 46, 59, 48,
+ 57, 9, 13, 32, 46, 59, 9, 13,
+ 32, 46, 59, 48, 57, 9, 13, 32,
+ 46, 59, 9, 13, 32, 46, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 46, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 58,
+ 59, 93, 9, 13, 32, 59, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 46,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 46, 58, 59, 93,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 46, 58, 59, 93, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 59, 48,
+ 57, 9, 13, 32, 46, 59, 48, 57,
+ 9, 13, 32, 46, 59, 48, 57, 9,
+ 13, 32, 46, 59, 9, 13, 32, 58,
+ 59, 9, 13, 32, 33, 37, 39, 59,
+ 61, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 68, 100,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 59, 91, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 69,
+ 101, 70, 102, 69, 101, 82, 114, 82,
+ 114, 69, 101, 68, 100, 45, 66, 98,
+ 89, 121, 0
+ };
-static const short _tsip_machine_parser_header_Referred_By_index_offsets[] = {
- 0, 0, 5, 9, 25, 27, 30, 46,
- 48, 51, 55, 58, 67, 71, 72, 74,
- 79, 81, 96, 98, 101, 115, 130, 136,
- 138, 141, 146, 161, 163, 166, 181, 183,
- 186, 190, 197, 199, 202, 207, 212, 214,
- 217, 221, 225, 239, 244, 250, 256, 262,
- 265, 270, 277, 279, 282, 284, 287, 289,
- 292, 295, 297, 300, 302, 305, 307, 314,
- 321, 327, 333, 339, 345, 348, 352, 359,
- 366, 373, 375, 378, 381, 383, 385, 402,
- 419, 434, 440, 442, 445, 450, 465, 467,
- 470, 485, 487, 490, 494, 510, 528, 546,
- 563, 568, 573, 589, 607, 625, 642, 660,
- 678, 695, 706, 718, 730, 742, 751, 762,
- 775, 783, 792, 800, 809, 817, 826, 835,
- 843, 850, 859, 867, 876, 884, 897, 910,
- 922, 934, 946, 958, 967, 977, 990, 1003,
- 1016, 1024, 1033, 1042, 1050, 1058, 1071, 1085,
- 1090, 1092, 1095, 1102, 1104, 1107, 1112, 1116,
- 1125, 1129, 1130, 1135, 1151, 1166, 1172, 1188,
- 1202, 1211, 1216, 1236, 1255, 1265, 1284, 1302,
- 1309, 1318, 1331, 1345, 1359, 1373, 1384, 1397,
- 1412, 1422, 1433, 1443, 1454, 1464, 1475, 1486,
- 1496, 1507, 1517, 1528, 1538, 1553, 1568, 1582,
- 1596, 1610, 1624, 1635, 1647, 1662, 1677, 1692,
- 1702, 1713, 1724, 1734, 1744, 1765, 1786, 1805,
- 1815, 1834, 1852, 1872, 1890, 1910, 1929, 1934,
- 1939, 1957, 1977, 1997, 2016, 2036, 2056, 2075,
- 2088, 2102, 2116, 2130, 2141, 2154, 2169, 2179,
- 2190, 2200, 2211, 2221, 2232, 2243, 2253, 2262,
- 2273, 2283, 2294, 2304, 2319, 2334, 2348, 2362,
- 2376, 2390, 2401, 2413, 2428, 2443, 2458, 2468,
- 2479, 2490, 2500, 2510, 2519, 2529, 2539, 2549,
- 2556, 2565, 2576, 2582, 2589, 2595, 2602, 2608,
- 2615, 2622, 2628, 2635, 2641, 2648, 2654, 2665,
- 2676, 2686, 2696, 2706, 2716, 2723, 2731, 2742,
- 2753, 2764, 2770, 2777, 2784, 2790, 2796, 2813,
- 2830, 2845, 2851, 2867, 2870, 2873, 2876, 2879,
- 2882, 2885, 2888, 2890, 2893, 2896
-};
+ static const char _tsip_machine_parser_header_Referred_By_single_lengths[] = {
+ 0, 4, 3, 9, 1, 2, 9, 1,
+ 2, 3, 0, 4, 3, 0, 1, 4,
+ 1, 9, 1, 2, 8, 9, 5, 1,
+ 2, 4, 9, 1, 2, 9, 1, 2,
+ 3, 4, 1, 2, 4, 4, 1, 2,
+ 3, 0, 8, 1, 2, 2, 2, 2,
+ 1, 3, 0, 1, 0, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1, 3, 3,
+ 2, 2, 2, 2, 2, 0, 3, 3,
+ 3, 0, 1, 1, 1, 1, 11, 11,
+ 9, 5, 1, 2, 4, 9, 1, 2,
+ 9, 1, 2, 3, 9, 11, 10, 10,
+ 4, 4, 9, 10, 10, 9, 10, 10,
+ 9, 5, 6, 6, 6, 6, 5, 7,
+ 4, 5, 4, 5, 4, 5, 5, 5,
+ 4, 5, 5, 5, 5, 7, 7, 6,
+ 6, 6, 6, 6, 4, 7, 7, 7,
+ 4, 5, 5, 5, 5, 7, 8, 4,
+ 1, 2, 4, 1, 2, 4, 0, 4,
+ 3, 0, 4, 10, 9, 5, 10, 8,
+ 7, 4, 13, 12, 8, 12, 11, 4,
+ 7, 8, 9, 9, 9, 9, 8, 10,
+ 7, 8, 7, 8, 7, 8, 8, 8,
+ 8, 8, 8, 8, 10, 10, 9, 9,
+ 9, 9, 9, 7, 10, 10, 10, 7,
+ 8, 8, 8, 8, 14, 14, 12, 8,
+ 12, 12, 14, 12, 13, 13, 4, 4,
+ 12, 13, 13, 12, 13, 13, 12, 8,
+ 9, 9, 9, 9, 8, 10, 7, 8,
+ 7, 8, 7, 8, 8, 8, 7, 8,
+ 8, 8, 8, 10, 10, 9, 9, 9,
+ 9, 9, 7, 10, 10, 10, 7, 8,
+ 8, 8, 8, 5, 6, 6, 6, 6,
+ 5, 7, 4, 5, 4, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 7, 7,
+ 6, 6, 6, 6, 6, 4, 7, 7,
+ 7, 4, 5, 5, 5, 5, 11, 11,
+ 9, 5, 10, 2, 2, 2, 2, 2,
+ 2, 2, 1, 2, 2, 0
+ };
-static const short _tsip_machine_parser_header_Referred_By_indicies[] = {
- 0, 2, 0, 2, 1, 0, 0, 3,
- 1, 3, 4, 3, 5, 6, 5, 5,
- 7, 5, 5, 5, 5, 8, 5, 8,
- 1, 9, 1, 10, 10, 1, 10, 11,
- 10, 5, 6, 5, 5, 7, 5, 5,
- 5, 5, 8, 5, 8, 1, 12, 1,
- 13, 13, 1, 13, 13, 7, 1, 14,
- 14, 1, 15, 15, 16, 17, 16, 16,
- 16, 16, 1, 15, 15, 17, 1, 18,
- 19, 18, 20, 21, 20, 22, 1, 23,
- 1, 22, 24, 22, 25, 25, 25, 26,
- 26, 25, 25, 25, 25, 25, 25, 1,
- 27, 1, 28, 28, 1, 28, 28, 25,
- 25, 25, 26, 26, 25, 25, 25, 25,
- 25, 25, 1, 29, 30, 29, 31, 31,
- 31, 32, 33, 31, 31, 31, 31, 31,
- 31, 1, 34, 35, 34, 22, 33, 1,
- 36, 1, 37, 37, 1, 37, 37, 22,
- 33, 1, 33, 38, 33, 39, 40, 39,
- 39, 41, 39, 39, 39, 39, 39, 39,
- 1, 42, 1, 43, 43, 1, 43, 44,
- 43, 39, 40, 39, 39, 41, 39, 39,
- 39, 39, 39, 39, 1, 45, 1, 46,
- 46, 1, 46, 46, 40, 1, 47, 48,
- 49, 1, 1, 1, 40, 50, 1, 40,
- 40, 1, 51, 30, 51, 32, 1, 52,
- 53, 52, 22, 1, 54, 1, 55, 55,
- 1, 55, 55, 22, 1, 40, 40, 40,
- 1, 51, 30, 51, 39, 39, 39, 32,
- 39, 39, 39, 39, 39, 39, 1, 57,
- 56, 56, 56, 1, 59, 48, 58, 58,
- 58, 1, 59, 48, 60, 60, 60, 1,
- 59, 48, 61, 61, 61, 1, 59, 48,
- 1, 63, 62, 56, 56, 1, 64, 59,
- 48, 65, 58, 58, 1, 66, 1, 67,
- 68, 1, 69, 1, 70, 71, 1, 72,
- 1, 48, 73, 1, 48, 74, 1, 48,
- 1, 70, 75, 1, 70, 1, 67, 76,
- 1, 67, 1, 64, 59, 48, 77, 60,
- 60, 1, 64, 59, 48, 61, 61, 61,
- 1, 79, 48, 78, 78, 78, 1, 81,
- 48, 80, 80, 80, 1, 81, 48, 82,
- 82, 82, 1, 81, 48, 83, 83, 83,
- 1, 81, 48, 1, 84, 78, 78, 1,
- 64, 81, 48, 85, 80, 80, 1, 64,
- 81, 48, 86, 82, 82, 1, 64, 81,
- 48, 83, 83, 83, 1, 87, 1, 64,
- 88, 1, 64, 89, 1, 64, 1, 63,
- 1, 29, 30, 29, 31, 31, 31, 32,
- 33, 90, 90, 31, 31, 31, 31, 31,
- 31, 1, 29, 30, 29, 31, 31, 31,
- 32, 33, 91, 91, 31, 31, 31, 31,
- 31, 31, 1, 92, 30, 92, 31, 31,
- 31, 32, 93, 31, 31, 31, 31, 31,
- 31, 1, 94, 95, 94, 22, 93, 1,
- 96, 1, 97, 97, 1, 97, 97, 22,
- 93, 1, 98, 99, 98, 39, 100, 39,
- 39, 41, 39, 39, 39, 39, 39, 39,
- 1, 101, 1, 102, 102, 1, 103, 104,
- 103, 39, 100, 39, 39, 41, 39, 39,
- 39, 39, 39, 39, 1, 105, 1, 106,
- 106, 1, 106, 106, 107, 1, 47, 108,
- 48, 108, 108, 108, 49, 108, 1, 1,
- 1, 108, 108, 108, 108, 40, 47, 108,
- 48, 108, 108, 108, 107, 109, 49, 108,
- 1, 1, 1, 108, 108, 108, 108, 40,
- 47, 110, 48, 110, 110, 110, 113, 49,
- 110, 1, 1, 1, 110, 111, 112, 110,
- 112, 40, 47, 110, 114, 110, 110, 110,
- 115, 49, 110, 1, 1, 1, 110, 110,
- 110, 110, 40, 116, 117, 116, 118, 1,
- 119, 120, 119, 121, 1, 47, 110, 48,
- 110, 110, 110, 49, 110, 1, 1, 1,
- 110, 110, 110, 110, 40, 47, 110, 114,
- 110, 110, 122, 123, 49, 110, 1, 1,
- 1, 110, 111, 111, 110, 111, 40, 47,
- 110, 114, 110, 110, 122, 115, 49, 110,
- 1, 1, 1, 110, 111, 111, 110, 111,
- 40, 47, 110, 48, 110, 110, 110, 49,
- 110, 1, 1, 1, 110, 111, 112, 110,
- 112, 40, 47, 110, 114, 110, 110, 124,
- 125, 49, 110, 1, 1, 1, 110, 112,
- 112, 110, 112, 40, 47, 110, 114, 110,
- 110, 124, 115, 49, 110, 1, 1, 1,
- 110, 112, 112, 110, 112, 40, 47, 110,
- 114, 110, 110, 110, 49, 110, 1, 1,
- 1, 110, 111, 112, 110, 112, 40, 47,
- 48, 127, 49, 1, 1, 1, 126, 126,
- 126, 40, 47, 48, 129, 49, 130, 1,
- 1, 1, 128, 128, 128, 40, 47, 48,
- 129, 49, 130, 1, 1, 1, 131, 131,
- 131, 40, 47, 48, 129, 49, 130, 1,
- 1, 1, 132, 132, 132, 40, 47, 48,
- 129, 49, 130, 1, 1, 1, 40, 47,
- 48, 134, 49, 1, 1, 1, 133, 126,
- 126, 40, 47, 48, 135, 129, 49, 130,
- 1, 1, 1, 136, 128, 128, 40, 47,
- 48, 49, 1, 1, 1, 137, 40, 47,
- 48, 138, 49, 1, 1, 1, 139, 40,
- 47, 48, 49, 1, 1, 1, 140, 40,
- 47, 48, 141, 49, 1, 1, 1, 142,
- 40, 47, 48, 49, 1, 1, 1, 143,
- 40, 47, 48, 49, 130, 1, 1, 1,
- 144, 40, 47, 48, 49, 130, 1, 1,
- 1, 145, 40, 47, 48, 49, 130, 1,
- 1, 1, 40, 47, 114, 49, 1, 1,
- 1, 40, 47, 48, 141, 49, 1, 1,
- 1, 146, 40, 47, 48, 141, 49, 1,
- 1, 1, 40, 47, 48, 138, 49, 1,
- 1, 1, 147, 40, 47, 48, 138, 49,
- 1, 1, 1, 40, 47, 48, 135, 129,
- 49, 130, 1, 1, 1, 148, 131, 131,
- 40, 47, 48, 135, 129, 49, 130, 1,
- 1, 1, 132, 132, 132, 40, 47, 48,
- 150, 49, 130, 1, 1, 1, 149, 149,
- 149, 40, 47, 48, 152, 49, 130, 1,
- 1, 1, 151, 151, 151, 40, 47, 48,
- 152, 49, 130, 1, 1, 1, 153, 153,
- 153, 40, 47, 48, 152, 49, 130, 1,
- 1, 1, 154, 154, 154, 40, 47, 48,
- 152, 49, 130, 1, 1, 1, 40, 47,
- 48, 49, 1, 1, 1, 155, 149, 149,
- 40, 47, 48, 135, 152, 49, 130, 1,
- 1, 1, 156, 151, 151, 40, 47, 48,
- 135, 152, 49, 130, 1, 1, 1, 157,
- 153, 153, 40, 47, 48, 135, 152, 49,
- 130, 1, 1, 1, 154, 154, 154, 40,
- 47, 48, 49, 1, 1, 1, 158, 40,
- 47, 48, 135, 49, 1, 1, 1, 159,
- 40, 47, 48, 135, 49, 1, 1, 1,
- 160, 40, 47, 48, 135, 49, 1, 1,
- 1, 40, 47, 48, 134, 49, 1, 1,
- 1, 40, 161, 162, 161, 163, 163, 163,
- 163, 163, 163, 163, 163, 163, 1, 164,
- 165, 164, 163, 163, 163, 166, 163, 163,
- 163, 163, 163, 163, 1, 167, 11, 167,
- 7, 1, 168, 1, 161, 161, 1, 170,
- 171, 172, 1, 1, 1, 169, 173, 1,
- 169, 169, 1, 164, 165, 164, 166, 1,
- 169, 169, 169, 1, 174, 174, 175, 176,
- 175, 175, 175, 175, 1, 174, 174, 176,
- 1, 177, 178, 179, 178, 180, 177, 180,
- 179, 180, 181, 181, 181, 180, 182, 182,
- 181, 181, 181, 181, 181, 181, 177, 183,
- 184, 183, 185, 185, 185, 186, 187, 185,
- 185, 185, 185, 185, 185, 177, 188, 179,
- 188, 180, 187, 177, 189, 179, 189, 190,
- 191, 190, 190, 180, 192, 190, 190, 190,
- 190, 190, 190, 177, 193, 184, 193, 190,
- 190, 190, 186, 190, 190, 190, 190, 190,
- 190, 177, 194, 179, 194, 195, 196, 197,
- 177, 177, 191, 193, 184, 193, 186, 177,
- 196, 179, 196, 198, 195, 198, 198, 196,
- 199, 197, 199, 198, 177, 177, 198, 198,
- 198, 198, 198, 191, 200, 184, 200, 201,
- 195, 201, 201, 202, 203, 197, 201, 177,
- 177, 201, 201, 201, 201, 201, 191, 204,
- 179, 204, 195, 196, 203, 197, 177, 177,
- 191, 205, 179, 205, 206, 207, 206, 206,
- 196, 208, 197, 206, 177, 177, 206, 206,
- 206, 206, 206, 191, 209, 184, 209, 206,
- 195, 206, 206, 202, 197, 206, 177, 177,
- 206, 206, 206, 206, 206, 191, 194, 179,
- 194, 196, 191, 191, 177, 209, 184, 209,
- 195, 202, 197, 177, 177, 191, 194, 179,
- 194, 195, 211, 196, 197, 177, 177, 210,
- 210, 210, 191, 194, 179, 194, 195, 213,
- 196, 197, 207, 177, 177, 212, 212, 212,
- 191, 194, 179, 194, 195, 213, 196, 197,
- 207, 177, 177, 214, 214, 214, 191, 194,
- 179, 194, 195, 213, 196, 197, 207, 177,
- 177, 215, 215, 215, 191, 194, 179, 194,
- 195, 213, 196, 197, 207, 177, 177, 191,
- 194, 179, 194, 195, 217, 196, 197, 177,
- 177, 216, 210, 210, 191, 194, 179, 194,
- 195, 218, 213, 196, 197, 207, 177, 177,
- 219, 212, 212, 191, 194, 179, 194, 195,
- 196, 197, 177, 177, 220, 191, 194, 179,
- 194, 195, 221, 196, 197, 177, 177, 222,
- 191, 194, 179, 194, 195, 196, 197, 177,
- 177, 223, 191, 194, 179, 194, 195, 224,
- 196, 197, 177, 177, 225, 191, 194, 179,
- 194, 195, 196, 197, 177, 177, 226, 191,
- 194, 179, 194, 195, 196, 197, 207, 177,
- 177, 227, 191, 194, 179, 194, 195, 196,
- 197, 207, 177, 177, 228, 191, 194, 179,
- 194, 195, 196, 197, 207, 177, 177, 191,
- 194, 179, 194, 195, 224, 196, 197, 177,
- 177, 229, 191, 194, 179, 194, 195, 224,
- 196, 197, 177, 177, 191, 194, 179, 194,
- 195, 221, 196, 197, 177, 177, 230, 191,
- 194, 179, 194, 195, 221, 196, 197, 177,
- 177, 191, 194, 179, 194, 195, 218, 213,
- 196, 197, 207, 177, 177, 231, 214, 214,
- 191, 194, 179, 194, 195, 218, 213, 196,
- 197, 207, 177, 177, 215, 215, 215, 191,
- 194, 179, 194, 195, 233, 196, 197, 207,
- 177, 177, 232, 232, 232, 191, 194, 179,
- 194, 195, 235, 196, 197, 207, 177, 177,
- 234, 234, 234, 191, 194, 179, 194, 195,
- 235, 196, 197, 207, 177, 177, 236, 236,
- 236, 191, 194, 179, 194, 195, 235, 196,
- 197, 207, 177, 177, 237, 237, 237, 191,
- 194, 179, 194, 195, 235, 196, 197, 207,
- 177, 177, 191, 194, 179, 194, 195, 196,
- 197, 177, 177, 238, 232, 232, 191, 194,
- 179, 194, 195, 218, 235, 196, 197, 207,
- 177, 177, 239, 234, 234, 191, 194, 179,
- 194, 195, 218, 235, 196, 197, 207, 177,
- 177, 240, 236, 236, 191, 194, 179, 194,
- 195, 218, 235, 196, 197, 207, 177, 177,
- 237, 237, 237, 191, 194, 179, 194, 195,
- 196, 197, 177, 177, 241, 191, 194, 179,
- 194, 195, 218, 196, 197, 177, 177, 242,
- 191, 194, 179, 194, 195, 218, 196, 197,
- 177, 177, 243, 191, 194, 179, 194, 195,
- 218, 196, 197, 177, 177, 191, 194, 179,
- 194, 195, 217, 196, 197, 177, 177, 191,
- 200, 184, 200, 201, 195, 201, 201, 202,
- 203, 244, 197, 244, 201, 177, 177, 201,
- 201, 201, 201, 201, 191, 200, 184, 200,
- 201, 195, 201, 201, 202, 203, 245, 197,
- 245, 201, 177, 177, 201, 201, 201, 201,
- 201, 191, 246, 184, 246, 201, 195, 201,
- 201, 202, 247, 197, 201, 177, 177, 201,
- 201, 201, 201, 201, 191, 248, 179, 248,
- 195, 196, 247, 197, 177, 177, 191, 249,
- 179, 249, 206, 250, 206, 206, 196, 208,
- 197, 206, 177, 177, 206, 206, 206, 206,
- 206, 191, 209, 184, 209, 251, 195, 251,
- 251, 251, 202, 197, 251, 177, 177, 251,
- 251, 251, 251, 191, 194, 179, 194, 251,
- 195, 251, 251, 251, 252, 196, 253, 197,
- 251, 177, 177, 251, 251, 251, 251, 191,
- 194, 179, 194, 251, 195, 251, 251, 251,
- 196, 197, 251, 177, 177, 251, 251, 251,
- 251, 191, 194, 179, 194, 254, 195, 254,
- 254, 254, 196, 257, 197, 254, 177, 177,
- 254, 255, 256, 254, 256, 191, 194, 179,
- 194, 254, 258, 254, 254, 254, 259, 196,
- 197, 254, 177, 177, 254, 254, 254, 254,
- 191, 260, 261, 260, 262, 177, 263, 264,
- 263, 265, 177, 194, 179, 194, 254, 195,
- 254, 254, 254, 196, 197, 254, 177, 177,
- 254, 254, 254, 254, 191, 194, 179, 194,
- 254, 258, 254, 254, 266, 267, 196, 197,
- 254, 177, 177, 254, 255, 255, 254, 255,
- 191, 194, 179, 194, 254, 258, 254, 254,
- 266, 259, 196, 197, 254, 177, 177, 254,
- 255, 255, 254, 255, 191, 194, 179, 194,
- 254, 195, 254, 254, 254, 196, 197, 254,
- 177, 177, 254, 255, 256, 254, 256, 191,
- 194, 179, 194, 254, 258, 254, 254, 268,
- 269, 196, 197, 254, 177, 177, 254, 256,
- 256, 254, 256, 191, 194, 179, 194, 254,
- 258, 254, 254, 268, 259, 196, 197, 254,
- 177, 177, 254, 256, 256, 254, 256, 191,
- 194, 179, 194, 254, 258, 254, 254, 254,
- 196, 197, 254, 177, 177, 254, 255, 256,
- 254, 256, 191, 194, 179, 194, 195, 271,
- 196, 197, 177, 177, 270, 270, 270, 191,
- 194, 179, 194, 195, 273, 196, 197, 274,
- 177, 177, 272, 272, 272, 191, 194, 179,
- 194, 195, 273, 196, 197, 274, 177, 177,
- 275, 275, 275, 191, 194, 179, 194, 195,
- 273, 196, 197, 274, 177, 177, 276, 276,
- 276, 191, 194, 179, 194, 195, 273, 196,
- 197, 274, 177, 177, 191, 194, 179, 194,
- 195, 278, 196, 197, 177, 177, 277, 270,
- 270, 191, 194, 179, 194, 195, 279, 273,
- 196, 197, 274, 177, 177, 280, 272, 272,
- 191, 194, 179, 194, 195, 196, 197, 177,
- 177, 281, 191, 194, 179, 194, 195, 282,
- 196, 197, 177, 177, 283, 191, 194, 179,
- 194, 195, 196, 197, 177, 177, 284, 191,
- 194, 179, 194, 195, 285, 196, 197, 177,
- 177, 286, 191, 194, 179, 194, 195, 196,
- 197, 177, 177, 287, 191, 194, 179, 194,
- 195, 196, 197, 274, 177, 177, 288, 191,
- 194, 179, 194, 195, 196, 197, 274, 177,
- 177, 289, 191, 194, 179, 194, 195, 196,
- 197, 274, 177, 177, 191, 194, 179, 194,
- 258, 196, 197, 177, 177, 191, 194, 179,
- 194, 195, 285, 196, 197, 177, 177, 290,
- 191, 194, 179, 194, 195, 285, 196, 197,
- 177, 177, 191, 194, 179, 194, 195, 282,
- 196, 197, 177, 177, 291, 191, 194, 179,
- 194, 195, 282, 196, 197, 177, 177, 191,
- 194, 179, 194, 195, 279, 273, 196, 197,
- 274, 177, 177, 292, 275, 275, 191, 194,
- 179, 194, 195, 279, 273, 196, 197, 274,
- 177, 177, 276, 276, 276, 191, 194, 179,
- 194, 195, 294, 196, 197, 274, 177, 177,
- 293, 293, 293, 191, 194, 179, 194, 195,
- 296, 196, 197, 274, 177, 177, 295, 295,
- 295, 191, 194, 179, 194, 195, 296, 196,
- 197, 274, 177, 177, 297, 297, 297, 191,
- 194, 179, 194, 195, 296, 196, 197, 274,
- 177, 177, 298, 298, 298, 191, 194, 179,
- 194, 195, 296, 196, 197, 274, 177, 177,
- 191, 194, 179, 194, 195, 196, 197, 177,
- 177, 299, 293, 293, 191, 194, 179, 194,
- 195, 279, 296, 196, 197, 274, 177, 177,
- 300, 295, 295, 191, 194, 179, 194, 195,
- 279, 296, 196, 197, 274, 177, 177, 301,
- 297, 297, 191, 194, 179, 194, 195, 279,
- 296, 196, 197, 274, 177, 177, 298, 298,
- 298, 191, 194, 179, 194, 195, 196, 197,
- 177, 177, 302, 191, 194, 179, 194, 195,
- 279, 196, 197, 177, 177, 303, 191, 194,
- 179, 194, 195, 279, 196, 197, 177, 177,
- 304, 191, 194, 179, 194, 195, 279, 196,
- 197, 177, 177, 191, 194, 179, 194, 195,
- 278, 196, 197, 177, 177, 191, 178, 179,
- 178, 306, 180, 305, 305, 305, 177, 178,
- 179, 178, 308, 180, 195, 307, 307, 307,
- 177, 178, 179, 178, 308, 180, 195, 309,
- 309, 309, 177, 178, 179, 178, 308, 180,
- 195, 310, 310, 310, 177, 178, 179, 178,
- 308, 180, 195, 177, 178, 179, 178, 312,
- 180, 311, 305, 305, 177, 178, 179, 178,
- 313, 308, 180, 195, 314, 307, 307, 177,
- 178, 179, 178, 180, 315, 177, 178, 179,
- 178, 316, 180, 317, 177, 178, 179, 178,
- 180, 318, 177, 178, 179, 178, 319, 180,
- 320, 177, 178, 179, 178, 180, 321, 177,
- 178, 179, 178, 180, 195, 322, 177, 178,
- 179, 178, 180, 195, 323, 177, 178, 179,
- 178, 180, 195, 177, 178, 179, 178, 319,
- 180, 324, 177, 178, 179, 178, 319, 180,
- 177, 178, 179, 178, 316, 180, 325, 177,
- 178, 179, 178, 316, 180, 177, 178, 179,
- 178, 313, 308, 180, 195, 326, 309, 309,
- 177, 178, 179, 178, 313, 308, 180, 195,
- 310, 310, 310, 177, 178, 179, 178, 328,
- 180, 195, 327, 327, 327, 177, 178, 179,
- 178, 330, 180, 195, 329, 329, 329, 177,
- 178, 179, 178, 330, 180, 195, 331, 331,
- 331, 177, 178, 179, 178, 330, 180, 195,
- 332, 332, 332, 177, 178, 179, 178, 330,
- 180, 195, 177, 178, 179, 178, 180, 333,
- 327, 327, 177, 178, 179, 178, 313, 330,
- 180, 195, 334, 329, 329, 177, 178, 179,
- 178, 313, 330, 180, 195, 335, 331, 331,
- 177, 178, 179, 178, 313, 330, 180, 195,
- 332, 332, 332, 177, 178, 179, 178, 180,
- 336, 177, 178, 179, 178, 313, 180, 337,
- 177, 178, 179, 178, 313, 180, 338, 177,
- 178, 179, 178, 313, 180, 177, 178, 179,
- 178, 312, 180, 177, 183, 184, 183, 185,
- 185, 185, 186, 187, 339, 339, 185, 185,
- 185, 185, 185, 185, 177, 183, 184, 183,
- 185, 185, 185, 186, 187, 340, 340, 185,
- 185, 185, 185, 185, 185, 177, 341, 184,
- 341, 185, 185, 185, 186, 342, 185, 185,
- 185, 185, 185, 185, 177, 343, 179, 343,
- 180, 342, 177, 344, 179, 344, 190, 345,
- 190, 190, 180, 192, 190, 190, 190, 190,
- 190, 190, 177, 346, 346, 1, 347, 347,
- 1, 348, 348, 1, 349, 349, 1, 350,
- 350, 1, 351, 351, 1, 352, 352, 1,
- 353, 1, 354, 354, 1, 0, 0, 1,
- 1, 0
-};
+ static const char _tsip_machine_parser_header_Referred_By_range_lengths[] = {
+ 0, 0, 0, 6, 0, 0, 6, 0,
+ 0, 0, 2, 4, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 5, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 2, 0, 0, 0, 0, 0, 0,
+ 0, 3, 5, 3, 3, 3, 3, 0,
+ 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 0, 1, 0, 3, 3,
+ 3, 3, 3, 3, 0, 3, 3, 3,
+ 3, 1, 1, 1, 0, 0, 5, 5,
+ 5, 0, 0, 0, 0, 5, 0, 0,
+ 5, 0, 0, 0, 6, 6, 7, 6,
+ 0, 0, 6, 7, 7, 7, 7, 7,
+ 7, 5, 5, 5, 5, 2, 5, 5,
+ 3, 3, 3, 3, 3, 3, 3, 2,
+ 2, 3, 2, 3, 2, 5, 5, 5,
+ 5, 5, 5, 2, 5, 5, 5, 5,
+ 3, 3, 3, 2, 2, 5, 5, 0,
+ 0, 0, 2, 0, 0, 0, 3, 4,
+ 0, 0, 0, 5, 5, 0, 5, 5,
+ 1, 0, 6, 6, 1, 6, 6, 2,
+ 1, 4, 4, 4, 4, 1, 4, 4,
+ 2, 2, 2, 2, 2, 2, 2, 1,
+ 2, 1, 2, 1, 4, 4, 4, 4,
+ 4, 4, 1, 4, 4, 4, 4, 2,
+ 2, 2, 1, 1, 6, 6, 6, 1,
+ 6, 5, 5, 5, 6, 5, 0, 0,
+ 5, 6, 6, 6, 6, 6, 6, 4,
+ 4, 4, 4, 1, 4, 4, 2, 2,
+ 2, 2, 2, 2, 2, 1, 1, 2,
+ 1, 2, 1, 4, 4, 4, 4, 4,
+ 4, 1, 4, 4, 4, 4, 2, 2,
+ 2, 1, 1, 3, 3, 3, 3, 0,
+ 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 0, 1, 0, 3, 3,
+ 3, 3, 3, 3, 0, 3, 3, 3,
+ 3, 1, 1, 1, 0, 0, 5, 5,
+ 5, 0, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
-static const short _tsip_machine_parser_header_Referred_By_trans_targs[] = {
- 2, 0, 299, 3, 4, 141, 146, 10,
- 151, 5, 6, 7, 8, 9, 11, 12,
- 11, 13, 14, 15, 15, 16, 17, 309,
- 18, 21, 78, 19, 20, 22, 16, 21,
- 17, 26, 22, 23, 24, 25, 27, 42,
- 33, 43, 28, 29, 30, 31, 32, 34,
- 36, 41, 35, 37, 37, 38, 39, 40,
- 44, 77, 45, 48, 46, 47, 49, 64,
- 50, 62, 51, 52, 60, 53, 54, 58,
- 55, 56, 57, 59, 61, 63, 65, 73,
- 66, 69, 67, 68, 70, 71, 72, 74,
- 75, 76, 79, 80, 81, 85, 81, 82,
- 83, 84, 85, 86, 92, 87, 88, 88,
- 89, 90, 91, 92, 93, 94, 95, 99,
- 102, 105, 96, 98, 97, 16, 17, 97,
- 16, 17, 100, 101, 103, 104, 106, 140,
- 107, 110, 120, 108, 109, 111, 127, 112,
- 125, 113, 114, 123, 115, 116, 121, 117,
- 118, 119, 122, 124, 126, 128, 136, 129,
- 132, 130, 131, 133, 134, 135, 137, 138,
- 139, 142, 144, 141, 143, 7, 10, 143,
- 145, 146, 147, 149, 150, 148, 152, 151,
- 153, 154, 154, 16, 155, 156, 294, 157,
- 16, 156, 155, 158, 157, 158, 159, 160,
- 259, 154, 160, 161, 162, 167, 163, 204,
- 164, 163, 162, 165, 164, 165, 166, 168,
- 169, 160, 170, 203, 171, 174, 172, 173,
- 175, 190, 176, 188, 177, 178, 186, 179,
- 180, 184, 181, 182, 183, 185, 187, 189,
- 191, 199, 192, 195, 193, 194, 196, 197,
- 198, 200, 201, 202, 205, 206, 207, 208,
- 207, 208, 209, 210, 211, 212, 213, 217,
- 220, 223, 214, 216, 215, 16, 155, 215,
- 16, 155, 218, 219, 221, 222, 224, 258,
- 225, 228, 238, 226, 227, 229, 245, 230,
- 243, 231, 232, 241, 233, 234, 239, 235,
- 236, 237, 240, 242, 244, 246, 254, 247,
- 250, 248, 249, 251, 252, 253, 255, 256,
- 257, 260, 293, 261, 264, 262, 263, 265,
- 280, 266, 278, 267, 268, 276, 269, 270,
- 274, 271, 272, 273, 275, 277, 279, 281,
- 289, 282, 285, 283, 284, 286, 287, 288,
- 290, 291, 292, 295, 296, 297, 298, 297,
- 298, 211, 300, 301, 302, 303, 304, 305,
- 306, 307, 308
-};
+ static const short _tsip_machine_parser_header_Referred_By_index_offsets[] = {
+ 0, 0, 5, 9, 25, 27, 30, 46,
+ 48, 51, 55, 58, 67, 71, 72, 74,
+ 79, 81, 96, 98, 101, 115, 130, 136,
+ 138, 141, 146, 161, 163, 166, 181, 183,
+ 186, 190, 197, 199, 202, 207, 212, 214,
+ 217, 221, 225, 239, 244, 250, 256, 262,
+ 265, 270, 277, 279, 282, 284, 287, 289,
+ 292, 295, 297, 300, 302, 305, 307, 314,
+ 321, 327, 333, 339, 345, 348, 352, 359,
+ 366, 373, 375, 378, 381, 383, 385, 402,
+ 419, 434, 440, 442, 445, 450, 465, 467,
+ 470, 485, 487, 490, 494, 510, 528, 546,
+ 563, 568, 573, 589, 607, 625, 642, 660,
+ 678, 695, 706, 718, 730, 742, 751, 762,
+ 775, 783, 792, 800, 809, 817, 826, 835,
+ 843, 850, 859, 867, 876, 884, 897, 910,
+ 922, 934, 946, 958, 967, 977, 990, 1003,
+ 1016, 1024, 1033, 1042, 1050, 1058, 1071, 1085,
+ 1090, 1092, 1095, 1102, 1104, 1107, 1112, 1116,
+ 1125, 1129, 1130, 1135, 1151, 1166, 1172, 1188,
+ 1202, 1211, 1216, 1236, 1255, 1265, 1284, 1302,
+ 1309, 1318, 1331, 1345, 1359, 1373, 1384, 1397,
+ 1412, 1422, 1433, 1443, 1454, 1464, 1475, 1486,
+ 1496, 1507, 1517, 1528, 1538, 1553, 1568, 1582,
+ 1596, 1610, 1624, 1635, 1647, 1662, 1677, 1692,
+ 1702, 1713, 1724, 1734, 1744, 1765, 1786, 1805,
+ 1815, 1834, 1852, 1872, 1890, 1910, 1929, 1934,
+ 1939, 1957, 1977, 1997, 2016, 2036, 2056, 2075,
+ 2088, 2102, 2116, 2130, 2141, 2154, 2169, 2179,
+ 2190, 2200, 2211, 2221, 2232, 2243, 2253, 2262,
+ 2273, 2283, 2294, 2304, 2319, 2334, 2348, 2362,
+ 2376, 2390, 2401, 2413, 2428, 2443, 2458, 2468,
+ 2479, 2490, 2500, 2510, 2519, 2529, 2539, 2549,
+ 2556, 2565, 2576, 2582, 2589, 2595, 2602, 2608,
+ 2615, 2622, 2628, 2635, 2641, 2648, 2654, 2665,
+ 2676, 2686, 2696, 2706, 2716, 2723, 2731, 2742,
+ 2753, 2764, 2770, 2777, 2784, 2790, 2796, 2813,
+ 2830, 2845, 2851, 2867, 2870, 2873, 2876, 2879,
+ 2882, 2885, 2888, 2890, 2893, 2896
+ };
-static const char _tsip_machine_parser_header_Referred_By_trans_actions[] = {
- 0, 0, 0, 0, 0, 1, 1, 0,
- 1, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 3, 0, 0, 0, 11,
- 0, 1, 1, 0, 0, 9, 9, 0,
- 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 9, 0, 0, 0,
- 0, 0, 1, 1, 1, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 22, 22, 22, 7,
- 7, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 1, 1, 19,
- 19, 0, 19, 0, 3, 3, 0, 0,
- 0, 19, 3, 0, 3, 0, 1, 1,
- 19, 0, 19, 0, 3, 3, 0, 0,
- 0, 19, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 19, 0,
- 3, 13, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 25, 25, 16,
- 16, 16, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 19, 0, 3,
- 13, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
+ static const short _tsip_machine_parser_header_Referred_By_indicies[] = {
+ 0, 2, 0, 2, 1, 0, 0, 3,
+ 1, 3, 4, 3, 5, 6, 5, 5,
+ 7, 5, 5, 5, 5, 8, 5, 8,
+ 1, 9, 1, 10, 10, 1, 10, 11,
+ 10, 5, 6, 5, 5, 7, 5, 5,
+ 5, 5, 8, 5, 8, 1, 12, 1,
+ 13, 13, 1, 13, 13, 7, 1, 14,
+ 14, 1, 15, 15, 16, 17, 16, 16,
+ 16, 16, 1, 15, 15, 17, 1, 18,
+ 19, 18, 20, 21, 20, 22, 1, 23,
+ 1, 22, 24, 22, 25, 25, 25, 26,
+ 26, 25, 25, 25, 25, 25, 25, 1,
+ 27, 1, 28, 28, 1, 28, 28, 25,
+ 25, 25, 26, 26, 25, 25, 25, 25,
+ 25, 25, 1, 29, 30, 29, 31, 31,
+ 31, 32, 33, 31, 31, 31, 31, 31,
+ 31, 1, 34, 35, 34, 22, 33, 1,
+ 36, 1, 37, 37, 1, 37, 37, 22,
+ 33, 1, 33, 38, 33, 39, 40, 39,
+ 39, 41, 39, 39, 39, 39, 39, 39,
+ 1, 42, 1, 43, 43, 1, 43, 44,
+ 43, 39, 40, 39, 39, 41, 39, 39,
+ 39, 39, 39, 39, 1, 45, 1, 46,
+ 46, 1, 46, 46, 40, 1, 47, 48,
+ 49, 1, 1, 1, 40, 50, 1, 40,
+ 40, 1, 51, 30, 51, 32, 1, 52,
+ 53, 52, 22, 1, 54, 1, 55, 55,
+ 1, 55, 55, 22, 1, 40, 40, 40,
+ 1, 51, 30, 51, 39, 39, 39, 32,
+ 39, 39, 39, 39, 39, 39, 1, 57,
+ 56, 56, 56, 1, 59, 48, 58, 58,
+ 58, 1, 59, 48, 60, 60, 60, 1,
+ 59, 48, 61, 61, 61, 1, 59, 48,
+ 1, 63, 62, 56, 56, 1, 64, 59,
+ 48, 65, 58, 58, 1, 66, 1, 67,
+ 68, 1, 69, 1, 70, 71, 1, 72,
+ 1, 48, 73, 1, 48, 74, 1, 48,
+ 1, 70, 75, 1, 70, 1, 67, 76,
+ 1, 67, 1, 64, 59, 48, 77, 60,
+ 60, 1, 64, 59, 48, 61, 61, 61,
+ 1, 79, 48, 78, 78, 78, 1, 81,
+ 48, 80, 80, 80, 1, 81, 48, 82,
+ 82, 82, 1, 81, 48, 83, 83, 83,
+ 1, 81, 48, 1, 84, 78, 78, 1,
+ 64, 81, 48, 85, 80, 80, 1, 64,
+ 81, 48, 86, 82, 82, 1, 64, 81,
+ 48, 83, 83, 83, 1, 87, 1, 64,
+ 88, 1, 64, 89, 1, 64, 1, 63,
+ 1, 29, 30, 29, 31, 31, 31, 32,
+ 33, 90, 90, 31, 31, 31, 31, 31,
+ 31, 1, 29, 30, 29, 31, 31, 31,
+ 32, 33, 91, 91, 31, 31, 31, 31,
+ 31, 31, 1, 92, 30, 92, 31, 31,
+ 31, 32, 93, 31, 31, 31, 31, 31,
+ 31, 1, 94, 95, 94, 22, 93, 1,
+ 96, 1, 97, 97, 1, 97, 97, 22,
+ 93, 1, 98, 99, 98, 39, 100, 39,
+ 39, 41, 39, 39, 39, 39, 39, 39,
+ 1, 101, 1, 102, 102, 1, 103, 104,
+ 103, 39, 100, 39, 39, 41, 39, 39,
+ 39, 39, 39, 39, 1, 105, 1, 106,
+ 106, 1, 106, 106, 107, 1, 47, 108,
+ 48, 108, 108, 108, 49, 108, 1, 1,
+ 1, 108, 108, 108, 108, 40, 47, 108,
+ 48, 108, 108, 108, 107, 109, 49, 108,
+ 1, 1, 1, 108, 108, 108, 108, 40,
+ 47, 110, 48, 110, 110, 110, 113, 49,
+ 110, 1, 1, 1, 110, 111, 112, 110,
+ 112, 40, 47, 110, 114, 110, 110, 110,
+ 115, 49, 110, 1, 1, 1, 110, 110,
+ 110, 110, 40, 116, 117, 116, 118, 1,
+ 119, 120, 119, 121, 1, 47, 110, 48,
+ 110, 110, 110, 49, 110, 1, 1, 1,
+ 110, 110, 110, 110, 40, 47, 110, 114,
+ 110, 110, 122, 123, 49, 110, 1, 1,
+ 1, 110, 111, 111, 110, 111, 40, 47,
+ 110, 114, 110, 110, 122, 115, 49, 110,
+ 1, 1, 1, 110, 111, 111, 110, 111,
+ 40, 47, 110, 48, 110, 110, 110, 49,
+ 110, 1, 1, 1, 110, 111, 112, 110,
+ 112, 40, 47, 110, 114, 110, 110, 124,
+ 125, 49, 110, 1, 1, 1, 110, 112,
+ 112, 110, 112, 40, 47, 110, 114, 110,
+ 110, 124, 115, 49, 110, 1, 1, 1,
+ 110, 112, 112, 110, 112, 40, 47, 110,
+ 114, 110, 110, 110, 49, 110, 1, 1,
+ 1, 110, 111, 112, 110, 112, 40, 47,
+ 48, 127, 49, 1, 1, 1, 126, 126,
+ 126, 40, 47, 48, 129, 49, 130, 1,
+ 1, 1, 128, 128, 128, 40, 47, 48,
+ 129, 49, 130, 1, 1, 1, 131, 131,
+ 131, 40, 47, 48, 129, 49, 130, 1,
+ 1, 1, 132, 132, 132, 40, 47, 48,
+ 129, 49, 130, 1, 1, 1, 40, 47,
+ 48, 134, 49, 1, 1, 1, 133, 126,
+ 126, 40, 47, 48, 135, 129, 49, 130,
+ 1, 1, 1, 136, 128, 128, 40, 47,
+ 48, 49, 1, 1, 1, 137, 40, 47,
+ 48, 138, 49, 1, 1, 1, 139, 40,
+ 47, 48, 49, 1, 1, 1, 140, 40,
+ 47, 48, 141, 49, 1, 1, 1, 142,
+ 40, 47, 48, 49, 1, 1, 1, 143,
+ 40, 47, 48, 49, 130, 1, 1, 1,
+ 144, 40, 47, 48, 49, 130, 1, 1,
+ 1, 145, 40, 47, 48, 49, 130, 1,
+ 1, 1, 40, 47, 114, 49, 1, 1,
+ 1, 40, 47, 48, 141, 49, 1, 1,
+ 1, 146, 40, 47, 48, 141, 49, 1,
+ 1, 1, 40, 47, 48, 138, 49, 1,
+ 1, 1, 147, 40, 47, 48, 138, 49,
+ 1, 1, 1, 40, 47, 48, 135, 129,
+ 49, 130, 1, 1, 1, 148, 131, 131,
+ 40, 47, 48, 135, 129, 49, 130, 1,
+ 1, 1, 132, 132, 132, 40, 47, 48,
+ 150, 49, 130, 1, 1, 1, 149, 149,
+ 149, 40, 47, 48, 152, 49, 130, 1,
+ 1, 1, 151, 151, 151, 40, 47, 48,
+ 152, 49, 130, 1, 1, 1, 153, 153,
+ 153, 40, 47, 48, 152, 49, 130, 1,
+ 1, 1, 154, 154, 154, 40, 47, 48,
+ 152, 49, 130, 1, 1, 1, 40, 47,
+ 48, 49, 1, 1, 1, 155, 149, 149,
+ 40, 47, 48, 135, 152, 49, 130, 1,
+ 1, 1, 156, 151, 151, 40, 47, 48,
+ 135, 152, 49, 130, 1, 1, 1, 157,
+ 153, 153, 40, 47, 48, 135, 152, 49,
+ 130, 1, 1, 1, 154, 154, 154, 40,
+ 47, 48, 49, 1, 1, 1, 158, 40,
+ 47, 48, 135, 49, 1, 1, 1, 159,
+ 40, 47, 48, 135, 49, 1, 1, 1,
+ 160, 40, 47, 48, 135, 49, 1, 1,
+ 1, 40, 47, 48, 134, 49, 1, 1,
+ 1, 40, 161, 162, 161, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 1, 164,
+ 165, 164, 163, 163, 163, 166, 163, 163,
+ 163, 163, 163, 163, 1, 167, 11, 167,
+ 7, 1, 168, 1, 161, 161, 1, 170,
+ 171, 172, 1, 1, 1, 169, 173, 1,
+ 169, 169, 1, 164, 165, 164, 166, 1,
+ 169, 169, 169, 1, 174, 174, 175, 176,
+ 175, 175, 175, 175, 1, 174, 174, 176,
+ 1, 177, 178, 179, 178, 180, 177, 180,
+ 179, 180, 181, 181, 181, 180, 182, 182,
+ 181, 181, 181, 181, 181, 181, 177, 183,
+ 184, 183, 185, 185, 185, 186, 187, 185,
+ 185, 185, 185, 185, 185, 177, 188, 179,
+ 188, 180, 187, 177, 189, 179, 189, 190,
+ 191, 190, 190, 180, 192, 190, 190, 190,
+ 190, 190, 190, 177, 193, 184, 193, 190,
+ 190, 190, 186, 190, 190, 190, 190, 190,
+ 190, 177, 194, 179, 194, 195, 196, 197,
+ 177, 177, 191, 193, 184, 193, 186, 177,
+ 196, 179, 196, 198, 195, 198, 198, 196,
+ 199, 197, 199, 198, 177, 177, 198, 198,
+ 198, 198, 198, 191, 200, 184, 200, 201,
+ 195, 201, 201, 202, 203, 197, 201, 177,
+ 177, 201, 201, 201, 201, 201, 191, 204,
+ 179, 204, 195, 196, 203, 197, 177, 177,
+ 191, 205, 179, 205, 206, 207, 206, 206,
+ 196, 208, 197, 206, 177, 177, 206, 206,
+ 206, 206, 206, 191, 209, 184, 209, 206,
+ 195, 206, 206, 202, 197, 206, 177, 177,
+ 206, 206, 206, 206, 206, 191, 194, 179,
+ 194, 196, 191, 191, 177, 209, 184, 209,
+ 195, 202, 197, 177, 177, 191, 194, 179,
+ 194, 195, 211, 196, 197, 177, 177, 210,
+ 210, 210, 191, 194, 179, 194, 195, 213,
+ 196, 197, 207, 177, 177, 212, 212, 212,
+ 191, 194, 179, 194, 195, 213, 196, 197,
+ 207, 177, 177, 214, 214, 214, 191, 194,
+ 179, 194, 195, 213, 196, 197, 207, 177,
+ 177, 215, 215, 215, 191, 194, 179, 194,
+ 195, 213, 196, 197, 207, 177, 177, 191,
+ 194, 179, 194, 195, 217, 196, 197, 177,
+ 177, 216, 210, 210, 191, 194, 179, 194,
+ 195, 218, 213, 196, 197, 207, 177, 177,
+ 219, 212, 212, 191, 194, 179, 194, 195,
+ 196, 197, 177, 177, 220, 191, 194, 179,
+ 194, 195, 221, 196, 197, 177, 177, 222,
+ 191, 194, 179, 194, 195, 196, 197, 177,
+ 177, 223, 191, 194, 179, 194, 195, 224,
+ 196, 197, 177, 177, 225, 191, 194, 179,
+ 194, 195, 196, 197, 177, 177, 226, 191,
+ 194, 179, 194, 195, 196, 197, 207, 177,
+ 177, 227, 191, 194, 179, 194, 195, 196,
+ 197, 207, 177, 177, 228, 191, 194, 179,
+ 194, 195, 196, 197, 207, 177, 177, 191,
+ 194, 179, 194, 195, 224, 196, 197, 177,
+ 177, 229, 191, 194, 179, 194, 195, 224,
+ 196, 197, 177, 177, 191, 194, 179, 194,
+ 195, 221, 196, 197, 177, 177, 230, 191,
+ 194, 179, 194, 195, 221, 196, 197, 177,
+ 177, 191, 194, 179, 194, 195, 218, 213,
+ 196, 197, 207, 177, 177, 231, 214, 214,
+ 191, 194, 179, 194, 195, 218, 213, 196,
+ 197, 207, 177, 177, 215, 215, 215, 191,
+ 194, 179, 194, 195, 233, 196, 197, 207,
+ 177, 177, 232, 232, 232, 191, 194, 179,
+ 194, 195, 235, 196, 197, 207, 177, 177,
+ 234, 234, 234, 191, 194, 179, 194, 195,
+ 235, 196, 197, 207, 177, 177, 236, 236,
+ 236, 191, 194, 179, 194, 195, 235, 196,
+ 197, 207, 177, 177, 237, 237, 237, 191,
+ 194, 179, 194, 195, 235, 196, 197, 207,
+ 177, 177, 191, 194, 179, 194, 195, 196,
+ 197, 177, 177, 238, 232, 232, 191, 194,
+ 179, 194, 195, 218, 235, 196, 197, 207,
+ 177, 177, 239, 234, 234, 191, 194, 179,
+ 194, 195, 218, 235, 196, 197, 207, 177,
+ 177, 240, 236, 236, 191, 194, 179, 194,
+ 195, 218, 235, 196, 197, 207, 177, 177,
+ 237, 237, 237, 191, 194, 179, 194, 195,
+ 196, 197, 177, 177, 241, 191, 194, 179,
+ 194, 195, 218, 196, 197, 177, 177, 242,
+ 191, 194, 179, 194, 195, 218, 196, 197,
+ 177, 177, 243, 191, 194, 179, 194, 195,
+ 218, 196, 197, 177, 177, 191, 194, 179,
+ 194, 195, 217, 196, 197, 177, 177, 191,
+ 200, 184, 200, 201, 195, 201, 201, 202,
+ 203, 244, 197, 244, 201, 177, 177, 201,
+ 201, 201, 201, 201, 191, 200, 184, 200,
+ 201, 195, 201, 201, 202, 203, 245, 197,
+ 245, 201, 177, 177, 201, 201, 201, 201,
+ 201, 191, 246, 184, 246, 201, 195, 201,
+ 201, 202, 247, 197, 201, 177, 177, 201,
+ 201, 201, 201, 201, 191, 248, 179, 248,
+ 195, 196, 247, 197, 177, 177, 191, 249,
+ 179, 249, 206, 250, 206, 206, 196, 208,
+ 197, 206, 177, 177, 206, 206, 206, 206,
+ 206, 191, 209, 184, 209, 251, 195, 251,
+ 251, 251, 202, 197, 251, 177, 177, 251,
+ 251, 251, 251, 191, 194, 179, 194, 251,
+ 195, 251, 251, 251, 252, 196, 253, 197,
+ 251, 177, 177, 251, 251, 251, 251, 191,
+ 194, 179, 194, 251, 195, 251, 251, 251,
+ 196, 197, 251, 177, 177, 251, 251, 251,
+ 251, 191, 194, 179, 194, 254, 195, 254,
+ 254, 254, 196, 257, 197, 254, 177, 177,
+ 254, 255, 256, 254, 256, 191, 194, 179,
+ 194, 254, 258, 254, 254, 254, 259, 196,
+ 197, 254, 177, 177, 254, 254, 254, 254,
+ 191, 260, 261, 260, 262, 177, 263, 264,
+ 263, 265, 177, 194, 179, 194, 254, 195,
+ 254, 254, 254, 196, 197, 254, 177, 177,
+ 254, 254, 254, 254, 191, 194, 179, 194,
+ 254, 258, 254, 254, 266, 267, 196, 197,
+ 254, 177, 177, 254, 255, 255, 254, 255,
+ 191, 194, 179, 194, 254, 258, 254, 254,
+ 266, 259, 196, 197, 254, 177, 177, 254,
+ 255, 255, 254, 255, 191, 194, 179, 194,
+ 254, 195, 254, 254, 254, 196, 197, 254,
+ 177, 177, 254, 255, 256, 254, 256, 191,
+ 194, 179, 194, 254, 258, 254, 254, 268,
+ 269, 196, 197, 254, 177, 177, 254, 256,
+ 256, 254, 256, 191, 194, 179, 194, 254,
+ 258, 254, 254, 268, 259, 196, 197, 254,
+ 177, 177, 254, 256, 256, 254, 256, 191,
+ 194, 179, 194, 254, 258, 254, 254, 254,
+ 196, 197, 254, 177, 177, 254, 255, 256,
+ 254, 256, 191, 194, 179, 194, 195, 271,
+ 196, 197, 177, 177, 270, 270, 270, 191,
+ 194, 179, 194, 195, 273, 196, 197, 274,
+ 177, 177, 272, 272, 272, 191, 194, 179,
+ 194, 195, 273, 196, 197, 274, 177, 177,
+ 275, 275, 275, 191, 194, 179, 194, 195,
+ 273, 196, 197, 274, 177, 177, 276, 276,
+ 276, 191, 194, 179, 194, 195, 273, 196,
+ 197, 274, 177, 177, 191, 194, 179, 194,
+ 195, 278, 196, 197, 177, 177, 277, 270,
+ 270, 191, 194, 179, 194, 195, 279, 273,
+ 196, 197, 274, 177, 177, 280, 272, 272,
+ 191, 194, 179, 194, 195, 196, 197, 177,
+ 177, 281, 191, 194, 179, 194, 195, 282,
+ 196, 197, 177, 177, 283, 191, 194, 179,
+ 194, 195, 196, 197, 177, 177, 284, 191,
+ 194, 179, 194, 195, 285, 196, 197, 177,
+ 177, 286, 191, 194, 179, 194, 195, 196,
+ 197, 177, 177, 287, 191, 194, 179, 194,
+ 195, 196, 197, 274, 177, 177, 288, 191,
+ 194, 179, 194, 195, 196, 197, 274, 177,
+ 177, 289, 191, 194, 179, 194, 195, 196,
+ 197, 274, 177, 177, 191, 194, 179, 194,
+ 258, 196, 197, 177, 177, 191, 194, 179,
+ 194, 195, 285, 196, 197, 177, 177, 290,
+ 191, 194, 179, 194, 195, 285, 196, 197,
+ 177, 177, 191, 194, 179, 194, 195, 282,
+ 196, 197, 177, 177, 291, 191, 194, 179,
+ 194, 195, 282, 196, 197, 177, 177, 191,
+ 194, 179, 194, 195, 279, 273, 196, 197,
+ 274, 177, 177, 292, 275, 275, 191, 194,
+ 179, 194, 195, 279, 273, 196, 197, 274,
+ 177, 177, 276, 276, 276, 191, 194, 179,
+ 194, 195, 294, 196, 197, 274, 177, 177,
+ 293, 293, 293, 191, 194, 179, 194, 195,
+ 296, 196, 197, 274, 177, 177, 295, 295,
+ 295, 191, 194, 179, 194, 195, 296, 196,
+ 197, 274, 177, 177, 297, 297, 297, 191,
+ 194, 179, 194, 195, 296, 196, 197, 274,
+ 177, 177, 298, 298, 298, 191, 194, 179,
+ 194, 195, 296, 196, 197, 274, 177, 177,
+ 191, 194, 179, 194, 195, 196, 197, 177,
+ 177, 299, 293, 293, 191, 194, 179, 194,
+ 195, 279, 296, 196, 197, 274, 177, 177,
+ 300, 295, 295, 191, 194, 179, 194, 195,
+ 279, 296, 196, 197, 274, 177, 177, 301,
+ 297, 297, 191, 194, 179, 194, 195, 279,
+ 296, 196, 197, 274, 177, 177, 298, 298,
+ 298, 191, 194, 179, 194, 195, 196, 197,
+ 177, 177, 302, 191, 194, 179, 194, 195,
+ 279, 196, 197, 177, 177, 303, 191, 194,
+ 179, 194, 195, 279, 196, 197, 177, 177,
+ 304, 191, 194, 179, 194, 195, 279, 196,
+ 197, 177, 177, 191, 194, 179, 194, 195,
+ 278, 196, 197, 177, 177, 191, 178, 179,
+ 178, 306, 180, 305, 305, 305, 177, 178,
+ 179, 178, 308, 180, 195, 307, 307, 307,
+ 177, 178, 179, 178, 308, 180, 195, 309,
+ 309, 309, 177, 178, 179, 178, 308, 180,
+ 195, 310, 310, 310, 177, 178, 179, 178,
+ 308, 180, 195, 177, 178, 179, 178, 312,
+ 180, 311, 305, 305, 177, 178, 179, 178,
+ 313, 308, 180, 195, 314, 307, 307, 177,
+ 178, 179, 178, 180, 315, 177, 178, 179,
+ 178, 316, 180, 317, 177, 178, 179, 178,
+ 180, 318, 177, 178, 179, 178, 319, 180,
+ 320, 177, 178, 179, 178, 180, 321, 177,
+ 178, 179, 178, 180, 195, 322, 177, 178,
+ 179, 178, 180, 195, 323, 177, 178, 179,
+ 178, 180, 195, 177, 178, 179, 178, 319,
+ 180, 324, 177, 178, 179, 178, 319, 180,
+ 177, 178, 179, 178, 316, 180, 325, 177,
+ 178, 179, 178, 316, 180, 177, 178, 179,
+ 178, 313, 308, 180, 195, 326, 309, 309,
+ 177, 178, 179, 178, 313, 308, 180, 195,
+ 310, 310, 310, 177, 178, 179, 178, 328,
+ 180, 195, 327, 327, 327, 177, 178, 179,
+ 178, 330, 180, 195, 329, 329, 329, 177,
+ 178, 179, 178, 330, 180, 195, 331, 331,
+ 331, 177, 178, 179, 178, 330, 180, 195,
+ 332, 332, 332, 177, 178, 179, 178, 330,
+ 180, 195, 177, 178, 179, 178, 180, 333,
+ 327, 327, 177, 178, 179, 178, 313, 330,
+ 180, 195, 334, 329, 329, 177, 178, 179,
+ 178, 313, 330, 180, 195, 335, 331, 331,
+ 177, 178, 179, 178, 313, 330, 180, 195,
+ 332, 332, 332, 177, 178, 179, 178, 180,
+ 336, 177, 178, 179, 178, 313, 180, 337,
+ 177, 178, 179, 178, 313, 180, 338, 177,
+ 178, 179, 178, 313, 180, 177, 178, 179,
+ 178, 312, 180, 177, 183, 184, 183, 185,
+ 185, 185, 186, 187, 339, 339, 185, 185,
+ 185, 185, 185, 185, 177, 183, 184, 183,
+ 185, 185, 185, 186, 187, 340, 340, 185,
+ 185, 185, 185, 185, 185, 177, 341, 184,
+ 341, 185, 185, 185, 186, 342, 185, 185,
+ 185, 185, 185, 185, 177, 343, 179, 343,
+ 180, 342, 177, 344, 179, 344, 190, 345,
+ 190, 190, 180, 192, 190, 190, 190, 190,
+ 190, 190, 177, 346, 346, 1, 347, 347,
+ 1, 348, 348, 1, 349, 349, 1, 350,
+ 350, 1, 351, 351, 1, 352, 352, 1,
+ 353, 1, 354, 354, 1, 0, 0, 1,
+ 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_Referred_By_trans_targs[] = {
+ 2, 0, 299, 3, 4, 141, 146, 10,
+ 151, 5, 6, 7, 8, 9, 11, 12,
+ 11, 13, 14, 15, 15, 16, 17, 309,
+ 18, 21, 78, 19, 20, 22, 16, 21,
+ 17, 26, 22, 23, 24, 25, 27, 42,
+ 33, 43, 28, 29, 30, 31, 32, 34,
+ 36, 41, 35, 37, 37, 38, 39, 40,
+ 44, 77, 45, 48, 46, 47, 49, 64,
+ 50, 62, 51, 52, 60, 53, 54, 58,
+ 55, 56, 57, 59, 61, 63, 65, 73,
+ 66, 69, 67, 68, 70, 71, 72, 74,
+ 75, 76, 79, 80, 81, 85, 81, 82,
+ 83, 84, 85, 86, 92, 87, 88, 88,
+ 89, 90, 91, 92, 93, 94, 95, 99,
+ 102, 105, 96, 98, 97, 16, 17, 97,
+ 16, 17, 100, 101, 103, 104, 106, 140,
+ 107, 110, 120, 108, 109, 111, 127, 112,
+ 125, 113, 114, 123, 115, 116, 121, 117,
+ 118, 119, 122, 124, 126, 128, 136, 129,
+ 132, 130, 131, 133, 134, 135, 137, 138,
+ 139, 142, 144, 141, 143, 7, 10, 143,
+ 145, 146, 147, 149, 150, 148, 152, 151,
+ 153, 154, 154, 16, 155, 156, 294, 157,
+ 16, 156, 155, 158, 157, 158, 159, 160,
+ 259, 154, 160, 161, 162, 167, 163, 204,
+ 164, 163, 162, 165, 164, 165, 166, 168,
+ 169, 160, 170, 203, 171, 174, 172, 173,
+ 175, 190, 176, 188, 177, 178, 186, 179,
+ 180, 184, 181, 182, 183, 185, 187, 189,
+ 191, 199, 192, 195, 193, 194, 196, 197,
+ 198, 200, 201, 202, 205, 206, 207, 208,
+ 207, 208, 209, 210, 211, 212, 213, 217,
+ 220, 223, 214, 216, 215, 16, 155, 215,
+ 16, 155, 218, 219, 221, 222, 224, 258,
+ 225, 228, 238, 226, 227, 229, 245, 230,
+ 243, 231, 232, 241, 233, 234, 239, 235,
+ 236, 237, 240, 242, 244, 246, 254, 247,
+ 250, 248, 249, 251, 252, 253, 255, 256,
+ 257, 260, 293, 261, 264, 262, 263, 265,
+ 280, 266, 278, 267, 268, 276, 269, 270,
+ 274, 271, 272, 273, 275, 277, 279, 281,
+ 289, 282, 285, 283, 284, 286, 287, 288,
+ 290, 291, 292, 295, 296, 297, 298, 297,
+ 298, 211, 300, 301, 302, 303, 304, 305,
+ 306, 307, 308
+ };
+
+ static const char _tsip_machine_parser_header_Referred_By_trans_actions[] = {
+ 0, 0, 0, 0, 0, 1, 1, 0,
+ 1, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 3, 0, 0, 0, 11,
+ 0, 1, 1, 0, 0, 9, 9, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 0, 1, 1, 1, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 22, 22, 22, 7,
+ 7, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 3, 3, 1, 1, 19,
+ 19, 0, 19, 0, 3, 3, 0, 0,
+ 0, 19, 3, 0, 3, 0, 1, 1,
+ 19, 0, 19, 0, 3, 3, 0, 0,
+ 0, 19, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 19, 0,
+ 3, 13, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 25, 25, 25, 16,
+ 16, 16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 19, 0, 3,
+ 13, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Referred_By_start = 1;
+ static const int tsip_machine_parser_header_Referred_By_first_final = 309;
+ static const int tsip_machine_parser_header_Referred_By_error = 0;
-static const int tsip_machine_parser_header_Referred_By_start = 1;
-static const int tsip_machine_parser_header_Referred_By_first_final = 309;
-static const int tsip_machine_parser_header_Referred_By_error = 0;
+ static const int tsip_machine_parser_header_Referred_By_en_main = 1;
-static const int tsip_machine_parser_header_Referred_By_en_main = 1;
+ /* #line 138 "./ragel/tsip_parser_header_Referred_By.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Referred_By_first_final);
+ (void)(tsip_machine_parser_header_Referred_By_error);
+ (void)(tsip_machine_parser_header_Referred_By_en_main);
-/* #line 138 "./ragel/tsip_parser_header_Referred_By.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Referred_By_first_final);
- (void)(tsip_machine_parser_header_Referred_By_error);
- (void)(tsip_machine_parser_header_Referred_By_en_main);
-
-/* #line 1166 "./src/headers/tsip_header_Referred_By.c" */
- {
- cs = tsip_machine_parser_header_Referred_By_start;
- }
+ /* #line 1166 "./src/headers/tsip_header_Referred_By.c" */
+ {
+ cs = tsip_machine_parser_header_Referred_By_start;
+ }
-/* #line 143 "./ragel/tsip_parser_header_Referred_By.rl" */
-
-/* #line 1173 "./src/headers/tsip_header_Referred_By.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
+ /* #line 143 "./ragel/tsip_parser_header_Referred_By.rl" */
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ /* #line 1173 "./src/headers/tsip_header_Referred_By.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Referred_By_trans_keys + _tsip_machine_parser_header_Referred_By_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Referred_By_index_offsets[cs];
+ _keys = _tsip_machine_parser_header_Referred_By_trans_keys + _tsip_machine_parser_header_Referred_By_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Referred_By_index_offsets[cs];
- _klen = _tsip_machine_parser_header_Referred_By_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_header_Referred_By_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _tsip_machine_parser_header_Referred_By_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_header_Referred_By_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Referred_By_indicies[_trans];
- cs = _tsip_machine_parser_header_Referred_By_trans_targs[_trans];
+ _trans = _tsip_machine_parser_header_Referred_By_indicies[_trans];
+ cs = _tsip_machine_parser_header_Referred_By_trans_targs[_trans];
- if ( _tsip_machine_parser_header_Referred_By_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _tsip_machine_parser_header_Referred_By_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _tsip_machine_parser_header_Referred_By_actions + _tsip_machine_parser_header_Referred_By_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 49 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 53 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- if(!r_by->uri) /* Only one URI */{
- int len = (int)(p - tag_start);
- if(r_by && !r_by->uri){
- if((r_by->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && r_by->display_name){
- r_by->uri->display_name = tsk_strdup(r_by->display_name);
- }
- }
- }
- }
- break;
- case 2:
-/* #line 64 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- if(!r_by->display_name){
- TSK_PARSER_SET_STRING(r_by->display_name);
- tsk_strunquote(&r_by->display_name);
- }
- }
- break;
- case 3:
-/* #line 71 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- TSK_PARSER_SET_STRING(r_by->cid);
- }
- break;
- case 4:
-/* #line 75 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(r_by));
- }
- break;
- case 5:
-/* #line 79 "./ragel/tsip_parser_header_Referred_By.rl" */
- {
- }
- break;
-/* #line 1292 "./src/headers/tsip_header_Referred_By.c" */
- }
- }
+ _acts = _tsip_machine_parser_header_Referred_By_actions + _tsip_machine_parser_header_Referred_By_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 49 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 53 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ if(!r_by->uri) { /* Only one URI */
+ int len = (int)(p - tag_start);
+ if(r_by && !r_by->uri) {
+ if((r_by->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && r_by->display_name) {
+ r_by->uri->display_name = tsk_strdup(r_by->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 2:
+ /* #line 64 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ if(!r_by->display_name) {
+ TSK_PARSER_SET_STRING(r_by->display_name);
+ tsk_strunquote(&r_by->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 71 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ TSK_PARSER_SET_STRING(r_by->cid);
+ }
+ break;
+ case 4:
+ /* #line 75 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(r_by));
+ }
+ break;
+ case 5:
+ /* #line 79 "./ragel/tsip_parser_header_Referred_By.rl" */
+ {
+ }
+ break;
+ /* #line 1292 "./src/headers/tsip_header_Referred_By.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 144 "./ragel/tsip_parser_header_Referred_By.rl" */
+
+ if( cs <
+ /* #line 1308 "./src/headers/tsip_header_Referred_By.c" */
+ 309
+ /* #line 145 "./ragel/tsip_parser_header_Referred_By.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Referred-By' header.");
+ TSK_OBJECT_SAFE_FREE(r_by);
+ }
-/* #line 144 "./ragel/tsip_parser_header_Referred_By.rl" */
-
- if( cs <
-/* #line 1308 "./src/headers/tsip_header_Referred_By.c" */
-309
-/* #line 145 "./ragel/tsip_parser_header_Referred_By.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Referred-By' header.");
- TSK_OBJECT_SAFE_FREE(r_by);
- }
-
- return r_by;
+ return r_by;
}
@@ -1327,46 +1338,45 @@ _again:
static tsk_object_t* tsip_header_Referred_By_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Referred_By_t *Referred_By = self;
- if(Referred_By){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
- const char* cid = va_arg(*app, const char*);
+ tsip_header_Referred_By_t *Referred_By = self;
+ if(Referred_By) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+ const char* cid = va_arg(*app, const char*);
- TSIP_HEADER(Referred_By)->type = tsip_htype_Referred_By;
- TSIP_HEADER(Referred_By)->serialize = tsip_header_Referred_By_serialize;
-
- Referred_By->uri = tsk_object_ref((void*)uri);
- Referred_By->cid = tsk_strdup(cid);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Referred_By header.");
- }
- return self;
+ TSIP_HEADER(Referred_By)->type = tsip_htype_Referred_By;
+ TSIP_HEADER(Referred_By)->serialize = tsip_header_Referred_By_serialize;
+
+ Referred_By->uri = tsk_object_ref((void*)uri);
+ Referred_By->cid = tsk_strdup(cid);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Referred_By header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Referred_By_dtor(tsk_object_t *self)
{
- tsip_header_Referred_By_t *Referred_By = self;
- if(Referred_By){
- TSK_FREE(Referred_By->display_name);
- TSK_OBJECT_SAFE_FREE(Referred_By->uri);
- TSK_FREE(Referred_By->cid);
+ tsip_header_Referred_By_t *Referred_By = self;
+ if(Referred_By) {
+ TSK_FREE(Referred_By->display_name);
+ TSK_OBJECT_SAFE_FREE(Referred_By->uri);
+ TSK_FREE(Referred_By->cid);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Referred_By));
- }
- else{
- TSK_DEBUG_ERROR("Null Referred_By header.");
- }
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Referred_By));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Referred_By header.");
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsip_header_Referred_By_def_s =
-{
- sizeof(tsip_header_Referred_By_t),
- tsip_header_Referred_By_ctor,
- tsip_header_Referred_By_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Referred_By_def_s = {
+ sizeof(tsip_header_Referred_By_t),
+ tsip_header_Referred_By_ctor,
+ tsip_header_Referred_By_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Referred_By_def_t = &tsip_header_Referred_By_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Require.c b/tinySIP/src/headers/tsip_header_Require.c
index 6f2e4a1..eab7ac7 100755
--- a/tinySIP/src/headers/tsip_header_Require.c
+++ b/tinySIP/src/headers/tsip_header_Require.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,254 +49,265 @@
tsip_header_Require_t* tsip_header_Require_create(const char* option)
{
- return tsk_object_new(TSIP_HEADER_REQUIRE_VA_ARGS(option));
+ return tsk_object_new(TSIP_HEADER_REQUIRE_VA_ARGS(option));
}
tsip_header_Require_t* tsip_header_Require_create_null()
{
- return tsip_header_Require_create(tsk_null);
+ return tsip_header_Require_create(tsk_null);
}
int tsip_header_Require_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Require_t *Require = (const tsip_header_Require_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Require->options){
- str = item->data;
- if(item == Require->options->head){
- ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- ret = tsk_buffer_append_2(output, ",%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Require_t *Require = (const tsip_header_Require_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Require->options) {
+ str = item->data;
+ if(item == Require->options->head) {
+ ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ ret = tsk_buffer_append_2(output, ",%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Require_t *tsip_header_Require_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Require_t *hdr_require = tsip_header_Require_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 96 "./src/headers/tsip_header_Require.c" */
-static const char _tsip_machine_parser_header_Require_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Require_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 17, 34, 35, 37, 53, 69, 73,
- 74, 76, 79, 80
-};
-
-static const char _tsip_machine_parser_header_Require_trans_keys[] = {
- 82, 114, 69, 101, 81, 113, 85, 117,
- 73, 105, 82, 114, 69, 101, 9, 32,
- 58, 9, 13, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 10, 9, 32, 9, 32, 44, 10,
- 0
-};
-
-static const char _tsip_machine_parser_header_Require_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 3, 7, 1, 2, 6, 8, 4, 1,
- 2, 3, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Require_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 4, 0, 0,
- 0, 0, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Require_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 25, 38, 40, 43, 55, 68, 73,
- 75, 78, 82, 84
-};
-
-static const char _tsip_machine_parser_header_Require_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 7, 7, 8,
- 1, 8, 9, 8, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 1, 11, 1,
- 12, 12, 1, 12, 12, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 1, 13,
- 14, 13, 15, 15, 15, 16, 15, 15,
- 15, 15, 15, 1, 17, 18, 17, 8,
- 1, 19, 1, 20, 20, 1, 20, 20,
- 8, 1, 21, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Require_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 13, 11, 12, 14, 18, 13,
- 9, 14, 15, 16, 17, 19
-};
-
-static const char _tsip_machine_parser_header_Require_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 3, 3, 0,
- 3, 0, 0, 0, 0, 5
-};
-
-static const int tsip_machine_parser_header_Require_start = 1;
-static const int tsip_machine_parser_header_Require_first_final = 19;
-static const int tsip_machine_parser_header_Require_error = 0;
-
-static const int tsip_machine_parser_header_Require_en_main = 1;
-
-
-/* #line 113 "./ragel/tsip_parser_header_Require.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Require_first_final);
- (void)(tsip_machine_parser_header_Require_error);
- (void)(tsip_machine_parser_header_Require_en_main);
-
-/* #line 178 "./src/headers/tsip_header_Require.c" */
- {
- cs = tsip_machine_parser_header_Require_start;
- }
-
-/* #line 118 "./ragel/tsip_parser_header_Require.rl" */
-
-/* #line 185 "./src/headers/tsip_header_Require.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Require_t *hdr_require = tsip_header_Require_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 96 "./src/headers/tsip_header_Require.c" */
+ static const char _tsip_machine_parser_header_Require_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Require_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 17, 34, 35, 37, 53, 69, 73,
+ 74, 76, 79, 80
+ };
+
+ static const char _tsip_machine_parser_header_Require_trans_keys[] = {
+ 82, 114, 69, 101, 81, 113, 85, 117,
+ 73, 105, 82, 114, 69, 101, 9, 32,
+ 58, 9, 13, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 10, 9, 32, 9, 32, 44, 10,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Require_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 3, 7, 1, 2, 6, 8, 4, 1,
+ 2, 3, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Require_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 4, 0, 0,
+ 0, 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Require_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 25, 38, 40, 43, 55, 68, 73,
+ 75, 78, 82, 84
+ };
+
+ static const char _tsip_machine_parser_header_Require_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 7, 7, 8,
+ 1, 8, 9, 8, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 1, 11, 1,
+ 12, 12, 1, 12, 12, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 1, 13,
+ 14, 13, 15, 15, 15, 16, 15, 15,
+ 15, 15, 15, 1, 17, 18, 17, 8,
+ 1, 19, 1, 20, 20, 1, 20, 20,
+ 8, 1, 21, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Require_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 13, 11, 12, 14, 18, 13,
+ 9, 14, 15, 16, 17, 19
+ };
+
+ static const char _tsip_machine_parser_header_Require_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 3, 3, 0,
+ 3, 0, 0, 0, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_Require_start = 1;
+ static const int tsip_machine_parser_header_Require_first_final = 19;
+ static const int tsip_machine_parser_header_Require_error = 0;
+
+ static const int tsip_machine_parser_header_Require_en_main = 1;
+
+
+ /* #line 113 "./ragel/tsip_parser_header_Require.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Require_first_final);
+ (void)(tsip_machine_parser_header_Require_error);
+ (void)(tsip_machine_parser_header_Require_en_main);
+
+ /* #line 178 "./src/headers/tsip_header_Require.c" */
+ {
+ cs = tsip_machine_parser_header_Require_start;
+ }
+
+ /* #line 118 "./ragel/tsip_parser_header_Require.rl" */
+
+ /* #line 185 "./src/headers/tsip_header_Require.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Require_trans_keys + _tsip_machine_parser_header_Require_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Require_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Require_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Require_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Require_trans_keys + _tsip_machine_parser_header_Require_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Require_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Require_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Require_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Require_indicies[_trans];
- cs = _tsip_machine_parser_header_Require_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Require_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Require_actions + _tsip_machine_parser_header_Require_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Require.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Require.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_require->options);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Require.rl" */
- {
- }
- break;
-/* #line 276 "./src/headers/tsip_header_Require.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Require_indicies[_trans];
+ cs = _tsip_machine_parser_header_Require_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Require_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Require_actions + _tsip_machine_parser_header_Require_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Require.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Require.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_require->options);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Require.rl" */
+ {
+ }
+ break;
+ /* #line 276 "./src/headers/tsip_header_Require.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 119 "./ragel/tsip_parser_header_Require.rl" */
-
- if( cs <
-/* #line 292 "./src/headers/tsip_header_Require.c" */
-19
-/* #line 120 "./ragel/tsip_parser_header_Require.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Require' header.");
- TSK_OBJECT_SAFE_FREE(hdr_require);
- }
-
- return hdr_require;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 119 "./ragel/tsip_parser_header_Require.rl" */
+
+ if( cs <
+ /* #line 292 "./src/headers/tsip_header_Require.c" */
+ 19
+ /* #line 120 "./ragel/tsip_parser_header_Require.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Require' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_require);
+ }
+
+ return hdr_require;
}
@@ -311,44 +322,43 @@ _again:
static tsk_object_t* tsip_header_Require_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Require_t *Require = self;
- if(Require){
- const char* option;
-
- TSIP_HEADER(Require)->type = tsip_htype_Require;
- TSIP_HEADER(Require)->serialize = tsip_header_Require_serialize;
-
- if((option = va_arg(*app, const char*))){
- tsk_string_t* string = tsk_string_create(option);
- Require->options = tsk_list_create();
-
- tsk_list_push_back_data(Require->options, ((void**) &string));
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Require header.");
- }
- return self;
+ tsip_header_Require_t *Require = self;
+ if(Require) {
+ const char* option;
+
+ TSIP_HEADER(Require)->type = tsip_htype_Require;
+ TSIP_HEADER(Require)->serialize = tsip_header_Require_serialize;
+
+ if((option = va_arg(*app, const char*))) {
+ tsk_string_t* string = tsk_string_create(option);
+ Require->options = tsk_list_create();
+
+ tsk_list_push_back_data(Require->options, ((void**) &string));
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Require header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Require_dtor(tsk_object_t *self)
{
- tsip_header_Require_t *Require = self;
- if(Require){
- TSK_OBJECT_SAFE_FREE(Require->options);
- }
- else{
- TSK_DEBUG_ERROR("Null Require header.");
- }
-
- return self;
+ tsip_header_Require_t *Require = self;
+ if(Require) {
+ TSK_OBJECT_SAFE_FREE(Require->options);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Require header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Require_def_s =
-{
- sizeof(tsip_header_Require_t),
- tsip_header_Require_ctor,
- tsip_header_Require_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Require_def_s = {
+ sizeof(tsip_header_Require_t),
+ tsip_header_Require_ctor,
+ tsip_header_Require_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Require_def_t = &tsip_header_Require_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Route.c b/tinySIP/src/headers/tsip_header_Route.c
index 02ad312..52178a6 100755
--- a/tinySIP/src/headers/tsip_header_Route.c
+++ b/tinySIP/src/headers/tsip_header_Route.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,446 +50,457 @@
tsip_header_Route_t* tsip_header_Route_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_ROUTE_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_ROUTE_VA_ARGS(uri));
}
tsip_header_Route_t* tsip_header_Route_create_null()
{
- return tsip_header_Route_create(tsk_null);
+ return tsip_header_Route_create(tsk_null);
}
int tsip_header_Route_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Route_t *Route = (const tsip_header_Route_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Route->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- return ret;
- }
-
- return -1;
-}
+ if(header) {
+ const tsip_header_Route_t *Route = (const tsip_header_Route_t *)header;
+ int ret = 0;
-tsip_header_Routes_L_t *tsip_header_Route_parse(const char *data, tsk_size_t size)
-{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Routes_L_t *hdr_routes = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Route_t *curr_route = tsk_null;
-
-
-/* #line 92 "./src/headers/tsip_header_Route.c" */
-static const char _tsip_machine_parser_header_Route_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 1, 0, 2, 4, 5
-};
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Route->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
-static const short _tsip_machine_parser_header_Route_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 13,
- 32, 33, 35, 54, 55, 57, 60, 64,
- 76, 79, 79, 80, 85, 86, 103, 104,
- 106, 122, 140, 146, 147, 149, 154, 173,
- 174, 176, 195, 196, 198, 201, 209, 210,
- 212, 217, 222, 223, 225, 229, 235, 252,
- 259, 267, 275, 283, 285, 292, 301, 303,
- 306, 308, 311, 313, 316, 319, 320, 323,
- 324, 327, 328, 337, 346, 354, 362, 370,
- 378, 380, 386, 395, 404, 413, 415, 418,
- 421, 422, 423, 440, 458, 462, 463, 465,
- 473, 474, 476, 480, 486
-};
-
-static const char _tsip_machine_parser_header_Route_trans_keys[] = {
- 82, 114, 79, 111, 85, 117, 84, 116,
- 69, 101, 9, 32, 58, 9, 13, 32,
- 33, 34, 37, 39, 60, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 60, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 60, 65, 90, 97, 122,
- 9, 32, 43, 58, 45, 46, 48, 57,
- 65, 90, 97, 122, 9, 32, 58, 62,
- 9, 13, 32, 44, 59, 10, 9, 13,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 34, 13, 34, 92, 127, 0, 8, 10,
- 31, 10, 9, 32, 9, 13, 32, 44,
- 59, 9, 13, 32, 44, 59, 10, 9,
- 32, 9, 32, 44, 59, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 44, 59, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 58, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 58, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 46, 48, 57, 46, 46, 48, 57, 46,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 46, 48, 57, 46, 58, 9,
- 13, 32, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 60, 10, 9,
- 32, 13, 34, 92, 127, 0, 8, 10,
- 31, 10, 9, 32, 9, 13, 32, 60,
- 0, 9, 11, 12, 14, 127, 0
-};
+ return ret;
+ }
-static const char _tsip_machine_parser_header_Route_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 3, 9,
- 1, 2, 9, 1, 2, 3, 0, 4,
- 3, 0, 1, 5, 1, 7, 1, 2,
- 6, 10, 6, 1, 2, 5, 9, 1,
- 2, 9, 1, 2, 3, 4, 1, 2,
- 5, 5, 1, 2, 4, 0, 9, 1,
- 2, 2, 2, 2, 1, 3, 0, 1,
- 0, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 2, 2, 2, 2,
- 2, 0, 3, 3, 3, 0, 1, 1,
- 1, 1, 7, 8, 4, 1, 2, 4,
- 1, 2, 4, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Route_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 0, 0, 2, 4,
- 0, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 3, 4, 3,
- 3, 3, 3, 0, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 1, 0, 3, 3, 3, 3, 3, 3,
- 0, 3, 3, 3, 3, 1, 1, 1,
- 0, 0, 5, 5, 0, 0, 0, 2,
- 0, 0, 0, 3, 0
-};
-
-static const short _tsip_machine_parser_header_Route_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 19,
- 34, 36, 39, 54, 56, 59, 63, 66,
- 75, 79, 80, 82, 88, 90, 103, 105,
- 108, 120, 135, 142, 144, 147, 153, 168,
- 170, 173, 188, 190, 193, 197, 204, 206,
- 209, 215, 221, 223, 226, 231, 235, 249,
- 254, 260, 266, 272, 275, 280, 287, 289,
- 292, 294, 297, 299, 302, 305, 307, 310,
- 312, 315, 317, 324, 331, 337, 343, 349,
- 355, 358, 362, 369, 376, 383, 385, 388,
- 391, 393, 395, 408, 422, 427, 429, 432,
- 439, 441, 444, 449, 453
-};
-
-static const char _tsip_machine_parser_header_Route_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 5,
- 5, 6, 1, 7, 8, 7, 9, 10,
- 9, 9, 11, 9, 9, 9, 9, 9,
- 9, 1, 12, 1, 13, 13, 1, 14,
- 15, 14, 9, 10, 9, 9, 11, 9,
- 9, 9, 9, 9, 9, 1, 16, 1,
- 17, 17, 1, 17, 17, 18, 1, 19,
- 19, 1, 20, 20, 21, 22, 21, 21,
- 21, 21, 1, 20, 20, 22, 1, 23,
- 24, 23, 25, 26, 25, 27, 28, 1,
- 29, 1, 28, 30, 28, 31, 31, 31,
- 31, 31, 31, 31, 31, 31, 1, 32,
- 1, 33, 33, 1, 33, 33, 31, 31,
- 31, 31, 31, 31, 31, 31, 31, 1,
- 34, 35, 34, 36, 36, 36, 37, 38,
- 39, 36, 36, 36, 36, 36, 1, 40,
- 41, 40, 6, 28, 39, 1, 42, 1,
- 43, 43, 1, 43, 43, 6, 28, 39,
- 1, 39, 44, 39, 45, 46, 45, 45,
- 47, 45, 45, 45, 45, 45, 45, 1,
- 48, 1, 49, 49, 1, 49, 50, 49,
- 45, 46, 45, 45, 47, 45, 45, 45,
- 45, 45, 45, 1, 51, 1, 52, 52,
- 1, 52, 52, 46, 1, 53, 54, 55,
- 1, 1, 1, 46, 56, 1, 46, 46,
- 1, 57, 35, 57, 37, 38, 1, 58,
- 59, 58, 6, 28, 1, 60, 1, 61,
- 61, 1, 61, 61, 6, 28, 1, 46,
- 46, 46, 1, 57, 35, 57, 45, 45,
- 45, 37, 38, 45, 45, 45, 45, 45,
- 1, 63, 62, 62, 62, 1, 65, 54,
- 64, 64, 64, 1, 65, 54, 66, 66,
- 66, 1, 65, 54, 67, 67, 67, 1,
- 65, 54, 1, 69, 68, 62, 62, 1,
- 70, 65, 54, 71, 64, 64, 1, 72,
- 1, 73, 74, 1, 75, 1, 76, 77,
- 1, 78, 1, 54, 79, 1, 54, 80,
- 1, 54, 1, 76, 81, 1, 76, 1,
- 73, 82, 1, 73, 1, 70, 65, 54,
- 83, 66, 66, 1, 70, 65, 54, 67,
- 67, 67, 1, 85, 54, 84, 84, 84,
- 1, 87, 54, 86, 86, 86, 1, 87,
- 54, 88, 88, 88, 1, 87, 54, 89,
- 89, 89, 1, 87, 54, 1, 90, 84,
- 84, 1, 70, 87, 54, 91, 86, 86,
- 1, 70, 87, 54, 92, 88, 88, 1,
- 70, 87, 54, 89, 89, 89, 1, 93,
- 1, 70, 94, 1, 70, 95, 1, 70,
- 1, 69, 1, 96, 97, 96, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 1,
- 99, 100, 99, 98, 98, 98, 101, 98,
- 98, 98, 98, 98, 98, 1, 102, 103,
- 102, 18, 1, 104, 1, 96, 96, 1,
- 106, 107, 108, 1, 1, 1, 105, 109,
- 1, 105, 105, 1, 99, 100, 99, 101,
- 1, 105, 105, 105, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Route_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 7,
- 8, 82, 87, 14, 9, 10, 10, 11,
- 12, 13, 14, 15, 16, 15, 17, 18,
- 19, 19, 20, 7, 21, 92, 22, 25,
- 23, 24, 26, 20, 25, 7, 21, 30,
- 26, 27, 28, 29, 31, 46, 37, 47,
- 32, 33, 34, 35, 36, 38, 40, 45,
- 39, 41, 41, 42, 43, 44, 48, 81,
- 49, 52, 50, 51, 53, 68, 54, 66,
- 55, 56, 64, 57, 58, 62, 59, 60,
- 61, 63, 65, 67, 69, 77, 70, 73,
- 71, 72, 74, 75, 76, 78, 79, 80,
- 83, 85, 82, 84, 11, 14, 84, 11,
- 86, 87, 88, 90, 91, 89
-};
-
-static const char _tsip_machine_parser_header_Route_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 3,
- 3, 15, 15, 3, 0, 0, 3, 3,
- 0, 0, 0, 1, 0, 0, 0, 0,
- 7, 11, 11, 11, 0, 13, 0, 1,
- 0, 0, 18, 18, 0, 18, 9, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 18, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
+ return -1;
+}
-static const int tsip_machine_parser_header_Route_start = 1;
-static const int tsip_machine_parser_header_Route_first_final = 92;
-static const int tsip_machine_parser_header_Route_error = 0;
-
-static const int tsip_machine_parser_header_Route_en_main = 1;
-
-
-/* #line 152 "./ragel/tsip_parser_header_Route.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Route_first_final);
- (void)(tsip_machine_parser_header_Route_error);
- (void)(tsip_machine_parser_header_Route_en_main);
-
-/* #line 330 "./src/headers/tsip_header_Route.c" */
- {
- cs = tsip_machine_parser_header_Route_start;
- }
-
-/* #line 157 "./ragel/tsip_parser_header_Route.rl" */
-
-/* #line 337 "./src/headers/tsip_header_Route.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+tsip_header_Routes_L_t *tsip_header_Route_parse(const char *data, tsk_size_t size)
+{
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Routes_L_t *hdr_routes = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Route_t *curr_route = tsk_null;
+
+
+ /* #line 92 "./src/headers/tsip_header_Route.c" */
+ static const char _tsip_machine_parser_header_Route_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 1, 0, 2, 4, 5
+ };
+
+ static const short _tsip_machine_parser_header_Route_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 13,
+ 32, 33, 35, 54, 55, 57, 60, 64,
+ 76, 79, 79, 80, 85, 86, 103, 104,
+ 106, 122, 140, 146, 147, 149, 154, 173,
+ 174, 176, 195, 196, 198, 201, 209, 210,
+ 212, 217, 222, 223, 225, 229, 235, 252,
+ 259, 267, 275, 283, 285, 292, 301, 303,
+ 306, 308, 311, 313, 316, 319, 320, 323,
+ 324, 327, 328, 337, 346, 354, 362, 370,
+ 378, 380, 386, 395, 404, 413, 415, 418,
+ 421, 422, 423, 440, 458, 462, 463, 465,
+ 473, 474, 476, 480, 486
+ };
+
+ static const char _tsip_machine_parser_header_Route_trans_keys[] = {
+ 82, 114, 79, 111, 85, 117, 84, 116,
+ 69, 101, 9, 32, 58, 9, 13, 32,
+ 33, 34, 37, 39, 60, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 60, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 60, 65, 90, 97, 122,
+ 9, 32, 43, 58, 45, 46, 48, 57,
+ 65, 90, 97, 122, 9, 32, 58, 62,
+ 9, 13, 32, 44, 59, 10, 9, 13,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 34, 13, 34, 92, 127, 0, 8, 10,
+ 31, 10, 9, 32, 9, 13, 32, 44,
+ 59, 9, 13, 32, 44, 59, 10, 9,
+ 32, 9, 32, 44, 59, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 44, 59, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 58, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 58, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 46, 48, 57, 46, 46, 48, 57, 46,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 46, 48, 57, 46, 58, 9,
+ 13, 32, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 60, 10, 9,
+ 32, 13, 34, 92, 127, 0, 8, 10,
+ 31, 10, 9, 32, 9, 13, 32, 60,
+ 0, 9, 11, 12, 14, 127, 0
+ };
+
+ static const char _tsip_machine_parser_header_Route_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 3, 9,
+ 1, 2, 9, 1, 2, 3, 0, 4,
+ 3, 0, 1, 5, 1, 7, 1, 2,
+ 6, 10, 6, 1, 2, 5, 9, 1,
+ 2, 9, 1, 2, 3, 4, 1, 2,
+ 5, 5, 1, 2, 4, 0, 9, 1,
+ 2, 2, 2, 2, 1, 3, 0, 1,
+ 0, 1, 0, 1, 1, 1, 1, 1,
+ 1, 1, 3, 3, 2, 2, 2, 2,
+ 2, 0, 3, 3, 3, 0, 1, 1,
+ 1, 1, 7, 8, 4, 1, 2, 4,
+ 1, 2, 4, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Route_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 0, 0, 2, 4,
+ 0, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 3, 4, 3,
+ 3, 3, 3, 0, 3, 3, 1, 1,
+ 1, 1, 1, 1, 1, 0, 1, 0,
+ 1, 0, 3, 3, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 1, 1, 1,
+ 0, 0, 5, 5, 0, 0, 0, 2,
+ 0, 0, 0, 3, 0
+ };
+
+ static const short _tsip_machine_parser_header_Route_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 19,
+ 34, 36, 39, 54, 56, 59, 63, 66,
+ 75, 79, 80, 82, 88, 90, 103, 105,
+ 108, 120, 135, 142, 144, 147, 153, 168,
+ 170, 173, 188, 190, 193, 197, 204, 206,
+ 209, 215, 221, 223, 226, 231, 235, 249,
+ 254, 260, 266, 272, 275, 280, 287, 289,
+ 292, 294, 297, 299, 302, 305, 307, 310,
+ 312, 315, 317, 324, 331, 337, 343, 349,
+ 355, 358, 362, 369, 376, 383, 385, 388,
+ 391, 393, 395, 408, 422, 427, 429, 432,
+ 439, 441, 444, 449, 453
+ };
+
+ static const char _tsip_machine_parser_header_Route_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 5,
+ 5, 6, 1, 7, 8, 7, 9, 10,
+ 9, 9, 11, 9, 9, 9, 9, 9,
+ 9, 1, 12, 1, 13, 13, 1, 14,
+ 15, 14, 9, 10, 9, 9, 11, 9,
+ 9, 9, 9, 9, 9, 1, 16, 1,
+ 17, 17, 1, 17, 17, 18, 1, 19,
+ 19, 1, 20, 20, 21, 22, 21, 21,
+ 21, 21, 1, 20, 20, 22, 1, 23,
+ 24, 23, 25, 26, 25, 27, 28, 1,
+ 29, 1, 28, 30, 28, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 1, 32,
+ 1, 33, 33, 1, 33, 33, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 1,
+ 34, 35, 34, 36, 36, 36, 37, 38,
+ 39, 36, 36, 36, 36, 36, 1, 40,
+ 41, 40, 6, 28, 39, 1, 42, 1,
+ 43, 43, 1, 43, 43, 6, 28, 39,
+ 1, 39, 44, 39, 45, 46, 45, 45,
+ 47, 45, 45, 45, 45, 45, 45, 1,
+ 48, 1, 49, 49, 1, 49, 50, 49,
+ 45, 46, 45, 45, 47, 45, 45, 45,
+ 45, 45, 45, 1, 51, 1, 52, 52,
+ 1, 52, 52, 46, 1, 53, 54, 55,
+ 1, 1, 1, 46, 56, 1, 46, 46,
+ 1, 57, 35, 57, 37, 38, 1, 58,
+ 59, 58, 6, 28, 1, 60, 1, 61,
+ 61, 1, 61, 61, 6, 28, 1, 46,
+ 46, 46, 1, 57, 35, 57, 45, 45,
+ 45, 37, 38, 45, 45, 45, 45, 45,
+ 1, 63, 62, 62, 62, 1, 65, 54,
+ 64, 64, 64, 1, 65, 54, 66, 66,
+ 66, 1, 65, 54, 67, 67, 67, 1,
+ 65, 54, 1, 69, 68, 62, 62, 1,
+ 70, 65, 54, 71, 64, 64, 1, 72,
+ 1, 73, 74, 1, 75, 1, 76, 77,
+ 1, 78, 1, 54, 79, 1, 54, 80,
+ 1, 54, 1, 76, 81, 1, 76, 1,
+ 73, 82, 1, 73, 1, 70, 65, 54,
+ 83, 66, 66, 1, 70, 65, 54, 67,
+ 67, 67, 1, 85, 54, 84, 84, 84,
+ 1, 87, 54, 86, 86, 86, 1, 87,
+ 54, 88, 88, 88, 1, 87, 54, 89,
+ 89, 89, 1, 87, 54, 1, 90, 84,
+ 84, 1, 70, 87, 54, 91, 86, 86,
+ 1, 70, 87, 54, 92, 88, 88, 1,
+ 70, 87, 54, 89, 89, 89, 1, 93,
+ 1, 70, 94, 1, 70, 95, 1, 70,
+ 1, 69, 1, 96, 97, 96, 98, 98,
+ 98, 98, 98, 98, 98, 98, 98, 1,
+ 99, 100, 99, 98, 98, 98, 101, 98,
+ 98, 98, 98, 98, 98, 1, 102, 103,
+ 102, 18, 1, 104, 1, 96, 96, 1,
+ 106, 107, 108, 1, 1, 1, 105, 109,
+ 1, 105, 105, 1, 99, 100, 99, 101,
+ 1, 105, 105, 105, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Route_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 7,
+ 8, 82, 87, 14, 9, 10, 10, 11,
+ 12, 13, 14, 15, 16, 15, 17, 18,
+ 19, 19, 20, 7, 21, 92, 22, 25,
+ 23, 24, 26, 20, 25, 7, 21, 30,
+ 26, 27, 28, 29, 31, 46, 37, 47,
+ 32, 33, 34, 35, 36, 38, 40, 45,
+ 39, 41, 41, 42, 43, 44, 48, 81,
+ 49, 52, 50, 51, 53, 68, 54, 66,
+ 55, 56, 64, 57, 58, 62, 59, 60,
+ 61, 63, 65, 67, 69, 77, 70, 73,
+ 71, 72, 74, 75, 76, 78, 79, 80,
+ 83, 85, 82, 84, 11, 14, 84, 11,
+ 86, 87, 88, 90, 91, 89
+ };
+
+ static const char _tsip_machine_parser_header_Route_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 3,
+ 3, 15, 15, 3, 0, 0, 3, 3,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 7, 11, 11, 11, 0, 13, 0, 1,
+ 0, 0, 18, 18, 0, 18, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 18, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Route_start = 1;
+ static const int tsip_machine_parser_header_Route_first_final = 92;
+ static const int tsip_machine_parser_header_Route_error = 0;
+
+ static const int tsip_machine_parser_header_Route_en_main = 1;
+
+
+ /* #line 152 "./ragel/tsip_parser_header_Route.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Route_first_final);
+ (void)(tsip_machine_parser_header_Route_error);
+ (void)(tsip_machine_parser_header_Route_en_main);
+
+ /* #line 330 "./src/headers/tsip_header_Route.c" */
+ {
+ cs = tsip_machine_parser_header_Route_start;
+ }
+
+ /* #line 157 "./ragel/tsip_parser_header_Route.rl" */
+
+ /* #line 337 "./src/headers/tsip_header_Route.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Route_trans_keys + _tsip_machine_parser_header_Route_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Route_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Route_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Route_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Route_trans_keys + _tsip_machine_parser_header_Route_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Route_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Route_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Route_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Route_indicies[_trans];
- cs = _tsip_machine_parser_header_Route_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Route_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Route_actions + _tsip_machine_parser_header_Route_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Route.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Route.rl" */
- {
- if(!curr_route){
- curr_route = tsip_header_Route_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Route.rl" */
- {
- if(curr_route){
- TSK_PARSER_SET_STRING(curr_route->display_name);
- tsk_strunquote(&curr_route->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_Route.rl" */
- {
- if(curr_route && !curr_route->uri){
- int len = (int)(p - tag_start);
- if(curr_route && !curr_route->uri){
- if((curr_route->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_route->display_name){
- curr_route->uri->display_name = tsk_strdup(curr_route->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_Route.rl" */
- {
- if(curr_route){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_Route.rl" */
- {
- if(curr_route){
- tsk_list_push_back_data(hdr_routes, ((void**) &curr_route));
- }
- }
- break;
- case 6:
-/* #line 91 "./ragel/tsip_parser_header_Route.rl" */
- {
- }
- break;
-/* #line 468 "./src/headers/tsip_header_Route.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Route_indicies[_trans];
+ cs = _tsip_machine_parser_header_Route_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Route_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Route_actions + _tsip_machine_parser_header_Route_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ if(!curr_route) {
+ curr_route = tsip_header_Route_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ if(curr_route) {
+ TSK_PARSER_SET_STRING(curr_route->display_name);
+ tsk_strunquote(&curr_route->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ if(curr_route && !curr_route->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_route && !curr_route->uri) {
+ if((curr_route->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_route->display_name) {
+ curr_route->uri->display_name = tsk_strdup(curr_route->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ if(curr_route) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ if(curr_route) {
+ tsk_list_push_back_data(hdr_routes, ((void**) &curr_route));
+ }
+ }
+ break;
+ case 6:
+ /* #line 91 "./ragel/tsip_parser_header_Route.rl" */
+ {
+ }
+ break;
+ /* #line 468 "./src/headers/tsip_header_Route.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 158 "./ragel/tsip_parser_header_Route.rl" */
-
- if( cs <
-/* #line 484 "./src/headers/tsip_header_Route.c" */
-92
-/* #line 159 "./ragel/tsip_parser_header_Route.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Route' header.");
- TSK_OBJECT_SAFE_FREE(curr_route);
- TSK_OBJECT_SAFE_FREE(hdr_routes);
- }
-
- return hdr_routes;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 158 "./ragel/tsip_parser_header_Route.rl" */
+
+ if( cs <
+ /* #line 484 "./src/headers/tsip_header_Route.c" */
+ 92
+ /* #line 159 "./ragel/tsip_parser_header_Route.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Route' header.");
+ TSK_OBJECT_SAFE_FREE(curr_route);
+ TSK_OBJECT_SAFE_FREE(hdr_routes);
+ }
+
+ return hdr_routes;
}
@@ -502,44 +513,43 @@ _again:
static tsk_object_t* tsip_header_Route_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Route_t *Route = self;
- if(Route){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(Route)->type = tsip_htype_Route;
- TSIP_HEADER(Route)->serialize = tsip_header_Route_serialize;
-
- if(uri){
- Route->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Route header.");
- }
- return self;
+ tsip_header_Route_t *Route = self;
+ if(Route) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(Route)->type = tsip_htype_Route;
+ TSIP_HEADER(Route)->serialize = tsip_header_Route_serialize;
+
+ if(uri) {
+ Route->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Route header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Route_dtor(tsk_object_t *self)
{
- tsip_header_Route_t *Route = self;
- if(Route){
- TSK_FREE(Route->display_name);
- TSK_OBJECT_SAFE_FREE(Route->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Route));
- }
- else{
- TSK_DEBUG_ERROR("Null Route header.");
- }
-
- return self;
+ tsip_header_Route_t *Route = self;
+ if(Route) {
+ TSK_FREE(Route->display_name);
+ TSK_OBJECT_SAFE_FREE(Route->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Route));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Route header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Route_def_s =
-{
- sizeof(tsip_header_Route_t),
- tsip_header_Route_ctor,
- tsip_header_Route_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Route_def_s = {
+ sizeof(tsip_header_Route_t),
+ tsip_header_Route_ctor,
+ tsip_header_Route_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Route_def_t = &tsip_header_Route_def_s;
diff --git a/tinySIP/src/headers/tsip_header_SIP_ETag.c b/tinySIP/src/headers/tsip_header_SIP_ETag.c
index f48a26a..99cc923 100755
--- a/tinySIP/src/headers/tsip_header_SIP_ETag.c
+++ b/tinySIP/src/headers/tsip_header_SIP_ETag.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,239 +50,250 @@
tsip_header_SIP_ETag_t* tsip_header_SIP_ETag_create(const char* etag)
{
- return tsk_object_new(TSIP_HEADER_SIP_ETAG_VA_ARGS(etag));
+ return tsk_object_new(TSIP_HEADER_SIP_ETAG_VA_ARGS(etag));
}
tsip_header_SIP_ETag_t* tsip_header_SIP_ETag_create_null()
{
- return tsip_header_SIP_ETag_create(tsk_null);
+ return tsip_header_SIP_ETag_create(tsk_null);
}
int tsip_header_SIP_ETag_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_SIP_ETag_t *SIP_ETag = (const tsip_header_SIP_ETag_t *)header;
- if(SIP_ETag->value){
- return tsk_buffer_append(output, SIP_ETag->value, tsk_strlen(SIP_ETag->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_SIP_ETag_t *SIP_ETag = (const tsip_header_SIP_ETag_t *)header;
+ if(SIP_ETag->value) {
+ return tsk_buffer_append(output, SIP_ETag->value, tsk_strlen(SIP_ETag->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_SIP_ETag_t *tsip_header_SIP_ETag_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_SIP_ETag_t *hdr_etag = tsip_header_SIP_ETag_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 86 "./src/headers/tsip_header_SIP_ETag.c" */
-static const char _tsip_machine_parser_header_SIP_ETag_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 13, 15, 18, 35, 36, 38, 54, 69,
- 70
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_trans_keys[] = {
- 83, 115, 73, 105, 80, 112, 45, 69,
- 101, 84, 116, 65, 97, 71, 103, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 13, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 2,
- 2, 3, 7, 1, 2, 6, 5, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 5, 5, 0,
- 0
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 20, 23, 27, 40, 42, 45, 57, 68,
- 70
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 8,
- 8, 9, 1, 9, 10, 9, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 1,
- 12, 1, 13, 13, 1, 13, 13, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 1, 14, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 1, 16, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 14, 12, 13, 15, 14,
- 16
-};
-
-static const char _tsip_machine_parser_header_SIP_ETag_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 3, 0,
- 5
-};
-
-static const int tsip_machine_parser_header_SIP_ETag_start = 1;
-static const int tsip_machine_parser_header_SIP_ETag_first_final = 16;
-static const int tsip_machine_parser_header_SIP_ETag_error = 0;
-
-static const int tsip_machine_parser_header_SIP_ETag_en_main = 1;
-
-
-/* #line 103 "./ragel/tsip_parser_header_SIP_ETag.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_SIP_ETag_first_final);
- (void)(tsip_machine_parser_header_SIP_ETag_error);
- (void)(tsip_machine_parser_header_SIP_ETag_en_main);
-
-/* #line 164 "./src/headers/tsip_header_SIP_ETag.c" */
- {
- cs = tsip_machine_parser_header_SIP_ETag_start;
- }
-
-/* #line 108 "./ragel/tsip_parser_header_SIP_ETag.rl" */
-
-/* #line 171 "./src/headers/tsip_header_SIP_ETag.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_SIP_ETag_t *hdr_etag = tsip_header_SIP_ETag_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 86 "./src/headers/tsip_header_SIP_ETag.c" */
+ static const char _tsip_machine_parser_header_SIP_ETag_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 13, 15, 18, 35, 36, 38, 54, 69,
+ 70
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_trans_keys[] = {
+ 83, 115, 73, 105, 80, 112, 45, 69,
+ 101, 84, 116, 65, 97, 71, 103, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 13, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 2,
+ 2, 3, 7, 1, 2, 6, 5, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 5, 5, 0,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 20, 23, 27, 40, 42, 45, 57, 68,
+ 70
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 8,
+ 8, 9, 1, 9, 10, 9, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 1,
+ 12, 1, 13, 13, 1, 13, 13, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 1, 14, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 1, 16, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 14, 12, 13, 15, 14,
+ 16
+ };
+
+ static const char _tsip_machine_parser_header_SIP_ETag_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 3, 0,
+ 5
+ };
+
+ static const int tsip_machine_parser_header_SIP_ETag_start = 1;
+ static const int tsip_machine_parser_header_SIP_ETag_first_final = 16;
+ static const int tsip_machine_parser_header_SIP_ETag_error = 0;
+
+ static const int tsip_machine_parser_header_SIP_ETag_en_main = 1;
+
+
+ /* #line 103 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_SIP_ETag_first_final);
+ (void)(tsip_machine_parser_header_SIP_ETag_error);
+ (void)(tsip_machine_parser_header_SIP_ETag_en_main);
+
+ /* #line 164 "./src/headers/tsip_header_SIP_ETag.c" */
+ {
+ cs = tsip_machine_parser_header_SIP_ETag_start;
+ }
+
+ /* #line 108 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+
+ /* #line 171 "./src/headers/tsip_header_SIP_ETag.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_SIP_ETag_trans_keys + _tsip_machine_parser_header_SIP_ETag_key_offsets[cs];
- _trans = _tsip_machine_parser_header_SIP_ETag_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_SIP_ETag_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_SIP_ETag_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_SIP_ETag_trans_keys + _tsip_machine_parser_header_SIP_ETag_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_SIP_ETag_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_SIP_ETag_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_SIP_ETag_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_SIP_ETag_indicies[_trans];
- cs = _tsip_machine_parser_header_SIP_ETag_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_SIP_ETag_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_SIP_ETag_actions + _tsip_machine_parser_header_SIP_ETag_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_SIP_ETag.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_SIP_ETag.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_etag->value);
- }
- break;
- case 2:
-/* #line 59 "./ragel/tsip_parser_header_SIP_ETag.rl" */
- {
- }
- break;
-/* #line 262 "./src/headers/tsip_header_SIP_ETag.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_SIP_ETag_indicies[_trans];
+ cs = _tsip_machine_parser_header_SIP_ETag_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_SIP_ETag_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_SIP_ETag_actions + _tsip_machine_parser_header_SIP_ETag_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_etag->value);
+ }
+ break;
+ case 2:
+ /* #line 59 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+ {
+ }
+ break;
+ /* #line 262 "./src/headers/tsip_header_SIP_ETag.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 109 "./ragel/tsip_parser_header_SIP_ETag.rl" */
-
- if( cs <
-/* #line 278 "./src/headers/tsip_header_SIP_ETag.c" */
-16
-/* #line 110 "./ragel/tsip_parser_header_SIP_ETag.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'SIP-ETag' header.");
- TSK_OBJECT_SAFE_FREE(hdr_etag);
- }
-
- return hdr_etag;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 109 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+
+ if( cs <
+ /* #line 278 "./src/headers/tsip_header_SIP_ETag.c" */
+ 16
+ /* #line 110 "./ragel/tsip_parser_header_SIP_ETag.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'SIP-ETag' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_etag);
+ }
+
+ return hdr_etag;
}
@@ -297,37 +308,36 @@ _again:
static tsk_object_t* tsip_header_SIP_ETag_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_SIP_ETag_t *SIP_ETag = self;
- if(SIP_ETag){
- TSIP_HEADER(SIP_ETag)->type = tsip_htype_SIP_ETag;
- TSIP_HEADER(SIP_ETag)->serialize = tsip_header_SIP_ETag_serialize;
- SIP_ETag->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new SIP_ETag header.");
- }
- return self;
+ tsip_header_SIP_ETag_t *SIP_ETag = self;
+ if(SIP_ETag) {
+ TSIP_HEADER(SIP_ETag)->type = tsip_htype_SIP_ETag;
+ TSIP_HEADER(SIP_ETag)->serialize = tsip_header_SIP_ETag_serialize;
+ SIP_ETag->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SIP_ETag header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_SIP_ETag_dtor(tsk_object_t *self)
{
- tsip_header_SIP_ETag_t *SIP_ETag = self;
- if(SIP_ETag){
- TSK_FREE(SIP_ETag->value);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(SIP_ETag));
- }
- else{
- TSK_DEBUG_ERROR("Null SIP_ETag header.");
- }
-
- return self;
+ tsip_header_SIP_ETag_t *SIP_ETag = self;
+ if(SIP_ETag) {
+ TSK_FREE(SIP_ETag->value);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(SIP_ETag));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SIP_ETag header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_SIP_ETag_def_s =
-{
- sizeof(tsip_header_SIP_ETag_t),
- tsip_header_SIP_ETag_ctor,
- tsip_header_SIP_ETag_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_SIP_ETag_def_s = {
+ sizeof(tsip_header_SIP_ETag_t),
+ tsip_header_SIP_ETag_ctor,
+ tsip_header_SIP_ETag_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_SIP_ETag_def_t = &tsip_header_SIP_ETag_def_s;
diff --git a/tinySIP/src/headers/tsip_header_SIP_If_Match.c b/tinySIP/src/headers/tsip_header_SIP_If_Match.c
index 9bcc1c1..29ca3b3 100755
--- a/tinySIP/src/headers/tsip_header_SIP_If_Match.c
+++ b/tinySIP/src/headers/tsip_header_SIP_If_Match.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,242 +51,253 @@
tsip_header_SIP_If_Match_t* tsip_header_SIP_If_Match_create(const char* etag)
{
- return tsk_object_new(TSIP_HEADER_SIP_IF_MATCH_VA_ARGS(etag));
+ return tsk_object_new(TSIP_HEADER_SIP_IF_MATCH_VA_ARGS(etag));
}
tsip_header_SIP_If_Match_t* tsip_header_SIP_If_Match_create_null()
{
- return tsip_header_SIP_If_Match_create(tsk_null);
+ return tsip_header_SIP_If_Match_create(tsk_null);
}
int tsip_header_SIP_If_Match_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_SIP_If_Match_t *SIP_If_Match = (const tsip_header_SIP_If_Match_t *)header;
- if(SIP_If_Match->value){
- return tsk_buffer_append(output, SIP_If_Match->value, tsk_strlen(SIP_If_Match->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_SIP_If_Match_t *SIP_If_Match = (const tsip_header_SIP_If_Match_t *)header;
+ if(SIP_If_Match->value) {
+ return tsk_buffer_append(output, SIP_If_Match->value, tsk_strlen(SIP_If_Match->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_SIP_If_Match_t *tsip_header_SIP_If_Match_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_SIP_If_Match_t *hdr_ifmatch = tsip_header_SIP_If_Match_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 87 "./src/headers/tsip_header_SIP_If_Match.c" */
-static const char _tsip_machine_parser_header_SIP_If_Match_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_key_offsets[] = {
- 0, 0, 2, 4, 6, 7, 9, 11,
- 12, 14, 16, 18, 20, 22, 25, 42,
- 43, 45, 61, 76, 77
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_trans_keys[] = {
- 83, 115, 73, 105, 80, 112, 45, 73,
- 105, 70, 102, 45, 77, 109, 65, 97,
- 84, 116, 67, 99, 72, 104, 9, 32,
- 58, 9, 13, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 13, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_single_lengths[] = {
- 0, 2, 2, 2, 1, 2, 2, 1,
- 2, 2, 2, 2, 2, 3, 7, 1,
- 2, 6, 5, 1, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 0,
- 0, 5, 5, 0, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_index_offsets[] = {
- 0, 0, 3, 6, 9, 11, 14, 17,
- 19, 22, 25, 28, 31, 34, 38, 51,
- 53, 56, 68, 79, 81
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 1, 8, 8, 1, 9, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 12, 12, 13, 1, 13, 14,
- 13, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 1, 16, 1, 17, 17, 1,
- 17, 17, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 1, 18, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 1, 20,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 18,
- 16, 17, 19, 18, 20
-};
-
-static const char _tsip_machine_parser_header_SIP_If_Match_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 3, 0, 5
-};
-
-static const int tsip_machine_parser_header_SIP_If_Match_start = 1;
-static const int tsip_machine_parser_header_SIP_If_Match_first_final = 20;
-static const int tsip_machine_parser_header_SIP_If_Match_error = 0;
-
-static const int tsip_machine_parser_header_SIP_If_Match_en_main = 1;
-
-
-/* #line 104 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_SIP_If_Match_first_final);
- (void)(tsip_machine_parser_header_SIP_If_Match_error);
- (void)(tsip_machine_parser_header_SIP_If_Match_en_main);
-
-/* #line 168 "./src/headers/tsip_header_SIP_If_Match.c" */
- {
- cs = tsip_machine_parser_header_SIP_If_Match_start;
- }
-
-/* #line 109 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
-
-/* #line 175 "./src/headers/tsip_header_SIP_If_Match.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_SIP_If_Match_t *hdr_ifmatch = tsip_header_SIP_If_Match_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 87 "./src/headers/tsip_header_SIP_If_Match.c" */
+ static const char _tsip_machine_parser_header_SIP_If_Match_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_key_offsets[] = {
+ 0, 0, 2, 4, 6, 7, 9, 11,
+ 12, 14, 16, 18, 20, 22, 25, 42,
+ 43, 45, 61, 76, 77
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_trans_keys[] = {
+ 83, 115, 73, 105, 80, 112, 45, 73,
+ 105, 70, 102, 45, 77, 109, 65, 97,
+ 84, 116, 67, 99, 72, 104, 9, 32,
+ 58, 9, 13, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 13, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_single_lengths[] = {
+ 0, 2, 2, 2, 1, 2, 2, 1,
+ 2, 2, 2, 2, 2, 3, 7, 1,
+ 2, 6, 5, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 5, 5, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_index_offsets[] = {
+ 0, 0, 3, 6, 9, 11, 14, 17,
+ 19, 22, 25, 28, 31, 34, 38, 51,
+ 53, 56, 68, 79, 81
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 1, 8, 8, 1, 9, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 12, 12, 13, 1, 13, 14,
+ 13, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 1, 16, 1, 17, 17, 1,
+ 17, 17, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 1, 18, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 1, 20,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 18,
+ 16, 17, 19, 18, 20
+ };
+
+ static const char _tsip_machine_parser_header_SIP_If_Match_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 3, 0, 5
+ };
+
+ static const int tsip_machine_parser_header_SIP_If_Match_start = 1;
+ static const int tsip_machine_parser_header_SIP_If_Match_first_final = 20;
+ static const int tsip_machine_parser_header_SIP_If_Match_error = 0;
+
+ static const int tsip_machine_parser_header_SIP_If_Match_en_main = 1;
+
+
+ /* #line 104 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_SIP_If_Match_first_final);
+ (void)(tsip_machine_parser_header_SIP_If_Match_error);
+ (void)(tsip_machine_parser_header_SIP_If_Match_en_main);
+
+ /* #line 168 "./src/headers/tsip_header_SIP_If_Match.c" */
+ {
+ cs = tsip_machine_parser_header_SIP_If_Match_start;
+ }
+
+ /* #line 109 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+
+ /* #line 175 "./src/headers/tsip_header_SIP_If_Match.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_SIP_If_Match_trans_keys + _tsip_machine_parser_header_SIP_If_Match_key_offsets[cs];
- _trans = _tsip_machine_parser_header_SIP_If_Match_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_SIP_If_Match_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_SIP_If_Match_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_SIP_If_Match_trans_keys + _tsip_machine_parser_header_SIP_If_Match_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_SIP_If_Match_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_SIP_If_Match_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_SIP_If_Match_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_SIP_If_Match_indicies[_trans];
- cs = _tsip_machine_parser_header_SIP_If_Match_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_SIP_If_Match_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_SIP_If_Match_actions + _tsip_machine_parser_header_SIP_If_Match_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_ifmatch->value);
- }
- break;
- case 2:
-/* #line 59 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
- {
- }
- break;
-/* #line 266 "./src/headers/tsip_header_SIP_If_Match.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_SIP_If_Match_indicies[_trans];
+ cs = _tsip_machine_parser_header_SIP_If_Match_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_SIP_If_Match_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_SIP_If_Match_actions + _tsip_machine_parser_header_SIP_If_Match_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_ifmatch->value);
+ }
+ break;
+ case 2:
+ /* #line 59 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+ {
+ }
+ break;
+ /* #line 266 "./src/headers/tsip_header_SIP_If_Match.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 110 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
-
- if( cs <
-/* #line 282 "./src/headers/tsip_header_SIP_If_Match.c" */
-20
-/* #line 111 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'SIP-If-Match' header.");
- TSK_OBJECT_SAFE_FREE(hdr_ifmatch);
- }
-
- return hdr_ifmatch;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 110 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+
+ if( cs <
+ /* #line 282 "./src/headers/tsip_header_SIP_If_Match.c" */
+ 20
+ /* #line 111 "./ragel/tsip_parser_header_SIP_If_Match.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'SIP-If-Match' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_ifmatch);
+ }
+
+ return hdr_ifmatch;
}
@@ -301,38 +312,37 @@ _again:
static tsk_object_t* tsip_header_SIP_If_Match_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_SIP_If_Match_t *SIP_If_Match = self;
- if(SIP_If_Match){
- TSIP_HEADER(SIP_If_Match)->type = tsip_htype_SIP_If_Match;
- TSIP_HEADER(SIP_If_Match)->serialize = tsip_header_SIP_If_Match_serialize;
- SIP_If_Match->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new SIP_If_Match header.");
- }
- return self;
+ tsip_header_SIP_If_Match_t *SIP_If_Match = self;
+ if(SIP_If_Match) {
+ TSIP_HEADER(SIP_If_Match)->type = tsip_htype_SIP_If_Match;
+ TSIP_HEADER(SIP_If_Match)->serialize = tsip_header_SIP_If_Match_serialize;
+ SIP_If_Match->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SIP_If_Match header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_SIP_If_Match_dtor(tsk_object_t *self)
{
- tsip_header_SIP_If_Match_t *SIP_If_Match = self;
- if(SIP_If_Match){
- TSK_FREE(SIP_If_Match->value);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(SIP_If_Match));
- }
- else{
- TSK_DEBUG_ERROR("Null SIP_If_Match header.");
- }
-
- return self;
+ tsip_header_SIP_If_Match_t *SIP_If_Match = self;
+ if(SIP_If_Match) {
+ TSK_FREE(SIP_If_Match->value);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(SIP_If_Match));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SIP_If_Match header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_SIP_If_Match_def_s =
-{
- sizeof(tsip_header_SIP_If_Match_t),
- tsip_header_SIP_If_Match_ctor,
- tsip_header_SIP_If_Match_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_SIP_If_Match_def_s = {
+ sizeof(tsip_header_SIP_If_Match_t),
+ tsip_header_SIP_If_Match_ctor,
+ tsip_header_SIP_If_Match_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_SIP_If_Match_def_t = &tsip_header_SIP_If_Match_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Security_Client.c b/tinySIP/src/headers/tsip_header_Security_Client.c
index 4f5c47e..ec405f6 100755
--- a/tinySIP/src/headers/tsip_header_Security_Client.c
+++ b/tinySIP/src/headers/tsip_header_Security_Client.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,852 +50,863 @@
tsip_header_Security_Client_t* tsip_header_Security_Client_create(const char* mech, const char* alg, const char* prot, const char* mod, const char* ealg, tnet_port_t port_c, tnet_port_t port_s, uint32_t spi_c, uint32_t spi_s)
{
- return tsk_object_new(TSIP_HEADER_SECURITY_CLIENT_VA_ARGS(mech, alg, prot, mod, ealg, port_c, port_s, spi_c, spi_s));
+ return tsk_object_new(TSIP_HEADER_SECURITY_CLIENT_VA_ARGS(mech, alg, prot, mod, ealg, port_c, port_s, spi_c, spi_s));
}
tsip_header_Security_Client_t* tsip_header_Security_Client_create_null()
{
- return tsip_header_Security_Client_create(tsk_null, tsk_null, tsk_null, tsk_null, tsk_null, 0, 0, 0, 0);
+ return tsip_header_Security_Client_create(tsk_null, tsk_null, tsk_null, tsk_null, tsk_null, 0, 0, 0, 0);
}
int tsip_header_Security_Client_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Security_Client_t *Security_Client = (const tsip_header_Security_Client_t *)header;
- int ret = 0;
-
- // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; mod=trans; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
- if(tsk_striequals(Security_Client->mech, "ipsec-3gpp")){
- ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
- Security_Client->mech,
-
- Security_Client->alg ? ";alg=" : "",
- Security_Client->alg ? Security_Client->alg : "",
-
- Security_Client->ealg ? ";ealg=" : "",
- Security_Client->ealg ? Security_Client->ealg : "",
-
- Security_Client->prot ? ";prot=" : "",
- Security_Client->prot ? Security_Client->prot : "",
-
- Security_Client->prot ? ";mod=" : "",
- Security_Client->prot ? Security_Client->mod : "",
-
- Security_Client->spi_c,
- Security_Client->spi_s,
- Security_Client->port_c,
- Security_Client->port_s
- );
- }
- else if(Security_Client->mech){
- ret = tsk_buffer_append(output, Security_Client->mech, tsk_strlen(Security_Client->mech));
- }
-
- if(Security_Client->q >= 0){
- /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
- ret = tsk_buffer_append_2(output, ";q=%1.3f", Security_Client->q);
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Security_Client_t *Security_Client = (const tsip_header_Security_Client_t *)header;
+ int ret = 0;
+
+ // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; mod=trans; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
+ if(tsk_striequals(Security_Client->mech, "ipsec-3gpp")) {
+ ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
+ Security_Client->mech,
+
+ Security_Client->alg ? ";alg=" : "",
+ Security_Client->alg ? Security_Client->alg : "",
+
+ Security_Client->ealg ? ";ealg=" : "",
+ Security_Client->ealg ? Security_Client->ealg : "",
+
+ Security_Client->prot ? ";prot=" : "",
+ Security_Client->prot ? Security_Client->prot : "",
+
+ Security_Client->prot ? ";mod=" : "",
+ Security_Client->prot ? Security_Client->mod : "",
+
+ Security_Client->spi_c,
+ Security_Client->spi_s,
+ Security_Client->port_c,
+ Security_Client->port_s
+ );
+ }
+ else if(Security_Client->mech) {
+ ret = tsk_buffer_append(output, Security_Client->mech, tsk_strlen(Security_Client->mech));
+ }
+
+ if(Security_Client->q >= 0) {
+ /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
+ ret = tsk_buffer_append_2(output, ";q=%1.3f", Security_Client->q);
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Security_Clients_L_t *tsip_header_Security_Client_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Security_Clients_L_t *hdr_securityclients = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Security_Client_t *curr_securityclient = tsk_null;
-
-
-/* #line 116 "./src/headers/tsip_header_Security_Client.c" */
-static const char _tsip_machine_parser_header_Security_Client_actions[] = {
- 0, 1, 0, 1, 3, 1, 4, 1,
- 5, 1, 6, 1, 7, 1, 8, 1,
- 9, 1, 10, 1, 11, 1, 12, 1,
- 13, 2, 1, 0, 2, 3, 2, 2,
- 4, 2, 2, 5, 2, 2, 6, 2,
- 2, 7, 2, 2, 8, 2, 2, 9,
- 2, 2, 10, 2, 2, 11, 2, 2,
- 12, 2
-};
-
-static const short _tsip_machine_parser_header_Security_Client_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 17, 19, 21, 23, 25, 27,
- 29, 32, 49, 50, 52, 68, 85, 90,
- 91, 93, 97, 124, 125, 127, 153, 171,
- 177, 178, 180, 185, 204, 205, 207, 226,
- 227, 229, 232, 240, 241, 243, 248, 249,
- 255, 272, 279, 287, 295, 303, 305, 312,
- 321, 323, 326, 328, 331, 333, 336, 339,
- 340, 343, 344, 347, 348, 357, 366, 374,
- 382, 390, 398, 400, 406, 415, 424, 433,
- 435, 438, 441, 442, 443, 463, 483, 501,
- 507, 508, 510, 515, 534, 535, 537, 556,
- 573, 593, 613, 633, 651, 657, 658, 660,
- 665, 684, 685, 687, 706, 723, 745, 765,
- 785, 804, 826, 844, 850, 851, 853, 858,
- 877, 878, 880, 899, 906, 924, 930, 931,
- 933, 938, 957, 958, 960, 979, 986, 1006,
- 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
- 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
- 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
- 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
- 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
- 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
- 1461, 1462, 1464, 1483, 1490
-};
-
-static const char _tsip_machine_parser_header_Security_Client_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 85, 117,
- 82, 114, 73, 105, 84, 116, 89, 121,
- 45, 67, 99, 76, 108, 73, 105, 69,
- 101, 78, 110, 84, 116, 9, 32, 58,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 10, 9, 32, 9, 32, 44,
- 59, 9, 13, 32, 33, 37, 39, 65,
- 69, 80, 81, 83, 97, 101, 112, 113,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 65, 69, 80, 81,
- 83, 97, 101, 112, 113, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 44, 59,
- 10, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 44, 59, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 76, 108, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 71, 103, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 61, 10, 9, 32, 9, 32,
- 44, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 65, 97,
- 126, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 71, 103,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 79, 82, 111, 114,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 82, 114, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 84, 116,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 61, 84,
- 116, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 10, 9, 32, 9,
- 32, 44, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 59, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 48, 57, 9, 13, 32, 44,
- 59, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 48, 59, 9, 13, 32,
- 44, 48, 59, 9, 13, 32, 44, 48,
- 59, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 80, 112, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Client_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 2, 2,
- 3, 7, 1, 2, 6, 9, 5, 1,
- 2, 4, 17, 1, 2, 16, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 5, 1, 0,
- 9, 1, 2, 2, 2, 2, 1, 3,
- 0, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 12, 12, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 9,
- 12, 12, 12, 10, 6, 1, 2, 5,
- 9, 1, 2, 9, 9, 14, 12, 12,
- 11, 14, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 10, 6, 1, 2,
- 5, 9, 1, 2, 9, 5, 12, 12,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 9, 10, 6, 1, 2, 5, 11,
- 1, 2, 11, 6, 5, 5, 5, 5,
- 6, 6, 6, 6, 12, 12, 11, 14,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 5, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Client_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 3,
- 4, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 4, 4, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 4,
- 4, 4, 4, 4, 0, 0, 0, 0,
- 5, 0, 0, 5, 4, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 4, 0, 0, 0,
- 0, 5, 0, 0, 5, 1, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 4, 4, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 1, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 0
-};
-
-static const short _tsip_machine_parser_header_Security_Client_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 24, 26, 29, 32, 35, 38, 41,
- 44, 48, 61, 63, 66, 78, 92, 98,
- 100, 103, 108, 131, 133, 136, 158, 173,
- 180, 182, 185, 191, 206, 208, 211, 226,
- 228, 231, 235, 242, 244, 247, 253, 255,
- 259, 273, 278, 284, 290, 296, 299, 304,
- 311, 313, 316, 318, 321, 323, 326, 329,
- 331, 334, 336, 339, 341, 348, 355, 361,
- 367, 373, 379, 382, 386, 393, 400, 407,
- 409, 412, 415, 417, 419, 436, 453, 468,
- 475, 477, 480, 486, 501, 503, 506, 521,
- 535, 552, 569, 586, 601, 608, 610, 613,
- 619, 634, 636, 639, 654, 668, 687, 704,
- 721, 737, 756, 771, 778, 780, 783, 789,
- 804, 806, 809, 824, 831, 846, 853, 855,
- 858, 864, 879, 881, 884, 899, 906, 923,
- 940, 955, 962, 964, 967, 973, 988, 990,
- 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
- 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
- 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
- 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
- 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
- 1348, 1350, 1353, 1368, 1375
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Client_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 8, 1,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 15, 1, 15, 15, 16, 1,
- 16, 17, 16, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 1, 19, 1, 20,
- 20, 1, 20, 20, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 1, 21, 22,
- 21, 23, 23, 23, 24, 25, 23, 23,
- 23, 23, 23, 1, 26, 27, 26, 16,
- 28, 1, 29, 1, 30, 30, 1, 30,
- 30, 16, 28, 1, 28, 31, 28, 32,
- 32, 32, 33, 34, 35, 36, 37, 33,
- 34, 35, 36, 37, 32, 32, 32, 32,
- 32, 32, 1, 38, 1, 39, 39, 1,
- 39, 39, 32, 32, 32, 33, 34, 35,
- 36, 37, 33, 34, 35, 36, 37, 32,
- 32, 32, 32, 32, 32, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 42,
- 42, 42, 42, 42, 1, 46, 47, 46,
- 16, 28, 45, 1, 48, 1, 49, 49,
- 1, 49, 49, 16, 28, 45, 1, 45,
- 50, 45, 51, 52, 51, 51, 53, 51,
- 51, 51, 51, 51, 51, 1, 54, 1,
- 55, 55, 1, 55, 56, 55, 51, 52,
- 51, 51, 53, 51, 51, 51, 51, 51,
- 51, 1, 57, 1, 58, 58, 1, 58,
- 58, 52, 1, 59, 60, 61, 1, 1,
- 1, 52, 62, 1, 52, 52, 1, 63,
- 41, 63, 43, 44, 1, 64, 1, 52,
- 52, 52, 1, 63, 41, 63, 51, 51,
- 51, 43, 44, 51, 51, 51, 51, 51,
- 1, 66, 65, 65, 65, 1, 68, 60,
- 67, 67, 67, 1, 68, 60, 69, 69,
- 69, 1, 68, 60, 70, 70, 70, 1,
- 68, 60, 1, 72, 71, 65, 65, 1,
- 73, 68, 60, 74, 67, 67, 1, 75,
- 1, 76, 77, 1, 78, 1, 79, 80,
- 1, 81, 1, 60, 82, 1, 60, 83,
- 1, 60, 1, 79, 84, 1, 79, 1,
- 76, 85, 1, 76, 1, 73, 68, 60,
- 86, 69, 69, 1, 73, 68, 60, 70,
- 70, 70, 1, 88, 60, 87, 87, 87,
- 1, 90, 60, 89, 89, 89, 1, 90,
- 60, 91, 91, 91, 1, 90, 60, 92,
- 92, 92, 1, 90, 60, 1, 93, 87,
- 87, 1, 73, 90, 60, 94, 89, 89,
- 1, 73, 90, 60, 95, 91, 91, 1,
- 73, 90, 60, 92, 92, 92, 1, 96,
- 1, 73, 97, 1, 73, 98, 1, 73,
- 1, 72, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 99, 99, 42, 42,
- 42, 42, 42, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 100, 100, 42,
- 42, 42, 42, 42, 1, 101, 41, 101,
- 42, 42, 42, 43, 44, 102, 42, 42,
- 42, 42, 42, 1, 103, 104, 103, 16,
- 28, 102, 1, 105, 1, 106, 106, 1,
- 106, 106, 16, 28, 102, 1, 102, 107,
- 102, 108, 52, 108, 108, 53, 108, 108,
- 108, 108, 108, 108, 1, 109, 1, 110,
- 110, 1, 110, 56, 110, 108, 52, 108,
- 108, 53, 108, 108, 108, 108, 108, 108,
- 1, 111, 112, 111, 113, 113, 113, 114,
- 115, 113, 113, 113, 113, 113, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 116, 116, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 117, 117, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 118, 118, 42, 42, 42, 42,
- 42, 1, 119, 41, 119, 42, 42, 42,
- 43, 44, 120, 42, 42, 42, 42, 42,
- 1, 121, 122, 121, 16, 28, 120, 1,
- 123, 1, 124, 124, 1, 124, 124, 16,
- 28, 120, 1, 120, 125, 120, 126, 52,
- 126, 126, 53, 126, 126, 126, 126, 126,
- 126, 1, 127, 1, 128, 128, 1, 128,
- 56, 128, 126, 52, 126, 126, 53, 126,
- 126, 126, 126, 126, 126, 1, 129, 130,
- 129, 131, 131, 131, 132, 133, 131, 131,
- 131, 131, 131, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 134, 135, 134,
- 135, 42, 42, 42, 42, 42, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 136, 136, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 137, 137, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 138, 44, 45, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 139, 140, 139, 140, 42, 42,
- 42, 42, 42, 1, 141, 41, 141, 42,
- 42, 42, 43, 44, 142, 42, 42, 42,
- 42, 42, 1, 143, 144, 143, 16, 28,
- 142, 1, 145, 1, 146, 146, 1, 146,
- 146, 16, 28, 142, 1, 142, 147, 142,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 148, 51, 51, 1, 149, 1, 150, 150,
- 1, 150, 56, 150, 51, 52, 51, 51,
- 53, 51, 51, 51, 148, 51, 51, 1,
- 151, 152, 151, 153, 155, 154, 1, 156,
- 41, 156, 42, 42, 42, 43, 44, 157,
- 42, 42, 42, 42, 42, 1, 158, 159,
- 158, 16, 28, 157, 1, 160, 1, 161,
- 161, 1, 161, 161, 16, 28, 157, 1,
- 157, 162, 157, 51, 52, 51, 51, 53,
- 51, 51, 51, 163, 51, 51, 1, 164,
- 1, 165, 165, 1, 165, 56, 165, 51,
- 52, 51, 51, 53, 51, 51, 51, 163,
- 51, 51, 1, 166, 167, 166, 168, 170,
- 169, 1, 40, 41, 40, 42, 42, 42,
- 43, 44, 45, 171, 171, 42, 42, 42,
- 42, 42, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 172, 172, 42, 42,
- 42, 42, 42, 1, 173, 41, 173, 42,
- 42, 42, 43, 44, 174, 42, 42, 42,
- 42, 42, 1, 175, 176, 175, 16, 28,
- 174, 1, 177, 1, 178, 178, 1, 178,
- 178, 16, 28, 174, 1, 174, 179, 174,
- 180, 52, 180, 180, 53, 180, 180, 180,
- 180, 180, 180, 1, 181, 1, 182, 182,
- 1, 182, 56, 182, 180, 52, 180, 180,
- 53, 180, 180, 180, 180, 180, 180, 1,
- 183, 184, 183, 185, 185, 185, 186, 187,
- 185, 185, 185, 185, 185, 1, 188, 41,
- 188, 42, 42, 42, 43, 44, 189, 42,
- 42, 42, 42, 42, 1, 190, 191, 190,
- 16, 28, 189, 1, 192, 1, 193, 193,
- 1, 193, 193, 16, 28, 189, 1, 189,
- 194, 189, 51, 52, 51, 51, 195, 196,
- 53, 51, 51, 51, 51, 51, 51, 1,
- 197, 1, 198, 198, 1, 198, 56, 198,
- 51, 52, 51, 51, 195, 196, 53, 51,
- 51, 51, 51, 51, 51, 1, 199, 200,
- 199, 201, 202, 203, 1, 199, 200, 199,
- 201, 203, 204, 1, 199, 200, 199, 201,
- 203, 205, 1, 199, 200, 199, 201, 203,
- 206, 1, 199, 200, 199, 201, 203, 1,
- 199, 200, 199, 201, 207, 203, 1, 199,
- 200, 199, 201, 208, 203, 1, 199, 200,
- 199, 201, 209, 203, 1, 199, 200, 199,
- 201, 206, 203, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 210, 210, 42,
- 42, 42, 42, 42, 1, 40, 41, 40,
- 42, 42, 42, 43, 44, 45, 211, 211,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 212, 44, 45,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 213,
- 214, 213, 214, 42, 42, 42, 42, 42,
- 1, 215, 41, 215, 42, 42, 42, 43,
- 44, 216, 42, 42, 42, 42, 42, 1,
- 217, 218, 217, 16, 28, 216, 1, 219,
- 1, 220, 220, 1, 220, 220, 16, 28,
- 216, 1, 216, 221, 216, 51, 52, 51,
- 51, 53, 51, 51, 51, 222, 51, 51,
- 1, 223, 1, 224, 224, 1, 224, 56,
- 224, 51, 52, 51, 51, 53, 51, 51,
- 51, 222, 51, 51, 1, 225, 226, 225,
- 227, 229, 228, 1, 230, 41, 230, 42,
- 42, 42, 43, 44, 231, 42, 42, 42,
- 42, 42, 1, 232, 233, 232, 16, 28,
- 231, 1, 234, 1, 235, 235, 1, 235,
- 235, 16, 28, 231, 1, 231, 236, 231,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 237, 51, 51, 1, 238, 1, 239, 239,
- 1, 239, 56, 239, 51, 52, 51, 51,
- 53, 51, 51, 51, 237, 51, 51, 1,
- 240, 241, 240, 242, 244, 243, 1, 1,
- 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Client_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 21, 19, 20, 22, 46, 21,
- 17, 26, 22, 23, 26, 24, 25, 27,
- 30, 84, 96, 109, 146, 164, 28, 29,
- 31, 46, 30, 17, 26, 35, 31, 32,
- 33, 34, 36, 48, 42, 49, 37, 38,
- 39, 40, 41, 43, 45, 47, 44, 22,
- 188, 50, 83, 51, 54, 52, 53, 55,
- 70, 56, 68, 57, 58, 66, 59, 60,
- 64, 61, 62, 63, 65, 67, 69, 71,
- 79, 72, 75, 73, 74, 76, 77, 78,
- 80, 81, 82, 85, 86, 87, 91, 87,
- 88, 89, 90, 92, 95, 93, 94, 22,
- 46, 95, 17, 26, 97, 98, 99, 100,
- 104, 100, 101, 102, 103, 105, 108, 106,
- 107, 22, 46, 108, 17, 26, 110, 134,
- 111, 112, 113, 114, 124, 115, 119, 115,
- 116, 117, 118, 120, 123, 121, 122, 22,
- 46, 17, 123, 26, 125, 129, 125, 126,
- 127, 128, 130, 133, 131, 132, 22, 46,
- 17, 133, 26, 135, 136, 137, 141, 137,
- 138, 139, 140, 142, 145, 143, 144, 22,
- 46, 145, 17, 26, 147, 151, 147, 148,
- 149, 150, 152, 155, 160, 153, 154, 22,
- 46, 17, 156, 26, 157, 158, 159, 161,
- 162, 163, 165, 166, 167, 168, 178, 169,
- 173, 169, 170, 171, 172, 174, 177, 175,
- 176, 22, 46, 17, 177, 26, 179, 183,
- 179, 180, 181, 182, 184, 187, 185, 186,
- 22, 46, 17, 187, 26
-};
-
-static const char _tsip_machine_parser_header_Security_Client_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 0, 0, 28, 28, 0,
- 28, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 55, 55, 0, 55, 21, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 23, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 46,
- 46, 0, 46, 15, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 43, 43, 0, 43, 13, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 34,
- 34, 34, 0, 7, 55, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 31, 31,
- 31, 0, 5, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 49,
- 49, 0, 49, 17, 55, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 52,
- 52, 52, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 40, 40, 40, 0, 11, 55, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 37, 37, 37, 0, 9
-};
-
-static const int tsip_machine_parser_header_Security_Client_start = 1;
-static const int tsip_machine_parser_header_Security_Client_first_final = 188;
-static const int tsip_machine_parser_header_Security_Client_error = 0;
-
-static const int tsip_machine_parser_header_Security_Client_en_main = 1;
-
-
-/* #line 213 "./ragel/tsip_parser_header_Security_Client.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Security_Client_first_final);
- (void)(tsip_machine_parser_header_Security_Client_error);
- (void)(tsip_machine_parser_header_Security_Client_en_main);
-
-/* #line 683 "./src/headers/tsip_header_Security_Client.c" */
- {
- cs = tsip_machine_parser_header_Security_Client_start;
- }
-
-/* #line 218 "./ragel/tsip_parser_header_Security_Client.rl" */
-
-/* #line 690 "./src/headers/tsip_header_Security_Client.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Security_Clients_L_t *hdr_securityclients = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Security_Client_t *curr_securityclient = tsk_null;
+
+
+ /* #line 116 "./src/headers/tsip_header_Security_Client.c" */
+ static const char _tsip_machine_parser_header_Security_Client_actions[] = {
+ 0, 1, 0, 1, 3, 1, 4, 1,
+ 5, 1, 6, 1, 7, 1, 8, 1,
+ 9, 1, 10, 1, 11, 1, 12, 1,
+ 13, 2, 1, 0, 2, 3, 2, 2,
+ 4, 2, 2, 5, 2, 2, 6, 2,
+ 2, 7, 2, 2, 8, 2, 2, 9,
+ 2, 2, 10, 2, 2, 11, 2, 2,
+ 12, 2
+ };
+
+ static const short _tsip_machine_parser_header_Security_Client_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 17, 19, 21, 23, 25, 27,
+ 29, 32, 49, 50, 52, 68, 85, 90,
+ 91, 93, 97, 124, 125, 127, 153, 171,
+ 177, 178, 180, 185, 204, 205, 207, 226,
+ 227, 229, 232, 240, 241, 243, 248, 249,
+ 255, 272, 279, 287, 295, 303, 305, 312,
+ 321, 323, 326, 328, 331, 333, 336, 339,
+ 340, 343, 344, 347, 348, 357, 366, 374,
+ 382, 390, 398, 400, 406, 415, 424, 433,
+ 435, 438, 441, 442, 443, 463, 483, 501,
+ 507, 508, 510, 515, 534, 535, 537, 556,
+ 573, 593, 613, 633, 651, 657, 658, 660,
+ 665, 684, 685, 687, 706, 723, 745, 765,
+ 785, 804, 826, 844, 850, 851, 853, 858,
+ 877, 878, 880, 899, 906, 924, 930, 931,
+ 933, 938, 957, 958, 960, 979, 986, 1006,
+ 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
+ 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
+ 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
+ 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
+ 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
+ 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
+ 1461, 1462, 1464, 1483, 1490
+ };
+
+ static const char _tsip_machine_parser_header_Security_Client_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 85, 117,
+ 82, 114, 73, 105, 84, 116, 89, 121,
+ 45, 67, 99, 76, 108, 73, 105, 69,
+ 101, 78, 110, 84, 116, 9, 32, 58,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 10, 9, 32, 9, 32, 44,
+ 59, 9, 13, 32, 33, 37, 39, 65,
+ 69, 80, 81, 83, 97, 101, 112, 113,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 65, 69, 80, 81,
+ 83, 97, 101, 112, 113, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 44, 59,
+ 10, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 44, 59, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 76, 108, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 71, 103, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 61, 10, 9, 32, 9, 32,
+ 44, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 65, 97,
+ 126, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 71, 103,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 79, 82, 111, 114,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 82, 114, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 84, 116,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 61, 84,
+ 116, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 10, 9, 32, 9,
+ 32, 44, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 59, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 48, 57, 9, 13, 32, 44,
+ 59, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 48, 59, 9, 13, 32,
+ 44, 48, 59, 9, 13, 32, 44, 48,
+ 59, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 80, 112, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Client_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 2, 2,
+ 3, 7, 1, 2, 6, 9, 5, 1,
+ 2, 4, 17, 1, 2, 16, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 5, 1, 0,
+ 9, 1, 2, 2, 2, 2, 1, 3,
+ 0, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 12, 12, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 9,
+ 12, 12, 12, 10, 6, 1, 2, 5,
+ 9, 1, 2, 9, 9, 14, 12, 12,
+ 11, 14, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 10, 6, 1, 2,
+ 5, 9, 1, 2, 9, 5, 12, 12,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 9, 10, 6, 1, 2, 5, 11,
+ 1, 2, 11, 6, 5, 5, 5, 5,
+ 6, 6, 6, 6, 12, 12, 11, 14,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 5, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Client_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 3,
+ 4, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 4, 4, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 4,
+ 4, 4, 4, 4, 0, 0, 0, 0,
+ 5, 0, 0, 5, 4, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 4, 0, 0, 0,
+ 0, 5, 0, 0, 5, 1, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 1, 1, 1, 0,
+ 0, 0, 0, 0, 4, 4, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 1, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_Security_Client_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 24, 26, 29, 32, 35, 38, 41,
+ 44, 48, 61, 63, 66, 78, 92, 98,
+ 100, 103, 108, 131, 133, 136, 158, 173,
+ 180, 182, 185, 191, 206, 208, 211, 226,
+ 228, 231, 235, 242, 244, 247, 253, 255,
+ 259, 273, 278, 284, 290, 296, 299, 304,
+ 311, 313, 316, 318, 321, 323, 326, 329,
+ 331, 334, 336, 339, 341, 348, 355, 361,
+ 367, 373, 379, 382, 386, 393, 400, 407,
+ 409, 412, 415, 417, 419, 436, 453, 468,
+ 475, 477, 480, 486, 501, 503, 506, 521,
+ 535, 552, 569, 586, 601, 608, 610, 613,
+ 619, 634, 636, 639, 654, 668, 687, 704,
+ 721, 737, 756, 771, 778, 780, 783, 789,
+ 804, 806, 809, 824, 831, 846, 853, 855,
+ 858, 864, 879, 881, 884, 899, 906, 923,
+ 940, 955, 962, 964, 967, 973, 988, 990,
+ 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
+ 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
+ 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
+ 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
+ 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
+ 1348, 1350, 1353, 1368, 1375
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Client_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 8, 1,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 15, 1, 15, 15, 16, 1,
+ 16, 17, 16, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 1, 19, 1, 20,
+ 20, 1, 20, 20, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 1, 21, 22,
+ 21, 23, 23, 23, 24, 25, 23, 23,
+ 23, 23, 23, 1, 26, 27, 26, 16,
+ 28, 1, 29, 1, 30, 30, 1, 30,
+ 30, 16, 28, 1, 28, 31, 28, 32,
+ 32, 32, 33, 34, 35, 36, 37, 33,
+ 34, 35, 36, 37, 32, 32, 32, 32,
+ 32, 32, 1, 38, 1, 39, 39, 1,
+ 39, 39, 32, 32, 32, 33, 34, 35,
+ 36, 37, 33, 34, 35, 36, 37, 32,
+ 32, 32, 32, 32, 32, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 42,
+ 42, 42, 42, 42, 1, 46, 47, 46,
+ 16, 28, 45, 1, 48, 1, 49, 49,
+ 1, 49, 49, 16, 28, 45, 1, 45,
+ 50, 45, 51, 52, 51, 51, 53, 51,
+ 51, 51, 51, 51, 51, 1, 54, 1,
+ 55, 55, 1, 55, 56, 55, 51, 52,
+ 51, 51, 53, 51, 51, 51, 51, 51,
+ 51, 1, 57, 1, 58, 58, 1, 58,
+ 58, 52, 1, 59, 60, 61, 1, 1,
+ 1, 52, 62, 1, 52, 52, 1, 63,
+ 41, 63, 43, 44, 1, 64, 1, 52,
+ 52, 52, 1, 63, 41, 63, 51, 51,
+ 51, 43, 44, 51, 51, 51, 51, 51,
+ 1, 66, 65, 65, 65, 1, 68, 60,
+ 67, 67, 67, 1, 68, 60, 69, 69,
+ 69, 1, 68, 60, 70, 70, 70, 1,
+ 68, 60, 1, 72, 71, 65, 65, 1,
+ 73, 68, 60, 74, 67, 67, 1, 75,
+ 1, 76, 77, 1, 78, 1, 79, 80,
+ 1, 81, 1, 60, 82, 1, 60, 83,
+ 1, 60, 1, 79, 84, 1, 79, 1,
+ 76, 85, 1, 76, 1, 73, 68, 60,
+ 86, 69, 69, 1, 73, 68, 60, 70,
+ 70, 70, 1, 88, 60, 87, 87, 87,
+ 1, 90, 60, 89, 89, 89, 1, 90,
+ 60, 91, 91, 91, 1, 90, 60, 92,
+ 92, 92, 1, 90, 60, 1, 93, 87,
+ 87, 1, 73, 90, 60, 94, 89, 89,
+ 1, 73, 90, 60, 95, 91, 91, 1,
+ 73, 90, 60, 92, 92, 92, 1, 96,
+ 1, 73, 97, 1, 73, 98, 1, 73,
+ 1, 72, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 99, 99, 42, 42,
+ 42, 42, 42, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 100, 100, 42,
+ 42, 42, 42, 42, 1, 101, 41, 101,
+ 42, 42, 42, 43, 44, 102, 42, 42,
+ 42, 42, 42, 1, 103, 104, 103, 16,
+ 28, 102, 1, 105, 1, 106, 106, 1,
+ 106, 106, 16, 28, 102, 1, 102, 107,
+ 102, 108, 52, 108, 108, 53, 108, 108,
+ 108, 108, 108, 108, 1, 109, 1, 110,
+ 110, 1, 110, 56, 110, 108, 52, 108,
+ 108, 53, 108, 108, 108, 108, 108, 108,
+ 1, 111, 112, 111, 113, 113, 113, 114,
+ 115, 113, 113, 113, 113, 113, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 116, 116, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 117, 117, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 118, 118, 42, 42, 42, 42,
+ 42, 1, 119, 41, 119, 42, 42, 42,
+ 43, 44, 120, 42, 42, 42, 42, 42,
+ 1, 121, 122, 121, 16, 28, 120, 1,
+ 123, 1, 124, 124, 1, 124, 124, 16,
+ 28, 120, 1, 120, 125, 120, 126, 52,
+ 126, 126, 53, 126, 126, 126, 126, 126,
+ 126, 1, 127, 1, 128, 128, 1, 128,
+ 56, 128, 126, 52, 126, 126, 53, 126,
+ 126, 126, 126, 126, 126, 1, 129, 130,
+ 129, 131, 131, 131, 132, 133, 131, 131,
+ 131, 131, 131, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 134, 135, 134,
+ 135, 42, 42, 42, 42, 42, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 136, 136, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 137, 137, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 138, 44, 45, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 139, 140, 139, 140, 42, 42,
+ 42, 42, 42, 1, 141, 41, 141, 42,
+ 42, 42, 43, 44, 142, 42, 42, 42,
+ 42, 42, 1, 143, 144, 143, 16, 28,
+ 142, 1, 145, 1, 146, 146, 1, 146,
+ 146, 16, 28, 142, 1, 142, 147, 142,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 148, 51, 51, 1, 149, 1, 150, 150,
+ 1, 150, 56, 150, 51, 52, 51, 51,
+ 53, 51, 51, 51, 148, 51, 51, 1,
+ 151, 152, 151, 153, 155, 154, 1, 156,
+ 41, 156, 42, 42, 42, 43, 44, 157,
+ 42, 42, 42, 42, 42, 1, 158, 159,
+ 158, 16, 28, 157, 1, 160, 1, 161,
+ 161, 1, 161, 161, 16, 28, 157, 1,
+ 157, 162, 157, 51, 52, 51, 51, 53,
+ 51, 51, 51, 163, 51, 51, 1, 164,
+ 1, 165, 165, 1, 165, 56, 165, 51,
+ 52, 51, 51, 53, 51, 51, 51, 163,
+ 51, 51, 1, 166, 167, 166, 168, 170,
+ 169, 1, 40, 41, 40, 42, 42, 42,
+ 43, 44, 45, 171, 171, 42, 42, 42,
+ 42, 42, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 172, 172, 42, 42,
+ 42, 42, 42, 1, 173, 41, 173, 42,
+ 42, 42, 43, 44, 174, 42, 42, 42,
+ 42, 42, 1, 175, 176, 175, 16, 28,
+ 174, 1, 177, 1, 178, 178, 1, 178,
+ 178, 16, 28, 174, 1, 174, 179, 174,
+ 180, 52, 180, 180, 53, 180, 180, 180,
+ 180, 180, 180, 1, 181, 1, 182, 182,
+ 1, 182, 56, 182, 180, 52, 180, 180,
+ 53, 180, 180, 180, 180, 180, 180, 1,
+ 183, 184, 183, 185, 185, 185, 186, 187,
+ 185, 185, 185, 185, 185, 1, 188, 41,
+ 188, 42, 42, 42, 43, 44, 189, 42,
+ 42, 42, 42, 42, 1, 190, 191, 190,
+ 16, 28, 189, 1, 192, 1, 193, 193,
+ 1, 193, 193, 16, 28, 189, 1, 189,
+ 194, 189, 51, 52, 51, 51, 195, 196,
+ 53, 51, 51, 51, 51, 51, 51, 1,
+ 197, 1, 198, 198, 1, 198, 56, 198,
+ 51, 52, 51, 51, 195, 196, 53, 51,
+ 51, 51, 51, 51, 51, 1, 199, 200,
+ 199, 201, 202, 203, 1, 199, 200, 199,
+ 201, 203, 204, 1, 199, 200, 199, 201,
+ 203, 205, 1, 199, 200, 199, 201, 203,
+ 206, 1, 199, 200, 199, 201, 203, 1,
+ 199, 200, 199, 201, 207, 203, 1, 199,
+ 200, 199, 201, 208, 203, 1, 199, 200,
+ 199, 201, 209, 203, 1, 199, 200, 199,
+ 201, 206, 203, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 210, 210, 42,
+ 42, 42, 42, 42, 1, 40, 41, 40,
+ 42, 42, 42, 43, 44, 45, 211, 211,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 212, 44, 45,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 213,
+ 214, 213, 214, 42, 42, 42, 42, 42,
+ 1, 215, 41, 215, 42, 42, 42, 43,
+ 44, 216, 42, 42, 42, 42, 42, 1,
+ 217, 218, 217, 16, 28, 216, 1, 219,
+ 1, 220, 220, 1, 220, 220, 16, 28,
+ 216, 1, 216, 221, 216, 51, 52, 51,
+ 51, 53, 51, 51, 51, 222, 51, 51,
+ 1, 223, 1, 224, 224, 1, 224, 56,
+ 224, 51, 52, 51, 51, 53, 51, 51,
+ 51, 222, 51, 51, 1, 225, 226, 225,
+ 227, 229, 228, 1, 230, 41, 230, 42,
+ 42, 42, 43, 44, 231, 42, 42, 42,
+ 42, 42, 1, 232, 233, 232, 16, 28,
+ 231, 1, 234, 1, 235, 235, 1, 235,
+ 235, 16, 28, 231, 1, 231, 236, 231,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 237, 51, 51, 1, 238, 1, 239, 239,
+ 1, 239, 56, 239, 51, 52, 51, 51,
+ 53, 51, 51, 51, 237, 51, 51, 1,
+ 240, 241, 240, 242, 244, 243, 1, 1,
+ 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Client_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 21, 19, 20, 22, 46, 21,
+ 17, 26, 22, 23, 26, 24, 25, 27,
+ 30, 84, 96, 109, 146, 164, 28, 29,
+ 31, 46, 30, 17, 26, 35, 31, 32,
+ 33, 34, 36, 48, 42, 49, 37, 38,
+ 39, 40, 41, 43, 45, 47, 44, 22,
+ 188, 50, 83, 51, 54, 52, 53, 55,
+ 70, 56, 68, 57, 58, 66, 59, 60,
+ 64, 61, 62, 63, 65, 67, 69, 71,
+ 79, 72, 75, 73, 74, 76, 77, 78,
+ 80, 81, 82, 85, 86, 87, 91, 87,
+ 88, 89, 90, 92, 95, 93, 94, 22,
+ 46, 95, 17, 26, 97, 98, 99, 100,
+ 104, 100, 101, 102, 103, 105, 108, 106,
+ 107, 22, 46, 108, 17, 26, 110, 134,
+ 111, 112, 113, 114, 124, 115, 119, 115,
+ 116, 117, 118, 120, 123, 121, 122, 22,
+ 46, 17, 123, 26, 125, 129, 125, 126,
+ 127, 128, 130, 133, 131, 132, 22, 46,
+ 17, 133, 26, 135, 136, 137, 141, 137,
+ 138, 139, 140, 142, 145, 143, 144, 22,
+ 46, 145, 17, 26, 147, 151, 147, 148,
+ 149, 150, 152, 155, 160, 153, 154, 22,
+ 46, 17, 156, 26, 157, 158, 159, 161,
+ 162, 163, 165, 166, 167, 168, 178, 169,
+ 173, 169, 170, 171, 172, 174, 177, 175,
+ 176, 22, 46, 17, 177, 26, 179, 183,
+ 179, 180, 181, 182, 184, 187, 185, 186,
+ 22, 46, 17, 187, 26
+ };
+
+ static const char _tsip_machine_parser_header_Security_Client_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 0, 0, 28, 28, 0,
+ 28, 3, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 0, 0,
+ 55, 55, 0, 55, 21, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 23, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 46,
+ 46, 0, 46, 15, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 43, 43, 0, 43, 13, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 34,
+ 34, 34, 0, 7, 55, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 31, 31,
+ 31, 0, 5, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 49,
+ 49, 0, 49, 17, 55, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 52,
+ 52, 52, 0, 19, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 40, 40, 40, 0, 11, 55, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 37, 37, 37, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_Security_Client_start = 1;
+ static const int tsip_machine_parser_header_Security_Client_first_final = 188;
+ static const int tsip_machine_parser_header_Security_Client_error = 0;
+
+ static const int tsip_machine_parser_header_Security_Client_en_main = 1;
+
+
+ /* #line 213 "./ragel/tsip_parser_header_Security_Client.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Security_Client_first_final);
+ (void)(tsip_machine_parser_header_Security_Client_error);
+ (void)(tsip_machine_parser_header_Security_Client_en_main);
+
+ /* #line 683 "./src/headers/tsip_header_Security_Client.c" */
+ {
+ cs = tsip_machine_parser_header_Security_Client_start;
+ }
+
+ /* #line 218 "./ragel/tsip_parser_header_Security_Client.rl" */
+
+ /* #line 690 "./src/headers/tsip_header_Security_Client.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Security_Client_trans_keys + _tsip_machine_parser_header_Security_Client_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Security_Client_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Security_Client_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Security_Client_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Security_Client_trans_keys + _tsip_machine_parser_header_Security_Client_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Security_Client_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Security_Client_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Security_Client_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Security_Client_indicies[_trans];
- cs = _tsip_machine_parser_header_Security_Client_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Security_Client_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Security_Client_actions + _tsip_machine_parser_header_Security_Client_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(!curr_securityclient){
- curr_securityclient = tsip_header_Security_Client_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- tsk_list_push_back_data(hdr_securityclients, ((void**) &curr_securityclient));
- }
- }
- break;
- case 3:
-/* #line 67 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_STRING(curr_securityclient->mech);
- }
- }
- break;
- case 4:
-/* #line 73 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_INT(curr_securityclient->port_s);
- }
- }
- break;
- case 5:
-/* #line 79 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_INT(curr_securityclient->port_c);
- }
- }
- break;
- case 6:
-/* #line 85 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_UINT(curr_securityclient->spi_s);
- }
- }
- break;
- case 7:
-/* #line 91 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_UINT(curr_securityclient->spi_c);
- }
- }
- break;
- case 8:
-/* #line 97 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_STRING(curr_securityclient->ealg);
- }
- }
- break;
- case 9:
-/* #line 103 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_STRING(curr_securityclient->alg);
- }
- }
- break;
- case 10:
-/* #line 109 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_STRING(curr_securityclient->prot);
- }
- }
- break;
- case 11:
-/* #line 115 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_SET_DOUBLE(curr_securityclient->q);
- }
- }
- break;
- case 12:
-/* #line 121 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- if(curr_securityclient){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityclient));
- }
- }
- break;
- case 13:
-/* #line 127 "./ragel/tsip_parser_header_Security_Client.rl" */
- {
- }
- break;
-/* #line 871 "./src/headers/tsip_header_Security_Client.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Security_Client_indicies[_trans];
+ cs = _tsip_machine_parser_header_Security_Client_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Security_Client_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Security_Client_actions + _tsip_machine_parser_header_Security_Client_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(!curr_securityclient) {
+ curr_securityclient = tsip_header_Security_Client_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ tsk_list_push_back_data(hdr_securityclients, ((void**) &curr_securityclient));
+ }
+ }
+ break;
+ case 3:
+ /* #line 67 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_STRING(curr_securityclient->mech);
+ }
+ }
+ break;
+ case 4:
+ /* #line 73 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_INT(curr_securityclient->port_s);
+ }
+ }
+ break;
+ case 5:
+ /* #line 79 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_INT(curr_securityclient->port_c);
+ }
+ }
+ break;
+ case 6:
+ /* #line 85 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_UINT(curr_securityclient->spi_s);
+ }
+ }
+ break;
+ case 7:
+ /* #line 91 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_UINT(curr_securityclient->spi_c);
+ }
+ }
+ break;
+ case 8:
+ /* #line 97 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_STRING(curr_securityclient->ealg);
+ }
+ }
+ break;
+ case 9:
+ /* #line 103 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_STRING(curr_securityclient->alg);
+ }
+ }
+ break;
+ case 10:
+ /* #line 109 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_STRING(curr_securityclient->prot);
+ }
+ }
+ break;
+ case 11:
+ /* #line 115 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_SET_DOUBLE(curr_securityclient->q);
+ }
+ }
+ break;
+ case 12:
+ /* #line 121 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ if(curr_securityclient) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityclient));
+ }
+ }
+ break;
+ case 13:
+ /* #line 127 "./ragel/tsip_parser_header_Security_Client.rl" */
+ {
+ }
+ break;
+ /* #line 871 "./src/headers/tsip_header_Security_Client.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 219 "./ragel/tsip_parser_header_Security_Client.rl" */
-
- if( cs <
-/* #line 887 "./src/headers/tsip_header_Security_Client.c" */
-188
-/* #line 220 "./ragel/tsip_parser_header_Security_Client.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Security-Client' header.");
- TSK_OBJECT_SAFE_FREE(curr_securityclient);
- TSK_OBJECT_SAFE_FREE(hdr_securityclients);
- }
-
- return hdr_securityclients;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 219 "./ragel/tsip_parser_header_Security_Client.rl" */
+
+ if( cs <
+ /* #line 887 "./src/headers/tsip_header_Security_Client.c" */
+ 188
+ /* #line 220 "./ragel/tsip_parser_header_Security_Client.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Security-Client' header.");
+ TSK_OBJECT_SAFE_FREE(curr_securityclient);
+ TSK_OBJECT_SAFE_FREE(hdr_securityclients);
+ }
+
+ return hdr_securityclients;
}
@@ -908,62 +919,61 @@ _again:
static tsk_object_t* tsip_header_Security_Client_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Security_Client_t *Security_Client = self;
- if(Security_Client){
- const char* mech = va_arg(*app, const char*);
+ tsip_header_Security_Client_t *Security_Client = self;
+ if(Security_Client) {
+ const char* mech = va_arg(*app, const char*);
- TSIP_HEADER(Security_Client)->type = tsip_htype_Security_Client;
- TSIP_HEADER(Security_Client)->serialize = tsip_header_Security_Client_serialize;
+ TSIP_HEADER(Security_Client)->type = tsip_htype_Security_Client;
+ TSIP_HEADER(Security_Client)->serialize = tsip_header_Security_Client_serialize;
- Security_Client->q = -1;
+ Security_Client->q = -1;
- if(mech){
- Security_Client->mech = tsk_strdup(mech);
- Security_Client->alg = tsk_strdup(va_arg(*app, const char*));
- Security_Client->prot = tsk_strdup(va_arg(*app, const char*));
- Security_Client->mod = tsk_strdup(va_arg(*app, const char*));
- Security_Client->ealg = tsk_strdup(va_arg(*app, const char*));
+ if(mech) {
+ Security_Client->mech = tsk_strdup(mech);
+ Security_Client->alg = tsk_strdup(va_arg(*app, const char*));
+ Security_Client->prot = tsk_strdup(va_arg(*app, const char*));
+ Security_Client->mod = tsk_strdup(va_arg(*app, const char*));
+ Security_Client->ealg = tsk_strdup(va_arg(*app, const char*));
#if defined(__GNUC__)
- Security_Client->port_c = (tnet_port_t)va_arg(*app, unsigned);
- Security_Client->port_s = (tnet_port_t)va_arg(*app, unsigned);
+ Security_Client->port_c = (tnet_port_t)va_arg(*app, unsigned);
+ Security_Client->port_s = (tnet_port_t)va_arg(*app, unsigned);
#else
- Security_Client->port_c = va_arg(*app, tnet_port_t);
- Security_Client->port_s = va_arg(*app, tnet_port_t);
+ Security_Client->port_c = va_arg(*app, tnet_port_t);
+ Security_Client->port_s = va_arg(*app, tnet_port_t);
#endif
- Security_Client->spi_c = va_arg(*app, uint32_t);
- Security_Client->spi_s = va_arg(*app, uint32_t);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Security_Client header.");
- }
- return self;
+ Security_Client->spi_c = va_arg(*app, uint32_t);
+ Security_Client->spi_s = va_arg(*app, uint32_t);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Security_Client header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Security_Client_dtor(tsk_object_t *self)
{
- tsip_header_Security_Client_t *Security_Client = self;
- if(Security_Client){
- TSK_FREE(Security_Client->mech);
- TSK_FREE(Security_Client->alg);
- TSK_FREE(Security_Client->prot);
- TSK_FREE(Security_Client->mod);
- TSK_FREE(Security_Client->ealg);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Client));
- }
- else{
- TSK_DEBUG_ERROR("Null Security_Client header.");
- }
-
- return self;
+ tsip_header_Security_Client_t *Security_Client = self;
+ if(Security_Client) {
+ TSK_FREE(Security_Client->mech);
+ TSK_FREE(Security_Client->alg);
+ TSK_FREE(Security_Client->prot);
+ TSK_FREE(Security_Client->mod);
+ TSK_FREE(Security_Client->ealg);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Client));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Security_Client header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Security_Client_def_s =
-{
- sizeof(tsip_header_Security_Client_t),
- tsip_header_Security_Client_ctor,
- tsip_header_Security_Client_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Security_Client_def_s = {
+ sizeof(tsip_header_Security_Client_t),
+ tsip_header_Security_Client_ctor,
+ tsip_header_Security_Client_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Security_Client_def_t = &tsip_header_Security_Client_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Security_Server.c b/tinySIP/src/headers/tsip_header_Security_Server.c
index 7554571..daf93c9 100755
--- a/tinySIP/src/headers/tsip_header_Security_Server.c
+++ b/tinySIP/src/headers/tsip_header_Security_Server.c
@@ -5,19 +5,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,849 +51,860 @@
tsip_header_Security_Server_t* tsip_header_Security_Server_create()
{
- return tsk_object_new(TSIP_HEADER_SECURITY_SERVER_VA_ARGS());
+ return tsk_object_new(TSIP_HEADER_SECURITY_SERVER_VA_ARGS());
}
tsip_header_Security_Server_t* tsip_header_Security_Server_create_null()
{
- return tsip_header_Security_Server_create();
+ return tsip_header_Security_Server_create();
}
int tsip_header_Security_Server_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Security_Server_t *Security_Server = (const tsip_header_Security_Server_t *)header;
- int ret = 0;
-
- // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
- if(tsk_striequals(Security_Server->mech, "ipsec-3gpp")){
- ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
- Security_Server->mech,
-
- Security_Server->alg ? ";alg=" : "",
- Security_Server->alg ? Security_Server->alg : "",
-
- Security_Server->ealg ? ";ealg=" : "",
- Security_Server->ealg ? Security_Server->ealg : "",
-
- Security_Server->prot ? ";prot=" : "",
- Security_Server->prot ? Security_Server->prot : "",
-
- Security_Server->spi_c,
- Security_Server->spi_s,
- Security_Server->port_c,
- Security_Server->port_s
- );
- }
- else if(Security_Server->mech){
- ret = tsk_buffer_append(output, Security_Server->mech, tsk_strlen(Security_Server->mech));
- }
-
- if(Security_Server->q >= 0){
- /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
- ret = tsk_buffer_append_2(output, ";q=%1.3f", Security_Server->q);
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Security_Server_t *Security_Server = (const tsip_header_Security_Server_t *)header;
+ int ret = 0;
+
+ // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
+ if(tsk_striequals(Security_Server->mech, "ipsec-3gpp")) {
+ ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
+ Security_Server->mech,
+
+ Security_Server->alg ? ";alg=" : "",
+ Security_Server->alg ? Security_Server->alg : "",
+
+ Security_Server->ealg ? ";ealg=" : "",
+ Security_Server->ealg ? Security_Server->ealg : "",
+
+ Security_Server->prot ? ";prot=" : "",
+ Security_Server->prot ? Security_Server->prot : "",
+
+ Security_Server->spi_c,
+ Security_Server->spi_s,
+ Security_Server->port_c,
+ Security_Server->port_s
+ );
+ }
+ else if(Security_Server->mech) {
+ ret = tsk_buffer_append(output, Security_Server->mech, tsk_strlen(Security_Server->mech));
+ }
+
+ if(Security_Server->q >= 0) {
+ /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
+ ret = tsk_buffer_append_2(output, ";q=%1.3f", Security_Server->q);
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Security_Servers_L_t *tsip_header_Security_Server_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Security_Servers_L_t *hdr_securityservers = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Security_Server_t *curr_securityserver = tsk_null;
-
-
-/* #line 117 "./src/headers/tsip_header_Security_Server.c" */
-static const char _tsip_machine_parser_header_Security_Server_actions[] = {
- 0, 1, 0, 1, 3, 1, 4, 1,
- 5, 1, 6, 1, 7, 1, 8, 1,
- 9, 1, 10, 1, 11, 1, 12, 1,
- 13, 2, 1, 0, 2, 3, 2, 2,
- 4, 2, 2, 5, 2, 2, 6, 2,
- 2, 7, 2, 2, 8, 2, 2, 9,
- 2, 2, 10, 2, 2, 11, 2, 2,
- 12, 2
-};
-
-static const short _tsip_machine_parser_header_Security_Server_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 17, 19, 21, 23, 25, 27,
- 29, 32, 49, 50, 52, 68, 85, 90,
- 91, 93, 97, 124, 125, 127, 153, 171,
- 177, 178, 180, 185, 204, 205, 207, 226,
- 227, 229, 232, 240, 241, 243, 248, 249,
- 255, 272, 279, 287, 295, 303, 305, 312,
- 321, 323, 326, 328, 331, 333, 336, 339,
- 340, 343, 344, 347, 348, 357, 366, 374,
- 382, 390, 398, 400, 406, 415, 424, 433,
- 435, 438, 441, 442, 443, 463, 483, 501,
- 507, 508, 510, 515, 534, 535, 537, 556,
- 573, 593, 613, 633, 651, 657, 658, 660,
- 665, 684, 685, 687, 706, 723, 745, 765,
- 785, 804, 826, 844, 850, 851, 853, 858,
- 877, 878, 880, 899, 906, 924, 930, 931,
- 933, 938, 957, 958, 960, 979, 986, 1006,
- 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
- 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
- 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
- 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
- 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
- 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
- 1461, 1462, 1464, 1483, 1490
-};
-
-static const char _tsip_machine_parser_header_Security_Server_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 85, 117,
- 82, 114, 73, 105, 84, 116, 89, 121,
- 45, 83, 115, 69, 101, 82, 114, 86,
- 118, 69, 101, 82, 114, 9, 32, 58,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 10, 9, 32, 9, 32, 44,
- 59, 9, 13, 32, 33, 37, 39, 65,
- 69, 80, 81, 83, 97, 101, 112, 113,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 65, 69, 80, 81,
- 83, 97, 101, 112, 113, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 44, 59,
- 10, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 44, 59, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 76, 108, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 71, 103, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 61, 10, 9, 32, 9, 32,
- 44, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 65, 97,
- 126, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 71, 103,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 79, 82, 111, 114,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 82, 114, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 84, 116,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 61, 84,
- 116, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 10, 9, 32, 9,
- 32, 44, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 59, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 48, 57, 9, 13, 32, 44,
- 59, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 48, 59, 9, 13, 32,
- 44, 48, 59, 9, 13, 32, 44, 48,
- 59, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 80, 112, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Server_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 2, 2,
- 3, 7, 1, 2, 6, 9, 5, 1,
- 2, 4, 17, 1, 2, 16, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 5, 1, 0,
- 9, 1, 2, 2, 2, 2, 1, 3,
- 0, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 12, 12, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 9,
- 12, 12, 12, 10, 6, 1, 2, 5,
- 9, 1, 2, 9, 9, 14, 12, 12,
- 11, 14, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 10, 6, 1, 2,
- 5, 9, 1, 2, 9, 5, 12, 12,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 9, 10, 6, 1, 2, 5, 11,
- 1, 2, 11, 6, 5, 5, 5, 5,
- 6, 6, 6, 6, 12, 12, 11, 14,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 5, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Server_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 3,
- 4, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 4, 4, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 4,
- 4, 4, 4, 4, 0, 0, 0, 0,
- 5, 0, 0, 5, 4, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 4, 0, 0, 0,
- 0, 5, 0, 0, 5, 1, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 4, 4, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 1, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 0
-};
-
-static const short _tsip_machine_parser_header_Security_Server_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 24, 26, 29, 32, 35, 38, 41,
- 44, 48, 61, 63, 66, 78, 92, 98,
- 100, 103, 108, 131, 133, 136, 158, 173,
- 180, 182, 185, 191, 206, 208, 211, 226,
- 228, 231, 235, 242, 244, 247, 253, 255,
- 259, 273, 278, 284, 290, 296, 299, 304,
- 311, 313, 316, 318, 321, 323, 326, 329,
- 331, 334, 336, 339, 341, 348, 355, 361,
- 367, 373, 379, 382, 386, 393, 400, 407,
- 409, 412, 415, 417, 419, 436, 453, 468,
- 475, 477, 480, 486, 501, 503, 506, 521,
- 535, 552, 569, 586, 601, 608, 610, 613,
- 619, 634, 636, 639, 654, 668, 687, 704,
- 721, 737, 756, 771, 778, 780, 783, 789,
- 804, 806, 809, 824, 831, 846, 853, 855,
- 858, 864, 879, 881, 884, 899, 906, 923,
- 940, 955, 962, 964, 967, 973, 988, 990,
- 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
- 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
- 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
- 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
- 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
- 1348, 1350, 1353, 1368, 1375
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Server_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 8, 1,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 15, 1, 15, 15, 16, 1,
- 16, 17, 16, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 1, 19, 1, 20,
- 20, 1, 20, 20, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 1, 21, 22,
- 21, 23, 23, 23, 24, 25, 23, 23,
- 23, 23, 23, 1, 26, 27, 26, 16,
- 28, 1, 29, 1, 30, 30, 1, 30,
- 30, 16, 28, 1, 28, 31, 28, 32,
- 32, 32, 33, 34, 35, 36, 37, 33,
- 34, 35, 36, 37, 32, 32, 32, 32,
- 32, 32, 1, 38, 1, 39, 39, 1,
- 39, 39, 32, 32, 32, 33, 34, 35,
- 36, 37, 33, 34, 35, 36, 37, 32,
- 32, 32, 32, 32, 32, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 42,
- 42, 42, 42, 42, 1, 46, 47, 46,
- 16, 28, 45, 1, 48, 1, 49, 49,
- 1, 49, 49, 16, 28, 45, 1, 45,
- 50, 45, 51, 52, 51, 51, 53, 51,
- 51, 51, 51, 51, 51, 1, 54, 1,
- 55, 55, 1, 55, 56, 55, 51, 52,
- 51, 51, 53, 51, 51, 51, 51, 51,
- 51, 1, 57, 1, 58, 58, 1, 58,
- 58, 52, 1, 59, 60, 61, 1, 1,
- 1, 52, 62, 1, 52, 52, 1, 63,
- 41, 63, 43, 44, 1, 64, 1, 52,
- 52, 52, 1, 63, 41, 63, 51, 51,
- 51, 43, 44, 51, 51, 51, 51, 51,
- 1, 66, 65, 65, 65, 1, 68, 60,
- 67, 67, 67, 1, 68, 60, 69, 69,
- 69, 1, 68, 60, 70, 70, 70, 1,
- 68, 60, 1, 72, 71, 65, 65, 1,
- 73, 68, 60, 74, 67, 67, 1, 75,
- 1, 76, 77, 1, 78, 1, 79, 80,
- 1, 81, 1, 60, 82, 1, 60, 83,
- 1, 60, 1, 79, 84, 1, 79, 1,
- 76, 85, 1, 76, 1, 73, 68, 60,
- 86, 69, 69, 1, 73, 68, 60, 70,
- 70, 70, 1, 88, 60, 87, 87, 87,
- 1, 90, 60, 89, 89, 89, 1, 90,
- 60, 91, 91, 91, 1, 90, 60, 92,
- 92, 92, 1, 90, 60, 1, 93, 87,
- 87, 1, 73, 90, 60, 94, 89, 89,
- 1, 73, 90, 60, 95, 91, 91, 1,
- 73, 90, 60, 92, 92, 92, 1, 96,
- 1, 73, 97, 1, 73, 98, 1, 73,
- 1, 72, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 99, 99, 42, 42,
- 42, 42, 42, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 100, 100, 42,
- 42, 42, 42, 42, 1, 101, 41, 101,
- 42, 42, 42, 43, 44, 102, 42, 42,
- 42, 42, 42, 1, 103, 104, 103, 16,
- 28, 102, 1, 105, 1, 106, 106, 1,
- 106, 106, 16, 28, 102, 1, 102, 107,
- 102, 108, 52, 108, 108, 53, 108, 108,
- 108, 108, 108, 108, 1, 109, 1, 110,
- 110, 1, 110, 56, 110, 108, 52, 108,
- 108, 53, 108, 108, 108, 108, 108, 108,
- 1, 111, 112, 111, 113, 113, 113, 114,
- 115, 113, 113, 113, 113, 113, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 116, 116, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 117, 117, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 118, 118, 42, 42, 42, 42,
- 42, 1, 119, 41, 119, 42, 42, 42,
- 43, 44, 120, 42, 42, 42, 42, 42,
- 1, 121, 122, 121, 16, 28, 120, 1,
- 123, 1, 124, 124, 1, 124, 124, 16,
- 28, 120, 1, 120, 125, 120, 126, 52,
- 126, 126, 53, 126, 126, 126, 126, 126,
- 126, 1, 127, 1, 128, 128, 1, 128,
- 56, 128, 126, 52, 126, 126, 53, 126,
- 126, 126, 126, 126, 126, 1, 129, 130,
- 129, 131, 131, 131, 132, 133, 131, 131,
- 131, 131, 131, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 134, 135, 134,
- 135, 42, 42, 42, 42, 42, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 136, 136, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 137, 137, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 138, 44, 45, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 139, 140, 139, 140, 42, 42,
- 42, 42, 42, 1, 141, 41, 141, 42,
- 42, 42, 43, 44, 142, 42, 42, 42,
- 42, 42, 1, 143, 144, 143, 16, 28,
- 142, 1, 145, 1, 146, 146, 1, 146,
- 146, 16, 28, 142, 1, 142, 147, 142,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 148, 51, 51, 1, 149, 1, 150, 150,
- 1, 150, 56, 150, 51, 52, 51, 51,
- 53, 51, 51, 51, 148, 51, 51, 1,
- 151, 152, 151, 153, 155, 154, 1, 156,
- 41, 156, 42, 42, 42, 43, 44, 157,
- 42, 42, 42, 42, 42, 1, 158, 159,
- 158, 16, 28, 157, 1, 160, 1, 161,
- 161, 1, 161, 161, 16, 28, 157, 1,
- 157, 162, 157, 51, 52, 51, 51, 53,
- 51, 51, 51, 163, 51, 51, 1, 164,
- 1, 165, 165, 1, 165, 56, 165, 51,
- 52, 51, 51, 53, 51, 51, 51, 163,
- 51, 51, 1, 166, 167, 166, 168, 170,
- 169, 1, 40, 41, 40, 42, 42, 42,
- 43, 44, 45, 171, 171, 42, 42, 42,
- 42, 42, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 172, 172, 42, 42,
- 42, 42, 42, 1, 173, 41, 173, 42,
- 42, 42, 43, 44, 174, 42, 42, 42,
- 42, 42, 1, 175, 176, 175, 16, 28,
- 174, 1, 177, 1, 178, 178, 1, 178,
- 178, 16, 28, 174, 1, 174, 179, 174,
- 180, 52, 180, 180, 53, 180, 180, 180,
- 180, 180, 180, 1, 181, 1, 182, 182,
- 1, 182, 56, 182, 180, 52, 180, 180,
- 53, 180, 180, 180, 180, 180, 180, 1,
- 183, 184, 183, 185, 185, 185, 186, 187,
- 185, 185, 185, 185, 185, 1, 188, 41,
- 188, 42, 42, 42, 43, 44, 189, 42,
- 42, 42, 42, 42, 1, 190, 191, 190,
- 16, 28, 189, 1, 192, 1, 193, 193,
- 1, 193, 193, 16, 28, 189, 1, 189,
- 194, 189, 51, 52, 51, 51, 195, 196,
- 53, 51, 51, 51, 51, 51, 51, 1,
- 197, 1, 198, 198, 1, 198, 56, 198,
- 51, 52, 51, 51, 195, 196, 53, 51,
- 51, 51, 51, 51, 51, 1, 199, 200,
- 199, 201, 202, 203, 1, 199, 200, 199,
- 201, 203, 204, 1, 199, 200, 199, 201,
- 203, 205, 1, 199, 200, 199, 201, 203,
- 206, 1, 199, 200, 199, 201, 203, 1,
- 199, 200, 199, 201, 207, 203, 1, 199,
- 200, 199, 201, 208, 203, 1, 199, 200,
- 199, 201, 209, 203, 1, 199, 200, 199,
- 201, 206, 203, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 210, 210, 42,
- 42, 42, 42, 42, 1, 40, 41, 40,
- 42, 42, 42, 43, 44, 45, 211, 211,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 212, 44, 45,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 213,
- 214, 213, 214, 42, 42, 42, 42, 42,
- 1, 215, 41, 215, 42, 42, 42, 43,
- 44, 216, 42, 42, 42, 42, 42, 1,
- 217, 218, 217, 16, 28, 216, 1, 219,
- 1, 220, 220, 1, 220, 220, 16, 28,
- 216, 1, 216, 221, 216, 51, 52, 51,
- 51, 53, 51, 51, 51, 222, 51, 51,
- 1, 223, 1, 224, 224, 1, 224, 56,
- 224, 51, 52, 51, 51, 53, 51, 51,
- 51, 222, 51, 51, 1, 225, 226, 225,
- 227, 229, 228, 1, 230, 41, 230, 42,
- 42, 42, 43, 44, 231, 42, 42, 42,
- 42, 42, 1, 232, 233, 232, 16, 28,
- 231, 1, 234, 1, 235, 235, 1, 235,
- 235, 16, 28, 231, 1, 231, 236, 231,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 237, 51, 51, 1, 238, 1, 239, 239,
- 1, 239, 56, 239, 51, 52, 51, 51,
- 53, 51, 51, 51, 237, 51, 51, 1,
- 240, 241, 240, 242, 244, 243, 1, 1,
- 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Server_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 21, 19, 20, 22, 46, 21,
- 17, 26, 22, 23, 26, 24, 25, 27,
- 30, 84, 96, 109, 146, 164, 28, 29,
- 31, 46, 30, 17, 26, 35, 31, 32,
- 33, 34, 36, 48, 42, 49, 37, 38,
- 39, 40, 41, 43, 45, 47, 44, 22,
- 188, 50, 83, 51, 54, 52, 53, 55,
- 70, 56, 68, 57, 58, 66, 59, 60,
- 64, 61, 62, 63, 65, 67, 69, 71,
- 79, 72, 75, 73, 74, 76, 77, 78,
- 80, 81, 82, 85, 86, 87, 91, 87,
- 88, 89, 90, 92, 95, 93, 94, 22,
- 46, 95, 17, 26, 97, 98, 99, 100,
- 104, 100, 101, 102, 103, 105, 108, 106,
- 107, 22, 46, 108, 17, 26, 110, 134,
- 111, 112, 113, 114, 124, 115, 119, 115,
- 116, 117, 118, 120, 123, 121, 122, 22,
- 46, 17, 123, 26, 125, 129, 125, 126,
- 127, 128, 130, 133, 131, 132, 22, 46,
- 17, 133, 26, 135, 136, 137, 141, 137,
- 138, 139, 140, 142, 145, 143, 144, 22,
- 46, 145, 17, 26, 147, 151, 147, 148,
- 149, 150, 152, 155, 160, 153, 154, 22,
- 46, 17, 156, 26, 157, 158, 159, 161,
- 162, 163, 165, 166, 167, 168, 178, 169,
- 173, 169, 170, 171, 172, 174, 177, 175,
- 176, 22, 46, 17, 177, 26, 179, 183,
- 179, 180, 181, 182, 184, 187, 185, 186,
- 22, 46, 17, 187, 26
-};
-
-static const char _tsip_machine_parser_header_Security_Server_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 0, 0, 28, 28, 0,
- 28, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 55, 55, 0, 55, 21, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 23, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 46,
- 46, 0, 46, 15, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 43, 43, 0, 43, 13, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 34,
- 34, 34, 0, 7, 55, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 31, 31,
- 31, 0, 5, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 49,
- 49, 0, 49, 17, 55, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 52,
- 52, 52, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 40, 40, 40, 0, 11, 55, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 37, 37, 37, 0, 9
-};
-
-static const int tsip_machine_parser_header_Security_Server_start = 1;
-static const int tsip_machine_parser_header_Security_Server_first_final = 188;
-static const int tsip_machine_parser_header_Security_Server_error = 0;
-
-static const int tsip_machine_parser_header_Security_Server_en_main = 1;
-
-
-/* #line 214 "./ragel/tsip_parser_header_Security_Server.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Security_Server_first_final);
- (void)(tsip_machine_parser_header_Security_Server_error);
- (void)(tsip_machine_parser_header_Security_Server_en_main);
-
-/* #line 684 "./src/headers/tsip_header_Security_Server.c" */
- {
- cs = tsip_machine_parser_header_Security_Server_start;
- }
-
-/* #line 219 "./ragel/tsip_parser_header_Security_Server.rl" */
-
-/* #line 691 "./src/headers/tsip_header_Security_Server.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Security_Servers_L_t *hdr_securityservers = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Security_Server_t *curr_securityserver = tsk_null;
+
+
+ /* #line 117 "./src/headers/tsip_header_Security_Server.c" */
+ static const char _tsip_machine_parser_header_Security_Server_actions[] = {
+ 0, 1, 0, 1, 3, 1, 4, 1,
+ 5, 1, 6, 1, 7, 1, 8, 1,
+ 9, 1, 10, 1, 11, 1, 12, 1,
+ 13, 2, 1, 0, 2, 3, 2, 2,
+ 4, 2, 2, 5, 2, 2, 6, 2,
+ 2, 7, 2, 2, 8, 2, 2, 9,
+ 2, 2, 10, 2, 2, 11, 2, 2,
+ 12, 2
+ };
+
+ static const short _tsip_machine_parser_header_Security_Server_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 17, 19, 21, 23, 25, 27,
+ 29, 32, 49, 50, 52, 68, 85, 90,
+ 91, 93, 97, 124, 125, 127, 153, 171,
+ 177, 178, 180, 185, 204, 205, 207, 226,
+ 227, 229, 232, 240, 241, 243, 248, 249,
+ 255, 272, 279, 287, 295, 303, 305, 312,
+ 321, 323, 326, 328, 331, 333, 336, 339,
+ 340, 343, 344, 347, 348, 357, 366, 374,
+ 382, 390, 398, 400, 406, 415, 424, 433,
+ 435, 438, 441, 442, 443, 463, 483, 501,
+ 507, 508, 510, 515, 534, 535, 537, 556,
+ 573, 593, 613, 633, 651, 657, 658, 660,
+ 665, 684, 685, 687, 706, 723, 745, 765,
+ 785, 804, 826, 844, 850, 851, 853, 858,
+ 877, 878, 880, 899, 906, 924, 930, 931,
+ 933, 938, 957, 958, 960, 979, 986, 1006,
+ 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
+ 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
+ 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
+ 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
+ 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
+ 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
+ 1461, 1462, 1464, 1483, 1490
+ };
+
+ static const char _tsip_machine_parser_header_Security_Server_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 85, 117,
+ 82, 114, 73, 105, 84, 116, 89, 121,
+ 45, 83, 115, 69, 101, 82, 114, 86,
+ 118, 69, 101, 82, 114, 9, 32, 58,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 10, 9, 32, 9, 32, 44,
+ 59, 9, 13, 32, 33, 37, 39, 65,
+ 69, 80, 81, 83, 97, 101, 112, 113,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 65, 69, 80, 81,
+ 83, 97, 101, 112, 113, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 44, 59,
+ 10, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 44, 59, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 76, 108, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 71, 103, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 61, 10, 9, 32, 9, 32,
+ 44, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 65, 97,
+ 126, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 71, 103,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 79, 82, 111, 114,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 82, 114, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 84, 116,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 61, 84,
+ 116, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 10, 9, 32, 9,
+ 32, 44, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 59, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 48, 57, 9, 13, 32, 44,
+ 59, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 48, 59, 9, 13, 32,
+ 44, 48, 59, 9, 13, 32, 44, 48,
+ 59, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 80, 112, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Server_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 2, 2,
+ 3, 7, 1, 2, 6, 9, 5, 1,
+ 2, 4, 17, 1, 2, 16, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 5, 1, 0,
+ 9, 1, 2, 2, 2, 2, 1, 3,
+ 0, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 12, 12, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 9,
+ 12, 12, 12, 10, 6, 1, 2, 5,
+ 9, 1, 2, 9, 9, 14, 12, 12,
+ 11, 14, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 10, 6, 1, 2,
+ 5, 9, 1, 2, 9, 5, 12, 12,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 9, 10, 6, 1, 2, 5, 11,
+ 1, 2, 11, 6, 5, 5, 5, 5,
+ 6, 6, 6, 6, 12, 12, 11, 14,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 5, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Server_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 3,
+ 4, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 4, 4, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 4,
+ 4, 4, 4, 4, 0, 0, 0, 0,
+ 5, 0, 0, 5, 4, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 4, 0, 0, 0,
+ 0, 5, 0, 0, 5, 1, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 1, 1, 1, 0,
+ 0, 0, 0, 0, 4, 4, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 1, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_Security_Server_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 24, 26, 29, 32, 35, 38, 41,
+ 44, 48, 61, 63, 66, 78, 92, 98,
+ 100, 103, 108, 131, 133, 136, 158, 173,
+ 180, 182, 185, 191, 206, 208, 211, 226,
+ 228, 231, 235, 242, 244, 247, 253, 255,
+ 259, 273, 278, 284, 290, 296, 299, 304,
+ 311, 313, 316, 318, 321, 323, 326, 329,
+ 331, 334, 336, 339, 341, 348, 355, 361,
+ 367, 373, 379, 382, 386, 393, 400, 407,
+ 409, 412, 415, 417, 419, 436, 453, 468,
+ 475, 477, 480, 486, 501, 503, 506, 521,
+ 535, 552, 569, 586, 601, 608, 610, 613,
+ 619, 634, 636, 639, 654, 668, 687, 704,
+ 721, 737, 756, 771, 778, 780, 783, 789,
+ 804, 806, 809, 824, 831, 846, 853, 855,
+ 858, 864, 879, 881, 884, 899, 906, 923,
+ 940, 955, 962, 964, 967, 973, 988, 990,
+ 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
+ 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
+ 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
+ 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
+ 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
+ 1348, 1350, 1353, 1368, 1375
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Server_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 8, 1,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 15, 1, 15, 15, 16, 1,
+ 16, 17, 16, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 1, 19, 1, 20,
+ 20, 1, 20, 20, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 1, 21, 22,
+ 21, 23, 23, 23, 24, 25, 23, 23,
+ 23, 23, 23, 1, 26, 27, 26, 16,
+ 28, 1, 29, 1, 30, 30, 1, 30,
+ 30, 16, 28, 1, 28, 31, 28, 32,
+ 32, 32, 33, 34, 35, 36, 37, 33,
+ 34, 35, 36, 37, 32, 32, 32, 32,
+ 32, 32, 1, 38, 1, 39, 39, 1,
+ 39, 39, 32, 32, 32, 33, 34, 35,
+ 36, 37, 33, 34, 35, 36, 37, 32,
+ 32, 32, 32, 32, 32, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 42,
+ 42, 42, 42, 42, 1, 46, 47, 46,
+ 16, 28, 45, 1, 48, 1, 49, 49,
+ 1, 49, 49, 16, 28, 45, 1, 45,
+ 50, 45, 51, 52, 51, 51, 53, 51,
+ 51, 51, 51, 51, 51, 1, 54, 1,
+ 55, 55, 1, 55, 56, 55, 51, 52,
+ 51, 51, 53, 51, 51, 51, 51, 51,
+ 51, 1, 57, 1, 58, 58, 1, 58,
+ 58, 52, 1, 59, 60, 61, 1, 1,
+ 1, 52, 62, 1, 52, 52, 1, 63,
+ 41, 63, 43, 44, 1, 64, 1, 52,
+ 52, 52, 1, 63, 41, 63, 51, 51,
+ 51, 43, 44, 51, 51, 51, 51, 51,
+ 1, 66, 65, 65, 65, 1, 68, 60,
+ 67, 67, 67, 1, 68, 60, 69, 69,
+ 69, 1, 68, 60, 70, 70, 70, 1,
+ 68, 60, 1, 72, 71, 65, 65, 1,
+ 73, 68, 60, 74, 67, 67, 1, 75,
+ 1, 76, 77, 1, 78, 1, 79, 80,
+ 1, 81, 1, 60, 82, 1, 60, 83,
+ 1, 60, 1, 79, 84, 1, 79, 1,
+ 76, 85, 1, 76, 1, 73, 68, 60,
+ 86, 69, 69, 1, 73, 68, 60, 70,
+ 70, 70, 1, 88, 60, 87, 87, 87,
+ 1, 90, 60, 89, 89, 89, 1, 90,
+ 60, 91, 91, 91, 1, 90, 60, 92,
+ 92, 92, 1, 90, 60, 1, 93, 87,
+ 87, 1, 73, 90, 60, 94, 89, 89,
+ 1, 73, 90, 60, 95, 91, 91, 1,
+ 73, 90, 60, 92, 92, 92, 1, 96,
+ 1, 73, 97, 1, 73, 98, 1, 73,
+ 1, 72, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 99, 99, 42, 42,
+ 42, 42, 42, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 100, 100, 42,
+ 42, 42, 42, 42, 1, 101, 41, 101,
+ 42, 42, 42, 43, 44, 102, 42, 42,
+ 42, 42, 42, 1, 103, 104, 103, 16,
+ 28, 102, 1, 105, 1, 106, 106, 1,
+ 106, 106, 16, 28, 102, 1, 102, 107,
+ 102, 108, 52, 108, 108, 53, 108, 108,
+ 108, 108, 108, 108, 1, 109, 1, 110,
+ 110, 1, 110, 56, 110, 108, 52, 108,
+ 108, 53, 108, 108, 108, 108, 108, 108,
+ 1, 111, 112, 111, 113, 113, 113, 114,
+ 115, 113, 113, 113, 113, 113, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 116, 116, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 117, 117, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 118, 118, 42, 42, 42, 42,
+ 42, 1, 119, 41, 119, 42, 42, 42,
+ 43, 44, 120, 42, 42, 42, 42, 42,
+ 1, 121, 122, 121, 16, 28, 120, 1,
+ 123, 1, 124, 124, 1, 124, 124, 16,
+ 28, 120, 1, 120, 125, 120, 126, 52,
+ 126, 126, 53, 126, 126, 126, 126, 126,
+ 126, 1, 127, 1, 128, 128, 1, 128,
+ 56, 128, 126, 52, 126, 126, 53, 126,
+ 126, 126, 126, 126, 126, 1, 129, 130,
+ 129, 131, 131, 131, 132, 133, 131, 131,
+ 131, 131, 131, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 134, 135, 134,
+ 135, 42, 42, 42, 42, 42, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 136, 136, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 137, 137, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 138, 44, 45, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 139, 140, 139, 140, 42, 42,
+ 42, 42, 42, 1, 141, 41, 141, 42,
+ 42, 42, 43, 44, 142, 42, 42, 42,
+ 42, 42, 1, 143, 144, 143, 16, 28,
+ 142, 1, 145, 1, 146, 146, 1, 146,
+ 146, 16, 28, 142, 1, 142, 147, 142,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 148, 51, 51, 1, 149, 1, 150, 150,
+ 1, 150, 56, 150, 51, 52, 51, 51,
+ 53, 51, 51, 51, 148, 51, 51, 1,
+ 151, 152, 151, 153, 155, 154, 1, 156,
+ 41, 156, 42, 42, 42, 43, 44, 157,
+ 42, 42, 42, 42, 42, 1, 158, 159,
+ 158, 16, 28, 157, 1, 160, 1, 161,
+ 161, 1, 161, 161, 16, 28, 157, 1,
+ 157, 162, 157, 51, 52, 51, 51, 53,
+ 51, 51, 51, 163, 51, 51, 1, 164,
+ 1, 165, 165, 1, 165, 56, 165, 51,
+ 52, 51, 51, 53, 51, 51, 51, 163,
+ 51, 51, 1, 166, 167, 166, 168, 170,
+ 169, 1, 40, 41, 40, 42, 42, 42,
+ 43, 44, 45, 171, 171, 42, 42, 42,
+ 42, 42, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 172, 172, 42, 42,
+ 42, 42, 42, 1, 173, 41, 173, 42,
+ 42, 42, 43, 44, 174, 42, 42, 42,
+ 42, 42, 1, 175, 176, 175, 16, 28,
+ 174, 1, 177, 1, 178, 178, 1, 178,
+ 178, 16, 28, 174, 1, 174, 179, 174,
+ 180, 52, 180, 180, 53, 180, 180, 180,
+ 180, 180, 180, 1, 181, 1, 182, 182,
+ 1, 182, 56, 182, 180, 52, 180, 180,
+ 53, 180, 180, 180, 180, 180, 180, 1,
+ 183, 184, 183, 185, 185, 185, 186, 187,
+ 185, 185, 185, 185, 185, 1, 188, 41,
+ 188, 42, 42, 42, 43, 44, 189, 42,
+ 42, 42, 42, 42, 1, 190, 191, 190,
+ 16, 28, 189, 1, 192, 1, 193, 193,
+ 1, 193, 193, 16, 28, 189, 1, 189,
+ 194, 189, 51, 52, 51, 51, 195, 196,
+ 53, 51, 51, 51, 51, 51, 51, 1,
+ 197, 1, 198, 198, 1, 198, 56, 198,
+ 51, 52, 51, 51, 195, 196, 53, 51,
+ 51, 51, 51, 51, 51, 1, 199, 200,
+ 199, 201, 202, 203, 1, 199, 200, 199,
+ 201, 203, 204, 1, 199, 200, 199, 201,
+ 203, 205, 1, 199, 200, 199, 201, 203,
+ 206, 1, 199, 200, 199, 201, 203, 1,
+ 199, 200, 199, 201, 207, 203, 1, 199,
+ 200, 199, 201, 208, 203, 1, 199, 200,
+ 199, 201, 209, 203, 1, 199, 200, 199,
+ 201, 206, 203, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 210, 210, 42,
+ 42, 42, 42, 42, 1, 40, 41, 40,
+ 42, 42, 42, 43, 44, 45, 211, 211,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 212, 44, 45,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 213,
+ 214, 213, 214, 42, 42, 42, 42, 42,
+ 1, 215, 41, 215, 42, 42, 42, 43,
+ 44, 216, 42, 42, 42, 42, 42, 1,
+ 217, 218, 217, 16, 28, 216, 1, 219,
+ 1, 220, 220, 1, 220, 220, 16, 28,
+ 216, 1, 216, 221, 216, 51, 52, 51,
+ 51, 53, 51, 51, 51, 222, 51, 51,
+ 1, 223, 1, 224, 224, 1, 224, 56,
+ 224, 51, 52, 51, 51, 53, 51, 51,
+ 51, 222, 51, 51, 1, 225, 226, 225,
+ 227, 229, 228, 1, 230, 41, 230, 42,
+ 42, 42, 43, 44, 231, 42, 42, 42,
+ 42, 42, 1, 232, 233, 232, 16, 28,
+ 231, 1, 234, 1, 235, 235, 1, 235,
+ 235, 16, 28, 231, 1, 231, 236, 231,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 237, 51, 51, 1, 238, 1, 239, 239,
+ 1, 239, 56, 239, 51, 52, 51, 51,
+ 53, 51, 51, 51, 237, 51, 51, 1,
+ 240, 241, 240, 242, 244, 243, 1, 1,
+ 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Server_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 21, 19, 20, 22, 46, 21,
+ 17, 26, 22, 23, 26, 24, 25, 27,
+ 30, 84, 96, 109, 146, 164, 28, 29,
+ 31, 46, 30, 17, 26, 35, 31, 32,
+ 33, 34, 36, 48, 42, 49, 37, 38,
+ 39, 40, 41, 43, 45, 47, 44, 22,
+ 188, 50, 83, 51, 54, 52, 53, 55,
+ 70, 56, 68, 57, 58, 66, 59, 60,
+ 64, 61, 62, 63, 65, 67, 69, 71,
+ 79, 72, 75, 73, 74, 76, 77, 78,
+ 80, 81, 82, 85, 86, 87, 91, 87,
+ 88, 89, 90, 92, 95, 93, 94, 22,
+ 46, 95, 17, 26, 97, 98, 99, 100,
+ 104, 100, 101, 102, 103, 105, 108, 106,
+ 107, 22, 46, 108, 17, 26, 110, 134,
+ 111, 112, 113, 114, 124, 115, 119, 115,
+ 116, 117, 118, 120, 123, 121, 122, 22,
+ 46, 17, 123, 26, 125, 129, 125, 126,
+ 127, 128, 130, 133, 131, 132, 22, 46,
+ 17, 133, 26, 135, 136, 137, 141, 137,
+ 138, 139, 140, 142, 145, 143, 144, 22,
+ 46, 145, 17, 26, 147, 151, 147, 148,
+ 149, 150, 152, 155, 160, 153, 154, 22,
+ 46, 17, 156, 26, 157, 158, 159, 161,
+ 162, 163, 165, 166, 167, 168, 178, 169,
+ 173, 169, 170, 171, 172, 174, 177, 175,
+ 176, 22, 46, 17, 177, 26, 179, 183,
+ 179, 180, 181, 182, 184, 187, 185, 186,
+ 22, 46, 17, 187, 26
+ };
+
+ static const char _tsip_machine_parser_header_Security_Server_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 0, 0, 28, 28, 0,
+ 28, 3, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 0, 0,
+ 55, 55, 0, 55, 21, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 23, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 46,
+ 46, 0, 46, 15, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 43, 43, 0, 43, 13, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 34,
+ 34, 34, 0, 7, 55, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 31, 31,
+ 31, 0, 5, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 49,
+ 49, 0, 49, 17, 55, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 52,
+ 52, 52, 0, 19, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 40, 40, 40, 0, 11, 55, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 37, 37, 37, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_Security_Server_start = 1;
+ static const int tsip_machine_parser_header_Security_Server_first_final = 188;
+ static const int tsip_machine_parser_header_Security_Server_error = 0;
+
+ static const int tsip_machine_parser_header_Security_Server_en_main = 1;
+
+
+ /* #line 214 "./ragel/tsip_parser_header_Security_Server.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Security_Server_first_final);
+ (void)(tsip_machine_parser_header_Security_Server_error);
+ (void)(tsip_machine_parser_header_Security_Server_en_main);
+
+ /* #line 684 "./src/headers/tsip_header_Security_Server.c" */
+ {
+ cs = tsip_machine_parser_header_Security_Server_start;
+ }
+
+ /* #line 219 "./ragel/tsip_parser_header_Security_Server.rl" */
+
+ /* #line 691 "./src/headers/tsip_header_Security_Server.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Security_Server_trans_keys + _tsip_machine_parser_header_Security_Server_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Security_Server_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Security_Server_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Security_Server_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Security_Server_trans_keys + _tsip_machine_parser_header_Security_Server_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Security_Server_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Security_Server_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Security_Server_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Security_Server_indicies[_trans];
- cs = _tsip_machine_parser_header_Security_Server_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Security_Server_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Security_Server_actions + _tsip_machine_parser_header_Security_Server_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 52 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 56 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(!curr_securityserver){
- curr_securityserver = tsip_header_Security_Server_create_null();
- }
- }
- break;
- case 2:
-/* #line 62 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- tsk_list_push_back_data(hdr_securityservers, ((void**) &curr_securityserver));
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_STRING(curr_securityserver->mech);
- }
- }
- break;
- case 4:
-/* #line 74 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_INT(curr_securityserver->port_s);
- }
- }
- break;
- case 5:
-/* #line 80 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_INT(curr_securityserver->port_c);
- }
- }
- break;
- case 6:
-/* #line 86 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_UINT(curr_securityserver->spi_s);
- }
- }
- break;
- case 7:
-/* #line 92 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_UINT(curr_securityserver->spi_c);
- }
- }
- break;
- case 8:
-/* #line 98 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_STRING(curr_securityserver->ealg);
- }
- }
- break;
- case 9:
-/* #line 104 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_STRING(curr_securityserver->alg);
- }
- }
- break;
- case 10:
-/* #line 110 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_STRING(curr_securityserver->prot);
- }
- }
- break;
- case 11:
-/* #line 116 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_SET_DOUBLE(curr_securityserver->q);
- }
- }
- break;
- case 12:
-/* #line 122 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- if(curr_securityserver){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityserver));
- }
- }
- break;
- case 13:
-/* #line 128 "./ragel/tsip_parser_header_Security_Server.rl" */
- {
- }
- break;
-/* #line 872 "./src/headers/tsip_header_Security_Server.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Security_Server_indicies[_trans];
+ cs = _tsip_machine_parser_header_Security_Server_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Security_Server_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Security_Server_actions + _tsip_machine_parser_header_Security_Server_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 52 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 56 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(!curr_securityserver) {
+ curr_securityserver = tsip_header_Security_Server_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 62 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ tsk_list_push_back_data(hdr_securityservers, ((void**) &curr_securityserver));
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_STRING(curr_securityserver->mech);
+ }
+ }
+ break;
+ case 4:
+ /* #line 74 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_INT(curr_securityserver->port_s);
+ }
+ }
+ break;
+ case 5:
+ /* #line 80 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_INT(curr_securityserver->port_c);
+ }
+ }
+ break;
+ case 6:
+ /* #line 86 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_UINT(curr_securityserver->spi_s);
+ }
+ }
+ break;
+ case 7:
+ /* #line 92 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_UINT(curr_securityserver->spi_c);
+ }
+ }
+ break;
+ case 8:
+ /* #line 98 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_STRING(curr_securityserver->ealg);
+ }
+ }
+ break;
+ case 9:
+ /* #line 104 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_STRING(curr_securityserver->alg);
+ }
+ }
+ break;
+ case 10:
+ /* #line 110 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_STRING(curr_securityserver->prot);
+ }
+ }
+ break;
+ case 11:
+ /* #line 116 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_SET_DOUBLE(curr_securityserver->q);
+ }
+ }
+ break;
+ case 12:
+ /* #line 122 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ if(curr_securityserver) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityserver));
+ }
+ }
+ break;
+ case 13:
+ /* #line 128 "./ragel/tsip_parser_header_Security_Server.rl" */
+ {
+ }
+ break;
+ /* #line 872 "./src/headers/tsip_header_Security_Server.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 220 "./ragel/tsip_parser_header_Security_Server.rl" */
-
- if( cs <
-/* #line 888 "./src/headers/tsip_header_Security_Server.c" */
-188
-/* #line 221 "./ragel/tsip_parser_header_Security_Server.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Security-Server' header.");
- TSK_OBJECT_SAFE_FREE(curr_securityserver);
- TSK_OBJECT_SAFE_FREE(hdr_securityservers);
- }
-
- return hdr_securityservers;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 220 "./ragel/tsip_parser_header_Security_Server.rl" */
+
+ if( cs <
+ /* #line 888 "./src/headers/tsip_header_Security_Server.c" */
+ 188
+ /* #line 221 "./ragel/tsip_parser_header_Security_Server.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Security-Server' header.");
+ TSK_OBJECT_SAFE_FREE(curr_securityserver);
+ TSK_OBJECT_SAFE_FREE(hdr_securityservers);
+ }
+
+ return hdr_securityservers;
}
@@ -906,44 +917,43 @@ _again:
static tsk_object_t* tsip_header_Security_Server_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Security_Server_t *Security_Server = self;
- if(Security_Server){
-
- TSIP_HEADER(Security_Server)->type = tsip_htype_Security_Server;
- TSIP_HEADER(Security_Server)->serialize = tsip_header_Security_Server_serialize;
-
- Security_Server->q = -1;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Security_Server header.");
- }
- return self;
+ tsip_header_Security_Server_t *Security_Server = self;
+ if(Security_Server) {
+
+ TSIP_HEADER(Security_Server)->type = tsip_htype_Security_Server;
+ TSIP_HEADER(Security_Server)->serialize = tsip_header_Security_Server_serialize;
+
+ Security_Server->q = -1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Security_Server header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Security_Server_dtor(tsk_object_t *self)
{
- tsip_header_Security_Server_t *Security_Server = self;
- if(Security_Server){
- TSK_FREE(Security_Server->mech);
- TSK_FREE(Security_Server->alg);
- TSK_FREE(Security_Server->prot);
- TSK_FREE(Security_Server->mod);
- TSK_FREE(Security_Server->ealg);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Server));
- }
- else{
- TSK_DEBUG_ERROR("Null Security_Server header.");
- }
-
- return self;
+ tsip_header_Security_Server_t *Security_Server = self;
+ if(Security_Server) {
+ TSK_FREE(Security_Server->mech);
+ TSK_FREE(Security_Server->alg);
+ TSK_FREE(Security_Server->prot);
+ TSK_FREE(Security_Server->mod);
+ TSK_FREE(Security_Server->ealg);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Server));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Security_Server header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Security_Server_def_s =
-{
- sizeof(tsip_header_Security_Server_t),
- tsip_header_Security_Server_ctor,
- tsip_header_Security_Server_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Security_Server_def_s = {
+ sizeof(tsip_header_Security_Server_t),
+ tsip_header_Security_Server_ctor,
+ tsip_header_Security_Server_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Security_Server_def_t = &tsip_header_Security_Server_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Security_Verify.c b/tinySIP/src/headers/tsip_header_Security_Verify.c
index fc87164..e453b17 100755
--- a/tinySIP/src/headers/tsip_header_Security_Verify.c
+++ b/tinySIP/src/headers/tsip_header_Security_Verify.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,848 +50,859 @@
tsip_header_Security_Verify_t* tsip_header_Security_Verify_create()
{
- return tsk_object_new(TSIP_HEADER_SECURITY_VERIFY_VA_ARGS());
+ return tsk_object_new(TSIP_HEADER_SECURITY_VERIFY_VA_ARGS());
}
tsip_header_Security_Verify_t* tsip_header_Security_Verify_create_null()
{
- return tsip_header_Security_Verify_create();
+ return tsip_header_Security_Verify_create();
}
int tsip_header_Security_Verify_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Security_Verify_t *Security_Verify = (const tsip_header_Security_Verify_t *)header;
- int ret = 0;
-
- // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
- if(tsk_striequals(Security_Verify->mech, "ipsec-3gpp")){
- ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
- Security_Verify->mech,
-
- Security_Verify->alg ? ";alg=" : "",
- Security_Verify->alg ? Security_Verify->alg : "",
-
- Security_Verify->ealg ? ";ealg=" : "",
- Security_Verify->ealg ? Security_Verify->ealg : "",
-
- Security_Verify->prot ? ";prot=" : "",
- Security_Verify->prot ? Security_Verify->prot : "",
-
- Security_Verify->spi_c,
- Security_Verify->spi_s,
- Security_Verify->port_c,
- Security_Verify->port_s
- );
- }
- else if(Security_Verify->mech){
- tsk_buffer_append(output, Security_Verify->mech, tsk_strlen(Security_Verify->mech));
- }
-
- if(Security_Verify->q >= 0){
- /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
- tsk_buffer_append_2(output, ";q=%1.3f", Security_Verify->q);
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Security_Verify_t *Security_Verify = (const tsip_header_Security_Verify_t *)header;
+ int ret = 0;
+
+ // ipsec-3gpp; alg=hmac-md5-96; ealg=des-ede3-cbc; spi-c=1111; spi-s=2222; port-c=5062; port-s=5064
+ if(tsk_striequals(Security_Verify->mech, "ipsec-3gpp")) {
+ ret = tsk_buffer_append_2(output, "%s%s%s%s%s%s%s;spi-c=%u;spi-s=%u;port-c=%u;port-s=%u",
+ Security_Verify->mech,
+
+ Security_Verify->alg ? ";alg=" : "",
+ Security_Verify->alg ? Security_Verify->alg : "",
+
+ Security_Verify->ealg ? ";ealg=" : "",
+ Security_Verify->ealg ? Security_Verify->ealg : "",
+
+ Security_Verify->prot ? ";prot=" : "",
+ Security_Verify->prot ? Security_Verify->prot : "",
+
+ Security_Verify->spi_c,
+ Security_Verify->spi_s,
+ Security_Verify->port_c,
+ Security_Verify->port_s
+ );
+ }
+ else if(Security_Verify->mech) {
+ tsk_buffer_append(output, Security_Verify->mech, tsk_strlen(Security_Verify->mech));
+ }
+
+ if(Security_Verify->q >= 0) {
+ /* qvalue = ("0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] ) */
+ tsk_buffer_append_2(output, ";q=%1.3f", Security_Verify->q);
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Security_Verifies_L_t *tsip_header_Security_Verify_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Security_Verifies_L_t *hdr_securityverifies = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Security_Verify_t *curr_securityverify = tsk_null;
-
-
-/* #line 115 "./src/headers/tsip_header_Security_Verify.c" */
-static const char _tsip_machine_parser_header_Security_Verify_actions[] = {
- 0, 1, 0, 1, 3, 1, 4, 1,
- 5, 1, 6, 1, 7, 1, 8, 1,
- 9, 1, 10, 1, 11, 1, 12, 1,
- 13, 2, 1, 0, 2, 3, 2, 2,
- 4, 2, 2, 5, 2, 2, 6, 2,
- 2, 7, 2, 2, 8, 2, 2, 9,
- 2, 2, 10, 2, 2, 11, 2, 2,
- 12, 2
-};
-
-static const short _tsip_machine_parser_header_Security_Verify_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 17, 19, 21, 23, 25, 27,
- 29, 32, 49, 50, 52, 68, 85, 90,
- 91, 93, 97, 124, 125, 127, 153, 171,
- 177, 178, 180, 185, 204, 205, 207, 226,
- 227, 229, 232, 240, 241, 243, 248, 249,
- 255, 272, 279, 287, 295, 303, 305, 312,
- 321, 323, 326, 328, 331, 333, 336, 339,
- 340, 343, 344, 347, 348, 357, 366, 374,
- 382, 390, 398, 400, 406, 415, 424, 433,
- 435, 438, 441, 442, 443, 463, 483, 501,
- 507, 508, 510, 515, 534, 535, 537, 556,
- 573, 593, 613, 633, 651, 657, 658, 660,
- 665, 684, 685, 687, 706, 723, 745, 765,
- 785, 804, 826, 844, 850, 851, 853, 858,
- 877, 878, 880, 899, 906, 924, 930, 931,
- 933, 938, 957, 958, 960, 979, 986, 1006,
- 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
- 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
- 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
- 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
- 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
- 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
- 1461, 1462, 1464, 1483, 1490
-};
-
-static const char _tsip_machine_parser_header_Security_Verify_trans_keys[] = {
- 83, 115, 69, 101, 67, 99, 85, 117,
- 82, 114, 73, 105, 84, 116, 89, 121,
- 45, 86, 118, 69, 101, 82, 114, 73,
- 105, 70, 102, 89, 121, 9, 32, 58,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 10, 9, 32, 9, 32, 44,
- 59, 9, 13, 32, 33, 37, 39, 65,
- 69, 80, 81, 83, 97, 101, 112, 113,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 65, 69, 80, 81,
- 83, 97, 101, 112, 113, 115, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 44, 59,
- 10, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 44, 59, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 76, 108, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 71, 103, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 44, 59, 61, 10, 9, 32, 9, 32,
- 44, 59, 61, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 65, 97,
- 126, 42, 46, 48, 57, 66, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 71, 103,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 79, 82, 111, 114,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 82, 114, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 84, 116,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 61, 84,
- 116, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 10, 9, 32, 9,
- 32, 44, 59, 61, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 48, 49, 91, 126, 42,
- 43, 45, 46, 50, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 59, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 48, 57, 9, 13, 32, 44,
- 59, 9, 13, 32, 44, 46, 59, 9,
- 13, 32, 44, 48, 59, 9, 13, 32,
- 44, 48, 59, 9, 13, 32, 44, 48,
- 59, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 80, 112, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 73, 105,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 44, 59, 61, 67, 83, 99,
- 115, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 126, 42, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 33, 34, 37,
- 39, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 10, 9, 32,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 48, 57, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Verify_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 2, 2, 2, 2,
- 3, 7, 1, 2, 6, 9, 5, 1,
- 2, 4, 17, 1, 2, 16, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 5, 1, 0,
- 9, 1, 2, 2, 2, 2, 1, 3,
- 0, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 12, 12, 10, 6,
- 1, 2, 5, 9, 1, 2, 9, 9,
- 12, 12, 12, 10, 6, 1, 2, 5,
- 9, 1, 2, 9, 9, 14, 12, 12,
- 11, 14, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 10, 6, 1, 2,
- 5, 9, 1, 2, 9, 5, 12, 12,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 9, 10, 6, 1, 2, 5, 11,
- 1, 2, 11, 6, 5, 5, 5, 5,
- 6, 6, 6, 6, 12, 12, 11, 14,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 5, 10, 6, 1, 2, 5, 9,
- 1, 2, 9, 5, 0
-};
-
-static const char _tsip_machine_parser_header_Security_Verify_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 5, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 3,
- 4, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 4, 4, 4, 0,
- 0, 0, 0, 5, 0, 0, 5, 4,
- 4, 4, 4, 4, 0, 0, 0, 0,
- 5, 0, 0, 5, 4, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 4, 0, 0, 0,
- 0, 5, 0, 0, 5, 1, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 4, 4, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 1, 4, 0, 0, 0, 0, 5,
- 0, 0, 5, 1, 0
-};
-
-static const short _tsip_machine_parser_header_Security_Verify_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 24, 26, 29, 32, 35, 38, 41,
- 44, 48, 61, 63, 66, 78, 92, 98,
- 100, 103, 108, 131, 133, 136, 158, 173,
- 180, 182, 185, 191, 206, 208, 211, 226,
- 228, 231, 235, 242, 244, 247, 253, 255,
- 259, 273, 278, 284, 290, 296, 299, 304,
- 311, 313, 316, 318, 321, 323, 326, 329,
- 331, 334, 336, 339, 341, 348, 355, 361,
- 367, 373, 379, 382, 386, 393, 400, 407,
- 409, 412, 415, 417, 419, 436, 453, 468,
- 475, 477, 480, 486, 501, 503, 506, 521,
- 535, 552, 569, 586, 601, 608, 610, 613,
- 619, 634, 636, 639, 654, 668, 687, 704,
- 721, 737, 756, 771, 778, 780, 783, 789,
- 804, 806, 809, 824, 831, 846, 853, 855,
- 858, 864, 879, 881, 884, 899, 906, 923,
- 940, 955, 962, 964, 967, 973, 988, 990,
- 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
- 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
- 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
- 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
- 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
- 1348, 1350, 1353, 1368, 1375
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Verify_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 8, 1,
- 9, 1, 10, 10, 1, 11, 11, 1,
- 12, 12, 1, 13, 13, 1, 14, 14,
- 1, 15, 15, 1, 15, 15, 16, 1,
- 16, 17, 16, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 1, 19, 1, 20,
- 20, 1, 20, 20, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 1, 21, 22,
- 21, 23, 23, 23, 24, 25, 23, 23,
- 23, 23, 23, 1, 26, 27, 26, 16,
- 28, 1, 29, 1, 30, 30, 1, 30,
- 30, 16, 28, 1, 28, 31, 28, 32,
- 32, 32, 33, 34, 35, 36, 37, 33,
- 34, 35, 36, 37, 32, 32, 32, 32,
- 32, 32, 1, 38, 1, 39, 39, 1,
- 39, 39, 32, 32, 32, 33, 34, 35,
- 36, 37, 33, 34, 35, 36, 37, 32,
- 32, 32, 32, 32, 32, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 42,
- 42, 42, 42, 42, 1, 46, 47, 46,
- 16, 28, 45, 1, 48, 1, 49, 49,
- 1, 49, 49, 16, 28, 45, 1, 45,
- 50, 45, 51, 52, 51, 51, 53, 51,
- 51, 51, 51, 51, 51, 1, 54, 1,
- 55, 55, 1, 55, 56, 55, 51, 52,
- 51, 51, 53, 51, 51, 51, 51, 51,
- 51, 1, 57, 1, 58, 58, 1, 58,
- 58, 52, 1, 59, 60, 61, 1, 1,
- 1, 52, 62, 1, 52, 52, 1, 63,
- 41, 63, 43, 44, 1, 64, 1, 52,
- 52, 52, 1, 63, 41, 63, 51, 51,
- 51, 43, 44, 51, 51, 51, 51, 51,
- 1, 66, 65, 65, 65, 1, 68, 60,
- 67, 67, 67, 1, 68, 60, 69, 69,
- 69, 1, 68, 60, 70, 70, 70, 1,
- 68, 60, 1, 72, 71, 65, 65, 1,
- 73, 68, 60, 74, 67, 67, 1, 75,
- 1, 76, 77, 1, 78, 1, 79, 80,
- 1, 81, 1, 60, 82, 1, 60, 83,
- 1, 60, 1, 79, 84, 1, 79, 1,
- 76, 85, 1, 76, 1, 73, 68, 60,
- 86, 69, 69, 1, 73, 68, 60, 70,
- 70, 70, 1, 88, 60, 87, 87, 87,
- 1, 90, 60, 89, 89, 89, 1, 90,
- 60, 91, 91, 91, 1, 90, 60, 92,
- 92, 92, 1, 90, 60, 1, 93, 87,
- 87, 1, 73, 90, 60, 94, 89, 89,
- 1, 73, 90, 60, 95, 91, 91, 1,
- 73, 90, 60, 92, 92, 92, 1, 96,
- 1, 73, 97, 1, 73, 98, 1, 73,
- 1, 72, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 99, 99, 42, 42,
- 42, 42, 42, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 100, 100, 42,
- 42, 42, 42, 42, 1, 101, 41, 101,
- 42, 42, 42, 43, 44, 102, 42, 42,
- 42, 42, 42, 1, 103, 104, 103, 16,
- 28, 102, 1, 105, 1, 106, 106, 1,
- 106, 106, 16, 28, 102, 1, 102, 107,
- 102, 108, 52, 108, 108, 53, 108, 108,
- 108, 108, 108, 108, 1, 109, 1, 110,
- 110, 1, 110, 56, 110, 108, 52, 108,
- 108, 53, 108, 108, 108, 108, 108, 108,
- 1, 111, 112, 111, 113, 113, 113, 114,
- 115, 113, 113, 113, 113, 113, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 116, 116, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 117, 117, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 118, 118, 42, 42, 42, 42,
- 42, 1, 119, 41, 119, 42, 42, 42,
- 43, 44, 120, 42, 42, 42, 42, 42,
- 1, 121, 122, 121, 16, 28, 120, 1,
- 123, 1, 124, 124, 1, 124, 124, 16,
- 28, 120, 1, 120, 125, 120, 126, 52,
- 126, 126, 53, 126, 126, 126, 126, 126,
- 126, 1, 127, 1, 128, 128, 1, 128,
- 56, 128, 126, 52, 126, 126, 53, 126,
- 126, 126, 126, 126, 126, 1, 129, 130,
- 129, 131, 131, 131, 132, 133, 131, 131,
- 131, 131, 131, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 134, 135, 134,
- 135, 42, 42, 42, 42, 42, 1, 40,
- 41, 40, 42, 42, 42, 43, 44, 45,
- 136, 136, 42, 42, 42, 42, 42, 1,
- 40, 41, 40, 42, 42, 42, 43, 44,
- 45, 137, 137, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 138, 44, 45, 42, 42, 42, 42, 42,
- 1, 40, 41, 40, 42, 42, 42, 43,
- 44, 45, 139, 140, 139, 140, 42, 42,
- 42, 42, 42, 1, 141, 41, 141, 42,
- 42, 42, 43, 44, 142, 42, 42, 42,
- 42, 42, 1, 143, 144, 143, 16, 28,
- 142, 1, 145, 1, 146, 146, 1, 146,
- 146, 16, 28, 142, 1, 142, 147, 142,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 148, 51, 51, 1, 149, 1, 150, 150,
- 1, 150, 56, 150, 51, 52, 51, 51,
- 53, 51, 51, 51, 148, 51, 51, 1,
- 151, 152, 151, 153, 155, 154, 1, 156,
- 41, 156, 42, 42, 42, 43, 44, 157,
- 42, 42, 42, 42, 42, 1, 158, 159,
- 158, 16, 28, 157, 1, 160, 1, 161,
- 161, 1, 161, 161, 16, 28, 157, 1,
- 157, 162, 157, 51, 52, 51, 51, 53,
- 51, 51, 51, 163, 51, 51, 1, 164,
- 1, 165, 165, 1, 165, 56, 165, 51,
- 52, 51, 51, 53, 51, 51, 51, 163,
- 51, 51, 1, 166, 167, 166, 168, 170,
- 169, 1, 40, 41, 40, 42, 42, 42,
- 43, 44, 45, 171, 171, 42, 42, 42,
- 42, 42, 1, 40, 41, 40, 42, 42,
- 42, 43, 44, 45, 172, 172, 42, 42,
- 42, 42, 42, 1, 173, 41, 173, 42,
- 42, 42, 43, 44, 174, 42, 42, 42,
- 42, 42, 1, 175, 176, 175, 16, 28,
- 174, 1, 177, 1, 178, 178, 1, 178,
- 178, 16, 28, 174, 1, 174, 179, 174,
- 180, 52, 180, 180, 53, 180, 180, 180,
- 180, 180, 180, 1, 181, 1, 182, 182,
- 1, 182, 56, 182, 180, 52, 180, 180,
- 53, 180, 180, 180, 180, 180, 180, 1,
- 183, 184, 183, 185, 185, 185, 186, 187,
- 185, 185, 185, 185, 185, 1, 188, 41,
- 188, 42, 42, 42, 43, 44, 189, 42,
- 42, 42, 42, 42, 1, 190, 191, 190,
- 16, 28, 189, 1, 192, 1, 193, 193,
- 1, 193, 193, 16, 28, 189, 1, 189,
- 194, 189, 51, 52, 51, 51, 195, 196,
- 53, 51, 51, 51, 51, 51, 51, 1,
- 197, 1, 198, 198, 1, 198, 56, 198,
- 51, 52, 51, 51, 195, 196, 53, 51,
- 51, 51, 51, 51, 51, 1, 199, 200,
- 199, 201, 202, 203, 1, 199, 200, 199,
- 201, 203, 204, 1, 199, 200, 199, 201,
- 203, 205, 1, 199, 200, 199, 201, 203,
- 206, 1, 199, 200, 199, 201, 203, 1,
- 199, 200, 199, 201, 207, 203, 1, 199,
- 200, 199, 201, 208, 203, 1, 199, 200,
- 199, 201, 209, 203, 1, 199, 200, 199,
- 201, 206, 203, 1, 40, 41, 40, 42,
- 42, 42, 43, 44, 45, 210, 210, 42,
- 42, 42, 42, 42, 1, 40, 41, 40,
- 42, 42, 42, 43, 44, 45, 211, 211,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 212, 44, 45,
- 42, 42, 42, 42, 42, 1, 40, 41,
- 40, 42, 42, 42, 43, 44, 45, 213,
- 214, 213, 214, 42, 42, 42, 42, 42,
- 1, 215, 41, 215, 42, 42, 42, 43,
- 44, 216, 42, 42, 42, 42, 42, 1,
- 217, 218, 217, 16, 28, 216, 1, 219,
- 1, 220, 220, 1, 220, 220, 16, 28,
- 216, 1, 216, 221, 216, 51, 52, 51,
- 51, 53, 51, 51, 51, 222, 51, 51,
- 1, 223, 1, 224, 224, 1, 224, 56,
- 224, 51, 52, 51, 51, 53, 51, 51,
- 51, 222, 51, 51, 1, 225, 226, 225,
- 227, 229, 228, 1, 230, 41, 230, 42,
- 42, 42, 43, 44, 231, 42, 42, 42,
- 42, 42, 1, 232, 233, 232, 16, 28,
- 231, 1, 234, 1, 235, 235, 1, 235,
- 235, 16, 28, 231, 1, 231, 236, 231,
- 51, 52, 51, 51, 53, 51, 51, 51,
- 237, 51, 51, 1, 238, 1, 239, 239,
- 1, 239, 56, 239, 51, 52, 51, 51,
- 53, 51, 51, 51, 237, 51, 51, 1,
- 240, 241, 240, 242, 244, 243, 1, 1,
- 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Security_Verify_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 21, 19, 20, 22, 46, 21,
- 17, 26, 22, 23, 26, 24, 25, 27,
- 30, 84, 96, 109, 146, 164, 28, 29,
- 31, 46, 30, 17, 26, 35, 31, 32,
- 33, 34, 36, 48, 42, 49, 37, 38,
- 39, 40, 41, 43, 45, 47, 44, 22,
- 188, 50, 83, 51, 54, 52, 53, 55,
- 70, 56, 68, 57, 58, 66, 59, 60,
- 64, 61, 62, 63, 65, 67, 69, 71,
- 79, 72, 75, 73, 74, 76, 77, 78,
- 80, 81, 82, 85, 86, 87, 91, 87,
- 88, 89, 90, 92, 95, 93, 94, 22,
- 46, 95, 17, 26, 97, 98, 99, 100,
- 104, 100, 101, 102, 103, 105, 108, 106,
- 107, 22, 46, 108, 17, 26, 110, 134,
- 111, 112, 113, 114, 124, 115, 119, 115,
- 116, 117, 118, 120, 123, 121, 122, 22,
- 46, 17, 123, 26, 125, 129, 125, 126,
- 127, 128, 130, 133, 131, 132, 22, 46,
- 17, 133, 26, 135, 136, 137, 141, 137,
- 138, 139, 140, 142, 145, 143, 144, 22,
- 46, 145, 17, 26, 147, 151, 147, 148,
- 149, 150, 152, 155, 160, 153, 154, 22,
- 46, 17, 156, 26, 157, 158, 159, 161,
- 162, 163, 165, 166, 167, 168, 178, 169,
- 173, 169, 170, 171, 172, 174, 177, 175,
- 176, 22, 46, 17, 177, 26, 179, 183,
- 179, 180, 181, 182, 184, 187, 185, 186,
- 22, 46, 17, 187, 26
-};
-
-static const char _tsip_machine_parser_header_Security_Verify_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 0, 0, 28, 28, 0,
- 28, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 55, 55, 0, 55, 21, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 23, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 46,
- 46, 0, 46, 15, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 43, 43, 0, 43, 13, 0, 0,
- 0, 0, 0, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 34,
- 34, 34, 0, 7, 55, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 31, 31,
- 31, 0, 5, 0, 0, 55, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 49,
- 49, 0, 49, 17, 55, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 52,
- 52, 52, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 55,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 40, 40, 40, 0, 11, 55, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 37, 37, 37, 0, 9
-};
-
-static const int tsip_machine_parser_header_Security_Verify_start = 1;
-static const int tsip_machine_parser_header_Security_Verify_first_final = 188;
-static const int tsip_machine_parser_header_Security_Verify_error = 0;
-
-static const int tsip_machine_parser_header_Security_Verify_en_main = 1;
-
-
-/* #line 212 "./ragel/tsip_parser_header_Security_Verify.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Security_Verify_first_final);
- (void)(tsip_machine_parser_header_Security_Verify_error);
- (void)(tsip_machine_parser_header_Security_Verify_en_main);
-
-/* #line 682 "./src/headers/tsip_header_Security_Verify.c" */
- {
- cs = tsip_machine_parser_header_Security_Verify_start;
- }
-
-/* #line 217 "./ragel/tsip_parser_header_Security_Verify.rl" */
-
-/* #line 689 "./src/headers/tsip_header_Security_Verify.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Security_Verifies_L_t *hdr_securityverifies = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Security_Verify_t *curr_securityverify = tsk_null;
+
+
+ /* #line 115 "./src/headers/tsip_header_Security_Verify.c" */
+ static const char _tsip_machine_parser_header_Security_Verify_actions[] = {
+ 0, 1, 0, 1, 3, 1, 4, 1,
+ 5, 1, 6, 1, 7, 1, 8, 1,
+ 9, 1, 10, 1, 11, 1, 12, 1,
+ 13, 2, 1, 0, 2, 3, 2, 2,
+ 4, 2, 2, 5, 2, 2, 6, 2,
+ 2, 7, 2, 2, 8, 2, 2, 9,
+ 2, 2, 10, 2, 2, 11, 2, 2,
+ 12, 2
+ };
+
+ static const short _tsip_machine_parser_header_Security_Verify_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 17, 19, 21, 23, 25, 27,
+ 29, 32, 49, 50, 52, 68, 85, 90,
+ 91, 93, 97, 124, 125, 127, 153, 171,
+ 177, 178, 180, 185, 204, 205, 207, 226,
+ 227, 229, 232, 240, 241, 243, 248, 249,
+ 255, 272, 279, 287, 295, 303, 305, 312,
+ 321, 323, 326, 328, 331, 333, 336, 339,
+ 340, 343, 344, 347, 348, 357, 366, 374,
+ 382, 390, 398, 400, 406, 415, 424, 433,
+ 435, 438, 441, 442, 443, 463, 483, 501,
+ 507, 508, 510, 515, 534, 535, 537, 556,
+ 573, 593, 613, 633, 651, 657, 658, 660,
+ 665, 684, 685, 687, 706, 723, 745, 765,
+ 785, 804, 826, 844, 850, 851, 853, 858,
+ 877, 878, 880, 899, 906, 924, 930, 931,
+ 933, 938, 957, 958, 960, 979, 986, 1006,
+ 1026, 1044, 1050, 1051, 1053, 1058, 1077, 1078,
+ 1080, 1099, 1116, 1134, 1140, 1141, 1143, 1148,
+ 1169, 1170, 1172, 1193, 1199, 1206, 1213, 1220,
+ 1225, 1231, 1237, 1243, 1249, 1269, 1289, 1308,
+ 1330, 1348, 1354, 1355, 1357, 1362, 1381, 1382,
+ 1384, 1403, 1410, 1428, 1434, 1435, 1437, 1442,
+ 1461, 1462, 1464, 1483, 1490
+ };
+
+ static const char _tsip_machine_parser_header_Security_Verify_trans_keys[] = {
+ 83, 115, 69, 101, 67, 99, 85, 117,
+ 82, 114, 73, 105, 84, 116, 89, 121,
+ 45, 86, 118, 69, 101, 82, 114, 73,
+ 105, 70, 102, 89, 121, 9, 32, 58,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 10, 9, 32, 9, 32, 44,
+ 59, 9, 13, 32, 33, 37, 39, 65,
+ 69, 80, 81, 83, 97, 101, 112, 113,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 65, 69, 80, 81,
+ 83, 97, 101, 112, 113, 115, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 44, 59,
+ 10, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 44, 59, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 76, 108, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 71, 103, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 44, 59, 61, 10, 9, 32, 9, 32,
+ 44, 59, 61, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 65, 97,
+ 126, 42, 46, 48, 57, 66, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 71, 103,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 79, 82, 111, 114,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 82, 114, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 84, 116,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 61, 84,
+ 116, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 10, 9, 32, 9,
+ 32, 44, 59, 61, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 48, 49, 91, 126, 42,
+ 43, 45, 46, 50, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 59, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 48, 57, 9, 13, 32, 44,
+ 59, 9, 13, 32, 44, 46, 59, 9,
+ 13, 32, 44, 48, 59, 9, 13, 32,
+ 44, 48, 59, 9, 13, 32, 44, 48,
+ 59, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 80, 112, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 73, 105,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 44, 59, 61, 67, 83, 99,
+ 115, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 126, 42, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 33, 34, 37,
+ 39, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 10, 9, 32,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 48, 57, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Verify_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 2, 2, 2, 2, 2,
+ 3, 7, 1, 2, 6, 9, 5, 1,
+ 2, 4, 17, 1, 2, 16, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 5, 1, 0,
+ 9, 1, 2, 2, 2, 2, 1, 3,
+ 0, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 12, 12, 10, 6,
+ 1, 2, 5, 9, 1, 2, 9, 9,
+ 12, 12, 12, 10, 6, 1, 2, 5,
+ 9, 1, 2, 9, 9, 14, 12, 12,
+ 11, 14, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 10, 6, 1, 2,
+ 5, 9, 1, 2, 9, 5, 12, 12,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 9, 10, 6, 1, 2, 5, 11,
+ 1, 2, 11, 6, 5, 5, 5, 5,
+ 6, 6, 6, 6, 12, 12, 11, 14,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 5, 10, 6, 1, 2, 5, 9,
+ 1, 2, 9, 5, 0
+ };
+
+ static const char _tsip_machine_parser_header_Security_Verify_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 5, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 3,
+ 4, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 4, 4, 4, 0,
+ 0, 0, 0, 5, 0, 0, 5, 4,
+ 4, 4, 4, 4, 0, 0, 0, 0,
+ 5, 0, 0, 5, 4, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 4, 0, 0, 0,
+ 0, 5, 0, 0, 5, 1, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 1, 1, 1, 0,
+ 0, 0, 0, 0, 4, 4, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 1, 4, 0, 0, 0, 0, 5,
+ 0, 0, 5, 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_Security_Verify_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 24, 26, 29, 32, 35, 38, 41,
+ 44, 48, 61, 63, 66, 78, 92, 98,
+ 100, 103, 108, 131, 133, 136, 158, 173,
+ 180, 182, 185, 191, 206, 208, 211, 226,
+ 228, 231, 235, 242, 244, 247, 253, 255,
+ 259, 273, 278, 284, 290, 296, 299, 304,
+ 311, 313, 316, 318, 321, 323, 326, 329,
+ 331, 334, 336, 339, 341, 348, 355, 361,
+ 367, 373, 379, 382, 386, 393, 400, 407,
+ 409, 412, 415, 417, 419, 436, 453, 468,
+ 475, 477, 480, 486, 501, 503, 506, 521,
+ 535, 552, 569, 586, 601, 608, 610, 613,
+ 619, 634, 636, 639, 654, 668, 687, 704,
+ 721, 737, 756, 771, 778, 780, 783, 789,
+ 804, 806, 809, 824, 831, 846, 853, 855,
+ 858, 864, 879, 881, 884, 899, 906, 923,
+ 940, 955, 962, 964, 967, 973, 988, 990,
+ 993, 1008, 1022, 1037, 1044, 1046, 1049, 1055,
+ 1072, 1074, 1077, 1094, 1101, 1108, 1115, 1122,
+ 1128, 1135, 1142, 1149, 1156, 1173, 1190, 1206,
+ 1225, 1240, 1247, 1249, 1252, 1258, 1273, 1275,
+ 1278, 1293, 1300, 1315, 1322, 1324, 1327, 1333,
+ 1348, 1350, 1353, 1368, 1375
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Verify_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 8, 1,
+ 9, 1, 10, 10, 1, 11, 11, 1,
+ 12, 12, 1, 13, 13, 1, 14, 14,
+ 1, 15, 15, 1, 15, 15, 16, 1,
+ 16, 17, 16, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 1, 19, 1, 20,
+ 20, 1, 20, 20, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 1, 21, 22,
+ 21, 23, 23, 23, 24, 25, 23, 23,
+ 23, 23, 23, 1, 26, 27, 26, 16,
+ 28, 1, 29, 1, 30, 30, 1, 30,
+ 30, 16, 28, 1, 28, 31, 28, 32,
+ 32, 32, 33, 34, 35, 36, 37, 33,
+ 34, 35, 36, 37, 32, 32, 32, 32,
+ 32, 32, 1, 38, 1, 39, 39, 1,
+ 39, 39, 32, 32, 32, 33, 34, 35,
+ 36, 37, 33, 34, 35, 36, 37, 32,
+ 32, 32, 32, 32, 32, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 42,
+ 42, 42, 42, 42, 1, 46, 47, 46,
+ 16, 28, 45, 1, 48, 1, 49, 49,
+ 1, 49, 49, 16, 28, 45, 1, 45,
+ 50, 45, 51, 52, 51, 51, 53, 51,
+ 51, 51, 51, 51, 51, 1, 54, 1,
+ 55, 55, 1, 55, 56, 55, 51, 52,
+ 51, 51, 53, 51, 51, 51, 51, 51,
+ 51, 1, 57, 1, 58, 58, 1, 58,
+ 58, 52, 1, 59, 60, 61, 1, 1,
+ 1, 52, 62, 1, 52, 52, 1, 63,
+ 41, 63, 43, 44, 1, 64, 1, 52,
+ 52, 52, 1, 63, 41, 63, 51, 51,
+ 51, 43, 44, 51, 51, 51, 51, 51,
+ 1, 66, 65, 65, 65, 1, 68, 60,
+ 67, 67, 67, 1, 68, 60, 69, 69,
+ 69, 1, 68, 60, 70, 70, 70, 1,
+ 68, 60, 1, 72, 71, 65, 65, 1,
+ 73, 68, 60, 74, 67, 67, 1, 75,
+ 1, 76, 77, 1, 78, 1, 79, 80,
+ 1, 81, 1, 60, 82, 1, 60, 83,
+ 1, 60, 1, 79, 84, 1, 79, 1,
+ 76, 85, 1, 76, 1, 73, 68, 60,
+ 86, 69, 69, 1, 73, 68, 60, 70,
+ 70, 70, 1, 88, 60, 87, 87, 87,
+ 1, 90, 60, 89, 89, 89, 1, 90,
+ 60, 91, 91, 91, 1, 90, 60, 92,
+ 92, 92, 1, 90, 60, 1, 93, 87,
+ 87, 1, 73, 90, 60, 94, 89, 89,
+ 1, 73, 90, 60, 95, 91, 91, 1,
+ 73, 90, 60, 92, 92, 92, 1, 96,
+ 1, 73, 97, 1, 73, 98, 1, 73,
+ 1, 72, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 99, 99, 42, 42,
+ 42, 42, 42, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 100, 100, 42,
+ 42, 42, 42, 42, 1, 101, 41, 101,
+ 42, 42, 42, 43, 44, 102, 42, 42,
+ 42, 42, 42, 1, 103, 104, 103, 16,
+ 28, 102, 1, 105, 1, 106, 106, 1,
+ 106, 106, 16, 28, 102, 1, 102, 107,
+ 102, 108, 52, 108, 108, 53, 108, 108,
+ 108, 108, 108, 108, 1, 109, 1, 110,
+ 110, 1, 110, 56, 110, 108, 52, 108,
+ 108, 53, 108, 108, 108, 108, 108, 108,
+ 1, 111, 112, 111, 113, 113, 113, 114,
+ 115, 113, 113, 113, 113, 113, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 116, 116, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 117, 117, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 118, 118, 42, 42, 42, 42,
+ 42, 1, 119, 41, 119, 42, 42, 42,
+ 43, 44, 120, 42, 42, 42, 42, 42,
+ 1, 121, 122, 121, 16, 28, 120, 1,
+ 123, 1, 124, 124, 1, 124, 124, 16,
+ 28, 120, 1, 120, 125, 120, 126, 52,
+ 126, 126, 53, 126, 126, 126, 126, 126,
+ 126, 1, 127, 1, 128, 128, 1, 128,
+ 56, 128, 126, 52, 126, 126, 53, 126,
+ 126, 126, 126, 126, 126, 1, 129, 130,
+ 129, 131, 131, 131, 132, 133, 131, 131,
+ 131, 131, 131, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 134, 135, 134,
+ 135, 42, 42, 42, 42, 42, 1, 40,
+ 41, 40, 42, 42, 42, 43, 44, 45,
+ 136, 136, 42, 42, 42, 42, 42, 1,
+ 40, 41, 40, 42, 42, 42, 43, 44,
+ 45, 137, 137, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 138, 44, 45, 42, 42, 42, 42, 42,
+ 1, 40, 41, 40, 42, 42, 42, 43,
+ 44, 45, 139, 140, 139, 140, 42, 42,
+ 42, 42, 42, 1, 141, 41, 141, 42,
+ 42, 42, 43, 44, 142, 42, 42, 42,
+ 42, 42, 1, 143, 144, 143, 16, 28,
+ 142, 1, 145, 1, 146, 146, 1, 146,
+ 146, 16, 28, 142, 1, 142, 147, 142,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 148, 51, 51, 1, 149, 1, 150, 150,
+ 1, 150, 56, 150, 51, 52, 51, 51,
+ 53, 51, 51, 51, 148, 51, 51, 1,
+ 151, 152, 151, 153, 155, 154, 1, 156,
+ 41, 156, 42, 42, 42, 43, 44, 157,
+ 42, 42, 42, 42, 42, 1, 158, 159,
+ 158, 16, 28, 157, 1, 160, 1, 161,
+ 161, 1, 161, 161, 16, 28, 157, 1,
+ 157, 162, 157, 51, 52, 51, 51, 53,
+ 51, 51, 51, 163, 51, 51, 1, 164,
+ 1, 165, 165, 1, 165, 56, 165, 51,
+ 52, 51, 51, 53, 51, 51, 51, 163,
+ 51, 51, 1, 166, 167, 166, 168, 170,
+ 169, 1, 40, 41, 40, 42, 42, 42,
+ 43, 44, 45, 171, 171, 42, 42, 42,
+ 42, 42, 1, 40, 41, 40, 42, 42,
+ 42, 43, 44, 45, 172, 172, 42, 42,
+ 42, 42, 42, 1, 173, 41, 173, 42,
+ 42, 42, 43, 44, 174, 42, 42, 42,
+ 42, 42, 1, 175, 176, 175, 16, 28,
+ 174, 1, 177, 1, 178, 178, 1, 178,
+ 178, 16, 28, 174, 1, 174, 179, 174,
+ 180, 52, 180, 180, 53, 180, 180, 180,
+ 180, 180, 180, 1, 181, 1, 182, 182,
+ 1, 182, 56, 182, 180, 52, 180, 180,
+ 53, 180, 180, 180, 180, 180, 180, 1,
+ 183, 184, 183, 185, 185, 185, 186, 187,
+ 185, 185, 185, 185, 185, 1, 188, 41,
+ 188, 42, 42, 42, 43, 44, 189, 42,
+ 42, 42, 42, 42, 1, 190, 191, 190,
+ 16, 28, 189, 1, 192, 1, 193, 193,
+ 1, 193, 193, 16, 28, 189, 1, 189,
+ 194, 189, 51, 52, 51, 51, 195, 196,
+ 53, 51, 51, 51, 51, 51, 51, 1,
+ 197, 1, 198, 198, 1, 198, 56, 198,
+ 51, 52, 51, 51, 195, 196, 53, 51,
+ 51, 51, 51, 51, 51, 1, 199, 200,
+ 199, 201, 202, 203, 1, 199, 200, 199,
+ 201, 203, 204, 1, 199, 200, 199, 201,
+ 203, 205, 1, 199, 200, 199, 201, 203,
+ 206, 1, 199, 200, 199, 201, 203, 1,
+ 199, 200, 199, 201, 207, 203, 1, 199,
+ 200, 199, 201, 208, 203, 1, 199, 200,
+ 199, 201, 209, 203, 1, 199, 200, 199,
+ 201, 206, 203, 1, 40, 41, 40, 42,
+ 42, 42, 43, 44, 45, 210, 210, 42,
+ 42, 42, 42, 42, 1, 40, 41, 40,
+ 42, 42, 42, 43, 44, 45, 211, 211,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 212, 44, 45,
+ 42, 42, 42, 42, 42, 1, 40, 41,
+ 40, 42, 42, 42, 43, 44, 45, 213,
+ 214, 213, 214, 42, 42, 42, 42, 42,
+ 1, 215, 41, 215, 42, 42, 42, 43,
+ 44, 216, 42, 42, 42, 42, 42, 1,
+ 217, 218, 217, 16, 28, 216, 1, 219,
+ 1, 220, 220, 1, 220, 220, 16, 28,
+ 216, 1, 216, 221, 216, 51, 52, 51,
+ 51, 53, 51, 51, 51, 222, 51, 51,
+ 1, 223, 1, 224, 224, 1, 224, 56,
+ 224, 51, 52, 51, 51, 53, 51, 51,
+ 51, 222, 51, 51, 1, 225, 226, 225,
+ 227, 229, 228, 1, 230, 41, 230, 42,
+ 42, 42, 43, 44, 231, 42, 42, 42,
+ 42, 42, 1, 232, 233, 232, 16, 28,
+ 231, 1, 234, 1, 235, 235, 1, 235,
+ 235, 16, 28, 231, 1, 231, 236, 231,
+ 51, 52, 51, 51, 53, 51, 51, 51,
+ 237, 51, 51, 1, 238, 1, 239, 239,
+ 1, 239, 56, 239, 51, 52, 51, 51,
+ 53, 51, 51, 51, 237, 51, 51, 1,
+ 240, 241, 240, 242, 244, 243, 1, 1,
+ 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Security_Verify_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 21, 19, 20, 22, 46, 21,
+ 17, 26, 22, 23, 26, 24, 25, 27,
+ 30, 84, 96, 109, 146, 164, 28, 29,
+ 31, 46, 30, 17, 26, 35, 31, 32,
+ 33, 34, 36, 48, 42, 49, 37, 38,
+ 39, 40, 41, 43, 45, 47, 44, 22,
+ 188, 50, 83, 51, 54, 52, 53, 55,
+ 70, 56, 68, 57, 58, 66, 59, 60,
+ 64, 61, 62, 63, 65, 67, 69, 71,
+ 79, 72, 75, 73, 74, 76, 77, 78,
+ 80, 81, 82, 85, 86, 87, 91, 87,
+ 88, 89, 90, 92, 95, 93, 94, 22,
+ 46, 95, 17, 26, 97, 98, 99, 100,
+ 104, 100, 101, 102, 103, 105, 108, 106,
+ 107, 22, 46, 108, 17, 26, 110, 134,
+ 111, 112, 113, 114, 124, 115, 119, 115,
+ 116, 117, 118, 120, 123, 121, 122, 22,
+ 46, 17, 123, 26, 125, 129, 125, 126,
+ 127, 128, 130, 133, 131, 132, 22, 46,
+ 17, 133, 26, 135, 136, 137, 141, 137,
+ 138, 139, 140, 142, 145, 143, 144, 22,
+ 46, 145, 17, 26, 147, 151, 147, 148,
+ 149, 150, 152, 155, 160, 153, 154, 22,
+ 46, 17, 156, 26, 157, 158, 159, 161,
+ 162, 163, 165, 166, 167, 168, 178, 169,
+ 173, 169, 170, 171, 172, 174, 177, 175,
+ 176, 22, 46, 17, 177, 26, 179, 183,
+ 179, 180, 181, 182, 184, 187, 185, 186,
+ 22, 46, 17, 187, 26
+ };
+
+ static const char _tsip_machine_parser_header_Security_Verify_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 0, 0, 28, 28, 0,
+ 28, 3, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 0, 0,
+ 55, 55, 0, 55, 21, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 23, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 46,
+ 46, 0, 46, 15, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 43, 43, 0, 43, 13, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 34,
+ 34, 34, 0, 7, 55, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 31, 31,
+ 31, 0, 5, 0, 0, 55, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 49,
+ 49, 0, 49, 17, 55, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 52,
+ 52, 52, 0, 19, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 55,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 40, 40, 40, 0, 11, 55, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 37, 37, 37, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_Security_Verify_start = 1;
+ static const int tsip_machine_parser_header_Security_Verify_first_final = 188;
+ static const int tsip_machine_parser_header_Security_Verify_error = 0;
+
+ static const int tsip_machine_parser_header_Security_Verify_en_main = 1;
+
+
+ /* #line 212 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Security_Verify_first_final);
+ (void)(tsip_machine_parser_header_Security_Verify_error);
+ (void)(tsip_machine_parser_header_Security_Verify_en_main);
+
+ /* #line 682 "./src/headers/tsip_header_Security_Verify.c" */
+ {
+ cs = tsip_machine_parser_header_Security_Verify_start;
+ }
+
+ /* #line 217 "./ragel/tsip_parser_header_Security_Verify.rl" */
+
+ /* #line 689 "./src/headers/tsip_header_Security_Verify.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Security_Verify_trans_keys + _tsip_machine_parser_header_Security_Verify_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Security_Verify_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Security_Verify_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Security_Verify_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Security_Verify_trans_keys + _tsip_machine_parser_header_Security_Verify_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Security_Verify_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Security_Verify_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Security_Verify_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Security_Verify_indicies[_trans];
- cs = _tsip_machine_parser_header_Security_Verify_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Security_Verify_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Security_Verify_actions + _tsip_machine_parser_header_Security_Verify_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(!curr_securityverify){
- curr_securityverify = tsip_header_Security_Verify_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- tsk_list_push_back_data(hdr_securityverifies, ((void**) &curr_securityverify));
- }
- }
- break;
- case 3:
-/* #line 67 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_STRING(curr_securityverify->mech);
- }
- }
- break;
- case 4:
-/* #line 73 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_INT(curr_securityverify->port_s);
- }
- }
- break;
- case 5:
-/* #line 79 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_INT(curr_securityverify->port_c);
- }
- }
- break;
- case 6:
-/* #line 85 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_UINT(curr_securityverify->spi_s);
- }
- }
- break;
- case 7:
-/* #line 91 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_UINT(curr_securityverify->spi_c);
- }
- }
- break;
- case 8:
-/* #line 97 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_STRING(curr_securityverify->ealg);
- }
- }
- break;
- case 9:
-/* #line 103 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_STRING(curr_securityverify->alg);
- }
- }
- break;
- case 10:
-/* #line 109 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_STRING(curr_securityverify->prot);
- }
- }
- break;
- case 11:
-/* #line 115 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_SET_DOUBLE(curr_securityverify->q);
- }
- }
- break;
- case 12:
-/* #line 121 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- if(curr_securityverify){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityverify));
- }
- }
- break;
- case 13:
-/* #line 127 "./ragel/tsip_parser_header_Security_Verify.rl" */
- {
- }
- break;
-/* #line 870 "./src/headers/tsip_header_Security_Verify.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Security_Verify_indicies[_trans];
+ cs = _tsip_machine_parser_header_Security_Verify_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Security_Verify_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Security_Verify_actions + _tsip_machine_parser_header_Security_Verify_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(!curr_securityverify) {
+ curr_securityverify = tsip_header_Security_Verify_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ tsk_list_push_back_data(hdr_securityverifies, ((void**) &curr_securityverify));
+ }
+ }
+ break;
+ case 3:
+ /* #line 67 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_STRING(curr_securityverify->mech);
+ }
+ }
+ break;
+ case 4:
+ /* #line 73 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_INT(curr_securityverify->port_s);
+ }
+ }
+ break;
+ case 5:
+ /* #line 79 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_INT(curr_securityverify->port_c);
+ }
+ }
+ break;
+ case 6:
+ /* #line 85 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_UINT(curr_securityverify->spi_s);
+ }
+ }
+ break;
+ case 7:
+ /* #line 91 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_UINT(curr_securityverify->spi_c);
+ }
+ }
+ break;
+ case 8:
+ /* #line 97 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_STRING(curr_securityverify->ealg);
+ }
+ }
+ break;
+ case 9:
+ /* #line 103 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_STRING(curr_securityverify->alg);
+ }
+ }
+ break;
+ case 10:
+ /* #line 109 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_STRING(curr_securityverify->prot);
+ }
+ }
+ break;
+ case 11:
+ /* #line 115 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_SET_DOUBLE(curr_securityverify->q);
+ }
+ }
+ break;
+ case 12:
+ /* #line 121 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ if(curr_securityverify) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_securityverify));
+ }
+ }
+ break;
+ case 13:
+ /* #line 127 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ {
+ }
+ break;
+ /* #line 870 "./src/headers/tsip_header_Security_Verify.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 218 "./ragel/tsip_parser_header_Security_Verify.rl" */
-
- if( cs <
-/* #line 886 "./src/headers/tsip_header_Security_Verify.c" */
-188
-/* #line 219 "./ragel/tsip_parser_header_Security_Verify.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Security-Verify' header.");
- TSK_OBJECT_SAFE_FREE(curr_securityverify);
- TSK_OBJECT_SAFE_FREE(hdr_securityverifies);
- }
-
- return hdr_securityverifies;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 218 "./ragel/tsip_parser_header_Security_Verify.rl" */
+
+ if( cs <
+ /* #line 886 "./src/headers/tsip_header_Security_Verify.c" */
+ 188
+ /* #line 219 "./ragel/tsip_parser_header_Security_Verify.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Security-Verify' header.");
+ TSK_OBJECT_SAFE_FREE(curr_securityverify);
+ TSK_OBJECT_SAFE_FREE(hdr_securityverifies);
+ }
+
+ return hdr_securityverifies;
}
@@ -904,45 +915,44 @@ _again:
static tsk_object_t* tsip_header_Security_Verify_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Security_Verify_t *Security_Verify = self;
- if(Security_Verify){
-
- TSIP_HEADER(Security_Verify)->type = tsip_htype_Security_Verify;
- TSIP_HEADER(Security_Verify)->serialize = tsip_header_Security_Verify_serialize;
-
- Security_Verify->q = -1;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Security_Verify header.");
- }
- return self;
+ tsip_header_Security_Verify_t *Security_Verify = self;
+ if(Security_Verify) {
+
+ TSIP_HEADER(Security_Verify)->type = tsip_htype_Security_Verify;
+ TSIP_HEADER(Security_Verify)->serialize = tsip_header_Security_Verify_serialize;
+
+ Security_Verify->q = -1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Security_Verify header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Security_Verify_dtor(tsk_object_t *self)
{
- tsip_header_Security_Verify_t *Security_Verify = self;
- if(Security_Verify){
- TSK_FREE(Security_Verify->mech);
- TSK_FREE(Security_Verify->alg);
- TSK_FREE(Security_Verify->prot);
- TSK_FREE(Security_Verify->mod);
- TSK_FREE(Security_Verify->ealg);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Verify));
- }
- else{
- TSK_DEBUG_ERROR("Null Security_Verify header.");
- }
-
- return self;
+ tsip_header_Security_Verify_t *Security_Verify = self;
+ if(Security_Verify) {
+ TSK_FREE(Security_Verify->mech);
+ TSK_FREE(Security_Verify->alg);
+ TSK_FREE(Security_Verify->prot);
+ TSK_FREE(Security_Verify->mod);
+ TSK_FREE(Security_Verify->ealg);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Security_Verify));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Security_Verify header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Security_Verify_def_s =
-{
- sizeof(tsip_header_Security_Verify_t),
- tsip_header_Security_Verify_ctor,
- tsip_header_Security_Verify_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Security_Verify_def_s = {
+ sizeof(tsip_header_Security_Verify_t),
+ tsip_header_Security_Verify_ctor,
+ tsip_header_Security_Verify_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Security_Verify_def_t = &tsip_header_Security_Verify_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Server.c b/tinySIP/src/headers/tsip_header_Server.c
index 130aa05..991e76b 100755
--- a/tinySIP/src/headers/tsip_header_Server.c
+++ b/tinySIP/src/headers/tsip_header_Server.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,223 +49,234 @@
tsip_header_Server_t* tsip_header_server_create(const char* server)
{
- return tsk_object_new(TSIP_HEADER_SERVER_VA_ARGS(server));
+ return tsk_object_new(TSIP_HEADER_SERVER_VA_ARGS(server));
}
tsip_header_Server_t* tsip_header_server_create_null()
{
- return tsip_header_server_create(tsk_null);
+ return tsip_header_server_create(tsk_null);
}
int tsip_header_Server_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Server_t *Server = (const tsip_header_Server_t *)header;
- if(Server->value){
- return tsk_buffer_append(output, Server->value, tsk_strlen(Server->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Server_t *Server = (const tsip_header_Server_t *)header;
+ if(Server->value) {
+ return tsk_buffer_append(output, Server->value, tsk_strlen(Server->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Server_t *tsip_header_Server_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Server_t *hdr_server = tsip_header_server_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 85 "./src/headers/tsip_header_Server.c" */
-static const char _tsip_machine_parser_header_Server_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 1
-};
-
-static const char _tsip_machine_parser_header_Server_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 15, 18, 19, 20
-};
-
-static const char _tsip_machine_parser_header_Server_trans_keys[] = {
- 83, 115, 69, 101, 82, 114, 86, 118,
- 69, 101, 82, 114, 9, 32, 58, 9,
- 13, 32, 13, 10, 0
-};
-
-static const char _tsip_machine_parser_header_Server_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 3,
- 3, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Server_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Server_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 22, 26, 28, 30
-};
-
-static const char _tsip_machine_parser_header_Server_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 6, 6, 7, 1, 9, 10,
- 9, 8, 12, 11, 13, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Server_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 8, 10, 9, 10, 11
-};
-
-static const char _tsip_machine_parser_header_Server_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 7, 0, 3, 5
-};
-
-static const int tsip_machine_parser_header_Server_start = 1;
-static const int tsip_machine_parser_header_Server_first_final = 11;
-static const int tsip_machine_parser_header_Server_error = 0;
-
-static const int tsip_machine_parser_header_Server_en_main = 1;
-
-
-/* #line 107 "./ragel/tsip_parser_header_Server.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Server_first_final);
- (void)(tsip_machine_parser_header_Server_error);
- (void)(tsip_machine_parser_header_Server_en_main);
-
-/* #line 147 "./src/headers/tsip_header_Server.c" */
- {
- cs = tsip_machine_parser_header_Server_start;
- }
-
-/* #line 112 "./ragel/tsip_parser_header_Server.rl" */
-
-/* #line 154 "./src/headers/tsip_header_Server.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Server_t *hdr_server = tsip_header_server_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 85 "./src/headers/tsip_header_Server.c" */
+ static const char _tsip_machine_parser_header_Server_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 1
+ };
+
+ static const char _tsip_machine_parser_header_Server_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 15, 18, 19, 20
+ };
+
+ static const char _tsip_machine_parser_header_Server_trans_keys[] = {
+ 83, 115, 69, 101, 82, 114, 86, 118,
+ 69, 101, 82, 114, 9, 32, 58, 9,
+ 13, 32, 13, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_Server_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 3,
+ 3, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Server_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Server_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 22, 26, 28, 30
+ };
+
+ static const char _tsip_machine_parser_header_Server_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 6, 6, 7, 1, 9, 10,
+ 9, 8, 12, 11, 13, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Server_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 8, 10, 9, 10, 11
+ };
+
+ static const char _tsip_machine_parser_header_Server_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 7, 0, 3, 5
+ };
+
+ static const int tsip_machine_parser_header_Server_start = 1;
+ static const int tsip_machine_parser_header_Server_first_final = 11;
+ static const int tsip_machine_parser_header_Server_error = 0;
+
+ static const int tsip_machine_parser_header_Server_en_main = 1;
+
+
+ /* #line 107 "./ragel/tsip_parser_header_Server.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Server_first_final);
+ (void)(tsip_machine_parser_header_Server_error);
+ (void)(tsip_machine_parser_header_Server_en_main);
+
+ /* #line 147 "./src/headers/tsip_header_Server.c" */
+ {
+ cs = tsip_machine_parser_header_Server_start;
+ }
+
+ /* #line 112 "./ragel/tsip_parser_header_Server.rl" */
+
+ /* #line 154 "./src/headers/tsip_header_Server.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Server_trans_keys + _tsip_machine_parser_header_Server_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Server_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Server_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Server_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Server_trans_keys + _tsip_machine_parser_header_Server_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Server_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Server_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Server_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Server_indicies[_trans];
- cs = _tsip_machine_parser_header_Server_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Server_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Server_actions + _tsip_machine_parser_header_Server_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Server.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Server.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_server->value);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Server.rl" */
- {
- }
- break;
-/* #line 245 "./src/headers/tsip_header_Server.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Server_indicies[_trans];
+ cs = _tsip_machine_parser_header_Server_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Server_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Server_actions + _tsip_machine_parser_header_Server_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Server.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Server.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_server->value);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Server.rl" */
+ {
+ }
+ break;
+ /* #line 245 "./src/headers/tsip_header_Server.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 113 "./ragel/tsip_parser_header_Server.rl" */
-
- if( cs <
-/* #line 261 "./src/headers/tsip_header_Server.c" */
-11
-/* #line 114 "./ragel/tsip_parser_header_Server.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Server' header.");
- TSK_OBJECT_SAFE_FREE(hdr_server);
- }
-
- return hdr_server;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 113 "./ragel/tsip_parser_header_Server.rl" */
+
+ if( cs <
+ /* #line 261 "./src/headers/tsip_header_Server.c" */
+ 11
+ /* #line 114 "./ragel/tsip_parser_header_Server.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Server' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_server);
+ }
+
+ return hdr_server;
}
@@ -280,37 +291,36 @@ _again:
static tsk_object_t* tsip_header_Server_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Server_t *Server = self;
- if(Server){
- TSIP_HEADER(Server)->type = tsip_htype_Server;
- TSIP_HEADER(Server)->serialize = tsip_header_Server_serialize;
- Server->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Server header.");
- }
- return self;
+ tsip_header_Server_t *Server = self;
+ if(Server) {
+ TSIP_HEADER(Server)->type = tsip_htype_Server;
+ TSIP_HEADER(Server)->serialize = tsip_header_Server_serialize;
+ Server->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Server header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Server_dtor(tsk_object_t *self)
{
- tsip_header_Server_t *Server = self;
- if(Server){
- TSK_FREE(Server->value);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Server));
- }
- else{
- TSK_DEBUG_ERROR("Null Server header.");
- }
-
- return self;
+ tsip_header_Server_t *Server = self;
+ if(Server) {
+ TSK_FREE(Server->value);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Server));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Server header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Server_def_s =
-{
- sizeof(tsip_header_Server_t),
- tsip_header_Server_ctor,
- tsip_header_Server_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Server_def_s = {
+ sizeof(tsip_header_Server_t),
+ tsip_header_Server_ctor,
+ tsip_header_Server_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Server_def_t = &tsip_header_Server_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Service_Route.c b/tinySIP/src/headers/tsip_header_Service_Route.c
index 0ff1947..393919e 100755
--- a/tinySIP/src/headers/tsip_header_Service_Route.c
+++ b/tinySIP/src/headers/tsip_header_Service_Route.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,454 +50,465 @@
tsip_header_Service_Route_t* tsip_header_Service_Route_create(const tsip_uri_t* uri)
{
- return tsk_object_new(TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(uri));
+ return tsk_object_new(TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(uri));
}
tsip_header_Service_Route_t* tsip_header_Service_Route_create_null()
{
- return tsip_header_Service_Route_create(tsk_null);
+ return tsip_header_Service_Route_create(tsk_null);
}
int tsip_header_Service_Route_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Service_Route_t *Service_Route = (const tsip_header_Service_Route_t *)header;
- int ret = 0;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(Service_Route->uri, tsk_true, tsk_true, output))){
- return ret;
- }
-
- return ret;
- }
-
- return -1;
-}
+ if(header) {
+ const tsip_header_Service_Route_t *Service_Route = (const tsip_header_Service_Route_t *)header;
+ int ret = 0;
-tsip_header_Service_Routes_L_t *tsip_header_Service_Route_parse(const char *data, tsk_size_t size)
-{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Service_Routes_L_t *hdr_services = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Service_Route_t *curr_service = tsk_null;
-
-
-/* #line 91 "./src/headers/tsip_header_Service_Route.c" */
-static const char _tsip_machine_parser_header_Service_Route_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 2,
- 1, 0, 2, 4, 5
-};
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(Service_Route->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
-static const short _tsip_machine_parser_header_Service_Route_key_offsets[] = {
- 0, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 16,
- 35, 36, 38, 57, 58, 60, 63, 67,
- 79, 82, 82, 83, 88, 89, 106, 107,
- 109, 125, 143, 149, 150, 152, 157, 176,
- 177, 179, 198, 199, 201, 204, 212, 213,
- 215, 220, 225, 226, 228, 232, 238, 255,
- 262, 270, 278, 286, 288, 295, 304, 306,
- 309, 311, 314, 316, 319, 322, 323, 326,
- 327, 330, 331, 340, 349, 357, 365, 373,
- 381, 383, 389, 398, 407, 416, 418, 421,
- 424, 425, 426, 443, 461, 465, 466, 468,
- 476, 477, 479, 483, 489
-};
-
-static const char _tsip_machine_parser_header_Service_Route_trans_keys[] = {
- 83, 101, 114, 118, 105, 99, 101, 45,
- 82, 111, 117, 116, 101, 9, 32, 58,
- 9, 13, 32, 33, 34, 37, 39, 60,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 13,
- 32, 33, 34, 37, 39, 60, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 60, 65,
- 90, 97, 122, 9, 32, 43, 58, 45,
- 46, 48, 57, 65, 90, 97, 122, 9,
- 32, 58, 62, 9, 13, 32, 44, 59,
- 10, 9, 13, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 59, 61, 10, 9, 32,
- 9, 32, 44, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 44, 59, 9, 13, 32, 44,
- 59, 10, 9, 32, 9, 32, 44, 59,
- 0, 9, 11, 12, 14, 127, 9, 13,
- 32, 33, 37, 39, 44, 59, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 58,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 58, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 48, 57, 46, 48, 57, 48, 57, 46,
- 48, 57, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 46, 48, 57, 46, 46,
- 48, 57, 46, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 48, 57, 46, 48, 57, 46, 48, 57,
- 46, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 60, 10, 9, 32, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 60, 0, 9, 11, 12, 14,
- 127, 0
-};
+ return ret;
+ }
-static const char _tsip_machine_parser_header_Service_Route_single_lengths[] = {
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 3, 9,
- 1, 2, 9, 1, 2, 3, 0, 4,
- 3, 0, 1, 5, 1, 7, 1, 2,
- 6, 10, 6, 1, 2, 5, 9, 1,
- 2, 9, 1, 2, 3, 4, 1, 2,
- 5, 5, 1, 2, 4, 0, 9, 1,
- 2, 2, 2, 2, 1, 3, 0, 1,
- 0, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 2, 2, 2, 2,
- 2, 0, 3, 3, 3, 0, 1, 1,
- 1, 1, 7, 8, 4, 1, 2, 4,
- 1, 2, 4, 0, 0
-};
-
-static const char _tsip_machine_parser_header_Service_Route_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5,
- 0, 0, 5, 0, 0, 0, 2, 4,
- 0, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 3, 4, 3,
- 3, 3, 3, 0, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 1, 0, 3, 3, 3, 3, 3, 3,
- 0, 3, 3, 3, 3, 1, 1, 1,
- 0, 0, 5, 5, 0, 0, 0, 2,
- 0, 0, 0, 3, 0
-};
-
-static const short _tsip_machine_parser_header_Service_Route_index_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 18, 20, 22, 24, 26, 30,
- 45, 47, 50, 65, 67, 70, 74, 77,
- 86, 90, 91, 93, 99, 101, 114, 116,
- 119, 131, 146, 153, 155, 158, 164, 179,
- 181, 184, 199, 201, 204, 208, 215, 217,
- 220, 226, 232, 234, 237, 242, 246, 260,
- 265, 271, 277, 283, 286, 291, 298, 300,
- 303, 305, 308, 310, 313, 316, 318, 321,
- 323, 326, 328, 335, 342, 348, 354, 360,
- 366, 369, 373, 380, 387, 394, 396, 399,
- 402, 404, 406, 419, 433, 438, 440, 443,
- 450, 452, 455, 460, 464
-};
-
-static const char _tsip_machine_parser_header_Service_Route_indicies[] = {
- 0, 1, 2, 1, 3, 1, 4, 1,
- 5, 1, 6, 1, 7, 1, 8, 1,
- 9, 1, 10, 1, 11, 1, 12, 1,
- 13, 1, 13, 13, 14, 1, 15, 16,
- 15, 17, 18, 17, 17, 19, 17, 17,
- 17, 17, 17, 17, 1, 20, 1, 21,
- 21, 1, 22, 23, 22, 17, 18, 17,
- 17, 19, 17, 17, 17, 17, 17, 17,
- 1, 24, 1, 25, 25, 1, 25, 25,
- 26, 1, 27, 27, 1, 28, 28, 29,
- 30, 29, 29, 29, 29, 1, 28, 28,
- 30, 1, 31, 32, 31, 33, 34, 33,
- 35, 36, 1, 37, 1, 36, 38, 36,
- 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 1, 40, 1, 41, 41, 1, 41,
- 41, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 1, 42, 43, 42, 44, 44,
- 44, 45, 46, 47, 44, 44, 44, 44,
- 44, 1, 48, 49, 48, 14, 36, 47,
- 1, 50, 1, 51, 51, 1, 51, 51,
- 14, 36, 47, 1, 47, 52, 47, 53,
- 54, 53, 53, 55, 53, 53, 53, 53,
- 53, 53, 1, 56, 1, 57, 57, 1,
- 57, 58, 57, 53, 54, 53, 53, 55,
- 53, 53, 53, 53, 53, 53, 1, 59,
- 1, 60, 60, 1, 60, 60, 54, 1,
- 61, 62, 63, 1, 1, 1, 54, 64,
- 1, 54, 54, 1, 65, 43, 65, 45,
- 46, 1, 66, 67, 66, 14, 36, 1,
- 68, 1, 69, 69, 1, 69, 69, 14,
- 36, 1, 54, 54, 54, 1, 65, 43,
- 65, 53, 53, 53, 45, 46, 53, 53,
- 53, 53, 53, 1, 71, 70, 70, 70,
- 1, 73, 62, 72, 72, 72, 1, 73,
- 62, 74, 74, 74, 1, 73, 62, 75,
- 75, 75, 1, 73, 62, 1, 77, 76,
- 70, 70, 1, 78, 73, 62, 79, 72,
- 72, 1, 80, 1, 81, 82, 1, 83,
- 1, 84, 85, 1, 86, 1, 62, 87,
- 1, 62, 88, 1, 62, 1, 84, 89,
- 1, 84, 1, 81, 90, 1, 81, 1,
- 78, 73, 62, 91, 74, 74, 1, 78,
- 73, 62, 75, 75, 75, 1, 93, 62,
- 92, 92, 92, 1, 95, 62, 94, 94,
- 94, 1, 95, 62, 96, 96, 96, 1,
- 95, 62, 97, 97, 97, 1, 95, 62,
- 1, 98, 92, 92, 1, 78, 95, 62,
- 99, 94, 94, 1, 78, 95, 62, 100,
- 96, 96, 1, 78, 95, 62, 97, 97,
- 97, 1, 101, 1, 78, 102, 1, 78,
- 103, 1, 78, 1, 77, 1, 104, 105,
- 104, 106, 106, 106, 106, 106, 106, 106,
- 106, 106, 1, 107, 108, 107, 106, 106,
- 106, 109, 106, 106, 106, 106, 106, 106,
- 1, 110, 111, 110, 26, 1, 112, 1,
- 104, 104, 1, 114, 115, 116, 1, 1,
- 1, 113, 117, 1, 113, 113, 1, 107,
- 108, 107, 109, 1, 113, 113, 113, 1,
- 1, 0
-};
-
-static const char _tsip_machine_parser_header_Service_Route_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 15,
- 16, 90, 95, 22, 17, 18, 18, 19,
- 20, 21, 22, 23, 24, 23, 25, 26,
- 27, 27, 28, 15, 29, 100, 30, 33,
- 31, 32, 34, 28, 33, 15, 29, 38,
- 34, 35, 36, 37, 39, 54, 45, 55,
- 40, 41, 42, 43, 44, 46, 48, 53,
- 47, 49, 49, 50, 51, 52, 56, 89,
- 57, 60, 58, 59, 61, 76, 62, 74,
- 63, 64, 72, 65, 66, 70, 67, 68,
- 69, 71, 73, 75, 77, 85, 78, 81,
- 79, 80, 82, 83, 84, 86, 87, 88,
- 91, 93, 90, 92, 19, 22, 92, 19,
- 94, 95, 96, 98, 99, 97
-};
-
-static const char _tsip_machine_parser_header_Service_Route_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 3,
- 3, 15, 15, 3, 0, 0, 3, 3,
- 0, 0, 0, 1, 0, 0, 0, 0,
- 7, 11, 11, 11, 0, 13, 0, 1,
- 0, 0, 18, 18, 0, 18, 9, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 18, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
+ return -1;
+}
-static const int tsip_machine_parser_header_Service_Route_start = 1;
-static const int tsip_machine_parser_header_Service_Route_first_final = 100;
-static const int tsip_machine_parser_header_Service_Route_error = 0;
-
-static const int tsip_machine_parser_header_Service_Route_en_main = 1;
-
-
-/* #line 148 "./ragel/tsip_parser_header_Service_Route.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Service_Route_first_final);
- (void)(tsip_machine_parser_header_Service_Route_error);
- (void)(tsip_machine_parser_header_Service_Route_en_main);
-
-/* #line 338 "./src/headers/tsip_header_Service_Route.c" */
- {
- cs = tsip_machine_parser_header_Service_Route_start;
- }
-
-/* #line 153 "./ragel/tsip_parser_header_Service_Route.rl" */
-
-/* #line 345 "./src/headers/tsip_header_Service_Route.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+tsip_header_Service_Routes_L_t *tsip_header_Service_Route_parse(const char *data, tsk_size_t size)
+{
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Service_Routes_L_t *hdr_services = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Service_Route_t *curr_service = tsk_null;
+
+
+ /* #line 91 "./src/headers/tsip_header_Service_Route.c" */
+ static const char _tsip_machine_parser_header_Service_Route_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 2,
+ 1, 0, 2, 4, 5
+ };
+
+ static const short _tsip_machine_parser_header_Service_Route_key_offsets[] = {
+ 0, 0, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 16,
+ 35, 36, 38, 57, 58, 60, 63, 67,
+ 79, 82, 82, 83, 88, 89, 106, 107,
+ 109, 125, 143, 149, 150, 152, 157, 176,
+ 177, 179, 198, 199, 201, 204, 212, 213,
+ 215, 220, 225, 226, 228, 232, 238, 255,
+ 262, 270, 278, 286, 288, 295, 304, 306,
+ 309, 311, 314, 316, 319, 322, 323, 326,
+ 327, 330, 331, 340, 349, 357, 365, 373,
+ 381, 383, 389, 398, 407, 416, 418, 421,
+ 424, 425, 426, 443, 461, 465, 466, 468,
+ 476, 477, 479, 483, 489
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_trans_keys[] = {
+ 83, 101, 114, 118, 105, 99, 101, 45,
+ 82, 111, 117, 116, 101, 9, 32, 58,
+ 9, 13, 32, 33, 34, 37, 39, 60,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 13,
+ 32, 33, 34, 37, 39, 60, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 60, 65,
+ 90, 97, 122, 9, 32, 43, 58, 45,
+ 46, 48, 57, 65, 90, 97, 122, 9,
+ 32, 58, 62, 9, 13, 32, 44, 59,
+ 10, 9, 13, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 59, 61, 10, 9, 32,
+ 9, 32, 44, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 44, 59, 9, 13, 32, 44,
+ 59, 10, 9, 32, 9, 32, 44, 59,
+ 0, 9, 11, 12, 14, 127, 9, 13,
+ 32, 33, 37, 39, 44, 59, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 58,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 58, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 48, 57, 46, 48, 57, 48, 57, 46,
+ 48, 57, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 46, 48, 57, 46, 46,
+ 48, 57, 46, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 48, 57, 46, 48, 57, 46, 48, 57,
+ 46, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 60, 10, 9, 32, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 60, 0, 9, 11, 12, 14,
+ 127, 0
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_single_lengths[] = {
+ 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 3, 9,
+ 1, 2, 9, 1, 2, 3, 0, 4,
+ 3, 0, 1, 5, 1, 7, 1, 2,
+ 6, 10, 6, 1, 2, 5, 9, 1,
+ 2, 9, 1, 2, 3, 4, 1, 2,
+ 5, 5, 1, 2, 4, 0, 9, 1,
+ 2, 2, 2, 2, 1, 3, 0, 1,
+ 0, 1, 0, 1, 1, 1, 1, 1,
+ 1, 1, 3, 3, 2, 2, 2, 2,
+ 2, 0, 3, 3, 3, 0, 1, 1,
+ 1, 1, 7, 8, 4, 1, 2, 4,
+ 1, 2, 4, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 5,
+ 0, 0, 5, 0, 0, 0, 2, 4,
+ 0, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 3, 4, 3,
+ 3, 3, 3, 0, 3, 3, 1, 1,
+ 1, 1, 1, 1, 1, 0, 1, 0,
+ 1, 0, 3, 3, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 1, 1, 1,
+ 0, 0, 5, 5, 0, 0, 0, 2,
+ 0, 0, 0, 3, 0
+ };
+
+ static const short _tsip_machine_parser_header_Service_Route_index_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 18, 20, 22, 24, 26, 30,
+ 45, 47, 50, 65, 67, 70, 74, 77,
+ 86, 90, 91, 93, 99, 101, 114, 116,
+ 119, 131, 146, 153, 155, 158, 164, 179,
+ 181, 184, 199, 201, 204, 208, 215, 217,
+ 220, 226, 232, 234, 237, 242, 246, 260,
+ 265, 271, 277, 283, 286, 291, 298, 300,
+ 303, 305, 308, 310, 313, 316, 318, 321,
+ 323, 326, 328, 335, 342, 348, 354, 360,
+ 366, 369, 373, 380, 387, 394, 396, 399,
+ 402, 404, 406, 419, 433, 438, 440, 443,
+ 450, 452, 455, 460, 464
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_indicies[] = {
+ 0, 1, 2, 1, 3, 1, 4, 1,
+ 5, 1, 6, 1, 7, 1, 8, 1,
+ 9, 1, 10, 1, 11, 1, 12, 1,
+ 13, 1, 13, 13, 14, 1, 15, 16,
+ 15, 17, 18, 17, 17, 19, 17, 17,
+ 17, 17, 17, 17, 1, 20, 1, 21,
+ 21, 1, 22, 23, 22, 17, 18, 17,
+ 17, 19, 17, 17, 17, 17, 17, 17,
+ 1, 24, 1, 25, 25, 1, 25, 25,
+ 26, 1, 27, 27, 1, 28, 28, 29,
+ 30, 29, 29, 29, 29, 1, 28, 28,
+ 30, 1, 31, 32, 31, 33, 34, 33,
+ 35, 36, 1, 37, 1, 36, 38, 36,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 1, 40, 1, 41, 41, 1, 41,
+ 41, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 1, 42, 43, 42, 44, 44,
+ 44, 45, 46, 47, 44, 44, 44, 44,
+ 44, 1, 48, 49, 48, 14, 36, 47,
+ 1, 50, 1, 51, 51, 1, 51, 51,
+ 14, 36, 47, 1, 47, 52, 47, 53,
+ 54, 53, 53, 55, 53, 53, 53, 53,
+ 53, 53, 1, 56, 1, 57, 57, 1,
+ 57, 58, 57, 53, 54, 53, 53, 55,
+ 53, 53, 53, 53, 53, 53, 1, 59,
+ 1, 60, 60, 1, 60, 60, 54, 1,
+ 61, 62, 63, 1, 1, 1, 54, 64,
+ 1, 54, 54, 1, 65, 43, 65, 45,
+ 46, 1, 66, 67, 66, 14, 36, 1,
+ 68, 1, 69, 69, 1, 69, 69, 14,
+ 36, 1, 54, 54, 54, 1, 65, 43,
+ 65, 53, 53, 53, 45, 46, 53, 53,
+ 53, 53, 53, 1, 71, 70, 70, 70,
+ 1, 73, 62, 72, 72, 72, 1, 73,
+ 62, 74, 74, 74, 1, 73, 62, 75,
+ 75, 75, 1, 73, 62, 1, 77, 76,
+ 70, 70, 1, 78, 73, 62, 79, 72,
+ 72, 1, 80, 1, 81, 82, 1, 83,
+ 1, 84, 85, 1, 86, 1, 62, 87,
+ 1, 62, 88, 1, 62, 1, 84, 89,
+ 1, 84, 1, 81, 90, 1, 81, 1,
+ 78, 73, 62, 91, 74, 74, 1, 78,
+ 73, 62, 75, 75, 75, 1, 93, 62,
+ 92, 92, 92, 1, 95, 62, 94, 94,
+ 94, 1, 95, 62, 96, 96, 96, 1,
+ 95, 62, 97, 97, 97, 1, 95, 62,
+ 1, 98, 92, 92, 1, 78, 95, 62,
+ 99, 94, 94, 1, 78, 95, 62, 100,
+ 96, 96, 1, 78, 95, 62, 97, 97,
+ 97, 1, 101, 1, 78, 102, 1, 78,
+ 103, 1, 78, 1, 77, 1, 104, 105,
+ 104, 106, 106, 106, 106, 106, 106, 106,
+ 106, 106, 1, 107, 108, 107, 106, 106,
+ 106, 109, 106, 106, 106, 106, 106, 106,
+ 1, 110, 111, 110, 26, 1, 112, 1,
+ 104, 104, 1, 114, 115, 116, 1, 1,
+ 1, 113, 117, 1, 113, 113, 1, 107,
+ 108, 107, 109, 1, 113, 113, 113, 1,
+ 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 15,
+ 16, 90, 95, 22, 17, 18, 18, 19,
+ 20, 21, 22, 23, 24, 23, 25, 26,
+ 27, 27, 28, 15, 29, 100, 30, 33,
+ 31, 32, 34, 28, 33, 15, 29, 38,
+ 34, 35, 36, 37, 39, 54, 45, 55,
+ 40, 41, 42, 43, 44, 46, 48, 53,
+ 47, 49, 49, 50, 51, 52, 56, 89,
+ 57, 60, 58, 59, 61, 76, 62, 74,
+ 63, 64, 72, 65, 66, 70, 67, 68,
+ 69, 71, 73, 75, 77, 85, 78, 81,
+ 79, 80, 82, 83, 84, 86, 87, 88,
+ 91, 93, 90, 92, 19, 22, 92, 19,
+ 94, 95, 96, 98, 99, 97
+ };
+
+ static const char _tsip_machine_parser_header_Service_Route_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3,
+ 3, 15, 15, 3, 0, 0, 3, 3,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 7, 11, 11, 11, 0, 13, 0, 1,
+ 0, 0, 18, 18, 0, 18, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 18, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Service_Route_start = 1;
+ static const int tsip_machine_parser_header_Service_Route_first_final = 100;
+ static const int tsip_machine_parser_header_Service_Route_error = 0;
+
+ static const int tsip_machine_parser_header_Service_Route_en_main = 1;
+
+
+ /* #line 148 "./ragel/tsip_parser_header_Service_Route.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Service_Route_first_final);
+ (void)(tsip_machine_parser_header_Service_Route_error);
+ (void)(tsip_machine_parser_header_Service_Route_en_main);
+
+ /* #line 338 "./src/headers/tsip_header_Service_Route.c" */
+ {
+ cs = tsip_machine_parser_header_Service_Route_start;
+ }
+
+ /* #line 153 "./ragel/tsip_parser_header_Service_Route.rl" */
+
+ /* #line 345 "./src/headers/tsip_header_Service_Route.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Service_Route_trans_keys + _tsip_machine_parser_header_Service_Route_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Service_Route_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Service_Route_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Service_Route_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Service_Route_trans_keys + _tsip_machine_parser_header_Service_Route_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Service_Route_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Service_Route_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Service_Route_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Service_Route_indicies[_trans];
- cs = _tsip_machine_parser_header_Service_Route_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Service_Route_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Service_Route_actions + _tsip_machine_parser_header_Service_Route_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- if(!curr_service){
- curr_service = tsip_header_Service_Route_create_null();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- if(curr_service){
- TSK_PARSER_SET_STRING(curr_service->display_name);
- tsk_strunquote(&curr_service->display_name);
- }
- }
- break;
- case 3:
-/* #line 68 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- if(curr_service && !curr_service->uri){
- int len = (int)(p - tag_start);
- if(curr_service && !curr_service->uri){
- if((curr_service->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_service->display_name){
- curr_service->uri->display_name = tsk_strdup(curr_service->display_name);
- }
- }
- }
- }
- break;
- case 4:
-/* #line 79 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- if(curr_service){
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service));
- }
- }
- break;
- case 5:
-/* #line 85 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- if(curr_service){
- tsk_list_push_back_data(hdr_services, ((void**) &curr_service));
- }
- }
- break;
- case 6:
-/* #line 91 "./ragel/tsip_parser_header_Service_Route.rl" */
- {
- }
- break;
-/* #line 476 "./src/headers/tsip_header_Service_Route.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Service_Route_indicies[_trans];
+ cs = _tsip_machine_parser_header_Service_Route_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Service_Route_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Service_Route_actions + _tsip_machine_parser_header_Service_Route_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ if(!curr_service) {
+ curr_service = tsip_header_Service_Route_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ if(curr_service) {
+ TSK_PARSER_SET_STRING(curr_service->display_name);
+ tsk_strunquote(&curr_service->display_name);
+ }
+ }
+ break;
+ case 3:
+ /* #line 68 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ if(curr_service && !curr_service->uri) {
+ int len = (int)(p - tag_start);
+ if(curr_service && !curr_service->uri) {
+ if((curr_service->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && curr_service->display_name) {
+ curr_service->uri->display_name = tsk_strdup(curr_service->display_name);
+ }
+ }
+ }
+ }
+ break;
+ case 4:
+ /* #line 79 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ if(curr_service) {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service));
+ }
+ }
+ break;
+ case 5:
+ /* #line 85 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ if(curr_service) {
+ tsk_list_push_back_data(hdr_services, ((void**) &curr_service));
+ }
+ }
+ break;
+ case 6:
+ /* #line 91 "./ragel/tsip_parser_header_Service_Route.rl" */
+ {
+ }
+ break;
+ /* #line 476 "./src/headers/tsip_header_Service_Route.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 154 "./ragel/tsip_parser_header_Service_Route.rl" */
-
- if( cs <
-/* #line 492 "./src/headers/tsip_header_Service_Route.c" */
-100
-/* #line 155 "./ragel/tsip_parser_header_Service_Route.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Service-Route' header.");
- TSK_OBJECT_SAFE_FREE(curr_service);
- TSK_OBJECT_SAFE_FREE(hdr_services);
- }
-
- return hdr_services;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 154 "./ragel/tsip_parser_header_Service_Route.rl" */
+
+ if( cs <
+ /* #line 492 "./src/headers/tsip_header_Service_Route.c" */
+ 100
+ /* #line 155 "./ragel/tsip_parser_header_Service_Route.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Service-Route' header.");
+ TSK_OBJECT_SAFE_FREE(curr_service);
+ TSK_OBJECT_SAFE_FREE(hdr_services);
+ }
+
+ return hdr_services;
}
@@ -510,43 +521,42 @@ _again:
static tsk_object_t* tsip_header_Service_Route_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Service_Route_t *Service_Route = self;
- if(Service_Route){
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
-
- TSIP_HEADER(Service_Route)->type = tsip_htype_Service_Route;
- TSIP_HEADER(Service_Route)->serialize = tsip_header_Service_Route_serialize;
- if(uri){
- Service_Route->uri = tsk_object_ref((void*)uri);
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Service_Route header.");
- }
- return self;
+ tsip_header_Service_Route_t *Service_Route = self;
+ if(Service_Route) {
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t*);
+
+ TSIP_HEADER(Service_Route)->type = tsip_htype_Service_Route;
+ TSIP_HEADER(Service_Route)->serialize = tsip_header_Service_Route_serialize;
+ if(uri) {
+ Service_Route->uri = tsk_object_ref((void*)uri);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Service_Route header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Service_Route_dtor(tsk_object_t *self)
{
- tsip_header_Service_Route_t *Service_Route = self;
- if(Service_Route){
- TSK_FREE(Service_Route->display_name);
- TSK_OBJECT_SAFE_FREE(Service_Route->uri);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Service_Route));
- }
- else{
- TSK_DEBUG_ERROR("Null Service_Route header.");
- }
-
- return self;
+ tsip_header_Service_Route_t *Service_Route = self;
+ if(Service_Route) {
+ TSK_FREE(Service_Route->display_name);
+ TSK_OBJECT_SAFE_FREE(Service_Route->uri);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Service_Route));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Service_Route header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Service_Route_def_s =
-{
- sizeof(tsip_header_Service_Route_t),
- tsip_header_Service_Route_ctor,
- tsip_header_Service_Route_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Service_Route_def_s = {
+ sizeof(tsip_header_Service_Route_t),
+ tsip_header_Service_Route_ctor,
+ tsip_header_Service_Route_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Service_Route_def_t = &tsip_header_Service_Route_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Session_Expires.c b/tinySIP/src/headers/tsip_header_Session_Expires.c
index 567aefd..d3c9050 100755
--- a/tinySIP/src/headers/tsip_header_Session_Expires.c
+++ b/tinySIP/src/headers/tsip_header_Session_Expires.c
@@ -6,19 +6,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,469 +49,480 @@
tsip_header_Session_Expires_t* tsip_header_Session_Expires_create(int64_t delta_seconds, tsk_bool_t refresher_uas)
{
- return tsk_object_new(TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(delta_seconds, refresher_uas));
+ return tsk_object_new(TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(delta_seconds, refresher_uas));
}
int tsip_header_Session_Expires_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Session_Expires_t *Session_Expires = (const tsip_header_Session_Expires_t *)header;
- if(Session_Expires->delta_seconds >=0){
- return tsk_buffer_append_2(output, "%lld;refresher=%s",
- Session_Expires->delta_seconds, Session_Expires->refresher_uas ? "uas" : "uac");
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Session_Expires_t *Session_Expires = (const tsip_header_Session_Expires_t *)header;
+ if(Session_Expires->delta_seconds >=0) {
+ return tsk_buffer_append_2(output, "%lld;refresher=%s",
+ Session_Expires->delta_seconds, Session_Expires->refresher_uas ? "uas" : "uac");
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_Session_Expires_t *tsip_header_Session_Expires_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Session_Expires_t *hdr_session_expires = tsip_header_Session_Expires_create(TSIP_SESSION_EXPIRES_DEFAULT_VALUE, tsk_false);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 81 "./src/headers/tsip_header_Session_Expires.c" */
-static const char _tsip_machine_parser_header_Session_Expires_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5
-};
-
-static const short _tsip_machine_parser_header_Session_Expires_key_offsets[] = {
- 0, 0, 4, 6, 8, 10, 12, 14,
- 16, 17, 19, 21, 23, 25, 27, 29,
- 31, 34, 39, 40, 42, 46, 52, 56,
- 57, 59, 62, 81, 82, 84, 102, 121,
- 126, 127, 129, 133, 152, 153, 155, 174,
- 175, 177, 180, 188, 189, 191, 195, 196,
- 202, 220, 227, 235, 243, 251, 253, 260,
- 269, 271, 274, 276, 279, 281, 284, 287,
- 288, 291, 292, 295, 296, 305, 314, 322,
- 330, 338, 346, 348, 354, 363, 372, 381,
- 383, 386, 389, 390, 391, 412, 433, 454,
- 475, 496, 517, 538, 559, 578, 583, 584,
- 586, 590, 611, 612, 614, 635, 655, 677,
- 681, 685
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_trans_keys[] = {
- 83, 88, 115, 120, 69, 101, 83, 115,
- 83, 115, 73, 105, 79, 111, 78, 110,
- 45, 69, 101, 88, 120, 80, 112, 73,
- 105, 82, 114, 69, 101, 83, 115, 9,
- 32, 58, 9, 13, 32, 48, 57, 10,
- 9, 32, 9, 32, 48, 57, 9, 13,
- 32, 59, 48, 57, 9, 13, 32, 59,
- 10, 9, 32, 9, 32, 59, 9, 13,
- 32, 33, 37, 39, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 61, 10, 9,
- 32, 9, 32, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 59, 10, 0, 9, 11, 12,
- 14, 127, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 58, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 58, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 48, 57, 46, 48, 57, 48,
- 57, 93, 48, 57, 93, 48, 57, 93,
- 46, 48, 57, 46, 46, 48, 57, 46,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 48, 57, 46,
- 48, 57, 46, 48, 57, 46, 58, 9,
- 13, 32, 33, 37, 39, 59, 61, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 61, 70, 102, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 72, 104, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 61, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 59, 61, 10,
- 9, 32, 9, 32, 59, 61, 9, 13,
- 32, 33, 34, 37, 39, 85, 91, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 13,
- 32, 33, 34, 37, 39, 85, 91, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 67, 83,
- 99, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 9, 13, 32, 59, 0
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_single_lengths[] = {
- 0, 4, 2, 2, 2, 2, 2, 2,
- 1, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 1, 2, 2, 4, 4, 1,
- 2, 3, 9, 1, 2, 8, 9, 5,
- 1, 2, 4, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 4, 1, 0,
- 8, 1, 2, 2, 2, 2, 1, 3,
- 0, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 11, 11, 11, 11,
- 11, 11, 11, 11, 9, 5, 1, 2,
- 4, 11, 1, 2, 11, 10, 12, 4,
- 4, 0
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 1, 0, 0,
- 0, 0, 5, 0, 0, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 3,
- 5, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 5, 5, 5, 0,
- 0, 0
-};
-
-static const short _tsip_machine_parser_header_Session_Expires_index_offsets[] = {
- 0, 0, 5, 8, 11, 14, 17, 20,
- 23, 25, 28, 31, 34, 37, 40, 43,
- 46, 50, 55, 57, 60, 64, 70, 75,
- 77, 80, 84, 99, 101, 104, 118, 133,
- 139, 141, 144, 149, 164, 166, 169, 184,
- 186, 189, 193, 200, 202, 205, 210, 212,
- 216, 230, 235, 241, 247, 253, 256, 261,
- 268, 270, 273, 275, 278, 280, 283, 286,
- 288, 291, 293, 296, 298, 305, 312, 318,
- 324, 330, 336, 339, 343, 350, 357, 364,
- 366, 369, 372, 374, 376, 393, 410, 427,
- 444, 461, 478, 495, 512, 527, 533, 535,
- 538, 543, 560, 562, 565, 582, 598, 616,
- 621, 626
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_indicies[] = {
- 0, 2, 0, 2, 1, 3, 3, 1,
- 4, 4, 1, 5, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 1, 10, 10, 1, 11, 11, 1, 12,
- 12, 1, 13, 13, 1, 14, 14, 1,
- 15, 15, 1, 2, 2, 1, 2, 2,
- 16, 1, 16, 17, 16, 18, 1, 19,
- 1, 20, 20, 1, 20, 20, 18, 1,
- 21, 22, 21, 24, 23, 1, 25, 26,
- 25, 27, 1, 28, 1, 29, 29, 1,
- 29, 29, 27, 1, 27, 30, 27, 31,
- 31, 31, 32, 32, 31, 31, 31, 31,
- 31, 31, 1, 33, 1, 34, 34, 1,
- 34, 34, 31, 31, 31, 32, 32, 31,
- 31, 31, 31, 31, 31, 1, 35, 36,
- 35, 37, 37, 37, 38, 39, 37, 37,
- 37, 37, 37, 37, 1, 40, 41, 40,
- 27, 39, 1, 42, 1, 43, 43, 1,
- 43, 43, 27, 39, 1, 39, 44, 39,
- 45, 46, 45, 45, 47, 45, 45, 45,
- 45, 45, 45, 1, 48, 1, 49, 49,
- 1, 49, 50, 49, 45, 46, 45, 45,
- 47, 45, 45, 45, 45, 45, 45, 1,
- 51, 1, 52, 52, 1, 52, 52, 46,
- 1, 53, 54, 55, 1, 1, 1, 46,
- 56, 1, 46, 46, 1, 57, 36, 57,
- 38, 1, 58, 1, 46, 46, 46, 1,
- 57, 36, 57, 45, 45, 45, 38, 45,
- 45, 45, 45, 45, 45, 1, 60, 59,
- 59, 59, 1, 62, 54, 61, 61, 61,
- 1, 62, 54, 63, 63, 63, 1, 62,
- 54, 64, 64, 64, 1, 62, 54, 1,
- 66, 65, 59, 59, 1, 67, 62, 54,
- 68, 61, 61, 1, 69, 1, 70, 71,
- 1, 72, 1, 73, 74, 1, 75, 1,
- 54, 76, 1, 54, 77, 1, 54, 1,
- 73, 78, 1, 73, 1, 70, 79, 1,
- 70, 1, 67, 62, 54, 80, 63, 63,
- 1, 67, 62, 54, 64, 64, 64, 1,
- 82, 54, 81, 81, 81, 1, 84, 54,
- 83, 83, 83, 1, 84, 54, 85, 85,
- 85, 1, 84, 54, 86, 86, 86, 1,
- 84, 54, 1, 87, 81, 81, 1, 67,
- 84, 54, 88, 83, 83, 1, 67, 84,
- 54, 89, 85, 85, 1, 67, 84, 54,
- 86, 86, 86, 1, 90, 1, 67, 91,
- 1, 67, 92, 1, 67, 1, 66, 1,
- 35, 36, 35, 37, 37, 37, 38, 39,
- 93, 93, 37, 37, 37, 37, 37, 37,
- 1, 35, 36, 35, 37, 37, 37, 38,
- 39, 94, 94, 37, 37, 37, 37, 37,
- 37, 1, 35, 36, 35, 37, 37, 37,
- 38, 39, 95, 95, 37, 37, 37, 37,
- 37, 37, 1, 35, 36, 35, 37, 37,
- 37, 38, 39, 96, 96, 37, 37, 37,
- 37, 37, 37, 1, 35, 36, 35, 37,
- 37, 37, 38, 39, 97, 97, 37, 37,
- 37, 37, 37, 37, 1, 35, 36, 35,
- 37, 37, 37, 38, 39, 98, 98, 37,
- 37, 37, 37, 37, 37, 1, 35, 36,
- 35, 37, 37, 37, 38, 39, 99, 99,
- 37, 37, 37, 37, 37, 37, 1, 35,
- 36, 35, 37, 37, 37, 38, 39, 100,
- 100, 37, 37, 37, 37, 37, 37, 1,
- 101, 36, 101, 37, 37, 37, 38, 102,
- 37, 37, 37, 37, 37, 37, 1, 103,
- 104, 103, 27, 102, 1, 105, 1, 106,
- 106, 1, 106, 106, 27, 102, 1, 102,
- 107, 102, 45, 46, 45, 45, 108, 47,
- 108, 45, 45, 45, 45, 45, 45, 1,
- 109, 1, 110, 110, 1, 110, 50, 110,
- 45, 46, 45, 45, 108, 47, 108, 45,
- 45, 45, 45, 45, 45, 1, 57, 36,
- 57, 45, 45, 45, 38, 111, 111, 45,
- 45, 45, 45, 45, 45, 1, 57, 36,
- 57, 45, 45, 45, 38, 112, 113, 112,
- 113, 45, 45, 45, 45, 45, 45, 1,
- 114, 115, 114, 116, 1, 117, 118, 117,
- 119, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_trans_targs[] = {
- 2, 0, 16, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 17, 18, 21, 19, 20, 22, 46, 21,
- 26, 22, 23, 26, 24, 25, 27, 30,
- 84, 28, 29, 31, 46, 30, 26, 35,
- 31, 32, 33, 34, 36, 48, 42, 49,
- 37, 38, 39, 40, 41, 43, 45, 47,
- 44, 22, 105, 50, 83, 51, 54, 52,
- 53, 55, 70, 56, 68, 57, 58, 66,
- 59, 60, 64, 61, 62, 63, 65, 67,
- 69, 71, 79, 72, 75, 73, 74, 76,
- 77, 78, 80, 81, 82, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 97, 93,
- 94, 95, 96, 98, 101, 99, 100, 102,
- 103, 104, 22, 46, 26, 22, 46, 26
-};
-
-static const char _tsip_machine_parser_header_Session_Expires_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 3, 3, 0,
- 3, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 9, 9, 0, 9, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 9, 11, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 9, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 7, 7, 7, 5, 5, 5
-};
-
-static const int tsip_machine_parser_header_Session_Expires_start = 1;
-static const int tsip_machine_parser_header_Session_Expires_first_final = 105;
-static const int tsip_machine_parser_header_Session_Expires_error = 0;
-
-static const int tsip_machine_parser_header_Session_Expires_en_main = 1;
-
-
-/* #line 111 "./ragel/tsip_parser_header_Session_Expires.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Session_Expires_first_final);
- (void)(tsip_machine_parser_header_Session_Expires_error);
- (void)(tsip_machine_parser_header_Session_Expires_en_main);
-
-/* #line 375 "./src/headers/tsip_header_Session_Expires.c" */
- {
- cs = tsip_machine_parser_header_Session_Expires_start;
- }
-
-/* #line 116 "./ragel/tsip_parser_header_Session_Expires.rl" */
-
-/* #line 382 "./src/headers/tsip_header_Session_Expires.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Session_Expires_t *hdr_session_expires = tsip_header_Session_Expires_create(TSIP_SESSION_EXPIRES_DEFAULT_VALUE, tsk_false);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 81 "./src/headers/tsip_header_Session_Expires.c" */
+ static const char _tsip_machine_parser_header_Session_Expires_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5
+ };
+
+ static const short _tsip_machine_parser_header_Session_Expires_key_offsets[] = {
+ 0, 0, 4, 6, 8, 10, 12, 14,
+ 16, 17, 19, 21, 23, 25, 27, 29,
+ 31, 34, 39, 40, 42, 46, 52, 56,
+ 57, 59, 62, 81, 82, 84, 102, 121,
+ 126, 127, 129, 133, 152, 153, 155, 174,
+ 175, 177, 180, 188, 189, 191, 195, 196,
+ 202, 220, 227, 235, 243, 251, 253, 260,
+ 269, 271, 274, 276, 279, 281, 284, 287,
+ 288, 291, 292, 295, 296, 305, 314, 322,
+ 330, 338, 346, 348, 354, 363, 372, 381,
+ 383, 386, 389, 390, 391, 412, 433, 454,
+ 475, 496, 517, 538, 559, 578, 583, 584,
+ 586, 590, 611, 612, 614, 635, 655, 677,
+ 681, 685
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_trans_keys[] = {
+ 83, 88, 115, 120, 69, 101, 83, 115,
+ 83, 115, 73, 105, 79, 111, 78, 110,
+ 45, 69, 101, 88, 120, 80, 112, 73,
+ 105, 82, 114, 69, 101, 83, 115, 9,
+ 32, 58, 9, 13, 32, 48, 57, 10,
+ 9, 32, 9, 32, 48, 57, 9, 13,
+ 32, 59, 48, 57, 9, 13, 32, 59,
+ 10, 9, 32, 9, 32, 59, 9, 13,
+ 32, 33, 37, 39, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 61, 10, 9,
+ 32, 9, 32, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 59, 10, 0, 9, 11, 12,
+ 14, 127, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 58, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 58, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 48, 57, 46, 48, 57, 48,
+ 57, 93, 48, 57, 93, 48, 57, 93,
+ 46, 48, 57, 46, 46, 48, 57, 46,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 48, 57, 46,
+ 48, 57, 46, 48, 57, 46, 58, 9,
+ 13, 32, 33, 37, 39, 59, 61, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 61, 70, 102, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 72, 104, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 61, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 59, 61, 10,
+ 9, 32, 9, 32, 59, 61, 9, 13,
+ 32, 33, 34, 37, 39, 85, 91, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 13,
+ 32, 33, 34, 37, 39, 85, 91, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 67, 83,
+ 99, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 9, 13, 32, 59, 0
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_single_lengths[] = {
+ 0, 4, 2, 2, 2, 2, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 1, 2, 2, 4, 4, 1,
+ 2, 3, 9, 1, 2, 8, 9, 5,
+ 1, 2, 4, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 4, 1, 0,
+ 8, 1, 2, 2, 2, 2, 1, 3,
+ 0, 1, 0, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 11, 11, 11, 11,
+ 11, 11, 11, 11, 9, 5, 1, 2,
+ 4, 11, 1, 2, 11, 10, 12, 4,
+ 4, 0
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 1, 1, 0, 0,
+ 0, 0, 5, 0, 0, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 3,
+ 5, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 5, 5, 5, 0,
+ 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Session_Expires_index_offsets[] = {
+ 0, 0, 5, 8, 11, 14, 17, 20,
+ 23, 25, 28, 31, 34, 37, 40, 43,
+ 46, 50, 55, 57, 60, 64, 70, 75,
+ 77, 80, 84, 99, 101, 104, 118, 133,
+ 139, 141, 144, 149, 164, 166, 169, 184,
+ 186, 189, 193, 200, 202, 205, 210, 212,
+ 216, 230, 235, 241, 247, 253, 256, 261,
+ 268, 270, 273, 275, 278, 280, 283, 286,
+ 288, 291, 293, 296, 298, 305, 312, 318,
+ 324, 330, 336, 339, 343, 350, 357, 364,
+ 366, 369, 372, 374, 376, 393, 410, 427,
+ 444, 461, 478, 495, 512, 527, 533, 535,
+ 538, 543, 560, 562, 565, 582, 598, 616,
+ 621, 626
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_indicies[] = {
+ 0, 2, 0, 2, 1, 3, 3, 1,
+ 4, 4, 1, 5, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 1, 10, 10, 1, 11, 11, 1, 12,
+ 12, 1, 13, 13, 1, 14, 14, 1,
+ 15, 15, 1, 2, 2, 1, 2, 2,
+ 16, 1, 16, 17, 16, 18, 1, 19,
+ 1, 20, 20, 1, 20, 20, 18, 1,
+ 21, 22, 21, 24, 23, 1, 25, 26,
+ 25, 27, 1, 28, 1, 29, 29, 1,
+ 29, 29, 27, 1, 27, 30, 27, 31,
+ 31, 31, 32, 32, 31, 31, 31, 31,
+ 31, 31, 1, 33, 1, 34, 34, 1,
+ 34, 34, 31, 31, 31, 32, 32, 31,
+ 31, 31, 31, 31, 31, 1, 35, 36,
+ 35, 37, 37, 37, 38, 39, 37, 37,
+ 37, 37, 37, 37, 1, 40, 41, 40,
+ 27, 39, 1, 42, 1, 43, 43, 1,
+ 43, 43, 27, 39, 1, 39, 44, 39,
+ 45, 46, 45, 45, 47, 45, 45, 45,
+ 45, 45, 45, 1, 48, 1, 49, 49,
+ 1, 49, 50, 49, 45, 46, 45, 45,
+ 47, 45, 45, 45, 45, 45, 45, 1,
+ 51, 1, 52, 52, 1, 52, 52, 46,
+ 1, 53, 54, 55, 1, 1, 1, 46,
+ 56, 1, 46, 46, 1, 57, 36, 57,
+ 38, 1, 58, 1, 46, 46, 46, 1,
+ 57, 36, 57, 45, 45, 45, 38, 45,
+ 45, 45, 45, 45, 45, 1, 60, 59,
+ 59, 59, 1, 62, 54, 61, 61, 61,
+ 1, 62, 54, 63, 63, 63, 1, 62,
+ 54, 64, 64, 64, 1, 62, 54, 1,
+ 66, 65, 59, 59, 1, 67, 62, 54,
+ 68, 61, 61, 1, 69, 1, 70, 71,
+ 1, 72, 1, 73, 74, 1, 75, 1,
+ 54, 76, 1, 54, 77, 1, 54, 1,
+ 73, 78, 1, 73, 1, 70, 79, 1,
+ 70, 1, 67, 62, 54, 80, 63, 63,
+ 1, 67, 62, 54, 64, 64, 64, 1,
+ 82, 54, 81, 81, 81, 1, 84, 54,
+ 83, 83, 83, 1, 84, 54, 85, 85,
+ 85, 1, 84, 54, 86, 86, 86, 1,
+ 84, 54, 1, 87, 81, 81, 1, 67,
+ 84, 54, 88, 83, 83, 1, 67, 84,
+ 54, 89, 85, 85, 1, 67, 84, 54,
+ 86, 86, 86, 1, 90, 1, 67, 91,
+ 1, 67, 92, 1, 67, 1, 66, 1,
+ 35, 36, 35, 37, 37, 37, 38, 39,
+ 93, 93, 37, 37, 37, 37, 37, 37,
+ 1, 35, 36, 35, 37, 37, 37, 38,
+ 39, 94, 94, 37, 37, 37, 37, 37,
+ 37, 1, 35, 36, 35, 37, 37, 37,
+ 38, 39, 95, 95, 37, 37, 37, 37,
+ 37, 37, 1, 35, 36, 35, 37, 37,
+ 37, 38, 39, 96, 96, 37, 37, 37,
+ 37, 37, 37, 1, 35, 36, 35, 37,
+ 37, 37, 38, 39, 97, 97, 37, 37,
+ 37, 37, 37, 37, 1, 35, 36, 35,
+ 37, 37, 37, 38, 39, 98, 98, 37,
+ 37, 37, 37, 37, 37, 1, 35, 36,
+ 35, 37, 37, 37, 38, 39, 99, 99,
+ 37, 37, 37, 37, 37, 37, 1, 35,
+ 36, 35, 37, 37, 37, 38, 39, 100,
+ 100, 37, 37, 37, 37, 37, 37, 1,
+ 101, 36, 101, 37, 37, 37, 38, 102,
+ 37, 37, 37, 37, 37, 37, 1, 103,
+ 104, 103, 27, 102, 1, 105, 1, 106,
+ 106, 1, 106, 106, 27, 102, 1, 102,
+ 107, 102, 45, 46, 45, 45, 108, 47,
+ 108, 45, 45, 45, 45, 45, 45, 1,
+ 109, 1, 110, 110, 1, 110, 50, 110,
+ 45, 46, 45, 45, 108, 47, 108, 45,
+ 45, 45, 45, 45, 45, 1, 57, 36,
+ 57, 45, 45, 45, 38, 111, 111, 45,
+ 45, 45, 45, 45, 45, 1, 57, 36,
+ 57, 45, 45, 45, 38, 112, 113, 112,
+ 113, 45, 45, 45, 45, 45, 45, 1,
+ 114, 115, 114, 116, 1, 117, 118, 117,
+ 119, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_trans_targs[] = {
+ 2, 0, 16, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 17, 18, 21, 19, 20, 22, 46, 21,
+ 26, 22, 23, 26, 24, 25, 27, 30,
+ 84, 28, 29, 31, 46, 30, 26, 35,
+ 31, 32, 33, 34, 36, 48, 42, 49,
+ 37, 38, 39, 40, 41, 43, 45, 47,
+ 44, 22, 105, 50, 83, 51, 54, 52,
+ 53, 55, 70, 56, 68, 57, 58, 66,
+ 59, 60, 64, 61, 62, 63, 65, 67,
+ 69, 71, 79, 72, 75, 73, 74, 76,
+ 77, 78, 80, 81, 82, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 97, 93,
+ 94, 95, 96, 98, 101, 99, 100, 102,
+ 103, 104, 22, 46, 26, 22, 46, 26
+ };
+
+ static const char _tsip_machine_parser_header_Session_Expires_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 3, 3, 0,
+ 3, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 9, 9, 0, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 11, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 7, 7, 7, 5, 5, 5
+ };
+
+ static const int tsip_machine_parser_header_Session_Expires_start = 1;
+ static const int tsip_machine_parser_header_Session_Expires_first_final = 105;
+ static const int tsip_machine_parser_header_Session_Expires_error = 0;
+
+ static const int tsip_machine_parser_header_Session_Expires_en_main = 1;
+
+
+ /* #line 111 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Session_Expires_first_final);
+ (void)(tsip_machine_parser_header_Session_Expires_error);
+ (void)(tsip_machine_parser_header_Session_Expires_en_main);
+
+ /* #line 375 "./src/headers/tsip_header_Session_Expires.c" */
+ {
+ cs = tsip_machine_parser_header_Session_Expires_start;
+ }
+
+ /* #line 116 "./ragel/tsip_parser_header_Session_Expires.rl" */
+
+ /* #line 382 "./src/headers/tsip_header_Session_Expires.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Session_Expires_trans_keys + _tsip_machine_parser_header_Session_Expires_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Session_Expires_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Session_Expires_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Session_Expires_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Session_Expires_trans_keys + _tsip_machine_parser_header_Session_Expires_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Session_Expires_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Session_Expires_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Session_Expires_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Session_Expires_indicies[_trans];
- cs = _tsip_machine_parser_header_Session_Expires_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Session_Expires_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Session_Expires_actions + _tsip_machine_parser_header_Session_Expires_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_session_expires->delta_seconds);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- hdr_session_expires->refresher_uas = tsk_true;
- }
- break;
- case 3:
-/* #line 61 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- hdr_session_expires->refresher_uas = tsk_false;
- }
- break;
- case 4:
-/* #line 65 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_session_expires));
- }
- break;
- case 5:
-/* #line 69 "./ragel/tsip_parser_header_Session_Expires.rl" */
- {
- }
- break;
-/* #line 491 "./src/headers/tsip_header_Session_Expires.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Session_Expires_indicies[_trans];
+ cs = _tsip_machine_parser_header_Session_Expires_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Session_Expires_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Session_Expires_actions + _tsip_machine_parser_header_Session_Expires_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_session_expires->delta_seconds);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ hdr_session_expires->refresher_uas = tsk_true;
+ }
+ break;
+ case 3:
+ /* #line 61 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ hdr_session_expires->refresher_uas = tsk_false;
+ }
+ break;
+ case 4:
+ /* #line 65 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_session_expires));
+ }
+ break;
+ case 5:
+ /* #line 69 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ {
+ }
+ break;
+ /* #line 491 "./src/headers/tsip_header_Session_Expires.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 117 "./ragel/tsip_parser_header_Session_Expires.rl" */
-
- if( cs <
-/* #line 507 "./src/headers/tsip_header_Session_Expires.c" */
-105
-/* #line 118 "./ragel/tsip_parser_header_Session_Expires.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Session-Expires' header.");
- TSK_OBJECT_SAFE_FREE(hdr_session_expires);
- }
-
- return hdr_session_expires;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 117 "./ragel/tsip_parser_header_Session_Expires.rl" */
+
+ if( cs <
+ /* #line 507 "./src/headers/tsip_header_Session_Expires.c" */
+ 105
+ /* #line 118 "./ragel/tsip_parser_header_Session_Expires.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Session-Expires' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_session_expires);
+ }
+
+ return hdr_session_expires;
}
@@ -526,38 +537,37 @@ _again:
static tsk_object_t* tsip_header_Session_Expires_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Session_Expires_t *Session_Expires = self;
- if(Session_Expires){
- TSIP_HEADER(Session_Expires)->type = tsip_htype_Session_Expires;
- TSIP_HEADER(Session_Expires)->serialize = tsip_header_Session_Expires_serialize;
- Session_Expires->delta_seconds = va_arg(*app, int64_t);
- Session_Expires->refresher_uas = va_arg(*app, tsk_bool_t);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Session-Expires header.");
- }
- return self;
+ tsip_header_Session_Expires_t *Session_Expires = self;
+ if(Session_Expires) {
+ TSIP_HEADER(Session_Expires)->type = tsip_htype_Session_Expires;
+ TSIP_HEADER(Session_Expires)->serialize = tsip_header_Session_Expires_serialize;
+ Session_Expires->delta_seconds = va_arg(*app, int64_t);
+ Session_Expires->refresher_uas = va_arg(*app, tsk_bool_t);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Session-Expires header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Session_Expires_dtor(tsk_object_t *self)
{
- tsip_header_Session_Expires_t *Session_Expires = self;
- if(Session_Expires){
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Session_Expires));
- }
- else{
- TSK_DEBUG_ERROR("Null Session-Expires header.");
- }
-
- return self;
+ tsip_header_Session_Expires_t *Session_Expires = self;
+ if(Session_Expires) {
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Session_Expires));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Session-Expires header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Session_Expires_def_s =
-{
- sizeof(tsip_header_Session_Expires_t),
- tsip_header_Session_Expires_ctor,
- tsip_header_Session_Expires_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Session_Expires_def_s = {
+ sizeof(tsip_header_Session_Expires_t),
+ tsip_header_Session_Expires_ctor,
+ tsip_header_Session_Expires_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Session_Expires_def_t = &tsip_header_Session_Expires_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Subscription_State.c b/tinySIP/src/headers/tsip_header_Subscription_State.c
index bfb3b30..400142f 100755
--- a/tinySIP/src/headers/tsip_header_Subscription_State.c
+++ b/tinySIP/src/headers/tsip_header_Subscription_State.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,605 +47,616 @@
tsip_header_Subscription_State_t* tsip_header_Subscription_State_create()
{
- return tsk_object_new(tsip_header_Subscription_State_def_t);
+ return tsk_object_new(tsip_header_Subscription_State_def_t);
}
int tsip_header_Subscription_State_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Subscription_State_t *Subscription_State = (const tsip_header_Subscription_State_t *)header;
- int ret;
-
- ret = tsk_buffer_append_2(output, "%s%s%s",
- Subscription_State->state,
-
- Subscription_State->reason ? ";reason=" : "",
- Subscription_State->reason ? Subscription_State->reason : ""
- );
- if(!ret && Subscription_State->expires>=0){
- ret = tsk_buffer_append_2(output, ";expires=%d", Subscription_State->expires);
- }
- if(!ret && Subscription_State->retry_after>=0){
- ret = tsk_buffer_append_2(output, ";retry-after=%d", Subscription_State->retry_after);
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Subscription_State_t *Subscription_State = (const tsip_header_Subscription_State_t *)header;
+ int ret;
+
+ ret = tsk_buffer_append_2(output, "%s%s%s",
+ Subscription_State->state,
+
+ Subscription_State->reason ? ";reason=" : "",
+ Subscription_State->reason ? Subscription_State->reason : ""
+ );
+ if(!ret && Subscription_State->expires>=0) {
+ ret = tsk_buffer_append_2(output, ";expires=%d", Subscription_State->expires);
+ }
+ if(!ret && Subscription_State->retry_after>=0) {
+ ret = tsk_buffer_append_2(output, ";retry-after=%d", Subscription_State->retry_after);
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Subscription_State_t *tsip_header_Subscription_State_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Subscription_State_t *hdr_Subscription_State = tsip_header_Subscription_State_create();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 91 "./src/headers/tsip_header_Subscription_State.c" */
-static const char _tsip_machine_parser_header_Subscription_State_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6
-};
-
-static const short _tsip_machine_parser_header_Subscription_State_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 16, 18, 20, 22, 24, 25, 27,
- 29, 31, 33, 35, 38, 55, 56, 58,
- 74, 92, 96, 97, 99, 102, 123, 124,
- 126, 146, 165, 170, 171, 173, 177, 196,
- 197, 199, 218, 219, 221, 224, 232, 233,
- 235, 239, 240, 246, 264, 271, 279, 287,
- 295, 297, 304, 313, 315, 318, 320, 323,
- 325, 328, 331, 332, 335, 336, 339, 340,
- 349, 358, 366, 374, 382, 390, 392, 398,
- 407, 416, 425, 427, 430, 433, 434, 435,
- 456, 477, 498, 519, 540, 561, 580, 585,
- 586, 588, 592, 611, 612, 614, 633, 639,
- 660, 683, 704, 725, 746, 765, 770, 771,
- 773, 777, 796, 797, 799, 818, 836, 857,
- 878, 897, 918, 939, 960, 981, 1002, 1021,
- 1026, 1027, 1029, 1033, 1052, 1053, 1055, 1074,
- 1080
-};
-
-static const char _tsip_machine_parser_header_Subscription_State_trans_keys[] = {
- 83, 115, 85, 117, 66, 98, 83, 115,
- 67, 99, 82, 114, 73, 105, 80, 112,
- 84, 116, 73, 105, 79, 111, 78, 110,
- 45, 83, 115, 84, 116, 65, 97, 84,
- 116, 69, 101, 9, 32, 58, 9, 13,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 10, 9, 32, 9, 32, 59, 9, 13,
- 32, 33, 37, 39, 69, 82, 101, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 69, 82, 101, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 59, 10,
- 0, 9, 11, 12, 14, 127, 9, 13,
- 32, 33, 37, 39, 59, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 59, 61, 88, 120, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 61, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 61, 83, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 61, 10, 9, 32, 9, 32, 59, 61,
- 9, 13, 32, 33, 34, 37, 39, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 13,
- 32, 33, 34, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 48, 57, 9,
- 13, 32, 33, 37, 39, 59, 61, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 61, 65, 84, 97, 116,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 61, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 89, 121, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 45, 46, 59, 61,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 70, 102,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 61, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 59, 48, 57,
- 0
-};
-
-static const char _tsip_machine_parser_header_Subscription_State_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 2,
- 2, 2, 2, 3, 7, 1, 2, 6,
- 8, 4, 1, 2, 3, 11, 1, 2,
- 10, 9, 5, 1, 2, 4, 9, 1,
- 2, 9, 1, 2, 3, 4, 1, 2,
- 4, 1, 0, 8, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 3,
- 3, 2, 2, 2, 2, 2, 0, 3,
- 3, 3, 0, 1, 1, 1, 1, 11,
- 11, 11, 11, 11, 11, 9, 5, 1,
- 2, 4, 9, 1, 2, 9, 4, 11,
- 13, 11, 11, 11, 9, 5, 1, 2,
- 4, 9, 1, 2, 9, 8, 11, 11,
- 11, 11, 11, 11, 11, 11, 9, 5,
- 1, 2, 4, 9, 1, 2, 9, 4,
- 0
-};
-
-static const char _tsip_machine_parser_header_Subscription_State_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 0, 0, 5,
- 5, 0, 0, 0, 0, 5, 0, 0,
- 5, 5, 0, 0, 0, 0, 5, 0,
- 0, 5, 0, 0, 0, 2, 0, 0,
- 0, 0, 3, 5, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 5, 0, 0, 5, 1, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 5, 0, 0, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 1,
- 0
-};
-
-static const short _tsip_machine_parser_header_Subscription_State_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 24, 27, 30, 33, 36, 38, 41,
- 44, 47, 50, 53, 57, 70, 72, 75,
- 87, 101, 106, 108, 111, 115, 132, 134,
- 137, 153, 168, 174, 176, 179, 184, 199,
- 201, 204, 219, 221, 224, 228, 235, 237,
- 240, 245, 247, 251, 265, 270, 276, 282,
- 288, 291, 296, 303, 305, 308, 310, 313,
- 315, 318, 321, 323, 326, 328, 331, 333,
- 340, 347, 353, 359, 365, 371, 374, 378,
- 385, 392, 399, 401, 404, 407, 409, 411,
- 428, 445, 462, 479, 496, 513, 528, 534,
- 536, 539, 544, 559, 561, 564, 579, 585,
- 602, 621, 638, 655, 672, 687, 693, 695,
- 698, 703, 718, 720, 723, 738, 752, 769,
- 786, 802, 819, 836, 853, 870, 887, 902,
- 908, 910, 913, 918, 933, 935, 938, 953,
- 959
-};
-
-static const unsigned char _tsip_machine_parser_header_Subscription_State_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 8, 8, 1,
- 9, 9, 1, 10, 10, 1, 11, 11,
- 1, 12, 12, 1, 13, 1, 14, 14,
- 1, 15, 15, 1, 16, 16, 1, 17,
- 17, 1, 18, 18, 1, 18, 18, 19,
- 1, 19, 20, 19, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 1, 22, 1,
- 23, 23, 1, 23, 23, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 1, 24,
- 25, 24, 26, 26, 26, 27, 26, 26,
- 26, 26, 26, 26, 1, 28, 29, 28,
- 30, 1, 31, 1, 32, 32, 1, 32,
- 32, 30, 1, 30, 33, 30, 34, 34,
- 34, 35, 36, 35, 36, 34, 34, 34,
- 34, 34, 34, 1, 37, 1, 38, 38,
- 1, 38, 38, 34, 34, 34, 35, 36,
- 35, 36, 34, 34, 34, 34, 34, 34,
- 1, 39, 40, 39, 41, 41, 41, 42,
- 43, 41, 41, 41, 41, 41, 41, 1,
- 44, 45, 44, 30, 43, 1, 46, 1,
- 47, 47, 1, 47, 47, 30, 43, 1,
- 43, 48, 43, 49, 50, 49, 49, 51,
- 49, 49, 49, 49, 49, 49, 1, 52,
- 1, 53, 53, 1, 53, 54, 53, 49,
- 50, 49, 49, 51, 49, 49, 49, 49,
- 49, 49, 1, 55, 1, 56, 56, 1,
- 56, 56, 50, 1, 57, 58, 59, 1,
- 1, 1, 50, 60, 1, 50, 50, 1,
- 61, 40, 61, 42, 1, 62, 1, 50,
- 50, 50, 1, 61, 40, 61, 49, 49,
- 49, 42, 49, 49, 49, 49, 49, 49,
- 1, 64, 63, 63, 63, 1, 66, 58,
- 65, 65, 65, 1, 66, 58, 67, 67,
- 67, 1, 66, 58, 68, 68, 68, 1,
- 66, 58, 1, 70, 69, 63, 63, 1,
- 71, 66, 58, 72, 65, 65, 1, 73,
- 1, 74, 75, 1, 76, 1, 77, 78,
- 1, 79, 1, 58, 80, 1, 58, 81,
- 1, 58, 1, 77, 82, 1, 77, 1,
- 74, 83, 1, 74, 1, 71, 66, 58,
- 84, 67, 67, 1, 71, 66, 58, 68,
- 68, 68, 1, 86, 58, 85, 85, 85,
- 1, 88, 58, 87, 87, 87, 1, 88,
- 58, 89, 89, 89, 1, 88, 58, 90,
- 90, 90, 1, 88, 58, 1, 91, 85,
- 85, 1, 71, 88, 58, 92, 87, 87,
- 1, 71, 88, 58, 93, 89, 89, 1,
- 71, 88, 58, 90, 90, 90, 1, 94,
- 1, 71, 95, 1, 71, 96, 1, 71,
- 1, 70, 1, 39, 40, 39, 41, 41,
- 41, 42, 43, 97, 97, 41, 41, 41,
- 41, 41, 41, 1, 39, 40, 39, 41,
- 41, 41, 42, 43, 98, 98, 41, 41,
- 41, 41, 41, 41, 1, 39, 40, 39,
- 41, 41, 41, 42, 43, 99, 99, 41,
- 41, 41, 41, 41, 41, 1, 39, 40,
- 39, 41, 41, 41, 42, 43, 100, 100,
- 41, 41, 41, 41, 41, 41, 1, 39,
- 40, 39, 41, 41, 41, 42, 43, 101,
- 101, 41, 41, 41, 41, 41, 41, 1,
- 39, 40, 39, 41, 41, 41, 42, 43,
- 102, 102, 41, 41, 41, 41, 41, 41,
- 1, 103, 40, 103, 41, 41, 41, 42,
- 104, 41, 41, 41, 41, 41, 41, 1,
- 105, 106, 105, 30, 104, 1, 107, 1,
- 108, 108, 1, 108, 108, 30, 104, 1,
- 104, 109, 104, 49, 50, 49, 49, 51,
- 49, 49, 49, 110, 49, 49, 1, 111,
- 1, 112, 112, 1, 112, 54, 112, 49,
- 50, 49, 49, 51, 49, 49, 49, 110,
- 49, 49, 1, 113, 114, 113, 116, 115,
- 1, 39, 40, 39, 41, 41, 41, 42,
- 43, 117, 117, 41, 41, 41, 41, 41,
- 41, 1, 39, 40, 39, 41, 41, 41,
- 42, 43, 118, 119, 118, 119, 41, 41,
- 41, 41, 41, 41, 1, 39, 40, 39,
- 41, 41, 41, 42, 43, 120, 120, 41,
- 41, 41, 41, 41, 41, 1, 39, 40,
- 39, 41, 41, 41, 42, 43, 121, 121,
- 41, 41, 41, 41, 41, 41, 1, 39,
- 40, 39, 41, 41, 41, 42, 43, 122,
- 122, 41, 41, 41, 41, 41, 41, 1,
- 123, 40, 123, 41, 41, 41, 42, 124,
- 41, 41, 41, 41, 41, 41, 1, 125,
- 126, 125, 30, 124, 1, 127, 1, 128,
- 128, 1, 128, 128, 30, 124, 1, 124,
- 129, 124, 130, 50, 130, 130, 51, 130,
- 130, 130, 130, 130, 130, 1, 131, 1,
- 132, 132, 1, 132, 54, 132, 130, 50,
- 130, 130, 51, 130, 130, 130, 130, 130,
- 130, 1, 133, 134, 133, 135, 135, 135,
- 136, 135, 135, 135, 135, 135, 135, 1,
- 39, 40, 39, 41, 41, 41, 42, 43,
- 137, 137, 41, 41, 41, 41, 41, 41,
- 1, 39, 40, 39, 41, 41, 41, 42,
- 43, 138, 138, 41, 41, 41, 41, 41,
- 41, 1, 39, 40, 39, 41, 41, 41,
- 139, 41, 42, 43, 41, 41, 41, 41,
- 41, 1, 39, 40, 39, 41, 41, 41,
- 42, 43, 140, 140, 41, 41, 41, 41,
- 41, 41, 1, 39, 40, 39, 41, 41,
- 41, 42, 43, 141, 141, 41, 41, 41,
- 41, 41, 41, 1, 39, 40, 39, 41,
- 41, 41, 42, 43, 142, 142, 41, 41,
- 41, 41, 41, 41, 1, 39, 40, 39,
- 41, 41, 41, 42, 43, 143, 143, 41,
- 41, 41, 41, 41, 41, 1, 39, 40,
- 39, 41, 41, 41, 42, 43, 144, 144,
- 41, 41, 41, 41, 41, 41, 1, 145,
- 40, 145, 41, 41, 41, 42, 146, 41,
- 41, 41, 41, 41, 41, 1, 147, 148,
- 147, 30, 146, 1, 149, 1, 150, 150,
- 1, 150, 150, 30, 146, 1, 146, 151,
- 146, 49, 50, 49, 49, 51, 49, 49,
- 49, 152, 49, 49, 1, 153, 1, 154,
- 154, 1, 154, 54, 154, 49, 50, 49,
- 49, 51, 49, 49, 49, 152, 49, 49,
- 1, 155, 156, 155, 158, 157, 1, 1,
- 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Subscription_State_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 24, 22, 23,
- 25, 49, 24, 29, 25, 26, 29, 27,
- 28, 30, 33, 87, 103, 31, 32, 34,
- 49, 33, 29, 38, 34, 35, 36, 37,
- 39, 51, 45, 52, 40, 41, 42, 43,
- 44, 46, 48, 50, 47, 25, 136, 53,
- 86, 54, 57, 55, 56, 58, 73, 59,
- 71, 60, 61, 69, 62, 63, 67, 64,
- 65, 66, 68, 70, 72, 74, 82, 75,
- 78, 76, 77, 79, 80, 81, 83, 84,
- 85, 88, 89, 90, 91, 92, 93, 94,
- 98, 94, 95, 96, 97, 99, 102, 100,
- 101, 25, 49, 102, 29, 104, 105, 118,
- 106, 107, 108, 109, 113, 109, 110, 111,
- 112, 114, 117, 115, 116, 25, 49, 117,
- 29, 119, 120, 121, 122, 123, 124, 125,
- 126, 127, 131, 127, 128, 129, 130, 132,
- 135, 133, 134, 25, 49, 135, 29
-};
-
-static const char _tsip_machine_parser_header_Subscription_State_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 3, 3, 0, 3, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 0, 0, 11,
- 11, 0, 11, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 11, 13, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 11,
- 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 7, 7, 0, 7, 0, 0, 0,
- 0, 0, 0, 11, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 5, 5, 0,
- 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 11, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 9, 9, 0, 9
-};
-
-static const int tsip_machine_parser_header_Subscription_State_start = 1;
-static const int tsip_machine_parser_header_Subscription_State_first_final = 136;
-static const int tsip_machine_parser_header_Subscription_State_error = 0;
-
-static const int tsip_machine_parser_header_Subscription_State_en_main = 1;
-
-
-/* #line 125 "./ragel/tsip_parser_header_Subscription_State.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Subscription_State_first_final);
- (void)(tsip_machine_parser_header_Subscription_State_error);
- (void)(tsip_machine_parser_header_Subscription_State_en_main);
-
-/* #line 503 "./src/headers/tsip_header_Subscription_State.c" */
- {
- cs = tsip_machine_parser_header_Subscription_State_start;
- }
-
-/* #line 130 "./ragel/tsip_parser_header_Subscription_State.rl" */
-
-/* #line 510 "./src/headers/tsip_header_Subscription_State.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Subscription_State_t *hdr_Subscription_State = tsip_header_Subscription_State_create();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 91 "./src/headers/tsip_header_Subscription_State.c" */
+ static const char _tsip_machine_parser_header_Subscription_State_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6
+ };
+
+ static const short _tsip_machine_parser_header_Subscription_State_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 16, 18, 20, 22, 24, 25, 27,
+ 29, 31, 33, 35, 38, 55, 56, 58,
+ 74, 92, 96, 97, 99, 102, 123, 124,
+ 126, 146, 165, 170, 171, 173, 177, 196,
+ 197, 199, 218, 219, 221, 224, 232, 233,
+ 235, 239, 240, 246, 264, 271, 279, 287,
+ 295, 297, 304, 313, 315, 318, 320, 323,
+ 325, 328, 331, 332, 335, 336, 339, 340,
+ 349, 358, 366, 374, 382, 390, 392, 398,
+ 407, 416, 425, 427, 430, 433, 434, 435,
+ 456, 477, 498, 519, 540, 561, 580, 585,
+ 586, 588, 592, 611, 612, 614, 633, 639,
+ 660, 683, 704, 725, 746, 765, 770, 771,
+ 773, 777, 796, 797, 799, 818, 836, 857,
+ 878, 897, 918, 939, 960, 981, 1002, 1021,
+ 1026, 1027, 1029, 1033, 1052, 1053, 1055, 1074,
+ 1080
+ };
+
+ static const char _tsip_machine_parser_header_Subscription_State_trans_keys[] = {
+ 83, 115, 85, 117, 66, 98, 83, 115,
+ 67, 99, 82, 114, 73, 105, 80, 112,
+ 84, 116, 73, 105, 79, 111, 78, 110,
+ 45, 83, 115, 84, 116, 65, 97, 84,
+ 116, 69, 101, 9, 32, 58, 9, 13,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 10, 9, 32, 9, 32, 59, 9, 13,
+ 32, 33, 37, 39, 69, 82, 101, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 69, 82, 101, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 59, 10,
+ 0, 9, 11, 12, 14, 127, 9, 13,
+ 32, 33, 37, 39, 59, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 59, 61, 88, 120, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 61, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 61, 83, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 61, 10, 9, 32, 9, 32, 59, 61,
+ 9, 13, 32, 33, 34, 37, 39, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 13,
+ 32, 33, 34, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 48, 57, 9,
+ 13, 32, 33, 37, 39, 59, 61, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 61, 65, 84, 97, 116,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 61, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 89, 121, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 45, 46, 59, 61,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 70, 102,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 61, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 59, 48, 57,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Subscription_State_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 2, 2,
+ 2, 2, 2, 3, 7, 1, 2, 6,
+ 8, 4, 1, 2, 3, 11, 1, 2,
+ 10, 9, 5, 1, 2, 4, 9, 1,
+ 2, 9, 1, 2, 3, 4, 1, 2,
+ 4, 1, 0, 8, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 3,
+ 3, 2, 2, 2, 2, 2, 0, 3,
+ 3, 3, 0, 1, 1, 1, 1, 11,
+ 11, 11, 11, 11, 11, 9, 5, 1,
+ 2, 4, 9, 1, 2, 9, 4, 11,
+ 13, 11, 11, 11, 9, 5, 1, 2,
+ 4, 9, 1, 2, 9, 8, 11, 11,
+ 11, 11, 11, 11, 11, 11, 9, 5,
+ 1, 2, 4, 9, 1, 2, 9, 4,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Subscription_State_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 5, 0, 0, 0, 0, 5, 0, 0,
+ 5, 5, 0, 0, 0, 0, 5, 0,
+ 0, 5, 0, 0, 0, 2, 0, 0,
+ 0, 0, 3, 5, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 5, 0, 0, 5, 1, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 5, 0, 0, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 1,
+ 0
+ };
+
+ static const short _tsip_machine_parser_header_Subscription_State_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 24, 27, 30, 33, 36, 38, 41,
+ 44, 47, 50, 53, 57, 70, 72, 75,
+ 87, 101, 106, 108, 111, 115, 132, 134,
+ 137, 153, 168, 174, 176, 179, 184, 199,
+ 201, 204, 219, 221, 224, 228, 235, 237,
+ 240, 245, 247, 251, 265, 270, 276, 282,
+ 288, 291, 296, 303, 305, 308, 310, 313,
+ 315, 318, 321, 323, 326, 328, 331, 333,
+ 340, 347, 353, 359, 365, 371, 374, 378,
+ 385, 392, 399, 401, 404, 407, 409, 411,
+ 428, 445, 462, 479, 496, 513, 528, 534,
+ 536, 539, 544, 559, 561, 564, 579, 585,
+ 602, 621, 638, 655, 672, 687, 693, 695,
+ 698, 703, 718, 720, 723, 738, 752, 769,
+ 786, 802, 819, 836, 853, 870, 887, 902,
+ 908, 910, 913, 918, 933, 935, 938, 953,
+ 959
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Subscription_State_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 8, 8, 1,
+ 9, 9, 1, 10, 10, 1, 11, 11,
+ 1, 12, 12, 1, 13, 1, 14, 14,
+ 1, 15, 15, 1, 16, 16, 1, 17,
+ 17, 1, 18, 18, 1, 18, 18, 19,
+ 1, 19, 20, 19, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 1, 22, 1,
+ 23, 23, 1, 23, 23, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 1, 24,
+ 25, 24, 26, 26, 26, 27, 26, 26,
+ 26, 26, 26, 26, 1, 28, 29, 28,
+ 30, 1, 31, 1, 32, 32, 1, 32,
+ 32, 30, 1, 30, 33, 30, 34, 34,
+ 34, 35, 36, 35, 36, 34, 34, 34,
+ 34, 34, 34, 1, 37, 1, 38, 38,
+ 1, 38, 38, 34, 34, 34, 35, 36,
+ 35, 36, 34, 34, 34, 34, 34, 34,
+ 1, 39, 40, 39, 41, 41, 41, 42,
+ 43, 41, 41, 41, 41, 41, 41, 1,
+ 44, 45, 44, 30, 43, 1, 46, 1,
+ 47, 47, 1, 47, 47, 30, 43, 1,
+ 43, 48, 43, 49, 50, 49, 49, 51,
+ 49, 49, 49, 49, 49, 49, 1, 52,
+ 1, 53, 53, 1, 53, 54, 53, 49,
+ 50, 49, 49, 51, 49, 49, 49, 49,
+ 49, 49, 1, 55, 1, 56, 56, 1,
+ 56, 56, 50, 1, 57, 58, 59, 1,
+ 1, 1, 50, 60, 1, 50, 50, 1,
+ 61, 40, 61, 42, 1, 62, 1, 50,
+ 50, 50, 1, 61, 40, 61, 49, 49,
+ 49, 42, 49, 49, 49, 49, 49, 49,
+ 1, 64, 63, 63, 63, 1, 66, 58,
+ 65, 65, 65, 1, 66, 58, 67, 67,
+ 67, 1, 66, 58, 68, 68, 68, 1,
+ 66, 58, 1, 70, 69, 63, 63, 1,
+ 71, 66, 58, 72, 65, 65, 1, 73,
+ 1, 74, 75, 1, 76, 1, 77, 78,
+ 1, 79, 1, 58, 80, 1, 58, 81,
+ 1, 58, 1, 77, 82, 1, 77, 1,
+ 74, 83, 1, 74, 1, 71, 66, 58,
+ 84, 67, 67, 1, 71, 66, 58, 68,
+ 68, 68, 1, 86, 58, 85, 85, 85,
+ 1, 88, 58, 87, 87, 87, 1, 88,
+ 58, 89, 89, 89, 1, 88, 58, 90,
+ 90, 90, 1, 88, 58, 1, 91, 85,
+ 85, 1, 71, 88, 58, 92, 87, 87,
+ 1, 71, 88, 58, 93, 89, 89, 1,
+ 71, 88, 58, 90, 90, 90, 1, 94,
+ 1, 71, 95, 1, 71, 96, 1, 71,
+ 1, 70, 1, 39, 40, 39, 41, 41,
+ 41, 42, 43, 97, 97, 41, 41, 41,
+ 41, 41, 41, 1, 39, 40, 39, 41,
+ 41, 41, 42, 43, 98, 98, 41, 41,
+ 41, 41, 41, 41, 1, 39, 40, 39,
+ 41, 41, 41, 42, 43, 99, 99, 41,
+ 41, 41, 41, 41, 41, 1, 39, 40,
+ 39, 41, 41, 41, 42, 43, 100, 100,
+ 41, 41, 41, 41, 41, 41, 1, 39,
+ 40, 39, 41, 41, 41, 42, 43, 101,
+ 101, 41, 41, 41, 41, 41, 41, 1,
+ 39, 40, 39, 41, 41, 41, 42, 43,
+ 102, 102, 41, 41, 41, 41, 41, 41,
+ 1, 103, 40, 103, 41, 41, 41, 42,
+ 104, 41, 41, 41, 41, 41, 41, 1,
+ 105, 106, 105, 30, 104, 1, 107, 1,
+ 108, 108, 1, 108, 108, 30, 104, 1,
+ 104, 109, 104, 49, 50, 49, 49, 51,
+ 49, 49, 49, 110, 49, 49, 1, 111,
+ 1, 112, 112, 1, 112, 54, 112, 49,
+ 50, 49, 49, 51, 49, 49, 49, 110,
+ 49, 49, 1, 113, 114, 113, 116, 115,
+ 1, 39, 40, 39, 41, 41, 41, 42,
+ 43, 117, 117, 41, 41, 41, 41, 41,
+ 41, 1, 39, 40, 39, 41, 41, 41,
+ 42, 43, 118, 119, 118, 119, 41, 41,
+ 41, 41, 41, 41, 1, 39, 40, 39,
+ 41, 41, 41, 42, 43, 120, 120, 41,
+ 41, 41, 41, 41, 41, 1, 39, 40,
+ 39, 41, 41, 41, 42, 43, 121, 121,
+ 41, 41, 41, 41, 41, 41, 1, 39,
+ 40, 39, 41, 41, 41, 42, 43, 122,
+ 122, 41, 41, 41, 41, 41, 41, 1,
+ 123, 40, 123, 41, 41, 41, 42, 124,
+ 41, 41, 41, 41, 41, 41, 1, 125,
+ 126, 125, 30, 124, 1, 127, 1, 128,
+ 128, 1, 128, 128, 30, 124, 1, 124,
+ 129, 124, 130, 50, 130, 130, 51, 130,
+ 130, 130, 130, 130, 130, 1, 131, 1,
+ 132, 132, 1, 132, 54, 132, 130, 50,
+ 130, 130, 51, 130, 130, 130, 130, 130,
+ 130, 1, 133, 134, 133, 135, 135, 135,
+ 136, 135, 135, 135, 135, 135, 135, 1,
+ 39, 40, 39, 41, 41, 41, 42, 43,
+ 137, 137, 41, 41, 41, 41, 41, 41,
+ 1, 39, 40, 39, 41, 41, 41, 42,
+ 43, 138, 138, 41, 41, 41, 41, 41,
+ 41, 1, 39, 40, 39, 41, 41, 41,
+ 139, 41, 42, 43, 41, 41, 41, 41,
+ 41, 1, 39, 40, 39, 41, 41, 41,
+ 42, 43, 140, 140, 41, 41, 41, 41,
+ 41, 41, 1, 39, 40, 39, 41, 41,
+ 41, 42, 43, 141, 141, 41, 41, 41,
+ 41, 41, 41, 1, 39, 40, 39, 41,
+ 41, 41, 42, 43, 142, 142, 41, 41,
+ 41, 41, 41, 41, 1, 39, 40, 39,
+ 41, 41, 41, 42, 43, 143, 143, 41,
+ 41, 41, 41, 41, 41, 1, 39, 40,
+ 39, 41, 41, 41, 42, 43, 144, 144,
+ 41, 41, 41, 41, 41, 41, 1, 145,
+ 40, 145, 41, 41, 41, 42, 146, 41,
+ 41, 41, 41, 41, 41, 1, 147, 148,
+ 147, 30, 146, 1, 149, 1, 150, 150,
+ 1, 150, 150, 30, 146, 1, 146, 151,
+ 146, 49, 50, 49, 49, 51, 49, 49,
+ 49, 152, 49, 49, 1, 153, 1, 154,
+ 154, 1, 154, 54, 154, 49, 50, 49,
+ 49, 51, 49, 49, 49, 152, 49, 49,
+ 1, 155, 156, 155, 158, 157, 1, 1,
+ 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Subscription_State_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 24, 22, 23,
+ 25, 49, 24, 29, 25, 26, 29, 27,
+ 28, 30, 33, 87, 103, 31, 32, 34,
+ 49, 33, 29, 38, 34, 35, 36, 37,
+ 39, 51, 45, 52, 40, 41, 42, 43,
+ 44, 46, 48, 50, 47, 25, 136, 53,
+ 86, 54, 57, 55, 56, 58, 73, 59,
+ 71, 60, 61, 69, 62, 63, 67, 64,
+ 65, 66, 68, 70, 72, 74, 82, 75,
+ 78, 76, 77, 79, 80, 81, 83, 84,
+ 85, 88, 89, 90, 91, 92, 93, 94,
+ 98, 94, 95, 96, 97, 99, 102, 100,
+ 101, 25, 49, 102, 29, 104, 105, 118,
+ 106, 107, 108, 109, 113, 109, 110, 111,
+ 112, 114, 117, 115, 116, 25, 49, 117,
+ 29, 119, 120, 121, 122, 123, 124, 125,
+ 126, 127, 131, 127, 128, 129, 130, 132,
+ 135, 133, 134, 25, 49, 135, 29
+ };
+
+ static const char _tsip_machine_parser_header_Subscription_State_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 3, 3, 0, 3, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 0, 0, 11,
+ 11, 0, 11, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 11, 13, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 11,
+ 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 7, 7, 0, 7, 0, 0, 0,
+ 0, 0, 0, 11, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 5, 5, 0,
+ 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 11, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 9, 9, 0, 9
+ };
+
+ static const int tsip_machine_parser_header_Subscription_State_start = 1;
+ static const int tsip_machine_parser_header_Subscription_State_first_final = 136;
+ static const int tsip_machine_parser_header_Subscription_State_error = 0;
+
+ static const int tsip_machine_parser_header_Subscription_State_en_main = 1;
+
+
+ /* #line 125 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Subscription_State_first_final);
+ (void)(tsip_machine_parser_header_Subscription_State_error);
+ (void)(tsip_machine_parser_header_Subscription_State_en_main);
+
+ /* #line 503 "./src/headers/tsip_header_Subscription_State.c" */
+ {
+ cs = tsip_machine_parser_header_Subscription_State_start;
+ }
+
+ /* #line 130 "./ragel/tsip_parser_header_Subscription_State.rl" */
+
+ /* #line 510 "./src/headers/tsip_header_Subscription_State.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Subscription_State_trans_keys + _tsip_machine_parser_header_Subscription_State_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Subscription_State_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Subscription_State_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Subscription_State_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Subscription_State_trans_keys + _tsip_machine_parser_header_Subscription_State_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Subscription_State_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Subscription_State_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Subscription_State_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Subscription_State_indicies[_trans];
- cs = _tsip_machine_parser_header_Subscription_State_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Subscription_State_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Subscription_State_actions + _tsip_machine_parser_header_Subscription_State_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Subscription_State->state);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_Subscription_State->reason);
- }
- break;
- case 3:
-/* #line 60 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Subscription_State->expires);
- }
- break;
- case 4:
-/* #line 64 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- TSK_PARSER_SET_INTEGER(hdr_Subscription_State->retry_after);
- }
- break;
- case 5:
-/* #line 68 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_Subscription_State));
- }
- break;
- case 6:
-/* #line 72 "./ragel/tsip_parser_header_Subscription_State.rl" */
- {
- }
- break;
-/* #line 625 "./src/headers/tsip_header_Subscription_State.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Subscription_State_indicies[_trans];
+ cs = _tsip_machine_parser_header_Subscription_State_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Subscription_State_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Subscription_State_actions + _tsip_machine_parser_header_Subscription_State_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Subscription_State->state);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_Subscription_State->reason);
+ }
+ break;
+ case 3:
+ /* #line 60 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Subscription_State->expires);
+ }
+ break;
+ case 4:
+ /* #line 64 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(hdr_Subscription_State->retry_after);
+ }
+ break;
+ case 5:
+ /* #line 68 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_Subscription_State));
+ }
+ break;
+ case 6:
+ /* #line 72 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ {
+ }
+ break;
+ /* #line 625 "./src/headers/tsip_header_Subscription_State.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 131 "./ragel/tsip_parser_header_Subscription_State.rl" */
-
- if( cs <
-/* #line 641 "./src/headers/tsip_header_Subscription_State.c" */
-136
-/* #line 132 "./ragel/tsip_parser_header_Subscription_State.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Subscription-State' header.");
- TSK_OBJECT_SAFE_FREE(hdr_Subscription_State);
- }
-
- return hdr_Subscription_State;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 131 "./ragel/tsip_parser_header_Subscription_State.rl" */
+
+ if( cs <
+ /* #line 641 "./src/headers/tsip_header_Subscription_State.c" */
+ 136
+ /* #line 132 "./ragel/tsip_parser_header_Subscription_State.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Subscription-State' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_Subscription_State);
+ }
+
+ return hdr_Subscription_State;
}
@@ -660,41 +671,40 @@ _again:
static tsk_object_t* tsip_header_Subscription_State_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Subscription_State_t *Subscription_State = self;
- if(Subscription_State){
- TSIP_HEADER(Subscription_State)->type = tsip_htype_Subscription_State;
- TSIP_HEADER(Subscription_State)->serialize = tsip_header_Subscription_State_serialize;
-
- Subscription_State->expires = -1;
- Subscription_State->retry_after = -1;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Subscription_State header.");
- }
- return self;
+ tsip_header_Subscription_State_t *Subscription_State = self;
+ if(Subscription_State) {
+ TSIP_HEADER(Subscription_State)->type = tsip_htype_Subscription_State;
+ TSIP_HEADER(Subscription_State)->serialize = tsip_header_Subscription_State_serialize;
+
+ Subscription_State->expires = -1;
+ Subscription_State->retry_after = -1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Subscription_State header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Subscription_State_dtor(tsk_object_t *self)
{
- tsip_header_Subscription_State_t *Subscription_State = self;
- if(Subscription_State){
- TSK_FREE(Subscription_State->state);
- TSK_FREE(Subscription_State->reason);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Subscription_State));
- }
- else{
- TSK_DEBUG_ERROR("Null Subscription_State header.");
- }
-
- return self;
+ tsip_header_Subscription_State_t *Subscription_State = self;
+ if(Subscription_State) {
+ TSK_FREE(Subscription_State->state);
+ TSK_FREE(Subscription_State->reason);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Subscription_State));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Subscription_State header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Subscription_State_def_s =
-{
- sizeof(tsip_header_Subscription_State_t),
- tsip_header_Subscription_State_ctor,
- tsip_header_Subscription_State_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Subscription_State_def_s = {
+ sizeof(tsip_header_Subscription_State_t),
+ tsip_header_Subscription_State_ctor,
+ tsip_header_Subscription_State_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Subscription_State_def_t = &tsip_header_Subscription_State_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Supported.c b/tinySIP/src/headers/tsip_header_Supported.c
index 2028bfd..f7c7d24 100755
--- a/tinySIP/src/headers/tsip_header_Supported.c
+++ b/tinySIP/src/headers/tsip_header_Supported.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,261 +49,272 @@
tsip_header_Supported_t* tsip_header_Supported_create(const char* option)
{
- return tsk_object_new(TSIP_HEADER_SUPPORTED_VA_ARGS(option));
+ return tsk_object_new(TSIP_HEADER_SUPPORTED_VA_ARGS(option));
}
tsip_header_Supported_t* tsip_header_Supported_create_null()
{
- return tsip_header_Supported_create(tsk_null);
+ return tsip_header_Supported_create(tsk_null);
}
int tsip_header_Supported_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Supported_t *Supported = (const tsip_header_Supported_t *)header;
- tsk_list_item_t *item;
- tsk_string_t *str;
- int ret = 0;
-
- tsk_list_foreach(item, Supported->options){
- str = item->data;
- if(item == Supported->options->head){
- ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
- }
- else{
- ret = tsk_buffer_append_2(output, ",%s", str->value);
- }
- }
-
- return ret;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_Supported_t *Supported = (const tsip_header_Supported_t *)header;
+ tsk_list_item_t *item;
+ tsk_string_t *str;
+ int ret = 0;
+
+ tsk_list_foreach(item, Supported->options) {
+ str = item->data;
+ if(item == Supported->options->head) {
+ ret = tsk_buffer_append(output, str->value, tsk_strlen(str->value));
+ }
+ else {
+ ret = tsk_buffer_append_2(output, ",%s", str->value);
+ }
+ }
+
+ return ret;
+ }
+
+ return -1;
}
tsip_header_Supported_t *tsip_header_Supported_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Supported_t *hdr_supported = tsip_header_Supported_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 96 "./src/headers/tsip_header_Supported.c" */
-static const char _tsip_machine_parser_header_Supported_actions[] = {
- 0, 1, 0, 1, 1, 1, 2
-};
-
-static const char _tsip_machine_parser_header_Supported_key_offsets[] = {
- 0, 0, 4, 7, 24, 25, 41, 45,
- 46, 48, 51, 68, 69, 71, 87, 89,
- 91, 93, 95, 97, 99, 101, 103
-};
-
-static const char _tsip_machine_parser_header_Supported_trans_keys[] = {
- 75, 83, 107, 115, 9, 32, 58, 9,
- 13, 32, 33, 37, 39, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 13, 32, 33, 37, 39, 44,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 10, 9, 32,
- 9, 32, 44, 9, 13, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 85,
- 117, 80, 112, 80, 112, 79, 111, 82,
- 114, 84, 116, 69, 101, 68, 100, 0
-};
-
-static const char _tsip_machine_parser_header_Supported_single_lengths[] = {
- 0, 4, 3, 7, 1, 8, 4, 1,
- 2, 3, 7, 1, 2, 6, 2, 2,
- 2, 2, 2, 2, 2, 2, 0
-};
-
-static const char _tsip_machine_parser_header_Supported_range_lengths[] = {
- 0, 0, 0, 5, 0, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const unsigned char _tsip_machine_parser_header_Supported_index_offsets[] = {
- 0, 0, 5, 9, 22, 24, 37, 42,
- 44, 47, 51, 64, 66, 69, 81, 84,
- 87, 90, 93, 96, 99, 102, 105
-};
-
-static const char _tsip_machine_parser_header_Supported_indicies[] = {
- 0, 2, 0, 2, 1, 0, 0, 3,
- 1, 3, 4, 3, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 6, 1,
- 7, 8, 7, 9, 9, 9, 10, 9,
- 9, 9, 9, 9, 1, 11, 12, 11,
- 13, 1, 14, 1, 15, 15, 1, 15,
- 15, 13, 1, 13, 16, 13, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 1,
- 17, 1, 18, 18, 1, 18, 18, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 1, 19, 19, 1, 20, 20, 1, 21,
- 21, 1, 22, 22, 1, 23, 23, 1,
- 24, 24, 1, 25, 25, 1, 0, 0,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Supported_trans_targs[] = {
- 2, 0, 14, 3, 4, 5, 22, 6,
- 4, 5, 10, 6, 7, 10, 8, 9,
- 11, 12, 13, 15, 16, 17, 18, 19,
- 20, 21
-};
-
-static const char _tsip_machine_parser_header_Supported_trans_actions[] = {
- 0, 0, 0, 0, 0, 1, 5, 3,
- 3, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
-};
-
-static const int tsip_machine_parser_header_Supported_start = 1;
-static const int tsip_machine_parser_header_Supported_first_final = 22;
-static const int tsip_machine_parser_header_Supported_error = 0;
-
-static const int tsip_machine_parser_header_Supported_en_main = 1;
-
-
-/* #line 113 "./ragel/tsip_parser_header_Supported.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Supported_first_final);
- (void)(tsip_machine_parser_header_Supported_error);
- (void)(tsip_machine_parser_header_Supported_en_main);
-
-/* #line 185 "./src/headers/tsip_header_Supported.c" */
- {
- cs = tsip_machine_parser_header_Supported_start;
- }
-
-/* #line 118 "./ragel/tsip_parser_header_Supported.rl" */
-
-/* #line 192 "./src/headers/tsip_header_Supported.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Supported_t *hdr_supported = tsip_header_Supported_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 96 "./src/headers/tsip_header_Supported.c" */
+ static const char _tsip_machine_parser_header_Supported_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2
+ };
+
+ static const char _tsip_machine_parser_header_Supported_key_offsets[] = {
+ 0, 0, 4, 7, 24, 25, 41, 45,
+ 46, 48, 51, 68, 69, 71, 87, 89,
+ 91, 93, 95, 97, 99, 101, 103
+ };
+
+ static const char _tsip_machine_parser_header_Supported_trans_keys[] = {
+ 75, 83, 107, 115, 9, 32, 58, 9,
+ 13, 32, 33, 37, 39, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 13, 32, 33, 37, 39, 44,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 10, 9, 32,
+ 9, 32, 44, 9, 13, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 85,
+ 117, 80, 112, 80, 112, 79, 111, 82,
+ 114, 84, 116, 69, 101, 68, 100, 0
+ };
+
+ static const char _tsip_machine_parser_header_Supported_single_lengths[] = {
+ 0, 4, 3, 7, 1, 8, 4, 1,
+ 2, 3, 7, 1, 2, 6, 2, 2,
+ 2, 2, 2, 2, 2, 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_Supported_range_lengths[] = {
+ 0, 0, 0, 5, 0, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_Supported_index_offsets[] = {
+ 0, 0, 5, 9, 22, 24, 37, 42,
+ 44, 47, 51, 64, 66, 69, 81, 84,
+ 87, 90, 93, 96, 99, 102, 105
+ };
+
+ static const char _tsip_machine_parser_header_Supported_indicies[] = {
+ 0, 2, 0, 2, 1, 0, 0, 3,
+ 1, 3, 4, 3, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 6, 1,
+ 7, 8, 7, 9, 9, 9, 10, 9,
+ 9, 9, 9, 9, 1, 11, 12, 11,
+ 13, 1, 14, 1, 15, 15, 1, 15,
+ 15, 13, 1, 13, 16, 13, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 1,
+ 17, 1, 18, 18, 1, 18, 18, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 1, 19, 19, 1, 20, 20, 1, 21,
+ 21, 1, 22, 22, 1, 23, 23, 1,
+ 24, 24, 1, 25, 25, 1, 0, 0,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Supported_trans_targs[] = {
+ 2, 0, 14, 3, 4, 5, 22, 6,
+ 4, 5, 10, 6, 7, 10, 8, 9,
+ 11, 12, 13, 15, 16, 17, 18, 19,
+ 20, 21
+ };
+
+ static const char _tsip_machine_parser_header_Supported_trans_actions[] = {
+ 0, 0, 0, 0, 0, 1, 5, 3,
+ 3, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Supported_start = 1;
+ static const int tsip_machine_parser_header_Supported_first_final = 22;
+ static const int tsip_machine_parser_header_Supported_error = 0;
+
+ static const int tsip_machine_parser_header_Supported_en_main = 1;
+
+
+ /* #line 113 "./ragel/tsip_parser_header_Supported.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Supported_first_final);
+ (void)(tsip_machine_parser_header_Supported_error);
+ (void)(tsip_machine_parser_header_Supported_en_main);
+
+ /* #line 185 "./src/headers/tsip_header_Supported.c" */
+ {
+ cs = tsip_machine_parser_header_Supported_start;
+ }
+
+ /* #line 118 "./ragel/tsip_parser_header_Supported.rl" */
+
+ /* #line 192 "./src/headers/tsip_header_Supported.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Supported_trans_keys + _tsip_machine_parser_header_Supported_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Supported_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Supported_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Supported_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Supported_trans_keys + _tsip_machine_parser_header_Supported_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Supported_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Supported_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Supported_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Supported_indicies[_trans];
- cs = _tsip_machine_parser_header_Supported_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Supported_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Supported_actions + _tsip_machine_parser_header_Supported_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 50 "./ragel/tsip_parser_header_Supported.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 54 "./ragel/tsip_parser_header_Supported.rl" */
- {
- TSK_PARSER_ADD_STRING(hdr_supported->options);
- }
- break;
- case 2:
-/* #line 58 "./ragel/tsip_parser_header_Supported.rl" */
- {
- }
- break;
-/* #line 283 "./src/headers/tsip_header_Supported.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Supported_indicies[_trans];
+ cs = _tsip_machine_parser_header_Supported_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Supported_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Supported_actions + _tsip_machine_parser_header_Supported_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 50 "./ragel/tsip_parser_header_Supported.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 54 "./ragel/tsip_parser_header_Supported.rl" */
+ {
+ TSK_PARSER_ADD_STRING(hdr_supported->options);
+ }
+ break;
+ case 2:
+ /* #line 58 "./ragel/tsip_parser_header_Supported.rl" */
+ {
+ }
+ break;
+ /* #line 283 "./src/headers/tsip_header_Supported.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 119 "./ragel/tsip_parser_header_Supported.rl" */
-
- if( cs <
-/* #line 299 "./src/headers/tsip_header_Supported.c" */
-22
-/* #line 120 "./ragel/tsip_parser_header_Supported.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Supported' header.");
- TSK_OBJECT_SAFE_FREE(hdr_supported);
- }
-
- return hdr_supported;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 119 "./ragel/tsip_parser_header_Supported.rl" */
+
+ if( cs <
+ /* #line 299 "./src/headers/tsip_header_Supported.c" */
+ 22
+ /* #line 120 "./ragel/tsip_parser_header_Supported.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Supported' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_supported);
+ }
+
+ return hdr_supported;
}
@@ -318,44 +329,43 @@ _again:
static tsk_object_t* tsip_header_Supported_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Supported_t *Supported = self;
- if(Supported){
- const char* option;
-
- TSIP_HEADER(Supported)->type = tsip_htype_Supported;
- TSIP_HEADER(Supported)->serialize = tsip_header_Supported_serialize;
-
- if((option = va_arg(*app, const char*))){
- tsk_string_t* string = tsk_string_create(option);
- Supported->options = tsk_list_create();
-
- tsk_list_push_back_data(Supported->options, ((void**) &string));
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Supported header.");
- }
- return self;
+ tsip_header_Supported_t *Supported = self;
+ if(Supported) {
+ const char* option;
+
+ TSIP_HEADER(Supported)->type = tsip_htype_Supported;
+ TSIP_HEADER(Supported)->serialize = tsip_header_Supported_serialize;
+
+ if((option = va_arg(*app, const char*))) {
+ tsk_string_t* string = tsk_string_create(option);
+ Supported->options = tsk_list_create();
+
+ tsk_list_push_back_data(Supported->options, ((void**) &string));
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Supported header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Supported_dtor(tsk_object_t *self)
{
- tsip_header_Supported_t *Supported = self;
- if(Supported){
- TSK_OBJECT_SAFE_FREE(Supported->options);
- }
- else{
- TSK_DEBUG_ERROR("Null Supported header.");
- }
-
- return self;
+ tsip_header_Supported_t *Supported = self;
+ if(Supported) {
+ TSK_OBJECT_SAFE_FREE(Supported->options);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Supported header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Supported_def_s =
-{
- sizeof(tsip_header_Supported_t),
- tsip_header_Supported_ctor,
- tsip_header_Supported_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Supported_def_s = {
+ sizeof(tsip_header_Supported_t),
+ tsip_header_Supported_ctor,
+ tsip_header_Supported_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Supported_def_t = &tsip_header_Supported_def_s;
diff --git a/tinySIP/src/headers/tsip_header_To.c b/tinySIP/src/headers/tsip_header_To.c
index 0c053a6..240e79a 100755
--- a/tinySIP/src/headers/tsip_header_To.c
+++ b/tinySIP/src/headers/tsip_header_To.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,852 +47,863 @@
tsip_header_To_t* tsip_header_To_create(const char* display_name, const tsip_uri_t* uri, const char* tag)
{
- return tsk_object_new(TSIP_HEADER_TO_VA_ARGS(display_name, uri, tag));
+ return tsk_object_new(TSIP_HEADER_TO_VA_ARGS(display_name, uri, tag));
}
tsip_header_To_t* tsip_header_To_create_null()
{
- return tsip_header_To_create(tsk_null, tsk_null, tsk_null);
+ return tsip_header_To_create(tsk_null, tsk_null, tsk_null);
}
int tsip_header_To_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- int ret = 0;
- const tsip_header_To_t *To = (const tsip_header_To_t *)header;
-
- /* Uri with hacked display-name*/
- if((ret = tsip_uri_serialize(To->uri, tsk_true, tsk_true, output))){
- return ret;
- }
- if(To->tag && (ret = tsk_buffer_append_2(output, ";tag=%s", To->tag))){
- return ret;
- }
- return ret;
- }
- return -1;
+ if(header) {
+ int ret = 0;
+ const tsip_header_To_t *To = (const tsip_header_To_t *)header;
+
+ /* Uri with hacked display-name*/
+ if((ret = tsip_uri_serialize(To->uri, tsk_true, tsk_true, output))) {
+ return ret;
+ }
+ if(To->tag && (ret = tsk_buffer_append_2(output, ";tag=%s", To->tag))) {
+ return ret;
+ }
+ return ret;
+ }
+ return -1;
}
tsip_header_To_t *tsip_header_To_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_To_t *hdr_to = tsip_header_To_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 88 "./src/headers/tsip_header_To.c" */
-static const char _tsip_machine_parser_header_To_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 2, 1, 3,
- 2, 1, 4
-};
-
-static const short _tsip_machine_parser_header_To_key_offsets[] = {
- 0, 0, 2, 7, 10, 31, 32, 34,
- 55, 56, 58, 61, 65, 77, 80, 80,
- 81, 85, 86, 105, 106, 108, 126, 145,
- 150, 151, 153, 157, 176, 177, 179, 198,
- 199, 201, 204, 212, 213, 215, 219, 223,
- 224, 226, 229, 235, 253, 260, 268, 276,
- 284, 286, 293, 302, 304, 307, 309, 312,
- 314, 317, 320, 321, 324, 325, 328, 329,
- 338, 347, 355, 363, 371, 379, 381, 387,
- 396, 405, 414, 416, 419, 422, 423, 424,
- 445, 466, 485, 490, 491, 493, 497, 516,
- 517, 519, 538, 556, 573, 591, 595, 596,
- 598, 606, 607, 609, 613, 619, 639, 658,
- 663, 663, 667, 687, 706, 711, 731, 749,
- 758, 762, 787, 811, 821, 845, 868, 876,
- 885, 901, 918, 935, 952, 963, 979, 997,
- 1008, 1020, 1031, 1043, 1054, 1066, 1078, 1088,
- 1100, 1110, 1122, 1132, 1150, 1168, 1185, 1202,
- 1219, 1236, 1247, 1262, 1280, 1298, 1316, 1327,
- 1339, 1351, 1361, 1371, 1397, 1423, 1447, 1457,
- 1481, 1504, 1515, 1527, 1539, 1551, 1557, 1568,
- 1581, 1587, 1594, 1600, 1607, 1613, 1620, 1627,
- 1632, 1639, 1644, 1651, 1656, 1669, 1682, 1694,
- 1706, 1718, 1730, 1736, 1746, 1759, 1772, 1785,
- 1791, 1798, 1805, 1810, 1815, 1836, 1857, 1876,
- 1881, 1901, 1919
-};
-
-static const char _tsip_machine_parser_header_To_trans_keys[] = {
- 84, 116, 9, 32, 58, 79, 111, 9,
- 32, 58, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 13, 32, 33, 34, 37,
- 39, 60, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 10,
- 9, 32, 9, 32, 60, 65, 90, 97,
- 122, 9, 32, 43, 58, 45, 46, 48,
- 57, 65, 90, 97, 122, 9, 32, 58,
- 62, 9, 13, 32, 59, 10, 9, 13,
- 32, 33, 37, 39, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 59, 61, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 59, 61, 10, 9,
- 32, 9, 32, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 10, 9,
- 32, 9, 32, 34, 13, 34, 92, 127,
- 0, 8, 10, 31, 10, 9, 32, 9,
- 13, 32, 59, 9, 13, 32, 59, 10,
- 9, 32, 9, 32, 59, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 58, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 58, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 48, 57, 46, 48, 57,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 46, 48, 57, 46, 46, 48, 57,
- 46, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 46, 48, 57, 46, 58,
- 9, 13, 32, 33, 37, 39, 59, 61,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 61, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 61, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 59, 61, 10, 9, 32, 9, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 59, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 60, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 60, 10, 9, 32, 13, 34,
- 92, 127, 0, 8, 10, 31, 10, 9,
- 32, 9, 13, 32, 60, 0, 9, 11,
- 12, 14, 127, 9, 13, 32, 33, 37,
- 39, 42, 43, 58, 126, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 37, 39, 58, 60, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 58, 60, 9,
- 13, 32, 59, 9, 13, 32, 33, 37,
- 39, 59, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 59, 61, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 59, 61, 9,
- 13, 32, 33, 34, 37, 39, 59, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 59, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 34, 59, 92, 127, 0, 31, 9, 13,
- 32, 59, 9, 13, 32, 33, 34, 37,
- 39, 59, 84, 92, 116, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 34,
- 37, 39, 59, 61, 92, 126, 127, 0,
- 31, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 34, 59,
- 61, 92, 127, 0, 31, 9, 13, 32,
- 33, 34, 37, 39, 59, 91, 92, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 59, 92, 126, 127,
- 0, 31, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 0, 8, 11, 127, 9, 13, 32, 34,
- 59, 92, 127, 0, 31, 9, 13, 32,
- 34, 58, 59, 92, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 58, 59, 92, 93, 127, 0,
- 31, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 34, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 58, 59, 92, 93,
- 127, 0, 31, 9, 13, 32, 34, 58,
- 59, 92, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 46,
- 58, 59, 92, 93, 127, 0, 31, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 34, 59, 92, 127, 0, 31, 48, 57,
- 9, 13, 32, 34, 46, 59, 92, 127,
- 0, 31, 48, 57, 9, 13, 32, 34,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 59,
- 92, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 59, 92, 93, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 59, 92,
- 93, 127, 0, 31, 48, 57, 9, 13,
- 32, 34, 59, 92, 93, 127, 0, 31,
- 9, 13, 32, 34, 46, 59, 92, 127,
- 0, 31, 48, 57, 9, 13, 32, 34,
- 46, 59, 92, 127, 0, 31, 9, 13,
- 32, 34, 46, 59, 92, 127, 0, 31,
- 48, 57, 9, 13, 32, 34, 46, 59,
- 92, 127, 0, 31, 9, 13, 32, 34,
- 46, 58, 59, 92, 93, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 46, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 58, 59, 92, 93,
- 127, 0, 31, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 34, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 58, 59,
- 92, 93, 127, 0, 31, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 34, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 58, 59, 92, 93, 127, 0, 31, 9,
- 13, 32, 34, 59, 92, 127, 0, 31,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 34, 46, 58, 59, 92, 93, 127,
- 0, 31, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 34, 46, 58, 59, 92,
- 93, 127, 0, 31, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 34, 46, 58,
- 59, 92, 93, 127, 0, 31, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 34,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 48, 57, 9, 13, 32, 34, 46,
- 59, 92, 127, 0, 31, 48, 57, 9,
- 13, 32, 34, 46, 59, 92, 127, 0,
- 31, 9, 13, 32, 34, 58, 59, 92,
- 127, 0, 31, 9, 13, 32, 33, 34,
- 37, 39, 59, 61, 65, 92, 97, 126,
- 127, 0, 31, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 13, 32,
- 33, 34, 37, 39, 59, 61, 71, 92,
- 103, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 34, 37, 39, 59, 61,
- 92, 126, 127, 0, 31, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 34, 59, 61, 92, 127, 0,
- 31, 9, 13, 32, 33, 34, 37, 39,
- 59, 91, 92, 126, 127, 0, 31, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 34, 37, 39,
- 59, 92, 126, 127, 0, 31, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 58, 59, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 58, 59, 93, 48, 57, 65,
- 70, 97, 102, 9, 13, 32, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 58, 59, 93, 9, 13, 32,
- 58, 59, 48, 57, 65, 70, 97, 102,
- 9, 13, 32, 46, 58, 59, 93, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 59, 48, 57, 9, 13, 32, 46, 59,
- 48, 57, 9, 13, 32, 59, 48, 57,
- 9, 13, 32, 46, 59, 48, 57, 9,
- 13, 32, 59, 48, 57, 9, 13, 32,
- 59, 93, 48, 57, 9, 13, 32, 59,
- 93, 48, 57, 9, 13, 32, 59, 93,
- 9, 13, 32, 46, 59, 48, 57, 9,
- 13, 32, 46, 59, 9, 13, 32, 46,
- 59, 48, 57, 9, 13, 32, 46, 59,
- 9, 13, 32, 46, 58, 59, 93, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 46, 58, 59, 93, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 58, 59, 93,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 58, 59, 93, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 58, 59, 93,
- 48, 57, 65, 70, 97, 102, 9, 13,
- 32, 58, 59, 93, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 58, 59, 93,
- 9, 13, 32, 59, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 46, 58, 59,
- 93, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 46, 58, 59, 93, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 46,
- 58, 59, 93, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 59, 48, 57, 9,
- 13, 32, 46, 59, 48, 57, 9, 13,
- 32, 46, 59, 48, 57, 9, 13, 32,
- 46, 59, 9, 13, 32, 58, 59, 9,
- 13, 32, 33, 37, 39, 59, 61, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 59, 61, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 59,
- 61, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 59, 91, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 59, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 0
-};
-
-static const char _tsip_machine_parser_header_To_single_lengths[] = {
- 0, 2, 5, 3, 9, 1, 2, 9,
- 1, 2, 3, 0, 4, 3, 0, 1,
- 4, 1, 9, 1, 2, 8, 9, 5,
- 1, 2, 4, 9, 1, 2, 9, 1,
- 2, 3, 4, 1, 2, 4, 4, 1,
- 2, 3, 0, 8, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 3,
- 3, 2, 2, 2, 2, 2, 0, 3,
- 3, 3, 0, 1, 1, 1, 1, 11,
- 11, 9, 5, 1, 2, 4, 9, 1,
- 2, 9, 8, 7, 8, 4, 1, 2,
- 4, 1, 2, 4, 0, 10, 9, 5,
- 0, 4, 10, 9, 5, 10, 8, 7,
- 4, 13, 12, 8, 12, 11, 4, 7,
- 8, 9, 9, 9, 9, 8, 10, 7,
- 8, 7, 8, 7, 8, 8, 8, 8,
- 8, 8, 8, 10, 10, 9, 9, 9,
- 9, 9, 7, 10, 10, 10, 7, 8,
- 8, 8, 8, 14, 14, 12, 8, 12,
- 11, 5, 6, 6, 6, 6, 5, 7,
- 4, 5, 4, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 7, 7, 6, 6,
- 6, 6, 6, 4, 7, 7, 7, 4,
- 5, 5, 5, 5, 11, 11, 9, 5,
- 10, 8, 0
-};
-
-static const char _tsip_machine_parser_header_To_range_lengths[] = {
- 0, 0, 0, 0, 6, 0, 0, 6,
- 0, 0, 0, 2, 4, 0, 0, 0,
- 0, 0, 5, 0, 0, 5, 5, 0,
- 0, 0, 0, 5, 0, 0, 5, 0,
- 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 3, 5, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 0, 1, 0, 3,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 0, 5,
- 5, 5, 0, 0, 0, 0, 5, 0,
- 0, 5, 5, 5, 5, 0, 0, 0,
- 2, 0, 0, 0, 3, 5, 5, 0,
- 0, 0, 5, 5, 0, 5, 5, 1,
- 0, 6, 6, 1, 6, 6, 2, 1,
- 4, 4, 4, 4, 1, 4, 4, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 1, 2, 1, 4, 4, 4, 4, 4,
- 4, 1, 4, 4, 4, 4, 2, 2,
- 2, 1, 1, 6, 6, 6, 1, 6,
- 6, 3, 3, 3, 3, 0, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 5, 5, 5, 0,
- 5, 5, 0
-};
-
-static const short _tsip_machine_parser_header_To_index_offsets[] = {
- 0, 0, 3, 9, 13, 29, 31, 34,
- 50, 52, 55, 59, 62, 71, 75, 76,
- 78, 83, 85, 100, 102, 105, 119, 134,
- 140, 142, 145, 150, 165, 167, 170, 185,
- 187, 190, 194, 201, 203, 206, 211, 216,
- 218, 221, 225, 229, 243, 248, 254, 260,
- 266, 269, 274, 281, 283, 286, 288, 291,
- 293, 296, 299, 301, 304, 306, 309, 311,
- 318, 325, 331, 337, 343, 349, 352, 356,
- 363, 370, 377, 379, 382, 385, 387, 389,
- 406, 423, 438, 444, 446, 449, 454, 469,
- 471, 474, 489, 503, 516, 530, 535, 537,
- 540, 547, 549, 552, 557, 561, 577, 592,
- 598, 599, 604, 620, 635, 641, 657, 671,
- 680, 685, 705, 724, 734, 753, 771, 778,
- 787, 800, 814, 828, 842, 853, 866, 881,
- 891, 902, 912, 923, 933, 944, 955, 965,
- 976, 986, 997, 1007, 1022, 1037, 1051, 1065,
- 1079, 1093, 1104, 1116, 1131, 1146, 1161, 1171,
- 1182, 1193, 1203, 1213, 1234, 1255, 1274, 1284,
- 1303, 1321, 1330, 1340, 1350, 1360, 1367, 1376,
- 1387, 1393, 1400, 1406, 1413, 1419, 1426, 1433,
- 1439, 1446, 1452, 1459, 1465, 1476, 1487, 1497,
- 1507, 1517, 1527, 1534, 1542, 1553, 1564, 1575,
- 1581, 1588, 1595, 1601, 1607, 1624, 1641, 1656,
- 1662, 1678, 1692
-};
-
-static const unsigned char _tsip_machine_parser_header_To_indicies[] = {
- 0, 0, 1, 2, 2, 3, 2, 2,
- 1, 2, 2, 3, 1, 3, 4, 3,
- 5, 6, 5, 5, 7, 5, 5, 5,
- 5, 8, 5, 8, 1, 9, 1, 10,
- 10, 1, 10, 11, 10, 5, 6, 5,
- 5, 7, 5, 5, 5, 5, 8, 5,
- 8, 1, 12, 1, 13, 13, 1, 13,
- 13, 7, 1, 14, 14, 1, 15, 15,
- 16, 17, 16, 16, 16, 16, 1, 15,
- 15, 17, 1, 18, 19, 18, 20, 21,
- 20, 22, 1, 23, 1, 22, 24, 22,
- 25, 25, 25, 26, 26, 25, 25, 25,
- 25, 25, 25, 1, 27, 1, 28, 28,
- 1, 28, 28, 25, 25, 25, 26, 26,
- 25, 25, 25, 25, 25, 25, 1, 29,
- 30, 29, 31, 31, 31, 32, 33, 31,
- 31, 31, 31, 31, 31, 1, 34, 35,
- 34, 22, 33, 1, 36, 1, 37, 37,
- 1, 37, 37, 22, 33, 1, 33, 38,
- 33, 39, 40, 39, 39, 41, 39, 39,
- 39, 39, 39, 39, 1, 42, 1, 43,
- 43, 1, 43, 44, 43, 39, 40, 39,
- 39, 41, 39, 39, 39, 39, 39, 39,
- 1, 45, 1, 46, 46, 1, 46, 46,
- 40, 1, 47, 48, 49, 1, 1, 1,
- 40, 50, 1, 40, 40, 1, 51, 30,
- 51, 32, 1, 52, 53, 52, 22, 1,
- 54, 1, 55, 55, 1, 55, 55, 22,
- 1, 40, 40, 40, 1, 51, 30, 51,
- 39, 39, 39, 32, 39, 39, 39, 39,
- 39, 39, 1, 57, 56, 56, 56, 1,
- 59, 48, 58, 58, 58, 1, 59, 48,
- 60, 60, 60, 1, 59, 48, 61, 61,
- 61, 1, 59, 48, 1, 63, 62, 56,
- 56, 1, 64, 59, 48, 65, 58, 58,
- 1, 66, 1, 67, 68, 1, 69, 1,
- 70, 71, 1, 72, 1, 48, 73, 1,
- 48, 74, 1, 48, 1, 70, 75, 1,
- 70, 1, 67, 76, 1, 67, 1, 64,
- 59, 48, 77, 60, 60, 1, 64, 59,
- 48, 61, 61, 61, 1, 79, 48, 78,
- 78, 78, 1, 81, 48, 80, 80, 80,
- 1, 81, 48, 82, 82, 82, 1, 81,
- 48, 83, 83, 83, 1, 81, 48, 1,
- 84, 78, 78, 1, 64, 81, 48, 85,
- 80, 80, 1, 64, 81, 48, 86, 82,
- 82, 1, 64, 81, 48, 83, 83, 83,
- 1, 87, 1, 64, 88, 1, 64, 89,
- 1, 64, 1, 63, 1, 29, 30, 29,
- 31, 31, 31, 32, 33, 90, 90, 31,
- 31, 31, 31, 31, 31, 1, 29, 30,
- 29, 31, 31, 31, 32, 33, 91, 91,
- 31, 31, 31, 31, 31, 31, 1, 92,
- 30, 92, 31, 31, 31, 32, 93, 31,
- 31, 31, 31, 31, 31, 1, 94, 95,
- 94, 22, 93, 1, 96, 1, 97, 97,
- 1, 97, 97, 22, 93, 1, 93, 98,
- 93, 99, 40, 99, 99, 41, 99, 99,
- 99, 99, 99, 99, 1, 100, 1, 101,
- 101, 1, 101, 44, 101, 99, 40, 99,
- 99, 41, 99, 99, 99, 99, 99, 99,
- 1, 102, 103, 102, 104, 104, 104, 105,
- 104, 104, 104, 104, 104, 104, 1, 106,
- 107, 106, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 1, 109, 110, 109, 108,
- 108, 108, 111, 108, 108, 108, 108, 108,
- 108, 1, 112, 11, 112, 7, 1, 113,
- 1, 106, 106, 1, 115, 116, 117, 1,
- 1, 1, 114, 118, 1, 114, 114, 1,
- 109, 110, 109, 111, 1, 114, 114, 114,
- 1, 119, 107, 119, 108, 108, 108, 108,
- 120, 121, 108, 120, 120, 120, 108, 120,
- 1, 122, 110, 122, 108, 108, 108, 121,
- 111, 108, 108, 108, 108, 108, 108, 1,
- 123, 11, 123, 121, 7, 1, 124, 125,
- 126, 125, 127, 124, 127, 126, 127, 128,
- 128, 128, 127, 129, 129, 128, 128, 128,
- 128, 128, 128, 124, 130, 131, 130, 132,
- 132, 132, 133, 134, 132, 132, 132, 132,
- 132, 132, 124, 135, 126, 135, 127, 134,
- 124, 136, 126, 136, 137, 138, 137, 137,
- 127, 139, 137, 137, 137, 137, 137, 137,
- 124, 140, 131, 140, 137, 137, 137, 133,
- 137, 137, 137, 137, 137, 137, 124, 141,
- 126, 141, 142, 143, 144, 124, 124, 138,
- 140, 131, 140, 133, 124, 143, 126, 143,
- 145, 142, 145, 145, 143, 146, 144, 146,
- 145, 124, 124, 145, 145, 145, 145, 145,
- 138, 147, 131, 147, 148, 142, 148, 148,
- 149, 150, 144, 148, 124, 124, 148, 148,
- 148, 148, 148, 138, 151, 126, 151, 142,
- 143, 150, 144, 124, 124, 138, 152, 126,
- 152, 153, 154, 153, 153, 143, 155, 144,
- 153, 124, 124, 153, 153, 153, 153, 153,
- 138, 156, 131, 156, 153, 142, 153, 153,
- 149, 144, 153, 124, 124, 153, 153, 153,
- 153, 153, 138, 141, 126, 141, 143, 138,
- 138, 124, 156, 131, 156, 142, 149, 144,
- 124, 124, 138, 141, 126, 141, 142, 158,
- 143, 144, 124, 124, 157, 157, 157, 138,
- 141, 126, 141, 142, 160, 143, 144, 154,
- 124, 124, 159, 159, 159, 138, 141, 126,
- 141, 142, 160, 143, 144, 154, 124, 124,
- 161, 161, 161, 138, 141, 126, 141, 142,
- 160, 143, 144, 154, 124, 124, 162, 162,
- 162, 138, 141, 126, 141, 142, 160, 143,
- 144, 154, 124, 124, 138, 141, 126, 141,
- 142, 164, 143, 144, 124, 124, 163, 157,
- 157, 138, 141, 126, 141, 142, 165, 160,
- 143, 144, 154, 124, 124, 166, 159, 159,
- 138, 141, 126, 141, 142, 143, 144, 124,
- 124, 167, 138, 141, 126, 141, 142, 168,
- 143, 144, 124, 124, 169, 138, 141, 126,
- 141, 142, 143, 144, 124, 124, 170, 138,
- 141, 126, 141, 142, 171, 143, 144, 124,
- 124, 172, 138, 141, 126, 141, 142, 143,
- 144, 124, 124, 173, 138, 141, 126, 141,
- 142, 143, 144, 154, 124, 124, 174, 138,
- 141, 126, 141, 142, 143, 144, 154, 124,
- 124, 175, 138, 141, 126, 141, 142, 143,
- 144, 154, 124, 124, 138, 141, 126, 141,
- 142, 171, 143, 144, 124, 124, 176, 138,
- 141, 126, 141, 142, 171, 143, 144, 124,
- 124, 138, 141, 126, 141, 142, 168, 143,
- 144, 124, 124, 177, 138, 141, 126, 141,
- 142, 168, 143, 144, 124, 124, 138, 141,
- 126, 141, 142, 165, 160, 143, 144, 154,
- 124, 124, 178, 161, 161, 138, 141, 126,
- 141, 142, 165, 160, 143, 144, 154, 124,
- 124, 162, 162, 162, 138, 141, 126, 141,
- 142, 180, 143, 144, 154, 124, 124, 179,
- 179, 179, 138, 141, 126, 141, 142, 182,
- 143, 144, 154, 124, 124, 181, 181, 181,
- 138, 141, 126, 141, 142, 182, 143, 144,
- 154, 124, 124, 183, 183, 183, 138, 141,
- 126, 141, 142, 182, 143, 144, 154, 124,
- 124, 184, 184, 184, 138, 141, 126, 141,
- 142, 182, 143, 144, 154, 124, 124, 138,
- 141, 126, 141, 142, 143, 144, 124, 124,
- 185, 179, 179, 138, 141, 126, 141, 142,
- 165, 182, 143, 144, 154, 124, 124, 186,
- 181, 181, 138, 141, 126, 141, 142, 165,
- 182, 143, 144, 154, 124, 124, 187, 183,
- 183, 138, 141, 126, 141, 142, 165, 182,
- 143, 144, 154, 124, 124, 184, 184, 184,
- 138, 141, 126, 141, 142, 143, 144, 124,
- 124, 188, 138, 141, 126, 141, 142, 165,
- 143, 144, 124, 124, 189, 138, 141, 126,
- 141, 142, 165, 143, 144, 124, 124, 190,
- 138, 141, 126, 141, 142, 165, 143, 144,
- 124, 124, 138, 141, 126, 141, 142, 164,
- 143, 144, 124, 124, 138, 147, 131, 147,
- 148, 142, 148, 148, 149, 150, 191, 144,
- 191, 148, 124, 124, 148, 148, 148, 148,
- 148, 138, 147, 131, 147, 148, 142, 148,
- 148, 149, 150, 192, 144, 192, 148, 124,
- 124, 148, 148, 148, 148, 148, 138, 193,
- 131, 193, 148, 142, 148, 148, 149, 194,
- 144, 148, 124, 124, 148, 148, 148, 148,
- 148, 138, 195, 126, 195, 142, 143, 194,
- 144, 124, 124, 138, 196, 126, 196, 197,
- 154, 197, 197, 143, 155, 144, 197, 124,
- 124, 197, 197, 197, 197, 197, 138, 198,
- 199, 198, 200, 142, 200, 200, 201, 144,
- 200, 124, 124, 200, 200, 200, 200, 200,
- 138, 125, 126, 125, 203, 127, 202, 202,
- 202, 124, 125, 126, 125, 205, 127, 142,
- 204, 204, 204, 124, 125, 126, 125, 205,
- 127, 142, 206, 206, 206, 124, 125, 126,
- 125, 205, 127, 142, 207, 207, 207, 124,
- 125, 126, 125, 205, 127, 142, 124, 125,
- 126, 125, 209, 127, 208, 202, 202, 124,
- 125, 126, 125, 210, 205, 127, 142, 211,
- 204, 204, 124, 125, 126, 125, 127, 212,
- 124, 125, 126, 125, 213, 127, 214, 124,
- 125, 126, 125, 127, 215, 124, 125, 126,
- 125, 216, 127, 217, 124, 125, 126, 125,
- 127, 218, 124, 125, 126, 125, 127, 142,
- 219, 124, 125, 126, 125, 127, 142, 220,
- 124, 125, 126, 125, 127, 142, 124, 125,
- 126, 125, 216, 127, 221, 124, 125, 126,
- 125, 216, 127, 124, 125, 126, 125, 213,
- 127, 222, 124, 125, 126, 125, 213, 127,
- 124, 125, 126, 125, 210, 205, 127, 142,
- 223, 206, 206, 124, 125, 126, 125, 210,
- 205, 127, 142, 207, 207, 207, 124, 125,
- 126, 125, 225, 127, 142, 224, 224, 224,
- 124, 125, 126, 125, 227, 127, 142, 226,
- 226, 226, 124, 125, 126, 125, 227, 127,
- 142, 228, 228, 228, 124, 125, 126, 125,
- 227, 127, 142, 229, 229, 229, 124, 125,
- 126, 125, 227, 127, 142, 124, 125, 126,
- 125, 127, 230, 224, 224, 124, 125, 126,
- 125, 210, 227, 127, 142, 231, 226, 226,
- 124, 125, 126, 125, 210, 227, 127, 142,
- 232, 228, 228, 124, 125, 126, 125, 210,
- 227, 127, 142, 229, 229, 229, 124, 125,
- 126, 125, 127, 233, 124, 125, 126, 125,
- 210, 127, 234, 124, 125, 126, 125, 210,
- 127, 235, 124, 125, 126, 125, 210, 127,
- 124, 125, 126, 125, 209, 127, 124, 130,
- 131, 130, 132, 132, 132, 133, 134, 236,
- 236, 132, 132, 132, 132, 132, 132, 124,
- 130, 131, 130, 132, 132, 132, 133, 134,
- 237, 237, 132, 132, 132, 132, 132, 132,
- 124, 238, 131, 238, 132, 132, 132, 133,
- 239, 132, 132, 132, 132, 132, 132, 124,
- 240, 126, 240, 127, 239, 124, 241, 126,
- 241, 242, 138, 242, 242, 127, 139, 242,
- 242, 242, 242, 242, 242, 124, 243, 199,
- 243, 244, 244, 244, 245, 244, 244, 244,
- 244, 244, 244, 124, 1, 0
-};
-
-static const unsigned char _tsip_machine_parser_header_To_trans_targs[] = {
- 2, 0, 3, 4, 5, 91, 96, 11,
- 101, 6, 7, 8, 9, 10, 12, 13,
- 12, 14, 15, 16, 16, 17, 18, 202,
- 19, 22, 79, 20, 21, 23, 17, 22,
- 18, 27, 23, 24, 25, 26, 28, 43,
- 34, 44, 29, 30, 31, 32, 33, 35,
- 37, 42, 36, 38, 38, 39, 40, 41,
- 45, 78, 46, 49, 47, 48, 50, 65,
- 51, 63, 52, 53, 61, 54, 55, 59,
- 56, 57, 58, 60, 62, 64, 66, 74,
- 67, 70, 68, 69, 71, 72, 73, 75,
- 76, 77, 80, 81, 82, 86, 82, 83,
- 84, 85, 87, 90, 88, 89, 38, 17,
- 90, 18, 92, 94, 91, 93, 8, 11,
- 93, 95, 96, 97, 99, 100, 98, 102,
- 101, 104, 103, 103, 105, 105, 17, 106,
- 107, 196, 108, 17, 107, 106, 109, 108,
- 109, 110, 111, 161, 105, 111, 112, 113,
- 118, 114, 155, 115, 114, 113, 116, 115,
- 116, 117, 119, 120, 111, 121, 154, 122,
- 125, 123, 124, 126, 141, 127, 139, 128,
- 129, 137, 130, 131, 135, 132, 133, 134,
- 136, 138, 140, 142, 150, 143, 146, 144,
- 145, 147, 148, 149, 151, 152, 153, 156,
- 157, 158, 159, 158, 159, 160, 111, 17,
- 160, 113, 162, 195, 163, 166, 164, 165,
- 167, 182, 168, 180, 169, 170, 178, 171,
- 172, 176, 173, 174, 175, 177, 179, 181,
- 183, 191, 184, 187, 185, 186, 188, 189,
- 190, 192, 193, 194, 197, 198, 199, 200,
- 199, 200, 201, 105, 201, 106
-};
-
-static const char _tsip_machine_parser_header_To_trans_actions[] = {
- 0, 0, 0, 0, 0, 1, 1, 0,
- 1, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 3, 0, 0, 0, 11,
- 0, 1, 1, 0, 0, 9, 9, 0,
- 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 9, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 7, 7,
- 0, 7, 0, 0, 0, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 3, 3, 3,
- 1, 1, 16, 16, 0, 16, 0, 3,
- 3, 0, 0, 0, 16, 3, 0, 3,
- 0, 1, 1, 16, 0, 16, 0, 3,
- 3, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 16, 0, 3, 3, 1, 13, 13,
- 0, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 16, 0,
- 3, 3, 1, 13, 0, 13
-};
-
-static const int tsip_machine_parser_header_To_start = 1;
-static const int tsip_machine_parser_header_To_first_final = 202;
-static const int tsip_machine_parser_header_To_error = 0;
-
-static const int tsip_machine_parser_header_To_en_main = 1;
-
-
-/* #line 130 "./ragel/tsip_parser_header_To.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_To_first_final);
- (void)(tsip_machine_parser_header_To_error);
- (void)(tsip_machine_parser_header_To_en_main);
-
-/* #line 750 "./src/headers/tsip_header_To.c" */
- {
- cs = tsip_machine_parser_header_To_start;
- }
-
-/* #line 135 "./ragel/tsip_parser_header_To.rl" */
-
-/* #line 757 "./src/headers/tsip_header_To.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_To_t *hdr_to = tsip_header_To_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 88 "./src/headers/tsip_header_To.c" */
+ static const char _tsip_machine_parser_header_To_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 2, 1, 3,
+ 2, 1, 4
+ };
+
+ static const short _tsip_machine_parser_header_To_key_offsets[] = {
+ 0, 0, 2, 7, 10, 31, 32, 34,
+ 55, 56, 58, 61, 65, 77, 80, 80,
+ 81, 85, 86, 105, 106, 108, 126, 145,
+ 150, 151, 153, 157, 176, 177, 179, 198,
+ 199, 201, 204, 212, 213, 215, 219, 223,
+ 224, 226, 229, 235, 253, 260, 268, 276,
+ 284, 286, 293, 302, 304, 307, 309, 312,
+ 314, 317, 320, 321, 324, 325, 328, 329,
+ 338, 347, 355, 363, 371, 379, 381, 387,
+ 396, 405, 414, 416, 419, 422, 423, 424,
+ 445, 466, 485, 490, 491, 493, 497, 516,
+ 517, 519, 538, 556, 573, 591, 595, 596,
+ 598, 606, 607, 609, 613, 619, 639, 658,
+ 663, 663, 667, 687, 706, 711, 731, 749,
+ 758, 762, 787, 811, 821, 845, 868, 876,
+ 885, 901, 918, 935, 952, 963, 979, 997,
+ 1008, 1020, 1031, 1043, 1054, 1066, 1078, 1088,
+ 1100, 1110, 1122, 1132, 1150, 1168, 1185, 1202,
+ 1219, 1236, 1247, 1262, 1280, 1298, 1316, 1327,
+ 1339, 1351, 1361, 1371, 1397, 1423, 1447, 1457,
+ 1481, 1504, 1515, 1527, 1539, 1551, 1557, 1568,
+ 1581, 1587, 1594, 1600, 1607, 1613, 1620, 1627,
+ 1632, 1639, 1644, 1651, 1656, 1669, 1682, 1694,
+ 1706, 1718, 1730, 1736, 1746, 1759, 1772, 1785,
+ 1791, 1798, 1805, 1810, 1815, 1836, 1857, 1876,
+ 1881, 1901, 1919
+ };
+
+ static const char _tsip_machine_parser_header_To_trans_keys[] = {
+ 84, 116, 9, 32, 58, 79, 111, 9,
+ 32, 58, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 13, 32, 33, 34, 37,
+ 39, 60, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 10,
+ 9, 32, 9, 32, 60, 65, 90, 97,
+ 122, 9, 32, 43, 58, 45, 46, 48,
+ 57, 65, 90, 97, 122, 9, 32, 58,
+ 62, 9, 13, 32, 59, 10, 9, 13,
+ 32, 33, 37, 39, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 59, 61, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 59, 61, 10, 9,
+ 32, 9, 32, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 10, 9,
+ 32, 9, 32, 34, 13, 34, 92, 127,
+ 0, 8, 10, 31, 10, 9, 32, 9,
+ 13, 32, 59, 9, 13, 32, 59, 10,
+ 9, 32, 9, 32, 59, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 58, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 48, 57, 46, 48, 57,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 46, 48, 57, 46, 46, 48, 57,
+ 46, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 46, 48, 57, 46, 58,
+ 9, 13, 32, 33, 37, 39, 59, 61,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 61, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 61, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 59, 61, 10, 9, 32, 9, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 59, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 60, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 60, 10, 9, 32, 13, 34,
+ 92, 127, 0, 8, 10, 31, 10, 9,
+ 32, 9, 13, 32, 60, 0, 9, 11,
+ 12, 14, 127, 9, 13, 32, 33, 37,
+ 39, 42, 43, 58, 126, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 37, 39, 58, 60, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 58, 60, 9,
+ 13, 32, 59, 9, 13, 32, 33, 37,
+ 39, 59, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 59, 61, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 59, 61, 9,
+ 13, 32, 33, 34, 37, 39, 59, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 59, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 34, 59, 92, 127, 0, 31, 9, 13,
+ 32, 59, 9, 13, 32, 33, 34, 37,
+ 39, 59, 84, 92, 116, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 34,
+ 37, 39, 59, 61, 92, 126, 127, 0,
+ 31, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 34, 59,
+ 61, 92, 127, 0, 31, 9, 13, 32,
+ 33, 34, 37, 39, 59, 91, 92, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 59, 92, 126, 127,
+ 0, 31, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 0, 8, 11, 127, 9, 13, 32, 34,
+ 59, 92, 127, 0, 31, 9, 13, 32,
+ 34, 58, 59, 92, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 58, 59, 92, 93, 127, 0,
+ 31, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 34, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 58, 59, 92, 93,
+ 127, 0, 31, 9, 13, 32, 34, 58,
+ 59, 92, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 46,
+ 58, 59, 92, 93, 127, 0, 31, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 34, 59, 92, 127, 0, 31, 48, 57,
+ 9, 13, 32, 34, 46, 59, 92, 127,
+ 0, 31, 48, 57, 9, 13, 32, 34,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 59,
+ 92, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 59, 92, 93, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 59, 92,
+ 93, 127, 0, 31, 48, 57, 9, 13,
+ 32, 34, 59, 92, 93, 127, 0, 31,
+ 9, 13, 32, 34, 46, 59, 92, 127,
+ 0, 31, 48, 57, 9, 13, 32, 34,
+ 46, 59, 92, 127, 0, 31, 9, 13,
+ 32, 34, 46, 59, 92, 127, 0, 31,
+ 48, 57, 9, 13, 32, 34, 46, 59,
+ 92, 127, 0, 31, 9, 13, 32, 34,
+ 46, 58, 59, 92, 93, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 46, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 58, 59, 92, 93,
+ 127, 0, 31, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 34, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 58, 59,
+ 92, 93, 127, 0, 31, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 34, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 58, 59, 92, 93, 127, 0, 31, 9,
+ 13, 32, 34, 59, 92, 127, 0, 31,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 34, 46, 58, 59, 92, 93, 127,
+ 0, 31, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 34, 46, 58, 59, 92,
+ 93, 127, 0, 31, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 34, 46, 58,
+ 59, 92, 93, 127, 0, 31, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 34,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 48, 57, 9, 13, 32, 34, 46,
+ 59, 92, 127, 0, 31, 48, 57, 9,
+ 13, 32, 34, 46, 59, 92, 127, 0,
+ 31, 9, 13, 32, 34, 58, 59, 92,
+ 127, 0, 31, 9, 13, 32, 33, 34,
+ 37, 39, 59, 61, 65, 92, 97, 126,
+ 127, 0, 31, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 13, 32,
+ 33, 34, 37, 39, 59, 61, 71, 92,
+ 103, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 34, 37, 39, 59, 61,
+ 92, 126, 127, 0, 31, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 34, 59, 61, 92, 127, 0,
+ 31, 9, 13, 32, 33, 34, 37, 39,
+ 59, 91, 92, 126, 127, 0, 31, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 34, 37, 39,
+ 59, 92, 126, 127, 0, 31, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 58, 59, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 58, 59, 93, 48, 57, 65,
+ 70, 97, 102, 9, 13, 32, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 58, 59, 93, 9, 13, 32,
+ 58, 59, 48, 57, 65, 70, 97, 102,
+ 9, 13, 32, 46, 58, 59, 93, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 59, 48, 57, 9, 13, 32, 46, 59,
+ 48, 57, 9, 13, 32, 59, 48, 57,
+ 9, 13, 32, 46, 59, 48, 57, 9,
+ 13, 32, 59, 48, 57, 9, 13, 32,
+ 59, 93, 48, 57, 9, 13, 32, 59,
+ 93, 48, 57, 9, 13, 32, 59, 93,
+ 9, 13, 32, 46, 59, 48, 57, 9,
+ 13, 32, 46, 59, 9, 13, 32, 46,
+ 59, 48, 57, 9, 13, 32, 46, 59,
+ 9, 13, 32, 46, 58, 59, 93, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 46, 58, 59, 93, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 58, 59, 93,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 58, 59, 93, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 58, 59, 93,
+ 48, 57, 65, 70, 97, 102, 9, 13,
+ 32, 58, 59, 93, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 58, 59, 93,
+ 9, 13, 32, 59, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 46, 58, 59,
+ 93, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 46, 58, 59, 93, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 46,
+ 58, 59, 93, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 59, 48, 57, 9,
+ 13, 32, 46, 59, 48, 57, 9, 13,
+ 32, 46, 59, 48, 57, 9, 13, 32,
+ 46, 59, 9, 13, 32, 58, 59, 9,
+ 13, 32, 33, 37, 39, 59, 61, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 59, 61, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 59,
+ 61, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 59, 91, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 59, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 0
+ };
+
+ static const char _tsip_machine_parser_header_To_single_lengths[] = {
+ 0, 2, 5, 3, 9, 1, 2, 9,
+ 1, 2, 3, 0, 4, 3, 0, 1,
+ 4, 1, 9, 1, 2, 8, 9, 5,
+ 1, 2, 4, 9, 1, 2, 9, 1,
+ 2, 3, 4, 1, 2, 4, 4, 1,
+ 2, 3, 0, 8, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 3,
+ 3, 2, 2, 2, 2, 2, 0, 3,
+ 3, 3, 0, 1, 1, 1, 1, 11,
+ 11, 9, 5, 1, 2, 4, 9, 1,
+ 2, 9, 8, 7, 8, 4, 1, 2,
+ 4, 1, 2, 4, 0, 10, 9, 5,
+ 0, 4, 10, 9, 5, 10, 8, 7,
+ 4, 13, 12, 8, 12, 11, 4, 7,
+ 8, 9, 9, 9, 9, 8, 10, 7,
+ 8, 7, 8, 7, 8, 8, 8, 8,
+ 8, 8, 8, 10, 10, 9, 9, 9,
+ 9, 9, 7, 10, 10, 10, 7, 8,
+ 8, 8, 8, 14, 14, 12, 8, 12,
+ 11, 5, 6, 6, 6, 6, 5, 7,
+ 4, 5, 4, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 7, 7, 6, 6,
+ 6, 6, 6, 4, 7, 7, 7, 4,
+ 5, 5, 5, 5, 11, 11, 9, 5,
+ 10, 8, 0
+ };
+
+ static const char _tsip_machine_parser_header_To_range_lengths[] = {
+ 0, 0, 0, 0, 6, 0, 0, 6,
+ 0, 0, 0, 2, 4, 0, 0, 0,
+ 0, 0, 5, 0, 0, 5, 5, 0,
+ 0, 0, 0, 5, 0, 0, 5, 0,
+ 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 3, 5, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 0, 1, 0, 3,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 0, 5,
+ 5, 5, 0, 0, 0, 0, 5, 0,
+ 0, 5, 5, 5, 5, 0, 0, 0,
+ 2, 0, 0, 0, 3, 5, 5, 0,
+ 0, 0, 5, 5, 0, 5, 5, 1,
+ 0, 6, 6, 1, 6, 6, 2, 1,
+ 4, 4, 4, 4, 1, 4, 4, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2,
+ 1, 2, 1, 4, 4, 4, 4, 4,
+ 4, 1, 4, 4, 4, 4, 2, 2,
+ 2, 1, 1, 6, 6, 6, 1, 6,
+ 6, 3, 3, 3, 3, 0, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 5, 5, 5, 0,
+ 5, 5, 0
+ };
+
+ static const short _tsip_machine_parser_header_To_index_offsets[] = {
+ 0, 0, 3, 9, 13, 29, 31, 34,
+ 50, 52, 55, 59, 62, 71, 75, 76,
+ 78, 83, 85, 100, 102, 105, 119, 134,
+ 140, 142, 145, 150, 165, 167, 170, 185,
+ 187, 190, 194, 201, 203, 206, 211, 216,
+ 218, 221, 225, 229, 243, 248, 254, 260,
+ 266, 269, 274, 281, 283, 286, 288, 291,
+ 293, 296, 299, 301, 304, 306, 309, 311,
+ 318, 325, 331, 337, 343, 349, 352, 356,
+ 363, 370, 377, 379, 382, 385, 387, 389,
+ 406, 423, 438, 444, 446, 449, 454, 469,
+ 471, 474, 489, 503, 516, 530, 535, 537,
+ 540, 547, 549, 552, 557, 561, 577, 592,
+ 598, 599, 604, 620, 635, 641, 657, 671,
+ 680, 685, 705, 724, 734, 753, 771, 778,
+ 787, 800, 814, 828, 842, 853, 866, 881,
+ 891, 902, 912, 923, 933, 944, 955, 965,
+ 976, 986, 997, 1007, 1022, 1037, 1051, 1065,
+ 1079, 1093, 1104, 1116, 1131, 1146, 1161, 1171,
+ 1182, 1193, 1203, 1213, 1234, 1255, 1274, 1284,
+ 1303, 1321, 1330, 1340, 1350, 1360, 1367, 1376,
+ 1387, 1393, 1400, 1406, 1413, 1419, 1426, 1433,
+ 1439, 1446, 1452, 1459, 1465, 1476, 1487, 1497,
+ 1507, 1517, 1527, 1534, 1542, 1553, 1564, 1575,
+ 1581, 1588, 1595, 1601, 1607, 1624, 1641, 1656,
+ 1662, 1678, 1692
+ };
+
+ static const unsigned char _tsip_machine_parser_header_To_indicies[] = {
+ 0, 0, 1, 2, 2, 3, 2, 2,
+ 1, 2, 2, 3, 1, 3, 4, 3,
+ 5, 6, 5, 5, 7, 5, 5, 5,
+ 5, 8, 5, 8, 1, 9, 1, 10,
+ 10, 1, 10, 11, 10, 5, 6, 5,
+ 5, 7, 5, 5, 5, 5, 8, 5,
+ 8, 1, 12, 1, 13, 13, 1, 13,
+ 13, 7, 1, 14, 14, 1, 15, 15,
+ 16, 17, 16, 16, 16, 16, 1, 15,
+ 15, 17, 1, 18, 19, 18, 20, 21,
+ 20, 22, 1, 23, 1, 22, 24, 22,
+ 25, 25, 25, 26, 26, 25, 25, 25,
+ 25, 25, 25, 1, 27, 1, 28, 28,
+ 1, 28, 28, 25, 25, 25, 26, 26,
+ 25, 25, 25, 25, 25, 25, 1, 29,
+ 30, 29, 31, 31, 31, 32, 33, 31,
+ 31, 31, 31, 31, 31, 1, 34, 35,
+ 34, 22, 33, 1, 36, 1, 37, 37,
+ 1, 37, 37, 22, 33, 1, 33, 38,
+ 33, 39, 40, 39, 39, 41, 39, 39,
+ 39, 39, 39, 39, 1, 42, 1, 43,
+ 43, 1, 43, 44, 43, 39, 40, 39,
+ 39, 41, 39, 39, 39, 39, 39, 39,
+ 1, 45, 1, 46, 46, 1, 46, 46,
+ 40, 1, 47, 48, 49, 1, 1, 1,
+ 40, 50, 1, 40, 40, 1, 51, 30,
+ 51, 32, 1, 52, 53, 52, 22, 1,
+ 54, 1, 55, 55, 1, 55, 55, 22,
+ 1, 40, 40, 40, 1, 51, 30, 51,
+ 39, 39, 39, 32, 39, 39, 39, 39,
+ 39, 39, 1, 57, 56, 56, 56, 1,
+ 59, 48, 58, 58, 58, 1, 59, 48,
+ 60, 60, 60, 1, 59, 48, 61, 61,
+ 61, 1, 59, 48, 1, 63, 62, 56,
+ 56, 1, 64, 59, 48, 65, 58, 58,
+ 1, 66, 1, 67, 68, 1, 69, 1,
+ 70, 71, 1, 72, 1, 48, 73, 1,
+ 48, 74, 1, 48, 1, 70, 75, 1,
+ 70, 1, 67, 76, 1, 67, 1, 64,
+ 59, 48, 77, 60, 60, 1, 64, 59,
+ 48, 61, 61, 61, 1, 79, 48, 78,
+ 78, 78, 1, 81, 48, 80, 80, 80,
+ 1, 81, 48, 82, 82, 82, 1, 81,
+ 48, 83, 83, 83, 1, 81, 48, 1,
+ 84, 78, 78, 1, 64, 81, 48, 85,
+ 80, 80, 1, 64, 81, 48, 86, 82,
+ 82, 1, 64, 81, 48, 83, 83, 83,
+ 1, 87, 1, 64, 88, 1, 64, 89,
+ 1, 64, 1, 63, 1, 29, 30, 29,
+ 31, 31, 31, 32, 33, 90, 90, 31,
+ 31, 31, 31, 31, 31, 1, 29, 30,
+ 29, 31, 31, 31, 32, 33, 91, 91,
+ 31, 31, 31, 31, 31, 31, 1, 92,
+ 30, 92, 31, 31, 31, 32, 93, 31,
+ 31, 31, 31, 31, 31, 1, 94, 95,
+ 94, 22, 93, 1, 96, 1, 97, 97,
+ 1, 97, 97, 22, 93, 1, 93, 98,
+ 93, 99, 40, 99, 99, 41, 99, 99,
+ 99, 99, 99, 99, 1, 100, 1, 101,
+ 101, 1, 101, 44, 101, 99, 40, 99,
+ 99, 41, 99, 99, 99, 99, 99, 99,
+ 1, 102, 103, 102, 104, 104, 104, 105,
+ 104, 104, 104, 104, 104, 104, 1, 106,
+ 107, 106, 108, 108, 108, 108, 108, 108,
+ 108, 108, 108, 1, 109, 110, 109, 108,
+ 108, 108, 111, 108, 108, 108, 108, 108,
+ 108, 1, 112, 11, 112, 7, 1, 113,
+ 1, 106, 106, 1, 115, 116, 117, 1,
+ 1, 1, 114, 118, 1, 114, 114, 1,
+ 109, 110, 109, 111, 1, 114, 114, 114,
+ 1, 119, 107, 119, 108, 108, 108, 108,
+ 120, 121, 108, 120, 120, 120, 108, 120,
+ 1, 122, 110, 122, 108, 108, 108, 121,
+ 111, 108, 108, 108, 108, 108, 108, 1,
+ 123, 11, 123, 121, 7, 1, 124, 125,
+ 126, 125, 127, 124, 127, 126, 127, 128,
+ 128, 128, 127, 129, 129, 128, 128, 128,
+ 128, 128, 128, 124, 130, 131, 130, 132,
+ 132, 132, 133, 134, 132, 132, 132, 132,
+ 132, 132, 124, 135, 126, 135, 127, 134,
+ 124, 136, 126, 136, 137, 138, 137, 137,
+ 127, 139, 137, 137, 137, 137, 137, 137,
+ 124, 140, 131, 140, 137, 137, 137, 133,
+ 137, 137, 137, 137, 137, 137, 124, 141,
+ 126, 141, 142, 143, 144, 124, 124, 138,
+ 140, 131, 140, 133, 124, 143, 126, 143,
+ 145, 142, 145, 145, 143, 146, 144, 146,
+ 145, 124, 124, 145, 145, 145, 145, 145,
+ 138, 147, 131, 147, 148, 142, 148, 148,
+ 149, 150, 144, 148, 124, 124, 148, 148,
+ 148, 148, 148, 138, 151, 126, 151, 142,
+ 143, 150, 144, 124, 124, 138, 152, 126,
+ 152, 153, 154, 153, 153, 143, 155, 144,
+ 153, 124, 124, 153, 153, 153, 153, 153,
+ 138, 156, 131, 156, 153, 142, 153, 153,
+ 149, 144, 153, 124, 124, 153, 153, 153,
+ 153, 153, 138, 141, 126, 141, 143, 138,
+ 138, 124, 156, 131, 156, 142, 149, 144,
+ 124, 124, 138, 141, 126, 141, 142, 158,
+ 143, 144, 124, 124, 157, 157, 157, 138,
+ 141, 126, 141, 142, 160, 143, 144, 154,
+ 124, 124, 159, 159, 159, 138, 141, 126,
+ 141, 142, 160, 143, 144, 154, 124, 124,
+ 161, 161, 161, 138, 141, 126, 141, 142,
+ 160, 143, 144, 154, 124, 124, 162, 162,
+ 162, 138, 141, 126, 141, 142, 160, 143,
+ 144, 154, 124, 124, 138, 141, 126, 141,
+ 142, 164, 143, 144, 124, 124, 163, 157,
+ 157, 138, 141, 126, 141, 142, 165, 160,
+ 143, 144, 154, 124, 124, 166, 159, 159,
+ 138, 141, 126, 141, 142, 143, 144, 124,
+ 124, 167, 138, 141, 126, 141, 142, 168,
+ 143, 144, 124, 124, 169, 138, 141, 126,
+ 141, 142, 143, 144, 124, 124, 170, 138,
+ 141, 126, 141, 142, 171, 143, 144, 124,
+ 124, 172, 138, 141, 126, 141, 142, 143,
+ 144, 124, 124, 173, 138, 141, 126, 141,
+ 142, 143, 144, 154, 124, 124, 174, 138,
+ 141, 126, 141, 142, 143, 144, 154, 124,
+ 124, 175, 138, 141, 126, 141, 142, 143,
+ 144, 154, 124, 124, 138, 141, 126, 141,
+ 142, 171, 143, 144, 124, 124, 176, 138,
+ 141, 126, 141, 142, 171, 143, 144, 124,
+ 124, 138, 141, 126, 141, 142, 168, 143,
+ 144, 124, 124, 177, 138, 141, 126, 141,
+ 142, 168, 143, 144, 124, 124, 138, 141,
+ 126, 141, 142, 165, 160, 143, 144, 154,
+ 124, 124, 178, 161, 161, 138, 141, 126,
+ 141, 142, 165, 160, 143, 144, 154, 124,
+ 124, 162, 162, 162, 138, 141, 126, 141,
+ 142, 180, 143, 144, 154, 124, 124, 179,
+ 179, 179, 138, 141, 126, 141, 142, 182,
+ 143, 144, 154, 124, 124, 181, 181, 181,
+ 138, 141, 126, 141, 142, 182, 143, 144,
+ 154, 124, 124, 183, 183, 183, 138, 141,
+ 126, 141, 142, 182, 143, 144, 154, 124,
+ 124, 184, 184, 184, 138, 141, 126, 141,
+ 142, 182, 143, 144, 154, 124, 124, 138,
+ 141, 126, 141, 142, 143, 144, 124, 124,
+ 185, 179, 179, 138, 141, 126, 141, 142,
+ 165, 182, 143, 144, 154, 124, 124, 186,
+ 181, 181, 138, 141, 126, 141, 142, 165,
+ 182, 143, 144, 154, 124, 124, 187, 183,
+ 183, 138, 141, 126, 141, 142, 165, 182,
+ 143, 144, 154, 124, 124, 184, 184, 184,
+ 138, 141, 126, 141, 142, 143, 144, 124,
+ 124, 188, 138, 141, 126, 141, 142, 165,
+ 143, 144, 124, 124, 189, 138, 141, 126,
+ 141, 142, 165, 143, 144, 124, 124, 190,
+ 138, 141, 126, 141, 142, 165, 143, 144,
+ 124, 124, 138, 141, 126, 141, 142, 164,
+ 143, 144, 124, 124, 138, 147, 131, 147,
+ 148, 142, 148, 148, 149, 150, 191, 144,
+ 191, 148, 124, 124, 148, 148, 148, 148,
+ 148, 138, 147, 131, 147, 148, 142, 148,
+ 148, 149, 150, 192, 144, 192, 148, 124,
+ 124, 148, 148, 148, 148, 148, 138, 193,
+ 131, 193, 148, 142, 148, 148, 149, 194,
+ 144, 148, 124, 124, 148, 148, 148, 148,
+ 148, 138, 195, 126, 195, 142, 143, 194,
+ 144, 124, 124, 138, 196, 126, 196, 197,
+ 154, 197, 197, 143, 155, 144, 197, 124,
+ 124, 197, 197, 197, 197, 197, 138, 198,
+ 199, 198, 200, 142, 200, 200, 201, 144,
+ 200, 124, 124, 200, 200, 200, 200, 200,
+ 138, 125, 126, 125, 203, 127, 202, 202,
+ 202, 124, 125, 126, 125, 205, 127, 142,
+ 204, 204, 204, 124, 125, 126, 125, 205,
+ 127, 142, 206, 206, 206, 124, 125, 126,
+ 125, 205, 127, 142, 207, 207, 207, 124,
+ 125, 126, 125, 205, 127, 142, 124, 125,
+ 126, 125, 209, 127, 208, 202, 202, 124,
+ 125, 126, 125, 210, 205, 127, 142, 211,
+ 204, 204, 124, 125, 126, 125, 127, 212,
+ 124, 125, 126, 125, 213, 127, 214, 124,
+ 125, 126, 125, 127, 215, 124, 125, 126,
+ 125, 216, 127, 217, 124, 125, 126, 125,
+ 127, 218, 124, 125, 126, 125, 127, 142,
+ 219, 124, 125, 126, 125, 127, 142, 220,
+ 124, 125, 126, 125, 127, 142, 124, 125,
+ 126, 125, 216, 127, 221, 124, 125, 126,
+ 125, 216, 127, 124, 125, 126, 125, 213,
+ 127, 222, 124, 125, 126, 125, 213, 127,
+ 124, 125, 126, 125, 210, 205, 127, 142,
+ 223, 206, 206, 124, 125, 126, 125, 210,
+ 205, 127, 142, 207, 207, 207, 124, 125,
+ 126, 125, 225, 127, 142, 224, 224, 224,
+ 124, 125, 126, 125, 227, 127, 142, 226,
+ 226, 226, 124, 125, 126, 125, 227, 127,
+ 142, 228, 228, 228, 124, 125, 126, 125,
+ 227, 127, 142, 229, 229, 229, 124, 125,
+ 126, 125, 227, 127, 142, 124, 125, 126,
+ 125, 127, 230, 224, 224, 124, 125, 126,
+ 125, 210, 227, 127, 142, 231, 226, 226,
+ 124, 125, 126, 125, 210, 227, 127, 142,
+ 232, 228, 228, 124, 125, 126, 125, 210,
+ 227, 127, 142, 229, 229, 229, 124, 125,
+ 126, 125, 127, 233, 124, 125, 126, 125,
+ 210, 127, 234, 124, 125, 126, 125, 210,
+ 127, 235, 124, 125, 126, 125, 210, 127,
+ 124, 125, 126, 125, 209, 127, 124, 130,
+ 131, 130, 132, 132, 132, 133, 134, 236,
+ 236, 132, 132, 132, 132, 132, 132, 124,
+ 130, 131, 130, 132, 132, 132, 133, 134,
+ 237, 237, 132, 132, 132, 132, 132, 132,
+ 124, 238, 131, 238, 132, 132, 132, 133,
+ 239, 132, 132, 132, 132, 132, 132, 124,
+ 240, 126, 240, 127, 239, 124, 241, 126,
+ 241, 242, 138, 242, 242, 127, 139, 242,
+ 242, 242, 242, 242, 242, 124, 243, 199,
+ 243, 244, 244, 244, 245, 244, 244, 244,
+ 244, 244, 244, 124, 1, 0
+ };
+
+ static const unsigned char _tsip_machine_parser_header_To_trans_targs[] = {
+ 2, 0, 3, 4, 5, 91, 96, 11,
+ 101, 6, 7, 8, 9, 10, 12, 13,
+ 12, 14, 15, 16, 16, 17, 18, 202,
+ 19, 22, 79, 20, 21, 23, 17, 22,
+ 18, 27, 23, 24, 25, 26, 28, 43,
+ 34, 44, 29, 30, 31, 32, 33, 35,
+ 37, 42, 36, 38, 38, 39, 40, 41,
+ 45, 78, 46, 49, 47, 48, 50, 65,
+ 51, 63, 52, 53, 61, 54, 55, 59,
+ 56, 57, 58, 60, 62, 64, 66, 74,
+ 67, 70, 68, 69, 71, 72, 73, 75,
+ 76, 77, 80, 81, 82, 86, 82, 83,
+ 84, 85, 87, 90, 88, 89, 38, 17,
+ 90, 18, 92, 94, 91, 93, 8, 11,
+ 93, 95, 96, 97, 99, 100, 98, 102,
+ 101, 104, 103, 103, 105, 105, 17, 106,
+ 107, 196, 108, 17, 107, 106, 109, 108,
+ 109, 110, 111, 161, 105, 111, 112, 113,
+ 118, 114, 155, 115, 114, 113, 116, 115,
+ 116, 117, 119, 120, 111, 121, 154, 122,
+ 125, 123, 124, 126, 141, 127, 139, 128,
+ 129, 137, 130, 131, 135, 132, 133, 134,
+ 136, 138, 140, 142, 150, 143, 146, 144,
+ 145, 147, 148, 149, 151, 152, 153, 156,
+ 157, 158, 159, 158, 159, 160, 111, 17,
+ 160, 113, 162, 195, 163, 166, 164, 165,
+ 167, 182, 168, 180, 169, 170, 178, 171,
+ 172, 176, 173, 174, 175, 177, 179, 181,
+ 183, 191, 184, 187, 185, 186, 188, 189,
+ 190, 192, 193, 194, 197, 198, 199, 200,
+ 199, 200, 201, 105, 201, 106
+ };
+
+ static const char _tsip_machine_parser_header_To_trans_actions[] = {
+ 0, 0, 0, 0, 0, 1, 1, 0,
+ 1, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 3, 0, 0, 0, 11,
+ 0, 1, 1, 0, 0, 9, 9, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 7, 7,
+ 0, 7, 0, 0, 0, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 3, 3, 3,
+ 1, 1, 16, 16, 0, 16, 0, 3,
+ 3, 0, 0, 0, 16, 3, 0, 3,
+ 0, 1, 1, 16, 0, 16, 0, 3,
+ 3, 0, 0, 0, 16, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 0, 3, 3, 1, 13, 13,
+ 0, 13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 0,
+ 3, 3, 1, 13, 0, 13
+ };
+
+ static const int tsip_machine_parser_header_To_start = 1;
+ static const int tsip_machine_parser_header_To_first_final = 202;
+ static const int tsip_machine_parser_header_To_error = 0;
+
+ static const int tsip_machine_parser_header_To_en_main = 1;
+
+
+ /* #line 130 "./ragel/tsip_parser_header_To.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_To_first_final);
+ (void)(tsip_machine_parser_header_To_error);
+ (void)(tsip_machine_parser_header_To_en_main);
+
+ /* #line 750 "./src/headers/tsip_header_To.c" */
+ {
+ cs = tsip_machine_parser_header_To_start;
+ }
+
+ /* #line 135 "./ragel/tsip_parser_header_To.rl" */
+
+ /* #line 757 "./src/headers/tsip_header_To.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_To_trans_keys + _tsip_machine_parser_header_To_key_offsets[cs];
- _trans = _tsip_machine_parser_header_To_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_To_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_To_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_To_trans_keys + _tsip_machine_parser_header_To_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_To_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_To_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_To_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_To_indicies[_trans];
- cs = _tsip_machine_parser_header_To_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_To_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_To_actions + _tsip_machine_parser_header_To_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_To.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_To.rl" */
- {
- int len = (int)(p - tag_start);
- if(hdr_to && !hdr_to->uri){
- if((hdr_to->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_to->display_name){
- hdr_to->uri->display_name = tsk_strdup(hdr_to->display_name);
- }
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_To.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_to->display_name);
- tsk_strunquote(&hdr_to->display_name);
- }
- break;
- case 3:
-/* #line 66 "./ragel/tsip_parser_header_To.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_to->tag);
- }
- break;
- case 4:
-/* #line 70 "./ragel/tsip_parser_header_To.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_to));
- }
- break;
- case 5:
-/* #line 74 "./ragel/tsip_parser_header_To.rl" */
- {
- }
- break;
-/* #line 872 "./src/headers/tsip_header_To.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_To_indicies[_trans];
+ cs = _tsip_machine_parser_header_To_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_To_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_To_actions + _tsip_machine_parser_header_To_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_To.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_To.rl" */
+ {
+ int len = (int)(p - tag_start);
+ if(hdr_to && !hdr_to->uri) {
+ if((hdr_to->uri = tsip_uri_parse(tag_start, (tsk_size_t)len)) && hdr_to->display_name) {
+ hdr_to->uri->display_name = tsk_strdup(hdr_to->display_name);
+ }
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_To.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_to->display_name);
+ tsk_strunquote(&hdr_to->display_name);
+ }
+ break;
+ case 3:
+ /* #line 66 "./ragel/tsip_parser_header_To.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_to->tag);
+ }
+ break;
+ case 4:
+ /* #line 70 "./ragel/tsip_parser_header_To.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(hdr_to));
+ }
+ break;
+ case 5:
+ /* #line 74 "./ragel/tsip_parser_header_To.rl" */
+ {
+ }
+ break;
+ /* #line 872 "./src/headers/tsip_header_To.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 136 "./ragel/tsip_parser_header_To.rl" */
-
- if( cs <
-/* #line 888 "./src/headers/tsip_header_To.c" */
-202
-/* #line 137 "./ragel/tsip_parser_header_To.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'To' header.");
- TSK_OBJECT_SAFE_FREE(hdr_to);
- }
-
- return hdr_to;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 136 "./ragel/tsip_parser_header_To.rl" */
+
+ if( cs <
+ /* #line 888 "./src/headers/tsip_header_To.c" */
+ 202
+ /* #line 137 "./ragel/tsip_parser_header_To.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'To' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_to);
+ }
+
+ return hdr_to;
}
@@ -907,47 +918,48 @@ _again:
static tsk_object_t* tsip_header_To_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_To_t *To = self;
- if(To){
- const char* display_name = va_arg(*app, const char *);
- const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
- const char* tag = va_arg(*app, const char *);
-
- To->display_name = tsk_strdup(display_name);
- if(uri) To->uri = tsk_object_ref((void *)uri);
- To->tag = tsk_strdup(tag);
-
- TSIP_HEADER(To)->type = tsip_htype_To;
- TSIP_HEADER(To)->serialize = tsip_header_To_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new To header.");
- }
- return self;
+ tsip_header_To_t *To = self;
+ if(To) {
+ const char* display_name = va_arg(*app, const char *);
+ const tsip_uri_t* uri = va_arg(*app, const tsip_uri_t *);
+ const char* tag = va_arg(*app, const char *);
+
+ To->display_name = tsk_strdup(display_name);
+ if(uri) {
+ To->uri = tsk_object_ref((void *)uri);
+ }
+ To->tag = tsk_strdup(tag);
+
+ TSIP_HEADER(To)->type = tsip_htype_To;
+ TSIP_HEADER(To)->serialize = tsip_header_To_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new To header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_To_dtor(tsk_object_t *self)
{
- tsip_header_To_t *To = self;
- if(To){
- TSK_FREE(To->display_name);
- TSK_FREE(To->tag);
-
- TSK_OBJECT_SAFE_FREE(To->uri);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(To));
- }
- else{
- TSK_DEBUG_ERROR("Null To header.");
- }
-
- return self;
+ tsip_header_To_t *To = self;
+ if(To) {
+ TSK_FREE(To->display_name);
+ TSK_FREE(To->tag);
+
+ TSK_OBJECT_SAFE_FREE(To->uri);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(To));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null To header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_To_def_s =
-{
- sizeof(tsip_header_To_t),
- tsip_header_To_ctor,
- tsip_header_To_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_To_def_s = {
+ sizeof(tsip_header_To_t),
+ tsip_header_To_ctor,
+ tsip_header_To_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_To_def_t = &tsip_header_To_def_s;
diff --git a/tinySIP/src/headers/tsip_header_User_Agent.c b/tinySIP/src/headers/tsip_header_User_Agent.c
index a054de7..e14a516 100755
--- a/tinySIP/src/headers/tsip_header_User_Agent.c
+++ b/tinySIP/src/headers/tsip_header_User_Agent.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,228 +47,239 @@
tsip_header_User_Agent_t* tsip_header_User_Agent_create(const char* ua)
{
- return tsk_object_new(TSIP_HEADER_USER_AGENT_VA_ARGS(ua));
+ return tsk_object_new(TSIP_HEADER_USER_AGENT_VA_ARGS(ua));
}
tsip_header_User_Agent_t* tsip_header_User_Agent_create_null()
{
- return tsip_header_User_Agent_create(tsk_null);
+ return tsip_header_User_Agent_create(tsk_null);
}
int tsip_header_User_Agent_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_User_Agent_t *User_Agent = (const tsip_header_User_Agent_t *)header;
- if(User_Agent->value){
- return tsk_buffer_append(output, User_Agent->value, tsk_strlen(User_Agent->value));
- }
- return 0;
- }
-
- return -1;
+ if(header) {
+ const tsip_header_User_Agent_t *User_Agent = (const tsip_header_User_Agent_t *)header;
+ if(User_Agent->value) {
+ return tsk_buffer_append(output, User_Agent->value, tsk_strlen(User_Agent->value));
+ }
+ return 0;
+ }
+
+ return -1;
}
tsip_header_User_Agent_t *tsip_header_User_Agent_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_User_Agent_t *hdr_user_agent = tsip_header_User_Agent_create_null();
-
- const char *tag_start = tsk_null;
-
-
-/* #line 83 "./src/headers/tsip_header_User_Agent.c" */
-static const char _tsip_machine_parser_header_User_Agent_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 2,
- 0, 1
-};
-
-static const char _tsip_machine_parser_header_User_Agent_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 9, 11,
- 13, 15, 17, 19, 22, 25, 26, 27
-};
-
-static const char _tsip_machine_parser_header_User_Agent_trans_keys[] = {
- 85, 117, 83, 115, 69, 101, 82, 114,
- 45, 65, 97, 71, 103, 69, 101, 78,
- 110, 84, 116, 9, 32, 58, 9, 13,
- 32, 13, 10, 0
-};
-
-static const char _tsip_machine_parser_header_User_Agent_single_lengths[] = {
- 0, 2, 2, 2, 2, 1, 2, 2,
- 2, 2, 2, 3, 3, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_User_Agent_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tsip_machine_parser_header_User_Agent_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 14, 17,
- 20, 23, 26, 29, 33, 37, 39, 41
-};
-
-static const char _tsip_machine_parser_header_User_Agent_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 1, 6, 6,
- 1, 7, 7, 1, 8, 8, 1, 9,
- 9, 1, 10, 10, 1, 10, 10, 11,
- 1, 13, 14, 13, 12, 16, 15, 17,
- 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_User_Agent_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 12, 14, 13,
- 14, 15
-};
-
-static const char _tsip_machine_parser_header_User_Agent_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 7, 0,
- 3, 5
-};
-
-static const int tsip_machine_parser_header_User_Agent_start = 1;
-static const int tsip_machine_parser_header_User_Agent_first_final = 15;
-static const int tsip_machine_parser_header_User_Agent_error = 0;
-
-static const int tsip_machine_parser_header_User_Agent_en_main = 1;
-
-
-/* #line 100 "./ragel/tsip_parser_header_User_Agent.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_User_Agent_first_final);
- (void)(tsip_machine_parser_header_User_Agent_error);
- (void)(tsip_machine_parser_header_User_Agent_en_main);
-
-/* #line 150 "./src/headers/tsip_header_User_Agent.c" */
- {
- cs = tsip_machine_parser_header_User_Agent_start;
- }
-
-/* #line 105 "./ragel/tsip_parser_header_User_Agent.rl" */
-
-/* #line 157 "./src/headers/tsip_header_User_Agent.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_User_Agent_t *hdr_user_agent = tsip_header_User_Agent_create_null();
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 83 "./src/headers/tsip_header_User_Agent.c" */
+ static const char _tsip_machine_parser_header_User_Agent_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 2,
+ 0, 1
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 9, 11,
+ 13, 15, 17, 19, 22, 25, 26, 27
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_trans_keys[] = {
+ 85, 117, 83, 115, 69, 101, 82, 114,
+ 45, 65, 97, 71, 103, 69, 101, 78,
+ 110, 84, 116, 9, 32, 58, 9, 13,
+ 32, 13, 10, 0
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_single_lengths[] = {
+ 0, 2, 2, 2, 2, 1, 2, 2,
+ 2, 2, 2, 3, 3, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 14, 17,
+ 20, 23, 26, 29, 33, 37, 39, 41
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 1, 6, 6,
+ 1, 7, 7, 1, 8, 8, 1, 9,
+ 9, 1, 10, 10, 1, 10, 10, 11,
+ 1, 13, 14, 13, 12, 16, 15, 17,
+ 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 12, 14, 13,
+ 14, 15
+ };
+
+ static const char _tsip_machine_parser_header_User_Agent_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 7, 0,
+ 3, 5
+ };
+
+ static const int tsip_machine_parser_header_User_Agent_start = 1;
+ static const int tsip_machine_parser_header_User_Agent_first_final = 15;
+ static const int tsip_machine_parser_header_User_Agent_error = 0;
+
+ static const int tsip_machine_parser_header_User_Agent_en_main = 1;
+
+
+ /* #line 100 "./ragel/tsip_parser_header_User_Agent.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_User_Agent_first_final);
+ (void)(tsip_machine_parser_header_User_Agent_error);
+ (void)(tsip_machine_parser_header_User_Agent_en_main);
+
+ /* #line 150 "./src/headers/tsip_header_User_Agent.c" */
+ {
+ cs = tsip_machine_parser_header_User_Agent_start;
+ }
+
+ /* #line 105 "./ragel/tsip_parser_header_User_Agent.rl" */
+
+ /* #line 157 "./src/headers/tsip_header_User_Agent.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_User_Agent_trans_keys + _tsip_machine_parser_header_User_Agent_key_offsets[cs];
- _trans = _tsip_machine_parser_header_User_Agent_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_User_Agent_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_User_Agent_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_User_Agent_trans_keys + _tsip_machine_parser_header_User_Agent_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_User_Agent_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_User_Agent_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_User_Agent_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_User_Agent_indicies[_trans];
- cs = _tsip_machine_parser_header_User_Agent_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_User_Agent_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_User_Agent_actions + _tsip_machine_parser_header_User_Agent_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 48 "./ragel/tsip_parser_header_User_Agent.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 52 "./ragel/tsip_parser_header_User_Agent.rl" */
- {
- TSK_PARSER_SET_STRING(hdr_user_agent->value);
- }
- break;
- case 2:
-/* #line 56 "./ragel/tsip_parser_header_User_Agent.rl" */
- {
- }
- break;
-/* #line 248 "./src/headers/tsip_header_User_Agent.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_User_Agent_indicies[_trans];
+ cs = _tsip_machine_parser_header_User_Agent_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_User_Agent_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_User_Agent_actions + _tsip_machine_parser_header_User_Agent_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 48 "./ragel/tsip_parser_header_User_Agent.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 52 "./ragel/tsip_parser_header_User_Agent.rl" */
+ {
+ TSK_PARSER_SET_STRING(hdr_user_agent->value);
+ }
+ break;
+ case 2:
+ /* #line 56 "./ragel/tsip_parser_header_User_Agent.rl" */
+ {
+ }
+ break;
+ /* #line 248 "./src/headers/tsip_header_User_Agent.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 106 "./ragel/tsip_parser_header_User_Agent.rl" */
-
- if( cs <
-/* #line 264 "./src/headers/tsip_header_User_Agent.c" */
-15
-/* #line 107 "./ragel/tsip_parser_header_User_Agent.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'User-Agent' header.");
- TSK_OBJECT_SAFE_FREE(hdr_user_agent);
- }
-
- return hdr_user_agent;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 106 "./ragel/tsip_parser_header_User_Agent.rl" */
+
+ if( cs <
+ /* #line 264 "./src/headers/tsip_header_User_Agent.c" */
+ 15
+ /* #line 107 "./ragel/tsip_parser_header_User_Agent.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'User-Agent' header.");
+ TSK_OBJECT_SAFE_FREE(hdr_user_agent);
+ }
+
+ return hdr_user_agent;
}
@@ -283,37 +294,36 @@ _again:
static tsk_object_t* tsip_header_User_Agent_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_User_Agent_t *User_Agent = self;
- if(User_Agent){
- TSIP_HEADER(User_Agent)->type = tsip_htype_User_Agent;
- TSIP_HEADER(User_Agent)->serialize = tsip_header_User_Agent_serialize;
- User_Agent->value = tsk_strdup(va_arg(*app, const char*));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new User_Agent header.");
- }
- return self;
+ tsip_header_User_Agent_t *User_Agent = self;
+ if(User_Agent) {
+ TSIP_HEADER(User_Agent)->type = tsip_htype_User_Agent;
+ TSIP_HEADER(User_Agent)->serialize = tsip_header_User_Agent_serialize;
+ User_Agent->value = tsk_strdup(va_arg(*app, const char*));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new User_Agent header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_User_Agent_dtor(tsk_object_t *self)
{
- tsip_header_User_Agent_t *User_Agent = self;
- if(User_Agent){
- TSK_FREE(User_Agent->value);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(User_Agent));
- }
- else{
- TSK_DEBUG_ERROR("Null User_Agent header.");
- }
-
- return self;
+ tsip_header_User_Agent_t *User_Agent = self;
+ if(User_Agent) {
+ TSK_FREE(User_Agent->value);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(User_Agent));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null User_Agent header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_User_Agent_def_s =
-{
- sizeof(tsip_header_User_Agent_t),
- tsip_header_User_Agent_ctor,
- tsip_header_User_Agent_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_User_Agent_def_s = {
+ sizeof(tsip_header_User_Agent_t),
+ tsip_header_User_Agent_ctor,
+ tsip_header_User_Agent_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_User_Agent_def_t = &tsip_header_User_Agent_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Via.c b/tinySIP/src/headers/tsip_header_Via.c
index aef8ce8..9c7bb52 100755
--- a/tinySIP/src/headers/tsip_header_Via.c
+++ b/tinySIP/src/headers/tsip_header_Via.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,1296 +46,1307 @@
tsip_header_Via_t* tsip_header_Via_create(const char* proto_name, const char* proto_version, const char* transport, const char* host, uint16_t port)
{
- return tsk_object_new(TSIP_HEADER_VIA_VA_ARGS(proto_name, proto_version, transport, host, port));
+ return tsk_object_new(TSIP_HEADER_VIA_VA_ARGS(proto_name, proto_version, transport, host, port));
}
tsip_header_Via_t* tsip_header_Via_create_null()
{
- return tsip_header_Via_create(tsk_null, tsk_null, tsk_null, tsk_null, 0);
+ return tsip_header_Via_create(tsk_null, tsk_null, tsk_null, tsk_null, 0);
}
int tsip_header_Via_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Via_t *Via = (const tsip_header_Via_t *)header;
- tsk_istr_t port, rport, ttl;
- int ipv6 = (Via->host && tsk_strcontains(Via->host, tsk_strlen(Via->host), ":"));
+ if(header) {
+ const tsip_header_Via_t *Via = (const tsip_header_Via_t *)header;
+ tsk_istr_t port, rport, ttl;
+ int ipv6 = (Via->host && tsk_strcontains(Via->host, tsk_strlen(Via->host), ":"));
- if(Via->port){
- tsk_itoa(Via->port, &port);
- }
- if(Via->rport){
- tsk_itoa(Via->rport, &rport);
- }
- if(Via->ttl){
- tsk_itoa(Via->ttl, &ttl);
- }
+ if(Via->port) {
+ tsk_itoa(Via->port, &port);
+ }
+ if(Via->rport) {
+ tsk_itoa(Via->rport, &rport);
+ }
+ if(Via->ttl) {
+ tsk_itoa(Via->ttl, &ttl);
+ }
- /* SIP/2.0/UDP [::]:1988;test=1234;comp=sigcomp;rport=254;ttl=457;received=192.0.2.101;branch=z9hG4bK1245420841406\r\n" */
- return tsk_buffer_append_2(output, "%s/%s/%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ /* SIP/2.0/UDP [::]:1988;test=1234;comp=sigcomp;rport=254;ttl=457;received=192.0.2.101;branch=z9hG4bK1245420841406\r\n" */
+ return tsk_buffer_append_2(output, "%s/%s/%s %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- Via->proto_name ? Via->proto_name : "SIP",
+ Via->proto_name ? Via->proto_name : "SIP",
- Via->proto_version ? Via->proto_version : "2.0",
+ Via->proto_version ? Via->proto_version : "2.0",
- Via->transport ? Via->transport : "UDP",
+ Via->transport ? Via->transport : "UDP",
- ipv6 ? "[" : "",
- Via->host ? Via->host : "127.0.0.1",
- ipv6 ? "]" : "",
+ ipv6 ? "[" : "",
+ Via->host ? Via->host : "127.0.0.1",
+ ipv6 ? "]" : "",
- Via->port ? ":" : "",
- Via->port ? port : "",
+ Via->port ? ":" : "",
+ Via->port ? port : "",
- Via->maddr ? ";maddr=" : "",
- Via->maddr ? Via->maddr : "",
+ Via->maddr ? ";maddr=" : "",
+ Via->maddr ? Via->maddr : "",
- Via->sigcomp_id ? ";sigcomp-id=" : "",
- Via->sigcomp_id ? Via->sigcomp_id : "",
+ Via->sigcomp_id ? ";sigcomp-id=" : "",
+ Via->sigcomp_id ? Via->sigcomp_id : "",
- Via->comp ? ";comp=" : "",
- Via->comp ? Via->comp : "",
+ Via->comp ? ";comp=" : "",
+ Via->comp ? Via->comp : "",
- Via->rport>=0 ? (Via->rport>0?";rport=":";rport") : "",
- Via->rport>0 ? rport : "",
+ Via->rport>=0 ? (Via->rport>0?";rport=":";rport") : "",
+ Via->rport>0 ? rport : "",
- Via->ttl>=0 ? (Via->ttl>0?";ttl=":";ttl") : "",
- Via->ttl>0 ? ttl : "",
+ Via->ttl>=0 ? (Via->ttl>0?";ttl=":";ttl") : "",
+ Via->ttl>0 ? ttl : "",
- Via->received ? ";received=" : "",
- Via->received ? Via->received : "",
+ Via->received ? ";received=" : "",
+ Via->received ? Via->received : "",
- Via->branch ? ";branch=" : "",
- Via->branch ? Via->branch : ""
- );
- }
- return -1;
+ Via->branch ? ";branch=" : "",
+ Via->branch ? Via->branch : ""
+ );
+ }
+ return -1;
}
char* tsip_header_Via_get_special_param_value(const tsip_header_t* header, const char* pname)
{
- if(header){
- const tsip_header_Via_t *Via = (const tsip_header_Via_t *)header;
- if(tsk_striequals(pname, "maddr")){
- return tsk_strdup(Via->maddr);
- }
- else if(tsk_striequals(pname, "sigcomp-id")){
- return tsk_strdup(Via->sigcomp_id);
- }
- else if(tsk_striequals(pname, "comp")){
- return tsk_strdup(Via->comp);
- }
- else if(tsk_striequals(pname, "rport")){
- tsk_istr_t rport;
- tsk_itoa(Via->rport, &rport);
-
- return tsk_strdup(rport);
- }
- else if(tsk_striequals(pname, "received")){
- return tsk_strdup(Via->received);
- }
- else if(tsk_striequals(pname, "branch")){
- return tsk_strdup(Via->branch);
- }
- }
- return tsk_null;
+ if(header) {
+ const tsip_header_Via_t *Via = (const tsip_header_Via_t *)header;
+ if(tsk_striequals(pname, "maddr")) {
+ return tsk_strdup(Via->maddr);
+ }
+ else if(tsk_striequals(pname, "sigcomp-id")) {
+ return tsk_strdup(Via->sigcomp_id);
+ }
+ else if(tsk_striequals(pname, "comp")) {
+ return tsk_strdup(Via->comp);
+ }
+ else if(tsk_striequals(pname, "rport")) {
+ tsk_istr_t rport;
+ tsk_itoa(Via->rport, &rport);
+
+ return tsk_strdup(rport);
+ }
+ else if(tsk_striequals(pname, "received")) {
+ return tsk_strdup(Via->received);
+ }
+ else if(tsk_striequals(pname, "branch")) {
+ return tsk_strdup(Via->branch);
+ }
+ }
+ return tsk_null;
}
tsip_header_Vias_L_t *tsip_header_Via_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Vias_L_t *hdr_vias = tsk_list_create();
- tsip_header_Via_t *curr_via = tsk_null;
-
- const char *tag_start = tsk_null;
-
-
-/* #line 156 "./src/headers/tsip_header_Via.c" */
-static const char _tsip_machine_parser_header_Via_actions[] = {
- 0, 1, 0, 1, 2, 1, 3, 1,
- 4, 1, 5, 1, 6, 1, 7, 1,
- 8, 1, 9, 1, 10, 1, 11, 1,
- 13, 1, 14, 1, 16, 2, 1, 0,
- 2, 4, 15, 2, 5, 15, 2, 7,
- 15, 2, 8, 15, 2, 9, 15, 2,
- 10, 15, 2, 11, 15, 2, 12, 13,
- 2, 13, 15, 2, 14, 15, 3, 12,
- 13, 15
-};
-
-static const short _tsip_machine_parser_header_Via_key_offsets[] = {
- 0, 0, 2, 7, 10, 27, 28, 30,
- 46, 62, 66, 67, 69, 72, 89, 90,
- 92, 108, 124, 128, 129, 131, 134, 151,
- 152, 154, 170, 187, 197, 198, 200, 209,
- 217, 224, 232, 238, 252, 258, 259, 261,
- 266, 271, 272, 274, 278, 285, 290, 291,
- 293, 297, 324, 325, 327, 353, 371, 377,
- 378, 380, 385, 404, 405, 407, 426, 427,
- 429, 432, 440, 441, 443, 448, 449, 455,
- 472, 479, 487, 495, 503, 505, 512, 521,
- 523, 526, 528, 531, 533, 536, 539, 540,
- 543, 544, 547, 548, 557, 566, 574, 582,
- 590, 598, 600, 606, 615, 624, 633, 635,
- 638, 641, 642, 643, 663, 683, 703, 723,
- 743, 761, 767, 768, 770, 775, 794, 795,
- 797, 816, 833, 853, 873, 893, 911, 917,
- 918, 920, 925, 944, 945, 947, 966, 983,
- 1003, 1023, 1043, 1063, 1081, 1087, 1088, 1090,
- 1095, 1116, 1117, 1119, 1140, 1161, 1181, 1202,
- 1221, 1234, 1241, 1252, 1260, 1267, 1273, 1292,
- 1313, 1332, 1353, 1372, 1385, 1398, 1411, 1432,
- 1453, 1474, 1495, 1516, 1537, 1544, 1552, 1560,
- 1568, 1570, 1577, 1586, 1588, 1591, 1593, 1596,
- 1598, 1601, 1604, 1605, 1610, 1613, 1614, 1617,
- 1618, 1627, 1636, 1644, 1652, 1660, 1668, 1670,
- 1676, 1685, 1694, 1703, 1705, 1708, 1711, 1712,
- 1713, 1735, 1755, 1775, 1795, 1815, 1835, 1855,
- 1873, 1879, 1880, 1882, 1887, 1913, 1914, 1916,
- 1942, 1955, 1957, 1960, 1962, 1965, 1967, 1974,
- 1981, 1986, 1989, 1990, 1993, 1994, 2007, 2020,
- 2026, 2033, 2045, 2057, 2069, 2081, 2087, 2093,
- 2106, 2119, 2132, 2134, 2137, 2140, 2141, 2153,
- 2165, 2177, 2178, 2198, 2218, 2238, 2244, 2250,
- 2251, 2253, 2258, 2263, 2264, 2266, 2270, 2277,
- 2297, 2317, 2335, 2341, 2342, 2344, 2349, 2368,
- 2369, 2371, 2390, 2397, 2404, 2409, 2416, 2428,
- 2434, 2442, 2448, 2456, 2462, 2476, 2490, 2504,
- 2512, 2520, 2528, 2536, 2544, 2552, 2559, 2567,
- 2575, 2583, 2585, 2592, 2601, 2603, 2606, 2608,
- 2611, 2613, 2616, 2619, 2620, 2626, 2629, 2630,
- 2633, 2634, 2643, 2652, 2660, 2668, 2676, 2684,
- 2686, 2692, 2701, 2710, 2719, 2721, 2724, 2727,
- 2728, 2729, 2731
-};
-
-static const char _tsip_machine_parser_header_Via_trans_keys[] = {
- 86, 118, 9, 32, 58, 73, 105, 9,
- 32, 58, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 10, 9, 32, 9, 32,
- 33, 37, 39, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 47, 126, 42, 43,
- 45, 57, 65, 90, 95, 122, 9, 13,
- 32, 47, 10, 9, 32, 9, 32, 47,
- 9, 13, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 10, 9, 32, 9, 32, 33, 37,
- 39, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 13, 32, 33,
- 37, 39, 47, 126, 42, 43, 45, 57,
- 65, 90, 95, 122, 9, 13, 32, 47,
- 10, 9, 32, 9, 32, 47, 9, 13,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 10,
- 9, 32, 9, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 91, 48,
- 57, 65, 90, 97, 122, 10, 9, 32,
- 9, 32, 91, 48, 57, 65, 90, 97,
- 122, 45, 46, 48, 57, 65, 90, 97,
- 122, 45, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 48, 57, 65, 90, 97, 122, 9, 13,
- 32, 44, 45, 46, 58, 59, 48, 57,
- 65, 90, 97, 122, 9, 13, 32, 44,
- 58, 59, 10, 9, 32, 9, 32, 44,
- 58, 59, 9, 13, 32, 48, 57, 10,
- 9, 32, 9, 32, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 10, 9, 32, 9, 32, 44,
- 59, 9, 13, 32, 33, 37, 39, 66,
- 67, 77, 82, 84, 98, 99, 109, 114,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 32, 33, 37, 39, 66, 67, 77, 82,
- 84, 98, 99, 109, 114, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 44, 59,
- 61, 10, 9, 32, 9, 32, 44, 59,
- 61, 9, 13, 32, 33, 34, 37, 39,
- 91, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 44, 59,
- 10, 0, 9, 11, 12, 14, 127, 9,
- 13, 32, 33, 37, 39, 44, 59, 126,
- 42, 46, 48, 57, 65, 90, 95, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 46, 48, 57, 46,
- 46, 48, 57, 46, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 46, 48,
- 57, 46, 58, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 82, 114, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 65, 97, 126, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 78, 110, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 67, 99, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 72, 104, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 59, 61, 10,
- 9, 32, 9, 32, 44, 59, 61, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 10, 9, 32, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 13, 32, 33, 37, 39, 44, 59,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 79, 111, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 77, 109,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 80, 112, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 59, 61, 10, 9, 32,
- 9, 32, 44, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 65, 97, 126, 42, 46, 48, 57, 66,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 68, 100, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 68, 100, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 82, 114, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 59, 61, 10,
- 9, 32, 9, 32, 44, 59, 61, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 10, 9, 32, 9,
- 13, 32, 33, 34, 37, 39, 91, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 45, 46, 59, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 45, 59, 126, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 37, 39, 44, 45, 46, 59, 126,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 126, 42, 46, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 44, 45, 46, 59, 48, 57, 65, 90,
- 97, 122, 45, 48, 57, 65, 90, 97,
- 122, 9, 13, 32, 44, 59, 48, 57,
- 65, 90, 97, 122, 45, 46, 48, 57,
- 65, 90, 97, 122, 45, 48, 57, 65,
- 90, 97, 122, 48, 57, 65, 90, 97,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 126, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 45, 46, 59, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 126, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 45, 46, 59, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 126, 42, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 44,
- 45, 46, 59, 48, 57, 65, 90, 97,
- 122, 9, 13, 32, 44, 45, 46, 59,
- 48, 57, 65, 90, 97, 122, 9, 13,
- 32, 44, 45, 46, 59, 48, 57, 65,
- 90, 97, 122, 9, 13, 32, 33, 37,
- 39, 44, 45, 46, 59, 126, 42, 43,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 9, 13, 32, 33, 37, 39, 44, 45,
- 46, 59, 126, 42, 43, 48, 57, 65,
- 90, 95, 96, 97, 122, 9, 13, 32,
- 33, 37, 39, 44, 45, 46, 59, 126,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 9, 13, 32, 33, 37, 39,
- 44, 45, 46, 59, 126, 42, 43, 48,
- 57, 65, 90, 95, 96, 97, 122, 9,
- 13, 32, 33, 37, 39, 44, 45, 46,
- 59, 126, 42, 43, 48, 57, 65, 90,
- 95, 96, 97, 122, 9, 13, 32, 33,
- 37, 39, 44, 45, 46, 59, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 58, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 58, 93, 58, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 48,
- 57, 46, 48, 57, 48, 57, 93, 48,
- 57, 93, 48, 57, 93, 9, 13, 32,
- 44, 59, 46, 48, 57, 46, 46, 48,
- 57, 46, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 46, 48, 57, 46,
- 58, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 69, 80, 101, 112, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 67, 99, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 69, 101, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 73, 105, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 86, 118, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 69, 101, 126, 42, 46, 48, 57, 65,
- 90, 95, 122, 9, 13, 32, 33, 37,
- 39, 44, 59, 61, 68, 100, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 33, 37, 39, 44, 59, 61,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 44, 59, 61, 10,
- 9, 32, 9, 32, 44, 59, 61, 9,
- 13, 32, 33, 34, 37, 39, 58, 91,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 70, 71, 90, 95, 96, 97, 102, 103,
- 122, 10, 9, 32, 9, 13, 32, 33,
- 34, 37, 39, 58, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 70, 71, 90,
- 95, 96, 97, 102, 103, 122, 9, 13,
- 32, 44, 46, 58, 59, 48, 57, 65,
- 70, 97, 102, 48, 57, 46, 48, 57,
- 48, 57, 46, 48, 57, 48, 57, 9,
- 13, 32, 44, 59, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 46, 48, 57, 46, 46, 48,
- 57, 46, 9, 13, 32, 44, 46, 58,
- 59, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 44, 46, 58, 59, 48, 57,
- 65, 70, 97, 102, 9, 13, 32, 44,
- 58, 59, 58, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 44, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 44, 58, 59, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 44, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 44, 58, 59, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 44, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 44, 46, 58, 59, 48, 57, 65, 70,
- 97, 102, 9, 13, 32, 44, 46, 58,
- 59, 48, 57, 65, 70, 97, 102, 9,
- 13, 32, 44, 46, 58, 59, 48, 57,
- 65, 70, 97, 102, 48, 57, 46, 48,
- 57, 46, 48, 57, 46, 9, 13, 32,
- 44, 58, 59, 48, 57, 65, 70, 97,
- 102, 9, 13, 32, 44, 58, 59, 48,
- 57, 65, 70, 97, 102, 9, 13, 32,
- 44, 58, 59, 48, 57, 65, 70, 97,
- 102, 58, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 79, 111, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 33, 37, 39, 44, 59, 61, 82,
- 114, 126, 42, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 33, 37, 39,
- 44, 59, 61, 84, 116, 126, 42, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 61, 9, 13, 32, 44,
- 59, 61, 10, 9, 32, 9, 32, 44,
- 59, 61, 9, 13, 32, 48, 57, 10,
- 9, 32, 9, 32, 48, 57, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 84, 116,
- 126, 42, 46, 48, 57, 65, 90, 95,
- 122, 9, 13, 32, 33, 37, 39, 44,
- 59, 61, 76, 108, 126, 42, 46, 48,
- 57, 65, 90, 95, 122, 9, 13, 32,
- 33, 37, 39, 44, 59, 61, 126, 42,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 13, 32, 44, 59, 61, 10, 9, 32,
- 9, 32, 44, 59, 61, 9, 13, 32,
- 33, 34, 37, 39, 91, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 10, 9, 32, 9, 13, 32, 33, 34,
- 37, 39, 91, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 13,
- 32, 44, 59, 48, 57, 9, 13, 32,
- 44, 59, 48, 57, 9, 13, 32, 44,
- 59, 45, 48, 57, 65, 90, 97, 122,
- 9, 13, 32, 44, 58, 59, 48, 57,
- 65, 90, 97, 122, 48, 57, 65, 90,
- 97, 122, 45, 46, 48, 57, 65, 90,
- 97, 122, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 48, 57, 65, 90, 97, 122, 9, 13,
- 32, 44, 45, 46, 58, 59, 48, 57,
- 65, 90, 97, 122, 9, 13, 32, 44,
- 45, 46, 58, 59, 48, 57, 65, 90,
- 97, 122, 9, 13, 32, 44, 45, 46,
- 58, 59, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 58, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 58, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 48, 57, 46, 48, 57, 48, 57,
- 46, 48, 57, 48, 57, 93, 48, 57,
- 93, 48, 57, 93, 9, 13, 32, 44,
- 58, 59, 46, 48, 57, 46, 46, 48,
- 57, 46, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 48,
- 57, 46, 48, 57, 46, 48, 57, 46,
- 58, 65, 97, 0
-};
-
-static const char _tsip_machine_parser_header_Via_single_lengths[] = {
- 0, 2, 5, 3, 7, 1, 2, 6,
- 8, 4, 1, 2, 3, 7, 1, 2,
- 6, 8, 4, 1, 2, 3, 7, 1,
- 2, 6, 7, 4, 1, 2, 3, 2,
- 1, 2, 0, 8, 6, 1, 2, 5,
- 3, 1, 2, 2, 5, 5, 1, 2,
- 4, 17, 1, 2, 16, 10, 6, 1,
- 2, 5, 9, 1, 2, 9, 1, 2,
- 3, 4, 1, 2, 5, 1, 0, 9,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 3, 3, 2, 2, 2,
- 2, 2, 0, 3, 3, 3, 0, 1,
- 1, 1, 1, 12, 12, 12, 12, 12,
- 10, 6, 1, 2, 5, 9, 1, 2,
- 9, 9, 12, 12, 12, 10, 6, 1,
- 2, 5, 9, 1, 2, 9, 9, 12,
- 12, 12, 12, 10, 6, 1, 2, 5,
- 9, 1, 2, 9, 11, 10, 11, 9,
- 7, 1, 5, 2, 1, 0, 9, 11,
- 9, 11, 9, 7, 7, 7, 11, 11,
- 11, 11, 11, 11, 1, 2, 2, 2,
- 2, 1, 3, 0, 1, 0, 1, 0,
- 1, 1, 1, 5, 1, 1, 1, 1,
- 3, 3, 2, 2, 2, 2, 2, 0,
- 3, 3, 3, 0, 1, 1, 1, 1,
- 14, 12, 12, 12, 12, 12, 12, 10,
- 6, 1, 2, 5, 10, 1, 2, 10,
- 7, 0, 1, 0, 1, 0, 5, 5,
- 5, 1, 1, 1, 1, 7, 7, 6,
- 1, 6, 6, 6, 6, 6, 0, 7,
- 7, 7, 0, 1, 1, 1, 6, 6,
- 6, 1, 12, 12, 12, 6, 6, 1,
- 2, 5, 3, 1, 2, 2, 5, 12,
- 12, 10, 6, 1, 2, 5, 9, 1,
- 2, 9, 5, 5, 5, 1, 6, 0,
- 2, 0, 2, 0, 8, 8, 8, 2,
- 2, 2, 2, 2, 2, 1, 2, 2,
- 2, 2, 1, 3, 0, 1, 0, 1,
- 0, 1, 1, 1, 6, 1, 1, 1,
- 1, 3, 3, 2, 2, 2, 2, 2,
- 0, 3, 3, 3, 0, 1, 1, 1,
- 1, 2, 0
-};
-
-static const char _tsip_machine_parser_header_Via_range_lengths[] = {
- 0, 0, 0, 0, 5, 0, 0, 5,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 5, 3, 0, 0, 3, 3,
- 3, 3, 3, 3, 0, 0, 0, 0,
- 1, 0, 0, 1, 1, 0, 0, 0,
- 0, 5, 0, 0, 5, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 0, 0,
- 0, 2, 0, 0, 0, 0, 3, 4,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 1,
- 0, 1, 0, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 3, 3, 1, 1,
- 1, 0, 0, 4, 4, 4, 4, 4,
- 4, 0, 0, 0, 0, 5, 0, 0,
- 5, 4, 4, 4, 4, 4, 0, 0,
- 0, 0, 5, 0, 0, 5, 4, 4,
- 4, 4, 4, 4, 0, 0, 0, 0,
- 6, 0, 0, 6, 5, 5, 5, 5,
- 3, 3, 3, 3, 3, 3, 5, 5,
- 5, 5, 5, 3, 3, 3, 5, 5,
- 5, 5, 5, 5, 3, 3, 3, 3,
- 0, 3, 3, 1, 1, 1, 1, 1,
- 1, 1, 0, 0, 1, 0, 1, 0,
- 3, 3, 3, 3, 3, 3, 0, 3,
- 3, 3, 3, 1, 1, 1, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 8, 0, 0, 8,
- 3, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 0, 1, 0, 3, 3, 0,
- 3, 3, 3, 3, 3, 0, 3, 3,
- 3, 3, 1, 1, 1, 0, 3, 3,
- 3, 0, 4, 4, 4, 0, 0, 0,
- 0, 0, 1, 0, 0, 1, 1, 4,
- 4, 4, 0, 0, 0, 0, 5, 0,
- 0, 5, 1, 1, 0, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 0, 3, 3, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 1, 0, 1,
- 0, 3, 3, 3, 3, 3, 3, 0,
- 3, 3, 3, 3, 1, 1, 1, 0,
- 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Via_index_offsets[] = {
- 0, 0, 3, 9, 13, 26, 28, 31,
- 43, 56, 61, 63, 66, 70, 83, 85,
- 88, 100, 113, 118, 120, 123, 127, 140,
- 142, 145, 157, 170, 178, 180, 183, 190,
- 196, 201, 207, 211, 223, 230, 232, 235,
- 241, 246, 248, 251, 255, 262, 268, 270,
- 273, 278, 301, 303, 306, 328, 343, 350,
- 352, 355, 361, 376, 378, 381, 396, 398,
- 401, 405, 412, 414, 417, 423, 425, 429,
- 443, 448, 454, 460, 466, 469, 474, 481,
- 483, 486, 488, 491, 493, 496, 499, 501,
- 504, 506, 509, 511, 518, 525, 531, 537,
- 543, 549, 552, 556, 563, 570, 577, 579,
- 582, 585, 587, 589, 606, 623, 640, 657,
- 674, 689, 696, 698, 701, 707, 722, 724,
- 727, 742, 756, 773, 790, 807, 822, 829,
- 831, 834, 840, 855, 857, 860, 875, 889,
- 906, 923, 940, 957, 972, 979, 981, 984,
- 990, 1006, 1008, 1011, 1027, 1044, 1060, 1077,
- 1092, 1103, 1108, 1117, 1123, 1128, 1132, 1147,
- 1164, 1179, 1196, 1211, 1222, 1233, 1244, 1261,
- 1278, 1295, 1312, 1329, 1346, 1351, 1357, 1363,
- 1369, 1372, 1377, 1384, 1386, 1389, 1391, 1394,
- 1396, 1399, 1402, 1404, 1410, 1413, 1415, 1418,
- 1420, 1427, 1434, 1440, 1446, 1452, 1458, 1461,
- 1465, 1472, 1479, 1486, 1488, 1491, 1494, 1496,
- 1498, 1517, 1534, 1551, 1568, 1585, 1602, 1619,
- 1634, 1641, 1643, 1646, 1652, 1671, 1673, 1676,
- 1695, 1706, 1708, 1711, 1713, 1716, 1718, 1725,
- 1732, 1738, 1741, 1743, 1746, 1748, 1759, 1770,
- 1777, 1782, 1792, 1802, 1812, 1822, 1829, 1833,
- 1844, 1855, 1866, 1868, 1871, 1874, 1876, 1886,
- 1896, 1906, 1908, 1925, 1942, 1959, 1966, 1973,
- 1975, 1978, 1984, 1989, 1991, 1994, 1998, 2005,
- 2022, 2039, 2054, 2061, 2063, 2066, 2072, 2087,
- 2089, 2092, 2107, 2114, 2121, 2127, 2132, 2142,
- 2146, 2152, 2156, 2162, 2166, 2178, 2190, 2202,
- 2208, 2214, 2220, 2226, 2232, 2238, 2243, 2249,
- 2255, 2261, 2264, 2269, 2276, 2278, 2281, 2283,
- 2286, 2288, 2291, 2294, 2296, 2303, 2306, 2308,
- 2311, 2313, 2320, 2327, 2333, 2339, 2345, 2351,
- 2354, 2358, 2365, 2372, 2379, 2381, 2384, 2387,
- 2389, 2391, 2394
-};
-
-static const short _tsip_machine_parser_header_Via_indicies[] = {
- 0, 0, 1, 2, 2, 3, 4, 4,
- 1, 2, 2, 3, 1, 3, 5, 3,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 1, 7, 1, 8, 8, 1, 8,
- 8, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 1, 9, 10, 9, 11, 11,
- 11, 12, 11, 11, 11, 11, 11, 1,
- 13, 14, 13, 15, 1, 16, 1, 17,
- 17, 1, 17, 17, 15, 1, 15, 18,
- 15, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 1, 20, 1, 21, 21, 1,
- 21, 21, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 1, 22, 23, 22, 24,
- 24, 24, 25, 24, 24, 24, 24, 24,
- 1, 26, 27, 26, 28, 1, 29, 1,
- 30, 30, 1, 30, 30, 28, 1, 28,
- 31, 28, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 1, 33, 1, 34, 34,
- 1, 34, 34, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 1, 35, 36, 35,
- 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 1, 38, 39, 38, 42, 40, 41,
- 41, 1, 43, 1, 44, 44, 1, 44,
- 44, 42, 40, 41, 41, 1, 45, 46,
- 47, 48, 48, 1, 45, 48, 48, 48,
- 1, 45, 49, 48, 48, 48, 1, 48,
- 50, 50, 1, 51, 52, 51, 53, 54,
- 55, 56, 57, 50, 50, 50, 1, 58,
- 59, 58, 3, 60, 61, 1, 62, 1,
- 63, 63, 1, 63, 63, 3, 60, 61,
- 1, 60, 64, 60, 65, 1, 66, 1,
- 67, 67, 1, 67, 67, 65, 1, 68,
- 69, 68, 70, 72, 71, 1, 73, 74,
- 73, 3, 61, 1, 75, 1, 76, 76,
- 1, 76, 76, 3, 61, 1, 61, 77,
- 61, 78, 78, 78, 79, 80, 81, 82,
- 83, 79, 80, 81, 82, 83, 78, 78,
- 78, 78, 78, 78, 1, 84, 1, 85,
- 85, 1, 85, 85, 78, 78, 78, 79,
- 80, 81, 82, 83, 79, 80, 81, 82,
- 83, 78, 78, 78, 78, 78, 78, 1,
- 86, 87, 86, 88, 88, 88, 89, 90,
- 91, 88, 88, 88, 88, 88, 1, 92,
- 93, 92, 3, 61, 91, 1, 94, 1,
- 95, 95, 1, 95, 95, 3, 61, 91,
- 1, 91, 96, 91, 97, 98, 97, 97,
- 99, 97, 97, 97, 97, 97, 97, 1,
- 100, 1, 101, 101, 1, 101, 102, 101,
- 97, 98, 97, 97, 99, 97, 97, 97,
- 97, 97, 97, 1, 103, 1, 104, 104,
- 1, 104, 104, 98, 1, 105, 106, 107,
- 1, 1, 1, 98, 108, 1, 98, 98,
- 1, 109, 87, 109, 89, 90, 1, 110,
- 1, 98, 98, 98, 1, 109, 87, 109,
- 97, 97, 97, 89, 90, 97, 97, 97,
- 97, 97, 1, 112, 111, 111, 111, 1,
- 114, 106, 113, 113, 113, 1, 114, 106,
- 115, 115, 115, 1, 114, 106, 116, 116,
- 116, 1, 114, 106, 1, 118, 117, 111,
- 111, 1, 119, 114, 106, 120, 113, 113,
- 1, 121, 1, 122, 123, 1, 124, 1,
- 125, 126, 1, 127, 1, 106, 128, 1,
- 106, 129, 1, 106, 1, 125, 130, 1,
- 125, 1, 122, 131, 1, 122, 1, 119,
- 114, 106, 132, 115, 115, 1, 119, 114,
- 106, 116, 116, 116, 1, 134, 106, 133,
- 133, 133, 1, 136, 106, 135, 135, 135,
- 1, 136, 106, 137, 137, 137, 1, 136,
- 106, 138, 138, 138, 1, 136, 106, 1,
- 139, 133, 133, 1, 119, 136, 106, 140,
- 135, 135, 1, 119, 136, 106, 141, 137,
- 137, 1, 119, 136, 106, 138, 138, 138,
- 1, 142, 1, 119, 143, 1, 119, 144,
- 1, 119, 1, 118, 1, 86, 87, 86,
- 88, 88, 88, 89, 90, 91, 145, 145,
- 88, 88, 88, 88, 88, 1, 86, 87,
- 86, 88, 88, 88, 89, 90, 91, 146,
- 146, 88, 88, 88, 88, 88, 1, 86,
- 87, 86, 88, 88, 88, 89, 90, 91,
- 147, 147, 88, 88, 88, 88, 88, 1,
- 86, 87, 86, 88, 88, 88, 89, 90,
- 91, 148, 148, 88, 88, 88, 88, 88,
- 1, 86, 87, 86, 88, 88, 88, 89,
- 90, 91, 149, 149, 88, 88, 88, 88,
- 88, 1, 150, 87, 150, 88, 88, 88,
- 89, 90, 151, 88, 88, 88, 88, 88,
- 1, 152, 153, 152, 3, 61, 151, 1,
- 154, 1, 155, 155, 1, 155, 155, 3,
- 61, 151, 1, 151, 156, 151, 157, 98,
- 157, 157, 99, 157, 157, 157, 157, 157,
- 157, 1, 158, 1, 159, 159, 1, 159,
- 102, 159, 157, 98, 157, 157, 99, 157,
- 157, 157, 157, 157, 157, 1, 160, 161,
- 160, 162, 162, 162, 163, 164, 162, 162,
- 162, 162, 162, 1, 86, 87, 86, 88,
- 88, 88, 89, 90, 91, 165, 165, 88,
- 88, 88, 88, 88, 1, 86, 87, 86,
- 88, 88, 88, 89, 90, 91, 166, 166,
- 88, 88, 88, 88, 88, 1, 86, 87,
- 86, 88, 88, 88, 89, 90, 91, 167,
- 167, 88, 88, 88, 88, 88, 1, 168,
- 87, 168, 88, 88, 88, 89, 90, 169,
- 88, 88, 88, 88, 88, 1, 170, 171,
- 170, 3, 61, 169, 1, 172, 1, 173,
- 173, 1, 173, 173, 3, 61, 169, 1,
- 169, 174, 169, 175, 98, 175, 175, 99,
- 175, 175, 175, 175, 175, 175, 1, 176,
- 1, 177, 177, 1, 177, 102, 177, 175,
- 98, 175, 175, 99, 175, 175, 175, 175,
- 175, 175, 1, 178, 179, 178, 180, 180,
- 180, 181, 182, 180, 180, 180, 180, 180,
- 1, 86, 87, 86, 88, 88, 88, 89,
- 90, 91, 183, 183, 88, 88, 88, 88,
- 88, 1, 86, 87, 86, 88, 88, 88,
- 89, 90, 91, 184, 184, 88, 88, 88,
- 88, 88, 1, 86, 87, 86, 88, 88,
- 88, 89, 90, 91, 185, 185, 88, 88,
- 88, 88, 88, 1, 86, 87, 86, 88,
- 88, 88, 89, 90, 91, 186, 186, 88,
- 88, 88, 88, 88, 1, 187, 87, 187,
- 88, 88, 88, 89, 90, 188, 88, 88,
- 88, 88, 88, 1, 189, 190, 189, 3,
- 61, 188, 1, 191, 1, 192, 192, 1,
- 192, 192, 3, 61, 188, 1, 188, 193,
- 188, 97, 98, 97, 97, 196, 97, 97,
- 97, 194, 195, 97, 195, 1, 197, 1,
- 198, 198, 1, 198, 102, 198, 97, 98,
- 97, 97, 196, 97, 97, 97, 194, 195,
- 97, 195, 1, 109, 87, 109, 97, 97,
- 97, 89, 199, 200, 90, 97, 97, 201,
- 202, 97, 202, 1, 109, 87, 109, 97,
- 97, 97, 89, 199, 90, 97, 97, 202,
- 202, 97, 202, 1, 109, 87, 109, 97,
- 97, 97, 89, 199, 203, 90, 97, 97,
- 202, 202, 97, 202, 1, 109, 87, 109,
- 97, 97, 97, 89, 90, 97, 97, 202,
- 204, 97, 204, 1, 205, 206, 205, 207,
- 208, 209, 210, 204, 204, 204, 1, 208,
- 204, 204, 204, 1, 205, 206, 205, 207,
- 210, 211, 204, 204, 1, 212, 213, 211,
- 211, 211, 1, 212, 211, 211, 211, 1,
- 211, 204, 204, 1, 109, 87, 109, 97,
- 97, 97, 89, 90, 97, 97, 214, 204,
- 97, 204, 1, 109, 87, 109, 97, 97,
- 97, 89, 199, 215, 90, 97, 97, 216,
- 202, 97, 202, 1, 109, 87, 109, 97,
- 97, 97, 89, 90, 97, 97, 217, 204,
- 97, 204, 1, 109, 87, 109, 97, 97,
- 97, 89, 199, 218, 90, 97, 97, 219,
- 202, 97, 202, 1, 109, 87, 109, 97,
- 97, 97, 89, 90, 97, 97, 220, 204,
- 97, 204, 1, 205, 206, 205, 207, 212,
- 213, 210, 221, 211, 211, 1, 205, 206,
- 205, 207, 212, 213, 210, 222, 211, 211,
- 1, 205, 206, 205, 207, 212, 213, 210,
- 211, 211, 211, 1, 109, 87, 109, 97,
- 97, 97, 89, 199, 218, 90, 97, 97,
- 223, 202, 97, 202, 1, 109, 87, 109,
- 97, 97, 97, 89, 199, 218, 90, 97,
- 97, 202, 202, 97, 202, 1, 109, 87,
- 109, 97, 97, 97, 89, 199, 215, 90,
- 97, 97, 224, 202, 97, 202, 1, 109,
- 87, 109, 97, 97, 97, 89, 199, 215,
- 90, 97, 97, 202, 202, 97, 202, 1,
- 109, 87, 109, 97, 97, 97, 89, 199,
- 200, 90, 97, 97, 225, 202, 97, 202,
- 1, 109, 87, 109, 97, 97, 97, 89,
- 199, 200, 90, 97, 97, 202, 202, 97,
- 202, 1, 227, 226, 226, 226, 1, 229,
- 230, 228, 228, 228, 1, 229, 230, 231,
- 231, 231, 1, 229, 230, 232, 232, 232,
- 1, 229, 230, 1, 234, 233, 226, 226,
- 1, 235, 229, 230, 236, 228, 228, 1,
- 237, 1, 238, 239, 1, 240, 1, 241,
- 242, 1, 243, 1, 230, 244, 1, 230,
- 245, 1, 230, 1, 205, 206, 205, 207,
- 210, 1, 241, 246, 1, 241, 1, 238,
- 247, 1, 238, 1, 235, 229, 230, 248,
- 231, 231, 1, 235, 229, 230, 232, 232,
- 232, 1, 250, 230, 249, 249, 249, 1,
- 252, 230, 251, 251, 251, 1, 252, 230,
- 253, 253, 253, 1, 252, 230, 254, 254,
- 254, 1, 252, 230, 1, 255, 249, 249,
- 1, 235, 252, 230, 256, 251, 251, 1,
- 235, 252, 230, 257, 253, 253, 1, 235,
- 252, 230, 254, 254, 254, 1, 258, 1,
- 235, 259, 1, 235, 260, 1, 235, 1,
- 234, 1, 86, 87, 86, 88, 88, 88,
- 89, 90, 91, 261, 262, 261, 262, 88,
- 88, 88, 88, 88, 1, 86, 87, 86,
- 88, 88, 88, 89, 90, 91, 263, 263,
- 88, 88, 88, 88, 88, 1, 86, 87,
- 86, 88, 88, 88, 89, 90, 91, 264,
- 264, 88, 88, 88, 88, 88, 1, 86,
- 87, 86, 88, 88, 88, 89, 90, 91,
- 265, 265, 88, 88, 88, 88, 88, 1,
- 86, 87, 86, 88, 88, 88, 89, 90,
- 91, 266, 266, 88, 88, 88, 88, 88,
- 1, 86, 87, 86, 88, 88, 88, 89,
- 90, 91, 267, 267, 88, 88, 88, 88,
- 88, 1, 86, 87, 86, 88, 88, 88,
- 89, 90, 91, 268, 268, 88, 88, 88,
- 88, 88, 1, 269, 87, 269, 88, 88,
- 88, 89, 90, 270, 88, 88, 88, 88,
- 88, 1, 271, 272, 271, 3, 61, 270,
- 1, 273, 1, 274, 274, 1, 274, 274,
- 3, 61, 270, 1, 270, 275, 270, 97,
- 98, 97, 97, 277, 99, 97, 97, 97,
- 276, 278, 97, 97, 278, 97, 1, 279,
- 1, 280, 280, 1, 280, 102, 280, 97,
- 98, 97, 97, 277, 99, 97, 97, 97,
- 276, 278, 97, 97, 278, 97, 1, 281,
- 282, 281, 283, 284, 286, 287, 285, 288,
- 288, 1, 289, 1, 290, 291, 1, 292,
- 1, 293, 294, 1, 295, 1, 281, 282,
- 281, 283, 287, 296, 1, 281, 282, 281,
- 283, 287, 297, 1, 281, 282, 281, 283,
- 287, 1, 293, 298, 1, 293, 1, 290,
- 299, 1, 290, 1, 281, 282, 281, 283,
- 284, 286, 287, 300, 301, 301, 1, 281,
- 282, 281, 283, 284, 286, 287, 302, 302,
- 302, 1, 281, 282, 281, 283, 286, 287,
- 1, 304, 303, 305, 305, 1, 281, 282,
- 281, 283, 307, 287, 306, 306, 306, 1,
- 281, 282, 281, 283, 309, 287, 308, 308,
- 308, 1, 281, 282, 281, 283, 309, 287,
- 310, 310, 310, 1, 281, 282, 281, 283,
- 309, 287, 311, 311, 311, 1, 281, 282,
- 281, 283, 309, 287, 1, 312, 306, 306,
- 1, 281, 282, 281, 283, 284, 309, 287,
- 313, 308, 308, 1, 281, 282, 281, 283,
- 284, 309, 287, 314, 310, 310, 1, 281,
- 282, 281, 283, 284, 309, 287, 311, 311,
- 311, 1, 315, 1, 284, 316, 1, 284,
- 317, 1, 284, 1, 281, 282, 281, 283,
- 286, 287, 288, 288, 288, 1, 281, 282,
- 281, 283, 286, 287, 301, 301, 301, 1,
- 281, 282, 281, 283, 286, 287, 302, 302,
- 302, 1, 304, 1, 86, 87, 86, 88,
- 88, 88, 89, 90, 91, 318, 318, 88,
- 88, 88, 88, 88, 1, 86, 87, 86,
- 88, 88, 88, 89, 90, 91, 319, 319,
- 88, 88, 88, 88, 88, 1, 86, 87,
- 86, 88, 88, 88, 89, 90, 91, 320,
- 320, 88, 88, 88, 88, 88, 1, 321,
- 322, 321, 323, 324, 325, 1, 326, 327,
- 326, 3, 61, 325, 1, 328, 1, 329,
- 329, 1, 329, 329, 3, 61, 325, 1,
- 325, 330, 325, 331, 1, 332, 1, 333,
- 333, 1, 333, 333, 331, 1, 334, 335,
- 334, 336, 338, 337, 1, 86, 87, 86,
- 88, 88, 88, 89, 90, 91, 339, 339,
- 88, 88, 88, 88, 88, 1, 86, 87,
- 86, 88, 88, 88, 89, 90, 91, 340,
- 340, 88, 88, 88, 88, 88, 1, 341,
- 87, 341, 88, 88, 88, 89, 90, 342,
- 88, 88, 88, 88, 88, 1, 343, 344,
- 343, 3, 61, 342, 1, 345, 1, 346,
- 346, 1, 346, 346, 3, 61, 342, 1,
- 342, 347, 342, 97, 98, 97, 97, 99,
- 97, 97, 97, 348, 97, 97, 1, 349,
- 1, 350, 350, 1, 350, 102, 350, 97,
- 98, 97, 97, 99, 97, 97, 97, 348,
- 97, 97, 1, 351, 352, 351, 353, 355,
- 354, 1, 351, 352, 351, 353, 355, 356,
- 1, 351, 352, 351, 353, 355, 1, 54,
- 50, 50, 50, 1, 51, 52, 51, 53,
- 56, 57, 48, 50, 50, 1, 357, 50,
- 50, 1, 45, 358, 359, 48, 48, 1,
- 360, 50, 50, 1, 45, 361, 362, 48,
- 48, 1, 363, 50, 50, 1, 51, 52,
- 51, 53, 45, 49, 56, 57, 364, 48,
- 48, 1, 51, 52, 51, 53, 45, 49,
- 56, 57, 365, 48, 48, 1, 51, 52,
- 51, 53, 45, 49, 56, 57, 48, 48,
- 48, 1, 45, 361, 366, 48, 48, 1,
- 45, 361, 48, 48, 48, 1, 45, 358,
- 367, 48, 48, 1, 45, 358, 48, 48,
- 48, 1, 45, 46, 368, 48, 48, 1,
- 45, 46, 48, 48, 48, 1, 370, 369,
- 369, 369, 1, 372, 373, 371, 371, 371,
- 1, 372, 373, 374, 374, 374, 1, 372,
- 373, 375, 375, 375, 1, 372, 373, 1,
- 377, 376, 369, 369, 1, 378, 372, 373,
- 379, 371, 371, 1, 380, 1, 381, 382,
- 1, 383, 1, 384, 385, 1, 386, 1,
- 373, 387, 1, 373, 388, 1, 373, 1,
- 51, 52, 51, 53, 56, 57, 1, 384,
- 389, 1, 384, 1, 381, 390, 1, 381,
- 1, 378, 372, 373, 391, 374, 374, 1,
- 378, 372, 373, 375, 375, 375, 1, 393,
- 373, 392, 392, 392, 1, 395, 373, 394,
- 394, 394, 1, 395, 373, 396, 396, 396,
- 1, 395, 373, 397, 397, 397, 1, 395,
- 373, 1, 398, 392, 392, 1, 378, 395,
- 373, 399, 394, 394, 1, 378, 395, 373,
- 400, 396, 396, 1, 378, 395, 373, 397,
- 397, 397, 1, 401, 1, 378, 402, 1,
- 378, 403, 1, 378, 1, 377, 1, 2,
- 2, 1, 1, 0
-};
-
-static const short _tsip_machine_parser_header_Via_trans_targs[] = {
- 2, 0, 3, 4, 337, 5, 8, 6,
- 7, 9, 10, 8, 13, 9, 10, 13,
- 11, 12, 14, 17, 15, 16, 18, 19,
- 17, 22, 18, 19, 22, 20, 21, 23,
- 26, 24, 25, 27, 28, 26, 27, 28,
- 31, 35, 301, 29, 30, 32, 287, 299,
- 33, 34, 35, 36, 69, 4, 285, 286,
- 40, 49, 36, 37, 40, 49, 38, 39,
- 41, 44, 42, 43, 45, 69, 4, 44,
- 49, 45, 46, 47, 48, 50, 53, 107,
- 122, 135, 208, 271, 51, 52, 54, 69,
- 53, 4, 49, 58, 54, 55, 56, 57,
- 59, 71, 65, 72, 60, 61, 62, 63,
- 64, 66, 68, 70, 67, 45, 338, 73,
- 106, 74, 77, 75, 76, 78, 93, 79,
- 91, 80, 81, 89, 82, 83, 87, 84,
- 85, 86, 88, 90, 92, 94, 102, 95,
- 98, 96, 97, 99, 100, 101, 103, 104,
- 105, 108, 109, 110, 111, 112, 113, 117,
- 113, 114, 115, 116, 118, 121, 119, 120,
- 45, 69, 121, 4, 49, 123, 124, 125,
- 126, 130, 126, 127, 128, 129, 131, 134,
- 132, 133, 45, 69, 134, 4, 49, 136,
- 137, 138, 139, 140, 144, 140, 141, 142,
- 143, 145, 148, 152, 172, 146, 147, 149,
- 158, 170, 150, 151, 152, 45, 69, 4,
- 153, 154, 49, 155, 156, 157, 159, 160,
- 168, 161, 162, 166, 163, 164, 165, 167,
- 169, 171, 173, 207, 174, 177, 187, 175,
- 176, 178, 194, 179, 192, 180, 181, 190,
- 182, 183, 188, 184, 185, 186, 189, 191,
- 193, 195, 203, 196, 199, 197, 198, 200,
- 201, 202, 204, 205, 206, 209, 258, 210,
- 211, 212, 213, 214, 215, 216, 220, 216,
- 217, 218, 219, 221, 224, 257, 254, 222,
- 223, 45, 69, 4, 225, 237, 240, 49,
- 255, 226, 227, 235, 228, 229, 233, 230,
- 231, 232, 234, 236, 238, 256, 239, 224,
- 241, 254, 242, 250, 243, 246, 244, 245,
- 247, 248, 249, 251, 252, 253, 259, 260,
- 261, 262, 69, 4, 49, 266, 262, 263,
- 264, 265, 267, 270, 268, 269, 45, 69,
- 4, 270, 49, 272, 273, 274, 278, 274,
- 275, 276, 277, 279, 282, 280, 281, 45,
- 69, 4, 283, 49, 284, 288, 289, 297,
- 290, 291, 295, 292, 293, 294, 296, 298,
- 300, 302, 336, 303, 306, 316, 304, 305,
- 307, 323, 308, 321, 309, 310, 319, 311,
- 312, 317, 313, 314, 315, 318, 320, 322,
- 324, 332, 325, 328, 326, 327, 329, 330,
- 331, 333, 334, 335
-};
-
-static const char _tsip_machine_parser_header_Via_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 29, 0,
- 0, 3, 3, 0, 3, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 5, 5,
- 0, 5, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 11, 11, 0, 0, 0,
- 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 32, 32, 32, 0, 0,
- 7, 7, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 35, 35, 35, 0,
- 9, 0, 0, 0, 0, 0, 1, 1,
- 1, 1, 1, 1, 0, 0, 59, 59,
- 0, 59, 25, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 59, 27, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 59, 0,
- 0, 0, 0, 0, 0, 1, 0, 0,
- 47, 47, 0, 47, 19, 0, 0, 0,
- 59, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 50, 50, 0, 50, 21, 0,
- 0, 0, 0, 59, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 41, 41, 41,
- 0, 0, 15, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 59, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 0,
- 0, 44, 44, 44, 0, 0, 0, 17,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 56, 56, 56, 23, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 62, 62,
- 62, 0, 53, 0, 0, 59, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 38,
- 38, 38, 0, 13, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Via_start = 1;
-static const int tsip_machine_parser_header_Via_first_final = 338;
-static const int tsip_machine_parser_header_Via_error = 0;
-
-static const int tsip_machine_parser_header_Via_en_main = 1;
-
-
-/* #line 253 "./ragel/tsip_parser_header_Via.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Via_first_final);
- (void)(tsip_machine_parser_header_Via_error);
- (void)(tsip_machine_parser_header_Via_en_main);
-
-/* #line 1122 "./src/headers/tsip_header_Via.c" */
- {
- cs = tsip_machine_parser_header_Via_start;
- }
-
-/* #line 258 "./ragel/tsip_parser_header_Via.rl" */
-
-/* #line 1129 "./src/headers/tsip_header_Via.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Vias_L_t *hdr_vias = tsk_list_create();
+ tsip_header_Via_t *curr_via = tsk_null;
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 156 "./src/headers/tsip_header_Via.c" */
+ static const char _tsip_machine_parser_header_Via_actions[] = {
+ 0, 1, 0, 1, 2, 1, 3, 1,
+ 4, 1, 5, 1, 6, 1, 7, 1,
+ 8, 1, 9, 1, 10, 1, 11, 1,
+ 13, 1, 14, 1, 16, 2, 1, 0,
+ 2, 4, 15, 2, 5, 15, 2, 7,
+ 15, 2, 8, 15, 2, 9, 15, 2,
+ 10, 15, 2, 11, 15, 2, 12, 13,
+ 2, 13, 15, 2, 14, 15, 3, 12,
+ 13, 15
+ };
+
+ static const short _tsip_machine_parser_header_Via_key_offsets[] = {
+ 0, 0, 2, 7, 10, 27, 28, 30,
+ 46, 62, 66, 67, 69, 72, 89, 90,
+ 92, 108, 124, 128, 129, 131, 134, 151,
+ 152, 154, 170, 187, 197, 198, 200, 209,
+ 217, 224, 232, 238, 252, 258, 259, 261,
+ 266, 271, 272, 274, 278, 285, 290, 291,
+ 293, 297, 324, 325, 327, 353, 371, 377,
+ 378, 380, 385, 404, 405, 407, 426, 427,
+ 429, 432, 440, 441, 443, 448, 449, 455,
+ 472, 479, 487, 495, 503, 505, 512, 521,
+ 523, 526, 528, 531, 533, 536, 539, 540,
+ 543, 544, 547, 548, 557, 566, 574, 582,
+ 590, 598, 600, 606, 615, 624, 633, 635,
+ 638, 641, 642, 643, 663, 683, 703, 723,
+ 743, 761, 767, 768, 770, 775, 794, 795,
+ 797, 816, 833, 853, 873, 893, 911, 917,
+ 918, 920, 925, 944, 945, 947, 966, 983,
+ 1003, 1023, 1043, 1063, 1081, 1087, 1088, 1090,
+ 1095, 1116, 1117, 1119, 1140, 1161, 1181, 1202,
+ 1221, 1234, 1241, 1252, 1260, 1267, 1273, 1292,
+ 1313, 1332, 1353, 1372, 1385, 1398, 1411, 1432,
+ 1453, 1474, 1495, 1516, 1537, 1544, 1552, 1560,
+ 1568, 1570, 1577, 1586, 1588, 1591, 1593, 1596,
+ 1598, 1601, 1604, 1605, 1610, 1613, 1614, 1617,
+ 1618, 1627, 1636, 1644, 1652, 1660, 1668, 1670,
+ 1676, 1685, 1694, 1703, 1705, 1708, 1711, 1712,
+ 1713, 1735, 1755, 1775, 1795, 1815, 1835, 1855,
+ 1873, 1879, 1880, 1882, 1887, 1913, 1914, 1916,
+ 1942, 1955, 1957, 1960, 1962, 1965, 1967, 1974,
+ 1981, 1986, 1989, 1990, 1993, 1994, 2007, 2020,
+ 2026, 2033, 2045, 2057, 2069, 2081, 2087, 2093,
+ 2106, 2119, 2132, 2134, 2137, 2140, 2141, 2153,
+ 2165, 2177, 2178, 2198, 2218, 2238, 2244, 2250,
+ 2251, 2253, 2258, 2263, 2264, 2266, 2270, 2277,
+ 2297, 2317, 2335, 2341, 2342, 2344, 2349, 2368,
+ 2369, 2371, 2390, 2397, 2404, 2409, 2416, 2428,
+ 2434, 2442, 2448, 2456, 2462, 2476, 2490, 2504,
+ 2512, 2520, 2528, 2536, 2544, 2552, 2559, 2567,
+ 2575, 2583, 2585, 2592, 2601, 2603, 2606, 2608,
+ 2611, 2613, 2616, 2619, 2620, 2626, 2629, 2630,
+ 2633, 2634, 2643, 2652, 2660, 2668, 2676, 2684,
+ 2686, 2692, 2701, 2710, 2719, 2721, 2724, 2727,
+ 2728, 2729, 2731
+ };
+
+ static const char _tsip_machine_parser_header_Via_trans_keys[] = {
+ 86, 118, 9, 32, 58, 73, 105, 9,
+ 32, 58, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 10, 9, 32, 9, 32,
+ 33, 37, 39, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 47, 126, 42, 43,
+ 45, 57, 65, 90, 95, 122, 9, 13,
+ 32, 47, 10, 9, 32, 9, 32, 47,
+ 9, 13, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 10, 9, 32, 9, 32, 33, 37,
+ 39, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 13, 32, 33,
+ 37, 39, 47, 126, 42, 43, 45, 57,
+ 65, 90, 95, 122, 9, 13, 32, 47,
+ 10, 9, 32, 9, 32, 47, 9, 13,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 10,
+ 9, 32, 9, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 91, 48,
+ 57, 65, 90, 97, 122, 10, 9, 32,
+ 9, 32, 91, 48, 57, 65, 90, 97,
+ 122, 45, 46, 48, 57, 65, 90, 97,
+ 122, 45, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 48, 57, 65, 90, 97, 122, 9, 13,
+ 32, 44, 45, 46, 58, 59, 48, 57,
+ 65, 90, 97, 122, 9, 13, 32, 44,
+ 58, 59, 10, 9, 32, 9, 32, 44,
+ 58, 59, 9, 13, 32, 48, 57, 10,
+ 9, 32, 9, 32, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 10, 9, 32, 9, 32, 44,
+ 59, 9, 13, 32, 33, 37, 39, 66,
+ 67, 77, 82, 84, 98, 99, 109, 114,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 32, 33, 37, 39, 66, 67, 77, 82,
+ 84, 98, 99, 109, 114, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 44, 59,
+ 61, 10, 9, 32, 9, 32, 44, 59,
+ 61, 9, 13, 32, 33, 34, 37, 39,
+ 91, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 44, 59,
+ 10, 0, 9, 11, 12, 14, 127, 9,
+ 13, 32, 33, 37, 39, 44, 59, 126,
+ 42, 46, 48, 57, 65, 90, 95, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 46, 48, 57, 46,
+ 46, 48, 57, 46, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 46, 48,
+ 57, 46, 58, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 82, 114, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 65, 97, 126, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 78, 110, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 67, 99, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 72, 104, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 59, 61, 10,
+ 9, 32, 9, 32, 44, 59, 61, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 10, 9, 32, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 13, 32, 33, 37, 39, 44, 59,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 79, 111, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 77, 109,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 80, 112, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 59, 61, 10, 9, 32,
+ 9, 32, 44, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 65, 97, 126, 42, 46, 48, 57, 66,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 68, 100, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 68, 100, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 82, 114, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 59, 61, 10,
+ 9, 32, 9, 32, 44, 59, 61, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 10, 9, 32, 9,
+ 13, 32, 33, 34, 37, 39, 91, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 45, 46, 59, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 45, 59, 126, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 37, 39, 44, 45, 46, 59, 126,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 126, 42, 46, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 44, 45, 46, 59, 48, 57, 65, 90,
+ 97, 122, 45, 48, 57, 65, 90, 97,
+ 122, 9, 13, 32, 44, 59, 48, 57,
+ 65, 90, 97, 122, 45, 46, 48, 57,
+ 65, 90, 97, 122, 45, 48, 57, 65,
+ 90, 97, 122, 48, 57, 65, 90, 97,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 126, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 45, 46, 59, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 126, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 45, 46, 59, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 126, 42, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 44,
+ 45, 46, 59, 48, 57, 65, 90, 97,
+ 122, 9, 13, 32, 44, 45, 46, 59,
+ 48, 57, 65, 90, 97, 122, 9, 13,
+ 32, 44, 45, 46, 59, 48, 57, 65,
+ 90, 97, 122, 9, 13, 32, 33, 37,
+ 39, 44, 45, 46, 59, 126, 42, 43,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 9, 13, 32, 33, 37, 39, 44, 45,
+ 46, 59, 126, 42, 43, 48, 57, 65,
+ 90, 95, 96, 97, 122, 9, 13, 32,
+ 33, 37, 39, 44, 45, 46, 59, 126,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 9, 13, 32, 33, 37, 39,
+ 44, 45, 46, 59, 126, 42, 43, 48,
+ 57, 65, 90, 95, 96, 97, 122, 9,
+ 13, 32, 33, 37, 39, 44, 45, 46,
+ 59, 126, 42, 43, 48, 57, 65, 90,
+ 95, 96, 97, 122, 9, 13, 32, 33,
+ 37, 39, 44, 45, 46, 59, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 58, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 58, 93, 58, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 48,
+ 57, 46, 48, 57, 48, 57, 93, 48,
+ 57, 93, 48, 57, 93, 9, 13, 32,
+ 44, 59, 46, 48, 57, 46, 46, 48,
+ 57, 46, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 46, 48, 57, 46,
+ 58, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 69, 80, 101, 112, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 67, 99, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 69, 101, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 73, 105, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 86, 118, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 69, 101, 126, 42, 46, 48, 57, 65,
+ 90, 95, 122, 9, 13, 32, 33, 37,
+ 39, 44, 59, 61, 68, 100, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 33, 37, 39, 44, 59, 61,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 44, 59, 61, 10,
+ 9, 32, 9, 32, 44, 59, 61, 9,
+ 13, 32, 33, 34, 37, 39, 58, 91,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 70, 71, 90, 95, 96, 97, 102, 103,
+ 122, 10, 9, 32, 9, 13, 32, 33,
+ 34, 37, 39, 58, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 70, 71, 90,
+ 95, 96, 97, 102, 103, 122, 9, 13,
+ 32, 44, 46, 58, 59, 48, 57, 65,
+ 70, 97, 102, 48, 57, 46, 48, 57,
+ 48, 57, 46, 48, 57, 48, 57, 9,
+ 13, 32, 44, 59, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 46, 48, 57, 46, 46, 48,
+ 57, 46, 9, 13, 32, 44, 46, 58,
+ 59, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 44, 46, 58, 59, 48, 57,
+ 65, 70, 97, 102, 9, 13, 32, 44,
+ 58, 59, 58, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 44, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 44, 58, 59, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 44, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 44, 58, 59, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 44, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 44, 46, 58, 59, 48, 57, 65, 70,
+ 97, 102, 9, 13, 32, 44, 46, 58,
+ 59, 48, 57, 65, 70, 97, 102, 9,
+ 13, 32, 44, 46, 58, 59, 48, 57,
+ 65, 70, 97, 102, 48, 57, 46, 48,
+ 57, 46, 48, 57, 46, 9, 13, 32,
+ 44, 58, 59, 48, 57, 65, 70, 97,
+ 102, 9, 13, 32, 44, 58, 59, 48,
+ 57, 65, 70, 97, 102, 9, 13, 32,
+ 44, 58, 59, 48, 57, 65, 70, 97,
+ 102, 58, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 79, 111, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 33, 37, 39, 44, 59, 61, 82,
+ 114, 126, 42, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 33, 37, 39,
+ 44, 59, 61, 84, 116, 126, 42, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 61, 9, 13, 32, 44,
+ 59, 61, 10, 9, 32, 9, 32, 44,
+ 59, 61, 9, 13, 32, 48, 57, 10,
+ 9, 32, 9, 32, 48, 57, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 84, 116,
+ 126, 42, 46, 48, 57, 65, 90, 95,
+ 122, 9, 13, 32, 33, 37, 39, 44,
+ 59, 61, 76, 108, 126, 42, 46, 48,
+ 57, 65, 90, 95, 122, 9, 13, 32,
+ 33, 37, 39, 44, 59, 61, 126, 42,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 13, 32, 44, 59, 61, 10, 9, 32,
+ 9, 32, 44, 59, 61, 9, 13, 32,
+ 33, 34, 37, 39, 91, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 10, 9, 32, 9, 13, 32, 33, 34,
+ 37, 39, 91, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 13,
+ 32, 44, 59, 48, 57, 9, 13, 32,
+ 44, 59, 48, 57, 9, 13, 32, 44,
+ 59, 45, 48, 57, 65, 90, 97, 122,
+ 9, 13, 32, 44, 58, 59, 48, 57,
+ 65, 90, 97, 122, 48, 57, 65, 90,
+ 97, 122, 45, 46, 48, 57, 65, 90,
+ 97, 122, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 48, 57, 65, 90, 97, 122, 9, 13,
+ 32, 44, 45, 46, 58, 59, 48, 57,
+ 65, 90, 97, 122, 9, 13, 32, 44,
+ 45, 46, 58, 59, 48, 57, 65, 90,
+ 97, 122, 9, 13, 32, 44, 45, 46,
+ 58, 59, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 58, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 48, 57, 46, 48, 57, 48, 57,
+ 46, 48, 57, 48, 57, 93, 48, 57,
+ 93, 48, 57, 93, 9, 13, 32, 44,
+ 58, 59, 46, 48, 57, 46, 46, 48,
+ 57, 46, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 48,
+ 57, 46, 48, 57, 46, 48, 57, 46,
+ 58, 65, 97, 0
+ };
+
+ static const char _tsip_machine_parser_header_Via_single_lengths[] = {
+ 0, 2, 5, 3, 7, 1, 2, 6,
+ 8, 4, 1, 2, 3, 7, 1, 2,
+ 6, 8, 4, 1, 2, 3, 7, 1,
+ 2, 6, 7, 4, 1, 2, 3, 2,
+ 1, 2, 0, 8, 6, 1, 2, 5,
+ 3, 1, 2, 2, 5, 5, 1, 2,
+ 4, 17, 1, 2, 16, 10, 6, 1,
+ 2, 5, 9, 1, 2, 9, 1, 2,
+ 3, 4, 1, 2, 5, 1, 0, 9,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 2, 2, 2,
+ 2, 2, 0, 3, 3, 3, 0, 1,
+ 1, 1, 1, 12, 12, 12, 12, 12,
+ 10, 6, 1, 2, 5, 9, 1, 2,
+ 9, 9, 12, 12, 12, 10, 6, 1,
+ 2, 5, 9, 1, 2, 9, 9, 12,
+ 12, 12, 12, 10, 6, 1, 2, 5,
+ 9, 1, 2, 9, 11, 10, 11, 9,
+ 7, 1, 5, 2, 1, 0, 9, 11,
+ 9, 11, 9, 7, 7, 7, 11, 11,
+ 11, 11, 11, 11, 1, 2, 2, 2,
+ 2, 1, 3, 0, 1, 0, 1, 0,
+ 1, 1, 1, 5, 1, 1, 1, 1,
+ 3, 3, 2, 2, 2, 2, 2, 0,
+ 3, 3, 3, 0, 1, 1, 1, 1,
+ 14, 12, 12, 12, 12, 12, 12, 10,
+ 6, 1, 2, 5, 10, 1, 2, 10,
+ 7, 0, 1, 0, 1, 0, 5, 5,
+ 5, 1, 1, 1, 1, 7, 7, 6,
+ 1, 6, 6, 6, 6, 6, 0, 7,
+ 7, 7, 0, 1, 1, 1, 6, 6,
+ 6, 1, 12, 12, 12, 6, 6, 1,
+ 2, 5, 3, 1, 2, 2, 5, 12,
+ 12, 10, 6, 1, 2, 5, 9, 1,
+ 2, 9, 5, 5, 5, 1, 6, 0,
+ 2, 0, 2, 0, 8, 8, 8, 2,
+ 2, 2, 2, 2, 2, 1, 2, 2,
+ 2, 2, 1, 3, 0, 1, 0, 1,
+ 0, 1, 1, 1, 6, 1, 1, 1,
+ 1, 3, 3, 2, 2, 2, 2, 2,
+ 0, 3, 3, 3, 0, 1, 1, 1,
+ 1, 2, 0
+ };
+
+ static const char _tsip_machine_parser_header_Via_range_lengths[] = {
+ 0, 0, 0, 0, 5, 0, 0, 5,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 5, 3, 0, 0, 3, 3,
+ 3, 3, 3, 3, 0, 0, 0, 0,
+ 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 5, 0, 0, 5, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 0, 0,
+ 0, 2, 0, 0, 0, 0, 3, 4,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 1, 0, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 1, 1,
+ 1, 0, 0, 4, 4, 4, 4, 4,
+ 4, 0, 0, 0, 0, 5, 0, 0,
+ 5, 4, 4, 4, 4, 4, 0, 0,
+ 0, 0, 5, 0, 0, 5, 4, 4,
+ 4, 4, 4, 4, 0, 0, 0, 0,
+ 6, 0, 0, 6, 5, 5, 5, 5,
+ 3, 3, 3, 3, 3, 3, 5, 5,
+ 5, 5, 5, 3, 3, 3, 5, 5,
+ 5, 5, 5, 5, 3, 3, 3, 3,
+ 0, 3, 3, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 1, 0, 1, 0,
+ 3, 3, 3, 3, 3, 3, 0, 3,
+ 3, 3, 3, 1, 1, 1, 0, 0,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 0, 0, 0, 0, 8, 0, 0, 8,
+ 3, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 0, 1, 0, 3, 3, 0,
+ 3, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 1, 1, 1, 0, 3, 3,
+ 3, 0, 4, 4, 4, 0, 0, 0,
+ 0, 0, 1, 0, 0, 1, 1, 4,
+ 4, 4, 0, 0, 0, 0, 5, 0,
+ 0, 5, 1, 1, 0, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 0, 3, 3, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 1, 0, 1,
+ 0, 3, 3, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 1, 1, 1, 0,
+ 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Via_index_offsets[] = {
+ 0, 0, 3, 9, 13, 26, 28, 31,
+ 43, 56, 61, 63, 66, 70, 83, 85,
+ 88, 100, 113, 118, 120, 123, 127, 140,
+ 142, 145, 157, 170, 178, 180, 183, 190,
+ 196, 201, 207, 211, 223, 230, 232, 235,
+ 241, 246, 248, 251, 255, 262, 268, 270,
+ 273, 278, 301, 303, 306, 328, 343, 350,
+ 352, 355, 361, 376, 378, 381, 396, 398,
+ 401, 405, 412, 414, 417, 423, 425, 429,
+ 443, 448, 454, 460, 466, 469, 474, 481,
+ 483, 486, 488, 491, 493, 496, 499, 501,
+ 504, 506, 509, 511, 518, 525, 531, 537,
+ 543, 549, 552, 556, 563, 570, 577, 579,
+ 582, 585, 587, 589, 606, 623, 640, 657,
+ 674, 689, 696, 698, 701, 707, 722, 724,
+ 727, 742, 756, 773, 790, 807, 822, 829,
+ 831, 834, 840, 855, 857, 860, 875, 889,
+ 906, 923, 940, 957, 972, 979, 981, 984,
+ 990, 1006, 1008, 1011, 1027, 1044, 1060, 1077,
+ 1092, 1103, 1108, 1117, 1123, 1128, 1132, 1147,
+ 1164, 1179, 1196, 1211, 1222, 1233, 1244, 1261,
+ 1278, 1295, 1312, 1329, 1346, 1351, 1357, 1363,
+ 1369, 1372, 1377, 1384, 1386, 1389, 1391, 1394,
+ 1396, 1399, 1402, 1404, 1410, 1413, 1415, 1418,
+ 1420, 1427, 1434, 1440, 1446, 1452, 1458, 1461,
+ 1465, 1472, 1479, 1486, 1488, 1491, 1494, 1496,
+ 1498, 1517, 1534, 1551, 1568, 1585, 1602, 1619,
+ 1634, 1641, 1643, 1646, 1652, 1671, 1673, 1676,
+ 1695, 1706, 1708, 1711, 1713, 1716, 1718, 1725,
+ 1732, 1738, 1741, 1743, 1746, 1748, 1759, 1770,
+ 1777, 1782, 1792, 1802, 1812, 1822, 1829, 1833,
+ 1844, 1855, 1866, 1868, 1871, 1874, 1876, 1886,
+ 1896, 1906, 1908, 1925, 1942, 1959, 1966, 1973,
+ 1975, 1978, 1984, 1989, 1991, 1994, 1998, 2005,
+ 2022, 2039, 2054, 2061, 2063, 2066, 2072, 2087,
+ 2089, 2092, 2107, 2114, 2121, 2127, 2132, 2142,
+ 2146, 2152, 2156, 2162, 2166, 2178, 2190, 2202,
+ 2208, 2214, 2220, 2226, 2232, 2238, 2243, 2249,
+ 2255, 2261, 2264, 2269, 2276, 2278, 2281, 2283,
+ 2286, 2288, 2291, 2294, 2296, 2303, 2306, 2308,
+ 2311, 2313, 2320, 2327, 2333, 2339, 2345, 2351,
+ 2354, 2358, 2365, 2372, 2379, 2381, 2384, 2387,
+ 2389, 2391, 2394
+ };
+
+ static const short _tsip_machine_parser_header_Via_indicies[] = {
+ 0, 0, 1, 2, 2, 3, 4, 4,
+ 1, 2, 2, 3, 1, 3, 5, 3,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 1, 7, 1, 8, 8, 1, 8,
+ 8, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 1, 9, 10, 9, 11, 11,
+ 11, 12, 11, 11, 11, 11, 11, 1,
+ 13, 14, 13, 15, 1, 16, 1, 17,
+ 17, 1, 17, 17, 15, 1, 15, 18,
+ 15, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 1, 20, 1, 21, 21, 1,
+ 21, 21, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 1, 22, 23, 22, 24,
+ 24, 24, 25, 24, 24, 24, 24, 24,
+ 1, 26, 27, 26, 28, 1, 29, 1,
+ 30, 30, 1, 30, 30, 28, 1, 28,
+ 31, 28, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 1, 33, 1, 34, 34,
+ 1, 34, 34, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 1, 35, 36, 35,
+ 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 1, 38, 39, 38, 42, 40, 41,
+ 41, 1, 43, 1, 44, 44, 1, 44,
+ 44, 42, 40, 41, 41, 1, 45, 46,
+ 47, 48, 48, 1, 45, 48, 48, 48,
+ 1, 45, 49, 48, 48, 48, 1, 48,
+ 50, 50, 1, 51, 52, 51, 53, 54,
+ 55, 56, 57, 50, 50, 50, 1, 58,
+ 59, 58, 3, 60, 61, 1, 62, 1,
+ 63, 63, 1, 63, 63, 3, 60, 61,
+ 1, 60, 64, 60, 65, 1, 66, 1,
+ 67, 67, 1, 67, 67, 65, 1, 68,
+ 69, 68, 70, 72, 71, 1, 73, 74,
+ 73, 3, 61, 1, 75, 1, 76, 76,
+ 1, 76, 76, 3, 61, 1, 61, 77,
+ 61, 78, 78, 78, 79, 80, 81, 82,
+ 83, 79, 80, 81, 82, 83, 78, 78,
+ 78, 78, 78, 78, 1, 84, 1, 85,
+ 85, 1, 85, 85, 78, 78, 78, 79,
+ 80, 81, 82, 83, 79, 80, 81, 82,
+ 83, 78, 78, 78, 78, 78, 78, 1,
+ 86, 87, 86, 88, 88, 88, 89, 90,
+ 91, 88, 88, 88, 88, 88, 1, 92,
+ 93, 92, 3, 61, 91, 1, 94, 1,
+ 95, 95, 1, 95, 95, 3, 61, 91,
+ 1, 91, 96, 91, 97, 98, 97, 97,
+ 99, 97, 97, 97, 97, 97, 97, 1,
+ 100, 1, 101, 101, 1, 101, 102, 101,
+ 97, 98, 97, 97, 99, 97, 97, 97,
+ 97, 97, 97, 1, 103, 1, 104, 104,
+ 1, 104, 104, 98, 1, 105, 106, 107,
+ 1, 1, 1, 98, 108, 1, 98, 98,
+ 1, 109, 87, 109, 89, 90, 1, 110,
+ 1, 98, 98, 98, 1, 109, 87, 109,
+ 97, 97, 97, 89, 90, 97, 97, 97,
+ 97, 97, 1, 112, 111, 111, 111, 1,
+ 114, 106, 113, 113, 113, 1, 114, 106,
+ 115, 115, 115, 1, 114, 106, 116, 116,
+ 116, 1, 114, 106, 1, 118, 117, 111,
+ 111, 1, 119, 114, 106, 120, 113, 113,
+ 1, 121, 1, 122, 123, 1, 124, 1,
+ 125, 126, 1, 127, 1, 106, 128, 1,
+ 106, 129, 1, 106, 1, 125, 130, 1,
+ 125, 1, 122, 131, 1, 122, 1, 119,
+ 114, 106, 132, 115, 115, 1, 119, 114,
+ 106, 116, 116, 116, 1, 134, 106, 133,
+ 133, 133, 1, 136, 106, 135, 135, 135,
+ 1, 136, 106, 137, 137, 137, 1, 136,
+ 106, 138, 138, 138, 1, 136, 106, 1,
+ 139, 133, 133, 1, 119, 136, 106, 140,
+ 135, 135, 1, 119, 136, 106, 141, 137,
+ 137, 1, 119, 136, 106, 138, 138, 138,
+ 1, 142, 1, 119, 143, 1, 119, 144,
+ 1, 119, 1, 118, 1, 86, 87, 86,
+ 88, 88, 88, 89, 90, 91, 145, 145,
+ 88, 88, 88, 88, 88, 1, 86, 87,
+ 86, 88, 88, 88, 89, 90, 91, 146,
+ 146, 88, 88, 88, 88, 88, 1, 86,
+ 87, 86, 88, 88, 88, 89, 90, 91,
+ 147, 147, 88, 88, 88, 88, 88, 1,
+ 86, 87, 86, 88, 88, 88, 89, 90,
+ 91, 148, 148, 88, 88, 88, 88, 88,
+ 1, 86, 87, 86, 88, 88, 88, 89,
+ 90, 91, 149, 149, 88, 88, 88, 88,
+ 88, 1, 150, 87, 150, 88, 88, 88,
+ 89, 90, 151, 88, 88, 88, 88, 88,
+ 1, 152, 153, 152, 3, 61, 151, 1,
+ 154, 1, 155, 155, 1, 155, 155, 3,
+ 61, 151, 1, 151, 156, 151, 157, 98,
+ 157, 157, 99, 157, 157, 157, 157, 157,
+ 157, 1, 158, 1, 159, 159, 1, 159,
+ 102, 159, 157, 98, 157, 157, 99, 157,
+ 157, 157, 157, 157, 157, 1, 160, 161,
+ 160, 162, 162, 162, 163, 164, 162, 162,
+ 162, 162, 162, 1, 86, 87, 86, 88,
+ 88, 88, 89, 90, 91, 165, 165, 88,
+ 88, 88, 88, 88, 1, 86, 87, 86,
+ 88, 88, 88, 89, 90, 91, 166, 166,
+ 88, 88, 88, 88, 88, 1, 86, 87,
+ 86, 88, 88, 88, 89, 90, 91, 167,
+ 167, 88, 88, 88, 88, 88, 1, 168,
+ 87, 168, 88, 88, 88, 89, 90, 169,
+ 88, 88, 88, 88, 88, 1, 170, 171,
+ 170, 3, 61, 169, 1, 172, 1, 173,
+ 173, 1, 173, 173, 3, 61, 169, 1,
+ 169, 174, 169, 175, 98, 175, 175, 99,
+ 175, 175, 175, 175, 175, 175, 1, 176,
+ 1, 177, 177, 1, 177, 102, 177, 175,
+ 98, 175, 175, 99, 175, 175, 175, 175,
+ 175, 175, 1, 178, 179, 178, 180, 180,
+ 180, 181, 182, 180, 180, 180, 180, 180,
+ 1, 86, 87, 86, 88, 88, 88, 89,
+ 90, 91, 183, 183, 88, 88, 88, 88,
+ 88, 1, 86, 87, 86, 88, 88, 88,
+ 89, 90, 91, 184, 184, 88, 88, 88,
+ 88, 88, 1, 86, 87, 86, 88, 88,
+ 88, 89, 90, 91, 185, 185, 88, 88,
+ 88, 88, 88, 1, 86, 87, 86, 88,
+ 88, 88, 89, 90, 91, 186, 186, 88,
+ 88, 88, 88, 88, 1, 187, 87, 187,
+ 88, 88, 88, 89, 90, 188, 88, 88,
+ 88, 88, 88, 1, 189, 190, 189, 3,
+ 61, 188, 1, 191, 1, 192, 192, 1,
+ 192, 192, 3, 61, 188, 1, 188, 193,
+ 188, 97, 98, 97, 97, 196, 97, 97,
+ 97, 194, 195, 97, 195, 1, 197, 1,
+ 198, 198, 1, 198, 102, 198, 97, 98,
+ 97, 97, 196, 97, 97, 97, 194, 195,
+ 97, 195, 1, 109, 87, 109, 97, 97,
+ 97, 89, 199, 200, 90, 97, 97, 201,
+ 202, 97, 202, 1, 109, 87, 109, 97,
+ 97, 97, 89, 199, 90, 97, 97, 202,
+ 202, 97, 202, 1, 109, 87, 109, 97,
+ 97, 97, 89, 199, 203, 90, 97, 97,
+ 202, 202, 97, 202, 1, 109, 87, 109,
+ 97, 97, 97, 89, 90, 97, 97, 202,
+ 204, 97, 204, 1, 205, 206, 205, 207,
+ 208, 209, 210, 204, 204, 204, 1, 208,
+ 204, 204, 204, 1, 205, 206, 205, 207,
+ 210, 211, 204, 204, 1, 212, 213, 211,
+ 211, 211, 1, 212, 211, 211, 211, 1,
+ 211, 204, 204, 1, 109, 87, 109, 97,
+ 97, 97, 89, 90, 97, 97, 214, 204,
+ 97, 204, 1, 109, 87, 109, 97, 97,
+ 97, 89, 199, 215, 90, 97, 97, 216,
+ 202, 97, 202, 1, 109, 87, 109, 97,
+ 97, 97, 89, 90, 97, 97, 217, 204,
+ 97, 204, 1, 109, 87, 109, 97, 97,
+ 97, 89, 199, 218, 90, 97, 97, 219,
+ 202, 97, 202, 1, 109, 87, 109, 97,
+ 97, 97, 89, 90, 97, 97, 220, 204,
+ 97, 204, 1, 205, 206, 205, 207, 212,
+ 213, 210, 221, 211, 211, 1, 205, 206,
+ 205, 207, 212, 213, 210, 222, 211, 211,
+ 1, 205, 206, 205, 207, 212, 213, 210,
+ 211, 211, 211, 1, 109, 87, 109, 97,
+ 97, 97, 89, 199, 218, 90, 97, 97,
+ 223, 202, 97, 202, 1, 109, 87, 109,
+ 97, 97, 97, 89, 199, 218, 90, 97,
+ 97, 202, 202, 97, 202, 1, 109, 87,
+ 109, 97, 97, 97, 89, 199, 215, 90,
+ 97, 97, 224, 202, 97, 202, 1, 109,
+ 87, 109, 97, 97, 97, 89, 199, 215,
+ 90, 97, 97, 202, 202, 97, 202, 1,
+ 109, 87, 109, 97, 97, 97, 89, 199,
+ 200, 90, 97, 97, 225, 202, 97, 202,
+ 1, 109, 87, 109, 97, 97, 97, 89,
+ 199, 200, 90, 97, 97, 202, 202, 97,
+ 202, 1, 227, 226, 226, 226, 1, 229,
+ 230, 228, 228, 228, 1, 229, 230, 231,
+ 231, 231, 1, 229, 230, 232, 232, 232,
+ 1, 229, 230, 1, 234, 233, 226, 226,
+ 1, 235, 229, 230, 236, 228, 228, 1,
+ 237, 1, 238, 239, 1, 240, 1, 241,
+ 242, 1, 243, 1, 230, 244, 1, 230,
+ 245, 1, 230, 1, 205, 206, 205, 207,
+ 210, 1, 241, 246, 1, 241, 1, 238,
+ 247, 1, 238, 1, 235, 229, 230, 248,
+ 231, 231, 1, 235, 229, 230, 232, 232,
+ 232, 1, 250, 230, 249, 249, 249, 1,
+ 252, 230, 251, 251, 251, 1, 252, 230,
+ 253, 253, 253, 1, 252, 230, 254, 254,
+ 254, 1, 252, 230, 1, 255, 249, 249,
+ 1, 235, 252, 230, 256, 251, 251, 1,
+ 235, 252, 230, 257, 253, 253, 1, 235,
+ 252, 230, 254, 254, 254, 1, 258, 1,
+ 235, 259, 1, 235, 260, 1, 235, 1,
+ 234, 1, 86, 87, 86, 88, 88, 88,
+ 89, 90, 91, 261, 262, 261, 262, 88,
+ 88, 88, 88, 88, 1, 86, 87, 86,
+ 88, 88, 88, 89, 90, 91, 263, 263,
+ 88, 88, 88, 88, 88, 1, 86, 87,
+ 86, 88, 88, 88, 89, 90, 91, 264,
+ 264, 88, 88, 88, 88, 88, 1, 86,
+ 87, 86, 88, 88, 88, 89, 90, 91,
+ 265, 265, 88, 88, 88, 88, 88, 1,
+ 86, 87, 86, 88, 88, 88, 89, 90,
+ 91, 266, 266, 88, 88, 88, 88, 88,
+ 1, 86, 87, 86, 88, 88, 88, 89,
+ 90, 91, 267, 267, 88, 88, 88, 88,
+ 88, 1, 86, 87, 86, 88, 88, 88,
+ 89, 90, 91, 268, 268, 88, 88, 88,
+ 88, 88, 1, 269, 87, 269, 88, 88,
+ 88, 89, 90, 270, 88, 88, 88, 88,
+ 88, 1, 271, 272, 271, 3, 61, 270,
+ 1, 273, 1, 274, 274, 1, 274, 274,
+ 3, 61, 270, 1, 270, 275, 270, 97,
+ 98, 97, 97, 277, 99, 97, 97, 97,
+ 276, 278, 97, 97, 278, 97, 1, 279,
+ 1, 280, 280, 1, 280, 102, 280, 97,
+ 98, 97, 97, 277, 99, 97, 97, 97,
+ 276, 278, 97, 97, 278, 97, 1, 281,
+ 282, 281, 283, 284, 286, 287, 285, 288,
+ 288, 1, 289, 1, 290, 291, 1, 292,
+ 1, 293, 294, 1, 295, 1, 281, 282,
+ 281, 283, 287, 296, 1, 281, 282, 281,
+ 283, 287, 297, 1, 281, 282, 281, 283,
+ 287, 1, 293, 298, 1, 293, 1, 290,
+ 299, 1, 290, 1, 281, 282, 281, 283,
+ 284, 286, 287, 300, 301, 301, 1, 281,
+ 282, 281, 283, 284, 286, 287, 302, 302,
+ 302, 1, 281, 282, 281, 283, 286, 287,
+ 1, 304, 303, 305, 305, 1, 281, 282,
+ 281, 283, 307, 287, 306, 306, 306, 1,
+ 281, 282, 281, 283, 309, 287, 308, 308,
+ 308, 1, 281, 282, 281, 283, 309, 287,
+ 310, 310, 310, 1, 281, 282, 281, 283,
+ 309, 287, 311, 311, 311, 1, 281, 282,
+ 281, 283, 309, 287, 1, 312, 306, 306,
+ 1, 281, 282, 281, 283, 284, 309, 287,
+ 313, 308, 308, 1, 281, 282, 281, 283,
+ 284, 309, 287, 314, 310, 310, 1, 281,
+ 282, 281, 283, 284, 309, 287, 311, 311,
+ 311, 1, 315, 1, 284, 316, 1, 284,
+ 317, 1, 284, 1, 281, 282, 281, 283,
+ 286, 287, 288, 288, 288, 1, 281, 282,
+ 281, 283, 286, 287, 301, 301, 301, 1,
+ 281, 282, 281, 283, 286, 287, 302, 302,
+ 302, 1, 304, 1, 86, 87, 86, 88,
+ 88, 88, 89, 90, 91, 318, 318, 88,
+ 88, 88, 88, 88, 1, 86, 87, 86,
+ 88, 88, 88, 89, 90, 91, 319, 319,
+ 88, 88, 88, 88, 88, 1, 86, 87,
+ 86, 88, 88, 88, 89, 90, 91, 320,
+ 320, 88, 88, 88, 88, 88, 1, 321,
+ 322, 321, 323, 324, 325, 1, 326, 327,
+ 326, 3, 61, 325, 1, 328, 1, 329,
+ 329, 1, 329, 329, 3, 61, 325, 1,
+ 325, 330, 325, 331, 1, 332, 1, 333,
+ 333, 1, 333, 333, 331, 1, 334, 335,
+ 334, 336, 338, 337, 1, 86, 87, 86,
+ 88, 88, 88, 89, 90, 91, 339, 339,
+ 88, 88, 88, 88, 88, 1, 86, 87,
+ 86, 88, 88, 88, 89, 90, 91, 340,
+ 340, 88, 88, 88, 88, 88, 1, 341,
+ 87, 341, 88, 88, 88, 89, 90, 342,
+ 88, 88, 88, 88, 88, 1, 343, 344,
+ 343, 3, 61, 342, 1, 345, 1, 346,
+ 346, 1, 346, 346, 3, 61, 342, 1,
+ 342, 347, 342, 97, 98, 97, 97, 99,
+ 97, 97, 97, 348, 97, 97, 1, 349,
+ 1, 350, 350, 1, 350, 102, 350, 97,
+ 98, 97, 97, 99, 97, 97, 97, 348,
+ 97, 97, 1, 351, 352, 351, 353, 355,
+ 354, 1, 351, 352, 351, 353, 355, 356,
+ 1, 351, 352, 351, 353, 355, 1, 54,
+ 50, 50, 50, 1, 51, 52, 51, 53,
+ 56, 57, 48, 50, 50, 1, 357, 50,
+ 50, 1, 45, 358, 359, 48, 48, 1,
+ 360, 50, 50, 1, 45, 361, 362, 48,
+ 48, 1, 363, 50, 50, 1, 51, 52,
+ 51, 53, 45, 49, 56, 57, 364, 48,
+ 48, 1, 51, 52, 51, 53, 45, 49,
+ 56, 57, 365, 48, 48, 1, 51, 52,
+ 51, 53, 45, 49, 56, 57, 48, 48,
+ 48, 1, 45, 361, 366, 48, 48, 1,
+ 45, 361, 48, 48, 48, 1, 45, 358,
+ 367, 48, 48, 1, 45, 358, 48, 48,
+ 48, 1, 45, 46, 368, 48, 48, 1,
+ 45, 46, 48, 48, 48, 1, 370, 369,
+ 369, 369, 1, 372, 373, 371, 371, 371,
+ 1, 372, 373, 374, 374, 374, 1, 372,
+ 373, 375, 375, 375, 1, 372, 373, 1,
+ 377, 376, 369, 369, 1, 378, 372, 373,
+ 379, 371, 371, 1, 380, 1, 381, 382,
+ 1, 383, 1, 384, 385, 1, 386, 1,
+ 373, 387, 1, 373, 388, 1, 373, 1,
+ 51, 52, 51, 53, 56, 57, 1, 384,
+ 389, 1, 384, 1, 381, 390, 1, 381,
+ 1, 378, 372, 373, 391, 374, 374, 1,
+ 378, 372, 373, 375, 375, 375, 1, 393,
+ 373, 392, 392, 392, 1, 395, 373, 394,
+ 394, 394, 1, 395, 373, 396, 396, 396,
+ 1, 395, 373, 397, 397, 397, 1, 395,
+ 373, 1, 398, 392, 392, 1, 378, 395,
+ 373, 399, 394, 394, 1, 378, 395, 373,
+ 400, 396, 396, 1, 378, 395, 373, 397,
+ 397, 397, 1, 401, 1, 378, 402, 1,
+ 378, 403, 1, 378, 1, 377, 1, 2,
+ 2, 1, 1, 0
+ };
+
+ static const short _tsip_machine_parser_header_Via_trans_targs[] = {
+ 2, 0, 3, 4, 337, 5, 8, 6,
+ 7, 9, 10, 8, 13, 9, 10, 13,
+ 11, 12, 14, 17, 15, 16, 18, 19,
+ 17, 22, 18, 19, 22, 20, 21, 23,
+ 26, 24, 25, 27, 28, 26, 27, 28,
+ 31, 35, 301, 29, 30, 32, 287, 299,
+ 33, 34, 35, 36, 69, 4, 285, 286,
+ 40, 49, 36, 37, 40, 49, 38, 39,
+ 41, 44, 42, 43, 45, 69, 4, 44,
+ 49, 45, 46, 47, 48, 50, 53, 107,
+ 122, 135, 208, 271, 51, 52, 54, 69,
+ 53, 4, 49, 58, 54, 55, 56, 57,
+ 59, 71, 65, 72, 60, 61, 62, 63,
+ 64, 66, 68, 70, 67, 45, 338, 73,
+ 106, 74, 77, 75, 76, 78, 93, 79,
+ 91, 80, 81, 89, 82, 83, 87, 84,
+ 85, 86, 88, 90, 92, 94, 102, 95,
+ 98, 96, 97, 99, 100, 101, 103, 104,
+ 105, 108, 109, 110, 111, 112, 113, 117,
+ 113, 114, 115, 116, 118, 121, 119, 120,
+ 45, 69, 121, 4, 49, 123, 124, 125,
+ 126, 130, 126, 127, 128, 129, 131, 134,
+ 132, 133, 45, 69, 134, 4, 49, 136,
+ 137, 138, 139, 140, 144, 140, 141, 142,
+ 143, 145, 148, 152, 172, 146, 147, 149,
+ 158, 170, 150, 151, 152, 45, 69, 4,
+ 153, 154, 49, 155, 156, 157, 159, 160,
+ 168, 161, 162, 166, 163, 164, 165, 167,
+ 169, 171, 173, 207, 174, 177, 187, 175,
+ 176, 178, 194, 179, 192, 180, 181, 190,
+ 182, 183, 188, 184, 185, 186, 189, 191,
+ 193, 195, 203, 196, 199, 197, 198, 200,
+ 201, 202, 204, 205, 206, 209, 258, 210,
+ 211, 212, 213, 214, 215, 216, 220, 216,
+ 217, 218, 219, 221, 224, 257, 254, 222,
+ 223, 45, 69, 4, 225, 237, 240, 49,
+ 255, 226, 227, 235, 228, 229, 233, 230,
+ 231, 232, 234, 236, 238, 256, 239, 224,
+ 241, 254, 242, 250, 243, 246, 244, 245,
+ 247, 248, 249, 251, 252, 253, 259, 260,
+ 261, 262, 69, 4, 49, 266, 262, 263,
+ 264, 265, 267, 270, 268, 269, 45, 69,
+ 4, 270, 49, 272, 273, 274, 278, 274,
+ 275, 276, 277, 279, 282, 280, 281, 45,
+ 69, 4, 283, 49, 284, 288, 289, 297,
+ 290, 291, 295, 292, 293, 294, 296, 298,
+ 300, 302, 336, 303, 306, 316, 304, 305,
+ 307, 323, 308, 321, 309, 310, 319, 311,
+ 312, 317, 313, 314, 315, 318, 320, 322,
+ 324, 332, 325, 328, 326, 327, 329, 330,
+ 331, 333, 334, 335
+ };
+
+ static const char _tsip_machine_parser_header_Via_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 29, 0,
+ 0, 3, 3, 0, 3, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 5, 5,
+ 0, 5, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 11, 11, 0, 0, 0,
+ 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 32, 32, 32, 0, 0,
+ 7, 7, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 35, 35, 35, 0,
+ 9, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 0, 0, 59, 59,
+ 0, 59, 25, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 59, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 59, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0,
+ 47, 47, 0, 47, 19, 0, 0, 0,
+ 59, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 50, 50, 0, 50, 21, 0,
+ 0, 0, 0, 59, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 41, 41, 41,
+ 0, 0, 15, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 59, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 0,
+ 0, 44, 44, 44, 0, 0, 0, 17,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 56, 56, 56, 23, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 62, 62,
+ 62, 0, 53, 0, 0, 59, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 38,
+ 38, 38, 0, 13, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Via_start = 1;
+ static const int tsip_machine_parser_header_Via_first_final = 338;
+ static const int tsip_machine_parser_header_Via_error = 0;
+
+ static const int tsip_machine_parser_header_Via_en_main = 1;
+
+
+ /* #line 253 "./ragel/tsip_parser_header_Via.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Via_first_final);
+ (void)(tsip_machine_parser_header_Via_error);
+ (void)(tsip_machine_parser_header_Via_en_main);
+
+ /* #line 1122 "./src/headers/tsip_header_Via.c" */
+ {
+ cs = tsip_machine_parser_header_Via_start;
+ }
+
+ /* #line 258 "./ragel/tsip_parser_header_Via.rl" */
+
+ /* #line 1129 "./src/headers/tsip_header_Via.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Via_trans_keys + _tsip_machine_parser_header_Via_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Via_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Via_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Via_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Via_trans_keys + _tsip_machine_parser_header_Via_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Via_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Via_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Via_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Via_indicies[_trans];
- cs = _tsip_machine_parser_header_Via_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Via_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Via_actions + _tsip_machine_parser_header_Via_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 47 "./ragel/tsip_parser_header_Via.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 51 "./ragel/tsip_parser_header_Via.rl" */
- {
- if(!curr_via){
- curr_via = tsip_header_Via_create_null();
- }
- }
- break;
- case 2:
-/* #line 57 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->proto_name);
- }
- break;
- case 3:
-/* #line 61 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->proto_version);
- }
- break;
- case 4:
-/* #line 65 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->host);
- if(curr_via->host && *curr_via->host == '['){
- tsk_strunquote_2(&curr_via->host, '[', ']');
- }
- }
- break;
- case 5:
-/* #line 72 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_INTEGER(curr_via->port);
- }
- break;
- case 6:
-/* #line 76 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->transport);
- }
- break;
- case 7:
-/* #line 80 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_INTEGER(curr_via->ttl);
- }
- break;
- case 8:
-/* #line 84 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->maddr);
- }
- break;
- case 9:
-/* #line 88 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->received);
- }
- break;
- case 10:
-/* #line 92 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->branch);
- }
- break;
- case 11:
-/* #line 96 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_STRING(curr_via->comp);
- }
- break;
- case 12:
-/* #line 100 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_SET_INTEGER(curr_via->rport);
- }
- break;
- case 13:
-/* #line 104 "./ragel/tsip_parser_header_Via.rl" */
- {
- if(curr_via->rport <0){
- curr_via->rport = 0;
- }
- }
- break;
- case 14:
-/* #line 110 "./ragel/tsip_parser_header_Via.rl" */
- {
- TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_via));
- }
- break;
- case 15:
-/* #line 114 "./ragel/tsip_parser_header_Via.rl" */
- {
- if(curr_via){
- tsk_list_push_back_data(hdr_vias, ((void**) &curr_via));
- }
- }
- break;
- case 16:
-/* #line 120 "./ragel/tsip_parser_header_Via.rl" */
- {
-
- }
- break;
-/* #line 1314 "./src/headers/tsip_header_Via.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Via_indicies[_trans];
+ cs = _tsip_machine_parser_header_Via_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Via_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Via_actions + _tsip_machine_parser_header_Via_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 47 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 51 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ if(!curr_via) {
+ curr_via = tsip_header_Via_create_null();
+ }
+ }
+ break;
+ case 2:
+ /* #line 57 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->proto_name);
+ }
+ break;
+ case 3:
+ /* #line 61 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->proto_version);
+ }
+ break;
+ case 4:
+ /* #line 65 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->host);
+ if(curr_via->host && *curr_via->host == '[') {
+ tsk_strunquote_2(&curr_via->host, '[', ']');
+ }
+ }
+ break;
+ case 5:
+ /* #line 72 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(curr_via->port);
+ }
+ break;
+ case 6:
+ /* #line 76 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->transport);
+ }
+ break;
+ case 7:
+ /* #line 80 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(curr_via->ttl);
+ }
+ break;
+ case 8:
+ /* #line 84 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->maddr);
+ }
+ break;
+ case 9:
+ /* #line 88 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->received);
+ }
+ break;
+ case 10:
+ /* #line 92 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->branch);
+ }
+ break;
+ case 11:
+ /* #line 96 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_STRING(curr_via->comp);
+ }
+ break;
+ case 12:
+ /* #line 100 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_SET_INTEGER(curr_via->rport);
+ }
+ break;
+ case 13:
+ /* #line 104 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ if(curr_via->rport <0) {
+ curr_via->rport = 0;
+ }
+ }
+ break;
+ case 14:
+ /* #line 110 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_via));
+ }
+ break;
+ case 15:
+ /* #line 114 "./ragel/tsip_parser_header_Via.rl" */
+ {
+ if(curr_via) {
+ tsk_list_push_back_data(hdr_vias, ((void**) &curr_via));
+ }
+ }
+ break;
+ case 16:
+ /* #line 120 "./ragel/tsip_parser_header_Via.rl" */
+ {
+
+ }
+ break;
+ /* #line 1314 "./src/headers/tsip_header_Via.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 259 "./ragel/tsip_parser_header_Via.rl" */
-
- if( cs <
-/* #line 1330 "./src/headers/tsip_header_Via.c" */
-338
-/* #line 260 "./ragel/tsip_parser_header_Via.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Via' header.");
- TSK_OBJECT_SAFE_FREE(curr_via);
- TSK_OBJECT_SAFE_FREE(hdr_vias);
- }
-
- return hdr_vias;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 259 "./ragel/tsip_parser_header_Via.rl" */
+
+ if( cs <
+ /* #line 1330 "./src/headers/tsip_header_Via.c" */
+ 338
+ /* #line 260 "./ragel/tsip_parser_header_Via.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Via' header.");
+ TSK_OBJECT_SAFE_FREE(curr_via);
+ TSK_OBJECT_SAFE_FREE(hdr_vias);
+ }
+
+ return hdr_vias;
}
@@ -1354,64 +1365,71 @@ _again:
static tsk_object_t* tsip_header_Via_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Via_t *via = self;
- if(via){
- const char* proto_name = va_arg(*app, const char *);
- const char* proto_version = va_arg(*app, const char *);
- const char* transport = va_arg(*app, const char *);
- const char* host = va_arg(*app, const char *);
+ tsip_header_Via_t *via = self;
+ if(via) {
+ const char* proto_name = va_arg(*app, const char *);
+ const char* proto_version = va_arg(*app, const char *);
+ const char* transport = va_arg(*app, const char *);
+ const char* host = va_arg(*app, const char *);
#if defined(__GNUC__)
- uint16_t port = (uint16_t)va_arg(*app, unsigned);
+ uint16_t port = (uint16_t)va_arg(*app, unsigned);
#else
- uint16_t port = va_arg(*app, uint16_t);
+ uint16_t port = va_arg(*app, uint16_t);
#endif
- if(proto_name) via->proto_name = tsk_strdup(proto_name);
- if(proto_version) via->proto_version = tsk_strdup(proto_version);
- if(transport) via->transport = tsk_strdup(transport);
- if(host) via->host = tsk_strdup(host);
- via->port = port;
-
- via->rport = -1;
- via->ttl = -1;
-
- TSIP_HEADER(via)->type = tsip_htype_Via;
- TSIP_HEADER(via)->serialize = tsip_header_Via_serialize;
- TSIP_HEADER(via)->get_special_param_value = tsip_header_Via_get_special_param_value;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Via header.");
- }
- return self;
+ if(proto_name) {
+ via->proto_name = tsk_strdup(proto_name);
+ }
+ if(proto_version) {
+ via->proto_version = tsk_strdup(proto_version);
+ }
+ if(transport) {
+ via->transport = tsk_strdup(transport);
+ }
+ if(host) {
+ via->host = tsk_strdup(host);
+ }
+ via->port = port;
+
+ via->rport = -1;
+ via->ttl = -1;
+
+ TSIP_HEADER(via)->type = tsip_htype_Via;
+ TSIP_HEADER(via)->serialize = tsip_header_Via_serialize;
+ TSIP_HEADER(via)->get_special_param_value = tsip_header_Via_get_special_param_value;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Via header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Via_dtor(tsk_object_t *self)
{
- tsip_header_Via_t *via = self;
- if(via){
- TSK_FREE(via->branch);
- TSK_FREE(via->comp);
- TSK_FREE(via->host);
- TSK_FREE(via->maddr);
- TSK_FREE(via->proto_name);
- TSK_FREE(via->proto_version);
- TSK_FREE(via->received);
- TSK_FREE(via->sigcomp_id);
- TSK_FREE(via->transport);
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(via));
- }
- else{
- TSK_DEBUG_ERROR("Null Via header.");
- }
-
- return self;
+ tsip_header_Via_t *via = self;
+ if(via) {
+ TSK_FREE(via->branch);
+ TSK_FREE(via->comp);
+ TSK_FREE(via->host);
+ TSK_FREE(via->maddr);
+ TSK_FREE(via->proto_name);
+ TSK_FREE(via->proto_version);
+ TSK_FREE(via->received);
+ TSK_FREE(via->sigcomp_id);
+ TSK_FREE(via->transport);
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(via));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Via header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Via_def_s =
-{
- sizeof(tsip_header_Via_t),
- tsip_header_Via_ctor,
- tsip_header_Via_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Via_def_s = {
+ sizeof(tsip_header_Via_t),
+ tsip_header_Via_ctor,
+ tsip_header_Via_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Via_def_t = &tsip_header_Via_def_s;
diff --git a/tinySIP/src/headers/tsip_header_WWW_Authenticate.c b/tinySIP/src/headers/tsip_header_WWW_Authenticate.c
index 203486f..2451697 100755
--- a/tinySIP/src/headers/tsip_header_WWW_Authenticate.c
+++ b/tinySIP/src/headers/tsip_header_WWW_Authenticate.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,69 +41,69 @@
tsip_header_WWW_Authenticate_t* tsip_header_WWW_Authenticate_create()
{
- return tsk_object_new(tsip_header_WWW_Authenticate_def_t);
+ return tsk_object_new(tsip_header_WWW_Authenticate_def_t);
}
int tsip_header_WWW_Authenticate_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_WWW_Authenticate_t *WWW_Authenticate = (const tsip_header_WWW_Authenticate_t *)header;
- if(WWW_Authenticate && WWW_Authenticate->scheme){
- return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
- WWW_Authenticate->scheme,
- WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
-
- WWW_Authenticate->domain ? ",domain=\"" : "",
- WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
- WWW_Authenticate->domain ? "\"" : "",
-
-
- WWW_Authenticate->qop ? ",qop=\"" : "",
- WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
- WWW_Authenticate->qop ? "\"" : "",
-
-
- WWW_Authenticate->nonce ? ",nonce=\"" : "",
- WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
- WWW_Authenticate->nonce ? "\"" : "",
-
- WWW_Authenticate->opaque ? ",opaque=\"" : "",
- WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
- WWW_Authenticate->opaque ? "\"" : "",
-
- WWW_Authenticate->stale ? "TRUE" : "FALSE",
-
- WWW_Authenticate->algorithm ? ",algorithm=" : "",
- WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
- );
- }
- }
- return -1;
+ if(header) {
+ const tsip_header_WWW_Authenticate_t *WWW_Authenticate = (const tsip_header_WWW_Authenticate_t *)header;
+ if(WWW_Authenticate && WWW_Authenticate->scheme) {
+ return tsk_buffer_append_2(output, "%s realm=\"%s\"%s%s%s%s%s%s%s%s%s%s%s%s,stale=%s%s%s",
+ WWW_Authenticate->scheme,
+ WWW_Authenticate->realm ? WWW_Authenticate->realm : "",
+
+ WWW_Authenticate->domain ? ",domain=\"" : "",
+ WWW_Authenticate->domain ? WWW_Authenticate->domain : "",
+ WWW_Authenticate->domain ? "\"" : "",
+
+
+ WWW_Authenticate->qop ? ",qop=\"" : "",
+ WWW_Authenticate->qop ? WWW_Authenticate->qop : "",
+ WWW_Authenticate->qop ? "\"" : "",
+
+
+ WWW_Authenticate->nonce ? ",nonce=\"" : "",
+ WWW_Authenticate->nonce ? WWW_Authenticate->nonce : "",
+ WWW_Authenticate->nonce ? "\"" : "",
+
+ WWW_Authenticate->opaque ? ",opaque=\"" : "",
+ WWW_Authenticate->opaque ? WWW_Authenticate->opaque : "",
+ WWW_Authenticate->opaque ? "\"" : "",
+
+ WWW_Authenticate->stale ? "TRUE" : "FALSE",
+
+ WWW_Authenticate->algorithm ? ",algorithm=" : "",
+ WWW_Authenticate->algorithm ? WWW_Authenticate->algorithm : ""
+ );
+ }
+ }
+ return -1;
}
tsip_header_WWW_Authenticate_t *tsip_header_WWW_Authenticate_parse(const char *data, tsk_size_t size)
{
- tsip_header_WWW_Authenticate_t *sip_hdr = 0;
- thttp_header_WWW_Authenticate_t* http_hdr;
-
- if((http_hdr = thttp_header_WWW_Authenticate_parse(data, size))){
- sip_hdr = tsip_header_WWW_Authenticate_create();
-
- sip_hdr->scheme = tsk_strdup(http_hdr->scheme);
- sip_hdr->realm = tsk_strdup(http_hdr->realm);
- sip_hdr->domain = tsk_strdup(http_hdr->domain);
- sip_hdr->nonce = tsk_strdup(http_hdr->nonce);
- sip_hdr->opaque = tsk_strdup(http_hdr->opaque);
- sip_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
- sip_hdr->qop = tsk_strdup(http_hdr->qop);
- sip_hdr->stale = http_hdr->stale;
-
- TSIP_HEADER(sip_hdr)->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
-
- TSK_OBJECT_SAFE_FREE(http_hdr);
- }
-
- return sip_hdr;
+ tsip_header_WWW_Authenticate_t *sip_hdr = 0;
+ thttp_header_WWW_Authenticate_t* http_hdr;
+
+ if((http_hdr = thttp_header_WWW_Authenticate_parse(data, size))) {
+ sip_hdr = tsip_header_WWW_Authenticate_create();
+
+ sip_hdr->scheme = tsk_strdup(http_hdr->scheme);
+ sip_hdr->realm = tsk_strdup(http_hdr->realm);
+ sip_hdr->domain = tsk_strdup(http_hdr->domain);
+ sip_hdr->nonce = tsk_strdup(http_hdr->nonce);
+ sip_hdr->opaque = tsk_strdup(http_hdr->opaque);
+ sip_hdr->algorithm = tsk_strdup(http_hdr->algorithm);
+ sip_hdr->qop = tsk_strdup(http_hdr->qop);
+ sip_hdr->stale = http_hdr->stale;
+
+ TSIP_HEADER(sip_hdr)->params = tsk_object_ref(THTTP_HEADER(http_hdr)->params);
+
+ TSK_OBJECT_SAFE_FREE(http_hdr);
+ }
+
+ return sip_hdr;
}
@@ -118,43 +118,42 @@ tsip_header_WWW_Authenticate_t *tsip_header_WWW_Authenticate_parse(const char *d
static tsk_object_t* tsip_header_WWW_Authenticate_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- TSIP_HEADER(WWW_Authenticate)->type = tsip_htype_WWW_Authenticate;
- TSIP_HEADER(WWW_Authenticate)->serialize = tsip_header_WWW_Authenticate_serialize;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
- }
- return self;
+ tsip_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ TSIP_HEADER(WWW_Authenticate)->type = tsip_htype_WWW_Authenticate;
+ TSIP_HEADER(WWW_Authenticate)->serialize = tsip_header_WWW_Authenticate_serialize;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new WWW_Authenticate header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_WWW_Authenticate_dtor(tsk_object_t *self)
{
- tsip_header_WWW_Authenticate_t *WWW_Authenticate = self;
- if(WWW_Authenticate){
- TSK_FREE(WWW_Authenticate->scheme);
- TSK_FREE(WWW_Authenticate->realm);
- TSK_FREE(WWW_Authenticate->domain);
- TSK_FREE(WWW_Authenticate->nonce);
- TSK_FREE(WWW_Authenticate->opaque);
- TSK_FREE(WWW_Authenticate->algorithm);
- TSK_FREE(WWW_Authenticate->qop);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(WWW_Authenticate));
- }
- else{
- TSK_DEBUG_ERROR("Null WWW_Authenticate header.");
- }
-
- return self;
+ tsip_header_WWW_Authenticate_t *WWW_Authenticate = self;
+ if(WWW_Authenticate) {
+ TSK_FREE(WWW_Authenticate->scheme);
+ TSK_FREE(WWW_Authenticate->realm);
+ TSK_FREE(WWW_Authenticate->domain);
+ TSK_FREE(WWW_Authenticate->nonce);
+ TSK_FREE(WWW_Authenticate->opaque);
+ TSK_FREE(WWW_Authenticate->algorithm);
+ TSK_FREE(WWW_Authenticate->qop);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(WWW_Authenticate));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null WWW_Authenticate header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_WWW_Authenticate_def_s =
-{
- sizeof(tsip_header_WWW_Authenticate_t),
- tsip_header_WWW_Authenticate_ctor,
- tsip_header_WWW_Authenticate_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_WWW_Authenticate_def_s = {
+ sizeof(tsip_header_WWW_Authenticate_t),
+ tsip_header_WWW_Authenticate_ctor,
+ tsip_header_WWW_Authenticate_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_WWW_Authenticate_def_t = &tsip_header_WWW_Authenticate_def_s;
diff --git a/tinySIP/src/headers/tsip_header_Warning.c b/tinySIP/src/headers/tsip_header_Warning.c
index ed7b3d9..245448d 100755
--- a/tinySIP/src/headers/tsip_header_Warning.c
+++ b/tinySIP/src/headers/tsip_header_Warning.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,459 +50,470 @@
tsip_header_Warning_t* tsip_header_Warning_create()
{
- return tsk_object_new(tsip_header_Warning_def_t);
+ return tsk_object_new(tsip_header_Warning_def_t);
}
int tsip_header_Warning_serialize(const tsip_header_t* header, tsk_buffer_t* output)
{
- if(header){
- const tsip_header_Warning_t *Warning = (const tsip_header_Warning_t *)header;
- return tsk_buffer_append_2(output, "%d %s %s",
- Warning->code, Warning->agent, Warning->text); /* warn-code SP warn-agent SP warn-text */
- }
+ if(header) {
+ const tsip_header_Warning_t *Warning = (const tsip_header_Warning_t *)header;
+ return tsk_buffer_append_2(output, "%d %s %s",
+ Warning->code, Warning->agent, Warning->text); /* warn-code SP warn-agent SP warn-text */
+ }
- return -1;
+ return -1;
}
tsip_header_Warnings_L_t *tsip_header_Warning_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
- tsip_header_Warnings_L_t *hdr_warnings = tsk_list_create();
-
- const char *tag_start = tsk_null;
- tsip_header_Warning_t *curr_warning = 0;
-
-
-/* #line 80 "./src/headers/tsip_header_Warning.c" */
-static const char _tsip_machine_parser_header_Warning_actions[] = {
- 0, 1, 0, 1, 2, 1, 4, 1,
- 6, 2, 1, 0, 2, 3, 5
-};
-
-static const short _tsip_machine_parser_header_Warning_key_offsets[] = {
- 0, 0, 2, 4, 6, 8, 10, 12,
- 14, 17, 22, 23, 25, 29, 31, 33,
- 34, 51, 66, 70, 74, 75, 77, 80,
- 88, 89, 91, 95, 99, 100, 102, 105,
- 106, 112, 129, 146, 163, 180, 198, 215,
- 233, 235, 238, 255, 272, 289, 306, 323,
- 341, 359, 377, 394, 411, 428, 445, 462,
- 479, 486, 494, 502, 510, 512, 519, 528,
- 530, 533, 535, 538, 540, 543, 546, 547,
- 549, 552, 553, 556, 557, 566, 575, 583,
- 591, 599, 607, 609, 615, 624, 633, 642,
- 644, 647, 650, 651, 652
-};
-
-static const char _tsip_machine_parser_header_Warning_trans_keys[] = {
- 87, 119, 65, 97, 82, 114, 78, 110,
- 73, 105, 78, 110, 71, 103, 9, 32,
- 58, 9, 13, 32, 48, 57, 10, 9,
- 32, 9, 32, 48, 57, 48, 57, 48,
- 57, 32, 33, 37, 39, 91, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 96, 97, 122, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 13, 32, 34, 9, 13,
- 32, 34, 10, 9, 32, 9, 32, 34,
- 13, 34, 92, 127, 0, 8, 10, 31,
- 10, 9, 32, 9, 13, 32, 44, 9,
- 13, 32, 44, 10, 9, 32, 9, 32,
- 44, 10, 0, 9, 11, 12, 14, 127,
- 32, 33, 37, 39, 45, 46, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 32, 33, 37, 39, 45, 46, 126,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 32, 33, 37, 39, 45, 46,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 32, 33, 37, 39, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 96, 97, 122, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 96, 97, 122, 32, 33,
- 37, 39, 45, 46, 126, 42, 43, 48,
- 57, 65, 90, 95, 96, 97, 122, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 48, 57, 32, 48, 57, 32, 33,
- 37, 39, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 96, 97, 122, 32,
- 33, 37, 39, 45, 46, 126, 42, 43,
- 48, 57, 65, 90, 95, 96, 97, 122,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 96, 97,
- 122, 32, 33, 37, 39, 45, 46, 126,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 32, 33, 37, 39, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 96, 97, 122, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 96, 97, 122, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 96, 97, 122, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 96, 97,
- 122, 32, 33, 37, 39, 45, 46, 126,
- 42, 43, 48, 57, 65, 90, 95, 96,
- 97, 122, 32, 33, 37, 39, 45, 46,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 96, 97, 122, 32, 33, 37, 39, 45,
- 46, 126, 42, 43, 48, 57, 65, 90,
- 95, 96, 97, 122, 32, 33, 37, 39,
- 45, 46, 126, 42, 43, 48, 57, 65,
- 90, 95, 96, 97, 122, 32, 33, 37,
- 39, 45, 46, 126, 42, 43, 48, 57,
- 65, 90, 95, 96, 97, 122, 32, 33,
- 37, 39, 45, 46, 126, 42, 43, 48,
- 57, 65, 90, 95, 96, 97, 122, 58,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 48, 57, 65, 70, 97, 102, 58, 93,
- 58, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 48, 57, 46, 48, 57, 48, 57, 46,
- 48, 57, 48, 57, 93, 48, 57, 93,
- 48, 57, 93, 32, 58, 46, 48, 57,
- 46, 46, 48, 57, 46, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 46, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 58,
- 93, 48, 57, 65, 70, 97, 102, 46,
- 58, 93, 48, 57, 65, 70, 97, 102,
- 46, 58, 93, 48, 57, 65, 70, 97,
- 102, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 48, 57, 46, 48, 57, 46,
- 48, 57, 46, 58, 0
-};
-
-static const char _tsip_machine_parser_header_Warning_single_lengths[] = {
- 0, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 1, 2, 2, 0, 0, 1,
- 5, 5, 4, 4, 1, 2, 3, 4,
- 1, 2, 4, 4, 1, 2, 3, 1,
- 0, 7, 7, 7, 5, 8, 7, 6,
- 0, 1, 5, 7, 5, 7, 5, 8,
- 8, 8, 7, 7, 7, 7, 7, 7,
- 1, 2, 2, 2, 2, 1, 3, 0,
- 1, 0, 1, 0, 1, 1, 1, 2,
- 1, 1, 1, 1, 3, 3, 2, 2,
- 2, 2, 2, 0, 3, 3, 3, 0,
- 1, 1, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_header_Warning_range_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 1, 1, 0,
- 6, 5, 0, 0, 0, 0, 0, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 5, 5, 5, 6, 5, 5, 6,
- 1, 1, 6, 5, 6, 5, 6, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 3, 3, 3, 3, 0, 3, 3, 1,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 1, 0, 1, 0, 3, 3, 3, 3,
- 3, 3, 0, 3, 3, 3, 3, 1,
- 1, 1, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_header_Warning_index_offsets[] = {
- 0, 0, 3, 6, 9, 12, 15, 18,
- 21, 25, 30, 32, 35, 39, 41, 43,
- 45, 57, 68, 73, 78, 80, 83, 87,
- 94, 96, 99, 104, 109, 111, 114, 118,
- 120, 124, 137, 150, 163, 175, 189, 202,
- 215, 217, 220, 232, 245, 257, 270, 282,
- 296, 310, 324, 337, 350, 363, 376, 389,
- 402, 407, 413, 419, 425, 428, 433, 440,
- 442, 445, 447, 450, 452, 455, 458, 460,
- 463, 466, 468, 471, 473, 480, 487, 493,
- 499, 505, 511, 514, 518, 525, 532, 539,
- 541, 544, 547, 549, 551
-};
-
-static const char _tsip_machine_parser_header_Warning_indicies[] = {
- 0, 0, 1, 2, 2, 1, 3, 3,
- 1, 4, 4, 1, 5, 5, 1, 6,
- 6, 1, 7, 7, 1, 7, 7, 8,
- 1, 8, 9, 8, 10, 1, 11, 1,
- 12, 12, 1, 12, 12, 10, 1, 13,
- 1, 14, 1, 15, 1, 16, 16, 16,
- 19, 16, 16, 16, 17, 18, 16, 18,
- 1, 20, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 1, 22, 23, 22, 24,
- 1, 25, 26, 25, 27, 1, 28, 1,
- 29, 29, 1, 29, 29, 27, 1, 30,
- 31, 32, 1, 1, 1, 27, 33, 1,
- 27, 27, 1, 34, 35, 34, 36, 1,
- 37, 38, 37, 8, 1, 39, 1, 40,
- 40, 1, 40, 40, 8, 1, 41, 1,
- 27, 27, 27, 1, 20, 21, 21, 21,
- 42, 43, 21, 21, 44, 45, 21, 45,
- 1, 20, 21, 21, 21, 42, 21, 21,
- 21, 45, 45, 21, 45, 1, 20, 21,
- 21, 21, 42, 46, 21, 21, 45, 45,
- 21, 45, 1, 20, 21, 21, 21, 21,
- 21, 21, 45, 47, 21, 47, 1, 20,
- 21, 21, 21, 48, 49, 50, 21, 21,
- 47, 47, 21, 47, 1, 20, 21, 21,
- 21, 48, 21, 21, 21, 47, 47, 21,
- 47, 1, 20, 21, 21, 21, 50, 21,
- 21, 21, 45, 47, 21, 47, 1, 51,
- 1, 20, 51, 1, 20, 21, 21, 21,
- 21, 21, 21, 52, 47, 21, 47, 1,
- 20, 21, 21, 21, 42, 53, 21, 21,
- 54, 45, 21, 45, 1, 20, 21, 21,
- 21, 21, 21, 21, 55, 47, 21, 47,
- 1, 20, 21, 21, 21, 42, 56, 21,
- 21, 57, 45, 21, 45, 1, 20, 21,
- 21, 21, 21, 21, 21, 58, 47, 21,
- 47, 1, 20, 21, 21, 21, 42, 46,
- 50, 21, 21, 59, 45, 21, 45, 1,
- 20, 21, 21, 21, 42, 46, 50, 21,
- 21, 60, 45, 21, 45, 1, 20, 21,
- 21, 21, 42, 46, 50, 21, 21, 45,
- 45, 21, 45, 1, 20, 21, 21, 21,
- 42, 56, 21, 21, 61, 45, 21, 45,
- 1, 20, 21, 21, 21, 42, 56, 21,
- 21, 45, 45, 21, 45, 1, 20, 21,
- 21, 21, 42, 53, 21, 21, 62, 45,
- 21, 45, 1, 20, 21, 21, 21, 42,
- 53, 21, 21, 45, 45, 21, 45, 1,
- 20, 21, 21, 21, 42, 43, 21, 21,
- 63, 45, 21, 45, 1, 20, 21, 21,
- 21, 42, 43, 21, 21, 45, 45, 21,
- 45, 1, 65, 64, 64, 64, 1, 67,
- 68, 66, 66, 66, 1, 67, 68, 69,
- 69, 69, 1, 67, 68, 70, 70, 70,
- 1, 67, 68, 1, 72, 71, 64, 64,
- 1, 73, 67, 68, 74, 66, 66, 1,
- 75, 1, 76, 77, 1, 78, 1, 79,
- 80, 1, 81, 1, 68, 82, 1, 68,
- 83, 1, 68, 1, 20, 50, 1, 79,
- 84, 1, 79, 1, 76, 85, 1, 76,
- 1, 73, 67, 68, 86, 69, 69, 1,
- 73, 67, 68, 70, 70, 70, 1, 88,
- 68, 87, 87, 87, 1, 90, 68, 89,
- 89, 89, 1, 90, 68, 91, 91, 91,
- 1, 90, 68, 92, 92, 92, 1, 90,
- 68, 1, 93, 87, 87, 1, 73, 90,
- 68, 94, 89, 89, 1, 73, 90, 68,
- 95, 91, 91, 1, 73, 90, 68, 92,
- 92, 92, 1, 96, 1, 73, 97, 1,
- 73, 98, 1, 73, 1, 72, 1, 1,
- 0
-};
-
-static const char _tsip_machine_parser_header_Warning_trans_targs[] = {
- 2, 0, 3, 4, 5, 6, 7, 8,
- 9, 10, 13, 11, 12, 14, 15, 16,
- 17, 33, 37, 56, 18, 17, 19, 20,
- 23, 19, 20, 23, 21, 22, 24, 26,
- 32, 25, 27, 31, 9, 27, 28, 29,
- 30, 92, 34, 42, 54, 35, 36, 37,
- 38, 39, 40, 41, 43, 44, 52, 45,
- 46, 50, 47, 48, 49, 51, 53, 55,
- 57, 91, 58, 61, 71, 59, 60, 62,
- 78, 63, 76, 64, 65, 74, 66, 67,
- 72, 68, 69, 70, 73, 75, 77, 79,
- 87, 80, 83, 81, 82, 84, 85, 86,
- 88, 89, 90
-};
-
-static const char _tsip_machine_parser_header_Warning_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 9, 0, 0, 0, 0, 5,
- 1, 1, 1, 1, 3, 0, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 12, 12, 12, 0, 0, 0,
- 0, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-};
-
-static const int tsip_machine_parser_header_Warning_start = 1;
-static const int tsip_machine_parser_header_Warning_first_final = 92;
-static const int tsip_machine_parser_header_Warning_error = 0;
-
-static const int tsip_machine_parser_header_Warning_en_main = 1;
-
-
-/* #line 128 "./ragel/tsip_parser_header_Warning.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_header_Warning_first_final);
- (void)(tsip_machine_parser_header_Warning_error);
- (void)(tsip_machine_parser_header_Warning_en_main);
-
-/* #line 349 "./src/headers/tsip_header_Warning.c" */
- {
- cs = tsip_machine_parser_header_Warning_start;
- }
-
-/* #line 133 "./ragel/tsip_parser_header_Warning.rl" */
-
-/* #line 356 "./src/headers/tsip_header_Warning.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+ tsip_header_Warnings_L_t *hdr_warnings = tsk_list_create();
+
+ const char *tag_start = tsk_null;
+ tsip_header_Warning_t *curr_warning = 0;
+
+
+ /* #line 80 "./src/headers/tsip_header_Warning.c" */
+ static const char _tsip_machine_parser_header_Warning_actions[] = {
+ 0, 1, 0, 1, 2, 1, 4, 1,
+ 6, 2, 1, 0, 2, 3, 5
+ };
+
+ static const short _tsip_machine_parser_header_Warning_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12,
+ 14, 17, 22, 23, 25, 29, 31, 33,
+ 34, 51, 66, 70, 74, 75, 77, 80,
+ 88, 89, 91, 95, 99, 100, 102, 105,
+ 106, 112, 129, 146, 163, 180, 198, 215,
+ 233, 235, 238, 255, 272, 289, 306, 323,
+ 341, 359, 377, 394, 411, 428, 445, 462,
+ 479, 486, 494, 502, 510, 512, 519, 528,
+ 530, 533, 535, 538, 540, 543, 546, 547,
+ 549, 552, 553, 556, 557, 566, 575, 583,
+ 591, 599, 607, 609, 615, 624, 633, 642,
+ 644, 647, 650, 651, 652
+ };
+
+ static const char _tsip_machine_parser_header_Warning_trans_keys[] = {
+ 87, 119, 65, 97, 82, 114, 78, 110,
+ 73, 105, 78, 110, 71, 103, 9, 32,
+ 58, 9, 13, 32, 48, 57, 10, 9,
+ 32, 9, 32, 48, 57, 48, 57, 48,
+ 57, 32, 33, 37, 39, 91, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 96, 97, 122, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 13, 32, 34, 9, 13,
+ 32, 34, 10, 9, 32, 9, 32, 34,
+ 13, 34, 92, 127, 0, 8, 10, 31,
+ 10, 9, 32, 9, 13, 32, 44, 9,
+ 13, 32, 44, 10, 9, 32, 9, 32,
+ 44, 10, 0, 9, 11, 12, 14, 127,
+ 32, 33, 37, 39, 45, 46, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 32, 33, 37, 39, 45, 46, 126,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 32, 33, 37, 39, 45, 46,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 32, 33, 37, 39, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 96, 97, 122, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 96, 97, 122, 32, 33,
+ 37, 39, 45, 46, 126, 42, 43, 48,
+ 57, 65, 90, 95, 96, 97, 122, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 48, 57, 32, 48, 57, 32, 33,
+ 37, 39, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 96, 97, 122, 32,
+ 33, 37, 39, 45, 46, 126, 42, 43,
+ 48, 57, 65, 90, 95, 96, 97, 122,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 96, 97,
+ 122, 32, 33, 37, 39, 45, 46, 126,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 32, 33, 37, 39, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 96, 97, 122, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 96, 97, 122, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 96, 97, 122, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 96, 97,
+ 122, 32, 33, 37, 39, 45, 46, 126,
+ 42, 43, 48, 57, 65, 90, 95, 96,
+ 97, 122, 32, 33, 37, 39, 45, 46,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 96, 97, 122, 32, 33, 37, 39, 45,
+ 46, 126, 42, 43, 48, 57, 65, 90,
+ 95, 96, 97, 122, 32, 33, 37, 39,
+ 45, 46, 126, 42, 43, 48, 57, 65,
+ 90, 95, 96, 97, 122, 32, 33, 37,
+ 39, 45, 46, 126, 42, 43, 48, 57,
+ 65, 90, 95, 96, 97, 122, 32, 33,
+ 37, 39, 45, 46, 126, 42, 43, 48,
+ 57, 65, 90, 95, 96, 97, 122, 58,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 48, 57, 65, 70, 97, 102, 58, 93,
+ 58, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 48, 57, 46, 48, 57, 48, 57, 46,
+ 48, 57, 48, 57, 93, 48, 57, 93,
+ 48, 57, 93, 32, 58, 46, 48, 57,
+ 46, 46, 48, 57, 46, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 48, 57, 46, 48, 57, 46,
+ 48, 57, 46, 58, 0
+ };
+
+ static const char _tsip_machine_parser_header_Warning_single_lengths[] = {
+ 0, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 1, 2, 2, 0, 0, 1,
+ 5, 5, 4, 4, 1, 2, 3, 4,
+ 1, 2, 4, 4, 1, 2, 3, 1,
+ 0, 7, 7, 7, 5, 8, 7, 6,
+ 0, 1, 5, 7, 5, 7, 5, 8,
+ 8, 8, 7, 7, 7, 7, 7, 7,
+ 1, 2, 2, 2, 2, 1, 3, 0,
+ 1, 0, 1, 0, 1, 1, 1, 2,
+ 1, 1, 1, 1, 3, 3, 2, 2,
+ 2, 2, 2, 0, 3, 3, 3, 0,
+ 1, 1, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_header_Warning_range_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 1, 1, 1, 0,
+ 6, 5, 0, 0, 0, 0, 0, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 5, 5, 5, 6, 5, 5, 6,
+ 1, 1, 6, 5, 6, 5, 6, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 3, 3, 3, 3, 0, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 0, 0,
+ 1, 0, 1, 0, 3, 3, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 1,
+ 1, 1, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_header_Warning_index_offsets[] = {
+ 0, 0, 3, 6, 9, 12, 15, 18,
+ 21, 25, 30, 32, 35, 39, 41, 43,
+ 45, 57, 68, 73, 78, 80, 83, 87,
+ 94, 96, 99, 104, 109, 111, 114, 118,
+ 120, 124, 137, 150, 163, 175, 189, 202,
+ 215, 217, 220, 232, 245, 257, 270, 282,
+ 296, 310, 324, 337, 350, 363, 376, 389,
+ 402, 407, 413, 419, 425, 428, 433, 440,
+ 442, 445, 447, 450, 452, 455, 458, 460,
+ 463, 466, 468, 471, 473, 480, 487, 493,
+ 499, 505, 511, 514, 518, 525, 532, 539,
+ 541, 544, 547, 549, 551
+ };
+
+ static const char _tsip_machine_parser_header_Warning_indicies[] = {
+ 0, 0, 1, 2, 2, 1, 3, 3,
+ 1, 4, 4, 1, 5, 5, 1, 6,
+ 6, 1, 7, 7, 1, 7, 7, 8,
+ 1, 8, 9, 8, 10, 1, 11, 1,
+ 12, 12, 1, 12, 12, 10, 1, 13,
+ 1, 14, 1, 15, 1, 16, 16, 16,
+ 19, 16, 16, 16, 17, 18, 16, 18,
+ 1, 20, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 1, 22, 23, 22, 24,
+ 1, 25, 26, 25, 27, 1, 28, 1,
+ 29, 29, 1, 29, 29, 27, 1, 30,
+ 31, 32, 1, 1, 1, 27, 33, 1,
+ 27, 27, 1, 34, 35, 34, 36, 1,
+ 37, 38, 37, 8, 1, 39, 1, 40,
+ 40, 1, 40, 40, 8, 1, 41, 1,
+ 27, 27, 27, 1, 20, 21, 21, 21,
+ 42, 43, 21, 21, 44, 45, 21, 45,
+ 1, 20, 21, 21, 21, 42, 21, 21,
+ 21, 45, 45, 21, 45, 1, 20, 21,
+ 21, 21, 42, 46, 21, 21, 45, 45,
+ 21, 45, 1, 20, 21, 21, 21, 21,
+ 21, 21, 45, 47, 21, 47, 1, 20,
+ 21, 21, 21, 48, 49, 50, 21, 21,
+ 47, 47, 21, 47, 1, 20, 21, 21,
+ 21, 48, 21, 21, 21, 47, 47, 21,
+ 47, 1, 20, 21, 21, 21, 50, 21,
+ 21, 21, 45, 47, 21, 47, 1, 51,
+ 1, 20, 51, 1, 20, 21, 21, 21,
+ 21, 21, 21, 52, 47, 21, 47, 1,
+ 20, 21, 21, 21, 42, 53, 21, 21,
+ 54, 45, 21, 45, 1, 20, 21, 21,
+ 21, 21, 21, 21, 55, 47, 21, 47,
+ 1, 20, 21, 21, 21, 42, 56, 21,
+ 21, 57, 45, 21, 45, 1, 20, 21,
+ 21, 21, 21, 21, 21, 58, 47, 21,
+ 47, 1, 20, 21, 21, 21, 42, 46,
+ 50, 21, 21, 59, 45, 21, 45, 1,
+ 20, 21, 21, 21, 42, 46, 50, 21,
+ 21, 60, 45, 21, 45, 1, 20, 21,
+ 21, 21, 42, 46, 50, 21, 21, 45,
+ 45, 21, 45, 1, 20, 21, 21, 21,
+ 42, 56, 21, 21, 61, 45, 21, 45,
+ 1, 20, 21, 21, 21, 42, 56, 21,
+ 21, 45, 45, 21, 45, 1, 20, 21,
+ 21, 21, 42, 53, 21, 21, 62, 45,
+ 21, 45, 1, 20, 21, 21, 21, 42,
+ 53, 21, 21, 45, 45, 21, 45, 1,
+ 20, 21, 21, 21, 42, 43, 21, 21,
+ 63, 45, 21, 45, 1, 20, 21, 21,
+ 21, 42, 43, 21, 21, 45, 45, 21,
+ 45, 1, 65, 64, 64, 64, 1, 67,
+ 68, 66, 66, 66, 1, 67, 68, 69,
+ 69, 69, 1, 67, 68, 70, 70, 70,
+ 1, 67, 68, 1, 72, 71, 64, 64,
+ 1, 73, 67, 68, 74, 66, 66, 1,
+ 75, 1, 76, 77, 1, 78, 1, 79,
+ 80, 1, 81, 1, 68, 82, 1, 68,
+ 83, 1, 68, 1, 20, 50, 1, 79,
+ 84, 1, 79, 1, 76, 85, 1, 76,
+ 1, 73, 67, 68, 86, 69, 69, 1,
+ 73, 67, 68, 70, 70, 70, 1, 88,
+ 68, 87, 87, 87, 1, 90, 68, 89,
+ 89, 89, 1, 90, 68, 91, 91, 91,
+ 1, 90, 68, 92, 92, 92, 1, 90,
+ 68, 1, 93, 87, 87, 1, 73, 90,
+ 68, 94, 89, 89, 1, 73, 90, 68,
+ 95, 91, 91, 1, 73, 90, 68, 92,
+ 92, 92, 1, 96, 1, 73, 97, 1,
+ 73, 98, 1, 73, 1, 72, 1, 1,
+ 0
+ };
+
+ static const char _tsip_machine_parser_header_Warning_trans_targs[] = {
+ 2, 0, 3, 4, 5, 6, 7, 8,
+ 9, 10, 13, 11, 12, 14, 15, 16,
+ 17, 33, 37, 56, 18, 17, 19, 20,
+ 23, 19, 20, 23, 21, 22, 24, 26,
+ 32, 25, 27, 31, 9, 27, 28, 29,
+ 30, 92, 34, 42, 54, 35, 36, 37,
+ 38, 39, 40, 41, 43, 44, 52, 45,
+ 46, 50, 47, 48, 49, 51, 53, 55,
+ 57, 91, 58, 61, 71, 59, 60, 62,
+ 78, 63, 76, 64, 65, 74, 66, 67,
+ 72, 68, 69, 70, 73, 75, 77, 79,
+ 87, 80, 83, 81, 82, 84, 85, 86,
+ 88, 89, 90
+ };
+
+ static const char _tsip_machine_parser_header_Warning_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 5,
+ 1, 1, 1, 1, 3, 0, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 12, 12, 12, 0, 0, 0,
+ 0, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0
+ };
+
+ static const int tsip_machine_parser_header_Warning_start = 1;
+ static const int tsip_machine_parser_header_Warning_first_final = 92;
+ static const int tsip_machine_parser_header_Warning_error = 0;
+
+ static const int tsip_machine_parser_header_Warning_en_main = 1;
+
+
+ /* #line 128 "./ragel/tsip_parser_header_Warning.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_header_Warning_first_final);
+ (void)(tsip_machine_parser_header_Warning_error);
+ (void)(tsip_machine_parser_header_Warning_en_main);
+
+ /* #line 349 "./src/headers/tsip_header_Warning.c" */
+ {
+ cs = tsip_machine_parser_header_Warning_start;
+ }
+
+ /* #line 133 "./ragel/tsip_parser_header_Warning.rl" */
+
+ /* #line 356 "./src/headers/tsip_header_Warning.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _keys = _tsip_machine_parser_header_Warning_trans_keys + _tsip_machine_parser_header_Warning_key_offsets[cs];
- _trans = _tsip_machine_parser_header_Warning_index_offsets[cs];
-
- _klen = _tsip_machine_parser_header_Warning_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_header_Warning_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _keys = _tsip_machine_parser_header_Warning_trans_keys + _tsip_machine_parser_header_Warning_key_offsets[cs];
+ _trans = _tsip_machine_parser_header_Warning_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_header_Warning_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_header_Warning_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_header_Warning_indicies[_trans];
- cs = _tsip_machine_parser_header_Warning_trans_targs[_trans];
-
- if ( _tsip_machine_parser_header_Warning_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_header_Warning_actions + _tsip_machine_parser_header_Warning_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 51 "./ragel/tsip_parser_header_Warning.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 55 "./ragel/tsip_parser_header_Warning.rl" */
- {
- if(!curr_warning){
- curr_warning = tsip_header_Warning_create();
- }
- }
- break;
- case 2:
-/* #line 61 "./ragel/tsip_parser_header_Warning.rl" */
- {
- if(curr_warning){
- TSK_PARSER_SET_STRING(curr_warning->agent);
- }
- }
- break;
- case 3:
-/* #line 67 "./ragel/tsip_parser_header_Warning.rl" */
- {
- if(curr_warning){
- TSK_PARSER_SET_STRING(curr_warning->text);
- }
- }
- break;
- case 4:
-/* #line 73 "./ragel/tsip_parser_header_Warning.rl" */
- {
- if(curr_warning){
- TSK_PARSER_SET_INTEGER(curr_warning->code);
- }
- }
- break;
- case 5:
-/* #line 79 "./ragel/tsip_parser_header_Warning.rl" */
- {
- if(curr_warning){
- tsk_list_push_back_data(hdr_warnings, ((void**) &curr_warning));
- }
- }
- break;
- case 6:
-/* #line 85 "./ragel/tsip_parser_header_Warning.rl" */
- {
- }
- break;
-/* #line 481 "./src/headers/tsip_header_Warning.c" */
- }
- }
+ _trans = _tsip_machine_parser_header_Warning_indicies[_trans];
+ cs = _tsip_machine_parser_header_Warning_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_header_Warning_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_header_Warning_actions + _tsip_machine_parser_header_Warning_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 51 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 55 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ if(!curr_warning) {
+ curr_warning = tsip_header_Warning_create();
+ }
+ }
+ break;
+ case 2:
+ /* #line 61 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ if(curr_warning) {
+ TSK_PARSER_SET_STRING(curr_warning->agent);
+ }
+ }
+ break;
+ case 3:
+ /* #line 67 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ if(curr_warning) {
+ TSK_PARSER_SET_STRING(curr_warning->text);
+ }
+ }
+ break;
+ case 4:
+ /* #line 73 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ if(curr_warning) {
+ TSK_PARSER_SET_INTEGER(curr_warning->code);
+ }
+ }
+ break;
+ case 5:
+ /* #line 79 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ if(curr_warning) {
+ tsk_list_push_back_data(hdr_warnings, ((void**) &curr_warning));
+ }
+ }
+ break;
+ case 6:
+ /* #line 85 "./ragel/tsip_parser_header_Warning.rl" */
+ {
+ }
+ break;
+ /* #line 481 "./src/headers/tsip_header_Warning.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 134 "./ragel/tsip_parser_header_Warning.rl" */
-
- if( cs <
-/* #line 497 "./src/headers/tsip_header_Warning.c" */
-92
-/* #line 135 "./ragel/tsip_parser_header_Warning.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse 'Warning' header.");
- TSK_OBJECT_SAFE_FREE(curr_warning);
- TSK_OBJECT_SAFE_FREE(hdr_warnings);
- }
-
- return hdr_warnings;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 134 "./ragel/tsip_parser_header_Warning.rl" */
+
+ if( cs <
+ /* #line 497 "./src/headers/tsip_header_Warning.c" */
+ 92
+ /* #line 135 "./ragel/tsip_parser_header_Warning.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse 'Warning' header.");
+ TSK_OBJECT_SAFE_FREE(curr_warning);
+ TSK_OBJECT_SAFE_FREE(hdr_warnings);
+ }
+
+ return hdr_warnings;
}
@@ -515,40 +526,39 @@ _again:
static tsk_object_t* tsip_header_Warning_ctor(tsk_object_t *self, va_list * app)
{
- tsip_header_Warning_t *Warning = self;
- if(Warning){
- TSIP_HEADER(Warning)->type = tsip_htype_Warning;
- TSIP_HEADER(Warning)->serialize = tsip_header_Warning_serialize;
-
- Warning->code = -1;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new Warning header.");
- }
- return self;
+ tsip_header_Warning_t *Warning = self;
+ if(Warning) {
+ TSIP_HEADER(Warning)->type = tsip_htype_Warning;
+ TSIP_HEADER(Warning)->serialize = tsip_header_Warning_serialize;
+
+ Warning->code = -1;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new Warning header.");
+ }
+ return self;
}
static tsk_object_t* tsip_header_Warning_dtor(tsk_object_t *self)
{
- tsip_header_Warning_t *Warning = self;
- if(Warning){
- TSK_FREE(Warning->agent);
- TSK_FREE(Warning->text);
-
- TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Warning));
- }
- else{
- TSK_DEBUG_ERROR("Null Warning header.");
- }
-
- return self;
+ tsip_header_Warning_t *Warning = self;
+ if(Warning) {
+ TSK_FREE(Warning->agent);
+ TSK_FREE(Warning->text);
+
+ TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Warning));
+ }
+ else {
+ TSK_DEBUG_ERROR("Null Warning header.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_header_Warning_def_s =
-{
- sizeof(tsip_header_Warning_t),
- tsip_header_Warning_ctor,
- tsip_header_Warning_dtor,
- tsk_null
+static const tsk_object_def_t tsip_header_Warning_def_s = {
+ sizeof(tsip_header_Warning_t),
+ tsip_header_Warning_ctor,
+ tsip_header_Warning_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_header_Warning_def_t = &tsip_header_Warning_def_s;
diff --git a/tinySIP/src/headers/tsip_header_accept.c b/tinySIP/src/headers/tsip_header_accept.c
index 6ddfcdf..92ff137 100755
--- a/tinySIP/src/headers/tsip_header_accept.c
+++ b/tinySIP/src/headers/tsip_header_accept.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/src/parsers/tsip_parser_header.c b/tinySIP/src/parsers/tsip_parser_header.c
index f7f6ba8..002d74b 100755
--- a/tinySIP/src/parsers/tsip_parser_header.c
+++ b/tinySIP/src/parsers/tsip_parser_header.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -70,6288 +70,6302 @@
tsk_bool_t tsip_header_parse(tsk_ragel_state_t *state, tsip_message_t *message)
{
- int cs = 0;
- const char *p = state->tag_start;
- const char *pe = state->tag_end;
- const char *eof = pe;
+ int cs = 0;
+ const char *p = state->tag_start;
+ const char *pe = state->tag_end;
+ const char *eof = pe;
-
-/* #line 80 "./src/parsers/tsip_parser_header.c" */
-static const char _tsip_machine_parser_headers_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 1, 8, 1, 9, 1, 10, 1,
- 11, 1, 12, 1, 13, 1, 14, 1,
- 15, 1, 16, 1, 17, 1, 18, 1,
- 19, 1, 20, 1, 21, 1, 22, 1,
- 23, 1, 24, 1, 25, 1, 26, 1,
- 27, 1, 28, 1, 29, 1, 30, 1,
- 31, 1, 32, 1, 33, 1, 34, 1,
- 35, 1, 36, 1, 37, 1, 38, 1,
- 39, 1, 40, 1, 41, 1, 42, 1,
- 43, 1, 44, 1, 45, 1, 46, 1,
- 47, 1, 48, 1, 49, 1, 50, 1,
- 51, 1, 52, 1, 53, 1, 54, 1,
- 55, 1, 56, 1, 57, 1, 58, 1,
- 59, 1, 60, 1, 61, 1, 62, 1,
- 63, 1, 64, 1, 65, 1, 66, 1,
- 67, 1, 68, 1, 69, 1, 70, 1,
- 71, 1, 72, 1, 73, 1, 74, 1,
- 75, 1, 76, 1, 77, 1, 78, 1,
- 79, 1, 80, 1, 81, 1, 82, 1,
- 83, 1, 84, 1, 85, 1, 86, 1,
- 87, 1, 88, 1, 89, 1, 90, 1,
- 91, 1, 92
-};
-static const char _tsip_machine_parser_headers_cond_offsets[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 2, 3, 4, 5, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6
-};
+ /* #line 80 "./src/parsers/tsip_parser_header.c" */
+ static const char _tsip_machine_parser_headers_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 1, 8, 1, 9, 1, 10, 1,
+ 11, 1, 12, 1, 13, 1, 14, 1,
+ 15, 1, 16, 1, 17, 1, 18, 1,
+ 19, 1, 20, 1, 21, 1, 22, 1,
+ 23, 1, 24, 1, 25, 1, 26, 1,
+ 27, 1, 28, 1, 29, 1, 30, 1,
+ 31, 1, 32, 1, 33, 1, 34, 1,
+ 35, 1, 36, 1, 37, 1, 38, 1,
+ 39, 1, 40, 1, 41, 1, 42, 1,
+ 43, 1, 44, 1, 45, 1, 46, 1,
+ 47, 1, 48, 1, 49, 1, 50, 1,
+ 51, 1, 52, 1, 53, 1, 54, 1,
+ 55, 1, 56, 1, 57, 1, 58, 1,
+ 59, 1, 60, 1, 61, 1, 62, 1,
+ 63, 1, 64, 1, 65, 1, 66, 1,
+ 67, 1, 68, 1, 69, 1, 70, 1,
+ 71, 1, 72, 1, 73, 1, 74, 1,
+ 75, 1, 76, 1, 77, 1, 78, 1,
+ 79, 1, 80, 1, 81, 1, 82, 1,
+ 83, 1, 84, 1, 85, 1, 86, 1,
+ 87, 1, 88, 1, 89, 1, 90, 1,
+ 91, 1, 92
+ };
-static const char _tsip_machine_parser_headers_cond_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1
-};
+ static const char _tsip_machine_parser_headers_cond_offsets[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 2, 3, 4, 5, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6
+ };
-static const short _tsip_machine_parser_headers_cond_keys[] = {
- 13, 13, 13, 13, 13, 13, 13, 13,
- 10, 10, 10, 10, 13, 13, 0
-};
+ static const char _tsip_machine_parser_headers_cond_lengths[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1
+ };
-static const char _tsip_machine_parser_headers_cond_spaces[] = {
- 0, 0, 0, 0, 0, 0, 0, 0
-};
+ static const short _tsip_machine_parser_headers_cond_keys[] = {
+ 13, 13, 13, 13, 13, 13, 13, 13,
+ 10, 10, 10, 10, 13, 13, 0
+ };
-static const short _tsip_machine_parser_headers_key_offsets[] = {
- 0, 0, 54, 71, 74, 77, 78, 79,
- 80, 82, 105, 124, 143, 162, 181, 198,
- 201, 204, 205, 206, 207, 209, 234, 253,
- 272, 291, 310, 329, 348, 365, 368, 371,
- 372, 373, 374, 376, 395, 414, 433, 452,
- 471, 490, 509, 526, 529, 532, 533, 534,
- 535, 537, 556, 575, 594, 613, 632, 651,
- 670, 687, 690, 693, 694, 695, 696, 698,
- 717, 736, 755, 774, 793, 812, 831, 848,
- 867, 886, 905, 924, 943, 962, 981, 1000,
- 1017, 1020, 1023, 1024, 1025, 1026, 1028, 1049,
- 1068, 1087, 1104, 1123, 1142, 1161, 1180, 1197,
- 1200, 1203, 1204, 1205, 1206, 1208, 1227, 1246,
- 1263, 1266, 1269, 1270, 1271, 1272, 1274, 1293,
- 1312, 1331, 1350, 1369, 1388, 1405, 1408, 1411,
- 1412, 1413, 1414, 1416, 1435, 1454, 1475, 1494,
- 1513, 1532, 1551, 1570, 1589, 1608, 1627, 1646,
- 1663, 1682, 1701, 1720, 1739, 1756, 1759, 1762,
- 1763, 1764, 1765, 1767, 1786, 1805, 1824, 1843,
- 1862, 1881, 1900, 1919, 1936, 1939, 1942, 1943,
- 1944, 1945, 1947, 1970, 1989, 2008, 2025, 2044,
- 2065, 2082, 2085, 2088, 2089, 2090, 2091, 2093,
- 2112, 2131, 2148, 2151, 2154, 2155, 2156, 2157,
- 2159, 2178, 2197, 2218, 2237, 2256, 2273, 2276,
- 2279, 2280, 2281, 2282, 2284, 2303, 2322, 2339,
- 2364, 2383, 2402, 2421, 2440, 2459, 2478, 2497,
- 2516, 2535, 2554, 2571, 2574, 2577, 2578, 2579,
- 2580, 2582, 2601, 2620, 2639, 2658, 2677, 2696,
- 2715, 2732, 2735, 2738, 2739, 2740, 2741, 2743,
- 2764, 2783, 2802, 2821, 2840, 2859, 2878, 2895,
- 2898, 2901, 2902, 2903, 2904, 2906, 2925, 2944,
- 2963, 2982, 2999, 3002, 3005, 3006, 3007, 3008,
- 3010, 3029, 3048, 3067, 3084, 3087, 3090, 3091,
- 3092, 3093, 3095, 3114, 3133, 3150, 3153, 3156,
- 3157, 3158, 3159, 3161, 3180, 3199, 3218, 3235,
- 3238, 3241, 3242, 3243, 3244, 3246, 3269, 3288,
- 3307, 3326, 3343, 3362, 3381, 3400, 3419, 3436,
- 3439, 3442, 3443, 3444, 3445, 3447, 3466, 3485,
- 3504, 3521, 3524, 3527, 3528, 3529, 3530, 3532,
- 3551, 3570, 3589, 3608, 3627, 3644, 3647, 3650,
- 3651, 3652, 3653, 3655, 3674, 3693, 3712, 3729,
- 3732, 3735, 3736, 3737, 3738, 3740, 3759, 3778,
- 3797, 3816, 3835, 3854, 3871, 3890, 3909, 3928,
- 3947, 3964, 3967, 3970, 3971, 3972, 3973, 3975,
- 3996, 4015, 4034, 4053, 4072, 4091, 4110, 4127,
- 4130, 4133, 4134, 4135, 4136, 4138, 4157, 4176,
- 4195, 4214, 4231, 4234, 4237, 4238, 4239, 4240,
- 4242, 4260, 4279, 4298, 4317, 4336, 4355, 4372,
- 4391, 4410, 4427, 4430, 4433, 4434, 4435, 4436,
- 4438, 4457, 4476, 4495, 4512, 4515, 4518, 4519,
- 4520, 4521, 4523, 4544, 4563, 4580, 4599, 4618,
- 4637, 4656, 4675, 4694, 4713, 4732, 4749, 4752,
- 4755, 4756, 4757, 4758, 4760, 4781, 4800, 4817,
- 4836, 4855, 4874, 4893, 4912, 4931, 4950, 4967,
- 4970, 4973, 4974, 4975, 4976, 4978, 4995, 5016,
- 5035, 5054, 5073, 5092, 5111, 5130, 5147, 5150,
- 5153, 5154, 5155, 5156, 5158, 5177, 5194, 5197,
- 5200, 5201, 5202, 5203, 5205, 5224, 5243, 5262,
- 5281, 5300, 5319, 5338, 5357, 5376, 5395, 5414,
- 5431, 5434, 5437, 5438, 5439, 5440, 5442, 5463,
- 5496, 5519, 5538, 5557, 5576, 5595, 5612, 5631,
- 5650, 5669, 5688, 5707, 5726, 5745, 5762, 5781,
- 5800, 5819, 5838, 5855, 5858, 5861, 5862, 5863,
- 5864, 5866, 5885, 5904, 5923, 5942, 5959, 5978,
- 5997, 6016, 6035, 6054, 6071, 6074, 6077, 6078,
- 6079, 6080, 6082, 6101, 6122, 6141, 6160, 6179,
- 6198, 6215, 6234, 6253, 6272, 6291, 6310, 6329,
- 6348, 6367, 6384, 6387, 6390, 6391, 6392, 6393,
- 6395, 6414, 6433, 6452, 6471, 6490, 6509, 6526,
- 6545, 6564, 6583, 6600, 6603, 6606, 6607, 6608,
- 6609, 6611, 6632, 6651, 6670, 6689, 6708, 6725,
- 6744, 6763, 6782, 6801, 6820, 6837, 6856, 6875,
- 6892, 6895, 6898, 6899, 6900, 6901, 6903, 6922,
- 6941, 6960, 6979, 6998, 7017, 7034, 7055, 7074,
- 7093, 7112, 7131, 7150, 7169, 7188, 7205, 7224,
- 7243, 7262, 7281, 7300, 7319, 7338, 7357, 7376,
- 7393, 7396, 7399, 7400, 7401, 7402, 7404, 7423,
- 7442, 7461, 7480, 7499, 7516, 7519, 7522, 7523,
- 7524, 7525, 7527, 7546, 7565, 7582, 7609, 7628,
- 7647, 7666, 7685, 7704, 7723, 7740, 7759, 7778,
- 7797, 7816, 7833, 7836, 7839, 7840, 7841, 7842,
- 7844, 7863, 7882, 7901, 7918, 7921, 7924, 7925,
- 7926, 7927, 7929, 7948, 7967, 7986, 8003, 8006,
- 8009, 8010, 8011, 8012, 8014, 8033, 8052, 8071,
- 8090, 8109, 8128, 8147, 8164, 8167, 8170, 8171,
- 8172, 8173, 8175, 8194, 8213, 8232, 8251, 8268,
- 8287, 8306, 8325, 8344, 8363, 8380, 8399, 8418,
- 8435, 8438, 8441, 8442, 8443, 8444, 8446, 8465,
- 8484, 8503, 8522, 8539, 8558, 8577, 8596, 8615,
- 8634, 8651, 8654, 8657, 8658, 8659, 8660, 8662,
- 8681, 8700, 8719, 8738, 8755, 8774, 8793, 8812,
- 8831, 8850, 8869, 8888, 8907, 8926, 8945, 8964,
- 8983, 9002, 9019, 9022, 9025, 9026, 9027, 9028,
- 9030, 9049, 9070, 9089, 9108, 9127, 9146, 9165,
- 9184, 9201, 9220, 9239, 9258, 9277, 9296, 9315,
- 9334, 9353, 9370, 9373, 9376, 9377, 9378, 9379,
- 9381, 9400, 9419, 9438, 9457, 9474, 9493, 9512,
- 9531, 9548, 9551, 9554, 9555, 9556, 9557, 9559,
- 9578, 9597, 9616, 9633, 9652, 9671, 9690, 9709,
- 9728, 9747, 9766, 9785, 9802, 9805, 9808, 9809,
- 9810, 9811, 9813, 9832, 9851, 9870, 9889, 9908,
- 9927, 9944, 9963, 9982, 10001, 10020, 10039, 10058,
- 10077, 10094, 10113, 10132, 10149, 10152, 10155, 10156,
- 10157, 10158, 10160, 10179, 10198, 10215, 10218, 10221,
- 10222, 10223, 10224, 10226, 10247, 10268, 10287, 10306,
- 10325, 10344, 10361, 10364, 10367, 10368, 10369, 10370,
- 10372, 10391, 10410, 10429, 10446, 10449, 10452, 10453,
- 10454, 10455, 10457, 10476, 10495, 10512, 10533, 10552,
- 10571, 10590, 10611, 10630, 10649, 10668, 10687, 10706,
- 10725, 10744, 10761, 10764, 10767, 10768, 10769, 10770,
- 10772, 10791, 10810, 10829, 10848, 10867, 10886, 10905,
- 10924, 10941, 10944, 10947, 10948, 10949, 10950, 10952,
- 10971, 10990, 11009, 11028, 11047, 11066, 11083, 11086,
- 11089, 11090, 11091, 11092, 11094, 11119, 11138, 11157,
- 11174, 11177, 11180, 11181, 11182, 11183, 11185, 11218,
- 11237, 11256, 11275, 11292, 11295, 11298, 11299, 11300,
- 11301, 11303, 11322, 11341, 11360, 11377, 11396, 11415,
- 11434, 11453, 11472, 11489, 11492, 11495, 11496, 11497,
- 11498, 11500, 11519, 11538, 11557, 11578, 11597, 11616,
- 11633, 11636, 11639, 11640, 11641, 11642, 11644, 11663,
- 11680, 11683, 11686, 11687, 11688, 11689, 11691, 11710,
- 11729, 11746, 11765, 11784, 11801, 11804, 11807, 11808,
- 11809, 11810, 11812, 11831, 11850, 11869, 11886, 11905,
- 11924, 11943, 11962, 11981, 12000, 12019, 12036, 12039,
- 12042, 12043, 12044, 12045, 12047, 12066, 12087, 12106,
- 12125, 12144, 12161, 12164, 12167, 12168, 12169, 12170,
- 12172, 12189, 12208, 12227, 12244, 12247, 12250, 12251,
- 12252, 12253, 12255, 12274, 12295, 12314, 12333, 12350,
- 12369, 12388, 12407, 12426, 12445, 12464, 12483, 12502,
- 12521, 12540, 12559, 12576, 12579, 12582, 12583, 12584,
- 12585, 12587, 12606, 12625, 12642, 12645, 12648, 12649,
- 12650, 12651, 12653, 12672, 12691, 12710, 12729, 12748,
- 12765, 12784, 12803, 12822, 12841, 12860, 12879, 12898,
- 12917, 12934, 12937, 12940, 12941, 12942, 12943, 12945,
- 12964, 12983, 13000, 13019, 13038, 13057, 13076, 13095,
- 13112, 13115, 13118, 13119, 13120, 13121, 13123, 13142,
- 13161, 13180, 13197, 13200, 13203, 13204, 13205, 13206,
- 13208, 13227, 13246, 13263, 13266, 13269, 13270, 13271,
- 13272, 13274, 13297, 13300, 13303, 13304, 13305, 13306,
- 13308, 13331, 13350, 13369, 13388, 13407, 13426, 13443,
- 13466, 13485, 13504, 13523, 13542, 13561, 13578, 13581,
- 13584, 13585, 13586, 13587, 13589, 13608, 13627, 13646,
- 13665, 13684, 13701, 13704, 13707, 13708, 13709, 13710,
- 13712, 13731, 13750, 13769, 13788, 13807, 13824, 13827,
- 13830, 13831, 13832, 13833, 13835, 13854, 13875, 13894,
- 13911, 13914, 13917, 13918, 13919, 13920, 13922, 13941,
- 13960, 13977, 13996, 14015, 14034, 14053, 14072, 14089,
- 14092, 14095, 14096, 14097, 14098, 14100, 14119, 14138,
- 14157, 14176, 14193, 14212, 14231, 14250, 14269, 14288,
- 14307, 14326, 14343, 14346, 14349, 14350, 14351, 14352,
- 14354, 14373, 14390, 14411, 14430, 14449, 14468, 14485,
- 14488, 14491, 14492, 14493, 14494, 14496, 14515, 14532,
- 14551, 14570, 14589, 14608, 14627, 14644, 14647, 14650,
- 14651, 14652, 14653, 14655, 14676, 14697, 14716, 14735,
- 14754, 14771, 14790, 14809, 14828, 14847, 14866, 14885,
- 14904, 14923, 14940, 14959, 14978, 14997, 15016, 15035,
- 15052, 15055, 15058, 15059, 15060, 15061, 15063, 15082,
- 15101, 15120, 15139, 15158, 15177, 15194, 15197, 15200,
- 15201, 15202, 15203, 15205, 15228, 15247, 15266, 15285,
- 15304, 15321, 15340, 15359, 15378, 15397, 15416, 15435,
- 15452, 15455, 15458, 15459, 15460, 15461, 15463, 15482,
- 15501, 15520, 15539, 15558, 15577, 15596, 15613, 15616,
- 15619, 15620, 15621, 15622, 15624, 15641, 15644, 15647,
- 15648, 15649, 15650, 15652, 15673, 15692, 15711, 15730,
- 15749, 15768, 15787, 15806, 15825, 15844, 15861, 15864,
- 15867, 15868, 15869, 15870, 15872, 15891, 15910, 15927,
- 15946, 15965, 15984, 16003, 16022, 16039, 16042, 16045,
- 16046, 16047, 16048, 16050, 16069, 16088, 16105, 16108,
- 16111, 16112, 16113, 16114, 16116, 16137, 16156, 16175,
- 16194, 16213, 16232, 16249, 16252, 16255, 16256, 16257,
- 16258, 16260, 16279, 16296, 16315, 16334, 16353, 16372,
- 16391, 16410, 16429, 16448, 16467, 16486, 16505, 16524,
- 16541, 16544, 16552, 16558, 16565, 16571, 16572, 16574,
- 16575, 16577, 16600, 16623, 16642, 16665, 16684, 16705,
- 16724, 16745, 16770, 16793, 16814, 16833, 16850, 16850
-};
+ static const char _tsip_machine_parser_headers_cond_spaces[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
-static const short _tsip_machine_parser_headers_trans_keys[] = {
- 33, 37, 39, 65, 67, 68, 69, 70,
- 72, 73, 74, 77, 79, 80, 82, 83,
- 84, 85, 86, 87, 97, 98, 99, 100,
- 101, 102, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 114, 115, 116, 117, 118,
- 119, 120, 121, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 67, 76, 85, 99, 108, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 67,
- 69, 76, 82, 99, 101, 108, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 67, 99, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 71, 103, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 85, 117, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 80, 112,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 89, 121, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 76, 101, 108, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 70, 102, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 87, 119, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 86, 118, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 79, 101, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 90, 122, 126, 42, 43,
- 45, 46, 48, 57, 65, 89, 95, 121,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 65, 79, 83, 97, 111, 115, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 76, 108, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 76, 108, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 78, 100, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 69, 97, 101, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 67, 99, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 68, 69, 76, 84, 100, 101, 108,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 67,
- 99, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 68, 100, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 65, 69, 97,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 85, 117, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 71, 103, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 89, 121, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 81, 113, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 82, 86, 88, 114,
- 118, 120, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 80, 112, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 77, 109, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 89, 121, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 68, 78, 100,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 89, 121, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 70, 102,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 95, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 96, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 76, 108, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 89, 121,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 65, 73, 97, 105, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 88, 120,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 70, 102, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 87, 119, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 77, 78,
- 109, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 86,
- 118, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 83, 101, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 88, 120,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 80, 112, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 78, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 90, 122, 126, 42, 43, 45,
- 46, 48, 57, 65, 89, 95, 121, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 45,
- 46, 58, 65, 82, 97, 114, 126, 42,
- 43, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 67, 68,
- 69, 77, 80, 85, 86, 97, 99, 100,
- 101, 109, 112, 117, 118, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 67, 78,
- 83, 99, 110, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 87, 119, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 75, 107, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 70, 102,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 79, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 87, 119, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 79, 101, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 68, 100, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 89, 121, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 97, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 68, 100, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 85, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 65, 72, 97, 104, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 76, 108,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 76, 108, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 89,
- 121, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 68, 100,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 71, 103, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 71, 103, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 70, 86, 102, 118, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 68, 100,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 68, 100, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 66, 76, 79, 82,
- 84, 98, 108, 111, 114, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 76, 108, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 76, 108, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 70, 102, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 80, 112, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 80, 112, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 89, 121,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 68, 100, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 76, 108, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 89, 121, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 77, 109, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 85, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 84,
- 116, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 72, 104, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 90, 122,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 89, 95, 121, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 79, 101, 111, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 70, 102, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 68, 100, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 89, 121, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 70, 102, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 76, 108, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 75, 107, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 89, 121,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 66, 98, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 83, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 100, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 87,
- 119, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 75, 107, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 73, 79, 105, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 79, 86, 111,
- 118, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 89, 121, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 65, 97, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 89, 121, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 88,
- 120, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 89, 121, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 82,
- 97, 114, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 85, 117, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 72, 104, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 79, 101, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 90, 122, 126, 42, 43, 45, 46, 48,
- 57, 65, 89, 95, 121, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 110, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 81, 113, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 85, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 69, 101, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 58, 9, 13,
- 32, 13, 10, 10, 9, 32, 9, 32,
- 33, 37, 39, 58, 65, 69, 79, 83,
- 97, 101, 111, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 75, 107, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 65,
- 67, 70, 74, 80, 81, 83, 84, 97,
- 99, 102, 106, 112, 113, 115, 116, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 83, 115, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 79, 111, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 114, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 68, 100, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 82, 114, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 82, 114, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 84, 115, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 85, 117, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 66, 98, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 45, 46,
- 58, 126, 42, 43, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 66, 98, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 89, 121, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 67, 99, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 76, 108, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 89, 97, 121, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 67, 99, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 79, 111,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 73, 101, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 83, 115, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 73, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 85, 117,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 67, 99, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 45, 46, 58, 126, 42, 43, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 80, 112, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 73, 105, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 79, 111, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 89, 121, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 58, 9, 13, 32, 13, 10, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 89, 121, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 70, 102, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 81, 113, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 69, 73, 85, 101, 105, 117, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 67, 82, 83, 99, 114, 115,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 84, 116, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 89, 121, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 45,
- 46, 58, 126, 42, 43, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 83, 86, 99, 115, 118, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 76, 108, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 78, 110, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 86, 118, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 70,
- 102, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 89, 121, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 58, 9, 13, 32, 13, 10,
- 10, 9, 32, 9, 32, 33, 37, 39,
- 58, 86, 118, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 73, 101, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 67, 99, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 79, 111, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 85, 117, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 78, 110, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 88, 120, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 83, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 45, 46, 58, 126, 42, 43,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 73, 101, 105,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 65, 97, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 71,
- 103, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 70, 102,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 77, 109, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 67, 99, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 72, 104,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 66, 80, 98,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 74, 83, 106, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 67, 99, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 67, 99, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 82, 114, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 73,
- 105, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 80, 112, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 45, 46, 58, 126, 42, 43, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 83, 115, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 84, 116, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 97, 126, 42, 43, 45, 46, 48,
- 57, 66, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 79, 111, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 82, 114, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 69, 101, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 68, 100, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 58, 9, 13, 32,
- 13, 10, 10, 9, 32, 9, 32, 33,
- 37, 39, 58, 65, 73, 79, 97, 105,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 66, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 82, 114, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 71, 103, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 84, 116, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 45, 46, 58,
- 126, 42, 43, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 73, 105, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 76, 108, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 71, 103,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 58, 9,
- 13, 32, 13, 10, 10, 9, 32, 9,
- 32, 33, 37, 39, 58, 77, 109, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 69, 101, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 84, 116,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 77, 109, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 80,
- 112, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 78, 83, 110, 115, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 83,
- 115, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 85, 117, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 80, 112, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 80, 112, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 79, 111, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 82, 114,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 69, 101, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 68,
- 100, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 13, 32, 13, 10, 10, 9, 32,
- 9, 32, 33, 37, 39, 58, 69, 101,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 82, 114, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 45, 46, 58, 126, 42,
- 43, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 71, 103, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 69, 101, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 78, 110,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 84, 116, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 58, 9, 13, 32, 13, 10, 10,
- 9, 32, 9, 32, 33, 37, 39, 58,
- 73, 105, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 65, 97, 126, 42, 43,
- 45, 46, 48, 57, 66, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 65, 87, 97, 119, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 78, 110, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 73, 105, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 78, 110, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 71, 103, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 58, 9, 13, 32, 13,
- 10, 10, 9, 32, 9, 32, 33, 37,
- 39, 58, 87, 119, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 45, 46, 58, 126,
- 42, 43, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 97,
- 126, 42, 43, 45, 46, 48, 57, 66,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 85, 117, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 72,
- 104, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 69, 101, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 78, 110, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 84, 116, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 33,
- 37, 39, 58, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 67, 99,
- 126, 42, 43, 45, 46, 48, 57, 65,
- 90, 95, 122, 9, 32, 33, 37, 39,
- 58, 65, 97, 126, 42, 43, 45, 46,
- 48, 57, 66, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 84, 116, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 69,
- 101, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 126, 42, 43, 45, 46, 48,
- 57, 65, 90, 95, 122, 9, 32, 58,
- 9, 32, 269, 525, -128, 12, 14, 127,
- 269, 525, -128, 12, 14, 127, 10, 269,
- 525, -128, 12, 14, 127, 269, 525, -128,
- 12, 14, 127, 522, 266, 522, 10, 9,
- 32, 9, 32, 33, 37, 39, 58, 67,
- 76, 85, 99, 108, 117, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 9, 32, 33, 37, 39, 58, 65, 79,
- 83, 97, 111, 115, 126, 42, 43, 45,
- 46, 48, 57, 66, 90, 95, 122, 9,
- 32, 33, 37, 39, 58, 65, 97, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 82, 86, 88, 114, 118, 120, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 82,
- 114, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 68, 78, 100, 110, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 79,
- 111, 126, 42, 43, 45, 46, 48, 57,
- 65, 90, 95, 122, 9, 32, 33, 37,
- 39, 58, 65, 73, 97, 105, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 65,
- 69, 79, 83, 97, 101, 111, 115, 126,
- 42, 43, 45, 46, 48, 57, 66, 90,
- 95, 122, 9, 32, 33, 37, 39, 58,
- 65, 73, 79, 97, 105, 111, 126, 42,
- 43, 45, 46, 48, 57, 66, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 78,
- 83, 110, 115, 126, 42, 43, 45, 46,
- 48, 57, 65, 90, 95, 122, 9, 32,
- 33, 37, 39, 58, 73, 105, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 9, 32, 33, 37, 39, 58, 126,
- 42, 43, 45, 46, 48, 57, 65, 90,
- 95, 122, 269, 525, -128, 12, 14, 127,
- 0
-};
+ static const short _tsip_machine_parser_headers_key_offsets[] = {
+ 0, 0, 54, 71, 74, 77, 78, 79,
+ 80, 82, 105, 124, 143, 162, 181, 198,
+ 201, 204, 205, 206, 207, 209, 234, 253,
+ 272, 291, 310, 329, 348, 365, 368, 371,
+ 372, 373, 374, 376, 395, 414, 433, 452,
+ 471, 490, 509, 526, 529, 532, 533, 534,
+ 535, 537, 556, 575, 594, 613, 632, 651,
+ 670, 687, 690, 693, 694, 695, 696, 698,
+ 717, 736, 755, 774, 793, 812, 831, 848,
+ 867, 886, 905, 924, 943, 962, 981, 1000,
+ 1017, 1020, 1023, 1024, 1025, 1026, 1028, 1049,
+ 1068, 1087, 1104, 1123, 1142, 1161, 1180, 1197,
+ 1200, 1203, 1204, 1205, 1206, 1208, 1227, 1246,
+ 1263, 1266, 1269, 1270, 1271, 1272, 1274, 1293,
+ 1312, 1331, 1350, 1369, 1388, 1405, 1408, 1411,
+ 1412, 1413, 1414, 1416, 1435, 1454, 1475, 1494,
+ 1513, 1532, 1551, 1570, 1589, 1608, 1627, 1646,
+ 1663, 1682, 1701, 1720, 1739, 1756, 1759, 1762,
+ 1763, 1764, 1765, 1767, 1786, 1805, 1824, 1843,
+ 1862, 1881, 1900, 1919, 1936, 1939, 1942, 1943,
+ 1944, 1945, 1947, 1970, 1989, 2008, 2025, 2044,
+ 2065, 2082, 2085, 2088, 2089, 2090, 2091, 2093,
+ 2112, 2131, 2148, 2151, 2154, 2155, 2156, 2157,
+ 2159, 2178, 2197, 2218, 2237, 2256, 2273, 2276,
+ 2279, 2280, 2281, 2282, 2284, 2303, 2322, 2339,
+ 2364, 2383, 2402, 2421, 2440, 2459, 2478, 2497,
+ 2516, 2535, 2554, 2571, 2574, 2577, 2578, 2579,
+ 2580, 2582, 2601, 2620, 2639, 2658, 2677, 2696,
+ 2715, 2732, 2735, 2738, 2739, 2740, 2741, 2743,
+ 2764, 2783, 2802, 2821, 2840, 2859, 2878, 2895,
+ 2898, 2901, 2902, 2903, 2904, 2906, 2925, 2944,
+ 2963, 2982, 2999, 3002, 3005, 3006, 3007, 3008,
+ 3010, 3029, 3048, 3067, 3084, 3087, 3090, 3091,
+ 3092, 3093, 3095, 3114, 3133, 3150, 3153, 3156,
+ 3157, 3158, 3159, 3161, 3180, 3199, 3218, 3235,
+ 3238, 3241, 3242, 3243, 3244, 3246, 3269, 3288,
+ 3307, 3326, 3343, 3362, 3381, 3400, 3419, 3436,
+ 3439, 3442, 3443, 3444, 3445, 3447, 3466, 3485,
+ 3504, 3521, 3524, 3527, 3528, 3529, 3530, 3532,
+ 3551, 3570, 3589, 3608, 3627, 3644, 3647, 3650,
+ 3651, 3652, 3653, 3655, 3674, 3693, 3712, 3729,
+ 3732, 3735, 3736, 3737, 3738, 3740, 3759, 3778,
+ 3797, 3816, 3835, 3854, 3871, 3890, 3909, 3928,
+ 3947, 3964, 3967, 3970, 3971, 3972, 3973, 3975,
+ 3996, 4015, 4034, 4053, 4072, 4091, 4110, 4127,
+ 4130, 4133, 4134, 4135, 4136, 4138, 4157, 4176,
+ 4195, 4214, 4231, 4234, 4237, 4238, 4239, 4240,
+ 4242, 4260, 4279, 4298, 4317, 4336, 4355, 4372,
+ 4391, 4410, 4427, 4430, 4433, 4434, 4435, 4436,
+ 4438, 4457, 4476, 4495, 4512, 4515, 4518, 4519,
+ 4520, 4521, 4523, 4544, 4563, 4580, 4599, 4618,
+ 4637, 4656, 4675, 4694, 4713, 4732, 4749, 4752,
+ 4755, 4756, 4757, 4758, 4760, 4781, 4800, 4817,
+ 4836, 4855, 4874, 4893, 4912, 4931, 4950, 4967,
+ 4970, 4973, 4974, 4975, 4976, 4978, 4995, 5016,
+ 5035, 5054, 5073, 5092, 5111, 5130, 5147, 5150,
+ 5153, 5154, 5155, 5156, 5158, 5177, 5194, 5197,
+ 5200, 5201, 5202, 5203, 5205, 5224, 5243, 5262,
+ 5281, 5300, 5319, 5338, 5357, 5376, 5395, 5414,
+ 5431, 5434, 5437, 5438, 5439, 5440, 5442, 5463,
+ 5496, 5519, 5538, 5557, 5576, 5595, 5612, 5631,
+ 5650, 5669, 5688, 5707, 5726, 5745, 5762, 5781,
+ 5800, 5819, 5838, 5855, 5858, 5861, 5862, 5863,
+ 5864, 5866, 5885, 5904, 5923, 5942, 5959, 5978,
+ 5997, 6016, 6035, 6054, 6071, 6074, 6077, 6078,
+ 6079, 6080, 6082, 6101, 6122, 6141, 6160, 6179,
+ 6198, 6215, 6234, 6253, 6272, 6291, 6310, 6329,
+ 6348, 6367, 6384, 6387, 6390, 6391, 6392, 6393,
+ 6395, 6414, 6433, 6452, 6471, 6490, 6509, 6526,
+ 6545, 6564, 6583, 6600, 6603, 6606, 6607, 6608,
+ 6609, 6611, 6632, 6651, 6670, 6689, 6708, 6725,
+ 6744, 6763, 6782, 6801, 6820, 6837, 6856, 6875,
+ 6892, 6895, 6898, 6899, 6900, 6901, 6903, 6922,
+ 6941, 6960, 6979, 6998, 7017, 7034, 7055, 7074,
+ 7093, 7112, 7131, 7150, 7169, 7188, 7205, 7224,
+ 7243, 7262, 7281, 7300, 7319, 7338, 7357, 7376,
+ 7393, 7396, 7399, 7400, 7401, 7402, 7404, 7423,
+ 7442, 7461, 7480, 7499, 7516, 7519, 7522, 7523,
+ 7524, 7525, 7527, 7546, 7565, 7582, 7609, 7628,
+ 7647, 7666, 7685, 7704, 7723, 7740, 7759, 7778,
+ 7797, 7816, 7833, 7836, 7839, 7840, 7841, 7842,
+ 7844, 7863, 7882, 7901, 7918, 7921, 7924, 7925,
+ 7926, 7927, 7929, 7948, 7967, 7986, 8003, 8006,
+ 8009, 8010, 8011, 8012, 8014, 8033, 8052, 8071,
+ 8090, 8109, 8128, 8147, 8164, 8167, 8170, 8171,
+ 8172, 8173, 8175, 8194, 8213, 8232, 8251, 8268,
+ 8287, 8306, 8325, 8344, 8363, 8380, 8399, 8418,
+ 8435, 8438, 8441, 8442, 8443, 8444, 8446, 8465,
+ 8484, 8503, 8522, 8539, 8558, 8577, 8596, 8615,
+ 8634, 8651, 8654, 8657, 8658, 8659, 8660, 8662,
+ 8681, 8700, 8719, 8738, 8755, 8774, 8793, 8812,
+ 8831, 8850, 8869, 8888, 8907, 8926, 8945, 8964,
+ 8983, 9002, 9019, 9022, 9025, 9026, 9027, 9028,
+ 9030, 9049, 9070, 9089, 9108, 9127, 9146, 9165,
+ 9184, 9201, 9220, 9239, 9258, 9277, 9296, 9315,
+ 9334, 9353, 9370, 9373, 9376, 9377, 9378, 9379,
+ 9381, 9400, 9419, 9438, 9457, 9474, 9493, 9512,
+ 9531, 9548, 9551, 9554, 9555, 9556, 9557, 9559,
+ 9578, 9597, 9616, 9633, 9652, 9671, 9690, 9709,
+ 9728, 9747, 9766, 9785, 9802, 9805, 9808, 9809,
+ 9810, 9811, 9813, 9832, 9851, 9870, 9889, 9908,
+ 9927, 9944, 9963, 9982, 10001, 10020, 10039, 10058,
+ 10077, 10094, 10113, 10132, 10149, 10152, 10155, 10156,
+ 10157, 10158, 10160, 10179, 10198, 10215, 10218, 10221,
+ 10222, 10223, 10224, 10226, 10247, 10268, 10287, 10306,
+ 10325, 10344, 10361, 10364, 10367, 10368, 10369, 10370,
+ 10372, 10391, 10410, 10429, 10446, 10449, 10452, 10453,
+ 10454, 10455, 10457, 10476, 10495, 10512, 10533, 10552,
+ 10571, 10590, 10611, 10630, 10649, 10668, 10687, 10706,
+ 10725, 10744, 10761, 10764, 10767, 10768, 10769, 10770,
+ 10772, 10791, 10810, 10829, 10848, 10867, 10886, 10905,
+ 10924, 10941, 10944, 10947, 10948, 10949, 10950, 10952,
+ 10971, 10990, 11009, 11028, 11047, 11066, 11083, 11086,
+ 11089, 11090, 11091, 11092, 11094, 11119, 11138, 11157,
+ 11174, 11177, 11180, 11181, 11182, 11183, 11185, 11218,
+ 11237, 11256, 11275, 11292, 11295, 11298, 11299, 11300,
+ 11301, 11303, 11322, 11341, 11360, 11377, 11396, 11415,
+ 11434, 11453, 11472, 11489, 11492, 11495, 11496, 11497,
+ 11498, 11500, 11519, 11538, 11557, 11578, 11597, 11616,
+ 11633, 11636, 11639, 11640, 11641, 11642, 11644, 11663,
+ 11680, 11683, 11686, 11687, 11688, 11689, 11691, 11710,
+ 11729, 11746, 11765, 11784, 11801, 11804, 11807, 11808,
+ 11809, 11810, 11812, 11831, 11850, 11869, 11886, 11905,
+ 11924, 11943, 11962, 11981, 12000, 12019, 12036, 12039,
+ 12042, 12043, 12044, 12045, 12047, 12066, 12087, 12106,
+ 12125, 12144, 12161, 12164, 12167, 12168, 12169, 12170,
+ 12172, 12189, 12208, 12227, 12244, 12247, 12250, 12251,
+ 12252, 12253, 12255, 12274, 12295, 12314, 12333, 12350,
+ 12369, 12388, 12407, 12426, 12445, 12464, 12483, 12502,
+ 12521, 12540, 12559, 12576, 12579, 12582, 12583, 12584,
+ 12585, 12587, 12606, 12625, 12642, 12645, 12648, 12649,
+ 12650, 12651, 12653, 12672, 12691, 12710, 12729, 12748,
+ 12765, 12784, 12803, 12822, 12841, 12860, 12879, 12898,
+ 12917, 12934, 12937, 12940, 12941, 12942, 12943, 12945,
+ 12964, 12983, 13000, 13019, 13038, 13057, 13076, 13095,
+ 13112, 13115, 13118, 13119, 13120, 13121, 13123, 13142,
+ 13161, 13180, 13197, 13200, 13203, 13204, 13205, 13206,
+ 13208, 13227, 13246, 13263, 13266, 13269, 13270, 13271,
+ 13272, 13274, 13297, 13300, 13303, 13304, 13305, 13306,
+ 13308, 13331, 13350, 13369, 13388, 13407, 13426, 13443,
+ 13466, 13485, 13504, 13523, 13542, 13561, 13578, 13581,
+ 13584, 13585, 13586, 13587, 13589, 13608, 13627, 13646,
+ 13665, 13684, 13701, 13704, 13707, 13708, 13709, 13710,
+ 13712, 13731, 13750, 13769, 13788, 13807, 13824, 13827,
+ 13830, 13831, 13832, 13833, 13835, 13854, 13875, 13894,
+ 13911, 13914, 13917, 13918, 13919, 13920, 13922, 13941,
+ 13960, 13977, 13996, 14015, 14034, 14053, 14072, 14089,
+ 14092, 14095, 14096, 14097, 14098, 14100, 14119, 14138,
+ 14157, 14176, 14193, 14212, 14231, 14250, 14269, 14288,
+ 14307, 14326, 14343, 14346, 14349, 14350, 14351, 14352,
+ 14354, 14373, 14390, 14411, 14430, 14449, 14468, 14485,
+ 14488, 14491, 14492, 14493, 14494, 14496, 14515, 14532,
+ 14551, 14570, 14589, 14608, 14627, 14644, 14647, 14650,
+ 14651, 14652, 14653, 14655, 14676, 14697, 14716, 14735,
+ 14754, 14771, 14790, 14809, 14828, 14847, 14866, 14885,
+ 14904, 14923, 14940, 14959, 14978, 14997, 15016, 15035,
+ 15052, 15055, 15058, 15059, 15060, 15061, 15063, 15082,
+ 15101, 15120, 15139, 15158, 15177, 15194, 15197, 15200,
+ 15201, 15202, 15203, 15205, 15228, 15247, 15266, 15285,
+ 15304, 15321, 15340, 15359, 15378, 15397, 15416, 15435,
+ 15452, 15455, 15458, 15459, 15460, 15461, 15463, 15482,
+ 15501, 15520, 15539, 15558, 15577, 15596, 15613, 15616,
+ 15619, 15620, 15621, 15622, 15624, 15641, 15644, 15647,
+ 15648, 15649, 15650, 15652, 15673, 15692, 15711, 15730,
+ 15749, 15768, 15787, 15806, 15825, 15844, 15861, 15864,
+ 15867, 15868, 15869, 15870, 15872, 15891, 15910, 15927,
+ 15946, 15965, 15984, 16003, 16022, 16039, 16042, 16045,
+ 16046, 16047, 16048, 16050, 16069, 16088, 16105, 16108,
+ 16111, 16112, 16113, 16114, 16116, 16137, 16156, 16175,
+ 16194, 16213, 16232, 16249, 16252, 16255, 16256, 16257,
+ 16258, 16260, 16279, 16296, 16315, 16334, 16353, 16372,
+ 16391, 16410, 16429, 16448, 16467, 16486, 16505, 16524,
+ 16541, 16544, 16552, 16558, 16565, 16571, 16572, 16574,
+ 16575, 16577, 16600, 16623, 16642, 16665, 16684, 16705,
+ 16724, 16745, 16770, 16793, 16814, 16833, 16850, 16850
+ };
-static const char _tsip_machine_parser_headers_single_lengths[] = {
- 0, 44, 7, 3, 3, 1, 1, 1,
- 2, 13, 9, 9, 9, 9, 9, 3,
- 3, 1, 1, 1, 2, 15, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 11, 9,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 11, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 13, 9, 9, 9, 9, 11,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 11, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 15,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 11,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 13, 9, 9,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 11,
- 9, 9, 9, 9, 9, 9, 9, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 8, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 11, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 11, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 11, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 13, 23,
- 13, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 11, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 11, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 9, 11, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 17, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 11, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 11, 11, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 11, 9, 9,
- 9, 11, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 15, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 23, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 11, 11, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 11, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 11, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 7, 3, 3, 1, 1,
- 1, 2, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 7, 3, 3, 1, 1, 1, 2, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 13, 3, 3, 1, 1, 1, 2,
- 13, 9, 9, 9, 9, 9, 9, 13,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 11, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 7, 3, 3, 1, 1, 1, 2,
- 9, 9, 11, 9, 9, 9, 7, 3,
- 3, 1, 1, 1, 2, 9, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 11, 11, 9, 9, 9,
- 7, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 13, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 3, 1, 1, 1, 2, 9, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 7, 3, 3, 1,
- 1, 1, 2, 11, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 9, 9, 9, 9,
- 9, 9, 9, 9, 7, 3, 3, 1,
- 1, 1, 2, 9, 9, 7, 3, 3,
- 1, 1, 1, 2, 11, 9, 9, 9,
- 9, 9, 7, 3, 3, 1, 1, 1,
- 2, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 7,
- 3, 4, 2, 3, 2, 1, 2, 1,
- 2, 13, 13, 9, 13, 9, 11, 9,
- 11, 15, 13, 11, 9, 7, 0, 2
-};
+ static const short _tsip_machine_parser_headers_trans_keys[] = {
+ 33, 37, 39, 65, 67, 68, 69, 70,
+ 72, 73, 74, 77, 79, 80, 82, 83,
+ 84, 85, 86, 87, 97, 98, 99, 100,
+ 101, 102, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 114, 115, 116, 117, 118,
+ 119, 120, 121, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 67, 76, 85, 99, 108, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 67,
+ 69, 76, 82, 99, 101, 108, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 67, 99, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 71, 103, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 85, 117, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 80, 112,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 89, 121, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 76, 101, 108, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 70, 102, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 87, 119, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 86, 118, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 79, 101, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 90, 122, 126, 42, 43,
+ 45, 46, 48, 57, 65, 89, 95, 121,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 65, 79, 83, 97, 111, 115, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 76, 108, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 76, 108, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 78, 100, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 69, 97, 101, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 67, 99, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 68, 69, 76, 84, 100, 101, 108,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 67,
+ 99, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 68, 100, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 65, 69, 97,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 85, 117, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 71, 103, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 89, 121, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 81, 113, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 82, 86, 88, 114,
+ 118, 120, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 80, 112, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 77, 109, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 89, 121, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 68, 78, 100,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 89, 121, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 70, 102,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 95, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 96, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 76, 108, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 89, 121,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 65, 73, 97, 105, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 88, 120,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 70, 102, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 87, 119, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 77, 78,
+ 109, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 86,
+ 118, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 83, 101, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 88, 120,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 80, 112, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 78, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 90, 122, 126, 42, 43, 45,
+ 46, 48, 57, 65, 89, 95, 121, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 45,
+ 46, 58, 65, 82, 97, 114, 126, 42,
+ 43, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 67, 68,
+ 69, 77, 80, 85, 86, 97, 99, 100,
+ 101, 109, 112, 117, 118, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 67, 78,
+ 83, 99, 110, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 87, 119, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 75, 107, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 70, 102,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 79, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 87, 119, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 79, 101, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 68, 100, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 89, 121, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 97, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 68, 100, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 85, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 65, 72, 97, 104, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 76, 108,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 76, 108, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 89,
+ 121, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 68, 100,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 71, 103, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 71, 103, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 70, 86, 102, 118, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 68, 100,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 68, 100, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 66, 76, 79, 82,
+ 84, 98, 108, 111, 114, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 76, 108, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 76, 108, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 70, 102, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 80, 112, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 80, 112, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 89, 121,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 68, 100, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 76, 108, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 89, 121, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 77, 109, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 85, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 84,
+ 116, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 72, 104, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 90, 122,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 89, 95, 121, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 79, 101, 111, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 70, 102, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 68, 100, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 89, 121, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 70, 102, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 76, 108, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 75, 107, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 89, 121,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 66, 98, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 83, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 100, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 87,
+ 119, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 75, 107, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 73, 79, 105, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 79, 86, 111,
+ 118, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 89, 121, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 65, 97, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 89, 121, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 88,
+ 120, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 89, 121, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 82,
+ 97, 114, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 85, 117, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 72, 104, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 79, 101, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 90, 122, 126, 42, 43, 45, 46, 48,
+ 57, 65, 89, 95, 121, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 110, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 81, 113, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 85, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 69, 101, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 58, 9, 13,
+ 32, 13, 10, 10, 9, 32, 9, 32,
+ 33, 37, 39, 58, 65, 69, 79, 83,
+ 97, 101, 111, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 75, 107, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 65,
+ 67, 70, 74, 80, 81, 83, 84, 97,
+ 99, 102, 106, 112, 113, 115, 116, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 83, 115, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 79, 111, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 114, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 68, 100, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 82, 114, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 82, 114, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 84, 115, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 85, 117, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 66, 98, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 45, 46,
+ 58, 126, 42, 43, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 66, 98, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 89, 121, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 67, 99, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 76, 108, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 89, 97, 121, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 67, 99, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 79, 111,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 73, 101, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 83, 115, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 73, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 85, 117,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 67, 99, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 45, 46, 58, 126, 42, 43, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 80, 112, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 73, 105, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 79, 111, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 89, 121, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 58, 9, 13, 32, 13, 10, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 89, 121, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 70, 102, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 81, 113, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 69, 73, 85, 101, 105, 117, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 67, 82, 83, 99, 114, 115,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 84, 116, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 89, 121, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 45,
+ 46, 58, 126, 42, 43, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 83, 86, 99, 115, 118, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 76, 108, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 78, 110, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 86, 118, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 70,
+ 102, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 89, 121, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 58, 9, 13, 32, 13, 10,
+ 10, 9, 32, 9, 32, 33, 37, 39,
+ 58, 86, 118, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 73, 101, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 67, 99, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 79, 111, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 85, 117, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 78, 110, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 88, 120, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 83, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 45, 46, 58, 126, 42, 43,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 73, 101, 105,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 65, 97, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 71,
+ 103, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 70, 102,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 77, 109, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 67, 99, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 72, 104,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 66, 80, 98,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 74, 83, 106, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 67, 99, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 67, 99, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 82, 114, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 73,
+ 105, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 80, 112, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 45, 46, 58, 126, 42, 43, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 83, 115, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 84, 116, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 97, 126, 42, 43, 45, 46, 48,
+ 57, 66, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 79, 111, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 82, 114, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 69, 101, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 68, 100, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 58, 9, 13, 32,
+ 13, 10, 10, 9, 32, 9, 32, 33,
+ 37, 39, 58, 65, 73, 79, 97, 105,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 66, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 82, 114, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 71, 103, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 84, 116, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 45, 46, 58,
+ 126, 42, 43, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 73, 105, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 76, 108, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 71, 103,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 58, 9,
+ 13, 32, 13, 10, 10, 9, 32, 9,
+ 32, 33, 37, 39, 58, 77, 109, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 69, 101, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 84, 116,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 77, 109, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 80,
+ 112, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 78, 83, 110, 115, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 83,
+ 115, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 85, 117, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 80, 112, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 80, 112, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 79, 111, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 82, 114,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 69, 101, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 68,
+ 100, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 13, 32, 13, 10, 10, 9, 32,
+ 9, 32, 33, 37, 39, 58, 69, 101,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 82, 114, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 45, 46, 58, 126, 42,
+ 43, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 71, 103, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 69, 101, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 78, 110,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 84, 116, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 58, 9, 13, 32, 13, 10, 10,
+ 9, 32, 9, 32, 33, 37, 39, 58,
+ 73, 105, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 65, 97, 126, 42, 43,
+ 45, 46, 48, 57, 66, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 65, 87, 97, 119, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 78, 110, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 73, 105, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 78, 110, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 71, 103, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 58, 9, 13, 32, 13,
+ 10, 10, 9, 32, 9, 32, 33, 37,
+ 39, 58, 87, 119, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 45, 46, 58, 126,
+ 42, 43, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 97,
+ 126, 42, 43, 45, 46, 48, 57, 66,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 85, 117, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 72,
+ 104, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 69, 101, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 78, 110, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 84, 116, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 33,
+ 37, 39, 58, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 67, 99,
+ 126, 42, 43, 45, 46, 48, 57, 65,
+ 90, 95, 122, 9, 32, 33, 37, 39,
+ 58, 65, 97, 126, 42, 43, 45, 46,
+ 48, 57, 66, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 84, 116, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 69,
+ 101, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 126, 42, 43, 45, 46, 48,
+ 57, 65, 90, 95, 122, 9, 32, 58,
+ 9, 32, 269, 525, -128, 12, 14, 127,
+ 269, 525, -128, 12, 14, 127, 10, 269,
+ 525, -128, 12, 14, 127, 269, 525, -128,
+ 12, 14, 127, 522, 266, 522, 10, 9,
+ 32, 9, 32, 33, 37, 39, 58, 67,
+ 76, 85, 99, 108, 117, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 9, 32, 33, 37, 39, 58, 65, 79,
+ 83, 97, 111, 115, 126, 42, 43, 45,
+ 46, 48, 57, 66, 90, 95, 122, 9,
+ 32, 33, 37, 39, 58, 65, 97, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 82, 86, 88, 114, 118, 120, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 82,
+ 114, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 68, 78, 100, 110, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 79,
+ 111, 126, 42, 43, 45, 46, 48, 57,
+ 65, 90, 95, 122, 9, 32, 33, 37,
+ 39, 58, 65, 73, 97, 105, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 65,
+ 69, 79, 83, 97, 101, 111, 115, 126,
+ 42, 43, 45, 46, 48, 57, 66, 90,
+ 95, 122, 9, 32, 33, 37, 39, 58,
+ 65, 73, 79, 97, 105, 111, 126, 42,
+ 43, 45, 46, 48, 57, 66, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 78,
+ 83, 110, 115, 126, 42, 43, 45, 46,
+ 48, 57, 65, 90, 95, 122, 9, 32,
+ 33, 37, 39, 58, 73, 105, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 9, 32, 33, 37, 39, 58, 126,
+ 42, 43, 45, 46, 48, 57, 65, 90,
+ 95, 122, 269, 525, -128, 12, 14, 127,
+ 0
+ };
-static const char _tsip_machine_parser_headers_range_lengths[] = {
- 0, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 4, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 4, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 4,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 4,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 4, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 4, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 4, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 5, 4, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 4, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 4, 5,
- 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 4, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 4, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 4, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 4, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 4, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 4, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 4,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 0, 0, 0, 0, 0, 0, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0,
- 5, 4, 5, 5, 5, 5, 5, 0,
- 0, 0, 0, 0, 0, 5, 4, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 4, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 4, 5,
- 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5,
- 5, 5, 5, 0, 0, 0, 0, 0,
- 0, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 2, 2, 2, 2, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 2
-};
+ static const char _tsip_machine_parser_headers_single_lengths[] = {
+ 0, 44, 7, 3, 3, 1, 1, 1,
+ 2, 13, 9, 9, 9, 9, 9, 3,
+ 3, 1, 1, 1, 2, 15, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 11, 9,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 11, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 13, 9, 9, 9, 9, 11,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 11, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 15,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 11,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 13, 9, 9,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 11,
+ 9, 9, 9, 9, 9, 9, 9, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 8, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 11, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 11, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 11, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 13, 23,
+ 13, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 11, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 11, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 9, 11, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 17, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 11, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 11, 11, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 11, 9, 9,
+ 9, 11, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 15, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 23, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 11, 11, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 11, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 11, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 7, 3, 3, 1, 1,
+ 1, 2, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 7, 3, 3, 1, 1, 1, 2, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 13, 3, 3, 1, 1, 1, 2,
+ 13, 9, 9, 9, 9, 9, 9, 13,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 11, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 7, 3, 3, 1, 1, 1, 2,
+ 9, 9, 11, 9, 9, 9, 7, 3,
+ 3, 1, 1, 1, 2, 9, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 11, 11, 9, 9, 9,
+ 7, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 13, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 3, 1, 1, 1, 2, 9, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 7, 3, 3, 1,
+ 1, 1, 2, 11, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 9, 9, 9, 9,
+ 9, 9, 9, 9, 7, 3, 3, 1,
+ 1, 1, 2, 9, 9, 7, 3, 3,
+ 1, 1, 1, 2, 11, 9, 9, 9,
+ 9, 9, 7, 3, 3, 1, 1, 1,
+ 2, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 7,
+ 3, 4, 2, 3, 2, 1, 2, 1,
+ 2, 13, 13, 9, 13, 9, 11, 9,
+ 11, 15, 13, 11, 9, 7, 0, 2
+ };
-static const short _tsip_machine_parser_headers_index_offsets[] = {
- 0, 0, 50, 63, 67, 71, 73, 75,
- 77, 80, 99, 114, 129, 144, 159, 173,
- 177, 181, 183, 185, 187, 190, 211, 226,
- 241, 256, 271, 286, 301, 314, 318, 322,
- 324, 326, 328, 331, 346, 361, 376, 391,
- 406, 421, 436, 449, 453, 457, 459, 461,
- 463, 466, 481, 496, 511, 526, 541, 556,
- 571, 584, 588, 592, 594, 596, 598, 601,
- 616, 631, 646, 661, 676, 691, 706, 720,
- 735, 750, 765, 780, 795, 810, 825, 840,
- 853, 857, 861, 863, 865, 867, 870, 887,
- 902, 917, 931, 946, 961, 976, 991, 1004,
- 1008, 1012, 1014, 1016, 1018, 1021, 1036, 1051,
- 1065, 1069, 1073, 1075, 1077, 1079, 1082, 1097,
- 1112, 1127, 1142, 1157, 1172, 1185, 1189, 1193,
- 1195, 1197, 1199, 1202, 1217, 1232, 1249, 1264,
- 1279, 1294, 1309, 1324, 1339, 1354, 1369, 1384,
- 1398, 1413, 1428, 1443, 1458, 1471, 1475, 1479,
- 1481, 1483, 1485, 1488, 1503, 1518, 1533, 1548,
- 1563, 1578, 1593, 1608, 1621, 1625, 1629, 1631,
- 1633, 1635, 1638, 1657, 1672, 1687, 1701, 1716,
- 1733, 1746, 1750, 1754, 1756, 1758, 1760, 1763,
- 1778, 1793, 1806, 1810, 1814, 1816, 1818, 1820,
- 1823, 1838, 1853, 1870, 1885, 1900, 1913, 1917,
- 1921, 1923, 1925, 1927, 1930, 1945, 1960, 1974,
- 1995, 2010, 2025, 2040, 2055, 2070, 2085, 2100,
- 2115, 2130, 2145, 2158, 2162, 2166, 2168, 2170,
- 2172, 2175, 2190, 2205, 2220, 2235, 2250, 2265,
- 2280, 2293, 2297, 2301, 2303, 2305, 2307, 2310,
- 2327, 2342, 2357, 2372, 2387, 2402, 2417, 2430,
- 2434, 2438, 2440, 2442, 2444, 2447, 2462, 2477,
- 2492, 2507, 2520, 2524, 2528, 2530, 2532, 2534,
- 2537, 2552, 2567, 2582, 2595, 2599, 2603, 2605,
- 2607, 2609, 2612, 2627, 2642, 2655, 2659, 2663,
- 2665, 2667, 2669, 2672, 2687, 2702, 2717, 2730,
- 2734, 2738, 2740, 2742, 2744, 2747, 2766, 2781,
- 2796, 2811, 2825, 2840, 2855, 2870, 2885, 2898,
- 2902, 2906, 2908, 2910, 2912, 2915, 2930, 2945,
- 2960, 2973, 2977, 2981, 2983, 2985, 2987, 2990,
- 3005, 3020, 3035, 3050, 3065, 3078, 3082, 3086,
- 3088, 3090, 3092, 3095, 3110, 3125, 3140, 3153,
- 3157, 3161, 3163, 3165, 3167, 3170, 3185, 3200,
- 3215, 3230, 3245, 3260, 3274, 3289, 3304, 3319,
- 3334, 3347, 3351, 3355, 3357, 3359, 3361, 3364,
- 3381, 3396, 3411, 3426, 3441, 3456, 3471, 3485,
- 3489, 3493, 3495, 3497, 3499, 3502, 3517, 3532,
- 3547, 3562, 3575, 3579, 3583, 3585, 3587, 3589,
- 3592, 3606, 3621, 3636, 3651, 3666, 3681, 3695,
- 3710, 3725, 3738, 3742, 3746, 3748, 3750, 3752,
- 3755, 3770, 3785, 3800, 3813, 3817, 3821, 3823,
- 3825, 3827, 3830, 3847, 3862, 3876, 3891, 3906,
- 3921, 3936, 3951, 3966, 3981, 3996, 4009, 4013,
- 4017, 4019, 4021, 4023, 4026, 4043, 4058, 4072,
- 4087, 4102, 4117, 4132, 4147, 4162, 4177, 4190,
- 4194, 4198, 4200, 4202, 4204, 4207, 4221, 4238,
- 4253, 4268, 4283, 4298, 4313, 4328, 4341, 4345,
- 4349, 4351, 4353, 4355, 4358, 4373, 4386, 4390,
- 4394, 4396, 4398, 4400, 4403, 4418, 4433, 4448,
- 4463, 4478, 4493, 4508, 4523, 4538, 4553, 4568,
- 4581, 4585, 4589, 4591, 4593, 4595, 4598, 4616,
- 4645, 4664, 4679, 4694, 4709, 4724, 4738, 4753,
- 4768, 4783, 4798, 4813, 4828, 4843, 4857, 4872,
- 4887, 4902, 4917, 4930, 4934, 4938, 4940, 4942,
- 4944, 4947, 4962, 4977, 4992, 5007, 5021, 5036,
- 5051, 5066, 5081, 5096, 5109, 5113, 5117, 5119,
- 5121, 5123, 5126, 5141, 5158, 5173, 5188, 5203,
- 5218, 5232, 5247, 5262, 5277, 5292, 5307, 5322,
- 5337, 5352, 5365, 5369, 5373, 5375, 5377, 5379,
- 5382, 5397, 5412, 5427, 5442, 5457, 5472, 5486,
- 5501, 5516, 5531, 5544, 5548, 5552, 5554, 5556,
- 5558, 5561, 5578, 5593, 5608, 5623, 5638, 5652,
- 5667, 5682, 5697, 5712, 5727, 5741, 5756, 5771,
- 5784, 5788, 5792, 5794, 5796, 5798, 5801, 5816,
- 5831, 5846, 5861, 5876, 5891, 5905, 5922, 5937,
- 5952, 5967, 5982, 5997, 6012, 6027, 6041, 6056,
- 6071, 6086, 6101, 6116, 6131, 6146, 6161, 6176,
- 6189, 6193, 6197, 6199, 6201, 6203, 6206, 6221,
- 6236, 6251, 6266, 6281, 6294, 6298, 6302, 6304,
- 6306, 6308, 6311, 6326, 6341, 6355, 6378, 6393,
- 6408, 6423, 6438, 6453, 6468, 6482, 6497, 6512,
- 6527, 6542, 6555, 6559, 6563, 6565, 6567, 6569,
- 6572, 6587, 6602, 6617, 6630, 6634, 6638, 6640,
- 6642, 6644, 6647, 6662, 6677, 6692, 6705, 6709,
- 6713, 6715, 6717, 6719, 6722, 6737, 6752, 6767,
- 6782, 6797, 6812, 6827, 6840, 6844, 6848, 6850,
- 6852, 6854, 6857, 6872, 6887, 6902, 6917, 6931,
- 6946, 6961, 6976, 6991, 7006, 7020, 7035, 7050,
- 7063, 7067, 7071, 7073, 7075, 7077, 7080, 7095,
- 7110, 7125, 7140, 7154, 7169, 7184, 7199, 7214,
- 7229, 7242, 7246, 7250, 7252, 7254, 7256, 7259,
- 7274, 7289, 7304, 7319, 7333, 7348, 7363, 7378,
- 7393, 7408, 7423, 7438, 7453, 7468, 7483, 7498,
- 7513, 7528, 7541, 7545, 7549, 7551, 7553, 7555,
- 7558, 7573, 7590, 7605, 7620, 7635, 7650, 7665,
- 7680, 7694, 7709, 7724, 7739, 7754, 7769, 7784,
- 7799, 7814, 7827, 7831, 7835, 7837, 7839, 7841,
- 7844, 7859, 7874, 7889, 7904, 7918, 7933, 7948,
- 7963, 7976, 7980, 7984, 7986, 7988, 7990, 7993,
- 8008, 8023, 8038, 8052, 8067, 8082, 8097, 8112,
- 8127, 8142, 8157, 8172, 8185, 8189, 8193, 8195,
- 8197, 8199, 8202, 8217, 8232, 8247, 8262, 8277,
- 8292, 8306, 8321, 8336, 8351, 8366, 8381, 8396,
- 8411, 8425, 8440, 8455, 8468, 8472, 8476, 8478,
- 8480, 8482, 8485, 8500, 8515, 8528, 8532, 8536,
- 8538, 8540, 8542, 8545, 8562, 8579, 8594, 8609,
- 8624, 8639, 8652, 8656, 8660, 8662, 8664, 8666,
- 8669, 8684, 8699, 8714, 8727, 8731, 8735, 8737,
- 8739, 8741, 8744, 8759, 8774, 8788, 8805, 8820,
- 8835, 8850, 8867, 8882, 8897, 8912, 8927, 8942,
- 8957, 8972, 8985, 8989, 8993, 8995, 8997, 8999,
- 9002, 9017, 9032, 9047, 9062, 9077, 9092, 9107,
- 9122, 9135, 9139, 9143, 9145, 9147, 9149, 9152,
- 9167, 9182, 9197, 9212, 9227, 9242, 9255, 9259,
- 9263, 9265, 9267, 9269, 9272, 9293, 9308, 9323,
- 9336, 9340, 9344, 9346, 9348, 9350, 9353, 9382,
- 9397, 9412, 9427, 9440, 9444, 9448, 9450, 9452,
- 9454, 9457, 9472, 9487, 9502, 9516, 9531, 9546,
- 9561, 9576, 9591, 9604, 9608, 9612, 9614, 9616,
- 9618, 9621, 9636, 9651, 9667, 9684, 9699, 9714,
- 9727, 9731, 9735, 9737, 9739, 9741, 9744, 9759,
- 9772, 9776, 9780, 9782, 9784, 9786, 9789, 9804,
- 9819, 9833, 9848, 9863, 9876, 9880, 9884, 9886,
- 9888, 9890, 9893, 9908, 9923, 9938, 9952, 9967,
- 9982, 9997, 10012, 10027, 10042, 10057, 10070, 10074,
- 10078, 10080, 10082, 10084, 10087, 10102, 10119, 10134,
- 10149, 10164, 10177, 10181, 10185, 10187, 10189, 10191,
- 10194, 10208, 10223, 10238, 10251, 10255, 10259, 10261,
- 10263, 10265, 10268, 10283, 10300, 10315, 10330, 10344,
- 10359, 10374, 10389, 10404, 10419, 10434, 10449, 10464,
- 10479, 10494, 10509, 10522, 10526, 10530, 10532, 10534,
- 10536, 10539, 10554, 10569, 10582, 10586, 10590, 10592,
- 10594, 10596, 10599, 10614, 10629, 10644, 10659, 10674,
- 10688, 10703, 10718, 10733, 10748, 10763, 10778, 10793,
- 10808, 10821, 10825, 10829, 10831, 10833, 10835, 10838,
- 10853, 10868, 10882, 10897, 10912, 10927, 10942, 10957,
- 10970, 10974, 10978, 10980, 10982, 10984, 10987, 11002,
- 11017, 11032, 11045, 11049, 11053, 11055, 11057, 11059,
- 11062, 11077, 11092, 11105, 11109, 11113, 11115, 11117,
- 11119, 11122, 11141, 11145, 11149, 11151, 11153, 11155,
- 11158, 11177, 11192, 11207, 11222, 11237, 11252, 11266,
- 11285, 11300, 11315, 11330, 11345, 11360, 11373, 11377,
- 11381, 11383, 11385, 11387, 11390, 11405, 11420, 11435,
- 11450, 11465, 11478, 11482, 11486, 11488, 11490, 11492,
- 11495, 11510, 11525, 11540, 11555, 11570, 11583, 11587,
- 11591, 11593, 11595, 11597, 11600, 11615, 11632, 11647,
- 11660, 11664, 11668, 11670, 11672, 11674, 11677, 11692,
- 11707, 11721, 11736, 11751, 11766, 11781, 11796, 11809,
- 11813, 11817, 11819, 11821, 11823, 11826, 11841, 11856,
- 11871, 11886, 11900, 11915, 11930, 11945, 11960, 11975,
- 11990, 12005, 12018, 12022, 12026, 12028, 12030, 12032,
- 12035, 12050, 12064, 12081, 12096, 12111, 12126, 12139,
- 12143, 12147, 12149, 12151, 12153, 12156, 12171, 12185,
- 12200, 12215, 12230, 12245, 12260, 12273, 12277, 12281,
- 12283, 12285, 12287, 12290, 12307, 12324, 12339, 12354,
- 12369, 12382, 12397, 12412, 12427, 12442, 12457, 12472,
- 12487, 12502, 12516, 12531, 12546, 12561, 12576, 12591,
- 12604, 12608, 12612, 12614, 12616, 12618, 12621, 12636,
- 12651, 12666, 12681, 12696, 12711, 12724, 12728, 12732,
- 12734, 12736, 12738, 12741, 12760, 12775, 12790, 12805,
- 12820, 12834, 12849, 12864, 12879, 12894, 12909, 12924,
- 12937, 12941, 12945, 12947, 12949, 12951, 12954, 12969,
- 12984, 12999, 13014, 13029, 13044, 13059, 13072, 13076,
- 13080, 13082, 13084, 13086, 13089, 13102, 13106, 13110,
- 13112, 13114, 13116, 13119, 13136, 13151, 13166, 13181,
- 13196, 13211, 13226, 13241, 13256, 13271, 13284, 13288,
- 13292, 13294, 13296, 13298, 13301, 13316, 13331, 13345,
- 13360, 13375, 13390, 13405, 13420, 13433, 13437, 13441,
- 13443, 13445, 13447, 13450, 13465, 13480, 13493, 13497,
- 13501, 13503, 13505, 13507, 13510, 13527, 13542, 13557,
- 13572, 13587, 13602, 13615, 13619, 13623, 13625, 13627,
- 13629, 13632, 13647, 13661, 13676, 13691, 13706, 13721,
- 13736, 13751, 13766, 13781, 13796, 13811, 13826, 13841,
- 13854, 13858, 13865, 13870, 13876, 13881, 13883, 13886,
- 13888, 13891, 13910, 13929, 13944, 13963, 13978, 13995,
- 14010, 14027, 14048, 14067, 14084, 14099, 14112, 14113
-};
+ static const char _tsip_machine_parser_headers_range_lengths[] = {
+ 0, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 4, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 4, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 4,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 4,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 4, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 4, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 5, 4, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 4, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 4, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 4, 5,
+ 5, 5, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 4, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 4, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 4, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 4, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 4, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 4, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 4, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0,
+ 5, 4, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 5, 4, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 4, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 4, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 4, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 5, 4, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 2, 2, 2, 2, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 2
+ };
-static const short _tsip_machine_parser_headers_indicies[] = {
- 0, 0, 0, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 7, 25, 26, 27, 28, 29,
- 30, 11, 12, 31, 14, 32, 33, 34,
- 18, 35, 36, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 38, 1, 38, 40, 38, 39, 41,
- 39, 42, 1, 43, 1, 39, 39, 1,
- 37, 37, 0, 0, 0, 38, 44, 45,
- 46, 44, 45, 46, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 47, 47, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 48, 48, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 49,
- 49, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 50, 50,
- 0, 0, 0, 0, 0, 0, 1, 51,
- 51, 0, 0, 0, 52, 0, 53, 0,
- 0, 0, 0, 0, 1, 51, 51, 53,
- 1, 53, 55, 53, 54, 56, 54, 57,
- 1, 58, 1, 54, 54, 1, 37, 37,
- 0, 0, 0, 38, 59, 60, 61, 62,
- 59, 60, 61, 62, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 63, 63, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 64, 64, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 65,
- 65, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 66, 66,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 67, 67, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 68, 68, 0, 0,
- 0, 0, 0, 0, 1, 69, 69, 0,
- 0, 0, 70, 0, 0, 0, 0, 0,
- 0, 1, 69, 69, 70, 1, 70, 72,
- 70, 71, 73, 71, 74, 1, 75, 1,
- 71, 71, 1, 37, 37, 0, 0, 0,
- 38, 76, 76, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 77, 77, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 78,
- 78, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 79, 79,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 80, 80, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 81, 81, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 82, 82, 0, 0, 0,
- 0, 0, 0, 1, 83, 83, 0, 0,
- 0, 84, 0, 0, 0, 0, 0, 0,
- 1, 83, 83, 84, 1, 84, 86, 84,
- 85, 87, 85, 88, 1, 89, 1, 85,
- 85, 1, 37, 37, 0, 0, 0, 38,
- 90, 90, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 91,
- 91, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 92, 92,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 93, 93, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 94, 94, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 95, 95, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 96, 96, 0, 0, 0, 0,
- 0, 0, 1, 97, 97, 0, 0, 0,
- 98, 0, 0, 0, 0, 0, 0, 1,
- 97, 97, 98, 1, 98, 100, 98, 99,
- 101, 99, 102, 1, 103, 1, 99, 99,
- 1, 37, 37, 0, 0, 0, 38, 104,
- 104, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 105, 105,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 106, 106, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 107, 107, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 108, 108, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 109, 109, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 110, 110, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 111,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 112, 112,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 113, 113, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 114, 114, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 115, 115, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 116, 116, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 117, 117, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 118, 118, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 119,
- 119, 0, 0, 0, 0, 0, 0, 1,
- 120, 120, 0, 0, 0, 121, 0, 0,
- 0, 0, 0, 0, 1, 120, 120, 121,
- 1, 121, 123, 121, 122, 124, 122, 125,
- 1, 126, 1, 122, 122, 1, 37, 37,
- 0, 0, 0, 38, 127, 128, 127, 128,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 129, 129, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 130, 130, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 131, 0, 38, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 132, 132, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 133, 133, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 134,
- 134, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 135, 135,
- 0, 0, 0, 0, 0, 0, 1, 136,
- 136, 0, 0, 0, 137, 0, 0, 0,
- 0, 0, 0, 1, 136, 136, 137, 1,
- 137, 139, 137, 138, 140, 138, 141, 1,
- 142, 1, 138, 138, 1, 37, 37, 0,
- 0, 0, 38, 143, 143, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 144, 144, 0, 0, 0, 0,
- 0, 0, 1, 145, 145, 0, 0, 0,
- 146, 0, 147, 0, 0, 0, 0, 0,
- 1, 145, 145, 147, 1, 147, 149, 147,
- 148, 150, 148, 151, 1, 152, 1, 148,
- 148, 1, 37, 37, 0, 0, 0, 38,
- 153, 153, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 154,
- 154, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 155, 155,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 156, 156, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 157, 157, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 158, 158, 0, 0, 0,
- 0, 0, 0, 1, 159, 159, 0, 0,
- 0, 160, 0, 0, 0, 0, 0, 0,
- 1, 159, 159, 160, 1, 160, 162, 160,
- 161, 163, 161, 164, 1, 165, 1, 161,
- 161, 1, 37, 37, 0, 0, 0, 38,
- 166, 166, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 167,
- 167, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 168, 169,
- 168, 169, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 170,
- 170, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 171, 171,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 172, 172, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 173, 173, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 174, 174, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 175, 175, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 176, 176, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 177, 177, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 178,
- 178, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 179, 0, 38,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 180, 180, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 181, 181, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 182, 182, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 183, 183, 0, 0, 0, 0, 0,
- 0, 1, 184, 184, 0, 0, 0, 185,
- 0, 0, 0, 0, 0, 0, 1, 184,
- 184, 185, 1, 185, 187, 185, 186, 188,
- 186, 189, 1, 190, 1, 186, 186, 1,
- 37, 37, 0, 0, 0, 38, 191, 191,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 192, 192, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 193, 193, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 194, 194, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 195, 195, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 196, 196, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 197, 197, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 198,
- 198, 0, 0, 0, 0, 0, 0, 1,
- 199, 199, 0, 0, 0, 200, 0, 0,
- 0, 0, 0, 0, 1, 199, 199, 200,
- 1, 200, 202, 200, 201, 203, 201, 204,
- 1, 205, 1, 201, 201, 1, 37, 37,
- 0, 0, 0, 38, 206, 207, 208, 206,
- 207, 208, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 209,
- 209, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 210, 210,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 211, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 212, 212, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 213, 214, 213, 214, 0, 0,
- 0, 0, 0, 0, 1, 215, 215, 0,
- 0, 0, 216, 0, 0, 0, 0, 0,
- 0, 1, 215, 215, 216, 1, 216, 218,
- 216, 217, 219, 217, 220, 1, 221, 1,
- 217, 217, 1, 37, 37, 0, 0, 0,
- 38, 222, 222, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 223, 223, 0, 0, 0, 0, 0, 0,
- 1, 224, 224, 0, 0, 0, 225, 0,
- 0, 0, 0, 0, 0, 1, 224, 224,
- 225, 1, 225, 227, 225, 226, 228, 226,
- 229, 1, 230, 1, 226, 226, 1, 37,
- 37, 0, 0, 0, 38, 231, 231, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 232, 232, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 233, 234, 233, 234, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 235, 235, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 236, 236, 0, 0, 0,
- 0, 0, 0, 1, 237, 237, 0, 0,
- 0, 238, 0, 0, 0, 0, 0, 0,
- 1, 237, 237, 238, 1, 238, 240, 238,
- 239, 241, 239, 242, 1, 243, 1, 239,
- 239, 1, 37, 37, 0, 0, 0, 38,
- 244, 244, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 245,
- 245, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 246, 0, 38,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 247, 248, 249, 250,
- 247, 248, 249, 250, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 251, 251, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 252, 252, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 253,
- 253, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 254, 254,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 255, 255, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 256, 256, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 257, 257, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 258, 258, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 259, 259, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 260, 260, 0, 0, 0, 0, 0, 0,
- 1, 261, 261, 0, 0, 0, 262, 0,
- 0, 0, 0, 0, 0, 1, 261, 261,
- 262, 1, 262, 264, 262, 263, 265, 263,
- 266, 1, 267, 1, 263, 263, 1, 37,
- 37, 0, 0, 0, 38, 268, 268, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 269, 269, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 270, 270, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 271, 271, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 272, 272, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 273, 273, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 274,
- 274, 0, 0, 0, 0, 0, 0, 1,
- 275, 275, 0, 0, 0, 276, 0, 0,
- 0, 0, 0, 0, 1, 275, 275, 276,
- 1, 276, 278, 276, 277, 279, 277, 280,
- 1, 281, 1, 277, 277, 1, 37, 37,
- 0, 0, 0, 38, 282, 283, 282, 283,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 284, 284, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 285, 285, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 286, 286, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 287, 287, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 288, 288, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 289, 289, 0, 0, 0, 0, 0, 0,
- 1, 290, 290, 0, 0, 0, 291, 0,
- 0, 0, 0, 0, 0, 1, 290, 290,
- 291, 1, 291, 293, 291, 292, 294, 292,
- 295, 1, 296, 1, 292, 292, 1, 37,
- 37, 0, 0, 0, 38, 297, 297, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 298, 298, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 299, 299, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 28, 28, 0, 0, 0, 0,
- 0, 0, 1, 300, 300, 0, 0, 0,
- 301, 0, 0, 0, 0, 0, 0, 1,
- 300, 300, 301, 1, 301, 303, 301, 302,
- 304, 302, 305, 1, 306, 1, 302, 302,
- 1, 37, 37, 0, 0, 0, 38, 307,
- 307, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 308, 308,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 309, 309, 0,
- 0, 0, 0, 0, 0, 1, 310, 310,
- 0, 0, 0, 311, 0, 0, 0, 0,
- 0, 0, 1, 310, 310, 311, 1, 311,
- 313, 311, 312, 314, 312, 315, 1, 316,
- 1, 312, 312, 1, 37, 37, 0, 0,
- 0, 38, 317, 317, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 318, 318, 0, 0, 0, 0, 0,
- 0, 1, 319, 319, 0, 0, 0, 320,
- 0, 0, 0, 0, 0, 0, 1, 319,
- 319, 320, 1, 320, 322, 320, 321, 323,
- 321, 324, 1, 325, 1, 321, 321, 1,
- 37, 37, 0, 0, 0, 38, 326, 326,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 327, 327, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 328, 328, 0, 0,
- 0, 0, 0, 0, 1, 329, 329, 0,
- 0, 0, 330, 0, 0, 0, 0, 0,
- 0, 1, 329, 329, 330, 1, 330, 332,
- 330, 331, 333, 331, 334, 1, 335, 1,
- 331, 331, 1, 37, 37, 0, 0, 0,
- 38, 336, 337, 338, 336, 337, 338, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 339, 339, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 340, 340, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 341, 341, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 342, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 343,
- 343, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 344, 344,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 345, 345, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 346, 346, 0, 0,
- 0, 0, 0, 0, 1, 347, 347, 0,
- 0, 0, 348, 0, 0, 0, 0, 0,
- 0, 1, 347, 347, 348, 1, 348, 350,
- 348, 349, 351, 349, 352, 1, 353, 1,
- 349, 349, 1, 37, 37, 0, 0, 0,
- 38, 354, 354, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 355, 355, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 356,
- 356, 0, 0, 0, 0, 0, 0, 1,
- 357, 357, 0, 0, 0, 358, 0, 0,
- 0, 0, 0, 0, 1, 357, 357, 358,
- 1, 358, 360, 358, 359, 361, 359, 362,
- 1, 363, 1, 359, 359, 1, 37, 37,
- 0, 0, 0, 38, 364, 364, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 365, 365, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 366, 366, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 367, 367, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 368, 368, 0, 0, 0, 0, 0, 0,
- 1, 369, 369, 0, 0, 0, 370, 0,
- 0, 0, 0, 0, 0, 1, 369, 369,
- 370, 1, 370, 372, 370, 371, 373, 371,
- 374, 1, 375, 1, 371, 371, 1, 37,
- 37, 0, 0, 0, 38, 376, 376, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 377, 377, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 378, 378, 0, 0, 0,
- 0, 0, 0, 1, 379, 379, 0, 0,
- 0, 380, 0, 0, 0, 0, 0, 0,
- 1, 379, 379, 380, 1, 380, 382, 380,
- 381, 383, 381, 384, 1, 385, 1, 381,
- 381, 1, 37, 37, 0, 0, 0, 38,
- 386, 386, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 387,
- 387, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 388, 388,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 389, 389, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 390, 390, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 391, 391, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 392, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 393, 393, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 394,
- 394, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 395, 395,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 396, 396, 0,
- 0, 0, 0, 0, 0, 1, 397, 397,
- 0, 0, 0, 398, 0, 0, 0, 0,
- 0, 0, 1, 397, 397, 398, 1, 398,
- 400, 398, 399, 401, 399, 402, 1, 403,
- 1, 399, 399, 1, 37, 37, 0, 0,
- 0, 38, 404, 405, 404, 405, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 406, 406, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 407, 407, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 408, 408, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 409, 409, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 410,
- 410, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 411, 411,
- 0, 0, 0, 0, 0, 0, 1, 412,
- 412, 0, 0, 0, 413, 0, 414, 0,
- 0, 0, 0, 0, 1, 412, 412, 414,
- 1, 414, 416, 414, 415, 417, 415, 418,
- 1, 419, 1, 415, 415, 1, 37, 37,
- 0, 0, 0, 38, 420, 420, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 421, 421, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 422, 422, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 30, 30, 0, 0, 0, 0, 0,
- 0, 1, 423, 423, 0, 0, 0, 424,
- 0, 0, 0, 0, 0, 0, 1, 423,
- 423, 424, 1, 424, 426, 424, 425, 427,
- 425, 428, 1, 429, 1, 425, 425, 1,
- 37, 37, 0, 0, 0, 38, 430, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 431, 431, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 432, 432, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 433, 433, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 434, 434, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 435, 435, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 436, 0,
- 38, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 437, 437, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 438, 438, 0, 0,
- 0, 0, 0, 0, 1, 439, 439, 0,
- 0, 0, 440, 0, 0, 0, 0, 0,
- 0, 1, 439, 439, 440, 1, 440, 442,
- 440, 441, 443, 441, 444, 1, 445, 1,
- 441, 441, 1, 37, 37, 0, 0, 0,
- 38, 446, 446, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 447, 447, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 448,
- 448, 0, 0, 0, 0, 0, 0, 1,
- 449, 449, 0, 0, 0, 450, 0, 0,
- 0, 0, 0, 0, 1, 449, 449, 450,
- 1, 450, 452, 450, 451, 453, 451, 454,
- 1, 455, 1, 451, 451, 1, 37, 37,
- 0, 0, 0, 38, 456, 457, 456, 457,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 458, 458, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 459, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 460, 460, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 461, 461, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 462, 462, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 463,
- 463, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 464, 464,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 465, 465, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 466, 466, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 467, 467, 0, 0, 0,
- 0, 0, 0, 1, 468, 468, 0, 0,
- 0, 469, 0, 0, 0, 0, 0, 0,
- 1, 468, 468, 469, 1, 469, 471, 469,
- 470, 472, 470, 473, 1, 474, 1, 470,
- 470, 1, 37, 37, 0, 0, 0, 38,
- 475, 476, 475, 476, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 477, 477, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 478,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 479, 479,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 480, 480, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 481, 481, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 482, 482, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 483, 483, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 484, 484, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 485, 485, 0, 0, 0, 0, 0, 0,
- 1, 486, 486, 0, 0, 0, 487, 0,
- 0, 0, 0, 0, 0, 1, 486, 486,
- 487, 1, 487, 489, 487, 488, 490, 488,
- 491, 1, 492, 1, 488, 488, 1, 37,
- 37, 0, 0, 0, 493, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 494, 495, 494, 495, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 496, 496, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 497, 497, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 498, 498, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 499, 499, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 500, 500, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 501,
- 501, 0, 0, 0, 0, 0, 0, 1,
- 502, 502, 0, 0, 0, 503, 0, 0,
- 0, 0, 0, 0, 1, 502, 502, 503,
- 1, 503, 505, 503, 504, 506, 504, 507,
- 1, 508, 1, 504, 504, 1, 37, 37,
- 0, 0, 0, 38, 509, 509, 0, 0,
- 0, 0, 0, 0, 1, 510, 510, 0,
- 0, 0, 511, 0, 0, 0, 0, 0,
- 0, 1, 510, 510, 511, 1, 511, 513,
- 511, 512, 514, 512, 515, 1, 516, 1,
- 512, 512, 1, 357, 357, 0, 0, 0,
- 358, 517, 517, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 518, 518, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 519,
- 519, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 520, 520,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 521, 521, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 522, 522, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 523, 523, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 524, 524, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 525, 525, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 526, 526, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 527,
- 527, 0, 0, 0, 0, 0, 0, 1,
- 528, 528, 0, 0, 0, 529, 0, 0,
- 0, 0, 0, 0, 1, 528, 528, 529,
- 1, 529, 531, 529, 530, 532, 530, 533,
- 1, 534, 1, 530, 530, 1, 37, 37,
- 0, 0, 0, 535, 0, 38, 536, 537,
- 536, 537, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 538, 539,
- 540, 541, 542, 543, 544, 545, 538, 539,
- 540, 541, 542, 543, 544, 545, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 546, 547, 548, 546, 547,
- 548, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 549, 549,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 550, 550, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 551, 551, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 552, 552, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 553, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 554, 554, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 555,
- 555, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 556, 556,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 557, 557, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 558, 558, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 559, 559, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 560, 560, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 561, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 562,
- 562, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 563, 563,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 564, 564, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 565, 565, 0, 0,
- 0, 0, 0, 0, 1, 566, 566, 0,
- 0, 0, 567, 0, 0, 0, 0, 0,
- 0, 1, 566, 566, 567, 1, 567, 569,
- 567, 568, 570, 568, 571, 1, 572, 1,
- 568, 568, 1, 37, 37, 0, 0, 0,
- 38, 573, 573, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 574, 574, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 575,
- 575, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 576, 576,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 577, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 578, 578, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 579, 579, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 580, 580, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 581, 581, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 582,
- 582, 0, 0, 0, 0, 0, 0, 1,
- 583, 583, 0, 0, 0, 584, 0, 0,
- 0, 0, 0, 0, 1, 583, 583, 584,
- 1, 584, 586, 584, 585, 587, 585, 588,
- 1, 589, 1, 585, 585, 1, 37, 37,
- 0, 0, 0, 38, 590, 590, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 591, 592, 591, 592, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 593, 593, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 594, 594, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 595, 595, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 596, 596, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 597,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 598, 598,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 599, 599, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 600, 600, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 601, 601, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 602, 602, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 603, 603, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 604, 604, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 605,
- 605, 0, 0, 0, 0, 0, 0, 1,
- 606, 606, 0, 0, 0, 607, 0, 0,
- 0, 0, 0, 0, 1, 606, 606, 607,
- 1, 607, 609, 607, 608, 610, 608, 611,
- 1, 612, 1, 608, 608, 1, 37, 37,
- 0, 0, 0, 38, 613, 613, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 614, 614, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 615, 615, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 616, 616, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 617, 617, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 618,
- 618, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 619, 0, 38,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 620, 620, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 621, 621, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 622, 622, 0, 0, 0, 0,
- 0, 0, 1, 623, 623, 0, 0, 0,
- 624, 0, 0, 0, 0, 0, 0, 1,
- 623, 623, 624, 1, 624, 626, 624, 625,
- 627, 625, 628, 1, 629, 1, 625, 625,
- 1, 37, 37, 0, 0, 0, 38, 630,
- 631, 630, 631, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 632, 632, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 633,
- 633, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 634, 634,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 635, 635, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 636, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 637, 637, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 638, 638, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 639, 639, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 640,
- 640, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 641, 641,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 642, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 643, 643, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 644, 644, 0, 0, 0, 0,
- 0, 0, 1, 645, 645, 0, 0, 0,
- 646, 0, 0, 0, 0, 0, 0, 1,
- 645, 645, 646, 1, 646, 648, 646, 647,
- 649, 647, 650, 1, 651, 1, 647, 647,
- 1, 37, 37, 0, 0, 0, 38, 652,
- 652, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 653, 653,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 654, 654, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 655, 655, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 656, 656, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 657, 657, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 658, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 659,
- 660, 659, 660, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 661, 661, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 662,
- 662, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 663, 663,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 664, 664, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 665, 665, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 666, 666, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 667, 667, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 668, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 669,
- 669, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 670, 670,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 671, 671, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 672, 672, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 673, 673, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 674, 674, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 675, 675, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 676, 676, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 677,
- 677, 0, 0, 0, 0, 0, 0, 1,
- 678, 678, 0, 0, 0, 679, 0, 0,
- 0, 0, 0, 0, 1, 678, 678, 679,
- 1, 679, 681, 679, 680, 682, 680, 683,
- 1, 684, 1, 680, 680, 1, 37, 37,
- 0, 0, 0, 38, 685, 685, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 686, 686, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 687, 687, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 688, 688, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 689, 689, 0, 0, 0, 0, 0, 0,
- 1, 690, 690, 0, 0, 0, 691, 0,
- 0, 0, 0, 0, 0, 1, 690, 690,
- 691, 1, 691, 693, 691, 692, 694, 692,
- 695, 1, 696, 1, 692, 692, 1, 37,
- 37, 0, 0, 0, 38, 697, 697, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 698, 698, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 699, 0, 38, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 700, 701, 702, 703, 704, 700, 701,
- 702, 703, 704, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 705, 705, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 706,
- 706, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 707, 707,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 708, 708, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 709, 709, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 710, 710, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 711, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 712, 712, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 713,
- 713, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 714, 714,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 715, 715, 0,
- 0, 0, 0, 0, 0, 1, 716, 716,
- 0, 0, 0, 717, 0, 0, 0, 0,
- 0, 0, 1, 716, 716, 717, 1, 717,
- 719, 717, 718, 720, 718, 721, 1, 722,
- 1, 718, 718, 1, 37, 37, 0, 0,
- 0, 38, 723, 723, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 724, 724, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 725, 725, 0, 0, 0, 0, 0, 0,
- 1, 726, 726, 0, 0, 0, 727, 0,
- 0, 0, 0, 0, 0, 1, 726, 726,
- 727, 1, 727, 729, 727, 728, 730, 728,
- 731, 1, 732, 1, 728, 728, 1, 37,
- 37, 0, 0, 0, 38, 733, 733, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 734, 734, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 735, 735, 0, 0, 0,
- 0, 0, 0, 1, 736, 736, 0, 0,
- 0, 737, 0, 0, 0, 0, 0, 0,
- 1, 736, 736, 737, 1, 737, 739, 737,
- 738, 740, 738, 741, 1, 742, 1, 738,
- 738, 1, 37, 37, 0, 0, 0, 38,
- 743, 743, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 744,
- 744, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 745, 745,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 746, 746, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 747, 747, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 748, 748, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 749, 749, 0, 0, 0, 0,
- 0, 0, 1, 750, 750, 0, 0, 0,
- 751, 0, 0, 0, 0, 0, 0, 1,
- 750, 750, 751, 1, 751, 753, 751, 752,
- 754, 752, 755, 1, 756, 1, 752, 752,
- 1, 37, 37, 0, 0, 0, 38, 757,
- 757, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 758, 758,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 759, 759, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 760, 760, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 761, 0, 38, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 762, 762, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 763, 763, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 764,
- 764, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 765, 765,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 766, 766, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 767, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 768, 768, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 769, 769, 0, 0, 0, 0, 0,
- 0, 1, 770, 770, 0, 0, 0, 771,
- 0, 0, 0, 0, 0, 0, 1, 770,
- 770, 771, 1, 771, 773, 771, 772, 774,
- 772, 775, 1, 776, 1, 772, 772, 1,
- 37, 37, 0, 0, 0, 38, 777, 777,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 778, 778, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 779, 779, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 780, 780, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 781, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 782, 782, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 783,
- 783, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 784, 784,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 785, 785, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 786, 786, 0, 0,
- 0, 0, 0, 0, 1, 787, 787, 0,
- 0, 0, 788, 0, 0, 0, 0, 0,
- 0, 1, 787, 787, 788, 1, 788, 790,
- 788, 789, 791, 789, 792, 1, 793, 1,
- 789, 789, 1, 37, 37, 0, 0, 0,
- 38, 794, 794, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 795, 795, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 796,
- 796, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 797, 797,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 798, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 799, 799, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 800, 800, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 801, 801, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 802, 802, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 803,
- 803, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 804, 804,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 805, 805, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 806, 806, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 807, 807, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 808, 808, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 809, 809, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 810, 810, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 811,
- 811, 0, 0, 0, 0, 0, 0, 1,
- 812, 812, 0, 0, 0, 813, 0, 0,
- 0, 0, 0, 0, 1, 812, 812, 813,
- 1, 813, 815, 813, 814, 816, 814, 817,
- 1, 818, 1, 814, 814, 1, 37, 37,
- 0, 0, 0, 38, 819, 819, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 820, 821, 820, 821, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 822, 822, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 823, 823, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 824, 824, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 825, 825, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 826, 826, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 827,
- 827, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 828, 0, 38,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 829, 829, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 830, 830, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 831, 831, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 832, 832, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 833, 833, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 834,
- 834, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 835, 835,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 836, 836, 0,
- 0, 0, 0, 0, 0, 1, 837, 837,
- 0, 0, 0, 838, 0, 0, 0, 0,
- 0, 0, 1, 837, 837, 838, 1, 838,
- 840, 838, 839, 841, 839, 842, 1, 843,
- 1, 839, 839, 1, 37, 37, 0, 0,
- 0, 38, 844, 844, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 845, 845, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 846, 846, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 847,
- 847, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 848, 0, 38,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 849, 849, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 850, 850, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 851, 851, 0, 0, 0, 0,
- 0, 0, 1, 852, 852, 0, 0, 0,
- 853, 0, 0, 0, 0, 0, 0, 1,
- 852, 852, 853, 1, 853, 855, 853, 854,
- 856, 854, 857, 1, 858, 1, 854, 854,
- 1, 37, 37, 0, 0, 0, 38, 859,
- 859, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 860, 860,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 861, 861, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 862, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 863, 863, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 864, 864, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 865, 865, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 866,
- 866, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 867, 867,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 868, 868, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 869, 869, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 870, 870, 0, 0, 0,
- 0, 0, 0, 1, 871, 871, 0, 0,
- 0, 872, 0, 0, 0, 0, 0, 0,
- 1, 871, 871, 872, 1, 872, 874, 872,
- 873, 875, 873, 876, 1, 877, 1, 873,
- 873, 1, 37, 37, 0, 0, 0, 38,
- 878, 878, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 879,
- 879, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 880, 880,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 881, 881, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 882, 882, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 883, 883, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 884, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 885, 885, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 886,
- 886, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 887, 887,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 888, 888, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 889, 889, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 890, 890, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 891, 891, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 892, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 893,
- 893, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 894, 894,
- 0, 0, 0, 0, 0, 0, 1, 895,
- 895, 0, 0, 0, 896, 0, 0, 0,
- 0, 0, 0, 1, 895, 895, 896, 1,
- 896, 898, 896, 897, 899, 897, 900, 1,
- 901, 1, 897, 897, 1, 37, 37, 0,
- 0, 0, 38, 902, 902, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 903, 903, 0, 0, 0, 0,
- 0, 0, 1, 904, 904, 0, 0, 0,
- 905, 0, 0, 0, 0, 0, 0, 1,
- 904, 904, 905, 1, 905, 907, 905, 906,
- 908, 906, 909, 1, 910, 1, 906, 906,
- 1, 37, 37, 0, 0, 0, 38, 911,
- 912, 911, 912, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 913, 914, 913, 914, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 915, 915, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 916, 916, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 917,
- 917, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 918, 918,
- 0, 0, 0, 0, 0, 0, 1, 919,
- 919, 0, 0, 0, 920, 0, 0, 0,
- 0, 0, 0, 1, 919, 919, 920, 1,
- 920, 922, 920, 921, 923, 921, 924, 1,
- 925, 1, 921, 921, 1, 37, 37, 0,
- 0, 0, 38, 926, 926, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 927, 927, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 928, 928, 0, 0, 0, 0, 0,
- 0, 1, 929, 929, 0, 0, 0, 930,
- 0, 0, 0, 0, 0, 0, 1, 929,
- 929, 930, 1, 930, 932, 930, 931, 933,
- 931, 934, 1, 935, 1, 931, 931, 1,
- 37, 37, 0, 0, 0, 38, 936, 936,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 937, 937, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 938, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 939, 940, 939, 940, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 941, 941, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 942, 942, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 943, 943, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 944, 945, 944, 945, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 946, 946, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 947, 947, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 948,
- 948, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 949, 949,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 950, 950, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 951, 951, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 952, 952, 0, 0, 0,
- 0, 0, 0, 1, 953, 953, 0, 0,
- 0, 954, 0, 0, 0, 0, 0, 0,
- 1, 953, 953, 954, 1, 954, 956, 954,
- 955, 957, 955, 958, 1, 959, 1, 955,
- 955, 1, 37, 37, 0, 0, 0, 38,
- 960, 960, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 961,
- 961, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 962, 962,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 963, 963, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 964, 964, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 965, 965, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 966, 966, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 967, 967, 0, 0, 0, 0, 0,
- 0, 1, 968, 968, 0, 0, 0, 969,
- 0, 0, 0, 0, 0, 0, 1, 968,
- 968, 969, 1, 969, 971, 969, 970, 972,
- 970, 973, 1, 974, 1, 970, 970, 1,
- 37, 37, 0, 0, 0, 38, 975, 975,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 976, 976, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 977, 977, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 978, 978, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 979, 979, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 980, 980, 0, 0, 0, 0, 0,
- 0, 1, 981, 981, 0, 0, 0, 982,
- 0, 0, 0, 0, 0, 0, 1, 981,
- 981, 982, 1, 982, 984, 982, 983, 985,
- 983, 986, 1, 987, 1, 983, 983, 1,
- 37, 37, 0, 0, 0, 38, 988, 989,
- 990, 991, 988, 989, 990, 991, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 992, 992, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 993, 993, 0, 0, 0, 0,
- 0, 0, 1, 994, 994, 0, 0, 0,
- 995, 0, 0, 0, 0, 0, 0, 1,
- 994, 994, 995, 1, 995, 997, 995, 996,
- 998, 996, 999, 1, 1000, 1, 996, 996,
- 1, 37, 37, 0, 0, 0, 38, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1009, 1009, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1010, 1010, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1011, 1011, 0, 0, 0, 0,
- 0, 0, 1, 1012, 1012, 0, 0, 0,
- 1013, 0, 0, 0, 0, 0, 0, 1,
- 1012, 1012, 1013, 1, 1013, 1015, 1013, 1014,
- 1016, 1014, 1017, 1, 1018, 1, 1014, 1014,
- 1, 37, 37, 0, 0, 0, 38, 1019,
- 1019, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1020, 1020,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1021, 1021, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 1022, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1023, 1023, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1024, 1024, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1025, 1025, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1026,
- 1026, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1027, 1027,
- 0, 0, 0, 0, 0, 0, 1, 1028,
- 1028, 0, 0, 0, 1029, 0, 0, 0,
- 0, 0, 0, 1, 1028, 1028, 1029, 1,
- 1029, 1031, 1029, 1030, 1032, 1030, 1033, 1,
- 1034, 1, 1030, 1030, 1, 37, 37, 0,
- 0, 0, 38, 1035, 1035, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1036, 1036, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 1037, 0, 38, 1038, 1038, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1039, 1040, 1039, 1040, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1041, 1041, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1042, 1042, 0, 0, 0, 0, 0,
- 0, 1, 1043, 1043, 0, 0, 0, 1044,
- 0, 0, 0, 0, 0, 0, 1, 1043,
- 1043, 1044, 1, 1044, 1046, 1044, 1045, 1047,
- 1045, 1048, 1, 1049, 1, 1045, 1045, 1,
- 37, 37, 0, 0, 0, 38, 1050, 1050,
- 0, 0, 0, 0, 0, 0, 1, 1051,
- 1051, 0, 0, 0, 1052, 0, 0, 0,
- 0, 0, 0, 1, 1051, 1051, 1052, 1,
- 1052, 1054, 1052, 1053, 1055, 1053, 1056, 1,
- 1057, 1, 1053, 1053, 1, 37, 37, 0,
- 0, 0, 38, 1058, 1058, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1059, 1059, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 1060, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1061,
- 1061, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 20, 20,
- 0, 0, 0, 0, 0, 0, 1, 1062,
- 1062, 0, 0, 0, 1063, 0, 0, 0,
- 0, 0, 0, 1, 1062, 1062, 1063, 1,
- 1063, 1065, 1063, 1064, 1066, 1064, 1067, 1,
- 1068, 1, 1064, 1064, 1, 37, 37, 0,
- 0, 0, 38, 1069, 1069, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1070, 1070, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1071, 1071, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 1072,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1073, 1073,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1074, 1074, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1075, 1075, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1076, 1076, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1077, 1077, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1078, 1078, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1079, 1079, 0, 0, 0, 0, 0, 0,
- 1, 1080, 1080, 0, 0, 0, 1081, 0,
- 0, 0, 0, 0, 0, 1, 1080, 1080,
- 1081, 1, 1081, 1083, 1081, 1082, 1084, 1082,
- 1085, 1, 1086, 1, 1082, 1082, 1, 37,
- 37, 0, 0, 0, 38, 1087, 1087, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1088, 1089, 1088, 1089,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1090, 1090, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1091, 1091, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1092, 1092, 0, 0, 0,
- 0, 0, 0, 1, 1093, 1093, 0, 0,
- 0, 1094, 0, 0, 0, 0, 0, 0,
- 1, 1093, 1093, 1094, 1, 1094, 1096, 1094,
- 1095, 1097, 1095, 1098, 1, 1099, 1, 1095,
- 1095, 1, 37, 37, 0, 0, 0, 1100,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1101, 1101,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1102, 1102, 0,
- 0, 0, 0, 0, 0, 1, 1103, 1103,
- 0, 0, 0, 1104, 0, 0, 0, 0,
- 0, 0, 1, 1103, 1103, 1104, 1, 1104,
- 1106, 1104, 1105, 1107, 1105, 1108, 1, 1109,
- 1, 1105, 1105, 1, 37, 37, 0, 0,
- 0, 38, 1110, 1110, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1111, 1112, 1111, 1112, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1113, 1113, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1114, 1114, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 1115,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1116, 1116,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1117, 1117, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1118, 1118, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1119, 1119, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1120, 1120, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1121, 1121, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1122, 1122, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1123,
- 1123, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1124, 1124,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1125, 1125, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1126, 1126, 0, 0,
- 0, 0, 0, 0, 1, 1127, 1127, 0,
- 0, 0, 1128, 0, 0, 0, 0, 0,
- 0, 1, 1127, 1127, 1128, 1, 1128, 1130,
- 1128, 1129, 1131, 1129, 1132, 1, 1133, 1,
- 1129, 1129, 1, 37, 37, 0, 0, 0,
- 38, 1134, 1134, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1135, 1135, 0, 0, 0, 0, 0, 0,
- 1, 1136, 1136, 0, 0, 0, 1137, 0,
- 0, 0, 0, 0, 0, 1, 1136, 1136,
- 1137, 1, 1137, 1139, 1137, 1138, 1140, 1138,
- 1141, 1, 1142, 1, 1138, 1138, 1, 37,
- 37, 0, 0, 0, 38, 1143, 1143, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1144, 1144, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1145, 1145, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1146, 1146, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1147, 1147, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 1148,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1149, 1149,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1150, 1150, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1151, 1151, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1152, 1152, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1153, 1153, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1154, 1154, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1155, 1155, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1156,
- 1156, 0, 0, 0, 0, 0, 0, 1,
- 1157, 1157, 0, 0, 0, 1158, 0, 0,
- 0, 0, 0, 0, 1, 1157, 1157, 1158,
- 1, 1158, 1160, 1158, 1159, 1161, 1159, 1162,
- 1, 1163, 1, 1159, 1159, 1, 37, 37,
- 0, 0, 0, 38, 1164, 1164, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1165, 1165, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 1166, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1167, 1167, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1168,
- 1168, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1169, 1169,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1170, 1170, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1171, 1171, 0, 0,
- 0, 0, 0, 0, 1, 1172, 1172, 0,
- 0, 0, 1173, 0, 0, 0, 0, 0,
- 0, 1, 1172, 1172, 1173, 1, 1173, 1175,
- 1173, 1174, 1176, 1174, 1177, 1, 1178, 1,
- 1174, 1174, 1, 37, 37, 0, 0, 0,
- 38, 1179, 1179, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1180, 1180, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1181,
- 1181, 0, 0, 0, 0, 0, 0, 1,
- 1182, 1182, 0, 0, 0, 1183, 0, 0,
- 0, 0, 0, 0, 1, 1182, 1182, 1183,
- 1, 1183, 1185, 1183, 1184, 1186, 1184, 1187,
- 1, 1188, 1, 1184, 1184, 1, 37, 37,
- 0, 0, 0, 38, 1189, 1189, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1190, 1190, 0, 0, 0,
- 0, 0, 0, 1, 1191, 1191, 0, 0,
- 0, 1192, 0, 0, 0, 0, 0, 0,
- 1, 1191, 1191, 1192, 1, 1192, 1194, 1192,
- 1193, 1195, 1193, 1196, 1, 1197, 1, 1193,
- 1193, 1, 1198, 1198, 0, 0, 0, 1199,
- 1200, 1201, 1202, 1200, 1201, 1202, 0, 0,
- 0, 0, 0, 0, 1, 1198, 1198, 1199,
- 1, 1199, 1204, 1199, 1203, 1205, 1203, 1206,
- 1, 1207, 1, 1203, 1203, 1, 37, 37,
- 0, 0, 0, 38, 1208, 1209, 1210, 1208,
- 1209, 1210, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1211,
- 1211, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1212, 1212,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1213, 1213, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1214, 1214, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1215, 1215, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 1216, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1217, 1218, 1219, 1217, 1218, 1219, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1220, 1220, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1221, 1221, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1222, 1222, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1223, 1223, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1224,
- 1224, 0, 0, 0, 0, 0, 0, 1,
- 1225, 1225, 0, 0, 0, 1226, 0, 0,
- 0, 0, 0, 0, 1, 1225, 1225, 1226,
- 1, 1226, 1228, 1226, 1227, 1229, 1227, 1230,
- 1, 1231, 1, 1227, 1227, 1, 37, 37,
- 0, 0, 0, 38, 1232, 1232, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1233, 1233, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1234, 1234, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1235, 1235, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1236, 1236, 0, 0, 0, 0, 0, 0,
- 1, 1237, 1237, 0, 0, 0, 1238, 0,
- 0, 0, 0, 0, 0, 1, 1237, 1237,
- 1238, 1, 1238, 1240, 1238, 1239, 1241, 1239,
- 1242, 1, 1243, 1, 1239, 1239, 1, 37,
- 37, 0, 0, 0, 38, 1244, 1244, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1245, 1245, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1246, 1246, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1247, 1247, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1248, 1248, 0, 0, 0, 0, 0,
- 0, 1, 1249, 1249, 0, 0, 0, 1250,
- 0, 0, 0, 0, 0, 0, 1, 1249,
- 1249, 1250, 1, 1250, 1252, 1250, 1251, 1253,
- 1251, 1254, 1, 1255, 1, 1251, 1251, 1,
- 37, 37, 0, 0, 0, 38, 1256, 1256,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1257, 1258, 1257,
- 1258, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1259, 1259,
- 0, 0, 0, 0, 0, 0, 1, 1260,
- 1260, 0, 0, 0, 1261, 0, 0, 0,
- 0, 0, 0, 1, 1260, 1260, 1261, 1,
- 1261, 1263, 1261, 1262, 1264, 1262, 1265, 1,
- 1266, 1, 1262, 1262, 1, 37, 37, 0,
- 0, 0, 38, 1267, 1267, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1268, 1268, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 1269, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1270,
- 1270, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1271, 1271,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1272, 1272, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1273, 1273, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1274, 1274, 0, 0, 0,
- 0, 0, 0, 1, 1275, 1275, 0, 0,
- 0, 1276, 0, 0, 0, 0, 0, 0,
- 1, 1275, 1275, 1276, 1, 1276, 1278, 1276,
- 1277, 1279, 1277, 1280, 1, 1281, 1, 1277,
- 1277, 1, 37, 37, 0, 0, 0, 38,
- 1282, 1282, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1283,
- 1283, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1284, 1284,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1285, 1285, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 1286, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1287, 1287, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1288, 1288, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1289, 1289, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1290,
- 1290, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1291, 1291,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1292, 1292, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 35, 35, 0, 0,
- 0, 0, 0, 0, 1, 1293, 1293, 0,
- 0, 0, 1294, 0, 0, 0, 0, 0,
- 0, 1, 1293, 1293, 1294, 1, 1294, 1296,
- 1294, 1295, 1297, 1295, 1298, 1, 1299, 1,
- 1295, 1295, 1, 37, 37, 0, 0, 0,
- 38, 1300, 1300, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 1301,
- 0, 38, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1302, 1303,
- 1302, 1303, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1304,
- 1304, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1305, 1305,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1306, 1306, 0,
- 0, 0, 0, 0, 0, 1, 1307, 1307,
- 0, 0, 0, 1308, 0, 0, 0, 0,
- 0, 0, 1, 1307, 1307, 1308, 1, 1308,
- 1310, 1308, 1309, 1311, 1309, 1312, 1, 1313,
- 1, 1309, 1309, 1, 37, 37, 0, 0,
- 0, 38, 1314, 1314, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 1315, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1316,
- 1316, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1317, 1317,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1318, 1318, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1319, 1319, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1320, 1320, 0, 0, 0,
- 0, 0, 0, 1, 1321, 1321, 0, 0,
- 0, 1322, 0, 0, 0, 0, 0, 0,
- 1, 1321, 1321, 1322, 1, 1322, 1324, 1322,
- 1323, 1325, 1323, 1326, 1, 1327, 1, 1323,
- 1323, 1, 37, 37, 0, 0, 0, 38,
- 1328, 1329, 1328, 1329, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1330, 1331, 1330, 1331, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1332, 1332, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1333, 1333, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1334, 1334, 0, 0, 0, 0, 0, 0,
- 1, 1198, 1198, 0, 0, 0, 1199, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1335, 1335, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1336, 1336, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1337, 1337, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1338, 1338, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1339, 1339, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1340,
- 1340, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1341, 1341,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1342, 1342, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 1343, 0, 38, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1344, 1344, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1345, 1345, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1346, 1346, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1347,
- 1347, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1348, 1348,
- 0, 0, 0, 0, 0, 0, 1, 1349,
- 1349, 0, 0, 0, 1350, 0, 0, 0,
- 0, 0, 0, 1, 1349, 1349, 1350, 1,
- 1350, 1352, 1350, 1351, 1353, 1351, 1354, 1,
- 1355, 1, 1351, 1351, 1, 37, 37, 0,
- 0, 0, 38, 1356, 1356, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1357, 1357, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1358, 1358, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1359, 1359, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1360,
- 1360, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 27, 27,
- 0, 0, 0, 0, 0, 0, 1, 1361,
- 1361, 0, 0, 0, 1362, 0, 0, 0,
- 0, 0, 0, 1, 1361, 1361, 1362, 1,
- 1362, 1364, 1362, 1363, 1365, 1363, 1366, 1,
- 1367, 1, 1363, 1363, 1, 37, 37, 0,
- 0, 0, 38, 1368, 1369, 1370, 1368, 1369,
- 1370, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1371, 1371,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1372, 1372, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1373, 1373, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1374, 1374, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 1375, 0, 38, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1376, 1376, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1377,
- 1377, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1378, 1378,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1379, 1379, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1380, 1380, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1381, 1381, 0, 0, 0,
- 0, 0, 0, 1, 1382, 1382, 0, 0,
- 0, 1383, 0, 0, 0, 0, 0, 0,
- 1, 1382, 1382, 1383, 1, 1383, 1385, 1383,
- 1384, 1386, 1384, 1387, 1, 1388, 1, 1384,
- 1384, 1, 37, 37, 0, 0, 0, 38,
- 1389, 1389, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1390,
- 1390, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1391, 1391,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1392, 1392, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1393, 1393, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1394, 1394, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1395, 1395, 0, 0, 0, 0,
- 0, 0, 1, 1396, 1396, 0, 0, 0,
- 1397, 0, 0, 0, 0, 0, 0, 1,
- 1396, 1396, 1397, 1, 1397, 1399, 1397, 1398,
- 1400, 1398, 1401, 1, 1402, 1, 1398, 1398,
- 1, 1403, 1403, 0, 0, 0, 1404, 0,
- 0, 0, 0, 0, 0, 1, 1403, 1403,
- 1404, 1, 1404, 1406, 1404, 1405, 1407, 1405,
- 1408, 1, 1409, 1, 1405, 1405, 1, 37,
- 37, 0, 0, 0, 38, 1410, 1411, 1410,
- 1411, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1412, 1412,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1413, 1413, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1414, 1414, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1415, 1415, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1416, 1416, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1417, 1417, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1418, 1418, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1419,
- 1419, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1420, 1420,
- 0, 0, 0, 0, 0, 0, 1, 1421,
- 1421, 0, 0, 0, 1422, 0, 0, 0,
- 0, 0, 0, 1, 1421, 1421, 1422, 1,
- 1422, 1424, 1422, 1423, 1425, 1423, 1426, 1,
- 1427, 1, 1423, 1423, 1, 37, 37, 0,
- 0, 0, 38, 1428, 1428, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1429, 1429, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 1430, 0, 38, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1431,
- 1431, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1432, 1432,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1433, 1433, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1434, 1434, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1435, 1435, 0, 0, 0,
- 0, 0, 0, 1, 1436, 1436, 0, 0,
- 0, 1437, 0, 0, 0, 0, 0, 0,
- 1, 1436, 1436, 1437, 1, 1437, 1439, 1437,
- 1438, 1440, 1438, 1441, 1, 1442, 1, 1438,
- 1438, 1, 37, 37, 0, 0, 0, 38,
- 1443, 1443, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1444,
- 1444, 0, 0, 0, 0, 0, 0, 1,
- 1445, 1445, 0, 0, 0, 1446, 0, 0,
- 0, 0, 0, 0, 1, 1445, 1445, 1446,
- 1, 1446, 1448, 1446, 1447, 1449, 1447, 1450,
- 1, 1451, 1, 1447, 1447, 1, 37, 37,
- 0, 0, 0, 38, 1452, 1453, 1452, 1453,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1454, 1454, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1455, 1455, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1456, 1456, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1457, 1457, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1458, 1458, 0, 0, 0, 0, 0,
- 0, 1, 1459, 1459, 0, 0, 0, 1460,
- 0, 0, 0, 0, 0, 0, 1, 1459,
- 1459, 1460, 1, 1460, 1462, 1460, 1461, 1463,
- 1461, 1464, 1, 1465, 1, 1461, 1461, 1,
- 37, 37, 0, 0, 0, 38, 1466, 1466,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 1467, 0, 38, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1468, 1468, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1469, 1469, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1470, 1470, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1471, 1471, 0, 0, 0, 0, 0, 0,
- 1, 37, 37, 0, 0, 0, 38, 1472,
- 1472, 0, 0, 0, 0, 0, 0, 1,
- 37, 37, 0, 0, 0, 38, 1473, 1473,
- 0, 0, 0, 0, 0, 0, 1, 37,
- 37, 0, 0, 0, 38, 1474, 1474, 0,
- 0, 0, 0, 0, 0, 1, 37, 37,
- 0, 0, 0, 38, 1475, 1475, 0, 0,
- 0, 0, 0, 0, 1, 37, 37, 0,
- 0, 0, 38, 1476, 1476, 0, 0, 0,
- 0, 0, 0, 1, 37, 37, 0, 0,
- 0, 38, 1477, 1477, 0, 0, 0, 0,
- 0, 0, 1, 37, 37, 0, 0, 0,
- 38, 1478, 1478, 0, 0, 0, 0, 0,
- 0, 1, 37, 37, 0, 0, 0, 38,
- 1479, 1479, 0, 0, 0, 0, 0, 0,
- 1, 1480, 1480, 0, 0, 0, 1481, 0,
- 0, 0, 0, 0, 0, 1, 1480, 1480,
- 1481, 1, 1481, 1481, 1483, 1483, 1482, 1482,
- 1, 1484, 1485, 1482, 1482, 1, 1487, 1486,
- 1488, 1486, 1486, 1, 1486, 1488, 1486, 1486,
- 1, 1489, 1, 42, 1489, 1, 1490, 1,
- 1482, 1482, 1, 69, 69, 0, 0, 0,
- 70, 44, 45, 46, 44, 45, 46, 0,
- 0, 0, 0, 0, 0, 1, 310, 310,
- 0, 0, 0, 311, 206, 207, 208, 206,
- 207, 208, 0, 0, 0, 0, 0, 0,
- 1, 1127, 1127, 0, 0, 0, 1128, 326,
- 326, 0, 0, 0, 0, 0, 0, 1,
- 275, 275, 0, 0, 0, 276, 336, 337,
- 338, 336, 337, 338, 0, 0, 0, 0,
- 0, 0, 1, 379, 379, 0, 0, 0,
- 380, 376, 376, 0, 0, 0, 0, 0,
- 0, 1, 215, 215, 0, 0, 0, 216,
- 404, 405, 404, 405, 0, 0, 0, 0,
- 0, 0, 1, 1080, 1080, 0, 0, 0,
- 1081, 446, 446, 0, 0, 0, 0, 0,
- 0, 1, 237, 237, 0, 0, 0, 238,
- 456, 457, 456, 457, 0, 0, 0, 0,
- 0, 0, 1, 1051, 1051, 0, 0, 0,
- 1052, 988, 989, 990, 991, 988, 989, 990,
- 991, 0, 0, 0, 0, 0, 0, 1,
- 1403, 1403, 0, 0, 0, 1404, 1368, 1369,
- 1370, 1368, 1369, 1370, 0, 0, 0, 0,
- 0, 0, 1, 159, 159, 0, 0, 0,
- 160, 1410, 1411, 1410, 1411, 0, 0, 0,
- 0, 0, 0, 1, 1445, 1445, 0, 0,
- 0, 1446, 1443, 1443, 0, 0, 0, 0,
- 0, 0, 1, 412, 412, 0, 0, 0,
- 414, 0, 0, 0, 0, 0, 0, 1,
- 1, 1486, 1488, 1486, 1486, 1, 0
-};
+ static const short _tsip_machine_parser_headers_index_offsets[] = {
+ 0, 0, 50, 63, 67, 71, 73, 75,
+ 77, 80, 99, 114, 129, 144, 159, 173,
+ 177, 181, 183, 185, 187, 190, 211, 226,
+ 241, 256, 271, 286, 301, 314, 318, 322,
+ 324, 326, 328, 331, 346, 361, 376, 391,
+ 406, 421, 436, 449, 453, 457, 459, 461,
+ 463, 466, 481, 496, 511, 526, 541, 556,
+ 571, 584, 588, 592, 594, 596, 598, 601,
+ 616, 631, 646, 661, 676, 691, 706, 720,
+ 735, 750, 765, 780, 795, 810, 825, 840,
+ 853, 857, 861, 863, 865, 867, 870, 887,
+ 902, 917, 931, 946, 961, 976, 991, 1004,
+ 1008, 1012, 1014, 1016, 1018, 1021, 1036, 1051,
+ 1065, 1069, 1073, 1075, 1077, 1079, 1082, 1097,
+ 1112, 1127, 1142, 1157, 1172, 1185, 1189, 1193,
+ 1195, 1197, 1199, 1202, 1217, 1232, 1249, 1264,
+ 1279, 1294, 1309, 1324, 1339, 1354, 1369, 1384,
+ 1398, 1413, 1428, 1443, 1458, 1471, 1475, 1479,
+ 1481, 1483, 1485, 1488, 1503, 1518, 1533, 1548,
+ 1563, 1578, 1593, 1608, 1621, 1625, 1629, 1631,
+ 1633, 1635, 1638, 1657, 1672, 1687, 1701, 1716,
+ 1733, 1746, 1750, 1754, 1756, 1758, 1760, 1763,
+ 1778, 1793, 1806, 1810, 1814, 1816, 1818, 1820,
+ 1823, 1838, 1853, 1870, 1885, 1900, 1913, 1917,
+ 1921, 1923, 1925, 1927, 1930, 1945, 1960, 1974,
+ 1995, 2010, 2025, 2040, 2055, 2070, 2085, 2100,
+ 2115, 2130, 2145, 2158, 2162, 2166, 2168, 2170,
+ 2172, 2175, 2190, 2205, 2220, 2235, 2250, 2265,
+ 2280, 2293, 2297, 2301, 2303, 2305, 2307, 2310,
+ 2327, 2342, 2357, 2372, 2387, 2402, 2417, 2430,
+ 2434, 2438, 2440, 2442, 2444, 2447, 2462, 2477,
+ 2492, 2507, 2520, 2524, 2528, 2530, 2532, 2534,
+ 2537, 2552, 2567, 2582, 2595, 2599, 2603, 2605,
+ 2607, 2609, 2612, 2627, 2642, 2655, 2659, 2663,
+ 2665, 2667, 2669, 2672, 2687, 2702, 2717, 2730,
+ 2734, 2738, 2740, 2742, 2744, 2747, 2766, 2781,
+ 2796, 2811, 2825, 2840, 2855, 2870, 2885, 2898,
+ 2902, 2906, 2908, 2910, 2912, 2915, 2930, 2945,
+ 2960, 2973, 2977, 2981, 2983, 2985, 2987, 2990,
+ 3005, 3020, 3035, 3050, 3065, 3078, 3082, 3086,
+ 3088, 3090, 3092, 3095, 3110, 3125, 3140, 3153,
+ 3157, 3161, 3163, 3165, 3167, 3170, 3185, 3200,
+ 3215, 3230, 3245, 3260, 3274, 3289, 3304, 3319,
+ 3334, 3347, 3351, 3355, 3357, 3359, 3361, 3364,
+ 3381, 3396, 3411, 3426, 3441, 3456, 3471, 3485,
+ 3489, 3493, 3495, 3497, 3499, 3502, 3517, 3532,
+ 3547, 3562, 3575, 3579, 3583, 3585, 3587, 3589,
+ 3592, 3606, 3621, 3636, 3651, 3666, 3681, 3695,
+ 3710, 3725, 3738, 3742, 3746, 3748, 3750, 3752,
+ 3755, 3770, 3785, 3800, 3813, 3817, 3821, 3823,
+ 3825, 3827, 3830, 3847, 3862, 3876, 3891, 3906,
+ 3921, 3936, 3951, 3966, 3981, 3996, 4009, 4013,
+ 4017, 4019, 4021, 4023, 4026, 4043, 4058, 4072,
+ 4087, 4102, 4117, 4132, 4147, 4162, 4177, 4190,
+ 4194, 4198, 4200, 4202, 4204, 4207, 4221, 4238,
+ 4253, 4268, 4283, 4298, 4313, 4328, 4341, 4345,
+ 4349, 4351, 4353, 4355, 4358, 4373, 4386, 4390,
+ 4394, 4396, 4398, 4400, 4403, 4418, 4433, 4448,
+ 4463, 4478, 4493, 4508, 4523, 4538, 4553, 4568,
+ 4581, 4585, 4589, 4591, 4593, 4595, 4598, 4616,
+ 4645, 4664, 4679, 4694, 4709, 4724, 4738, 4753,
+ 4768, 4783, 4798, 4813, 4828, 4843, 4857, 4872,
+ 4887, 4902, 4917, 4930, 4934, 4938, 4940, 4942,
+ 4944, 4947, 4962, 4977, 4992, 5007, 5021, 5036,
+ 5051, 5066, 5081, 5096, 5109, 5113, 5117, 5119,
+ 5121, 5123, 5126, 5141, 5158, 5173, 5188, 5203,
+ 5218, 5232, 5247, 5262, 5277, 5292, 5307, 5322,
+ 5337, 5352, 5365, 5369, 5373, 5375, 5377, 5379,
+ 5382, 5397, 5412, 5427, 5442, 5457, 5472, 5486,
+ 5501, 5516, 5531, 5544, 5548, 5552, 5554, 5556,
+ 5558, 5561, 5578, 5593, 5608, 5623, 5638, 5652,
+ 5667, 5682, 5697, 5712, 5727, 5741, 5756, 5771,
+ 5784, 5788, 5792, 5794, 5796, 5798, 5801, 5816,
+ 5831, 5846, 5861, 5876, 5891, 5905, 5922, 5937,
+ 5952, 5967, 5982, 5997, 6012, 6027, 6041, 6056,
+ 6071, 6086, 6101, 6116, 6131, 6146, 6161, 6176,
+ 6189, 6193, 6197, 6199, 6201, 6203, 6206, 6221,
+ 6236, 6251, 6266, 6281, 6294, 6298, 6302, 6304,
+ 6306, 6308, 6311, 6326, 6341, 6355, 6378, 6393,
+ 6408, 6423, 6438, 6453, 6468, 6482, 6497, 6512,
+ 6527, 6542, 6555, 6559, 6563, 6565, 6567, 6569,
+ 6572, 6587, 6602, 6617, 6630, 6634, 6638, 6640,
+ 6642, 6644, 6647, 6662, 6677, 6692, 6705, 6709,
+ 6713, 6715, 6717, 6719, 6722, 6737, 6752, 6767,
+ 6782, 6797, 6812, 6827, 6840, 6844, 6848, 6850,
+ 6852, 6854, 6857, 6872, 6887, 6902, 6917, 6931,
+ 6946, 6961, 6976, 6991, 7006, 7020, 7035, 7050,
+ 7063, 7067, 7071, 7073, 7075, 7077, 7080, 7095,
+ 7110, 7125, 7140, 7154, 7169, 7184, 7199, 7214,
+ 7229, 7242, 7246, 7250, 7252, 7254, 7256, 7259,
+ 7274, 7289, 7304, 7319, 7333, 7348, 7363, 7378,
+ 7393, 7408, 7423, 7438, 7453, 7468, 7483, 7498,
+ 7513, 7528, 7541, 7545, 7549, 7551, 7553, 7555,
+ 7558, 7573, 7590, 7605, 7620, 7635, 7650, 7665,
+ 7680, 7694, 7709, 7724, 7739, 7754, 7769, 7784,
+ 7799, 7814, 7827, 7831, 7835, 7837, 7839, 7841,
+ 7844, 7859, 7874, 7889, 7904, 7918, 7933, 7948,
+ 7963, 7976, 7980, 7984, 7986, 7988, 7990, 7993,
+ 8008, 8023, 8038, 8052, 8067, 8082, 8097, 8112,
+ 8127, 8142, 8157, 8172, 8185, 8189, 8193, 8195,
+ 8197, 8199, 8202, 8217, 8232, 8247, 8262, 8277,
+ 8292, 8306, 8321, 8336, 8351, 8366, 8381, 8396,
+ 8411, 8425, 8440, 8455, 8468, 8472, 8476, 8478,
+ 8480, 8482, 8485, 8500, 8515, 8528, 8532, 8536,
+ 8538, 8540, 8542, 8545, 8562, 8579, 8594, 8609,
+ 8624, 8639, 8652, 8656, 8660, 8662, 8664, 8666,
+ 8669, 8684, 8699, 8714, 8727, 8731, 8735, 8737,
+ 8739, 8741, 8744, 8759, 8774, 8788, 8805, 8820,
+ 8835, 8850, 8867, 8882, 8897, 8912, 8927, 8942,
+ 8957, 8972, 8985, 8989, 8993, 8995, 8997, 8999,
+ 9002, 9017, 9032, 9047, 9062, 9077, 9092, 9107,
+ 9122, 9135, 9139, 9143, 9145, 9147, 9149, 9152,
+ 9167, 9182, 9197, 9212, 9227, 9242, 9255, 9259,
+ 9263, 9265, 9267, 9269, 9272, 9293, 9308, 9323,
+ 9336, 9340, 9344, 9346, 9348, 9350, 9353, 9382,
+ 9397, 9412, 9427, 9440, 9444, 9448, 9450, 9452,
+ 9454, 9457, 9472, 9487, 9502, 9516, 9531, 9546,
+ 9561, 9576, 9591, 9604, 9608, 9612, 9614, 9616,
+ 9618, 9621, 9636, 9651, 9667, 9684, 9699, 9714,
+ 9727, 9731, 9735, 9737, 9739, 9741, 9744, 9759,
+ 9772, 9776, 9780, 9782, 9784, 9786, 9789, 9804,
+ 9819, 9833, 9848, 9863, 9876, 9880, 9884, 9886,
+ 9888, 9890, 9893, 9908, 9923, 9938, 9952, 9967,
+ 9982, 9997, 10012, 10027, 10042, 10057, 10070, 10074,
+ 10078, 10080, 10082, 10084, 10087, 10102, 10119, 10134,
+ 10149, 10164, 10177, 10181, 10185, 10187, 10189, 10191,
+ 10194, 10208, 10223, 10238, 10251, 10255, 10259, 10261,
+ 10263, 10265, 10268, 10283, 10300, 10315, 10330, 10344,
+ 10359, 10374, 10389, 10404, 10419, 10434, 10449, 10464,
+ 10479, 10494, 10509, 10522, 10526, 10530, 10532, 10534,
+ 10536, 10539, 10554, 10569, 10582, 10586, 10590, 10592,
+ 10594, 10596, 10599, 10614, 10629, 10644, 10659, 10674,
+ 10688, 10703, 10718, 10733, 10748, 10763, 10778, 10793,
+ 10808, 10821, 10825, 10829, 10831, 10833, 10835, 10838,
+ 10853, 10868, 10882, 10897, 10912, 10927, 10942, 10957,
+ 10970, 10974, 10978, 10980, 10982, 10984, 10987, 11002,
+ 11017, 11032, 11045, 11049, 11053, 11055, 11057, 11059,
+ 11062, 11077, 11092, 11105, 11109, 11113, 11115, 11117,
+ 11119, 11122, 11141, 11145, 11149, 11151, 11153, 11155,
+ 11158, 11177, 11192, 11207, 11222, 11237, 11252, 11266,
+ 11285, 11300, 11315, 11330, 11345, 11360, 11373, 11377,
+ 11381, 11383, 11385, 11387, 11390, 11405, 11420, 11435,
+ 11450, 11465, 11478, 11482, 11486, 11488, 11490, 11492,
+ 11495, 11510, 11525, 11540, 11555, 11570, 11583, 11587,
+ 11591, 11593, 11595, 11597, 11600, 11615, 11632, 11647,
+ 11660, 11664, 11668, 11670, 11672, 11674, 11677, 11692,
+ 11707, 11721, 11736, 11751, 11766, 11781, 11796, 11809,
+ 11813, 11817, 11819, 11821, 11823, 11826, 11841, 11856,
+ 11871, 11886, 11900, 11915, 11930, 11945, 11960, 11975,
+ 11990, 12005, 12018, 12022, 12026, 12028, 12030, 12032,
+ 12035, 12050, 12064, 12081, 12096, 12111, 12126, 12139,
+ 12143, 12147, 12149, 12151, 12153, 12156, 12171, 12185,
+ 12200, 12215, 12230, 12245, 12260, 12273, 12277, 12281,
+ 12283, 12285, 12287, 12290, 12307, 12324, 12339, 12354,
+ 12369, 12382, 12397, 12412, 12427, 12442, 12457, 12472,
+ 12487, 12502, 12516, 12531, 12546, 12561, 12576, 12591,
+ 12604, 12608, 12612, 12614, 12616, 12618, 12621, 12636,
+ 12651, 12666, 12681, 12696, 12711, 12724, 12728, 12732,
+ 12734, 12736, 12738, 12741, 12760, 12775, 12790, 12805,
+ 12820, 12834, 12849, 12864, 12879, 12894, 12909, 12924,
+ 12937, 12941, 12945, 12947, 12949, 12951, 12954, 12969,
+ 12984, 12999, 13014, 13029, 13044, 13059, 13072, 13076,
+ 13080, 13082, 13084, 13086, 13089, 13102, 13106, 13110,
+ 13112, 13114, 13116, 13119, 13136, 13151, 13166, 13181,
+ 13196, 13211, 13226, 13241, 13256, 13271, 13284, 13288,
+ 13292, 13294, 13296, 13298, 13301, 13316, 13331, 13345,
+ 13360, 13375, 13390, 13405, 13420, 13433, 13437, 13441,
+ 13443, 13445, 13447, 13450, 13465, 13480, 13493, 13497,
+ 13501, 13503, 13505, 13507, 13510, 13527, 13542, 13557,
+ 13572, 13587, 13602, 13615, 13619, 13623, 13625, 13627,
+ 13629, 13632, 13647, 13661, 13676, 13691, 13706, 13721,
+ 13736, 13751, 13766, 13781, 13796, 13811, 13826, 13841,
+ 13854, 13858, 13865, 13870, 13876, 13881, 13883, 13886,
+ 13888, 13891, 13910, 13929, 13944, 13963, 13978, 13995,
+ 14010, 14027, 14048, 14067, 14084, 14099, 14112, 14113
+ };
-static const short _tsip_machine_parser_headers_trans_targs[] = {
- 2, 0, 9, 162, 275, 285, 323, 333,
- 351, 392, 402, 460, 478, 908, 1105, 1267,
- 1307, 1339, 1348, 1385, 971, 1386, 1387, 1388,
- 1389, 1390, 1391, 1260, 249, 1392, 369, 1393,
- 1394, 1395, 1396, 1193, 1397, 3, 4, 5,
- 7, 6, 1398, 8, 10, 86, 123, 11,
- 12, 13, 14, 15, 21, 16, 17, 19,
- 18, 1398, 20, 22, 35, 49, 63, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 33, 32, 1398, 34, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 47, 46,
- 1398, 48, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 61, 60, 1398, 62,
- 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 84, 83, 1398, 85, 87,
- 101, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 99, 98, 1398, 100, 102,
- 103, 104, 110, 105, 106, 108, 107, 1398,
- 109, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 121, 120, 1398, 122, 124, 125,
- 126, 147, 127, 128, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140,
- 141, 142, 143, 145, 144, 1398, 146, 148,
- 149, 150, 151, 152, 153, 154, 155, 156,
- 157, 158, 160, 159, 1398, 161, 163, 184,
- 266, 164, 165, 166, 167, 168, 175, 169,
- 170, 171, 173, 172, 1398, 174, 176, 177,
- 178, 179, 180, 182, 181, 1398, 183, 185,
- 186, 187, 196, 188, 189, 190, 191, 192,
- 194, 193, 1398, 195, 197, 198, 199, 200,
- 217, 231, 256, 201, 202, 203, 204, 205,
- 206, 207, 208, 209, 210, 211, 212, 213,
- 215, 214, 1398, 216, 218, 219, 220, 221,
- 222, 223, 224, 225, 226, 227, 229, 228,
- 1398, 230, 232, 245, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 243, 242, 1398,
- 244, 246, 247, 248, 250, 251, 252, 254,
- 253, 1398, 255, 257, 258, 259, 260, 261,
- 262, 264, 263, 1398, 265, 267, 268, 269,
- 270, 271, 273, 272, 1398, 274, 276, 277,
- 278, 279, 280, 281, 283, 282, 1398, 284,
- 286, 301, 311, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 299, 298,
- 1398, 300, 302, 303, 304, 305, 306, 307,
- 309, 308, 1398, 310, 312, 313, 314, 315,
- 316, 317, 318, 319, 321, 320, 1398, 322,
- 324, 325, 326, 327, 328, 329, 331, 330,
- 1398, 332, 334, 335, 336, 337, 338, 339,
- 340, 341, 342, 343, 344, 345, 346, 347,
- 349, 348, 1398, 350, 352, 376, 353, 354,
- 355, 356, 357, 358, 359, 365, 360, 361,
- 363, 362, 1398, 364, 366, 367, 368, 370,
- 371, 372, 374, 373, 1398, 375, 377, 378,
- 379, 380, 381, 382, 383, 384, 385, 386,
- 387, 388, 390, 389, 1398, 391, 393, 394,
- 395, 396, 397, 398, 400, 399, 1398, 401,
- 403, 420, 404, 405, 406, 407, 408, 409,
- 410, 411, 412, 413, 414, 415, 416, 418,
- 417, 1398, 419, 421, 437, 422, 423, 424,
- 425, 426, 427, 428, 429, 430, 431, 432,
- 433, 435, 434, 1398, 436, 438, 439, 452,
- 440, 441, 442, 443, 444, 445, 446, 447,
- 448, 450, 449, 1398, 451, 453, 454, 455,
- 456, 458, 457, 1398, 459, 461, 462, 463,
- 464, 465, 466, 467, 468, 469, 470, 471,
- 472, 473, 474, 476, 475, 1398, 477, 479,
- 826, 835, 480, 561, 626, 702, 719, 744,
- 783, 802, 481, 505, 522, 482, 483, 484,
- 485, 486, 487, 488, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 500,
- 501, 503, 502, 1398, 504, 506, 507, 508,
- 509, 510, 511, 512, 513, 514, 515, 516,
- 517, 518, 520, 519, 1398, 521, 523, 524,
- 544, 525, 526, 527, 528, 529, 530, 531,
- 532, 533, 534, 535, 536, 537, 538, 539,
- 540, 542, 541, 1398, 543, 545, 546, 547,
- 548, 549, 550, 551, 552, 553, 554, 555,
- 556, 557, 559, 558, 1398, 560, 562, 582,
- 563, 564, 565, 566, 567, 568, 569, 570,
- 571, 572, 573, 574, 575, 576, 577, 578,
- 580, 579, 1398, 581, 583, 584, 585, 586,
- 587, 588, 589, 590, 614, 591, 592, 593,
- 594, 595, 596, 597, 598, 599, 600, 601,
- 602, 603, 604, 605, 606, 607, 608, 609,
- 610, 612, 611, 1398, 613, 615, 616, 617,
- 618, 619, 620, 621, 622, 624, 623, 1398,
- 625, 627, 628, 629, 630, 648, 658, 668,
- 682, 631, 632, 633, 634, 635, 636, 637,
- 638, 639, 640, 641, 642, 643, 644, 646,
- 645, 1398, 647, 649, 650, 651, 652, 653,
- 654, 656, 655, 1398, 657, 659, 660, 661,
- 662, 663, 664, 666, 665, 1398, 667, 669,
- 670, 671, 672, 673, 674, 675, 676, 677,
- 678, 680, 679, 1398, 681, 683, 684, 685,
- 686, 687, 688, 689, 690, 691, 692, 693,
- 694, 695, 696, 697, 698, 700, 699, 1398,
- 701, 703, 704, 705, 706, 707, 708, 709,
- 710, 711, 712, 713, 714, 715, 717, 716,
- 1398, 718, 720, 721, 722, 723, 724, 725,
- 726, 727, 728, 729, 730, 731, 732, 733,
- 734, 735, 736, 737, 738, 739, 740, 742,
- 741, 1398, 743, 745, 746, 768, 747, 748,
- 749, 750, 751, 752, 753, 754, 755, 756,
- 757, 758, 759, 760, 761, 762, 763, 764,
- 766, 765, 1398, 767, 769, 770, 771, 772,
- 773, 774, 775, 776, 777, 778, 779, 781,
- 780, 1398, 782, 784, 785, 786, 787, 788,
- 789, 790, 791, 792, 793, 794, 795, 796,
- 797, 798, 800, 799, 1398, 801, 803, 804,
- 805, 806, 807, 808, 809, 810, 811, 812,
- 813, 814, 815, 816, 817, 818, 819, 820,
- 821, 822, 824, 823, 1398, 825, 827, 828,
- 829, 830, 831, 833, 832, 1398, 834, 836,
- 858, 837, 848, 838, 839, 840, 841, 842,
- 843, 844, 846, 845, 1398, 847, 849, 850,
- 851, 852, 853, 854, 856, 855, 1398, 857,
- 859, 860, 861, 862, 895, 863, 864, 865,
- 866, 880, 867, 868, 869, 870, 871, 872,
- 873, 874, 875, 876, 878, 877, 1398, 879,
- 881, 882, 883, 884, 885, 886, 887, 888,
- 889, 890, 891, 893, 892, 1398, 894, 896,
- 897, 898, 899, 900, 901, 902, 903, 904,
- 906, 905, 1398, 907, 909, 918, 1086, 1096,
- 910, 911, 912, 913, 914, 916, 915, 1398,
- 917, 919, 929, 945, 978, 996, 1018, 1050,
- 1071, 920, 921, 922, 923, 924, 925, 927,
- 926, 1398, 928, 930, 931, 932, 933, 934,
- 935, 936, 937, 938, 939, 940, 941, 943,
- 942, 1398, 944, 946, 947, 948, 966, 949,
- 958, 950, 951, 952, 953, 954, 956, 955,
- 1398, 957, 959, 960, 961, 962, 964, 963,
- 1398, 965, 967, 968, 969, 970, 972, 973,
- 974, 976, 975, 1398, 977, 979, 980, 981,
- 982, 983, 984, 985, 986, 987, 988, 989,
- 990, 991, 992, 994, 993, 1398, 995, 997,
- 998, 1008, 999, 1000, 1001, 1002, 1003, 1004,
- 1006, 1005, 1398, 1007, 1009, 1010, 1011, 1012,
- 1013, 1014, 1016, 1015, 1398, 1017, 1019, 1020,
- 1041, 1021, 1022, 1023, 1024, 1025, 1026, 1027,
- 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035,
- 1036, 1037, 1039, 1038, 1398, 1040, 1042, 1043,
- 1044, 1045, 1046, 1048, 1047, 1398, 1049, 1051,
- 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059,
- 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067,
- 1069, 1068, 1398, 1070, 1072, 1073, 1074, 1075,
- 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1084,
- 1083, 1398, 1085, 1087, 1088, 1089, 1090, 1091,
- 1092, 1094, 1093, 1398, 1095, 1097, 1098, 1099,
- 1100, 1101, 1103, 1102, 1398, 1104, 1106, 1107,
- 1112, 1200, 1227, 1108, 1110, 1109, 1398, 1111,
- 1113, 1156, 1181, 1114, 1115, 1116, 1117, 1118,
- 1119, 1120, 1132, 1144, 1121, 1122, 1123, 1124,
- 1125, 1126, 1127, 1128, 1130, 1129, 1398, 1131,
- 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140,
- 1142, 1141, 1398, 1143, 1145, 1146, 1147, 1148,
- 1149, 1150, 1151, 1152, 1154, 1153, 1398, 1155,
- 1157, 1158, 1166, 1159, 1160, 1161, 1162, 1164,
- 1163, 1398, 1165, 1167, 1168, 1169, 1170, 1171,
- 1172, 1173, 1174, 1175, 1176, 1177, 1179, 1178,
- 1398, 1180, 1182, 1183, 1184, 1185, 1186, 1187,
- 1188, 1189, 1190, 1191, 1192, 1194, 1195, 1196,
- 1198, 1197, 1398, 1199, 1201, 1202, 1203, 1213,
- 1204, 1205, 1206, 1207, 1208, 1209, 1211, 1210,
- 1398, 1212, 1214, 1215, 1216, 1217, 1218, 1219,
- 1220, 1221, 1222, 1223, 1225, 1224, 1398, 1226,
- 1228, 1254, 1229, 1233, 1230, 1231, 1232, 1234,
- 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242,
- 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250,
- 1252, 1251, 1398, 1253, 1255, 1256, 1257, 1258,
- 1259, 1261, 1262, 1263, 1265, 1264, 1398, 1266,
- 1268, 1286, 1300, 1269, 1270, 1271, 1272, 1273,
- 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281,
- 1282, 1284, 1283, 1398, 1285, 1287, 1288, 1289,
- 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1298,
- 1297, 1398, 1299, 1301, 1302, 1303, 1305, 1304,
- 1398, 1306, 1308, 1324, 1309, 1310, 1311, 1312,
- 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320,
- 1322, 1321, 1398, 1323, 1325, 1326, 1327, 1328,
- 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1337,
- 1336, 1398, 1338, 1340, 1341, 1342, 1343, 1344,
- 1346, 1345, 1398, 1347, 1349, 1361, 1350, 1351,
- 1352, 1353, 1354, 1355, 1356, 1357, 1359, 1358,
- 1398, 1360, 1362, 1363, 1364, 1365, 1366, 1367,
- 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375,
- 1376, 1377, 1378, 1383, 1379, 1382, 1380, 1399,
- 1381, 1398, 1384
-};
+ static const short _tsip_machine_parser_headers_indicies[] = {
+ 0, 0, 0, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 7, 25, 26, 27, 28, 29,
+ 30, 11, 12, 31, 14, 32, 33, 34,
+ 18, 35, 36, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 38, 1, 38, 40, 38, 39, 41,
+ 39, 42, 1, 43, 1, 39, 39, 1,
+ 37, 37, 0, 0, 0, 38, 44, 45,
+ 46, 44, 45, 46, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 47, 47, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 48, 48, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 49,
+ 49, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 50, 50,
+ 0, 0, 0, 0, 0, 0, 1, 51,
+ 51, 0, 0, 0, 52, 0, 53, 0,
+ 0, 0, 0, 0, 1, 51, 51, 53,
+ 1, 53, 55, 53, 54, 56, 54, 57,
+ 1, 58, 1, 54, 54, 1, 37, 37,
+ 0, 0, 0, 38, 59, 60, 61, 62,
+ 59, 60, 61, 62, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 63, 63, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 64, 64, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 65,
+ 65, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 66, 66,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 67, 67, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 68, 68, 0, 0,
+ 0, 0, 0, 0, 1, 69, 69, 0,
+ 0, 0, 70, 0, 0, 0, 0, 0,
+ 0, 1, 69, 69, 70, 1, 70, 72,
+ 70, 71, 73, 71, 74, 1, 75, 1,
+ 71, 71, 1, 37, 37, 0, 0, 0,
+ 38, 76, 76, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 77, 77, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 78,
+ 78, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 79, 79,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 80, 80, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 81, 81, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 82, 82, 0, 0, 0,
+ 0, 0, 0, 1, 83, 83, 0, 0,
+ 0, 84, 0, 0, 0, 0, 0, 0,
+ 1, 83, 83, 84, 1, 84, 86, 84,
+ 85, 87, 85, 88, 1, 89, 1, 85,
+ 85, 1, 37, 37, 0, 0, 0, 38,
+ 90, 90, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 91,
+ 91, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 92, 92,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 93, 93, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 94, 94, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 95, 95, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 96, 96, 0, 0, 0, 0,
+ 0, 0, 1, 97, 97, 0, 0, 0,
+ 98, 0, 0, 0, 0, 0, 0, 1,
+ 97, 97, 98, 1, 98, 100, 98, 99,
+ 101, 99, 102, 1, 103, 1, 99, 99,
+ 1, 37, 37, 0, 0, 0, 38, 104,
+ 104, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 105, 105,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 106, 106, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 107, 107, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 108, 108, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 109, 109, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 110, 110, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 111,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 112, 112,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 113, 113, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 114, 114, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 115, 115, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 116, 116, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 117, 117, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 118, 118, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 119,
+ 119, 0, 0, 0, 0, 0, 0, 1,
+ 120, 120, 0, 0, 0, 121, 0, 0,
+ 0, 0, 0, 0, 1, 120, 120, 121,
+ 1, 121, 123, 121, 122, 124, 122, 125,
+ 1, 126, 1, 122, 122, 1, 37, 37,
+ 0, 0, 0, 38, 127, 128, 127, 128,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 129, 129, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 130, 130, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 131, 0, 38, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 132, 132, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 133, 133, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 134,
+ 134, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 135, 135,
+ 0, 0, 0, 0, 0, 0, 1, 136,
+ 136, 0, 0, 0, 137, 0, 0, 0,
+ 0, 0, 0, 1, 136, 136, 137, 1,
+ 137, 139, 137, 138, 140, 138, 141, 1,
+ 142, 1, 138, 138, 1, 37, 37, 0,
+ 0, 0, 38, 143, 143, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 144, 144, 0, 0, 0, 0,
+ 0, 0, 1, 145, 145, 0, 0, 0,
+ 146, 0, 147, 0, 0, 0, 0, 0,
+ 1, 145, 145, 147, 1, 147, 149, 147,
+ 148, 150, 148, 151, 1, 152, 1, 148,
+ 148, 1, 37, 37, 0, 0, 0, 38,
+ 153, 153, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 154,
+ 154, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 155, 155,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 156, 156, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 157, 157, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 158, 158, 0, 0, 0,
+ 0, 0, 0, 1, 159, 159, 0, 0,
+ 0, 160, 0, 0, 0, 0, 0, 0,
+ 1, 159, 159, 160, 1, 160, 162, 160,
+ 161, 163, 161, 164, 1, 165, 1, 161,
+ 161, 1, 37, 37, 0, 0, 0, 38,
+ 166, 166, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 167,
+ 167, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 168, 169,
+ 168, 169, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 170,
+ 170, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 171, 171,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 172, 172, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 173, 173, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 174, 174, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 175, 175, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 176, 176, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 177, 177, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 178,
+ 178, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 179, 0, 38,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 180, 180, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 181, 181, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 182, 182, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 183, 183, 0, 0, 0, 0, 0,
+ 0, 1, 184, 184, 0, 0, 0, 185,
+ 0, 0, 0, 0, 0, 0, 1, 184,
+ 184, 185, 1, 185, 187, 185, 186, 188,
+ 186, 189, 1, 190, 1, 186, 186, 1,
+ 37, 37, 0, 0, 0, 38, 191, 191,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 192, 192, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 193, 193, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 194, 194, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 195, 195, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 196, 196, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 197, 197, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 198,
+ 198, 0, 0, 0, 0, 0, 0, 1,
+ 199, 199, 0, 0, 0, 200, 0, 0,
+ 0, 0, 0, 0, 1, 199, 199, 200,
+ 1, 200, 202, 200, 201, 203, 201, 204,
+ 1, 205, 1, 201, 201, 1, 37, 37,
+ 0, 0, 0, 38, 206, 207, 208, 206,
+ 207, 208, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 209,
+ 209, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 210, 210,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 211, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 212, 212, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 213, 214, 213, 214, 0, 0,
+ 0, 0, 0, 0, 1, 215, 215, 0,
+ 0, 0, 216, 0, 0, 0, 0, 0,
+ 0, 1, 215, 215, 216, 1, 216, 218,
+ 216, 217, 219, 217, 220, 1, 221, 1,
+ 217, 217, 1, 37, 37, 0, 0, 0,
+ 38, 222, 222, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 223, 223, 0, 0, 0, 0, 0, 0,
+ 1, 224, 224, 0, 0, 0, 225, 0,
+ 0, 0, 0, 0, 0, 1, 224, 224,
+ 225, 1, 225, 227, 225, 226, 228, 226,
+ 229, 1, 230, 1, 226, 226, 1, 37,
+ 37, 0, 0, 0, 38, 231, 231, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 232, 232, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 233, 234, 233, 234, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 235, 235, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 236, 236, 0, 0, 0,
+ 0, 0, 0, 1, 237, 237, 0, 0,
+ 0, 238, 0, 0, 0, 0, 0, 0,
+ 1, 237, 237, 238, 1, 238, 240, 238,
+ 239, 241, 239, 242, 1, 243, 1, 239,
+ 239, 1, 37, 37, 0, 0, 0, 38,
+ 244, 244, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 245,
+ 245, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 246, 0, 38,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 247, 248, 249, 250,
+ 247, 248, 249, 250, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 251, 251, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 252, 252, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 253,
+ 253, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 254, 254,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 255, 255, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 256, 256, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 257, 257, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 258, 258, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 259, 259, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 260, 260, 0, 0, 0, 0, 0, 0,
+ 1, 261, 261, 0, 0, 0, 262, 0,
+ 0, 0, 0, 0, 0, 1, 261, 261,
+ 262, 1, 262, 264, 262, 263, 265, 263,
+ 266, 1, 267, 1, 263, 263, 1, 37,
+ 37, 0, 0, 0, 38, 268, 268, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 269, 269, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 270, 270, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 271, 271, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 272, 272, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 273, 273, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 274,
+ 274, 0, 0, 0, 0, 0, 0, 1,
+ 275, 275, 0, 0, 0, 276, 0, 0,
+ 0, 0, 0, 0, 1, 275, 275, 276,
+ 1, 276, 278, 276, 277, 279, 277, 280,
+ 1, 281, 1, 277, 277, 1, 37, 37,
+ 0, 0, 0, 38, 282, 283, 282, 283,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 284, 284, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 285, 285, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 286, 286, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 287, 287, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 288, 288, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 289, 289, 0, 0, 0, 0, 0, 0,
+ 1, 290, 290, 0, 0, 0, 291, 0,
+ 0, 0, 0, 0, 0, 1, 290, 290,
+ 291, 1, 291, 293, 291, 292, 294, 292,
+ 295, 1, 296, 1, 292, 292, 1, 37,
+ 37, 0, 0, 0, 38, 297, 297, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 298, 298, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 299, 299, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 28, 28, 0, 0, 0, 0,
+ 0, 0, 1, 300, 300, 0, 0, 0,
+ 301, 0, 0, 0, 0, 0, 0, 1,
+ 300, 300, 301, 1, 301, 303, 301, 302,
+ 304, 302, 305, 1, 306, 1, 302, 302,
+ 1, 37, 37, 0, 0, 0, 38, 307,
+ 307, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 308, 308,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 309, 309, 0,
+ 0, 0, 0, 0, 0, 1, 310, 310,
+ 0, 0, 0, 311, 0, 0, 0, 0,
+ 0, 0, 1, 310, 310, 311, 1, 311,
+ 313, 311, 312, 314, 312, 315, 1, 316,
+ 1, 312, 312, 1, 37, 37, 0, 0,
+ 0, 38, 317, 317, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 318, 318, 0, 0, 0, 0, 0,
+ 0, 1, 319, 319, 0, 0, 0, 320,
+ 0, 0, 0, 0, 0, 0, 1, 319,
+ 319, 320, 1, 320, 322, 320, 321, 323,
+ 321, 324, 1, 325, 1, 321, 321, 1,
+ 37, 37, 0, 0, 0, 38, 326, 326,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 327, 327, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 328, 328, 0, 0,
+ 0, 0, 0, 0, 1, 329, 329, 0,
+ 0, 0, 330, 0, 0, 0, 0, 0,
+ 0, 1, 329, 329, 330, 1, 330, 332,
+ 330, 331, 333, 331, 334, 1, 335, 1,
+ 331, 331, 1, 37, 37, 0, 0, 0,
+ 38, 336, 337, 338, 336, 337, 338, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 339, 339, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 340, 340, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 341, 341, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 342, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 343,
+ 343, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 344, 344,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 345, 345, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 346, 346, 0, 0,
+ 0, 0, 0, 0, 1, 347, 347, 0,
+ 0, 0, 348, 0, 0, 0, 0, 0,
+ 0, 1, 347, 347, 348, 1, 348, 350,
+ 348, 349, 351, 349, 352, 1, 353, 1,
+ 349, 349, 1, 37, 37, 0, 0, 0,
+ 38, 354, 354, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 355, 355, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 356,
+ 356, 0, 0, 0, 0, 0, 0, 1,
+ 357, 357, 0, 0, 0, 358, 0, 0,
+ 0, 0, 0, 0, 1, 357, 357, 358,
+ 1, 358, 360, 358, 359, 361, 359, 362,
+ 1, 363, 1, 359, 359, 1, 37, 37,
+ 0, 0, 0, 38, 364, 364, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 365, 365, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 366, 366, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 367, 367, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 368, 368, 0, 0, 0, 0, 0, 0,
+ 1, 369, 369, 0, 0, 0, 370, 0,
+ 0, 0, 0, 0, 0, 1, 369, 369,
+ 370, 1, 370, 372, 370, 371, 373, 371,
+ 374, 1, 375, 1, 371, 371, 1, 37,
+ 37, 0, 0, 0, 38, 376, 376, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 377, 377, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 378, 378, 0, 0, 0,
+ 0, 0, 0, 1, 379, 379, 0, 0,
+ 0, 380, 0, 0, 0, 0, 0, 0,
+ 1, 379, 379, 380, 1, 380, 382, 380,
+ 381, 383, 381, 384, 1, 385, 1, 381,
+ 381, 1, 37, 37, 0, 0, 0, 38,
+ 386, 386, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 387,
+ 387, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 388, 388,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 389, 389, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 390, 390, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 391, 391, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 392, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 393, 393, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 394,
+ 394, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 395, 395,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 396, 396, 0,
+ 0, 0, 0, 0, 0, 1, 397, 397,
+ 0, 0, 0, 398, 0, 0, 0, 0,
+ 0, 0, 1, 397, 397, 398, 1, 398,
+ 400, 398, 399, 401, 399, 402, 1, 403,
+ 1, 399, 399, 1, 37, 37, 0, 0,
+ 0, 38, 404, 405, 404, 405, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 406, 406, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 407, 407, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 408, 408, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 409, 409, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 410,
+ 410, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 411, 411,
+ 0, 0, 0, 0, 0, 0, 1, 412,
+ 412, 0, 0, 0, 413, 0, 414, 0,
+ 0, 0, 0, 0, 1, 412, 412, 414,
+ 1, 414, 416, 414, 415, 417, 415, 418,
+ 1, 419, 1, 415, 415, 1, 37, 37,
+ 0, 0, 0, 38, 420, 420, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 421, 421, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 422, 422, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 30, 30, 0, 0, 0, 0, 0,
+ 0, 1, 423, 423, 0, 0, 0, 424,
+ 0, 0, 0, 0, 0, 0, 1, 423,
+ 423, 424, 1, 424, 426, 424, 425, 427,
+ 425, 428, 1, 429, 1, 425, 425, 1,
+ 37, 37, 0, 0, 0, 38, 430, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 431, 431, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 432, 432, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 433, 433, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 434, 434, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 435, 435, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 436, 0,
+ 38, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 437, 437, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 438, 438, 0, 0,
+ 0, 0, 0, 0, 1, 439, 439, 0,
+ 0, 0, 440, 0, 0, 0, 0, 0,
+ 0, 1, 439, 439, 440, 1, 440, 442,
+ 440, 441, 443, 441, 444, 1, 445, 1,
+ 441, 441, 1, 37, 37, 0, 0, 0,
+ 38, 446, 446, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 447, 447, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 448,
+ 448, 0, 0, 0, 0, 0, 0, 1,
+ 449, 449, 0, 0, 0, 450, 0, 0,
+ 0, 0, 0, 0, 1, 449, 449, 450,
+ 1, 450, 452, 450, 451, 453, 451, 454,
+ 1, 455, 1, 451, 451, 1, 37, 37,
+ 0, 0, 0, 38, 456, 457, 456, 457,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 458, 458, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 459, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 460, 460, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 461, 461, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 462, 462, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 463,
+ 463, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 464, 464,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 465, 465, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 466, 466, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 467, 467, 0, 0, 0,
+ 0, 0, 0, 1, 468, 468, 0, 0,
+ 0, 469, 0, 0, 0, 0, 0, 0,
+ 1, 468, 468, 469, 1, 469, 471, 469,
+ 470, 472, 470, 473, 1, 474, 1, 470,
+ 470, 1, 37, 37, 0, 0, 0, 38,
+ 475, 476, 475, 476, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 477, 477, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 478,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 479, 479,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 480, 480, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 481, 481, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 482, 482, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 483, 483, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 484, 484, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 485, 485, 0, 0, 0, 0, 0, 0,
+ 1, 486, 486, 0, 0, 0, 487, 0,
+ 0, 0, 0, 0, 0, 1, 486, 486,
+ 487, 1, 487, 489, 487, 488, 490, 488,
+ 491, 1, 492, 1, 488, 488, 1, 37,
+ 37, 0, 0, 0, 493, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 494, 495, 494, 495, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 496, 496, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 497, 497, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 498, 498, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 499, 499, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 500, 500, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 501,
+ 501, 0, 0, 0, 0, 0, 0, 1,
+ 502, 502, 0, 0, 0, 503, 0, 0,
+ 0, 0, 0, 0, 1, 502, 502, 503,
+ 1, 503, 505, 503, 504, 506, 504, 507,
+ 1, 508, 1, 504, 504, 1, 37, 37,
+ 0, 0, 0, 38, 509, 509, 0, 0,
+ 0, 0, 0, 0, 1, 510, 510, 0,
+ 0, 0, 511, 0, 0, 0, 0, 0,
+ 0, 1, 510, 510, 511, 1, 511, 513,
+ 511, 512, 514, 512, 515, 1, 516, 1,
+ 512, 512, 1, 357, 357, 0, 0, 0,
+ 358, 517, 517, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 518, 518, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 519,
+ 519, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 520, 520,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 521, 521, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 522, 522, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 523, 523, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 524, 524, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 525, 525, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 526, 526, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 527,
+ 527, 0, 0, 0, 0, 0, 0, 1,
+ 528, 528, 0, 0, 0, 529, 0, 0,
+ 0, 0, 0, 0, 1, 528, 528, 529,
+ 1, 529, 531, 529, 530, 532, 530, 533,
+ 1, 534, 1, 530, 530, 1, 37, 37,
+ 0, 0, 0, 535, 0, 38, 536, 537,
+ 536, 537, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 538, 539,
+ 540, 541, 542, 543, 544, 545, 538, 539,
+ 540, 541, 542, 543, 544, 545, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 546, 547, 548, 546, 547,
+ 548, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 549, 549,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 550, 550, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 551, 551, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 552, 552, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 553, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 554, 554, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 555,
+ 555, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 556, 556,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 557, 557, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 558, 558, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 559, 559, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 560, 560, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 561, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 562,
+ 562, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 563, 563,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 564, 564, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 565, 565, 0, 0,
+ 0, 0, 0, 0, 1, 566, 566, 0,
+ 0, 0, 567, 0, 0, 0, 0, 0,
+ 0, 1, 566, 566, 567, 1, 567, 569,
+ 567, 568, 570, 568, 571, 1, 572, 1,
+ 568, 568, 1, 37, 37, 0, 0, 0,
+ 38, 573, 573, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 574, 574, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 575,
+ 575, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 576, 576,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 577, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 578, 578, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 579, 579, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 580, 580, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 581, 581, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 582,
+ 582, 0, 0, 0, 0, 0, 0, 1,
+ 583, 583, 0, 0, 0, 584, 0, 0,
+ 0, 0, 0, 0, 1, 583, 583, 584,
+ 1, 584, 586, 584, 585, 587, 585, 588,
+ 1, 589, 1, 585, 585, 1, 37, 37,
+ 0, 0, 0, 38, 590, 590, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 591, 592, 591, 592, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 593, 593, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 594, 594, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 595, 595, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 596, 596, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 597,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 598, 598,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 599, 599, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 600, 600, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 601, 601, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 602, 602, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 603, 603, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 604, 604, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 605,
+ 605, 0, 0, 0, 0, 0, 0, 1,
+ 606, 606, 0, 0, 0, 607, 0, 0,
+ 0, 0, 0, 0, 1, 606, 606, 607,
+ 1, 607, 609, 607, 608, 610, 608, 611,
+ 1, 612, 1, 608, 608, 1, 37, 37,
+ 0, 0, 0, 38, 613, 613, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 614, 614, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 615, 615, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 616, 616, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 617, 617, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 618,
+ 618, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 619, 0, 38,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 620, 620, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 621, 621, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 622, 622, 0, 0, 0, 0,
+ 0, 0, 1, 623, 623, 0, 0, 0,
+ 624, 0, 0, 0, 0, 0, 0, 1,
+ 623, 623, 624, 1, 624, 626, 624, 625,
+ 627, 625, 628, 1, 629, 1, 625, 625,
+ 1, 37, 37, 0, 0, 0, 38, 630,
+ 631, 630, 631, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 632, 632, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 633,
+ 633, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 634, 634,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 635, 635, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 636, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 637, 637, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 638, 638, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 639, 639, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 640,
+ 640, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 641, 641,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 642, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 643, 643, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 644, 644, 0, 0, 0, 0,
+ 0, 0, 1, 645, 645, 0, 0, 0,
+ 646, 0, 0, 0, 0, 0, 0, 1,
+ 645, 645, 646, 1, 646, 648, 646, 647,
+ 649, 647, 650, 1, 651, 1, 647, 647,
+ 1, 37, 37, 0, 0, 0, 38, 652,
+ 652, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 653, 653,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 654, 654, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 655, 655, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 656, 656, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 657, 657, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 658, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 659,
+ 660, 659, 660, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 661, 661, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 662,
+ 662, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 663, 663,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 664, 664, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 665, 665, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 666, 666, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 667, 667, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 668, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 669,
+ 669, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 670, 670,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 671, 671, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 672, 672, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 673, 673, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 674, 674, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 675, 675, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 676, 676, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 677,
+ 677, 0, 0, 0, 0, 0, 0, 1,
+ 678, 678, 0, 0, 0, 679, 0, 0,
+ 0, 0, 0, 0, 1, 678, 678, 679,
+ 1, 679, 681, 679, 680, 682, 680, 683,
+ 1, 684, 1, 680, 680, 1, 37, 37,
+ 0, 0, 0, 38, 685, 685, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 686, 686, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 687, 687, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 688, 688, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 689, 689, 0, 0, 0, 0, 0, 0,
+ 1, 690, 690, 0, 0, 0, 691, 0,
+ 0, 0, 0, 0, 0, 1, 690, 690,
+ 691, 1, 691, 693, 691, 692, 694, 692,
+ 695, 1, 696, 1, 692, 692, 1, 37,
+ 37, 0, 0, 0, 38, 697, 697, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 698, 698, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 699, 0, 38, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 700, 701, 702, 703, 704, 700, 701,
+ 702, 703, 704, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 705, 705, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 706,
+ 706, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 707, 707,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 708, 708, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 709, 709, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 710, 710, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 711, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 712, 712, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 713,
+ 713, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 714, 714,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 715, 715, 0,
+ 0, 0, 0, 0, 0, 1, 716, 716,
+ 0, 0, 0, 717, 0, 0, 0, 0,
+ 0, 0, 1, 716, 716, 717, 1, 717,
+ 719, 717, 718, 720, 718, 721, 1, 722,
+ 1, 718, 718, 1, 37, 37, 0, 0,
+ 0, 38, 723, 723, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 724, 724, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 725, 725, 0, 0, 0, 0, 0, 0,
+ 1, 726, 726, 0, 0, 0, 727, 0,
+ 0, 0, 0, 0, 0, 1, 726, 726,
+ 727, 1, 727, 729, 727, 728, 730, 728,
+ 731, 1, 732, 1, 728, 728, 1, 37,
+ 37, 0, 0, 0, 38, 733, 733, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 734, 734, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 735, 735, 0, 0, 0,
+ 0, 0, 0, 1, 736, 736, 0, 0,
+ 0, 737, 0, 0, 0, 0, 0, 0,
+ 1, 736, 736, 737, 1, 737, 739, 737,
+ 738, 740, 738, 741, 1, 742, 1, 738,
+ 738, 1, 37, 37, 0, 0, 0, 38,
+ 743, 743, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 744,
+ 744, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 745, 745,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 746, 746, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 747, 747, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 748, 748, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 749, 749, 0, 0, 0, 0,
+ 0, 0, 1, 750, 750, 0, 0, 0,
+ 751, 0, 0, 0, 0, 0, 0, 1,
+ 750, 750, 751, 1, 751, 753, 751, 752,
+ 754, 752, 755, 1, 756, 1, 752, 752,
+ 1, 37, 37, 0, 0, 0, 38, 757,
+ 757, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 758, 758,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 759, 759, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 760, 760, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 761, 0, 38, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 762, 762, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 763, 763, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 764,
+ 764, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 765, 765,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 766, 766, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 767, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 768, 768, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 769, 769, 0, 0, 0, 0, 0,
+ 0, 1, 770, 770, 0, 0, 0, 771,
+ 0, 0, 0, 0, 0, 0, 1, 770,
+ 770, 771, 1, 771, 773, 771, 772, 774,
+ 772, 775, 1, 776, 1, 772, 772, 1,
+ 37, 37, 0, 0, 0, 38, 777, 777,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 778, 778, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 779, 779, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 780, 780, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 781, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 782, 782, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 783,
+ 783, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 784, 784,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 785, 785, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 786, 786, 0, 0,
+ 0, 0, 0, 0, 1, 787, 787, 0,
+ 0, 0, 788, 0, 0, 0, 0, 0,
+ 0, 1, 787, 787, 788, 1, 788, 790,
+ 788, 789, 791, 789, 792, 1, 793, 1,
+ 789, 789, 1, 37, 37, 0, 0, 0,
+ 38, 794, 794, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 795, 795, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 796,
+ 796, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 797, 797,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 798, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 799, 799, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 800, 800, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 801, 801, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 802, 802, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 803,
+ 803, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 804, 804,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 805, 805, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 806, 806, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 807, 807, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 808, 808, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 809, 809, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 810, 810, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 811,
+ 811, 0, 0, 0, 0, 0, 0, 1,
+ 812, 812, 0, 0, 0, 813, 0, 0,
+ 0, 0, 0, 0, 1, 812, 812, 813,
+ 1, 813, 815, 813, 814, 816, 814, 817,
+ 1, 818, 1, 814, 814, 1, 37, 37,
+ 0, 0, 0, 38, 819, 819, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 820, 821, 820, 821, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 822, 822, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 823, 823, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 824, 824, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 825, 825, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 826, 826, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 827,
+ 827, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 828, 0, 38,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 829, 829, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 830, 830, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 831, 831, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 832, 832, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 833, 833, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 834,
+ 834, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 835, 835,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 836, 836, 0,
+ 0, 0, 0, 0, 0, 1, 837, 837,
+ 0, 0, 0, 838, 0, 0, 0, 0,
+ 0, 0, 1, 837, 837, 838, 1, 838,
+ 840, 838, 839, 841, 839, 842, 1, 843,
+ 1, 839, 839, 1, 37, 37, 0, 0,
+ 0, 38, 844, 844, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 845, 845, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 846, 846, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 847,
+ 847, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 848, 0, 38,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 849, 849, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 850, 850, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 851, 851, 0, 0, 0, 0,
+ 0, 0, 1, 852, 852, 0, 0, 0,
+ 853, 0, 0, 0, 0, 0, 0, 1,
+ 852, 852, 853, 1, 853, 855, 853, 854,
+ 856, 854, 857, 1, 858, 1, 854, 854,
+ 1, 37, 37, 0, 0, 0, 38, 859,
+ 859, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 860, 860,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 861, 861, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 862, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 863, 863, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 864, 864, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 865, 865, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 866,
+ 866, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 867, 867,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 868, 868, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 869, 869, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 870, 870, 0, 0, 0,
+ 0, 0, 0, 1, 871, 871, 0, 0,
+ 0, 872, 0, 0, 0, 0, 0, 0,
+ 1, 871, 871, 872, 1, 872, 874, 872,
+ 873, 875, 873, 876, 1, 877, 1, 873,
+ 873, 1, 37, 37, 0, 0, 0, 38,
+ 878, 878, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 879,
+ 879, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 880, 880,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 881, 881, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 882, 882, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 883, 883, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 884, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 885, 885, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 886,
+ 886, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 887, 887,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 888, 888, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 889, 889, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 890, 890, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 891, 891, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 892, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 893,
+ 893, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 894, 894,
+ 0, 0, 0, 0, 0, 0, 1, 895,
+ 895, 0, 0, 0, 896, 0, 0, 0,
+ 0, 0, 0, 1, 895, 895, 896, 1,
+ 896, 898, 896, 897, 899, 897, 900, 1,
+ 901, 1, 897, 897, 1, 37, 37, 0,
+ 0, 0, 38, 902, 902, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 903, 903, 0, 0, 0, 0,
+ 0, 0, 1, 904, 904, 0, 0, 0,
+ 905, 0, 0, 0, 0, 0, 0, 1,
+ 904, 904, 905, 1, 905, 907, 905, 906,
+ 908, 906, 909, 1, 910, 1, 906, 906,
+ 1, 37, 37, 0, 0, 0, 38, 911,
+ 912, 911, 912, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 913, 914, 913, 914, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 915, 915, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 916, 916, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 917,
+ 917, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 918, 918,
+ 0, 0, 0, 0, 0, 0, 1, 919,
+ 919, 0, 0, 0, 920, 0, 0, 0,
+ 0, 0, 0, 1, 919, 919, 920, 1,
+ 920, 922, 920, 921, 923, 921, 924, 1,
+ 925, 1, 921, 921, 1, 37, 37, 0,
+ 0, 0, 38, 926, 926, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 927, 927, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 928, 928, 0, 0, 0, 0, 0,
+ 0, 1, 929, 929, 0, 0, 0, 930,
+ 0, 0, 0, 0, 0, 0, 1, 929,
+ 929, 930, 1, 930, 932, 930, 931, 933,
+ 931, 934, 1, 935, 1, 931, 931, 1,
+ 37, 37, 0, 0, 0, 38, 936, 936,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 937, 937, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 938, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 939, 940, 939, 940, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 941, 941, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 942, 942, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 943, 943, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 944, 945, 944, 945, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 946, 946, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 947, 947, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 948,
+ 948, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 949, 949,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 950, 950, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 951, 951, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 952, 952, 0, 0, 0,
+ 0, 0, 0, 1, 953, 953, 0, 0,
+ 0, 954, 0, 0, 0, 0, 0, 0,
+ 1, 953, 953, 954, 1, 954, 956, 954,
+ 955, 957, 955, 958, 1, 959, 1, 955,
+ 955, 1, 37, 37, 0, 0, 0, 38,
+ 960, 960, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 961,
+ 961, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 962, 962,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 963, 963, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 964, 964, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 965, 965, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 966, 966, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 967, 967, 0, 0, 0, 0, 0,
+ 0, 1, 968, 968, 0, 0, 0, 969,
+ 0, 0, 0, 0, 0, 0, 1, 968,
+ 968, 969, 1, 969, 971, 969, 970, 972,
+ 970, 973, 1, 974, 1, 970, 970, 1,
+ 37, 37, 0, 0, 0, 38, 975, 975,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 976, 976, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 977, 977, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 978, 978, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 979, 979, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 980, 980, 0, 0, 0, 0, 0,
+ 0, 1, 981, 981, 0, 0, 0, 982,
+ 0, 0, 0, 0, 0, 0, 1, 981,
+ 981, 982, 1, 982, 984, 982, 983, 985,
+ 983, 986, 1, 987, 1, 983, 983, 1,
+ 37, 37, 0, 0, 0, 38, 988, 989,
+ 990, 991, 988, 989, 990, 991, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 992, 992, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 993, 993, 0, 0, 0, 0,
+ 0, 0, 1, 994, 994, 0, 0, 0,
+ 995, 0, 0, 0, 0, 0, 0, 1,
+ 994, 994, 995, 1, 995, 997, 995, 996,
+ 998, 996, 999, 1, 1000, 1, 996, 996,
+ 1, 37, 37, 0, 0, 0, 38, 1001,
+ 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1001,
+ 1002, 1003, 1004, 1005, 1006, 1007, 1008, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1009, 1009, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1010, 1010, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1011, 1011, 0, 0, 0, 0,
+ 0, 0, 1, 1012, 1012, 0, 0, 0,
+ 1013, 0, 0, 0, 0, 0, 0, 1,
+ 1012, 1012, 1013, 1, 1013, 1015, 1013, 1014,
+ 1016, 1014, 1017, 1, 1018, 1, 1014, 1014,
+ 1, 37, 37, 0, 0, 0, 38, 1019,
+ 1019, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1020, 1020,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1021, 1021, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 1022, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1023, 1023, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1024, 1024, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1025, 1025, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1026,
+ 1026, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1027, 1027,
+ 0, 0, 0, 0, 0, 0, 1, 1028,
+ 1028, 0, 0, 0, 1029, 0, 0, 0,
+ 0, 0, 0, 1, 1028, 1028, 1029, 1,
+ 1029, 1031, 1029, 1030, 1032, 1030, 1033, 1,
+ 1034, 1, 1030, 1030, 1, 37, 37, 0,
+ 0, 0, 38, 1035, 1035, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1036, 1036, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 1037, 0, 38, 1038, 1038, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1039, 1040, 1039, 1040, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1041, 1041, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1042, 1042, 0, 0, 0, 0, 0,
+ 0, 1, 1043, 1043, 0, 0, 0, 1044,
+ 0, 0, 0, 0, 0, 0, 1, 1043,
+ 1043, 1044, 1, 1044, 1046, 1044, 1045, 1047,
+ 1045, 1048, 1, 1049, 1, 1045, 1045, 1,
+ 37, 37, 0, 0, 0, 38, 1050, 1050,
+ 0, 0, 0, 0, 0, 0, 1, 1051,
+ 1051, 0, 0, 0, 1052, 0, 0, 0,
+ 0, 0, 0, 1, 1051, 1051, 1052, 1,
+ 1052, 1054, 1052, 1053, 1055, 1053, 1056, 1,
+ 1057, 1, 1053, 1053, 1, 37, 37, 0,
+ 0, 0, 38, 1058, 1058, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1059, 1059, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 1060, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1061,
+ 1061, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 20, 20,
+ 0, 0, 0, 0, 0, 0, 1, 1062,
+ 1062, 0, 0, 0, 1063, 0, 0, 0,
+ 0, 0, 0, 1, 1062, 1062, 1063, 1,
+ 1063, 1065, 1063, 1064, 1066, 1064, 1067, 1,
+ 1068, 1, 1064, 1064, 1, 37, 37, 0,
+ 0, 0, 38, 1069, 1069, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1070, 1070, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1071, 1071, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 1072,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1073, 1073,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1074, 1074, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1075, 1075, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1076, 1076, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1077, 1077, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1078, 1078, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1079, 1079, 0, 0, 0, 0, 0, 0,
+ 1, 1080, 1080, 0, 0, 0, 1081, 0,
+ 0, 0, 0, 0, 0, 1, 1080, 1080,
+ 1081, 1, 1081, 1083, 1081, 1082, 1084, 1082,
+ 1085, 1, 1086, 1, 1082, 1082, 1, 37,
+ 37, 0, 0, 0, 38, 1087, 1087, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1088, 1089, 1088, 1089,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1090, 1090, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1091, 1091, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1092, 1092, 0, 0, 0,
+ 0, 0, 0, 1, 1093, 1093, 0, 0,
+ 0, 1094, 0, 0, 0, 0, 0, 0,
+ 1, 1093, 1093, 1094, 1, 1094, 1096, 1094,
+ 1095, 1097, 1095, 1098, 1, 1099, 1, 1095,
+ 1095, 1, 37, 37, 0, 0, 0, 1100,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1101, 1101,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1102, 1102, 0,
+ 0, 0, 0, 0, 0, 1, 1103, 1103,
+ 0, 0, 0, 1104, 0, 0, 0, 0,
+ 0, 0, 1, 1103, 1103, 1104, 1, 1104,
+ 1106, 1104, 1105, 1107, 1105, 1108, 1, 1109,
+ 1, 1105, 1105, 1, 37, 37, 0, 0,
+ 0, 38, 1110, 1110, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1111, 1112, 1111, 1112, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1113, 1113, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1114, 1114, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 1115,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1116, 1116,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1117, 1117, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1118, 1118, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1119, 1119, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1120, 1120, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1121, 1121, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1122, 1122, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1123,
+ 1123, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1124, 1124,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1125, 1125, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1126, 1126, 0, 0,
+ 0, 0, 0, 0, 1, 1127, 1127, 0,
+ 0, 0, 1128, 0, 0, 0, 0, 0,
+ 0, 1, 1127, 1127, 1128, 1, 1128, 1130,
+ 1128, 1129, 1131, 1129, 1132, 1, 1133, 1,
+ 1129, 1129, 1, 37, 37, 0, 0, 0,
+ 38, 1134, 1134, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1135, 1135, 0, 0, 0, 0, 0, 0,
+ 1, 1136, 1136, 0, 0, 0, 1137, 0,
+ 0, 0, 0, 0, 0, 1, 1136, 1136,
+ 1137, 1, 1137, 1139, 1137, 1138, 1140, 1138,
+ 1141, 1, 1142, 1, 1138, 1138, 1, 37,
+ 37, 0, 0, 0, 38, 1143, 1143, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1144, 1144, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1145, 1145, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1146, 1146, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1147, 1147, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 1148,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1149, 1149,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1150, 1150, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1151, 1151, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1152, 1152, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1153, 1153, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1154, 1154, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1155, 1155, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1156,
+ 1156, 0, 0, 0, 0, 0, 0, 1,
+ 1157, 1157, 0, 0, 0, 1158, 0, 0,
+ 0, 0, 0, 0, 1, 1157, 1157, 1158,
+ 1, 1158, 1160, 1158, 1159, 1161, 1159, 1162,
+ 1, 1163, 1, 1159, 1159, 1, 37, 37,
+ 0, 0, 0, 38, 1164, 1164, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1165, 1165, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 1166, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1167, 1167, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1168,
+ 1168, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1169, 1169,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1170, 1170, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1171, 1171, 0, 0,
+ 0, 0, 0, 0, 1, 1172, 1172, 0,
+ 0, 0, 1173, 0, 0, 0, 0, 0,
+ 0, 1, 1172, 1172, 1173, 1, 1173, 1175,
+ 1173, 1174, 1176, 1174, 1177, 1, 1178, 1,
+ 1174, 1174, 1, 37, 37, 0, 0, 0,
+ 38, 1179, 1179, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1180, 1180, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1181,
+ 1181, 0, 0, 0, 0, 0, 0, 1,
+ 1182, 1182, 0, 0, 0, 1183, 0, 0,
+ 0, 0, 0, 0, 1, 1182, 1182, 1183,
+ 1, 1183, 1185, 1183, 1184, 1186, 1184, 1187,
+ 1, 1188, 1, 1184, 1184, 1, 37, 37,
+ 0, 0, 0, 38, 1189, 1189, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1190, 1190, 0, 0, 0,
+ 0, 0, 0, 1, 1191, 1191, 0, 0,
+ 0, 1192, 0, 0, 0, 0, 0, 0,
+ 1, 1191, 1191, 1192, 1, 1192, 1194, 1192,
+ 1193, 1195, 1193, 1196, 1, 1197, 1, 1193,
+ 1193, 1, 1198, 1198, 0, 0, 0, 1199,
+ 1200, 1201, 1202, 1200, 1201, 1202, 0, 0,
+ 0, 0, 0, 0, 1, 1198, 1198, 1199,
+ 1, 1199, 1204, 1199, 1203, 1205, 1203, 1206,
+ 1, 1207, 1, 1203, 1203, 1, 37, 37,
+ 0, 0, 0, 38, 1208, 1209, 1210, 1208,
+ 1209, 1210, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1211,
+ 1211, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1212, 1212,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1213, 1213, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1214, 1214, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1215, 1215, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 1216, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1217, 1218, 1219, 1217, 1218, 1219, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1220, 1220, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1221, 1221, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1222, 1222, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1223, 1223, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1224,
+ 1224, 0, 0, 0, 0, 0, 0, 1,
+ 1225, 1225, 0, 0, 0, 1226, 0, 0,
+ 0, 0, 0, 0, 1, 1225, 1225, 1226,
+ 1, 1226, 1228, 1226, 1227, 1229, 1227, 1230,
+ 1, 1231, 1, 1227, 1227, 1, 37, 37,
+ 0, 0, 0, 38, 1232, 1232, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1233, 1233, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1234, 1234, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1235, 1235, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1236, 1236, 0, 0, 0, 0, 0, 0,
+ 1, 1237, 1237, 0, 0, 0, 1238, 0,
+ 0, 0, 0, 0, 0, 1, 1237, 1237,
+ 1238, 1, 1238, 1240, 1238, 1239, 1241, 1239,
+ 1242, 1, 1243, 1, 1239, 1239, 1, 37,
+ 37, 0, 0, 0, 38, 1244, 1244, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1245, 1245, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1246, 1246, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1247, 1247, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1248, 1248, 0, 0, 0, 0, 0,
+ 0, 1, 1249, 1249, 0, 0, 0, 1250,
+ 0, 0, 0, 0, 0, 0, 1, 1249,
+ 1249, 1250, 1, 1250, 1252, 1250, 1251, 1253,
+ 1251, 1254, 1, 1255, 1, 1251, 1251, 1,
+ 37, 37, 0, 0, 0, 38, 1256, 1256,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1257, 1258, 1257,
+ 1258, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1259, 1259,
+ 0, 0, 0, 0, 0, 0, 1, 1260,
+ 1260, 0, 0, 0, 1261, 0, 0, 0,
+ 0, 0, 0, 1, 1260, 1260, 1261, 1,
+ 1261, 1263, 1261, 1262, 1264, 1262, 1265, 1,
+ 1266, 1, 1262, 1262, 1, 37, 37, 0,
+ 0, 0, 38, 1267, 1267, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1268, 1268, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 1269, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1270,
+ 1270, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1271, 1271,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1272, 1272, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1273, 1273, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1274, 1274, 0, 0, 0,
+ 0, 0, 0, 1, 1275, 1275, 0, 0,
+ 0, 1276, 0, 0, 0, 0, 0, 0,
+ 1, 1275, 1275, 1276, 1, 1276, 1278, 1276,
+ 1277, 1279, 1277, 1280, 1, 1281, 1, 1277,
+ 1277, 1, 37, 37, 0, 0, 0, 38,
+ 1282, 1282, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1283,
+ 1283, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1284, 1284,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1285, 1285, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 1286, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1287, 1287, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1288, 1288, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1289, 1289, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1290,
+ 1290, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1291, 1291,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1292, 1292, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 35, 35, 0, 0,
+ 0, 0, 0, 0, 1, 1293, 1293, 0,
+ 0, 0, 1294, 0, 0, 0, 0, 0,
+ 0, 1, 1293, 1293, 1294, 1, 1294, 1296,
+ 1294, 1295, 1297, 1295, 1298, 1, 1299, 1,
+ 1295, 1295, 1, 37, 37, 0, 0, 0,
+ 38, 1300, 1300, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 1301,
+ 0, 38, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1302, 1303,
+ 1302, 1303, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1304,
+ 1304, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1305, 1305,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1306, 1306, 0,
+ 0, 0, 0, 0, 0, 1, 1307, 1307,
+ 0, 0, 0, 1308, 0, 0, 0, 0,
+ 0, 0, 1, 1307, 1307, 1308, 1, 1308,
+ 1310, 1308, 1309, 1311, 1309, 1312, 1, 1313,
+ 1, 1309, 1309, 1, 37, 37, 0, 0,
+ 0, 38, 1314, 1314, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 1315, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1316,
+ 1316, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1317, 1317,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1318, 1318, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1319, 1319, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1320, 1320, 0, 0, 0,
+ 0, 0, 0, 1, 1321, 1321, 0, 0,
+ 0, 1322, 0, 0, 0, 0, 0, 0,
+ 1, 1321, 1321, 1322, 1, 1322, 1324, 1322,
+ 1323, 1325, 1323, 1326, 1, 1327, 1, 1323,
+ 1323, 1, 37, 37, 0, 0, 0, 38,
+ 1328, 1329, 1328, 1329, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1330, 1331, 1330, 1331, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1332, 1332, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1333, 1333, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1334, 1334, 0, 0, 0, 0, 0, 0,
+ 1, 1198, 1198, 0, 0, 0, 1199, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1335, 1335, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1336, 1336, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1337, 1337, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1338, 1338, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1339, 1339, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1340,
+ 1340, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1341, 1341,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1342, 1342, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 1343, 0, 38, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1344, 1344, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1345, 1345, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1346, 1346, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1347,
+ 1347, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1348, 1348,
+ 0, 0, 0, 0, 0, 0, 1, 1349,
+ 1349, 0, 0, 0, 1350, 0, 0, 0,
+ 0, 0, 0, 1, 1349, 1349, 1350, 1,
+ 1350, 1352, 1350, 1351, 1353, 1351, 1354, 1,
+ 1355, 1, 1351, 1351, 1, 37, 37, 0,
+ 0, 0, 38, 1356, 1356, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1357, 1357, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1358, 1358, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1359, 1359, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1360,
+ 1360, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 27, 27,
+ 0, 0, 0, 0, 0, 0, 1, 1361,
+ 1361, 0, 0, 0, 1362, 0, 0, 0,
+ 0, 0, 0, 1, 1361, 1361, 1362, 1,
+ 1362, 1364, 1362, 1363, 1365, 1363, 1366, 1,
+ 1367, 1, 1363, 1363, 1, 37, 37, 0,
+ 0, 0, 38, 1368, 1369, 1370, 1368, 1369,
+ 1370, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1371, 1371,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1372, 1372, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1373, 1373, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1374, 1374, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 1375, 0, 38, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1376, 1376, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1377,
+ 1377, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1378, 1378,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1379, 1379, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1380, 1380, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1381, 1381, 0, 0, 0,
+ 0, 0, 0, 1, 1382, 1382, 0, 0,
+ 0, 1383, 0, 0, 0, 0, 0, 0,
+ 1, 1382, 1382, 1383, 1, 1383, 1385, 1383,
+ 1384, 1386, 1384, 1387, 1, 1388, 1, 1384,
+ 1384, 1, 37, 37, 0, 0, 0, 38,
+ 1389, 1389, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1390,
+ 1390, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1391, 1391,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1392, 1392, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1393, 1393, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1394, 1394, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1395, 1395, 0, 0, 0, 0,
+ 0, 0, 1, 1396, 1396, 0, 0, 0,
+ 1397, 0, 0, 0, 0, 0, 0, 1,
+ 1396, 1396, 1397, 1, 1397, 1399, 1397, 1398,
+ 1400, 1398, 1401, 1, 1402, 1, 1398, 1398,
+ 1, 1403, 1403, 0, 0, 0, 1404, 0,
+ 0, 0, 0, 0, 0, 1, 1403, 1403,
+ 1404, 1, 1404, 1406, 1404, 1405, 1407, 1405,
+ 1408, 1, 1409, 1, 1405, 1405, 1, 37,
+ 37, 0, 0, 0, 38, 1410, 1411, 1410,
+ 1411, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1412, 1412,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1413, 1413, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1414, 1414, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1415, 1415, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1416, 1416, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1417, 1417, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1418, 1418, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1419,
+ 1419, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1420, 1420,
+ 0, 0, 0, 0, 0, 0, 1, 1421,
+ 1421, 0, 0, 0, 1422, 0, 0, 0,
+ 0, 0, 0, 1, 1421, 1421, 1422, 1,
+ 1422, 1424, 1422, 1423, 1425, 1423, 1426, 1,
+ 1427, 1, 1423, 1423, 1, 37, 37, 0,
+ 0, 0, 38, 1428, 1428, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1429, 1429, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 1430, 0, 38, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1431,
+ 1431, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1432, 1432,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1433, 1433, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1434, 1434, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1435, 1435, 0, 0, 0,
+ 0, 0, 0, 1, 1436, 1436, 0, 0,
+ 0, 1437, 0, 0, 0, 0, 0, 0,
+ 1, 1436, 1436, 1437, 1, 1437, 1439, 1437,
+ 1438, 1440, 1438, 1441, 1, 1442, 1, 1438,
+ 1438, 1, 37, 37, 0, 0, 0, 38,
+ 1443, 1443, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1444,
+ 1444, 0, 0, 0, 0, 0, 0, 1,
+ 1445, 1445, 0, 0, 0, 1446, 0, 0,
+ 0, 0, 0, 0, 1, 1445, 1445, 1446,
+ 1, 1446, 1448, 1446, 1447, 1449, 1447, 1450,
+ 1, 1451, 1, 1447, 1447, 1, 37, 37,
+ 0, 0, 0, 38, 1452, 1453, 1452, 1453,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1454, 1454, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1455, 1455, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1456, 1456, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1457, 1457, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1458, 1458, 0, 0, 0, 0, 0,
+ 0, 1, 1459, 1459, 0, 0, 0, 1460,
+ 0, 0, 0, 0, 0, 0, 1, 1459,
+ 1459, 1460, 1, 1460, 1462, 1460, 1461, 1463,
+ 1461, 1464, 1, 1465, 1, 1461, 1461, 1,
+ 37, 37, 0, 0, 0, 38, 1466, 1466,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 1467, 0, 38, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1468, 1468, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1469, 1469, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1470, 1470, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1471, 1471, 0, 0, 0, 0, 0, 0,
+ 1, 37, 37, 0, 0, 0, 38, 1472,
+ 1472, 0, 0, 0, 0, 0, 0, 1,
+ 37, 37, 0, 0, 0, 38, 1473, 1473,
+ 0, 0, 0, 0, 0, 0, 1, 37,
+ 37, 0, 0, 0, 38, 1474, 1474, 0,
+ 0, 0, 0, 0, 0, 1, 37, 37,
+ 0, 0, 0, 38, 1475, 1475, 0, 0,
+ 0, 0, 0, 0, 1, 37, 37, 0,
+ 0, 0, 38, 1476, 1476, 0, 0, 0,
+ 0, 0, 0, 1, 37, 37, 0, 0,
+ 0, 38, 1477, 1477, 0, 0, 0, 0,
+ 0, 0, 1, 37, 37, 0, 0, 0,
+ 38, 1478, 1478, 0, 0, 0, 0, 0,
+ 0, 1, 37, 37, 0, 0, 0, 38,
+ 1479, 1479, 0, 0, 0, 0, 0, 0,
+ 1, 1480, 1480, 0, 0, 0, 1481, 0,
+ 0, 0, 0, 0, 0, 1, 1480, 1480,
+ 1481, 1, 1481, 1481, 1483, 1483, 1482, 1482,
+ 1, 1484, 1485, 1482, 1482, 1, 1487, 1486,
+ 1488, 1486, 1486, 1, 1486, 1488, 1486, 1486,
+ 1, 1489, 1, 42, 1489, 1, 1490, 1,
+ 1482, 1482, 1, 69, 69, 0, 0, 0,
+ 70, 44, 45, 46, 44, 45, 46, 0,
+ 0, 0, 0, 0, 0, 1, 310, 310,
+ 0, 0, 0, 311, 206, 207, 208, 206,
+ 207, 208, 0, 0, 0, 0, 0, 0,
+ 1, 1127, 1127, 0, 0, 0, 1128, 326,
+ 326, 0, 0, 0, 0, 0, 0, 1,
+ 275, 275, 0, 0, 0, 276, 336, 337,
+ 338, 336, 337, 338, 0, 0, 0, 0,
+ 0, 0, 1, 379, 379, 0, 0, 0,
+ 380, 376, 376, 0, 0, 0, 0, 0,
+ 0, 1, 215, 215, 0, 0, 0, 216,
+ 404, 405, 404, 405, 0, 0, 0, 0,
+ 0, 0, 1, 1080, 1080, 0, 0, 0,
+ 1081, 446, 446, 0, 0, 0, 0, 0,
+ 0, 1, 237, 237, 0, 0, 0, 238,
+ 456, 457, 456, 457, 0, 0, 0, 0,
+ 0, 0, 1, 1051, 1051, 0, 0, 0,
+ 1052, 988, 989, 990, 991, 988, 989, 990,
+ 991, 0, 0, 0, 0, 0, 0, 1,
+ 1403, 1403, 0, 0, 0, 1404, 1368, 1369,
+ 1370, 1368, 1369, 1370, 0, 0, 0, 0,
+ 0, 0, 1, 159, 159, 0, 0, 0,
+ 160, 1410, 1411, 1410, 1411, 0, 0, 0,
+ 0, 0, 0, 1, 1445, 1445, 0, 0,
+ 0, 1446, 1443, 1443, 0, 0, 0, 0,
+ 0, 0, 1, 412, 412, 0, 0, 0,
+ 414, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1486, 1488, 1486, 1486, 1, 0
+ };
-static const unsigned char _tsip_machine_parser_headers_trans_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 185, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 9, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 11, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 13,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 15, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 19, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 0, 0, 23, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 25, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 27, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 29, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 31,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 35, 0, 0, 0, 0,
- 0, 0, 0, 0, 37, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 39, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 41, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 43, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 45, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 47, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 49, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 51, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 53, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 55, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 57, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 59, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 63, 0, 0, 0, 0,
- 0, 0, 0, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 67, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 69, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 71, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 73, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 77, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 79, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 81,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 83, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 85, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 87, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 89, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 91,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 93, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 95, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 97, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 99, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 101, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 103, 0, 0, 0,
- 0, 0, 0, 0, 0, 105, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 107, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 109, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 111, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 113, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 115, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 117,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 119, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 121, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 123, 0, 0, 0, 0, 0, 0, 0,
- 125, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 127, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 129, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 131, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 133, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 135, 0, 0, 0,
- 0, 0, 0, 0, 0, 137, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 139, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 141, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 143, 0, 0, 0, 0,
- 0, 0, 0, 0, 145, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 163, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 147, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 149, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 151, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 153, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 155, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 157, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 159, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 161, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 165, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 167, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 169, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 171, 0, 0, 0, 0, 0, 0,
- 173, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 175, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 177, 0, 0, 0, 0, 0, 0,
- 0, 0, 179, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 181, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 185,
- 0, 183, 0
-};
+ static const short _tsip_machine_parser_headers_trans_targs[] = {
+ 2, 0, 9, 162, 275, 285, 323, 333,
+ 351, 392, 402, 460, 478, 908, 1105, 1267,
+ 1307, 1339, 1348, 1385, 971, 1386, 1387, 1388,
+ 1389, 1390, 1391, 1260, 249, 1392, 369, 1393,
+ 1394, 1395, 1396, 1193, 1397, 3, 4, 5,
+ 7, 6, 1398, 8, 10, 86, 123, 11,
+ 12, 13, 14, 15, 21, 16, 17, 19,
+ 18, 1398, 20, 22, 35, 49, 63, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31,
+ 33, 32, 1398, 34, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 47, 46,
+ 1398, 48, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 61, 60, 1398, 62,
+ 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 84, 83, 1398, 85, 87,
+ 101, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 99, 98, 1398, 100, 102,
+ 103, 104, 110, 105, 106, 108, 107, 1398,
+ 109, 111, 112, 113, 114, 115, 116, 117,
+ 118, 119, 121, 120, 1398, 122, 124, 125,
+ 126, 147, 127, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 137, 138, 139, 140,
+ 141, 142, 143, 145, 144, 1398, 146, 148,
+ 149, 150, 151, 152, 153, 154, 155, 156,
+ 157, 158, 160, 159, 1398, 161, 163, 184,
+ 266, 164, 165, 166, 167, 168, 175, 169,
+ 170, 171, 173, 172, 1398, 174, 176, 177,
+ 178, 179, 180, 182, 181, 1398, 183, 185,
+ 186, 187, 196, 188, 189, 190, 191, 192,
+ 194, 193, 1398, 195, 197, 198, 199, 200,
+ 217, 231, 256, 201, 202, 203, 204, 205,
+ 206, 207, 208, 209, 210, 211, 212, 213,
+ 215, 214, 1398, 216, 218, 219, 220, 221,
+ 222, 223, 224, 225, 226, 227, 229, 228,
+ 1398, 230, 232, 245, 233, 234, 235, 236,
+ 237, 238, 239, 240, 241, 243, 242, 1398,
+ 244, 246, 247, 248, 250, 251, 252, 254,
+ 253, 1398, 255, 257, 258, 259, 260, 261,
+ 262, 264, 263, 1398, 265, 267, 268, 269,
+ 270, 271, 273, 272, 1398, 274, 276, 277,
+ 278, 279, 280, 281, 283, 282, 1398, 284,
+ 286, 301, 311, 287, 288, 289, 290, 291,
+ 292, 293, 294, 295, 296, 297, 299, 298,
+ 1398, 300, 302, 303, 304, 305, 306, 307,
+ 309, 308, 1398, 310, 312, 313, 314, 315,
+ 316, 317, 318, 319, 321, 320, 1398, 322,
+ 324, 325, 326, 327, 328, 329, 331, 330,
+ 1398, 332, 334, 335, 336, 337, 338, 339,
+ 340, 341, 342, 343, 344, 345, 346, 347,
+ 349, 348, 1398, 350, 352, 376, 353, 354,
+ 355, 356, 357, 358, 359, 365, 360, 361,
+ 363, 362, 1398, 364, 366, 367, 368, 370,
+ 371, 372, 374, 373, 1398, 375, 377, 378,
+ 379, 380, 381, 382, 383, 384, 385, 386,
+ 387, 388, 390, 389, 1398, 391, 393, 394,
+ 395, 396, 397, 398, 400, 399, 1398, 401,
+ 403, 420, 404, 405, 406, 407, 408, 409,
+ 410, 411, 412, 413, 414, 415, 416, 418,
+ 417, 1398, 419, 421, 437, 422, 423, 424,
+ 425, 426, 427, 428, 429, 430, 431, 432,
+ 433, 435, 434, 1398, 436, 438, 439, 452,
+ 440, 441, 442, 443, 444, 445, 446, 447,
+ 448, 450, 449, 1398, 451, 453, 454, 455,
+ 456, 458, 457, 1398, 459, 461, 462, 463,
+ 464, 465, 466, 467, 468, 469, 470, 471,
+ 472, 473, 474, 476, 475, 1398, 477, 479,
+ 826, 835, 480, 561, 626, 702, 719, 744,
+ 783, 802, 481, 505, 522, 482, 483, 484,
+ 485, 486, 487, 488, 489, 490, 491, 492,
+ 493, 494, 495, 496, 497, 498, 499, 500,
+ 501, 503, 502, 1398, 504, 506, 507, 508,
+ 509, 510, 511, 512, 513, 514, 515, 516,
+ 517, 518, 520, 519, 1398, 521, 523, 524,
+ 544, 525, 526, 527, 528, 529, 530, 531,
+ 532, 533, 534, 535, 536, 537, 538, 539,
+ 540, 542, 541, 1398, 543, 545, 546, 547,
+ 548, 549, 550, 551, 552, 553, 554, 555,
+ 556, 557, 559, 558, 1398, 560, 562, 582,
+ 563, 564, 565, 566, 567, 568, 569, 570,
+ 571, 572, 573, 574, 575, 576, 577, 578,
+ 580, 579, 1398, 581, 583, 584, 585, 586,
+ 587, 588, 589, 590, 614, 591, 592, 593,
+ 594, 595, 596, 597, 598, 599, 600, 601,
+ 602, 603, 604, 605, 606, 607, 608, 609,
+ 610, 612, 611, 1398, 613, 615, 616, 617,
+ 618, 619, 620, 621, 622, 624, 623, 1398,
+ 625, 627, 628, 629, 630, 648, 658, 668,
+ 682, 631, 632, 633, 634, 635, 636, 637,
+ 638, 639, 640, 641, 642, 643, 644, 646,
+ 645, 1398, 647, 649, 650, 651, 652, 653,
+ 654, 656, 655, 1398, 657, 659, 660, 661,
+ 662, 663, 664, 666, 665, 1398, 667, 669,
+ 670, 671, 672, 673, 674, 675, 676, 677,
+ 678, 680, 679, 1398, 681, 683, 684, 685,
+ 686, 687, 688, 689, 690, 691, 692, 693,
+ 694, 695, 696, 697, 698, 700, 699, 1398,
+ 701, 703, 704, 705, 706, 707, 708, 709,
+ 710, 711, 712, 713, 714, 715, 717, 716,
+ 1398, 718, 720, 721, 722, 723, 724, 725,
+ 726, 727, 728, 729, 730, 731, 732, 733,
+ 734, 735, 736, 737, 738, 739, 740, 742,
+ 741, 1398, 743, 745, 746, 768, 747, 748,
+ 749, 750, 751, 752, 753, 754, 755, 756,
+ 757, 758, 759, 760, 761, 762, 763, 764,
+ 766, 765, 1398, 767, 769, 770, 771, 772,
+ 773, 774, 775, 776, 777, 778, 779, 781,
+ 780, 1398, 782, 784, 785, 786, 787, 788,
+ 789, 790, 791, 792, 793, 794, 795, 796,
+ 797, 798, 800, 799, 1398, 801, 803, 804,
+ 805, 806, 807, 808, 809, 810, 811, 812,
+ 813, 814, 815, 816, 817, 818, 819, 820,
+ 821, 822, 824, 823, 1398, 825, 827, 828,
+ 829, 830, 831, 833, 832, 1398, 834, 836,
+ 858, 837, 848, 838, 839, 840, 841, 842,
+ 843, 844, 846, 845, 1398, 847, 849, 850,
+ 851, 852, 853, 854, 856, 855, 1398, 857,
+ 859, 860, 861, 862, 895, 863, 864, 865,
+ 866, 880, 867, 868, 869, 870, 871, 872,
+ 873, 874, 875, 876, 878, 877, 1398, 879,
+ 881, 882, 883, 884, 885, 886, 887, 888,
+ 889, 890, 891, 893, 892, 1398, 894, 896,
+ 897, 898, 899, 900, 901, 902, 903, 904,
+ 906, 905, 1398, 907, 909, 918, 1086, 1096,
+ 910, 911, 912, 913, 914, 916, 915, 1398,
+ 917, 919, 929, 945, 978, 996, 1018, 1050,
+ 1071, 920, 921, 922, 923, 924, 925, 927,
+ 926, 1398, 928, 930, 931, 932, 933, 934,
+ 935, 936, 937, 938, 939, 940, 941, 943,
+ 942, 1398, 944, 946, 947, 948, 966, 949,
+ 958, 950, 951, 952, 953, 954, 956, 955,
+ 1398, 957, 959, 960, 961, 962, 964, 963,
+ 1398, 965, 967, 968, 969, 970, 972, 973,
+ 974, 976, 975, 1398, 977, 979, 980, 981,
+ 982, 983, 984, 985, 986, 987, 988, 989,
+ 990, 991, 992, 994, 993, 1398, 995, 997,
+ 998, 1008, 999, 1000, 1001, 1002, 1003, 1004,
+ 1006, 1005, 1398, 1007, 1009, 1010, 1011, 1012,
+ 1013, 1014, 1016, 1015, 1398, 1017, 1019, 1020,
+ 1041, 1021, 1022, 1023, 1024, 1025, 1026, 1027,
+ 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035,
+ 1036, 1037, 1039, 1038, 1398, 1040, 1042, 1043,
+ 1044, 1045, 1046, 1048, 1047, 1398, 1049, 1051,
+ 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059,
+ 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067,
+ 1069, 1068, 1398, 1070, 1072, 1073, 1074, 1075,
+ 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1084,
+ 1083, 1398, 1085, 1087, 1088, 1089, 1090, 1091,
+ 1092, 1094, 1093, 1398, 1095, 1097, 1098, 1099,
+ 1100, 1101, 1103, 1102, 1398, 1104, 1106, 1107,
+ 1112, 1200, 1227, 1108, 1110, 1109, 1398, 1111,
+ 1113, 1156, 1181, 1114, 1115, 1116, 1117, 1118,
+ 1119, 1120, 1132, 1144, 1121, 1122, 1123, 1124,
+ 1125, 1126, 1127, 1128, 1130, 1129, 1398, 1131,
+ 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140,
+ 1142, 1141, 1398, 1143, 1145, 1146, 1147, 1148,
+ 1149, 1150, 1151, 1152, 1154, 1153, 1398, 1155,
+ 1157, 1158, 1166, 1159, 1160, 1161, 1162, 1164,
+ 1163, 1398, 1165, 1167, 1168, 1169, 1170, 1171,
+ 1172, 1173, 1174, 1175, 1176, 1177, 1179, 1178,
+ 1398, 1180, 1182, 1183, 1184, 1185, 1186, 1187,
+ 1188, 1189, 1190, 1191, 1192, 1194, 1195, 1196,
+ 1198, 1197, 1398, 1199, 1201, 1202, 1203, 1213,
+ 1204, 1205, 1206, 1207, 1208, 1209, 1211, 1210,
+ 1398, 1212, 1214, 1215, 1216, 1217, 1218, 1219,
+ 1220, 1221, 1222, 1223, 1225, 1224, 1398, 1226,
+ 1228, 1254, 1229, 1233, 1230, 1231, 1232, 1234,
+ 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242,
+ 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250,
+ 1252, 1251, 1398, 1253, 1255, 1256, 1257, 1258,
+ 1259, 1261, 1262, 1263, 1265, 1264, 1398, 1266,
+ 1268, 1286, 1300, 1269, 1270, 1271, 1272, 1273,
+ 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281,
+ 1282, 1284, 1283, 1398, 1285, 1287, 1288, 1289,
+ 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1298,
+ 1297, 1398, 1299, 1301, 1302, 1303, 1305, 1304,
+ 1398, 1306, 1308, 1324, 1309, 1310, 1311, 1312,
+ 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320,
+ 1322, 1321, 1398, 1323, 1325, 1326, 1327, 1328,
+ 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1337,
+ 1336, 1398, 1338, 1340, 1341, 1342, 1343, 1344,
+ 1346, 1345, 1398, 1347, 1349, 1361, 1350, 1351,
+ 1352, 1353, 1354, 1355, 1356, 1357, 1359, 1358,
+ 1398, 1360, 1362, 1363, 1364, 1365, 1366, 1367,
+ 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375,
+ 1376, 1377, 1378, 1383, 1379, 1382, 1380, 1399,
+ 1381, 1398, 1384
+ };
-static const int tsip_machine_parser_headers_start = 1;
-static const int tsip_machine_parser_headers_first_final = 1398;
-static const int tsip_machine_parser_headers_error = 0;
+ static const unsigned char _tsip_machine_parser_headers_trans_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 185, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 11, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 13,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 17, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 19, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 21, 0, 0, 0,
+ 0, 0, 0, 0, 0, 23, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 25, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 27, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 29, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 31,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 33, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 35, 0, 0, 0, 0,
+ 0, 0, 0, 0, 37, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 39, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 41, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 43, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 49, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 53, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 55, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 57, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 59, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 67, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 69, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 71, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 73, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 75, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 77, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 79, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 81,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 83, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 85, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 87, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 89, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 91,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 93, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 95, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 97, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 99, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 101, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 103, 0, 0, 0,
+ 0, 0, 0, 0, 0, 105, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 107, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 109, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 111, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 113, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 115, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 117,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 119, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 121, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 123, 0, 0, 0, 0, 0, 0, 0,
+ 125, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 127, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 129, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 131, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 133, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 135, 0, 0, 0,
+ 0, 0, 0, 0, 0, 137, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 139, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 141, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 143, 0, 0, 0, 0,
+ 0, 0, 0, 0, 145, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 163, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 147, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 149, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 151, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 153, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 155, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 157, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 159, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 161, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 165, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 167, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 169, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 171, 0, 0, 0, 0, 0, 0,
+ 173, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 175, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 177, 0, 0, 0, 0, 0, 0,
+ 0, 0, 179, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 181, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 185,
+ 0, 183, 0
+ };
-static const int tsip_machine_parser_headers_en_main = 1;
+ static const int tsip_machine_parser_headers_start = 1;
+ static const int tsip_machine_parser_headers_first_final = 1398;
+ static const int tsip_machine_parser_headers_error = 0;
+ static const int tsip_machine_parser_headers_en_main = 1;
-/* #line 854 "./ragel/tsip_parser_header.rl" */
- (void)(eof);
- (void)(tsip_machine_parser_headers_first_final);
- (void)(tsip_machine_parser_headers_error);
- (void)(tsip_machine_parser_headers_en_main);
-
-/* #line 5457 "./src/parsers/tsip_parser_header.c" */
- {
- cs = tsip_machine_parser_headers_start;
- }
-/* #line 859 "./ragel/tsip_parser_header.rl" */
-
-/* #line 5464 "./src/parsers/tsip_parser_header.c" */
- {
- int _klen;
- unsigned int _trans;
- short _widec;
- const char *_acts;
- unsigned int _nacts;
- const short *_keys;
+ /* #line 854 "./ragel/tsip_parser_header.rl" */
+ (void)(eof);
+ (void)(tsip_machine_parser_headers_first_final);
+ (void)(tsip_machine_parser_headers_error);
+ (void)(tsip_machine_parser_headers_en_main);
+
+ /* #line 5457 "./src/parsers/tsip_parser_header.c" */
+ {
+ cs = tsip_machine_parser_headers_start;
+ }
+
+ /* #line 859 "./ragel/tsip_parser_header.rl" */
+
+ /* #line 5464 "./src/parsers/tsip_parser_header.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ short _widec;
+ const char *_acts;
+ unsigned int _nacts;
+ const short *_keys;
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _widec = (*p);
- _klen = _tsip_machine_parser_headers_cond_lengths[cs];
- _keys = _tsip_machine_parser_headers_cond_keys + (_tsip_machine_parser_headers_cond_offsets[cs]*2);
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _widec = (*p);
+ _klen = _tsip_machine_parser_headers_cond_lengths[cs];
+ _keys = _tsip_machine_parser_headers_cond_keys + (_tsip_machine_parser_headers_cond_offsets[cs]*2);
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- switch ( _tsip_machine_parser_headers_cond_spaces[_tsip_machine_parser_headers_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
- case 0: {
- _widec = (short)(128 + ((*p) - -128));
- if (
-/* #line 834 "./ragel/tsip_parser_header.rl" */
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ switch ( _tsip_machine_parser_headers_cond_spaces[_tsip_machine_parser_headers_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
+ case 0: {
+ _widec = (short)(128 + ((*p) - -128));
+ if (
+ /* #line 834 "./ragel/tsip_parser_header.rl" */
- prev_not_comma(p)
- ) _widec += 256;
- break;
- }
- }
- break;
- }
- }
- }
+ prev_not_comma(p)
+ ) {
+ _widec += 256;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
- _keys = _tsip_machine_parser_headers_trans_keys + _tsip_machine_parser_headers_key_offsets[cs];
- _trans = _tsip_machine_parser_headers_index_offsets[cs];
+ _keys = _tsip_machine_parser_headers_trans_keys + _tsip_machine_parser_headers_key_offsets[cs];
+ _trans = _tsip_machine_parser_headers_index_offsets[cs];
- _klen = _tsip_machine_parser_headers_single_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_headers_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( _widec < *_mid )
- _upper = _mid - 1;
- else if ( _widec > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( _widec < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( _widec > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
- _klen = _tsip_machine_parser_headers_range_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
+ _klen = _tsip_machine_parser_headers_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_headers_indicies[_trans];
- cs = _tsip_machine_parser_headers_trans_targs[_trans];
+ _trans = _tsip_machine_parser_headers_indicies[_trans];
+ cs = _tsip_machine_parser_headers_trans_targs[_trans];
- if ( _tsip_machine_parser_headers_trans_actions[_trans] == 0 )
- goto _again;
+ if ( _tsip_machine_parser_headers_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
- _acts = _tsip_machine_parser_headers_actions + _tsip_machine_parser_headers_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 71 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Accept NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 1:
-/* #line 79 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Accept_Contact NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 2:
-/* #line 87 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Accept_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 3:
-/* #line 95 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Accept_Language NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 4:
-/* #line 103 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Accept_Resource_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 5:
-/* #line 111 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Alert_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 6:
-/* #line 119 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Allow_t *header = tsip_header_Allow_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 7:
-/* #line 126 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Allow_Events_t *header = tsip_header_Allow_Events_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 8:
-/* #line 133 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Authentication_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 9:
-/* #line 141 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Authorization_t *header = tsip_header_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 10:
-/* #line 148 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->Call_ID){
- message->Call_ID = tsip_header_Call_ID_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'Call-ID' header.");
- }
- }
- break;
- case 11:
-/* #line 161 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Call_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 12:
-/* #line 169 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Contacts_L_t* headers = tsip_header_Contact_parse(state->tag_start, (state->tag_end-state->tag_start));
- if(headers)
- {
- tsk_list_item_t *item;
- tsk_list_foreach(item, headers)
- {
- tsip_header_Contact_t *hdr = tsk_object_ref(item->data);
- if(!message->Contact){
- message->Contact = hdr;
- }
- else{
- tsk_list_push_back_data(message->headers, ((void**) &hdr));
- }
- }
+ _acts = _tsip_machine_parser_headers_actions + _tsip_machine_parser_headers_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 71 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Accept NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 1:
+ /* #line 79 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Accept_Contact NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 2:
+ /* #line 87 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Accept_Encoding NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 3:
+ /* #line 95 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Accept_Language NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 4:
+ /* #line 103 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Accept_Resource_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 5:
+ /* #line 111 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Alert_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 6:
+ /* #line 119 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Allow_t *header = tsip_header_Allow_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 7:
+ /* #line 126 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Allow_Events_t *header = tsip_header_Allow_Events_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 8:
+ /* #line 133 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Authentication_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 9:
+ /* #line 141 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Authorization_t *header = tsip_header_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 10:
+ /* #line 148 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->Call_ID) {
+ message->Call_ID = tsip_header_Call_ID_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'Call-ID' header.");
+ }
+ }
+ break;
+ case 11:
+ /* #line 161 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Call_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 12:
+ /* #line 169 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Contacts_L_t* headers = tsip_header_Contact_parse(state->tag_start, (state->tag_end-state->tag_start));
+ if(headers) {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, headers) {
+ tsip_header_Contact_t *hdr = tsk_object_ref(item->data);
+ if(!message->Contact) {
+ message->Contact = hdr;
+ }
+ else {
+ tsk_list_push_back_data(message->headers, ((void**) &hdr));
+ }
+ }
- TSK_OBJECT_SAFE_FREE(headers);
- }
- }
- break;
- case 13:
-/* #line 191 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Content_Disposition NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 14:
-/* #line 199 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("PARSE_HEADER_ACCEPT NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 15:
-/* #line 207 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Content_Language NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 16:
-/* #line 215 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->Content_Length){
- message->Content_Length = tsip_header_Content_Length_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'Content-Length' header.");
- }
- }
- break;
- case 17:
-/* #line 228 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->Content_Type){
- message->Content_Type = tsip_header_Content_Type_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'Content-Type' header.");
- }
- }
- break;
- case 18:
-/* #line 241 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->CSeq){
- message->CSeq = tsip_header_CSeq_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'CSeq' header.");
- }
- }
- break;
- case 19:
-/* #line 254 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Date_t *header = tsip_header_Date_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 20:
-/* #line 261 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Error_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 21:
-/* #line 269 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Event_t *header = tsip_header_Event_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 22:
-/* #line 276 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->Expires){
- message->Expires = tsip_header_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'Expires' header.");
- }
- }
- break;
- case 23:
-/* #line 289 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->From){
- message->From = tsip_header_From_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'From' header.");
- }
- }
- break;
- case 24:
-/* #line 302 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_History_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 25:
-/* #line 310 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Identity NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 26:
-/* #line 318 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Identity_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 27:
-/* #line 326 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_In_Reply_To NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 28:
-/* #line 334 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Join NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 29:
-/* #line 342 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Max_Forwards_t *header = tsip_header_Max_Forwards_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 30:
-/* #line 349 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_MIME_Version NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 31:
-/* #line 357 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Min_Expires_t *header = tsip_header_Min_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 32:
-/* #line 364 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Min_SE_t *header = tsip_header_Min_SE_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 33:
-/* #line 371 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Organization NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 34:
-/* #line 379 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_P_Access_Network_Info_t *header = tsip_header_P_Access_Network_Info_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 35:
-/* #line 386 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Answer_State NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 36:
-/* #line 394 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_P_Asserted_Identities_L_t* headers = tsip_header_P_Asserted_Identity_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 37:
-/* #line 401 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_P_Associated_URIs_L_t* headers = tsip_header_P_Associated_URI_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 38:
-/* #line 408 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Called_Party_ID NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 39:
-/* #line 416 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_P_Charging_Function_Addressess_L_t* headers = tsip_header_P_Charging_Function_Addresses_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 40:
-/* #line 423 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Charging_Vector NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 41:
-/* #line 431 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_DCS_Billing_Info NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 42:
-/* #line 439 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_DCS_LAES NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 43:
-/* #line 447 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_DCS_OSPS NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 44:
-/* #line 455 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_DCS_Redirect NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 45:
-/* #line 463 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_DCS_Trace_Party_ID NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 46:
-/* #line 471 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Early_Media NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 47:
-/* #line 479 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Media_Authorization NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 48:
-/* #line 487 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_P_Preferred_Identity_t *header = tsip_header_P_Preferred_Identity_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 49:
-/* #line 494 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Profile_Key NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 50:
-/* #line 502 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_User_Database NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 51:
-/* #line 510 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_P_Visited_Network_ID NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 52:
-/* #line 518 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Paths_L_t* headers = tsip_header_Path_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 53:
-/* #line 525 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 54:
-/* #line 533 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Privacy_t *header = tsip_header_Privacy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 55:
-/* #line 540 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Proxy_Authenticate_t *header = tsip_header_Proxy_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 56:
-/* #line 547 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Proxy_Authorization_t *header = tsip_header_Proxy_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 57:
-/* #line 554 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Proxy_Require_t *header = tsip_header_Proxy_Require_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 58:
-/* #line 561 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_RAck_t *header = tsip_header_RAck_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 59:
-/* #line 568 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Reason NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 60:
-/* #line 576 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Record_Routes_L_t* headers = tsip_header_Record_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 61:
-/* #line 583 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Refer_Sub_t *header = tsip_header_Refer_Sub_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 62:
-/* #line 590 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Refer_To_t *header = tsip_header_Refer_To_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 63:
-/* #line 597 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Referred_By_t *header = tsip_header_Referred_By_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 64:
-/* #line 604 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Reject_Contact NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 65:
-/* #line 612 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Replaces NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 66:
-/* #line 620 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Reply_To NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 67:
-/* #line 628 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Request_Disposition NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 68:
-/* #line 636 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Require_t *header = tsip_header_Require_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 69:
-/* #line 643 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Resource_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 70:
-/* #line 651 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Retry_After NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 71:
-/* #line 659 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Routes_L_t* headers = tsip_header_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 72:
-/* #line 666 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_RSeq_t *header = tsip_header_RSeq_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 73:
-/* #line 673 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Security_Clients_L_t* headers = tsip_header_Security_Client_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 74:
-/* #line 680 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Security_Servers_L_t* headers = tsip_header_Security_Server_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 75:
-/* #line 687 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Security_Verifies_L_t* headers = tsip_header_Security_Verify_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 76:
-/* #line 694 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Server_t *header = tsip_header_Server_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 77:
-/* #line 701 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Service_Routes_L_t* headers = tsip_header_Service_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 78:
-/* #line 708 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Session_Expires_t *header = tsip_header_Session_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 79:
-/* #line 715 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_SIP_ETag_t *header = tsip_header_SIP_ETag_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 80:
-/* #line 722 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_SIP_If_Match_t *header = tsip_header_SIP_If_Match_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 81:
-/* #line 729 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Subject NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 82:
-/* #line 737 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Subscription_State_t* header = tsip_header_Subscription_State_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 83:
-/* #line 744 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Supported_t *header = tsip_header_Supported_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 84:
-/* #line 751 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Target_Dialog NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 85:
-/* #line 759 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Timestamp NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 86:
-/* #line 767 "./ragel/tsip_parser_header.rl" */
- {
- if(!message->To){
- message->To = tsip_header_To_parse(state->tag_start, (state->tag_end-state->tag_start));
- }
- else{
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- TSK_DEBUG_WARN("The message already have 'To' header.");
- }
- }
- break;
- case 87:
-/* #line 780 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- //TSK_DEBUG_WARN("parse_header_Unsupported NOT IMPLEMENTED. Will be added as Dummy header.");
- }
- break;
- case 88:
-/* #line 788 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_User_Agent_t *header = tsip_header_User_Agent_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 89:
-/* #line 795 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Vias_L_t* headers = tsip_header_Via_parse(state->tag_start, (state->tag_end-state->tag_start));
- if(headers){
- tsk_list_item_t *item;
- tsk_list_foreach(item, headers){
- tsip_header_Via_t *hdr = tsk_object_ref(item->data);
- if(!message->firstVia){
- message->firstVia = hdr;
- }
- else{
- tsk_list_push_back_data(message->headers, ((void**) &hdr));
- }
- }
+ TSK_OBJECT_SAFE_FREE(headers);
+ }
+ }
+ break;
+ case 13:
+ /* #line 191 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Content_Disposition NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 14:
+ /* #line 199 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("PARSE_HEADER_ACCEPT NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 15:
+ /* #line 207 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Content_Language NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 16:
+ /* #line 215 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->Content_Length) {
+ message->Content_Length = tsip_header_Content_Length_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'Content-Length' header.");
+ }
+ }
+ break;
+ case 17:
+ /* #line 228 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->Content_Type) {
+ message->Content_Type = tsip_header_Content_Type_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'Content-Type' header.");
+ }
+ }
+ break;
+ case 18:
+ /* #line 241 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->CSeq) {
+ message->CSeq = tsip_header_CSeq_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'CSeq' header.");
+ }
+ }
+ break;
+ case 19:
+ /* #line 254 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Date_t *header = tsip_header_Date_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 20:
+ /* #line 261 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Error_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 21:
+ /* #line 269 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Event_t *header = tsip_header_Event_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 22:
+ /* #line 276 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->Expires) {
+ message->Expires = tsip_header_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'Expires' header.");
+ }
+ }
+ break;
+ case 23:
+ /* #line 289 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->From) {
+ message->From = tsip_header_From_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'From' header.");
+ }
+ }
+ break;
+ case 24:
+ /* #line 302 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_History_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 25:
+ /* #line 310 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Identity NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 26:
+ /* #line 318 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Identity_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 27:
+ /* #line 326 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_In_Reply_To NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 28:
+ /* #line 334 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Join NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 29:
+ /* #line 342 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Max_Forwards_t *header = tsip_header_Max_Forwards_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 30:
+ /* #line 349 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_MIME_Version NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 31:
+ /* #line 357 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Min_Expires_t *header = tsip_header_Min_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 32:
+ /* #line 364 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Min_SE_t *header = tsip_header_Min_SE_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 33:
+ /* #line 371 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Organization NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 34:
+ /* #line 379 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_P_Access_Network_Info_t *header = tsip_header_P_Access_Network_Info_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 35:
+ /* #line 386 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Answer_State NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 36:
+ /* #line 394 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_P_Asserted_Identities_L_t* headers = tsip_header_P_Asserted_Identity_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 37:
+ /* #line 401 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_P_Associated_URIs_L_t* headers = tsip_header_P_Associated_URI_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 38:
+ /* #line 408 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Called_Party_ID NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 39:
+ /* #line 416 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_P_Charging_Function_Addressess_L_t* headers = tsip_header_P_Charging_Function_Addresses_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 40:
+ /* #line 423 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Charging_Vector NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 41:
+ /* #line 431 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_DCS_Billing_Info NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 42:
+ /* #line 439 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_DCS_LAES NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 43:
+ /* #line 447 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_DCS_OSPS NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 44:
+ /* #line 455 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_DCS_Redirect NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 45:
+ /* #line 463 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_DCS_Trace_Party_ID NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 46:
+ /* #line 471 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Early_Media NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 47:
+ /* #line 479 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Media_Authorization NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 48:
+ /* #line 487 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_P_Preferred_Identity_t *header = tsip_header_P_Preferred_Identity_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 49:
+ /* #line 494 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Profile_Key NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 50:
+ /* #line 502 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_User_Database NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 51:
+ /* #line 510 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_P_Visited_Network_ID NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 52:
+ /* #line 518 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Paths_L_t* headers = tsip_header_Path_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 53:
+ /* #line 525 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 54:
+ /* #line 533 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Privacy_t *header = tsip_header_Privacy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 55:
+ /* #line 540 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Proxy_Authenticate_t *header = tsip_header_Proxy_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 56:
+ /* #line 547 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Proxy_Authorization_t *header = tsip_header_Proxy_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 57:
+ /* #line 554 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Proxy_Require_t *header = tsip_header_Proxy_Require_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 58:
+ /* #line 561 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_RAck_t *header = tsip_header_RAck_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 59:
+ /* #line 568 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Reason NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 60:
+ /* #line 576 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Record_Routes_L_t* headers = tsip_header_Record_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 61:
+ /* #line 583 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Refer_Sub_t *header = tsip_header_Refer_Sub_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 62:
+ /* #line 590 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Refer_To_t *header = tsip_header_Refer_To_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 63:
+ /* #line 597 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Referred_By_t *header = tsip_header_Referred_By_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 64:
+ /* #line 604 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Reject_Contact NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 65:
+ /* #line 612 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Replaces NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 66:
+ /* #line 620 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Reply_To NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 67:
+ /* #line 628 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Request_Disposition NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 68:
+ /* #line 636 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Require_t *header = tsip_header_Require_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 69:
+ /* #line 643 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Resource_Priority NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 70:
+ /* #line 651 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Retry_After NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 71:
+ /* #line 659 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Routes_L_t* headers = tsip_header_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 72:
+ /* #line 666 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_RSeq_t *header = tsip_header_RSeq_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 73:
+ /* #line 673 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Security_Clients_L_t* headers = tsip_header_Security_Client_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 74:
+ /* #line 680 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Security_Servers_L_t* headers = tsip_header_Security_Server_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 75:
+ /* #line 687 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Security_Verifies_L_t* headers = tsip_header_Security_Verify_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 76:
+ /* #line 694 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Server_t *header = tsip_header_Server_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 77:
+ /* #line 701 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Service_Routes_L_t* headers = tsip_header_Service_Route_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 78:
+ /* #line 708 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Session_Expires_t *header = tsip_header_Session_Expires_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 79:
+ /* #line 715 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_SIP_ETag_t *header = tsip_header_SIP_ETag_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 80:
+ /* #line 722 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_SIP_If_Match_t *header = tsip_header_SIP_If_Match_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 81:
+ /* #line 729 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Subject NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 82:
+ /* #line 737 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Subscription_State_t* header = tsip_header_Subscription_State_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 83:
+ /* #line 744 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Supported_t *header = tsip_header_Supported_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 84:
+ /* #line 751 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Target_Dialog NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 85:
+ /* #line 759 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Timestamp NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 86:
+ /* #line 767 "./ragel/tsip_parser_header.rl" */
+ {
+ if(!message->To) {
+ message->To = tsip_header_To_parse(state->tag_start, (state->tag_end-state->tag_start));
+ }
+ else {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ TSK_DEBUG_WARN("The message already have 'To' header.");
+ }
+ }
+ break;
+ case 87:
+ /* #line 780 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ //TSK_DEBUG_WARN("parse_header_Unsupported NOT IMPLEMENTED. Will be added as Dummy header.");
+ }
+ break;
+ case 88:
+ /* #line 788 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_User_Agent_t *header = tsip_header_User_Agent_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 89:
+ /* #line 795 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Vias_L_t* headers = tsip_header_Via_parse(state->tag_start, (state->tag_end-state->tag_start));
+ if(headers) {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, headers) {
+ tsip_header_Via_t *hdr = tsk_object_ref(item->data);
+ if(!message->firstVia) {
+ message->firstVia = hdr;
+ }
+ else {
+ tsk_list_push_back_data(message->headers, ((void**) &hdr));
+ }
+ }
- TSK_OBJECT_SAFE_FREE(headers);
- }
- }
- break;
- case 90:
-/* #line 815 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Warnings_L_t* headers = tsip_header_Warning_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADERS(headers);
- }
- break;
- case 91:
-/* #line 822 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_WWW_Authenticate_t *header = tsip_header_WWW_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
- case 92:
-/* #line 829 "./ragel/tsip_parser_header.rl" */
- {
- tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
- ADD_HEADER(header);
- }
- break;
-/* #line 6337 "./src/parsers/tsip_parser_header.c" */
- }
- }
+ TSK_OBJECT_SAFE_FREE(headers);
+ }
+ }
+ break;
+ case 90:
+ /* #line 815 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Warnings_L_t* headers = tsip_header_Warning_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADERS(headers);
+ }
+ break;
+ case 91:
+ /* #line 822 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_WWW_Authenticate_t *header = tsip_header_WWW_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ case 92:
+ /* #line 829 "./ragel/tsip_parser_header.rl" */
+ {
+ tsip_header_Dummy_t *header = tsip_header_Dummy_parse(state->tag_start, (state->tag_end-state->tag_start));
+ ADD_HEADER(header);
+ }
+ break;
+ /* #line 6337 "./src/parsers/tsip_parser_header.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 860 "./ragel/tsip_parser_header.rl" */
-/* #line 860 "./ragel/tsip_parser_header.rl" */
-
- return ( cs >=
-/* #line 6353 "./src/parsers/tsip_parser_header.c" */
-1398
-/* #line 861 "./ragel/tsip_parser_header.rl" */
- );
- //return (cs == tsip_machine_parser_headers_first_final);
+ return ( cs >=
+ /* #line 6353 "./src/parsers/tsip_parser_header.c" */
+ 1398
+ /* #line 861 "./ragel/tsip_parser_header.rl" */
+ );
+ //return (cs == tsip_machine_parser_headers_first_final);
}
diff --git a/tinySIP/src/parsers/tsip_parser_message.c b/tinySIP/src/parsers/tsip_parser_message.c
index ff5caa5..9059505 100755
--- a/tinySIP/src/parsers/tsip_parser_message.c
+++ b/tinySIP/src/parsers/tsip_parser_message.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -58,134 +58,134 @@ static void tsip_message_parser_eoh(tsk_ragel_state_t *state, tsip_message_t *me
/* #line 60 "./src/parsers/tsip_parser_message.c" */
static const char _tsip_machine_parser_message_actions[] = {
- 0, 1, 0, 1, 1, 1, 2, 1,
- 3, 1, 4, 1, 5, 1, 6, 1,
- 7, 2, 0, 5, 2, 6, 0
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 1, 6, 1,
+ 7, 2, 0, 5, 2, 6, 0
};
static const char _tsip_machine_parser_message_cond_offsets[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2
};
static const char _tsip_machine_parser_message_cond_lengths[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
};
static const short _tsip_machine_parser_message_cond_keys[] = {
- 13, 13, 10, 10, 0
+ 13, 13, 10, 10, 0
};
static const char _tsip_machine_parser_message_cond_spaces[] = {
- 0, 0, 0
+ 0, 0, 0
};
static const unsigned char _tsip_machine_parser_message_key_offsets[] = {
- 0, 0, 16, 31, 35, 47, 50, 50,
- 51, 53, 55, 57, 58, 60, 63, 65,
- 68, 69, 70, 76, 77, 78, 79, 96,
- 113, 127, 129, 132, 134, 137, 139, 141,
- 143, 144, 160, 176, 182, 188
+ 0, 0, 16, 31, 35, 47, 50, 50,
+ 51, 53, 55, 57, 58, 60, 63, 65,
+ 68, 69, 70, 76, 77, 78, 79, 96,
+ 113, 127, 129, 132, 134, 137, 139, 141,
+ 143, 144, 160, 176, 182, 188
};
static const short _tsip_machine_parser_message_trans_keys[] = {
- 33, 37, 39, 83, 115, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 33, 37, 39, 126, 42, 43, 45,
- 46, 48, 57, 65, 90, 95, 122, 65,
- 90, 97, 122, 9, 32, 43, 58, 45,
- 46, 48, 57, 65, 90, 97, 122, 9,
- 32, 58, 32, 83, 115, 73, 105, 80,
- 112, 47, 48, 57, 46, 48, 57, 48,
- 57, 13, 48, 57, 10, 13, 269, 525,
- -128, 12, 14, 127, 522, 13, 10, 32,
- 33, 37, 39, 73, 105, 126, 42, 43,
- 45, 46, 48, 57, 65, 90, 95, 122,
- 32, 33, 37, 39, 80, 112, 126, 42,
- 43, 45, 46, 48, 57, 65, 90, 95,
- 122, 32, 33, 37, 39, 47, 126, 42,
- 43, 45, 57, 65, 90, 95, 122, 48,
- 57, 46, 48, 57, 48, 57, 32, 48,
- 57, 48, 57, 48, 57, 48, 57, 32,
- 13, 37, 60, 62, 96, 127, 0, 8,
- 10, 31, 34, 35, 91, 94, 123, 125,
- 13, 37, 60, 62, 96, 127, 0, 8,
- 10, 31, 34, 35, 91, 94, 123, 125,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 65, 70, 97, 102, 0
+ 33, 37, 39, 83, 115, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 33, 37, 39, 126, 42, 43, 45,
+ 46, 48, 57, 65, 90, 95, 122, 65,
+ 90, 97, 122, 9, 32, 43, 58, 45,
+ 46, 48, 57, 65, 90, 97, 122, 9,
+ 32, 58, 32, 83, 115, 73, 105, 80,
+ 112, 47, 48, 57, 46, 48, 57, 48,
+ 57, 13, 48, 57, 10, 13, 269, 525,
+ -128, 12, 14, 127, 522, 13, 10, 32,
+ 33, 37, 39, 73, 105, 126, 42, 43,
+ 45, 46, 48, 57, 65, 90, 95, 122,
+ 32, 33, 37, 39, 80, 112, 126, 42,
+ 43, 45, 46, 48, 57, 65, 90, 95,
+ 122, 32, 33, 37, 39, 47, 126, 42,
+ 43, 45, 57, 65, 90, 95, 122, 48,
+ 57, 46, 48, 57, 48, 57, 32, 48,
+ 57, 48, 57, 48, 57, 48, 57, 32,
+ 13, 37, 60, 62, 96, 127, 0, 8,
+ 10, 31, 34, 35, 91, 94, 123, 125,
+ 13, 37, 60, 62, 96, 127, 0, 8,
+ 10, 31, 34, 35, 91, 94, 123, 125,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 65, 70, 97, 102, 0
};
static const char _tsip_machine_parser_message_single_lengths[] = {
- 0, 6, 5, 0, 4, 3, 0, 1,
- 2, 2, 2, 1, 0, 1, 0, 1,
- 1, 1, 2, 1, 1, 1, 7, 7,
- 6, 0, 1, 0, 1, 0, 0, 0,
- 1, 6, 6, 0, 0, 0
+ 0, 6, 5, 0, 4, 3, 0, 1,
+ 2, 2, 2, 1, 0, 1, 0, 1,
+ 1, 1, 2, 1, 1, 1, 7, 7,
+ 6, 0, 1, 0, 1, 0, 0, 0,
+ 1, 6, 6, 0, 0, 0
};
static const char _tsip_machine_parser_message_range_lengths[] = {
- 0, 5, 5, 2, 4, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1,
- 0, 0, 2, 0, 0, 0, 5, 5,
- 4, 1, 1, 1, 1, 1, 1, 1,
- 0, 5, 5, 3, 3, 0
+ 0, 5, 5, 2, 4, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1,
+ 0, 0, 2, 0, 0, 0, 5, 5,
+ 4, 1, 1, 1, 1, 1, 1, 1,
+ 0, 5, 5, 3, 3, 0
};
static const unsigned char _tsip_machine_parser_message_index_offsets[] = {
- 0, 0, 12, 23, 26, 35, 39, 40,
- 42, 45, 48, 51, 53, 55, 58, 60,
- 63, 65, 67, 72, 74, 76, 78, 91,
- 104, 115, 117, 120, 122, 125, 127, 129,
- 131, 133, 145, 157, 161, 165
+ 0, 0, 12, 23, 26, 35, 39, 40,
+ 42, 45, 48, 51, 53, 55, 58, 60,
+ 63, 65, 67, 72, 74, 76, 78, 91,
+ 104, 115, 117, 120, 122, 125, 127, 129,
+ 131, 133, 145, 157, 161, 165
};
static const char _tsip_machine_parser_message_indicies[] = {
- 0, 0, 0, 2, 2, 0, 0, 0,
- 0, 0, 0, 1, 3, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 1, 5,
- 5, 1, 6, 6, 7, 8, 7, 7,
- 7, 7, 1, 6, 6, 8, 1, 9,
- 10, 9, 11, 11, 1, 12, 12, 1,
- 13, 13, 1, 14, 1, 15, 1, 16,
- 15, 1, 17, 1, 18, 17, 1, 19,
- 1, 21, 20, 22, 23, 22, 22, 1,
- 24, 1, 26, 25, 27, 1, 3, 4,
- 4, 4, 28, 28, 4, 4, 4, 4,
- 4, 4, 1, 3, 4, 4, 4, 29,
- 29, 4, 4, 4, 4, 4, 4, 1,
- 3, 4, 4, 4, 30, 4, 4, 4,
- 4, 4, 1, 31, 1, 32, 31, 1,
- 33, 1, 34, 33, 1, 35, 1, 36,
- 1, 37, 1, 38, 1, 40, 41, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 39, 43, 44, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 42, 45, 45, 45,
- 1, 42, 42, 42, 1, 46, 0
+ 0, 0, 0, 2, 2, 0, 0, 0,
+ 0, 0, 0, 1, 3, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 1, 5,
+ 5, 1, 6, 6, 7, 8, 7, 7,
+ 7, 7, 1, 6, 6, 8, 1, 9,
+ 10, 9, 11, 11, 1, 12, 12, 1,
+ 13, 13, 1, 14, 1, 15, 1, 16,
+ 15, 1, 17, 1, 18, 17, 1, 19,
+ 1, 21, 20, 22, 23, 22, 22, 1,
+ 24, 1, 26, 25, 27, 1, 3, 4,
+ 4, 4, 28, 28, 4, 4, 4, 4,
+ 4, 4, 1, 3, 4, 4, 4, 29,
+ 29, 4, 4, 4, 4, 4, 4, 1,
+ 3, 4, 4, 4, 30, 4, 4, 4,
+ 4, 4, 1, 31, 1, 32, 31, 1,
+ 33, 1, 34, 33, 1, 35, 1, 36,
+ 1, 37, 1, 38, 1, 40, 41, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 39, 43, 44, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 42, 45, 45, 45,
+ 1, 42, 42, 42, 1, 46, 0
};
static const char _tsip_machine_parser_message_trans_targs[] = {
- 2, 0, 22, 3, 2, 4, 5, 4,
- 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 21, 18, 19,
- 20, 18, 21, 37, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34,
- 16, 35, 34, 16, 35, 36, 37
+ 2, 0, 22, 3, 2, 4, 5, 4,
+ 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 21, 18, 19,
+ 20, 18, 21, 37, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34,
+ 16, 35, 34, 16, 35, 36, 37
};
static const char _tsip_machine_parser_message_trans_actions[] = {
- 1, 0, 1, 3, 0, 1, 0, 0,
- 0, 0, 5, 1, 0, 0, 0, 0,
- 0, 0, 7, 0, 1, 0, 0, 0,
- 0, 20, 13, 15, 0, 0, 0, 0,
- 0, 0, 7, 1, 0, 0, 9, 1,
- 17, 1, 0, 11, 0, 0, 0
+ 1, 0, 1, 3, 0, 1, 0, 0,
+ 0, 0, 5, 1, 0, 0, 0, 0,
+ 0, 0, 7, 0, 1, 0, 0, 0,
+ 0, 20, 13, 15, 0, 0, 0, 0,
+ 0, 0, 7, 1, 0, 0, 9, 1,
+ 17, 1, 0, 11, 0, 0, 0
};
static const int tsip_machine_parser_message_start = 1;
@@ -200,334 +200,340 @@ static const int tsip_machine_parser_message_en_main = 1;
tsk_bool_t tsip_message_parse(tsk_ragel_state_t *state, tsip_message_t **result, tsk_bool_t extract_content)
{
- if(!state || state->pe <= state->p){
- return tsk_false;
- }
-
- if(!*result){
- *result = tsip_message_create();
- }
-
- /* Ragel init */
- tsip_message_parser_init(state);
-
- /*
- * State mechine execution.
- */
- tsip_message_parser_execute(state, *result, extract_content);
-
- /* Check result */
-
- if( state->cs <
-/* #line 223 "./src/parsers/tsip_parser_message.c" */
-37
-/* #line 214 "./ragel/tsip_parser_message.rl" */
- )
- {
- TSK_DEBUG_ERROR("Failed to parse SIP message: %s", state->p);
- TSK_OBJECT_SAFE_FREE(*result);
- return tsk_false;
- }
- return tsk_true;
+ if(!state || state->pe <= state->p) {
+ return tsk_false;
+ }
+
+ if(!*result) {
+ *result = tsip_message_create();
+ }
+
+ /* Ragel init */
+ tsip_message_parser_init(state);
+
+ /*
+ * State mechine execution.
+ */
+ tsip_message_parser_execute(state, *result, extract_content);
+
+ /* Check result */
+
+ if( state->cs <
+ /* #line 223 "./src/parsers/tsip_parser_message.c" */
+ 37
+ /* #line 214 "./ragel/tsip_parser_message.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP message: %s", state->p);
+ TSK_OBJECT_SAFE_FREE(*result);
+ return tsk_false;
+ }
+ return tsk_true;
}
static void tsip_message_parser_init(tsk_ragel_state_t *state)
{
- int cs = 0;
-
- /* Regel machine initialization. */
-
-/* #line 242 "./src/parsers/tsip_parser_message.c" */
- {
- cs = tsip_machine_parser_message_start;
- }
-
-/* #line 230 "./ragel/tsip_parser_message.rl" */
-
- state->cs = cs;
+ int cs = 0;
+
+ /* Regel machine initialization. */
+
+ /* #line 242 "./src/parsers/tsip_parser_message.c" */
+ {
+ cs = tsip_machine_parser_message_start;
+ }
+
+ /* #line 230 "./ragel/tsip_parser_message.rl" */
+
+ state->cs = cs;
}
static void tsip_message_parser_execute(tsk_ragel_state_t *state, tsip_message_t *message, tsk_bool_t extract_content)
{
- int cs = state->cs;
- const char *p = state->p;
- const char *pe = state->pe;
- const char *eof = state->eof;
-
-
-/* #line 260 "./src/parsers/tsip_parser_message.c" */
- {
- int _klen;
- unsigned int _trans;
- short _widec;
- const char *_acts;
- unsigned int _nacts;
- const short *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = state->cs;
+ const char *p = state->p;
+ const char *pe = state->pe;
+ const char *eof = state->eof;
+
+
+ /* #line 260 "./src/parsers/tsip_parser_message.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ short _widec;
+ const char *_acts;
+ unsigned int _nacts;
+ const short *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _widec = (*p);
- _klen = _tsip_machine_parser_message_cond_lengths[cs];
- _keys = _tsip_machine_parser_message_cond_keys + (_tsip_machine_parser_message_cond_offsets[cs]*2);
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- switch ( _tsip_machine_parser_message_cond_spaces[_tsip_machine_parser_message_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
- case 0: {
- _widec = (short)(128 + ((*p) - -128));
- if (
-/* #line 36 "./ragel/tsip_parser_message.rl" */
-
- prev_not_comma(p)
- ) _widec += 256;
- break;
- }
- }
- break;
- }
- }
- }
-
- _keys = _tsip_machine_parser_message_trans_keys + _tsip_machine_parser_message_key_offsets[cs];
- _trans = _tsip_machine_parser_message_index_offsets[cs];
-
- _klen = _tsip_machine_parser_message_single_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( _widec < *_mid )
- _upper = _mid - 1;
- else if ( _widec > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_message_range_lengths[cs];
- if ( _klen > 0 ) {
- const short *_lower = _keys;
- const short *_mid;
- const short *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( _widec < _mid[0] )
- _upper = _mid - 2;
- else if ( _widec > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _widec = (*p);
+ _klen = _tsip_machine_parser_message_cond_lengths[cs];
+ _keys = _tsip_machine_parser_message_cond_keys + (_tsip_machine_parser_message_cond_offsets[cs]*2);
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ switch ( _tsip_machine_parser_message_cond_spaces[_tsip_machine_parser_message_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
+ case 0: {
+ _widec = (short)(128 + ((*p) - -128));
+ if (
+ /* #line 36 "./ragel/tsip_parser_message.rl" */
+
+ prev_not_comma(p)
+ ) {
+ _widec += 256;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ _keys = _tsip_machine_parser_message_trans_keys + _tsip_machine_parser_message_key_offsets[cs];
+ _trans = _tsip_machine_parser_message_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_message_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( _widec < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( _widec > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_message_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const short *_lower = _keys;
+ const short *_mid;
+ const short *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( _widec < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( _widec > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_message_indicies[_trans];
- cs = _tsip_machine_parser_message_trans_targs[_trans];
-
- if ( _tsip_machine_parser_message_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_message_actions + _tsip_machine_parser_message_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 55 "./ragel/tsip_parser_message.rl" */
- {
- state->tag_start = p;
- }
- break;
- case 1:
-/* #line 61 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(message->type == tsip_unknown)
- {
- message->type = tsip_request;
- if(!message->line.request.method)
- {
- message->line.request.method = tsk_calloc(1, len+1);
- memcpy(message->line.request.method, state->tag_start, len);
- message->line.request.request_type = tsip_request_get_type(message->line.request.method);
- }
- }
- else
- {
- state->cs = tsip_machine_parser_message_error;
- }
- }
- break;
- case 2:
-/* #line 84 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->line.request.uri)
- {
- message->line.request.uri = tsip_uri_parse(state->tag_start, (tsk_size_t)len);
- }
- }
- break;
- case 3:
-/* #line 97 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->sip_version)
- {
- message->sip_version = tsk_calloc(1, len+1);
- memcpy(message->sip_version, state->tag_start, len);
- }
- }
- break;
- case 4:
-/* #line 111 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(message->type == tsip_unknown)
- {
- message->type = tsip_response;
- message->line.response.status_code = atoi(state->tag_start);
- }
- else
- {
- state->cs = tsip_machine_parser_message_error;
- }
- }
- break;
- case 5:
-/* #line 129 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(!message->line.response.reason_phrase)
- {
- message->line.response.reason_phrase = tsk_calloc(1, len+1);
- memcpy(message->line.response.reason_phrase, state->tag_start, len);
- }
- }
- break;
- case 6:
-/* #line 143 "./ragel/tsip_parser_message.rl" */
- {
- int len;
- state->tag_end = p;
- len = (int)(state->tag_end - state->tag_start);
-
- if(tsip_header_parse(state, message)){
- //TSK_DEBUG_INFO("TSIP_MESSAGE_PARSER::PARSE_HEADER len=%d state=%d", len, state->cs);
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse header - %s", state->tag_start);
- }
- }
- break;
- case 7:
-/* #line 167 "./ragel/tsip_parser_message.rl" */
- {
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
-
- tsip_message_parser_eoh(state, message, extract_content);
-
- cs = state->cs;
- p = state->p;
- pe = state->pe;
- eof = state->eof;
- }
- break;
-/* #line 487 "./src/parsers/tsip_parser_message.c" */
- }
- }
+ _trans = _tsip_machine_parser_message_indicies[_trans];
+ cs = _tsip_machine_parser_message_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_message_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_message_actions + _tsip_machine_parser_message_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 55 "./ragel/tsip_parser_message.rl" */
+ {
+ state->tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 61 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(message->type == tsip_unknown) {
+ message->type = tsip_request;
+ if(!message->line.request.method) {
+ message->line.request.method = tsk_calloc(1, len+1);
+ memcpy(message->line.request.method, state->tag_start, len);
+ message->line.request.request_type = tsip_request_get_type(message->line.request.method);
+ }
+ }
+ else {
+ state->cs = tsip_machine_parser_message_error;
+ }
+ }
+ break;
+ case 2:
+ /* #line 84 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->line.request.uri) {
+ message->line.request.uri = tsip_uri_parse(state->tag_start, (tsk_size_t)len);
+ }
+ }
+ break;
+ case 3:
+ /* #line 97 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->sip_version) {
+ message->sip_version = tsk_calloc(1, len+1);
+ memcpy(message->sip_version, state->tag_start, len);
+ }
+ }
+ break;
+ case 4:
+ /* #line 111 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(message->type == tsip_unknown) {
+ message->type = tsip_response;
+ message->line.response.status_code = atoi(state->tag_start);
+ }
+ else {
+ state->cs = tsip_machine_parser_message_error;
+ }
+ }
+ break;
+ case 5:
+ /* #line 129 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(!message->line.response.reason_phrase) {
+ message->line.response.reason_phrase = tsk_calloc(1, len+1);
+ memcpy(message->line.response.reason_phrase, state->tag_start, len);
+ }
+ }
+ break;
+ case 6:
+ /* #line 143 "./ragel/tsip_parser_message.rl" */
+ {
+ int len;
+ state->tag_end = p;
+ len = (int)(state->tag_end - state->tag_start);
+
+ if(tsip_header_parse(state, message)) {
+ //TSK_DEBUG_INFO("TSIP_MESSAGE_PARSER::PARSE_HEADER len=%d state=%d", len, state->cs);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse header - %s", state->tag_start);
+ }
+ }
+ break;
+ case 7:
+ /* #line 167 "./ragel/tsip_parser_message.rl" */
+ {
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
+
+ tsip_message_parser_eoh(state, message, extract_content);
+
+ cs = state->cs;
+ p = state->p;
+ pe = state->pe;
+ eof = state->eof;
+ }
+ break;
+ /* #line 487 "./src/parsers/tsip_parser_message.c" */
+ }
+ }
_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- _out: {}
- }
-
-/* #line 242 "./ragel/tsip_parser_message.rl" */
-
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+_out: {
+ }
+ }
+
+ /* #line 242 "./ragel/tsip_parser_message.rl" */
+
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
}
static void tsip_message_parser_eoh(tsk_ragel_state_t *state, tsip_message_t *message, tsk_bool_t extract_content)
{
- int cs = state->cs;
- const char *p = state->p;
- const char *pe = state->pe;
- const char *eof = state->eof;
- const char *eoh = (state->p + 1);
-
- if(extract_content && message)
- {
- uint32_t clen = TSIP_MESSAGE_CONTENT_LENGTH(message);
- if((p+clen) <pe && !message->Content){
- message->Content = tsk_buffer_create((p+1), clen);
- p = (p+clen);
- }
- else{
- p = (pe-1);
- }
- }
- //%%write eof;
-
- state->cs = cs;
- state->p = p;
- state->pe = pe;
- state->eof = eof;
- state->eoh = eoh;
+ int cs = state->cs;
+ const char *p = state->p;
+ const char *pe = state->pe;
+ const char *eof = state->eof;
+ const char *eoh = (state->p + 1);
+
+ if(extract_content && message) {
+ uint32_t clen = TSIP_MESSAGE_CONTENT_LENGTH(message);
+ if((p+clen) <pe && !message->Content) {
+ message->Content = tsk_buffer_create((p+1), clen);
+ p = (p+clen);
+ }
+ else {
+ p = (pe-1);
+ }
+ }
+ //%%write eof;
+
+ state->cs = cs;
+ state->p = p;
+ state->pe = pe;
+ state->eof = eof;
+ state->eoh = eoh;
}
diff --git a/tinySIP/src/parsers/tsip_parser_uri.c b/tinySIP/src/parsers/tsip_parser_uri.c
index b15ee1c..a81197e 100755
--- a/tinySIP/src/parsers/tsip_parser_uri.c
+++ b/tinySIP/src/parsers/tsip_parser_uri.c
@@ -4,19 +4,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -45,14 +45,14 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
/// @ingroup tsip_uri_group
///
-/// Creates SIP/SIPS/TEL URI from string buffer.
+/// Creates SIP/SIPS/TEL URI from string buffer.
///
///
/// @param data Pointer to a string buffer from which to create the URI object.
-/// @param size The size of the string buffer.
+/// @param size The size of the string buffer.
///
/// @retval @ref tsip_uri_t* object if succeed and Null otherwise.
-///
+///
/// @code
/// tsip_uri_t* uri;
/// if((uri = tsip_uri_parse("sip:bob@open-ims.test", strlen("sip:bob@open-ims.test")))){
@@ -68,618 +68,689 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
tsip_uri_t *tsip_uri_parse(const char *data, tsk_size_t size)
{
- int cs = 0;
- const char *p = data;
- const char *pe = p + size;
- const char *eof = pe;
-
- const char *ts = tsk_null, *te = tsk_null;
- int act = 0;
-
- tsip_uri_t *uri = tsip_uri_create(uri_unknown);
-
- const char *tag_start = tsk_null;
-
-
-/* #line 85 "./src/parsers/tsip_parser_uri.c" */
-static const char _tsip_machine_parser_uri_actions[] = {
- 0, 1, 0, 1, 5, 1, 7, 1,
- 9, 1, 11, 1, 12, 1, 13, 1,
- 14, 1, 17, 1, 18, 1, 20, 1,
- 21, 1, 22, 1, 23, 2, 1, 15,
- 2, 2, 15, 2, 4, 6, 2, 7,
- 10, 2, 7, 16, 2, 8, 10, 2,
- 9, 16, 2, 9, 19, 2, 13, 0,
- 2, 13, 6, 3, 0, 8, 10, 3,
- 13, 0, 6, 3, 13, 3, 0
-};
-
-static const short _tsip_machine_parser_uri_key_offsets[] = {
- 0, 0, 7, 15, 22, 28, 34, 40,
- 53, 66, 72, 78, 78, 91, 97, 103,
- 116, 122, 128, 141, 154, 160, 166, 180,
- 194, 200, 206, 219, 219, 227, 234, 242,
- 248, 256, 262, 268, 276, 282, 290, 296,
- 304, 312, 320, 328, 336, 344, 352, 360,
- 368, 370, 372, 385, 400, 414, 420, 426,
- 436, 446, 457, 457, 466, 466, 476, 486,
- 495, 496, 511, 525, 532, 540, 548, 556,
- 558, 565, 574, 576, 579, 581, 584, 586,
- 589, 592, 593, 596, 597, 600, 601, 610,
- 619, 627, 635, 643, 651, 653, 659, 668,
- 677, 686, 688, 691, 694, 695, 696
-};
-
-static const char _tsip_machine_parser_uri_trans_keys[] = {
- 45, 48, 57, 65, 90, 97, 122, 45,
- 46, 48, 57, 65, 90, 97, 122, 45,
- 48, 57, 65, 90, 97, 122, 48, 57,
- 65, 90, 97, 122, 48, 57, 65, 70,
- 97, 102, 48, 57, 65, 70, 97, 102,
- 33, 37, 93, 95, 126, 36, 43, 45,
- 58, 65, 91, 97, 122, 33, 37, 93,
- 95, 126, 36, 43, 45, 58, 65, 91,
- 97, 122, 48, 57, 65, 70, 97, 102,
- 48, 57, 65, 70, 97, 102, 33, 37,
- 93, 95, 126, 36, 43, 45, 58, 65,
- 91, 97, 122, 48, 57, 65, 70, 97,
- 102, 48, 57, 65, 70, 97, 102, 33,
- 37, 93, 95, 126, 36, 43, 45, 58,
- 65, 91, 97, 122, 48, 57, 65, 70,
- 97, 102, 48, 57, 65, 70, 97, 102,
- 33, 37, 59, 61, 63, 95, 126, 36,
- 57, 65, 90, 97, 122, 33, 37, 58,
- 61, 64, 95, 126, 36, 59, 63, 90,
- 97, 122, 48, 57, 65, 70, 97, 102,
- 48, 57, 65, 70, 97, 102, 33, 37,
- 61, 64, 95, 126, 36, 46, 48, 57,
- 65, 90, 97, 122, 33, 37, 61, 64,
- 95, 126, 36, 46, 48, 57, 65, 90,
- 97, 122, 48, 57, 65, 70, 97, 102,
- 48, 57, 65, 70, 97, 102, 58, 59,
- 83, 84, 91, 115, 116, 48, 57, 65,
- 90, 97, 122, 45, 46, 48, 57, 65,
- 90, 97, 122, 45, 48, 57, 65, 90,
- 97, 122, 45, 46, 48, 57, 65, 90,
- 97, 122, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 48, 57, 65, 90, 97, 122, 48, 57,
- 65, 90, 97, 122, 45, 46, 48, 57,
- 65, 90, 97, 122, 48, 57, 65, 90,
- 97, 122, 45, 46, 48, 57, 65, 90,
- 97, 122, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 45, 46, 48, 57, 65, 90, 97, 122,
- 48, 57, 48, 57, 33, 37, 93, 95,
- 126, 36, 43, 45, 58, 65, 91, 97,
- 122, 33, 37, 59, 61, 93, 95, 126,
- 36, 43, 45, 58, 65, 91, 97, 122,
- 33, 37, 59, 93, 95, 126, 36, 43,
- 45, 58, 65, 91, 97, 122, 48, 57,
- 65, 70, 97, 102, 48, 57, 65, 70,
- 97, 102, 45, 46, 73, 105, 48, 57,
- 65, 90, 97, 122, 45, 46, 80, 112,
- 48, 57, 65, 90, 97, 122, 45, 46,
- 58, 83, 115, 48, 57, 65, 90, 97,
- 122, 45, 46, 58, 48, 57, 65, 90,
- 97, 122, 45, 46, 69, 101, 48, 57,
- 65, 90, 97, 122, 45, 46, 76, 108,
- 48, 57, 65, 90, 97, 122, 45, 46,
- 58, 48, 57, 65, 90, 97, 122, 59,
- 33, 37, 59, 61, 93, 95, 126, 36,
- 43, 45, 58, 65, 91, 97, 122, 33,
- 37, 59, 93, 95, 126, 36, 43, 45,
- 58, 65, 91, 97, 122, 58, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 48, 57,
- 65, 70, 97, 102, 58, 93, 58, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 48, 57, 46, 48, 57,
- 48, 57, 93, 48, 57, 93, 48, 57,
- 93, 46, 48, 57, 46, 46, 48, 57,
- 46, 46, 58, 93, 48, 57, 65, 70,
- 97, 102, 46, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 58, 93, 48, 57, 65,
- 70, 97, 102, 46, 58, 93, 48, 57,
- 65, 70, 97, 102, 46, 58, 93, 48,
- 57, 65, 70, 97, 102, 46, 58, 93,
- 48, 57, 65, 70, 97, 102, 48, 57,
- 46, 48, 57, 46, 48, 57, 46, 58,
- 0
-};
-
-static const char _tsip_machine_parser_uri_single_lengths[] = {
- 0, 1, 2, 1, 0, 0, 0, 5,
- 5, 0, 0, 0, 5, 0, 0, 5,
- 0, 0, 7, 7, 0, 0, 6, 6,
- 0, 0, 7, 0, 2, 1, 2, 0,
- 2, 0, 0, 2, 0, 2, 0, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 5, 7, 6, 0, 0, 4,
- 4, 5, 0, 3, 0, 4, 4, 3,
- 1, 7, 6, 1, 2, 2, 2, 2,
- 1, 3, 0, 1, 0, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 3, 3,
- 2, 2, 2, 2, 2, 0, 3, 3,
- 3, 0, 1, 1, 1, 1, 0
-};
-
-static const char _tsip_machine_parser_uri_range_lengths[] = {
- 0, 3, 3, 3, 3, 3, 3, 4,
- 4, 3, 3, 0, 4, 3, 3, 4,
- 3, 3, 3, 3, 3, 3, 4, 4,
- 3, 3, 3, 0, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 1, 1, 4, 4, 4, 3, 3, 3,
- 3, 3, 0, 3, 0, 3, 3, 3,
- 0, 4, 4, 3, 3, 3, 3, 0,
- 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 0, 1, 0, 3, 3,
- 3, 3, 3, 3, 0, 3, 3, 3,
- 3, 1, 1, 1, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_uri_index_offsets[] = {
- 0, 0, 5, 11, 16, 20, 24, 28,
- 38, 48, 52, 56, 57, 67, 71, 75,
- 85, 89, 93, 104, 115, 119, 123, 134,
- 145, 149, 153, 164, 165, 171, 176, 182,
- 186, 192, 196, 200, 206, 210, 216, 220,
- 226, 232, 238, 244, 250, 256, 262, 268,
- 274, 276, 278, 288, 300, 311, 315, 319,
- 327, 335, 344, 345, 352, 353, 361, 369,
- 376, 378, 390, 401, 406, 412, 418, 424,
- 427, 432, 439, 441, 444, 446, 449, 451,
- 454, 457, 459, 462, 464, 467, 469, 476,
- 483, 489, 495, 501, 507, 510, 514, 521,
- 528, 535, 537, 540, 543, 545, 547
-};
-
-static const char _tsip_machine_parser_uri_indicies[] = {
- 1, 2, 2, 2, 0, 3, 4, 5,
- 5, 5, 0, 3, 5, 5, 5, 0,
- 5, 2, 2, 0, 7, 7, 7, 6,
- 8, 8, 8, 6, 9, 10, 9, 9,
- 9, 9, 9, 9, 9, 6, 11, 12,
- 11, 11, 11, 11, 11, 11, 11, 6,
- 13, 13, 13, 6, 11, 11, 11, 6,
- 14, 16, 17, 16, 16, 16, 16, 16,
- 16, 16, 15, 18, 18, 18, 15, 19,
- 19, 19, 15, 20, 21, 20, 20, 20,
- 20, 20, 20, 20, 15, 22, 22, 22,
- 15, 20, 20, 20, 15, 23, 25, 23,
- 23, 23, 23, 23, 23, 23, 23, 24,
- 26, 27, 28, 26, 29, 26, 26, 26,
- 26, 26, 24, 30, 30, 30, 24, 26,
- 26, 26, 24, 31, 32, 31, 33, 31,
- 31, 31, 31, 31, 31, 24, 34, 35,
- 34, 36, 34, 34, 34, 34, 34, 34,
- 24, 37, 37, 37, 24, 34, 34, 34,
- 24, 40, 41, 43, 44, 45, 43, 44,
- 39, 42, 42, 38, 38, 47, 48, 49,
- 50, 50, 38, 47, 50, 50, 50, 38,
- 47, 51, 50, 50, 50, 38, 50, 2,
- 2, 38, 1, 53, 2, 2, 2, 52,
- 5, 2, 2, 52, 54, 2, 2, 38,
- 47, 55, 56, 50, 50, 38, 57, 2,
- 2, 38, 47, 58, 59, 50, 50, 38,
- 60, 2, 2, 38, 3, 4, 61, 5,
- 5, 52, 3, 4, 62, 5, 5, 52,
- 3, 4, 5, 5, 5, 52, 47, 58,
- 63, 50, 50, 38, 47, 58, 50, 50,
- 50, 38, 47, 55, 64, 50, 50, 38,
- 47, 55, 50, 50, 50, 38, 47, 48,
- 65, 50, 50, 38, 47, 48, 50, 50,
- 50, 38, 66, 38, 66, 67, 9, 68,
- 9, 9, 9, 9, 9, 9, 9, 38,
- 8, 70, 71, 72, 8, 8, 8, 8,
- 8, 8, 8, 69, 11, 12, 71, 11,
- 11, 11, 11, 11, 11, 11, 69, 73,
- 73, 73, 38, 8, 8, 8, 38, 1,
- 53, 74, 74, 2, 2, 2, 52, 1,
- 53, 75, 75, 2, 2, 2, 52, 1,
- 53, 76, 77, 77, 2, 2, 2, 52,
- 78, 1, 53, 79, 2, 2, 2, 52,
- 80, 1, 53, 81, 81, 2, 2, 2,
- 52, 1, 53, 82, 82, 2, 2, 2,
- 52, 1, 53, 83, 2, 2, 2, 52,
- 86, 85, 19, 88, 89, 90, 19, 19,
- 19, 19, 19, 19, 19, 87, 20, 21,
- 89, 20, 20, 20, 20, 20, 20, 20,
- 87, 92, 91, 91, 91, 38, 94, 95,
- 93, 93, 93, 38, 94, 95, 96, 96,
- 96, 38, 94, 95, 97, 97, 97, 38,
- 94, 95, 38, 99, 98, 91, 91, 38,
- 100, 94, 95, 101, 93, 93, 38, 102,
- 38, 103, 104, 38, 105, 38, 106, 107,
- 38, 108, 38, 95, 109, 38, 95, 110,
- 38, 95, 38, 106, 111, 38, 106, 38,
- 103, 112, 38, 103, 38, 100, 94, 95,
- 113, 96, 96, 38, 100, 94, 95, 97,
- 97, 97, 38, 115, 95, 114, 114, 114,
- 38, 117, 95, 116, 116, 116, 38, 117,
- 95, 118, 118, 118, 38, 117, 95, 119,
- 119, 119, 38, 117, 95, 38, 120, 114,
- 114, 38, 100, 117, 95, 121, 116, 116,
- 38, 100, 117, 95, 122, 118, 118, 38,
- 100, 117, 95, 119, 119, 119, 38, 123,
- 38, 100, 124, 38, 100, 125, 38, 100,
- 38, 99, 38, 24, 0
-};
-
-static const char _tsip_machine_parser_uri_trans_targs[] = {
- 26, 1, 32, 3, 4, 2, 26, 6,
- 51, 51, 5, 52, 9, 10, 64, 26,
- 65, 13, 14, 65, 66, 16, 17, 19,
- 0, 20, 19, 20, 22, 102, 21, 23,
- 24, 102, 23, 24, 102, 25, 27, 28,
- 48, 50, 32, 55, 61, 67, 26, 29,
- 34, 46, 30, 31, 26, 33, 35, 36,
- 44, 37, 38, 42, 39, 40, 41, 43,
- 45, 47, 49, 26, 53, 26, 5, 7,
- 8, 54, 56, 57, 58, 59, 26, 60,
- 26, 62, 63, 11, 26, 64, 12, 26,
- 13, 12, 15, 68, 101, 69, 72, 26,
- 70, 71, 73, 88, 74, 86, 75, 76,
- 84, 77, 78, 82, 79, 80, 81, 83,
- 85, 87, 89, 97, 90, 93, 91, 92,
- 94, 95, 96, 98, 99, 100
-};
-
-static const char _tsip_machine_parser_uri_trans_actions[] = {
- 25, 0, 13, 0, 0, 0, 27, 0,
- 13, 53, 1, 13, 0, 0, 67, 23,
- 53, 1, 0, 13, 13, 0, 0, 1,
- 0, 1, 0, 0, 5, 38, 0, 1,
- 1, 59, 0, 0, 44, 0, 0, 35,
- 0, 0, 56, 63, 56, 3, 21, 0,
- 0, 0, 0, 0, 17, 13, 0, 0,
- 0, 0, 0, 0, 13, 13, 13, 0,
- 0, 0, 0, 19, 1, 50, 0, 7,
- 0, 0, 13, 13, 0, 13, 29, 0,
- 32, 13, 13, 0, 41, 13, 5, 47,
- 0, 7, 0, 0, 0, 0, 0, 15,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0
-};
-
-static const char _tsip_machine_parser_uri_to_state_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 9, 0, 0, 0, 0, 0,
- 0, 0, 9, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const char _tsip_machine_parser_uri_from_state_actions[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 11, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const short _tsip_machine_parser_uri_eof_trans[] = {
- 0, 1, 1, 1, 1, 7, 7, 7,
- 7, 7, 7, 1, 16, 16, 16, 16,
- 16, 16, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 47, 47, 47, 47, 47,
- 53, 53, 47, 47, 47, 47, 47, 53,
- 53, 53, 47, 47, 47, 47, 47, 47,
- 47, 68, 47, 70, 70, 47, 47, 53,
- 53, 53, 79, 53, 81, 53, 53, 53,
- 85, 88, 88, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 0
-};
-
-static const int tsip_machine_parser_uri_start = 26;
-static const int tsip_machine_parser_uri_first_final = 26;
-static const int tsip_machine_parser_uri_error = 0;
-
-static const int tsip_machine_parser_uri_en_sip_usrinfo = 18;
-static const int tsip_machine_parser_uri_en_main = 26;
-
-
-/* #line 166 "./ragel/tsip_parser_uri.rl" */
- (void)(eof);
- (void)(void)(tsip_machine_parser_uri_first_final);
- (void)(void)(tsip_machine_parser_uri_error);
- (void)(void)(tsip_machine_parser_uri_en_sip_usrinfo);
- (void)(void)(tsip_machine_parser_uri_en_main);
-
-/* #line 426 "./src/parsers/tsip_parser_uri.c" */
- {
- cs = tsip_machine_parser_uri_start;
- ts = 0;
- te = 0;
- act = 0;
- }
-
-/* #line 172 "./ragel/tsip_parser_uri.rl" */
-
-/* #line 436 "./src/parsers/tsip_parser_uri.c" */
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
+ int cs = 0;
+ const char *p = data;
+ const char *pe = p + size;
+ const char *eof = pe;
+
+ const char *ts = tsk_null, *te = tsk_null;
+ int act = 0;
+
+ tsip_uri_t *uri = tsip_uri_create(uri_unknown);
+
+ const char *tag_start = tsk_null;
+
+
+ /* #line 85 "./src/parsers/tsip_parser_uri.c" */
+ static const char _tsip_machine_parser_uri_actions[] = {
+ 0, 1, 0, 1, 5, 1, 7, 1,
+ 9, 1, 11, 1, 12, 1, 13, 1,
+ 14, 1, 17, 1, 18, 1, 20, 1,
+ 21, 1, 22, 1, 23, 2, 1, 15,
+ 2, 2, 15, 2, 4, 6, 2, 7,
+ 10, 2, 7, 16, 2, 8, 10, 2,
+ 9, 16, 2, 9, 19, 2, 13, 0,
+ 2, 13, 6, 3, 0, 8, 10, 3,
+ 13, 0, 6, 3, 13, 3, 0
+ };
+
+ static const short _tsip_machine_parser_uri_key_offsets[] = {
+ 0, 0, 7, 15, 22, 28, 34, 40,
+ 53, 66, 72, 78, 78, 91, 97, 103,
+ 116, 122, 128, 141, 154, 160, 166, 180,
+ 194, 200, 206, 219, 219, 227, 234, 242,
+ 248, 256, 262, 268, 276, 282, 290, 296,
+ 304, 312, 320, 328, 336, 344, 352, 360,
+ 368, 370, 372, 385, 400, 414, 420, 426,
+ 436, 446, 457, 457, 466, 466, 476, 486,
+ 495, 496, 511, 525, 532, 540, 548, 556,
+ 558, 565, 574, 576, 579, 581, 584, 586,
+ 589, 592, 593, 596, 597, 600, 601, 610,
+ 619, 627, 635, 643, 651, 653, 659, 668,
+ 677, 686, 688, 691, 694, 695, 696
+ };
+
+ static const char _tsip_machine_parser_uri_trans_keys[] = {
+ 45, 48, 57, 65, 90, 97, 122, 45,
+ 46, 48, 57, 65, 90, 97, 122, 45,
+ 48, 57, 65, 90, 97, 122, 48, 57,
+ 65, 90, 97, 122, 48, 57, 65, 70,
+ 97, 102, 48, 57, 65, 70, 97, 102,
+ 33, 37, 93, 95, 126, 36, 43, 45,
+ 58, 65, 91, 97, 122, 33, 37, 93,
+ 95, 126, 36, 43, 45, 58, 65, 91,
+ 97, 122, 48, 57, 65, 70, 97, 102,
+ 48, 57, 65, 70, 97, 102, 33, 37,
+ 93, 95, 126, 36, 43, 45, 58, 65,
+ 91, 97, 122, 48, 57, 65, 70, 97,
+ 102, 48, 57, 65, 70, 97, 102, 33,
+ 37, 93, 95, 126, 36, 43, 45, 58,
+ 65, 91, 97, 122, 48, 57, 65, 70,
+ 97, 102, 48, 57, 65, 70, 97, 102,
+ 33, 37, 59, 61, 63, 95, 126, 36,
+ 57, 65, 90, 97, 122, 33, 37, 58,
+ 61, 64, 95, 126, 36, 59, 63, 90,
+ 97, 122, 48, 57, 65, 70, 97, 102,
+ 48, 57, 65, 70, 97, 102, 33, 37,
+ 61, 64, 95, 126, 36, 46, 48, 57,
+ 65, 90, 97, 122, 33, 37, 61, 64,
+ 95, 126, 36, 46, 48, 57, 65, 90,
+ 97, 122, 48, 57, 65, 70, 97, 102,
+ 48, 57, 65, 70, 97, 102, 58, 59,
+ 83, 84, 91, 115, 116, 48, 57, 65,
+ 90, 97, 122, 45, 46, 48, 57, 65,
+ 90, 97, 122, 45, 48, 57, 65, 90,
+ 97, 122, 45, 46, 48, 57, 65, 90,
+ 97, 122, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 48, 57, 65, 90, 97, 122, 48, 57,
+ 65, 90, 97, 122, 45, 46, 48, 57,
+ 65, 90, 97, 122, 48, 57, 65, 90,
+ 97, 122, 45, 46, 48, 57, 65, 90,
+ 97, 122, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 45, 46, 48, 57, 65, 90, 97, 122,
+ 48, 57, 48, 57, 33, 37, 93, 95,
+ 126, 36, 43, 45, 58, 65, 91, 97,
+ 122, 33, 37, 59, 61, 93, 95, 126,
+ 36, 43, 45, 58, 65, 91, 97, 122,
+ 33, 37, 59, 93, 95, 126, 36, 43,
+ 45, 58, 65, 91, 97, 122, 48, 57,
+ 65, 70, 97, 102, 48, 57, 65, 70,
+ 97, 102, 45, 46, 73, 105, 48, 57,
+ 65, 90, 97, 122, 45, 46, 80, 112,
+ 48, 57, 65, 90, 97, 122, 45, 46,
+ 58, 83, 115, 48, 57, 65, 90, 97,
+ 122, 45, 46, 58, 48, 57, 65, 90,
+ 97, 122, 45, 46, 69, 101, 48, 57,
+ 65, 90, 97, 122, 45, 46, 76, 108,
+ 48, 57, 65, 90, 97, 122, 45, 46,
+ 58, 48, 57, 65, 90, 97, 122, 59,
+ 33, 37, 59, 61, 93, 95, 126, 36,
+ 43, 45, 58, 65, 91, 97, 122, 33,
+ 37, 59, 93, 95, 126, 36, 43, 45,
+ 58, 65, 91, 97, 122, 58, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 48, 57,
+ 65, 70, 97, 102, 58, 93, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 48, 57, 46, 48, 57,
+ 48, 57, 93, 48, 57, 93, 48, 57,
+ 93, 46, 48, 57, 46, 46, 48, 57,
+ 46, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 48, 57,
+ 46, 48, 57, 46, 48, 57, 46, 58,
+ 0
+ };
+
+ static const char _tsip_machine_parser_uri_single_lengths[] = {
+ 0, 1, 2, 1, 0, 0, 0, 5,
+ 5, 0, 0, 0, 5, 0, 0, 5,
+ 0, 0, 7, 7, 0, 0, 6, 6,
+ 0, 0, 7, 0, 2, 1, 2, 0,
+ 2, 0, 0, 2, 0, 2, 0, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 0, 0, 5, 7, 6, 0, 0, 4,
+ 4, 5, 0, 3, 0, 4, 4, 3,
+ 1, 7, 6, 1, 2, 2, 2, 2,
+ 1, 3, 0, 1, 0, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1, 3, 3,
+ 2, 2, 2, 2, 2, 0, 3, 3,
+ 3, 0, 1, 1, 1, 1, 0
+ };
+
+ static const char _tsip_machine_parser_uri_range_lengths[] = {
+ 0, 3, 3, 3, 3, 3, 3, 4,
+ 4, 3, 3, 0, 4, 3, 3, 4,
+ 3, 3, 3, 3, 3, 3, 4, 4,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 1, 1, 4, 4, 4, 3, 3, 3,
+ 3, 3, 0, 3, 0, 3, 3, 3,
+ 0, 4, 4, 3, 3, 3, 3, 0,
+ 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 0, 1, 0, 3, 3,
+ 3, 3, 3, 3, 0, 3, 3, 3,
+ 3, 1, 1, 1, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_uri_index_offsets[] = {
+ 0, 0, 5, 11, 16, 20, 24, 28,
+ 38, 48, 52, 56, 57, 67, 71, 75,
+ 85, 89, 93, 104, 115, 119, 123, 134,
+ 145, 149, 153, 164, 165, 171, 176, 182,
+ 186, 192, 196, 200, 206, 210, 216, 220,
+ 226, 232, 238, 244, 250, 256, 262, 268,
+ 274, 276, 278, 288, 300, 311, 315, 319,
+ 327, 335, 344, 345, 352, 353, 361, 369,
+ 376, 378, 390, 401, 406, 412, 418, 424,
+ 427, 432, 439, 441, 444, 446, 449, 451,
+ 454, 457, 459, 462, 464, 467, 469, 476,
+ 483, 489, 495, 501, 507, 510, 514, 521,
+ 528, 535, 537, 540, 543, 545, 547
+ };
+
+ static const char _tsip_machine_parser_uri_indicies[] = {
+ 1, 2, 2, 2, 0, 3, 4, 5,
+ 5, 5, 0, 3, 5, 5, 5, 0,
+ 5, 2, 2, 0, 7, 7, 7, 6,
+ 8, 8, 8, 6, 9, 10, 9, 9,
+ 9, 9, 9, 9, 9, 6, 11, 12,
+ 11, 11, 11, 11, 11, 11, 11, 6,
+ 13, 13, 13, 6, 11, 11, 11, 6,
+ 14, 16, 17, 16, 16, 16, 16, 16,
+ 16, 16, 15, 18, 18, 18, 15, 19,
+ 19, 19, 15, 20, 21, 20, 20, 20,
+ 20, 20, 20, 20, 15, 22, 22, 22,
+ 15, 20, 20, 20, 15, 23, 25, 23,
+ 23, 23, 23, 23, 23, 23, 23, 24,
+ 26, 27, 28, 26, 29, 26, 26, 26,
+ 26, 26, 24, 30, 30, 30, 24, 26,
+ 26, 26, 24, 31, 32, 31, 33, 31,
+ 31, 31, 31, 31, 31, 24, 34, 35,
+ 34, 36, 34, 34, 34, 34, 34, 34,
+ 24, 37, 37, 37, 24, 34, 34, 34,
+ 24, 40, 41, 43, 44, 45, 43, 44,
+ 39, 42, 42, 38, 38, 47, 48, 49,
+ 50, 50, 38, 47, 50, 50, 50, 38,
+ 47, 51, 50, 50, 50, 38, 50, 2,
+ 2, 38, 1, 53, 2, 2, 2, 52,
+ 5, 2, 2, 52, 54, 2, 2, 38,
+ 47, 55, 56, 50, 50, 38, 57, 2,
+ 2, 38, 47, 58, 59, 50, 50, 38,
+ 60, 2, 2, 38, 3, 4, 61, 5,
+ 5, 52, 3, 4, 62, 5, 5, 52,
+ 3, 4, 5, 5, 5, 52, 47, 58,
+ 63, 50, 50, 38, 47, 58, 50, 50,
+ 50, 38, 47, 55, 64, 50, 50, 38,
+ 47, 55, 50, 50, 50, 38, 47, 48,
+ 65, 50, 50, 38, 47, 48, 50, 50,
+ 50, 38, 66, 38, 66, 67, 9, 68,
+ 9, 9, 9, 9, 9, 9, 9, 38,
+ 8, 70, 71, 72, 8, 8, 8, 8,
+ 8, 8, 8, 69, 11, 12, 71, 11,
+ 11, 11, 11, 11, 11, 11, 69, 73,
+ 73, 73, 38, 8, 8, 8, 38, 1,
+ 53, 74, 74, 2, 2, 2, 52, 1,
+ 53, 75, 75, 2, 2, 2, 52, 1,
+ 53, 76, 77, 77, 2, 2, 2, 52,
+ 78, 1, 53, 79, 2, 2, 2, 52,
+ 80, 1, 53, 81, 81, 2, 2, 2,
+ 52, 1, 53, 82, 82, 2, 2, 2,
+ 52, 1, 53, 83, 2, 2, 2, 52,
+ 86, 85, 19, 88, 89, 90, 19, 19,
+ 19, 19, 19, 19, 19, 87, 20, 21,
+ 89, 20, 20, 20, 20, 20, 20, 20,
+ 87, 92, 91, 91, 91, 38, 94, 95,
+ 93, 93, 93, 38, 94, 95, 96, 96,
+ 96, 38, 94, 95, 97, 97, 97, 38,
+ 94, 95, 38, 99, 98, 91, 91, 38,
+ 100, 94, 95, 101, 93, 93, 38, 102,
+ 38, 103, 104, 38, 105, 38, 106, 107,
+ 38, 108, 38, 95, 109, 38, 95, 110,
+ 38, 95, 38, 106, 111, 38, 106, 38,
+ 103, 112, 38, 103, 38, 100, 94, 95,
+ 113, 96, 96, 38, 100, 94, 95, 97,
+ 97, 97, 38, 115, 95, 114, 114, 114,
+ 38, 117, 95, 116, 116, 116, 38, 117,
+ 95, 118, 118, 118, 38, 117, 95, 119,
+ 119, 119, 38, 117, 95, 38, 120, 114,
+ 114, 38, 100, 117, 95, 121, 116, 116,
+ 38, 100, 117, 95, 122, 118, 118, 38,
+ 100, 117, 95, 119, 119, 119, 38, 123,
+ 38, 100, 124, 38, 100, 125, 38, 100,
+ 38, 99, 38, 24, 0
+ };
+
+ static const char _tsip_machine_parser_uri_trans_targs[] = {
+ 26, 1, 32, 3, 4, 2, 26, 6,
+ 51, 51, 5, 52, 9, 10, 64, 26,
+ 65, 13, 14, 65, 66, 16, 17, 19,
+ 0, 20, 19, 20, 22, 102, 21, 23,
+ 24, 102, 23, 24, 102, 25, 27, 28,
+ 48, 50, 32, 55, 61, 67, 26, 29,
+ 34, 46, 30, 31, 26, 33, 35, 36,
+ 44, 37, 38, 42, 39, 40, 41, 43,
+ 45, 47, 49, 26, 53, 26, 5, 7,
+ 8, 54, 56, 57, 58, 59, 26, 60,
+ 26, 62, 63, 11, 26, 64, 12, 26,
+ 13, 12, 15, 68, 101, 69, 72, 26,
+ 70, 71, 73, 88, 74, 86, 75, 76,
+ 84, 77, 78, 82, 79, 80, 81, 83,
+ 85, 87, 89, 97, 90, 93, 91, 92,
+ 94, 95, 96, 98, 99, 100
+ };
+
+ static const char _tsip_machine_parser_uri_trans_actions[] = {
+ 25, 0, 13, 0, 0, 0, 27, 0,
+ 13, 53, 1, 13, 0, 0, 67, 23,
+ 53, 1, 0, 13, 13, 0, 0, 1,
+ 0, 1, 0, 0, 5, 38, 0, 1,
+ 1, 59, 0, 0, 44, 0, 0, 35,
+ 0, 0, 56, 63, 56, 3, 21, 0,
+ 0, 0, 0, 0, 17, 13, 0, 0,
+ 0, 0, 0, 0, 13, 13, 13, 0,
+ 0, 0, 0, 19, 1, 50, 0, 7,
+ 0, 0, 13, 13, 0, 13, 29, 0,
+ 32, 13, 13, 0, 41, 13, 5, 47,
+ 0, 7, 0, 0, 0, 0, 0, 15,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_uri_to_state_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const char _tsip_machine_parser_uri_from_state_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 11, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static const short _tsip_machine_parser_uri_eof_trans[] = {
+ 0, 1, 1, 1, 1, 7, 7, 7,
+ 7, 7, 7, 1, 16, 16, 16, 16,
+ 16, 16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 47, 47, 47, 47, 47,
+ 53, 53, 47, 47, 47, 47, 47, 53,
+ 53, 53, 47, 47, 47, 47, 47, 47,
+ 47, 68, 47, 70, 70, 47, 47, 53,
+ 53, 53, 79, 53, 81, 53, 53, 53,
+ 85, 88, 88, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 0
+ };
+
+ static const int tsip_machine_parser_uri_start = 26;
+ static const int tsip_machine_parser_uri_first_final = 26;
+ static const int tsip_machine_parser_uri_error = 0;
+
+ static const int tsip_machine_parser_uri_en_sip_usrinfo = 18;
+ static const int tsip_machine_parser_uri_en_main = 26;
+
+
+ /* #line 166 "./ragel/tsip_parser_uri.rl" */
+ (void)(eof);
+ (void)(void)(tsip_machine_parser_uri_first_final);
+ (void)(void)(tsip_machine_parser_uri_error);
+ (void)(void)(tsip_machine_parser_uri_en_sip_usrinfo);
+ (void)(void)(tsip_machine_parser_uri_en_main);
+
+ /* #line 426 "./src/parsers/tsip_parser_uri.c" */
+ {
+ cs = tsip_machine_parser_uri_start;
+ ts = 0;
+ te = 0;
+ act = 0;
+ }
+
+ /* #line 172 "./ragel/tsip_parser_uri.rl" */
+
+ /* #line 436 "./src/parsers/tsip_parser_uri.c" */
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe ) {
+ goto _test_eof;
+ }
+ if ( cs == 0 ) {
+ goto _out;
+ }
_resume:
- _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_from_state_actions[cs];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 ) {
- switch ( *_acts++ ) {
- case 12:
-/* #line 1 "./ragel/tsip_parser_uri.rl" */
- {ts = p;}
- break;
-/* #line 457 "./src/parsers/tsip_parser_uri.c" */
- }
- }
-
- _keys = _tsip_machine_parser_uri_trans_keys + _tsip_machine_parser_uri_key_offsets[cs];
- _trans = _tsip_machine_parser_uri_index_offsets[cs];
-
- _klen = _tsip_machine_parser_uri_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _tsip_machine_parser_uri_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += ((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
+ _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_from_state_actions[cs];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 12:
+ /* #line 1 "./ragel/tsip_parser_uri.rl" */
+ {
+ ts = p;
+ }
+ break;
+ /* #line 457 "./src/parsers/tsip_parser_uri.c" */
+ }
+ }
+
+ _keys = _tsip_machine_parser_uri_trans_keys + _tsip_machine_parser_uri_key_offsets[cs];
+ _trans = _tsip_machine_parser_uri_index_offsets[cs];
+
+ _klen = _tsip_machine_parser_uri_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid ) {
+ _upper = _mid - 1;
+ }
+ else if ( (*p) > *_mid ) {
+ _lower = _mid + 1;
+ }
+ else {
+ _trans += (_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _tsip_machine_parser_uri_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower ) {
+ break;
+ }
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] ) {
+ _upper = _mid - 2;
+ }
+ else if ( (*p) > _mid[1] ) {
+ _lower = _mid + 2;
+ }
+ else {
+ _trans += ((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
_match:
- _trans = _tsip_machine_parser_uri_indicies[_trans];
+ _trans = _tsip_machine_parser_uri_indicies[_trans];
_eof_trans:
- cs = _tsip_machine_parser_uri_trans_targs[_trans];
-
- if ( _tsip_machine_parser_uri_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 0:
-/* #line 46 "./ragel/tsip_parser_uri.rl" */
- {
- tag_start = p;
- }
- break;
- case 1:
-/* #line 51 "./ragel/tsip_parser_uri.rl" */
- { uri->scheme = tsk_strdup("sip"), uri->type = uri_sip; }
- break;
- case 2:
-/* #line 52 "./ragel/tsip_parser_uri.rl" */
- { uri->scheme = tsk_strdup("sips"), uri->type = uri_sips; }
- break;
- case 3:
-/* #line 53 "./ragel/tsip_parser_uri.rl" */
- { uri->scheme = tsk_strdup("tel"), uri->type = uri_tel; }
- break;
- case 4:
-/* #line 56 "./ragel/tsip_parser_uri.rl" */
- { uri->host_type = host_ipv4; }
- break;
- case 5:
-/* #line 57 "./ragel/tsip_parser_uri.rl" */
- { uri->host_type = host_ipv6; }
- break;
- case 6:
-/* #line 58 "./ragel/tsip_parser_uri.rl" */
- { uri->host_type = host_hostname; }
- break;
- case 7:
-/* #line 64 "./ragel/tsip_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->user_name);
- }
- break;
- case 8:
-/* #line 68 "./ragel/tsip_parser_uri.rl" */
- {
- TSK_PARSER_SET_STRING(uri->password);
- }
- break;
- case 9:
-/* #line 80 "./ragel/tsip_parser_uri.rl" */
- {
- TSK_PARSER_ADD_PARAM(uri->params);
- }
- break;
- case 10:
-/* #line 90 "./ragel/tsip_parser_uri.rl" */
- { {cs = 26; goto _again;} }
- break;
- case 13:
-/* #line 1 "./ragel/tsip_parser_uri.rl" */
- {te = p+1;}
- break;
- case 14:
-/* #line 103 "./ragel/tsip_parser_uri.rl" */
- {te = p+1;{
- TSK_SCANNER_SET_STRING(uri->host);
- if(uri->host_type == host_ipv6){
- tsk_strunquote_2(&uri->host, '[', ']');
- }
- }}
- break;
- case 15:
-/* #line 94 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{
- if(tsk_strcontains(te, (pe - te), "@")){
- {cs = 18; goto _again;}
- }
- }}
- break;
- case 16:
-/* #line 100 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{ }}
- break;
- case 17:
-/* #line 103 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{
- TSK_SCANNER_SET_STRING(uri->host);
- if(uri->host_type == host_ipv6){
- tsk_strunquote_2(&uri->host, '[', ']');
- }
- }}
- break;
- case 18:
-/* #line 111 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{
- ts++;
- TSK_SCANNER_SET_INTEGER(uri->port);
- }}
- break;
- case 19:
-/* #line 116 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{ }}
- break;
- case 20:
-/* #line 117 "./ragel/tsip_parser_uri.rl" */
- {te = p;p--;{ }}
- break;
- case 21:
-/* #line 100 "./ragel/tsip_parser_uri.rl" */
- {{p = ((te))-1;}{ }}
- break;
- case 22:
-/* #line 103 "./ragel/tsip_parser_uri.rl" */
- {{p = ((te))-1;}{
- TSK_SCANNER_SET_STRING(uri->host);
- if(uri->host_type == host_ipv6){
- tsk_strunquote_2(&uri->host, '[', ']');
- }
- }}
- break;
- case 23:
-/* #line 116 "./ragel/tsip_parser_uri.rl" */
- {{p = ((te))-1;}{ }}
- break;
-/* #line 641 "./src/parsers/tsip_parser_uri.c" */
- }
- }
+ cs = _tsip_machine_parser_uri_trans_targs[_trans];
+
+ if ( _tsip_machine_parser_uri_trans_actions[_trans] == 0 ) {
+ goto _again;
+ }
+
+ _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 0:
+ /* #line 46 "./ragel/tsip_parser_uri.rl" */
+ {
+ tag_start = p;
+ }
+ break;
+ case 1:
+ /* #line 51 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->scheme = tsk_strdup("sip"), uri->type = uri_sip;
+ }
+ break;
+ case 2:
+ /* #line 52 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->scheme = tsk_strdup("sips"), uri->type = uri_sips;
+ }
+ break;
+ case 3:
+ /* #line 53 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->scheme = tsk_strdup("tel"), uri->type = uri_tel;
+ }
+ break;
+ case 4:
+ /* #line 56 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->host_type = host_ipv4;
+ }
+ break;
+ case 5:
+ /* #line 57 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->host_type = host_ipv6;
+ }
+ break;
+ case 6:
+ /* #line 58 "./ragel/tsip_parser_uri.rl" */
+ {
+ uri->host_type = host_hostname;
+ }
+ break;
+ case 7:
+ /* #line 64 "./ragel/tsip_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->user_name);
+ }
+ break;
+ case 8:
+ /* #line 68 "./ragel/tsip_parser_uri.rl" */
+ {
+ TSK_PARSER_SET_STRING(uri->password);
+ }
+ break;
+ case 9:
+ /* #line 80 "./ragel/tsip_parser_uri.rl" */
+ {
+ TSK_PARSER_ADD_PARAM(uri->params);
+ }
+ break;
+ case 10:
+ /* #line 90 "./ragel/tsip_parser_uri.rl" */
+ { {
+ cs = 26;
+ goto _again;
+ }
+ }
+ break;
+ case 13:
+ /* #line 1 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p+1;
+ }
+ break;
+ case 14:
+ /* #line 103 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p+1;
+ {
+ TSK_SCANNER_SET_STRING(uri->host);
+ if(uri->host_type == host_ipv6) {
+ tsk_strunquote_2(&uri->host, '[', ']');
+ }
+ }
+ }
+ break;
+ case 15:
+ /* #line 94 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ {
+ if(tsk_strcontains(te, (pe - te), "@")) {
+ {
+ cs = 18;
+ goto _again;
+ }
+ }
+ }
+ }
+ break;
+ case 16:
+ /* #line 100 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 17:
+ /* #line 103 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ {
+ TSK_SCANNER_SET_STRING(uri->host);
+ if(uri->host_type == host_ipv6) {
+ tsk_strunquote_2(&uri->host, '[', ']');
+ }
+ }
+ }
+ break;
+ case 18:
+ /* #line 111 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ {
+ ts++;
+ TSK_SCANNER_SET_INTEGER(uri->port);
+ }
+ }
+ break;
+ case 19:
+ /* #line 116 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 20:
+ /* #line 117 "./ragel/tsip_parser_uri.rl" */
+ {
+ te = p;
+ p--;
+ { }
+ }
+ break;
+ case 21:
+ /* #line 100 "./ragel/tsip_parser_uri.rl" */
+ {{
+ p = ((te))-1;
+ }{ }
+ }
+ break;
+ case 22:
+ /* #line 103 "./ragel/tsip_parser_uri.rl" */
+ {{
+ p = ((te))-1;
+ }{
+ TSK_SCANNER_SET_STRING(uri->host);
+ if(uri->host_type == host_ipv6) {
+ tsk_strunquote_2(&uri->host, '[', ']');
+ }
+ }
+ }
+ break;
+ case 23:
+ /* #line 116 "./ragel/tsip_parser_uri.rl" */
+ {{
+ p = ((te))-1;
+ }{ }
+ }
+ break;
+ /* #line 641 "./src/parsers/tsip_parser_uri.c" */
+ }
+ }
_again:
- _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_to_state_actions[cs];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 ) {
- switch ( *_acts++ ) {
- case 11:
-/* #line 1 "./ragel/tsip_parser_uri.rl" */
- {ts = 0;}
- break;
-/* #line 654 "./src/parsers/tsip_parser_uri.c" */
- }
- }
-
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- if ( _tsip_machine_parser_uri_eof_trans[cs] > 0 ) {
- _trans = _tsip_machine_parser_uri_eof_trans[cs] - 1;
- goto _eof_trans;
- }
- }
-
- _out: {}
- }
-
-/* #line 173 "./ragel/tsip_parser_uri.rl" */
-
- if( cs <
-/* #line 677 "./src/parsers/tsip_parser_uri.c" */
-26
-/* #line 174 "./ragel/tsip_parser_uri.rl" */
- ){
- TSK_DEBUG_ERROR("Failed to parse SIP/SIPS/TEL URI.");
- TSK_OBJECT_SAFE_FREE(uri);
- }
-
- return uri;
+ _acts = _tsip_machine_parser_uri_actions + _tsip_machine_parser_uri_to_state_actions[cs];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 ) {
+ switch ( *_acts++ ) {
+ case 11:
+ /* #line 1 "./ragel/tsip_parser_uri.rl" */
+ {
+ ts = 0;
+ }
+ break;
+ /* #line 654 "./src/parsers/tsip_parser_uri.c" */
+ }
+ }
+
+ if ( cs == 0 ) {
+ goto _out;
+ }
+ if ( ++p != pe ) {
+ goto _resume;
+ }
+_test_eof: {
+ }
+ if ( p == eof ) {
+ if ( _tsip_machine_parser_uri_eof_trans[cs] > 0 ) {
+ _trans = _tsip_machine_parser_uri_eof_trans[cs] - 1;
+ goto _eof_trans;
+ }
+ }
+
+_out: {
+ }
+ }
+
+ /* #line 173 "./ragel/tsip_parser_uri.rl" */
+
+ if( cs <
+ /* #line 677 "./src/parsers/tsip_parser_uri.c" */
+ 26
+ /* #line 174 "./ragel/tsip_parser_uri.rl" */
+ ) {
+ TSK_DEBUG_ERROR("Failed to parse SIP/SIPS/TEL URI.");
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+
+ return uri;
}
diff --git a/tinySIP/src/sigcomp/tsip_sigcomp.c b/tinySIP/src/sigcomp/tsip_sigcomp.c
index 8935cb9..ec1a771 100755
--- a/tinySIP/src/sigcomp/tsip_sigcomp.c
+++ b/tinySIP/src/sigcomp/tsip_sigcomp.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -29,7 +29,7 @@
*/
#include "tinysip/sigcomp/tsip_sigcomp.h"
-#include "tcomp_manager.h"
+#include "tcomp_manager.h"
#include "tsk_safeobj.h"
#include "tsk_memory.h"
@@ -40,31 +40,29 @@
#include <string.h> /* used by tsk_string.h macros */
/** SigComp compartment */
-typedef struct tsip_sigcomp_compartment_s
-{
- TSK_DECLARE_OBJECT;
-
- char* id;
- uint64_t stream_id;
- tcomp_result_t *decomp_result;
-
- /* tinySigComp library is thread-safe but I prefer to add this
- * tcomp_manager_provideCompartmentId() is unsafe */
- TSK_DECLARE_SAFEOBJ;
+typedef struct tsip_sigcomp_compartment_s {
+ TSK_DECLARE_OBJECT;
+
+ char* id;
+ uint64_t stream_id;
+ tcomp_result_t *decomp_result;
+
+ /* tinySigComp library is thread-safe but I prefer to add this
+ * tcomp_manager_provideCompartmentId() is unsafe */
+ TSK_DECLARE_SAFEOBJ;
}
tsip_sigcomp_compartment_t;
const tsk_object_def_t *tsip_sigcomp_compartment_def_t;
typedef tsk_list_t tsip_sigcomp_compartments_L_t;
/** SigComp handler */
-typedef struct tsip_sigcomp_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsip_sigcomp_s {
+ TSK_DECLARE_OBJECT;
- tcomp_manager_handle_t *manager;
- tsip_sigcomp_compartments_L_t* compartments;
+ tcomp_manager_handle_t *manager;
+ tsip_sigcomp_compartments_L_t* compartments;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tsip_sigcomp_t;
const tsk_object_def_t *tsip_sigcomp_def_t;
@@ -72,11 +70,11 @@ const tsk_object_def_t *tsip_sigcomp_def_t;
/*== Predicate function to find a compartment by id */
static int pred_find_compartment_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data){
- tsip_sigcomp_compartment_t *compartment = item->data;
- return tsk_strcmp(compartment->id, (const char*)id);
- }
- return -1;
+ if(item && item->data) {
+ tsip_sigcomp_compartment_t *compartment = item->data;
+ return tsk_strcmp(compartment->id, (const char*)id);
+ }
+ return -1;
}
/** Creates new SigComp handler
@@ -87,26 +85,26 @@ static int pred_find_compartment_by_id(const tsk_list_item_t *item, const void *
*/
tsip_sigcomp_handle_t* tsip_sigcomp_handler_create(uint8_t cpb, uint32_t dms, uint32_t sms)
{
- tsip_sigcomp_t* sigcomp = tsk_object_new(tsip_sigcomp_def_t);
-
- /* create SigComp handler */
- if(!sigcomp){
- TSK_DEBUG_ERROR("Failed to create new SigComp handler");
- return tsk_null;
- }
-
- /* create SigComp manager */
- if(!(sigcomp->manager = tcomp_manager_create()) || !(sigcomp->compartments = tsk_list_create())){
- TSK_DEBUG_ERROR("Failed to create new SigComp manager");
- TSK_OBJECT_SAFE_FREE(sigcomp);
- return tsk_null;
- }
-
- tcomp_manager_setCycles_Per_Bit(sigcomp->manager, cpb);
- tcomp_manager_setDecompression_Memory_Size(sigcomp->manager, dms);
- tcomp_manager_setState_Memory_Size(sigcomp->manager, sms);
-
- return sigcomp;
+ tsip_sigcomp_t* sigcomp = tsk_object_new(tsip_sigcomp_def_t);
+
+ /* create SigComp handler */
+ if(!sigcomp) {
+ TSK_DEBUG_ERROR("Failed to create new SigComp handler");
+ return tsk_null;
+ }
+
+ /* create SigComp manager */
+ if(!(sigcomp->manager = tcomp_manager_create()) || !(sigcomp->compartments = tsk_list_create())) {
+ TSK_DEBUG_ERROR("Failed to create new SigComp manager");
+ TSK_OBJECT_SAFE_FREE(sigcomp);
+ return tsk_null;
+ }
+
+ tcomp_manager_setCycles_Per_Bit(sigcomp->manager, cpb);
+ tcomp_manager_setDecompression_Memory_Size(sigcomp->manager, dms);
+ tcomp_manager_setState_Memory_Size(sigcomp->manager, sms);
+
+ return sigcomp;
}
/** Creates new SigComp handler
* Adds/Removes dictionaries. These dictionaries will be used both for compression and decompression.
@@ -119,36 +117,36 @@ tsip_sigcomp_handle_t* tsip_sigcomp_handler_create(uint8_t cpb, uint32_t dms, ui
*/
int tsip_sigcomp_handler_set_dicts(tsip_sigcomp_handle_t* self, tsk_bool_t sip_n_sdp, tsk_bool_t pres)
{
- tsip_sigcomp_t* sigcomp = self;
-
- if(!sigcomp || !sigcomp->manager){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(sigcomp);
-
- /* SIP/SDP (RFC 3485) */
- if(sip_n_sdp){
- tcomp_manager_addSipSdpDictionary(sigcomp->manager);
- }
- else{
- // FIXME: To be implemented in tinySigComp
- /* tcomp_manager_removeSipSdpDictionary(sigcomp->manager); */
- }
-
- /* SIP/SDP (RFC 5112) */
- if(pres){
- tcomp_manager_addPresenceDictionary(sigcomp->manager);
- }
- else{
- // FIXME: To be implemented in tinySigComp
- /* tcomp_manager_removePresenceDictionary(sigcomp->manager); */
- }
-
- tsk_safeobj_unlock(sigcomp);
-
- return 0;
+ tsip_sigcomp_t* sigcomp = self;
+
+ if(!sigcomp || !sigcomp->manager) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(sigcomp);
+
+ /* SIP/SDP (RFC 3485) */
+ if(sip_n_sdp) {
+ tcomp_manager_addSipSdpDictionary(sigcomp->manager);
+ }
+ else {
+ // FIXME: To be implemented in tinySigComp
+ /* tcomp_manager_removeSipSdpDictionary(sigcomp->manager); */
+ }
+
+ /* SIP/SDP (RFC 5112) */
+ if(pres) {
+ tcomp_manager_addPresenceDictionary(sigcomp->manager);
+ }
+ else {
+ // FIXME: To be implemented in tinySigComp
+ /* tcomp_manager_removePresenceDictionary(sigcomp->manager); */
+ }
+
+ tsk_safeobj_unlock(sigcomp);
+
+ return 0;
}
/** Adds new SigComp compartement to the handler
@@ -158,42 +156,42 @@ int tsip_sigcomp_handler_set_dicts(tsip_sigcomp_handle_t* self, tsk_bool_t sip_n
*/
int tsip_sigcomp_handler_add_compartment(tsip_sigcomp_handle_t* self, const char* comp_id)
{
- tsip_sigcomp_compartment_t* compartment;
- tsip_sigcomp_t* sigcomp = self;
- int ret = -1;
-
- if(!sigcomp || !comp_id){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- tsk_safeobj_lock(sigcomp);
-
- /* check if we already have a compartment with the same id */
- if(tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id)){
- TSK_DEBUG_ERROR("Failed to add new SigComp compartment. %s already exist.", comp_id);
- ret = -2;
- goto bail;
- }
-
- if((compartment = tsk_object_new(tsip_sigcomp_compartment_def_t))){
- compartment->id = tsk_strdup(comp_id);
- tcomp_result_setCompartmentId(compartment->decomp_result, compartment->id, tsk_strlen(compartment->id));
-
- tsk_list_push_back_data(sigcomp->compartments, (void**)&compartment);
- ret = 0;
- goto bail;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new SigComp compartment");
- ret = -3;
- goto bail;
- }
+ tsip_sigcomp_compartment_t* compartment;
+ tsip_sigcomp_t* sigcomp = self;
+ int ret = -1;
+
+ if(!sigcomp || !comp_id) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ tsk_safeobj_lock(sigcomp);
+
+ /* check if we already have a compartment with the same id */
+ if(tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id)) {
+ TSK_DEBUG_ERROR("Failed to add new SigComp compartment. %s already exist.", comp_id);
+ ret = -2;
+ goto bail;
+ }
+
+ if((compartment = tsk_object_new(tsip_sigcomp_compartment_def_t))) {
+ compartment->id = tsk_strdup(comp_id);
+ tcomp_result_setCompartmentId(compartment->decomp_result, compartment->id, tsk_strlen(compartment->id));
+
+ tsk_list_push_back_data(sigcomp->compartments, (void**)&compartment);
+ ret = 0;
+ goto bail;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SigComp compartment");
+ ret = -3;
+ goto bail;
+ }
bail:
- tsk_safeobj_unlock(sigcomp);
+ tsk_safeobj_unlock(sigcomp);
- return ret;
+ return ret;
}
/** Removes a SigComp compartement from the handler
@@ -203,37 +201,37 @@ bail:
*/
int tsip_sigcomp_handler_remove_compartment(tsip_sigcomp_handle_t* self, const char* comp_id)
{
- tsip_sigcomp_t* sigcomp = self;
+ tsip_sigcomp_t* sigcomp = self;
- if(!sigcomp || !comp_id){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!sigcomp || !comp_id) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsk_safeobj_lock(sigcomp);
- tsk_list_remove_item_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id);
- tsk_safeobj_unlock(sigcomp);
+ tsk_safeobj_lock(sigcomp);
+ tsk_list_remove_item_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id);
+ tsk_safeobj_unlock(sigcomp);
- return 0;
+ return 0;
}
// FIXME
const char* tsip_sigcomp_handler_fixme_getcompid(const tsip_sigcomp_handle_t* self)
{
- const tsip_sigcomp_t* sigcomp = self;
- const char* comp_id = tsk_null;
-
- if(!sigcomp){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsk_safeobj_lock(sigcomp);
- if(!TSK_LIST_IS_EMPTY(sigcomp->compartments)){
- comp_id = ((tsip_sigcomp_compartment_t*)TSK_LIST_FIRST_DATA(sigcomp->compartments))->id;
- }
- tsk_safeobj_unlock(sigcomp);
- return comp_id;
+ const tsip_sigcomp_t* sigcomp = self;
+ const char* comp_id = tsk_null;
+
+ if(!sigcomp) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsk_safeobj_lock(sigcomp);
+ if(!TSK_LIST_IS_EMPTY(sigcomp->compartments)) {
+ comp_id = ((tsip_sigcomp_compartment_t*)TSK_LIST_FIRST_DATA(sigcomp->compartments))->id;
+ }
+ tsk_safeobj_unlock(sigcomp);
+ return comp_id;
}
/** Close all SigComp compartments
@@ -241,24 +239,24 @@ const char* tsip_sigcomp_handler_fixme_getcompid(const tsip_sigcomp_handle_t* se
*/
int tsip_sigcomp_close_all(tsip_sigcomp_handle_t* self)
{
- tsip_sigcomp_t* sigcomp = self;
- const tsk_list_item_t* item;
- const char* comp_id;
+ tsip_sigcomp_t* sigcomp = self;
+ const tsk_list_item_t* item;
+ const char* comp_id;
- if(!sigcomp){
- return -1;
- }
+ if(!sigcomp) {
+ return -1;
+ }
- tsk_safeobj_lock(sigcomp);
+ tsk_safeobj_lock(sigcomp);
- tsk_list_foreach(item, sigcomp->compartments){
- comp_id = ((tsip_sigcomp_compartment_t*)item->data)->id;
- tcomp_manager_closeCompartment(sigcomp->manager, comp_id, tsk_strlen(comp_id));
- }
+ tsk_list_foreach(item, sigcomp->compartments) {
+ comp_id = ((tsip_sigcomp_compartment_t*)item->data)->id;
+ tcomp_manager_closeCompartment(sigcomp->manager, comp_id, tsk_strlen(comp_id));
+ }
- tsk_safeobj_unlock(sigcomp);
+ tsk_safeobj_unlock(sigcomp);
- return 0;
+ return 0;
}
/** Compress a Sip message
@@ -275,33 +273,33 @@ int tsip_sigcomp_close_all(tsip_sigcomp_handle_t* self)
*/
tsk_size_t tsip_sigcomp_handler_compress(tsip_sigcomp_handle_t* self, const char* comp_id, tsk_bool_t is_stream, const void* in_data, tsk_size_t in_size, void* out_data, tsk_size_t out_maxsize)
{
- tsk_size_t out_size = 0;
- tsip_sigcomp_compartment_t* compartment;
- tsip_sigcomp_t* sigcomp = self;
-
- if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* find the compartment */
- if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))){
- TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
- return 0;
- }
-
- /* take ownership and lock() */
- compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
- tsk_safeobj_lock(compartment);
-
- /* compress the message */
- out_size = tcomp_manager_compress(sigcomp->manager, compartment->id, tsk_strlen(compartment->id), in_data, in_size, out_data, out_maxsize, is_stream);
-
- /* release ownership and unlock() */
- tsk_safeobj_unlock(compartment);
- tsk_object_unref(compartment);
-
- return out_size;
+ tsk_size_t out_size = 0;
+ tsip_sigcomp_compartment_t* compartment;
+ tsip_sigcomp_t* sigcomp = self;
+
+ if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* find the compartment */
+ if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
+ TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
+ return 0;
+ }
+
+ /* take ownership and lock() */
+ compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
+ tsk_safeobj_lock(compartment);
+
+ /* compress the message */
+ out_size = tcomp_manager_compress(sigcomp->manager, compartment->id, tsk_strlen(compartment->id), in_data, in_size, out_data, out_maxsize, is_stream);
+
+ /* release ownership and unlock() */
+ tsk_safeobj_unlock(compartment);
+ tsk_object_unref(compartment);
+
+ return out_size;
}
/** UnCompress a SigComp message
@@ -318,57 +316,57 @@ tsk_size_t tsip_sigcomp_handler_compress(tsip_sigcomp_handle_t* self, const char
*/
tsk_size_t tsip_sigcomp_handler_uncompress(tsip_sigcomp_handle_t* self, const char* comp_id, tsk_bool_t is_stream, const void* in_data, tsk_size_t in_size, void* out_data, tsk_size_t out_maxsize, tsk_bool_t* is_nack)
{
- tsk_size_t out_size = 0;
- tsip_sigcomp_compartment_t* compartment;
- tsip_sigcomp_t* sigcomp = self;
-
- if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize || !is_nack){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* find the compartment */
- if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))){
- TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
- return 0;
- }
-
- *is_nack = tsk_false;
-
- /* take ownership and lock() */
- compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
- tsk_safeobj_lock(compartment);
-
- /* uncompress the message */
- tcomp_result_setOutputBuffer(compartment->decomp_result, out_data, out_maxsize, is_stream, compartment->stream_id); // set the output buffer where to copy uncompressed message
- out_size = tcomp_manager_decompress(sigcomp->manager, in_data, in_size, compartment->decomp_result);
- if(out_size){
- // provide the compartment id --> save temp states
- tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
- }
- else{
- if((*is_nack = compartment->decomp_result->isNack)){
- tsk_size_t nack_info_size;
- if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))){
- out_size = (nack_info_size > out_maxsize) ? out_maxsize : nack_info_size;
- memcpy(out_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), out_size);
- TSK_DEBUG_INFO("We got a NACK to send()");
- }
- else{
- TSK_DEBUG_INFO("We got a NACK from the remote party");
- }
- }
- else{
- /* Should never happen */
- TSK_DEBUG_ERROR("SigComp decompression failed");
- }
- }
-
- /* release ownership and unlock() */
- tsk_safeobj_unlock(compartment);
- tsk_object_unref(compartment);
-
- return out_size;
+ tsk_size_t out_size = 0;
+ tsip_sigcomp_compartment_t* compartment;
+ tsip_sigcomp_t* sigcomp = self;
+
+ if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize || !is_nack) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* find the compartment */
+ if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
+ TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
+ return 0;
+ }
+
+ *is_nack = tsk_false;
+
+ /* take ownership and lock() */
+ compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
+ tsk_safeobj_lock(compartment);
+
+ /* uncompress the message */
+ tcomp_result_setOutputBuffer(compartment->decomp_result, out_data, out_maxsize, is_stream, compartment->stream_id); // set the output buffer where to copy uncompressed message
+ out_size = tcomp_manager_decompress(sigcomp->manager, in_data, in_size, compartment->decomp_result);
+ if(out_size) {
+ // provide the compartment id --> save temp states
+ tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
+ }
+ else {
+ if((*is_nack = compartment->decomp_result->isNack)) {
+ tsk_size_t nack_info_size;
+ if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))) {
+ out_size = (nack_info_size > out_maxsize) ? out_maxsize : nack_info_size;
+ memcpy(out_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), out_size);
+ TSK_DEBUG_INFO("We got a NACK to send()");
+ }
+ else {
+ TSK_DEBUG_INFO("We got a NACK from the remote party");
+ }
+ }
+ else {
+ /* Should never happen */
+ TSK_DEBUG_ERROR("SigComp decompression failed");
+ }
+ }
+
+ /* release ownership and unlock() */
+ tsk_safeobj_unlock(compartment);
+ tsk_object_unref(compartment);
+
+ return out_size;
}
/** Try to unCompress the next stream chunck. Must only be used with stream compartments.
@@ -384,55 +382,55 @@ tsk_size_t tsip_sigcomp_handler_uncompress(tsip_sigcomp_handle_t* self, const ch
*/
tsk_size_t tsip_sigcomp_handler_uncompress_next(tsip_sigcomp_handle_t* self, const char* comp_id, void** nack_data, tsk_bool_t* is_nack)
{
- tsk_size_t out_size = 0;
- tsip_sigcomp_compartment_t* compartment;
- tsip_sigcomp_t* sigcomp = self;
-
- if(!sigcomp || !is_nack || !nack_data){
- TSK_DEBUG_ERROR("Invalid parameter");
- return 0;
- }
-
- /* find the compartment */
- if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))){
- TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
- return 0;
- }
-
- /* take ownership and lock() */
- compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
- tsk_safeobj_lock(compartment);
-
- /* uncompress the next chunk
- * the returned size the the total size which includes previous chuncks uncompressed
- * using tsip_sigcomp_handler_uncompress()
- */
- out_size = tcomp_manager_getNextStreamMessage(sigcomp->manager, compartment->decomp_result);
-
- if(out_size){
- // provide the compartment id --> save temp states
- tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
- }
- else{
- if((*is_nack = compartment->decomp_result->isNack)){
- tsk_size_t nack_info_size;
- if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))){
- if((*nack_data = tsk_calloc(nack_info_size, sizeof(uint8_t)))){
- memcpy(*nack_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), nack_info_size);
- }
- TSK_DEBUG_INFO("We got a NACK to send()");
- }
- else{
- TSK_DEBUG_INFO("We got a NACK from the remote party");
- }
- }
- }
-
- /* release ownership and unlock() */
- tsk_safeobj_unlock(compartment);
- tsk_object_unref(compartment);
-
- return out_size;
+ tsk_size_t out_size = 0;
+ tsip_sigcomp_compartment_t* compartment;
+ tsip_sigcomp_t* sigcomp = self;
+
+ if(!sigcomp || !is_nack || !nack_data) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return 0;
+ }
+
+ /* find the compartment */
+ if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
+ TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
+ return 0;
+ }
+
+ /* take ownership and lock() */
+ compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
+ tsk_safeobj_lock(compartment);
+
+ /* uncompress the next chunk
+ * the returned size the the total size which includes previous chuncks uncompressed
+ * using tsip_sigcomp_handler_uncompress()
+ */
+ out_size = tcomp_manager_getNextStreamMessage(sigcomp->manager, compartment->decomp_result);
+
+ if(out_size) {
+ // provide the compartment id --> save temp states
+ tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
+ }
+ else {
+ if((*is_nack = compartment->decomp_result->isNack)) {
+ tsk_size_t nack_info_size;
+ if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))) {
+ if((*nack_data = tsk_calloc(nack_info_size, sizeof(uint8_t)))) {
+ memcpy(*nack_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), nack_info_size);
+ }
+ TSK_DEBUG_INFO("We got a NACK to send()");
+ }
+ else {
+ TSK_DEBUG_INFO("We got a NACK from the remote party");
+ }
+ }
+ }
+
+ /* release ownership and unlock() */
+ tsk_safeobj_unlock(compartment);
+ tsk_object_unref(compartment);
+
+ return out_size;
}
//===========================================================================
@@ -440,37 +438,36 @@ tsk_size_t tsip_sigcomp_handler_uncompress_next(tsip_sigcomp_handle_t* self, con
//
static tsk_object_t* tsip_sigcomp_ctor(tsk_object_t * self, va_list * app)
{
- tsip_sigcomp_t *sigcomp = self;
- if(sigcomp){
- /* Done by tsip_sigcomp_create()
- sigcomp->manager = tcomp_manager_create();
- sigcomp->compartments = tsk_list_create();
- */
-
- tsk_safeobj_init(sigcomp);
- }
- return self;
+ tsip_sigcomp_t *sigcomp = self;
+ if(sigcomp) {
+ /* Done by tsip_sigcomp_create()
+ sigcomp->manager = tcomp_manager_create();
+ sigcomp->compartments = tsk_list_create();
+ */
+
+ tsk_safeobj_init(sigcomp);
+ }
+ return self;
}
static tsk_object_t* tsip_sigcomp_dtor(tsk_object_t * self)
-{
- tsip_sigcomp_t *sigcomp = self;
- if(sigcomp){
- TSK_OBJECT_SAFE_FREE(sigcomp->manager);
- TSK_OBJECT_SAFE_FREE(sigcomp->compartments);
+{
+ tsip_sigcomp_t *sigcomp = self;
+ if(sigcomp) {
+ TSK_OBJECT_SAFE_FREE(sigcomp->manager);
+ TSK_OBJECT_SAFE_FREE(sigcomp->compartments);
- tsk_safeobj_deinit(sigcomp);
- }
+ tsk_safeobj_deinit(sigcomp);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsip_sigcomp_def_s =
-{
- sizeof(tsip_sigcomp_t),
- tsip_sigcomp_ctor,
- tsip_sigcomp_dtor,
- tsk_null,
+static const tsk_object_def_t tsip_sigcomp_def_s = {
+ sizeof(tsip_sigcomp_t),
+ tsip_sigcomp_ctor,
+ tsip_sigcomp_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsip_sigcomp_def_t = &tsip_sigcomp_def_s;
@@ -480,48 +477,47 @@ const tsk_object_def_t *tsip_sigcomp_def_t = &tsip_sigcomp_def_s;
//
static tsk_object_t* tsip_sigcomp_compartment_ctor(tsk_object_t * self, va_list * app)
{
- static uint64_t __unique_stream_id = 0;
-
- tsip_sigcomp_compartment_t *compartment = self;
- if(compartment){
- compartment->decomp_result = tcomp_result_create();
- compartment->stream_id = ++(__unique_stream_id);
- tsk_safeobj_init(compartment);
- }
- return self;
+ static uint64_t __unique_stream_id = 0;
+
+ tsip_sigcomp_compartment_t *compartment = self;
+ if(compartment) {
+ compartment->decomp_result = tcomp_result_create();
+ compartment->stream_id = ++(__unique_stream_id);
+ tsk_safeobj_init(compartment);
+ }
+ return self;
}
static tsk_object_t* tsip_sigcomp_compartment_dtor(tsk_object_t * self)
-{
- tsip_sigcomp_compartment_t *compartment = self;
- if(compartment){
- TSK_FREE(compartment->id);
- TSK_OBJECT_SAFE_FREE(compartment->decomp_result);
+{
+ tsip_sigcomp_compartment_t *compartment = self;
+ if(compartment) {
+ TSK_FREE(compartment->id);
+ TSK_OBJECT_SAFE_FREE(compartment->decomp_result);
- tsk_safeobj_deinit(compartment);
- }
+ tsk_safeobj_deinit(compartment);
+ }
- return self;
+ return self;
}
int tsip_sigcomp_compartment_cmp(const tsk_object_t * _c1, const tsk_object_t * _c2)
{
- const tsip_sigcomp_compartment_t *c1 = _c1;
- const tsip_sigcomp_compartment_t *c2 = _c2;
-
- if(c1 && c2){
- return tsk_strcmp(c1->id, c2->id);
- }
- else{
- return (c1 - c2);
- }
+ const tsip_sigcomp_compartment_t *c1 = _c1;
+ const tsip_sigcomp_compartment_t *c2 = _c2;
+
+ if(c1 && c2) {
+ return tsk_strcmp(c1->id, c2->id);
+ }
+ else {
+ return (c1 - c2);
+ }
}
-static const tsk_object_def_t tsip_sigcomp_compartment_def_s =
-{
- sizeof(tsip_sigcomp_compartment_t),
- tsip_sigcomp_compartment_ctor,
- tsip_sigcomp_compartment_dtor,
- tsip_sigcomp_compartment_cmp,
+static const tsk_object_def_t tsip_sigcomp_compartment_def_s = {
+ sizeof(tsip_sigcomp_compartment_t),
+ tsip_sigcomp_compartment_ctor,
+ tsip_sigcomp_compartment_dtor,
+ tsip_sigcomp_compartment_cmp,
};
const tsk_object_def_t *tsip_sigcomp_compartment_def_t = &tsip_sigcomp_compartment_def_s;
diff --git a/tinySIP/src/transactions/tsip_transac.c b/tinySIP/src/transactions/tsip_transac.c
index 1ecac59..6498f51 100755
--- a/tinySIP/src/transactions/tsip_transac.c
+++ b/tinySIP/src/transactions/tsip_transac.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,232 +43,226 @@
static tsk_object_t* tsip_transac_dst_ctor(tsk_object_t * _self, va_list * app)
{
- tsip_transac_dst_t *dst = _self;
- if(dst){
-
- }
- return _self;
+ tsip_transac_dst_t *dst = _self;
+ if(dst) {
+
+ }
+ return _self;
}
static tsk_object_t* tsip_transac_dst_dtor(tsk_object_t * _self)
-{
- tsip_transac_dst_t *dst = _self;
- if(dst){
- TSK_OBJECT_SAFE_FREE(dst->stack);
- switch(dst->type){
- case tsip_transac_dst_type_dialog:
- {
- TSK_OBJECT_SAFE_FREE(dst->dialog.dlg);
- break;
- }
- case tsip_transac_dst_type_net:
- {
- break;
- }
- }
- }
- return _self;
-}
-static const tsk_object_def_t tsip_transac_dst_def_s =
{
- sizeof(tsip_transac_dst_t),
- tsip_transac_dst_ctor,
- tsip_transac_dst_dtor,
- tsk_null,
+ tsip_transac_dst_t *dst = _self;
+ if(dst) {
+ TSK_OBJECT_SAFE_FREE(dst->stack);
+ switch(dst->type) {
+ case tsip_transac_dst_type_dialog: {
+ TSK_OBJECT_SAFE_FREE(dst->dialog.dlg);
+ break;
+ }
+ case tsip_transac_dst_type_net: {
+ break;
+ }
+ }
+ }
+ return _self;
+}
+static const tsk_object_def_t tsip_transac_dst_def_s = {
+ sizeof(tsip_transac_dst_t),
+ tsip_transac_dst_ctor,
+ tsip_transac_dst_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsip_transac_dst_def_t = &tsip_transac_dst_def_s;
static struct tsip_transac_dst_s* tsip_transac_dst_create(tsip_transac_dst_type_t type, struct tsip_stack_s* stack)
{
- struct tsip_transac_dst_s* dst = tsk_object_new(tsip_transac_dst_def_t);
- if(dst){
- dst->type = type;
- dst->stack = tsk_object_ref(stack);
- }
- return dst;
+ struct tsip_transac_dst_s* dst = tsk_object_new(tsip_transac_dst_def_t);
+ if(dst) {
+ dst->type = type;
+ dst->stack = tsk_object_ref(stack);
+ }
+ return dst;
}
struct tsip_transac_dst_s* tsip_transac_dst_dialog_create(tsip_dialog_t *dlg)
{
- struct tsip_transac_dst_s* dst;
- if((dst = tsip_transac_dst_create(tsip_transac_dst_type_dialog, TSIP_DIALOG_GET_STACK(dlg)))){
- dst->dialog.dlg = tsk_object_ref(dlg);
- }
- return dst;
+ struct tsip_transac_dst_s* dst;
+ if((dst = tsip_transac_dst_create(tsip_transac_dst_type_dialog, TSIP_DIALOG_GET_STACK(dlg)))) {
+ dst->dialog.dlg = tsk_object_ref(dlg);
+ }
+ return dst;
}
struct tsip_transac_dst_s* tsip_transac_dst_net_create(struct tsip_stack_s* stack)
{
- struct tsip_transac_dst_s* dst;
- if((dst = tsip_transac_dst_create(tsip_transac_dst_type_net, stack))){
- }
- return dst;
+ struct tsip_transac_dst_s* dst;
+ if((dst = tsip_transac_dst_create(tsip_transac_dst_type_net, stack))) {
+ }
+ return dst;
}
static int tsip_transac_dst_deliver(struct tsip_transac_dst_s* self, tsip_dialog_event_type_t event_type, const tsip_message_t *msg)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->type){
- case tsip_transac_dst_type_dialog:
- {
- return self->dialog.dlg->callback(
- self->dialog.dlg,
- event_type,
- msg
- );
- }
- case tsip_transac_dst_type_net:
- {
- if(!msg){
- TSK_DEBUG_ERROR("Message is null");
- return -1;
- }
-
- // all messages coming from WebSocket transport have to be updated (AoR, Via...) before network delivering
- // all other messages MUST not unless specified from the dialog layer
- TSIP_MESSAGE(msg)->update |= (TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type));
-
- return tsip_transport_layer_send(
- self->stack->layer_transport,
- msg->firstVia ? msg->firstVia->branch : tsk_null,
- TSIP_MESSAGE(msg)
- );
- }
- default:
- {
- TSK_DEBUG_ERROR("Unexpected code called");
- return -2;
- }
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->type) {
+ case tsip_transac_dst_type_dialog: {
+ return self->dialog.dlg->callback(
+ self->dialog.dlg,
+ event_type,
+ msg
+ );
+ }
+ case tsip_transac_dst_type_net: {
+ if(!msg) {
+ TSK_DEBUG_ERROR("Message is null");
+ return -1;
+ }
+
+ // all messages coming from WebSocket transport have to be updated (AoR, Via...) before network delivering
+ // all other messages MUST not unless specified from the dialog layer
+ TSIP_MESSAGE(msg)->update |= (TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type));
+
+ return tsip_transport_layer_send(
+ self->stack->layer_transport,
+ msg->firstVia ? msg->firstVia->branch : tsk_null,
+ TSIP_MESSAGE(msg)
+ );
+ }
+ default: {
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -2;
+ }
+ }
}
int tsip_transac_init(tsip_transac_t *self, tsip_transac_type_t type, int32_t cseq_value, const char* cseq_method, const char* callid, struct tsip_transac_dst_s* dst, tsk_fsm_state_id curr, tsk_fsm_state_id term)
{
- if(self && !self->initialized){
- self->type = type;
- self->cseq_value = cseq_value;
- tsk_strupdate(&self->cseq_method, cseq_method);
- tsk_strupdate(&self->callid, callid);
- self->dst = tsk_object_ref(dst);
-
- /* FSM */
- self->fsm = tsk_fsm_create(curr, term);
-
- self->initialized = tsk_true;
-
- return 0;
- }
- return -1;
+ if(self && !self->initialized) {
+ self->type = type;
+ self->cseq_value = cseq_value;
+ tsk_strupdate(&self->cseq_method, cseq_method);
+ tsk_strupdate(&self->callid, callid);
+ self->dst = tsk_object_ref(dst);
+
+ /* FSM */
+ self->fsm = tsk_fsm_create(curr, term);
+
+ self->initialized = tsk_true;
+
+ return 0;
+ }
+ return -1;
}
int tsip_transac_deinit(tsip_transac_t *self)
{
- if(self && self->initialized){
- /* FSM */
- TSK_OBJECT_SAFE_FREE(self->fsm);
-
- TSK_FREE(self->branch);
- TSK_FREE(self->cseq_method);
- TSK_FREE(self->callid);
- TSK_OBJECT_SAFE_FREE(self->dst);
-
- self->initialized = tsk_false;
-
- return 0;
- }
- return -1;
+ if(self && self->initialized) {
+ /* FSM */
+ TSK_OBJECT_SAFE_FREE(self->fsm);
+
+ TSK_FREE(self->branch);
+ TSK_FREE(self->cseq_method);
+ TSK_FREE(self->callid);
+ TSK_OBJECT_SAFE_FREE(self->dst);
+
+ self->initialized = tsk_false;
+
+ return 0;
+ }
+ return -1;
}
int tsip_transac_start(tsip_transac_t *self, const tsip_request_t* request)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- switch(self->type){
- case tsip_transac_type_nist:{
- return tsip_transac_nist_start(TSIP_TRANSAC_NIST(self), request);
- }
- case tsip_transac_type_ist:{
- return tsip_transac_ist_start(TSIP_TRANSAC_IST(self), request);
- }
- case tsip_transac_type_nict:{
- return tsip_transac_nict_start(TSIP_TRANSAC_NICT(self), request);
- }
- case tsip_transac_type_ict:{
- return tsip_transac_ict_start(TSIP_TRANSAC_ICT(self), request);
- }
- }
-
- TSK_DEBUG_ERROR("Unexpected code called");
- return -2;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ switch(self->type) {
+ case tsip_transac_type_nist: {
+ return tsip_transac_nist_start(TSIP_TRANSAC_NIST(self), request);
+ }
+ case tsip_transac_type_ist: {
+ return tsip_transac_ist_start(TSIP_TRANSAC_IST(self), request);
+ }
+ case tsip_transac_type_nict: {
+ return tsip_transac_nict_start(TSIP_TRANSAC_NICT(self), request);
+ }
+ case tsip_transac_type_ict: {
+ return tsip_transac_ict_start(TSIP_TRANSAC_ICT(self), request);
+ }
+ }
+
+ TSK_DEBUG_ERROR("Unexpected code called");
+ return -2;
}
// deliver the message to the destination (e.g. local dialog)
int tsip_transac_deliver(tsip_transac_t* self, tsip_dialog_event_type_t event_type, const tsip_message_t *msg)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return tsip_transac_dst_deliver(self->dst, event_type, msg);
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return tsip_transac_dst_deliver(self->dst, event_type, msg);
}
// send the message over the network
int tsip_transac_send(tsip_transac_t *self, const char *branch, tsip_message_t *msg)
{
- if(self && TSIP_TRANSAC_GET_STACK(self)->layer_transport && msg){
- const struct tsip_ssession_s* ss = TSIP_TRANSAC_GET_SESSION(self);
- if(ss){
- // set SigComp identifier as the message is directly sent to the transport layer
- tsk_strupdate(&msg->sigcomp_id, ss->sigcomp_id);
- }
- return tsip_transport_layer_send(TSIP_TRANSAC_GET_STACK(self)->layer_transport, branch, TSIP_MESSAGE(msg));
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self && TSIP_TRANSAC_GET_STACK(self)->layer_transport && msg) {
+ const struct tsip_ssession_s* ss = TSIP_TRANSAC_GET_SESSION(self);
+ if(ss) {
+ // set SigComp identifier as the message is directly sent to the transport layer
+ tsk_strupdate(&msg->sigcomp_id, ss->sigcomp_id);
+ }
+ return tsip_transport_layer_send(TSIP_TRANSAC_GET_STACK(self)->layer_transport, branch, TSIP_MESSAGE(msg));
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_transac_cmp(const tsip_transac_t *t1, const tsip_transac_t *t2)
{
- if(t1 && t2){
- if(tsk_strequals(t1->branch, t2->branch) && tsk_strequals(t1->cseq_method, t2->cseq_method)){
- return 0;
- }
- }
- return -1;
+ if(t1 && t2) {
+ if(tsk_strequals(t1->branch, t2->branch) && tsk_strequals(t1->cseq_method, t2->cseq_method)) {
+ return 0;
+ }
+ }
+ return -1;
}
int tsip_transac_remove(const tsip_transac_t* self)
{
- int ret;
- tsip_transac_t* safe_copy;
-
- safe_copy = (tsip_transac_t*)tsk_object_ref(TSK_OBJECT(self));
- ret = tsip_transac_layer_remove(TSIP_TRANSAC_GET_STACK(self)->layer_transac, safe_copy);
- tsk_object_unref(safe_copy);
-
- return ret;
+ int ret;
+ tsip_transac_t* safe_copy;
+
+ safe_copy = (tsip_transac_t*)tsk_object_ref(TSK_OBJECT(self));
+ ret = tsip_transac_layer_remove(TSIP_TRANSAC_GET_STACK(self)->layer_transac, safe_copy);
+ tsk_object_unref(safe_copy);
+
+ return ret;
}
int tsip_transac_fsm_act(tsip_transac_t* self, tsk_fsm_action_id action_id, const tsip_message_t* message)
{
- int ret;
- tsip_transac_t* safe_copy;
+ int ret;
+ tsip_transac_t* safe_copy;
- if(!self || !self->fsm){
- TSK_DEBUG_WARN("Invalid parameter.");
- return -1;
- }
+ if(!self || !self->fsm) {
+ TSK_DEBUG_WARN("Invalid parameter.");
+ return -1;
+ }
- safe_copy = tsk_object_ref(TSK_OBJECT(self));
- ret = tsk_fsm_act(self->fsm, action_id, safe_copy, message, self, message);
- tsk_object_unref(safe_copy);
+ safe_copy = tsk_object_ref(TSK_OBJECT(self));
+ ret = tsk_fsm_act(self->fsm, action_id, safe_copy, message, self, message);
+ tsk_object_unref(safe_copy);
- return ret;
+ return ret;
}
diff --git a/tinySIP/src/transactions/tsip_transac_ict.c b/tinySIP/src/transactions/tsip_transac_ict.c
index 8678851..c2b9b13 100755
--- a/tinySIP/src/transactions/tsip_transac_ict.c
+++ b/tinySIP/src/transactions/tsip_transac_ict.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -111,32 +111,30 @@ int tsip_transac_ict_Any_2_Terminated_X_cancel(va_list *app); /* doubango-specif
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_cancel = tsip_atype_cancel,
-
- _fsm_action_send = 0xFF,
- _fsm_action_timerA,
- _fsm_action_timerB,
- _fsm_action_timerD,
- _fsm_action_timerM,
- _fsm_action_1xx,
- _fsm_action_2xx,
- _fsm_action_300_to_699,
- _fsm_action_transporterror,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_cancel = tsip_atype_cancel,
+
+ _fsm_action_send = 0xFF,
+ _fsm_action_timerA,
+ _fsm_action_timerB,
+ _fsm_action_timerD,
+ _fsm_action_timerM,
+ _fsm_action_1xx,
+ _fsm_action_2xx,
+ _fsm_action_300_to_699,
+ _fsm_action_transporterror,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Calling,
- _fsm_state_Proceeding,
- _fsm_state_Completed,
- _fsm_state_Accepted,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Calling,
+ _fsm_state_Proceeding,
+ _fsm_state_Completed,
+ _fsm_state_Accepted,
+ _fsm_state_Terminated
}
_fsm_state_t;
@@ -145,88 +143,84 @@ _fsm_state_t;
* Callback function called by the transport layer to alert the transaction for incoming messages
* or errors (e.g. transport error).
*
- * @param [in,out] self A pointer to the IC transaction.
- * @param type The event type.
+ * @param [in,out] self A pointer to the IC transaction.
+ * @param type The event type.
* @param [in,out] msg The incoming message.
*
- * @return Zero if succeed and no-zero error code otherwise.
+ * @return Zero if succeed and no-zero error code otherwise.
**/
int tsip_transac_ict_event_callback(const tsip_transac_ict_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
-{
- /* draft-sparks-sip-invfix-03 - 7.2. UAC Impacts
- Any response received which does not match an existing client transaction state machine is simply dropped.
- */
- switch(type){
-
- case tsip_transac_incoming_msg:
- {
- if(msg)
- {
- if(TSIP_MESSAGE_IS_RESPONSE(msg)){
- if(TSIP_RESPONSE_IS_1XX(msg)){
- return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_1xx, msg);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_2xx, msg);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){
- return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_300_to_699, msg);
- }
- else{
- TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg));
- return 0;
- }
- }
- // any other response have to be delivered if dst_type is 'network'
- if(TSIP_TRANSAC(self)->dst->type == tsip_transac_dst_type_net){
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_transac_incoming_msg, msg);
- }
- }
- break;
- }
-
- case tsip_transac_canceled:
- case tsip_transac_terminated:
- case tsip_transac_timedout:
- break;
-
- case tsip_transac_error:
- {
- return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
- }
-
- case tsip_transac_transport_error:
- {
- return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
- }
-
- default: break;
- }
-
- return 0;
+{
+ /* draft-sparks-sip-invfix-03 - 7.2. UAC Impacts
+ Any response received which does not match an existing client transaction state machine is simply dropped.
+ */
+ switch(type) {
+
+ case tsip_transac_incoming_msg: {
+ if(msg) {
+ if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_1xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_2xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) {
+ return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_300_to_699, msg);
+ }
+ else {
+ TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg));
+ return 0;
+ }
+ }
+ // any other response have to be delivered if dst_type is 'network'
+ if(TSIP_TRANSAC(self)->dst->type == tsip_transac_dst_type_net) {
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_transac_incoming_msg, msg);
+ }
+ }
+ break;
+ }
+
+ case tsip_transac_canceled:
+ case tsip_transac_terminated:
+ case tsip_transac_timedout:
+ break;
+
+ case tsip_transac_error: {
+ return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
+ }
+
+ case tsip_transac_transport_error: {
+ return tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
+ }
+
+ default:
+ break;
+ }
+
+ return 0;
}
int tsip_transac_ict_timer_callback(const tsip_transac_ict_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self && TSIP_TRANSAC(self))
- {
- if(timer_id == self->timerA.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerA, tsk_null);
- }
- else if(timer_id == self->timerB.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerB, tsk_null);
- }
- else if(timer_id == self->timerD.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerD, tsk_null);
- }
- else if(timer_id == self->timerM.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerM, tsk_null);
- }
- }
-
- return ret;
+ int ret = -1;
+
+ if(self && TSIP_TRANSAC(self)) {
+ if(timer_id == self->timerA.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerA, tsk_null);
+ }
+ else if(timer_id == self->timerB.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerB, tsk_null);
+ }
+ else if(timer_id == self->timerD.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerD, tsk_null);
+ }
+ else if(timer_id == self->timerM.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerM, tsk_null);
+ }
+ }
+
+ return ret;
}
@@ -239,135 +233,135 @@ int tsip_transac_ict_timer_callback(const tsip_transac_ict_t* self, tsk_timer_id
**/
int tsip_transac_ict_init(tsip_transac_ict_t *self)
{
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Send) -> Calling
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_send, _fsm_state_Calling, tsip_transac_ict_Started_2_Calling_X_send, "tsip_transac_ict_Started_2_Calling_X_send"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_ict_Started_2_Started_X_any"),
-
- /*=======================
- * === Calling ===
- */
- // Calling -> (timerA) -> Calling
- TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_timerA, _fsm_state_Calling, tsip_transac_ict_Calling_2_Calling_X_timerA, "tsip_transac_ict_Calling_2_Calling_X_timerA"),
- // Calling -> (timerB) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_timerB, _fsm_state_Terminated, tsip_transac_ict_Calling_2_Terminated_X_timerB, "tsip_transac_ict_Calling_2_Terminated_X_timerB"),
- // Calling -> (300-699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Calling_2_Completed_X_300_to_699, "tsip_transac_ict_Calling_2_Completed_X_300_to_699"),
- // Calling -> (1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_ict_Calling_2_Proceeding_X_1xx, "tsip_transac_ict_Calling_2_Proceeding_X_1xx"),
- // Calling -> (2xx) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Calling_2_Accepted_X_2xx, "tsip_transac_ict_Calling_2_Accepted_X_2xx"),
-
- /*=======================
- * === Proceeding ===
- */
- // Proceeding -> (1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_ict_Proceeding_2_Proceeding_X_1xx, "tsip_transac_ict_Proceeding_2_Proceeding_X_1xx"),
- // Proceeding -> (300-699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Proceeding_2_Completed_X_300_to_699, "tsip_transac_ict_Proceeding_2_Completed_X_300_to_699"),
- // Proceeding -> (2xx) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Proceeding_2_Accepted_X_2xx, "tsip_transac_ict_Proceeding_2_Accepted_X_2xx"),
-
- /*=======================
- * === Completed ===
- */
- // Completed -> (300-699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Completed_2_Completed_X_300_to_699, "tsip_transac_ict_Completed_2_Completed_X_300_to_699"),
- // Completed -> (timerD) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerD, _fsm_state_Terminated, tsip_transac_ict_Completed_2_Terminated_X_timerD, "tsip_transac_ict_Completed_2_Terminated_X_timerD"),
-
- /*=======================
- * === Accepted ===
- */
- // Accepted -> (2xx) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Accepted_2_Accepted_X_2xx, "tsip_transac_ict_Accepted_2_Accepted_X_2xx"),
- // Accepted -> (timerM) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerM, _fsm_state_Terminated, tsip_transac_ict_Accepted_2_Terminated_X_timerM, "tsip_transac_ict_Accepted_2_Terminated_X_timerM"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_transportError, "tsip_transac_ict_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_Error, "tsip_transac_ict_Any_2_Terminated_X_Error"),
- // Any -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_cancel, "tsip_transac_ict_Any_2_Terminated_X_cancel"),
-
- TSK_FSM_ADD_NULL());
-
-
- /* Set callback function to call when new messages arrive or errors happen in
- the transport layer.
- */
- TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_ict_event_callback);
-
- /* Timers */
- self->timerA.id = TSK_INVALID_TIMER_ID;
- self->timerB.id = TSK_INVALID_TIMER_ID;
- self->timerD.id = TSK_INVALID_TIMER_ID;
- self->timerM.id = TSK_INVALID_TIMER_ID;
-
- self->timerA.timeout = TSIP_TIMER_GET(A);
- self->timerB.timeout = TSIP_TIMER_GET(B);
- self->timerM.timeout = TSIP_TIMER_GET(M);
-
- return 0;
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Send) -> Calling
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_send, _fsm_state_Calling, tsip_transac_ict_Started_2_Calling_X_send, "tsip_transac_ict_Started_2_Calling_X_send"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_ict_Started_2_Started_X_any"),
+
+ /*=======================
+ * === Calling ===
+ */
+ // Calling -> (timerA) -> Calling
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_timerA, _fsm_state_Calling, tsip_transac_ict_Calling_2_Calling_X_timerA, "tsip_transac_ict_Calling_2_Calling_X_timerA"),
+ // Calling -> (timerB) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_timerB, _fsm_state_Terminated, tsip_transac_ict_Calling_2_Terminated_X_timerB, "tsip_transac_ict_Calling_2_Terminated_X_timerB"),
+ // Calling -> (300-699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Calling_2_Completed_X_300_to_699, "tsip_transac_ict_Calling_2_Completed_X_300_to_699"),
+ // Calling -> (1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_ict_Calling_2_Proceeding_X_1xx, "tsip_transac_ict_Calling_2_Proceeding_X_1xx"),
+ // Calling -> (2xx) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Calling, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Calling_2_Accepted_X_2xx, "tsip_transac_ict_Calling_2_Accepted_X_2xx"),
+
+ /*=======================
+ * === Proceeding ===
+ */
+ // Proceeding -> (1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_ict_Proceeding_2_Proceeding_X_1xx, "tsip_transac_ict_Proceeding_2_Proceeding_X_1xx"),
+ // Proceeding -> (300-699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Proceeding_2_Completed_X_300_to_699, "tsip_transac_ict_Proceeding_2_Completed_X_300_to_699"),
+ // Proceeding -> (2xx) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Proceeding_2_Accepted_X_2xx, "tsip_transac_ict_Proceeding_2_Accepted_X_2xx"),
+
+ /*=======================
+ * === Completed ===
+ */
+ // Completed -> (300-699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_300_to_699, _fsm_state_Completed, tsip_transac_ict_Completed_2_Completed_X_300_to_699, "tsip_transac_ict_Completed_2_Completed_X_300_to_699"),
+ // Completed -> (timerD) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerD, _fsm_state_Terminated, tsip_transac_ict_Completed_2_Terminated_X_timerD, "tsip_transac_ict_Completed_2_Terminated_X_timerD"),
+
+ /*=======================
+ * === Accepted ===
+ */
+ // Accepted -> (2xx) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_2xx, _fsm_state_Accepted, tsip_transac_ict_Accepted_2_Accepted_X_2xx, "tsip_transac_ict_Accepted_2_Accepted_X_2xx"),
+ // Accepted -> (timerM) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerM, _fsm_state_Terminated, tsip_transac_ict_Accepted_2_Terminated_X_timerM, "tsip_transac_ict_Accepted_2_Terminated_X_timerM"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_transportError, "tsip_transac_ict_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_Error, "tsip_transac_ict_Any_2_Terminated_X_Error"),
+ // Any -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_ict_Any_2_Terminated_X_cancel, "tsip_transac_ict_Any_2_Terminated_X_cancel"),
+
+ TSK_FSM_ADD_NULL());
+
+
+ /* Set callback function to call when new messages arrive or errors happen in
+ the transport layer.
+ */
+ TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_ict_event_callback);
+
+ /* Timers */
+ self->timerA.id = TSK_INVALID_TIMER_ID;
+ self->timerB.id = TSK_INVALID_TIMER_ID;
+ self->timerD.id = TSK_INVALID_TIMER_ID;
+ self->timerM.id = TSK_INVALID_TIMER_ID;
+
+ self->timerA.timeout = TSIP_TIMER_GET(A);
+ self->timerB.timeout = TSIP_TIMER_GET(B);
+ self->timerM.timeout = TSIP_TIMER_GET(M);
+
+ return 0;
}
tsip_transac_ict_t* tsip_transac_ict_create(int32_t cseq_value, const char* callid, tsip_transac_dst_t* dst)
{
- tsip_transac_ict_t* transac = tsk_object_new(tsip_transac_ict_def_t);
- if(transac){
- // initialize base class
- tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_ict, cseq_value, "INVITE", callid, dst, _fsm_state_Started, _fsm_state_Terminated);
-
- // init FSM
- TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_ict_OnTerminated), (const void*)transac);
-
- // initialize ICT object
- tsip_transac_ict_init(transac);
- }
- return transac;
+ tsip_transac_ict_t* transac = tsk_object_new(tsip_transac_ict_def_t);
+ if(transac) {
+ // initialize base class
+ tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_ict, cseq_value, "INVITE", callid, dst, _fsm_state_Started, _fsm_state_Terminated);
+
+ // init FSM
+ TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_ict_OnTerminated), (const void*)transac);
+
+ // initialize ICT object
+ tsip_transac_ict_init(transac);
+ }
+ return transac;
}
/**
* Starts the client transaction.
*
- * @param [in,out] self The client transaction to start.
- * @param [in,out] request The SIP/IMS INVITE request to send.
+ * @param [in,out] self The client transaction to start.
+ * @param [in,out] request The SIP/IMS INVITE request to send.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_transac_ict_start(tsip_transac_ict_t *self, const tsip_request_t* request)
{
- int ret = -1;
- if(self && request && !TSIP_TRANSAC(self)->running){
- /* Add branch to the new client transaction
- * - Transac will use request branch if exit (e.g. when request received over websocket)
- */
- if((request->firstVia && !tsk_strnullORempty(request->firstVia->branch))){
- tsk_strupdate(&TSIP_TRANSAC(self)->branch, (request->firstVia ? request->firstVia->branch : "doubango"));
- }
- else if((TSIP_TRANSAC(self)->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))){
- tsk_istr_t branch;
- tsk_strrandom(&branch);
- tsk_strcat_2(&(TSIP_TRANSAC(self)->branch), "-%s", branch);
- }
-
- TSIP_TRANSAC(self)->running = 1;
- self->request = tsk_object_ref((void*)request);
-
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send, tsk_null);
- }
- return ret;
+ int ret = -1;
+ if(self && request && !TSIP_TRANSAC(self)->running) {
+ /* Add branch to the new client transaction
+ * - Transac will use request branch if exit (e.g. when request received over websocket)
+ */
+ if((request->firstVia && !tsk_strnullORempty(request->firstVia->branch))) {
+ tsk_strupdate(&TSIP_TRANSAC(self)->branch, (request->firstVia ? request->firstVia->branch : "doubango"));
+ }
+ else if((TSIP_TRANSAC(self)->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))) {
+ tsk_istr_t branch;
+ tsk_strrandom(&branch);
+ tsk_strcat_2(&(TSIP_TRANSAC(self)->branch), "-%s", branch);
+ }
+
+ TSIP_TRANSAC(self)->running = 1;
+ self->request = tsk_object_ref((void*)request);
+
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send, tsk_null);
+ }
+ return ret;
}
@@ -382,367 +376,367 @@ int tsip_transac_ict_start(tsip_transac_ict_t *self, const tsip_request_t* reque
*/
int tsip_transac_ict_Started_2_Calling_X_send(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- //== Send the request
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(self->request));
-
- // Now that the first request is sent using the best transport mean we know if it's reliable or not
- if(TNET_SOCKET_TYPE_IS_VALID(self->request->dst_net_type)){
- TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(self->request->dst_net_type);
- self->timerD.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(D);
- }
-
- /* RFC 3261 - 17.1.1.2 Formal Description
- If an unreliable transport is being used, the client transaction MUST
- start timer A with a value of T1.
- If a reliable transport is being used, the client transaction SHOULD
- NOT start timer A (Timer A controls request retransmissions). For
- any transport, the client transaction MUST start timer B with a value
- of 64*T1 seconds (Timer B controls transaction timeouts).
- */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_ICT_TIMER_SCHEDULE(A);
- }
- TRANSAC_ICT_TIMER_SCHEDULE(B);
-
- return 0;
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ //== Send the request
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(self->request));
+
+ // Now that the first request is sent using the best transport mean we know if it's reliable or not
+ if(TNET_SOCKET_TYPE_IS_VALID(self->request->dst_net_type)) {
+ TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(self->request->dst_net_type);
+ self->timerD.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(D);
+ }
+
+ /* RFC 3261 - 17.1.1.2 Formal Description
+ If an unreliable transport is being used, the client transaction MUST
+ start timer A with a value of T1.
+ If a reliable transport is being used, the client transaction SHOULD
+ NOT start timer A (Timer A controls request retransmissions). For
+ any transport, the client transaction MUST start timer B with a value
+ of 64*T1 seconds (Timer B controls transaction timeouts).
+ */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_ICT_TIMER_SCHEDULE(A);
+ }
+ TRANSAC_ICT_TIMER_SCHEDULE(B);
+
+ return 0;
}
/* Calling -> (timerA) -> Calling
*/
int tsip_transac_ict_Calling_2_Calling_X_timerA(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* RFC 3261 - 17.1.1.2 Formal Description
- When timer A fires, the client transaction MUST retransmit the
- request by passing it to the transport layer, and MUST reset the
- timer with a value of 2*T1. The formal definition of retransmit
+ /* RFC 3261 - 17.1.1.2 Formal Description
+ When timer A fires, the client transaction MUST retransmit the
+ request by passing it to the transport layer, and MUST reset the
+ timer with a value of 2*T1. The formal definition of retransmit
- within the context of the transaction layer is to take the message
- previously sent to the transport layer and pass it to the transport
- layer once more.
+ within the context of the transaction layer is to take the message
+ previously sent to the transport layer and pass it to the transport
+ layer once more.
- When timer A fires 2*T1 seconds later, the request MUST be
- retransmitted again (assuming the client transaction is still in this
- state). This process MUST continue so that the request is
- retransmitted with intervals that double after each transmission.
- These retransmissions SHOULD only be done while the client
- transaction is in the "calling" state.
- */
+ When timer A fires 2*T1 seconds later, the request MUST be
+ retransmitted again (assuming the client transaction is still in this
+ state). This process MUST continue so that the request is
+ retransmitted with intervals that double after each transmission.
+ These retransmissions SHOULD only be done while the client
+ transaction is in the "calling" state.
+ */
- //== Send the request
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
+ //== Send the request
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
- self->timerA.timeout *= 2; /* Will not raise indefinitely ==> see timer B */
- TRANSAC_ICT_TIMER_SCHEDULE(A);
+ self->timerA.timeout *= 2; /* Will not raise indefinitely ==> see timer B */
+ TRANSAC_ICT_TIMER_SCHEDULE(A);
- return 0;
+ return 0;
}
/* Calling -> (timerB) -> Terminated
*/
int tsip_transac_ict_Calling_2_Terminated_X_timerB(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* RFC 3261 - 17.1.1.2 Formal Description
- If the client transaction is still in the "Calling" state when timer
- B fires, the client transaction SHOULD inform the TU that a timeout
- has occurred. The client transaction MUST NOT generate an ACK. The
- value of 64*T1 is equal to the amount of time required to send seven
- requests in the case of an unreliable transport.
- */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_timedout, tsk_null);
-
- return 0;
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.1.1.2 Formal Description
+ If the client transaction is still in the "Calling" state when timer
+ B fires, the client transaction SHOULD inform the TU that a timeout
+ has occurred. The client transaction MUST NOT generate an ACK. The
+ value of 64*T1 is equal to the amount of time required to send seven
+ requests in the case of an unreliable transport.
+ */
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_timedout, tsk_null);
+
+ return 0;
}
/* Calling -> (300-699) -> Completed
*/
int tsip_transac_ict_Calling_2_Completed_X_300_to_699(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- When in either the "Calling" or "Proceeding" states, reception of
- a response with status code from 300-699 MUST cause the client
- transaction to transition to "Completed". The client transaction
- MUST pass the received response up to the TU, and the client
- transaction MUST generate an ACK request, even if the transport is
- reliable (guidelines for constructing the ACK from the response
- are given in Section 17.1.1.3) and then pass the ACK to the
- transport layer for transmission. The ACK MUST be sent to the
- same address, port, and transport to which the original request
- was sent.
- */
- /* Do not retransmit */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(A);
- }
- TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- The client transaction MUST start timer D when it enters the
- "Completed" state for any reason, with a value of at least 32
- seconds for unreliable transports, and a value of zero seconds for
- reliable transports. Timer D reflects the amount of time that the
- server transaction can remain in the "Completed" state when
- unreliable transports are used.
- */
- TRANSAC_ICT_TIMER_SCHEDULE(D); /* timerD already have the right value (0 if reliable and non-zero otherwise) */
-
- /* Send ACK */
- if((ret = tsip_transac_ict_send_ACK(self, response))){
- return ret;
- }
-
- /* Pass the response to the dialog. */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ When in either the "Calling" or "Proceeding" states, reception of
+ a response with status code from 300-699 MUST cause the client
+ transaction to transition to "Completed". The client transaction
+ MUST pass the received response up to the TU, and the client
+ transaction MUST generate an ACK request, even if the transport is
+ reliable (guidelines for constructing the ACK from the response
+ are given in Section 17.1.1.3) and then pass the ACK to the
+ transport layer for transmission. The ACK MUST be sent to the
+ same address, port, and transport to which the original request
+ was sent.
+ */
+ /* Do not retransmit */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(A);
+ }
+ TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ The client transaction MUST start timer D when it enters the
+ "Completed" state for any reason, with a value of at least 32
+ seconds for unreliable transports, and a value of zero seconds for
+ reliable transports. Timer D reflects the amount of time that the
+ server transaction can remain in the "Completed" state when
+ unreliable transports are used.
+ */
+ TRANSAC_ICT_TIMER_SCHEDULE(D); /* timerD already have the right value (0 if reliable and non-zero otherwise) */
+
+ /* Send ACK */
+ if((ret = tsip_transac_ict_send_ACK(self, response))) {
+ return ret;
+ }
+
+ /* Pass the response to the dialog. */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
}
/* Calling -> (1xx) -> Proceeding
*/
int tsip_transac_ict_Calling_2_Proceeding_X_1xx(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* RFC 3261 - 17.1.1.2 Formal Description
- If the client transaction receives a provisional response while in
- the "Calling" state, it transitions to the "Proceeding" state. In the
- "Proceeding" state, the client transaction SHOULD NOT retransmit the
- request any longer. Furthermore, the provisional response MUST be
- passed to the TU. Any further provisional responses MUST be passed
- up to the TU while in the "Proceeding" state.
- */
-
- /* Do not retransmit */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(A);
- }
- TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
-
- /* Pass the provisional response to the dialog. */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
-
- return 0;
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* RFC 3261 - 17.1.1.2 Formal Description
+ If the client transaction receives a provisional response while in
+ the "Calling" state, it transitions to the "Proceeding" state. In the
+ "Proceeding" state, the client transaction SHOULD NOT retransmit the
+ request any longer. Furthermore, the provisional response MUST be
+ passed to the TU. Any further provisional responses MUST be passed
+ up to the TU while in the "Proceeding" state.
+ */
+
+ /* Do not retransmit */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(A);
+ }
+ TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
+
+ /* Pass the provisional response to the dialog. */
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+
+ return 0;
}
/* Calling -> (2xx) -> Accepted
*/
int tsip_transac_ict_Calling_2_Accepted_X_2xx(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- When a 2xx response is received while in either the "Calling" or
- "Proceeding" states, the client transaction MUST transition to the
- "Accepted" state, and Timer M MUST be started with a value of
- 64*T1. The 2xx response MUST be passed up to the TU. The client
- transaction MUST NOT generate an ACK to the 2xx response - its
- handling is delegated to the TU.
- */
-
- /* Schedule timer M */
- TRANSAC_ICT_TIMER_SCHEDULE(M);
-
- /* Cancel timers A and B */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_ICT_TIMER_SCHEDULE(A);
- }
- TRANSAC_ICT_TIMER_SCHEDULE(B);
-
- /* pass the response to the TU (dialog) */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ When a 2xx response is received while in either the "Calling" or
+ "Proceeding" states, the client transaction MUST transition to the
+ "Accepted" state, and Timer M MUST be started with a value of
+ 64*T1. The 2xx response MUST be passed up to the TU. The client
+ transaction MUST NOT generate an ACK to the 2xx response - its
+ handling is delegated to the TU.
+ */
+
+ /* Schedule timer M */
+ TRANSAC_ICT_TIMER_SCHEDULE(M);
+
+ /* Cancel timers A and B */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_ICT_TIMER_SCHEDULE(A);
+ }
+ TRANSAC_ICT_TIMER_SCHEDULE(B);
+
+ /* pass the response to the TU (dialog) */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
}
/* Proceeding -> (1xx) -> Proceeding
*/
int tsip_transac_ict_Proceeding_2_Proceeding_X_1xx(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* pass the response to the TU (dialog) */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+ /* pass the response to the TU (dialog) */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
}
/* Proceeding -> (300-699) -> Completed
*/
int tsip_transac_ict_Proceeding_2_Completed_X_300_to_699(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- When in either the "Calling" or "Proceeding" states, reception of
- a response with status code from 300-699 MUST cause the client
- transaction to transition to "Completed". The client transaction
- MUST pass the received response up to the TU, and the client
- transaction MUST generate an ACK request, even if the transport is
- reliable (guidelines for constructing the ACK from the response
- are given in Section 17.1.1.3) and then pass the ACK to the
- transport layer for transmission. The ACK MUST be sent to the
- same address, port, and transport to which the original request
- was sent.
- */
- /* Do not retransmit */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(A);
- }
- TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- The client transaction MUST start timer D when it enters the
- "Completed" state for any reason, with a value of at least 32
- seconds for unreliable transports, and a value of zero seconds for
- reliable transports. Timer D reflects the amount of time that the
- server transaction can remain in the "Completed" state when
- unreliable transports are used.
- */
- TRANSAC_ICT_TIMER_SCHEDULE(D); /* timerD already have the right value (0 if reliable and non-zero otherwise) */
-
- /* Send ACK */
- if((ret = tsip_transac_ict_send_ACK(self, response))){
- return ret;
- }
-
- /* Pass the response to the dialog. */
- ret = tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
-
- return ret;
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ When in either the "Calling" or "Proceeding" states, reception of
+ a response with status code from 300-699 MUST cause the client
+ transaction to transition to "Completed". The client transaction
+ MUST pass the received response up to the TU, and the client
+ transaction MUST generate an ACK request, even if the transport is
+ reliable (guidelines for constructing the ACK from the response
+ are given in Section 17.1.1.3) and then pass the ACK to the
+ transport layer for transmission. The ACK MUST be sent to the
+ same address, port, and transport to which the original request
+ was sent.
+ */
+ /* Do not retransmit */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(A);
+ }
+ TRANSAC_TIMER_CANCEL(B); /* Now it's up to the UAS to update the FSM. */
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ The client transaction MUST start timer D when it enters the
+ "Completed" state for any reason, with a value of at least 32
+ seconds for unreliable transports, and a value of zero seconds for
+ reliable transports. Timer D reflects the amount of time that the
+ server transaction can remain in the "Completed" state when
+ unreliable transports are used.
+ */
+ TRANSAC_ICT_TIMER_SCHEDULE(D); /* timerD already have the right value (0 if reliable and non-zero otherwise) */
+
+ /* Send ACK */
+ if((ret = tsip_transac_ict_send_ACK(self, response))) {
+ return ret;
+ }
+
+ /* Pass the response to the dialog. */
+ ret = tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+
+ return ret;
}
/* Proceeding -> (2xx) -> Accepted
*/
int tsip_transac_ict_Proceeding_2_Accepted_X_2xx(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- When a 2xx response is received while in either the "Calling" or
- "Proceeding" states, the client transaction MUST transition to the
- "Accepted" state, and Timer M MUST be started with a value of
- 64*T1. The 2xx response MUST be passed up to the TU. The client
- transaction MUST NOT generate an ACK to the 2xx response - its
- handling is delegated to the TU.
- */
-
- /* Schedule timer M */
- TRANSAC_ICT_TIMER_SCHEDULE(M);
-
- /* Cancel timers A and B */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_ICT_TIMER_SCHEDULE(A);
- }
- TRANSAC_ICT_TIMER_SCHEDULE(B);
-
- /* pass the response to the TU (dialog) */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ When a 2xx response is received while in either the "Calling" or
+ "Proceeding" states, the client transaction MUST transition to the
+ "Accepted" state, and Timer M MUST be started with a value of
+ 64*T1. The 2xx response MUST be passed up to the TU. The client
+ transaction MUST NOT generate an ACK to the 2xx response - its
+ handling is delegated to the TU.
+ */
+
+ /* Schedule timer M */
+ TRANSAC_ICT_TIMER_SCHEDULE(M);
+
+ /* Cancel timers A and B */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_ICT_TIMER_SCHEDULE(A);
+ }
+ TRANSAC_ICT_TIMER_SCHEDULE(B);
+
+ /* pass the response to the TU (dialog) */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
}
/* Completed -> (300-699) -> Completed
*/
int tsip_transac_ict_Completed_2_Completed_X_300_to_699(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- Any retransmissions of a response with status code 300-699 that
- are received while in the "Completed" state MUST cause the ACK to
- be re-passed to the transport layer for retransmission, but the
- newly received response MUST NOT be passed up to the TU.
- */
-
- return tsip_transac_ict_send_ACK(self, response);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ Any retransmissions of a response with status code 300-699 that
+ are received while in the "Completed" state MUST cause the ACK to
+ be re-passed to the transport layer for retransmission, but the
+ newly received response MUST NOT be passed up to the TU.
+ */
+
+ return tsip_transac_ict_send_ACK(self, response);
}
/* Completed -> (timerD) -> Terminated
*/
int tsip_transac_ict_Completed_2_Terminated_X_timerD(va_list *app)
{
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- If timer D fires while the client transaction is in the
- "Completed" state, the client transaction MUST move to the
- "Terminated" state.
- */
-
- /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
- return 0;
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ If timer D fires while the client transaction is in the
+ "Completed" state, the client transaction MUST move to the
+ "Terminated" state.
+ */
+
+ /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
+ return 0;
}
/* Accepted -> (2xx) -> Accepted
*/
int tsip_transac_ict_Accepted_2_Accepted_X_2xx(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
-
- /* draft-sparks-sip-invfix-03 - 7.2. UAC Impacts
- A 2xx response received while in the "Accepted" state MUST be passed to the TU and
- the machine remains in the "Accepted" state. The client transaction
- MUST NOT generate an ACK to any 2xx response on its own. The TU
- responsible for the transaction will generate the ACK.
- */
-
- /* Pass the response to the TU. */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
-
- return 0;
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+
+ /* draft-sparks-sip-invfix-03 - 7.2. UAC Impacts
+ A 2xx response received while in the "Accepted" state MUST be passed to the TU and
+ the machine remains in the "Accepted" state. The client transaction
+ MUST NOT generate an ACK to any 2xx response on its own. The TU
+ responsible for the transaction will generate the ACK.
+ */
+
+ /* Pass the response to the TU. */
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, response);
+
+ return 0;
}
/* Accepted -> (timerM) -> Terminated
*/
int tsip_transac_ict_Accepted_2_Terminated_X_timerM(va_list *app)
{
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- If timer M fires while the client transaction is in the "Accepted"
- state, the client transaction MUST move to the "Terminated" state.
- */
- return 0;
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ If timer M fires while the client transaction is in the "Accepted"
+ state, the client transaction MUST move to the "Terminated" state.
+ */
+ return 0;
}
/* Any -> (Transport Error) -> Terminated
*/
int tsip_transac_ict_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
}
/* Any -> (Error) -> Terminated
*/
int tsip_transac_ict_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_ict_t *self = va_arg(*app, tsip_transac_ict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_ict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
}
/* Any -> (cancel) -> Terminated
*/
int tsip_transac_ict_Any_2_Terminated_X_cancel(va_list *app)
{
- /* doubango-specific */
- return 0;
+ /* doubango-specific */
+ return 0;
}
@@ -754,102 +748,101 @@ int tsip_transac_ict_Any_2_Terminated_X_cancel(va_list *app)
*/
int tsip_transac_ict_send_ACK(tsip_transac_ict_t *self, const tsip_response_t* response)
{
- int ret = -1;
- tsip_request_t *request = tsk_null;
- const tsk_list_item_t* item;
-
- if(!self || !self->request || !response){
- goto bail;
- }
-
- // check lastINVITE
- if( !self->request->firstVia ||
- !self->request->From ||
- !self->request->line.request.uri ||
- !self->request->Call_ID ||
- !self->request->CSeq)
- {
- ret = -2;
- goto bail;
- }
-
- // check response
- if(!response->To){
- ret = -3;
- goto bail;
- }
-
- /* RFC 3261 - 17.1.1.3 Construction of the ACK Request
-
- The ACK request constructed by the client transaction MUST contain
- values for the Call-ID, From, and Request-URI that are equal to the
- values of those header fields in the request passed to the transport
- by the client transaction (call this the "original request"). The To
- header field in the ACK MUST equal the To header field in the
- response being acknowledged, and therefore will usually differ from
- the To header field in the original request by the addition of the
- tag parameter. The ACK MUST contain a single Via header field, and
- this MUST be equal to the top Via header field of the original
- request. The CSeq header field in the ACK MUST contain the same
- value for the sequence number as was present in the original request,
- but the method parameter MUST be equal to "ACK".
-
- If the INVITE request whose response is being acknowledged had Route
- header fields, those header fields MUST appear in the ACK. This is
- to ensure that the ACK can be routed properly through any downstream
- stateless proxies.
-
- Although any request MAY contain a body, a body in an ACK is special
- since the request cannot be rejected if the body is not understood.
- Therefore, placement of bodies in ACK for non-2xx is NOT RECOMMENDED,
- but if done, the body types are restricted to any that appeared in
- the INVITE, assuming that the response to the INVITE was not 415. If
- it was, the body in the ACK MAY be any type listed in the Accept
- header field in the 415.
- */
- if((request = tsip_request_new("ACK", self->request->line.request.uri, self->request->From->uri, response->To->uri, self->request->Call_ID->value, self->request->CSeq->seq))){
- // Via
- request->firstVia = tsk_object_ref((void*)self->request->firstVia);
- // tags
- if(request->From){
- request->From->tag = tsk_strdup(self->request->From->tag);
- }
- if(request->To){
- request->To->tag = tsk_strdup(response->To->tag);
- }
- // Routes
- tsk_list_foreach(item, self->request->headers){
- const tsip_header_t* curr = item->data;
- if(curr->type == tsip_htype_Route){
- tsip_message_add_header(request, curr);
- }
- }
-
- // SigComp
- if(TSIP_TRANSAC_GET_SESSION(self) && TSIP_TRANSAC_GET_SESSION(self)->sigcomp_id){
- request->sigcomp_id = tsk_strdup(TSIP_TRANSAC_GET_SESSION(self)->sigcomp_id);
- }
-
- // send the request
- ret = tsip_transac_send(TSIP_TRANSAC(self), request->firstVia->branch, request);
- TSK_OBJECT_SAFE_FREE(request);
- }
+ int ret = -1;
+ tsip_request_t *request = tsk_null;
+ const tsk_list_item_t* item;
+
+ if(!self || !self->request || !response) {
+ goto bail;
+ }
+
+ // check lastINVITE
+ if( !self->request->firstVia ||
+ !self->request->From ||
+ !self->request->line.request.uri ||
+ !self->request->Call_ID ||
+ !self->request->CSeq) {
+ ret = -2;
+ goto bail;
+ }
+
+ // check response
+ if(!response->To) {
+ ret = -3;
+ goto bail;
+ }
+
+ /* RFC 3261 - 17.1.1.3 Construction of the ACK Request
+
+ The ACK request constructed by the client transaction MUST contain
+ values for the Call-ID, From, and Request-URI that are equal to the
+ values of those header fields in the request passed to the transport
+ by the client transaction (call this the "original request"). The To
+ header field in the ACK MUST equal the To header field in the
+ response being acknowledged, and therefore will usually differ from
+ the To header field in the original request by the addition of the
+ tag parameter. The ACK MUST contain a single Via header field, and
+ this MUST be equal to the top Via header field of the original
+ request. The CSeq header field in the ACK MUST contain the same
+ value for the sequence number as was present in the original request,
+ but the method parameter MUST be equal to "ACK".
+
+ If the INVITE request whose response is being acknowledged had Route
+ header fields, those header fields MUST appear in the ACK. This is
+ to ensure that the ACK can be routed properly through any downstream
+ stateless proxies.
+
+ Although any request MAY contain a body, a body in an ACK is special
+ since the request cannot be rejected if the body is not understood.
+ Therefore, placement of bodies in ACK for non-2xx is NOT RECOMMENDED,
+ but if done, the body types are restricted to any that appeared in
+ the INVITE, assuming that the response to the INVITE was not 415. If
+ it was, the body in the ACK MAY be any type listed in the Accept
+ header field in the 415.
+ */
+ if((request = tsip_request_new("ACK", self->request->line.request.uri, self->request->From->uri, response->To->uri, self->request->Call_ID->value, self->request->CSeq->seq))) {
+ // Via
+ request->firstVia = tsk_object_ref((void*)self->request->firstVia);
+ // tags
+ if(request->From) {
+ request->From->tag = tsk_strdup(self->request->From->tag);
+ }
+ if(request->To) {
+ request->To->tag = tsk_strdup(response->To->tag);
+ }
+ // Routes
+ tsk_list_foreach(item, self->request->headers) {
+ const tsip_header_t* curr = item->data;
+ if(curr->type == tsip_htype_Route) {
+ tsip_message_add_header(request, curr);
+ }
+ }
+
+ // SigComp
+ if(TSIP_TRANSAC_GET_SESSION(self) && TSIP_TRANSAC_GET_SESSION(self)->sigcomp_id) {
+ request->sigcomp_id = tsk_strdup(TSIP_TRANSAC_GET_SESSION(self)->sigcomp_id);
+ }
+
+ // send the request
+ ret = tsip_transac_send(TSIP_TRANSAC(self), request->firstVia->branch, request);
+ TSK_OBJECT_SAFE_FREE(request);
+ }
bail:
- return ret;
+ return ret;
}
/*== TERMINATED
*/
int tsip_transac_ict_OnTerminated(tsip_transac_ict_t *self)
{
- /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
- The client transaction MUST be destroyed the instant it enters the "Terminated" state.
- */
- TSK_DEBUG_INFO("=== ICT terminated ===");
-
- /* Remove (and destroy) the transaction from the layer. */
- return tsip_transac_remove(TSIP_TRANSAC(self));
+ /* draft-sparks-sip-invfix-03 - 8.4. Pages 126 through 128
+ The client transaction MUST be destroyed the instant it enters the "Terminated" state.
+ */
+ TSK_DEBUG_INFO("=== ICT terminated ===");
+
+ /* Remove (and destroy) the transaction from the layer. */
+ return tsip_transac_remove(TSIP_TRANSAC(self));
}
@@ -883,45 +876,44 @@ int tsip_transac_ict_OnTerminated(tsip_transac_ict_t *self)
//
static tsk_object_t* tsip_transac_ict_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transac_ict_t *transac = self;
- if(transac){
- }
- return self;
+ tsip_transac_ict_t *transac = self;
+ if(transac) {
+ }
+ return self;
}
static tsk_object_t* tsip_transac_ict_dtor(tsk_object_t * _self)
-{
- tsip_transac_ict_t *self = _self;
- if(self){
- /* Cancel timers */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(A);
- }
- TRANSAC_TIMER_CANCEL(B);
- TRANSAC_TIMER_CANCEL(D);
- TRANSAC_TIMER_CANCEL(M);
-
- TSIP_TRANSAC(self)->running = tsk_false;
- TSK_OBJECT_SAFE_FREE(self->request);
-
- /* DeInitialize base class */
- tsip_transac_deinit(TSIP_TRANSAC(self));
-
- TSK_DEBUG_INFO("*** ICT destroyed ***");
- }
- return _self;
+{
+ tsip_transac_ict_t *self = _self;
+ if(self) {
+ /* Cancel timers */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(A);
+ }
+ TRANSAC_TIMER_CANCEL(B);
+ TRANSAC_TIMER_CANCEL(D);
+ TRANSAC_TIMER_CANCEL(M);
+
+ TSIP_TRANSAC(self)->running = tsk_false;
+ TSK_OBJECT_SAFE_FREE(self->request);
+
+ /* DeInitialize base class */
+ tsip_transac_deinit(TSIP_TRANSAC(self));
+
+ TSK_DEBUG_INFO("*** ICT destroyed ***");
+ }
+ return _self;
}
static int tsip_transac_ict_cmp(const tsk_object_t *t1, const tsk_object_t *t2)
{
- return tsip_transac_cmp(t1, t2);
+ return tsip_transac_cmp(t1, t2);
}
-static const tsk_object_def_t tsip_transac_ict_def_s =
-{
- sizeof(tsip_transac_ict_t),
- tsip_transac_ict_ctor,
- tsip_transac_ict_dtor,
- tsip_transac_ict_cmp,
+static const tsk_object_def_t tsip_transac_ict_def_s = {
+ sizeof(tsip_transac_ict_t),
+ tsip_transac_ict_ctor,
+ tsip_transac_ict_dtor,
+ tsip_transac_ict_cmp,
};
const tsk_object_def_t *tsip_transac_ict_def_t = &tsip_transac_ict_def_s;
diff --git a/tinySIP/src/transactions/tsip_transac_ist.c b/tinySIP/src/transactions/tsip_transac_ist.c
index f4f9233..fc03388 100755
--- a/tinySIP/src/transactions/tsip_transac_ist.c
+++ b/tinySIP/src/transactions/tsip_transac_ist.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -120,241 +120,233 @@ static int tsip_transac_ist_Any_2_Terminated_X_cancel(va_list *app); /* doubango
/* ======================== conds ======================== */
static tsk_bool_t _fsm_cond_is_resp2INVITE(tsip_transac_ist_t* self, tsip_message_t* message)
{
- return TSIP_RESPONSE_IS_TO_INVITE(message);
+ return TSIP_RESPONSE_IS_TO_INVITE(message);
}
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_cancel = tsip_atype_cancel,
-
- _fsm_action_recv_INVITE = 0xFF,
- _fsm_action_recv_ACK,
- _fsm_action_send_1xx,
- _fsm_action_send_2xx,
- _fsm_action_send_300_to_699,
- _fsm_action_send_non1xx,
- _fsm_action_timerH,
- _fsm_action_timerI,
- _fsm_action_timerG,
- _fsm_action_timerL,
- _fsm_action_timerX,
- _fsm_action_transporterror,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_cancel = tsip_atype_cancel,
+
+ _fsm_action_recv_INVITE = 0xFF,
+ _fsm_action_recv_ACK,
+ _fsm_action_send_1xx,
+ _fsm_action_send_2xx,
+ _fsm_action_send_300_to_699,
+ _fsm_action_send_non1xx,
+ _fsm_action_timerH,
+ _fsm_action_timerI,
+ _fsm_action_timerG,
+ _fsm_action_timerL,
+ _fsm_action_timerX,
+ _fsm_action_transporterror,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Proceeding,
- _fsm_state_Completed,
- _fsm_state_Accepted,
- _fsm_state_Confirmed,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Proceeding,
+ _fsm_state_Completed,
+ _fsm_state_Accepted,
+ _fsm_state_Confirmed,
+ _fsm_state_Terminated
}
_fsm_state_t;
int tsip_transac_ist_event_callback(const tsip_transac_ist_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_transac_incoming_msg: /* From Transport Layer to Transaction Layer */
- {
- if(msg && TSIP_MESSAGE_IS_REQUEST(msg)){
- if(TSIP_REQUEST_IS_INVITE(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_INVITE, msg);
- }
- else if(TSIP_REQUEST_IS_ACK(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_ACK, msg);
- }
- }
- break;
- }
-
- case tsip_transac_outgoing_msg: /* From TU to Transport Layer */
- {
- if(msg && TSIP_MESSAGE_IS_RESPONSE(msg))
- {
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_1xx, msg);
- }
- else if(TSIP_RESPONSE_IS_2XX(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_2xx, msg);
- }
- else if(TSIP_RESPONSE_IS_3456(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_300_to_699, msg);
- }
- }
- break;
- }
-
- case tsip_transac_canceled:
- case tsip_transac_terminated:
- case tsip_transac_timedout:
- break;
-
- case tsip_transac_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
- break;
- }
-
- case tsip_transac_transport_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
- break;
- }
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_transac_incoming_msg: { /* From Transport Layer to Transaction Layer */
+ if(msg && TSIP_MESSAGE_IS_REQUEST(msg)) {
+ if(TSIP_REQUEST_IS_INVITE(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_INVITE, msg);
+ }
+ else if(TSIP_REQUEST_IS_ACK(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_ACK, msg);
+ }
+ }
+ break;
+ }
+
+ case tsip_transac_outgoing_msg: { /* From TU to Transport Layer */
+ if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_1xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_2XX(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_2xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_3456(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_300_to_699, msg);
+ }
+ }
+ break;
+ }
+
+ case tsip_transac_canceled:
+ case tsip_transac_terminated:
+ case tsip_transac_timedout:
+ break;
+
+ case tsip_transac_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
+ break;
+ }
+
+ case tsip_transac_transport_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
+ break;
+ }
+ }
+
+ return ret;
}
int tsip_transac_ist_timer_callback(const tsip_transac_ist_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self){
- if(timer_id == self->timerH.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerH, tsk_null);
- }
- else if(timer_id == self->timerI.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerI, tsk_null);
- }
- else if(timer_id == self->timerG.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerG, tsk_null);
- }
- else if(timer_id == self->timerL.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerL, tsk_null);
- }
- else if(timer_id == self->timerX.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerX, tsk_null);
- }
- }
-
- return ret;
+ int ret = -1;
+
+ if(self) {
+ if(timer_id == self->timerH.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerH, tsk_null);
+ }
+ else if(timer_id == self->timerI.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerI, tsk_null);
+ }
+ else if(timer_id == self->timerG.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerG, tsk_null);
+ }
+ else if(timer_id == self->timerL.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerL, tsk_null);
+ }
+ else if(timer_id == self->timerX.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerX, tsk_null);
+ }
+ }
+
+ return ret;
}
int tsip_transac_ist_init(tsip_transac_ist_t *self)
{
- /* Initialize the state machine.
- */
- tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (recv INVITE) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_recv_INVITE, _fsm_state_Proceeding, tsip_transac_ist_Started_2_Proceeding_X_INVITE, "tsip_transac_ist_Started_2_Proceeding_X_INVITE"),
- // Started -> (Any other) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_ist_Started_2_Started_X_any"),
-
- /*=======================
- * === Proceeding ===
- */
- // Proceeding -> (recv INVITE) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_recv_INVITE, _fsm_state_Proceeding, tsip_transac_ist_Proceeding_2_Proceeding_X_INVITE, "tsip_transac_ist_Proceeding_2_Proceeding_X_INVITE"),
- // Proceeding -> (send 1xx) -> Proceeding
- TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_1xx, _fsm_cond_is_resp2INVITE, _fsm_state_Proceeding, tsip_transac_ist_Proceeding_2_Proceeding_X_1xx, "tsip_transac_ist_Proceeding_2_Proceeding_X_1xx"),
- // Proceeding -> (send 300to699) -> Completed
- TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_300_to_699, _fsm_cond_is_resp2INVITE, _fsm_state_Completed, tsip_transac_ist_Proceeding_2_Completed_X_300_to_699, "tsip_transac_ist_Proceeding_2_Completed_X_300_to_699"),
- // Proceeding -> (send 2xx) -> Accepted
- TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Accepted, tsip_transac_ist_Proceeding_2_Accepted_X_2xx, "tsip_transac_ist_Proceeding_2_Accepted_X_2xx"),
-
- /*=======================
- * === Completed ===
- */
- // Completed -> (recv INVITE) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_recv_INVITE, _fsm_state_Completed, tsip_transac_ist_Completed_2_Completed_INVITE, "tsip_transac_ist_Completed_2_Completed_INVITE"),
- // Completed -> (timer G) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerG, _fsm_state_Completed, tsip_transac_ist_Completed_2_Completed_timerG, "tsip_transac_ist_Completed_2_Completed_timerG"),
- // Completed -> (timerH) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerH, _fsm_state_Terminated, tsip_transac_ist_Completed_2_Terminated_timerH, "tsip_transac_ist_Completed_2_Terminated_timerH"),
- // Completed -> (recv ACK) -> Confirmed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_recv_ACK, _fsm_state_Confirmed, tsip_transac_ist_Completed_2_Confirmed_ACK, "tsip_transac_ist_Completed_2_Confirmed_ACK"),
-
- /*=======================
- * === Accepted ===
- */
- // Accepted -> (recv INVITE) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_recv_INVITE, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_INVITE, "tsip_transac_ist_Accepted_2_Accepted_INVITE"),
- // Accepted -> (send 2xx) -> Accepted
- TSK_FSM_ADD(_fsm_state_Accepted, _fsm_action_send_2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_2xx, "tsip_transac_ist_Accepted_2_Accepted_2xx"),
- // Accepted -> (timer X) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerX, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_timerX, "tsip_transac_ist_Accepted_2_Accepted_timerX"),
- // Accepted -> (recv ACK) -> Accepted
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_recv_ACK, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_iACK, "tsip_transac_ist_Accepted_2_Accepted_iACK"),
- // Accepted -> (timerL) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerL, _fsm_state_Terminated, tsip_transac_ist_Accepted_2_Terminated_timerL, "tsip_transac_ist_Accepted_2_Terminated_timerL"),
-
- /*=======================
- * === Confirmed ===
- */
- // Confirmed -> (timerI) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Confirmed, _fsm_action_timerI, _fsm_state_Terminated, tsip_transac_ist_Confirmed_2_Terminated_timerI, "tsip_transac_ist_Confirmed_2_Terminated_timerI"),
-
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_transportError, "tsip_transac_ist_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_Error, "tsip_transac_ist_Any_2_Terminated_X_Error"),
- // Any -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_cancel, "tsip_transac_ist_Any_2_Terminated_X_cancel"),
-
-
- TSK_FSM_ADD_NULL());
-
- /* Set callback function to call when new messages arrive or errors happen at
- the transport layer.
- */
- TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_ist_event_callback);
-
- /* Set Timers
- * RFC 3261 17.2.1: For unreliable transports, timer G is set to fire in T1 seconds, and is not set to fire for
- reliable transports.
- */
- self->timerH.timeout = TSIP_TIMER_GET(H);
- self->timerG.timeout = TSIP_TIMER_GET(G);
- self->timerL.timeout = TSIP_TIMER_GET(L);
- self->timerX.timeout = TSIP_TIMER_GET(G);
-
- return 0;
+ /* Initialize the state machine.
+ */
+ tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (recv INVITE) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_recv_INVITE, _fsm_state_Proceeding, tsip_transac_ist_Started_2_Proceeding_X_INVITE, "tsip_transac_ist_Started_2_Proceeding_X_INVITE"),
+ // Started -> (Any other) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_ist_Started_2_Started_X_any"),
+
+ /*=======================
+ * === Proceeding ===
+ */
+ // Proceeding -> (recv INVITE) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_recv_INVITE, _fsm_state_Proceeding, tsip_transac_ist_Proceeding_2_Proceeding_X_INVITE, "tsip_transac_ist_Proceeding_2_Proceeding_X_INVITE"),
+ // Proceeding -> (send 1xx) -> Proceeding
+ TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_1xx, _fsm_cond_is_resp2INVITE, _fsm_state_Proceeding, tsip_transac_ist_Proceeding_2_Proceeding_X_1xx, "tsip_transac_ist_Proceeding_2_Proceeding_X_1xx"),
+ // Proceeding -> (send 300to699) -> Completed
+ TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_300_to_699, _fsm_cond_is_resp2INVITE, _fsm_state_Completed, tsip_transac_ist_Proceeding_2_Completed_X_300_to_699, "tsip_transac_ist_Proceeding_2_Completed_X_300_to_699"),
+ // Proceeding -> (send 2xx) -> Accepted
+ TSK_FSM_ADD(_fsm_state_Proceeding, _fsm_action_send_2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Accepted, tsip_transac_ist_Proceeding_2_Accepted_X_2xx, "tsip_transac_ist_Proceeding_2_Accepted_X_2xx"),
+
+ /*=======================
+ * === Completed ===
+ */
+ // Completed -> (recv INVITE) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_recv_INVITE, _fsm_state_Completed, tsip_transac_ist_Completed_2_Completed_INVITE, "tsip_transac_ist_Completed_2_Completed_INVITE"),
+ // Completed -> (timer G) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerG, _fsm_state_Completed, tsip_transac_ist_Completed_2_Completed_timerG, "tsip_transac_ist_Completed_2_Completed_timerG"),
+ // Completed -> (timerH) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerH, _fsm_state_Terminated, tsip_transac_ist_Completed_2_Terminated_timerH, "tsip_transac_ist_Completed_2_Terminated_timerH"),
+ // Completed -> (recv ACK) -> Confirmed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_recv_ACK, _fsm_state_Confirmed, tsip_transac_ist_Completed_2_Confirmed_ACK, "tsip_transac_ist_Completed_2_Confirmed_ACK"),
+
+ /*=======================
+ * === Accepted ===
+ */
+ // Accepted -> (recv INVITE) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_recv_INVITE, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_INVITE, "tsip_transac_ist_Accepted_2_Accepted_INVITE"),
+ // Accepted -> (send 2xx) -> Accepted
+ TSK_FSM_ADD(_fsm_state_Accepted, _fsm_action_send_2xx, _fsm_cond_is_resp2INVITE, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_2xx, "tsip_transac_ist_Accepted_2_Accepted_2xx"),
+ // Accepted -> (timer X) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerX, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_timerX, "tsip_transac_ist_Accepted_2_Accepted_timerX"),
+ // Accepted -> (recv ACK) -> Accepted
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_recv_ACK, _fsm_state_Accepted, tsip_transac_ist_Accepted_2_Accepted_iACK, "tsip_transac_ist_Accepted_2_Accepted_iACK"),
+ // Accepted -> (timerL) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Accepted, _fsm_action_timerL, _fsm_state_Terminated, tsip_transac_ist_Accepted_2_Terminated_timerL, "tsip_transac_ist_Accepted_2_Terminated_timerL"),
+
+ /*=======================
+ * === Confirmed ===
+ */
+ // Confirmed -> (timerI) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Confirmed, _fsm_action_timerI, _fsm_state_Terminated, tsip_transac_ist_Confirmed_2_Terminated_timerI, "tsip_transac_ist_Confirmed_2_Terminated_timerI"),
+
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_transportError, "tsip_transac_ist_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_Error, "tsip_transac_ist_Any_2_Terminated_X_Error"),
+ // Any -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_ist_Any_2_Terminated_X_cancel, "tsip_transac_ist_Any_2_Terminated_X_cancel"),
+
+
+ TSK_FSM_ADD_NULL());
+
+ /* Set callback function to call when new messages arrive or errors happen at
+ the transport layer.
+ */
+ TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_ist_event_callback);
+
+ /* Set Timers
+ * RFC 3261 17.2.1: For unreliable transports, timer G is set to fire in T1 seconds, and is not set to fire for
+ reliable transports.
+ */
+ self->timerH.timeout = TSIP_TIMER_GET(H);
+ self->timerG.timeout = TSIP_TIMER_GET(G);
+ self->timerL.timeout = TSIP_TIMER_GET(L);
+ self->timerX.timeout = TSIP_TIMER_GET(G);
+
+ return 0;
}
tsip_transac_ist_t* tsip_transac_ist_create(int32_t cseq_value, const char* callid, tsip_transac_dst_t* dst)
{
- tsip_transac_ist_t* transac = tsk_object_new(tsip_transac_ist_def_t);
- if(transac){
- // initialize base class
- tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_ist, cseq_value, "INVITE", callid, dst, _fsm_state_Started, _fsm_state_Terminated);
-
- // init FSM
- TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_ist_OnTerminated), (const void*)transac);
-
- // initialize IST object
- tsip_transac_ist_init(transac);
- }
- return transac;
+ tsip_transac_ist_t* transac = tsk_object_new(tsip_transac_ist_def_t);
+ if(transac) {
+ // initialize base class
+ tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_ist, cseq_value, "INVITE", callid, dst, _fsm_state_Started, _fsm_state_Terminated);
+
+ // init FSM
+ TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_ist_OnTerminated), (const void*)transac);
+
+ // initialize IST object
+ tsip_transac_ist_init(transac);
+ }
+ return transac;
}
int tsip_transac_ist_start(tsip_transac_ist_t *self, const tsip_request_t* request)
{
- int ret = -1;
-
- if(self && !TSIP_TRANSAC(self)->running && request){
- TSIP_TRANSAC(self)->running = 1;
- if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_INVITE, request))){
- //
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self && !TSIP_TRANSAC(self)->running && request) {
+ TSIP_TRANSAC(self)->running = 1;
+ if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_recv_INVITE, request))) {
+ //
+ }
+ }
+ return ret;
}
@@ -369,286 +361,286 @@ int tsip_transac_ist_start(tsip_transac_ist_t *self, const tsip_request_t* reque
*/
int tsip_transac_ist_Started_2_Proceeding_X_INVITE(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- int ret = -1;
-
- if(TNET_SOCKET_TYPE_IS_VALID(request->src_net_type)){
- TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(request->src_net_type);
- }
-
- /* Set Timers */
- self->timerI.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(I);
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- When a server transaction is constructed for a request, it enters the
- "Proceeding" state. The server transaction MUST generate a 100
- (Trying) response unless it knows that the TU will generate a
- provisional or final response within 200 ms, in which case it MAY
- generate a 100 (Trying) response.
-
- RFC 3262 - 3. UAS Behavior
- A UAS MUST NOT attempt to send a 100 (Trying) response reliably.
- */
- if(request){
- tsip_response_t* response;
- if((response = tsip_response_new(100, "Trying (sent from the Transaction Layer)", request))){
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, response);
- TRANSAC_IST_SET_LAST_RESPONSE(self, response); // Update last response
- TSK_OBJECT_SAFE_FREE(response);
- }
- }
- if(!ret){ /* Send "100 Trying" is OK ==> alert dialog for the incoming INVITE */
- ret = tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
- }
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ int ret = -1;
+
+ if(TNET_SOCKET_TYPE_IS_VALID(request->src_net_type)) {
+ TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(request->src_net_type);
+ }
+
+ /* Set Timers */
+ self->timerI.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(I);
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ When a server transaction is constructed for a request, it enters the
+ "Proceeding" state. The server transaction MUST generate a 100
+ (Trying) response unless it knows that the TU will generate a
+ provisional or final response within 200 ms, in which case it MAY
+ generate a 100 (Trying) response.
+
+ RFC 3262 - 3. UAS Behavior
+ A UAS MUST NOT attempt to send a 100 (Trying) response reliably.
+ */
+ if(request) {
+ tsip_response_t* response;
+ if((response = tsip_response_new(100, "Trying (sent from the Transaction Layer)", request))) {
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, response);
+ TRANSAC_IST_SET_LAST_RESPONSE(self, response); // Update last response
+ TSK_OBJECT_SAFE_FREE(response);
+ }
+ }
+ if(!ret) { /* Send "100 Trying" is OK ==> alert dialog for the incoming INVITE */
+ ret = tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
+ }
+ return ret;
}
/* Proceeding --> (recv INVITE) --> Proceeding
*/
int tsip_transac_ist_Proceeding_2_Proceeding_X_INVITE(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- int ret = -1;
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- If a request retransmission is received while in the "Proceeding" state, the most
- recent provisional response that was received from the TU MUST be
- passed to the transport layer for retransmission.
- */
- if(self->lastResponse){
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ int ret = -1;
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ If a request retransmission is received while in the "Proceeding" state, the most
+ recent provisional response that was received from the TU MUST be
+ passed to the transport layer for retransmission.
+ */
+ if(self->lastResponse) {
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+
+ return ret;
}
/* Proceeding --> (send 1xx) --> Proceeding
*/
int tsip_transac_ist_Proceeding_2_Proceeding_X_1xx(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
- /* Send to the transport layer */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+ /* Send to the transport layer */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
- /* Update last response */
- TRANSAC_IST_SET_LAST_RESPONSE(self, response);
+ /* Update last response */
+ TRANSAC_IST_SET_LAST_RESPONSE(self, response);
- return ret;
+ return ret;
}
/* Proceeding --> (send 300-699) --> Completed
*/
int tsip_transac_ist_Proceeding_2_Completed_X_300_to_699(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- /* RFC 3264 17.2.1 INVITE Server Transaction
- While in the "Proceeding" state, if the TU passes a response with
- status code from 300 to 699 to the server transaction, the response
- MUST be passed to the transport layer for transmission, and the state
- machine MUST enter the "Completed" state. For unreliable transports, timer G is set to fire in T1 seconds,
- and is not set to fire for reliable transports.
- */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_IST_TIMER_SCHEDULE(G);
- }
-
- /* Send to the transport layer */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
-
- /* Update last response */
- TRANSAC_IST_SET_LAST_RESPONSE(self, response);
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- When the "Completed" state is entered, timer H MUST be set to fire in
- 64*T1 seconds for all transports.
- */
- TRANSAC_IST_TIMER_SCHEDULE(H);
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ /* RFC 3264 17.2.1 INVITE Server Transaction
+ While in the "Proceeding" state, if the TU passes a response with
+ status code from 300 to 699 to the server transaction, the response
+ MUST be passed to the transport layer for transmission, and the state
+ machine MUST enter the "Completed" state. For unreliable transports, timer G is set to fire in T1 seconds,
+ and is not set to fire for reliable transports.
+ */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_IST_TIMER_SCHEDULE(G);
+ }
+
+ /* Send to the transport layer */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+
+ /* Update last response */
+ TRANSAC_IST_SET_LAST_RESPONSE(self, response);
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ When the "Completed" state is entered, timer H MUST be set to fire in
+ 64*T1 seconds for all transports.
+ */
+ TRANSAC_IST_TIMER_SCHEDULE(H);
+
+ return ret;
}
/* Proceeding --> (send 2xx) --> Accepted
*/
int tsip_transac_ist_Proceeding_2_Accepted_X_2xx(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret = -1;
-
- /* draft-sparks-sip-invfix-03 - 8.5. Pages 134 to 135
- If, while in the "Proceeding" state, the TU passes a 2xx response
- to the server transaction, the server transaction MUST pass this
- response to the transport layer for transmission. It is not
- retransmitted by the server transaction; retransmissions of 2xx
- responses are handled by the TU. The server transaction MUST then
- transition to the "Accepted" state.
- */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
-
- /* Update last response */
- TRANSAC_IST_SET_LAST_RESPONSE(self, response);
-
- /* RFC 3261 - 13.3.1.4 The INVITE is Accepted
- Since 2xx is retransmitted end-to-end, there may be hops between
- UAS and UAC that are UDP. To ensure reliable delivery across
- these hops, the response is retransmitted periodically even if the
- transport at the UAS is reliable.
- */
- TRANSAC_IST_TIMER_SCHEDULE(X);
- self->timerX.timeout <<= 1;
-
- /* draft-sparks-sip-invfix-03 - 8.7. Page 137
- When the INVITE server transaction enters the "Accepted" state,
- Timer L MUST be set to fire in 64*T1 for all transports. This
- value matches both Timer B in the next upstream client state
- machine (the amount of time the previous hop will wait for a
- response when no provisionals have been sent) and the amount of
- time this (or any downstream) UAS core might be retransmitting the
- 2xx while waiting for an ACK.
- */
- TRANSAC_IST_TIMER_SCHEDULE(L);
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret = -1;
+
+ /* draft-sparks-sip-invfix-03 - 8.5. Pages 134 to 135
+ If, while in the "Proceeding" state, the TU passes a 2xx response
+ to the server transaction, the server transaction MUST pass this
+ response to the transport layer for transmission. It is not
+ retransmitted by the server transaction; retransmissions of 2xx
+ responses are handled by the TU. The server transaction MUST then
+ transition to the "Accepted" state.
+ */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+
+ /* Update last response */
+ TRANSAC_IST_SET_LAST_RESPONSE(self, response);
+
+ /* RFC 3261 - 13.3.1.4 The INVITE is Accepted
+ Since 2xx is retransmitted end-to-end, there may be hops between
+ UAS and UAC that are UDP. To ensure reliable delivery across
+ these hops, the response is retransmitted periodically even if the
+ transport at the UAS is reliable.
+ */
+ TRANSAC_IST_TIMER_SCHEDULE(X);
+ self->timerX.timeout <<= 1;
+
+ /* draft-sparks-sip-invfix-03 - 8.7. Page 137
+ When the INVITE server transaction enters the "Accepted" state,
+ Timer L MUST be set to fire in 64*T1 for all transports. This
+ value matches both Timer B in the next upstream client state
+ machine (the amount of time the previous hop will wait for a
+ response when no provisionals have been sent) and the amount of
+ time this (or any downstream) UAS core might be retransmitting the
+ 2xx while waiting for an ACK.
+ */
+ TRANSAC_IST_TIMER_SCHEDULE(L);
+
+ return ret;
}
/* Completed --> (recv INVITE) --> Completed
*/
int tsip_transac_ist_Completed_2_Completed_INVITE(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- int ret = -1;
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- Furthermore, while in the "Completed" state, if a request retransmission is
- received, the server SHOULD pass the response to the transport for
- retransmission.
- */
- if(self->lastResponse){
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ int ret = -1;
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ Furthermore, while in the "Completed" state, if a request retransmission is
+ received, the server SHOULD pass the response to the transport for
+ retransmission.
+ */
+ if(self->lastResponse) {
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+
+ return ret;
}
/* Completed --> (timerG) --> Completed
*/
int tsip_transac_ist_Completed_2_Completed_timerG(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- int ret = -1;
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- If timer G fires, the response is passed to the transport layer once
- more for retransmission, and timer G is set to fire in MIN(2*T1, T2) seconds.
- From then on, when timer G fires, the response is passed to the transport again for
- transmission, and timer G is reset with a value that doubles, unless
- that value exceeds T2, in which case it is reset with the value of T2.
- */
- if(self->lastResponse){
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
- self->timerG.timeout = TSK_MIN(self->timerG.timeout*2, TSIP_TIMER_GET(T2));
- TRANSAC_IST_TIMER_SCHEDULE(G);
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ int ret = -1;
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ If timer G fires, the response is passed to the transport layer once
+ more for retransmission, and timer G is set to fire in MIN(2*T1, T2) seconds.
+ From then on, when timer G fires, the response is passed to the transport again for
+ transmission, and timer G is reset with a value that doubles, unless
+ that value exceeds T2, in which case it is reset with the value of T2.
+ */
+ if(self->lastResponse) {
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+ self->timerG.timeout = TSK_MIN(self->timerG.timeout*2, TSIP_TIMER_GET(T2));
+ TRANSAC_IST_TIMER_SCHEDULE(G);
+
+ return ret;
}
/* Completed --> (timerH) --> Terminated
*/
int tsip_transac_ist_Completed_2_Terminated_timerH(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- If timer H fires while in the "Completed" state, it implies that the
- ACK was never received. In this case, the server transaction MUST
- transition to the "Terminated" state, and MUST indicate to the TU
- that a transaction failure has occurred.
- */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ If timer H fires while in the "Completed" state, it implies that the
+ ACK was never received. In this case, the server transaction MUST
+ transition to the "Terminated" state, and MUST indicate to the TU
+ that a transaction failure has occurred.
+ */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
}
/* Completed --> (recv ACK) --> Confirmed
*/
int tsip_transac_ist_Completed_2_Confirmed_ACK(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- If an ACK is received while the server transaction is in the
- "Completed" state, the server transaction MUST transition to the
- "Confirmed" state. As Timer G is ignored in this state, any
- retransmissions of the response will cease
- */
- TRANSAC_TIMER_CANCEL(G);/* To avoid warnings from FSM manager. */
-
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- The purpose of the "Confirmed" state is to absorb any additional ACK
- messages that arrive, triggered from retransmissions of the final
- response. When this state is entered, timer I is set to fire in T4
- seconds for unreliable transports, and zero seconds for reliable
- transports.
- */
- TRANSAC_IST_TIMER_SCHEDULE(I); /* Has the right value (zero of reliable and ...) */
-
-
- return 0;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ If an ACK is received while the server transaction is in the
+ "Completed" state, the server transaction MUST transition to the
+ "Confirmed" state. As Timer G is ignored in this state, any
+ retransmissions of the response will cease
+ */
+ TRANSAC_TIMER_CANCEL(G);/* To avoid warnings from FSM manager. */
+
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ The purpose of the "Confirmed" state is to absorb any additional ACK
+ messages that arrive, triggered from retransmissions of the final
+ response. When this state is entered, timer I is set to fire in T4
+ seconds for unreliable transports, and zero seconds for reliable
+ transports.
+ */
+ TRANSAC_IST_TIMER_SCHEDULE(I); /* Has the right value (zero of reliable and ...) */
+
+
+ return 0;
}
/* Accepted --> (recv INVITE) --> Accepted
*/
int tsip_transac_ist_Accepted_2_Accepted_INVITE(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
-
- /* draft-sparks-sip-invfix-03 - 8.7. Page 137
- The purpose of the "Accepted" state is to absorb retransmissions
- of an accepted INVITE request. Any such retransmissions are
- absorbed entirely within the server transaction. They are not
- passed up to the TU since any downstream UAS cores that accepted
- the request have taken responsibility for reliability and will
- already retransmit their 2xx responses if neccessary.
- */
-
- /* Do not pass to the TU (see above)
- VERY IMPORTANT: INVITE dialog is responsible for reliability of the 2xx response.
- */
- if(self->lastResponse){
- return tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
- return 0;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+
+ /* draft-sparks-sip-invfix-03 - 8.7. Page 137
+ The purpose of the "Accepted" state is to absorb retransmissions
+ of an accepted INVITE request. Any such retransmissions are
+ absorbed entirely within the server transaction. They are not
+ passed up to the TU since any downstream UAS cores that accepted
+ the request have taken responsibility for reliability and will
+ already retransmit their 2xx responses if neccessary.
+ */
+
+ /* Do not pass to the TU (see above)
+ VERY IMPORTANT: INVITE dialog is responsible for reliability of the 2xx response.
+ */
+ if(self->lastResponse) {
+ return tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+ return 0;
}
/* Accepted --> (send 2xx) --> Accepted
*/
int tsip_transac_ist_Accepted_2_Accepted_2xx(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
- /* draft-sparks-sip-invfix-03 - 8.7. Page 137
- While in the "Accepted" state, if the TU passes a 2xx response,
- the server transaction MUST pass the response to the transport
- layer for transmission.
- */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
-
- /* Update last response */
- TRANSAC_IST_SET_LAST_RESPONSE(self, response);
-
- return ret;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+ /* draft-sparks-sip-invfix-03 - 8.7. Page 137
+ While in the "Accepted" state, if the TU passes a 2xx response,
+ the server transaction MUST pass the response to the transport
+ layer for transmission.
+ */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+
+ /* Update last response */
+ TRANSAC_IST_SET_LAST_RESPONSE(self, response);
+
+ return ret;
}
/* Accepted --> (timer X) --> Accepted
@@ -656,14 +648,14 @@ int tsip_transac_ist_Accepted_2_Accepted_2xx(va_list *app)
*/
static int tsip_transac_ist_Accepted_2_Accepted_timerX(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- if(self->lastResponse){
- int ret;
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- self->timerX.timeout <<= 1;
- TRANSAC_IST_TIMER_SCHEDULE(X);
- }
- return 0;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ if(self->lastResponse) {
+ int ret;
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ self->timerX.timeout <<= 1;
+ TRANSAC_IST_TIMER_SCHEDULE(X);
+ }
+ return 0;
}
/* Accepted --> (Recv ACK) --> Accepted
@@ -671,77 +663,77 @@ static int tsip_transac_ist_Accepted_2_Accepted_timerX(va_list *app)
*/
int tsip_transac_ist_Accepted_2_Accepted_iACK(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
- self->acked = tsk_true;
- TRANSAC_TIMER_CANCEL(X);
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+ self->acked = tsk_true;
+ TRANSAC_TIMER_CANCEL(X);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
}
/* Accepted --> (timerL) --> Terminated
*/
static int tsip_transac_ist_Accepted_2_Terminated_timerL(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* draft-sparks-sip-invfix-03 - 8.7. Page 137
- If Timer L fires while the INVITE server transaction is in the "Accepted" state, the transaction
- MUST transition to the "Terminated" state. Once the transaction is in the "Terminated" state, it MUST be
- destroyed immediately.
- */
- if(!self->acked){
- TSK_DEBUG_ERROR("ACK not received");
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
- }
- return 0;
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* draft-sparks-sip-invfix-03 - 8.7. Page 137
+ If Timer L fires while the INVITE server transaction is in the "Accepted" state, the transaction
+ MUST transition to the "Terminated" state. Once the transaction is in the "Terminated" state, it MUST be
+ destroyed immediately.
+ */
+ if(!self->acked) {
+ TSK_DEBUG_ERROR("ACK not received");
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ }
+ return 0;
}
/* Confirmed --> (timerI) --> Terminated
*/
static int tsip_transac_ist_Confirmed_2_Terminated_timerI(va_list *app)
{
- /* RFC 3261 - 17.2.1 INVITE Server Transaction
- Once timer I fires, the server MUST transition to the
- "Terminated" state.
-
- Once the transaction is in the "Terminated" state, it MUST be
- destroyed immediately. As with client transactions, this is needed
- to ensure reliability of the 2xx responses to INVITE.
- */
- return 0;
+ /* RFC 3261 - 17.2.1 INVITE Server Transaction
+ Once timer I fires, the server MUST transition to the
+ "Terminated" state.
+
+ Once the transaction is in the "Terminated" state, it MUST be
+ destroyed immediately. As with client transactions, this is needed
+ to ensure reliability of the 2xx responses to INVITE.
+ */
+ return 0;
}
/* Any -> (Transport Error) -> Terminated
*/
static int tsip_transac_ist_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
}
/* Any -> (Error) -> Terminated
*/
static int tsip_transac_ist_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_ist_t *self = va_arg(*app, tsip_transac_ist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
}
/* Any -> (cancel) -> Terminated
*/
static int tsip_transac_ist_Any_2_Terminated_X_cancel(va_list *app)
{
- /* doubango-specific */
- return 0;
+ /* doubango-specific */
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -754,10 +746,10 @@ static int tsip_transac_ist_Any_2_Terminated_X_cancel(va_list *app)
*/
static int tsip_transac_ist_OnTerminated(tsip_transac_ist_t *self)
{
- TSK_DEBUG_INFO("=== IST terminated ===");
-
- /* Remove (and destroy) the transaction from the layer. */
- return tsip_transac_remove(TSIP_TRANSAC(self));
+ TSK_DEBUG_INFO("=== IST terminated ===");
+
+ /* Remove (and destroy) the transaction from the layer. */
+ return tsip_transac_remove(TSIP_TRANSAC(self));
}
@@ -777,47 +769,45 @@ static int tsip_transac_ist_OnTerminated(tsip_transac_ist_t *self)
//
static tsk_object_t* tsip_transac_ist_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transac_ist_t *transac = self;
- if(transac){
- }
- return self;
+ tsip_transac_ist_t *transac = self;
+ if(transac) {
+ }
+ return self;
}
static tsk_object_t* tsip_transac_ist_dtor(tsk_object_t * _self)
-{
- tsip_transac_ist_t *self = _self;
- if(self)
- {
- /* Cancel timers */
- TRANSAC_TIMER_CANCEL(H);
- TRANSAC_TIMER_CANCEL(I);
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(G);
- }
- TRANSAC_TIMER_CANCEL(L);
- TRANSAC_TIMER_CANCEL(X);
-
- TSIP_TRANSAC(self)->running = tsk_false;
- TSK_OBJECT_SAFE_FREE(self->lastResponse);
-
- /* DeInitialize base class */
- tsip_transac_deinit(TSIP_TRANSAC(self));
-
- TSK_DEBUG_INFO("*** IST destroyed ***");
- }
- return _self;
+{
+ tsip_transac_ist_t *self = _self;
+ if(self) {
+ /* Cancel timers */
+ TRANSAC_TIMER_CANCEL(H);
+ TRANSAC_TIMER_CANCEL(I);
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(G);
+ }
+ TRANSAC_TIMER_CANCEL(L);
+ TRANSAC_TIMER_CANCEL(X);
+
+ TSIP_TRANSAC(self)->running = tsk_false;
+ TSK_OBJECT_SAFE_FREE(self->lastResponse);
+
+ /* DeInitialize base class */
+ tsip_transac_deinit(TSIP_TRANSAC(self));
+
+ TSK_DEBUG_INFO("*** IST destroyed ***");
+ }
+ return _self;
}
static int tsip_transac_ist_cmp(const tsk_object_t *t1, const tsk_object_t *t2)
{
- return tsip_transac_cmp(t1, t2);
+ return tsip_transac_cmp(t1, t2);
}
-static const tsk_object_def_t tsip_transac_ist_def_s =
-{
- sizeof(tsip_transac_ist_t),
- tsip_transac_ist_ctor,
- tsip_transac_ist_dtor,
- tsip_transac_ist_cmp,
+static const tsk_object_def_t tsip_transac_ist_def_s = {
+ sizeof(tsip_transac_ist_t),
+ tsip_transac_ist_ctor,
+ tsip_transac_ist_dtor,
+ tsip_transac_ist_cmp,
};
const tsk_object_def_t *tsip_transac_ist_def_t = &tsip_transac_ist_def_s;
diff --git a/tinySIP/src/transactions/tsip_transac_layer.c b/tinySIP/src/transactions/tsip_transac_layer.c
index b3cf167..767dfb6 100755
--- a/tinySIP/src/transactions/tsip_transac_layer.c
+++ b/tinySIP/src/transactions/tsip_transac_layer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,220 +39,215 @@
tsip_transac_layer_t* tsip_transac_layer_create(tsip_stack_t* stack)
{
- return tsk_object_new(tsip_transac_layer_def_t, stack);
+ return tsk_object_new(tsip_transac_layer_def_t, stack);
}
tsip_transac_t* tsip_transac_layer_new(const tsip_transac_layer_t *self, tsk_bool_t isCT, const tsip_message_t* msg, tsip_transac_dst_t* dst)
{
- tsip_transac_t *ret = tsk_null;
- tsip_transac_t *transac = tsk_null;
-
- tsk_safeobj_lock(self);
-
- if(self && msg)
- {
- if(TSIP_MESSAGE_IS_REQUEST(msg))
- {
- if(isCT) /* Client transaction */
- {
- if(TSIP_REQUEST_IS_INVITE(msg)){
- // INVITE Client transaction (ICT)
- transac = (tsip_transac_t *)tsip_transac_ict_create(msg->CSeq->seq, msg->Call_ID->value, dst);
- }
- else{
- // NON-INVITE Client transaction (NICT)
- transac = (tsip_transac_t *)tsip_transac_nict_create(msg->CSeq->seq, msg->CSeq->method, msg->Call_ID->value, dst);
- }
- }
- else /* Server transaction */
- {
- if(TSIP_REQUEST_IS_INVITE(msg)){
- // INVITE Server transaction (IST)
- transac = (tsip_transac_t *)tsip_transac_ist_create(msg->CSeq->seq, msg->Call_ID->value, dst);
- }
- else{
- // NON-INVITE Server transaction (NIST)
- transac = (tsip_transac_t *)tsip_transac_nist_create(msg->CSeq->seq, msg->CSeq->method, msg->Call_ID->value, dst);
- }
-
- if(transac){ /* Copy branch from the message */
- transac->branch = tsk_strdup(msg->firstVia->branch);
- }
- }
-
- /* Add new transaction */
- if(transac){
- ret = tsk_object_ref(transac);
- tsk_list_push_back_data(self->transactions, (void**)&transac);
- }
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ tsip_transac_t *ret = tsk_null;
+ tsip_transac_t *transac = tsk_null;
+
+ tsk_safeobj_lock(self);
+
+ if(self && msg) {
+ if(TSIP_MESSAGE_IS_REQUEST(msg)) {
+ if(isCT) { /* Client transaction */
+ if(TSIP_REQUEST_IS_INVITE(msg)) {
+ // INVITE Client transaction (ICT)
+ transac = (tsip_transac_t *)tsip_transac_ict_create(msg->CSeq->seq, msg->Call_ID->value, dst);
+ }
+ else {
+ // NON-INVITE Client transaction (NICT)
+ transac = (tsip_transac_t *)tsip_transac_nict_create(msg->CSeq->seq, msg->CSeq->method, msg->Call_ID->value, dst);
+ }
+ }
+ else { /* Server transaction */
+ if(TSIP_REQUEST_IS_INVITE(msg)) {
+ // INVITE Server transaction (IST)
+ transac = (tsip_transac_t *)tsip_transac_ist_create(msg->CSeq->seq, msg->Call_ID->value, dst);
+ }
+ else {
+ // NON-INVITE Server transaction (NIST)
+ transac = (tsip_transac_t *)tsip_transac_nist_create(msg->CSeq->seq, msg->CSeq->method, msg->Call_ID->value, dst);
+ }
+
+ if(transac) { /* Copy branch from the message */
+ transac->branch = tsk_strdup(msg->firstVia->branch);
+ }
+ }
+
+ /* Add new transaction */
+ if(transac) {
+ ret = tsk_object_ref(transac);
+ tsk_list_push_back_data(self->transactions, (void**)&transac);
+ }
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
int tsip_transac_layer_remove(tsip_transac_layer_t *self, const tsip_transac_t *transac)
{
- if(transac && self){
- tsk_safeobj_lock(self);
- tsk_list_remove_item_by_data(self->transactions, transac);
- tsk_safeobj_unlock(self);
+ if(transac && self) {
+ tsk_safeobj_lock(self);
+ tsk_list_remove_item_by_data(self->transactions, transac);
+ tsk_safeobj_unlock(self);
- return 0;
- }
+ return 0;
+ }
- return -1;
+ return -1;
}
/* cancel all transactions related to this dialog */
int tsip_transac_layer_cancel_by_dialog(tsip_transac_layer_t *self, const struct tsip_dialog_s* dialog)
{
- tsk_list_item_t *item;
- int ret = 0; /* Perhaps there is zero transaction */
+ tsk_list_item_t *item;
+ int ret = 0; /* Perhaps there is zero transaction */
- if(!self || !dialog){
- TSK_DEBUG_WARN("Invalid parameter.");
- return -1;
- }
-
- tsk_safeobj_lock(self);
+ if(!self || !dialog) {
+ TSK_DEBUG_WARN("Invalid parameter.");
+ return -1;
+ }
+
+ tsk_safeobj_lock(self);
again:
- tsk_list_foreach(item, self->transactions){
- if(tsk_object_cmp(dialog, TSIP_TRANSAC_GET_DIALOG(item->data)) == 0){
- if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(item->data), tsip_atype_cancel, tsk_null))){ /* will call tsip_transac_layer_remove() if succeed */
- /* break; */
- }
- else{
- /* we cannot continue because an item has been removed from the list while we are looping through */
- goto again;
- }
- }
- }
- tsk_safeobj_unlock(self);
-
- return 0;
+ tsk_list_foreach(item, self->transactions) {
+ if(tsk_object_cmp(dialog, TSIP_TRANSAC_GET_DIALOG(item->data)) == 0) {
+ if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(item->data), tsip_atype_cancel, tsk_null))) { /* will call tsip_transac_layer_remove() if succeed */
+ /* break; */
+ }
+ else {
+ /* we cannot continue because an item has been removed from the list while we are looping through */
+ goto again;
+ }
+ }
+ }
+ tsk_safeobj_unlock(self);
+
+ return 0;
}
tsip_transac_t* tsip_transac_layer_find_client(const tsip_transac_layer_t *self, const tsip_response_t* response)
{
- /*
- RFC 3261 - 17.1.3 Matching Responses to Client Transactions
-
- When the transport layer in the client receives a response, it has to
- determine which client transaction will handle the response, so that
- the processing of Sections 17.1.1 and 17.1.2 can take place. The
- branch parameter in the top Via header field is used for this
- purpose. A response matches a client transaction under two
- conditions:
-
- 1. If the response has the same value of the branch parameter in
- the top Via header field as the branch parameter in the top
- Via header field of the request that created the transaction.
-
- 2. If the method parameter in the CSeq header field matches the
- method of the request that created the transaction. The
- method is needed since a CANCEL request constitutes a
- different transaction, but shares the same value of the branch
- parameter.
- */
- tsip_transac_t *ret = tsk_null;
- tsip_transac_t *transac;
- tsk_list_item_t *item;
-
- /* Check first Via/CSeq validity.
- */
- if(!response->firstVia || !response->CSeq){
- return tsk_null;
- }
-
- tsk_safeobj_lock(self);
-
- tsk_list_foreach(item, self->transactions){
- transac = item->data;
- if( tsk_strequals(transac->branch, response->firstVia->branch)
- && tsk_strequals(transac->cseq_method, response->CSeq->method)
- )
- {
- ret = tsk_object_ref(transac);
- break;
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ /*
+ RFC 3261 - 17.1.3 Matching Responses to Client Transactions
+
+ When the transport layer in the client receives a response, it has to
+ determine which client transaction will handle the response, so that
+ the processing of Sections 17.1.1 and 17.1.2 can take place. The
+ branch parameter in the top Via header field is used for this
+ purpose. A response matches a client transaction under two
+ conditions:
+
+ 1. If the response has the same value of the branch parameter in
+ the top Via header field as the branch parameter in the top
+ Via header field of the request that created the transaction.
+
+ 2. If the method parameter in the CSeq header field matches the
+ method of the request that created the transaction. The
+ method is needed since a CANCEL request constitutes a
+ different transaction, but shares the same value of the branch
+ parameter.
+ */
+ tsip_transac_t *ret = tsk_null;
+ tsip_transac_t *transac;
+ tsk_list_item_t *item;
+
+ /* Check first Via/CSeq validity.
+ */
+ if(!response->firstVia || !response->CSeq) {
+ return tsk_null;
+ }
+
+ tsk_safeobj_lock(self);
+
+ tsk_list_foreach(item, self->transactions) {
+ transac = item->data;
+ if( tsk_strequals(transac->branch, response->firstVia->branch)
+ && tsk_strequals(transac->cseq_method, response->CSeq->method)
+ ) {
+ ret = tsk_object_ref(transac);
+ break;
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
tsip_transac_t* tsip_transac_layer_find_server(const tsip_transac_layer_t *self, const tsip_message_t* message)
{
- /*
- RFC 3261 - 17.2.3 Matching Requests to Server Transactions
-
- When a request is received from the network by the server, it has to
- be matched to an existing transaction. This is accomplished in the
- following manner.
-
- The branch parameter in the topmost Via header field of the request
- is examined. If it is present and begins with the magic cookie
- "z9hG4bK", the request was generated by a client transaction
- compliant to this specification. Therefore, the branch parameter
- will be unique across all transactions sent by that client. The
- request matches a transaction if:
-
- 1. the branch parameter in the request is equal to the one in the
- top Via header field of the request that created the
- transaction, and
-
- 2. the sent-by value in the top Via of the request is equal to the
- one in the request that created the transaction, and
-
- 3. the method of the request matches the one that created the
- transaction, except for ACK, where the method of the request
- that created the transaction is INVITE.
- */
- tsip_transac_t *ret = tsk_null;
- tsip_transac_t *transac;
- tsk_list_item_t *item;
- //const char* sent_by;
-
- /* Check first Via/CSeq validity */
- if(!message->firstVia || !message->CSeq){
- return tsk_null;
- }
-
- tsk_safeobj_lock(self);
-
- tsk_list_foreach(item, self->transactions){
- transac = item->data;
- if(TSIP_REQUEST_IS_ACK(message) && tsk_strequals(transac->callid, message->Call_ID->value)){ /* 1. ACK branch won't match INVITE's but they MUST have the same CSeq/CallId values */
- // [transac->type == tsip_transac_type_ist] is used to avoid looping in webrtc2sip mode (e.g. browser <->(breaker)<->browser)
- // (browser-1) -> INVITE -> (breaker) -> INVITE - (server) -> INVITE -> (breaker) -> (browser-2)
- // the breaker will have two transactions (IST and ICT) with same cseq value and call-id (if not changed by the server)
- if(transac->type == tsip_transac_type_ist && tsk_striequals(transac->cseq_method, "INVITE") && message->CSeq->seq == transac->cseq_value){
- ret = tsk_object_ref(transac);
- break;
- }
- }
- else if(tsk_strequals(transac->branch, message->firstVia->branch) /* 2. Compare branches*/
- && (1 == 1) /* FIXME: compare host:ip */
- ){
- if(tsk_strequals(transac->cseq_method, message->CSeq->method)){
- ret = tsk_object_ref(transac);
- break;
- }
- else if(TSIP_REQUEST_IS_CANCEL(message) || TSIP_RESPONSE_IS_TO_CANCEL(message)){
- ret = tsk_object_ref(transac);
- break;
- }
- }
- }
-
- tsk_safeobj_unlock(self);
-
- return ret;
+ /*
+ RFC 3261 - 17.2.3 Matching Requests to Server Transactions
+
+ When a request is received from the network by the server, it has to
+ be matched to an existing transaction. This is accomplished in the
+ following manner.
+
+ The branch parameter in the topmost Via header field of the request
+ is examined. If it is present and begins with the magic cookie
+ "z9hG4bK", the request was generated by a client transaction
+ compliant to this specification. Therefore, the branch parameter
+ will be unique across all transactions sent by that client. The
+ request matches a transaction if:
+
+ 1. the branch parameter in the request is equal to the one in the
+ top Via header field of the request that created the
+ transaction, and
+
+ 2. the sent-by value in the top Via of the request is equal to the
+ one in the request that created the transaction, and
+
+ 3. the method of the request matches the one that created the
+ transaction, except for ACK, where the method of the request
+ that created the transaction is INVITE.
+ */
+ tsip_transac_t *ret = tsk_null;
+ tsip_transac_t *transac;
+ tsk_list_item_t *item;
+ //const char* sent_by;
+
+ /* Check first Via/CSeq validity */
+ if(!message->firstVia || !message->CSeq) {
+ return tsk_null;
+ }
+
+ tsk_safeobj_lock(self);
+
+ tsk_list_foreach(item, self->transactions) {
+ transac = item->data;
+ if(TSIP_REQUEST_IS_ACK(message) && tsk_strequals(transac->callid, message->Call_ID->value)) { /* 1. ACK branch won't match INVITE's but they MUST have the same CSeq/CallId values */
+ // [transac->type == tsip_transac_type_ist] is used to avoid looping in webrtc2sip mode (e.g. browser <->(breaker)<->browser)
+ // (browser-1) -> INVITE -> (breaker) -> INVITE - (server) -> INVITE -> (breaker) -> (browser-2)
+ // the breaker will have two transactions (IST and ICT) with same cseq value and call-id (if not changed by the server)
+ if(transac->type == tsip_transac_type_ist && tsk_striequals(transac->cseq_method, "INVITE") && message->CSeq->seq == transac->cseq_value) {
+ ret = tsk_object_ref(transac);
+ break;
+ }
+ }
+ else if(tsk_strequals(transac->branch, message->firstVia->branch) /* 2. Compare branches*/
+ && (1 == 1) /* FIXME: compare host:ip */
+ ) {
+ if(tsk_strequals(transac->cseq_method, message->CSeq->method)) {
+ ret = tsk_object_ref(transac);
+ break;
+ }
+ else if(TSIP_REQUEST_IS_CANCEL(message) || TSIP_RESPONSE_IS_TO_CANCEL(message)) {
+ ret = tsk_object_ref(transac);
+ break;
+ }
+ }
+ }
+
+ tsk_safeobj_unlock(self);
+
+ return ret;
}
@@ -272,31 +267,31 @@ tsip_transac_t* tsip_transac_layer_find_server(const tsip_transac_layer_t *self,
**/
int tsip_transac_layer_handle_incoming_msg(const tsip_transac_layer_t *self, const tsip_message_t* message)
{
- int ret = -1;
- tsip_transac_t *transac = tsk_null;
-
- if(!message){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- //tsk_safeobj_lock(self);
-
- if(TSIP_MESSAGE_IS_REQUEST(message)){
- transac = tsip_transac_layer_find_server(self, /*TSIP_MESSAGE_AS_REQUEST*/(message));
- }
- else{
- transac = tsip_transac_layer_find_client(self, /*TSIP_MESSAGE_AS_RESPONSE*/(message));
- }
-
- //tsk_safeobj_unlock(self);
-
- if(transac){
- ret = transac->callback(transac, tsip_transac_incoming_msg, message);
- tsk_object_unref(transac);
- }
-
- return ret;
+ int ret = -1;
+ tsip_transac_t *transac = tsk_null;
+
+ if(!message) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ //tsk_safeobj_lock(self);
+
+ if(TSIP_MESSAGE_IS_REQUEST(message)) {
+ transac = tsip_transac_layer_find_server(self, /*TSIP_MESSAGE_AS_REQUEST*/(message));
+ }
+ else {
+ transac = tsip_transac_layer_find_client(self, /*TSIP_MESSAGE_AS_RESPONSE*/(message));
+ }
+
+ //tsk_safeobj_unlock(self);
+
+ if(transac) {
+ ret = transac->callback(transac, tsip_transac_incoming_msg, message);
+ tsk_object_unref(transac);
+ }
+
+ return ret;
}
@@ -314,39 +309,38 @@ int tsip_transac_layer_handle_incoming_msg(const tsip_transac_layer_t *self, con
//
static tsk_object_t* tsip_transac_layer_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transac_layer_t *layer = self;
- if(layer){
- layer->stack = va_arg(*app, const tsip_stack_handle_t *);
- layer->transactions = tsk_list_create();
-
- tsk_safeobj_init(layer);
- }
- return self;
+ tsip_transac_layer_t *layer = self;
+ if(layer) {
+ layer->stack = va_arg(*app, const tsip_stack_handle_t *);
+ layer->transactions = tsk_list_create();
+
+ tsk_safeobj_init(layer);
+ }
+ return self;
}
static tsk_object_t* tsip_transac_layer_dtor(tsk_object_t * self)
-{
- tsip_transac_layer_t *layer = self;
- if(layer){
- TSK_OBJECT_SAFE_FREE(layer->transactions);
+{
+ tsip_transac_layer_t *layer = self;
+ if(layer) {
+ TSK_OBJECT_SAFE_FREE(layer->transactions);
- tsk_safeobj_deinit(layer);
+ tsk_safeobj_deinit(layer);
- TSK_DEBUG_INFO("*** Transaction Layer destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** Transaction Layer destroyed ***");
+ }
+ return self;
}
static int tsip_transac_layer_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_transac_layer_def_s =
-{
- sizeof(tsip_transac_layer_t),
- tsip_transac_layer_ctor,
- tsip_transac_layer_dtor,
- tsip_transac_layer_cmp,
+static const tsk_object_def_t tsip_transac_layer_def_s = {
+ sizeof(tsip_transac_layer_t),
+ tsip_transac_layer_ctor,
+ tsip_transac_layer_dtor,
+ tsip_transac_layer_cmp,
};
const tsk_object_def_t *tsip_transac_layer_def_t = &tsip_transac_layer_def_s;
diff --git a/tinySIP/src/transactions/tsip_transac_nict.c b/tinySIP/src/transactions/tsip_transac_nict.c
index c16e503..cdae368 100755
--- a/tinySIP/src/transactions/tsip_transac_nict.c
+++ b/tinySIP/src/transactions/tsip_transac_nict.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -102,29 +102,27 @@ static int tsip_transac_nict_Any_2_Terminated_X_cancel(va_list *app); /* doubang
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_cancel = tsip_atype_cancel,
-
- _fsm_action_send = 0xFF,
- _fsm_action_timerE,
- _fsm_action_timerF,
- _fsm_action_timerK,
- _fsm_action_1xx,
- _fsm_action_200_to_699,
- _fsm_action_transporterror,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_cancel = tsip_atype_cancel,
+
+ _fsm_action_send = 0xFF,
+ _fsm_action_timerE,
+ _fsm_action_timerF,
+ _fsm_action_timerK,
+ _fsm_action_1xx,
+ _fsm_action_200_to_699,
+ _fsm_action_transporterror,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Trying,
- _fsm_state_Proceeding,
- _fsm_state_Completed,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Trying,
+ _fsm_state_Proceeding,
+ _fsm_state_Completed,
+ _fsm_state_Terminated
}
_fsm_state_t;
@@ -133,74 +131,71 @@ _fsm_state_t;
* Callback function called by the transport layer to alert the transaction for incoming messages
* or errors (e.g. transport error).
*
- * @param [in,out] self A pointer to the NIC transaction.
- * @param type The event type.
+ * @param [in,out] self A pointer to the NIC transaction.
+ * @param type The event type.
* @param [in,out] msg The incoming message.
*
- * @return Zero if succeed and no-zero error code otherwise.
+ * @return Zero if succeed and no-zero error code otherwise.
**/
int tsip_transac_nict_event_callback(const tsip_transac_nict_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
-{
- int ret = 0;
-
- switch(type)
- {
- case tsip_transac_incoming_msg:
- {
- if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)){
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_1xx, msg);
- }
- else if(TSIP_RESPONSE_IS_23456(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_200_to_699, msg);
- }
- else{
- TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg));
- }
- }
- break;
- }
-
- case tsip_transac_canceled:
- case tsip_transac_terminated:
- case tsip_transac_timedout:
- break;
-
- case tsip_transac_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
- break;
- }
-
- case tsip_transac_transport_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
- break;
- }
-
- default: break;
- }
-
- return ret;
+{
+ int ret = 0;
+
+ switch(type) {
+ case tsip_transac_incoming_msg: {
+ if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_1xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_23456(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_200_to_699, msg);
+ }
+ else {
+ TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg));
+ }
+ }
+ break;
+ }
+
+ case tsip_transac_canceled:
+ case tsip_transac_terminated:
+ case tsip_transac_timedout:
+ break;
+
+ case tsip_transac_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
+ break;
+ }
+
+ case tsip_transac_transport_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return ret;
}
int tsip_transac_nict_timer_callback(const tsip_transac_nict_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
-
- if(self){
- if(timer_id == self->timerE.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerE, tsk_null);
- }
- else if(timer_id == self->timerF.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerF, tsk_null);
- }
- else if(timer_id == self->timerK.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerK, tsk_null);
- }
- }
-
- return ret;
+ int ret = -1;
+
+ if(self) {
+ if(timer_id == self->timerE.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerE, tsk_null);
+ }
+ else if(timer_id == self->timerF.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerF, tsk_null);
+ }
+ else if(timer_id == self->timerK.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerK, tsk_null);
+ }
+ }
+
+ return ret;
}
/** Initializes the transaction.
@@ -212,126 +207,126 @@ int tsip_transac_nict_timer_callback(const tsip_transac_nict_t* self, tsk_timer_
**/
int tsip_transac_nict_init(tsip_transac_nict_t *self)
{
- /* Initialize the state machine. */
- tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (Send) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_send, _fsm_state_Trying, tsip_transac_nict_Started_2_Trying_X_send, "tsip_transac_nict_Started_2_Trying_X_send"),
- // Started -> (Any) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nict_Started_2_Started_X_any"),
-
- /*=======================
- * === Trying ===
- */
- // Trying -> (timerE) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerE, _fsm_state_Trying, tsip_transac_nict_Trying_2_Trying_X_timerE, "tsip_transac_nict_Trying_2_Trying_X_timerE"),
- // Trying -> (timerF) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_timerF, "tsip_transac_nict_Trying_2_Terminated_X_timerF"),
- // Trying -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_transportError, "tsip_transac_nict_Trying_2_Terminated_X_transportError"),
- // Trying -> (1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Trying_2_Proceedding_X_1xx, "tsip_transac_nict_Trying_2_Proceedding_X_1xx"),
- // Trying -> (200 to 699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Trying_2_Completed_X_200_to_699, "tsip_transac_nict_Trying_2_Completed_X_200_to_699"),
-
- /*=======================
- * === Proceeding ===
- */
- // Proceeding -> (timerE) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerE, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_timerE, "tsip_transac_nict_Proceeding_2_Proceeding_X_timerE"),
- // Proceeding -> (timerF) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_timerF, "tsip_transac_nict_Proceeding_2_Terminated_X_timerF"),
- // Proceeding -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_transportError, "tsip_transac_nict_Proceeding_2_Terminated_X_transportError"),
- // Proceeding -> (1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_1xx, "tsip_transac_nict_Proceeding_2_Proceeding_X_1xx"),
- // Proceeding -> (200 to 699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Proceeding_2_Completed_X_200_to_699, "tsip_transac_nict_Proceeding_2_Completed_X_200_to_699"),
-
- /*=======================
- * === Completed ===
- */
- // Completed -> (timer K) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerK, _fsm_state_Terminated, tsip_transac_nict_Completed_2_Terminated_X_timerK, "tsip_transac_nict_Completed_2_Terminated_X_timerK"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_transportError, "tsip_transac_nict_Any_2_Terminated_X_transportError"),
- // Any -> (error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_Error, "tsip_transac_nict_Any_2_Terminated_X_Error"),
- // Any -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_cancel, "tsip_transac_nict_Any_2_Terminated_X_cancel"),
-
- TSK_FSM_ADD_NULL());
-
- /* Set callback function to call when new messages arrive or errors happen in
- the transport layer.
- */
- TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_nict_event_callback);
-
- /* Timers */
- self->timerE.id = TSK_INVALID_TIMER_ID;
- self->timerF.id = TSK_INVALID_TIMER_ID;
- self->timerK.id = TSK_INVALID_TIMER_ID;
- self->timerE.timeout = TSIP_TIMER_GET(E);
- self->timerF.timeout = TSIP_TIMER_GET(F);
-
- return 0;
+ /* Initialize the state machine. */
+ tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (Send) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_send, _fsm_state_Trying, tsip_transac_nict_Started_2_Trying_X_send, "tsip_transac_nict_Started_2_Trying_X_send"),
+ // Started -> (Any) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nict_Started_2_Started_X_any"),
+
+ /*=======================
+ * === Trying ===
+ */
+ // Trying -> (timerE) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerE, _fsm_state_Trying, tsip_transac_nict_Trying_2_Trying_X_timerE, "tsip_transac_nict_Trying_2_Trying_X_timerE"),
+ // Trying -> (timerF) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_timerF, "tsip_transac_nict_Trying_2_Terminated_X_timerF"),
+ // Trying -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_transportError, "tsip_transac_nict_Trying_2_Terminated_X_transportError"),
+ // Trying -> (1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Trying_2_Proceedding_X_1xx, "tsip_transac_nict_Trying_2_Proceedding_X_1xx"),
+ // Trying -> (200 to 699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Trying_2_Completed_X_200_to_699, "tsip_transac_nict_Trying_2_Completed_X_200_to_699"),
+
+ /*=======================
+ * === Proceeding ===
+ */
+ // Proceeding -> (timerE) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerE, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_timerE, "tsip_transac_nict_Proceeding_2_Proceeding_X_timerE"),
+ // Proceeding -> (timerF) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_timerF, "tsip_transac_nict_Proceeding_2_Terminated_X_timerF"),
+ // Proceeding -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_transportError, "tsip_transac_nict_Proceeding_2_Terminated_X_transportError"),
+ // Proceeding -> (1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_1xx, "tsip_transac_nict_Proceeding_2_Proceeding_X_1xx"),
+ // Proceeding -> (200 to 699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Proceeding_2_Completed_X_200_to_699, "tsip_transac_nict_Proceeding_2_Completed_X_200_to_699"),
+
+ /*=======================
+ * === Completed ===
+ */
+ // Completed -> (timer K) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerK, _fsm_state_Terminated, tsip_transac_nict_Completed_2_Terminated_X_timerK, "tsip_transac_nict_Completed_2_Terminated_X_timerK"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_transportError, "tsip_transac_nict_Any_2_Terminated_X_transportError"),
+ // Any -> (error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_Error, "tsip_transac_nict_Any_2_Terminated_X_Error"),
+ // Any -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_cancel, "tsip_transac_nict_Any_2_Terminated_X_cancel"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Set callback function to call when new messages arrive or errors happen in
+ the transport layer.
+ */
+ TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_nict_event_callback);
+
+ /* Timers */
+ self->timerE.id = TSK_INVALID_TIMER_ID;
+ self->timerF.id = TSK_INVALID_TIMER_ID;
+ self->timerK.id = TSK_INVALID_TIMER_ID;
+ self->timerE.timeout = TSIP_TIMER_GET(E);
+ self->timerF.timeout = TSIP_TIMER_GET(F);
+
+ return 0;
}
tsip_transac_nict_t* tsip_transac_nict_create(int32_t cseq_value, const char* cseq_method, const char* callid, tsip_transac_dst_t* dst)
{
- tsip_transac_nict_t* transac = tsk_object_new(tsip_transac_nict_def_t);
- if(transac){
- // initialize base class
- tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_nict, cseq_value, cseq_method, callid, dst, _fsm_state_Started, _fsm_state_Terminated);
-
- // init FSM
- TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_nict_OnTerminated), (const void*)transac);
-
- // initialize NICT object
- tsip_transac_nict_init(transac);
- }
- return transac;
+ tsip_transac_nict_t* transac = tsk_object_new(tsip_transac_nict_def_t);
+ if(transac) {
+ // initialize base class
+ tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_nict, cseq_value, cseq_method, callid, dst, _fsm_state_Started, _fsm_state_Terminated);
+
+ // init FSM
+ TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_nict_OnTerminated), (const void*)transac);
+
+ // initialize NICT object
+ tsip_transac_nict_init(transac);
+ }
+ return transac;
}
/**
* Starts the client transaction.
*
- * @param [in,out] self The client transaction to start.
- * @param [in,out] request The SIP/IMS request to send.
+ * @param [in,out] self The client transaction to start.
+ * @param [in,out] request The SIP/IMS request to send.
*
- * @return Zero if succeed and non-zero error code otherwise.
+ * @return Zero if succeed and non-zero error code otherwise.
**/
int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* request)
{
- int ret = -1;
- if(self && request && !TSIP_TRANSAC(self)->running){
- /* Add branch to the new client transaction
- * - CANCEL will have the same Via and Contact headers as the request it cancel
- * - Transac will use request branch if exit (e.g. when request received over websocket)
- */
- if((request->firstVia && !tsk_strnullORempty(request->firstVia->branch))){
- tsk_strupdate(&TSIP_TRANSAC(self)->branch, (request->firstVia ? request->firstVia->branch : "doubango"));
- }
- else if((TSIP_TRANSAC(self)->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))){
- tsk_istr_t branch;
- tsk_strrandom(&branch);
- tsk_strcat_2(&(TSIP_TRANSAC(self)->branch), "-%s", branch);
- }
-
- TSIP_TRANSAC(self)->running = tsk_true;
- self->request = tsk_object_ref((void*)request);
-
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send, tsk_null);
- }
- return ret;
+ int ret = -1;
+ if(self && request && !TSIP_TRANSAC(self)->running) {
+ /* Add branch to the new client transaction
+ * - CANCEL will have the same Via and Contact headers as the request it cancel
+ * - Transac will use request branch if exit (e.g. when request received over websocket)
+ */
+ if((request->firstVia && !tsk_strnullORempty(request->firstVia->branch))) {
+ tsk_strupdate(&TSIP_TRANSAC(self)->branch, (request->firstVia ? request->firstVia->branch : "doubango"));
+ }
+ else if((TSIP_TRANSAC(self)->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))) {
+ tsk_istr_t branch;
+ tsk_strrandom(&branch);
+ tsk_strcat_2(&(TSIP_TRANSAC(self)->branch), "-%s", branch);
+ }
+
+ TSIP_TRANSAC(self)->running = tsk_true;
+ self->request = tsk_object_ref((void*)request);
+
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send, tsk_null);
+ }
+ return ret;
}
@@ -350,304 +345,304 @@ int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* req
*/
int tsip_transac_nict_Started_2_Trying_X_send(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- //== Send the request
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(self->request));
-
- // Now that the first request is sent using the best transport mean we know if it's reliable or not
- if(TNET_SOCKET_TYPE_IS_VALID(self->request->dst_net_type)){
- TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(self->request->dst_net_type);
- self->timerK.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(K); /* RFC 3261 - 17.1.2.2*/
- }
-
- /* RFC 3261 - 17.1.2.2
- The "Trying" state is entered when the TU initiates a new client
- transaction with a request. When entering this state, the client
- transaction SHOULD set timer F to fire in 64*T1 seconds.
- */
- TRANSAC_NICT_TIMER_SCHEDULE(F);
-
- /* RFC 3261 - 17.1.2.2
- If an unreliable transport is in use, the client transaction MUST set timer
- E to fire in T1 seconds.
- */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_NICT_TIMER_SCHEDULE(E);
- }
-
- return 0;
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ //== Send the request
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(self->request));
+
+ // Now that the first request is sent using the best transport mean we know if it's reliable or not
+ if(TNET_SOCKET_TYPE_IS_VALID(self->request->dst_net_type)) {
+ TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(self->request->dst_net_type);
+ self->timerK.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(K); /* RFC 3261 - 17.1.2.2*/
+ }
+
+ /* RFC 3261 - 17.1.2.2
+ The "Trying" state is entered when the TU initiates a new client
+ transaction with a request. When entering this state, the client
+ transaction SHOULD set timer F to fire in 64*T1 seconds.
+ */
+ TRANSAC_NICT_TIMER_SCHEDULE(F);
+
+ /* RFC 3261 - 17.1.2.2
+ If an unreliable transport is in use, the client transaction MUST set timer
+ E to fire in T1 seconds.
+ */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_NICT_TIMER_SCHEDULE(E);
+ }
+
+ return 0;
}
/* Trying -> (Timer E) -> Trying
*/
int tsip_transac_nict_Trying_2_Trying_X_timerE(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
-
- //== Send the request
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
-
- /* RFC 3261 - 17.1.2.2
- If timer E fires while still in this (Trying) state, the timer is reset, but this time with a value of MIN(2*T1, T2).
- When the timer fires again, it is reset to a MIN(4*T1, T2). This process continues so that retransmissions occur with an exponentially
- increasing interval that caps at T2. The default value of T2 is 4s, and it represents the amount of time a non-INVITE server transaction
- will take to respond to a request, if it does not respond immediately. For the default values of T1 and T2, this results in
- intervals of 500 ms, 1 s, 2 s, 4 s, 4 s, 4 s, etc.
- */
- self->timerE.timeout = TSK_MIN((self->timerE.timeout<<1), TSIP_TIMER_GET(T2));
- TRANSAC_NICT_TIMER_SCHEDULE(E);
-
- return 0;
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+
+ //== Send the request
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
+
+ /* RFC 3261 - 17.1.2.2
+ If timer E fires while still in this (Trying) state, the timer is reset, but this time with a value of MIN(2*T1, T2).
+ When the timer fires again, it is reset to a MIN(4*T1, T2). This process continues so that retransmissions occur with an exponentially
+ increasing interval that caps at T2. The default value of T2 is 4s, and it represents the amount of time a non-INVITE server transaction
+ will take to respond to a request, if it does not respond immediately. For the default values of T1 and T2, this results in
+ intervals of 500 ms, 1 s, 2 s, 4 s, 4 s, 4 s, etc.
+ */
+ self->timerE.timeout = TSK_MIN((self->timerE.timeout<<1), TSIP_TIMER_GET(T2));
+ TRANSAC_NICT_TIMER_SCHEDULE(E);
+
+ return 0;
}
/* Trying -> (Timer F) -> Terminated
*/
int tsip_transac_nict_Trying_2_Terminated_X_timerF(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- /* RFC 3261 - 17.1.2.2
- If Timer F fires while the client transaction is still in the
- "Trying" state, the client transaction SHOULD inform the TU about the
- timeout, and then it SHOULD enter the "Terminated" state.
- */
+ /* RFC 3261 - 17.1.2.2
+ If Timer F fires while the client transaction is still in the
+ "Trying" state, the client transaction SHOULD inform the TU about the
+ timeout, and then it SHOULD enter the "Terminated" state.
+ */
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
-
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_timedout, self->request);
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return 0;
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_timedout, self->request);
+
+ return 0;
}
/* Trying -> (Transport Error) -> Terminated
*/
int tsip_transac_nict_Trying_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, self->request);
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, self->request);
- return 0;
+ return 0;
}
/* Trying -> (1xx) -> Proceeding
*/
int tsip_transac_nict_Trying_2_Proceedding_X_1xx(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* RFC 3261 - 17.1.2.2
- If a provisional response is received while in the "Trying" state, the
- response MUST be passed to the TU, and then the client transaction
- SHOULD move to the "Proceeding" state.
- */
-
- /* Cancel timers */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(E);
- }
- TRANSAC_TIMER_CANCEL(F); /* Now it's up to the UAS to update the FSM. */
-
- /* Pass the provisional response to the dialog. */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
-
- return 0;
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.1.2.2
+ If a provisional response is received while in the "Trying" state, the
+ response MUST be passed to the TU, and then the client transaction
+ SHOULD move to the "Proceeding" state.
+ */
+
+ /* Cancel timers */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(E);
+ }
+ TRANSAC_TIMER_CANCEL(F); /* Now it's up to the UAS to update the FSM. */
+
+ /* Pass the provisional response to the dialog. */
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
+
+ return 0;
}
/* Trying -> (200-699) -> Completed
*/
int tsip_transac_nict_Trying_2_Completed_X_200_to_699(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* RFC 3261 - 17.1.2.2
- If a final response (status codes 200-699) is received while in the "Trying" state, the response
- MUST be passed to the TU, and the client transaction MUST transition
- to the "Completed" state.
+ /* RFC 3261 - 17.1.2.2
+ If a final response (status codes 200-699) is received while in the "Trying" state, the response
+ MUST be passed to the TU, and the client transaction MUST transition
+ to the "Completed" state.
- If Timer K fires while in this state (Completed), the client transaction MUST transition to the "Terminated" state.
- */
+ If Timer K fires while in this state (Completed), the client transaction MUST transition to the "Terminated" state.
+ */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(E);
- }
- TRANSAC_TIMER_CANCEL(F);
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(E);
+ }
+ TRANSAC_TIMER_CANCEL(F);
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
- /* SCHEDULE timer K */
- TRANSAC_NICT_TIMER_SCHEDULE(K);
+ /* SCHEDULE timer K */
+ TRANSAC_NICT_TIMER_SCHEDULE(K);
- return 0;
+ return 0;
}
/* Proceeding -> (TimerE) -> Proceeding
*/
int tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- //== Send the request
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
+ //== Send the request
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
- /* RFC 3261 - 17.1.2.2
- If Timer E fires while in the "Proceeding" state, the request MUST be
- passed to the transport layer for retransmission, and Timer E MUST be
- reset with a value of T2 seconds.
- */
- self->timerE.timeout = TSK_MIN(self->timerE.timeout*2, TSIP_TIMER_GET(T2));
- TRANSAC_NICT_TIMER_SCHEDULE(E);
+ /* RFC 3261 - 17.1.2.2
+ If Timer E fires while in the "Proceeding" state, the request MUST be
+ passed to the transport layer for retransmission, and Timer E MUST be
+ reset with a value of T2 seconds.
+ */
+ self->timerE.timeout = TSK_MIN(self->timerE.timeout*2, TSIP_TIMER_GET(T2));
+ TRANSAC_NICT_TIMER_SCHEDULE(E);
- return 0;
+ return 0;
}
/* Proceeding -> (Timer F) -> Proceeding
*/
int tsip_transac_nict_Proceeding_2_Terminated_X_timerF(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* RFC 3261 - 17.1.2.2
- If timer F fires while in the "Proceeding" state, the TU MUST be informed of a timeout, and the
- client transaction MUST transition to the terminated state.
- */
+ /* RFC 3261 - 17.1.2.2
+ If timer F fires while in the "Proceeding" state, the TU MUST be informed of a timeout, and the
+ client transaction MUST transition to the terminated state.
+ */
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
- return 0;
+ return 0;
}
/* Proceeding -> (Transport error) -> Terminated
*/
int tsip_transac_nict_Proceeding_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ /*const tsip_message_t *message = va_arg(*app, const tsip_message_t *);*/
- /* Timers will be canceles by On */
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, 0);
+ /* Timers will be canceles by On */
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, 0);
- return 0;
+ return 0;
}
/* Proceeding -> (1xx) -> Proceeding
*/
int tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(E);
- }
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(E);
+ }
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
- return 0;
+ return 0;
}
/* Proceeding -> (200-699) -> Completed
*/
int tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
-
- /* RFC 3261 - 17.1.2.2
- If a final response (status codes 200-699) is received while in the
- "Proceeding" state, the response MUST be passed to the TU, and the
- client transaction MUST transition to the "Completed" state.
- */
-
- /* RFC 3261 - 17.1.2.2
- Once the client transaction enters the "Completed" state, it MUST set
- Timer K to fire in T4 seconds for unreliable transports, and zero
- seconds for reliable transports. The "Completed" state exists to
- buffer any additional response retransmissions that may be received
- (which is why the client transaction remains there only for
-
- unreliable transports). T4 represents the amount of time the network
- will take to clear messages between client and server transactions.
- The default value of T4 is 5s.
- */
-
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(E);
- }
-
- tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
-
- /* SCHEDULE timer K */
- TRANSAC_NICT_TIMER_SCHEDULE(K);
-
- return 0;
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.1.2.2
+ If a final response (status codes 200-699) is received while in the
+ "Proceeding" state, the response MUST be passed to the TU, and the
+ client transaction MUST transition to the "Completed" state.
+ */
+
+ /* RFC 3261 - 17.1.2.2
+ Once the client transaction enters the "Completed" state, it MUST set
+ Timer K to fire in T4 seconds for unreliable transports, and zero
+ seconds for reliable transports. The "Completed" state exists to
+ buffer any additional response retransmissions that may be received
+ (which is why the client transaction remains there only for
+
+ unreliable transports). T4 represents the amount of time the network
+ will take to clear messages between client and server transactions.
+ The default value of T4 is 5s.
+ */
+
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(E);
+ }
+
+ tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, message);
+
+ /* SCHEDULE timer K */
+ TRANSAC_NICT_TIMER_SCHEDULE(K);
+
+ return 0;
}
/* Completed -> (Timer K) -> Terminated
*/
int tsip_transac_nict_Completed_2_Terminated_X_timerK(va_list *app)
{
- //tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ //tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+
+ /* RFC 3261 - 17.1.2.2
+ If Timer K fires while in this state (Completed), the client transaction
+ MUST transition to the "Terminated" state.
+ */
- /* RFC 3261 - 17.1.2.2
- If Timer K fires while in this state (Completed), the client transaction
- MUST transition to the "Terminated" state.
- */
-
- /* RFC 3261 - 17.1.2.2
- ONCE THE TRANSACTION IS IN THE TERMINATED STATE, IT MUST BE DESTROYED IMMEDIATELY.
- */
+ /* RFC 3261 - 17.1.2.2
+ ONCE THE TRANSACTION IS IN THE TERMINATED STATE, IT MUST BE DESTROYED IMMEDIATELY.
+ */
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- //tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transac_ok, 0);
+ //tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transac_ok, 0);
- return 0;
+ return 0;
}
/* Any -> (Transport Error) -> Terminated
*/
int tsip_transac_nict_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
}
/* Any -> (Error) -> Terminated
*/
int tsip_transac_nict_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
}
/* Any -> (cancel) -> Terminated
*/
int tsip_transac_nict_Any_2_Terminated_X_cancel(va_list *app)
{
- /* doubango-specific */
- return 0;
+ /* doubango-specific */
+ return 0;
}
@@ -662,10 +657,10 @@ int tsip_transac_nict_Any_2_Terminated_X_cancel(va_list *app)
*/
int tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self)
{
- TSK_DEBUG_INFO("=== NICT terminated ===");
-
- /* Remove (and destroy) the transaction from the layer. */
- return tsip_transac_remove(TSIP_TRANSAC(self));
+ TSK_DEBUG_INFO("=== NICT terminated ===");
+
+ /* Remove (and destroy) the transaction from the layer. */
+ return tsip_transac_remove(TSIP_TRANSAC(self));
}
@@ -688,44 +683,43 @@ int tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self)
//
static tsk_object_t* tsip_transac_nict_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transac_nict_t *transac = self;
- if(transac){
- }
- return self;
+ tsip_transac_nict_t *transac = self;
+ if(transac) {
+ }
+ return self;
}
static tsk_object_t* tsip_transac_nict_dtor(tsk_object_t * _self)
-{
- tsip_transac_nict_t *self = _self;
- if(self){
- /* Cancel timers */
- if(!TSIP_TRANSAC(self)->reliable){
- TRANSAC_TIMER_CANCEL(E);
- }
- TRANSAC_TIMER_CANCEL(F);
- TRANSAC_TIMER_CANCEL(K);
-
- TSIP_TRANSAC(self)->running = tsk_false;
- TSK_OBJECT_SAFE_FREE(self->request);
-
- /* DeInitialize base class */
- tsip_transac_deinit(TSIP_TRANSAC(self));
-
- TSK_DEBUG_INFO("*** NICT destroyed ***");
- }
- return _self;
+{
+ tsip_transac_nict_t *self = _self;
+ if(self) {
+ /* Cancel timers */
+ if(!TSIP_TRANSAC(self)->reliable) {
+ TRANSAC_TIMER_CANCEL(E);
+ }
+ TRANSAC_TIMER_CANCEL(F);
+ TRANSAC_TIMER_CANCEL(K);
+
+ TSIP_TRANSAC(self)->running = tsk_false;
+ TSK_OBJECT_SAFE_FREE(self->request);
+
+ /* DeInitialize base class */
+ tsip_transac_deinit(TSIP_TRANSAC(self));
+
+ TSK_DEBUG_INFO("*** NICT destroyed ***");
+ }
+ return _self;
}
static int tsip_transac_nict_cmp(const tsk_object_t *t1, const tsk_object_t *t2)
{
- return tsip_transac_cmp(t1, t2);
+ return tsip_transac_cmp(t1, t2);
}
-static const tsk_object_def_t tsip_transac_nict_def_s =
-{
- sizeof(tsip_transac_nict_t),
- tsip_transac_nict_ctor,
- tsip_transac_nict_dtor,
- tsip_transac_nict_cmp,
+static const tsk_object_def_t tsip_transac_nict_def_s = {
+ sizeof(tsip_transac_nict_t),
+ tsip_transac_nict_ctor,
+ tsip_transac_nict_dtor,
+ tsip_transac_nict_cmp,
};
const tsk_object_def_t *tsip_transac_nict_def_t = &tsip_transac_nict_def_s;
diff --git a/tinySIP/src/transactions/tsip_transac_nist.c b/tinySIP/src/transactions/tsip_transac_nist.c
index 66424b2..6c99c02 100755
--- a/tinySIP/src/transactions/tsip_transac_nist.c
+++ b/tinySIP/src/transactions/tsip_transac_nist.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -60,7 +60,7 @@
| | |
+-------------->| Terminated|
| |
- +-----------+
+ +-----------+
=============================================================================*/
@@ -104,183 +104,175 @@ int tsip_transac_nist_Any_2_Terminated_X_cancel(va_list *app); /* doubango-speci
/* ======================== conds ======================== */
/* ======================== actions ======================== */
-typedef enum _fsm_action_e
-{
- _fsm_action_cancel = tsip_atype_cancel,
-
- _fsm_action_request = 0xFF,
- _fsm_action_send_1xx,
- _fsm_action_send_200_to_699,
- _fsm_action_timerJ,
- _fsm_action_transporterror,
- _fsm_action_error,
+typedef enum _fsm_action_e {
+ _fsm_action_cancel = tsip_atype_cancel,
+
+ _fsm_action_request = 0xFF,
+ _fsm_action_send_1xx,
+ _fsm_action_send_200_to_699,
+ _fsm_action_timerJ,
+ _fsm_action_transporterror,
+ _fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
-typedef enum _fsm_state_e
-{
- _fsm_state_Started,
- _fsm_state_Trying,
- _fsm_state_Proceeding,
- _fsm_state_Completed,
- _fsm_state_Terminated
+typedef enum _fsm_state_e {
+ _fsm_state_Started,
+ _fsm_state_Trying,
+ _fsm_state_Proceeding,
+ _fsm_state_Completed,
+ _fsm_state_Terminated
}
_fsm_state_t;
int tsip_transac_nist_event_callback(const tsip_transac_nist_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
{
- int ret = -1;
-
- switch(type)
- {
- case tsip_transac_incoming_msg: /* From Transport Layer to Transaction Layer */
- {
- if(msg && TSIP_MESSAGE_IS_REQUEST(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_request, msg);
- }
- break;
- }
-
- case tsip_transac_outgoing_msg: /* From TU to Transport Layer */
- {
- if(msg && TSIP_MESSAGE_IS_RESPONSE(msg))
- {
- if(TSIP_RESPONSE_IS_1XX(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_1xx, msg);
- }
- else if(TSIP_RESPONSE_IS_23456(msg)){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_200_to_699, msg);
- }
- }
- break;
- }
-
- case tsip_transac_canceled:
- case tsip_transac_terminated:
- case tsip_transac_timedout:
- break;
-
- case tsip_transac_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
- break;
- }
-
- case tsip_transac_transport_error:
- {
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
- break;
- }
- }
-
- return ret;
+ int ret = -1;
+
+ switch(type) {
+ case tsip_transac_incoming_msg: { /* From Transport Layer to Transaction Layer */
+ if(msg && TSIP_MESSAGE_IS_REQUEST(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_request, msg);
+ }
+ break;
+ }
+
+ case tsip_transac_outgoing_msg: { /* From TU to Transport Layer */
+ if(msg && TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ if(TSIP_RESPONSE_IS_1XX(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_1xx, msg);
+ }
+ else if(TSIP_RESPONSE_IS_23456(msg)) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_send_200_to_699, msg);
+ }
+ }
+ break;
+ }
+
+ case tsip_transac_canceled:
+ case tsip_transac_terminated:
+ case tsip_transac_timedout:
+ break;
+
+ case tsip_transac_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_error, msg);
+ break;
+ }
+
+ case tsip_transac_transport_error: {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_transporterror, msg);
+ break;
+ }
+ }
+
+ return ret;
}
int tsip_transac_nist_timer_callback(const tsip_transac_nist_t* self, tsk_timer_id_t timer_id)
{
- int ret = -1;
+ int ret = -1;
- if(self){
- if(timer_id == self->timerJ.id){
- ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerJ, tsk_null);
- }
- }
+ if(self) {
+ if(timer_id == self->timerJ.id) {
+ ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_timerJ, tsk_null);
+ }
+ }
- return ret;
+ return ret;
}
int tsip_transac_nist_init(tsip_transac_nist_t *self)
{
- /* Initialize the state machine.
- */
- tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
-
- /*=======================
- * === Started ===
- */
- // Started -> (receive request) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_request, _fsm_state_Trying, tsip_transac_nist_Started_2_Trying_X_request, "tsip_transac_nist_Started_2_Trying_X_request"),
- // Started -> (Any other) -> Started
- TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nist_Started_2_Started_X_any"),
-
- /*=======================
- * === Trying ===
- */
- // Trying -> (receive request retransmission) -> Trying
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_request, _fsm_state_Trying, tsk_null, "tsip_transac_nist_Trying_2_Trying_X_request"),
- // Trying -> (send 1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Trying_2_Proceeding_X_send_1xx, "tsip_transac_nist_Trying_2_Proceeding_X_send_1xx"),
- // Trying -> (send 200 to 699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Trying_2_Completed_X_send_200_to_699, "tsip_transac_nist_Trying_2_Completed_X_send_200_to_699"),
-
- /*=======================
- * === Proceeding ===
- */
- // Proceeding -> (send 1xx) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx, "tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx"),
- // Proceeding -> (send 200 to 699) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699, "tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699"),
- // Proceeding -> (receive request) -> Proceeding
- TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_request, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_request, "tsip_transac_nist_Proceeding_2_Proceeding_X_request"),
-
- /*=======================
- * === Completed ===
- */
- // Completed -> (receive request) -> Completed
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_request, _fsm_state_Completed, tsip_transac_nist_Completed_2_Completed_X_request, "tsip_transac_nist_Completed_2_Completed_X_request"),
- // Completed -> (timer J) -> Terminated
- TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerJ, _fsm_state_Terminated, tsip_transac_nist_Completed_2_Terminated_X_tirmerJ, "tsip_transac_nist_Completed_2_Terminated_X_tirmerJ"),
-
- /*=======================
- * === Any ===
- */
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_transportError, "tsip_transac_nist_Any_2_Terminated_X_transportError"),
- // Any -> (transport error) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_Error, "tsip_transac_nist_Any_2_Terminated_X_Error"),
- // Any -> (cancel) -> Terminated
- TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_cancel, "tsip_transac_nist_Any_2_Terminated_X_cancel"),
-
- TSK_FSM_ADD_NULL());
-
- /* Set callback function to call when new messages arrive or errors happen at
- the transport layer.
- */
- TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_nist_event_callback);
-
- return 0;
+ /* Initialize the state machine.
+ */
+ tsk_fsm_set(TSIP_TRANSAC_GET_FSM(self),
+
+ /*=======================
+ * === Started ===
+ */
+ // Started -> (receive request) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_request, _fsm_state_Trying, tsip_transac_nist_Started_2_Trying_X_request, "tsip_transac_nist_Started_2_Trying_X_request"),
+ // Started -> (Any other) -> Started
+ TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nist_Started_2_Started_X_any"),
+
+ /*=======================
+ * === Trying ===
+ */
+ // Trying -> (receive request retransmission) -> Trying
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_request, _fsm_state_Trying, tsk_null, "tsip_transac_nist_Trying_2_Trying_X_request"),
+ // Trying -> (send 1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Trying_2_Proceeding_X_send_1xx, "tsip_transac_nist_Trying_2_Proceeding_X_send_1xx"),
+ // Trying -> (send 200 to 699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Trying_2_Completed_X_send_200_to_699, "tsip_transac_nist_Trying_2_Completed_X_send_200_to_699"),
+
+ /*=======================
+ * === Proceeding ===
+ */
+ // Proceeding -> (send 1xx) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx, "tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx"),
+ // Proceeding -> (send 200 to 699) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699, "tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699"),
+ // Proceeding -> (receive request) -> Proceeding
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_request, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_request, "tsip_transac_nist_Proceeding_2_Proceeding_X_request"),
+
+ /*=======================
+ * === Completed ===
+ */
+ // Completed -> (receive request) -> Completed
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_request, _fsm_state_Completed, tsip_transac_nist_Completed_2_Completed_X_request, "tsip_transac_nist_Completed_2_Completed_X_request"),
+ // Completed -> (timer J) -> Terminated
+ TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerJ, _fsm_state_Terminated, tsip_transac_nist_Completed_2_Terminated_X_tirmerJ, "tsip_transac_nist_Completed_2_Terminated_X_tirmerJ"),
+
+ /*=======================
+ * === Any ===
+ */
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_transportError, "tsip_transac_nist_Any_2_Terminated_X_transportError"),
+ // Any -> (transport error) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_Error, "tsip_transac_nist_Any_2_Terminated_X_Error"),
+ // Any -> (cancel) -> Terminated
+ TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_cancel, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_cancel, "tsip_transac_nist_Any_2_Terminated_X_cancel"),
+
+ TSK_FSM_ADD_NULL());
+
+ /* Set callback function to call when new messages arrive or errors happen at
+ the transport layer.
+ */
+ TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK_F(tsip_transac_nist_event_callback);
+
+ return 0;
}
tsip_transac_nist_t* tsip_transac_nist_create(int32_t cseq_value, const char* cseq_method, const char* callid, tsip_transac_dst_t* dst)
{
- tsip_transac_nist_t* transac = tsk_object_new(tsip_transac_nist_def_t);
-
- if(transac){
- // initialize base class
- tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_nist, cseq_value, cseq_method, callid, dst, _fsm_state_Started, _fsm_state_Terminated);
-
- // init FSM
- TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
- tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_nist_OnTerminated), (const void*)transac);
-
- // initialize NICT object
- tsip_transac_nist_init(transac);
- }
- return transac;
+ tsip_transac_nist_t* transac = tsk_object_new(tsip_transac_nist_def_t);
+
+ if(transac) {
+ // initialize base class
+ tsip_transac_init(TSIP_TRANSAC(transac), tsip_transac_type_nist, cseq_value, cseq_method, callid, dst, _fsm_state_Started, _fsm_state_Terminated);
+
+ // init FSM
+ TSIP_TRANSAC_GET_FSM(transac)->debug = DEBUG_STATE_MACHINE;
+ tsk_fsm_set_callback_terminated(TSIP_TRANSAC_GET_FSM(transac), TSK_FSM_ONTERMINATED_F(tsip_transac_nist_OnTerminated), (const void*)transac);
+
+ // initialize NICT object
+ tsip_transac_nist_init(transac);
+ }
+ return transac;
}
int tsip_transac_nist_start(tsip_transac_nist_t *self, const tsip_request_t* request)
{
- int ret = -1;
-
- if(self && !TSIP_TRANSAC(self)->running && request){
- TSIP_TRANSAC(self)->running = 1;
- if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_request, request))){
- //
- }
- }
- return ret;
+ int ret = -1;
+
+ if(self && !TSIP_TRANSAC(self)->running && request) {
+ TSIP_TRANSAC(self)->running = 1;
+ if((ret = tsip_transac_fsm_act(TSIP_TRANSAC(self), _fsm_action_request, request))) {
+ //
+ }
+ }
+ return ret;
}
@@ -299,206 +291,206 @@ int tsip_transac_nist_start(tsip_transac_nist_t *self, const tsip_request_t* req
*/
int tsip_transac_nist_Started_2_Trying_X_request(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
-
- if(TNET_SOCKET_TYPE_IS_VALID(request->src_net_type)){
- TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(request->src_net_type);
- }
-
- /* Set Timers */
- self->timerJ.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(J); /* RFC 3261 - 17.2.2*/
-
- /* RFC 3261 - 17.2.2
- The state machine is initialized in the "Trying" state and is passed
- a request other than INVITE or ACK when initialized. This request is
- passed up to the TU. Once in the "Trying" state, any further request
- retransmissions are discarded. A request is a retransmission if it
- matches the same server transaction, using the rules specified in
- Section 17.2.3.
- */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
+
+ if(TNET_SOCKET_TYPE_IS_VALID(request->src_net_type)) {
+ TSIP_TRANSAC(self)->reliable = TNET_SOCKET_TYPE_IS_STREAM(request->src_net_type);
+ }
+
+ /* Set Timers */
+ self->timerJ.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(J); /* RFC 3261 - 17.2.2*/
+
+ /* RFC 3261 - 17.2.2
+ The state machine is initialized in the "Trying" state and is passed
+ a request other than INVITE or ACK when initialized. This request is
+ passed up to the TU. Once in the "Trying" state, any further request
+ retransmissions are discarded. A request is a retransmission if it
+ matches the same server transaction, using the rules specified in
+ Section 17.2.3.
+ */
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_i_msg, request);
}
/* Trying --> (1xx) --> Proceeding
*/
int tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- /* RFC 3261 - 17.2.2
- While in the "Trying" state, if the TU passes a provisional response
- to the server transaction, the server transaction MUST enter the
- "Proceeding" state. The response MUST be passed to the transport
- layer for transmission.
- */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
-
- /* Update last response */
- TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
-
- return ret;
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ /* RFC 3261 - 17.2.2
+ While in the "Trying" state, if the TU passes a provisional response
+ to the server transaction, the server transaction MUST enter the
+ "Proceeding" state. The response MUST be passed to the transport
+ layer for transmission.
+ */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+
+ /* Update last response */
+ TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
+
+ return ret;
}
/* Trying --> (200-699) --> Completed
*/
int tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
- /* RFC 3261 - 17.2.2
- When the server transaction enters the "Completed" state, it MUST set
- Timer J to fire in 64*T1 seconds for unreliable transports, and zero
- seconds for reliable transports.
- */
- TRANSAC_NIST_TIMER_SCHEDULE(J);
+ /* RFC 3261 - 17.2.2
+ When the server transaction enters the "Completed" state, it MUST set
+ Timer J to fire in 64*T1 seconds for unreliable transports, and zero
+ seconds for reliable transports.
+ */
+ TRANSAC_NIST_TIMER_SCHEDULE(J);
- /* Update last response */
- TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
+ /* Update last response */
+ TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
- return ret;
+ return ret;
}
/* Proceeding --> (1xx) --> Proceeding
*/
int tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- /* RFC 3261 - 17.2.2
- Any further provisional responses that are
- received from the TU while in the "Proceeding" state MUST be passed
- to the transport layer for transmission.
- */
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+ /* RFC 3261 - 17.2.2
+ Any further provisional responses that are
+ received from the TU while in the "Proceeding" state MUST be passed
+ to the transport layer for transmission.
+ */
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
- /* Update last response */
- TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
+ /* Update last response */
+ TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
- return 0;
+ return 0;
}
/* Proceeding -> (INCOMING REQUEST) -> Proceeding
*/
int tsip_transac_nist_Proceeding_2_Proceeding_X_request(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
-
- /* RFC 3261 - 17.2.2
- If a retransmission of the request is received while in the "Proceeding" state, the most
- recently sent provisional response MUST be passed to the transport
- layer for retransmission.
- */
- if(self->lastResponse){
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
-
- return 0;
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+
+ /* RFC 3261 - 17.2.2
+ If a retransmission of the request is received while in the "Proceeding" state, the most
+ recently sent provisional response MUST be passed to the transport
+ layer for retransmission.
+ */
+ if(self->lastResponse) {
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+
+ return 0;
}
/* Proceeding --> (200-699) --> Completed
*/
int tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
- int ret;
-
- /* RFC 3261 - 17.2.2
- If the TU passes a final response (status
- codes 200-699) to the server while in the "Proceeding" state, the
- transaction MUST enter the "Completed" state, and the response MUST
- be passed to the transport layer for transmission.
- */
- ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
-
- /* RFC 3261 - 17.2.2
- When the server transaction enters the "Completed" state, it MUST set
- Timer J to fire in 64*T1 seconds for unreliable transports, and zero
- seconds for reliable transports.
- */
- TRANSAC_NIST_TIMER_SCHEDULE(J);
-
- /* Update last response */
- TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
-
- return ret;
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
+ int ret;
+
+ /* RFC 3261 - 17.2.2
+ If the TU passes a final response (status
+ codes 200-699) to the server while in the "Proceeding" state, the
+ transaction MUST enter the "Completed" state, and the response MUST
+ be passed to the transport layer for transmission.
+ */
+ ret = tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(response));
+
+ /* RFC 3261 - 17.2.2
+ When the server transaction enters the "Completed" state, it MUST set
+ Timer J to fire in 64*T1 seconds for unreliable transports, and zero
+ seconds for reliable transports.
+ */
+ TRANSAC_NIST_TIMER_SCHEDULE(J);
+
+ /* Update last response */
+ TRANSAC_NIST_SET_LAST_RESPONSE(self, response);
+
+ return ret;
}
/* Completed --> (INCOMING REQUEST) --> Completed
*/
int tsip_transac_nist_Completed_2_Completed_X_request(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
-
- /* RFC 3261 - 17.2.2
- While in the "Completed" state, the server transaction MUST pass the final response to the transport
- layer for retransmission whenever a retransmission of the request is received.
- */
- if(self->lastResponse){
- tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
- }
-
- return 0;
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+
+ /* RFC 3261 - 17.2.2
+ While in the "Completed" state, the server transaction MUST pass the final response to the transport
+ layer for retransmission whenever a retransmission of the request is received.
+ */
+ if(self->lastResponse) {
+ tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
+ }
+
+ return 0;
}
/* Complete --> (Timer J) --> Terminated
*/
int tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(va_list *app)
{
- /*tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);*/
- /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
-
- /* RFC 3261 - 17.2.2
- The server transaction remains in this state (Completed) until Timer J fires, at
- which point it MUST transition to the "Terminated" state.
- */
-
- /* RFC 3261 - 17.2.2
- THE SERVER TRANSACTION MUST BE DESTROYED THE INSTANT IT ENTERS THE "TERMINATED" STATE.
- */
- return 0;
+ /*tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);*/
+ /*const tsip_response_t *response = va_arg(*app, const tsip_response_t *);*/
+
+ /* RFC 3261 - 17.2.2
+ The server transaction remains in this state (Completed) until Timer J fires, at
+ which point it MUST transition to the "Terminated" state.
+ */
+
+ /* RFC 3261 - 17.2.2
+ THE SERVER TRANSACTION MUST BE DESTROYED THE INSTANT IT ENTERS THE "TERMINATED" STATE.
+ */
+ return 0;
}
/* Any -> (Transport Error) -> Terminated
*/
int tsip_transac_nist_Any_2_Terminated_X_transportError(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_transport_error, tsk_null);
}
/* Any -> (Error) -> Terminated
*/
int tsip_transac_nist_Any_2_Terminated_X_Error(va_list *app)
{
- tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
- //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
+ tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
+ //const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
- /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
+ /* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
- return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
+ return tsip_transac_deliver(TSIP_TRANSAC(self), tsip_dialog_error, tsk_null);
}
/* Any -> (cancel) -> Terminated
*/
int tsip_transac_nist_Any_2_Terminated_X_cancel(va_list *app)
{
- /* doubango-specific */
- return 0;
+ /* doubango-specific */
+ return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -513,10 +505,10 @@ int tsip_transac_nist_Any_2_Terminated_X_cancel(va_list *app)
*/
int tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self)
{
- TSK_DEBUG_INFO("=== NIST terminated ===");
-
- /* Remove (and destroy) the transaction from the layer. */
- return tsip_transac_remove(TSIP_TRANSAC(self));
+ TSK_DEBUG_INFO("=== NIST terminated ===");
+
+ /* Remove (and destroy) the transaction from the layer. */
+ return tsip_transac_remove(TSIP_TRANSAC(self));
}
@@ -544,40 +536,39 @@ int tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self)
//
static tsk_object_t* tsip_transac_nist_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transac_nist_t *transac = self;
- if(transac){
- }
- return self;
+ tsip_transac_nist_t *transac = self;
+ if(transac) {
+ }
+ return self;
}
static tsk_object_t* tsip_transac_nist_dtor(tsk_object_t * _self)
-{
- tsip_transac_nist_t *self = _self;
- if(self){
- /* Cancel timers */
- TRANSAC_TIMER_CANCEL(J);
+{
+ tsip_transac_nist_t *self = _self;
+ if(self) {
+ /* Cancel timers */
+ TRANSAC_TIMER_CANCEL(J);
- TSIP_TRANSAC(self)->running = tsk_false;
- TSK_OBJECT_SAFE_FREE(self->lastResponse);
+ TSIP_TRANSAC(self)->running = tsk_false;
+ TSK_OBJECT_SAFE_FREE(self->lastResponse);
- /* DeInitialize base class */
- tsip_transac_deinit(TSIP_TRANSAC(self));
+ /* DeInitialize base class */
+ tsip_transac_deinit(TSIP_TRANSAC(self));
- TSK_DEBUG_INFO("*** NIST destroyed ***");
- }
- return _self;
+ TSK_DEBUG_INFO("*** NIST destroyed ***");
+ }
+ return _self;
}
static int tsip_transac_nist_cmp(const tsk_object_t *t1, const tsk_object_t *t2)
{
- return tsip_transac_cmp(t1, t2);
+ return tsip_transac_cmp(t1, t2);
}
-static const tsk_object_def_t tsip_transac_nist_def_s =
-{
- sizeof(tsip_transac_nist_t),
- tsip_transac_nist_ctor,
- tsip_transac_nist_dtor,
- tsip_transac_nist_cmp,
+static const tsk_object_def_t tsip_transac_nist_def_s = {
+ sizeof(tsip_transac_nist_t),
+ tsip_transac_nist_ctor,
+ tsip_transac_nist_dtor,
+ tsip_transac_nist_cmp,
};
const tsk_object_def_t *tsip_transac_nist_def_t = &tsip_transac_nist_def_s;
diff --git a/tinySIP/src/transports/tsip_transport.c b/tinySIP/src/transports/tsip_transport.c
index f86f718..e9d2473 100755
--- a/tinySIP/src/transports/tsip_transport.c
+++ b/tinySIP/src/transports/tsip_transport.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -56,68 +56,67 @@
static const char* __null_callid = tsk_null;
-static const tsip_transport_idx_xt _tsip_transport_idxs_xs[TSIP_TRANSPORT_IDX_MAX] =
-{
- { TSIP_TRANSPORT_IDX_UDP, "UDP", TNET_SOCKET_TYPE_UDP },
- { TSIP_TRANSPORT_IDX_DTLS, "DTLS", TNET_SOCKET_TYPE_DTLS },
- { TSIP_TRANSPORT_IDX_TCP, "TCP", TNET_SOCKET_TYPE_TCP },
- { TSIP_TRANSPORT_IDX_TLS, "TLS", TNET_SOCKET_TYPE_TLS },
- { TSIP_TRANSPORT_IDX_WS, "WS", TNET_SOCKET_TYPE_WS },
- { TSIP_TRANSPORT_IDX_WSS, "WSS", TNET_SOCKET_TYPE_WSS },
+static const tsip_transport_idx_xt _tsip_transport_idxs_xs[TSIP_TRANSPORT_IDX_MAX] = {
+ { TSIP_TRANSPORT_IDX_UDP, "UDP", TNET_SOCKET_TYPE_UDP },
+ { TSIP_TRANSPORT_IDX_DTLS, "DTLS", TNET_SOCKET_TYPE_DTLS },
+ { TSIP_TRANSPORT_IDX_TCP, "TCP", TNET_SOCKET_TYPE_TCP },
+ { TSIP_TRANSPORT_IDX_TLS, "TLS", TNET_SOCKET_TYPE_TLS },
+ { TSIP_TRANSPORT_IDX_WS, "WS", TNET_SOCKET_TYPE_WS },
+ { TSIP_TRANSPORT_IDX_WSS, "WSS", TNET_SOCKET_TYPE_WSS },
};
const tsip_transport_idx_xt* tsip_transport_get_by_name(const char* name)
{
- int i;
- if(!name) {
- return tsk_null;
- }
- for(i = 0; i < TSIP_TRANSPORT_IDX_MAX; ++i) {
- if(tsk_striequals(_tsip_transport_idxs_xs[i].name, name)){
- return &_tsip_transport_idxs_xs[i];
- }
- }
- return tsk_null;
+ int i;
+ if(!name) {
+ return tsk_null;
+ }
+ for(i = 0; i < TSIP_TRANSPORT_IDX_MAX; ++i) {
+ if(tsk_striequals(_tsip_transport_idxs_xs[i].name, name)) {
+ return &_tsip_transport_idxs_xs[i];
+ }
+ }
+ return tsk_null;
}
// returns -1 if not exist
int tsip_transport_get_idx_by_name(const char* name)
{
- const tsip_transport_idx_xt* t_idx = tsip_transport_get_by_name(name);
- return t_idx ? t_idx->idx : -1;
+ const tsip_transport_idx_xt* t_idx = tsip_transport_get_by_name(name);
+ return t_idx ? t_idx->idx : -1;
}
enum tnet_socket_type_e tsip_transport_get_type_by_name(const char* name)
{
- const tsip_transport_idx_xt* t_idx = tsip_transport_get_by_name(name);
- return t_idx ? t_idx->type : tnet_socket_type_invalid;
+ const tsip_transport_idx_xt* t_idx = tsip_transport_get_by_name(name);
+ return t_idx ? t_idx->type : tnet_socket_type_invalid;
}
/*== Predicate function to find a peer by local id */
static int _pred_find_stream_peer_by_local_fd(const tsk_list_item_t *item, const void *local_fd)
{
- if(item && item->data){
- const tsip_transport_stream_peer_t *peer = (const tsip_transport_stream_peer_t*)item->data;
- return (peer->local_fd - *((tnet_fd_t*)local_fd));
- }
- return -1;
+ if(item && item->data) {
+ const tsip_transport_stream_peer_t *peer = (const tsip_transport_stream_peer_t*)item->data;
+ return (peer->local_fd - *((tnet_fd_t*)local_fd));
+ }
+ return -1;
}
/* creates new SIP transport */
tsip_transport_t* tsip_transport_create(tsip_stack_t* stack, const char* host, tnet_port_t port, tnet_socket_type_t type, const char* description)
{
- tsip_transport_t* transport;
- if((transport = tsk_object_new(tsip_transport_def_t, stack, host, port, type, description))){
- int i;
- for(i = 0; i < sizeof(_tsip_transport_idxs_xs)/sizeof(_tsip_transport_idxs_xs[0]); ++i){
- if(_tsip_transport_idxs_xs[i].type & type){
- transport->idx = _tsip_transport_idxs_xs[i].idx;
- break;
- }
- }
- }
- return transport;
+ tsip_transport_t* transport;
+ if((transport = tsk_object_new(tsip_transport_def_t, stack, host, port, type, description))) {
+ int i;
+ for(i = 0; i < sizeof(_tsip_transport_idxs_xs)/sizeof(_tsip_transport_idxs_xs[0]); ++i) {
+ if(_tsip_transport_idxs_xs[i].type & type) {
+ transport->idx = _tsip_transport_idxs_xs[i].idx;
+ break;
+ }
+ }
+ }
+ return transport;
}
/* add Via header using the transport config
@@ -125,866 +124,868 @@ must be called after update_aor()
*/
int tsip_transport_addvia(const tsip_transport_t* self, const char *branch, tsip_message_t *msg)
{
- tnet_ip_t ip = { '\0' };
- tnet_port_t port;
- int ret;
- int32_t transport_idx;
-
- if((transport_idx = tsip_transport_get_idx_by_name(self->protocol)) == -1){
- transport_idx = self->stack->network.transport_idx_default;
- }
-
- /* we always use same port to send() and recv() msg which means Via and Contact headers are identical */
- if(TNET_SOCKET_TYPE_IS_IPSEC(self->type) && ((tsip_transport_ipsec_t*)self)->asso_active){
- memcpy(ip, ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->ip, sizeof(tnet_ip_t));
- port = ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->port;
- }
- else if(self->stack->network.aor.ip[transport_idx] && self->stack->network.aor.port[transport_idx]){
- memcpy(ip, self->stack->network.aor.ip[transport_idx], TSK_MIN(tsk_strlen(self->stack->network.aor.ip[transport_idx]), sizeof(ip)));
- port = self->stack->network.aor.port[transport_idx];
- }
- else if((ret = tsip_transport_get_ip_n_port(self, &ip, &port))){
- return ret;
- }
-
- /* is there a Via header? */
- if(!msg->firstVia){
- /* RFC 3261 - 18.1.1 Sending Requests
- Before a request is sent, the client transport MUST insert a value of
- the "sent-by" field into the Via header field. This field contains
- an IP address or host name, and port. The usage of an FQDN is
- RECOMMENDED. This field is used for sending responses under certain
- conditions, described below. If the port is absent, the default
- value depends on the transport. It is 5060 for UDP, TCP and SCTP,
- 5061 for TLS.
- */
- msg->firstVia = tsip_header_Via_create(TSIP_HEADER_VIA_PROTO_NAME_DEFAULT, TSIP_HEADER_VIA_PROTO_VERSION_DEFAULT, self->via_protocol, ip, port);
- TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "rport", tsk_null);
- }
- else if(msg->update && self->stack->network.mode == tsip_stack_mode_webrtc2sip){
- if(TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type)){
- const tsip_transport_t* ws_transport = tsip_transport_layer_find_by_type(self->stack->layer_transport, msg->src_net_type);
- if(ws_transport){
- tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(ws_transport), msg->local_fd);
- if(peer){
- // hack the first Via as many servers fail to parse "WS" or "WSS" as valid transpors
- //if(tsk_striequals(msg->firstVia->transport, "WS") || tsk_striequals(msg->firstVia->transport, "WSS")){
- TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "ws-hacked", TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) ? "WSS" : "WS");
- tsk_strupdate(&msg->firstVia->transport, "TCP");
- tsk_strupdate(&msg->firstVia->host, peer->remote_ip);
- msg->firstVia->port = peer->remote_port;
- //}
- TSK_OBJECT_SAFE_FREE(peer);
-
- // replace first Via with ours
- tsip_message_add_header(msg, (const tsip_header_t *)msg->firstVia);
- TSK_OBJECT_SAFE_FREE(msg->firstVia);
- msg->firstVia = tsip_header_Via_create(TSIP_HEADER_VIA_PROTO_NAME_DEFAULT, TSIP_HEADER_VIA_PROTO_VERSION_DEFAULT, self->via_protocol, ip, port);
- TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "rport", tsk_null);
- }
- }
- }
- }
-
- /* updates the branch */
- if(branch){
- tsk_strupdate(&msg->firstVia->branch, branch);
- }
- else{ /* Probably ACK sent from Dialog Layer */
- TSK_FREE(msg->firstVia->branch);
- if((msg->firstVia->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))){
- tsk_istr_t _branch;
- tsk_strrandom(&_branch);
- tsk_strcat_2(&msg->firstVia->branch, "-%s", _branch);
- }
- }
-
- /* multicast case */
- if(tsk_false){
- /* RFC 3261 - 18.1.1 Sending Requests (FIXME)
- A client that sends a request to a multicast address MUST add the
- "maddr" parameter to its Via header field value containing the
- destination multicast address, and for IPv4, SHOULD add the "ttl"
- parameter with a value of 1. Usage of IPv6 multicast is not defined
- in this specification, and will be a subject of future
- standardization when the need arises.
- */
- }
-
- /*
- * comp=sigcomp; sigcomp-id=
- */
-
- return 0;
+ tnet_ip_t ip = { '\0' };
+ tnet_port_t port;
+ int ret;
+ int32_t transport_idx;
+
+ if((transport_idx = tsip_transport_get_idx_by_name(self->protocol)) == -1) {
+ transport_idx = self->stack->network.transport_idx_default;
+ }
+
+ /* we always use same port to send() and recv() msg which means Via and Contact headers are identical */
+ if(TNET_SOCKET_TYPE_IS_IPSEC(self->type) && ((tsip_transport_ipsec_t*)self)->asso_active) {
+ memcpy(ip, ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->ip, sizeof(tnet_ip_t));
+ port = ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->port;
+ }
+ else if(self->stack->network.aor.ip[transport_idx] && self->stack->network.aor.port[transport_idx]) {
+ memcpy(ip, self->stack->network.aor.ip[transport_idx], TSK_MIN(tsk_strlen(self->stack->network.aor.ip[transport_idx]), sizeof(ip)));
+ port = self->stack->network.aor.port[transport_idx];
+ }
+ else if((ret = tsip_transport_get_ip_n_port(self, &ip, &port))) {
+ return ret;
+ }
+
+ /* is there a Via header? */
+ if(!msg->firstVia) {
+ /* RFC 3261 - 18.1.1 Sending Requests
+ Before a request is sent, the client transport MUST insert a value of
+ the "sent-by" field into the Via header field. This field contains
+ an IP address or host name, and port. The usage of an FQDN is
+ RECOMMENDED. This field is used for sending responses under certain
+ conditions, described below. If the port is absent, the default
+ value depends on the transport. It is 5060 for UDP, TCP and SCTP,
+ 5061 for TLS.
+ */
+ msg->firstVia = tsip_header_Via_create(TSIP_HEADER_VIA_PROTO_NAME_DEFAULT, TSIP_HEADER_VIA_PROTO_VERSION_DEFAULT, self->via_protocol, ip, port);
+ TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "rport", tsk_null);
+ }
+ else if(msg->update && self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
+ if(TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type)) {
+ const tsip_transport_t* ws_transport = tsip_transport_layer_find_by_type(self->stack->layer_transport, msg->src_net_type);
+ if(ws_transport) {
+ tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(ws_transport), msg->local_fd);
+ if(peer) {
+ // hack the first Via as many servers fail to parse "WS" or "WSS" as valid transpors
+ //if(tsk_striequals(msg->firstVia->transport, "WS") || tsk_striequals(msg->firstVia->transport, "WSS")){
+ TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "ws-hacked", TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) ? "WSS" : "WS");
+ tsk_strupdate(&msg->firstVia->transport, "TCP");
+ tsk_strupdate(&msg->firstVia->host, peer->remote_ip);
+ msg->firstVia->port = peer->remote_port;
+ //}
+ TSK_OBJECT_SAFE_FREE(peer);
+
+ // replace first Via with ours
+ tsip_message_add_header(msg, (const tsip_header_t *)msg->firstVia);
+ TSK_OBJECT_SAFE_FREE(msg->firstVia);
+ msg->firstVia = tsip_header_Via_create(TSIP_HEADER_VIA_PROTO_NAME_DEFAULT, TSIP_HEADER_VIA_PROTO_VERSION_DEFAULT, self->via_protocol, ip, port);
+ TSIP_HEADER_ADD_PARAM(TSIP_HEADER(msg->firstVia), "rport", tsk_null);
+ }
+ }
+ }
+ }
+
+ /* updates the branch */
+ if(branch) {
+ tsk_strupdate(&msg->firstVia->branch, branch);
+ }
+ else { /* Probably ACK sent from Dialog Layer */
+ TSK_FREE(msg->firstVia->branch);
+ if((msg->firstVia->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE))) {
+ tsk_istr_t _branch;
+ tsk_strrandom(&_branch);
+ tsk_strcat_2(&msg->firstVia->branch, "-%s", _branch);
+ }
+ }
+
+ /* multicast case */
+ if(tsk_false) {
+ /* RFC 3261 - 18.1.1 Sending Requests (FIXME)
+ A client that sends a request to a multicast address MUST add the
+ "maddr" parameter to its Via header field value containing the
+ destination multicast address, and for IPv4, SHOULD add the "ttl"
+ parameter with a value of 1. Usage of IPv6 multicast is not defined
+ in this specification, and will be a subject of future
+ standardization when the need arises.
+ */
+ }
+
+ /*
+ * comp=sigcomp; sigcomp-id=
+ */
+
+ return 0;
}
int tsip_transport_msg_update_aor(tsip_transport_t* self, tsip_message_t *msg)
{
- int ret = 0;
- int32_t transport_idx;
-
- /* already updtated (e.g. retrans)? */
- if(!msg->update){
- return 0;
- }
-
- if((transport_idx = tsip_transport_get_idx_by_name(self->protocol)) == -1){
- transport_idx = self->stack->network.transport_idx_default;
- }
-
- /* retrieves the transport ip address and port */
- if(!self->stack->network.aor.ip[transport_idx] && !self->stack->network.aor.port[transport_idx]){
- tnet_ip_t ip = {0};
- tnet_port_t port = 0;
-
- if((ret = tsip_transport_get_public_ip_n_port(self, &ip, &port))){
- TSK_DEBUG_ERROR("Failed to get public IP");
- return ret;
- }
- else{
- ((tsip_stack_t*)self->stack)->network.aor.ip[transport_idx] = tsk_strdup(ip);
- ((tsip_stack_t*)self->stack)->network.aor.port[transport_idx] = port;
- }
- }
-
- /* === Host and port === */
- if(msg->Contact && msg->Contact->uri){
- tsk_strupdate(&(msg->Contact->uri->scheme), self->scheme);
- msg->Contact->uri->host_type = TNET_SOCKET_TYPE_IS_IPV6(self->type) ? host_ipv6 : host_ipv4; /* for serializer ...who know? */
- tsk_params_add_param(&msg->Contact->uri->params, "transport", self->protocol);
-
- // IPSec
- if(TNET_SOCKET_TYPE_IS_IPSEC(self->type) && ((tsip_transport_ipsec_t*)self)->asso_active){
- tsk_strupdate(&(msg->Contact->uri->host), ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->ip);
- msg->Contact->uri->port = ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->port;
- }
- else {
- tsk_strupdate(&(msg->Contact->uri->host), self->stack->network.aor.ip[transport_idx]);
- msg->Contact->uri->port = self->stack->network.aor.port[transport_idx];
- }
-
- /* Add extra params for message received over WebSocket transport */
- if((TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type)) && msg->local_fd > 0){
- tnet_ip_t ws_src_ip;
- tnet_port_t ws_src_port;
- if(tnet_get_ip_n_port(msg->local_fd, tsk_false/*remote*/, &ws_src_ip, &ws_src_port) == 0){
- tsk_params_add_param(&msg->Contact->uri->params, "ws-src-ip", ws_src_ip);
- tsk_params_add_param_3(&msg->Contact->uri->params, "ws-src-port", (int64_t)ws_src_port);
- tsk_params_add_param(&msg->Contact->uri->params, "ws-src-proto", TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) ? "ws" : "wss");
- }
- }
- }
-
- return 0;
+ int ret = 0;
+ int32_t transport_idx;
+
+ /* already updtated (e.g. retrans)? */
+ if(!msg->update) {
+ return 0;
+ }
+
+ if((transport_idx = tsip_transport_get_idx_by_name(self->protocol)) == -1) {
+ transport_idx = self->stack->network.transport_idx_default;
+ }
+
+ /* retrieves the transport ip address and port */
+ if(!self->stack->network.aor.ip[transport_idx] && !self->stack->network.aor.port[transport_idx]) {
+ tnet_ip_t ip = {0};
+ tnet_port_t port = 0;
+
+ if((ret = tsip_transport_get_public_ip_n_port(self, &ip, &port))) {
+ TSK_DEBUG_ERROR("Failed to get public IP");
+ return ret;
+ }
+ else {
+ ((tsip_stack_t*)self->stack)->network.aor.ip[transport_idx] = tsk_strdup(ip);
+ ((tsip_stack_t*)self->stack)->network.aor.port[transport_idx] = port;
+ }
+ }
+
+ /* === Host and port === */
+ if(msg->Contact && msg->Contact->uri) {
+ tsk_strupdate(&(msg->Contact->uri->scheme), self->scheme);
+ msg->Contact->uri->host_type = TNET_SOCKET_TYPE_IS_IPV6(self->type) ? host_ipv6 : host_ipv4; /* for serializer ...who know? */
+ tsk_params_add_param(&msg->Contact->uri->params, "transport", self->protocol);
+
+ // IPSec
+ if(TNET_SOCKET_TYPE_IS_IPSEC(self->type) && ((tsip_transport_ipsec_t*)self)->asso_active) {
+ tsk_strupdate(&(msg->Contact->uri->host), ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->ip);
+ msg->Contact->uri->port = ((tsip_transport_ipsec_t*)self)->asso_active->socket_us->port;
+ }
+ else {
+ tsk_strupdate(&(msg->Contact->uri->host), self->stack->network.aor.ip[transport_idx]);
+ msg->Contact->uri->port = self->stack->network.aor.port[transport_idx];
+ }
+
+ /* Add extra params for message received over WebSocket transport */
+ if((TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type)) && msg->local_fd > 0) {
+ tnet_ip_t ws_src_ip;
+ tnet_port_t ws_src_port;
+ if(tnet_get_ip_n_port(msg->local_fd, tsk_false/*remote*/, &ws_src_ip, &ws_src_port) == 0) {
+ tsk_params_add_param(&msg->Contact->uri->params, "ws-src-ip", ws_src_ip);
+ tsk_params_add_param_3(&msg->Contact->uri->params, "ws-src-port", (int64_t)ws_src_port);
+ tsk_params_add_param(&msg->Contact->uri->params, "ws-src-proto", TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) ? "ws" : "wss");
+ }
+ }
+ }
+
+ return 0;
}
/* update the entire message (IPSec headers, SigComp, ....) */
int tsip_transport_msg_update(const tsip_transport_t* self, tsip_message_t *msg)
{
- int ret = 0;
-
- /* already updtated (e.g. retrans)? */
- if(!msg->update){
- return 0;
- }
-
- /* === IPSec headers (Security-Client, Security-Verify, Sec-Agree ...) === */
- if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)){
- ret = tsip_transport_ipsec_updateMSG(TSIP_TRANSPORT_IPSEC(self), msg);
- }
-
- /* === SigComp === */
- if(msg->sigcomp_id){
- /* Via */
- if(msg->firstVia){
- char* quoted_id = tsk_null;
- TSIP_HEADER_ADD_PARAM(msg->firstVia, "comp", "sigcomp");
- tsk_sprintf(&quoted_id, "\"%s\"", msg->sigcomp_id);
- TSIP_HEADER_ADD_PARAM(msg->firstVia, "sigcomp-id", quoted_id);
- TSK_FREE(quoted_id);
- }
- /* Contact */
- if(msg->Contact && msg->Contact->uri){
- tsk_params_add_param(&msg->Contact->uri->params, "sigcomp-id", msg->sigcomp_id);
- }
- }
- /* === WebRTC2SIP === */
- if(TSIP_MESSAGE_IS_REQUEST(msg)) {
- if(self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
- // Request Uri (Fix: https://code.google.com/p/webrtc2sip/issues/detail?id=56)
- if(tsk_params_have_param(msg->line.request.uri->params, "transport")){
- tsk_params_add_param(&msg->line.request.uri->params, "transport", self->protocol);
- }
- }
- }
-
-
- msg->update = tsk_false; /* To avoid to update retrans. */
-
- return ret;
+ int ret = 0;
+
+ /* already updtated (e.g. retrans)? */
+ if(!msg->update) {
+ return 0;
+ }
+
+ /* === IPSec headers (Security-Client, Security-Verify, Sec-Agree ...) === */
+ if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)) {
+ ret = tsip_transport_ipsec_updateMSG(TSIP_TRANSPORT_IPSEC(self), msg);
+ }
+
+ /* === SigComp === */
+ if(msg->sigcomp_id) {
+ /* Via */
+ if(msg->firstVia) {
+ char* quoted_id = tsk_null;
+ TSIP_HEADER_ADD_PARAM(msg->firstVia, "comp", "sigcomp");
+ tsk_sprintf(&quoted_id, "\"%s\"", msg->sigcomp_id);
+ TSIP_HEADER_ADD_PARAM(msg->firstVia, "sigcomp-id", quoted_id);
+ TSK_FREE(quoted_id);
+ }
+ /* Contact */
+ if(msg->Contact && msg->Contact->uri) {
+ tsk_params_add_param(&msg->Contact->uri->params, "sigcomp-id", msg->sigcomp_id);
+ }
+ }
+ /* === WebRTC2SIP === */
+ if(TSIP_MESSAGE_IS_REQUEST(msg)) {
+ if(self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
+ // Request Uri (Fix: https://code.google.com/p/webrtc2sip/issues/detail?id=56)
+ if(tsk_params_have_param(msg->line.request.uri->params, "transport")) {
+ tsk_params_add_param(&msg->line.request.uri->params, "transport", self->protocol);
+ }
+ }
+ }
+
+
+ msg->update = tsk_false; /* To avoid to update retrans. */
+
+ return ret;
}
// "udp", "tcp" or "tls"
tsk_size_t tsip_transport_send_raw(const tsip_transport_t* self, const char* dst_host, tnet_port_t dst_port, const void* data, tsk_size_t size, const char* callid)
{
- tsk_size_t ret = 0;
-
- TSK_DEBUG_INFO("\n\nSEND: %.*s\n\n", size, (const char*)data);
-
- if(TNET_SOCKET_TYPE_IS_DGRAM(self->type)){// "udp" or "dtls"
- const struct sockaddr_storage* to = &self->pcscf_addr;
- struct sockaddr_storage dst_addr; // must be local scope
- if(!tsk_strnullORempty(dst_host) && dst_port){
- if(tnet_sockaddr_init(dst_host, dst_port, self->type, &dst_addr) == 0){
- to = &dst_addr;
- }
- }
- if(!(ret = tnet_transport_sendto(self->net_transport, self->connectedFD, (const struct sockaddr*)to, data, size))){
- TSK_DEBUG_ERROR("Send(%u) returns zero", size);
- }
- }
- else{// "sctp", "tcp" or "tls"
- tsip_transport_stream_peer_t* peer = tsk_null;
- tnet_ip_t dst_ip;
-
- if(tsk_strnullORempty(dst_host) || !dst_port){
- if(tnet_get_sockip_n_port((const struct sockaddr *)&self->pcscf_addr, &dst_ip, &dst_port) != 0){
- TSK_DEBUG_ERROR("Failed to get Proxy-CSCF IP address and port");
- return 0;
- }
- }
- else{
- // get IP address and port
- // we use ip/port instead of fqdn because this what "tsip_transport_add_stream_peer()" requires it
- if(tnet_resolve(dst_host, dst_port, self->type, &dst_ip, &dst_port) != 0){
- TSK_DEBUG_ERROR("Failed to resolve(%s/%d)", dst_host, dst_port);
- return 0;
- }
- }
-
- if(!(peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(self), dst_ip, dst_port, self->type))){
- tnet_fd_t fd;
- TSK_DEBUG_INFO("Cannot find peer with remote IP/Port=%s/%d, connecting to the destination...", dst_ip, dst_port);
- // connect to the destination
+ tsk_size_t ret = 0;
+
+ TSK_DEBUG_INFO("\n\nSEND: %.*s\n\n", size, (const char*)data);
+
+ if(TNET_SOCKET_TYPE_IS_DGRAM(self->type)) { // "udp" or "dtls"
+ const struct sockaddr_storage* to = &self->pcscf_addr;
+ struct sockaddr_storage dst_addr; // must be local scope
+ if(!tsk_strnullORempty(dst_host) && dst_port) {
+ if(tnet_sockaddr_init(dst_host, dst_port, self->type, &dst_addr) == 0) {
+ to = &dst_addr;
+ }
+ }
+ if(!(ret = tnet_transport_sendto(self->net_transport, self->connectedFD, (const struct sockaddr*)to, data, size))) {
+ TSK_DEBUG_ERROR("Send(%u) returns zero", size);
+ }
+ }
+ else { // "sctp", "tcp" or "tls"
+ tsip_transport_stream_peer_t* peer = tsk_null;
+ tnet_ip_t dst_ip;
+
+ if(tsk_strnullORempty(dst_host) || !dst_port) {
+ if(tnet_get_sockip_n_port((const struct sockaddr *)&self->pcscf_addr, &dst_ip, &dst_port) != 0) {
+ TSK_DEBUG_ERROR("Failed to get Proxy-CSCF IP address and port");
+ return 0;
+ }
+ }
+ else {
+ // get IP address and port
+ // we use ip/port instead of fqdn because this what "tsip_transport_add_stream_peer()" requires it
+ if(tnet_resolve(dst_host, dst_port, self->type, &dst_ip, &dst_port) != 0) {
+ TSK_DEBUG_ERROR("Failed to resolve(%s/%d)", dst_host, dst_port);
+ return 0;
+ }
+ }
+
+ if(!(peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(self), dst_ip, dst_port, self->type))) {
+ tnet_fd_t fd;
+ TSK_DEBUG_INFO("Cannot find peer with remote IP/Port=%s/%d, connecting to the destination...", dst_ip, dst_port);
+ // connect to the destination
// stream with the new "fd" will be added later, make sure that no other thread (e.g. network callback) will manipulate the peers
tsip_transport_stream_peers_lock(TSIP_TRANSPORT(self));
- if((fd = tnet_transport_connectto_2(TSIP_TRANSPORT(self)->net_transport, dst_ip, dst_port)) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect to %s/%d", dst_ip, dst_port);
+ if((fd = tnet_transport_connectto_2(TSIP_TRANSPORT(self)->net_transport, dst_ip, dst_port)) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect to %s/%d", dst_ip, dst_port);
tsip_transport_stream_peers_unlock(TSIP_TRANSPORT(self));
- return 0;
- }
+ return 0;
+ }
// only clients will have connected fd == EVAL. For servers, it will be equal to master's fd
// connected fd value will be set to EVAL when "disconnected" event is received
if (TSIP_TRANSPORT(self)->connectedFD == TNET_INVALID_FD) {
TSIP_TRANSPORT(self)->connectedFD = fd;
}
-
- if(tsip_transport_add_stream_peer_2(TSIP_TRANSPORT(self), fd, self->type, tsk_false, dst_ip, dst_port) != 0){
- TSK_DEBUG_ERROR("Failed to add stream peer local fd = %d, remote IP/Port=%s/%d", fd, dst_ip, dst_port);
+
+ if(tsip_transport_add_stream_peer_2(TSIP_TRANSPORT(self), fd, self->type, tsk_false, dst_ip, dst_port) != 0) {
+ TSK_DEBUG_ERROR("Failed to add stream peer local fd = %d, remote IP/Port=%s/%d", fd, dst_ip, dst_port);
tsip_transport_stream_peers_unlock(TSIP_TRANSPORT(self));
- return 0;
- }
+ return 0;
+ }
tsip_transport_stream_peers_unlock(TSIP_TRANSPORT(self));
-
- // retrieve the peer
- if(!(peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(self), fd))){
- TSK_DEBUG_INFO("Cannot find peer with remote IP/Port=%s/%d. Cancel data sending", dst_ip, dst_port);
- return 0;
- }
- }
- // store call-id
- if(callid != __null_callid && tsip_dialog_layer_have_dialog_with_callid(self->stack->layer_dialog, callid)){
- ret = tsip_transport_stream_peer_add_callid(peer, callid);
- }
- // send() data
- if(peer->connected){
- ret = tnet_transport_send(self->net_transport, peer->local_fd, data, size);
- }
- else{
- TSK_DEBUG_INFO("Data send requested but peer not connected yet...saving data");
- tsk_buffer_append(peer->snd_buff_stream, data, size);
- ret = 0; // nothing sent
- }
- TSK_OBJECT_SAFE_FREE(peer);
- }
-
- return ret;
+
+ // retrieve the peer
+ if(!(peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(self), fd))) {
+ TSK_DEBUG_INFO("Cannot find peer with remote IP/Port=%s/%d. Cancel data sending", dst_ip, dst_port);
+ return 0;
+ }
+ }
+ // store call-id
+ if(callid != __null_callid && tsip_dialog_layer_have_dialog_with_callid(self->stack->layer_dialog, callid)) {
+ ret = tsip_transport_stream_peer_add_callid(peer, callid);
+ }
+ // send() data
+ if(peer->connected) {
+ ret = tnet_transport_send(self->net_transport, peer->local_fd, data, size);
+ }
+ else {
+ TSK_DEBUG_INFO("Data send requested but peer not connected yet...saving data");
+ tsk_buffer_append(peer->snd_buff_stream, data, size);
+ ret = 0; // nothing sent
+ }
+ TSK_OBJECT_SAFE_FREE(peer);
+ }
+
+ return ret;
}
// "ws" or "wss"
tsk_size_t tsip_transport_send_raw_ws(const tsip_transport_t* self, tnet_fd_t local_fd, const void* data, tsk_size_t size, const char* callid)
{
- /*static const uint8_t __ws_first_byte = 0x82;*/
- const uint8_t* pdata = (const uint8_t*)data;
- uint64_t data_size = 1 + 1 + size;
- uint64_t lsize = (uint64_t)size;
- uint8_t* pws_snd_buffer;
- tsip_transport_stream_peer_t* peer;
- tsk_size_t ret;
-
- if(!(peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(self), local_fd))){
- TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", local_fd);
- return 0;
- }
-
- if(lsize > 0x7D && lsize <= 0xFFFF){
- data_size += 2;
- }
- else if(lsize > 0xFFFF){
- data_size += 8;
- }
- if(peer->ws.snd_buffer_size < data_size){
- if(!(peer->ws.snd_buffer = tsk_realloc(peer->ws.snd_buffer, (tsk_size_t)data_size))){
- TSK_DEBUG_ERROR("Failed to allocate buffer with size = %llu", data_size);
- peer->ws.snd_buffer_size = 0;
- TSK_OBJECT_SAFE_FREE(peer);
- return 0;
- }
- peer->ws.snd_buffer_size = data_size;
- }
- pws_snd_buffer = (uint8_t*)peer->ws.snd_buffer;
-
- pws_snd_buffer[0] = 0x82;
- if(lsize <= 0x7D){
- pws_snd_buffer[1] = (uint8_t)lsize;
- pws_snd_buffer = &pws_snd_buffer[2];
- }
- else if(lsize <= 0xFFFF){
- pws_snd_buffer[1] = 0x7E;
- pws_snd_buffer[2] = (lsize >> 8) & 0xFF;
- pws_snd_buffer[3] = (lsize & 0xFF);
- pws_snd_buffer = &pws_snd_buffer[4];
- }
- else{
- pws_snd_buffer[1] = 0x7F;
- pws_snd_buffer[2] = (lsize >> 56) & 0xFF;
- pws_snd_buffer[3] = (lsize >> 48) & 0xFF;
- pws_snd_buffer[4] = (lsize >> 40) & 0xFF;
- pws_snd_buffer[5] = (lsize >> 32) & 0xFF;
- pws_snd_buffer[6] = (lsize >> 24) & 0xFF;
- pws_snd_buffer[7] = (lsize >> 16) & 0xFF;
- pws_snd_buffer[8] = (lsize >> 8) & 0xFF;
- pws_snd_buffer[9] = (lsize & 0xFF);
- pws_snd_buffer = &pws_snd_buffer[10];
- }
-
- memcpy(pws_snd_buffer, pdata, (size_t)lsize);
-
- // store call-id
- if(callid != __null_callid && tsip_dialog_layer_have_dialog_with_callid(self->stack->layer_dialog, callid)){
- ret = tsip_transport_stream_peer_add_callid(peer, callid);
- }
- // send() data
- ret = tnet_transport_send(self->net_transport, local_fd, peer->ws.snd_buffer, (tsk_size_t)data_size);
-
- TSK_OBJECT_SAFE_FREE(peer);
-
- return ret;
+ /*static const uint8_t __ws_first_byte = 0x82;*/
+ const uint8_t* pdata = (const uint8_t*)data;
+ uint64_t data_size = 1 + 1 + size;
+ uint64_t lsize = (uint64_t)size;
+ uint8_t* pws_snd_buffer;
+ tsip_transport_stream_peer_t* peer;
+ tsk_size_t ret;
+
+ if(!(peer = tsip_transport_find_stream_peer_by_local_fd(TSIP_TRANSPORT(self), local_fd))) {
+ TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", local_fd);
+ return 0;
+ }
+
+ if(lsize > 0x7D && lsize <= 0xFFFF) {
+ data_size += 2;
+ }
+ else if(lsize > 0xFFFF) {
+ data_size += 8;
+ }
+ if(peer->ws.snd_buffer_size < data_size) {
+ if(!(peer->ws.snd_buffer = tsk_realloc(peer->ws.snd_buffer, (tsk_size_t)data_size))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer with size = %llu", data_size);
+ peer->ws.snd_buffer_size = 0;
+ TSK_OBJECT_SAFE_FREE(peer);
+ return 0;
+ }
+ peer->ws.snd_buffer_size = data_size;
+ }
+ pws_snd_buffer = (uint8_t*)peer->ws.snd_buffer;
+
+ pws_snd_buffer[0] = 0x82;
+ if(lsize <= 0x7D) {
+ pws_snd_buffer[1] = (uint8_t)lsize;
+ pws_snd_buffer = &pws_snd_buffer[2];
+ }
+ else if(lsize <= 0xFFFF) {
+ pws_snd_buffer[1] = 0x7E;
+ pws_snd_buffer[2] = (lsize >> 8) & 0xFF;
+ pws_snd_buffer[3] = (lsize & 0xFF);
+ pws_snd_buffer = &pws_snd_buffer[4];
+ }
+ else {
+ pws_snd_buffer[1] = 0x7F;
+ pws_snd_buffer[2] = (lsize >> 56) & 0xFF;
+ pws_snd_buffer[3] = (lsize >> 48) & 0xFF;
+ pws_snd_buffer[4] = (lsize >> 40) & 0xFF;
+ pws_snd_buffer[5] = (lsize >> 32) & 0xFF;
+ pws_snd_buffer[6] = (lsize >> 24) & 0xFF;
+ pws_snd_buffer[7] = (lsize >> 16) & 0xFF;
+ pws_snd_buffer[8] = (lsize >> 8) & 0xFF;
+ pws_snd_buffer[9] = (lsize & 0xFF);
+ pws_snd_buffer = &pws_snd_buffer[10];
+ }
+
+ memcpy(pws_snd_buffer, pdata, (size_t)lsize);
+
+ // store call-id
+ if(callid != __null_callid && tsip_dialog_layer_have_dialog_with_callid(self->stack->layer_dialog, callid)) {
+ ret = tsip_transport_stream_peer_add_callid(peer, callid);
+ }
+ // send() data
+ ret = tnet_transport_send(self->net_transport, local_fd, peer->ws.snd_buffer, (tsk_size_t)data_size);
+
+ TSK_OBJECT_SAFE_FREE(peer);
+
+ return ret;
}
-/* sends a request
+/* sends a request
* all callers of this function should provide a sigcomp-id
*/
tsk_size_t tsip_transport_send(const tsip_transport_t* self, const char *branch, tsip_message_t *msg, const char* destIP, int32_t destPort)
{
- tsk_size_t ret = 0;
- if(self){
- tsk_buffer_t *buffer = tsk_null;
- const char* callid = msg->Call_ID ? msg->Call_ID->value : __null_callid;
-
- /* Add Via and update AOR, IPSec headers, SigComp ...
- * ACK sent from the transaction layer will contains a Via header and should not be updated
- * CANCEL will have the same Via and Contact headers as the request it cancel
- * Any request received from WS/WSS transport layer have to be updated regardless above rules
- */
- if(TSIP_MESSAGE_IS_REQUEST(msg)){
- const tsk_bool_t update = ( (!TSIP_REQUEST_IS_ACK(msg) || (TSIP_REQUEST_IS_ACK(msg) && !msg->firstVia)) && !TSIP_REQUEST_IS_CANCEL(msg) )
- || ( TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) );
- if(update){
- /* AoR: Contact header */
- tsip_transport_msg_update_aor((tsip_transport_t*)self, msg);
- /* should be done before tsip_transport_msg_update() which could use the Via header
- must be done after update_aor()
- */
- tsip_transport_addvia(self, branch, msg);
- tsip_transport_msg_update(self, msg); /* IPSec, SigComp, ... */
- }
- }
- else if(TSIP_MESSAGE_IS_RESPONSE(msg)){
- /* AoR for responses which have a contact header (e.g. 183/200 INVITE) */
- if(msg->Contact){
- tsip_transport_msg_update_aor((tsip_transport_t*)self, msg);
- }
- /* RFC 3581 - 4. Server Behavior
- When a server compliant to this specification (which can be a proxy
- or UAS) receives a request, it examines the topmost Via header field
- value. If this Via header field value contains an "rport" parameter
- with no value, it MUST set the value of the parameter to the source
- port of the request.
- */
- if(msg->firstVia->rport == 0){
- /* As the response message has been built from the request ...then it's first via is the same as
- the request's first via.
- */
- msg->firstVia->rport = msg->firstVia->port;
- }
- }
-
- if((buffer = tsk_buffer_create_null())){
- tsip_message_tostring(msg, buffer);
-
- if(buffer->size >1300){
- /* RFC 3261 - 18.1.1 Sending Requests (FIXME)
- If a request is within 200 bytes of the path MTU, or if it is larger
- than 1300 bytes and the path MTU is unknown, the request MUST be sent
- using an RFC 2914 [43] congestion controlled transport protocol, such
- as TCP. If this causes a change in the transport protocol from the
- one indicated in the top Via, the value in the top Via MUST be
- changed. This prevents fragmentation of messages over UDP and
- provides congestion control for larger messages. However,
- implementations MUST be able to handle messages up to the maximum
- datagram packet size. For UDP, this size is 65,535 bytes, including
- IP and UDP headers.
- */
- }
-
- /* === SigComp === */
- if(msg->sigcomp_id){
- if(self->stack->sigcomp.handle){
- tsk_size_t out_size;
- char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
-
- out_size = tsip_sigcomp_handler_compress(self->stack->sigcomp.handle, msg->sigcomp_id, TNET_SOCKET_TYPE_IS_STREAM(self->type),
- buffer->data, buffer->size, SigCompBuffer, sizeof(SigCompBuffer));
- if(out_size){
- tsk_buffer_cleanup(buffer);
- tsk_buffer_append(buffer, SigCompBuffer, out_size);
- }
- }
- else{
- TSK_DEBUG_ERROR("The outgoing message should be compressed using SigComp but there is not compartment");
- }
- }
-
- /* === Send the message === */
- if(TNET_SOCKET_TYPE_IS_WS(self->type) || TNET_SOCKET_TYPE_IS_WSS(self->type)){
- //if(!TNET_SOCKET_TYPE_IS_WS(msg->net_type) && !TNET_SOCKET_TYPE_IS_WSS(msg->net_type)){
- // message not received over WS/WS tranport but have to be sent over WS/WS
- tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(self), destIP, destPort, self->type);
- if(peer){
- ret = tsip_transport_send_raw_ws(self, peer->local_fd, buffer->data, buffer->size, callid);
- TSK_OBJECT_SAFE_FREE(peer);
- }
- else if(msg->local_fd > 0)
- //}
- //else{
- ret = tsip_transport_send_raw_ws(self, msg->local_fd, buffer->data, buffer->size, callid);
- //}
- }
- else if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)){
- tnet_fd_t fd = tsip_transport_ipsec_getFD(TSIP_TRANSPORT_IPSEC(self), TSIP_MESSAGE_IS_REQUEST(msg));
- // "fd == TNET_INVALID_FD" means IPSec SAs not up yet
- ret = (fd != TNET_INVALID_FD)
- ? tnet_sockfd_send(fd, buffer->data, buffer->size, 0)
- : tsip_transport_send_raw(self, destIP, destPort, buffer->data, buffer->size, callid);
- }
- else{
- ret = tsip_transport_send_raw(self, destIP, destPort, buffer->data, buffer->size, callid);
- }
+ tsk_size_t ret = 0;
+ if(self) {
+ tsk_buffer_t *buffer = tsk_null;
+ const char* callid = msg->Call_ID ? msg->Call_ID->value : __null_callid;
+
+ /* Add Via and update AOR, IPSec headers, SigComp ...
+ * ACK sent from the transaction layer will contains a Via header and should not be updated
+ * CANCEL will have the same Via and Contact headers as the request it cancel
+ * Any request received from WS/WSS transport layer have to be updated regardless above rules
+ */
+ if(TSIP_MESSAGE_IS_REQUEST(msg)) {
+ const tsk_bool_t update = ( (!TSIP_REQUEST_IS_ACK(msg) || (TSIP_REQUEST_IS_ACK(msg) && !msg->firstVia)) && !TSIP_REQUEST_IS_CANCEL(msg) )
+ || ( TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) );
+ if(update) {
+ /* AoR: Contact header */
+ tsip_transport_msg_update_aor((tsip_transport_t*)self, msg);
+ /* should be done before tsip_transport_msg_update() which could use the Via header
+ must be done after update_aor()
+ */
+ tsip_transport_addvia(self, branch, msg);
+ tsip_transport_msg_update(self, msg); /* IPSec, SigComp, ... */
+ }
+ }
+ else if(TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ /* AoR for responses which have a contact header (e.g. 183/200 INVITE) */
+ if(msg->Contact) {
+ tsip_transport_msg_update_aor((tsip_transport_t*)self, msg);
+ }
+ /* RFC 3581 - 4. Server Behavior
+ When a server compliant to this specification (which can be a proxy
+ or UAS) receives a request, it examines the topmost Via header field
+ value. If this Via header field value contains an "rport" parameter
+ with no value, it MUST set the value of the parameter to the source
+ port of the request.
+ */
+ if(msg->firstVia->rport == 0) {
+ /* As the response message has been built from the request ...then it's first via is the same as
+ the request's first via.
+ */
+ msg->firstVia->rport = msg->firstVia->port;
+ }
+ }
+
+ if((buffer = tsk_buffer_create_null())) {
+ tsip_message_tostring(msg, buffer);
+
+ if(buffer->size >1300) {
+ /* RFC 3261 - 18.1.1 Sending Requests (FIXME)
+ If a request is within 200 bytes of the path MTU, or if it is larger
+ than 1300 bytes and the path MTU is unknown, the request MUST be sent
+ using an RFC 2914 [43] congestion controlled transport protocol, such
+ as TCP. If this causes a change in the transport protocol from the
+ one indicated in the top Via, the value in the top Via MUST be
+ changed. This prevents fragmentation of messages over UDP and
+ provides congestion control for larger messages. However,
+ implementations MUST be able to handle messages up to the maximum
+ datagram packet size. For UDP, this size is 65,535 bytes, including
+ IP and UDP headers.
+ */
+ }
+
+ /* === SigComp === */
+ if(msg->sigcomp_id) {
+ if(self->stack->sigcomp.handle) {
+ tsk_size_t out_size;
+ char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
+
+ out_size = tsip_sigcomp_handler_compress(self->stack->sigcomp.handle, msg->sigcomp_id, TNET_SOCKET_TYPE_IS_STREAM(self->type),
+ buffer->data, buffer->size, SigCompBuffer, sizeof(SigCompBuffer));
+ if(out_size) {
+ tsk_buffer_cleanup(buffer);
+ tsk_buffer_append(buffer, SigCompBuffer, out_size);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("The outgoing message should be compressed using SigComp but there is not compartment");
+ }
+ }
+
+ /* === Send the message === */
+ if(TNET_SOCKET_TYPE_IS_WS(self->type) || TNET_SOCKET_TYPE_IS_WSS(self->type)) {
+ //if(!TNET_SOCKET_TYPE_IS_WS(msg->net_type) && !TNET_SOCKET_TYPE_IS_WSS(msg->net_type)){
+ // message not received over WS/WS tranport but have to be sent over WS/WS
+ tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(self), destIP, destPort, self->type);
+ if(peer) {
+ ret = tsip_transport_send_raw_ws(self, peer->local_fd, buffer->data, buffer->size, callid);
+ TSK_OBJECT_SAFE_FREE(peer);
+ }
+ else if(msg->local_fd > 0)
+ //}
+ //else{
+ {
+ ret = tsip_transport_send_raw_ws(self, msg->local_fd, buffer->data, buffer->size, callid);
+ }
+ //}
+ }
+ else if(TNET_SOCKET_TYPE_IS_IPSEC(self->type)) {
+ tnet_fd_t fd = tsip_transport_ipsec_getFD(TSIP_TRANSPORT_IPSEC(self), TSIP_MESSAGE_IS_REQUEST(msg));
+ // "fd == TNET_INVALID_FD" means IPSec SAs not up yet
+ ret = (fd != TNET_INVALID_FD)
+ ? tnet_sockfd_send(fd, buffer->data, buffer->size, 0)
+ : tsip_transport_send_raw(self, destIP, destPort, buffer->data, buffer->size, callid);
+ }
+ else {
+ ret = tsip_transport_send_raw(self, destIP, destPort, buffer->data, buffer->size, callid);
+ }
//bail:
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
- return ret;
+ return ret;
}
tsip_uri_t* tsip_transport_get_uri(const tsip_transport_t *self, tsk_bool_t lr)
{
- if(self){
- //tnet_ip_t ip;
- //tnet_port_t port;
- tsip_uri_t* uri = tsk_null;
-
- //if(!tnet_get_ip_n_port(self->connectedFD, &ip, &port)){
- char* uristring = tsk_null;
- int ipv6 = TNET_SOCKET_TYPE_IS_IPV6(self->type);
-
- tsk_sprintf(&uristring, "%s:%s%s%s:%d;%s;transport=%s",
- self->scheme,
- ipv6 ? "[" : "",
- ((tsip_stack_t*)self->stack)->network.aor.ip[self->idx],
- ipv6 ? "]" : "",
- ((tsip_stack_t*)self->stack)->network.aor.port[self->idx],
- lr ? "lr" : "",
- self->protocol);
- if(uristring){
- if((uri = tsip_uri_parse(uristring, tsk_strlen(uristring)))){
- uri->host_type = ipv6 ? host_ipv6 : host_ipv4;
- }
- TSK_FREE(uristring);
- }
- //}
- return uri;
- }
- return tsk_null;
+ if(self) {
+ //tnet_ip_t ip;
+ //tnet_port_t port;
+ tsip_uri_t* uri = tsk_null;
+
+ //if(!tnet_get_ip_n_port(self->connectedFD, &ip, &port)){
+ char* uristring = tsk_null;
+ int ipv6 = TNET_SOCKET_TYPE_IS_IPV6(self->type);
+
+ tsk_sprintf(&uristring, "%s:%s%s%s:%d;%s;transport=%s",
+ self->scheme,
+ ipv6 ? "[" : "",
+ ((tsip_stack_t*)self->stack)->network.aor.ip[self->idx],
+ ipv6 ? "]" : "",
+ ((tsip_stack_t*)self->stack)->network.aor.port[self->idx],
+ lr ? "lr" : "",
+ self->protocol);
+ if(uristring) {
+ if((uri = tsip_uri_parse(uristring, tsk_strlen(uristring)))) {
+ uri->host_type = ipv6 ? host_ipv6 : host_ipv4;
+ }
+ TSK_FREE(uristring);
+ }
+ //}
+ return uri;
+ }
+ return tsk_null;
}
// remote ip should not be FQDN
int tsip_transport_add_stream_peer_2(tsip_transport_t *self, tnet_fd_t local_fd, enum tnet_socket_type_e type, tsk_bool_t connected, const char* remote_host, tnet_port_t remote_port)
{
- tsip_transport_stream_peer_t* peer = tsk_null;
- tnet_ip_t remote_ip;
- int ret = 0;
+ tsip_transport_stream_peer_t* peer = tsk_null;
+ tnet_ip_t remote_ip;
+ int ret = 0;
- if(!self || local_fd < 0){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(!self || local_fd < 0) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
- tsip_transport_stream_peers_lock(self);
+ tsip_transport_stream_peers_lock(self);
- if(tsip_transport_have_stream_peer_with_local_fd(self, local_fd)){
- TSK_DEBUG_INFO("Peer with local fd=%d already exist", local_fd);
+ if(tsip_transport_have_stream_peer_with_local_fd(self, local_fd)) {
+ TSK_DEBUG_INFO("Peer with local fd=%d already exist", local_fd);
#if TSIP_UNDER_WINDOWS
- // could happen if the closed socket haven't raised "close event" yet and new one added : Windows only
- tsip_transport_remove_stream_peer_by_local_fd(self, local_fd);
+ // could happen if the closed socket haven't raised "close event" yet and new one added : Windows only
+ tsip_transport_remove_stream_peer_by_local_fd(self, local_fd);
#else
- peer = tsip_transport_pop_stream_peer_by_local_fd(self, local_fd);
+ peer = tsip_transport_pop_stream_peer_by_local_fd(self, local_fd);
#endif
- }
-
- if(tsk_strnullORempty(remote_host) || !remote_port){
- if(tnet_get_ip_n_port(local_fd, tsk_false/*remote*/, &remote_ip, &remote_port) != 0){
- TSK_DEBUG_ERROR("Failed to get remote peer ip and address for local fd = %d", local_fd);
- ret = -2;
- goto bail;
- }
- remote_host = (const char*)remote_ip;
- }
- else if((ret = tnet_resolve(remote_host, remote_port, type, &remote_ip, &remote_port))){
- TSK_DEBUG_ERROR("Failed to resolve(%s/%d)", remote_host, remote_port);
- ret = -3;
- goto bail;
- }
-
- if(!peer && !(peer = tsk_object_new(tsip_transport_stream_peer_def_t))){
- TSK_DEBUG_ERROR("Failed to create network stream peer");
- ret = -4;
- goto bail;
- }
-
- peer->local_fd = local_fd;
- peer->type = type;
- peer->connected = connected;
- peer->remote_port = remote_port;
- memcpy(peer->remote_ip, remote_ip, sizeof(remote_ip));
-
- tsip_transport_stream_peers_lock(self);
- peer->time_latest_activity = tsk_time_now();
- peer->time_added = peer->time_latest_activity;
- tsk_list_push_back_data(self->stream_peers, (void**)&peer);
- ++self->stream_peers_count;
- TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
- tsip_transport_stream_peers_unlock(self);
-
- // Cleanup streams
- if (self->stream_peers_count > TSIP_TRANSPORT_STREAM_PEERS_COUNT_BEFORE_CHECKING_TIMEOUT && self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
- ret = tsip_transport_stream_peers_cleanup(self);
- }
+ }
+
+ if(tsk_strnullORempty(remote_host) || !remote_port) {
+ if(tnet_get_ip_n_port(local_fd, tsk_false/*remote*/, &remote_ip, &remote_port) != 0) {
+ TSK_DEBUG_ERROR("Failed to get remote peer ip and address for local fd = %d", local_fd);
+ ret = -2;
+ goto bail;
+ }
+ remote_host = (const char*)remote_ip;
+ }
+ else if((ret = tnet_resolve(remote_host, remote_port, type, &remote_ip, &remote_port))) {
+ TSK_DEBUG_ERROR("Failed to resolve(%s/%d)", remote_host, remote_port);
+ ret = -3;
+ goto bail;
+ }
+
+ if(!peer && !(peer = tsk_object_new(tsip_transport_stream_peer_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create network stream peer");
+ ret = -4;
+ goto bail;
+ }
+
+ peer->local_fd = local_fd;
+ peer->type = type;
+ peer->connected = connected;
+ peer->remote_port = remote_port;
+ memcpy(peer->remote_ip, remote_ip, sizeof(remote_ip));
+
+ tsip_transport_stream_peers_lock(self);
+ peer->time_latest_activity = tsk_time_now();
+ peer->time_added = peer->time_latest_activity;
+ tsk_list_push_back_data(self->stream_peers, (void**)&peer);
+ ++self->stream_peers_count;
+ TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
+ tsip_transport_stream_peers_unlock(self);
+
+ // Cleanup streams
+ if (self->stream_peers_count > TSIP_TRANSPORT_STREAM_PEERS_COUNT_BEFORE_CHECKING_TIMEOUT && self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
+ ret = tsip_transport_stream_peers_cleanup(self);
+ }
bail:
- TSK_OBJECT_SAFE_FREE(peer);
- tsip_transport_stream_peers_unlock(self);
- return ret;
+ TSK_OBJECT_SAFE_FREE(peer);
+ tsip_transport_stream_peers_unlock(self);
+ return ret;
}
// up to the caller to release the returned object
tsip_transport_stream_peer_t* tsip_transport_find_stream_peer_by_local_fd(tsip_transport_t *self, tnet_fd_t local_fd)
{
- tsip_transport_stream_peer_t* peer = tsk_null;
- tsk_list_item_t* item;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsip_transport_stream_peers_lock(self);
- tsk_list_foreach(item, self->stream_peers){
- if(((tsip_transport_stream_peer_t*)item->data)->local_fd == local_fd){
- peer = tsk_object_ref(item->data);
- break;
- }
- }
- tsip_transport_stream_peers_unlock(self);
- return peer;
+ tsip_transport_stream_peer_t* peer = tsk_null;
+ tsk_list_item_t* item;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsip_transport_stream_peers_lock(self);
+ tsk_list_foreach(item, self->stream_peers) {
+ if(((tsip_transport_stream_peer_t*)item->data)->local_fd == local_fd) {
+ peer = tsk_object_ref(item->data);
+ break;
+ }
+ }
+ tsip_transport_stream_peers_unlock(self);
+ return peer;
}
// up to the caller to release the returned object
// calling this function will remove the peer from the list
tsip_transport_stream_peer_t* tsip_transport_pop_stream_peer_by_local_fd(tsip_transport_t *self, tnet_fd_t local_fd)
{
- if(self){
- tsip_transport_stream_peer_t* peer = tsk_null;
- tsk_list_item_t *item;
- tsip_transport_stream_peers_lock(self);
- if((item = tsk_list_pop_item_by_pred(self->stream_peers, _pred_find_stream_peer_by_local_fd, &local_fd))){
- peer = tsk_object_ref(item->data);
- TSK_OBJECT_SAFE_FREE(item);
- --self->stream_peers_count;
- TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
- }
- tsip_transport_stream_peers_unlock(self);
- return peer;
- }
- return tsk_null;
+ if(self) {
+ tsip_transport_stream_peer_t* peer = tsk_null;
+ tsk_list_item_t *item;
+ tsip_transport_stream_peers_lock(self);
+ if((item = tsk_list_pop_item_by_pred(self->stream_peers, _pred_find_stream_peer_by_local_fd, &local_fd))) {
+ peer = tsk_object_ref(item->data);
+ TSK_OBJECT_SAFE_FREE(item);
+ --self->stream_peers_count;
+ TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
+ }
+ tsip_transport_stream_peers_unlock(self);
+ return peer;
+ }
+ return tsk_null;
}
// up to the caller to release the returned object
tsip_transport_stream_peer_t* tsip_transport_find_stream_peer_by_remote_ip(tsip_transport_t *self, const char* remote_ip, tnet_port_t remote_port, enum tnet_socket_type_e type)
{
- tsip_transport_stream_peer_t* peer = tsk_null;
- tsk_list_item_t* item;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- tsip_transport_stream_peers_lock(self);
- tsk_list_foreach(item, self->stream_peers){
- if(((tsip_transport_stream_peer_t*)item->data)->type == type && ((tsip_transport_stream_peer_t*)item->data)->remote_port == remote_port && tsk_striequals(((tsip_transport_stream_peer_t*)item->data)->remote_ip, remote_ip)){
- peer = tsk_object_ref(item->data);
- break;
- }
- }
- tsip_transport_stream_peers_unlock(self);
- return peer;
+ tsip_transport_stream_peer_t* peer = tsk_null;
+ tsk_list_item_t* item;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ tsip_transport_stream_peers_lock(self);
+ tsk_list_foreach(item, self->stream_peers) {
+ if(((tsip_transport_stream_peer_t*)item->data)->type == type && ((tsip_transport_stream_peer_t*)item->data)->remote_port == remote_port && tsk_striequals(((tsip_transport_stream_peer_t*)item->data)->remote_ip, remote_ip)) {
+ peer = tsk_object_ref(item->data);
+ break;
+ }
+ }
+ tsip_transport_stream_peers_unlock(self);
+ return peer;
}
tsk_bool_t tsip_transport_have_stream_peer_with_remote_ip(tsip_transport_t *self, const char* remote_ip, tnet_port_t remote_port, enum tnet_socket_type_e type)
{
- if(self && !tsk_strnullORempty(remote_ip) && remote_port){
- tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(self, remote_ip, remote_port, type);
- if(peer){
- TSK_OBJECT_SAFE_FREE(peer);
- return tsk_true;
- }
- }
- return tsk_false;
+ if(self && !tsk_strnullORempty(remote_ip) && remote_port) {
+ tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(self, remote_ip, remote_port, type);
+ if(peer) {
+ TSK_OBJECT_SAFE_FREE(peer);
+ return tsk_true;
+ }
+ }
+ return tsk_false;
}
tsk_bool_t tsip_transport_have_stream_peer_with_local_fd(tsip_transport_t *self, tnet_fd_t local_fd)
{
- tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_local_fd(self, local_fd);
- tsk_bool_t ret = (peer != tsk_null);
- TSK_OBJECT_SAFE_FREE(peer);
- return ret;
+ tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_local_fd(self, local_fd);
+ tsk_bool_t ret = (peer != tsk_null);
+ TSK_OBJECT_SAFE_FREE(peer);
+ return ret;
}
int tsip_transport_remove_stream_peer_by_local_fd(tsip_transport_t *self, tnet_fd_t local_fd)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- tsip_transport_stream_peers_lock(self);
- if (tsk_list_remove_item_by_pred(self->stream_peers, _pred_find_stream_peer_by_local_fd, &local_fd)) {
- --self->stream_peers_count;
- TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
- }
- tsip_transport_stream_peers_unlock(self);
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ tsip_transport_stream_peers_lock(self);
+ if (tsk_list_remove_item_by_pred(self->stream_peers, _pred_find_stream_peer_by_local_fd, &local_fd)) {
+ --self->stream_peers_count;
+ TSK_DEBUG_INFO("#%d peers in the '%s' transport", self->stream_peers_count, tsip_transport_get_description(self));
+ }
+ tsip_transport_stream_peers_unlock(self);
+
+ return 0;
}
int tsip_transport_remove_callid_from_stream_peers(tsip_transport_t *self, const char* callid, tsk_bool_t* removed)
{
- if(!self || !removed){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- *removed = tsk_false;
- if(TNET_SOCKET_TYPE_IS_STREAM(self->type)){
- tsk_list_item_t *item;
- tsip_transport_stream_peers_lock(self);
- tsk_list_foreach(item, self->stream_peers){
- if(tsip_transport_stream_peer_remove_callid((tsip_transport_stream_peer_t*)item->data, callid, removed) == 0 && *removed){
- TSK_DEBUG_INFO("[Transport] Removed call-id = '%s' from transport with type = %d", callid, self->type);
- break;
- }
- }
- tsip_transport_stream_peers_unlock(self);
- }
-
- return 0;
+ if(!self || !removed) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ *removed = tsk_false;
+ if(TNET_SOCKET_TYPE_IS_STREAM(self->type)) {
+ tsk_list_item_t *item;
+ tsip_transport_stream_peers_lock(self);
+ tsk_list_foreach(item, self->stream_peers) {
+ if(tsip_transport_stream_peer_remove_callid((tsip_transport_stream_peer_t*)item->data, callid, removed) == 0 && *removed) {
+ TSK_DEBUG_INFO("[Transport] Removed call-id = '%s' from transport with type = %d", callid, self->type);
+ break;
+ }
+ }
+ tsip_transport_stream_peers_unlock(self);
+ }
+
+ return 0;
}
tsk_bool_t tsip_transport_stream_peer_have_callid(const tsip_transport_stream_peer_t* self, const char* callid)
{
- tsk_bool_t have_cid = tsk_false;
- if(self){
- const tsk_list_item_t* item;
-
- tsk_list_lock(self->dialogs_cids);
- tsk_list_foreach(item, self->dialogs_cids){
- if(tsk_strequals(TSK_STRING_STR(item->data), callid)){
- have_cid = tsk_true;
- break;
- }
- }
- tsk_list_unlock(self->dialogs_cids);
- }
- return have_cid;
+ tsk_bool_t have_cid = tsk_false;
+ if(self) {
+ const tsk_list_item_t* item;
+
+ tsk_list_lock(self->dialogs_cids);
+ tsk_list_foreach(item, self->dialogs_cids) {
+ if(tsk_strequals(TSK_STRING_STR(item->data), callid)) {
+ have_cid = tsk_true;
+ break;
+ }
+ }
+ tsk_list_unlock(self->dialogs_cids);
+ }
+ return have_cid;
}
int tsip_transport_stream_peer_add_callid(tsip_transport_stream_peer_t* self, const char* callid)
{
- if(self && !tsk_strnullORempty(callid)){
- tsk_list_lock(self->dialogs_cids);
- if(!tsip_transport_stream_peer_have_callid(self, callid)){
- tsk_string_t* cid = tsk_string_create(callid);
- if(cid){
- TSK_DEBUG_INFO("Add call-id = '%s' to peer with local fd = %d", callid, self->local_fd);
- tsk_list_push_back_data(self->dialogs_cids, (void**)&cid);
- TSK_OBJECT_SAFE_FREE(cid);
- }
- }
- tsk_list_unlock(self->dialogs_cids);
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self && !tsk_strnullORempty(callid)) {
+ tsk_list_lock(self->dialogs_cids);
+ if(!tsip_transport_stream_peer_have_callid(self, callid)) {
+ tsk_string_t* cid = tsk_string_create(callid);
+ if(cid) {
+ TSK_DEBUG_INFO("Add call-id = '%s' to peer with local fd = %d", callid, self->local_fd);
+ tsk_list_push_back_data(self->dialogs_cids, (void**)&cid);
+ TSK_OBJECT_SAFE_FREE(cid);
+ }
+ }
+ tsk_list_unlock(self->dialogs_cids);
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_transport_stream_peer_remove_callid(tsip_transport_stream_peer_t* self, const char* callid, tsk_bool_t *removed)
{
- if(self && removed){
- *removed = tsk_false;
- tsk_list_lock(self->dialogs_cids);
- if((*removed = tsk_list_remove_item_by_pred(self->dialogs_cids, tsk_string_pred_cmp, callid)) == tsk_true){
- TSK_DEBUG_INFO("[Stream] Removed call-id = '%s' from peer with local fd = %d", callid, self->local_fd);
- }
- tsk_list_unlock(self->dialogs_cids);
- return 0;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self && removed) {
+ *removed = tsk_false;
+ tsk_list_lock(self->dialogs_cids);
+ if((*removed = tsk_list_remove_item_by_pred(self->dialogs_cids, tsk_string_pred_cmp, callid)) == tsk_true) {
+ TSK_DEBUG_INFO("[Stream] Removed call-id = '%s' from peer with local fd = %d", callid, self->local_fd);
+ }
+ tsk_list_unlock(self->dialogs_cids);
+ return 0;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
int tsip_transport_stream_peers_cleanup(tsip_transport_t *self)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- if (TNET_SOCKET_TYPE_IS_STREAM(self->type)) {
- tsk_list_item_t *item;
- tsip_transport_stream_peer_t *peer;
- tnet_fd_t fd;
- tsk_bool_t close;
- uint64_t now = tsk_time_now();
- tsip_transport_stream_peers_lock(self);
- tsk_list_foreach(item, self->stream_peers) {
- if ((peer = (item->data))) {
- close = ((now - TSIP_TRANSPORT_STREAM_PEER_TIMEOUT) > peer->time_latest_activity);
- if (!close) {
- close = !peer->got_valid_sip_msg && ((now - TSIP_TRANSPORT_STREAM_PEER_FIRST_MSG_TIMEOUT) > peer->time_added);
- }
- if (!close) {
- if ((TNET_SOCKET_TYPE_IS_WS(peer->type) || TNET_SOCKET_TYPE_IS_WSS(peer->type)) && !peer->ws.handshaking_done) {
- close = ((now - TSIP_TRANSPORT_STREAM_PEER_WS_HANDSHAKING_TIMEOUT) > peer->time_added);
- }
- }
- if (close) {
- fd = peer->local_fd;
- TSK_DEBUG_INFO("Peer with fd=%d, type=%d, got_valid_sip_msg=%d, time_added=%llu, time_latest_activity=%llu, now=%llu in '%s' transport timedout",
- fd, peer->type, peer->got_valid_sip_msg, peer->time_added, peer->time_latest_activity, now, tsip_transport_get_description(self));
- tsip_transport_remove_socket(self, (tnet_fd_t *)&fd);
- }
- }
- }
- tsip_transport_stream_peers_unlock(self);
- }
-
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ if (TNET_SOCKET_TYPE_IS_STREAM(self->type)) {
+ tsk_list_item_t *item;
+ tsip_transport_stream_peer_t *peer;
+ tnet_fd_t fd;
+ tsk_bool_t close;
+ uint64_t now = tsk_time_now();
+ tsip_transport_stream_peers_lock(self);
+ tsk_list_foreach(item, self->stream_peers) {
+ if ((peer = (item->data))) {
+ close = ((now - TSIP_TRANSPORT_STREAM_PEER_TIMEOUT) > peer->time_latest_activity);
+ if (!close) {
+ close = !peer->got_valid_sip_msg && ((now - TSIP_TRANSPORT_STREAM_PEER_FIRST_MSG_TIMEOUT) > peer->time_added);
+ }
+ if (!close) {
+ if ((TNET_SOCKET_TYPE_IS_WS(peer->type) || TNET_SOCKET_TYPE_IS_WSS(peer->type)) && !peer->ws.handshaking_done) {
+ close = ((now - TSIP_TRANSPORT_STREAM_PEER_WS_HANDSHAKING_TIMEOUT) > peer->time_added);
+ }
+ }
+ if (close) {
+ fd = peer->local_fd;
+ TSK_DEBUG_INFO("Peer with fd=%d, type=%d, got_valid_sip_msg=%d, time_added=%llu, time_latest_activity=%llu, now=%llu in '%s' transport timedout",
+ fd, peer->type, peer->got_valid_sip_msg, peer->time_added, peer->time_latest_activity, now, tsip_transport_get_description(self));
+ tsip_transport_remove_socket(self, (tnet_fd_t *)&fd);
+ }
+ }
+ }
+ tsip_transport_stream_peers_unlock(self);
+ }
+
+ return 0;
}
int tsip_transport_init(tsip_transport_t* self, tnet_socket_type_t type, const struct tsip_stack_s *stack, const char *host, tnet_port_t port, const char* description)
{
- if(!self || self->initialized){
- return -1;
- }
-
- self->stack = stack;
- self->type = type;
- self->net_transport = tnet_transport_create(host, port, type, description);
-
- self->scheme = "sip";
-
- if(TNET_SOCKET_TYPE_IS_STREAM(type)){
- if(TNET_SOCKET_TYPE_IS_TLS(type)){
- self->scheme = "sips";
- self->protocol = "tcp";
- self->via_protocol = "TLS";
- self->service = "SIPS+D2T";
- }
- else if(TNET_SOCKET_TYPE_IS_WS(type)){
- self->protocol = "ws";
- self->via_protocol = "WS";
- self->service = "SIP+D2W";
- }
- else if(TNET_SOCKET_TYPE_IS_WSS(type)){
- self->scheme = "sips";
- self->protocol = "wss";
- self->via_protocol = "WSS";
- self->service = "SIPS+D2W";
- }
- else{
- self->protocol = "tcp";
- self->via_protocol = "TCP";
- self->service = "SIP+D2T";
- }
-
- /* Stream buffer */
- self->stream_peers = tsk_list_create();
+ if(!self || self->initialized) {
+ return -1;
+ }
+
+ self->stack = stack;
+ self->type = type;
+ self->net_transport = tnet_transport_create(host, port, type, description);
+
+ self->scheme = "sip";
+
+ if(TNET_SOCKET_TYPE_IS_STREAM(type)) {
+ if(TNET_SOCKET_TYPE_IS_TLS(type)) {
+ self->scheme = "sips";
+ self->protocol = "tcp";
+ self->via_protocol = "TLS";
+ self->service = "SIPS+D2T";
+ }
+ else if(TNET_SOCKET_TYPE_IS_WS(type)) {
+ self->protocol = "ws";
+ self->via_protocol = "WS";
+ self->service = "SIP+D2W";
+ }
+ else if(TNET_SOCKET_TYPE_IS_WSS(type)) {
+ self->scheme = "sips";
+ self->protocol = "wss";
+ self->via_protocol = "WSS";
+ self->service = "SIPS+D2W";
+ }
+ else {
+ self->protocol = "tcp";
+ self->via_protocol = "TCP";
+ self->service = "SIP+D2T";
+ }
+
+ /* Stream buffer */
+ self->stream_peers = tsk_list_create();
if (!self->stream_peers) {
return -1;
}
- }
- else{
- if(TNET_SOCKET_TYPE_IS_DTLS(type)){
- self->scheme = "sips";
- self->protocol = "dtls-udp";
- self->via_protocol = "DTLS-UDP";
- self->service = "SIPS+D2U";
- }
- else{
- self->protocol = "udp";
- self->via_protocol = "UDP";
- self->service = "SIP+D2U";
- }
- }
- self->connectedFD = TNET_INVALID_FD;
- self->initialized = 1;
-
- return 0;
+ }
+ else {
+ if(TNET_SOCKET_TYPE_IS_DTLS(type)) {
+ self->scheme = "sips";
+ self->protocol = "dtls-udp";
+ self->via_protocol = "DTLS-UDP";
+ self->service = "SIPS+D2U";
+ }
+ else {
+ self->protocol = "udp";
+ self->via_protocol = "UDP";
+ self->service = "SIP+D2U";
+ }
+ }
+ self->connectedFD = TNET_INVALID_FD;
+ self->initialized = 1;
+
+ return 0;
}
int tsip_transport_deinit(tsip_transport_t* self)
{
- if(!self || !self->initialized){
- return -1;
- }
-
- TSK_OBJECT_SAFE_FREE(self->net_transport);
- TSK_OBJECT_SAFE_FREE(self->stream_peers);
-
- self->initialized = 0;
- return 0;
+ if(!self || !self->initialized) {
+ return -1;
+ }
+
+ TSK_OBJECT_SAFE_FREE(self->net_transport);
+ TSK_OBJECT_SAFE_FREE(self->stream_peers);
+
+ self->initialized = 0;
+ return 0;
}
@@ -995,53 +996,52 @@ int tsip_transport_deinit(tsip_transport_t* self)
//
static tsk_object_t* tsip_transport_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transport_t *transport = self;
- if(transport){
- const tsip_stack_handle_t *stack = va_arg(*app, const tsip_stack_handle_t*);
- const char *host = va_arg(*app, const char*);
+ tsip_transport_t *transport = self;
+ if(transport) {
+ const tsip_stack_handle_t *stack = va_arg(*app, const tsip_stack_handle_t*);
+ const char *host = va_arg(*app, const char*);
#if defined(__GNUC__)
- tnet_port_t port = (tnet_port_t)va_arg(*app, unsigned);
+ tnet_port_t port = (tnet_port_t)va_arg(*app, unsigned);
#else
- tnet_port_t port = va_arg(*app, tnet_port_t);
+ tnet_port_t port = va_arg(*app, tnet_port_t);
#endif
- tnet_socket_type_t type = va_arg(*app, tnet_socket_type_t);
- const char *description = va_arg(*app, const char*);
-
- if(tsip_transport_init(transport, type, stack, host, port, description)){
- TSK_DEBUG_ERROR("Failed to initialize transport");
- return tsk_null;
- }
- }
- return self;
+ tnet_socket_type_t type = va_arg(*app, tnet_socket_type_t);
+ const char *description = va_arg(*app, const char*);
+
+ if(tsip_transport_init(transport, type, stack, host, port, description)) {
+ TSK_DEBUG_ERROR("Failed to initialize transport");
+ return tsk_null;
+ }
+ }
+ return self;
}
static tsk_object_t* tsip_transport_dtor(tsk_object_t * self)
-{
- tsip_transport_t *transport = self;
- if(transport){
- tsip_transport_deinit(transport);
- }
- return self;
+{
+ tsip_transport_t *transport = self;
+ if(transport) {
+ tsip_transport_deinit(transport);
+ }
+ return self;
}
static int tsip_transport_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tsip_transport_t *transport1 = obj1;
- const tsip_transport_t *transport2 = obj2;
- if(transport1 && transport2){
- const char* desc1 = tsip_transport_get_description(transport1);
- const char* desc2 = tsip_transport_get_description(transport2);
- return tsk_stricmp(desc1, desc2);
- }
- return -1;
+ const tsip_transport_t *transport1 = obj1;
+ const tsip_transport_t *transport2 = obj2;
+ if(transport1 && transport2) {
+ const char* desc1 = tsip_transport_get_description(transport1);
+ const char* desc2 = tsip_transport_get_description(transport2);
+ return tsk_stricmp(desc1, desc2);
+ }
+ return -1;
}
-static const tsk_object_def_t tsip_transport_def_s =
-{
- sizeof(tsip_transport_t),
- tsip_transport_ctor,
- tsip_transport_dtor,
- tsip_transport_cmp,
+static const tsk_object_def_t tsip_transport_def_s = {
+ sizeof(tsip_transport_t),
+ tsip_transport_ctor,
+ tsip_transport_dtor,
+ tsip_transport_cmp,
};
const tsk_object_def_t *tsip_transport_def_t = &tsip_transport_def_s;
@@ -1053,51 +1053,50 @@ const tsk_object_def_t *tsip_transport_def_t = &tsip_transport_def_s;
//
static tsk_object_t* tsip_transport_stream_peer_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transport_stream_peer_t *peer = self;
- if(peer){
- if (!(peer->rcv_buff_stream = tsk_buffer_create_null())) {
+ tsip_transport_stream_peer_t *peer = self;
+ if(peer) {
+ if (!(peer->rcv_buff_stream = tsk_buffer_create_null())) {
return tsk_null;
}
- if (!(peer->snd_buff_stream = tsk_buffer_create_null())) {
+ if (!(peer->snd_buff_stream = tsk_buffer_create_null())) {
return tsk_null;
}
- if (!(peer->dialogs_cids = tsk_list_create())){
+ if (!(peer->dialogs_cids = tsk_list_create())) {
return tsk_null;
}
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tsip_transport_stream_peer_dtor(tsk_object_t * self)
-{
- tsip_transport_stream_peer_t *peer = self;
- if(peer){
- TSK_DEBUG_INFO("*** Stream Peer destroyed ***");
- TSK_OBJECT_SAFE_FREE(peer->rcv_buff_stream);
- TSK_OBJECT_SAFE_FREE(peer->snd_buff_stream);
-
- TSK_SAFE_FREE(peer->ws.rcv_buffer);
- peer->ws.rcv_buffer_size = 0;
- TSK_SAFE_FREE(peer->ws.snd_buffer);
- peer->ws.snd_buffer_size = 0;
-
- TSK_OBJECT_SAFE_FREE(peer->dialogs_cids);
- }
- return self;
+{
+ tsip_transport_stream_peer_t *peer = self;
+ if(peer) {
+ TSK_DEBUG_INFO("*** Stream Peer destroyed ***");
+ TSK_OBJECT_SAFE_FREE(peer->rcv_buff_stream);
+ TSK_OBJECT_SAFE_FREE(peer->snd_buff_stream);
+
+ TSK_SAFE_FREE(peer->ws.rcv_buffer);
+ peer->ws.rcv_buffer_size = 0;
+ TSK_SAFE_FREE(peer->ws.snd_buffer);
+ peer->ws.snd_buffer_size = 0;
+
+ TSK_OBJECT_SAFE_FREE(peer->dialogs_cids);
+ }
+ return self;
}
static int tsip_transport_stream_peer_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tsip_transport_stream_peer_t *peer1 = obj1;
- const tsip_transport_stream_peer_t *peer2 = obj2;
- if(peer1 && peer2){
- return (peer1->local_fd - peer2->local_fd);
- }
- return -1;
+ const tsip_transport_stream_peer_t *peer1 = obj1;
+ const tsip_transport_stream_peer_t *peer2 = obj2;
+ if(peer1 && peer2) {
+ return (peer1->local_fd - peer2->local_fd);
+ }
+ return -1;
}
-static const tsk_object_def_t tsip_transport_stream_peer_def_s =
-{
- sizeof(tsip_transport_stream_peer_t),
- tsip_transport_stream_peer_ctor,
- tsip_transport_stream_peer_dtor,
- tsip_transport_stream_peer_cmp,
+static const tsk_object_def_t tsip_transport_stream_peer_def_s = {
+ sizeof(tsip_transport_stream_peer_t),
+ tsip_transport_stream_peer_ctor,
+ tsip_transport_stream_peer_dtor,
+ tsip_transport_stream_peer_cmp,
};
const tsk_object_def_t *tsip_transport_stream_peer_def_t = &tsip_transport_stream_peer_def_s;
diff --git a/tinySIP/src/transports/tsip_transport_ipsec.c b/tinySIP/src/transports/tsip_transport_ipsec.c
index 390e999..9e4ce95 100755
--- a/tinySIP/src/transports/tsip_transport_ipsec.c
+++ b/tinySIP/src/transports/tsip_transport_ipsec.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,318 +46,318 @@ TINYSIP_GEXTERN const tsk_object_def_t *tsip_ipsec_association_def_t;
tsip_ipsec_association_t* tsip_ipsec_association_create(const tsip_transport_t* transport)
{
- return tsk_object_new(tsip_ipsec_association_def_t, transport);
+ return tsk_object_new(tsip_ipsec_association_def_t, transport);
}
tsip_transport_ipsec_t* tsip_transport_ipsec_create(struct tsip_stack_s* stack, const char* host, tnet_port_t port, tnet_socket_type_t type, const char* description)
{
- return tsk_object_new(tsip_transport_ipsec_def_t, stack, host, port, type, description);
+ return tsk_object_new(tsip_transport_ipsec_def_t, stack, host, port, type, description);
}
int tsip_transport_ipsec_createTempSAs(tsip_transport_ipsec_t* self)
{
- int ret = -1;
-
- /* Check */
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- /* Already have temporary SAs ? */
- if (self->asso_temporary) {
- TSK_DEBUG_ERROR("IPSec transport layer already have temporary SAs");
- ret = -2;
- goto bail;
- }
-
- /* Create temporary association */
- if ((self->asso_temporary = tsip_ipsec_association_create(TSIP_TRANSPORT(self)))) {
- if (self->asso_temporary->ctx && self->asso_temporary->ctx->state == tipsec_state_inbound) {
- ret = 0;
- }
- else {
- TSK_DEBUG_INFO("Failed to create new temporary SAs.");
- ret = -3;
- goto bail;
- }
- }
- else {
- TSK_DEBUG_INFO("Failed to create new temporary SAs.");
-
- ret = -4;
- goto bail;
- }
+ int ret = -1;
+
+ /* Check */
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ /* Already have temporary SAs ? */
+ if (self->asso_temporary) {
+ TSK_DEBUG_ERROR("IPSec transport layer already have temporary SAs");
+ ret = -2;
+ goto bail;
+ }
+
+ /* Create temporary association */
+ if ((self->asso_temporary = tsip_ipsec_association_create(TSIP_TRANSPORT(self)))) {
+ if (self->asso_temporary->ctx && self->asso_temporary->ctx->state == tipsec_state_inbound) {
+ ret = 0;
+ }
+ else {
+ TSK_DEBUG_INFO("Failed to create new temporary SAs.");
+ ret = -3;
+ goto bail;
+ }
+ }
+ else {
+ TSK_DEBUG_INFO("Failed to create new temporary SAs.");
+
+ ret = -4;
+ goto bail;
+ }
bail:
- if (ret && ret != -1) {
- TSK_OBJECT_SAFE_FREE(self->asso_temporary);
- }
- return ret;
+ if (ret && ret != -1) {
+ TSK_OBJECT_SAFE_FREE(self->asso_temporary);
+ }
+ return ret;
}
int tsip_transport_ipsec_ensureTempSAs(tsip_transport_ipsec_t* self, const tsip_response_t *r401_407, int64_t expires)
{
- int ret = -1;
- struct sockaddr_storage to;
- tsk_size_t index;
- const tsip_header_Security_Server_t *ssHdr;
- double maxQ = -2.0; /* The Q value in the SIP header will be equal to -1 by default. */
- int match = 0;
-
-
- tipsec_spi_t spi_pc, spi_ps;
- tipsec_port_t port_pc, port_ps;
- tipsec_lifetime_t lifetime;
-
- if(!self || expires < 0){
- goto bail;
- }
-
- lifetime = (tipsec_lifetime_t)expires;
-
- /* Already have temporary SAs ? */
- if(!self->asso_temporary){
- TSK_DEBUG_ERROR("Cannot ensure temporary SAs (No tempSAs)");
- ret = -2;
- goto bail;
- }
-
- /* Cleanup old Security-Verifies */
- TSK_OBJECT_SAFE_FREE(self->secVerifies);
-
- /* RFC 3329 - 2.3.1 Client Initiated
-
- When the client receives a response with a Security-Server header field, it MUST choose the security mechanism in the server's list
- with the highest "q" value among all the mechanisms that are known to the client.
- */
- for (index = 0; (ssHdr = (const tsip_header_Security_Server_t *)tsip_message_get_headerAt(r401_407, tsip_htype_Security_Server, index)); index++) {
- tsip_header_Security_Verify_t* svHdr;
-
- if (maxQ > ssHdr->q || !tsk_striequals(ssHdr->mech, "ipsec-3gpp")){
- goto copy;
- }
-
- if ((TIPSEC_ALG_FROM_STR(ssHdr->alg) == self->asso_temporary->ctx->alg) &&
- (TIPSEC_EALG_FROM_STR(ssHdr->ealg) == self->asso_temporary->ctx->ealg) &&
- (TIPSEC_PROTOCOL_FROM_STR(ssHdr->prot) == self->asso_temporary->ctx->protocol) &&
- (TIPSEC_MODE_FROM_STR(ssHdr->mod) == self->asso_temporary->ctx->mode)){
-
- match = 1;
-
- maxQ = (ssHdr->q >= maxQ) ? ssHdr->q : maxQ;
- spi_pc = ssHdr->spi_c;
- spi_ps = ssHdr->spi_s;
- port_pc = ssHdr->port_c;
- port_ps = ssHdr->port_s;
- }
+ int ret = -1;
+ struct sockaddr_storage to;
+ tsk_size_t index;
+ const tsip_header_Security_Server_t *ssHdr;
+ double maxQ = -2.0; /* The Q value in the SIP header will be equal to -1 by default. */
+ int match = 0;
+
+
+ tipsec_spi_t spi_pc, spi_ps;
+ tipsec_port_t port_pc, port_ps;
+ tipsec_lifetime_t lifetime;
+
+ if(!self || expires < 0) {
+ goto bail;
+ }
+
+ lifetime = (tipsec_lifetime_t)expires;
+
+ /* Already have temporary SAs ? */
+ if(!self->asso_temporary) {
+ TSK_DEBUG_ERROR("Cannot ensure temporary SAs (No tempSAs)");
+ ret = -2;
+ goto bail;
+ }
+
+ /* Cleanup old Security-Verifies */
+ TSK_OBJECT_SAFE_FREE(self->secVerifies);
+
+ /* RFC 3329 - 2.3.1 Client Initiated
+
+ When the client receives a response with a Security-Server header field, it MUST choose the security mechanism in the server's list
+ with the highest "q" value among all the mechanisms that are known to the client.
+ */
+ for (index = 0; (ssHdr = (const tsip_header_Security_Server_t *)tsip_message_get_headerAt(r401_407, tsip_htype_Security_Server, index)); index++) {
+ tsip_header_Security_Verify_t* svHdr;
+
+ if (maxQ > ssHdr->q || !tsk_striequals(ssHdr->mech, "ipsec-3gpp")) {
+ goto copy;
+ }
+
+ if ((TIPSEC_ALG_FROM_STR(ssHdr->alg) == self->asso_temporary->ctx->alg) &&
+ (TIPSEC_EALG_FROM_STR(ssHdr->ealg) == self->asso_temporary->ctx->ealg) &&
+ (TIPSEC_PROTOCOL_FROM_STR(ssHdr->prot) == self->asso_temporary->ctx->protocol) &&
+ (TIPSEC_MODE_FROM_STR(ssHdr->mod) == self->asso_temporary->ctx->mode)) {
+
+ match = 1;
+
+ maxQ = (ssHdr->q >= maxQ) ? ssHdr->q : maxQ;
+ spi_pc = ssHdr->spi_c;
+ spi_ps = ssHdr->spi_s;
+ port_pc = ssHdr->port_c;
+ port_ps = ssHdr->port_s;
+ }
copy:
- svHdr = tsip_header_Security_Verify_create_null();
- svHdr->mech = tsk_strdup(ssHdr->mech);
- svHdr->alg = tsk_strdup(ssHdr->alg);
- svHdr->prot = tsk_strdup(ssHdr->prot);
- svHdr->mod = tsk_strdup(ssHdr->mod);
- svHdr->ealg = tsk_strdup(ssHdr->ealg);
- svHdr->port_c = ssHdr->port_c;
- svHdr->port_s = ssHdr->port_s;
- svHdr->spi_c = ssHdr->spi_c;
- svHdr->spi_s = ssHdr->spi_s;
- svHdr->q = ssHdr->q;
- TSIP_HEADER_PARAMS(svHdr) = tsk_object_ref(TSIP_HEADER_PARAMS(ssHdr));
- if(!self->secVerifies){
- self->secVerifies = tsk_list_create();
- }
- tsk_list_push_back_data(self->secVerifies, (void**)&svHdr);
- }
-
- if(!match){
- TSK_DEBUG_ERROR("Failed to match security server<->security client.");
- ret = -3;
- goto bail;
- }
-
- /* Set remote parameters received from 401/407 response. */
- if((ret = tipsec_ctx_set_remote(self->asso_temporary->ctx, spi_pc, spi_ps, port_pc, port_ps, lifetime))){
- TSK_DEBUG_ERROR("Failed to set remote IPSec parameters [%d]", ret);
- goto bail;
- }
-
- /* Connect Sockets: port_uc to port_ps*/
- if((ret = tnet_sockaddr_init(self->asso_temporary->ip_remote, self->asso_temporary->ctx->port_ps, TSIP_TRANSPORT(self)->type, &to))){
- TSK_DEBUG_ERROR("Invalid HOST/PORT [%s/%u].", (const char*)self->asso_temporary->ctx->addr_remote, self->asso_temporary->ctx->port_ps);
- goto bail;
- }
- if((ret = tnet_sockfd_connectto(self->asso_temporary->socket_uc->fd, &to))){
- TSK_DEBUG_ERROR("Failed to connect port_uc to port_ps.");
- goto bail;
- }
+ svHdr = tsip_header_Security_Verify_create_null();
+ svHdr->mech = tsk_strdup(ssHdr->mech);
+ svHdr->alg = tsk_strdup(ssHdr->alg);
+ svHdr->prot = tsk_strdup(ssHdr->prot);
+ svHdr->mod = tsk_strdup(ssHdr->mod);
+ svHdr->ealg = tsk_strdup(ssHdr->ealg);
+ svHdr->port_c = ssHdr->port_c;
+ svHdr->port_s = ssHdr->port_s;
+ svHdr->spi_c = ssHdr->spi_c;
+ svHdr->spi_s = ssHdr->spi_s;
+ svHdr->q = ssHdr->q;
+ TSIP_HEADER_PARAMS(svHdr) = tsk_object_ref(TSIP_HEADER_PARAMS(ssHdr));
+ if(!self->secVerifies) {
+ self->secVerifies = tsk_list_create();
+ }
+ tsk_list_push_back_data(self->secVerifies, (void**)&svHdr);
+ }
+
+ if(!match) {
+ TSK_DEBUG_ERROR("Failed to match security server<->security client.");
+ ret = -3;
+ goto bail;
+ }
+
+ /* Set remote parameters received from 401/407 response. */
+ if((ret = tipsec_ctx_set_remote(self->asso_temporary->ctx, spi_pc, spi_ps, port_pc, port_ps, lifetime))) {
+ TSK_DEBUG_ERROR("Failed to set remote IPSec parameters [%d]", ret);
+ goto bail;
+ }
+
+ /* Connect Sockets: port_uc to port_ps*/
+ if((ret = tnet_sockaddr_init(self->asso_temporary->ip_remote, self->asso_temporary->ctx->port_ps, TSIP_TRANSPORT(self)->type, &to))) {
+ TSK_DEBUG_ERROR("Invalid HOST/PORT [%s/%u].", (const char*)self->asso_temporary->ctx->addr_remote, self->asso_temporary->ctx->port_ps);
+ goto bail;
+ }
+ if((ret = tnet_sockfd_connectto(self->asso_temporary->socket_uc->fd, &to))) {
+ TSK_DEBUG_ERROR("Failed to connect port_uc to port_ps.");
+ goto bail;
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_ipsec_startSAs(tsip_transport_ipsec_t* self, const tipsec_key_t* ik, const tipsec_key_t* ck)
{
- int ret = -1;
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if (!self->asso_temporary) {
- TSK_DEBUG_ERROR("Failed to find temporary SAs");
- ret = -2;
- goto bail;
- }
-
- /* Promote tempSAs (temp => active) */
- TSK_OBJECT_SAFE_FREE(self->asso_active); /* delete old active SAs */
- self->asso_active = tsk_object_ref((void*)self->asso_temporary); /* promote */
- TSK_OBJECT_SAFE_FREE(self->asso_temporary); /* delete old temp SAs */
-
- if ((ret = tipsec_ctx_set_keys(self->asso_active->ctx, ik, ck)) == 0){
- ret = tipsec_ctx_start(self->asso_active->ctx);
- }
+ int ret = -1;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if (!self->asso_temporary) {
+ TSK_DEBUG_ERROR("Failed to find temporary SAs");
+ ret = -2;
+ goto bail;
+ }
+
+ /* Promote tempSAs (temp => active) */
+ TSK_OBJECT_SAFE_FREE(self->asso_active); /* delete old active SAs */
+ self->asso_active = tsk_object_ref((void*)self->asso_temporary); /* promote */
+ TSK_OBJECT_SAFE_FREE(self->asso_temporary); /* delete old temp SAs */
+
+ if ((ret = tipsec_ctx_set_keys(self->asso_active->ctx, ik, ck)) == 0) {
+ ret = tipsec_ctx_start(self->asso_active->ctx);
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_ipsec_cleanupSAs(tsip_transport_ipsec_t* self)
{
- int ret = -1;
+ int ret = -1;
- if(!self){
- goto bail;
- }
+ if(!self) {
+ goto bail;
+ }
- TSK_OBJECT_SAFE_FREE(self->asso_temporary);
- TSK_OBJECT_SAFE_FREE(self->asso_active);
+ TSK_OBJECT_SAFE_FREE(self->asso_temporary);
+ TSK_OBJECT_SAFE_FREE(self->asso_active);
bail:
- return ret;
+ return ret;
}
int tsip_transport_ipsec_updateMSG(tsip_transport_ipsec_t* self, tsip_message_t *msg)
{
- int ret = -1;
- const tsip_ipsec_association_t* asso;
-
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- asso = (self->asso_temporary && TSIP_REQUEST_IS_REGISTER(msg)) ? self->asso_temporary : self->asso_active;
- if (!asso || !asso->ctx) {
- TSK_DEBUG_ERROR("No IPSec association found.");
- ret = -2;
- goto bail;
- }
-
- if (TSIP_MESSAGE_IS_RESPONSE(msg)) {
- return 0;
- }
-
- /* Security-Client, Require, Proxy-Require and Security Verify */
- switch(msg->line.request.request_type) {
- case tsip_BYE:
- case tsip_INVITE:
- case tsip_OPTIONS:
- case tsip_REGISTER:
- case tsip_SUBSCRIBE:
- case tsip_NOTIFY:
- case tsip_REFER:
- case tsip_INFO:
- case tsip_UPDATE:
- case tsip_MESSAGE:
- case tsip_PUBLISH:
- case tsip_PRACK:
- {
- const tsk_list_item_t *item;
- TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_SECURITY_CLIENT_VA_ARGS("ipsec-3gpp",
- TIPSEC_ALG_TO_STR(asso->ctx->alg),
- TIPSEC_PROTOCOL_TO_STR(asso->ctx->protocol),
- TIPSEC_MODE_TO_STR(asso->ctx->mode),
- TIPSEC_EALG_TO_STR(asso->ctx->ealg),
- asso->ctx->port_uc,
- asso->ctx->port_us,
- asso->ctx->spi_uc,
- asso->ctx->spi_us
- ));
- /* RFC 3329 - 2.3.1 Client Initiated
- All the subsequent SIP requests sent by the client to that server
- SHOULD make use of the security mechanism initiated in the previous
- step. These requests MUST contain a Security-Verify header field
- that mirrors the server's list received previously in the Security-
- Server header field. These requests MUST also have both a Require
- and Proxy-Require header fields with the value "sec-agree".
- */
- tsk_list_foreach(item, self->secVerifies){
- tsip_message_add_header(msg, (const tsip_header_t*)item->data);
- }
- TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_REQUIRE_VA_ARGS("sec-agree"));
- TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_PROXY_REQUIRE_VA_ARGS("sec-agree"));
- break;
- }
-
- default: break;
- }
-
- ret = 0;
-
- /* Add Security-Server headers */
+ int ret = -1;
+ const tsip_ipsec_association_t* asso;
+
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ asso = (self->asso_temporary && TSIP_REQUEST_IS_REGISTER(msg)) ? self->asso_temporary : self->asso_active;
+ if (!asso || !asso->ctx) {
+ TSK_DEBUG_ERROR("No IPSec association found.");
+ ret = -2;
+ goto bail;
+ }
+
+ if (TSIP_MESSAGE_IS_RESPONSE(msg)) {
+ return 0;
+ }
+
+ /* Security-Client, Require, Proxy-Require and Security Verify */
+ switch(msg->line.request.request_type) {
+ case tsip_BYE:
+ case tsip_INVITE:
+ case tsip_OPTIONS:
+ case tsip_REGISTER:
+ case tsip_SUBSCRIBE:
+ case tsip_NOTIFY:
+ case tsip_REFER:
+ case tsip_INFO:
+ case tsip_UPDATE:
+ case tsip_MESSAGE:
+ case tsip_PUBLISH:
+ case tsip_PRACK: {
+ const tsk_list_item_t *item;
+ TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_SECURITY_CLIENT_VA_ARGS("ipsec-3gpp",
+ TIPSEC_ALG_TO_STR(asso->ctx->alg),
+ TIPSEC_PROTOCOL_TO_STR(asso->ctx->protocol),
+ TIPSEC_MODE_TO_STR(asso->ctx->mode),
+ TIPSEC_EALG_TO_STR(asso->ctx->ealg),
+ asso->ctx->port_uc,
+ asso->ctx->port_us,
+ asso->ctx->spi_uc,
+ asso->ctx->spi_us
+ ));
+ /* RFC 3329 - 2.3.1 Client Initiated
+ All the subsequent SIP requests sent by the client to that server
+ SHOULD make use of the security mechanism initiated in the previous
+ step. These requests MUST contain a Security-Verify header field
+ that mirrors the server's list received previously in the Security-
+ Server header field. These requests MUST also have both a Require
+ and Proxy-Require header fields with the value "sec-agree".
+ */
+ tsk_list_foreach(item, self->secVerifies) {
+ tsip_message_add_header(msg, (const tsip_header_t*)item->data);
+ }
+ TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_REQUIRE_VA_ARGS("sec-agree"));
+ TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_PROXY_REQUIRE_VA_ARGS("sec-agree"));
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ ret = 0;
+
+ /* Add Security-Server headers */
bail:
- return ret;
+ return ret;
}
tnet_fd_t tsip_transport_ipsec_getFD(tsip_transport_ipsec_t* self, int isRequest)
{
- if (!self) {
- TSK_DEBUG_ERROR("Invalid parameter");
- return TNET_INVALID_FD;
- }
-
- /* If no active SAs ca be found then use default connection. */
- if (!self->asso_active) {
- return TNET_INVALID_FD;
- // return TSIP_TRANSPORT(self)->connectedFD;
- }
-
- /* IPSec ports management
- For more information: http://betelco.blogspot.com/2008/09/ipsec-using-security-agreement-in-3gpp.html
- */
-
- if (TNET_SOCKET_TYPE_IS_DGRAM(TSIP_TRANSPORT(self)->type)) {
- /*
- === UDP ===
- port_uc -> REGISTER -> port_ps
- port_ps <- 200 OK <- port_pc
- */
- return self->asso_active->socket_uc->fd;
- }
- else {
- /*
- === TCP ===
- port_uc -> REGISTER -> port_ps
- port_uc <- 200 OK <- port_ps
-
- port_us <- NOTIFY <- port_pc
- port_us -> 200 OK -> port_pc
- */
- if (isRequest) {
- return self->asso_active->socket_uc->fd;
- }
- else {
- return self->asso_active->socket_us->fd;
- }
- }
-
- return TNET_INVALID_FD;
+ if (!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return TNET_INVALID_FD;
+ }
+
+ /* If no active SAs ca be found then use default connection. */
+ if (!self->asso_active) {
+ return TNET_INVALID_FD;
+ // return TSIP_TRANSPORT(self)->connectedFD;
+ }
+
+ /* IPSec ports management
+ For more information: http://betelco.blogspot.com/2008/09/ipsec-using-security-agreement-in-3gpp.html
+ */
+
+ if (TNET_SOCKET_TYPE_IS_DGRAM(TSIP_TRANSPORT(self)->type)) {
+ /*
+ === UDP ===
+ port_uc -> REGISTER -> port_ps
+ port_ps <- 200 OK <- port_pc
+ */
+ return self->asso_active->socket_uc->fd;
+ }
+ else {
+ /*
+ === TCP ===
+ port_uc -> REGISTER -> port_ps
+ port_uc <- 200 OK <- port_ps
+
+ port_us <- NOTIFY <- port_pc
+ port_us -> 200 OK -> port_pc
+ */
+ if (isRequest) {
+ return self->asso_active->socket_uc->fd;
+ }
+ else {
+ return self->asso_active->socket_us->fd;
+ }
+ }
+
+ return TNET_INVALID_FD;
}
@@ -373,57 +373,56 @@ tnet_fd_t tsip_transport_ipsec_getFD(tsip_transport_ipsec_t* self, int isRequest
//
static tsk_object_t* tsip_transport_ipsec_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transport_ipsec_t *transport = self;
- if(transport){
- const struct tsip_stack_s *stack = va_arg(*app, const struct tsip_stack_s*);
- const char *host = va_arg(*app, const char*);
+ tsip_transport_ipsec_t *transport = self;
+ if(transport) {
+ const struct tsip_stack_s *stack = va_arg(*app, const struct tsip_stack_s*);
+ const char *host = va_arg(*app, const char*);
#if defined(__GNUC__)
- tnet_port_t port = (tnet_port_t)va_arg(*app, unsigned);
+ tnet_port_t port = (tnet_port_t)va_arg(*app, unsigned);
#else
- tnet_port_t port = va_arg(*app, tnet_port_t);
+ tnet_port_t port = va_arg(*app, tnet_port_t);
#endif
- tnet_socket_type_t type = va_arg(*app, tnet_socket_type_t);
- const char *description = va_arg(*app, const char*);
-
- /* init base */
- tsip_transport_init(TSIP_TRANSPORT(transport), type, stack, host, port, description);
- }
- return self;
+ tnet_socket_type_t type = va_arg(*app, tnet_socket_type_t);
+ const char *description = va_arg(*app, const char*);
+
+ /* init base */
+ tsip_transport_init(TSIP_TRANSPORT(transport), type, stack, host, port, description);
+ }
+ return self;
}
static tsk_object_t* tsip_transport_ipsec_dtor(tsk_object_t * self)
-{
- tsip_transport_ipsec_t *transport = self;
- if(transport){
- /* deinit base */
- tsip_transport_deinit(TSIP_TRANSPORT(transport));
-
- /* deinit self */
- tsip_transport_ipsec_cleanupSAs(transport);
-
- TSK_OBJECT_SAFE_FREE(transport->secVerifies);
- }
- return self;
+{
+ tsip_transport_ipsec_t *transport = self;
+ if(transport) {
+ /* deinit base */
+ tsip_transport_deinit(TSIP_TRANSPORT(transport));
+
+ /* deinit self */
+ tsip_transport_ipsec_cleanupSAs(transport);
+
+ TSK_OBJECT_SAFE_FREE(transport->secVerifies);
+ }
+ return self;
}
static int tsip_transport_ipsec_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tsip_transport_ipsec_t *transport1 = obj1;
- const tsip_transport_ipsec_t *transport2 = obj2;
- if(transport1 && transport2){
- const char* desc1 = tsip_transport_get_description(TSIP_TRANSPORT(transport1));
- const char* desc2 = tsip_transport_get_description(TSIP_TRANSPORT(transport2));
- return tsk_stricmp(desc1, desc2);
- }
- return -1;
+ const tsip_transport_ipsec_t *transport1 = obj1;
+ const tsip_transport_ipsec_t *transport2 = obj2;
+ if(transport1 && transport2) {
+ const char* desc1 = tsip_transport_get_description(TSIP_TRANSPORT(transport1));
+ const char* desc2 = tsip_transport_get_description(TSIP_TRANSPORT(transport2));
+ return tsk_stricmp(desc1, desc2);
+ }
+ return -1;
}
-static const tsk_object_def_t tsip_transport_ipsec_def_s =
-{
- sizeof(tsip_transport_ipsec_t),
- tsip_transport_ipsec_ctor,
- tsip_transport_ipsec_dtor,
- tsip_transport_ipsec_cmp,
+static const tsk_object_def_t tsip_transport_ipsec_def_s = {
+ sizeof(tsip_transport_ipsec_t),
+ tsip_transport_ipsec_ctor,
+ tsip_transport_ipsec_dtor,
+ tsip_transport_ipsec_cmp,
};
const tsk_object_def_t *tsip_transport_ipsec_def_t = &tsip_transport_ipsec_def_s;
@@ -442,96 +441,92 @@ const tsk_object_def_t *tsip_transport_ipsec_def_t = &tsip_transport_ipsec_def_s
//
static tsk_object_t* tsip_ipsec_association_ctor(tsk_object_t * self, va_list * app)
{
- tsip_ipsec_association_t *association = self;
- if(association){
-
- const tsip_transport_t* transport = va_arg(*app, const tsip_transport_t *);
-
- /* Set transport */
- association->transport = transport;
-
- /* Get local IP and port. */
- tsip_transport_get_ip_n_port(transport, &association->ip_local, &association->port_local);
-
- /* Create IPSec context */
- if (tipsec_ctx_create(
- TIPSEC_IPPROTO_FROM_STR(transport->protocol),
- TNET_SOCKET_TYPE_IS_IPV6(transport->type),
- TIPSEC_MODE_FROM_STR(transport->stack->security.ipsec.mode),
- TIPSEC_EALG_FROM_STR(transport->stack->security.ipsec.ealg),
- TIPSEC_ALG_FROM_STR(transport->stack->security.ipsec.alg),
- TIPSEC_PROTOCOL_FROM_STR(transport->stack->security.ipsec.protocol), &association->ctx))
- {
- TSK_DEBUG_ERROR("Failed to create IPSec context");
- return tsk_null;
- }
-
- /* Create Both client and Server legs */
- association->socket_us = tnet_socket_create(association->ip_local, TNET_SOCKET_PORT_ANY, transport->type);
- association->socket_uc = tnet_socket_create(association->ip_local, TNET_SOCKET_PORT_ANY, transport->type);
-
- /* Add Both sockets to the network transport */
- tsip_transport_add_socket(transport, association->socket_us->fd, transport->type, 0, 0);
- tsip_transport_add_socket(transport, association->socket_uc->fd, transport->type, 0, 1);
-
- /* Set local */
- if (tnet_get_peerip(transport->connectedFD, &association->ip_remote) == 0) { /* Get remote IP string */
- if (tipsec_ctx_set_local(association->ctx, association->ip_local, association->ip_remote, association->socket_uc->port, association->socket_us->port)) {
- TSK_DEBUG_ERROR("Failed to set IPSec local info:%s,%s,%u,%u", association->ip_local, association->ip_remote, association->socket_uc->port, association->socket_us->port);
- return tsk_null;
- }
- }
- else {
- // Resolve the HostName because "tipsec_ctx_set_local()" requires IP address instead of FQDN.
- if (tnet_resolve(transport->stack->network.proxy_cscf[transport->stack->network.transport_idx_default],
- transport->stack->network.proxy_cscf_port[transport->stack->network.transport_idx_default],
- transport->stack->network.proxy_cscf_type[transport->stack->network.transport_idx_default],
- &association->ip_remote, tsk_null))
- {
- return tsk_null;
- }
- if (tipsec_ctx_set_local(association->ctx,
- association->ip_local,
- association->ip_remote,
- association->socket_uc->port,
- association->socket_us->port))
- {
- return tsk_null;
- }
- }
- }
- return self;
+ tsip_ipsec_association_t *association = self;
+ if(association) {
+
+ const tsip_transport_t* transport = va_arg(*app, const tsip_transport_t *);
+
+ /* Set transport */
+ association->transport = transport;
+
+ /* Get local IP and port. */
+ tsip_transport_get_ip_n_port(transport, &association->ip_local, &association->port_local);
+
+ /* Create IPSec context */
+ if (tipsec_ctx_create(
+ TIPSEC_IPPROTO_FROM_STR(transport->protocol),
+ TNET_SOCKET_TYPE_IS_IPV6(transport->type),
+ TIPSEC_MODE_FROM_STR(transport->stack->security.ipsec.mode),
+ TIPSEC_EALG_FROM_STR(transport->stack->security.ipsec.ealg),
+ TIPSEC_ALG_FROM_STR(transport->stack->security.ipsec.alg),
+ TIPSEC_PROTOCOL_FROM_STR(transport->stack->security.ipsec.protocol), &association->ctx)) {
+ TSK_DEBUG_ERROR("Failed to create IPSec context");
+ return tsk_null;
+ }
+
+ /* Create Both client and Server legs */
+ association->socket_us = tnet_socket_create(association->ip_local, TNET_SOCKET_PORT_ANY, transport->type);
+ association->socket_uc = tnet_socket_create(association->ip_local, TNET_SOCKET_PORT_ANY, transport->type);
+
+ /* Add Both sockets to the network transport */
+ tsip_transport_add_socket(transport, association->socket_us->fd, transport->type, 0, 0);
+ tsip_transport_add_socket(transport, association->socket_uc->fd, transport->type, 0, 1);
+
+ /* Set local */
+ if (tnet_get_peerip(transport->connectedFD, &association->ip_remote) == 0) { /* Get remote IP string */
+ if (tipsec_ctx_set_local(association->ctx, association->ip_local, association->ip_remote, association->socket_uc->port, association->socket_us->port)) {
+ TSK_DEBUG_ERROR("Failed to set IPSec local info:%s,%s,%u,%u", association->ip_local, association->ip_remote, association->socket_uc->port, association->socket_us->port);
+ return tsk_null;
+ }
+ }
+ else {
+ // Resolve the HostName because "tipsec_ctx_set_local()" requires IP address instead of FQDN.
+ if (tnet_resolve(transport->stack->network.proxy_cscf[transport->stack->network.transport_idx_default],
+ transport->stack->network.proxy_cscf_port[transport->stack->network.transport_idx_default],
+ transport->stack->network.proxy_cscf_type[transport->stack->network.transport_idx_default],
+ &association->ip_remote, tsk_null)) {
+ return tsk_null;
+ }
+ if (tipsec_ctx_set_local(association->ctx,
+ association->ip_local,
+ association->ip_remote,
+ association->socket_uc->port,
+ association->socket_us->port)) {
+ return tsk_null;
+ }
+ }
+ }
+ return self;
}
static tsk_object_t* tsip_ipsec_association_dtor(tsk_object_t * self)
-{
- tsip_ipsec_association_t *association = self;
- if(association){
- TSK_OBJECT_SAFE_FREE(association->ctx);
-
- /* Remove Both sockets from the network transport and delete them. */
- if(association->socket_uc){
- tsip_transport_remove_socket(association->transport, &association->socket_uc->fd);
- TSK_OBJECT_SAFE_FREE(association->socket_uc);
- }
- if(association->socket_us){
- tsip_transport_remove_socket(association->transport, &association->socket_us->fd);
- TSK_OBJECT_SAFE_FREE(association->socket_us);
- }
- }
- return self;
+{
+ tsip_ipsec_association_t *association = self;
+ if(association) {
+ TSK_OBJECT_SAFE_FREE(association->ctx);
+
+ /* Remove Both sockets from the network transport and delete them. */
+ if(association->socket_uc) {
+ tsip_transport_remove_socket(association->transport, &association->socket_uc->fd);
+ TSK_OBJECT_SAFE_FREE(association->socket_uc);
+ }
+ if(association->socket_us) {
+ tsip_transport_remove_socket(association->transport, &association->socket_us->fd);
+ TSK_OBJECT_SAFE_FREE(association->socket_us);
+ }
+ }
+ return self;
}
static int tsip_ipsec_association_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_ipsec_association_def_s =
-{
- sizeof(tsip_ipsec_association_t),
- tsip_ipsec_association_ctor,
- tsip_ipsec_association_dtor,
- tsip_ipsec_association_cmp,
+static const tsk_object_def_t tsip_ipsec_association_def_s = {
+ sizeof(tsip_ipsec_association_t),
+ tsip_ipsec_association_ctor,
+ tsip_ipsec_association_dtor,
+ tsip_ipsec_association_cmp,
};
const tsk_object_def_t *tsip_ipsec_association_def_t = &tsip_ipsec_association_def_s;
diff --git a/tinySIP/src/transports/tsip_transport_layer.c b/tinySIP/src/transports/tsip_transport_layer.c
index 93668b9..fc01c0e 100755
--- a/tinySIP/src/transports/tsip_transport_layer.c
+++ b/tinySIP/src/transports/tsip_transport_layer.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -60,1199 +60,1190 @@ extern tsip_event_t* tsip_event_create(tsip_ssession_t* ss, short code, const ch
tsip_transport_layer_t* tsip_transport_layer_create(tsip_stack_t *stack)
{
- return tsk_object_new(tsip_transport_layer_def_t, stack);
+ return tsk_object_new(tsip_transport_layer_def_t, stack);
}
const tsip_transport_t* tsip_transport_layer_find_by_type(const tsip_transport_layer_t* self, tnet_socket_type_t type)
{
- const tsk_list_item_t *item;
- const tsip_transport_t* transport = tsk_null;
+ const tsk_list_item_t *item;
+ const tsip_transport_t* transport = tsk_null;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- tsk_list_lock(self->transports);
+ tsk_list_lock(self->transports);
- tsk_list_foreach(item, self->transports){
- if(((const tsip_transport_t*)item->data)->type == type){
- transport = ((const tsip_transport_t*)item->data);
- break;
- }
- }
+ tsk_list_foreach(item, self->transports) {
+ if(((const tsip_transport_t*)item->data)->type == type) {
+ transport = ((const tsip_transport_t*)item->data);
+ break;
+ }
+ }
- tsk_list_unlock(self->transports);
+ tsk_list_unlock(self->transports);
- return transport;
+ return transport;
}
const tsip_transport_t* tsip_transport_layer_find_by_idx(const tsip_transport_layer_t* self, int32_t idx)
{
- const tsk_list_item_t *item;
- const tsip_transport_t* transport = tsk_null;
+ const tsk_list_item_t *item;
+ const tsip_transport_t* transport = tsk_null;
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- tsk_list_lock(self->transports);
+ tsk_list_lock(self->transports);
- tsk_list_foreach(item, self->transports){
- if(((const tsip_transport_t*)item->data)->idx == idx){
- transport = ((const tsip_transport_t*)item->data);
- break;
- }
- }
+ tsk_list_foreach(item, self->transports) {
+ if(((const tsip_transport_t*)item->data)->idx == idx) {
+ transport = ((const tsip_transport_t*)item->data);
+ break;
+ }
+ }
- tsk_list_unlock(self->transports);
+ tsk_list_unlock(self->transports);
- return transport;
+ return transport;
}
int tsip_transport_layer_handle_incoming_msg(const tsip_transport_t *transport, tsip_message_t *message)
{
- int ret = -1;
-
- if(message){
- const tsip_transac_layer_t *layer_transac = transport->stack->layer_transac;
- const tsip_dialog_layer_t *layer_dialog = transport->stack->layer_dialog;
-
- if((ret = tsip_transac_layer_handle_incoming_msg(layer_transac, message))){
- /* NO MATCHING TRANSACTION FOUND ==> LOOK INTO DIALOG LAYER */
- ret = tsip_dialog_layer_handle_incoming_msg(layer_dialog, message);
- }
- }
- return ret;
+ int ret = -1;
+
+ if(message) {
+ const tsip_transac_layer_t *layer_transac = transport->stack->layer_transac;
+ const tsip_dialog_layer_t *layer_dialog = transport->stack->layer_dialog;
+
+ if((ret = tsip_transac_layer_handle_incoming_msg(layer_transac, message))) {
+ /* NO MATCHING TRANSACTION FOUND ==> LOOK INTO DIALOG LAYER */
+ ret = tsip_dialog_layer_handle_incoming_msg(layer_dialog, message);
+ }
+ }
+ return ret;
}
/*== Non-blocking callback function (STREAM: TCP, TLS and SCTP) */
static int tsip_transport_layer_stream_cb(const tnet_transport_event_t* e)
{
- int ret = -1;
- tsk_ragel_state_t state;
- tsip_message_t *message = tsk_null;
- int endOfheaders = -1;
- tsip_transport_t *transport = (tsip_transport_t *)e->callback_data;
- tsip_transport_stream_peer_t* peer;
-
- switch(e->type){
- case event_data: {
- TSK_DEBUG_INFO("\n\nRECV:%.*s\n\n", e->size, (const char*)e->data);
- break;
- }
- case event_closed:
- case event_error:
- case event_removed:
- {
- tsip_transport_stream_peer_t* peer;
- TSK_DEBUG_INFO("Stream Peer closed - %d", e->local_fd);
- // signal "peer disconnected" before "stack disconnected"
- if((peer = tsip_transport_pop_stream_peer_by_local_fd(transport, e->local_fd))){
- tsip_dialog_layer_signal_peer_disconnected(TSIP_STACK(transport->stack)->layer_dialog, peer);
- TSK_OBJECT_SAFE_FREE(peer);
- }
- else {
- TSK_DEBUG_INFO("Closed peer with fd=%d not registered yet", e->local_fd);
+ int ret = -1;
+ tsk_ragel_state_t state;
+ tsip_message_t *message = tsk_null;
+ int endOfheaders = -1;
+ tsip_transport_t *transport = (tsip_transport_t *)e->callback_data;
+ tsip_transport_stream_peer_t* peer;
+
+ switch(e->type) {
+ case event_data: {
+ TSK_DEBUG_INFO("\n\nRECV:%.*s\n\n", e->size, (const char*)e->data);
+ break;
+ }
+ case event_closed:
+ case event_error:
+ case event_removed: {
+ tsip_transport_stream_peer_t* peer;
+ TSK_DEBUG_INFO("Stream Peer closed - %d", e->local_fd);
+ // signal "peer disconnected" before "stack disconnected"
+ if((peer = tsip_transport_pop_stream_peer_by_local_fd(transport, e->local_fd))) {
+ tsip_dialog_layer_signal_peer_disconnected(TSIP_STACK(transport->stack)->layer_dialog, peer);
+ TSK_OBJECT_SAFE_FREE(peer);
+ }
+ else {
+ TSK_DEBUG_INFO("Closed peer with fd=%d not registered yet", e->local_fd);
+ }
+ // connectedFD== master's fd for servers
+ if(transport->connectedFD == e->local_fd || transport->connectedFD == TNET_INVALID_FD) {
+ TSK_DEBUG_INFO("SIP 'connectedFD' (%d) closed", transport->connectedFD);
+ if(transport->stack) {
+ tsip_event_t* e;
+ // signal to all dialogs that transport error raised
+ tsip_dialog_layer_signal_stack_disconnected(TSIP_STACK(transport->stack)->layer_dialog);
+ // signal to the end-user that the stack is disconnected
+ if((e = tsip_event_create(tsk_null, tsip_event_code_stack_disconnected, "Stack disconnected", tsk_null, tsip_event_stack))) {
+ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(transport->stack), e);
}
- // connectedFD== master's fd for servers
- if(transport->connectedFD == e->local_fd || transport->connectedFD == TNET_INVALID_FD){
- TSK_DEBUG_INFO("SIP 'connectedFD' (%d) closed", transport->connectedFD);
- if(transport->stack){
- tsip_event_t* e;
- // signal to all dialogs that transport error raised
- tsip_dialog_layer_signal_stack_disconnected(TSIP_STACK(transport->stack)->layer_dialog);
- // signal to the end-user that the stack is disconnected
- if((e = tsip_event_create(tsk_null, tsip_event_code_stack_disconnected, "Stack disconnected", tsk_null, tsip_event_stack))){
- TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(transport->stack), e);
- }
- }
- transport->connectedFD = TNET_INVALID_FD;
- }
- return 0;
- }
- case event_connected:
- case event_accepted:
- {
- tsip_transport_stream_peer_t* peer;
- TSK_DEBUG_INFO("Stream Peer accepted/connected - %d", e->local_fd);
- // find peer
- if((peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))){
- peer->connected = tsk_true;
- if(peer->snd_buff_stream->data && peer->snd_buff_stream->size > 0){ // is there pending outgoing data postponed until socket get connected?
- tnet_transport_send(transport->net_transport, peer->local_fd, peer->snd_buff_stream->data, peer->snd_buff_stream->size);
- tsk_buffer_cleanup(peer->snd_buff_stream);
- }
- TSK_OBJECT_SAFE_FREE(peer);
- }
- else{
- // on iOS (cfsocket implementation) opening the master stream raise "connected" callback which is not correct.
- // Ignoring the socket is not a problem as we'll get a callback event ("accepted") when a client connects to the master.
- // The master cannot raise "connected" even as it's already in "listening" state
+ }
+ transport->connectedFD = TNET_INVALID_FD;
+ }
+ return 0;
+ }
+ case event_connected:
+ case event_accepted: {
+ tsip_transport_stream_peer_t* peer;
+ TSK_DEBUG_INFO("Stream Peer accepted/connected - %d", e->local_fd);
+ // find peer
+ if((peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))) {
+ peer->connected = tsk_true;
+ if(peer->snd_buff_stream->data && peer->snd_buff_stream->size > 0) { // is there pending outgoing data postponed until socket get connected?
+ tnet_transport_send(transport->net_transport, peer->local_fd, peer->snd_buff_stream->data, peer->snd_buff_stream->size);
+ tsk_buffer_cleanup(peer->snd_buff_stream);
+ }
+ TSK_OBJECT_SAFE_FREE(peer);
+ }
+ else {
+ // on iOS (cfsocket implementation) opening the master stream raise "connected" callback which is not correct.
+ // Ignoring the socket is not a problem as we'll get a callback event ("accepted") when a client connects to the master.
+ // The master cannot raise "connected" even as it's already in "listening" state
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)
- if(tnet_transport_get_master_fd(transport->net_transport) == e->local_fd){
- return 0;
- }
+ if(tnet_transport_get_master_fd(transport->net_transport) == e->local_fd) {
+ return 0;
+ }
#endif
- return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
- }
- }
- default:{
- return 0;
- }
- }
-
- if(!(peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))){
- TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", e->local_fd);
- return -1;
- }
-
- /* Update latest time activity */
- peer->time_latest_activity = tsk_time_now();
-
- /* RFC 3261 - 7.5 Framing SIP Messages
-
- Unlike HTTP, SIP implementations can use UDP or other unreliable
- datagram protocols. Each such datagram carries one request or
- response. See Section 18 on constraints on usage of unreliable
- transports.
-
- Implementations processing SIP messages over stream-oriented
- transports MUST ignore any CRLF appearing before the start-line
- [H4.1].
-
- The Content-Length header field value is used to locate the end of
- each SIP message in a stream. It will always be present when SIP
- messages are sent over stream-oriented transports.
- */
-
- /* Check if buffer is too big to be valid (have we missed some chuncks?) */
- if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MAX_STREAM_CHUNCK_SIZE){
- TSK_DEBUG_ERROR("TCP Buffer is too big to be valid");
- tsk_buffer_cleanup(peer->rcv_buff_stream);
- }
-
- /* === SigComp === */
- if(TSIP_IS_SIGCOMP_DATA(e->data)){
- char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
- //====== FIXME: This implmentation will always use the first SigComp-Id for decompression =====
- tsk_bool_t is_nack;
- const char* comp_id;
- void* nack_data = tsk_null;
- tsk_size_t data_size, next_size;
-
- // First Pass
- comp_id = tsip_sigcomp_handler_fixme_getcompid(transport->stack->sigcomp.handle);
- data_size = tsip_sigcomp_handler_uncompressTCP(transport->stack->sigcomp.handle, comp_id, e->data, e->size, SigCompBuffer, sizeof(SigCompBuffer), &is_nack);
-
- if(data_size){
- if(is_nack){
- tsip_transport_send_raw(transport, tsk_null, 0, SigCompBuffer, data_size, __null_callid);
- }
- else{
- // append result
- tsk_buffer_append(peer->rcv_buff_stream, SigCompBuffer, data_size);
- }
- }
- else{ /* Partial message? */
- TSK_DEBUG_ERROR("SigComp decompression has failed");
- return 0;
- }
- // Query for all other chuncks
- while((next_size = tsip_sigcomp_handler_uncompress_next(transport->stack->sigcomp.handle, comp_id, &nack_data, &is_nack)) || nack_data){
- if(is_nack){
- tsip_transport_send_raw(transport, tsk_null, 0, nack_data, next_size, __null_callid);
- TSK_FREE(nack_data);
- }
- else{
- // append result
- tsk_buffer_append(peer->rcv_buff_stream, SigCompBuffer, (next_size - data_size));
- data_size = next_size;
- }
- }
- }
- else{
- /* Append new content. */
- tsk_buffer_append(peer->rcv_buff_stream, e->data, e->size);
- }
-
- /* Check if we have all SIP/WS headers. */
+ return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
+ }
+ }
+ default: {
+ return 0;
+ }
+ }
+
+ if(!(peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))) {
+ TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", e->local_fd);
+ return -1;
+ }
+
+ /* Update latest time activity */
+ peer->time_latest_activity = tsk_time_now();
+
+ /* RFC 3261 - 7.5 Framing SIP Messages
+
+ Unlike HTTP, SIP implementations can use UDP or other unreliable
+ datagram protocols. Each such datagram carries one request or
+ response. See Section 18 on constraints on usage of unreliable
+ transports.
+
+ Implementations processing SIP messages over stream-oriented
+ transports MUST ignore any CRLF appearing before the start-line
+ [H4.1].
+
+ The Content-Length header field value is used to locate the end of
+ each SIP message in a stream. It will always be present when SIP
+ messages are sent over stream-oriented transports.
+ */
+
+ /* Check if buffer is too big to be valid (have we missed some chuncks?) */
+ if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MAX_STREAM_CHUNCK_SIZE) {
+ TSK_DEBUG_ERROR("TCP Buffer is too big to be valid");
+ tsk_buffer_cleanup(peer->rcv_buff_stream);
+ }
+
+ /* === SigComp === */
+ if(TSIP_IS_SIGCOMP_DATA(e->data)) {
+ char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
+ //====== FIXME: This implmentation will always use the first SigComp-Id for decompression =====
+ tsk_bool_t is_nack;
+ const char* comp_id;
+ void* nack_data = tsk_null;
+ tsk_size_t data_size, next_size;
+
+ // First Pass
+ comp_id = tsip_sigcomp_handler_fixme_getcompid(transport->stack->sigcomp.handle);
+ data_size = tsip_sigcomp_handler_uncompressTCP(transport->stack->sigcomp.handle, comp_id, e->data, e->size, SigCompBuffer, sizeof(SigCompBuffer), &is_nack);
+
+ if(data_size) {
+ if(is_nack) {
+ tsip_transport_send_raw(transport, tsk_null, 0, SigCompBuffer, data_size, __null_callid);
+ }
+ else {
+ // append result
+ tsk_buffer_append(peer->rcv_buff_stream, SigCompBuffer, data_size);
+ }
+ }
+ else { /* Partial message? */
+ TSK_DEBUG_ERROR("SigComp decompression has failed");
+ return 0;
+ }
+ // Query for all other chuncks
+ while((next_size = tsip_sigcomp_handler_uncompress_next(transport->stack->sigcomp.handle, comp_id, &nack_data, &is_nack)) || nack_data) {
+ if(is_nack) {
+ tsip_transport_send_raw(transport, tsk_null, 0, nack_data, next_size, __null_callid);
+ TSK_FREE(nack_data);
+ }
+ else {
+ // append result
+ tsk_buffer_append(peer->rcv_buff_stream, SigCompBuffer, (next_size - data_size));
+ data_size = next_size;
+ }
+ }
+ }
+ else {
+ /* Append new content. */
+ tsk_buffer_append(peer->rcv_buff_stream, e->data, e->size);
+ }
+
+ /* Check if we have all SIP/WS headers. */
parse_buffer:
- if((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(peer->rcv_buff_stream),TSK_BUFFER_SIZE(peer->rcv_buff_stream), "\r\n\r\n"/*2CRLF*/)) < 0){
- TSK_DEBUG_INFO("No all SIP headers in the TCP buffer.");
- goto bail;
- }
-
- /* If we are there this mean that we have all SIP headers.
- * ==> Parse the SIP message without the content.
- */
- tsk_ragel_state_init(&state, TSK_BUFFER_DATA(peer->rcv_buff_stream), endOfheaders + 4/*2CRLF*/);
- if(tsip_message_parse(&state, &message, tsk_false/* do not extract the content */) == tsk_true){
- tsk_size_t clen = TSIP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header (see RFC 3261 - 7.5). If no CL header then the macro return zero. */
- if(clen == 0){ /* No content */
- tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove SIP headers and CRLF */
- }
- else{ /* There is a content */
- if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(peer->rcv_buff_stream)){ /* There is content but not all the content. */
- TSK_DEBUG_INFO("No all SIP content in the TCP buffer (clen=%u and %u > %u).", clen, (endOfheaders + 4/*2CRLF*/ + clen), TSK_BUFFER_SIZE(peer->rcv_buff_stream));
- goto bail;
- }
- else{
- /* Add the content to the message. */
- tsip_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(peer->rcv_buff_stream) + endOfheaders + 4/*2CRLF*/, clen);
- /* Remove SIP headers, CRLF and the content. */
- tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/ + clen));
- }
- }
- }
- else {
- TSK_DEBUG_ERROR("Failed to parse pending stream....reset buffer");
- tsk_buffer_cleanup(peer->rcv_buff_stream);
- }
-
- if(message && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To){
- /* Signal we got at least one valid SIP message */
- peer->got_valid_sip_msg = tsk_true;
- /* Set fd */
- message->local_fd = e->local_fd;
- message->src_net_type = transport->type;
- /* Alert transaction/dialog layer */
- ret = tsip_transport_layer_handle_incoming_msg(transport, message);
- /* Parse next chunck */
- if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MIN_STREAM_CHUNCK_SIZE){
- /* message already passed to the dialog/transac layers */
- TSK_OBJECT_SAFE_FREE(message);
- goto parse_buffer;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse SIP message");
- ret = -15;
- }
+ if((endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(peer->rcv_buff_stream),TSK_BUFFER_SIZE(peer->rcv_buff_stream), "\r\n\r\n"/*2CRLF*/)) < 0) {
+ TSK_DEBUG_INFO("No all SIP headers in the TCP buffer.");
+ goto bail;
+ }
+
+ /* If we are there this mean that we have all SIP headers.
+ * ==> Parse the SIP message without the content.
+ */
+ tsk_ragel_state_init(&state, TSK_BUFFER_DATA(peer->rcv_buff_stream), endOfheaders + 4/*2CRLF*/);
+ if(tsip_message_parse(&state, &message, tsk_false/* do not extract the content */) == tsk_true) {
+ tsk_size_t clen = TSIP_MESSAGE_CONTENT_LENGTH(message); /* MUST have content-length header (see RFC 3261 - 7.5). If no CL header then the macro return zero. */
+ if(clen == 0) { /* No content */
+ tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove SIP headers and CRLF */
+ }
+ else { /* There is a content */
+ if((endOfheaders + 4/*2CRLF*/ + clen) > TSK_BUFFER_SIZE(peer->rcv_buff_stream)) { /* There is content but not all the content. */
+ TSK_DEBUG_INFO("No all SIP content in the TCP buffer (clen=%u and %u > %u).", clen, (endOfheaders + 4/*2CRLF*/ + clen), TSK_BUFFER_SIZE(peer->rcv_buff_stream));
+ goto bail;
+ }
+ else {
+ /* Add the content to the message. */
+ tsip_message_add_content(message, tsk_null, TSK_BUFFER_TO_U8(peer->rcv_buff_stream) + endOfheaders + 4/*2CRLF*/, clen);
+ /* Remove SIP headers, CRLF and the content. */
+ tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/ + clen));
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse pending stream....reset buffer");
+ tsk_buffer_cleanup(peer->rcv_buff_stream);
+ }
+
+ if(message && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To) {
+ /* Signal we got at least one valid SIP message */
+ peer->got_valid_sip_msg = tsk_true;
+ /* Set fd */
+ message->local_fd = e->local_fd;
+ message->src_net_type = transport->type;
+ /* Alert transaction/dialog layer */
+ ret = tsip_transport_layer_handle_incoming_msg(transport, message);
+ /* Parse next chunck */
+ if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MIN_STREAM_CHUNCK_SIZE) {
+ /* message already passed to the dialog/transac layers */
+ TSK_OBJECT_SAFE_FREE(message);
+ goto parse_buffer;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse SIP message");
+ ret = -15;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(message);
- TSK_OBJECT_SAFE_FREE(peer);
+ TSK_OBJECT_SAFE_FREE(message);
+ TSK_OBJECT_SAFE_FREE(peer);
- return ret;
+ return ret;
}
/*== Non-blocking callback function (STREAM: WS, WSS) */
static int tsip_transport_layer_ws_cb(const tnet_transport_event_t* e)
{
- int ret = -1;
- tsk_ragel_state_t state;
- tsip_message_t *message = tsk_null;
- int endOfheaders = -1;
- tsip_transport_t *transport = (tsip_transport_t *)e->callback_data;
- tsk_bool_t check_end_of_hdrs = tsk_true;
- tsk_bool_t go_message = tsk_false;
- uint64_t data_len = 0;
- uint64_t pay_len = 0;
- tsip_transport_stream_peer_t* peer;
-
- switch(e->type){
- case event_data: {
- break;
- }
- case event_closed:
- case event_error:
- case event_removed:
- {
- tsip_transport_stream_peer_t* peer;
- TSK_DEBUG_INFO("WebSocket Peer closed with fd = %d", e->local_fd);
- if((peer = tsip_transport_pop_stream_peer_by_local_fd(transport, e->local_fd))){
- tsip_dialog_layer_signal_peer_disconnected(TSIP_STACK(transport->stack)->layer_dialog, peer);
- TSK_OBJECT_SAFE_FREE(peer);
- }
- return 0;
- }
- case event_accepted:
- case event_connected:
- {
- TSK_DEBUG_INFO("WebSocket Peer accepted/connected with fd = %d", e->local_fd);
- return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
- }
- default:{
- return 0;
- }
- }
-
- if(!(peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))){
- TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", e->local_fd);
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- return -1;
- }
-
- /* Update latest time activity */
- peer->time_latest_activity = tsk_time_now();
-
- /* Check if buffer is too big to be valid (have we missed some chuncks?) */
- if((TSK_BUFFER_SIZE(peer->rcv_buff_stream) + e->size) >= TSIP_MAX_STREAM_CHUNCK_SIZE){
- TSK_DEBUG_ERROR("TCP Buffer is too big to be valid");
- tsk_buffer_cleanup(peer->rcv_buff_stream);
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
-
- // Append new content
- tsk_buffer_append(peer->rcv_buff_stream, e->data, e->size);
-
- /* Check if WebSocket data */
- if(peer->rcv_buff_stream->size > 4){
- const uint8_t* pdata = (const uint8_t*)peer->rcv_buff_stream->data;
- tsk_bool_t is_GET = (pdata[0] == 'G' && pdata[1] == 'E' && pdata[2] == 'T');
- if (!peer->ws.handshaking_done && !is_GET) {
- TSK_DEBUG_ERROR("WS handshaking not done yet");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
- check_end_of_hdrs = is_GET;
- }
-
- /* Check if we have all HTTP/SIP/WS headers. */
+ int ret = -1;
+ tsk_ragel_state_t state;
+ tsip_message_t *message = tsk_null;
+ int endOfheaders = -1;
+ tsip_transport_t *transport = (tsip_transport_t *)e->callback_data;
+ tsk_bool_t check_end_of_hdrs = tsk_true;
+ tsk_bool_t go_message = tsk_false;
+ uint64_t data_len = 0;
+ uint64_t pay_len = 0;
+ tsip_transport_stream_peer_t* peer;
+
+ switch(e->type) {
+ case event_data: {
+ break;
+ }
+ case event_closed:
+ case event_error:
+ case event_removed: {
+ tsip_transport_stream_peer_t* peer;
+ TSK_DEBUG_INFO("WebSocket Peer closed with fd = %d", e->local_fd);
+ if((peer = tsip_transport_pop_stream_peer_by_local_fd(transport, e->local_fd))) {
+ tsip_dialog_layer_signal_peer_disconnected(TSIP_STACK(transport->stack)->layer_dialog, peer);
+ TSK_OBJECT_SAFE_FREE(peer);
+ }
+ return 0;
+ }
+ case event_accepted:
+ case event_connected: {
+ TSK_DEBUG_INFO("WebSocket Peer accepted/connected with fd = %d", e->local_fd);
+ return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
+ }
+ default: {
+ return 0;
+ }
+ }
+
+ if(!(peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))) {
+ TSK_DEBUG_ERROR("Failed to find peer with local fd equal to %d", e->local_fd);
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ return -1;
+ }
+
+ /* Update latest time activity */
+ peer->time_latest_activity = tsk_time_now();
+
+ /* Check if buffer is too big to be valid (have we missed some chuncks?) */
+ if((TSK_BUFFER_SIZE(peer->rcv_buff_stream) + e->size) >= TSIP_MAX_STREAM_CHUNCK_SIZE) {
+ TSK_DEBUG_ERROR("TCP Buffer is too big to be valid");
+ tsk_buffer_cleanup(peer->rcv_buff_stream);
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+
+ // Append new content
+ tsk_buffer_append(peer->rcv_buff_stream, e->data, e->size);
+
+ /* Check if WebSocket data */
+ if(peer->rcv_buff_stream->size > 4) {
+ const uint8_t* pdata = (const uint8_t*)peer->rcv_buff_stream->data;
+ tsk_bool_t is_GET = (pdata[0] == 'G' && pdata[1] == 'E' && pdata[2] == 'T');
+ if (!peer->ws.handshaking_done && !is_GET) {
+ TSK_DEBUG_ERROR("WS handshaking not done yet");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+ check_end_of_hdrs = is_GET;
+ }
+
+ /* Check if we have all HTTP/SIP/WS headers. */
parse_buffer:
- if(check_end_of_hdrs && (endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(peer->rcv_buff_stream),TSK_BUFFER_SIZE(peer->rcv_buff_stream), "\r\n\r\n"/*2CRLF*/)) < 0){
- TSK_DEBUG_INFO("No all headers in the WS buffer");
- goto bail;
- }
-
- /* WebSocket handling*/
- if(peer->rcv_buff_stream->size > 4){
- const uint8_t* pdata = (const uint8_t*)peer->rcv_buff_stream->data;
-
- /* WebSocket Handshake */
- if(pdata[0] == 'G' && pdata[1] == 'E' && pdata[2] == 'T'){
- thttp_message_t *http_req = thttp_message_create();
- thttp_response_t *http_resp = tsk_null;
- tsk_buffer_t *http_buff = tsk_null;
- const thttp_header_Sec_WebSocket_Protocol_t* http_hdr_proto;
- const thttp_header_Sec_WebSocket_Key_t* http_hdr_key;
- const char* msg_start = (const char*)peer->rcv_buff_stream->data;
- const char* msg_end = (msg_start + peer->rcv_buff_stream->size);
- int32_t idx;
-
- if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) > 2){
- TSK_DEBUG_INFO("WebSocket handshake message: %.*s", (msg_end - msg_start), msg_start);
- msg_start += (idx + 2); // skip request header
- while(msg_start < msg_end){
- if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) <= 2){
- break;
- }
- idx+= 2;
- tsk_ragel_state_init(&state, msg_start, idx);
- if((ret = thttp_header_parse(&state, http_req))){
- TSK_DEBUG_ERROR("Failed to parse header: %s", msg_start);
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
- msg_start += idx;
- }
- }
-
- // get key header
- if(!(http_hdr_key = (const thttp_header_Sec_WebSocket_Key_t*)thttp_message_get_header(http_req, thttp_htype_Sec_WebSocket_Key))){
- TSK_DEBUG_ERROR("No 'Sec-WebSocket-Key' header");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
-
-
- if(http_hdr_key && (http_hdr_proto = (const thttp_header_Sec_WebSocket_Protocol_t*)thttp_message_get_header(http_req, thttp_htype_Sec_WebSocket_Protocol))){
- if(tsk_list_find_object_by_pred((const tsk_list_t*)http_hdr_proto->values, tsk_string_pred_icmp, "sip")){
- // send response
- if((http_resp = thttp_response_new((short)101, "Switching Protocols", http_req))){
- // compute response key
- thttp_auth_ws_keystring_t key_resp = {0};
- thttp_auth_ws_response(http_hdr_key->value, &key_resp);
-
- thttp_message_add_headers_2(http_resp,
- THTTP_HEADER_DUMMY_VA_ARGS("Upgrade", "websocket"),
- THTTP_HEADER_DUMMY_VA_ARGS("Connection", "Upgrade"),
- THTTP_HEADER_SEC_WEBSOCKET_ACCEPT_VA_ARGS(key_resp),
- THTTP_HEADER_SEC_WEBSOCKET_PROTOCOL_VA_ARGS("sip"),
- THTTP_HEADER_SEC_WEBSOCKET_VERSION_VA_ARGS("13"),
- tsk_null);
-
- // serialize response
- if((http_buff = tsk_buffer_create_null())){
- thttp_message_serialize(http_resp, http_buff);
- // TSK_DEBUG_INFO("WS response=%s", http_buff->data);
- // send response
- if((tnet_transport_send(transport->net_transport, e->local_fd, http_buff->data, http_buff->size)) != http_buff->size){
- TSK_DEBUG_ERROR("Failed to send reponse");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
- }
- else {
- TSK_DEBUG_ERROR("Failed to create buffer");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
- peer->ws.handshaking_done = tsk_true; // WS handshaking done
- }
- }
- else{
- TSK_DEBUG_ERROR("Not SIP protocol");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
- }
- else{
- TSK_DEBUG_ERROR("No 'Sec-WebSocket-Protocol' header");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- goto bail;
- }
-
- tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF */
- TSK_OBJECT_SAFE_FREE(http_req);
- TSK_OBJECT_SAFE_FREE(http_resp);
- TSK_OBJECT_SAFE_FREE(http_buff);
- } /* end-of WebSocket handshake */
-
- /* WebSocket data */
- else{
- const uint8_t opcode = pdata[0] & 0x0F;
- if((pdata[0] & 0x01)/* FIN */){
- const uint8_t mask_flag = (pdata[1] >> 7); // Must be "1" for "client -> server"
- uint8_t mask_key[4] = { 0x00 };
- uint64_t pay_idx;
- uint8_t* pws_rcv_buffer;
-
- if(pdata[0] & 0x40 || pdata[0] & 0x20 || pdata[0] & 0x10){
- TSK_DEBUG_ERROR("Unknown extension: %d", (pdata[0] >> 4) & 0x07);
- tsk_buffer_cleanup(peer->rcv_buff_stream);
- goto bail;
- }
-
- pay_len = pdata[1] & 0x7F;
- data_len = 2;
-
- if(pay_len == 126){
- if(peer->rcv_buff_stream->size < 4) { TSK_DEBUG_WARN("Too short"); goto bail; }
- pay_len = (pdata[2] << 8 | pdata[3]);
- pdata = &pdata[4];
- data_len += 2;
- }
- else if(pay_len == 127){
- if((peer->rcv_buff_stream->size - data_len) < 8) { TSK_DEBUG_WARN("Too short"); goto bail; }
- pay_len = (((uint64_t)pdata[2]) << 56 | ((uint64_t)pdata[3]) << 48 | ((uint64_t)pdata[4]) << 40 | ((uint64_t)pdata[5]) << 32 | ((uint64_t)pdata[6]) << 24 | ((uint64_t)pdata[7]) << 16 | ((uint64_t)pdata[8]) << 8 || ((uint64_t)pdata[9]));
- pdata = &pdata[10];
- data_len += 8;
- }
- else{
- pdata = &pdata[2];
- }
-
- if(mask_flag){ // must be "true"
- if((peer->rcv_buff_stream->size - data_len) < 4) { TSK_DEBUG_WARN("Too short"); goto bail; }
- mask_key[0] = pdata[0];
- mask_key[1] = pdata[1];
- mask_key[2] = pdata[2];
- mask_key[3] = pdata[3];
- pdata = &pdata[4];
- data_len += 4;
- }
-
- if((peer->rcv_buff_stream->size - data_len) < pay_len){
- TSK_DEBUG_INFO("No all data in the WS buffer");
- goto bail;
- }
-
- // create ws buffer tohold unmasked data
- if(peer->ws.rcv_buffer_size < pay_len){
- if(!(peer->ws.rcv_buffer = tsk_realloc(peer->ws.rcv_buffer, (tsk_size_t)pay_len))){
- TSK_DEBUG_ERROR("Failed to allocate buffer of size %lld", pay_len);
- peer->ws.rcv_buffer_size = 0;
- goto bail;
- }
- peer->ws.rcv_buffer_size = (tsk_size_t)pay_len;
- }
-
- pws_rcv_buffer = (uint8_t*)peer->ws.rcv_buffer;
- data_len += pay_len;
-
- // unmasking the payload
- for(pay_idx = 0; pay_idx < pay_len; ++pay_idx){
- pws_rcv_buffer[pay_idx] = (pdata[pay_idx] ^ mask_key[(pay_idx & 3)]);
- }
-
- go_message = tsk_true;
- }
- else if(opcode == 0x08){ // RFC6455 - 5.5.1. Close
- TSK_DEBUG_INFO("WebSocket opcode 0x8 (Close)");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- }
- }
- }/* end-of WebSocket handling */
-
- // skip SIP message parsing if websocket transport
-
- if(!go_message){
- goto bail;
- }
-
- // If we are there this mean that we have all SIP headers.
- // ==> Parse the SIP message without the content.
- TSK_DEBUG_INFO("Receiving SIP o/ WebSocket message: %.*s", pay_len, (const char*)peer->ws.rcv_buffer);
- tsk_ragel_state_init(&state, peer->ws.rcv_buffer, (tsk_size_t)pay_len);
- if (tsip_message_parse(&state, &message, tsk_false/* do not extract the content */) == tsk_true) {
- const uint8_t* body_start = (const uint8_t*)state.eoh;
- int64_t clen = (pay_len - (int64_t)(body_start - ((const uint8_t*)peer->ws.rcv_buffer)));
- if (clen > 0) {
- // Add the content to the message. */
- tsip_message_add_content(message, tsk_null, body_start, (tsk_size_t)clen);
- }
- tsk_buffer_remove(peer->rcv_buff_stream, 0, (tsk_size_t)data_len);
- }
-
- if(message && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To){
- /* Signal we got at least one valid SIP message */
- peer->got_valid_sip_msg = tsk_true;
- /* Set fd */
- message->local_fd = e->local_fd;
- message->src_net_type = transport->type;
- /* Alert transaction/dialog layer */
- ret = tsip_transport_layer_handle_incoming_msg(transport, message);
- /* Parse next chunck */
- if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MIN_STREAM_CHUNCK_SIZE){
- /* message already passed to the dialog/transac layers */
- TSK_OBJECT_SAFE_FREE(message);
- goto parse_buffer;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to parse SIP message");
- tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
- ret = -15;
- goto bail;
- }
+ if(check_end_of_hdrs && (endOfheaders = tsk_strindexOf(TSK_BUFFER_DATA(peer->rcv_buff_stream),TSK_BUFFER_SIZE(peer->rcv_buff_stream), "\r\n\r\n"/*2CRLF*/)) < 0) {
+ TSK_DEBUG_INFO("No all headers in the WS buffer");
+ goto bail;
+ }
+
+ /* WebSocket handling*/
+ if(peer->rcv_buff_stream->size > 4) {
+ const uint8_t* pdata = (const uint8_t*)peer->rcv_buff_stream->data;
+
+ /* WebSocket Handshake */
+ if(pdata[0] == 'G' && pdata[1] == 'E' && pdata[2] == 'T') {
+ thttp_message_t *http_req = thttp_message_create();
+ thttp_response_t *http_resp = tsk_null;
+ tsk_buffer_t *http_buff = tsk_null;
+ const thttp_header_Sec_WebSocket_Protocol_t* http_hdr_proto;
+ const thttp_header_Sec_WebSocket_Key_t* http_hdr_key;
+ const char* msg_start = (const char*)peer->rcv_buff_stream->data;
+ const char* msg_end = (msg_start + peer->rcv_buff_stream->size);
+ int32_t idx;
+
+ if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) > 2) {
+ TSK_DEBUG_INFO("WebSocket handshake message: %.*s", (msg_end - msg_start), msg_start);
+ msg_start += (idx + 2); // skip request header
+ while(msg_start < msg_end) {
+ if((idx = tsk_strindexOf(msg_start, (msg_end - msg_start), "\r\n")) <= 2) {
+ break;
+ }
+ idx+= 2;
+ tsk_ragel_state_init(&state, msg_start, idx);
+ if((ret = thttp_header_parse(&state, http_req))) {
+ TSK_DEBUG_ERROR("Failed to parse header: %s", msg_start);
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+ msg_start += idx;
+ }
+ }
+
+ // get key header
+ if(!(http_hdr_key = (const thttp_header_Sec_WebSocket_Key_t*)thttp_message_get_header(http_req, thttp_htype_Sec_WebSocket_Key))) {
+ TSK_DEBUG_ERROR("No 'Sec-WebSocket-Key' header");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+
+
+ if(http_hdr_key && (http_hdr_proto = (const thttp_header_Sec_WebSocket_Protocol_t*)thttp_message_get_header(http_req, thttp_htype_Sec_WebSocket_Protocol))) {
+ if(tsk_list_find_object_by_pred((const tsk_list_t*)http_hdr_proto->values, tsk_string_pred_icmp, "sip")) {
+ // send response
+ if((http_resp = thttp_response_new((short)101, "Switching Protocols", http_req))) {
+ // compute response key
+ thttp_auth_ws_keystring_t key_resp = {0};
+ thttp_auth_ws_response(http_hdr_key->value, &key_resp);
+
+ thttp_message_add_headers_2(http_resp,
+ THTTP_HEADER_DUMMY_VA_ARGS("Upgrade", "websocket"),
+ THTTP_HEADER_DUMMY_VA_ARGS("Connection", "Upgrade"),
+ THTTP_HEADER_SEC_WEBSOCKET_ACCEPT_VA_ARGS(key_resp),
+ THTTP_HEADER_SEC_WEBSOCKET_PROTOCOL_VA_ARGS("sip"),
+ THTTP_HEADER_SEC_WEBSOCKET_VERSION_VA_ARGS("13"),
+ tsk_null);
+
+ // serialize response
+ if((http_buff = tsk_buffer_create_null())) {
+ thttp_message_serialize(http_resp, http_buff);
+ // TSK_DEBUG_INFO("WS response=%s", http_buff->data);
+ // send response
+ if((tnet_transport_send(transport->net_transport, e->local_fd, http_buff->data, http_buff->size)) != http_buff->size) {
+ TSK_DEBUG_ERROR("Failed to send reponse");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create buffer");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+ peer->ws.handshaking_done = tsk_true; // WS handshaking done
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Not SIP protocol");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("No 'Sec-WebSocket-Protocol' header");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ goto bail;
+ }
+
+ tsk_buffer_remove(peer->rcv_buff_stream, 0, (endOfheaders + 4/*2CRLF*/)); /* Remove HTTP headers and CRLF */
+ TSK_OBJECT_SAFE_FREE(http_req);
+ TSK_OBJECT_SAFE_FREE(http_resp);
+ TSK_OBJECT_SAFE_FREE(http_buff);
+ } /* end-of WebSocket handshake */
+
+ /* WebSocket data */
+ else {
+ const uint8_t opcode = pdata[0] & 0x0F;
+ if((pdata[0] & 0x01)/* FIN */) {
+ const uint8_t mask_flag = (pdata[1] >> 7); // Must be "1" for "client -> server"
+ uint8_t mask_key[4] = { 0x00 };
+ uint64_t pay_idx;
+ uint8_t* pws_rcv_buffer;
+
+ if(pdata[0] & 0x40 || pdata[0] & 0x20 || pdata[0] & 0x10) {
+ TSK_DEBUG_ERROR("Unknown extension: %d", (pdata[0] >> 4) & 0x07);
+ tsk_buffer_cleanup(peer->rcv_buff_stream);
+ goto bail;
+ }
+
+ pay_len = pdata[1] & 0x7F;
+ data_len = 2;
+
+ if(pay_len == 126) {
+ if(peer->rcv_buff_stream->size < 4) {
+ TSK_DEBUG_WARN("Too short");
+ goto bail;
+ }
+ pay_len = (pdata[2] << 8 | pdata[3]);
+ pdata = &pdata[4];
+ data_len += 2;
+ }
+ else if(pay_len == 127) {
+ if((peer->rcv_buff_stream->size - data_len) < 8) {
+ TSK_DEBUG_WARN("Too short");
+ goto bail;
+ }
+ pay_len = (((uint64_t)pdata[2]) << 56 | ((uint64_t)pdata[3]) << 48 | ((uint64_t)pdata[4]) << 40 | ((uint64_t)pdata[5]) << 32 | ((uint64_t)pdata[6]) << 24 | ((uint64_t)pdata[7]) << 16 | ((uint64_t)pdata[8]) << 8 || ((uint64_t)pdata[9]));
+ pdata = &pdata[10];
+ data_len += 8;
+ }
+ else {
+ pdata = &pdata[2];
+ }
+
+ if(mask_flag) { // must be "true"
+ if((peer->rcv_buff_stream->size - data_len) < 4) {
+ TSK_DEBUG_WARN("Too short");
+ goto bail;
+ }
+ mask_key[0] = pdata[0];
+ mask_key[1] = pdata[1];
+ mask_key[2] = pdata[2];
+ mask_key[3] = pdata[3];
+ pdata = &pdata[4];
+ data_len += 4;
+ }
+
+ if((peer->rcv_buff_stream->size - data_len) < pay_len) {
+ TSK_DEBUG_INFO("No all data in the WS buffer");
+ goto bail;
+ }
+
+ // create ws buffer tohold unmasked data
+ if(peer->ws.rcv_buffer_size < pay_len) {
+ if(!(peer->ws.rcv_buffer = tsk_realloc(peer->ws.rcv_buffer, (tsk_size_t)pay_len))) {
+ TSK_DEBUG_ERROR("Failed to allocate buffer of size %lld", pay_len);
+ peer->ws.rcv_buffer_size = 0;
+ goto bail;
+ }
+ peer->ws.rcv_buffer_size = (tsk_size_t)pay_len;
+ }
+
+ pws_rcv_buffer = (uint8_t*)peer->ws.rcv_buffer;
+ data_len += pay_len;
+
+ // unmasking the payload
+ for(pay_idx = 0; pay_idx < pay_len; ++pay_idx) {
+ pws_rcv_buffer[pay_idx] = (pdata[pay_idx] ^ mask_key[(pay_idx & 3)]);
+ }
+
+ go_message = tsk_true;
+ }
+ else if(opcode == 0x08) { // RFC6455 - 5.5.1. Close
+ TSK_DEBUG_INFO("WebSocket opcode 0x8 (Close)");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ }
+ }
+ }/* end-of WebSocket handling */
+
+ // skip SIP message parsing if websocket transport
+
+ if(!go_message) {
+ goto bail;
+ }
+
+ // If we are there this mean that we have all SIP headers.
+ // ==> Parse the SIP message without the content.
+ TSK_DEBUG_INFO("Receiving SIP o/ WebSocket message: %.*s", pay_len, (const char*)peer->ws.rcv_buffer);
+ tsk_ragel_state_init(&state, peer->ws.rcv_buffer, (tsk_size_t)pay_len);
+ if (tsip_message_parse(&state, &message, tsk_false/* do not extract the content */) == tsk_true) {
+ const uint8_t* body_start = (const uint8_t*)state.eoh;
+ int64_t clen = (pay_len - (int64_t)(body_start - ((const uint8_t*)peer->ws.rcv_buffer)));
+ if (clen > 0) {
+ // Add the content to the message. */
+ tsip_message_add_content(message, tsk_null, body_start, (tsk_size_t)clen);
+ }
+ tsk_buffer_remove(peer->rcv_buff_stream, 0, (tsk_size_t)data_len);
+ }
+
+ if(message && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To) {
+ /* Signal we got at least one valid SIP message */
+ peer->got_valid_sip_msg = tsk_true;
+ /* Set fd */
+ message->local_fd = e->local_fd;
+ message->src_net_type = transport->type;
+ /* Alert transaction/dialog layer */
+ ret = tsip_transport_layer_handle_incoming_msg(transport, message);
+ /* Parse next chunck */
+ if(TSK_BUFFER_SIZE(peer->rcv_buff_stream) >= TSIP_MIN_STREAM_CHUNCK_SIZE) {
+ /* message already passed to the dialog/transac layers */
+ TSK_OBJECT_SAFE_FREE(message);
+ goto parse_buffer;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to parse SIP message");
+ tsip_transport_remove_socket(transport, (tnet_fd_t *)&e->local_fd);
+ ret = -15;
+ goto bail;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(message);
- TSK_OBJECT_SAFE_FREE(peer);
+ TSK_OBJECT_SAFE_FREE(message);
+ TSK_OBJECT_SAFE_FREE(peer);
- return ret;
+ return ret;
}
/*== Non-blocking callback function (DGRAM: UDP) */
static int tsip_transport_layer_dgram_cb(const tnet_transport_event_t* e)
{
- int ret = -1;
- tsk_ragel_state_t state;
- tsip_message_t *message = tsk_null;
- const tsip_transport_t *transport = e->callback_data;
- const char* data_ptr;
- tsk_size_t data_size;
- char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
-
- switch(e->type){
- case event_data: {
- TSK_DEBUG_INFO("\n\nRECV:%.*s\n\n", e->size, (const char*)e->data);
- break;
- }
- case event_closed:
- case event_connected:
- default:{
- return 0;
- }
- }
-
- /* === SigComp === */
- if(TSIP_IS_SIGCOMP_DATA(e->data)){
- //======
- // FIXME: This implmentation will always use the first SigComp-Id for decompression
- // The destination addr will always be the pcscf which will not work for server mode
- //=====
- tsk_bool_t is_nack;
- const char* comp_id;
-
- comp_id = tsip_sigcomp_handler_fixme_getcompid(transport->stack->sigcomp.handle);
- data_size = tsip_sigcomp_handler_uncompressUDP(transport->stack->sigcomp.handle, comp_id, e->data, e->size, SigCompBuffer, sizeof(SigCompBuffer), &is_nack);
- data_ptr = SigCompBuffer;
- if(data_size){
- if(is_nack){
- tsip_transport_send_raw(transport, tsk_null, 0, data_ptr, data_size, __null_callid);
- return 0;
- }
- }
- else{
- TSK_DEBUG_ERROR("SigComp decompression has failed");
- return -2;
- }
- }
- else{
- data_ptr = e->data;
- data_size = e->size;
- }
-
- if (data_size == 4 && ((data_ptr[0] == '\r' && data_ptr[1] == '\n'&& data_ptr[2] == '\r' && data_ptr[3] == '\n') || (data_ptr[0] == 0x00 && data_ptr[1] == 0x00 && data_ptr[2] == 0x00 && data_ptr[3] == 0x00))) {
- TSK_DEBUG_INFO("2CRLF");
- tsip_transport_send_raw(transport, tsk_null, 0, data_ptr, data_size, __null_callid);
- return 0;
- }
-
- tsk_ragel_state_init(&state, data_ptr, data_size);
- if(tsip_message_parse(&state, &message, tsk_true) == tsk_true
- && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To)
- {
- /* Set local fd used to receive the message and the address of the remote peer */
- message->local_fd = e->local_fd;
- message->remote_addr = e->remote_addr;
- message->src_net_type = transport->type;
-
- /* RFC 3581 - 4. Server Behavior
- When a server compliant to this specification (which can be a proxy
- or UAS) receives a request, it examines the topmost Via header field
- value. If this Via header field value contains an "rport" parameter
- with no value, it MUST set the value of the parameter to the source
- port of the request. This is analogous to the way in which a server
- will insert the "received" parameter into the topmost Via header
- field value. In fact, the server MUST insert a "received" parameter
- containing the source IP address that the request came from, even if
- it is identical to the value of the "sent-by" component. Note that
- this processing takes place independent of the transport protocol.
- */
- if(TSIP_MESSAGE_IS_REQUEST(message) && TSIP_STACK_MODE_IS_SERVER(transport->stack)){
- if(message->firstVia->rport == 0){ // 0: exist with no value; -1: doesn't exist; other contains the rport value
- tnet_ip_t ip;
- tnet_port_t port;
- if((ret = tnet_get_sockip_n_port((const struct sockaddr*)&e->remote_addr, &ip, &port)) == 0){
- message->firstVia->rport = (int32_t)port;
- tsk_strupdate(&message->firstVia->received, (const char*)ip);
- }
- }
- }
-
-
- /* Alert transaction/dialog layer */
- ret = tsip_transport_layer_handle_incoming_msg(transport, message);
- }
- TSK_OBJECT_SAFE_FREE(message);
-
- return ret;
+ int ret = -1;
+ tsk_ragel_state_t state;
+ tsip_message_t *message = tsk_null;
+ const tsip_transport_t *transport = e->callback_data;
+ const char* data_ptr;
+ tsk_size_t data_size;
+ char SigCompBuffer[TSIP_SIGCOMP_MAX_BUFF_SIZE];
+
+ switch(e->type) {
+ case event_data: {
+ TSK_DEBUG_INFO("\n\nRECV:%.*s\n\n", e->size, (const char*)e->data);
+ break;
+ }
+ case event_closed:
+ case event_connected:
+ default: {
+ return 0;
+ }
+ }
+
+ /* === SigComp === */
+ if(TSIP_IS_SIGCOMP_DATA(e->data)) {
+ //======
+ // FIXME: This implmentation will always use the first SigComp-Id for decompression
+ // The destination addr will always be the pcscf which will not work for server mode
+ //=====
+ tsk_bool_t is_nack;
+ const char* comp_id;
+
+ comp_id = tsip_sigcomp_handler_fixme_getcompid(transport->stack->sigcomp.handle);
+ data_size = tsip_sigcomp_handler_uncompressUDP(transport->stack->sigcomp.handle, comp_id, e->data, e->size, SigCompBuffer, sizeof(SigCompBuffer), &is_nack);
+ data_ptr = SigCompBuffer;
+ if(data_size) {
+ if(is_nack) {
+ tsip_transport_send_raw(transport, tsk_null, 0, data_ptr, data_size, __null_callid);
+ return 0;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("SigComp decompression has failed");
+ return -2;
+ }
+ }
+ else {
+ data_ptr = e->data;
+ data_size = e->size;
+ }
+
+ if (data_size == 4 && ((data_ptr[0] == '\r' && data_ptr[1] == '\n'&& data_ptr[2] == '\r' && data_ptr[3] == '\n') || (data_ptr[0] == 0x00 && data_ptr[1] == 0x00 && data_ptr[2] == 0x00 && data_ptr[3] == 0x00))) {
+ TSK_DEBUG_INFO("2CRLF");
+ tsip_transport_send_raw(transport, tsk_null, 0, data_ptr, data_size, __null_callid);
+ return 0;
+ }
+
+ tsk_ragel_state_init(&state, data_ptr, data_size);
+ if(tsip_message_parse(&state, &message, tsk_true) == tsk_true
+ && message->firstVia && message->Call_ID && message->CSeq && message->From && message->To) {
+ /* Set local fd used to receive the message and the address of the remote peer */
+ message->local_fd = e->local_fd;
+ message->remote_addr = e->remote_addr;
+ message->src_net_type = transport->type;
+
+ /* RFC 3581 - 4. Server Behavior
+ When a server compliant to this specification (which can be a proxy
+ or UAS) receives a request, it examines the topmost Via header field
+ value. If this Via header field value contains an "rport" parameter
+ with no value, it MUST set the value of the parameter to the source
+ port of the request. This is analogous to the way in which a server
+ will insert the "received" parameter into the topmost Via header
+ field value. In fact, the server MUST insert a "received" parameter
+ containing the source IP address that the request came from, even if
+ it is identical to the value of the "sent-by" component. Note that
+ this processing takes place independent of the transport protocol.
+ */
+ if(TSIP_MESSAGE_IS_REQUEST(message) && TSIP_STACK_MODE_IS_SERVER(transport->stack)) {
+ if(message->firstVia->rport == 0) { // 0: exist with no value; -1: doesn't exist; other contains the rport value
+ tnet_ip_t ip;
+ tnet_port_t port;
+ if((ret = tnet_get_sockip_n_port((const struct sockaddr*)&e->remote_addr, &ip, &port)) == 0) {
+ message->firstVia->rport = (int32_t)port;
+ tsk_strupdate(&message->firstVia->received, (const char*)ip);
+ }
+ }
+ }
+
+
+ /* Alert transaction/dialog layer */
+ ret = tsip_transport_layer_handle_incoming_msg(transport, message);
+ }
+ TSK_OBJECT_SAFE_FREE(message);
+
+ return ret;
}
static const tsip_transport_t* tsip_transport_layer_find(const tsip_transport_layer_t* self, tsip_message_t *msg, char** destIP, int32_t *destPort)
{
- const tsip_transport_t* transport = tsk_null;
-
- if(!self || !destIP){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- // check whether the message already contains destination address (most likely retransmitted)
- if(!tsk_strnullORempty(msg->dst_address) && msg->dst_port && TNET_SOCKET_TYPE_IS_VALID(msg->dst_net_type)){
- const tsk_list_item_t *item;
- tsk_strupdate(destIP, msg->dst_address);
- *destPort = msg->dst_port;
- tsk_list_foreach(item, self->transports){
- if(((const tsip_transport_t*)item->data)->type == msg->dst_net_type){
- transport = ((const tsip_transport_t*)item->data);
- goto bail;
- }
- }
- }
-
- // use default values
- tsk_strupdate(destIP, self->stack->network.proxy_cscf[self->stack->network.transport_idx_default]);
- *destPort = self->stack->network.proxy_cscf_port[self->stack->network.transport_idx_default];
-
- /* =========== Sending Request =========
- *
- */
- if(TSIP_MESSAGE_IS_REQUEST(msg)){
- tsip_dialog_t* dialog;
- tsk_list_item_t *item;
- tsip_transport_t *curr;
- tnet_socket_type_t destNetType = self->stack->network.transport_types[self->stack->network.transport_idx_default];
- /* RFC 3261 - 18.1.1 Sending Requests
- If the port is absent, the default value depends on the transport. It is 5060 for UDP, TCP and SCTP, 5061 for TLS. */
- // int32_t destDefaultPort = TNET_SOCKET_TYPE_IS_TLS(destNetType) ? 5061 : 5060;
-
- /* If message received over WebSocket transport and stack is running in w2s mode then forward to the first route if available */
- if((self->stack->network.mode == tsip_stack_mode_webrtc2sip)){
- const tsip_header_Route_t *route_first;
- if((route_first = (const tsip_header_Route_t*)tsip_message_get_header(msg, tsip_htype_Route)) && route_first->uri && !tsk_strnullORempty(route_first->uri->host)){
- const char* transport_str = tsk_params_get_param_value(route_first->uri->params, "transport");
- const tsip_header_Route_t *route;
- tnet_port_t local_port;
- const char *local_ip;
- int t_idx = -1, route_i = 0;
- if(!tsk_strnullORempty(transport_str)){
- t_idx = tsip_transport_get_idx_by_name(transport_str);
- if(t_idx != -1){
- destNetType = self->stack->network.transport_types[t_idx];
- }
- }
- tsk_strupdate(destIP, route_first->uri->host);
- *destPort = (route_first->uri->port ? route_first->uri->port : 5060);
-
- local_ip = self->stack->network.local_ip[t_idx == -1 ? self->stack->network.transport_idx_default : t_idx];
- local_port = self->stack->network.local_port[t_idx == -1 ? self->stack->network.transport_idx_default : t_idx];
+ const tsip_transport_t* transport = tsk_null;
+
+ if(!self || !destIP) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ // check whether the message already contains destination address (most likely retransmitted)
+ if(!tsk_strnullORempty(msg->dst_address) && msg->dst_port && TNET_SOCKET_TYPE_IS_VALID(msg->dst_net_type)) {
+ const tsk_list_item_t *item;
+ tsk_strupdate(destIP, msg->dst_address);
+ *destPort = msg->dst_port;
+ tsk_list_foreach(item, self->transports) {
+ if(((const tsip_transport_t*)item->data)->type == msg->dst_net_type) {
+ transport = ((const tsip_transport_t*)item->data);
+ goto bail;
+ }
+ }
+ }
+
+ // use default values
+ tsk_strupdate(destIP, self->stack->network.proxy_cscf[self->stack->network.transport_idx_default]);
+ *destPort = self->stack->network.proxy_cscf_port[self->stack->network.transport_idx_default];
+
+ /* =========== Sending Request =========
+ *
+ */
+ if(TSIP_MESSAGE_IS_REQUEST(msg)) {
+ tsip_dialog_t* dialog;
+ tsk_list_item_t *item;
+ tsip_transport_t *curr;
+ tnet_socket_type_t destNetType = self->stack->network.transport_types[self->stack->network.transport_idx_default];
+ /* RFC 3261 - 18.1.1 Sending Requests
+ If the port is absent, the default value depends on the transport. It is 5060 for UDP, TCP and SCTP, 5061 for TLS. */
+ // int32_t destDefaultPort = TNET_SOCKET_TYPE_IS_TLS(destNetType) ? 5061 : 5060;
+
+ /* If message received over WebSocket transport and stack is running in w2s mode then forward to the first route if available */
+ if((self->stack->network.mode == tsip_stack_mode_webrtc2sip)) {
+ const tsip_header_Route_t *route_first;
+ if((route_first = (const tsip_header_Route_t*)tsip_message_get_header(msg, tsip_htype_Route)) && route_first->uri && !tsk_strnullORempty(route_first->uri->host)) {
+ const char* transport_str = tsk_params_get_param_value(route_first->uri->params, "transport");
+ const tsip_header_Route_t *route;
+ tnet_port_t local_port;
+ const char *local_ip;
+ int t_idx = -1, route_i = 0;
+ if(!tsk_strnullORempty(transport_str)) {
+ t_idx = tsip_transport_get_idx_by_name(transport_str);
+ if(t_idx != -1) {
+ destNetType = self->stack->network.transport_types[t_idx];
+ }
+ }
+ tsk_strupdate(destIP, route_first->uri->host);
+ *destPort = (route_first->uri->port ? route_first->uri->port : 5060);
+
+ local_ip = self->stack->network.local_ip[t_idx == -1 ? self->stack->network.transport_idx_default : t_idx];
+ local_port = self->stack->network.local_port[t_idx == -1 ? self->stack->network.transport_idx_default : t_idx];
clean_routes:
- route_i = 0;
- while((route = (const tsip_header_Route_t *)tsip_message_get_headerAt(msg, tsip_htype_Route, route_i++))){
- if(route && route->uri){
- if(tsk_params_have_param(route->uri->params, "sipml5-outbound") || (tsk_strequals(local_ip, route->uri->host) && local_port == route->uri->port)){
- tsk_list_remove_item_by_data(msg->headers, route);
- goto clean_routes;
- }
- }
- }
- }
- else if(!TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) && !TNET_SOCKET_TYPE_IS_WS(msg->src_net_type)){
- const char* ws_src_ip = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-ip");
- if(ws_src_ip){
- const char* ws_src_port = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-port");
- const char* ws_src_proto = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-proto");
- tsk_strupdate(destIP, ws_src_ip);
- *destPort = atoi(ws_src_port);
- destNetType = self->stack->network.transport_types[tsip_transport_get_idx_by_name(ws_src_proto)];
- }
- }
- }
- else{
- /* Sends request to the first route or remote target */
- dialog = tsip_dialog_layer_find_by_callid(self->stack->layer_dialog, msg->Call_ID->value);
- if(dialog){
- const tsip_header_Record_Route_t* route;
- tsk_bool_t b_using_route = tsk_false;
- tsk_list_foreach(item, dialog->record_routes){
- if(!(route = item->data)){
- continue;
- }
- if(route->uri && route->uri->host){
- tsk_strupdate(destIP, route->uri->host);
- *destPort = route->uri->port > 0 ? route->uri->port : (TNET_SOCKET_TYPE_IS_TLS(destNetType) ? 5061 : 5060);
- b_using_route = tsk_true;
- break;
- }
- }
- if(!b_using_route){
- // Client mode requires the port to be defined (dialog connected) while server mode doesn't.
- if(dialog->uri_remote_target && dialog->uri_remote_target->host && (dialog->uri_remote_target->port || TSIP_STACK_MODE_IS_SERVER(self->stack))){
- const char* transport_name = tsk_params_get_param_value(dialog->uri_remote_target->params, "transport");
- tsk_strupdate(destIP, dialog->uri_remote_target->host);
- *destPort = dialog->uri_remote_target->port ? dialog->uri_remote_target->port : (tsk_striequals(transport_name, "TLS") ? 5061 : 5060);
- if(!tsk_strnullORempty(transport_name)) {
- enum tnet_socket_type_e _destNetType = tsip_transport_get_type_by_name(transport_name);
- if(TNET_SOCKET_TYPE_IS_VALID(_destNetType)) {
- // _destNetType is UDP, TCP, WSSS...and not UDP-IPv4, TCP-IPv6, WSS-IPv4-IPsec...This is why closest match is used.
- destNetType = _destNetType;
- }
- }
- }
- }
- TSK_OBJECT_SAFE_FREE(dialog);
- }
- }
-
- /* Find the right transport using exact/closest match */
- {
- const tsip_transport_t* transport_closest1 = tsk_null;
- const tsip_transport_t* transport_closest2 = tsk_null;
- tsk_list_foreach(item, self->transports){
- curr = item->data;
- if(curr->type == destNetType){
- transport = curr;
- break;
- }
- if((curr->type & destNetType) == destNetType){
- transport_closest1 = curr;
- }
- if(self->stack->network.transport_idx_default>= 0 && curr->type == self->stack->network.transport_types[self->stack->network.transport_idx_default]) {
- transport_closest2 = curr;
- }
- }
- if(!transport && (transport_closest1 || transport_closest2)) {
- const tsip_transport_t* transport_closest = transport_closest1 ? transport_closest1 : transport_closest2;
- // For example, UDP will match with UDP-IPv4-IPSec or UDP-IPv6
- TSK_DEBUG_INFO("Setting transport with closest match(%d->%d)", destNetType, transport_closest->type);
- transport = transport_closest;
- }
- }
-
-
- /* DNS NAPTR + SRV if the Proxy-CSCF is not defined and route set is empty */
- if(transport && !(*destIP) && !self->stack->network.proxy_cscf[self->stack->network.transport_idx_default]){
- tnet_port_t dstPort;
- if(tnet_dns_query_naptr_srv(self->stack->dns_ctx, msg->To->uri->host, transport->service, destIP, &dstPort) == 0){
- *destPort = dstPort;
- }
- else{
- tsk_strupdate(destIP, msg->To->uri->host);
- *destPort = 5060;
- }
- }
- }
-
-
-
- /* =========== Sending Response =========
- *
- */
- else if(msg->firstVia)
- {
- { /* Find the transport. */
- tsk_list_item_t *item;
- tsip_transport_t *curr;
- tsk_list_foreach(item, self->transports)
- {
- curr = item->data;
- if(tsip_transport_have_socket(curr, msg->local_fd))
- {
- transport = curr;
- break;
- }
- }
- }
-
- /* webrtc2sip mode */
- if(self->stack->network.mode == tsip_stack_mode_webrtc2sip){
- if(TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WS(msg->src_net_type)){ // response over WS or WSS
- transport = tsip_transport_layer_find_by_idx(self, tsip_transport_get_idx_by_name(msg->firstVia->transport));
- if(transport){
- tsk_strupdate(destIP, msg->firstVia->host);
- *destPort = msg->firstVia->port;
- msg->dst_net_type = transport->type;
- }
- return transport;
- }
- else{ // response over UDP, TCP or TLS
- const tsip_header_Via_t* via_2nd = (const tsip_header_Via_t*)tsip_message_get_headerAt(msg, tsip_htype_Via, 1);
- tsk_bool_t via_ws_transport = via_2nd && (tsk_striequals(via_2nd->transport, "WS") || tsk_striequals(via_2nd->transport, "WSS"));
- tsk_bool_t via_ws_hacked = via_2nd && TSIP_HEADER_HAVE_PARAM(via_2nd, "ws-hacked");
- if(via_2nd && (via_ws_transport || via_ws_hacked)){
- int t_idx = tsip_transport_get_idx_by_name(via_ws_transport ? via_2nd->transport : TSIP_HEADER_GET_PARAM_VALUE(via_2nd, "ws-hacked"));
- const tsip_transport_t* ws_transport = tsip_transport_layer_find_by_idx(self, t_idx);
- if(ws_transport){
- tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(ws_transport), via_2nd->host, via_2nd->port, ws_transport->type);
- if(peer){
- tsk_strupdate(destIP, peer->remote_ip);
- *destPort = peer->remote_port;
- msg->dst_net_type = ws_transport->type;
- TSK_OBJECT_SAFE_FREE(peer);
- return ws_transport;
- }
- }
-
- TSK_DEBUG_ERROR("Failed to match response expected to be forwarded via WebSocket transport");
- return tsk_null;
- }
- }
- }
-
- if(TSIP_HEADER_VIA_RELIABLE_TRANS(msg->firstVia)) /*== RELIABLE ===*/
- {
- /* RFC 3261 - 18.2.2 Sending Responses
- If the "sent-protocol" is a reliable transport protocol such as
- TCP or SCTP, or TLS over those, the response MUST be sent using
- the existing connection to the source of the original request
- that created the transaction, if that connection is still open.
- This requires the server transport to maintain an association
- between server transactions and transport connections. If that
- connection is no longer open, the server SHOULD open a
- connection to the IP address in the "received" parameter, if
- present, using the port in the "sent-by" value, or the default
- port for that transport, if no port is specified. If that
- connection attempt fails, the server SHOULD use the procedures
- in [4] for servers in order to determine the IP address and
- port to open the connection and send the response to.
- */
- if(tsk_strnullORempty(*destIP)){
- tnet_ip_t peer_ip;
- tnet_port_t peer_port;
- if(transport && tnet_get_peerip_n_port(msg->local_fd, &peer_ip, &peer_port) == 0){ // connection is still open ?
- tsk_strupdate(destIP, peer_ip);
- *destPort = peer_port;
- }
- else{
- if(msg->firstVia->received){
- tsk_strupdate(destIP, msg->firstVia->received);
- *destPort = msg->firstVia->rport > 0 ? msg->firstVia->rport : msg->firstVia->port;
- }
- else{
- tsk_strupdate(destIP, msg->firstVia->host);
- *destPort = msg->firstVia->port;
- }
- }
- }
- }
- else
- {
- if(msg->firstVia->maddr) /*== UNRELIABLE MULTICAST ===*/
- {
- /* RFC 3261 - 18.2.2 Sending Responses
- Otherwise, if the Via header field value contains a "maddr" parameter, the
- response MUST be forwarded to the address listed there, using
- the port indicated in "sent-by", or port 5060 if none is present.
- If the address is a multicast address, the response SHOULD be
- sent using the TTL indicated in the "ttl" parameter, or with a
- TTL of 1 if that parameter is not present.
- */
- }
- else /*=== UNRELIABLE UNICAST ===*/
- {
- if(msg->firstVia->received)
- {
- if(msg->firstVia->rport > 0)
- {
- /* RFC 3581 - 4. Server Behavior
- When a server attempts to send a response, it examines the topmost
- Via header field value of that response. If the "sent-protocol"
- component indicates an unreliable unicast transport protocol, such as
- UDP, and there is no "maddr" parameter, but there is both a
- "received" parameter and an "rport" parameter, the response MUST be
- sent to the IP address listed in the "received" parameter, and the
- port in the "rport" parameter. The response MUST be sent from the
- same address and port that the corresponding request was received on.
- This effectively adds a new processing step between bullets two and
- three in Section 18.2.2 of SIP [1].
- */
- tsk_strupdate(destIP, msg->firstVia->received);
- *destPort = msg->firstVia->rport;
- }
- else
- {
- /* RFC 3261 - 18.2.2 Sending Responses
- Otherwise (for unreliable unicast transports), if the top Via
- has a "received" parameter, the response MUST be sent to the
- address in the "received" parameter, using the port indicated
- in the "sent-by" value, or using port 5060 if none is specified
- explicitly. If this fails, for example, elicits an ICMP "port
- unreachable" response, the procedures of Section 5 of [4]
- SHOULD be used to determine where to send the response.
- */
- tsk_strupdate(destIP, msg->firstVia->received);
- *destPort = msg->firstVia->port ? msg->firstVia->port : 5060;
- }
- }
- else
- {
- /* RFC 3261 - 18.2.2 Sending Responses
- Otherwise, if it is not receiver-tagged, the response MUST be
- sent to the address indicated by the "sent-by" value, using the
- procedures in Section 5 of [4].
- */
- tsk_strupdate(destIP, msg->firstVia->host);
- if(msg->firstVia->port > 0)
- {
- *destPort = msg->firstVia->port;
- }
- }
- }
- }
- }
-
- // update message to avoid destination address to avoid running the same algo for retransmissions
- tsk_strupdate(&msg->dst_address, *destIP);
- msg->dst_port = *destPort;
- if(!TNET_SOCKET_TYPE_IS_VALID(msg->dst_net_type) && transport){
- msg->dst_net_type = transport->type;
- }
-
+ route_i = 0;
+ while((route = (const tsip_header_Route_t *)tsip_message_get_headerAt(msg, tsip_htype_Route, route_i++))) {
+ if(route && route->uri) {
+ if(tsk_params_have_param(route->uri->params, "sipml5-outbound") || (tsk_strequals(local_ip, route->uri->host) && local_port == route->uri->port)) {
+ tsk_list_remove_item_by_data(msg->headers, route);
+ goto clean_routes;
+ }
+ }
+ }
+ }
+ else if(!TNET_SOCKET_TYPE_IS_WS(msg->src_net_type) && !TNET_SOCKET_TYPE_IS_WS(msg->src_net_type)) {
+ const char* ws_src_ip = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-ip");
+ if(ws_src_ip) {
+ const char* ws_src_port = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-port");
+ const char* ws_src_proto = tsk_params_get_param_value(msg->line.request.uri->params, "ws-src-proto");
+ tsk_strupdate(destIP, ws_src_ip);
+ *destPort = atoi(ws_src_port);
+ destNetType = self->stack->network.transport_types[tsip_transport_get_idx_by_name(ws_src_proto)];
+ }
+ }
+ }
+ else {
+ /* Sends request to the first route or remote target */
+ dialog = tsip_dialog_layer_find_by_callid(self->stack->layer_dialog, msg->Call_ID->value);
+ if(dialog) {
+ const tsip_header_Record_Route_t* route;
+ tsk_bool_t b_using_route = tsk_false;
+ tsk_list_foreach(item, dialog->record_routes) {
+ if(!(route = item->data)) {
+ continue;
+ }
+ if(route->uri && route->uri->host) {
+ tsk_strupdate(destIP, route->uri->host);
+ *destPort = route->uri->port > 0 ? route->uri->port : (TNET_SOCKET_TYPE_IS_TLS(destNetType) ? 5061 : 5060);
+ b_using_route = tsk_true;
+ break;
+ }
+ }
+ if(!b_using_route) {
+ // Client mode requires the port to be defined (dialog connected) while server mode doesn't.
+ if(dialog->uri_remote_target && dialog->uri_remote_target->host && (dialog->uri_remote_target->port || TSIP_STACK_MODE_IS_SERVER(self->stack))) {
+ const char* transport_name = tsk_params_get_param_value(dialog->uri_remote_target->params, "transport");
+ tsk_strupdate(destIP, dialog->uri_remote_target->host);
+ *destPort = dialog->uri_remote_target->port ? dialog->uri_remote_target->port : (tsk_striequals(transport_name, "TLS") ? 5061 : 5060);
+ if(!tsk_strnullORempty(transport_name)) {
+ enum tnet_socket_type_e _destNetType = tsip_transport_get_type_by_name(transport_name);
+ if(TNET_SOCKET_TYPE_IS_VALID(_destNetType)) {
+ // _destNetType is UDP, TCP, WSSS...and not UDP-IPv4, TCP-IPv6, WSS-IPv4-IPsec...This is why closest match is used.
+ destNetType = _destNetType;
+ }
+ }
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(dialog);
+ }
+ }
+
+ /* Find the right transport using exact/closest match */
+ {
+ const tsip_transport_t* transport_closest1 = tsk_null;
+ const tsip_transport_t* transport_closest2 = tsk_null;
+ tsk_list_foreach(item, self->transports) {
+ curr = item->data;
+ if(curr->type == destNetType) {
+ transport = curr;
+ break;
+ }
+ if((curr->type & destNetType) == destNetType) {
+ transport_closest1 = curr;
+ }
+ if(self->stack->network.transport_idx_default>= 0 && curr->type == self->stack->network.transport_types[self->stack->network.transport_idx_default]) {
+ transport_closest2 = curr;
+ }
+ }
+ if(!transport && (transport_closest1 || transport_closest2)) {
+ const tsip_transport_t* transport_closest = transport_closest1 ? transport_closest1 : transport_closest2;
+ // For example, UDP will match with UDP-IPv4-IPSec or UDP-IPv6
+ TSK_DEBUG_INFO("Setting transport with closest match(%d->%d)", destNetType, transport_closest->type);
+ transport = transport_closest;
+ }
+ }
+
+
+ /* DNS NAPTR + SRV if the Proxy-CSCF is not defined and route set is empty */
+ if(transport && !(*destIP) && !self->stack->network.proxy_cscf[self->stack->network.transport_idx_default]) {
+ tnet_port_t dstPort;
+ if(tnet_dns_query_naptr_srv(self->stack->dns_ctx, msg->To->uri->host, transport->service, destIP, &dstPort) == 0) {
+ *destPort = dstPort;
+ }
+ else {
+ tsk_strupdate(destIP, msg->To->uri->host);
+ *destPort = 5060;
+ }
+ }
+ }
+
+
+
+ /* =========== Sending Response =========
+ *
+ */
+ else if(msg->firstVia) {
+ { /* Find the transport. */
+ tsk_list_item_t *item;
+ tsip_transport_t *curr;
+ tsk_list_foreach(item, self->transports) {
+ curr = item->data;
+ if(tsip_transport_have_socket(curr, msg->local_fd)) {
+ transport = curr;
+ break;
+ }
+ }
+ }
+
+ /* webrtc2sip mode */
+ if(self->stack->network.mode == tsip_stack_mode_webrtc2sip) {
+ if(TNET_SOCKET_TYPE_IS_WSS(msg->src_net_type) || TNET_SOCKET_TYPE_IS_WS(msg->src_net_type)) { // response over WS or WSS
+ transport = tsip_transport_layer_find_by_idx(self, tsip_transport_get_idx_by_name(msg->firstVia->transport));
+ if(transport) {
+ tsk_strupdate(destIP, msg->firstVia->host);
+ *destPort = msg->firstVia->port;
+ msg->dst_net_type = transport->type;
+ }
+ return transport;
+ }
+ else { // response over UDP, TCP or TLS
+ const tsip_header_Via_t* via_2nd = (const tsip_header_Via_t*)tsip_message_get_headerAt(msg, tsip_htype_Via, 1);
+ tsk_bool_t via_ws_transport = via_2nd && (tsk_striequals(via_2nd->transport, "WS") || tsk_striequals(via_2nd->transport, "WSS"));
+ tsk_bool_t via_ws_hacked = via_2nd && TSIP_HEADER_HAVE_PARAM(via_2nd, "ws-hacked");
+ if(via_2nd && (via_ws_transport || via_ws_hacked)) {
+ int t_idx = tsip_transport_get_idx_by_name(via_ws_transport ? via_2nd->transport : TSIP_HEADER_GET_PARAM_VALUE(via_2nd, "ws-hacked"));
+ const tsip_transport_t* ws_transport = tsip_transport_layer_find_by_idx(self, t_idx);
+ if(ws_transport) {
+ tsip_transport_stream_peer_t* peer = tsip_transport_find_stream_peer_by_remote_ip(TSIP_TRANSPORT(ws_transport), via_2nd->host, via_2nd->port, ws_transport->type);
+ if(peer) {
+ tsk_strupdate(destIP, peer->remote_ip);
+ *destPort = peer->remote_port;
+ msg->dst_net_type = ws_transport->type;
+ TSK_OBJECT_SAFE_FREE(peer);
+ return ws_transport;
+ }
+ }
+
+ TSK_DEBUG_ERROR("Failed to match response expected to be forwarded via WebSocket transport");
+ return tsk_null;
+ }
+ }
+ }
+
+ if(TSIP_HEADER_VIA_RELIABLE_TRANS(msg->firstVia)) { /*== RELIABLE ===*/
+ /* RFC 3261 - 18.2.2 Sending Responses
+ If the "sent-protocol" is a reliable transport protocol such as
+ TCP or SCTP, or TLS over those, the response MUST be sent using
+ the existing connection to the source of the original request
+ that created the transaction, if that connection is still open.
+ This requires the server transport to maintain an association
+ between server transactions and transport connections. If that
+ connection is no longer open, the server SHOULD open a
+ connection to the IP address in the "received" parameter, if
+ present, using the port in the "sent-by" value, or the default
+ port for that transport, if no port is specified. If that
+ connection attempt fails, the server SHOULD use the procedures
+ in [4] for servers in order to determine the IP address and
+ port to open the connection and send the response to.
+ */
+ if(tsk_strnullORempty(*destIP)) {
+ tnet_ip_t peer_ip;
+ tnet_port_t peer_port;
+ if(transport && tnet_get_peerip_n_port(msg->local_fd, &peer_ip, &peer_port) == 0) { // connection is still open ?
+ tsk_strupdate(destIP, peer_ip);
+ *destPort = peer_port;
+ }
+ else {
+ if(msg->firstVia->received) {
+ tsk_strupdate(destIP, msg->firstVia->received);
+ *destPort = msg->firstVia->rport > 0 ? msg->firstVia->rport : msg->firstVia->port;
+ }
+ else {
+ tsk_strupdate(destIP, msg->firstVia->host);
+ *destPort = msg->firstVia->port;
+ }
+ }
+ }
+ }
+ else {
+ if(msg->firstVia->maddr) { /*== UNRELIABLE MULTICAST ===*/
+ /* RFC 3261 - 18.2.2 Sending Responses
+ Otherwise, if the Via header field value contains a "maddr" parameter, the
+ response MUST be forwarded to the address listed there, using
+ the port indicated in "sent-by", or port 5060 if none is present.
+ If the address is a multicast address, the response SHOULD be
+ sent using the TTL indicated in the "ttl" parameter, or with a
+ TTL of 1 if that parameter is not present.
+ */
+ }
+ else { /*=== UNRELIABLE UNICAST ===*/
+ if(msg->firstVia->received) {
+ if(msg->firstVia->rport > 0) {
+ /* RFC 3581 - 4. Server Behavior
+ When a server attempts to send a response, it examines the topmost
+ Via header field value of that response. If the "sent-protocol"
+ component indicates an unreliable unicast transport protocol, such as
+ UDP, and there is no "maddr" parameter, but there is both a
+ "received" parameter and an "rport" parameter, the response MUST be
+ sent to the IP address listed in the "received" parameter, and the
+ port in the "rport" parameter. The response MUST be sent from the
+ same address and port that the corresponding request was received on.
+ This effectively adds a new processing step between bullets two and
+ three in Section 18.2.2 of SIP [1].
+ */
+ tsk_strupdate(destIP, msg->firstVia->received);
+ *destPort = msg->firstVia->rport;
+ }
+ else {
+ /* RFC 3261 - 18.2.2 Sending Responses
+ Otherwise (for unreliable unicast transports), if the top Via
+ has a "received" parameter, the response MUST be sent to the
+ address in the "received" parameter, using the port indicated
+ in the "sent-by" value, or using port 5060 if none is specified
+ explicitly. If this fails, for example, elicits an ICMP "port
+ unreachable" response, the procedures of Section 5 of [4]
+ SHOULD be used to determine where to send the response.
+ */
+ tsk_strupdate(destIP, msg->firstVia->received);
+ *destPort = msg->firstVia->port ? msg->firstVia->port : 5060;
+ }
+ }
+ else {
+ /* RFC 3261 - 18.2.2 Sending Responses
+ Otherwise, if it is not receiver-tagged, the response MUST be
+ sent to the address indicated by the "sent-by" value, using the
+ procedures in Section 5 of [4].
+ */
+ tsk_strupdate(destIP, msg->firstVia->host);
+ if(msg->firstVia->port > 0) {
+ *destPort = msg->firstVia->port;
+ }
+ }
+ }
+ }
+ }
+
+ // update message to avoid destination address to avoid running the same algo for retransmissions
+ tsk_strupdate(&msg->dst_address, *destIP);
+ msg->dst_port = *destPort;
+ if(!TNET_SOCKET_TYPE_IS_VALID(msg->dst_net_type) && transport) {
+ msg->dst_net_type = transport->type;
+ }
+
bail:
- return transport;
+ return transport;
}
int tsip_transport_layer_add(tsip_transport_layer_t* self, const char* local_host, tnet_port_t local_port, tnet_socket_type_t type, const char* description)
{
- // FIXME: CHECK IF already exist
- if(self && description)
- {
- tsip_transport_t *transport =
- (TNET_SOCKET_TYPE_IS_IPSEC(type) || self->stack->security.enable_secagree_ipsec) ?
- (tsip_transport_t *)tsip_transport_ipsec_create((tsip_stack_t*)self->stack, local_host, local_port, type, description) /* IPSec is a special case. All other are ok. */
- : tsip_transport_create((tsip_stack_t*)self->stack, local_host, local_port, type, description); /* UDP, SCTP, TCP, TLS, WS, WSS */
-
- if(transport && transport->net_transport && self->stack){
- /* Set TLS certs */
- if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type) || TNET_SOCKET_TYPE_IS_DTLS(type) || self->stack->security.enable_secagree_tls){
- tsip_transport_tls_set_certs(transport, self->stack->security.tls.ca, self->stack->security.tls.pbk, self->stack->security.tls.pvk, self->stack->security.tls.verify);
- }
- /* Nat Traversal context */
- if(self->stack->natt.ctx){
- tnet_transport_set_natt_ctx(transport->net_transport, self->stack->natt.ctx);
- }
- tsk_list_push_back_data(self->transports, (void**)&transport);
- return 0;
- }
- else {
- return -2;
- }
- }
- return -1;
+ // FIXME: CHECK IF already exist
+ if(self && description) {
+ tsip_transport_t *transport =
+ (TNET_SOCKET_TYPE_IS_IPSEC(type) || self->stack->security.enable_secagree_ipsec) ?
+ (tsip_transport_t *)tsip_transport_ipsec_create((tsip_stack_t*)self->stack, local_host, local_port, type, description) /* IPSec is a special case. All other are ok. */
+ : tsip_transport_create((tsip_stack_t*)self->stack, local_host, local_port, type, description); /* UDP, SCTP, TCP, TLS, WS, WSS */
+
+ if(transport && transport->net_transport && self->stack) {
+ /* Set TLS certs */
+ if(TNET_SOCKET_TYPE_IS_TLS(type) || TNET_SOCKET_TYPE_IS_WSS(type) || TNET_SOCKET_TYPE_IS_DTLS(type) || self->stack->security.enable_secagree_tls) {
+ tsip_transport_tls_set_certs(transport, self->stack->security.tls.ca, self->stack->security.tls.pbk, self->stack->security.tls.pvk, self->stack->security.tls.verify);
+ }
+ /* Nat Traversal context */
+ if(self->stack->natt.ctx) {
+ tnet_transport_set_natt_ctx(transport->net_transport, self->stack->natt.ctx);
+ }
+ tsk_list_push_back_data(self->transports, (void**)&transport);
+ return 0;
+ }
+ else {
+ return -2;
+ }
+ }
+ return -1;
}
int tsip_transport_layer_send(const tsip_transport_layer_t* self, const char *branch, tsip_message_t *msg)
{
- if(msg && self && self->stack){
- char* destIP = tsk_null;
- int32_t destPort = 5060;
- const tsip_transport_t *transport = tsip_transport_layer_find(self, msg, &destIP, &destPort);
- int ret;
- if(transport){
- if(tsip_transport_send(transport, branch, TSIP_MESSAGE(msg), destIP, destPort) > 0/* returns number of send bytes */){
- ret = 0;
- }
- else{
- ret = -3;
- }
- }
- else{
- TSK_DEBUG_ERROR("Failed to find valid transport");
- ret = -2;
- }
- TSK_FREE(destIP);
- return ret;
- }
- else{
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
+ if(msg && self && self->stack) {
+ char* destIP = tsk_null;
+ int32_t destPort = 5060;
+ const tsip_transport_t *transport = tsip_transport_layer_find(self, msg, &destIP, &destPort);
+ int ret;
+ if(transport) {
+ if(tsip_transport_send(transport, branch, TSIP_MESSAGE(msg), destIP, destPort) > 0/* returns number of send bytes */) {
+ ret = 0;
+ }
+ else {
+ ret = -3;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to find valid transport");
+ ret = -2;
+ }
+ TSK_FREE(destIP);
+ return ret;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
}
int tsip_transport_createTempSAs(const tsip_transport_layer_t *self)
{
- int ret = -1;
-
- tsk_list_item_t *item;
- tsip_transport_t* transport;
-
- if(!self){
- goto bail;
- }
-
- tsk_list_foreach(item, self->transports){
- transport = item->data;
- if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
- ret = tsip_transport_ipsec_createTempSAs(TSIP_TRANSPORT_IPSEC(transport));
- break;
- }
- }
+ int ret = -1;
+
+ tsk_list_item_t *item;
+ tsip_transport_t* transport;
+
+ if(!self) {
+ goto bail;
+ }
+
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+ if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)) {
+ ret = tsip_transport_ipsec_createTempSAs(TSIP_TRANSPORT_IPSEC(transport));
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_ensureTempSAs(const tsip_transport_layer_t *self, const tsip_response_t *r401_407, int64_t expires)
{
- int ret = -1;
-
- tsk_list_item_t *item;
- tsip_transport_t* transport;
-
- if(!self){
- goto bail;
- }
-
- tsk_list_foreach(item, self->transports){
- transport = item->data;
- if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
- ret = tsip_transport_ipsec_ensureTempSAs(TSIP_TRANSPORT_IPSEC(transport), r401_407, expires);
- break;
- }
- }
+ int ret = -1;
+
+ tsk_list_item_t *item;
+ tsip_transport_t* transport;
+
+ if(!self) {
+ goto bail;
+ }
+
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+ if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)) {
+ ret = tsip_transport_ipsec_ensureTempSAs(TSIP_TRANSPORT_IPSEC(transport), r401_407, expires);
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_startSAs(const tsip_transport_layer_t* self, const void* ik, const void* ck)
{
- int ret = -1;
-
- tsk_list_item_t *item;
- tsip_transport_t* transport;
-
- if(!self){
- goto bail;
- }
-
- tsk_list_foreach(item, self->transports){
- transport = item->data;
- if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
- ret = tsip_transport_ipsec_startSAs(TSIP_TRANSPORT_IPSEC(transport), (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
- break;
- }
- }
+ int ret = -1;
+
+ tsk_list_item_t *item;
+ tsip_transport_t* transport;
+
+ if(!self) {
+ goto bail;
+ }
+
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+ if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)) {
+ ret = tsip_transport_ipsec_startSAs(TSIP_TRANSPORT_IPSEC(transport), (const tipsec_key_t*)ik, (const tipsec_key_t*)ck);
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_cleanupSAs(const tsip_transport_layer_t *self)
{
- int ret = -1;
-
- tsk_list_item_t *item;
- tsip_transport_t* transport;
-
- if(!self){
- goto bail;
- }
-
- tsk_list_foreach(item, self->transports){
- transport = item->data;
- if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)){
- ret = tsip_transport_ipsec_cleanupSAs(TSIP_TRANSPORT_IPSEC(transport));
- break;
- }
- }
+ int ret = -1;
+
+ tsk_list_item_t *item;
+ tsip_transport_t* transport;
+
+ if(!self) {
+ goto bail;
+ }
+
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+ if(TNET_SOCKET_TYPE_IS_IPSEC(transport->type)) {
+ ret = tsip_transport_ipsec_cleanupSAs(TSIP_TRANSPORT_IPSEC(transport));
+ break;
+ }
+ }
bail:
- return ret;
+ return ret;
}
int tsip_transport_layer_remove_callid_from_stream_peers(tsip_transport_layer_t *self, const char* callid)
{
- if(self && callid){
- int ret = 0;
- tsk_bool_t removed = tsk_false;
- tsip_transport_t* transport;
- tsk_list_item_t* item;
- tsk_list_lock(self->transports);
- tsk_list_foreach(item, self->transports){
- if(!(transport = TSIP_TRANSPORT(item->data)) || !TNET_SOCKET_TYPE_IS_STREAM(transport->type)){
- continue;
- }
- if((ret = tsip_transport_remove_callid_from_stream_peers(transport, callid, &removed)) == 0 && removed){
- TSK_DEBUG_INFO("[Transport Layer] Removed call-id = '%s' from transport layer", callid);
- break;
- }
- }
- tsk_list_unlock(self->transports);
- return ret;
- }
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
+ if(self && callid) {
+ int ret = 0;
+ tsk_bool_t removed = tsk_false;
+ tsip_transport_t* transport;
+ tsk_list_item_t* item;
+ tsk_list_lock(self->transports);
+ tsk_list_foreach(item, self->transports) {
+ if(!(transport = TSIP_TRANSPORT(item->data)) || !TNET_SOCKET_TYPE_IS_STREAM(transport->type)) {
+ continue;
+ }
+ if((ret = tsip_transport_remove_callid_from_stream_peers(transport, callid, &removed)) == 0 && removed) {
+ TSK_DEBUG_INFO("[Transport Layer] Removed call-id = '%s' from transport layer", callid);
+ break;
+ }
+ }
+ tsk_list_unlock(self->transports);
+ return ret;
+ }
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
}
tsk_bool_t tsip_transport_layer_have_stream_peer_with_remote_ip(const tsip_transport_layer_t *self, const char* remote_ip, tnet_port_t remote_port)
{
- if(self && remote_ip){
- const tsk_list_item_t* item;
- tsk_bool_t found = tsk_false;
- tsip_transport_t* transport;
- tsk_list_lock(self->transports);
- tsk_list_foreach(item, self->transports){
- if(!(transport = TSIP_TRANSPORT(item->data)) || !TNET_SOCKET_TYPE_IS_STREAM(transport->type)){
- continue;
- }
- if(tsip_transport_have_stream_peer_with_remote_ip(transport, remote_ip, remote_port, transport->type)){
- found = tsk_true;
- break;
- }
- }
- tsk_list_unlock(self->transports);
- return found;
- }
- return tsk_false;
+ if(self && remote_ip) {
+ const tsk_list_item_t* item;
+ tsk_bool_t found = tsk_false;
+ tsip_transport_t* transport;
+ tsk_list_lock(self->transports);
+ tsk_list_foreach(item, self->transports) {
+ if(!(transport = TSIP_TRANSPORT(item->data)) || !TNET_SOCKET_TYPE_IS_STREAM(transport->type)) {
+ continue;
+ }
+ if(tsip_transport_have_stream_peer_with_remote_ip(transport, remote_ip, remote_port, transport->type)) {
+ found = tsk_true;
+ break;
+ }
+ }
+ tsk_list_unlock(self->transports);
+ return found;
+ }
+ return tsk_false;
}
@@ -1260,100 +1251,102 @@ tsk_bool_t tsip_transport_layer_have_stream_peer_with_remote_ip(const tsip_trans
int tsip_transport_layer_start(tsip_transport_layer_t* self)
{
- if(self){
- if(!self->running){
- int ret = 0;
- tsk_list_item_t *item;
- tsip_transport_t* transport;
- int32_t transport_idx = self->stack->network.transport_idx_default;
-
- /* start() */
- tsk_list_foreach(item, self->transports){
- transport = item->data;
- if((ret = tsip_transport_start(transport))){
- return ret;
- }
- }
-
- /* connect() */
- tsk_list_foreach(item, self->transports){
- transport = item->data;
-
- // set callback
- if(TNET_SOCKET_TYPE_IS_DGRAM(transport->type)){
- tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_dgram_cb), transport);
- }
- else if(TNET_SOCKET_TYPE_IS_WS(transport->type) || TNET_SOCKET_TYPE_IS_WSS(transport->type)){
- tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_ws_cb), transport);
- }
- else{
- tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_stream_cb), transport);
- }
-
- if((ret = tnet_sockaddr_init(self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx], transport->type, &transport->pcscf_addr))){
- TSK_DEBUG_ERROR("[%s:%u] is invalid address", self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx]);
- return ret;
- }
-
- if(TNET_SOCKET_TYPE_IS_STREAM(transport->type)){
- if(!TSIP_STACK_MODE_IS_SERVER(transport->stack)){
- // Between "tsip_transport_connectto_2()" and "tsip_transport_add_stream_peer_2()" the net callback could be called and
- // off cource peer will not be found in the list. This is why the list is locked.
+ if(self) {
+ if(!self->running) {
+ int ret = 0;
+ tsk_list_item_t *item;
+ tsip_transport_t* transport;
+ int32_t transport_idx = self->stack->network.transport_idx_default;
+
+ /* start() */
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+ if((ret = tsip_transport_start(transport))) {
+ return ret;
+ }
+ }
+
+ /* connect() */
+ tsk_list_foreach(item, self->transports) {
+ transport = item->data;
+
+ // set callback
+ if(TNET_SOCKET_TYPE_IS_DGRAM(transport->type)) {
+ tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_dgram_cb), transport);
+ }
+ else if(TNET_SOCKET_TYPE_IS_WS(transport->type) || TNET_SOCKET_TYPE_IS_WSS(transport->type)) {
+ tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_ws_cb), transport);
+ }
+ else {
+ tsip_transport_set_callback(transport, TNET_TRANSPORT_CB_F(tsip_transport_layer_stream_cb), transport);
+ }
+
+ if((ret = tnet_sockaddr_init(self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx], transport->type, &transport->pcscf_addr))) {
+ TSK_DEBUG_ERROR("[%s:%u] is invalid address", self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx]);
+ return ret;
+ }
+
+ if(TNET_SOCKET_TYPE_IS_STREAM(transport->type)) {
+ if(!TSIP_STACK_MODE_IS_SERVER(transport->stack)) {
+ // Between "tsip_transport_connectto_2()" and "tsip_transport_add_stream_peer_2()" the net callback could be called and
+ // off cource peer will not be found in the list. This is why the list is locked.
tsip_transport_stream_peers_lock(transport);
- if((transport->connectedFD = tsip_transport_connectto_2(transport, self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx])) == TNET_INVALID_FD){
- TSK_DEBUG_ERROR("Failed to connect the SIP transport");
- tsip_transport_stream_peers_unlock(transport);
- return -3;
- }
+ if((transport->connectedFD = tsip_transport_connectto_2(transport, self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx])) == TNET_INVALID_FD) {
+ TSK_DEBUG_ERROR("Failed to connect the SIP transport");
+ tsip_transport_stream_peers_unlock(transport);
+ return -3;
+ }
TSK_DEBUG_INFO("SIP transport fd=%d", transport->connectedFD);
- // store peer
- tsip_transport_add_stream_peer_2(transport, transport->connectedFD, transport->type, tsk_false, self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx]);
- tsip_transport_stream_peers_unlock(transport);
- // give the socket chance to connect
- if((ret = tnet_sockfd_waitUntilWritable(transport->connectedFD, TSIP_CONNECT_TIMEOUT)) || (ret = tnet_sockfd_waitUntilReadable(transport->connectedFD, TSIP_CONNECT_TIMEOUT))){
- TSK_DEBUG_INFO("%d milliseconds elapsed and the socket is still not connected.", TSIP_CONNECT_TIMEOUT);
- // dot not exit, store the outgoing data until connection succeed
- }
- }
- }
-
+ // store peer
+ tsip_transport_add_stream_peer_2(transport, transport->connectedFD, transport->type, tsk_false, self->stack->network.proxy_cscf[transport_idx], self->stack->network.proxy_cscf_port[transport_idx]);
+ tsip_transport_stream_peers_unlock(transport);
+ // give the socket chance to connect
+ if((ret = tnet_sockfd_waitUntilWritable(transport->connectedFD, TSIP_CONNECT_TIMEOUT)) || (ret = tnet_sockfd_waitUntilReadable(transport->connectedFD, TSIP_CONNECT_TIMEOUT))) {
+ TSK_DEBUG_INFO("%d milliseconds elapsed and the socket is still not connected.", TSIP_CONNECT_TIMEOUT);
+ // dot not exit, store the outgoing data until connection succeed
+ }
+ }
+ }
+
// set connectedFD=master for servers
- if(transport->connectedFD == TNET_INVALID_FD){
- transport->connectedFD = tnet_transport_get_master_fd(transport->net_transport);
- }
- }
-
- self->running = tsk_true;
-
- return 0;
- }
- else return -2;
- }
- return -1;
+ if(transport->connectedFD == TNET_INVALID_FD) {
+ transport->connectedFD = tnet_transport_get_master_fd(transport->net_transport);
+ }
+ }
+
+ self->running = tsk_true;
+
+ return 0;
+ }
+ else {
+ return -2;
+ }
+ }
+ return -1;
}
int tsip_transport_layer_shutdown(tsip_transport_layer_t* self)
{
- if(self){
- if(!TSK_LIST_IS_EMPTY(self->transports)){
- //if(self->running){
- /*int ret = 0;*/
- tsk_list_item_t *item;
- while((item = tsk_list_pop_first_item(self->transports))){
- TSK_OBJECT_SAFE_FREE(item); // Network transports are not reusable ==> (shutdow+remove)
- }
- self->running = tsk_false;
- return 0;
- }
- else{
- return 0; /* not running */
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ if(!TSK_LIST_IS_EMPTY(self->transports)) {
+ //if(self->running){
+ /*int ret = 0;*/
+ tsk_list_item_t *item;
+ while((item = tsk_list_pop_first_item(self->transports))) {
+ TSK_OBJECT_SAFE_FREE(item); // Network transports are not reusable ==> (shutdow+remove)
+ }
+ self->running = tsk_false;
+ return 0;
+ }
+ else {
+ return 0; /* not running */
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
@@ -1366,38 +1359,37 @@ int tsip_transport_layer_shutdown(tsip_transport_layer_t* self)
//
static tsk_object_t* tsip_transport_layer_ctor(tsk_object_t * self, va_list * app)
{
- tsip_transport_layer_t *layer = self;
- if(layer){
- layer->stack = va_arg(*app, const tsip_stack_t *);
+ tsip_transport_layer_t *layer = self;
+ if(layer) {
+ layer->stack = va_arg(*app, const tsip_stack_t *);
- layer->transports = tsk_list_create();
- }
- return self;
+ layer->transports = tsk_list_create();
+ }
+ return self;
}
static tsk_object_t* tsip_transport_layer_dtor(tsk_object_t * self)
-{
- tsip_transport_layer_t *layer = self;
- if(layer){
- tsip_transport_layer_shutdown(self);
+{
+ tsip_transport_layer_t *layer = self;
+ if(layer) {
+ tsip_transport_layer_shutdown(self);
- TSK_OBJECT_SAFE_FREE(layer->transports);
+ TSK_OBJECT_SAFE_FREE(layer->transports);
- TSK_DEBUG_INFO("*** Transport Layer destroyed ***");
- }
- return self;
+ TSK_DEBUG_INFO("*** Transport Layer destroyed ***");
+ }
+ return self;
}
static int tsip_transport_layer_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_transport_layer_def_s =
-{
- sizeof(tsip_transport_layer_t),
- tsip_transport_layer_ctor,
- tsip_transport_layer_dtor,
- tsip_transport_layer_cmp,
+static const tsk_object_def_t tsip_transport_layer_def_s = {
+ sizeof(tsip_transport_layer_t),
+ tsip_transport_layer_ctor,
+ tsip_transport_layer_dtor,
+ tsip_transport_layer_cmp,
};
const tsk_object_def_t *tsip_transport_layer_def_t = &tsip_transport_layer_def_s;
diff --git a/tinySIP/src/tsip.c b/tinySIP/src/tsip.c
index 9a377d4..1db31d3 100755
--- a/tinySIP/src/tsip.c
+++ b/tinySIP/src/tsip.c
@@ -70,7 +70,7 @@ TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(self), e); \
static int __tsip_stack_get_transport_idx_by_name(tsip_stack_t *self, const char* name)
{
- if(tsk_strnullORempty(name) && TSIP_STACK_MODE_IS_CLIENT(self)){
+ if(tsk_strnullORempty(name) && TSIP_STACK_MODE_IS_CLIENT(self)) {
return self->network.transport_idx_default; // for backward compatibility
}
return tsip_transport_get_idx_by_name(name);
@@ -80,384 +80,399 @@ static int __tsip_stack_get_transport_idx_by_name(tsip_stack_t *self, const char
static int __tsip_stack_set(tsip_stack_t *self, va_list* app)
{
tsip_stack_param_type_t curr;
-
- while((curr = va_arg(*app, tsip_stack_param_type_t)) != tsip_pname_null){
- switch(curr){
-
- /* === Identity === */
- case tsip_pname_display_name:
- { /* (const char*)NAME_STR */
- const char* NAME_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->identity.display_name, NAME_STR);
- break;
- }
- case tsip_pname_impu:
- case tsip_pname_preferred_id:
- { /* (const char*)URI_STR */
- const char* URI_STR = va_arg(*app, const char*);
- if(!tsk_strnullORempty(URI_STR)){
- tsip_uri_t *uri = tsip_uri_parse(URI_STR, tsk_strlen(URI_STR));
- if(uri){
- if(curr == tsip_pname_impu){
- TSK_OBJECT_SAFE_FREE(self->identity.impu);
- self->identity.impu = uri;
- }
- else{
- TSK_OBJECT_SAFE_FREE(self->identity.preferred);
- self->identity.preferred = uri;
- }
+
+ while((curr = va_arg(*app, tsip_stack_param_type_t)) != tsip_pname_null) {
+ switch(curr) {
+
+ /* === Identity === */
+ case tsip_pname_display_name: {
+ /* (const char*)NAME_STR */
+ const char* NAME_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->identity.display_name, NAME_STR);
+ break;
+ }
+ case tsip_pname_impu:
+ case tsip_pname_preferred_id: {
+ /* (const char*)URI_STR */
+ const char* URI_STR = va_arg(*app, const char*);
+ if(!tsk_strnullORempty(URI_STR)) {
+ tsip_uri_t *uri = tsip_uri_parse(URI_STR, tsk_strlen(URI_STR));
+ if(uri) {
+ if(curr == tsip_pname_impu) {
+ TSK_OBJECT_SAFE_FREE(self->identity.impu);
+ self->identity.impu = uri;
}
- else{
- TSK_DEBUG_ERROR("'%s' is an invalid SIP/TEL URI", URI_STR);
- if(curr == tsip_pname_impu){
- return -1; /* IMPU is mandatory but P-Preferred-Identity isn't. */
- }
+ else {
+ TSK_OBJECT_SAFE_FREE(self->identity.preferred);
+ self->identity.preferred = uri;
}
}
- else if(curr == tsip_pname_impu){
- TSK_DEBUG_ERROR("IMPU (IMS Public Identity) is mandatory.");
- return -1;
+ else {
+ TSK_DEBUG_ERROR("'%s' is an invalid SIP/TEL URI", URI_STR);
+ if(curr == tsip_pname_impu) {
+ return -1; /* IMPU is mandatory but P-Preferred-Identity isn't. */
+ }
}
- break;
}
- case tsip_pname_impi:
- { /* (const char*)IMPI_STR */
- const char* IMPI_STR = va_arg(*app, const char*);
- if(tsk_strnullORempty(IMPI_STR)){
- TSK_DEBUG_ERROR("IMPI (IMS Private Identity) is mandatory.");
- return -1; /* mandatory */
- }
- tsk_strupdate(&self->identity.impi, IMPI_STR);
- break;
+ else if(curr == tsip_pname_impu) {
+ TSK_DEBUG_ERROR("IMPU (IMS Public Identity) is mandatory.");
+ return -1;
}
- case tsip_pname_password:
- { /* (const char*)PASSORD_STR */
- const char* PASSORD_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->identity.password, PASSORD_STR);
- break;
+ break;
+ }
+ case tsip_pname_impi: {
+ /* (const char*)IMPI_STR */
+ const char* IMPI_STR = va_arg(*app, const char*);
+ if(tsk_strnullORempty(IMPI_STR)) {
+ TSK_DEBUG_ERROR("IMPI (IMS Private Identity) is mandatory.");
+ return -1; /* mandatory */
}
-
- /* === SigComp === */
- case tsip_pname_sigcomp:
- { /* (unsigned)DMS_UINT, (unsigned)SMS_UINT, (unsigned)CPB_UINT, (tsk_bool_t)PRES_DICT_BOOL */
- self->sigcomp.dms = va_arg(*app, unsigned);
- self->sigcomp.sms = va_arg(*app, unsigned);
- self->sigcomp.cpb = va_arg(*app, unsigned);
- self->sigcomp.pres_dict = va_arg(*app, tsk_bool_t);
- break;
+ tsk_strupdate(&self->identity.impi, IMPI_STR);
+ break;
+ }
+ case tsip_pname_password: {
+ /* (const char*)PASSORD_STR */
+ const char* PASSORD_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->identity.password, PASSORD_STR);
+ break;
+ }
+
+ /* === SigComp === */
+ case tsip_pname_sigcomp: {
+ /* (unsigned)DMS_UINT, (unsigned)SMS_UINT, (unsigned)CPB_UINT, (tsk_bool_t)PRES_DICT_BOOL */
+ self->sigcomp.dms = va_arg(*app, unsigned);
+ self->sigcomp.sms = va_arg(*app, unsigned);
+ self->sigcomp.cpb = va_arg(*app, unsigned);
+ self->sigcomp.pres_dict = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case tsip_pname_sigcomp_add_compartment: {
+ /* (const char*)COMPARTMENT_ID_STR */
+ if(!self->sigcomp.handle) {
+ self->sigcomp.handle = tsip_sigcomp_handler_create(self->sigcomp.cpb, self->sigcomp.dms, self->sigcomp.sms);
+ tsip_sigcomp_handler_set_dicts(self->sigcomp.handle, self->sigcomp.sip_dict, self->sigcomp.pres_dict);
}
- case tsip_pname_sigcomp_add_compartment:
- { /* (const char*)COMPARTMENT_ID_STR */
- if(!self->sigcomp.handle){
- self->sigcomp.handle = tsip_sigcomp_handler_create(self->sigcomp.cpb, self->sigcomp.dms, self->sigcomp.sms);
- tsip_sigcomp_handler_set_dicts(self->sigcomp.handle, self->sigcomp.sip_dict, self->sigcomp.pres_dict);
- }
- tsip_sigcomp_handler_add_compartment(self->sigcomp.handle, va_arg(*app, const char*));
- break;
+ tsip_sigcomp_handler_add_compartment(self->sigcomp.handle, va_arg(*app, const char*));
+ break;
+ }
+ case tsip_pname_sigcomp_remove_compartment: {
+ /* (const char*)COMPARTMENT_ID_STR */
+ if(self->sigcomp.handle) {
+ tsip_sigcomp_handler_remove_compartment(self->sigcomp.handle, va_arg(*app, const char*));
}
- case tsip_pname_sigcomp_remove_compartment:
- { /* (const char*)COMPARTMENT_ID_STR */
- if(self->sigcomp.handle){
- tsip_sigcomp_handler_remove_compartment(self->sigcomp.handle, va_arg(*app, const char*));
+ break;
+ }
+
+ /* === Network === */
+ case tsip_pname_realm: {
+ /* (const char*)URI_STR */
+ const char* URI_STR = va_arg(*app, const char*);
+ tsip_uri_t *uri;
+ if(!tsk_strnullORempty(URI_STR) && (uri = tsip_uri_parse(URI_STR, tsk_strlen(URI_STR)))) {
+ if(uri->type == uri_unknown) { /* scheme is missing or unsupported? */
+ tsk_strupdate(&uri->scheme, "sip");
+ uri->type = uri_sip;
}
- break;
+ TSK_OBJECT_SAFE_FREE(self->network.realm); /* delete old */
+ self->network.realm = uri;
}
-
- /* === Network === */
- case tsip_pname_realm:
- { /* (const char*)URI_STR */
- const char* URI_STR = va_arg(*app, const char*);
- tsip_uri_t *uri;
- if(!tsk_strnullORempty(URI_STR) && (uri = tsip_uri_parse(URI_STR, tsk_strlen(URI_STR)))){
- if(uri->type == uri_unknown){ /* scheme is missing or unsupported? */
- tsk_strupdate(&uri->scheme, "sip");
- uri->type = uri_sip;
- }
- TSK_OBJECT_SAFE_FREE(self->network.realm); /* delete old */
- self->network.realm = uri;
- }
- else{
- TSK_DEBUG_ERROR("'%s' is an invalid SIP/TEL URI", URI_STR);
- return -1; /* mandatory */
- }
- break;
+ else {
+ TSK_DEBUG_ERROR("'%s' is an invalid SIP/TEL URI", URI_STR);
+ return -1; /* mandatory */
}
- case tsip_pname_local_ip:
- { /* (const char*)TRANSPORT_STR, (const char*)IP_STR */
- const char* TRANSPORT_STR = va_arg(*app, const char*);
- const char* IP_STR = va_arg(*app, const char*);
- int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
- if(t_idx < 0) { TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR); return -1; }
-
- tsk_strupdate(&self->network.local_ip[t_idx], IP_STR);
- self->network.local_ip_is_set_by_user[t_idx] = tsk_true; // do not query best source when stack is re-started
- if(TSIP_STACK_MODE_IS_SERVER(self) && !tsk_strnullORempty(TRANSPORT_STR)){
- self->network.transport_types[t_idx] = tsip_transport_get_type_by_name(TRANSPORT_STR);
- }
- break;
+ break;
+ }
+ case tsip_pname_local_ip: {
+ /* (const char*)TRANSPORT_STR, (const char*)IP_STR */
+ const char* TRANSPORT_STR = va_arg(*app, const char*);
+ const char* IP_STR = va_arg(*app, const char*);
+ int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
+ if(t_idx < 0) {
+ TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR);
+ return -1;
}
- case tsip_pname_local_port:
- { /* (const char*)TRANSPORT_STR, (unsigned)PORT_UINT */
- const char* TRANSPORT_STR = va_arg(*app, const char*);
- unsigned PORT_UINT = va_arg(*app, unsigned);
- int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
- if(t_idx < 0) { TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR); return -1; }
-
- self->network.local_port[t_idx] = PORT_UINT;
- if(TSIP_STACK_MODE_IS_SERVER(self) && !tsk_strnullORempty(TRANSPORT_STR)){
- self->network.transport_types[t_idx] = tsip_transport_get_type_by_name(TRANSPORT_STR);
- }
- break;
+
+ tsk_strupdate(&self->network.local_ip[t_idx], IP_STR);
+ self->network.local_ip_is_set_by_user[t_idx] = tsk_true; // do not query best source when stack is re-started
+ if(TSIP_STACK_MODE_IS_SERVER(self) && !tsk_strnullORempty(TRANSPORT_STR)) {
+ self->network.transport_types[t_idx] = tsip_transport_get_type_by_name(TRANSPORT_STR);
}
- case tsip_pname_aor:
- { /* (const char*)TRANSPORT_STR, (const char*)IP_STR, (unsigned)PORT_UINT */
- const char* TRANSPORT_STR = va_arg(*app, const char*);
- const char* IP_STR = va_arg(*app, const char*);
- tnet_port_t PORT_UINT = (tnet_port_t)va_arg(*app, unsigned);
- int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
- if(t_idx < 0) { TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR); return -1; }
-
- if(!tsk_strnullORempty(IP_STR)){
- tsk_strupdate(&self->network.aor.ip[t_idx], IP_STR);
- }
- if(PORT_UINT){
- self->network.aor.port[t_idx] = PORT_UINT;
- }
- break;
+ break;
+ }
+ case tsip_pname_local_port: {
+ /* (const char*)TRANSPORT_STR, (unsigned)PORT_UINT */
+ const char* TRANSPORT_STR = va_arg(*app, const char*);
+ unsigned PORT_UINT = va_arg(*app, unsigned);
+ int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
+ if(t_idx < 0) {
+ TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR);
+ return -1;
}
- case tsip_pname_discovery_naptr:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->network.discovery_naptr = va_arg(*app, tsk_bool_t);
- break;
+
+ self->network.local_port[t_idx] = PORT_UINT;
+ if(TSIP_STACK_MODE_IS_SERVER(self) && !tsk_strnullORempty(TRANSPORT_STR)) {
+ self->network.transport_types[t_idx] = tsip_transport_get_type_by_name(TRANSPORT_STR);
}
- case tsip_pname_discovery_dhcp:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->network.discovery_dhcp = va_arg(*app, tsk_bool_t);
- break;
+ break;
+ }
+ case tsip_pname_aor: {
+ /* (const char*)TRANSPORT_STR, (const char*)IP_STR, (unsigned)PORT_UINT */
+ const char* TRANSPORT_STR = va_arg(*app, const char*);
+ const char* IP_STR = va_arg(*app, const char*);
+ tnet_port_t PORT_UINT = (tnet_port_t)va_arg(*app, unsigned);
+ int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
+ if(t_idx < 0) {
+ TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR);
+ return -1;
}
- case tsip_pname_proxy_cscf:
- { /* (const char*)FQDN_STR, (unsigned)PORT_UINT, (const char*)TRANSPORT_STR, (const char*)IP_VERSION_STR */
- const char* FQDN_STR = va_arg(*app, const char*);
- tnet_port_t PORT_UINT = va_arg(*app, unsigned);
- const char* TRANSPORT_STR = va_arg(*app, const char*);
- const char* IP_VERSION_STR = va_arg(*app, const char*);
- int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
- if(t_idx < 0) { TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR); return -1; }
-
- if(TSIP_STACK_MODE_IS_CLIENT(self)){
- // "client" mode support a unique proxy_cscf -> reset previous transports
- int k;
- for(k = 0; k < sizeof(self->network.proxy_cscf_type)/sizeof(self->network.proxy_cscf_type[0]); ++k) {
- self->network.proxy_cscf_type[k] = tnet_socket_type_invalid;
- }
- }
-
- /* IP Address */
- tsk_strupdate(&self->network.proxy_cscf[t_idx], FQDN_STR);
-
- /* Port */
- if(PORT_UINT){
- self->network.proxy_cscf_port[t_idx] = PORT_UINT;
- }
-
- /* Transport */
- if(tsk_strnullORempty(TRANSPORT_STR) || tsk_striequals(TRANSPORT_STR, "UDP")){
- TNET_SOCKET_TYPE_SET_UDP(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "DTLS")){
- TNET_SOCKET_TYPE_SET_DTLS(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "TCP")){
- TNET_SOCKET_TYPE_SET_TCP(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "TLS")){
- TNET_SOCKET_TYPE_SET_TLS(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "SCTP")){
- TNET_SOCKET_TYPE_SET_SCTP(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "WS")){
- TNET_SOCKET_TYPE_SET_WS(self->network.proxy_cscf_type[t_idx]);
- }
- else if(tsk_striequals(TRANSPORT_STR, "WSS")){
- TNET_SOCKET_TYPE_SET_WSS(self->network.proxy_cscf_type[t_idx]);
- }
- TNET_SOCKET_TYPE_SET_IPV4(self->network.proxy_cscf_type[t_idx]); // IPv4 is the default version
- /* whether to use ipv6 or not */
- if(!tsk_strnullORempty(IP_VERSION_STR)){
- if(tsk_strcontains(IP_VERSION_STR, tsk_strlen(IP_VERSION_STR), "6")){
- TNET_SOCKET_TYPE_SET_IPV6Only(self->network.proxy_cscf_type[t_idx]); // "only" to clear IPv4 flag
- }
- if(tsk_strcontains(IP_VERSION_STR, tsk_strlen(IP_VERSION_STR), "4")){
- TNET_SOCKET_TYPE_SET_IPV4(self->network.proxy_cscf_type[t_idx]); /* Not IPV4only ==> '46'/'64' */
- }
- }
- /* use same transport type as the proxy-cscf */
- self->network.transport_types[t_idx] = self->network.proxy_cscf_type[t_idx];
- /* set default transport */
- self->network.transport_idx_default = t_idx;
- break;
+
+ if(!tsk_strnullORempty(IP_STR)) {
+ tsk_strupdate(&self->network.aor.ip[t_idx], IP_STR);
+ }
+ if(PORT_UINT) {
+ self->network.aor.port[t_idx] = PORT_UINT;
}
- case tsip_pname_dnsserver:
- { /* (const char*)IP_STR */
- const char* IP_STR = va_arg(*app, const char*);
- if(tnet_dns_add_server(self->dns_ctx, IP_STR)){
- TSK_DEBUG_ERROR("Failed to add [%s] as DNS server", IP_STR);
+ break;
+ }
+ case tsip_pname_discovery_naptr: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->network.discovery_naptr = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case tsip_pname_discovery_dhcp: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->network.discovery_dhcp = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case tsip_pname_proxy_cscf: {
+ /* (const char*)FQDN_STR, (unsigned)PORT_UINT, (const char*)TRANSPORT_STR, (const char*)IP_VERSION_STR */
+ const char* FQDN_STR = va_arg(*app, const char*);
+ tnet_port_t PORT_UINT = va_arg(*app, unsigned);
+ const char* TRANSPORT_STR = va_arg(*app, const char*);
+ const char* IP_VERSION_STR = va_arg(*app, const char*);
+ int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
+ if(t_idx < 0) {
+ TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR);
+ return -1;
+ }
+
+ if(TSIP_STACK_MODE_IS_CLIENT(self)) {
+ // "client" mode support a unique proxy_cscf -> reset previous transports
+ int k;
+ for(k = 0; k < sizeof(self->network.proxy_cscf_type)/sizeof(self->network.proxy_cscf_type[0]); ++k) {
+ self->network.proxy_cscf_type[k] = tnet_socket_type_invalid;
}
- break;
}
- case tsip_pname_max_fds:
- { /* (unsigned)MAX_FDS_UINT */
- self->network.max_fds = va_arg(*app, unsigned);
- break;
+
+ /* IP Address */
+ tsk_strupdate(&self->network.proxy_cscf[t_idx], FQDN_STR);
+
+ /* Port */
+ if(PORT_UINT) {
+ self->network.proxy_cscf_port[t_idx] = PORT_UINT;
+ }
+
+ /* Transport */
+ if(tsk_strnullORempty(TRANSPORT_STR) || tsk_striequals(TRANSPORT_STR, "UDP")) {
+ TNET_SOCKET_TYPE_SET_UDP(self->network.proxy_cscf_type[t_idx]);
}
- case tsip_pname_mode:
- { /* (tsip_stack_mode_t)MODE_ENUM */
- self->network.mode = va_arg(*app, tsip_stack_mode_t);
- break;
+ else if(tsk_striequals(TRANSPORT_STR, "DTLS")) {
+ TNET_SOCKET_TYPE_SET_DTLS(self->network.proxy_cscf_type[t_idx]);
}
-
-
-
- /* === Security === */
- case tsip_pname_early_ims:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->security.earlyIMS = va_arg(*app, tsk_bool_t);
- break;
+ else if(tsk_striequals(TRANSPORT_STR, "TCP")) {
+ TNET_SOCKET_TYPE_SET_TCP(self->network.proxy_cscf_type[t_idx]);
}
- case tsip_pname_secagree_ipsec:
- { /* (const char*)TRANSPORT_STR, (tsk_bool_t)ENABLED_BOOL */
- const char* TRANSPORT_STR = va_arg(*app, const char*);
- tsk_bool_t ENABLED_BOOL = va_arg(*app, tsk_bool_t);
- int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
- if(t_idx < 0) { TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR); return -1; }
- if(ENABLED_BOOL){
- tsk_strupdate(&self->security.secagree_mech, "ipsec-3gpp");
- TNET_SOCKET_TYPE_SET_IPSEC(self->network.proxy_cscf_type[t_idx]);
- }
- else{
- TNET_SOCKET_TYPE_UNSET(self->network.proxy_cscf_type[t_idx], IPSEC);
- }
- break;
+ else if(tsk_striequals(TRANSPORT_STR, "TLS")) {
+ TNET_SOCKET_TYPE_SET_TLS(self->network.proxy_cscf_type[t_idx]);
}
- case tsip_pname_secagree_tls:
- { /* (tsk_bool_t)ENABLED_BOOL */
- if((self->security.enable_secagree_tls = va_arg(*app, tsk_bool_t))){
- tsk_strupdate(&self->security.secagree_mech, "tls");
- }
- break;
+ else if(tsk_striequals(TRANSPORT_STR, "SCTP")) {
+ TNET_SOCKET_TYPE_SET_SCTP(self->network.proxy_cscf_type[t_idx]);
}
- case tsip_pname_amf:
- { /* (uint16_t)AMF_UINT16 */
- unsigned amf = va_arg(*app, unsigned);
- self->security.amf[0] = (amf >> 8);
- self->security.amf[1] = (amf & 0xFF);
- break;
+ else if(tsk_striequals(TRANSPORT_STR, "WS")) {
+ TNET_SOCKET_TYPE_SET_WS(self->network.proxy_cscf_type[t_idx]);
}
- case tsip_pname_operator_id:
- { /* (const char*)OPID_HEX_STR */
- const char* hexstr = va_arg(*app, const char*);
- tsk_size_t len = tsk_strlen(hexstr);
- if(len && !(len & 0x01)){
- tsk_size_t i, j;
- if(tsk_strindexOf(hexstr, tsk_strlen(hexstr), "0x") == 0){
- hexstr += 2;
- len -= 2;
- }
- /* reset old value */
- memset(self->security.operator_id, 0, sizeof(self->security.operator_id));
-
- /* set new value */
- if(len){ /* perhaps there were only 2 chars*/
- for(i = 0, j = 0; (i<(sizeof(operator_id_t) * 2) && i<len); i+=2, j++){
-#if 0 /* Could cause SIGBUS error (if memory misaligned) */
- sscanf(&hexstr[i], "%2x", &self->security.operator_id[j]);
-#else
- static unsigned _1bytes; /* do not use neither int8_t nor uint8_t */
- sscanf(&hexstr[i], "%2x", &_1bytes);
- self->security.operator_id[j] = (_1bytes & 0xFF);
-#endif
- }
- }
+ else if(tsk_striequals(TRANSPORT_STR, "WSS")) {
+ TNET_SOCKET_TYPE_SET_WSS(self->network.proxy_cscf_type[t_idx]);
+ }
+ TNET_SOCKET_TYPE_SET_IPV4(self->network.proxy_cscf_type[t_idx]); // IPv4 is the default version
+ /* whether to use ipv6 or not */
+ if(!tsk_strnullORempty(IP_VERSION_STR)) {
+ if(tsk_strcontains(IP_VERSION_STR, tsk_strlen(IP_VERSION_STR), "6")) {
+ TNET_SOCKET_TYPE_SET_IPV6Only(self->network.proxy_cscf_type[t_idx]); // "only" to clear IPv4 flag
}
- else{
- TSK_DEBUG_ERROR("%s is invalid for an Operator Id value.", hexstr);
+ if(tsk_strcontains(IP_VERSION_STR, tsk_strlen(IP_VERSION_STR), "4")) {
+ TNET_SOCKET_TYPE_SET_IPV4(self->network.proxy_cscf_type[t_idx]); /* Not IPV4only ==> '46'/'64' */
}
- break;
}
- case tsip_pname_ipsec_params:
- { /* (const char*)ALG_STR, (const char*)EALG_STR, (const char*)MODE_STR, (const char*)PROTOCOL_STR*/
- tsk_strupdate(&self->security.ipsec.alg, va_arg(*app, const char*));
- tsk_strupdate(&self->security.ipsec.ealg, va_arg(*app, const char*));
- tsk_strupdate(&self->security.ipsec.mode, va_arg(*app, const char*));
- tsk_strupdate(&self->security.ipsec.protocol, va_arg(*app, const char*));
- break;
+ /* use same transport type as the proxy-cscf */
+ self->network.transport_types[t_idx] = self->network.proxy_cscf_type[t_idx];
+ /* set default transport */
+ self->network.transport_idx_default = t_idx;
+ break;
+ }
+ case tsip_pname_dnsserver: {
+ /* (const char*)IP_STR */
+ const char* IP_STR = va_arg(*app, const char*);
+ if(tnet_dns_add_server(self->dns_ctx, IP_STR)) {
+ TSK_DEBUG_ERROR("Failed to add [%s] as DNS server", IP_STR);
}
- case tsip_pname_tls_certs:
- { /* (const char*)CA_FILE_STR, (const char*)PUB_FILE_STR, (const char*)PRIV_FILE_STR, (tsk_bool_t)VERIF_BOOL */
- tsk_strupdate(&self->security.tls.ca, va_arg(*app, const char*));
- tsk_strupdate(&self->security.tls.pbk, va_arg(*app, const char*));
- tsk_strupdate(&self->security.tls.pvk, va_arg(*app, const char*));
- self->security.tls.verify = va_arg(*app, tsk_bool_t);
- break;
+ break;
+ }
+ case tsip_pname_max_fds: {
+ /* (unsigned)MAX_FDS_UINT */
+ self->network.max_fds = va_arg(*app, unsigned);
+ break;
+ }
+ case tsip_pname_mode: {
+ /* (tsip_stack_mode_t)MODE_ENUM */
+ self->network.mode = va_arg(*app, tsip_stack_mode_t);
+ break;
+ }
+
+
+
+ /* === Security === */
+ case tsip_pname_early_ims: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->security.earlyIMS = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case tsip_pname_secagree_ipsec: {
+ /* (const char*)TRANSPORT_STR, (tsk_bool_t)ENABLED_BOOL */
+ const char* TRANSPORT_STR = va_arg(*app, const char*);
+ tsk_bool_t ENABLED_BOOL = va_arg(*app, tsk_bool_t);
+ int t_idx = __tsip_stack_get_transport_idx_by_name(self, TRANSPORT_STR);
+ if(t_idx < 0) {
+ TSK_DEBUG_ERROR("%s not valid as transport or you're probably using deprecated function", TRANSPORT_STR);
+ return -1;
}
-
-
- /* === Dummy Headers === */
- case tsip_pname_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* NAME_STR = va_arg(*app, const char*);
- const char* VALUE_STR = va_arg(*app, const char*);
- if(VALUE_STR == ((const char*)-1)){ /* UNSET */
- tsk_params_remove_param(self->headers, NAME_STR);
- }
- else{ /* SET */
- tsk_params_add_param(&self->headers, NAME_STR, VALUE_STR);
- }
- break;
+ if(ENABLED_BOOL) {
+ tsk_strupdate(&self->security.secagree_mech, "ipsec-3gpp");
+ TNET_SOCKET_TYPE_SET_IPSEC(self->network.proxy_cscf_type[t_idx]);
}
-
-
- /* === Nat Traversal === */
- case tsip_pname_stun_server:
- { /* (const char*)IP_STR, (unsigned)PORT_UINT */
- const char* IP_STR = va_arg(*app, const char*);
- unsigned PORT_UINT = va_arg(*app, unsigned);
- /* do not check, Null==> disable STUN */
- tsk_strupdate(&self->natt.stun.ip, IP_STR);
- self->natt.stun.port = PORT_UINT;
- break;
+ else {
+ TNET_SOCKET_TYPE_UNSET(self->network.proxy_cscf_type[t_idx], IPSEC);
}
- case tsip_pname_stun_cred:
- { /* (const char*)USR_STR, (const char*)PASSORD_STR */
- const char* USR_STR = va_arg(*app, const char*);
- const char* PASSORD_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->natt.stun.login, USR_STR);
- tsk_strupdate(&self->natt.stun.pwd, PASSORD_STR);
- break;
+ break;
+ }
+ case tsip_pname_secagree_tls: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ if((self->security.enable_secagree_tls = va_arg(*app, tsk_bool_t))) {
+ tsk_strupdate(&self->security.secagree_mech, "tls");
}
- case tsip_pname_stun_enabled:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->natt.stun.enabled = va_arg(*app, tsk_bool_t);
- break;
+ break;
+ }
+ case tsip_pname_amf: {
+ /* (uint16_t)AMF_UINT16 */
+ unsigned amf = va_arg(*app, unsigned);
+ self->security.amf[0] = (amf >> 8);
+ self->security.amf[1] = (amf & 0xFF);
+ break;
+ }
+ case tsip_pname_operator_id: {
+ /* (const char*)OPID_HEX_STR */
+ const char* hexstr = va_arg(*app, const char*);
+ tsk_size_t len = tsk_strlen(hexstr);
+ if(len && !(len & 0x01)) {
+ tsk_size_t i, j;
+ if(tsk_strindexOf(hexstr, tsk_strlen(hexstr), "0x") == 0) {
+ hexstr += 2;
+ len -= 2;
+ }
+ /* reset old value */
+ memset(self->security.operator_id, 0, sizeof(self->security.operator_id));
+
+ /* set new value */
+ if(len) { /* perhaps there were only 2 chars*/
+ for(i = 0, j = 0; (i<(sizeof(operator_id_t) * 2) && i<len); i+=2, j++) {
+#if 0 /* Could cause SIGBUS error (if memory misaligned) */
+ sscanf(&hexstr[i], "%2x", &self->security.operator_id[j]);
+#else
+ static unsigned _1bytes; /* do not use neither int8_t nor uint8_t */
+ sscanf(&hexstr[i], "%2x", &_1bytes);
+ self->security.operator_id[j] = (_1bytes & 0xFF);
+#endif
+ }
+ }
}
- /* === User Data === */
- case tsip_pname_userdata:
- { /* (const void*)DATA_PTR */
- self->userdata = va_arg(*app, const void*);
- break;
+ else {
+ TSK_DEBUG_ERROR("%s is invalid for an Operator Id value.", hexstr);
}
-
-
-
- default:
- { /* va_list will be unsafe ==> must exit */
- TSK_DEBUG_WARN("Found unknown pname.");
- goto bail;
+ break;
+ }
+ case tsip_pname_ipsec_params: {
+ /* (const char*)ALG_STR, (const char*)EALG_STR, (const char*)MODE_STR, (const char*)PROTOCOL_STR*/
+ tsk_strupdate(&self->security.ipsec.alg, va_arg(*app, const char*));
+ tsk_strupdate(&self->security.ipsec.ealg, va_arg(*app, const char*));
+ tsk_strupdate(&self->security.ipsec.mode, va_arg(*app, const char*));
+ tsk_strupdate(&self->security.ipsec.protocol, va_arg(*app, const char*));
+ break;
+ }
+ case tsip_pname_tls_certs: {
+ /* (const char*)CA_FILE_STR, (const char*)PUB_FILE_STR, (const char*)PRIV_FILE_STR, (tsk_bool_t)VERIF_BOOL */
+ tsk_strupdate(&self->security.tls.ca, va_arg(*app, const char*));
+ tsk_strupdate(&self->security.tls.pbk, va_arg(*app, const char*));
+ tsk_strupdate(&self->security.tls.pvk, va_arg(*app, const char*));
+ self->security.tls.verify = va_arg(*app, tsk_bool_t);
+ break;
+ }
+
+
+ /* === Dummy Headers === */
+ case tsip_pname_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* NAME_STR = va_arg(*app, const char*);
+ const char* VALUE_STR = va_arg(*app, const char*);
+ if(VALUE_STR == ((const char*)-1)) { /* UNSET */
+ tsk_params_remove_param(self->headers, NAME_STR);
+ }
+ else { /* SET */
+ tsk_params_add_param(&self->headers, NAME_STR, VALUE_STR);
}
+ break;
+ }
+
+
+ /* === Nat Traversal === */
+ case tsip_pname_stun_server: {
+ /* (const char*)IP_STR, (unsigned)PORT_UINT */
+ const char* IP_STR = va_arg(*app, const char*);
+ unsigned PORT_UINT = va_arg(*app, unsigned);
+ /* do not check, Null==> disable STUN */
+ tsk_strupdate(&self->natt.stun.ip, IP_STR);
+ self->natt.stun.port = PORT_UINT;
+ break;
+ }
+ case tsip_pname_stun_cred: {
+ /* (const char*)USR_STR, (const char*)PASSORD_STR */
+ const char* USR_STR = va_arg(*app, const char*);
+ const char* PASSORD_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->natt.stun.login, USR_STR);
+ tsk_strupdate(&self->natt.stun.pwd, PASSORD_STR);
+ break;
+ }
+ case tsip_pname_stun_enabled: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->natt.stun.enabled = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ /* === User Data === */
+ case tsip_pname_userdata: {
+ /* (const void*)DATA_PTR */
+ self->userdata = va_arg(*app, const void*);
+ break;
+ }
+
+
+
+ default: {
+ /* va_list will be unsafe ==> must exit */
+ TSK_DEBUG_WARN("Found unknown pname.");
+ goto bail;
+ }
}/* switch */
}/* while */
-
+
bail:
return 0;
}
@@ -478,18 +493,18 @@ bail:
*
* @code
int app_callback(const tsip_event_t *sipevent);
-
+
const char* realm_uri = "sip:open-ims.test";
const char* impi_uri = "bob@open-ims.test";
const char* impu_uri = "sip:bob@open-ims.test";
-
+
tsip_stack_handle_t* stack = tsip_stack_create(app_callback, realm_uri, impi_uri, impu_uri,
TSIP_STACK_SET_PASSWORD("mysecret"),
// ...other macros...
TSIP_STACK_SET_NULL());
-
+
// ...whatever
-
+
TSK_OBJECT_SAFE_FREE(stack);
* @endcode
* @sa @ref tsip_stack_set()<br>@ref tsip_stack_start()
@@ -499,41 +514,47 @@ tsip_stack_handle_t* tsip_stack_create(tsip_stack_callback_f callback, const cha
tsip_stack_t* stack = tsk_null;
va_list ap;
int i;
-
+
/* === check values === */
- if(!realm_uri || !impi_uri || !impu_uri){
+ if(!realm_uri || !impi_uri || !impu_uri) {
TSK_DEBUG_ERROR("Invalid parameter.");
goto bail;
}
-
+
/* === create the stack === */
- if(!(stack = tsk_object_new(tsip_stack_def_t))){ /* should never happen */
+ if(!(stack = tsk_object_new(tsip_stack_def_t))) { /* should never happen */
TSK_DEBUG_ERROR("Failed to create the stack.");
goto bail;
}
-
+
/* === Set mandatory values (realm, IMPI and IMPU) === */
if(tsip_stack_set(stack,
TSIP_STACK_SET_REALM(realm_uri),
TSIP_STACK_SET_IMPI(impi_uri),
TSIP_STACK_SET_IMPU(impu_uri),
-
- TSIP_STACK_SET_NULL())){
+
+ TSIP_STACK_SET_NULL())) {
TSK_DEBUG_ERROR("Invalid parameter.");
TSK_OBJECT_SAFE_FREE(stack);
goto bail;
}
-
+
/* === Default values (Network) === */
stack->network.mode = tsip_stack_mode_ua;
- for(i = 0; i < sizeof(stack->network.local_port)/sizeof(stack->network.local_port[0]); ++i) { stack->network.local_port[i] = TNET_SOCKET_PORT_ANY; }
- for(i = 0; i < sizeof(stack->network.proxy_cscf_port)/sizeof(stack->network.proxy_cscf_port[0]); ++i) { stack->network.proxy_cscf_port[i] = 5060; }
- for(i = 0; i < sizeof(stack->network.proxy_cscf_type)/sizeof(stack->network.proxy_cscf_type[0]); ++i) { stack->network.proxy_cscf_type[i] = tnet_socket_type_invalid; }
+ for(i = 0; i < sizeof(stack->network.local_port)/sizeof(stack->network.local_port[0]); ++i) {
+ stack->network.local_port[i] = TNET_SOCKET_PORT_ANY;
+ }
+ for(i = 0; i < sizeof(stack->network.proxy_cscf_port)/sizeof(stack->network.proxy_cscf_port[0]); ++i) {
+ stack->network.proxy_cscf_port[i] = 5060;
+ }
+ for(i = 0; i < sizeof(stack->network.proxy_cscf_type)/sizeof(stack->network.proxy_cscf_type[0]); ++i) {
+ stack->network.proxy_cscf_type[i] = tnet_socket_type_invalid;
+ }
stack->network.max_fds = tmedia_defaults_get_max_fds();
-
+
// all events should be delivered to the user before the stack stop
tsk_runnable_set_important(TSK_RUNNABLE(stack), tsk_true);
-
+
/* === SigComp === */
// only create the handler on-demand: when compartment is added
stack->sigcomp.dms = TSIP_SIGCOMP_DMS;
@@ -541,65 +562,65 @@ tsip_stack_handle_t* tsip_stack_create(tsip_stack_callback_f callback, const cha
stack->sigcomp.cpb = TSIP_SIGCOMP_CPB;
stack->sigcomp.sip_dict = TSIP_SIGCOMP_SIP_DICT;
stack->sigcomp.pres_dict = TSIP_SIGCOMP_PRES_DICT;
-
+
/* === DNS context ===
* Because of TSIP_STACK_SET_DNS_SERVER(), ctx should be created before calling __tsip_stack_set()
*/
stack->dns_ctx = tnet_dns_ctx_create();
-
+
/* === DHCP context === */
-
+
/* === NAT Traversal === */
{
const char *server_ip, *usr_name, *usr_pwd;
uint16_t server_port;
stack->natt.stun.enabled = tmedia_defaults_get_stun_enabled();
- if(tmedia_defaults_get_stun_server(&server_ip, &server_port) == 0){
+ if(tmedia_defaults_get_stun_server(&server_ip, &server_port) == 0) {
tsk_strupdate(&stack->natt.stun.ip, server_ip);
stack->natt.stun.port = server_port;
}
- if(tmedia_defaults_get_stun_cred(&usr_name, &usr_pwd) == 0){
+ if(tmedia_defaults_get_stun_cred(&usr_name, &usr_pwd) == 0) {
tsk_strupdate(&stack->natt.stun.login, usr_name);
tsk_strupdate(&stack->natt.stun.pwd, usr_pwd);
}
}
-
+
/* === Set user supplied parameters === */
va_start(ap, impu_uri);
- if(__tsip_stack_set(stack, &ap)){
+ if(__tsip_stack_set(stack, &ap)) {
TSK_DEBUG_ERROR("Invalid parameter.");
TSK_OBJECT_SAFE_FREE(stack);
va_end(ap);
goto bail;
}
va_end(ap);
-
+
/* === Internals === */
stack->callback = callback;
- if(!stack->ssessions){
+ if(!stack->ssessions) {
stack->ssessions = tsk_list_create();
}
- if(!stack->headers){ /* could be created by tsk_params_add_param() */
+ if(!stack->headers) { /* could be created by tsk_params_add_param() */
stack->headers = tsk_list_create();
}
-
+
/* === Layers === */
- if(!(stack->layer_dialog = tsip_dialog_layer_create(stack))){
+ if(!(stack->layer_dialog = tsip_dialog_layer_create(stack))) {
TSK_DEBUG_ERROR("Failed to create Dialog layer");
TSK_OBJECT_SAFE_FREE(stack);
goto bail;
}
- if(!(stack->layer_transac = tsip_transac_layer_create(stack))){
+ if(!(stack->layer_transac = tsip_transac_layer_create(stack))) {
TSK_DEBUG_ERROR("Failed to create Transac layer");
TSK_OBJECT_SAFE_FREE(stack);
goto bail;
}
- if(!(stack->layer_transport = tsip_transport_layer_create(stack))){
+ if(!(stack->layer_transport = tsip_transport_layer_create(stack))) {
TSK_DEBUG_ERROR("Failed to create Transport layer");
TSK_OBJECT_SAFE_FREE(stack);
goto bail;
}
-
+
bail:
return stack;
}
@@ -616,44 +637,44 @@ int tsip_stack_start(tsip_stack_handle_t *self)
tsip_stack_t *stack = self;
tnet_socket_type_t* tx_values;
const char* stack_error_desc = "Failed to start the stack";
-
- if(!stack){
+
+ if(!stack) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(stack->started){
+
+ if(stack->started) {
TSK_DEBUG_INFO("Stack Already started");
return 0;
}
-
+
tsk_safeobj_lock(stack);
-
+
// transports
- if(TSIP_STACK_MODE_IS_SERVER(stack)){
+ if(TSIP_STACK_MODE_IS_SERVER(stack)) {
TSK_DEBUG_INFO("Stack running in SERVER mode");
tx_values = &stack->network.transport_types[0];
tx_count = sizeof(stack->network.transport_types) / sizeof(stack->network.transport_types[0]);
}
- else{
+ else {
TSK_DEBUG_INFO("Stack running in CLIENT mode");
tx_values = &stack->network.proxy_cscf_type[0];
tx_count = sizeof(stack->network.proxy_cscf_type) / sizeof(stack->network.proxy_cscf_type[0]);
}
-
+
/* === Timer manager === */
- if(!stack->timer_mgr_global){
+ if(!stack->timer_mgr_global) {
stack->timer_mgr_global = tsk_timer_mgr_global_ref();
}
- if((ret = tsk_timer_manager_start(stack->timer_mgr_global))){
+ if((ret = tsk_timer_manager_start(stack->timer_mgr_global))) {
goto bail;
}
-
+
/* === Set P-Preferred-Identity === */
- if(!stack->identity.preferred && stack->identity.impu){
+ if(!stack->identity.preferred && stack->identity.impu) {
stack->identity.preferred = tsk_object_ref((void*)stack->identity.impu);
}
-
+
/* === Set Max FDs === */
if (stack->network.max_fds > 0 && stack->network.max_fds < 0xFFFF) {
TSK_DEBUG_INFO("Setting max FDs to %u", (unsigned)stack->network.max_fds);
@@ -663,10 +684,10 @@ int tsip_stack_start(tsip_stack_handle_t *self)
/* goto bail; */ // Not fatal error
}
}
-
+
/* === Transport type === */
- if(!tsk_strnullORempty(stack->security.secagree_mech)){
- if(tsk_striequals(stack->security.secagree_mech, "ipsec-3gpp") && stack->security.enable_secagree_ipsec){
+ if(!tsk_strnullORempty(stack->security.secagree_mech)) {
+ if(tsk_striequals(stack->security.secagree_mech, "ipsec-3gpp") && stack->security.enable_secagree_ipsec) {
#if 0
TNET_SOCKET_TYPE_SET_IPSEC(stack->network.proxy_cscf_type);
#endif
@@ -674,59 +695,58 @@ int tsip_stack_start(tsip_stack_handle_t *self)
}
//else if if(tsk_striquals(stack->security.secagree_mech, "ipsec-ike"))
}
-
- for(t_idx = 0; t_idx < tx_count; ++t_idx){
- if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])){
+
+ for(t_idx = 0; t_idx < tx_count; ++t_idx) {
+ if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])) {
continue;
}
/* === Use DNS NAPTR+SRV for the P-CSCF discovery if we are in client mode === */
- if(TSIP_STACK_MODE_IS_CLIENT(stack)){
- if(tsk_strnullORempty(stack->network.proxy_cscf[t_idx]) || (stack->network.discovery_dhcp || stack->network.discovery_naptr)){
- if(stack->network.discovery_dhcp){ /* DHCP v4/v6 */
+ if(TSIP_STACK_MODE_IS_CLIENT(stack)) {
+ if(tsk_strnullORempty(stack->network.proxy_cscf[t_idx]) || (stack->network.discovery_dhcp || stack->network.discovery_naptr)) {
+ if(stack->network.discovery_dhcp) { /* DHCP v4/v6 */
/* FIXME: */
TSK_DEBUG_ERROR("Unexpected code called");
ret = -2;
} /* DHCP */
- else{ /* DNS NAPTR + SRV*/
+ else { /* DNS NAPTR + SRV*/
char* hostname = tsk_null;
tnet_port_t port = 0;
const char* service = TNET_SOCKET_TYPE_IS_DGRAM(tx_values[t_idx]) ? "SIP+D2U" : (TNET_SOCKET_TYPE_IS_TLS(tx_values[t_idx]) ? "SIPS+D2T" : "SIP+D2T");
- if((ret = tnet_dns_query_naptr_srv(stack->dns_ctx, stack->network.realm->host, service, &hostname, &port)) == 0){
+ if((ret = tnet_dns_query_naptr_srv(stack->dns_ctx, stack->network.realm->host, service, &hostname, &port)) == 0) {
TSK_DEBUG_INFO("DNS SRV(NAPTR(%s, %s) = [%s / %d]", stack->network.realm->host, service, hostname, port);
tsk_strupdate(&stack->network.proxy_cscf[t_idx], hostname);
- if(!stack->network.proxy_cscf_port[t_idx] || stack->network.proxy_cscf_port[t_idx]==5060){ /* Only if the Proxy-CSCF port is missing or default */
+ if(!stack->network.proxy_cscf_port[t_idx] || stack->network.proxy_cscf_port[t_idx]==5060) { /* Only if the Proxy-CSCF port is missing or default */
stack->network.proxy_cscf_port[t_idx] = port;
}
}
- else{
+ else {
TSK_DEBUG_ERROR("P-CSCF discovery using DNS NAPTR failed. The stack will use the user supplied address and port.");
}
-
+
TSK_FREE(hostname);
} /* NAPTR */
}
-
+
/* Check Proxy-CSCF IP address */
- if(!tsk_strnullORempty(stack->network.proxy_cscf[t_idx])){
+ if(!tsk_strnullORempty(stack->network.proxy_cscf[t_idx])) {
TSK_DEBUG_INFO("Proxy-CSCF=[%s]:%d", stack->network.proxy_cscf[t_idx], stack->network.proxy_cscf_port[t_idx]);
}
- else{
+ else {
TSK_DEBUG_ERROR("Proxy-CSCF IP address is Null.");
ret = -1983;
goto bail;
}
}// !Server mode
-
+
/* === Get Best source address === */
// Best local address must be updated if not defined or none is set by the user.
// The local address could be no-null if the stack is re-starting: https://code.google.com/p/doubango/issues/detail?id=454 and https://code.google.com/p/idoubs/issues/detail?id=195
if (!stack->network.local_ip_is_set_by_user[t_idx] || tsk_strnullORempty(stack->network.local_ip[t_idx]) || tsk_striequals(stack->network.local_ip[t_idx], "127.0.0.1")) { /* loacal-ip is missing? */
tnet_ip_t bestsource;
if ((ret = tnet_getbestsource(stack->network.proxy_cscf[t_idx] ? stack->network.proxy_cscf[t_idx] : "google.com",
- stack->network.proxy_cscf_port[t_idx] ? stack->network.proxy_cscf_port[t_idx] : 5060,
- tx_values[t_idx],
- &bestsource)))
- {
+ stack->network.proxy_cscf_port[t_idx] ? stack->network.proxy_cscf_port[t_idx] : 5060,
+ tx_values[t_idx],
+ &bestsource))) {
TSK_DEBUG_ERROR("Failed to get best source [%d]", ret);
/* do not exit ==> will use default IP address */
}
@@ -739,98 +759,98 @@ int tsip_stack_start(tsip_stack_handle_t *self)
TSK_DEBUG_INFO("Do not query for best source address at %d, local_ip_is_set_by_user=%d, local_ip=%s", t_idx, stack->network.local_ip_is_set_by_user[t_idx], stack->network.local_ip[t_idx]);
}
} /* for (t_idx...) */
-
+
/* === Runnable === */
TSK_RUNNABLE(stack)->run = run;
- if((ret = tsk_runnable_start(TSK_RUNNABLE(stack), tsip_event_def_t))){
+ if((ret = tsk_runnable_start(TSK_RUNNABLE(stack), tsip_event_def_t))) {
stack_error_desc = "Failed to start runnable";
TSK_DEBUG_ERROR("%s", stack_error_desc);
goto bail;
}
-
+
// must be here because the runnable object is only valid after start()
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_starting, "Stack starting");
-
+
/* === Nat Traversal === */
// delete previous context
TSK_OBJECT_SAFE_FREE(stack->natt.ctx);
- if(stack->natt.stun.enabled && !tsk_strnullORempty(stack->natt.stun.ip)){
- if(stack->natt.stun.port == 0){
+ if(stack->natt.stun.enabled && !tsk_strnullORempty(stack->natt.stun.ip)) {
+ if(stack->natt.stun.port == 0) {
/* FIXME: for now only UDP(IPv4/IPv6) is supported */
stack->natt.stun.port = kStunPortDefaultTcpUdp;
}
TSK_DEBUG_INFO("STUN server = %s:%u", stack->natt.stun.ip, stack->natt.stun.port);
stack->natt.ctx = tnet_nat_context_create(TNET_SOCKET_TYPE_IS_IPV6(tx_values[stack->network.transport_idx_default])? tnet_socket_type_udp_ipv6: tnet_socket_type_udp_ipv4,
- stack->natt.stun.login, stack->natt.stun.pwd);
+ stack->natt.stun.login, stack->natt.stun.pwd);
ret = tnet_nat_set_server(stack->natt.ctx, stack->natt.stun.ip, stack->natt.stun.port);
}
-
+
/* === Transport Layer === */
- for(t_idx = 0; t_idx < tx_count; ++t_idx){
- if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])){
+ for(t_idx = 0; t_idx < tx_count; ++t_idx) {
+ if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])) {
continue;
}
- if((ret = tsip_transport_layer_add(stack->layer_transport, stack->network.local_ip[t_idx], stack->network.local_port[t_idx], tx_values[t_idx], "SIP transport"))){
+ if((ret = tsip_transport_layer_add(stack->layer_transport, stack->network.local_ip[t_idx], stack->network.local_port[t_idx], tx_values[t_idx], "SIP transport"))) {
stack_error_desc = "Failed to add new transport";
TSK_DEBUG_ERROR("%s", stack_error_desc);
goto bail;
}
}
/* Starts the transport Layer */
- if((ret = tsip_transport_layer_start(stack->layer_transport))){
+ if((ret = tsip_transport_layer_start(stack->layer_transport))) {
stack_error_desc = "Failed to start sip transport";
TSK_DEBUG_ERROR("%s", stack_error_desc);
goto bail;
}
-
+
/* Update the local_ip */
- for(t_idx = 0; t_idx < tx_count; ++t_idx){
- if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])){
+ for(t_idx = 0; t_idx < tx_count; ++t_idx) {
+ if(!TNET_SOCKET_TYPE_IS_VALID(tx_values[t_idx])) {
continue;
}
- if(tsk_strnullORempty(stack->network.local_ip[t_idx])){
+ if(tsk_strnullORempty(stack->network.local_ip[t_idx])) {
const tsip_transport_t* transport = tsip_transport_layer_find_by_type(stack->layer_transport, tx_values[t_idx]);
-
- if(transport){
+
+ if(transport) {
tnet_ip_t ip;
- if(!tnet_transport_get_ip_n_port_2(transport->net_transport, &ip, tsk_null)){
+ if(!tnet_transport_get_ip_n_port_2(transport->net_transport, &ip, tsk_null)) {
tsk_strupdate(&stack->network.local_ip[t_idx], ip);
}
- else{
+ else {
TSK_DEBUG_WARN("Failed to get local_ip for transport type = %d", tx_values[t_idx]);
/* Do not exit */
}
}
}
}
-
-
+
+
/* === ALL IS OK === */
-
+
stack->started = tsk_true;
-
+
/* Signal to the end-user that the stack has been started */
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_started, "Stack started");
-
+
TSK_DEBUG_INFO("SIP STACK -- START");
-
+
tsk_safeobj_unlock(stack);
-
+
return 0;
-
-
+
+
bail:
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_failed_to_start, stack_error_desc);
/* stop all running instances */
- if(stack->layer_transport){
+ if(stack->layer_transport) {
tsip_transport_layer_shutdown(stack->layer_transport);
}
- if(TSK_RUNNABLE(stack)->running){
+ if(TSK_RUNNABLE(stack)->running) {
tsk_runnable_stop(TSK_RUNNABLE(stack));
}
-
+
tsk_safeobj_unlock(stack);
-
+
return ret;
}
@@ -850,17 +870,17 @@ bail:
*/
int tsip_stack_set(tsip_stack_handle_t *self, ...)
{
- if(self){
+ if(self) {
int ret;
tsip_stack_t *stack = self;
-
+
va_list ap;
va_start(ap, self);
ret = __tsip_stack_set(stack, &ap);
va_end(ap);
return ret;
}
- else{
+ else {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
@@ -872,10 +892,10 @@ int tsip_stack_set(tsip_stack_handle_t *self, ...)
*/
const void* tsip_stack_get_userdata(const tsip_stack_handle_t *self)
{
- if(self){
+ if(self) {
return ((const tsip_stack_t *)self)->userdata;
}
- else{
+ else {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
@@ -885,10 +905,10 @@ const void* tsip_stack_get_userdata(const tsip_stack_handle_t *self)
*/
tnet_dns_ctx_t* tsip_stack_get_dnsctx(tsip_stack_handle_t *self)
{
- if(self){
+ if(self) {
return (tnet_dns_ctx_t*)tsk_object_ref(((tsip_stack_t *)self)->dns_ctx);
}
- else{
+ else {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
@@ -898,10 +918,10 @@ tnet_dns_ctx_t* tsip_stack_get_dnsctx(tsip_stack_handle_t *self)
*/
tsip_uri_t* tsip_stack_get_preferred_id(tsip_stack_handle_t *self)
{
- if(self){
+ if(self) {
return (tsip_uri_t*)tsk_object_ref(((tsip_stack_t *)self)->identity.preferred);
}
- else{
+ else {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
@@ -912,25 +932,25 @@ tsip_uri_t* tsip_stack_get_preferred_id(tsip_stack_handle_t *self)
int tsip_stack_get_local_ip_n_port(const tsip_stack_handle_t *self, const char* protocol, tnet_port_t *port, tnet_ip_t *ip)
{
const tsip_stack_t *stack = self;
-
- if(!stack || !port || !ip){
+
+ if(!stack || !port || !ip) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
-
- if(stack){
+
+ if(stack) {
tsk_list_item_t *item;
- tsk_list_foreach(item, stack->layer_transport->transports){
+ tsk_list_foreach(item, stack->layer_transport->transports) {
tsip_transport_t *transport = item->data;
-
- if(transport){
- if(tsk_striequals(transport->protocol, protocol)){
+
+ if(transport) {
+ if(tsk_striequals(transport->protocol, protocol)) {
return tnet_transport_get_public_ip_n_port(transport->net_transport,transport->connectedFD, ip, port);
}
}
}
}
-
+
TSK_DEBUG_ERROR("No transport with such protocol (%s) could be found", protocol);
return -2;
}
@@ -946,97 +966,97 @@ int tsip_stack_get_local_ip_n_port(const tsip_stack_handle_t *self, const char*
int tsip_stack_stop(tsip_stack_handle_t *self)
{
tsip_stack_t *stack = self;
-
- if(stack){
+
+ if(stack) {
tsk_bool_t one_failed = tsk_false;
int ret = 0;
-
+
tsk_safeobj_lock(stack);
-
- if(!stack->started){
+
+ if(!stack->started) {
TSK_DEBUG_INFO("Stack already stopped");
goto bail;
}
-
+
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_stopping, "Stack stopping");
-
+
/* Hangup all dialogs starting by REGISTER */
- if((ret = tsip_dialog_layer_shutdownAll(stack->layer_dialog))){
+ if((ret = tsip_dialog_layer_shutdownAll(stack->layer_dialog))) {
TSK_DEBUG_WARN("Failed to hang-up all dialogs");
one_failed = tsk_true;
}
-
+
/* do not try to clean up transactions ==> each dialog will cancel its transactions.
* see tsip_dialog_deinit() which call tsip_transac_layer_cancel_by_dialog() */
-
+
/* Stop the timer manager */
// not done as it's global (shared). Will be done when all instance are destoyed
-
+
/* Stop the transport layer */
- if((ret = tsip_transport_layer_shutdown(stack->layer_transport))){
+ if((ret = tsip_transport_layer_shutdown(stack->layer_transport))) {
TSK_DEBUG_WARN("Failed to stop the transport layer");
one_failed = tsk_true;
}
-
- /* Signal to the end-user that the stack has been stopped
+
+ /* Signal to the end-user that the stack has been stopped
* should be done before tsk_runnable_stop() which will stop the thread
* responsible for the callbacks. The enqueued data have been marked as "important".
* As both the timer manager and the transport layer have been stoped there is no
* chance to got additional events */
- if(one_failed){
+ if(one_failed) {
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_failed_to_stop, "Stack failed to stop");
}
- else{
+ else {
TSIP_STACK_SIGNAL(self, tsip_event_code_stack_stopped, "Stack stopped");
}
-
+
/* Stop runnable (run() thread) */
- if((ret = tsk_runnable_stop(TSK_RUNNABLE(stack)))){
+ if((ret = tsk_runnable_stop(TSK_RUNNABLE(stack)))) {
TSK_DEBUG_WARN("Failed to stop the stack");
one_failed = tsk_true;
}
-
+
/* Close all SigComp Compartments (do not remove them) */
- if(stack->sigcomp.handle){
+ if(stack->sigcomp.handle) {
tsip_sigcomp_close_all(stack->sigcomp.handle);
}
-
+
/* reset AoR */
TSK_FREE_TABLE(stack->network.aor.ip);
memset(stack->network.aor.port, 0, sizeof(stack->network.aor.port));
-
+
/* stops timer manager */
- if(stack->timer_mgr_global){
+ if(stack->timer_mgr_global) {
tsk_timer_mgr_global_unref(&stack->timer_mgr_global);
}
-
- if(!one_failed){
+
+ if(!one_failed) {
stack->started = tsk_false;
}
-
+
TSK_DEBUG_INFO("SIP STACK -- STOP");
-
- bail:
+
+bail:
tsk_safeobj_unlock(stack);
-
+
return ret;
}
-
+
return -1;
}
/* internal function used to construct a valid contact URI */
tsip_uri_t* tsip_stack_get_contacturi(const tsip_stack_t *stack, const char* protocol)
{
- if(stack){
+ if(stack) {
tsk_list_item_t *item;
- tsk_list_foreach(item, stack->layer_transport->transports){
+ tsk_list_foreach(item, stack->layer_transport->transports) {
tsip_transport_t *transport = item->data;
-
- if(transport){
- if(tsk_striequals(transport->protocol, protocol)){
+
+ if(transport) {
+ if(tsk_striequals(transport->protocol, protocol)) {
tsip_uri_t* uri = tsk_null;
- if((uri = tsip_transport_get_uri(transport, tsk_false))){
+ if((uri = tsip_transport_get_uri(transport, tsk_false))) {
tsk_strupdate(&uri->user_name, stack->identity.impu->user_name);
return uri;
}
@@ -1050,20 +1070,20 @@ tsip_uri_t* tsip_stack_get_contacturi(const tsip_stack_t *stack, const char* pro
/* internal function used to construct a valid Proxy-CSCF URI used as the default first route */
tsip_uri_t* tsip_stack_get_pcscf_uri(const tsip_stack_t *stack, tnet_socket_type_t type, tsk_bool_t lr)
{
- if(stack){
+ if(stack) {
const tsip_transport_t *transport = tsk_null;
- if(!TNET_SOCKET_TYPE_IS_VALID(type) && !TSK_LIST_IS_EMPTY(stack->layer_transport->transports)){
+ if(!TNET_SOCKET_TYPE_IS_VALID(type) && !TSK_LIST_IS_EMPTY(stack->layer_transport->transports)) {
transport = stack->layer_transport->transports->head->data;
}
- else{
+ else {
transport = tsip_transport_layer_find_by_type(stack->layer_transport, type);
}
-
- if(transport){
+
+ if(transport) {
tsip_uri_t* uri = tsk_null;
tsk_bool_t ipv6 = TNET_SOCKET_TYPE_IS_IPV6(transport->type);
tsk_bool_t quote_ip = (ipv6 && tsk_strcontains(stack->network.proxy_cscf[transport->idx], tsk_strlen(stack->network.proxy_cscf[transport->idx]), ":")) /* IPv6 IP string?*/;
-
+
char* uristring = tsk_null;
tsk_sprintf(&uristring, "%s:%s%s%s:%d;%s;transport=%s",
transport->scheme,
@@ -1073,16 +1093,16 @@ tsip_uri_t* tsip_stack_get_pcscf_uri(const tsip_stack_t *stack, tnet_socket_type
stack->network.proxy_cscf_port[transport->idx],
lr ? "lr" : "",
transport->protocol);
- if(uristring){
- if((uri = tsip_uri_parse(uristring, tsk_strlen(uristring)))){
+ if(uristring) {
+ if((uri = tsip_uri_parse(uristring, tsk_strlen(uristring)))) {
//uri->host_type = ipv6 ? thttp_host_ipv6 : thttp_host_ipv4;
}
TSK_FREE(uristring);
}
-
+
return uri;
}
-
+
}
return tsk_null;
}
@@ -1100,22 +1120,22 @@ static void* TSK_STDCALL run(void* self)
{
tsk_list_item_t *curr;
tsip_stack_t *stack = self;
-
+
TSK_DEBUG_INFO("SIP STACK::run -- START");
-
+
TSK_RUNNABLE_RUN_BEGIN(stack);
-
- if((curr = TSK_RUNNABLE_POP_FIRST(stack))){
+
+ if((curr = TSK_RUNNABLE_POP_FIRST(stack))) {
tsip_event_t *sipevent = (tsip_event_t*)curr->data;
- if(stack->callback){
+ if(stack->callback) {
sipevent->userdata = stack->userdata; // needed by sessionless events
stack->callback(sipevent);
- }
+ }
tsk_object_unref(curr);
}
-
+
TSK_RUNNABLE_RUN_END(self);
-
+
TSK_DEBUG_INFO("SIP STACK::run -- STOP");
return 0;
}
@@ -1135,36 +1155,36 @@ static void* TSK_STDCALL run(void* self)
static tsk_object_t* tsip_stack_ctor(tsk_object_t * self, va_list * app)
{
tsip_stack_t *stack = self;
- if(stack){
+ if(stack) {
tsk_safeobj_init(stack);
}
return self;
}
static tsk_object_t* tsip_stack_dtor(tsk_object_t * self)
-{
+{
tsip_stack_t *stack = self;
- if(stack){
-
+ if(stack) {
+
/* /!\ Order in which objects are destroyed is very important */
-
- /* Stop
+
+ /* Stop
* Will try to hangup all dialogs */
- if(stack->started){
+ if(stack->started) {
tsip_stack_stop(stack);
}
-
- /* Layers(1/1): Transacs and dialogs use timer_mgr when destroyed
+
+ /* Layers(1/1): Transacs and dialogs use timer_mgr when destroyed
* Dialogs =>(use)=> transacs =>(use)=> transport. */
TSK_OBJECT_SAFE_FREE(stack->layer_dialog);
TSK_OBJECT_SAFE_FREE(stack->layer_transac);
TSK_OBJECT_SAFE_FREE(stack->layer_transport);
-
+
/* Internals(1/2) */
- if(stack->timer_mgr_global){
+ if(stack->timer_mgr_global) {
tsk_timer_mgr_global_unref(&stack->timer_mgr_global);
}
-
+
/* Identity */
TSK_FREE(stack->identity.display_name);
TSK_OBJECT_SAFE_FREE(stack->identity.impu);
@@ -1172,64 +1192,63 @@ static tsk_object_t* tsip_stack_dtor(tsk_object_t * self)
//TSK_OBJECT_SAFE_FREE(stack->associated_identity);
TSK_FREE(stack->identity.impi);
TSK_FREE(stack->identity.password);
-
+
/* Network(1/1) */
TSK_FREE_TABLE(stack->network.local_ip);
TSK_OBJECT_SAFE_FREE(stack->network.realm);
TSK_FREE_TABLE(stack->network.proxy_cscf);
TSK_OBJECT_SAFE_FREE(stack->paths);
-
+
TSK_FREE_TABLE(stack->network.aor.ip);
-
+
TSK_OBJECT_SAFE_FREE(stack->service_routes);
TSK_OBJECT_SAFE_FREE(stack->associated_uris);
-
+
/* SigComp (MUST be done after transports) */
TSK_OBJECT_SAFE_FREE(stack->sigcomp.handle);
-
+
/* Security(1/1) */
TSK_FREE(stack->security.secagree_mech);
TSK_FREE(stack->security.ipsec.alg);
TSK_FREE(stack->security.ipsec.ealg);
TSK_FREE(stack->security.ipsec.mode);
TSK_FREE(stack->security.ipsec.protocol);
-
+
TSK_FREE(stack->security.tls.ca);
TSK_FREE(stack->security.tls.pbk);
TSK_FREE(stack->security.tls.pvk);
-
-
+
+
/* DNS */
TSK_OBJECT_SAFE_FREE(stack->dns_ctx);
-
+
/* NAT Traversal context */
TSK_FREE(stack->natt.stun.ip);
TSK_FREE(stack->natt.stun.login);
TSK_FREE(stack->natt.stun.pwd);
TSK_OBJECT_SAFE_FREE(stack->natt.ctx);
-
+
/* DHCP */
-
+
/* features */
-
+
/* QoS */
-
+
/* Internals (2/2) */
TSK_OBJECT_SAFE_FREE(stack->ssessions);
TSK_OBJECT_SAFE_FREE(stack->headers);
-
+
tsk_safeobj_deinit(stack);
-
+
TSK_DEBUG_INFO("*** SIP Stack destroyed ***");
}
return self;
}
-static const tsk_object_def_t tsip_stack_def_s =
-{
+static const tsk_object_def_t tsip_stack_def_s = {
sizeof(tsip_stack_t),
- tsip_stack_ctor,
+ tsip_stack_ctor,
tsip_stack_dtor,
- tsk_null,
+ tsk_null,
};
const tsk_object_def_t *tsip_stack_def_t = &tsip_stack_def_s;
diff --git a/tinySIP/src/tsip_action.c b/tinySIP/src/tsip_action.c
index d34235b..a5d2feb 100755
--- a/tinySIP/src/tsip_action.c
+++ b/tinySIP/src/tsip_action.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -70,14 +70,14 @@ TSK_OBJECT_SAFE_FREE(handle);
*/
tsip_action_handle_t* tsip_action_create(tsip_action_type_t type, ...)
{
- va_list ap;
- tsip_action_t* handle;
-
- va_start(ap, type);
- handle = _tsip_action_create(type, &ap);
- va_end(ap);
-
- return handle;
+ va_list ap;
+ tsip_action_t* handle;
+
+ va_start(ap, type);
+ handle = _tsip_action_create(type, &ap);
+ va_end(ap);
+
+ return handle;
}
/**@ingroup tsip_action_group
@@ -100,143 +100,143 @@ TSK_OBJECT_SAFE_FREE(handle);
*/
int tsip_action_set(tsip_action_handle_t* self, ...)
{
- int ret;
- va_list ap;
-
- va_start(ap, self);
- ret = _tsip_action_set(self, &ap);
- va_end(ap);
-
- return ret;
+ int ret;
+ va_list ap;
+
+ va_start(ap, self);
+ ret = _tsip_action_set(self, &ap);
+ va_end(ap);
+
+ return ret;
}
/** internal fuction used to config a SIP action */
int _tsip_action_set(tsip_action_handle_t* self, va_list* app)
{
- tsip_action_param_type_t curr;
- tsip_action_t* action = self;
-
- if(!action){ /* Nothing to do */
- return 0;
- }
-
- while((curr = va_arg(*app, tsip_action_param_type_t)) != aptype_null){
-
- switch(curr){
- case aptype_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* name = va_arg(*app, const char *);
- const char* value = va_arg(*app, const char *);
-
- tsk_params_add_param(&action->headers, name, value);
- break;
- }
- case aptype_config:
- { /* (const tsip_action_handle_t*)ACTION_CONFIG_HANDLE */
- const tsip_action_t* handle = va_arg(*app, const tsip_action_handle_t *);
- if(handle && handle->type == tsip_atype_config){
- /* Copy headers */
- if(!TSK_LIST_IS_EMPTY(handle->headers)){
- tsk_list_pushback_list(action->headers, handle->headers);
- }
- /* Copy payload */
- if(handle->payload && handle->payload->data && handle->payload->size){
- TSK_OBJECT_SAFE_FREE(action->payload);
- action->payload = tsk_buffer_create(handle->payload->data, handle->payload->size);
- }
- /* Copy resp line */
- action->line_resp.code = handle->line_resp.code;
- tsk_strupdate(&action->line_resp.phrase, handle->line_resp.phrase);
- /* Copy media type */
- action->media.type = handle->media.type;
- /* Copy media params */
- if(!TSK_LIST_IS_EMPTY(handle->media.params)){
- if(!action->media.params){
- action->media.params = tmedia_params_create();
- }
- tsk_list_pushback_list(action->media.params, handle->media.params);
- }
- }
- else if(handle){ /* Only invalid type should cause error */
- TSK_DEBUG_ERROR("Invalid action configuration handle.");
- return -2;
- }
- break;
- }
- case aptype_payload:
- { /* (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE */
- const void* payload = va_arg(*app, const void *);
- tsk_size_t size = va_arg(*app, tsk_size_t);
- if(payload && size){
- TSK_OBJECT_SAFE_FREE(action->payload);
- action->payload = tsk_buffer_create(payload, size);
- }
- break;
- }
-
- case aptype_resp_line:
- { /* (int32_t)CODE_INT, (const char*)PHRASE_STR */
- int32_t code = va_arg(*app, int32_t);
- const char* phrase = va_arg(*app, const void *);
- action->line_resp.code = (short)code;
- tsk_strupdate(&action->line_resp.phrase, phrase);
- break;
- }
-
- case aptype_media_type:
- { /* (enum tmedia_type_e)TYPE_ENUM */
- action->media.type = va_arg(*app, tmedia_type_t);
- break;
- }
-
- case aptype_media:
- { /* ... */
- tmedia_params_L_t* params;
- if((params = tmedia_params_create_2(app))){
- if(action->media.params){
- tsk_list_pushback_list(action->media.params, params);
- }
- else{
- action->media.params = tsk_object_ref(params);
- }
- TSK_OBJECT_SAFE_FREE(params);
- }
- break;
- }
-
- default:
- { /* va_list will be unsafe ==> exit */
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- return -3;
- }
- } /* switch */
- } /* while */
-
- return 0;
+ tsip_action_param_type_t curr;
+ tsip_action_t* action = self;
+
+ if(!action) { /* Nothing to do */
+ return 0;
+ }
+
+ while((curr = va_arg(*app, tsip_action_param_type_t)) != aptype_null) {
+
+ switch(curr) {
+ case aptype_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* name = va_arg(*app, const char *);
+ const char* value = va_arg(*app, const char *);
+
+ tsk_params_add_param(&action->headers, name, value);
+ break;
+ }
+ case aptype_config: {
+ /* (const tsip_action_handle_t*)ACTION_CONFIG_HANDLE */
+ const tsip_action_t* handle = va_arg(*app, const tsip_action_handle_t *);
+ if(handle && handle->type == tsip_atype_config) {
+ /* Copy headers */
+ if(!TSK_LIST_IS_EMPTY(handle->headers)) {
+ tsk_list_pushback_list(action->headers, handle->headers);
+ }
+ /* Copy payload */
+ if(handle->payload && handle->payload->data && handle->payload->size) {
+ TSK_OBJECT_SAFE_FREE(action->payload);
+ action->payload = tsk_buffer_create(handle->payload->data, handle->payload->size);
+ }
+ /* Copy resp line */
+ action->line_resp.code = handle->line_resp.code;
+ tsk_strupdate(&action->line_resp.phrase, handle->line_resp.phrase);
+ /* Copy media type */
+ action->media.type = handle->media.type;
+ /* Copy media params */
+ if(!TSK_LIST_IS_EMPTY(handle->media.params)) {
+ if(!action->media.params) {
+ action->media.params = tmedia_params_create();
+ }
+ tsk_list_pushback_list(action->media.params, handle->media.params);
+ }
+ }
+ else if(handle) { /* Only invalid type should cause error */
+ TSK_DEBUG_ERROR("Invalid action configuration handle.");
+ return -2;
+ }
+ break;
+ }
+ case aptype_payload: {
+ /* (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE */
+ const void* payload = va_arg(*app, const void *);
+ tsk_size_t size = va_arg(*app, tsk_size_t);
+ if(payload && size) {
+ TSK_OBJECT_SAFE_FREE(action->payload);
+ action->payload = tsk_buffer_create(payload, size);
+ }
+ break;
+ }
+
+ case aptype_resp_line: {
+ /* (int32_t)CODE_INT, (const char*)PHRASE_STR */
+ int32_t code = va_arg(*app, int32_t);
+ const char* phrase = va_arg(*app, const void *);
+ action->line_resp.code = (short)code;
+ tsk_strupdate(&action->line_resp.phrase, phrase);
+ break;
+ }
+
+ case aptype_media_type: {
+ /* (enum tmedia_type_e)TYPE_ENUM */
+ action->media.type = va_arg(*app, tmedia_type_t);
+ break;
+ }
+
+ case aptype_media: {
+ /* ... */
+ tmedia_params_L_t* params;
+ if((params = tmedia_params_create_2(app))) {
+ if(action->media.params) {
+ tsk_list_pushback_list(action->media.params, params);
+ }
+ else {
+ action->media.params = tsk_object_ref(params);
+ }
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ break;
+ }
+
+ default: {
+ /* va_list will be unsafe ==> exit */
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ return -3;
+ }
+ } /* switch */
+ } /* while */
+
+ return 0;
}
/** internal function used to create new SIP action */
tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
{
- tsip_action_t* action = tsk_null;
-
- /* create the action */
- if(!(action = tsk_object_new(tsip_action_def_t))){
- TSK_DEBUG_ERROR("Failed to create new SIP action.");
- return tsk_null;
- }
- else{
- action->type = type;
- }
-
- /* configure the action */
- if(_tsip_action_set(action, app)){
- TSK_DEBUG_ERROR("Invalid parameter");
- TSK_OBJECT_SAFE_FREE(action);
- }
-
- return action;
+ tsip_action_t* action = tsk_null;
+
+ /* create the action */
+ if(!(action = tsk_object_new(tsip_action_def_t))) {
+ TSK_DEBUG_ERROR("Failed to create new SIP action.");
+ return tsk_null;
+ }
+ else {
+ action->type = type;
+ }
+
+ /* configure the action */
+ if(_tsip_action_set(action, app)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ TSK_OBJECT_SAFE_FREE(action);
+ }
+
+ return action;
}
@@ -248,36 +248,35 @@ tsip_action_t* _tsip_action_create(tsip_action_type_t type, va_list* app)
//
static tsk_object_t* tsip_action_ctor(tsk_object_t * self, va_list * app)
{
- tsip_action_t *action = self;
- if(action){
- action->headers = tsk_list_create();
- action->media.type = tmedia_none;
- }
- return self;
+ tsip_action_t *action = self;
+ if(action) {
+ action->headers = tsk_list_create();
+ action->media.type = tmedia_none;
+ }
+ return self;
}
static tsk_object_t* tsip_action_dtor(tsk_object_t * self)
-{
- tsip_action_t *action = self;
- if(action){
- TSK_OBJECT_SAFE_FREE(action->headers);
- TSK_OBJECT_SAFE_FREE(action->payload);
+{
+ tsip_action_t *action = self;
+ if(action) {
+ TSK_OBJECT_SAFE_FREE(action->headers);
+ TSK_OBJECT_SAFE_FREE(action->payload);
- TSK_OBJECT_SAFE_FREE(action->media.params);
+ TSK_OBJECT_SAFE_FREE(action->media.params);
- TSK_FREE(action->line_resp.phrase);
+ TSK_FREE(action->line_resp.phrase);
- TSK_FREE(action->ect.to);
- }
+ TSK_FREE(action->ect.to);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsip_action_def_s =
-{
- sizeof(tsip_action_t),
- tsip_action_ctor,
- tsip_action_dtor,
- tsk_null,
+static const tsk_object_def_t tsip_action_def_s = {
+ sizeof(tsip_action_t),
+ tsip_action_ctor,
+ tsip_action_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsip_action_def_t = &tsip_action_def_s;
diff --git a/tinySIP/src/tsip_event.c b/tinySIP/src/tsip_event.c
index 83cc165..565df45 100755
--- a/tinySIP/src/tsip_event.c
+++ b/tinySIP/src/tsip_event.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,58 +40,58 @@
/* internal function used to create base SIP event */
tsip_event_t* tsip_event_create(tsip_ssession_t* ss, short code, const char* phrase, const tsip_message_t* sipmessage, tsip_event_type_t type)
{
- tsip_event_t* e;
- if((e = tsk_object_new(tsip_event_def_t, ss, code, phrase, sipmessage, type))){
- tsip_event_init(e, ss, code, phrase, sipmessage, type);
- }
- return e;
+ tsip_event_t* e;
+ if((e = tsk_object_new(tsip_event_def_t, ss, code, phrase, sipmessage, type))) {
+ tsip_event_init(e, ss, code, phrase, sipmessage, type);
+ }
+ return e;
}
/* initialize a sip sevent */
int tsip_event_init(tsip_event_t* self, tsip_ssession_t *ss, short code, const char *phrase, const tsip_message_t* sipmessage, tsip_event_type_t type)
{
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- self->ss = tsk_object_ref(ss);
- self->code = code;
- tsk_strupdate(&(self->phrase), phrase);
- self->type = type;
- if(sipmessage){
- self->sipmessage = tsk_object_ref((void*)sipmessage);
- }
- return 0;
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ self->ss = tsk_object_ref(ss);
+ self->code = code;
+ tsk_strupdate(&(self->phrase), phrase);
+ self->type = type;
+ if(sipmessage) {
+ self->sipmessage = tsk_object_ref((void*)sipmessage);
+ }
+ return 0;
}
/* signal new event (enqueue) */
int tsip_event_signal(tsip_event_type_t type, tsip_ssession_t* ss, short code, const char *phrase)
{
- return tsip_event_signal_2(type, ss, code, phrase, tsk_null);
+ return tsip_event_signal_2(type, ss, code, phrase, tsk_null);
}
int tsip_event_signal_2(tsip_event_type_t type, tsip_ssession_t* ss, short code, const char *phrase, const struct tsip_message_s* sipmessage)
{
- tsip_event_t* e;
- if((e = tsip_event_create(ss, code, phrase, sipmessage, type))){
- TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(ss->stack), e);
- return 0;
- }
- return -1;
+ tsip_event_t* e;
+ if((e = tsip_event_create(ss, code, phrase, sipmessage, type))) {
+ TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(ss->stack), e);
+ return 0;
+ }
+ return -1;
}
int tsip_event_deinit(tsip_event_t* self)
{
- if(self){
- TSK_OBJECT_SAFE_FREE(self->ss);
-
- TSK_FREE(self->phrase);
- TSK_OBJECT_SAFE_FREE(self->sipmessage);
-
- return 0;
- }
- return -1;
+ if(self) {
+ TSK_OBJECT_SAFE_FREE(self->ss);
+
+ TSK_FREE(self->phrase);
+ TSK_OBJECT_SAFE_FREE(self->sipmessage);
+
+ return 0;
+ }
+ return -1;
}
@@ -112,15 +112,15 @@ int tsip_event_deinit(tsip_event_t* self)
//
static tsk_object_t* tsip_event_ctor(tsk_object_t * self, va_list * app)
{
- tsip_event_t *sipevent = self;
- if(sipevent){
+ tsip_event_t *sipevent = self;
+ if(sipevent) {
// const tsip_message_t* sipmessage;
// tsip_stack_t *stack;
// tsip_ssession_handle_t *SSESSION;
// short code;
// const char *phrase;
// tsip_event_type_t type;
-//
+//
// stack = va_arg(*app, tsip_stack_handle_t *);
// SSESSION = va_arg(*app, tsip_ssession_handle_t*);
//
@@ -130,34 +130,33 @@ static tsk_object_t* tsip_event_ctor(tsk_object_t * self, va_list * app)
// code = va_arg(*app, short);
//#endif
// phrase = va_arg(*app, const char *);
-//
+//
// sipmessage = va_arg(*app, const tsip_message_t*);
// type = va_arg(*app, tsip_event_type_t);
-//
+//
// tsip_event_init(self, stack, SSESSION, code, phrase, sipmessage, type);
- }
- return self;
+ }
+ return self;
}
static tsk_object_t* tsip_event_dtor(tsk_object_t * self)
-{
- tsip_event_t *sipevent = self;
- if(sipevent){
- tsip_event_deinit(sipevent);
- }
- return self;
+{
+ tsip_event_t *sipevent = self;
+ if(sipevent) {
+ tsip_event_deinit(sipevent);
+ }
+ return self;
}
static int tsip_event_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- return -1;
+ return -1;
}
-static const tsk_object_def_t tsip_event_def_s =
-{
- sizeof(tsip_event_t),
- tsip_event_ctor,
- tsip_event_dtor,
- tsip_event_cmp,
+static const tsk_object_def_t tsip_event_def_s = {
+ sizeof(tsip_event_t),
+ tsip_event_ctor,
+ tsip_event_dtor,
+ tsip_event_cmp,
};
const tsk_object_def_t *tsip_event_def_t = &tsip_event_def_s;
diff --git a/tinySIP/src/tsip_message.c b/tinySIP/src/tsip_message.c
index 5ac2545..89f2f41 100755
--- a/tinySIP/src/tsip_message.c
+++ b/tinySIP/src/tsip_message.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -49,43 +49,43 @@
/*== Predicate function to find tsk_string_t object by val*/
static int __pred_find_string_by_value(const tsk_list_item_t *item, const void *stringVal)
{
- if(item && item->data){
- tsk_string_t *string = item->data;
- return tsk_stricmp(string->value, stringVal);
- }
- return -1;
+ if(item && item->data) {
+ tsk_string_t *string = item->data;
+ return tsk_stricmp(string->value, stringVal);
+ }
+ return -1;
}
/*== Predicate function to find tsip_header_t object by type. */
static int __pred_find_header_by_type(const tsk_list_item_t *item, const void *tsip_htype)
{
- if(item && item->data){
- tsip_header_t *header = item->data;
- tsip_header_type_t htype = *((tsip_header_type_t*)tsip_htype);
- return (header->type - htype);
- }
- return -1;
+ if(item && item->data) {
+ tsip_header_t *header = item->data;
+ tsip_header_type_t htype = *((tsip_header_type_t*)tsip_htype);
+ return (header->type - htype);
+ }
+ return -1;
}
tsip_message_t* tsip_message_create()
{
- return tsk_object_new(tsip_message_def_t, tsip_unknown);
+ return tsk_object_new(tsip_message_def_t, tsip_unknown);
}
tsip_request_t* tsip_request_create(const char* method, const tsip_uri_t* uri)
{
- return tsk_object_new(tsip_message_def_t, tsip_request, method, uri);
+ return tsk_object_new(tsip_message_def_t, tsip_request, method, uri);
}
tsip_response_t* tsip_response_create(const tsip_request_t* request, short status_code, const char* reason_phrase)
{
- return tsk_object_new(tsip_message_def_t, tsip_response, request, status_code, reason_phrase);
+ return tsk_object_new(tsip_message_def_t, tsip_response, request, status_code, reason_phrase);
}
int tsip_message_add_header(tsip_message_t *self, const tsip_header_t *hdr)
{
- #define ADD_HEADER(type, field) \
+#define ADD_HEADER(type, field) \
case tsip_htype_##type: \
{ \
if(!self->field) \
@@ -95,401 +95,450 @@ int tsip_message_add_header(tsip_message_t *self, const tsip_header_t *hdr)
} \
break; \
}
-
- if(self && hdr){
- tsip_header_t *header = tsk_object_ref((void*)hdr);
-
- switch(header->type){
- ADD_HEADER(Via, firstVia);
- ADD_HEADER(From, From);
- ADD_HEADER(To, To);
- ADD_HEADER(Contact, Contact);
- ADD_HEADER(Call_ID, Call_ID);
- ADD_HEADER(CSeq, CSeq);
- ADD_HEADER(Expires, Expires);
- ADD_HEADER(Content_Type, Content_Type);
- ADD_HEADER(Content_Length, Content_Length);
-
- default: break;
- }
-
- tsk_list_push_back_data(self->headers, (void**)&header);
-
- return 0;
- }
- return -1;
+
+ if(self && hdr) {
+ tsip_header_t *header = tsk_object_ref((void*)hdr);
+
+ switch(header->type) {
+ ADD_HEADER(Via, firstVia);
+ ADD_HEADER(From, From);
+ ADD_HEADER(To, To);
+ ADD_HEADER(Contact, Contact);
+ ADD_HEADER(Call_ID, Call_ID);
+ ADD_HEADER(CSeq, CSeq);
+ ADD_HEADER(Expires, Expires);
+ ADD_HEADER(Content_Type, Content_Type);
+ ADD_HEADER(Content_Length, Content_Length);
+
+ default:
+ break;
+ }
+
+ tsk_list_push_back_data(self->headers, (void**)&header);
+
+ return 0;
+ }
+ return -1;
}
int tsip_message_add_headers(tsip_message_t *self, ...)
{
- const tsk_object_def_t* objdef;
- tsip_header_t *header;
- va_list ap;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- va_start(ap, self);
- while((objdef = va_arg(ap, const tsk_object_def_t*))){
- if((header = tsk_object_new_2(objdef, &ap))){
- tsip_message_add_header(self, header);
- TSK_OBJECT_SAFE_FREE(header);
- }
- }
- va_end(ap);
-
- return 0;
+ const tsk_object_def_t* objdef;
+ tsip_header_t *header;
+ va_list ap;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ va_start(ap, self);
+ while((objdef = va_arg(ap, const tsk_object_def_t*))) {
+ if((header = tsk_object_new_2(objdef, &ap))) {
+ tsip_message_add_header(self, header);
+ TSK_OBJECT_SAFE_FREE(header);
+ }
+ }
+ va_end(ap);
+
+ return 0;
}
int tsip_message_add_content(tsip_message_t *self, const char* content_type, const void* content, tsk_size_t size)
{
- if(self){
- if(content_type){
- TSK_OBJECT_SAFE_FREE(self->Content_Type);
- }
- TSK_OBJECT_SAFE_FREE(self->Content_Length);
- TSK_OBJECT_SAFE_FREE(self->Content);
-
- if(content_type){
- TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
- }
- TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
- self->Content = tsk_buffer_create(content, size);
-
- return 0;
- }
- return -1;
+ if(self) {
+ if(content_type) {
+ TSK_OBJECT_SAFE_FREE(self->Content_Type);
+ }
+ TSK_OBJECT_SAFE_FREE(self->Content_Length);
+ TSK_OBJECT_SAFE_FREE(self->Content);
+
+ if(content_type) {
+ TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
+ }
+ TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
+ self->Content = tsk_buffer_create(content, size);
+
+ return 0;
+ }
+ return -1;
}
const tsip_header_t *tsip_message_get_headerAt(const tsip_message_t *self, tsip_header_type_t type, tsk_size_t index)
{
- /* Do not forget to update tinyWRAP::SipMessage::getHeaderAt() */
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
- const tsip_header_t* hdr = tsk_null;
-
- if(self){
- switch(type)
- {
- case tsip_htype_Via:
- if(index == 0){
- hdr = (const tsip_header_t*)self->firstVia;
- goto bail;
- }else pos++; break;
- case tsip_htype_From:
- if(index == 0){
- hdr = (const tsip_header_t*)self->From;
- goto bail;
- }else pos++; break;
- case tsip_htype_To:
- if(index == 0){
- hdr = (const tsip_header_t*)self->To;
- goto bail;
- }else pos++; break;
- case tsip_htype_Contact:
- if(index == 0){
- hdr = (const tsip_header_t*)self->Contact;
- goto bail;
- }else pos++; break;
- case tsip_htype_Call_ID:
- if(index == 0){
- hdr = (const tsip_header_t*)self->Call_ID;
- goto bail;
- }else pos++; break;
- case tsip_htype_CSeq:
- if(index == 0){
- hdr = (const tsip_header_t*)self->CSeq;
- goto bail;
- }else pos++; break;
- case tsip_htype_Expires:
- if(index == 0){
- hdr = (const tsip_header_t*)self->Expires;
- goto bail;
- }else pos++; break;
- case tsip_htype_Content_Type:
- if(index == 0){
- hdr = (const tsip_header_t*)self->Content_Type;
- goto bail;
- }else pos++; break;
- case tsip_htype_Content_Length:
- if(index == 0){
- hdr = (const tsip_header_t*)self->Content_Length;
- goto bail;
- }else pos++; break;
- default:
- break;
- }
-
- tsk_list_foreach(item, self->headers){
- if(!__pred_find_header_by_type(item, &type)){
- if(pos++ >= index){
- hdr = item->data;
- break;
- }
- }
- }
- }
+ /* Do not forget to update tinyWRAP::SipMessage::getHeaderAt() */
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+ const tsip_header_t* hdr = tsk_null;
+
+ if(self) {
+ switch(type) {
+ case tsip_htype_Via:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->firstVia;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_From:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_To:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_Contact:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->Contact;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_Call_ID:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->Call_ID;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_CSeq:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->CSeq;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_Expires:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->Expires;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_Content_Type:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->Content_Type;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ case tsip_htype_Content_Length:
+ if(index == 0) {
+ hdr = (const tsip_header_t*)self->Content_Length;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ break;
+ default:
+ break;
+ }
+
+ tsk_list_foreach(item, self->headers) {
+ if(!__pred_find_header_by_type(item, &type)) {
+ if(pos++ >= index) {
+ hdr = item->data;
+ break;
+ }
+ }
+ }
+ }
bail:
- return hdr;
+ return hdr;
}
const tsip_header_t *tsip_message_get_headerLast(const tsip_message_t *self, tsip_header_type_t type)
{
- const tsip_header_t *hdr, *last = tsk_null;
- tsk_size_t index = 0;
- while((hdr = tsip_message_get_headerAt(self, type, index++))){
- last = hdr;
- }
- return last;
+ const tsip_header_t *hdr, *last = tsk_null;
+ tsk_size_t index = 0;
+ while((hdr = tsip_message_get_headerAt(self, type, index++))) {
+ last = hdr;
+ }
+ return last;
}
const tsip_header_t *tsip_message_get_header(const tsip_message_t *self, tsip_header_type_t type)
{
- return tsip_message_get_headerAt(self, type, 0);
+ return tsip_message_get_headerAt(self, type, 0);
}
/**
-* Indicates whether the sepecified method is listed in the SIP 'Allow' header.
+* Indicates whether the sepecified method is listed in the SIP 'Allow' header.
*
-* @param [in,out] self The SIP message holding the 'Allow' header.
-* @param [in,out] method The method to look for.
+* @param [in,out] self The SIP message holding the 'Allow' header.
+* @param [in,out] method The method to look for.
*
-* @return @a tsk_true if succeed and @a tsk_false otherwise.
+* @return @a tsk_true if succeed and @a tsk_false otherwise.
*/
tsk_bool_t tsip_message_allowed(const tsip_message_t *self, const char* method)
{
- int index = 0;
- tsip_header_Allow_t *hdr_allow;
-
- if(self){
- while( (hdr_allow = (tsip_header_Allow_t*)tsip_message_get_headerAt(self, tsip_htype_Allow, index++)) ){
- if(tsk_list_find_item_by_pred(hdr_allow->methods, __pred_find_string_by_value, method)){
- return tsk_true;
- }
- }
- }
- return tsk_false;
+ int index = 0;
+ tsip_header_Allow_t *hdr_allow;
+
+ if(self) {
+ while( (hdr_allow = (tsip_header_Allow_t*)tsip_message_get_headerAt(self, tsip_htype_Allow, index++)) ) {
+ if(tsk_list_find_item_by_pred(hdr_allow->methods, __pred_find_string_by_value, method)) {
+ return tsk_true;
+ }
+ }
+ }
+ return tsk_false;
}
tsk_bool_t tsip_message_supported(const tsip_message_t *self, const char* option)
{
- int index = 0;
- tsip_header_Supported_t *hdr_supported;
-
- if(self){
- while( (hdr_supported = (tsip_header_Supported_t*)tsip_message_get_headerAt(self, tsip_htype_Supported, index++)) ){
- if(tsk_list_find_item_by_pred(hdr_supported->options, __pred_find_string_by_value, option)){
- return tsk_true;
- }
- }
- }
- return tsk_false;
+ int index = 0;
+ tsip_header_Supported_t *hdr_supported;
+
+ if(self) {
+ while( (hdr_supported = (tsip_header_Supported_t*)tsip_message_get_headerAt(self, tsip_htype_Supported, index++)) ) {
+ if(tsk_list_find_item_by_pred(hdr_supported->options, __pred_find_string_by_value, option)) {
+ return tsk_true;
+ }
+ }
+ }
+ return tsk_false;
}
tsk_bool_t tsip_message_required(const tsip_message_t *self, const char* option)
{
- int index = 0;
- tsip_header_Require_t *hdr_require;
-
- if(self){
- while( (hdr_require = (tsip_header_Require_t*)tsip_message_get_headerAt(self, tsip_htype_Require, index++)) ){
- if(tsk_list_find_item_by_pred(hdr_require->options, __pred_find_string_by_value, option)){
- return tsk_true;
- }
- }
- }
- return tsk_false;
+ int index = 0;
+ tsip_header_Require_t *hdr_require;
+
+ if(self) {
+ while( (hdr_require = (tsip_header_Require_t*)tsip_message_get_headerAt(self, tsip_htype_Require, index++)) ) {
+ if(tsk_list_find_item_by_pred(hdr_require->options, __pred_find_string_by_value, option)) {
+ return tsk_true;
+ }
+ }
+ }
+ return tsk_false;
}
int64_t tsip_message_getExpires(const tsip_message_t *self)
-{
- if(self){
- if(self->Expires){
- return self->Expires->delta_seconds;
- }
-
- // FIXME: You MUST choose the right contact
- if(self->Contact){
- return self->Contact->expires;
- }
- }
- return -1;
+{
+ if(self) {
+ if(self->Expires) {
+ return self->Expires->delta_seconds;
+ }
+
+ // FIXME: You MUST choose the right contact
+ if(self->Contact) {
+ return self->Contact->expires;
+ }
+ }
+ return -1;
}
uint32_t tsip_message_getContent_length(const tsip_message_t *self)
{
- return (self && self->Content_Length) ? self->Content_Length->length : 0;
+ return (self && self->Content_Length) ? self->Content_Length->length : 0;
}
int tsip_message_tostring(const tsip_message_t *self, tsk_buffer_t *output)
{
- if(!self || !output){
- return -1;
- }
-
- if(TSIP_MESSAGE_IS_REQUEST(self)){
- /*Method SP Request_URI SP SIP_Version CRLF*/
- /* Method */
- tsk_buffer_append_2(output, "%s ", self->line.request.method);
- /* Request URI (without quotes but with params)*/
- tsip_uri_serialize(self->line.request.uri, tsk_true, tsk_false, output);
- /* SIP VERSION */
- tsk_buffer_append_2(output, " %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT);
- }
- else{
- /*SIP_Version SP Status_Code SP Reason_Phrase CRLF*/
- tsk_buffer_append_2(output, "%s %hi %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT, TSIP_RESPONSE_CODE(self), TSIP_RESPONSE_PHRASE(self));
- }
-
- /* First Via */
- if(self->firstVia){
- tsip_header_serialize(TSIP_HEADER(self->firstVia), output);
- }
-
- /* From */
- if(self->From){
- tsip_header_serialize(TSIP_HEADER(self->From), output);
- }
- /* To */
- if(self->To){
- tsip_header_serialize(TSIP_HEADER(self->To), output);
- }
- /* Contact */
- if(self->Contact){
- tsip_header_serialize(TSIP_HEADER(self->Contact), output);
- }
- /* Call_id */
- if(self->Call_ID){
- tsip_header_serialize(TSIP_HEADER(self->Call_ID), output);
- }
- /* CSeq */
- if(self->CSeq){
- tsip_header_serialize(TSIP_HEADER(self->CSeq), output);
- }
- /* Expires */
- if(self->Expires){
- tsip_header_serialize(TSIP_HEADER(self->Expires), output);
- }
- /* Content-Type */
- if(self->Content_Type){
- tsip_header_serialize(TSIP_HEADER(self->Content_Type), output);
- }
- /* Content-Length*/
- if(self->Content_Length){
- tsip_header_serialize(TSIP_HEADER(self->Content_Length), output);
- }
-
- /* All other headers */
- {
- tsk_list_item_t *item;
- tsk_list_foreach(item, self->headers){
- tsip_header_serialize(TSIP_HEADER(item->data), output);
- }
- }
-
- /* EMPTY LINE */
- tsk_buffer_append(output, "\r\n", 2);
-
- /* CONTENT */
- if(TSIP_MESSAGE_HAS_CONTENT(self)){
- tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
- }
-
- return 0;
+ if(!self || !output) {
+ return -1;
+ }
+
+ if(TSIP_MESSAGE_IS_REQUEST(self)) {
+ /*Method SP Request_URI SP SIP_Version CRLF*/
+ /* Method */
+ tsk_buffer_append_2(output, "%s ", self->line.request.method);
+ /* Request URI (without quotes but with params)*/
+ tsip_uri_serialize(self->line.request.uri, tsk_true, tsk_false, output);
+ /* SIP VERSION */
+ tsk_buffer_append_2(output, " %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT);
+ }
+ else {
+ /*SIP_Version SP Status_Code SP Reason_Phrase CRLF*/
+ tsk_buffer_append_2(output, "%s %hi %s\r\n", TSIP_MESSAGE_VERSION_DEFAULT, TSIP_RESPONSE_CODE(self), TSIP_RESPONSE_PHRASE(self));
+ }
+
+ /* First Via */
+ if(self->firstVia) {
+ tsip_header_serialize(TSIP_HEADER(self->firstVia), output);
+ }
+
+ /* From */
+ if(self->From) {
+ tsip_header_serialize(TSIP_HEADER(self->From), output);
+ }
+ /* To */
+ if(self->To) {
+ tsip_header_serialize(TSIP_HEADER(self->To), output);
+ }
+ /* Contact */
+ if(self->Contact) {
+ tsip_header_serialize(TSIP_HEADER(self->Contact), output);
+ }
+ /* Call_id */
+ if(self->Call_ID) {
+ tsip_header_serialize(TSIP_HEADER(self->Call_ID), output);
+ }
+ /* CSeq */
+ if(self->CSeq) {
+ tsip_header_serialize(TSIP_HEADER(self->CSeq), output);
+ }
+ /* Expires */
+ if(self->Expires) {
+ tsip_header_serialize(TSIP_HEADER(self->Expires), output);
+ }
+ /* Content-Type */
+ if(self->Content_Type) {
+ tsip_header_serialize(TSIP_HEADER(self->Content_Type), output);
+ }
+ /* Content-Length*/
+ if(self->Content_Length) {
+ tsip_header_serialize(TSIP_HEADER(self->Content_Length), output);
+ }
+
+ /* All other headers */
+ {
+ tsk_list_item_t *item;
+ tsk_list_foreach(item, self->headers) {
+ tsip_header_serialize(TSIP_HEADER(item->data), output);
+ }
+ }
+
+ /* EMPTY LINE */
+ tsk_buffer_append(output, "\r\n", 2);
+
+ /* CONTENT */
+ if(TSIP_MESSAGE_HAS_CONTENT(self)) {
+ tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content));
+ }
+
+ return 0;
}
tsip_request_type_t tsip_request_get_type(const char* method)
{
- if(tsk_strnullORempty(method)){
- return tsip_NONE;
- }
-
- if(tsk_striequals(method, "ACK")){
- return tsip_ACK;
- }else if(tsk_striequals(method, "BYE")){
- return tsip_BYE;
- }else if(tsk_striequals(method, "CANCEL")){
- return tsip_CANCEL;
- }else if(tsk_striequals(method, "INVITE")){
- return tsip_INVITE;
- }else if(tsk_striequals(method, "OPTIONS")){
- return tsip_OPTIONS;
- }else if(tsk_striequals(method, "REGISTER")){
- return tsip_REGISTER;
- }else if(tsk_striequals(method, "SUBSCRIBE")){
- return tsip_SUBSCRIBE;
- }else if(tsk_striequals(method, "NOTIFY")){
- return tsip_NOTIFY;
- }else if(tsk_striequals(method, "REFER")){
- return tsip_REFER;
- }else if(tsk_striequals(method, "INFO")){
- return tsip_INFO;
- }else if(tsk_striequals(method, "UPDATE")){
- return tsip_UPDATE;
- }else if(tsk_striequals(method, "MESSAGE")){
- return tsip_MESSAGE;
- }else if(tsk_striequals(method, "PUBLISH")){
- return tsip_PUBLISH;
- }else if(tsk_striequals(method, "PRACK")){
- return tsip_PRACK;
- }
-
- return tsip_NONE;
+ if(tsk_strnullORempty(method)) {
+ return tsip_NONE;
+ }
+
+ if(tsk_striequals(method, "ACK")) {
+ return tsip_ACK;
+ }
+ else if(tsk_striequals(method, "BYE")) {
+ return tsip_BYE;
+ }
+ else if(tsk_striequals(method, "CANCEL")) {
+ return tsip_CANCEL;
+ }
+ else if(tsk_striequals(method, "INVITE")) {
+ return tsip_INVITE;
+ }
+ else if(tsk_striequals(method, "OPTIONS")) {
+ return tsip_OPTIONS;
+ }
+ else if(tsk_striequals(method, "REGISTER")) {
+ return tsip_REGISTER;
+ }
+ else if(tsk_striequals(method, "SUBSCRIBE")) {
+ return tsip_SUBSCRIBE;
+ }
+ else if(tsk_striequals(method, "NOTIFY")) {
+ return tsip_NOTIFY;
+ }
+ else if(tsk_striequals(method, "REFER")) {
+ return tsip_REFER;
+ }
+ else if(tsk_striequals(method, "INFO")) {
+ return tsip_INFO;
+ }
+ else if(tsk_striequals(method, "UPDATE")) {
+ return tsip_UPDATE;
+ }
+ else if(tsk_striequals(method, "MESSAGE")) {
+ return tsip_MESSAGE;
+ }
+ else if(tsk_striequals(method, "PUBLISH")) {
+ return tsip_PUBLISH;
+ }
+ else if(tsk_striequals(method, "PRACK")) {
+ return tsip_PRACK;
+ }
+
+ return tsip_NONE;
}
tsip_request_t *tsip_request_new(const char* method, const tsip_uri_t *request_uri, const tsip_uri_t *from, const tsip_uri_t *to, const char *call_id, int32_t cseq)
{
- tsip_request_t* request;
-
- /* RFC 3261 8.1.1 Generating the Request
- A valid SIP request formulated by a UAC MUST, at a minimum, contain
- the following header fields: To, From, CSeq, Call-ID, Max-Forwards,
- and Via; all of these header fields are mandatory in all SIP
- requests. These six header fields are the fundamental building
- blocks of a SIP message, as they jointly provide for most of the
- critical message routing services including the addressing of
- messages, the routing of responses, limiting message propagation,
- ordering of messages, and the unique identification of transactions.
- These header fields are in addition to the mandatory request line,
- which contains the method, Request-URI, and SIP version.
- */
-
- if((request = tsip_request_create(method, request_uri))){
- tsip_message_add_headers(request,
- TSIP_HEADER_TO_VA_ARGS(to?to->display_name:tsk_null, to, tsk_null),
- TSIP_HEADER_FROM_VA_ARGS(from?from->display_name:tsk_null, from, tsk_null),
- TSIP_HEADER_CSEQ_VA_ARGS(cseq, method),
- TSIP_HEADER_CALL_ID_VA_ARGS(call_id),
- TSIP_HEADER_MAX_FORWARDS_VA_ARGS(TSIP_HEADER_MAX_FORWARDS_DEFAULT),
- /* Via will be added by the transport layer */
- /* TSIP_HEADER_USER_AGENT_VA_ARGS(TSIP_HEADER_USER_AGENT_DEFAULT), */
- TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
-
- tsk_null);
- }
-
- return request;
+ tsip_request_t* request;
+
+ /* RFC 3261 8.1.1 Generating the Request
+ A valid SIP request formulated by a UAC MUST, at a minimum, contain
+ the following header fields: To, From, CSeq, Call-ID, Max-Forwards,
+ and Via; all of these header fields are mandatory in all SIP
+ requests. These six header fields are the fundamental building
+ blocks of a SIP message, as they jointly provide for most of the
+ critical message routing services including the addressing of
+ messages, the routing of responses, limiting message propagation,
+ ordering of messages, and the unique identification of transactions.
+ These header fields are in addition to the mandatory request line,
+ which contains the method, Request-URI, and SIP version.
+ */
+
+ if((request = tsip_request_create(method, request_uri))) {
+ tsip_message_add_headers(request,
+ TSIP_HEADER_TO_VA_ARGS(to?to->display_name:tsk_null, to, tsk_null),
+ TSIP_HEADER_FROM_VA_ARGS(from?from->display_name:tsk_null, from, tsk_null),
+ TSIP_HEADER_CSEQ_VA_ARGS(cseq, method),
+ TSIP_HEADER_CALL_ID_VA_ARGS(call_id),
+ TSIP_HEADER_MAX_FORWARDS_VA_ARGS(TSIP_HEADER_MAX_FORWARDS_DEFAULT),
+ /* Via will be added by the transport layer */
+ /* TSIP_HEADER_USER_AGENT_VA_ARGS(TSIP_HEADER_USER_AGENT_DEFAULT), */
+ TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
+
+ tsk_null);
+ }
+
+ return request;
}
tsip_response_t *tsip_response_new(short status_code, const char* reason_phrase, const tsip_request_t *request)
{
- tsip_response_t *response = tsk_null;
+ tsip_response_t *response = tsk_null;
- if(request){
- if((response = tsip_response_create(request, status_code, reason_phrase))){
- tsip_message_add_headers(response,
- /* TSIP_HEADER_USER_AGENT_VA_ARGS(TSIP_HEADER_USER_AGENT_DEFAULT), */ /* To be compliant with OMA SIMPLE IM v1.0*/
- TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
+ if(request) {
+ if((response = tsip_response_create(request, status_code, reason_phrase))) {
+ tsip_message_add_headers(response,
+ /* TSIP_HEADER_USER_AGENT_VA_ARGS(TSIP_HEADER_USER_AGENT_DEFAULT), */ /* To be compliant with OMA SIMPLE IM v1.0*/
+ TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(0),
- tsk_null);
- }
- }
+ tsk_null);
+ }
+ }
- return response;
+ return response;
}
@@ -508,147 +557,142 @@ tsip_response_t *tsip_response_new(short status_code, const char* reason_phrase,
*/
static tsk_object_t* tsip_message_ctor(tsk_object_t *self, va_list * app)
{
- tsip_message_t *message = self;
- if(message)
- {
- message->type = va_arg(*app, tsip_message_type_t);
- message->headers = tsk_list_create();
- message->local_fd = TNET_INVALID_FD;
- message->line.request.request_type = tsip_NONE;
-
-
- switch(message->type)
- {
- case tsip_unknown:
- {
- break;
- }
+ tsip_message_t *message = self;
+ if(message) {
+ message->type = va_arg(*app, tsip_message_type_t);
+ message->headers = tsk_list_create();
+ message->local_fd = TNET_INVALID_FD;
+ message->line.request.request_type = tsip_NONE;
- case tsip_request:
- {
- message->line.request.method = tsk_strdup(va_arg(*app, const char*));
- message->line.request.uri = tsk_object_ref((void*)va_arg(*app, const tsip_uri_t*));
- message->line.request.request_type = tsip_request_get_type(message->line.request.method);
- break;
- }
+ switch(message->type) {
+ case tsip_unknown: {
+ break;
+ }
- case tsip_response:
- {
- const tsip_request_t* request = va_arg(*app, const tsip_request_t*);
+ case tsip_request: {
+ message->line.request.method = tsk_strdup(va_arg(*app, const char*));
+ message->line.request.uri = tsk_object_ref((void*)va_arg(*app, const tsip_uri_t*));
+
+ message->line.request.request_type = tsip_request_get_type(message->line.request.method);
+ break;
+ }
+
+ case tsip_response: {
+ const tsip_request_t* request = va_arg(*app, const tsip_request_t*);
#if defined(__GNUC__)
- message->line.response.status_code = (short)va_arg(*app, int);
+ message->line.response.status_code = (short)va_arg(*app, int);
#else
- message->line.response.status_code = va_arg(*app, short);
+ message->line.response.status_code = va_arg(*app, short);
#endif
- message->line.response.reason_phrase = tsk_strdup(va_arg(*app, const char*));
-
- /* Copy network information */
- message->local_fd = request->local_fd;
- message->remote_addr = request->remote_addr;
- message->src_net_type = request->src_net_type;
- message->dst_net_type = request->dst_net_type;
-
- /*
- RFC 3261 - 8.2.6.2 Headers and Tags
-
- The From field of the response MUST equal the From header field of
- the request. The Call-ID header field of the response MUST equal the
- Call-ID header field of the request. The CSeq header field of the
- response MUST equal the CSeq field of the request. The Via header
- field values in the response MUST equal the Via header field values
- in the request and MUST maintain the same ordering.
-
- If a request contained a To tag in the request, the To header field
- in the response MUST equal that of the request. However, if the To
- header field in the request did not contain a tag, the URI in the To
- header field in the response MUST equal the URI in the To header
- field; additionally, the UAS MUST add a tag to the To header field in
- the response (with the exception of the 100 (Trying) response, in
- which a tag MAY be present). This serves to identify the UAS that is
- responding, possibly resulting in a component of a dialog ID. The
- same tag MUST be used for all responses to that request, both final
- and provisional (again excepting the 100 (Trying)). Procedures for
- the generation of tags are defined in Section 19.3.
- */
- message->From = tsk_object_ref((void*)request->From);
- message->Call_ID = tsk_object_ref((void*)request->Call_ID);
- message->CSeq = tsk_object_ref((void*)request->CSeq);
- message->firstVia = tsk_object_ref((void*)request->firstVia);
- /* All other VIAs */
- if(message->firstVia){
- tsk_size_t index = 1;
- const tsip_header_t * via;
- while((via = tsip_message_get_headerAt(request, tsip_htype_Via, index++))){
- tsip_message_add_header(message, via);
- }
- }
- /* Record routes */
- {
- tsk_size_t index = 0;
- const tsip_header_t *record_route;
- while((record_route = tsip_message_get_headerAt(request, tsip_htype_Record_Route, index++))){
- tsip_message_add_header(message, record_route);
- }
- }
- message->To = tsk_object_ref((void*)request->To);
-
- break;
- }
- }
- }
- else
- {
- TSK_DEBUG_ERROR("Failed to create new sip message.");
- }
- return self;
+ message->line.response.reason_phrase = tsk_strdup(va_arg(*app, const char*));
+
+ /* Copy network information */
+ message->local_fd = request->local_fd;
+ message->remote_addr = request->remote_addr;
+ message->src_net_type = request->src_net_type;
+ message->dst_net_type = request->dst_net_type;
+
+ /*
+ RFC 3261 - 8.2.6.2 Headers and Tags
+
+ The From field of the response MUST equal the From header field of
+ the request. The Call-ID header field of the response MUST equal the
+ Call-ID header field of the request. The CSeq header field of the
+ response MUST equal the CSeq field of the request. The Via header
+ field values in the response MUST equal the Via header field values
+ in the request and MUST maintain the same ordering.
+
+ If a request contained a To tag in the request, the To header field
+ in the response MUST equal that of the request. However, if the To
+ header field in the request did not contain a tag, the URI in the To
+ header field in the response MUST equal the URI in the To header
+ field; additionally, the UAS MUST add a tag to the To header field in
+ the response (with the exception of the 100 (Trying) response, in
+ which a tag MAY be present). This serves to identify the UAS that is
+ responding, possibly resulting in a component of a dialog ID. The
+ same tag MUST be used for all responses to that request, both final
+ and provisional (again excepting the 100 (Trying)). Procedures for
+ the generation of tags are defined in Section 19.3.
+ */
+ message->From = tsk_object_ref((void*)request->From);
+ message->Call_ID = tsk_object_ref((void*)request->Call_ID);
+ message->CSeq = tsk_object_ref((void*)request->CSeq);
+ message->firstVia = tsk_object_ref((void*)request->firstVia);
+ /* All other VIAs */
+ if(message->firstVia) {
+ tsk_size_t index = 1;
+ const tsip_header_t * via;
+ while((via = tsip_message_get_headerAt(request, tsip_htype_Via, index++))) {
+ tsip_message_add_header(message, via);
+ }
+ }
+ /* Record routes */
+ {
+ tsk_size_t index = 0;
+ const tsip_header_t *record_route;
+ while((record_route = tsip_message_get_headerAt(request, tsip_htype_Record_Route, index++))) {
+ tsip_message_add_header(message, record_route);
+ }
+ }
+ message->To = tsk_object_ref((void*)request->To);
+
+ break;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new sip message.");
+ }
+ return self;
}
/**@ingroup tsip_message_group
*/
static tsk_object_t* tsip_message_dtor(tsk_object_t *self)
{
- tsip_message_t *message = self;
- if(message){
- if(TSIP_MESSAGE_IS_REQUEST(message)){
- TSK_FREE(message->line.request.method);
- TSK_OBJECT_SAFE_FREE(message->line.request.uri);
- }
- else if(TSIP_MESSAGE_IS_RESPONSE(message)){
- TSK_FREE(message->line.response.reason_phrase);
- }
-
- TSK_FREE(message->sip_version);
-
- TSK_OBJECT_SAFE_FREE(message->Call_ID);
- TSK_OBJECT_SAFE_FREE(message->Contact);
- TSK_OBJECT_SAFE_FREE(message->Content_Length);
- TSK_OBJECT_SAFE_FREE(message->Content_Type);
- TSK_OBJECT_SAFE_FREE(message->CSeq);
- TSK_OBJECT_SAFE_FREE(message->firstVia);
- TSK_OBJECT_SAFE_FREE(message->From);
- TSK_OBJECT_SAFE_FREE(message->Expires);
- TSK_OBJECT_SAFE_FREE(message->To);
-
- TSK_OBJECT_SAFE_FREE(message->Content);
-
- TSK_OBJECT_SAFE_FREE(message->headers);
-
- TSK_FREE(message->sigcomp_id);
-
- TSK_FREE(message->dst_address);
- }
- else TSK_DEBUG_ERROR("Null SIP message.");
-
- return self;
+ tsip_message_t *message = self;
+ if(message) {
+ if(TSIP_MESSAGE_IS_REQUEST(message)) {
+ TSK_FREE(message->line.request.method);
+ TSK_OBJECT_SAFE_FREE(message->line.request.uri);
+ }
+ else if(TSIP_MESSAGE_IS_RESPONSE(message)) {
+ TSK_FREE(message->line.response.reason_phrase);
+ }
+
+ TSK_FREE(message->sip_version);
+
+ TSK_OBJECT_SAFE_FREE(message->Call_ID);
+ TSK_OBJECT_SAFE_FREE(message->Contact);
+ TSK_OBJECT_SAFE_FREE(message->Content_Length);
+ TSK_OBJECT_SAFE_FREE(message->Content_Type);
+ TSK_OBJECT_SAFE_FREE(message->CSeq);
+ TSK_OBJECT_SAFE_FREE(message->firstVia);
+ TSK_OBJECT_SAFE_FREE(message->From);
+ TSK_OBJECT_SAFE_FREE(message->Expires);
+ TSK_OBJECT_SAFE_FREE(message->To);
+
+ TSK_OBJECT_SAFE_FREE(message->Content);
+
+ TSK_OBJECT_SAFE_FREE(message->headers);
+
+ TSK_FREE(message->sigcomp_id);
+
+ TSK_FREE(message->dst_address);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SIP message.");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsip_message_def_s =
-{
- sizeof(tsip_message_t),
- tsip_message_ctor,
- tsip_message_dtor,
- tsk_null
+static const tsk_object_def_t tsip_message_def_s = {
+ sizeof(tsip_message_t),
+ tsip_message_ctor,
+ tsip_message_dtor,
+ tsk_null
};
const tsk_object_def_t *tsip_message_def_t = &tsip_message_def_s;
diff --git a/tinySIP/src/tsip_ssession.c b/tinySIP/src/tsip_ssession.c
index 47b78da..8db4194 100755
--- a/tinySIP/src/tsip_ssession.c
+++ b/tinySIP/src/tsip_ssession.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,614 +47,633 @@
/* internal function used to create session for server dialogs */
tsip_ssession_handle_t* tsip_ssession_create_2(const tsip_stack_t* stack, const struct tsip_message_s* message)
{
- tsip_ssession_t* ss = tsk_null;
-
- if(message){
- char *from = tsk_null, *to = tsk_null;
-
- /* From: */
- if(message->From && message->From->uri){ /* MUST be not null */
- from = tsip_uri_tostring(message->From->uri, tsk_false, tsk_false);
- }
- /* To: */
- if(message->To && message->To->uri){ /* MUST be not null */
- to = tsip_uri_tostring(message->To->uri, tsk_false, tsk_false);
- }
- /* create the "server-side-session" */
- if((ss = tsip_ssession_create((tsip_stack_handle_t*)stack, TSIP_SSESSION_SET_NULL()))){
- tsip_ssession_set(ss,
- /* default values should be in conformance with the swig wrapper */
- TSIP_SSESSION_SET_FROM_STR(from),
- TSIP_SSESSION_SET_TO_STR(to),
- TSIP_SSESSION_SET_NULL());
- }
-
- /* in all cases */
- TSK_FREE(from);
- TSK_FREE(to);
- }
-
- /* as the it's a "server-side-session", you are not the owner
- * The end-user should call tsip_ssession_have_ownership() to check whether he has the ownership.
- * The end-user should also call tsip_ssession_take_ownership() to take the ownership. This will avoid the session to be deleted by the stack
- * when the associated dialog ends. */
- if(ss){
- ss->owner = tsk_false;
- }
-
- return ss;
+ tsip_ssession_t* ss = tsk_null;
+
+ if(message) {
+ char *from = tsk_null, *to = tsk_null;
+
+ /* From: */
+ if(message->From && message->From->uri) { /* MUST be not null */
+ from = tsip_uri_tostring(message->From->uri, tsk_false, tsk_false);
+ }
+ /* To: */
+ if(message->To && message->To->uri) { /* MUST be not null */
+ to = tsip_uri_tostring(message->To->uri, tsk_false, tsk_false);
+ }
+ /* create the "server-side-session" */
+ if((ss = tsip_ssession_create((tsip_stack_handle_t*)stack, TSIP_SSESSION_SET_NULL()))) {
+ tsip_ssession_set(ss,
+ /* default values should be in conformance with the swig wrapper */
+ TSIP_SSESSION_SET_FROM_STR(from),
+ TSIP_SSESSION_SET_TO_STR(to),
+ TSIP_SSESSION_SET_NULL());
+ }
+
+ /* in all cases */
+ TSK_FREE(from);
+ TSK_FREE(to);
+ }
+
+ /* as the it's a "server-side-session", you are not the owner
+ * The end-user should call tsip_ssession_have_ownership() to check whether he has the ownership.
+ * The end-user should also call tsip_ssession_take_ownership() to take the ownership. This will avoid the session to be deleted by the stack
+ * when the associated dialog ends. */
+ if(ss) {
+ ss->owner = tsk_false;
+ }
+
+ return ss;
}
int __tsip_ssession_set_To(tsip_ssession_t *self, const char* value)
-{
- tsip_uri_t* uri;
- if(value && (uri = tsip_uri_parse(value, tsk_strlen(value)))){
- TSK_OBJECT_SAFE_FREE(self->to);
- self->to = uri;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("%s is invalid as 'To' header value", value);
- return -1;
- }
+{
+ tsip_uri_t* uri;
+ if(value && (uri = tsip_uri_parse(value, tsk_strlen(value)))) {
+ TSK_OBJECT_SAFE_FREE(self->to);
+ self->to = uri;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("%s is invalid as 'To' header value", value);
+ return -1;
+ }
}
int __tsip_ssession_set_From(tsip_ssession_t *self, const char* value)
{
- tsip_uri_t* uri;
- if(value && (uri = tsip_uri_parse(value, tsk_strlen(value)))){
- TSK_OBJECT_SAFE_FREE(self->from);
- self->from = uri;
- return 0;
- }
- else{
- TSK_DEBUG_ERROR("%s is invalid as 'From' header value", value);
- return -1;
- }
+ tsip_uri_t* uri;
+ if(value && (uri = tsip_uri_parse(value, tsk_strlen(value)))) {
+ TSK_OBJECT_SAFE_FREE(self->from);
+ self->from = uri;
+ return 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("%s is invalid as 'From' header value", value);
+ return -1;
+ }
}
int __tsip_ssession_set(tsip_ssession_t *self, va_list *app)
{
- tsip_ssession_param_type_t sscurr;
- tsip_msession_param_type_t mscurr;
- tmedia_session_mgr_t* mgr = tsk_null;
-
- int ret = 0;
-
- if(!self){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- while((sscurr = va_arg(*app, tsip_ssession_param_type_t)) != sstype_null){
- switch(sscurr){
- //=======
- // Sip
- //=======
- case sstype_header:
- case sstype_caps:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* name = va_arg(*app, const char *);
- const char* value = va_arg(*app, const char *);
-
- if(sscurr == sstype_header){
- /* whether to SET or UNSET the header */
- if(value == ((const char*)-1)){
- tsk_params_remove_param(self->headers, name);
- break;
- }
-
- /* From */
- if(value && tsk_striequals(name, "From")){
- if((ret = __tsip_ssession_set_From(self, value))){
- goto bail;
- }
- }
- /* To */
- else if(value && tsk_striequals(name, "To")){
- if((ret = __tsip_ssession_set_To(self, value))){
- goto bail;
- }
- }
- /* Expires */
- else if(value && tsk_striequals(name, "Expires")){
- /* should never happen ==> ...but who know? */
- }
- /* Any other */
- else{
- tsk_params_add_param(&self->headers, name, value);
- }
- }else if(sscurr == sstype_caps){
- if(value == ((const char*)-1)){ /* UNSET */
- tsk_params_remove_param(self->caps, name);
- }
- else{ /* SET */
- tsk_params_add_param(&self->caps, name, value);
- }
- }
- break;
- }
- case sstype_userdata:
- { /* (const void*)DATA_PTR */
- self->userdata = va_arg(*app, const void *);
- break;
- }
- case sstype_to_str:
- { /* (const char*)URI_STR */
- if((ret = __tsip_ssession_set_To(self, va_arg(*app, const char *)))){
- goto bail;
- }
- break;
- }
- case sstype_from_str:
- { /* (const char*)URI_STR*/
- if((ret = __tsip_ssession_set_From(self, va_arg(*app, const char *)))){
- goto bail;
- }
- break;
- }
- case sstype_to_obj:
- { /* (const tsip_uri_t*)URI_OBJ */
- const tsip_uri_t* URI_OBJ = va_arg(*app, const tsip_uri_t *);
- if(URI_OBJ){
- TSK_OBJECT_SAFE_FREE(self->to);
- self->to = tsk_object_ref((void*)URI_OBJ);
- }
- break;
- }
- case sstype_from_obj:
- { /* (const char*)URI_OBJ*/
- const tsip_uri_t* URI_OBJ = va_arg(*app, const tsip_uri_t *);
- if(URI_OBJ){
- TSK_OBJECT_SAFE_FREE(self->from);
- self->from = tsk_object_ref((void*)URI_OBJ);
- }
- break;
- }
- case sstype_nocontact:
- { /* (tsk_bool_t)ENABLED_BOOL */
- self->no_contact = va_arg(*app, tsk_bool_t);
- break;
- }
- case sstype_expires:
- { /* (unsigned)VALUE_UINT */
- self->expires = (((int64_t)va_arg(*app, unsigned)) * 1000) /* milliseconds */;
- break;
- }
- case sstype_silent_hangup:
- { /* sstype_silent_hangup, (tsk_bool_t)ENABLED_BOOL */
- self->silent_hangup = va_arg(*app, tsk_bool_t);
- break;
- }
- case sstype_sigcomp_id:
- { /* (const char*)COMPARTMENT_ID_STR */
- const char* COMPARTMENT_ID_STR = va_arg(*app, const char*);
- if(COMPARTMENT_ID_STR == (const char*)-1){
- TSK_FREE(self->sigcomp_id);
- }
- else{
- tsk_strupdate(&self->sigcomp_id, COMPARTMENT_ID_STR);
- }
- break;
- }
- case sstype_auth_ha1:
- { /* (const char*)AUTH_HA1_STR */
- const char* AUTH_HA1_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->auth_ha1, AUTH_HA1_STR);
- break;
- }
- case sstype_auth_impi:
- { /* (const char*)AUTH_IMPI_STR */
- const char* AUTH_IMPI_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->auth_impi, AUTH_IMPI_STR);
- break;
- }
- case sstype_parent_id:
- { /* ((tsip_ssession_id_t)PARENT_ID_SSID) */
- self->id_parent = va_arg(*app, tsip_ssession_id_t);
- break;
- }
- case sstype_ws_src:
- { /* (const char*)SRC_HOST_STR, (int32_t)SRC_PORT_INT, (const char*)SRC_PROTO_STR */
- const char* SRC_HOST_STR = va_arg(*app, const char*);
- int32_t SRC_PORT_INT = va_arg(*app, int32_t);
- const char* SRC_PROTO_STR = va_arg(*app, const char*);
- tsk_strupdate(&self->ws.src.host, SRC_HOST_STR);
- tsk_itoa(SRC_PORT_INT, &self->ws.src.port);
- tsk_strupdate(&self->ws.src.proto, SRC_PROTO_STR);
- break;
- }
- case sstype_media:
- {
- //=========
- // Media
- //=========
- if (!mgr) {
- mgr = tsip_session_get_mediamgr(self);
+ tsip_ssession_param_type_t sscurr;
+ tsip_msession_param_type_t mscurr;
+ tmedia_session_mgr_t* mgr = tsk_null;
+
+ int ret = 0;
+
+ if(!self) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ while((sscurr = va_arg(*app, tsip_ssession_param_type_t)) != sstype_null) {
+ switch(sscurr) {
+ //=======
+ // Sip
+ //=======
+ case sstype_header:
+ case sstype_caps: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* name = va_arg(*app, const char *);
+ const char* value = va_arg(*app, const char *);
+
+ if(sscurr == sstype_header) {
+ /* whether to SET or UNSET the header */
+ if(value == ((const char*)-1)) {
+ tsk_params_remove_param(self->headers, name);
+ break;
+ }
+
+ /* From */
+ if(value && tsk_striequals(name, "From")) {
+ if((ret = __tsip_ssession_set_From(self, value))) {
+ goto bail;
}
- while((mscurr = va_arg(*app, tsip_msession_param_type_t)) != mstype_null){
- switch(mscurr){
- case mstype_set_profile:
- // (tmedia_profile_t)PROFILE_ENUM
- self->media.profile = va_arg(*app, tmedia_profile_t);
- break;
- case mstype_set_srtp_mode:
- // (tmedia_srtp_mode_t)SRTP_MODE_ENUM
- self->media.srtp_mode = va_arg(*app, tmedia_srtp_mode_t);
- break;
- case mstype_set_avpf_mode:
- // (tmedia_mode_t)MEDIA_MODE_ENUM
- self->media.avpf_mode = va_arg(*app, tmedia_mode_t);
- break;
- case mstype_set_100rel: self->media.enable_100rel = va_arg(*app, tsk_bool_t); break;
- case mstype_set_ice: self->media.enable_ice = va_arg(*app, tsk_bool_t); break;
- case mstype_set_ice_stun: self->media.enable_icestun = va_arg(*app, tsk_bool_t); break;
- case mstype_set_ice_turn: self->media.enable_iceturn = va_arg(*app, tsk_bool_t); break;
- case mstype_set_rtcp: self->media.enable_rtcp = va_arg(*app, tsk_bool_t); break;
- case mstype_set_rtcpmux: self->media.enable_rtcpmux = va_arg(*app, tsk_bool_t); break;
- case mstype_set_qos:
- { /* (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM */
- self->media.qos.type = va_arg(*app, tmedia_qos_stype_t);
- self->media.qos.strength = va_arg(*app, tmedia_qos_strength_t);
- break;
- }
- case mstype_unset_qos:
- { /* */
- self->media.qos.type = tmedia_qos_stype_none;
- self->media.qos.strength = tmedia_qos_strength_none;
- break;
- }
- case mstype_set_timers:
- { /* (unsigned)TIMEOUT_UINT, (const char*)REFRESHER_STR */
- /* set values */
- self->media.timers.timeout = va_arg(*app, unsigned);
- tsk_strupdate(&self->media.timers.refresher, va_arg(*app, const char*));
- break;
- }
- case mstype_unset_timers:
- { /* */
- /* unset values */
- self->media.timers.timeout = 0;
- TSK_FREE(self->media.timers.refresher);
- break;
- }
- case mstype_set_codecs:
- {/* (signed)CODECS_INT */
- self->media.codecs = va_arg(*app, signed);
- if(mgr){ // apply now
- tmedia_session_mgr_set_codecs_supported(mgr, self->media.codecs);
- }
- break;
- }
- case mstype_set_bypass_encoding:
- {/* (tsk_bool_t)ENABLED_BOOL */
- self->media.bypass_encoding = va_arg(*app, tsk_bool_t);
- break;
- }
- case mstype_set_bypass_decoding:
- {/* (tsk_bool_t)ENABLED_BOOL */
- self->media.bypass_decoding = va_arg(*app, tsk_bool_t);
- break;
- }
- case mstype_set_rtp_ssrc:
- {/* (tmedia_type_t)MEDIA_ENUM, (uint32_t)SSRC_UINT */
- tmedia_type_t MEDIA_ENUM = va_arg(*app, tmedia_type_t);
- uint32_t SSRC_UINT = va_arg(*app, uint32_t);
- switch(MEDIA_ENUM){
- case tmedia_audio: self->media.rtp.ssrc.audio = SSRC_UINT; break;
- case tmedia_video: self->media.rtp.ssrc.video = SSRC_UINT; break;
- default: break;
- }
- break;
- }
- case mstype_set_msrp_cb:
- { /* (tmedia_session_msrp_cb_f)TMEDIA_SESSION_MSRP_CB_F */
- self->media.msrp.callback = va_arg(*app, tmedia_session_msrp_cb_f);
- break;
- }
- case mstype_set_stun_server:
- { /* (const char*)HOSTNAME, (uint16_t)PORT */
- const char* HOSTNAME = va_arg(*app, const char*);
- uint16_t PORT = tsk_va_arg_u16(*app);
- tsk_strupdate(&self->media.stun.hostname, HOSTNAME);
- self->media.stun.port = PORT;
- break;
- }
- case mstype_set_stun_cred:
- { /* (const char*)USERNAME, (const char*)PASSWORD */
- const char* USERNAME = va_arg(*app, const char*);
- const char* PASSWORD = va_arg(*app, const char*);
- tsk_strupdate(&self->media.stun.username, USERNAME);
- tsk_strupdate(&self->media.stun.password, PASSWORD);
- break;
- }
- case mstype_set_video_fps:
- {/* (signed)FPS_INT */
- self->media.video_fps = va_arg(*app, signed);
- break;
- }
- case mstype_set_video_bw_up:
- {/* (signed)BW_INT */
- self->media.video_bw_up = va_arg(*app, signed);
- break;
- }
- case mstype_set_video_bw_down:
- {/* (signed)BW_INT */
- self->media.video_bw_down = va_arg(*app, signed);
- break;
- }
- case mstype_set_video_prefsize:
- {/* (tmedia_pref_video_size_t)PREFSIZE_ENUM */
- self->media.video_pref_size = va_arg(*app, tmedia_pref_video_size_t);
- break;
- }
- default:{
- /* va_list will be unsafe => exit */
- TSK_DEBUG_ERROR("%d NOT a valid MEDIA pname", mscurr);
- goto bail; }
- } /* switch */
- } /* while */
-
- break;
- } /* case */
-
- default:{
- /* va_list will be unsafe => exit */
- TSK_DEBUG_ERROR("%d NOT a valid SIP pname", sscurr);
- goto bail; }
-
- } /* switch */
- } /* while */
+ }
+ /* To */
+ else if(value && tsk_striequals(name, "To")) {
+ if((ret = __tsip_ssession_set_To(self, value))) {
+ goto bail;
+ }
+ }
+ /* Expires */
+ else if(value && tsk_striequals(name, "Expires")) {
+ /* should never happen ==> ...but who know? */
+ }
+ /* Any other */
+ else {
+ tsk_params_add_param(&self->headers, name, value);
+ }
+ }
+ else if(sscurr == sstype_caps) {
+ if(value == ((const char*)-1)) { /* UNSET */
+ tsk_params_remove_param(self->caps, name);
+ }
+ else { /* SET */
+ tsk_params_add_param(&self->caps, name, value);
+ }
+ }
+ break;
+ }
+ case sstype_userdata: {
+ /* (const void*)DATA_PTR */
+ self->userdata = va_arg(*app, const void *);
+ break;
+ }
+ case sstype_to_str: {
+ /* (const char*)URI_STR */
+ if((ret = __tsip_ssession_set_To(self, va_arg(*app, const char *)))) {
+ goto bail;
+ }
+ break;
+ }
+ case sstype_from_str: {
+ /* (const char*)URI_STR*/
+ if((ret = __tsip_ssession_set_From(self, va_arg(*app, const char *)))) {
+ goto bail;
+ }
+ break;
+ }
+ case sstype_to_obj: {
+ /* (const tsip_uri_t*)URI_OBJ */
+ const tsip_uri_t* URI_OBJ = va_arg(*app, const tsip_uri_t *);
+ if(URI_OBJ) {
+ TSK_OBJECT_SAFE_FREE(self->to);
+ self->to = tsk_object_ref((void*)URI_OBJ);
+ }
+ break;
+ }
+ case sstype_from_obj: {
+ /* (const char*)URI_OBJ*/
+ const tsip_uri_t* URI_OBJ = va_arg(*app, const tsip_uri_t *);
+ if(URI_OBJ) {
+ TSK_OBJECT_SAFE_FREE(self->from);
+ self->from = tsk_object_ref((void*)URI_OBJ);
+ }
+ break;
+ }
+ case sstype_nocontact: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->no_contact = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case sstype_expires: {
+ /* (unsigned)VALUE_UINT */
+ self->expires = (((int64_t)va_arg(*app, unsigned)) * 1000) /* milliseconds */;
+ break;
+ }
+ case sstype_silent_hangup: {
+ /* sstype_silent_hangup, (tsk_bool_t)ENABLED_BOOL */
+ self->silent_hangup = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case sstype_sigcomp_id: {
+ /* (const char*)COMPARTMENT_ID_STR */
+ const char* COMPARTMENT_ID_STR = va_arg(*app, const char*);
+ if(COMPARTMENT_ID_STR == (const char*)-1) {
+ TSK_FREE(self->sigcomp_id);
+ }
+ else {
+ tsk_strupdate(&self->sigcomp_id, COMPARTMENT_ID_STR);
+ }
+ break;
+ }
+ case sstype_auth_ha1: {
+ /* (const char*)AUTH_HA1_STR */
+ const char* AUTH_HA1_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->auth_ha1, AUTH_HA1_STR);
+ break;
+ }
+ case sstype_auth_impi: {
+ /* (const char*)AUTH_IMPI_STR */
+ const char* AUTH_IMPI_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->auth_impi, AUTH_IMPI_STR);
+ break;
+ }
+ case sstype_parent_id: {
+ /* ((tsip_ssession_id_t)PARENT_ID_SSID) */
+ self->id_parent = va_arg(*app, tsip_ssession_id_t);
+ break;
+ }
+ case sstype_ws_src: {
+ /* (const char*)SRC_HOST_STR, (int32_t)SRC_PORT_INT, (const char*)SRC_PROTO_STR */
+ const char* SRC_HOST_STR = va_arg(*app, const char*);
+ int32_t SRC_PORT_INT = va_arg(*app, int32_t);
+ const char* SRC_PROTO_STR = va_arg(*app, const char*);
+ tsk_strupdate(&self->ws.src.host, SRC_HOST_STR);
+ tsk_itoa(SRC_PORT_INT, &self->ws.src.port);
+ tsk_strupdate(&self->ws.src.proto, SRC_PROTO_STR);
+ break;
+ }
+ case sstype_media: {
+ //=========
+ // Media
+ //=========
+ if (!mgr) {
+ mgr = tsip_session_get_mediamgr(self);
+ }
+ while((mscurr = va_arg(*app, tsip_msession_param_type_t)) != mstype_null) {
+ switch(mscurr) {
+ case mstype_set_profile:
+ // (tmedia_profile_t)PROFILE_ENUM
+ self->media.profile = va_arg(*app, tmedia_profile_t);
+ break;
+ case mstype_set_srtp_mode:
+ // (tmedia_srtp_mode_t)SRTP_MODE_ENUM
+ self->media.srtp_mode = va_arg(*app, tmedia_srtp_mode_t);
+ break;
+ case mstype_set_avpf_mode:
+ // (tmedia_mode_t)MEDIA_MODE_ENUM
+ self->media.avpf_mode = va_arg(*app, tmedia_mode_t);
+ break;
+ case mstype_set_100rel:
+ self->media.enable_100rel = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_ice:
+ self->media.enable_ice = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_ice_stun:
+ self->media.enable_icestun = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_ice_turn:
+ self->media.enable_iceturn = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_rtcp:
+ self->media.enable_rtcp = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_rtcpmux:
+ self->media.enable_rtcpmux = va_arg(*app, tsk_bool_t);
+ break;
+ case mstype_set_qos: {
+ /* (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM */
+ self->media.qos.type = va_arg(*app, tmedia_qos_stype_t);
+ self->media.qos.strength = va_arg(*app, tmedia_qos_strength_t);
+ break;
+ }
+ case mstype_unset_qos: {
+ /* */
+ self->media.qos.type = tmedia_qos_stype_none;
+ self->media.qos.strength = tmedia_qos_strength_none;
+ break;
+ }
+ case mstype_set_timers: {
+ /* (unsigned)TIMEOUT_UINT, (const char*)REFRESHER_STR */
+ /* set values */
+ self->media.timers.timeout = va_arg(*app, unsigned);
+ tsk_strupdate(&self->media.timers.refresher, va_arg(*app, const char*));
+ break;
+ }
+ case mstype_unset_timers: {
+ /* */
+ /* unset values */
+ self->media.timers.timeout = 0;
+ TSK_FREE(self->media.timers.refresher);
+ break;
+ }
+ case mstype_set_codecs: {
+ /* (signed)CODECS_INT */
+ self->media.codecs = va_arg(*app, signed);
+ if(mgr) { // apply now
+ tmedia_session_mgr_set_codecs_supported(mgr, self->media.codecs);
+ }
+ break;
+ }
+ case mstype_set_bypass_encoding: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->media.bypass_encoding = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case mstype_set_bypass_decoding: {
+ /* (tsk_bool_t)ENABLED_BOOL */
+ self->media.bypass_decoding = va_arg(*app, tsk_bool_t);
+ break;
+ }
+ case mstype_set_rtp_ssrc: {
+ /* (tmedia_type_t)MEDIA_ENUM, (uint32_t)SSRC_UINT */
+ tmedia_type_t MEDIA_ENUM = va_arg(*app, tmedia_type_t);
+ uint32_t SSRC_UINT = va_arg(*app, uint32_t);
+ switch(MEDIA_ENUM) {
+ case tmedia_audio:
+ self->media.rtp.ssrc.audio = SSRC_UINT;
+ break;
+ case tmedia_video:
+ self->media.rtp.ssrc.video = SSRC_UINT;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case mstype_set_msrp_cb: {
+ /* (tmedia_session_msrp_cb_f)TMEDIA_SESSION_MSRP_CB_F */
+ self->media.msrp.callback = va_arg(*app, tmedia_session_msrp_cb_f);
+ break;
+ }
+ case mstype_set_stun_server: {
+ /* (const char*)HOSTNAME, (uint16_t)PORT */
+ const char* HOSTNAME = va_arg(*app, const char*);
+ uint16_t PORT = tsk_va_arg_u16(*app);
+ tsk_strupdate(&self->media.stun.hostname, HOSTNAME);
+ self->media.stun.port = PORT;
+ break;
+ }
+ case mstype_set_stun_cred: {
+ /* (const char*)USERNAME, (const char*)PASSWORD */
+ const char* USERNAME = va_arg(*app, const char*);
+ const char* PASSWORD = va_arg(*app, const char*);
+ tsk_strupdate(&self->media.stun.username, USERNAME);
+ tsk_strupdate(&self->media.stun.password, PASSWORD);
+ break;
+ }
+ case mstype_set_video_fps: {
+ /* (signed)FPS_INT */
+ self->media.video_fps = va_arg(*app, signed);
+ break;
+ }
+ case mstype_set_video_bw_up: {
+ /* (signed)BW_INT */
+ self->media.video_bw_up = va_arg(*app, signed);
+ break;
+ }
+ case mstype_set_video_bw_down: {
+ /* (signed)BW_INT */
+ self->media.video_bw_down = va_arg(*app, signed);
+ break;
+ }
+ case mstype_set_video_prefsize: {
+ /* (tmedia_pref_video_size_t)PREFSIZE_ENUM */
+ self->media.video_pref_size = va_arg(*app, tmedia_pref_video_size_t);
+ break;
+ }
+ default: {
+ /* va_list will be unsafe => exit */
+ TSK_DEBUG_ERROR("%d NOT a valid MEDIA pname", mscurr);
+ goto bail;
+ }
+ } /* switch */
+ } /* while */
+
+ break;
+ } /* case */
+
+ default: {
+ /* va_list will be unsafe => exit */
+ TSK_DEBUG_ERROR("%d NOT a valid SIP pname", sscurr);
+ goto bail;
+ }
+
+ } /* switch */
+ } /* while */
bail:
- TSK_OBJECT_SAFE_FREE(mgr);
+ TSK_OBJECT_SAFE_FREE(mgr);
- return ret;
+ return ret;
}
tsip_ssession_handle_t* tsip_ssession_create(tsip_stack_handle_t *stack, ...)
{
- tsip_ssession_t* ss = tsk_null;
- va_list ap;
- tsip_stack_t* _stack = stack;
-
- if(!_stack){
- TSK_DEBUG_ERROR("Invalid Parameter.");
- goto bail;
- }
-
- if(!(ss = tsk_object_new(tsip_ssession_def_t, stack))){
- TSK_DEBUG_ERROR("Failed to create new SIP Session.");
- return tsk_null;
- }
-
- va_start(ap, stack);
- if(__tsip_ssession_set(ss, &ap)){
- TSK_DEBUG_ERROR("Failed to set user's parameters.");
- TSK_OBJECT_SAFE_FREE(ss);
- va_end(ap);
- goto bail;
- }
- va_end(ap);
-
- /* from */
- if(!ss->from && _stack->identity.impu){
- ss->from = tsip_uri_clone(_stack->identity.impu, tsk_false, tsk_false);
- }
- /* to */
- /* To value will be set by the dialog (whether to use as Request-URI). */
+ tsip_ssession_t* ss = tsk_null;
+ va_list ap;
+ tsip_stack_t* _stack = stack;
+
+ if(!_stack) {
+ TSK_DEBUG_ERROR("Invalid Parameter.");
+ goto bail;
+ }
+
+ if(!(ss = tsk_object_new(tsip_ssession_def_t, stack))) {
+ TSK_DEBUG_ERROR("Failed to create new SIP Session.");
+ return tsk_null;
+ }
+
+ va_start(ap, stack);
+ if(__tsip_ssession_set(ss, &ap)) {
+ TSK_DEBUG_ERROR("Failed to set user's parameters.");
+ TSK_OBJECT_SAFE_FREE(ss);
+ va_end(ap);
+ goto bail;
+ }
+ va_end(ap);
+
+ /* from */
+ if(!ss->from && _stack->identity.impu) {
+ ss->from = tsip_uri_clone(_stack->identity.impu, tsk_false, tsk_false);
+ }
+ /* to */
+ /* To value will be set by the dialog (whether to use as Request-URI). */
bail:
- return ss;
+ return ss;
}
int tsip_ssession_set(tsip_ssession_handle_t *self, ...)
{
- if(self){
- int ret;
- va_list ap;
-
- tsip_ssession_t *ss = self;
-
- if(ss->id == TSIP_SSESSION_INVALID_ID){
- return -2;
- }
-
- va_start(ap, self);
- ret = __tsip_ssession_set(ss, &ap);
- va_end(ap);
- return ret;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ int ret;
+ va_list ap;
+
+ tsip_ssession_t *ss = self;
+
+ if(ss->id == TSIP_SSESSION_INVALID_ID) {
+ return -2;
+ }
+
+ va_start(ap, self);
+ ret = __tsip_ssession_set(ss, &ap);
+ va_end(ap);
+ return ret;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
tsip_ssession_id_t tsip_ssession_get_id(const tsip_ssession_handle_t *self)
{
- if(self){
- const tsip_ssession_t *ss = self;
- return ss->id;
- }
- return TSIP_SSESSION_INVALID_ID;
+ if(self) {
+ const tsip_ssession_t *ss = self;
+ return ss->id;
+ }
+ return TSIP_SSESSION_INVALID_ID;
}
tsip_ssession_id_t tsip_ssession_get_id_parent(const tsip_ssession_handle_t *self)
{
- if(self){
- const tsip_ssession_t *ss = self;
- return ss->id_parent;
- }
- return TSIP_SSESSION_INVALID_ID;
+ if(self) {
+ const tsip_ssession_t *ss = self;
+ return ss->id_parent;
+ }
+ return TSIP_SSESSION_INVALID_ID;
}
int tsip_ssession_take_ownership(tsip_ssession_handle_t *self)
{
- if(self){
- tsip_ssession_t *ss = self;
- if(!ss->owner){
- ss->owner = tsk_true;
- /* before: only the dialog had a reference to the SIP session */
- ss = tsk_object_ref(ss);
- /* after: both the end-user and the dialog have their references */
- return 0;
- }
- return -2;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(self) {
+ tsip_ssession_t *ss = self;
+ if(!ss->owner) {
+ ss->owner = tsk_true;
+ /* before: only the dialog had a reference to the SIP session */
+ ss = tsk_object_ref(ss);
+ /* after: both the end-user and the dialog have their references */
+ return 0;
+ }
+ return -2;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
tsk_bool_t tsip_ssession_have_ownership(const tsip_ssession_handle_t *self)
{
- if(self){
- const tsip_ssession_t *ss = self;
- return ss->owner;
- }
- return tsk_false;
+ if(self) {
+ const tsip_ssession_t *ss = self;
+ return ss->owner;
+ }
+ return tsk_false;
}
int tsip_ssession_respond(const tsip_ssession_handle_t *self, short status, const char* phrase, const void* payload, tsk_size_t size, const struct tsip_message_s* request, ...)
{
- tsip_response_t *response = tsk_null;
- tsip_dialog_t* dialog = tsk_null;
- const tsip_ssession_t *ss = self;
- int ret = -1;
-
- if(!ss || !request){
- goto bail;
- }
-
- if(!(dialog = tsip_dialog_layer_find_by_ss(ss->stack->layer_dialog, ss))){
- goto bail;
- }
-
- if(!(response = tsip_dialog_response_new(TSIP_DIALOG(self), status, phrase, request))){
- goto bail;
- }
-
- if(payload && size){
- if((ret = tsip_message_add_content(response, tsk_null, payload, size))){
- goto bail;
- }
- }
- ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
+ tsip_response_t *response = tsk_null;
+ tsip_dialog_t* dialog = tsk_null;
+ const tsip_ssession_t *ss = self;
+ int ret = -1;
+
+ if(!ss || !request) {
+ goto bail;
+ }
+
+ if(!(dialog = tsip_dialog_layer_find_by_ss(ss->stack->layer_dialog, ss))) {
+ goto bail;
+ }
+
+ if(!(response = tsip_dialog_response_new(TSIP_DIALOG(self), status, phrase, request))) {
+ goto bail;
+ }
+
+ if(payload && size) {
+ if((ret = tsip_message_add_content(response, tsk_null, payload, size))) {
+ goto bail;
+ }
+ }
+ ret = tsip_dialog_response_send(TSIP_DIALOG(self), response);
bail:
- TSK_OBJECT_SAFE_FREE(response);
- TSK_OBJECT_SAFE_FREE(dialog);
+ TSK_OBJECT_SAFE_FREE(response);
+ TSK_OBJECT_SAFE_FREE(dialog);
- return ret;
+ return ret;
}
const void* tsip_ssession_get_userdata(const tsip_ssession_handle_t *self)
{
- const tsip_ssession_t* ss = (const tsip_ssession_t*)self;
- if(ss){
- return ss->userdata;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ const tsip_ssession_t* ss = (const tsip_ssession_t*)self;
+ if(ss) {
+ return ss->userdata;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
}
tmedia_type_t tsip_ssession_get_mediatype(const tsip_ssession_handle_t *self)
{
- if(self){
- return ((const tsip_ssession_t*)self)->media.type;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tmedia_none;
- }
+ if(self) {
+ return ((const tsip_ssession_t*)self)->media.type;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tmedia_none;
+ }
}
#include "tinysip/dialogs/tsip_dialog_invite.h"
tmedia_session_mgr_t* tsip_session_get_mediamgr(const tsip_ssession_handle_t *self)
{
- tmedia_session_mgr_t* mgr = tsk_null;
+ tmedia_session_mgr_t* mgr = tsk_null;
- if(self){
- const tsip_ssession_t *ss = self;
- tsip_dialog_t* dialog;
+ if(self) {
+ const tsip_ssession_t *ss = self;
+ tsip_dialog_t* dialog;
- if((dialog = tsip_dialog_layer_find_by_ss(ss->stack->layer_dialog, self))){
- if(dialog->type == tsip_dialog_INVITE){
+ if((dialog = tsip_dialog_layer_find_by_ss(ss->stack->layer_dialog, self))) {
+ if(dialog->type == tsip_dialog_INVITE) {
mgr = tsk_object_ref(TSIP_DIALOG_INVITE(dialog)->msession_mgr);
}
- tsk_object_unref(dialog);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
-
- return mgr;
+ tsk_object_unref(dialog);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+
+ return mgr;
}
const tsip_stack_handle_t* tsip_ssession_get_stack(const tsip_ssession_handle_t *self)
{
- if(self){
- return ((const tsip_ssession_t*)self)->stack;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(self) {
+ return ((const tsip_ssession_t*)self)->stack;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
}
tmedia_codec_id_t tsip_ssession_get_codecs_neg(tsip_ssession_handle_t *self)
{
- int32_t codecs_neg = (int32_t)tmedia_codec_id_none;
- if(self){
- tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(self);
- if(mgr){
- (tmedia_session_mgr_get(mgr,
- TMEDIA_SESSION_GET_INT32(mgr->type, "codecs-negotiated", &codecs_neg),
- TMEDIA_SESSION_GET_NULL()));
- TSK_OBJECT_SAFE_FREE(mgr);
- }
- }
- return (tmedia_codec_id_t)codecs_neg;
+ int32_t codecs_neg = (int32_t)tmedia_codec_id_none;
+ if(self) {
+ tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(self);
+ if(mgr) {
+ (tmedia_session_mgr_get(mgr,
+ TMEDIA_SESSION_GET_INT32(mgr->type, "codecs-negotiated", &codecs_neg),
+ TMEDIA_SESSION_GET_NULL()));
+ TSK_OBJECT_SAFE_FREE(mgr);
+ }
+ }
+ return (tmedia_codec_id_t)codecs_neg;
}
int tsip_ssession_handle(const tsip_ssession_t *self, const struct tsip_action_s* action)
{
- int ret = -1;
-
- if(self && self->stack && action){
- tsip_dialog_t *dialog;
-
- if((dialog = tsip_dialog_layer_find_by_ss(self->stack->layer_dialog, self))){
- switch(action->type){
- case tsip_atype_hangup:
- { /* hang-up is an special case (==> hangup/cancel/nothing) */
- ret = tsip_dialog_hangup(dialog, action);
- break;
- }
- default:
- { /* All other cases */
- ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
- break;
- }
- }
- /* unref */
- tsk_object_unref(dialog);
- }
- else{
- TSK_DEBUG_ERROR("Failed to find dialog with this opid [%lld]", self->id);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
-
- return ret;
+ int ret = -1;
+
+ if(self && self->stack && action) {
+ tsip_dialog_t *dialog;
+
+ if((dialog = tsip_dialog_layer_find_by_ss(self->stack->layer_dialog, self))) {
+ switch(action->type) {
+ case tsip_atype_hangup: {
+ /* hang-up is an special case (==> hangup/cancel/nothing) */
+ ret = tsip_dialog_hangup(dialog, action);
+ break;
+ }
+ default: {
+ /* All other cases */
+ ret = tsip_dialog_fsm_act(dialog, action->type, tsk_null, action);
+ break;
+ }
+ }
+ /* unref */
+ tsk_object_unref(dialog);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to find dialog with this opid [%lld]", self->id);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+
+ return ret;
}
@@ -666,126 +685,125 @@ int tsip_ssession_handle(const tsip_ssession_t *self, const struct tsip_action_s
//
static tsk_object_t* tsip_ssession_ctor(tsk_object_t * self, va_list * app)
{
- tsip_ssession_t *ss = self;
- static tsip_ssession_id_t unique_id = 0;
- if(ss){
- ss->stack = va_arg(*app, const tsip_stack_t*);
- ss->caps = tsk_list_create();
- ss->headers = tsk_list_create();
-
- /* unique identifier */
- ss->id = ++unique_id;
- // default: you are the owner
- ss->owner = tsk_true;
- // default expires value
- ss->expires = TSIP_SSESSION_EXPIRES_DEFAULT;
- // default parentid: not parent -> no pending transfer
- ss->id_parent = TSIP_SSESSION_INVALID_ID;
- // default SigComp compId (will be updated by session_set())
- if (ss->stack->sigcomp.handle) {
- ss->sigcomp_id = tsk_strdup(tsip_sigcomp_handler_fixme_getcompid(ss->stack->sigcomp.handle));
- }
- // default media values
- ss->media.profile = tmedia_defaults_get_profile();
- ss->media.srtp_mode = tmedia_defaults_get_srtp_mode();
- ss->media.avpf_mode = tmedia_defaults_get_avpf_mode();
- ss->media.enable_100rel = tmedia_defaults_get_100rel_enabled();
- ss->media.enable_ice = tmedia_defaults_get_ice_enabled();
- ss->media.enable_icestun = tmedia_defaults_get_icestun_enabled();
- ss->media.enable_iceturn = tmedia_defaults_get_iceturn_enabled();
- ss->media.enable_rtcp = tmedia_defaults_get_rtcp_enabled();
- ss->media.enable_rtcpmux = tmedia_defaults_get_rtcpmux_enabled();
- ss->media.type = tmedia_none;
- ss->media.qos.type = tmedia_qos_stype_none;
- ss->media.qos.strength = tmedia_qos_strength_none;
- ss->media.timers.refresher = tsk_strdup(tmedia_defaults_get_inv_session_refresher());
- ss->media.timers.timeout = tmedia_defaults_get_inv_session_expires();
- ss->media.codecs = tmedia_codec_id_all;
- ss->media.bypass_encoding = tmedia_defaults_get_bypass_encoding();
- ss->media.bypass_decoding = tmedia_defaults_get_bypass_decoding();
- ss->media.video_fps = tmedia_defaults_get_video_fps();
- ss->media.video_bw_down = tmedia_defaults_get_bandwidth_video_download_max();
- ss->media.video_bw_up = tmedia_defaults_get_bandwidth_video_upload_max();
- ss->media.video_pref_size = tmedia_defaults_get_pref_video_size();
- {
- const char *stun_hostname, *stun_username, *stun_password;
- uint16_t stun_port;
- if(tmedia_defaults_get_stun_server(&stun_hostname, &stun_port) == 0){
- ss->media.stun.hostname = tsk_strdup(stun_hostname);
- ss->media.stun.port = stun_port;
- }
- if(tmedia_defaults_get_stun_cred(&stun_username, &stun_password) == 0){
- ss->media.stun.username = tsk_strdup(stun_username);
- ss->media.stun.password = tsk_strdup(stun_password);
- }
- }
-
- /* add the session to the stack */
- if(ss->stack){
- tsk_list_push_back_data(ss->stack->ssessions, (void**)&ss);
- }
- }
-
- return self;
+ tsip_ssession_t *ss = self;
+ static tsip_ssession_id_t unique_id = 0;
+ if(ss) {
+ ss->stack = va_arg(*app, const tsip_stack_t*);
+ ss->caps = tsk_list_create();
+ ss->headers = tsk_list_create();
+
+ /* unique identifier */
+ ss->id = ++unique_id;
+ // default: you are the owner
+ ss->owner = tsk_true;
+ // default expires value
+ ss->expires = TSIP_SSESSION_EXPIRES_DEFAULT;
+ // default parentid: not parent -> no pending transfer
+ ss->id_parent = TSIP_SSESSION_INVALID_ID;
+ // default SigComp compId (will be updated by session_set())
+ if (ss->stack->sigcomp.handle) {
+ ss->sigcomp_id = tsk_strdup(tsip_sigcomp_handler_fixme_getcompid(ss->stack->sigcomp.handle));
+ }
+ // default media values
+ ss->media.profile = tmedia_defaults_get_profile();
+ ss->media.srtp_mode = tmedia_defaults_get_srtp_mode();
+ ss->media.avpf_mode = tmedia_defaults_get_avpf_mode();
+ ss->media.enable_100rel = tmedia_defaults_get_100rel_enabled();
+ ss->media.enable_ice = tmedia_defaults_get_ice_enabled();
+ ss->media.enable_icestun = tmedia_defaults_get_icestun_enabled();
+ ss->media.enable_iceturn = tmedia_defaults_get_iceturn_enabled();
+ ss->media.enable_rtcp = tmedia_defaults_get_rtcp_enabled();
+ ss->media.enable_rtcpmux = tmedia_defaults_get_rtcpmux_enabled();
+ ss->media.type = tmedia_none;
+ ss->media.qos.type = tmedia_qos_stype_none;
+ ss->media.qos.strength = tmedia_qos_strength_none;
+ ss->media.timers.refresher = tsk_strdup(tmedia_defaults_get_inv_session_refresher());
+ ss->media.timers.timeout = tmedia_defaults_get_inv_session_expires();
+ ss->media.codecs = tmedia_codec_id_all;
+ ss->media.bypass_encoding = tmedia_defaults_get_bypass_encoding();
+ ss->media.bypass_decoding = tmedia_defaults_get_bypass_decoding();
+ ss->media.video_fps = tmedia_defaults_get_video_fps();
+ ss->media.video_bw_down = tmedia_defaults_get_bandwidth_video_download_max();
+ ss->media.video_bw_up = tmedia_defaults_get_bandwidth_video_upload_max();
+ ss->media.video_pref_size = tmedia_defaults_get_pref_video_size();
+ {
+ const char *stun_hostname, *stun_username, *stun_password;
+ uint16_t stun_port;
+ if(tmedia_defaults_get_stun_server(&stun_hostname, &stun_port) == 0) {
+ ss->media.stun.hostname = tsk_strdup(stun_hostname);
+ ss->media.stun.port = stun_port;
+ }
+ if(tmedia_defaults_get_stun_cred(&stun_username, &stun_password) == 0) {
+ ss->media.stun.username = tsk_strdup(stun_username);
+ ss->media.stun.password = tsk_strdup(stun_password);
+ }
+ }
+
+ /* add the session to the stack */
+ if(ss->stack) {
+ tsk_list_push_back_data(ss->stack->ssessions, (void**)&ss);
+ }
+ }
+
+ return self;
}
static tsk_object_t* tsip_ssession_dtor(tsk_object_t * self)
-{
- tsip_ssession_t *ss = self;
- if(ss){
- /* remove from the stack */
- if(ss->stack){
- tsk_list_remove_item_by_data(ss->stack->ssessions, ss);
- }
-
- //=======
- // SIP
- //=======
- TSK_OBJECT_SAFE_FREE(ss->caps);
- TSK_OBJECT_SAFE_FREE(ss->headers);
-
- TSK_OBJECT_SAFE_FREE(ss->from);
- TSK_OBJECT_SAFE_FREE(ss->to);
-
- TSK_FREE(ss->sigcomp_id);
- TSK_FREE(ss->auth_ha1);
- TSK_FREE(ss->auth_impi);
-
- //=======
- // Media
- //=======
- TSK_FREE(ss->media.timers.refresher);
- TSK_FREE(ss->media.stun.username);
- TSK_FREE(ss->media.stun.password);
- TSK_FREE(ss->media.stun.hostname);
-
- //=======
- // WebSocket
- //=======
- TSK_FREE(ss->ws.src.host);
- TSK_FREE(ss->ws.src.proto);
-
- TSK_DEBUG_INFO("*** SIP Session destroyed ***");
- }
- return self;
+{
+ tsip_ssession_t *ss = self;
+ if(ss) {
+ /* remove from the stack */
+ if(ss->stack) {
+ tsk_list_remove_item_by_data(ss->stack->ssessions, ss);
+ }
+
+ //=======
+ // SIP
+ //=======
+ TSK_OBJECT_SAFE_FREE(ss->caps);
+ TSK_OBJECT_SAFE_FREE(ss->headers);
+
+ TSK_OBJECT_SAFE_FREE(ss->from);
+ TSK_OBJECT_SAFE_FREE(ss->to);
+
+ TSK_FREE(ss->sigcomp_id);
+ TSK_FREE(ss->auth_ha1);
+ TSK_FREE(ss->auth_impi);
+
+ //=======
+ // Media
+ //=======
+ TSK_FREE(ss->media.timers.refresher);
+ TSK_FREE(ss->media.stun.username);
+ TSK_FREE(ss->media.stun.password);
+ TSK_FREE(ss->media.stun.hostname);
+
+ //=======
+ // WebSocket
+ //=======
+ TSK_FREE(ss->ws.src.host);
+ TSK_FREE(ss->ws.src.proto);
+
+ TSK_DEBUG_INFO("*** SIP Session destroyed ***");
+ }
+ return self;
}
static int tsip_ssession_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- const tsip_ssession_t *ss1 = obj1;
- const tsip_ssession_t *ss2 = obj2;
+ const tsip_ssession_t *ss1 = obj1;
+ const tsip_ssession_t *ss2 = obj2;
- if(ss1 && ss2){
- return (int)(ss1->id-ss2->id);
- }
- return -1;
+ if(ss1 && ss2) {
+ return (int)(ss1->id-ss2->id);
+ }
+ return -1;
}
-static const tsk_object_def_t tsip_ssession_def_s =
-{
- sizeof(tsip_ssession_t),
- tsip_ssession_ctor,
- tsip_ssession_dtor,
- tsip_ssession_cmp,
+static const tsk_object_def_t tsip_ssession_def_s = {
+ sizeof(tsip_ssession_t),
+ tsip_ssession_ctor,
+ tsip_ssession_dtor,
+ tsip_ssession_cmp,
};
const tsk_object_def_t *tsip_ssession_def_t = &tsip_ssession_def_s;
diff --git a/tinySIP/src/tsip_timers.c b/tinySIP/src/tsip_timers.c
index 942b895..fb2c247 100755
--- a/tinySIP/src/tsip_timers.c
+++ b/tinySIP/src/tsip_timers.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -64,7 +64,7 @@
retransmits
Timer K T4 for UDP Section 17.1.2.2 Wait time for
0s for TCP/SCTP response retransmits
-
+
Timer L 64*T1 Section 17.2.1 Wait time for
accepted INVITE
request retransmits
@@ -118,133 +118,165 @@ static uint32_t M = 64*TIMER_T1; // draft-sparks-sip-invfix
-void tsip_timers_setT1(uint32_t t1){
- T1 = t1;
- A = E = G = T1;
- B = F = H = J = (T1*64);
+void tsip_timers_setT1(uint32_t t1)
+{
+ T1 = t1;
+ A = E = G = T1;
+ B = F = H = J = (T1*64);
}
-void tsip_timers_setT2(uint32_t t2){
- T2 = t2;
+void tsip_timers_setT2(uint32_t t2)
+{
+ T2 = t2;
}
-void tsip_timers_setT4(uint32_t t4){
- T4 = t4;
- I = K = T4;
+void tsip_timers_setT4(uint32_t t4)
+{
+ T4 = t4;
+ I = K = T4;
}
-void tsip_timers_setA(uint32_t a){
- A = a;
+void tsip_timers_setA(uint32_t a)
+{
+ A = a;
}
-void tsip_timers_setB(uint32_t b){
- B = b;
+void tsip_timers_setB(uint32_t b)
+{
+ B = b;
}
-void tsip_timers_setC(uint32_t c){
- C = c;
+void tsip_timers_setC(uint32_t c)
+{
+ C = c;
}
-void tsip_timers_setD(uint32_t d){
- D = d;
+void tsip_timers_setD(uint32_t d)
+{
+ D = d;
}
-void tsip_timers_setE(uint32_t e){
- E = e;
+void tsip_timers_setE(uint32_t e)
+{
+ E = e;
}
-void tsip_timers_setF(uint32_t f){
- F = f;
+void tsip_timers_setF(uint32_t f)
+{
+ F = f;
}
-void tsip_timers_setG(uint32_t g){
- G = g;
+void tsip_timers_setG(uint32_t g)
+{
+ G = g;
}
-void tsip_timers_setH(uint32_t h){
- H = h;
+void tsip_timers_setH(uint32_t h)
+{
+ H = h;
}
-void tsip_timers_setI(uint32_t i){
- I = i;
+void tsip_timers_setI(uint32_t i)
+{
+ I = i;
}
-void tsip_timers_setJ(uint32_t j){
- J = j;
+void tsip_timers_setJ(uint32_t j)
+{
+ J = j;
}
-void tsip_timers_setK(uint32_t k){
- K = k;
+void tsip_timers_setK(uint32_t k)
+{
+ K = k;
}
-void tsip_timers_setL(uint32_t l){
- L = l;
+void tsip_timers_setL(uint32_t l)
+{
+ L = l;
}
-void tsip_timers_setM(uint32_t m){
- M = m;
+void tsip_timers_setM(uint32_t m)
+{
+ M = m;
}
-uint32_t tsip_timers_getT1(){
- return T1;
+uint32_t tsip_timers_getT1()
+{
+ return T1;
}
-uint32_t tsip_timers_getT2(){
- return T2;
+uint32_t tsip_timers_getT2()
+{
+ return T2;
}
-uint32_t tsip_timers_getT4(){
- return T4;
+uint32_t tsip_timers_getT4()
+{
+ return T4;
}
-uint32_t tsip_timers_getA(){
- return A;
+uint32_t tsip_timers_getA()
+{
+ return A;
}
-uint32_t tsip_timers_getB(){
- return B;
+uint32_t tsip_timers_getB()
+{
+ return B;
}
-uint32_t tsip_timers_getC(){
- return C;
+uint32_t tsip_timers_getC()
+{
+ return C;
}
-uint32_t tsip_timers_getD(){
- return D;
+uint32_t tsip_timers_getD()
+{
+ return D;
}
-uint32_t tsip_timers_getE(){
- return E;
+uint32_t tsip_timers_getE()
+{
+ return E;
}
-uint32_t tsip_timers_getF(){
- return F;
+uint32_t tsip_timers_getF()
+{
+ return F;
}
-uint32_t tsip_timers_getG(){
- return G;
+uint32_t tsip_timers_getG()
+{
+ return G;
}
-uint32_t tsip_timers_getH(){
- return H;
+uint32_t tsip_timers_getH()
+{
+ return H;
}
-uint32_t tsip_timers_getI(){
- return I;
+uint32_t tsip_timers_getI()
+{
+ return I;
}
-uint32_t tsip_timers_getJ(){
- return J;
+uint32_t tsip_timers_getJ()
+{
+ return J;
}
-uint32_t tsip_timers_getK(){
- return K;
+uint32_t tsip_timers_getK()
+{
+ return K;
}
-uint32_t tsip_timers_getL(){
- return L;
+uint32_t tsip_timers_getL()
+{
+ return L;
}
-uint32_t tsip_timers_getM(){
- return M;
+uint32_t tsip_timers_getM()
+{
+ return M;
}
diff --git a/tinySIP/src/tsip_uri.c b/tinySIP/src/tsip_uri.c
index 90d9859..2fd3a0b 100755
--- a/tinySIP/src/tsip_uri.c
+++ b/tinySIP/src/tsip_uri.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -51,44 +51,44 @@
*/
tsip_uri_t* tsip_uri_create(tsip_uri_type_t type)
{
- return tsk_object_new(tsip_uri_def_t, type);
+ return tsk_object_new(tsip_uri_def_t, type);
}
/* internal function used to serialize a SIP/SIPS/TEL URI */
int __tsip_uri_serialize(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_buffer_t *output)
{
- tsk_istr_t port;
-
- if(uri->port){
- tsk_itoa(uri->port, &port);
- }
-
- /* sip:alice:secretword@atlanta.com:65535 */
- tsk_buffer_append_2(output, "%s:%s%s%s%s%s%s%s%s%s",
-
- uri->scheme ? uri->scheme : "sip", /* default scheme is sip: */
-
- uri->user_name ? uri->user_name : "",
-
- uri->password ? ":" : "",
- uri->password ? uri->password : "",
-
- uri->host ? (uri->user_name ? "@" : "") : "",
- uri->host_type == host_ipv6 ? "[" : "",
- uri->host ? uri->host : "",
- uri->host_type == host_ipv6 ? "]" : "",
-
- uri->port ? ":" : "",
- uri->port ? port : ""
- );
-
- /* Params */
- if(with_params && !TSK_LIST_IS_EMPTY(uri->params)){
- tsk_buffer_append(output, ";", 1);
- tsk_params_tostring(uri->params, ';', output);
- }
-
- return 0;
+ tsk_istr_t port;
+
+ if(uri->port) {
+ tsk_itoa(uri->port, &port);
+ }
+
+ /* sip:alice:secretword@atlanta.com:65535 */
+ tsk_buffer_append_2(output, "%s:%s%s%s%s%s%s%s%s%s",
+
+ uri->scheme ? uri->scheme : "sip", /* default scheme is sip: */
+
+ uri->user_name ? uri->user_name : "",
+
+ uri->password ? ":" : "",
+ uri->password ? uri->password : "",
+
+ uri->host ? (uri->user_name ? "@" : "") : "",
+ uri->host_type == host_ipv6 ? "[" : "",
+ uri->host ? uri->host : "",
+ uri->host_type == host_ipv6 ? "]" : "",
+
+ uri->port ? ":" : "",
+ uri->port ? port : ""
+ );
+
+ /* Params */
+ if(with_params && !TSK_LIST_IS_EMPTY(uri->params)) {
+ tsk_buffer_append(output, ";", 1);
+ tsk_params_tostring(uri->params, ';', output);
+ }
+
+ return 0;
}
/**@ingroup tsip_uri_group
@@ -101,26 +101,26 @@ int __tsip_uri_serialize(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_buff
*/
int tsip_uri_serialize(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bool_t quote, tsk_buffer_t *output)
{
- if(uri && output){
- int ret = 0;
- if(quote){
- if(uri->display_name){
- tsk_buffer_append_2(output, "\"%s\"", uri->display_name);
- }
-
- tsk_buffer_append(output, "<", 1);
- ret = __tsip_uri_serialize(uri, with_params, output);
- tsk_buffer_append(output, ">", 1);
- }
- else{
- ret = __tsip_uri_serialize(uri, with_params, output);
- }
- return ret;
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
+ if(uri && output) {
+ int ret = 0;
+ if(quote) {
+ if(uri->display_name) {
+ tsk_buffer_append_2(output, "\"%s\"", uri->display_name);
+ }
+
+ tsk_buffer_append(output, "<", 1);
+ ret = __tsip_uri_serialize(uri, with_params, output);
+ tsk_buffer_append(output, ">", 1);
+ }
+ else {
+ ret = __tsip_uri_serialize(uri, with_params, output);
+ }
+ return ret;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
}
/**@ingroup tsip_uri_group
@@ -132,18 +132,18 @@ int tsip_uri_serialize(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bool_t
*/
char* tsip_uri_tostring(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bool_t quote)
{
- tsk_buffer_t *output = tsk_buffer_create_null();
- char* ret = 0;
-
- if(!tsip_uri_serialize(uri, with_params, quote, output)){
- ret = tsk_strndup((const char*)output->data, output->size);
- }
- else{
- TSK_DEBUG_ERROR("Failed to serialize URI.");
- }
-
- TSK_OBJECT_SAFE_FREE(output);
- return ret;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ char* ret = 0;
+
+ if(!tsip_uri_serialize(uri, with_params, quote, output)) {
+ ret = tsk_strndup((const char*)output->data, output->size);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to serialize URI.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(output);
+ return ret;
}
/**@ingroup tsip_uri_group
@@ -155,14 +155,14 @@ char* tsip_uri_tostring(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bool_
*/
tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bool_t quote)
{
- tsip_uri_t *newuri = tsk_null;
- tsk_buffer_t *output = tsk_buffer_create_null();
- if((tsip_uri_serialize(uri, with_params, quote, output)) == 0){
- newuri = tsip_uri_parse(output->data, output->size);
- }
- TSK_OBJECT_SAFE_FREE(output);
-
- return newuri;
+ tsip_uri_t *newuri = tsk_null;
+ tsk_buffer_t *output = tsk_buffer_create_null();
+ if((tsip_uri_serialize(uri, with_params, quote, output)) == 0) {
+ newuri = tsip_uri_parse(output->data, output->size);
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+
+ return newuri;
}
@@ -178,64 +178,63 @@ tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, tsk_bool_t with_params, tsk_bo
static tsk_object_t* tsip_uri_ctor(tsk_object_t *self, va_list * app)
{
- tsip_uri_t *uri = self;
- if(uri)
- {
- uri->type = va_arg(*app, tsip_uri_type_t);
- uri->params = tsk_list_create(); /* Empty list. */
- }
- else
- {
- TSK_DEBUG_ERROR("Failed to create new SIP/SIPS/TEL.");
- }
- return self;
+ tsip_uri_t *uri = self;
+ if(uri) {
+ uri->type = va_arg(*app, tsip_uri_type_t);
+ uri->params = tsk_list_create(); /* Empty list. */
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new SIP/SIPS/TEL.");
+ }
+ return self;
}
static tsk_object_t* tsip_uri_dtor(tsk_object_t *self)
{
- tsip_uri_t *uri = self;
- if(uri)
- {
- TSK_FREE(uri->scheme);
- TSK_FREE(uri->host);
- TSK_FREE(uri->user_name);
- TSK_FREE(uri->password);
- TSK_FREE(uri->display_name);
- TSK_OBJECT_SAFE_FREE(uri->params);
- }
- else TSK_DEBUG_ERROR("Null SIP/SIPS/TEL URI.");
-
- return self;
+ tsip_uri_t *uri = self;
+ if(uri) {
+ TSK_FREE(uri->scheme);
+ TSK_FREE(uri->host);
+ TSK_FREE(uri->user_name);
+ TSK_FREE(uri->password);
+ TSK_FREE(uri->display_name);
+ TSK_OBJECT_SAFE_FREE(uri->params);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null SIP/SIPS/TEL URI.");
+ }
+
+ return self;
}
int tsip_uri_strcmp(const char* s1, const char* s2, tsk_bool_t case_sensitive)
{
- if(s1 && s2){
- tsk_bool_t s1_is_encoded = tsk_false;
- tsk_bool_t s2_is_encoded = tsk_false;
- char* s1_decoded = (char*)s1;
- char* s2_decoded = (char*)s2;
- int ret;
-
- if(tsk_strcontains(s1, tsk_strlen(s1), "%")){
- s1_is_encoded = 1;
- s1_decoded = tsk_url_decode(s1);
- }
- if(tsk_strcontains(s2, tsk_strlen(s2), "%")){
- s2_is_encoded = 1;
- s2_decoded = tsk_url_decode(s2);
- }
-
- ret = case_sensitive ? tsk_strcmp(s1_decoded, s2_decoded) : tsk_stricmp(s1_decoded, s2_decoded);
- if(s1_is_encoded){
- TSK_FREE(s1_decoded);
- }
- if(s2_is_encoded){
- TSK_FREE(s2_decoded);
- }
- return ret;
- }
- return case_sensitive ? tsk_strcmp(s1, s2) : tsk_stricmp(s1, s2);
+ if(s1 && s2) {
+ tsk_bool_t s1_is_encoded = tsk_false;
+ tsk_bool_t s2_is_encoded = tsk_false;
+ char* s1_decoded = (char*)s1;
+ char* s2_decoded = (char*)s2;
+ int ret;
+
+ if(tsk_strcontains(s1, tsk_strlen(s1), "%")) {
+ s1_is_encoded = 1;
+ s1_decoded = tsk_url_decode(s1);
+ }
+ if(tsk_strcontains(s2, tsk_strlen(s2), "%")) {
+ s2_is_encoded = 1;
+ s2_decoded = tsk_url_decode(s2);
+ }
+
+ ret = case_sensitive ? tsk_strcmp(s1_decoded, s2_decoded) : tsk_stricmp(s1_decoded, s2_decoded);
+ if(s1_is_encoded) {
+ TSK_FREE(s1_decoded);
+ }
+ if(s2_is_encoded) {
+ TSK_FREE(s2_decoded);
+ }
+ return ret;
+ }
+ return case_sensitive ? tsk_strcmp(s1, s2) : tsk_stricmp(s1, s2);
}
#define tsip_uri_strequals(s1, s2) !tsip_uri_strcmp(s1, s2, tsk_true)
#define tsip_uri_striequals(s1, s2) !tsip_uri_strcmp(s1, s2, tsk_false)
@@ -243,103 +242,100 @@ int tsip_uri_strcmp(const char* s1, const char* s2, tsk_bool_t case_sensitive)
// FIXME: tel uris are compared as per RFC 3966 section 4
static int tsip_uri_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
{
- if(obj1 && obj2){
- const tsip_uri_t* uri1 = obj1;
- const tsip_uri_t* uri2 = obj2;
- const tsk_param_t* param1;
- const tsk_param_t* param2;
- const tsk_list_item_t *item;
-
- /* RFC 3261 - 19.1.4 URI Comparison
-
- Comparison of the userinfo of SIP and SIPS URIs is case-sensitive. This includes userinfo containing passwords or
- formatted as telephone-subscribers. Comparison of all other components of the URI is case-insensitive unless explicitly
- defined otherwise.
-
- An IP address that is the result of a DNS lookup of a host name does not match that host name.
-
- For two URIs to be equal, the user, password, host, and port components must match.
-
- A URI omitting the user component will not match a URI that includes one. A URI omitting the password component will not
- match a URI that includes one.
-
- userinfo = ( user / telephone-subscriber ) [ ":" password ] "@"
- */
- if(!tsk_strequals(uri1->scheme, uri2->scheme) ||
- !tsip_uri_strequals(uri1->user_name, uri2->user_name) ||
- !tsip_uri_strequals(uri1->host, uri2->host) ||
- !tsk_strequals(uri1->password, uri2->password) ||
- uri1->port != uri2->port){
- return -2;
- }
-
- /* Is there parameters */
- if((!uri1->params && !uri2->params) || (TSK_LIST_IS_EMPTY(uri1->params) && TSK_LIST_IS_EMPTY(uri2->params))){
- return 0;
- }
-
- /* RFC 3261 - 19.1.4 URI Comparison
-
- A URI omitting any component with a default value will not match a URI explicitly containing that component with its
- default value. For instance, a URI omitting the optional port component will not match a URI explicitly declaring port 5060.
- The same is true for the transport-parameter, ttl-parameter, user-parameter, and method components.
-
- - A user, ttl, or method uri-parameter appearing in only one URI never matches, even if it contains the default value.
- - A URI that includes an maddr parameter will not match a URI that contains no maddr parameter.
- */
+ if(obj1 && obj2) {
+ const tsip_uri_t* uri1 = obj1;
+ const tsip_uri_t* uri2 = obj2;
+ const tsk_param_t* param1;
+ const tsk_param_t* param2;
+ const tsk_list_item_t *item;
+
+ /* RFC 3261 - 19.1.4 URI Comparison
+
+ Comparison of the userinfo of SIP and SIPS URIs is case-sensitive. This includes userinfo containing passwords or
+ formatted as telephone-subscribers. Comparison of all other components of the URI is case-insensitive unless explicitly
+ defined otherwise.
+
+ An IP address that is the result of a DNS lookup of a host name does not match that host name.
+
+ For two URIs to be equal, the user, password, host, and port components must match.
+
+ A URI omitting the user component will not match a URI that includes one. A URI omitting the password component will not
+ match a URI that includes one.
+
+ userinfo = ( user / telephone-subscriber ) [ ":" password ] "@"
+ */
+ if(!tsk_strequals(uri1->scheme, uri2->scheme) ||
+ !tsip_uri_strequals(uri1->user_name, uri2->user_name) ||
+ !tsip_uri_strequals(uri1->host, uri2->host) ||
+ !tsk_strequals(uri1->password, uri2->password) ||
+ uri1->port != uri2->port) {
+ return -2;
+ }
+
+ /* Is there parameters */
+ if((!uri1->params && !uri2->params) || (TSK_LIST_IS_EMPTY(uri1->params) && TSK_LIST_IS_EMPTY(uri2->params))) {
+ return 0;
+ }
+
+ /* RFC 3261 - 19.1.4 URI Comparison
+
+ A URI omitting any component with a default value will not match a URI explicitly containing that component with its
+ default value. For instance, a URI omitting the optional port component will not match a URI explicitly declaring port 5060.
+ The same is true for the transport-parameter, ttl-parameter, user-parameter, and method components.
+
+ - A user, ttl, or method uri-parameter appearing in only one URI never matches, even if it contains the default value.
+ - A URI that includes an maddr parameter will not match a URI that contains no maddr parameter.
+ */
#define TSIP_URI_CMP_PARAMETER(pname) \
param1 = tsk_params_get_param_by_name(uri1->params, pname);\
param2 = tsk_params_get_param_by_name(uri2->params, pname);\
if((param1 || param2) && ((param1 && !param2) || (!param1 && param2) || (!tsip_uri_striequals(param1->value, param2->value)))){\
return -3;\
}
- TSIP_URI_CMP_PARAMETER("transport");
- TSIP_URI_CMP_PARAMETER("ttl");
- TSIP_URI_CMP_PARAMETER("user");
- TSIP_URI_CMP_PARAMETER("method");
- TSIP_URI_CMP_PARAMETER("maddr");
-
- /* RFC 3261 - 19.1.4 URI Comparison
-
- URI uri-parameter components are compared as follows:
-
- 1 - Any uri-parameter appearing in both URIs must match.
- 2 - All other uri-parameters appearing in only one URI are ignored when comparing the URIs.
-
- o URI header components are never ignored. Any present header component MUST be present in both URIs and match for the URIs
- to match. The matching rules are defined for each header field in Section 20.
- */
- tsk_list_foreach(item, uri1->params)
- {
- param1 = item->data;
- if((param2 = tsk_params_get_param_by_name(uri2->params, param1->name))){
- if(!tsip_uri_striequals(param1->value, param2->value)){
- return -4;
- }
- }
- }
- tsk_list_foreach(item, uri2->params)
- {
- param2 = item->data;
- if((param1 = tsk_params_get_param_by_name(uri1->params, param2->name))){
- if(!tsk_striequals(param1->value, param2->value)){
- return -4;
- }
- }
- }
-
- return 0;
- }
- else{
- return (!obj1 && !obj2) ? 0 : -1;
- }
+ TSIP_URI_CMP_PARAMETER("transport");
+ TSIP_URI_CMP_PARAMETER("ttl");
+ TSIP_URI_CMP_PARAMETER("user");
+ TSIP_URI_CMP_PARAMETER("method");
+ TSIP_URI_CMP_PARAMETER("maddr");
+
+ /* RFC 3261 - 19.1.4 URI Comparison
+
+ URI uri-parameter components are compared as follows:
+
+ 1 - Any uri-parameter appearing in both URIs must match.
+ 2 - All other uri-parameters appearing in only one URI are ignored when comparing the URIs.
+
+ o URI header components are never ignored. Any present header component MUST be present in both URIs and match for the URIs
+ to match. The matching rules are defined for each header field in Section 20.
+ */
+ tsk_list_foreach(item, uri1->params) {
+ param1 = item->data;
+ if((param2 = tsk_params_get_param_by_name(uri2->params, param1->name))) {
+ if(!tsip_uri_striequals(param1->value, param2->value)) {
+ return -4;
+ }
+ }
+ }
+ tsk_list_foreach(item, uri2->params) {
+ param2 = item->data;
+ if((param1 = tsk_params_get_param_by_name(uri1->params, param2->name))) {
+ if(!tsk_striequals(param1->value, param2->value)) {
+ return -4;
+ }
+ }
+ }
+
+ return 0;
+ }
+ else {
+ return (!obj1 && !obj2) ? 0 : -1;
+ }
}
-static const tsk_object_def_t tsip_uri_def_s =
-{
- sizeof(tsip_uri_t),
- tsip_uri_ctor,
- tsip_uri_dtor,
- tsip_uri_cmp
+static const tsk_object_def_t tsip_uri_def_s = {
+ sizeof(tsip_uri_t),
+ tsip_uri_ctor,
+ tsip_uri_dtor,
+ tsip_uri_cmp
};
const tsk_object_def_t *tsip_uri_def_t = &tsip_uri_def_s;
diff --git a/tinySIP/test/stdafx.c b/tinySIP/test/stdafx.c
index 2983941..e7b4dd6 100755
--- a/tinySIP/test/stdafx.c
+++ b/tinySIP/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/test/stdafx.h b/tinySIP/test/stdafx.h
index 0632737..be4f8f7 100755
--- a/tinySIP/test/stdafx.h
+++ b/tinySIP/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySIP/test/targetver.h b/tinySIP/test/targetver.h
index 9927d16..92eb509 100755
--- a/tinySIP/test/targetver.h
+++ b/tinySIP/test/targetver.h
@@ -1,8 +1,8 @@
#ifndef TSIP_TEST_TARGETVER_H
#define TSIP_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinySIP/test/test.c b/tinySIP/test/test.c
index 64eef40..7fc3a22 100755
--- a/tinySIP/test/test.c
+++ b/tinySIP/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,40 +46,40 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- tnet_startup();
+ tnet_startup();
#if RUN_TEST_LOOP
- for(;;)
+ for(;;)
#endif
- {
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
+ {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
+
+
-
-
#if RUN_TEST_ALL || RUN_TEST_MESSAGES
- test_messages();
+ test_messages();
#endif
#if RUN_TEST_ALL || RUN_TEST_URI
- test_uri();
+ test_uri();
#endif
#if RUN_TEST_ALL ||RUN_TEST_TRANSAC
- test_transac();
+ test_transac();
#endif
#if RUN_TEST_ALL || RUN_TEST_STACK
- test_stack();
+ test_stack();
#endif
#if RUN_TEST_ALL || RUN_TEST_IMS_AKA
- test_imsaka();
+ test_imsaka();
#endif
- }
+ }
- tnet_cleanup();
+ tnet_cleanup();
- return 0;
+ return 0;
}
diff --git a/tinySIP/test/test_imsaka.h b/tinySIP/test/test_imsaka.h
index 3b5d35d..0ceb53b 100755
--- a/tinySIP/test/test_imsaka.h
+++ b/tinySIP/test/test_imsaka.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,46 +47,46 @@
void test_imsaka()
{
- tsip_challenge_t* challenge;
- tsip_stack_handle_t *stack;
- tsip_request_t *request = tsk_null;
- tsk_ragel_state_t state;
- tsip_header_Authorization_t* hdr_Auth;
+ tsip_challenge_t* challenge;
+ tsip_stack_handle_t *stack;
+ tsip_request_t *request = tsk_null;
+ tsk_ragel_state_t state;
+ tsip_header_Authorization_t* hdr_Auth;
+
+ /* create the SIP stack */
+ stack = tsip_stack_create(tsk_null, "sip:ims.inexbee.com", "bob@ims.inexbee.com", "sip:bob@ims.inexbee.com",
+ TSIP_STACK_SET_PASSWORD("bob"),
+ TSIP_STACK_SET_NULL());
- /* create the SIP stack */
- stack = tsip_stack_create(tsk_null, "sip:ims.inexbee.com", "bob@ims.inexbee.com", "sip:bob@ims.inexbee.com",
- TSIP_STACK_SET_PASSWORD("bob"),
- TSIP_STACK_SET_NULL());
-
- /* create the chalenge */
- challenge = tsip_challenge_create(stack,
- tsk_false,
- "Digest", /* scheme */
- "ims.inexbee.com", /* realm */
- "RqhHfrN+ciXaM4mt8k/0Lyx7bgshVgAA5TcTpiTtqsY=", /* nonce */
- tsk_null, /* opaque */
- "AKAv1-MD5", /* algorithm */
- "auth" /* qop */
- );
+ /* create the chalenge */
+ challenge = tsip_challenge_create(stack,
+ tsk_false,
+ "Digest", /* scheme */
+ "ims.inexbee.com", /* realm */
+ "RqhHfrN+ciXaM4mt8k/0Lyx7bgshVgAA5TcTpiTtqsY=", /* nonce */
+ tsk_null, /* opaque */
+ "AKAv1-MD5", /* algorithm */
+ "auth" /* qop */
+ );
- /* Parse SIP request */
- tsk_ragel_state_init(&state, TEST_IMS_AKA_REQUEST, tsk_strlen(TEST_IMS_AKA_REQUEST));
- if(!tsip_message_parse(&state, &request, tsk_true)){
- goto bail;
- }
+ /* Parse SIP request */
+ tsk_ragel_state_init(&state, TEST_IMS_AKA_REQUEST, tsk_strlen(TEST_IMS_AKA_REQUEST));
+ if(!tsip_message_parse(&state, &request, tsk_true)) {
+ goto bail;
+ }
- /* Gets auth header */
- if((hdr_Auth = (tsip_header_Authorization_t*)tsip_challenge_create_header_authorization(challenge, request))){
- TSK_DEBUG_INFO("Response=[%s]", hdr_Auth->response);
- }
+ /* Gets auth header */
+ if((hdr_Auth = (tsip_header_Authorization_t*)tsip_challenge_create_header_authorization(challenge, request))) {
+ TSK_DEBUG_INFO("Response=[%s]", hdr_Auth->response);
+ }
bail:
- TSK_OBJECT_SAFE_FREE(request);
- TSK_OBJECT_SAFE_FREE(challenge);
- TSK_OBJECT_SAFE_FREE(stack);
+ TSK_OBJECT_SAFE_FREE(request);
+ TSK_OBJECT_SAFE_FREE(challenge);
+ TSK_OBJECT_SAFE_FREE(stack);
- getchar();
+ getchar();
}
#endif /* _TEST_IMS_AKA_H */
diff --git a/tinySIP/test/test_sipmessages.h b/tinySIP/test/test_sipmessages.h
index 47b5608..0ddb5eb 100755
--- a/tinySIP/test/test_sipmessages.h
+++ b/tinySIP/test/test_sipmessages.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -78,8 +78,8 @@
"Subscription-State: active;reason=deactivated;expires=507099;retry-after=145;test=jk\r\n"\
"\r\n"
- //"Via: SIP/2.0/UDP 192.168.0.11:64163;rport=4;branch=z9hG4bK1262758946486\r\n" \
- //"Via: SIP/2.0/UDP 192.168.0.11:59265;rport=59265;branch=z9hG4bK1263064096664\r\n" \
+//"Via: SIP/2.0/UDP 192.168.0.11:64163;rport=4;branch=z9hG4bK1262758946486\r\n" \
+//"Via: SIP/2.0/UDP 192.168.0.11:59265;rport=59265;branch=z9hG4bK1263064096664\r\n" \
#define SIP_MESSAGE \
"MESSAGE sip:mamadou@open-ims.test SIP/2.0\r\n" \
@@ -148,7 +148,7 @@
"Content-Length: 0\r\n" \
"Warning: 392 10.19.3.160:6060 \"Noisy feedback tells: pid=30444 req_src_ip=10.19.3.160 req_src_port=5060 in_uri=sip:scscf.open-ims.test:6060 out_uri=sip:scscf.open-ims.test:6060 via_cnt==3\"\r\n" \
"\r\n" \
-
+
#define SIP_OPTIONS \
"SIP/2.0 200 OK\r\n" \
@@ -186,79 +186,79 @@
void test_parser()
{
- tsk_ragel_state_t state;
- tsip_message_t *message = tsk_null;
- tsk_buffer_t *buffer = tsk_buffer_create_null();
- const tsip_header_Contact_t* header_contact;
- tsk_size_t i;
-
- tsk_ragel_state_init(&state, SIP_MSG_2_TEST, tsk_strlen(SIP_MSG_2_TEST));
- tsip_message_parse(&state, &message, tsk_true);
-
- for(i = 0; (header_contact = (const tsip_header_Contact_t*)tsip_message_get_headerAt(message, tsip_htype_Contact, i)); ++i){
- const char* pub_gruu = TSIP_HEADER_GET_PARAM_VALUE(header_contact, "pub-gruu");
- TSK_DEBUG_INFO("pub-gruu for contact header at index %d = %s", i, (pub_gruu ? pub_gruu : "null"));
- }
-
- tsip_message_tostring(message, buffer);
- TSK_DEBUG_INFO("Buffer=\n%s", TSK_BUFFER_TO_STRING(buffer));
-
- TSK_OBJECT_SAFE_FREE(message);
- TSK_OBJECT_SAFE_FREE(buffer);
+ tsk_ragel_state_t state;
+ tsip_message_t *message = tsk_null;
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
+ const tsip_header_Contact_t* header_contact;
+ tsk_size_t i;
+
+ tsk_ragel_state_init(&state, SIP_MSG_2_TEST, tsk_strlen(SIP_MSG_2_TEST));
+ tsip_message_parse(&state, &message, tsk_true);
+
+ for(i = 0; (header_contact = (const tsip_header_Contact_t*)tsip_message_get_headerAt(message, tsip_htype_Contact, i)); ++i) {
+ const char* pub_gruu = TSIP_HEADER_GET_PARAM_VALUE(header_contact, "pub-gruu");
+ TSK_DEBUG_INFO("pub-gruu for contact header at index %d = %s", i, (pub_gruu ? pub_gruu : "null"));
+ }
+
+ tsip_message_tostring(message, buffer);
+ TSK_DEBUG_INFO("Buffer=\n%s", TSK_BUFFER_TO_STRING(buffer));
+
+ TSK_OBJECT_SAFE_FREE(message);
+ TSK_OBJECT_SAFE_FREE(buffer);
}
void test_requests()
{
- tsk_buffer_t *buffer = tsk_buffer_create_null();
- tsip_uri_t *from = tsip_uri_parse("sip:mamadou@open-ims.test", tsk_strlen("sip:mamadou@open-ims.test"));
- tsip_uri_t *request_uri = tsip_uri_parse("sip:open-ims.test", tsk_strlen("sip:open-ims.test"));
-
-
- tsip_request_t *request = tsip_request_new("REGISTER", request_uri, from, from, "ABCDEFGHIJKLMOPQRSTUVWXYZ", 4521);
-
- tsip_message_tostring(request, buffer);
- TSK_DEBUG_INFO("Buffer=\n%s", TSK_BUFFER_TO_STRING(buffer));
-
-
- TSK_OBJECT_SAFE_FREE(from);
- TSK_OBJECT_SAFE_FREE(request_uri);
- TSK_OBJECT_SAFE_FREE(request);
- TSK_OBJECT_SAFE_FREE(buffer);
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
+ tsip_uri_t *from = tsip_uri_parse("sip:mamadou@open-ims.test", tsk_strlen("sip:mamadou@open-ims.test"));
+ tsip_uri_t *request_uri = tsip_uri_parse("sip:open-ims.test", tsk_strlen("sip:open-ims.test"));
+
+
+ tsip_request_t *request = tsip_request_new("REGISTER", request_uri, from, from, "ABCDEFGHIJKLMOPQRSTUVWXYZ", 4521);
+
+ tsip_message_tostring(request, buffer);
+ TSK_DEBUG_INFO("Buffer=\n%s", TSK_BUFFER_TO_STRING(buffer));
+
+
+ TSK_OBJECT_SAFE_FREE(from);
+ TSK_OBJECT_SAFE_FREE(request_uri);
+ TSK_OBJECT_SAFE_FREE(request);
+ TSK_OBJECT_SAFE_FREE(buffer);
}
void test_responses()
{
- tsk_ragel_state_t state;
- tsip_request_t *request = 0;
- tsip_request_t *response = 0;
+ tsk_ragel_state_t state;
+ tsip_request_t *request = 0;
+ tsip_request_t *response = 0;
+
+ tsk_ragel_state_init(&state, SIP_MSG_2_TEST, tsk_strlen(SIP_MSG_2_TEST));
+ tsip_message_parse(&state, &request, tsk_true);
- tsk_ragel_state_init(&state, SIP_MSG_2_TEST, tsk_strlen(SIP_MSG_2_TEST));
- tsip_message_parse(&state, &request, tsk_true);
+ /* Create the response and destroy the request */
+ response = tsip_response_new(200, "OK you can move forward", request);
+ TSK_OBJECT_SAFE_FREE(request);
- /* Create the response and destroy the request */
- response = tsip_response_new(200, "OK you can move forward", request);
- TSK_OBJECT_SAFE_FREE(request);
+ {
+ /* DUMP the response */
+ tsk_buffer_t *buffer = tsk_buffer_create_null();
- {
- /* DUMP the response */
- tsk_buffer_t *buffer = tsk_buffer_create_null();
+ tsip_message_tostring(response, buffer);
+ TSK_DEBUG_INFO("Response=\n%s", TSK_BUFFER_TO_STRING(buffer));
- tsip_message_tostring(response, buffer);
- TSK_DEBUG_INFO("Response=\n%s", TSK_BUFFER_TO_STRING(buffer));
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
-
- TSK_OBJECT_SAFE_FREE(response);
+ TSK_OBJECT_SAFE_FREE(response);
}
void test_messages()
{
- test_parser();
- //test_requests();
- //test_responses();
+ test_parser();
+ //test_requests();
+ //test_responses();
}
diff --git a/tinySIP/test/test_stack.h b/tinySIP/test/test_stack.h
index 7cfc04c..0bde757 100755
--- a/tinySIP/test/test_stack.h
+++ b/tinySIP/test/test_stack.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -76,158 +76,142 @@
int test_stack_callback(const tsip_event_t *sipevent)
{
- TSK_DEBUG_INFO("\n====\nSTACK event: %d [%s] with opid=%lld\n=====",
- sipevent->code, sipevent->phrase, tsip_ssession_get_id(sipevent->ss));
-
- // For ssessions created by the stack ==> call tsk_object_ref(sipevent->ssession);
- // to take ownership.
-
- switch(sipevent->type)
- {
- //
- // REGISTER
- //
- case tsip_event_register:
- {
- const tsip_register_event_t* _event;
- TSK_DEBUG_INFO("SIP event(REGISTER)");
-
- _event = TSIP_REGISTER_EVENT(sipevent);
- switch(_event->type){
- case tsip_ao_register: /* Answer to Outgoing REGISTER */
- {
- if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)){
- TSK_DEBUG_INFO("Registration succeed.");
- }
- else{
- TSK_DEBUG_INFO("Registration failed.");
- }
- break;
- }
- case tsip_ao_unregister: /* Answer to Outgoing UNREGISTER */
- {
- if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)){
- TSK_DEBUG_INFO("UnRegistration succeed.");
- }
- else{
- TSK_DEBUG_INFO("UnRegistration failed.");
- }
- break;
- }
- default:
- break;
- }
-
- break;
- }
-
- //
- // INVITE
- //
- case tsip_event_invite:
- {
- TSK_DEBUG_INFO("SIP event(INVITE)");
- break;
- }
-
- //
- // MESSAGE
- //
- case tsip_event_message:
- {
- const tsip_message_event_t* _event;
- TSK_DEBUG_INFO("SIP event(MESSAGE)");
-
- _event = TSIP_MESSAGE_EVENT(sipevent);
- switch(_event->type)
- {
- case tsip_i_message: /* Incoming MESSAGE */
- {
- if(TSIP_MESSAGE_HAS_CONTENT(sipevent->sipmessage)){
- TSK_DEBUG_INFO("MESSAGE Content: %s", TSIP_MESSAGE_CONTENT(sipevent->sipmessage));
- }
- break;
- }
- case tsip_ao_message: /* Answer to Outgoing MESSAGE */
- {
- if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)){
- TSK_DEBUG_INFO("MESSAGE successfully sent.");
- }
- else{
- TSK_DEBUG_INFO("Failed to send MESSAGE (sip code:%d).", TSIP_RESPONSE_CODE(sipevent->sipmessage));
- }
- }
- default:
- break;
- }
-
- break;
- }
-
- //
- // PUBLISH
- //
- case tsip_event_publish:
- {
- TSK_DEBUG_INFO("SIP event(PUBLISH)");
- break;
- }
-
- //
- // SUBSCRIBE
- //
- case tsip_event_subscribe:
- {
- const tsip_subscribe_event_t* _event;
- TSK_DEBUG_INFO("SIP event(SUBSCRIBE)");
-
- _event = TSIP_SUBSCRIBE_EVENT(sipevent);
- switch(_event->type)
- {
- case tsip_i_notify: /* Incoming NOTIFY */
- {
- if(TSIP_MESSAGE_CONTENT_DATA(sipevent->sipmessage)){
- TSK_DEBUG_INFO("NOTIFY Content: %s", TSIP_MESSAGE_CONTENT(sipevent->sipmessage));
- }
- break;
- }
- case tsip_ao_subscribe: /* Answer to Outgoing SUBSCRIBE */
- {
- if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)){
- TSK_DEBUG_INFO("Subscription succeed.");
- }
- else{
- TSK_DEBUG_INFO("Subscription failed.");
- }
- break;
- }
- case tsip_ao_unsubscribe: /* Answer to Outgoing UNSUBSCRIBE */
- {
- if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)){
- TSK_DEBUG_INFO("UnSubscription succeed.");
- }
- else{
- TSK_DEBUG_INFO("UnSubscription failed.");
- }
- break;
- }
- default:
- break;
- }
-
- break;
- }
-
- default:
- {
- TSK_DEBUG_INFO("SIP event(UNKNOWN)");
- break;
- }
- }
-
- //tsk_thread_sleep(1000000);
-
- return 0;
+ TSK_DEBUG_INFO("\n====\nSTACK event: %d [%s] with opid=%lld\n=====",
+ sipevent->code, sipevent->phrase, tsip_ssession_get_id(sipevent->ss));
+
+ // For ssessions created by the stack ==> call tsk_object_ref(sipevent->ssession);
+ // to take ownership.
+
+ switch(sipevent->type) {
+ //
+ // REGISTER
+ //
+ case tsip_event_register: {
+ const tsip_register_event_t* _event;
+ TSK_DEBUG_INFO("SIP event(REGISTER)");
+
+ _event = TSIP_REGISTER_EVENT(sipevent);
+ switch(_event->type) {
+ case tsip_ao_register: { /* Answer to Outgoing REGISTER */
+ if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("Registration succeed.");
+ }
+ else {
+ TSK_DEBUG_INFO("Registration failed.");
+ }
+ break;
+ }
+ case tsip_ao_unregister: { /* Answer to Outgoing UNREGISTER */
+ if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("UnRegistration succeed.");
+ }
+ else {
+ TSK_DEBUG_INFO("UnRegistration failed.");
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ break;
+ }
+
+ //
+ // INVITE
+ //
+ case tsip_event_invite: {
+ TSK_DEBUG_INFO("SIP event(INVITE)");
+ break;
+ }
+
+ //
+ // MESSAGE
+ //
+ case tsip_event_message: {
+ const tsip_message_event_t* _event;
+ TSK_DEBUG_INFO("SIP event(MESSAGE)");
+
+ _event = TSIP_MESSAGE_EVENT(sipevent);
+ switch(_event->type) {
+ case tsip_i_message: { /* Incoming MESSAGE */
+ if(TSIP_MESSAGE_HAS_CONTENT(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("MESSAGE Content: %s", TSIP_MESSAGE_CONTENT(sipevent->sipmessage));
+ }
+ break;
+ }
+ case tsip_ao_message: { /* Answer to Outgoing MESSAGE */
+ if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("MESSAGE successfully sent.");
+ }
+ else {
+ TSK_DEBUG_INFO("Failed to send MESSAGE (sip code:%d).", TSIP_RESPONSE_CODE(sipevent->sipmessage));
+ }
+ }
+ default:
+ break;
+ }
+
+ break;
+ }
+
+ //
+ // PUBLISH
+ //
+ case tsip_event_publish: {
+ TSK_DEBUG_INFO("SIP event(PUBLISH)");
+ break;
+ }
+
+ //
+ // SUBSCRIBE
+ //
+ case tsip_event_subscribe: {
+ const tsip_subscribe_event_t* _event;
+ TSK_DEBUG_INFO("SIP event(SUBSCRIBE)");
+
+ _event = TSIP_SUBSCRIBE_EVENT(sipevent);
+ switch(_event->type) {
+ case tsip_i_notify: { /* Incoming NOTIFY */
+ if(TSIP_MESSAGE_CONTENT_DATA(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("NOTIFY Content: %s", TSIP_MESSAGE_CONTENT(sipevent->sipmessage));
+ }
+ break;
+ }
+ case tsip_ao_subscribe: { /* Answer to Outgoing SUBSCRIBE */
+ if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("Subscription succeed.");
+ }
+ else {
+ TSK_DEBUG_INFO("Subscription failed.");
+ }
+ break;
+ }
+ case tsip_ao_unsubscribe: { /* Answer to Outgoing UNSUBSCRIBE */
+ if(TSIP_RESPONSE_IS_2XX(sipevent->sipmessage)) {
+ TSK_DEBUG_INFO("UnSubscription succeed.");
+ }
+ else {
+ TSK_DEBUG_INFO("UnSubscription failed.");
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ break;
+ }
+
+ default: {
+ TSK_DEBUG_INFO("SIP event(UNKNOWN)");
+ break;
+ }
+ }
+
+ //tsk_thread_sleep(1000000);
+
+ return 0;
}
@@ -238,283 +222,283 @@ void test_stack()
//#define DOMAIN "ims.inexbee.com"
//#define DOMAIN "sip2sip.info"
- const void* usr_context = tsk_null;
- int ret;
- uint16_t AMF = 0x0001;
-/*
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
- TSIP_STACK_SET_DISPLAY_NAME("2233392625"),
- TSIP_STACK_SET_PUBLIC_IDENTITY("sip:2233392625@"DOMAIN),
- TSIP_STACK_SET_PRIVATE_IDENTITY("2233392625"),
- TSIP_STACK_SET_PASSWORD("d3sb7j4fb8"),
- TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
- TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
- //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
- //TSIP_STACK_SET_PROXY_CSCF("proxy.sipthor.net", "udp", 0),
- //TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
- TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
- TSIP_STACK_SET_MOBILITY("fixed"),
- TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
- TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
- TSIP_STACK_SET_PRIVACY("header;id"),
-*/
+ const void* usr_context = tsk_null;
+ int ret;
+ uint16_t AMF = 0x0001;
+ /*
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
+ TSIP_STACK_SET_DISPLAY_NAME("2233392625"),
+ TSIP_STACK_SET_PUBLIC_IDENTITY("sip:2233392625@"DOMAIN),
+ TSIP_STACK_SET_PRIVATE_IDENTITY("2233392625"),
+ TSIP_STACK_SET_PASSWORD("d3sb7j4fb8"),
+ TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
+ TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
+ //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
+ //TSIP_STACK_SET_PROXY_CSCF("proxy.sipthor.net", "udp", 0),
+ //TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
+ TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
+ TSIP_STACK_SET_MOBILITY("fixed"),
+ TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
+ TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
+ TSIP_STACK_SET_PRIVACY("header;id"),
+ */
+
+ /*
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
+ TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
+ TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@"DOMAIN),
+ TSIP_STACK_SET_PRIVATE_IDENTITY("mamadou@"DOMAIN),
+ TSIP_STACK_SET_PASSWORD("mamadou"),
+ TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
+ TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
+ //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
+ TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
+ //TSIP_STACK_SET_PROXY_CSCF_PORT(5081),
+ TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
+ //TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"),
+ TSIP_STACK_SET_MOBILITY("fixed"),
+ TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
+ TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
+ TSIP_STACK_SET_PRIVACY("header;id"),
+ */
+
+
+
+ int32_t port = 4060;
+ /*
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "mamadou@"DOMAIN, "sip:mamadou@"DOMAIN,
+ TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
+ TSIP_STACK_SET_PASSWORD("mamadou"),
+ TSIP_STACK_SET_IMS_AKA_AMF(AMF),
+ TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("0xff08"),
+ TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
+
+ TSIP_STACK_SET_PROXY_CSCF("192.168.16.225", port, "udp", "ipv4"),
+
+ TSIP_STACK_SET_EARLY_IMS(tsk_true),
+ */
+
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "mamadou@"DOMAIN, "sip:mamadou@"DOMAIN,
+ TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
+ TSIP_STACK_SET_PASSWORD("mamadou"),
+ TSIP_STACK_SET_IMS_AKA_AMF(AMF),
+ TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("0xff08"),
+ TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
+
+ TSIP_STACK_SET_PROXY_CSCF("192.168.0.13", 5081, "tcp", "ipv4"),
+ TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
+
+ TSIP_STACK_SET_EARLY_IMS(tsk_true),
+
+
+ /*
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "2233392625", "sip:2233392625@"DOMAIN,
+ TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
+ TSIP_STACK_SET_PASSWORD("d3sb7j4fb8"),
+
+ TSIP_STACK_SET_EARLY_IMS(tsk_true),
+
+ TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
+ */
+ /*
+ tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
+ TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
+ TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@"DOMAIN),
+ TSIP_STACK_SET_PRIVATE_IDENTITY("mamadou@"DOMAIN),
+ TSIP_STACK_SET_PASSWORD("mamadou"),
+ TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
+ TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
+ //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
+ TSIP_STACK_SET_PROXY_CSCF("192.168.16.104", "udp", 0),
+ //TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
+ TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
+ //TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"),
+ TSIP_STACK_SET_MOBILITY("fixed"),
+ TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
+ TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
+ TSIP_STACK_SET_PRIVACY("header;id"),
+ */
+
+ TSIP_STACK_SET_NULL());
+
+
+
+
+ //tsip_ssession_handle_t *op = tsip_ssession_create(stack,
+ // TSIP_SSESSION_SET_CONTEXT(usr_context),
+ // TSIP_SSESSION_SET_HEADER("expires", "30"),
+ // TSIP_SSESSION_SET_HEADER("Persistence", "session"),
+ //
+ // TSIP_SSESSION_SET_CAPS("language", "\"en,fr\""),
+ // TSIP_SSESSION_SET_CAPS("+audio", ""),
+ // TSIP_SSESSION_SET_CAPS("+g.oma.sip-im", ""),
+ //
+ // tsk_null);
+
+
+ tsip_ssession_handle_t *op = tsip_ssession_create(stack,
+ TSIP_SSESSION_SET_EXPIRES(30),
+
+ TSIP_SSESSION_SET_CAPS("+g.oma.sip-im", ""),
+ TSIP_SSESSION_SET_CAPS("+audio", ""),
+ TSIP_SSESSION_SET_CAPS("automata", ""),
+ TSIP_SSESSION_SET_CAPS("language", "\"en,fr\""),
+
+ TSIP_SSESSION_SET_HEADER("Supported", "ssl"),
+ TSIP_SSESSION_SET_HEADER("P-Access-Network-Info", "3GPP-UTRAN-TDD;utran-cell-id-3gpp=AAAAA0000BBBB"),
+
+ TSIP_SSESSION_UNSET_HEADER("P-Access-Network-Info"),
+
+ TSIP_SSESSION_SET_NULL());
+
+ //tsip_ssession_id_t opid = tsip_ssession_get_id(op);
+
+ if((ret = tsip_stack_start(stack))) {
+ goto bail;
+ }
+
+ tsip_action_REGISTER(op,
+ TSIP_ACTION_SET_HEADER("My-Header-1", "My-Value-1"),
+ TSIP_ACTION_SET_HEADER("My-Header-2", "My-Value-1"),
+
+ TSIP_ACTION_SET_NULL());
+
+ getchar();
+ //tsk_thread_sleep(2000);
+
+ tsip_action_UNREGISTER(op,
+ TSIP_ACTION_SET_NULL()
+ );
- /*
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
- TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
- TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@"DOMAIN),
- TSIP_STACK_SET_PRIVATE_IDENTITY("mamadou@"DOMAIN),
- TSIP_STACK_SET_PASSWORD("mamadou"),
- TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
- TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
- //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
- TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
- //TSIP_STACK_SET_PROXY_CSCF_PORT(5081),
- TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
- //TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"),
- TSIP_STACK_SET_MOBILITY("fixed"),
- TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
- TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
- TSIP_STACK_SET_PRIVACY("header;id"),
-*/
+ getchar();
+ tsk_thread_sleep(2000);
-
-
- int32_t port = 4060;
-/*
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "mamadou@"DOMAIN, "sip:mamadou@"DOMAIN,
- TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
- TSIP_STACK_SET_PASSWORD("mamadou"),
- TSIP_STACK_SET_IMS_AKA_AMF(AMF),
- TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("0xff08"),
- TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
-
- TSIP_STACK_SET_PROXY_CSCF("192.168.16.225", port, "udp", "ipv4"),
-
- TSIP_STACK_SET_EARLY_IMS(tsk_true),
-*/
+ //tsip_unregister(op,
+ // TSIP_ACTION_SET_HEADER("Persistence2", "action"),
+ //
+ // tsk_null);
+ /*
+ tsip_subscribe(op,
+ TSIP_ACTION_SET_HEADER("Persistence", "action"),
+
+ tsk_null);
+
+ tsk_thread_sleep(5000);
+
+ tsip_unsubscribe(op,
+ TSIP_ACTION_SET_HEADER("Persistence2", "action"),
+
+ tsk_null);
+ */
+
+ /* INVITE */
+ /*
+ {
+ tsip_ssession_handle_t *call = TSIP_SSESSION_CREATE(stack,
+ TSIP_SSESSION_SET_HEADER("to", "sip:samba@"DOMAIN),
+ TSIP_SSESSION_SET_CAPS("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3gpp-service.ims.icsi.mmtel\""),
+ TSIP_SSESSION_SET_HEADER("Supported", "timer, norefersub, precondition"),
+ TSIP_SSESSION_SET_HEADER("Require", "100rel"),
+
+ TSIP_SSESSION_SET_PARAM("content", TEST_STACK_SDP),
+
+ TSIP_SSESSION_SET_NULL());
+ tsip_invite(stack, call);
+ }
+ */
+
+ /* SUBSCRIBE */
+ //{
+ // tsip_ssession_handle_t *ss2 = tsip_ssession_create(stack,
+ // TSIP_SSESSION_SET_CONTEXT(usr_context),
+ // TSIP_SSESSION_SET_HEADER("expires", "35"),
+ // TSIP_SSESSION_SET_HEADER("Event", "reg"),
+ // TSIP_SSESSION_SET_HEADER("Accept", "application/reginfo+xml"),
+ // TSIP_SSESSION_SET_HEADER("Allow-Events", "refer, presence, presence.winfo, xcap-diff"),
+ // TSIP_SSESSION_SET_HEADER("Allow", "INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER"),
+ //
+ // tsk_null);
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "mamadou@"DOMAIN, "sip:mamadou@"DOMAIN,
- TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
- TSIP_STACK_SET_PASSWORD("mamadou"),
- TSIP_STACK_SET_IMS_AKA_AMF(AMF),
- TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("0xff08"),
- TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
-
- TSIP_STACK_SET_PROXY_CSCF("192.168.0.13", 5081, "tcp", "ipv4"),
- TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
-
- TSIP_STACK_SET_EARLY_IMS(tsk_true),
-
-
-/*
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback, "sip:"DOMAIN, "2233392625", "sip:2233392625@"DOMAIN,
- TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
- TSIP_STACK_SET_PASSWORD("d3sb7j4fb8"),
-
- TSIP_STACK_SET_EARLY_IMS(tsk_true),
-
- TSIP_STACK_SET_HEADER("User-Agent", "IM-client/OMA1.0 doubango/v1.0.0"),
-*/
-/*
- tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
- TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
- TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@"DOMAIN),
- TSIP_STACK_SET_PRIVATE_IDENTITY("mamadou@"DOMAIN),
- TSIP_STACK_SET_PASSWORD("mamadou"),
- TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip:
- TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
- //TSIP_STACK_SET_DISCOVERY_NAPTR(1),
- TSIP_STACK_SET_PROXY_CSCF("192.168.16.104", "udp", 0),
- //TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
- TSIP_STACK_SET_PROXY_CSCF_PORT(5060),
- //TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"),
- TSIP_STACK_SET_MOBILITY("fixed"),
- TSIP_STACK_SET_DEVICE_ID("dd1289fa-c3d7-47bd-a40d-f1f1b2cc5ffc"),
- TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
- TSIP_STACK_SET_PRIVACY("header;id"),
-*/
+ // tsip_subscribe(ss2,
+ // TSIP_ACTION_SET_HEADER("Description", "subscribing"),
- TSIP_STACK_SET_NULL());
-
-
-
-
- //tsip_ssession_handle_t *op = tsip_ssession_create(stack,
- // TSIP_SSESSION_SET_CONTEXT(usr_context),
- // TSIP_SSESSION_SET_HEADER("expires", "30"),
- // TSIP_SSESSION_SET_HEADER("Persistence", "session"),
- //
- // TSIP_SSESSION_SET_CAPS("language", "\"en,fr\""),
- // TSIP_SSESSION_SET_CAPS("+audio", ""),
- // TSIP_SSESSION_SET_CAPS("+g.oma.sip-im", ""),
- //
- // tsk_null);
-
-
-tsip_ssession_handle_t *op = tsip_ssession_create(stack,
- TSIP_SSESSION_SET_EXPIRES(30),
-
- TSIP_SSESSION_SET_CAPS("+g.oma.sip-im", ""),
- TSIP_SSESSION_SET_CAPS("+audio", ""),
- TSIP_SSESSION_SET_CAPS("automata", ""),
- TSIP_SSESSION_SET_CAPS("language", "\"en,fr\""),
-
- TSIP_SSESSION_SET_HEADER("Supported", "ssl"),
- TSIP_SSESSION_SET_HEADER("P-Access-Network-Info", "3GPP-UTRAN-TDD;utran-cell-id-3gpp=AAAAA0000BBBB"),
-
- TSIP_SSESSION_UNSET_HEADER("P-Access-Network-Info"),
-
- TSIP_SSESSION_SET_NULL());
-
- //tsip_ssession_id_t opid = tsip_ssession_get_id(op);
-
- if((ret = tsip_stack_start(stack))){
- goto bail;
- }
-
- tsip_action_REGISTER(op,
- TSIP_ACTION_SET_HEADER("My-Header-1", "My-Value-1"),
- TSIP_ACTION_SET_HEADER("My-Header-2", "My-Value-1"),
-
- TSIP_ACTION_SET_NULL());
-
- getchar();
- //tsk_thread_sleep(2000);
-
- tsip_action_UNREGISTER(op,
- TSIP_ACTION_SET_NULL()
- );
-
- getchar();
- tsk_thread_sleep(2000);
-
- //tsip_unregister(op,
- // TSIP_ACTION_SET_HEADER("Persistence2", "action"),
- //
- // tsk_null);
-/*
- tsip_subscribe(op,
- TSIP_ACTION_SET_HEADER("Persistence", "action"),
-
- tsk_null);
-
- tsk_thread_sleep(5000);
-
- tsip_unsubscribe(op,
- TSIP_ACTION_SET_HEADER("Persistence2", "action"),
-
- tsk_null);
- */
-
- /* INVITE */
- /*
- {
- tsip_ssession_handle_t *call = TSIP_SSESSION_CREATE(stack,
- TSIP_SSESSION_SET_HEADER("to", "sip:samba@"DOMAIN),
- TSIP_SSESSION_SET_CAPS("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3gpp-service.ims.icsi.mmtel\""),
- TSIP_SSESSION_SET_HEADER("Supported", "timer, norefersub, precondition"),
- TSIP_SSESSION_SET_HEADER("Require", "100rel"),
-
- TSIP_SSESSION_SET_PARAM("content", TEST_STACK_SDP),
-
- TSIP_SSESSION_SET_NULL());
- tsip_invite(stack, call);
- }
- */
-
- /* SUBSCRIBE */
- //{
- // tsip_ssession_handle_t *ss2 = tsip_ssession_create(stack,
- // TSIP_SSESSION_SET_CONTEXT(usr_context),
- // TSIP_SSESSION_SET_HEADER("expires", "35"),
- // TSIP_SSESSION_SET_HEADER("Event", "reg"),
- // TSIP_SSESSION_SET_HEADER("Accept", "application/reginfo+xml"),
- // TSIP_SSESSION_SET_HEADER("Allow-Events", "refer, presence, presence.winfo, xcap-diff"),
- // TSIP_SSESSION_SET_HEADER("Allow", "INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER"),
- //
- // tsk_null);
-
- // tsip_subscribe(ss2,
- // TSIP_ACTION_SET_HEADER("Description", "subscribing"),
-
- // tsk_null);
-
- // getchar();
-
- // tsip_unsubscribe(ss2,
- // TSIP_ACTION_SET_HEADER("Test", "unsubscribing"),
- //
- // tsk_null);
- //}
-
- /* MESSAGE */
- //{
- // tsip_ssession_handle_t *ss3 = TSIP_SSESSION_CREATE(stack,
- // TSIP_SSESSION_SET_HEADER("to", "sip:alice@"DOMAIN),
- // TSIP_SSESSION_SET_HEADER("Accept-Contact", "*;+g.oma.sip-im"),
- //
- // tsk_null);
- // tsip_message(ss3,
- // TSIP_ACTION_SET_HEADER("Content-Type", "text/plain"),
- // TSIP_ACTION_SET_PAYLOAD("Hello world!", tsk_strlen("Hello world!")),
-
- // tsk_null
- // );
- //}
-
- /* PUBLISH */
- /*{
- tsip_ssession_handle_t *ss4 = TSIP_SSESSION_CREATE(stack,
- TSIP_SSESSION_SET_HEADER("expires", "30"),
- TSIP_SSESSION_SET_HEADER("to", "sip:mamadou@"DOMAIN),
-
- TSIP_SSESSION_SET_HEADER("Accept-Contact", "*;+g.oma.sip-im"),
- TSIP_SSESSION_SET_HEADER("Event", "presence"),
-
- tsk_null);
-
- tsip_publish(ss4,
- TSIP_ACTION_SET_HEADER("Description", "publish"),
- TSIP_ACTION_SET_HEADER("Content-Type", "application/pidf+xml"),
- TSIP_ACTION_SET_PAYLOAD(TEST_STACK_PIDF, tsk_strlen(TEST_STACK_PIDF)),
-
- tsk_null);
-
- getchar();
-
- tsip_unpublish(ss4,
- TSIP_ACTION_SET_HEADER("Description", "unpublish"),
-
- tsk_null);
- }
- */
- // /*getchar();
- // tsip_ssession_set(op4,
- // TSIP_SSESSION_SET_PARAM("content", TEST_STACK_PIDF),
-
- // TSIP_SSESSION_SET_NULL());
- // tsip_publish(stack, op4);*/
- //
- // getchar();
- // tsip_ssession_hangup(op4);
- //
- //}
+ // tsk_null);
+
+ // getchar();
+
+ // tsip_unsubscribe(ss2,
+ // TSIP_ACTION_SET_HEADER("Test", "unsubscribing"),
+ //
+ // tsk_null);
+ //}
+
+ /* MESSAGE */
+ //{
+ // tsip_ssession_handle_t *ss3 = TSIP_SSESSION_CREATE(stack,
+ // TSIP_SSESSION_SET_HEADER("to", "sip:alice@"DOMAIN),
+ // TSIP_SSESSION_SET_HEADER("Accept-Contact", "*;+g.oma.sip-im"),
+ //
+ // tsk_null);
+ // tsip_message(ss3,
+ // TSIP_ACTION_SET_HEADER("Content-Type", "text/plain"),
+ // TSIP_ACTION_SET_PAYLOAD("Hello world!", tsk_strlen("Hello world!")),
+
+ // tsk_null
+ // );
+ //}
+
+ /* PUBLISH */
+ /*{
+ tsip_ssession_handle_t *ss4 = TSIP_SSESSION_CREATE(stack,
+ TSIP_SSESSION_SET_HEADER("expires", "30"),
+ TSIP_SSESSION_SET_HEADER("to", "sip:mamadou@"DOMAIN),
+
+ TSIP_SSESSION_SET_HEADER("Accept-Contact", "*;+g.oma.sip-im"),
+ TSIP_SSESSION_SET_HEADER("Event", "presence"),
+
+ tsk_null);
+
+ tsip_publish(ss4,
+ TSIP_ACTION_SET_HEADER("Description", "publish"),
+ TSIP_ACTION_SET_HEADER("Content-Type", "application/pidf+xml"),
+ TSIP_ACTION_SET_PAYLOAD(TEST_STACK_PIDF, tsk_strlen(TEST_STACK_PIDF)),
+
+ tsk_null);
+
+ getchar();
+
+ tsip_unpublish(ss4,
+ TSIP_ACTION_SET_HEADER("Description", "unpublish"),
+
+ tsk_null);
+ }
+ */
+ // /*getchar();
+ // tsip_ssession_set(op4,
+ // TSIP_SSESSION_SET_PARAM("content", TEST_STACK_PIDF),
+
+ // TSIP_SSESSION_SET_NULL());
+ // tsip_publish(stack, op4);*/
+ //
+ // getchar();
+ // tsip_ssession_hangup(op4);
+ //
+ //}
bail:
- //while(1);//tsk_thread_sleep(500);
- //while(1)
- //tsk_thread_sleep(50000);
- getchar();
+ //while(1);//tsk_thread_sleep(500);
+ //while(1)
+ //tsk_thread_sleep(50000);
+ getchar();
- tsip_stack_stop(stack);
+ tsip_stack_stop(stack);
- TSK_OBJECT_SAFE_FREE(op);
- TSK_OBJECT_SAFE_FREE(stack);
+ TSK_OBJECT_SAFE_FREE(op);
+ TSK_OBJECT_SAFE_FREE(stack);
- TSK_DEBUG_INFO("==================");
- TSK_DEBUG_INFO("==================");
- TSK_DEBUG_INFO("==================");
- TSK_DEBUG_INFO("==================");
+ TSK_DEBUG_INFO("==================");
+ TSK_DEBUG_INFO("==================");
+ TSK_DEBUG_INFO("==================");
+ TSK_DEBUG_INFO("==================");
}
diff --git a/tinySIP/test/test_transac.h b/tinySIP/test/test_transac.h
index 3f31173..e274811 100755
--- a/tinySIP/test/test_transac.h
+++ b/tinySIP/test/test_transac.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,11 +24,11 @@
void test_transac()
{
- //tsip_transac_nict_t transact;
+ //tsip_transac_nict_t transact;
- //tsip_transac_nict_init(&transact);
+ //tsip_transac_nict_init(&transact);
- //tsk_thread_sleep(2000);
+ //tsk_thread_sleep(2000);
}
#endif /* _TEST_TRANSAC_H */
diff --git a/tinySIP/test/test_uri.h b/tinySIP/test/test_uri.h
index befbdfd..0558b93 100755
--- a/tinySIP/test/test_uri.h
+++ b/tinySIP/test/test_uri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,156 +22,148 @@
#ifndef _TEST_SIPURI_H
#define _TEST_SIPURI_H
-const char* uris[] =
-{
-
- //== SIP:
- "sip:123.com",
- "sip:open-ims.test",
- "sip:pcscf.open-ims.test:4060;lr;transport=udp",
- "sip:2233392625@sip2sip.info",
- "sip:alice@iatlanta.com;p1=23",
- "sip:*666*@atlanta.com",
- "sip:#66#@atlanta.com", // should fail: # must be replaced with %23
- "sip:alice:secretword@atlanta.com",
- "sip:alice:secretword@atlanta.com:65535;transport=tcp",
+const char* uris[] = {
+
+ //== SIP:
+ "sip:123.com",
+ "sip:open-ims.test",
+ "sip:pcscf.open-ims.test:4060;lr;transport=udp",
+ "sip:2233392625@sip2sip.info",
+ "sip:alice@iatlanta.com;p1=23",
+ "sip:*666*@atlanta.com",
+ "sip:#66#@atlanta.com", // should fail: # must be replaced with %23
+ "sip:alice:secretword@atlanta.com",
+ "sip:alice:secretword@atlanta.com:65535;transport=tcp",
"sip:+1-212-555-1212:1234@gateway.com;user=phone",
- "sip:alice@192.0.2.4:5060",
- "sip:alice@[1111::aaa:bbb:ccc:ddd]:5060",
- "sip:atlanta.com",
- "sip:alice@[1111::aaa:bbb:ccc:ddd]",
- "sip:alice@[1111::aaa:bbb:ccc:ddd]:5060;user=phone",
- "sip:alice@1111::aaa:bbb:ccc:ddd", // should fail
- "sip:alice@[::127]",
- "sip:ss2.biloxi.example.com;lr",// FIXME
+ "sip:alice@192.0.2.4:5060",
+ "sip:alice@[1111::aaa:bbb:ccc:ddd]:5060",
+ "sip:atlanta.com",
+ "sip:alice@[1111::aaa:bbb:ccc:ddd]",
+ "sip:alice@[1111::aaa:bbb:ccc:ddd]:5060;user=phone",
+ "sip:alice@1111::aaa:bbb:ccc:ddd", // should fail
+ "sip:alice@[::127]",
+ "sip:ss2.biloxi.example.com;lr",// FIXME
"sip:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
"sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15",
"sip:alice@atlanta.com;comp=sigcomp",
- "sip:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
+ "sip:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
"sip:alice@atlanta.com?subject=project%20x&priority=urgent",
- //== SIPS:
- "sips:alice@atlanta.com",
+ //== SIPS:
+ "sips:alice@atlanta.com",
"sips:alice:secretword@atlanta.com;transport=tcp",
"sips:+1-212-555-1212:1234@gateway.com;user=phone",
"sips:alice@192.0.2.4",
"sips:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
"sips:alice@atlanta.com;maddr=239.255.255.1;ttl=15",
"sips:alice@atlanta.com;comp=sigcomp",
- "sips:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
+ "sips:atlanta.com;method=REGISTER?to=alice%40atlanta.com",
"sips:alice@atlanta.com?subject=project%20x&priority=urgent",
- //== TEL:
- "tel:+1-201-555-0123",
+ //== TEL:
+ "tel:+1-201-555-0123",
"tel:7042;phone-context=example.com;ff=ff",
"tel:863-1234;phone-context=+1-914-555",
- "tel:#666#",
+ "tel:#666#",
};
void test_uri_tostring(const tsip_uri_t *uri)
{
- char* ret = tsip_uri_tostring(uri, 1, 1);
- TSK_DEBUG_INFO("uri_to_string=%s", ret);
- TSK_FREE(ret);
+ char* ret = tsip_uri_tostring(uri, 1, 1);
+ TSK_DEBUG_INFO("uri_to_string=%s", ret);
+ TSK_FREE(ret);
}
void test_uri_parser()
{
- int i;
- tsk_list_item_t *item = 0;
-
- for(i=0; i<sizeof(uris)/sizeof(const char*); i++)
- {
- tsip_uri_t *uri = tsip_uri_parse(uris[i], tsk_strlen(uris[i]));
-
- printf("\n== Parsing {{ %s }} ==\n\n", uris[i]);
-
- if(uri)
- {
- printf("scheme: %s\n", uri->scheme);
- printf("user-name: %s\n", uri->user_name);
- printf("password: %s\n", uri->password);
- printf("host: %s\n", uri->host);
- printf("port: %d\n", uri->port);
- printf("host-type: %s\n", uri->host_type == host_ipv4 ? "IPv4" : (uri->host_type == host_ipv6 ? "IPv6" : (uri->host_type == host_hostname ? "HOSTNAME" : "UNKNOWN")) );
-
- printf("---PARAMS---\n");
-
- /* dump all parameters */
- tsk_list_foreach(item, uri->params)
- {
- tsk_param_t* param = item->data;
- printf("-->%s=%s\n", param->name, param->value);
- }
-
- printf("Is-secure: %s\n", TSIP_URI_IS_SECURE(uri) ? "YES" : "NO");
-
- test_uri_tostring(uri);
- }
- else
- {
- printf("INVALID SIP URI.\n");
- }
-
- printf("\n\n");
- getchar();
-
- TSK_OBJECT_SAFE_FREE(uri);
- }
+ int i;
+ tsk_list_item_t *item = 0;
+
+ for(i=0; i<sizeof(uris)/sizeof(const char*); i++) {
+ tsip_uri_t *uri = tsip_uri_parse(uris[i], tsk_strlen(uris[i]));
+
+ printf("\n== Parsing {{ %s }} ==\n\n", uris[i]);
+
+ if(uri) {
+ printf("scheme: %s\n", uri->scheme);
+ printf("user-name: %s\n", uri->user_name);
+ printf("password: %s\n", uri->password);
+ printf("host: %s\n", uri->host);
+ printf("port: %d\n", uri->port);
+ printf("host-type: %s\n", uri->host_type == host_ipv4 ? "IPv4" : (uri->host_type == host_ipv6 ? "IPv6" : (uri->host_type == host_hostname ? "HOSTNAME" : "UNKNOWN")) );
+
+ printf("---PARAMS---\n");
+
+ /* dump all parameters */
+ tsk_list_foreach(item, uri->params) {
+ tsk_param_t* param = item->data;
+ printf("-->%s=%s\n", param->name, param->value);
+ }
+
+ printf("Is-secure: %s\n", TSIP_URI_IS_SECURE(uri) ? "YES" : "NO");
+
+ test_uri_tostring(uri);
+ }
+ else {
+ printf("INVALID SIP URI.\n");
+ }
+
+ printf("\n\n");
+ getchar();
+
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
}
-struct test_uri_bundle
-{
- const char* uri1;
- const char* uri2;
+struct test_uri_bundle {
+ const char* uri1;
+ const char* uri2;
- unsigned match:1;
+ unsigned match:1;
};
// From RFC 3261 - 19.1.4 URI Comparison
-struct test_uri_bundle test_uri_bundles[] =
-{
- /* Match */
- { "sip:%61lice@atlanta.com;transport=TCP", "sip:alice@AtLanTa.CoM;Transport=tcp", 1 },
- { "sip:carol@chicago.com", "sip:carol@chicago.com;newparam=5", 1 },
- { "sip:carol@chicago.com", "sip:carol@chicago.com;security=on", 1 },
- { "sip:carol@chicago.com;newparam=5", "sip:carol@chicago.com;security=on", 1 },
- { "sip:biloxi.com;transport=tcp;method=REGISTER?to=sip:bob%40biloxi.com", "sip:biloxi.com;method=REGISTER;transport=tcp?to=sip:bob%40biloxi.com", 1 },
- { "sip:alice@atlanta.com?subject=project%20x&priority=urgent", "sip:alice@atlanta.com?priority=urgent&subject=project%20x", 1 },
-
- /* Do not match */
- { "SIP:ALICE@AtLanTa.CoM;Transport=udp", "sip:alice@AtLanTa.CoM;Transport=UDP", 0 }, /* different usernames */
- { "sip:bob@biloxi.com", "sip:bob@biloxi.com:5060", 0 }, /* can resolve to different ports */
- { "sip:bob@biloxi.com", "sip:bob@biloxi.com;transport=udp", 0 }, /* can resolve to different transports */
- { "sip:bob@biloxi.com", "sip:bob@biloxi.com:6000;transport=tcp", 0 }, /* can resolve to different port and transports */
- { "sip:carol@chicago.com", "sip:carol@chicago.com?Subject=next%20meeting", 0 }, /* different header component */
- { "sip:bob@phone21.boxesbybob.com", "sip:bob@192.0.2.4", 0 }, /* even though that's what phone21.boxesbybob.com resolves to*/
+struct test_uri_bundle test_uri_bundles[] = {
+ /* Match */
+ { "sip:%61lice@atlanta.com;transport=TCP", "sip:alice@AtLanTa.CoM;Transport=tcp", 1 },
+ { "sip:carol@chicago.com", "sip:carol@chicago.com;newparam=5", 1 },
+ { "sip:carol@chicago.com", "sip:carol@chicago.com;security=on", 1 },
+ { "sip:carol@chicago.com;newparam=5", "sip:carol@chicago.com;security=on", 1 },
+ { "sip:biloxi.com;transport=tcp;method=REGISTER?to=sip:bob%40biloxi.com", "sip:biloxi.com;method=REGISTER;transport=tcp?to=sip:bob%40biloxi.com", 1 },
+ { "sip:alice@atlanta.com?subject=project%20x&priority=urgent", "sip:alice@atlanta.com?priority=urgent&subject=project%20x", 1 },
+
+ /* Do not match */
+ { "SIP:ALICE@AtLanTa.CoM;Transport=udp", "sip:alice@AtLanTa.CoM;Transport=UDP", 0 }, /* different usernames */
+ { "sip:bob@biloxi.com", "sip:bob@biloxi.com:5060", 0 }, /* can resolve to different ports */
+ { "sip:bob@biloxi.com", "sip:bob@biloxi.com;transport=udp", 0 }, /* can resolve to different transports */
+ { "sip:bob@biloxi.com", "sip:bob@biloxi.com:6000;transport=tcp", 0 }, /* can resolve to different port and transports */
+ { "sip:carol@chicago.com", "sip:carol@chicago.com?Subject=next%20meeting", 0 }, /* different header component */
+ { "sip:bob@phone21.boxesbybob.com", "sip:bob@192.0.2.4", 0 }, /* even though that's what phone21.boxesbybob.com resolves to*/
};
void test_uri_cmp()
{
- size_t i;
-
- for(i=0; i< sizeof(test_uri_bundles)/sizeof(struct test_uri_bundle); i++)
- {
- tsip_uri_t *uri1 = tsip_uri_parse(test_uri_bundles[i].uri1, tsk_strlen(test_uri_bundles[i].uri1));
- tsip_uri_t *uri2 = tsip_uri_parse(test_uri_bundles[i].uri2, tsk_strlen(test_uri_bundles[i].uri2));
-
- if(tsk_object_cmp(uri1, uri2) && test_uri_bundles[i].match){
- TSK_DEBUG_ERROR("URI Comparison failed.");
- }
- else{
- TSK_DEBUG_INFO("URI Comparison ok.");
- }
-
- TSK_OBJECT_SAFE_FREE(uri1);
- TSK_OBJECT_SAFE_FREE(uri2);
- }
+ size_t i;
+
+ for(i=0; i< sizeof(test_uri_bundles)/sizeof(struct test_uri_bundle); i++) {
+ tsip_uri_t *uri1 = tsip_uri_parse(test_uri_bundles[i].uri1, tsk_strlen(test_uri_bundles[i].uri1));
+ tsip_uri_t *uri2 = tsip_uri_parse(test_uri_bundles[i].uri2, tsk_strlen(test_uri_bundles[i].uri2));
+
+ if(tsk_object_cmp(uri1, uri2) && test_uri_bundles[i].match) {
+ TSK_DEBUG_ERROR("URI Comparison failed.");
+ }
+ else {
+ TSK_DEBUG_INFO("URI Comparison ok.");
+ }
+
+ TSK_OBJECT_SAFE_FREE(uri1);
+ TSK_OBJECT_SAFE_FREE(uri2);
+ }
}
void test_uri()
{
- test_uri_parser();
- test_uri_cmp();
+ test_uri_parser();
+ test_uri_cmp();
}
#endif /* _TEST_SIPURI_H */
diff --git a/tinySMS/include/tinysms.h b/tinySMS/include/tinysms.h
index d3f69ee..98ecb8e 100755
--- a/tinySMS/include/tinysms.h
+++ b/tinySMS/include/tinysms.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySMS/include/tinysms/rpdu/tsms_rpdu.h b/tinySMS/include/tinysms/rpdu/tsms_rpdu.h
index 4c2b704..c73ca84 100755
--- a/tinySMS/include/tinysms/rpdu/tsms_rpdu.h
+++ b/tinySMS/include/tinysms/rpdu/tsms_rpdu.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,16 +37,15 @@
TSMS_BEGIN_DECLS
/** @a RP-DATA as per 3GPP TS 24.011 section 7.3.1. */
-typedef struct tsms_rpdu_data_s
-{
- TSMS_DECLARE_RPDU_MESSAGE;
-
- // section 8.2.5.1
- tsms_address_t *oa;
- //section 8.2.5.2
- tsms_address_t *da;
- // section 8.2.5.3
- tsk_buffer_t* udata;
+typedef struct tsms_rpdu_data_s {
+ TSMS_DECLARE_RPDU_MESSAGE;
+
+ // section 8.2.5.1
+ tsms_address_t *oa;
+ //section 8.2.5.2
+ tsms_address_t *da;
+ // section 8.2.5.3
+ tsk_buffer_t* udata;
}
tsms_rpdu_data_t;
@@ -101,9 +100,8 @@ TINYSMS_API tsms_rpdu_data_t* tsms_rpdu_data_create(uint8_t mr, const tsms_addre
TINYSMS_GEXTERN const tsk_object_def_t *tsms_rpdu_data_def_t;
/** RP-SMMA as per 3GPP TS 24.011 section 7.3.2. */
-typedef struct tsms_rpdu_smma_s
-{
- TSMS_DECLARE_RPDU_MESSAGE;
+typedef struct tsms_rpdu_smma_s {
+ TSMS_DECLARE_RPDU_MESSAGE;
}
tsms_rpdu_smma_t;
@@ -128,12 +126,11 @@ TINYSMS_API tsms_rpdu_smma_t* tsms_rpdu_smma_create(uint8_t mr);
TINYSMS_GEXTERN const tsk_object_def_t *tsms_rpdu_smma_def_t;
/** RP-ACK as per 3GPP TS 24.011 section 7.3.3. */
-typedef struct tsms_rpdu_ack_s
-{
- TSMS_DECLARE_RPDU_MESSAGE;
+typedef struct tsms_rpdu_ack_s {
+ TSMS_DECLARE_RPDU_MESSAGE;
- // section 8.2.5.3
- tsk_buffer_t* udata;
+ // section 8.2.5.3
+ tsk_buffer_t* udata;
}
tsms_rpdu_ack_t;
@@ -184,14 +181,13 @@ TINYSMS_API tsms_rpdu_ack_t* tsms_rpdu_ack_create(uint8_t mr, const tsms_tpdu_me
TINYSMS_GEXTERN const tsk_object_def_t *tsms_rpdu_ack_def_t;
/** RP-ERROR as per 3GPP TS 24.011 section 7.3.4. */
-typedef struct tsms_rpdu_error_s
-{
- TSMS_DECLARE_RPDU_MESSAGE;
-
- // section 8.2.5.4
- uint8_t cause [3]; //2-3o
- // section 8.2.5.3
- tsk_buffer_t* udata;
+typedef struct tsms_rpdu_error_s {
+ TSMS_DECLARE_RPDU_MESSAGE;
+
+ // section 8.2.5.4
+ uint8_t cause [3]; //2-3o
+ // section 8.2.5.3
+ tsk_buffer_t* udata;
}
tsms_rpdu_error_t;
diff --git a/tinySMS/include/tinysms/tpdu/tsms_tpdu_command.h b/tinySMS/include/tinysms/tpdu/tsms_tpdu_command.h
index 655dc00..fe79bb2 100755
--- a/tinySMS/include/tinysms/tpdu/tsms_tpdu_command.h
+++ b/tinySMS/include/tinysms/tpdu/tsms_tpdu_command.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,58 +36,56 @@
TSMS_BEGIN_DECLS
-/** TP-Command-Type (TP-CT) as per 3GPP TS 23.040 section 9.2.3.19.
+/** TP-Command-Type (TP-CT) as per 3GPP TS 23.040 section 9.2.3.19.
* An 8-bit field.
*/
-typedef enum tsms_tpdu_cmd_e
-{
- tsms_tpdu_cmd_rel = 0x00, /**< Enquiry relating to previously submitted short message. */
- tsms_tpdu_cmd_cancel = 0x01, /**< Cancel Status Report Request relating to previously submitted short message. */
- tsms_tpdu_cmd_delete = 0x02, /**< Delete previously submitted Short Message. */
- tsms_tpdu_cmd_enable_status = 0x03, /**< Enable Status Report Request relating to previously submitted short message. */
- /* 00000100..00011111 ==> Reserved */
- /* 11100000..11111111 ==> Values specific for each SC */
+typedef enum tsms_tpdu_cmd_e {
+ tsms_tpdu_cmd_rel = 0x00, /**< Enquiry relating to previously submitted short message. */
+ tsms_tpdu_cmd_cancel = 0x01, /**< Cancel Status Report Request relating to previously submitted short message. */
+ tsms_tpdu_cmd_delete = 0x02, /**< Delete previously submitted Short Message. */
+ tsms_tpdu_cmd_enable_status = 0x03, /**< Enable Status Report Request relating to previously submitted short message. */
+ /* 00000100..00011111 ==> Reserved */
+ /* 11100000..11111111 ==> Values specific for each SC */
}
tsms_tpdu_cmd_t;
/** SMS TPDU SMS-COMMAND message as per 3GPP TS 23.040 section 9.2.2.4.
*/
-typedef struct tsms_tpdu_command_s
-{
- TSMS_DECLARE_TPDU_MESSAGE;
-
- tsms_address_t* smsc;
-
- /** TP-User-Data-Header-Indication (O - 1b)
- * Parameter indicating that the TP-CD field contains a Header. */
- unsigned udhi:1;
- /** TP Status Report Request (O - 1b)
- * Parameter indicating if the SMS Command is requesting a status report. */
- unsigned srr:1;
- /** TP Message Reference (M - I)
- * Parameter identifying the SMS COMMAND. */
- uint8_t mr;
- /** TP Protocol Identifier (M - o)
- * Parameter identifying the above layer protocol, if any. */
- //(base)uint8_t pid;
- /** TP Command Type (M - o)
- * Parameter specifying which operation is to be performed on a SM.
- * See section 9.2.3.19 */
- tsms_tpdu_cmd_t ct;
- /** TP Message Number (M - o)
- * Parameter indicating which SM in the SC to operate on.
- * See section 9.2.3.18 */
- uint8_t mn;
- /** TP Destination Address (M - 2-12o)
- * Parameter indicating the Destination Address to which the TP Command refers. */
- tsms_address_t* da;
- /** TP Command Data Length (M - o)
- * Parameter indicating the length of the TP-CD field in octets. */
- //(base)uint8_t cdl;
- /** TP Command Data (O - o)
- * Parameter containing user data. */
- //(base)uint8_t cd;
+typedef struct tsms_tpdu_command_s {
+ TSMS_DECLARE_TPDU_MESSAGE;
+
+ tsms_address_t* smsc;
+
+ /** TP-User-Data-Header-Indication (O - 1b)
+ * Parameter indicating that the TP-CD field contains a Header. */
+ unsigned udhi:1;
+ /** TP Status Report Request (O - 1b)
+ * Parameter indicating if the SMS Command is requesting a status report. */
+ unsigned srr:1;
+ /** TP Message Reference (M - I)
+ * Parameter identifying the SMS COMMAND. */
+ uint8_t mr;
+ /** TP Protocol Identifier (M - o)
+ * Parameter identifying the above layer protocol, if any. */
+ //(base)uint8_t pid;
+ /** TP Command Type (M - o)
+ * Parameter specifying which operation is to be performed on a SM.
+ * See section 9.2.3.19 */
+ tsms_tpdu_cmd_t ct;
+ /** TP Message Number (M - o)
+ * Parameter indicating which SM in the SC to operate on.
+ * See section 9.2.3.18 */
+ uint8_t mn;
+ /** TP Destination Address (M - 2-12o)
+ * Parameter indicating the Destination Address to which the TP Command refers. */
+ tsms_address_t* da;
+ /** TP Command Data Length (M - o)
+ * Parameter indicating the length of the TP-CD field in octets. */
+ //(base)uint8_t cdl;
+ /** TP Command Data (O - o)
+ * Parameter containing user data. */
+ //(base)uint8_t cd;
}
tsms_tpdu_command_t;
diff --git a/tinySMS/include/tinysms/tpdu/tsms_tpdu_deliver.h b/tinySMS/include/tinysms/tpdu/tsms_tpdu_deliver.h
index 6413bda..09d1dd6 100755
--- a/tinySMS/include/tinysms/tpdu/tsms_tpdu_deliver.h
+++ b/tinySMS/include/tinysms/tpdu/tsms_tpdu_deliver.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,46 +39,45 @@ TSMS_BEGIN_DECLS
/** SMS TPDU SMS-DELIVER message as per 3GPP TS 23.040 section 9.2.2.1.
*/
-typedef struct tsms_tpdu_deliver_s
-{
- TSMS_DECLARE_TPDU_MESSAGE;
+typedef struct tsms_tpdu_deliver_s {
+ TSMS_DECLARE_TPDU_MESSAGE;
- tsms_address_t* smsc;
+ tsms_address_t* smsc;
- /** TP More Messages to Send (M - 1b)
- * Parameter indicating whether or not there are more messages to send. */
- unsigned mms:1;
- /** TP-Loop-Prevention (O - 1b)
- * Parameter indicating that SMS applications should inhibit forwarding or automatic message generation that could cause infinite looping. */
- unsigned lp:2;
- /** TP Reply Path (M - 1b)
- * Parameter indicating the request for Reply Path.
- Section 9.2.3.28 */
- unsigned rp:1;
- /** TP User Data Header Indicator (O - 1b)
- * Parameter indicating that the TP UD field contains a Header. */
- unsigned udhi:1;
- /** TP Status Report Indicator (O - 1b)
- * Parameter indicating if the SME has requested a status report. */
- unsigned sri:1;
- /** TP Originating Address (M - 2-12o)
- * Address of the originating SME. */
- tsms_address_t* oa;
- /** TP Protocol Identifier (M - o)
- * Parameter identifying the above layer protocol, if any. */
- //(base)uint8_t pid;
- /** TP Data Coding Scheme (M - o)
- * Parameter identifying the coding scheme within the TP-User-Data. */
- //(base)uint8_t dcs;
- /** TP Service Centre Time Stamp (M - 7o)
- * Parameter identifying time when the SC received the message. */
- uint8_t scts[7];
- /** TP User Data Length (M - I)
- * Parameter indicating the length of the TP User Data field to follow. */
- //(base)uint8_t udl;
- /** TP User Data (O - v)
- * User data. */
- //(base)tsk_buffer_t* ud;
+ /** TP More Messages to Send (M - 1b)
+ * Parameter indicating whether or not there are more messages to send. */
+ unsigned mms:1;
+ /** TP-Loop-Prevention (O - 1b)
+ * Parameter indicating that SMS applications should inhibit forwarding or automatic message generation that could cause infinite looping. */
+ unsigned lp:2;
+ /** TP Reply Path (M - 1b)
+ * Parameter indicating the request for Reply Path.
+ Section 9.2.3.28 */
+ unsigned rp:1;
+ /** TP User Data Header Indicator (O - 1b)
+ * Parameter indicating that the TP UD field contains a Header. */
+ unsigned udhi:1;
+ /** TP Status Report Indicator (O - 1b)
+ * Parameter indicating if the SME has requested a status report. */
+ unsigned sri:1;
+ /** TP Originating Address (M - 2-12o)
+ * Address of the originating SME. */
+ tsms_address_t* oa;
+ /** TP Protocol Identifier (M - o)
+ * Parameter identifying the above layer protocol, if any. */
+ //(base)uint8_t pid;
+ /** TP Data Coding Scheme (M - o)
+ * Parameter identifying the coding scheme within the TP-User-Data. */
+ //(base)uint8_t dcs;
+ /** TP Service Centre Time Stamp (M - 7o)
+ * Parameter identifying time when the SC received the message. */
+ uint8_t scts[7];
+ /** TP User Data Length (M - I)
+ * Parameter indicating the length of the TP User Data field to follow. */
+ //(base)uint8_t udl;
+ /** TP User Data (O - v)
+ * User data. */
+ //(base)tsk_buffer_t* ud;
}
tsms_tpdu_deliver_t;
diff --git a/tinySMS/include/tinysms/tpdu/tsms_tpdu_report.h b/tinySMS/include/tinysms/tpdu/tsms_tpdu_report.h
index 0eb1874..d42279c 100755
--- a/tinySMS/include/tinysms/tpdu/tsms_tpdu_report.h
+++ b/tinySMS/include/tinysms/tpdu/tsms_tpdu_report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,41 +40,40 @@ TSMS_BEGIN_DECLS
/** SMS TPDU SMS-DELIVER-REPORT or SMS-SUBMIT-REPORT
* message as per 3GPP TS 23.040 section 9.2.2.1a or 9.2.2.2a.
*/
-typedef struct tsms_tpdu_report_s
-{
- TSMS_DECLARE_TPDU_MESSAGE;
-
- tsms_address_t* smsc;
-
- /** Indicates whether the Report is for RP-ERROR or not (RP-ACK).*/
- tsk_bool_t error;
-
- /** TP-User-Data-Header-Indication (O - 1b)
- * Parameter indicating that the TP-UD field contains a Header. */
- unsigned udhi:1;
- /** TP Failure Cause (M - I)
- * Parameter indicating the reason for SMS DELIVER/SUBMIT failure.
- See clause 9.2.3.22 */
- uint8_t fcs;
- /** TP Parameter Indicator (M - o)
- * Parameter indicating the presence of any of the optional parameters which follow. */
- uint8_t pi;
- /** TP Service Centre Time Stamp (M - 7o)
- * Parameter identifying the time when the SC received the SMS DELIVER/SUBMIT.
- * See clause 9.2.3.11. */
- uint8_t scts[7];
- /** TP Protocol Identifier (O - o)
- * See clause 9.2.3.9. */
- //(base)uint8_t pid;
- /** TP Data Coding Scheme (O - o)
- * See clause 9.2.3.10. */
- //(base)uint8_t dcs;
- /** TP User Data Length (O- o)
- * See clause 9.2.3.16. */
- //(base)uint8_t udl;
- /** TP User Data (O - v)
- * User data. */
- //(base)tsk_buffer_t* ud;
+typedef struct tsms_tpdu_report_s {
+ TSMS_DECLARE_TPDU_MESSAGE;
+
+ tsms_address_t* smsc;
+
+ /** Indicates whether the Report is for RP-ERROR or not (RP-ACK).*/
+ tsk_bool_t error;
+
+ /** TP-User-Data-Header-Indication (O - 1b)
+ * Parameter indicating that the TP-UD field contains a Header. */
+ unsigned udhi:1;
+ /** TP Failure Cause (M - I)
+ * Parameter indicating the reason for SMS DELIVER/SUBMIT failure.
+ See clause 9.2.3.22 */
+ uint8_t fcs;
+ /** TP Parameter Indicator (M - o)
+ * Parameter indicating the presence of any of the optional parameters which follow. */
+ uint8_t pi;
+ /** TP Service Centre Time Stamp (M - 7o)
+ * Parameter identifying the time when the SC received the SMS DELIVER/SUBMIT.
+ * See clause 9.2.3.11. */
+ uint8_t scts[7];
+ /** TP Protocol Identifier (O - o)
+ * See clause 9.2.3.9. */
+ //(base)uint8_t pid;
+ /** TP Data Coding Scheme (O - o)
+ * See clause 9.2.3.10. */
+ //(base)uint8_t dcs;
+ /** TP User Data Length (O- o)
+ * See clause 9.2.3.16. */
+ //(base)uint8_t udl;
+ /** TP User Data (O - v)
+ * User data. */
+ //(base)tsk_buffer_t* ud;
}
tsms_tpdu_report_t;
diff --git a/tinySMS/include/tinysms/tpdu/tsms_tpdu_status_report.h b/tinySMS/include/tinysms/tpdu/tsms_tpdu_status_report.h
index 001127d..8eae0a7 100755
--- a/tinySMS/include/tinysms/tpdu/tsms_tpdu_status_report.h
+++ b/tinySMS/include/tinysms/tpdu/tsms_tpdu_status_report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,105 +40,103 @@ TSMS_BEGIN_DECLS
/** 3GPP TS 23.040 v910 section 9.2.3.15 (TP-ST).
* Used in SMS-STATUS-REPORT message.
*/
-typedef enum tsms_tpdu_status_type_e
-{
- /*== Short message transaction completed ==*/
- tsms_tpdu_status_received = 0x00, /**< Short message received by the SME. */
- tsms_tpdu_status_forwarded = 0x01, /**< Short message forwarded by the SC to the SME but the SC is unable to confirm delivery. */
- tsms_tpdu_status_replaced = 0x02, /**< Short message replaced by the SC. */
- /* 0000011..0001111 Reserved */
- /* 0010000..0011111 Values specific to each SC */
-
- /*== Temporary error, SC still trying to transfer SM ==*/
- tsms_tpdu_status_congestion = 0x20, /**< Congestion. */
- tsms_tpdu_status_busy = 0x21, /**< ME busy. */
- tsms_tpdu_status_no_response = 0x22, /**< No response from SME. */
- tsms_tpdu_status_serv_rejected = 0x23, /**< Service rejected. */
- tsms_tpdu_status_no_qos = 0x24, /**< Quality of service not available. */
- tsms_tpdu_status_error_in_sme= 0x25, /**< Error in SME. */
- /* 0100110..0101111 Reserved */
- /* 0110000..0111111 Values specific to each SC */
-
- /*== Permanent error, SC is not making any more transfer attempts ==*/
- tsms_tpdu_status_remote_error = 0x40, /**< Remote procedure error. */
- tsms_tpdu_status_incompatible_dest = 0x41, /**< Incompatible destination. */
- tsms_tpdu_status_conn_rejected = 0x42, /**< Connection rejected by SME. */
- tsms_tpdu_status_not_obtainable = 0x43, /**< Not obtainable. */
- tsms_tpdu_status_no_qos_2 = 0x44, /**< Quality of service not available. */
- tsms_tpdu_status_no_inter_avail = 0x45, /**< No interworking available. */
- tsms_tpdu_status_vp_expired = 0x46, /**< SM Validity Period Expired. */
- tsms_tpdu_status_deleted_by_orig = 0x47, /**< SM Deleted by originating SME. */
- tsms_tpdu_status_deleted_by_admin = 0x48, /**< SM Deleted by SC Administration. */
- tsms_tpdu_status_sm_not_exist = 0x49, /**< SM does not exist (The SM may have previously existed in the SC but the SC no longer has knowledge of it or the SM may never have previously existed in the SC). */
- /* 1001010..1001111 Reserved */
- /* 1010000..1011111 Values specific to each SC */
-
- /*== Temporary error, SC is not making any more transfer attempts ==*/
- tsms_tpdu_status_congestion_3 = 0x50, /**< Congestion. */
- tsms_tpdu_status_busy_3 = 0x51, /**< SME busy. */
- tsms_tpdu_status_no_response_3 = 0x52, /**< No response from SME. */
- tsms_tpdu_status_serv_rejected_3 = 0x53, /**< Service rejected. */
- tsms_tpdu_status_temp_no_qos_3 = 0x54, /**< Quality of service not available. */
- tsms_tpdu_status_error_in_sme_3 = 0x55, /**< Error in SME. */
- /* 1100110..1101001 Reserved */
- /* 1101010..1101111 Reserved */
- /* 1110000..1111111 Values specific to each SC */
+typedef enum tsms_tpdu_status_type_e {
+ /*== Short message transaction completed ==*/
+ tsms_tpdu_status_received = 0x00, /**< Short message received by the SME. */
+ tsms_tpdu_status_forwarded = 0x01, /**< Short message forwarded by the SC to the SME but the SC is unable to confirm delivery. */
+ tsms_tpdu_status_replaced = 0x02, /**< Short message replaced by the SC. */
+ /* 0000011..0001111 Reserved */
+ /* 0010000..0011111 Values specific to each SC */
+
+ /*== Temporary error, SC still trying to transfer SM ==*/
+ tsms_tpdu_status_congestion = 0x20, /**< Congestion. */
+ tsms_tpdu_status_busy = 0x21, /**< ME busy. */
+ tsms_tpdu_status_no_response = 0x22, /**< No response from SME. */
+ tsms_tpdu_status_serv_rejected = 0x23, /**< Service rejected. */
+ tsms_tpdu_status_no_qos = 0x24, /**< Quality of service not available. */
+ tsms_tpdu_status_error_in_sme= 0x25, /**< Error in SME. */
+ /* 0100110..0101111 Reserved */
+ /* 0110000..0111111 Values specific to each SC */
+
+ /*== Permanent error, SC is not making any more transfer attempts ==*/
+ tsms_tpdu_status_remote_error = 0x40, /**< Remote procedure error. */
+ tsms_tpdu_status_incompatible_dest = 0x41, /**< Incompatible destination. */
+ tsms_tpdu_status_conn_rejected = 0x42, /**< Connection rejected by SME. */
+ tsms_tpdu_status_not_obtainable = 0x43, /**< Not obtainable. */
+ tsms_tpdu_status_no_qos_2 = 0x44, /**< Quality of service not available. */
+ tsms_tpdu_status_no_inter_avail = 0x45, /**< No interworking available. */
+ tsms_tpdu_status_vp_expired = 0x46, /**< SM Validity Period Expired. */
+ tsms_tpdu_status_deleted_by_orig = 0x47, /**< SM Deleted by originating SME. */
+ tsms_tpdu_status_deleted_by_admin = 0x48, /**< SM Deleted by SC Administration. */
+ tsms_tpdu_status_sm_not_exist = 0x49, /**< SM does not exist (The SM may have previously existed in the SC but the SC no longer has knowledge of it or the SM may never have previously existed in the SC). */
+ /* 1001010..1001111 Reserved */
+ /* 1010000..1011111 Values specific to each SC */
+
+ /*== Temporary error, SC is not making any more transfer attempts ==*/
+ tsms_tpdu_status_congestion_3 = 0x50, /**< Congestion. */
+ tsms_tpdu_status_busy_3 = 0x51, /**< SME busy. */
+ tsms_tpdu_status_no_response_3 = 0x52, /**< No response from SME. */
+ tsms_tpdu_status_serv_rejected_3 = 0x53, /**< Service rejected. */
+ tsms_tpdu_status_temp_no_qos_3 = 0x54, /**< Quality of service not available. */
+ tsms_tpdu_status_error_in_sme_3 = 0x55, /**< Error in SME. */
+ /* 1100110..1101001 Reserved */
+ /* 1101010..1101111 Reserved */
+ /* 1110000..1111111 Values specific to each SC */
}
tsms_tpdu_status_type_t;
/** SMS TPDU SMS-STATUS-REPORT message as per 3GPP TS 23.040 section 9.2.2.3.
*/
-typedef struct tsms_tpdu_status_report_s
-{
- TSMS_DECLARE_TPDU_MESSAGE;
-
- tsms_address_t* smsc;
-
- /** TP User Data Header Indicator (O - 1b)
- * Parameter indicating that the TP UD field contains a Header. */
- unsigned udhi:1;
- /** TP More Messages to Send (M - 1b)
- * Parameter indicating whether or not there are more messages to send. */
- unsigned mms:1;
- /** TP-Loop-Prevention (O - 1b)
- * Parameter indicating that SMS applications should inhibit forwarding or automatic message generation that could cause infinite looping.
- Section 9.2.3.28 */
- unsigned lp:1;
- /** TP Status Report Qualifier (M - 1b)
- * Parameter indicating whether the previously submitted TPDU was an SMS-SUBMIT or an SMS COMMAND. */
- unsigned srq:1;
- /** TP Message Reference (M - I)
- * Parameter identifying the previously submitted SMS SUBMIT or SMS COMMAND.
- * See section 9.2.3.26. */
- unsigned mr;
- /** TP Recipient Address (M - 2-12o)
- * Address of the recipient of the previously submitted mobile originated short message. */
- tsms_address_t* ra;
- /** TP Service Centre Time Stamp (M - 7o)
- * Parameter identifying time when the SC received the previously sent SMS SUBMIT. */
- uint8_t scts[7];
- /** TP Discharge Time (M 7o)
- * Parameter identifying the time associated with a particular TP ST outcome. */
- uint8_t dt[7];
- /** TP Status (M - o)
- * Parameter identifying the status of the previously sent mobile originated short message. */
- tsms_tpdu_status_type_t st;
- /** TP-Parameter-Indicator (O - o)
- * Parameter indicating the presence of any of the optional parameters which follow. */
- uint8_t pi;
- /** TP Protocol Identifier (O - o)
- * See clause 9.2.3.9. TP-PID of original SMS-SUBMIT. */
- //(base)uint8_t pid;
- /** TP Data Coding Scheme (O - o)
- * See clause 9.2.3.10. */
- //(base)uint8_t dcs;
- /** TP User Data Length (O- o)
- * See clause 9.2.3.16. */
- //(base)uint8_t udl;
- /** TP User Data (O - v)
- * User data. See clause 9.2.3.24. */
- //(base)uint8_t* ud;
+typedef struct tsms_tpdu_status_report_s {
+ TSMS_DECLARE_TPDU_MESSAGE;
+
+ tsms_address_t* smsc;
+
+ /** TP User Data Header Indicator (O - 1b)
+ * Parameter indicating that the TP UD field contains a Header. */
+ unsigned udhi:1;
+ /** TP More Messages to Send (M - 1b)
+ * Parameter indicating whether or not there are more messages to send. */
+ unsigned mms:1;
+ /** TP-Loop-Prevention (O - 1b)
+ * Parameter indicating that SMS applications should inhibit forwarding or automatic message generation that could cause infinite looping.
+ Section 9.2.3.28 */
+ unsigned lp:1;
+ /** TP Status Report Qualifier (M - 1b)
+ * Parameter indicating whether the previously submitted TPDU was an SMS-SUBMIT or an SMS COMMAND. */
+ unsigned srq:1;
+ /** TP Message Reference (M - I)
+ * Parameter identifying the previously submitted SMS SUBMIT or SMS COMMAND.
+ * See section 9.2.3.26. */
+ unsigned mr;
+ /** TP Recipient Address (M - 2-12o)
+ * Address of the recipient of the previously submitted mobile originated short message. */
+ tsms_address_t* ra;
+ /** TP Service Centre Time Stamp (M - 7o)
+ * Parameter identifying time when the SC received the previously sent SMS SUBMIT. */
+ uint8_t scts[7];
+ /** TP Discharge Time (M 7o)
+ * Parameter identifying the time associated with a particular TP ST outcome. */
+ uint8_t dt[7];
+ /** TP Status (M - o)
+ * Parameter identifying the status of the previously sent mobile originated short message. */
+ tsms_tpdu_status_type_t st;
+ /** TP-Parameter-Indicator (O - o)
+ * Parameter indicating the presence of any of the optional parameters which follow. */
+ uint8_t pi;
+ /** TP Protocol Identifier (O - o)
+ * See clause 9.2.3.9. TP-PID of original SMS-SUBMIT. */
+ //(base)uint8_t pid;
+ /** TP Data Coding Scheme (O - o)
+ * See clause 9.2.3.10. */
+ //(base)uint8_t dcs;
+ /** TP User Data Length (O- o)
+ * See clause 9.2.3.16. */
+ //(base)uint8_t udl;
+ /** TP User Data (O - v)
+ * User data. See clause 9.2.3.24. */
+ //(base)uint8_t* ud;
}
tsms_tpdu_status_report_t;
diff --git a/tinySMS/include/tinysms/tpdu/tsms_tpdu_submit.h b/tinySMS/include/tinysms/tpdu/tsms_tpdu_submit.h
index 4191a8f..c965bdf 100755
--- a/tinySMS/include/tinysms/tpdu/tsms_tpdu_submit.h
+++ b/tinySMS/include/tinysms/tpdu/tsms_tpdu_submit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,50 +39,49 @@ TSMS_BEGIN_DECLS
/** SMS @a SMS-SUBMIT message as per 3GPP TS 23.040 section 9.2.2.2
*/
-typedef struct tsms_tpdu_submit_s
-{
- TSMS_DECLARE_TPDU_MESSAGE;
+typedef struct tsms_tpdu_submit_s {
+ TSMS_DECLARE_TPDU_MESSAGE;
- tsms_address_t* smsc;
+ tsms_address_t* smsc;
- /** TP Reject Duplicates (M - 1b)
- * Parameter indicating whether or not the SC shall accept an SMS SUBMIT for an
- * SM still held in the SC which has the same TP MR and the same TP DA as a
- * previously submitted SM from the same OA. */
- unsigned rd:1;
- /** TP Validity Period Format (M - 2b)
- * Parameter indicating whether or not the TP VP field is present. */
- tsms_tpdu_vpf_t vpf;
- /** TP Reply Path (M - 1b)
- * Parameter indicating the request for Reply Path. */
- unsigned rp:1;
- /** TP User Data Header Indicator (O - 1b)
- * Parameter indicating that the TP UD field contains a Header. */
- unsigned udhi:1;
- /** TP Status Report Request (O - 1b)
- * Parameter indicating if the MS is requesting a status report. */
- unsigned srr:1;
- /** TP Message Reference (M - I)
- * Parameter identifying the SMS SUBMIT. */
- uint8_t mr;
- /** TP Destination Address (M - 2-12o)
- * Address of the destination SME. */
- tsms_address_t* da;
- /** TP Protocol Identifier (M - o)
- * Parameter identifying the above layer protocol, if any. */
- //(base)uint8_t pid;
- /** TP Data Coding Scheme (M - o)
- * Parameter identifying the coding scheme within the TP User Data. */
- //(base)uint8_t dcs;
- /** TP Validity Period (O - o/7o)
- * Parameter identifying the time from where the message is no longer valid. */
- uint8_t vp[7];
- /** TP User Data Length (M - I)
- * Parameter indicating the length of the TP User Data field to follow. */
- //(base)uint8_t udl;
- /** TP User Data (O - v)
- * User data. */
- //(base)tsk_buffer_t* ud;
+ /** TP Reject Duplicates (M - 1b)
+ * Parameter indicating whether or not the SC shall accept an SMS SUBMIT for an
+ * SM still held in the SC which has the same TP MR and the same TP DA as a
+ * previously submitted SM from the same OA. */
+ unsigned rd:1;
+ /** TP Validity Period Format (M - 2b)
+ * Parameter indicating whether or not the TP VP field is present. */
+ tsms_tpdu_vpf_t vpf;
+ /** TP Reply Path (M - 1b)
+ * Parameter indicating the request for Reply Path. */
+ unsigned rp:1;
+ /** TP User Data Header Indicator (O - 1b)
+ * Parameter indicating that the TP UD field contains a Header. */
+ unsigned udhi:1;
+ /** TP Status Report Request (O - 1b)
+ * Parameter indicating if the MS is requesting a status report. */
+ unsigned srr:1;
+ /** TP Message Reference (M - I)
+ * Parameter identifying the SMS SUBMIT. */
+ uint8_t mr;
+ /** TP Destination Address (M - 2-12o)
+ * Address of the destination SME. */
+ tsms_address_t* da;
+ /** TP Protocol Identifier (M - o)
+ * Parameter identifying the above layer protocol, if any. */
+ //(base)uint8_t pid;
+ /** TP Data Coding Scheme (M - o)
+ * Parameter identifying the coding scheme within the TP User Data. */
+ //(base)uint8_t dcs;
+ /** TP Validity Period (O - o/7o)
+ * Parameter identifying the time from where the message is no longer valid. */
+ uint8_t vp[7];
+ /** TP User Data Length (M - I)
+ * Parameter indicating the length of the TP User Data field to follow. */
+ //(base)uint8_t udl;
+ /** TP User Data (O - v)
+ * User data. */
+ //(base)tsk_buffer_t* ud;
}
tsms_tpdu_submit_t;
diff --git a/tinySMS/include/tinysms/tsms.h b/tinySMS/include/tinysms/tsms.h
index fb11185..2ef5c7c 100755
--- a/tinySMS/include/tinysms/tsms.h
+++ b/tinySMS/include/tinysms/tsms.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySMS/include/tinysms/tsms_address.h b/tinySMS/include/tinysms/tsms_address.h
index f71589f..0a74483 100755
--- a/tinySMS/include/tinysms/tsms_address.h
+++ b/tinySMS/include/tinysms/tsms_address.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,74 +40,70 @@ typedef uint8_t tsms_address_string_t[13]; /* 12 + (+) */
/** Address type
*/
-typedef enum tsms_address_type_e
-{
- tsms_addr_oa,
- tsms_addr_da,
- tsms_addr_smsc,
+typedef enum tsms_address_type_e {
+ tsms_addr_oa,
+ tsms_addr_da,
+ tsms_addr_smsc,
}
tsms_address_type_t;
/** Type-of-number
* 3GPP TS 23.040 v910 section 9.1.2.5.
*/
-typedef enum tsms_address_ton_e
-{
- /** "Unknown" is used when the user or network has no a priori information about the numbering plan. In
- this case, the Address-Value field is organized according to the network dialling plan, e.g. prefix or
- escape digits might be present.*/
- tsms_addr_ton_unknown = 0x00, // 0b000
- /** International number
- The international format shall be accepted also when the message is destined to a recipient in the
- same country as the MSC. */
- tsms_addr_ton_international = 0x01, // 0b001
- /** National number
- Prefix or escape digits shall not be included */
- tsms_addr_ton_national = 0x02, // 0b010
- /** "Network specific number" is used to indicate administration/service number specific to the serving
- network, e.g. used to access an operator. */
- tsms_addr_ton_network_specific = 0x03, // 0b011
- /** "Subscriber number" is used when a specific short number representation is stored in one or more
- SCs as part of a higher layer application. (Note that "Subscriber number" shall only be used in
- connection with the proper PID referring to this application). */
- tsms_addr_ton_subscriber = 0x04, // 0b100
- /** Alphanumeric, (coded according to GSM TS 03.38 7-bit default alphabet) */
- tsms_addr_ton_alphanumeric = 0x05, // 0b101
- /** Abbreviated number */
- tsms_addr_ton_abbreviated = 0x06, // 0b110
- /** Reserved for extension */
- tsms_addr_ton_reserved = 0x07, // 0b111
+typedef enum tsms_address_ton_e {
+ /** "Unknown" is used when the user or network has no a priori information about the numbering plan. In
+ this case, the Address-Value field is organized according to the network dialling plan, e.g. prefix or
+ escape digits might be present.*/
+ tsms_addr_ton_unknown = 0x00, // 0b000
+ /** International number
+ The international format shall be accepted also when the message is destined to a recipient in the
+ same country as the MSC. */
+ tsms_addr_ton_international = 0x01, // 0b001
+ /** National number
+ Prefix or escape digits shall not be included */
+ tsms_addr_ton_national = 0x02, // 0b010
+ /** "Network specific number" is used to indicate administration/service number specific to the serving
+ network, e.g. used to access an operator. */
+ tsms_addr_ton_network_specific = 0x03, // 0b011
+ /** "Subscriber number" is used when a specific short number representation is stored in one or more
+ SCs as part of a higher layer application. (Note that "Subscriber number" shall only be used in
+ connection with the proper PID referring to this application). */
+ tsms_addr_ton_subscriber = 0x04, // 0b100
+ /** Alphanumeric, (coded according to GSM TS 03.38 7-bit default alphabet) */
+ tsms_addr_ton_alphanumeric = 0x05, // 0b101
+ /** Abbreviated number */
+ tsms_addr_ton_abbreviated = 0x06, // 0b110
+ /** Reserved for extension */
+ tsms_addr_ton_reserved = 0x07, // 0b111
}
tsms_address_ton_t;
/** Numbering-Plan-Identification
* 3GPP TS 23.040 v910 section 9.1.2.5.
*/
-typedef enum tsms_address_npi_e
-{
- /* 0000 */ tsms_addr_npi_unknown = 0x00, /**< Unknown */
- /* 0001 */ tsms_addr_npi_isdn = 0x01, /**< ISDN/telephone numbering plan (E.164/E.163) */
- /* 0011 */ tsms_addr_npi_x121 = 0x03, /**< Data numbering plan (X.121) */
- /* 0100 */ tsms_addr_npi_telex = 0x04, /**< Telex numbering plan */
- /* 1000 */ tsms_addr_npi_national = 0x08, /**< National numbering plan */
- /* 1001 */ tsms_addr_npi_private = 0x09, /**< Private numbering plan */
- /* 1010 */ tsms_addr_npi_ermes = 0x0A, /**< ERMES numbering plan (ETSI DE/PS 3 01-3) */
- /* 1111 */ tsms_addr_npi_reserved = 0x0F, /**< Reserved for extension */
+typedef enum tsms_address_npi_e {
+ /* 0000 */ tsms_addr_npi_unknown = 0x00, /**< Unknown */
+ /* 0001 */ tsms_addr_npi_isdn = 0x01, /**< ISDN/telephone numbering plan (E.164/E.163) */
+ /* 0011 */ tsms_addr_npi_x121 = 0x03, /**< Data numbering plan (X.121) */
+ /* 0100 */ tsms_addr_npi_telex = 0x04, /**< Telex numbering plan */
+ /* 1000 */ tsms_addr_npi_national = 0x08, /**< National numbering plan */
+ /* 1001 */ tsms_addr_npi_private = 0x09, /**< Private numbering plan */
+ /* 1010 */ tsms_addr_npi_ermes = 0x0A, /**< ERMES numbering plan (ETSI DE/PS 3 01-3) */
+ /* 1111 */ tsms_addr_npi_reserved = 0x0F, /**< Reserved for extension */
}
tsms_address_npi_t;
/** Address
*/
-typedef struct tsms_address_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsms_address_s {
+ TSK_DECLARE_OBJECT;
- // Address Type
- tsms_address_ton_t ton; /**< Type-of-number */
- tsms_address_npi_t npi; /**< Numbering-Plan-Identification */
+ // Address Type
+ tsms_address_ton_t ton; /**< Type-of-number */
+ tsms_address_npi_t npi; /**< Numbering-Plan-Identification */
- tsms_address_type_t type;
- char* digits; /* BCD digits */
+ tsms_address_type_t type;
+ char* digits; /* BCD digits */
}
tsms_address_t;
diff --git a/tinySMS/include/tinysms/tsms_common.h b/tinySMS/include/tinysms/tsms_common.h
index 38bef53..e80bac9 100755
--- a/tinySMS/include/tinysms/tsms_common.h
+++ b/tinySMS/include/tinysms/tsms_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,14 +38,13 @@
TSMS_BEGIN_DECLS
-/** SMS alphabet values as per 3GPP TS 23.038 v911 section 4.
+/** SMS alphabet values as per 3GPP TS 23.038 v911 section 4.
* Part of TP-DCS (SMS Data Coding Scheme).
*/
-typedef enum tsms_alphabet_e
-{
- /*11*/ tsms_alpha_reserved = 0x03,
- /*00*/ tsms_alpha_7bit = 0x00,
- /*01*/ tsms_alpha_8bit = 0x01,
+typedef enum tsms_alphabet_e {
+ /*11*/ tsms_alpha_reserved = 0x03,
+ /*00*/ tsms_alpha_7bit = 0x00,
+ /*01*/ tsms_alpha_8bit = 0x01,
/*10*/ tsms_alpha_ucs2 = 0x02
}
tsms_alphabet_t;
@@ -54,19 +53,18 @@ tsms_alphabet_t;
#define TSMS_ALPHA_FROM_DCS(dcs) (((dcs) & 0x0C) >> 2) /* Bit3 and Bit2 */
-/* ======================== TPDU ========================
+/* ======================== TPDU ========================
=========================================================*/
/** 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI) */
-typedef enum tsms_tpdu_mti_e
-{
- /*0 0*/ tsms_tpdu_mti_deliver_mt = 0x00, /**< SMS-DELIVER (in the direction SC to MS)*/
- /*0 0*/ tsms_tpdu_mti_deliver_report_mo = 0x00, /**< SMS-DELIVER-REPORT (in the direction MS to SC)*/
- /*1 0*/ tsms_tpdu_mti_status_report_mt = 0x02, /**< SMS-STATUS-REPORT (in the direction SC to MS)*/
- /*1 0*/ tsms_tpdu_mti_command_mo = 0x02, /**< SMS-COMMAND (in the direction MS to SC)*/
- /*0 1*/ tsms_tpdu_mti_submit_mo = 0x01, /**< SMS-SUBMIT (in the direction MS to SC)*/
- /*0 1*/ tsms_tpdu_mti_submit_report_mt = 0x01, /**< SMS-SUBMIT-REPORT (in the direction SC to MS)*/
- /*1 1*/ tsms_tpdu_mti_reserved = 0x03 /**< Reserved*/
+typedef enum tsms_tpdu_mti_e {
+ /*0 0*/ tsms_tpdu_mti_deliver_mt = 0x00, /**< SMS-DELIVER (in the direction SC to MS)*/
+ /*0 0*/ tsms_tpdu_mti_deliver_report_mo = 0x00, /**< SMS-DELIVER-REPORT (in the direction MS to SC)*/
+ /*1 0*/ tsms_tpdu_mti_status_report_mt = 0x02, /**< SMS-STATUS-REPORT (in the direction SC to MS)*/
+ /*1 0*/ tsms_tpdu_mti_command_mo = 0x02, /**< SMS-COMMAND (in the direction MS to SC)*/
+ /*0 1*/ tsms_tpdu_mti_submit_mo = 0x01, /**< SMS-SUBMIT (in the direction MS to SC)*/
+ /*0 1*/ tsms_tpdu_mti_submit_report_mt = 0x01, /**< SMS-SUBMIT-REPORT (in the direction SC to MS)*/
+ /*1 1*/ tsms_tpdu_mti_reserved = 0x03 /**< Reserved*/
}
tsms_tpdu_mti_t;
@@ -74,38 +72,36 @@ tsms_tpdu_mti_t;
#define TSMS_TPDU_MTI_IS_MO(mti) (((mti) == tsms_tpdu_mti_deliver_report_mo) || ((mti) == tsms_tpdu_mti_command_mo) || ((mti) == tsms_tpdu_mti_submit_mo))
/** 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI) */
-typedef enum tsms_tpdu_vpf_e
-{
- // Bit4 and Bit3
- /*0 0*/ tsms_tpdu_vpf_not_present = 0x00, /**< TP VP field not present */
- /*1 0*/ tsms_tpdu_vpf_relative = 0x02, /**< TP VP field present - relative format*/
- /*0 1*/ tsms_tpdu_vpf_enhanced = 0x01, /**< TP-VP field present - enhanced format */
- /*1 1*/ tsms_tpdu_vpf_absolute = 0x03, /**< TP VP field present - absolute format */
+typedef enum tsms_tpdu_vpf_e {
+ // Bit4 and Bit3
+ /*0 0*/ tsms_tpdu_vpf_not_present = 0x00, /**< TP VP field not present */
+ /*1 0*/ tsms_tpdu_vpf_relative = 0x02, /**< TP VP field present - relative format*/
+ /*0 1*/ tsms_tpdu_vpf_enhanced = 0x01, /**< TP-VP field present - enhanced format */
+ /*1 1*/ tsms_tpdu_vpf_absolute = 0x03, /**< TP VP field present - absolute format */
}
tsms_tpdu_vpf_t;
/** SM-TL base type as per 3GPP TS 23.040 section 9.2.
*/
-typedef struct tsms_tpdu_message_s
-{
- TSK_DECLARE_OBJECT;
-
- tsk_bool_t MobOrig;
-
- /** TP Message Type Indicator (TP MTI) as per TS 23.040 section 9.2.3.1. 2-bit field. */
- tsms_tpdu_mti_t mti;
- /** TP Protocol Identifier (M - o)
- * Parameter identifying the above layer protocol, if any. */
- uint8_t pid;
- /** TP Data Coding Scheme (M - o)
- * Parameter identifying the coding scheme within the TP-User-Data. */
- uint8_t dcs;
- /** TP User Data Length (M - I)
- * Parameter indicating the length of the TP User Data field to follow. */
- uint8_t udl;
- /** TP User Data (O - v)
- * User data. */
- tsk_buffer_t* ud;
+typedef struct tsms_tpdu_message_s {
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t MobOrig;
+
+ /** TP Message Type Indicator (TP MTI) as per TS 23.040 section 9.2.3.1. 2-bit field. */
+ tsms_tpdu_mti_t mti;
+ /** TP Protocol Identifier (M - o)
+ * Parameter identifying the above layer protocol, if any. */
+ uint8_t pid;
+ /** TP Data Coding Scheme (M - o)
+ * Parameter identifying the coding scheme within the TP-User-Data. */
+ uint8_t dcs;
+ /** TP User Data Length (M - I)
+ * Parameter indicating the length of the TP User Data field to follow. */
+ uint8_t udl;
+ /** TP User Data (O - v)
+ * User data. */
+ tsk_buffer_t* ud;
}
tsms_tpdu_message_t;
@@ -167,20 +163,19 @@ int tsms_tpdu_message_deinit(tsms_tpdu_message_t* self);
*/
#define TSMS_TPDU_APPEND_SMSC 0
-/* ======================== RPDU ========================
+/* ======================== RPDU ========================
=========================================================*/
/** RP-MTI types as per 3GPP TS 24.011 section 8.2.2
* 3bit field located in the first octet of all RP-Messages. */
-typedef enum tsms_rpdu_type_e
-{
- /*000*/ tsms_rpdu_type_data_mo = 0x00, /**< RP-DATA message ms->n */
- /*001*/ tsms_rpdu_type_data_mt = 0x01, /**< RP-DATA message n->ms */
- /*010*/ tsms_rpdu_type_ack_mo = 0x02, /**< RP-ACK message ms->n */
- /*011*/ tsms_rpdu_type_ack_mt = 0x03, /**< RP-ACK message n->ms */
- /*100*/ tsms_rpdu_type_error_mo = 0x04, /**< RP-ERROR message ms->n */
- /*101*/ tsms_rpdu_type_error_mt = 0x05, /**< RP-ERROR message n->ms */
- /*110*/ tsms_rpdu_type_smma_mo = 0x06, /**< RP-SMMA message ms->n */
+typedef enum tsms_rpdu_type_e {
+ /*000*/ tsms_rpdu_type_data_mo = 0x00, /**< RP-DATA message ms->n */
+ /*001*/ tsms_rpdu_type_data_mt = 0x01, /**< RP-DATA message n->ms */
+ /*010*/ tsms_rpdu_type_ack_mo = 0x02, /**< RP-ACK message ms->n */
+ /*011*/ tsms_rpdu_type_ack_mt = 0x03, /**< RP-ACK message n->ms */
+ /*100*/ tsms_rpdu_type_error_mo = 0x04, /**< RP-ERROR message ms->n */
+ /*101*/ tsms_rpdu_type_error_mt = 0x05, /**< RP-ERROR message n->ms */
+ /*110*/ tsms_rpdu_type_smma_mo = 0x06, /**< RP-SMMA message ms->n */
}
tsms_rpdu_type_t;
@@ -189,12 +184,11 @@ tsms_rpdu_type_t;
|| ((type) == tsms_rpdu_type_error_mo) \
|| ((type) == tsms_rpdu_type_smma_mo))
-typedef struct tsms_rpdu_message_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tsms_rpdu_message_s {
+ TSK_DECLARE_OBJECT;
- tsms_rpdu_type_t mti;
- uint8_t mr; /**< Message Reference. */
+ tsms_rpdu_type_t mti;
+ uint8_t mr; /**< Message Reference. */
}
tsms_rpdu_message_t;
#define TSMS_DECLARE_RPDU_MESSAGE tsms_rpdu_message_t rpdu
diff --git a/tinySMS/include/tinysms/tsms_etsi_gsm_03_38.h b/tinySMS/include/tinysms/tsms_etsi_gsm_03_38.h
index 40aedda..cac8171 100755
--- a/tinySMS/include/tinysms/tsms_etsi_gsm_03_38.h
+++ b/tinySMS/include/tinysms/tsms_etsi_gsm_03_38.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,132 +35,131 @@
TSMS_BEGIN_DECLS
#define TSMS_ETSI_GSM_03_38_COUNT 123
-static uint16_t TSMS_ETSI_GSM_03_38[TSMS_ETSI_GSM_03_38_COUNT][2] =
-{
- 0x00, 0x0040 ,//# COMMERCIAL AT
- 0x01, 0x00A3 ,//# POUND SIGN
- 0x02, 0x0024 ,//# DOLLAR SIGN
- 0x03, 0x00A5 ,//# YEN SIGN
- 0x04, 0x00E8 ,//# LATIN SMALL LETTER E WITH GRAVE
- 0x05, 0x00E9 ,//# LATIN SMALL LETTER E WITH ACUTE
- 0x06, 0x00F9 ,//# LATIN SMALL LETTER U WITH GRAVE
- 0x07, 0x00EC ,//# LATIN SMALL LETTER I WITH GRAVE
- 0x08, 0x00F2 ,//# LATIN SMALL LETTER O WITH GRAVE
- 0x09, 0x00E7 ,//# LATIN SMALL LETTER C WITH CEDILLA
- 0x0B, 0x00D8 ,//# LATIN CAPITAL LETTER O WITH STROKE
- 0x0C, 0x00F8 ,//# LATIN SMALL LETTER O WITH STROKE
- 0x0E, 0x00C5 ,//# LATIN CAPITAL LETTER A WITH RING ABOVE
- 0x0F, 0x00E5 ,//# LATIN SMALL LETTER A WITH RING ABOVE
- 0x11, 0x005F ,//# LOW LINE
- 0x1B14, 0x005E ,//# CIRCUMFLEX ACCENT
- 0x1B28, 0x007B ,//# LEFT CURLY BRACKET
- 0x1B29, 0x007D ,//# RIGHT CURLY BRACKET
- 0x1B2F, 0x005C ,//# REVERSE SOLIDUS
- 0x1B3C, 0x005B ,//# LEFT SQUARE BRACKET
- 0x1B3D, 0x007E ,//# TILDE
- 0x1B3E, 0x005D ,//# RIGHT SQUARE BRACKET
- 0x1B40, 0x007C ,//# VERTICAL LINE
- 0x1C, 0x00C6 ,//# LATIN CAPITAL LETTER AE
- 0x1D, 0x00E6 ,//# LATIN SMALL LETTER AE
- 0x1E, 0x00DF ,//# LATIN SMALL LETTER SHARP S (German)
- 0x1F, 0x00C9 ,//# LATIN CAPITAL LETTER E WITH ACUTE
- 0x20, 0x0020 ,//# SPACE
- 0x21, 0x0021 ,//# EXCLAMATION MARK
- 0x22, 0x0022 ,//# QUOTATION MARK
- 0x23, 0x0023 ,//# NUMBER SIGN
- 0x24, 0x00A4 ,//# CURRENCY SIGN
- 0x25, 0x0025 ,//# PERCENT SIGN
- 0x26, 0x0026 ,//# AMPERSAND
- 0x27, 0x0027 ,//# APOSTROPHE
- 0x28, 0x0028 ,//# LEFT PARENTHESIS
- 0x29, 0x0029 ,//# RIGHT PARENTHESIS
- 0x2A, 0x002A ,//# ASTERISK
- 0x2B, 0x002B ,//# PLUS SIGN
- 0x2C, 0x002C ,//# COMMA
- 0x2D, 0x002D ,//# HYPHEN-MINUS
- 0x2E, 0x002E ,//# FULL STOP
- 0x2F, 0x002F ,//# SOLIDUS
- 0x30, 0x0030 ,//# DIGIT ZERO
- 0x31, 0x0031 ,//# DIGIT ONE
- 0x32, 0x0032 ,//# DIGIT TWO
- 0x33, 0x0033 ,//# DIGIT THREE
- 0x34, 0x0034 ,//# DIGIT FOUR
- 0x35, 0x0035 ,//# DIGIT FIVE
- 0x36, 0x0036 ,//# DIGIT SIX
- 0x37, 0x0037 ,//# DIGIT SEVEN
- 0x38, 0x0038 ,//# DIGIT EIGHT
- 0x39, 0x0039 ,//# DIGIT NINE
- 0x3A, 0x003A ,//# COLON
- 0x3B, 0x003B ,//# SEMICOLON
- 0x3C, 0x003C ,//# LESS-THAN SIGN
- 0x3D, 0x003D ,//# EQUALS SIGN
- 0x3E, 0x003E ,//# GREATER-THAN SIGN
- 0x3F, 0x003F ,//# QUESTION MARK
- 0x40, 0x00A1 ,//# INVERTED EXCLAMATION MARK
- 0x41, 0x0041 ,//# LATIN CAPITAL LETTER A
- 0x42, 0x0042 ,//# LATIN CAPITAL LETTER B
- //,//#0x42 0x0392 ,//# GREEK CAPITAL LETTER BETA
- 0x43, 0x0043 ,//# LATIN CAPITAL LETTER C
- 0x44, 0x0044 ,//# LATIN CAPITAL LETTER D
- 0x45, 0x0045 ,//# LATIN CAPITAL LETTER E
- 0x46, 0x0046 ,//# LATIN CAPITAL LETTER F
- 0x47, 0x0047 ,//# LATIN CAPITAL LETTER G
- 0x48, 0x0048 ,//# LATIN CAPITAL LETTER H
- 0x49, 0x0049 ,//# LATIN CAPITAL LETTER I
- 0x4A, 0x004A ,//# LATIN CAPITAL LETTER J
- 0x4B, 0x004B ,//# LATIN CAPITAL LETTER K
- 0x4C, 0x004C ,//# LATIN CAPITAL LETTER L
- 0x4D, 0x004D ,//# LATIN CAPITAL LETTER M
- 0x4E, 0x004E ,//# LATIN CAPITAL LETTER N
- 0x4F, 0x004F ,//# LATIN CAPITAL LETTER O
- 0x50, 0x0050 ,//# LATIN CAPITAL LETTER P
- 0x51, 0x0051 ,//# LATIN CAPITAL LETTER Q
- 0x52, 0x0052 ,//# LATIN CAPITAL LETTER R
- 0x53, 0x0053 ,//# LATIN CAPITAL LETTER S
- 0x54, 0x0054 ,//# LATIN CAPITAL LETTER T
- 0x55, 0x0055 ,//# LATIN CAPITAL LETTER U
- 0x56, 0x0056 ,//# LATIN CAPITAL LETTER V
- 0x57, 0x0057 ,//# LATIN CAPITAL LETTER W
- 0x58, 0x0058 ,//# LATIN CAPITAL LETTER X
- 0x59, 0x0059 ,//# LATIN CAPITAL LETTER Y
- 0x5A, 0x005A ,//# LATIN CAPITAL LETTER Z
- 0x5B, 0x00C4 ,//# LATIN CAPITAL LETTER A WITH DIAERESIS
- 0x5C, 0x00D6 ,//# LATIN CAPITAL LETTER O WITH DIAERESIS
- 0x5D, 0x00D1 ,//# LATIN CAPITAL LETTER N WITH TILDE
- 0x5E, 0x00DC ,//# LATIN CAPITAL LETTER U WITH DIAERESIS
- 0x5F, 0x00A7 ,//# SECTION SIGN
- 0x60, 0x00BF ,//# INVERTED QUESTION MARK
- 0x61, 0x0061 ,//# LATIN SMALL LETTER A
- 0x62, 0x0062 ,//# LATIN SMALL LETTER B
- 0x63, 0x0063 ,//# LATIN SMALL LETTER C
- 0x64, 0x0064 ,//# LATIN SMALL LETTER D
- 0x65, 0x0065 ,//# LATIN SMALL LETTER E
- 0x66, 0x0066 ,//# LATIN SMALL LETTER F
- 0x67, 0x0067 ,//# LATIN SMALL LETTER G
- 0x68, 0x0068 ,//# LATIN SMALL LETTER H
- 0x69, 0x0069 ,//# LATIN SMALL LETTER I
- 0x6A, 0x006A ,//# LATIN SMALL LETTER J
- 0x6B, 0x006B ,//# LATIN SMALL LETTER K
- 0x6C, 0x006C ,//# LATIN SMALL LETTER L
- 0x6D, 0x006D ,//# LATIN SMALL LETTER M
- 0x6E, 0x006E ,//# LATIN SMALL LETTER N
- 0x6F, 0x006F ,//# LATIN SMALL LETTER O
- 0x70, 0x0070 ,//# LATIN SMALL LETTER P
- 0x71, 0x0071 ,//# LATIN SMALL LETTER Q
- 0x72, 0x0072 ,//# LATIN SMALL LETTER R
- 0x73, 0x0073 ,//# LATIN SMALL LETTER S
- 0x74, 0x0074 ,//# LATIN SMALL LETTER T
- 0x75, 0x0075 ,//# LATIN SMALL LETTER U
- 0x76, 0x0076 ,//# LATIN SMALL LETTER V
- 0x77, 0x0077 ,//# LATIN SMALL LETTER W
- 0x78, 0x0078 ,//# LATIN SMALL LETTER X
- 0x79, 0x0079 ,//# LATIN SMALL LETTER Y
- 0x7A, 0x007A ,//# LATIN SMALL LETTER Z
- 0x7B, 0x00E4 ,//# LATIN SMALL LETTER A WITH DIAERESIS
- 0x7C, 0x00F6 ,//# LATIN SMALL LETTER O WITH DIAERESIS
- 0x7D, 0x00F1 ,//# LATIN SMALL LETTER N WITH TILDE
- 0x7E, 0x00FC ,//# LATIN SMALL LETTER U WITH DIAERESIS
- 0x7F, 0x00E0 ,//# LATIN SMALL LETTER A WITH GRAVE
+static uint16_t TSMS_ETSI_GSM_03_38[TSMS_ETSI_GSM_03_38_COUNT][2] = {
+ 0x00, 0x0040 ,//# COMMERCIAL AT
+ 0x01, 0x00A3 ,//# POUND SIGN
+ 0x02, 0x0024 ,//# DOLLAR SIGN
+ 0x03, 0x00A5 ,//# YEN SIGN
+ 0x04, 0x00E8 ,//# LATIN SMALL LETTER E WITH GRAVE
+ 0x05, 0x00E9 ,//# LATIN SMALL LETTER E WITH ACUTE
+ 0x06, 0x00F9 ,//# LATIN SMALL LETTER U WITH GRAVE
+ 0x07, 0x00EC ,//# LATIN SMALL LETTER I WITH GRAVE
+ 0x08, 0x00F2 ,//# LATIN SMALL LETTER O WITH GRAVE
+ 0x09, 0x00E7 ,//# LATIN SMALL LETTER C WITH CEDILLA
+ 0x0B, 0x00D8 ,//# LATIN CAPITAL LETTER O WITH STROKE
+ 0x0C, 0x00F8 ,//# LATIN SMALL LETTER O WITH STROKE
+ 0x0E, 0x00C5 ,//# LATIN CAPITAL LETTER A WITH RING ABOVE
+ 0x0F, 0x00E5 ,//# LATIN SMALL LETTER A WITH RING ABOVE
+ 0x11, 0x005F ,//# LOW LINE
+ 0x1B14, 0x005E ,//# CIRCUMFLEX ACCENT
+ 0x1B28, 0x007B ,//# LEFT CURLY BRACKET
+ 0x1B29, 0x007D ,//# RIGHT CURLY BRACKET
+ 0x1B2F, 0x005C ,//# REVERSE SOLIDUS
+ 0x1B3C, 0x005B ,//# LEFT SQUARE BRACKET
+ 0x1B3D, 0x007E ,//# TILDE
+ 0x1B3E, 0x005D ,//# RIGHT SQUARE BRACKET
+ 0x1B40, 0x007C ,//# VERTICAL LINE
+ 0x1C, 0x00C6 ,//# LATIN CAPITAL LETTER AE
+ 0x1D, 0x00E6 ,//# LATIN SMALL LETTER AE
+ 0x1E, 0x00DF ,//# LATIN SMALL LETTER SHARP S (German)
+ 0x1F, 0x00C9 ,//# LATIN CAPITAL LETTER E WITH ACUTE
+ 0x20, 0x0020 ,//# SPACE
+ 0x21, 0x0021 ,//# EXCLAMATION MARK
+ 0x22, 0x0022 ,//# QUOTATION MARK
+ 0x23, 0x0023 ,//# NUMBER SIGN
+ 0x24, 0x00A4 ,//# CURRENCY SIGN
+ 0x25, 0x0025 ,//# PERCENT SIGN
+ 0x26, 0x0026 ,//# AMPERSAND
+ 0x27, 0x0027 ,//# APOSTROPHE
+ 0x28, 0x0028 ,//# LEFT PARENTHESIS
+ 0x29, 0x0029 ,//# RIGHT PARENTHESIS
+ 0x2A, 0x002A ,//# ASTERISK
+ 0x2B, 0x002B ,//# PLUS SIGN
+ 0x2C, 0x002C ,//# COMMA
+ 0x2D, 0x002D ,//# HYPHEN-MINUS
+ 0x2E, 0x002E ,//# FULL STOP
+ 0x2F, 0x002F ,//# SOLIDUS
+ 0x30, 0x0030 ,//# DIGIT ZERO
+ 0x31, 0x0031 ,//# DIGIT ONE
+ 0x32, 0x0032 ,//# DIGIT TWO
+ 0x33, 0x0033 ,//# DIGIT THREE
+ 0x34, 0x0034 ,//# DIGIT FOUR
+ 0x35, 0x0035 ,//# DIGIT FIVE
+ 0x36, 0x0036 ,//# DIGIT SIX
+ 0x37, 0x0037 ,//# DIGIT SEVEN
+ 0x38, 0x0038 ,//# DIGIT EIGHT
+ 0x39, 0x0039 ,//# DIGIT NINE
+ 0x3A, 0x003A ,//# COLON
+ 0x3B, 0x003B ,//# SEMICOLON
+ 0x3C, 0x003C ,//# LESS-THAN SIGN
+ 0x3D, 0x003D ,//# EQUALS SIGN
+ 0x3E, 0x003E ,//# GREATER-THAN SIGN
+ 0x3F, 0x003F ,//# QUESTION MARK
+ 0x40, 0x00A1 ,//# INVERTED EXCLAMATION MARK
+ 0x41, 0x0041 ,//# LATIN CAPITAL LETTER A
+ 0x42, 0x0042 ,//# LATIN CAPITAL LETTER B
+ //,//#0x42 0x0392 ,//# GREEK CAPITAL LETTER BETA
+ 0x43, 0x0043 ,//# LATIN CAPITAL LETTER C
+ 0x44, 0x0044 ,//# LATIN CAPITAL LETTER D
+ 0x45, 0x0045 ,//# LATIN CAPITAL LETTER E
+ 0x46, 0x0046 ,//# LATIN CAPITAL LETTER F
+ 0x47, 0x0047 ,//# LATIN CAPITAL LETTER G
+ 0x48, 0x0048 ,//# LATIN CAPITAL LETTER H
+ 0x49, 0x0049 ,//# LATIN CAPITAL LETTER I
+ 0x4A, 0x004A ,//# LATIN CAPITAL LETTER J
+ 0x4B, 0x004B ,//# LATIN CAPITAL LETTER K
+ 0x4C, 0x004C ,//# LATIN CAPITAL LETTER L
+ 0x4D, 0x004D ,//# LATIN CAPITAL LETTER M
+ 0x4E, 0x004E ,//# LATIN CAPITAL LETTER N
+ 0x4F, 0x004F ,//# LATIN CAPITAL LETTER O
+ 0x50, 0x0050 ,//# LATIN CAPITAL LETTER P
+ 0x51, 0x0051 ,//# LATIN CAPITAL LETTER Q
+ 0x52, 0x0052 ,//# LATIN CAPITAL LETTER R
+ 0x53, 0x0053 ,//# LATIN CAPITAL LETTER S
+ 0x54, 0x0054 ,//# LATIN CAPITAL LETTER T
+ 0x55, 0x0055 ,//# LATIN CAPITAL LETTER U
+ 0x56, 0x0056 ,//# LATIN CAPITAL LETTER V
+ 0x57, 0x0057 ,//# LATIN CAPITAL LETTER W
+ 0x58, 0x0058 ,//# LATIN CAPITAL LETTER X
+ 0x59, 0x0059 ,//# LATIN CAPITAL LETTER Y
+ 0x5A, 0x005A ,//# LATIN CAPITAL LETTER Z
+ 0x5B, 0x00C4 ,//# LATIN CAPITAL LETTER A WITH DIAERESIS
+ 0x5C, 0x00D6 ,//# LATIN CAPITAL LETTER O WITH DIAERESIS
+ 0x5D, 0x00D1 ,//# LATIN CAPITAL LETTER N WITH TILDE
+ 0x5E, 0x00DC ,//# LATIN CAPITAL LETTER U WITH DIAERESIS
+ 0x5F, 0x00A7 ,//# SECTION SIGN
+ 0x60, 0x00BF ,//# INVERTED QUESTION MARK
+ 0x61, 0x0061 ,//# LATIN SMALL LETTER A
+ 0x62, 0x0062 ,//# LATIN SMALL LETTER B
+ 0x63, 0x0063 ,//# LATIN SMALL LETTER C
+ 0x64, 0x0064 ,//# LATIN SMALL LETTER D
+ 0x65, 0x0065 ,//# LATIN SMALL LETTER E
+ 0x66, 0x0066 ,//# LATIN SMALL LETTER F
+ 0x67, 0x0067 ,//# LATIN SMALL LETTER G
+ 0x68, 0x0068 ,//# LATIN SMALL LETTER H
+ 0x69, 0x0069 ,//# LATIN SMALL LETTER I
+ 0x6A, 0x006A ,//# LATIN SMALL LETTER J
+ 0x6B, 0x006B ,//# LATIN SMALL LETTER K
+ 0x6C, 0x006C ,//# LATIN SMALL LETTER L
+ 0x6D, 0x006D ,//# LATIN SMALL LETTER M
+ 0x6E, 0x006E ,//# LATIN SMALL LETTER N
+ 0x6F, 0x006F ,//# LATIN SMALL LETTER O
+ 0x70, 0x0070 ,//# LATIN SMALL LETTER P
+ 0x71, 0x0071 ,//# LATIN SMALL LETTER Q
+ 0x72, 0x0072 ,//# LATIN SMALL LETTER R
+ 0x73, 0x0073 ,//# LATIN SMALL LETTER S
+ 0x74, 0x0074 ,//# LATIN SMALL LETTER T
+ 0x75, 0x0075 ,//# LATIN SMALL LETTER U
+ 0x76, 0x0076 ,//# LATIN SMALL LETTER V
+ 0x77, 0x0077 ,//# LATIN SMALL LETTER W
+ 0x78, 0x0078 ,//# LATIN SMALL LETTER X
+ 0x79, 0x0079 ,//# LATIN SMALL LETTER Y
+ 0x7A, 0x007A ,//# LATIN SMALL LETTER Z
+ 0x7B, 0x00E4 ,//# LATIN SMALL LETTER A WITH DIAERESIS
+ 0x7C, 0x00F6 ,//# LATIN SMALL LETTER O WITH DIAERESIS
+ 0x7D, 0x00F1 ,//# LATIN SMALL LETTER N WITH TILDE
+ 0x7E, 0x00FC ,//# LATIN SMALL LETTER U WITH DIAERESIS
+ 0x7F, 0x00E0 ,//# LATIN SMALL LETTER A WITH GRAVE
};
TSMS_END_DECLS
diff --git a/tinySMS/include/tinysms/tsms_packing.h b/tinySMS/include/tinysms/tsms_packing.h
index e1452cb..f3dc2b1 100755
--- a/tinySMS/include/tinysms/tsms_packing.h
+++ b/tinySMS/include/tinysms/tsms_packing.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySMS/include/tinysms_config.h b/tinySMS/include/tinysms_config.h
index e0cd694..7d68583 100755
--- a/tinySMS/include/tinysms_config.h
+++ b/tinySMS/include/tinysms_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,13 +46,13 @@
# define TINYSMS_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TSMS_BEGIN_DECLS extern "C" {
# define TSMS_END_DECLS }
#else
-# define TSMS_BEGIN_DECLS
+# define TSMS_BEGIN_DECLS
# define TSMS_END_DECLS
#endif
@@ -74,7 +74,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYSMS_CONFIG_H
diff --git a/tinySMS/src/rpdu/tsms_rpdu.c b/tinySMS/src/rpdu/tsms_rpdu.c
index 72640b9..4f3d8d0 100755
--- a/tinySMS/src/rpdu/tsms_rpdu.c
+++ b/tinySMS/src/rpdu/tsms_rpdu.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,93 +42,93 @@
/** internal function used to deserialize a RP-DATA message from binary content. */
tsms_rpdu_message_t* _tsms_rpdu_rpdata_deserialize(const void* data, tsk_size_t size)
{
- /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
- tsms_rpdu_data_t* self = tsms_rpdu_data_create(0x00, tsk_null, tsk_null, tsk_false);
- tsk_bool_t failed = tsk_false;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
- tsk_size_t smsc_len;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
- if(TSMS_RPDU_MESSAGE(self)->mti == tsms_rpdu_type_data_mt){
- /* 7.3.1.1 RP DATA (Network to Mobile Station) */
- if((self->oa = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_smsc, &smsc_len))){
- pdata += smsc_len;
- }
- /* 7.3.1.2 RP DATA (Mobile Station to Network) */
- pdata++; /* 1o */
- }
- else if(TSMS_RPDU_MESSAGE(self)->mti == tsms_rpdu_type_data_mo){
- /* 7.3.1.1 RP DATA (Network to Mobile Station) */
- pdata++; /* 1o */
- /* 7.3.1.2 RP DATA (Mobile Station to Network) */
- if((self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_smsc, &smsc_len))){
- pdata += smsc_len;
- }
- }
- else{
- failed = tsk_true;
- TSK_DEBUG_ERROR("%d Not a valid RP-DATA messsage", TSMS_RPDU_MESSAGE(self)->mti);
- goto bail;
- }
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if((pend-pdata) > 1){
- tsk_size_t length = *pdata++; // length-indicator
- if((length != (pend-pdata))){
- TSK_DEBUG_WARN("Invalid length-indicator.");
- }
- else{
- self->udata = tsk_buffer_create(pdata, length);
- }
- }
- else{
- TSK_DEBUG_WARN("RP-User data element is mandatory for RP-DATA messages.");
- }
-
+ /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
+ tsms_rpdu_data_t* self = tsms_rpdu_data_create(0x00, tsk_null, tsk_null, tsk_false);
+ tsk_bool_t failed = tsk_false;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+ tsk_size_t smsc_len;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
+ if(TSMS_RPDU_MESSAGE(self)->mti == tsms_rpdu_type_data_mt) {
+ /* 7.3.1.1 RP DATA (Network to Mobile Station) */
+ if((self->oa = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_smsc, &smsc_len))) {
+ pdata += smsc_len;
+ }
+ /* 7.3.1.2 RP DATA (Mobile Station to Network) */
+ pdata++; /* 1o */
+ }
+ else if(TSMS_RPDU_MESSAGE(self)->mti == tsms_rpdu_type_data_mo) {
+ /* 7.3.1.1 RP DATA (Network to Mobile Station) */
+ pdata++; /* 1o */
+ /* 7.3.1.2 RP DATA (Mobile Station to Network) */
+ if((self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_smsc, &smsc_len))) {
+ pdata += smsc_len;
+ }
+ }
+ else {
+ failed = tsk_true;
+ TSK_DEBUG_ERROR("%d Not a valid RP-DATA messsage", TSMS_RPDU_MESSAGE(self)->mti);
+ goto bail;
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if((pend-pdata) > 1) {
+ tsk_size_t length = *pdata++; // length-indicator
+ if((length != (pend-pdata))) {
+ TSK_DEBUG_WARN("Invalid length-indicator.");
+ }
+ else {
+ self->udata = tsk_buffer_create(pdata, length);
+ }
+ }
+ else {
+ TSK_DEBUG_WARN("RP-User data element is mandatory for RP-DATA messages.");
+ }
+
bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_RPDU_MESSAGE(self);
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_RPDU_MESSAGE(self);
}
/** internal function used to serialize a RP-DATA message as binary content.*/
int _tsms_rpdu_rpdata_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t* output)
{
- /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
- const tsms_rpdu_data_t* self = (const tsms_rpdu_data_t*)_self;
+ /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
+ const tsms_rpdu_data_t* self = (const tsms_rpdu_data_t*)_self;
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- tsk_buffer_append(output, &_self->mti, 1);
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ tsk_buffer_append(output, &_self->mti, 1);
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- tsk_buffer_append(output, &_self->mr, 1);
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ tsk_buffer_append(output, &_self->mr, 1);
- /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
- tsms_address_serialize(self->oa, output);
+ /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
+ tsms_address_serialize(self->oa, output);
- /* 3GPP TS 24.011 ==> 8.2.5.2 Destination address element */
- tsms_address_serialize(self->da, output);
+ /* 3GPP TS 24.011 ==> 8.2.5.2 Destination address element */
+ tsms_address_serialize(self->da, output);
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(self->udata){
- tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
- tsk_buffer_append(output, self->udata->data, self->udata->size);
- }
- else{
- static uint8_t _1byte = 0x00;
- tsk_buffer_append(output, &_1byte, 1); // length-indicator
- }
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(self->udata) {
+ tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
+ tsk_buffer_append(output, self->udata->data, self->udata->size);
+ }
+ else {
+ static uint8_t _1byte = 0x00;
+ tsk_buffer_append(output, &_1byte, 1); // length-indicator
+ }
- return 0;
+ return 0;
}
/**@ingroup tsms_rpdu_group
@@ -146,45 +146,45 @@ int _tsms_rpdu_rpdata_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t*
*/
tsms_rpdu_data_t* tsms_rpdu_data_create(uint8_t mr, const tsms_address_string_t smsc, const tsms_tpdu_message_t* tpdu, tsk_bool_t MobOrig)
{
- tsms_rpdu_data_t* ret = tsk_null;
-
- if(!(ret = tsk_object_new(tsms_rpdu_data_def_t))){
- goto bail;
- }
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_data_mo : tsms_rpdu_type_data_mt;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(ret)->mr = mr;
-
- /* 3GPP TS 24.341 section B5 (Moblie Originated RP-DATA message)
- The payload includes an RP-DATA message (see 3GPP TS 24.011 [8]). It includes:
- - Address of the originating UE: this field includes the length indicator only;
- - Address of the destination SC, which is configured in the UE; and
- - RP-User-Data (see 3GPP TS 23.040 [3]), which includes SMS-SUBMIT as type indicator.
- */
-
-
- /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
- if(smsc){
- if(TSMS_RPDU_MESSAGE(ret)->mti == tsms_rpdu_type_data_mt){
- /* 7.3.1.1 RP DATA (Network to Mobile Station) */
- ret->oa = tsms_address_smsc_create(smsc);
- }
- else{
- /* 7.3.1.2 RP DATA (Mobile Station to Network) */
- ret->da = tsms_address_smsc_create(smsc);
- }
- }
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(tpdu && (ret->udata = tsk_buffer_create_null())){
- tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
- }
+ tsms_rpdu_data_t* ret = tsk_null;
+
+ if(!(ret = tsk_object_new(tsms_rpdu_data_def_t))) {
+ goto bail;
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_data_mo : tsms_rpdu_type_data_mt;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(ret)->mr = mr;
+
+ /* 3GPP TS 24.341 section B5 (Moblie Originated RP-DATA message)
+ The payload includes an RP-DATA message (see 3GPP TS 24.011 [8]). It includes:
+ - Address of the originating UE: this field includes the length indicator only;
+ - Address of the destination SC, which is configured in the UE; and
+ - RP-User-Data (see 3GPP TS 23.040 [3]), which includes SMS-SUBMIT as type indicator.
+ */
+
+
+ /* 3GPP TS 24.011 ==> 8.2.5.1 Originator address element */
+ if(smsc) {
+ if(TSMS_RPDU_MESSAGE(ret)->mti == tsms_rpdu_type_data_mt) {
+ /* 7.3.1.1 RP DATA (Network to Mobile Station) */
+ ret->oa = tsms_address_smsc_create(smsc);
+ }
+ else {
+ /* 7.3.1.2 RP DATA (Mobile Station to Network) */
+ ret->da = tsms_address_smsc_create(smsc);
+ }
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(tpdu && (ret->udata = tsk_buffer_create_null())) {
+ tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
+ }
bail:
- return ret;
+ return ret;
}
//
@@ -192,37 +192,36 @@ bail:
//
static tsk_object_t* tsms_rpdu_data_ctor(tsk_object_t * self, va_list * app)
{
- tsms_rpdu_data_t *rpdata = self;
- if(rpdata){
- TSMS_RPDU_MESSAGE(rpdata)->mti = tsms_rpdu_type_data_mo;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ tsms_rpdu_data_t *rpdata = self;
+ if(rpdata) {
+ TSMS_RPDU_MESSAGE(rpdata)->mti = tsms_rpdu_type_data_mo;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_rpdu_data_dtor(tsk_object_t * self)
-{
- tsms_rpdu_data_t *rpdata = self;
- if(rpdata){
- TSK_OBJECT_SAFE_FREE(rpdata->oa);
- TSK_OBJECT_SAFE_FREE(rpdata->da);
- TSK_OBJECT_SAFE_FREE(rpdata->udata);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
-
- return self;
+{
+ tsms_rpdu_data_t *rpdata = self;
+ if(rpdata) {
+ TSK_OBJECT_SAFE_FREE(rpdata->oa);
+ TSK_OBJECT_SAFE_FREE(rpdata->da);
+ TSK_OBJECT_SAFE_FREE(rpdata->udata);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsms_rpdu_data_def_s =
-{
- sizeof(tsms_rpdu_data_t),
- tsms_rpdu_data_ctor,
- tsms_rpdu_data_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_rpdu_data_def_s = {
+ sizeof(tsms_rpdu_data_t),
+ tsms_rpdu_data_ctor,
+ tsms_rpdu_data_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_rpdu_data_def_t = &tsms_rpdu_data_def_s;
@@ -231,32 +230,32 @@ const tsk_object_def_t *tsms_rpdu_data_def_t = &tsms_rpdu_data_def_s;
/** internal function used to deserialize a RP-SMMA message from binary content. */
tsms_rpdu_message_t* _tsms_rpdu_rpsmma_deserialize(const void* data, tsk_size_t size)
{
- /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
- tsms_rpdu_smma_t* self = tsms_rpdu_smma_create(0);
- const uint8_t* pdata = data;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
-
- return TSMS_RPDU_MESSAGE(self);
+ /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
+ tsms_rpdu_smma_t* self = tsms_rpdu_smma_create(0);
+ const uint8_t* pdata = data;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
+
+ return TSMS_RPDU_MESSAGE(self);
}
/** internal function used to serialize a RP-SMMA message as binary content. */
int _tsms_rpdu_rpsmma_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t* output)
{
- /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
- //const tsms_rpdu_smma_t* self = (const tsms_rpdu_smma_t*)_self;
+ /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
+ //const tsms_rpdu_smma_t* self = (const tsms_rpdu_smma_t*)_self;
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- tsk_buffer_append(output, &_self->mti, 1);
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ tsk_buffer_append(output, &_self->mti, 1);
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- tsk_buffer_append(output, &_self->mr, 1);
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ tsk_buffer_append(output, &_self->mr, 1);
- return 0;
+ return 0;
}
/**@ingroup tsms_rpdu_group
@@ -270,12 +269,12 @@ int _tsms_rpdu_rpsmma_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t*
*/
tsms_rpdu_smma_t* tsms_rpdu_smma_create(uint8_t mr)
{
- tsms_rpdu_smma_t* ret = tsk_null;
+ tsms_rpdu_smma_t* ret = tsk_null;
- if((ret = tsk_object_new(tsms_rpdu_smma_def_t))){
- TSMS_RPDU_MESSAGE(ret)->mr = mr;
- }
- return ret;
+ if((ret = tsk_object_new(tsms_rpdu_smma_def_t))) {
+ TSMS_RPDU_MESSAGE(ret)->mr = mr;
+ }
+ return ret;
}
//
@@ -283,34 +282,33 @@ tsms_rpdu_smma_t* tsms_rpdu_smma_create(uint8_t mr)
//
static tsk_object_t* tsms_rpdu_smma_ctor(tsk_object_t * self, va_list * app)
{
- tsms_rpdu_smma_t *smma = self;
- if(smma){
- TSMS_RPDU_MESSAGE(smma)->mti = tsms_rpdu_type_smma_mo;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ tsms_rpdu_smma_t *smma = self;
+ if(smma) {
+ TSMS_RPDU_MESSAGE(smma)->mti = tsms_rpdu_type_smma_mo;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_rpdu_smma_dtor(tsk_object_t * self)
-{
- tsms_rpdu_smma_t *smma = self;
- if(smma){
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
-
- return self;
+{
+ tsms_rpdu_smma_t *smma = self;
+ if(smma) {
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsms_rpdu_smma_def_s =
-{
- sizeof(tsms_rpdu_smma_t),
- tsms_rpdu_smma_ctor,
- tsms_rpdu_smma_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_rpdu_smma_def_s = {
+ sizeof(tsms_rpdu_smma_t),
+ tsms_rpdu_smma_ctor,
+ tsms_rpdu_smma_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_rpdu_smma_def_t = &tsms_rpdu_smma_def_s;
@@ -320,58 +318,58 @@ const tsk_object_def_t *tsms_rpdu_smma_def_t = &tsms_rpdu_smma_def_s;
/** internal function used to deserialize an RP-ACK message from binary content. */
tsms_rpdu_message_t* _tsms_rpdu_rpack_deserialize(const void* data, tsk_size_t size)
{
- /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
- tsms_rpdu_ack_t* self = tsms_rpdu_ack_create(0, tsk_null, tsk_false);
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if((pend-pdata) > 1){
- tsk_size_t length;
- /*uint8_t iei =*/ (void)(*pdata++); // IEI MUST be equal to 0x41
- length = *pdata++; // length-indicator
- if((length != (pend-pdata))){
- TSK_DEBUG_WARN("Invalid length-indicator.");
- }
- else{
- self->udata = tsk_buffer_create(pdata, length);
- }
- }
-
- return TSMS_RPDU_MESSAGE(self);
+ /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
+ tsms_rpdu_ack_t* self = tsms_rpdu_ack_create(0, tsk_null, tsk_false);
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if((pend-pdata) > 1) {
+ tsk_size_t length;
+ /*uint8_t iei =*/ (void)(*pdata++); // IEI MUST be equal to 0x41
+ length = *pdata++; // length-indicator
+ if((length != (pend-pdata))) {
+ TSK_DEBUG_WARN("Invalid length-indicator.");
+ }
+ else {
+ self->udata = tsk_buffer_create(pdata, length);
+ }
+ }
+
+ return TSMS_RPDU_MESSAGE(self);
}
/** internal function used to serialize a RP-ACK message as binary content. */
int _tsms_rpdu_rpack_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t* output)
{
- /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
- const tsms_rpdu_ack_t* self = (const tsms_rpdu_ack_t*)_self;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- tsk_buffer_append(output, &_self->mti, 1);
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- tsk_buffer_append(output, &_self->mr, 1);
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(self->udata){
- static uint8_t iei = 0x41;
- tsk_buffer_append(output, &iei, 1); // IEI
- tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
- tsk_buffer_append(output, self->udata->data, self->udata->size);
- }
- else{
- static uint8_t _1byte = 0x00;
- tsk_buffer_append(output, &_1byte, 1); // length-indicator
- }
-
- return 0;
+ /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
+ const tsms_rpdu_ack_t* self = (const tsms_rpdu_ack_t*)_self;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ tsk_buffer_append(output, &_self->mti, 1);
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ tsk_buffer_append(output, &_self->mr, 1);
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(self->udata) {
+ static uint8_t iei = 0x41;
+ tsk_buffer_append(output, &iei, 1); // IEI
+ tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
+ tsk_buffer_append(output, self->udata->data, self->udata->size);
+ }
+ else {
+ static uint8_t _1byte = 0x00;
+ tsk_buffer_append(output, &_1byte, 1); // length-indicator
+ }
+
+ return 0;
}
/**@ingroup tsms_rpdu_group
@@ -387,29 +385,29 @@ int _tsms_rpdu_rpack_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t* o
*/
tsms_rpdu_ack_t* tsms_rpdu_ack_create(uint8_t mr, const tsms_tpdu_message_t* tpdu, tsk_bool_t MobOrig)
{
- tsms_rpdu_ack_t* ret = tsk_null;
-
- if(!tpdu){
- TSK_DEBUG_WARN("TPDU for RP-ACK message is Null.");
- }
-
- if(!(ret = tsk_object_new(tsms_rpdu_ack_def_t))){
- goto bail;
- }
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_ack_mo : tsms_rpdu_type_ack_mt;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(ret)->mr = mr;
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(tpdu && (ret->udata = tsk_buffer_create_null())){
- tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
- }
+ tsms_rpdu_ack_t* ret = tsk_null;
+
+ if(!tpdu) {
+ TSK_DEBUG_WARN("TPDU for RP-ACK message is Null.");
+ }
+
+ if(!(ret = tsk_object_new(tsms_rpdu_ack_def_t))) {
+ goto bail;
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_ack_mo : tsms_rpdu_type_ack_mt;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(ret)->mr = mr;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(tpdu && (ret->udata = tsk_buffer_create_null())) {
+ tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
+ }
bail:
- return ret;
+ return ret;
}
//
@@ -417,35 +415,34 @@ bail:
//
static tsk_object_t* tsms_rpdu_ack_ctor(tsk_object_t * self, va_list * app)
{
- tsms_rpdu_ack_t *ack = self;
- if(ack){
- TSMS_RPDU_MESSAGE(ack)->mti = tsms_rpdu_type_ack_mo;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ tsms_rpdu_ack_t *ack = self;
+ if(ack) {
+ TSMS_RPDU_MESSAGE(ack)->mti = tsms_rpdu_type_ack_mo;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_rpdu_ack_dtor(tsk_object_t * self)
-{
- tsms_rpdu_ack_t *ack = self;
- if(ack){
- TSK_OBJECT_SAFE_FREE(ack->udata);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
-
- return self;
+{
+ tsms_rpdu_ack_t *ack = self;
+ if(ack) {
+ TSK_OBJECT_SAFE_FREE(ack->udata);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsms_rpdu_ack_def_s =
-{
- sizeof(tsms_rpdu_ack_t),
- tsms_rpdu_ack_ctor,
- tsms_rpdu_ack_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_rpdu_ack_def_s = {
+ sizeof(tsms_rpdu_ack_t),
+ tsms_rpdu_ack_ctor,
+ tsms_rpdu_ack_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_rpdu_ack_def_t = &tsms_rpdu_ack_def_s;
@@ -454,79 +451,79 @@ const tsk_object_def_t *tsms_rpdu_ack_def_t = &tsms_rpdu_ack_def_s;
/** internal function used to deserialize a RP-ERROR message from binary content. */
tsms_rpdu_message_t* _tsms_rpdu_rperror_deserialize(const void* data, tsk_size_t size)
{
- /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
- tsms_rpdu_error_t* self = tsms_rpdu_error_create(0, tsk_null, 0, tsk_false);
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
- tsk_bool_t failed = tsk_false;
- uint8_t cause_count;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
-
- /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause
- * Only 1 cause (LV)*/
- if((cause_count = *pdata++)){
- self->cause[0] = cause_count;
- self->cause[1] = *pdata++;
- if((pdata += (cause_count-1)) >= pend){
- TSMS_ERROR_TOO_SHORT("RP-ERROR");
- }
- }
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if((pend-pdata) > 2){
- tsk_size_t length;
- /*uint8_t iei =*/ (void)(*pdata++); // IEI MUST be equal to 0x41
- length = *pdata++; // length-indicator
- if((length != (pend-pdata))){
- TSK_DEBUG_WARN("Invalid length-indicator.");
- }
- else{
- self->udata = tsk_buffer_create(pdata, length);
- }
- }
-
+ /* don't need to test data and size --> already done by tsms_rpdu_message_deserialize() */
+ tsms_rpdu_error_t* self = tsms_rpdu_error_create(0, tsk_null, 0, tsk_false);
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+ tsk_bool_t failed = tsk_false;
+ uint8_t cause_count;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(self)->mti = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(self)->mr = *pdata++;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause
+ * Only 1 cause (LV)*/
+ if((cause_count = *pdata++)) {
+ self->cause[0] = cause_count;
+ self->cause[1] = *pdata++;
+ if((pdata += (cause_count-1)) >= pend) {
+ TSMS_ERROR_TOO_SHORT("RP-ERROR");
+ }
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if((pend-pdata) > 2) {
+ tsk_size_t length;
+ /*uint8_t iei =*/ (void)(*pdata++); // IEI MUST be equal to 0x41
+ length = *pdata++; // length-indicator
+ if((length != (pend-pdata))) {
+ TSK_DEBUG_WARN("Invalid length-indicator.");
+ }
+ else {
+ self->udata = tsk_buffer_create(pdata, length);
+ }
+ }
+
bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_RPDU_MESSAGE(self);
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_RPDU_MESSAGE(self);
}
/** internal function used to serialize a RP-ERROR message as binary content. */
int _tsms_rpdu_rperror_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t* output)
{
- /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
- const tsms_rpdu_error_t* self = (const tsms_rpdu_error_t*)_self;
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- tsk_buffer_append(output, &_self->mti, 1);
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- tsk_buffer_append(output, &_self->mr, 1);
-
- /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause
- * Only 1 cause (LV)*/
- tsk_buffer_append(output, self->cause, 2);
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(self->udata){
- static uint8_t iei = 0x41;
- tsk_buffer_append(output, &iei, 1); // IEI
- tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
- tsk_buffer_append(output, self->udata->data, self->udata->size);
- }
- else{
- static uint8_t _1byte = 0x00;
- tsk_buffer_append(output, &_1byte, 1); // length-indicator
- }
-
- return 0;
+ /* don't need to test output and self --> already done by tsms_rpdu_message_serialize() */
+ const tsms_rpdu_error_t* self = (const tsms_rpdu_error_t*)_self;
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ tsk_buffer_append(output, &_self->mti, 1);
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ tsk_buffer_append(output, &_self->mr, 1);
+
+ /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause
+ * Only 1 cause (LV)*/
+ tsk_buffer_append(output, self->cause, 2);
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(self->udata) {
+ static uint8_t iei = 0x41;
+ tsk_buffer_append(output, &iei, 1); // IEI
+ tsk_buffer_append(output, &self->udata->size, 1); // length-indicator
+ tsk_buffer_append(output, self->udata->data, self->udata->size);
+ }
+ else {
+ static uint8_t _1byte = 0x00;
+ tsk_buffer_append(output, &_1byte, 1); // length-indicator
+ }
+
+ return 0;
}
/**@ingroup tsms_rpdu_group
@@ -543,33 +540,33 @@ int _tsms_rpdu_rperror_serialize(const tsms_rpdu_message_t* _self, tsk_buffer_t*
*/
tsms_rpdu_error_t* tsms_rpdu_error_create(uint8_t mr, const tsms_tpdu_message_t* tpdu, uint8_t cause, tsk_bool_t MobOrig)
{
- tsms_rpdu_error_t* ret = tsk_null;
-
- /*if(!tpdu){
- TSK_DEBUG_WARN("TPDU for RP-ERROR message is Null.");
- }*/
-
- if(!(ret = tsk_object_new(tsms_rpdu_error_def_t))){
- goto bail;
- }
-
- /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
- TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_error_mo : tsms_rpdu_type_error_mt;
-
- /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
- TSMS_RPDU_MESSAGE(ret)->mr = mr;
-
- /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause */
- ret->cause[0] = 1 /*len*/;
- ret->cause[1] = cause;
-
- /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
- if(tpdu && (ret->udata = tsk_buffer_create_null())){
- tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
- }
+ tsms_rpdu_error_t* ret = tsk_null;
+
+ /*if(!tpdu){
+ TSK_DEBUG_WARN("TPDU for RP-ERROR message is Null.");
+ }*/
+
+ if(!(ret = tsk_object_new(tsms_rpdu_error_def_t))) {
+ goto bail;
+ }
+
+ /* 3GPP TS 24.011 ==> 8.2.2 Message type indicator (MTI) */
+ TSMS_RPDU_MESSAGE(ret)->mti = MobOrig? tsms_rpdu_type_error_mo : tsms_rpdu_type_error_mt;
+
+ /* 3GPP TS 24.011 ==> 8.2.3 Message reference */
+ TSMS_RPDU_MESSAGE(ret)->mr = mr;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.4 RP Cause */
+ ret->cause[0] = 1 /*len*/;
+ ret->cause[1] = cause;
+
+ /* 3GPP TS 24.011 ==> 8.2.5.3 RP-User data element */
+ if(tpdu && (ret->udata = tsk_buffer_create_null())) {
+ tsms_tpdu_message_serialize(tpdu, ret->udata, MobOrig);
+ }
bail:
- return ret;
+ return ret;
}
//
@@ -577,35 +574,34 @@ bail:
//
static tsk_object_t* tsms_rpdu_error_ctor(tsk_object_t * self, va_list * app)
{
- tsms_rpdu_error_t *error = self;
- if(error){
- TSMS_RPDU_MESSAGE(error)->mti = tsms_rpdu_type_error_mo;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ tsms_rpdu_error_t *error = self;
+ if(error) {
+ TSMS_RPDU_MESSAGE(error)->mti = tsms_rpdu_type_error_mo;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_rpdu_error_dtor(tsk_object_t * self)
-{
- tsms_rpdu_error_t *error = self;
- if(error){
- TSK_OBJECT_SAFE_FREE(error->udata);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
-
- return self;
+{
+ tsms_rpdu_error_t *error = self;
+ if(error) {
+ TSK_OBJECT_SAFE_FREE(error->udata);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+
+ return self;
}
-static const tsk_object_def_t tsms_rpdu_error_def_s =
-{
- sizeof(tsms_rpdu_error_t),
- tsms_rpdu_error_ctor,
- tsms_rpdu_error_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_rpdu_error_def_s = {
+ sizeof(tsms_rpdu_error_t),
+ tsms_rpdu_error_ctor,
+ tsms_rpdu_error_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_rpdu_error_def_t = &tsms_rpdu_error_def_s;
diff --git a/tinySMS/src/tpdu/tsms_tpdu_command.c b/tinySMS/src/tpdu/tsms_tpdu_command.c
index 4733edc..7d84f12 100755
--- a/tinySMS/src/tpdu/tsms_tpdu_command.c
+++ b/tinySMS/src/tpdu/tsms_tpdu_command.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,153 +39,153 @@
/** internal function used to deserialse a SMS-COMMAND message from binary content. */
tsms_tpdu_message_t* _tsms_tpdu_command_deserialize(const void* data, tsk_size_t size)
{
- /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
- tsms_tpdu_command_t* self = tsms_tpdu_command_create(0, tsk_null, tsk_null, 0, tsms_tpdu_cmd_rel);
- tsk_bool_t failed = tsk_false;
- tsk_size_t any_len;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
-
- /* SMSC address */
+ /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
+ tsms_tpdu_command_t* self = tsms_tpdu_command_create(0, tsk_null, tsk_null, 0, tsms_tpdu_cmd_rel);
+ tsk_bool_t failed = tsk_false;
+ tsk_size_t any_len;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-COMMAND == Failed to parse SMSC address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
+ if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-COMMAND == Failed to parse SMSC address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
#endif
- /* SMS-COMMAND first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Request(1b)
-
- +----+----+----+----+----+----+----+----+
- | |UDHI|SRR | | | | MTI |
- +----+----+----+----+----+----+----+----+
- */
- TSMS_TPDU_MESSAGE(self)->mti = (*pdata & 0x03);
- self->srr = (*pdata & 0x20)>>5,
- self->udhi = (*pdata & 0x40)>>6;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
- * 1o */
- self->mr = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->pid = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.19 TP-Command-Type (TP-CT)
- * 1o */
- self->ct = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.18 TP-Message-Number (TP-MN)
- * 1o */
- self->mn = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
- if(!(self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse DA address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.20 TP Command Data Length (TP CDL)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->udl = *pdata;
- pdata++;
-
- /* 3GPP TS 23.040 ==> 9.2.3.21 TP Command Data (TP CD) */
- if((pend-pdata) > 0){
- TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
- }
-
- bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_TPDU_MESSAGE(self);
+ /* SMS-COMMAND first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Request(1b)
+
+ +----+----+----+----+----+----+----+----+
+ | |UDHI|SRR | | | | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ TSMS_TPDU_MESSAGE(self)->mti = (*pdata & 0x03);
+ self->srr = (*pdata & 0x20)>>5,
+ self->udhi = (*pdata & 0x40)>>6;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
+ * 1o */
+ self->mr = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->pid = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.19 TP-Command-Type (TP-CT)
+ * 1o */
+ self->ct = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.18 TP-Message-Number (TP-MN)
+ * 1o */
+ self->mn = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
+ if(!(self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse DA address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.20 TP Command Data Length (TP CDL)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->udl = *pdata;
+ pdata++;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.21 TP Command Data (TP CD) */
+ if((pend-pdata) > 0) {
+ TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
+ }
+
+bail:
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_TPDU_MESSAGE(self);
}
/** internal function used to serialize a SMS-COMMAND message as binary content. */
int _tsms_tpdu_command_serialize(const tsms_tpdu_command_t* self, tsk_buffer_t* output)
{
- uint8_t _1byte;
+ uint8_t _1byte;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- /* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- tsms_address_serialize(self->smsc, output);
+ tsms_address_serialize(self->smsc, output);
#endif
- /* SMS-COMMAND first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Request(1b)
-
- +----+----+----+----+----+----+----+----+
- | |UDHI|SRR | | | | MTI |
- +----+----+----+----+----+----+----+----+
- */
- _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
- _1byte |=
- /*1b*/
- /*2b*/
- ((uint8_t)self->srr) << 5 /*1b*/
- | ((uint8_t)self->udhi) << 6; /*1b*/
- tsk_buffer_append(output, &_1byte, 1);
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
- tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.19 TP-Command-Type (TP-CT) */
- tsk_buffer_append(output, &self->ct, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.18 TP-Message-Number (TP-MN) */
- tsk_buffer_append(output, &self->mn, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
- tsms_address_serialize(self->da, output);
-
- /* 3GPP TS 23.040 ==> 9.2.3.20 TP Command Data Length (TP CDL) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.21 TP Command Data (TP CD) */
- tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
-
- return 0;
+ /* SMS-COMMAND first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Request(1b)
+
+ +----+----+----+----+----+----+----+----+
+ | |UDHI|SRR | | | | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
+ _1byte |=
+ /*1b*/
+ /*2b*/
+ ((uint8_t)self->srr) << 5 /*1b*/
+ | ((uint8_t)self->udhi) << 6; /*1b*/
+ tsk_buffer_append(output, &_1byte, 1);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
+ tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.19 TP-Command-Type (TP-CT) */
+ tsk_buffer_append(output, &self->ct, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.18 TP-Message-Number (TP-MN) */
+ tsk_buffer_append(output, &self->mn, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
+ tsms_address_serialize(self->da, output);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.20 TP Command Data Length (TP CDL) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.21 TP Command Data (TP CD) */
+ tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
+
+ return 0;
}
/**@ingroup tsms_tpdu_group
@@ -195,15 +195,15 @@ int _tsms_tpdu_command_serialize(const tsms_tpdu_command_t* self, tsk_buffer_t*
* @param mr TP-Message-Reference (TP-MR) as per 3GPP TS 23.040 section 9.2.3.6.
* @param smsc The address of the SMSC. e.g. "+331253688".
* @param dest The address of the destination. e.g. "+331253688".
-* @param msg_num The message number. For more information, please refer to 3GPP TS 23.040 section 9.2.3.18 (TP-MN).
+* @param msg_num The message number. For more information, please refer to 3GPP TS 23.040 section 9.2.3.18 (TP-MN).
* @param cmd The command type as per 3GPP TS 23.040 v910 section 9.2.3.19 (TP-CT).
* @retval SMS-COMMAND message.
*
* See For more information, see @ref tsms_tpdu_group_COMMAND "SMS-COMMAND".
*/
tsms_tpdu_command_t* tsms_tpdu_command_create(uint8_t mr, const tsms_address_string_t smsc, const tsms_address_string_t dest, uint8_t msg_num, tsms_tpdu_cmd_t cmd)
-{
- return tsk_object_new(tsms_tpdu_command_def_t, mr, smsc, dest, msg_num, cmd);
+{
+ return tsk_object_new(tsms_tpdu_command_def_t, mr, smsc, dest, msg_num, cmd);
}
@@ -213,63 +213,62 @@ tsms_tpdu_command_t* tsms_tpdu_command_create(uint8_t mr, const tsms_address_str
//
static tsk_object_t* tsms_tpdu_command_ctor(tsk_object_t * self, va_list * app)
{
- tsms_tpdu_command_t *command = self;
- if(command){
- const char* smsc, *dest;
- uint8_t mr, msg_num;
- tsms_tpdu_cmd_t cmd;
-
+ tsms_tpdu_command_t *command = self;
+ if(command) {
+ const char* smsc, *dest;
+ uint8_t mr, msg_num;
+ tsms_tpdu_cmd_t cmd;
+
#if defined(__GNUC__)
- mr = (uint8_t)va_arg(*app, unsigned);
+ mr = (uint8_t)va_arg(*app, unsigned);
#else
- mr = va_arg(*app, uint8_t);
+ mr = va_arg(*app, uint8_t);
#endif
- smsc = va_arg(*app, const char*);
- dest = va_arg(*app, const char*);
+ smsc = va_arg(*app, const char*);
+ dest = va_arg(*app, const char*);
#if defined(__GNUC__)
- msg_num = (uint8_t)va_arg(*app, unsigned);
+ msg_num = (uint8_t)va_arg(*app, unsigned);
#else
- msg_num = va_arg(*app, uint8_t);
+ msg_num = va_arg(*app, uint8_t);
#endif
- cmd = va_arg(*app, tsms_tpdu_cmd_t);
-
- /* init base*/
- tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(command), tsms_tpdu_mti_command_mo);
- /* init self */
- command->mr = mr;
- if(smsc){
- command->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
- }
- if(dest){
- command->da = tsms_address_da_create((const uint8_t*)dest);
- }
- command->mn = msg_num;
- command->ct = cmd;
- }
- return self;
+ cmd = va_arg(*app, tsms_tpdu_cmd_t);
+
+ /* init base*/
+ tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(command), tsms_tpdu_mti_command_mo);
+ /* init self */
+ command->mr = mr;
+ if(smsc) {
+ command->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
+ }
+ if(dest) {
+ command->da = tsms_address_da_create((const uint8_t*)dest);
+ }
+ command->mn = msg_num;
+ command->ct = cmd;
+ }
+ return self;
}
static tsk_object_t* tsms_tpdu_command_dtor(tsk_object_t * self)
-{
- tsms_tpdu_command_t *command = self;
- if(command){
- /*deinit base*/
- tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(command));
- /*deinit self*/
- TSK_OBJECT_SAFE_FREE(command->smsc);
- TSK_OBJECT_SAFE_FREE(command->da);
- }
-
- return self;
+{
+ tsms_tpdu_command_t *command = self;
+ if(command) {
+ /*deinit base*/
+ tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(command));
+ /*deinit self*/
+ TSK_OBJECT_SAFE_FREE(command->smsc);
+ TSK_OBJECT_SAFE_FREE(command->da);
+ }
+
+ return self;
}
-static const tsk_object_def_t tsms_tpdu_command_def_s =
-{
- sizeof(tsms_tpdu_command_t),
- tsms_tpdu_command_ctor,
- tsms_tpdu_command_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_tpdu_command_def_s = {
+ sizeof(tsms_tpdu_command_t),
+ tsms_tpdu_command_ctor,
+ tsms_tpdu_command_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_tpdu_command_def_t = &tsms_tpdu_command_def_s;
diff --git a/tinySMS/src/tpdu/tsms_tpdu_deliver.c b/tinySMS/src/tpdu/tsms_tpdu_deliver.c
index afc4086..327cb04 100755
--- a/tinySMS/src/tpdu/tsms_tpdu_deliver.c
+++ b/tinySMS/src/tpdu/tsms_tpdu_deliver.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,153 +43,153 @@
/** internal function used to deserialize a buffer containing a SMS-DELIVER message. */
tsms_tpdu_message_t* _tsms_tpdu_deliver_deserialize(const void* data, tsk_size_t size)
{
- /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
- tsms_tpdu_deliver_t* self = tsms_tpdu_deliver_create(tsk_null, tsk_null);
- tsk_bool_t failed = tsk_false;
- tsk_size_t any_len;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
-
- /* SMSC address */
+ /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
+ tsms_tpdu_deliver_t* self = tsms_tpdu_deliver_create(tsk_null, tsk_null);
+ tsk_bool_t failed = tsk_false;
+ tsk_size_t any_len;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse SMSC address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
+ if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse SMSC address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
#endif
- /* SMS-DELIVER first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-More-Messages-to-Send(1b)
- - TP-Loop-Prevention(1b)
- - TP-Reply-Path(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Indication(1b)
- +----+----+----+----+----+----+----+----+
- | RP|UDHI|SRI | |LP |MMS | MTI |
- +----+----+----+----+----+----+----+----+
- */
- TSMS_TPDU_MESSAGE(self)->mti = (*pdata & 0x03);
- self->mms = (*pdata & 0x04)>>2,
- self->lp = (*pdata & 0x08)>>3,
- self->sri = (*pdata & 0x20)>>5,
- self->udhi = (*pdata & 0x40)>>6,
- self->rp = (*pdata & 0x80)>>7;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> TP-Originating-Address (TP-OA)*/
- if(!(self->oa = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_oa, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse OA address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->pid = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
- * 7o */
- if((pend - pdata)<=7){
- TSMS_ERROR_TOO_SHORT();
- }
- memcpy(self->scts, pdata, 7);
- pdata += 7;
-
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->udl = *pdata;
- pdata++;
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- if((pend-pdata) > 0){
- TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
- }
-
- bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_TPDU_MESSAGE(self);
+ /* SMS-DELIVER first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-More-Messages-to-Send(1b)
+ - TP-Loop-Prevention(1b)
+ - TP-Reply-Path(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Indication(1b)
+ +----+----+----+----+----+----+----+----+
+ | RP|UDHI|SRI | |LP |MMS | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ TSMS_TPDU_MESSAGE(self)->mti = (*pdata & 0x03);
+ self->mms = (*pdata & 0x04)>>2,
+ self->lp = (*pdata & 0x08)>>3,
+ self->sri = (*pdata & 0x20)>>5,
+ self->udhi = (*pdata & 0x40)>>6,
+ self->rp = (*pdata & 0x80)>>7;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> TP-Originating-Address (TP-OA)*/
+ if(!(self->oa = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_oa, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse OA address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->pid = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
+ * 7o */
+ if((pend - pdata)<=7) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ memcpy(self->scts, pdata, 7);
+ pdata += 7;
+
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->udl = *pdata;
+ pdata++;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ if((pend-pdata) > 0) {
+ TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
+ }
+
+bail:
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_TPDU_MESSAGE(self);
}
/** internal function used to serialize a SMS-DELIVER message. */
int _tsms_tpdu_deliver_serialize(const tsms_tpdu_deliver_t* self, tsk_buffer_t* output)
{
- uint8_t _1byte;
+ uint8_t _1byte;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
-/* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- tsms_address_serialize(self->smsc, output);
+ tsms_address_serialize(self->smsc, output);
#endif
- /* SMS-DELIVER first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-More-Messages-to-Send(1b)
- - TP-Loop-Prevention(1b)
- - TP-Reply-Path(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Indication(1b)
- +----+----+----+----+----+----+----+----+
- | RP|UDHI|SRI | |LP |MMS | MTI |
- +----+----+----+----+----+----+----+----+
- */
- _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
- _1byte |= ((uint8_t)self->mms) << 2 /*1b*/
- | ((uint8_t)self->lp) << 3 /*1b*/
- /*1b (unused)*/
- | ((uint8_t)self->sri) << 5 /*1b*/
- | ((uint8_t)self->udhi) << 6 /*1b*/
- | ((uint8_t)self->rp) << 7; /*1b*/
- tsk_buffer_append(output, &_1byte, 1);
-
- /* 3GPP TS 23.040 ==> TP-Originating-Address (TP-OA)*/
- tsms_address_serialize(self->oa, output);
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)*/
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)*/
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)*/
- tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
-
- return 0;
+ /* SMS-DELIVER first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-More-Messages-to-Send(1b)
+ - TP-Loop-Prevention(1b)
+ - TP-Reply-Path(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Indication(1b)
+ +----+----+----+----+----+----+----+----+
+ | RP|UDHI|SRI | |LP |MMS | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
+ _1byte |= ((uint8_t)self->mms) << 2 /*1b*/
+ | ((uint8_t)self->lp) << 3 /*1b*/
+ /*1b (unused)*/
+ | ((uint8_t)self->sri) << 5 /*1b*/
+ | ((uint8_t)self->udhi) << 6 /*1b*/
+ | ((uint8_t)self->rp) << 7; /*1b*/
+ tsk_buffer_append(output, &_1byte, 1);
+
+ /* 3GPP TS 23.040 ==> TP-Originating-Address (TP-OA)*/
+ tsms_address_serialize(self->oa, output);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)*/
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)*/
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)*/
+ tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
+
+ return 0;
}
/**@ingroup tsms_tpdu_group
@@ -204,14 +204,14 @@ int _tsms_tpdu_deliver_serialize(const tsms_tpdu_deliver_t* self, tsk_buffer_t*
*/
tsms_tpdu_deliver_t* tsms_tpdu_deliver_create(const tsms_address_string_t smsc, const tsms_address_string_t orig)
{
- tsms_tpdu_deliver_t* ret = tsk_null;
-
- if(!(ret = tsk_object_new(tsms_tpdu_deliver_def_t, smsc, orig))){
- goto bail;
- }
-
+ tsms_tpdu_deliver_t* ret = tsk_null;
+
+ if(!(ret = tsk_object_new(tsms_tpdu_deliver_def_t, smsc, orig))) {
+ goto bail;
+ }
+
bail:
- return ret;
+ return ret;
}
//=================================================================================================
@@ -219,45 +219,44 @@ bail:
//
static tsk_object_t* tsms_tpdu_deliver_ctor(tsk_object_t * self, va_list * app)
{
- tsms_tpdu_deliver_t *deliver = self;
- if(deliver){
- const char* smsc, *orig;
-
- smsc = va_arg(*app, const char*);
- orig = va_arg(*app, const char*);
-
- /* init base*/
- tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(deliver), tsms_tpdu_mti_deliver_mt);
- /* init self */
- deliver->mms = TSMS_TPDU_DEFAULT_MMS;
- if(smsc){
- deliver->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
- }
- if(orig){
- deliver->oa = tsms_address_oa_create((const uint8_t*)orig);
- }
- }
- return self;
+ tsms_tpdu_deliver_t *deliver = self;
+ if(deliver) {
+ const char* smsc, *orig;
+
+ smsc = va_arg(*app, const char*);
+ orig = va_arg(*app, const char*);
+
+ /* init base*/
+ tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(deliver), tsms_tpdu_mti_deliver_mt);
+ /* init self */
+ deliver->mms = TSMS_TPDU_DEFAULT_MMS;
+ if(smsc) {
+ deliver->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
+ }
+ if(orig) {
+ deliver->oa = tsms_address_oa_create((const uint8_t*)orig);
+ }
+ }
+ return self;
}
static tsk_object_t* tsms_tpdu_deliver_dtor(tsk_object_t * self)
-{
- tsms_tpdu_deliver_t *deliver = self;
- if(deliver){
- /*deinit base*/
- tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(deliver));
- /*deinit self*/
- TSK_OBJECT_SAFE_FREE(deliver->oa);
- TSK_OBJECT_SAFE_FREE(deliver->smsc);
- }
- return self;
+{
+ tsms_tpdu_deliver_t *deliver = self;
+ if(deliver) {
+ /*deinit base*/
+ tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(deliver));
+ /*deinit self*/
+ TSK_OBJECT_SAFE_FREE(deliver->oa);
+ TSK_OBJECT_SAFE_FREE(deliver->smsc);
+ }
+ return self;
}
-static const tsk_object_def_t tsms_tpdu_deliver_def_s =
-{
- sizeof(tsms_tpdu_deliver_t),
- tsms_tpdu_deliver_ctor,
- tsms_tpdu_deliver_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_tpdu_deliver_def_s = {
+ sizeof(tsms_tpdu_deliver_t),
+ tsms_tpdu_deliver_ctor,
+ tsms_tpdu_deliver_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_tpdu_deliver_def_t = &tsms_tpdu_deliver_def_s;
diff --git a/tinySMS/src/tpdu/tsms_tpdu_report.c b/tinySMS/src/tpdu/tsms_tpdu_report.c
index 73f6132..1a2ce9d 100755
--- a/tinySMS/src/tpdu/tsms_tpdu_report.c
+++ b/tinySMS/src/tpdu/tsms_tpdu_report.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,187 +42,187 @@
tsms_tpdu_message_t* _tsms_tpdu_report_deserialize_2(const void* data, tsk_size_t size, tsk_bool_t error)
{
- /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
- tsms_tpdu_report_t* self = tsms_tpdu_report_create(tsk_null, tsk_false, error);
- tsk_bool_t failed = tsk_false;
+ /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
+ tsms_tpdu_report_t* self = tsms_tpdu_report_create(tsk_null, tsk_false, error);
+ tsk_bool_t failed = tsk_false;
// tsk_size_t any_len;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
- /* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC && 0
- if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse SMSC address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
+ if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-DELIVER == Failed to parse SMSC address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
#endif
- /* SMS-DELIVER-REPORT/MS-SUBMIT-REPORT (both ACK and ERROR) first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-User-Data-Header-Indication(1b)
-
- +----+----+----+----+----+----+----+----+
- | |UDHI| | | | | MTI |
- +----+----+----+----+----+----+----+----+
- */
- TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
- self->udhi = (*pdata & 0x40)>>6;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- if(self->error){ /* FIXME ==> should comes from RP layer */
- /* 3GPP TS 23.040 ==> 9.2.3.22 TP-Failure-Cause(TP-FCS) */
- //tsk_buffer_append(output, &self->fcs, 1); /*0x00-0xFF ==> 1o*/
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
- * 1o
- bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
- Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
- */
- self->pi = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- if(TSMS_TPDU_MESSAGE(self)->mti == tsms_tpdu_mti_submit_report_mt){
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
- * 7o */
- if((pend - pdata)<7){
- TSMS_ERROR_TOO_SHORT();
- }
- memcpy(self->scts, pdata, 7);
- pdata += 7;
- }
-
- if(self->pi & 0x01){ /* bit 0 */
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->pid = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- if(self->pi & 0x02){ /* bit 1 */
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- if(self->pi & 0x04){ /* bit 2 */
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->udl = *pdata;
- pdata++;
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- if((pend-pdata) > 0){
- TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
- }
- }
+ /* SMS-DELIVER-REPORT/MS-SUBMIT-REPORT (both ACK and ERROR) first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-User-Data-Header-Indication(1b)
+
+ +----+----+----+----+----+----+----+----+
+ | |UDHI| | | | | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
+ self->udhi = (*pdata & 0x40)>>6;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ if(self->error) { /* FIXME ==> should comes from RP layer */
+ /* 3GPP TS 23.040 ==> 9.2.3.22 TP-Failure-Cause(TP-FCS) */
+ //tsk_buffer_append(output, &self->fcs, 1); /*0x00-0xFF ==> 1o*/
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
+ * 1o
+ bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
+ Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
+ */
+ self->pi = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ if(TSMS_TPDU_MESSAGE(self)->mti == tsms_tpdu_mti_submit_report_mt) {
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
+ * 7o */
+ if((pend - pdata)<7) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ memcpy(self->scts, pdata, 7);
+ pdata += 7;
+ }
+
+ if(self->pi & 0x01) { /* bit 0 */
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->pid = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ if(self->pi & 0x02) { /* bit 1 */
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ if(self->pi & 0x04) { /* bit 2 */
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->udl = *pdata;
+ pdata++;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ if((pend-pdata) > 0) {
+ TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
+ }
+ }
bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_TPDU_MESSAGE(self);
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_TPDU_MESSAGE(self);
}
tsms_tpdu_message_t* _tsms_tpdu_report_deserialize(const void* data, tsk_size_t size)
{
- return _tsms_tpdu_report_deserialize_2(data, size, tsk_false);
+ return _tsms_tpdu_report_deserialize_2(data, size, tsk_false);
}
int _tsms_tpdu_report_serialize(const tsms_tpdu_report_t* self, tsk_buffer_t* output)
{
- uint8_t _1byte;
+ uint8_t _1byte;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- /* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- tsms_address_serialize(self->smsc, output);
+ tsms_address_serialize(self->smsc, output);
#endif
- /* SMS-DELIVER-REPORT/MS-SUBMIT-REPORT (both ACK and ERROR) first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-User-Data-Header-Indication(1b)
-
- +----+----+----+----+----+----+----+----+
- | |UDHI| | | | | MTI |
- +----+----+----+----+----+----+----+----+
- */
- _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
- _1byte |= ((uint8_t)self->udhi) << 6; /*1b*/
- tsk_buffer_append(output, &_1byte, 1);
-
- if(self->error){
- /* 3GPP TS 23.040 ==> 9.2.3.22 TP-Failure-Cause(TP-FCS) */
- tsk_buffer_append(output, &self->fcs, 1); /*0x00-0xFF ==> 1o*/
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
- bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
- Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
- As we are the serializer, we know which field should be added or not ==> append our own TP-PI field
- */
- _1byte = self->pi | 0x07 /* Bits 2,1 and 0 to '1' */;
- tsk_buffer_append(output, &_1byte, 1); /* 1o*/
-
- if(TSMS_TPDU_MESSAGE(self)->mti == tsms_tpdu_mti_submit_report_mt){
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS) */
- tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
-
- return 0;
+ /* SMS-DELIVER-REPORT/MS-SUBMIT-REPORT (both ACK and ERROR) first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-User-Data-Header-Indication(1b)
+
+ +----+----+----+----+----+----+----+----+
+ | |UDHI| | | | | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
+ _1byte |= ((uint8_t)self->udhi) << 6; /*1b*/
+ tsk_buffer_append(output, &_1byte, 1);
+
+ if(self->error) {
+ /* 3GPP TS 23.040 ==> 9.2.3.22 TP-Failure-Cause(TP-FCS) */
+ tsk_buffer_append(output, &self->fcs, 1); /*0x00-0xFF ==> 1o*/
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
+ bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
+ Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
+ As we are the serializer, we know which field should be added or not ==> append our own TP-PI field
+ */
+ _1byte = self->pi | 0x07 /* Bits 2,1 and 0 to '1' */;
+ tsk_buffer_append(output, &_1byte, 1); /* 1o*/
+
+ if(TSMS_TPDU_MESSAGE(self)->mti == tsms_tpdu_mti_submit_report_mt) {
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS) */
+ tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
+
+ return 0;
}
tsms_tpdu_report_t* tsms_tpdu_report_create(const tsms_address_string_t smsc, tsk_bool_t submit, tsk_bool_t error)
{
- tsms_tpdu_report_t* ret = tsk_null;
-
- if(!(ret = tsk_object_new(tsms_tpdu_report_def_t, smsc, submit, error))){
- goto bail;
- }
-
+ tsms_tpdu_report_t* ret = tsk_null;
+
+ if(!(ret = tsk_object_new(tsms_tpdu_report_def_t, smsc, submit, error))) {
+ goto bail;
+ }
+
bail:
- return ret;
+ return ret;
}
int tsms_tpdu_report_set_fcs(tsms_tpdu_report_t* self, uint8_t code)
{
- if(self){
- tsms_tpdu_report_t* report = self;
- report->fcs = code;
- return 0;
- }
- return -1;
+ if(self) {
+ tsms_tpdu_report_t* report = self;
+ report->fcs = code;
+ return 0;
+ }
+ return -1;
}
//=================================================================================================
@@ -230,55 +230,54 @@ int tsms_tpdu_report_set_fcs(tsms_tpdu_report_t* self, uint8_t code)
//
static tsk_object_t* tsms_tpdu_report_ctor(tsk_object_t * self, va_list * app)
{
- tsms_tpdu_report_t *report = self;
- if(report){
- const char* smsc;
- tsk_bool_t error, submit;
-
- smsc = va_arg(*app, const char*);
- submit = va_arg(*app, tsk_bool_t);
- error = va_arg(*app, tsk_bool_t);
-
- /* init base*/
- tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(report), submit?tsms_tpdu_mti_submit_report_mt
- :tsms_tpdu_mti_deliver_report_mo);
- /* init self */
- if(smsc){
- report->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
- }
- report->error = error;
-
- /*init self*/
- if(report->error){
- report->fcs = TSMS_TPDU_DEFAULT_FCS;
- }
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ tsms_tpdu_report_t *report = self;
+ if(report) {
+ const char* smsc;
+ tsk_bool_t error, submit;
+
+ smsc = va_arg(*app, const char*);
+ submit = va_arg(*app, tsk_bool_t);
+ error = va_arg(*app, tsk_bool_t);
+
+ /* init base*/
+ tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(report), submit?tsms_tpdu_mti_submit_report_mt
+ :tsms_tpdu_mti_deliver_report_mo);
+ /* init self */
+ if(smsc) {
+ report->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
+ }
+ report->error = error;
+
+ /*init self*/
+ if(report->error) {
+ report->fcs = TSMS_TPDU_DEFAULT_FCS;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_tpdu_report_dtor(tsk_object_t * self)
-{
- tsms_tpdu_report_t *report = self;
- if(report){
- /*deinit base*/
- tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(report));
- /*deinit self*/
- TSK_OBJECT_SAFE_FREE(report->smsc);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+{
+ tsms_tpdu_report_t *report = self;
+ if(report) {
+ /*deinit base*/
+ tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(report));
+ /*deinit self*/
+ TSK_OBJECT_SAFE_FREE(report->smsc);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
-static const tsk_object_def_t tsms_tpdu_report_def_s =
-{
- sizeof(tsms_tpdu_report_t),
- tsms_tpdu_report_ctor,
- tsms_tpdu_report_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_tpdu_report_def_s = {
+ sizeof(tsms_tpdu_report_t),
+ tsms_tpdu_report_ctor,
+ tsms_tpdu_report_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_tpdu_report_def_t = &tsms_tpdu_report_def_s;
diff --git a/tinySMS/src/tpdu/tsms_tpdu_status_report.c b/tinySMS/src/tpdu/tsms_tpdu_status_report.c
index 5c08b1b..b7691b0 100755
--- a/tinySMS/src/tpdu/tsms_tpdu_status_report.c
+++ b/tinySMS/src/tpdu/tsms_tpdu_status_report.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,194 +43,194 @@
/** internal function used to deserialize a SMS-STATUS-REPORT message from a binary buffer. */
tsms_tpdu_message_t* _tsms_tpdu_status_report_deserialize(const void* data, tsk_size_t size)
{
- /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
- tsms_tpdu_status_report_t* self = tsms_tpdu_status_report_create(0, tsk_null, tsk_null, tsms_tpdu_status_received, tsk_false);
- tsk_bool_t failed = tsk_false;
- tsk_size_t any_len;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
-
- /* SMSC address */
+ /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
+ tsms_tpdu_status_report_t* self = tsms_tpdu_status_report_create(0, tsk_null, tsk_null, tsms_tpdu_status_received, tsk_false);
+ tsk_bool_t failed = tsk_false;
+ tsk_size_t any_len;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-STATUS-REPORT == Failed to parse SMSC address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
+ if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-STATUS-REPORT == Failed to parse SMSC address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
#endif
- /* SMS-STATUS-REPORT first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-More-Messages-to-Send(1b)
- - TP-Loop-Prevention(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Qualifier(1b)
- +----+----+----+----+----+----+----+----+
- | |UDHI| SRQ| |LP |MMS | MTI |
- +----+----+----+----+----+----+----+----+
- */
- TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
- self->mms = (*pdata & 0x04)>>2,
- self->lp = (*pdata & 0x08)>>3,
- self->srq = (*pdata & 0x20)>>5,
- self->udhi = (*pdata & 0x40)>>6;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
- * 1o */
- self->mr = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> xxxx TP-Recipient-Address (TP-RA) */
- if(!(self->ra = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-STATUS-REPORT == Failed to parse RA address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
- * 7o */
- if((pend - pdata)<=7){
- TSMS_ERROR_TOO_SHORT();
- }
- memcpy(self->scts, pdata, 7);
- pdata += 7;
-
- /* 3GPP TS 23.040 ==> xxxx TP Discharge Time(TP-DT)
- * 7o */
- if((pend - pdata)<=7){
- TSMS_ERROR_TOO_SHORT();
- }
- memcpy(self->dt, pdata, 7);
- pdata += 7;
-
- /* 3GPP TS 23.040 ==> 9.2.3.15 TP Status(TP-ST)
- * 1o */
- self->st = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> xxxx TP-Parameter-Indicator (TP-PI)
- * 1o */
- self->pi = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->pid = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->udl = *pdata;
- pdata++;
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- if((pend-pdata) > 0){
- TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
- }
-
- bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_TPDU_MESSAGE(self);
+ /* SMS-STATUS-REPORT first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-More-Messages-to-Send(1b)
+ - TP-Loop-Prevention(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Qualifier(1b)
+ +----+----+----+----+----+----+----+----+
+ | |UDHI| SRQ| |LP |MMS | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
+ self->mms = (*pdata & 0x04)>>2,
+ self->lp = (*pdata & 0x08)>>3,
+ self->srq = (*pdata & 0x20)>>5,
+ self->udhi = (*pdata & 0x40)>>6;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
+ * 1o */
+ self->mr = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> xxxx TP-Recipient-Address (TP-RA) */
+ if(!(self->ra = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-STATUS-REPORT == Failed to parse RA address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS)
+ * 7o */
+ if((pend - pdata)<=7) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ memcpy(self->scts, pdata, 7);
+ pdata += 7;
+
+ /* 3GPP TS 23.040 ==> xxxx TP Discharge Time(TP-DT)
+ * 7o */
+ if((pend - pdata)<=7) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ memcpy(self->dt, pdata, 7);
+ pdata += 7;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.15 TP Status(TP-ST)
+ * 1o */
+ self->st = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> xxxx TP-Parameter-Indicator (TP-PI)
+ * 1o */
+ self->pi = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->pid = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->udl = *pdata;
+ pdata++;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ if((pend-pdata) > 0) {
+ TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
+ }
+
+bail:
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_TPDU_MESSAGE(self);
}
/* internal function used to serialize a SMS-STATUS-REPORT to binary content. */
int _tsms_tpdu_status_report_serialize(const tsms_tpdu_status_report_t* self, tsk_buffer_t* output)
{
- uint8_t _1byte;
+ uint8_t _1byte;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- /* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- tsms_address_serialize(self->smsc, output);
+ tsms_address_serialize(self->smsc, output);
#endif
- /* SMS-STATUS-REPORT first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-More-Messages-to-Send(1b)
- - TP-Loop-Prevention(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Qualifier(1b)
- +----+----+----+----+----+----+----+----+
- | |UDHI| SRQ| |LP |MMS | MTI |
- +----+----+----+----+----+----+----+----+
- */
- _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
- _1byte |= ((uint8_t)self->mms) << 2 /*1b*/
- | ((uint8_t)self->lp) << 3 /*1b*/
- /*1b (unused)*/
- | ((uint8_t)self->srq) << 5 /*1b*/
- | ((uint8_t)self->udhi) << 6; /*1b*/
- tsk_buffer_append(output, &_1byte, 1);
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
- tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
-
- /* 3GPP TS 23.040 ==> xxxx TP-Recipient-Address (TP-RA) */
- tsms_address_serialize(self->ra, output);
-
- /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS) */
- tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
-
- /* 3GPP TS 23.040 ==> xxxx TP Discharge Time(TP-DT) */
- tsk_buffer_append(output, self->dt, sizeof(self->dt)); /*7o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.15 TP Status(TP-ST) */
- tsk_buffer_append(output, &self->st, 1); /*0-255 ==> 1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
- bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
- Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
- As we are the serializer, we know which field should be added or not ==> append our own TP-PI field
- */
- _1byte = self->pi | 0x07 /* Bits 2,1 and 0 to '1' */;
- tsk_buffer_append(output, &_1byte, 1); /* 1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
-
- return 0;
+ /* SMS-STATUS-REPORT first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-More-Messages-to-Send(1b)
+ - TP-Loop-Prevention(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Qualifier(1b)
+ +----+----+----+----+----+----+----+----+
+ | |UDHI| SRQ| |LP |MMS | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
+ _1byte |= ((uint8_t)self->mms) << 2 /*1b*/
+ | ((uint8_t)self->lp) << 3 /*1b*/
+ /*1b (unused)*/
+ | ((uint8_t)self->srq) << 5 /*1b*/
+ | ((uint8_t)self->udhi) << 6; /*1b*/
+ tsk_buffer_append(output, &_1byte, 1);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
+ tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
+
+ /* 3GPP TS 23.040 ==> xxxx TP-Recipient-Address (TP-RA) */
+ tsms_address_serialize(self->ra, output);
+
+ /* 3GPP TS 23.040 ==> TP-Service-Centre-Time-Stamp (TP-SCTS) */
+ tsk_buffer_append(output, self->scts, sizeof(self->scts)); /*7o*/
+
+ /* 3GPP TS 23.040 ==> xxxx TP Discharge Time(TP-DT) */
+ tsk_buffer_append(output, self->dt, sizeof(self->dt)); /*7o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.15 TP Status(TP-ST) */
+ tsk_buffer_append(output, &self->st, 1); /*0-255 ==> 1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.27 TP-Parameter-Indicator (TP-PI)
+ bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
+ Extension bit Reserved Reserved Reserved Reserved TP UDL TP DCS TP PID
+ As we are the serializer, we know which field should be added or not ==> append our own TP-PI field
+ */
+ _1byte = self->pi | 0x07 /* Bits 2,1 and 0 to '1' */;
+ tsk_buffer_append(output, &_1byte, 1); /* 1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
+
+ return 0;
}
/**@ingroup tsms_tpdu_group
@@ -249,14 +249,14 @@ int _tsms_tpdu_status_report_serialize(const tsms_tpdu_status_report_t* self, ts
*/
tsms_tpdu_status_report_t* tsms_tpdu_status_report_create(uint8_t mr, const tsms_address_string_t smsc, const tsms_address_string_t recipient, tsms_tpdu_status_type_t status, tsk_bool_t submit)
{
- tsms_tpdu_status_report_t* ret = tsk_null;
-
- if(!(ret = tsk_object_new(tsms_tpdu_status_report_def_t, mr, smsc, recipient, status))){
- goto bail;
- }
-
+ tsms_tpdu_status_report_t* ret = tsk_null;
+
+ if(!(ret = tsk_object_new(tsms_tpdu_status_report_def_t, mr, smsc, recipient, status))) {
+ goto bail;
+ }
+
bail:
- return ret;
+ return ret;
}
//=================================================================================================
@@ -264,64 +264,63 @@ bail:
//
static tsk_object_t* tsms_tpdu_status_report_ctor(tsk_object_t * self, va_list * app)
{
- tsms_tpdu_status_report_t *status_report = self;
- if(status_report){
- const char* smsc, *recipient;
- uint8_t mr;
- tsms_tpdu_status_type_t status;
- tsk_bool_t submit;
-
+ tsms_tpdu_status_report_t *status_report = self;
+ if(status_report) {
+ const char* smsc, *recipient;
+ uint8_t mr;
+ tsms_tpdu_status_type_t status;
+ tsk_bool_t submit;
+
#if defined(__GNUC__)
- mr = (uint8_t)va_arg(*app, unsigned);
+ mr = (uint8_t)va_arg(*app, unsigned);
#else
- mr = va_arg(*app, uint8_t);
+ mr = va_arg(*app, uint8_t);
#endif
- smsc = va_arg(*app, const char*);
- recipient = va_arg(*app, const char*);
- status = va_arg(*app, tsms_tpdu_status_type_t);
- submit = va_arg(*app, tsk_bool_t);
-
- /* init base*/
- tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(status_report), tsms_tpdu_mti_status_report_mt);
- /* init self */
- status_report->mr = mr;
- if(smsc){
- status_report->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
- }
- if(recipient){
- status_report->ra = tsms_address_da_create((const uint8_t*)recipient);
- }
- status_report->st = status;
- status_report->mms = TSMS_TPDU_DEFAULT_MMS;
- status_report->srq = submit?0:1/*SMS-COMAND*/;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ smsc = va_arg(*app, const char*);
+ recipient = va_arg(*app, const char*);
+ status = va_arg(*app, tsms_tpdu_status_type_t);
+ submit = va_arg(*app, tsk_bool_t);
+
+ /* init base*/
+ tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(status_report), tsms_tpdu_mti_status_report_mt);
+ /* init self */
+ status_report->mr = mr;
+ if(smsc) {
+ status_report->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
+ }
+ if(recipient) {
+ status_report->ra = tsms_address_da_create((const uint8_t*)recipient);
+ }
+ status_report->st = status;
+ status_report->mms = TSMS_TPDU_DEFAULT_MMS;
+ status_report->srq = submit?0:1/*SMS-COMAND*/;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_tpdu_status_report_dtor(tsk_object_t * self)
-{
- tsms_tpdu_status_report_t *status_report = self;
- if(status_report){
- /*deinit base*/
- tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(status_report));
- /*deinit self*/
- TSK_OBJECT_SAFE_FREE(status_report->smsc);
- TSK_OBJECT_SAFE_FREE(status_report->ra);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+{
+ tsms_tpdu_status_report_t *status_report = self;
+ if(status_report) {
+ /*deinit base*/
+ tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(status_report));
+ /*deinit self*/
+ TSK_OBJECT_SAFE_FREE(status_report->smsc);
+ TSK_OBJECT_SAFE_FREE(status_report->ra);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
-static const tsk_object_def_t tsms_tpdu_status_report_def_s =
-{
- sizeof(tsms_tpdu_status_report_t),
- tsms_tpdu_status_report_ctor,
- tsms_tpdu_status_report_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_tpdu_status_report_def_s = {
+ sizeof(tsms_tpdu_status_report_t),
+ tsms_tpdu_status_report_ctor,
+ tsms_tpdu_status_report_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_tpdu_status_report_def_t = &tsms_tpdu_status_report_def_s;
diff --git a/tinySMS/src/tpdu/tsms_tpdu_submit.c b/tinySMS/src/tpdu/tsms_tpdu_submit.c
index 22095c0..b5e36be 100755
--- a/tinySMS/src/tpdu/tsms_tpdu_submit.c
+++ b/tinySMS/src/tpdu/tsms_tpdu_submit.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,117 +44,120 @@
*/
tsms_tpdu_message_t* _tsms_tpdu_submit_deserialize(const void* data, tsk_size_t size)
{
- /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
- tsms_tpdu_submit_t* self = tsms_tpdu_submit_create(0, tsk_null, tsk_null);
- tsk_bool_t failed = tsk_false;
- tsk_size_t any_len;
- const uint8_t* pdata = data;
- const uint8_t* pend = pdata + size;
-
- /* SMSC address */
+ /* You don't need to test data and test, this is an internal function called by tsms_tpdu_message_deserialize() */
+ tsms_tpdu_submit_t* self = tsms_tpdu_submit_create(0, tsk_null, tsk_null);
+ tsk_bool_t failed = tsk_false;
+ tsk_size_t any_len;
+ const uint8_t* pdata = data;
+ const uint8_t* pend = pdata + size;
+
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-SUBMIT == Failed to parse SMSC address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
+ if(!(self->smsc = tsms_address_deserialize(data, size, tsms_addr_smsc, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-SUBMIT == Failed to parse SMSC address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
#endif
- /* SMS-SUBMIT first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-Reject-Duplicates(1b)
- - TP-Validity-Period-Format(1b)
- - TP-Reply-Path(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Request(1b)
-
- +----+----+----+----+----+----+----+----+
- |RP |UDHI|SRR |VPF | RD | MTI |
- +----+----+----+----+----+----+----+----+
- */
- TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
- self->rd = (*pdata & 0x04)>>2,
- self->vpf = (*pdata & 0x18)>>3,
- self->srr = (*pdata & 0x20)>>5,
- self->udhi = (*pdata & 0x40)>>6,
- self->rp = (*pdata & 0x80)>>7;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
- * 1o */
- self->mr = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
- if(!(self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len){
- TSK_DEBUG_ERROR("SMS-SUBMIT == Failed to parse DA address");
- failed = tsk_true;
- goto bail;
- }
- else{
- if((pdata += any_len) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->pid = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
- if((++pdata) >= pend){
- TSMS_ERROR_TOO_SHORT();
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.12 TP-Validity-Period
- * 1o for Relative format (9.2.3.12.1)
- * 7o for Absolute format (9.2.3.12.2)
- * 7o for Enhanced format (9.2.3.12.3)*/
- switch(self->vpf){
- case tsms_tpdu_vpf_relative:
- any_len = 1; break;
- case tsms_tpdu_vpf_enhanced:
- case tsms_tpdu_vpf_absolute:
- any_len = 7; break;
- default:
- case tsms_tpdu_vpf_not_present:
- any_len = 0; break;
- }
- if((tsk_size_t)(pend-pdata) <= any_len){
- TSMS_ERROR_TOO_SHORT();
- }
- memcpy(self->vp, pdata, any_len);
- pdata += any_len;
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
- * 1o */
- TSMS_TPDU_MESSAGE(self)->udl = *pdata;
- pdata++;
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- if((pend-pdata) > 0){
- TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
- }
+ /* SMS-SUBMIT first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-Reject-Duplicates(1b)
+ - TP-Validity-Period-Format(1b)
+ - TP-Reply-Path(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Request(1b)
+
+ +----+----+----+----+----+----+----+----+
+ |RP |UDHI|SRR |VPF | RD | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ TSMS_TPDU_MESSAGE(self)->mti = *pdata & 0x03;
+ self->rd = (*pdata & 0x04)>>2,
+ self->vpf = (*pdata & 0x18)>>3,
+ self->srr = (*pdata & 0x20)>>5,
+ self->udhi = (*pdata & 0x40)>>6,
+ self->rp = (*pdata & 0x80)>>7;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR)
+ * 1o */
+ self->mr = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
+ if(!(self->da = tsms_address_deserialize(pdata, (pend-pdata), tsms_addr_da, &any_len)) || !any_len) {
+ TSK_DEBUG_ERROR("SMS-SUBMIT == Failed to parse DA address");
+ failed = tsk_true;
+ goto bail;
+ }
+ else {
+ if((pdata += any_len) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->pid = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->dcs = *pdata;
+ if((++pdata) >= pend) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.12 TP-Validity-Period
+ * 1o for Relative format (9.2.3.12.1)
+ * 7o for Absolute format (9.2.3.12.2)
+ * 7o for Enhanced format (9.2.3.12.3)*/
+ switch(self->vpf) {
+ case tsms_tpdu_vpf_relative:
+ any_len = 1;
+ break;
+ case tsms_tpdu_vpf_enhanced:
+ case tsms_tpdu_vpf_absolute:
+ any_len = 7;
+ break;
+ default:
+ case tsms_tpdu_vpf_not_present:
+ any_len = 0;
+ break;
+ }
+ if((tsk_size_t)(pend-pdata) <= any_len) {
+ TSMS_ERROR_TOO_SHORT();
+ }
+ memcpy(self->vp, pdata, any_len);
+ pdata += any_len;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
+ * 1o */
+ TSMS_TPDU_MESSAGE(self)->udl = *pdata;
+ pdata++;
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ if((pend-pdata) > 0) {
+ TSMS_TPDU_MESSAGE(self)->ud = tsk_buffer_create(pdata, (pend-pdata));
+ }
bail:
- if(failed){
- TSK_OBJECT_SAFE_FREE(self);
- }
- return TSMS_TPDU_MESSAGE(self);
+ if(failed) {
+ TSK_OBJECT_SAFE_FREE(self);
+ }
+ return TSMS_TPDU_MESSAGE(self);
}
@@ -162,72 +165,72 @@ bail:
*/
int _tsms_tpdu_submit_serialize(const tsms_tpdu_submit_t* self, tsk_buffer_t* output)
{
- uint8_t _1byte;
+ uint8_t _1byte;
- if(!self){
- return -1;
- }
+ if(!self) {
+ return -1;
+ }
- /* SMSC address */
+ /* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
- tsms_address_serialize(self->smsc, output);
+ tsms_address_serialize(self->smsc, output);
#endif
- /* SMS-SUBMIT first Octect:
- - TP-Message-Type-Indicator(2b)
- - TP-Reject-Duplicates(1b)
- - TP-Validity-Period-Format(1b)
- - TP-Reply-Path(1b)
- - TP-User-Data-Header-Indicator(1b)
- - TP-Status-Report-Request(1b)
-
- +----+----+----+----+----+----+----+----+
- |RP |UDHI|SRR |VPF | RD | MTI |
- +----+----+----+----+----+----+----+----+
- */
- _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
- _1byte |= ((uint8_t)self->rd) << 2 /*1b*/
- | ((uint8_t)self->vpf) << 3 /*2b*/
- | ((uint8_t)self->srr) << 5 /*1b*/
- | ((uint8_t)self->udhi) << 6; /*1b*/
- tsk_buffer_append(output, &_1byte, 1);
-
- /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
- tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
- tsms_address_serialize(self->da, output);
-
- /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.12 TP-Validity-Period
- * 1o for Relative format (9.2.3.12.1)
- * 7o for Absolute format (9.2.3.12.2)
- * 7o for Enhanced format (9.2.3.12.3)*/
- switch(self->vpf){
- case tsms_tpdu_vpf_relative:
- tsk_buffer_append(output, &self->vp, 1);
- break;
- case tsms_tpdu_vpf_enhanced:
- case tsms_tpdu_vpf_absolute:
- tsk_buffer_append(output, &self->vp, 7);
- break;
- default:
- case tsms_tpdu_vpf_not_present:
- break;
- }
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
- tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
-
- return 0;
+ /* SMS-SUBMIT first Octect:
+ - TP-Message-Type-Indicator(2b)
+ - TP-Reject-Duplicates(1b)
+ - TP-Validity-Period-Format(1b)
+ - TP-Reply-Path(1b)
+ - TP-User-Data-Header-Indicator(1b)
+ - TP-Status-Report-Request(1b)
+
+ +----+----+----+----+----+----+----+----+
+ |RP |UDHI|SRR |VPF | RD | MTI |
+ +----+----+----+----+----+----+----+----+
+ */
+ _1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
+ _1byte |= ((uint8_t)self->rd) << 2 /*1b*/
+ | ((uint8_t)self->vpf) << 3 /*2b*/
+ | ((uint8_t)self->srr) << 5 /*1b*/
+ | ((uint8_t)self->udhi) << 6; /*1b*/
+ tsk_buffer_append(output, &_1byte, 1);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
+ tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
+ tsms_address_serialize(self->da, output);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->pid, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->dcs, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.12 TP-Validity-Period
+ * 1o for Relative format (9.2.3.12.1)
+ * 7o for Absolute format (9.2.3.12.2)
+ * 7o for Enhanced format (9.2.3.12.3)*/
+ switch(self->vpf) {
+ case tsms_tpdu_vpf_relative:
+ tsk_buffer_append(output, &self->vp, 1);
+ break;
+ case tsms_tpdu_vpf_enhanced:
+ case tsms_tpdu_vpf_absolute:
+ tsk_buffer_append(output, &self->vp, 7);
+ break;
+ default:
+ case tsms_tpdu_vpf_not_present:
+ break;
+ }
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL) */
+ tsk_buffer_append(output, &TSMS_TPDU_MESSAGE(self)->udl, 1); /*1o*/
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ tsk_buffer_append(output, TSK_BUFFER_DATA(TSMS_TPDU_MESSAGE(self)->ud), TSK_BUFFER_SIZE(TSMS_TPDU_MESSAGE(self)->ud));
+
+ return 0;
}
/**@ingroup tsms_tpdu_group
@@ -243,14 +246,14 @@ int _tsms_tpdu_submit_serialize(const tsms_tpdu_submit_t* self, tsk_buffer_t* ou
*/
tsms_tpdu_submit_t* tsms_tpdu_submit_create(uint8_t mr, const tsms_address_string_t smsc, const tsms_address_string_t dest)
{
- tsms_tpdu_submit_t* ret = tsk_null;
-
- if(!(ret = tsk_object_new(tsms_tpdu_submit_def_t, mr, smsc, dest))){
- goto bail;
- }
-
+ tsms_tpdu_submit_t* ret = tsk_null;
+
+ if(!(ret = tsk_object_new(tsms_tpdu_submit_def_t, mr, smsc, dest))) {
+ goto bail;
+ }
+
bail:
- return ret;
+ return ret;
}
//=================================================================================================
@@ -258,60 +261,59 @@ bail:
//
static tsk_object_t* tsms_tpdu_submit_ctor(tsk_object_t * self, va_list * app)
{
- tsms_tpdu_submit_t *submit = self;
- if(submit){
- const char* smsc, *dest;
- uint8_t mr;
-
+ tsms_tpdu_submit_t *submit = self;
+ if(submit) {
+ const char* smsc, *dest;
+ uint8_t mr;
+
#if defined(__GNUC__)
- mr = (uint8_t)va_arg(*app, unsigned);
+ mr = (uint8_t)va_arg(*app, unsigned);
#else
- mr = va_arg(*app, uint8_t);
+ mr = va_arg(*app, uint8_t);
#endif
- smsc = va_arg(*app, const char*);
- dest = va_arg(*app, const char*);
-
- /* init base*/
- tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(submit), tsms_tpdu_mti_submit_mo);
- /* init self */
- submit->mr = mr;
- if(smsc){
- submit->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
- }
- if(dest){
- submit->da = tsms_address_da_create((const uint8_t*)dest);
- }
-
- submit->vp[0] = TSMS_TPDU_DEFAULT_VP;
- submit->vpf = TSMS_TPDU_DEFAULT_VPF;
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+ smsc = va_arg(*app, const char*);
+ dest = va_arg(*app, const char*);
+
+ /* init base*/
+ tsms_tpdu_message_init(TSMS_TPDU_MESSAGE(submit), tsms_tpdu_mti_submit_mo);
+ /* init self */
+ submit->mr = mr;
+ if(smsc) {
+ submit->smsc = tsms_address_smsc_create((const uint8_t*)smsc);
+ }
+ if(dest) {
+ submit->da = tsms_address_da_create((const uint8_t*)dest);
+ }
+
+ submit->vp[0] = TSMS_TPDU_DEFAULT_VP;
+ submit->vpf = TSMS_TPDU_DEFAULT_VPF;
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
static tsk_object_t* tsms_tpdu_submit_dtor(tsk_object_t * self)
-{
- tsms_tpdu_submit_t *submit = self;
- if(submit){
- /*deinit base*/
- tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(submit));
- /*deinit self*/
- TSK_OBJECT_SAFE_FREE(submit->smsc);
- TSK_OBJECT_SAFE_FREE(submit->da);
- }
- else{
- TSK_DEBUG_ERROR("Null");
- }
- return self;
+{
+ tsms_tpdu_submit_t *submit = self;
+ if(submit) {
+ /*deinit base*/
+ tsms_tpdu_message_deinit(TSMS_TPDU_MESSAGE(submit));
+ /*deinit self*/
+ TSK_OBJECT_SAFE_FREE(submit->smsc);
+ TSK_OBJECT_SAFE_FREE(submit->da);
+ }
+ else {
+ TSK_DEBUG_ERROR("Null");
+ }
+ return self;
}
-static const tsk_object_def_t tsms_tpdu_submit_def_s =
-{
- sizeof(tsms_tpdu_submit_t),
- tsms_tpdu_submit_ctor,
- tsms_tpdu_submit_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_tpdu_submit_def_s = {
+ sizeof(tsms_tpdu_submit_t),
+ tsms_tpdu_submit_ctor,
+ tsms_tpdu_submit_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_tpdu_submit_def_t = &tsms_tpdu_submit_def_s;
diff --git a/tinySMS/src/tsms.c b/tinySMS/src/tsms.c
index 3ad8abf..aa63e17 100755
--- a/tinySMS/src/tsms.c
+++ b/tinySMS/src/tsms.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -50,7 +50,7 @@
*
*
* @image html SMS_Architecture.png "Protocol layer overview for the Short Message Service"
-*
+*
* <h2>18.1 Modes</h2>
* In real world, there are two ways to receive or send SMS messages over mobile networks: Binary (PDU) and Text mode.
*
@@ -77,7 +77,7 @@
/**@defgroup tsms_tpdu_group Service provided by the SM-TL (Transport)
* The Short Message Transfer Layer (SM TL) provides a service to the Short Message Application Layer (SM AL).
*
-* This service enables the SM AL to transfer short messages to its peer entity, receive short messages from its
+* This service enables the SM AL to transfer short messages to its peer entity, receive short messages from its
* peer entity and receive reports about earlier requests for short messages to be transferred.
*
* ======
@@ -177,7 +177,7 @@ TSK_OBJECT_SAFE_FREE(buffer);
* <i>SMS-STATUS-REPORT</i> messages are used to convey status reports from the SC (Service Center) to the MS (Mobile Station).<br>
* For more information, please refer to 3GPP TS 23.040 section 9.2.2.3.<br>
* The code below shows how to receive a <i>SMS-STATUS-REPORT</i> message, sent from the SC to the MS (MT).<br>
-*
+*
* @code
#include "tsk.h"
#include "tinysms.h"
@@ -216,7 +216,7 @@ uint8_t mr = 0xF5;
uint8_t message_number = 0xF8;
command = tsms_tpdu_command_create(mr, smsc, destination, message_number, tsms_tpdu_cmd_delete);
-
+
if((hex = tsms_tpdu_command_tohexastring(command))){
TSK_DEBUG_INFO("SMS-COMMAND=%s", hex);
TSK_FREE(hex);
@@ -319,7 +319,7 @@ TSK_OBJECT_SAFE_FREE(buffer);
*
* A SC receiving binary <i>RP-DATA</i> message (or any other <i>RP-*</i>) from the network should use tsms_rpdu_message_deserialize() function to deserialize the content.<br>
* The code below shows how to receive a <i>RP-DATA</i> message with a <i>RP-User-Data</i> (see 3GPP TS 23.011 section 8.2.5.3) information element which includes <i>SMS-DELIVER</i> as type indicator (this use case comes from 3GPP TS 24.341 chapter B.6). <br>
-*
+*
* @code
#include "tsk.h"
#include "tinysms.h"
@@ -383,7 +383,7 @@ TSK_OBJECT_SAFE_FREE(rp_smma);
* This message is sent between the MSC and the mobile station in both directions and used to relay the acknowledgement of a <i>RP-DATA</i> or <i>RP-SMMA</i> message reception.<br>
* For more information, please refer to 3GPP TS 24.011 section 7.3.2.3.<br>
* The code below shows how to send a <i>RP-ACK</i> message with a <i>RP-User-Data</i> (see 3GPP TS 23.011 section 8.2.5.3) information element which includes <i>SMS-DELIVER-REPORT</i> as type indicator (this use case comes from 3GPP TS 24.341 chapter B.6 section 8). <br>
-*
+*
* @code
#include "tsk.h"
#include "tinysms.h"
@@ -419,7 +419,7 @@ TSK_OBJECT_SAFE_FREE(rp_ack);
* This message is sent between the MSC and the mobile station in both directions and used to relay an error cause from an erroneous short message or notification transfer attempt.<br>
* For more information, please refer to 3GPP TS 24.011 section7.3.2.4.<br>
* The code below shows how to send a <i>RP-ERROR</i> message with a <i>RP-User-Data</i> (see 3GPP TS 23.011 section 8.2.5.3) information element which includes <i>SMS-DELIVER-REPORT</i> as type indicator. In this example, the error message is sent because the “call is barred”. For more information about the cause values that may be contained in an <i>RP-ERROR</i> message, please refer to 3GPP TS 24.011 section 8.2.5.4.<br>
-*
+*
* @code
#include "tsk.h"
#include "tinysms.h"
@@ -436,7 +436,7 @@ uint8_t mr = 0xF5;
// create SMS-DELIVER-REPORT message
sms_report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
// create RP-ERROR message
-rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report),
+rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report),
0x0A//call barred
);
// serialize
diff --git a/tinySMS/src/tsms_address.c b/tinySMS/src/tsms_address.c
index 26da4c6..56f9fde 100755
--- a/tinySMS/src/tsms_address.c
+++ b/tinySMS/src/tsms_address.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,163 +39,163 @@
*/
char* tsms_address_swap(const char* in, tsk_size_t in_len)
{
- tsk_size_t i;
- char* ret = tsk_null;
- if(tsk_strnullORempty(in)){
- goto bail;
- }
- ret = tsk_calloc(in_len + 2/*\0 and trainling F*/, sizeof(uint8_t));
-
- if(in_len>=2){
- for(i=0; i<in_len; i+=2){
- ret[i] = in[i+1];
- ret[i+1] = in[i];
- }
- }
-
- if(in_len & 0x01){ /* odd number? */
- ret[i-2] = 'F';
- ret[i-1] = in[i-2];
- }
+ tsk_size_t i;
+ char* ret = tsk_null;
+ if(tsk_strnullORempty(in)) {
+ goto bail;
+ }
+ ret = tsk_calloc(in_len + 2/*\0 and trainling F*/, sizeof(uint8_t));
+
+ if(in_len>=2) {
+ for(i=0; i<in_len; i+=2) {
+ ret[i] = in[i+1];
+ ret[i+1] = in[i];
+ }
+ }
+
+ if(in_len & 0x01) { /* odd number? */
+ ret[i-2] = 'F';
+ ret[i-1] = in[i-2];
+ }
bail:
- return ret;
+ return ret;
}
tsms_address_t* tsms_address_create(const tsms_address_string_t digits, tsms_address_type_t type)
{
- return tsk_object_new(tsms_address_def_t, digits, type);
+ return tsk_object_new(tsms_address_def_t, digits, type);
}
tsms_address_t* tsms_address_oa_create(const tsms_address_string_t digits)
{
- return tsms_address_create(digits, tsms_addr_oa);
+ return tsms_address_create(digits, tsms_addr_oa);
}
tsms_address_t* tsms_address_da_create(const tsms_address_string_t digits)
{
- return tsms_address_create(digits, tsms_addr_da);
+ return tsms_address_create(digits, tsms_addr_da);
}
tsms_address_t* tsms_address_smsc_create(const tsms_address_string_t digits)
{
- return tsms_address_create(digits, tsms_addr_smsc);
+ return tsms_address_create(digits, tsms_addr_smsc);
}
/** Serialize the address as per 3GPP TS 23.040 v910 section 9.1.2.5. */
int tsms_address_serialize(const tsms_address_t* address, tsk_buffer_t* output)
{
- char* number = tsk_null;
- tsk_size_t i, num_len/*real len*/;
- uint8_t type_of_address;
- if(!output){
- return -1;
- }
-
- /* For more information see 3GPP TS 23.040 v910 section 9.1.2.5
-
- 1 - Address-Length
- 2 - Type-of-Address
- +----+----+----+----+----+----+----+----+
- | 1 | TON | NPI |
- +----+----+----+----+----+----+----+----+
- 3 - Phone number in semi octets
- */
- number = tsms_address_swap(address ? address->digits : tsk_null, address ? strlen(address->digits) : 0);
-
- if(number){
- tsk_size_t len = (address->type == tsms_addr_smsc) ?
- ((strlen(number)/2) + 1) /* Number of octets plus 1. */
- : strlen(address->digits); /* Number of BCD digits */
- /* 1 - Address-Length */
- tsk_buffer_append(output, &len, 1);
- }
- else{
- /* 1 - Address-Length */
- static uint8_t _1bytes = 0x00;
- tsk_buffer_append(output, &_1bytes, 1);
- goto bail; /* neither 2 nor 3 will be executed */
- }
-
- /* 2 - Type-of-Address */
- type_of_address = (address->npi | (((address->ton << 4) | 0x80)));
- tsk_buffer_append(output, &type_of_address, 1);
- /* 3 - Phone number in semi octets (BCD digits) */
- if(((num_len = strlen(number)))){
- unsigned _1bytes; /* do not use neither int8_t nor uint8_t */
- /* as number comes from swap ==> num_len not odd */
- for(i=0; i<num_len; i+=2){
- if(sscanf(&number[i], "%2x", &_1bytes)){ /*do not use tsk_atox(str), because str should end with '\0'.*/
- tsk_buffer_append(output, &_1bytes, 1);
- }
- }
- }
-
+ char* number = tsk_null;
+ tsk_size_t i, num_len/*real len*/;
+ uint8_t type_of_address;
+ if(!output) {
+ return -1;
+ }
+
+ /* For more information see 3GPP TS 23.040 v910 section 9.1.2.5
+
+ 1 - Address-Length
+ 2 - Type-of-Address
+ +----+----+----+----+----+----+----+----+
+ | 1 | TON | NPI |
+ +----+----+----+----+----+----+----+----+
+ 3 - Phone number in semi octets
+ */
+ number = tsms_address_swap(address ? address->digits : tsk_null, address ? strlen(address->digits) : 0);
+
+ if(number) {
+ tsk_size_t len = (address->type == tsms_addr_smsc) ?
+ ((strlen(number)/2) + 1) /* Number of octets plus 1. */
+ : strlen(address->digits); /* Number of BCD digits */
+ /* 1 - Address-Length */
+ tsk_buffer_append(output, &len, 1);
+ }
+ else {
+ /* 1 - Address-Length */
+ static uint8_t _1bytes = 0x00;
+ tsk_buffer_append(output, &_1bytes, 1);
+ goto bail; /* neither 2 nor 3 will be executed */
+ }
+
+ /* 2 - Type-of-Address */
+ type_of_address = (address->npi | (((address->ton << 4) | 0x80)));
+ tsk_buffer_append(output, &type_of_address, 1);
+ /* 3 - Phone number in semi octets (BCD digits) */
+ if(((num_len = strlen(number)))) {
+ unsigned _1bytes; /* do not use neither int8_t nor uint8_t */
+ /* as number comes from swap ==> num_len not odd */
+ for(i=0; i<num_len; i+=2) {
+ if(sscanf(&number[i], "%2x", &_1bytes)) { /*do not use tsk_atox(str), because str should end with '\0'.*/
+ tsk_buffer_append(output, &_1bytes, 1);
+ }
+ }
+ }
+
bail:
- TSK_FREE(number);
- return 0;
+ TSK_FREE(number);
+ return 0;
}
tsms_address_t* tsms_address_deserialize(const void* data, tsk_size_t size, tsms_address_type_t xtype, tsk_size_t *length)
{
- tsms_address_t* address = tsk_null;
- uint8_t addr_len, _1byte, i;
- const uint8_t* pdata = data;
- *length = 0;
-
- if(!pdata || size<=2){
- TSK_DEBUG_ERROR("Invalid Parameter.");
- goto bail;
- }
-
- /* 1 - Address-Length */
- addr_len = *pdata;
- pdata++;
-
- /*== len=0 ==*/
- if(!addr_len){
- address = tsms_address_create(tsk_null, xtype);
- *length = 1;
- goto bail;
- }
- /*== check validity for non-zero-length address ==*/
- addr_len = (xtype == tsms_addr_smsc) ?
- (addr_len - 1) /* Number of octets plus 1. */
- : ((addr_len/2) + (addr_len%2)); /* Number of BCD digits */
- if((tsk_size_t)(1 /*Address-Length*/ + 1 /*Type-of-Address*/ + addr_len /* digits */) >= size){
- TSK_DEBUG_ERROR("Too short to contain an address.");
- goto bail;
- }
- else{
- address = tsms_address_create(tsk_null, xtype);
- *length = 1 /*Address-Length*/ + 1 /*Type-of-Address*/ + addr_len /* digits */;
- }
-
- /* 2 - Type-of-Address
- +----+----+----+----+----+----+----+----+
- | 1 | TON | NPI |
- +----+----+----+----+----+----+----+----+
- */
- address->ton = ((*pdata &0x70) >> 4);
- address->npi = (*pdata &0x0F);
- pdata++;
-
- /* 3 - Phone number in semi octets (BCD digits) */
- //address->digits = tsk_calloc((addr_len/2) + 1, sizeof(uint8_t));
- for(i=0; i<addr_len; i++, pdata++){
- _1byte = ((*pdata << 4) | (*pdata >> 4));
- if((_1byte & 0x0F) == 0x0F){ /* ends with 'F'? */
- _1byte = ((_1byte & 0xF0) >> 4);
- tsk_strcat_2(&address->digits, "%.1x", _1byte);
- }
- else{
- tsk_strcat_2(&address->digits, "%.2x", _1byte);
- }
- }
-
+ tsms_address_t* address = tsk_null;
+ uint8_t addr_len, _1byte, i;
+ const uint8_t* pdata = data;
+ *length = 0;
+
+ if(!pdata || size<=2) {
+ TSK_DEBUG_ERROR("Invalid Parameter.");
+ goto bail;
+ }
+
+ /* 1 - Address-Length */
+ addr_len = *pdata;
+ pdata++;
+
+ /*== len=0 ==*/
+ if(!addr_len) {
+ address = tsms_address_create(tsk_null, xtype);
+ *length = 1;
+ goto bail;
+ }
+ /*== check validity for non-zero-length address ==*/
+ addr_len = (xtype == tsms_addr_smsc) ?
+ (addr_len - 1) /* Number of octets plus 1. */
+ : ((addr_len/2) + (addr_len%2)); /* Number of BCD digits */
+ if((tsk_size_t)(1 /*Address-Length*/ + 1 /*Type-of-Address*/ + addr_len /* digits */) >= size) {
+ TSK_DEBUG_ERROR("Too short to contain an address.");
+ goto bail;
+ }
+ else {
+ address = tsms_address_create(tsk_null, xtype);
+ *length = 1 /*Address-Length*/ + 1 /*Type-of-Address*/ + addr_len /* digits */;
+ }
+
+ /* 2 - Type-of-Address
+ +----+----+----+----+----+----+----+----+
+ | 1 | TON | NPI |
+ +----+----+----+----+----+----+----+----+
+ */
+ address->ton = ((*pdata &0x70) >> 4);
+ address->npi = (*pdata &0x0F);
+ pdata++;
+
+ /* 3 - Phone number in semi octets (BCD digits) */
+ //address->digits = tsk_calloc((addr_len/2) + 1, sizeof(uint8_t));
+ for(i=0; i<addr_len; i++, pdata++) {
+ _1byte = ((*pdata << 4) | (*pdata >> 4));
+ if((_1byte & 0x0F) == 0x0F) { /* ends with 'F'? */
+ _1byte = ((_1byte & 0xF0) >> 4);
+ tsk_strcat_2(&address->digits, "%.1x", _1byte);
+ }
+ else {
+ tsk_strcat_2(&address->digits, "%.2x", _1byte);
+ }
+ }
+
bail:
- return address;
+ return address;
}
//=================================================================================================
@@ -203,47 +203,46 @@ bail:
//
static tsk_object_t* tsms_address_ctor(tsk_object_t * self, va_list * app)
{
- tsms_address_t *address = self;
- if(address){
- const char* digits = va_arg(*app, const char*);
- address->type = va_arg(*app, tsms_address_type_t);
-
- if(!tsk_strnullORempty(digits)){
- if(*digits == '+'){
- address->npi = tsms_addr_npi_isdn;
- address->ton = tsms_addr_ton_international;
- address->digits = tsk_strdup((digits+1));
- }
- else{
- address->npi = tsms_addr_npi_national;
- address->ton = tsms_addr_ton_national;
- address->digits = tsk_strdup((digits));
- }
- }
- else{
- address->npi = tsms_addr_npi_unknown;
- address->ton = tsms_addr_ton_unknown;
- }
-
- }
- return self;
+ tsms_address_t *address = self;
+ if(address) {
+ const char* digits = va_arg(*app, const char*);
+ address->type = va_arg(*app, tsms_address_type_t);
+
+ if(!tsk_strnullORempty(digits)) {
+ if(*digits == '+') {
+ address->npi = tsms_addr_npi_isdn;
+ address->ton = tsms_addr_ton_international;
+ address->digits = tsk_strdup((digits+1));
+ }
+ else {
+ address->npi = tsms_addr_npi_national;
+ address->ton = tsms_addr_ton_national;
+ address->digits = tsk_strdup((digits));
+ }
+ }
+ else {
+ address->npi = tsms_addr_npi_unknown;
+ address->ton = tsms_addr_ton_unknown;
+ }
+
+ }
+ return self;
}
static tsk_object_t* tsms_address_dtor(tsk_object_t * self)
-{
- tsms_address_t *address = self;
- if(address){
- TSK_FREE(address->digits);
- }
+{
+ tsms_address_t *address = self;
+ if(address) {
+ TSK_FREE(address->digits);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t tsms_address_def_s =
-{
- sizeof(tsms_address_t),
- tsms_address_ctor,
- tsms_address_dtor,
- tsk_null,
+static const tsk_object_def_t tsms_address_def_s = {
+ sizeof(tsms_address_t),
+ tsms_address_ctor,
+ tsms_address_dtor,
+ tsk_null,
};
const tsk_object_def_t *tsms_address_def_t = &tsms_address_def_s;
diff --git a/tinySMS/src/tsms_common.c b/tinySMS/src/tsms_common.c
index 92cda4c..f1e926a 100755
--- a/tinySMS/src/tsms_common.c
+++ b/tinySMS/src/tsms_common.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,7 +37,7 @@
#include <string.h> /* strlen() */
-/* ======================== TPDU ========================
+/* ======================== TPDU ========================
=========================================================*/
extern tsms_tpdu_message_t* _tsms_tpdu_submit_deserialize(const void* data, tsk_size_t size);
@@ -54,14 +54,14 @@ extern int _tsms_tpdu_status_report_serialize(const tsms_tpdu_message_t* self, t
int tsms_tpdu_message_init(tsms_tpdu_message_t* self, tsms_tpdu_mti_t mti)
{
- if(self){
- self->MobOrig = tsk_true;
- self->mti = mti;
- self->pid = TSMS_TPDU_DEFAULT_PID;
- self->dcs = TSMS_TPDU_DEFAULT_DCS;
- return 0;
- }
- return -1;
+ if(self) {
+ self->MobOrig = tsk_true;
+ self->mti = mti;
+ self->pid = TSMS_TPDU_DEFAULT_PID;
+ self->dcs = TSMS_TPDU_DEFAULT_DCS;
+ return 0;
+ }
+ return -1;
}
/**@ingroup tsms_tpdu_group
@@ -75,36 +75,44 @@ int tsms_tpdu_message_init(tsms_tpdu_message_t* self, tsms_tpdu_mti_t mti)
*/
int tsms_tpdu_message_serialize(const tsms_tpdu_message_t* self, tsk_buffer_t* output, tsk_bool_t MobOrig)
{
- if(!self){
- return -1;
- }
-
- /* 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI)
- bit1 bit0 Message type
- 0 0 SMS-DELIVER (in the direction SC to MS)
- 0 0 SMS-DELIVER-REPORT (in the direction MS to SC)
- 1 0 SMS-STATUS-REPORT (in the direction SC to MS)
- 1 0 SMS-COMMAND (in the direction MS to SC)
- 0 1 SMS-SUBMIT (in the direction MS to SC)
- 0 1 SMS-SUBMIT-REPORT (in the direction SC to MS)
- 1 1 Reserved
- */
- if(MobOrig){ /* MO */
- switch(self->mti){
- case tsms_tpdu_mti_deliver_report_mo: return _tsms_tpdu_report_serialize(self, output); /* SMS-DELIVER-REPORT */
- case tsms_tpdu_mti_command_mo: return _tsms_tpdu_command_serialize(self, output); /* SMS-COMMAND */
- case tsms_tpdu_mti_submit_mo: return _tsms_tpdu_submit_serialize(self, output); /* SMS-SUBMIT */
- default: return -2;
- }
- }
- else{ /* MT */
- switch(self->mti){
- case tsms_tpdu_mti_deliver_mt: return _tsms_tpdu_deliver_serialize(self, output); /* SMS-DELIVER */
- case tsms_tpdu_mti_status_report_mt: return _tsms_tpdu_status_report_serialize(self, output); /* SMS-STATUS-REPORT */
- case tsms_tpdu_mti_submit_report_mt: return _tsms_tpdu_report_serialize(self, output); /* SMS-SUBMIT-REPORT */
- default: return -2;
- }
- }
+ if(!self) {
+ return -1;
+ }
+
+ /* 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI)
+ bit1 bit0 Message type
+ 0 0 SMS-DELIVER (in the direction SC to MS)
+ 0 0 SMS-DELIVER-REPORT (in the direction MS to SC)
+ 1 0 SMS-STATUS-REPORT (in the direction SC to MS)
+ 1 0 SMS-COMMAND (in the direction MS to SC)
+ 0 1 SMS-SUBMIT (in the direction MS to SC)
+ 0 1 SMS-SUBMIT-REPORT (in the direction SC to MS)
+ 1 1 Reserved
+ */
+ if(MobOrig) { /* MO */
+ switch(self->mti) {
+ case tsms_tpdu_mti_deliver_report_mo:
+ return _tsms_tpdu_report_serialize(self, output); /* SMS-DELIVER-REPORT */
+ case tsms_tpdu_mti_command_mo:
+ return _tsms_tpdu_command_serialize(self, output); /* SMS-COMMAND */
+ case tsms_tpdu_mti_submit_mo:
+ return _tsms_tpdu_submit_serialize(self, output); /* SMS-SUBMIT */
+ default:
+ return -2;
+ }
+ }
+ else { /* MT */
+ switch(self->mti) {
+ case tsms_tpdu_mti_deliver_mt:
+ return _tsms_tpdu_deliver_serialize(self, output); /* SMS-DELIVER */
+ case tsms_tpdu_mti_status_report_mt:
+ return _tsms_tpdu_status_report_serialize(self, output); /* SMS-STATUS-REPORT */
+ case tsms_tpdu_mti_submit_report_mt:
+ return _tsms_tpdu_report_serialize(self, output); /* SMS-SUBMIT-REPORT */
+ default:
+ return -2;
+ }
+ }
}
/**@ingroup tsms_tpdu_group
@@ -116,56 +124,70 @@ int tsms_tpdu_message_serialize(const tsms_tpdu_message_t* self, tsk_buffer_t* o
*/
tsms_tpdu_message_t* tsms_tpdu_message_deserialize(const void* data, tsk_size_t size, tsk_bool_t MobOrig)
{
- tsms_tpdu_mti_t mti;
- uint8_t smsc_len = 0;
- tsms_tpdu_message_t* ret = tsk_null;
-
- if(!data || size<=1){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_null;
- }
+ tsms_tpdu_mti_t mti;
+ uint8_t smsc_len = 0;
+ tsms_tpdu_message_t* ret = tsk_null;
+
+ if(!data || size<=1) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_null;
+ }
#if TSMS_TPDU_APPEND_SMSC
- smsc_len = *((uint8_t*)data) + 1/* len itself*/;
- if(smsc_len>=size){
- TSK_DEBUG_ERROR("Too short.");
- return tsk_null;
- }
+ smsc_len = *((uint8_t*)data) + 1/* len itself*/;
+ if(smsc_len>=size) {
+ TSK_DEBUG_ERROR("Too short.");
+ return tsk_null;
+ }
#endif
-
- mti = (*(((uint8_t*)data)+smsc_len) & 0x03);
-
- /* 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI)
- bit1 bit0 Message type
- 0 0 SMS-DELIVER (in the direction SC to MS)
- 0 0 SMS-DELIVER-REPORT (in the direction MS to SC)
- 1 0 SMS-STATUS-REPORT (in the direction SC to MS)
- 1 0 SMS-COMMAND (in the direction MS to SC)
- 0 1 SMS-SUBMIT (in the direction MS to SC)
- 0 1 SMS-SUBMIT-REPORT (in the direction SC to MS)
- 1 1 Reserved
- */
- if(MobOrig){ /* MO */
- switch(mti){
- case tsms_tpdu_mti_deliver_report_mo: ret = _tsms_tpdu_report_deserialize(data, size); break; /* SMS-DELIVER-REPORT */
- case tsms_tpdu_mti_command_mo: ret = _tsms_tpdu_command_deserialize(data, size); break; /* SMS-COMMAND */
- case tsms_tpdu_mti_submit_mo: ret = _tsms_tpdu_submit_deserialize(data, size); break; /* SMS-SUBMIT */
- default: return tsk_null;
- }
- }
- else{ /* MT */
- switch(mti){
- case tsms_tpdu_mti_deliver_mt: ret = _tsms_tpdu_deliver_deserialize(data, size); break;/* SMS-DELIVER */
- case tsms_tpdu_mti_status_report_mt: ret = _tsms_tpdu_status_report_deserialize(data, size); break;/* SMS-STATUS-REPORT */
- case tsms_tpdu_mti_submit_report_mt: ret = _tsms_tpdu_report_deserialize(data, size); break;/* SMS-SUBMIT-REPORT */
- default: return tsk_null;
- }
- }
-
- if(ret){
- ret->MobOrig = MobOrig;
- }
- return ret;
+
+ mti = (*(((uint8_t*)data)+smsc_len) & 0x03);
+
+ /* 3GPP TS 23.040 - 9.2.3.1 TP Message Type Indicator (TP MTI)
+ bit1 bit0 Message type
+ 0 0 SMS-DELIVER (in the direction SC to MS)
+ 0 0 SMS-DELIVER-REPORT (in the direction MS to SC)
+ 1 0 SMS-STATUS-REPORT (in the direction SC to MS)
+ 1 0 SMS-COMMAND (in the direction MS to SC)
+ 0 1 SMS-SUBMIT (in the direction MS to SC)
+ 0 1 SMS-SUBMIT-REPORT (in the direction SC to MS)
+ 1 1 Reserved
+ */
+ if(MobOrig) { /* MO */
+ switch(mti) {
+ case tsms_tpdu_mti_deliver_report_mo:
+ ret = _tsms_tpdu_report_deserialize(data, size);
+ break; /* SMS-DELIVER-REPORT */
+ case tsms_tpdu_mti_command_mo:
+ ret = _tsms_tpdu_command_deserialize(data, size);
+ break; /* SMS-COMMAND */
+ case tsms_tpdu_mti_submit_mo:
+ ret = _tsms_tpdu_submit_deserialize(data, size);
+ break; /* SMS-SUBMIT */
+ default:
+ return tsk_null;
+ }
+ }
+ else { /* MT */
+ switch(mti) {
+ case tsms_tpdu_mti_deliver_mt:
+ ret = _tsms_tpdu_deliver_deserialize(data, size);
+ break;/* SMS-DELIVER */
+ case tsms_tpdu_mti_status_report_mt:
+ ret = _tsms_tpdu_status_report_deserialize(data, size);
+ break;/* SMS-STATUS-REPORT */
+ case tsms_tpdu_mti_submit_report_mt:
+ ret = _tsms_tpdu_report_deserialize(data, size);
+ break;/* SMS-SUBMIT-REPORT */
+ default:
+ return tsk_null;
+ }
+ }
+
+ if(ret) {
+ ret->MobOrig = MobOrig;
+ }
+ return ret;
}
/**@ingroup tsms_tpdu_group
@@ -173,21 +195,21 @@ tsms_tpdu_message_t* tsms_tpdu_message_deserialize(const void* data, tsk_size_t
*/
char* tsms_tpdu_message_tostring(const tsms_tpdu_message_t* self, tsk_bool_t MobOrig)
{
- char* ret = tsk_null;
- tsk_buffer_t* output = tsk_null;
- if(!self){
- goto bail;
- }
-
- if((output = tsk_buffer_create_null())){
- if(!tsms_tpdu_message_serialize(self, output, MobOrig)){
- ret = tsk_strndup(output->data, output->size);
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
+ char* ret = tsk_null;
+ tsk_buffer_t* output = tsk_null;
+ if(!self) {
+ goto bail;
+ }
+
+ if((output = tsk_buffer_create_null())) {
+ if(!tsms_tpdu_message_serialize(self, output, MobOrig)) {
+ ret = tsk_strndup(output->data, output->size);
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup tsms_tpdu_group
@@ -200,24 +222,24 @@ bail:
*/
char* tsms_tpdu_message_tohexastring(const tsms_tpdu_message_t* self, tsk_bool_t MobOrig)
{
- char* ret = tsk_null;
- tsk_buffer_t* output = tsk_null;
- if(!self){
- goto bail;
- }
-
- if((output = tsk_buffer_create_null())){
- if(!tsms_tpdu_message_serialize(self, output, MobOrig)){
- tsk_size_t i;
- for(i=0;i<output->size;i++){
- tsk_strcat_2(&ret, "%.2X", *(TSK_BUFFER_TO_U8(output)+i));
- }
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
+ char* ret = tsk_null;
+ tsk_buffer_t* output = tsk_null;
+ if(!self) {
+ goto bail;
+ }
+
+ if((output = tsk_buffer_create_null())) {
+ if(!tsms_tpdu_message_serialize(self, output, MobOrig)) {
+ tsk_size_t i;
+ for(i=0; i<output->size; i++) {
+ tsk_strcat_2(&ret, "%.2X", *(TSK_BUFFER_TO_U8(output)+i));
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup tsms_tpdu_group
@@ -227,25 +249,24 @@ bail:
*/
char* tsms_tpdu_message_get_payload(const tsms_tpdu_message_t* self)
{
- if(!self || !self->ud || !self->ud->data || !self->ud->size){
- TSK_DEBUG_WARN("No content.");
- return tsk_null;
- }
-
- switch(TSMS_ALPHA_FROM_DCS(self->dcs)){
- case tsms_alpha_7bit:
- return tsms_pack_from_7bit(self->ud->data, self->ud->size);
- case tsms_alpha_8bit:
- return tsms_pack_from_8bit(self->ud->data, self->ud->size);
- case tsms_alpha_ucs2:
- return tsms_pack_from_ucs2(self->ud->data, self->ud->size);
- case tsms_alpha_reserved:
- default:
- {
- TSK_DEBUG_ERROR("%d alpha not suported", TSMS_ALPHA_FROM_DCS(self->dcs));
- return tsk_null;
- }
- }
+ if(!self || !self->ud || !self->ud->data || !self->ud->size) {
+ TSK_DEBUG_WARN("No content.");
+ return tsk_null;
+ }
+
+ switch(TSMS_ALPHA_FROM_DCS(self->dcs)) {
+ case tsms_alpha_7bit:
+ return tsms_pack_from_7bit(self->ud->data, self->ud->size);
+ case tsms_alpha_8bit:
+ return tsms_pack_from_8bit(self->ud->data, self->ud->size);
+ case tsms_alpha_ucs2:
+ return tsms_pack_from_ucs2(self->ud->data, self->ud->size);
+ case tsms_alpha_reserved:
+ default: {
+ TSK_DEBUG_ERROR("%d alpha not suported", TSMS_ALPHA_FROM_DCS(self->dcs));
+ return tsk_null;
+ }
+ }
}
/**@ingroup tsms_tpdu_group
@@ -258,57 +279,56 @@ char* tsms_tpdu_message_get_payload(const tsms_tpdu_message_t* self)
*/
int tsms_tpdu_message_set_userdata(tsms_tpdu_message_t* self, const tsk_buffer_t* udata, tsms_alphabet_t alpha)
{
- if(!self || !udata){
- return -1;
- }
- /* SMS alphabet values as per 3GPP TS 23.038 v911 section 4.
- * Part of TP-DCS (SMS Data Coding Scheme).
- */
- self->dcs = ((self->dcs & 0xF3) | (alpha << 2)); /* Bit3 and Bit2 */
-
- TSK_OBJECT_SAFE_FREE(self->ud);
-
- /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
- * (alpha = SMS_ALPHA_7bit) ==> number of septets.
- * ((alpha == SMS_ALPHA_8bit) || (alpha == SMS_ALPHA_UCS2)) ==> number of octes.
- */
-
- /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
- switch(alpha){
- case tsms_alpha_7bit: {
- self->udl = (udata->size) + (udata->size/7);
- self->ud = tsk_buffer_create(udata->data, udata->size);
- }
- break;
- case tsms_alpha_8bit:
- case tsms_alpha_ucs2: {
- self->udl = udata->size;
- self->ud = tsk_buffer_create(udata->data, udata->size);
- }
- break;
-
- default:
- {
- TSK_DEBUG_ERROR("Invalid Alphabet.");
- return -2;
- }
- }
- return 0;
+ if(!self || !udata) {
+ return -1;
+ }
+ /* SMS alphabet values as per 3GPP TS 23.038 v911 section 4.
+ * Part of TP-DCS (SMS Data Coding Scheme).
+ */
+ self->dcs = ((self->dcs & 0xF3) | (alpha << 2)); /* Bit3 and Bit2 */
+
+ TSK_OBJECT_SAFE_FREE(self->ud);
+
+ /* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
+ * (alpha = SMS_ALPHA_7bit) ==> number of septets.
+ * ((alpha == SMS_ALPHA_8bit) || (alpha == SMS_ALPHA_UCS2)) ==> number of octes.
+ */
+
+ /* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
+ switch(alpha) {
+ case tsms_alpha_7bit: {
+ self->udl = (udata->size) + (udata->size/7);
+ self->ud = tsk_buffer_create(udata->data, udata->size);
+ }
+ break;
+ case tsms_alpha_8bit:
+ case tsms_alpha_ucs2: {
+ self->udl = udata->size;
+ self->ud = tsk_buffer_create(udata->data, udata->size);
+ }
+ break;
+
+ default: {
+ TSK_DEBUG_ERROR("Invalid Alphabet.");
+ return -2;
+ }
+ }
+ return 0;
}
/** internal function used to deinit a TP-Message.*/
int tsms_tpdu_message_deinit(tsms_tpdu_message_t* self)
{
- if(self){
- TSK_OBJECT_SAFE_FREE(self->ud);
- return 0;
- }
- return -1;
+ if(self) {
+ TSK_OBJECT_SAFE_FREE(self->ud);
+ return 0;
+ }
+ return -1;
}
-/* ======================== RPDU ========================
+/* ======================== RPDU ========================
=========================================================*/
extern int _tsms_rpdu_rpdata_serialize(const tsms_rpdu_message_t* self, tsk_buffer_t* output);
@@ -333,26 +353,26 @@ extern tsms_rpdu_message_t* _tsms_rpdu_rperror_deserialize(const void* data, tsk
*/
int tsms_rpdu_message_serialize(const tsms_rpdu_message_t* self, tsk_buffer_t* output)
{
- if(!self || !output){
- TSK_DEBUG_ERROR("Invalid Parameter");
- return -1;
- }
-
- switch(self->mti){
- case tsms_rpdu_type_data_mo:
- case tsms_rpdu_type_data_mt:
- return _tsms_rpdu_rpdata_serialize(self, output);
- case tsms_rpdu_type_ack_mo:
- case tsms_rpdu_type_ack_mt:
- return _tsms_rpdu_rpack_serialize(self, output);
- case tsms_rpdu_type_error_mo:
- case tsms_rpdu_type_error_mt:
- return _tsms_rpdu_rperror_serialize(self, output);
- case tsms_rpdu_type_smma_mo:
- return _tsms_rpdu_rpsmma_serialize(self, output);
- }
-
- return -2;
+ if(!self || !output) {
+ TSK_DEBUG_ERROR("Invalid Parameter");
+ return -1;
+ }
+
+ switch(self->mti) {
+ case tsms_rpdu_type_data_mo:
+ case tsms_rpdu_type_data_mt:
+ return _tsms_rpdu_rpdata_serialize(self, output);
+ case tsms_rpdu_type_ack_mo:
+ case tsms_rpdu_type_ack_mt:
+ return _tsms_rpdu_rpack_serialize(self, output);
+ case tsms_rpdu_type_error_mo:
+ case tsms_rpdu_type_error_mt:
+ return _tsms_rpdu_rperror_serialize(self, output);
+ case tsms_rpdu_type_smma_mo:
+ return _tsms_rpdu_rpsmma_serialize(self, output);
+ }
+
+ return -2;
}
/**@ingroup tsms_rpdu_group
@@ -363,30 +383,30 @@ int tsms_rpdu_message_serialize(const tsms_rpdu_message_t* self, tsk_buffer_t* o
*/
tsms_rpdu_message_t* tsms_rpdu_message_deserialize(const void* data, tsk_size_t size)
{
- tsms_rpdu_type_t mti;
-
- if(!data || size<2 /* MTI and MR*/){
- TSK_DEBUG_ERROR("Invalid parameter.");
- return tsk_null;
- }
-
- mti = (*((uint8_t*)data) & 0x07);
-
- switch(mti){
- case tsms_rpdu_type_data_mo:
- case tsms_rpdu_type_data_mt:
- return _tsms_rpdu_rpdata_deserialize(data, size);
- case tsms_rpdu_type_ack_mo:
- case tsms_rpdu_type_ack_mt:
- return _tsms_rpdu_rpack_deserialize(data, size);
- case tsms_rpdu_type_error_mo:
- case tsms_rpdu_type_error_mt:
- return _tsms_rpdu_rperror_deserialize(data, size);
- case tsms_rpdu_type_smma_mo:
- return _tsms_rpdu_rpsmma_deserialize(data, size);
- }
-
- return tsk_null;
+ tsms_rpdu_type_t mti;
+
+ if(!data || size<2 /* MTI and MR*/) {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ return tsk_null;
+ }
+
+ mti = (*((uint8_t*)data) & 0x07);
+
+ switch(mti) {
+ case tsms_rpdu_type_data_mo:
+ case tsms_rpdu_type_data_mt:
+ return _tsms_rpdu_rpdata_deserialize(data, size);
+ case tsms_rpdu_type_ack_mo:
+ case tsms_rpdu_type_ack_mt:
+ return _tsms_rpdu_rpack_deserialize(data, size);
+ case tsms_rpdu_type_error_mo:
+ case tsms_rpdu_type_error_mt:
+ return _tsms_rpdu_rperror_deserialize(data, size);
+ case tsms_rpdu_type_smma_mo:
+ return _tsms_rpdu_rpsmma_deserialize(data, size);
+ }
+
+ return tsk_null;
}
/**@ingroup tsms_rpdu_group
@@ -396,22 +416,22 @@ tsms_rpdu_message_t* tsms_rpdu_message_deserialize(const void* data, tsk_size_t
*/
char* tsms_rpdu_message_tohexastring(const tsms_rpdu_message_t* self)
{
- char* ret = tsk_null;
- tsk_buffer_t* output = tsk_null;
- if(!self){
- goto bail;
- }
-
- if((output = tsk_buffer_create_null())){
- if(!tsms_rpdu_message_serialize(self, output)){
- tsk_size_t i;
- for(i=0;i<output->size;i++){
- tsk_strcat_2(&ret, "%.2X", *(TSK_BUFFER_TO_U8(output)+i));
- }
- }
- TSK_OBJECT_SAFE_FREE(output);
- }
+ char* ret = tsk_null;
+ tsk_buffer_t* output = tsk_null;
+ if(!self) {
+ goto bail;
+ }
+
+ if((output = tsk_buffer_create_null())) {
+ if(!tsms_rpdu_message_serialize(self, output)) {
+ tsk_size_t i;
+ for(i=0; i<output->size; i++) {
+ tsk_strcat_2(&ret, "%.2X", *(TSK_BUFFER_TO_U8(output)+i));
+ }
+ }
+ TSK_OBJECT_SAFE_FREE(output);
+ }
bail:
- return ret;
+ return ret;
}
diff --git a/tinySMS/src/tsms_packing.c b/tinySMS/src/tsms_packing.c
index 9f9f916..8a833bf 100755
--- a/tinySMS/src/tsms_packing.c
+++ b/tinySMS/src/tsms_packing.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -48,95 +48,95 @@
*/
tsk_buffer_t* tsms_pack_to_7bit(const char* ascii)
{
- /* 3GPP TS 23.038 - 6.1.2.1.1 Packing of 7-bit characters
- If a character number $ is noted in the following way:
- b7 b6 b5 b4 b3 b2 b1
- $a $b $c $d $e $f $g
- The packing of the 7-bitscharacters in octets is done by completing the octets with zeros on the left.
- For examples, packing: $
- - one character in one octet:
- - bits number:
- 7 6 5 4 3 2 1 0
- 0 1a 1b 1c 1d 1e 1f 1g
-
- - two characters in two octets:
- - bits number:
- 7 6 5 4 3 2 1 0
- 2g 1a 1b 1c 1d 1e 1f 1g
- 0 0 2a 2b 2c 2d 2e 2f
-
- - three characters in three octets:
- - bits number:
- 7 6 5 4 3 2 1 0
- 2g 1a 1b 1c 1d 1e 1f 1g
- 3f 3g 2a 2b 2c 2d 2e 2f
- 0 0 0 3a 3b 3c 3d 3e
-
- - seven characters in seven octets:
- - bits number:
- 7 6 5 4 3 2 1 0
- 2g 1a 1b 1c 1d 1e 1f 1g
- 3f 3g 2a 2b 2c 2d 2e 2f
- 4e 4f 4g 3a 3b 3c 3d 3e
- 5d 5e 5f 5g 4a 4b 4c 4d
- 6c 6d 6e 6f 6g 5a 5b 5c
- 7b 7c 7d 7e 7f 7g 6a 6b
- 0 0 0 0 0 0 0 7a
-
- - eight characters in seven octets:
- - bits number:
- 7 6 5 4 3 2 1 0
- 2g 1a 1b 1c 1d 1e 1f 1g
- 3f 3g 2a 2b 2c 2d 2e 2f
- 4e 4f 4g 3a 3b 3c 3d 3e
- 5d 5e 5f 5g 4a 4b 4c 4d
- 6c 6d 6e 6f 6g 5a 5b 5c
- 7b 7c 7d 7e 7f 7g 6a 6b
- 8a 8b 8c 8d 8e 8f 8g 7a
-
- The bit number zero is always transmitted first.
- Therefore, in 140 octets, it is possible to pack (140x8)/7=160 characters.
- */
- tsk_buffer_t* ret = tsk_null;
- uint8_t* _ret = tsk_null;
- register tsk_size_t len, bcount = 1/*1-7*/, index = 0, retindex = 0, retlen = 0;
- const uint8_t* pascii = (const uint8_t*)ascii;
-
- if(!ascii || !(len = strlen(ascii))){
- TSK_DEBUG_WARN("Null or Empty ascci string.");
- goto bail;
- }
-
- retlen = len - (len/7) + 1;
- if(!(_ret = tsk_calloc(retlen, sizeof(uint8_t)))){
- goto bail;
- }
-
- while(index < len){
- if(index == 0){
- _ret[retindex] |= (pascii[index] & (0xFF >> bcount)) |
- (pascii[index+1] << (8 - bcount));
- }
- else{
- _ret[retindex] = ((pascii[index] >> (bcount - 1))& (0xFF >> bcount))
- | (pascii[index+1] <<(8-bcount));
- }
-
- /* how many bytes to use to complete on the left? */
- if(++bcount == 8){
- bcount = 1, ++index;
- }
- /* next */
- retindex++;
- index++;
- }
-
- /* creat ret */
- ret = tsk_buffer_create(_ret, (retlen-1));
+ /* 3GPP TS 23.038 - 6.1.2.1.1 Packing of 7-bit characters
+ If a character number $ is noted in the following way:
+ b7 b6 b5 b4 b3 b2 b1
+ $a $b $c $d $e $f $g
+ The packing of the 7-bitscharacters in octets is done by completing the octets with zeros on the left.
+ For examples, packing: $
+ - one character in one octet:
+ - bits number:
+ 7 6 5 4 3 2 1 0
+ 0 1a 1b 1c 1d 1e 1f 1g
+
+ - two characters in two octets:
+ - bits number:
+ 7 6 5 4 3 2 1 0
+ 2g 1a 1b 1c 1d 1e 1f 1g
+ 0 0 2a 2b 2c 2d 2e 2f
+
+ - three characters in three octets:
+ - bits number:
+ 7 6 5 4 3 2 1 0
+ 2g 1a 1b 1c 1d 1e 1f 1g
+ 3f 3g 2a 2b 2c 2d 2e 2f
+ 0 0 0 3a 3b 3c 3d 3e
+
+ - seven characters in seven octets:
+ - bits number:
+ 7 6 5 4 3 2 1 0
+ 2g 1a 1b 1c 1d 1e 1f 1g
+ 3f 3g 2a 2b 2c 2d 2e 2f
+ 4e 4f 4g 3a 3b 3c 3d 3e
+ 5d 5e 5f 5g 4a 4b 4c 4d
+ 6c 6d 6e 6f 6g 5a 5b 5c
+ 7b 7c 7d 7e 7f 7g 6a 6b
+ 0 0 0 0 0 0 0 7a
+
+ - eight characters in seven octets:
+ - bits number:
+ 7 6 5 4 3 2 1 0
+ 2g 1a 1b 1c 1d 1e 1f 1g
+ 3f 3g 2a 2b 2c 2d 2e 2f
+ 4e 4f 4g 3a 3b 3c 3d 3e
+ 5d 5e 5f 5g 4a 4b 4c 4d
+ 6c 6d 6e 6f 6g 5a 5b 5c
+ 7b 7c 7d 7e 7f 7g 6a 6b
+ 8a 8b 8c 8d 8e 8f 8g 7a
+
+ The bit number zero is always transmitted first.
+ Therefore, in 140 octets, it is possible to pack (140x8)/7=160 characters.
+ */
+ tsk_buffer_t* ret = tsk_null;
+ uint8_t* _ret = tsk_null;
+ register tsk_size_t len, bcount = 1/*1-7*/, index = 0, retindex = 0, retlen = 0;
+ const uint8_t* pascii = (const uint8_t*)ascii;
+
+ if(!ascii || !(len = strlen(ascii))) {
+ TSK_DEBUG_WARN("Null or Empty ascci string.");
+ goto bail;
+ }
+
+ retlen = len - (len/7) + 1;
+ if(!(_ret = tsk_calloc(retlen, sizeof(uint8_t)))) {
+ goto bail;
+ }
+
+ while(index < len) {
+ if(index == 0) {
+ _ret[retindex] |= (pascii[index] & (0xFF >> bcount)) |
+ (pascii[index+1] << (8 - bcount));
+ }
+ else {
+ _ret[retindex] = ((pascii[index] >> (bcount - 1))& (0xFF >> bcount))
+ | (pascii[index+1] <<(8-bcount));
+ }
+
+ /* how many bytes to use to complete on the left? */
+ if(++bcount == 8) {
+ bcount = 1, ++index;
+ }
+ /* next */
+ retindex++;
+ index++;
+ }
+
+ /* creat ret */
+ ret = tsk_buffer_create(_ret, (retlen-1));
bail:
- TSK_FREE(_ret);
-
- return ret;
+ TSK_FREE(_ret);
+
+ return ret;
}
/**@ingroup tsms_packing_group
@@ -147,36 +147,36 @@ bail:
*/
tsk_buffer_t* tsms_pack_to_ucs2(const char* ascii)
{
- register tsk_size_t i, j;
- tsk_size_t len, retlen = 0;
- uint8_t* str = tsk_null;
- tsk_buffer_t* ret = tsk_null;
-
- if(!ascii || !(len=strlen(ascii))){
- TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
- goto bail;
- }
-
- if(!(str = tsk_calloc(len, sizeof(uint8_t)*2))){
- goto bail;
- }
-
- /* very bas way to do conversion ==> to be fixed */
- for(i=0; i<len; i++){
- for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++){
- if((uint8_t)ascii[i] == (uint8_t)(TSMS_ETSI_GSM_03_38[j][1] & 0xFF)){
- retlen++; /* 00 */
- *(str + retlen++) = (TSMS_ETSI_GSM_03_38[j][0] & 0xFF);
- }
- }
- }
-
- /* create buffer */
- ret = tsk_buffer_create(str, retlen);
+ register tsk_size_t i, j;
+ tsk_size_t len, retlen = 0;
+ uint8_t* str = tsk_null;
+ tsk_buffer_t* ret = tsk_null;
+
+ if(!ascii || !(len=strlen(ascii))) {
+ TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
+ goto bail;
+ }
+
+ if(!(str = tsk_calloc(len, sizeof(uint8_t)*2))) {
+ goto bail;
+ }
+
+ /* very bas way to do conversion ==> to be fixed */
+ for(i=0; i<len; i++) {
+ for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++) {
+ if((uint8_t)ascii[i] == (uint8_t)(TSMS_ETSI_GSM_03_38[j][1] & 0xFF)) {
+ retlen++; /* 00 */
+ *(str + retlen++) = (TSMS_ETSI_GSM_03_38[j][0] & 0xFF);
+ }
+ }
+ }
+
+ /* create buffer */
+ ret = tsk_buffer_create(str, retlen);
bail:
- TSK_FREE(str);
- return ret;
+ TSK_FREE(str);
+ return ret;
}
/**@ingroup tsms_packing_group
@@ -187,36 +187,36 @@ bail:
*/
tsk_buffer_t* tsms_pack_to_8bit(const char* ascii)
{
- register tsk_size_t i, j;
- tsk_size_t len, retlen = 0;
- uint8_t* str = tsk_null;
- tsk_buffer_t* ret = tsk_null;
-
- if(!ascii || !(len=strlen(ascii))){
- TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
- goto bail;
- }
-
- if(!(str = tsk_calloc(len, sizeof(uint8_t)))){
- goto bail;
- }
-
- /* very bas way to do conversion ==> to be fixed */
- for(i = 0; i<len; i++){
- for(j = 0; j<TSMS_ETSI_GSM_03_38_COUNT; j++){
- if((uint8_t)ascii[i] == (uint8_t)(TSMS_ETSI_GSM_03_38[j][1] & 0xFF)){
- *(str + retlen++) = (TSMS_ETSI_GSM_03_38[j][0] & 0xFF);
- continue;
- }
- }
- }
-
- /* create buffer */
- ret = tsk_buffer_create(str, retlen);
+ register tsk_size_t i, j;
+ tsk_size_t len, retlen = 0;
+ uint8_t* str = tsk_null;
+ tsk_buffer_t* ret = tsk_null;
+
+ if(!ascii || !(len=strlen(ascii))) {
+ TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
+ goto bail;
+ }
+
+ if(!(str = tsk_calloc(len, sizeof(uint8_t)))) {
+ goto bail;
+ }
+
+ /* very bas way to do conversion ==> to be fixed */
+ for(i = 0; i<len; i++) {
+ for(j = 0; j<TSMS_ETSI_GSM_03_38_COUNT; j++) {
+ if((uint8_t)ascii[i] == (uint8_t)(TSMS_ETSI_GSM_03_38[j][1] & 0xFF)) {
+ *(str + retlen++) = (TSMS_ETSI_GSM_03_38[j][0] & 0xFF);
+ continue;
+ }
+ }
+ }
+
+ /* create buffer */
+ ret = tsk_buffer_create(str, retlen);
bail:
- TSK_FREE(str);
- return ret;
+ TSK_FREE(str);
+ return ret;
}
/**@ingroup tsms_packing_group
@@ -228,45 +228,45 @@ bail:
*/
char* tsms_pack_from_7bit(const void* gsm7bit, tsk_size_t size)
{
- char* ret = tsk_null;
- register tsk_size_t bcount = 1/*1-7*/, index = 0, retindex = 0, retsize = 0;
- const uint8_t* pgsm7bit = gsm7bit;
-
- if(!gsm7bit || !size){
- TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
- goto bail;
- }
-
- // dup the gsm7bit buffer
- retsize = size + (size/7) + 1; // variable used for debug
- if(!(ret = tsk_calloc(retsize, sizeof(uint8_t)))){
- goto bail;
- }
-
- while(index < size){
- ret[retindex] = (pgsm7bit[index] & (0xFF >>bcount));
- if(index){
- ret[retindex] = (ret[retindex] << (bcount - 1))
- | (pgsm7bit[index-1] >> (8 - bcount + 1));
- }
-
- /* how many bytes to use to complete on the right? */
- if(bcount++ == 8){
- bcount = 1, --index;
- }
- /* next */
- index++;
- retindex++;
- }
-
- /* special one */
- if(!(size%7)){
- ret[retindex] = pgsm7bit[size-1]>>1;
- }
-
+ char* ret = tsk_null;
+ register tsk_size_t bcount = 1/*1-7*/, index = 0, retindex = 0, retsize = 0;
+ const uint8_t* pgsm7bit = gsm7bit;
+
+ if(!gsm7bit || !size) {
+ TSK_DEBUG_WARN("Null or Empty gsm7bit buffer.");
+ goto bail;
+ }
+
+ // dup the gsm7bit buffer
+ retsize = size + (size/7) + 1; // variable used for debug
+ if(!(ret = tsk_calloc(retsize, sizeof(uint8_t)))) {
+ goto bail;
+ }
+
+ while(index < size) {
+ ret[retindex] = (pgsm7bit[index] & (0xFF >>bcount));
+ if(index) {
+ ret[retindex] = (ret[retindex] << (bcount - 1))
+ | (pgsm7bit[index-1] >> (8 - bcount + 1));
+ }
+
+ /* how many bytes to use to complete on the right? */
+ if(bcount++ == 8) {
+ bcount = 1, --index;
+ }
+ /* next */
+ index++;
+ retindex++;
+ }
+
+ /* special one */
+ if(!(size%7)) {
+ ret[retindex] = pgsm7bit[size-1]>>1;
+ }
+
bail:
-
- return ret;
+
+ return ret;
}
/**@ingroup tsms_packing_group
@@ -278,31 +278,31 @@ bail:
*/
char* tsms_pack_from_ucs2(const void* ucs2, tsk_size_t size)
{
- register tsk_size_t i, j;
- char* ret = tsk_null;
-
- const uint16_t* pucs2 = ucs2;
-
- if(!ucs2 || !size){
- TSK_DEBUG_WARN("Null or Empty gsm8bit buffer.");
- goto bail;
- }
-
- if(!(ret = tsk_calloc(size+1, sizeof(uint8_t)))){
- goto bail;
- }
-
- for(i=0; i<size; i++){
- for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++){
- if(*(pucs2 + i) == (TSMS_ETSI_GSM_03_38[j][0])){
- *(ret+i) = (TSMS_ETSI_GSM_03_38[j][1] & 0xFF);
- continue;
- }
- }
- }
+ register tsk_size_t i, j;
+ char* ret = tsk_null;
+
+ const uint16_t* pucs2 = ucs2;
+
+ if(!ucs2 || !size) {
+ TSK_DEBUG_WARN("Null or Empty gsm8bit buffer.");
+ goto bail;
+ }
+
+ if(!(ret = tsk_calloc(size+1, sizeof(uint8_t)))) {
+ goto bail;
+ }
+
+ for(i=0; i<size; i++) {
+ for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++) {
+ if(*(pucs2 + i) == (TSMS_ETSI_GSM_03_38[j][0])) {
+ *(ret+i) = (TSMS_ETSI_GSM_03_38[j][1] & 0xFF);
+ continue;
+ }
+ }
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup tsms_packing_group
@@ -314,30 +314,30 @@ bail:
*/
char* tsms_pack_from_8bit(const void* gsm8bit, tsk_size_t size)
{
- register tsk_size_t i, j;
- char* ret = tsk_null;
-
- const uint8_t* pgsm8bit = gsm8bit;
-
- if(!gsm8bit || !size){
- TSK_DEBUG_WARN("Null or Empty gsm8bit buffer.");
- goto bail;
- }
-
- if(!(ret = tsk_calloc(size+1, sizeof(uint8_t)))){
- goto bail;
- }
-
- /* Very bad way to do convertion ==> to be changed */
- for(i=0; i<size; i++){
- for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++){
- if(*(pgsm8bit + i) == (TSMS_ETSI_GSM_03_38[j][0] & 0xFF)){
- *(ret+i) = (TSMS_ETSI_GSM_03_38[j][1] & 0xFF);
- continue;
- }
- }
- }
+ register tsk_size_t i, j;
+ char* ret = tsk_null;
+
+ const uint8_t* pgsm8bit = gsm8bit;
+
+ if(!gsm8bit || !size) {
+ TSK_DEBUG_WARN("Null or Empty gsm8bit buffer.");
+ goto bail;
+ }
+
+ if(!(ret = tsk_calloc(size+1, sizeof(uint8_t)))) {
+ goto bail;
+ }
+
+ /* Very bad way to do convertion ==> to be changed */
+ for(i=0; i<size; i++) {
+ for(j=0; j<TSMS_ETSI_GSM_03_38_COUNT; j++) {
+ if(*(pgsm8bit + i) == (TSMS_ETSI_GSM_03_38[j][0] & 0xFF)) {
+ *(ret+i) = (TSMS_ETSI_GSM_03_38[j][1] & 0xFF);
+ continue;
+ }
+ }
+ }
bail:
- return ret;
+ return ret;
}
diff --git a/tinySMS/test/stdafx.c b/tinySMS/test/stdafx.c
index a98e092..938920a 100755
--- a/tinySMS/test/stdafx.c
+++ b/tinySMS/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySMS/test/stdafx.h b/tinySMS/test/stdafx.h
index d87dff0..7015ac9 100755
--- a/tinySMS/test/stdafx.h
+++ b/tinySMS/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinySMS/test/targetver.h b/tinySMS/test/targetver.h
index a4c6bd1..920ad46 100755
--- a/tinySMS/test/targetver.h
+++ b/tinySMS/test/targetver.h
@@ -1,8 +1,8 @@
#ifndef SMS_TEST_TARGETVER_H
#define SMS_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinySMS/test/test.c b/tinySMS/test/test.c
index 538cd16..a1f7717 100755
--- a/tinySMS/test/test.c
+++ b/tinySMS/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -27,38 +27,38 @@
char* tohex(uint8_t* ptr, size_t size)
{
- char* ret = tsk_null;
- size_t i;
- for(i=0;i<size;i++){
- tsk_strcat_2(&ret, "%.2X", *ptr++);
- }
- return ret;
+ char* ret = tsk_null;
+ size_t i;
+ for(i=0; i<size; i++) {
+ tsk_strcat_2(&ret, "%.2X", *ptr++);
+ }
+ return ret;
}
void printhex(const char* what, uint8_t* ptr, size_t size)
{
- size_t i;
- printf("%s", what);
- for(i=0;i<size;i++){
- printf("%.2X", *ptr++);
- }
- printf("\n");
+ size_t i;
+ printf("%s", what);
+ for(i=0; i<size; i++) {
+ printf("%.2X", *ptr++);
+ }
+ printf("\n");
}
tsk_bool_t bin_equals(const uint8_t* b1, const uint8_t* b2, size_t size)
{
- size_t i;
-
- // we assume that sizeof(b1)==sizeof(b2)
- if(!b1 || !b2 || !size){
- return tsk_false;
- }
- for(i=0; i<size;i++){
- if(b1[i] != b2[i]){
- return tsk_false;
- }
- }
- return tsk_true;
+ size_t i;
+
+ // we assume that sizeof(b1)==sizeof(b2)
+ if(!b1 || !b2 || !size) {
+ return tsk_false;
+ }
+ for(i=0; i<size; i++) {
+ if(b1[i] != b2[i]) {
+ return tsk_false;
+ }
+ }
+ return tsk_true;
}
@@ -82,23 +82,23 @@ int main()
#endif
{
#if RUN_TEST_LOOP
- for(;;)
+ for(;;)
#endif
- {
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
-
+ {
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 - 2010 Mamadou Diop \n\n");
+
#if RUN_TEST_ALL || RUN_TEST_PACKING
- test_packing();
+ test_packing();
#endif
#if RUN_TEST_ALL || RUN_TEST_TPDU
- test_tpdu();
+ test_tpdu();
#endif
#if RUN_TEST_ALL || RUN_TEST_RPDU
- test_rpdu();
+ test_rpdu();
#endif
- }
+ }
} \ No newline at end of file
diff --git a/tinySMS/test/test_packing.h b/tinySMS/test/test_packing.h
index d37ef33..f83da14 100755
--- a/tinySMS/test/test_packing.h
+++ b/tinySMS/test/test_packing.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -22,119 +22,118 @@
#ifndef _TEST_SMSPACKING_H
#define _TEST_SMSPACKING_H
-typedef struct test_message_7bit_s{
- const char* ascii;
- const char* _7bit;
+typedef struct test_message_7bit_s {
+ const char* ascii;
+ const char* _7bit;
}
test_message_7bit_t;
-test_message_7bit_t test_messages_7bit[] =
-{
- "a","\x61",
- "ab","\x61\x31",
- "abc","\x61\xF1\x18",
- "abcdefg","\x61\xF1\x98\x5C\x36\x9F\x01",
- "abcdefgh","\x61\xF1\x98\x5C\x36\x9F\xD1",
- "abcdefghi","\x61\xF1\x98\x5C\x36\x9F\xD1\x69",
- "abcdefgh12345678","\x61\xF1\x98\x5C\x36\x9F\xD1\x31\xD9\x8C\x56\xB3\xDD\x70",
- "abcdefgh123456789","\x61\xF1\x98\x5C\x36\x9F\xD1\x31\xD9\x8C\x56\xB3\xDD\x70\x39",
- "This is a test sms message","\x54\x74\x7A\x0E\x4A\xCF\x41\x61\x10\xBD\x3C\xA7\x83\xE6\xED\x39\xA8\x5D\x9E\xCF\xC3\xE7\x32",
- "salut","\xF3\x30\xBB\x4E\x07",
- "hellohello","\xE8\x32\x9B\xFD\x46\x97\xD9\xEC\x37",
+test_message_7bit_t test_messages_7bit[] = {
+ "a","\x61",
+ "ab","\x61\x31",
+ "abc","\x61\xF1\x18",
+ "abcdefg","\x61\xF1\x98\x5C\x36\x9F\x01",
+ "abcdefgh","\x61\xF1\x98\x5C\x36\x9F\xD1",
+ "abcdefghi","\x61\xF1\x98\x5C\x36\x9F\xD1\x69",
+ "abcdefgh12345678","\x61\xF1\x98\x5C\x36\x9F\xD1\x31\xD9\x8C\x56\xB3\xDD\x70",
+ "abcdefgh123456789","\x61\xF1\x98\x5C\x36\x9F\xD1\x31\xD9\x8C\x56\xB3\xDD\x70\x39",
+ "This is a test sms message","\x54\x74\x7A\x0E\x4A\xCF\x41\x61\x10\xBD\x3C\xA7\x83\xE6\xED\x39\xA8\x5D\x9E\xCF\xC3\xE7\x32",
+ "salut","\xF3\x30\xBB\x4E\x07",
+ "hellohello","\xE8\x32\x9B\xFD\x46\x97\xD9\xEC\x37",
};
void test_7bit()
{
- tsk_size_t i;
- tsk_buffer_t* buffer;
- char* temp;
+ tsk_size_t i;
+ tsk_buffer_t* buffer;
+ char* temp;
- /* To 7bit */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((buffer = tsms_pack_to_7bit(test_messages_7bit[i].ascii))){
- /*if((temp = tohex(buffer->data, buffer->size))){
- if(!tsk_striequals(temp, test_messages_7bit[i]._7bit)){
- TSK_DEBUG_ERROR("tsms_pack_to_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
- }
- TSK_FREE(temp);
- }*/
- if(!bin_equals(buffer->data, test_messages_7bit[i]._7bit, buffer->size)){
- TSK_DEBUG_ERROR("tsms_pack_to_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
+ /* To 7bit */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((buffer = tsms_pack_to_7bit(test_messages_7bit[i].ascii))) {
+ /*if((temp = tohex(buffer->data, buffer->size))){
+ if(!tsk_striequals(temp, test_messages_7bit[i]._7bit)){
+ TSK_DEBUG_ERROR("tsms_pack_to_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
+ }
+ TSK_FREE(temp);
+ }*/
+ if(!bin_equals(buffer->data, test_messages_7bit[i]._7bit, buffer->size)) {
+ TSK_DEBUG_ERROR("tsms_pack_to_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
- /* From 7bit */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((temp = tsms_pack_from_7bit(test_messages_7bit[i]._7bit, (tsk_size_t)tsk_strlen(test_messages_7bit[i]._7bit)))){
- if(!tsk_striequals(temp, test_messages_7bit[i].ascii)){
- TSK_DEBUG_ERROR("tsms_pack_from_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
- }
- TSK_FREE(temp);
- }
- }
+ /* From 7bit */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((temp = tsms_pack_from_7bit(test_messages_7bit[i]._7bit, (tsk_size_t)tsk_strlen(test_messages_7bit[i]._7bit)))) {
+ if(!tsk_striequals(temp, test_messages_7bit[i].ascii)) {
+ TSK_DEBUG_ERROR("tsms_pack_from_7bit(\"%s\") Failed.\n", test_messages_7bit[i].ascii);
+ }
+ TSK_FREE(temp);
+ }
+ }
}
void test_8bit()
{
- tsk_size_t i;
- tsk_buffer_t* buffer;
- char* temp;
-
- /* To 8bit */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((buffer = tsms_pack_to_8bit(test_messages_7bit[i].ascii))){
- if(!tsk_strequals(buffer->data, test_messages_7bit[i].ascii)){
- TSK_DEBUG_INFO("tsms_pack_to_8bit(%s) Failed", test_messages_7bit[i].ascii);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
+ tsk_size_t i;
+ tsk_buffer_t* buffer;
+ char* temp;
+
+ /* To 8bit */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((buffer = tsms_pack_to_8bit(test_messages_7bit[i].ascii))) {
+ if(!tsk_strequals(buffer->data, test_messages_7bit[i].ascii)) {
+ TSK_DEBUG_INFO("tsms_pack_to_8bit(%s) Failed", test_messages_7bit[i].ascii);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
- /* From 8bit */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((temp = tsms_pack_from_8bit(test_messages_7bit[i].ascii, (tsk_size_t)tsk_strlen(test_messages_7bit[i].ascii)))){
- if(!tsk_strequals(temp, test_messages_7bit[i].ascii)){
- TSK_DEBUG_INFO("tsms_pack_from_8bit(%s) Failed", test_messages_7bit[i].ascii);
- }
- TSK_FREE(temp);
- }
- }
+ /* From 8bit */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((temp = tsms_pack_from_8bit(test_messages_7bit[i].ascii, (tsk_size_t)tsk_strlen(test_messages_7bit[i].ascii)))) {
+ if(!tsk_strequals(temp, test_messages_7bit[i].ascii)) {
+ TSK_DEBUG_INFO("tsms_pack_from_8bit(%s) Failed", test_messages_7bit[i].ascii);
+ }
+ TSK_FREE(temp);
+ }
+ }
}
void test_ucs2()
{
- tsk_size_t i;
- tsk_buffer_t* buffer;
- char* temp;
-
- /* To ucs2 */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((buffer = tsms_pack_to_ucs2(test_messages_7bit[i].ascii))){
- if(!tsk_strequals(buffer->data, test_messages_7bit[i].ascii)){
- TSK_DEBUG_INFO("tsms_pack_to_ucs2(%s) Failed", test_messages_7bit[i].ascii);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- }
+ tsk_size_t i;
+ tsk_buffer_t* buffer;
+ char* temp;
+
+ /* To ucs2 */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((buffer = tsms_pack_to_ucs2(test_messages_7bit[i].ascii))) {
+ if(!tsk_strequals(buffer->data, test_messages_7bit[i].ascii)) {
+ TSK_DEBUG_INFO("tsms_pack_to_ucs2(%s) Failed", test_messages_7bit[i].ascii);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ }
- /* From ucs2 */
- for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++){
- if((temp = tsms_pack_from_ucs2(test_messages_7bit[i].ascii, (tsk_size_t)tsk_strlen(test_messages_7bit[i].ascii)))){
- if(!tsk_strequals(temp, test_messages_7bit[i].ascii)){
- TSK_DEBUG_INFO("tsms_pack_from_ucs2(%s) Failed", test_messages_7bit[i].ascii);
- }
- TSK_FREE(temp);
- }
- }
+ /* From ucs2 */
+ for(i=0; i<sizeof(test_messages_7bit)/sizeof(test_message_7bit_t); i++) {
+ if((temp = tsms_pack_from_ucs2(test_messages_7bit[i].ascii, (tsk_size_t)tsk_strlen(test_messages_7bit[i].ascii)))) {
+ if(!tsk_strequals(temp, test_messages_7bit[i].ascii)) {
+ TSK_DEBUG_INFO("tsms_pack_from_ucs2(%s) Failed", test_messages_7bit[i].ascii);
+ }
+ TSK_FREE(temp);
+ }
+ }
}
void test_packing()
{
- test_ucs2();
- test_8bit();
- test_7bit();
+ test_ucs2();
+ test_8bit();
+ test_7bit();
}
#endif /* _TEST_SMSPACKING_H */
diff --git a/tinySMS/test/test_rpdu.h b/tinySMS/test/test_rpdu.h
index 11044e7..066ab0a 100755
--- a/tinySMS/test/test_rpdu.h
+++ b/tinySMS/test/test_rpdu.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -24,249 +24,244 @@
void test_i_rpdata(const void* data, tsk_size_t size, tsk_bool_t MobOrig)
{
- tsms_rpdu_message_t* rp_message = tsk_null;
- tsms_tpdu_message_t* tpdu = tsk_null;
+ tsms_rpdu_message_t* rp_message = tsk_null;
+ tsms_tpdu_message_t* tpdu = tsk_null;
- if(!(rp_message = tsms_rpdu_message_deserialize(data, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
- goto bail;
- }
-
- switch(rp_message->mti){
- case tsms_rpdu_type_data_mo:
- case tsms_rpdu_type_data_mt:
- {
- char* ascii = tsk_null;
- tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
- if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))){
- if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo){ /* SMS-SUBMIT or SMS-DELIVER? */
- if((ascii = tsms_tpdu_message_get_payload(tpdu))){
- TSK_DEBUG_INFO("ASCII message=%s", ascii);
- TSK_FREE(ascii);
- }
- }
- }
- break;
- }
- case tsms_rpdu_type_ack_mo:
- case tsms_rpdu_type_ack_mt:
- {
- tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
- // ...do whatever you want
- if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))){
- // ...do whatever you want
- }
- TSK_DEBUG_INFO("RP-ACK");
- break;
- }
- case tsms_rpdu_type_error_mo:
- case tsms_rpdu_type_error_mt:
- {
- tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
- // ...do whatever you want
- if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))){
- // ...do whatever you want
- }
- TSK_DEBUG_INFO("RP-ERROR");
- break;
- }
- case tsms_rpdu_type_smma_mo:
- {
- tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
- // ...do whatever you want
- TSK_DEBUG_INFO("RP-SMMA");
- break;
- }
- default:
- {
- TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
- break;
- }
- }
+ if(!(rp_message = tsms_rpdu_message_deserialize(data, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
+ goto bail;
+ }
+
+ switch(rp_message->mti) {
+ case tsms_rpdu_type_data_mo:
+ case tsms_rpdu_type_data_mt: {
+ char* ascii = tsk_null;
+ tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
+ if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))) {
+ if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo) { /* SMS-SUBMIT or SMS-DELIVER? */
+ if((ascii = tsms_tpdu_message_get_payload(tpdu))) {
+ TSK_DEBUG_INFO("ASCII message=%s", ascii);
+ TSK_FREE(ascii);
+ }
+ }
+ }
+ break;
+ }
+ case tsms_rpdu_type_ack_mo:
+ case tsms_rpdu_type_ack_mt: {
+ tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
+ // ...do whatever you want
+ if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ TSK_DEBUG_INFO("RP-ACK");
+ break;
+ }
+ case tsms_rpdu_type_error_mo:
+ case tsms_rpdu_type_error_mt: {
+ tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
+ // ...do whatever you want
+ if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ TSK_DEBUG_INFO("RP-ERROR");
+ break;
+ }
+ case tsms_rpdu_type_smma_mo: {
+ tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
+ // ...do whatever you want
+ TSK_DEBUG_INFO("RP-SMMA");
+ break;
+ }
+ default: {
+ TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
+ break;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(rp_message);
- TSK_OBJECT_SAFE_FREE(tpdu);
+ TSK_OBJECT_SAFE_FREE(rp_message);
+ TSK_OBJECT_SAFE_FREE(tpdu);
}
void test_o_rpdata_submit()
{
- //== Sending RP-DATA(SMS-SUBMIT) ==
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_submit_t* sms_submit = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
- const char* smsc = "+331000009";
- const char* destination = "+333361234567";
- const char* short_message = "hello world";
- uint8_t mr = 0xF5;
- uint8_t message_number = 0xF8;
- char* hex;
-
- // create SMS-SUBMIT message
- sms_submit = tsms_tpdu_submit_create(mr, smsc, destination);
- // Set content for SMS-SUBMIT
- if((buffer = tsms_pack_to_7bit(short_message))){
- ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- // create RP-DATA message and print its content (for test only)
- rp_data = tsms_rpdu_data_create_mo(mr, smsc, TSMS_TPDU_MESSAGE(sms_submit));
- if((hex = tsms_rpdu_message_tohexastring(TSMS_RPDU_MESSAGE(rp_data)))){
- TSK_DEBUG_INFO("RP-DATA=%s", hex);
- TSK_FREE(hex);
- }
+ //== Sending RP-DATA(SMS-SUBMIT) ==
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_submit_t* sms_submit = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+ const char* smsc = "+331000009";
+ const char* destination = "+333361234567";
+ const char* short_message = "hello world";
+ uint8_t mr = 0xF5;
+ uint8_t message_number = 0xF8;
+ char* hex;
+
+ // create SMS-SUBMIT message
+ sms_submit = tsms_tpdu_submit_create(mr, smsc, destination);
+ // Set content for SMS-SUBMIT
+ if((buffer = tsms_pack_to_7bit(short_message))) {
+ ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ // create RP-DATA message and print its content (for test only)
+ rp_data = tsms_rpdu_data_create_mo(mr, smsc, TSMS_TPDU_MESSAGE(sms_submit));
+ if((hex = tsms_rpdu_message_tohexastring(TSMS_RPDU_MESSAGE(rp_data)))) {
+ TSK_DEBUG_INFO("RP-DATA=%s", hex);
+ TSK_FREE(hex);
+ }
- // serialize
- buffer = tsk_buffer_create_null();
- ret = tsms_rpdu_data_serialize(rp_data, buffer);
- // send(socket, buffer->data, buffer->size);
- // print result (hex) to the console
- printhex("==RP-DATA(SMS-SUBMIT):", buffer->data, buffer->size);
-
- // receiving
- test_i_rpdata(buffer->data, buffer->size, tsk_true);
+ // serialize
+ buffer = tsk_buffer_create_null();
+ ret = tsms_rpdu_data_serialize(rp_data, buffer);
+ // send(socket, buffer->data, buffer->size);
+ // print result (hex) to the console
+ printhex("==RP-DATA(SMS-SUBMIT):", buffer->data, buffer->size);
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_submit);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ // receiving
+ test_i_rpdata(buffer->data, buffer->size, tsk_true);
+
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_submit);
+ TSK_OBJECT_SAFE_FREE(rp_data);
}
void test_o_rpdata_deliver()
{
- //== Sending RP-DATA(SMS-DELIVER) ==
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_deliver_t* sms_deliver = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
- const char* smsc = "+331000000";
- const char* originator = "+3361234567";
- const char* content = "hello world!";
-
- // create SMS-DELIVER message
- sms_deliver = tsms_tpdu_deliver_create(smsc, originator);
- // Set content for SMS-DELIVER
- if((buffer = tsms_pack_to_7bit(content))){
- ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- // create RP-DATA message
- rp_data = tsms_rpdu_data_create_mt(0x01, smsc, TSMS_TPDU_MESSAGE(sms_deliver));
- // serialize
- buffer = tsk_buffer_create_null();
- ret = tsms_rpdu_data_serialize(rp_data, buffer);
- // send(socket, buffer->data, buffer->size);
- // print result (hex) to the console
- printhex("==RP-DATA(SMS-DELIVER):", buffer->data, buffer->size);
-
- // receiving
- test_i_rpdata(buffer->data, buffer->size, tsk_false);
+ //== Sending RP-DATA(SMS-DELIVER) ==
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_deliver_t* sms_deliver = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+ const char* smsc = "+331000000";
+ const char* originator = "+3361234567";
+ const char* content = "hello world!";
+
+ // create SMS-DELIVER message
+ sms_deliver = tsms_tpdu_deliver_create(smsc, originator);
+ // Set content for SMS-DELIVER
+ if((buffer = tsms_pack_to_7bit(content))) {
+ ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ // create RP-DATA message
+ rp_data = tsms_rpdu_data_create_mt(0x01, smsc, TSMS_TPDU_MESSAGE(sms_deliver));
+ // serialize
+ buffer = tsk_buffer_create_null();
+ ret = tsms_rpdu_data_serialize(rp_data, buffer);
+ // send(socket, buffer->data, buffer->size);
+ // print result (hex) to the console
+ printhex("==RP-DATA(SMS-DELIVER):", buffer->data, buffer->size);
+
+ // receiving
+ test_i_rpdata(buffer->data, buffer->size, tsk_false);
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_deliver);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_deliver);
+ TSK_OBJECT_SAFE_FREE(rp_data);
}
void test_o_rpdata_smma()
{
- //== Sending RP-SMMA ==
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_rpdu_smma_t* rp_smma = tsk_null;
- uint8_t mr = 0xF5;
-
- // create RP-SMMA message
- rp_smma = tsms_rpdu_smma_create(mr);
- // serialize
- buffer = tsk_buffer_create_null();
- ret = tsms_rpdu_data_serialize(rp_smma, buffer);
- // send(socket, buffer->data, buffer->size);
- // print result (hex) to the console
- printhex("==RP-SMMA:", buffer->data, buffer->size);
-
- // receiving
- test_i_rpdata(buffer->data, buffer->size, tsk_true);
+ //== Sending RP-SMMA ==
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_rpdu_smma_t* rp_smma = tsk_null;
+ uint8_t mr = 0xF5;
+
+ // create RP-SMMA message
+ rp_smma = tsms_rpdu_smma_create(mr);
+ // serialize
+ buffer = tsk_buffer_create_null();
+ ret = tsms_rpdu_data_serialize(rp_smma, buffer);
+ // send(socket, buffer->data, buffer->size);
+ // print result (hex) to the console
+ printhex("==RP-SMMA:", buffer->data, buffer->size);
+
+ // receiving
+ test_i_rpdata(buffer->data, buffer->size, tsk_true);
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(rp_smma);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(rp_smma);
}
void test_o_rpdata_ack()
{
- //== Sending RP-ACK(SMS-DELIVER-REPORT) ==
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_ack_t* rp_ack= tsk_null;
- const char* smsc = "+331000000";
- tsk_bool_t isSUBMIT = tsk_false; /* isDELIVER */
- tsk_bool_t isERROR = tsk_false;
- uint8_t mr = 0xF5;
+ //== Sending RP-ACK(SMS-DELIVER-REPORT) ==
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_ack_t* rp_ack= tsk_null;
+ const char* smsc = "+331000000";
+ tsk_bool_t isSUBMIT = tsk_false; /* isDELIVER */
+ tsk_bool_t isERROR = tsk_false;
+ uint8_t mr = 0xF5;
- // create SMS-DELIVER-REPORT message
- sms_report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
- // create RP-ACK message (From MS to SC)
- rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report));
- // serialize
- buffer = tsk_buffer_create_null();
- if(!(ret = tsms_rpdu_data_serialize(rp_ack, buffer))){
- // send(socket, buffer->data, buffer->size);
- // print result (hex) to the console
- printhex("==RP-ACK(SMS-DELIVER-REPORT):", buffer->data, buffer->size);
- }
+ // create SMS-DELIVER-REPORT message
+ sms_report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
+ // create RP-ACK message (From MS to SC)
+ rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report));
+ // serialize
+ buffer = tsk_buffer_create_null();
+ if(!(ret = tsms_rpdu_data_serialize(rp_ack, buffer))) {
+ // send(socket, buffer->data, buffer->size);
+ // print result (hex) to the console
+ printhex("==RP-ACK(SMS-DELIVER-REPORT):", buffer->data, buffer->size);
+ }
- // receiving
- test_i_rpdata(buffer->data, buffer->size, tsk_true);
+ // receiving
+ test_i_rpdata(buffer->data, buffer->size, tsk_true);
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_ack);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_ack);
}
void test_o_rpdata_error()
{
- //== Sending RP-ERROR(SMS-DELIVER-REPORT) ==
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_error_t* rp_error= tsk_null;
- tsk_bool_t isSUBMIT = tsk_false; /* isDELIVER */
- tsk_bool_t isERROR = tsk_true;
- const char* smsc = "+331000000";
- uint8_t mr = 0xF5;
+ //== Sending RP-ERROR(SMS-DELIVER-REPORT) ==
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_error_t* rp_error= tsk_null;
+ tsk_bool_t isSUBMIT = tsk_false; /* isDELIVER */
+ tsk_bool_t isERROR = tsk_true;
+ const char* smsc = "+331000000";
+ uint8_t mr = 0xF5;
- // create SMS-DELIVER-REPORT message
- sms_report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
- // create RP-ERROR message
- rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/);
- // serialize
- buffer = tsk_buffer_create_null();
- if(!(ret = tsms_rpdu_data_serialize(rp_error, buffer))){
- // send(socket, buffer->data, buffer->size);
- // print result (hex) to the console
- printhex("==RP-ERROR(SMS-DELIVER-REPORT):", buffer->data, buffer->size);
- }
+ // create SMS-DELIVER-REPORT message
+ sms_report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
+ // create RP-ERROR message
+ rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/);
+ // serialize
+ buffer = tsk_buffer_create_null();
+ if(!(ret = tsms_rpdu_data_serialize(rp_error, buffer))) {
+ // send(socket, buffer->data, buffer->size);
+ // print result (hex) to the console
+ printhex("==RP-ERROR(SMS-DELIVER-REPORT):", buffer->data, buffer->size);
+ }
- // receiving
- test_i_rpdata(buffer->data, buffer->size, tsk_true);
+ // receiving
+ test_i_rpdata(buffer->data, buffer->size, tsk_true);
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_error);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_error);
}
void test_rpdu()
{
- test_o_rpdata_submit();
- //test_o_rpdata_deliver();
- //test_o_rpdata_smma();
- //test_o_rpdata_ack();
- //test_o_rpdata_error();
+ test_o_rpdata_submit();
+ //test_o_rpdata_deliver();
+ //test_o_rpdata_smma();
+ //test_o_rpdata_ack();
+ //test_o_rpdata_error();
- //const char* data = "\x03\x01\x41\x09\x01\x00\x01\x80\x01\x32\x42\x00\x69";
- //test_i_rpdata(data, 13, tsk_false);
+ //const char* data = "\x03\x01\x41\x09\x01\x00\x01\x80\x01\x32\x42\x00\x69";
+ //test_i_rpdata(data, 13, tsk_false);
}
#endif /* _TEST_SMSRPDU_H */
diff --git a/tinySMS/test/test_tpdu.h b/tinySMS/test/test_tpdu.h
index 27433f8..fe3b617 100755
--- a/tinySMS/test/test_tpdu.h
+++ b/tinySMS/test/test_tpdu.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -28,188 +28,188 @@ static uint8_t __pdu_last_mr = 0;
void test_submit()
{
- int ret;
- tsms_tpdu_submit_t* submit = tsk_null;
- tsk_buffer_t* buffer = tsk_null;
- char* hex;
- const char* smsc = "+331000009";
- const char* destination = "+333361234567";
- const char* short_message = "hello world";
- uint8_t mr = 0xF5;
-
- submit = tsms_tpdu_submit_create(mr, smsc, destination);
-
- /* encode the user data to GSM 7-bit alphabet */
- if((buffer = tsms_pack_to_7bit(short_message))){
- ret = tsms_tpdu_submit_set_userdata(submit, buffer, tsms_alpha_7bit);
- if((hex = tsms_tpdu_submit_tohexastring(submit))){
- TSK_DEBUG_INFO("SMS-SUBMIT=%s", hex);
- TSK_FREE(hex);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
-
- /* receiving */
- buffer = tsk_buffer_create_null();
- ret = tsms_tpdu_submit_serialize(submit, buffer);
- // send(socket, buffer->data, buffer->size);
-
- TSK_OBJECT_SAFE_FREE(submit);
- submit = (tsms_tpdu_submit_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
- if((hex = tsms_tpdu_submit_tohexastring(submit))){
- TSK_DEBUG_INFO("SMS-SUBMIT=%s", hex);
- TSK_FREE(hex);
- }
-
- TSK_OBJECT_SAFE_FREE(submit);
- TSK_OBJECT_SAFE_FREE(buffer);
-
- printf("==========\n");
+ int ret;
+ tsms_tpdu_submit_t* submit = tsk_null;
+ tsk_buffer_t* buffer = tsk_null;
+ char* hex;
+ const char* smsc = "+331000009";
+ const char* destination = "+333361234567";
+ const char* short_message = "hello world";
+ uint8_t mr = 0xF5;
+
+ submit = tsms_tpdu_submit_create(mr, smsc, destination);
+
+ /* encode the user data to GSM 7-bit alphabet */
+ if((buffer = tsms_pack_to_7bit(short_message))) {
+ ret = tsms_tpdu_submit_set_userdata(submit, buffer, tsms_alpha_7bit);
+ if((hex = tsms_tpdu_submit_tohexastring(submit))) {
+ TSK_DEBUG_INFO("SMS-SUBMIT=%s", hex);
+ TSK_FREE(hex);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+
+ /* receiving */
+ buffer = tsk_buffer_create_null();
+ ret = tsms_tpdu_submit_serialize(submit, buffer);
+ // send(socket, buffer->data, buffer->size);
+
+ TSK_OBJECT_SAFE_FREE(submit);
+ submit = (tsms_tpdu_submit_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
+ if((hex = tsms_tpdu_submit_tohexastring(submit))) {
+ TSK_DEBUG_INFO("SMS-SUBMIT=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ TSK_OBJECT_SAFE_FREE(submit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+ printf("==========\n");
}
void test_deliver()
{
- int ret;
- tsms_tpdu_deliver_t* deliver = tsk_null;
- tsk_buffer_t* buffer = tsk_null;
- char* hex;
-
- deliver = tsms_tpdu_deliver_create("+27381000015", "+46708251358");
-
- /* sending */
- if((buffer = tsms_pack_to_7bit(USER_DATA))){
- ret = tsms_tpdu_deliver_set_userdata(deliver, buffer, tsms_alpha_7bit);
- if((hex = tsms_tpdu_deliver_tohexastring(deliver))){
- TSK_DEBUG_INFO("SMS-DELIVER=%s", hex);
- TSK_FREE(hex);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
-
- /* receiving */
- buffer = tsk_buffer_create_null();
- tsms_tpdu_deliver_serialize(deliver, buffer);
-
- TSK_OBJECT_SAFE_FREE(deliver);
-
- //{
- // tsms_tpdu_message_t* sms_any = tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
- // if(sms_any && sms_any->mti == tsms_tpdu_mti_deliver_mt){
- // //tsms_tpdu_deliver_t* sms_deliver = TSMS_TPDU_DELIVER(sms_any); ==> Yes we can !
- // char* ascii;
- // if((ascii = tsms_tpdu_message_get_payload(sms_any))){
- // TSK_DEBUG_INFO("Message=%s", ascii);
- // TSK_FREE(ascii);
- // }
- // }
- // TSK_OBJECT_SAFE_FREE(sms_any);
- //}
-
- deliver = (tsms_tpdu_deliver_t*)tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
- if((hex = tsms_tpdu_deliver_tohexastring(deliver))){
- TSK_DEBUG_INFO("SMS-DELIVER=%s", hex);
- TSK_FREE(hex);
- }
-
- TSK_OBJECT_SAFE_FREE(deliver);
- TSK_OBJECT_SAFE_FREE(buffer);
-
- printf("==========\n");
+ int ret;
+ tsms_tpdu_deliver_t* deliver = tsk_null;
+ tsk_buffer_t* buffer = tsk_null;
+ char* hex;
+
+ deliver = tsms_tpdu_deliver_create("+27381000015", "+46708251358");
+
+ /* sending */
+ if((buffer = tsms_pack_to_7bit(USER_DATA))) {
+ ret = tsms_tpdu_deliver_set_userdata(deliver, buffer, tsms_alpha_7bit);
+ if((hex = tsms_tpdu_deliver_tohexastring(deliver))) {
+ TSK_DEBUG_INFO("SMS-DELIVER=%s", hex);
+ TSK_FREE(hex);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+
+ /* receiving */
+ buffer = tsk_buffer_create_null();
+ tsms_tpdu_deliver_serialize(deliver, buffer);
+
+ TSK_OBJECT_SAFE_FREE(deliver);
+
+ //{
+ // tsms_tpdu_message_t* sms_any = tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
+ // if(sms_any && sms_any->mti == tsms_tpdu_mti_deliver_mt){
+ // //tsms_tpdu_deliver_t* sms_deliver = TSMS_TPDU_DELIVER(sms_any); ==> Yes we can !
+ // char* ascii;
+ // if((ascii = tsms_tpdu_message_get_payload(sms_any))){
+ // TSK_DEBUG_INFO("Message=%s", ascii);
+ // TSK_FREE(ascii);
+ // }
+ // }
+ // TSK_OBJECT_SAFE_FREE(sms_any);
+ //}
+
+ deliver = (tsms_tpdu_deliver_t*)tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
+ if((hex = tsms_tpdu_deliver_tohexastring(deliver))) {
+ TSK_DEBUG_INFO("SMS-DELIVER=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ TSK_OBJECT_SAFE_FREE(deliver);
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+ printf("==========\n");
}
void test_report()
{
- int ret;
- tsms_tpdu_report_t* report = tsk_null;
- tsk_buffer_t* buffer = tsk_null;
- char* hex;
- const char* smsc = "+331000009";
- tsk_bool_t isSUBMIT = tsk_false;
- tsk_bool_t isERROR = tsk_false;
-
- report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
-
- /* sending */
- if((buffer = tsms_pack_to_7bit(USER_DATA))){
- ret = tsms_tpdu_deliver_set_userdata(report, buffer, tsms_alpha_7bit);
- if((hex = tsms_tpdu_deliver_tohexastring(report))){
- TSK_DEBUG_INFO("SMS-DELIVER-REPORT for RP-ERROR=%s", hex);
- TSK_FREE(hex);
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- }
-
- /* receiving */
- buffer = tsk_buffer_create_null();
- tsms_tpdu_report_serialize(report, buffer);
-
- TSK_OBJECT_SAFE_FREE(report);
- report = (tsms_tpdu_report_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
- if((hex = tsms_tpdu_report_tohexastring(report))){
- TSK_DEBUG_INFO("SMS-DELIVER-REPORT for RP-ERROR=%s", hex);
- TSK_FREE(hex);
- }
-
- TSK_OBJECT_SAFE_FREE(report);
- TSK_OBJECT_SAFE_FREE(buffer);
-
- printf("==========\n");
+ int ret;
+ tsms_tpdu_report_t* report = tsk_null;
+ tsk_buffer_t* buffer = tsk_null;
+ char* hex;
+ const char* smsc = "+331000009";
+ tsk_bool_t isSUBMIT = tsk_false;
+ tsk_bool_t isERROR = tsk_false;
+
+ report = tsms_tpdu_report_create(smsc, isSUBMIT, isERROR);
+
+ /* sending */
+ if((buffer = tsms_pack_to_7bit(USER_DATA))) {
+ ret = tsms_tpdu_deliver_set_userdata(report, buffer, tsms_alpha_7bit);
+ if((hex = tsms_tpdu_deliver_tohexastring(report))) {
+ TSK_DEBUG_INFO("SMS-DELIVER-REPORT for RP-ERROR=%s", hex);
+ TSK_FREE(hex);
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+
+ /* receiving */
+ buffer = tsk_buffer_create_null();
+ tsms_tpdu_report_serialize(report, buffer);
+
+ TSK_OBJECT_SAFE_FREE(report);
+ report = (tsms_tpdu_report_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
+ if((hex = tsms_tpdu_report_tohexastring(report))) {
+ TSK_DEBUG_INFO("SMS-DELIVER-REPORT for RP-ERROR=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ TSK_OBJECT_SAFE_FREE(report);
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+ printf("==========\n");
}
void test_command()
{
- tsms_tpdu_command_t* command = tsk_null;
- char* hex;
- tsk_buffer_t* buffer = tsk_null;
- const char* smsc = "+331000009";
- const char* destination = "+333361234567";
- uint8_t mr = 0xF5;
- uint8_t message_number = 0xF8;
-
- command = tsms_tpdu_command_create(mr, smsc, destination, message_number, tsms_tpdu_cmd_delete);
-
- /*sending*/
- if((hex = tsms_tpdu_command_tohexastring(command))){
- TSK_DEBUG_INFO("SMS-COMMAND=%s", hex);
- TSK_FREE(hex);
- }
-
- /* receiving */
- buffer = tsk_buffer_create_null();
- tsms_tpdu_command_serialize(command, buffer);
-
- TSK_OBJECT_SAFE_FREE(command);
- command = (tsms_tpdu_command_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
- if((hex = tsms_tpdu_command_tohexastring(command))){
- TSK_DEBUG_INFO("SMS-COMMAND=%s", hex);
- TSK_FREE(hex);
- }
-
- TSK_OBJECT_SAFE_FREE(command);
- TSK_OBJECT_SAFE_FREE(buffer);
-
- printf("==========\n");
+ tsms_tpdu_command_t* command = tsk_null;
+ char* hex;
+ tsk_buffer_t* buffer = tsk_null;
+ const char* smsc = "+331000009";
+ const char* destination = "+333361234567";
+ uint8_t mr = 0xF5;
+ uint8_t message_number = 0xF8;
+
+ command = tsms_tpdu_command_create(mr, smsc, destination, message_number, tsms_tpdu_cmd_delete);
+
+ /*sending*/
+ if((hex = tsms_tpdu_command_tohexastring(command))) {
+ TSK_DEBUG_INFO("SMS-COMMAND=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ /* receiving */
+ buffer = tsk_buffer_create_null();
+ tsms_tpdu_command_serialize(command, buffer);
+
+ TSK_OBJECT_SAFE_FREE(command);
+ command = (tsms_tpdu_command_t*)tsms_tpdu_message_deserialize_mo(buffer->data, buffer->size);
+ if((hex = tsms_tpdu_command_tohexastring(command))) {
+ TSK_DEBUG_INFO("SMS-COMMAND=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ TSK_OBJECT_SAFE_FREE(command);
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+ printf("==========\n");
}
void test_sreport()
{
- tsms_tpdu_status_report_t* sreport = tsk_null;
- char* hex;
- tsk_buffer_t* buffer = tsk_null;
-
- sreport = tsms_tpdu_status_report_create(__pdu_last_mr++, "+3310000", "+332666", tsms_tpdu_status_busy, tsk_true);
-
- if((hex = tsms_tpdu_report_tohexastring(sreport))){
- TSK_DEBUG_INFO("SMS-STATUS-REPORT=%s", hex);
- TSK_FREE(hex);
- }
-
- /* receiving */
- buffer = tsk_buffer_create_null();
- tsms_tpdu_status_report_serialize(sreport, buffer);
-
-
+ tsms_tpdu_status_report_t* sreport = tsk_null;
+ char* hex;
+ tsk_buffer_t* buffer = tsk_null;
+
+ sreport = tsms_tpdu_status_report_create(__pdu_last_mr++, "+3310000", "+332666", tsms_tpdu_status_busy, tsk_true);
+
+ if((hex = tsms_tpdu_report_tohexastring(sreport))) {
+ TSK_DEBUG_INFO("SMS-STATUS-REPORT=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ /* receiving */
+ buffer = tsk_buffer_create_null();
+ tsms_tpdu_status_report_serialize(sreport, buffer);
+
+
//tsms_tpdu_message_t* sms_any = tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
//if(sms_any && sms_any->mti == tsms_tpdu_mti_status_report_mt){
// tsms_tpdu_status_report_t* sms_status_report = TSMS_TPDU_STATUS_REPORT(sms_any);
@@ -223,28 +223,28 @@ void test_sreport()
// }
//}
//TSK_OBJECT_SAFE_FREE(sms_any);
-
- TSK_OBJECT_SAFE_FREE(sreport);
- sreport = (tsms_tpdu_status_report_t*)tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
- if((hex = tsms_tpdu_status_report_tohexastring(sreport))){
- TSK_DEBUG_INFO("SMS-STATUS-REPORT=%s", hex);
- TSK_FREE(hex);
- }
- TSK_OBJECT_SAFE_FREE(sreport);
- TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sreport);
+ sreport = (tsms_tpdu_status_report_t*)tsms_tpdu_message_deserialize_mt(buffer->data, buffer->size);
+ if((hex = tsms_tpdu_status_report_tohexastring(sreport))) {
+ TSK_DEBUG_INFO("SMS-STATUS-REPORT=%s", hex);
+ TSK_FREE(hex);
+ }
+
+ TSK_OBJECT_SAFE_FREE(sreport);
+ TSK_OBJECT_SAFE_FREE(buffer);
- printf("==========\n");
+ printf("==========\n");
}
void test_tpdu()
{
- test_submit();
- test_deliver();
- test_report();
- test_command();
- test_sreport();
+ test_submit();
+ test_deliver();
+ test_report();
+ test_command();
+ test_sreport();
}
#endif /* _TEST_SMSTPDU_H */
diff --git a/tinyXCAP/include/tinyxcap.h b/tinyXCAP/include/tinyxcap.h
index 3f991ac..99bdb73 100755
--- a/tinyXCAP/include/tinyxcap.h
+++ b/tinyXCAP/include/tinyxcap.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyXCAP/include/tinyxcap/txcap_action.h b/tinyXCAP/include/tinyxcap/txcap_action.h
index c14abf5..700051e 100755
--- a/tinyXCAP/include/tinyxcap/txcap_action.h
+++ b/tinyXCAP/include/tinyxcap/txcap_action.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,52 +44,48 @@ TXCAP_BEGIN_DECLS
/** List of all supported types.
*/
-typedef enum txcap_action_type_e
-{
- txcap_atp_create,
- txcap_atp_replace,
- txcap_atp_fetch,
- txcap_atp_delete
+typedef enum txcap_action_type_e {
+ txcap_atp_create,
+ txcap_atp_replace,
+ txcap_atp_fetch,
+ txcap_atp_delete
}
txcap_action_type_t;
/** List of all supported targets.
*/
-typedef enum txcap_action_target_e
-{
- txcap_atg_element,
- txcap_atg_document,
- txcap_atg_attribute
+typedef enum txcap_action_target_e {
+ txcap_atg_element,
+ txcap_atg_document,
+ txcap_atg_attribute
}
txcap_action_target_t;
/** List of all supported options.
* To pass an option to the sesion, use @ref TXCAP_ACTION_SET_OPTION() macro.
*/
-typedef enum txcap_action_option_e
-{
- TXCAP_ACTION_OPTION_TIMEOUT = THTTP_ACTION_OPTION_TIMEOUT,
+typedef enum txcap_action_option_e {
+ TXCAP_ACTION_OPTION_TIMEOUT = THTTP_ACTION_OPTION_TIMEOUT,
- //TXCAP_ACTION_OPTION_*** = 0xFF,
- //TXCAP_ACTION_OPTION_****,
+ //TXCAP_ACTION_OPTION_*** = 0xFF,
+ //TXCAP_ACTION_OPTION_****,
}
txcap_action_option_t;
-typedef enum txcap_action_param_type_e
-{
- txcap_apt_null = 0,
+typedef enum txcap_action_param_type_e {
+ txcap_apt_null = 0,
- txcap_apt_option,
- txcap_apt_header,
- txcap_apt_payload,
- txcap_apt_selector,
- txcap_apt_urlstring
+ txcap_apt_option,
+ txcap_apt_header,
+ txcap_apt_payload,
+ txcap_apt_selector,
+ txcap_apt_urlstring
}
txcap_action_param_type_t;
/**@ingroup txcap_action_group
* @def TXCAP_ACTION_SET_OPTION
-* Adds or updates an option.
+* Adds or updates an option.
* This is a helper macro for @a txcap_action_*() functions.
* @param ID_INT The id of the option to add/update (@ref txcap_action_option_t).
* @param VALUE_STR The new value of the option (<i>const char*</i>).
@@ -130,7 +126,7 @@ int ret = txcap_action_fetch_element(stack,
*/
/**@ingroup txcap_action_group
* @def TXCAP_ACTION_SET_PAYLOAD
-* Adds a content (or payload) to the request. You should also add a content-type header by using
+* Adds a content (or payload) to the request. You should also add a content-type header by using
* @ref TXCAP_ACTION_SET_HEADER() macro. You should not add the content-length header.
* This is a helper macro for @a txcap_action_*() functions.
* @param PAY_PTR A pointer to the payload (<i>const void*</i>).
@@ -158,7 +154,7 @@ int ret = txcap_action_create_element(stack,
* if it's missing. This parameter is mandatory.
* @param ... Node selection steps. You must use @a TXCAP_SELECTOR_NODE_SET_*() macros to set these parameters.
* MUST always ends with @ref TXCAP_SELECTOR_NODE_SET_NULL.
-*
+*
* @code
int ret = txcap_action_fetch_attribute(stack,
// action-level options
@@ -182,7 +178,7 @@ int ret = txcap_action_fetch_attribute(stack,
* @def TXCAP_ACTION_SET_REQUEST_URI
* Sets the request URI. This macro is useful if you want to provide your own request URI instead of using @ref TXCAP_ACTION_SET_SELECTOR.
* @param URI_STR Fully Qualified HTTP/HTTPS URI.
-*
+*
* @code
const char* PAYLOAD = "....";
int ret = txcap_action_create_element(stack,
diff --git a/tinyXCAP/include/tinyxcap/txcap_auid.h b/tinyXCAP/include/tinyxcap/txcap_auid.h
index 9a257a1..e9dddc0 100755
--- a/tinyXCAP/include/tinyxcap/txcap_auid.h
+++ b/tinyXCAP/include/tinyxcap/txcap_auid.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,13 +40,13 @@ TXCAP_BEGIN_DECLS
#define TXCAP_AUID_IETF_XCAP_CAPS_MIME_TYPE "application/xcap-caps+xml"
#define TXCAP_AUID_IETF_XCAP_CAPS_NS "urn:ietf:params:xml:ns:xcap-caps"
#define TXCAP_AUID_IETF_XCAP_CAPS_DOC "index"
-
+
/*== resource-lists ==*/
#define TXCAP_AUID_IETF_RESOURCE_LISTS_ID "resource-lists"
#define TXCAP_AUID_IETF_RESOURCE_LISTS_MIME_TYPE "application/resource-lists+xml"
#define TXCAP_AUID_IETF_RESOURCE_LISTS_NS "urn:ietf:params:xml:ns:resource-lists"
#define TXCAP_AUID_IETF_RESOURCE_LISTS_DOC "index"
-
+
/*== rls-services ==*/
#define TXCAP_AUID_IETF_RLS_SERVICES_ID "rls-services"
#define TXCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE "application/rls-services+xml"
@@ -110,37 +110,35 @@ TXCAP_BEGIN_DECLS
/** List of supported AUIDs.
*/
-typedef enum txcap_auid_type_e
-{
- tauid_dummy, /**< any auid */
-
- tauid_ietf_xcap_caps, /**< xcap-caps */
- tauid_ietf_resource_lists, /**< resource-lists */
- tauid_ietf_rls_services, /**< rls-services */
- tauid_ietf_pres_rules, /**< pres-rules */
- tauid_ietf_directory, /**< directory */
-
- tauid_oma_conv_history, /**< org.openmobilealliance.conv-history */
- tauid_oma_pres_rules, /**< org.openmobilealliance.pres-rules */
- tauid_oma_directory, /**< org.openmobilealliance.xcap-directory */
- tauid_oma_deferred_list, /**< org.openmobilealliance.deferred-list */
- tauid_oma_pres_content, /**< org.openmobilealliance.pres-content*/
- tauid_oma_shared_groups /**< org.openmobilealliance.group-usage-list */
+typedef enum txcap_auid_type_e {
+ tauid_dummy, /**< any auid */
+
+ tauid_ietf_xcap_caps, /**< xcap-caps */
+ tauid_ietf_resource_lists, /**< resource-lists */
+ tauid_ietf_rls_services, /**< rls-services */
+ tauid_ietf_pres_rules, /**< pres-rules */
+ tauid_ietf_directory, /**< directory */
+
+ tauid_oma_conv_history, /**< org.openmobilealliance.conv-history */
+ tauid_oma_pres_rules, /**< org.openmobilealliance.pres-rules */
+ tauid_oma_directory, /**< org.openmobilealliance.xcap-directory */
+ tauid_oma_deferred_list, /**< org.openmobilealliance.deferred-list */
+ tauid_oma_pres_content, /**< org.openmobilealliance.pres-content*/
+ tauid_oma_shared_groups /**< org.openmobilealliance.group-usage-list */
}
txcap_auid_type_t;
/** XCAP AUID.
*/
-typedef struct txcap_auid_s
-{
- TSK_DECLARE_OBJECT;
-
- txcap_auid_type_t type;
- char* id; /**< The id of the AUID (e.g. 'xcap-caps' or 'rls-services' or 'resource-lists' or ...)*/
- char* mime_type; /**< The default MIME-type of the document associated to this auid. */
- char* ns; /**< The namespace associated to this auid. */
- char* document_name; /**< The default name of the document associated to this auid. */
- tsk_bool_t global; /**< Indicates the auid scope. */
+typedef struct txcap_auid_s {
+ TSK_DECLARE_OBJECT;
+
+ txcap_auid_type_t type;
+ char* id; /**< The id of the AUID (e.g. 'xcap-caps' or 'rls-services' or 'resource-lists' or ...)*/
+ char* mime_type; /**< The default MIME-type of the document associated to this auid. */
+ char* ns; /**< The namespace associated to this auid. */
+ char* document_name; /**< The default name of the document associated to this auid. */
+ tsk_bool_t global; /**< Indicates the auid scope. */
}
txcap_auid_t;
diff --git a/tinyXCAP/include/tinyxcap/txcap_document.h b/tinyXCAP/include/tinyxcap/txcap_document.h
index 80e63ba..2ed6cfd 100755
--- a/tinyXCAP/include/tinyxcap/txcap_document.h
+++ b/tinyXCAP/include/tinyxcap/txcap_document.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyXCAP/include/tinyxcap/txcap_node.h b/tinyXCAP/include/tinyxcap/txcap_node.h
index 91895fe..6ba0171 100755
--- a/tinyXCAP/include/tinyxcap/txcap_node.h
+++ b/tinyXCAP/include/tinyxcap/txcap_node.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -37,15 +37,14 @@
TXCAP_BEGIN_DECLS
-typedef enum txcap_selector_param_type_e
-{
- xcapp_node_null = 0,
+typedef enum txcap_selector_param_type_e {
+ xcapp_node_null = 0,
- xcapp_node_name,
- xcapp_node_pos,
- xcapp_node_attribute,
- xcapp_node_pos_n_attribute,
- xcapp_node_namespace
+ xcapp_node_name,
+ xcapp_node_pos,
+ xcapp_node_attribute,
+ xcapp_node_pos_n_attribute,
+ xcapp_node_namespace
}
txcap_selector_param_type_t;
diff --git a/tinyXCAP/include/tinyxcap/txcap_selector.h b/tinyXCAP/include/tinyxcap/txcap_selector.h
index 3086bc9..8eebcf9 100755
--- a/tinyXCAP/include/tinyxcap/txcap_selector.h
+++ b/tinyXCAP/include/tinyxcap/txcap_selector.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyXCAP/include/tinyxcap_config.h b/tinyXCAP/include/tinyxcap_config.h
index 3d3fc18..c0582bc 100755
--- a/tinyXCAP/include/tinyxcap_config.h
+++ b/tinyXCAP/include/tinyxcap_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,13 +46,13 @@
# define TINYXCAP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TXCAP_BEGIN_DECLS extern "C" {
# define TXCAP_END_DECLS }
#else
-# define TXCAP_BEGIN_DECLS
+# define TXCAP_BEGIN_DECLS
# define TXCAP_END_DECLS
#endif
@@ -74,7 +74,7 @@
#endif
#if HAVE_CONFIG_H
- #include <config.h>
+#include <config.h>
#endif
#endif // TINYXCAP_CONFIG_H
diff --git a/tinyXCAP/include/txcap.h b/tinyXCAP/include/txcap.h
index e412bc6..6fde06e 100755
--- a/tinyXCAP/include/txcap.h
+++ b/tinyXCAP/include/txcap.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,34 +39,32 @@
TXCAP_BEGIN_DECLS
-typedef enum txcap_stack_option_e
-{
- //! request timeout
- TXCAP_STACK_OPTION_TIMEOUT,
- //! time to live
- TXCAP_STACK_OPTION_TTL,
-
- //! xcap-root
- TXCAP_STACK_OPTION_ROOT,
- //! user's password
- TXCAP_STACK_OPTION_PASSWORD,
- //! xcap user indentifier (e.g. sip:bob@example.com)
- TXCAP_STACK_OPTION_XUI,
- //! local ip address
- TXCAP_STACK_OPTION_LOCAL_IP,
- //! local port
- TXCAP_STACK_OPTION_LOCAL_PORT,
+typedef enum txcap_stack_option_e {
+ //! request timeout
+ TXCAP_STACK_OPTION_TIMEOUT,
+ //! time to live
+ TXCAP_STACK_OPTION_TTL,
+
+ //! xcap-root
+ TXCAP_STACK_OPTION_ROOT,
+ //! user's password
+ TXCAP_STACK_OPTION_PASSWORD,
+ //! xcap user indentifier (e.g. sip:bob@example.com)
+ TXCAP_STACK_OPTION_XUI,
+ //! local ip address
+ TXCAP_STACK_OPTION_LOCAL_IP,
+ //! local port
+ TXCAP_STACK_OPTION_LOCAL_PORT,
}
txcap_stack_option_t;
-typedef enum txcap_stack_param_type_e
-{
- xcapp_null = 0,
+typedef enum txcap_stack_param_type_e {
+ xcapp_null = 0,
- xcapp_option,
- xcapp_header,
- xcapp_userdata,
- xcapp_auid,
+ xcapp_option,
+ xcapp_header,
+ xcapp_userdata,
+ xcapp_auid,
}
txcap_stack_param_type_t;
@@ -76,7 +74,7 @@ txcap_stack_param_type_t;
/**@ingroup txcap_stack_group
* @def TXCAP_STACK_SET_OPTION
-* Adds or updates an option.
+* Adds or updates an option.
* This is a helper macro for @ref txcap_stack_create() and @ref txcap_stack_set().
* @param ID_ENUM The id of the option to add/update (@ref txcap_stack_option_t).
* @param VALUE_STR The new value of the option (<i>const char*</i>).
@@ -84,7 +82,7 @@ txcap_stack_param_type_t;
* @code
int ret = txcap_stack_set(stack,
// stack-level options
- TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
+ TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
TXCAP_STACK_SET_NULL());
* @endcode
*/
@@ -95,7 +93,7 @@ int ret = txcap_stack_set(stack,
*
* @code
int ret = txcap_stack_set(stack,
- TXCAP_STACK_SET_PASSWORD("mysecret"),
+ TXCAP_STACK_SET_PASSWORD("mysecret"),
TXCAP_STACK_SET_NULL());
* @endcode
*
@@ -108,7 +106,7 @@ int ret = txcap_stack_set(stack,
*
* @code
int ret = txcap_stack_set(stack,
- TXCAP_STACK_SET_ROOT("http://192.168.0.10:8080/services"),
+ TXCAP_STACK_SET_ROOT("http://192.168.0.10:8080/services"),
TXCAP_STACK_SET_NULL());
* @endcode
*
@@ -166,9 +164,9 @@ int ret = txcap_stack_set(stack,
/**@ingroup txcap_stack_group
* @def TXCAP_STACK_SET_CONTEXT
* Sets or updates the user's context. The context will be returned to the application layer
-* throught the callback function.
+* throught the callback function.
* @param CTX_PTR A pointer to the context (<i>const void*</i>).
-*
+*
* @code
const struct application_s context;
int ret = txcap_stack_set(stack,
@@ -213,22 +211,21 @@ int ret = txcap_stack_set(stack,
#define TXCAP_STACK_SET_NULL() xcapp_null
-typedef struct txcap_stack_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct txcap_stack_s {
+ TSK_DECLARE_OBJECT;
+
+ char* xui; /**< user's name as per RFC 4825 subclause 4.Also used to fill @b "X-3GPP-Intended-Identity" header.*/
+ char* password; /**< user's password used to authenticate to the XDMS . */
+ char* xcap_root; /**< xcap-root URI as per RFC 4825 subclause 6.1. MUST be a valid HTPP/HTTPS URL and will be used to build all request-uris. */
- char* xui; /**< user's name as per RFC 4825 subclause 4.Also used to fill @b "X-3GPP-Intended-Identity" header.*/
- char* password; /**< user's password used to authenticate to the XDMS . */
- char* xcap_root; /**< xcap-root URI as per RFC 4825 subclause 6.1. MUST be a valid HTPP/HTTPS URL and will be used to build all request-uris. */
-
- thttp_session_handle_t* http_session;
- thttp_stack_handle_t* http_stack; /**< http/https stack */
+ thttp_session_handle_t* http_session;
+ thttp_stack_handle_t* http_stack; /**< http/https stack */
- tsk_options_L_t *options; /**< list of user options */
- const void* context; /**< user's context */
- txcap_auids_L_t* auids; /**< user's auids */
+ tsk_options_L_t *options; /**< list of user options */
+ const void* context; /**< user's context */
+ txcap_auids_L_t* auids; /**< user's auids */
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
txcap_stack_t;
typedef void txcap_stack_handle_t;/**< Pointer to a XCAP stack. Should be created using @ref txcap_stack_create().*/
diff --git a/tinyXCAP/src/txcap.c b/tinyXCAP/src/txcap.c
index 17fbe1d..5f29132 100755
--- a/tinyXCAP/src/txcap.c
+++ b/tinyXCAP/src/txcap.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,21 +35,21 @@
/**@mainpage tinyXCAP API Overview
-*
-*
+*
+*
* <h1>16 XCAP</h1>
-*
+*
* The XCAP Framework is mainly based on RFC 4825 and uses tinyHTTP project. The framework can be used to implements advanced OMA functionalities such Enhanced Address Book, Presence Authorization Rules, Service Configuration …
* At startup the stack will load all supported AUIDs with their default values.
-*
-*
-*
+*
+*
+*
* <h2>16.1 Initialization</h2>
-*
+*
* As the XCAP stack depends on the HTTP/HTTPS stack (<a href="http://www.doubango.org/API/tinyHTTP/">tinyHTTP</a>) which uses the network library (<a href="http://www.doubango.org/API/tinyNET/"tinyNET</a>), you MUST call <a href="http://doubango.org/API/tinyNET/tnet_8c.html#affba6c2710347476f615b0135777c640"> tnet_startup()</a> before using any XCAP function (txcap_*). <br>
* <a href="http://doubango.org/API/tinyNET/tnet_8c.html#ac42b22a7ac5831f04326aee9de033c84"> tnet_cleanup()</a> is used to terminate use of network functions. <br>
* The example below demonstrates how to create and start a XCAP stack. In this example, the xcap-root URI is http://doubango.org:8080/services and the SIP AOR (used as XUI) is sip:bob@doubango.org.
-*
+*
* @code
txcap_stack_handle_t* stack = tsk_null;
int ret;
@@ -57,7 +57,7 @@ int ret;
tnet_startup();
stack = txcap_stack_create(test_stack_callback, "sip:bob@doubango.org", "mysecret", "http://doubango.org:8080/services",
-
+
// options
TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
@@ -79,33 +79,33 @@ bail:
tnet_cleanup();
* @endcode
-*
+*
* The stack-level headers will be added in all outgoing requests.
* A stack is a well-defined object and must be destroyed by using @a TSK_OBJECT_SAFE_FREE() macro. The stack will be automatically stopped when destroyed.
-*
-*
-*
+*
+*
+*
* <h2>16.2 Application Unique ID (AUID) object</h2>
-*
+*
* An AUID object is defined by:
* - An id (e.g. “xcap-caps”),
* - A MIME-Type (e.g. “application/xcap-caps+xml”),
* - A namespace (e.g. “urn:ietf:params:xml:ns:xcap-caps”),
* - A document name (e.g. “index”), which defines the name of the default document associated with this AUID
* - A scope (“global” or “users”)
-*
+*
* At startup, the stack will load all supported AUIDs with their default values. You can at any time change these values or register your own AUID object. The list of default AUIDs with their default values are shown in the next sections.
* When you are about to send a request, it’s not mandatory to use a registered AUID but it’s easier to generate the selector as all parameters are pre-configured.
-*
-*
-*
+*
+*
+*
* <h3>16.2.1 Default AUIDs</h3>
-*
+*
* The table below shows the default AUIDs as they are defined by the stack at startup.
* <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
* <TR VALIGN=TOP>
* <TD WIDTH=139 BGCOLOR="#d9d9d9">
-*
+*
* <P STYLE="border: none; padding: 0in"><B>Id</B></P>
* </TD>
* <TD WIDTH=132 BGCOLOR="#d9d9d9">
@@ -113,7 +113,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=120 BGCOLOR="#d9d9d9">
* <P STYLE="border: none; padding: 0in"><B>Namespace</B></P>
-*
+*
* </TD>
* <TD WIDTH=84 BGCOLOR="#d9d9d9">
* <P STYLE="border: none; padding: 0in"><B>Document </B>
@@ -122,7 +122,7 @@ tnet_cleanup();
* <TD WIDTH=53 BGCOLOR="#d9d9d9">
* <P STYLE="border: none; padding: 0in"><B>Scope</B></P>
* </TD>
-*
+*
* <TD WIDTH=129 BGCOLOR="#d9d9d9">
* <P STYLE="border: none; padding: 0in"><B>Reference</B></P>
* </TD>
@@ -131,7 +131,7 @@ tnet_cleanup();
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">xcap-caps</P>
* </TD>
-*
+*
* <TD WIDTH=132>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/xcap-caps+xml</P>
* </TD>
@@ -140,7 +140,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=84>
* <P STYLE="border: none; padding: 0in">index</P>
-*
+*
* </TD>
* <TD WIDTH=53>
* <P STYLE="border: none; padding: 0in">global</P>
@@ -150,7 +150,7 @@ tnet_cleanup();
* 4825 section 12.1</P>
* </TD>
* </TR>
-*
+*
* <TR VALIGN=TOP>
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">resource-lists</P>
@@ -159,7 +159,7 @@ tnet_cleanup();
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/resource-lists+xml</P>
* </TD>
* <TD WIDTH=120>
-*
+*
* <P STYLE="border: none; padding: 0in">urn:ietf:params:xml:ns:resource-lists</P>
* </TD>
* <TD WIDTH=84>
@@ -167,7 +167,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=53>
* <P STYLE="border: none; padding: 0in">users</P>
-*
+*
* </TD>
* <TD WIDTH=129>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">RFC
@@ -177,7 +177,7 @@ tnet_cleanup();
* <TR VALIGN=TOP>
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">rls-services</P>
-*
+*
* </TD>
* <TD WIDTH=132>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/rls-services+xml</P>
@@ -186,7 +186,7 @@ tnet_cleanup();
* <P STYLE="border: none; padding: 0in">urn:ietf:params:xml:ns:rls-services&quot;</P>
* </TD>
* <TD WIDTH=84>
-*
+*
* <P STYLE="border: none; padding: 0in">index</P>
* </TD>
* <TD WIDTH=53>
@@ -195,7 +195,7 @@ tnet_cleanup();
* <TD WIDTH=129>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">RFC
* 4826 section 4.4.1</P>
-*
+*
* </TD>
* </TR>
* <TR VALIGN=TOP>
@@ -204,7 +204,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=132>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/auth-policy+xml</P>
-*
+*
* </TD>
* <TD WIDTH=120>
* <P STYLE="border: none; padding: 0in">urn:ietf:params:xml:ns:pres-rules</P>
@@ -213,7 +213,7 @@ tnet_cleanup();
* <P STYLE="border: none; padding: 0in">index</P>
* </TD>
* <TD WIDTH=53>
-*
+*
* <P STYLE="border: none; padding: 0in">users</P>
* </TD>
* <TD WIDTH=129>
@@ -223,7 +223,7 @@ tnet_cleanup();
* </TR>
* <TR VALIGN=TOP>
* <TD WIDTH=139>
-*
+*
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">org.openmobilealliance.pres-rules</P>
* </TD>
* <TD WIDTH=132>
@@ -231,7 +231,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=120>
* <P STYLE="border: none; padding: 0in">urn:ietf:params:xml:ns:common-policy</P>
-*
+*
* </TD>
* <TD WIDTH=84>
* <P STYLE="border: none; padding: 0in">pres-rules</P>
@@ -240,7 +240,7 @@ tnet_cleanup();
* <P STYLE="border: none; padding: 0in">users</P>
* </TD>
* <TD WIDTH=129>
-*
+*
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">[OMA-TS-Presence_SIMPLE_XDM-V1_1-20080627-A]
* section 5.1.1.2</P>
* </TD>
@@ -250,7 +250,7 @@ tnet_cleanup();
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">directory</P>
* </TD>
* <TD WIDTH=132>
-*
+*
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/directory+xml</P>
* </TD>
* <TD WIDTH=120>
@@ -258,7 +258,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=84>
* <P STYLE="border: none; padding: 0in">directory.xml</P>
-*
+*
* </TD>
* <TD WIDTH=53>
* <P STYLE="border: none; padding: 0in">users</P>
@@ -268,7 +268,7 @@ tnet_cleanup();
* section 9.1</P>
* </TD>
* </TR>
-*
+*
* <TR VALIGN=TOP>
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">org.openmobilealliance.xcap-directory</P>
@@ -277,7 +277,7 @@ tnet_cleanup();
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/vnd.oma.xcap-directory+xml</P>
* </TD>
* <TD WIDTH=120>
-*
+*
* <P STYLE="border: none; padding: 0in">urn:oma:xml:xdm:xcap-directory</P>
* </TD>
* <TD WIDTH=84>
@@ -285,7 +285,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=53>
* <P STYLE="border: none; padding: 0in">users</P>
-*
+*
* </TD>
* <TD WIDTH=129>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">[OMA-TS-XDM_Core-V1_1-20080627-A]
@@ -295,7 +295,7 @@ tnet_cleanup();
* <TR VALIGN=TOP>
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">org.openmobilealliance.pres-content</P>
-*
+*
* </TD>
* <TD WIDTH=132>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">application/vnd.oma.pres-content+xml</P>
@@ -304,7 +304,7 @@ tnet_cleanup();
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">urn:oma:xml:prs:pres-content</P>
* </TD>
* <TD WIDTH=84>
-*
+*
* <P STYLE="border: none; padding: 0in">oma_status-icon/rcs_status_icon</P>
* </TD>
* <TD WIDTH=53>
@@ -313,7 +313,7 @@ tnet_cleanup();
* <TD WIDTH=129>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">[OMA-TS-Presence-SIMPLE_Content_XDM-V1_0-20081223-C]
* section 5.1.2</P>
-*
+*
* </TD>
* </TR>
* <TR VALIGN=TOP>
@@ -322,7 +322,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=132>
* <P LANG="en-GB" STYLE="border: none; padding: 0in">application/vnd.oma.im.history-list+xml</P>
-*
+*
* </TD>
* <TD WIDTH=120>
* <P STYLE="border: none; padding: 0in">urn:oma:xml:im:history-list</P>
@@ -331,7 +331,7 @@ tnet_cleanup();
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">conv-history</P>
* </TD>
* <TD WIDTH=53>
-*
+*
* <P STYLE="border: none; padding: 0in">users</P>
* </TD>
* <TD WIDTH=129>
@@ -340,7 +340,7 @@ tnet_cleanup();
* 5.1.2</P>
* </TD>
* </TR>
-*
+*
* <TR VALIGN=TOP>
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">org.openmobilealliance.deferred-list</P>
@@ -349,7 +349,7 @@ tnet_cleanup();
* <P LANG="en-GB" STYLE="border: none; padding: 0in">application/vnd.oma.im.deferred-list+xml</P>
* </TD>
* <TD WIDTH=120>
-*
+*
* <P STYLE="border: none; padding: 0in">urn:oma:xml:im:history-list</P>
* </TD>
* <TD WIDTH=84>
@@ -357,7 +357,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=53>
* <P STYLE="border: none; padding: 0in">users</P>
-*
+*
* </TD>
* <TD WIDTH=129>
* <P STYLE="border: none; padding: 0in">[OMA-TS-IM_XDM-V1_0-20070816-C]
@@ -366,7 +366,7 @@ tnet_cleanup();
* </TD>
* </TR>
* <TR VALIGN=TOP>
-*
+*
* <TD WIDTH=139>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">org.openmobilealliance.group-usage-list</P>
* </TD>
@@ -375,7 +375,7 @@ tnet_cleanup();
* </TD>
* <TD WIDTH=120>
* <PRE CLASS="western" STYLE="margin-bottom: 0.2in; border: none; padding: 0in">rn:ietf:params:xml:ns:resource-lists</PRE><P STYLE="border: none; padding: 0in">
-*
+*
* &nbsp;</P>
* </TD>
* <TD WIDTH=84>
@@ -384,38 +384,38 @@ tnet_cleanup();
* <TD WIDTH=53>
* <P LANG="fr-FR" STYLE="border: none; padding: 0in">users</P>
* </TD>
-*
+*
* <TD WIDTH=129>
* <P STYLE="border: none; padding: 0in">[OMA-TS-XDM_Shared-V1_1-20080627-A]
* subclause 5.2.2</P>
* </TD>
* </TR>
* </TABLE>
-*
-*
+*
+*
* <h3>16.2.2 AUID registration</h3>
-*
+*
* === The code below shows how to register two AUIDs. If the AUID object already exist (case-insensitive comparison on the id), then it will be updated. All fields are mandatory (id, mime-type, namespace, document and scope).
-*
+*
* @code
txcap_stack_set(stack,
TXCAP_STACK_SET_AUID("my-xcap-caps", "application/my-xcap-caps+xml", "urn:ietf:params:xml:ns:my-xcap-caps", "my-document", tsk_true),
TXCAP_STACK_SET_AUID("my-resource-lists", "application/my-resource-lists+xml", "urn:ietf:params:xml:ns:my-resource-lists", "my-document", tsk_false),
-
+
TXCAP_STACK_SET_NULL()); // mandatory
*
* @endcode
-*
+*
* The stack should be created as shown at section 16.1.
-* Only AUIDs which don’t appear in the table above should be registered using this method
-*
-*
+* Only AUIDs which don’t appear in the table above should be registered using this method
+*
+*
* <h2>16.3 Selector</h2>
-*
+*
* The selector is a helper function which could be used to construct XCAP URIs. XCAP URI is constructed as per RFC 4825 section 6. @a TXCAP_SELECTOR_NODE_SET*() macros are used to build a complete and well-formed URI (already percent encoded).
* All examples below assume that our AOR (used as XUI) is sip:bob@doubango.com, we are using the ‘rcs’list and the xcap-root URI is http://doubango.org:8080/services. All these parameters should be set when the stack is created. You will also notice that TXCAP_SELECTOR_NODE_SET_NULL() macro is used to ends the node selection parameters passed to txcap_selector_get_url(), it’s mandatory and should always be the last one.
-*
+*
* - Select XDMS capabilities:
* @code
char* urlstring = txcap_selector_get_url(stack, "xcap-caps",
@@ -423,7 +423,7 @@ char* urlstring = txcap_selector_get_url(stack, "xcap-caps",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/xcap-caps/global/index</i>
* - Select 'resource-lists' document
@@ -436,7 +436,7 @@ TSK_FREE(urlstring);
*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index</i>
-*
+*
* - Select 'rcs' list
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -444,10 +444,10 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TXCAP_SELECTOR_NODE_SET_NULL());
TSK_DEBUG_INFO("%s\n", urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B\@name=\%22rcs\%22\%5D</i>
-*
+*
* - Select the 2nd list
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -456,10 +456,10 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B2\%5D</i>
-*
+*
* - Select the 4th list using wildcard
* @code
urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -468,10 +468,10 @@ urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/*\%5B4\%5D</i>
-*
+*
* - Select bob's entry
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -481,10 +481,10 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B\@name=\%22rcs\%22\%5D/entry\%5B\@uri=\%22sip:bob@doubango.org\%22\%5D</i>
-*
+*
* - Select bob’s display-name
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -495,10 +495,10 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B\@name=\%22rcs\%22\%5D/entry\%5B\@uri=\%22sip:bob@doubango.org\%22\%5D/display-name</i>
-*
+*
* - Select the display-name of the 1st entry
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -509,10 +509,10 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B\@name=\%22rcs\%22\%5D/entry\%5B1\%5D/display-name</i>
-*
+*
* - Select bob from position 23
* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
@@ -522,12 +522,12 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/list\%5B\@name=\%22rcs\%22\%5D/entry\%5B23\%5D\%5B\@uri=\%22sip:bob@doubango.org\%22\%5D</i>
-*
+*
* - Namespaces test
-* @code
+* @code
char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TXCAP_SELECTOR_NODE_SET_NAME("foo"),
TXCAP_SELECTOR_NODE_SET_NAME("a:bar"),
@@ -538,13 +538,13 @@ char* urlstring = txcap_selector_get_url(stack, "resource-lists",
TSK_DEBUG_INFO("%s\n", urlstring);
TSK_FREE(urlstring);
* @endcode
-*
+*
* Console Output:
* <i>http://doubango.org:8080/services/resource-lists/users/sip:bob@doubango.org/index/~~/resource-lists/foo/a:bar/b:baz%3Fxmlns(a=\%22urn:namespace1-uri\%22)xmlns(b=\%22urn:namespace2-uri\%22)</i>
-*
+*
* <h2>16.4 XDMC Usage</h2>
-*
-* It is assumed that the address of the XDMS (or aggregation Proxy) is “doubango.org:8080/services” and thus the XCAP Root URI is “doubango.org:8080/services”. “sip:bob@doubango.org” will be used as the XUI.
+*
+* It is assumed that the address of the XDMS (or aggregation Proxy) is “doubango.org:8080/services” and thus the XCAP Root URI is “doubango.org:8080/services”. “sip:bob@doubango.org” will be used as the XUI.
* An XDMC can perform twelve actions:
* - @ref txcap_action_create_element(): Creates new element by sending a HTTP/HTTPS PUT request. The default Content-Type will be “application/xcap-el+xml”, unless you provide your own Content-Type by using TXCAP_ACTION_SET_HEADER().
* - @ref txcap_action_create_document(): Creates new document by sending a HTTP/HTTPS PUT request. The default Content-Type will be the one associated with the AUID of the document, unless you provide your own Content-Type by using TXCAP_ACTION_SET_HEADER().
@@ -555,13 +555,13 @@ TSK_FREE(urlstring);
* - @ref txcap_action_fetch_element(): Retrieves an element from the XDMS by sending a HTTP/HTTPS GET request. The default Content-Type will be “application/xcap-el+xml”, unless you provide your own Content-Type by using TXCAP_ACTION_SET_HEADER().
* - @ref txcap_action_fetch_document(): Retrieves a document from the XDMS by sending a HTTP/HTTPS GET request. The default Content-Type will be the one associated with the AUID of the document, unless you provide your own Content-Type by using TXCAP_ACTION_SET_HEADER().
* - @ref txcap_action_fetch_attribute(): Retrieves an attribute from the XDMS by sending a HTTP/HTTPS GET request. The default Content-Type will be “application/xcap-att+xml”, unless you provide your own Content-Type by using TXCAP_ACTION_SET_HEADER().
-* - @ref txcap_action_delete_element(): Deletes an element from the XDMS by sending a HTTP/HTTPS DELETE request.
+* - @ref txcap_action_delete_element(): Deletes an element from the XDMS by sending a HTTP/HTTPS DELETE request.
* - @ref txcap_action_delete_document(): Deletes a document from the XDMS by sending a HTTP/HTTPS DELETE request.
-* - @ref txcap_action_delete_attribute(): Deletes an attribute from the XDMS by sending a HTTP/HTTPS DELETE request.
-*
+* - @ref txcap_action_delete_attribute(): Deletes an attribute from the XDMS by sending a HTTP/HTTPS DELETE request.
+*
* To understand how the stack is created, please refer to section 16.1.
-*
-*
+*
+*
* <h3>16.4.1 Retrieving XDMS capabilities</h3>
* === The code below shows how an XDMC obtains the XDMS capabilities document.
* @code
@@ -573,7 +573,7 @@ int ret = txcap_action_fetch_document(stack,
TXCAP_ACTION_SET_NULL()
);
* @endcode
-*
+*
* The XDMC will send:
* @code
GET /services/xcap-caps/global/index HTTP/1.1
@@ -709,7 +709,7 @@ int ret = txcap_action_fetch_document(stack,
* @endcode
*
* The XDMC will send:
-*
+*
* @code
GET /services/org.openmobilealliance.pres-content/users/sip:mamadou@micromethod.com/oma_status-icon/rcs_status_icon HTTP/1.1
Host: doubango.org:8080
@@ -725,124 +725,118 @@ Content-Type: application/vnd.oma.pres-content+xml
*/
int __txcap_stack_set(txcap_stack_t* self, va_list *app)
{
- txcap_stack_param_type_t curr;
- tsk_bool_t cred_updated = tsk_false;
-
- if(!self || !self->http_session){
- return -1;
- }
-
- while((curr = va_arg(*app, txcap_stack_param_type_t)) != xcapp_null){
- switch(curr){
- case xcapp_option:
- { /* (txcap_stack_option_t)ID_ENUM, (const char*)VALUE_STR */
- txcap_stack_option_t ID_ENUM = va_arg(*app, txcap_stack_option_t);
- const char* VALUE_STR = va_arg(*app, const char*);
- switch(ID_ENUM){
- case TXCAP_STACK_OPTION_ROOT:
- {
- tsk_strupdate(&self->xcap_root, VALUE_STR);
- break;
- }
- /* PASSWORD and XUI are not used as options in the HTTP/HTTPS stack */
- case TXCAP_STACK_OPTION_PASSWORD:
- {
- tsk_strupdate(&self->password, VALUE_STR);
- cred_updated = tsk_true;
- break;
- }
- case TXCAP_STACK_OPTION_XUI:
- {
- tsk_strupdate(&self->xui, VALUE_STR);
- cred_updated = tsk_true;
- break;
- }
- case TXCAP_STACK_OPTION_LOCAL_IP:
- {
- thttp_stack_set(self->http_stack, THTTP_STACK_SET_LOCAL_IP(VALUE_STR),
- THTTP_STACK_SET_NULL());
- break;
- }
- case TXCAP_STACK_OPTION_LOCAL_PORT:
- {
- int port = atoi(VALUE_STR);
- thttp_stack_set(self->http_stack, THTTP_STACK_SET_LOCAL_PORT(port),
- THTTP_STACK_SET_NULL());
- break;
- }
- default:
- { /* HTTP Options: MUST be changed to valid HTTP option enum */
- switch(ID_ENUM){
- case TXCAP_STACK_OPTION_TIMEOUT:
- tsk_options_add_option(&((thttp_session_t*)self->http_session)->options, THTTP_SESSION_OPTION_TIMEOUT, VALUE_STR);
- break;
- case TXCAP_STACK_OPTION_TTL:
- tsk_options_add_option(&((thttp_session_t*)self->http_session)->options, THTTP_SESSION_OPTION_TTL, VALUE_STR);
- break;
- default:
- TSK_DEBUG_WARN("%d is an invalid XCAP option", ID_ENUM);
- break;
- }
-
- break;
- }
- }
- break;
- }
-
- case xcapp_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* NAME_STR = va_arg(*app, const char*);
- const char* VALUE_STR = va_arg(*app, const char*);
- if(VALUE_STR == (const char*)-1){
- tsk_params_remove_param(((thttp_session_t*)self->http_session)->headers, NAME_STR);
- }
- else{
- tsk_params_add_param(&((thttp_session_t*)self->http_session)->headers, NAME_STR, VALUE_STR);
- }
- break;
- }
-
- case xcapp_userdata:
- { /* (const void*)CTX_PTR */
- const void* CTX_PTR = va_arg(*app, const void*);
- ((thttp_session_t*)self->http_session)->userdata = CTX_PTR;
- break;
- }
-
- case xcapp_auid:
- { /* (const char*)ID_STR, (const char*)MIME_TYPE_STR, (const char*)NS_STR, (const char*)DOC_NAME_STR, (tsk_bool_t)IS_GLOBAL_BOOL */
- const char* ID_STR = va_arg(*app, const char*);
- const char* MIME_TYPE_STR = va_arg(*app, const char*);
- const char* NS_STR = va_arg(*app, const char*);
- const char* DOC_NAME_STR = va_arg(*app, const char*);
- tsk_bool_t IS_GLOBAL_BOOL = va_arg(*app, tsk_bool_t);
-
- if(txcap_auid_register(self->auids, ID_STR, MIME_TYPE_STR, NS_STR, DOC_NAME_STR, IS_GLOBAL_BOOL)){
- // do nothing
- }
-
- break;
- }
-
- default:
- {
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- goto bail;
- }
- } /* switch */
- } /* while */
-
- if(cred_updated && self->http_session){
- /* credentials */
- thttp_session_set(self->http_session,
- THTTP_SESSION_SET_CRED(self->xui, self->password),
- THTTP_SESSION_SET_NULL());
- }
- return 0;
+ txcap_stack_param_type_t curr;
+ tsk_bool_t cred_updated = tsk_false;
+
+ if(!self || !self->http_session) {
+ return -1;
+ }
+
+ while((curr = va_arg(*app, txcap_stack_param_type_t)) != xcapp_null) {
+ switch(curr) {
+ case xcapp_option: {
+ /* (txcap_stack_option_t)ID_ENUM, (const char*)VALUE_STR */
+ txcap_stack_option_t ID_ENUM = va_arg(*app, txcap_stack_option_t);
+ const char* VALUE_STR = va_arg(*app, const char*);
+ switch(ID_ENUM) {
+ case TXCAP_STACK_OPTION_ROOT: {
+ tsk_strupdate(&self->xcap_root, VALUE_STR);
+ break;
+ }
+ /* PASSWORD and XUI are not used as options in the HTTP/HTTPS stack */
+ case TXCAP_STACK_OPTION_PASSWORD: {
+ tsk_strupdate(&self->password, VALUE_STR);
+ cred_updated = tsk_true;
+ break;
+ }
+ case TXCAP_STACK_OPTION_XUI: {
+ tsk_strupdate(&self->xui, VALUE_STR);
+ cred_updated = tsk_true;
+ break;
+ }
+ case TXCAP_STACK_OPTION_LOCAL_IP: {
+ thttp_stack_set(self->http_stack, THTTP_STACK_SET_LOCAL_IP(VALUE_STR),
+ THTTP_STACK_SET_NULL());
+ break;
+ }
+ case TXCAP_STACK_OPTION_LOCAL_PORT: {
+ int port = atoi(VALUE_STR);
+ thttp_stack_set(self->http_stack, THTTP_STACK_SET_LOCAL_PORT(port),
+ THTTP_STACK_SET_NULL());
+ break;
+ }
+ default: {
+ /* HTTP Options: MUST be changed to valid HTTP option enum */
+ switch(ID_ENUM) {
+ case TXCAP_STACK_OPTION_TIMEOUT:
+ tsk_options_add_option(&((thttp_session_t*)self->http_session)->options, THTTP_SESSION_OPTION_TIMEOUT, VALUE_STR);
+ break;
+ case TXCAP_STACK_OPTION_TTL:
+ tsk_options_add_option(&((thttp_session_t*)self->http_session)->options, THTTP_SESSION_OPTION_TTL, VALUE_STR);
+ break;
+ default:
+ TSK_DEBUG_WARN("%d is an invalid XCAP option", ID_ENUM);
+ break;
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+
+ case xcapp_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* NAME_STR = va_arg(*app, const char*);
+ const char* VALUE_STR = va_arg(*app, const char*);
+ if(VALUE_STR == (const char*)-1) {
+ tsk_params_remove_param(((thttp_session_t*)self->http_session)->headers, NAME_STR);
+ }
+ else {
+ tsk_params_add_param(&((thttp_session_t*)self->http_session)->headers, NAME_STR, VALUE_STR);
+ }
+ break;
+ }
+
+ case xcapp_userdata: {
+ /* (const void*)CTX_PTR */
+ const void* CTX_PTR = va_arg(*app, const void*);
+ ((thttp_session_t*)self->http_session)->userdata = CTX_PTR;
+ break;
+ }
+
+ case xcapp_auid: {
+ /* (const char*)ID_STR, (const char*)MIME_TYPE_STR, (const char*)NS_STR, (const char*)DOC_NAME_STR, (tsk_bool_t)IS_GLOBAL_BOOL */
+ const char* ID_STR = va_arg(*app, const char*);
+ const char* MIME_TYPE_STR = va_arg(*app, const char*);
+ const char* NS_STR = va_arg(*app, const char*);
+ const char* DOC_NAME_STR = va_arg(*app, const char*);
+ tsk_bool_t IS_GLOBAL_BOOL = va_arg(*app, tsk_bool_t);
+
+ if(txcap_auid_register(self->auids, ID_STR, MIME_TYPE_STR, NS_STR, DOC_NAME_STR, IS_GLOBAL_BOOL)) {
+ // do nothing
+ }
+
+ break;
+ }
+
+ default: {
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ goto bail;
+ }
+ } /* switch */
+ } /* while */
+
+ if(cred_updated && self->http_session) {
+ /* credentials */
+ thttp_session_set(self->http_session,
+ THTTP_SESSION_SET_CRED(self->xui, self->password),
+ THTTP_SESSION_SET_NULL());
+ }
+ return 0;
bail:
- return -2;
+ return -2;
}
/**@ingroup txcap_stack_group
@@ -853,7 +847,7 @@ bail:
* This paramter is mandatory and must not be null. If for any reason you'd like to update the user's id, then use @ref TXCAP_STACK_SET_XUI().
* @param password user's password used to authenticate to the XDMS.
* This parameter is not mandatory. If for any reason you'd like to update the password, then use @ref TXCAP_STACK_SET_PASSWORD().
-* @param xcap_root xcap-root URI as per RFC 4825 subclause 6.1, used to build all request-uris.
+* @param xcap_root xcap-root URI as per RFC 4825 subclause 6.1, used to build all request-uris.
* This parameter is not mandatory and must be a valid HTPP/HTTPS URL.
* @param ... User configuration. You must use @a TXCAP_STACK_SET_*() macros to set these options.
* The list of options must always end with @ref TXCAP_STACK_SET_NULL() even if these is no option to pass to the stack.
@@ -864,15 +858,15 @@ bail:
int test_stack_callback(const thttp_event_t *httpevent);
txcap_stack_handle_t* stack = txcap_stack_create(test_stack_callback, "sip:bob@example.com", "mysecret", "http://doubango.org:8080/services",
-
+
// stack-level options
TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
-
+
// stack-level headers
TXCAP_STACK_SET_HEADER("Connection", "Keep-Alive"),
TXCAP_STACK_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
TXCAP_STACK_SET_HEADER("X-3GPP-Intended-Identity", XUI),
-
+
TXCAP_STACK_SET_NULL());
* @endcode
*
@@ -880,41 +874,41 @@ txcap_stack_handle_t* stack = txcap_stack_create(test_stack_callback, "sip:bob@e
*/
txcap_stack_handle_t* txcap_stack_create(thttp_stack_callback_f callback, const char* xui, const char* password, const char* xcap_root, ...)
{
- txcap_stack_t* ret = tsk_null;
-
- if(!xui || !xcap_root){
- TSK_DEBUG_ERROR("Both xui and xcap_root are mandatory and should be non-null");
- goto bail;
- }
-
- /* check url validity */
- if(!thttp_url_isvalid(xcap_root)){
- TSK_DEBUG_ERROR("%s is not a valid HTTP/HTTPS url", xcap_root);
- goto bail;
- }
-
- if(!(ret = tsk_object_new(txcap_stack_def_t, callback, xui, password, xcap_root))){
- TSK_DEBUG_FATAL("Failed to create the XCAP stack");
- goto bail;
- }
- else{
- /* set parameters */
- va_list ap;
- va_start(ap, xcap_root);
- __txcap_stack_set(ret, &ap);
- va_end(ap);
- /* credendials */
- tsk_strupdate(&ret->xui, xui);
- tsk_strupdate(&ret->password, password);
- if(ret->http_session){
- thttp_session_set(ret->http_session,
- THTTP_SESSION_SET_CRED(ret->xui, ret->password),
- THTTP_SESSION_SET_NULL());
- }
- }
+ txcap_stack_t* ret = tsk_null;
+
+ if(!xui || !xcap_root) {
+ TSK_DEBUG_ERROR("Both xui and xcap_root are mandatory and should be non-null");
+ goto bail;
+ }
+
+ /* check url validity */
+ if(!thttp_url_isvalid(xcap_root)) {
+ TSK_DEBUG_ERROR("%s is not a valid HTTP/HTTPS url", xcap_root);
+ goto bail;
+ }
+
+ if(!(ret = tsk_object_new(txcap_stack_def_t, callback, xui, password, xcap_root))) {
+ TSK_DEBUG_FATAL("Failed to create the XCAP stack");
+ goto bail;
+ }
+ else {
+ /* set parameters */
+ va_list ap;
+ va_start(ap, xcap_root);
+ __txcap_stack_set(ret, &ap);
+ va_end(ap);
+ /* credendials */
+ tsk_strupdate(&ret->xui, xui);
+ tsk_strupdate(&ret->password, password);
+ if(ret->http_session) {
+ thttp_session_set(ret->http_session,
+ THTTP_SESSION_SET_CRED(ret->xui, ret->password),
+ THTTP_SESSION_SET_NULL());
+ }
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup txcap_stack_group
@@ -925,22 +919,22 @@ bail:
*/
int txcap_stack_start(txcap_stack_handle_t* self)
{
- int ret = -1;
- txcap_stack_t* stack = self;
+ int ret = -1;
+ txcap_stack_t* stack = self;
- if(!stack){
- goto bail;
- }
+ if(!stack) {
+ goto bail;
+ }
- if(!(ret = thttp_stack_start(stack->http_stack))){
- //if(!stack->http_session){
- // stack->http_session = thttp_session_create(stack->http_stack ,
- // THTTP_SESSION_SET_NULL());
- //}
- }
+ if(!(ret = thttp_stack_start(stack->http_stack))) {
+ //if(!stack->http_session){
+ // stack->http_session = thttp_session_create(stack->http_stack ,
+ // THTTP_SESSION_SET_NULL());
+ //}
+ }
bail:
- return ret;
+ return ret;
}
/**@ingroup txcap_stack_group
@@ -959,8 +953,8 @@ txcap_stack_set(stack,
TXCAP_STACK_SET_AUID("resource-lists2", "application/resource-lists+xml2", "urn:ietf:params:xml:ns:resource-lists2", "index2", tsk_false),
// stack-level headers
TXCAP_STACK_SET_HEADER("Connection", "Keep-Alive"),
- TXCAP_STACK_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
-
+ TXCAP_STACK_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
+
TXCAP_STACK_SET_NULL());
* @endcode
*
@@ -968,19 +962,19 @@ txcap_stack_set(stack,
*/
int txcap_stack_set(txcap_stack_handle_t* self, ...)
{
- int ret = -1;
- va_list ap;
+ int ret = -1;
+ va_list ap;
- if(!self){
- goto bail;
- }
-
- va_start(ap, self);
- ret = __txcap_stack_set(self, &ap);
- va_end(ap);
+ if(!self) {
+ goto bail;
+ }
+
+ va_start(ap, self);
+ ret = __txcap_stack_set(self, &ap);
+ va_end(ap);
bail:
- return ret;
+ return ret;
}
/**@ingroup txcap_stack_group
@@ -991,20 +985,20 @@ bail:
*/
int txcap_stack_stop(txcap_stack_handle_t* self)
{
- int ret = -1;
- txcap_stack_t* stack = self;
-
- if(!stack){
- goto bail;
- }
- else{
- if(!(ret = thttp_stack_stop(stack->http_stack))){
- //TSK_OBJECT_SAFE_FREE(stack->http_session);
- }
- }
+ int ret = -1;
+ txcap_stack_t* stack = self;
+
+ if(!stack) {
+ goto bail;
+ }
+ else {
+ if(!(ret = thttp_stack_stop(stack->http_stack))) {
+ //TSK_OBJECT_SAFE_FREE(stack->http_session);
+ }
+ }
bail:
- return ret;
+ return ret;
}
@@ -1020,60 +1014,59 @@ bail:
//
static tsk_object_t* _txcap_stack_create(tsk_object_t * self, va_list * app)
{
- txcap_stack_t *stack = self;
- if(stack){
- thttp_stack_callback_f callback;
- tsk_safeobj_init(stack);
-
- callback = va_arg(*app, thttp_stack_callback_f);
- stack->xui = tsk_strdup( va_arg(*app, const char*) );
- stack->password = tsk_strdup( va_arg(*app, const char*) );
- stack->xcap_root = tsk_strdup( va_arg(*app, const char*) );
-
- /* HTTP/HTTPS stack and session */
- stack->http_stack = thttp_stack_create(callback,
- THTTP_STACK_SET_NULL());
- stack->http_session = thttp_session_create(stack->http_stack ,
- THTTP_SESSION_SET_NULL());
-
- /* Options */
- stack->options = tsk_list_create();
-
- /* AUIDs */
- txcap_auids_init(&stack->auids);
- }
- return self;
+ txcap_stack_t *stack = self;
+ if(stack) {
+ thttp_stack_callback_f callback;
+ tsk_safeobj_init(stack);
+
+ callback = va_arg(*app, thttp_stack_callback_f);
+ stack->xui = tsk_strdup( va_arg(*app, const char*) );
+ stack->password = tsk_strdup( va_arg(*app, const char*) );
+ stack->xcap_root = tsk_strdup( va_arg(*app, const char*) );
+
+ /* HTTP/HTTPS stack and session */
+ stack->http_stack = thttp_stack_create(callback,
+ THTTP_STACK_SET_NULL());
+ stack->http_session = thttp_session_create(stack->http_stack ,
+ THTTP_SESSION_SET_NULL());
+
+ /* Options */
+ stack->options = tsk_list_create();
+
+ /* AUIDs */
+ txcap_auids_init(&stack->auids);
+ }
+ return self;
}
static tsk_object_t* txcap_stack_destroy(tsk_object_t* self)
-{
- txcap_stack_t *stack = self;
- if(stack){
- /* vars */
- TSK_FREE(stack->xui);
- TSK_FREE(stack->password);
- TSK_FREE(stack->xcap_root);
-
- /* HTTP/HTTPS resources */
- TSK_OBJECT_SAFE_FREE(stack->http_session);
- TSK_OBJECT_SAFE_FREE(stack->http_stack);
-
- /* Options */
- TSK_OBJECT_SAFE_FREE(stack->options);
-
- /* AUIDs */
- TSK_OBJECT_SAFE_FREE(stack->auids);
-
- tsk_safeobj_deinit(stack);
- }
- return self;
+{
+ txcap_stack_t *stack = self;
+ if(stack) {
+ /* vars */
+ TSK_FREE(stack->xui);
+ TSK_FREE(stack->password);
+ TSK_FREE(stack->xcap_root);
+
+ /* HTTP/HTTPS resources */
+ TSK_OBJECT_SAFE_FREE(stack->http_session);
+ TSK_OBJECT_SAFE_FREE(stack->http_stack);
+
+ /* Options */
+ TSK_OBJECT_SAFE_FREE(stack->options);
+
+ /* AUIDs */
+ TSK_OBJECT_SAFE_FREE(stack->auids);
+
+ tsk_safeobj_deinit(stack);
+ }
+ return self;
}
-static const tsk_object_def_t txcap_stack_def_s =
-{
- sizeof(txcap_stack_t),
- _txcap_stack_create,
- txcap_stack_destroy,
- tsk_null,
+static const tsk_object_def_t txcap_stack_def_s = {
+ sizeof(txcap_stack_t),
+ _txcap_stack_create,
+ txcap_stack_destroy,
+ tsk_null,
};
const tsk_object_def_t *txcap_stack_def_t = &txcap_stack_def_s;
diff --git a/tinyXCAP/src/txcap_action.c b/tinyXCAP/src/txcap_action.c
index 7bf8d0b..df12e9c 100755
--- a/tinyXCAP/src/txcap_action.c
+++ b/tinyXCAP/src/txcap_action.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,167 +42,170 @@ extern char* __txcap_selector_get_url(const txcap_stack_handle_t* stack, const c
*/
int txcap_action_perform(txcap_stack_handle_t* stack, txcap_action_type_t type, txcap_action_target_t target, ...)
{
- tsk_options_L_t* options = tsk_null;
- tsk_params_L_t* headers = tsk_null;
- char* urlstring = tsk_null;
- thttp_action_t* action;
- thttp_dialog_t* dialog;
- int ret = -1;
- txcap_action_param_type_t curr;
- const char* method = "GET";
- const char* mime_type = tsk_null;
- const char* AUID_STR = tsk_null;
- const void* PAY_PTR = tsk_null;
- size_t PAY_SIZE = 0;
- va_list ap;
- txcap_stack_t* xcap_stack = stack;
-
- if(!xcap_stack){
- goto bail;
- }
- else{
- xcap_stack = tsk_object_ref(stack);
- options = tsk_list_create();
- headers = tsk_list_create();
- }
-
- va_start(ap, target);
- while((curr = va_arg(ap, txcap_action_param_type_t)) != txcap_apt_null){
- switch(curr){
- case txcap_apt_option:
- { /*(thttp_action_option_t)ID_INT, (const char*)VALUE_STR*/
- thttp_action_option_t ID_INT = va_arg(ap, thttp_action_option_t);
- const char* VALUE_STR = va_arg(ap, const char *);
- tsk_options_add_option(&options, ID_INT, VALUE_STR);
- break;
- }
- case txcap_apt_header:
- { /* (const char*)NAME_STR, (const char*)VALUE_STR */
- const char* NAME_STR = va_arg(ap, const char *);
- const char* VALUE_STR = va_arg(ap, const char *);
- if(VALUE_STR == (const char*)-1){
- tsk_params_remove_param(headers, NAME_STR);
- }
- else{
- tsk_params_add_param(&headers, NAME_STR, VALUE_STR);
- }
- break;
- }
- case txcap_apt_payload:
- { /*(const void*)PAY_PTR, (size_t)PAY_SIZE*/
- PAY_PTR = va_arg(ap, const void *);
- PAY_SIZE = va_arg(ap, size_t);
- break;
- }
- case txcap_apt_selector:
- { /*(const char*)AUID_STR, __VA_ARGS__*/
- AUID_STR = va_arg(ap, const char *);
- if(!urlstring){
- urlstring = __txcap_selector_get_url(stack, AUID_STR, &ap);
- }
- break;
- }
- case txcap_apt_urlstring:
- { /* (const char*)URI_STR */
- const char* URI_STR = va_arg(ap, const char *);
- if(!urlstring){
- urlstring = tsk_strdup(URI_STR);
- }
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- goto done;
- }
- }/* switch */
- } /* while */
+ tsk_options_L_t* options = tsk_null;
+ tsk_params_L_t* headers = tsk_null;
+ char* urlstring = tsk_null;
+ thttp_action_t* action;
+ thttp_dialog_t* dialog;
+ int ret = -1;
+ txcap_action_param_type_t curr;
+ const char* method = "GET";
+ const char* mime_type = tsk_null;
+ const char* AUID_STR = tsk_null;
+ const void* PAY_PTR = tsk_null;
+ size_t PAY_SIZE = 0;
+ va_list ap;
+ txcap_stack_t* xcap_stack = stack;
+
+ if(!xcap_stack) {
+ goto bail;
+ }
+ else {
+ xcap_stack = tsk_object_ref(stack);
+ options = tsk_list_create();
+ headers = tsk_list_create();
+ }
+
+ va_start(ap, target);
+ while((curr = va_arg(ap, txcap_action_param_type_t)) != txcap_apt_null) {
+ switch(curr) {
+ case txcap_apt_option: {
+ /*(thttp_action_option_t)ID_INT, (const char*)VALUE_STR*/
+ thttp_action_option_t ID_INT = va_arg(ap, thttp_action_option_t);
+ const char* VALUE_STR = va_arg(ap, const char *);
+ tsk_options_add_option(&options, ID_INT, VALUE_STR);
+ break;
+ }
+ case txcap_apt_header: {
+ /* (const char*)NAME_STR, (const char*)VALUE_STR */
+ const char* NAME_STR = va_arg(ap, const char *);
+ const char* VALUE_STR = va_arg(ap, const char *);
+ if(VALUE_STR == (const char*)-1) {
+ tsk_params_remove_param(headers, NAME_STR);
+ }
+ else {
+ tsk_params_add_param(&headers, NAME_STR, VALUE_STR);
+ }
+ break;
+ }
+ case txcap_apt_payload: {
+ /*(const void*)PAY_PTR, (size_t)PAY_SIZE*/
+ PAY_PTR = va_arg(ap, const void *);
+ PAY_SIZE = va_arg(ap, size_t);
+ break;
+ }
+ case txcap_apt_selector: {
+ /*(const char*)AUID_STR, __VA_ARGS__*/
+ AUID_STR = va_arg(ap, const char *);
+ if(!urlstring) {
+ urlstring = __txcap_selector_get_url(stack, AUID_STR, &ap);
+ }
+ break;
+ }
+ case txcap_apt_urlstring: {
+ /* (const char*)URI_STR */
+ const char* URI_STR = va_arg(ap, const char *);
+ if(!urlstring) {
+ urlstring = tsk_strdup(URI_STR);
+ }
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ goto done;
+ }
+ }/* switch */
+ } /* while */
done:
- va_end(ap);
-
- /* checks urlstring */
- if(!urlstring){
- TSK_DEBUG_ERROR("Failed to compute XCAP URL");
- goto bail;
- }
-
- /* HTTP method */
- switch(type){
- case txcap_atp_create:
- case txcap_atp_replace:
- method = "PUT"; break;
- case txcap_atp_fetch:
- method = "GET"; break;
- case txcap_atp_delete:
- method = "DELETE"; break;
- }
-
- /*content-type*/
- switch(target){
- case txcap_atg_element:
- mime_type = TXCAP_MIME_TYPE_ELEMENT; break;
- case txcap_atg_document:
- {
- if(AUID_STR){
- txcap_auid_t* auid;
- if((auid = txcap_auid_get_by_id(xcap_stack->auids, AUID_STR))){
- mime_type = (const char*)auid->mime_type; // (cont char*) do not strdup()
- TSK_OBJECT_SAFE_FREE(auid);
- }
- else{
- TSK_DEBUG_WARN("Failed to find auid with id=%s", AUID_STR);
- }
- }
- break;
- }
- case txcap_atg_attribute:
- mime_type = TXCAP_MIME_TYPE_ATTRIBUTE; break;
- }
-
- /* HTTP action */
- if((action = thttp_action_create(thttp_atype_o_request, urlstring, method, tsk_null))){
- const tsk_list_item_t* item;
- if((dialog = thttp_dialog_new(xcap_stack->http_session))){
- /* copy options */
- tsk_list_foreach(item, options){
- tsk_options_add_option(&action->options, ((const tsk_option_t*)item->data)->id, ((const tsk_option_t*)item->data)->value);
- }
- /* copy action-level headers */
- tsk_list_foreach(item, headers){
- tsk_params_add_param(&action->headers, ((const tsk_param_t*)item->data)->name, ((const tsk_param_t*)item->data)->value);
- }
- /* copy session-level headers ==> will be added by thttp_dialog_send_request()*/
- //--tsk_list_pushback_list(action->headers, ((thttp_session_t*)xcap_stack->http_session)->headers);
-
- /* Content-Type */
- if(mime_type){
- if(!tsk_params_have_param(action->headers, "Content-Type")){
- tsk_params_add_param(&action->headers, "Content-Type", mime_type);
- }
- }
-
- /* payload */
- if(PAY_PTR && PAY_SIZE){
- action->payload = tsk_buffer_create(PAY_PTR, PAY_SIZE);
- }
-
- /* performs */
- ret = thttp_dialog_fsm_act(dialog, action->type, tsk_null, action);
- tsk_object_unref(dialog);
- }
- else{
- TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS dialog.");
- ret = -2;
- }
- TSK_OBJECT_SAFE_FREE(action);
- }
+ va_end(ap);
+
+ /* checks urlstring */
+ if(!urlstring) {
+ TSK_DEBUG_ERROR("Failed to compute XCAP URL");
+ goto bail;
+ }
+
+ /* HTTP method */
+ switch(type) {
+ case txcap_atp_create:
+ case txcap_atp_replace:
+ method = "PUT";
+ break;
+ case txcap_atp_fetch:
+ method = "GET";
+ break;
+ case txcap_atp_delete:
+ method = "DELETE";
+ break;
+ }
+
+ /*content-type*/
+ switch(target) {
+ case txcap_atg_element:
+ mime_type = TXCAP_MIME_TYPE_ELEMENT;
+ break;
+ case txcap_atg_document: {
+ if(AUID_STR) {
+ txcap_auid_t* auid;
+ if((auid = txcap_auid_get_by_id(xcap_stack->auids, AUID_STR))) {
+ mime_type = (const char*)auid->mime_type; // (cont char*) do not strdup()
+ TSK_OBJECT_SAFE_FREE(auid);
+ }
+ else {
+ TSK_DEBUG_WARN("Failed to find auid with id=%s", AUID_STR);
+ }
+ }
+ break;
+ }
+ case txcap_atg_attribute:
+ mime_type = TXCAP_MIME_TYPE_ATTRIBUTE;
+ break;
+ }
+
+ /* HTTP action */
+ if((action = thttp_action_create(thttp_atype_o_request, urlstring, method, tsk_null))) {
+ const tsk_list_item_t* item;
+ if((dialog = thttp_dialog_new(xcap_stack->http_session))) {
+ /* copy options */
+ tsk_list_foreach(item, options) {
+ tsk_options_add_option(&action->options, ((const tsk_option_t*)item->data)->id, ((const tsk_option_t*)item->data)->value);
+ }
+ /* copy action-level headers */
+ tsk_list_foreach(item, headers) {
+ tsk_params_add_param(&action->headers, ((const tsk_param_t*)item->data)->name, ((const tsk_param_t*)item->data)->value);
+ }
+ /* copy session-level headers ==> will be added by thttp_dialog_send_request()*/
+ //--tsk_list_pushback_list(action->headers, ((thttp_session_t*)xcap_stack->http_session)->headers);
+
+ /* Content-Type */
+ if(mime_type) {
+ if(!tsk_params_have_param(action->headers, "Content-Type")) {
+ tsk_params_add_param(&action->headers, "Content-Type", mime_type);
+ }
+ }
+
+ /* payload */
+ if(PAY_PTR && PAY_SIZE) {
+ action->payload = tsk_buffer_create(PAY_PTR, PAY_SIZE);
+ }
+
+ /* performs */
+ ret = thttp_dialog_fsm_act(dialog, action->type, tsk_null, action);
+ tsk_object_unref(dialog);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create new HTTP/HTTPS dialog.");
+ ret = -2;
+ }
+ TSK_OBJECT_SAFE_FREE(action);
+ }
bail:
- TSK_FREE(urlstring);
- TSK_OBJECT_SAFE_FREE(options);
- TSK_OBJECT_SAFE_FREE(headers);
- tsk_object_unref(xcap_stack);
- return ret;
+ TSK_FREE(urlstring);
+ TSK_OBJECT_SAFE_FREE(options);
+ TSK_OBJECT_SAFE_FREE(headers);
+ tsk_object_unref(xcap_stack);
+ return ret;
}
diff --git a/tinyXCAP/src/txcap_auid.c b/tinyXCAP/src/txcap_auid.c
index d3058d9..434c15f 100755
--- a/tinyXCAP/src/txcap_auid.c
+++ b/tinyXCAP/src/txcap_auid.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -33,143 +33,141 @@
#include "tsk_debug.h"
-typedef struct auid_s
-{
- txcap_auid_type_t type;
- const char* id;
- const char* mime_type;
- const char* ns;
- const char* document_name;
- tsk_bool_t global;
+typedef struct auid_s {
+ txcap_auid_type_t type;
+ const char* id;
+ const char* mime_type;
+ const char* ns;
+ const char* document_name;
+ tsk_bool_t global;
}
auid_t;
/** List of all default auids */
-static const auid_t __txcap_auids[] =
-{
- /*== xcap-caps ==*/{
- tauid_ietf_xcap_caps,
- TXCAP_AUID_IETF_XCAP_CAPS_ID,
- TXCAP_AUID_IETF_XCAP_CAPS_MIME_TYPE,
- TXCAP_AUID_IETF_XCAP_CAPS_NS,
- TXCAP_AUID_IETF_XCAP_CAPS_DOC,
- tsk_true
- },
-
- /*== resource-lists ==*/{
- tauid_ietf_resource_lists,
- TXCAP_AUID_IETF_RESOURCE_LISTS_ID,
- TXCAP_AUID_IETF_RESOURCE_LISTS_MIME_TYPE,
- TXCAP_AUID_IETF_RESOURCE_LISTS_NS,
- TXCAP_AUID_IETF_RESOURCE_LISTS_DOC,
- tsk_false
- },
-
- /*== rls-services ==*/{
- tauid_ietf_rls_services,
- TXCAP_AUID_IETF_RLS_SERVICES_ID,
- TXCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE,
- TXCAP_AUID_IETF_RLS_SERVICES_NS,
- TXCAP_AUID_IETF_RLS_SERVICES_DOC,
- tsk_false
- },
-
- /*== pres-rules ==*/{
- tauid_ietf_pres_rules,
- TXCAP_AUID_IETF_PRES_RULES_ID,
- TXCAP_AUID_IETF_PRES_RULES_MIME_TYPE,
- TXCAP_AUID_IETF_PRES_RULES_NS,
- TXCAP_AUID_IETF_PRES_RULES_DOC,
- tsk_false
- },
-
- /*== pidf-manipulation ==*/{
- tauid_ietf_pres_rules,
- TXCAP_AUID_IETF_PIDF_MANIPULATION_ID,
- TXCAP_AUID_IETF_PIDF_MANIPULATION_MIME_TYPE,
- TXCAP_AUID_IETF_PIDF_MANIPULATION_NS,
- TXCAP_AUID_IETF_PIDF_MANIPULATION_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.pres-rules ==*/{
- tauid_oma_pres_rules,
- TXCAP_AUID_OMA_PRES_RULES_ID,
- TXCAP_AUID_OMA_PRES_RULES_MIME_TYPE,
- TXCAP_AUID_OMA_PRES_RULES_NS,
- TXCAP_AUID_OMA_PRES_RULES_DOC,
- tsk_false
- },
-
- /*== directory ==*/{
- tauid_ietf_directory,
- TXCAP_AUID_IETF_DIRECTORY_ID,
- TXCAP_AUID_IETF_DIRECTORY_MIME_TYPE,
- TXCAP_AUID_IETF_DIRECTORY_NS,
- TXCAP_AUID_IETF_DIRECTORY_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.xcap-directory ==*/{
- tauid_oma_directory,
- TXCAP_AUID_OMA_DIRECTORY_ID,
- TXCAP_AUID_OMA_DIRECTORY_MIME_TYPE,
- TXCAP_AUID_OMA_DIRECTORY_NS,
- TXCAP_AUID_OMA_DIRECTORY_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.pres-content ==*/{
- tauid_oma_pres_content,
- TXCAP_AUID_OMA_PRES_CONTENT_ID,
- TXCAP_AUID_OMA_PRES_CONTENT_MIME_TYPE,
- TXCAP_AUID_OMA_PRES_CONTENT_NS,
- TXCAP_AUID_OMA_PRES_CONTENT_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.conv-history ==*/{
- tauid_oma_conv_history,
- TXCAP_AUID_OMA_CONV_HISTORY_ID,
- TXCAP_AUID_OMA_CONV_HISTORY_MIME_TYPE,
- TXCAP_AUID_OMA_CONV_HISTORY_NS,
- TXCAP_AUID_OMA_CONV_HISTORY_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.deferred-list ==*/{
- tauid_oma_deferred_list,
- TXCAP_AUID_OMA_DEFERRED_LIST_ID,
- TXCAP_AUID_OMA_DEFERRED_LIST_MIME_TYPE,
- TXCAP_AUID_OMA_DEFERRED_LIST_NS,
- TXCAP_AUID_OMA_DEFERRED_LIST_DOC,
- tsk_false
- },
-
- /*== org.openmobilealliance.group-usage-list ==*/{
- tauid_oma_shared_groups,
- TXCAP_AUID_OMA_SHARED_GROUPS_ID,
- TXCAP_AUID_OMA_SHARED_GROUPS_MIME_TYPE,
- TXCAP_AUID_OMA_SHARED_GROUPS_NS,
- TXCAP_AUID_OMA_SHARED_GROUPS_DOC,
- tsk_false
- },
+static const auid_t __txcap_auids[] = {
+ /*== xcap-caps ==*/{
+ tauid_ietf_xcap_caps,
+ TXCAP_AUID_IETF_XCAP_CAPS_ID,
+ TXCAP_AUID_IETF_XCAP_CAPS_MIME_TYPE,
+ TXCAP_AUID_IETF_XCAP_CAPS_NS,
+ TXCAP_AUID_IETF_XCAP_CAPS_DOC,
+ tsk_true
+ },
+
+ /*== resource-lists ==*/{
+ tauid_ietf_resource_lists,
+ TXCAP_AUID_IETF_RESOURCE_LISTS_ID,
+ TXCAP_AUID_IETF_RESOURCE_LISTS_MIME_TYPE,
+ TXCAP_AUID_IETF_RESOURCE_LISTS_NS,
+ TXCAP_AUID_IETF_RESOURCE_LISTS_DOC,
+ tsk_false
+ },
+
+ /*== rls-services ==*/{
+ tauid_ietf_rls_services,
+ TXCAP_AUID_IETF_RLS_SERVICES_ID,
+ TXCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE,
+ TXCAP_AUID_IETF_RLS_SERVICES_NS,
+ TXCAP_AUID_IETF_RLS_SERVICES_DOC,
+ tsk_false
+ },
+
+ /*== pres-rules ==*/{
+ tauid_ietf_pres_rules,
+ TXCAP_AUID_IETF_PRES_RULES_ID,
+ TXCAP_AUID_IETF_PRES_RULES_MIME_TYPE,
+ TXCAP_AUID_IETF_PRES_RULES_NS,
+ TXCAP_AUID_IETF_PRES_RULES_DOC,
+ tsk_false
+ },
+
+ /*== pidf-manipulation ==*/{
+ tauid_ietf_pres_rules,
+ TXCAP_AUID_IETF_PIDF_MANIPULATION_ID,
+ TXCAP_AUID_IETF_PIDF_MANIPULATION_MIME_TYPE,
+ TXCAP_AUID_IETF_PIDF_MANIPULATION_NS,
+ TXCAP_AUID_IETF_PIDF_MANIPULATION_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.pres-rules ==*/{
+ tauid_oma_pres_rules,
+ TXCAP_AUID_OMA_PRES_RULES_ID,
+ TXCAP_AUID_OMA_PRES_RULES_MIME_TYPE,
+ TXCAP_AUID_OMA_PRES_RULES_NS,
+ TXCAP_AUID_OMA_PRES_RULES_DOC,
+ tsk_false
+ },
+
+ /*== directory ==*/{
+ tauid_ietf_directory,
+ TXCAP_AUID_IETF_DIRECTORY_ID,
+ TXCAP_AUID_IETF_DIRECTORY_MIME_TYPE,
+ TXCAP_AUID_IETF_DIRECTORY_NS,
+ TXCAP_AUID_IETF_DIRECTORY_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.xcap-directory ==*/{
+ tauid_oma_directory,
+ TXCAP_AUID_OMA_DIRECTORY_ID,
+ TXCAP_AUID_OMA_DIRECTORY_MIME_TYPE,
+ TXCAP_AUID_OMA_DIRECTORY_NS,
+ TXCAP_AUID_OMA_DIRECTORY_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.pres-content ==*/{
+ tauid_oma_pres_content,
+ TXCAP_AUID_OMA_PRES_CONTENT_ID,
+ TXCAP_AUID_OMA_PRES_CONTENT_MIME_TYPE,
+ TXCAP_AUID_OMA_PRES_CONTENT_NS,
+ TXCAP_AUID_OMA_PRES_CONTENT_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.conv-history ==*/{
+ tauid_oma_conv_history,
+ TXCAP_AUID_OMA_CONV_HISTORY_ID,
+ TXCAP_AUID_OMA_CONV_HISTORY_MIME_TYPE,
+ TXCAP_AUID_OMA_CONV_HISTORY_NS,
+ TXCAP_AUID_OMA_CONV_HISTORY_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.deferred-list ==*/{
+ tauid_oma_deferred_list,
+ TXCAP_AUID_OMA_DEFERRED_LIST_ID,
+ TXCAP_AUID_OMA_DEFERRED_LIST_MIME_TYPE,
+ TXCAP_AUID_OMA_DEFERRED_LIST_NS,
+ TXCAP_AUID_OMA_DEFERRED_LIST_DOC,
+ tsk_false
+ },
+
+ /*== org.openmobilealliance.group-usage-list ==*/{
+ tauid_oma_shared_groups,
+ TXCAP_AUID_OMA_SHARED_GROUPS_ID,
+ TXCAP_AUID_OMA_SHARED_GROUPS_MIME_TYPE,
+ TXCAP_AUID_OMA_SHARED_GROUPS_NS,
+ TXCAP_AUID_OMA_SHARED_GROUPS_DOC,
+ tsk_false
+ },
};
txcap_auid_t* txcap_auid_create(txcap_auid_type_t type, const char* id, const char* mime_type, const char* ns, const char* document_name, tsk_bool_t is_global)
{
- return tsk_object_new(txcap_auid_def_t, type, id, mime_type, ns, document_name, is_global);
+ return tsk_object_new(txcap_auid_def_t, type, id, mime_type, ns, document_name, is_global);
}
/** Predicate function used to find an option by id.
*/
static int pred_find_auid_by_id(const tsk_list_item_t *item, const void *id)
{
- if(item && item->data){
- txcap_auid_t *auid = item->data;
- return tsk_stricmp(auid->id, (const char*)id);
- }
- return -1;
+ if(item && item->data) {
+ txcap_auid_t *auid = item->data;
+ return tsk_stricmp(auid->id, (const char*)id);
+ }
+ return -1;
}
@@ -179,34 +177,34 @@ static int pred_find_auid_by_id(const tsk_list_item_t *item, const void *id)
*/
int txcap_auids_init(txcap_auids_L_t** auids)
{
- size_t i;
- size_t count;
- if(!auids){
- TSK_DEBUG_ERROR("invalid parameter.");
- return -1;
- }
- else if(*auids){
- TSK_DEBUG_WARN("auids already initialized.");
- }
- else{
- *auids = tsk_list_create();
- }
-
- count = sizeof(__txcap_auids)/sizeof(auid_t);
- for(i = 0; i<count; i++){
- txcap_auid_t* auid = txcap_auid_create(__txcap_auids[i].type,
- __txcap_auids[i].id,
- __txcap_auids[i].mime_type,
- __txcap_auids[i].ns,
- __txcap_auids[i].document_name,
- __txcap_auids[i].global);
- tsk_list_push_back_data(*auids, (void**)&auid);
- }
-
- return 0;
+ size_t i;
+ size_t count;
+ if(!auids) {
+ TSK_DEBUG_ERROR("invalid parameter.");
+ return -1;
+ }
+ else if(*auids) {
+ TSK_DEBUG_WARN("auids already initialized.");
+ }
+ else {
+ *auids = tsk_list_create();
+ }
+
+ count = sizeof(__txcap_auids)/sizeof(auid_t);
+ for(i = 0; i<count; i++) {
+ txcap_auid_t* auid = txcap_auid_create(__txcap_auids[i].type,
+ __txcap_auids[i].id,
+ __txcap_auids[i].mime_type,
+ __txcap_auids[i].ns,
+ __txcap_auids[i].document_name,
+ __txcap_auids[i].global);
+ tsk_list_push_back_data(*auids, (void**)&auid);
+ }
+
+ return 0;
}
-/**
+/**
* Registers a new AUID. If the AUID already exist (case-insensitive comparison on the id),
* then it will be updated with the new supplied values.
* @param auids The destination list.
@@ -219,31 +217,32 @@ int txcap_auids_init(txcap_auids_L_t** auids)
*/
int txcap_auid_register(txcap_auids_L_t* auids, const char* id, const char* mime_type, const char* ns, const char* document_name, tsk_bool_t is_global)
{
- const tsk_list_item_t* item;
- int ret = -1;
-
- if(!auids || !id){
- return -1;
- }
-
- if((item = tsk_list_find_item_by_pred(auids, pred_find_auid_by_id, id))){
- tsk_strupdate(&((txcap_auid_t*)item->data)->mime_type, mime_type);
- tsk_strupdate(&((txcap_auid_t*)item->data)->ns, ns);
- tsk_strupdate(&((txcap_auid_t*)item->data)->document_name, document_name);
- ((txcap_auid_t*)item->data)->global = is_global;
- ret = 0;
- }
- else{
- txcap_auid_t* auid;
- if((auid = txcap_auid_create(tauid_dummy, id, mime_type, ns, document_name, is_global))){
- tsk_list_push_back_data(auids, (void**)&auid);
- ret = 0;
- }else{
- ret = -2;
- }
- }
-
- return ret;
+ const tsk_list_item_t* item;
+ int ret = -1;
+
+ if(!auids || !id) {
+ return -1;
+ }
+
+ if((item = tsk_list_find_item_by_pred(auids, pred_find_auid_by_id, id))) {
+ tsk_strupdate(&((txcap_auid_t*)item->data)->mime_type, mime_type);
+ tsk_strupdate(&((txcap_auid_t*)item->data)->ns, ns);
+ tsk_strupdate(&((txcap_auid_t*)item->data)->document_name, document_name);
+ ((txcap_auid_t*)item->data)->global = is_global;
+ ret = 0;
+ }
+ else {
+ txcap_auid_t* auid;
+ if((auid = txcap_auid_create(tauid_dummy, id, mime_type, ns, document_name, is_global))) {
+ tsk_list_push_back_data(auids, (void**)&auid);
+ ret = 0;
+ }
+ else {
+ ret = -2;
+ }
+ }
+
+ return ret;
}
/**
@@ -255,19 +254,19 @@ int txcap_auid_register(txcap_auids_L_t* auids, const char* id, const char* mime
*/
txcap_auid_t* txcap_auid_get_by_id(txcap_auids_L_t* auids, const char* id)
{
- //const txcap_auid_t* ret = tsk_null;
- const tsk_list_item_t* item;
-
- if(!auids){
- return tsk_null;
- }
-
- if((item = tsk_list_find_item_by_pred(auids, pred_find_auid_by_id, id))){
- return tsk_object_ref((void*)item->data);
- }
- else{
- return tsk_null;
- }
+ //const txcap_auid_t* ret = tsk_null;
+ const tsk_list_item_t* item;
+
+ if(!auids) {
+ return tsk_null;
+ }
+
+ if((item = tsk_list_find_item_by_pred(auids, pred_find_auid_by_id, id))) {
+ return tsk_object_ref((void*)item->data);
+ }
+ else {
+ return tsk_null;
+ }
}
@@ -276,50 +275,49 @@ txcap_auid_t* txcap_auid_get_by_id(txcap_auids_L_t* auids, const char* id)
//
static tsk_object_t* txcap_auid_ctor(tsk_object_t * self, va_list * app)
{
- txcap_auid_t *auid = self;
- if(auid){
- auid->type = va_arg(*app, txcap_auid_type_t);
- auid->id = tsk_strdup( va_arg(*app, const char*) );
- auid->mime_type = tsk_strdup( va_arg(*app, const char*) );
- auid->ns = tsk_strdup( va_arg(*app, const char*) );
- auid->document_name = tsk_strdup( va_arg(*app, const char*) );
- auid->global = va_arg(*app, tsk_bool_t);
- }
- return self;
+ txcap_auid_t *auid = self;
+ if(auid) {
+ auid->type = va_arg(*app, txcap_auid_type_t);
+ auid->id = tsk_strdup( va_arg(*app, const char*) );
+ auid->mime_type = tsk_strdup( va_arg(*app, const char*) );
+ auid->ns = tsk_strdup( va_arg(*app, const char*) );
+ auid->document_name = tsk_strdup( va_arg(*app, const char*) );
+ auid->global = va_arg(*app, tsk_bool_t);
+ }
+ return self;
}
static tsk_object_t* txcap_auid_dtor(tsk_object_t * self)
-{
- txcap_auid_t *auid = self;
- if(auid){
- TSK_FREE(auid->id);
- TSK_FREE(auid->mime_type);
- TSK_FREE(auid->ns);
- TSK_FREE(auid->document_name);
- }
-
- return self;
+{
+ txcap_auid_t *auid = self;
+ if(auid) {
+ TSK_FREE(auid->id);
+ TSK_FREE(auid->mime_type);
+ TSK_FREE(auid->ns);
+ TSK_FREE(auid->document_name);
+ }
+
+ return self;
}
static int txcap_auid_cmp(const tsk_object_t *_a1, const tsk_object_t *_a2)
{
- const txcap_auid_t *a1 = _a1;
- const txcap_auid_t *a2 = _a2;
-
- if(a1 && a2){
- return tsk_stricmp(a1->id, a2->id);
- }
- else{
- return -1;
- }
+ const txcap_auid_t *a1 = _a1;
+ const txcap_auid_t *a2 = _a2;
+
+ if(a1 && a2) {
+ return tsk_stricmp(a1->id, a2->id);
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t txcap_auid_def_s =
-{
- sizeof(txcap_auid_t),
- txcap_auid_ctor,
- txcap_auid_dtor,
- txcap_auid_cmp,
+static const tsk_object_def_t txcap_auid_def_s = {
+ sizeof(txcap_auid_t),
+ txcap_auid_ctor,
+ txcap_auid_dtor,
+ txcap_auid_cmp,
};
const tsk_object_def_t *txcap_auid_def_t = &txcap_auid_def_s;
diff --git a/tinyXCAP/src/txcap_document.c b/tinyXCAP/src/txcap_document.c
index 7c65a35..abc288d 100755
--- a/tinyXCAP/src/txcap_document.c
+++ b/tinyXCAP/src/txcap_document.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -62,23 +62,23 @@
*/
char* txcap_selector_get_document(const txcap_stack_handle_t* stack, const char* auid_id)
{
- char* ret = tsk_null;
- txcap_auid_t* auid;
+ char* ret = tsk_null;
+ txcap_auid_t* auid;
- const txcap_stack_t* xcap_stack = stack;
- if(xcap_stack && xcap_stack->auids && auid_id){
- if((auid = txcap_auid_get_by_id(xcap_stack->auids, auid_id))){
- ret = txcap_selector_get_document_2(xcap_stack->xcap_root, auid->id, auid->global? tsk_null: xcap_stack->xui, auid->document_name);
- TSK_OBJECT_SAFE_FREE(auid);
- }
- else{
- TSK_DEBUG_ERROR("Fail to find AUID with id %s.", auid_id);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter.");
- }
- return ret;
+ const txcap_stack_t* xcap_stack = stack;
+ if(xcap_stack && xcap_stack->auids && auid_id) {
+ if((auid = txcap_auid_get_by_id(xcap_stack->auids, auid_id))) {
+ ret = txcap_selector_get_document_2(xcap_stack->xcap_root, auid->id, auid->global? tsk_null: xcap_stack->xui, auid->document_name);
+ TSK_OBJECT_SAFE_FREE(auid);
+ }
+ else {
+ TSK_DEBUG_ERROR("Fail to find AUID with id %s.", auid_id);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter.");
+ }
+ return ret;
}
/**@ingroup txcap_selector_group
@@ -117,21 +117,21 @@ char* txcap_selector_get_document(const txcap_stack_handle_t* stack, const char*
*/
char* txcap_selector_get_document_2(const char* xcap_root, const char* auid_id, const char* xui, const char* doc_name)
{
- char* ret = tsk_null;
-
- if(!xcap_root || !auid_id || !doc_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ char* ret = tsk_null;
+
+ if(!xcap_root || !auid_id || !doc_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- if(!xui || tsk_striequals("global", xui)){
- /* xdm-root/auid-name/global/doc-name */
- tsk_sprintf(&ret, "%s/%s/global/%s", xcap_root, auid_id, doc_name);
- }
- else{
- /* xdm-root/auid-name/users/xui/doc-name */
- tsk_sprintf(&ret, "%s/%s/users/%s/%s", xcap_root, auid_id, xui, doc_name);
- }
+ if(!xui || tsk_striequals("global", xui)) {
+ /* xdm-root/auid-name/global/doc-name */
+ tsk_sprintf(&ret, "%s/%s/global/%s", xcap_root, auid_id, doc_name);
+ }
+ else {
+ /* xdm-root/auid-name/users/xui/doc-name */
+ tsk_sprintf(&ret, "%s/%s/users/%s/%s", xcap_root, auid_id, xui, doc_name);
+ }
- return ret;
+ return ret;
} \ No newline at end of file
diff --git a/tinyXCAP/src/txcap_node.c b/tinyXCAP/src/txcap_node.c
index 62f5ae0..ee1963f 100755
--- a/tinyXCAP/src/txcap_node.c
+++ b/tinyXCAP/src/txcap_node.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -55,14 +55,14 @@ char* node = txcap_selector_get_node("resource-lists",
*/
char* txcap_selector_get_node(const char* auid_id, ...)
{
- char* ret = tsk_null;
- va_list ap;
+ char* ret = tsk_null;
+ va_list ap;
- va_start(ap, auid_id);
- ret = txcap_selector_get_node_2(auid_id, &ap);
- va_end(ap);
+ va_start(ap, auid_id);
+ ret = txcap_selector_get_node_2(auid_id, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
/**@ingroup txcap_selector_group
@@ -79,77 +79,76 @@ char* txcap_selector_get_node(const char* auid_id, ...)
*/
char* txcap_selector_get_node_2(const char* auid_id, va_list* app)
{
- char* ret = tsk_null;
- char* namespace = tsk_null;
- tsk_buffer_t* buffer = tsk_buffer_create_null();
- txcap_selector_param_type_t step;
+ char* ret = tsk_null;
+ char* namespace = tsk_null;
+ tsk_buffer_t* buffer = tsk_buffer_create_null();
+ txcap_selector_param_type_t step;
- while((step = va_arg(*app, txcap_selector_param_type_t)) != xcapp_node_null){
- switch(step){
- case xcapp_node_name:
- { /* (const char*)QNAME_STR */
- const char* QNAME_STR = va_arg(*app, const char*);
- if(tsk_buffer_append_2(buffer, "/%s", QNAME_STR)){
- goto bail;
- }
- break;
- }
- case xcapp_node_pos:
- { /* (const char*)QNAME_STR, (unsigned int)POS_UINT */
- const char* QNAME_STR = va_arg(*app, const char*);
- unsigned int POS_UINT = va_arg(*app, unsigned int);
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
- QNAME_STR, POS_UINT);
- break;
- }
- case xcapp_node_attribute:
- { /* (const char*)QNAME_STR, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR */
- const char* QNAME_STR = va_arg(*app, const char*);
- const char* ATT_QNAME_STR = va_arg(*app, const char*);
- const char* ATT_VALUE_STR = va_arg(*app, const char*);
- tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
- QNAME_STR, ATT_QNAME_STR, ATT_VALUE_STR);
- break;
- }
- case xcapp_node_pos_n_attribute:
- { /* (const char*)QNAME_STR, (unsigned int)POS_UINT, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR */
- const char* QNAME_STR = va_arg(*app, const char*);
- unsigned int POS_UINT = va_arg(*app, unsigned int);
- const char* ATT_QNAME_STR = va_arg(*app, const char*);
- const char* ATT_VALUE_STR = va_arg(*app, const char*);
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
- QNAME_STR, POS_UINT, ATT_QNAME_STR, ATT_VALUE_STR);
- break;
- }
- case xcapp_node_namespace:
- { /* (const char*)PREFIX_STR, (const char*)VALUE_STR */
- const char* PREFIX_STR = va_arg(*app, const char*);
- const char* VALUE_STR = va_arg(*app, const char*);
- char* temp = tsk_null;
- tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
- namespace?"":"%3F",PREFIX_STR, VALUE_STR);
- tsk_strcat(&namespace, temp);
- TSK_FREE(temp);
- break;
- }
- default:
- {
- TSK_DEBUG_ERROR("NOT SUPPORTED.");
- goto bail;
- }
- } /* switch */
- } /* while */
+ while((step = va_arg(*app, txcap_selector_param_type_t)) != xcapp_node_null) {
+ switch(step) {
+ case xcapp_node_name: {
+ /* (const char*)QNAME_STR */
+ const char* QNAME_STR = va_arg(*app, const char*);
+ if(tsk_buffer_append_2(buffer, "/%s", QNAME_STR)) {
+ goto bail;
+ }
+ break;
+ }
+ case xcapp_node_pos: {
+ /* (const char*)QNAME_STR, (unsigned int)POS_UINT */
+ const char* QNAME_STR = va_arg(*app, const char*);
+ unsigned int POS_UINT = va_arg(*app, unsigned int);
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
+ QNAME_STR, POS_UINT);
+ break;
+ }
+ case xcapp_node_attribute: {
+ /* (const char*)QNAME_STR, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR */
+ const char* QNAME_STR = va_arg(*app, const char*);
+ const char* ATT_QNAME_STR = va_arg(*app, const char*);
+ const char* ATT_VALUE_STR = va_arg(*app, const char*);
+ tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
+ QNAME_STR, ATT_QNAME_STR, ATT_VALUE_STR);
+ break;
+ }
+ case xcapp_node_pos_n_attribute: {
+ /* (const char*)QNAME_STR, (unsigned int)POS_UINT, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR */
+ const char* QNAME_STR = va_arg(*app, const char*);
+ unsigned int POS_UINT = va_arg(*app, unsigned int);
+ const char* ATT_QNAME_STR = va_arg(*app, const char*);
+ const char* ATT_VALUE_STR = va_arg(*app, const char*);
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
+ QNAME_STR, POS_UINT, ATT_QNAME_STR, ATT_VALUE_STR);
+ break;
+ }
+ case xcapp_node_namespace: {
+ /* (const char*)PREFIX_STR, (const char*)VALUE_STR */
+ const char* PREFIX_STR = va_arg(*app, const char*);
+ const char* VALUE_STR = va_arg(*app, const char*);
+ char* temp = tsk_null;
+ tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
+ namespace?"":"%3F",PREFIX_STR, VALUE_STR);
+ tsk_strcat(&namespace, temp);
+ TSK_FREE(temp);
+ break;
+ }
+ default: {
+ TSK_DEBUG_ERROR("NOT SUPPORTED.");
+ goto bail;
+ }
+ } /* switch */
+ } /* while */
- /* append the namespace */
- if(namespace){
- tsk_buffer_append(buffer, namespace, tsk_strlen(namespace));
- TSK_FREE(namespace);
- }
+ /* append the namespace */
+ if(namespace) {
+ tsk_buffer_append(buffer, namespace, tsk_strlen(namespace));
+ TSK_FREE(namespace);
+ }
bail:
- if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)){
- ret = tsk_strndup(TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
- }
- TSK_OBJECT_SAFE_FREE(buffer);
- return ret;
+ if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)) {
+ ret = tsk_strndup(TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+ return ret;
}
diff --git a/tinyXCAP/src/txcap_selector.c b/tinyXCAP/src/txcap_selector.c
index 01beb0a..7d98c3c 100755
--- a/tinyXCAP/src/txcap_selector.c
+++ b/tinyXCAP/src/txcap_selector.c
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,66 +38,66 @@
*/
char* __txcap_selector_get_url(const txcap_stack_handle_t* stack, const char* auid_id, va_list* app)
{
- char* ret = tsk_null;
- char* node = tsk_null;
- if(!stack && !auid_id){
- goto bail;
- }
-
- /* ==document== */
- if(!(ret = txcap_selector_get_document(stack, auid_id))){
- TSK_DEBUG_ERROR("Failed to compute XCAP document URL.");
- goto bail;
- }
-
- /* ==node== */
- if((node = txcap_selector_get_node_2(auid_id, app))){
- /* append node root */
- char* temp = tsk_null;
- tsk_sprintf(&temp, "/~~/%s", auid_id);
- tsk_strcat(&ret, temp);
- /* append node */
- tsk_strcat(&ret, node);
- /* free */
- TSK_FREE(temp);
- TSK_FREE(node);
- }
-
+ char* ret = tsk_null;
+ char* node = tsk_null;
+ if(!stack && !auid_id) {
+ goto bail;
+ }
+
+ /* ==document== */
+ if(!(ret = txcap_selector_get_document(stack, auid_id))) {
+ TSK_DEBUG_ERROR("Failed to compute XCAP document URL.");
+ goto bail;
+ }
+
+ /* ==node== */
+ if((node = txcap_selector_get_node_2(auid_id, app))) {
+ /* append node root */
+ char* temp = tsk_null;
+ tsk_sprintf(&temp, "/~~/%s", auid_id);
+ tsk_strcat(&ret, temp);
+ /* append node */
+ tsk_strcat(&ret, node);
+ /* free */
+ TSK_FREE(temp);
+ TSK_FREE(node);
+ }
+
bail:
- return ret;
+ return ret;
}
/** Internal function
*/
char* __txcap_selector_get_url_2(const char* xcap_root, const char* auid_id, const char* xui, const char* doc_name, va_list* app)
{
- char* ret = tsk_null;
- char* node = tsk_null;
- if(!xcap_root && !auid_id){
- goto bail;
- }
-
- /* ==document== */
- if(!(ret = txcap_selector_get_document_2(xcap_root, auid_id, xui, doc_name))){
- TSK_DEBUG_ERROR("Failed to compute XCAP document URL.");
- goto bail;
- }
-
- /* ==node== */
- if((node = txcap_selector_get_node_2(auid_id, app))){
- /* append node root */
- char* temp = tsk_null;
- tsk_sprintf(&temp, "/~~/%s", auid_id);
- tsk_strcat(&ret, temp);
- /* append node */
- tsk_strcat(&ret, node);
- /* free */
- TSK_FREE(temp);
- TSK_FREE(node);
- }
-
+ char* ret = tsk_null;
+ char* node = tsk_null;
+ if(!xcap_root && !auid_id) {
+ goto bail;
+ }
+
+ /* ==document== */
+ if(!(ret = txcap_selector_get_document_2(xcap_root, auid_id, xui, doc_name))) {
+ TSK_DEBUG_ERROR("Failed to compute XCAP document URL.");
+ goto bail;
+ }
+
+ /* ==node== */
+ if((node = txcap_selector_get_node_2(auid_id, app))) {
+ /* append node root */
+ char* temp = tsk_null;
+ tsk_sprintf(&temp, "/~~/%s", auid_id);
+ tsk_strcat(&ret, temp);
+ /* append node */
+ tsk_strcat(&ret, node);
+ /* free */
+ TSK_FREE(temp);
+ TSK_FREE(node);
+ }
+
bail:
- return ret;
+ return ret;
}
/**@ingroup txcap_selector_group
@@ -126,14 +126,14 @@ TSK_FREE(urlstring);
*/
char* txcap_selector_get_url(const txcap_stack_handle_t* stack, const char* auid_id, ...)
{
- char* ret;
- va_list ap;
-
- va_start(ap, auid_id);
- ret = __txcap_selector_get_url(stack, auid_id, &ap);
- va_end(ap);
-
- return ret;
+ char* ret;
+ va_list ap;
+
+ va_start(ap, auid_id);
+ ret = __txcap_selector_get_url(stack, auid_id, &ap);
+ va_end(ap);
+
+ return ret;
}
/**@ingroup txcap_selector_group
@@ -156,12 +156,12 @@ char* txcap_selector_get_url(const txcap_stack_handle_t* stack, const char* auid
*/
char* txcap_selector_get_url_2(const char* xcap_root, const char* auid_id, const char* xui, const char* doc_name, ...)
{
- char* ret;
- va_list ap;
-
- va_start(ap, doc_name);
- ret = __txcap_selector_get_url_2(xcap_root, auid_id, xui, doc_name, &ap);
- va_end(ap);
-
- return ret;
+ char* ret;
+ va_list ap;
+
+ va_start(ap, doc_name);
+ ret = __txcap_selector_get_url_2(xcap_root, auid_id, xui, doc_name, &ap);
+ va_end(ap);
+
+ return ret;
}
diff --git a/tinyXCAP/test/stdafx.c b/tinyXCAP/test/stdafx.c
index e0ce978..3469d19 100755
--- a/tinyXCAP/test/stdafx.c
+++ b/tinyXCAP/test/stdafx.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyXCAP/test/stdafx.h b/tinyXCAP/test/stdafx.h
index 9169a19..c84adbc 100755
--- a/tinyXCAP/test/stdafx.h
+++ b/tinyXCAP/test/stdafx.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyXCAP/test/targetver.h b/tinyXCAP/test/targetver.h
index a1a8470..47d031d 100755
--- a/tinyXCAP/test/targetver.h
+++ b/tinyXCAP/test/targetver.h
@@ -3,8 +3,8 @@
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
diff --git a/tinyXCAP/test/test.c b/tinyXCAP/test/test.c
index c2930f1..4e370b2 100755
--- a/tinyXCAP/test/test.c
+++ b/tinyXCAP/test/test.c
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -50,30 +50,30 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
- tnet_startup();
+ tnet_startup();
- /* Print copyright information */
- printf("Doubango Project\nCopyright (C) 2009 Mamadou Diop \n\n");
+ /* Print copyright information */
+ printf("Doubango Project\nCopyright (C) 2009 Mamadou Diop \n\n");
#if LOOP
- while(1)
+ while(1)
#endif
- {
- /* XCAP document/node selector */
+ {
+ /* XCAP document/node selector */
#if RUN_TEST_SELECTOR || RUN_TEST_ALL
- test_selector();
+ test_selector();
#endif
- /* XCAP stack */
+ /* XCAP stack */
#if RUN_TEST_STACK || RUN_TEST_ALL
- test_stack();
+ test_stack();
#endif
-
-
- }
-
- tnet_cleanup();
- return 0;
+
+ }
+
+ tnet_cleanup();
+
+ return 0;
}
diff --git a/tinyXCAP/test/test_selector.h b/tinyXCAP/test/test_selector.h
index aa332f2..66f1246 100755
--- a/tinyXCAP/test/test_selector.h
+++ b/tinyXCAP/test/test_selector.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -24,132 +24,132 @@
void test_selector()
{
- txcap_stack_handle_t* stack = tsk_null;
- char* urlstring;
-
- stack = txcap_stack_create(tsk_null, XUI, PASSWORD, XCAP_ROOT,
- TXCAP_STACK_SET_NULL());
-
- /* add user auids */
- txcap_stack_set(stack,
- TXCAP_STACK_SET_AUID("xcap-caps2", "application/xcap-caps2+xml", "urn:ietf:params:xml:ns:xcap-caps2", "index2", tsk_true),
- TXCAP_STACK_SET_AUID("resource-lists2", "application/resource-lists+xml2", "urn:ietf:params:xml:ns:resource-lists2", "index2", tsk_false),
-
- TXCAP_STACK_SET_NULL()); /* mandatory */
-
- /* IETF server capabilities */
- urlstring = txcap_selector_get_url(stack, "xcap-caps",
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("Document('xcap-caps') = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* My custom xcap-caps */
- urlstring = txcap_selector_get_url(stack, "xcap-caps2",
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("Document('xcap-caps2') = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* IETF resource-lists */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("Document('resource-lists') = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* My custom resource-lists */
- urlstring = txcap_selector_get_url(stack, "resource-lists2",
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("Document('resource-lists2') = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Full custom resource-lists */
- urlstring = txcap_selector_get_document_2(XCAP_ROOT, "resource-lists3", XUI, "index3");
- TSK_DEBUG_INFO("Document('resource-lists2') = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve 'rcs' list
- * Expected node: /resource-lists/list[@name="rcs"]
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("'rcs' list = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve the 2nd list
- * Expected node: /resource-lists/list[2]
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_POS("list", 2),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("2nd list = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve the 4th list (wildcard)
- * Expected node: /resource-lists/*[4]
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_POS("*", 4),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("4th list (wildcard) = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve the entry with: uri='sip:bob@example.com' and list='rcs'
- * Expected node: /resource-lists/list[@name="rcs"]/entry[@uri="sip:bob@example.com"]
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("By uri and list = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve bob's display-name
- * Expected node: /resource-lists/list[@name="rcs"]/entry[@uri="sip:bob@example.com"]/display-name
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("bob's display-name = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve the display-name of the fisrt entry from the 'rcs' list
- * Expected node: /resource-lists/list[@name="rcs"]/entry[1]/display-name
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_POS("entry", 1),
- TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("display-name of 1st entry = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Retrieve the entry with: uri='sip:bob@example.com' from position 23 from 'rcs' list
- * Expected node: /resource-lists/list[@name="rcs"]/entry[23][@uri="sip:bob@example.com"]
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE("entry", 23, "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("bob at pos 23 from 'rcs' = %s\n", urlstring);
- TSK_FREE(urlstring);
-
- /* Namespace test
- * Expected node: /foo/a:bar/b:baz?xmlns(a=urn:test:namespace1-uri)xmlns(b=urn:test:namespace2-uri)
- */
- urlstring = txcap_selector_get_url(stack, "resource-lists",
- TXCAP_SELECTOR_NODE_SET_NAME("foo"),
- TXCAP_SELECTOR_NODE_SET_NAME("a:bar"),
- TXCAP_SELECTOR_NODE_SET_NAME("b:baz"),
- TXCAP_SELECTOR_NODE_SET_NAMESPACE("a", "urn:namespace1-uri"),
- TXCAP_SELECTOR_NODE_SET_NAMESPACE("b", "urn:namespace2-uri"),
- TXCAP_SELECTOR_NODE_SET_NULL());
- TSK_DEBUG_INFO("Namespace test = %s\n", urlstring);
- TSK_FREE(urlstring);
-
-
- TSK_OBJECT_SAFE_FREE(stack);
+ txcap_stack_handle_t* stack = tsk_null;
+ char* urlstring;
+
+ stack = txcap_stack_create(tsk_null, XUI, PASSWORD, XCAP_ROOT,
+ TXCAP_STACK_SET_NULL());
+
+ /* add user auids */
+ txcap_stack_set(stack,
+ TXCAP_STACK_SET_AUID("xcap-caps2", "application/xcap-caps2+xml", "urn:ietf:params:xml:ns:xcap-caps2", "index2", tsk_true),
+ TXCAP_STACK_SET_AUID("resource-lists2", "application/resource-lists+xml2", "urn:ietf:params:xml:ns:resource-lists2", "index2", tsk_false),
+
+ TXCAP_STACK_SET_NULL()); /* mandatory */
+
+ /* IETF server capabilities */
+ urlstring = txcap_selector_get_url(stack, "xcap-caps",
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("Document('xcap-caps') = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* My custom xcap-caps */
+ urlstring = txcap_selector_get_url(stack, "xcap-caps2",
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("Document('xcap-caps2') = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* IETF resource-lists */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("Document('resource-lists') = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* My custom resource-lists */
+ urlstring = txcap_selector_get_url(stack, "resource-lists2",
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("Document('resource-lists2') = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Full custom resource-lists */
+ urlstring = txcap_selector_get_document_2(XCAP_ROOT, "resource-lists3", XUI, "index3");
+ TSK_DEBUG_INFO("Document('resource-lists2') = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve 'rcs' list
+ * Expected node: /resource-lists/list[@name="rcs"]
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("'rcs' list = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve the 2nd list
+ * Expected node: /resource-lists/list[2]
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_POS("list", 2),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("2nd list = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve the 4th list (wildcard)
+ * Expected node: /resource-lists/*[4]
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_POS("*", 4),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("4th list (wildcard) = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve the entry with: uri='sip:bob@example.com' and list='rcs'
+ * Expected node: /resource-lists/list[@name="rcs"]/entry[@uri="sip:bob@example.com"]
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("By uri and list = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve bob's display-name
+ * Expected node: /resource-lists/list[@name="rcs"]/entry[@uri="sip:bob@example.com"]/display-name
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("bob's display-name = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve the display-name of the fisrt entry from the 'rcs' list
+ * Expected node: /resource-lists/list[@name="rcs"]/entry[1]/display-name
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_POS("entry", 1),
+ TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("display-name of 1st entry = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Retrieve the entry with: uri='sip:bob@example.com' from position 23 from 'rcs' list
+ * Expected node: /resource-lists/list[@name="rcs"]/entry[23][@uri="sip:bob@example.com"]
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE("entry", 23, "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("bob at pos 23 from 'rcs' = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+ /* Namespace test
+ * Expected node: /foo/a:bar/b:baz?xmlns(a=urn:test:namespace1-uri)xmlns(b=urn:test:namespace2-uri)
+ */
+ urlstring = txcap_selector_get_url(stack, "resource-lists",
+ TXCAP_SELECTOR_NODE_SET_NAME("foo"),
+ TXCAP_SELECTOR_NODE_SET_NAME("a:bar"),
+ TXCAP_SELECTOR_NODE_SET_NAME("b:baz"),
+ TXCAP_SELECTOR_NODE_SET_NAMESPACE("a", "urn:namespace1-uri"),
+ TXCAP_SELECTOR_NODE_SET_NAMESPACE("b", "urn:namespace2-uri"),
+ TXCAP_SELECTOR_NODE_SET_NULL());
+ TSK_DEBUG_INFO("Namespace test = %s\n", urlstring);
+ TSK_FREE(urlstring);
+
+
+ TSK_OBJECT_SAFE_FREE(stack);
}
#endif /* _TEST_SELECTOR_H */
diff --git a/tinyXCAP/test/test_stack.h b/tinyXCAP/test/test_stack.h
index e34b9a5..8083ac0 100755
--- a/tinyXCAP/test/test_stack.h
+++ b/tinyXCAP/test/test_stack.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -31,293 +31,289 @@
int test_stack_callback(const thttp_event_t *httpevent)
{
- switch(httpevent->type){
- case thttp_event_message: /* New HTTP message */
- {
- if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)){
- const thttp_header_ETag_t* etag;
- TSK_DEBUG_INFO("=== %d ==> %s", THTTP_RESPONSE_CODE(httpevent->message), THTTP_MESSAGE_CONTENT(httpevent->message));
- // You can use
- if((etag = (const thttp_header_ETag_t*)thttp_message_get_header(httpevent->message, thttp_htype_ETag))){
- TSK_DEBUG_INFO("Etag=%s", etag->value);
- }
- }
- else{
-
- }
- break;
- }
-
- case thttp_event_auth_failed:
- {
- TSK_DEBUG_INFO("=== auth failed.");
- break;
- }
-
- case thttp_event_closed: /* HTTP connection closed (informational) */
- {
- TSK_DEBUG_INFO("=== closed.");
- break;
- }
-
- default:
- {
- break;
- }
- }
- return 0;
+ switch(httpevent->type) {
+ case thttp_event_message: { /* New HTTP message */
+ if(THTTP_MESSAGE_IS_RESPONSE(httpevent->message)) {
+ const thttp_header_ETag_t* etag;
+ TSK_DEBUG_INFO("=== %d ==> %s", THTTP_RESPONSE_CODE(httpevent->message), THTTP_MESSAGE_CONTENT(httpevent->message));
+ // You can use
+ if((etag = (const thttp_header_ETag_t*)thttp_message_get_header(httpevent->message, thttp_htype_ETag))) {
+ TSK_DEBUG_INFO("Etag=%s", etag->value);
+ }
+ }
+ else {
+
+ }
+ break;
+ }
+
+ case thttp_event_auth_failed: {
+ TSK_DEBUG_INFO("=== auth failed.");
+ break;
+ }
+
+ case thttp_event_closed: { /* HTTP connection closed (informational) */
+ TSK_DEBUG_INFO("=== closed.");
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
+ return 0;
}
void test_stack()
{
- txcap_stack_handle_t* stack = tsk_null;
- int ret;
+ txcap_stack_handle_t* stack = tsk_null;
+ int ret;
- stack = txcap_stack_create(test_stack_callback, XUI, PASSWORD, XCAP_ROOT,
+ stack = txcap_stack_create(test_stack_callback, XUI, PASSWORD, XCAP_ROOT,
#if defined(ANDROID)
- TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_LOCAL_IP, "10.0.2.15"),
+ TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_LOCAL_IP, "10.0.2.15"),
#endif
-
- // stack-level options
- TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
-
- // stack-level headers
- TXCAP_STACK_SET_HEADER("Connection", "Keep-Alive"),
- TXCAP_STACK_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
- TXCAP_STACK_SET_HEADER("X-3GPP-Intended-Identity", XUI),
-
- TXCAP_STACK_SET_NULL());
-
- if((ret = txcap_stack_start(stack))){
- goto bail;
- }
-
- /* add user auids */
- txcap_stack_set(stack,
- // add new AUIDs
- TXCAP_STACK_SET_AUID("xcap-caps2", "application/xcap-caps2+xml", "urn:ietf:params:xml:ns:xcap-caps2", "index2", tsk_true),
- TXCAP_STACK_SET_AUID("resource-lists2", "application/resource-lists+xml2", "urn:ietf:params:xml:ns:resource-lists2", "index2", tsk_false),
-
- TXCAP_STACK_SET_NULL()); /* mandatory */
-
- //== get xcap-caps document
- ret = txcap_action_fetch_document(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // action-level headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // selector
- TXCAP_ACTION_SET_SELECTOR("xcap-caps",
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-/*
- //== get resource-lists document
- ret = txcap_action_fetch_document(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- //action-level headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== get 'rcs' list
- ret = txcap_action_fetch_element(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // action-level headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve the 2nd list
- ret = txcap_action_fetch_element(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_POS("list", 2),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve the 4th list (wildcard)
- ret = txcap_action_fetch_element(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_POS("*", 4),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve the entry with: uri=XUI and list='rcs'
- ret = txcap_action_fetch_element(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve XUI's display-name ==> 404
- ret = txcap_action_fetch_attribute(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve the display-name of the fisrt entry from the 'rcs' list ==> 404
- ret = txcap_action_fetch_attribute(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_POS("entry", 1),
- TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Retrieve the entry with: uri='XUI' from position 1 from 'rcs' list
- ret = txcap_action_fetch_element(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- // headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // action-level selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
- TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE("entry", 1, "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
-
- getchar();
-
- //== Add newlist
- ret = txcap_action_create_element(stack,
- // selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // payload
- TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_LIST, strlen(PAYLOAD_LIST)),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
- getchar();
-
- //== Add entry
- ret = txcap_action_create_element(stack,
- // selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // payload
- TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_ENTRY, strlen(PAYLOAD_ENTRY)),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
- getchar();
-
- //== Add entry using dummy URI
- ret = txcap_action_create_element(stack,
- // dummy uri
- TXCAP_ACTION_SET_REQUEST_URI("http://doubango.org/services/dummy/"XUI),
- // payload
- TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_ENTRY, strlen(PAYLOAD_ENTRY)),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
- getchar();
-
- //== Delete entry
- ret = txcap_action_delete_element(stack,
- // selector
- TXCAP_ACTION_SET_SELECTOR("resource-lists",
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
- TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
- getchar();
-
-
-
-
- ret = txcap_action_fetch_document(stack,
- // action-level options
- TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
- //action-level headers
- TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
- // selector
- TXCAP_ACTION_SET_SELECTOR("org.openmobilealliance.pres-content",
- TXCAP_SELECTOR_NODE_SET_NULL()),
- // ends parameters
- TXCAP_ACTION_SET_NULL()
- );
- */
+
+ // stack-level options
+ TXCAP_STACK_SET_OPTION(TXCAP_STACK_OPTION_TIMEOUT, "6000"),
+
+ // stack-level headers
+ TXCAP_STACK_SET_HEADER("Connection", "Keep-Alive"),
+ TXCAP_STACK_SET_HEADER("User-Agent", "XDM-client/OMA1.1"),
+ TXCAP_STACK_SET_HEADER("X-3GPP-Intended-Identity", XUI),
+
+ TXCAP_STACK_SET_NULL());
+
+ if((ret = txcap_stack_start(stack))) {
+ goto bail;
+ }
+
+ /* add user auids */
+ txcap_stack_set(stack,
+ // add new AUIDs
+ TXCAP_STACK_SET_AUID("xcap-caps2", "application/xcap-caps2+xml", "urn:ietf:params:xml:ns:xcap-caps2", "index2", tsk_true),
+ TXCAP_STACK_SET_AUID("resource-lists2", "application/resource-lists+xml2", "urn:ietf:params:xml:ns:resource-lists2", "index2", tsk_false),
+
+ TXCAP_STACK_SET_NULL()); /* mandatory */
+
+ //== get xcap-caps document
+ ret = txcap_action_fetch_document(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // action-level headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("xcap-caps",
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+ /*
+ //== get resource-lists document
+ ret = txcap_action_fetch_document(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ //action-level headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== get 'rcs' list
+ ret = txcap_action_fetch_element(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // action-level headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve the 2nd list
+ ret = txcap_action_fetch_element(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_POS("list", 2),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve the 4th list (wildcard)
+ ret = txcap_action_fetch_element(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_POS("*", 4),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve the entry with: uri=XUI and list='rcs'
+ ret = txcap_action_fetch_element(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve XUI's display-name ==> 404
+ ret = txcap_action_fetch_attribute(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve the display-name of the fisrt entry from the 'rcs' list ==> 404
+ ret = txcap_action_fetch_attribute(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_POS("entry", 1),
+ TXCAP_SELECTOR_NODE_SET_NAME("display-name"),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Retrieve the entry with: uri='XUI' from position 1 from 'rcs' list
+ ret = txcap_action_fetch_element(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ // headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // action-level selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "rcs"),
+ TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE("entry", 1, "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+
+ getchar();
+
+ //== Add newlist
+ ret = txcap_action_create_element(stack,
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // payload
+ TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_LIST, strlen(PAYLOAD_LIST)),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+ getchar();
+
+ //== Add entry
+ ret = txcap_action_create_element(stack,
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // payload
+ TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_ENTRY, strlen(PAYLOAD_ENTRY)),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+ getchar();
+
+ //== Add entry using dummy URI
+ ret = txcap_action_create_element(stack,
+ // dummy uri
+ TXCAP_ACTION_SET_REQUEST_URI("http://doubango.org/services/dummy/"XUI),
+ // payload
+ TXCAP_ACTION_SET_PAYLOAD(PAYLOAD_ENTRY, strlen(PAYLOAD_ENTRY)),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+ getchar();
+
+ //== Delete entry
+ ret = txcap_action_delete_element(stack,
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("resource-lists",
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("list", "name", "newlist"),
+ TXCAP_SELECTOR_NODE_SET_ATTRIBUTE("entry", "uri", XUI),
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+ getchar();
+
+
+
+
+ ret = txcap_action_fetch_document(stack,
+ // action-level options
+ TXCAP_ACTION_SET_OPTION(TXCAP_ACTION_OPTION_TIMEOUT, "6000"),
+ //action-level headers
+ TXCAP_ACTION_SET_HEADER("Pragma", "No-Cache"),
+ // selector
+ TXCAP_ACTION_SET_SELECTOR("org.openmobilealliance.pres-content",
+ TXCAP_SELECTOR_NODE_SET_NULL()),
+ // ends parameters
+ TXCAP_ACTION_SET_NULL()
+ );
+ */
bail:
- getchar();
-
+ getchar();
+
- TSK_OBJECT_SAFE_FREE(stack);
+ TSK_OBJECT_SAFE_FREE(stack);
}
#endif /* _TEST_STACK_H */
OpenPOWER on IntegriCloud